mirror of
https://github.com/langgenius/dify.git
synced 2026-11-13 23:06:40 +08:00
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
136 lines
4.3 KiB
TypeScript
Generated
136 lines
4.3 KiB
TypeScript
Generated
// 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 zDraftWorkflowNotExistError = /* @__PURE__ */ (() =>
|
|
zErrorResponse.and(
|
|
z.object({
|
|
code: z.literal('draft_workflow_not_exist'),
|
|
status: z.literal(404),
|
|
}),
|
|
))()
|
|
|
|
const zDraftWorkflowNotSyncError = /* @__PURE__ */ (() =>
|
|
zErrorResponse.and(
|
|
z.object({
|
|
code: z.literal('draft_workflow_not_sync'),
|
|
status: z.literal(409),
|
|
}),
|
|
))()
|
|
|
|
const zAgentNotFoundError = /* @__PURE__ */ (() =>
|
|
zErrorResponse.and(
|
|
z.object({
|
|
code: z.literal('agent_not_found_error'),
|
|
status: z.literal(404),
|
|
}),
|
|
))()
|
|
|
|
const zAgentVersionNotFoundError = /* @__PURE__ */ (() =>
|
|
zErrorResponse.and(
|
|
z.object({
|
|
code: z.literal('agent_version_not_found_error'),
|
|
status: z.literal(404),
|
|
}),
|
|
))()
|
|
|
|
const zAgentSoulLockedError = /* @__PURE__ */ (() =>
|
|
zErrorResponse.and(
|
|
z.object({
|
|
code: z.literal('agent_soul_locked_error'),
|
|
status: z.literal(400),
|
|
}),
|
|
))()
|
|
|
|
const zInvalidComposerConfigError = /* @__PURE__ */ (() =>
|
|
zErrorResponse.and(
|
|
z.object({
|
|
code: z.literal('invalid_composer_config_error'),
|
|
status: z.literal(400),
|
|
}),
|
|
))()
|
|
|
|
const zPlaintextSecretNotAllowedError = /* @__PURE__ */ (() =>
|
|
zErrorResponse.and(
|
|
z.object({
|
|
code: z.literal('plaintext_secret_not_allowed_error'),
|
|
status: z.literal(400),
|
|
}),
|
|
))()
|
|
|
|
const zAgentNameConflictError = /* @__PURE__ */ (() =>
|
|
zErrorResponse.and(
|
|
z.object({
|
|
code: z.literal('agent_name_conflict_error'),
|
|
status: z.literal(409),
|
|
}),
|
|
))()
|
|
|
|
const zAgentVersionConflictError = /* @__PURE__ */ (() =>
|
|
zErrorResponse.and(
|
|
z.object({
|
|
code: z.literal('agent_version_conflict_error'),
|
|
status: z.literal(409),
|
|
}),
|
|
))()
|
|
|
|
export const get7Errors = {
|
|
draft_workflow_not_exist: { status: 404, data: zDraftWorkflowNotExistError },
|
|
}
|
|
|
|
export const post4Errors = {
|
|
agent_not_found_error: { status: 404, data: zAgentNotFoundError },
|
|
agent_version_conflict_error: { status: 409, data: zAgentVersionConflictError },
|
|
agent_version_not_found_error: { status: 404, data: zAgentVersionNotFoundError },
|
|
invalid_composer_config_error: { status: 400, data: zInvalidComposerConfigError },
|
|
}
|
|
|
|
export const post6Errors = {
|
|
agent_name_conflict_error: { status: 409, data: zAgentNameConflictError },
|
|
agent_not_found_error: { status: 404, data: zAgentNotFoundError },
|
|
agent_soul_locked_error: { status: 400, data: zAgentSoulLockedError },
|
|
agent_version_not_found_error: { status: 404, data: zAgentVersionNotFoundError },
|
|
invalid_composer_config_error: { status: 400, data: zInvalidComposerConfigError },
|
|
plaintext_secret_not_allowed_error: { status: 400, data: zPlaintextSecretNotAllowedError },
|
|
}
|
|
|
|
export const post7Errors = {
|
|
agent_soul_locked_error: { status: 400, data: zAgentSoulLockedError },
|
|
invalid_composer_config_error: { status: 400, data: zInvalidComposerConfigError },
|
|
plaintext_secret_not_allowed_error: { status: 400, data: zPlaintextSecretNotAllowedError },
|
|
}
|
|
|
|
export const get9Errors = {
|
|
agent_not_found_error: { status: 404, data: zAgentNotFoundError },
|
|
agent_version_not_found_error: { status: 404, data: zAgentVersionNotFoundError },
|
|
}
|
|
|
|
export const putErrors = {
|
|
agent_name_conflict_error: { status: 409, data: zAgentNameConflictError },
|
|
agent_not_found_error: { status: 404, data: zAgentNotFoundError },
|
|
agent_soul_locked_error: { status: 400, data: zAgentSoulLockedError },
|
|
agent_version_not_found_error: { status: 404, data: zAgentVersionNotFoundError },
|
|
invalid_composer_config_error: { status: 400, data: zInvalidComposerConfigError },
|
|
plaintext_secret_not_allowed_error: { status: 400, data: zPlaintextSecretNotAllowedError },
|
|
}
|
|
|
|
export const get14Errors = {
|
|
draft_workflow_not_exist: { status: 404, data: zDraftWorkflowNotExistError },
|
|
}
|
|
|
|
export const get15Errors = {
|
|
draft_workflow_not_exist: { status: 404, data: zDraftWorkflowNotExistError },
|
|
}
|
|
|
|
export const post10Errors = {
|
|
draft_workflow_not_sync: { status: 409, data: zDraftWorkflowNotSyncError },
|
|
}
|