mirror of
https://github.com/langgenius/dify.git
synced 2026-11-10 21:35:45 +08:00
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
46 lines
1.2 KiB
TypeScript
Generated
46 lines
1.2 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 zHumanInputFormSubmittedError = /* @__PURE__ */ (() =>
|
|
zErrorResponse.and(
|
|
z.object({
|
|
code: z.literal('human_input_form_submitted'),
|
|
status: z.literal(412),
|
|
}),
|
|
))()
|
|
|
|
const zInvalidFormDataError = /* @__PURE__ */ (() =>
|
|
zErrorResponse.and(
|
|
z.object({
|
|
code: z.literal('invalid_form_data'),
|
|
status: z.literal(400),
|
|
}),
|
|
))()
|
|
|
|
const zHumanInputFormExpiredError = /* @__PURE__ */ (() =>
|
|
zErrorResponse.and(
|
|
z.object({
|
|
code: z.literal('human_input_form_expired'),
|
|
status: z.literal(412),
|
|
}),
|
|
))()
|
|
|
|
export const getErrors = {
|
|
human_input_form_submitted: { status: 412, data: zHumanInputFormSubmittedError },
|
|
}
|
|
|
|
export const postErrors = {
|
|
human_input_form_expired: { status: 412, data: zHumanInputFormExpiredError },
|
|
human_input_form_submitted: { status: 412, data: zHumanInputFormSubmittedError },
|
|
invalid_form_data: { status: 400, data: zInvalidFormDataError },
|
|
}
|