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

import { oc } from '@orpc/contract'
import * as z from 'zod'
import {
  zFileExtensionBlockedError,
  zFileTooLargeError,
  zFilenameNotExistsError,
  zNoFileUploadedError,
  zTooManyFilesError,
  zUnsupportedFileTypeError,
} from './zod.gen.ts'
import {
  zGetFilesByFileIdPreviewPath,
  zGetFilesByFileIdPreviewResponse,
  zGetFilesSupportTypeResponse,
  zGetFilesUploadResponse,
  zPostFilesUploadBody,
  zPostFilesUploadResponse,
} from './zod.gen.ts'

export const get = oc
  .route({
    inputStructure: 'detailed',
    method: 'GET',
    operationId: 'getFilesSupportType',
    path: '/files/support-type',
    tags: ['console'],
  })
  .output(zGetFilesSupportTypeResponse)

export const supportType = {
  get,
}

export const get2 = oc
  .route({
    inputStructure: 'detailed',
    method: 'GET',
    operationId: 'getFilesUpload',
    path: '/files/upload',
    tags: ['console'],
  })
  .output(zGetFilesUploadResponse)

export const post = oc
  .route({
    inputStructure: 'detailed',
    method: 'POST',
    operationId: 'postFilesUpload',
    path: '/files/upload',
    successStatus: 201,
    tags: ['console'],
  })
  .input(z.object({ body: zPostFilesUploadBody }))
  .output(zPostFilesUploadResponse)
  .errors({
    file_extension_blocked: { status: 400, data: zFileExtensionBlockedError },
    file_too_large: { status: 413, data: zFileTooLargeError },
    filename_not_exists_error: { status: 400, data: zFilenameNotExistsError },
    no_file_uploaded: { status: 400, data: zNoFileUploadedError },
    too_many_files: { status: 400, data: zTooManyFilesError },
    unsupported_file_type: { status: 415, data: zUnsupportedFileTypeError },
  })

export const upload = {
  get: get2,
  post,
}

export const get3 = oc
  .route({
    inputStructure: 'detailed',
    method: 'GET',
    operationId: 'getFilesByFileIdPreview',
    path: '/files/{file_id}/preview',
    tags: ['console'],
  })
  .input(z.object({ params: zGetFilesByFileIdPreviewPath }))
  .output(zGetFilesByFileIdPreviewResponse)

export const preview = {
  get: get3,
}

export const byFileId = {
  preview,
}

export const files = {
  supportType,
  upload,
  byFileId,
}

export const contract = {
  files,
}