@powerhousedao/reactor 6.2.3-dev.50 → 6.2.3-dev.51
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/{document-indexer-DwAMDVRI.js → document-indexer-3fkVWCaN.js} +26 -14
- package/dist/document-indexer-3fkVWCaN.js.map +1 -0
- package/dist/{drive-container-types-Ci1pdv4X.js → drive-container-types-BAfFzBOf.js} +133 -7
- package/dist/drive-container-types-BAfFzBOf.js.map +1 -0
- package/dist/entry.js +2 -2
- package/dist/{forwarding-logger-ByfBFgMS.js → forwarding-logger-B9LLXItm.js} +111 -79
- package/dist/forwarding-logger-B9LLXItm.js.map +1 -0
- package/dist/{index-CNhT69De.d.ts → index-dDm0fUBT.d.ts} +518 -68
- package/dist/index-dDm0fUBT.d.ts.map +1 -0
- package/dist/index.d.ts +1040 -138
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3110 -776
- package/dist/index.js.map +1 -1
- package/dist/projection-entry.js +2 -2
- package/dist/{projection-shard-manager-CQ5FwQmv.js → projection-shard-manager-Drl9w8Eo.js} +3 -13
- package/dist/projection-shard-manager-Drl9w8Eo.js.map +1 -0
- package/dist/rpc.d.ts +32 -6
- package/dist/rpc.d.ts.map +1 -1
- package/dist/rpc.js +8 -4
- package/dist/rpc.js.map +1 -1
- package/dist/{worker-handle-CN2-oRv-.js → worker-handle-Nso8i5eU.js} +2 -2
- package/dist/{worker-handle-CN2-oRv-.js.map → worker-handle-Nso8i5eU.js.map} +1 -1
- package/dist/worker-pool-router-BROOEQSE.js +35 -0
- package/dist/worker-pool-router-BROOEQSE.js.map +1 -0
- package/package.json +3 -3
- package/dist/document-indexer-DwAMDVRI.js.map +0 -1
- package/dist/drive-container-types-Ci1pdv4X.js.map +0 -1
- package/dist/forwarding-logger-ByfBFgMS.js.map +0 -1
- package/dist/index-CNhT69De.d.ts.map +0 -1
- package/dist/projection-shard-manager-CQ5FwQmv.js.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { $ as
|
|
2
|
-
import { Action, AuthSubject, CreateDocumentActionInput, DocumentModelModule, ISigner, Operation, OperationContext, OperationWithContext, OperationWithContext as OperationWithContext$1, PHAuthState, PHDocument, PHDocumentState, PURGE_DOCUMENT, PeerCapability, PeerManifest, PurgeDocumentAction, PurgeDocumentActionInput, PurgeMarkerOperation, SignaturePolicy, UpgradeDocumentActionInput, UpgradeManifest, actions as documentActions, isPurgeMarker } from "@powerhousedao/shared/document-model";
|
|
1
|
+
import { $ as DEFAULT_READ_MODEL_YIELD_DEADLINE_MS, $a as SyncPendingEvent, $i as AtomicTxn, $n as QueueStateSnapshot, $r as ModelLoadedMessage, $t as PeerManifestListener, A as PGliteFlushSyncTimeoutError, Aa as ConnectionState, Ai as IDocumentModelLoader, An as DeadLetterPage, Ao as SubmittedActionResult, Ar as Unsubscribe, At as CreateDocumentOptions, B as PGliteSessionPoisonedError, Ba as RemoteOptions, Bi as IDocumentMetaCache, Bn as IInspectorAdmin, Br as AbortMessage, Bt as DecisionTarget, C as ReactorClientModule, Ca as SyncHoldRecord, Ci as KyselyDocumentPurger, Cn as IJobAwaiter, Co as JobStatus, Cr as ReactorEventTypes, Ct as RegisteredDecisionModel, D as GroupCommitPGliteOptions, Da as ChannelHealth, Di as KyselyOperationStore, Dn as IQueue, Do as RelationshipChangeType, Dr as ReadModelStage, Dt as documentDecisionModel, E as SyncModule, Ea as ChannelErrorSource, Ei as KyselyKeyframeStore, En as EnqueuePurgeOptions, Eo as PropagationMode, Er as ReadModelIndexingStage, Et as DocumentDecisionModel, F as HardenedPGliteDialectOptions, Fa as LocalPeer, Fi as Database$1, Fn as RemoteSyncInspection, Fo as SnapshotValidationIssue, Fr as SignatureTrustPolicy, Ft as ProtocolSelection, G as StorageHealth, Ga as SyncEnvelope, Gi as CachedSnapshot, Gn as InspectorAttachmentInfo, Gr as FactorySpec, Gt as IPeerAgreement, H as isLongRunningStatement, Ha as RemotePersistence, Hi as DriveCollectionId, Hn as IReactorDbQuery, Hr as DocumentModelSpec, Ht as IStreamStateReader, I as PGliteAbortedTransactionError, Ia as PollBehavior, Ii as DocumentIndexerDatabase, In as deriveConnectionHealth, Io as StreamOrderIssue, Ir as SignatureVerdict, It as UpgradeDocumentOptions, J as PoolStats, Ja as SyncFailedEvent, Ji as WriteCacheConfig, Jn as InspectorDriveIntegrity, Jr as JobWriteReadyPayload, Jt as ConnectionStateChangeCallback, K as ForwardingPoolInstrumentation, Ka as SyncEnvelopeType, Ki as DocumentStreamKey, Kn as InspectorDocumentModelInfo, Kr as HeartbeatMessage, Kt as PeerAgreementBasis, L as PGliteAcquireTimeoutError, La as PurgeLookup, Li as DocumentPurgeRow, Ln as IInspectableAttachmentStore, Lo as ValidationResult, Lr as SignatureVerificationHandler, Lt as BuiltDecisionModel, M as DEFAULT_RECOVERY_TIMEOUT_MS, Ma as ConnectionStateSnapshot, Mi as DocumentModelSource, Mn as MailboxDepths, Mo as IDocumentIntegrityService, Mr as SIGNATURE_REFUSAL_CODES, Mt as DocumentChangeType, N as DEFAULT_STATEMENT_TIMEOUT_MS, Na as DeadLetterAddedEvent, Ni as FileModelSource, Nn as RemoteConnectionHealth, No as KeyframeValidationIssue, Nr as SignatureRefusalCode, Nt as IDriveClient, O as IGroupCommitStorage, Oa as ChannelMeta, Oi as KyselyWriteCache, On as IJobTracker, Oo as SearchFilter, Or as SignatureRefusedEvent, Ot as ActionCandidate, P as HardenedPGliteDialect, Pa as JwtHandler, Pi as PackageModelSource, Pn as RemoteCursorInfo, Po as RebuildResult, Pr as SignatureScheme, Pt as IReactorClient, Q as DEFAULT_COMMIT_CHUNK_SIZE, Qa as SyncOperationStatus, Qi as AppendConditionStream, Qn as InspectorStorageHealth, Qr as ModelLoadFailedMessage, Qt as ISyncManager, R as PGliteSession, Ra as RemoteCursor, Ri as OperationTable, Rn as IInspectableQueue, Ro as OutOfOrderPair, Rr as SignatureVerificationMode, Rt as DecisionContext, S as LoadJobPlan, Sa as RevisionMismatchError, Si as DEFAULT_PURGE_DELETE_BATCH, Sn as SubscriptionErrorContext, So as JobResultSummary, Sr as PurgeMarkerContext, St as AdmissionDecision, T as ReactorModule, Ta as ChannelConfig, Ti as appliedDelete, Tn as DocumentPurgeService, To as PagingOptions, Tr as ReadModelIndexedEvent, Tt as selectDecisionModel, U as queryThroughDialect, Ua as RemoteRecord, Ui as IOperationIndex, Un as IReactorFactsSink, Ur as ErrorInfo, Ut as Projection, V as PGliteStatementTimeoutError, Va as RemotePeer, Vi as ICollectionMembershipCache, Vn as IInspectorStorageHealthProvider, Vr as DbConfig, Vt as Evaluation, W as IStorageHealthProvider, Wa as RemoteStatus, Wi as OperationIndexEntry, Wn as InspectorAccess, Wr as ExecuteMessage, Wt as StreamQuery, X as BaseReadModel, Xa as SyncHold, Xi as AppendCondition, Xn as InspectorDrivePage, Xr as LogMessage, Xt as IChannelFactory, Y as instrumentPgPool, Ya as SyncHeldEvent, Yi as APPEND_CONDITION_FAILED_PREFIX, Yn as InspectorDriveIntegrityRef, Yr as LoadModelMessage, Yt as IChannel, Z as BaseReadModelConfig, Za as SyncOperationErrorType, Zi as AppendConditionFailedError, Zn as InspectorProcessorInfo, Zr as MetricsMessage, Zt as ISyncAdmin, _ as ExecutionJobPlan, _a as ISyncRemoteStorage, _i as JobResult, _n as isDriveAuthError, _o as ConsistencyKey, _r as JobPendingEvent, _t as ModelReadGate, a as ModelNotWorkerImportableError, aa as DocumentRevisions, ai as SanitizedArg, an as SyncStatusTracker, ao as IReadModelCoordinator, ar as CatchUpStatus, at as InsertableDocumentSnapshot, b as InProcessReactorModule, ba as PurgeRefusalRecord, bi as IExecutionScope, bn as IReactorSubscriptionManager, bo as JobInfo, br as JobWriteReadyEvent, bt as SubjectScopePredicate, c as DocumentModelResolver, ca as IDocumentIndexer, ci as WorkerPoolConfig, cn as SyncOperation, co as IJobExecutionHandle, cr as ICatchUpConsumer, ct as makeConsistencyKey, d as BatchExecutionRequest, da as IOperationStore, di as ExecutorStartedEvent, dn as DRIVE_AUTH_ERROR_MESSAGES, do as JobKind, dr as SweepResult, dt as IJobExecutorManager, ea as DeadLetterRecord, ei as ModelManifestEntry, en as Remote, eo as SyncPurgeRefusedEvent, er as ReactorInfo, et as PurgeFence, f as BatchExecutionResult, fa as ISyncCursorStorage, fi as ExecutorStoppedEvent, fn as DriveRequestError, fo as JobRoutingMeta, fr as WatermarkStatus, ft as ActionEvaluationConfig, g as DegradedComponent, ga as ISyncReceivedMarkerStorage, gi as JobFailedEvent, gn as SyncRepairRefusedError, go as ConsistencyCoordinate, gr as JobFailedEvent$1, gt as IReadGate, h as Database, ha as ISyncPurgeRefusalStorage, hi as JobExecutorEventTypes, hn as RECOVERABLE_GRAPHQL_ERROR_CODES, ho as RetryAccounting, hr as EventBusAggregateError, ht as BareReadGate, i as InvalidModuleError, ia as DocumentRelationship, ii as ResultMessage, in as SyncStatusChangeCallback, io as IReadModel, ir as CatchUpConsumerStatus, it as DocumentViewDatabase, j as DEFAULT_LONG_STATEMENT_TIMEOUT_MS, ja as ConnectionStateChangedEvent, ji as IDocumentModelRegistry, jn as ISyncInspector, jo as ViewFilter, jr as AdmissionPath, jt as DocumentChangeEvent, k as GroupCommitPGliteInstance, ka as ChannelScheme, ki as IWriteCache, kn as IEventBus, ko as ShutdownStatus, kr as Subscriber, kt as ActionEvaluations, l as IDocumentModelResolver, la as IDocumentView, li as DEFAULT_MAX_PURGE_OPERATIONS, ln as SyncOperationAggregateError, lo as Job, lr as ISettledWatermark, lt as IExecutorWorker, m as BatchLoadResult, ma as ISyncHoldStorage, mi as JobExecutorConfig, mn as PollingChannelError, mo as QueueEventTypes, mr as CatchUpSweptEvent, mt as ALWAYS_READABLE_SCOPES, n as DuplicateManifestError, na as DocumentExistence, ni as ParentMessage, nn as ISyncStatusTracker, no as SyncSucceededEvent, nr as StoragePersistence, nt as defaultReadModelIndexingConfig, o as ModuleNotFoundError, oa as DuplicateOperationError, oi as ShutdownMessage, on as IMailbox, oo as ReadModelRegistrationStage, or as CatchUpThread, ot as ConsistencyTracker, p as BatchLoadRequest, pa as ISyncDeadLetterStorage, pi as JobCompletedEvent, pn as InvalidDeadLetterCursorError, po as PurgeJobOptions, pr as defaultCatchUpConfig, pt as ReactorClient, q as PoolInstrumentation, qa as SyncEventTypes, qi as KeyframeSnapshot, qn as InspectorDriveInfo, qr as InitMessage, qt as createPeerAgreement, r as DuplicateModuleError, ra as DocumentGraphEdge, ri as ReadyMessage, rn as SyncStatus, ro as ILiveReadModelCoordinator, rr as CatchUpConfig, rt as unchunkedReadModelIndexingConfig, s as loadDocumentModelSpec, sa as IDocumentGraph, si as WorkerMessage, sn as Mailbox, so as supportsLiveReadModelRegistration, sr as ICatchUp, st as IConsistencyTracker, t as DocumentModelRegistry, ta as DocumentAlreadyExistsError, ti as ModuleRef, tn as RemoteMeta, to as SyncReleasedEvent, tr as ReactorStorageFacts, tt as ReadModelIndexingConfig, u as NullDocumentModelResolver, ua as IKeyframeStore, ui as ExecutorManagerStatus, un as ChannelError, uo as JobAvailableEvent, ur as SweepBlockedAt, ut as IJobExecutor, v as IReactor, va as OperationFilter, vi as JobStartedEvent, vn as isRecoverableGraphQLError, vo as ConsistencyToken, vr as JobReadReadyEvent, vt as ReadGateOptions, w as ReactorFeatures, wa as ViewFilter$1, wi as PurgeStream, wn as JobAwaiter, wo as PagedResults, wr as ReadModelBatchCompletedEvent, wt as decideAtHead, x as InProcessSyncModule, xa as ReceivedMarkerRecord, xi as CollectionMember, xn as ISubscriptionErrorHandler, xo as JobMeta, xr as ModelLoadedEvent, xt as readDecisionModel, y as InProcessReactorClientModule, ya as OptimisticLockError, yi as ReactorFeatureFlags, yn as DocumentDeletedInfo, yo as ErrorInfo$1, yr as JobRunningEvent, yt as SeededStateReader, z as PGliteSessionError, za as RemoteFilter, zi as PurgeRemovedRows, zn as IInspector, zo as firstOutOfOrderPair, zr as SignerConfig, zt as DecisionModel } from "./index-dDm0fUBT.js";
|
|
2
|
+
import { Action, AuthSubject, CreateDocumentActionInput, DocumentModelModule, ISigner, Operation, OperationContext, OperationWithContext, OperationWithContext as OperationWithContext$1, PHAuthState, PHDocument, PHDocumentState, PURGE_DOCUMENT, PeerCapability, PeerManifest, ProtocolVersions, PurgeDocumentAction, PurgeDocumentActionInput, PurgeMarkerOperation, SignaturePolicy, UpgradeDocumentActionInput, UpgradeManifest, actions as documentActions, isPurgeMarker } from "@powerhousedao/shared/document-model";
|
|
3
3
|
import { DocumentDriveDocument, DriveInput, FolderNode, Node } from "@powerhousedao/shared/document-drive";
|
|
4
4
|
import { ILogger } from "document-model";
|
|
5
|
-
import {
|
|
5
|
+
import { Kysely, Transaction } from "kysely";
|
|
6
6
|
import { IProcessor, IProcessorHostModuleBase, IProcessorHostModuleBase as IProcessorHostModuleBase$1, IProcessorManager, IProcessorManager as IProcessorManager$1, IRelationalDb, ProcessorApp, ProcessorFactory, ProcessorFactory as ProcessorFactory$1, ProcessorFactoryBuilder, ProcessorFilter, ProcessorRecord, ProcessorRecord as ProcessorRecord$1, ProcessorStatus, RelationalDbProcessor, TrackedProcessor, TrackedProcessor as TrackedProcessor$1, createRelationalDb } from "@powerhousedao/shared/processors";
|
|
7
7
|
import "node:worker_threads";
|
|
8
8
|
//#region src/attachments/types.d.ts
|
|
@@ -55,14 +55,43 @@ export declare function updateRelationshipAction(sourceId: string, targetId: str
|
|
|
55
55
|
*/
|
|
56
56
|
export declare function removeRelationshipAction(sourceId: string, targetId: string, relationshipType?: string): Action;
|
|
57
57
|
//#endregion
|
|
58
|
+
//#region src/storage/storage-flush.d.ts
|
|
59
|
+
/**
|
|
60
|
+
* The durability barrier the reactor's two acknowledgment boundaries sit
|
|
61
|
+
* behind, for an embedded store whose statements do not flush themselves.
|
|
62
|
+
*
|
|
63
|
+
* 1. A sync cursor write flushes first, so no cursor row is ever durable
|
|
64
|
+
* ahead of the operations it covers (FlushGuardedSyncCursorStorage).
|
|
65
|
+
* 2. A job's write-ready announcement, which `waitForJob` turns into terminal
|
|
66
|
+
* success, waits for a flush covering the job's commit - except a load a
|
|
67
|
+
* sync cursor protects, whose operations are re-pulled if lost.
|
|
68
|
+
*
|
|
69
|
+
* A store durable per statement uses {@link NoopStorageFlusher}.
|
|
70
|
+
*/
|
|
71
|
+
interface IStorageFlusher {
|
|
72
|
+
/**
|
|
73
|
+
* Resolves once every write issued before the call is durable. Rejects with
|
|
74
|
+
* {@link StoragePoisonedError} once the store can make nothing durable again.
|
|
75
|
+
*/
|
|
76
|
+
flush(): Promise<void>;
|
|
77
|
+
}
|
|
78
|
+
/** The store's session is poisoned; only a host restart recovers it. */
|
|
79
|
+
export declare class StoragePoisonedError extends Error {
|
|
80
|
+
constructor(message: string, cause?: unknown);
|
|
81
|
+
}
|
|
82
|
+
//#endregion
|
|
58
83
|
//#region src/client/drive-client.d.ts
|
|
84
|
+
/** The client members a {@link DriveClient} reads and writes through. */
|
|
85
|
+
type DriveClientDeps = Pick<IReactorClient, "get" | "execute" | "create" | "setPreferredEditor" | "getCreateSignaturePolicy" | "getCreateProtocolVersions" | "waitForJob">;
|
|
86
|
+
type BatchSubmitter = (request: BatchExecutionRequest, signal?: AbortSignal) => Promise<BatchExecutionResult>;
|
|
59
87
|
export declare class DriveClient implements IDriveClient {
|
|
60
88
|
private readonly client;
|
|
61
89
|
private readonly logger;
|
|
62
|
-
private readonly reactor;
|
|
63
90
|
private readonly signer;
|
|
64
91
|
private readonly resolveReference;
|
|
65
|
-
|
|
92
|
+
private readonly executeBatch;
|
|
93
|
+
/** `submitter` may still be an IReactor, whose executeBatch is used. */
|
|
94
|
+
constructor(client: DriveClientDeps, logger: ILogger, submitter: BatchSubmitter | IReactor, signer: ISigner, resolveReference: (identifier: string, signal?: AbortSignal) => Promise<string>);
|
|
66
95
|
create(input: DriveInput, signal?: AbortSignal): Promise<DocumentDriveDocument>;
|
|
67
96
|
addFile<TDocument extends PHDocument = PHDocument>(driveIdentifier: string, document: PHDocument, parentFolder?: string, signal?: AbortSignal): Promise<TDocument>;
|
|
68
97
|
addFolder(driveIdentifier: string, name: string, parentFolder?: string, signal?: AbortSignal): Promise<FolderNode>;
|
|
@@ -84,6 +113,24 @@ export declare class DriveClient implements IDriveClient {
|
|
|
84
113
|
private removeFileNode;
|
|
85
114
|
}
|
|
86
115
|
//#endregion
|
|
116
|
+
//#region src/client/derivations.d.ts
|
|
117
|
+
/** The signed jobs that create `document`, and attach it to `parentId`. */
|
|
118
|
+
export declare function buildCreateJobs(document: PHDocument, parentId: string | undefined, signer: ISigner, signal?: AbortSignal): Promise<ExecutionJobPlan[]>;
|
|
119
|
+
/** The registered module for a type: the requested version, else the latest. */
|
|
120
|
+
export declare function selectDocumentModelModule(modules: readonly DocumentModelModule[], documentModelType: string, documentModelVersion?: number): DocumentModelModule;
|
|
121
|
+
/** A new, empty document of `module`, under the create defaults given. */
|
|
122
|
+
export declare function createEmptyDocument(module: DocumentModelModule, options: CreateDocumentOptions | undefined, defaultPolicy: SignaturePolicy, baseVersions: ProtocolVersions): PHDocument;
|
|
123
|
+
type UpgradeDocumentDeps = {
|
|
124
|
+
readonly signer: ISigner;
|
|
125
|
+
read<TDocument extends PHDocument>(identifier: string, branch: string | undefined, consistencyToken: ConsistencyToken | undefined, signal?: AbortSignal): Promise<TDocument>;
|
|
126
|
+
getDocumentModelModule(documentType: string): Promise<DocumentModelModule>;
|
|
127
|
+
/** Submits signed actions and returns the job, without waiting. */
|
|
128
|
+
submit(documentId: string, branch: string, actions: Action[], signal?: AbortSignal): Promise<JobInfo>;
|
|
129
|
+
waitForJob(job: JobInfo, signal?: AbortSignal): Promise<JobInfo>;
|
|
130
|
+
};
|
|
131
|
+
/** Retries from a fresh read when a concurrent edit invalidates the snapshot. */
|
|
132
|
+
export declare function upgradeDocumentWith<TDocument extends PHDocument>(deps: UpgradeDocumentDeps, documentIdentifier: string, toVersion?: number, options?: UpgradeDocumentOptions, signal?: AbortSignal): Promise<TDocument>;
|
|
133
|
+
//#endregion
|
|
87
134
|
//#region src/executor/worker-pool-job-executor-manager.d.ts
|
|
88
135
|
/**
|
|
89
136
|
* Factory invoked once per worker at `start()` time. The index is the
|
|
@@ -515,6 +562,7 @@ export declare class HybridProjectionCoordinator implements ILiveReadModelCoordi
|
|
|
515
562
|
/** Wired as `onReadReady`; host trackers are already advanced (port FIFO). */
|
|
516
563
|
acceptReadReady(event: JobReadReadyEvent): void;
|
|
517
564
|
addReadModel(readModel: IReadModel, stage: ReadModelRegistrationStage): void;
|
|
565
|
+
removeReadModel(readModel: IReadModel): boolean;
|
|
518
566
|
getChainDepth(): number;
|
|
519
567
|
indexedReadModels(): readonly IReadModel[];
|
|
520
568
|
catchUpStatuses(): CatchUpStatus[];
|
|
@@ -547,16 +595,20 @@ export declare class SyncBuilder {
|
|
|
547
595
|
private holdStorage?;
|
|
548
596
|
private receivedMarkerStorage?;
|
|
549
597
|
private purgeRefusalStorage?;
|
|
598
|
+
private storageFlusher;
|
|
550
599
|
private config;
|
|
551
600
|
withChannelFactory(factory: IChannelFactory): this;
|
|
552
601
|
withRemoteStorage(storage: ISyncRemoteStorage): this;
|
|
553
602
|
withCursorStorage(storage: ISyncCursorStorage): this;
|
|
603
|
+
/** The barrier every cursor write, including a custom storage's, goes behind. */
|
|
604
|
+
withStorageFlusher(flusher: IStorageFlusher): this;
|
|
554
605
|
withDeadLetterStorage(storage: ISyncDeadLetterStorage): this;
|
|
555
606
|
withHoldStorage(storage: ISyncHoldStorage): this;
|
|
556
607
|
withReceivedMarkerStorage(storage: ISyncReceivedMarkerStorage): this;
|
|
557
608
|
withPurgeRefusalStorage(storage: ISyncPurgeRefusalStorage): this;
|
|
558
609
|
withMaxDeadLettersPerRemote(limit: number): this;
|
|
559
610
|
withMaxInboxBatchSize(limit: number): this;
|
|
611
|
+
withMaxConcurrentInboxChunks(limit: number): this;
|
|
560
612
|
withMaxHeldOperationsPerRemote(limit: number): this;
|
|
561
613
|
withStaleRemotePollWindowMs(windowMs: number): this;
|
|
562
614
|
build(reactor: IReactor, logger: ILogger, operationIndex: IOperationIndex, eventBus: IEventBus, db: Kysely<Database$1>, driveContainerTypes: ReadonlySet<string>, watermark: ISettledWatermark, localPeer?: LocalPeer): ISyncManager;
|
|
@@ -687,6 +739,8 @@ export declare class ReactorBuilder {
|
|
|
687
739
|
private readModelCoordinator?;
|
|
688
740
|
private readModelCoordinatorFactory?;
|
|
689
741
|
private kyselyInstance?;
|
|
742
|
+
private storageFactsOverride?;
|
|
743
|
+
private groupCommitPGlite?;
|
|
690
744
|
private signer?;
|
|
691
745
|
private workerSigner?;
|
|
692
746
|
private trustPolicy?;
|
|
@@ -694,6 +748,7 @@ export declare class ReactorBuilder {
|
|
|
694
748
|
private signalHandlersEnabled;
|
|
695
749
|
private queueInstance?;
|
|
696
750
|
private channelScheme?;
|
|
751
|
+
private readonly additionalChannelFactories;
|
|
697
752
|
private jwtHandler?;
|
|
698
753
|
private documentModelLoader?;
|
|
699
754
|
private shutdownHooks;
|
|
@@ -771,6 +826,17 @@ export declare class ReactorBuilder {
|
|
|
771
826
|
/** Whether {@link withTrustPolicy} was called. */
|
|
772
827
|
hasTrustPolicy(): boolean;
|
|
773
828
|
withKysely(kysely: Kysely<Database>): this;
|
|
829
|
+
/** Declares the store's facts; without it a caller-supplied store is unknown. */
|
|
830
|
+
withStorageFacts(facts: ReactorStorageFacts): this;
|
|
831
|
+
/**
|
|
832
|
+
* Runs the reactor on an embedded PGlite with group commit: statements stop
|
|
833
|
+
* syncing the filesystem, and the flush moves to a job's write-ready and
|
|
834
|
+
* every sync cursor write. A poisoned session goes to `onUnrecoverable`,
|
|
835
|
+
* since a fallback would leave in-memory read-model positions ahead of the
|
|
836
|
+
* store. The caller keeps `pg` if the build fails; once built, the module's
|
|
837
|
+
* `groupCommitStorage` closes it.
|
|
838
|
+
*/
|
|
839
|
+
withGroupCommitPGlite(options: GroupCommitPGliteOptions): this;
|
|
774
840
|
/**
|
|
775
841
|
* Register an externally-constructed pg.Pool's {@link PoolInstrumentation}
|
|
776
842
|
* so it surfaces through {@link ReactorModule.pools}. Use this when the
|
|
@@ -780,8 +846,17 @@ export declare class ReactorBuilder {
|
|
|
780
846
|
*/
|
|
781
847
|
withInstrumentedPool(instrumentation: PoolInstrumentation): this;
|
|
782
848
|
withQueue(queue: IQueue): this;
|
|
783
|
-
/**
|
|
849
|
+
/**
|
|
850
|
+
* Mutually exclusive with {@link withSync}; setting both fails the build.
|
|
851
|
+
* Compose further transports onto the scheme with {@link withAdditionalChannelFactory}.
|
|
852
|
+
*/
|
|
784
853
|
withChannelScheme(scheme: ChannelScheme): this;
|
|
854
|
+
/**
|
|
855
|
+
* Routes `type` to `factory` beside the {@link withChannelScheme} scheme's
|
|
856
|
+
* own factory, through a {@link CompositeChannelFactory}. Build refuses it
|
|
857
|
+
* without a scheme, or when `type` is the scheme's own.
|
|
858
|
+
*/
|
|
859
|
+
withAdditionalChannelFactory(type: string, factory: IChannelFactory): this;
|
|
785
860
|
withJwtHandler(handler: JwtHandler): this;
|
|
786
861
|
withDocumentModelLoader(loader: IDocumentModelLoader): this;
|
|
787
862
|
withSignalHandlers(): this;
|
|
@@ -830,6 +905,18 @@ export declare class ReactorBuilder {
|
|
|
830
905
|
getImportableEntries(documentType: string): ModelManifestEntry[];
|
|
831
906
|
build(): Promise<IReactor>;
|
|
832
907
|
buildModule(): Promise<InProcessReactorModule>;
|
|
908
|
+
/** Refuses what would bypass the flush or leave a poison with no owner. */
|
|
909
|
+
private assertStorageConfiguration;
|
|
910
|
+
/**
|
|
911
|
+
* A committed job waits for its flush, the statement in flight then one
|
|
912
|
+
* sync, and withholds past that wait. Statements before the commit queue
|
|
913
|
+
* behind the same flush, so the job timeout outlasts the wait too.
|
|
914
|
+
*/
|
|
915
|
+
private fitJobTimeoutToDurability;
|
|
916
|
+
private assembleModule;
|
|
917
|
+
private assertAdditionalChannelFactories;
|
|
918
|
+
/** Bare without additional factories, so an existing reactor routes as before. */
|
|
919
|
+
private buildSchemeChannelFactory;
|
|
833
920
|
/**
|
|
834
921
|
* The single Postgres config for the parent, executor workers, and
|
|
835
922
|
* projection shards. They must share one physical database (the parent
|
|
@@ -1154,6 +1241,11 @@ export declare function parseDriveUrl(url: string): ParsedDriveUrl;
|
|
|
1154
1241
|
export declare function driveIdFromUrl(url: string): string;
|
|
1155
1242
|
//#endregion
|
|
1156
1243
|
//#region src/shared/errors.d.ts
|
|
1244
|
+
/**
|
|
1245
|
+
* Error thrown when attempting to access a deleted document.
|
|
1246
|
+
*/
|
|
1247
|
+
/** The error name on a job the reactor does not know. */
|
|
1248
|
+
export declare const JOB_NOT_FOUND_ERROR_NAME = "JobNotFoundError";
|
|
1157
1249
|
/** The message carries the code: only name and message cross the queue. */
|
|
1158
1250
|
export declare class InvalidSignatureError extends Error {
|
|
1159
1251
|
readonly documentId: string;
|
|
@@ -1387,6 +1479,8 @@ export declare class InMemoryQueue implements IQueue {
|
|
|
1387
1479
|
private jobIdToDocId;
|
|
1388
1480
|
private completedJobs;
|
|
1389
1481
|
private jobIndex;
|
|
1482
|
+
private jobIdToSeq;
|
|
1483
|
+
private nextSeq;
|
|
1390
1484
|
private isBlocked;
|
|
1391
1485
|
private onDrainedCallback?;
|
|
1392
1486
|
private isPausedFlag;
|
|
@@ -1555,11 +1649,13 @@ export declare class SimpleJobExecutor implements IJobExecutor {
|
|
|
1555
1649
|
private documentActionHandler;
|
|
1556
1650
|
private executionScope;
|
|
1557
1651
|
private signer;
|
|
1652
|
+
private readonly flusher;
|
|
1558
1653
|
/**
|
|
1559
1654
|
* `signer` signs the operations the reducer synthesizes; unsigned if omitted.
|
|
1560
1655
|
* `trustPolicy` decides which keys may sign as which users at admission.
|
|
1656
|
+
* `flusher` makes a job durable before its write-ready is announced.
|
|
1561
1657
|
*/
|
|
1562
|
-
constructor(logger: ILogger, registry: IDocumentModelRegistry, operationStore: IOperationStore, eventBus: IEventBus, writeCache: IWriteCache, operationIndex: IOperationIndex, documentMetaCache: IDocumentMetaCache, collectionMembershipCache: ICollectionMembershipCache, driveContainerTypes: ReadonlySet<string>, config: JobExecutorConfig, executionScope?: IExecutionScope, signer?: ISigner, trustPolicy?: SignatureTrustPolicy);
|
|
1658
|
+
constructor(logger: ILogger, registry: IDocumentModelRegistry, operationStore: IOperationStore, eventBus: IEventBus, writeCache: IWriteCache, operationIndex: IOperationIndex, documentMetaCache: IDocumentMetaCache, collectionMembershipCache: ICollectionMembershipCache, driveContainerTypes: ReadonlySet<string>, config: JobExecutorConfig, executionScope?: IExecutionScope, signer?: ISigner, trustPolicy?: SignatureTrustPolicy, flusher?: IStorageFlusher);
|
|
1563
1659
|
/**
|
|
1564
1660
|
* Execute a single job by applying all its actions through the appropriate reducers.
|
|
1565
1661
|
* Actions are processed sequentially in order.
|
|
@@ -1579,7 +1675,17 @@ export declare class SimpleJobExecutor implements IJobExecutor {
|
|
|
1579
1675
|
* but nothing here closes it, and a caller that needs to know a write is
|
|
1580
1676
|
* real has the job status to ask.
|
|
1581
1677
|
*/
|
|
1582
|
-
executeJob(job: Job, signal?: AbortSignal): Promise<JobResult>;
|
|
1678
|
+
executeJob(job: Job, signal?: AbortSignal, onCommitting?: () => void): Promise<JobResult>;
|
|
1679
|
+
/**
|
|
1680
|
+
* Waits for a flush covering the committed job before its write-ready goes
|
|
1681
|
+
* out; false withholds the announcement. A failed flush is never a failed
|
|
1682
|
+
* job, since the commit stands: it is retried, and the announcement is
|
|
1683
|
+
* withheld once the store is poisoned (the host restarts), the attempts run
|
|
1684
|
+
* out, the wait outlives `durabilityWaitMs`, or the job's signal aborts.
|
|
1685
|
+
*/
|
|
1686
|
+
private awaitDurable;
|
|
1687
|
+
/** Settles with TIMED_OUT at the deadline or on abort; the wait itself is abandoned. */
|
|
1688
|
+
private withinDurabilityWait;
|
|
1583
1689
|
/**
|
|
1584
1690
|
* The body of a job, run inside the execution scope's transaction.
|
|
1585
1691
|
*
|
|
@@ -1772,6 +1878,26 @@ export declare class SimpleJobExecutor implements IJobExecutor {
|
|
|
1772
1878
|
private accumulateResultOrReturnError;
|
|
1773
1879
|
}
|
|
1774
1880
|
//#endregion
|
|
1881
|
+
//#region src/executor/worker-pool-router.d.ts
|
|
1882
|
+
/**
|
|
1883
|
+
* Sticky-by-document routing for the executor worker pool.
|
|
1884
|
+
*
|
|
1885
|
+
* Hashes `documentId` to a stable bucket so every job on a given document
|
|
1886
|
+
* lands on the same worker. The queue already enforces "at most one job
|
|
1887
|
+
* executing per document at a time", so a sticky worker always sees a fresh
|
|
1888
|
+
* post-commit snapshot before its next job on that document — which keeps
|
|
1889
|
+
* the per-worker `IWriteCache` and `IDocumentMetaCache` coherent for free.
|
|
1890
|
+
*
|
|
1891
|
+
* The hash is FNV-1a 32-bit: deterministic, dependency-free, and stable
|
|
1892
|
+
* across processes (so the same routing decision can be reproduced anywhere
|
|
1893
|
+
* the documentId is known).
|
|
1894
|
+
*
|
|
1895
|
+
* @see Executor Worker Pool Design wiki page
|
|
1896
|
+
* (Powerhouse board wiki id: d400d711-f07e-4389-a226-4e9fdd4fa8ba)
|
|
1897
|
+
*/
|
|
1898
|
+
export declare function hashDocumentId(documentId: string): number;
|
|
1899
|
+
export declare function bucketFor(documentId: string, numWorkers: number): number;
|
|
1900
|
+
//#endregion
|
|
1775
1901
|
//#region src/executor/worker/forwarding-logger.d.ts
|
|
1776
1902
|
export declare function createForwardingLogger(post: (msg: LogMessage) => void, level?: ILogger["level"], tags?: string[]): ILogger;
|
|
1777
1903
|
//#endregion
|
|
@@ -1829,32 +1955,6 @@ export declare class SyncScopeGate {
|
|
|
1829
1955
|
scopePredicateById(documentId: string, subject: AuthSubject, branch: string, signal?: AbortSignal): Promise<(scope: string) => boolean>;
|
|
1830
1956
|
}
|
|
1831
1957
|
//#endregion
|
|
1832
|
-
//#region src/decision/stream-order.d.ts
|
|
1833
|
-
/** Where a stream's stored order contradicts its timestamps. */
|
|
1834
|
-
type OutOfOrderPair = {
|
|
1835
|
-
previous: Operation;
|
|
1836
|
-
current: Operation;
|
|
1837
|
-
/**
|
|
1838
|
-
* `descending` cannot be walked at all. `tied` walks fine — the intra-stream
|
|
1839
|
-
* rule breaks the tie by index — but violates the monotonic auth rule, so a
|
|
1840
|
-
* stream holding one can never be replicated to a peer that lacks it.
|
|
1841
|
-
*/
|
|
1842
|
-
kind: "descending" | "tied";
|
|
1843
|
-
};
|
|
1844
|
-
/**
|
|
1845
|
-
* The first pair of effective operations whose stored order contradicts their
|
|
1846
|
-
* timestamps, or undefined when the stream is in position order.
|
|
1847
|
-
*
|
|
1848
|
-
* Such a stream cannot be walked, and the auth stream is never reshuffled once
|
|
1849
|
-
* the monotonic rule is on, so run this before enabling enforcement on a fleet.
|
|
1850
|
-
*
|
|
1851
|
-
* `requireStrict` additionally rejects a tie, which is what the auth stream's
|
|
1852
|
-
* monotonic rule requires and what the walk alone does not care about.
|
|
1853
|
-
*/
|
|
1854
|
-
export declare function firstOutOfOrderPair(operations: Operation[], options?: {
|
|
1855
|
-
requireStrict?: boolean;
|
|
1856
|
-
}): OutOfOrderPair | undefined;
|
|
1857
|
-
//#endregion
|
|
1858
1958
|
//#region src/storage/kysely/document-indexer.d.ts
|
|
1859
1959
|
type IndexerDatabase = Database$1 & DocumentIndexerDatabase & DocumentViewDatabase;
|
|
1860
1960
|
export declare class KyselyDocumentIndexer extends BaseReadModel implements IDocumentIndexer {
|
|
@@ -1879,69 +1979,6 @@ export declare class KyselyDocumentIndexer extends BaseReadModel implements IDoc
|
|
|
1879
1979
|
private handleUpdateRelationship;
|
|
1880
1980
|
}
|
|
1881
1981
|
//#endregion
|
|
1882
|
-
//#region src/storage/kysely/pglite-dialect.d.ts
|
|
1883
|
-
/** Structural so importing this module does not pull in the PGlite wasm bundle. */
|
|
1884
|
-
type PGliteSession = {
|
|
1885
|
-
query: (sql: string, params?: unknown[]) => Promise<{
|
|
1886
|
-
rows: unknown[];
|
|
1887
|
-
affectedRows?: number;
|
|
1888
|
-
}>;
|
|
1889
|
-
/** Simple-query execution, used for the commit guard and session recovery. */
|
|
1890
|
-
exec: (sql: string) => Promise<unknown>;
|
|
1891
|
-
isInTransaction: () => boolean;
|
|
1892
|
-
};
|
|
1893
|
-
type HardenedPGliteDialectOptions = {
|
|
1894
|
-
/** Opt-in bound on waiting for the single PGlite lease; 0 (the default) waits indefinitely. */
|
|
1895
|
-
acquireTimeoutMs: number;
|
|
1896
|
-
/** Bound on a call that never settles (a dead wasm call); a long synchronous statement still finishes. 0 disables it. */
|
|
1897
|
-
statementTimeoutMs: number;
|
|
1898
|
-
/** The bound for {@link isLongRunningStatement} statements, whose runtime scales with the data. */
|
|
1899
|
-
longStatementTimeoutMs: number;
|
|
1900
|
-
/** Bound on each session recovery statement, which runs against the session that just failed. */
|
|
1901
|
-
recoveryTimeoutMs: number;
|
|
1902
|
-
/** Where unrecoverable session faults and swallowed rollbacks are reported. */
|
|
1903
|
-
onDiagnostic: (message: string, error?: unknown) => void;
|
|
1904
|
-
/** Called once, the first time the session is refused as unrecoverable; the owner should restart. */
|
|
1905
|
-
onPoisoned: (cause: Error) => void;
|
|
1906
|
-
};
|
|
1907
|
-
export declare const DEFAULT_STATEMENT_TIMEOUT_MS = 120000;
|
|
1908
|
-
export declare const DEFAULT_LONG_STATEMENT_TIMEOUT_MS = 900000;
|
|
1909
|
-
export declare const DEFAULT_RECOVERY_TIMEOUT_MS = 15000;
|
|
1910
|
-
/** Maintenance and DDL, matched on the leading keyword of the compiled SQL. */
|
|
1911
|
-
export declare function isLongRunningStatement(statement: string): boolean;
|
|
1912
|
-
type IntrospectedDatabase = Parameters<Dialect["createIntrospector"]>[0];
|
|
1913
|
-
export declare class PGliteSessionError extends Error {
|
|
1914
|
-
readonly cause?: unknown;
|
|
1915
|
-
constructor(message: string, cause?: unknown);
|
|
1916
|
-
}
|
|
1917
|
-
export declare class PGliteAcquireTimeoutError extends PGliteSessionError {
|
|
1918
|
-
constructor(timeoutMs: number);
|
|
1919
|
-
}
|
|
1920
|
-
/** The call cannot be aborted, so it is abandoned and the session treated as poisoned. */
|
|
1921
|
-
export declare class PGliteStatementTimeoutError extends PGliteSessionError {
|
|
1922
|
-
constructor(timeoutMs: number, statement: string);
|
|
1923
|
-
}
|
|
1924
|
-
export declare class PGliteAbortedTransactionError extends PGliteSessionError {
|
|
1925
|
-
constructor(cause: unknown);
|
|
1926
|
-
}
|
|
1927
|
-
/** No statement can clear the session (e.g. a stuck active portal). */
|
|
1928
|
-
export declare class PGliteSessionPoisonedError extends PGliteSessionError {
|
|
1929
|
-
constructor(cause: unknown);
|
|
1930
|
-
}
|
|
1931
|
-
/** `kysely-pglite-dialect` hardened for one shared session that a fault must not brick. */
|
|
1932
|
-
export declare class HardenedPGliteDialect implements Dialect {
|
|
1933
|
-
private readonly client;
|
|
1934
|
-
private readonly inner;
|
|
1935
|
-
private readonly options;
|
|
1936
|
-
constructor(client: PGliteSession, options?: Partial<HardenedPGliteDialectOptions>);
|
|
1937
|
-
createAdapter(): DialectAdapter;
|
|
1938
|
-
createDriver(): Driver;
|
|
1939
|
-
createQueryCompiler(): QueryCompiler;
|
|
1940
|
-
createIntrospector(db: IntrospectedDatabase): DatabaseIntrospector;
|
|
1941
|
-
}
|
|
1942
|
-
/** Raw SQL through the dialect's queue, instead of into whatever transaction holds the session. */
|
|
1943
|
-
export declare function queryThroughDialect<DB>(db: Kysely<DB>, sql: string, params?: unknown[]): Promise<unknown[]>;
|
|
1944
|
-
//#endregion
|
|
1945
1982
|
//#region src/read-models/coordinator.d.ts
|
|
1946
1983
|
/**
|
|
1947
1984
|
* Coordinates read model synchronization by listening to operation write events
|
|
@@ -1971,6 +2008,7 @@ export declare class ReadModelCoordinator implements ILiveReadModelCoordinator {
|
|
|
1971
2008
|
getChainDepth(): number;
|
|
1972
2009
|
indexedReadModels(): readonly IReadModel[];
|
|
1973
2010
|
addReadModel(readModel: IReadModel, stage: ReadModelRegistrationStage): void;
|
|
2011
|
+
removeReadModel(readModel: IReadModel): boolean;
|
|
1974
2012
|
private handleWriteReady;
|
|
1975
2013
|
private emitEmptyReadReady;
|
|
1976
2014
|
private runChain;
|
|
@@ -2141,7 +2179,56 @@ export declare class KyselySyncRemoteStorage implements ISyncRemoteStorage {
|
|
|
2141
2179
|
remove(name: string, signal?: AbortSignal): Promise<void>;
|
|
2142
2180
|
}
|
|
2143
2181
|
//#endregion
|
|
2182
|
+
//#region src/sync/channels/composite-channel-factory.d.ts
|
|
2183
|
+
/**
|
|
2184
|
+
* An {@link IChannelFactory} that dispatches to one of several factories on
|
|
2185
|
+
* {@link ChannelConfig.type}.
|
|
2186
|
+
*
|
|
2187
|
+
* This is the seam that lets ONE reactor hold remotes of more than one
|
|
2188
|
+
* transport at once -- gql remotes to a Switchboard AND brokered
|
|
2189
|
+
* `LocalChannel` peers (multi-reactor W3.0). Before it, a reactor wired a
|
|
2190
|
+
* single factory, so a local-sync reactor was local-only and a gql reactor
|
|
2191
|
+
* could not adopt a local peer; every mixed topology was out of reach.
|
|
2192
|
+
*
|
|
2193
|
+
* Routing is strict and total: a config whose type no registered factory
|
|
2194
|
+
* claims is refused by name rather than handed to whichever factory happens to
|
|
2195
|
+
* be first. That refusal is the point -- the single-factory world answered a
|
|
2196
|
+
* `{ type: "local" }` config on a gql reactor with a complaint about a missing
|
|
2197
|
+
* `url`, which says nothing about what is actually wrong.
|
|
2198
|
+
*
|
|
2199
|
+
* The composite adds no behaviour of its own: it holds no queue, no transport
|
|
2200
|
+
* and no logger, and every argument is passed through untouched. Which types a
|
|
2201
|
+
* reactor registers is the builder's decision (`ReactorBuilder`), not this
|
|
2202
|
+
* class's.
|
|
2203
|
+
*/
|
|
2204
|
+
export declare class CompositeChannelFactory implements IChannelFactory {
|
|
2205
|
+
private readonly factories;
|
|
2206
|
+
/**
|
|
2207
|
+
* @param factories - (channel-config type -> factory) pairs. A duplicated
|
|
2208
|
+
* type is refused rather than silently resolved to the last entry: two
|
|
2209
|
+
* factories claiming one type is a configuration mistake with no correct
|
|
2210
|
+
* answer.
|
|
2211
|
+
* @throws Error if `factories` is empty or names a type twice
|
|
2212
|
+
*/
|
|
2213
|
+
constructor(factories: Iterable<readonly [string, IChannelFactory]>);
|
|
2214
|
+
/**
|
|
2215
|
+
* Creates a channel with the factory registered for `config.type`.
|
|
2216
|
+
*
|
|
2217
|
+
* @throws Error if no factory is registered for that type
|
|
2218
|
+
*/
|
|
2219
|
+
instance(remoteId: string, remoteName: string, config: ChannelConfig, cursorStorage: ISyncCursorStorage, collectionId: DriveCollectionId, filter: RemoteFilter, operationIndex: IOperationIndex, options?: RemoteOptions): IChannel;
|
|
2220
|
+
/** The types it routes, in registration order. */
|
|
2221
|
+
get channelTypes(): readonly string[];
|
|
2222
|
+
}
|
|
2223
|
+
//#endregion
|
|
2144
2224
|
//#region src/sync/channels/gql-request-channel-factory.d.ts
|
|
2225
|
+
/**
|
|
2226
|
+
* The {@link ChannelConfig.type} a GqlRequestChannel is created from.
|
|
2227
|
+
*
|
|
2228
|
+
* Named so {@link CompositeChannelFactory} registration and the callers that
|
|
2229
|
+
* build a `{ type: "gql" }` config agree on one spelling.
|
|
2230
|
+
*/
|
|
2231
|
+
export declare const GQL_CHANNEL_TYPE = "gql";
|
|
2145
2232
|
/**
|
|
2146
2233
|
* Factory for creating GqlRequestChannel instances.
|
|
2147
2234
|
*
|
|
@@ -2152,6 +2239,7 @@ export declare class KyselySyncRemoteStorage implements ISyncRemoteStorage {
|
|
|
2152
2239
|
* which is useful for short-lived tokens with audience-specific claims.
|
|
2153
2240
|
*/
|
|
2154
2241
|
export declare class GqlRequestChannelFactory implements IChannelFactory {
|
|
2242
|
+
readonly channelTypes: string[];
|
|
2155
2243
|
private readonly logger;
|
|
2156
2244
|
private readonly jwtHandler?;
|
|
2157
2245
|
private readonly queue;
|
|
@@ -2169,15 +2257,30 @@ export declare class GqlRequestChannelFactory implements IChannelFactory {
|
|
|
2169
2257
|
}
|
|
2170
2258
|
//#endregion
|
|
2171
2259
|
//#region src/sync/channels/gql-response-channel-factory.d.ts
|
|
2260
|
+
/**
|
|
2261
|
+
* The {@link ChannelConfig.type} a GqlResponseChannel is created from.
|
|
2262
|
+
*
|
|
2263
|
+
* A response channel is never configured by this reactor: it is registered by
|
|
2264
|
+
* the peer that polls it, over the `registerChannel` mutation, whose resolver
|
|
2265
|
+
* (`packages/reactor-api`) writes exactly this type. Named here so
|
|
2266
|
+
* {@link CompositeChannelFactory} registration for the SWITCHBOARD scheme
|
|
2267
|
+
* routes the configs that actually arrive.
|
|
2268
|
+
*/
|
|
2269
|
+
export declare const POLLING_CHANNEL_TYPE = "polling";
|
|
2172
2270
|
/**
|
|
2173
2271
|
* Factory for creating GqlResponseChannel instances.
|
|
2174
2272
|
*/
|
|
2175
2273
|
export declare class GqlResponseChannelFactory implements IChannelFactory {
|
|
2274
|
+
readonly channelTypes: string[];
|
|
2176
2275
|
private readonly logger;
|
|
2177
2276
|
constructor(logger: ILogger);
|
|
2178
2277
|
instance(remoteId: string, remoteName: string, config: ChannelConfig, cursorStorage: ISyncCursorStorage): IChannel;
|
|
2179
2278
|
}
|
|
2180
2279
|
//#endregion
|
|
2280
|
+
//#region src/sync/channels/channel-factory-types.d.ts
|
|
2281
|
+
/** The channel types a built factory declares; empty when it declares none. */
|
|
2282
|
+
export declare function channelFactoryTypes(factory: IChannelFactory): readonly string[];
|
|
2283
|
+
//#endregion
|
|
2181
2284
|
//#region src/sync/channels/poll-timer.d.ts
|
|
2182
2285
|
/** Once `signal` aborts, settle promptly and stop mutating shared state. */
|
|
2183
2286
|
type PollDelegate = (signal: AbortSignal | undefined) => Promise<void>;
|
|
@@ -2480,6 +2583,395 @@ export declare class GqlResponseChannel implements IChannel {
|
|
|
2480
2583
|
private unservedFloor;
|
|
2481
2584
|
}
|
|
2482
2585
|
//#endregion
|
|
2586
|
+
//#region src/sync/channels/local-channel-transport.d.ts
|
|
2587
|
+
/**
|
|
2588
|
+
* The environment-neutral transport {@link LocalChannel} speaks over.
|
|
2589
|
+
*
|
|
2590
|
+
* A LocalChannel never touches a real MessagePort directly: it depends only on
|
|
2591
|
+
* this interface so the same channel runs over a browser MessagePort, a
|
|
2592
|
+
* `node:worker_threads` MessagePort, or an in-process stub in a test. Whatever
|
|
2593
|
+
* crosses `postMessage` must be structured-clone-safe -- plain data, never a
|
|
2594
|
+
* function or a closure -- because a real port clones it.
|
|
2595
|
+
*/
|
|
2596
|
+
interface LocalChannelPort {
|
|
2597
|
+
/** Sends one structured-clone-safe message to the peer. */
|
|
2598
|
+
postMessage(data: unknown): void;
|
|
2599
|
+
/** Registers a listener for messages from the peer; returns its removal. */
|
|
2600
|
+
onMessage(callback: (data: unknown) => void): () => void;
|
|
2601
|
+
/** Releases the transport. Idempotent; the registrant calls it, not a channel. */
|
|
2602
|
+
close(): void;
|
|
2603
|
+
}
|
|
2604
|
+
/**
|
|
2605
|
+
* Resolves the transport for a remote from its channel config.
|
|
2606
|
+
*
|
|
2607
|
+
* The factory holds one of these rather than taking a port directly, because
|
|
2608
|
+
* {@link IChannelFactory.instance} has no seam for a live object and a port is
|
|
2609
|
+
* not clone-safe config. W1.2 supplies a real brokered MessagePort by keying it
|
|
2610
|
+
* here under the same (peerId, channelName) the config names, with no change to
|
|
2611
|
+
* the channel.
|
|
2612
|
+
*
|
|
2613
|
+
* Returns undefined when nothing is registered for the key; the factory turns
|
|
2614
|
+
* that into a thrown error so a misconfigured remote fails loudly at init.
|
|
2615
|
+
*/
|
|
2616
|
+
type LocalChannelTransportProvider = (peerId: string, channelName: string) => LocalChannelPort | undefined;
|
|
2617
|
+
/**
|
|
2618
|
+
* The shape both a browser MessagePort and a `node:worker_threads` MessagePort
|
|
2619
|
+
* satisfy, narrowed to what {@link messagePortTransport} uses. Neither global
|
|
2620
|
+
* MessagePort type is in scope in this package, so the adapter is written
|
|
2621
|
+
* against this structural type instead.
|
|
2622
|
+
*/
|
|
2623
|
+
interface MessagePortLike {
|
|
2624
|
+
postMessage(value: unknown): void;
|
|
2625
|
+
close(): void;
|
|
2626
|
+
on?(event: "message", listener: (value: unknown) => void): unknown;
|
|
2627
|
+
off?(event: "message", listener: (value: unknown) => void): unknown;
|
|
2628
|
+
addEventListener?(type: "message", listener: (event: unknown) => void): void;
|
|
2629
|
+
removeEventListener?(type: "message", listener: (event: unknown) => void): void;
|
|
2630
|
+
start?(): void;
|
|
2631
|
+
}
|
|
2632
|
+
/**
|
|
2633
|
+
* Wraps a real MessagePort as a {@link LocalChannelPort}.
|
|
2634
|
+
*
|
|
2635
|
+
* A `node:worker_threads` port is an EventEmitter, so the EventEmitter surface
|
|
2636
|
+
* (`on`/`off`) is preferred when present. A browser port is driven through
|
|
2637
|
+
* `addEventListener` and an explicit `start()`, whose event carries the payload
|
|
2638
|
+
* on `.data`; once started it drops what arrives with no listener attached.
|
|
2639
|
+
* Register the result with a `LocalChannelPortRegistry`, which holds one
|
|
2640
|
+
* listener for the port's life and queues frames between channels.
|
|
2641
|
+
*/
|
|
2642
|
+
export declare function messagePortTransport(port: MessagePortLike): LocalChannelPort;
|
|
2643
|
+
//#endregion
|
|
2644
|
+
//#region src/sync/channels/local-channel.d.ts
|
|
2645
|
+
/**
|
|
2646
|
+
* A symmetric, push-capable synchronization channel between two reactors over a
|
|
2647
|
+
* message port.
|
|
2648
|
+
*
|
|
2649
|
+
* Unlike the gql channels -- one polls and pushes over HTTP, the other never
|
|
2650
|
+
* initiates and is filled by resolvers -- a LocalChannel is peer-to-peer: either
|
|
2651
|
+
* side may push envelopes to the other at any time, with no GraphQL, no HTTP and
|
|
2652
|
+
* no Switchboard. It is the productionized sibling of the test channel: a real
|
|
2653
|
+
* wire protocol over an injected {@link LocalChannelPort}, the peer-manifest
|
|
2654
|
+
* handshake wired into the sync manager, cursor persistence, and ACK-driven
|
|
2655
|
+
* outbox trimming.
|
|
2656
|
+
*
|
|
2657
|
+
* The inbox holds its ack below unapplied purge markers, as the gql channels'
|
|
2658
|
+
* inboxes do.
|
|
2659
|
+
*/
|
|
2660
|
+
export declare class LocalChannel implements IChannel {
|
|
2661
|
+
readonly inbox: IMailbox;
|
|
2662
|
+
readonly outbox: IMailbox;
|
|
2663
|
+
readonly deadLetter: IMailbox;
|
|
2664
|
+
private readonly logger;
|
|
2665
|
+
private readonly channelId;
|
|
2666
|
+
private readonly remoteName;
|
|
2667
|
+
private readonly cursorStorage;
|
|
2668
|
+
private readonly port;
|
|
2669
|
+
private readonly collectionId;
|
|
2670
|
+
private readonly filter;
|
|
2671
|
+
private isShutdown;
|
|
2672
|
+
private unsubscribeTransport?;
|
|
2673
|
+
private localManifestProvider?;
|
|
2674
|
+
/** Undefined until the first handshake; null for a peer that announces nothing. */
|
|
2675
|
+
private peerManifest;
|
|
2676
|
+
private readonly peerManifestCallbacks;
|
|
2677
|
+
private connectionState;
|
|
2678
|
+
/** Whether any valid frame has arrived since init. */
|
|
2679
|
+
private heardPeer;
|
|
2680
|
+
private failureCount;
|
|
2681
|
+
private lastSuccessUtcMs?;
|
|
2682
|
+
private lastFailureUtcMs?;
|
|
2683
|
+
/** The highest inbox ack already reported to the peer; only an advance re-posts. */
|
|
2684
|
+
private lastPostedAckOrdinal;
|
|
2685
|
+
private pushFailureCount;
|
|
2686
|
+
private pushRetryTimer?;
|
|
2687
|
+
private readonly connectionStateCallbacks;
|
|
2688
|
+
private readonly cursorWriters;
|
|
2689
|
+
constructor(logger: ILogger, channelId: string, remoteName: string, cursorStorage: ISyncCursorStorage, port: LocalChannelPort, collectionId: DriveCollectionId, filter: RemoteFilter);
|
|
2690
|
+
/**
|
|
2691
|
+
* Loads the persisted cursors and initialises both mailboxes BEFORE
|
|
2692
|
+
* subscribing to the transport, so no inbound message is ever processed
|
|
2693
|
+
* against a zeroed mailbox. A frame processed before `inbox.init` runs would
|
|
2694
|
+
* be added below an ack of 0, and the init that followed would overwrite the
|
|
2695
|
+
* ack while leaving that frame pinning the floor -- dragging the live ack
|
|
2696
|
+
* below the durable cursor and re-loading already-applied ops as fresh jobs.
|
|
2697
|
+
*
|
|
2698
|
+
* Loading first relies on the port holding frames until a listener attaches.
|
|
2699
|
+
* A `LocalChannelPortRegistry` port does: it keeps one listener on the
|
|
2700
|
+
* raw port for its whole registration and replays, in order, what arrived
|
|
2701
|
+
* while no channel was attached. A raw browser MessagePort handed straight to
|
|
2702
|
+
* a channel does not once started, so a frame arriving between a shutdown
|
|
2703
|
+
* and the next init on it is lost.
|
|
2704
|
+
*/
|
|
2705
|
+
init(): Promise<void>;
|
|
2706
|
+
/** Leaves the port open: whoever registered it closes it. */
|
|
2707
|
+
shutdown(): Promise<void>;
|
|
2708
|
+
getConnectionState(): ConnectionStateSnapshot;
|
|
2709
|
+
onConnectionStateChange(callback: ConnectionStateChangeCallback): () => void;
|
|
2710
|
+
/**
|
|
2711
|
+
* A push transport has nothing to poll, so this asks the peer to re-push
|
|
2712
|
+
* whatever it still holds unacked for this side, from this side's inbox ack.
|
|
2713
|
+
*/
|
|
2714
|
+
triggerPull(): void;
|
|
2715
|
+
/** This channel pushes to its peer; it has no holder to hear from. */
|
|
2716
|
+
notePoll(): void;
|
|
2717
|
+
/** No holder, so nothing this channel reports may strand one. */
|
|
2718
|
+
lastHolderPollUtcMs(): number | undefined;
|
|
2719
|
+
setLocalManifest(provider: () => PeerManifest): void;
|
|
2720
|
+
onPeerManifest(callback: PeerManifestListener): () => void;
|
|
2721
|
+
/** Pushes freshly added outbox items that have not since been removed. */
|
|
2722
|
+
private onOutboxAdded;
|
|
2723
|
+
/**
|
|
2724
|
+
* Persists the outbox cursor from the applied ordinal of what was removed,
|
|
2725
|
+
* clamped below the lowest ordinal still in flight. Items for different
|
|
2726
|
+
* documents apply out of order, so the highest applied ordinal can pass one
|
|
2727
|
+
* still unacked; a restart from it would skip that one.
|
|
2728
|
+
*/
|
|
2729
|
+
private onOutboxRemoved;
|
|
2730
|
+
/**
|
|
2731
|
+
* Persists the inbox ack and reports it to the peer so it trims its outbox.
|
|
2732
|
+
* The ack is posted only when it strictly advances, so a burst of removals
|
|
2733
|
+
* that does not move the floor does not flood the peer with duplicate acks.
|
|
2734
|
+
*/
|
|
2735
|
+
private onInboxRemoved;
|
|
2736
|
+
/** Unconditional, so a peer re-pushing what this side applied can trim. */
|
|
2737
|
+
private postAck;
|
|
2738
|
+
private receive;
|
|
2739
|
+
/**
|
|
2740
|
+
* A HELLO's sinceOrdinal is the peer's inbox ack, so the outbox is trimmed to
|
|
2741
|
+
* it exactly as an ACK would, letting a reconnect resume without re-serving
|
|
2742
|
+
* applied ops. An opening hello then re-pushes the remaining unacked items in
|
|
2743
|
+
* case the peer reconnected and lost them. A reply does not: it answers this
|
|
2744
|
+
* side's own opening, so the peer did not reset, and re-pushing would hand
|
|
2745
|
+
* it every unacked op a second time.
|
|
2746
|
+
*/
|
|
2747
|
+
private receiveHello;
|
|
2748
|
+
/**
|
|
2749
|
+
* Ingests a push into the inbox, dropping operations the inbox has already
|
|
2750
|
+
* acked. A reconnecting peer may re-push durable ops before it hears this
|
|
2751
|
+
* side's ack; adding one back as a fresh sync job would transiently drag the
|
|
2752
|
+
* ack floor below the persisted cursor, so a batch entirely at or below the
|
|
2753
|
+
* ack is skipped, and the ack is posted again so the peer can trim them. A
|
|
2754
|
+
* frame {@link isLocalWireMessage} rejects never reaches here; one that still
|
|
2755
|
+
* fails conversion is recorded as a failure.
|
|
2756
|
+
*/
|
|
2757
|
+
private receivePush;
|
|
2758
|
+
private receiveResend;
|
|
2759
|
+
private sendHello;
|
|
2760
|
+
/**
|
|
2761
|
+
* Pushes the given outbox items to the peer, marking them in flight.
|
|
2762
|
+
*
|
|
2763
|
+
* A transport throw is classified rather than treated as terminal: only a
|
|
2764
|
+
* structured-clone failure, which recurs identically on every retry, dead-
|
|
2765
|
+
* letters its ops. Any other fault is transient -- the port is momentarily
|
|
2766
|
+
* unusable -- so the ops stay in the outbox and {@link handlePushFailure}
|
|
2767
|
+
* schedules a backoff re-push, keeping behaviour in step with the gql
|
|
2768
|
+
* sibling's recoverable/unrecoverable split.
|
|
2769
|
+
*/
|
|
2770
|
+
private pushOutbox;
|
|
2771
|
+
/** Re-pushes every outbox item the peer has not acknowledged. */
|
|
2772
|
+
private rePushUnacked;
|
|
2773
|
+
/**
|
|
2774
|
+
* Routes a push transport failure: a structured-clone (`DataCloneError`)
|
|
2775
|
+
* failure is unrecoverable and dead-letters its ops; any other error is a
|
|
2776
|
+
* transient transport fault, so the ops are left in the outbox to be
|
|
2777
|
+
* re-pushed by the backoff retry and by the next hello/resend recovery.
|
|
2778
|
+
*/
|
|
2779
|
+
private handlePushFailure;
|
|
2780
|
+
/** A structured-clone failure cannot self-heal; every other fault can. */
|
|
2781
|
+
private classifyPostError;
|
|
2782
|
+
/** Schedules a single backoff re-push of the unacked outbox. */
|
|
2783
|
+
private schedulePushRetry;
|
|
2784
|
+
/** Clears the backoff state once a push lands or the channel stops. */
|
|
2785
|
+
private clearPushRetry;
|
|
2786
|
+
/** One envelope per SyncOperation, with key/dependsOn for batch ordering. */
|
|
2787
|
+
private envelopesFor;
|
|
2788
|
+
/**
|
|
2789
|
+
* Hears the peer's manifest, deduped like the gql channel: an older or
|
|
2790
|
+
* identical revision is ignored, so a reconnect that re-announces the same
|
|
2791
|
+
* manifest does not re-run the sync manager's hold reconciliation.
|
|
2792
|
+
*/
|
|
2793
|
+
private hearPeer;
|
|
2794
|
+
/** Sends a message, returning whether the transport accepted it. */
|
|
2795
|
+
private post;
|
|
2796
|
+
/** Leaves the push retry alone: only a push that lands clears it. */
|
|
2797
|
+
private markSuccess;
|
|
2798
|
+
private recordFailure;
|
|
2799
|
+
private transitionConnectionState;
|
|
2800
|
+
/** The greatest operation ordinal a sync op carries, or 0 when it carries none. */
|
|
2801
|
+
private highestOrdinal;
|
|
2802
|
+
/** The lowest ordinal of an outbox item the peer has not applied. */
|
|
2803
|
+
private unappliedOutboxFloor;
|
|
2804
|
+
/**
|
|
2805
|
+
* Advances a persisted cursor only once the write has landed, and never with
|
|
2806
|
+
* two writes for the same row outstanding. See the gql request channel for
|
|
2807
|
+
* the full argument: concurrent writers for one row are last-writer-wins, and
|
|
2808
|
+
* the storage promises no FIFO, so a burst of removals is coalesced into one
|
|
2809
|
+
* ordered write rather than a race.
|
|
2810
|
+
*/
|
|
2811
|
+
private persistCursor;
|
|
2812
|
+
/** One link of a cursor write chain; never rejects, so the chain survives. */
|
|
2813
|
+
private writeCursor;
|
|
2814
|
+
}
|
|
2815
|
+
//#endregion
|
|
2816
|
+
//#region src/sync/channels/local-channel-factory.d.ts
|
|
2817
|
+
/** The {@link ChannelConfig.type} a LocalChannel is created from. */
|
|
2818
|
+
export declare const LOCAL_CHANNEL_TYPE = "local";
|
|
2819
|
+
/**
|
|
2820
|
+
* Factory for {@link LocalChannel} instances.
|
|
2821
|
+
*
|
|
2822
|
+
* The channel's config is `{ type: "local", parameters: { peerId, channelName } }`
|
|
2823
|
+
* -- no url, because there is no server. The factory does not take a port
|
|
2824
|
+
* directly: {@link IChannelFactory.instance} has no seam for a live object, and
|
|
2825
|
+
* a MessagePort is not clone-safe config that could ride in `parameters`.
|
|
2826
|
+
* Instead the factory holds a {@link LocalChannelTransportProvider} and resolves
|
|
2827
|
+
* the port from the (peerId, channelName) the config names. W1.2 supplies a real
|
|
2828
|
+
* brokered MessagePort by registering it with the provider under that key, with
|
|
2829
|
+
* no change to the channel or this factory.
|
|
2830
|
+
*/
|
|
2831
|
+
export declare class LocalChannelFactory implements IChannelFactory {
|
|
2832
|
+
readonly channelTypes: string[];
|
|
2833
|
+
private readonly logger;
|
|
2834
|
+
private readonly transportProvider;
|
|
2835
|
+
constructor(logger: ILogger, transportProvider: LocalChannelTransportProvider);
|
|
2836
|
+
instance(remoteId: string, remoteName: string, config: ChannelConfig, cursorStorage: ISyncCursorStorage, collectionId: DriveCollectionId, filter: RemoteFilter, _operationIndex: IOperationIndex, _options?: RemoteOptions): IChannel;
|
|
2837
|
+
}
|
|
2838
|
+
//#endregion
|
|
2839
|
+
//#region src/sync/channels/local-channel-registry.d.ts
|
|
2840
|
+
type LocalChannelPortRegistryOptions = {
|
|
2841
|
+
logger?: ILogger;
|
|
2842
|
+
/** Frames held for a detached port before its queued pushes are discarded. */
|
|
2843
|
+
maxQueuedFrames?: number;
|
|
2844
|
+
};
|
|
2845
|
+
/** Brokered local-sync ports by (peerId, channelName); owns closing them. */
|
|
2846
|
+
export declare class LocalChannelPortRegistry {
|
|
2847
|
+
private readonly ports;
|
|
2848
|
+
private readonly closedKeys;
|
|
2849
|
+
private closed;
|
|
2850
|
+
private readonly logger;
|
|
2851
|
+
private readonly maxQueuedFrames;
|
|
2852
|
+
constructor(options?: LocalChannelPortRegistryOptions);
|
|
2853
|
+
/** Hand this to the {@link LocalChannelFactory}. */
|
|
2854
|
+
readonly provider: LocalChannelTransportProvider;
|
|
2855
|
+
/** Refuses a live key; a closed key may be registered again (a re-link). */
|
|
2856
|
+
register(peerId: string, channelName: string, port: LocalChannelPort): void;
|
|
2857
|
+
has(peerId: string, channelName: string): boolean;
|
|
2858
|
+
isClosed(peerId: string, channelName: string): boolean;
|
|
2859
|
+
/** Detaches the registry's listener and closes the port. */
|
|
2860
|
+
unregister(peerId: string, channelName: string): void;
|
|
2861
|
+
/** Closes every port and refuses later registrations; the host is going away. */
|
|
2862
|
+
close(): void;
|
|
2863
|
+
private key;
|
|
2864
|
+
}
|
|
2865
|
+
/** `branch: ""` matches every branch. */
|
|
2866
|
+
export declare const DEFAULT_LOCAL_FILTER: RemoteFilter;
|
|
2867
|
+
/** Session-scoped: no later boot can rebuild a brokered port. */
|
|
2868
|
+
export declare const LOCAL_REMOTE_OPTIONS: RemoteOptions;
|
|
2869
|
+
export declare function localChannelConfig(peerId: string, channelName: string): ChannelConfig;
|
|
2870
|
+
/** `fromKey` splits on the last dot, so neither part may hold one. */
|
|
2871
|
+
export declare function assertCollectionIdParts(driveId: string, branch: string): void;
|
|
2872
|
+
/** A dotted drive id parses as a dotted branch, so that is refused here. */
|
|
2873
|
+
export declare function collectionIdFromKey(key: string): DriveCollectionId;
|
|
2874
|
+
type LocalRemoteSpec = {
|
|
2875
|
+
peerId: string;
|
|
2876
|
+
channelName: string;
|
|
2877
|
+
collectionId: DriveCollectionId;
|
|
2878
|
+
remoteName: string;
|
|
2879
|
+
filter: RemoteFilter;
|
|
2880
|
+
};
|
|
2881
|
+
type LocalRemoveSpec = {
|
|
2882
|
+
remoteName: string;
|
|
2883
|
+
peerId: string;
|
|
2884
|
+
channelName: string;
|
|
2885
|
+
};
|
|
2886
|
+
type LocalPeerSyncManager = Pick<ISyncManager, "list" | "add" | "remove" | "resetSettled">;
|
|
2887
|
+
/** Registers before `add`, because `add` resolves the port through the factory. */
|
|
2888
|
+
export declare function registerLocalPeer(syncManager: LocalPeerSyncManager, registry: LocalChannelPortRegistry, spec: LocalRemoteSpec, port: LocalChannelPort): Promise<Remote>;
|
|
2889
|
+
/**
|
|
2890
|
+
* Waits out a running reset, then removes. The port is closed only once the
|
|
2891
|
+
* remote is gone, so a failed remove (a reset that started meanwhile) leaves
|
|
2892
|
+
* the link intact for a retry.
|
|
2893
|
+
*/
|
|
2894
|
+
export declare function removeLocalPeer(syncManager: LocalPeerSyncManager, registry: LocalChannelPortRegistry, spec: LocalRemoveSpec): Promise<void>;
|
|
2895
|
+
//#endregion
|
|
2896
|
+
//#region src/sync/channels/local-wire.d.ts
|
|
2897
|
+
/**
|
|
2898
|
+
* The messages two {@link LocalChannel}s exchange over a message port.
|
|
2899
|
+
*
|
|
2900
|
+
* The protocol is a stream, not a request/response: either side may send any
|
|
2901
|
+
* message at any time and nothing is correlated by a reply. It is the symmetric
|
|
2902
|
+
* analog of the gql channels' touchChannel/pushSyncEnvelopes/ackOrdinal, carried
|
|
2903
|
+
* as structured-clone-safe plain data so a real MessagePort can clone it -- no
|
|
2904
|
+
* functions, no class instances on the wire.
|
|
2905
|
+
*
|
|
2906
|
+
* Ordinal discipline mirrors the gql channels (see sync/design.md:178-204): an
|
|
2907
|
+
* ordinal a side reports is always how far IT has applied of what the PEER sent,
|
|
2908
|
+
* i.e. an ordinal in the peer's outbox frame. The receiver of such a report
|
|
2909
|
+
* trims its own outbox against it with `trimMailboxFromAckOrdinal`.
|
|
2910
|
+
*/
|
|
2911
|
+
type LocalWireMessage = LocalHelloMessage | LocalPushMessage | LocalAckMessage | LocalResendMessage;
|
|
2912
|
+
/** Identifies which end of the handshake sent a message, for diagnostics. */
|
|
2913
|
+
type LocalWireKind = "hello" | "push" | "ack" | "resend";
|
|
2914
|
+
/**
|
|
2915
|
+
* Opens (or re-opens) the link. Each side sends one on init. A side that hears
|
|
2916
|
+
* an opening hello answers with one marked `reply`, so a side that resets while
|
|
2917
|
+
* its peer stays up still completes a handshake; a reply is never answered.
|
|
2918
|
+
*
|
|
2919
|
+
* `sinceOrdinal` is the sender's inbox ack: the peer trims its outbox up to it,
|
|
2920
|
+
* exactly as it would on an {@link LocalAckMessage}, so a HELLO after a restart
|
|
2921
|
+
* resumes without re-serving what the sender already applied. `manifest` is the
|
|
2922
|
+
* sender's PeerManifest (null for a peer that announces nothing), which drives
|
|
2923
|
+
* the receiver's version-skew holds.
|
|
2924
|
+
*/
|
|
2925
|
+
type LocalHelloMessage = {
|
|
2926
|
+
kind: "hello";
|
|
2927
|
+
channelId: string;
|
|
2928
|
+
collectionId: string;
|
|
2929
|
+
filter: RemoteFilter;
|
|
2930
|
+
sinceOrdinal: number;
|
|
2931
|
+
manifest: PeerManifest | null;
|
|
2932
|
+
reply?: boolean;
|
|
2933
|
+
};
|
|
2934
|
+
/**
|
|
2935
|
+
* Carries sync envelopes to the peer's inbox. `envelopes` is the output of
|
|
2936
|
+
* `serializeEnvelope`, which the receiver feeds back through
|
|
2937
|
+
* `envelopesToSyncOperations`; the pair keeps the payload clone-safe and
|
|
2938
|
+
* preserves key/dependsOn batch ordering across the wire.
|
|
2939
|
+
*/
|
|
2940
|
+
type LocalPushMessage = {
|
|
2941
|
+
kind: "push";
|
|
2942
|
+
channelId: string;
|
|
2943
|
+
envelopes: unknown[];
|
|
2944
|
+
};
|
|
2945
|
+
/**
|
|
2946
|
+
* Advances the peer's knowledge of what this side has applied. `ackOrdinal` is
|
|
2947
|
+
* this side's inbox ack (the peer's outbox frame); the peer trims its outbox up
|
|
2948
|
+
* to it. Sent whenever the inbox cursor advances.
|
|
2949
|
+
*/
|
|
2950
|
+
type LocalAckMessage = {
|
|
2951
|
+
kind: "ack";
|
|
2952
|
+
channelId: string;
|
|
2953
|
+
ackOrdinal: number;
|
|
2954
|
+
};
|
|
2955
|
+
/**
|
|
2956
|
+
* Asks the peer to re-push whatever it still holds unacked for this side. It is
|
|
2957
|
+
* the push transport's stand-in for a pull: there is nothing to poll, so a
|
|
2958
|
+
* resend request carries this side's inbox ack both to trim the peer's outbox
|
|
2959
|
+
* and to let the peer re-send the remainder.
|
|
2960
|
+
*/
|
|
2961
|
+
type LocalResendMessage = {
|
|
2962
|
+
kind: "resend";
|
|
2963
|
+
channelId: string;
|
|
2964
|
+
sinceOrdinal: number;
|
|
2965
|
+
};
|
|
2966
|
+
/**
|
|
2967
|
+
* Whether a received value is a well-formed wire message.
|
|
2968
|
+
*
|
|
2969
|
+
* A push is validated down to what `envelopesToSyncOperations` dereferences:
|
|
2970
|
+
* each envelope's `channelMeta.id` and, per operation, the `operation.action`
|
|
2971
|
+
* and the `context` fields it batches on.
|
|
2972
|
+
*/
|
|
2973
|
+
export declare function isLocalWireMessage(data: unknown): data is LocalWireMessage;
|
|
2974
|
+
//#endregion
|
|
2483
2975
|
//#region src/sync/channels/interval-poll-timer.d.ts
|
|
2484
2976
|
type PollTimerConfig = {
|
|
2485
2977
|
intervalMs: number;
|
|
@@ -2713,46 +3205,6 @@ type ReactorHostModuleBaseOptions = Pick<IProcessorHostModuleBase$1, "analyticsS
|
|
|
2713
3205
|
/** Builds the reactor-level host module; hosts spread it and add their own fields. */
|
|
2714
3206
|
export declare function createReactorHostModuleBase(options: ReactorHostModuleBaseOptions): IReactorProcessorHostModuleBase;
|
|
2715
3207
|
//#endregion
|
|
2716
|
-
//#region src/admin/types.d.ts
|
|
2717
|
-
type KeyframeValidationIssue = {
|
|
2718
|
-
scope: string;
|
|
2719
|
-
branch: string;
|
|
2720
|
-
revision: number;
|
|
2721
|
-
keyframeHash: string;
|
|
2722
|
-
replayedHash: string;
|
|
2723
|
-
};
|
|
2724
|
-
type SnapshotValidationIssue = {
|
|
2725
|
-
scope: string;
|
|
2726
|
-
branch: string;
|
|
2727
|
-
snapshotHash: string;
|
|
2728
|
-
replayedHash: string;
|
|
2729
|
-
};
|
|
2730
|
-
/** Effective operations whose stored order contradicts their timestamps. */
|
|
2731
|
-
type StreamOrderIssue = {
|
|
2732
|
-
scope: string;
|
|
2733
|
-
branch: string;
|
|
2734
|
-
previous: Operation;
|
|
2735
|
-
current: Operation;
|
|
2736
|
-
kind: OutOfOrderPair["kind"];
|
|
2737
|
-
};
|
|
2738
|
-
type ValidationResult = {
|
|
2739
|
-
documentId: string;
|
|
2740
|
-
isConsistent: boolean;
|
|
2741
|
-
keyframeIssues: KeyframeValidationIssue[];
|
|
2742
|
-
snapshotIssues: SnapshotValidationIssue[];
|
|
2743
|
-
streamOrderIssues: StreamOrderIssue[];
|
|
2744
|
-
};
|
|
2745
|
-
type RebuildResult = {
|
|
2746
|
-
documentId: string;
|
|
2747
|
-
keyframesDeleted: number;
|
|
2748
|
-
scopesInvalidated: number;
|
|
2749
|
-
};
|
|
2750
|
-
interface IDocumentIntegrityService {
|
|
2751
|
-
validateDocument(documentId: string, branch?: string, signal?: AbortSignal): Promise<ValidationResult>;
|
|
2752
|
-
rebuildKeyframes(documentId: string, branch?: string, signal?: AbortSignal): Promise<RebuildResult>;
|
|
2753
|
-
rebuildSnapshots(documentId: string, branch?: string, signal?: AbortSignal): Promise<RebuildResult>;
|
|
2754
|
-
}
|
|
2755
|
-
//#endregion
|
|
2756
3208
|
//#region src/admin/document-integrity-service.d.ts
|
|
2757
3209
|
export declare class DocumentIntegrityService implements IDocumentIntegrityService {
|
|
2758
3210
|
private readonly keyframeStore;
|
|
@@ -2913,6 +3365,456 @@ export declare class ContiguousCursor {
|
|
|
2913
3365
|
advance(to: number): void;
|
|
2914
3366
|
}
|
|
2915
3367
|
//#endregion
|
|
3368
|
+
//#region src/inspector/drive-inspection.d.ts
|
|
3369
|
+
/** `IReactor` reads as the host; `IReactorClient` gates on `view.subject`. */
|
|
3370
|
+
type InspectorDocumentReader = {
|
|
3371
|
+
find(search: SearchFilter, view?: ViewFilter, paging?: PagingOptions): Promise<PagedResults<PHDocument>>;
|
|
3372
|
+
get(id: string, view?: ViewFilter): Promise<PHDocument>;
|
|
3373
|
+
};
|
|
3374
|
+
/** Drive listing and integrity, every read made through one reader and view. */
|
|
3375
|
+
export declare class DriveInspection {
|
|
3376
|
+
private readonly reader;
|
|
3377
|
+
private readonly registry?;
|
|
3378
|
+
private readonly view;
|
|
3379
|
+
constructor(reader: InspectorDocumentReader, registry?: IDocumentModelRegistry | undefined, view?: ViewFilter);
|
|
3380
|
+
listDrives(cursor?: string, limit?: number): Promise<InspectorDrivePage>;
|
|
3381
|
+
checkDriveIntegrity(driveId: string, branch: string): Promise<InspectorDriveIntegrity>;
|
|
3382
|
+
private presentDocumentIds;
|
|
3383
|
+
private supportedDocumentTypes;
|
|
3384
|
+
}
|
|
3385
|
+
//#endregion
|
|
3386
|
+
//#region src/inspector/reactor-inspector.d.ts
|
|
3387
|
+
/** The facts a `ReactorInspector` reports; `workflows` changes after build. */
|
|
3388
|
+
type ReactorInspectorFacts = {
|
|
3389
|
+
storage?: ReactorStorageFacts;
|
|
3390
|
+
syncChannels?: readonly string[];
|
|
3391
|
+
access?: InspectorAccess;
|
|
3392
|
+
workflows?: boolean;
|
|
3393
|
+
};
|
|
3394
|
+
/** A missing component reads as empty; an action on one is refused. */
|
|
3395
|
+
type ReactorInspectorComponents = {
|
|
3396
|
+
queue?: IInspectableQueue;
|
|
3397
|
+
processorManager?: IProcessorManager$1;
|
|
3398
|
+
catchUp?: ICatchUp;
|
|
3399
|
+
integrity?: IDocumentIntegrityService;
|
|
3400
|
+
storageHealth?: IInspectorStorageHealthProvider;
|
|
3401
|
+
documentModelRegistry?: IDocumentModelRegistry;
|
|
3402
|
+
drives?: DriveInspection;
|
|
3403
|
+
attachmentStore?: IInspectableAttachmentStore;
|
|
3404
|
+
facts?: ReactorInspectorFacts;
|
|
3405
|
+
};
|
|
3406
|
+
/** In-process inspector over a reactor module's live components. */
|
|
3407
|
+
export declare class ReactorInspector implements IInspector, IInspectorAdmin, IReactorFactsSink {
|
|
3408
|
+
private readonly components;
|
|
3409
|
+
private readonly storageFacts;
|
|
3410
|
+
private readonly syncChannels;
|
|
3411
|
+
private readonly access;
|
|
3412
|
+
private workflows;
|
|
3413
|
+
constructor(components: ReactorInspectorComponents);
|
|
3414
|
+
setWorkflows(composed: boolean): void;
|
|
3415
|
+
info(): Promise<ReactorInfo>;
|
|
3416
|
+
listDocumentModels(): Promise<InspectorDocumentModelInfo[]>;
|
|
3417
|
+
listDrives(cursor?: string, limit?: number): Promise<InspectorDrivePage>;
|
|
3418
|
+
checkDriveIntegrity(driveId: string, branch: string): Promise<InspectorDriveIntegrity>;
|
|
3419
|
+
getAttachmentInfo(): Promise<InspectorAttachmentInfo>;
|
|
3420
|
+
getQueueState(): Promise<QueueStateSnapshot>;
|
|
3421
|
+
getProcessors(): Promise<InspectorProcessorInfo[]>;
|
|
3422
|
+
getCatchUpStatus(): Promise<CatchUpStatus>;
|
|
3423
|
+
getStorageHealth(): Promise<InspectorStorageHealth>;
|
|
3424
|
+
validateDocument(documentId: string, branch?: string): Promise<ValidationResult>;
|
|
3425
|
+
pauseQueue(): Promise<void>;
|
|
3426
|
+
resumeQueue(): Promise<void>;
|
|
3427
|
+
retryProcessor(processorId: string): Promise<void>;
|
|
3428
|
+
sweepCatchUp(): Promise<SweepResult[]>;
|
|
3429
|
+
rebuildKeyframes(documentId: string, branch?: string): Promise<RebuildResult>;
|
|
3430
|
+
rebuildSnapshots(documentId: string, branch?: string): Promise<RebuildResult>;
|
|
3431
|
+
}
|
|
3432
|
+
//#endregion
|
|
3433
|
+
//#region src/inspector/from-module.d.ts
|
|
3434
|
+
type ReactorInspectorOptions = {
|
|
3435
|
+
/** Absent: a group-commit store's own health, else `tracked: false`. */
|
|
3436
|
+
storageHealth?: IInspectorStorageHealthProvider;
|
|
3437
|
+
attachmentStore?: IInspectableAttachmentStore;
|
|
3438
|
+
/** The tiers the host serves beyond reads; defaults to reads only. */
|
|
3439
|
+
access?: InspectorAccess;
|
|
3440
|
+
/** Set later through `setWorkflows` when the runtime is composed after build. */
|
|
3441
|
+
workflows?: boolean;
|
|
3442
|
+
};
|
|
3443
|
+
/** The in-process inspector over a built module; drive reads run as the host. */
|
|
3444
|
+
export declare function createReactorInspector(module: InProcessReactorModule, options?: ReactorInspectorOptions): ReactorInspector;
|
|
3445
|
+
//#endregion
|
|
3446
|
+
//#region src/inspector/ops.d.ts
|
|
3447
|
+
/** Reads serve every caller a transport admits; admin and sql need access. */
|
|
3448
|
+
type InspectorTier = "read" | "admin" | "sql";
|
|
3449
|
+
/** Only a read op has a GraphQL root field. */
|
|
3450
|
+
type InspectorOpSpec = {
|
|
3451
|
+
readonly rpc: string;
|
|
3452
|
+
readonly tier: "read";
|
|
3453
|
+
readonly gql: string;
|
|
3454
|
+
} | {
|
|
3455
|
+
readonly rpc: string;
|
|
3456
|
+
readonly tier: "admin" | "sql";
|
|
3457
|
+
};
|
|
3458
|
+
/** The `inspector-op` channel, one row per member. */
|
|
3459
|
+
export declare const INSPECTOR_OPS: {
|
|
3460
|
+
readonly info: {
|
|
3461
|
+
readonly rpc: "reactor.info";
|
|
3462
|
+
readonly tier: "read";
|
|
3463
|
+
readonly gql: "info";
|
|
3464
|
+
};
|
|
3465
|
+
readonly listDocumentModels: {
|
|
3466
|
+
readonly rpc: "registry.listDocumentModels";
|
|
3467
|
+
readonly tier: "read";
|
|
3468
|
+
readonly gql: "documentModels";
|
|
3469
|
+
};
|
|
3470
|
+
readonly listDrives: {
|
|
3471
|
+
readonly rpc: "drives.list";
|
|
3472
|
+
readonly tier: "read";
|
|
3473
|
+
readonly gql: "drives";
|
|
3474
|
+
};
|
|
3475
|
+
readonly checkDriveIntegrity: {
|
|
3476
|
+
readonly rpc: "drives.checkIntegrity";
|
|
3477
|
+
readonly tier: "read";
|
|
3478
|
+
readonly gql: "driveIntegrity";
|
|
3479
|
+
};
|
|
3480
|
+
readonly getAttachmentInfo: {
|
|
3481
|
+
readonly rpc: "attachments.info";
|
|
3482
|
+
readonly tier: "read";
|
|
3483
|
+
readonly gql: "attachmentInfo";
|
|
3484
|
+
};
|
|
3485
|
+
readonly getQueueState: {
|
|
3486
|
+
readonly rpc: "queue.getState";
|
|
3487
|
+
readonly tier: "read";
|
|
3488
|
+
readonly gql: "queueState";
|
|
3489
|
+
};
|
|
3490
|
+
readonly getProcessors: {
|
|
3491
|
+
readonly rpc: "processors.getAll";
|
|
3492
|
+
readonly tier: "read";
|
|
3493
|
+
readonly gql: "processors";
|
|
3494
|
+
};
|
|
3495
|
+
readonly getCatchUpStatus: {
|
|
3496
|
+
readonly rpc: "catchUp.status";
|
|
3497
|
+
readonly tier: "read";
|
|
3498
|
+
readonly gql: "catchUpStatus";
|
|
3499
|
+
};
|
|
3500
|
+
readonly getStorageHealth: {
|
|
3501
|
+
readonly rpc: "storage.health";
|
|
3502
|
+
readonly tier: "read";
|
|
3503
|
+
readonly gql: "storageHealth";
|
|
3504
|
+
};
|
|
3505
|
+
readonly validateDocument: {
|
|
3506
|
+
readonly rpc: "integrity.validate";
|
|
3507
|
+
readonly tier: "read";
|
|
3508
|
+
readonly gql: "validateDocument";
|
|
3509
|
+
};
|
|
3510
|
+
readonly pauseQueue: {
|
|
3511
|
+
readonly rpc: "queue.pause";
|
|
3512
|
+
readonly tier: "admin";
|
|
3513
|
+
};
|
|
3514
|
+
readonly resumeQueue: {
|
|
3515
|
+
readonly rpc: "queue.resume";
|
|
3516
|
+
readonly tier: "admin";
|
|
3517
|
+
};
|
|
3518
|
+
readonly retryProcessor: {
|
|
3519
|
+
readonly rpc: "processors.retry";
|
|
3520
|
+
readonly tier: "admin";
|
|
3521
|
+
};
|
|
3522
|
+
readonly sweepCatchUp: {
|
|
3523
|
+
readonly rpc: "catchUp.sweepNow";
|
|
3524
|
+
readonly tier: "admin";
|
|
3525
|
+
};
|
|
3526
|
+
readonly rebuildKeyframes: {
|
|
3527
|
+
readonly rpc: "integrity.rebuildKeyframes";
|
|
3528
|
+
readonly tier: "admin";
|
|
3529
|
+
};
|
|
3530
|
+
readonly rebuildSnapshots: {
|
|
3531
|
+
readonly rpc: "integrity.rebuildSnapshots";
|
|
3532
|
+
readonly tier: "admin";
|
|
3533
|
+
};
|
|
3534
|
+
readonly queryDb: {
|
|
3535
|
+
readonly rpc: "db.query";
|
|
3536
|
+
readonly tier: "sql";
|
|
3537
|
+
};
|
|
3538
|
+
};
|
|
3539
|
+
/** The inspection and repair rows of the `sync-op` channel. */
|
|
3540
|
+
export declare const SYNC_INSPECTION_OPS: {
|
|
3541
|
+
readonly inspectRemote: {
|
|
3542
|
+
readonly rpc: "inspect.remote";
|
|
3543
|
+
readonly tier: "read";
|
|
3544
|
+
readonly gql: "remote";
|
|
3545
|
+
};
|
|
3546
|
+
readonly inspectRemotes: {
|
|
3547
|
+
readonly rpc: "inspect.remotes";
|
|
3548
|
+
readonly tier: "read";
|
|
3549
|
+
readonly gql: "remotes";
|
|
3550
|
+
};
|
|
3551
|
+
readonly listDeadLetters: {
|
|
3552
|
+
readonly rpc: "deadLetters.list";
|
|
3553
|
+
readonly tier: "read";
|
|
3554
|
+
readonly gql: "deadLetters";
|
|
3555
|
+
};
|
|
3556
|
+
readonly resetChannel: {
|
|
3557
|
+
readonly rpc: "repair.resetChannel";
|
|
3558
|
+
readonly tier: "admin";
|
|
3559
|
+
};
|
|
3560
|
+
readonly requeueDeadLetter: {
|
|
3561
|
+
readonly rpc: "deadLetters.requeue";
|
|
3562
|
+
readonly tier: "admin";
|
|
3563
|
+
};
|
|
3564
|
+
readonly clearDeadLetter: {
|
|
3565
|
+
readonly rpc: "deadLetters.clear";
|
|
3566
|
+
readonly tier: "admin";
|
|
3567
|
+
};
|
|
3568
|
+
};
|
|
3569
|
+
type InspectorOpKey = keyof typeof INSPECTOR_OPS;
|
|
3570
|
+
type SyncInspectionOpKey = keyof typeof SYNC_INSPECTION_OPS;
|
|
3571
|
+
type ReadKeys<T> = { [K in keyof T]: T[K] extends {
|
|
3572
|
+
readonly tier: "read";
|
|
3573
|
+
} ? K : never; }[keyof T];
|
|
3574
|
+
type InspectorReadOpKey = ReadKeys<typeof INSPECTOR_OPS>;
|
|
3575
|
+
type SyncInspectionReadOpKey = ReadKeys<typeof SYNC_INSPECTION_OPS>;
|
|
3576
|
+
/** Reads only, unless a host grants more. */
|
|
3577
|
+
export declare const READ_ONLY_ACCESS: InspectorAccess;
|
|
3578
|
+
export declare function tierAllowed(tier: InspectorTier, access: InspectorAccess): boolean;
|
|
3579
|
+
/** The table key whose rpc name is `method`, or undefined. */
|
|
3580
|
+
export declare function opKeyOf<K extends string>(table: Readonly<Record<K, InspectorOpSpec>>, method: string): K | undefined;
|
|
3581
|
+
/** The read rows' GraphQL root field names, keyed by member. */
|
|
3582
|
+
export declare function readOpFields<K extends string>(table: Readonly<Record<K, InspectorOpSpec>>): Partial<Record<K, string>>;
|
|
3583
|
+
export declare class UnknownInspectorOpError extends Error {
|
|
3584
|
+
readonly method: string;
|
|
3585
|
+
constructor(method: string);
|
|
3586
|
+
}
|
|
3587
|
+
export declare class InspectorOpRefusedError extends Error {
|
|
3588
|
+
readonly method: string;
|
|
3589
|
+
readonly tier: InspectorTier;
|
|
3590
|
+
constructor(method: string, tier: InspectorTier);
|
|
3591
|
+
}
|
|
3592
|
+
export declare class InspectorOpUnavailableError extends Error {
|
|
3593
|
+
readonly method: string;
|
|
3594
|
+
constructor(method: string);
|
|
3595
|
+
}
|
|
3596
|
+
type OpHandler = (...args: unknown[]) => unknown;
|
|
3597
|
+
/** Refuses unknown methods and ungranted tiers before resolving a handler. */
|
|
3598
|
+
export declare function dispatchTableOp<K extends string>(table: Readonly<Record<K, InspectorOpSpec>>, resolve: (key: K) => OpHandler | undefined, access: InspectorAccess, method: string, args: readonly unknown[]): Promise<unknown>;
|
|
3599
|
+
/** Binds `key` on `target` when it is a method there. */
|
|
3600
|
+
export declare function methodOf(target: object | undefined, key: string): OpHandler | undefined;
|
|
3601
|
+
//#endregion
|
|
3602
|
+
//#region src/inspector/storage-facts.d.ts
|
|
3603
|
+
export declare const UNKNOWN_STORAGE_FACTS: ReactorStorageFacts;
|
|
3604
|
+
export declare const POSTGRES_STORAGE_FACTS: ReactorStorageFacts;
|
|
3605
|
+
export declare const IN_MEMORY_PGLITE_STORAGE_FACTS: ReactorStorageFacts;
|
|
3606
|
+
export declare const PGLITE_PATH_STORAGE_FACTS: ReactorStorageFacts;
|
|
3607
|
+
export declare const PGLITE_IDB_STORAGE_FACTS: ReactorStorageFacts;
|
|
3608
|
+
//#endregion
|
|
3609
|
+
//#region src/inspector/wire.d.ts
|
|
3610
|
+
type WireChannelConfig = {
|
|
3611
|
+
readonly type?: string;
|
|
3612
|
+
readonly parameters?: Record<string, unknown>;
|
|
3613
|
+
};
|
|
3614
|
+
/** `RemoteMeta` as JSON delivers it; a vanished remote is identity only. */
|
|
3615
|
+
type WireRemoteMeta = {
|
|
3616
|
+
readonly id: string;
|
|
3617
|
+
readonly name?: string;
|
|
3618
|
+
readonly collectionId?: {
|
|
3619
|
+
readonly driveId?: string;
|
|
3620
|
+
readonly branch?: string;
|
|
3621
|
+
};
|
|
3622
|
+
readonly channelConfig?: WireChannelConfig;
|
|
3623
|
+
readonly filter?: RemoteFilter;
|
|
3624
|
+
readonly options?: RemoteOptions;
|
|
3625
|
+
readonly peer?: RemotePeer;
|
|
3626
|
+
};
|
|
3627
|
+
type WireReactorStorageFacts = {
|
|
3628
|
+
readonly engine: string;
|
|
3629
|
+
readonly persistence: string;
|
|
3630
|
+
readonly durable: boolean;
|
|
3631
|
+
readonly selfHeal: boolean;
|
|
3632
|
+
};
|
|
3633
|
+
type WireInspectorAccess = {
|
|
3634
|
+
readonly admin: boolean;
|
|
3635
|
+
readonly sql: boolean;
|
|
3636
|
+
};
|
|
3637
|
+
/** `access` is null for a caller who is not an operator of the host. */
|
|
3638
|
+
type WireReactorInfo = {
|
|
3639
|
+
readonly storage: WireReactorStorageFacts;
|
|
3640
|
+
readonly workflows: boolean;
|
|
3641
|
+
readonly syncChannels: readonly string[];
|
|
3642
|
+
readonly access: WireInspectorAccess | null;
|
|
3643
|
+
};
|
|
3644
|
+
/** A queued job without its actions or operations. */
|
|
3645
|
+
type WireQueueJob = {
|
|
3646
|
+
readonly id: string;
|
|
3647
|
+
readonly kind: string;
|
|
3648
|
+
readonly documentId: string;
|
|
3649
|
+
readonly scope: string;
|
|
3650
|
+
readonly branch: string;
|
|
3651
|
+
readonly status: "pending" | "executing";
|
|
3652
|
+
readonly actionCount: number;
|
|
3653
|
+
readonly operationCount: number;
|
|
3654
|
+
readonly retryCount: number;
|
|
3655
|
+
};
|
|
3656
|
+
type WireQueueState = {
|
|
3657
|
+
readonly isPaused: boolean;
|
|
3658
|
+
readonly totalPending: number;
|
|
3659
|
+
readonly totalExecuting: number;
|
|
3660
|
+
readonly pendingJobs: WireQueueJob[];
|
|
3661
|
+
readonly executingJobs: WireQueueJob[];
|
|
3662
|
+
};
|
|
3663
|
+
type WireInspectorDocumentModel = {
|
|
3664
|
+
readonly documentType: string;
|
|
3665
|
+
readonly name: string;
|
|
3666
|
+
readonly version: number;
|
|
3667
|
+
readonly supportedVersions: number[];
|
|
3668
|
+
};
|
|
3669
|
+
type WireInspectorDrive = {
|
|
3670
|
+
readonly driveId: string;
|
|
3671
|
+
readonly name: string;
|
|
3672
|
+
readonly branch: string;
|
|
3673
|
+
readonly collectionId: string;
|
|
3674
|
+
readonly documentType: string;
|
|
3675
|
+
readonly nodeCount: number;
|
|
3676
|
+
readonly fileCount: number;
|
|
3677
|
+
readonly folderCount: number;
|
|
3678
|
+
readonly otherNodeCount: number;
|
|
3679
|
+
readonly unreadableNodeCount: number;
|
|
3680
|
+
readonly icon: string | null;
|
|
3681
|
+
};
|
|
3682
|
+
type WireInspectorDrivePage = {
|
|
3683
|
+
readonly results: WireInspectorDrive[];
|
|
3684
|
+
readonly nextCursor: string | null;
|
|
3685
|
+
};
|
|
3686
|
+
type WireInspectorDriveIntegrityRef = {
|
|
3687
|
+
readonly id: string;
|
|
3688
|
+
readonly documentType: string;
|
|
3689
|
+
};
|
|
3690
|
+
type WireInspectorDriveIntegrity = {
|
|
3691
|
+
readonly driveId: string;
|
|
3692
|
+
readonly checkedNodeCount: number;
|
|
3693
|
+
readonly totalFileNodeCount: number;
|
|
3694
|
+
readonly missingDocuments: WireInspectorDriveIntegrityRef[];
|
|
3695
|
+
readonly unsupportedTypes: WireInspectorDriveIntegrityRef[];
|
|
3696
|
+
};
|
|
3697
|
+
type WireInspectorAttachmentInfo = {
|
|
3698
|
+
readonly present: boolean;
|
|
3699
|
+
readonly storeKind: string;
|
|
3700
|
+
readonly hasReplicator: boolean;
|
|
3701
|
+
readonly replicatorRunning: boolean;
|
|
3702
|
+
readonly backlogScanned: boolean;
|
|
3703
|
+
readonly refsSeen: number;
|
|
3704
|
+
readonly held: number;
|
|
3705
|
+
readonly bytesHeld: number;
|
|
3706
|
+
readonly queued: number;
|
|
3707
|
+
readonly fetching: number;
|
|
3708
|
+
readonly pendingFetches: number;
|
|
3709
|
+
readonly waiting: number;
|
|
3710
|
+
readonly notFound: number;
|
|
3711
|
+
readonly failed: number;
|
|
3712
|
+
readonly lastError: string | null;
|
|
3713
|
+
};
|
|
3714
|
+
type WireInspectorProcessor = {
|
|
3715
|
+
readonly processorId: string;
|
|
3716
|
+
readonly factoryId: string;
|
|
3717
|
+
readonly driveId: string;
|
|
3718
|
+
readonly processorIndex: number;
|
|
3719
|
+
readonly lastOrdinal: number;
|
|
3720
|
+
readonly status: string;
|
|
3721
|
+
readonly lastError: string | null;
|
|
3722
|
+
readonly lastErrorTimestampUtcMs: number | null;
|
|
3723
|
+
};
|
|
3724
|
+
type WireStorageHealth = {
|
|
3725
|
+
readonly tracked: boolean;
|
|
3726
|
+
readonly healthy: boolean;
|
|
3727
|
+
readonly everRecreated: boolean;
|
|
3728
|
+
readonly recreateCount: number;
|
|
3729
|
+
};
|
|
3730
|
+
/** Issues ride a JSON scalar; each carries the scope it was found in. */
|
|
3731
|
+
type WireValidationResult = {
|
|
3732
|
+
readonly documentId: string;
|
|
3733
|
+
readonly isConsistent: boolean;
|
|
3734
|
+
readonly keyframeIssues: Record<string, unknown>[];
|
|
3735
|
+
readonly snapshotIssues: Record<string, unknown>[];
|
|
3736
|
+
readonly streamOrderIssues: Record<string, unknown>[];
|
|
3737
|
+
};
|
|
3738
|
+
type WireRemoteCursor = {
|
|
3739
|
+
readonly cursorType: "inbox" | "outbox";
|
|
3740
|
+
readonly cursorOrdinal: number;
|
|
3741
|
+
readonly lastSyncedAtUtcMs: number | null;
|
|
3742
|
+
readonly liveAckOrdinal: number;
|
|
3743
|
+
readonly liveLatestOrdinal: number;
|
|
3744
|
+
};
|
|
3745
|
+
type WireMailboxDepths = {
|
|
3746
|
+
readonly inbox: number;
|
|
3747
|
+
readonly outbox: number;
|
|
3748
|
+
readonly deadLetter: number;
|
|
3749
|
+
};
|
|
3750
|
+
type WireRemoteConnectionHealth = {
|
|
3751
|
+
readonly snapshot: ConnectionStateSnapshot;
|
|
3752
|
+
readonly neverSucceeded: boolean;
|
|
3753
|
+
readonly stalenessMs: number | null;
|
|
3754
|
+
};
|
|
3755
|
+
/** One remote's inspection plus its configuration. */
|
|
3756
|
+
type WireRemoteSyncInspection = {
|
|
3757
|
+
readonly remoteName: string;
|
|
3758
|
+
readonly remoteId: string;
|
|
3759
|
+
readonly inboxCursor: WireRemoteCursor;
|
|
3760
|
+
readonly outboxCursor: WireRemoteCursor;
|
|
3761
|
+
readonly mailboxDepths: WireMailboxDepths;
|
|
3762
|
+
readonly connection: WireRemoteConnectionHealth;
|
|
3763
|
+
readonly meta: WireRemoteMeta;
|
|
3764
|
+
};
|
|
3765
|
+
/** A dead letter without its operations. */
|
|
3766
|
+
type WireDeadLetter = {
|
|
3767
|
+
readonly id: string;
|
|
3768
|
+
readonly jobId: string;
|
|
3769
|
+
readonly documentId: string;
|
|
3770
|
+
readonly branch: string;
|
|
3771
|
+
readonly scopes: string[];
|
|
3772
|
+
readonly errorType: string;
|
|
3773
|
+
readonly errorMessage: string;
|
|
3774
|
+
readonly operationCount: number;
|
|
3775
|
+
};
|
|
3776
|
+
type WireDeadLetterPage = {
|
|
3777
|
+
readonly remoteName: string;
|
|
3778
|
+
readonly results: WireDeadLetter[];
|
|
3779
|
+
readonly nextCursor: string | null;
|
|
3780
|
+
};
|
|
3781
|
+
/** The queue as the inspection surface serves it: no document content. */
|
|
3782
|
+
export declare function toWireQueueState(snapshot: QueueStateSnapshot): WireQueueState;
|
|
3783
|
+
/** A dead letter as the inspection surface serves it: no document content. */
|
|
3784
|
+
export declare function toWireDeadLetter(record: DeadLetterRecord): WireDeadLetter;
|
|
3785
|
+
/** Every wire record's fields, by the GraphQL type that serves it. */
|
|
3786
|
+
export declare const INSPECTION_WIRE_FIELDS: {
|
|
3787
|
+
readonly ReactorInfo: readonly ["storage", "workflows", "syncChannels", "access"];
|
|
3788
|
+
readonly ReactorStorageFacts: readonly ["engine", "persistence", "durable", "selfHeal"];
|
|
3789
|
+
readonly InspectorAccess: readonly ["admin", "sql"];
|
|
3790
|
+
readonly InspectionDocumentModel: readonly ["documentType", "name", "version", "supportedVersions"];
|
|
3791
|
+
readonly InspectionDrive: readonly ["driveId", "name", "branch", "collectionId", "documentType", "nodeCount", "fileCount", "folderCount", "otherNodeCount", "unreadableNodeCount", "icon"];
|
|
3792
|
+
readonly InspectionDrivePage: readonly ["results", "nextCursor"];
|
|
3793
|
+
readonly InspectionDriveIntegrityRef: readonly ["id", "documentType"];
|
|
3794
|
+
readonly InspectionDriveIntegrity: readonly ["driveId", "checkedNodeCount", "totalFileNodeCount", "missingDocuments", "unsupportedTypes"];
|
|
3795
|
+
readonly InspectionAttachmentInfo: readonly ["present", "storeKind", "hasReplicator", "replicatorRunning", "backlogScanned", "refsSeen", "held", "bytesHeld", "queued", "fetching", "pendingFetches", "waiting", "notFound", "failed", "lastError"];
|
|
3796
|
+
readonly InspectionQueueJob: readonly ["id", "kind", "documentId", "scope", "branch", "status", "actionCount", "operationCount", "retryCount"];
|
|
3797
|
+
readonly InspectionQueueState: readonly ["isPaused", "totalPending", "totalExecuting", "pendingJobs", "executingJobs"];
|
|
3798
|
+
readonly InspectionProcessor: readonly ["processorId", "factoryId", "driveId", "processorIndex", "lastOrdinal", "status", "lastError", "lastErrorTimestampUtcMs"];
|
|
3799
|
+
readonly InspectionStorageHealth: readonly ["tracked", "healthy", "everRecreated", "recreateCount"];
|
|
3800
|
+
readonly InspectionValidation: readonly ["documentId", "isConsistent", "keyframeIssues", "snapshotIssues", "streamOrderIssues"];
|
|
3801
|
+
readonly InspectionCursor: readonly ["cursorType", "cursorOrdinal", "lastSyncedAtUtcMs", "liveAckOrdinal", "liveLatestOrdinal"];
|
|
3802
|
+
readonly InspectionMailboxDepths: readonly ["inbox", "outbox", "deadLetter"];
|
|
3803
|
+
readonly InspectionConnectionHealth: readonly ["snapshot", "neverSucceeded", "stalenessMs"];
|
|
3804
|
+
readonly InspectionRemote: readonly ["remoteName", "remoteId", "inboxCursor", "outboxCursor", "mailboxDepths", "connection", "meta"];
|
|
3805
|
+
readonly InspectionDeadLetter: readonly ["id", "jobId", "documentId", "branch", "scopes", "errorType", "errorMessage", "operationCount"];
|
|
3806
|
+
readonly InspectionDeadLetterPage: readonly ["remoteName", "results", "nextCursor"];
|
|
3807
|
+
};
|
|
3808
|
+
/** The root fields the inspection subgraph serves: the read rows only. */
|
|
3809
|
+
export declare const INSPECTION_ROOT_FIELDS: {
|
|
3810
|
+
readonly ReactorInspection: readonly string[];
|
|
3811
|
+
};
|
|
3812
|
+
/** Ordinals pass 2^31, so these are `Float` rather than `Int`. */
|
|
3813
|
+
export declare const INSPECTION_ORDINAL_FIELDS: {
|
|
3814
|
+
readonly InspectionProcessor: readonly ["lastOrdinal"];
|
|
3815
|
+
readonly InspectionCursor: readonly ["cursorOrdinal", "liveAckOrdinal", "liveLatestOrdinal"];
|
|
3816
|
+
};
|
|
3817
|
+
//#endregion
|
|
2916
3818
|
//#region src/storage/kysely/document-purges.d.ts
|
|
2917
3819
|
/** Class key of every purge lock; the stream locks use the single-key space. */
|
|
2918
3820
|
export declare const PURGE_NS = 1347571013;
|
|
@@ -2925,6 +3827,6 @@ export declare function findPurged(db: Kysely<any>, ids: Iterable<string>): Prom
|
|
|
2925
3827
|
/** Every tombstoned id, read in the handle's schema. */
|
|
2926
3828
|
export declare function listPurged(db: Kysely<any>): Promise<string[]>;
|
|
2927
3829
|
//#endregion
|
|
2928
|
-
export { ALWAYS_READABLE_SCOPES, APPEND_CONDITION_FAILED_PREFIX, type AbortMessage, type ActionCandidate, type ActionEvaluationConfig, type ActionEvaluations, type AdmissionDecision, type AdmissionPath, type AppendCondition, AppendConditionFailedError, type AppendConditionStream, type AtomicTxn, type AttachmentHash, type AttachmentRef, type AuthDecisionModel, BareReadGate, BaseReadModel, type BaseReadModelConfig, type BatchExecutionRequest, type BatchExecutionResult, type BatchLoadRequest, type BatchLoadResult, type BuiltDecisionModel, type BuiltInReadModelKind, type CachedSnapshot, type CatchUpConfig, type CatchUpConsumerStatus, type CatchUpStatus, type CatchUpSweptEvent, type CatchUpThread, type ChannelConfig, ChannelError, ChannelErrorSource, type ChannelHealth, type ChannelMeta, ChannelScheme, type CollectionMember, type ConnectionState, type ConnectionStateChangeCallback, type ConnectionStateChangedEvent, type ConnectionStateSnapshot, type ConsistencyCoordinate, type ConsistencyKey, type ConsistencyToken, ConsistencyTracker, DEFAULT_COMMIT_CHUNK_SIZE, DEFAULT_MAX_PURGE_OPERATIONS, DEFAULT_PURGE_DELETE_BATCH, DEFAULT_READ_MODEL_YIELD_DEADLINE_MS, DRIVE_AUTH_ERROR_MESSAGES, type Database, type DbConfig, type DeadLetterAddedEvent, type DecisionContext, type DecisionModel, type DecisionTarget, type DegradedComponent, type DeliveryLookup, type DeliveryMembership, type DeliveryRow, DocumentAlreadyExistsError, type DocumentChangeEvent, DocumentChangeType, type DocumentDecisionModel, type DocumentDeletedInfo, DocumentExistence, type DocumentGraphEdge, type DocumentIndexerDatabase, DocumentModelRegistry, DocumentModelResolver, type DocumentModelSource, type DocumentModelSpec, type DocumentPurgeRow, DocumentPurgeService, type DocumentRelationship, type DocumentRevisions, type DocumentStreamKey, type DocumentViewDatabase, DriveCollectionId, DriveRequestError, DuplicateManifestError, DuplicateModuleError, DuplicateOperationError, type EnqueuePurgeOptions, type Evaluation, EventBusAggregateError, type ExecuteMessage, type ExecutionJobPlan, type ExecutorStartedEvent, type ExecutorStoppedEvent, type FactorySpec, type FileModelSource, type GqlChannelConfig, type HardenedPGliteDialectOptions, type HeartbeatMessage, type HybridProjectionCoordinatorOptions, type HybridProjectionOptions, type ICatchUp, type ICatchUpConsumer, type IChannel, type IChannelFactory, type IConsistencyTracker, type IDeliveryTracking, 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 IPeerAgreement, type IPollTimer, type IProcessor, type IProcessorHostModuleBase, type IProcessorManager, type IProjectionTransport, type IPurgeRefusalRecorder, type IQueue, type IReactor, type IReactorClient, type IReactorProcessorHostModuleBase, type IReactorSubscriptionManager, type IReadGate, type IReadModel, type IReadModelCoordinator, type IRelationalDb, type ISettledWatermark, type IStreamStateReader, type ISubscriptionErrorHandler, type ISyncAdmin, type ISyncCursorStorage, type ISyncHoldStorage, type ISyncManager, type ISyncPurgeRefusalStorage, type ISyncReceivedMarkerStorage, type ISyncRemoteStorage, type ISyncStatusTracker, type IWriteCache, SimpleJobExecutor as InMemoryJobExecutor, type InProcessReactorClientModule, type InProcessReactorModule, type InProcessSyncModule, type InitMessage, type InsertableDocumentSnapshot, InvalidModuleError, type Job, type JobAvailableEvent, JobAwaiter, type JobCompletedEvent, type JobExecutorConfig, JobExecutorEventTypes, type JobExecutorFactory, type JobFailedEvent, type JobInfo, type JobKind, type JobPendingEvent, type JobReadReadyEvent, type JobResult, type JobResultSummary, type JobRunningEvent, type JobStartedEvent, JobStatus, type JobWriteReadyEvent, type JobWriteReadyPayload, type JwtHandler, type KeyframeSnapshot, type KeyframeValidationIssue, KyselyDocumentPurger, KyselyKeyframeStore, KyselyOperationStore, KyselyWriteCache, type LoadJobPlan, type LoadModelMessage, type LocalPeer, type LogMessage, Mailbox, type MetricsMessage, type ModelLoadFailedMessage, type ModelLoadedEvent, type ModelLoadedMessage, type ModelManifestEntry, ModelNotWorkerImportableError, ModelReadGate, ModuleNotFoundError, type ModuleRef, NullDocumentModelResolver, type OperationBatch, type OperationContext, type OperationFilter, type OperationIndexEntry, type OperationTable, type OperationWithContext, OptimisticLockError, type OutOfOrderPair, type PGliteSession, PURGE_DOCUMENT, type PackageModelSource, type PagedResults, type PagingOptions, type ParentMessage, type ParsedDriveUrl, type ParsedPaging, type ParsedSnapshot, type PeerAgreementBasis, type PendingDelivery, PollBehavior, type PollDelegate, type PolledMarkerRefusal, PollingChannelError, type PoolInstrumentation, type PoolStats, type ProbeReading, type ProcessorApp, type ProcessorFactory, type ProcessorFactoryBuilder, type ProcessorFilter, type ProcessorRecord, type ProcessorStatus, type Projection, type ProjectionShardBuilderConfig, type ProjectionShardHooks, type ProjectionShardManagerConfig, type ProjectionWorkerFactory, PropagationMode, type ProtocolSelection, type PurgeDocumentAction, type PurgeDocumentActionInput, type PurgeFence, type PurgeJobOptions, type PurgeLockMode, type PurgeLookup, type PurgeMarkerContext, type PurgeMarkerOperation, type PurgeRefusalRecord, type PurgeRemovedRows, type PurgeStream, QueueEventTypes, RECOVERABLE_GRAPHQL_ERROR_CODES, ReactorClient, type ReactorClientModule, ReactorEventTypes, type ReactorFeatureFlags, type ReactorFeatures, type ReactorHostModuleBaseOptions, type JobFailedEvent$1 as ReactorJobFailedEvent, type ReactorModule, type ReactorReadModels, type ReadGateOptions, type ReadModelBatchCompletedEvent, type ReadModelCoordinatorFactory, type ReadModelCoordinatorFactoryDeps, type ReadModelFactory, type ReadModelFactoryDeps, type ReadModelIndexedEvent, type ReadModelIndexingConfig, type ReadModelIndexingStage, type ReadModelRegistrationStage, type ReadModelStage, type ReadyMessage, type RebuildResult, type ReceivedMarkerRecord, type RegisteredDecisionModel, RelationalDbProcessor, RelationshipChangeType, type Remote, type RemoteCursor, type RemoteFilter, type RemoteMeta, type RemoteOptions, type RemotePeer, type RemoteRecord, type RemoteStatus, type ResultMessage, RetryAccounting, RevisionMismatchError, SIGNATURE_REFUSAL_CODES, type SanitizedArg, type SearchFilter, SeededStateReader, type ShutdownMessage, type ShutdownStatus, type SignatureRefusalCode, type SignatureRefusedEvent, type SignatureScheme, type SignatureTrustPolicy, type SignatureVerificationHandler, type SignatureVerificationMode, type SignerConfig, type SnapshotFunctions, type SnapshotValidationIssue, type Database$1 as StorageDatabase, type StreamOrderIssue, type StreamQuery, type SubjectScopePredicate, type SubmittedActionResult, type SubscriptionErrorContext, type SweepBlockedAt, type SweepResult, type SyncEnvelope, type SyncEnvelopeType, SyncEventTypes, type SyncFailedEvent, type SyncHeldEvent, type SyncHold, type SyncHoldRecord, type SyncModule, SyncOperation, SyncOperationAggregateError, type SyncOperationErrorType, SyncOperationStatus, type SyncPendingEvent, type SyncPurgeRefusedEvent, type SyncReleasedEvent, SyncRepairRefusedError, SyncStatus, type SyncStatusChangeCallback, SyncStatusTracker, type SyncSucceededEvent, type TrackedProcessor, type Unsubscribe, type UnsupportedStoredDocuments, type ValidationResult, type VerificationTarget, type ViewFilter, type WatermarkProbe, type WatermarkStatus, type ErrorInfo as WorkerErrorInfo, type WorkerMessage, type WorkerPoolConfig, type WorkerPoolOptions, type WriteCacheConfig, appliedDelete, createPeerAgreement, createRelationalDb, decideAtHead, defaultCatchUpConfig, defaultReadModelIndexingConfig, documentActions, documentDecisionModel, instrumentPgPool, isDriveAuthError, isPurgeMarker, isRecoverableGraphQLError, loadDocumentModelSpec, makeConsistencyKey, readDecisionModel, selectDecisionModel, supportsLiveReadModelRegistration, unchunkedReadModelIndexingConfig };
|
|
3830
|
+
export { ALWAYS_READABLE_SCOPES, APPEND_CONDITION_FAILED_PREFIX, type AbortMessage, type ActionCandidate, type ActionEvaluationConfig, type ActionEvaluations, type AdmissionDecision, type AdmissionPath, type AppendCondition, AppendConditionFailedError, type AppendConditionStream, type AtomicTxn, type AttachmentHash, type AttachmentRef, type AuthDecisionModel, BareReadGate, BaseReadModel, type BaseReadModelConfig, type BatchExecutionRequest, type BatchExecutionResult, type BatchLoadRequest, type BatchLoadResult, type BatchSubmitter, type BuiltDecisionModel, type BuiltInReadModelKind, type CachedSnapshot, type CatchUpConfig, type CatchUpConsumerStatus, type CatchUpStatus, type CatchUpSweptEvent, type CatchUpThread, type ChannelConfig, ChannelError, ChannelErrorSource, type ChannelHealth, type ChannelMeta, ChannelScheme, type CollectionMember, type ConnectionState, type ConnectionStateChangeCallback, type ConnectionStateChangedEvent, type ConnectionStateSnapshot, type ConsistencyCoordinate, type ConsistencyKey, type ConsistencyToken, ConsistencyTracker, type CreateDocumentOptions, DEFAULT_COMMIT_CHUNK_SIZE, DEFAULT_LONG_STATEMENT_TIMEOUT_MS, DEFAULT_MAX_PURGE_OPERATIONS, DEFAULT_PURGE_DELETE_BATCH, DEFAULT_READ_MODEL_YIELD_DEADLINE_MS, DEFAULT_RECOVERY_TIMEOUT_MS, DEFAULT_STATEMENT_TIMEOUT_MS, DRIVE_AUTH_ERROR_MESSAGES, type Database, type DbConfig, type DeadLetterAddedEvent, type DeadLetterPage, type DecisionContext, type DecisionModel, type DecisionTarget, type DegradedComponent, type DeliveryLookup, type DeliveryMembership, type DeliveryRow, DocumentAlreadyExistsError, type DocumentChangeEvent, DocumentChangeType, type DocumentDecisionModel, type DocumentDeletedInfo, DocumentExistence, type DocumentGraphEdge, type DocumentIndexerDatabase, DocumentModelRegistry, DocumentModelResolver, type DocumentModelSource, type DocumentModelSpec, type DocumentPurgeRow, DocumentPurgeService, type DocumentRelationship, type DocumentRevisions, type DocumentStreamKey, type DocumentViewDatabase, type DriveClientDeps, DriveCollectionId, DriveRequestError, DuplicateManifestError, DuplicateModuleError, DuplicateOperationError, type EnqueuePurgeOptions, type Evaluation, EventBusAggregateError, type ExecuteMessage, type ExecutionJobPlan, type ExecutorStartedEvent, type ExecutorStoppedEvent, type FactorySpec, type FileModelSource, type GqlChannelConfig, type GroupCommitPGliteInstance, type GroupCommitPGliteOptions, HardenedPGliteDialect, type HardenedPGliteDialectOptions, type HeartbeatMessage, type HybridProjectionCoordinatorOptions, type HybridProjectionOptions, type ICatchUp, type ICatchUpConsumer, type IChannel, type IChannelFactory, type IConsistencyTracker, type IDeliveryTracking, type IDocumentGraph, type IDocumentIndexer, type IDocumentIntegrityService, type IDocumentModelLoader, type IDocumentModelRegistry, type IDocumentModelResolver, type IDocumentView, type IDriveClient, type IEventBus, type IGroupCommitStorage, type IInspectableAttachmentStore, type IInspectableQueue, type IInspector, type IInspectorAdmin, type IInspectorStorageHealthProvider, type IJobAwaiter, type IJobExecutor, type IJobExecutorManager, type IJobTracker, type IKeyframeStore, type ILiveReadModelCoordinator, type IMailbox, type IOperationIndex, type IOperationStore, type IPeerAgreement, type IPollTimer, type IProcessor, type IProcessorHostModuleBase, type IProcessorManager, type IProjectionTransport, type IPurgeRefusalRecorder, type IQueue, type IReactor, type IReactorClient, type IReactorDbQuery, type IReactorFactsSink, type IReactorProcessorHostModuleBase, type IReactorSubscriptionManager, type IReadGate, type IReadModel, type IReadModelCoordinator, type IRelationalDb, type ISettledWatermark, type IStorageFlusher, type IStorageHealthProvider, type IStreamStateReader, type ISubscriptionErrorHandler, type ISyncAdmin, type ISyncCursorStorage, type ISyncHoldStorage, type ISyncInspector, type ISyncManager, type ISyncPurgeRefusalStorage, type ISyncReceivedMarkerStorage, type ISyncRemoteStorage, type ISyncStatusTracker, type IWriteCache, SimpleJobExecutor as InMemoryJobExecutor, type InProcessReactorClientModule, type InProcessReactorModule, type InProcessSyncModule, type InitMessage, type InsertableDocumentSnapshot, type InspectorAccess, type InspectorAttachmentInfo, type InspectorDocumentModelInfo, type InspectorDocumentReader, type InspectorDriveInfo, type InspectorDriveIntegrity, type InspectorDriveIntegrityRef, type InspectorDrivePage, type InspectorOpKey, type InspectorOpSpec, type InspectorProcessorInfo, type InspectorReadOpKey, type InspectorStorageHealth, type InspectorTier, InvalidDeadLetterCursorError, InvalidModuleError, type Job, type JobAvailableEvent, JobAwaiter, type JobCompletedEvent, type JobExecutorConfig, JobExecutorEventTypes, type JobExecutorFactory, type JobFailedEvent, type JobInfo, type JobKind, type JobPendingEvent, type JobReadReadyEvent, type JobResult, type JobResultSummary, type JobRunningEvent, type JobStartedEvent, JobStatus, type JobWriteReadyEvent, type JobWriteReadyPayload, type JwtHandler, type KeyframeSnapshot, type KeyframeValidationIssue, KyselyDocumentPurger, KyselyKeyframeStore, KyselyOperationStore, KyselyWriteCache, type LoadJobPlan, type LoadModelMessage, type LocalAckMessage, type LocalChannelPort, type LocalChannelPortRegistryOptions, type LocalChannelTransportProvider, type LocalHelloMessage, type LocalPeer, type LocalPeerSyncManager, type LocalPushMessage, type LocalRemoteSpec, type LocalRemoveSpec, type LocalResendMessage, type LocalWireKind, type LocalWireMessage, type LogMessage, Mailbox, type MailboxDepths, type MessagePortLike, type MetricsMessage, type ModelLoadFailedMessage, type ModelLoadedEvent, type ModelLoadedMessage, type ModelManifestEntry, ModelNotWorkerImportableError, ModelReadGate, ModuleNotFoundError, type ModuleRef, NullDocumentModelResolver, type OperationBatch, type OperationContext, type OperationFilter, type OperationIndexEntry, type OperationTable, type OperationWithContext, OptimisticLockError, type OutOfOrderPair, PGliteAbortedTransactionError, PGliteAcquireTimeoutError, PGliteFlushSyncTimeoutError, type PGliteSession, PGliteSessionError, PGliteSessionPoisonedError, PGliteStatementTimeoutError, PURGE_DOCUMENT, type PackageModelSource, type PagedResults, type PagingOptions, type ParentMessage, type ParsedDriveUrl, type ParsedPaging, type ParsedSnapshot, type PeerAgreementBasis, type PendingDelivery, PollBehavior, type PollDelegate, type PolledMarkerRefusal, PollingChannelError, type PoolInstrumentation, type PoolStats, type ProbeReading, type ProcessorApp, type ProcessorFactory, type ProcessorFactoryBuilder, type ProcessorFilter, type ProcessorRecord, type ProcessorStatus, type Projection, type ProjectionShardBuilderConfig, type ProjectionShardHooks, type ProjectionShardManagerConfig, type ProjectionWorkerFactory, PropagationMode, type ProtocolSelection, type PurgeDocumentAction, type PurgeDocumentActionInput, type PurgeFence, type PurgeJobOptions, type PurgeLockMode, type PurgeLookup, type PurgeMarkerContext, type PurgeMarkerOperation, type PurgeRefusalRecord, type PurgeRemovedRows, type PurgeStream, QueueEventTypes, type QueueStateSnapshot, RECOVERABLE_GRAPHQL_ERROR_CODES, ReactorClient, type ReactorClientModule, ReactorEventTypes, type ReactorFeatureFlags, type ReactorFeatures, type ReactorHostModuleBaseOptions, type ReactorInfo, type ReactorInspectorComponents, type ReactorInspectorFacts, type ReactorInspectorOptions, type JobFailedEvent$1 as ReactorJobFailedEvent, type ReactorModule, type ReactorReadModels, type ReactorStorageFacts, type ReadGateOptions, type ReadModelBatchCompletedEvent, type ReadModelCoordinatorFactory, type ReadModelCoordinatorFactoryDeps, type ReadModelFactory, type ReadModelFactoryDeps, type ReadModelIndexedEvent, type ReadModelIndexingConfig, type ReadModelIndexingStage, type ReadModelRegistrationStage, type ReadModelStage, type ReadyMessage, type RebuildResult, type ReceivedMarkerRecord, type RegisteredDecisionModel, RelationalDbProcessor, RelationshipChangeType, type Remote, type RemoteConnectionHealth, type RemoteCursor, type RemoteCursorInfo, type RemoteFilter, type RemoteMeta, type RemoteOptions, type RemotePeer, RemotePersistence, type RemoteRecord, type RemoteStatus, type RemoteSyncInspection, type ResultMessage, RetryAccounting, RevisionMismatchError, SIGNATURE_REFUSAL_CODES, type SanitizedArg, type SearchFilter, SeededStateReader, type ShutdownMessage, type ShutdownStatus, type SignatureRefusalCode, type SignatureRefusedEvent, type SignatureScheme, type SignatureTrustPolicy, type SignatureVerificationHandler, type SignatureVerificationMode, type SignerConfig, type SnapshotFunctions, type SnapshotValidationIssue, type Database$1 as StorageDatabase, type StorageHealth, type StoragePersistence, type StreamOrderIssue, type StreamQuery, type SubjectScopePredicate, type SubmittedActionResult, type SubscriptionErrorContext, type SweepBlockedAt, type SweepResult, type SyncEnvelope, type SyncEnvelopeType, SyncEventTypes, type SyncFailedEvent, type SyncHeldEvent, type SyncHold, type SyncHoldRecord, type SyncInspectionOpKey, type SyncInspectionReadOpKey, type SyncModule, SyncOperation, SyncOperationAggregateError, type SyncOperationErrorType, SyncOperationStatus, type SyncPendingEvent, type SyncPurgeRefusedEvent, type SyncReleasedEvent, SyncRepairRefusedError, SyncStatus, type SyncStatusChangeCallback, SyncStatusTracker, type SyncSucceededEvent, type TrackedProcessor, type Unsubscribe, type UnsupportedStoredDocuments, type UpgradeDocumentDeps, type UpgradeDocumentOptions, type ValidationResult, type VerificationTarget, type ViewFilter, type WatermarkProbe, type WatermarkStatus, type WireChannelConfig, type WireDeadLetter, type WireDeadLetterPage, type WireInspectorAccess, type WireInspectorAttachmentInfo, type WireInspectorDocumentModel, type WireInspectorDrive, type WireInspectorDriveIntegrity, type WireInspectorDriveIntegrityRef, type WireInspectorDrivePage, type WireInspectorProcessor, type WireMailboxDepths, type WireQueueJob, type WireQueueState, type WireReactorInfo, type WireReactorStorageFacts, type WireRemoteConnectionHealth, type WireRemoteCursor, type WireRemoteMeta, type WireRemoteSyncInspection, type WireStorageHealth, type WireValidationResult, type ErrorInfo as WorkerErrorInfo, type WorkerMessage, type WorkerPoolConfig, type WorkerPoolOptions, type WriteCacheConfig, appliedDelete, createPeerAgreement, createRelationalDb, decideAtHead, defaultCatchUpConfig, defaultReadModelIndexingConfig, deriveConnectionHealth, documentActions, documentDecisionModel, firstOutOfOrderPair, instrumentPgPool, isDriveAuthError, isLongRunningStatement, isPurgeMarker, isRecoverableGraphQLError, loadDocumentModelSpec, makeConsistencyKey, queryThroughDialect, readDecisionModel, selectDecisionModel, supportsLiveReadModelRegistration, unchunkedReadModelIndexingConfig };
|
|
2929
3831
|
export {};
|
|
2930
3832
|
//# sourceMappingURL=index.d.ts.map
|