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

import { oc } from '@orpc/contract'
import * as z from 'zod'

import {
  zDeleteConversationsByCIdPath,
  zDeleteConversationsByCIdResponse,
  zDeleteSavedMessagesByMessageIdPath,
  zDeleteSavedMessagesByMessageIdResponse,
  zGetConversationsQuery,
  zGetConversationsResponse,
  zGetFormHumanInputByFormTokenPath,
  zGetFormHumanInputByFormTokenResponse,
  zGetLoginStatusResponse,
  zGetMessagesByMessageIdMoreLikeThisPath,
  zGetMessagesByMessageIdMoreLikeThisQuery,
  zGetMessagesByMessageIdMoreLikeThisResponse,
  zGetMessagesByMessageIdSuggestedQuestionsPath,
  zGetMessagesByMessageIdSuggestedQuestionsResponse,
  zGetMessagesQuery,
  zGetMessagesResponse,
  zGetMetaResponse,
  zGetParametersResponse,
  zGetPassportResponse,
  zGetRemoteFilesByUrlPath,
  zGetRemoteFilesByUrlResponse,
  zGetSavedMessagesQuery,
  zGetSavedMessagesResponse,
  zGetSiteResponse,
  zGetSystemFeaturesResponse,
  zGetWebappAccessModeQuery,
  zGetWebappAccessModeResponse,
  zGetWebappPermissionQuery,
  zGetWebappPermissionResponse,
  zGetWorkflowByTaskIdEventsPath,
  zGetWorkflowByTaskIdEventsResponse,
  zPatchConversationsByCIdPinPath,
  zPatchConversationsByCIdPinResponse,
  zPatchConversationsByCIdUnpinPath,
  zPatchConversationsByCIdUnpinResponse,
  zPostAudioToTextResponse,
  zPostChatMessagesBody,
  zPostChatMessagesByTaskIdStopPath,
  zPostChatMessagesByTaskIdStopResponse,
  zPostChatMessagesResponse,
  zPostCompletionMessagesBody,
  zPostCompletionMessagesByTaskIdStopPath,
  zPostCompletionMessagesByTaskIdStopResponse,
  zPostCompletionMessagesResponse,
  zPostConversationsByCIdNamePath,
  zPostConversationsByCIdNameQuery,
  zPostConversationsByCIdNameResponse,
  zPostEmailCodeLoginBody,
  zPostEmailCodeLoginResponse,
  zPostEmailCodeLoginValidityBody,
  zPostEmailCodeLoginValidityResponse,
  zPostFilesUploadResponse,
  zPostForgotPasswordBody,
  zPostForgotPasswordResetsBody,
  zPostForgotPasswordResetsResponse,
  zPostForgotPasswordResponse,
  zPostForgotPasswordValidityBody,
  zPostForgotPasswordValidityResponse,
  zPostFormHumanInputByFormTokenPath,
  zPostFormHumanInputByFormTokenResponse,
  zPostLoginBody,
  zPostLoginResponse,
  zPostLogoutResponse,
  zPostMessagesByMessageIdFeedbacksPath,
  zPostMessagesByMessageIdFeedbacksQuery,
  zPostMessagesByMessageIdFeedbacksResponse,
  zPostRemoteFilesUploadResponse,
  zPostSavedMessagesQuery,
  zPostSavedMessagesResponse,
  zPostTextToAudioBody,
  zPostTextToAudioResponse,
  zPostWorkflowsRunBody,
  zPostWorkflowsRunResponse,
  zPostWorkflowsTasksByTaskIdStopPath,
  zPostWorkflowsTasksByTaskIdStopResponse,
} from './zod.gen'

/**
 * Convert audio to text
 *
 * Convert audio file to text using speech-to-text service.
 *
 * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.
 *
 * @deprecated
 */
export const post = oc
  .route({
    deprecated: true,
    description:
      'Convert audio file to text using speech-to-text service.\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.',
    inputStructure: 'detailed',
    method: 'POST',
    operationId: 'postAudioToText',
    path: '/audio-to-text',
    summary: 'Convert audio to text',
    tags: ['web'],
  })
  .output(zPostAudioToTextResponse)

export const audioToText = {
  post,
}

/**
 * Stop a running chat message task.
 */
export const post2 = oc
  .route({
    description: 'Stop a running chat message task.',
    inputStructure: 'detailed',
    method: 'POST',
    operationId: 'postChatMessagesByTaskIdStop',
    path: '/chat-messages/{task_id}/stop',
    tags: ['web'],
  })
  .input(z.object({ params: zPostChatMessagesByTaskIdStopPath }))
  .output(zPostChatMessagesByTaskIdStopResponse)

export const stop = {
  post: post2,
}

export const byTaskId = {
  stop,
}

/**
 * Create a chat message for conversational applications.
 *
 * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.
 *
 * @deprecated
 */
export const post3 = oc
  .route({
    deprecated: true,
    description:
      'Create a chat message for conversational applications.\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.',
    inputStructure: 'detailed',
    method: 'POST',
    operationId: 'postChatMessages',
    path: '/chat-messages',
    tags: ['web'],
  })
  .input(z.object({ body: zPostChatMessagesBody }))
  .output(zPostChatMessagesResponse)

export const chatMessages = {
  post: post3,
  byTaskId,
}

/**
 * Stop a running completion message task.
 */
export const post4 = oc
  .route({
    description: 'Stop a running completion message task.',
    inputStructure: 'detailed',
    method: 'POST',
    operationId: 'postCompletionMessagesByTaskIdStop',
    path: '/completion-messages/{task_id}/stop',
    tags: ['web'],
  })
  .input(z.object({ params: zPostCompletionMessagesByTaskIdStopPath }))
  .output(zPostCompletionMessagesByTaskIdStopResponse)

export const stop2 = {
  post: post4,
}

export const byTaskId2 = {
  stop: stop2,
}

/**
 * Create a completion message for text generation applications.
 *
 * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.
 *
 * @deprecated
 */
export const post5 = oc
  .route({
    deprecated: true,
    description:
      'Create a completion message for text generation applications.\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.',
    inputStructure: 'detailed',
    method: 'POST',
    operationId: 'postCompletionMessages',
    path: '/completion-messages',
    tags: ['web'],
  })
  .input(z.object({ body: zPostCompletionMessagesBody }))
  .output(zPostCompletionMessagesResponse)

export const completionMessages = {
  post: post5,
  byTaskId: byTaskId2,
}

/**
 * Rename a specific conversation with a custom name or auto-generate one.
 *
 * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.
 *
 * @deprecated
 */
export const post6 = oc
  .route({
    deprecated: true,
    description:
      'Rename a specific conversation with a custom name or auto-generate one.\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.',
    inputStructure: 'detailed',
    method: 'POST',
    operationId: 'postConversationsByCIdName',
    path: '/conversations/{c_id}/name',
    tags: ['web'],
  })
  .input(
    z.object({
      params: zPostConversationsByCIdNamePath,
      query: zPostConversationsByCIdNameQuery.optional(),
    }),
  )
  .output(zPostConversationsByCIdNameResponse)

export const name = {
  post: post6,
}

/**
 * Pin a specific conversation to keep it at the top of the list.
 */
export const patch = oc
  .route({
    description: 'Pin a specific conversation to keep it at the top of the list.',
    inputStructure: 'detailed',
    method: 'PATCH',
    operationId: 'patchConversationsByCIdPin',
    path: '/conversations/{c_id}/pin',
    tags: ['web'],
  })
  .input(z.object({ params: zPatchConversationsByCIdPinPath }))
  .output(zPatchConversationsByCIdPinResponse)

export const pin = {
  patch,
}

/**
 * Unpin a specific conversation to remove it from the top of the list.
 */
export const patch2 = oc
  .route({
    description: 'Unpin a specific conversation to remove it from the top of the list.',
    inputStructure: 'detailed',
    method: 'PATCH',
    operationId: 'patchConversationsByCIdUnpin',
    path: '/conversations/{c_id}/unpin',
    tags: ['web'],
  })
  .input(z.object({ params: zPatchConversationsByCIdUnpinPath }))
  .output(zPatchConversationsByCIdUnpinResponse)

export const unpin = {
  patch: patch2,
}

/**
 * Delete a specific conversation.
 */
export const delete_ = oc
  .route({
    description: 'Delete a specific conversation.',
    inputStructure: 'detailed',
    method: 'DELETE',
    operationId: 'deleteConversationsByCId',
    path: '/conversations/{c_id}',
    successStatus: 204,
    tags: ['web'],
  })
  .input(z.object({ params: zDeleteConversationsByCIdPath }))
  .output(zDeleteConversationsByCIdResponse)

export const byCId = {
  delete: delete_,
  name,
  pin,
  unpin,
}

/**
 * Retrieve paginated list of conversations for a chat application.
 *
 * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.
 *
 * @deprecated
 */
export const get = oc
  .route({
    deprecated: true,
    description:
      'Retrieve paginated list of conversations for a chat application.\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.',
    inputStructure: 'detailed',
    method: 'GET',
    operationId: 'getConversations',
    path: '/conversations',
    tags: ['web'],
  })
  .input(z.object({ query: zGetConversationsQuery.optional() }))
  .output(zGetConversationsResponse)

export const conversations = {
  get,
  byCId,
}

/**
 * Verify email code and complete login
 */
export const post7 = oc
  .route({
    description: 'Verify email code and complete login',
    inputStructure: 'detailed',
    method: 'POST',
    operationId: 'postEmailCodeLoginValidity',
    path: '/email-code-login/validity',
    tags: ['web'],
  })
  .input(z.object({ body: zPostEmailCodeLoginValidityBody }))
  .output(zPostEmailCodeLoginValidityResponse)

export const validity = {
  post: post7,
}

/**
 * Send email verification code for login
 */
export const post8 = oc
  .route({
    description: 'Send email verification code for login',
    inputStructure: 'detailed',
    method: 'POST',
    operationId: 'postEmailCodeLogin',
    path: '/email-code-login',
    tags: ['web'],
  })
  .input(z.object({ body: zPostEmailCodeLoginBody }))
  .output(zPostEmailCodeLoginResponse)

export const emailCodeLogin = {
  post: post8,
  validity,
}

/**
 * Upload a file for use in web applications
 *
 * Upload a file for use in web applications
 * Accepts file uploads for use within web applications, supporting
 * multiple file types with automatic validation and storage.
 *
 * Args:
 * app_model: The associated application model
 * end_user: The end user uploading the file
 *
 * Form Parameters:
 * file: The file to upload (required)
 * source: Optional source type (datasets or None)
 *
 * Returns:
 * dict: File information including ID, URL, and metadata
 * int: HTTP status code 201 for success
 *
 * Raises:
 * NoFileUploadedError: No file provided in request
 * TooManyFilesError: Multiple files provided (only one allowed)
 * FilenameNotExistsError: File has no filename
 * FileTooLargeError: File exceeds size limit
 * UnsupportedFileTypeError: File type not supported
 */
export const post9 = oc
  .route({
    description:
      'Upload a file for use in web applications\nAccepts file uploads for use within web applications, supporting\nmultiple file types with automatic validation and storage.\n\nArgs:\n    app_model: The associated application model\n    end_user: The end user uploading the file\n\nForm Parameters:\n    file: The file to upload (required)\n    source: Optional source type (datasets or None)\n\nReturns:\n    dict: File information including ID, URL, and metadata\n    int: HTTP status code 201 for success\n\nRaises:\n    NoFileUploadedError: No file provided in request\n    TooManyFilesError: Multiple files provided (only one allowed)\n    FilenameNotExistsError: File has no filename\n    FileTooLargeError: File exceeds size limit\n    UnsupportedFileTypeError: File type not supported',
    inputStructure: 'detailed',
    method: 'POST',
    operationId: 'postFilesUpload',
    path: '/files/upload',
    successStatus: 201,
    summary: 'Upload a file for use in web applications',
    tags: ['web'],
  })
  .output(zPostFilesUploadResponse)

export const upload = {
  post: post9,
}

export const files = {
  upload,
}

/**
 * Reset user password with verification token
 */
export const post10 = oc
  .route({
    description: 'Reset user password with verification token',
    inputStructure: 'detailed',
    method: 'POST',
    operationId: 'postForgotPasswordResets',
    path: '/forgot-password/resets',
    tags: ['web'],
  })
  .input(z.object({ body: zPostForgotPasswordResetsBody }))
  .output(zPostForgotPasswordResetsResponse)

export const resets = {
  post: post10,
}

/**
 * Verify password reset token validity
 */
export const post11 = oc
  .route({
    description: 'Verify password reset token validity',
    inputStructure: 'detailed',
    method: 'POST',
    operationId: 'postForgotPasswordValidity',
    path: '/forgot-password/validity',
    tags: ['web'],
  })
  .input(z.object({ body: zPostForgotPasswordValidityBody }))
  .output(zPostForgotPasswordValidityResponse)

export const validity2 = {
  post: post11,
}

/**
 * Send password reset email
 */
export const post12 = oc
  .route({
    description: 'Send password reset email',
    inputStructure: 'detailed',
    method: 'POST',
    operationId: 'postForgotPassword',
    path: '/forgot-password',
    tags: ['web'],
  })
  .input(z.object({ body: zPostForgotPasswordBody }))
  .output(zPostForgotPasswordResponse)

export const forgotPassword = {
  post: post12,
  resets,
  validity: validity2,
}

/**
 * Get human input form definition by token
 *
 * GET /api/form/human_input/<form_token>
 *
 * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.
 *
 * @deprecated
 */
export const get2 = oc
  .route({
    deprecated: true,
    description:
      'GET /api/form/human_input/<form_token>\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.',
    inputStructure: 'detailed',
    method: 'GET',
    operationId: 'getFormHumanInputByFormToken',
    path: '/form/human_input/{form_token}',
    summary: 'Get human input form definition by token',
    tags: ['web'],
  })
  .input(z.object({ params: zGetFormHumanInputByFormTokenPath }))
  .output(zGetFormHumanInputByFormTokenResponse)

/**
 * Submit human input form by token
 *
 * POST /api/form/human_input/<form_token>
 *
 * Request body:
 * {
 * "inputs": {
 * "content": "User input content"
 * },
 * "action": "Approve"
 * }
 *
 * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.
 *
 * @deprecated
 */
export const post13 = oc
  .route({
    deprecated: true,
    description:
      'POST /api/form/human_input/<form_token>\n\nRequest body:\n{\n    "inputs": {\n        "content": "User input content"\n    },\n    "action": "Approve"\n}\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.',
    inputStructure: 'detailed',
    method: 'POST',
    operationId: 'postFormHumanInputByFormToken',
    path: '/form/human_input/{form_token}',
    summary: 'Submit human input form by token',
    tags: ['web'],
  })
  .input(z.object({ params: zPostFormHumanInputByFormTokenPath }))
  .output(zPostFormHumanInputByFormTokenResponse)

export const byFormToken = {
  get: get2,
  post: post13,
}

export const humanInput = {
  byFormToken,
}

export const form = {
  humanInput,
}

/**
 * Check login status
 */
export const get3 = oc
  .route({
    description: 'Check login status',
    inputStructure: 'detailed',
    method: 'GET',
    operationId: 'getLoginStatus',
    path: '/login/status',
    tags: ['web'],
  })
  .output(zGetLoginStatusResponse)

export const status = {
  get: get3,
}

/**
 * Authenticate user and login
 *
 * Authenticate user for web application access
 */
export const post14 = oc
  .route({
    description: 'Authenticate user for web application access',
    inputStructure: 'detailed',
    method: 'POST',
    operationId: 'postLogin',
    path: '/login',
    summary: 'Authenticate user and login',
    tags: ['web'],
  })
  .input(z.object({ body: zPostLoginBody }))
  .output(zPostLoginResponse)

export const login = {
  post: post14,
  status,
}

/**
 * Logout user from web application
 */
export const post15 = oc
  .route({
    description: 'Logout user from web application',
    inputStructure: 'detailed',
    method: 'POST',
    operationId: 'postLogout',
    path: '/logout',
    tags: ['web'],
  })
  .output(zPostLogoutResponse)

export const logout = {
  post: post15,
}

/**
 * Submit feedback (like/dislike) for a specific message.
 *
 * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.
 *
 * @deprecated
 */
export const post16 = oc
  .route({
    deprecated: true,
    description:
      'Submit feedback (like/dislike) for a specific message.\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.',
    inputStructure: 'detailed',
    method: 'POST',
    operationId: 'postMessagesByMessageIdFeedbacks',
    path: '/messages/{message_id}/feedbacks',
    tags: ['web'],
  })
  .input(
    z.object({
      params: zPostMessagesByMessageIdFeedbacksPath,
      query: zPostMessagesByMessageIdFeedbacksQuery.optional(),
    }),
  )
  .output(zPostMessagesByMessageIdFeedbacksResponse)

export const feedbacks = {
  post: post16,
}

/**
 * Generate a new completion similar to an existing message (completion apps only).
 *
 * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.
 *
 * @deprecated
 */
export const get4 = oc
  .route({
    deprecated: true,
    description:
      'Generate a new completion similar to an existing message (completion apps only).\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.',
    inputStructure: 'detailed',
    method: 'GET',
    operationId: 'getMessagesByMessageIdMoreLikeThis',
    path: '/messages/{message_id}/more-like-this',
    tags: ['web'],
  })
  .input(
    z.object({
      params: zGetMessagesByMessageIdMoreLikeThisPath,
      query: zGetMessagesByMessageIdMoreLikeThisQuery,
    }),
  )
  .output(zGetMessagesByMessageIdMoreLikeThisResponse)

export const moreLikeThis = {
  get: get4,
}

/**
 * Get suggested follow-up questions after a message (chat apps only).
 */
export const get5 = oc
  .route({
    description: 'Get suggested follow-up questions after a message (chat apps only).',
    inputStructure: 'detailed',
    method: 'GET',
    operationId: 'getMessagesByMessageIdSuggestedQuestions',
    path: '/messages/{message_id}/suggested-questions',
    tags: ['web'],
  })
  .input(z.object({ params: zGetMessagesByMessageIdSuggestedQuestionsPath }))
  .output(zGetMessagesByMessageIdSuggestedQuestionsResponse)

export const suggestedQuestions = {
  get: get5,
}

export const byMessageId = {
  feedbacks,
  moreLikeThis,
  suggestedQuestions,
}

/**
 * Retrieve paginated list of messages from a conversation in a chat application.
 *
 * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.
 *
 * @deprecated
 */
export const get6 = oc
  .route({
    deprecated: true,
    description:
      'Retrieve paginated list of messages from a conversation in a chat application.\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.',
    inputStructure: 'detailed',
    method: 'GET',
    operationId: 'getMessages',
    path: '/messages',
    tags: ['web'],
  })
  .input(z.object({ query: zGetMessagesQuery }))
  .output(zGetMessagesResponse)

export const messages = {
  get: get6,
  byMessageId,
}

/**
 * Get app meta
 *
 * Retrieve the metadata for a specific app.
 *
 * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.
 *
 * @deprecated
 */
export const get7 = oc
  .route({
    deprecated: true,
    description:
      'Retrieve the metadata for a specific app.\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.',
    inputStructure: 'detailed',
    method: 'GET',
    operationId: 'getMeta',
    path: '/meta',
    summary: 'Get app meta',
    tags: ['web'],
  })
  .output(zGetMetaResponse)

export const meta = {
  get: get7,
}

/**
 * Retrieve app parameters
 *
 * Retrieve the parameters for a specific app.
 *
 * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.
 *
 * @deprecated
 */
export const get8 = oc
  .route({
    deprecated: true,
    description:
      'Retrieve the parameters for a specific app.\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.',
    inputStructure: 'detailed',
    method: 'GET',
    operationId: 'getParameters',
    path: '/parameters',
    summary: 'Retrieve app parameters',
    tags: ['web'],
  })
  .output(zGetParametersResponse)

export const parameters = {
  get: get8,
}

/**
 * Get authentication passport for web application access
 *
 * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.
 *
 * @deprecated
 */
export const get9 = oc
  .route({
    deprecated: true,
    description:
      'Get authentication passport for web application access\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.',
    inputStructure: 'detailed',
    method: 'GET',
    operationId: 'getPassport',
    path: '/passport',
    tags: ['web'],
  })
  .output(zGetPassportResponse)

export const passport = {
  get: get9,
}

/**
 * Upload a file from a remote URL
 *
 * Upload a file from a remote URL
 * Downloads a file from the provided remote URL and uploads it
 * to the platform storage for use in web applications.
 *
 * Args:
 * app_model: The associated application model
 * end_user: The end user making the request
 *
 * JSON Parameters:
 * url: The remote URL to download the file from (required)
 *
 * Returns:
 * dict: File information including ID, signed URL, and metadata
 * int: HTTP status code 201 for success
 *
 * Raises:
 * RemoteFileUploadError: Failed to fetch file from remote URL
 * FileTooLargeError: File exceeds size limit
 * UnsupportedFileTypeError: File type not supported
 *
 * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.
 *
 * @deprecated
 */
export const post17 = oc
  .route({
    deprecated: true,
    description:
      'Upload a file from a remote URL\nDownloads a file from the provided remote URL and uploads it\nto the platform storage for use in web applications.\n\nArgs:\n    app_model: The associated application model\n    end_user: The end user making the request\n\nJSON Parameters:\n    url: The remote URL to download the file from (required)\n\nReturns:\n    dict: File information including ID, signed URL, and metadata\n    int: HTTP status code 201 for success\n\nRaises:\n    RemoteFileUploadError: Failed to fetch file from remote URL\n    FileTooLargeError: File exceeds size limit\n    UnsupportedFileTypeError: File type not supported\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.',
    inputStructure: 'detailed',
    method: 'POST',
    operationId: 'postRemoteFilesUpload',
    path: '/remote-files/upload',
    successStatus: 201,
    summary: 'Upload a file from a remote URL',
    tags: ['web'],
  })
  .output(zPostRemoteFilesUploadResponse)

export const upload2 = {
  post: post17,
}

/**
 * Get information about a remote file
 *
 * Get information about a remote file
 * Retrieves basic information about a file located at a remote URL,
 * including content type and content length.
 *
 * Args:
 * app_model: The associated application model
 * end_user: The end user making the request
 * url: URL-encoded path to the remote file
 *
 * Returns:
 * dict: Remote file information including type and length
 *
 * Raises:
 * HTTPException: If the remote file cannot be accessed
 */
export const get10 = oc
  .route({
    description:
      'Get information about a remote file\nRetrieves basic information about a file located at a remote URL,\nincluding content type and content length.\n\nArgs:\n    app_model: The associated application model\n    end_user: The end user making the request\n    url: URL-encoded path to the remote file\n\nReturns:\n    dict: Remote file information including type and length\n\nRaises:\n    HTTPException: If the remote file cannot be accessed',
    inputStructure: 'detailed',
    method: 'GET',
    operationId: 'getRemoteFilesByUrl',
    path: '/remote-files/{url}',
    summary: 'Get information about a remote file',
    tags: ['web'],
  })
  .input(z.object({ params: zGetRemoteFilesByUrlPath }))
  .output(zGetRemoteFilesByUrlResponse)

export const byUrl = {
  get: get10,
}

export const remoteFiles = {
  upload: upload2,
  byUrl,
}

/**
 * Remove a message from saved messages.
 */
export const delete2 = oc
  .route({
    description: 'Remove a message from saved messages.',
    inputStructure: 'detailed',
    method: 'DELETE',
    operationId: 'deleteSavedMessagesByMessageId',
    path: '/saved-messages/{message_id}',
    successStatus: 204,
    tags: ['web'],
  })
  .input(z.object({ params: zDeleteSavedMessagesByMessageIdPath }))
  .output(zDeleteSavedMessagesByMessageIdResponse)

export const byMessageId2 = {
  delete: delete2,
}

/**
 * Retrieve paginated list of saved messages for a completion application.
 *
 * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.
 *
 * @deprecated
 */
export const get11 = oc
  .route({
    deprecated: true,
    description:
      'Retrieve paginated list of saved messages for a completion application.\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.',
    inputStructure: 'detailed',
    method: 'GET',
    operationId: 'getSavedMessages',
    path: '/saved-messages',
    tags: ['web'],
  })
  .input(z.object({ query: zGetSavedMessagesQuery.optional() }))
  .output(zGetSavedMessagesResponse)

/**
 * Save a specific message for later reference.
 *
 * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.
 *
 * @deprecated
 */
export const post18 = oc
  .route({
    deprecated: true,
    description:
      'Save a specific message for later reference.\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.',
    inputStructure: 'detailed',
    method: 'POST',
    operationId: 'postSavedMessages',
    path: '/saved-messages',
    tags: ['web'],
  })
  .input(z.object({ query: zPostSavedMessagesQuery }))
  .output(zPostSavedMessagesResponse)

export const savedMessages = {
  get: get11,
  post: post18,
  byMessageId: byMessageId2,
}

/**
 * Retrieve app site info
 *
 * Retrieve app site information and configuration.
 *
 * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.
 *
 * @deprecated
 */
export const get12 = oc
  .route({
    deprecated: true,
    description:
      'Retrieve app site information and configuration.\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.',
    inputStructure: 'detailed',
    method: 'GET',
    operationId: 'getSite',
    path: '/site',
    summary: 'Retrieve app site info',
    tags: ['web'],
  })
  .output(zGetSiteResponse)

export const site = {
  get: get12,
}

/**
 * Get system feature flags and configuration
 *
 * Get system feature flags and configuration
 * Returns the current system feature flags and configuration
 * that control various functionalities across the platform.
 *
 * Returns:
 * dict: System feature configuration object
 *
 * This endpoint is akin to the `SystemFeatureApi` endpoint in api/controllers/console/feature.py,
 * except it is intended for use by the web app, instead of the console dashboard.
 *
 * NOTE: This endpoint is unauthenticated by design, as it provides system features
 * data required for webapp initialization.
 *
 * Authentication would create circular dependency (can't authenticate without webapp loading).
 *
 * Only non-sensitive configuration data should be returned by this endpoint.
 */
export const get13 = oc
  .route({
    description:
      'Get system feature flags and configuration\nReturns the current system feature flags and configuration\nthat control various functionalities across the platform.\n\nReturns:\n    dict: System feature configuration object\n\nThis endpoint is akin to the `SystemFeatureApi` endpoint in api/controllers/console/feature.py,\nexcept it is intended for use by the web app, instead of the console dashboard.\n\nNOTE: This endpoint is unauthenticated by design, as it provides system features\ndata required for webapp initialization.\n\nAuthentication would create circular dependency (can\'t authenticate without webapp loading).\n\nOnly non-sensitive configuration data should be returned by this endpoint.',
    inputStructure: 'detailed',
    method: 'GET',
    operationId: 'getSystemFeatures',
    path: '/system-features',
    summary: 'Get system feature flags and configuration',
    tags: ['web'],
  })
  .output(zGetSystemFeaturesResponse)

export const systemFeatures = {
  get: get13,
}

/**
 * Convert text to audio
 *
 * Convert text to audio using text-to-speech service.
 *
 * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.
 *
 * @deprecated
 */
export const post19 = oc
  .route({
    deprecated: true,
    description:
      'Convert text to audio using text-to-speech service.\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.',
    inputStructure: 'detailed',
    method: 'POST',
    operationId: 'postTextToAudio',
    path: '/text-to-audio',
    summary: 'Convert text to audio',
    tags: ['web'],
  })
  .input(z.object({ body: zPostTextToAudioBody }))
  .output(zPostTextToAudioResponse)

export const textToAudio = {
  post: post19,
}

/**
 * Retrieve the access mode for a web application (public or restricted).
 */
export const get14 = oc
  .route({
    description: 'Retrieve the access mode for a web application (public or restricted).',
    inputStructure: 'detailed',
    method: 'GET',
    operationId: 'getWebappAccessMode',
    path: '/webapp/access-mode',
    tags: ['web'],
  })
  .input(z.object({ query: zGetWebappAccessModeQuery.optional() }))
  .output(zGetWebappAccessModeResponse)

export const accessMode = {
  get: get14,
}

/**
 * Check if user has permission to access a web application.
 */
export const get15 = oc
  .route({
    description: 'Check if user has permission to access a web application.',
    inputStructure: 'detailed',
    method: 'GET',
    operationId: 'getWebappPermission',
    path: '/webapp/permission',
    tags: ['web'],
  })
  .input(z.object({ query: zGetWebappPermissionQuery }))
  .output(zGetWebappPermissionResponse)

export const permission = {
  get: get15,
}

export const webapp = {
  accessMode,
  permission,
}

/**
 * Get workflow execution events stream after resume
 *
 * GET /api/workflow/<task_id>/events
 *
 * Returns Server-Sent Events stream.
 *
 * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.
 *
 * @deprecated
 */
export const get16 = oc
  .route({
    deprecated: true,
    description:
      'GET /api/workflow/<task_id>/events\n\nReturns Server-Sent Events stream.\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.',
    inputStructure: 'detailed',
    method: 'GET',
    operationId: 'getWorkflowByTaskIdEvents',
    path: '/workflow/{task_id}/events',
    summary: 'Get workflow execution events stream after resume',
    tags: ['default'],
  })
  .input(z.object({ params: zGetWorkflowByTaskIdEventsPath }))
  .output(zGetWorkflowByTaskIdEventsResponse)

export const events = {
  get: get16,
}

export const byTaskId3 = {
  events,
}

export const workflow = {
  byTaskId: byTaskId3,
}

/**
 * Run workflow
 *
 * Execute a workflow with provided inputs and files.
 *
 * Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.
 *
 * @deprecated
 */
export const post20 = oc
  .route({
    deprecated: true,
    description:
      'Execute a workflow with provided inputs and files.\n\nGenerated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.',
    inputStructure: 'detailed',
    method: 'POST',
    operationId: 'postWorkflowsRun',
    path: '/workflows/run',
    summary: 'Run workflow',
    tags: ['web'],
  })
  .input(z.object({ body: zPostWorkflowsRunBody }))
  .output(zPostWorkflowsRunResponse)

export const run = {
  post: post20,
}

/**
 * Stop workflow task
 *
 * Stop a running workflow task.
 */
export const post21 = oc
  .route({
    description: 'Stop a running workflow task.',
    inputStructure: 'detailed',
    method: 'POST',
    operationId: 'postWorkflowsTasksByTaskIdStop',
    path: '/workflows/tasks/{task_id}/stop',
    summary: 'Stop workflow task',
    tags: ['web'],
  })
  .input(z.object({ params: zPostWorkflowsTasksByTaskIdStopPath }))
  .output(zPostWorkflowsTasksByTaskIdStopResponse)

export const stop3 = {
  post: post21,
}

export const byTaskId4 = {
  stop: stop3,
}

export const tasks = {
  byTaskId: byTaskId4,
}

export const workflows = {
  run,
  tasks,
}

export const contract = {
  audioToText,
  chatMessages,
  completionMessages,
  conversations,
  emailCodeLogin,
  files,
  forgotPassword,
  form,
  login,
  logout,
  messages,
  meta,
  parameters,
  passport,
  remoteFiles,
  savedMessages,
  site,
  systemFeatures,
  textToAudio,
  webapp,
  workflow,
  workflows,
}
