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.0 KB
Raw Blame
// This file is auto-generated by @hey-api/openapi-ts

import * as z from 'zod'

/**
 * EmailPayload
 */
export const zEmailPayload = z.object({
  email: z.string(),
  language: z.string().nullish(),
})

/**
 * SimpleResultDataResponse
 */
export const zSimpleResultDataResponse = z.object({
  data: z.string(),
  result: z.string(),
})

/**
 * ErrorResponse
 *
 * Documented non-2xx body emitted by ``register_external_error_handlers``.
 *
 * ``params`` and ``details`` appear only on the errors that set them. The schema
 * stays open because ``HTTPException.data`` may carry extra keys.
 */
export const zErrorResponse = z.object({
  code: z.string(),
  details: z.record(z.string(), z.unknown()).optional(),
  message: z.string(),
  params: z.string().optional(),
  status: z.int(),
})

/**
 * AccountBannedError
 *
 * Account is banned.
 */
export const zAccountBannedError = zErrorResponse.and(
  z.object({
    code: z.literal('account_banned'),
    status: z.literal(400),
  }),
)

/**
 * AccountInFreezeError
 *
 * This email account has been deleted within the past 30 days and is temporarily unavailable for new account registration.
 */
export const zAccountInFreezeError = zErrorResponse.and(
  z.object({
    code: z.literal('account_in_freeze'),
    status: z.literal(400),
  }),
)

/**
 * EmailDomainSuspendedError
 *
 * This email domain has been suspended.
 */
export const zEmailDomainSuspendedError = zErrorResponse.and(
  z.object({
    code: z.literal('email_domain_suspended'),
    status: z.literal(400),
  }),
)

/**
 * PasswordResetRateLimitExceededError
 *
 * Too many password reset emails have been sent. Please try again in {minutes} minutes.
 */
export const zPasswordResetRateLimitExceededError = zErrorResponse.and(
  z.object({
    code: z.literal('password_reset_rate_limit_exceeded'),
    status: z.literal(429),
  }),
)

export const zPostResetPasswordBody = zEmailPayload

/**
 * Success
 */
export const zPostResetPasswordResponse = zSimpleResultDataResponse