@powerhousedao/reactor 6.2.3-dev.10 → 6.2.3-dev.12
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/{build-worker-executor-_x-U7e_A.js → build-worker-executor-DUjyF4NM.js} +2 -2
- package/dist/{build-worker-executor-_x-U7e_A.js.map → build-worker-executor-DUjyF4NM.js.map} +1 -1
- package/dist/{document-indexer-BRqfWhe1.js → document-indexer-C1oY6CaR.js} +162 -20
- package/dist/document-indexer-C1oY6CaR.js.map +1 -0
- package/dist/{drive-container-types-CE7dxz0_.js → drive-container-types-CS5IxDiA.js} +101 -62
- package/dist/drive-container-types-CS5IxDiA.js.map +1 -0
- package/dist/entry.js +2 -2
- package/dist/index.d.ts +171 -71
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +22 -12
- package/dist/index.js.map +1 -1
- package/dist/projection-entry.js +8 -8
- package/dist/projection-entry.js.map +1 -1
- package/dist/{projection-shard-manager-CPQc5XHL.js → projection-shard-manager-CUo4bF4O.js} +3 -2
- package/dist/projection-shard-manager-CUo4bF4O.js.map +1 -0
- package/dist/{worker-B12tBZmr.js → worker-g03lNM42.js} +2 -2
- package/dist/{worker-B12tBZmr.js.map → worker-g03lNM42.js.map} +1 -1
- package/package.json +4 -4
- package/dist/document-indexer-BRqfWhe1.js.map +0 -1
- package/dist/drive-container-types-CE7dxz0_.js.map +0 -1
- package/dist/projection-shard-manager-CPQc5XHL.js.map +0 -1
package/dist/entry.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { o as instrumentPgPool } from "./drive-container-types-
|
|
1
|
+
import { o as instrumentPgPool } from "./drive-container-types-CS5IxDiA.js";
|
|
2
2
|
import { n as errorToInfo, t as createForwardingLogger } from "./forwarding-logger-BBkMSxuJ.js";
|
|
3
|
-
import { n as defaultLoadFactory, t as buildWorkerExecutor } from "./build-worker-executor-
|
|
3
|
+
import { n as defaultLoadFactory, t as buildWorkerExecutor } from "./build-worker-executor-DUjyF4NM.js";
|
|
4
4
|
import { ConsoleLogger } from "document-model";
|
|
5
5
|
import { isMainThread, parentPort } from "node:worker_threads";
|
|
6
6
|
//#region src/executor/worker/run-worker.ts
|
package/dist/index.d.ts
CHANGED
|
@@ -712,6 +712,16 @@ interface IOperationStore {
|
|
|
712
712
|
* Returns operations for a document/scope/branch whose index is greater
|
|
713
713
|
* than the given revision.
|
|
714
714
|
*
|
|
715
|
+
* `paging.cursor` is opaque to callers: treat it only as the value
|
|
716
|
+
* returned in `nextCursor` from a previous page, never construct or
|
|
717
|
+
* interpret it directly. An implementation must never emit a `nextCursor`
|
|
718
|
+
* equal to the start-of-stream sentinel ("0"), since a caller that walks
|
|
719
|
+
* `nextCursor` to exhaustion would read that as "start over" and loop
|
|
720
|
+
* forever. The reference encoding (used by the Kysely and Hypercore
|
|
721
|
+
* stores) is the index to resume from, i.e. the last returned row's index
|
|
722
|
+
* plus one, so a page that happens to end at index 0 still produces a
|
|
723
|
+
* cursor distinguishable from the start sentinel.
|
|
724
|
+
*
|
|
715
725
|
* @param documentId - The document id
|
|
716
726
|
* @param scope - The operation scope
|
|
717
727
|
* @param branch - The branch name
|
|
@@ -734,6 +744,16 @@ interface IOperationStore {
|
|
|
734
744
|
/**
|
|
735
745
|
* Gets operations that may conflict with incoming operations during a load.
|
|
736
746
|
*
|
|
747
|
+
* `paging.cursor` is opaque to callers: treat it only as the value
|
|
748
|
+
* returned in `nextCursor` from a previous page, never construct or
|
|
749
|
+
* interpret it directly. An implementation must never emit a `nextCursor`
|
|
750
|
+
* equal to the start-of-stream sentinel ("0"), since a caller that walks
|
|
751
|
+
* `nextCursor` to exhaustion would read that as "start over" and loop
|
|
752
|
+
* forever. The reference encoding (used by the Kysely and Hypercore
|
|
753
|
+
* stores) is the index to resume from, i.e. the last returned row's index
|
|
754
|
+
* plus one, so a page that happens to end at index 0 still produces a
|
|
755
|
+
* cursor distinguishable from the start sentinel.
|
|
756
|
+
*
|
|
737
757
|
* @param documentId - The document id
|
|
738
758
|
* @param scope - The scope to query
|
|
739
759
|
* @param branch - The branch name
|
|
@@ -3409,8 +3429,22 @@ declare class KyselyOperationStore implements IOperationStore {
|
|
|
3409
3429
|
private findIdempotentReplay;
|
|
3410
3430
|
/** True when the staged write creates a document rather than appending to one. */
|
|
3411
3431
|
private isCreate;
|
|
3432
|
+
/**
|
|
3433
|
+
* The paging cursor here encodes the index to resume from (one past the
|
|
3434
|
+
* last row returned), not the last row's own index. This keeps "0" an
|
|
3435
|
+
* unambiguous start-of-stream sentinel even when a page ends at index 0
|
|
3436
|
+
* (e.g. `limit: 1` on a fresh stream), which would otherwise make
|
|
3437
|
+
* `nextCursor` equal the start cursor and loop a caller that walks pages
|
|
3438
|
+
* forever.
|
|
3439
|
+
*/
|
|
3412
3440
|
getSince(documentId: string, scope: string, branch: string, revision: number, filter?: OperationFilter, paging?: PagingOptions, signal?: AbortSignal): Promise<PagedResults<Operation>>;
|
|
3413
3441
|
getSinceId(id: number, paging?: PagingOptions, signal?: AbortSignal): Promise<PagedResults<OperationWithContext$1>>;
|
|
3442
|
+
/**
|
|
3443
|
+
* The paging cursor here encodes the index to resume from (one past the
|
|
3444
|
+
* last row returned), not the last row's own index, for the same reason as
|
|
3445
|
+
* `getSince`: a page ending at index 0 must not produce a cursor that is
|
|
3446
|
+
* indistinguishable from the start-of-stream sentinel.
|
|
3447
|
+
*/
|
|
3414
3448
|
getConflicting(documentId: string, scope: string, branch: string, minTimestamp: string, paging?: PagingOptions, signal?: AbortSignal): Promise<PagedResults<Operation>>;
|
|
3415
3449
|
getRevisions(documentId: string, branch: string, signal?: AbortSignal): Promise<DocumentRevisions>;
|
|
3416
3450
|
getStreamLatestTimestamp(documentId: string, scope: string, branch: string, signal?: AbortSignal): Promise<string | undefined>;
|
|
@@ -4390,6 +4424,7 @@ interface DocumentSnapshotTable {
|
|
|
4390
4424
|
documentType: string;
|
|
4391
4425
|
lastOperationIndex: number;
|
|
4392
4426
|
lastOperationHash: string;
|
|
4427
|
+
lastOperationOrdinal: Generated<number>;
|
|
4393
4428
|
lastUpdatedAt: Generated<Date>;
|
|
4394
4429
|
snapshotVersion: Generated<number>;
|
|
4395
4430
|
identifiers: unknown;
|
|
@@ -5463,6 +5498,101 @@ declare class NullDocumentModelResolver implements IDocumentModelResolver {
|
|
|
5463
5498
|
*/
|
|
5464
5499
|
type WorkerFactory = (index: number) => IExecutorWorker;
|
|
5465
5500
|
//#endregion
|
|
5501
|
+
//#region src/read-models/base-read-model.d.ts
|
|
5502
|
+
/** Bounds on an indexing pass: one transaction, and the stall between yields. */
|
|
5503
|
+
type ReadModelIndexingConfig = {
|
|
5504
|
+
/** Maximum operations committed in a single transaction. */commitChunkSize: number; /** Maximum elapsed milliseconds before yielding between chunks. */
|
|
5505
|
+
yieldDeadlineMs: number;
|
|
5506
|
+
};
|
|
5507
|
+
/** Small enough that a chunk's transaction rarely outlasts the yield deadline. */
|
|
5508
|
+
declare const DEFAULT_COMMIT_CHUNK_SIZE = 50;
|
|
5509
|
+
/** Matches the executor's own default, so both paths yield on the same cadence. */
|
|
5510
|
+
declare const DEFAULT_READ_MODEL_YIELD_DEADLINE_MS = 50;
|
|
5511
|
+
declare const defaultReadModelIndexingConfig: ReadModelIndexingConfig;
|
|
5512
|
+
/** For read models whose callers can observe where a batch was split. */
|
|
5513
|
+
declare const unchunkedReadModelIndexingConfig: ReadModelIndexingConfig;
|
|
5514
|
+
type BaseReadModelConfig = {
|
|
5515
|
+
readModelId: string;
|
|
5516
|
+
rebuildStateOnInit: boolean; /** Defaults to {@link defaultReadModelIndexingConfig}. */
|
|
5517
|
+
indexing?: ReadModelIndexingConfig;
|
|
5518
|
+
};
|
|
5519
|
+
/**
|
|
5520
|
+
* Base class for read models that provides catch-up/rewind functionality.
|
|
5521
|
+
* Handles initialization, state tracking via ViewState table, and consistency tracking.
|
|
5522
|
+
* Subclasses override commitOperations() with their specific domain logic.
|
|
5523
|
+
*/
|
|
5524
|
+
declare class BaseReadModel implements IReadModel {
|
|
5525
|
+
protected db: Kysely<DocumentViewDatabase>;
|
|
5526
|
+
protected operationIndex: IOperationIndex;
|
|
5527
|
+
protected writeCache: IWriteCache;
|
|
5528
|
+
protected consistencyTracker: IConsistencyTracker;
|
|
5529
|
+
protected config: BaseReadModelConfig;
|
|
5530
|
+
protected lastOrdinal: number;
|
|
5531
|
+
readonly name: string;
|
|
5532
|
+
private readonly indexing;
|
|
5533
|
+
/**
|
|
5534
|
+
* Lowest ordinal this model failed to commit and has not committed since, or
|
|
5535
|
+
* zero when there is none. The stored cursor is held below it so replay from
|
|
5536
|
+
* the cursor still reaches every operation the failed pass left out.
|
|
5537
|
+
*/
|
|
5538
|
+
private uncommittedOrdinal;
|
|
5539
|
+
constructor(db: Kysely<DocumentViewDatabase>, operationIndex: IOperationIndex, writeCache: IWriteCache, consistencyTracker: IConsistencyTracker, config: BaseReadModelConfig);
|
|
5540
|
+
/**
|
|
5541
|
+
* Initializes the read model by loading state and catching up on missed operations.
|
|
5542
|
+
*/
|
|
5543
|
+
init(): Promise<void>;
|
|
5544
|
+
/**
|
|
5545
|
+
* Commits the batch in chunks, yielding between them with no transaction
|
|
5546
|
+
* open. A chunk that throws leaves the earlier chunks committed, so the pass
|
|
5547
|
+
* saves the cursor for that prefix and parks it below the operation it could
|
|
5548
|
+
* not commit before rethrowing.
|
|
5549
|
+
*/
|
|
5550
|
+
indexOperations(items: OperationWithContext$1[]): Promise<void>;
|
|
5551
|
+
/**
|
|
5552
|
+
* Waits for the read model to reach the specified consistency level.
|
|
5553
|
+
*/
|
|
5554
|
+
waitForConsistency(token: ConsistencyToken, timeoutMs?: number, signal?: AbortSignal): Promise<void>;
|
|
5555
|
+
protected commitOperations(items: OperationWithContext$1[]): Promise<void>;
|
|
5556
|
+
/**
|
|
5557
|
+
* Rebuilds document state for each operation using the write cache.
|
|
5558
|
+
*/
|
|
5559
|
+
protected rebuildStateForOperations(operations: OperationWithContext$1[]): Promise<OperationWithContext$1[]>;
|
|
5560
|
+
/**
|
|
5561
|
+
* Loads the last processed ordinal from the ViewState table.
|
|
5562
|
+
* Returns undefined if no state exists for this read model.
|
|
5563
|
+
*/
|
|
5564
|
+
protected loadState(): Promise<number | undefined>;
|
|
5565
|
+
/**
|
|
5566
|
+
* Initializes the ViewState row for this read model.
|
|
5567
|
+
*/
|
|
5568
|
+
protected initializeState(): Promise<void>;
|
|
5569
|
+
/**
|
|
5570
|
+
* Saves the last processed ordinal to the ViewState table.
|
|
5571
|
+
*/
|
|
5572
|
+
protected saveState(trx: Transaction<DocumentViewDatabase>, items: OperationWithContext$1[]): Promise<void>;
|
|
5573
|
+
/**
|
|
5574
|
+
* Updates the consistency tracker with the processed operations.
|
|
5575
|
+
*/
|
|
5576
|
+
protected updateConsistencyTracker(items: OperationWithContext$1[]): void;
|
|
5577
|
+
/**
|
|
5578
|
+
* Saves the cursor for the chunks that did commit before a later chunk threw.
|
|
5579
|
+
* A failure here is swallowed: the cursor simply stays where the pass found
|
|
5580
|
+
* it, which is equally safe, and the commit error is the one worth raising.
|
|
5581
|
+
*/
|
|
5582
|
+
private recordCommittedPrefix;
|
|
5583
|
+
/** Writes the cursor for the given items, never past a parked ordinal. */
|
|
5584
|
+
private persistCursor;
|
|
5585
|
+
/**
|
|
5586
|
+
* Holds the cursor written by {@link saveState}, which subclasses may
|
|
5587
|
+
* override, below the lowest operation this model failed to commit.
|
|
5588
|
+
*/
|
|
5589
|
+
private clampCursorToPark;
|
|
5590
|
+
/** Remembers the lowest ordinal the failed pass left uncommitted. */
|
|
5591
|
+
private park;
|
|
5592
|
+
/** The park lifts once a later pass commits the operation that failed. */
|
|
5593
|
+
private liftParkIfCommitted;
|
|
5594
|
+
}
|
|
5595
|
+
//#endregion
|
|
5466
5596
|
//#region src/projection/protocol.d.ts
|
|
5467
5597
|
/**
|
|
5468
5598
|
* Identifier for a built-in read model the projection worker materializes
|
|
@@ -5498,6 +5628,12 @@ type ProjectionInitMessage = {
|
|
|
5498
5628
|
preReadyKinds: BuiltInReadModelKind[];
|
|
5499
5629
|
postReadyKinds: BuiltInReadModelKind[];
|
|
5500
5630
|
chainDepthReportIntervalMs: number;
|
|
5631
|
+
/**
|
|
5632
|
+
* Chunking bounds every read model this worker builds indexes under. The
|
|
5633
|
+
* host computes one config for both the in-process and the worker path, so
|
|
5634
|
+
* a tuned cadence cannot apply to one and not the other.
|
|
5635
|
+
*/
|
|
5636
|
+
indexing: ReadModelIndexingConfig;
|
|
5501
5637
|
};
|
|
5502
5638
|
/**
|
|
5503
5639
|
* Relays a JOB_WRITE_READY event from the host bus into the worker's
|
|
@@ -5702,6 +5838,11 @@ type ProjectionShardManagerConfig = ProjectionShardHooks & {
|
|
|
5702
5838
|
models: ModelManifestEntry[];
|
|
5703
5839
|
preReadyKinds: BuiltInReadModelKind[];
|
|
5704
5840
|
postReadyKinds: BuiltInReadModelKind[];
|
|
5841
|
+
/**
|
|
5842
|
+
* Chunking bounds the shards' read models index under. Comes from the same
|
|
5843
|
+
* host config the in-process read models get, so the two paths cannot drift.
|
|
5844
|
+
*/
|
|
5845
|
+
indexing: ReadModelIndexingConfig;
|
|
5705
5846
|
factory: ProjectionWorkerFactory;
|
|
5706
5847
|
logger: ILogger;
|
|
5707
5848
|
hostBus: IEventBus;
|
|
@@ -6149,6 +6290,10 @@ declare class ReactorBuilder {
|
|
|
6149
6290
|
* models never index an operation, so the manager advances these from the
|
|
6150
6291
|
* shards' relayed indexing reports; without them every read carrying a
|
|
6151
6292
|
* consistency token waits forever.
|
|
6293
|
+
* @param indexing The chunking bounds the host's own read models index
|
|
6294
|
+
* under. The shards' read models are built inside the worker, so without
|
|
6295
|
+
* this they would fall back to the library default and a host that tuned
|
|
6296
|
+
* the cadence would silently get it on the in-process path only.
|
|
6152
6297
|
* @param registerShutdownHook Whether the builder owns `manager.shutdown()`
|
|
6153
6298
|
* at signal time. False for the coordinator-factory path, whose factory
|
|
6154
6299
|
* registers its own hook so host chains drain before the worker stops.
|
|
@@ -6937,67 +7082,12 @@ declare function firstOutOfOrderPair(operations: Operation[], options?: {
|
|
|
6937
7082
|
requireStrict?: boolean;
|
|
6938
7083
|
}): OutOfOrderPair | undefined;
|
|
6939
7084
|
//#endregion
|
|
6940
|
-
//#region src/read-models/base-read-model.d.ts
|
|
6941
|
-
type BaseReadModelConfig = {
|
|
6942
|
-
readModelId: string;
|
|
6943
|
-
rebuildStateOnInit: boolean;
|
|
6944
|
-
};
|
|
6945
|
-
/**
|
|
6946
|
-
* Base class for read models that provides catch-up/rewind functionality.
|
|
6947
|
-
* Handles initialization, state tracking via ViewState table, and consistency tracking.
|
|
6948
|
-
* Subclasses override commitOperations() with their specific domain logic.
|
|
6949
|
-
*/
|
|
6950
|
-
declare class BaseReadModel implements IReadModel {
|
|
6951
|
-
protected db: Kysely<DocumentViewDatabase>;
|
|
6952
|
-
protected operationIndex: IOperationIndex;
|
|
6953
|
-
protected writeCache: IWriteCache;
|
|
6954
|
-
protected consistencyTracker: IConsistencyTracker;
|
|
6955
|
-
protected config: BaseReadModelConfig;
|
|
6956
|
-
protected lastOrdinal: number;
|
|
6957
|
-
readonly name: string;
|
|
6958
|
-
constructor(db: Kysely<DocumentViewDatabase>, operationIndex: IOperationIndex, writeCache: IWriteCache, consistencyTracker: IConsistencyTracker, config: BaseReadModelConfig);
|
|
6959
|
-
/**
|
|
6960
|
-
* Initializes the read model by loading state and catching up on missed operations.
|
|
6961
|
-
*/
|
|
6962
|
-
init(): Promise<void>;
|
|
6963
|
-
/**
|
|
6964
|
-
* Template method: runs domain-specific commitOperations, then persists
|
|
6965
|
-
* state and updates consistency tracking.
|
|
6966
|
-
*/
|
|
6967
|
-
indexOperations(items: OperationWithContext$1[]): Promise<void>;
|
|
6968
|
-
/**
|
|
6969
|
-
* Waits for the read model to reach the specified consistency level.
|
|
6970
|
-
*/
|
|
6971
|
-
waitForConsistency(token: ConsistencyToken, timeoutMs?: number, signal?: AbortSignal): Promise<void>;
|
|
6972
|
-
protected commitOperations(items: OperationWithContext$1[]): Promise<void>;
|
|
6973
|
-
/**
|
|
6974
|
-
* Rebuilds document state for each operation using the write cache.
|
|
6975
|
-
*/
|
|
6976
|
-
protected rebuildStateForOperations(operations: OperationWithContext$1[]): Promise<OperationWithContext$1[]>;
|
|
6977
|
-
/**
|
|
6978
|
-
* Loads the last processed ordinal from the ViewState table.
|
|
6979
|
-
* Returns undefined if no state exists for this read model.
|
|
6980
|
-
*/
|
|
6981
|
-
protected loadState(): Promise<number | undefined>;
|
|
6982
|
-
/**
|
|
6983
|
-
* Initializes the ViewState row for this read model.
|
|
6984
|
-
*/
|
|
6985
|
-
protected initializeState(): Promise<void>;
|
|
6986
|
-
/**
|
|
6987
|
-
* Saves the last processed ordinal to the ViewState table.
|
|
6988
|
-
*/
|
|
6989
|
-
protected saveState(trx: Transaction<DocumentViewDatabase>, items: OperationWithContext$1[]): Promise<void>;
|
|
6990
|
-
/**
|
|
6991
|
-
* Updates the consistency tracker with the processed operations.
|
|
6992
|
-
*/
|
|
6993
|
-
protected updateConsistencyTracker(items: OperationWithContext$1[]): void;
|
|
6994
|
-
}
|
|
6995
|
-
//#endregion
|
|
6996
7085
|
//#region src/storage/kysely/document-indexer.d.ts
|
|
6997
7086
|
type IndexerDatabase = Database$1 & DocumentIndexerDatabase & DocumentViewDatabase;
|
|
6998
7087
|
declare class KyselyDocumentIndexer extends BaseReadModel implements IDocumentIndexer {
|
|
6999
7088
|
private _db;
|
|
7000
|
-
constructor(db: Kysely<IndexerDatabase>, operationIndex: IOperationIndex, writeCache: IWriteCache, consistencyTracker: IConsistencyTracker);
|
|
7089
|
+
constructor(db: Kysely<IndexerDatabase>, operationIndex: IOperationIndex, writeCache: IWriteCache, consistencyTracker: IConsistencyTracker, indexing?: ReadModelIndexingConfig);
|
|
7090
|
+
/** Opens no transaction for a batch carrying no relationship operation. */
|
|
7001
7091
|
protected commitOperations(items: OperationWithContext$1[]): Promise<void>;
|
|
7002
7092
|
getOutgoing(documentId: string, types?: string[], paging?: PagingOptions, consistencyToken?: ConsistencyToken, signal?: AbortSignal): Promise<PagedResults<DocumentRelationship>>;
|
|
7003
7093
|
getIncoming(documentId: string, types?: string[], paging?: PagingOptions, consistencyToken?: ConsistencyToken, signal?: AbortSignal): Promise<PagedResults<DocumentRelationship>>;
|
|
@@ -7052,23 +7142,28 @@ declare class ReadModelCoordinator implements ILiveReadModelCoordinator {
|
|
|
7052
7142
|
//#endregion
|
|
7053
7143
|
//#region src/read-models/document-view.d.ts
|
|
7054
7144
|
type Database$2 = Database$1 & DocumentViewDatabase;
|
|
7055
|
-
|
|
7056
|
-
|
|
7145
|
+
/**
|
|
7146
|
+
* What a single-document read of a deleted document returns. A listing omits a
|
|
7147
|
+
* deleted document under either value.
|
|
7148
|
+
*/
|
|
7149
|
+
declare enum DeletedDocumentRead {
|
|
7057
7150
|
/**
|
|
7058
|
-
*
|
|
7059
|
-
*
|
|
7060
|
-
* which is what makes deletion positional. Listings omit it either way.
|
|
7151
|
+
* The document reads as missing: `get` throws and `resolveIdOrSlug` does not
|
|
7152
|
+
* match its id.
|
|
7061
7153
|
*/
|
|
7062
|
-
|
|
7063
|
-
private _db;
|
|
7064
|
-
constructor(db: Kysely<Database$2>, operationStore: IOperationStore, operationIndex: IOperationIndex, writeCache: IWriteCache, consistencyTracker: IConsistencyTracker,
|
|
7154
|
+
NotFound = "NotFound",
|
|
7065
7155
|
/**
|
|
7066
|
-
*
|
|
7067
|
-
*
|
|
7068
|
-
* which is what makes deletion positional.
|
|
7156
|
+
* The document's state as of the deletion, with `state.document.isDeleted`
|
|
7157
|
+
* telling the caller what it holds. Only meaningful with `documentDecisions`,
|
|
7158
|
+
* which is what makes deletion positional.
|
|
7069
7159
|
*/
|
|
7070
|
-
|
|
7071
|
-
|
|
7160
|
+
StateAtDeletion = "StateAtDeletion"
|
|
7161
|
+
}
|
|
7162
|
+
declare class KyselyDocumentView extends BaseReadModel implements IDocumentView {
|
|
7163
|
+
private operationStore;
|
|
7164
|
+
private readonly deletedDocumentRead;
|
|
7165
|
+
private _db;
|
|
7166
|
+
constructor(db: Kysely<Database$2>, operationStore: IOperationStore, operationIndex: IOperationIndex, writeCache: IWriteCache, consistencyTracker: IConsistencyTracker, deletedDocumentRead: DeletedDocumentRead, indexing?: ReadModelIndexingConfig);
|
|
7072
7167
|
/**
|
|
7073
7168
|
* Indexes committed operations into DocumentSnapshot rows. CREATE_DOCUMENT
|
|
7074
7169
|
* only seeds header/document/auth. UPGRADE_DOCUMENT reindexes every scope
|
|
@@ -7078,6 +7173,11 @@ declare class KyselyDocumentView extends BaseReadModel implements IDocumentView
|
|
|
7078
7173
|
* without either fall back to header/document/auth, because their sibling
|
|
7079
7174
|
* echoes may be stale. All other action types index only header and their
|
|
7080
7175
|
* own scope.
|
|
7176
|
+
*
|
|
7177
|
+
* The header row is the one row every scope's chain writes, so it accepts a
|
|
7178
|
+
* write only from an operation whose global ordinal is at least the one the
|
|
7179
|
+
* row already carries. Without that, a chunked pass that started earlier
|
|
7180
|
+
* reverts a concurrent rename with the stale echo its later chunks carry.
|
|
7081
7181
|
*/
|
|
7082
7182
|
protected commitOperations(items: OperationWithContext$1[]): Promise<void>;
|
|
7083
7183
|
exists(documentIds: string[], existence: DocumentExistence, consistencyToken?: ConsistencyToken, signal?: AbortSignal): Promise<boolean[]>;
|
|
@@ -7675,5 +7775,5 @@ declare class ProcessorManager extends BaseReadModel implements IProcessorManage
|
|
|
7675
7775
|
private deleteProcessorCursors;
|
|
7676
7776
|
}
|
|
7677
7777
|
//#endregion
|
|
7678
|
-
export { ALWAYS_READABLE_SCOPES, APPEND_CONDITION_FAILED_PREFIX, type AbortMessage, type ActionCandidate, type ActionEvaluationConfig, type ActionEvaluations, type AdmissionDecision, type AppendCondition, AppendConditionFailedError, type AppendConditionStream, type AtomicTxn, type AttachmentHash, type AttachmentRef, type AuthDecisionModel, AuthEnforcementDisabledError, BareReadGate, BaseReadModel, type BatchExecutionRequest, type BatchExecutionResult, type BatchLoadRequest, type BatchLoadResult, type BuiltDecisionModel, type BuiltInReadModelKind, type CachedSnapshot, type ChannelConfig, ChannelError, ChannelErrorSource, type ChannelHealth, type ChannelMeta, ChannelScheme, type ConnectionState, type ConnectionStateChangeCallback, type ConnectionStateChangedEvent, type ConnectionStateSnapshot, type ConsistencyCoordinate, type ConsistencyKey, type ConsistencyToken, ConsistencyTracker, DEFAULT_DRIVE_CONTAINER_TYPES, DOCUMENT_INDEXER_READ_MODEL, DOCUMENT_VIEW_READ_MODEL, DRIVE_AUTH_ERROR_MESSAGES, type Database, type DbConfig, type DeadLetterAddedEvent, type DecisionContext, type DecisionModel, type DecisionTarget, DefaultSubscriptionErrorHandler, type DegradedComponent, DocumentAlreadyExistsError, type DocumentChangeEvent, DocumentChangeType, type DocumentDecisionModel, DocumentExistence, type DocumentGraphEdge, type DocumentIndexerDatabase, DocumentIntegrityService, DocumentModelRegistry, DocumentModelResolver, type DocumentModelSource, type DocumentModelSpec, type DocumentRelationship, type DocumentRevisions, type DocumentStreamKey, type DocumentViewDatabase, DriveClient, DriveCollectionId, DriveRequestError, DuplicateManifestError, DuplicateModuleError, DuplicateOperationError, type Evaluation, EventBus, EventBusAggregateError, type ExecuteMessage, type ExecutionJobPlan, type ExecutorStartedEvent, type ExecutorStoppedEvent, type FactorySpec, type FileModelSource, type GqlChannelConfig, GqlRequestChannel, GqlRequestChannelFactory, GqlResponseChannel, GqlResponseChannelFactory, type HeartbeatMessage, HybridProjectionCoordinator, type HybridProjectionCoordinatorOptions, type HybridProjectionOptions, type IChannel, type IChannelFactory, type IConsistencyTracker, type IDocumentGraph, type IDocumentIndexer, type IDocumentIntegrityService, type IDocumentModelLoader, type IDocumentModelRegistry, type IDocumentModelResolver, type IDocumentView, type IDriveClient, type IEventBus, type IJobAwaiter, type IJobExecutor, type IJobExecutorManager, type IJobTracker, type IKeyframeStore, type ILiveReadModelCoordinator, type IMailbox, type IOperationIndex, type IOperationStore, type IPollTimer, type IProcessor, type IProcessorHostModuleBase, type IProcessorManager, type IProjectionTransport, type IQueue, type IReactor, type IReactorClient, type IReactorProcessorHostModuleBase, type IReactorSubscriptionManager, type IReadGate, type IReadModel, type IReadModelCoordinator, type IRelationalDb, type IStreamStateReader, type ISubscriptionErrorHandler, type ISyncCursorStorage, type ISyncManager, type ISyncRemoteStorage, type ISyncStatusTracker, type IWriteCache, SimpleJobExecutor as InMemoryJobExecutor, SimpleJobExecutor, InMemoryJobTracker, InMemoryQueue, type InProcessReactorClientModule, type InProcessReactorModule, type InProcessSyncModule, type InitMessage, type InsertableDocumentSnapshot, IntervalPollTimer, InvalidModuleError, type Job, type JobAvailableEvent, JobAwaiter, type JobCompletedEvent, type JobExecutorConfig, JobExecutorEventTypes, type JobExecutorFactory, type JobFailedEvent, type JobInfo, type JobPendingEvent, type JobReadReadyEvent, type JobResult, type JobResultSummary, type JobRunningEvent, type JobStartedEvent, JobStatus, type JobWriteReadyEvent, type JobWriteReadyPayload, type JwtHandler, type KeyframeSnapshot, type KeyframeValidationIssue, KyselyDocumentIndexer, KyselyDocumentView, KyselyKeyframeStore, KyselyOperationStore, KyselySyncCursorStorage, KyselySyncRemoteStorage, KyselyWriteCache, type LoadJobPlan, type LoadModelMessage, type LogMessage, Mailbox, type MetricsMessage, type ModelLoadFailedMessage, type ModelLoadedEvent, type ModelLoadedMessage, type ModelManifestEntry, ModelReadGate, ModuleNotFoundError, type ModuleRef, NullDocumentModelResolver, type OperationBatch, type OperationContext, type OperationFilter, type OperationIndexEntry, type OperationTable, type OperationWithContext, OptimisticLockError, type OutOfOrderPair, type PackageModelSource, type PagedResults, type PagingOptions, type ParentMessage, type ParsedDriveUrl, type ParsedPaging, PollBehavior, PollingChannelError, type PoolInstrumentation, type PoolStats, type ProcessorApp, type ProcessorFactory, type ProcessorFactoryBuilder, type ProcessorFilter, ProcessorManager, type ProcessorRecord, type ProcessorStatus, type Projection, type ProjectionShardBuilderConfig, type ProjectionShardHooks, type ProjectionShardManagerConfig, type ProjectionWorkerFactory, PropagationMode, QueueEventTypes, REACTOR_SCHEMA, RECOVERABLE_GRAPHQL_ERROR_CODES, Reactor, ReactorBuilder, ReactorClient, ReactorClientBuilder, type ReactorClientModule, ReactorEventTypes, type ReactorFeatureFlags, type ReactorFeatures, type ReactorHostModuleBaseOptions, type JobFailedEvent$1 as ReactorJobFailedEvent, type ReactorModule, type ReactorReadModels, ReactorSubscriptionManager, type ReadGateOptions, type ReadModelBatchCompletedEvent, ReadModelCoordinator, type ReadModelCoordinatorFactory, type ReadModelCoordinatorFactoryDeps, type ReadModelFactory, type ReadModelFactoryDeps, type ReadModelIndexedEvent, type ReadModelIndexingStage, type ReadModelRegistrationStage, type ReadModelStage, type ReadyMessage, type RebuildResult, type RegisteredDecisionModel, RelationalDbProcessor, RelationshipChangeType, RelationshipNotFoundError, type Remote, type RemoteCursor, type RemoteFilter, type RemoteMeta, type RemoteOptions, type RemoteRecord, type RemoteStatus, type ResultMessage, RetryAccounting, RevisionMismatchError, type SanitizedArg, type SearchFilter, SeededStateReader, type ShutdownMessage, type ShutdownStatus, type SignatureVerificationHandler, type SignatureVerifierSpec, type SignerConfig, SimpleJobExecutorManager, type SnapshotValidationIssue, type Database$1 as StorageDatabase, type StreamOrderIssue, type StreamQuery, type SubmittedActionResult, type SubscriptionErrorContext, SyncBuilder, type SyncEnvelope, type SyncEnvelopeType, SyncEventTypes, type SyncFailedEvent, type SyncModule, SyncOperation, SyncOperationAggregateError, type SyncOperationErrorType, SyncOperationStatus, type SyncPendingEvent, SyncScopeGate, SyncStatus, type SyncStatusChangeCallback, SyncStatusTracker, type SyncSucceededEvent, type TrackedProcessor, type Unsubscribe, type ValidationResult, type ViewFilter, type ErrorInfo as WorkerErrorInfo, type WorkerMessage, type WorkerPoolConfig, type WorkerPoolOptions, type WriteCacheConfig, addRelationshipAction, authDecisionModel, batchOperationsByDocument, buildDecisionModel, classifyJobFailure, consolidateSyncOperations, createDocumentAction, createForwardingLogger, createHybridProjectionCoordinatorFactory, createMutableShutdownStatus, createReactorHostModuleBase, createRelationalDb, decideAtHead, deleteDocumentAction, documentActions, documentDecisionModel, driveIdFromUrl, envelopesToSyncOperations, errorToInfo, firstOutOfOrderPair, getMigrationStatus, instrumentPgPool, isDriveAuthError, isRecoverableGraphQLError, makeConsistencyKey, parseDriveUrl, parsePagingOptions, quarantinesDocument, readDecisionModel, removeRelationshipAction, runMigrations, sanitizeArg, selectDecisionModel, supportsLiveReadModelRegistration, syncOperationErrorType, trimMailboxFromAckOrdinal, updateRelationshipAction, upgradeDocumentAction, workerEntryPath };
|
|
7778
|
+
export { ALWAYS_READABLE_SCOPES, APPEND_CONDITION_FAILED_PREFIX, type AbortMessage, type ActionCandidate, type ActionEvaluationConfig, type ActionEvaluations, type AdmissionDecision, type AppendCondition, AppendConditionFailedError, type AppendConditionStream, type AtomicTxn, type AttachmentHash, type AttachmentRef, type AuthDecisionModel, AuthEnforcementDisabledError, BareReadGate, BaseReadModel, type BaseReadModelConfig, type BatchExecutionRequest, type BatchExecutionResult, type BatchLoadRequest, type BatchLoadResult, type BuiltDecisionModel, type BuiltInReadModelKind, type CachedSnapshot, type ChannelConfig, ChannelError, ChannelErrorSource, type ChannelHealth, type ChannelMeta, ChannelScheme, type ConnectionState, type ConnectionStateChangeCallback, type ConnectionStateChangedEvent, type ConnectionStateSnapshot, type ConsistencyCoordinate, type ConsistencyKey, type ConsistencyToken, ConsistencyTracker, DEFAULT_COMMIT_CHUNK_SIZE, DEFAULT_DRIVE_CONTAINER_TYPES, DEFAULT_READ_MODEL_YIELD_DEADLINE_MS, DOCUMENT_INDEXER_READ_MODEL, DOCUMENT_VIEW_READ_MODEL, DRIVE_AUTH_ERROR_MESSAGES, type Database, type DbConfig, type DeadLetterAddedEvent, type DecisionContext, type DecisionModel, type DecisionTarget, DefaultSubscriptionErrorHandler, type DegradedComponent, DeletedDocumentRead, DocumentAlreadyExistsError, type DocumentChangeEvent, DocumentChangeType, type DocumentDecisionModel, DocumentExistence, type DocumentGraphEdge, type DocumentIndexerDatabase, DocumentIntegrityService, DocumentModelRegistry, DocumentModelResolver, type DocumentModelSource, type DocumentModelSpec, type DocumentRelationship, type DocumentRevisions, type DocumentStreamKey, type DocumentViewDatabase, DriveClient, DriveCollectionId, DriveRequestError, DuplicateManifestError, DuplicateModuleError, DuplicateOperationError, type Evaluation, EventBus, EventBusAggregateError, type ExecuteMessage, type ExecutionJobPlan, type ExecutorStartedEvent, type ExecutorStoppedEvent, type FactorySpec, type FileModelSource, type GqlChannelConfig, GqlRequestChannel, GqlRequestChannelFactory, GqlResponseChannel, GqlResponseChannelFactory, type HeartbeatMessage, HybridProjectionCoordinator, type HybridProjectionCoordinatorOptions, type HybridProjectionOptions, type IChannel, type IChannelFactory, type IConsistencyTracker, type IDocumentGraph, type IDocumentIndexer, type IDocumentIntegrityService, type IDocumentModelLoader, type IDocumentModelRegistry, type IDocumentModelResolver, type IDocumentView, type IDriveClient, type IEventBus, type IJobAwaiter, type IJobExecutor, type IJobExecutorManager, type IJobTracker, type IKeyframeStore, type ILiveReadModelCoordinator, type IMailbox, type IOperationIndex, type IOperationStore, type IPollTimer, type IProcessor, type IProcessorHostModuleBase, type IProcessorManager, type IProjectionTransport, type IQueue, type IReactor, type IReactorClient, type IReactorProcessorHostModuleBase, type IReactorSubscriptionManager, type IReadGate, type IReadModel, type IReadModelCoordinator, type IRelationalDb, type IStreamStateReader, type ISubscriptionErrorHandler, type ISyncCursorStorage, type ISyncManager, type ISyncRemoteStorage, type ISyncStatusTracker, type IWriteCache, SimpleJobExecutor as InMemoryJobExecutor, SimpleJobExecutor, InMemoryJobTracker, InMemoryQueue, type InProcessReactorClientModule, type InProcessReactorModule, type InProcessSyncModule, type InitMessage, type InsertableDocumentSnapshot, IntervalPollTimer, InvalidModuleError, type Job, type JobAvailableEvent, JobAwaiter, type JobCompletedEvent, type JobExecutorConfig, JobExecutorEventTypes, type JobExecutorFactory, type JobFailedEvent, type JobInfo, type JobPendingEvent, type JobReadReadyEvent, type JobResult, type JobResultSummary, type JobRunningEvent, type JobStartedEvent, JobStatus, type JobWriteReadyEvent, type JobWriteReadyPayload, type JwtHandler, type KeyframeSnapshot, type KeyframeValidationIssue, KyselyDocumentIndexer, KyselyDocumentView, KyselyKeyframeStore, KyselyOperationStore, KyselySyncCursorStorage, KyselySyncRemoteStorage, KyselyWriteCache, type LoadJobPlan, type LoadModelMessage, type LogMessage, Mailbox, type MetricsMessage, type ModelLoadFailedMessage, type ModelLoadedEvent, type ModelLoadedMessage, type ModelManifestEntry, ModelReadGate, ModuleNotFoundError, type ModuleRef, NullDocumentModelResolver, type OperationBatch, type OperationContext, type OperationFilter, type OperationIndexEntry, type OperationTable, type OperationWithContext, OptimisticLockError, type OutOfOrderPair, type PackageModelSource, type PagedResults, type PagingOptions, type ParentMessage, type ParsedDriveUrl, type ParsedPaging, PollBehavior, PollingChannelError, type PoolInstrumentation, type PoolStats, type ProcessorApp, type ProcessorFactory, type ProcessorFactoryBuilder, type ProcessorFilter, ProcessorManager, type ProcessorRecord, type ProcessorStatus, type Projection, type ProjectionShardBuilderConfig, type ProjectionShardHooks, type ProjectionShardManagerConfig, type ProjectionWorkerFactory, PropagationMode, QueueEventTypes, REACTOR_SCHEMA, RECOVERABLE_GRAPHQL_ERROR_CODES, Reactor, ReactorBuilder, ReactorClient, ReactorClientBuilder, type ReactorClientModule, ReactorEventTypes, type ReactorFeatureFlags, type ReactorFeatures, type ReactorHostModuleBaseOptions, type JobFailedEvent$1 as ReactorJobFailedEvent, type ReactorModule, type ReactorReadModels, ReactorSubscriptionManager, type ReadGateOptions, type ReadModelBatchCompletedEvent, ReadModelCoordinator, type ReadModelCoordinatorFactory, type ReadModelCoordinatorFactoryDeps, type ReadModelFactory, type ReadModelFactoryDeps, type ReadModelIndexedEvent, type ReadModelIndexingConfig, type ReadModelIndexingStage, type ReadModelRegistrationStage, type ReadModelStage, type ReadyMessage, type RebuildResult, type RegisteredDecisionModel, RelationalDbProcessor, RelationshipChangeType, RelationshipNotFoundError, type Remote, type RemoteCursor, type RemoteFilter, type RemoteMeta, type RemoteOptions, type RemoteRecord, type RemoteStatus, type ResultMessage, RetryAccounting, RevisionMismatchError, type SanitizedArg, type SearchFilter, SeededStateReader, type ShutdownMessage, type ShutdownStatus, type SignatureVerificationHandler, type SignatureVerifierSpec, type SignerConfig, SimpleJobExecutorManager, type SnapshotValidationIssue, type Database$1 as StorageDatabase, type StreamOrderIssue, type StreamQuery, type SubmittedActionResult, type SubscriptionErrorContext, SyncBuilder, type SyncEnvelope, type SyncEnvelopeType, SyncEventTypes, type SyncFailedEvent, type SyncModule, SyncOperation, SyncOperationAggregateError, type SyncOperationErrorType, SyncOperationStatus, type SyncPendingEvent, SyncScopeGate, SyncStatus, type SyncStatusChangeCallback, SyncStatusTracker, type SyncSucceededEvent, type TrackedProcessor, type Unsubscribe, type ValidationResult, type ViewFilter, type ErrorInfo as WorkerErrorInfo, type WorkerMessage, type WorkerPoolConfig, type WorkerPoolOptions, type WriteCacheConfig, addRelationshipAction, authDecisionModel, batchOperationsByDocument, buildDecisionModel, classifyJobFailure, consolidateSyncOperations, createDocumentAction, createForwardingLogger, createHybridProjectionCoordinatorFactory, createMutableShutdownStatus, createReactorHostModuleBase, createRelationalDb, decideAtHead, defaultReadModelIndexingConfig, deleteDocumentAction, documentActions, documentDecisionModel, driveIdFromUrl, envelopesToSyncOperations, errorToInfo, firstOutOfOrderPair, getMigrationStatus, instrumentPgPool, isDriveAuthError, isRecoverableGraphQLError, makeConsistencyKey, parseDriveUrl, parsePagingOptions, quarantinesDocument, readDecisionModel, removeRelationshipAction, runMigrations, sanitizeArg, selectDecisionModel, supportsLiveReadModelRegistration, syncOperationErrorType, trimMailboxFromAckOrdinal, unchunkedReadModelIndexingConfig, updateRelationshipAction, upgradeDocumentAction, workerEntryPath };
|
|
7679
7779
|
//# sourceMappingURL=index.d.ts.map
|