dify/packages/contracts/generated/api/console/trial-apps/orpc.gen.ts
2026-04-30 11:34:27 +00:00

299 lines
7.1 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'
export const post = oc
.route({
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,
}
export const post2 = oc
.route({
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,
}
export const post3 = oc
.route({
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,
}
export const get = oc
.route({
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,
}
export const get2 = oc
.route({
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
*/
export const get3 = oc
.route({
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.
*/
export const get4 = oc
.route({
description:
'Returns the site configuration for the application including theme, icons, and text.',
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,
}
export const post4 = oc
.route({
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
*/
export const post5 = oc
.route({
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
*/
export const post6 = oc
.route({
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
*/
export const get5 = oc
.route({
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
*/
export const get6 = oc
.route({
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,
}