fix: update types

This commit is contained in:
zhsama 2025-10-30 16:16:55 +08:00
parent 4635b99153
commit ed6bb121bb
4 changed files with 17 additions and 8 deletions

View File

@ -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

View File

@ -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<Locale, string>
label: TypeWithI18N
type: string
auto_generate: any
template: any
@ -173,15 +174,21 @@ export type TriggerEventParameter = {
precision: any
options?: Array<{
value: string
label: Record<Locale, string>
label: TypeWithI18N
icon?: string
}>
description?: Record<Locale, string>
description?: TypeWithI18N
}
export type TriggerEvent = {
identity: Identity
description: Record<Locale, string>
name: string
identity: {
author: string
name: string
label: TypeWithI18N
provider?: string
}
description: TypeWithI18N
parameters: TriggerEventParameter[]
output_schema: Record<string, any>
}

View File

@ -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[]
}

View File

@ -149,6 +149,8 @@ export const useUpdateTriggerSubscriptionBuilder = () => {
subscriptionBuilderId: string
name?: string
properties?: Record<string, any>
parameters?: Record<string, any>
credentials?: Record<string, any>
}) => {
const { provider, subscriptionBuilderId, ...body } = payload
return post<TriggerSubscriptionBuilder>(
@ -180,7 +182,7 @@ export const useVerifyTriggerSubscriptionBuilder = () => {
export type BuildTriggerSubscriptionPayload = {
provider: string
subscriptionBuilderId: string
name: string
name?: string
parameters?: Record<string, any>
}