@korajs/store 1.0.0-beta.1 → 1.0.0-beta.11
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/dist/adapters/better-sqlite3.cjs.map +1 -1
- package/dist/adapters/better-sqlite3.d.cts +1 -1
- package/dist/adapters/better-sqlite3.d.ts +1 -1
- package/dist/adapters/better-sqlite3.js +1 -1
- package/dist/adapters/indexeddb.cjs +523 -148
- package/dist/adapters/indexeddb.cjs.map +1 -1
- package/dist/adapters/indexeddb.d.cts +4 -2
- package/dist/adapters/indexeddb.d.ts +4 -2
- package/dist/adapters/indexeddb.js +55 -11
- package/dist/adapters/indexeddb.js.map +1 -1
- package/dist/adapters/sqlite-wasm-worker.cjs +207 -187
- package/dist/adapters/sqlite-wasm-worker.cjs.map +1 -1
- package/dist/adapters/sqlite-wasm-worker.js +208 -188
- package/dist/adapters/sqlite-wasm-worker.js.map +1 -1
- package/dist/adapters/sqlite-wasm.cjs +474 -140
- package/dist/adapters/sqlite-wasm.cjs.map +1 -1
- package/dist/adapters/sqlite-wasm.d.cts +45 -8
- package/dist/adapters/sqlite-wasm.d.ts +45 -8
- package/dist/adapters/sqlite-wasm.js +3 -3
- package/dist/{backup-ZV4Y424B.js → backup-5S7K2Z35.js} +3 -3
- package/dist/{chunk-FFYA7J5H.js → chunk-CYO3YKFL.js} +4 -3
- package/dist/chunk-CYO3YKFL.js.map +1 -0
- package/dist/{chunk-6NKLDBTY.js → chunk-GSJ7EEUC.js} +2 -1
- package/dist/chunk-GSJ7EEUC.js.map +1 -0
- package/dist/{chunk-X57MWW35.js → chunk-HS6DBMST.js} +13 -10
- package/dist/chunk-HS6DBMST.js.map +1 -0
- package/dist/chunk-RJIEKEN4.js +751 -0
- package/dist/chunk-RJIEKEN4.js.map +1 -0
- package/dist/{chunk-QL2XVZRN.js → chunk-TUR7RGEP.js} +12 -1
- package/dist/{chunk-QL2XVZRN.js.map → chunk-TUR7RGEP.js.map} +1 -1
- package/dist/{chunk-IOEFNHHP.js → chunk-VDBJQ75K.js} +2 -2
- package/dist/chunk-VDBJQ75K.js.map +1 -0
- package/dist/{chunk-ZLWAYQEQ.js → chunk-YT7MRFCP.js} +36 -32
- package/dist/chunk-YT7MRFCP.js.map +1 -0
- package/dist/{export-audit-AJ7RORNK.js → export-audit-ODGQTQIK.js} +3 -3
- package/dist/index.cjs +313 -144
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +51 -5
- package/dist/index.d.ts +51 -5
- package/dist/index.js +212 -59
- package/dist/index.js.map +1 -1
- package/dist/internal.cjs +46 -40
- package/dist/internal.cjs.map +1 -1
- package/dist/internal.d.cts +3 -3
- package/dist/internal.d.ts +3 -3
- package/dist/internal.js +3 -3
- package/dist/sqlite-wasm-channel-GGHA2BXU.js +12 -0
- package/dist/{sqlite-wasm-channel-DUDPclTE.d.cts → sqlite-wasm-channel-L6o3bWQK.d.cts} +1 -1
- package/dist/{sqlite-wasm-channel-DUDPclTE.d.ts → sqlite-wasm-channel-L6o3bWQK.d.ts} +1 -1
- package/dist/{types-5h4Hqcwc.d.ts → types-BOO9EPt1.d.ts} +1 -1
- package/dist/{types-k6AZgiH4.d.ts → types-BslDOTk0.d.cts} +26 -1
- package/dist/{types-k6AZgiH4.d.cts → types-BslDOTk0.d.ts} +26 -1
- package/dist/{types-DfPiPwKr.d.cts → types-C_GDavG-.d.cts} +1 -1
- package/package.json +2 -12
- package/dist/adapters/sqlite-wasm-shared-host.cjs +0 -68
- package/dist/adapters/sqlite-wasm-shared-host.cjs.map +0 -1
- package/dist/adapters/sqlite-wasm-shared-host.d.cts +0 -2
- package/dist/adapters/sqlite-wasm-shared-host.d.ts +0 -2
- package/dist/adapters/sqlite-wasm-shared-host.js +0 -66
- package/dist/adapters/sqlite-wasm-shared-host.js.map +0 -1
- package/dist/chunk-6NKLDBTY.js.map +0 -1
- package/dist/chunk-FFYA7J5H.js.map +0 -1
- package/dist/chunk-IOEFNHHP.js.map +0 -1
- package/dist/chunk-RBPVEAVM.js +0 -425
- package/dist/chunk-RBPVEAVM.js.map +0 -1
- package/dist/chunk-X57MWW35.js.map +0 -1
- package/dist/chunk-ZLWAYQEQ.js.map +0 -1
- package/dist/sqlite-wasm-channel-H43KEZLM.js +0 -12
- /package/dist/{backup-ZV4Y424B.js.map → backup-5S7K2Z35.js.map} +0 -0
- /package/dist/{export-audit-AJ7RORNK.js.map → export-audit-ODGQTQIK.js.map} +0 -0
- /package/dist/{sqlite-wasm-channel-H43KEZLM.js.map → sqlite-wasm-channel-GGHA2BXU.js.map} +0 -0
package/dist/index.d.cts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { C as CollectionRecord, S as StorageAdapter, Q as QueryDescriptor,
|
|
2
|
-
export { M as MigrationPlan,
|
|
1
|
+
import { C as CollectionRecord, S as StorageAdapter, Q as QueryDescriptor, d as SubscriptionCallback, W as WhereClause, e as OrderByDirection, L as LocalMutationHandler, f as StoreConfig, A as ApplyRemoteOptions, g as MaterializedRowSnapshot, h as RowVersionState } from './types-BslDOTk0.cjs';
|
|
2
|
+
export { M as MigrationPlan, i as OrderByClause, j as StorageFallbackReason, a as StorageOpenState, k as StoreIsolation, T as Transaction, l as TransactionBufferedEntry, m as TransactionCommitBatch, n as TransactionCommitResult, o as WhereOperators } from './types-BslDOTk0.cjs';
|
|
3
3
|
import { Operation, KoraError, VersionVector, SchemaDefinition, HLCTimestamp, MergeTrace, CollectionDefinition, SequenceConfig, HybridLogicalClock, CausalTracker, OperationLog, ApplyResult, StateMachineDefinition, KoraBytesValue, KoraEvent, BlobRefMetadata, BlobRef } from '@korajs/core';
|
|
4
4
|
export { ApplyResult } from '@korajs/core';
|
|
5
|
-
import { R as RelationEnforcer, L as LocalMutationContext } from './types-
|
|
6
|
-
export { C as Collection } from './types-
|
|
5
|
+
import { R as RelationEnforcer, L as LocalMutationContext } from './types-C_GDavG-.cjs';
|
|
6
|
+
export { C as Collection } from './types-C_GDavG-.cjs';
|
|
7
7
|
import * as yjs from 'yjs';
|
|
8
8
|
import { C as ContentAddressedBlobStore, M as MemoryBlobStore } from './content-addressed-blob-store-Dcj3SB9r.cjs';
|
|
9
9
|
export { B as BlobIntegrityError } from './content-addressed-blob-store-Dcj3SB9r.cjs';
|
|
@@ -71,6 +71,15 @@ declare class WorkerInitError extends KoraError {
|
|
|
71
71
|
declare class WorkerTimeoutError extends KoraError {
|
|
72
72
|
constructor(operation: string, timeoutMs: number);
|
|
73
73
|
}
|
|
74
|
+
/**
|
|
75
|
+
* Thrown when a follower tab cannot reach a live leader tab over the multi-tab
|
|
76
|
+
* broadcast channel (the leader tab was closed, crashed, or is unresponsive).
|
|
77
|
+
* Distinct from {@link WorkerTimeoutError}: this fails fast on a confirmed-absent
|
|
78
|
+
* leader instead of waiting out the full RPC timeout.
|
|
79
|
+
*/
|
|
80
|
+
declare class NoLeaderError extends KoraError {
|
|
81
|
+
constructor(operation: string);
|
|
82
|
+
}
|
|
74
83
|
/**
|
|
75
84
|
* Thrown when IndexedDB persistence operations fail (serialize/deserialize).
|
|
76
85
|
*/
|
|
@@ -811,6 +820,14 @@ declare class Store implements OperationLog {
|
|
|
811
820
|
* Route local CRUD through the unified apply pipeline (korajs ApplyPipeline).
|
|
812
821
|
*/
|
|
813
822
|
setLocalMutationHandler(handler: LocalMutationHandler | null): void;
|
|
823
|
+
/**
|
|
824
|
+
* Notify this store that another same-origin runtime committed an operation to
|
|
825
|
+
* the shared local database. The operation has already been persisted and
|
|
826
|
+
* materialized by the database owner; this method only advances in-memory causal
|
|
827
|
+
* watermarks and invalidates local reactive queries so already-open tabs stay
|
|
828
|
+
* live without reapplying or rewriting the operation.
|
|
829
|
+
*/
|
|
830
|
+
notifyExternalOperation(operation: Operation): void;
|
|
814
831
|
/**
|
|
815
832
|
* Build mutation context for a collection (used by ApplyPipeline side effects).
|
|
816
833
|
*/
|
|
@@ -849,6 +866,23 @@ declare class Store implements OperationLog {
|
|
|
849
866
|
* Persist or clear the delta cursor for paginated initial sync resume.
|
|
850
867
|
*/
|
|
851
868
|
saveDeltaCursor(cursor: string | null): Promise<void>;
|
|
869
|
+
/**
|
|
870
|
+
* Load the persisted delivery watermark for a view signature (0 when none recorded).
|
|
871
|
+
* Defaults to the unfiltered view so existing single-watermark reads keep working.
|
|
872
|
+
*/
|
|
873
|
+
loadDeliveryWatermark(signature?: string): Promise<number>;
|
|
874
|
+
/**
|
|
875
|
+
* Persist the delivery watermark for a view signature so it survives a client restart.
|
|
876
|
+
*/
|
|
877
|
+
saveDeliveryWatermark(signature: string, watermark: number): Promise<void>;
|
|
878
|
+
/**
|
|
879
|
+
* Load every persisted view watermark, keyed by signature.
|
|
880
|
+
*/
|
|
881
|
+
loadAllDeliveryWatermarks(): Promise<Record<string, number>>;
|
|
882
|
+
/**
|
|
883
|
+
* Delete a persisted view watermark (safe: the view back-fills from 0 when next visited).
|
|
884
|
+
*/
|
|
885
|
+
deleteDeliveryWatermark(signature: string): Promise<void>;
|
|
852
886
|
/**
|
|
853
887
|
* Local operations not yet reflected on the server version vector.
|
|
854
888
|
*/
|
|
@@ -883,6 +917,12 @@ declare class Store implements OperationLog {
|
|
|
883
917
|
* Latest operation for a record from any node (for 3-way merge when local op log is empty).
|
|
884
918
|
*/
|
|
885
919
|
getLatestOperationForRecord(collection: string, recordId: string): Promise<Operation | null>;
|
|
920
|
+
/**
|
|
921
|
+
* All operations for a record, sorted in HLC total order (wallTime, logical,
|
|
922
|
+
* nodeId). Used by the apply pipeline to materialize atomic-op fields by folding
|
|
923
|
+
* the record's log, matching the server's materialization exactly.
|
|
924
|
+
*/
|
|
925
|
+
getOperationsForRecord(collection: string, recordId: string): Promise<Operation[]>;
|
|
886
926
|
/** Expose the subscription manager for direct access (e.g., by QueryBuilder) */
|
|
887
927
|
getSubscriptionManager(): SubscriptionManager;
|
|
888
928
|
/**
|
|
@@ -976,6 +1016,7 @@ declare class QueryStore<T = CollectionRecord> {
|
|
|
976
1016
|
private listeners;
|
|
977
1017
|
private unsubscribeQuery;
|
|
978
1018
|
private active;
|
|
1019
|
+
private hasEmittedSnapshot;
|
|
979
1020
|
private readonly queryBuilder;
|
|
980
1021
|
constructor(queryBuilder: QueryBuilder<T>);
|
|
981
1022
|
/**
|
|
@@ -986,6 +1027,11 @@ declare class QueryStore<T = CollectionRecord> {
|
|
|
986
1027
|
subscribe: (onStoreChange: () => void) => (() => void);
|
|
987
1028
|
/** Synchronous read of the latest query results. */
|
|
988
1029
|
getSnapshot: () => readonly T[];
|
|
1030
|
+
/**
|
|
1031
|
+
* Whether the underlying query subscription has delivered at least one
|
|
1032
|
+
* authoritative result for the current subscription lifecycle.
|
|
1033
|
+
*/
|
|
1034
|
+
hasSnapshot: () => boolean;
|
|
989
1035
|
/** Tear down listeners and the underlying query subscription. */
|
|
990
1036
|
destroy(): void;
|
|
991
1037
|
private startSubscription;
|
|
@@ -1748,4 +1794,4 @@ declare function createChunkPortPair(): {
|
|
|
1748
1794
|
b: ChunkMessagePort;
|
|
1749
1795
|
};
|
|
1750
1796
|
|
|
1751
|
-
export { AdapterError, ApplyRemoteOptions, type AuditExportManifest, type AuditExportOptions, type AuditExportPayload, type AuditExportProgress, type AuditTraceQuery, type BackupManifest, type BackupOptions, type BackupProgress, type BlobGcOptions, type BlobGcResult, type BlobManifest, type BlobManifestMetadata, COMPACTION_BASELINE_META_KEY, type ChunkMessage, type ChunkMessagePort, type ChunkProvider, type ChunkRequestMessage, type ChunkResponseMessage, type ClockRebaseResult, type CollectionAccessor, CollectionRecord, type CompactionResult, type CompactionStrategy, ContentAddressedBlobStore, type CreateRichTextControllerOptions, DEFAULT_CHUNK_SIZE, InvalidStateTransitionError, LAST_ACKED_SERVER_VECTOR_META_KEY, LocalMutationHandler, MaterializedRowSnapshot, MemoryBlobStore, type OpfsBlobDirectory, OpfsBlobStore, OptimisticLockError, OrderByDirection, type PersistedAuditTrace, PersistenceError, QueryBuilder, QueryDescriptor, QueryError, QueryStore, QueryStoreCache, type ReceiveBlobResult, type ReceiveBlobStores, RecordNotFoundError, type RemoteChunkProvider, type ReplaySnapshot, type RestoreOptions, type RestoreResult, type RichTextAwarenessUser, type RichTextController, type RichTextControllerSnapshot, type RichTextCursorInfo, type RichTextSyncEngine, RowVersionState, SequenceManager, type ServerBlobCallbacks, StorageAdapter, Store, StoreConfig, StoreNotOpenError, SubscriptionBloomFilter, SubscriptionCallback, SubscriptionManager, type SubscriptionManagerOptions, type SubscriptionStats, type TransactionCollectionAccessor, TransactionContext, type TransactionContextConfig, WhereClause, WorkerInitError, WorkerTimeoutError, asRichTextSyncEngine, assertQueryReady, chunkBlob, collectBlobGarbage, collectOperationsAheadOfServer, compactOperationLog, computeAckCompactionWatermark, createChunkPortPair, createMemoryServerBlobStore, createOpfsBlobDirectory, createOpfsBlobStore, createRemoteChunkProvider, createRichTextController, decodeAuditExport, decodeRichtext, deserializeVersionVectorFromMeta, encodeRichtext, exportBackup, extractBlobRefs, fetchBlobManifest, getSharedQueryStoreCache, mergeVersionVectors, parseBlobManifest, persistedAuditTraceFromEvent, pluralize, prepareBlobForSend, putBlobForTransfer, readAuditExportManifest, readBackupManifest, reassembleBlob, receiveBlob, resolveBlobManifest, restoreBackup, richtextStatesEqual, richtextToPlainText, serializeBlobManifest, serializeVersionVectorToMeta, serveBlobChunks, singularize, toServerBlobCallbacks, validateStateTransition, validateUpdateStateMachine, verifyAuditExportChecksum, verifyBackupChecksum };
|
|
1797
|
+
export { AdapterError, ApplyRemoteOptions, type AuditExportManifest, type AuditExportOptions, type AuditExportPayload, type AuditExportProgress, type AuditTraceQuery, type BackupManifest, type BackupOptions, type BackupProgress, type BlobGcOptions, type BlobGcResult, type BlobManifest, type BlobManifestMetadata, COMPACTION_BASELINE_META_KEY, type ChunkMessage, type ChunkMessagePort, type ChunkProvider, type ChunkRequestMessage, type ChunkResponseMessage, type ClockRebaseResult, type CollectionAccessor, CollectionRecord, type CompactionResult, type CompactionStrategy, ContentAddressedBlobStore, type CreateRichTextControllerOptions, DEFAULT_CHUNK_SIZE, InvalidStateTransitionError, LAST_ACKED_SERVER_VECTOR_META_KEY, LocalMutationHandler, MaterializedRowSnapshot, MemoryBlobStore, NoLeaderError, type OpfsBlobDirectory, OpfsBlobStore, OptimisticLockError, OrderByDirection, type PersistedAuditTrace, PersistenceError, QueryBuilder, QueryDescriptor, QueryError, QueryStore, QueryStoreCache, type ReceiveBlobResult, type ReceiveBlobStores, RecordNotFoundError, type RemoteChunkProvider, type ReplaySnapshot, type RestoreOptions, type RestoreResult, type RichTextAwarenessUser, type RichTextController, type RichTextControllerSnapshot, type RichTextCursorInfo, type RichTextSyncEngine, RowVersionState, SequenceManager, type ServerBlobCallbacks, StorageAdapter, Store, StoreConfig, StoreNotOpenError, SubscriptionBloomFilter, SubscriptionCallback, SubscriptionManager, type SubscriptionManagerOptions, type SubscriptionStats, type TransactionCollectionAccessor, TransactionContext, type TransactionContextConfig, WhereClause, WorkerInitError, WorkerTimeoutError, asRichTextSyncEngine, assertQueryReady, chunkBlob, collectBlobGarbage, collectOperationsAheadOfServer, compactOperationLog, computeAckCompactionWatermark, createChunkPortPair, createMemoryServerBlobStore, createOpfsBlobDirectory, createOpfsBlobStore, createRemoteChunkProvider, createRichTextController, decodeAuditExport, decodeRichtext, deserializeVersionVectorFromMeta, encodeRichtext, exportBackup, extractBlobRefs, fetchBlobManifest, getSharedQueryStoreCache, mergeVersionVectors, parseBlobManifest, persistedAuditTraceFromEvent, pluralize, prepareBlobForSend, putBlobForTransfer, readAuditExportManifest, readBackupManifest, reassembleBlob, receiveBlob, resolveBlobManifest, restoreBackup, richtextStatesEqual, richtextToPlainText, serializeBlobManifest, serializeVersionVectorToMeta, serveBlobChunks, singularize, toServerBlobCallbacks, validateStateTransition, validateUpdateStateMachine, verifyAuditExportChecksum, verifyBackupChecksum };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { C as CollectionRecord, S as StorageAdapter, Q as QueryDescriptor,
|
|
2
|
-
export { M as MigrationPlan,
|
|
1
|
+
import { C as CollectionRecord, S as StorageAdapter, Q as QueryDescriptor, d as SubscriptionCallback, W as WhereClause, e as OrderByDirection, L as LocalMutationHandler, f as StoreConfig, A as ApplyRemoteOptions, g as MaterializedRowSnapshot, h as RowVersionState } from './types-BslDOTk0.js';
|
|
2
|
+
export { M as MigrationPlan, i as OrderByClause, j as StorageFallbackReason, a as StorageOpenState, k as StoreIsolation, T as Transaction, l as TransactionBufferedEntry, m as TransactionCommitBatch, n as TransactionCommitResult, o as WhereOperators } from './types-BslDOTk0.js';
|
|
3
3
|
import { Operation, KoraError, VersionVector, SchemaDefinition, HLCTimestamp, MergeTrace, CollectionDefinition, SequenceConfig, HybridLogicalClock, CausalTracker, OperationLog, ApplyResult, StateMachineDefinition, KoraBytesValue, KoraEvent, BlobRefMetadata, BlobRef } from '@korajs/core';
|
|
4
4
|
export { ApplyResult } from '@korajs/core';
|
|
5
|
-
import { R as RelationEnforcer, L as LocalMutationContext } from './types-
|
|
6
|
-
export { C as Collection } from './types-
|
|
5
|
+
import { R as RelationEnforcer, L as LocalMutationContext } from './types-BOO9EPt1.js';
|
|
6
|
+
export { C as Collection } from './types-BOO9EPt1.js';
|
|
7
7
|
import * as yjs from 'yjs';
|
|
8
8
|
import { C as ContentAddressedBlobStore, M as MemoryBlobStore } from './content-addressed-blob-store-Dcj3SB9r.js';
|
|
9
9
|
export { B as BlobIntegrityError } from './content-addressed-blob-store-Dcj3SB9r.js';
|
|
@@ -71,6 +71,15 @@ declare class WorkerInitError extends KoraError {
|
|
|
71
71
|
declare class WorkerTimeoutError extends KoraError {
|
|
72
72
|
constructor(operation: string, timeoutMs: number);
|
|
73
73
|
}
|
|
74
|
+
/**
|
|
75
|
+
* Thrown when a follower tab cannot reach a live leader tab over the multi-tab
|
|
76
|
+
* broadcast channel (the leader tab was closed, crashed, or is unresponsive).
|
|
77
|
+
* Distinct from {@link WorkerTimeoutError}: this fails fast on a confirmed-absent
|
|
78
|
+
* leader instead of waiting out the full RPC timeout.
|
|
79
|
+
*/
|
|
80
|
+
declare class NoLeaderError extends KoraError {
|
|
81
|
+
constructor(operation: string);
|
|
82
|
+
}
|
|
74
83
|
/**
|
|
75
84
|
* Thrown when IndexedDB persistence operations fail (serialize/deserialize).
|
|
76
85
|
*/
|
|
@@ -811,6 +820,14 @@ declare class Store implements OperationLog {
|
|
|
811
820
|
* Route local CRUD through the unified apply pipeline (korajs ApplyPipeline).
|
|
812
821
|
*/
|
|
813
822
|
setLocalMutationHandler(handler: LocalMutationHandler | null): void;
|
|
823
|
+
/**
|
|
824
|
+
* Notify this store that another same-origin runtime committed an operation to
|
|
825
|
+
* the shared local database. The operation has already been persisted and
|
|
826
|
+
* materialized by the database owner; this method only advances in-memory causal
|
|
827
|
+
* watermarks and invalidates local reactive queries so already-open tabs stay
|
|
828
|
+
* live without reapplying or rewriting the operation.
|
|
829
|
+
*/
|
|
830
|
+
notifyExternalOperation(operation: Operation): void;
|
|
814
831
|
/**
|
|
815
832
|
* Build mutation context for a collection (used by ApplyPipeline side effects).
|
|
816
833
|
*/
|
|
@@ -849,6 +866,23 @@ declare class Store implements OperationLog {
|
|
|
849
866
|
* Persist or clear the delta cursor for paginated initial sync resume.
|
|
850
867
|
*/
|
|
851
868
|
saveDeltaCursor(cursor: string | null): Promise<void>;
|
|
869
|
+
/**
|
|
870
|
+
* Load the persisted delivery watermark for a view signature (0 when none recorded).
|
|
871
|
+
* Defaults to the unfiltered view so existing single-watermark reads keep working.
|
|
872
|
+
*/
|
|
873
|
+
loadDeliveryWatermark(signature?: string): Promise<number>;
|
|
874
|
+
/**
|
|
875
|
+
* Persist the delivery watermark for a view signature so it survives a client restart.
|
|
876
|
+
*/
|
|
877
|
+
saveDeliveryWatermark(signature: string, watermark: number): Promise<void>;
|
|
878
|
+
/**
|
|
879
|
+
* Load every persisted view watermark, keyed by signature.
|
|
880
|
+
*/
|
|
881
|
+
loadAllDeliveryWatermarks(): Promise<Record<string, number>>;
|
|
882
|
+
/**
|
|
883
|
+
* Delete a persisted view watermark (safe: the view back-fills from 0 when next visited).
|
|
884
|
+
*/
|
|
885
|
+
deleteDeliveryWatermark(signature: string): Promise<void>;
|
|
852
886
|
/**
|
|
853
887
|
* Local operations not yet reflected on the server version vector.
|
|
854
888
|
*/
|
|
@@ -883,6 +917,12 @@ declare class Store implements OperationLog {
|
|
|
883
917
|
* Latest operation for a record from any node (for 3-way merge when local op log is empty).
|
|
884
918
|
*/
|
|
885
919
|
getLatestOperationForRecord(collection: string, recordId: string): Promise<Operation | null>;
|
|
920
|
+
/**
|
|
921
|
+
* All operations for a record, sorted in HLC total order (wallTime, logical,
|
|
922
|
+
* nodeId). Used by the apply pipeline to materialize atomic-op fields by folding
|
|
923
|
+
* the record's log, matching the server's materialization exactly.
|
|
924
|
+
*/
|
|
925
|
+
getOperationsForRecord(collection: string, recordId: string): Promise<Operation[]>;
|
|
886
926
|
/** Expose the subscription manager for direct access (e.g., by QueryBuilder) */
|
|
887
927
|
getSubscriptionManager(): SubscriptionManager;
|
|
888
928
|
/**
|
|
@@ -976,6 +1016,7 @@ declare class QueryStore<T = CollectionRecord> {
|
|
|
976
1016
|
private listeners;
|
|
977
1017
|
private unsubscribeQuery;
|
|
978
1018
|
private active;
|
|
1019
|
+
private hasEmittedSnapshot;
|
|
979
1020
|
private readonly queryBuilder;
|
|
980
1021
|
constructor(queryBuilder: QueryBuilder<T>);
|
|
981
1022
|
/**
|
|
@@ -986,6 +1027,11 @@ declare class QueryStore<T = CollectionRecord> {
|
|
|
986
1027
|
subscribe: (onStoreChange: () => void) => (() => void);
|
|
987
1028
|
/** Synchronous read of the latest query results. */
|
|
988
1029
|
getSnapshot: () => readonly T[];
|
|
1030
|
+
/**
|
|
1031
|
+
* Whether the underlying query subscription has delivered at least one
|
|
1032
|
+
* authoritative result for the current subscription lifecycle.
|
|
1033
|
+
*/
|
|
1034
|
+
hasSnapshot: () => boolean;
|
|
989
1035
|
/** Tear down listeners and the underlying query subscription. */
|
|
990
1036
|
destroy(): void;
|
|
991
1037
|
private startSubscription;
|
|
@@ -1748,4 +1794,4 @@ declare function createChunkPortPair(): {
|
|
|
1748
1794
|
b: ChunkMessagePort;
|
|
1749
1795
|
};
|
|
1750
1796
|
|
|
1751
|
-
export { AdapterError, ApplyRemoteOptions, type AuditExportManifest, type AuditExportOptions, type AuditExportPayload, type AuditExportProgress, type AuditTraceQuery, type BackupManifest, type BackupOptions, type BackupProgress, type BlobGcOptions, type BlobGcResult, type BlobManifest, type BlobManifestMetadata, COMPACTION_BASELINE_META_KEY, type ChunkMessage, type ChunkMessagePort, type ChunkProvider, type ChunkRequestMessage, type ChunkResponseMessage, type ClockRebaseResult, type CollectionAccessor, CollectionRecord, type CompactionResult, type CompactionStrategy, ContentAddressedBlobStore, type CreateRichTextControllerOptions, DEFAULT_CHUNK_SIZE, InvalidStateTransitionError, LAST_ACKED_SERVER_VECTOR_META_KEY, LocalMutationHandler, MaterializedRowSnapshot, MemoryBlobStore, type OpfsBlobDirectory, OpfsBlobStore, OptimisticLockError, OrderByDirection, type PersistedAuditTrace, PersistenceError, QueryBuilder, QueryDescriptor, QueryError, QueryStore, QueryStoreCache, type ReceiveBlobResult, type ReceiveBlobStores, RecordNotFoundError, type RemoteChunkProvider, type ReplaySnapshot, type RestoreOptions, type RestoreResult, type RichTextAwarenessUser, type RichTextController, type RichTextControllerSnapshot, type RichTextCursorInfo, type RichTextSyncEngine, RowVersionState, SequenceManager, type ServerBlobCallbacks, StorageAdapter, Store, StoreConfig, StoreNotOpenError, SubscriptionBloomFilter, SubscriptionCallback, SubscriptionManager, type SubscriptionManagerOptions, type SubscriptionStats, type TransactionCollectionAccessor, TransactionContext, type TransactionContextConfig, WhereClause, WorkerInitError, WorkerTimeoutError, asRichTextSyncEngine, assertQueryReady, chunkBlob, collectBlobGarbage, collectOperationsAheadOfServer, compactOperationLog, computeAckCompactionWatermark, createChunkPortPair, createMemoryServerBlobStore, createOpfsBlobDirectory, createOpfsBlobStore, createRemoteChunkProvider, createRichTextController, decodeAuditExport, decodeRichtext, deserializeVersionVectorFromMeta, encodeRichtext, exportBackup, extractBlobRefs, fetchBlobManifest, getSharedQueryStoreCache, mergeVersionVectors, parseBlobManifest, persistedAuditTraceFromEvent, pluralize, prepareBlobForSend, putBlobForTransfer, readAuditExportManifest, readBackupManifest, reassembleBlob, receiveBlob, resolveBlobManifest, restoreBackup, richtextStatesEqual, richtextToPlainText, serializeBlobManifest, serializeVersionVectorToMeta, serveBlobChunks, singularize, toServerBlobCallbacks, validateStateTransition, validateUpdateStateMachine, verifyAuditExportChecksum, verifyBackupChecksum };
|
|
1797
|
+
export { AdapterError, ApplyRemoteOptions, type AuditExportManifest, type AuditExportOptions, type AuditExportPayload, type AuditExportProgress, type AuditTraceQuery, type BackupManifest, type BackupOptions, type BackupProgress, type BlobGcOptions, type BlobGcResult, type BlobManifest, type BlobManifestMetadata, COMPACTION_BASELINE_META_KEY, type ChunkMessage, type ChunkMessagePort, type ChunkProvider, type ChunkRequestMessage, type ChunkResponseMessage, type ClockRebaseResult, type CollectionAccessor, CollectionRecord, type CompactionResult, type CompactionStrategy, ContentAddressedBlobStore, type CreateRichTextControllerOptions, DEFAULT_CHUNK_SIZE, InvalidStateTransitionError, LAST_ACKED_SERVER_VECTOR_META_KEY, LocalMutationHandler, MaterializedRowSnapshot, MemoryBlobStore, NoLeaderError, type OpfsBlobDirectory, OpfsBlobStore, OptimisticLockError, OrderByDirection, type PersistedAuditTrace, PersistenceError, QueryBuilder, QueryDescriptor, QueryError, QueryStore, QueryStoreCache, type ReceiveBlobResult, type ReceiveBlobStores, RecordNotFoundError, type RemoteChunkProvider, type ReplaySnapshot, type RestoreOptions, type RestoreResult, type RichTextAwarenessUser, type RichTextController, type RichTextControllerSnapshot, type RichTextCursorInfo, type RichTextSyncEngine, RowVersionState, SequenceManager, type ServerBlobCallbacks, StorageAdapter, Store, StoreConfig, StoreNotOpenError, SubscriptionBloomFilter, SubscriptionCallback, SubscriptionManager, type SubscriptionManagerOptions, type SubscriptionStats, type TransactionCollectionAccessor, TransactionContext, type TransactionContextConfig, WhereClause, WorkerInitError, WorkerTimeoutError, asRichTextSyncEngine, assertQueryReady, chunkBlob, collectBlobGarbage, collectOperationsAheadOfServer, compactOperationLog, computeAckCompactionWatermark, createChunkPortPair, createMemoryServerBlobStore, createOpfsBlobDirectory, createOpfsBlobStore, createRemoteChunkProvider, createRichTextController, decodeAuditExport, decodeRichtext, deserializeVersionVectorFromMeta, encodeRichtext, exportBackup, extractBlobRefs, fetchBlobManifest, getSharedQueryStoreCache, mergeVersionVectors, parseBlobManifest, persistedAuditTraceFromEvent, pluralize, prepareBlobForSend, putBlobForTransfer, readAuditExportManifest, readBackupManifest, reassembleBlob, receiveBlob, resolveBlobManifest, restoreBackup, richtextStatesEqual, richtextToPlainText, serializeBlobManifest, serializeVersionVectorToMeta, serveBlobChunks, singularize, toServerBlobCallbacks, validateStateTransition, validateUpdateStateMachine, verifyAuditExportChecksum, verifyBackupChecksum };
|