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

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

import {
  zDeleteRagPipelineCustomizedTemplatesByTemplateIdPath,
  zDeleteRagPipelineCustomizedTemplatesByTemplateIdResponse,
  zDeleteRagPipelinesByPipelineIdWorkflowsByWorkflowIdPath,
  zDeleteRagPipelinesByPipelineIdWorkflowsByWorkflowIdResponse,
  zDeleteRagPipelinesByPipelineIdWorkflowsDraftNodesByNodeIdVariablesPath,
  zDeleteRagPipelinesByPipelineIdWorkflowsDraftNodesByNodeIdVariablesResponse,
  zDeleteRagPipelinesByPipelineIdWorkflowsDraftVariablesByVariableIdPath,
  zDeleteRagPipelinesByPipelineIdWorkflowsDraftVariablesByVariableIdResponse,
  zDeleteRagPipelinesByPipelineIdWorkflowsDraftVariablesPath,
  zDeleteRagPipelinesByPipelineIdWorkflowsDraftVariablesResponse,
  zGetRagPipelinesByPipelineIdExportsPath,
  zGetRagPipelinesByPipelineIdExportsResponse,
  zGetRagPipelinesByPipelineIdWorkflowRunsByRunIdNodeExecutionsPath,
  zGetRagPipelinesByPipelineIdWorkflowRunsByRunIdNodeExecutionsResponse,
  zGetRagPipelinesByPipelineIdWorkflowRunsByRunIdPath,
  zGetRagPipelinesByPipelineIdWorkflowRunsByRunIdResponse,
  zGetRagPipelinesByPipelineIdWorkflowRunsPath,
  zGetRagPipelinesByPipelineIdWorkflowRunsResponse,
  zGetRagPipelinesByPipelineIdWorkflowsDefaultWorkflowBlockConfigsByBlockTypePath,
  zGetRagPipelinesByPipelineIdWorkflowsDefaultWorkflowBlockConfigsByBlockTypeResponse,
  zGetRagPipelinesByPipelineIdWorkflowsDefaultWorkflowBlockConfigsPath,
  zGetRagPipelinesByPipelineIdWorkflowsDefaultWorkflowBlockConfigsResponse,
  zGetRagPipelinesByPipelineIdWorkflowsDraftEnvironmentVariablesPath,
  zGetRagPipelinesByPipelineIdWorkflowsDraftEnvironmentVariablesResponse,
  zGetRagPipelinesByPipelineIdWorkflowsDraftNodesByNodeIdLastRunPath,
  zGetRagPipelinesByPipelineIdWorkflowsDraftNodesByNodeIdLastRunResponse,
  zGetRagPipelinesByPipelineIdWorkflowsDraftNodesByNodeIdVariablesPath,
  zGetRagPipelinesByPipelineIdWorkflowsDraftNodesByNodeIdVariablesResponse,
  zGetRagPipelinesByPipelineIdWorkflowsDraftPath,
  zGetRagPipelinesByPipelineIdWorkflowsDraftPreProcessingParametersPath,
  zGetRagPipelinesByPipelineIdWorkflowsDraftPreProcessingParametersResponse,
  zGetRagPipelinesByPipelineIdWorkflowsDraftProcessingParametersPath,
  zGetRagPipelinesByPipelineIdWorkflowsDraftProcessingParametersResponse,
  zGetRagPipelinesByPipelineIdWorkflowsDraftResponse,
  zGetRagPipelinesByPipelineIdWorkflowsDraftSystemVariablesPath,
  zGetRagPipelinesByPipelineIdWorkflowsDraftSystemVariablesResponse,
  zGetRagPipelinesByPipelineIdWorkflowsDraftVariablesByVariableIdPath,
  zGetRagPipelinesByPipelineIdWorkflowsDraftVariablesByVariableIdResponse,
  zGetRagPipelinesByPipelineIdWorkflowsDraftVariablesPath,
  zGetRagPipelinesByPipelineIdWorkflowsDraftVariablesResponse,
  zGetRagPipelinesByPipelineIdWorkflowsPath,
  zGetRagPipelinesByPipelineIdWorkflowsPublishedPreProcessingParametersPath,
  zGetRagPipelinesByPipelineIdWorkflowsPublishedPreProcessingParametersResponse,
  zGetRagPipelinesByPipelineIdWorkflowsPublishedProcessingParametersPath,
  zGetRagPipelinesByPipelineIdWorkflowsPublishedProcessingParametersResponse,
  zGetRagPipelinesByPipelineIdWorkflowsPublishPath,
  zGetRagPipelinesByPipelineIdWorkflowsPublishResponse,
  zGetRagPipelinesByPipelineIdWorkflowsResponse,
  zGetRagPipelinesDatasourcePluginsResponse,
  zGetRagPipelinesImportsByPipelineIdCheckDependenciesPath,
  zGetRagPipelinesImportsByPipelineIdCheckDependenciesResponse,
  zGetRagPipelinesRecommendedPluginsResponse,
  zGetRagPipelineTemplatesByTemplateIdPath,
  zGetRagPipelineTemplatesByTemplateIdResponse,
  zGetRagPipelineTemplatesResponse,
  zPatchRagPipelineCustomizedTemplatesByTemplateIdPath,
  zPatchRagPipelineCustomizedTemplatesByTemplateIdResponse,
  zPatchRagPipelinesByPipelineIdWorkflowsByWorkflowIdPath,
  zPatchRagPipelinesByPipelineIdWorkflowsByWorkflowIdResponse,
  zPatchRagPipelinesByPipelineIdWorkflowsDraftVariablesByVariableIdPath,
  zPatchRagPipelinesByPipelineIdWorkflowsDraftVariablesByVariableIdResponse,
  zPostRagPipelineCustomizedTemplatesByTemplateIdPath,
  zPostRagPipelineCustomizedTemplatesByTemplateIdResponse,
  zPostRagPipelineDatasetBody,
  zPostRagPipelineDatasetResponse,
  zPostRagPipelineEmptyDatasetResponse,
  zPostRagPipelinesByPipelineIdCustomizedPublishBody,
  zPostRagPipelinesByPipelineIdCustomizedPublishPath,
  zPostRagPipelinesByPipelineIdCustomizedPublishResponse,
  zPostRagPipelinesByPipelineIdWorkflowRunsTasksByTaskIdStopPath,
  zPostRagPipelinesByPipelineIdWorkflowRunsTasksByTaskIdStopResponse,
  zPostRagPipelinesByPipelineIdWorkflowsByWorkflowIdRestorePath,
  zPostRagPipelinesByPipelineIdWorkflowsByWorkflowIdRestoreResponse,
  zPostRagPipelinesByPipelineIdWorkflowsDraftDatasourceNodesByNodeIdRunBody,
  zPostRagPipelinesByPipelineIdWorkflowsDraftDatasourceNodesByNodeIdRunPath,
  zPostRagPipelinesByPipelineIdWorkflowsDraftDatasourceNodesByNodeIdRunResponse,
  zPostRagPipelinesByPipelineIdWorkflowsDraftDatasourceVariablesInspectBody,
  zPostRagPipelinesByPipelineIdWorkflowsDraftDatasourceVariablesInspectPath,
  zPostRagPipelinesByPipelineIdWorkflowsDraftDatasourceVariablesInspectResponse,
  zPostRagPipelinesByPipelineIdWorkflowsDraftIterationNodesByNodeIdRunBody,
  zPostRagPipelinesByPipelineIdWorkflowsDraftIterationNodesByNodeIdRunPath,
  zPostRagPipelinesByPipelineIdWorkflowsDraftIterationNodesByNodeIdRunResponse,
  zPostRagPipelinesByPipelineIdWorkflowsDraftLoopNodesByNodeIdRunBody,
  zPostRagPipelinesByPipelineIdWorkflowsDraftLoopNodesByNodeIdRunPath,
  zPostRagPipelinesByPipelineIdWorkflowsDraftLoopNodesByNodeIdRunResponse,
  zPostRagPipelinesByPipelineIdWorkflowsDraftNodesByNodeIdRunBody,
  zPostRagPipelinesByPipelineIdWorkflowsDraftNodesByNodeIdRunPath,
  zPostRagPipelinesByPipelineIdWorkflowsDraftNodesByNodeIdRunResponse,
  zPostRagPipelinesByPipelineIdWorkflowsDraftPath,
  zPostRagPipelinesByPipelineIdWorkflowsDraftResponse,
  zPostRagPipelinesByPipelineIdWorkflowsDraftRunBody,
  zPostRagPipelinesByPipelineIdWorkflowsDraftRunPath,
  zPostRagPipelinesByPipelineIdWorkflowsDraftRunResponse,
  zPostRagPipelinesByPipelineIdWorkflowsPublishedDatasourceNodesByNodeIdPreviewBody,
  zPostRagPipelinesByPipelineIdWorkflowsPublishedDatasourceNodesByNodeIdPreviewPath,
  zPostRagPipelinesByPipelineIdWorkflowsPublishedDatasourceNodesByNodeIdPreviewResponse,
  zPostRagPipelinesByPipelineIdWorkflowsPublishedDatasourceNodesByNodeIdRunBody,
  zPostRagPipelinesByPipelineIdWorkflowsPublishedDatasourceNodesByNodeIdRunPath,
  zPostRagPipelinesByPipelineIdWorkflowsPublishedDatasourceNodesByNodeIdRunResponse,
  zPostRagPipelinesByPipelineIdWorkflowsPublishedRunBody,
  zPostRagPipelinesByPipelineIdWorkflowsPublishedRunPath,
  zPostRagPipelinesByPipelineIdWorkflowsPublishedRunResponse,
  zPostRagPipelinesByPipelineIdWorkflowsPublishPath,
  zPostRagPipelinesByPipelineIdWorkflowsPublishResponse,
  zPostRagPipelinesImportsBody,
  zPostRagPipelinesImportsByImportIdConfirmPath,
  zPostRagPipelinesImportsByImportIdConfirmResponse,
  zPostRagPipelinesImportsResponse,
  zPostRagPipelinesTransformDatasetsByDatasetIdPath,
  zPostRagPipelinesTransformDatasetsByDatasetIdResponse,
  zPutRagPipelinesByPipelineIdWorkflowsDraftVariablesByVariableIdResetPath,
  zPutRagPipelinesByPipelineIdWorkflowsDraftVariablesByVariableIdResetResponse,
} from './zod.gen'

/**
 * 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 delete_ = oc
  .route({
    deprecated: true,
    description:
      'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.',
    inputStructure: 'detailed',
    method: 'DELETE',
    operationId: 'deleteRagPipelineCustomizedTemplatesByTemplateId',
    path: '/rag/pipeline/customized/templates/{template_id}',
    tags: ['console'],
  })
  .input(z.object({ params: zDeleteRagPipelineCustomizedTemplatesByTemplateIdPath }))
  .output(zDeleteRagPipelineCustomizedTemplatesByTemplateIdResponse)

/**
 * 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 patch = oc
  .route({
    deprecated: true,
    description:
      'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.',
    inputStructure: 'detailed',
    method: 'PATCH',
    operationId: 'patchRagPipelineCustomizedTemplatesByTemplateId',
    path: '/rag/pipeline/customized/templates/{template_id}',
    tags: ['console'],
  })
  .input(z.object({ params: zPatchRagPipelineCustomizedTemplatesByTemplateIdPath }))
  .output(zPatchRagPipelineCustomizedTemplatesByTemplateIdResponse)

export const post = oc
  .route({
    inputStructure: 'detailed',
    method: 'POST',
    operationId: 'postRagPipelineCustomizedTemplatesByTemplateId',
    path: '/rag/pipeline/customized/templates/{template_id}',
    tags: ['console'],
  })
  .input(z.object({ params: zPostRagPipelineCustomizedTemplatesByTemplateIdPath }))
  .output(zPostRagPipelineCustomizedTemplatesByTemplateIdResponse)

export const byTemplateId = {
  delete: delete_,
  patch,
  post,
}

export const templates = {
  byTemplateId,
}

export const customized = {
  templates,
}

/**
 * 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 post2 = oc
  .route({
    deprecated: true,
    description:
      'Generated 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: 'postRagPipelineDataset',
    path: '/rag/pipeline/dataset',
    tags: ['console'],
  })
  .input(z.object({ body: zPostRagPipelineDatasetBody }))
  .output(zPostRagPipelineDatasetResponse)

export const dataset = {
  post: post2,
}

/**
 * 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:
      'Generated 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: 'postRagPipelineEmptyDataset',
    path: '/rag/pipeline/empty-dataset',
    tags: ['console'],
  })
  .output(zPostRagPipelineEmptyDatasetResponse)

export const emptyDataset = {
  post: post3,
}

/**
 * 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:
      'Generated 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: 'getRagPipelineTemplatesByTemplateId',
    path: '/rag/pipeline/templates/{template_id}',
    tags: ['console'],
  })
  .input(z.object({ params: zGetRagPipelineTemplatesByTemplateIdPath }))
  .output(zGetRagPipelineTemplatesByTemplateIdResponse)

export const byTemplateId2 = {
  get,
}

/**
 * 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:
      'Generated 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: 'getRagPipelineTemplates',
    path: '/rag/pipeline/templates',
    tags: ['console'],
  })
  .output(zGetRagPipelineTemplatesResponse)

export const templates2 = {
  get: get2,
  byTemplateId: byTemplateId2,
}

export const pipeline = {
  customized,
  dataset,
  emptyDataset,
  templates: templates2,
}

/**
 * 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 get3 = oc
  .route({
    deprecated: true,
    description:
      'Generated 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: 'getRagPipelinesDatasourcePlugins',
    path: '/rag/pipelines/datasource-plugins',
    tags: ['console'],
  })
  .output(zGetRagPipelinesDatasourcePluginsResponse)

export const datasourcePlugins = {
  get: get3,
}

/**
 * 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 post4 = oc
  .route({
    deprecated: true,
    description:
      'Generated 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: 'postRagPipelinesImportsByImportIdConfirm',
    path: '/rag/pipelines/imports/{import_id}/confirm',
    tags: ['console'],
  })
  .input(z.object({ params: zPostRagPipelinesImportsByImportIdConfirmPath }))
  .output(zPostRagPipelinesImportsByImportIdConfirmResponse)

export const confirm = {
  post: post4,
}

export const byImportId = {
  confirm,
}

/**
 * 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:
      'Generated 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: 'getRagPipelinesImportsByPipelineIdCheckDependencies',
    path: '/rag/pipelines/imports/{pipeline_id}/check-dependencies',
    tags: ['console'],
  })
  .input(z.object({ params: zGetRagPipelinesImportsByPipelineIdCheckDependenciesPath }))
  .output(zGetRagPipelinesImportsByPipelineIdCheckDependenciesResponse)

export const checkDependencies = {
  get: get4,
}

export const byPipelineId = {
  checkDependencies,
}

/**
 * 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:
      'Generated 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: 'postRagPipelinesImports',
    path: '/rag/pipelines/imports',
    tags: ['console'],
  })
  .input(z.object({ body: zPostRagPipelinesImportsBody }))
  .output(zPostRagPipelinesImportsResponse)

export const imports = {
  post: post5,
  byImportId,
  byPipelineId,
}

/**
 * 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 get5 = oc
  .route({
    deprecated: true,
    description:
      'Generated 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: 'getRagPipelinesRecommendedPlugins',
    path: '/rag/pipelines/recommended-plugins',
    tags: ['console'],
  })
  .output(zGetRagPipelinesRecommendedPluginsResponse)

export const recommendedPlugins = {
  get: get5,
}

/**
 * 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:
      'Generated 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: 'postRagPipelinesTransformDatasetsByDatasetId',
    path: '/rag/pipelines/transform/datasets/{dataset_id}',
    tags: ['console'],
  })
  .input(z.object({ params: zPostRagPipelinesTransformDatasetsByDatasetIdPath }))
  .output(zPostRagPipelinesTransformDatasetsByDatasetIdResponse)

export const byDatasetId = {
  post: post6,
}

export const datasets = {
  byDatasetId,
}

export const transform = {
  datasets,
}

/**
 * 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 post7 = oc
  .route({
    deprecated: true,
    description:
      'Generated 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: 'postRagPipelinesByPipelineIdCustomizedPublish',
    path: '/rag/pipelines/{pipeline_id}/customized/publish',
    tags: ['console'],
  })
  .input(
    z.object({
      body: zPostRagPipelinesByPipelineIdCustomizedPublishBody,
      params: zPostRagPipelinesByPipelineIdCustomizedPublishPath,
    }),
  )
  .output(zPostRagPipelinesByPipelineIdCustomizedPublishResponse)

export const publish = {
  post: post7,
}

export const customized2 = {
  publish,
}

/**
 * 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:
      'Generated 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: 'getRagPipelinesByPipelineIdExports',
    path: '/rag/pipelines/{pipeline_id}/exports',
    tags: ['console'],
  })
  .input(z.object({ params: zGetRagPipelinesByPipelineIdExportsPath }))
  .output(zGetRagPipelinesByPipelineIdExportsResponse)

export const exports_ = {
  get: get6,
}

/**
 * Stop workflow task
 */
export const post8 = oc
  .route({
    inputStructure: 'detailed',
    method: 'POST',
    operationId: 'postRagPipelinesByPipelineIdWorkflowRunsTasksByTaskIdStop',
    path: '/rag/pipelines/{pipeline_id}/workflow-runs/tasks/{task_id}/stop',
    summary: 'Stop workflow task',
    tags: ['console'],
  })
  .input(z.object({ params: zPostRagPipelinesByPipelineIdWorkflowRunsTasksByTaskIdStopPath }))
  .output(zPostRagPipelinesByPipelineIdWorkflowRunsTasksByTaskIdStopResponse)

export const stop = {
  post: post8,
}

export const byTaskId = {
  stop,
}

export const tasks = {
  byTaskId,
}

/**
 * Get workflow run node execution list
 */
export const get7 = oc
  .route({
    inputStructure: 'detailed',
    method: 'GET',
    operationId: 'getRagPipelinesByPipelineIdWorkflowRunsByRunIdNodeExecutions',
    path: '/rag/pipelines/{pipeline_id}/workflow-runs/{run_id}/node-executions',
    summary: 'Get workflow run node execution list',
    tags: ['console'],
  })
  .input(z.object({ params: zGetRagPipelinesByPipelineIdWorkflowRunsByRunIdNodeExecutionsPath }))
  .output(zGetRagPipelinesByPipelineIdWorkflowRunsByRunIdNodeExecutionsResponse)

export const nodeExecutions = {
  get: get7,
}

/**
 * Get workflow run detail
 */
export const get8 = oc
  .route({
    inputStructure: 'detailed',
    method: 'GET',
    operationId: 'getRagPipelinesByPipelineIdWorkflowRunsByRunId',
    path: '/rag/pipelines/{pipeline_id}/workflow-runs/{run_id}',
    summary: 'Get workflow run detail',
    tags: ['console'],
  })
  .input(z.object({ params: zGetRagPipelinesByPipelineIdWorkflowRunsByRunIdPath }))
  .output(zGetRagPipelinesByPipelineIdWorkflowRunsByRunIdResponse)

export const byRunId = {
  get: get8,
  nodeExecutions,
}

/**
 * Get workflow run list
 */
export const get9 = oc
  .route({
    inputStructure: 'detailed',
    method: 'GET',
    operationId: 'getRagPipelinesByPipelineIdWorkflowRuns',
    path: '/rag/pipelines/{pipeline_id}/workflow-runs',
    summary: 'Get workflow run list',
    tags: ['console'],
  })
  .input(z.object({ params: zGetRagPipelinesByPipelineIdWorkflowRunsPath }))
  .output(zGetRagPipelinesByPipelineIdWorkflowRunsResponse)

export const workflowRuns = {
  get: get9,
  tasks,
  byRunId,
}

/**
 * Get default block config
 *
 * 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 get10 = oc
  .route({
    deprecated: true,
    description:
      'Generated 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: 'getRagPipelinesByPipelineIdWorkflowsDefaultWorkflowBlockConfigsByBlockType',
    path: '/rag/pipelines/{pipeline_id}/workflows/default-workflow-block-configs/{block_type}',
    summary: 'Get default block config',
    tags: ['console'],
  })
  .input(
    z.object({
      params: zGetRagPipelinesByPipelineIdWorkflowsDefaultWorkflowBlockConfigsByBlockTypePath,
    }),
  )
  .output(zGetRagPipelinesByPipelineIdWorkflowsDefaultWorkflowBlockConfigsByBlockTypeResponse)

export const byBlockType = {
  get: get10,
}

/**
 * Get default block config
 *
 * 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:
      'Generated 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: 'getRagPipelinesByPipelineIdWorkflowsDefaultWorkflowBlockConfigs',
    path: '/rag/pipelines/{pipeline_id}/workflows/default-workflow-block-configs',
    summary: 'Get default block config',
    tags: ['console'],
  })
  .input(z.object({ params: zGetRagPipelinesByPipelineIdWorkflowsDefaultWorkflowBlockConfigsPath }))
  .output(zGetRagPipelinesByPipelineIdWorkflowsDefaultWorkflowBlockConfigsResponse)

export const defaultWorkflowBlockConfigs = {
  get: get11,
  byBlockType,
}

/**
 * Run rag pipeline datasource
 *
 * 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 post9 = oc
  .route({
    deprecated: true,
    description:
      'Generated 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: 'postRagPipelinesByPipelineIdWorkflowsDraftDatasourceNodesByNodeIdRun',
    path: '/rag/pipelines/{pipeline_id}/workflows/draft/datasource/nodes/{node_id}/run',
    summary: 'Run rag pipeline datasource',
    tags: ['console'],
  })
  .input(
    z.object({
      body: zPostRagPipelinesByPipelineIdWorkflowsDraftDatasourceNodesByNodeIdRunBody,
      params: zPostRagPipelinesByPipelineIdWorkflowsDraftDatasourceNodesByNodeIdRunPath,
    }),
  )
  .output(zPostRagPipelinesByPipelineIdWorkflowsDraftDatasourceNodesByNodeIdRunResponse)

export const run = {
  post: post9,
}

export const byNodeId = {
  run,
}

export const nodes = {
  byNodeId,
}

/**
 * Set datasource variables
 *
 * 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 post10 = oc
  .route({
    deprecated: true,
    description:
      'Generated 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: 'postRagPipelinesByPipelineIdWorkflowsDraftDatasourceVariablesInspect',
    path: '/rag/pipelines/{pipeline_id}/workflows/draft/datasource/variables-inspect',
    summary: 'Set datasource variables',
    tags: ['console'],
  })
  .input(
    z.object({
      body: zPostRagPipelinesByPipelineIdWorkflowsDraftDatasourceVariablesInspectBody,
      params: zPostRagPipelinesByPipelineIdWorkflowsDraftDatasourceVariablesInspectPath,
    }),
  )
  .output(zPostRagPipelinesByPipelineIdWorkflowsDraftDatasourceVariablesInspectResponse)

export const variablesInspect = {
  post: post10,
}

export const datasource = {
  nodes,
  variablesInspect,
}

/**
 * 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:
      'Generated 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: 'getRagPipelinesByPipelineIdWorkflowsDraftEnvironmentVariables',
    path: '/rag/pipelines/{pipeline_id}/workflows/draft/environment-variables',
    tags: ['console'],
  })
  .input(z.object({ params: zGetRagPipelinesByPipelineIdWorkflowsDraftEnvironmentVariablesPath }))
  .output(zGetRagPipelinesByPipelineIdWorkflowsDraftEnvironmentVariablesResponse)

export const environmentVariables = {
  get: get12,
}

/**
 * Run draft workflow iteration node
 *
 * 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 post11 = oc
  .route({
    deprecated: true,
    description:
      'Generated 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: 'postRagPipelinesByPipelineIdWorkflowsDraftIterationNodesByNodeIdRun',
    path: '/rag/pipelines/{pipeline_id}/workflows/draft/iteration/nodes/{node_id}/run',
    summary: 'Run draft workflow iteration node',
    tags: ['console'],
  })
  .input(
    z.object({
      body: zPostRagPipelinesByPipelineIdWorkflowsDraftIterationNodesByNodeIdRunBody,
      params: zPostRagPipelinesByPipelineIdWorkflowsDraftIterationNodesByNodeIdRunPath,
    }),
  )
  .output(zPostRagPipelinesByPipelineIdWorkflowsDraftIterationNodesByNodeIdRunResponse)

export const run2 = {
  post: post11,
}

export const byNodeId2 = {
  run: run2,
}

export const nodes2 = {
  byNodeId: byNodeId2,
}

export const iteration = {
  nodes: nodes2,
}

/**
 * Run draft workflow loop node
 *
 * 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 post12 = oc
  .route({
    deprecated: true,
    description:
      'Generated 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: 'postRagPipelinesByPipelineIdWorkflowsDraftLoopNodesByNodeIdRun',
    path: '/rag/pipelines/{pipeline_id}/workflows/draft/loop/nodes/{node_id}/run',
    summary: 'Run draft workflow loop node',
    tags: ['console'],
  })
  .input(
    z.object({
      body: zPostRagPipelinesByPipelineIdWorkflowsDraftLoopNodesByNodeIdRunBody,
      params: zPostRagPipelinesByPipelineIdWorkflowsDraftLoopNodesByNodeIdRunPath,
    }),
  )
  .output(zPostRagPipelinesByPipelineIdWorkflowsDraftLoopNodesByNodeIdRunResponse)

export const run3 = {
  post: post12,
}

export const byNodeId3 = {
  run: run3,
}

export const nodes3 = {
  byNodeId: byNodeId3,
}

export const loop = {
  nodes: nodes3,
}

export const get13 = oc
  .route({
    inputStructure: 'detailed',
    method: 'GET',
    operationId: 'getRagPipelinesByPipelineIdWorkflowsDraftNodesByNodeIdLastRun',
    path: '/rag/pipelines/{pipeline_id}/workflows/draft/nodes/{node_id}/last-run',
    tags: ['console'],
  })
  .input(z.object({ params: zGetRagPipelinesByPipelineIdWorkflowsDraftNodesByNodeIdLastRunPath }))
  .output(zGetRagPipelinesByPipelineIdWorkflowsDraftNodesByNodeIdLastRunResponse)

export const lastRun = {
  get: get13,
}

/**
 * Run draft workflow node
 *
 * 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:
      'Generated 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: 'postRagPipelinesByPipelineIdWorkflowsDraftNodesByNodeIdRun',
    path: '/rag/pipelines/{pipeline_id}/workflows/draft/nodes/{node_id}/run',
    summary: 'Run draft workflow node',
    tags: ['console'],
  })
  .input(
    z.object({
      body: zPostRagPipelinesByPipelineIdWorkflowsDraftNodesByNodeIdRunBody,
      params: zPostRagPipelinesByPipelineIdWorkflowsDraftNodesByNodeIdRunPath,
    }),
  )
  .output(zPostRagPipelinesByPipelineIdWorkflowsDraftNodesByNodeIdRunResponse)

export const run4 = {
  post: post13,
}

/**
 * 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 delete2 = oc
  .route({
    deprecated: true,
    description:
      'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.',
    inputStructure: 'detailed',
    method: 'DELETE',
    operationId: 'deleteRagPipelinesByPipelineIdWorkflowsDraftNodesByNodeIdVariables',
    path: '/rag/pipelines/{pipeline_id}/workflows/draft/nodes/{node_id}/variables',
    tags: ['console'],
  })
  .input(
    z.object({ params: zDeleteRagPipelinesByPipelineIdWorkflowsDraftNodesByNodeIdVariablesPath }),
  )
  .output(zDeleteRagPipelinesByPipelineIdWorkflowsDraftNodesByNodeIdVariablesResponse)

/**
 * 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 get14 = oc
  .route({
    deprecated: true,
    description:
      'Generated 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: 'getRagPipelinesByPipelineIdWorkflowsDraftNodesByNodeIdVariables',
    path: '/rag/pipelines/{pipeline_id}/workflows/draft/nodes/{node_id}/variables',
    tags: ['console'],
  })
  .input(z.object({ params: zGetRagPipelinesByPipelineIdWorkflowsDraftNodesByNodeIdVariablesPath }))
  .output(zGetRagPipelinesByPipelineIdWorkflowsDraftNodesByNodeIdVariablesResponse)

export const variables = {
  delete: delete2,
  get: get14,
}

export const byNodeId4 = {
  lastRun,
  run: run4,
  variables,
}

export const nodes4 = {
  byNodeId: byNodeId4,
}

/**
 * Get first step parameters of rag pipeline
 *
 * 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 get15 = oc
  .route({
    deprecated: true,
    description:
      'Generated 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: 'getRagPipelinesByPipelineIdWorkflowsDraftPreProcessingParameters',
    path: '/rag/pipelines/{pipeline_id}/workflows/draft/pre-processing/parameters',
    summary: 'Get first step parameters of rag pipeline',
    tags: ['console'],
  })
  .input(
    z.object({ params: zGetRagPipelinesByPipelineIdWorkflowsDraftPreProcessingParametersPath }),
  )
  .output(zGetRagPipelinesByPipelineIdWorkflowsDraftPreProcessingParametersResponse)

export const parameters = {
  get: get15,
}

export const preProcessing = {
  parameters,
}

/**
 * Get second step parameters of rag pipeline
 *
 * 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:
      'Generated 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: 'getRagPipelinesByPipelineIdWorkflowsDraftProcessingParameters',
    path: '/rag/pipelines/{pipeline_id}/workflows/draft/processing/parameters',
    summary: 'Get second step parameters of rag pipeline',
    tags: ['console'],
  })
  .input(z.object({ params: zGetRagPipelinesByPipelineIdWorkflowsDraftProcessingParametersPath }))
  .output(zGetRagPipelinesByPipelineIdWorkflowsDraftProcessingParametersResponse)

export const parameters2 = {
  get: get16,
}

export const processing = {
  parameters: parameters2,
}

/**
 * Run draft workflow
 *
 * 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 post14 = oc
  .route({
    deprecated: true,
    description:
      'Generated 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: 'postRagPipelinesByPipelineIdWorkflowsDraftRun',
    path: '/rag/pipelines/{pipeline_id}/workflows/draft/run',
    summary: 'Run draft workflow',
    tags: ['console'],
  })
  .input(
    z.object({
      body: zPostRagPipelinesByPipelineIdWorkflowsDraftRunBody,
      params: zPostRagPipelinesByPipelineIdWorkflowsDraftRunPath,
    }),
  )
  .output(zPostRagPipelinesByPipelineIdWorkflowsDraftRunResponse)

export const run5 = {
  post: post14,
}

/**
 * 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 get17 = oc
  .route({
    deprecated: true,
    description:
      'Generated 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: 'getRagPipelinesByPipelineIdWorkflowsDraftSystemVariables',
    path: '/rag/pipelines/{pipeline_id}/workflows/draft/system-variables',
    tags: ['console'],
  })
  .input(z.object({ params: zGetRagPipelinesByPipelineIdWorkflowsDraftSystemVariablesPath }))
  .output(zGetRagPipelinesByPipelineIdWorkflowsDraftSystemVariablesResponse)

export const systemVariables = {
  get: get17,
}

/**
 * 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 put = oc
  .route({
    deprecated: true,
    description:
      'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.',
    inputStructure: 'detailed',
    method: 'PUT',
    operationId: 'putRagPipelinesByPipelineIdWorkflowsDraftVariablesByVariableIdReset',
    path: '/rag/pipelines/{pipeline_id}/workflows/draft/variables/{variable_id}/reset',
    tags: ['console'],
  })
  .input(
    z.object({ params: zPutRagPipelinesByPipelineIdWorkflowsDraftVariablesByVariableIdResetPath }),
  )
  .output(zPutRagPipelinesByPipelineIdWorkflowsDraftVariablesByVariableIdResetResponse)

export const reset = {
  put,
}

/**
 * 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 delete3 = oc
  .route({
    deprecated: true,
    description:
      'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.',
    inputStructure: 'detailed',
    method: 'DELETE',
    operationId: 'deleteRagPipelinesByPipelineIdWorkflowsDraftVariablesByVariableId',
    path: '/rag/pipelines/{pipeline_id}/workflows/draft/variables/{variable_id}',
    tags: ['console'],
  })
  .input(
    z.object({ params: zDeleteRagPipelinesByPipelineIdWorkflowsDraftVariablesByVariableIdPath }),
  )
  .output(zDeleteRagPipelinesByPipelineIdWorkflowsDraftVariablesByVariableIdResponse)

/**
 * 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 get18 = oc
  .route({
    deprecated: true,
    description:
      'Generated 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: 'getRagPipelinesByPipelineIdWorkflowsDraftVariablesByVariableId',
    path: '/rag/pipelines/{pipeline_id}/workflows/draft/variables/{variable_id}',
    tags: ['console'],
  })
  .input(z.object({ params: zGetRagPipelinesByPipelineIdWorkflowsDraftVariablesByVariableIdPath }))
  .output(zGetRagPipelinesByPipelineIdWorkflowsDraftVariablesByVariableIdResponse)

/**
 * 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 patch2 = oc
  .route({
    deprecated: true,
    description:
      'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.',
    inputStructure: 'detailed',
    method: 'PATCH',
    operationId: 'patchRagPipelinesByPipelineIdWorkflowsDraftVariablesByVariableId',
    path: '/rag/pipelines/{pipeline_id}/workflows/draft/variables/{variable_id}',
    tags: ['console'],
  })
  .input(
    z.object({ params: zPatchRagPipelinesByPipelineIdWorkflowsDraftVariablesByVariableIdPath }),
  )
  .output(zPatchRagPipelinesByPipelineIdWorkflowsDraftVariablesByVariableIdResponse)

export const byVariableId = {
  delete: delete3,
  get: get18,
  patch: patch2,
  reset,
}

/**
 * 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 delete4 = oc
  .route({
    deprecated: true,
    description:
      'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.',
    inputStructure: 'detailed',
    method: 'DELETE',
    operationId: 'deleteRagPipelinesByPipelineIdWorkflowsDraftVariables',
    path: '/rag/pipelines/{pipeline_id}/workflows/draft/variables',
    tags: ['console'],
  })
  .input(z.object({ params: zDeleteRagPipelinesByPipelineIdWorkflowsDraftVariablesPath }))
  .output(zDeleteRagPipelinesByPipelineIdWorkflowsDraftVariablesResponse)

/**
 * 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 get19 = oc
  .route({
    deprecated: true,
    description:
      'Generated 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: 'getRagPipelinesByPipelineIdWorkflowsDraftVariables',
    path: '/rag/pipelines/{pipeline_id}/workflows/draft/variables',
    tags: ['console'],
  })
  .input(z.object({ params: zGetRagPipelinesByPipelineIdWorkflowsDraftVariablesPath }))
  .output(zGetRagPipelinesByPipelineIdWorkflowsDraftVariablesResponse)

export const variables2 = {
  delete: delete4,
  get: get19,
  byVariableId,
}

/**
 * Get draft rag pipeline's workflow
 *
 * 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 get20 = oc
  .route({
    deprecated: true,
    description:
      'Generated 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: 'getRagPipelinesByPipelineIdWorkflowsDraft',
    path: '/rag/pipelines/{pipeline_id}/workflows/draft',
    summary: 'Get draft rag pipeline\'s workflow',
    tags: ['console'],
  })
  .input(z.object({ params: zGetRagPipelinesByPipelineIdWorkflowsDraftPath }))
  .output(zGetRagPipelinesByPipelineIdWorkflowsDraftResponse)

/**
 * Sync draft workflow
 *
 * 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 post15 = oc
  .route({
    deprecated: true,
    description:
      'Generated 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: 'postRagPipelinesByPipelineIdWorkflowsDraft',
    path: '/rag/pipelines/{pipeline_id}/workflows/draft',
    summary: 'Sync draft workflow',
    tags: ['console'],
  })
  .input(z.object({ params: zPostRagPipelinesByPipelineIdWorkflowsDraftPath }))
  .output(zPostRagPipelinesByPipelineIdWorkflowsDraftResponse)

export const draft = {
  get: get20,
  post: post15,
  datasource,
  environmentVariables,
  iteration,
  loop,
  nodes: nodes4,
  preProcessing,
  processing,
  run: run5,
  systemVariables,
  variables: variables2,
}

/**
 * Get published pipeline
 *
 * 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 get21 = oc
  .route({
    deprecated: true,
    description:
      'Generated 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: 'getRagPipelinesByPipelineIdWorkflowsPublish',
    path: '/rag/pipelines/{pipeline_id}/workflows/publish',
    summary: 'Get published pipeline',
    tags: ['console'],
  })
  .input(z.object({ params: zGetRagPipelinesByPipelineIdWorkflowsPublishPath }))
  .output(zGetRagPipelinesByPipelineIdWorkflowsPublishResponse)

/**
 * Publish workflow
 */
export const post16 = oc
  .route({
    inputStructure: 'detailed',
    method: 'POST',
    operationId: 'postRagPipelinesByPipelineIdWorkflowsPublish',
    path: '/rag/pipelines/{pipeline_id}/workflows/publish',
    summary: 'Publish workflow',
    tags: ['console'],
  })
  .input(z.object({ params: zPostRagPipelinesByPipelineIdWorkflowsPublishPath }))
  .output(zPostRagPipelinesByPipelineIdWorkflowsPublishResponse)

export const publish2 = {
  get: get21,
  post: post16,
}

/**
 * Run datasource content preview
 *
 * 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:
      'Generated 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: 'postRagPipelinesByPipelineIdWorkflowsPublishedDatasourceNodesByNodeIdPreview',
    path: '/rag/pipelines/{pipeline_id}/workflows/published/datasource/nodes/{node_id}/preview',
    summary: 'Run datasource content preview',
    tags: ['console'],
  })
  .input(
    z.object({
      body: zPostRagPipelinesByPipelineIdWorkflowsPublishedDatasourceNodesByNodeIdPreviewBody,
      params: zPostRagPipelinesByPipelineIdWorkflowsPublishedDatasourceNodesByNodeIdPreviewPath,
    }),
  )
  .output(zPostRagPipelinesByPipelineIdWorkflowsPublishedDatasourceNodesByNodeIdPreviewResponse)

export const preview = {
  post: post17,
}

/**
 * Run rag pipeline datasource
 *
 * 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:
      'Generated 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: 'postRagPipelinesByPipelineIdWorkflowsPublishedDatasourceNodesByNodeIdRun',
    path: '/rag/pipelines/{pipeline_id}/workflows/published/datasource/nodes/{node_id}/run',
    summary: 'Run rag pipeline datasource',
    tags: ['console'],
  })
  .input(
    z.object({
      body: zPostRagPipelinesByPipelineIdWorkflowsPublishedDatasourceNodesByNodeIdRunBody,
      params: zPostRagPipelinesByPipelineIdWorkflowsPublishedDatasourceNodesByNodeIdRunPath,
    }),
  )
  .output(zPostRagPipelinesByPipelineIdWorkflowsPublishedDatasourceNodesByNodeIdRunResponse)

export const run6 = {
  post: post18,
}

export const byNodeId5 = {
  preview,
  run: run6,
}

export const nodes5 = {
  byNodeId: byNodeId5,
}

export const datasource2 = {
  nodes: nodes5,
}

/**
 * Get first step parameters of rag pipeline
 *
 * 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 get22 = oc
  .route({
    deprecated: true,
    description:
      'Generated 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: 'getRagPipelinesByPipelineIdWorkflowsPublishedPreProcessingParameters',
    path: '/rag/pipelines/{pipeline_id}/workflows/published/pre-processing/parameters',
    summary: 'Get first step parameters of rag pipeline',
    tags: ['console'],
  })
  .input(
    z.object({ params: zGetRagPipelinesByPipelineIdWorkflowsPublishedPreProcessingParametersPath }),
  )
  .output(zGetRagPipelinesByPipelineIdWorkflowsPublishedPreProcessingParametersResponse)

export const parameters3 = {
  get: get22,
}

export const preProcessing2 = {
  parameters: parameters3,
}

/**
 * Get second step parameters of rag pipeline
 *
 * 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 get23 = oc
  .route({
    deprecated: true,
    description:
      'Generated 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: 'getRagPipelinesByPipelineIdWorkflowsPublishedProcessingParameters',
    path: '/rag/pipelines/{pipeline_id}/workflows/published/processing/parameters',
    summary: 'Get second step parameters of rag pipeline',
    tags: ['console'],
  })
  .input(
    z.object({ params: zGetRagPipelinesByPipelineIdWorkflowsPublishedProcessingParametersPath }),
  )
  .output(zGetRagPipelinesByPipelineIdWorkflowsPublishedProcessingParametersResponse)

export const parameters4 = {
  get: get23,
}

export const processing2 = {
  parameters: parameters4,
}

/**
 * Run published workflow
 *
 * 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:
      'Generated 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: 'postRagPipelinesByPipelineIdWorkflowsPublishedRun',
    path: '/rag/pipelines/{pipeline_id}/workflows/published/run',
    summary: 'Run published workflow',
    tags: ['console'],
  })
  .input(
    z.object({
      body: zPostRagPipelinesByPipelineIdWorkflowsPublishedRunBody,
      params: zPostRagPipelinesByPipelineIdWorkflowsPublishedRunPath,
    }),
  )
  .output(zPostRagPipelinesByPipelineIdWorkflowsPublishedRunResponse)

export const run7 = {
  post: post19,
}

export const published = {
  datasource: datasource2,
  preProcessing: preProcessing2,
  processing: processing2,
  run: run7,
}

export const post20 = oc
  .route({
    inputStructure: 'detailed',
    method: 'POST',
    operationId: 'postRagPipelinesByPipelineIdWorkflowsByWorkflowIdRestore',
    path: '/rag/pipelines/{pipeline_id}/workflows/{workflow_id}/restore',
    tags: ['console'],
  })
  .input(z.object({ params: zPostRagPipelinesByPipelineIdWorkflowsByWorkflowIdRestorePath }))
  .output(zPostRagPipelinesByPipelineIdWorkflowsByWorkflowIdRestoreResponse)

export const restore = {
  post: post20,
}

/**
 * Delete a published workflow version that is not currently active on the pipeline
 */
export const delete5 = oc
  .route({
    inputStructure: 'detailed',
    method: 'DELETE',
    operationId: 'deleteRagPipelinesByPipelineIdWorkflowsByWorkflowId',
    path: '/rag/pipelines/{pipeline_id}/workflows/{workflow_id}',
    successStatus: 204,
    summary: 'Delete a published workflow version that is not currently active on the pipeline',
    tags: ['console'],
  })
  .input(z.object({ params: zDeleteRagPipelinesByPipelineIdWorkflowsByWorkflowIdPath }))
  .output(zDeleteRagPipelinesByPipelineIdWorkflowsByWorkflowIdResponse)

/**
 * Update workflow attributes
 *
 * 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 patch3 = oc
  .route({
    deprecated: true,
    description:
      'Generated contract types may be inaccurate because backend OpenAPI annotations are incomplete. Do not migrate callers until the generated contract is accurate.',
    inputStructure: 'detailed',
    method: 'PATCH',
    operationId: 'patchRagPipelinesByPipelineIdWorkflowsByWorkflowId',
    path: '/rag/pipelines/{pipeline_id}/workflows/{workflow_id}',
    summary: 'Update workflow attributes',
    tags: ['console'],
  })
  .input(z.object({ params: zPatchRagPipelinesByPipelineIdWorkflowsByWorkflowIdPath }))
  .output(zPatchRagPipelinesByPipelineIdWorkflowsByWorkflowIdResponse)

export const byWorkflowId = {
  delete: delete5,
  patch: patch3,
  restore,
}

/**
 * Get published workflows
 *
 * 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 get24 = oc
  .route({
    deprecated: true,
    description:
      'Generated 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: 'getRagPipelinesByPipelineIdWorkflows',
    path: '/rag/pipelines/{pipeline_id}/workflows',
    summary: 'Get published workflows',
    tags: ['console'],
  })
  .input(z.object({ params: zGetRagPipelinesByPipelineIdWorkflowsPath }))
  .output(zGetRagPipelinesByPipelineIdWorkflowsResponse)

export const workflows = {
  get: get24,
  defaultWorkflowBlockConfigs,
  draft,
  publish: publish2,
  published,
  byWorkflowId,
}

export const byPipelineId2 = {
  customized: customized2,
  exports: exports_,
  workflowRuns,
  workflows,
}

export const pipelines = {
  datasourcePlugins,
  imports,
  recommendedPlugins,
  transform,
  byPipelineId: byPipelineId2,
}

export const rag = {
  pipeline,
  pipelines,
}

export const contract = {
  rag,
}
