@powerhousedao/reactor 6.0.0-dev.105 → 6.0.0-dev.106
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 +4306 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +9433 -0
- package/dist/index.js.map +1 -0
- package/package.json +16 -18
- package/dist/src/actions/index.d.ts +0 -24
- package/dist/src/actions/index.d.ts.map +0 -1
- package/dist/src/admin/document-integrity-service.d.ts +0 -17
- package/dist/src/admin/document-integrity-service.d.ts.map +0 -1
- package/dist/src/admin/types.d.ts +0 -30
- package/dist/src/admin/types.d.ts.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/collection-membership-cache.d.ts +0 -14
- package/dist/src/cache/collection-membership-cache.d.ts.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.d.ts +0 -31
- package/dist/src/cache/document-meta-cache.d.ts.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/kysely-operation-index.d.ts +0 -24
- package/dist/src/cache/kysely-operation-index.d.ts.map +0 -1
- package/dist/src/cache/kysely-write-cache.d.ts +0 -142
- package/dist/src/cache/kysely-write-cache.d.ts.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/operation-index-types.d.ts +0 -64
- package/dist/src/cache/operation-index-types.d.ts.map +0 -1
- package/dist/src/cache/write/interfaces.d.ts +0 -88
- package/dist/src/cache/write/interfaces.d.ts.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/client/reactor-client.d.ts +0 -121
- package/dist/src/client/reactor-client.d.ts.map +0 -1
- package/dist/src/client/types.d.ts +0 -260
- package/dist/src/client/types.d.ts.map +0 -1
- package/dist/src/core/reactor-builder.d.ts +0 -60
- package/dist/src/core/reactor-builder.d.ts.map +0 -1
- package/dist/src/core/reactor-client-builder.d.ts +0 -53
- package/dist/src/core/reactor-client-builder.d.ts.map +0 -1
- package/dist/src/core/reactor.d.ts +0 -56
- package/dist/src/core/reactor.d.ts.map +0 -1
- package/dist/src/core/types.d.ts +0 -312
- package/dist/src/core/types.d.ts.map +0 -1
- package/dist/src/core/utils.d.ts +0 -95
- package/dist/src/core/utils.d.ts.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/interfaces.d.ts +0 -27
- package/dist/src/events/interfaces.d.ts.map +0 -1
- package/dist/src/events/types.d.ts +0 -92
- package/dist/src/events/types.d.ts.map +0 -1
- package/dist/src/executor/document-action-handler.d.ts +0 -30
- package/dist/src/executor/document-action-handler.d.ts.map +0 -1
- package/dist/src/executor/execution-scope.d.ts +0 -44
- package/dist/src/executor/execution-scope.d.ts.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/signature-verifier.d.ts +0 -9
- package/dist/src/executor/signature-verifier.d.ts.map +0 -1
- package/dist/src/executor/simple-job-executor-manager.d.ts +0 -40
- package/dist/src/executor/simple-job-executor-manager.d.ts.map +0 -1
- package/dist/src/executor/simple-job-executor.d.ts +0 -42
- package/dist/src/executor/simple-job-executor.d.ts.map +0 -1
- package/dist/src/executor/types.d.ts +0 -91
- package/dist/src/executor/types.d.ts.map +0 -1
- package/dist/src/executor/util.d.ts +0 -84
- package/dist/src/executor/util.d.ts.map +0 -1
- package/dist/src/index.d.ts +0 -56
- package/dist/src/index.d.ts.map +0 -1
- package/dist/src/index.js +0 -20714
- package/dist/src/job-tracker/in-memory-job-tracker.d.ts +0 -26
- package/dist/src/job-tracker/in-memory-job-tracker.d.ts.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/interfaces.d.ts +0 -41
- package/dist/src/job-tracker/interfaces.d.ts.map +0 -1
- package/dist/src/logging/console.d.ts +0 -2
- package/dist/src/logging/console.d.ts.map +0 -1
- package/dist/src/logging/types.d.ts +0 -2
- package/dist/src/logging/types.d.ts.map +0 -1
- package/dist/src/processors/index.d.ts +0 -2
- package/dist/src/processors/index.d.ts.map +0 -1
- package/dist/src/processors/processor-manager.d.ts +0 -51
- package/dist/src/processors/processor-manager.d.ts.map +0 -1
- package/dist/src/processors/utils.d.ts +0 -11
- package/dist/src/processors/utils.d.ts.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/job-execution-handle.d.ts +0 -28
- package/dist/src/queue/job-execution-handle.d.ts.map +0 -1
- package/dist/src/queue/queue.d.ts +0 -110
- package/dist/src/queue/queue.d.ts.map +0 -1
- package/dist/src/queue/types.d.ts +0 -74
- package/dist/src/queue/types.d.ts.map +0 -1
- package/dist/src/read-models/base-read-model.d.ts +0 -62
- package/dist/src/read-models/base-read-model.d.ts.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/document-view.d.ts +0 -27
- package/dist/src/read-models/document-view.d.ts.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/types.d.ts +0 -63
- package/dist/src/read-models/types.d.ts.map +0 -1
- package/dist/src/registry/document-model-resolver.d.ts +0 -29
- package/dist/src/registry/document-model-resolver.d.ts.map +0 -1
- package/dist/src/registry/implementation.d.ts +0 -74
- package/dist/src/registry/implementation.d.ts.map +0 -1
- package/dist/src/registry/index.d.ts +0 -5
- package/dist/src/registry/index.d.ts.map +0 -1
- package/dist/src/registry/interfaces.d.ts +0 -108
- package/dist/src/registry/interfaces.d.ts.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/collect-all-pages.d.ts +0 -7
- package/dist/src/shared/collect-all-pages.d.ts.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/drive-url.d.ts +0 -15
- package/dist/src/shared/drive-url.d.ts.map +0 -1
- package/dist/src/shared/errors.d.ts +0 -50
- package/dist/src/shared/errors.d.ts.map +0 -1
- package/dist/src/shared/factories.d.ts +0 -20
- package/dist/src/shared/factories.d.ts.map +0 -1
- package/dist/src/shared/types.d.ts +0 -161
- package/dist/src/shared/types.d.ts.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/signer/passthrough-signer.d.ts +0 -12
- package/dist/src/signer/passthrough-signer.d.ts.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/storage/index.d.ts +0 -4
- package/dist/src/storage/index.d.ts.map +0 -1
- package/dist/src/storage/interfaces.d.ts +0 -574
- package/dist/src/storage/interfaces.d.ts.map +0 -1
- package/dist/src/storage/kysely/document-indexer.d.ts +0 -27
- package/dist/src/storage/kysely/document-indexer.d.ts.map +0 -1
- package/dist/src/storage/kysely/keyframe-store.d.ts +0 -24
- package/dist/src/storage/kysely/keyframe-store.d.ts.map +0 -1
- package/dist/src/storage/kysely/store.d.ts +0 -21
- package/dist/src/storage/kysely/store.d.ts.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-dead-letter-storage.d.ts +0 -18
- package/dist/src/storage/kysely/sync-dead-letter-storage.d.ts.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/types.d.ts +0 -157
- package/dist/src/storage/kysely/types.d.ts.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/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/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/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/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/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/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/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/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/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/011_add_cursor_type_column.d.ts +0 -3
- package/dist/src/storage/migrations/011_add_cursor_type_column.d.ts.map +0 -1
- package/dist/src/storage/migrations/012_add_source_remote_column.d.ts +0 -3
- package/dist/src/storage/migrations/012_add_source_remote_column.d.ts.map +0 -1
- package/dist/src/storage/migrations/013_create_sync_dead_letters_table.d.ts +0 -3
- package/dist/src/storage/migrations/013_create_sync_dead_letters_table.d.ts.map +0 -1
- package/dist/src/storage/migrations/014_create_processor_cursor_table.d.ts +0 -3
- package/dist/src/storage/migrations/014_create_processor_cursor_table.d.ts.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/migrator.d.ts +0 -6
- package/dist/src/storage/migrations/migrator.d.ts.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/types.d.ts +0 -9
- package/dist/src/storage/migrations/types.d.ts.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/subs/default-error-handler.d.ts +0 -13
- package/dist/src/subs/default-error-handler.d.ts.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/subscription-notification-read-model.d.ts +0 -18
- package/dist/src/subs/subscription-notification-read-model.d.ts.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/sync/batch-aggregator.d.ts +0 -25
- package/dist/src/sync/batch-aggregator.d.ts.map +0 -1
- package/dist/src/sync/buffered-mailbox.d.ts +0 -37
- package/dist/src/sync/buffered-mailbox.d.ts.map +0 -1
- package/dist/src/sync/channels/gql-req-channel.d.ts +0 -133
- package/dist/src/sync/channels/gql-req-channel.d.ts.map +0 -1
- package/dist/src/sync/channels/gql-request-channel-factory.d.ts +0 -32
- package/dist/src/sync/channels/gql-request-channel-factory.d.ts.map +0 -1
- package/dist/src/sync/channels/gql-res-channel.d.ts +0 -31
- package/dist/src/sync/channels/gql-res-channel.d.ts.map +0 -1
- package/dist/src/sync/channels/gql-response-channel-factory.d.ts +0 -13
- package/dist/src/sync/channels/gql-response-channel-factory.d.ts.map +0 -1
- package/dist/src/sync/channels/index.d.ts +0 -8
- package/dist/src/sync/channels/index.d.ts.map +0 -1
- package/dist/src/sync/channels/interval-poll-timer.d.ts +0 -40
- package/dist/src/sync/channels/interval-poll-timer.d.ts.map +0 -1
- package/dist/src/sync/channels/poll-timer.d.ts +0 -14
- package/dist/src/sync/channels/poll-timer.d.ts.map +0 -1
- package/dist/src/sync/channels/utils.d.ts +0 -44
- package/dist/src/sync/channels/utils.d.ts.map +0 -1
- package/dist/src/sync/errors.d.ts +0 -16
- package/dist/src/sync/errors.d.ts.map +0 -1
- package/dist/src/sync/index.d.ts +0 -16
- package/dist/src/sync/index.d.ts.map +0 -1
- package/dist/src/sync/interfaces.d.ts +0 -203
- package/dist/src/sync/interfaces.d.ts.map +0 -1
- package/dist/src/sync/mailbox.d.ts +0 -62
- package/dist/src/sync/mailbox.d.ts.map +0 -1
- package/dist/src/sync/sync-awaiter.d.ts +0 -34
- package/dist/src/sync/sync-awaiter.d.ts.map +0 -1
- package/dist/src/sync/sync-builder.d.ts +0 -23
- package/dist/src/sync/sync-builder.d.ts.map +0 -1
- package/dist/src/sync/sync-manager.d.ts +0 -51
- package/dist/src/sync/sync-manager.d.ts.map +0 -1
- package/dist/src/sync/sync-operation.d.ts +0 -30
- package/dist/src/sync/sync-operation.d.ts.map +0 -1
- package/dist/src/sync/sync-status-tracker.d.ts +0 -31
- package/dist/src/sync/sync-status-tracker.d.ts.map +0 -1
- package/dist/src/sync/types.d.ts +0 -165
- package/dist/src/sync/types.d.ts.map +0 -1
- package/dist/src/sync/utils.d.ts +0 -71
- package/dist/src/sync/utils.d.ts.map +0 -1
- package/dist/src/utils/reshuffle.d.ts +0 -47
- package/dist/src/utils/reshuffle.d.ts.map +0 -1
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
import type { OperationWithContext } from "@powerhousedao/shared/document-model";
|
|
2
|
-
import type { Job } from "../queue/types.js";
|
|
3
|
-
import type { JobMeta } from "../shared/types.js";
|
|
4
|
-
/**
|
|
5
|
-
* Describes a function to unsubscribe from an event.
|
|
6
|
-
*/
|
|
7
|
-
export type Unsubscribe = () => void;
|
|
8
|
-
/**
|
|
9
|
-
* A subscriber is a function that is called when an event is emitted.
|
|
10
|
-
*
|
|
11
|
-
* It is passed the event type and the data.
|
|
12
|
-
* It can return a promise or a value.
|
|
13
|
-
* If it returns a promise, the event bus will wait for the promise to resolve before calling the next subscriber.
|
|
14
|
-
* If it throws an error, the event bus will reject with an aggregate error of all errors.
|
|
15
|
-
*
|
|
16
|
-
* @param type - The type of event to emit.
|
|
17
|
-
* @param data - The data to pass to the subscriber.
|
|
18
|
-
*/
|
|
19
|
-
export type Subscriber = (type: number, data: any) => void | Promise<void>;
|
|
20
|
-
/**
|
|
21
|
-
* Custom error class that aggregates multiple errors from event subscribers.
|
|
22
|
-
*/
|
|
23
|
-
export declare class EventBusAggregateError extends Error {
|
|
24
|
-
readonly errors: any[];
|
|
25
|
-
constructor(errors: unknown[]);
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* Event types for reactor lifecycle events.
|
|
29
|
-
*/
|
|
30
|
-
export declare const ReactorEventTypes: {
|
|
31
|
-
readonly JOB_PENDING: 10001;
|
|
32
|
-
readonly JOB_RUNNING: 10002;
|
|
33
|
-
readonly JOB_WRITE_READY: 10003;
|
|
34
|
-
readonly JOB_READ_READY: 10004;
|
|
35
|
-
readonly JOB_FAILED: 10005;
|
|
36
|
-
};
|
|
37
|
-
/**
|
|
38
|
-
* Event emitted when a job is registered and waiting to be executed.
|
|
39
|
-
*/
|
|
40
|
-
export type JobPendingEvent = {
|
|
41
|
-
jobId: string;
|
|
42
|
-
jobMeta: JobMeta;
|
|
43
|
-
};
|
|
44
|
-
/**
|
|
45
|
-
* Event emitted when a job starts executing.
|
|
46
|
-
*/
|
|
47
|
-
export type JobRunningEvent = {
|
|
48
|
-
jobId: string;
|
|
49
|
-
jobMeta: JobMeta;
|
|
50
|
-
};
|
|
51
|
-
/**
|
|
52
|
-
* Event emitted when operations are written to IOperationStore.
|
|
53
|
-
* Contains the operations directly to avoid round-trip queries.
|
|
54
|
-
*/
|
|
55
|
-
export type JobWriteReadyEvent = {
|
|
56
|
-
jobId: string;
|
|
57
|
-
operations: OperationWithContext[];
|
|
58
|
-
jobMeta: JobMeta;
|
|
59
|
-
/**
|
|
60
|
-
* Maps documentId to the collection IDs it belongs to.
|
|
61
|
-
* Used by SyncManager to route operations only to remotes
|
|
62
|
-
* whose collection contains the document.
|
|
63
|
-
*/
|
|
64
|
-
collectionMemberships?: Record<string, string[]>;
|
|
65
|
-
};
|
|
66
|
-
/**
|
|
67
|
-
* Event emitted after all read models have finished processing operations.
|
|
68
|
-
* This event fires after JOB_WRITE_READY and guarantees that:
|
|
69
|
-
* - All read models (DocumentView, DocumentIndexer, etc.) have indexed the operations
|
|
70
|
-
* - All consistency trackers have been updated with the new operation indices
|
|
71
|
-
* - Queries without consistency tokens will now see the updated data
|
|
72
|
-
*
|
|
73
|
-
* This event is useful for:
|
|
74
|
-
* - Test synchronization (knowing when read models are ready)
|
|
75
|
-
* - Observability (measuring read model latency)
|
|
76
|
-
* - Event-driven workflows (triggering downstream processes)
|
|
77
|
-
*/
|
|
78
|
-
export type JobReadReadyEvent = {
|
|
79
|
-
jobId: string;
|
|
80
|
-
operations: OperationWithContext[];
|
|
81
|
-
};
|
|
82
|
-
/**
|
|
83
|
-
* Event emitted when a job fails with an unrecoverable error.
|
|
84
|
-
* This event allows the JobAwaiter and other subscribers to react to job failures
|
|
85
|
-
* without polling.
|
|
86
|
-
*/
|
|
87
|
-
export type JobFailedEvent = {
|
|
88
|
-
jobId: string;
|
|
89
|
-
error: Error;
|
|
90
|
-
job?: Job;
|
|
91
|
-
};
|
|
92
|
-
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3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CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,KAAK,CAAC;IACb,GAAG,CAAC,EAAE,GAAG,CAAC;CACX,CAAC"}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import type { Action, Operation } from "document-model";
|
|
2
|
-
import type { IOperationIndexTxn } from "../cache/operation-index-types.js";
|
|
3
|
-
import type { ILogger } from "../logging/types.js";
|
|
4
|
-
import type { Job } from "../queue/types.js";
|
|
5
|
-
import type { IDocumentModelRegistry } from "../registry/interfaces.js";
|
|
6
|
-
import type { ExecutionStores } from "./execution-scope.js";
|
|
7
|
-
import type { JobResult } from "./types.js";
|
|
8
|
-
export declare class DocumentActionHandler {
|
|
9
|
-
private registry;
|
|
10
|
-
private logger;
|
|
11
|
-
constructor(registry: IDocumentModelRegistry, logger: ILogger);
|
|
12
|
-
execute(job: Job, action: Action, startTime: number, indexTxn: IOperationIndexTxn, stores: ExecutionStores, skip?: number, sourceRemote?: string, signal?: AbortSignal): Promise<JobResult & {
|
|
13
|
-
operationsWithContext?: Array<{
|
|
14
|
-
operation: Operation;
|
|
15
|
-
context: {
|
|
16
|
-
documentId: string;
|
|
17
|
-
scope: string;
|
|
18
|
-
branch: string;
|
|
19
|
-
documentType: string;
|
|
20
|
-
};
|
|
21
|
-
}>;
|
|
22
|
-
}>;
|
|
23
|
-
private executeCreate;
|
|
24
|
-
private executeDelete;
|
|
25
|
-
private executeUpgrade;
|
|
26
|
-
private executeAddRelationship;
|
|
27
|
-
private executeRemoveRelationship;
|
|
28
|
-
private writeOperationToStore;
|
|
29
|
-
}
|
|
30
|
-
//# sourceMappingURL=document-action-handler.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"document-action-handler.d.ts","sourceRoot":"","sources":["../../../src/executor/document-action-handler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,MAAM,EAIN,SAAS,EAMV,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AAE5E,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AAExE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAY5C,qBAAa,qBAAqB;IAE9B,OAAO,CAAC,QAAQ;IAChB,OAAO,CAAC,MAAM;gBADN,QAAQ,EAAE,sBAAsB,EAChC,MAAM,EAAE,OAAO;IAGnB,OAAO,CACX,GAAG,EAAE,GAAG,EACR,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,kBAAkB,EAC5B,MAAM,EAAE,eAAe,EACvB,IAAI,GAAE,MAAU,EAChB,YAAY,GAAE,MAAW,EACzB,MAAM,CAAC,EAAE,WAAW,GACnB,OAAO,CACR,SAAS,GAAG;QACV,qBAAqB,CAAC,EAAE,KAAK,CAAC;YAC5B,SAAS,EAAE,SAAS,CAAC;YACrB,OAAO,EAAE;gBACP,UAAU,EAAE,MAAM,CAAC;gBACnB,KAAK,EAAE,MAAM,CAAC;gBACd,MAAM,EAAE,MAAM,CAAC;gBACf,YAAY,EAAE,MAAM,CAAC;aACtB,CAAC;SACH,CAAC,CAAC;KACJ,CACF;YA+Da,aAAa;YAyGb,aAAa;YAiIb,cAAc;YA4Kd,sBAAsB;YAyJtB,yBAAyB;YA+IzB,qBAAqB;CA2CpC"}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import type { Kysely } from "kysely";
|
|
2
|
-
import type { CollectionMembershipCache } from "../cache/collection-membership-cache.js";
|
|
3
|
-
import type { DocumentMetaCache } from "../cache/document-meta-cache.js";
|
|
4
|
-
import type { KyselyOperationIndex } from "../cache/kysely-operation-index.js";
|
|
5
|
-
import type { KyselyWriteCache } from "../cache/kysely-write-cache.js";
|
|
6
|
-
import type { IOperationIndex } from "../cache/operation-index-types.js";
|
|
7
|
-
import type { IWriteCache } from "../cache/write/interfaces.js";
|
|
8
|
-
import type { IDocumentMetaCache } from "../cache/document-meta-cache-types.js";
|
|
9
|
-
import type { ICollectionMembershipCache } from "../cache/collection-membership-cache.js";
|
|
10
|
-
import type { IOperationStore } from "../storage/interfaces.js";
|
|
11
|
-
import type { KyselyOperationStore } from "../storage/kysely/store.js";
|
|
12
|
-
import type { KyselyKeyframeStore } from "../storage/kysely/keyframe-store.js";
|
|
13
|
-
import type { Database } from "../storage/kysely/types.js";
|
|
14
|
-
export interface ExecutionStores {
|
|
15
|
-
operationStore: IOperationStore;
|
|
16
|
-
operationIndex: IOperationIndex;
|
|
17
|
-
writeCache: IWriteCache;
|
|
18
|
-
documentMetaCache: IDocumentMetaCache;
|
|
19
|
-
collectionMembershipCache: ICollectionMembershipCache;
|
|
20
|
-
}
|
|
21
|
-
export interface IExecutionScope {
|
|
22
|
-
run<T>(fn: (stores: ExecutionStores) => Promise<T>, signal?: AbortSignal): Promise<T>;
|
|
23
|
-
}
|
|
24
|
-
export declare class DefaultExecutionScope implements IExecutionScope {
|
|
25
|
-
private operationStore;
|
|
26
|
-
private operationIndex;
|
|
27
|
-
private writeCache;
|
|
28
|
-
private documentMetaCache;
|
|
29
|
-
private collectionMembershipCache;
|
|
30
|
-
constructor(operationStore: IOperationStore, operationIndex: IOperationIndex, writeCache: IWriteCache, documentMetaCache: IDocumentMetaCache, collectionMembershipCache: ICollectionMembershipCache);
|
|
31
|
-
run<T>(fn: (stores: ExecutionStores) => Promise<T>, signal?: AbortSignal): Promise<T>;
|
|
32
|
-
}
|
|
33
|
-
export declare class KyselyExecutionScope implements IExecutionScope {
|
|
34
|
-
private db;
|
|
35
|
-
private operationStore;
|
|
36
|
-
private operationIndex;
|
|
37
|
-
private keyframeStore;
|
|
38
|
-
private writeCache;
|
|
39
|
-
private documentMetaCache;
|
|
40
|
-
private collectionMembershipCache;
|
|
41
|
-
constructor(db: Kysely<Database>, operationStore: KyselyOperationStore, operationIndex: KyselyOperationIndex, keyframeStore: KyselyKeyframeStore, writeCache: KyselyWriteCache, documentMetaCache: DocumentMetaCache, collectionMembershipCache: CollectionMembershipCache);
|
|
42
|
-
run<T>(fn: (stores: ExecutionStores) => Promise<T>, signal?: AbortSignal): Promise<T>;
|
|
43
|
-
}
|
|
44
|
-
//# sourceMappingURL=execution-scope.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"execution-scope.d.ts","sourceRoot":"","sources":["../../../src/executor/execution-scope.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAe,MAAM,QAAQ,CAAC;AAClD,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,yCAAyC,CAAC;AACzF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACzE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAC/E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AACvE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AACzE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AAChF,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,yCAAyC,CAAC;AAC1F,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AACvE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAC/E,OAAO,KAAK,EAAE,QAAQ,EAA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B,EAAE,iBAAiB,EACpC,yBAAyB,EAAE,yBAAyB;IAGxD,GAAG,CAAC,CAAC,EACT,EAAE,EAAE,CAAC,MAAM,EAAE,eAAe,KAAK,OAAO,CAAC,CAAC,CAAC,EAC3C,MAAM,CAAC,EAAE,WAAW,GACnB,OAAO,CAAC,CAAC,CAAC;CAoBd"}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import type { Job } from "../queue/types.js";
|
|
2
|
-
import type { ExecutorManagerStatus, JobResult } from "./types.js";
|
|
3
|
-
/**
|
|
4
|
-
* Simple interface for executing a job.
|
|
5
|
-
* A JobExecutor simply takes a job and executes it - nothing more.
|
|
6
|
-
*/
|
|
7
|
-
export interface IJobExecutor {
|
|
8
|
-
/**
|
|
9
|
-
* Execute a single job.
|
|
10
|
-
* @param job - The job to execute
|
|
11
|
-
* @returns Promise that resolves to the job result
|
|
12
|
-
*/
|
|
13
|
-
executeJob(job: Job, signal?: AbortSignal): Promise<JobResult>;
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* Interface for managing multiple job executors.
|
|
17
|
-
* Listens for 'jobAvailable' events from the event bus, pulls jobs from the queue,
|
|
18
|
-
* and coordinates the distribution of jobs across multiple executor instances.
|
|
19
|
-
*/
|
|
20
|
-
export interface IJobExecutorManager {
|
|
21
|
-
/**
|
|
22
|
-
* Start the executor manager.
|
|
23
|
-
* Begins listening for 'jobAvailable' events and dispatching to executors.
|
|
24
|
-
*
|
|
25
|
-
* @param numExecutors - Number of executor instances to create
|
|
26
|
-
* @returns Promise that resolves when the manager is started
|
|
27
|
-
*/
|
|
28
|
-
start(numExecutors: number): Promise<void>;
|
|
29
|
-
/**
|
|
30
|
-
* Stop the executor manager.
|
|
31
|
-
*
|
|
32
|
-
* @param graceful - Whether to wait for current jobs to complete
|
|
33
|
-
* @returns Promise that resolves when the manager is stopped
|
|
34
|
-
*/
|
|
35
|
-
stop(graceful?: boolean): Promise<void>;
|
|
36
|
-
/**
|
|
37
|
-
* Get all managed executor instances.
|
|
38
|
-
*
|
|
39
|
-
* @returns Array of executor instances
|
|
40
|
-
*/
|
|
41
|
-
getExecutors(): IJobExecutor[];
|
|
42
|
-
/**
|
|
43
|
-
* Get the current status of the manager.
|
|
44
|
-
*
|
|
45
|
-
* @returns The current manager status
|
|
46
|
-
*/
|
|
47
|
-
getStatus(): ExecutorManagerStatus;
|
|
48
|
-
}
|
|
49
|
-
//# sourceMappingURL=interfaces.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../src/executor/interfaces.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,KAAK,EAAE,qBAAqB,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAEnE;;;GAGG;AACH,MAAM,WAAW,YAAY;IAC3B;;;;OAIG;IACH,UAAU,CAAC,GAAG,EAAE,GAAG,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;CAChE;AAED;;;;GAIG;AACH,MAAM,WAAW,mBAAmB;IAClC;;;;;;OAMG;IACH,KAAK,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE3C;;;;;OAKG;IACH,IAAI,CAAC,QAAQ,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAExC;;;;OAIG;IACH,YAAY,IAAI,YAAY,EAAE,CAAC;IAE/B;;;;OAIG;IACH,SAAS,IAAI,qBAAqB,CAAC;CACpC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { Action, Operation } from "document-model";
|
|
2
|
-
import type { SignatureVerificationHandler } from "../signer/types.js";
|
|
3
|
-
export declare class SignatureVerifier {
|
|
4
|
-
private verifier?;
|
|
5
|
-
constructor(verifier?: SignatureVerificationHandler | undefined);
|
|
6
|
-
verifyActions(documentId: string, branch: string, actions: Action[]): Promise<void>;
|
|
7
|
-
verifyOperations(documentId: string, operations: Operation[]): Promise<void>;
|
|
8
|
-
}
|
|
9
|
-
//# sourceMappingURL=signature-verifier.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"signature-verifier.d.ts","sourceRoot":"","sources":["../../../src/executor/signature-verifier.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAGxD,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,oBAAoB,CAAC;AAEvE,qBAAa,iBAAiB;IAChB,OAAO,CAAC,QAAQ,CAAC;gBAAT,QAAQ,CAAC,EAAE,4BAA4B,YAAA;IAErD,aAAa,CACjB,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,EAAE,GAChB,OAAO,CAAC,IAAI,CAAC;IAmDV,gBAAgB,CACpB,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,SAAS,EAAE,GACtB,OAAO,CAAC,IAAI,CAAC;CA0CjB"}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import type { IEventBus } from "../events/interfaces.js";
|
|
2
|
-
import type { IJobTracker } from "../job-tracker/interfaces.js";
|
|
3
|
-
import type { ILogger } from "../logging/types.js";
|
|
4
|
-
import type { IQueue } from "../queue/interfaces.js";
|
|
5
|
-
import type { IDocumentModelResolver } from "../registry/document-model-resolver.js";
|
|
6
|
-
import type { IJobExecutor, IJobExecutorManager } from "./interfaces.js";
|
|
7
|
-
import type { ExecutorManagerStatus } from "./types.js";
|
|
8
|
-
export type JobExecutorFactory = () => IJobExecutor;
|
|
9
|
-
/**
|
|
10
|
-
* Manages multiple job executors and coordinates job distribution.
|
|
11
|
-
* Listens for job available events and dispatches jobs to executors.
|
|
12
|
-
*/
|
|
13
|
-
export declare class SimpleJobExecutorManager implements IJobExecutorManager {
|
|
14
|
-
private executorFactory;
|
|
15
|
-
private eventBus;
|
|
16
|
-
private queue;
|
|
17
|
-
private jobTracker;
|
|
18
|
-
private logger;
|
|
19
|
-
private resolver;
|
|
20
|
-
private executors;
|
|
21
|
-
private isRunning;
|
|
22
|
-
private activeJobs;
|
|
23
|
-
private totalJobsProcessed;
|
|
24
|
-
private unsubscribe?;
|
|
25
|
-
private deferredJobs;
|
|
26
|
-
private jobTimeoutMs;
|
|
27
|
-
constructor(executorFactory: JobExecutorFactory, eventBus: IEventBus, queue: IQueue, jobTracker: IJobTracker, logger: ILogger, resolver: IDocumentModelResolver, jobTimeoutMs?: number);
|
|
28
|
-
start(numExecutors: number): Promise<void>;
|
|
29
|
-
stop(graceful?: boolean): Promise<void>;
|
|
30
|
-
getExecutors(): IJobExecutor[];
|
|
31
|
-
getStatus(): ExecutorManagerStatus;
|
|
32
|
-
private processNextJob;
|
|
33
|
-
private checkForMoreJobs;
|
|
34
|
-
private processExistingJobs;
|
|
35
|
-
private toErrorInfo;
|
|
36
|
-
private hasCreateDocumentAction;
|
|
37
|
-
private flushDeferredJobs;
|
|
38
|
-
private formatErrorHistory;
|
|
39
|
-
}
|
|
40
|
-
//# sourceMappingURL=simple-job-executor-manager.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"simple-job-executor-manager.d.ts","sourceRoot":"","sources":["../../../src/executor/simple-job-executor-manager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAEzD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAGrD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,wCAAwC,CAAC;AAOrF,OAAO,KAAK,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACzE,OAAO,KAAK,EAAE,qBAAqB,EAAa,MAAM,YAAY,CAAC;AAEnE,MAAM,MAAM,kBAAkB,GAAG,MAAM,YAAY,CAAC;AAEpD;;;GAGG;AACH,qBAAa,wBAAyB,YAAW,mBAAmB;IAWhE,OAAO,CAAC,eAAe;IACvB,OAAO,CAAC,QAAQ;IAChB,OAAO,CAAC,KAAK;IACb,OAAO,CAAC,UAAU;IAClB,OAAO,CAAC,MAAM;IACd,OAAO,CAAC,QAAQ;IAflB,OAAO,CAAC,SAAS,CAAsB;IACvC,OAAO,CAAC,SAAS,CAAS;IAC1B,OAAO,CAAC,UAAU,CAAK;IACvB,OAAO,CAAC,kBAAkB,CAAK;IAC/B,OAAO,CAAC,WAAW,CAAC,CAAa;IACjC,OAAO,CAAC,YAAY,CAA4B;IAEhD,OAAO,CAAC,YAAY,CAAS;gBAGnB,eAAe,EAAE,kBAAkB,EACnC,QAAQ,EAAE,SAAS,EACnB,KAAK,EAAE,MAAM,EACb,UAAU,EAAE,WAAW,EACvB,MAAM,EAAE,OAAO,EACf,QAAQ,EAAE,sBAAsB,EACxC,YAAY,GAAE,MAAe;IAKzB,KAAK,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAgC1C,IAAI,CAAC,QAAQ,UAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IAwC1C,YAAY,IAAI,YAAY,EAAE;IAI9B,SAAS,IAAI,qBAAqB;YASpB,cAAc;YAqMd,gBAAgB;YAkBhB,mBAAmB;IAwBjC,OAAO,CAAC,WAAW;IAanB,OAAO,CAAC,uBAAuB;YAcjB,iBAAiB;IAgB/B,OAAO,CAAC,kBAAkB;CAwB3B"}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import type { ICollectionMembershipCache } from "../cache/collection-membership-cache.js";
|
|
2
|
-
import type { IDocumentMetaCache } from "../cache/document-meta-cache-types.js";
|
|
3
|
-
import type { IOperationIndex } from "../cache/operation-index-types.js";
|
|
4
|
-
import type { IWriteCache } from "../cache/write/interfaces.js";
|
|
5
|
-
import type { IEventBus } from "../events/interfaces.js";
|
|
6
|
-
import type { ILogger } from "../logging/types.js";
|
|
7
|
-
import type { Job } from "../queue/types.js";
|
|
8
|
-
import type { IDocumentModelRegistry } from "../registry/interfaces.js";
|
|
9
|
-
import type { SignatureVerificationHandler } from "../signer/types.js";
|
|
10
|
-
import type { IOperationStore } from "../storage/interfaces.js";
|
|
11
|
-
import type { IExecutionScope } from "./execution-scope.js";
|
|
12
|
-
import type { IJobExecutor } from "./interfaces.js";
|
|
13
|
-
import type { JobExecutorConfig, JobResult } from "./types.js";
|
|
14
|
-
/**
|
|
15
|
-
* Simple job executor that processes a job by applying actions through document model reducers.
|
|
16
|
-
*/
|
|
17
|
-
export declare class SimpleJobExecutor implements IJobExecutor {
|
|
18
|
-
private logger;
|
|
19
|
-
private registry;
|
|
20
|
-
private operationStore;
|
|
21
|
-
private eventBus;
|
|
22
|
-
private writeCache;
|
|
23
|
-
private operationIndex;
|
|
24
|
-
private documentMetaCache;
|
|
25
|
-
private collectionMembershipCache;
|
|
26
|
-
private config;
|
|
27
|
-
private signatureVerifierModule;
|
|
28
|
-
private documentActionHandler;
|
|
29
|
-
private executionScope;
|
|
30
|
-
constructor(logger: ILogger, registry: IDocumentModelRegistry, operationStore: IOperationStore, eventBus: IEventBus, writeCache: IWriteCache, operationIndex: IOperationIndex, documentMetaCache: IDocumentMetaCache, collectionMembershipCache: ICollectionMembershipCache, config: JobExecutorConfig, signatureVerifier?: SignatureVerificationHandler, executionScope?: IExecutionScope);
|
|
31
|
-
/**
|
|
32
|
-
* Execute a single job by applying all its actions through the appropriate reducers.
|
|
33
|
-
* Actions are processed sequentially in order.
|
|
34
|
-
*/
|
|
35
|
-
executeJob(job: Job, signal?: AbortSignal): Promise<JobResult>;
|
|
36
|
-
private getCollectionMembershipsForOperations;
|
|
37
|
-
private processActions;
|
|
38
|
-
private executeRegularAction;
|
|
39
|
-
private executeLoadJob;
|
|
40
|
-
private accumulateResultOrReturnError;
|
|
41
|
-
}
|
|
42
|
-
//# sourceMappingURL=simple-job-executor.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"simple-job-executor.d.ts","sourceRoot":"","sources":["../../../src/executor/simple-job-executor.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,yCAAyC,CAAC;AAC1F,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AAChF,OAAO,KAAK,EACV,eAAe,EAEhB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAEzD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AAExE,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,oBAAoB,CAAC;AACvE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAGhE,OAAO,KAAK,EAAmB,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAE7E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAEpD,OAAO,KAAK,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAoB/D;;GAEG;AACH,qBAAa,iBAAkB,YAAW,YAAY;IAOlD,OAAO,CAAC,MAAM;IACd,OAAO,CAAC,QAAQ;IAChB,OAAO,CAAC,cAAc;IACtB,OAAO,CAAC,QAAQ;IAChB,OAAO,CAAC,UAAU;IAClB,OAAO,CAAC,cAAc;IACtB,OAAO,CAAC,iBAAiB;IACzB,OAAO,CAAC,yBAAyB;IAbnC,OAAO,CAAC,MAAM,CAA8B;IAC5C,OAAO,CAAC,uBAAuB,CAAoB;IACnD,OAAO,CAAC,qBAAqB,CAAwB;IACrD,OAAO,CAAC,cAAc,CAAkB;gBAG9B,MAAM,EAAE,OAAO,EACf,QAAQ,EAAE,sBAAsB,EAChC,cAAc,EAAE,eAAe,EAC/B,QAAQ,EAAE,SAAS,EACnB,UAAU,EAAE,WAAW,EACvB,cAAc,EAAE,eAAe,EAC/B,iBAAiB,EAAE,kBAAkB,EACrC,yBAAyB,EAAE,0BAA0B,EAC7D,MAAM,EAAE,iBAAiB,EACzB,iBAAiB,CAAC,EAAE,4BAA4B,EAChD,cAAc,CAAC,EAAE,eAAe;IAsBlC;;;OAGG;IACG,UAAU,CAAC,GAAG,EAAE,GAAG,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,SAAS,CAAC;YA2ItD,qCAAqC;YAYrC,cAAc;YAgFd,oBAAoB;YAyNpB,cAAc;IA8M5B,OAAO,CAAC,6BAA6B;CAgBtC"}
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
import type { OperationWithContext } from "@powerhousedao/shared/document-model";
|
|
2
|
-
import type { Operation } from "document-model";
|
|
3
|
-
import type { Job } from "../queue/types.js";
|
|
4
|
-
/**
|
|
5
|
-
* Represents the result of a job execution
|
|
6
|
-
*/
|
|
7
|
-
export type JobResult = {
|
|
8
|
-
/** The job that was executed */
|
|
9
|
-
job: Job;
|
|
10
|
-
/** Whether the job executed successfully */
|
|
11
|
-
success: boolean;
|
|
12
|
-
/** Error if the job failed */
|
|
13
|
-
error?: Error;
|
|
14
|
-
/** The operations generated from the actions (if successful) */
|
|
15
|
-
operations?: Operation[];
|
|
16
|
-
/**
|
|
17
|
-
* Operations with context (includes ephemeral resultingState).
|
|
18
|
-
* Used for emitting to IDocumentView via event bus.
|
|
19
|
-
*/
|
|
20
|
-
operationsWithContext?: OperationWithContext[];
|
|
21
|
-
/** Timestamp when the job execution completed */
|
|
22
|
-
completedAt?: string;
|
|
23
|
-
/** Duration of job execution in milliseconds */
|
|
24
|
-
duration?: number;
|
|
25
|
-
/** Any additional metadata from the execution */
|
|
26
|
-
metadata?: Record<string, any>;
|
|
27
|
-
};
|
|
28
|
-
/**
|
|
29
|
-
* Configuration options for the job executor
|
|
30
|
-
*/
|
|
31
|
-
export type JobExecutorConfig = {
|
|
32
|
-
/** Maximum number of conflicting operations to skip when reshuffling. */
|
|
33
|
-
maxSkipThreshold?: number;
|
|
34
|
-
/** Maximum number of concurrent jobs to execute */
|
|
35
|
-
maxConcurrency?: number;
|
|
36
|
-
/** Maximum time in milliseconds a job can run before being considered timed out */
|
|
37
|
-
jobTimeoutMs?: number;
|
|
38
|
-
/** Base delay in milliseconds for exponential backoff retries */
|
|
39
|
-
retryBaseDelayMs?: number;
|
|
40
|
-
/** Maximum delay in milliseconds for exponential backoff retries */
|
|
41
|
-
retryMaxDelayMs?: number;
|
|
42
|
-
};
|
|
43
|
-
/**
|
|
44
|
-
* Event types for the job executor
|
|
45
|
-
*/
|
|
46
|
-
export declare const JobExecutorEventTypes: {
|
|
47
|
-
readonly JOB_STARTED: 20000;
|
|
48
|
-
readonly JOB_COMPLETED: 20001;
|
|
49
|
-
readonly JOB_FAILED: 20002;
|
|
50
|
-
readonly EXECUTOR_STARTED: 20003;
|
|
51
|
-
readonly EXECUTOR_STOPPED: 20004;
|
|
52
|
-
};
|
|
53
|
-
/**
|
|
54
|
-
* Event data for job execution events
|
|
55
|
-
*/
|
|
56
|
-
export type JobStartedEvent = {
|
|
57
|
-
job: Job;
|
|
58
|
-
startedAt: string;
|
|
59
|
-
};
|
|
60
|
-
export type JobCompletedEvent = {
|
|
61
|
-
job: Job;
|
|
62
|
-
result: JobResult;
|
|
63
|
-
};
|
|
64
|
-
export type JobFailedEvent = {
|
|
65
|
-
job: Job;
|
|
66
|
-
error: string;
|
|
67
|
-
willRetry: boolean;
|
|
68
|
-
retryCount: number;
|
|
69
|
-
};
|
|
70
|
-
export type ExecutorStartedEvent = {
|
|
71
|
-
config: JobExecutorConfig;
|
|
72
|
-
startedAt: string;
|
|
73
|
-
};
|
|
74
|
-
export type ExecutorStoppedEvent = {
|
|
75
|
-
stoppedAt: string;
|
|
76
|
-
graceful: boolean;
|
|
77
|
-
};
|
|
78
|
-
/**
|
|
79
|
-
* Status information for the job executor manager
|
|
80
|
-
*/
|
|
81
|
-
export type ExecutorManagerStatus = {
|
|
82
|
-
/** Whether the manager is currently running */
|
|
83
|
-
isRunning: boolean;
|
|
84
|
-
/** Number of executor instances managed */
|
|
85
|
-
numExecutors: number;
|
|
86
|
-
/** Number of jobs currently being processed */
|
|
87
|
-
activeJobs: number;
|
|
88
|
-
/** Total number of jobs processed since start */
|
|
89
|
-
totalJobsProcessed: number;
|
|
90
|
-
};
|
|
91
|
-
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/executor/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAC;AACjF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAE7C;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG;IACtB,gCAAgC;IAChC,GAAG,EAAE,GAAG,CAAC;IAET,4CAA4C;IAC5C,OAAO,EAAE,OAAO,CAAC;IAEjB,8BAA8B;IAC9B,KAAK,CAAC,EAAE,KAAK,CAAC;IAEd,gEAAgE;IAChE,UAAU,CAAC,EAAE,SAAS,EAAE,CAAC;IAEzB;;;OAGG;IACH,qBAAqB,CAAC,EAAE,oBAAoB,EAAE,CAAC;IAE/C,iDAAiD;IACjD,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,gDAAgD;IAChD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,iDAAiD;IACjD,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nB,iDAAiD;IACjD,kBAAkB,EAAE,MAAM,CAAC;CAC5B,CAAC"}
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
import type { OperationWithContext } from "@powerhousedao/shared/document-model";
|
|
2
|
-
import type { Action, CreateDocumentAction, DeleteDocumentAction, Operation, PHDocument, UpgradeDocumentAction, UpgradeTransition } from "document-model";
|
|
3
|
-
import type { Job } from "../queue/types.js";
|
|
4
|
-
import type { ConsistencyToken } from "../shared/types.js";
|
|
5
|
-
import type { JobResult } from "./types.js";
|
|
6
|
-
/**
|
|
7
|
-
* Creates a PHDocument from a CREATE_DOCUMENT action input.
|
|
8
|
-
* Reconstructs the document header and initializes the base state.
|
|
9
|
-
*
|
|
10
|
-
* @param action - The CREATE_DOCUMENT action containing the document parameters
|
|
11
|
-
* @returns A newly constructed PHDocument with initialized header and base state
|
|
12
|
-
*/
|
|
13
|
-
export declare function createDocumentFromAction(action: CreateDocumentAction): PHDocument;
|
|
14
|
-
/**
|
|
15
|
-
* Applies an UPGRADE_DOCUMENT action to a document.
|
|
16
|
-
* Handles all upgrade scenarios including initial upgrades, no-ops, and multi-step upgrades.
|
|
17
|
-
*
|
|
18
|
-
* Behavior based on fromVersion/toVersion:
|
|
19
|
-
* - fromVersion === toVersion (and fromVersion > 0): No-op - return unchanged document
|
|
20
|
-
* - fromVersion > toVersion: Throw DowngradeNotSupportedError
|
|
21
|
-
* - All other cases: Apply upgradePath transitions (if provided), then apply initialState, set version
|
|
22
|
-
*
|
|
23
|
-
* The initialState from the action is always applied (if provided) to maintain backward
|
|
24
|
-
* compatibility with the original implementation.
|
|
25
|
-
*
|
|
26
|
-
* @param document - The document to upgrade
|
|
27
|
-
* @param action - The UPGRADE_DOCUMENT action
|
|
28
|
-
* @param upgradePath - Optional pre-computed upgrade path for multi-step upgrades
|
|
29
|
-
* @returns The upgraded document (unchanged if no-op)
|
|
30
|
-
* @throws DowngradeNotSupportedError if attempting to downgrade
|
|
31
|
-
*/
|
|
32
|
-
export declare function applyUpgradeDocumentAction(document: PHDocument, action: UpgradeDocumentAction, upgradePath?: UpgradeTransition[]): PHDocument;
|
|
33
|
-
/**
|
|
34
|
-
* Applies a DELETE_DOCUMENT action to a document.
|
|
35
|
-
* Marks the document as deleted in the document scope state.
|
|
36
|
-
*
|
|
37
|
-
* @param document - The document to mark as deleted
|
|
38
|
-
* @param action - The DELETE_DOCUMENT action
|
|
39
|
-
* @returns The updated document (mutates in place and returns for convenience)
|
|
40
|
-
*/
|
|
41
|
-
export declare function applyDeleteDocumentAction(document: PHDocument, action: DeleteDocumentAction): PHDocument;
|
|
42
|
-
/**
|
|
43
|
-
* Calculate the next operation index for a specific scope.
|
|
44
|
-
* Each scope maintains its own independent index sequence.
|
|
45
|
-
*
|
|
46
|
-
* Per-scope indexing means:
|
|
47
|
-
* - Each scope (document, global, local, etc.) has independent indexes
|
|
48
|
-
* - Indexes start at 0 for each scope
|
|
49
|
-
* - Different scopes can have operations with the same index value
|
|
50
|
-
*
|
|
51
|
-
* This function uses header.revision which is populated by the cache/storage layer
|
|
52
|
-
* and contains the next available index for each scope. This design avoids requiring
|
|
53
|
-
* the full operation history to be loaded, which is crucial for snapshot-based caching.
|
|
54
|
-
*
|
|
55
|
-
* @param document - The document whose header.revision to inspect
|
|
56
|
-
* @param scope - The scope to calculate the next index for
|
|
57
|
-
* @returns The next available index in the specified scope
|
|
58
|
-
*/
|
|
59
|
-
export declare const getNextIndexForScope: (document: PHDocument, scope: string) => number;
|
|
60
|
-
/**
|
|
61
|
-
* Creates an empty consistency token with no coordinates.
|
|
62
|
-
* Used when a job is registered or fails without writing operations.
|
|
63
|
-
*
|
|
64
|
-
* @returns A consistency token with an empty coordinates array
|
|
65
|
-
*/
|
|
66
|
-
export declare function createEmptyConsistencyToken(): ConsistencyToken;
|
|
67
|
-
/**
|
|
68
|
-
* Creates a consistency token from operations written during job execution.
|
|
69
|
-
* Maps each operation to a consistency coordinate tracking (documentId, scope, branch, operationIndex).
|
|
70
|
-
* If no operations are provided, returns an empty token.
|
|
71
|
-
*
|
|
72
|
-
* @param operationsWithContext - Array of operations with their execution context
|
|
73
|
-
* @returns A consistency token representing all operations written
|
|
74
|
-
*/
|
|
75
|
-
export declare function createConsistencyToken(operationsWithContext: OperationWithContext[]): ConsistencyToken;
|
|
76
|
-
export declare function createOperation(action: Action, index: number, skip: number, context: {
|
|
77
|
-
documentId: string;
|
|
78
|
-
scope: string;
|
|
79
|
-
branch: string;
|
|
80
|
-
}): Operation;
|
|
81
|
-
export declare function updateDocumentRevision(document: PHDocument, scope: string, operationIndex: number): void;
|
|
82
|
-
export declare function buildSuccessResult(job: Job, operation: Operation, documentId: string, documentType: string, resultingState: string, startTime: number): JobResult;
|
|
83
|
-
export declare function buildErrorResult(job: Job, error: Error, startTime: number): JobResult;
|
|
84
|
-
//# sourceMappingURL=util.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../../src/executor/util.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAC;AACjF,OAAO,KAAK,EACV,MAAM,EACN,oBAAoB,EAEpB,oBAAoB,EACpB,SAAS,EACT,UAAU,EACV,qBAAqB,EACrB,iBAAiB,EAClB,MAAM,gBAAgB,CAAC;AAMxB,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAE7C,OAAO,KAAK,EAEV,gBAAgB,EACjB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAE5C;;;;;;GAMG;AACH,wBAAgB,wBAAwB,CACtC,MAAM,EAAE,oBAAoB,GAC3B,UAAU,CAkDZ;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,0BAA0B,CACxC,QAAQ,EAAE,UAAU,EACpB,MAAM,EAAE,qBAAqB,EAC7B,WAAW,CAAC,EAAE,iBAAiB,EAAE,GAChC,UAAU,CA6BZ;AAkBD;;;;;;;GAOG;AACH,wBAAgB,yBAAyB,CACvC,QAAQ,EAAE,UAAU,EACpB,MAAM,EAAE,oBAAoB,GAC3B,UAAU,CAaZ;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,oBAAoB,GAC/B,UAAU,UAAU,EACpB,OAAO,MAAM,KACZ,MAEF,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,2BAA2B,IAAI,gBAAgB,CAM9D;AAED;;;;;;;GAOG;AACH,wBAAgB,sBAAsB,CACpC,qBAAqB,EAAE,oBAAoB,EAAE,GAC5C,gBAAgB,CAqBlB;AAED,wBAAgB,eAAe,CAC7B,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GAC7D,SAAS,CAgBX;AAED,wBAAgB,sBAAsB,CACpC,QAAQ,EAAE,UAAU,EACpB,KAAK,EAAE,MAAM,EACb,cAAc,EAAE,MAAM,GACrB,IAAI,CAKN;AAED,wBAAgB,kBAAkB,CAChC,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,SAAS,EACpB,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,MAAM,EACpB,cAAc,EAAE,MAAM,EACtB,SAAS,EAAE,MAAM,GAChB,SAAS,CAoBX;AAED,wBAAgB,gBAAgB,CAC9B,GAAG,EAAE,GAAG,EACR,KAAK,EAAE,KAAK,EACZ,SAAS,EAAE,MAAM,GAChB,SAAS,CAOX"}
|
package/dist/src/index.d.ts
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
export { addRelationshipAction, createDocumentAction, deleteDocumentAction, documentActions, removeRelationshipAction, upgradeDocumentAction, } from "./actions/index.js";
|
|
2
|
-
export { ReactorClient } from "./client/reactor-client.js";
|
|
3
|
-
export { DocumentChangeType, type DocumentChangeEvent, type IReactorClient, } from "./client/types.js";
|
|
4
|
-
export { ReactorBuilder } from "./core/reactor-builder.js";
|
|
5
|
-
export { ReactorClientBuilder } from "./core/reactor-client-builder.js";
|
|
6
|
-
export { Reactor } from "./core/reactor.js";
|
|
7
|
-
export { type BatchLoadRequest, type BatchLoadResult, type IReactor, type LoadJobPlan, type ReactorClientModule, type ReactorFeatures, type ReactorModule, type SyncModule, } from "./core/types.js";
|
|
8
|
-
export { JobAwaiter, type IJobAwaiter } from "./shared/awaiter.js";
|
|
9
|
-
export { ConsistencyTracker, makeConsistencyKey, type IConsistencyTracker, } from "./shared/consistency-tracker.js";
|
|
10
|
-
export { driveIdFromUrl, parseDriveUrl, type ParsedDriveUrl, } from "./shared/drive-url.js";
|
|
11
|
-
export { createMutableShutdownStatus } from "./shared/factories.js";
|
|
12
|
-
export { JobStatus, PropagationMode, RelationshipChangeType, type ConsistencyCoordinate, type ConsistencyKey, type ConsistencyToken, type JobInfo, type PagedResults, type PagingOptions, type SearchFilter, type ShutdownStatus, type ViewFilter, } from "./shared/types.js";
|
|
13
|
-
export { type SignatureVerificationHandler, type SignerConfig, } from "./signer/types.js";
|
|
14
|
-
export { DefaultSubscriptionErrorHandler } from "./subs/default-error-handler.js";
|
|
15
|
-
export { ReactorSubscriptionManager } from "./subs/react-subscription-manager.js";
|
|
16
|
-
export { type IReactorSubscriptionManager, type ISubscriptionErrorHandler, type SubscriptionErrorContext, } from "./subs/types.js";
|
|
17
|
-
export { EventBus } from "./events/event-bus.js";
|
|
18
|
-
export { type IEventBus } from "./events/interfaces.js";
|
|
19
|
-
export { EventBusAggregateError, ReactorEventTypes, type JobPendingEvent, type JobReadReadyEvent, type JobRunningEvent, type JobWriteReadyEvent, type JobFailedEvent as ReactorJobFailedEvent, type Unsubscribe, } from "./events/types.js";
|
|
20
|
-
export { type IQueue } from "./queue/interfaces.js";
|
|
21
|
-
export { InMemoryQueue } from "./queue/queue.js";
|
|
22
|
-
export { QueueEventTypes, type Job, type JobAvailableEvent, } from "./queue/types.js";
|
|
23
|
-
export { InMemoryJobTracker } from "./job-tracker/in-memory-job-tracker.js";
|
|
24
|
-
export { type IJobTracker } from "./job-tracker/interfaces.js";
|
|
25
|
-
export { type IJobExecutor, type IJobExecutorManager, } from "./executor/interfaces.js";
|
|
26
|
-
export { SimpleJobExecutorManager, type JobExecutorFactory, } from "./executor/simple-job-executor-manager.js";
|
|
27
|
-
export { SimpleJobExecutor as InMemoryJobExecutor, SimpleJobExecutor, } from "./executor/simple-job-executor.js";
|
|
28
|
-
export { JobExecutorEventTypes, type ExecutorStartedEvent, type ExecutorStoppedEvent, type JobCompletedEvent, type JobExecutorConfig, type JobFailedEvent, type JobResult, type JobStartedEvent, } from "./executor/types.js";
|
|
29
|
-
export { DocumentModelRegistry, DuplicateModuleError, InvalidModuleError, ModuleNotFoundError, NullDocumentModelResolver, type IDocumentModelLoader, type IDocumentModelRegistry, } from "./registry/index.js";
|
|
30
|
-
export type { OperationContext, OperationWithContext, } from "@powerhousedao/shared/document-model";
|
|
31
|
-
export type { Database } from "./core/types.js";
|
|
32
|
-
export { DuplicateOperationError, OptimisticLockError, RevisionMismatchError, type AtomicTxn, type DocumentGraphEdge, type DocumentRelationship, type DocumentRevisions, type IDocumentGraph, type IDocumentIndexer, type IDocumentView, type IKeyframeStore, type IOperationStore, type OperationFilter, } from "./storage/interfaces.js";
|
|
33
|
-
export { KyselyDocumentIndexer } from "./storage/kysely/document-indexer.js";
|
|
34
|
-
export { KyselyKeyframeStore } from "./storage/kysely/keyframe-store.js";
|
|
35
|
-
export { KyselyOperationStore } from "./storage/kysely/store.js";
|
|
36
|
-
export type { DocumentIndexerDatabase, OperationTable, Database as StorageDatabase, } from "./storage/kysely/types.js";
|
|
37
|
-
export { BaseReadModel } from "./read-models/base-read-model.js";
|
|
38
|
-
export { ReadModelCoordinator } from "./read-models/coordinator.js";
|
|
39
|
-
export { KyselyDocumentView } from "./read-models/document-view.js";
|
|
40
|
-
export { type IReadModel, type IReadModelCoordinator, } from "./read-models/interfaces.js";
|
|
41
|
-
export type { DocumentViewDatabase, InsertableDocumentSnapshot, } from "./read-models/types.js";
|
|
42
|
-
export { KyselyWriteCache } from "./cache/kysely-write-cache.js";
|
|
43
|
-
export { driveCollectionId, type IOperationIndex, type OperationIndexEntry, } from "./cache/operation-index-types.js";
|
|
44
|
-
export type { CachedSnapshot, DocumentStreamKey, KeyframeSnapshot, WriteCacheConfig, } from "./cache/write-cache-types.js";
|
|
45
|
-
export { type IWriteCache } from "./cache/write/interfaces.js";
|
|
46
|
-
export { ConsoleLogger } from "./logging/console.js";
|
|
47
|
-
export { type ILogger } from "./logging/types.js";
|
|
48
|
-
export { REACTOR_SCHEMA, getMigrationStatus, runMigrations, } from "./storage/migrations/migrator.js";
|
|
49
|
-
export { KyselySyncCursorStorage, KyselySyncRemoteStorage, type ISyncCursorStorage, type ISyncRemoteStorage, } from "./storage/index.js";
|
|
50
|
-
export { ChannelError, ChannelErrorSource, ChannelScheme, GqlRequestChannel, GqlRequestChannelFactory, GqlResponseChannel, GqlResponseChannelFactory, IntervalPollTimer, Mailbox, PollingChannelError, SyncBuilder, SyncEventTypes, SyncOperation, SyncOperationAggregateError, SyncOperationStatus, SyncStatus, SyncStatusTracker, batchOperationsByDocument, consolidateSyncOperations, sortEnvelopesByFirstOperationTimestamp, trimMailboxFromAckOrdinal, type ChannelConfig, type ChannelHealth, type ChannelMeta, type ConnectionState, type ConnectionStateChangedEvent, type ConnectionStateChangeCallback, type ConnectionStateSnapshot, type DeadLetterAddedEvent, type GqlChannelConfig, type IChannel, type IChannelFactory, type IPollTimer, type ISyncManager, type ISyncStatusTracker, type JwtHandler, type OperationBatch, type Remote, type RemoteCursor, type RemoteFilter, type RemoteOptions, type RemoteRecord, type RemoteStatus, type SyncEnvelope, type SyncEnvelopeType, type SyncFailedEvent, type SyncOperationErrorType, type SyncPendingEvent, type SyncStatusChangeCallback, type SyncSucceededEvent, } from "./sync/index.js";
|
|
51
|
-
export { RelationalDbProcessor, createRelationalDb, } from "@powerhousedao/shared/processors";
|
|
52
|
-
export type { IProcessor, IProcessorHostModule, IProcessorManager, IRelationalDb, ProcessorFactory, ProcessorFilter, ProcessorRecord, ProcessorStatus, TrackedProcessor, } from "@powerhousedao/shared/processors";
|
|
53
|
-
export { ProcessorManager } from "./processors/index.js";
|
|
54
|
-
export { DocumentIntegrityService } from "./admin/document-integrity-service.js";
|
|
55
|
-
export type { IDocumentIntegrityService, KeyframeValidationIssue, RebuildResult, SnapshotValidationIssue, ValidationResult, } from "./admin/types.js";
|
|
56
|
-
//# sourceMappingURL=index.d.ts.map
|
package/dist/src/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,qBAAqB,EACrB,oBAAoB,EACpB,oBAAoB,EACpB,eAAe,EACf,wBAAwB,EACxB,qBAAqB,GACtB,MAAM,oBAAoB,CAAC;AAG5B,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EACL,kBAAkB,EAClB,KAAK,mBAAmB,EACxB,KAAK,cAAc,GACpB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AACxE,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACpB,KAAK,QAAQ,EACb,KAAK,WAAW,EAChB,KAAK,mBAAmB,EACxB,KAAK,eAAe,EACpB,KAAK,aAAa,EAClB,KAAK,UAAU,GAChB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,UAAU,EAAE,KAAK,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACnE,OAAO,EACL,kBAAkB,EAClB,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