mirror of
https://github.com/langgenius/dify.git
synced 2026-11-13 06:41:07 +08:00
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
69 lines
1.8 KiB
TypeScript
Generated
69 lines
1.8 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 zFileExtensionBlockedError = /* @__PURE__ */ (() =>
|
|
zErrorResponse.and(
|
|
z.object({
|
|
code: z.literal('file_extension_blocked'),
|
|
status: z.literal(400),
|
|
}),
|
|
))()
|
|
|
|
const zFilenameNotExistsError = /* @__PURE__ */ (() =>
|
|
zErrorResponse.and(
|
|
z.object({
|
|
code: z.literal('filename_not_exists_error'),
|
|
status: z.literal(400),
|
|
}),
|
|
))()
|
|
|
|
const zNoFileUploadedError = /* @__PURE__ */ (() =>
|
|
zErrorResponse.and(
|
|
z.object({
|
|
code: z.literal('no_file_uploaded'),
|
|
status: z.literal(400),
|
|
}),
|
|
))()
|
|
|
|
const zTooManyFilesError = /* @__PURE__ */ (() =>
|
|
zErrorResponse.and(
|
|
z.object({
|
|
code: z.literal('too_many_files'),
|
|
status: z.literal(400),
|
|
}),
|
|
))()
|
|
|
|
const zFileTooLargeError = /* @__PURE__ */ (() =>
|
|
zErrorResponse.and(
|
|
z.object({
|
|
code: z.literal('file_too_large'),
|
|
status: z.literal(413),
|
|
}),
|
|
))()
|
|
|
|
const zUnsupportedFileTypeError = /* @__PURE__ */ (() =>
|
|
zErrorResponse.and(
|
|
z.object({
|
|
code: z.literal('unsupported_file_type'),
|
|
status: z.literal(415),
|
|
}),
|
|
))()
|
|
|
|
export const postErrors = {
|
|
file_extension_blocked: { status: 400, data: zFileExtensionBlockedError },
|
|
file_too_large: { status: 413, data: zFileTooLargeError },
|
|
filename_not_exists_error: { status: 400, data: zFilenameNotExistsError },
|
|
no_file_uploaded: { status: 400, data: zNoFileUploadedError },
|
|
too_many_files: { status: 400, data: zTooManyFilesError },
|
|
unsupported_file_type: { status: 415, data: zUnsupportedFileTypeError },
|
|
}
|