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.

5.2 KB
Raw Blame
// This file is auto-generated by @hey-api/openapi-ts

import * as z from 'zod'

/**
 * EmailRegisterResetPayload
 */
export const zEmailRegisterResetPayload = z.object({
  language: z.string().nullish(),
  new_password: z.string(),
  password_confirm: z.string(),
  timezone: z.string().nullish(),
  token: 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(),
})

/**
 * 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),
  }),
)

/**
 * EmailAlreadyInUseError
 *
 * A user with this email already exists.
 */
export const zEmailAlreadyInUseError = zErrorResponse.and(
  z.object({
    code: z.literal('email_already_in_use'),
    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),
  }),
)

/**
 * InvalidOrExpiredTokenError
 *
 * The token is invalid or has expired.
 */
export const zInvalidOrExpiredTokenError = zErrorResponse.and(
  z.object({
    code: z.literal('invalid_or_expired_token'),
    status: z.literal(400),
  }),
)

/**
 * LimitExceededError
 *
 * Unable to create account because the licensed seats limit was exceeded
 */
export const zLimitExceededError = zErrorResponse.and(
  z.object({
    code: z.literal('limit_exceeded'),
    status: z.literal(400),
  }),
)

/**
 * NormalizedEmailAlreadyInUseError
 *
 * An account with an equivalent email address already exists.
 */
export const zNormalizedEmailAlreadyInUseError = zErrorResponse.and(
  z.object({
    code: z.literal('normalized_email_already_in_use'),
    status: z.literal(400),
  }),
)

/**
 * PasswordMismatchError
 *
 * The passwords do not match.
 */
export const zPasswordMismatchError = zErrorResponse.and(
  z.object({
    code: z.literal('password_mismatch'),
    status: z.literal(400),
  }),
)

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

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

/**
 * EmailRegisterRateLimitExceededError
 *
 * Too many email register emails have been sent. Please try again in {minutes} minutes.
 */
export const zEmailRegisterRateLimitExceededError = zErrorResponse.and(
  z.object({
    code: z.literal('email_register_rate_limit_exceeded'),
    status: z.literal(429),
  }),
)

/**
 * EmailSendIpLimitError
 *
 * Too many emails have been sent from this IP address recently. Please try again later.
 */
export const zEmailSendIpLimitError = zErrorResponse.and(
  z.object({
    code: z.literal('email_send_ip_limit'),
    status: z.literal(429),
  }),
)

/**
 * EmailRegisterValidityPayload
 */
export const zEmailRegisterValidityPayload = z.object({
  code: z.string(),
  email: z.string(),
  token: z.string(),
})

/**
 * VerificationTokenResponse
 */
export const zVerificationTokenResponse = z.object({
  email: z.string(),
  is_valid: z.boolean(),
  token: z.string(),
})

/**
 * EmailCodeError
 *
 * Email code is invalid or expired.
 */
export const zEmailCodeError = zErrorResponse.and(
  z.object({
    code: z.literal('email_code_error'),
    status: z.literal(400),
  }),
)

/**
 * InvalidEmailError
 *
 * The email address is not valid.
 */
export const zInvalidEmailError = zErrorResponse.and(
  z.object({
    code: z.literal('invalid_email'),
    status: z.literal(400),
  }),
)

/**
 * EmailRegisterLimitError
 *
 * Too many failed email register attempts. Please try again in 24 hours.
 */
export const zEmailRegisterLimitError = zErrorResponse.and(
  z.object({
    code: z.literal('email_register_limit'),
    status: z.literal(429),
  }),
)

/**
 * EmailRegisterTokenPairResponse
 */
export const zEmailRegisterTokenPairResponse = z.object({
  access_token: z.string(),
  csrf_token: z.string(),
  refresh_token: z.string(),
})

/**
 * EmailRegisterResetResponse
 */
export const zEmailRegisterResetResponse = z.object({
  data: zEmailRegisterTokenPairResponse,
  result: z.string(),
})

export const zPostEmailRegisterBody = zEmailRegisterResetPayload

/**
 * Success
 */
export const zPostEmailRegisterResponse = zEmailRegisterResetResponse

export const zPostEmailRegisterSendEmailBody = zEmailRegisterSendPayload

/**
 * Success
 */
export const zPostEmailRegisterSendEmailResponse = zSimpleResultDataResponse

export const zPostEmailRegisterValidityBody = zEmailRegisterValidityPayload

/**
 * Success
 */
export const zPostEmailRegisterValidityResponse = zVerificationTokenResponse