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.

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

import * as z from 'zod'

/**
 * OAuthDataSourceBindingResponse
 */
export const zOAuthDataSourceBindingResponse = z.object({
  result: z.string(),
})

/**
 * ErrorMessageResponse
 *
 * Legacy ``{"error": message}`` body a few endpoints return instead of the standard error body.
 */
export const zErrorMessageResponse = z.object({
  error: z.string(),
})

/**
 * ErrorResponse
 *
 * Documented non-2xx body emitted by ``register_external_error_handlers``.
 *
 * ``params`` and ``details`` appear only on the errors that set them. The schema
 * stays open because ``HTTPException.data`` may carry extra keys.
 */
export const zErrorResponse = z.object({
  code: z.string(),
  details: z.record(z.string(), z.unknown()).optional(),
  message: z.string(),
  params: z.string().optional(),
  status: z.int(),
})

/**
 * OAuthDataSourceResponse
 */
export const zOAuthDataSourceResponse = z.object({
  data: z.string(),
})

/**
 * OAuthDataSourceSyncResponse
 */
export const zOAuthDataSourceSyncResponse = z.object({
  result: z.string(),
})

/**
 * PluginOAuthAuthorizationUrlResponse
 */
export const zPluginOAuthAuthorizationUrlResponse = z.object({
  authorization_url: z.string(),
})

/**
 * OAuthProviderRequest
 */
export const zOAuthProviderRequest = z.object({
  client_id: z.string(),
  redirect_uri: z.string(),
})

/**
 * OAuthProviderAppResponse
 */
export const zOAuthProviderAppResponse = z.object({
  app_icon: z.string(),
  app_label: z.record(z.string(), z.unknown()),
  auto_authorize: z.boolean(),
  scope: z.string(),
})

/**
 * OAuthClientPayload
 */
export const zOAuthClientPayload = z.object({
  client_id: z.string(),
})

/**
 * OAuthProviderAccountResponse
 */
export const zOAuthProviderAccountResponse = z.object({
  avatar: z.string().nullish(),
  created_at: z.int(),
  email: z.string(),
  id: z.string(),
  interface_language: z.string().nullable(),
  name: z.string(),
  timezone: z.string().nullable(),
})

/**
 * OAuthProviderAuthorizeResponse
 */
export const zOAuthProviderAuthorizeResponse = z.object({
  code: z.string(),
})

/**
 * OAuthTokenRequest
 */
export const zOAuthTokenRequest = z.object({
  client_id: z.string(),
  client_secret: z.string().nullish(),
  code: z.string().nullish(),
  grant_type: z.string(),
  redirect_uri: z.string().nullish(),
  refresh_token: z.string().nullish(),
})

/**
 * OAuthProviderTokenResponse
 */
export const zOAuthProviderTokenResponse = z.object({
  access_token: z.string(),
  expires_in: z.int(),
  refresh_token: z.string(),
  token_type: z.string(),
})

export const zGetOauthDataSourceBindingByProviderPath = z.object({
  provider: z.string(),
})

export const zGetOauthDataSourceBindingByProviderQuery = z.object({
  code: z.string(),
})

/**
 * Data source binding success
 */
export const zGetOauthDataSourceBindingByProviderResponse = zOAuthDataSourceBindingResponse

export const zGetOauthDataSourceByProviderPath = z.object({
  provider: z.string(),
})

/**
 * Authorization URL or internal setup success
 */
export const zGetOauthDataSourceByProviderResponse = zOAuthDataSourceResponse

export const zGetOauthDataSourceByProviderByBindingIdSyncPath = z.object({
  binding_id: z.uuid(),
  provider: z.string(),
})

/**
 * Data source sync success
 */
export const zGetOauthDataSourceByProviderByBindingIdSyncResponse = zOAuthDataSourceSyncResponse

export const zGetOauthPluginByProviderIdDatasourceGetAuthorizationUrlPath = z.object({
  provider_id: z.string(),
})

export const zGetOauthPluginByProviderIdDatasourceGetAuthorizationUrlQuery = z.object({
  credential_id: z.string().optional(),
  visibility: z.string().optional(),
})

/**
 * Datasource OAuth authorization URL generated successfully
 */
export const zGetOauthPluginByProviderIdDatasourceGetAuthorizationUrlResponse =
  zPluginOAuthAuthorizationUrlResponse

export const zGetOauthPluginByProviderToolAuthorizationUrlPath = z.object({
  provider: z.string(),
})

export const zGetOauthPluginByProviderToolAuthorizationUrlQuery = z.object({
  visibility: z.enum(['all_team_members', 'only_me']).optional(),
})

/**
 * Tool OAuth authorization URL generated successfully
 */
export const zGetOauthPluginByProviderToolAuthorizationUrlResponse =
  zPluginOAuthAuthorizationUrlResponse

export const zPostOauthProviderBody = zOAuthProviderRequest

/**
 * Success
 */
export const zPostOauthProviderResponse = zOAuthProviderAppResponse

export const zPostOauthProviderAccountBody = zOAuthClientPayload

/**
 * Success
 */
export const zPostOauthProviderAccountResponse = zOAuthProviderAccountResponse

export const zPostOauthProviderAuthorizeBody = zOAuthClientPayload

/**
 * Success
 */
export const zPostOauthProviderAuthorizeResponse = zOAuthProviderAuthorizeResponse

export const zPostOauthProviderTokenBody = zOAuthTokenRequest

/**
 * Success
 */
export const zPostOauthProviderTokenResponse = zOAuthProviderTokenResponse