@ontos-ai/knowhere-sdk 2.4.2 → 2.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -0
- package/dist/chunk-4PWLXJGH.mjs +719 -0
- package/dist/index.d.mts +30 -2
- package/dist/index.d.ts +30 -2
- package/dist/index.js +1051 -513
- package/dist/index.mjs +127 -446
- package/dist/sequential-parsed-document-archive-S56UEARH.mjs +139 -0
- package/package.json +5 -2
package/dist/index.d.mts
CHANGED
|
@@ -441,6 +441,11 @@ interface ParsedDocumentWriteObjectParams extends ParsedDocumentObjectParams {
|
|
|
441
441
|
readonly contentType: string;
|
|
442
442
|
readonly metadata?: Readonly<Record<string, string>>;
|
|
443
443
|
}
|
|
444
|
+
/** Stream sinks must consume the body before resolving and reject partial writes. */
|
|
445
|
+
interface ParsedDocumentWriteObjectStreamParams extends Omit<ParsedDocumentWriteObjectParams, 'body'> {
|
|
446
|
+
readonly body: ReadableStream<Uint8Array>;
|
|
447
|
+
readonly signal?: AbortSignal;
|
|
448
|
+
}
|
|
444
449
|
interface ParsedDocumentWriteObjectResult extends ParsedDocumentObjectParams {
|
|
445
450
|
readonly url?: string;
|
|
446
451
|
}
|
|
@@ -456,6 +461,11 @@ interface ParsedDocumentSyncProgress {
|
|
|
456
461
|
readonly documentId: string;
|
|
457
462
|
readonly revisionKey: string;
|
|
458
463
|
readonly nextChunkPage?: number;
|
|
464
|
+
readonly pinnedRevisionKey?: string;
|
|
465
|
+
readonly archiveIdentity?: string;
|
|
466
|
+
readonly nextArchiveEntry?: number;
|
|
467
|
+
/** Content hashes for verifying a sequential retry without a strong HTTP validator. */
|
|
468
|
+
readonly archiveEntryHashes?: readonly string[];
|
|
459
469
|
readonly status: 'running' | 'completed' | 'failed';
|
|
460
470
|
readonly updatedAt: string;
|
|
461
471
|
readonly error?: string;
|
|
@@ -463,6 +473,7 @@ interface ParsedDocumentSyncProgress {
|
|
|
463
473
|
interface ParsedDocumentStorage {
|
|
464
474
|
readObject(params: ParsedDocumentObjectParams): Promise<ParsedDocumentObject | null>;
|
|
465
475
|
writeObject(params: ParsedDocumentWriteObjectParams): Promise<ParsedDocumentWriteObjectResult>;
|
|
476
|
+
writeObjectStream?(params: ParsedDocumentWriteObjectStreamParams): Promise<ParsedDocumentWriteObjectResult>;
|
|
466
477
|
headObject?(params: ParsedDocumentObjectParams): Promise<ParsedDocumentObjectHead | null>;
|
|
467
478
|
getObjectUrl?(params: ParsedDocumentObjectParams): Promise<string | null>;
|
|
468
479
|
deletePrefix?(params: ParsedDocumentRevisionParams): Promise<void>;
|
|
@@ -473,6 +484,10 @@ interface ParsedDocumentSyncScheduler {
|
|
|
473
484
|
schedule(task: () => Promise<void>): void | Promise<void>;
|
|
474
485
|
}
|
|
475
486
|
interface ParsedDocumentStorageLimits {
|
|
487
|
+
/** ZIP entries copied per invocation (default 100). */
|
|
488
|
+
readonly maxEntriesPerSync?: number;
|
|
489
|
+
/** ZIP copy budget checked between entries (default 120000ms). */
|
|
490
|
+
readonly archiveSyncDeadlineMs?: number;
|
|
476
491
|
readonly remotePageSize?: number;
|
|
477
492
|
readonly maxPagesPerSync?: number;
|
|
478
493
|
readonly syncDeadlineMs?: number;
|
|
@@ -1303,7 +1318,11 @@ interface KnowledgeDocumentReference {
|
|
|
1303
1318
|
revisionKey?: string;
|
|
1304
1319
|
}
|
|
1305
1320
|
type KnowledgeParsedStorageOptions = ParsedDocumentStorageConfig;
|
|
1306
|
-
|
|
1321
|
+
interface KnowledgeSyncParsedDocumentParams extends KnowledgeDocumentReference {
|
|
1322
|
+
readonly signal?: AbortSignal;
|
|
1323
|
+
/** Optionally retain the exact source ZIP as result.zip after committing the snapshot. */
|
|
1324
|
+
readonly retainResultArchive?: boolean;
|
|
1325
|
+
}
|
|
1307
1326
|
interface KnowledgeSyncParsedDocumentResponse {
|
|
1308
1327
|
documentId: string;
|
|
1309
1328
|
revisionKey: string;
|
|
@@ -1617,6 +1636,8 @@ declare function syncParseResultToParsedDocumentStorage(params: {
|
|
|
1617
1636
|
readonly documentId?: string;
|
|
1618
1637
|
readonly revisionKey?: string;
|
|
1619
1638
|
readonly source?: ParsedDocumentCommitSource;
|
|
1639
|
+
readonly signal?: AbortSignal;
|
|
1640
|
+
readonly beforeCommit?: () => Promise<void>;
|
|
1620
1641
|
}): Promise<{
|
|
1621
1642
|
readonly result: ParseResult;
|
|
1622
1643
|
readonly documentId: string;
|
|
@@ -1753,4 +1774,11 @@ declare class JobFailedError extends KnowhereError {
|
|
|
1753
1774
|
constructor(message: string, code: string, jobResult: JobResult);
|
|
1754
1775
|
}
|
|
1755
1776
|
|
|
1756
|
-
|
|
1777
|
+
/** The sequential ZIP fallback could not access its SDK-owned temporary storage. */
|
|
1778
|
+
declare class ParsedDocumentArchiveError extends KnowhereError {
|
|
1779
|
+
readonly code: "ARCHIVE_SPOOL_FAILED";
|
|
1780
|
+
readonly cause: unknown;
|
|
1781
|
+
constructor(cause: unknown);
|
|
1782
|
+
}
|
|
1783
|
+
|
|
1784
|
+
export { APIError, type AuthTokenProvider, AuthenticationError, BadRequestError, type BaseChunk, ChecksumError, type Chunk, ConflictError, type CreateJobParams, DiskParsedDocumentStorage, type DocType, type Document, type DocumentChunk, type DocumentChunkGetParams, type DocumentChunkListParams, type DocumentChunkListResponse, type DocumentChunkPagination, type DocumentChunkResponse, type DocumentChunkType, type DocumentListPagination, type DocumentListParams, type DocumentListResponse, type DocumentMetadata, type DocumentPageCitationSource, Documents, type FileIndex, GatewayTimeoutError, type ImageChunk, InternalServerError, InvalidStateError, type Job, type JobError, JobFailedError, type JobResult, type JobStatus, Jobs, Knowhere, type KnowhereAssetStorageAdapter, type KnowhereAssetStorageBody, type KnowhereAssetStorageHead, type KnowhereAssetStorageObject, type KnowhereAssetStorageOptions, type KnowhereAssetStorageResult, type KnowhereAssetStorageWriteResult, KnowhereError, type KnowhereOptions, Knowledge, type KnowledgeAsyncJobStatusResponse, type KnowledgeAsyncParseParams, type KnowledgeAsyncParseResponse, type KnowledgeCacheDocumentParams, type KnowledgeCacheJobResultParams, type KnowledgeChunkType, type KnowledgeDocumentReference, type KnowledgeGrepMatch, type KnowledgeGrepParams, type KnowledgeGrepResponse, type KnowledgeImportJobResultParams, type KnowledgeJobResultResponse, type KnowledgeLoadJobResultParams, type KnowledgeOutline, type KnowledgeParseParams, type KnowledgeParsedStorageOptions, type KnowledgeReadChunk, type KnowledgeReadParams, type KnowledgeReadResponse, type KnowledgeSearchParams, type KnowledgeSearchReference, type KnowledgeSearchResponse, type KnowledgeSearchResult, type KnowledgeSection, type KnowledgeStartupRecoveryResponse, type KnowledgeSyncParsedDocumentParams, type KnowledgeSyncParsedDocumentResponse, type LlmConfig, type LlmModelsConfig, type LlmProviderConfig, type LoadOptions, type LocalKnowledgeDocument, type LocalKnowledgeParseResponse, LocalKnowledgeStore, type Manifest, NODE_SDK_DOCUMENT_METADATA_DEFAULTS, NetworkError, NotFoundError, type PageChunk, type PageCitationAsset, type PageCitationAssetContentType, type PageCitationAssetSource, type ParseParams, type ParseResult, ParsedDocumentArchiveError, type ParsedDocumentCommit, type ParsedDocumentCommitSource, type ParsedDocumentObject, type ParsedDocumentObjectHead, type ParsedDocumentObjectParams, type ParsedDocumentRevisionParams, type ParsedDocumentStorage, type ParsedDocumentStorageConfig, type ParsedDocumentStorageDocument, type ParsedDocumentStorageLimits, type ParsedDocumentSyncProgress, type ParsedDocumentSyncScheduler, type ParsedDocumentWriteObjectParams, type ParsedDocumentWriteObjectResult, type ParsedDocumentWriteObjectStreamParams, type ParsingModel, type ParsingParams, PaymentRequiredError, PermissionDeniedError, type PollProgress, PollingTimeoutError, RateLimitError, Retrieval, type RetrievalChannel, type RetrievalChunkType, type RetrievalEvidencePart, type RetrievalFilterMode, type RetrievalQueryParams, type RetrievalQueryResponse, type RetrievalReferencedChunk, type RetrievalResult, type RetrievalSectionExclusion, type RetrievalSource, ServiceUnavailableError, type Statistics, type TableChunk, type TextChunk, TimeoutError, type UploadParams, type UploadProgress, VERSION, ValidationError, type WaitOptions, type WebhookConfig, Knowhere as default, mergeDocumentMetadataDefaults, storeParseResultAssets, syncParseResultToParsedDocumentStorage };
|
package/dist/index.d.ts
CHANGED
|
@@ -441,6 +441,11 @@ interface ParsedDocumentWriteObjectParams extends ParsedDocumentObjectParams {
|
|
|
441
441
|
readonly contentType: string;
|
|
442
442
|
readonly metadata?: Readonly<Record<string, string>>;
|
|
443
443
|
}
|
|
444
|
+
/** Stream sinks must consume the body before resolving and reject partial writes. */
|
|
445
|
+
interface ParsedDocumentWriteObjectStreamParams extends Omit<ParsedDocumentWriteObjectParams, 'body'> {
|
|
446
|
+
readonly body: ReadableStream<Uint8Array>;
|
|
447
|
+
readonly signal?: AbortSignal;
|
|
448
|
+
}
|
|
444
449
|
interface ParsedDocumentWriteObjectResult extends ParsedDocumentObjectParams {
|
|
445
450
|
readonly url?: string;
|
|
446
451
|
}
|
|
@@ -456,6 +461,11 @@ interface ParsedDocumentSyncProgress {
|
|
|
456
461
|
readonly documentId: string;
|
|
457
462
|
readonly revisionKey: string;
|
|
458
463
|
readonly nextChunkPage?: number;
|
|
464
|
+
readonly pinnedRevisionKey?: string;
|
|
465
|
+
readonly archiveIdentity?: string;
|
|
466
|
+
readonly nextArchiveEntry?: number;
|
|
467
|
+
/** Content hashes for verifying a sequential retry without a strong HTTP validator. */
|
|
468
|
+
readonly archiveEntryHashes?: readonly string[];
|
|
459
469
|
readonly status: 'running' | 'completed' | 'failed';
|
|
460
470
|
readonly updatedAt: string;
|
|
461
471
|
readonly error?: string;
|
|
@@ -463,6 +473,7 @@ interface ParsedDocumentSyncProgress {
|
|
|
463
473
|
interface ParsedDocumentStorage {
|
|
464
474
|
readObject(params: ParsedDocumentObjectParams): Promise<ParsedDocumentObject | null>;
|
|
465
475
|
writeObject(params: ParsedDocumentWriteObjectParams): Promise<ParsedDocumentWriteObjectResult>;
|
|
476
|
+
writeObjectStream?(params: ParsedDocumentWriteObjectStreamParams): Promise<ParsedDocumentWriteObjectResult>;
|
|
466
477
|
headObject?(params: ParsedDocumentObjectParams): Promise<ParsedDocumentObjectHead | null>;
|
|
467
478
|
getObjectUrl?(params: ParsedDocumentObjectParams): Promise<string | null>;
|
|
468
479
|
deletePrefix?(params: ParsedDocumentRevisionParams): Promise<void>;
|
|
@@ -473,6 +484,10 @@ interface ParsedDocumentSyncScheduler {
|
|
|
473
484
|
schedule(task: () => Promise<void>): void | Promise<void>;
|
|
474
485
|
}
|
|
475
486
|
interface ParsedDocumentStorageLimits {
|
|
487
|
+
/** ZIP entries copied per invocation (default 100). */
|
|
488
|
+
readonly maxEntriesPerSync?: number;
|
|
489
|
+
/** ZIP copy budget checked between entries (default 120000ms). */
|
|
490
|
+
readonly archiveSyncDeadlineMs?: number;
|
|
476
491
|
readonly remotePageSize?: number;
|
|
477
492
|
readonly maxPagesPerSync?: number;
|
|
478
493
|
readonly syncDeadlineMs?: number;
|
|
@@ -1303,7 +1318,11 @@ interface KnowledgeDocumentReference {
|
|
|
1303
1318
|
revisionKey?: string;
|
|
1304
1319
|
}
|
|
1305
1320
|
type KnowledgeParsedStorageOptions = ParsedDocumentStorageConfig;
|
|
1306
|
-
|
|
1321
|
+
interface KnowledgeSyncParsedDocumentParams extends KnowledgeDocumentReference {
|
|
1322
|
+
readonly signal?: AbortSignal;
|
|
1323
|
+
/** Optionally retain the exact source ZIP as result.zip after committing the snapshot. */
|
|
1324
|
+
readonly retainResultArchive?: boolean;
|
|
1325
|
+
}
|
|
1307
1326
|
interface KnowledgeSyncParsedDocumentResponse {
|
|
1308
1327
|
documentId: string;
|
|
1309
1328
|
revisionKey: string;
|
|
@@ -1617,6 +1636,8 @@ declare function syncParseResultToParsedDocumentStorage(params: {
|
|
|
1617
1636
|
readonly documentId?: string;
|
|
1618
1637
|
readonly revisionKey?: string;
|
|
1619
1638
|
readonly source?: ParsedDocumentCommitSource;
|
|
1639
|
+
readonly signal?: AbortSignal;
|
|
1640
|
+
readonly beforeCommit?: () => Promise<void>;
|
|
1620
1641
|
}): Promise<{
|
|
1621
1642
|
readonly result: ParseResult;
|
|
1622
1643
|
readonly documentId: string;
|
|
@@ -1753,4 +1774,11 @@ declare class JobFailedError extends KnowhereError {
|
|
|
1753
1774
|
constructor(message: string, code: string, jobResult: JobResult);
|
|
1754
1775
|
}
|
|
1755
1776
|
|
|
1756
|
-
|
|
1777
|
+
/** The sequential ZIP fallback could not access its SDK-owned temporary storage. */
|
|
1778
|
+
declare class ParsedDocumentArchiveError extends KnowhereError {
|
|
1779
|
+
readonly code: "ARCHIVE_SPOOL_FAILED";
|
|
1780
|
+
readonly cause: unknown;
|
|
1781
|
+
constructor(cause: unknown);
|
|
1782
|
+
}
|
|
1783
|
+
|
|
1784
|
+
export { APIError, type AuthTokenProvider, AuthenticationError, BadRequestError, type BaseChunk, ChecksumError, type Chunk, ConflictError, type CreateJobParams, DiskParsedDocumentStorage, type DocType, type Document, type DocumentChunk, type DocumentChunkGetParams, type DocumentChunkListParams, type DocumentChunkListResponse, type DocumentChunkPagination, type DocumentChunkResponse, type DocumentChunkType, type DocumentListPagination, type DocumentListParams, type DocumentListResponse, type DocumentMetadata, type DocumentPageCitationSource, Documents, type FileIndex, GatewayTimeoutError, type ImageChunk, InternalServerError, InvalidStateError, type Job, type JobError, JobFailedError, type JobResult, type JobStatus, Jobs, Knowhere, type KnowhereAssetStorageAdapter, type KnowhereAssetStorageBody, type KnowhereAssetStorageHead, type KnowhereAssetStorageObject, type KnowhereAssetStorageOptions, type KnowhereAssetStorageResult, type KnowhereAssetStorageWriteResult, KnowhereError, type KnowhereOptions, Knowledge, type KnowledgeAsyncJobStatusResponse, type KnowledgeAsyncParseParams, type KnowledgeAsyncParseResponse, type KnowledgeCacheDocumentParams, type KnowledgeCacheJobResultParams, type KnowledgeChunkType, type KnowledgeDocumentReference, type KnowledgeGrepMatch, type KnowledgeGrepParams, type KnowledgeGrepResponse, type KnowledgeImportJobResultParams, type KnowledgeJobResultResponse, type KnowledgeLoadJobResultParams, type KnowledgeOutline, type KnowledgeParseParams, type KnowledgeParsedStorageOptions, type KnowledgeReadChunk, type KnowledgeReadParams, type KnowledgeReadResponse, type KnowledgeSearchParams, type KnowledgeSearchReference, type KnowledgeSearchResponse, type KnowledgeSearchResult, type KnowledgeSection, type KnowledgeStartupRecoveryResponse, type KnowledgeSyncParsedDocumentParams, type KnowledgeSyncParsedDocumentResponse, type LlmConfig, type LlmModelsConfig, type LlmProviderConfig, type LoadOptions, type LocalKnowledgeDocument, type LocalKnowledgeParseResponse, LocalKnowledgeStore, type Manifest, NODE_SDK_DOCUMENT_METADATA_DEFAULTS, NetworkError, NotFoundError, type PageChunk, type PageCitationAsset, type PageCitationAssetContentType, type PageCitationAssetSource, type ParseParams, type ParseResult, ParsedDocumentArchiveError, type ParsedDocumentCommit, type ParsedDocumentCommitSource, type ParsedDocumentObject, type ParsedDocumentObjectHead, type ParsedDocumentObjectParams, type ParsedDocumentRevisionParams, type ParsedDocumentStorage, type ParsedDocumentStorageConfig, type ParsedDocumentStorageDocument, type ParsedDocumentStorageLimits, type ParsedDocumentSyncProgress, type ParsedDocumentSyncScheduler, type ParsedDocumentWriteObjectParams, type ParsedDocumentWriteObjectResult, type ParsedDocumentWriteObjectStreamParams, type ParsingModel, type ParsingParams, PaymentRequiredError, PermissionDeniedError, type PollProgress, PollingTimeoutError, RateLimitError, Retrieval, type RetrievalChannel, type RetrievalChunkType, type RetrievalEvidencePart, type RetrievalFilterMode, type RetrievalQueryParams, type RetrievalQueryResponse, type RetrievalReferencedChunk, type RetrievalResult, type RetrievalSectionExclusion, type RetrievalSource, ServiceUnavailableError, type Statistics, type TableChunk, type TextChunk, TimeoutError, type UploadParams, type UploadProgress, VERSION, ValidationError, type WaitOptions, type WebhookConfig, Knowhere as default, mergeDocumentMetadataDefaults, storeParseResultAssets, syncParseResultToParsedDocumentStorage };
|