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.

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

/**
 * BrandingModel
 */
export const zBrandingModel = z.object({
  application_title: z.string().default(''),
  enabled: z.boolean().default(false),
  favicon: z.string().default(''),
  login_page_logo: z.string().default(''),
  workspace_logo: z.string().default(''),
})

/**
 * DeploymentEdition
 *
 * Enum representing the deployment edition of the platform.
 */
export const zDeploymentEdition = z.enum(['CLOUD', 'COMMUNITY', 'ENTERPRISE'])

/**
 * SSOProtocol
 */
export const zSsoProtocol = z.enum(['oauth2', 'oidc', 'saml'])

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

/**
 * LicenseStatus
 */
export const zLicenseStatus = z.enum(['active', 'expired', 'expiring', 'inactive', 'lost', 'none'])

/**
 * LicenseModel
 */
export const zLicenseModel = z.object({
  expired_at: z.string().default(''),
  license_expiry_notice_enabled: z.boolean().default(false),
  seats: zLicenseLimitationModel.default({
    enabled: false,
    limit: 0,
    size: 0,
  }),
  status: zLicenseStatus.default('none'),
  workspaces: zLicenseLimitationModel.default({
    enabled: false,
    limit: 0,
    size: 0,
  }),
})

/**
 * LicenseStatusModel
 */
export const zLicenseStatusModel = z.object({
  status: zLicenseStatus.default('none'),
})

/**
 * PluginInstallationScope
 */
export const zPluginInstallationScope = z.enum([
  'all',
  'none',
  'official_and_specific_partners',
  'official_only',
])

/**
 * PluginInstallationPermissionModel
 */
export const zPluginInstallationPermissionModel = z.object({
  plugin_installation_scope: zPluginInstallationScope.default('all'),
  restrict_to_marketplace_only: z.boolean().default(false),
})

/**
 * WebAppAuthSSOModel
 */
export const zWebAppAuthSsoModel = z.object({
  protocol: zSsoProtocol.nullable(),
})

/**
 * WebAppAuthModel
 */
export const zWebAppAuthModel = z.object({
  allow_email_code_login: z.boolean().default(false),
  allow_email_password_login: z.boolean().default(false),
  allow_public_access: z.boolean().default(true),
  allow_sso: z.boolean().default(false),
  enabled: z.boolean().default(false),
  sso_config: zWebAppAuthSsoModel,
})

/**
 * SystemFeatureModel
 *
 * Non-sensitive bootstrap snapshot exposed before Console or Web authentication.
 */
export const zSystemFeatureModel = z.object({
  agent_tracing_api_collection_enabled: z.boolean(),
  branding: zBrandingModel.default({
    application_title: '',
    enabled: false,
    favicon: '',
    login_page_logo: '',
    workspace_logo: '',
  }),
  deployment_edition: zDeploymentEdition,
  enable_app_deploy: z.boolean().default(false),
  enable_change_email: z.boolean().default(true),
  enable_creators_platform: z.boolean().default(false),
  enable_email_code_login: z.boolean().default(false),
  enable_email_password_login: z.boolean().default(true),
  enable_explore_banner: z.boolean().default(false),
  enable_learn_app: z.boolean().default(true),
  enable_marketplace: z.boolean().default(false),
  enable_social_oauth_login: z.boolean().default(false),
  enable_step_by_step_tour: z.boolean().default(false),
  is_allow_register: z.boolean().default(false),
  is_email_setup: z.boolean().default(false),
  license: zLicenseStatusModel.default({ status: 'none' }),
  plugin_installation_permission: zPluginInstallationPermissionModel.default({
    plugin_installation_scope: 'all',
    restrict_to_marketplace_only: false,
  }),
  rbac_enabled: z.boolean().default(false),
  sso_enforced_for_signin: z.boolean().default(false),
  sso_enforced_for_signin_protocol: zSsoProtocol.nullable(),
  webapp_auth: zWebAppAuthModel,
})

/**
 * Success
 */
export const zGetSystemFeaturesResponse = zSystemFeatureModel

/**
 * Success
 */
export const zGetSystemFeaturesLicenseResponse = zLicenseModel