mirror of
https://github.com/langgenius/dify.git
synced 2026-06-09 01:11:11 +08:00
387 lines
12 KiB
TypeScript
387 lines
12 KiB
TypeScript
// This file is auto-generated by @hey-api/openapi-ts
|
|
|
|
import { oc } from '@orpc/contract'
|
|
import * as z from 'zod'
|
|
|
|
import {
|
|
zGetTrialAppsByAppIdDatasetsPath,
|
|
zGetTrialAppsByAppIdDatasetsResponse,
|
|
zGetTrialAppsByAppIdMessagesByMessageIdSuggestedQuestionsPath,
|
|
zGetTrialAppsByAppIdMessagesByMessageIdSuggestedQuestionsResponse,
|
|
zGetTrialAppsByAppIdParametersPath,
|
|
zGetTrialAppsByAppIdParametersResponse,
|
|
zGetTrialAppsByAppIdPath,
|
|
zGetTrialAppsByAppIdResponse,
|
|
zGetTrialAppsByAppIdSitePath,
|
|
zGetTrialAppsByAppIdSiteResponse,
|
|
zGetTrialAppsByAppIdWorkflowsPath,
|
|
zGetTrialAppsByAppIdWorkflowsResponse,
|
|
zPostTrialAppsByAppIdAudioToTextPath,
|
|
zPostTrialAppsByAppIdAudioToTextResponse,
|
|
zPostTrialAppsByAppIdChatMessagesBody,
|
|
zPostTrialAppsByAppIdChatMessagesPath,
|
|
zPostTrialAppsByAppIdChatMessagesResponse,
|
|
zPostTrialAppsByAppIdCompletionMessagesBody,
|
|
zPostTrialAppsByAppIdCompletionMessagesPath,
|
|
zPostTrialAppsByAppIdCompletionMessagesResponse,
|
|
zPostTrialAppsByAppIdTextToAudioBody,
|
|
zPostTrialAppsByAppIdTextToAudioPath,
|
|
zPostTrialAppsByAppIdTextToAudioResponse,
|
|
zPostTrialAppsByAppIdWorkflowsRunBody,
|
|
zPostTrialAppsByAppIdWorkflowsRunPath,
|
|
zPostTrialAppsByAppIdWorkflowsRunResponse,
|
|
zPostTrialAppsByAppIdWorkflowsTasksByTaskIdStopPath,
|
|
zPostTrialAppsByAppIdWorkflowsTasksByTaskIdStopResponse,
|
|
} from './zod.gen'
|
|
|
|
/**
|
|
* Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.
|
|
*
|
|
* @deprecated
|
|
*/
|
|
export const post = oc
|
|
.route({
|
|
deprecated: true,
|
|
description:
|
|
'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.',
|
|
inputStructure: 'detailed',
|
|
method: 'POST',
|
|
operationId: 'postTrialAppsByAppIdAudioToText',
|
|
path: '/trial-apps/{app_id}/audio-to-text',
|
|
tags: ['console'],
|
|
})
|
|
.input(z.object({ params: zPostTrialAppsByAppIdAudioToTextPath }))
|
|
.output(zPostTrialAppsByAppIdAudioToTextResponse)
|
|
|
|
export const audioToText = {
|
|
post,
|
|
}
|
|
|
|
/**
|
|
* Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.
|
|
*
|
|
* @deprecated
|
|
*/
|
|
export const post2 = oc
|
|
.route({
|
|
deprecated: true,
|
|
description:
|
|
'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.',
|
|
inputStructure: 'detailed',
|
|
method: 'POST',
|
|
operationId: 'postTrialAppsByAppIdChatMessages',
|
|
path: '/trial-apps/{app_id}/chat-messages',
|
|
tags: ['console'],
|
|
})
|
|
.input(
|
|
z.object({
|
|
body: zPostTrialAppsByAppIdChatMessagesBody,
|
|
params: zPostTrialAppsByAppIdChatMessagesPath,
|
|
}),
|
|
)
|
|
.output(zPostTrialAppsByAppIdChatMessagesResponse)
|
|
|
|
export const chatMessages = {
|
|
post: post2,
|
|
}
|
|
|
|
/**
|
|
* Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.
|
|
*
|
|
* @deprecated
|
|
*/
|
|
export const post3 = oc
|
|
.route({
|
|
deprecated: true,
|
|
description:
|
|
'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.',
|
|
inputStructure: 'detailed',
|
|
method: 'POST',
|
|
operationId: 'postTrialAppsByAppIdCompletionMessages',
|
|
path: '/trial-apps/{app_id}/completion-messages',
|
|
tags: ['console'],
|
|
})
|
|
.input(
|
|
z.object({
|
|
body: zPostTrialAppsByAppIdCompletionMessagesBody,
|
|
params: zPostTrialAppsByAppIdCompletionMessagesPath,
|
|
}),
|
|
)
|
|
.output(zPostTrialAppsByAppIdCompletionMessagesResponse)
|
|
|
|
export const completionMessages = {
|
|
post: post3,
|
|
}
|
|
|
|
/**
|
|
* Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.
|
|
*
|
|
* @deprecated
|
|
*/
|
|
export const get = oc
|
|
.route({
|
|
deprecated: true,
|
|
description:
|
|
'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.',
|
|
inputStructure: 'detailed',
|
|
method: 'GET',
|
|
operationId: 'getTrialAppsByAppIdDatasets',
|
|
path: '/trial-apps/{app_id}/datasets',
|
|
tags: ['console'],
|
|
})
|
|
.input(z.object({ params: zGetTrialAppsByAppIdDatasetsPath }))
|
|
.output(zGetTrialAppsByAppIdDatasetsResponse)
|
|
|
|
export const datasets = {
|
|
get,
|
|
}
|
|
|
|
/**
|
|
* Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.
|
|
*
|
|
* @deprecated
|
|
*/
|
|
export const get2 = oc
|
|
.route({
|
|
deprecated: true,
|
|
description:
|
|
'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.',
|
|
inputStructure: 'detailed',
|
|
method: 'GET',
|
|
operationId: 'getTrialAppsByAppIdMessagesByMessageIdSuggestedQuestions',
|
|
path: '/trial-apps/{app_id}/messages/{message_id}/suggested-questions',
|
|
tags: ['console'],
|
|
})
|
|
.input(z.object({ params: zGetTrialAppsByAppIdMessagesByMessageIdSuggestedQuestionsPath }))
|
|
.output(zGetTrialAppsByAppIdMessagesByMessageIdSuggestedQuestionsResponse)
|
|
|
|
export const suggestedQuestions = {
|
|
get: get2,
|
|
}
|
|
|
|
export const byMessageId = {
|
|
suggestedQuestions,
|
|
}
|
|
|
|
export const messages = {
|
|
byMessageId,
|
|
}
|
|
|
|
/**
|
|
* Retrieve app parameters
|
|
*
|
|
* Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.
|
|
*
|
|
* @deprecated
|
|
*/
|
|
export const get3 = oc
|
|
.route({
|
|
deprecated: true,
|
|
description:
|
|
'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.',
|
|
inputStructure: 'detailed',
|
|
method: 'GET',
|
|
operationId: 'getTrialAppsByAppIdParameters',
|
|
path: '/trial-apps/{app_id}/parameters',
|
|
summary: 'Retrieve app parameters',
|
|
tags: ['console'],
|
|
})
|
|
.input(z.object({ params: zGetTrialAppsByAppIdParametersPath }))
|
|
.output(zGetTrialAppsByAppIdParametersResponse)
|
|
|
|
export const parameters = {
|
|
get: get3,
|
|
}
|
|
|
|
/**
|
|
* Retrieve app site info
|
|
*
|
|
* Returns the site configuration for the application including theme, icons, and text.
|
|
*
|
|
* Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.
|
|
*
|
|
* @deprecated
|
|
*/
|
|
export const get4 = oc
|
|
.route({
|
|
deprecated: true,
|
|
description:
|
|
'Returns the site configuration for the application including theme, icons, and text.\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.',
|
|
inputStructure: 'detailed',
|
|
method: 'GET',
|
|
operationId: 'getTrialAppsByAppIdSite',
|
|
path: '/trial-apps/{app_id}/site',
|
|
summary: 'Retrieve app site info',
|
|
tags: ['console'],
|
|
})
|
|
.input(z.object({ params: zGetTrialAppsByAppIdSitePath }))
|
|
.output(zGetTrialAppsByAppIdSiteResponse)
|
|
|
|
export const site = {
|
|
get: get4,
|
|
}
|
|
|
|
/**
|
|
* Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.
|
|
*
|
|
* @deprecated
|
|
*/
|
|
export const post4 = oc
|
|
.route({
|
|
deprecated: true,
|
|
description:
|
|
'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.',
|
|
inputStructure: 'detailed',
|
|
method: 'POST',
|
|
operationId: 'postTrialAppsByAppIdTextToAudio',
|
|
path: '/trial-apps/{app_id}/text-to-audio',
|
|
tags: ['console'],
|
|
})
|
|
.input(
|
|
z.object({
|
|
body: zPostTrialAppsByAppIdTextToAudioBody,
|
|
params: zPostTrialAppsByAppIdTextToAudioPath,
|
|
}),
|
|
)
|
|
.output(zPostTrialAppsByAppIdTextToAudioResponse)
|
|
|
|
export const textToAudio = {
|
|
post: post4,
|
|
}
|
|
|
|
/**
|
|
* Run workflow
|
|
*
|
|
* Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.
|
|
*
|
|
* @deprecated
|
|
*/
|
|
export const post5 = oc
|
|
.route({
|
|
deprecated: true,
|
|
description:
|
|
'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.',
|
|
inputStructure: 'detailed',
|
|
method: 'POST',
|
|
operationId: 'postTrialAppsByAppIdWorkflowsRun',
|
|
path: '/trial-apps/{app_id}/workflows/run',
|
|
summary: 'Run workflow',
|
|
tags: ['console'],
|
|
})
|
|
.input(
|
|
z.object({
|
|
body: zPostTrialAppsByAppIdWorkflowsRunBody,
|
|
params: zPostTrialAppsByAppIdWorkflowsRunPath,
|
|
}),
|
|
)
|
|
.output(zPostTrialAppsByAppIdWorkflowsRunResponse)
|
|
|
|
export const run = {
|
|
post: post5,
|
|
}
|
|
|
|
/**
|
|
* Stop workflow task
|
|
*
|
|
* Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.
|
|
*
|
|
* @deprecated
|
|
*/
|
|
export const post6 = oc
|
|
.route({
|
|
deprecated: true,
|
|
description:
|
|
'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.',
|
|
inputStructure: 'detailed',
|
|
method: 'POST',
|
|
operationId: 'postTrialAppsByAppIdWorkflowsTasksByTaskIdStop',
|
|
path: '/trial-apps/{app_id}/workflows/tasks/{task_id}/stop',
|
|
summary: 'Stop workflow task',
|
|
tags: ['console'],
|
|
})
|
|
.input(z.object({ params: zPostTrialAppsByAppIdWorkflowsTasksByTaskIdStopPath }))
|
|
.output(zPostTrialAppsByAppIdWorkflowsTasksByTaskIdStopResponse)
|
|
|
|
export const stop = {
|
|
post: post6,
|
|
}
|
|
|
|
export const byTaskId = {
|
|
stop,
|
|
}
|
|
|
|
export const tasks = {
|
|
byTaskId,
|
|
}
|
|
|
|
/**
|
|
* Get workflow detail
|
|
*
|
|
* Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.
|
|
*
|
|
* @deprecated
|
|
*/
|
|
export const get5 = oc
|
|
.route({
|
|
deprecated: true,
|
|
description:
|
|
'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.',
|
|
inputStructure: 'detailed',
|
|
method: 'GET',
|
|
operationId: 'getTrialAppsByAppIdWorkflows',
|
|
path: '/trial-apps/{app_id}/workflows',
|
|
summary: 'Get workflow detail',
|
|
tags: ['console'],
|
|
})
|
|
.input(z.object({ params: zGetTrialAppsByAppIdWorkflowsPath }))
|
|
.output(zGetTrialAppsByAppIdWorkflowsResponse)
|
|
|
|
export const workflows = {
|
|
get: get5,
|
|
run,
|
|
tasks,
|
|
}
|
|
|
|
/**
|
|
* Get app detail
|
|
*
|
|
* Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.
|
|
*
|
|
* @deprecated
|
|
*/
|
|
export const get6 = oc
|
|
.route({
|
|
deprecated: true,
|
|
description:
|
|
'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.',
|
|
inputStructure: 'detailed',
|
|
method: 'GET',
|
|
operationId: 'getTrialAppsByAppId',
|
|
path: '/trial-apps/{app_id}',
|
|
summary: 'Get app detail',
|
|
tags: ['console'],
|
|
})
|
|
.input(z.object({ params: zGetTrialAppsByAppIdPath }))
|
|
.output(zGetTrialAppsByAppIdResponse)
|
|
|
|
export const byAppId = {
|
|
get: get6,
|
|
audioToText,
|
|
chatMessages,
|
|
completionMessages,
|
|
datasets,
|
|
messages,
|
|
parameters,
|
|
site,
|
|
textToAudio,
|
|
workflows,
|
|
}
|
|
|
|
export const trialApps = {
|
|
byAppId,
|
|
}
|
|
|
|
export const contract = {
|
|
trialApps,
|
|
}
|