// This file is auto-generated by @hey-api/openapi-ts

import * as z from 'zod'

/**
 * AllowedExtensionsResponse
 */
export const zAllowedExtensionsResponse = z.object({
  allowed_extensions: z.array(z.string()),
})

/**
 * UploadConfig
 */
export const zUploadConfig = z.object({
  attachment_image_file_size_limit: z.int(),
  audio_file_size_limit: z.int(),
  batch_count_limit: z.int(),
  file_size_limit: z.int(),
  file_upload_limit: z.int(),
  image_file_batch_limit: z.int(),
  image_file_size_limit: z.int(),
  single_chunk_attachment_limit: z.int(),
  video_file_size_limit: z.int(),
  workflow_file_upload_limit: z.int(),
})

/**
 * FileResponse
 */
export const zFileResponse = z.object({
  conversation_id: z.string().nullish(),
  created_at: z.int().nullish(),
  created_by: z.string().nullish(),
  extension: z.string().nullish(),
  file_key: z.string().nullish(),
  id: z.string(),
  mime_type: z.string().nullish(),
  name: z.string(),
  original_url: z.string().nullish(),
  preview_url: z.string().nullish(),
  reference: z.string().nullish(),
  size: z.int(),
  source_url: z.string().nullish(),
  tenant_id: z.string().nullish(),
  user_id: z.string().nullish(),
})

/**
 * TextContentResponse
 */
export const zTextContentResponse = z.object({
  content: z.string(),
})

/**
 * Success
 */
export const zGetFilesSupportTypeResponse = zAllowedExtensionsResponse

/**
 * Success
 */
export const zGetFilesUploadResponse = zUploadConfig

export const zPostFilesUploadBody = z.object({
  file: z.custom<Blob | File>((value) => value instanceof Blob || value instanceof File),
  source: z.enum(['datasets']).optional(),
})

/**
 * File uploaded successfully
 */
export const zPostFilesUploadResponse = zFileResponse

export const zGetFilesByFileIdPreviewPath = z.object({
  file_id: z.uuid(),
})

/**
 * Success
 */
export const zGetFilesByFileIdPreviewResponse = zTextContentResponse
