@powerhousedao/reactor 6.2.0-dev.4 → 6.2.0-dev.41
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{build-worker-executor-DDVXB921.js → build-worker-executor-BL_Y8oCi.js} +3 -3
- package/dist/{build-worker-executor-DDVXB921.js.map → build-worker-executor-BL_Y8oCi.js.map} +1 -1
- package/dist/{document-indexer-B2iLRB0o.js → document-indexer-B6iippzG.js} +7 -2
- package/dist/document-indexer-B6iippzG.js.map +1 -0
- package/dist/{drive-container-types-BNpMlgT_.js → drive-container-types-BuFNr0j0.js} +129 -105
- package/dist/drive-container-types-BuFNr0j0.js.map +1 -0
- package/dist/entry.js +2 -2
- package/dist/index.d.ts +139 -45
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +158 -55
- package/dist/index.js.map +1 -1
- package/dist/projection-entry.js +4 -4
- package/dist/{projection-shard-manager-_c7orNo5.js → projection-shard-manager-BnQKFqQd.js} +2 -2
- package/dist/{projection-shard-manager-_c7orNo5.js.map → projection-shard-manager-BnQKFqQd.js.map} +1 -1
- package/dist/{types-CxSpmNGK.js → types-DMKLa0Ok.js} +3 -2
- package/dist/types-DMKLa0Ok.js.map +1 -0
- package/dist/{worker-SUoDhurA.js → worker-Dzrw1YMV.js} +2 -2
- package/dist/{worker-SUoDhurA.js.map → worker-Dzrw1YMV.js.map} +1 -1
- package/package.json +19 -7
- package/dist/document-indexer-B2iLRB0o.js.map +0 -1
- package/dist/drive-container-types-BNpMlgT_.js.map +0 -1
- package/dist/types-CxSpmNGK.js.map +0 -1
package/dist/entry.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { o as instrumentPgPool } from "./drive-container-types-
|
|
1
|
+
import { o as instrumentPgPool } from "./drive-container-types-BuFNr0j0.js";
|
|
2
2
|
import { n as errorToInfo, t as createForwardingLogger } from "./forwarding-logger-BBkMSxuJ.js";
|
|
3
|
-
import { n as defaultLoadFactory, t as buildWorkerExecutor } from "./build-worker-executor-
|
|
3
|
+
import { n as defaultLoadFactory, t as buildWorkerExecutor } from "./build-worker-executor-BL_Y8oCi.js";
|
|
4
4
|
import { ConsoleLogger } from "document-model";
|
|
5
5
|
import { isMainThread, parentPort } from "node:worker_threads";
|
|
6
6
|
//#region src/executor/worker/run-worker.ts
|
package/dist/index.d.ts
CHANGED
|
@@ -186,7 +186,8 @@ type JobMeta = BatchMeta & Record<string, unknown>;
|
|
|
186
186
|
* Describes the current state of a job.
|
|
187
187
|
*/
|
|
188
188
|
type JobInfo = {
|
|
189
|
-
id: string;
|
|
189
|
+
id: string; /** The document this job operates on; empty string when the job is unknown. */
|
|
190
|
+
documentId: string;
|
|
190
191
|
status: JobStatus;
|
|
191
192
|
createdAtUtcIso: string;
|
|
192
193
|
completedAtUtcIso?: string;
|
|
@@ -413,6 +414,9 @@ type ConnectionStateSnapshot = {
|
|
|
413
414
|
pushBlocked: boolean;
|
|
414
415
|
pushFailureCount: number;
|
|
415
416
|
receivingPages: boolean;
|
|
417
|
+
/** Latest error was the remote rejecting the caller as unauthenticated
|
|
418
|
+
* (401/403 or Forbidden GraphQL error). Only meaningful while state="error". */
|
|
419
|
+
requiresAuth: boolean;
|
|
416
420
|
};
|
|
417
421
|
type ConnectionStateChangedEvent = {
|
|
418
422
|
remoteName: string;
|
|
@@ -432,7 +436,7 @@ type ChannelConfig = {
|
|
|
432
436
|
type RemoteRecord = {
|
|
433
437
|
id: string;
|
|
434
438
|
name: string;
|
|
435
|
-
collectionId:
|
|
439
|
+
collectionId: DriveCollectionId;
|
|
436
440
|
channelConfig: ChannelConfig;
|
|
437
441
|
filter: RemoteFilter;
|
|
438
442
|
options: RemoteOptions;
|
|
@@ -1118,7 +1122,32 @@ interface IOperationIndex {
|
|
|
1118
1122
|
*/
|
|
1119
1123
|
getCollectionsForDocuments(documentIds: string[]): Promise<Record<string, string[]>>;
|
|
1120
1124
|
}
|
|
1121
|
-
|
|
1125
|
+
/**
|
|
1126
|
+
* Identifies the collection a remote synchronizes. Collections are drive-level
|
|
1127
|
+
* abstractions (document-drive and reactor-drive), so a collection id is the
|
|
1128
|
+
* drive document id plus the branch it scopes to rather than an opaque string.
|
|
1129
|
+
*
|
|
1130
|
+
* The canonical string form (`drive.${branch}.${driveId}`) is produced only by
|
|
1131
|
+
* `key` and parsed only by `fromKey`; that string is the wire and storage
|
|
1132
|
+
* representation and is byte-for-byte identical to the legacy
|
|
1133
|
+
* `driveCollectionId(branch, driveId)` output, so existing `document_collections`
|
|
1134
|
+
* rows and persisted remotes remain valid without migration.
|
|
1135
|
+
*/
|
|
1136
|
+
declare class DriveCollectionId {
|
|
1137
|
+
readonly driveId: string;
|
|
1138
|
+
readonly branch: string;
|
|
1139
|
+
private constructor();
|
|
1140
|
+
static forDrive(driveId: string, branch?: string): DriveCollectionId;
|
|
1141
|
+
/**
|
|
1142
|
+
* The single deserializer for the wire/storage form. `branch` may contain
|
|
1143
|
+
* dots, while `driveId` is a dot-free document id, so the drive id is the
|
|
1144
|
+
* final dot-delimited segment.
|
|
1145
|
+
*/
|
|
1146
|
+
static fromKey(key: string): DriveCollectionId;
|
|
1147
|
+
get key(): string;
|
|
1148
|
+
toString(): string;
|
|
1149
|
+
equals(other: DriveCollectionId): boolean;
|
|
1150
|
+
}
|
|
1122
1151
|
//#endregion
|
|
1123
1152
|
//#region src/cache/write/interfaces.d.ts
|
|
1124
1153
|
/**
|
|
@@ -1243,6 +1272,7 @@ declare const ReactorEventTypes: {
|
|
|
1243
1272
|
readonly JOB_FAILED: 10005;
|
|
1244
1273
|
readonly READMODEL_BATCH_COMPLETED: 10006;
|
|
1245
1274
|
readonly READMODEL_INDEXED: 10007;
|
|
1275
|
+
readonly MODEL_LOADED: 10008;
|
|
1246
1276
|
};
|
|
1247
1277
|
/**
|
|
1248
1278
|
* Stage within ReadModelCoordinator.runChain. Used as a dimension on
|
|
@@ -1254,6 +1284,12 @@ type ReadModelStage = "pre_ready" | "emit" | "post_ready";
|
|
|
1254
1284
|
* involve a read model so it is excluded from this discriminant.
|
|
1255
1285
|
*/
|
|
1256
1286
|
type ReadModelIndexingStage = "pre_ready" | "post_ready";
|
|
1287
|
+
/**
|
|
1288
|
+
* Emitted after the resolver loads a model on demand, so peers load it too.
|
|
1289
|
+
*/
|
|
1290
|
+
type ModelLoadedEvent = {
|
|
1291
|
+
documentType: string;
|
|
1292
|
+
};
|
|
1257
1293
|
/**
|
|
1258
1294
|
* Event emitted when a job is registered and waiting to be executed.
|
|
1259
1295
|
*/
|
|
@@ -1597,6 +1633,17 @@ interface IReactorClient {
|
|
|
1597
1633
|
* @returns The up-to-date PHDocument with scopes and list of child document ids
|
|
1598
1634
|
*/
|
|
1599
1635
|
get<TDocument extends PHDocument>(identifier: string, view?: ViewFilter, signal?: AbortSignal): Promise<TDocument>;
|
|
1636
|
+
/**
|
|
1637
|
+
* Resolves an identifier (either an id or a slug) to the canonical document
|
|
1638
|
+
* id, using the same lookup as the read/operation data paths. Resolves
|
|
1639
|
+
* against the "main" branch. Throws if the identifier cannot be resolved or
|
|
1640
|
+
* is ambiguous.
|
|
1641
|
+
*
|
|
1642
|
+
* @param identifier - Required, this is the document id or slug
|
|
1643
|
+
* @param signal - Optional abort signal to cancel the request
|
|
1644
|
+
* @returns The canonical document id
|
|
1645
|
+
*/
|
|
1646
|
+
resolveIdOrSlug(identifier: string, signal?: AbortSignal): Promise<string>;
|
|
1600
1647
|
/**
|
|
1601
1648
|
* Retrieves operations for a document.
|
|
1602
1649
|
*
|
|
@@ -1849,6 +1896,12 @@ declare class ReactorClient implements IReactorClient {
|
|
|
1849
1896
|
* Retrieves a specific PHDocument
|
|
1850
1897
|
*/
|
|
1851
1898
|
get<TDocument extends PHDocument>(identifier: string, view?: ViewFilter, signal?: AbortSignal): Promise<TDocument>;
|
|
1899
|
+
/**
|
|
1900
|
+
* Resolves an identifier (id or slug) to the canonical document id, using the
|
|
1901
|
+
* same lookup as the data path. Resolves against the "main" branch. Throws if
|
|
1902
|
+
* the identifier cannot be resolved or is ambiguous.
|
|
1903
|
+
*/
|
|
1904
|
+
resolveIdOrSlug(identifier: string, signal?: AbortSignal): Promise<string>;
|
|
1852
1905
|
/**
|
|
1853
1906
|
* Retrieves operations for a document
|
|
1854
1907
|
*/
|
|
@@ -3047,6 +3100,15 @@ type ForwardingPoolInstrumentation = PoolInstrumentation & {
|
|
|
3047
3100
|
};
|
|
3048
3101
|
//#endregion
|
|
3049
3102
|
//#region src/sync/errors.d.ts
|
|
3103
|
+
/** Auth-rejection message fragments the switchboard emits. Shared with
|
|
3104
|
+
* reactor-api so server throws and this client check can't drift. */
|
|
3105
|
+
declare const DRIVE_AUTH_ERROR_MESSAGES: {
|
|
3106
|
+
readonly forbidden: "Forbidden: insufficient permissions";
|
|
3107
|
+
readonly authenticationRequired: "Forbidden: authentication required";
|
|
3108
|
+
};
|
|
3109
|
+
/** True when the remote rejected the caller as unauthenticated/unauthorized:
|
|
3110
|
+
* an HTTP 401/403, or a Forbidden/Unauthorized GraphQL error. */
|
|
3111
|
+
declare function isDriveAuthError(error: unknown): boolean;
|
|
3050
3112
|
declare class PollingChannelError extends Error {
|
|
3051
3113
|
constructor(message: string);
|
|
3052
3114
|
}
|
|
@@ -3246,7 +3308,7 @@ interface IChannelFactory {
|
|
|
3246
3308
|
* @param options - Remote-level options (e.g. pollBehavior). May be omitted; implementations should default sensibly.
|
|
3247
3309
|
* @returns A new channel instance
|
|
3248
3310
|
*/
|
|
3249
|
-
instance(remoteId: string, remoteName: string, config: ChannelConfig, cursorStorage: ISyncCursorStorage, collectionId:
|
|
3311
|
+
instance(remoteId: string, remoteName: string, config: ChannelConfig, cursorStorage: ISyncCursorStorage, collectionId: DriveCollectionId, filter: RemoteFilter, operationIndex: IOperationIndex, options?: RemoteOptions): IChannel;
|
|
3250
3312
|
}
|
|
3251
3313
|
/**
|
|
3252
3314
|
* Represents a configured remote with an active channel.
|
|
@@ -3254,32 +3316,16 @@ interface IChannelFactory {
|
|
|
3254
3316
|
* A remote defines what to synchronize (collectionId, filter) and how to synchronize it (channel).
|
|
3255
3317
|
* The remote name is used as a unique identifier across the system.
|
|
3256
3318
|
*/
|
|
3257
|
-
type
|
|
3258
|
-
/**
|
|
3259
|
-
* Unique identifier for this remote.
|
|
3260
|
-
*/
|
|
3319
|
+
type RemoteMeta = {
|
|
3261
3320
|
id: string;
|
|
3262
|
-
/**
|
|
3263
|
-
* Unique name for this remote.
|
|
3264
|
-
*/
|
|
3265
3321
|
name: string;
|
|
3266
|
-
|
|
3267
|
-
|
|
3268
|
-
* Typically created via driveCollectionId(branch, documentId) for drive-level sync.
|
|
3269
|
-
*/
|
|
3270
|
-
collectionId: string;
|
|
3271
|
-
/**
|
|
3272
|
-
* Filter to apply to operations.
|
|
3273
|
-
* Can filter by documentId, scope, and branch.
|
|
3274
|
-
*/
|
|
3322
|
+
collectionId: DriveCollectionId;
|
|
3323
|
+
channelConfig: ChannelConfig;
|
|
3275
3324
|
filter: RemoteFilter;
|
|
3276
|
-
/**
|
|
3277
|
-
* Additional configuration options for the remote.
|
|
3278
|
-
*/
|
|
3279
3325
|
options: RemoteOptions;
|
|
3280
|
-
|
|
3281
|
-
|
|
3282
|
-
|
|
3326
|
+
};
|
|
3327
|
+
type Remote = {
|
|
3328
|
+
meta: RemoteMeta;
|
|
3283
3329
|
channel: IChannel;
|
|
3284
3330
|
};
|
|
3285
3331
|
/**
|
|
@@ -3335,7 +3381,7 @@ interface ISyncManager {
|
|
|
3335
3381
|
* @returns Promise that resolves with the created remote
|
|
3336
3382
|
* @throws Error if a remote with this name already exists
|
|
3337
3383
|
*/
|
|
3338
|
-
add(name: string, collectionId:
|
|
3384
|
+
add(name: string, collectionId: DriveCollectionId, channelConfig: ChannelConfig, filter?: RemoteFilter, options?: RemoteOptions, id?: string): Promise<Remote>;
|
|
3339
3385
|
/**
|
|
3340
3386
|
* Triggers a one-shot pull for the named remote. Useful for Manual poll-behavior
|
|
3341
3387
|
* remotes, where the channel is registered but does not poll on a schedule.
|
|
@@ -3636,23 +3682,38 @@ type ReactorFeatures = {
|
|
|
3636
3682
|
*/
|
|
3637
3683
|
type Database = Database$1 & DocumentViewDatabase & DocumentIndexerDatabase;
|
|
3638
3684
|
/**
|
|
3639
|
-
*
|
|
3685
|
+
* Base sync-manager contract resolvable in every environment (in-process or
|
|
3686
|
+
* proxied over a worker boundary): just the sync manager.
|
|
3640
3687
|
*/
|
|
3641
3688
|
interface SyncModule {
|
|
3689
|
+
syncManager: ISyncManager;
|
|
3690
|
+
}
|
|
3691
|
+
/**
|
|
3692
|
+
* Sync module composed in-process, with the full set of sync dependencies.
|
|
3693
|
+
*/
|
|
3694
|
+
interface InProcessSyncModule extends SyncModule {
|
|
3642
3695
|
remoteStorage: ISyncRemoteStorage;
|
|
3643
3696
|
cursorStorage: ISyncCursorStorage;
|
|
3644
3697
|
deadLetterStorage: ISyncDeadLetterStorage;
|
|
3645
3698
|
channelFactory: IChannelFactory;
|
|
3646
|
-
syncManager: ISyncManager;
|
|
3647
3699
|
}
|
|
3648
3700
|
/**
|
|
3649
|
-
*
|
|
3650
|
-
*
|
|
3651
|
-
*
|
|
3701
|
+
* Base reactor module contract — the dependencies a client resolves regardless
|
|
3702
|
+
* of where the reactor graph lives. In-process hosts compose
|
|
3703
|
+
* {@link InProcessReactorModule}; a worker-backed tab resolves only this base
|
|
3704
|
+
* (the full graph lives in the worker).
|
|
3652
3705
|
*/
|
|
3653
3706
|
interface ReactorModule {
|
|
3654
|
-
eventBus: IEventBus;
|
|
3655
3707
|
documentModelRegistry: IDocumentModelRegistry;
|
|
3708
|
+
syncModule: SyncModule | undefined;
|
|
3709
|
+
eventBus: IEventBus;
|
|
3710
|
+
}
|
|
3711
|
+
/**
|
|
3712
|
+
* Reactor module composed in-process: the full dependency graph. Provides
|
|
3713
|
+
* direct access to internal components for advanced use cases, testing, or
|
|
3714
|
+
* integration scenarios.
|
|
3715
|
+
*/
|
|
3716
|
+
interface InProcessReactorModule extends ReactorModule {
|
|
3656
3717
|
queue: IQueue;
|
|
3657
3718
|
jobTracker: IJobTracker;
|
|
3658
3719
|
executorManager: IJobExecutorManager;
|
|
@@ -3669,8 +3730,8 @@ interface ReactorModule {
|
|
|
3669
3730
|
subscriptionManager: IReactorSubscriptionManager;
|
|
3670
3731
|
processorManager: IProcessorManager$1;
|
|
3671
3732
|
processorManagerConsistencyTracker: IConsistencyTracker;
|
|
3672
|
-
syncModule: SyncModule | undefined;
|
|
3673
3733
|
reactor: IReactor;
|
|
3734
|
+
syncModule: InProcessSyncModule | undefined;
|
|
3674
3735
|
/**
|
|
3675
3736
|
* Instrumented pg.Pool handles registered with the builder, either by
|
|
3676
3737
|
* createPostgresDatabase or by withInstrumentedPool. Empty when no pg
|
|
@@ -3680,11 +3741,18 @@ interface ReactorModule {
|
|
|
3680
3741
|
pools: PoolInstrumentation[];
|
|
3681
3742
|
}
|
|
3682
3743
|
/**
|
|
3683
|
-
*
|
|
3684
|
-
*
|
|
3685
|
-
* testing, or integration scenarios.
|
|
3744
|
+
* Base reactor client contract — the client plus its reactor module. Satisfied
|
|
3745
|
+
* by every host; in-process hosts extend it with {@link InProcessReactorClientModule}.
|
|
3686
3746
|
*/
|
|
3687
3747
|
interface ReactorClientModule {
|
|
3748
|
+
client: IReactorClient;
|
|
3749
|
+
reactorModule: ReactorModule | undefined;
|
|
3750
|
+
}
|
|
3751
|
+
/**
|
|
3752
|
+
* Reactor client composed in-process: the concrete client plus direct refs to
|
|
3753
|
+
* the in-process graph internals.
|
|
3754
|
+
*/
|
|
3755
|
+
interface InProcessReactorClientModule extends ReactorClientModule {
|
|
3688
3756
|
client: ReactorClient;
|
|
3689
3757
|
reactor: IReactor;
|
|
3690
3758
|
eventBus: IEventBus;
|
|
@@ -3693,7 +3761,7 @@ interface ReactorClientModule {
|
|
|
3693
3761
|
signer: ISigner;
|
|
3694
3762
|
subscriptionManager: IReactorSubscriptionManager;
|
|
3695
3763
|
jobAwaiter: IJobAwaiter;
|
|
3696
|
-
reactorModule:
|
|
3764
|
+
reactorModule: InProcessReactorModule | undefined;
|
|
3697
3765
|
}
|
|
3698
3766
|
//#endregion
|
|
3699
3767
|
//#region src/client/drive-client.d.ts
|
|
@@ -3753,6 +3821,8 @@ declare class DocumentModelResolver implements IDocumentModelResolver {
|
|
|
3753
3821
|
private loadingModels;
|
|
3754
3822
|
private failedModelTypes;
|
|
3755
3823
|
private broadcastHook;
|
|
3824
|
+
private modelLoadedHook;
|
|
3825
|
+
private readonly logger;
|
|
3756
3826
|
constructor(registry: IDocumentModelRegistry, loader: IDocumentModelLoader);
|
|
3757
3827
|
/**
|
|
3758
3828
|
* Install a post-success hook called after the resolver registers a
|
|
@@ -3760,7 +3830,14 @@ declare class DocumentModelResolver implements IDocumentModelResolver {
|
|
|
3760
3830
|
* `load-model` broadcast without touching the resolver's constructor.
|
|
3761
3831
|
*/
|
|
3762
3832
|
setBroadcastHook(hook: ModelLoadedBroadcastHook): void;
|
|
3833
|
+
/**
|
|
3834
|
+
* Post-success hook called with the document type after a model loads, so
|
|
3835
|
+
* peers (tabs) can load the same type via the event bus.
|
|
3836
|
+
*/
|
|
3837
|
+
setModelLoadedHook(hook: (documentType: string) => Promise<void>): void;
|
|
3763
3838
|
ensureModelLoaded(documentType: string): Promise<void>;
|
|
3839
|
+
private loadRegisterAndBroadcast;
|
|
3840
|
+
private notifyPeersModelLoaded;
|
|
3764
3841
|
private broadcastIfPossible;
|
|
3765
3842
|
}
|
|
3766
3843
|
/**
|
|
@@ -4053,7 +4130,7 @@ declare class SyncBuilder {
|
|
|
4053
4130
|
withMaxDeadLettersPerRemote(limit: number): this;
|
|
4054
4131
|
withMaxInboxBatchSize(limit: number): this;
|
|
4055
4132
|
build(reactor: IReactor, logger: ILogger, operationIndex: IOperationIndex, eventBus: IEventBus, db: Kysely<Database$1>, driveContainerTypes: ReadonlySet<string>): ISyncManager;
|
|
4056
|
-
buildModule(reactor: IReactor, logger: ILogger, operationIndex: IOperationIndex, eventBus: IEventBus, db: Kysely<Database$1>, driveContainerTypes: ReadonlySet<string>):
|
|
4133
|
+
buildModule(reactor: IReactor, logger: ILogger, operationIndex: IOperationIndex, eventBus: IEventBus, db: Kysely<Database$1>, driveContainerTypes: ReadonlySet<string>): InProcessSyncModule;
|
|
4057
4134
|
}
|
|
4058
4135
|
//#endregion
|
|
4059
4136
|
//#region src/core/reactor-builder.d.ts
|
|
@@ -4227,7 +4304,7 @@ declare class ReactorBuilder {
|
|
|
4227
4304
|
withProjectionWorkerFactory(factory: ProjectionWorkerFactory): this;
|
|
4228
4305
|
getResolvedModelManifest(): ModelManifestEntry[] | undefined;
|
|
4229
4306
|
build(): Promise<IReactor>;
|
|
4230
|
-
buildModule(): Promise<
|
|
4307
|
+
buildModule(): Promise<InProcessReactorModule>;
|
|
4231
4308
|
/**
|
|
4232
4309
|
* Constructs a {@link ProjectionShardManager} bound to the host event
|
|
4233
4310
|
* bus. Builds the default thread-transport factory unless one was
|
|
@@ -4296,7 +4373,7 @@ declare class ReactorClientBuilder {
|
|
|
4296
4373
|
withJobAwaiter(jobAwaiter: IJobAwaiter): this;
|
|
4297
4374
|
withDocumentModelLoader(loader: IDocumentModelLoader): this;
|
|
4298
4375
|
build(): Promise<ReactorClient>;
|
|
4299
|
-
buildModule(): Promise<
|
|
4376
|
+
buildModule(): Promise<InProcessReactorClientModule>;
|
|
4300
4377
|
}
|
|
4301
4378
|
//#endregion
|
|
4302
4379
|
//#region src/core/drive-container-types.d.ts
|
|
@@ -4885,6 +4962,15 @@ declare class KyselyWriteCache implements IWriteCache {
|
|
|
4885
4962
|
getStream(documentId: string, scope: string, branch: string): DocumentStream | undefined;
|
|
4886
4963
|
private findNearestKeyframe;
|
|
4887
4964
|
private coldMissRebuild;
|
|
4965
|
+
/**
|
|
4966
|
+
* Resolves which module version to use for a given operation in phase 2.
|
|
4967
|
+
*
|
|
4968
|
+
* Uses the validated-upgrade boundary rules from D7:
|
|
4969
|
+
* - If `input.revision` is present: op.index < revision[scope] → before the upgrade boundary
|
|
4970
|
+
* - Otherwise: timestamp fallback
|
|
4971
|
+
* - Falls back to final module version when neither is decidable
|
|
4972
|
+
*/
|
|
4973
|
+
private resolveModuleVersionForOp;
|
|
4888
4974
|
private warmMissRebuild;
|
|
4889
4975
|
private findNearestOlderSnapshot;
|
|
4890
4976
|
private makeStreamKey;
|
|
@@ -5217,7 +5303,7 @@ declare class GqlRequestChannelFactory implements IChannelFactory {
|
|
|
5217
5303
|
* @param operationIndex - Operation index for querying timestamps
|
|
5218
5304
|
* @returns A new GqlRequestChannel instance
|
|
5219
5305
|
*/
|
|
5220
|
-
instance(remoteId: string, remoteName: string, config: ChannelConfig, cursorStorage: ISyncCursorStorage, collectionId:
|
|
5306
|
+
instance(remoteId: string, remoteName: string, config: ChannelConfig, cursorStorage: ISyncCursorStorage, collectionId: DriveCollectionId, filter: RemoteFilter, operationIndex: IOperationIndex, options?: RemoteOptions): IChannel;
|
|
5221
5307
|
}
|
|
5222
5308
|
//#endregion
|
|
5223
5309
|
//#region src/sync/channels/gql-response-channel-factory.d.ts
|
|
@@ -5254,8 +5340,8 @@ type IPollTimer = {
|
|
|
5254
5340
|
type GqlChannelConfig = {
|
|
5255
5341
|
/** The GraphQL endpoint URL */url: string; /** Dynamic JWT token handler for generating fresh tokens per-request */
|
|
5256
5342
|
jwtHandler?: JwtHandler; /** Custom fetch function for testing (default: global fetch) */
|
|
5257
|
-
fetchFn?: typeof fetch; /** Collection
|
|
5258
|
-
collectionId:
|
|
5343
|
+
fetchFn?: typeof fetch; /** Collection to synchronize (drive-level abstraction) */
|
|
5344
|
+
collectionId: DriveCollectionId; /** Filter to apply to operations */
|
|
5259
5345
|
filter: RemoteFilter; /** Base delay in ms for exponential backoff on push retries */
|
|
5260
5346
|
retryBaseDelayMs: number; /** Maximum delay in ms for exponential backoff on push retries */
|
|
5261
5347
|
retryMaxDelayMs: number;
|
|
@@ -5288,7 +5374,10 @@ declare class GqlRequestChannel implements IChannel {
|
|
|
5288
5374
|
private isPushing;
|
|
5289
5375
|
private pendingDrain;
|
|
5290
5376
|
private receivingPages;
|
|
5377
|
+
private isRecovering;
|
|
5291
5378
|
private connectionState;
|
|
5379
|
+
/** Latest unrecoverable error was an auth rejection; cleared on connect. */
|
|
5380
|
+
private requiresAuth;
|
|
5292
5381
|
private readonly connectionStateCallbacks;
|
|
5293
5382
|
constructor(logger: ILogger, channelId: string, remoteName: string, cursorStorage: ISyncCursorStorage, config: GqlChannelConfig, operationIndex: IOperationIndex, pollTimer: IPollTimer);
|
|
5294
5383
|
/**
|
|
@@ -5322,6 +5411,11 @@ declare class GqlRequestChannel implements IChannel {
|
|
|
5322
5411
|
* Self-retries with backoff instead of restarting the poll timer on failure.
|
|
5323
5412
|
*/
|
|
5324
5413
|
private recoverFromChannelNotFound;
|
|
5414
|
+
/**
|
|
5415
|
+
* Resumes pushing outbox items that were blocked while the channel was being
|
|
5416
|
+
* recreated. Called after a successful re-registration.
|
|
5417
|
+
*/
|
|
5418
|
+
private resumePushAfterRecovery;
|
|
5325
5419
|
/**
|
|
5326
5420
|
* Queries the remote GraphQL endpoint for sync envelopes.
|
|
5327
5421
|
*/
|
|
@@ -5579,5 +5673,5 @@ declare class ProcessorManager extends BaseReadModel implements IProcessorManage
|
|
|
5579
5673
|
private deleteProcessorCursors;
|
|
5580
5674
|
}
|
|
5581
5675
|
//#endregion
|
|
5582
|
-
export { type AbortMessage, type AtomicTxn, type AttachmentHash, type AttachmentRef, BaseReadModel, type BatchExecutionRequest, type BatchExecutionResult, type BatchLoadRequest, type BatchLoadResult, type BuiltInReadModelKind, type CachedSnapshot, type ChannelConfig, ChannelError, ChannelErrorSource, type ChannelHealth, type ChannelMeta, ChannelScheme, type ConnectionState, type ConnectionStateChangeCallback, type ConnectionStateChangedEvent, type ConnectionStateSnapshot, type ConsistencyCoordinate, type ConsistencyKey, type ConsistencyToken, ConsistencyTracker, DEFAULT_DRIVE_CONTAINER_TYPES, type Database, type DbConfig, type DeadLetterAddedEvent, DefaultSubscriptionErrorHandler, type DocumentChangeEvent, DocumentChangeType, type DocumentGraphEdge, type DocumentIndexerDatabase, DocumentIntegrityService, DocumentModelRegistry, DocumentModelResolver, type DocumentModelSpec, type DocumentModelSpecInput, type DocumentRelationship, type DocumentRevisions, type DocumentStreamKey, type DocumentViewDatabase, DriveClient, DuplicateManifestError, DuplicateModuleError, DuplicateOperationError, EventBus, EventBusAggregateError, type ExecuteMessage, type ExecutionJobPlan, type ExecutorStartedEvent, type ExecutorStoppedEvent, type FactorySpec, type GqlChannelConfig, GqlRequestChannel, GqlRequestChannelFactory, GqlResponseChannel, GqlResponseChannelFactory, type HeartbeatMessage, type IChannel, type IChannelFactory, type IConsistencyTracker, type IDocumentGraph, type IDocumentIndexer, type IDocumentIntegrityService, type IDocumentModelLoader, type IDocumentModelRegistry, type IDocumentModelResolver, type IDocumentView, type IDriveClient, type IEventBus, type IJobAwaiter, type IJobExecutor, type IJobExecutorManager, type IJobTracker, type IKeyframeStore, type IOperationIndex, type IOperationStore, type IPollTimer, type IProcessor, type IProcessorHostModule, type IProcessorManager, type IProjectionTransport, type IQueue, type IReactor, type IReactorClient, type IReactorSubscriptionManager, type IReadModel, type IReadModelCoordinator, type IRelationalDb, type ISubscriptionErrorHandler, type ISyncCursorStorage, type ISyncManager, type ISyncRemoteStorage, type ISyncStatusTracker, type IWriteCache, SimpleJobExecutor as InMemoryJobExecutor, SimpleJobExecutor, InMemoryJobTracker, InMemoryQueue, type InitMessage, type InsertableDocumentSnapshot, IntervalPollTimer, InvalidModuleError, type Job, type JobAvailableEvent, JobAwaiter, type JobCompletedEvent, type JobExecutorConfig, JobExecutorEventTypes, type JobExecutorFactory, type JobFailedEvent, type JobInfo, type JobPendingEvent, type JobReadReadyEvent, type JobResult, type JobRunningEvent, type JobStartedEvent, JobStatus, type JobWriteReadyEvent, type JobWriteReadyPayload, type JwtHandler, type KeyframeSnapshot, type KeyframeValidationIssue, KyselyDocumentIndexer, KyselyDocumentView, KyselyKeyframeStore, KyselyOperationStore, KyselySyncCursorStorage, KyselySyncRemoteStorage, KyselyWriteCache, type LoadJobPlan, type LoadModelMessage, type LogMessage, Mailbox, type MetricsMessage, type ModelLoadFailedMessage, type ModelLoadedMessage, type ModelManifestEntry, ModuleNotFoundError, type ModuleRef, NullDocumentModelResolver, type OperationBatch, type OperationContext, type OperationFilter, type OperationIndexEntry, type OperationTable, type OperationWithContext, OptimisticLockError, type PagedResults, type PagingOptions, type ParentMessage, type ParsedDriveUrl, type ParsedPaging, PollBehavior, PollingChannelError, type PoolInstrumentation, type PoolStats, type ProcessorApp, type ProcessorFactory, type ProcessorFactoryBuilder, type ProcessorFilter, ProcessorManager, type ProcessorRecord, type ProcessorStatus, type ProjectionShardBuilderConfig, type ProjectionShardManagerConfig, type ProjectionWorkerFactory, PropagationMode, QueueEventTypes, REACTOR_SCHEMA, Reactor, ReactorBuilder, ReactorClient, ReactorClientBuilder, type ReactorClientModule, ReactorEventTypes, type ReactorFeatures, type JobFailedEvent$1 as ReactorJobFailedEvent, type ReactorModule, ReactorSubscriptionManager, type ReadModelBatchCompletedEvent, ReadModelCoordinator, type ReadModelFactory, type ReadModelFactoryDeps, type ReadModelIndexedEvent, type ReadModelIndexingStage, type ReadModelStage, type ReadyMessage, type RebuildResult, RelationalDbProcessor, RelationshipChangeType, type Remote, type RemoteCursor, type RemoteFilter, type RemoteOptions, type RemoteRecord, type RemoteStatus, type ResultMessage, RevisionMismatchError, type SanitizedArg, type SearchFilter, type ShutdownMessage, type ShutdownStatus, type SignatureVerificationHandler, type SignatureVerifierSpec, type SignerConfig, SimpleJobExecutorManager, type SnapshotValidationIssue, type Database$1 as StorageDatabase, type SubscriptionErrorContext, SyncBuilder, type SyncEnvelope, type SyncEnvelopeType, SyncEventTypes, type SyncFailedEvent, type SyncModule, SyncOperation, SyncOperationAggregateError, type SyncOperationErrorType, SyncOperationStatus, type SyncPendingEvent, SyncStatus, type SyncStatusChangeCallback, SyncStatusTracker, type SyncSucceededEvent, type TrackedProcessor, type Unsubscribe, type ValidationResult, type ViewFilter, type ErrorInfo as WorkerErrorInfo, type WorkerMessage, type WorkerPoolConfig, type WriteCacheConfig, addRelationshipAction, batchOperationsByDocument, consolidateSyncOperations, createDocumentAction, createForwardingLogger, createMutableShutdownStatus, createRelationalDb, deleteDocumentAction, documentActions,
|
|
5676
|
+
export { type AbortMessage, type AtomicTxn, type AttachmentHash, type AttachmentRef, BaseReadModel, type BatchExecutionRequest, type BatchExecutionResult, type BatchLoadRequest, type BatchLoadResult, type BuiltInReadModelKind, type CachedSnapshot, type ChannelConfig, ChannelError, ChannelErrorSource, type ChannelHealth, type ChannelMeta, ChannelScheme, type ConnectionState, type ConnectionStateChangeCallback, type ConnectionStateChangedEvent, type ConnectionStateSnapshot, type ConsistencyCoordinate, type ConsistencyKey, type ConsistencyToken, ConsistencyTracker, DEFAULT_DRIVE_CONTAINER_TYPES, DRIVE_AUTH_ERROR_MESSAGES, type Database, type DbConfig, type DeadLetterAddedEvent, DefaultSubscriptionErrorHandler, type DocumentChangeEvent, DocumentChangeType, type DocumentGraphEdge, type DocumentIndexerDatabase, DocumentIntegrityService, DocumentModelRegistry, DocumentModelResolver, type DocumentModelSpec, type DocumentModelSpecInput, type DocumentRelationship, type DocumentRevisions, type DocumentStreamKey, type DocumentViewDatabase, DriveClient, DriveCollectionId, DuplicateManifestError, DuplicateModuleError, DuplicateOperationError, EventBus, EventBusAggregateError, type ExecuteMessage, type ExecutionJobPlan, type ExecutorStartedEvent, type ExecutorStoppedEvent, type FactorySpec, type GqlChannelConfig, GqlRequestChannel, GqlRequestChannelFactory, GqlResponseChannel, GqlResponseChannelFactory, type HeartbeatMessage, type IChannel, type IChannelFactory, type IConsistencyTracker, type IDocumentGraph, type IDocumentIndexer, type IDocumentIntegrityService, type IDocumentModelLoader, type IDocumentModelRegistry, type IDocumentModelResolver, type IDocumentView, type IDriveClient, type IEventBus, type IJobAwaiter, type IJobExecutor, type IJobExecutorManager, type IJobTracker, type IKeyframeStore, type IMailbox, type IOperationIndex, type IOperationStore, type IPollTimer, type IProcessor, type IProcessorHostModule, type IProcessorManager, type IProjectionTransport, type IQueue, type IReactor, type IReactorClient, type IReactorSubscriptionManager, type IReadModel, type IReadModelCoordinator, type IRelationalDb, type ISubscriptionErrorHandler, type ISyncCursorStorage, type ISyncManager, type ISyncRemoteStorage, type ISyncStatusTracker, type IWriteCache, SimpleJobExecutor as InMemoryJobExecutor, SimpleJobExecutor, InMemoryJobTracker, InMemoryQueue, type InProcessReactorClientModule, type InProcessReactorModule, type InProcessSyncModule, type InitMessage, type InsertableDocumentSnapshot, IntervalPollTimer, InvalidModuleError, type Job, type JobAvailableEvent, JobAwaiter, type JobCompletedEvent, type JobExecutorConfig, JobExecutorEventTypes, type JobExecutorFactory, type JobFailedEvent, type JobInfo, type JobPendingEvent, type JobReadReadyEvent, type JobResult, type JobRunningEvent, type JobStartedEvent, JobStatus, type JobWriteReadyEvent, type JobWriteReadyPayload, type JwtHandler, type KeyframeSnapshot, type KeyframeValidationIssue, KyselyDocumentIndexer, KyselyDocumentView, KyselyKeyframeStore, KyselyOperationStore, KyselySyncCursorStorage, KyselySyncRemoteStorage, KyselyWriteCache, type LoadJobPlan, type LoadModelMessage, type LogMessage, Mailbox, type MetricsMessage, type ModelLoadFailedMessage, type ModelLoadedEvent, type ModelLoadedMessage, type ModelManifestEntry, ModuleNotFoundError, type ModuleRef, NullDocumentModelResolver, type OperationBatch, type OperationContext, type OperationFilter, type OperationIndexEntry, type OperationTable, type OperationWithContext, OptimisticLockError, type PagedResults, type PagingOptions, type ParentMessage, type ParsedDriveUrl, type ParsedPaging, PollBehavior, PollingChannelError, type PoolInstrumentation, type PoolStats, type ProcessorApp, type ProcessorFactory, type ProcessorFactoryBuilder, type ProcessorFilter, ProcessorManager, type ProcessorRecord, type ProcessorStatus, type ProjectionShardBuilderConfig, type ProjectionShardManagerConfig, type ProjectionWorkerFactory, PropagationMode, QueueEventTypes, REACTOR_SCHEMA, Reactor, ReactorBuilder, ReactorClient, ReactorClientBuilder, type ReactorClientModule, ReactorEventTypes, type ReactorFeatures, type JobFailedEvent$1 as ReactorJobFailedEvent, type ReactorModule, ReactorSubscriptionManager, type ReadModelBatchCompletedEvent, ReadModelCoordinator, type ReadModelFactory, type ReadModelFactoryDeps, type ReadModelIndexedEvent, type ReadModelIndexingStage, type ReadModelStage, type ReadyMessage, type RebuildResult, RelationalDbProcessor, RelationshipChangeType, type Remote, type RemoteCursor, type RemoteFilter, type RemoteMeta, type RemoteOptions, type RemoteRecord, type RemoteStatus, type ResultMessage, RevisionMismatchError, type SanitizedArg, type SearchFilter, type ShutdownMessage, type ShutdownStatus, type SignatureVerificationHandler, type SignatureVerifierSpec, type SignerConfig, SimpleJobExecutorManager, type SnapshotValidationIssue, type Database$1 as StorageDatabase, type SubscriptionErrorContext, SyncBuilder, type SyncEnvelope, type SyncEnvelopeType, SyncEventTypes, type SyncFailedEvent, type SyncModule, SyncOperation, SyncOperationAggregateError, type SyncOperationErrorType, SyncOperationStatus, type SyncPendingEvent, SyncStatus, type SyncStatusChangeCallback, SyncStatusTracker, type SyncSucceededEvent, type TrackedProcessor, type Unsubscribe, type ValidationResult, type ViewFilter, type ErrorInfo as WorkerErrorInfo, type WorkerMessage, type WorkerPoolConfig, type WriteCacheConfig, addRelationshipAction, batchOperationsByDocument, consolidateSyncOperations, createDocumentAction, createForwardingLogger, createMutableShutdownStatus, createRelationalDb, deleteDocumentAction, documentActions, driveIdFromUrl, envelopesToSyncOperations, errorToInfo, getMigrationStatus, instrumentPgPool, isDriveAuthError, makeConsistencyKey, parseDriveUrl, parsePagingOptions, removeRelationshipAction, runMigrations, sanitizeArg, trimMailboxFromAckOrdinal, updateRelationshipAction, upgradeDocumentAction, workerEntryPath };
|
|
5583
5677
|
//# sourceMappingURL=index.d.ts.map
|