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>
51 lines
1.4 KiB
TypeScript
Generated
51 lines
1.4 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 zAccountInFreezeError = /* @__PURE__ */ (() =>
|
|
zErrorResponse.and(
|
|
z.object({
|
|
code: z.literal('account_in_freeze'),
|
|
status: z.literal(400),
|
|
}),
|
|
))()
|
|
|
|
const zEmailDomainSuspendedError = /* @__PURE__ */ (() =>
|
|
zErrorResponse.and(
|
|
z.object({
|
|
code: z.literal('email_domain_suspended'),
|
|
status: z.literal(400),
|
|
}),
|
|
))()
|
|
|
|
const zAlreadyActivateError = /* @__PURE__ */ (() =>
|
|
zErrorResponse.and(
|
|
z.object({
|
|
code: z.literal('already_activate'),
|
|
status: z.literal(403),
|
|
}),
|
|
))()
|
|
|
|
const zInvitationAccountMismatchError = /* @__PURE__ */ (() =>
|
|
zErrorResponse.and(
|
|
z.object({
|
|
code: z.literal('invitation_account_mismatch'),
|
|
status: z.literal(403),
|
|
}),
|
|
))()
|
|
|
|
export const postErrors = {
|
|
account_in_freeze: { status: 400, data: zAccountInFreezeError },
|
|
already_activate: { status: 403, data: zAlreadyActivateError },
|
|
email_domain_suspended: { status: 400, data: zEmailDomainSuspendedError },
|
|
invitation_account_mismatch: { status: 403, data: zInvitationAccountMismatchError },
|
|
}
|