mirror of
https://github.com/langgenius/dify.git
synced 2026-11-30 00:28:01 +08:00
Co-authored-by: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
96 lines
2.3 KiB
TypeScript
Generated
96 lines
2.3 KiB
TypeScript
Generated
// This file is auto-generated by scripts/add-orpc-error-maps.ts
|
|
import * as z from 'zod'
|
|
|
|
const zErrorDetail = /* @__PURE__ */ (() =>
|
|
z.object({
|
|
loc: z
|
|
.array(z.union([z.string(), z.int()]))
|
|
.optional()
|
|
.default([]),
|
|
msg: z.string(),
|
|
type: z.string(),
|
|
}))()
|
|
|
|
const zHint = /* @__PURE__ */ (() =>
|
|
z.object({
|
|
form: z.array(z.record(z.string(), z.unknown())).nullish(),
|
|
input: z.record(z.string(), z.unknown()),
|
|
op: z.string(),
|
|
summary: z.string(),
|
|
}))()
|
|
|
|
const zErrorBody = /* @__PURE__ */ (() =>
|
|
z.object({
|
|
code: z.string(),
|
|
details: z.array(zErrorDetail).nullish(),
|
|
hint: z.string().nullish(),
|
|
hints: z.array(zHint).nullish(),
|
|
message: z.string(),
|
|
status: z.int(),
|
|
}))()
|
|
|
|
const zAlreadySubmittedError = /* @__PURE__ */ (() =>
|
|
zErrorBody.and(
|
|
z.object({
|
|
code: z.literal('already_submitted'),
|
|
status: z.literal(409),
|
|
}),
|
|
))()
|
|
|
|
const zExpiredError = /* @__PURE__ */ (() =>
|
|
zErrorBody.and(
|
|
z.object({
|
|
code: z.literal('expired'),
|
|
status: z.literal(410),
|
|
}),
|
|
))()
|
|
|
|
const zInvalidInputError = /* @__PURE__ */ (() =>
|
|
zErrorBody.and(
|
|
z.object({
|
|
code: z.literal('invalid_input'),
|
|
status: z.literal(400),
|
|
}),
|
|
))()
|
|
|
|
const zPaidPlanRequiredError = /* @__PURE__ */ (() =>
|
|
zErrorBody.and(
|
|
z.object({
|
|
code: z.literal('paid_plan_required'),
|
|
status: z.literal(403),
|
|
}),
|
|
))()
|
|
|
|
const zServiceApiDisabledError = /* @__PURE__ */ (() =>
|
|
zErrorBody.and(
|
|
z.object({
|
|
code: z.literal('service_api_disabled'),
|
|
status: z.literal(403),
|
|
}),
|
|
))()
|
|
|
|
const zWorkflowNotActiveError = /* @__PURE__ */ (() =>
|
|
zErrorBody.and(
|
|
z.object({
|
|
code: z.literal('workflow_not_active'),
|
|
status: z.literal(409),
|
|
}),
|
|
))()
|
|
|
|
export const post10Errors = {
|
|
already_submitted: { status: 409, data: zAlreadySubmittedError },
|
|
expired: { status: 410, data: zExpiredError },
|
|
invalid_input: { status: 400, data: zInvalidInputError },
|
|
workflow_not_active: { status: 409, data: zWorkflowNotActiveError },
|
|
}
|
|
|
|
export const get16Errors = {
|
|
already_submitted: { status: 409, data: zAlreadySubmittedError },
|
|
expired: { status: 410, data: zExpiredError },
|
|
}
|
|
|
|
export const post17Errors = {
|
|
paid_plan_required: { status: 403, data: zPaidPlanRequiredError },
|
|
service_api_disabled: { status: 403, data: zServiceApiDisabledError },
|
|
}
|