import { APIResource } from "../../core/resource.js"; import * as FilesAPI from "../files.js"; import * as KnowledgeBasesAPI from "./knowledge-bases.js"; import * as UsersAPI from "../users/users.js"; import { APIPromise } from "../../core/api-promise.js"; import { RequestOptions } from "../../internal/request-options.js"; export declare class Files extends APIResource { /** * Get a paginated list of files that belong to a specific knowledge base. * * - Requires KNOWLEDGE_BASE_READ permission * - Returns the same file structure as the global file list * - Supports pagination and basic filtering by file type and search keyword */ list(id: string, query?: FileListParams | null | undefined, options?: RequestOptions): APIPromise; /** * Create associations between a knowledge base and multiple files. * * - Requires KNOWLEDGE_BASE_UPDATE permission * - Ignores duplicate associations (on conflict do nothing) * - Only files owned by the current user are processed */ batchAdd(id: string, body: FileBatchAddParams, options?: RequestOptions): APIPromise; /** * Remove associations between a knowledge base and multiple files. * * - Requires KNOWLEDGE_BASE_UPDATE permission * - Ignores records that are not linked to the knowledge base */ batchRemove(id: string, body: FileBatchRemoveParams, options?: RequestOptions): APIPromise; /** * Move multiple files from the source knowledge base to a target knowledge base. * * - Requires KNOWLEDGE_BASE_UPDATE permission * - Removes links from the source knowledge base * - Existing links in the target knowledge base are skipped without error */ move(id: string, body: FileMoveParams, options?: RequestOptions): APIPromise; } export interface KBAPIResponseFileList extends UsersAPI.APIResponseBase { data?: KBAPIResponseFileList.Data; } export declare namespace KBAPIResponseFileList { interface Data { files: Array; total: number; /** * Total size in bytes of all matched files */ totalSize?: string; } } export interface KBAPIResponseFileOperation extends UsersAPI.APIResponseBase { data: KnowledgeBasesAPI.KnowledgeBaseFileOperationResult; } export interface KBAPIResponseMoveFiles extends UsersAPI.APIResponseBase { data: KnowledgeBasesAPI.MoveKnowledgeBaseFilesResult; } export interface KBFile { id?: string; chunking?: KBFile.Chunking | null; createdAt?: string | null; embedding?: KBFile.Embedding | null; fileHash?: string | null; fileType?: string | null; knowledgeBaseId?: string | null; knowledgeBases?: Array | null; metadata?: { [key: string]: unknown; } | null; name?: string | null; size?: number | null; updatedAt?: string | null; url?: string | null; userId?: string | null; } export declare namespace KBFile { interface Chunking { id?: string | null; /** * Chunk count for the related file (only for chunking tasks) */ count?: number | null; error?: Chunking.Error | null; status?: 'pending' | 'processing' | 'success' | 'error' | null; type?: 'chunk' | 'embedding' | 'image_generation' | null; } namespace Chunking { interface Error { body: Error.Body; name: string; } namespace Error { interface Body { detail: string; } } } interface Embedding { id?: string | null; /** * Chunk count for the related file (only for chunking tasks) */ count?: number | null; error?: Embedding.Error | null; status?: 'pending' | 'processing' | 'success' | 'error' | null; type?: 'chunk' | 'embedding' | 'image_generation' | null; } namespace Embedding { interface Error { body: Error.Body; name: string; } namespace Error { interface Body { detail: string; } } } interface KnowledgeBase { id: string; name: string; avatar?: string | null; description?: string | null; } } export interface FileListParams { /** * Filter by file type (e.g., 'image/', 'application/pdf') */ fileType?: string; /** * Search keyword for file name (case-insensitive) */ keyword?: string; /** * Page number (default 1) */ page?: number; /** * Items per page (default 20, max 100) */ pageSize?: number; } export interface FileBatchAddParams { /** * Array of file IDs to associate */ fileIds: Array; } export interface FileBatchRemoveParams { /** * Array of file IDs to detach */ fileIds: Array; } export interface FileMoveParams { /** * Array of file IDs to move */ fileIds: Array; /** * Target knowledge base ID */ targetKnowledgeBaseId: string; } export declare namespace Files { export { type KBAPIResponseFileList as KBAPIResponseFileList, type KBAPIResponseFileOperation as KBAPIResponseFileOperation, type KBAPIResponseMoveFiles as KBAPIResponseMoveFiles, type KBFile as KBFile, type FileListParams as FileListParams, type FileBatchAddParams as FileBatchAddParams, type FileBatchRemoveParams as FileBatchRemoveParams, type FileMoveParams as FileMoveParams, }; } //# sourceMappingURL=files.d.ts.map