@powerhousedao/ph-cli 6.0.0-dev.90 → 6.0.0-dev.91

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/src/cli.js CHANGED
@@ -332315,6 +332315,7 @@ class GqlRequestChannel {
332315
332315
  cursorStorage;
332316
332316
  operationIndex;
332317
332317
  pollTimer;
332318
+ abortController = new AbortController;
332318
332319
  isShutdown;
332319
332320
  failureCount;
332320
332321
  lastSuccessUtcMs;
@@ -332395,6 +332396,7 @@ class GqlRequestChannel {
332395
332396
  });
332396
332397
  }
332397
332398
  shutdown() {
332399
+ this.abortController.abort();
332398
332400
  this.bufferedOutbox.flush();
332399
332401
  this.isShutdown = true;
332400
332402
  this.pollTimer.stop();
@@ -332422,7 +332424,7 @@ class GqlRequestChannel {
332422
332424
  };
332423
332425
  }
332424
332426
  async init() {
332425
- await this.touchRemoteChannel();
332427
+ const { ackOrdinal } = await this.touchRemoteChannel();
332426
332428
  const cursors = await this.cursorStorage.list(this.remoteName);
332427
332429
  const inboxOrdinal = cursors.find((c2) => c2.cursorType === "inbox")?.cursorOrdinal ?? 0;
332428
332430
  const outboxOrdinal = cursors.find((c2) => c2.cursorType === "outbox")?.cursorOrdinal ?? 0;
@@ -332430,6 +332432,9 @@ class GqlRequestChannel {
332430
332432
  this.outbox.init(outboxOrdinal);
332431
332433
  this.lastPersistedInboxOrdinal = inboxOrdinal;
332432
332434
  this.lastPersistedOutboxOrdinal = outboxOrdinal;
332435
+ if (ackOrdinal > 0) {
332436
+ trimMailboxFromAckOrdinal(this.outbox, ackOrdinal);
332437
+ }
332433
332438
  this.pollTimer.setDelegate(() => this.poll());
332434
332439
  this.pollTimer.start();
332435
332440
  this.transitionConnectionState("connected");
@@ -332499,34 +332504,57 @@ class GqlRequestChannel {
332499
332504
  this.deadLetter.add(...syncOps);
332500
332505
  }
332501
332506
  handlePollError(error48) {
332507
+ if (this.isShutdown)
332508
+ return true;
332502
332509
  const err2 = error48 instanceof Error ? error48 : new Error(String(error48));
332503
332510
  if (err2.message.includes("Channel not found")) {
332504
332511
  this.transitionConnectionState("reconnecting");
332505
332512
  this.recoverFromChannelNotFound();
332506
332513
  return true;
332507
332514
  }
332515
+ const classification = this.classifyError(err2);
332508
332516
  this.failureCount++;
332509
332517
  this.lastFailureUtcMs = Date.now();
332510
- this.transitionConnectionState("error");
332511
332518
  const channelError = new ChannelError("inbox", err2);
332512
- this.logger.error("GqlChannel poll error (@FailureCount): @Error", this.failureCount, channelError);
332519
+ this.logger.error("GqlChannel poll error (@FailureCount, @Classification): @Error", this.failureCount, classification, channelError);
332520
+ if (classification === "unrecoverable") {
332521
+ this.pollTimer.stop();
332522
+ this.transitionConnectionState("error");
332523
+ return true;
332524
+ }
332525
+ this.transitionConnectionState("error");
332513
332526
  return false;
332514
332527
  }
332515
332528
  recoverFromChannelNotFound() {
332516
332529
  this.logger.info("GqlChannel @ChannelId not found on remote, re-registering...", this.channelId);
332517
332530
  this.pollTimer.stop();
332518
- this.touchRemoteChannel().then(() => {
332519
- this.logger.info("GqlChannel @ChannelId re-registered successfully", this.channelId);
332520
- this.failureCount = 0;
332521
- this.pollTimer.start();
332522
- this.transitionConnectionState("connected");
332523
- }).catch((recoveryError) => {
332524
- this.logger.error("GqlChannel @ChannelId failed to re-register: @Error", this.channelId, recoveryError);
332525
- this.failureCount++;
332526
- this.lastFailureUtcMs = Date.now();
332527
- this.pollTimer.start();
332528
- this.transitionConnectionState("error");
332529
- });
332531
+ const attemptRecovery = (attempt) => {
332532
+ if (this.isShutdown)
332533
+ return;
332534
+ this.touchRemoteChannel().then(({ ackOrdinal }) => {
332535
+ this.logger.info("GqlChannel @ChannelId re-registered successfully", this.channelId);
332536
+ this.failureCount = 0;
332537
+ if (ackOrdinal > 0) {
332538
+ trimMailboxFromAckOrdinal(this.outbox, ackOrdinal);
332539
+ }
332540
+ this.pollTimer.start();
332541
+ this.transitionConnectionState("connected");
332542
+ }).catch((recoveryError) => {
332543
+ const err2 = recoveryError instanceof Error ? recoveryError : new Error(String(recoveryError));
332544
+ const classification = this.classifyError(err2);
332545
+ this.logger.error("GqlChannel @ChannelId recovery attempt @Attempt failed (@Classification): @Error", this.channelId, attempt, classification, recoveryError);
332546
+ this.failureCount++;
332547
+ this.lastFailureUtcMs = Date.now();
332548
+ if (classification === "unrecoverable") {
332549
+ this.transitionConnectionState("error");
332550
+ return;
332551
+ }
332552
+ this.transitionConnectionState("reconnecting");
332553
+ const delay = calculateBackoffDelay(attempt, this.config.retryBaseDelayMs, this.config.retryMaxDelayMs, Math.random());
332554
+ setTimeout(() => attemptRecovery(attempt + 1), delay);
332555
+ });
332556
+ };
332557
+ attemptRecovery(1);
332530
332558
  }
332531
332559
  async pollSyncEnvelopes(ackOrdinal, latestOrdinal) {
332532
332560
  const query = `
@@ -332624,7 +332652,10 @@ class GqlRequestChannel {
332624
332652
  } catch {}
332625
332653
  const mutation = `
332626
332654
  mutation TouchChannel($input: TouchChannelInput!) {
332627
- touchChannel(input: $input)
332655
+ touchChannel(input: $input) {
332656
+ success
332657
+ ackOrdinal
332658
+ }
332628
332659
  }
332629
332660
  `;
332630
332661
  const variables = {
@@ -332640,7 +332671,11 @@ class GqlRequestChannel {
332640
332671
  sinceTimestampUtcMs
332641
332672
  }
332642
332673
  };
332643
- await this.executeGraphQL(mutation, variables);
332674
+ const data = await this.executeGraphQL(mutation, variables);
332675
+ if (!data.touchChannel.success) {
332676
+ throw new GraphQLRequestError("touchChannel returned success=false", "graphql");
332677
+ }
332678
+ return { ackOrdinal: data.touchChannel.ackOrdinal };
332644
332679
  }
332645
332680
  attemptPush(syncOps) {
332646
332681
  this.pushSyncOperations(syncOps).then(() => {
@@ -332650,8 +332685,11 @@ class GqlRequestChannel {
332650
332685
  this.transitionConnectionState("connected");
332651
332686
  }
332652
332687
  }).catch((error48) => {
332688
+ if (this.isShutdown)
332689
+ return;
332653
332690
  const err2 = error48 instanceof Error ? error48 : new Error(String(error48));
332654
- if (this.isRecoverablePushError(err2)) {
332691
+ const classification = this.classifyError(err2);
332692
+ if (classification === "recoverable") {
332655
332693
  this.pushFailureCount++;
332656
332694
  this.pushBlocked = true;
332657
332695
  this.logger.error("GqlChannel push failed (attempt @FailureCount), will retry: @Error", this.pushFailureCount, err2);
@@ -332685,12 +332723,26 @@ class GqlRequestChannel {
332685
332723
  this.attemptPush([...allItems]);
332686
332724
  }, delay);
332687
332725
  }
332688
- isRecoverablePushError(error48) {
332689
- if (error48.message.startsWith("GraphQL errors:"))
332690
- return false;
332691
- if (error48.message === "GraphQL response missing data field")
332692
- return false;
332693
- return true;
332726
+ classifyError(error48) {
332727
+ if (!(error48 instanceof GraphQLRequestError)) {
332728
+ return "recoverable";
332729
+ }
332730
+ switch (error48.category) {
332731
+ case "network":
332732
+ return "recoverable";
332733
+ case "http": {
332734
+ if (error48.statusCode !== undefined && error48.statusCode >= 500) {
332735
+ return "recoverable";
332736
+ }
332737
+ return "unrecoverable";
332738
+ }
332739
+ case "parse":
332740
+ return "recoverable";
332741
+ case "graphql":
332742
+ return "unrecoverable";
332743
+ case "missing-data":
332744
+ return "unrecoverable";
332745
+ }
332694
332746
  }
332695
332747
  async pushSyncOperations(syncOps) {
332696
332748
  for (const syncOp of syncOps) {
@@ -332767,26 +332819,27 @@ class GqlRequestChannel {
332767
332819
  body: JSON.stringify({
332768
332820
  query,
332769
332821
  variables
332770
- })
332822
+ }),
332823
+ signal: this.abortController.signal
332771
332824
  });
332772
332825
  } catch (error48) {
332773
- throw new Error(`GraphQL request failed: ${error48 instanceof Error ? error48.message : String(error48)}`);
332826
+ throw new GraphQLRequestError(`GraphQL request failed: ${error48 instanceof Error ? error48.message : String(error48)}`, "network");
332774
332827
  }
332775
332828
  if (!response.ok) {
332776
- throw new Error(`GraphQL request failed: ${response.status} ${response.statusText}`);
332829
+ throw new GraphQLRequestError(`GraphQL request failed: ${response.status} ${response.statusText}`, "http", response.status);
332777
332830
  }
332778
332831
  let result;
332779
332832
  try {
332780
332833
  result = await response.json();
332781
332834
  } catch (error48) {
332782
- throw new Error(`Failed to parse GraphQL response: ${error48 instanceof Error ? error48.message : String(error48)}`);
332835
+ throw new GraphQLRequestError(`Failed to parse GraphQL response: ${error48 instanceof Error ? error48.message : String(error48)}`, "parse");
332783
332836
  }
332784
332837
  this.logger.verbose("GQL response @channelId @operation status=@status data=@data errors=@errors", this.channelId, operationName, response.status, JSON.stringify(result.data), result.errors ? JSON.stringify(result.errors) : "none");
332785
332838
  if (result.errors) {
332786
- throw new Error(`GraphQL errors: ${JSON.stringify(result.errors, null, 2)}`);
332839
+ throw new GraphQLRequestError(`GraphQL errors: ${JSON.stringify(result.errors, null, 2)}`, "graphql");
332787
332840
  }
332788
332841
  if (!result.data) {
332789
- throw new Error("GraphQL response missing data field");
332842
+ throw new GraphQLRequestError("GraphQL response missing data field", "missing-data");
332790
332843
  }
332791
332844
  return result.data;
332792
332845
  }
@@ -333337,6 +333390,7 @@ class SyncManager {
333337
333390
  remotes;
333338
333391
  awaiter;
333339
333392
  syncAwaiter;
333393
+ abortController = new AbortController;
333340
333394
  isShutdown;
333341
333395
  eventUnsubscribe;
333342
333396
  failedEventUnsubscribe;
@@ -333397,6 +333451,7 @@ class SyncManager {
333397
333451
  }
333398
333452
  shutdown() {
333399
333453
  this.isShutdown = true;
333454
+ this.abortController.abort();
333400
333455
  this.batchAggregator.clear();
333401
333456
  if (this.eventUnsubscribe) {
333402
333457
  this.eventUnsubscribe();
@@ -333589,6 +333644,8 @@ class SyncManager {
333589
333644
  return Array.from(this.remotes.values()).filter((remote) => remote.collectionId === collectionId);
333590
333645
  }
333591
333646
  async processCompleteBatch(batch) {
333647
+ if (this.isShutdown)
333648
+ return;
333592
333649
  const collectionIds = [
333593
333650
  ...new Set(Object.values(batch.collectionMemberships).flatMap((collections) => collections))
333594
333651
  ];
@@ -333632,8 +333689,10 @@ class SyncManager {
333632
333689
  const operations2 = syncOp.operations.map((op) => op.operation);
333633
333690
  let jobInfo;
333634
333691
  try {
333635
- jobInfo = await this.reactor.load(syncOp.documentId, syncOp.branch, operations2, undefined, { sourceRemote: remote.name });
333692
+ jobInfo = await this.reactor.load(syncOp.documentId, syncOp.branch, operations2, this.abortController.signal, { sourceRemote: remote.name });
333636
333693
  } catch (error48) {
333694
+ if (this.isShutdown)
333695
+ return;
333637
333696
  const err2 = error48 instanceof Error ? error48 : new Error(String(error48));
333638
333697
  this.logger.error("Failed to load operations from inbox (@remote, @documentId, @error)", remote.name, syncOp.documentId, err2.message);
333639
333698
  const channelError = new ChannelError("inbox", err2);
@@ -333644,8 +333703,10 @@ class SyncManager {
333644
333703
  }
333645
333704
  let completedJobInfo;
333646
333705
  try {
333647
- completedJobInfo = await this.awaiter.waitForJob(jobInfo.id);
333706
+ completedJobInfo = await this.awaiter.waitForJob(jobInfo.id, this.abortController.signal);
333648
333707
  } catch (error48) {
333708
+ if (this.isShutdown)
333709
+ return;
333649
333710
  const err2 = error48 instanceof Error ? error48 : new Error(String(error48));
333650
333711
  this.logger.error("Failed to wait for job completion (@remote, @documentId, @jobId, @error)", remote.name, syncOp.documentId, jobInfo.id, err2.message);
333651
333712
  const channelError = new ChannelError("inbox", err2);
@@ -333680,10 +333741,10 @@ class SyncManager {
333680
333741
  const request = { jobs };
333681
333742
  let result;
333682
333743
  try {
333683
- result = await this.reactor.loadBatch(request, undefined, {
333684
- sourceRemote
333685
- });
333744
+ result = await this.reactor.loadBatch(request, this.abortController.signal, { sourceRemote });
333686
333745
  } catch (error48) {
333746
+ if (this.isShutdown)
333747
+ return;
333687
333748
  for (const { remote, syncOp } of items) {
333688
333749
  const err2 = error48 instanceof Error ? error48 : new Error(String(error48));
333689
333750
  syncOp.failed(new ChannelError("inbox", err2));
@@ -333704,8 +333765,10 @@ class SyncManager {
333704
333765
  const jobInfo = result.jobs[syncOp.jobId];
333705
333766
  let completedJobInfo;
333706
333767
  try {
333707
- completedJobInfo = await this.awaiter.waitForJob(jobInfo.id);
333768
+ completedJobInfo = await this.awaiter.waitForJob(jobInfo.id, this.abortController.signal);
333708
333769
  } catch (error48) {
333770
+ if (this.isShutdown)
333771
+ continue;
333709
333772
  const err2 = error48 instanceof Error ? error48 : new Error(String(error48));
333710
333773
  syncOp.failed(new ChannelError("inbox", err2));
333711
333774
  remote.channel.deadLetter.add(syncOp);
@@ -333752,7 +333815,7 @@ class SyncManager {
333752
333815
  remote.channel.outbox.add(...syncOps);
333753
333816
  }
333754
333817
  async getOperationsForRemote(remote, ackOrdinal) {
333755
- const results = await this.operationIndex.find(remote.collectionId, ackOrdinal, { excludeSourceRemote: remote.name });
333818
+ const results = await this.operationIndex.find(remote.collectionId, ackOrdinal, { excludeSourceRemote: remote.name }, undefined, this.abortController.signal);
333756
333819
  let operations2 = results.results.map((entry) => toOperationWithContext(entry));
333757
333820
  const sinceTimestamp = remote.options.sinceTimestampUtcMs;
333758
333821
  if (sinceTimestamp && sinceTimestamp !== "0") {
@@ -333769,7 +333832,7 @@ var __defProp2, __export2 = (target, all) => {
333769
333832
  configurable: true,
333770
333833
  set: (newValue) => all[name4] = () => newValue
333771
333834
  });
333772
- }, byteToHex, rnds8, randomUUID, PropagationMode, RelationshipChangeType, JobStatus, DocumentChangeType, AlterTableNode2, IdentifierNode2, CreateIndexNode2, CreateSchemaNode2, ON_COMMIT_ACTIONS2, CreateTableNode2, SchemableIdentifierNode2, DropIndexNode2, DropSchemaNode2, DropTableNode2, AliasNode2, TableNode2, SelectModifierNode2, AndNode2, OrNode2, OnNode2, JoinNode2, BinaryOperationNode2, COMPARISON_OPERATORS2, ARITHMETIC_OPERATORS2, JSON_OPERATORS2, BINARY_OPERATORS2, UNARY_FILTER_OPERATORS2, UNARY_OPERATORS2, OPERATORS2, OperatorNode2, ColumnNode2, SelectAllNode2, ReferenceNode2, OrderByItemNode2, RawNode2, CollateNode2, LOGGED_MESSAGES2, JSONReferenceNode2, JSONOperatorChainNode2, JSONPathNode2, PrimitiveValueListNode2, ValueListNode2, ValueNode2, ParensNode2, OrderByNode2, PartitionByNode2, OverNode2, FromNode2, GroupByNode2, HavingNode2, InsertQueryNode2, ListNode2, UpdateQueryNode2, UsingNode2, DeleteQueryNode2, WhereNode2, ReturningNode2, ExplainNode2, WhenNode2, MergeQueryNode2, OutputNode2, QueryNode2, SelectQueryNode2, PartitionByItemNode2, SelectionNode2, ValuesNode2, DefaultInsertValueNode2, ColumnUpdateNode2, OnDuplicateKeyNode2, NoResultError2, OnConflictNode2, TopNode2, OrActionNode2, LimitNode2, CommonTableExpressionNameNode2, CommonTableExpressionNode2, WithNode2, CHARS2, ROOT_OPERATION_NODES2, SCHEMALESS_FUNCTIONS2, WithSchemaTransformer2, MatchedNode2, NO_PLUGINS2, NoopQueryExecutor2, NOOP_QUERY_EXECUTOR2, OffsetNode2, GroupByItemNode2, SetOperationNode2, FetchNode2, AggregateFunctionNode2, FunctionNode2, UnaryOperationNode2, CaseNode2, JSONPathLegNode2, TraversedJSONPathBuilder2, TupleNode2, SIMPLE_COLUMN_DATA_TYPES2, COLUMN_DATA_TYPE_REGEX2, DataTypeNode2, CastNode2, AddColumnNode2, ColumnDefinitionNode2, DropColumnNode2, RenameColumnNode2, CheckConstraintNode2, ON_MODIFY_FOREIGN_ACTIONS2, ReferencesNode2, GeneratedNode2, DefaultValueNode2, ModifyColumnNode2, ForeignKeyConstraintNode2, AddConstraintNode2, UniqueConstraintNode2, DropConstraintNode2, AlterColumnNode2, PrimaryKeyConstraintNode2, AddIndexNode2, RenameConstraintNode2, ImmediateValueTransformer2, CreateViewNode2, DropViewNode2, CreateTypeNode2, DropTypeNode2, RefreshMaterializedViewNode2, DefaultQueryExecutor2, ignoreError2 = () => {}, TRANSACTION_ACCESS_MODES2, TRANSACTION_ISOLATION_LEVELS2, logLevels2, LOG_LEVELS4, Kysely2, Transaction2, ControlledTransaction2, sql3, LIT_WRAP_REGEX2, DefaultQueryCompiler2, SELECT_MODIFIER_SQL2, SELECT_MODIFIER_PRIORITY2, JOIN_TYPE_SQL2, CompiledQuery2, DEFAULT_MIGRATION_TABLE2 = "kysely_migration", DEFAULT_MIGRATION_LOCK_TABLE2 = "kysely_migration_lock", DEFAULT_ALLOW_UNORDERED_MIGRATIONS2 = false, MIGRATION_LOCK_ID2 = "migration_lock", NO_MIGRATIONS2, MigrationResultSetError2, LOCK_ID3, DocumentDeletedError, DocumentNotFoundError, EventBusAggregateError, ReactorEventTypes, QueueEventTypes, ModuleNotFoundError, DuplicateModuleError, STRICT_ORDER_ACTION_TYPES, DRIVE_DOCUMENT_TYPE = "powerhouse/document-drive", ProcessorManager, exports_001_create_operation_table, exports_002_create_keyframe_table, exports_003_create_document_table, exports_004_create_document_relationship_table, exports_005_create_indexer_state_table, exports_006_create_document_snapshot_table, exports_007_create_slug_mapping_table, exports_008_create_view_state_table, exports_009_create_operation_index_tables, exports_010_create_sync_tables, exports_011_add_cursor_type_column, exports_012_add_source_remote_column, exports_013_create_sync_dead_letters_table, exports_014_create_processor_cursor_table, REACTOR_SCHEMA = "reactor", migrations, ChannelScheme, SyncOperationStatus, ChannelErrorSource, SyncEventTypes, MailboxAggregateError, ChannelError, SyncOperationAggregateError, syncOpCounter = 0, getLatestAppliedOrdinal = (syncOps) => {
333835
+ }, byteToHex, rnds8, randomUUID, PropagationMode, RelationshipChangeType, JobStatus, DocumentChangeType, AlterTableNode2, IdentifierNode2, CreateIndexNode2, CreateSchemaNode2, ON_COMMIT_ACTIONS2, CreateTableNode2, SchemableIdentifierNode2, DropIndexNode2, DropSchemaNode2, DropTableNode2, AliasNode2, TableNode2, SelectModifierNode2, AndNode2, OrNode2, OnNode2, JoinNode2, BinaryOperationNode2, COMPARISON_OPERATORS2, ARITHMETIC_OPERATORS2, JSON_OPERATORS2, BINARY_OPERATORS2, UNARY_FILTER_OPERATORS2, UNARY_OPERATORS2, OPERATORS2, OperatorNode2, ColumnNode2, SelectAllNode2, ReferenceNode2, OrderByItemNode2, RawNode2, CollateNode2, LOGGED_MESSAGES2, JSONReferenceNode2, JSONOperatorChainNode2, JSONPathNode2, PrimitiveValueListNode2, ValueListNode2, ValueNode2, ParensNode2, OrderByNode2, PartitionByNode2, OverNode2, FromNode2, GroupByNode2, HavingNode2, InsertQueryNode2, ListNode2, UpdateQueryNode2, UsingNode2, DeleteQueryNode2, WhereNode2, ReturningNode2, ExplainNode2, WhenNode2, MergeQueryNode2, OutputNode2, QueryNode2, SelectQueryNode2, PartitionByItemNode2, SelectionNode2, ValuesNode2, DefaultInsertValueNode2, ColumnUpdateNode2, OnDuplicateKeyNode2, NoResultError2, OnConflictNode2, TopNode2, OrActionNode2, LimitNode2, CommonTableExpressionNameNode2, CommonTableExpressionNode2, WithNode2, CHARS2, ROOT_OPERATION_NODES2, SCHEMALESS_FUNCTIONS2, WithSchemaTransformer2, MatchedNode2, NO_PLUGINS2, NoopQueryExecutor2, NOOP_QUERY_EXECUTOR2, OffsetNode2, GroupByItemNode2, SetOperationNode2, FetchNode2, AggregateFunctionNode2, FunctionNode2, UnaryOperationNode2, CaseNode2, JSONPathLegNode2, TraversedJSONPathBuilder2, TupleNode2, SIMPLE_COLUMN_DATA_TYPES2, COLUMN_DATA_TYPE_REGEX2, DataTypeNode2, CastNode2, AddColumnNode2, ColumnDefinitionNode2, DropColumnNode2, RenameColumnNode2, CheckConstraintNode2, ON_MODIFY_FOREIGN_ACTIONS2, ReferencesNode2, GeneratedNode2, DefaultValueNode2, ModifyColumnNode2, ForeignKeyConstraintNode2, AddConstraintNode2, UniqueConstraintNode2, DropConstraintNode2, AlterColumnNode2, PrimaryKeyConstraintNode2, AddIndexNode2, RenameConstraintNode2, ImmediateValueTransformer2, CreateViewNode2, DropViewNode2, CreateTypeNode2, DropTypeNode2, RefreshMaterializedViewNode2, DefaultQueryExecutor2, ignoreError2 = () => {}, TRANSACTION_ACCESS_MODES2, TRANSACTION_ISOLATION_LEVELS2, logLevels2, LOG_LEVELS4, Kysely2, Transaction2, ControlledTransaction2, sql3, LIT_WRAP_REGEX2, DefaultQueryCompiler2, SELECT_MODIFIER_SQL2, SELECT_MODIFIER_PRIORITY2, JOIN_TYPE_SQL2, CompiledQuery2, DEFAULT_MIGRATION_TABLE2 = "kysely_migration", DEFAULT_MIGRATION_LOCK_TABLE2 = "kysely_migration_lock", DEFAULT_ALLOW_UNORDERED_MIGRATIONS2 = false, MIGRATION_LOCK_ID2 = "migration_lock", NO_MIGRATIONS2, MigrationResultSetError2, LOCK_ID3, DocumentDeletedError, DocumentNotFoundError, EventBusAggregateError, ReactorEventTypes, QueueEventTypes, ModuleNotFoundError, DuplicateModuleError, STRICT_ORDER_ACTION_TYPES, DRIVE_DOCUMENT_TYPE = "powerhouse/document-drive", ProcessorManager, exports_001_create_operation_table, exports_002_create_keyframe_table, exports_003_create_document_table, exports_004_create_document_relationship_table, exports_005_create_indexer_state_table, exports_006_create_document_snapshot_table, exports_007_create_slug_mapping_table, exports_008_create_view_state_table, exports_009_create_operation_index_tables, exports_010_create_sync_tables, exports_011_add_cursor_type_column, exports_012_add_source_remote_column, exports_013_create_sync_dead_letters_table, exports_014_create_processor_cursor_table, REACTOR_SCHEMA = "reactor", migrations, ChannelScheme, SyncOperationStatus, ChannelErrorSource, SyncEventTypes, MailboxAggregateError, GraphQLRequestError, ChannelError, SyncOperationAggregateError, syncOpCounter = 0, getLatestAppliedOrdinal = (syncOps) => {
333773
333836
  let maxOrdinal = 0;
333774
333837
  for (const syncOp of syncOps) {
333775
333838
  if (syncOp.status === 2) {
@@ -338255,6 +338318,16 @@ var init_src6 = __esm(() => {
338255
338318
  this.errors = errors5;
338256
338319
  }
338257
338320
  };
338321
+ GraphQLRequestError = class GraphQLRequestError extends Error {
338322
+ statusCode;
338323
+ category;
338324
+ constructor(message, category, statusCode) {
338325
+ super(message);
338326
+ this.name = "GraphQLRequestError";
338327
+ this.category = category;
338328
+ this.statusCode = statusCode;
338329
+ }
338330
+ };
338258
338331
  ChannelError = class ChannelError extends Error {
338259
338332
  source;
338260
338333
  error;