mirror of
https://github.com/langgenius/dify.git
synced 2026-10-04 13:47:55 +08:00
160 lines
4.0 KiB
TypeScript
160 lines
4.0 KiB
TypeScript
// This file is auto-generated by @hey-api/openapi-ts
|
|
|
|
import { eventIterator, oc } from '@orpc/contract'
|
|
import * as z from 'zod'
|
|
import {
|
|
zGetDifyBuilderSessionsBySessionIdConversationPath,
|
|
zGetDifyBuilderSessionsBySessionIdConversationQuery,
|
|
zGetDifyBuilderSessionsBySessionIdConversationResponse,
|
|
zGetDifyBuilderSessionsBySessionIdPath,
|
|
zGetDifyBuilderSessionsBySessionIdResponse,
|
|
zGetDifyBuilderSessionsBySessionIdStreamPath,
|
|
zGetDifyBuilderSessionsBySessionIdStreamResponse,
|
|
zPostDifyBuilderAgentPingResponse,
|
|
zPostDifyBuilderSessionsBody,
|
|
zPostDifyBuilderSessionsBySessionIdActionsBody,
|
|
zPostDifyBuilderSessionsBySessionIdActionsPath,
|
|
zPostDifyBuilderSessionsBySessionIdActionsResponse,
|
|
zPostDifyBuilderSessionsBySessionIdMessagesBody,
|
|
zPostDifyBuilderSessionsBySessionIdMessagesPath,
|
|
zPostDifyBuilderSessionsBySessionIdMessagesResponse,
|
|
zPostDifyBuilderSessionsResponse,
|
|
} from './zod.gen'
|
|
|
|
export const post = oc
|
|
.route({
|
|
inputStructure: 'detailed',
|
|
method: 'POST',
|
|
operationId: 'postDifyBuilderAgentPing',
|
|
path: '/dify-builder/agent/ping',
|
|
tags: ['console'],
|
|
})
|
|
.output(zPostDifyBuilderAgentPingResponse)
|
|
|
|
export const ping = {
|
|
post,
|
|
}
|
|
|
|
export const agent = {
|
|
ping,
|
|
}
|
|
|
|
export const post2 = oc
|
|
.route({
|
|
inputStructure: 'detailed',
|
|
method: 'POST',
|
|
operationId: 'postDifyBuilderSessionsBySessionIdActions',
|
|
path: '/dify-builder/sessions/{session_id}/actions',
|
|
tags: ['console'],
|
|
})
|
|
.input(
|
|
z.object({
|
|
body: zPostDifyBuilderSessionsBySessionIdActionsBody,
|
|
params: zPostDifyBuilderSessionsBySessionIdActionsPath,
|
|
}),
|
|
)
|
|
.output(eventIterator(zPostDifyBuilderSessionsBySessionIdActionsResponse))
|
|
|
|
export const actions = {
|
|
post: post2,
|
|
}
|
|
|
|
export const get = oc
|
|
.route({
|
|
inputStructure: 'detailed',
|
|
method: 'GET',
|
|
operationId: 'getDifyBuilderSessionsBySessionIdConversation',
|
|
path: '/dify-builder/sessions/{session_id}/conversation',
|
|
tags: ['console'],
|
|
})
|
|
.input(
|
|
z.object({
|
|
params: zGetDifyBuilderSessionsBySessionIdConversationPath,
|
|
query: zGetDifyBuilderSessionsBySessionIdConversationQuery.optional(),
|
|
}),
|
|
)
|
|
.output(zGetDifyBuilderSessionsBySessionIdConversationResponse)
|
|
|
|
export const conversation = {
|
|
get,
|
|
}
|
|
|
|
export const post3 = oc
|
|
.route({
|
|
inputStructure: 'detailed',
|
|
method: 'POST',
|
|
operationId: 'postDifyBuilderSessionsBySessionIdMessages',
|
|
path: '/dify-builder/sessions/{session_id}/messages',
|
|
tags: ['console'],
|
|
})
|
|
.input(
|
|
z.object({
|
|
body: zPostDifyBuilderSessionsBySessionIdMessagesBody,
|
|
params: zPostDifyBuilderSessionsBySessionIdMessagesPath,
|
|
}),
|
|
)
|
|
.output(eventIterator(zPostDifyBuilderSessionsBySessionIdMessagesResponse))
|
|
|
|
export const messages = {
|
|
post: post3,
|
|
}
|
|
|
|
export const get2 = oc
|
|
.route({
|
|
inputStructure: 'detailed',
|
|
method: 'GET',
|
|
operationId: 'getDifyBuilderSessionsBySessionIdStream',
|
|
path: '/dify-builder/sessions/{session_id}/stream',
|
|
tags: ['console'],
|
|
})
|
|
.input(z.object({ params: zGetDifyBuilderSessionsBySessionIdStreamPath }))
|
|
.output(eventIterator(zGetDifyBuilderSessionsBySessionIdStreamResponse))
|
|
|
|
export const stream = {
|
|
get: get2,
|
|
}
|
|
|
|
export const get3 = oc
|
|
.route({
|
|
inputStructure: 'detailed',
|
|
method: 'GET',
|
|
operationId: 'getDifyBuilderSessionsBySessionId',
|
|
path: '/dify-builder/sessions/{session_id}',
|
|
tags: ['console'],
|
|
})
|
|
.input(z.object({ params: zGetDifyBuilderSessionsBySessionIdPath }))
|
|
.output(zGetDifyBuilderSessionsBySessionIdResponse)
|
|
|
|
export const bySessionId = {
|
|
get: get3,
|
|
actions,
|
|
conversation,
|
|
messages,
|
|
stream,
|
|
}
|
|
|
|
export const post4 = oc
|
|
.route({
|
|
inputStructure: 'detailed',
|
|
method: 'POST',
|
|
operationId: 'postDifyBuilderSessions',
|
|
path: '/dify-builder/sessions',
|
|
tags: ['console'],
|
|
})
|
|
.input(z.object({ body: zPostDifyBuilderSessionsBody }))
|
|
.output(eventIterator(zPostDifyBuilderSessionsResponse))
|
|
|
|
export const sessions = {
|
|
post: post4,
|
|
bySessionId,
|
|
}
|
|
|
|
export const difyBuilder = {
|
|
agent,
|
|
sessions,
|
|
}
|
|
|
|
export const contract = {
|
|
difyBuilder,
|
|
}
|