mirror of
https://github.com/langgenius/dify.git
synced 2026-10-16 15:35:32 +08:00
difyctl keeps its workspace pin on the device and no longer calls the server switch, so the op had no caller. `current` on the workspace list and detail reported the web console's workspace, which read as the one difyctl uses.
3248 lines
76 KiB
TypeScript
3248 lines
76 KiB
TypeScript
// This file is auto-generated by @hey-api/openapi-ts
|
|
|
|
import * as z from 'zod'
|
|
|
|
/**
|
|
* AccountPayload
|
|
*/
|
|
export const zAccountPayload = z.object({
|
|
email: z.string(),
|
|
id: z.string(),
|
|
name: z.string(),
|
|
})
|
|
|
|
/**
|
|
* AdvancedChatNodeRunPayload
|
|
*/
|
|
export const zAdvancedChatNodeRunPayload = z.object({
|
|
files: z
|
|
.record(
|
|
z.string(),
|
|
z.union([
|
|
z.custom<Blob | File>((value) => value instanceof Blob || value instanceof File),
|
|
z.array(z.custom<Blob | File>((value) => value instanceof Blob || value instanceof File)),
|
|
]),
|
|
)
|
|
.nullish(),
|
|
inputs: z.record(z.string(), z.unknown()).optional(),
|
|
query: z.string().optional().default(''),
|
|
})
|
|
|
|
/**
|
|
* AdvancedChatRunPayload
|
|
*
|
|
* A chat run against an advanced-chat (chatflow) app, which can also pin a workflow version.
|
|
*/
|
|
export const zAdvancedChatRunPayload = z.object({
|
|
attachments: z
|
|
.array(z.custom<Blob | File>((value) => value instanceof Blob || value instanceof File))
|
|
.nullish(),
|
|
auto_generate_name: z.boolean().optional().default(true),
|
|
conversation_id: z.string().nullish(),
|
|
files: z
|
|
.record(
|
|
z.string(),
|
|
z.union([
|
|
z.custom<Blob | File>((value) => value instanceof Blob || value instanceof File),
|
|
z.array(z.custom<Blob | File>((value) => value instanceof Blob || value instanceof File)),
|
|
]),
|
|
)
|
|
.nullish(),
|
|
inputs: z.record(z.string(), z.unknown()).optional(),
|
|
query: z.string(),
|
|
workflow_id: z.string().nullish(),
|
|
workspace_id: z.string().nullish(),
|
|
})
|
|
|
|
/**
|
|
* AdvancedChatWebApp
|
|
*/
|
|
export const zAdvancedChatWebApp = z.object({
|
|
access_token: z.string().nullish(),
|
|
app_base_url: z.string(),
|
|
chat_color_theme: z.string().nullish(),
|
|
chat_color_theme_inverted: z.boolean().optional().default(false),
|
|
copyright: z.string().nullish(),
|
|
custom_disclaimer: z.string().nullish(),
|
|
default_language: z.string().nullish(),
|
|
description: z.string().nullish(),
|
|
enabled: z.boolean(),
|
|
icon: z.string().nullish(),
|
|
icon_background: z.string().nullish(),
|
|
icon_type: z.string().nullish(),
|
|
input_placeholder: z.string().nullish(),
|
|
privacy_policy: z.string().nullish(),
|
|
show_workflow_steps: z.boolean().optional().default(false),
|
|
title: z.string().nullish(),
|
|
url: z.string().nullish(),
|
|
use_icon_as_answer_icon: z.boolean().optional().default(false),
|
|
})
|
|
|
|
/**
|
|
* AdvancedChatWebAppPatch
|
|
*/
|
|
export const zAdvancedChatWebAppPatch = z.object({
|
|
chat_color_theme: z.string().nullish(),
|
|
chat_color_theme_inverted: z.boolean().nullish(),
|
|
copyright: z.string().nullish(),
|
|
custom_disclaimer: z.string().nullish(),
|
|
default_language: z.string().nullish(),
|
|
description: z.string().nullish(),
|
|
enabled: z.boolean().nullish(),
|
|
icon: z.string().nullish(),
|
|
icon_background: z.string().nullish(),
|
|
icon_type: z.enum(['emoji', 'image', 'link']).nullish(),
|
|
input_placeholder: z.string().nullish(),
|
|
privacy_policy: z.string().nullish(),
|
|
show_workflow_steps: z.boolean().nullish(),
|
|
title: z.string().nullish(),
|
|
use_icon_as_answer_icon: z.boolean().nullish(),
|
|
})
|
|
|
|
/**
|
|
* AgentAppInfo
|
|
*/
|
|
export const zAgentAppInfo = z.object({
|
|
description: z.string().nullish(),
|
|
icon: z.string().nullish(),
|
|
icon_background: z.string().nullish(),
|
|
icon_type: z.string().nullish(),
|
|
max_active_requests: z.int().nullish(),
|
|
name: z.string(),
|
|
role: z.string().nullish(),
|
|
use_icon_as_answer_icon: z.boolean().optional().default(false),
|
|
})
|
|
|
|
/**
|
|
* AgentAppInfoPatch
|
|
*/
|
|
export const zAgentAppInfoPatch = z.object({
|
|
description: z.string().max(400).nullish(),
|
|
icon: z.string().nullish(),
|
|
icon_background: z.string().nullish(),
|
|
icon_type: z.enum(['emoji', 'image', 'link']).nullish(),
|
|
max_active_requests: z.int().gte(0).nullish(),
|
|
name: z.string().min(1).nullish(),
|
|
role: z.string().max(255).nullish(),
|
|
use_icon_as_answer_icon: z.boolean().nullish(),
|
|
})
|
|
|
|
/**
|
|
* AgentServiceApi
|
|
*/
|
|
export const zAgentServiceApi = z.object({
|
|
access_ready: z.boolean(),
|
|
api_rph: z.int().optional().default(0),
|
|
api_rpm: z.int().optional().default(0),
|
|
base_url: z.string(),
|
|
enabled: z.boolean(),
|
|
})
|
|
|
|
/**
|
|
* AgentWebApp
|
|
*/
|
|
export const zAgentWebApp = z.object({
|
|
access_ready: z.boolean(),
|
|
access_token: z.string().nullish(),
|
|
app_base_url: z.string(),
|
|
chat_color_theme: z.string().nullish(),
|
|
chat_color_theme_inverted: z.boolean().optional().default(false),
|
|
copyright: z.string().nullish(),
|
|
custom_disclaimer: z.string().nullish(),
|
|
default_language: z.string().nullish(),
|
|
description: z.string().nullish(),
|
|
enabled: z.boolean(),
|
|
icon: z.string().nullish(),
|
|
icon_background: z.string().nullish(),
|
|
icon_type: z.string().nullish(),
|
|
input_placeholder: z.string().nullish(),
|
|
privacy_policy: z.string().nullish(),
|
|
title: z.string().nullish(),
|
|
url: z.string().nullish(),
|
|
use_icon_as_answer_icon: z.boolean().optional().default(false),
|
|
})
|
|
|
|
/**
|
|
* AppDescribeInfo
|
|
*/
|
|
export const zAppDescribeInfo = z.object({
|
|
description: z.string().nullish(),
|
|
id: z.string(),
|
|
is_agent: z.boolean().optional().default(false),
|
|
mode: z.string(),
|
|
name: z.string(),
|
|
service_api_enabled: z.boolean(),
|
|
updated_at: z.string().nullish(),
|
|
})
|
|
|
|
/**
|
|
* AppDescribeQuery
|
|
*
|
|
* `?fields=` allow-list for GET /apps/<id>.
|
|
*
|
|
* Empty / omitted → all blocks. Unknown member → ValidationError → 422.
|
|
*/
|
|
export const zAppDescribeQuery = z.object({
|
|
fields: z.string().optional(),
|
|
})
|
|
|
|
/**
|
|
* AppDslExportQuery
|
|
*
|
|
* Query parameters for GET /apps/<app_id>/dsl.
|
|
*/
|
|
export const zAppDslExportQuery = z.object({
|
|
include_secret: z.boolean().optional().default(false),
|
|
workflow_id: z.uuid().nullish(),
|
|
})
|
|
|
|
/**
|
|
* AppDslExportResponse
|
|
*
|
|
* Export DSL response.
|
|
*/
|
|
export const zAppDslExportResponse = z.object({
|
|
data: z.string(),
|
|
draft_hash: z.string().nullish(),
|
|
})
|
|
|
|
/**
|
|
* AppDslImportPayload
|
|
*
|
|
* Request body for POST /workspaces/<workspace_id>/apps/imports.
|
|
*/
|
|
export const zAppDslImportPayload = z.object({
|
|
app_id: z.string().nullish(),
|
|
description: z.string().nullish(),
|
|
draft_hash: z.string().nullish(),
|
|
icon: z.string().nullish(),
|
|
icon_background: z.string().nullish(),
|
|
icon_type: z.string().nullish(),
|
|
mode: z.enum(['yaml-content', 'yaml-url']),
|
|
name: z.string().nullish(),
|
|
yaml_content: z.string().nullish(),
|
|
yaml_url: z.string().nullish(),
|
|
})
|
|
|
|
/**
|
|
* AppInfo
|
|
*/
|
|
export const zAppInfo = z.object({
|
|
description: z.string().nullish(),
|
|
id: z.string(),
|
|
mode: z.string(),
|
|
name: z.string(),
|
|
})
|
|
|
|
/**
|
|
* AppInfoPatch
|
|
*/
|
|
export const zAppInfoPatch = z.object({
|
|
description: z.string().max(400).nullish(),
|
|
icon: z.string().nullish(),
|
|
icon_background: z.string().nullish(),
|
|
icon_type: z.enum(['emoji', 'image', 'link']).nullish(),
|
|
max_active_requests: z.int().gte(0).nullish(),
|
|
name: z.string().min(1).nullish(),
|
|
})
|
|
|
|
/**
|
|
* AppMode
|
|
*/
|
|
export const zAppMode = z.enum([
|
|
'advanced-chat',
|
|
'agent',
|
|
'agent-chat',
|
|
'channel',
|
|
'chat',
|
|
'completion',
|
|
'rag-pipeline',
|
|
'workflow',
|
|
])
|
|
|
|
/**
|
|
* AppListRow
|
|
*/
|
|
export const zAppListRow = z.object({
|
|
description: z.string().nullish(),
|
|
id: z.string(),
|
|
mode: zAppMode,
|
|
name: z.string(),
|
|
updated_at: z.string().nullish(),
|
|
workspace_id: z.string().nullish(),
|
|
workspace_name: z.string().nullish(),
|
|
})
|
|
|
|
/**
|
|
* AppSettingsInfo
|
|
*/
|
|
export const zAppSettingsInfo = z.object({
|
|
description: z.string().nullish(),
|
|
icon: z.string().nullish(),
|
|
icon_background: z.string().nullish(),
|
|
icon_type: z.string().nullish(),
|
|
max_active_requests: z.int().nullish(),
|
|
name: z.string(),
|
|
})
|
|
|
|
/**
|
|
* ChatAppInfo
|
|
*/
|
|
export const zChatAppInfo = z.object({
|
|
description: z.string().nullish(),
|
|
icon: z.string().nullish(),
|
|
icon_background: z.string().nullish(),
|
|
icon_type: z.string().nullish(),
|
|
max_active_requests: z.int().nullish(),
|
|
name: z.string(),
|
|
use_icon_as_answer_icon: z.boolean().optional().default(false),
|
|
})
|
|
|
|
/**
|
|
* ChatAppInfoPatch
|
|
*/
|
|
export const zChatAppInfoPatch = z.object({
|
|
description: z.string().max(400).nullish(),
|
|
icon: z.string().nullish(),
|
|
icon_background: z.string().nullish(),
|
|
icon_type: z.enum(['emoji', 'image', 'link']).nullish(),
|
|
max_active_requests: z.int().gte(0).nullish(),
|
|
name: z.string().min(1).nullish(),
|
|
use_icon_as_answer_icon: z.boolean().nullish(),
|
|
})
|
|
|
|
/**
|
|
* ChatRunPayload
|
|
*/
|
|
export const zChatRunPayload = z.object({
|
|
attachments: z
|
|
.array(z.custom<Blob | File>((value) => value instanceof Blob || value instanceof File))
|
|
.nullish(),
|
|
auto_generate_name: z.boolean().optional().default(true),
|
|
conversation_id: z.string().nullish(),
|
|
files: z
|
|
.record(
|
|
z.string(),
|
|
z.union([
|
|
z.custom<Blob | File>((value) => value instanceof Blob || value instanceof File),
|
|
z.array(z.custom<Blob | File>((value) => value instanceof Blob || value instanceof File)),
|
|
]),
|
|
)
|
|
.nullish(),
|
|
inputs: z.record(z.string(), z.unknown()).optional(),
|
|
query: z.string(),
|
|
workspace_id: z.string().nullish(),
|
|
})
|
|
|
|
/**
|
|
* ChatWebApp
|
|
*/
|
|
export const zChatWebApp = z.object({
|
|
access_token: z.string().nullish(),
|
|
app_base_url: z.string(),
|
|
chat_color_theme: z.string().nullish(),
|
|
chat_color_theme_inverted: z.boolean().optional().default(false),
|
|
copyright: z.string().nullish(),
|
|
custom_disclaimer: z.string().nullish(),
|
|
default_language: z.string().nullish(),
|
|
description: z.string().nullish(),
|
|
enabled: z.boolean(),
|
|
icon: z.string().nullish(),
|
|
icon_background: z.string().nullish(),
|
|
icon_type: z.string().nullish(),
|
|
input_placeholder: z.string().nullish(),
|
|
privacy_policy: z.string().nullish(),
|
|
title: z.string().nullish(),
|
|
url: z.string().nullish(),
|
|
use_icon_as_answer_icon: z.boolean().optional().default(false),
|
|
})
|
|
|
|
/**
|
|
* ChatWebAppPatch
|
|
*/
|
|
export const zChatWebAppPatch = z.object({
|
|
chat_color_theme: z.string().nullish(),
|
|
chat_color_theme_inverted: z.boolean().nullish(),
|
|
copyright: z.string().nullish(),
|
|
custom_disclaimer: z.string().nullish(),
|
|
default_language: z.string().nullish(),
|
|
description: z.string().nullish(),
|
|
enabled: z.boolean().nullish(),
|
|
icon: z.string().nullish(),
|
|
icon_background: z.string().nullish(),
|
|
icon_type: z.enum(['emoji', 'image', 'link']).nullish(),
|
|
input_placeholder: z.string().nullish(),
|
|
privacy_policy: z.string().nullish(),
|
|
title: z.string().nullish(),
|
|
use_icon_as_answer_icon: z.boolean().nullish(),
|
|
})
|
|
|
|
/**
|
|
* CompletionRunPayload
|
|
*/
|
|
export const zCompletionRunPayload = z.object({
|
|
attachments: z
|
|
.array(z.custom<Blob | File>((value) => value instanceof Blob || value instanceof File))
|
|
.nullish(),
|
|
files: z
|
|
.record(
|
|
z.string(),
|
|
z.union([
|
|
z.custom<Blob | File>((value) => value instanceof Blob || value instanceof File),
|
|
z.array(z.custom<Blob | File>((value) => value instanceof Blob || value instanceof File)),
|
|
]),
|
|
)
|
|
.nullish(),
|
|
inputs: z.record(z.string(), z.unknown()).optional(),
|
|
query: z.string().optional().default(''),
|
|
workspace_id: z.string().nullish(),
|
|
})
|
|
|
|
/**
|
|
* CreateAppPayload
|
|
*/
|
|
export const zCreateAppPayload = z.object({
|
|
description: z.string().max(400).nullish(),
|
|
icon: z.string().nullish(),
|
|
icon_background: z.string().nullish(),
|
|
icon_type: z.enum(['emoji', 'image', 'link']).nullish(),
|
|
name: z.string().min(1),
|
|
})
|
|
|
|
/**
|
|
* CreatedAppResponse
|
|
*/
|
|
export const zCreatedAppResponse = z.object({
|
|
app_id: z.string(),
|
|
mode: z.string(),
|
|
name: z.string(),
|
|
})
|
|
|
|
/**
|
|
* CredentialFormField
|
|
*/
|
|
export const zCredentialFormField = z.object({
|
|
label: z.string().nullable(),
|
|
name: z.string(),
|
|
options: z.array(z.string()).nullable(),
|
|
placeholder: z.string().nullable(),
|
|
required: z.boolean(),
|
|
show_on: z.array(z.record(z.string(), z.string())),
|
|
type: z.string(),
|
|
})
|
|
|
|
/**
|
|
* CredentialRef
|
|
*/
|
|
export const zCredentialRef = z.object({
|
|
id: z.string(),
|
|
name: z.string().nullable(),
|
|
})
|
|
|
|
/**
|
|
* CustomModelRow
|
|
*/
|
|
export const zCustomModelRow = z.object({
|
|
active_credential: zCredentialRef.nullable(),
|
|
model: z.string(),
|
|
model_type: z.string(),
|
|
})
|
|
|
|
/**
|
|
* DeploymentEdition
|
|
*
|
|
* Enum representing the deployment edition of the platform.
|
|
*/
|
|
export const zDeploymentEdition = z.enum(['CLOUD', 'COMMUNITY', 'ENTERPRISE'])
|
|
|
|
/**
|
|
* DeviceCodeRequest
|
|
*/
|
|
export const zDeviceCodeRequest = z.object({
|
|
client_id: z.string(),
|
|
device_label: z.string(),
|
|
})
|
|
|
|
/**
|
|
* DeviceCodeResponse
|
|
*/
|
|
export const zDeviceCodeResponse = z.object({
|
|
device_code: z.string(),
|
|
expires_in: z.int(),
|
|
interval: z.int(),
|
|
user_code: z.string(),
|
|
verification_uri: z.string(),
|
|
})
|
|
|
|
/**
|
|
* DeviceFlowErrorResponse
|
|
*
|
|
* RFC 8628-style device-flow error. These routes keep the OAuth ``{"error": code}`` shape
|
|
* instead of ``ErrorBody`` because device clients parse it.
|
|
*/
|
|
export const zDeviceFlowErrorResponse = z.object({
|
|
error: z.enum([
|
|
'access_denied',
|
|
'already_resolved',
|
|
'approval_outcome_unknown',
|
|
'approve_in_progress',
|
|
'authorization_pending',
|
|
'expired_or_unknown',
|
|
'expired_token',
|
|
'slow_down',
|
|
'state_lost',
|
|
'unsupported_client',
|
|
]),
|
|
})
|
|
|
|
/**
|
|
* DeviceLookupQuery
|
|
*/
|
|
export const zDeviceLookupQuery = z.object({
|
|
user_code: z.string(),
|
|
})
|
|
|
|
/**
|
|
* DeviceLookupResponse
|
|
*/
|
|
export const zDeviceLookupResponse = z.object({
|
|
client_id: z.string().nullish(),
|
|
expires_in_remaining: z.int().optional().default(0),
|
|
valid: z.boolean(),
|
|
})
|
|
|
|
/**
|
|
* DeviceMutateRequest
|
|
*/
|
|
export const zDeviceMutateRequest = z.object({
|
|
user_code: z.string(),
|
|
})
|
|
|
|
/**
|
|
* DeviceMutateResponse
|
|
*/
|
|
export const zDeviceMutateResponse = z.object({
|
|
status: z.string(),
|
|
})
|
|
|
|
/**
|
|
* DevicePollRequest
|
|
*/
|
|
export const zDevicePollRequest = z.object({
|
|
client_id: z.string(),
|
|
device_code: z.string(),
|
|
})
|
|
|
|
/**
|
|
* DraftWorkflowRunPayload
|
|
*/
|
|
export const zDraftWorkflowRunPayload = z.object({
|
|
attachments: z
|
|
.array(z.custom<Blob | File>((value) => value instanceof Blob || value instanceof File))
|
|
.nullish(),
|
|
files: z
|
|
.record(
|
|
z.string(),
|
|
z.union([
|
|
z.custom<Blob | File>((value) => value instanceof Blob || value instanceof File),
|
|
z.array(z.custom<Blob | File>((value) => value instanceof Blob || value instanceof File)),
|
|
]),
|
|
)
|
|
.nullish(),
|
|
inputs: z.record(z.string(), z.unknown()).optional(),
|
|
workspace_id: z.string().nullish(),
|
|
})
|
|
|
|
/**
|
|
* DslCheckPayload
|
|
*/
|
|
export const zDslCheckPayload = z.object({
|
|
app_id: z.string().nullish(),
|
|
yaml_content: z.string(),
|
|
})
|
|
|
|
/**
|
|
* DslImportWarning
|
|
*
|
|
* Portable DSL reference that could not be restored in the target workspace.
|
|
*/
|
|
export const zDslImportWarning = z.object({
|
|
code: z.string(),
|
|
details: z.record(z.string(), z.unknown()).optional(),
|
|
message: z.string(),
|
|
path: z.string(),
|
|
})
|
|
|
|
/**
|
|
* DslIssueRow
|
|
*/
|
|
export const zDslIssueRow = z.object({
|
|
code: z.string(),
|
|
loc: z.array(z.union([z.string(), z.int()])),
|
|
message: z.string(),
|
|
node_id: z.string().nullable(),
|
|
severity: z.string(),
|
|
})
|
|
|
|
/**
|
|
* EnvVariableRow
|
|
*/
|
|
export const zEnvVariableRow = z.object({
|
|
description: z.string().optional().default(''),
|
|
id: z.string(),
|
|
name: z.string(),
|
|
value: z.unknown(),
|
|
value_type: z.string(),
|
|
})
|
|
|
|
/**
|
|
* EnvVariableListResponse
|
|
*/
|
|
export const zEnvVariableListResponse = z.object({
|
|
data: z.array(zEnvVariableRow),
|
|
})
|
|
|
|
/**
|
|
* EnvVariableValueType
|
|
*
|
|
* Value types the draft environment-variable ``set`` op accepts.
|
|
*
|
|
* A curated subset of ``SegmentType``: what the console's environment-variable editor
|
|
* allows (``ENVIRONMENT_VARIABLE_SUPPORTED_TYPES`` in controllers/console/app/workflow.py).
|
|
* Members reference ``SegmentType.*.value`` so the subset relationship is type-checked.
|
|
*/
|
|
export const zEnvVariableValueType = z.enum(['number', 'secret', 'string'])
|
|
|
|
/**
|
|
* EnvVariableSetPayload
|
|
*/
|
|
export const zEnvVariableSetPayload = z.object({
|
|
description: z.string().optional().default(''),
|
|
name: z.string(),
|
|
value: z.unknown(),
|
|
value_type: zEnvVariableValueType,
|
|
})
|
|
|
|
/**
|
|
* ErrorDetail
|
|
*/
|
|
export const zErrorDetail = z.object({
|
|
loc: z
|
|
.array(z.union([z.string(), z.int()]))
|
|
.optional()
|
|
.default([]),
|
|
msg: z.string(),
|
|
type: z.string(),
|
|
})
|
|
|
|
/**
|
|
* EventStreamResponse
|
|
*/
|
|
export const zEventStreamResponse = z.string()
|
|
|
|
/**
|
|
* FileResponse
|
|
*/
|
|
export const zFileResponse = z.object({
|
|
conversation_id: z.uuid().nullish(),
|
|
created_at: z.int().nullish(),
|
|
created_by: z.uuid().nullish(),
|
|
extension: z.string().nullish(),
|
|
file_key: z.string().nullish(),
|
|
id: z.uuid(),
|
|
mime_type: z.string().nullish(),
|
|
name: z.string(),
|
|
original_url: z.string().nullish(),
|
|
preview_url: z.string().nullish(),
|
|
reference: z.string().nullish(),
|
|
size: z.int(),
|
|
source_url: z.string().nullish(),
|
|
tenant_id: z.uuid().nullish(),
|
|
user_id: z.uuid().nullish(),
|
|
})
|
|
|
|
/**
|
|
* FileUploadPayload
|
|
*/
|
|
export const zFileUploadPayload = z.object({
|
|
file: z.custom<Blob | File>((value) => value instanceof Blob || value instanceof File),
|
|
})
|
|
|
|
/**
|
|
* Github
|
|
*/
|
|
export const zGithub = z.object({
|
|
github_plugin_unique_identifier: z.string(),
|
|
package: z.string(),
|
|
repo: z.string(),
|
|
version: z.string(),
|
|
})
|
|
|
|
/**
|
|
* HealthResponse
|
|
*
|
|
* Liveness payload for `GET /openapi/v1/_health` — no auth required.
|
|
*/
|
|
export const zHealthResponse = z.object({
|
|
ok: z.boolean(),
|
|
})
|
|
|
|
/**
|
|
* Hint
|
|
*
|
|
* A next step: the op id to call and its ready input.
|
|
*/
|
|
export const zHint = z.object({
|
|
form: z.array(z.record(z.string(), z.unknown())).nullish(),
|
|
input: z.record(z.string(), z.unknown()),
|
|
op: z.string(),
|
|
summary: z.string(),
|
|
})
|
|
|
|
/**
|
|
* AppDescribeResponse
|
|
*/
|
|
export const zAppDescribeResponse = z.object({
|
|
hints: z.array(zHint).optional(),
|
|
info: zAppDescribeInfo.nullish(),
|
|
input_schema: z.record(z.string(), z.unknown()).nullish(),
|
|
parameters: z.record(z.string(), z.unknown()).nullish(),
|
|
})
|
|
|
|
/**
|
|
* AppListResponse
|
|
*/
|
|
export const zAppListResponse = z.object({
|
|
data: z.array(zAppListRow),
|
|
has_more: z.boolean(),
|
|
hints: z.array(zHint).optional(),
|
|
limit: z.int(),
|
|
page: z.int(),
|
|
total: z.int(),
|
|
})
|
|
|
|
/**
|
|
* CredentialWriteResponse
|
|
*/
|
|
export const zCredentialWriteResponse = z.object({
|
|
active: z.boolean(),
|
|
hints: z.array(zHint).optional(),
|
|
id: z.string(),
|
|
name: z.string().nullable(),
|
|
})
|
|
|
|
/**
|
|
* DslCheckResponse
|
|
*/
|
|
export const zDslCheckResponse = z.object({
|
|
hints: z.array(zHint).optional(),
|
|
issues: z.array(zDslIssueRow),
|
|
valid: z.boolean(),
|
|
})
|
|
|
|
/**
|
|
* ErrorBody
|
|
*
|
|
* Canonical non-2xx body. ``code`` is typed ``str`` (not the enum) so the
|
|
* generated client schema stays an open enum — old CLIs keep parsing when a
|
|
* future server adds a code. Formatter tests pin emitted values to the enum.
|
|
*/
|
|
export const zErrorBody = z.object({
|
|
code: z.string(),
|
|
details: z.array(zErrorDetail).nullish(),
|
|
hint: z.string().nullish(),
|
|
hints: z.array(zHint).nullish(),
|
|
message: z.string(),
|
|
status: z.int(),
|
|
})
|
|
|
|
/**
|
|
* FormSubmitResponse
|
|
*
|
|
* 200 body for POST /apps/<id>/human-input-forms/<token>:submit: the hint to follow the
|
|
* resumed run. `extra='forbid'` pins `additionalProperties: false` so the generated contract
|
|
* is exact rather than an under-annotated open object.
|
|
*/
|
|
export const zFormSubmitResponse = z.object({
|
|
hints: z.array(zHint).optional(),
|
|
})
|
|
|
|
/**
|
|
* HumanInputFormDefinitionResponse
|
|
*/
|
|
export const zHumanInputFormDefinitionResponse = z.object({
|
|
expiration_time: z.int().nullish(),
|
|
form_content: z.string(),
|
|
inputs: z.array(z.record(z.string(), z.unknown())).optional(),
|
|
resolved_default_values: z.record(z.string(), z.string()),
|
|
user_actions: z.array(z.record(z.string(), z.unknown())).optional(),
|
|
})
|
|
|
|
/**
|
|
* ImportStatus
|
|
*/
|
|
export const zImportStatus = z.enum(['completed', 'completed-with-warnings', 'failed', 'pending'])
|
|
|
|
/**
|
|
* AppDslImportResponse
|
|
*
|
|
* `Import` plus the server-built next step for a pending import.
|
|
*/
|
|
export const zAppDslImportResponse = z.object({
|
|
app_id: z.string().nullish(),
|
|
app_mode: zAppMode.nullish(),
|
|
current_dsl_version: z.string().optional().default('0.7.0'),
|
|
error: z.string().optional().default(''),
|
|
hints: z.array(zHint).optional(),
|
|
id: z.string(),
|
|
imported_dsl_version: z.string().optional().default(''),
|
|
permission_keys: z.array(z.string()).optional(),
|
|
status: zImportStatus,
|
|
warnings: z.array(zDslImportWarning).optional(),
|
|
})
|
|
|
|
/**
|
|
* Import
|
|
*/
|
|
export const zImport = z.object({
|
|
app_id: z.string().nullish(),
|
|
app_mode: zAppMode.nullish(),
|
|
current_dsl_version: z.string().optional().default('0.7.0'),
|
|
error: z.string().optional().default(''),
|
|
id: z.string(),
|
|
imported_dsl_version: z.string().optional().default(''),
|
|
permission_keys: z.array(z.string()).optional(),
|
|
status: zImportStatus,
|
|
warnings: z.array(zDslImportWarning).optional(),
|
|
})
|
|
|
|
export const zJsonValue = z.unknown()
|
|
|
|
/**
|
|
* KnowledgeBaseListQuery
|
|
*/
|
|
export const zKnowledgeBaseListQuery = z.object({
|
|
limit: z.int().gte(1).lte(100).optional().default(20),
|
|
page: z.int().gte(1).optional().default(1),
|
|
query: z.string().optional().default(''),
|
|
})
|
|
|
|
/**
|
|
* LlmModelBlock
|
|
*/
|
|
export const zLlmModelBlock = z.object({
|
|
completion_params: z.record(z.string(), z.unknown()).optional(),
|
|
mode: z.string(),
|
|
name: z.string(),
|
|
provider: z.string(),
|
|
})
|
|
|
|
/**
|
|
* Marketplace
|
|
*/
|
|
export const zMarketplace = z.object({
|
|
marketplace_plugin_unique_identifier: z.string(),
|
|
version: z.string().nullish(),
|
|
})
|
|
|
|
/**
|
|
* MarketplacePluginRow
|
|
*/
|
|
export const zMarketplacePluginRow = z.object({
|
|
authorized_category: z.string().nullable(),
|
|
brief: z.string().nullable(),
|
|
category: z.string(),
|
|
identifier: z.string(),
|
|
install_count: z.int(),
|
|
installed: z.boolean(),
|
|
installed_version: z.string().nullable(),
|
|
label: z.string().nullable(),
|
|
plugin_id: z.string(),
|
|
version: z.string(),
|
|
})
|
|
|
|
/**
|
|
* MarketplacePluginListResponse
|
|
*/
|
|
export const zMarketplacePluginListResponse = z.object({
|
|
data: z.array(zMarketplacePluginRow),
|
|
has_more: z.boolean(),
|
|
hints: z.array(zHint).optional(),
|
|
limit: z.int(),
|
|
page: z.int(),
|
|
total: z.int(),
|
|
})
|
|
|
|
/**
|
|
* MemberActionResponse
|
|
*/
|
|
export const zMemberActionResponse = z.object({
|
|
result: z.literal('success').optional().default('success'),
|
|
})
|
|
|
|
/**
|
|
* MemberInvitePayload
|
|
*/
|
|
export const zMemberInvitePayload = z.object({
|
|
email: z.string(),
|
|
role: z.enum(['admin', 'normal']),
|
|
})
|
|
|
|
/**
|
|
* MemberInviteResponse
|
|
*/
|
|
export const zMemberInviteResponse = z.object({
|
|
email: z.string(),
|
|
invite_url: z.string(),
|
|
member_id: z.string(),
|
|
result: z.literal('success').optional().default('success'),
|
|
role: z.string(),
|
|
tenant_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* MemberListQuery
|
|
*
|
|
* Strict (extra='forbid').
|
|
*/
|
|
export const zMemberListQuery = z.object({
|
|
limit: z.int().gte(1).lte(100).optional().default(20),
|
|
page: z.int().gte(1).optional().default(1),
|
|
})
|
|
|
|
/**
|
|
* MemberResponse
|
|
*/
|
|
export const zMemberResponse = z.object({
|
|
avatar: z.string().nullish(),
|
|
email: z.string(),
|
|
id: z.string(),
|
|
name: z.string(),
|
|
role: z.string(),
|
|
status: z.string(),
|
|
})
|
|
|
|
/**
|
|
* MemberListResponse
|
|
*/
|
|
export const zMemberListResponse = z.object({
|
|
data: z.array(zMemberResponse),
|
|
has_more: z.boolean(),
|
|
hints: z.array(zHint).optional(),
|
|
limit: z.int(),
|
|
page: z.int(),
|
|
total: z.int(),
|
|
})
|
|
|
|
/**
|
|
* MemberRoleUpdatePayload
|
|
*/
|
|
export const zMemberRoleUpdatePayload = z.object({
|
|
role: z.enum(['admin', 'normal']),
|
|
})
|
|
|
|
/**
|
|
* ModelProviderDetailResponse
|
|
*/
|
|
export const zModelProviderDetailResponse = z.object({
|
|
active_credential: zCredentialRef.nullable(),
|
|
configured: z.boolean(),
|
|
credential_form: z.array(zCredentialFormField),
|
|
credentials: z.array(zCredentialRef),
|
|
custom_model_form: z.array(zCredentialFormField).nullable(),
|
|
custom_models: z.array(zCustomModelRow),
|
|
hints: z.array(zHint).optional(),
|
|
label: z.string().nullable(),
|
|
model_types: z.array(z.string()),
|
|
provider: z.string(),
|
|
})
|
|
|
|
/**
|
|
* ModelProviderRow
|
|
*/
|
|
export const zModelProviderRow = z.object({
|
|
active_credential: zCredentialRef.nullable(),
|
|
configured: z.boolean(),
|
|
label: z.string().nullable(),
|
|
model_types: z.array(z.string()),
|
|
provider: z.string(),
|
|
})
|
|
|
|
/**
|
|
* ModelRow
|
|
*/
|
|
export const zModelRow = z.object({
|
|
features: z.array(z.string()),
|
|
label: z.string().nullable(),
|
|
model: z.string(),
|
|
model_type: z.string(),
|
|
node_model: zLlmModelBlock.nullish(),
|
|
provider: z.string(),
|
|
provider_label: z.string().nullable(),
|
|
status: z.string(),
|
|
})
|
|
|
|
/**
|
|
* ModelListResponse
|
|
*/
|
|
export const zModelListResponse = z.object({
|
|
data: z.array(zModelRow),
|
|
has_more: z.boolean(),
|
|
hints: z.array(zHint).optional(),
|
|
limit: z.int(),
|
|
page: z.int(),
|
|
total: z.int(),
|
|
})
|
|
|
|
/**
|
|
* ModelType
|
|
*
|
|
* Enum class for model type.
|
|
*/
|
|
export const zModelType = z.enum([
|
|
'llm',
|
|
'moderation',
|
|
'rerank',
|
|
'speech2text',
|
|
'text-embedding',
|
|
'tts',
|
|
])
|
|
|
|
/**
|
|
* ModelCredentialCreatePayload
|
|
*/
|
|
export const zModelCredentialCreatePayload = z.object({
|
|
credentials: z.record(z.string(), z.unknown()),
|
|
model: z.string(),
|
|
model_type: zModelType,
|
|
name: z.string().nullish(),
|
|
})
|
|
|
|
/**
|
|
* ModelCredentialUpdatePayload
|
|
*/
|
|
export const zModelCredentialUpdatePayload = z.object({
|
|
credentials: z.record(z.string(), z.unknown()),
|
|
model: z.string(),
|
|
model_type: zModelType,
|
|
name: z.string().nullish(),
|
|
})
|
|
|
|
/**
|
|
* ModelListQuery
|
|
*/
|
|
export const zModelListQuery = z.object({
|
|
limit: z.int().gte(1).lte(100).optional().default(20),
|
|
model_type: zModelType.nullish(),
|
|
page: z.int().gte(1).optional().default(1),
|
|
provider: z.string().nullish(),
|
|
query: z.string().optional().default(''),
|
|
})
|
|
|
|
/**
|
|
* ModelRef
|
|
*/
|
|
export const zModelRef = z.object({
|
|
model: z.string(),
|
|
model_type: zModelType,
|
|
})
|
|
|
|
/**
|
|
* MultipleRetrievalFragment
|
|
*/
|
|
export const zMultipleRetrievalFragment = z.object({
|
|
reranking_enable: z.boolean().optional().default(false),
|
|
top_k: z.int().optional().default(4),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeRetrievalFragment
|
|
*/
|
|
export const zKnowledgeRetrievalFragment = z.object({
|
|
dataset_ids: z.array(z.string()),
|
|
multiple_retrieval_config: zMultipleRetrievalFragment.optional(),
|
|
retrieval_mode: z.literal('multiple').optional().default('multiple'),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeBaseRow
|
|
*/
|
|
export const zKnowledgeBaseRow = z.object({
|
|
description: z.string().nullable(),
|
|
document_count: z.int(),
|
|
id: z.string(),
|
|
indexing_technique: z.string().nullable(),
|
|
name: z.string(),
|
|
node_data: zKnowledgeRetrievalFragment,
|
|
provider: z.string(),
|
|
usable: z.boolean(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeBaseListResponse
|
|
*/
|
|
export const zKnowledgeBaseListResponse = z.object({
|
|
data: z.array(zKnowledgeBaseRow),
|
|
has_more: z.boolean(),
|
|
hints: z.array(zHint).optional(),
|
|
limit: z.int(),
|
|
page: z.int(),
|
|
total: z.int(),
|
|
})
|
|
|
|
/**
|
|
* NodeChange
|
|
*/
|
|
export const zNodeChange = z.object({
|
|
fields: z.array(z.string()),
|
|
id: z.string(),
|
|
title: z.string(),
|
|
type: z.string(),
|
|
})
|
|
|
|
/**
|
|
* NodeRunPayload
|
|
*/
|
|
export const zNodeRunPayload = z.object({
|
|
files: z
|
|
.record(
|
|
z.string(),
|
|
z.union([
|
|
z.custom<Blob | File>((value) => value instanceof Blob || value instanceof File),
|
|
z.array(z.custom<Blob | File>((value) => value instanceof Blob || value instanceof File)),
|
|
]),
|
|
)
|
|
.nullish(),
|
|
inputs: z.record(z.string(), z.unknown()).optional(),
|
|
})
|
|
|
|
/**
|
|
* NodeTypeDetailResponse
|
|
*/
|
|
export const zNodeTypeDetailResponse = z.object({
|
|
default_config: z.record(z.string(), z.unknown()),
|
|
schema: z.record(z.string(), z.unknown()),
|
|
type: z.string(),
|
|
version: z.string(),
|
|
})
|
|
|
|
/**
|
|
* NodeTypeRow
|
|
*/
|
|
export const zNodeTypeRow = z.object({
|
|
type: z.string(),
|
|
version: z.string(),
|
|
})
|
|
|
|
/**
|
|
* NodeTypeListResponse
|
|
*/
|
|
export const zNodeTypeListResponse = z.object({
|
|
data: z.array(zNodeTypeRow),
|
|
})
|
|
|
|
/**
|
|
* OpenApiErrorCode
|
|
*/
|
|
export const zOpenApiErrorCode = z.enum([
|
|
'agent_not_published',
|
|
'app_mode_mismatch',
|
|
'app_unavailable',
|
|
'bad_gateway',
|
|
'bad_request',
|
|
'catalog_stale',
|
|
'completion_request_error',
|
|
'conflict',
|
|
'conversation_completed',
|
|
'credential_invalid',
|
|
'credential_not_found',
|
|
'credential_oauth_only',
|
|
'draft_changed',
|
|
'draft_not_found',
|
|
'dsl_invalid',
|
|
'env_variable_not_found',
|
|
'file_extension_blocked',
|
|
'file_too_large',
|
|
'filename_not_exists',
|
|
'forbidden',
|
|
'form_not_found',
|
|
'internal_server_error',
|
|
'invalid_param',
|
|
'marketplace_disabled',
|
|
'marketplace_unavailable',
|
|
'member_license_exceeded',
|
|
'member_limit_exceeded',
|
|
'method_not_allowed',
|
|
'model_currently_not_support',
|
|
'no_file_uploaded',
|
|
'node_not_found',
|
|
'node_type_not_found',
|
|
'not_acceptable',
|
|
'not_found',
|
|
'plugin_install_forbidden',
|
|
'plugin_not_installed',
|
|
'plugin_service_unavailable',
|
|
'provider_not_found',
|
|
'provider_not_initialize',
|
|
'provider_quota_exceeded',
|
|
'rate_limit_error',
|
|
'recipient_surface_mismatch',
|
|
'request_entity_too_large',
|
|
'run_not_found',
|
|
'secret_mask_not_secret',
|
|
'secret_mask_unknown_id',
|
|
'service_api_disabled',
|
|
'too_many_files',
|
|
'too_many_requests',
|
|
'trigger_workflow_service_mode_unavailable',
|
|
'unauthorized',
|
|
'unknown',
|
|
'unsupported_file_type',
|
|
'unsupported_media_type',
|
|
'version_not_found',
|
|
'version_not_restorable',
|
|
'webapp_access_mode_console_only',
|
|
'webapp_access_requires_ee',
|
|
'webapp_access_unavailable',
|
|
'webapp_public_access_disabled',
|
|
])
|
|
|
|
/**
|
|
* OpenApiFormSubmitPayload
|
|
*
|
|
* The console payload plus local file parts; `_files.merge_files` sets them on `inputs`.
|
|
*/
|
|
export const zOpenApiFormSubmitPayload = z.object({
|
|
action: z.string(),
|
|
files: z
|
|
.record(
|
|
z.string(),
|
|
z.union([
|
|
z.custom<Blob | File>((value) => value instanceof Blob || value instanceof File),
|
|
z.array(z.custom<Blob | File>((value) => value instanceof Blob || value instanceof File)),
|
|
]),
|
|
)
|
|
.nullish(),
|
|
inputs: z.record(z.string(), zJsonValue),
|
|
})
|
|
|
|
/**
|
|
* Package
|
|
*/
|
|
export const zPackage = z.object({
|
|
plugin_unique_identifier: z.string(),
|
|
version: z.string().nullish(),
|
|
})
|
|
|
|
/**
|
|
* PermittedExternalAppsListResponse
|
|
*/
|
|
export const zPermittedExternalAppsListResponse = z.object({
|
|
data: z.array(zAppListRow),
|
|
has_more: z.boolean(),
|
|
hints: z.array(zHint).optional(),
|
|
limit: z.int(),
|
|
page: z.int(),
|
|
total: z.int(),
|
|
})
|
|
|
|
/**
|
|
* PluginCategory
|
|
*/
|
|
export const zPluginCategory = z.enum([
|
|
'agent-strategy',
|
|
'datasource',
|
|
'extension',
|
|
'model',
|
|
'tool',
|
|
'trigger',
|
|
])
|
|
|
|
/**
|
|
* MarketplacePluginQuery
|
|
*/
|
|
export const zMarketplacePluginQuery = z.object({
|
|
category: zPluginCategory.nullish(),
|
|
limit: z.int().gte(1).lte(100).optional().default(20),
|
|
page: z.int().gte(1).optional().default(1),
|
|
query: z.string().optional().default(''),
|
|
})
|
|
|
|
/**
|
|
* PluginDeleteResponse
|
|
*/
|
|
export const zPluginDeleteResponse = z.object({
|
|
deleted: z.boolean(),
|
|
plugin_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* PluginDependencyType
|
|
*/
|
|
export const zPluginDependencyType = z.enum(['github', 'marketplace', 'package'])
|
|
|
|
/**
|
|
* PluginDependency
|
|
*/
|
|
export const zPluginDependency = z.object({
|
|
current_identifier: z.string().nullish(),
|
|
type: zPluginDependencyType,
|
|
value: z.union([zGithub, zMarketplace, zPackage]),
|
|
})
|
|
|
|
/**
|
|
* CheckDependenciesResponse
|
|
*/
|
|
export const zCheckDependenciesResponse = z.object({
|
|
hints: z.array(zHint).optional(),
|
|
leaked_dependencies: z.array(zPluginDependency).optional(),
|
|
})
|
|
|
|
/**
|
|
* CheckDependenciesResult
|
|
*/
|
|
export const zCheckDependenciesResult = z.object({
|
|
leaked_dependencies: z.array(zPluginDependency).optional(),
|
|
})
|
|
|
|
/**
|
|
* PluginInstallPayload
|
|
*/
|
|
export const zPluginInstallPayload = z.object({
|
|
identifiers: z.array(z.string()).min(1),
|
|
})
|
|
|
|
/**
|
|
* PluginInstallTaskStatus
|
|
*/
|
|
export const zPluginInstallTaskStatus = z.enum(['failed', 'pending', 'running', 'success'])
|
|
|
|
/**
|
|
* PluginListQuery
|
|
*/
|
|
export const zPluginListQuery = z.object({
|
|
category: zPluginCategory.nullish(),
|
|
})
|
|
|
|
/**
|
|
* PluginProvides
|
|
*/
|
|
export const zPluginProvides = z.object({
|
|
model_provider: z.string().nullable(),
|
|
tool_provider: z.string().nullable(),
|
|
})
|
|
|
|
/**
|
|
* PluginRow
|
|
*/
|
|
export const zPluginRow = z.object({
|
|
category: z.string(),
|
|
identifier: z.string(),
|
|
label: z.string().nullable(),
|
|
latest_version: z.string().nullable(),
|
|
plugin_id: z.string(),
|
|
provides: zPluginProvides,
|
|
source: z.string(),
|
|
version: z.string(),
|
|
})
|
|
|
|
/**
|
|
* PluginListResponse
|
|
*/
|
|
export const zPluginListResponse = z.object({
|
|
data: z.array(zPluginRow),
|
|
hints: z.array(zHint).optional(),
|
|
})
|
|
|
|
/**
|
|
* PluginTaskItem
|
|
*/
|
|
export const zPluginTaskItem = z.object({
|
|
identifier: z.string(),
|
|
message: z.string(),
|
|
plugin_id: z.string(),
|
|
status: zPluginInstallTaskStatus,
|
|
})
|
|
|
|
/**
|
|
* PluginTaskResponse
|
|
*/
|
|
export const zPluginTaskResponse = z.object({
|
|
hints: z.array(zHint).optional(),
|
|
plugins: z.array(zPluginTaskItem),
|
|
status: zPluginInstallTaskStatus,
|
|
task_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* PluginTaskStartResponse
|
|
*/
|
|
export const zPluginTaskStartResponse = z.object({
|
|
all_installed: z.boolean(),
|
|
hints: z.array(zHint).optional(),
|
|
task_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* ProviderCredentialCreatePayload
|
|
*/
|
|
export const zProviderCredentialCreatePayload = z.object({
|
|
credentials: z.record(z.string(), z.unknown()),
|
|
name: z.string().nullish(),
|
|
})
|
|
|
|
/**
|
|
* ProviderCredentialUpdatePayload
|
|
*/
|
|
export const zProviderCredentialUpdatePayload = z.object({
|
|
credentials: z.record(z.string(), z.unknown()),
|
|
name: z.string().nullish(),
|
|
})
|
|
|
|
/**
|
|
* PublishPayload
|
|
*/
|
|
export const zPublishPayload = z.object({
|
|
marked_comment: z.string().max(100).optional().default(''),
|
|
marked_name: z.string().max(20).optional().default(''),
|
|
})
|
|
|
|
/**
|
|
* PublishResponse
|
|
*/
|
|
export const zPublishResponse = z.object({
|
|
created_at: z.int(),
|
|
version_id: z.string(),
|
|
warning: z.string().nullish(),
|
|
})
|
|
|
|
/**
|
|
* ReleaseCheckName
|
|
*/
|
|
export const zReleaseCheckName = z.enum(['draft_valid', 'tested'])
|
|
|
|
/**
|
|
* ReleaseCheckRow
|
|
*/
|
|
export const zReleaseCheckRow = z.object({
|
|
detail: z.string(),
|
|
name: zReleaseCheckName,
|
|
passed: z.boolean(),
|
|
})
|
|
|
|
/**
|
|
* ReleaseState
|
|
*/
|
|
export const zReleaseState = z.object({
|
|
service_api_enabled: z.boolean(),
|
|
webapp_enabled: z.boolean(),
|
|
})
|
|
|
|
/**
|
|
* RestoreResponse
|
|
*/
|
|
export const zRestoreResponse = z.object({
|
|
draft_hash: z.string(),
|
|
result: z.literal('success'),
|
|
})
|
|
|
|
/**
|
|
* RevokeResponse
|
|
*/
|
|
export const zRevokeResponse = z.object({
|
|
status: z.string(),
|
|
})
|
|
|
|
/**
|
|
* RunListQuery
|
|
*/
|
|
export const zRunListQuery = z.object({
|
|
last_id: z.uuid().nullish(),
|
|
limit: z.int().gte(1).lte(100).optional().default(20),
|
|
status: z.enum(['failed', 'partial-succeeded', 'running', 'stopped', 'succeeded']).nullish(),
|
|
triggered_from: z.enum(['app-run', 'debugging']).optional().default('debugging'),
|
|
})
|
|
|
|
/**
|
|
* ServerVersionResponse
|
|
*
|
|
* Meta endpoint payload for `GET /openapi/v1/_version` — no auth required.
|
|
*/
|
|
export const zServerVersionResponse = z.object({
|
|
edition: zDeploymentEdition,
|
|
version: z.string(),
|
|
})
|
|
|
|
/**
|
|
* ServiceApi
|
|
*/
|
|
export const zServiceApi = z.object({
|
|
base_url: z.string(),
|
|
enabled: z.boolean(),
|
|
})
|
|
|
|
/**
|
|
* ServiceApiPatch
|
|
*/
|
|
export const zServiceApiPatch = z.object({
|
|
enabled: z.boolean(),
|
|
})
|
|
|
|
/**
|
|
* SessionListQuery
|
|
*
|
|
* Pagination for GET /account/sessions. Strict (extra='forbid').
|
|
*/
|
|
export const zSessionListQuery = z.object({
|
|
limit: z.int().gte(1).lte(100).optional().default(100),
|
|
page: z.int().gte(1).optional().default(1),
|
|
})
|
|
|
|
/**
|
|
* SessionRow
|
|
*/
|
|
export const zSessionRow = z.object({
|
|
client_id: z.string(),
|
|
created_at: z.string().nullish(),
|
|
device_label: z.string(),
|
|
expires_at: z.string().nullish(),
|
|
id: z.string(),
|
|
last_used_at: z.string().nullish(),
|
|
prefix: z.string(),
|
|
})
|
|
|
|
/**
|
|
* SessionListResponse
|
|
*/
|
|
export const zSessionListResponse = z.object({
|
|
data: z.array(zSessionRow),
|
|
has_more: z.boolean(),
|
|
hints: z.array(zHint).optional(),
|
|
limit: z.int(),
|
|
page: z.int(),
|
|
total: z.int(),
|
|
})
|
|
|
|
/**
|
|
* SimpleAccountResponse
|
|
*/
|
|
export const zSimpleAccountResponse = z.object({
|
|
email: z.string(),
|
|
id: z.string(),
|
|
name: z.string(),
|
|
})
|
|
|
|
/**
|
|
* SimpleEndUser
|
|
*/
|
|
export const zSimpleEndUser = z.object({
|
|
id: z.string(),
|
|
is_anonymous: z.boolean(),
|
|
session_id: z.string().nullish(),
|
|
type: z.string(),
|
|
})
|
|
|
|
/**
|
|
* SimpleResultResponse
|
|
*/
|
|
export const zSimpleResultResponse = z.object({
|
|
result: z.string(),
|
|
})
|
|
|
|
/**
|
|
* SubjectType
|
|
*/
|
|
export const zSubjectType = z.enum(['account', 'external_sso', 'resource_access'])
|
|
|
|
/**
|
|
* SupportedAppType
|
|
*
|
|
* App types the ``app`` usage face (``get app``) lists and filters.
|
|
*
|
|
* A curated subset of :class:`AppMode`: the real, user-facing app categories.
|
|
* Excludes runtime-only mode tags that are not standalone apps
|
|
* (``rag-pipeline`` is a knowledge ``Pipeline``; ``channel`` is unused) and the
|
|
* roster-owned ``agent`` type (surfaced through the roster, not this list).
|
|
*
|
|
* Members reference ``AppMode.*.value`` so the subset relationship is
|
|
* type-checked: dropping a member from ``AppMode`` breaks this at import.
|
|
* This is the single source for the listable set — params, filters, and the
|
|
* generated CLI whitelist all derive from it.
|
|
*/
|
|
export const zSupportedAppType = z.enum([
|
|
'advanced-chat',
|
|
'agent-chat',
|
|
'chat',
|
|
'completion',
|
|
'workflow',
|
|
])
|
|
|
|
/**
|
|
* AppListQuery
|
|
*
|
|
* mode is a closed enum of listable app types.
|
|
*/
|
|
export const zAppListQuery = z.object({
|
|
limit: z.int().gte(1).lte(100).optional().default(20),
|
|
mode: zSupportedAppType.nullish(),
|
|
name: z.string().max(200).nullish(),
|
|
page: z.int().gte(1).optional().default(1),
|
|
workspace_id: z.uuid(),
|
|
})
|
|
|
|
/**
|
|
* PermittedExternalAppsListQuery
|
|
*
|
|
* Strict (extra='forbid').
|
|
*/
|
|
export const zPermittedExternalAppsListQuery = z.object({
|
|
limit: z.int().gte(1).lte(100).optional().default(20),
|
|
mode: zSupportedAppType.nullish(),
|
|
name: z.string().max(200).nullish(),
|
|
page: z.int().gte(1).optional().default(1),
|
|
})
|
|
|
|
/**
|
|
* TaskStopResponse
|
|
*
|
|
* 200 body for POST /apps/<id>/tasks/<task_id>:stop. The handler always returns
|
|
* {"result": "success"}, so `result` is required (no default) — the generated contract
|
|
* types it as a required `'success'` rather than an optional field.
|
|
*/
|
|
export const zTaskStopResponse = z.object({
|
|
result: z.literal('success'),
|
|
})
|
|
|
|
/**
|
|
* ToolCredentialCreatePayload
|
|
*/
|
|
export const zToolCredentialCreatePayload = z.object({
|
|
credentials: z.record(z.string(), z.unknown()),
|
|
name: z.string().max(30).nullish(),
|
|
})
|
|
|
|
/**
|
|
* ToolCredentialUpdatePayload
|
|
*/
|
|
export const zToolCredentialUpdatePayload = z.object({
|
|
credentials: z.record(z.string(), z.unknown()),
|
|
name: z.string().max(30).nullish(),
|
|
})
|
|
|
|
/**
|
|
* ToolInputType
|
|
*
|
|
* Binding modes for persisted tool input values.
|
|
*/
|
|
export const zToolInputType = z.enum(['constant', 'mixed', 'variable'])
|
|
|
|
/**
|
|
* ToolInputValue
|
|
*/
|
|
export const zToolInputValue = z.object({
|
|
type: zToolInputType.optional().default('constant'),
|
|
value: z.unknown().optional(),
|
|
})
|
|
|
|
/**
|
|
* ToolNodeTemplate
|
|
*
|
|
* A tool node's data with every value as {type, value}.
|
|
*/
|
|
export const zToolNodeTemplate = z.object({
|
|
plugin_id: z.string().nullable(),
|
|
plugin_unique_identifier: z.string().nullable(),
|
|
provider_id: z.string(),
|
|
provider_name: z.string(),
|
|
provider_type: z.string(),
|
|
title: z.string(),
|
|
tool_configurations: z.record(z.string(), zToolInputValue),
|
|
tool_label: z.string(),
|
|
tool_name: z.string(),
|
|
tool_node_version: z.string().optional().default('2'),
|
|
tool_parameters: z.record(z.string(), zToolInputValue),
|
|
type: z.string().optional().default('tool'),
|
|
})
|
|
|
|
/**
|
|
* ToolParameterRow
|
|
*/
|
|
export const zToolParameterRow = z.object({
|
|
default: z.unknown(),
|
|
form: z.string(),
|
|
label: z.string().nullable(),
|
|
llm_description: z.string().nullable(),
|
|
max: z.number().nullable(),
|
|
min: z.number().nullable(),
|
|
name: z.string(),
|
|
options: z.array(z.string()),
|
|
required: z.boolean(),
|
|
type: z.string(),
|
|
})
|
|
|
|
/**
|
|
* ToolProviderDetailResponse
|
|
*/
|
|
export const zToolProviderDetailResponse = z.object({
|
|
configured: z.boolean(),
|
|
credential_form: z.array(zCredentialFormField),
|
|
credential_types: z.array(z.string()),
|
|
credentials: z.array(zCredentialRef),
|
|
default_credential: zCredentialRef.nullable(),
|
|
hints: z.array(zHint).optional(),
|
|
label: z.string().nullable(),
|
|
provider: z.string(),
|
|
})
|
|
|
|
/**
|
|
* ToolProviderRow
|
|
*/
|
|
export const zToolProviderRow = z.object({
|
|
configured: z.boolean(),
|
|
credential_types: z.array(z.string()),
|
|
label: z.string().nullable(),
|
|
provider: z.string(),
|
|
})
|
|
|
|
/**
|
|
* ToolRow
|
|
*/
|
|
export const zToolRow = z.object({
|
|
configured: z.boolean(),
|
|
description: z.string().nullable(),
|
|
label: z.string(),
|
|
name: z.string(),
|
|
node_data: zToolNodeTemplate,
|
|
parameters: z.array(zToolParameterRow),
|
|
provider: z.string(),
|
|
provider_label: z.string().nullable(),
|
|
provider_type: z.string(),
|
|
})
|
|
|
|
/**
|
|
* ToolListResponse
|
|
*/
|
|
export const zToolListResponse = z.object({
|
|
data: z.array(zToolRow),
|
|
has_more: z.boolean(),
|
|
hints: z.array(zHint).optional(),
|
|
limit: z.int(),
|
|
page: z.int(),
|
|
total: z.int(),
|
|
})
|
|
|
|
/**
|
|
* ToolSource
|
|
*
|
|
* Tool provider types a workflow tool node can call; values match the node's provider_type.
|
|
*/
|
|
export const zToolSource = z.enum(['api', 'builtin', 'mcp', 'workflow'])
|
|
|
|
/**
|
|
* ToolListQuery
|
|
*/
|
|
export const zToolListQuery = z.object({
|
|
limit: z.int().gte(1).lte(100).optional().default(20),
|
|
page: z.int().gte(1).optional().default(1),
|
|
provider: z.string().nullish(),
|
|
provider_type: zToolSource.nullish(),
|
|
query: z.string().optional().default(''),
|
|
})
|
|
|
|
/**
|
|
* UsageInfo
|
|
*/
|
|
export const zUsageInfo = z.object({
|
|
completion_tokens: z.int().optional().default(0),
|
|
prompt_tokens: z.int().optional().default(0),
|
|
total_tokens: z.int().optional().default(0),
|
|
})
|
|
|
|
/**
|
|
* MessageMetadata
|
|
*/
|
|
export const zMessageMetadata = z.object({
|
|
retriever_resources: z.array(z.record(z.string(), z.unknown())).optional().default([]),
|
|
usage: zUsageInfo.nullish(),
|
|
})
|
|
|
|
/**
|
|
* VersionListQuery
|
|
*/
|
|
export const zVersionListQuery = z.object({
|
|
limit: z.int().gte(1).lte(100).optional().default(20),
|
|
named_only: z.boolean().optional().default(false),
|
|
page: z.int().gte(1).optional().default(1),
|
|
})
|
|
|
|
/**
|
|
* VersionRow
|
|
*/
|
|
export const zVersionRow = z.object({
|
|
created_at: z.int(),
|
|
created_by: z.string().nullish(),
|
|
current: z.boolean().optional().default(false),
|
|
id: z.string(),
|
|
marked_comment: z.string(),
|
|
marked_name: z.string(),
|
|
})
|
|
|
|
/**
|
|
* VersionListResponse
|
|
*
|
|
* Page of published versions, newest first; there is no total, `hints` carries the next page.
|
|
*/
|
|
export const zVersionListResponse = z.object({
|
|
data: z.array(zVersionRow),
|
|
has_more: z.boolean(),
|
|
hints: z.array(zHint).optional(),
|
|
limit: z.int(),
|
|
page: z.int(),
|
|
})
|
|
|
|
/**
|
|
* WebApp
|
|
*/
|
|
export const zWebApp = z.object({
|
|
access_token: z.string().nullish(),
|
|
app_base_url: z.string(),
|
|
copyright: z.string().nullish(),
|
|
custom_disclaimer: z.string().nullish(),
|
|
default_language: z.string().nullish(),
|
|
description: z.string().nullish(),
|
|
enabled: z.boolean(),
|
|
icon: z.string().nullish(),
|
|
icon_background: z.string().nullish(),
|
|
icon_type: z.string().nullish(),
|
|
privacy_policy: z.string().nullish(),
|
|
title: z.string().nullish(),
|
|
url: z.string().nullish(),
|
|
})
|
|
|
|
/**
|
|
* WebAppAccess
|
|
*/
|
|
export const zWebAppAccess = z.object({
|
|
access_mode: z.string(),
|
|
})
|
|
|
|
/**
|
|
* WebAppAccessMode
|
|
*/
|
|
export const zWebAppAccessMode = z.enum(['private', 'private_all', 'public', 'sso_verified'])
|
|
|
|
/**
|
|
* WebAppAccessPayload
|
|
*/
|
|
export const zWebAppAccessPayload = z.object({
|
|
access_mode: zWebAppAccessMode,
|
|
})
|
|
|
|
/**
|
|
* WebAppPatch
|
|
*/
|
|
export const zWebAppPatch = z.object({
|
|
copyright: z.string().nullish(),
|
|
custom_disclaimer: z.string().nullish(),
|
|
default_language: z.string().nullish(),
|
|
description: z.string().nullish(),
|
|
enabled: z.boolean().nullish(),
|
|
icon: z.string().nullish(),
|
|
icon_background: z.string().nullish(),
|
|
icon_type: z.enum(['emoji', 'image', 'link']).nullish(),
|
|
privacy_policy: z.string().nullish(),
|
|
title: z.string().nullish(),
|
|
})
|
|
|
|
/**
|
|
* WebAppToken
|
|
*/
|
|
export const zWebAppToken = z.object({
|
|
access_token: z.string().nullish(),
|
|
app_base_url: z.string(),
|
|
url: z.string().nullish(),
|
|
})
|
|
|
|
/**
|
|
* WorkflowDiff
|
|
*/
|
|
export const zWorkflowDiff = z.object({
|
|
edges_added: z.array(z.string()),
|
|
edges_removed: z.array(z.string()),
|
|
env_added: z.array(z.string()),
|
|
env_removed: z.array(z.string()),
|
|
features_changed: z.boolean(),
|
|
nodes_added: z.array(zNodeChange),
|
|
nodes_changed: z.array(zNodeChange),
|
|
nodes_removed: z.array(zNodeChange),
|
|
published: z.boolean(),
|
|
})
|
|
|
|
/**
|
|
* ReleaseCheckResponse
|
|
*/
|
|
export const zReleaseCheckResponse = z.object({
|
|
changes: zWorkflowDiff,
|
|
checks: z.array(zReleaseCheckRow),
|
|
hints: z.array(zHint).optional(),
|
|
issues: z.array(zDslIssueRow),
|
|
ready: z.boolean(),
|
|
state: zReleaseState,
|
|
})
|
|
|
|
/**
|
|
* WorkflowRunData
|
|
*/
|
|
export const zWorkflowRunData = z.object({
|
|
created_at: z.int().nullish(),
|
|
elapsed_time: z.number().nullish(),
|
|
error: z.string().nullish(),
|
|
finished_at: z.int().nullish(),
|
|
id: z.string(),
|
|
outputs: z.record(z.string(), z.unknown()).optional(),
|
|
status: z.string(),
|
|
total_steps: z.int().nullish(),
|
|
total_tokens: z.int().nullish(),
|
|
workflow_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* WorkflowRunDetailResponse
|
|
*/
|
|
export const zWorkflowRunDetailResponse = z.object({
|
|
created_at: z.int().nullish(),
|
|
created_by_account: zSimpleAccountResponse.nullish(),
|
|
created_by_end_user: zSimpleEndUser.nullish(),
|
|
created_by_role: z.string().nullish(),
|
|
elapsed_time: z.number().nullish(),
|
|
error: z.string().nullish(),
|
|
exceptions_count: z.int().nullish(),
|
|
finished_at: z.int().nullish(),
|
|
graph: z.unknown(),
|
|
id: z.string(),
|
|
inputs: z.unknown(),
|
|
outputs: z.unknown(),
|
|
status: z.string().nullish(),
|
|
total_steps: z.int().nullish(),
|
|
total_tokens: z.int().nullish(),
|
|
version: z.string().nullish(),
|
|
})
|
|
|
|
/**
|
|
* WorkflowRunForListResponse
|
|
*/
|
|
export const zWorkflowRunForListResponse = z.object({
|
|
created_at: z.int().nullish(),
|
|
created_by_account: zSimpleAccountResponse.nullish(),
|
|
elapsed_time: z.number().nullish(),
|
|
exceptions_count: z.int().nullish(),
|
|
finished_at: z.int().nullish(),
|
|
id: z.string(),
|
|
retry_index: z.int().nullish(),
|
|
status: z.string().nullish(),
|
|
total_steps: z.int().nullish(),
|
|
total_tokens: z.int().nullish(),
|
|
version: z.string().nullish(),
|
|
})
|
|
|
|
/**
|
|
* RunListResponse
|
|
*
|
|
* Cursor page of runs; `hints` carries the next page.
|
|
*/
|
|
export const zRunListResponse = z.object({
|
|
data: z.array(zWorkflowRunForListResponse),
|
|
has_more: z.boolean(),
|
|
hints: z.array(zHint).optional(),
|
|
limit: z.int(),
|
|
})
|
|
|
|
/**
|
|
* WorkflowRunNodeExecutionResponse
|
|
*/
|
|
export const zWorkflowRunNodeExecutionResponse = z.object({
|
|
created_at: z.int().nullish(),
|
|
created_by_account: zSimpleAccountResponse.nullish(),
|
|
created_by_end_user: zSimpleEndUser.nullish(),
|
|
created_by_role: z.string().nullish(),
|
|
elapsed_time: z.number().nullish(),
|
|
error: z.string().nullish(),
|
|
execution_metadata: z.unknown().optional(),
|
|
extras: z.unknown().optional(),
|
|
finished_at: z.int().nullish(),
|
|
id: z.string(),
|
|
index: z.int().nullish(),
|
|
inputs: z.unknown().optional(),
|
|
inputs_truncated: z.boolean().nullish(),
|
|
node_id: z.string().nullish(),
|
|
node_type: z.string().nullish(),
|
|
outputs: z.unknown().optional(),
|
|
outputs_truncated: z.boolean().nullish(),
|
|
predecessor_node_id: z.string().nullish(),
|
|
process_data: z.unknown().optional(),
|
|
process_data_truncated: z.boolean().nullish(),
|
|
retry_index: z.int().nullish(),
|
|
status: z.string().nullish(),
|
|
title: z.string().nullish(),
|
|
})
|
|
|
|
/**
|
|
* WorkflowRunNodeExecutionListResponse
|
|
*/
|
|
export const zWorkflowRunNodeExecutionListResponse = z.object({
|
|
data: z.array(zWorkflowRunNodeExecutionResponse),
|
|
})
|
|
|
|
/**
|
|
* WorkflowRunPayload
|
|
*/
|
|
export const zWorkflowRunPayload = z.object({
|
|
attachments: z
|
|
.array(z.custom<Blob | File>((value) => value instanceof Blob || value instanceof File))
|
|
.nullish(),
|
|
files: z
|
|
.record(
|
|
z.string(),
|
|
z.union([
|
|
z.custom<Blob | File>((value) => value instanceof Blob || value instanceof File),
|
|
z.array(z.custom<Blob | File>((value) => value instanceof Blob || value instanceof File)),
|
|
]),
|
|
)
|
|
.nullish(),
|
|
inputs: z.record(z.string(), z.unknown()).optional(),
|
|
workflow_id: z.string().nullish(),
|
|
workspace_id: z.string().nullish(),
|
|
})
|
|
|
|
/**
|
|
* WorkflowWebApp
|
|
*/
|
|
export const zWorkflowWebApp = z.object({
|
|
access_token: z.string().nullish(),
|
|
app_base_url: z.string(),
|
|
copyright: z.string().nullish(),
|
|
custom_disclaimer: z.string().nullish(),
|
|
default_language: z.string().nullish(),
|
|
description: z.string().nullish(),
|
|
enabled: z.boolean(),
|
|
icon: z.string().nullish(),
|
|
icon_background: z.string().nullish(),
|
|
icon_type: z.string().nullish(),
|
|
privacy_policy: z.string().nullish(),
|
|
show_workflow_steps: z.boolean().optional().default(false),
|
|
title: z.string().nullish(),
|
|
url: z.string().nullish(),
|
|
})
|
|
|
|
/**
|
|
* WorkflowWebAppPatch
|
|
*/
|
|
export const zWorkflowWebAppPatch = z.object({
|
|
copyright: z.string().nullish(),
|
|
custom_disclaimer: z.string().nullish(),
|
|
default_language: z.string().nullish(),
|
|
description: z.string().nullish(),
|
|
enabled: z.boolean().nullish(),
|
|
icon: z.string().nullish(),
|
|
icon_background: z.string().nullish(),
|
|
icon_type: z.enum(['emoji', 'image', 'link']).nullish(),
|
|
privacy_policy: z.string().nullish(),
|
|
show_workflow_steps: z.boolean().nullish(),
|
|
title: z.string().nullish(),
|
|
})
|
|
|
|
/**
|
|
* WorkspaceDetailResponse
|
|
*/
|
|
export const zWorkspaceDetailResponse = z.object({
|
|
created_at: z.string().nullish(),
|
|
id: z.string(),
|
|
name: z.string(),
|
|
role: z.string(),
|
|
status: z.string(),
|
|
})
|
|
|
|
/**
|
|
* WorkspaceListQuery
|
|
*
|
|
* Strict (extra='forbid').
|
|
*/
|
|
export const zWorkspaceListQuery = z.object({
|
|
limit: z.int().gte(1).lte(100).optional().default(20),
|
|
page: z.int().gte(1).optional().default(1),
|
|
})
|
|
|
|
/**
|
|
* WorkspacePayload
|
|
*/
|
|
export const zWorkspacePayload = z.object({
|
|
id: z.string(),
|
|
name: z.string(),
|
|
role: z.string(),
|
|
})
|
|
|
|
/**
|
|
* AccountResponse
|
|
*/
|
|
export const zAccountResponse = z.object({
|
|
account: zAccountPayload.nullish(),
|
|
default_workspace_id: z.string().nullish(),
|
|
subject_email: z.string().nullish(),
|
|
subject_issuer: z.string().nullish(),
|
|
subject_type: zSubjectType,
|
|
workspaces: z.array(zWorkspacePayload).optional().default([]),
|
|
})
|
|
|
|
/**
|
|
* DeviceTokenResponse
|
|
*/
|
|
export const zDeviceTokenResponse = z.object({
|
|
account: zAccountPayload.nullish(),
|
|
default_workspace_id: z.string().nullish(),
|
|
expires_at: z.string(),
|
|
subject_email: z.string().nullish(),
|
|
subject_issuer: z.string().nullish(),
|
|
subject_type: zSubjectType,
|
|
token: z.string(),
|
|
token_id: z.string(),
|
|
workspaces: z.array(zWorkspacePayload).optional().default([]),
|
|
})
|
|
|
|
/**
|
|
* WorkspaceSummaryResponse
|
|
*/
|
|
export const zWorkspaceSummaryResponse = z.object({
|
|
id: z.string(),
|
|
name: z.string(),
|
|
role: z.string(),
|
|
status: z.string(),
|
|
})
|
|
|
|
/**
|
|
* WorkspaceListResponse
|
|
*/
|
|
export const zWorkspaceListResponse = z.object({
|
|
data: z.array(zWorkspaceSummaryResponse),
|
|
has_more: z.boolean(),
|
|
hints: z.array(zHint).optional(),
|
|
limit: z.int(),
|
|
page: z.int(),
|
|
total: z.int(),
|
|
})
|
|
|
|
/**
|
|
* Success
|
|
*/
|
|
export const zGetCatalogResponse = z.record(z.string(), z.unknown())
|
|
|
|
/**
|
|
* Health check
|
|
*/
|
|
export const zGetHealthResponse = zHealthResponse
|
|
|
|
/**
|
|
* Server version
|
|
*/
|
|
export const zGetVersionResponse = zServerVersionResponse
|
|
|
|
/**
|
|
* Account info
|
|
*/
|
|
export const zGetAccountResponse = zAccountResponse
|
|
|
|
export const zGetAccountSessionsQuery = z.object({
|
|
limit: z.int().gte(1).lte(100).optional().default(100),
|
|
page: z.int().gte(1).optional().default(1),
|
|
})
|
|
|
|
/**
|
|
* Session list
|
|
*/
|
|
export const zGetAccountSessionsResponse = zSessionListResponse
|
|
|
|
/**
|
|
* Session revoked
|
|
*/
|
|
export const zDeleteAccountSessionsSelfResponse = zRevokeResponse
|
|
|
|
export const zDeleteAccountSessionsBySessionIdPath = z.object({
|
|
session_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* Session revoked
|
|
*/
|
|
export const zDeleteAccountSessionsBySessionIdResponse = zRevokeResponse
|
|
|
|
export const zGetAppsQuery = z.object({
|
|
limit: z.int().gte(1).lte(100).optional().default(20),
|
|
mode: z.enum(['advanced-chat', 'agent-chat', 'chat', 'completion', 'workflow']).optional(),
|
|
name: z.string().max(200).optional(),
|
|
page: z.int().gte(1).optional().default(1),
|
|
workspace_id: z.uuid(),
|
|
})
|
|
|
|
/**
|
|
* App list
|
|
*/
|
|
export const zGetAppsResponse = zAppListResponse
|
|
|
|
export const zGetAppsByAppIdPath = z.object({
|
|
app_id: z.string(),
|
|
})
|
|
|
|
export const zGetAppsByAppIdQuery = z.object({
|
|
fields: z.string().optional(),
|
|
})
|
|
|
|
/**
|
|
* App description
|
|
*/
|
|
export const zGetAppsByAppIdResponse = zAppDescribeResponse
|
|
|
|
export const zPostAppsByAppIdAdvancedChatRunBody = zAdvancedChatRunPayload
|
|
|
|
export const zPostAppsByAppIdAdvancedChatRunPath = z.object({
|
|
app_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* Run result (SSE stream)
|
|
*/
|
|
export const zPostAppsByAppIdAdvancedChatRunResponse = zEventStreamResponse
|
|
|
|
export const zGetAppsByAppIdAppInfoAdvancedChatPath = z.object({
|
|
app_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* App info
|
|
*/
|
|
export const zGetAppsByAppIdAppInfoAdvancedChatResponse = zChatAppInfo
|
|
|
|
export const zPatchAppsByAppIdAppInfoAdvancedChatBody = zChatAppInfoPatch
|
|
|
|
export const zPatchAppsByAppIdAppInfoAdvancedChatPath = z.object({
|
|
app_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* App info
|
|
*/
|
|
export const zPatchAppsByAppIdAppInfoAdvancedChatResponse = zChatAppInfo
|
|
|
|
export const zGetAppsByAppIdAppInfoAgentPath = z.object({
|
|
app_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* App info
|
|
*/
|
|
export const zGetAppsByAppIdAppInfoAgentResponse = zAgentAppInfo
|
|
|
|
export const zPatchAppsByAppIdAppInfoAgentBody = zAgentAppInfoPatch
|
|
|
|
export const zPatchAppsByAppIdAppInfoAgentPath = z.object({
|
|
app_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* App info
|
|
*/
|
|
export const zPatchAppsByAppIdAppInfoAgentResponse = zAgentAppInfo
|
|
|
|
export const zGetAppsByAppIdAppInfoAgentChatPath = z.object({
|
|
app_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* App info
|
|
*/
|
|
export const zGetAppsByAppIdAppInfoAgentChatResponse = zChatAppInfo
|
|
|
|
export const zPatchAppsByAppIdAppInfoAgentChatBody = zChatAppInfoPatch
|
|
|
|
export const zPatchAppsByAppIdAppInfoAgentChatPath = z.object({
|
|
app_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* App info
|
|
*/
|
|
export const zPatchAppsByAppIdAppInfoAgentChatResponse = zChatAppInfo
|
|
|
|
export const zGetAppsByAppIdAppInfoChatPath = z.object({
|
|
app_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* App info
|
|
*/
|
|
export const zGetAppsByAppIdAppInfoChatResponse = zChatAppInfo
|
|
|
|
export const zPatchAppsByAppIdAppInfoChatBody = zChatAppInfoPatch
|
|
|
|
export const zPatchAppsByAppIdAppInfoChatPath = z.object({
|
|
app_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* App info
|
|
*/
|
|
export const zPatchAppsByAppIdAppInfoChatResponse = zChatAppInfo
|
|
|
|
export const zGetAppsByAppIdAppInfoCompletionPath = z.object({
|
|
app_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* App info
|
|
*/
|
|
export const zGetAppsByAppIdAppInfoCompletionResponse = zAppSettingsInfo
|
|
|
|
export const zPatchAppsByAppIdAppInfoCompletionBody = zAppInfoPatch
|
|
|
|
export const zPatchAppsByAppIdAppInfoCompletionPath = z.object({
|
|
app_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* App info
|
|
*/
|
|
export const zPatchAppsByAppIdAppInfoCompletionResponse = zAppSettingsInfo
|
|
|
|
export const zGetAppsByAppIdAppInfoWorkflowPath = z.object({
|
|
app_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* App info
|
|
*/
|
|
export const zGetAppsByAppIdAppInfoWorkflowResponse = zAppSettingsInfo
|
|
|
|
export const zPatchAppsByAppIdAppInfoWorkflowBody = zAppInfoPatch
|
|
|
|
export const zPatchAppsByAppIdAppInfoWorkflowPath = z.object({
|
|
app_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* App info
|
|
*/
|
|
export const zPatchAppsByAppIdAppInfoWorkflowResponse = zAppSettingsInfo
|
|
|
|
export const zPostAppsByAppIdChatRunBody = zChatRunPayload
|
|
|
|
export const zPostAppsByAppIdChatRunPath = z.object({
|
|
app_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* Run result (SSE stream)
|
|
*/
|
|
export const zPostAppsByAppIdChatRunResponse = zEventStreamResponse
|
|
|
|
export const zPostAppsByAppIdCompletionRunBody = zCompletionRunPayload
|
|
|
|
export const zPostAppsByAppIdCompletionRunPath = z.object({
|
|
app_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* Run result (SSE stream)
|
|
*/
|
|
export const zPostAppsByAppIdCompletionRunResponse = zEventStreamResponse
|
|
|
|
export const zGetAppsByAppIdDependenciesCheckPath = z.object({
|
|
app_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* Dependencies checked
|
|
*/
|
|
export const zGetAppsByAppIdDependenciesCheckResponse = zCheckDependenciesResponse
|
|
|
|
export const zPostAppsByAppIdDraftAdvancedChatNodesByNodeIdRunBody = zAdvancedChatNodeRunPayload
|
|
|
|
export const zPostAppsByAppIdDraftAdvancedChatNodesByNodeIdRunPath = z.object({
|
|
app_id: z.string(),
|
|
node_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* Node execution
|
|
*/
|
|
export const zPostAppsByAppIdDraftAdvancedChatNodesByNodeIdRunResponse =
|
|
zWorkflowRunNodeExecutionResponse
|
|
|
|
export const zPostAppsByAppIdDraftAdvancedChatRunBody = zChatRunPayload
|
|
|
|
export const zPostAppsByAppIdDraftAdvancedChatRunPath = z.object({
|
|
app_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* Run result (SSE stream)
|
|
*/
|
|
export const zPostAppsByAppIdDraftAdvancedChatRunResponse = zEventStreamResponse
|
|
|
|
export const zPostAppsByAppIdDraftWorkflowNodesByNodeIdRunBody = zNodeRunPayload
|
|
|
|
export const zPostAppsByAppIdDraftWorkflowNodesByNodeIdRunPath = z.object({
|
|
app_id: z.string(),
|
|
node_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* Node execution
|
|
*/
|
|
export const zPostAppsByAppIdDraftWorkflowNodesByNodeIdRunResponse =
|
|
zWorkflowRunNodeExecutionResponse
|
|
|
|
export const zPostAppsByAppIdDraftWorkflowRunBody = zDraftWorkflowRunPayload
|
|
|
|
export const zPostAppsByAppIdDraftWorkflowRunPath = z.object({
|
|
app_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* Run result (SSE stream)
|
|
*/
|
|
export const zPostAppsByAppIdDraftWorkflowRunResponse = zEventStreamResponse
|
|
|
|
export const zGetAppsByAppIdDslPath = z.object({
|
|
app_id: z.string(),
|
|
})
|
|
|
|
export const zGetAppsByAppIdDslQuery = z.object({
|
|
include_secret: z.boolean().optional().default(false),
|
|
workflow_id: z.uuid().optional(),
|
|
})
|
|
|
|
/**
|
|
* Export successful
|
|
*/
|
|
export const zGetAppsByAppIdDslResponse = zAppDslExportResponse
|
|
|
|
export const zGetAppsByAppIdEnvPath = z.object({
|
|
app_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* Environment variables
|
|
*/
|
|
export const zGetAppsByAppIdEnvResponse = zEnvVariableListResponse
|
|
|
|
export const zDeleteAppsByAppIdEnvByEnvIdPath = z.object({
|
|
app_id: z.string(),
|
|
env_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* Variable removed
|
|
*/
|
|
export const zDeleteAppsByAppIdEnvByEnvIdResponse = zSimpleResultResponse
|
|
|
|
export const zPutAppsByAppIdEnvByEnvIdBody = zEnvVariableSetPayload
|
|
|
|
export const zPutAppsByAppIdEnvByEnvIdPath = z.object({
|
|
app_id: z.string(),
|
|
env_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* Variable set
|
|
*/
|
|
export const zPutAppsByAppIdEnvByEnvIdResponse = zSimpleResultResponse
|
|
|
|
export const zPostAppsByAppIdFilesBody = zFileUploadPayload
|
|
|
|
export const zPostAppsByAppIdFilesPath = z.object({
|
|
app_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* File uploaded successfully
|
|
*/
|
|
export const zPostAppsByAppIdFilesResponse = zFileResponse
|
|
|
|
export const zGetAppsByAppIdHumanInputFormsByFormTokenPath = z.object({
|
|
app_id: z.string(),
|
|
form_token: z.string(),
|
|
})
|
|
|
|
/**
|
|
* Form definition
|
|
*/
|
|
export const zGetAppsByAppIdHumanInputFormsByFormTokenResponse = zHumanInputFormDefinitionResponse
|
|
|
|
export const zPostAppsByAppIdHumanInputFormsByFormTokenSubmitBody = zOpenApiFormSubmitPayload
|
|
|
|
export const zPostAppsByAppIdHumanInputFormsByFormTokenSubmitPath = z.object({
|
|
app_id: z.string(),
|
|
form_token: z.string(),
|
|
})
|
|
|
|
/**
|
|
* Form submitted
|
|
*/
|
|
export const zPostAppsByAppIdHumanInputFormsByFormTokenSubmitResponse = zFormSubmitResponse
|
|
|
|
export const zGetAppsByAppIdReleaseCheckPath = z.object({
|
|
app_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* Release check
|
|
*/
|
|
export const zGetAppsByAppIdReleaseCheckResponse = zReleaseCheckResponse
|
|
|
|
export const zGetAppsByAppIdRunsPath = z.object({
|
|
app_id: z.string(),
|
|
})
|
|
|
|
export const zGetAppsByAppIdRunsQuery = z.object({
|
|
last_id: z.uuid().optional(),
|
|
limit: z.int().gte(1).lte(100).optional().default(20),
|
|
status: z.enum(['failed', 'partial-succeeded', 'running', 'stopped', 'succeeded']).optional(),
|
|
triggered_from: z.enum(['app-run', 'debugging']).optional().default('debugging'),
|
|
})
|
|
|
|
/**
|
|
* Run list
|
|
*/
|
|
export const zGetAppsByAppIdRunsResponse = zRunListResponse
|
|
|
|
export const zGetAppsByAppIdRunsByRunIdPath = z.object({
|
|
app_id: z.string(),
|
|
run_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* Run detail
|
|
*/
|
|
export const zGetAppsByAppIdRunsByRunIdResponse = zWorkflowRunDetailResponse
|
|
|
|
export const zGetAppsByAppIdRunsByRunIdNodesPath = z.object({
|
|
app_id: z.string(),
|
|
run_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* Node steps
|
|
*/
|
|
export const zGetAppsByAppIdRunsByRunIdNodesResponse = zWorkflowRunNodeExecutionListResponse
|
|
|
|
export const zGetAppsByAppIdServiceApiPath = z.object({
|
|
app_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* Service API
|
|
*/
|
|
export const zGetAppsByAppIdServiceApiResponse = zServiceApi
|
|
|
|
export const zPatchAppsByAppIdServiceApiBody = zServiceApiPatch
|
|
|
|
export const zPatchAppsByAppIdServiceApiPath = z.object({
|
|
app_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* Service API
|
|
*/
|
|
export const zPatchAppsByAppIdServiceApiResponse = zServiceApi
|
|
|
|
export const zGetAppsByAppIdServiceApiAgentPath = z.object({
|
|
app_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* Service API
|
|
*/
|
|
export const zGetAppsByAppIdServiceApiAgentResponse = zAgentServiceApi
|
|
|
|
export const zPatchAppsByAppIdServiceApiAgentBody = zServiceApiPatch
|
|
|
|
export const zPatchAppsByAppIdServiceApiAgentPath = z.object({
|
|
app_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* Service API
|
|
*/
|
|
export const zPatchAppsByAppIdServiceApiAgentResponse = zAgentServiceApi
|
|
|
|
export const zGetAppsByAppIdTasksByTaskIdEventsPath = z.object({
|
|
app_id: z.string(),
|
|
task_id: z.string(),
|
|
})
|
|
|
|
export const zGetAppsByAppIdTasksByTaskIdEventsQuery = z.object({
|
|
continue_on_pause: z.boolean().optional().default(false),
|
|
include_state_snapshot: z.boolean().optional().default(false),
|
|
})
|
|
|
|
/**
|
|
* SSE event stream
|
|
*/
|
|
export const zGetAppsByAppIdTasksByTaskIdEventsResponse = zEventStreamResponse
|
|
|
|
export const zPostAppsByAppIdTasksByTaskIdStopPath = z.object({
|
|
app_id: z.string(),
|
|
task_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* Task stopped
|
|
*/
|
|
export const zPostAppsByAppIdTasksByTaskIdStopResponse = zTaskStopResponse
|
|
|
|
export const zGetAppsByAppIdVersionsPath = z.object({
|
|
app_id: z.string(),
|
|
})
|
|
|
|
export const zGetAppsByAppIdVersionsQuery = z.object({
|
|
limit: z.int().gte(1).lte(100).optional().default(20),
|
|
named_only: z.boolean().optional().default(false),
|
|
page: z.int().gte(1).optional().default(1),
|
|
})
|
|
|
|
/**
|
|
* Version list
|
|
*/
|
|
export const zGetAppsByAppIdVersionsResponse = zVersionListResponse
|
|
|
|
export const zPostAppsByAppIdVersionsByVersionIdRestorePath = z.object({
|
|
app_id: z.string(),
|
|
version_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* Restored into the draft
|
|
*/
|
|
export const zPostAppsByAppIdVersionsByVersionIdRestoreResponse = zRestoreResponse
|
|
|
|
export const zGetAppsByAppIdWebappAccessPath = z.object({
|
|
app_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* Web-app access
|
|
*/
|
|
export const zGetAppsByAppIdWebappAccessResponse = zWebAppAccess
|
|
|
|
export const zPutAppsByAppIdWebappAccessBody = zWebAppAccessPayload
|
|
|
|
export const zPutAppsByAppIdWebappAccessPath = z.object({
|
|
app_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* Web-app access
|
|
*/
|
|
export const zPutAppsByAppIdWebappAccessResponse = zWebAppAccess
|
|
|
|
export const zGetAppsByAppIdWebappAccessAgentPath = z.object({
|
|
app_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* Web-app access
|
|
*/
|
|
export const zGetAppsByAppIdWebappAccessAgentResponse = zWebAppAccess
|
|
|
|
export const zPutAppsByAppIdWebappAccessAgentBody = zWebAppAccessPayload
|
|
|
|
export const zPutAppsByAppIdWebappAccessAgentPath = z.object({
|
|
app_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* Web-app access
|
|
*/
|
|
export const zPutAppsByAppIdWebappAccessAgentResponse = zWebAppAccess
|
|
|
|
export const zGetAppsByAppIdWebappAdvancedChatPath = z.object({
|
|
app_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* Web app
|
|
*/
|
|
export const zGetAppsByAppIdWebappAdvancedChatResponse = zAdvancedChatWebApp
|
|
|
|
export const zPatchAppsByAppIdWebappAdvancedChatBody = zAdvancedChatWebAppPatch
|
|
|
|
export const zPatchAppsByAppIdWebappAdvancedChatPath = z.object({
|
|
app_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* Web app
|
|
*/
|
|
export const zPatchAppsByAppIdWebappAdvancedChatResponse = zAdvancedChatWebApp
|
|
|
|
export const zGetAppsByAppIdWebappAgentPath = z.object({
|
|
app_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* Web app
|
|
*/
|
|
export const zGetAppsByAppIdWebappAgentResponse = zAgentWebApp
|
|
|
|
export const zPatchAppsByAppIdWebappAgentBody = zChatWebAppPatch
|
|
|
|
export const zPatchAppsByAppIdWebappAgentPath = z.object({
|
|
app_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* Web app
|
|
*/
|
|
export const zPatchAppsByAppIdWebappAgentResponse = zAgentWebApp
|
|
|
|
export const zGetAppsByAppIdWebappAgentChatPath = z.object({
|
|
app_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* Web app
|
|
*/
|
|
export const zGetAppsByAppIdWebappAgentChatResponse = zChatWebApp
|
|
|
|
export const zPatchAppsByAppIdWebappAgentChatBody = zChatWebAppPatch
|
|
|
|
export const zPatchAppsByAppIdWebappAgentChatPath = z.object({
|
|
app_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* Web app
|
|
*/
|
|
export const zPatchAppsByAppIdWebappAgentChatResponse = zChatWebApp
|
|
|
|
export const zPostAppsByAppIdWebappAgentResetPath = z.object({
|
|
app_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* New URL token
|
|
*/
|
|
export const zPostAppsByAppIdWebappAgentResetResponse = zWebAppToken
|
|
|
|
export const zGetAppsByAppIdWebappChatPath = z.object({
|
|
app_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* Web app
|
|
*/
|
|
export const zGetAppsByAppIdWebappChatResponse = zChatWebApp
|
|
|
|
export const zPatchAppsByAppIdWebappChatBody = zChatWebAppPatch
|
|
|
|
export const zPatchAppsByAppIdWebappChatPath = z.object({
|
|
app_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* Web app
|
|
*/
|
|
export const zPatchAppsByAppIdWebappChatResponse = zChatWebApp
|
|
|
|
export const zGetAppsByAppIdWebappCompletionPath = z.object({
|
|
app_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* Web app
|
|
*/
|
|
export const zGetAppsByAppIdWebappCompletionResponse = zWebApp
|
|
|
|
export const zPatchAppsByAppIdWebappCompletionBody = zWebAppPatch
|
|
|
|
export const zPatchAppsByAppIdWebappCompletionPath = z.object({
|
|
app_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* Web app
|
|
*/
|
|
export const zPatchAppsByAppIdWebappCompletionResponse = zWebApp
|
|
|
|
export const zGetAppsByAppIdWebappWorkflowPath = z.object({
|
|
app_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* Web app
|
|
*/
|
|
export const zGetAppsByAppIdWebappWorkflowResponse = zWorkflowWebApp
|
|
|
|
export const zPatchAppsByAppIdWebappWorkflowBody = zWorkflowWebAppPatch
|
|
|
|
export const zPatchAppsByAppIdWebappWorkflowPath = z.object({
|
|
app_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* Web app
|
|
*/
|
|
export const zPatchAppsByAppIdWebappWorkflowResponse = zWorkflowWebApp
|
|
|
|
export const zPostAppsByAppIdWebappResetPath = z.object({
|
|
app_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* New URL token
|
|
*/
|
|
export const zPostAppsByAppIdWebappResetResponse = zWebAppToken
|
|
|
|
export const zPostAppsByAppIdWorkflowRunBody = zWorkflowRunPayload
|
|
|
|
export const zPostAppsByAppIdWorkflowRunPath = z.object({
|
|
app_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* Run result (SSE stream)
|
|
*/
|
|
export const zPostAppsByAppIdWorkflowRunResponse = zEventStreamResponse
|
|
|
|
export const zPostAppsByAppIdPublishBody = zPublishPayload
|
|
|
|
export const zPostAppsByAppIdPublishPath = z.object({
|
|
app_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* Published
|
|
*/
|
|
export const zPostAppsByAppIdPublishResponse = zPublishResponse
|
|
|
|
/**
|
|
* Node types
|
|
*/
|
|
export const zGetNodeTypesResponse = zNodeTypeListResponse
|
|
|
|
export const zGetNodeTypesByNodeTypePath = z.object({
|
|
node_type: z.string(),
|
|
})
|
|
|
|
/**
|
|
* Node type
|
|
*/
|
|
export const zGetNodeTypesByNodeTypeResponse = zNodeTypeDetailResponse
|
|
|
|
export const zPostOauthDeviceApproveBody = zDeviceMutateRequest
|
|
|
|
/**
|
|
* Approved
|
|
*/
|
|
export const zPostOauthDeviceApproveResponse = zDeviceMutateResponse
|
|
|
|
export const zPostOauthDeviceCodeBody = zDeviceCodeRequest
|
|
|
|
/**
|
|
* Device code created
|
|
*/
|
|
export const zPostOauthDeviceCodeResponse = zDeviceCodeResponse
|
|
|
|
export const zPostOauthDeviceDenyBody = zDeviceMutateRequest
|
|
|
|
/**
|
|
* Denied
|
|
*/
|
|
export const zPostOauthDeviceDenyResponse = zDeviceMutateResponse
|
|
|
|
export const zGetOauthDeviceLookupQuery = z.object({
|
|
user_code: z.string(),
|
|
})
|
|
|
|
/**
|
|
* Device lookup result
|
|
*/
|
|
export const zGetOauthDeviceLookupResponse = zDeviceLookupResponse
|
|
|
|
export const zPostOauthDeviceTokenBody = zDevicePollRequest
|
|
|
|
/**
|
|
* Device token
|
|
*/
|
|
export const zPostOauthDeviceTokenResponse = zDeviceTokenResponse
|
|
|
|
export const zGetPermittedExternalAppsQuery = z.object({
|
|
limit: z.int().gte(1).lte(100).optional().default(20),
|
|
mode: z.enum(['advanced-chat', 'agent-chat', 'chat', 'completion', 'workflow']).optional(),
|
|
name: z.string().max(200).optional(),
|
|
page: z.int().gte(1).optional().default(1),
|
|
})
|
|
|
|
/**
|
|
* Permitted external apps list
|
|
*/
|
|
export const zGetPermittedExternalAppsResponse = zPermittedExternalAppsListResponse
|
|
|
|
export const zGetPermittedExternalAppsByAppIdPath = z.object({
|
|
app_id: z.string(),
|
|
})
|
|
|
|
export const zGetPermittedExternalAppsByAppIdQuery = z.object({
|
|
fields: z.string().optional(),
|
|
})
|
|
|
|
/**
|
|
* Permitted external app description
|
|
*/
|
|
export const zGetPermittedExternalAppsByAppIdResponse = zAppDescribeResponse
|
|
|
|
export const zGetWorkspacesQuery = z.object({
|
|
limit: z.int().gte(1).lte(100).optional().default(20),
|
|
page: z.int().gte(1).optional().default(1),
|
|
})
|
|
|
|
/**
|
|
* Workspace list
|
|
*/
|
|
export const zGetWorkspacesResponse = zWorkspaceListResponse
|
|
|
|
export const zGetWorkspacesByWorkspaceIdPath = z.object({
|
|
workspace_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* Workspace detail
|
|
*/
|
|
export const zGetWorkspacesByWorkspaceIdResponse = zWorkspaceDetailResponse
|
|
|
|
export const zPostWorkspacesByWorkspaceIdAppsAdvancedChatBody = zCreateAppPayload
|
|
|
|
export const zPostWorkspacesByWorkspaceIdAppsAdvancedChatPath = z.object({
|
|
workspace_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* Created
|
|
*/
|
|
export const zPostWorkspacesByWorkspaceIdAppsAdvancedChatResponse = zCreatedAppResponse
|
|
|
|
export const zPostWorkspacesByWorkspaceIdAppsImportsBody = zAppDslImportPayload
|
|
|
|
export const zPostWorkspacesByWorkspaceIdAppsImportsPath = z.object({
|
|
workspace_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* Import completed
|
|
*/
|
|
export const zPostWorkspacesByWorkspaceIdAppsImportsResponse = zAppDslImportResponse
|
|
|
|
export const zPostWorkspacesByWorkspaceIdAppsImportsByImportIdConfirmPath = z.object({
|
|
import_id: z.string(),
|
|
workspace_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* Import confirmed
|
|
*/
|
|
export const zPostWorkspacesByWorkspaceIdAppsImportsByImportIdConfirmResponse = zImport
|
|
|
|
export const zPostWorkspacesByWorkspaceIdAppsImportsCheckBody = zDslCheckPayload
|
|
|
|
export const zPostWorkspacesByWorkspaceIdAppsImportsCheckPath = z.object({
|
|
workspace_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* Check result
|
|
*/
|
|
export const zPostWorkspacesByWorkspaceIdAppsImportsCheckResponse = zDslCheckResponse
|
|
|
|
export const zPostWorkspacesByWorkspaceIdAppsWorkflowBody = zCreateAppPayload
|
|
|
|
export const zPostWorkspacesByWorkspaceIdAppsWorkflowPath = z.object({
|
|
workspace_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* Created
|
|
*/
|
|
export const zPostWorkspacesByWorkspaceIdAppsWorkflowResponse = zCreatedAppResponse
|
|
|
|
export const zGetWorkspacesByWorkspaceIdKnowledgeBasesPath = z.object({
|
|
workspace_id: z.string(),
|
|
})
|
|
|
|
export const zGetWorkspacesByWorkspaceIdKnowledgeBasesQuery = z.object({
|
|
limit: z.int().gte(1).lte(100).optional().default(20),
|
|
page: z.int().gte(1).optional().default(1),
|
|
query: z.string().optional().default(''),
|
|
})
|
|
|
|
/**
|
|
* Knowledge bases
|
|
*/
|
|
export const zGetWorkspacesByWorkspaceIdKnowledgeBasesResponse = zKnowledgeBaseListResponse
|
|
|
|
export const zGetWorkspacesByWorkspaceIdMarketplacePluginsPath = z.object({
|
|
workspace_id: z.string(),
|
|
})
|
|
|
|
export const zGetWorkspacesByWorkspaceIdMarketplacePluginsQuery = z.object({
|
|
category: z
|
|
.enum(['agent-strategy', 'datasource', 'extension', 'model', 'tool', 'trigger'])
|
|
.optional(),
|
|
limit: z.int().gte(1).lte(100).optional().default(20),
|
|
page: z.int().gte(1).optional().default(1),
|
|
query: z.string().optional().default(''),
|
|
})
|
|
|
|
/**
|
|
* Marketplace plugins
|
|
*/
|
|
export const zGetWorkspacesByWorkspaceIdMarketplacePluginsResponse = zMarketplacePluginListResponse
|
|
|
|
export const zGetWorkspacesByWorkspaceIdMembersPath = z.object({
|
|
workspace_id: z.string(),
|
|
})
|
|
|
|
export const zGetWorkspacesByWorkspaceIdMembersQuery = z.object({
|
|
limit: z.int().gte(1).lte(100).optional().default(20),
|
|
page: z.int().gte(1).optional().default(1),
|
|
})
|
|
|
|
/**
|
|
* Member list
|
|
*/
|
|
export const zGetWorkspacesByWorkspaceIdMembersResponse = zMemberListResponse
|
|
|
|
export const zPostWorkspacesByWorkspaceIdMembersBody = zMemberInvitePayload
|
|
|
|
export const zPostWorkspacesByWorkspaceIdMembersPath = z.object({
|
|
workspace_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* Member invited
|
|
*/
|
|
export const zPostWorkspacesByWorkspaceIdMembersResponse = zMemberInviteResponse
|
|
|
|
export const zDeleteWorkspacesByWorkspaceIdMembersByMemberIdPath = z.object({
|
|
member_id: z.string(),
|
|
workspace_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* Member removed
|
|
*/
|
|
export const zDeleteWorkspacesByWorkspaceIdMembersByMemberIdResponse = zMemberActionResponse
|
|
|
|
export const zPatchWorkspacesByWorkspaceIdMembersByMemberIdBody = zMemberRoleUpdatePayload
|
|
|
|
export const zPatchWorkspacesByWorkspaceIdMembersByMemberIdPath = z.object({
|
|
member_id: z.string(),
|
|
workspace_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* Role updated
|
|
*/
|
|
export const zPatchWorkspacesByWorkspaceIdMembersByMemberIdResponse = zMemberActionResponse
|
|
|
|
export const zGetWorkspacesByWorkspaceIdModelProvidersByProviderPath = z.object({
|
|
provider: z.string(),
|
|
workspace_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* Model provider
|
|
*/
|
|
export const zGetWorkspacesByWorkspaceIdModelProvidersByProviderResponse =
|
|
zModelProviderDetailResponse
|
|
|
|
export const zPostWorkspacesByWorkspaceIdModelProvidersByProviderCredentialsBody =
|
|
zProviderCredentialCreatePayload
|
|
|
|
export const zPostWorkspacesByWorkspaceIdModelProvidersByProviderCredentialsPath = z.object({
|
|
provider: z.string(),
|
|
workspace_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* Credential saved
|
|
*/
|
|
export const zPostWorkspacesByWorkspaceIdModelProvidersByProviderCredentialsResponse =
|
|
zCredentialWriteResponse
|
|
|
|
export const zPatchWorkspacesByWorkspaceIdModelProvidersByProviderCredentialsByCredentialIdBody =
|
|
zProviderCredentialUpdatePayload
|
|
|
|
export const zPatchWorkspacesByWorkspaceIdModelProvidersByProviderCredentialsByCredentialIdPath =
|
|
z.object({
|
|
credential_id: z.string(),
|
|
provider: z.string(),
|
|
workspace_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* Credential replaced
|
|
*/
|
|
export const zPatchWorkspacesByWorkspaceIdModelProvidersByProviderCredentialsByCredentialIdResponse =
|
|
zCredentialWriteResponse
|
|
|
|
export const zPostWorkspacesByWorkspaceIdModelProvidersByProviderModelsCredentialsBody =
|
|
zModelCredentialCreatePayload
|
|
|
|
export const zPostWorkspacesByWorkspaceIdModelProvidersByProviderModelsCredentialsPath = z.object({
|
|
provider: z.string(),
|
|
workspace_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* Credential saved
|
|
*/
|
|
export const zPostWorkspacesByWorkspaceIdModelProvidersByProviderModelsCredentialsResponse =
|
|
zCredentialWriteResponse
|
|
|
|
export const zPatchWorkspacesByWorkspaceIdModelProvidersByProviderModelsCredentialsByCredentialIdBody =
|
|
zModelCredentialUpdatePayload
|
|
|
|
export const zPatchWorkspacesByWorkspaceIdModelProvidersByProviderModelsCredentialsByCredentialIdPath =
|
|
z.object({
|
|
credential_id: z.string(),
|
|
provider: z.string(),
|
|
workspace_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* Credential replaced
|
|
*/
|
|
export const zPatchWorkspacesByWorkspaceIdModelProvidersByProviderModelsCredentialsByCredentialIdResponse =
|
|
zCredentialWriteResponse
|
|
|
|
export const zGetWorkspacesByWorkspaceIdModelsPath = z.object({
|
|
workspace_id: z.string(),
|
|
})
|
|
|
|
export const zGetWorkspacesByWorkspaceIdModelsQuery = z.object({
|
|
limit: z.int().gte(1).lte(100).optional().default(20),
|
|
model_type: z
|
|
.enum(['llm', 'moderation', 'rerank', 'speech2text', 'text-embedding', 'tts'])
|
|
.optional(),
|
|
page: z.int().gte(1).optional().default(1),
|
|
provider: z.string().optional(),
|
|
query: z.string().optional().default(''),
|
|
})
|
|
|
|
/**
|
|
* Models
|
|
*/
|
|
export const zGetWorkspacesByWorkspaceIdModelsResponse = zModelListResponse
|
|
|
|
export const zGetWorkspacesByWorkspaceIdPluginTasksByTaskIdPath = z.object({
|
|
task_id: z.string(),
|
|
workspace_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* Install task
|
|
*/
|
|
export const zGetWorkspacesByWorkspaceIdPluginTasksByTaskIdResponse = zPluginTaskResponse
|
|
|
|
export const zGetWorkspacesByWorkspaceIdPluginsPath = z.object({
|
|
workspace_id: z.string(),
|
|
})
|
|
|
|
export const zGetWorkspacesByWorkspaceIdPluginsQuery = z.object({
|
|
category: z
|
|
.enum(['agent-strategy', 'datasource', 'extension', 'model', 'tool', 'trigger'])
|
|
.optional(),
|
|
})
|
|
|
|
/**
|
|
* Installed plugins
|
|
*/
|
|
export const zGetWorkspacesByWorkspaceIdPluginsResponse = zPluginListResponse
|
|
|
|
export const zDeleteWorkspacesByWorkspaceIdPluginsByPluginIdPath = z.object({
|
|
plugin_id: z.string(),
|
|
workspace_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* Plugin uninstalled
|
|
*/
|
|
export const zDeleteWorkspacesByWorkspaceIdPluginsByPluginIdResponse = zPluginDeleteResponse
|
|
|
|
export const zPostWorkspacesByWorkspaceIdPluginsInstallBody = zPluginInstallPayload
|
|
|
|
export const zPostWorkspacesByWorkspaceIdPluginsInstallPath = z.object({
|
|
workspace_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* Install started
|
|
*/
|
|
export const zPostWorkspacesByWorkspaceIdPluginsInstallResponse = zPluginTaskStartResponse
|
|
|
|
export const zGetWorkspacesByWorkspaceIdToolProvidersByProviderPath = z.object({
|
|
provider: z.string(),
|
|
workspace_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* Tool provider
|
|
*/
|
|
export const zGetWorkspacesByWorkspaceIdToolProvidersByProviderResponse =
|
|
zToolProviderDetailResponse
|
|
|
|
export const zPostWorkspacesByWorkspaceIdToolProvidersByProviderCredentialsBody =
|
|
zToolCredentialCreatePayload
|
|
|
|
export const zPostWorkspacesByWorkspaceIdToolProvidersByProviderCredentialsPath = z.object({
|
|
provider: z.string(),
|
|
workspace_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* Credential saved
|
|
*/
|
|
export const zPostWorkspacesByWorkspaceIdToolProvidersByProviderCredentialsResponse =
|
|
zCredentialWriteResponse
|
|
|
|
export const zPatchWorkspacesByWorkspaceIdToolProvidersByProviderCredentialsByCredentialIdBody =
|
|
zToolCredentialUpdatePayload
|
|
|
|
export const zPatchWorkspacesByWorkspaceIdToolProvidersByProviderCredentialsByCredentialIdPath =
|
|
z.object({
|
|
credential_id: z.string(),
|
|
provider: z.string(),
|
|
workspace_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* Credential replaced
|
|
*/
|
|
export const zPatchWorkspacesByWorkspaceIdToolProvidersByProviderCredentialsByCredentialIdResponse =
|
|
zCredentialWriteResponse
|
|
|
|
export const zGetWorkspacesByWorkspaceIdToolsPath = z.object({
|
|
workspace_id: z.string(),
|
|
})
|
|
|
|
export const zGetWorkspacesByWorkspaceIdToolsQuery = z.object({
|
|
limit: z.int().gte(1).lte(100).optional().default(20),
|
|
page: z.int().gte(1).optional().default(1),
|
|
provider: z.string().optional(),
|
|
provider_type: z.enum(['api', 'builtin', 'mcp', 'workflow']).optional(),
|
|
query: z.string().optional().default(''),
|
|
})
|
|
|
|
/**
|
|
* Tools
|
|
*/
|
|
export const zGetWorkspacesByWorkspaceIdToolsResponse = zToolListResponse
|