From ed6bb121bb5868952c07fe5e19150fdf56f43d9c Mon Sep 17 00:00:00 2001 From: zhsama Date: Thu, 30 Oct 2025 16:16:55 +0800 Subject: [PATCH] fix: update types --- .../trigger/event-detail-drawer.tsx | 2 +- web/app/components/plugins/types.ts | 17 ++++++++++++----- .../components/workflow/block-selector/types.ts | 2 +- web/service/use-triggers.ts | 4 +++- 4 files changed, 17 insertions(+), 8 deletions(-) diff --git a/web/app/components/plugins/plugin-detail-panel/trigger/event-detail-drawer.tsx b/web/app/components/plugins/plugin-detail-panel/trigger/event-detail-drawer.tsx index e241fadb8a..2083f34263 100644 --- a/web/app/components/plugins/plugin-detail-panel/trigger/event-detail-drawer.tsx +++ b/web/app/components/plugins/plugin-detail-panel/trigger/event-detail-drawer.tsx @@ -17,7 +17,7 @@ import { import type { TFunction } from 'i18next' import type { FC } from 'react' import { useTranslation } from 'react-i18next' -import type { TriggerEvent } from '../../types' +import type { TriggerEvent } from '@/app/components/plugins/types' type EventDetailDrawerProps = { eventInfo: TriggerEvent diff --git a/web/app/components/plugins/types.ts b/web/app/components/plugins/types.ts index 8d42e6787e..d9659df3ad 100644 --- a/web/app/components/plugins/types.ts +++ b/web/app/components/plugins/types.ts @@ -4,6 +4,7 @@ import type { Locale } from '@/i18n-config' import type { AgentFeature } from '@/app/components/workflow/nodes/agent/types' import type { AutoUpdateConfig } from './reference-setting-modal/auto-update-setting/types' import type { FormTypeEnum } from '../base/form/types' +import type { TypeWithI18N } from '@/app/components/base/form/types' export enum PluginCategoryEnum { tool = 'tool', @@ -160,7 +161,7 @@ export type PropertiesSchema = { export type TriggerEventParameter = { name: string - label: Record + label: TypeWithI18N type: string auto_generate: any template: any @@ -173,15 +174,21 @@ export type TriggerEventParameter = { precision: any options?: Array<{ value: string - label: Record + label: TypeWithI18N icon?: string }> - description?: Record + description?: TypeWithI18N } export type TriggerEvent = { - identity: Identity - description: Record + name: string + identity: { + author: string + name: string + label: TypeWithI18N + provider?: string + } + description: TypeWithI18N parameters: TriggerEventParameter[] output_schema: Record } diff --git a/web/app/components/workflow/block-selector/types.ts b/web/app/components/workflow/block-selector/types.ts index e995974b87..b69453e937 100644 --- a/web/app/components/workflow/block-selector/types.ts +++ b/web/app/components/workflow/block-selector/types.ts @@ -216,7 +216,7 @@ export type TriggerWithProvider = Collection & { meta: PluginMeta plugin_unique_identifier: string credentials_schema?: TriggerCredentialField[] - subscription_constructor: PluginTriggerSubscriptionConstructor + subscription_constructor?: PluginTriggerSubscriptionConstructor | null subscription_schema?: ParametersSchema[] supported_creation_methods: SupportedCreationMethods[] } diff --git a/web/service/use-triggers.ts b/web/service/use-triggers.ts index 43defceae3..cfb786e4a9 100644 --- a/web/service/use-triggers.ts +++ b/web/service/use-triggers.ts @@ -149,6 +149,8 @@ export const useUpdateTriggerSubscriptionBuilder = () => { subscriptionBuilderId: string name?: string properties?: Record + parameters?: Record + credentials?: Record }) => { const { provider, subscriptionBuilderId, ...body } = payload return post( @@ -180,7 +182,7 @@ export const useVerifyTriggerSubscriptionBuilder = () => { export type BuildTriggerSubscriptionPayload = { provider: string subscriptionBuilderId: string - name: string + name?: string parameters?: Record }