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

/**
 * PaidPlanRequiredError
 *
 * This feature requires a paid plan.
 */
export const zPaidPlanRequiredError = zErrorResponse.and(
  z.object({
    code: z.literal('paid_plan_required'),
    status: z.literal(403),
  }),
)

/**
 * WorkflowRunArchiveDownloadPayload
 *
 * Request body for preparing one monthly workflow-run archive download.
 */
export const zWorkflowRunArchiveDownloadPayload = z.object({
  month: z.int().gte(1).lte(12),
  year: z.int().gte(1).lte(9999),
})

/**
 * WorkflowRunArchiveSummaryResponse
 */
export const zWorkflowRunArchiveSummaryResponse = z.object({
  archive_bytes: z.int(),
  archived_month_count: z.int(),
  latest_archived_at: z.iso.datetime().nullish(),
  workflow_run_count: z.int(),
})

/**
 * WorkflowRunArchiveDownloadStatus
 *
 * Lifecycle state for an asynchronous archive download request.
 */
export const zWorkflowRunArchiveDownloadStatus = z.enum([
  'failed',
  'pending',
  'processing',
  'ready',
])

/**
 * WorkflowRunArchiveDownloadTaskResponse
 */
export const zWorkflowRunArchiveDownloadTaskResponse = z.object({
  archive_bytes: z.int(),
  bundle_count: z.int(),
  created_at: z.iso.datetime(),
  download_id: z.string(),
  error: z.string().nullish(),
  expires_at: z.iso.datetime(),
  file_name: z.string().nullish(),
  file_size_bytes: z.int().nullish(),
  finished_at: z.iso.datetime().nullish(),
  month: z.int(),
  started_at: z.iso.datetime().nullish(),
  status: zWorkflowRunArchiveDownloadStatus,
  updated_at: z.iso.datetime(),
  year: z.int(),
})

/**
 * WorkflowRunArchiveMonthResponse
 */
export const zWorkflowRunArchiveMonthResponse = z.object({
  archive_bytes: z.int(),
  bundle_count: z.int(),
  deletion_status: z.enum(['failed', 'pending', 'processing']).nullish(),
  download_task: zWorkflowRunArchiveDownloadTaskResponse.nullish(),
  latest_archived_at: z.iso.datetime(),
  month: z.int(),
  row_count: z.int(),
  workflow_run_count: z.int(),
  year: z.int(),
})

/**
 * WorkflowRunArchiveListResponse
 */
export const zWorkflowRunArchiveListResponse = z.object({
  months: z.array(zWorkflowRunArchiveMonthResponse),
  summary: zWorkflowRunArchiveSummaryResponse,
})

/**
 * WorkflowRunArchiveDeletionStatus
 */
export const zWorkflowRunArchiveDeletionStatus = z.enum([
  'completed',
  'failed',
  'pending',
  'processing',
])

/**
 * WorkflowRunArchiveDeletionTaskResponse
 */
export const zWorkflowRunArchiveDeletionTaskResponse = z.object({
  error: z.string().nullish(),
  month: z.int(),
  status: zWorkflowRunArchiveDeletionStatus,
  year: z.int(),
})

/**
 * Success
 */
export const zGetWorkflowRunArchivesResponse = zWorkflowRunArchiveListResponse

export const zPostWorkflowRunArchivesDownloadsBody = zWorkflowRunArchiveDownloadPayload

/**
 * Download task accepted
 */
export const zPostWorkflowRunArchivesDownloadsResponse = zWorkflowRunArchiveDownloadTaskResponse

export const zGetWorkflowRunArchivesDownloadsByDownloadIdPath = z.object({
  download_id: z.string(),
})

/**
 * Success
 */
export const zGetWorkflowRunArchivesDownloadsByDownloadIdResponse =
  zWorkflowRunArchiveDownloadTaskResponse

export const zDeleteWorkflowRunArchivesByYearByMonthPath = z.object({
  month: z.int().gte(1).lte(12),
  year: z.int().gte(1).lte(9999),
})

/**
 * Archive deletion accepted
 */
export const zDeleteWorkflowRunArchivesByYearByMonthResponse =
  zWorkflowRunArchiveDeletionTaskResponse