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.

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

import * as z from 'zod'

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

/**
 * VectorSpaceLimitationModel
 */
export const zVectorSpaceLimitationModel = z.object({
  limit: z.int(),
  size: z.int(),
  usage_unknown: z.boolean().optional().default(false),
})

/**
 * LimitationModel
 */
export const zLimitationModel = z.object({
  limit: z.int().default(0),
  size: z.int().default(0),
})

/**
 * Quota
 */
export const zQuota = z.object({
  limit: z.int().default(0),
  reset_date: z.int().default(-1),
  usage: z.int().default(0),
})

/**
 * EducationModel
 */
export const zEducationModel = z.object({
  activated: z.boolean().default(false),
  enabled: z.boolean().default(false),
})

/**
 * KnowledgePipeline
 */
export const zKnowledgePipeline = z.object({
  publish_enabled: z.boolean().default(false),
})

/**
 * LicenseLimitationModel
 *
 * - enabled: whether this limit is enforced
 * - size: current usage count
 * - limit: maximum allowed count; 0 means unlimited
 */
export const zLicenseLimitationModel = z.object({
  enabled: z.boolean().default(false),
  limit: z.int().default(0),
  size: z.int().default(0),
})

/**
 * CloudPlan
 *
 * Enum representing user plan types in the cloud platform.
 *
 * SANDBOX: Free/default plan with limited features
 * PROFESSIONAL: Professional paid plan
 * TEAM: Team collaboration paid plan
 */
export const zCloudPlan = z.enum(['professional', 'sandbox', 'team'])

/**
 * SubscriptionModel
 */
export const zSubscriptionModel = z.object({
  interval: z.enum(['', 'month', 'year']).default(''),
  plan: zCloudPlan.default('sandbox'),
})

/**
 * BillingModel
 */
export const zBillingModel = z.object({
  subscription: zSubscriptionModel.default({ interval: '', plan: 'sandbox' }),
})

/**
 * FeatureModel
 *
 * Effective feature availability and limits for the current workspace.
 */
export const zFeatureModel = z.object({
  annotation_quota_limit: zLimitationModel.default({ limit: 10, size: 0 }),
  api_rate_limit: zQuota.default({
    limit: 5000,
    reset_date: 0,
    usage: 0,
  }),
  apps: zLimitationModel.default({ limit: 10, size: 0 }),
  billing: zBillingModel.default({ subscription: { interval: '', plan: 'sandbox' } }),
  can_replace_logo: z.boolean().default(false),
  documents_upload_quota: zLimitationModel.default({ limit: 50, size: 0 }),
  education: zEducationModel.default({ activated: false, enabled: false }),
  enable_knowledge_fs: z.boolean().default(false),
  enable_skill: z.boolean().default(true),
  human_input_email_delivery_enabled: z.boolean().default(false),
  im_centrally_managed: z.boolean().default(false),
  is_allow_transfer_workspace: z.boolean().default(true),
  knowledge_pipeline: zKnowledgePipeline.default({ publish_enabled: false }),
  members: zLimitationModel.default({ limit: 1, size: 0 }),
  model_load_balancing_enabled: z.boolean().default(false),
  trigger_event: zQuota.default({
    limit: 3000,
    reset_date: 0,
    usage: 0,
  }),
  webapp_copyright_enabled: z.boolean().default(false),
  workflow_collaboration_enabled: z.boolean().default(false),
  workspace_members: zLicenseLimitationModel.default({
    enabled: false,
    limit: 0,
    size: 0,
  }),
})

/**
 * Success
 */
export const zGetFeaturesResponse = zFeatureModel

/**
 * Success
 */
export const zGetFeaturesVectorSpaceResponse = zVectorSpaceLimitationModel