Files
dify/web/contract/console/workflow.ts
非法操作 53a22aa41b feat: collaboration (#30781)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: yyh <yuanyouhuilyz@gmail.com>
Co-authored-by: yyh <92089059+lyzno1@users.noreply.github.com>
2026-04-16 02:21:04 +00:00

81 lines
2.0 KiB
TypeScript

import type {
FileUpload,
RetrieverResource,
SensitiveWordAvoidance,
SpeechToText,
SuggestedQuestionsAfterAnswer,
TextToSpeech,
} from '@/app/components/base/features/types'
import type { ConversationVariable, EnvironmentVariable } from '@/app/components/workflow/types'
import type { CommonResponse } from '@/models/common'
import { type } from '@orpc/contract'
import { base } from '../base'
export type WorkflowDraftFeaturesPayload = {
opening_statement: string
suggested_questions: string[]
suggested_questions_after_answer?: SuggestedQuestionsAfterAnswer
text_to_speech?: TextToSpeech
speech_to_text?: SpeechToText
retriever_resource?: RetrieverResource
sensitive_word_avoidance?: SensitiveWordAvoidance
file_upload?: FileUpload
}
export const workflowDraftEnvironmentVariablesContract = base
.route({
path: '/apps/{appId}/workflows/draft/environment-variables',
method: 'GET',
})
.input(type<{
params: {
appId: string
}
}>())
.output(type<{ items: EnvironmentVariable[] }>())
export const workflowDraftUpdateEnvironmentVariablesContract = base
.route({
path: '/apps/{appId}/workflows/draft/environment-variables',
method: 'POST',
})
.input(type<{
params: {
appId: string
}
body: {
environment_variables: EnvironmentVariable[]
}
}>())
.output(type<CommonResponse>())
export const workflowDraftUpdateConversationVariablesContract = base
.route({
path: '/apps/{appId}/workflows/draft/conversation-variables',
method: 'POST',
})
.input(type<{
params: {
appId: string
}
body: {
conversation_variables: ConversationVariable[]
}
}>())
.output(type<CommonResponse>())
export const workflowDraftUpdateFeaturesContract = base
.route({
path: '/apps/{appId}/workflows/draft/features',
method: 'POST',
})
.input(type<{
params: {
appId: string
}
body: {
features: WorkflowDraftFeaturesPayload
}
}>())
.output(type<CommonResponse>())