mirror of
https://github.com/langgenius/dify.git
synced 2026-07-22 19:48:36 +08:00
33 lines
796 B
TypeScript
33 lines
796 B
TypeScript
import type {
|
|
ParametersSchema,
|
|
PluginDeclaration,
|
|
PluginDetail,
|
|
PluginTriggerSubscriptionConstructor,
|
|
} from '../types'
|
|
import { create } from 'zustand'
|
|
|
|
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
|
|
setDetail: (detail?: SimpleDetail) => void
|
|
}
|
|
|
|
export const usePluginStore = create<Shape>((set) => ({
|
|
detail: undefined,
|
|
setDetail: (detail?: SimpleDetail) => set({ detail }),
|
|
}))
|