chore: 纳入本地 Dify 1.19.0 源码及品牌与免登改动
演示目录只保留可重建的源码。运行密钥、数据卷、依赖和带口令的本地配置不进入仓库。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
60158935f4
commit
6519682885
15831 files changed
+3063428
No files matched your search
+488
@@ -0,0 +1,488 @@
|
||||
// This file is auto-generated by scripts/add-orpc-error-maps.ts
|
||||
import * as z from 'zod'
|
||||
|
||||
const zErrorResponse = /* @__PURE__ */ (() =>
|
||||
z.object({
|
||||
code: z.string(),
|
||||
details: z.record(z.string(), z.unknown()).optional(),
|
||||
message: z.string(),
|
||||
params: z.string().optional(),
|
||||
status: z.int(),
|
||||
}))()
|
||||
|
||||
const zInvalidCursorError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('invalid_cursor'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zWebAppAccessUnavailableError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('web_app_access_unavailable'),
|
||||
status: z.literal(503),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zAccessDeniedError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('access_denied'),
|
||||
status: z.literal(403),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zInstalledAppNotFoundError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('installed_app_not_found'),
|
||||
status: z.literal(404),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zInstalledAppUnavailableError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('installed_app_unavailable'),
|
||||
status: z.literal(404),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zAppUnavailableError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('app_unavailable'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zCompletionRequestError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('completion_request_error'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zModelCurrentlyNotSupportError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('model_currently_not_support'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zNoAudioUploadedError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('no_audio_uploaded'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zProviderNotInitializeError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('provider_not_initialize'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zProviderNotSupportSpeechToTextError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('provider_not_support_speech_to_text'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zProviderQuotaExceededError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('provider_quota_exceeded'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zSpeechToTextDisabledError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('speech_to_text_disabled'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zAgentVersionNotFoundError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('agent_version_not_found_error'),
|
||||
status: z.literal(404),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zAudioTooLargeError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('audio_too_large'),
|
||||
status: z.literal(413),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zUnsupportedAudioTypeError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('unsupported_audio_type'),
|
||||
status: z.literal(415),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zNotChatAppError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('not_chat_app'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zRateLimitError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('rate_limit_error'),
|
||||
status: z.literal(429),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zNotCompletionAppError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('not_completion_app'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zConversationCursorNotFoundError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('conversation_cursor_not_found'),
|
||||
status: z.literal(404),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zConversationNotFoundError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('conversation_not_found'),
|
||||
status: z.literal(404),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zConversationNameRequiredError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('conversation_name_required'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zConversationFirstMessageNotFoundError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('conversation_first_message_not_found'),
|
||||
status: z.literal(404),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zMessageCursorNotFoundError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('message_cursor_not_found'),
|
||||
status: z.literal(404),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zMessageFeedbackRatingRequiredError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('message_feedback_rating_required'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zMessageNotFoundError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('message_not_found'),
|
||||
status: z.literal(404),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zAppMoreLikeThisDisabledError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('app_more_like_this_disabled'),
|
||||
status: z.literal(403),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zAppSuggestedQuestionsAfterAnswerDisabledError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('app_suggested_questions_after_answer_disabled'),
|
||||
status: z.literal(403),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zProviderNotSupportTextToSpeechError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('provider_not_support_text_to_speech'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
))()
|
||||
|
||||
const zNotWorkflowAppError = /* @__PURE__ */ (() =>
|
||||
zErrorResponse.and(
|
||||
z.object({
|
||||
code: z.literal('not_workflow_app'),
|
||||
status: z.literal(400),
|
||||
}),
|
||||
))()
|
||||
|
||||
export const postErrors = {
|
||||
access_denied: { status: 403, data: zAccessDeniedError },
|
||||
agent_version_not_found_error: { status: 404, data: zAgentVersionNotFoundError },
|
||||
app_unavailable: { status: 400, data: zAppUnavailableError },
|
||||
audio_too_large: { status: 413, data: zAudioTooLargeError },
|
||||
completion_request_error: { status: 400, data: zCompletionRequestError },
|
||||
installed_app_not_found: { status: 404, data: zInstalledAppNotFoundError },
|
||||
model_currently_not_support: { status: 400, data: zModelCurrentlyNotSupportError },
|
||||
no_audio_uploaded: { status: 400, data: zNoAudioUploadedError },
|
||||
provider_not_initialize: { status: 400, data: zProviderNotInitializeError },
|
||||
provider_not_support_speech_to_text: { status: 400, data: zProviderNotSupportSpeechToTextError },
|
||||
provider_quota_exceeded: { status: 400, data: zProviderQuotaExceededError },
|
||||
speech_to_text_disabled: { status: 400, data: zSpeechToTextDisabledError },
|
||||
unsupported_audio_type: { status: 415, data: zUnsupportedAudioTypeError },
|
||||
web_app_access_unavailable: { status: 503, data: zWebAppAccessUnavailableError },
|
||||
}
|
||||
|
||||
export const post2Errors = {
|
||||
access_denied: { status: 403, data: zAccessDeniedError },
|
||||
installed_app_not_found: { status: 404, data: zInstalledAppNotFoundError },
|
||||
not_chat_app: { status: 400, data: zNotChatAppError },
|
||||
web_app_access_unavailable: { status: 503, data: zWebAppAccessUnavailableError },
|
||||
}
|
||||
|
||||
export const post3Errors = {
|
||||
access_denied: { status: 403, data: zAccessDeniedError },
|
||||
app_unavailable: { status: 400, data: zAppUnavailableError },
|
||||
completion_request_error: { status: 400, data: zCompletionRequestError },
|
||||
installed_app_not_found: { status: 404, data: zInstalledAppNotFoundError },
|
||||
model_currently_not_support: { status: 400, data: zModelCurrentlyNotSupportError },
|
||||
not_chat_app: { status: 400, data: zNotChatAppError },
|
||||
provider_not_initialize: { status: 400, data: zProviderNotInitializeError },
|
||||
provider_quota_exceeded: { status: 400, data: zProviderQuotaExceededError },
|
||||
rate_limit_error: { status: 429, data: zRateLimitError },
|
||||
web_app_access_unavailable: { status: 503, data: zWebAppAccessUnavailableError },
|
||||
}
|
||||
|
||||
export const post4Errors = {
|
||||
access_denied: { status: 403, data: zAccessDeniedError },
|
||||
installed_app_not_found: { status: 404, data: zInstalledAppNotFoundError },
|
||||
not_completion_app: { status: 400, data: zNotCompletionAppError },
|
||||
web_app_access_unavailable: { status: 503, data: zWebAppAccessUnavailableError },
|
||||
}
|
||||
|
||||
export const post5Errors = {
|
||||
access_denied: { status: 403, data: zAccessDeniedError },
|
||||
app_unavailable: { status: 400, data: zAppUnavailableError },
|
||||
completion_request_error: { status: 400, data: zCompletionRequestError },
|
||||
installed_app_not_found: { status: 404, data: zInstalledAppNotFoundError },
|
||||
model_currently_not_support: { status: 400, data: zModelCurrentlyNotSupportError },
|
||||
not_completion_app: { status: 400, data: zNotCompletionAppError },
|
||||
provider_not_initialize: { status: 400, data: zProviderNotInitializeError },
|
||||
provider_quota_exceeded: { status: 400, data: zProviderQuotaExceededError },
|
||||
web_app_access_unavailable: { status: 503, data: zWebAppAccessUnavailableError },
|
||||
}
|
||||
|
||||
export const post6Errors = {
|
||||
access_denied: { status: 403, data: zAccessDeniedError },
|
||||
conversation_first_message_not_found: {
|
||||
status: 404,
|
||||
data: zConversationFirstMessageNotFoundError,
|
||||
},
|
||||
conversation_name_required: { status: 400, data: zConversationNameRequiredError },
|
||||
conversation_not_found: { status: 404, data: zConversationNotFoundError },
|
||||
installed_app_not_found: { status: 404, data: zInstalledAppNotFoundError },
|
||||
not_chat_app: { status: 400, data: zNotChatAppError },
|
||||
web_app_access_unavailable: { status: 503, data: zWebAppAccessUnavailableError },
|
||||
}
|
||||
|
||||
export const patchErrors = {
|
||||
access_denied: { status: 403, data: zAccessDeniedError },
|
||||
conversation_not_found: { status: 404, data: zConversationNotFoundError },
|
||||
installed_app_not_found: { status: 404, data: zInstalledAppNotFoundError },
|
||||
not_chat_app: { status: 400, data: zNotChatAppError },
|
||||
web_app_access_unavailable: { status: 503, data: zWebAppAccessUnavailableError },
|
||||
}
|
||||
|
||||
export const patch2Errors = {
|
||||
access_denied: { status: 403, data: zAccessDeniedError },
|
||||
conversation_not_found: { status: 404, data: zConversationNotFoundError },
|
||||
installed_app_not_found: { status: 404, data: zInstalledAppNotFoundError },
|
||||
not_chat_app: { status: 400, data: zNotChatAppError },
|
||||
web_app_access_unavailable: { status: 503, data: zWebAppAccessUnavailableError },
|
||||
}
|
||||
|
||||
export const delete_Errors = {
|
||||
access_denied: { status: 403, data: zAccessDeniedError },
|
||||
conversation_not_found: { status: 404, data: zConversationNotFoundError },
|
||||
installed_app_not_found: { status: 404, data: zInstalledAppNotFoundError },
|
||||
not_chat_app: { status: 400, data: zNotChatAppError },
|
||||
web_app_access_unavailable: { status: 503, data: zWebAppAccessUnavailableError },
|
||||
}
|
||||
|
||||
export const getErrors = {
|
||||
access_denied: { status: 403, data: zAccessDeniedError },
|
||||
conversation_cursor_not_found: { status: 404, data: zConversationCursorNotFoundError },
|
||||
installed_app_not_found: { status: 404, data: zInstalledAppNotFoundError },
|
||||
not_chat_app: { status: 400, data: zNotChatAppError },
|
||||
web_app_access_unavailable: { status: 503, data: zWebAppAccessUnavailableError },
|
||||
}
|
||||
|
||||
export const post7Errors = {
|
||||
access_denied: { status: 403, data: zAccessDeniedError },
|
||||
app_unavailable: { status: 400, data: zAppUnavailableError },
|
||||
installed_app_not_found: { status: 404, data: zInstalledAppNotFoundError },
|
||||
message_feedback_rating_required: { status: 400, data: zMessageFeedbackRatingRequiredError },
|
||||
message_not_found: { status: 404, data: zMessageNotFoundError },
|
||||
web_app_access_unavailable: { status: 503, data: zWebAppAccessUnavailableError },
|
||||
}
|
||||
|
||||
export const get2Errors = {
|
||||
access_denied: { status: 403, data: zAccessDeniedError },
|
||||
app_more_like_this_disabled: { status: 403, data: zAppMoreLikeThisDisabledError },
|
||||
app_unavailable: { status: 400, data: zAppUnavailableError },
|
||||
completion_request_error: { status: 400, data: zCompletionRequestError },
|
||||
installed_app_not_found: { status: 404, data: zInstalledAppNotFoundError },
|
||||
message_not_found: { status: 404, data: zMessageNotFoundError },
|
||||
model_currently_not_support: { status: 400, data: zModelCurrentlyNotSupportError },
|
||||
not_completion_app: { status: 400, data: zNotCompletionAppError },
|
||||
provider_not_initialize: { status: 400, data: zProviderNotInitializeError },
|
||||
provider_quota_exceeded: { status: 400, data: zProviderQuotaExceededError },
|
||||
web_app_access_unavailable: { status: 503, data: zWebAppAccessUnavailableError },
|
||||
}
|
||||
|
||||
export const get3Errors = {
|
||||
access_denied: { status: 403, data: zAccessDeniedError },
|
||||
app_suggested_questions_after_answer_disabled: {
|
||||
status: 403,
|
||||
data: zAppSuggestedQuestionsAfterAnswerDisabledError,
|
||||
},
|
||||
app_unavailable: { status: 400, data: zAppUnavailableError },
|
||||
completion_request_error: { status: 400, data: zCompletionRequestError },
|
||||
conversation_not_found: { status: 404, data: zConversationNotFoundError },
|
||||
installed_app_not_found: { status: 404, data: zInstalledAppNotFoundError },
|
||||
message_not_found: { status: 404, data: zMessageNotFoundError },
|
||||
model_currently_not_support: { status: 400, data: zModelCurrentlyNotSupportError },
|
||||
not_chat_app: { status: 400, data: zNotChatAppError },
|
||||
provider_not_initialize: { status: 400, data: zProviderNotInitializeError },
|
||||
provider_quota_exceeded: { status: 400, data: zProviderQuotaExceededError },
|
||||
web_app_access_unavailable: { status: 503, data: zWebAppAccessUnavailableError },
|
||||
}
|
||||
|
||||
export const get4Errors = {
|
||||
access_denied: { status: 403, data: zAccessDeniedError },
|
||||
app_unavailable: { status: 400, data: zAppUnavailableError },
|
||||
conversation_not_found: { status: 404, data: zConversationNotFoundError },
|
||||
installed_app_not_found: { status: 404, data: zInstalledAppNotFoundError },
|
||||
message_cursor_not_found: { status: 404, data: zMessageCursorNotFoundError },
|
||||
not_chat_app: { status: 400, data: zNotChatAppError },
|
||||
web_app_access_unavailable: { status: 503, data: zWebAppAccessUnavailableError },
|
||||
}
|
||||
|
||||
export const get5Errors = {
|
||||
access_denied: { status: 403, data: zAccessDeniedError },
|
||||
app_unavailable: { status: 400, data: zAppUnavailableError },
|
||||
installed_app_not_found: { status: 404, data: zInstalledAppNotFoundError },
|
||||
web_app_access_unavailable: { status: 503, data: zWebAppAccessUnavailableError },
|
||||
}
|
||||
|
||||
export const get6Errors = {
|
||||
access_denied: { status: 403, data: zAccessDeniedError },
|
||||
app_unavailable: { status: 400, data: zAppUnavailableError },
|
||||
installed_app_not_found: { status: 404, data: zInstalledAppNotFoundError },
|
||||
web_app_access_unavailable: { status: 503, data: zWebAppAccessUnavailableError },
|
||||
}
|
||||
|
||||
export const delete2Errors = {
|
||||
access_denied: { status: 403, data: zAccessDeniedError },
|
||||
installed_app_not_found: { status: 404, data: zInstalledAppNotFoundError },
|
||||
not_completion_app: { status: 400, data: zNotCompletionAppError },
|
||||
web_app_access_unavailable: { status: 503, data: zWebAppAccessUnavailableError },
|
||||
}
|
||||
|
||||
export const get7Errors = {
|
||||
access_denied: { status: 403, data: zAccessDeniedError },
|
||||
installed_app_not_found: { status: 404, data: zInstalledAppNotFoundError },
|
||||
not_completion_app: { status: 400, data: zNotCompletionAppError },
|
||||
web_app_access_unavailable: { status: 503, data: zWebAppAccessUnavailableError },
|
||||
}
|
||||
|
||||
export const post8Errors = {
|
||||
access_denied: { status: 403, data: zAccessDeniedError },
|
||||
installed_app_not_found: { status: 404, data: zInstalledAppNotFoundError },
|
||||
not_completion_app: { status: 400, data: zNotCompletionAppError },
|
||||
web_app_access_unavailable: { status: 503, data: zWebAppAccessUnavailableError },
|
||||
}
|
||||
|
||||
export const post9Errors = {
|
||||
access_denied: { status: 403, data: zAccessDeniedError },
|
||||
agent_version_not_found_error: { status: 404, data: zAgentVersionNotFoundError },
|
||||
app_unavailable: { status: 400, data: zAppUnavailableError },
|
||||
completion_request_error: { status: 400, data: zCompletionRequestError },
|
||||
installed_app_not_found: { status: 404, data: zInstalledAppNotFoundError },
|
||||
model_currently_not_support: { status: 400, data: zModelCurrentlyNotSupportError },
|
||||
provider_not_initialize: { status: 400, data: zProviderNotInitializeError },
|
||||
provider_not_support_text_to_speech: { status: 400, data: zProviderNotSupportTextToSpeechError },
|
||||
provider_quota_exceeded: { status: 400, data: zProviderQuotaExceededError },
|
||||
web_app_access_unavailable: { status: 503, data: zWebAppAccessUnavailableError },
|
||||
}
|
||||
|
||||
export const post10Errors = {
|
||||
access_denied: { status: 403, data: zAccessDeniedError },
|
||||
completion_request_error: { status: 400, data: zCompletionRequestError },
|
||||
installed_app_not_found: { status: 404, data: zInstalledAppNotFoundError },
|
||||
model_currently_not_support: { status: 400, data: zModelCurrentlyNotSupportError },
|
||||
not_workflow_app: { status: 400, data: zNotWorkflowAppError },
|
||||
provider_not_initialize: { status: 400, data: zProviderNotInitializeError },
|
||||
provider_quota_exceeded: { status: 400, data: zProviderQuotaExceededError },
|
||||
rate_limit_error: { status: 429, data: zRateLimitError },
|
||||
web_app_access_unavailable: { status: 503, data: zWebAppAccessUnavailableError },
|
||||
}
|
||||
|
||||
export const post11Errors = {
|
||||
access_denied: { status: 403, data: zAccessDeniedError },
|
||||
installed_app_not_found: { status: 404, data: zInstalledAppNotFoundError },
|
||||
not_workflow_app: { status: 400, data: zNotWorkflowAppError },
|
||||
web_app_access_unavailable: { status: 503, data: zWebAppAccessUnavailableError },
|
||||
}
|
||||
|
||||
export const get8Errors = {
|
||||
access_denied: { status: 403, data: zAccessDeniedError },
|
||||
installed_app_not_found: { status: 404, data: zInstalledAppNotFoundError },
|
||||
installed_app_unavailable: { status: 404, data: zInstalledAppUnavailableError },
|
||||
web_app_access_unavailable: { status: 503, data: zWebAppAccessUnavailableError },
|
||||
}
|
||||
|
||||
export const patch3Errors = {
|
||||
access_denied: { status: 403, data: zAccessDeniedError },
|
||||
installed_app_not_found: { status: 404, data: zInstalledAppNotFoundError },
|
||||
web_app_access_unavailable: { status: 503, data: zWebAppAccessUnavailableError },
|
||||
}
|
||||
|
||||
export const get9Errors = {
|
||||
invalid_cursor: { status: 400, data: zInvalidCursorError },
|
||||
web_app_access_unavailable: { status: 503, data: zWebAppAccessUnavailableError },
|
||||
}
|
||||
+819
@@ -0,0 +1,819 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
import { oc } from '@orpc/contract'
|
||||
import * as z from 'zod'
|
||||
import {
|
||||
zAccessDeniedError,
|
||||
zAgentVersionNotFoundError,
|
||||
zAppMoreLikeThisDisabledError,
|
||||
zAppSuggestedQuestionsAfterAnswerDisabledError,
|
||||
zAppUnavailableError,
|
||||
zAudioTooLargeError,
|
||||
zCompletionRequestError,
|
||||
zConversationCursorNotFoundError,
|
||||
zConversationFirstMessageNotFoundError,
|
||||
zConversationNameRequiredError,
|
||||
zConversationNotFoundError,
|
||||
zInstalledAppNotFoundError,
|
||||
zInstalledAppUnavailableError,
|
||||
zInvalidCursorError,
|
||||
zMessageCursorNotFoundError,
|
||||
zMessageFeedbackRatingRequiredError,
|
||||
zMessageNotFoundError,
|
||||
zModelCurrentlyNotSupportError,
|
||||
zNoAudioUploadedError,
|
||||
zNotChatAppError,
|
||||
zNotCompletionAppError,
|
||||
zNotWorkflowAppError,
|
||||
zProviderNotInitializeError,
|
||||
zProviderNotSupportSpeechToTextError,
|
||||
zProviderNotSupportTextToSpeechError,
|
||||
zProviderQuotaExceededError,
|
||||
zRateLimitError,
|
||||
zSpeechToTextDisabledError,
|
||||
zUnsupportedAudioTypeError,
|
||||
zWebAppAccessUnavailableError,
|
||||
} from './zod.gen.ts'
|
||||
import {
|
||||
zDeleteInstalledAppsByInstalledAppIdConversationsByCIdPath,
|
||||
zDeleteInstalledAppsByInstalledAppIdConversationsByCIdResponse,
|
||||
zDeleteInstalledAppsByInstalledAppIdSavedMessagesByMessageIdPath,
|
||||
zDeleteInstalledAppsByInstalledAppIdSavedMessagesByMessageIdResponse,
|
||||
zGetInstalledAppsByInstalledAppIdConversationsPath,
|
||||
zGetInstalledAppsByInstalledAppIdConversationsQuery,
|
||||
zGetInstalledAppsByInstalledAppIdConversationsResponse,
|
||||
zGetInstalledAppsByInstalledAppIdMessagesByMessageIdMoreLikeThisPath,
|
||||
zGetInstalledAppsByInstalledAppIdMessagesByMessageIdMoreLikeThisQuery,
|
||||
zGetInstalledAppsByInstalledAppIdMessagesByMessageIdMoreLikeThisResponse,
|
||||
zGetInstalledAppsByInstalledAppIdMessagesByMessageIdSuggestedQuestionsPath,
|
||||
zGetInstalledAppsByInstalledAppIdMessagesByMessageIdSuggestedQuestionsResponse,
|
||||
zGetInstalledAppsByInstalledAppIdMessagesPath,
|
||||
zGetInstalledAppsByInstalledAppIdMessagesQuery,
|
||||
zGetInstalledAppsByInstalledAppIdMessagesResponse,
|
||||
zGetInstalledAppsByInstalledAppIdMetaPath,
|
||||
zGetInstalledAppsByInstalledAppIdMetaResponse,
|
||||
zGetInstalledAppsByInstalledAppIdParametersPath,
|
||||
zGetInstalledAppsByInstalledAppIdParametersResponse,
|
||||
zGetInstalledAppsByInstalledAppIdPath,
|
||||
zGetInstalledAppsByInstalledAppIdResponse,
|
||||
zGetInstalledAppsByInstalledAppIdSavedMessagesPath,
|
||||
zGetInstalledAppsByInstalledAppIdSavedMessagesQuery,
|
||||
zGetInstalledAppsByInstalledAppIdSavedMessagesResponse,
|
||||
zGetInstalledAppsQuery,
|
||||
zGetInstalledAppsResponse,
|
||||
zPatchInstalledAppsByInstalledAppIdBody,
|
||||
zPatchInstalledAppsByInstalledAppIdConversationsByCIdPinPath,
|
||||
zPatchInstalledAppsByInstalledAppIdConversationsByCIdPinResponse,
|
||||
zPatchInstalledAppsByInstalledAppIdConversationsByCIdUnpinPath,
|
||||
zPatchInstalledAppsByInstalledAppIdConversationsByCIdUnpinResponse,
|
||||
zPatchInstalledAppsByInstalledAppIdPath,
|
||||
zPatchInstalledAppsByInstalledAppIdResponse,
|
||||
zPostInstalledAppsByInstalledAppIdAudioToTextPath,
|
||||
zPostInstalledAppsByInstalledAppIdAudioToTextResponse,
|
||||
zPostInstalledAppsByInstalledAppIdChatMessagesBody,
|
||||
zPostInstalledAppsByInstalledAppIdChatMessagesByTaskIdStopPath,
|
||||
zPostInstalledAppsByInstalledAppIdChatMessagesByTaskIdStopResponse,
|
||||
zPostInstalledAppsByInstalledAppIdChatMessagesPath,
|
||||
zPostInstalledAppsByInstalledAppIdChatMessagesResponse,
|
||||
zPostInstalledAppsByInstalledAppIdCompletionMessagesBody,
|
||||
zPostInstalledAppsByInstalledAppIdCompletionMessagesByTaskIdStopPath,
|
||||
zPostInstalledAppsByInstalledAppIdCompletionMessagesByTaskIdStopResponse,
|
||||
zPostInstalledAppsByInstalledAppIdCompletionMessagesPath,
|
||||
zPostInstalledAppsByInstalledAppIdCompletionMessagesResponse,
|
||||
zPostInstalledAppsByInstalledAppIdConversationsByCIdNameBody,
|
||||
zPostInstalledAppsByInstalledAppIdConversationsByCIdNamePath,
|
||||
zPostInstalledAppsByInstalledAppIdConversationsByCIdNameResponse,
|
||||
zPostInstalledAppsByInstalledAppIdMessagesByMessageIdFeedbacksBody,
|
||||
zPostInstalledAppsByInstalledAppIdMessagesByMessageIdFeedbacksPath,
|
||||
zPostInstalledAppsByInstalledAppIdMessagesByMessageIdFeedbacksResponse,
|
||||
zPostInstalledAppsByInstalledAppIdSavedMessagesBody,
|
||||
zPostInstalledAppsByInstalledAppIdSavedMessagesPath,
|
||||
zPostInstalledAppsByInstalledAppIdSavedMessagesResponse,
|
||||
zPostInstalledAppsByInstalledAppIdTextToAudioBody,
|
||||
zPostInstalledAppsByInstalledAppIdTextToAudioPath,
|
||||
zPostInstalledAppsByInstalledAppIdTextToAudioResponse,
|
||||
zPostInstalledAppsByInstalledAppIdWorkflowsRunBody,
|
||||
zPostInstalledAppsByInstalledAppIdWorkflowsRunPath,
|
||||
zPostInstalledAppsByInstalledAppIdWorkflowsRunResponse,
|
||||
zPostInstalledAppsByInstalledAppIdWorkflowsTasksByTaskIdStopPath,
|
||||
zPostInstalledAppsByInstalledAppIdWorkflowsTasksByTaskIdStopResponse,
|
||||
} from './zod.gen.ts'
|
||||
|
||||
export const post = oc
|
||||
.route({
|
||||
inputStructure: 'detailed',
|
||||
method: 'POST',
|
||||
operationId: 'postInstalledAppsByInstalledAppIdAudioToText',
|
||||
path: '/installed-apps/{installed_app_id}/audio-to-text',
|
||||
tags: ['console'],
|
||||
})
|
||||
.input(z.object({ params: zPostInstalledAppsByInstalledAppIdAudioToTextPath }))
|
||||
.output(zPostInstalledAppsByInstalledAppIdAudioToTextResponse)
|
||||
.errors({
|
||||
access_denied: { status: 403, data: zAccessDeniedError },
|
||||
agent_version_not_found_error: { status: 404, data: zAgentVersionNotFoundError },
|
||||
app_unavailable: { status: 400, data: zAppUnavailableError },
|
||||
audio_too_large: { status: 413, data: zAudioTooLargeError },
|
||||
completion_request_error: { status: 400, data: zCompletionRequestError },
|
||||
installed_app_not_found: { status: 404, data: zInstalledAppNotFoundError },
|
||||
model_currently_not_support: { status: 400, data: zModelCurrentlyNotSupportError },
|
||||
no_audio_uploaded: { status: 400, data: zNoAudioUploadedError },
|
||||
provider_not_initialize: { status: 400, data: zProviderNotInitializeError },
|
||||
provider_not_support_speech_to_text: {
|
||||
status: 400,
|
||||
data: zProviderNotSupportSpeechToTextError,
|
||||
},
|
||||
provider_quota_exceeded: { status: 400, data: zProviderQuotaExceededError },
|
||||
speech_to_text_disabled: { status: 400, data: zSpeechToTextDisabledError },
|
||||
unsupported_audio_type: { status: 415, data: zUnsupportedAudioTypeError },
|
||||
web_app_access_unavailable: { status: 503, data: zWebAppAccessUnavailableError },
|
||||
})
|
||||
|
||||
export const audioToText = {
|
||||
post,
|
||||
}
|
||||
|
||||
export const post2 = oc
|
||||
.route({
|
||||
inputStructure: 'detailed',
|
||||
method: 'POST',
|
||||
operationId: 'postInstalledAppsByInstalledAppIdChatMessagesByTaskIdStop',
|
||||
path: '/installed-apps/{installed_app_id}/chat-messages/{task_id}/stop',
|
||||
tags: ['console'],
|
||||
})
|
||||
.input(z.object({ params: zPostInstalledAppsByInstalledAppIdChatMessagesByTaskIdStopPath }))
|
||||
.output(zPostInstalledAppsByInstalledAppIdChatMessagesByTaskIdStopResponse)
|
||||
.errors({
|
||||
access_denied: { status: 403, data: zAccessDeniedError },
|
||||
installed_app_not_found: { status: 404, data: zInstalledAppNotFoundError },
|
||||
not_chat_app: { status: 400, data: zNotChatAppError },
|
||||
web_app_access_unavailable: { status: 503, data: zWebAppAccessUnavailableError },
|
||||
})
|
||||
|
||||
export const stop = {
|
||||
post: post2,
|
||||
}
|
||||
|
||||
export const byTaskId = {
|
||||
stop,
|
||||
}
|
||||
|
||||
export const post3 = oc
|
||||
.route({
|
||||
inputStructure: 'detailed',
|
||||
method: 'POST',
|
||||
operationId: 'postInstalledAppsByInstalledAppIdChatMessages',
|
||||
path: '/installed-apps/{installed_app_id}/chat-messages',
|
||||
tags: ['console'],
|
||||
})
|
||||
.input(
|
||||
z.object({
|
||||
body: zPostInstalledAppsByInstalledAppIdChatMessagesBody,
|
||||
params: zPostInstalledAppsByInstalledAppIdChatMessagesPath,
|
||||
}),
|
||||
)
|
||||
.output(zPostInstalledAppsByInstalledAppIdChatMessagesResponse)
|
||||
.errors({
|
||||
access_denied: { status: 403, data: zAccessDeniedError },
|
||||
app_unavailable: { status: 400, data: zAppUnavailableError },
|
||||
completion_request_error: { status: 400, data: zCompletionRequestError },
|
||||
installed_app_not_found: { status: 404, data: zInstalledAppNotFoundError },
|
||||
model_currently_not_support: { status: 400, data: zModelCurrentlyNotSupportError },
|
||||
not_chat_app: { status: 400, data: zNotChatAppError },
|
||||
provider_not_initialize: { status: 400, data: zProviderNotInitializeError },
|
||||
provider_quota_exceeded: { status: 400, data: zProviderQuotaExceededError },
|
||||
rate_limit_error: { status: 429, data: zRateLimitError },
|
||||
web_app_access_unavailable: { status: 503, data: zWebAppAccessUnavailableError },
|
||||
})
|
||||
|
||||
export const chatMessages = {
|
||||
post: post3,
|
||||
byTaskId,
|
||||
}
|
||||
|
||||
export const post4 = oc
|
||||
.route({
|
||||
inputStructure: 'detailed',
|
||||
method: 'POST',
|
||||
operationId: 'postInstalledAppsByInstalledAppIdCompletionMessagesByTaskIdStop',
|
||||
path: '/installed-apps/{installed_app_id}/completion-messages/{task_id}/stop',
|
||||
tags: ['console'],
|
||||
})
|
||||
.input(z.object({ params: zPostInstalledAppsByInstalledAppIdCompletionMessagesByTaskIdStopPath }))
|
||||
.output(zPostInstalledAppsByInstalledAppIdCompletionMessagesByTaskIdStopResponse)
|
||||
.errors({
|
||||
access_denied: { status: 403, data: zAccessDeniedError },
|
||||
installed_app_not_found: { status: 404, data: zInstalledAppNotFoundError },
|
||||
not_completion_app: { status: 400, data: zNotCompletionAppError },
|
||||
web_app_access_unavailable: { status: 503, data: zWebAppAccessUnavailableError },
|
||||
})
|
||||
|
||||
export const stop2 = {
|
||||
post: post4,
|
||||
}
|
||||
|
||||
export const byTaskId2 = {
|
||||
stop: stop2,
|
||||
}
|
||||
|
||||
export const post5 = oc
|
||||
.route({
|
||||
inputStructure: 'detailed',
|
||||
method: 'POST',
|
||||
operationId: 'postInstalledAppsByInstalledAppIdCompletionMessages',
|
||||
path: '/installed-apps/{installed_app_id}/completion-messages',
|
||||
tags: ['console'],
|
||||
})
|
||||
.input(
|
||||
z.object({
|
||||
body: zPostInstalledAppsByInstalledAppIdCompletionMessagesBody,
|
||||
params: zPostInstalledAppsByInstalledAppIdCompletionMessagesPath,
|
||||
}),
|
||||
)
|
||||
.output(zPostInstalledAppsByInstalledAppIdCompletionMessagesResponse)
|
||||
.errors({
|
||||
access_denied: { status: 403, data: zAccessDeniedError },
|
||||
app_unavailable: { status: 400, data: zAppUnavailableError },
|
||||
completion_request_error: { status: 400, data: zCompletionRequestError },
|
||||
installed_app_not_found: { status: 404, data: zInstalledAppNotFoundError },
|
||||
model_currently_not_support: { status: 400, data: zModelCurrentlyNotSupportError },
|
||||
not_completion_app: { status: 400, data: zNotCompletionAppError },
|
||||
provider_not_initialize: { status: 400, data: zProviderNotInitializeError },
|
||||
provider_quota_exceeded: { status: 400, data: zProviderQuotaExceededError },
|
||||
web_app_access_unavailable: { status: 503, data: zWebAppAccessUnavailableError },
|
||||
})
|
||||
|
||||
export const completionMessages = {
|
||||
post: post5,
|
||||
byTaskId: byTaskId2,
|
||||
}
|
||||
|
||||
export const post6 = oc
|
||||
.route({
|
||||
inputStructure: 'detailed',
|
||||
method: 'POST',
|
||||
operationId: 'postInstalledAppsByInstalledAppIdConversationsByCIdName',
|
||||
path: '/installed-apps/{installed_app_id}/conversations/{c_id}/name',
|
||||
tags: ['console'],
|
||||
})
|
||||
.input(
|
||||
z.object({
|
||||
body: zPostInstalledAppsByInstalledAppIdConversationsByCIdNameBody,
|
||||
params: zPostInstalledAppsByInstalledAppIdConversationsByCIdNamePath,
|
||||
}),
|
||||
)
|
||||
.output(zPostInstalledAppsByInstalledAppIdConversationsByCIdNameResponse)
|
||||
.errors({
|
||||
access_denied: { status: 403, data: zAccessDeniedError },
|
||||
conversation_first_message_not_found: {
|
||||
status: 404,
|
||||
data: zConversationFirstMessageNotFoundError,
|
||||
},
|
||||
conversation_name_required: { status: 400, data: zConversationNameRequiredError },
|
||||
conversation_not_found: { status: 404, data: zConversationNotFoundError },
|
||||
installed_app_not_found: { status: 404, data: zInstalledAppNotFoundError },
|
||||
not_chat_app: { status: 400, data: zNotChatAppError },
|
||||
web_app_access_unavailable: { status: 503, data: zWebAppAccessUnavailableError },
|
||||
})
|
||||
|
||||
export const name = {
|
||||
post: post6,
|
||||
}
|
||||
|
||||
export const patch = oc
|
||||
.route({
|
||||
inputStructure: 'detailed',
|
||||
method: 'PATCH',
|
||||
operationId: 'patchInstalledAppsByInstalledAppIdConversationsByCIdPin',
|
||||
path: '/installed-apps/{installed_app_id}/conversations/{c_id}/pin',
|
||||
tags: ['console'],
|
||||
})
|
||||
.input(z.object({ params: zPatchInstalledAppsByInstalledAppIdConversationsByCIdPinPath }))
|
||||
.output(zPatchInstalledAppsByInstalledAppIdConversationsByCIdPinResponse)
|
||||
.errors({
|
||||
access_denied: { status: 403, data: zAccessDeniedError },
|
||||
conversation_not_found: { status: 404, data: zConversationNotFoundError },
|
||||
installed_app_not_found: { status: 404, data: zInstalledAppNotFoundError },
|
||||
not_chat_app: { status: 400, data: zNotChatAppError },
|
||||
web_app_access_unavailable: { status: 503, data: zWebAppAccessUnavailableError },
|
||||
})
|
||||
|
||||
export const pin = {
|
||||
patch,
|
||||
}
|
||||
|
||||
export const patch2 = oc
|
||||
.route({
|
||||
inputStructure: 'detailed',
|
||||
method: 'PATCH',
|
||||
operationId: 'patchInstalledAppsByInstalledAppIdConversationsByCIdUnpin',
|
||||
path: '/installed-apps/{installed_app_id}/conversations/{c_id}/unpin',
|
||||
tags: ['console'],
|
||||
})
|
||||
.input(z.object({ params: zPatchInstalledAppsByInstalledAppIdConversationsByCIdUnpinPath }))
|
||||
.output(zPatchInstalledAppsByInstalledAppIdConversationsByCIdUnpinResponse)
|
||||
.errors({
|
||||
access_denied: { status: 403, data: zAccessDeniedError },
|
||||
conversation_not_found: { status: 404, data: zConversationNotFoundError },
|
||||
installed_app_not_found: { status: 404, data: zInstalledAppNotFoundError },
|
||||
not_chat_app: { status: 400, data: zNotChatAppError },
|
||||
web_app_access_unavailable: { status: 503, data: zWebAppAccessUnavailableError },
|
||||
})
|
||||
|
||||
export const unpin = {
|
||||
patch: patch2,
|
||||
}
|
||||
|
||||
export const delete_ = oc
|
||||
.route({
|
||||
inputStructure: 'detailed',
|
||||
method: 'DELETE',
|
||||
operationId: 'deleteInstalledAppsByInstalledAppIdConversationsByCId',
|
||||
path: '/installed-apps/{installed_app_id}/conversations/{c_id}',
|
||||
successStatus: 204,
|
||||
tags: ['console'],
|
||||
})
|
||||
.input(z.object({ params: zDeleteInstalledAppsByInstalledAppIdConversationsByCIdPath }))
|
||||
.output(zDeleteInstalledAppsByInstalledAppIdConversationsByCIdResponse)
|
||||
.errors({
|
||||
access_denied: { status: 403, data: zAccessDeniedError },
|
||||
conversation_not_found: { status: 404, data: zConversationNotFoundError },
|
||||
installed_app_not_found: { status: 404, data: zInstalledAppNotFoundError },
|
||||
not_chat_app: { status: 400, data: zNotChatAppError },
|
||||
web_app_access_unavailable: { status: 503, data: zWebAppAccessUnavailableError },
|
||||
})
|
||||
|
||||
export const byCId = {
|
||||
delete: delete_,
|
||||
name,
|
||||
pin,
|
||||
unpin,
|
||||
}
|
||||
|
||||
export const get = oc
|
||||
.route({
|
||||
inputStructure: 'detailed',
|
||||
method: 'GET',
|
||||
operationId: 'getInstalledAppsByInstalledAppIdConversations',
|
||||
path: '/installed-apps/{installed_app_id}/conversations',
|
||||
tags: ['console'],
|
||||
})
|
||||
.input(
|
||||
z.object({
|
||||
params: zGetInstalledAppsByInstalledAppIdConversationsPath,
|
||||
query: zGetInstalledAppsByInstalledAppIdConversationsQuery.optional(),
|
||||
}),
|
||||
)
|
||||
.output(zGetInstalledAppsByInstalledAppIdConversationsResponse)
|
||||
.errors({
|
||||
access_denied: { status: 403, data: zAccessDeniedError },
|
||||
conversation_cursor_not_found: { status: 404, data: zConversationCursorNotFoundError },
|
||||
installed_app_not_found: { status: 404, data: zInstalledAppNotFoundError },
|
||||
not_chat_app: { status: 400, data: zNotChatAppError },
|
||||
web_app_access_unavailable: { status: 503, data: zWebAppAccessUnavailableError },
|
||||
})
|
||||
|
||||
export const conversations = {
|
||||
get,
|
||||
byCId,
|
||||
}
|
||||
|
||||
export const post7 = oc
|
||||
.route({
|
||||
inputStructure: 'detailed',
|
||||
method: 'POST',
|
||||
operationId: 'postInstalledAppsByInstalledAppIdMessagesByMessageIdFeedbacks',
|
||||
path: '/installed-apps/{installed_app_id}/messages/{message_id}/feedbacks',
|
||||
tags: ['console'],
|
||||
})
|
||||
.input(
|
||||
z.object({
|
||||
body: zPostInstalledAppsByInstalledAppIdMessagesByMessageIdFeedbacksBody,
|
||||
params: zPostInstalledAppsByInstalledAppIdMessagesByMessageIdFeedbacksPath,
|
||||
}),
|
||||
)
|
||||
.output(zPostInstalledAppsByInstalledAppIdMessagesByMessageIdFeedbacksResponse)
|
||||
.errors({
|
||||
access_denied: { status: 403, data: zAccessDeniedError },
|
||||
app_unavailable: { status: 400, data: zAppUnavailableError },
|
||||
installed_app_not_found: { status: 404, data: zInstalledAppNotFoundError },
|
||||
message_feedback_rating_required: { status: 400, data: zMessageFeedbackRatingRequiredError },
|
||||
message_not_found: { status: 404, data: zMessageNotFoundError },
|
||||
web_app_access_unavailable: { status: 503, data: zWebAppAccessUnavailableError },
|
||||
})
|
||||
|
||||
export const feedbacks = {
|
||||
post: post7,
|
||||
}
|
||||
|
||||
export const get2 = oc
|
||||
.route({
|
||||
inputStructure: 'detailed',
|
||||
method: 'GET',
|
||||
operationId: 'getInstalledAppsByInstalledAppIdMessagesByMessageIdMoreLikeThis',
|
||||
path: '/installed-apps/{installed_app_id}/messages/{message_id}/more-like-this',
|
||||
tags: ['console'],
|
||||
})
|
||||
.input(
|
||||
z.object({
|
||||
params: zGetInstalledAppsByInstalledAppIdMessagesByMessageIdMoreLikeThisPath,
|
||||
query: zGetInstalledAppsByInstalledAppIdMessagesByMessageIdMoreLikeThisQuery,
|
||||
}),
|
||||
)
|
||||
.output(zGetInstalledAppsByInstalledAppIdMessagesByMessageIdMoreLikeThisResponse)
|
||||
.errors({
|
||||
access_denied: { status: 403, data: zAccessDeniedError },
|
||||
app_more_like_this_disabled: { status: 403, data: zAppMoreLikeThisDisabledError },
|
||||
app_unavailable: { status: 400, data: zAppUnavailableError },
|
||||
completion_request_error: { status: 400, data: zCompletionRequestError },
|
||||
installed_app_not_found: { status: 404, data: zInstalledAppNotFoundError },
|
||||
message_not_found: { status: 404, data: zMessageNotFoundError },
|
||||
model_currently_not_support: { status: 400, data: zModelCurrentlyNotSupportError },
|
||||
not_completion_app: { status: 400, data: zNotCompletionAppError },
|
||||
provider_not_initialize: { status: 400, data: zProviderNotInitializeError },
|
||||
provider_quota_exceeded: { status: 400, data: zProviderQuotaExceededError },
|
||||
web_app_access_unavailable: { status: 503, data: zWebAppAccessUnavailableError },
|
||||
})
|
||||
|
||||
export const moreLikeThis = {
|
||||
get: get2,
|
||||
}
|
||||
|
||||
export const get3 = oc
|
||||
.route({
|
||||
inputStructure: 'detailed',
|
||||
method: 'GET',
|
||||
operationId: 'getInstalledAppsByInstalledAppIdMessagesByMessageIdSuggestedQuestions',
|
||||
path: '/installed-apps/{installed_app_id}/messages/{message_id}/suggested-questions',
|
||||
tags: ['console'],
|
||||
})
|
||||
.input(
|
||||
z.object({
|
||||
params: zGetInstalledAppsByInstalledAppIdMessagesByMessageIdSuggestedQuestionsPath,
|
||||
}),
|
||||
)
|
||||
.output(zGetInstalledAppsByInstalledAppIdMessagesByMessageIdSuggestedQuestionsResponse)
|
||||
.errors({
|
||||
access_denied: { status: 403, data: zAccessDeniedError },
|
||||
app_suggested_questions_after_answer_disabled: {
|
||||
status: 403,
|
||||
data: zAppSuggestedQuestionsAfterAnswerDisabledError,
|
||||
},
|
||||
app_unavailable: { status: 400, data: zAppUnavailableError },
|
||||
completion_request_error: { status: 400, data: zCompletionRequestError },
|
||||
conversation_not_found: { status: 404, data: zConversationNotFoundError },
|
||||
installed_app_not_found: { status: 404, data: zInstalledAppNotFoundError },
|
||||
message_not_found: { status: 404, data: zMessageNotFoundError },
|
||||
model_currently_not_support: { status: 400, data: zModelCurrentlyNotSupportError },
|
||||
not_chat_app: { status: 400, data: zNotChatAppError },
|
||||
provider_not_initialize: { status: 400, data: zProviderNotInitializeError },
|
||||
provider_quota_exceeded: { status: 400, data: zProviderQuotaExceededError },
|
||||
web_app_access_unavailable: { status: 503, data: zWebAppAccessUnavailableError },
|
||||
})
|
||||
|
||||
export const suggestedQuestions = {
|
||||
get: get3,
|
||||
}
|
||||
|
||||
export const byMessageId = {
|
||||
feedbacks,
|
||||
moreLikeThis,
|
||||
suggestedQuestions,
|
||||
}
|
||||
|
||||
export const get4 = oc
|
||||
.route({
|
||||
inputStructure: 'detailed',
|
||||
method: 'GET',
|
||||
operationId: 'getInstalledAppsByInstalledAppIdMessages',
|
||||
path: '/installed-apps/{installed_app_id}/messages',
|
||||
tags: ['console'],
|
||||
})
|
||||
.input(
|
||||
z.object({
|
||||
params: zGetInstalledAppsByInstalledAppIdMessagesPath,
|
||||
query: zGetInstalledAppsByInstalledAppIdMessagesQuery,
|
||||
}),
|
||||
)
|
||||
.output(zGetInstalledAppsByInstalledAppIdMessagesResponse)
|
||||
.errors({
|
||||
access_denied: { status: 403, data: zAccessDeniedError },
|
||||
app_unavailable: { status: 400, data: zAppUnavailableError },
|
||||
conversation_not_found: { status: 404, data: zConversationNotFoundError },
|
||||
installed_app_not_found: { status: 404, data: zInstalledAppNotFoundError },
|
||||
message_cursor_not_found: { status: 404, data: zMessageCursorNotFoundError },
|
||||
not_chat_app: { status: 400, data: zNotChatAppError },
|
||||
web_app_access_unavailable: { status: 503, data: zWebAppAccessUnavailableError },
|
||||
})
|
||||
|
||||
export const messages = {
|
||||
get: get4,
|
||||
byMessageId,
|
||||
}
|
||||
|
||||
/**
|
||||
* Get app meta
|
||||
*/
|
||||
export const get5 = oc
|
||||
.route({
|
||||
inputStructure: 'detailed',
|
||||
method: 'GET',
|
||||
operationId: 'getInstalledAppsByInstalledAppIdMeta',
|
||||
path: '/installed-apps/{installed_app_id}/meta',
|
||||
summary: 'Get app meta',
|
||||
tags: ['console'],
|
||||
})
|
||||
.input(z.object({ params: zGetInstalledAppsByInstalledAppIdMetaPath }))
|
||||
.output(zGetInstalledAppsByInstalledAppIdMetaResponse)
|
||||
.errors({
|
||||
access_denied: { status: 403, data: zAccessDeniedError },
|
||||
app_unavailable: { status: 400, data: zAppUnavailableError },
|
||||
installed_app_not_found: { status: 404, data: zInstalledAppNotFoundError },
|
||||
web_app_access_unavailable: { status: 503, data: zWebAppAccessUnavailableError },
|
||||
})
|
||||
|
||||
export const meta = {
|
||||
get: get5,
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve app parameters
|
||||
*/
|
||||
export const get6 = oc
|
||||
.route({
|
||||
inputStructure: 'detailed',
|
||||
method: 'GET',
|
||||
operationId: 'getInstalledAppsByInstalledAppIdParameters',
|
||||
path: '/installed-apps/{installed_app_id}/parameters',
|
||||
summary: 'Retrieve app parameters',
|
||||
tags: ['console'],
|
||||
})
|
||||
.input(z.object({ params: zGetInstalledAppsByInstalledAppIdParametersPath }))
|
||||
.output(zGetInstalledAppsByInstalledAppIdParametersResponse)
|
||||
.errors({
|
||||
access_denied: { status: 403, data: zAccessDeniedError },
|
||||
app_unavailable: { status: 400, data: zAppUnavailableError },
|
||||
installed_app_not_found: { status: 404, data: zInstalledAppNotFoundError },
|
||||
web_app_access_unavailable: { status: 503, data: zWebAppAccessUnavailableError },
|
||||
})
|
||||
|
||||
export const parameters = {
|
||||
get: get6,
|
||||
}
|
||||
|
||||
export const delete2 = oc
|
||||
.route({
|
||||
inputStructure: 'detailed',
|
||||
method: 'DELETE',
|
||||
operationId: 'deleteInstalledAppsByInstalledAppIdSavedMessagesByMessageId',
|
||||
path: '/installed-apps/{installed_app_id}/saved-messages/{message_id}',
|
||||
successStatus: 204,
|
||||
tags: ['console'],
|
||||
})
|
||||
.input(z.object({ params: zDeleteInstalledAppsByInstalledAppIdSavedMessagesByMessageIdPath }))
|
||||
.output(zDeleteInstalledAppsByInstalledAppIdSavedMessagesByMessageIdResponse)
|
||||
.errors({
|
||||
access_denied: { status: 403, data: zAccessDeniedError },
|
||||
installed_app_not_found: { status: 404, data: zInstalledAppNotFoundError },
|
||||
not_completion_app: { status: 400, data: zNotCompletionAppError },
|
||||
web_app_access_unavailable: { status: 503, data: zWebAppAccessUnavailableError },
|
||||
})
|
||||
|
||||
export const byMessageId2 = {
|
||||
delete: delete2,
|
||||
}
|
||||
|
||||
export const get7 = oc
|
||||
.route({
|
||||
inputStructure: 'detailed',
|
||||
method: 'GET',
|
||||
operationId: 'getInstalledAppsByInstalledAppIdSavedMessages',
|
||||
path: '/installed-apps/{installed_app_id}/saved-messages',
|
||||
tags: ['console'],
|
||||
})
|
||||
.input(
|
||||
z.object({
|
||||
params: zGetInstalledAppsByInstalledAppIdSavedMessagesPath,
|
||||
query: zGetInstalledAppsByInstalledAppIdSavedMessagesQuery.optional(),
|
||||
}),
|
||||
)
|
||||
.output(zGetInstalledAppsByInstalledAppIdSavedMessagesResponse)
|
||||
.errors({
|
||||
access_denied: { status: 403, data: zAccessDeniedError },
|
||||
installed_app_not_found: { status: 404, data: zInstalledAppNotFoundError },
|
||||
not_completion_app: { status: 400, data: zNotCompletionAppError },
|
||||
web_app_access_unavailable: { status: 503, data: zWebAppAccessUnavailableError },
|
||||
})
|
||||
|
||||
export const post8 = oc
|
||||
.route({
|
||||
inputStructure: 'detailed',
|
||||
method: 'POST',
|
||||
operationId: 'postInstalledAppsByInstalledAppIdSavedMessages',
|
||||
path: '/installed-apps/{installed_app_id}/saved-messages',
|
||||
tags: ['console'],
|
||||
})
|
||||
.input(
|
||||
z.object({
|
||||
body: zPostInstalledAppsByInstalledAppIdSavedMessagesBody,
|
||||
params: zPostInstalledAppsByInstalledAppIdSavedMessagesPath,
|
||||
}),
|
||||
)
|
||||
.output(zPostInstalledAppsByInstalledAppIdSavedMessagesResponse)
|
||||
.errors({
|
||||
access_denied: { status: 403, data: zAccessDeniedError },
|
||||
installed_app_not_found: { status: 404, data: zInstalledAppNotFoundError },
|
||||
not_completion_app: { status: 400, data: zNotCompletionAppError },
|
||||
web_app_access_unavailable: { status: 503, data: zWebAppAccessUnavailableError },
|
||||
})
|
||||
|
||||
export const savedMessages = {
|
||||
get: get7,
|
||||
post: post8,
|
||||
byMessageId: byMessageId2,
|
||||
}
|
||||
|
||||
export const post9 = oc
|
||||
.route({
|
||||
inputStructure: 'detailed',
|
||||
method: 'POST',
|
||||
operationId: 'postInstalledAppsByInstalledAppIdTextToAudio',
|
||||
path: '/installed-apps/{installed_app_id}/text-to-audio',
|
||||
tags: ['console'],
|
||||
})
|
||||
.input(
|
||||
z.object({
|
||||
body: zPostInstalledAppsByInstalledAppIdTextToAudioBody,
|
||||
params: zPostInstalledAppsByInstalledAppIdTextToAudioPath,
|
||||
}),
|
||||
)
|
||||
.output(zPostInstalledAppsByInstalledAppIdTextToAudioResponse)
|
||||
.errors({
|
||||
access_denied: { status: 403, data: zAccessDeniedError },
|
||||
agent_version_not_found_error: { status: 404, data: zAgentVersionNotFoundError },
|
||||
app_unavailable: { status: 400, data: zAppUnavailableError },
|
||||
completion_request_error: { status: 400, data: zCompletionRequestError },
|
||||
installed_app_not_found: { status: 404, data: zInstalledAppNotFoundError },
|
||||
model_currently_not_support: { status: 400, data: zModelCurrentlyNotSupportError },
|
||||
provider_not_initialize: { status: 400, data: zProviderNotInitializeError },
|
||||
provider_not_support_text_to_speech: {
|
||||
status: 400,
|
||||
data: zProviderNotSupportTextToSpeechError,
|
||||
},
|
||||
provider_quota_exceeded: { status: 400, data: zProviderQuotaExceededError },
|
||||
web_app_access_unavailable: { status: 503, data: zWebAppAccessUnavailableError },
|
||||
})
|
||||
|
||||
export const textToAudio = {
|
||||
post: post9,
|
||||
}
|
||||
|
||||
/**
|
||||
* Run workflow
|
||||
*/
|
||||
export const post10 = oc
|
||||
.route({
|
||||
inputStructure: 'detailed',
|
||||
method: 'POST',
|
||||
operationId: 'postInstalledAppsByInstalledAppIdWorkflowsRun',
|
||||
path: '/installed-apps/{installed_app_id}/workflows/run',
|
||||
summary: 'Run workflow',
|
||||
tags: ['console'],
|
||||
})
|
||||
.input(
|
||||
z.object({
|
||||
body: zPostInstalledAppsByInstalledAppIdWorkflowsRunBody,
|
||||
params: zPostInstalledAppsByInstalledAppIdWorkflowsRunPath,
|
||||
}),
|
||||
)
|
||||
.output(zPostInstalledAppsByInstalledAppIdWorkflowsRunResponse)
|
||||
.errors({
|
||||
access_denied: { status: 403, data: zAccessDeniedError },
|
||||
completion_request_error: { status: 400, data: zCompletionRequestError },
|
||||
installed_app_not_found: { status: 404, data: zInstalledAppNotFoundError },
|
||||
model_currently_not_support: { status: 400, data: zModelCurrentlyNotSupportError },
|
||||
not_workflow_app: { status: 400, data: zNotWorkflowAppError },
|
||||
provider_not_initialize: { status: 400, data: zProviderNotInitializeError },
|
||||
provider_quota_exceeded: { status: 400, data: zProviderQuotaExceededError },
|
||||
rate_limit_error: { status: 429, data: zRateLimitError },
|
||||
web_app_access_unavailable: { status: 503, data: zWebAppAccessUnavailableError },
|
||||
})
|
||||
|
||||
export const run = {
|
||||
post: post10,
|
||||
}
|
||||
|
||||
/**
|
||||
* Stop workflow task
|
||||
*/
|
||||
export const post11 = oc
|
||||
.route({
|
||||
inputStructure: 'detailed',
|
||||
method: 'POST',
|
||||
operationId: 'postInstalledAppsByInstalledAppIdWorkflowsTasksByTaskIdStop',
|
||||
path: '/installed-apps/{installed_app_id}/workflows/tasks/{task_id}/stop',
|
||||
summary: 'Stop workflow task',
|
||||
tags: ['console'],
|
||||
})
|
||||
.input(z.object({ params: zPostInstalledAppsByInstalledAppIdWorkflowsTasksByTaskIdStopPath }))
|
||||
.output(zPostInstalledAppsByInstalledAppIdWorkflowsTasksByTaskIdStopResponse)
|
||||
.errors({
|
||||
access_denied: { status: 403, data: zAccessDeniedError },
|
||||
installed_app_not_found: { status: 404, data: zInstalledAppNotFoundError },
|
||||
not_workflow_app: { status: 400, data: zNotWorkflowAppError },
|
||||
web_app_access_unavailable: { status: 503, data: zWebAppAccessUnavailableError },
|
||||
})
|
||||
|
||||
export const stop3 = {
|
||||
post: post11,
|
||||
}
|
||||
|
||||
export const byTaskId3 = {
|
||||
stop: stop3,
|
||||
}
|
||||
|
||||
export const tasks = {
|
||||
byTaskId: byTaskId3,
|
||||
}
|
||||
|
||||
export const workflows = {
|
||||
run,
|
||||
tasks,
|
||||
}
|
||||
|
||||
export const get8 = oc
|
||||
.route({
|
||||
inputStructure: 'detailed',
|
||||
method: 'GET',
|
||||
operationId: 'getInstalledAppsByInstalledAppId',
|
||||
path: '/installed-apps/{installed_app_id}',
|
||||
tags: ['console'],
|
||||
})
|
||||
.input(z.object({ params: zGetInstalledAppsByInstalledAppIdPath }))
|
||||
.output(zGetInstalledAppsByInstalledAppIdResponse)
|
||||
.errors({
|
||||
access_denied: { status: 403, data: zAccessDeniedError },
|
||||
installed_app_not_found: { status: 404, data: zInstalledAppNotFoundError },
|
||||
installed_app_unavailable: { status: 404, data: zInstalledAppUnavailableError },
|
||||
web_app_access_unavailable: { status: 503, data: zWebAppAccessUnavailableError },
|
||||
})
|
||||
|
||||
export const patch3 = oc
|
||||
.route({
|
||||
inputStructure: 'detailed',
|
||||
method: 'PATCH',
|
||||
operationId: 'patchInstalledAppsByInstalledAppId',
|
||||
path: '/installed-apps/{installed_app_id}',
|
||||
tags: ['console'],
|
||||
})
|
||||
.input(
|
||||
z.object({
|
||||
body: zPatchInstalledAppsByInstalledAppIdBody,
|
||||
params: zPatchInstalledAppsByInstalledAppIdPath,
|
||||
}),
|
||||
)
|
||||
.output(zPatchInstalledAppsByInstalledAppIdResponse)
|
||||
.errors({
|
||||
access_denied: { status: 403, data: zAccessDeniedError },
|
||||
installed_app_not_found: { status: 404, data: zInstalledAppNotFoundError },
|
||||
web_app_access_unavailable: { status: 503, data: zWebAppAccessUnavailableError },
|
||||
})
|
||||
|
||||
export const byInstalledAppId = {
|
||||
get: get8,
|
||||
patch: patch3,
|
||||
audioToText,
|
||||
chatMessages,
|
||||
completionMessages,
|
||||
conversations,
|
||||
messages,
|
||||
meta,
|
||||
parameters,
|
||||
savedMessages,
|
||||
textToAudio,
|
||||
workflows,
|
||||
}
|
||||
|
||||
export const get9 = oc
|
||||
.route({
|
||||
inputStructure: 'detailed',
|
||||
method: 'GET',
|
||||
operationId: 'getInstalledApps',
|
||||
path: '/installed-apps',
|
||||
tags: ['console'],
|
||||
})
|
||||
.input(z.object({ query: zGetInstalledAppsQuery.optional() }).optional())
|
||||
.output(zGetInstalledAppsResponse)
|
||||
.errors({
|
||||
invalid_cursor: { status: 400, data: zInvalidCursorError },
|
||||
web_app_access_unavailable: { status: 503, data: zWebAppAccessUnavailableError },
|
||||
})
|
||||
|
||||
export const installedApps = {
|
||||
get: get9,
|
||||
byInstalledAppId,
|
||||
}
|
||||
|
||||
export const contract = {
|
||||
installedApps,
|
||||
}
|
||||
+1748
File diff suppressed because it is too large.
Load diff
+1669
File diff suppressed because it is too large.
Load diff
Reference in new issue
Block a user