refactor(web): migrate trigger console contracts (#38255)

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
This commit is contained in:
Stephen Zhou
2026-07-01 14:46:30 +00:00
committed by GitHub
co-authored by autofix-ci[bot]
parent f98c6cb2a6
commit 6eb9928df7
10 changed files with 731 additions and 241 deletions
@@ -824,7 +824,7 @@ export type TriggerOAuthClientResponse = {
configured: boolean
custom_configured: boolean
custom_enabled: boolean
oauth_client_schema: unknown
oauth_client_schema: Array<TriggerProviderConfigResponse>
params: {
[key: string]: unknown
}
@@ -1342,6 +1342,27 @@ export type ProviderConfig = {
export type TriggerCreationMethod = 'APIKEY' | 'MANUAL' | 'OAUTH'
export type TriggerProviderConfigResponse = {
default?: number | string | number | boolean | null
help?: I18nObject | null
label?: I18nObject | null
multiple?: boolean
name: string
options?: Array<TriggerProviderConfigOptionResponse> | null
placeholder?: I18nObject | null
required?: boolean
scope?: AppSelectorScope | ModelSelectorScope | ToolSelectorScope | null
type:
| 'app-selector'
| 'array[tools]'
| 'boolean'
| 'model-selector'
| 'secret-input'
| 'select'
| 'text-input'
url?: string | null
}
export type RequestLog = {
created_at: string
endpoint: string
@@ -1628,6 +1649,11 @@ export type CoreEntitiesProviderEntitiesBasicProviderConfigType
| 'select'
| 'text-input'
export type TriggerProviderConfigOptionResponse = {
label: I18nObject
value: string
}
export type AiModelEntityResponse = {
deprecated?: boolean
features?: Array<ModelFeature> | null
@@ -4817,7 +4843,7 @@ export type PostWorkspacesCurrentTriggerProviderByProviderSubscriptionsVerifyByS
export type PostWorkspacesCurrentTriggerProviderByProviderSubscriptionsVerifyBySubscriptionIdResponses
= {
200: TriggerProviderOpaqueResponse
200: TriggerSubscriptionBuilderVerifyResponse
}
export type PostWorkspacesCurrentTriggerProviderByProviderSubscriptionsVerifyBySubscriptionIdResponse
@@ -614,19 +614,6 @@ export const zWorkflowToolDeletePayload = z.object({
workflow_tool_id: z.string(),
})
/**
* TriggerOAuthClientResponse
*/
export const zTriggerOAuthClientResponse = z.object({
configured: z.boolean(),
custom_configured: z.boolean(),
custom_enabled: z.boolean(),
oauth_client_schema: z.unknown(),
params: z.record(z.string(), z.unknown()),
redirect_uri: z.string(),
system_configured: z.boolean(),
})
/**
* TriggerOAuthClientPayload
*/
@@ -2024,6 +2011,52 @@ export const zOAuthSchema = z.object({
credentials_schema: z.array(zProviderConfig).optional(),
})
/**
* TriggerProviderConfigOptionResponse
*/
export const zTriggerProviderConfigOptionResponse = z.object({
label: zI18nObject,
value: z.string(),
})
/**
* TriggerProviderConfigResponse
*/
export const zTriggerProviderConfigResponse = z.object({
default: z.union([z.int(), z.string(), z.number(), z.boolean()]).nullish(),
help: zI18nObject.nullish(),
label: zI18nObject.nullish(),
multiple: z.boolean().optional().default(false),
name: z.string(),
options: z.array(zTriggerProviderConfigOptionResponse).nullish(),
placeholder: zI18nObject.nullish(),
required: z.boolean().optional().default(false),
scope: z.union([zAppSelectorScope, zModelSelectorScope, zToolSelectorScope]).nullish(),
type: z.enum([
'app-selector',
'array[tools]',
'boolean',
'model-selector',
'secret-input',
'select',
'text-input',
]),
url: z.string().nullish(),
})
/**
* TriggerOAuthClientResponse
*/
export const zTriggerOAuthClientResponse = z.object({
configured: z.boolean(),
custom_configured: z.boolean(),
custom_enabled: z.boolean(),
oauth_client_schema: z.array(zTriggerProviderConfigResponse),
params: z.record(z.string(), z.unknown()),
redirect_uri: z.string(),
system_configured: z.boolean(),
})
/**
* UnaddedModelConfiguration
*
@@ -4327,7 +4360,7 @@ export const zPostWorkspacesCurrentTriggerProviderByProviderSubscriptionsVerifyB
* Success
*/
export const zPostWorkspacesCurrentTriggerProviderByProviderSubscriptionsVerifyBySubscriptionIdResponse
= zTriggerProviderOpaqueResponse
= zTriggerSubscriptionBuilderVerifyResponse
export const zPostWorkspacesCurrentTriggerProviderBySubscriptionIdSubscriptionsDeletePath
= z.object({