mirror of
https://github.com/langgenius/dify.git
synced 2026-11-30 00:28:01 +08:00
47 lines
1.3 KiB
TypeScript
Generated
47 lines
1.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 zBillingOperationFailedError = /* @__PURE__ */ (() =>
|
|
zErrorResponse.and(
|
|
z.object({
|
|
code: z.literal('billing_operation_failed'),
|
|
status: z.literal(502),
|
|
}),
|
|
))()
|
|
|
|
const zBillingUnavailableError = /* @__PURE__ */ (() =>
|
|
zErrorResponse.and(
|
|
z.object({
|
|
code: z.literal('billing_unavailable'),
|
|
status: z.literal(503),
|
|
}),
|
|
))()
|
|
|
|
const zAnnualDiscountActiveError = /* @__PURE__ */ (() =>
|
|
zErrorResponse.and(
|
|
z.object({
|
|
code: z.literal('annual_discount_active'),
|
|
status: z.literal(409),
|
|
}),
|
|
))()
|
|
|
|
export const getErrors = {
|
|
billing_operation_failed: { status: 502, data: zBillingOperationFailedError },
|
|
billing_unavailable: { status: 503, data: zBillingUnavailableError },
|
|
}
|
|
|
|
export const get2Errors = {
|
|
annual_discount_active: { status: 409, data: zAnnualDiscountActiveError },
|
|
billing_operation_failed: { status: 502, data: zBillingOperationFailedError },
|
|
billing_unavailable: { status: 503, data: zBillingUnavailableError },
|
|
}
|