@powerhousedao/reactor 6.0.0-dev.22 → 6.0.0-dev.220
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/index.d.ts +4504 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +9927 -0
- package/dist/index.js.map +1 -0
- package/package.json +20 -18
- package/dist/src/actions/index.d.ts +0 -24
- package/dist/src/actions/index.d.ts.map +0 -1
- package/dist/src/actions/index.js +0 -76
- package/dist/src/actions/index.js.map +0 -1
- package/dist/src/cache/buffer/ring-buffer.d.ts +0 -37
- package/dist/src/cache/buffer/ring-buffer.d.ts.map +0 -1
- package/dist/src/cache/buffer/ring-buffer.js +0 -69
- package/dist/src/cache/buffer/ring-buffer.js.map +0 -1
- package/dist/src/cache/document-meta-cache-types.d.ts +0 -114
- package/dist/src/cache/document-meta-cache-types.d.ts.map +0 -1
- package/dist/src/cache/document-meta-cache-types.js +0 -2
- package/dist/src/cache/document-meta-cache-types.js.map +0 -1
- package/dist/src/cache/document-meta-cache.d.ts +0 -30
- package/dist/src/cache/document-meta-cache.d.ts.map +0 -1
- package/dist/src/cache/document-meta-cache.js +0 -128
- package/dist/src/cache/document-meta-cache.js.map +0 -1
- package/dist/src/cache/index.d.ts +0 -3
- package/dist/src/cache/index.d.ts.map +0 -1
- package/dist/src/cache/index.js +0 -2
- package/dist/src/cache/index.js.map +0 -1
- package/dist/src/cache/kysely-operation-index.d.ts +0 -16
- package/dist/src/cache/kysely-operation-index.d.ts.map +0 -1
- package/dist/src/cache/kysely-operation-index.js +0 -265
- package/dist/src/cache/kysely-operation-index.js.map +0 -1
- package/dist/src/cache/kysely-write-cache.d.ts +0 -134
- package/dist/src/cache/kysely-write-cache.d.ts.map +0 -1
- package/dist/src/cache/kysely-write-cache.js +0 -388
- package/dist/src/cache/kysely-write-cache.js.map +0 -1
- package/dist/src/cache/lru/lru-tracker.d.ts +0 -15
- package/dist/src/cache/lru/lru-tracker.d.ts.map +0 -1
- package/dist/src/cache/lru/lru-tracker.js +0 -96
- package/dist/src/cache/lru/lru-tracker.js.map +0 -1
- package/dist/src/cache/operation-index-types.d.ts +0 -51
- package/dist/src/cache/operation-index-types.d.ts.map +0 -1
- package/dist/src/cache/operation-index-types.js +0 -4
- package/dist/src/cache/operation-index-types.js.map +0 -1
- package/dist/src/cache/write/interfaces.d.ts +0 -83
- package/dist/src/cache/write/interfaces.d.ts.map +0 -1
- package/dist/src/cache/write/interfaces.js +0 -2
- package/dist/src/cache/write/interfaces.js.map +0 -1
- package/dist/src/cache/write-cache-types.d.ts +0 -42
- package/dist/src/cache/write-cache-types.d.ts.map +0 -1
- package/dist/src/cache/write-cache-types.js +0 -2
- package/dist/src/cache/write-cache-types.js.map +0 -1
- package/dist/src/client/reactor-client.d.ts +0 -121
- package/dist/src/client/reactor-client.d.ts.map +0 -1
- package/dist/src/client/reactor-client.js +0 -425
- package/dist/src/client/reactor-client.js.map +0 -1
- package/dist/src/client/types.d.ts +0 -253
- package/dist/src/client/types.d.ts.map +0 -1
- package/dist/src/client/types.js +0 -14
- package/dist/src/client/types.js.map +0 -1
- package/dist/src/core/reactor-builder.d.ts +0 -47
- package/dist/src/core/reactor-builder.d.ts.map +0 -1
- package/dist/src/core/reactor-builder.js +0 -231
- package/dist/src/core/reactor-builder.js.map +0 -1
- package/dist/src/core/reactor-client-builder.d.ts +0 -49
- package/dist/src/core/reactor-client-builder.d.ts.map +0 -1
- package/dist/src/core/reactor-client-builder.js +0 -123
- package/dist/src/core/reactor-client-builder.js.map +0 -1
- package/dist/src/core/reactor.d.ts +0 -116
- package/dist/src/core/reactor.d.ts.map +0 -1
- package/dist/src/core/reactor.js +0 -988
- package/dist/src/core/reactor.js.map +0 -1
- package/dist/src/core/types.d.ts +0 -277
- package/dist/src/core/types.d.ts.map +0 -1
- package/dist/src/core/types.js +0 -2
- package/dist/src/core/types.js.map +0 -1
- package/dist/src/core/utils.d.ts +0 -59
- package/dist/src/core/utils.d.ts.map +0 -1
- package/dist/src/core/utils.js +0 -171
- package/dist/src/core/utils.js.map +0 -1
- package/dist/src/events/event-bus.d.ts +0 -8
- package/dist/src/events/event-bus.d.ts.map +0 -1
- package/dist/src/events/event-bus.js +0 -53
- package/dist/src/events/event-bus.js.map +0 -1
- package/dist/src/events/interfaces.d.ts +0 -27
- package/dist/src/events/interfaces.d.ts.map +0 -1
- package/dist/src/events/interfaces.js +0 -2
- package/dist/src/events/interfaces.js.map +0 -1
- package/dist/src/events/types.d.ts +0 -67
- package/dist/src/events/types.d.ts.map +0 -1
- package/dist/src/events/types.js +0 -28
- package/dist/src/events/types.js.map +0 -1
- package/dist/src/executor/interfaces.d.ts +0 -49
- package/dist/src/executor/interfaces.d.ts.map +0 -1
- package/dist/src/executor/interfaces.js +0 -2
- package/dist/src/executor/interfaces.js.map +0 -1
- package/dist/src/executor/simple-job-executor-manager.d.ts +0 -34
- package/dist/src/executor/simple-job-executor-manager.d.ts.map +0 -1
- package/dist/src/executor/simple-job-executor-manager.js +0 -233
- package/dist/src/executor/simple-job-executor-manager.js.map +0 -1
- package/dist/src/executor/simple-job-executor.d.ts +0 -80
- package/dist/src/executor/simple-job-executor.d.ts.map +0 -1
- package/dist/src/executor/simple-job-executor.js +0 -898
- package/dist/src/executor/simple-job-executor.js.map +0 -1
- package/dist/src/executor/types.d.ts +0 -93
- package/dist/src/executor/types.d.ts.map +0 -1
- package/dist/src/executor/types.js +0 -11
- package/dist/src/executor/types.js.map +0 -1
- package/dist/src/executor/util.d.ts +0 -74
- package/dist/src/executor/util.d.ts.map +0 -1
- package/dist/src/executor/util.js +0 -184
- package/dist/src/executor/util.js.map +0 -1
- package/dist/src/index.d.ts +0 -53
- package/dist/src/index.d.ts.map +0 -1
- package/dist/src/index.js +0 -62
- package/dist/src/index.js.map +0 -1
- package/dist/src/job-tracker/in-memory-job-tracker.d.ts +0 -25
- package/dist/src/job-tracker/in-memory-job-tracker.d.ts.map +0 -1
- package/dist/src/job-tracker/in-memory-job-tracker.js +0 -112
- package/dist/src/job-tracker/in-memory-job-tracker.js.map +0 -1
- package/dist/src/job-tracker/index.d.ts +0 -3
- package/dist/src/job-tracker/index.d.ts.map +0 -1
- package/dist/src/job-tracker/index.js +0 -2
- package/dist/src/job-tracker/index.js.map +0 -1
- package/dist/src/job-tracker/interfaces.d.ts +0 -39
- package/dist/src/job-tracker/interfaces.d.ts.map +0 -1
- package/dist/src/job-tracker/interfaces.js +0 -2
- package/dist/src/job-tracker/interfaces.js.map +0 -1
- package/dist/src/logging/console.d.ts +0 -23
- package/dist/src/logging/console.d.ts.map +0 -1
- package/dist/src/logging/console.js +0 -108
- package/dist/src/logging/console.js.map +0 -1
- package/dist/src/logging/types.d.ts +0 -12
- package/dist/src/logging/types.d.ts.map +0 -1
- package/dist/src/logging/types.js +0 -2
- package/dist/src/logging/types.js.map +0 -1
- package/dist/src/processors/index.d.ts +0 -3
- package/dist/src/processors/index.d.ts.map +0 -1
- package/dist/src/processors/index.js +0 -2
- package/dist/src/processors/index.js.map +0 -1
- package/dist/src/processors/processor-manager.d.ts +0 -38
- package/dist/src/processors/processor-manager.d.ts.map +0 -1
- package/dist/src/processors/processor-manager.js +0 -165
- package/dist/src/processors/processor-manager.js.map +0 -1
- package/dist/src/processors/types.d.ts +0 -63
- package/dist/src/processors/types.d.ts.map +0 -1
- package/dist/src/processors/types.js +0 -2
- package/dist/src/processors/types.js.map +0 -1
- package/dist/src/processors/utils.d.ts +0 -10
- package/dist/src/processors/utils.d.ts.map +0 -1
- package/dist/src/processors/utils.js +0 -59
- package/dist/src/processors/utils.js.map +0 -1
- package/dist/src/queue/interfaces.d.ts +0 -103
- package/dist/src/queue/interfaces.d.ts.map +0 -1
- package/dist/src/queue/interfaces.js +0 -2
- package/dist/src/queue/interfaces.js.map +0 -1
- package/dist/src/queue/job-execution-handle.d.ts +0 -25
- package/dist/src/queue/job-execution-handle.d.ts.map +0 -1
- package/dist/src/queue/job-execution-handle.js +0 -62
- package/dist/src/queue/job-execution-handle.js.map +0 -1
- package/dist/src/queue/queue.d.ts +0 -81
- package/dist/src/queue/queue.d.ts.map +0 -1
- package/dist/src/queue/queue.js +0 -384
- package/dist/src/queue/queue.js.map +0 -1
- package/dist/src/queue/types.d.ts +0 -73
- package/dist/src/queue/types.d.ts.map +0 -1
- package/dist/src/queue/types.js +0 -19
- package/dist/src/queue/types.js.map +0 -1
- package/dist/src/read-models/base-read-model.d.ts +0 -60
- package/dist/src/read-models/base-read-model.d.ts.map +0 -1
- package/dist/src/read-models/base-read-model.js +0 -143
- package/dist/src/read-models/base-read-model.js.map +0 -1
- package/dist/src/read-models/coordinator.d.ts +0 -39
- package/dist/src/read-models/coordinator.d.ts.map +0 -1
- package/dist/src/read-models/coordinator.js +0 -72
- package/dist/src/read-models/coordinator.js.map +0 -1
- package/dist/src/read-models/document-view.d.ts +0 -24
- package/dist/src/read-models/document-view.d.ts.map +0 -1
- package/dist/src/read-models/document-view.js +0 -377
- package/dist/src/read-models/document-view.js.map +0 -1
- package/dist/src/read-models/interfaces.d.ts +0 -29
- package/dist/src/read-models/interfaces.d.ts.map +0 -1
- package/dist/src/read-models/interfaces.js +0 -2
- package/dist/src/read-models/interfaces.js.map +0 -1
- package/dist/src/read-models/types.d.ts +0 -47
- package/dist/src/read-models/types.d.ts.map +0 -1
- package/dist/src/read-models/types.js +0 -2
- package/dist/src/read-models/types.js.map +0 -1
- package/dist/src/registry/implementation.d.ts +0 -70
- package/dist/src/registry/implementation.d.ts.map +0 -1
- package/dist/src/registry/implementation.js +0 -216
- package/dist/src/registry/implementation.js.map +0 -1
- package/dist/src/registry/index.d.ts +0 -3
- package/dist/src/registry/index.d.ts.map +0 -1
- package/dist/src/registry/index.js +0 -2
- package/dist/src/registry/index.js.map +0 -1
- package/dist/src/registry/interfaces.d.ts +0 -100
- package/dist/src/registry/interfaces.d.ts.map +0 -1
- package/dist/src/registry/interfaces.js +0 -2
- package/dist/src/registry/interfaces.js.map +0 -1
- package/dist/src/shared/awaiter.d.ts +0 -35
- package/dist/src/shared/awaiter.d.ts.map +0 -1
- package/dist/src/shared/awaiter.js +0 -123
- package/dist/src/shared/awaiter.js.map +0 -1
- package/dist/src/shared/consistency-tracker.d.ts +0 -48
- package/dist/src/shared/consistency-tracker.d.ts.map +0 -1
- package/dist/src/shared/consistency-tracker.js +0 -123
- package/dist/src/shared/consistency-tracker.js.map +0 -1
- package/dist/src/shared/drive-url.d.ts +0 -15
- package/dist/src/shared/drive-url.d.ts.map +0 -1
- package/dist/src/shared/drive-url.js +0 -17
- package/dist/src/shared/drive-url.js.map +0 -1
- package/dist/src/shared/errors.d.ts +0 -41
- package/dist/src/shared/errors.d.ts.map +0 -1
- package/dist/src/shared/errors.js +0 -75
- package/dist/src/shared/errors.js.map +0 -1
- package/dist/src/shared/factories.d.ts +0 -16
- package/dist/src/shared/factories.d.ts.map +0 -1
- package/dist/src/shared/factories.js +0 -33
- package/dist/src/shared/factories.js.map +0 -1
- package/dist/src/shared/types.d.ts +0 -136
- package/dist/src/shared/types.d.ts.map +0 -1
- package/dist/src/shared/types.js +0 -38
- package/dist/src/shared/types.js.map +0 -1
- package/dist/src/shared/utils.d.ts +0 -3
- package/dist/src/shared/utils.d.ts.map +0 -1
- package/dist/src/shared/utils.js +0 -8
- package/dist/src/shared/utils.js.map +0 -1
- package/dist/src/signer/passthrough-signer.d.ts +0 -12
- package/dist/src/signer/passthrough-signer.d.ts.map +0 -1
- package/dist/src/signer/passthrough-signer.js +0 -19
- package/dist/src/signer/passthrough-signer.js.map +0 -1
- package/dist/src/signer/types.d.ts +0 -17
- package/dist/src/signer/types.d.ts.map +0 -1
- package/dist/src/signer/types.js +0 -2
- package/dist/src/signer/types.js.map +0 -1
- package/dist/src/storage/consistency-aware-legacy-storage.d.ts +0 -33
- package/dist/src/storage/consistency-aware-legacy-storage.d.ts.map +0 -1
- package/dist/src/storage/consistency-aware-legacy-storage.js +0 -65
- package/dist/src/storage/consistency-aware-legacy-storage.js.map +0 -1
- package/dist/src/storage/index.d.ts +0 -4
- package/dist/src/storage/index.d.ts.map +0 -1
- package/dist/src/storage/index.js +0 -3
- package/dist/src/storage/index.js.map +0 -1
- package/dist/src/storage/interfaces.d.ts +0 -454
- package/dist/src/storage/interfaces.d.ts.map +0 -1
- package/dist/src/storage/interfaces.js +0 -19
- package/dist/src/storage/interfaces.js.map +0 -1
- package/dist/src/storage/kysely/document-indexer.d.ts +0 -28
- package/dist/src/storage/kysely/document-indexer.d.ts.map +0 -1
- package/dist/src/storage/kysely/document-indexer.js +0 -350
- package/dist/src/storage/kysely/document-indexer.js.map +0 -1
- package/dist/src/storage/kysely/keyframe-store.d.ts +0 -15
- package/dist/src/storage/kysely/keyframe-store.d.ts.map +0 -1
- package/dist/src/storage/kysely/keyframe-store.js +0 -64
- package/dist/src/storage/kysely/keyframe-store.js.map +0 -1
- package/dist/src/storage/kysely/store.d.ts +0 -16
- package/dist/src/storage/kysely/store.d.ts.map +0 -1
- package/dist/src/storage/kysely/store.js +0 -246
- package/dist/src/storage/kysely/store.js.map +0 -1
- package/dist/src/storage/kysely/sync-cursor-storage.d.ts +0 -13
- package/dist/src/storage/kysely/sync-cursor-storage.d.ts.map +0 -1
- package/dist/src/storage/kysely/sync-cursor-storage.js +0 -93
- package/dist/src/storage/kysely/sync-cursor-storage.js.map +0 -1
- package/dist/src/storage/kysely/sync-remote-storage.d.ts +0 -13
- package/dist/src/storage/kysely/sync-remote-storage.d.ts.map +0 -1
- package/dist/src/storage/kysely/sync-remote-storage.js +0 -133
- package/dist/src/storage/kysely/sync-remote-storage.js.map +0 -1
- package/dist/src/storage/kysely/types.d.ts +0 -135
- package/dist/src/storage/kysely/types.d.ts.map +0 -1
- package/dist/src/storage/kysely/types.js +0 -2
- package/dist/src/storage/kysely/types.js.map +0 -1
- package/dist/src/storage/migrations/001_create_operation_table.d.ts +0 -3
- package/dist/src/storage/migrations/001_create_operation_table.d.ts.map +0 -1
- package/dist/src/storage/migrations/001_create_operation_table.js +0 -41
- package/dist/src/storage/migrations/001_create_operation_table.js.map +0 -1
- package/dist/src/storage/migrations/002_create_keyframe_table.d.ts +0 -3
- package/dist/src/storage/migrations/002_create_keyframe_table.d.ts.map +0 -1
- package/dist/src/storage/migrations/002_create_keyframe_table.js +0 -27
- package/dist/src/storage/migrations/002_create_keyframe_table.js.map +0 -1
- package/dist/src/storage/migrations/003_create_document_table.d.ts +0 -3
- package/dist/src/storage/migrations/003_create_document_table.d.ts.map +0 -1
- package/dist/src/storage/migrations/003_create_document_table.js +0 -10
- package/dist/src/storage/migrations/003_create_document_table.js.map +0 -1
- package/dist/src/storage/migrations/004_create_document_relationship_table.d.ts +0 -3
- package/dist/src/storage/migrations/004_create_document_relationship_table.d.ts.map +0 -1
- package/dist/src/storage/migrations/004_create_document_relationship_table.js +0 -35
- package/dist/src/storage/migrations/004_create_document_relationship_table.js.map +0 -1
- package/dist/src/storage/migrations/005_create_indexer_state_table.d.ts +0 -3
- package/dist/src/storage/migrations/005_create_indexer_state_table.d.ts.map +0 -1
- package/dist/src/storage/migrations/005_create_indexer_state_table.js +0 -10
- package/dist/src/storage/migrations/005_create_indexer_state_table.js.map +0 -1
- package/dist/src/storage/migrations/006_create_document_snapshot_table.d.ts +0 -3
- package/dist/src/storage/migrations/006_create_document_snapshot_table.d.ts.map +0 -1
- package/dist/src/storage/migrations/006_create_document_snapshot_table.js +0 -49
- package/dist/src/storage/migrations/006_create_document_snapshot_table.js.map +0 -1
- package/dist/src/storage/migrations/007_create_slug_mapping_table.d.ts +0 -3
- package/dist/src/storage/migrations/007_create_slug_mapping_table.d.ts.map +0 -1
- package/dist/src/storage/migrations/007_create_slug_mapping_table.js +0 -24
- package/dist/src/storage/migrations/007_create_slug_mapping_table.js.map +0 -1
- package/dist/src/storage/migrations/008_create_view_state_table.d.ts +0 -3
- package/dist/src/storage/migrations/008_create_view_state_table.d.ts.map +0 -1
- package/dist/src/storage/migrations/008_create_view_state_table.js +0 -10
- package/dist/src/storage/migrations/008_create_view_state_table.js.map +0 -1
- package/dist/src/storage/migrations/009_create_operation_index_tables.d.ts +0 -3
- package/dist/src/storage/migrations/009_create_operation_index_tables.d.ts.map +0 -1
- package/dist/src/storage/migrations/009_create_operation_index_tables.js +0 -50
- package/dist/src/storage/migrations/009_create_operation_index_tables.js.map +0 -1
- package/dist/src/storage/migrations/010_create_sync_tables.d.ts +0 -3
- package/dist/src/storage/migrations/010_create_sync_tables.d.ts.map +0 -1
- package/dist/src/storage/migrations/010_create_sync_tables.js +0 -43
- package/dist/src/storage/migrations/010_create_sync_tables.js.map +0 -1
- package/dist/src/storage/migrations/index.d.ts +0 -3
- package/dist/src/storage/migrations/index.d.ts.map +0 -1
- package/dist/src/storage/migrations/index.js +0 -3
- package/dist/src/storage/migrations/index.js.map +0 -1
- package/dist/src/storage/migrations/migrator.d.ts +0 -6
- package/dist/src/storage/migrations/migrator.d.ts.map +0 -1
- package/dist/src/storage/migrations/migrator.js +0 -78
- package/dist/src/storage/migrations/migrator.js.map +0 -1
- package/dist/src/storage/migrations/run-migrations.d.ts +0 -2
- package/dist/src/storage/migrations/run-migrations.d.ts.map +0 -1
- package/dist/src/storage/migrations/run-migrations.js +0 -58
- package/dist/src/storage/migrations/run-migrations.js.map +0 -1
- package/dist/src/storage/migrations/types.d.ts +0 -9
- package/dist/src/storage/migrations/types.d.ts.map +0 -1
- package/dist/src/storage/migrations/types.js +0 -2
- package/dist/src/storage/migrations/types.js.map +0 -1
- package/dist/src/storage/txn.d.ts +0 -15
- package/dist/src/storage/txn.d.ts.map +0 -1
- package/dist/src/storage/txn.js +0 -42
- package/dist/src/storage/txn.js.map +0 -1
- package/dist/src/subs/default-error-handler.d.ts +0 -13
- package/dist/src/subs/default-error-handler.d.ts.map +0 -1
- package/dist/src/subs/default-error-handler.js +0 -27
- package/dist/src/subs/default-error-handler.js.map +0 -1
- package/dist/src/subs/react-subscription-manager.d.ts +0 -45
- package/dist/src/subs/react-subscription-manager.d.ts.map +0 -1
- package/dist/src/subs/react-subscription-manager.js +0 -185
- package/dist/src/subs/react-subscription-manager.js.map +0 -1
- package/dist/src/subs/subscription-notification-read-model.d.ts +0 -17
- package/dist/src/subs/subscription-notification-read-model.d.ts.map +0 -1
- package/dist/src/subs/subscription-notification-read-model.js +0 -62
- package/dist/src/subs/subscription-notification-read-model.js.map +0 -1
- package/dist/src/subs/types.d.ts +0 -64
- package/dist/src/subs/types.d.ts.map +0 -1
- package/dist/src/subs/types.js +0 -2
- package/dist/src/subs/types.js.map +0 -1
- package/dist/src/sync/channels/composite-channel-factory.d.ts +0 -32
- package/dist/src/sync/channels/composite-channel-factory.d.ts.map +0 -1
- package/dist/src/sync/channels/composite-channel-factory.js +0 -88
- package/dist/src/sync/channels/composite-channel-factory.js.map +0 -1
- package/dist/src/sync/channels/gql-channel-factory.d.ts +0 -27
- package/dist/src/sync/channels/gql-channel-factory.d.ts.map +0 -1
- package/dist/src/sync/channels/gql-channel-factory.js +0 -77
- package/dist/src/sync/channels/gql-channel-factory.js.map +0 -1
- package/dist/src/sync/channels/gql-channel.d.ts +0 -120
- package/dist/src/sync/channels/gql-channel.d.ts.map +0 -1
- package/dist/src/sync/channels/gql-channel.js +0 -436
- package/dist/src/sync/channels/gql-channel.js.map +0 -1
- package/dist/src/sync/channels/index.d.ts +0 -6
- package/dist/src/sync/channels/index.d.ts.map +0 -1
- package/dist/src/sync/channels/index.js +0 -6
- package/dist/src/sync/channels/index.js.map +0 -1
- package/dist/src/sync/channels/polling-channel.d.ts +0 -39
- package/dist/src/sync/channels/polling-channel.d.ts.map +0 -1
- package/dist/src/sync/channels/polling-channel.js +0 -72
- package/dist/src/sync/channels/polling-channel.js.map +0 -1
- package/dist/src/sync/channels/utils.d.ts +0 -30
- package/dist/src/sync/channels/utils.d.ts.map +0 -1
- package/dist/src/sync/channels/utils.js +0 -96
- package/dist/src/sync/channels/utils.js.map +0 -1
- package/dist/src/sync/errors.d.ts +0 -10
- package/dist/src/sync/errors.d.ts.map +0 -1
- package/dist/src/sync/errors.js +0 -17
- package/dist/src/sync/errors.js.map +0 -1
- package/dist/src/sync/index.d.ts +0 -12
- package/dist/src/sync/index.d.ts.map +0 -1
- package/dist/src/sync/index.js +0 -9
- package/dist/src/sync/index.js.map +0 -1
- package/dist/src/sync/interfaces.d.ts +0 -182
- package/dist/src/sync/interfaces.d.ts.map +0 -1
- package/dist/src/sync/interfaces.js +0 -2
- package/dist/src/sync/interfaces.js.map +0 -1
- package/dist/src/sync/mailbox.d.ts +0 -21
- package/dist/src/sync/mailbox.d.ts.map +0 -1
- package/dist/src/sync/mailbox.js +0 -59
- package/dist/src/sync/mailbox.js.map +0 -1
- package/dist/src/sync/sync-builder.d.ts +0 -19
- package/dist/src/sync/sync-builder.d.ts.map +0 -1
- package/dist/src/sync/sync-builder.js +0 -39
- package/dist/src/sync/sync-builder.js.map +0 -1
- package/dist/src/sync/sync-manager.d.ts +0 -37
- package/dist/src/sync/sync-manager.d.ts.map +0 -1
- package/dist/src/sync/sync-manager.js +0 -267
- package/dist/src/sync/sync-manager.js.map +0 -1
- package/dist/src/sync/sync-operation.d.ts +0 -28
- package/dist/src/sync/sync-operation.d.ts.map +0 -1
- package/dist/src/sync/sync-operation.js +0 -63
- package/dist/src/sync/sync-operation.js.map +0 -1
- package/dist/src/sync/types.d.ts +0 -62
- package/dist/src/sync/types.d.ts.map +0 -1
- package/dist/src/sync/types.js +0 -16
- package/dist/src/sync/types.js.map +0 -1
- package/dist/src/sync/utils.d.ts +0 -36
- package/dist/src/sync/utils.d.ts.map +0 -1
- package/dist/src/sync/utils.js +0 -78
- package/dist/src/sync/utils.js.map +0 -1
- package/dist/src/utils/reshuffle.d.ts +0 -30
- package/dist/src/utils/reshuffle.d.ts.map +0 -1
- package/dist/src/utils/reshuffle.js +0 -47
- package/dist/src/utils/reshuffle.js.map +0 -1
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import { RelationshipChangeType } from "../shared/types.js";
|
|
2
|
-
/**
|
|
3
|
-
* A read model that notifies the subscription manager when operations are processed.
|
|
4
|
-
* This bridges the gap between operation processing and subscription callbacks.
|
|
5
|
-
*
|
|
6
|
-
* Must be processed AFTER other read models have completed and AFTER OPERATIONS_READY
|
|
7
|
-
* is emitted, so that reactor.get() returns fresh data when callbacks fire.
|
|
8
|
-
*/
|
|
9
|
-
export class SubscriptionNotificationReadModel {
|
|
10
|
-
subscriptionManager;
|
|
11
|
-
documentView;
|
|
12
|
-
constructor(subscriptionManager, documentView) {
|
|
13
|
-
this.subscriptionManager = subscriptionManager;
|
|
14
|
-
this.documentView = documentView;
|
|
15
|
-
}
|
|
16
|
-
async indexOperations(operations) {
|
|
17
|
-
if (operations.length === 0)
|
|
18
|
-
return;
|
|
19
|
-
const created = [];
|
|
20
|
-
const deleted = [];
|
|
21
|
-
const updatedIds = new Set();
|
|
22
|
-
const documentTypes = new Map();
|
|
23
|
-
const parentIds = new Map();
|
|
24
|
-
for (const item of operations) {
|
|
25
|
-
const { operation, context } = item;
|
|
26
|
-
const actionType = operation.action.type;
|
|
27
|
-
documentTypes.set(context.documentId, context.documentType);
|
|
28
|
-
if (actionType === "CREATE_DOCUMENT") {
|
|
29
|
-
created.push(context.documentId);
|
|
30
|
-
}
|
|
31
|
-
else if (actionType === "DELETE_DOCUMENT") {
|
|
32
|
-
const input = operation.action.input;
|
|
33
|
-
const deletedId = input.documentId ?? context.documentId;
|
|
34
|
-
deleted.push(deletedId);
|
|
35
|
-
}
|
|
36
|
-
else if (actionType === "ADD_RELATIONSHIP") {
|
|
37
|
-
const input = operation.action.input;
|
|
38
|
-
this.subscriptionManager.notifyRelationshipChanged(input.sourceId, input.targetId, RelationshipChangeType.Added, input.childType);
|
|
39
|
-
}
|
|
40
|
-
else if (actionType === "REMOVE_RELATIONSHIP") {
|
|
41
|
-
const input = operation.action.input;
|
|
42
|
-
this.subscriptionManager.notifyRelationshipChanged(input.sourceId, input.targetId, RelationshipChangeType.Removed, input.childType);
|
|
43
|
-
}
|
|
44
|
-
else {
|
|
45
|
-
if (!created.includes(context.documentId)) {
|
|
46
|
-
updatedIds.add(context.documentId);
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
if (created.length > 0) {
|
|
51
|
-
this.subscriptionManager.notifyDocumentsCreated(created, documentTypes, parentIds);
|
|
52
|
-
}
|
|
53
|
-
if (deleted.length > 0) {
|
|
54
|
-
this.subscriptionManager.notifyDocumentsDeleted(deleted, documentTypes, parentIds);
|
|
55
|
-
}
|
|
56
|
-
if (updatedIds.size > 0 && this.documentView) {
|
|
57
|
-
const documents = await Promise.all(Array.from(updatedIds).map((id) => this.documentView.get(id)));
|
|
58
|
-
this.subscriptionManager.notifyDocumentsUpdated(documents);
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
//# sourceMappingURL=subscription-notification-read-model.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"subscription-notification-read-model.js","sourceRoot":"","sources":["../../../src/subs/subscription-notification-read-model.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAO5D;;;;;;GAMG;AACH,MAAM,OAAO,iCAAiC;IAElC;IACA;IAFV,YACU,mBAA+C,EAC/C,YAA4B;QAD5B,wBAAmB,GAAnB,mBAAmB,CAA4B;QAC/C,iBAAY,GAAZ,YAAY,CAAgB;IACnC,CAAC;IAEJ,KAAK,CAAC,eAAe,CAAC,UAAkC;QACtD,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC;YAAE,OAAO;QAEpC,MAAM,OAAO,GAAa,EAAE,CAAC;QAC7B,MAAM,OAAO,GAAa,EAAE,CAAC;QAC7B,MAAM,UAAU,GAAG,IAAI,GAAG,EAAU,CAAC;QACrC,MAAM,aAAa,GAAG,IAAI,GAAG,EAAkB,CAAC;QAChD,MAAM,SAAS,GAAG,IAAI,GAAG,EAAyB,CAAC;QAEnD,KAAK,MAAM,IAAI,IAAI,UAAU,EAAE,CAAC;YAC9B,MAAM,EAAE,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AAC,UAAU,CAAC,CAAC;gBACrC,CAAC;YACH,CAAC;QACH,CAAC;QAED,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACvB,IAAI,CAAC,mBAAmB,CAAC,sBAAsB,CAC7C,OAAO,EACP,aAAa,EACb,SAAS,CACV,CAAC;QACJ,CAAC;QAED,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACvB,IAAI,CAAC,mBAAmB,CAAC,sBAAsB,CAC7C,OAAO,EACP,aAAa,EACb,SAAS,CACV,CAAC;QACJ,CAAC;QAED,IAAI,UAAU,CAAC,IAAI,GAAG,CAAC,IAAI,IAAI,CAAC,YAAY,EAAE,CAAC;YAC7C,MAAM,SAAS,GAAG,MAAM,OAAO,CAAC,GAAG,CACjC,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC,YAAa,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAC/D,CAAC;YACF,IAAI,CAAC,mBAAmB,CAAC,sBAAsB,CAAC,SAAS,CAAC,CAAC;QAC7D,CAAC;IACH,CAAC;CACF"}
|
package/dist/src/subs/types.d.ts
DELETED
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import type { PHDocument } from "document-model";
|
|
2
|
-
import type { PagedResults, RelationshipChangeType, SearchFilter, ViewFilter } from "../shared/types.js";
|
|
3
|
-
/**
|
|
4
|
-
* Error handler for subscription callback errors
|
|
5
|
-
*/
|
|
6
|
-
export interface ISubscriptionErrorHandler {
|
|
7
|
-
/**
|
|
8
|
-
* Called when a subscription callback throws an error
|
|
9
|
-
* @param error - The error that was thrown
|
|
10
|
-
* @param context - Context about which subscription failed
|
|
11
|
-
*/
|
|
12
|
-
handleError(error: unknown, context: SubscriptionErrorContext): void;
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* Context information about a subscription error
|
|
16
|
-
*/
|
|
17
|
-
export interface SubscriptionErrorContext {
|
|
18
|
-
/** The type of event that was being processed */
|
|
19
|
-
eventType: "created" | "deleted" | "updated" | "relationshipChanged";
|
|
20
|
-
/** The subscription ID that failed */
|
|
21
|
-
subscriptionId: string;
|
|
22
|
-
/** Optional additional data about the event */
|
|
23
|
-
eventData?: unknown;
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Interface for subscribing to document events in the reactor.
|
|
27
|
-
*/
|
|
28
|
-
export interface IReactorSubscriptionManager {
|
|
29
|
-
/**
|
|
30
|
-
* Subscribes to document creation events
|
|
31
|
-
*
|
|
32
|
-
* @param callback - Function called when documents are created
|
|
33
|
-
* @param search - Optional search filter to limit which documents trigger events
|
|
34
|
-
* @param view - Optional filter containing branch and scopes information
|
|
35
|
-
* @returns A function that unsubscribes from the events
|
|
36
|
-
*/
|
|
37
|
-
onDocumentCreated(callback: (result: PagedResults<string>) => void, search?: SearchFilter): () => void;
|
|
38
|
-
/**
|
|
39
|
-
* Subscribes to document deletion events
|
|
40
|
-
*
|
|
41
|
-
* @param callback - Function called when documents are deleted
|
|
42
|
-
* @param search - Optional search filter to limit which documents trigger events
|
|
43
|
-
* @returns A function that unsubscribes from the events
|
|
44
|
-
*/
|
|
45
|
-
onDocumentDeleted(callback: (documentIds: string[]) => void, search?: SearchFilter): () => void;
|
|
46
|
-
/**
|
|
47
|
-
* Subscribes to document state updates
|
|
48
|
-
*
|
|
49
|
-
* @param callback - Function called when documents are updated
|
|
50
|
-
* @param search - Optional search filter to limit which documents trigger events
|
|
51
|
-
* @param view - Optional filter containing branch and scopes information
|
|
52
|
-
* @returns A function that unsubscribes from the events
|
|
53
|
-
*/
|
|
54
|
-
onDocumentStateUpdated(callback: (result: PagedResults<PHDocument>) => void, search?: SearchFilter, view?: ViewFilter): () => void;
|
|
55
|
-
/**
|
|
56
|
-
* Subscribes to parent-child relationship change events
|
|
57
|
-
*
|
|
58
|
-
* @param callback - Function called when parent-child relationships change
|
|
59
|
-
* @param search - Optional search filter to limit which documents trigger events
|
|
60
|
-
* @returns A function that unsubscribes from the events
|
|
61
|
-
*/
|
|
62
|
-
onRelationshipChanged(callback: (parentId: string, childId: string, changeType: RelationshipChangeType) => void, search?: SearchFilter): () => void;
|
|
63
|
-
}
|
|
64
|
-
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/subs/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,KAAK,EACV,YAAY,EACZ,sBAAsB,EACtB,YAAY,EACZ,UAAU,EACX,MAAM,oBAAoB,CAAC;AAE5B;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACxC;;;;OAIG;IACH,WAAW,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,wBAAwB,GAAG,IAAI,CAAC;CACtE;AAED;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACvC,iDAAiD;IACjD,SAAS,EAAE,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,qBAAqB,CAAC;IACrE,sCAAsC;IACtC,cAAc,EAAE,MAAM,CAAC;IACvB,+CAA+C;IAC/C,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,2BAA2B;IAC1C;;;;;;;OAOG;IACH,iBAAiB,CACf,QAAQ,EAAE,CAAC,MAAM,EAAE,YAAY,CAAC,MAAM,CAAC,KAAK,IAAI,EAChD,MAAM,CAAC,EAAE,YAAY,GACpB,MAAM,IAAI,CAAC;IAEd;;;;;;OAMG;IACH,iBAAiB,CACf,QAAQ,EAAE,CAAC,WAAW,EAAE,MAAM,EAAE,KAAK,IAAI,EACzC,MAAM,CAAC,EAAE,YAAY,GACpB,MAAM,IAAI,CAAC;IAEd;;;;;;;OAOG;IACH,sBAAsB,CACpB,QAAQ,EAAE,CAAC,MAAM,EAAE,YAAY,CAAC,UAAU,CAAC,KAAK,IAAI,EACpD,MAAM,CAAC,EAAE,YAAY,EACrB,IAAI,CAAC,EAAE,UAAU,GAChB,MAAM,IAAI,CAAC;IAEd;;;;;;OAMG;IACH,qBAAqB,CACnB,QAAQ,EAAE,CACR,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,sBAAsB,KAC/B,IAAI,EACT,MAAM,CAAC,EAAE,YAAY,GACpB,MAAM,IAAI,CAAC;CACf"}
|
package/dist/src/subs/types.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/subs/types.ts"],"names":[],"mappings":""}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import type { IOperationIndex } from "../../cache/operation-index-types.js";
|
|
2
|
-
import type { ILogger } from "../../logging/types.js";
|
|
3
|
-
import type { ISyncCursorStorage } from "../../storage/interfaces.js";
|
|
4
|
-
import type { IChannel, IChannelFactory } from "../interfaces.js";
|
|
5
|
-
import type { ChannelConfig, RemoteFilter } from "../types.js";
|
|
6
|
-
/**
|
|
7
|
-
* Factory for creating channel instances of multiple types.
|
|
8
|
-
*
|
|
9
|
-
* Supports both "gql" channels for network-based synchronization and
|
|
10
|
-
* "internal" channels for in-process communication.
|
|
11
|
-
*/
|
|
12
|
-
export declare class CompositeChannelFactory implements IChannelFactory {
|
|
13
|
-
private readonly logger;
|
|
14
|
-
constructor(logger: ILogger);
|
|
15
|
-
/**
|
|
16
|
-
* Creates a new channel instance based on the configuration type.
|
|
17
|
-
*
|
|
18
|
-
* @param remoteId - Unique identifier for the remote
|
|
19
|
-
* @param remoteName - Human-readable name for the remote
|
|
20
|
-
* @param config - Channel configuration including type and parameters
|
|
21
|
-
* @param cursorStorage - Storage for persisting synchronization cursors
|
|
22
|
-
* @param collectionId - Collection ID for filtering
|
|
23
|
-
* @param filter - Remote filter configuration
|
|
24
|
-
* @param operationIndex - Operation index for querying timestamps
|
|
25
|
-
* @returns A new channel instance
|
|
26
|
-
* @throws Error if config.type is not supported or required parameters are missing
|
|
27
|
-
*/
|
|
28
|
-
instance(remoteId: string, remoteName: string, config: ChannelConfig, cursorStorage: ISyncCursorStorage, collectionId: string, filter: RemoteFilter, operationIndex: IOperationIndex): IChannel;
|
|
29
|
-
private createGqlChannel;
|
|
30
|
-
private createPollingChannel;
|
|
31
|
-
}
|
|
32
|
-
//# sourceMappingURL=composite-channel-factory.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"composite-channel-factory.d.ts","sourceRoot":"","sources":["../../../../src/sync/channels/composite-channel-factory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;AAC5E,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AACtE,OAAO,KAAK,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAClE,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAI/D;;;;;GAKG;AACH,qBAAa,uBAAwB,YAAW,eAAe;IAC7D,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAU;gBAErB,MAAM,EAAE,OAAO;IAI3B;;;;;;;;;;;;OAYG;IACH,QAAQ,CACN,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,aAAa,EACrB,aAAa,EAAE,kBAAkB,EACjC,YAAY,EAAE,MAAM,EACpB,MAAM,EAAE,YAAY,EACpB,cAAc,EAAE,eAAe,GAC9B,QAAQ;IAsBX,OAAO,CAAC,gBAAgB;IA0ExB,OAAO,CAAC,oBAAoB;CAO7B"}
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
import { GqlChannel } from "./gql-channel.js";
|
|
2
|
-
import { PollingChannel } from "./polling-channel.js";
|
|
3
|
-
/**
|
|
4
|
-
* Factory for creating channel instances of multiple types.
|
|
5
|
-
*
|
|
6
|
-
* Supports both "gql" channels for network-based synchronization and
|
|
7
|
-
* "internal" channels for in-process communication.
|
|
8
|
-
*/
|
|
9
|
-
export class CompositeChannelFactory {
|
|
10
|
-
logger;
|
|
11
|
-
constructor(logger) {
|
|
12
|
-
this.logger = logger;
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* Creates a new channel instance based on the configuration type.
|
|
16
|
-
*
|
|
17
|
-
* @param remoteId - Unique identifier for the remote
|
|
18
|
-
* @param remoteName - Human-readable name for the remote
|
|
19
|
-
* @param config - Channel configuration including type and parameters
|
|
20
|
-
* @param cursorStorage - Storage for persisting synchronization cursors
|
|
21
|
-
* @param collectionId - Collection ID for filtering
|
|
22
|
-
* @param filter - Remote filter configuration
|
|
23
|
-
* @param operationIndex - Operation index for querying timestamps
|
|
24
|
-
* @returns A new channel instance
|
|
25
|
-
* @throws Error if config.type is not supported or required parameters are missing
|
|
26
|
-
*/
|
|
27
|
-
instance(remoteId, remoteName, config, cursorStorage, collectionId, filter, operationIndex) {
|
|
28
|
-
if (config.type === "gql") {
|
|
29
|
-
return this.createGqlChannel(remoteId, remoteName, config, cursorStorage, collectionId, filter, operationIndex);
|
|
30
|
-
}
|
|
31
|
-
if (config.type === "polling") {
|
|
32
|
-
return this.createPollingChannel(remoteId, remoteName, cursorStorage);
|
|
33
|
-
}
|
|
34
|
-
throw new Error(`CompositeChannelFactory does not support channel type "${config.type}"`);
|
|
35
|
-
}
|
|
36
|
-
createGqlChannel(remoteId, remoteName, config, cursorStorage, collectionId, filter, operationIndex) {
|
|
37
|
-
const url = config.parameters.url;
|
|
38
|
-
if (typeof url !== "string" || !url) {
|
|
39
|
-
throw new Error('CompositeChannelFactory requires "url" parameter for gql channels');
|
|
40
|
-
}
|
|
41
|
-
const gqlConfig = {
|
|
42
|
-
url,
|
|
43
|
-
collectionId,
|
|
44
|
-
filter,
|
|
45
|
-
};
|
|
46
|
-
if (config.parameters.authToken !== undefined) {
|
|
47
|
-
if (typeof config.parameters.authToken !== "string") {
|
|
48
|
-
throw new Error('"authToken" parameter must be a string');
|
|
49
|
-
}
|
|
50
|
-
gqlConfig.authToken = config.parameters.authToken;
|
|
51
|
-
}
|
|
52
|
-
if (config.parameters.pollIntervalMs !== undefined) {
|
|
53
|
-
if (typeof config.parameters.pollIntervalMs !== "number") {
|
|
54
|
-
throw new Error('"pollIntervalMs" parameter must be a number');
|
|
55
|
-
}
|
|
56
|
-
gqlConfig.pollIntervalMs = config.parameters.pollIntervalMs;
|
|
57
|
-
}
|
|
58
|
-
if (config.parameters.retryBaseDelayMs !== undefined) {
|
|
59
|
-
if (typeof config.parameters.retryBaseDelayMs !== "number") {
|
|
60
|
-
throw new Error('"retryBaseDelayMs" parameter must be a number');
|
|
61
|
-
}
|
|
62
|
-
gqlConfig.retryBaseDelayMs = config.parameters.retryBaseDelayMs;
|
|
63
|
-
}
|
|
64
|
-
if (config.parameters.retryMaxDelayMs !== undefined) {
|
|
65
|
-
if (typeof config.parameters.retryMaxDelayMs !== "number") {
|
|
66
|
-
throw new Error('"retryMaxDelayMs" parameter must be a number');
|
|
67
|
-
}
|
|
68
|
-
gqlConfig.retryMaxDelayMs = config.parameters.retryMaxDelayMs;
|
|
69
|
-
}
|
|
70
|
-
if (config.parameters.maxFailures !== undefined) {
|
|
71
|
-
if (typeof config.parameters.maxFailures !== "number") {
|
|
72
|
-
throw new Error('"maxFailures" parameter must be a number');
|
|
73
|
-
}
|
|
74
|
-
gqlConfig.maxFailures = config.parameters.maxFailures;
|
|
75
|
-
}
|
|
76
|
-
if (config.parameters.fetchFn !== undefined) {
|
|
77
|
-
if (typeof config.parameters.fetchFn !== "function") {
|
|
78
|
-
throw new Error('"fetchFn" parameter must be a function');
|
|
79
|
-
}
|
|
80
|
-
gqlConfig.fetchFn = config.parameters.fetchFn;
|
|
81
|
-
}
|
|
82
|
-
return new GqlChannel(this.logger, remoteId, remoteName, cursorStorage, gqlConfig, operationIndex);
|
|
83
|
-
}
|
|
84
|
-
createPollingChannel(remoteId, remoteName, cursorStorage) {
|
|
85
|
-
return new PollingChannel(remoteId, remoteName, cursorStorage);
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
//# sourceMappingURL=composite-channel-factory.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"composite-channel-factory.js","sourceRoot":"","sources":["../../../../src/sync/channels/composite-channel-factory.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,UAAU,EAAyB,MAAM,kBAAkB,CAAC;AACrE,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD;;;;;GAKG;AACH,MAAM,OAAO,uBAAuB;IACjB,MAAM,CAAU;IAEjC,YAAY,MAAe;QACzB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED;;;;;;;;;;;;OAYG;IACH,QAAQ,CACN,QAAgB,EAChB,UAAkB,EAClB,MAAqB,EACrB,aAAiC,EACjC,YAAoB,EACpB,MAAoB,EACpB,cAA+B;QAE/B,IAAI,MAAM,CAAC,IAAI,KAAK,KAAK,EAAE,CAAC;YAC1B,OAAO,IAAI,CAAC,gBAAgB,CAC1B,QAAQ,EACR,UAAU,EACV,MAAM,EACN,aAAa,EACb,YAAY,EACZ,MAAM,EACN,cAAc,CACf,CAAC;QACJ,CAAC;QAED,IAAI,MAAM,CAAC,IAAI,KAAK,SAAS,EAAE,CAAC;YAC9B,OAAO,IAAI,CAAC,oBAAoB,CAAC,QAAQ,EAAE,UAAU,EAAE,aAAa,CAAC,CAAC;QACxE,CAAC;QAED,MAAM,IAAI,KAAK,CACb,0DAA0D,MAAM,CAAC,IAAI,GAAG,CACzE,CAAC;IACJ,CAAC;IAEO,gBAAgB,CACtB,QAAgB,EAChB,UAAkB,EAClB,MAAqB,EACrB,aAAiC,EACjC,YAAoB,EACpB,MAAoB,EACpB,cAA+B;Q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AAQ,EAAE,CAAC;gBAC1D,MAAM,IAAI,KAAK,CAAC,8CAA8C,CAAC,CAAC;YAClE,CAAC;YACD,SAAS,CAAC,eAAe,GAAG,MAAM,CAAC,UAAU,CAAC,eAAe,CAAC;QAChE,CAAC;QAED,IAAI,MAAM,CAAC,UAAU,CAAC,WAAW,KAAK,SAAS,EAAE,CAAC;YAChD,IAAI,OAAO,MAAM,CAAC,UAAU,CAAC,WAAW,KAAK,QAAQ,EAAE,CAAC;gBACtD,MAAM,IAAI,KAAK,CAAC,0CAA0C,CAAC,CAAC;YAC9D,CAAC;YACD,SAAS,CAAC,WAAW,GAAG,MAAM,CAAC,UAAU,CAAC,WAAW,CAAC;QACxD,CAAC;QAED,IAAI,MAAM,CAAC,UAAU,CAAC,OAAO,KAAK,SAAS,EAAE,CAAC;YAC5C,IAAI,OAAO,MAAM,CAAC,UAAU,CAAC,OAAO,KAAK,UAAU,EAAE,CAAC;gBACpD,MAAM,IAAI,KAAK,CAAC,wCAAwC,CAAC,CAAC;YAC5D,CAAC;YACD,SAAS,CAAC,OAAO,GAAG,MAAM,CAAC,UAAU,CAAC,OAAuB,CAAC;QAChE,CAAC;QAED,OAAO,IAAI,UAAU,CACnB,IAAI,CAAC,MAAM,EACX,QAAQ,EACR,UAAU,EACV,aAAa,EACb,SAAS,EACT,cAAc,CACf,CAAC;IACJ,CAAC;IAEO,oBAAoB,CAC1B,QAAgB,EAChB,UAAkB,EAClB,aAAiC;QAEjC,OAAO,IAAI,cAAc,CAAC,QAAQ,EAAE,UAAU,EAAE,aAAa,CAAC,CAAC;IACjE,CAAC;CACF"}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import type { IOperationIndex } from "../../cache/operation-index-types.js";
|
|
2
|
-
import type { ILogger } from "../../logging/types.js";
|
|
3
|
-
import type { ISyncCursorStorage } from "../../storage/interfaces.js";
|
|
4
|
-
import type { IChannel, IChannelFactory } from "../interfaces.js";
|
|
5
|
-
import type { ChannelConfig, RemoteFilter } from "../types.js";
|
|
6
|
-
/**
|
|
7
|
-
* Factory for creating GqlChannel instances.
|
|
8
|
-
*
|
|
9
|
-
* Extracts GraphQL-specific configuration from ChannelConfig.parameters and
|
|
10
|
-
* instantiates GqlChannel instances for network-based synchronization.
|
|
11
|
-
*/
|
|
12
|
-
export declare class GqlChannelFactory implements IChannelFactory {
|
|
13
|
-
private readonly logger;
|
|
14
|
-
constructor(logger: ILogger);
|
|
15
|
-
/**
|
|
16
|
-
* Creates a new GqlChannel instance with the given configuration.
|
|
17
|
-
* See GqlChannelConfig for the expected parameters.
|
|
18
|
-
*
|
|
19
|
-
* @param config - Channel configuration including type and parameters
|
|
20
|
-
* @param cursorStorage - Storage for persisting synchronization cursors
|
|
21
|
-
* @param operationIndex - Operation index for querying timestamps
|
|
22
|
-
* @returns A new GqlChannel instance
|
|
23
|
-
* @throws Error if config.type is not "gql" or required parameters are missing
|
|
24
|
-
*/
|
|
25
|
-
instance(remoteId: string, remoteName: string, config: ChannelConfig, cursorStorage: ISyncCursorStorage, collectionId: string, filter: RemoteFilter, operationIndex: IOperationIndex): IChannel;
|
|
26
|
-
}
|
|
27
|
-
//# sourceMappingURL=gql-channel-factory.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"gql-channel-factory.d.ts","sourceRoot":"","sources":["../../../../src/sync/channels/gql-channel-factory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;AAC5E,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AACtE,OAAO,KAAK,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAClE,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAG/D;;;;;GAKG;AACH,qBAAa,iBAAkB,YAAW,eAAe;IACvD,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAU;gBAErB,MAAM,EAAE,OAAO;IAI3B;;;;;;;;;OASG;IACH,QAAQ,CACN,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,aAAa,EACrB,aAAa,EAAE,kBAAkB,EACjC,YAAY,EAAE,MAAM,EACpB,MAAM,EAAE,YAAY,EACpB,cAAc,EAAE,eAAe,GAC9B,QAAQ;CAyEZ"}
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
import { GqlChannel } from "./gql-channel.js";
|
|
2
|
-
/**
|
|
3
|
-
* Factory for creating GqlChannel instances.
|
|
4
|
-
*
|
|
5
|
-
* Extracts GraphQL-specific configuration from ChannelConfig.parameters and
|
|
6
|
-
* instantiates GqlChannel instances for network-based synchronization.
|
|
7
|
-
*/
|
|
8
|
-
export class GqlChannelFactory {
|
|
9
|
-
logger;
|
|
10
|
-
constructor(logger) {
|
|
11
|
-
this.logger = logger;
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* Creates a new GqlChannel instance with the given configuration.
|
|
15
|
-
* See GqlChannelConfig for the expected parameters.
|
|
16
|
-
*
|
|
17
|
-
* @param config - Channel configuration including type and parameters
|
|
18
|
-
* @param cursorStorage - Storage for persisting synchronization cursors
|
|
19
|
-
* @param operationIndex - Operation index for querying timestamps
|
|
20
|
-
* @returns A new GqlChannel instance
|
|
21
|
-
* @throws Error if config.type is not "gql" or required parameters are missing
|
|
22
|
-
*/
|
|
23
|
-
instance(remoteId, remoteName, config, cursorStorage, collectionId, filter, operationIndex) {
|
|
24
|
-
if (config.type !== "gql") {
|
|
25
|
-
throw new Error(`GqlChannelFactory can only create channels of type "gql", got "${config.type}"`);
|
|
26
|
-
}
|
|
27
|
-
// Extract and validate required parameters
|
|
28
|
-
const url = config.parameters.url;
|
|
29
|
-
if (typeof url !== "string" || !url) {
|
|
30
|
-
throw new Error('GqlChannelFactory requires "url" parameter in config.parameters');
|
|
31
|
-
}
|
|
32
|
-
// Extract optional parameters with validation
|
|
33
|
-
const gqlConfig = {
|
|
34
|
-
url,
|
|
35
|
-
collectionId,
|
|
36
|
-
filter,
|
|
37
|
-
};
|
|
38
|
-
if (config.parameters.authToken !== undefined) {
|
|
39
|
-
if (typeof config.parameters.authToken !== "string") {
|
|
40
|
-
throw new Error('"authToken" parameter must be a string');
|
|
41
|
-
}
|
|
42
|
-
gqlConfig.authToken = config.parameters.authToken;
|
|
43
|
-
}
|
|
44
|
-
if (config.parameters.pollIntervalMs !== undefined) {
|
|
45
|
-
if (typeof config.parameters.pollIntervalMs !== "number") {
|
|
46
|
-
throw new Error('"pollIntervalMs" parameter must be a number');
|
|
47
|
-
}
|
|
48
|
-
gqlConfig.pollIntervalMs = config.parameters.pollIntervalMs;
|
|
49
|
-
}
|
|
50
|
-
if (config.parameters.retryBaseDelayMs !== undefined) {
|
|
51
|
-
if (typeof config.parameters.retryBaseDelayMs !== "number") {
|
|
52
|
-
throw new Error('"retryBaseDelayMs" parameter must be a number');
|
|
53
|
-
}
|
|
54
|
-
gqlConfig.retryBaseDelayMs = config.parameters.retryBaseDelayMs;
|
|
55
|
-
}
|
|
56
|
-
if (config.parameters.retryMaxDelayMs !== undefined) {
|
|
57
|
-
if (typeof config.parameters.retryMaxDelayMs !== "number") {
|
|
58
|
-
throw new Error('"retryMaxDelayMs" parameter must be a number');
|
|
59
|
-
}
|
|
60
|
-
gqlConfig.retryMaxDelayMs = config.parameters.retryMaxDelayMs;
|
|
61
|
-
}
|
|
62
|
-
if (config.parameters.maxFailures !== undefined) {
|
|
63
|
-
if (typeof config.parameters.maxFailures !== "number") {
|
|
64
|
-
throw new Error('"maxFailures" parameter must be a number');
|
|
65
|
-
}
|
|
66
|
-
gqlConfig.maxFailures = config.parameters.maxFailures;
|
|
67
|
-
}
|
|
68
|
-
if (config.parameters.fetchFn !== undefined) {
|
|
69
|
-
if (typeof config.parameters.fetchFn !== "function") {
|
|
70
|
-
throw new Error('"fetchFn" parameter must be a function');
|
|
71
|
-
}
|
|
72
|
-
gqlConfig.fetchFn = config.parameters.fetchFn;
|
|
73
|
-
}
|
|
74
|
-
return new GqlChannel(this.logger, remoteId, remoteName, cursorStorage, gqlConfig, operationIndex);
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
//# sourceMappingURL=gql-channel-factory.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"gql-channel-factory.js","sourceRoot":"","sources":["../../../../src/sync/channels/gql-channel-factory.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,UAAU,EAAyB,MAAM,kBAAkB,CAAC;AAErE;;;;;GAKG;AACH,MAAM,OAAO,iBAAiB;IACX,MAAM,CAAU;IAEjC,YAAY,MAAe;QACzB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED;;;;;;;;;OASG;IACH,QAAQ,CACN,QAAgB,EAChB,UAAkB,EAClB,MAAqB,EACrB,aAAiC,EACjC,YAAoB,EACpB,MAAoB,EACpB,cAA+B;QAE/B,IAAI,MAAM,CAAC,IAAI,KAAK,KAAK,EAAE,CAAC;YAC1B,MAAM,IAAI,KAAK,CACb,kEAAkE,MAAM,CAAC,IAAI,GAAG,CACjF,CAAC;QACJ,CAAC;QAED,2CAA2C;QAC3C,MAAM,GAAG,GAAG,MAAM,CAAC,UAAU,CAAC,GAAG,CAAC;QAClC,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,CAAC,GAAG,EAAE,CAAC;YACpC,MAAM,IAAI,KAAK,CACb,iEAAiE,CAClE,CAAC;QACJ,CAAC;QAED,8CAA8C;QAC9C,MAAM,SAAS,GAAqB;YAClC,GAAG;YACH,YAAY;YACZ,MAAM;SACP,CAAC;QAEF,IAAI,MAAM,CAAC,UAAU,CAAC,SAAS,KAAK,SAAS,EAAE,CAAC;YAC9C,IAAI,OAAO,MAAM,CAAC,UAAU,CAAC,SAAS,KAAK,QAAQ,EAAE,CAAC;gBACpD,MAAM,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AC,WAAW,CAAC;QACxD,CAAC;QAED,IAAI,MAAM,CAAC,UAAU,CAAC,OAAO,KAAK,SAAS,EAAE,CAAC;YAC5C,IAAI,OAAO,MAAM,CAAC,UAAU,CAAC,OAAO,KAAK,UAAU,EAAE,CAAC;gBACpD,MAAM,IAAI,KAAK,CAAC,wCAAwC,CAAC,CAAC;YAC5D,CAAC;YACD,SAAS,CAAC,OAAO,GAAG,MAAM,CAAC,UAAU,CAAC,OAAuB,CAAC;QAChE,CAAC;QAED,OAAO,IAAI,UAAU,CACnB,IAAI,CAAC,MAAM,EACX,QAAQ,EACR,UAAU,EACV,aAAa,EACb,SAAS,EACT,cAAc,CACf,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
import type { IOperationIndex } from "../../cache/operation-index-types.js";
|
|
2
|
-
import type { ILogger } from "../../logging/types.js";
|
|
3
|
-
import type { ISyncCursorStorage } from "../../storage/interfaces.js";
|
|
4
|
-
import type { IChannel } from "../interfaces.js";
|
|
5
|
-
import { Mailbox } from "../mailbox.js";
|
|
6
|
-
import type { SyncOperation } from "../sync-operation.js";
|
|
7
|
-
import type { RemoteFilter } from "../types.js";
|
|
8
|
-
/**
|
|
9
|
-
* Configuration parameters for GqlChannel
|
|
10
|
-
*/
|
|
11
|
-
export type GqlChannelConfig = {
|
|
12
|
-
/** The GraphQL endpoint URL */
|
|
13
|
-
url: string;
|
|
14
|
-
/** Authentication token for the remote */
|
|
15
|
-
authToken?: string;
|
|
16
|
-
/** Polling interval in milliseconds (default: 5000) */
|
|
17
|
-
pollIntervalMs?: number;
|
|
18
|
-
/** Base delay for exponential backoff retries in milliseconds (default: 1000) */
|
|
19
|
-
retryBaseDelayMs?: number;
|
|
20
|
-
/** Maximum delay for exponential backoff retries in milliseconds (default: 300000) */
|
|
21
|
-
retryMaxDelayMs?: number;
|
|
22
|
-
/** Maximum number of consecutive failures before marking as error (default: 5) */
|
|
23
|
-
maxFailures?: number;
|
|
24
|
-
/** Custom fetch function for testing (default: global fetch) */
|
|
25
|
-
fetchFn?: typeof fetch;
|
|
26
|
-
/** Collection ID to synchronize */
|
|
27
|
-
collectionId: string;
|
|
28
|
-
/** Filter to apply to operations */
|
|
29
|
-
filter: RemoteFilter;
|
|
30
|
-
};
|
|
31
|
-
/**
|
|
32
|
-
* GraphQL-based synchronization channel for network communication between reactors.
|
|
33
|
-
*/
|
|
34
|
-
export declare class GqlChannel implements IChannel {
|
|
35
|
-
private readonly logger;
|
|
36
|
-
private readonly operationIndex;
|
|
37
|
-
readonly inbox: Mailbox<SyncOperation>;
|
|
38
|
-
readonly outbox: Mailbox<SyncOperation>;
|
|
39
|
-
readonly deadLetter: Mailbox<SyncOperation>;
|
|
40
|
-
private readonly channelId;
|
|
41
|
-
private readonly remoteName;
|
|
42
|
-
private readonly cursorStorage;
|
|
43
|
-
private readonly config;
|
|
44
|
-
private isShutdown;
|
|
45
|
-
private pollTimer?;
|
|
46
|
-
private failureCount;
|
|
47
|
-
private lastSuccessUtcMs?;
|
|
48
|
-
private lastFailureUtcMs?;
|
|
49
|
-
constructor(logger: ILogger, channelId: string, remoteName: string, cursorStorage: ISyncCursorStorage, config: GqlChannelConfig, operationIndex: IOperationIndex);
|
|
50
|
-
/**
|
|
51
|
-
* Shuts down the channel and prevents further operations.
|
|
52
|
-
*/
|
|
53
|
-
shutdown(): void;
|
|
54
|
-
/**
|
|
55
|
-
* Initializes the channel by registering it on the remote server and starting polling.
|
|
56
|
-
*/
|
|
57
|
-
init(): Promise<void>;
|
|
58
|
-
/**
|
|
59
|
-
* Starts the polling loop to fetch operations from the remote.
|
|
60
|
-
*/
|
|
61
|
-
private startPolling;
|
|
62
|
-
/**
|
|
63
|
-
* Polls the remote for new sync envelopes.
|
|
64
|
-
*/
|
|
65
|
-
private poll;
|
|
66
|
-
/**
|
|
67
|
-
* Handles polling errors with exponential backoff.
|
|
68
|
-
*/
|
|
69
|
-
private handlePollError;
|
|
70
|
-
/**
|
|
71
|
-
* Recovers from a "Channel not found" error by re-registering and restarting polling.
|
|
72
|
-
*/
|
|
73
|
-
private recoverFromChannelNotFound;
|
|
74
|
-
/**
|
|
75
|
-
* Queries the remote GraphQL endpoint for sync envelopes.
|
|
76
|
-
*/
|
|
77
|
-
private pollSyncEnvelopes;
|
|
78
|
-
/**
|
|
79
|
-
* Registers or updates this channel on the remote server via GraphQL mutation.
|
|
80
|
-
*/
|
|
81
|
-
private touchRemoteChannel;
|
|
82
|
-
/**
|
|
83
|
-
* Handles sync operations added to the outbox by sending them to the remote.
|
|
84
|
-
*/
|
|
85
|
-
private handleOutboxAdded;
|
|
86
|
-
/**
|
|
87
|
-
* Pushes a sync operation to the remote via GraphQL mutation.
|
|
88
|
-
*/
|
|
89
|
-
private pushSyncOperation;
|
|
90
|
-
/**
|
|
91
|
-
* Serializes a SyncEnvelope for GraphQL transport.
|
|
92
|
-
*
|
|
93
|
-
* Signatures are serialized as comma-separated strings since GraphQL schema
|
|
94
|
-
* defines them as [String!]!. Extra context fields (resultingState, ordinal)
|
|
95
|
-
* are stripped since they are not defined in OperationContextInput.
|
|
96
|
-
*/
|
|
97
|
-
private serializeEnvelope;
|
|
98
|
-
/**
|
|
99
|
-
* Serializes an action for GraphQL transport, converting signature tuples to strings.
|
|
100
|
-
*/
|
|
101
|
-
private serializeAction;
|
|
102
|
-
/**
|
|
103
|
-
* Executes a GraphQL query or mutation against the remote endpoint.
|
|
104
|
-
*/
|
|
105
|
-
private executeGraphQL;
|
|
106
|
-
/**
|
|
107
|
-
* Updates the synchronization cursor for this channel's remote.
|
|
108
|
-
*/
|
|
109
|
-
updateCursor(cursorOrdinal: number): Promise<void>;
|
|
110
|
-
/**
|
|
111
|
-
* Gets the current health status of the channel.
|
|
112
|
-
*/
|
|
113
|
-
getHealth(): {
|
|
114
|
-
state: "idle" | "running" | "error";
|
|
115
|
-
lastSuccessUtcMs?: number;
|
|
116
|
-
lastFailureUtcMs?: number;
|
|
117
|
-
failureCount: number;
|
|
118
|
-
};
|
|
119
|
-
}
|
|
120
|
-
//# sourceMappingURL=gql-channel.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"gql-channel.d.ts","sourceRoot":"","sources":["../../../../src/sync/channels/gql-channel.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;AAC5E,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AAEtE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,KAAK,EAAgB,YAAY,EAAgB,MAAM,aAAa,CAAC;AAI5E;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC7B,+BAA+B;IAC/B,GAAG,EAAE,MAAM,CAAC;IACZ,0CAA0C;IAC1C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,uDAAuD;IACvD,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,iFAAiF;IACjF,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,sFAAsF;IACtF,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,kFAAkF;IAClF,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,gEAAgE;IAChE,OAAO,CAAC,EAAE,OAAO,KAAK,CAAC;IACvB,mCAAmC;IACnC,YAAY,EAAE,MAAM,CAAC;IACrB,oCAAoC;IACpC,MAAM,EAAE,YAAY,CAAC;CACtB,CAAC;AAEF;;GAEG;AACH,qBAAa,UAAW,YAAW,QAAQ;IAgBvC,OAAO,CAAC,QAAQ,CAAC,MAAM;IAKvB,OAAO,CAAC,QAAQ,CAAC,cAAc;IApBjC,QAAQ,CAAC,KAAK,EAAE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