@powerhousedao/reactor 6.2.0-dev.9 → 6.2.0-rc.1
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-DeJ2DW16.js} +2 -2
- package/dist/{build-worker-executor-DDVXB921.js.map → build-worker-executor-DeJ2DW16.js.map} +1 -1
- package/dist/{document-indexer-B2iLRB0o.js → document-indexer-DLEyUQxU.js} +6 -1
- package/dist/document-indexer-DLEyUQxU.js.map +1 -0
- package/dist/{drive-container-types-BNpMlgT_.js → drive-container-types-BxnXaOAp.js} +128 -104
- package/dist/drive-container-types-BxnXaOAp.js.map +1 -0
- package/dist/entry.js +2 -2
- package/dist/index.d.ts +84 -12
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +88 -18
- package/dist/index.js.map +1 -1
- package/dist/projection-entry.js +3 -3
- package/dist/{worker-SUoDhurA.js → worker-XYrQaEmt.js} +2 -2
- package/dist/{worker-SUoDhurA.js.map → worker-XYrQaEmt.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/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { A as parsePagingOptions, C as DuplicateManifestError, D as DocumentDeletedError, E as ModuleNotFoundError, O as DocumentNotFoundError, S as CollectionMembershipCache, T as InvalidModuleError, _ as KyselyWriteCache, a as createForwardingPoolInstrumentation, b as createConsistencyToken, c as DuplicateOperationError, d as KyselyKeyframeStore, f as DocumentModelRegistry, g as EventBus, h as KyselyExecutionScope, i as runMigrations, j as throwIfAborted, k as matchesScope, l as OptimisticLockError, m as
|
|
1
|
+
import { A as parsePagingOptions, C as DuplicateManifestError, D as DocumentDeletedError, E as ModuleNotFoundError, O as DocumentNotFoundError, S as CollectionMembershipCache, T as InvalidModuleError, _ as KyselyWriteCache, a as createForwardingPoolInstrumentation, b as createConsistencyToken, c as DuplicateOperationError, d as KyselyKeyframeStore, f as DocumentModelRegistry, g as EventBus, h as KyselyExecutionScope, i as runMigrations, j as throwIfAborted, k as matchesScope, l as OptimisticLockError, m as DriveCollectionId, n as REACTOR_SCHEMA, o as instrumentPgPool, p as SimpleJobExecutor, r as getMigrationStatus, s as KyselyOperationStore, t as DEFAULT_DRIVE_CONTAINER_TYPES, u as RevisionMismatchError, v as KyselyOperationIndex, w as DuplicateModuleError, x as createEmptyConsistencyToken, y as DocumentMetaCache } from "./drive-container-types-BxnXaOAp.js";
|
|
2
2
|
import { n as ReactorEventTypes, t as EventBusAggregateError } from "./types-CxSpmNGK.js";
|
|
3
3
|
import { i as WorkerInitFailedError, r as WorkerExitedError, t as WorkerAbortTimeoutError } from "./errors-D3S6Eysd.js";
|
|
4
|
-
import { a as ReadModelCoordinator, i as KyselyDocumentView, n as ConsistencyTracker, o as BaseReadModel, r as makeConsistencyKey, t as KyselyDocumentIndexer } from "./document-indexer-
|
|
4
|
+
import { a as ReadModelCoordinator, i as KyselyDocumentView, n as ConsistencyTracker, o as BaseReadModel, r as makeConsistencyKey, t as KyselyDocumentIndexer } from "./document-indexer-DLEyUQxU.js";
|
|
5
5
|
import { n as errorToInfo, r as sanitizeArg, t as createForwardingLogger } from "./forwarding-logger-BBkMSxuJ.js";
|
|
6
|
-
import { t as workerEntryPath } from "./worker-
|
|
6
|
+
import { t as workerEntryPath } from "./worker-XYrQaEmt.js";
|
|
7
7
|
import { actions, actions as documentActions, createPresignedHeader, generateId, hashDocumentStateForScope, replayDocument } from "@powerhousedao/shared/document-model";
|
|
8
8
|
import { addFile, addFolder, copyNode, deleteNode, driveCreateDocument, generateNodesCopy, getDescendants, handleTargetNameCollisions, isFileNode, isFolderNode, moveNode, updateNode } from "@powerhousedao/shared/document-drive";
|
|
9
9
|
import { v4 } from "uuid";
|
|
@@ -737,6 +737,14 @@ var ReactorClient = class {
|
|
|
737
737
|
return await this.reactor.getByIdOrSlug(identifier, view, void 0, signal);
|
|
738
738
|
}
|
|
739
739
|
/**
|
|
740
|
+
* Resolves an identifier (id or slug) to the canonical document id, using the
|
|
741
|
+
* same lookup as the data path. Resolves against the "main" branch. Throws if
|
|
742
|
+
* the identifier cannot be resolved or is ambiguous.
|
|
743
|
+
*/
|
|
744
|
+
async resolveIdOrSlug(identifier, signal) {
|
|
745
|
+
return this.documentView.resolveIdOrSlug(identifier, void 0, void 0, signal);
|
|
746
|
+
}
|
|
747
|
+
/**
|
|
740
748
|
* Retrieves operations for a document
|
|
741
749
|
*/
|
|
742
750
|
async getOperations(documentIdentifier, view, filter, paging, signal) {
|
|
@@ -1858,6 +1866,7 @@ var InMemoryJobTracker = class {
|
|
|
1858
1866
|
if (!job) {
|
|
1859
1867
|
this.jobs.set(jobId, {
|
|
1860
1868
|
id: jobId,
|
|
1869
|
+
documentId: "",
|
|
1861
1870
|
status: JobStatus.RUNNING,
|
|
1862
1871
|
createdAtUtcIso: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1863
1872
|
consistencyToken: createEmptyConsistencyToken(),
|
|
@@ -1878,6 +1887,7 @@ var InMemoryJobTracker = class {
|
|
|
1878
1887
|
if (!existing) {
|
|
1879
1888
|
this.jobs.set(jobId, {
|
|
1880
1889
|
id: jobId,
|
|
1890
|
+
documentId: job?.documentId ?? "",
|
|
1881
1891
|
status: JobStatus.FAILED,
|
|
1882
1892
|
createdAtUtcIso: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1883
1893
|
completedAtUtcIso: (/* @__PURE__ */ new Date()).toISOString(),
|
|
@@ -3295,6 +3305,20 @@ var GraphQLRequestError = class extends Error {
|
|
|
3295
3305
|
this.statusCode = statusCode;
|
|
3296
3306
|
}
|
|
3297
3307
|
};
|
|
3308
|
+
/** Auth-rejection message fragments the switchboard emits. Shared with
|
|
3309
|
+
* reactor-api so server throws and this client check can't drift. */
|
|
3310
|
+
const DRIVE_AUTH_ERROR_MESSAGES = {
|
|
3311
|
+
forbidden: "Forbidden: insufficient permissions",
|
|
3312
|
+
authenticationRequired: "Forbidden: authentication required"
|
|
3313
|
+
};
|
|
3314
|
+
/** True when the remote rejected the caller as unauthenticated/unauthorized:
|
|
3315
|
+
* an HTTP 401/403, or a Forbidden/Unauthorized GraphQL error. */
|
|
3316
|
+
function isDriveAuthError(error) {
|
|
3317
|
+
if (!(error instanceof GraphQLRequestError)) return false;
|
|
3318
|
+
if (error.category === "http") return error.statusCode === 401 || error.statusCode === 403;
|
|
3319
|
+
if (error.category === "graphql") return Object.values(DRIVE_AUTH_ERROR_MESSAGES).some((m) => error.message.includes(m));
|
|
3320
|
+
return false;
|
|
3321
|
+
}
|
|
3298
3322
|
var PollingChannelError = class extends Error {
|
|
3299
3323
|
constructor(message) {
|
|
3300
3324
|
super(message);
|
|
@@ -3946,7 +3970,10 @@ var GqlRequestChannel = class {
|
|
|
3946
3970
|
isPushing = false;
|
|
3947
3971
|
pendingDrain = false;
|
|
3948
3972
|
receivingPages = false;
|
|
3973
|
+
isRecovering = false;
|
|
3949
3974
|
connectionState = "connecting";
|
|
3975
|
+
/** Latest unrecoverable error was an auth rejection; cleared on connect. */
|
|
3976
|
+
requiresAuth = false;
|
|
3950
3977
|
connectionStateCallbacks = /* @__PURE__ */ new Set();
|
|
3951
3978
|
constructor(logger, channelId, remoteName, cursorStorage, config, operationIndex, pollTimer) {
|
|
3952
3979
|
this.logger = logger;
|
|
@@ -4038,7 +4065,8 @@ var GqlRequestChannel = class {
|
|
|
4038
4065
|
lastFailureUtcMs: this.lastFailureUtcMs ?? 0,
|
|
4039
4066
|
pushBlocked: this.pushBlocked,
|
|
4040
4067
|
pushFailureCount: this.pushFailureCount,
|
|
4041
|
-
receivingPages: this.receivingPages
|
|
4068
|
+
receivingPages: this.receivingPages,
|
|
4069
|
+
requiresAuth: this.requiresAuth
|
|
4042
4070
|
};
|
|
4043
4071
|
}
|
|
4044
4072
|
onConnectionStateChange(callback) {
|
|
@@ -4069,6 +4097,7 @@ var GqlRequestChannel = class {
|
|
|
4069
4097
|
this.transitionConnectionState("connected");
|
|
4070
4098
|
}
|
|
4071
4099
|
transitionConnectionState(next) {
|
|
4100
|
+
if (next === "connected") this.requiresAuth = false;
|
|
4072
4101
|
if (this.connectionState === next) return;
|
|
4073
4102
|
this.connectionState = next;
|
|
4074
4103
|
const snapshot = this.getConnectionState();
|
|
@@ -4143,6 +4172,7 @@ var GqlRequestChannel = class {
|
|
|
4143
4172
|
this.logger.error("GqlChannel poll error (@FailureCount, @Classification): @Error", this.failureCount, classification, channelError);
|
|
4144
4173
|
if (classification === "unrecoverable") {
|
|
4145
4174
|
this.pollTimer.stop();
|
|
4175
|
+
this.requiresAuth = isDriveAuthError(err);
|
|
4146
4176
|
this.transitionConnectionState("error");
|
|
4147
4177
|
return true;
|
|
4148
4178
|
}
|
|
@@ -4154,16 +4184,23 @@ var GqlRequestChannel = class {
|
|
|
4154
4184
|
* Self-retries with backoff instead of restarting the poll timer on failure.
|
|
4155
4185
|
*/
|
|
4156
4186
|
recoverFromChannelNotFound() {
|
|
4187
|
+
if (this.isRecovering) return;
|
|
4188
|
+
this.isRecovering = true;
|
|
4157
4189
|
this.logger.info("GqlChannel @ChannelId not found on remote, re-registering...", this.channelId);
|
|
4158
4190
|
this.pollTimer.stop();
|
|
4159
4191
|
const attemptRecovery = (attempt) => {
|
|
4160
|
-
if (this.isShutdown)
|
|
4192
|
+
if (this.isShutdown) {
|
|
4193
|
+
this.isRecovering = false;
|
|
4194
|
+
return;
|
|
4195
|
+
}
|
|
4161
4196
|
this.touchRemoteChannel().then(({ ackOrdinal }) => {
|
|
4162
4197
|
this.logger.info("GqlChannel @ChannelId re-registered successfully", this.channelId);
|
|
4198
|
+
this.isRecovering = false;
|
|
4163
4199
|
this.failureCount = 0;
|
|
4164
4200
|
if (ackOrdinal > 0) trimMailboxFromAckOrdinal(this.outbox, ackOrdinal);
|
|
4165
4201
|
this.pollTimer.start();
|
|
4166
4202
|
this.transitionConnectionState("connected");
|
|
4203
|
+
this.resumePushAfterRecovery();
|
|
4167
4204
|
}).catch((recoveryError) => {
|
|
4168
4205
|
const err = recoveryError instanceof Error ? recoveryError : new Error(String(recoveryError));
|
|
4169
4206
|
const classification = this.classifyError(err);
|
|
@@ -4171,6 +4208,8 @@ var GqlRequestChannel = class {
|
|
|
4171
4208
|
this.failureCount++;
|
|
4172
4209
|
this.lastFailureUtcMs = Date.now();
|
|
4173
4210
|
if (classification === "unrecoverable") {
|
|
4211
|
+
this.isRecovering = false;
|
|
4212
|
+
this.requiresAuth = isDriveAuthError(err);
|
|
4174
4213
|
this.transitionConnectionState("error");
|
|
4175
4214
|
return;
|
|
4176
4215
|
}
|
|
@@ -4182,6 +4221,22 @@ var GqlRequestChannel = class {
|
|
|
4182
4221
|
attemptRecovery(1);
|
|
4183
4222
|
}
|
|
4184
4223
|
/**
|
|
4224
|
+
* Resumes pushing outbox items that were blocked while the channel was being
|
|
4225
|
+
* recreated. Called after a successful re-registration.
|
|
4226
|
+
*/
|
|
4227
|
+
resumePushAfterRecovery() {
|
|
4228
|
+
if (this.isShutdown) return;
|
|
4229
|
+
if (!this.pushBlocked) return;
|
|
4230
|
+
if (this.pushRetryTimer) {
|
|
4231
|
+
clearTimeout(this.pushRetryTimer);
|
|
4232
|
+
this.pushRetryTimer = null;
|
|
4233
|
+
}
|
|
4234
|
+
this.pushBlocked = false;
|
|
4235
|
+
this.pushFailureCount = 0;
|
|
4236
|
+
const items = this.outbox.items;
|
|
4237
|
+
if (items.length > 0) this.attemptPush([...items]);
|
|
4238
|
+
}
|
|
4239
|
+
/**
|
|
4185
4240
|
* Queries the remote GraphQL endpoint for sync envelopes.
|
|
4186
4241
|
*/
|
|
4187
4242
|
async pollSyncEnvelopes(ackOrdinal, latestOrdinal) {
|
|
@@ -4272,7 +4327,7 @@ var GqlRequestChannel = class {
|
|
|
4272
4327
|
async touchRemoteChannel() {
|
|
4273
4328
|
let sinceTimestampUtcMs = "0";
|
|
4274
4329
|
try {
|
|
4275
|
-
const result = await this.operationIndex.getLatestTimestampForCollection(this.config.collectionId);
|
|
4330
|
+
const result = await this.operationIndex.getLatestTimestampForCollection(this.config.collectionId.key);
|
|
4276
4331
|
if (result) sinceTimestampUtcMs = result;
|
|
4277
4332
|
} catch {}
|
|
4278
4333
|
const mutation = `
|
|
@@ -4286,7 +4341,7 @@ var GqlRequestChannel = class {
|
|
|
4286
4341
|
const variables = { input: {
|
|
4287
4342
|
id: this.channelId,
|
|
4288
4343
|
name: this.channelId,
|
|
4289
|
-
collectionId: this.config.collectionId,
|
|
4344
|
+
collectionId: this.config.collectionId.key,
|
|
4290
4345
|
filter: {
|
|
4291
4346
|
documentId: this.config.filter.documentId,
|
|
4292
4347
|
scope: this.config.filter.scope,
|
|
@@ -4317,6 +4372,12 @@ var GqlRequestChannel = class {
|
|
|
4317
4372
|
this.pendingDrain = false;
|
|
4318
4373
|
if (this.isShutdown) return;
|
|
4319
4374
|
const err = error instanceof Error ? error : new Error(String(error));
|
|
4375
|
+
if (err.message.includes("Channel not found")) {
|
|
4376
|
+
this.pushBlocked = true;
|
|
4377
|
+
this.transitionConnectionState("reconnecting");
|
|
4378
|
+
this.recoverFromChannelNotFound();
|
|
4379
|
+
return;
|
|
4380
|
+
}
|
|
4320
4381
|
if (this.classifyError(err) === "recoverable") {
|
|
4321
4382
|
this.pushFailureCount++;
|
|
4322
4383
|
this.pushBlocked = true;
|
|
@@ -4328,6 +4389,7 @@ var GqlRequestChannel = class {
|
|
|
4328
4389
|
for (const syncOp of syncOps) syncOp.failed(channelError);
|
|
4329
4390
|
this.deadLetter.add(...syncOps);
|
|
4330
4391
|
this.outbox.remove(...syncOps);
|
|
4392
|
+
this.requiresAuth = isDriveAuthError(err);
|
|
4331
4393
|
this.transitionConnectionState("error");
|
|
4332
4394
|
}
|
|
4333
4395
|
});
|
|
@@ -4620,7 +4682,8 @@ var GqlResponseChannel = class {
|
|
|
4620
4682
|
lastFailureUtcMs: 0,
|
|
4621
4683
|
pushBlocked: false,
|
|
4622
4684
|
pushFailureCount: 0,
|
|
4623
|
-
receivingPages: false
|
|
4685
|
+
receivingPages: false,
|
|
4686
|
+
requiresAuth: false
|
|
4624
4687
|
};
|
|
4625
4688
|
}
|
|
4626
4689
|
onConnectionStateChange(callback) {
|
|
@@ -4819,7 +4882,7 @@ function rowToRemoteRecord(row) {
|
|
|
4819
4882
|
return {
|
|
4820
4883
|
id: row.channel_id,
|
|
4821
4884
|
name: row.name,
|
|
4822
|
-
collectionId: row.collection_id,
|
|
4885
|
+
collectionId: DriveCollectionId.fromKey(row.collection_id),
|
|
4823
4886
|
channelConfig: {
|
|
4824
4887
|
type: row.channel_type,
|
|
4825
4888
|
parameters: row.channel_parameters ?? {}
|
|
@@ -4849,13 +4912,13 @@ function rowToRemoteRecord(row) {
|
|
|
4849
4912
|
function remoteRecordToRow(remote) {
|
|
4850
4913
|
return {
|
|
4851
4914
|
name: remote.name,
|
|
4852
|
-
collection_id: remote.collectionId,
|
|
4915
|
+
collection_id: remote.collectionId.key,
|
|
4853
4916
|
channel_type: remote.channelConfig.type,
|
|
4854
4917
|
channel_id: remote.id,
|
|
4855
4918
|
remote_name: remote.name,
|
|
4856
4919
|
channel_parameters: remote.channelConfig.parameters,
|
|
4857
|
-
filter_document_ids: remote.filter.documentId.length > 0 ? remote.filter.documentId : null,
|
|
4858
|
-
filter_scopes: remote.filter.scope.length > 0 ? remote.filter.scope : null,
|
|
4920
|
+
filter_document_ids: remote.filter.documentId.length > 0 ? JSON.stringify(remote.filter.documentId) : null,
|
|
4921
|
+
filter_scopes: remote.filter.scope.length > 0 ? JSON.stringify(remote.filter.scope) : null,
|
|
4859
4922
|
filter_branch: remote.filter.branch,
|
|
4860
4923
|
push_state: remote.status.push.state,
|
|
4861
4924
|
push_last_success_utc_ms: remote.status.push.lastSuccessUtcMs ? new Date(remote.status.push.lastSuccessUtcMs).toISOString() : null,
|
|
@@ -5002,7 +5065,7 @@ var BatchAggregator = class {
|
|
|
5002
5065
|
if (!this.driveContainerTypes.has(op.context.documentType)) continue;
|
|
5003
5066
|
const input = action.input;
|
|
5004
5067
|
if (!input?.sourceId || !input.targetId) continue;
|
|
5005
|
-
const collectionId =
|
|
5068
|
+
const collectionId = DriveCollectionId.forDrive(input.sourceId, op.context.branch).key;
|
|
5006
5069
|
if (!(input.targetId in mergedMemberships)) mergedMemberships[input.targetId] = [];
|
|
5007
5070
|
if (!mergedMemberships[input.targetId].includes(collectionId)) mergedMemberships[input.targetId].push(collectionId);
|
|
5008
5071
|
}
|
|
@@ -5369,7 +5432,7 @@ var SyncManager = class {
|
|
|
5369
5432
|
}, options = { sinceTimestampUtcMs: "0" }, id) {
|
|
5370
5433
|
if (this.isShutdown) throw new Error("SyncManager is shutdown and cannot add remotes");
|
|
5371
5434
|
if (this.remotes.has(name)) throw new Error(`Remote with name '${name}' already exists`);
|
|
5372
|
-
this.logger.debug("Adding remote (@name, @collectionId, @channelConfig, @filter, @options, @id)", name, collectionId, channelConfig, filter, options, id);
|
|
5435
|
+
this.logger.debug("Adding remote (@name, @collectionId, @channelConfig, @filter, @options, @id)", name, collectionId.key, channelConfig, filter, options, id);
|
|
5373
5436
|
const remoteId = id ?? crypto.randomUUID();
|
|
5374
5437
|
const remoteRecord = {
|
|
5375
5438
|
id: remoteId,
|
|
@@ -5527,7 +5590,7 @@ var SyncManager = class {
|
|
|
5527
5590
|
this.logger.debug("Loaded @count persisted dead letters for remote @name", records.length, remote.name);
|
|
5528
5591
|
}
|
|
5529
5592
|
getRemotesForCollection(collectionId) {
|
|
5530
|
-
return Array.from(this.remotes.values()).filter((remote) => remote.collectionId === collectionId);
|
|
5593
|
+
return Array.from(this.remotes.values()).filter((remote) => remote.collectionId.key === collectionId);
|
|
5531
5594
|
}
|
|
5532
5595
|
async processCompleteBatch(batch) {
|
|
5533
5596
|
if (this.isShutdown) return;
|
|
@@ -5710,7 +5773,7 @@ var SyncManager = class {
|
|
|
5710
5773
|
}
|
|
5711
5774
|
remote.channel.outbox.add(...syncOps);
|
|
5712
5775
|
};
|
|
5713
|
-
let page = await this.operationIndex.find(remote.collectionId, ackOrdinal, { excludeSourceRemote: remote.name }, void 0, composedSignal);
|
|
5776
|
+
let page = await this.operationIndex.find(remote.collectionId.key, ackOrdinal, { excludeSourceRemote: remote.name }, void 0, composedSignal);
|
|
5714
5777
|
let carry = [];
|
|
5715
5778
|
let hasMore;
|
|
5716
5779
|
do {
|
|
@@ -6029,6 +6092,7 @@ var Reactor = class {
|
|
|
6029
6092
|
};
|
|
6030
6093
|
const jobInfo = {
|
|
6031
6094
|
id: jobId,
|
|
6095
|
+
documentId: job.documentId,
|
|
6032
6096
|
status: JobStatus.PENDING,
|
|
6033
6097
|
createdAtUtcIso,
|
|
6034
6098
|
consistencyToken: {
|
|
@@ -6067,6 +6131,7 @@ var Reactor = class {
|
|
|
6067
6131
|
};
|
|
6068
6132
|
const jobInfo = {
|
|
6069
6133
|
id: jobId,
|
|
6134
|
+
documentId: job.documentId,
|
|
6070
6135
|
status: JobStatus.PENDING,
|
|
6071
6136
|
createdAtUtcIso,
|
|
6072
6137
|
consistencyToken: {
|
|
@@ -6104,6 +6169,7 @@ var Reactor = class {
|
|
|
6104
6169
|
};
|
|
6105
6170
|
const jobInfo = {
|
|
6106
6171
|
id: jobId,
|
|
6172
|
+
documentId: job.documentId,
|
|
6107
6173
|
status: JobStatus.PENDING,
|
|
6108
6174
|
createdAtUtcIso,
|
|
6109
6175
|
consistencyToken: {
|
|
@@ -6143,6 +6209,7 @@ var Reactor = class {
|
|
|
6143
6209
|
};
|
|
6144
6210
|
const jobInfo = {
|
|
6145
6211
|
id: jobId,
|
|
6212
|
+
documentId: job.documentId,
|
|
6146
6213
|
status: JobStatus.PENDING,
|
|
6147
6214
|
createdAtUtcIso,
|
|
6148
6215
|
consistencyToken: {
|
|
@@ -6177,6 +6244,7 @@ var Reactor = class {
|
|
|
6177
6244
|
for (const jobPlan of request.jobs) {
|
|
6178
6245
|
const jobInfo = {
|
|
6179
6246
|
id: planKeyToJobId.get(jobPlan.key),
|
|
6247
|
+
documentId: jobPlan.documentId,
|
|
6180
6248
|
status: JobStatus.PENDING,
|
|
6181
6249
|
createdAtUtcIso,
|
|
6182
6250
|
consistencyToken: {
|
|
@@ -6246,6 +6314,7 @@ var Reactor = class {
|
|
|
6246
6314
|
for (const jobPlan of request.jobs) {
|
|
6247
6315
|
const jobInfo = {
|
|
6248
6316
|
id: planKeyToJobId.get(jobPlan.key),
|
|
6317
|
+
documentId: jobPlan.documentId,
|
|
6249
6318
|
status: JobStatus.PENDING,
|
|
6250
6319
|
createdAtUtcIso,
|
|
6251
6320
|
consistencyToken: {
|
|
@@ -6318,6 +6387,7 @@ var Reactor = class {
|
|
|
6318
6387
|
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
6319
6388
|
return Promise.resolve({
|
|
6320
6389
|
id: jobId,
|
|
6390
|
+
documentId: "",
|
|
6321
6391
|
status: JobStatus.FAILED,
|
|
6322
6392
|
createdAtUtcIso: now,
|
|
6323
6393
|
completedAtUtcIso: now,
|
|
@@ -6793,7 +6863,7 @@ var ReactorBuilder = class {
|
|
|
6793
6863
|
const [{ WorkerHandle }, { createThreadTransport }, { workerEntryPath }] = await Promise.all([
|
|
6794
6864
|
import("./worker-handle-B1w03nRA.js"),
|
|
6795
6865
|
import("./transport-ByGviWdZ.js"),
|
|
6796
|
-
import("./worker-
|
|
6866
|
+
import("./worker-XYrQaEmt.js").then((n) => n.n)
|
|
6797
6867
|
]);
|
|
6798
6868
|
const db = this.workerDbConfig;
|
|
6799
6869
|
const signatureVerifier = this.workerSignatureVerifierSpec;
|
|
@@ -7160,6 +7230,6 @@ var DocumentIntegrityService = class {
|
|
|
7160
7230
|
}
|
|
7161
7231
|
};
|
|
7162
7232
|
//#endregion
|
|
7163
|
-
export { BaseReadModel, ChannelError, ChannelErrorSource, ChannelScheme, ConsistencyTracker, DEFAULT_DRIVE_CONTAINER_TYPES, DefaultSubscriptionErrorHandler, DocumentChangeType, DocumentIntegrityService, DocumentModelRegistry, DocumentModelResolver, DriveClient, DuplicateManifestError, DuplicateModuleError, DuplicateOperationError, EventBus, EventBusAggregateError, GqlRequestChannel, GqlRequestChannelFactory, GqlResponseChannel, GqlResponseChannelFactory, SimpleJobExecutor as InMemoryJobExecutor, SimpleJobExecutor, InMemoryJobTracker, InMemoryQueue, IntervalPollTimer, InvalidModuleError, JobAwaiter, JobExecutorEventTypes, JobStatus, KyselyDocumentIndexer, KyselyDocumentView, KyselyKeyframeStore, KyselyOperationStore, KyselySyncCursorStorage, KyselySyncRemoteStorage, KyselyWriteCache, Mailbox, ModuleNotFoundError, NullDocumentModelResolver, OptimisticLockError, PollBehavior, PollingChannelError, ProcessorManager, PropagationMode, QueueEventTypes, REACTOR_SCHEMA, Reactor, ReactorBuilder, ReactorClient, ReactorClientBuilder, ReactorEventTypes, ReactorSubscriptionManager, ReadModelCoordinator, RelationalDbProcessor, RelationshipChangeType, RevisionMismatchError, SimpleJobExecutorManager, SyncBuilder, SyncEventTypes, SyncOperation, SyncOperationAggregateError, SyncOperationStatus, SyncStatus, SyncStatusTracker, addRelationshipAction, batchOperationsByDocument, consolidateSyncOperations, createDocumentAction, createForwardingLogger, createMutableShutdownStatus, createRelationalDb, deleteDocumentAction, documentActions,
|
|
7233
|
+
export { BaseReadModel, ChannelError, ChannelErrorSource, ChannelScheme, ConsistencyTracker, DEFAULT_DRIVE_CONTAINER_TYPES, DRIVE_AUTH_ERROR_MESSAGES, DefaultSubscriptionErrorHandler, DocumentChangeType, DocumentIntegrityService, DocumentModelRegistry, DocumentModelResolver, DriveClient, DriveCollectionId, DuplicateManifestError, DuplicateModuleError, DuplicateOperationError, EventBus, EventBusAggregateError, GqlRequestChannel, GqlRequestChannelFactory, GqlResponseChannel, GqlResponseChannelFactory, SimpleJobExecutor as InMemoryJobExecutor, SimpleJobExecutor, InMemoryJobTracker, InMemoryQueue, IntervalPollTimer, InvalidModuleError, JobAwaiter, JobExecutorEventTypes, JobStatus, KyselyDocumentIndexer, KyselyDocumentView, KyselyKeyframeStore, KyselyOperationStore, KyselySyncCursorStorage, KyselySyncRemoteStorage, KyselyWriteCache, Mailbox, ModuleNotFoundError, NullDocumentModelResolver, OptimisticLockError, PollBehavior, PollingChannelError, ProcessorManager, PropagationMode, QueueEventTypes, REACTOR_SCHEMA, Reactor, ReactorBuilder, ReactorClient, ReactorClientBuilder, ReactorEventTypes, ReactorSubscriptionManager, ReadModelCoordinator, RelationalDbProcessor, RelationshipChangeType, RevisionMismatchError, SimpleJobExecutorManager, SyncBuilder, SyncEventTypes, SyncOperation, SyncOperationAggregateError, SyncOperationStatus, SyncStatus, SyncStatusTracker, 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 };
|
|
7164
7234
|
|
|
7165
7235
|
//# sourceMappingURL=index.js.map
|