Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

2.5 KB
Raw Blame
// 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 zEmailSendIpLimitError = /* @__PURE__ */ (() =>
  zErrorResponse.and(
    z.object({
      code: z.literal('email_send_ip_limit'),
      status: z.literal(429),
    }),
  ))()

const zPasswordResetRateLimitExceededError = /* @__PURE__ */ (() =>
  zErrorResponse.and(
    z.object({
      code: z.literal('password_reset_rate_limit_exceeded'),
      status: z.literal(429),
    }),
  ))()

const zAccountNotFoundError = /* @__PURE__ */ (() =>
  zErrorResponse.and(
    z.object({
      code: z.literal('account_not_found'),
      status: z.literal(400),
    }),
  ))()

const zInvalidOrExpiredTokenError = /* @__PURE__ */ (() =>
  zErrorResponse.and(
    z.object({
      code: z.literal('invalid_or_expired_token'),
      status: z.literal(400),
    }),
  ))()

const zPasswordMismatchError = /* @__PURE__ */ (() =>
  zErrorResponse.and(
    z.object({
      code: z.literal('password_mismatch'),
      status: z.literal(400),
    }),
  ))()

const zEmailCodeError = /* @__PURE__ */ (() =>
  zErrorResponse.and(
    z.object({
      code: z.literal('email_code_error'),
      status: z.literal(400),
    }),
  ))()

const zInvalidEmailError = /* @__PURE__ */ (() =>
  zErrorResponse.and(
    z.object({
      code: z.literal('invalid_email'),
      status: z.literal(400),
    }),
  ))()

const zEmailPasswordResetLimitError = /* @__PURE__ */ (() =>
  zErrorResponse.and(
    z.object({
      code: z.literal('email_password_reset_limit'),
      status: z.literal(429),
    }),
  ))()

export const postErrors = {
  account_not_found: { status: 400, data: zAccountNotFoundError },
  invalid_or_expired_token: { status: 400, data: zInvalidOrExpiredTokenError },
  password_mismatch: { status: 400, data: zPasswordMismatchError },
}

export const post2Errors = {
  email_code_error: { status: 400, data: zEmailCodeError },
  email_password_reset_limit: { status: 429, data: zEmailPasswordResetLimitError },
  invalid_email: { status: 400, data: zInvalidEmailError },
  invalid_or_expired_token: { status: 400, data: zInvalidOrExpiredTokenError },
}

export const post3Errors = {
  email_send_ip_limit: { status: 429, data: zEmailSendIpLimitError },
  password_reset_rate_limit_exceeded: { status: 429, data: zPasswordResetRateLimitExceededError },
}