mirror of
https://github.com/langgenius/dify.git
synced 2026-05-04 01:18:05 +08:00
fix: type
This commit is contained in:
@ -1,7 +1,22 @@
|
||||
import { create } from 'zustand'
|
||||
import type { PluginDetail } from '../types'
|
||||
import type {
|
||||
ParametersSchema,
|
||||
PluginDeclaration,
|
||||
PluginDetail,
|
||||
PluginTriggerSubscriptionConstructor,
|
||||
} from '../types'
|
||||
|
||||
export type SimpleDetail = Pick<PluginDetail, 'plugin_id' | 'declaration' | 'name' | 'plugin_unique_identifier' | 'id'> & { provider: string }
|
||||
type TriggerDeclarationSummary = {
|
||||
subscription_schema?: ParametersSchema[]
|
||||
subscription_constructor?: PluginTriggerSubscriptionConstructor | null
|
||||
}
|
||||
|
||||
export type SimpleDetail = Pick<PluginDetail, 'plugin_id' | 'name' | 'plugin_unique_identifier' | 'id'> & {
|
||||
provider: string
|
||||
declaration: Partial<Omit<PluginDeclaration, 'trigger'>> & {
|
||||
trigger?: TriggerDeclarationSummary
|
||||
}
|
||||
}
|
||||
|
||||
type Shape = {
|
||||
detail: SimpleDetail | undefined
|
||||
|
||||
@ -139,7 +139,7 @@ export const CommonCreateModal = ({ onClose, createType, builder }: Props) => {
|
||||
const { mutate: buildSubscription, isPending: isBuilding } = useBuildTriggerSubscription()
|
||||
const { mutate: updateBuilder } = useUpdateTriggerSubscriptionBuilder()
|
||||
|
||||
const manualPropertiesSchema = detail?.declaration.trigger.subscription_schema || [] // manual
|
||||
const manualPropertiesSchema = detail?.declaration?.trigger?.subscription_schema || [] // manual
|
||||
const manualPropertiesFormRef = React.useRef<FormRefObject>(null)
|
||||
|
||||
const subscriptionFormRef = React.useRef<FormRefObject>(null)
|
||||
|
||||
Reference in New Issue
Block a user