mirror of
https://github.com/langgenius/dify.git
synced 2026-09-05 08:48:10 +08:00
4819 lines
142 KiB
TypeScript
4819 lines
142 KiB
TypeScript
// This file is auto-generated by @hey-api/openapi-ts
|
|
|
|
import * as z from 'zod'
|
|
|
|
/**
|
|
* KnowledgeFSInitialSourcePreviewJobCreateResponse
|
|
*/
|
|
export const zKnowledgeFsInitialSourcePreviewJobCreateResponse = z.object({
|
|
job_id: z.string(),
|
|
status: z.literal('pending').optional().default('pending'),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSBulkJobResponse
|
|
*/
|
|
export const zKnowledgeFsBulkJobResponse = z.object({
|
|
canceled_items: z.int().gte(0),
|
|
completed_items: z.int().gte(0),
|
|
created_at: z.iso.datetime(),
|
|
failed_item_ids: z.array(z.string()),
|
|
failed_items: z.int().gte(0),
|
|
id: z.string(),
|
|
knowledge_space_id: z.string(),
|
|
status: z.enum(['canceled', 'completed', 'failed', 'running']),
|
|
total_items: z.int().gte(0),
|
|
type: z.enum(['document_delete', 'document_reindex', 'document_upload']),
|
|
updated_at: z.iso.datetime(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSDocumentStagedUploadPayload
|
|
*/
|
|
export const zKnowledgeFsDocumentStagedUploadPayload = z.object({
|
|
upload_id: z.string().min(1).max(255),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSDocumentStagedUploadAcceptedResponse
|
|
*/
|
|
export const zKnowledgeFsDocumentStagedUploadAcceptedResponse = z.object({
|
|
compilation_job_id: z.string(),
|
|
document_asset_id: z.string(),
|
|
status: z.literal('accepted').optional().default('accepted'),
|
|
upload_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSDocumentReindexPayload
|
|
*/
|
|
export const zKnowledgeFsDocumentReindexPayload = z.object({
|
|
all: z.boolean().nullish(),
|
|
documentIds: z.array(z.string()).min(1).max(1000).nullish(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSDocumentDeletePayload
|
|
*/
|
|
export const zKnowledgeFsDocumentDeletePayload = z.object({
|
|
expectedRevision: z.int().gte(1),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSDocumentResponse
|
|
*/
|
|
export const zKnowledgeFsDocumentResponse = z.object({
|
|
created_at: z.iso.datetime(),
|
|
filename: z.string(),
|
|
id: z.string(),
|
|
knowledge_space_id: z.string(),
|
|
metadata: z.record(z.string(), z.unknown()),
|
|
mime_type: z.string(),
|
|
object_key: z.string(),
|
|
parser_status: z.enum(['failed', 'parsed', 'pending']),
|
|
sha256: z.string(),
|
|
size_bytes: z.int().gte(0),
|
|
source_id: z.string().nullish(),
|
|
updated_at: z.iso.datetime().nullish(),
|
|
version: z.int().gte(1),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSDocumentListResponse
|
|
*/
|
|
export const zKnowledgeFsDocumentListResponse = z.object({
|
|
data: z.array(zKnowledgeFsDocumentResponse),
|
|
next_cursor: z.string().nullish(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSDocumentMetadataPayload
|
|
*/
|
|
export const zKnowledgeFsDocumentMetadataPayload = z.object({
|
|
expectedRowVersion: z.int().gte(0),
|
|
patch: z.record(z.string(), z.unknown()),
|
|
})
|
|
|
|
/**
|
|
* BinaryFileResponse
|
|
*/
|
|
export const zBinaryFileResponse = z.custom<Blob | File>(
|
|
(value) => value instanceof Blob || value instanceof File,
|
|
)
|
|
|
|
/**
|
|
* KnowledgeFSDocumentChunkResponse
|
|
*/
|
|
export const zKnowledgeFsDocumentChunkResponse = z.object({
|
|
created_at: z.iso.datetime(),
|
|
document_id: z.string(),
|
|
document_revision: z.int().gte(1),
|
|
enabled: z.boolean(),
|
|
end_offset: z.int().gte(0).nullish(),
|
|
id: z.string(),
|
|
kind: z.enum(['chunk', 'image', 'section', 'summary', 'table']).optional().default('chunk'),
|
|
knowledge_space_id: z.string(),
|
|
ordinal: z.int().gte(0),
|
|
parent_chunk_id: z.string().nullish(),
|
|
parse_element_ids: z.array(z.string()),
|
|
section_path: z.array(z.string()).optional(),
|
|
start_offset: z.int().gte(0).nullish(),
|
|
text: z.string(),
|
|
token_count: z.int().gte(0),
|
|
user_metadata: z.record(z.string(), z.unknown()),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSDocumentChunkListResponse
|
|
*/
|
|
export const zKnowledgeFsDocumentChunkListResponse = z.object({
|
|
data: z.array(zKnowledgeFsDocumentChunkResponse),
|
|
next_cursor: z.string().nullish(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSExternalAccessResponse
|
|
*/
|
|
export const zKnowledgeFsExternalAccessResponse = z.object({
|
|
agent_enabled: z.boolean(),
|
|
mcp_enabled: z.boolean(),
|
|
revision: z.int(),
|
|
service_api_enabled: z.boolean(),
|
|
workflow_enabled: z.boolean(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSExternalAccessPayload
|
|
*/
|
|
export const zKnowledgeFsExternalAccessPayload = z.object({
|
|
agent_enabled: z.boolean(),
|
|
mcp_enabled: z.boolean().optional().default(false),
|
|
service_api_enabled: z.boolean(),
|
|
workflow_enabled: z.boolean(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSGoldenQuestionPayload
|
|
*/
|
|
export const zKnowledgeFsGoldenQuestionPayload = z.object({
|
|
annotation: z.string().max(2000).optional().default(''),
|
|
evidence_text: z.string().max(8000).optional().default(''),
|
|
expected_evidence_ids: z.array(z.string()).max(50).optional(),
|
|
match_policy: z.enum(['all', 'any']).optional().default('all'),
|
|
question: z.string().min(1).max(4000),
|
|
source_bad_case_id: z.string().max(255).nullish(),
|
|
tags: z.array(z.string()).max(50).optional(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSGoldenQuestionResponse
|
|
*/
|
|
export const zKnowledgeFsGoldenQuestionResponse = z.object({
|
|
annotation: z.string(),
|
|
created_at: z.iso.datetime(),
|
|
evidence_text: z.string().optional().default(''),
|
|
expected_evidence_ids: z.array(z.string()).optional(),
|
|
id: z.string(),
|
|
match_policy: z.enum(['all', 'any']).optional().default('all'),
|
|
question: z.string(),
|
|
status: z.enum(['active', 'draft', 'stale']),
|
|
tags: z.array(z.string()),
|
|
updated_at: z.iso.datetime(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSGoldenQuestionListResponse
|
|
*/
|
|
export const zKnowledgeFsGoldenQuestionListResponse = z.object({
|
|
data: z.array(zKnowledgeFsGoldenQuestionResponse),
|
|
next_cursor: z.string().nullish(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSGoldenQuestionEvidenceMatchPayload
|
|
*/
|
|
export const zKnowledgeFsGoldenQuestionEvidenceMatchPayload = z.object({
|
|
evidence: z.string().min(1).max(8000).nullish(),
|
|
minimum_similarity: z.number().gte(0).lte(1).optional().default(0.7),
|
|
node_ids: z.array(z.string()).max(50).optional(),
|
|
top_k: z.int().gte(1).lte(10).optional().default(5),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSDocumentCompilationJobResponse
|
|
*/
|
|
export const zKnowledgeFsDocumentCompilationJobResponse = z.object({
|
|
base_head_revision: z.int().gte(0).nullish(),
|
|
candidate_fingerprint: z.string().nullish(),
|
|
candidate_publication_id: z.string().nullish(),
|
|
completed_at: z.number().nullish(),
|
|
created_at: z.number(),
|
|
document_asset_id: z.string(),
|
|
error: z.string().nullish(),
|
|
execution_attempts: z.int().gte(0).nullish(),
|
|
id: z.string(),
|
|
knowledge_space_id: z.string(),
|
|
max_execution_attempts: z.int().gte(1).nullish(),
|
|
run_state: z.string().nullish(),
|
|
stage: z.enum([
|
|
'canceled',
|
|
'failed',
|
|
'nodes_generated',
|
|
'outline_built',
|
|
'parsed',
|
|
'projection_built',
|
|
'published',
|
|
'queued',
|
|
'smoke_eval_passed',
|
|
]),
|
|
updated_at: z.number(),
|
|
version: z.int().gte(1),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSDocumentBatchDownloadPayload
|
|
*/
|
|
export const zKnowledgeFsDocumentBatchDownloadPayload = z.object({
|
|
document_ids: z.array(z.string()).min(1).max(100),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSLogicalDocumentDeletePayload
|
|
*/
|
|
export const zKnowledgeFsLogicalDocumentDeletePayload = z.object({
|
|
expectedRevision: z.int().gte(0),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSDocumentAvailabilityPayload
|
|
*/
|
|
export const zKnowledgeFsDocumentAvailabilityPayload = z.object({
|
|
enabled: z.boolean(),
|
|
expectedRowVersion: z.int().gte(0),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSMetadataFieldCreatePayload
|
|
*/
|
|
export const zKnowledgeFsMetadataFieldCreatePayload = z.object({
|
|
name: z.string().min(1).max(255),
|
|
type: z.enum(['number', 'string', 'time']),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSMetadataFieldResponse
|
|
*/
|
|
export const zKnowledgeFsMetadataFieldResponse = z.object({
|
|
count: z.int().gte(0),
|
|
created_at: z.iso.datetime(),
|
|
id: z.string(),
|
|
name: z.string(),
|
|
row_version: z.int().gte(0),
|
|
type: z.enum(['number', 'string', 'time']),
|
|
updated_at: z.iso.datetime(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSMetadataFieldListResponse
|
|
*/
|
|
export const zKnowledgeFsMetadataFieldListResponse = z.object({
|
|
data: z.array(zKnowledgeFsMetadataFieldResponse),
|
|
next_cursor: z.string().nullish(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSMetadataFieldDeleteResponse
|
|
*/
|
|
export const zKnowledgeFsMetadataFieldDeleteResponse = z.object({
|
|
deleted: z.literal(true),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSMetadataFieldUpdatePayload
|
|
*/
|
|
export const zKnowledgeFsMetadataFieldUpdatePayload = z.object({
|
|
expectedRowVersion: z.int().gte(0),
|
|
name: z.string().min(1).max(255),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSBadCaseCreatePayload
|
|
*/
|
|
export const zKnowledgeFsBadCaseCreatePayload = z.object({
|
|
reason: z.string().min(1).max(4000),
|
|
tags: z.array(z.string()).max(50).optional(),
|
|
trace_id: z.string().min(1),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSBadCaseResponse
|
|
*/
|
|
export const zKnowledgeFsBadCaseResponse = z.object({
|
|
created_at: z.iso.datetime(),
|
|
id: z.string(),
|
|
question: z.string().optional().default(''),
|
|
reason: z.string(),
|
|
replay_run_id: z.string().nullish(),
|
|
revision: z.int().gte(1),
|
|
status: z.enum(['dismissed', 'fixed', 'open', 'replaying']),
|
|
tags: z.array(z.string()),
|
|
updated_at: z.iso.datetime(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSBadCaseListResponse
|
|
*/
|
|
export const zKnowledgeFsBadCaseListResponse = z.object({
|
|
data: z.array(zKnowledgeFsBadCaseResponse),
|
|
next_cursor: z.string().nullish(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSBadCaseUpdatePayload
|
|
*/
|
|
export const zKnowledgeFsBadCaseUpdatePayload = z.object({
|
|
expected_revision: z.int().gte(1),
|
|
reason: z.string().min(1).max(4000).nullish(),
|
|
replay_run_id: z.string().nullish(),
|
|
status: z.enum(['dismissed', 'fixed', 'open', 'replaying']),
|
|
tags: z.array(z.string()).max(50).nullish(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSBadCaseTraceReferenceResponse
|
|
*/
|
|
export const zKnowledgeFsBadCaseTraceReferenceResponse = z.object({
|
|
trace_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSQualityReplayPayload
|
|
*/
|
|
export const zKnowledgeFsQualityReplayPayload = z.object({
|
|
golden_question_ids: z.array(z.string()).min(1).max(1000).nullish(),
|
|
mode: z.enum(['deep', 'fast', 'research']).nullish(),
|
|
selection: z.literal('all-active').nullish(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSQueryResponse
|
|
*/
|
|
export const zKnowledgeFsQueryResponse = z.object({
|
|
answer: z.string().nullish(),
|
|
id: z.string(),
|
|
status: z.string(),
|
|
trace_id: z.string().nullish(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSQueryStreamCapabilityResponse
|
|
*/
|
|
export const zKnowledgeFsQueryStreamCapabilityResponse = z.object({
|
|
expires_at: z.iso.datetime(),
|
|
operation_id: z.literal('createQuery'),
|
|
token: z.string(),
|
|
url: z.string(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSProfileMigrationResponse
|
|
*/
|
|
export const zKnowledgeFsProfileMigrationResponse = z.object({
|
|
candidate_publication_fingerprint: z.string().nullish(),
|
|
changed_kind: z.enum(['embedding', 'retrieval']),
|
|
checkpoint: z.enum(['activated', 'candidate-built', 'evaluated', 'queued']),
|
|
completed_at: z.iso.datetime().nullish(),
|
|
created_at: z.iso.datetime(),
|
|
error_code: z.string().nullish(),
|
|
evaluation_summary: z
|
|
.record(z.string(), z.union([z.boolean(), z.number(), z.int(), z.string()]))
|
|
.nullish(),
|
|
id: z.string(),
|
|
knowledge_space_id: z.string(),
|
|
rebuild_scope: z.enum([
|
|
'clone-publication',
|
|
'full-page-index-summary-outline',
|
|
'full-vector-space',
|
|
]),
|
|
run_state: z.enum(['canceled', 'failed', 'queued', 'running', 'succeeded']),
|
|
updated_at: z.iso.datetime(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSSourceConnectionCreatePayload
|
|
*/
|
|
export const zKnowledgeFsSourceConnectionCreatePayload = z.object({
|
|
authKind: z.enum(['api-key', 'endpoint']),
|
|
configuration: z.record(z.string(), z.union([z.boolean(), z.int(), z.string()])).optional(),
|
|
credentials: z.record(z.string(), z.unknown()),
|
|
name: z.string().min(1).max(160),
|
|
providerId: z.string().min(1).max(128),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSSourceConnectionResponse
|
|
*/
|
|
export const zKnowledgeFsSourceConnectionResponse = z.object({
|
|
auth_kind: z.enum(['api-key', 'endpoint', 'oauth2']),
|
|
configuration: z.record(z.string(), z.union([z.boolean(), z.int(), z.string()])),
|
|
created_at: z.iso.datetime(),
|
|
error_code: z.string().nullish(),
|
|
expires_at: z.iso.datetime().nullish(),
|
|
id: z.string(),
|
|
knowledge_space_id: z.string(),
|
|
name: z.string(),
|
|
provider_id: z.string(),
|
|
scopes: z.array(z.string()),
|
|
status: z.enum(['active', 'error', 'expired', 'provisioning', 'revoked']),
|
|
updated_at: z.iso.datetime(),
|
|
version: z.int().gte(1),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSSourceConnectionListResponse
|
|
*/
|
|
export const zKnowledgeFsSourceConnectionListResponse = z.object({
|
|
data: z.array(zKnowledgeFsSourceConnectionResponse),
|
|
next_cursor: z.string().nullish(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSSourceConnectionRefreshPayload
|
|
*/
|
|
export const zKnowledgeFsSourceConnectionRefreshPayload = z.object({
|
|
expectedVersion: z.int().gte(1),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSSourceWorkflowCancelPayload
|
|
*/
|
|
export const zKnowledgeFsSourceWorkflowCancelPayload = z.object({
|
|
reason: z.string().max(1000).nullish(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSCrawlPreviewSelectionPayload
|
|
*/
|
|
export const zKnowledgeFsCrawlPreviewSelectionPayload = z.object({
|
|
pageIds: z.array(z.string()).min(1).max(200),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSSourceCreatePayload
|
|
*/
|
|
export const zKnowledgeFsSourceCreatePayload = z.object({
|
|
connectionId: z.string().nullish(),
|
|
credentials: z.record(z.string(), z.unknown()).nullish(),
|
|
metadata: z.record(z.string(), z.unknown()).optional(),
|
|
name: z.string().min(1).max(200),
|
|
permissionScope: z.array(z.string()).max(1000).optional(),
|
|
status: z.enum(['active', 'disabled', 'error', 'syncing']).nullish(),
|
|
type: z.enum(['connector', 'object-storage', 'upload', 'web']),
|
|
uri: z.string().min(1).max(4096),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSSourceDeletePayload
|
|
*/
|
|
export const zKnowledgeFsSourceDeletePayload = z.object({
|
|
expectedRevision: z.int().gte(1),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSSourceSyncPolicyResponse
|
|
*/
|
|
export const zKnowledgeFsSourceSyncPolicyResponse = z.object({
|
|
created_at: z.iso.datetime(),
|
|
custom_interval_seconds: z.int().nullish(),
|
|
enabled: z.boolean(),
|
|
expected_source_version: z.int().gte(1),
|
|
id: z.string(),
|
|
knowledge_space_id: z.string(),
|
|
mode: z.enum(['custom', 'interval', 'manual']),
|
|
next_run_at: z.iso.datetime().nullish(),
|
|
revision: z.int().gte(1),
|
|
source_id: z.string(),
|
|
updated_at: z.iso.datetime(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSSourceSyncPolicyPayload
|
|
*/
|
|
export const zKnowledgeFsSourceSyncPolicyPayload = z.object({
|
|
customIntervalSeconds: z.int().gte(3600).lte(2592000).nullish(),
|
|
enabled: z.boolean(),
|
|
expectedRevision: z.int().gte(0),
|
|
expectedSourceVersion: z.int().gte(1),
|
|
mode: z.enum(['custom', 'interval', 'manual']),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSSpaceTagsReplacePayload
|
|
*/
|
|
export const zKnowledgeFsSpaceTagsReplacePayload = z.object({
|
|
tag_ids: z.array(z.string()).max(100).optional(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSUploadSessionCreatePayload
|
|
*/
|
|
export const zKnowledgeFsUploadSessionCreatePayload = z.object({
|
|
checksumSha256Base64: z.string().min(1).max(255),
|
|
contentType: z.string().min(1).max(255),
|
|
expectedSizeBytes: z.int().gt(0),
|
|
fileName: z.string().min(1).max(512),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSUploadSessionAbortPayload
|
|
*/
|
|
export const zKnowledgeFsUploadSessionAbortPayload = z.record(z.string(), z.never())
|
|
|
|
/**
|
|
* KnowledgeFSUploadPartPresignPayload
|
|
*/
|
|
export const zKnowledgeFsUploadPartPresignPayload = z.object({
|
|
checksumSha256Base64: z.string().min(1).max(255),
|
|
contentLength: z.int().gt(0),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSPresignedUploadResponse
|
|
*/
|
|
export const zKnowledgeFsPresignedUploadResponse = z.object({
|
|
expires_at: z.int().gte(0),
|
|
headers: z.record(z.string(), z.string()),
|
|
method: z.literal('PUT'),
|
|
url: z.string().min(1).max(8192),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSStreamCapabilityPayload
|
|
*/
|
|
export const zKnowledgeFsStreamCapabilityPayload = z.object({
|
|
control_space_id: z.string().min(1).max(255),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSStreamCapabilityResponse
|
|
*/
|
|
export const zKnowledgeFsStreamCapabilityResponse = z.object({
|
|
expires_at: z.iso.datetime(),
|
|
operation_id: z.literal('streamResearchTask'),
|
|
token: z.string(),
|
|
url: z.string(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSStagedUploadResponse
|
|
*/
|
|
export const zKnowledgeFsStagedUploadResponse = z.object({
|
|
content_type: z.string(),
|
|
expires_at: z.iso.datetime(),
|
|
file_name: z.string(),
|
|
id: z.string(),
|
|
size_bytes: z.int().gt(0),
|
|
status: z.enum(['aborted', 'claimed', 'claiming', 'expired', 'failed', 'uploaded']),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSJWKResponse
|
|
*/
|
|
export const zKnowledgeFsjwkResponse = z.object({
|
|
alg: z.literal('RS256'),
|
|
e: z.string(),
|
|
kid: z.string(),
|
|
kty: z.literal('RSA'),
|
|
n: z.string(),
|
|
use: z.literal('sig'),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSJWKSResponse
|
|
*/
|
|
export const zKnowledgeFsjwksResponse = z.object({
|
|
keys: z.array(zKnowledgeFsjwkResponse),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSQueryImageReference
|
|
*/
|
|
export const zKnowledgeFsQueryImageReference = z.object({
|
|
uploadFileId: z.string().min(1),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSAdmittedQueryRequest
|
|
*/
|
|
export const zKnowledgeFsAdmittedQueryRequest = z.object({
|
|
activeDocumentIds: z.array(z.string()).max(100).optional(),
|
|
activeEntityIds: z.array(z.string()).max(100).optional(),
|
|
knowledgeSpaceId: z.string().min(1),
|
|
mode: z.enum(['auto', 'deep', 'fast', 'research']).nullish(),
|
|
query: z.string().max(16000).nullish(),
|
|
queryImages: z.array(zKnowledgeFsQueryImageReference).max(4).optional(),
|
|
sessionId: z.string().nullish(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSQueryCreatePayload
|
|
*/
|
|
export const zKnowledgeFsQueryCreatePayload = z.object({
|
|
activeDocumentIds: z.array(z.string()).max(100).optional(),
|
|
activeEntityIds: z.array(z.string()).max(100).optional(),
|
|
mode: z.enum(['auto', 'deep', 'fast', 'research']).nullish(),
|
|
query: z.string().max(16000).nullish(),
|
|
queryImages: z.array(zKnowledgeFsQueryImageReference).max(4).optional(),
|
|
sessionId: z.string().nullish(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSQueryAdmissionResponse
|
|
*/
|
|
export const zKnowledgeFsQueryAdmissionResponse = z.object({
|
|
expires_at: z.iso.datetime(),
|
|
operation_id: z.literal('createQuery'),
|
|
request: zKnowledgeFsAdmittedQueryRequest,
|
|
token: z.string(),
|
|
url: z.string(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSResearchTaskPlanPayload
|
|
*/
|
|
export const zKnowledgeFsResearchTaskPlanPayload = z.object({
|
|
budgetUsd: z.number().gte(0).nullish(),
|
|
mode: z.enum(['auto', 'deep', 'fast', 'research']).nullish(),
|
|
query: z.string().max(16000).nullish(),
|
|
queryImages: z.array(zKnowledgeFsQueryImageReference).max(4).optional(),
|
|
topK: z.int().gte(1).lte(50).nullish(),
|
|
})
|
|
|
|
export const zJsonValue = z.unknown()
|
|
|
|
/**
|
|
* KnowledgeFSInitialSourcePreviewPayload
|
|
*/
|
|
export const zKnowledgeFsInitialSourcePreviewPayload = z.object({
|
|
credentialId: z.string().min(1).max(255),
|
|
datasource: z.string().min(1).max(255),
|
|
kind: z.enum(['online_document', 'online_drive']),
|
|
parameters: z.record(z.string(), zJsonValue).optional(),
|
|
pluginId: z.string().min(1).max(255),
|
|
provider: z.string().min(1).max(255),
|
|
providerDisplayName: z.string().min(1).max(255).nullish(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSInitialWebsiteSourcePreviewPayload
|
|
*/
|
|
export const zKnowledgeFsInitialWebsiteSourcePreviewPayload = z.object({
|
|
credentialId: z.string().min(1).max(255),
|
|
datasource: z.string().min(1).max(255),
|
|
kind: z.literal('website_crawl'),
|
|
parameters: z.record(z.string(), zJsonValue).optional(),
|
|
pluginId: z.string().min(1).max(255),
|
|
provider: z.string().min(1).max(255),
|
|
providerDisplayName: z.string().min(1).max(255).nullish(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSInitialSourcePreviewDocumentResponse
|
|
*/
|
|
export const zKnowledgeFsInitialSourcePreviewDocumentResponse = z.object({
|
|
last_edited_time: z.string().nullish(),
|
|
name: z.string(),
|
|
page_id: z.string(),
|
|
provider_item_id: z.string(),
|
|
type: z.string(),
|
|
workspace_id: z.string(),
|
|
workspace_name: z.string().nullish(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSInitialSourcePreviewFileResponse
|
|
*/
|
|
export const zKnowledgeFsInitialSourcePreviewFileResponse = z.object({
|
|
bucket: z.string().nullish(),
|
|
id: z.string(),
|
|
mime_type: z.string().nullish(),
|
|
name: z.string(),
|
|
provider_item_id: z.string(),
|
|
size: z.int().gte(0),
|
|
type: z.string(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSInitialSourcePreviewPageResponse
|
|
*/
|
|
export const zKnowledgeFsInitialSourcePreviewPageResponse = z.object({
|
|
description: z.string().nullish(),
|
|
source_url: z.string(),
|
|
title: z.string().nullish(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSInitialSourcePreviewResponse
|
|
*/
|
|
export const zKnowledgeFsInitialSourcePreviewResponse = z.object({
|
|
configuration_fingerprint: z.string().nullish(),
|
|
documents: z.array(zKnowledgeFsInitialSourcePreviewDocumentResponse).optional(),
|
|
files: z.array(zKnowledgeFsInitialSourcePreviewFileResponse).optional(),
|
|
kind: z.enum(['online_document', 'online_drive', 'website_crawl']),
|
|
next_page_parameters: z.record(z.string(), zJsonValue).nullish(),
|
|
pages: z.array(zKnowledgeFsInitialSourcePreviewPageResponse).optional(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSInitialSourcePreviewJobResponse
|
|
*/
|
|
export const zKnowledgeFsInitialSourcePreviewJobResponse = z.object({
|
|
job_id: z.string(),
|
|
result: zKnowledgeFsInitialSourcePreviewResponse.nullish(),
|
|
status: z.enum(['canceled', 'completed', 'failed', 'pending', 'running']),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSModelIntent
|
|
*/
|
|
export const zKnowledgeFsModelIntent = z.object({
|
|
model: z.string().min(1).max(255),
|
|
plugin_id: z.string().min(1).max(255),
|
|
provider: z.string().min(1).max(255),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSControlSpaceVisibility
|
|
*/
|
|
export const zKnowledgeFsControlSpaceVisibility = z.enum([
|
|
'all_team_members',
|
|
'only_me',
|
|
'partial_members',
|
|
])
|
|
|
|
/**
|
|
* KnowledgeFSSpaceUpdatePayload
|
|
*/
|
|
export const zKnowledgeFsSpaceUpdatePayload = z.object({
|
|
description: z.string().max(2000).nullish(),
|
|
icon: z
|
|
.string()
|
|
.max(72)
|
|
.regex(/^(?:builtin:)?[+a-z0-9_-]{1,64}$/)
|
|
.nullish(),
|
|
icon_background: z
|
|
.string()
|
|
.regex(/^#[0-9A-Fa-f]{6}$/)
|
|
.nullish(),
|
|
name: z.string().min(1).max(40).nullish(),
|
|
visibility: zKnowledgeFsControlSpaceVisibility.nullish(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSControlSpaceState
|
|
*/
|
|
export const zKnowledgeFsControlSpaceState = z.enum([
|
|
'active',
|
|
'deleted',
|
|
'deleting',
|
|
'error',
|
|
'provisioning',
|
|
])
|
|
|
|
/**
|
|
* KnowledgeFSSpaceCreateResponse
|
|
*/
|
|
export const zKnowledgeFsSpaceCreateResponse = z.object({
|
|
control_space_id: z.string(),
|
|
model_setup_required: z.boolean(),
|
|
operation_id: z.string(),
|
|
state: zKnowledgeFsControlSpaceState,
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSProductPermission
|
|
*/
|
|
export const zKnowledgeFsProductPermission = z.enum([
|
|
'knowledge_space_access_config',
|
|
'knowledge_space_create',
|
|
'knowledge_space_delete',
|
|
'knowledge_space_document_write',
|
|
'knowledge_space_edit',
|
|
'knowledge_space_query',
|
|
'knowledge_space_read',
|
|
])
|
|
|
|
/**
|
|
* KnowledgeFSTechnicalSummary
|
|
*/
|
|
export const zKnowledgeFsTechnicalSummary = z.object({
|
|
description: z.string().nullish(),
|
|
document_count: z.int().gte(0).optional().default(0),
|
|
icon: z.string().nullish(),
|
|
icon_background: z
|
|
.string()
|
|
.regex(/^#[0-9A-Fa-f]{6}$/)
|
|
.nullish(),
|
|
index_state: z.string().nullish(),
|
|
knowledge_space_id: z.string(),
|
|
last_job_state: z.string().nullish(),
|
|
model_profile: z.record(z.string(), z.unknown()).nullish(),
|
|
name: z.string(),
|
|
revision: z.int().gte(0),
|
|
slug: z.string(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSSpaceDetailResponse
|
|
*/
|
|
export const zKnowledgeFsSpaceDetailResponse = z.object({
|
|
control_space_id: z.string(),
|
|
created_at: z.iso.datetime(),
|
|
knowledge_space_id: z.string().nullable(),
|
|
owner_account_id: z.string(),
|
|
permission_keys: z.array(zKnowledgeFsProductPermission),
|
|
resource_version: z.int(),
|
|
state: zKnowledgeFsControlSpaceState,
|
|
technical_status: z.enum(['available', 'not_ready', 'unavailable']),
|
|
technical_summary: zKnowledgeFsTechnicalSummary.nullish(),
|
|
updated_at: z.iso.datetime(),
|
|
visibility: zKnowledgeFsControlSpaceVisibility,
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSAppSpaceJoinType
|
|
*/
|
|
export const zKnowledgeFsAppSpaceJoinType = z.enum(['agent', 'workflow'])
|
|
|
|
/**
|
|
* KnowledgeFSAppBindingPayload
|
|
*/
|
|
export const zKnowledgeFsAppBindingPayload = z.object({
|
|
app_id: z.string().min(1),
|
|
caller_kind: zKnowledgeFsAppSpaceJoinType,
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSAppSpaceJoinStatus
|
|
*/
|
|
export const zKnowledgeFsAppSpaceJoinStatus = z.enum(['active', 'revoked'])
|
|
|
|
/**
|
|
* KnowledgeFSAppBindingResponse
|
|
*/
|
|
export const zKnowledgeFsAppBindingResponse = z.object({
|
|
app_id: z.string(),
|
|
caller_kind: zKnowledgeFsAppSpaceJoinType,
|
|
id: z.string(),
|
|
revision: z.int(),
|
|
status: zKnowledgeFsAppSpaceJoinStatus,
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSAppBindingListResponse
|
|
*/
|
|
export const zKnowledgeFsAppBindingListResponse = z.object({
|
|
data: z.array(zKnowledgeFsAppBindingResponse),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSPublicFailureResponse
|
|
*/
|
|
export const zKnowledgeFsPublicFailureResponse = z.object({
|
|
action: z
|
|
.enum([
|
|
'configure_model',
|
|
'configure_parser',
|
|
'configure_source',
|
|
'contact_admin',
|
|
'retry',
|
|
'reupload',
|
|
])
|
|
.nullish(),
|
|
category: z.enum([
|
|
'authorization',
|
|
'canceled',
|
|
'configuration',
|
|
'conflict',
|
|
'dependency',
|
|
'internal',
|
|
'not_found',
|
|
'rate_limit',
|
|
'timeout',
|
|
'validation',
|
|
]),
|
|
code: z.enum([
|
|
'DOCUMENT_COMPILATION_FAILED',
|
|
'DOCUMENT_COMPILATION_LEASE_LOST',
|
|
'DOCUMENT_COMPILATION_RETRYABLE',
|
|
'DOCUMENT_DISABLED',
|
|
'DOCUMENT_PARSER_INPUT_INVALID',
|
|
'DOCUMENT_PARSER_NOT_CONFIGURED',
|
|
'DOCUMENT_PARSER_RATE_LIMITED',
|
|
'DOCUMENT_PARSER_RESPONSE_INVALID',
|
|
'DOCUMENT_PARSER_TIMEOUT',
|
|
'DOCUMENT_PARSER_UNAVAILABLE',
|
|
'DOCUMENT_PARSER_UNSUPPORTED_TYPE',
|
|
'DOCUMENT_PDF_RENDER_FAILED',
|
|
'EMBEDDING_DIMENSION_INVALID',
|
|
'EMBEDDING_DIMENSION_UNSUPPORTED',
|
|
'EXECUTION_ATTEMPTS_EXHAUSTED',
|
|
'KNOWLEDGE_FS_ACCESS_DENIED',
|
|
'KNOWLEDGE_FS_CONFLICT',
|
|
'KNOWLEDGE_FS_INTERNAL_ERROR',
|
|
'KNOWLEDGE_FS_INVALID_REQUEST',
|
|
'KNOWLEDGE_FS_NOT_FOUND',
|
|
'KNOWLEDGE_FS_RATE_LIMITED',
|
|
'KNOWLEDGE_FS_TIMEOUT',
|
|
'KNOWLEDGE_FS_UNAVAILABLE',
|
|
'KNOWLEDGE_SPACE_MANIFEST_NOT_FOUND',
|
|
'KNOWLEDGE_SPACE_MODEL_CONFIGURATION_REQUIRED',
|
|
'MODEL_CAPABILITY_MISMATCH',
|
|
'MODEL_CONFIGURATION_STALE',
|
|
'MODEL_CREDENTIAL_INVALID',
|
|
'MODEL_CREDENTIAL_VALIDATION_UNAVAILABLE',
|
|
'MODEL_IDENTITY_MISMATCH',
|
|
'MODEL_PREFLIGHT_CANCELED',
|
|
'MODEL_PREFLIGHT_FAILED',
|
|
'MODEL_PREFLIGHT_TIMEOUT',
|
|
'MODEL_PREFLIGHT_UNAVAILABLE',
|
|
'MODEL_PROFILE_ACTIVATION_INCOMPLETE',
|
|
'MODEL_PROFILE_ACTIVATION_PERMISSION_REQUIRED',
|
|
'MODEL_RUNTIME_FAILED',
|
|
'MODEL_RUNTIME_RESPONSE_INVALID',
|
|
'MODEL_RUNTIME_TIMEOUT',
|
|
'MODEL_RUNTIME_UNAVAILABLE',
|
|
'MODEL_SELECTION_NOT_FOUND',
|
|
'RESEARCH_TASK_CAPABILITY_REVOKED',
|
|
'RESEARCH_TASK_DISPATCH_DEAD',
|
|
'RESEARCH_TASK_EXECUTION_ATTEMPTS_EXHAUSTED',
|
|
'RESEARCH_TASK_FAILED',
|
|
'RESEARCH_TASK_PERMISSION_SNAPSHOT_INVALID',
|
|
'RESEARCH_TASK_RUNTIME_SNAPSHOT_INVALID',
|
|
'RETRIEVAL_DELETION_IN_PROGRESS',
|
|
'RETRIEVAL_EXECUTION_LEASE_LOST',
|
|
'SOURCE_BULK_ACTION_FAILED',
|
|
'SOURCE_CONNECTION_UNAVAILABLE',
|
|
'SOURCE_CRAWL_PAGE_NOT_FOUND',
|
|
'SOURCE_CRAWL_PROVIDER_UNAVAILABLE',
|
|
'SOURCE_CRAWL_RESULT_LIMIT_EXCEEDED',
|
|
'SOURCE_CREDENTIAL_CONFIG_INVALID',
|
|
'SOURCE_CREDENTIAL_MUTATION_FAILED',
|
|
'SOURCE_CREDENTIAL_TEST_FAILED',
|
|
'SOURCE_CREDENTIAL_UNAVAILABLE',
|
|
'SOURCE_DOCUMENT_COMPILATION_FAILED',
|
|
'SOURCE_DOCUMENT_MATERIALIZATION_FAILED',
|
|
'SOURCE_DOCUMENT_REPLACEMENT_SAGA_REQUIRED',
|
|
'SOURCE_IMPORT_PARTIAL_FAILURE',
|
|
'SOURCE_ONLINE_DOCUMENT_CONFIG_INVALID',
|
|
'SOURCE_ONLINE_DOCUMENT_IMPORT_FAILED',
|
|
'SOURCE_ONLINE_DOCUMENT_PAGE_FETCH_FAILED',
|
|
'SOURCE_ONLINE_DOCUMENT_REQUEST_FAILED',
|
|
'SOURCE_ONLINE_DOCUMENT_UNAVAILABLE',
|
|
'SOURCE_ONLINE_DRIVE_CONFIG_INVALID',
|
|
'SOURCE_ONLINE_DRIVE_FILE_DOWNLOAD_FAILED',
|
|
'SOURCE_ONLINE_DRIVE_IMPORT_FAILED',
|
|
'SOURCE_ONLINE_DRIVE_REQUEST_FAILED',
|
|
'SOURCE_ONLINE_DRIVE_UNAVAILABLE',
|
|
'SOURCE_OPERATION_FAILED',
|
|
'SOURCE_PROVIDER_REJECTED',
|
|
'SOURCE_PROVIDER_TIMEOUT',
|
|
'SOURCE_PROVIDER_UNAVAILABLE',
|
|
'SOURCE_SECRET_INTEGRITY_FAILED',
|
|
'SOURCE_SECRET_REF_CONFLICT',
|
|
'SOURCE_SYNC_FAILED',
|
|
'SOURCE_SYNC_SELECTION_MISMATCH',
|
|
'SOURCE_WEBSITE_CRAWL_CONFIG_INVALID',
|
|
'SOURCE_WEBSITE_CRAWL_FAILED',
|
|
'SOURCE_WORKFLOW_CONTENT_MISSING',
|
|
'SOURCE_WORKFLOW_CONTENT_TOO_LARGE',
|
|
'SOURCE_WORKFLOW_EXTERNAL_TIMEOUT',
|
|
'SOURCE_WORKFLOW_FAILED',
|
|
'UPLOAD_INITIALIZATION_FAILED',
|
|
'UPLOAD_INTEGRITY_MISMATCH',
|
|
]),
|
|
message: z.string().min(1).max(1024),
|
|
parameters: z
|
|
.record(z.string(), z.union([z.string(), z.int(), z.number(), z.boolean()]))
|
|
.nullish(),
|
|
retryPolicy: z.enum(['after_configuration', 'automatic', 'manual', 'never']),
|
|
stage: z
|
|
.string()
|
|
.min(1)
|
|
.max(128)
|
|
.regex(/^[a-z][a-z0-9_.-]{0,127}$/)
|
|
.nullish(),
|
|
traceId: z
|
|
.string()
|
|
.min(1)
|
|
.max(128)
|
|
.regex(/^[A-Za-z0-9._:-]{1,128}$/)
|
|
.nullish(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSSourceWorkflowResponse
|
|
*/
|
|
export const zKnowledgeFsSourceWorkflowResponse = z.object({
|
|
canceled_at: z.iso.datetime().nullish(),
|
|
checkpoint: z.string(),
|
|
completed_at: z.iso.datetime().nullish(),
|
|
created_at: z.iso.datetime(),
|
|
cursor: z.string().nullish(),
|
|
execution_attempts: z.int().gte(0),
|
|
failure: zKnowledgeFsPublicFailureResponse.nullish(),
|
|
id: z.string(),
|
|
kind: z.string(),
|
|
knowledge_space_id: z.string(),
|
|
last_error_code: z
|
|
.enum([
|
|
'DOCUMENT_COMPILATION_FAILED',
|
|
'DOCUMENT_COMPILATION_LEASE_LOST',
|
|
'DOCUMENT_COMPILATION_RETRYABLE',
|
|
'DOCUMENT_DISABLED',
|
|
'DOCUMENT_PARSER_INPUT_INVALID',
|
|
'DOCUMENT_PARSER_NOT_CONFIGURED',
|
|
'DOCUMENT_PARSER_RATE_LIMITED',
|
|
'DOCUMENT_PARSER_RESPONSE_INVALID',
|
|
'DOCUMENT_PARSER_TIMEOUT',
|
|
'DOCUMENT_PARSER_UNAVAILABLE',
|
|
'DOCUMENT_PARSER_UNSUPPORTED_TYPE',
|
|
'DOCUMENT_PDF_RENDER_FAILED',
|
|
'EMBEDDING_DIMENSION_INVALID',
|
|
'EMBEDDING_DIMENSION_UNSUPPORTED',
|
|
'EXECUTION_ATTEMPTS_EXHAUSTED',
|
|
'KNOWLEDGE_FS_ACCESS_DENIED',
|
|
'KNOWLEDGE_FS_CONFLICT',
|
|
'KNOWLEDGE_FS_INTERNAL_ERROR',
|
|
'KNOWLEDGE_FS_INVALID_REQUEST',
|
|
'KNOWLEDGE_FS_NOT_FOUND',
|
|
'KNOWLEDGE_FS_RATE_LIMITED',
|
|
'KNOWLEDGE_FS_TIMEOUT',
|
|
'KNOWLEDGE_FS_UNAVAILABLE',
|
|
'KNOWLEDGE_SPACE_MANIFEST_NOT_FOUND',
|
|
'KNOWLEDGE_SPACE_MODEL_CONFIGURATION_REQUIRED',
|
|
'MODEL_CAPABILITY_MISMATCH',
|
|
'MODEL_CONFIGURATION_STALE',
|
|
'MODEL_CREDENTIAL_INVALID',
|
|
'MODEL_CREDENTIAL_VALIDATION_UNAVAILABLE',
|
|
'MODEL_IDENTITY_MISMATCH',
|
|
'MODEL_PREFLIGHT_CANCELED',
|
|
'MODEL_PREFLIGHT_FAILED',
|
|
'MODEL_PREFLIGHT_TIMEOUT',
|
|
'MODEL_PREFLIGHT_UNAVAILABLE',
|
|
'MODEL_PROFILE_ACTIVATION_INCOMPLETE',
|
|
'MODEL_PROFILE_ACTIVATION_PERMISSION_REQUIRED',
|
|
'MODEL_RUNTIME_FAILED',
|
|
'MODEL_RUNTIME_RESPONSE_INVALID',
|
|
'MODEL_RUNTIME_TIMEOUT',
|
|
'MODEL_RUNTIME_UNAVAILABLE',
|
|
'MODEL_SELECTION_NOT_FOUND',
|
|
'RESEARCH_TASK_CAPABILITY_REVOKED',
|
|
'RESEARCH_TASK_DISPATCH_DEAD',
|
|
'RESEARCH_TASK_EXECUTION_ATTEMPTS_EXHAUSTED',
|
|
'RESEARCH_TASK_FAILED',
|
|
'RESEARCH_TASK_PERMISSION_SNAPSHOT_INVALID',
|
|
'RESEARCH_TASK_RUNTIME_SNAPSHOT_INVALID',
|
|
'RETRIEVAL_DELETION_IN_PROGRESS',
|
|
'RETRIEVAL_EXECUTION_LEASE_LOST',
|
|
'SOURCE_BULK_ACTION_FAILED',
|
|
'SOURCE_CONNECTION_UNAVAILABLE',
|
|
'SOURCE_CRAWL_PAGE_NOT_FOUND',
|
|
'SOURCE_CRAWL_PROVIDER_UNAVAILABLE',
|
|
'SOURCE_CRAWL_RESULT_LIMIT_EXCEEDED',
|
|
'SOURCE_CREDENTIAL_CONFIG_INVALID',
|
|
'SOURCE_CREDENTIAL_MUTATION_FAILED',
|
|
'SOURCE_CREDENTIAL_TEST_FAILED',
|
|
'SOURCE_CREDENTIAL_UNAVAILABLE',
|
|
'SOURCE_DOCUMENT_COMPILATION_FAILED',
|
|
'SOURCE_DOCUMENT_MATERIALIZATION_FAILED',
|
|
'SOURCE_DOCUMENT_REPLACEMENT_SAGA_REQUIRED',
|
|
'SOURCE_IMPORT_PARTIAL_FAILURE',
|
|
'SOURCE_ONLINE_DOCUMENT_CONFIG_INVALID',
|
|
'SOURCE_ONLINE_DOCUMENT_IMPORT_FAILED',
|
|
'SOURCE_ONLINE_DOCUMENT_PAGE_FETCH_FAILED',
|
|
'SOURCE_ONLINE_DOCUMENT_REQUEST_FAILED',
|
|
'SOURCE_ONLINE_DOCUMENT_UNAVAILABLE',
|
|
'SOURCE_ONLINE_DRIVE_CONFIG_INVALID',
|
|
'SOURCE_ONLINE_DRIVE_FILE_DOWNLOAD_FAILED',
|
|
'SOURCE_ONLINE_DRIVE_IMPORT_FAILED',
|
|
'SOURCE_ONLINE_DRIVE_REQUEST_FAILED',
|
|
'SOURCE_ONLINE_DRIVE_UNAVAILABLE',
|
|
'SOURCE_OPERATION_FAILED',
|
|
'SOURCE_PROVIDER_REJECTED',
|
|
'SOURCE_PROVIDER_TIMEOUT',
|
|
'SOURCE_PROVIDER_UNAVAILABLE',
|
|
'SOURCE_SECRET_INTEGRITY_FAILED',
|
|
'SOURCE_SECRET_REF_CONFLICT',
|
|
'SOURCE_SYNC_FAILED',
|
|
'SOURCE_SYNC_SELECTION_MISMATCH',
|
|
'SOURCE_WEBSITE_CRAWL_CONFIG_INVALID',
|
|
'SOURCE_WEBSITE_CRAWL_FAILED',
|
|
'SOURCE_WORKFLOW_CONTENT_MISSING',
|
|
'SOURCE_WORKFLOW_CONTENT_TOO_LARGE',
|
|
'SOURCE_WORKFLOW_EXTERNAL_TIMEOUT',
|
|
'SOURCE_WORKFLOW_FAILED',
|
|
'UPLOAD_INITIALIZATION_FAILED',
|
|
'UPLOAD_INTEGRITY_MISMATCH',
|
|
])
|
|
.nullish(),
|
|
max_execution_attempts: z.int().gte(1),
|
|
progress_completed: z.int().gte(0),
|
|
progress_failed: z.int().gte(0),
|
|
progress_skipped: z.int().gte(0),
|
|
progress_total: z.int().gte(0).nullish(),
|
|
source_id: z.string().nullish(),
|
|
state: z.string(),
|
|
updated_at: z.iso.datetime(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSSourceResponse
|
|
*/
|
|
export const zKnowledgeFsSourceResponse = z.object({
|
|
connection_id: z.string().nullish(),
|
|
created_at: z.iso.datetime(),
|
|
credential_configured: z.boolean().nullish(),
|
|
id: z.string(),
|
|
knowledge_space_id: z.string(),
|
|
last_synced_at: z.iso.datetime().nullish(),
|
|
metadata: z.record(z.string(), z.unknown()),
|
|
name: z.string(),
|
|
permission_scope: z.array(z.string()),
|
|
status: z.enum(['active', 'disabled', 'error', 'syncing']),
|
|
sync_policy: zKnowledgeFsSourceSyncPolicyResponse.nullish(),
|
|
sync_workflow: zKnowledgeFsSourceWorkflowResponse.nullish(),
|
|
type: z.enum(['connector', 'object-storage', 'upload', 'web']),
|
|
updated_at: z.iso.datetime(),
|
|
uri: z.string(),
|
|
version: z.int().gte(1),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSSourceListResponse
|
|
*/
|
|
export const zKnowledgeFsSourceListResponse = z.object({
|
|
data: z.array(zKnowledgeFsSourceResponse),
|
|
next_cursor: z.string().nullish(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSSourceCredentialTestResponse
|
|
*/
|
|
export const zKnowledgeFsSourceCredentialTestResponse = z.object({
|
|
code: z
|
|
.enum([
|
|
'DOCUMENT_COMPILATION_FAILED',
|
|
'DOCUMENT_COMPILATION_LEASE_LOST',
|
|
'DOCUMENT_COMPILATION_RETRYABLE',
|
|
'DOCUMENT_DISABLED',
|
|
'DOCUMENT_PARSER_INPUT_INVALID',
|
|
'DOCUMENT_PARSER_NOT_CONFIGURED',
|
|
'DOCUMENT_PARSER_RATE_LIMITED',
|
|
'DOCUMENT_PARSER_RESPONSE_INVALID',
|
|
'DOCUMENT_PARSER_TIMEOUT',
|
|
'DOCUMENT_PARSER_UNAVAILABLE',
|
|
'DOCUMENT_PARSER_UNSUPPORTED_TYPE',
|
|
'DOCUMENT_PDF_RENDER_FAILED',
|
|
'EMBEDDING_DIMENSION_INVALID',
|
|
'EMBEDDING_DIMENSION_UNSUPPORTED',
|
|
'EXECUTION_ATTEMPTS_EXHAUSTED',
|
|
'KNOWLEDGE_FS_ACCESS_DENIED',
|
|
'KNOWLEDGE_FS_CONFLICT',
|
|
'KNOWLEDGE_FS_INTERNAL_ERROR',
|
|
'KNOWLEDGE_FS_INVALID_REQUEST',
|
|
'KNOWLEDGE_FS_NOT_FOUND',
|
|
'KNOWLEDGE_FS_RATE_LIMITED',
|
|
'KNOWLEDGE_FS_TIMEOUT',
|
|
'KNOWLEDGE_FS_UNAVAILABLE',
|
|
'KNOWLEDGE_SPACE_MANIFEST_NOT_FOUND',
|
|
'KNOWLEDGE_SPACE_MODEL_CONFIGURATION_REQUIRED',
|
|
'MODEL_CAPABILITY_MISMATCH',
|
|
'MODEL_CONFIGURATION_STALE',
|
|
'MODEL_CREDENTIAL_INVALID',
|
|
'MODEL_CREDENTIAL_VALIDATION_UNAVAILABLE',
|
|
'MODEL_IDENTITY_MISMATCH',
|
|
'MODEL_PREFLIGHT_CANCELED',
|
|
'MODEL_PREFLIGHT_FAILED',
|
|
'MODEL_PREFLIGHT_TIMEOUT',
|
|
'MODEL_PREFLIGHT_UNAVAILABLE',
|
|
'MODEL_PROFILE_ACTIVATION_INCOMPLETE',
|
|
'MODEL_PROFILE_ACTIVATION_PERMISSION_REQUIRED',
|
|
'MODEL_RUNTIME_FAILED',
|
|
'MODEL_RUNTIME_RESPONSE_INVALID',
|
|
'MODEL_RUNTIME_TIMEOUT',
|
|
'MODEL_RUNTIME_UNAVAILABLE',
|
|
'MODEL_SELECTION_NOT_FOUND',
|
|
'RESEARCH_TASK_CAPABILITY_REVOKED',
|
|
'RESEARCH_TASK_DISPATCH_DEAD',
|
|
'RESEARCH_TASK_EXECUTION_ATTEMPTS_EXHAUSTED',
|
|
'RESEARCH_TASK_FAILED',
|
|
'RESEARCH_TASK_PERMISSION_SNAPSHOT_INVALID',
|
|
'RESEARCH_TASK_RUNTIME_SNAPSHOT_INVALID',
|
|
'RETRIEVAL_DELETION_IN_PROGRESS',
|
|
'RETRIEVAL_EXECUTION_LEASE_LOST',
|
|
'SOURCE_BULK_ACTION_FAILED',
|
|
'SOURCE_CONNECTION_UNAVAILABLE',
|
|
'SOURCE_CRAWL_PAGE_NOT_FOUND',
|
|
'SOURCE_CRAWL_PROVIDER_UNAVAILABLE',
|
|
'SOURCE_CRAWL_RESULT_LIMIT_EXCEEDED',
|
|
'SOURCE_CREDENTIAL_CONFIG_INVALID',
|
|
'SOURCE_CREDENTIAL_MUTATION_FAILED',
|
|
'SOURCE_CREDENTIAL_TEST_FAILED',
|
|
'SOURCE_CREDENTIAL_UNAVAILABLE',
|
|
'SOURCE_DOCUMENT_COMPILATION_FAILED',
|
|
'SOURCE_DOCUMENT_MATERIALIZATION_FAILED',
|
|
'SOURCE_DOCUMENT_REPLACEMENT_SAGA_REQUIRED',
|
|
'SOURCE_IMPORT_PARTIAL_FAILURE',
|
|
'SOURCE_ONLINE_DOCUMENT_CONFIG_INVALID',
|
|
'SOURCE_ONLINE_DOCUMENT_IMPORT_FAILED',
|
|
'SOURCE_ONLINE_DOCUMENT_PAGE_FETCH_FAILED',
|
|
'SOURCE_ONLINE_DOCUMENT_REQUEST_FAILED',
|
|
'SOURCE_ONLINE_DOCUMENT_UNAVAILABLE',
|
|
'SOURCE_ONLINE_DRIVE_CONFIG_INVALID',
|
|
'SOURCE_ONLINE_DRIVE_FILE_DOWNLOAD_FAILED',
|
|
'SOURCE_ONLINE_DRIVE_IMPORT_FAILED',
|
|
'SOURCE_ONLINE_DRIVE_REQUEST_FAILED',
|
|
'SOURCE_ONLINE_DRIVE_UNAVAILABLE',
|
|
'SOURCE_OPERATION_FAILED',
|
|
'SOURCE_PROVIDER_REJECTED',
|
|
'SOURCE_PROVIDER_TIMEOUT',
|
|
'SOURCE_PROVIDER_UNAVAILABLE',
|
|
'SOURCE_SECRET_INTEGRITY_FAILED',
|
|
'SOURCE_SECRET_REF_CONFLICT',
|
|
'SOURCE_SYNC_FAILED',
|
|
'SOURCE_SYNC_SELECTION_MISMATCH',
|
|
'SOURCE_WEBSITE_CRAWL_CONFIG_INVALID',
|
|
'SOURCE_WEBSITE_CRAWL_FAILED',
|
|
'SOURCE_WORKFLOW_CONTENT_MISSING',
|
|
'SOURCE_WORKFLOW_CONTENT_TOO_LARGE',
|
|
'SOURCE_WORKFLOW_EXTERNAL_TIMEOUT',
|
|
'SOURCE_WORKFLOW_FAILED',
|
|
'UPLOAD_INITIALIZATION_FAILED',
|
|
'UPLOAD_INTEGRITY_MISMATCH',
|
|
])
|
|
.nullish(),
|
|
error: z.string().nullish(),
|
|
failure: zKnowledgeFsPublicFailureResponse.nullish(),
|
|
valid: z.boolean(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSBackgroundTaskFailureResponse
|
|
*/
|
|
export const zKnowledgeFsBackgroundTaskFailureResponse = z.object({
|
|
document_id: z.string(),
|
|
document_title: z.string().nullish(),
|
|
error_code: z.string(),
|
|
error_message: z.string(),
|
|
failure: zKnowledgeFsPublicFailureResponse,
|
|
job_id: z.string().nullish(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSBackgroundTaskResponse
|
|
*/
|
|
export const zKnowledgeFsBackgroundTaskResponse = z.object({
|
|
can_cancel: z.boolean(),
|
|
can_retry: z.boolean(),
|
|
completed_at: z.iso.datetime().nullish(),
|
|
created_at: z.iso.datetime(),
|
|
document_id: z.string().nullish(),
|
|
document_revision: z.int().gte(1).nullish(),
|
|
document_title: z.string().nullish(),
|
|
error_code: z.string().nullish(),
|
|
error_message: z.string().nullish(),
|
|
failure: zKnowledgeFsPublicFailureResponse.nullish(),
|
|
failures: z.array(zKnowledgeFsBackgroundTaskFailureResponse).nullish(),
|
|
id: z.string(),
|
|
knowledge_space_id: z.string(),
|
|
operation: z.enum([
|
|
'document_delete',
|
|
'document_processing',
|
|
'document_reindex',
|
|
'document_upload',
|
|
'source_bulk',
|
|
'source_crawl_import',
|
|
'source_crawl_preview',
|
|
'source_online_document_import',
|
|
'source_online_drive_import',
|
|
'source_sync',
|
|
]),
|
|
progress_completed: z.int().gte(0),
|
|
progress_failed: z.int().gte(0),
|
|
progress_percent: z.int().gte(0).lte(100),
|
|
progress_total: z.int().gte(0),
|
|
source_id: z.string().nullish(),
|
|
source_title: z.string().nullish(),
|
|
state: z.enum(['canceled', 'completed', 'failed', 'queued', 'running']),
|
|
task_kind: z.enum(['document', 'document_bulk', 'source']),
|
|
updated_at: z.iso.datetime(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSBackgroundTaskListResponse
|
|
*/
|
|
export const zKnowledgeFsBackgroundTaskListResponse = z.object({
|
|
data: z.array(zKnowledgeFsBackgroundTaskResponse),
|
|
next_cursor: z.string().nullish(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSBulkDocumentDeleteItemPayload
|
|
*/
|
|
export const zKnowledgeFsBulkDocumentDeleteItemPayload = z.object({
|
|
documentId: z.string().min(1),
|
|
expectedRevision: z.int().gte(1),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSBulkDocumentDeletePayload
|
|
*/
|
|
export const zKnowledgeFsBulkDocumentDeletePayload = z.object({
|
|
documents: z.array(zKnowledgeFsBulkDocumentDeleteItemPayload).min(1).max(1000),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSDocumentReindexItemResponse
|
|
*/
|
|
export const zKnowledgeFsDocumentReindexItemResponse = z.object({
|
|
asset: zKnowledgeFsDocumentResponse.nullish(),
|
|
compilation_job: z.record(z.string(), z.unknown()).nullish(),
|
|
document_id: z.string().nullish(),
|
|
status: z.enum(['disabled', 'not_found', 'queued']),
|
|
status_url: z.string().nullish(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSDocumentReindexResponse
|
|
*/
|
|
export const zKnowledgeFsDocumentReindexResponse = z.object({
|
|
bulk_job_id: z.string(),
|
|
items: z.array(zKnowledgeFsDocumentReindexItemResponse),
|
|
total: z.int().gte(0),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSDocumentRevisionResponse
|
|
*/
|
|
export const zKnowledgeFsDocumentRevisionResponse = z.object({
|
|
activated_at: z.iso.datetime().nullish(),
|
|
content_hash: z.string(),
|
|
created_at: z.iso.datetime(),
|
|
document_asset_id: z.string(),
|
|
document_asset_version: z.int().gte(1),
|
|
document_id: z.string(),
|
|
knowledge_space_id: z.string(),
|
|
mime_type: z.string(),
|
|
revision: z.int().gte(1),
|
|
size_bytes: z.int().gte(0),
|
|
state: z.enum(['active', 'candidate', 'failed', 'superseded']),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSLogicalDocumentResponse
|
|
*/
|
|
export const zKnowledgeFsLogicalDocumentResponse = z.object({
|
|
active: zKnowledgeFsDocumentRevisionResponse.nullable(),
|
|
active_revision: z.int().gte(1).nullish(),
|
|
created_at: z.iso.datetime(),
|
|
disabled_at: z.iso.datetime().nullish(),
|
|
disabled_by_subject_id: z.string().nullish(),
|
|
enabled: z.boolean().optional().default(true),
|
|
id: z.string(),
|
|
knowledge_space_id: z.string(),
|
|
provider_item_id: z.string().nullish(),
|
|
row_version: z.int().gte(0),
|
|
source_id: z.string().nullish(),
|
|
status: z.enum(['deleting', 'failed', 'pending', 'ready']),
|
|
title: z.string(),
|
|
updated_at: z.iso.datetime(),
|
|
user_metadata: z.record(z.string(), z.unknown()),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSDocumentRevisionListResponse
|
|
*/
|
|
export const zKnowledgeFsDocumentRevisionListResponse = z.object({
|
|
data: z.array(zKnowledgeFsDocumentRevisionResponse),
|
|
next_cursor: z.string().nullish(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSLogicalDocumentListResponse
|
|
*/
|
|
export const zKnowledgeFsLogicalDocumentListResponse = z.object({
|
|
data: z.array(zKnowledgeFsLogicalDocumentResponse),
|
|
next_cursor: z.string().nullish(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSDocumentMultimodalItemResponse
|
|
*/
|
|
export const zKnowledgeFsDocumentMultimodalItemResponse = z.object({
|
|
asset_url: z.string().nullish(),
|
|
caption: z.string().nullish(),
|
|
end_offset: z.int().gte(0).nullish(),
|
|
id: z.string(),
|
|
modality: z.enum(['code', 'image', 'page', 'table']),
|
|
ocr_text: z.string().nullish(),
|
|
page_number: z.int().gte(1).nullish(),
|
|
parse_element_id: z.string().min(1).max(512),
|
|
section_path: z.array(z.string()).optional(),
|
|
start_offset: z.int().gte(0).nullish(),
|
|
text_preview: z.string().nullish(),
|
|
thumbnail_url: z.string().nullish(),
|
|
title: z.string().nullish(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSDocumentMultimodalManifestResponse
|
|
*/
|
|
export const zKnowledgeFsDocumentMultimodalManifestResponse = z.object({
|
|
artifact_hash: z.string(),
|
|
created_at: z.iso.datetime(),
|
|
document_asset_id: z.string(),
|
|
id: z.string(),
|
|
items: z.array(zKnowledgeFsDocumentMultimodalItemResponse),
|
|
manifest_version: z.string(),
|
|
updated_at: z.iso.datetime().nullish(),
|
|
version: z.int().gte(1),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSDocumentOutlineNodeResponse
|
|
*/
|
|
export const zKnowledgeFsDocumentOutlineNodeResponse = z.object({
|
|
child_node_ids: z.array(z.string()).optional(),
|
|
children: z.array(z.lazy((): any => zKnowledgeFsDocumentOutlineNodeResponse)).optional(),
|
|
end_offset: z.int().gte(0).nullish(),
|
|
end_page: z.int().gte(1).nullish(),
|
|
id: z.string(),
|
|
level: z.int().gte(1),
|
|
metadata: z.record(z.string(), z.unknown()),
|
|
section_path: z.array(z.string()).optional(),
|
|
source_element_ids: z.array(z.string()).optional(),
|
|
source_node_ids: z.array(z.string()).optional(),
|
|
start_offset: z.int().gte(0).nullish(),
|
|
start_page: z.int().gte(1).nullish(),
|
|
summary: z.string().nullish(),
|
|
title: z.string(),
|
|
title_location: z.record(z.string(), z.unknown()).nullish(),
|
|
toc_source: z.string(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSDocumentOutlineResponse
|
|
*/
|
|
export const zKnowledgeFsDocumentOutlineResponse = z.object({
|
|
artifact_hash: z.string(),
|
|
created_at: z.iso.datetime(),
|
|
document_asset_id: z.string(),
|
|
id: z.string(),
|
|
knowledge_space_id: z.string(),
|
|
metadata: z.record(z.string(), z.unknown()),
|
|
nodes: z.array(zKnowledgeFsDocumentOutlineNodeResponse),
|
|
outline_version: z.string(),
|
|
parse_artifact_id: z.string(),
|
|
updated_at: z.iso.datetime().nullish(),
|
|
version: z.int().gte(1),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSGoldenQuestionBulkImportRowPayload
|
|
*/
|
|
export const zKnowledgeFsGoldenQuestionBulkImportRowPayload = z.object({
|
|
evidence: z.string().min(1).max(8000),
|
|
question: z.string().min(1).max(4000),
|
|
tags: z.array(z.string()).max(50).optional(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSGoldenQuestionBulkImportPayload
|
|
*/
|
|
export const zKnowledgeFsGoldenQuestionBulkImportPayload = z.object({
|
|
match_policy: z.enum(['all', 'any']).optional().default('all'),
|
|
minimum_similarity: z.number().gte(0).lte(1).optional().default(0.7),
|
|
rows: z.array(zKnowledgeFsGoldenQuestionBulkImportRowPayload).min(1).max(500),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSGoldenQuestionBulkImportItemResponse
|
|
*/
|
|
export const zKnowledgeFsGoldenQuestionBulkImportItemResponse = z.object({
|
|
expected_evidence_id: z.string().nullish(),
|
|
question_id: z.string(),
|
|
row_index: z.int().gte(0),
|
|
similarity: z.number().gte(0).lte(1).nullish(),
|
|
status: z.enum(['active', 'draft']),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSGoldenQuestionBulkImportResponse
|
|
*/
|
|
export const zKnowledgeFsGoldenQuestionBulkImportResponse = z.object({
|
|
active_count: z.int().gte(0),
|
|
draft_count: z.int().gte(0),
|
|
items: z.array(zKnowledgeFsGoldenQuestionBulkImportItemResponse),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSGoldenQuestionEvidenceCandidateResponse
|
|
*/
|
|
export const zKnowledgeFsGoldenQuestionEvidenceCandidateResponse = z.object({
|
|
document_asset_id: z.string(),
|
|
node_id: z.string(),
|
|
page_number: z.int().nullish(),
|
|
projection_id: z.string().nullish(),
|
|
score: z.number().gte(0).lte(1).nullish(),
|
|
section_path: z.array(z.string()),
|
|
text: z.string(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSGoldenQuestionEvidenceMatchResponse
|
|
*/
|
|
export const zKnowledgeFsGoldenQuestionEvidenceMatchResponse = z.object({
|
|
candidates: z.array(zKnowledgeFsGoldenQuestionEvidenceCandidateResponse),
|
|
evidence: z.string(),
|
|
matched: z.boolean(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSBulkDocumentAvailabilityItem
|
|
*/
|
|
export const zKnowledgeFsBulkDocumentAvailabilityItem = z.object({
|
|
documentId: z.string(),
|
|
expectedRowVersion: z.int().gte(0),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSBulkDocumentAvailabilityPayload
|
|
*/
|
|
export const zKnowledgeFsBulkDocumentAvailabilityPayload = z.object({
|
|
documents: z.array(zKnowledgeFsBulkDocumentAvailabilityItem).min(1).max(100),
|
|
enabled: z.boolean(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSBulkDocumentAvailabilityFailureResponse
|
|
*/
|
|
export const zKnowledgeFsBulkDocumentAvailabilityFailureResponse = z.object({
|
|
document_id: z.string(),
|
|
status: z.enum(['conflict', 'not_found']),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSBulkDocumentAvailabilityResponse
|
|
*/
|
|
export const zKnowledgeFsBulkDocumentAvailabilityResponse = z.object({
|
|
items: z.array(
|
|
z.union([
|
|
zKnowledgeFsLogicalDocumentResponse,
|
|
zKnowledgeFsBulkDocumentAvailabilityFailureResponse,
|
|
]),
|
|
),
|
|
total: z.int().gte(0),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSBulkLogicalDocumentDeleteItemPayload
|
|
*/
|
|
export const zKnowledgeFsBulkLogicalDocumentDeleteItemPayload = z.object({
|
|
documentId: z.string().min(1),
|
|
expectedRevision: z.int().gte(0),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSBulkLogicalDocumentDeletePayload
|
|
*/
|
|
export const zKnowledgeFsBulkLogicalDocumentDeletePayload = z.object({
|
|
documents: z.array(zKnowledgeFsBulkLogicalDocumentDeleteItemPayload).min(1).max(100),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSOverviewInventoryDeltaResponse
|
|
*/
|
|
export const zKnowledgeFsOverviewInventoryDeltaResponse = z.object({
|
|
added_last_7d: z.int().gte(0),
|
|
total: z.int().gte(0),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSOverviewIndexCoverageResponse
|
|
*/
|
|
export const zKnowledgeFsOverviewIndexCoverageResponse = z.object({
|
|
indexed: z.int().gte(0),
|
|
percentage: z.number().gte(0).lte(100),
|
|
total: z.int().gte(0),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSOverviewSourceCategoriesResponse
|
|
*/
|
|
export const zKnowledgeFsOverviewSourceCategoriesResponse = z.object({
|
|
crawl: z.int().gte(0),
|
|
online_documents: z.int().gte(0),
|
|
online_drives: z.int().gte(0),
|
|
uploads: z.int().gte(0),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSOverviewInventoryResponse
|
|
*/
|
|
export const zKnowledgeFsOverviewInventoryResponse = z.object({
|
|
generated_at: z.iso.datetime(),
|
|
graph_entities: zKnowledgeFsOverviewInventoryDeltaResponse,
|
|
graph_relations: zKnowledgeFsOverviewInventoryDeltaResponse,
|
|
index_coverage: zKnowledgeFsOverviewIndexCoverageResponse,
|
|
knowledge_space_id: z.string(),
|
|
source_categories: zKnowledgeFsOverviewSourceCategoriesResponse,
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSOverviewQueryOutcomeBucketResponse
|
|
*/
|
|
export const zKnowledgeFsOverviewQueryOutcomeBucketResponse = z.object({
|
|
answered: z.int().gte(0),
|
|
end_at: z.iso.datetime(),
|
|
low_confidence: z.int().gte(0),
|
|
no_evidence: z.int().gte(0),
|
|
query_count: z.int().gte(0),
|
|
start_at: z.iso.datetime(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSOverviewQueryOutcomeCountsResponse
|
|
*/
|
|
export const zKnowledgeFsOverviewQueryOutcomeCountsResponse = z.object({
|
|
answer_rate: z.number().gte(0).lte(1),
|
|
answered: z.int().gte(0),
|
|
low_confidence: z.int().gte(0),
|
|
no_evidence: z.int().gte(0),
|
|
query_count: z.int().gte(0),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSOverviewQueryOutcomesResponse
|
|
*/
|
|
export const zKnowledgeFsOverviewQueryOutcomesResponse = z.object({
|
|
buckets: z.array(zKnowledgeFsOverviewQueryOutcomeBucketResponse),
|
|
current: zKnowledgeFsOverviewQueryOutcomeCountsResponse,
|
|
generated_at: z.iso.datetime(),
|
|
knowledge_space_id: z.string(),
|
|
previous: zKnowledgeFsOverviewQueryOutcomeCountsResponse,
|
|
previous_since: z.iso.datetime(),
|
|
since: z.iso.datetime(),
|
|
window: z.enum(['24h', '30d', '7d']),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSOverviewRateComparisonResponse
|
|
*/
|
|
export const zKnowledgeFsOverviewRateComparisonResponse = z.object({
|
|
change_percentage_points: z.number(),
|
|
previous_value: z.number().gte(0).lte(1),
|
|
value: z.number().gte(0).lte(1),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSOverviewCountComparisonResponse
|
|
*/
|
|
export const zKnowledgeFsOverviewCountComparisonResponse = z.object({
|
|
change_rate: z.number().nullable(),
|
|
previous_value: z.int().gte(0),
|
|
value: z.int().gte(0),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSOverviewStatsResponse
|
|
*/
|
|
export const zKnowledgeFsOverviewStatsResponse = z.object({
|
|
answer_rate: zKnowledgeFsOverviewRateComparisonResponse,
|
|
documents: z.int().gte(0),
|
|
fresh_source_count: z.int().gte(0),
|
|
freshness_seconds: z.int().gte(0).nullish(),
|
|
generated_at: z.iso.datetime(),
|
|
knowledge_space_id: z.string(),
|
|
latest_source_sync_at: z.iso.datetime().nullish(),
|
|
linked_apps: z.int().gte(0),
|
|
queries: zKnowledgeFsOverviewCountComparisonResponse,
|
|
source_count: z.int().gte(0),
|
|
stale_source_count: z.int().gte(0),
|
|
window: z.enum(['24h', '30d', '7d']),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSQualityReplaySummary
|
|
*/
|
|
export const zKnowledgeFsQualityReplaySummary = z.object({
|
|
completed: z.int().gte(0),
|
|
failed: z.int().gte(0),
|
|
hit_rate: z.number().gte(0).lte(1),
|
|
passed: z.int().gte(0),
|
|
total: z.int().gte(0),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSResearchTaskLimits
|
|
*/
|
|
export const zKnowledgeFsResearchTaskLimits = z.object({
|
|
maxRetrievalSteps: z.int().gte(1).nullish(),
|
|
maxScannedResources: z.int().gte(1).nullish(),
|
|
maxToolCalls: z.int().gte(1).nullish(),
|
|
timeoutMs: z.int().gte(1).nullish(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSResearchTaskCreatePayload
|
|
*/
|
|
export const zKnowledgeFsResearchTaskCreatePayload = z.object({
|
|
budgetUsd: z.number().gte(0).nullish(),
|
|
limits: zKnowledgeFsResearchTaskLimits.nullish(),
|
|
metadata: z.record(z.string(), z.unknown()).optional(),
|
|
mode: z.enum(['auto', 'deep', 'fast', 'research']).nullish(),
|
|
query: z.string().max(16000).nullish(),
|
|
queryImages: z.array(zKnowledgeFsQueryImageReference).max(4).optional(),
|
|
topK: z.int().gte(1).lte(50).nullish(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSQueryImageResponse
|
|
*
|
|
* One query image a retrieval run was asked with, enriched for console display.
|
|
*
|
|
* The gateway persists only the UploadFile reference and static metadata; the console fills in
|
|
* the file name and a short-lived signed preview URL for files the caller still owns.
|
|
*/
|
|
export const zKnowledgeFsQueryImageResponse = z.object({
|
|
byte_size: z.int().gte(0).nullish(),
|
|
mime_type: z.string().nullish(),
|
|
name: z.string().nullish(),
|
|
preview_url: z.string().nullish(),
|
|
upload_file_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSResearchTaskResponse
|
|
*/
|
|
export const zKnowledgeFsResearchTaskResponse = z.object({
|
|
budget_usd: z.number().gte(0).nullish(),
|
|
completed_at: z.number().nullish(),
|
|
cost: z.record(z.string(), z.unknown()),
|
|
created_at: z.number(),
|
|
error: z.string().nullish(),
|
|
failure: zKnowledgeFsPublicFailureResponse.nullish(),
|
|
id: z.string(),
|
|
knowledge_space_id: z.string(),
|
|
limits: zKnowledgeFsResearchTaskLimits.nullish(),
|
|
metadata: z.record(z.string(), z.unknown()),
|
|
mode: z.enum(['auto', 'deep', 'fast', 'research']).nullish(),
|
|
query: z.string(),
|
|
query_images: z.array(zKnowledgeFsQueryImageResponse).optional(),
|
|
stage: z.enum([
|
|
'analyzing',
|
|
'canceled',
|
|
'completed',
|
|
'failed',
|
|
'generating',
|
|
'paused',
|
|
'planning',
|
|
'queued',
|
|
'retrieving',
|
|
]),
|
|
top_k: z.int().nullish(),
|
|
updated_at: z.number(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSResearchTaskListResponse
|
|
*/
|
|
export const zKnowledgeFsResearchTaskListResponse = z.object({
|
|
data: z.array(zKnowledgeFsResearchTaskResponse),
|
|
next_cursor: z.string().nullish(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSResearchTaskPlanBudgetResponse
|
|
*/
|
|
export const zKnowledgeFsResearchTaskPlanBudgetResponse = z.object({
|
|
budget_usd: z.number().gte(0).nullish(),
|
|
exceeds_budget: z.boolean(),
|
|
remaining_budget_usd: z.number().nullish(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSResearchTaskRetrievalPlanResponse
|
|
*/
|
|
export const zKnowledgeFsResearchTaskRetrievalPlanResponse = z.object({
|
|
dense_top_k: z.int().gte(0),
|
|
fts_top_k: z.int().gte(0),
|
|
fusion_limit: z.int().gte(0),
|
|
query_language: z.enum(['cjk', 'latin', 'mixed-cjk-latin', 'other']),
|
|
requested_mode: z.enum(['auto', 'deep', 'fast', 'research']),
|
|
rerank_candidate_limit: z.int().gte(0),
|
|
resolved_mode: z.enum(['deep', 'fast', 'research']),
|
|
strategy_version: z.string(),
|
|
top_k: z.int().gte(1),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSResearchTaskPlanResponse
|
|
*/
|
|
export const zKnowledgeFsResearchTaskPlanResponse = z.object({
|
|
budget: zKnowledgeFsResearchTaskPlanBudgetResponse,
|
|
estimates: z.record(z.string(), z.unknown()),
|
|
knowledge_space_id: z.string(),
|
|
query: z.string(),
|
|
query_images: z.array(zKnowledgeFsQueryImageReference).optional(),
|
|
retrieval_plan: zKnowledgeFsResearchTaskRetrievalPlanResponse,
|
|
steps: z.array(z.record(z.string(), z.unknown())),
|
|
strategy_version: z.literal('research-dry-run-planner-v1'),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSResearchTaskPartialResponse
|
|
*/
|
|
export const zKnowledgeFsResearchTaskPartialResponse = z.object({
|
|
answer: z.string().min(1).max(20000).nullish(),
|
|
evidence_bundle: z.record(z.string(), z.unknown()),
|
|
knowledge_space_id: z.string(),
|
|
research_task_job_id: z.string(),
|
|
sequence: z.int().gte(1),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSResearchTaskPartialListResponse
|
|
*/
|
|
export const zKnowledgeFsResearchTaskPartialListResponse = z.object({
|
|
data: z.array(zKnowledgeFsResearchTaskPartialResponse),
|
|
next_cursor: z.string().nullish(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSActiveProfileRevisions
|
|
*/
|
|
export const zKnowledgeFsActiveProfileRevisions = z.object({
|
|
embedding: z.int().gte(1).nullish(),
|
|
retrieval: z.int().gte(1).nullish(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSReadinessCapabilities
|
|
*/
|
|
export const zKnowledgeFsReadinessCapabilities = z.object({
|
|
deep: z.boolean(),
|
|
index: z.boolean(),
|
|
ingest: z.boolean(),
|
|
query: z.boolean(),
|
|
research: z.boolean(),
|
|
source_sync: z.boolean(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSEmbeddingSettingsResponse
|
|
*/
|
|
export const zKnowledgeFsEmbeddingSettingsResponse = z.object({
|
|
dimension: z.int().gte(1).nullish(),
|
|
model: z.string(),
|
|
plugin_id: z.string(),
|
|
provider: z.string(),
|
|
revision: z.int().gte(1).nullish(),
|
|
vector_space_id: z.string().nullish(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSReadinessIssue
|
|
*/
|
|
export const zKnowledgeFsReadinessIssue = z.object({
|
|
code: z.enum(['binding_missing', 'incompatible', 'missing', 'unavailable', 'validation_failed']),
|
|
field: z.enum(['embedding', 'publication', 'reasoning', 'rerank']),
|
|
retryable: z.boolean(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSProfileModelSelection
|
|
*/
|
|
export const zKnowledgeFsProfileModelSelection = z.object({
|
|
model: z.string().min(1).max(256),
|
|
pluginId: z.string().min(1).max(256),
|
|
provider: z.string().min(1).max(256),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSCrawlPreviewPageResponse
|
|
*/
|
|
export const zKnowledgeFsCrawlPreviewPageResponse = z.object({
|
|
description: z.string().nullish(),
|
|
etag: z.string().nullish(),
|
|
page_id: z.string(),
|
|
source_url: z.string(),
|
|
title: z.string().nullish(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSCrawlPreviewPageListResponse
|
|
*/
|
|
export const zKnowledgeFsCrawlPreviewPageListResponse = z.object({
|
|
data: z.array(zKnowledgeFsCrawlPreviewPageResponse),
|
|
next_cursor: z.string().nullish(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSSourceEditWebsiteSelectionPayload
|
|
*/
|
|
export const zKnowledgeFsSourceEditWebsiteSelectionPayload = z.object({
|
|
kind: z.literal('website_crawl'),
|
|
sourceUrls: z.array(z.string()).min(1).max(200),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSSourceEditSyncPolicyPayload
|
|
*/
|
|
export const zKnowledgeFsSourceEditSyncPolicyPayload = z.object({
|
|
customIntervalSeconds: z.int().gte(3600).lte(2592000).nullish(),
|
|
enabled: z.boolean(),
|
|
mode: z.enum(['custom', 'interval', 'manual']),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSCrawlImportPagePayload
|
|
*/
|
|
export const zKnowledgeFsCrawlImportPagePayload = z.object({
|
|
content: z.string().max(10000000),
|
|
description: z.string().nullish(),
|
|
sourceUrl: z.string().min(1).max(4096),
|
|
title: z.string().max(500).nullish(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSCrawlImportPayload
|
|
*/
|
|
export const zKnowledgeFsCrawlImportPayload = z.object({
|
|
pages: z.array(zKnowledgeFsCrawlImportPagePayload).min(1).max(200).nullish(),
|
|
sourceUrls: z.array(z.string()).min(1).max(200),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSSourceImportPagePayload
|
|
*/
|
|
export const zKnowledgeFsSourceImportPagePayload = z.object({
|
|
lastEditedTime: z.string().nullish(),
|
|
name: z.string().min(1).max(200).nullish(),
|
|
pageId: z.string().min(1),
|
|
type: z.string().min(1),
|
|
workspaceId: z.string().min(1),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSSourceImportPagesPayload
|
|
*/
|
|
export const zKnowledgeFsSourceImportPagesPayload = z.object({
|
|
pages: z.array(zKnowledgeFsSourceImportPagePayload).min(1).max(200),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSSourceImportedDocumentResponse
|
|
*/
|
|
export const zKnowledgeFsSourceImportedDocumentResponse = z.object({
|
|
document_asset_id: z.string(),
|
|
filename: z.string(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSSourceImportFailureResponse
|
|
*/
|
|
export const zKnowledgeFsSourceImportFailureResponse = z.object({
|
|
code: z.enum([
|
|
'DOCUMENT_COMPILATION_FAILED',
|
|
'DOCUMENT_COMPILATION_LEASE_LOST',
|
|
'DOCUMENT_COMPILATION_RETRYABLE',
|
|
'DOCUMENT_DISABLED',
|
|
'DOCUMENT_PARSER_INPUT_INVALID',
|
|
'DOCUMENT_PARSER_NOT_CONFIGURED',
|
|
'DOCUMENT_PARSER_RATE_LIMITED',
|
|
'DOCUMENT_PARSER_RESPONSE_INVALID',
|
|
'DOCUMENT_PARSER_TIMEOUT',
|
|
'DOCUMENT_PARSER_UNAVAILABLE',
|
|
'DOCUMENT_PARSER_UNSUPPORTED_TYPE',
|
|
'DOCUMENT_PDF_RENDER_FAILED',
|
|
'EMBEDDING_DIMENSION_INVALID',
|
|
'EMBEDDING_DIMENSION_UNSUPPORTED',
|
|
'EXECUTION_ATTEMPTS_EXHAUSTED',
|
|
'KNOWLEDGE_FS_ACCESS_DENIED',
|
|
'KNOWLEDGE_FS_CONFLICT',
|
|
'KNOWLEDGE_FS_INTERNAL_ERROR',
|
|
'KNOWLEDGE_FS_INVALID_REQUEST',
|
|
'KNOWLEDGE_FS_NOT_FOUND',
|
|
'KNOWLEDGE_FS_RATE_LIMITED',
|
|
'KNOWLEDGE_FS_TIMEOUT',
|
|
'KNOWLEDGE_FS_UNAVAILABLE',
|
|
'KNOWLEDGE_SPACE_MANIFEST_NOT_FOUND',
|
|
'KNOWLEDGE_SPACE_MODEL_CONFIGURATION_REQUIRED',
|
|
'MODEL_CAPABILITY_MISMATCH',
|
|
'MODEL_CONFIGURATION_STALE',
|
|
'MODEL_CREDENTIAL_INVALID',
|
|
'MODEL_CREDENTIAL_VALIDATION_UNAVAILABLE',
|
|
'MODEL_IDENTITY_MISMATCH',
|
|
'MODEL_PREFLIGHT_CANCELED',
|
|
'MODEL_PREFLIGHT_FAILED',
|
|
'MODEL_PREFLIGHT_TIMEOUT',
|
|
'MODEL_PREFLIGHT_UNAVAILABLE',
|
|
'MODEL_PROFILE_ACTIVATION_INCOMPLETE',
|
|
'MODEL_PROFILE_ACTIVATION_PERMISSION_REQUIRED',
|
|
'MODEL_RUNTIME_FAILED',
|
|
'MODEL_RUNTIME_RESPONSE_INVALID',
|
|
'MODEL_RUNTIME_TIMEOUT',
|
|
'MODEL_RUNTIME_UNAVAILABLE',
|
|
'MODEL_SELECTION_NOT_FOUND',
|
|
'RESEARCH_TASK_CAPABILITY_REVOKED',
|
|
'RESEARCH_TASK_DISPATCH_DEAD',
|
|
'RESEARCH_TASK_EXECUTION_ATTEMPTS_EXHAUSTED',
|
|
'RESEARCH_TASK_FAILED',
|
|
'RESEARCH_TASK_PERMISSION_SNAPSHOT_INVALID',
|
|
'RESEARCH_TASK_RUNTIME_SNAPSHOT_INVALID',
|
|
'RETRIEVAL_DELETION_IN_PROGRESS',
|
|
'RETRIEVAL_EXECUTION_LEASE_LOST',
|
|
'SOURCE_BULK_ACTION_FAILED',
|
|
'SOURCE_CONNECTION_UNAVAILABLE',
|
|
'SOURCE_CRAWL_PAGE_NOT_FOUND',
|
|
'SOURCE_CRAWL_PROVIDER_UNAVAILABLE',
|
|
'SOURCE_CRAWL_RESULT_LIMIT_EXCEEDED',
|
|
'SOURCE_CREDENTIAL_CONFIG_INVALID',
|
|
'SOURCE_CREDENTIAL_MUTATION_FAILED',
|
|
'SOURCE_CREDENTIAL_TEST_FAILED',
|
|
'SOURCE_CREDENTIAL_UNAVAILABLE',
|
|
'SOURCE_DOCUMENT_COMPILATION_FAILED',
|
|
'SOURCE_DOCUMENT_MATERIALIZATION_FAILED',
|
|
'SOURCE_DOCUMENT_REPLACEMENT_SAGA_REQUIRED',
|
|
'SOURCE_IMPORT_PARTIAL_FAILURE',
|
|
'SOURCE_ONLINE_DOCUMENT_CONFIG_INVALID',
|
|
'SOURCE_ONLINE_DOCUMENT_IMPORT_FAILED',
|
|
'SOURCE_ONLINE_DOCUMENT_PAGE_FETCH_FAILED',
|
|
'SOURCE_ONLINE_DOCUMENT_REQUEST_FAILED',
|
|
'SOURCE_ONLINE_DOCUMENT_UNAVAILABLE',
|
|
'SOURCE_ONLINE_DRIVE_CONFIG_INVALID',
|
|
'SOURCE_ONLINE_DRIVE_FILE_DOWNLOAD_FAILED',
|
|
'SOURCE_ONLINE_DRIVE_IMPORT_FAILED',
|
|
'SOURCE_ONLINE_DRIVE_REQUEST_FAILED',
|
|
'SOURCE_ONLINE_DRIVE_UNAVAILABLE',
|
|
'SOURCE_OPERATION_FAILED',
|
|
'SOURCE_PROVIDER_REJECTED',
|
|
'SOURCE_PROVIDER_TIMEOUT',
|
|
'SOURCE_PROVIDER_UNAVAILABLE',
|
|
'SOURCE_SECRET_INTEGRITY_FAILED',
|
|
'SOURCE_SECRET_REF_CONFLICT',
|
|
'SOURCE_SYNC_FAILED',
|
|
'SOURCE_SYNC_SELECTION_MISMATCH',
|
|
'SOURCE_WEBSITE_CRAWL_CONFIG_INVALID',
|
|
'SOURCE_WEBSITE_CRAWL_FAILED',
|
|
'SOURCE_WORKFLOW_CONTENT_MISSING',
|
|
'SOURCE_WORKFLOW_CONTENT_TOO_LARGE',
|
|
'SOURCE_WORKFLOW_EXTERNAL_TIMEOUT',
|
|
'SOURCE_WORKFLOW_FAILED',
|
|
'UPLOAD_INITIALIZATION_FAILED',
|
|
'UPLOAD_INTEGRITY_MISMATCH',
|
|
]),
|
|
error: z.string(),
|
|
failure: zKnowledgeFsPublicFailureResponse.nullish(),
|
|
filename: z.string(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSSourceImportResponse
|
|
*/
|
|
export const zKnowledgeFsSourceImportResponse = z.object({
|
|
documents: z.array(zKnowledgeFsSourceImportedDocumentResponse),
|
|
failed: z.array(zKnowledgeFsSourceImportFailureResponse),
|
|
skipped: z.array(z.string()),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSSourceImportFilePayload
|
|
*/
|
|
export const zKnowledgeFsSourceImportFilePayload = z.object({
|
|
bucket: z.string().nullish(),
|
|
id: z.string().min(1),
|
|
mimeType: z.string().nullish(),
|
|
name: z.string().min(1).max(255),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSSourceImportFilesPayload
|
|
*/
|
|
export const zKnowledgeFsSourceImportFilesPayload = z.object({
|
|
files: z.array(zKnowledgeFsSourceImportFilePayload).min(1).max(200),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSSpaceTagResponse
|
|
*/
|
|
export const zKnowledgeFsSpaceTagResponse = z.object({
|
|
id: z.string(),
|
|
name: z.string(),
|
|
type: z.literal('knowledge').optional().default('knowledge'),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSSpaceTagListResponse
|
|
*/
|
|
export const zKnowledgeFsSpaceTagListResponse = z.object({
|
|
data: z.array(zKnowledgeFsSpaceTagResponse),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSSpaceListItemResponse
|
|
*/
|
|
export const zKnowledgeFsSpaceListItemResponse = z.object({
|
|
control_space_id: z.string(),
|
|
created_at: z.iso.datetime(),
|
|
knowledge_space_id: z.string().nullable(),
|
|
linked_apps: z.int().gte(0),
|
|
owner_account_id: z.string(),
|
|
permission_keys: z.array(zKnowledgeFsProductPermission),
|
|
resource_version: z.int(),
|
|
state: zKnowledgeFsControlSpaceState,
|
|
tags: z.array(zKnowledgeFsSpaceTagResponse).optional(),
|
|
technical_status: z.enum(['available', 'not_ready', 'unavailable']),
|
|
technical_summary: zKnowledgeFsTechnicalSummary.nullish(),
|
|
updated_at: z.iso.datetime(),
|
|
visibility: zKnowledgeFsControlSpaceVisibility,
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSSpaceListResponse
|
|
*/
|
|
export const zKnowledgeFsSpaceListResponse = z.object({
|
|
data: z.array(zKnowledgeFsSpaceListItemResponse),
|
|
has_more: z.boolean(),
|
|
limit: z.int(),
|
|
page: z.int(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSAnswerTraceStepResponse
|
|
*/
|
|
export const zKnowledgeFsAnswerTraceStepResponse = z.object({
|
|
ended_at: z.iso.datetime().nullish(),
|
|
metadata: z.record(z.string(), z.unknown()),
|
|
name: z.string(),
|
|
started_at: z.iso.datetime(),
|
|
status: z.enum(['error', 'ok', 'skipped']),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSAnswerTraceResponse
|
|
*/
|
|
export const zKnowledgeFsAnswerTraceResponse = z.object({
|
|
created_at: z.iso.datetime(),
|
|
evidence_bundle_id: z.string().nullish(),
|
|
id: z.string(),
|
|
knowledge_space_id: z.string(),
|
|
mode: z.enum(['auto', 'deep', 'fast', 'research']),
|
|
query: z.string(),
|
|
query_images: z.array(zKnowledgeFsQueryImageResponse).optional(),
|
|
steps: z.array(zKnowledgeFsAnswerTraceStepResponse),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSTraceEntryResponse
|
|
*/
|
|
export const zKnowledgeFsTraceEntryResponse = z.object({
|
|
kind: z.enum(['directory', 'resource']),
|
|
metadata: z.record(z.string(), z.unknown()),
|
|
name: z.string(),
|
|
path: z.string(),
|
|
resource_type: z.string().nullish(),
|
|
target_id: z.string().nullish(),
|
|
version: z.int().gte(1).nullish(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSTraceEntryListResponse
|
|
*/
|
|
export const zKnowledgeFsTraceEntryListResponse = z.object({
|
|
consistency_class: z.string().nullish(),
|
|
data: z.array(zKnowledgeFsTraceEntryResponse),
|
|
next_cursor: z.string().nullish(),
|
|
path: z.string(),
|
|
preview: z.boolean().nullish(),
|
|
truncated: z.boolean(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSUploadSessionResponse
|
|
*/
|
|
export const zKnowledgeFsUploadSessionResponse = z.object({
|
|
compilation_job_id: z.string().nullish(),
|
|
completed_at: z.int().nullish(),
|
|
document_asset_id: z.string().nullish(),
|
|
expected_size_bytes: z.int().gt(0),
|
|
expires_at: z.int().gte(0),
|
|
id: z.string().min(1).max(255),
|
|
mode: z.enum(['multipart', 'single', 'small_fallback']),
|
|
multipart_part_count: z.int().gte(1).nullish(),
|
|
multipart_part_size_bytes: z.int().gt(0).nullish(),
|
|
status: z.enum([
|
|
'aborted',
|
|
'aborting',
|
|
'completed',
|
|
'completing',
|
|
'creating',
|
|
'expired',
|
|
'failed',
|
|
'ready',
|
|
]),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSUploadSessionCreateResponse
|
|
*/
|
|
export const zKnowledgeFsUploadSessionCreateResponse = z.object({
|
|
session: zKnowledgeFsUploadSessionResponse,
|
|
upload: zKnowledgeFsPresignedUploadResponse.nullish(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSUploadSessionMutationResponse
|
|
*/
|
|
export const zKnowledgeFsUploadSessionMutationResponse = z.object({
|
|
session: zKnowledgeFsUploadSessionResponse,
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSSmallFileUploadResponse
|
|
*/
|
|
export const zKnowledgeFsSmallFileUploadResponse = z.object({
|
|
session: zKnowledgeFsUploadSessionResponse,
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSUploadSessionPartPayload
|
|
*/
|
|
export const zKnowledgeFsUploadSessionPartPayload = z.object({
|
|
checksumSha256Base64: z.string().min(1).max(255).nullish(),
|
|
etag: z.string().min(1).max(255),
|
|
partNumber: z.int().gte(1).lte(10000),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSUploadSessionCompletePayload
|
|
*/
|
|
export const zKnowledgeFsUploadSessionCompletePayload = z.object({
|
|
parts: z.array(zKnowledgeFsUploadSessionPartPayload).max(10000).nullish(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSInitialWebsiteCrawlOptionsPayload
|
|
*/
|
|
export const zKnowledgeFsInitialWebsiteCrawlOptionsPayload = z.object({
|
|
include_subpages: z.boolean().optional().default(true),
|
|
limit: z.int().gte(1).lte(200).optional().default(100),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSInitialWebsiteSelectionPayload
|
|
*/
|
|
export const zKnowledgeFsInitialWebsiteSelectionPayload = z.object({
|
|
canonical_url: z.string().min(1).max(4096).nullish(),
|
|
source_url: z.string().min(1).max(4096),
|
|
title: z.string().max(500).nullish(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSInitialWebsiteSourcePayload
|
|
*/
|
|
export const zKnowledgeFsInitialWebsiteSourcePayload = z.object({
|
|
crawl_options: zKnowledgeFsInitialWebsiteCrawlOptionsPayload,
|
|
credentialId: z.string().min(1).max(255).nullish(),
|
|
custom_interval_seconds: z.int().gte(3600).lte(2592000).nullish(),
|
|
datasource: z.string().min(1).max(255).optional().default('crawl'),
|
|
kind: z.literal('website_crawl'),
|
|
name: z.string().min(1).max(200),
|
|
parameters: z.record(z.string(), zJsonValue).optional(),
|
|
pluginId: z.string().min(1).max(255).nullish(),
|
|
previewConfigurationFingerprint: z.string().length(64).nullish(),
|
|
previewJobId: z.string().min(1).max(255).nullish(),
|
|
provider: z.string().min(1).max(255),
|
|
providerDisplayName: z.string().min(1).max(255).nullish(),
|
|
root_url: z.string().min(1).max(4096),
|
|
selection: z.array(zKnowledgeFsInitialWebsiteSelectionPayload).min(1).max(200),
|
|
sync_policy: z.enum(['custom', 'daily', 'manual']).optional().default('daily'),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSOnlineDocumentWorkflowImportItemPayload
|
|
*/
|
|
export const zKnowledgeFsOnlineDocumentWorkflowImportItemPayload = z.object({
|
|
etag: z.string().max(1024).nullish(),
|
|
lastEditedTime: z.string().max(128).nullish(),
|
|
name: z.string().max(500).nullish(),
|
|
pageId: z.string().min(1).max(1024),
|
|
providerItemId: z.string().min(1).max(1024),
|
|
type: z.string().min(1).max(128),
|
|
workspaceId: z.string().min(1).max(1024),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSInitialOnlineDocumentSourcePayload
|
|
*/
|
|
export const zKnowledgeFsInitialOnlineDocumentSourcePayload = z.object({
|
|
credentialId: z.string().min(1).max(255),
|
|
custom_interval_seconds: z.int().gte(3600).lte(2592000).nullish(),
|
|
datasource: z.string().min(1).max(255),
|
|
kind: z.literal('online_document'),
|
|
name: z.string().min(1).max(200),
|
|
parameters: z.record(z.string(), zJsonValue).optional(),
|
|
pluginId: z.string().min(1).max(255),
|
|
provider: z.string().min(1).max(255),
|
|
providerDisplayName: z.string().min(1).max(255).nullish(),
|
|
selection: z.array(zKnowledgeFsOnlineDocumentWorkflowImportItemPayload).min(1).max(200),
|
|
sync_policy: z.enum(['custom', 'daily', 'manual']).optional().default('daily'),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSSourceEditOnlineDocumentSelectionPayload
|
|
*/
|
|
export const zKnowledgeFsSourceEditOnlineDocumentSelectionPayload = z.object({
|
|
items: z.array(zKnowledgeFsOnlineDocumentWorkflowImportItemPayload).min(1).max(200),
|
|
kind: z.literal('online_document'),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSOnlineDocumentWorkflowImportPayload
|
|
*/
|
|
export const zKnowledgeFsOnlineDocumentWorkflowImportPayload = z.object({
|
|
items: z.array(zKnowledgeFsOnlineDocumentWorkflowImportItemPayload).min(1).max(200),
|
|
kind: z.literal('online-document-import'),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSOnlineDriveWorkflowImportItemPayload
|
|
*/
|
|
export const zKnowledgeFsOnlineDriveWorkflowImportItemPayload = z.object({
|
|
bucket: z.string().max(1024).nullish(),
|
|
etag: z.string().max(1024).nullish(),
|
|
id: z.string().min(1).max(1024),
|
|
mimeType: z.string().max(255).nullish(),
|
|
name: z.string().min(1).max(500),
|
|
providerItemId: z.string().min(1).max(1024),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSInitialOnlineDriveSourcePayload
|
|
*/
|
|
export const zKnowledgeFsInitialOnlineDriveSourcePayload = z.object({
|
|
credentialId: z.string().min(1).max(255),
|
|
custom_interval_seconds: z.int().gte(3600).lte(2592000).nullish(),
|
|
datasource: z.string().min(1).max(255),
|
|
kind: z.literal('online_drive'),
|
|
name: z.string().min(1).max(200),
|
|
parameters: z.record(z.string(), zJsonValue).optional(),
|
|
pluginId: z.string().min(1).max(255),
|
|
provider: z.string().min(1).max(255),
|
|
providerDisplayName: z.string().min(1).max(255).nullish(),
|
|
selection: z.array(zKnowledgeFsOnlineDriveWorkflowImportItemPayload).min(1).max(200),
|
|
sync_policy: z.enum(['custom', 'daily', 'manual']).optional().default('daily'),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSSourceEditOnlineDriveSelectionPayload
|
|
*/
|
|
export const zKnowledgeFsSourceEditOnlineDriveSelectionPayload = z.object({
|
|
items: z.array(zKnowledgeFsOnlineDriveWorkflowImportItemPayload).min(1).max(200),
|
|
kind: z.literal('online_drive'),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSSourceUpdatePayload
|
|
*/
|
|
export const zKnowledgeFsSourceUpdatePayload = z.object({
|
|
expectedVersion: z.int().gte(1).nullish(),
|
|
metadata: z.record(z.string(), z.unknown()).nullish(),
|
|
name: z.string().min(1).max(200).nullish(),
|
|
providerParameters: z
|
|
.record(z.string(), z.union([z.boolean(), z.number(), z.string()]))
|
|
.nullish(),
|
|
selection: z
|
|
.discriminatedUnion('kind', [
|
|
zKnowledgeFsSourceEditWebsiteSelectionPayload.extend({ kind: z.literal('website_crawl') }),
|
|
zKnowledgeFsSourceEditOnlineDocumentSelectionPayload.extend({
|
|
kind: z.literal('online_document'),
|
|
}),
|
|
zKnowledgeFsSourceEditOnlineDriveSelectionPayload.extend({ kind: z.literal('online_drive') }),
|
|
])
|
|
.nullish(),
|
|
status: z.enum(['active', 'disabled', 'error', 'syncing']).nullish(),
|
|
syncAfterUpdate: z.boolean().nullish(),
|
|
syncPolicy: zKnowledgeFsSourceEditSyncPolicyPayload.nullish(),
|
|
uri: z.string().min(1).max(4096).nullish(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSOnlineDriveWorkflowImportPayload
|
|
*/
|
|
export const zKnowledgeFsOnlineDriveWorkflowImportPayload = z.object({
|
|
items: z.array(zKnowledgeFsOnlineDriveWorkflowImportItemPayload).min(1).max(200),
|
|
kind: z.literal('online-drive-import'),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSSourceWorkflowImportPayload
|
|
*/
|
|
export const zKnowledgeFsSourceWorkflowImportPayload = z.discriminatedUnion('kind', [
|
|
zKnowledgeFsOnlineDocumentWorkflowImportPayload.extend({
|
|
kind: z.literal('online-document-import'),
|
|
}),
|
|
zKnowledgeFsOnlineDriveWorkflowImportPayload.extend({ kind: z.literal('online-drive-import') }),
|
|
])
|
|
|
|
/**
|
|
* KnowledgeFSRerankIntent
|
|
*/
|
|
export const zKnowledgeFsRerankIntent = z.object({
|
|
enabled: z.boolean(),
|
|
model: zKnowledgeFsModelIntent.nullish(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSScoreThresholdIntent
|
|
*/
|
|
export const zKnowledgeFsScoreThresholdIntent = z.object({
|
|
enabled: z.boolean(),
|
|
stage: z.enum(['mode-final', 'rerank']).optional().default('mode-final'),
|
|
value: z.number().gte(0).lte(1).nullish(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSRetrievalProfileIntent
|
|
*/
|
|
export const zKnowledgeFsRetrievalProfileIntent = z.object({
|
|
default_mode: z.enum(['deep', 'fast', 'research']),
|
|
reasoning_model: zKnowledgeFsModelIntent,
|
|
rerank: zKnowledgeFsRerankIntent,
|
|
score_threshold: zKnowledgeFsScoreThresholdIntent,
|
|
top_k: z.int().gte(1).lte(100),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSSpaceCreatePayload
|
|
*/
|
|
export const zKnowledgeFsSpaceCreatePayload = z.object({
|
|
description: z.string().max(2000).nullish(),
|
|
embedding: zKnowledgeFsModelIntent.nullish(),
|
|
icon: z
|
|
.string()
|
|
.max(72)
|
|
.regex(/^(?:builtin:)?[+a-z0-9_-]{1,64}$/)
|
|
.nullish(),
|
|
idempotency_key: z.string().min(1).max(255).nullish(),
|
|
initial_source: z
|
|
.discriminatedUnion('kind', [
|
|
zKnowledgeFsInitialWebsiteSourcePayload.extend({ kind: z.literal('website_crawl') }),
|
|
zKnowledgeFsInitialOnlineDocumentSourcePayload.extend({ kind: z.literal('online_document') }),
|
|
zKnowledgeFsInitialOnlineDriveSourcePayload.extend({ kind: z.literal('online_drive') }),
|
|
])
|
|
.nullish(),
|
|
name: z.string().min(1).max(40),
|
|
retrieval: zKnowledgeFsRetrievalProfileIntent.nullish(),
|
|
slug: z
|
|
.string()
|
|
.min(1)
|
|
.max(160)
|
|
.regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/),
|
|
visibility: zKnowledgeFsControlSpaceVisibility.optional().default('only_me'),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSDurableDeletionErrorResponse
|
|
*/
|
|
export const zKnowledgeFsDurableDeletionErrorResponse = z.object({
|
|
code: z.string(),
|
|
message: z.string(),
|
|
retryable: z.boolean(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSDurableDeletionProgressResponse
|
|
*/
|
|
export const zKnowledgeFsDurableDeletionProgressResponse = z.object({
|
|
completed_items: z.int().gte(0),
|
|
current_item_kind: z.string().nullish(),
|
|
total_items: z.int().gte(0).nullish(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSDurableDeletionJobResponse
|
|
*/
|
|
export const zKnowledgeFsDurableDeletionJobResponse = z.object({
|
|
checkpoint: z.enum([
|
|
'completed',
|
|
'deleting_derived_data',
|
|
'deleting_objects',
|
|
'deleting_primary_data',
|
|
'quiescing',
|
|
'requested',
|
|
]),
|
|
completed_at: z.iso.datetime().nullish(),
|
|
created_at: z.iso.datetime(),
|
|
error: zKnowledgeFsDurableDeletionErrorResponse.nullish(),
|
|
id: z.string(),
|
|
knowledge_space_id: z.string(),
|
|
mode: z.enum(['cascade', 'keep']).nullish(),
|
|
progress: zKnowledgeFsDurableDeletionProgressResponse.nullish(),
|
|
retry_at: z.iso.datetime().nullish(),
|
|
run_state: z.enum([
|
|
'canceled',
|
|
'completed',
|
|
'dispatch_pending',
|
|
'failed',
|
|
'queued',
|
|
'retry_wait',
|
|
'running',
|
|
]),
|
|
target_id: z.string(),
|
|
target_type: z.enum(['document', 'knowledge_space', 'logical_document', 'source']),
|
|
updated_at: z.iso.datetime(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSDurableDeletionAcceptedResponse
|
|
*/
|
|
export const zKnowledgeFsDurableDeletionAcceptedResponse = z.object({
|
|
document_title: z.string().nullish(),
|
|
job: zKnowledgeFsDurableDeletionJobResponse,
|
|
status_url: z.string(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSBulkDeletionAcceptedItemResponse
|
|
*/
|
|
export const zKnowledgeFsBulkDeletionAcceptedItemResponse = z.object({
|
|
document_id: z.string(),
|
|
document_title: z.string().nullish(),
|
|
job: zKnowledgeFsDurableDeletionJobResponse,
|
|
status_url: z.string(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSBulkDeletionAcceptedResponse
|
|
*/
|
|
export const zKnowledgeFsBulkDeletionAcceptedResponse = z.object({
|
|
items: z.array(zKnowledgeFsBulkDeletionAcceptedItemResponse),
|
|
total: z.int().gte(1),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSControlSpacePermissionRole
|
|
*/
|
|
export const zKnowledgeFsControlSpacePermissionRole = z.enum(['editor', 'owner', 'viewer'])
|
|
|
|
/**
|
|
* KnowledgeFSMemberBindingPayload
|
|
*/
|
|
export const zKnowledgeFsMemberBindingPayload = z.object({
|
|
account_id: z.string().min(1),
|
|
role: zKnowledgeFsControlSpacePermissionRole,
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSMembersReplacePayload
|
|
*/
|
|
export const zKnowledgeFsMembersReplacePayload = z.object({
|
|
members: z.array(zKnowledgeFsMemberBindingPayload).max(1000),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSPermissionResponse
|
|
*/
|
|
export const zKnowledgeFsPermissionResponse = z.object({
|
|
account_id: z.string(),
|
|
revision: z.int(),
|
|
role: zKnowledgeFsControlSpacePermissionRole,
|
|
status: z.string(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSPermissionListResponse
|
|
*/
|
|
export const zKnowledgeFsPermissionListResponse = z.object({
|
|
data: z.array(zKnowledgeFsPermissionResponse),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSOverviewActivityActorResponse
|
|
*/
|
|
export const zKnowledgeFsOverviewActivityActorResponse = z.object({
|
|
id: z.string().nullish(),
|
|
type: z.enum(['member', 'system']),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSOverviewActivityResourceResponse
|
|
*/
|
|
export const zKnowledgeFsOverviewActivityResourceResponse = z.object({
|
|
id: z.string().nullish(),
|
|
type: z.enum([
|
|
'document',
|
|
'knowledge-space',
|
|
'permission',
|
|
'profile',
|
|
'publication',
|
|
'query',
|
|
'source',
|
|
'worker',
|
|
]),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSOverviewActivityResponse
|
|
*/
|
|
export const zKnowledgeFsOverviewActivityResponse = z.object({
|
|
action: z.enum([
|
|
'document.failed',
|
|
'document.published',
|
|
'permission.updated',
|
|
'profile.published',
|
|
'query.completed',
|
|
'query.failed',
|
|
'query.requested',
|
|
'settings.updated',
|
|
'source.failed',
|
|
'source.synced',
|
|
'worker.failed',
|
|
]),
|
|
actor: zKnowledgeFsOverviewActivityActorResponse,
|
|
details: z.record(z.string(), z.union([z.boolean(), z.number(), z.string()])),
|
|
id: z.string(),
|
|
occurred_at: z.iso.datetime(),
|
|
resource: zKnowledgeFsOverviewActivityResourceResponse,
|
|
result: z.enum(['canceled', 'failure', 'pending', 'success']),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSOverviewActivityListResponse
|
|
*/
|
|
export const zKnowledgeFsOverviewActivityListResponse = z.object({
|
|
data: z.array(zKnowledgeFsOverviewActivityResponse),
|
|
next_cursor: z.string().nullish(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSOverviewAttentionActionResponse
|
|
*/
|
|
export const zKnowledgeFsOverviewAttentionActionResponse = z.object({
|
|
kind: z.enum(['open-resource', 'review-models', 'review-permissions']),
|
|
resource_id: z.string().nullish(),
|
|
resource_type: z.enum(['document', 'failed-query', 'knowledge-space', 'source']),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSOverviewAttentionEvidenceResponse
|
|
*/
|
|
export const zKnowledgeFsOverviewAttentionEvidenceResponse = z.object({
|
|
code: z.string(),
|
|
observed_at: z.iso.datetime(),
|
|
value: z.union([z.number(), z.string()]).nullish(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSOverviewAttentionResourceResponse
|
|
*/
|
|
export const zKnowledgeFsOverviewAttentionResourceResponse = z.object({
|
|
id: z.string(),
|
|
type: z.enum(['document', 'failed-query', 'knowledge-space', 'source']),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSOverviewAttentionResponse
|
|
*/
|
|
export const zKnowledgeFsOverviewAttentionResponse = z.object({
|
|
action: zKnowledgeFsOverviewAttentionActionResponse,
|
|
dismissed_until: z.iso.datetime().nullish(),
|
|
evidence: z.array(zKnowledgeFsOverviewAttentionEvidenceResponse),
|
|
issue_key: z.string(),
|
|
knowledge_space_id: z.string(),
|
|
resource: zKnowledgeFsOverviewAttentionResourceResponse,
|
|
revision: z.int().gte(1),
|
|
rule_id: z.enum([
|
|
'failed-document',
|
|
'low-quality-query',
|
|
'model-readiness',
|
|
'permission-readiness',
|
|
'stale-source',
|
|
]),
|
|
severity: z.enum(['critical', 'info', 'warning']),
|
|
status: z.enum(['active', 'dismissed', 'resolved']),
|
|
title: z.string(),
|
|
updated_at: z.iso.datetime(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSOverviewAttentionListResponse
|
|
*/
|
|
export const zKnowledgeFsOverviewAttentionListResponse = z.object({
|
|
data: z.array(zKnowledgeFsOverviewAttentionResponse),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSOverviewHealthComponentResponse
|
|
*/
|
|
export const zKnowledgeFsOverviewHealthComponentResponse = z.object({
|
|
codes: z.array(z.string()),
|
|
state: z.enum(['degraded', 'healthy', 'unavailable', 'unknown']),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSOverviewHealthComponentsResponse
|
|
*/
|
|
export const zKnowledgeFsOverviewHealthComponentsResponse = z.object({
|
|
index: zKnowledgeFsOverviewHealthComponentResponse,
|
|
ingestion: zKnowledgeFsOverviewHealthComponentResponse,
|
|
profile_publication: zKnowledgeFsOverviewHealthComponentResponse,
|
|
query_availability: zKnowledgeFsOverviewHealthComponentResponse,
|
|
source_freshness: zKnowledgeFsOverviewHealthComponentResponse,
|
|
worker_readiness: zKnowledgeFsOverviewHealthComponentResponse,
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSOverviewHealthResponse
|
|
*/
|
|
export const zKnowledgeFsOverviewHealthResponse = z.object({
|
|
components: zKnowledgeFsOverviewHealthComponentsResponse,
|
|
generated_at: z.iso.datetime(),
|
|
knowledge_space_id: z.string(),
|
|
state: z.enum(['degraded', 'healthy', 'unavailable', 'unknown']),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSQualityReplayEmbeddingProvenance
|
|
*/
|
|
export const zKnowledgeFsQualityReplayEmbeddingProvenance = z.object({
|
|
dimension: z.int().gt(0),
|
|
model: z.string(),
|
|
vector_space_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSQualityReplayProjectionProvenance
|
|
*/
|
|
export const zKnowledgeFsQualityReplayProjectionProvenance = z.object({
|
|
projection_version: z.int().gt(0),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSQualityReplayRetrievalProvenance
|
|
*/
|
|
export const zKnowledgeFsQualityReplayRetrievalProvenance = z.object({
|
|
profile_revision: z.int().gt(0),
|
|
reasoning_model: z.string(),
|
|
rerank_model: z.string().nullish(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSQualityReplayProvenance
|
|
*/
|
|
export const zKnowledgeFsQualityReplayProvenance = z.object({
|
|
embedding: zKnowledgeFsQualityReplayEmbeddingProvenance.nullish(),
|
|
projection: zKnowledgeFsQualityReplayProjectionProvenance,
|
|
retrieval: zKnowledgeFsQualityReplayRetrievalProvenance,
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSProductRerankProfile
|
|
*/
|
|
export const zKnowledgeFsProductRerankProfile = z.object({
|
|
enabled: z.boolean(),
|
|
model: zKnowledgeFsProfileModelSelection.nullish(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSProductScoreThreshold
|
|
*/
|
|
export const zKnowledgeFsProductScoreThreshold = z.object({
|
|
enabled: z.boolean(),
|
|
stage: z.enum(['mode-final', 'rerank']).optional().default('mode-final'),
|
|
value: z.number().gte(0).lte(1).nullish(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSRetrievalSettingsResponse
|
|
*/
|
|
export const zKnowledgeFsRetrievalSettingsResponse = z.object({
|
|
default_mode: z.enum(['deep', 'fast', 'research']),
|
|
reasoning_model: zKnowledgeFsEmbeddingSettingsResponse,
|
|
rerank: zKnowledgeFsProductRerankProfile,
|
|
revision: z.int().gte(1).nullish(),
|
|
score_threshold: zKnowledgeFsProductScoreThreshold,
|
|
top_k: z.int().gte(1).lte(100),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSSettingsResponse
|
|
*/
|
|
export const zKnowledgeFsSettingsResponse = z.object({
|
|
active_profile_available: z.boolean(),
|
|
active_profile_revisions: zKnowledgeFsActiveProfileRevisions,
|
|
capabilities: zKnowledgeFsReadinessCapabilities,
|
|
configuration_state: z.enum([
|
|
'active',
|
|
'pending-validation',
|
|
'setup-required',
|
|
'validation-failed',
|
|
]),
|
|
embedding: zKnowledgeFsEmbeddingSettingsResponse.nullable(),
|
|
issues: z.array(zKnowledgeFsReadinessIssue),
|
|
retrieval: zKnowledgeFsRetrievalSettingsResponse.nullable(),
|
|
revision: z.int().gte(1),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSSettingsUpdateResponse
|
|
*/
|
|
export const zKnowledgeFsSettingsUpdateResponse = z.object({
|
|
migration: zKnowledgeFsProfileMigrationResponse.nullish(),
|
|
settings: zKnowledgeFsSettingsResponse,
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSProductRetrievalProfile
|
|
*/
|
|
export const zKnowledgeFsProductRetrievalProfile = z.object({
|
|
defaultMode: z.enum(['deep', 'fast', 'research']),
|
|
reasoningModel: zKnowledgeFsProfileModelSelection,
|
|
rerank: zKnowledgeFsProductRerankProfile,
|
|
scoreThreshold: zKnowledgeFsProductScoreThreshold,
|
|
topK: z.int().gte(1).lte(100),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSSettingsPayload
|
|
*/
|
|
export const zKnowledgeFsSettingsPayload = z.object({
|
|
embedding: zKnowledgeFsProfileModelSelection.nullish(),
|
|
expectedRevision: z.int().gte(1),
|
|
retrieval: zKnowledgeFsProductRetrievalProfile.nullish(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSSourceProviderFieldResponse
|
|
*/
|
|
export const zKnowledgeFsSourceProviderFieldResponse = z.object({
|
|
description: z.string().nullish(),
|
|
format: z.enum(['password', 'uri']).nullish(),
|
|
name: z.string(),
|
|
required: z.boolean(),
|
|
secret: z.boolean(),
|
|
type: z.enum(['boolean', 'integer', 'string']),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSSourceProviderResponse
|
|
*/
|
|
export const zKnowledgeFsSourceProviderResponse = z.object({
|
|
auth_kinds: z.array(z.enum(['api-key', 'endpoint', 'oauth2'])),
|
|
available: z.boolean(),
|
|
capabilities: z.array(z.enum(['online-document', 'online-drive', 'website-crawl'])),
|
|
configuration: z.array(zKnowledgeFsSourceProviderFieldResponse),
|
|
display_name: z.string(),
|
|
id: z.string(),
|
|
unavailable_reason: z.string().nullish(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSSourceProviderListResponse
|
|
*/
|
|
export const zKnowledgeFsSourceProviderListResponse = z.object({
|
|
data: z.array(zKnowledgeFsSourceProviderResponse),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSDeferredSyncPolicyPayload
|
|
*/
|
|
export const zKnowledgeFsDeferredSyncPolicyPayload = z.object({
|
|
customIntervalSeconds: z.int().gte(3600).lte(2592000).nullish(),
|
|
enabled: z.boolean(),
|
|
mode: z.enum(['custom', 'interval', 'manual']),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSAsyncCrawlPreviewImportPayload
|
|
*/
|
|
export const zKnowledgeFsAsyncCrawlPreviewImportPayload = z.object({
|
|
kind: z.literal('crawl-preview-selection'),
|
|
pageIds: z.array(z.string()).min(1).max(200),
|
|
previewWorkflowId: z.string().min(1).max(255),
|
|
syncPolicy: zKnowledgeFsDeferredSyncPolicyPayload,
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSAsyncWebsiteCrawlImportPayload
|
|
*/
|
|
export const zKnowledgeFsAsyncWebsiteCrawlImportPayload = z.object({
|
|
kind: z.literal('website-crawl-import'),
|
|
sourceUrls: z.array(z.string()).min(1).max(200),
|
|
syncPolicy: zKnowledgeFsDeferredSyncPolicyPayload,
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSAsyncOnlineDocumentImportPayload
|
|
*/
|
|
export const zKnowledgeFsAsyncOnlineDocumentImportPayload = z.object({
|
|
items: z.array(zKnowledgeFsOnlineDocumentWorkflowImportItemPayload).min(1).max(200),
|
|
kind: z.literal('online-document-import'),
|
|
syncPolicy: zKnowledgeFsDeferredSyncPolicyPayload,
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSAsyncOnlineDriveImportPayload
|
|
*/
|
|
export const zKnowledgeFsAsyncOnlineDriveImportPayload = z.object({
|
|
items: z.array(zKnowledgeFsOnlineDriveWorkflowImportItemPayload).min(1).max(200),
|
|
kind: z.literal('online-drive-import'),
|
|
syncPolicy: zKnowledgeFsDeferredSyncPolicyPayload,
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSAsyncSourceImportPayload
|
|
*/
|
|
export const zKnowledgeFsAsyncSourceImportPayload = z.discriminatedUnion('kind', [
|
|
zKnowledgeFsAsyncCrawlPreviewImportPayload.extend({ kind: z.literal('crawl-preview-selection') }),
|
|
zKnowledgeFsAsyncWebsiteCrawlImportPayload.extend({ kind: z.literal('website-crawl-import') }),
|
|
zKnowledgeFsAsyncOnlineDocumentImportPayload.extend({
|
|
kind: z.literal('online-document-import'),
|
|
}),
|
|
zKnowledgeFsAsyncOnlineDriveImportPayload.extend({ kind: z.literal('online-drive-import') }),
|
|
])
|
|
|
|
/**
|
|
* KnowledgeFSSourceFileResponse
|
|
*/
|
|
export const zKnowledgeFsSourceFileResponse = z.object({
|
|
id: z.string(),
|
|
name: z.string(),
|
|
size: z.number().gte(0).nullish(),
|
|
type: z.string(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSSourceFileBucketResponse
|
|
*/
|
|
export const zKnowledgeFsSourceFileBucketResponse = z.object({
|
|
bucket: z.string().nullish(),
|
|
continuation_token: z.string().nullish(),
|
|
files: z.array(zKnowledgeFsSourceFileResponse),
|
|
is_truncated: z.boolean().nullish(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSSourceFilesResponse
|
|
*/
|
|
export const zKnowledgeFsSourceFilesResponse = z.object({
|
|
buckets: z.array(zKnowledgeFsSourceFileBucketResponse),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSSourcePageResponse
|
|
*/
|
|
export const zKnowledgeFsSourcePageResponse = z.object({
|
|
last_edited_time: z.string().nullish(),
|
|
page_id: z.string(),
|
|
page_name: z.string(),
|
|
parent_id: z.string().nullish(),
|
|
type: z.string(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSSourceWorkspacePagesResponse
|
|
*/
|
|
export const zKnowledgeFsSourceWorkspacePagesResponse = z.object({
|
|
pages: z.array(zKnowledgeFsSourcePageResponse),
|
|
total: z.int().gte(0).nullish(),
|
|
workspace_id: z.string().nullish(),
|
|
workspace_name: z.string().nullish(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSSourcePagesResponse
|
|
*/
|
|
export const zKnowledgeFsSourcePagesResponse = z.object({
|
|
next_cursor: z.string().nullish(),
|
|
workspaces: z.array(zKnowledgeFsSourceWorkspacePagesResponse),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSTraceProfileResponse
|
|
*/
|
|
export const zKnowledgeFsTraceProfileResponse = z.object({
|
|
embedding_model: z.string().nullish(),
|
|
embedding_vector_space_id: z.string().nullish(),
|
|
projection_publication_id: z.string().nullish(),
|
|
projection_version: z.int().gte(1).nullish(),
|
|
reasoning_model: z.string().nullish(),
|
|
rerank_model: z.string().nullish(),
|
|
retrieval_profile_revision: z.int().gte(1).nullish(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSTraceScoresResponse
|
|
*/
|
|
export const zKnowledgeFsTraceScoresResponse = z.object({
|
|
final: z.number().gte(0).lte(1).nullish(),
|
|
rerank: z.number().gte(0).lte(1).nullish(),
|
|
retrieval: z.number().gte(0).lte(1).nullish(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSTraceStageResponse
|
|
*/
|
|
export const zKnowledgeFsTraceStageResponse = z.object({
|
|
candidate_count: z.int().gte(0).nullish(),
|
|
name: z.string(),
|
|
status: z.enum(['error', 'ok', 'skipped']),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSTraceResponse
|
|
*/
|
|
export const zKnowledgeFsTraceResponse = z.object({
|
|
completed: z.boolean(),
|
|
created_at: z.iso.datetime(),
|
|
duration_ms: z.int().gte(0).nullish(),
|
|
evidence_bundle_id: z.string().nullish(),
|
|
evidence_state: z.string().nullish(),
|
|
final_score: z.number().gte(0).lte(1).nullish(),
|
|
id: z.string(),
|
|
mode: z.enum(['auto', 'deep', 'fast', 'research']),
|
|
open_bad_case_id: z.string().nullish(),
|
|
profile: zKnowledgeFsTraceProfileResponse,
|
|
query: z.string(),
|
|
query_images: z.array(zKnowledgeFsQueryImageResponse).optional(),
|
|
result_count: z.int().gte(0),
|
|
scores: zKnowledgeFsTraceScoresResponse,
|
|
stages: z.array(zKnowledgeFsTraceStageResponse),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSTraceListResponse
|
|
*/
|
|
export const zKnowledgeFsTraceListResponse = z.object({
|
|
data: z.array(zKnowledgeFsTraceResponse),
|
|
next_cursor: z.string().nullish(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSQualityReplayMetrics
|
|
*/
|
|
export const zKnowledgeFsQualityReplayMetrics = z.object({
|
|
dense_candidates: z.int().gte(0).nullish(),
|
|
fts_candidates: z.int().gte(0).nullish(),
|
|
fused_candidates: z.int().gte(0).nullish(),
|
|
graph_expansion_candidates: z.int().gte(0).nullish(),
|
|
page_index_matched_nodes: z.int().gte(0).nullish(),
|
|
permission_filtered_candidates: z.int().gte(0).nullish(),
|
|
rerank_candidates: z.int().gte(0).nullish(),
|
|
score_threshold_filtered_candidates: z.int().gte(0).nullish(),
|
|
summary_candidates: z.int().gte(0).nullish(),
|
|
total_ms: z.number().gte(0).nullish(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSQualityReplayEvidenceItem
|
|
*/
|
|
export const zKnowledgeFsQualityReplayEvidenceItem = z.object({
|
|
available: z.boolean(),
|
|
document_name: z.string().nullish(),
|
|
matched: z.boolean(),
|
|
ordinal: z.int().gte(1),
|
|
page_number: z.int().gte(1).nullish(),
|
|
section_path: z.array(z.string()).optional(),
|
|
text: z.string().nullish(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSQualityReplayEvidenceDiff
|
|
*/
|
|
export const zKnowledgeFsQualityReplayEvidenceDiff = z.object({
|
|
evidence_items: z.array(zKnowledgeFsQualityReplayEvidenceItem).nullish(),
|
|
expected_count: z.int().gte(0),
|
|
matched_count: z.int().gte(0),
|
|
missing_count: z.int().gte(0),
|
|
retrieved_count: z.int().gte(0),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSQualityReplayItemResult
|
|
*/
|
|
export const zKnowledgeFsQualityReplayItemResult = z.object({
|
|
evidence_diff: zKnowledgeFsQualityReplayEvidenceDiff,
|
|
metrics: zKnowledgeFsQualityReplayMetrics,
|
|
passed: z.boolean(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSQualityReplayItem
|
|
*/
|
|
export const zKnowledgeFsQualityReplayItem = z.object({
|
|
golden_question_id: z.string(),
|
|
id: z.string(),
|
|
match_policy: z.enum(['all', 'any']),
|
|
ordinal: z.int().gte(1),
|
|
question: z.string(),
|
|
result: zKnowledgeFsQualityReplayItemResult.nullish(),
|
|
state: z.enum(['canceled', 'failed', 'passed', 'queued', 'running']),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSQualityReplayResponse
|
|
*/
|
|
export const zKnowledgeFsQualityReplayResponse = z.object({
|
|
attempt: z.int().gte(0),
|
|
created_at: z.iso.datetime(),
|
|
error: z.string().nullish(),
|
|
id: z.string(),
|
|
items: z.array(zKnowledgeFsQualityReplayItem),
|
|
knowledge_space_id: z.string(),
|
|
mode: z.enum(['deep', 'fast', 'research']),
|
|
provenance: zKnowledgeFsQualityReplayProvenance,
|
|
revision: z.int().gte(1),
|
|
state: z.enum(['canceled', 'failed', 'passed', 'queued', 'running']),
|
|
summary: zKnowledgeFsQualityReplaySummary,
|
|
updated_at: z.iso.datetime(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFSQualityReplayListResponse
|
|
*/
|
|
export const zKnowledgeFsQualityReplayListResponse = z.object({
|
|
data: z.array(zKnowledgeFsQualityReplayResponse),
|
|
next_cursor: z.string().nullish(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFS Capability v2 public keys
|
|
*/
|
|
export const zGetKnowledgeFsWellKnownJwksJsonResponse = zKnowledgeFsjwksResponse
|
|
|
|
export const zPostKnowledgeFsQueryStreamBody = zKnowledgeFsAdmittedQueryRequest
|
|
|
|
/**
|
|
* KnowledgeFS query event stream
|
|
*/
|
|
export const zPostKnowledgeFsQueryStreamResponse = z.string()
|
|
|
|
export const zGetKnowledgeFsResearchTasksByTaskIdEventsPath = z.object({
|
|
task_id: z.string(),
|
|
})
|
|
|
|
export const zGetKnowledgeFsResearchTasksByTaskIdEventsQuery = z.object({
|
|
cursor: z.string().min(1).max(1000).optional(),
|
|
knowledgeSpaceId: z.string().min(1).max(255),
|
|
limit: z.int().gte(1).lte(100).optional().default(25),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFS research task event stream
|
|
*/
|
|
export const zGetKnowledgeFsResearchTasksByTaskIdEventsResponse = z.string()
|
|
|
|
export const zPostKnowledgeFsSourceProviderPreviewBody = zKnowledgeFsInitialSourcePreviewPayload
|
|
|
|
/**
|
|
* Datasource resources available for an initial Source
|
|
*/
|
|
export const zPostKnowledgeFsSourceProviderPreviewResponse =
|
|
zKnowledgeFsInitialSourcePreviewResponse
|
|
|
|
export const zPostKnowledgeFsSourceProviderPreviewJobsBody =
|
|
zKnowledgeFsInitialWebsiteSourcePreviewPayload
|
|
|
|
/**
|
|
* Website datasource preview queued
|
|
*/
|
|
export const zPostKnowledgeFsSourceProviderPreviewJobsResponse =
|
|
zKnowledgeFsInitialSourcePreviewJobCreateResponse
|
|
|
|
export const zDeleteKnowledgeFsSourceProviderPreviewJobsByJobIdPath = z.object({
|
|
job_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* Website datasource preview canceled
|
|
*/
|
|
export const zDeleteKnowledgeFsSourceProviderPreviewJobsByJobIdResponse =
|
|
zKnowledgeFsInitialSourcePreviewJobResponse
|
|
|
|
export const zGetKnowledgeFsSourceProviderPreviewJobsByJobIdPath = z.object({
|
|
job_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* Website datasource preview status
|
|
*/
|
|
export const zGetKnowledgeFsSourceProviderPreviewJobsByJobIdResponse =
|
|
zKnowledgeFsInitialSourcePreviewJobResponse
|
|
|
|
export const zGetKnowledgeFsSpacesQuery = z.object({
|
|
creator_ids: z.array(z.string().min(1).max(255)).max(100).optional(),
|
|
limit: z.int().gte(1).lte(100).optional().default(20),
|
|
page: z.int().gte(1).optional().default(1),
|
|
query: z.string().max(255).optional(),
|
|
tag_ids: z.array(z.string().min(1).max(255)).max(100).optional(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFS spaces
|
|
*/
|
|
export const zGetKnowledgeFsSpacesResponse = zKnowledgeFsSpaceListResponse
|
|
|
|
export const zPostKnowledgeFsSpacesBody = zKnowledgeFsSpaceCreatePayload
|
|
|
|
/**
|
|
* KnowledgeFS provisioning accepted
|
|
*/
|
|
export const zPostKnowledgeFsSpacesResponse = zKnowledgeFsSpaceCreateResponse
|
|
|
|
export const zDeleteKnowledgeFsSpacesByControlSpaceIdPath = z.object({
|
|
control_space_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFS deletion accepted
|
|
*/
|
|
export const zDeleteKnowledgeFsSpacesByControlSpaceIdResponse = z.void()
|
|
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdPath = z.object({
|
|
control_space_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFS space
|
|
*/
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdResponse = zKnowledgeFsSpaceDetailResponse
|
|
|
|
export const zPatchKnowledgeFsSpacesByControlSpaceIdBody = zKnowledgeFsSpaceUpdatePayload
|
|
|
|
export const zPatchKnowledgeFsSpacesByControlSpaceIdPath = z.object({
|
|
control_space_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFS space updated
|
|
*/
|
|
export const zPatchKnowledgeFsSpacesByControlSpaceIdResponse = zKnowledgeFsSpaceDetailResponse
|
|
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdAppBindingsPath = z.object({
|
|
control_space_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFS app bindings
|
|
*/
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdAppBindingsResponse =
|
|
zKnowledgeFsAppBindingListResponse
|
|
|
|
export const zPutKnowledgeFsSpacesByControlSpaceIdAppBindingsBody = zKnowledgeFsAppBindingPayload
|
|
|
|
export const zPutKnowledgeFsSpacesByControlSpaceIdAppBindingsPath = z.object({
|
|
control_space_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFS app binding enabled
|
|
*/
|
|
export const zPutKnowledgeFsSpacesByControlSpaceIdAppBindingsResponse =
|
|
zKnowledgeFsAppBindingResponse
|
|
|
|
export const zDeleteKnowledgeFsSpacesByControlSpaceIdAppBindingsByCallerKindByAppIdPath = z.object({
|
|
app_id: z.string(),
|
|
caller_kind: z.string(),
|
|
control_space_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFS app binding revoked
|
|
*/
|
|
export const zDeleteKnowledgeFsSpacesByControlSpaceIdAppBindingsByCallerKindByAppIdResponse =
|
|
z.void()
|
|
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdBackgroundTasksPath = z.object({
|
|
control_space_id: z.string(),
|
|
})
|
|
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdBackgroundTasksQuery = z.object({
|
|
cursor: z.string().min(1).max(8192).optional(),
|
|
limit: z.int().gte(1).lte(100).optional().default(50),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFS background tasks
|
|
*/
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdBackgroundTasksResponse =
|
|
zKnowledgeFsBackgroundTaskListResponse
|
|
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdBackgroundTasksByTaskKindByTaskIdCancelPath =
|
|
z.object({
|
|
control_space_id: z.string(),
|
|
task_id: z.string(),
|
|
task_kind: z.string(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFS background task canceled
|
|
*/
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdBackgroundTasksByTaskKindByTaskIdCancelResponse =
|
|
zKnowledgeFsBackgroundTaskResponse
|
|
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdBackgroundTasksByTaskKindByTaskIdRetryPath =
|
|
z.object({
|
|
control_space_id: z.string(),
|
|
task_id: z.string(),
|
|
task_kind: z.string(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFS background task retried
|
|
*/
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdBackgroundTasksByTaskKindByTaskIdRetryResponse =
|
|
zKnowledgeFsBackgroundTaskResponse
|
|
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdBulkJobsByJobIdPath = z.object({
|
|
control_space_id: z.string(),
|
|
job_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFS bulk job
|
|
*/
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdBulkJobsByJobIdResponse =
|
|
zKnowledgeFsBulkJobResponse
|
|
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdDocumentsPath = z.object({
|
|
control_space_id: z.string(),
|
|
})
|
|
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdDocumentsQuery = z.object({
|
|
cursor: z.string().min(1).max(1000).optional(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFS documents
|
|
*/
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdDocumentsResponse =
|
|
zKnowledgeFsDocumentListResponse
|
|
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdDocumentsBody =
|
|
zKnowledgeFsDocumentStagedUploadPayload
|
|
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdDocumentsPath = z.object({
|
|
control_space_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFS document accepted for processing
|
|
*/
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdDocumentsResponse =
|
|
zKnowledgeFsDocumentStagedUploadAcceptedResponse
|
|
|
|
export const zDeleteKnowledgeFsSpacesByControlSpaceIdDocumentsBulkBody =
|
|
zKnowledgeFsBulkDocumentDeletePayload
|
|
|
|
export const zDeleteKnowledgeFsSpacesByControlSpaceIdDocumentsBulkHeaders = z.object({
|
|
'Idempotency-Key': z.string().min(8).max(255),
|
|
})
|
|
|
|
export const zDeleteKnowledgeFsSpacesByControlSpaceIdDocumentsBulkPath = z.object({
|
|
control_space_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFS document deletions accepted
|
|
*/
|
|
export const zDeleteKnowledgeFsSpacesByControlSpaceIdDocumentsBulkResponse =
|
|
zKnowledgeFsBulkDeletionAcceptedResponse
|
|
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdDocumentsReindexBody =
|
|
zKnowledgeFsDocumentReindexPayload
|
|
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdDocumentsReindexPath = z.object({
|
|
control_space_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFS document reindex queued
|
|
*/
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdDocumentsReindexResponse =
|
|
zKnowledgeFsDocumentReindexResponse
|
|
|
|
export const zDeleteKnowledgeFsSpacesByControlSpaceIdDocumentsByDocumentIdBody =
|
|
zKnowledgeFsDocumentDeletePayload
|
|
|
|
export const zDeleteKnowledgeFsSpacesByControlSpaceIdDocumentsByDocumentIdHeaders = z.object({
|
|
'Idempotency-Key': z.string().min(8).max(255),
|
|
})
|
|
|
|
export const zDeleteKnowledgeFsSpacesByControlSpaceIdDocumentsByDocumentIdPath = z.object({
|
|
control_space_id: z.string(),
|
|
document_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFS document deletion accepted
|
|
*/
|
|
export const zDeleteKnowledgeFsSpacesByControlSpaceIdDocumentsByDocumentIdResponse =
|
|
zKnowledgeFsDurableDeletionAcceptedResponse
|
|
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdDocumentsByDocumentIdPath = z.object({
|
|
control_space_id: z.string(),
|
|
document_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFS document
|
|
*/
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdDocumentsByDocumentIdResponse =
|
|
zKnowledgeFsDocumentResponse
|
|
|
|
export const zPatchKnowledgeFsSpacesByControlSpaceIdDocumentsByDocumentIdBody =
|
|
zKnowledgeFsDocumentMetadataPayload
|
|
|
|
export const zPatchKnowledgeFsSpacesByControlSpaceIdDocumentsByDocumentIdPath = z.object({
|
|
control_space_id: z.string(),
|
|
document_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFS document metadata updated
|
|
*/
|
|
export const zPatchKnowledgeFsSpacesByControlSpaceIdDocumentsByDocumentIdResponse =
|
|
zKnowledgeFsLogicalDocumentResponse
|
|
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdDocumentsByDocumentIdMultimodalPath = z.object({
|
|
control_space_id: z.string(),
|
|
document_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFS document multimodal manifest
|
|
*/
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdDocumentsByDocumentIdMultimodalResponse =
|
|
zKnowledgeFsDocumentMultimodalManifestResponse
|
|
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdDocumentsByDocumentIdMultimodalByItemIdAssetPath =
|
|
z.object({
|
|
control_space_id: z.string(),
|
|
document_id: z.string(),
|
|
item_id: z.string(),
|
|
})
|
|
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdDocumentsByDocumentIdMultimodalByItemIdAssetQuery =
|
|
z.object({
|
|
variant: z
|
|
.string()
|
|
.min(1)
|
|
.max(64)
|
|
.regex(/^[A-Za-z0-9._=-]+$/)
|
|
.optional(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFS document multimodal asset
|
|
*/
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdDocumentsByDocumentIdMultimodalByItemIdAssetResponse =
|
|
zBinaryFileResponse
|
|
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdDocumentsByDocumentIdOutlinePath = z.object({
|
|
control_space_id: z.string(),
|
|
document_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFS document outline
|
|
*/
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdDocumentsByDocumentIdOutlineResponse =
|
|
zKnowledgeFsDocumentOutlineResponse
|
|
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdDocumentsByDocumentIdRevisionsPath = z.object({
|
|
control_space_id: z.string(),
|
|
document_id: z.string(),
|
|
})
|
|
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdDocumentsByDocumentIdRevisionsQuery = z.object({
|
|
cursor: z.string().min(1).max(1000).optional(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFS document revisions
|
|
*/
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdDocumentsByDocumentIdRevisionsResponse =
|
|
zKnowledgeFsDocumentRevisionListResponse
|
|
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdDocumentsByDocumentIdRevisionsByRevisionChunksPath =
|
|
z.object({
|
|
control_space_id: z.string(),
|
|
document_id: z.string(),
|
|
revision: z.int(),
|
|
})
|
|
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdDocumentsByDocumentIdRevisionsByRevisionChunksQuery =
|
|
z.object({
|
|
cursor: z.string().min(1).max(1000).optional(),
|
|
query: z.string().min(1).max(512).optional(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFS document chunks
|
|
*/
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdDocumentsByDocumentIdRevisionsByRevisionChunksResponse =
|
|
zKnowledgeFsDocumentChunkListResponse
|
|
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdDocumentsByDocumentIdRevisionsByRevisionChunksByChunkIdPath =
|
|
z.object({
|
|
chunk_id: z.string(),
|
|
control_space_id: z.string(),
|
|
document_id: z.string(),
|
|
revision: z.int(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFS document chunk
|
|
*/
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdDocumentsByDocumentIdRevisionsByRevisionChunksByChunkIdResponse =
|
|
zKnowledgeFsDocumentChunkResponse
|
|
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdExternalAccessPath = z.object({
|
|
control_space_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFS external access
|
|
*/
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdExternalAccessResponse =
|
|
zKnowledgeFsExternalAccessResponse
|
|
|
|
export const zPutKnowledgeFsSpacesByControlSpaceIdExternalAccessBody =
|
|
zKnowledgeFsExternalAccessPayload
|
|
|
|
export const zPutKnowledgeFsSpacesByControlSpaceIdExternalAccessPath = z.object({
|
|
control_space_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFS external access updated
|
|
*/
|
|
export const zPutKnowledgeFsSpacesByControlSpaceIdExternalAccessResponse =
|
|
zKnowledgeFsExternalAccessResponse
|
|
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdGoldenQuestionsPath = z.object({
|
|
control_space_id: z.string(),
|
|
})
|
|
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdGoldenQuestionsQuery = z.object({
|
|
cursor: z.string().min(1).max(1000).optional(),
|
|
limit: z.int().gte(1).lte(100).optional().default(50),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFS golden questions
|
|
*/
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdGoldenQuestionsResponse =
|
|
zKnowledgeFsGoldenQuestionListResponse
|
|
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdGoldenQuestionsBody =
|
|
zKnowledgeFsGoldenQuestionPayload
|
|
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdGoldenQuestionsPath = z.object({
|
|
control_space_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFS golden question created
|
|
*/
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdGoldenQuestionsResponse =
|
|
zKnowledgeFsGoldenQuestionResponse
|
|
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdGoldenQuestionsBulkImportBody =
|
|
zKnowledgeFsGoldenQuestionBulkImportPayload
|
|
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdGoldenQuestionsBulkImportPath = z.object({
|
|
control_space_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFS golden questions imported
|
|
*/
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdGoldenQuestionsBulkImportResponse =
|
|
zKnowledgeFsGoldenQuestionBulkImportResponse
|
|
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdGoldenQuestionsEvidenceMatchesBody =
|
|
zKnowledgeFsGoldenQuestionEvidenceMatchPayload
|
|
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdGoldenQuestionsEvidenceMatchesPath = z.object({
|
|
control_space_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFS golden question evidence matches
|
|
*/
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdGoldenQuestionsEvidenceMatchesResponse =
|
|
zKnowledgeFsGoldenQuestionEvidenceMatchResponse
|
|
|
|
export const zDeleteKnowledgeFsSpacesByControlSpaceIdGoldenQuestionsByQuestionIdPath = z.object({
|
|
control_space_id: z.string(),
|
|
question_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFS golden question deleted
|
|
*/
|
|
export const zDeleteKnowledgeFsSpacesByControlSpaceIdGoldenQuestionsByQuestionIdResponse = z.void()
|
|
|
|
export const zPatchKnowledgeFsSpacesByControlSpaceIdGoldenQuestionsByQuestionIdBody =
|
|
zKnowledgeFsGoldenQuestionPayload
|
|
|
|
export const zPatchKnowledgeFsSpacesByControlSpaceIdGoldenQuestionsByQuestionIdPath = z.object({
|
|
control_space_id: z.string(),
|
|
question_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFS golden question updated
|
|
*/
|
|
export const zPatchKnowledgeFsSpacesByControlSpaceIdGoldenQuestionsByQuestionIdResponse =
|
|
zKnowledgeFsGoldenQuestionResponse
|
|
|
|
export const zDeleteKnowledgeFsSpacesByControlSpaceIdJobsByJobIdPath = z.object({
|
|
control_space_id: z.string(),
|
|
job_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFS compilation job canceled
|
|
*/
|
|
export const zDeleteKnowledgeFsSpacesByControlSpaceIdJobsByJobIdResponse =
|
|
zKnowledgeFsDocumentCompilationJobResponse
|
|
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdJobsByJobIdPath = z.object({
|
|
control_space_id: z.string(),
|
|
job_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFS compilation job
|
|
*/
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdJobsByJobIdResponse =
|
|
zKnowledgeFsDocumentCompilationJobResponse
|
|
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdJobsByJobIdRetryPath = z.object({
|
|
control_space_id: z.string(),
|
|
job_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFS compilation job retried
|
|
*/
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdJobsByJobIdRetryResponse =
|
|
zKnowledgeFsDocumentCompilationJobResponse
|
|
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdLogicalDocumentsPath = z.object({
|
|
control_space_id: z.string(),
|
|
})
|
|
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdLogicalDocumentsQuery = z.object({
|
|
cursor: z.string().min(1).max(1000).optional(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFS logical documents
|
|
*/
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdLogicalDocumentsResponse =
|
|
zKnowledgeFsLogicalDocumentListResponse
|
|
|
|
export const zPatchKnowledgeFsSpacesByControlSpaceIdLogicalDocumentsBody =
|
|
zKnowledgeFsBulkDocumentAvailabilityPayload
|
|
|
|
export const zPatchKnowledgeFsSpacesByControlSpaceIdLogicalDocumentsPath = z.object({
|
|
control_space_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFS logical document availability updated
|
|
*/
|
|
export const zPatchKnowledgeFsSpacesByControlSpaceIdLogicalDocumentsResponse =
|
|
zKnowledgeFsBulkDocumentAvailabilityResponse
|
|
|
|
export const zDeleteKnowledgeFsSpacesByControlSpaceIdLogicalDocumentsBulkBody =
|
|
zKnowledgeFsBulkLogicalDocumentDeletePayload
|
|
|
|
export const zDeleteKnowledgeFsSpacesByControlSpaceIdLogicalDocumentsBulkHeaders = z.object({
|
|
'Idempotency-Key': z.string().min(8).max(255),
|
|
})
|
|
|
|
export const zDeleteKnowledgeFsSpacesByControlSpaceIdLogicalDocumentsBulkPath = z.object({
|
|
control_space_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFS logical document deletions accepted
|
|
*/
|
|
export const zDeleteKnowledgeFsSpacesByControlSpaceIdLogicalDocumentsBulkResponse =
|
|
zKnowledgeFsBulkDeletionAcceptedResponse
|
|
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdLogicalDocumentsDownloadZipBody =
|
|
zKnowledgeFsDocumentBatchDownloadPayload
|
|
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdLogicalDocumentsDownloadZipPath = z.object({
|
|
control_space_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFS logical documents ZIP
|
|
*/
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdLogicalDocumentsDownloadZipResponse =
|
|
zBinaryFileResponse
|
|
|
|
export const zDeleteKnowledgeFsSpacesByControlSpaceIdLogicalDocumentsByDocumentIdBody =
|
|
zKnowledgeFsLogicalDocumentDeletePayload
|
|
|
|
export const zDeleteKnowledgeFsSpacesByControlSpaceIdLogicalDocumentsByDocumentIdHeaders = z.object(
|
|
{
|
|
'Idempotency-Key': z.string().min(8).max(255),
|
|
},
|
|
)
|
|
|
|
export const zDeleteKnowledgeFsSpacesByControlSpaceIdLogicalDocumentsByDocumentIdPath = z.object({
|
|
control_space_id: z.string(),
|
|
document_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFS logical document deletion accepted
|
|
*/
|
|
export const zDeleteKnowledgeFsSpacesByControlSpaceIdLogicalDocumentsByDocumentIdResponse =
|
|
zKnowledgeFsDurableDeletionAcceptedResponse
|
|
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdLogicalDocumentsByDocumentIdPath = z.object({
|
|
control_space_id: z.string(),
|
|
document_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFS logical document
|
|
*/
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdLogicalDocumentsByDocumentIdResponse =
|
|
zKnowledgeFsLogicalDocumentResponse
|
|
|
|
export const zPatchKnowledgeFsSpacesByControlSpaceIdLogicalDocumentsByDocumentIdBody =
|
|
zKnowledgeFsDocumentAvailabilityPayload
|
|
|
|
export const zPatchKnowledgeFsSpacesByControlSpaceIdLogicalDocumentsByDocumentIdPath = z.object({
|
|
control_space_id: z.string(),
|
|
document_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFS logical document availability updated
|
|
*/
|
|
export const zPatchKnowledgeFsSpacesByControlSpaceIdLogicalDocumentsByDocumentIdResponse =
|
|
zKnowledgeFsLogicalDocumentResponse
|
|
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdLogicalDocumentsByDocumentIdDownloadPath =
|
|
z.object({
|
|
control_space_id: z.string(),
|
|
document_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFS logical document
|
|
*/
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdLogicalDocumentsByDocumentIdDownloadResponse =
|
|
zBinaryFileResponse
|
|
|
|
export const zPutKnowledgeFsSpacesByControlSpaceIdMembersBody = zKnowledgeFsMembersReplacePayload
|
|
|
|
export const zPutKnowledgeFsSpacesByControlSpaceIdMembersPath = z.object({
|
|
control_space_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFS space members replaced
|
|
*/
|
|
export const zPutKnowledgeFsSpacesByControlSpaceIdMembersResponse =
|
|
zKnowledgeFsPermissionListResponse
|
|
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdMetadataPath = z.object({
|
|
control_space_id: z.string(),
|
|
})
|
|
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdMetadataQuery = z.object({
|
|
cursor: z.string().min(1).max(1000).optional(),
|
|
limit: z.int().gte(1).lte(100).optional().default(100),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFS metadata fields
|
|
*/
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdMetadataResponse =
|
|
zKnowledgeFsMetadataFieldListResponse
|
|
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdMetadataBody =
|
|
zKnowledgeFsMetadataFieldCreatePayload
|
|
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdMetadataPath = z.object({
|
|
control_space_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFS metadata field created
|
|
*/
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdMetadataResponse =
|
|
zKnowledgeFsMetadataFieldResponse
|
|
|
|
export const zDeleteKnowledgeFsSpacesByControlSpaceIdMetadataByFieldIdPath = z.object({
|
|
control_space_id: z.string(),
|
|
field_id: z.string(),
|
|
})
|
|
|
|
export const zDeleteKnowledgeFsSpacesByControlSpaceIdMetadataByFieldIdQuery = z.object({
|
|
expectedRowVersion: z.int().gte(0),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFS metadata field deleted
|
|
*/
|
|
export const zDeleteKnowledgeFsSpacesByControlSpaceIdMetadataByFieldIdResponse =
|
|
zKnowledgeFsMetadataFieldDeleteResponse
|
|
|
|
export const zPatchKnowledgeFsSpacesByControlSpaceIdMetadataByFieldIdBody =
|
|
zKnowledgeFsMetadataFieldUpdatePayload
|
|
|
|
export const zPatchKnowledgeFsSpacesByControlSpaceIdMetadataByFieldIdPath = z.object({
|
|
control_space_id: z.string(),
|
|
field_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFS metadata field updated
|
|
*/
|
|
export const zPatchKnowledgeFsSpacesByControlSpaceIdMetadataByFieldIdResponse =
|
|
zKnowledgeFsMetadataFieldResponse
|
|
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdOverviewActivityPath = z.object({
|
|
control_space_id: z.string(),
|
|
})
|
|
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdOverviewActivityQuery = z.object({
|
|
action: z
|
|
.enum([
|
|
'document.failed',
|
|
'document.published',
|
|
'permission.updated',
|
|
'profile.published',
|
|
'query.completed',
|
|
'query.failed',
|
|
'query.requested',
|
|
'settings.updated',
|
|
'source.failed',
|
|
'source.synced',
|
|
'worker.failed',
|
|
])
|
|
.optional(),
|
|
actor_id: z.string().min(1).max(255).optional(),
|
|
actor_type: z.enum(['member', 'system']).optional(),
|
|
cursor: z.string().min(1).max(512).optional(),
|
|
from_at: z.iso.datetime().optional(),
|
|
limit: z.int().gte(1).lte(100).optional().default(50),
|
|
resource_type: z
|
|
.enum([
|
|
'document',
|
|
'knowledge-space',
|
|
'permission',
|
|
'profile',
|
|
'publication',
|
|
'query',
|
|
'source',
|
|
'worker',
|
|
])
|
|
.optional(),
|
|
result: z.enum(['canceled', 'failure', 'pending', 'success']).optional(),
|
|
to_at: z.iso.datetime().optional(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFS activity
|
|
*/
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdOverviewActivityResponse =
|
|
zKnowledgeFsOverviewActivityListResponse
|
|
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdOverviewAttentionPath = z.object({
|
|
control_space_id: z.string(),
|
|
})
|
|
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdOverviewAttentionQuery = z.object({
|
|
include_dismissed: z.boolean().optional().default(false),
|
|
limit: z.int().gte(1).lte(100).optional().default(50),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFS attention findings
|
|
*/
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdOverviewAttentionResponse =
|
|
zKnowledgeFsOverviewAttentionListResponse
|
|
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdOverviewHealthPath = z.object({
|
|
control_space_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFS health
|
|
*/
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdOverviewHealthResponse =
|
|
zKnowledgeFsOverviewHealthResponse
|
|
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdOverviewInventoryPath = z.object({
|
|
control_space_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFS inventory
|
|
*/
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdOverviewInventoryResponse =
|
|
zKnowledgeFsOverviewInventoryResponse
|
|
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdOverviewQueryOutcomesPath = z.object({
|
|
control_space_id: z.string(),
|
|
})
|
|
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdOverviewQueryOutcomesQuery = z.object({
|
|
window: z.enum(['24h', '30d', '7d']).optional().default('24h'),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFS query outcomes
|
|
*/
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdOverviewQueryOutcomesResponse =
|
|
zKnowledgeFsOverviewQueryOutcomesResponse
|
|
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdOverviewStatsPath = z.object({
|
|
control_space_id: z.string(),
|
|
})
|
|
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdOverviewStatsQuery = z.object({
|
|
window: z.enum(['24h', '30d', '7d']).optional().default('24h'),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFS Overview statistics
|
|
*/
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdOverviewStatsResponse =
|
|
zKnowledgeFsOverviewStatsResponse
|
|
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdPermissionsPath = z.object({
|
|
control_space_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFS space permissions
|
|
*/
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdPermissionsResponse =
|
|
zKnowledgeFsPermissionListResponse
|
|
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdQualityBadCasesPath = z.object({
|
|
control_space_id: z.string(),
|
|
})
|
|
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdQualityBadCasesQuery = z.object({
|
|
cursor: z.string().min(1).max(1000).optional(),
|
|
limit: z.int().gte(1).lte(100).optional().default(50),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFS bad cases
|
|
*/
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdQualityBadCasesResponse =
|
|
zKnowledgeFsBadCaseListResponse
|
|
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdQualityBadCasesBody =
|
|
zKnowledgeFsBadCaseCreatePayload
|
|
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdQualityBadCasesPath = z.object({
|
|
control_space_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFS bad case created
|
|
*/
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdQualityBadCasesResponse =
|
|
zKnowledgeFsBadCaseResponse
|
|
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdQualityBadCasesByBadCaseIdPath = z.object({
|
|
bad_case_id: z.string(),
|
|
control_space_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFS bad case
|
|
*/
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdQualityBadCasesByBadCaseIdResponse =
|
|
zKnowledgeFsBadCaseResponse
|
|
|
|
export const zPatchKnowledgeFsSpacesByControlSpaceIdQualityBadCasesByBadCaseIdBody =
|
|
zKnowledgeFsBadCaseUpdatePayload
|
|
|
|
export const zPatchKnowledgeFsSpacesByControlSpaceIdQualityBadCasesByBadCaseIdPath = z.object({
|
|
bad_case_id: z.string(),
|
|
control_space_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFS bad case updated
|
|
*/
|
|
export const zPatchKnowledgeFsSpacesByControlSpaceIdQualityBadCasesByBadCaseIdResponse =
|
|
zKnowledgeFsBadCaseResponse
|
|
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdQualityBadCasesByBadCaseIdTraceReferencePath =
|
|
z.object({
|
|
bad_case_id: z.string(),
|
|
control_space_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFS bad case trace reference
|
|
*/
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdQualityBadCasesByBadCaseIdTraceReferenceResponse =
|
|
zKnowledgeFsBadCaseTraceReferenceResponse
|
|
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdQualityReplayRunsPath = z.object({
|
|
control_space_id: z.string(),
|
|
})
|
|
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdQualityReplayRunsQuery = z.object({
|
|
cursor: z.string().max(1000).optional(),
|
|
limit: z.int().gte(1).lte(100).optional().default(20),
|
|
mode: z.enum(['deep', 'fast', 'research']).optional(),
|
|
state: z.enum(['canceled', 'failed', 'passed', 'queued', 'running']).optional(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFS quality replay history
|
|
*/
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdQualityReplayRunsResponse =
|
|
zKnowledgeFsQualityReplayListResponse
|
|
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdQualityReplayRunsBody =
|
|
zKnowledgeFsQualityReplayPayload
|
|
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdQualityReplayRunsHeaders = z.object({
|
|
'Idempotency-Key': z.string().min(8).max(255),
|
|
})
|
|
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdQualityReplayRunsPath = z.object({
|
|
control_space_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFS quality replay queued
|
|
*/
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdQualityReplayRunsResponse =
|
|
zKnowledgeFsQualityReplayResponse
|
|
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdQualityReplayRunsByRunIdPath = z.object({
|
|
control_space_id: z.string(),
|
|
run_id: z.string(),
|
|
})
|
|
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdQualityReplayRunsByRunIdQuery = z.object({
|
|
evidence_item_id: z.uuid().optional(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFS quality replay run
|
|
*/
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdQualityReplayRunsByRunIdResponse =
|
|
zKnowledgeFsQualityReplayResponse
|
|
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdQueriesBody = zKnowledgeFsQueryCreatePayload
|
|
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdQueriesPath = z.object({
|
|
control_space_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFS query accepted
|
|
*/
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdQueriesResponse = zKnowledgeFsQueryResponse
|
|
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdQueriesAdmissionBody =
|
|
zKnowledgeFsQueryCreatePayload
|
|
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdQueriesAdmissionPath = z.object({
|
|
control_space_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFS streaming query admitted through Dify API
|
|
*/
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdQueriesAdmissionResponse =
|
|
zKnowledgeFsQueryAdmissionResponse
|
|
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdQueryStreamCapabilityPath = z.object({
|
|
control_space_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFS Dify API query stream capability
|
|
*/
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdQueryStreamCapabilityResponse =
|
|
zKnowledgeFsQueryStreamCapabilityResponse
|
|
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdResearchTasksPath = z.object({
|
|
control_space_id: z.string(),
|
|
})
|
|
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdResearchTasksQuery = z.object({
|
|
cursor: z.string().min(1).max(1000).optional(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFS research tasks
|
|
*/
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdResearchTasksResponse =
|
|
zKnowledgeFsResearchTaskListResponse
|
|
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdResearchTasksBody =
|
|
zKnowledgeFsResearchTaskCreatePayload
|
|
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdResearchTasksPath = z.object({
|
|
control_space_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFS research task accepted
|
|
*/
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdResearchTasksResponse =
|
|
zKnowledgeFsResearchTaskResponse
|
|
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdResearchTasksPlanBody =
|
|
zKnowledgeFsResearchTaskPlanPayload
|
|
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdResearchTasksPlanPath = z.object({
|
|
control_space_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFS research task plan
|
|
*/
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdResearchTasksPlanResponse =
|
|
zKnowledgeFsResearchTaskPlanResponse
|
|
|
|
export const zDeleteKnowledgeFsSpacesByControlSpaceIdResearchTasksByTaskIdPath = z.object({
|
|
control_space_id: z.string(),
|
|
task_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFS research task canceled
|
|
*/
|
|
export const zDeleteKnowledgeFsSpacesByControlSpaceIdResearchTasksByTaskIdResponse =
|
|
zKnowledgeFsResearchTaskResponse
|
|
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdResearchTasksByTaskIdPath = z.object({
|
|
control_space_id: z.string(),
|
|
task_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFS research task
|
|
*/
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdResearchTasksByTaskIdResponse =
|
|
zKnowledgeFsResearchTaskResponse
|
|
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdResearchTasksByTaskIdPartialsPath = z.object({
|
|
control_space_id: z.string(),
|
|
task_id: z.string(),
|
|
})
|
|
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdResearchTasksByTaskIdPartialsQuery = z.object({
|
|
cursor: z.string().min(1).max(1000).optional(),
|
|
limit: z.int().gte(1).lte(100).optional().default(25),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFS research task partial evidence
|
|
*/
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdResearchTasksByTaskIdPartialsResponse =
|
|
zKnowledgeFsResearchTaskPartialListResponse
|
|
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdSettingsPath = z.object({
|
|
control_space_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFS settings
|
|
*/
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdSettingsResponse = zKnowledgeFsSettingsResponse
|
|
|
|
export const zPatchKnowledgeFsSpacesByControlSpaceIdSettingsBody = zKnowledgeFsSettingsPayload
|
|
|
|
export const zPatchKnowledgeFsSpacesByControlSpaceIdSettingsPath = z.object({
|
|
control_space_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFS settings updated
|
|
*/
|
|
export const zPatchKnowledgeFsSpacesByControlSpaceIdSettingsResponse =
|
|
zKnowledgeFsSettingsUpdateResponse
|
|
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdSettingsMigrationsByMigrationIdPath = z.object({
|
|
control_space_id: z.string(),
|
|
migration_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFS settings migration
|
|
*/
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdSettingsMigrationsByMigrationIdResponse =
|
|
zKnowledgeFsProfileMigrationResponse
|
|
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdSourceConnectionsPath = z.object({
|
|
control_space_id: z.string(),
|
|
})
|
|
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdSourceConnectionsQuery = z.object({
|
|
cursor: z.string().min(1).max(4096).optional(),
|
|
limit: z.int().gte(1).lte(200).optional().default(50),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFS source connections
|
|
*/
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdSourceConnectionsResponse =
|
|
zKnowledgeFsSourceConnectionListResponse
|
|
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdSourceConnectionsBody =
|
|
zKnowledgeFsSourceConnectionCreatePayload
|
|
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdSourceConnectionsPath = z.object({
|
|
control_space_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFS source connection created
|
|
*/
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdSourceConnectionsResponse =
|
|
zKnowledgeFsSourceConnectionResponse
|
|
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdSourceConnectionsByConnectionIdRefreshBody =
|
|
zKnowledgeFsSourceConnectionRefreshPayload
|
|
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdSourceConnectionsByConnectionIdRefreshPath =
|
|
z.object({
|
|
connection_id: z.string(),
|
|
control_space_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFS source connection refreshed
|
|
*/
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdSourceConnectionsByConnectionIdRefreshResponse =
|
|
zKnowledgeFsSourceConnectionResponse
|
|
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdSourceProvidersPath = z.object({
|
|
control_space_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFS source providers
|
|
*/
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdSourceProvidersResponse =
|
|
zKnowledgeFsSourceProviderListResponse
|
|
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdSourceWorkflowsByRunIdPath = z.object({
|
|
control_space_id: z.string(),
|
|
run_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFS source workflow
|
|
*/
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdSourceWorkflowsByRunIdResponse =
|
|
zKnowledgeFsSourceWorkflowResponse
|
|
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdSourceWorkflowsByRunIdCancelBody =
|
|
zKnowledgeFsSourceWorkflowCancelPayload
|
|
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdSourceWorkflowsByRunIdCancelPath = z.object({
|
|
control_space_id: z.string(),
|
|
run_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFS source workflow canceled
|
|
*/
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdSourceWorkflowsByRunIdCancelResponse =
|
|
zKnowledgeFsSourceWorkflowResponse
|
|
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdSourceWorkflowsByRunIdPagesPath = z.object({
|
|
control_space_id: z.string(),
|
|
run_id: z.string(),
|
|
})
|
|
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdSourceWorkflowsByRunIdPagesQuery = z.object({
|
|
cursor: z.string().min(1).max(4096).optional(),
|
|
limit: z.int().gte(1).lte(200).optional().default(50),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFS crawl preview pages
|
|
*/
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdSourceWorkflowsByRunIdPagesResponse =
|
|
zKnowledgeFsCrawlPreviewPageListResponse
|
|
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdSourceWorkflowsByRunIdRetryPath = z.object({
|
|
control_space_id: z.string(),
|
|
run_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFS source workflow retried
|
|
*/
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdSourceWorkflowsByRunIdRetryResponse =
|
|
zKnowledgeFsSourceWorkflowResponse
|
|
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdSourceWorkflowsByRunIdSelectionBody =
|
|
zKnowledgeFsCrawlPreviewSelectionPayload
|
|
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdSourceWorkflowsByRunIdSelectionHeaders =
|
|
z.object({
|
|
'Idempotency-Key': z.string().min(8).max(255),
|
|
})
|
|
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdSourceWorkflowsByRunIdSelectionPath = z.object({
|
|
control_space_id: z.string(),
|
|
run_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFS crawl preview selection accepted
|
|
*/
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdSourceWorkflowsByRunIdSelectionResponse =
|
|
zKnowledgeFsSourceWorkflowResponse
|
|
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdSourcesPath = z.object({
|
|
control_space_id: z.string(),
|
|
})
|
|
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdSourcesQuery = z.object({
|
|
cursor: z.string().min(1).max(1000).optional(),
|
|
limit: z.int().gte(1).lte(200).optional().default(50),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFS sources
|
|
*/
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdSourcesResponse = zKnowledgeFsSourceListResponse
|
|
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdSourcesBody = zKnowledgeFsSourceCreatePayload
|
|
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdSourcesPath = z.object({
|
|
control_space_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFS source created
|
|
*/
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdSourcesResponse = zKnowledgeFsSourceResponse
|
|
|
|
export const zDeleteKnowledgeFsSpacesByControlSpaceIdSourcesBySourceIdBody =
|
|
zKnowledgeFsSourceDeletePayload
|
|
|
|
export const zDeleteKnowledgeFsSpacesByControlSpaceIdSourcesBySourceIdHeaders = z.object({
|
|
'Idempotency-Key': z.string().min(8).max(255),
|
|
})
|
|
|
|
export const zDeleteKnowledgeFsSpacesByControlSpaceIdSourcesBySourceIdPath = z.object({
|
|
control_space_id: z.string(),
|
|
source_id: z.string(),
|
|
})
|
|
|
|
export const zDeleteKnowledgeFsSpacesByControlSpaceIdSourcesBySourceIdQuery = z.object({
|
|
documents: z.enum(['cascade', 'keep']).optional().default('cascade'),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFS source deletion accepted
|
|
*/
|
|
export const zDeleteKnowledgeFsSpacesByControlSpaceIdSourcesBySourceIdResponse =
|
|
zKnowledgeFsDurableDeletionAcceptedResponse
|
|
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdSourcesBySourceIdPath = z.object({
|
|
control_space_id: z.string(),
|
|
source_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFS source
|
|
*/
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdSourcesBySourceIdResponse =
|
|
zKnowledgeFsSourceResponse
|
|
|
|
export const zPatchKnowledgeFsSpacesByControlSpaceIdSourcesBySourceIdBody =
|
|
zKnowledgeFsSourceUpdatePayload
|
|
|
|
export const zPatchKnowledgeFsSpacesByControlSpaceIdSourcesBySourceIdPath = z.object({
|
|
control_space_id: z.string(),
|
|
source_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFS source updated
|
|
*/
|
|
export const zPatchKnowledgeFsSpacesByControlSpaceIdSourcesBySourceIdResponse =
|
|
zKnowledgeFsSourceResponse
|
|
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdSourcesBySourceIdAsyncImportBody =
|
|
zKnowledgeFsAsyncSourceImportPayload
|
|
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdSourcesBySourceIdAsyncImportHeaders = z.object({
|
|
'Idempotency-Key': z.string().min(8).max(255),
|
|
})
|
|
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdSourcesBySourceIdAsyncImportPath = z.object({
|
|
control_space_id: z.string(),
|
|
source_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFS Source import accepted for asynchronous reconciliation
|
|
*/
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdSourcesBySourceIdAsyncImportResponse =
|
|
zKnowledgeFsSourceWorkflowResponse
|
|
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdSourcesBySourceIdCrawlImportBody =
|
|
zKnowledgeFsCrawlImportPayload
|
|
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdSourcesBySourceIdCrawlImportHeaders = z.object({
|
|
'Idempotency-Key': z.string().min(8).max(255),
|
|
})
|
|
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdSourcesBySourceIdCrawlImportPath = z.object({
|
|
control_space_id: z.string(),
|
|
source_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFS selected website crawl import accepted
|
|
*/
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdSourcesBySourceIdCrawlImportResponse =
|
|
zKnowledgeFsSourceWorkflowResponse
|
|
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdSourcesBySourceIdCrawlPreviewHeaders = z.object({
|
|
'Idempotency-Key': z.string().min(8).max(255),
|
|
})
|
|
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdSourcesBySourceIdCrawlPreviewPath = z.object({
|
|
control_space_id: z.string(),
|
|
source_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFS source crawl preview accepted
|
|
*/
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdSourcesBySourceIdCrawlPreviewResponse =
|
|
zKnowledgeFsSourceWorkflowResponse
|
|
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdSourcesBySourceIdFilesPath = z.object({
|
|
control_space_id: z.string(),
|
|
source_id: z.string(),
|
|
})
|
|
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdSourcesBySourceIdFilesQuery = z.object({
|
|
bucket: z.string().optional(),
|
|
continuationToken: z.string().min(1).max(4096).optional(),
|
|
maxKeys: z.int().gte(1).lte(1000).optional(),
|
|
prefix: z.string().optional(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFS source files
|
|
*/
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdSourcesBySourceIdFilesResponse =
|
|
zKnowledgeFsSourceFilesResponse
|
|
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdSourcesBySourceIdImportBody =
|
|
zKnowledgeFsSourceImportPagesPayload
|
|
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdSourcesBySourceIdImportPath = z.object({
|
|
control_space_id: z.string(),
|
|
source_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFS source pages imported
|
|
*/
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdSourcesBySourceIdImportResponse =
|
|
zKnowledgeFsSourceImportResponse
|
|
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdSourcesBySourceIdImportFilesBody =
|
|
zKnowledgeFsSourceImportFilesPayload
|
|
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdSourcesBySourceIdImportFilesPath = z.object({
|
|
control_space_id: z.string(),
|
|
source_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFS source files imported
|
|
*/
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdSourcesBySourceIdImportFilesResponse =
|
|
zKnowledgeFsSourceImportResponse
|
|
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdSourcesBySourceIdPagesPath = z.object({
|
|
control_space_id: z.string(),
|
|
source_id: z.string(),
|
|
})
|
|
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdSourcesBySourceIdPagesQuery = z.object({
|
|
cursor: z.string().min(1).max(4096).optional(),
|
|
limit: z.int().gte(1).lte(200).optional().default(50),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFS source pages
|
|
*/
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdSourcesBySourceIdPagesResponse =
|
|
zKnowledgeFsSourcePagesResponse
|
|
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdSourcesBySourceIdSyncHeaders = z.object({
|
|
'Idempotency-Key': z.string().min(8).max(255),
|
|
})
|
|
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdSourcesBySourceIdSyncPath = z.object({
|
|
control_space_id: z.string(),
|
|
source_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFS source sync accepted
|
|
*/
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdSourcesBySourceIdSyncResponse =
|
|
zKnowledgeFsSourceWorkflowResponse
|
|
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdSourcesBySourceIdSyncPolicyPath = z.object({
|
|
control_space_id: z.string(),
|
|
source_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFS source sync policy
|
|
*/
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdSourcesBySourceIdSyncPolicyResponse =
|
|
zKnowledgeFsSourceSyncPolicyResponse
|
|
|
|
export const zPutKnowledgeFsSpacesByControlSpaceIdSourcesBySourceIdSyncPolicyBody =
|
|
zKnowledgeFsSourceSyncPolicyPayload
|
|
|
|
export const zPutKnowledgeFsSpacesByControlSpaceIdSourcesBySourceIdSyncPolicyPath = z.object({
|
|
control_space_id: z.string(),
|
|
source_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFS source sync policy updated
|
|
*/
|
|
export const zPutKnowledgeFsSpacesByControlSpaceIdSourcesBySourceIdSyncPolicyResponse =
|
|
zKnowledgeFsSourceSyncPolicyResponse
|
|
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdSourcesBySourceIdTestPath = z.object({
|
|
control_space_id: z.string(),
|
|
source_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFS source credential test
|
|
*/
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdSourcesBySourceIdTestResponse =
|
|
zKnowledgeFsSourceCredentialTestResponse
|
|
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdSourcesBySourceIdWorkflowImportsBody =
|
|
zKnowledgeFsSourceWorkflowImportPayload
|
|
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdSourcesBySourceIdWorkflowImportsHeaders =
|
|
z.object({
|
|
'Idempotency-Key': z.string().min(8).max(255),
|
|
})
|
|
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdSourcesBySourceIdWorkflowImportsPath = z.object({
|
|
control_space_id: z.string(),
|
|
source_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFS durable provider import accepted
|
|
*/
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdSourcesBySourceIdWorkflowImportsResponse =
|
|
zKnowledgeFsSourceWorkflowResponse
|
|
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdTagsPath = z.object({
|
|
control_space_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFS space tags
|
|
*/
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdTagsResponse = zKnowledgeFsSpaceTagListResponse
|
|
|
|
export const zPutKnowledgeFsSpacesByControlSpaceIdTagsBody = zKnowledgeFsSpaceTagsReplacePayload
|
|
|
|
export const zPutKnowledgeFsSpacesByControlSpaceIdTagsPath = z.object({
|
|
control_space_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFS space tags replaced
|
|
*/
|
|
export const zPutKnowledgeFsSpacesByControlSpaceIdTagsResponse = zKnowledgeFsSpaceTagListResponse
|
|
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdTracesPath = z.object({
|
|
control_space_id: z.string(),
|
|
})
|
|
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdTracesQuery = z.object({
|
|
cursor: z.string().min(1).max(1000).optional(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFS traces
|
|
*/
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdTracesResponse = zKnowledgeFsTraceListResponse
|
|
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdTracesByTraceIdPath = z.object({
|
|
control_space_id: z.string(),
|
|
trace_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFS answer trace
|
|
*/
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdTracesByTraceIdResponse =
|
|
zKnowledgeFsAnswerTraceResponse
|
|
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdTracesByTraceIdConflictsPath = z.object({
|
|
control_space_id: z.string(),
|
|
trace_id: z.string(),
|
|
})
|
|
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdTracesByTraceIdConflictsQuery = z.object({
|
|
cursor: z.string().min(1).max(1000).optional(),
|
|
limit: z.int().gte(1).lte(200).optional().default(100),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFS trace conflicts
|
|
*/
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdTracesByTraceIdConflictsResponse =
|
|
zKnowledgeFsTraceEntryListResponse
|
|
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdTracesByTraceIdEvidencePath = z.object({
|
|
control_space_id: z.string(),
|
|
trace_id: z.string(),
|
|
})
|
|
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdTracesByTraceIdEvidenceQuery = z.object({
|
|
cursor: z.string().min(1).max(1000).optional(),
|
|
limit: z.int().gte(1).lte(200).optional().default(100),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFS trace evidence view
|
|
*/
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdTracesByTraceIdEvidenceResponse =
|
|
zKnowledgeFsTraceEntryListResponse
|
|
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdTracesByTraceIdMissingPath = z.object({
|
|
control_space_id: z.string(),
|
|
trace_id: z.string(),
|
|
})
|
|
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdTracesByTraceIdMissingQuery = z.object({
|
|
cursor: z.string().min(1).max(1000).optional(),
|
|
limit: z.int().gte(1).lte(200).optional().default(100),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFS trace missing evidence
|
|
*/
|
|
export const zGetKnowledgeFsSpacesByControlSpaceIdTracesByTraceIdMissingResponse =
|
|
zKnowledgeFsTraceEntryListResponse
|
|
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdUploadSessionsBody =
|
|
zKnowledgeFsUploadSessionCreatePayload
|
|
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdUploadSessionsHeaders = z.object({
|
|
'Idempotency-Key': z.string().min(8).max(255),
|
|
})
|
|
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdUploadSessionsPath = z.object({
|
|
control_space_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFS upload session created
|
|
*/
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdUploadSessionsResponse =
|
|
zKnowledgeFsUploadSessionCreateResponse
|
|
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdUploadSessionsByUploadSessionIdAbortBody =
|
|
zKnowledgeFsUploadSessionAbortPayload
|
|
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdUploadSessionsByUploadSessionIdAbortPath =
|
|
z.object({
|
|
control_space_id: z.string(),
|
|
upload_session_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFS upload session aborted
|
|
*/
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdUploadSessionsByUploadSessionIdAbortResponse =
|
|
zKnowledgeFsUploadSessionMutationResponse
|
|
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdUploadSessionsByUploadSessionIdCompleteBody =
|
|
zKnowledgeFsUploadSessionCompletePayload
|
|
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdUploadSessionsByUploadSessionIdCompletePath =
|
|
z.object({
|
|
control_space_id: z.string(),
|
|
upload_session_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFS upload session completed
|
|
*/
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdUploadSessionsByUploadSessionIdCompleteResponse =
|
|
zKnowledgeFsUploadSessionMutationResponse
|
|
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdUploadSessionsByUploadSessionIdPartsByPartNumberPresignBody =
|
|
zKnowledgeFsUploadPartPresignPayload
|
|
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdUploadSessionsByUploadSessionIdPartsByPartNumberPresignPath =
|
|
z.object({
|
|
control_space_id: z.string(),
|
|
part_number: z.int(),
|
|
upload_session_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFS upload part URL created
|
|
*/
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdUploadSessionsByUploadSessionIdPartsByPartNumberPresignResponse =
|
|
zKnowledgeFsPresignedUploadResponse
|
|
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdUploadSessionsByUploadSessionIdSmallFileBody =
|
|
z.object({
|
|
file: z.custom<Blob | File>((value) => value instanceof Blob || value instanceof File),
|
|
})
|
|
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdUploadSessionsByUploadSessionIdSmallFilePath =
|
|
z.object({
|
|
control_space_id: z.string(),
|
|
upload_session_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFS small-file fallback completed
|
|
*/
|
|
export const zPostKnowledgeFsSpacesByControlSpaceIdUploadSessionsByUploadSessionIdSmallFileResponse =
|
|
zKnowledgeFsSmallFileUploadResponse
|
|
|
|
export const zPostKnowledgeFsTasksByTaskIdStreamCapabilityBody = zKnowledgeFsStreamCapabilityPayload
|
|
|
|
export const zPostKnowledgeFsTasksByTaskIdStreamCapabilityPath = z.object({
|
|
task_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFS task stream capability
|
|
*/
|
|
export const zPostKnowledgeFsTasksByTaskIdStreamCapabilityResponse =
|
|
zKnowledgeFsStreamCapabilityResponse
|
|
|
|
export const zPostKnowledgeFsUploadsBody = z.object({
|
|
file: z.custom<Blob | File>((value) => value instanceof Blob || value instanceof File),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFS document bytes staged in the current workspace
|
|
*/
|
|
export const zPostKnowledgeFsUploadsResponse = zKnowledgeFsStagedUploadResponse
|
|
|
|
export const zDeleteKnowledgeFsUploadsByUploadIdPath = z.object({
|
|
upload_id: z.string(),
|
|
})
|
|
|
|
/**
|
|
* KnowledgeFS staged upload discarded
|
|
*/
|
|
export const zDeleteKnowledgeFsUploadsByUploadIdResponse = z.void()
|