@korajs/store 1.0.0-beta.5 → 1.0.0-beta.6
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.d.cts +1 -1
- package/dist/adapters/better-sqlite3.d.ts +1 -1
- package/dist/adapters/indexeddb.cjs +309 -128
- 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 +7 -2
- package/dist/adapters/indexeddb.js.map +1 -1
- package/dist/adapters/sqlite-wasm-worker.cjs.map +1 -1
- package/dist/adapters/sqlite-wasm-worker.js +250 -3
- package/dist/adapters/sqlite-wasm-worker.js.map +1 -1
- package/dist/adapters/sqlite-wasm.cjs +304 -128
- package/dist/adapters/sqlite-wasm.cjs.map +1 -1
- package/dist/adapters/sqlite-wasm.d.cts +18 -7
- package/dist/adapters/sqlite-wasm.d.ts +18 -7
- package/dist/adapters/sqlite-wasm.js +2 -2
- package/dist/{chunk-Q57CHIIN.js → chunk-FKW56RVZ.js} +306 -129
- package/dist/chunk-FKW56RVZ.js.map +1 -0
- package/dist/{chunk-COJSQBXW.js → chunk-VDBJQ75K.js} +1 -1
- package/dist/chunk-VDBJQ75K.js.map +1 -0
- package/dist/{chunk-RL43UYQZ.js → chunk-YT7MRFCP.js} +5 -5
- package/dist/index.cjs +16 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +12 -4
- package/dist/index.d.ts +12 -4
- package/dist/index.js +34 -18
- package/dist/index.js.map +1 -1
- package/dist/internal.d.cts +3 -3
- package/dist/internal.d.ts +3 -3
- package/dist/internal.js +2 -2
- package/dist/{sqlite-wasm-channel-NGSBJR44.js → sqlite-wasm-channel-GGHA2BXU.js} +2 -2
- package/dist/{sqlite-wasm-channel-Bx57s8Cq.d.cts → sqlite-wasm-channel-L6o3bWQK.d.cts} +2 -2
- package/dist/{sqlite-wasm-channel-Bx57s8Cq.d.ts → sqlite-wasm-channel-L6o3bWQK.d.ts} +2 -2
- package/dist/{types-C1kigrWz.d.ts → types-BOO9EPt1.d.ts} +1 -1
- package/dist/{types-D1MzKVmk.d.ts → types-BslDOTk0.d.cts} +16 -1
- package/dist/{types-D1MzKVmk.d.cts → types-BslDOTk0.d.ts} +16 -1
- package/dist/{types-DAo9oduO.d.cts → types-C_GDavG-.d.cts} +1 -1
- package/package.json +1 -11
- package/dist/adapters/sqlite-wasm-shared-host.cjs +0 -345
- package/dist/adapters/sqlite-wasm-shared-host.cjs.map +0 -1
- package/dist/adapters/sqlite-wasm-shared-host.d.cts +0 -82
- package/dist/adapters/sqlite-wasm-shared-host.d.ts +0 -82
- package/dist/adapters/sqlite-wasm-shared-host.js +0 -61
- package/dist/adapters/sqlite-wasm-shared-host.js.map +0 -1
- package/dist/chunk-3Y2IERBF.js +0 -255
- package/dist/chunk-3Y2IERBF.js.map +0 -1
- package/dist/chunk-COJSQBXW.js.map +0 -1
- package/dist/chunk-Q57CHIIN.js.map +0 -1
- /package/dist/{chunk-RL43UYQZ.js.map → chunk-YT7MRFCP.js.map} +0 -0
- /package/dist/{sqlite-wasm-channel-NGSBJR44.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';
|
|
@@ -820,6 +820,14 @@ declare class Store implements OperationLog {
|
|
|
820
820
|
* Route local CRUD through the unified apply pipeline (korajs ApplyPipeline).
|
|
821
821
|
*/
|
|
822
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;
|
|
823
831
|
/**
|
|
824
832
|
* Build mutation context for a collection (used by ApplyPipeline side effects).
|
|
825
833
|
*/
|
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';
|
|
@@ -820,6 +820,14 @@ declare class Store implements OperationLog {
|
|
|
820
820
|
* Route local CRUD through the unified apply pipeline (korajs ApplyPipeline).
|
|
821
821
|
*/
|
|
822
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;
|
|
823
831
|
/**
|
|
824
832
|
* Build mutation context for a collection (used by ApplyPipeline side effects).
|
|
825
833
|
*/
|
package/dist/index.js
CHANGED
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
exportBackup,
|
|
3
|
-
readBackupManifest,
|
|
4
|
-
restoreBackup,
|
|
5
|
-
verifyBackupChecksum
|
|
6
|
-
} from "./chunk-HS6DBMST.js";
|
|
7
1
|
import {
|
|
8
2
|
decodeAuditExport,
|
|
9
3
|
readAuditExportManifest,
|
|
@@ -39,7 +33,24 @@ import {
|
|
|
39
33
|
serializeRowVersion,
|
|
40
34
|
validateStateTransition,
|
|
41
35
|
validateUpdateStateMachine
|
|
42
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-YT7MRFCP.js";
|
|
37
|
+
import {
|
|
38
|
+
AdapterError,
|
|
39
|
+
NoLeaderError,
|
|
40
|
+
OptimisticLockError,
|
|
41
|
+
PersistenceError,
|
|
42
|
+
QueryError,
|
|
43
|
+
RecordNotFoundError,
|
|
44
|
+
StoreNotOpenError,
|
|
45
|
+
WorkerInitError,
|
|
46
|
+
WorkerTimeoutError
|
|
47
|
+
} from "./chunk-TUR7RGEP.js";
|
|
48
|
+
import {
|
|
49
|
+
exportBackup,
|
|
50
|
+
readBackupManifest,
|
|
51
|
+
restoreBackup,
|
|
52
|
+
verifyBackupChecksum
|
|
53
|
+
} from "./chunk-HS6DBMST.js";
|
|
43
54
|
import {
|
|
44
55
|
decodeRichtext,
|
|
45
56
|
decodeRichtextFieldsFromOpData,
|
|
@@ -52,17 +63,6 @@ import {
|
|
|
52
63
|
serializeOperation,
|
|
53
64
|
serializeRecord
|
|
54
65
|
} from "./chunk-GSJ7EEUC.js";
|
|
55
|
-
import {
|
|
56
|
-
AdapterError,
|
|
57
|
-
NoLeaderError,
|
|
58
|
-
OptimisticLockError,
|
|
59
|
-
PersistenceError,
|
|
60
|
-
QueryError,
|
|
61
|
-
RecordNotFoundError,
|
|
62
|
-
StoreNotOpenError,
|
|
63
|
-
WorkerInitError,
|
|
64
|
-
WorkerTimeoutError
|
|
65
|
-
} from "./chunk-TUR7RGEP.js";
|
|
66
66
|
|
|
67
67
|
// src/compaction/types.ts
|
|
68
68
|
var COMPACTION_BASELINE_META_KEY = "compaction_baseline_at";
|
|
@@ -2596,6 +2596,22 @@ var Store = class {
|
|
|
2596
2596
|
col.setMutationHandler(handler);
|
|
2597
2597
|
}
|
|
2598
2598
|
}
|
|
2599
|
+
/**
|
|
2600
|
+
* Notify this store that another same-origin runtime committed an operation to
|
|
2601
|
+
* the shared local database. The operation has already been persisted and
|
|
2602
|
+
* materialized by the database owner; this method only advances in-memory causal
|
|
2603
|
+
* watermarks and invalidates local reactive queries so already-open tabs stay
|
|
2604
|
+
* live without reapplying or rewriting the operation.
|
|
2605
|
+
*/
|
|
2606
|
+
notifyExternalOperation(operation) {
|
|
2607
|
+
this.ensureOpen();
|
|
2608
|
+
const definition = this.schema.collections[operation.collection];
|
|
2609
|
+
if (!definition) {
|
|
2610
|
+
return;
|
|
2611
|
+
}
|
|
2612
|
+
this.recordOperationSequence(operation);
|
|
2613
|
+
this.subscriptionManager.notify(operation.collection, operation);
|
|
2614
|
+
}
|
|
2599
2615
|
/**
|
|
2600
2616
|
* Build mutation context for a collection (used by ApplyPipeline side effects).
|
|
2601
2617
|
*/
|