Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

11.8 KB
Raw Blame
// This file is auto-generated by @hey-api/openapi-ts

import { oc } from '@orpc/contract'
import * as z from 'zod'
import {
  zConsoleAccessServiceCreateEnvironmentApiKeyPath,
  zConsoleAccessServiceCreateEnvironmentApiKeyResponse,
  zConsoleAccessServiceDeleteEnvironmentApiKeyPath,
  zConsoleAccessServiceDeleteEnvironmentApiKeyResponse,
  zConsoleAccessServiceGetEnvironmentApiPath,
  zConsoleAccessServiceGetEnvironmentApiResponse,
  zConsoleAccessServiceGetEnvironmentMcpServerPath,
  zConsoleAccessServiceGetEnvironmentMcpServerResponse,
  zConsoleAccessServiceGetEnvironmentSitePath,
  zConsoleAccessServiceGetEnvironmentSiteResponse,
  zConsoleAccessServiceGetEnvironmentWebAppSubjectsPath,
  zConsoleAccessServiceGetEnvironmentWebAppSubjectsResponse,
  zConsoleAccessServiceListEnvironmentApiKeysPath,
  zConsoleAccessServiceListEnvironmentApiKeysResponse,
  zConsoleAccessServiceListEnvironmentTriggersPath,
  zConsoleAccessServiceListEnvironmentTriggersResponse,
  zConsoleAccessServiceResetEnvironmentSiteAccessTokenPath,
  zConsoleAccessServiceResetEnvironmentSiteAccessTokenResponse,
  zConsoleAccessServiceUpdateEnvironmentApiBody,
  zConsoleAccessServiceUpdateEnvironmentApiPath,
  zConsoleAccessServiceUpdateEnvironmentApiResponse,
  zConsoleAccessServiceUpdateEnvironmentSiteBody,
  zConsoleAccessServiceUpdateEnvironmentSitePath,
  zConsoleAccessServiceUpdateEnvironmentSiteResponse,
  zConsoleAccessServiceUpdateEnvironmentWebAppAccessModeBody,
  zConsoleAccessServiceUpdateEnvironmentWebAppAccessModePath,
  zConsoleAccessServiceUpdateEnvironmentWebAppAccessModeResponse,
  zConsoleDeploymentServiceDeployWorkflowBody,
  zConsoleDeploymentServiceDeployWorkflowPath,
  zConsoleDeploymentServiceDeployWorkflowResponse,
  zConsoleDeploymentServiceGetEnvironmentDeploymentPath,
  zConsoleDeploymentServiceGetEnvironmentDeploymentResponse,
  zConsoleDeploymentServiceGetWorkflowDeploymentOptionsPath,
  zConsoleDeploymentServiceGetWorkflowDeploymentOptionsResponse,
  zConsoleDeploymentServiceListAppEnvironmentsPath,
  zConsoleDeploymentServiceListAppEnvironmentsResponse,
  zConsoleDeploymentServiceListEnvironmentDeploymentsPath,
  zConsoleDeploymentServiceListEnvironmentDeploymentsResponse,
  zConsoleDeploymentServicePrecheckWorkflowDeploymentPath,
  zConsoleDeploymentServicePrecheckWorkflowDeploymentResponse,
  zConsoleDeploymentServiceUndeployWorkflowPath,
  zConsoleDeploymentServiceUndeployWorkflowResponse,
} from './zod.gen.ts'

export const listAppEnvironments = oc
  .route({
    inputStructure: 'detailed',
    method: 'GET',
    operationId: 'ConsoleDeploymentService_ListAppEnvironments',
    path: '/enterprise/app-deploy/apps/{app_id}/environments',
    tags: ['ConsoleDeploymentService'],
  })
  .input(z.object({ params: zConsoleDeploymentServiceListAppEnvironmentsPath }))
  .output(zConsoleDeploymentServiceListAppEnvironmentsResponse)

export const listEnvironmentDeployments = oc
  .route({
    inputStructure: 'detailed',
    method: 'GET',
    operationId: 'ConsoleDeploymentService_ListEnvironmentDeployments',
    path: '/enterprise/app-deploy/apps/{app_id}/workflows/environment-deployments',
    tags: ['ConsoleDeploymentService'],
  })
  .input(z.object({ params: zConsoleDeploymentServiceListEnvironmentDeploymentsPath }))
  .output(zConsoleDeploymentServiceListEnvironmentDeploymentsResponse)

export const getEnvironmentDeployment = oc
  .route({
    inputStructure: 'detailed',
    method: 'GET',
    operationId: 'ConsoleDeploymentService_GetEnvironmentDeployment',
    path: '/enterprise/app-deploy/apps/{app_id}/workflows/environment-deployments/{environment_id}',
    tags: ['ConsoleDeploymentService'],
  })
  .input(z.object({ params: zConsoleDeploymentServiceGetEnvironmentDeploymentPath }))
  .output(zConsoleDeploymentServiceGetEnvironmentDeploymentResponse)

export const getWorkflowDeploymentOptions = oc
  .route({
    inputStructure: 'detailed',
    method: 'GET',
    operationId: 'ConsoleDeploymentService_GetWorkflowDeploymentOptions',
    path: '/enterprise/app-deploy/apps/{app_id}/workflows/{workflow_id}/environments/{environment_id}/deployment-options',
    tags: ['ConsoleDeploymentService'],
  })
  .input(z.object({ params: zConsoleDeploymentServiceGetWorkflowDeploymentOptionsPath }))
  .output(zConsoleDeploymentServiceGetWorkflowDeploymentOptionsResponse)

export const deployWorkflow = oc
  .route({
    inputStructure: 'detailed',
    method: 'POST',
    operationId: 'ConsoleDeploymentService_DeployWorkflow',
    path: '/enterprise/app-deploy/apps/{app_id}/workflows/{workflow_id}/environments/{environment_id}/deployment:deploy',
    tags: ['ConsoleDeploymentService'],
  })
  .input(
    z.object({
      body: zConsoleDeploymentServiceDeployWorkflowBody,
      params: zConsoleDeploymentServiceDeployWorkflowPath,
    }),
  )
  .output(zConsoleDeploymentServiceDeployWorkflowResponse)

export const undeployWorkflow = oc
  .route({
    inputStructure: 'detailed',
    method: 'POST',
    operationId: 'ConsoleDeploymentService_UndeployWorkflow',
    path: '/enterprise/app-deploy/apps/{app_id}/workflows/{workflow_id}/environments/{environment_id}/deployment:undeploy',
    tags: ['ConsoleDeploymentService'],
  })
  .input(z.object({ params: zConsoleDeploymentServiceUndeployWorkflowPath }))
  .output(zConsoleDeploymentServiceUndeployWorkflowResponse)

export const precheckWorkflowDeployment = oc
  .route({
    inputStructure: 'detailed',
    method: 'GET',
    operationId: 'ConsoleDeploymentService_PrecheckWorkflowDeployment',
    path: '/enterprise/app-deploy/apps/{app_id}/workflows/{workflow_id}:precheck',
    tags: ['ConsoleDeploymentService'],
  })
  .input(z.object({ params: zConsoleDeploymentServicePrecheckWorkflowDeploymentPath }))
  .output(zConsoleDeploymentServicePrecheckWorkflowDeploymentResponse)

export const deploymentService = {
  listAppEnvironments,
  listEnvironmentDeployments,
  getEnvironmentDeployment,
  getWorkflowDeploymentOptions,
  deployWorkflow,
  undeployWorkflow,
  precheckWorkflowDeployment,
}

export const getEnvironmentApi = oc
  .route({
    inputStructure: 'detailed',
    method: 'GET',
    operationId: 'ConsoleAccessService_GetEnvironmentAPI',
    path: '/enterprise/app-deploy/apps/{app_id}/environments/{environment_id}/api',
    tags: ['ConsoleAccessService'],
  })
  .input(z.object({ params: zConsoleAccessServiceGetEnvironmentApiPath }))
  .output(zConsoleAccessServiceGetEnvironmentApiResponse)

export const updateEnvironmentApi = oc
  .route({
    inputStructure: 'detailed',
    method: 'PATCH',
    operationId: 'ConsoleAccessService_UpdateEnvironmentAPI',
    path: '/enterprise/app-deploy/apps/{app_id}/environments/{environment_id}/api',
    tags: ['ConsoleAccessService'],
  })
  .input(
    z.object({
      body: zConsoleAccessServiceUpdateEnvironmentApiBody,
      params: zConsoleAccessServiceUpdateEnvironmentApiPath,
    }),
  )
  .output(zConsoleAccessServiceUpdateEnvironmentApiResponse)

export const listEnvironmentApiKeys = oc
  .route({
    inputStructure: 'detailed',
    method: 'GET',
    operationId: 'ConsoleAccessService_ListEnvironmentApiKeys',
    path: '/enterprise/app-deploy/apps/{app_id}/environments/{environment_id}/api-keys',
    tags: ['ConsoleAccessService'],
  })
  .input(z.object({ params: zConsoleAccessServiceListEnvironmentApiKeysPath }))
  .output(zConsoleAccessServiceListEnvironmentApiKeysResponse)

export const createEnvironmentApiKey = oc
  .route({
    inputStructure: 'detailed',
    method: 'POST',
    operationId: 'ConsoleAccessService_CreateEnvironmentApiKey',
    path: '/enterprise/app-deploy/apps/{app_id}/environments/{environment_id}/api-keys',
    tags: ['ConsoleAccessService'],
  })
  .input(z.object({ params: zConsoleAccessServiceCreateEnvironmentApiKeyPath }))
  .output(zConsoleAccessServiceCreateEnvironmentApiKeyResponse)

export const deleteEnvironmentApiKey = oc
  .route({
    inputStructure: 'detailed',
    method: 'DELETE',
    operationId: 'ConsoleAccessService_DeleteEnvironmentApiKey',
    path: '/enterprise/app-deploy/apps/{app_id}/environments/{environment_id}/api-keys/{api_key_id}',
    tags: ['ConsoleAccessService'],
  })
  .input(z.object({ params: zConsoleAccessServiceDeleteEnvironmentApiKeyPath }))
  .output(zConsoleAccessServiceDeleteEnvironmentApiKeyResponse)

export const getEnvironmentMcpServer = oc
  .route({
    inputStructure: 'detailed',
    method: 'GET',
    operationId: 'ConsoleAccessService_GetEnvironmentMCPServer',
    path: '/enterprise/app-deploy/apps/{app_id}/environments/{environment_id}/server',
    tags: ['ConsoleAccessService'],
  })
  .input(z.object({ params: zConsoleAccessServiceGetEnvironmentMcpServerPath }))
  .output(zConsoleAccessServiceGetEnvironmentMcpServerResponse)

export const getEnvironmentSite = oc
  .route({
    inputStructure: 'detailed',
    method: 'GET',
    operationId: 'ConsoleAccessService_GetEnvironmentSite',
    path: '/enterprise/app-deploy/apps/{app_id}/environments/{environment_id}/site',
    tags: ['ConsoleAccessService'],
  })
  .input(z.object({ params: zConsoleAccessServiceGetEnvironmentSitePath }))
  .output(zConsoleAccessServiceGetEnvironmentSiteResponse)

export const updateEnvironmentSite = oc
  .route({
    inputStructure: 'detailed',
    method: 'PATCH',
    operationId: 'ConsoleAccessService_UpdateEnvironmentSite',
    path: '/enterprise/app-deploy/apps/{app_id}/environments/{environment_id}/site',
    tags: ['ConsoleAccessService'],
  })
  .input(
    z.object({
      body: zConsoleAccessServiceUpdateEnvironmentSiteBody,
      params: zConsoleAccessServiceUpdateEnvironmentSitePath,
    }),
  )
  .output(zConsoleAccessServiceUpdateEnvironmentSiteResponse)

export const resetEnvironmentSiteAccessToken = oc
  .route({
    inputStructure: 'detailed',
    method: 'POST',
    operationId: 'ConsoleAccessService_ResetEnvironmentSiteAccessToken',
    path: '/enterprise/app-deploy/apps/{app_id}/environments/{environment_id}/site/access-token-reset',
    tags: ['ConsoleAccessService'],
  })
  .input(z.object({ params: zConsoleAccessServiceResetEnvironmentSiteAccessTokenPath }))
  .output(zConsoleAccessServiceResetEnvironmentSiteAccessTokenResponse)

export const listEnvironmentTriggers = oc
  .route({
    inputStructure: 'detailed',
    method: 'GET',
    operationId: 'ConsoleAccessService_ListEnvironmentTriggers',
    path: '/enterprise/app-deploy/apps/{app_id}/environments/{environment_id}/triggers',
    tags: ['ConsoleAccessService'],
  })
  .input(z.object({ params: zConsoleAccessServiceListEnvironmentTriggersPath }))
  .output(zConsoleAccessServiceListEnvironmentTriggersResponse)

export const updateEnvironmentWebAppAccessMode = oc
  .route({
    inputStructure: 'detailed',
    method: 'POST',
    operationId: 'ConsoleAccessService_UpdateEnvironmentWebAppAccessMode',
    path: '/enterprise/app-deploy/apps/{app_id}/environments/{environment_id}/webapp/access-mode',
    tags: ['ConsoleAccessService'],
  })
  .input(
    z.object({
      body: zConsoleAccessServiceUpdateEnvironmentWebAppAccessModeBody,
      params: zConsoleAccessServiceUpdateEnvironmentWebAppAccessModePath,
    }),
  )
  .output(zConsoleAccessServiceUpdateEnvironmentWebAppAccessModeResponse)

export const getEnvironmentWebAppSubjects = oc
  .route({
    inputStructure: 'detailed',
    method: 'GET',
    operationId: 'ConsoleAccessService_GetEnvironmentWebAppSubjects',
    path: '/enterprise/app-deploy/apps/{app_id}/environments/{environment_id}/webapp/subjects',
    tags: ['ConsoleAccessService'],
  })
  .input(z.object({ params: zConsoleAccessServiceGetEnvironmentWebAppSubjectsPath }))
  .output(zConsoleAccessServiceGetEnvironmentWebAppSubjectsResponse)

export const accessService = {
  getEnvironmentApi,
  updateEnvironmentApi,
  listEnvironmentApiKeys,
  createEnvironmentApiKey,
  deleteEnvironmentApiKey,
  getEnvironmentMcpServer,
  getEnvironmentSite,
  updateEnvironmentSite,
  resetEnvironmentSiteAccessToken,
  listEnvironmentTriggers,
  updateEnvironmentWebAppAccessMode,
  getEnvironmentWebAppSubjects,
}

export const contract = {
  deploymentService,
  accessService,
}