@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.
Files changed (242) hide show
  1. package/dist/index.d.ts +4306 -0
  2. package/dist/index.d.ts.map +1 -0
  3. package/dist/index.js +9433 -0
  4. package/dist/index.js.map +1 -0
  5. package/package.json +16 -18
  6. package/dist/src/actions/index.d.ts +0 -24
  7. package/dist/src/actions/index.d.ts.map +0 -1
  8. package/dist/src/admin/document-integrity-service.d.ts +0 -17
  9. package/dist/src/admin/document-integrity-service.d.ts.map +0 -1
  10. package/dist/src/admin/types.d.ts +0 -30
  11. package/dist/src/admin/types.d.ts.map +0 -1
  12. package/dist/src/cache/buffer/ring-buffer.d.ts +0 -37
  13. package/dist/src/cache/buffer/ring-buffer.d.ts.map +0 -1
  14. package/dist/src/cache/collection-membership-cache.d.ts +0 -14
  15. package/dist/src/cache/collection-membership-cache.d.ts.map +0 -1
  16. package/dist/src/cache/document-meta-cache-types.d.ts +0 -114
  17. package/dist/src/cache/document-meta-cache-types.d.ts.map +0 -1
  18. package/dist/src/cache/document-meta-cache.d.ts +0 -31
  19. package/dist/src/cache/document-meta-cache.d.ts.map +0 -1
  20. package/dist/src/cache/index.d.ts +0 -3
  21. package/dist/src/cache/index.d.ts.map +0 -1
  22. package/dist/src/cache/kysely-operation-index.d.ts +0 -24
  23. package/dist/src/cache/kysely-operation-index.d.ts.map +0 -1
  24. package/dist/src/cache/kysely-write-cache.d.ts +0 -142
  25. package/dist/src/cache/kysely-write-cache.d.ts.map +0 -1
  26. package/dist/src/cache/lru/lru-tracker.d.ts +0 -15
  27. package/dist/src/cache/lru/lru-tracker.d.ts.map +0 -1
  28. package/dist/src/cache/operation-index-types.d.ts +0 -64
  29. package/dist/src/cache/operation-index-types.d.ts.map +0 -1
  30. package/dist/src/cache/write/interfaces.d.ts +0 -88
  31. package/dist/src/cache/write/interfaces.d.ts.map +0 -1
  32. package/dist/src/cache/write-cache-types.d.ts +0 -42
  33. package/dist/src/cache/write-cache-types.d.ts.map +0 -1
  34. package/dist/src/client/reactor-client.d.ts +0 -121
  35. package/dist/src/client/reactor-client.d.ts.map +0 -1
  36. package/dist/src/client/types.d.ts +0 -260
  37. package/dist/src/client/types.d.ts.map +0 -1
  38. package/dist/src/core/reactor-builder.d.ts +0 -60
  39. package/dist/src/core/reactor-builder.d.ts.map +0 -1
  40. package/dist/src/core/reactor-client-builder.d.ts +0 -53
  41. package/dist/src/core/reactor-client-builder.d.ts.map +0 -1
  42. package/dist/src/core/reactor.d.ts +0 -56
  43. package/dist/src/core/reactor.d.ts.map +0 -1
  44. package/dist/src/core/types.d.ts +0 -312
  45. package/dist/src/core/types.d.ts.map +0 -1
  46. package/dist/src/core/utils.d.ts +0 -95
  47. package/dist/src/core/utils.d.ts.map +0 -1
  48. package/dist/src/events/event-bus.d.ts +0 -8
  49. package/dist/src/events/event-bus.d.ts.map +0 -1
  50. package/dist/src/events/interfaces.d.ts +0 -27
  51. package/dist/src/events/interfaces.d.ts.map +0 -1
  52. package/dist/src/events/types.d.ts +0 -92
  53. package/dist/src/events/types.d.ts.map +0 -1
  54. package/dist/src/executor/document-action-handler.d.ts +0 -30
  55. package/dist/src/executor/document-action-handler.d.ts.map +0 -1
  56. package/dist/src/executor/execution-scope.d.ts +0 -44
  57. package/dist/src/executor/execution-scope.d.ts.map +0 -1
  58. package/dist/src/executor/interfaces.d.ts +0 -49
  59. package/dist/src/executor/interfaces.d.ts.map +0 -1
  60. package/dist/src/executor/signature-verifier.d.ts +0 -9
  61. package/dist/src/executor/signature-verifier.d.ts.map +0 -1
  62. package/dist/src/executor/simple-job-executor-manager.d.ts +0 -40
  63. package/dist/src/executor/simple-job-executor-manager.d.ts.map +0 -1
  64. package/dist/src/executor/simple-job-executor.d.ts +0 -42
  65. package/dist/src/executor/simple-job-executor.d.ts.map +0 -1
  66. package/dist/src/executor/types.d.ts +0 -91
  67. package/dist/src/executor/types.d.ts.map +0 -1
  68. package/dist/src/executor/util.d.ts +0 -84
  69. package/dist/src/executor/util.d.ts.map +0 -1
  70. package/dist/src/index.d.ts +0 -56
  71. package/dist/src/index.d.ts.map +0 -1
  72. package/dist/src/index.js +0 -20714
  73. package/dist/src/job-tracker/in-memory-job-tracker.d.ts +0 -26
  74. package/dist/src/job-tracker/in-memory-job-tracker.d.ts.map +0 -1
  75. package/dist/src/job-tracker/index.d.ts +0 -3
  76. package/dist/src/job-tracker/index.d.ts.map +0 -1
  77. package/dist/src/job-tracker/interfaces.d.ts +0 -41
  78. package/dist/src/job-tracker/interfaces.d.ts.map +0 -1
  79. package/dist/src/logging/console.d.ts +0 -2
  80. package/dist/src/logging/console.d.ts.map +0 -1
  81. package/dist/src/logging/types.d.ts +0 -2
  82. package/dist/src/logging/types.d.ts.map +0 -1
  83. package/dist/src/processors/index.d.ts +0 -2
  84. package/dist/src/processors/index.d.ts.map +0 -1
  85. package/dist/src/processors/processor-manager.d.ts +0 -51
  86. package/dist/src/processors/processor-manager.d.ts.map +0 -1
  87. package/dist/src/processors/utils.d.ts +0 -11
  88. package/dist/src/processors/utils.d.ts.map +0 -1
  89. package/dist/src/queue/interfaces.d.ts +0 -103
  90. package/dist/src/queue/interfaces.d.ts.map +0 -1
  91. package/dist/src/queue/job-execution-handle.d.ts +0 -28
  92. package/dist/src/queue/job-execution-handle.d.ts.map +0 -1
  93. package/dist/src/queue/queue.d.ts +0 -110
  94. package/dist/src/queue/queue.d.ts.map +0 -1
  95. package/dist/src/queue/types.d.ts +0 -74
  96. package/dist/src/queue/types.d.ts.map +0 -1
  97. package/dist/src/read-models/base-read-model.d.ts +0 -62
  98. package/dist/src/read-models/base-read-model.d.ts.map +0 -1
  99. package/dist/src/read-models/coordinator.d.ts +0 -39
  100. package/dist/src/read-models/coordinator.d.ts.map +0 -1
  101. package/dist/src/read-models/document-view.d.ts +0 -27
  102. package/dist/src/read-models/document-view.d.ts.map +0 -1
  103. package/dist/src/read-models/interfaces.d.ts +0 -29
  104. package/dist/src/read-models/interfaces.d.ts.map +0 -1
  105. package/dist/src/read-models/types.d.ts +0 -63
  106. package/dist/src/read-models/types.d.ts.map +0 -1
  107. package/dist/src/registry/document-model-resolver.d.ts +0 -29
  108. package/dist/src/registry/document-model-resolver.d.ts.map +0 -1
  109. package/dist/src/registry/implementation.d.ts +0 -74
  110. package/dist/src/registry/implementation.d.ts.map +0 -1
  111. package/dist/src/registry/index.d.ts +0 -5
  112. package/dist/src/registry/index.d.ts.map +0 -1
  113. package/dist/src/registry/interfaces.d.ts +0 -108
  114. package/dist/src/registry/interfaces.d.ts.map +0 -1
  115. package/dist/src/shared/awaiter.d.ts +0 -35
  116. package/dist/src/shared/awaiter.d.ts.map +0 -1
  117. package/dist/src/shared/collect-all-pages.d.ts +0 -7
  118. package/dist/src/shared/collect-all-pages.d.ts.map +0 -1
  119. package/dist/src/shared/consistency-tracker.d.ts +0 -48
  120. package/dist/src/shared/consistency-tracker.d.ts.map +0 -1
  121. package/dist/src/shared/drive-url.d.ts +0 -15
  122. package/dist/src/shared/drive-url.d.ts.map +0 -1
  123. package/dist/src/shared/errors.d.ts +0 -50
  124. package/dist/src/shared/errors.d.ts.map +0 -1
  125. package/dist/src/shared/factories.d.ts +0 -20
  126. package/dist/src/shared/factories.d.ts.map +0 -1
  127. package/dist/src/shared/types.d.ts +0 -161
  128. package/dist/src/shared/types.d.ts.map +0 -1
  129. package/dist/src/shared/utils.d.ts +0 -3
  130. package/dist/src/shared/utils.d.ts.map +0 -1
  131. package/dist/src/signer/passthrough-signer.d.ts +0 -12
  132. package/dist/src/signer/passthrough-signer.d.ts.map +0 -1
  133. package/dist/src/signer/types.d.ts +0 -17
  134. package/dist/src/signer/types.d.ts.map +0 -1
  135. package/dist/src/storage/index.d.ts +0 -4
  136. package/dist/src/storage/index.d.ts.map +0 -1
  137. package/dist/src/storage/interfaces.d.ts +0 -574
  138. package/dist/src/storage/interfaces.d.ts.map +0 -1
  139. package/dist/src/storage/kysely/document-indexer.d.ts +0 -27
  140. package/dist/src/storage/kysely/document-indexer.d.ts.map +0 -1
  141. package/dist/src/storage/kysely/keyframe-store.d.ts +0 -24
  142. package/dist/src/storage/kysely/keyframe-store.d.ts.map +0 -1
  143. package/dist/src/storage/kysely/store.d.ts +0 -21
  144. package/dist/src/storage/kysely/store.d.ts.map +0 -1
  145. package/dist/src/storage/kysely/sync-cursor-storage.d.ts +0 -13
  146. package/dist/src/storage/kysely/sync-cursor-storage.d.ts.map +0 -1
  147. package/dist/src/storage/kysely/sync-dead-letter-storage.d.ts +0 -18
  148. package/dist/src/storage/kysely/sync-dead-letter-storage.d.ts.map +0 -1
  149. package/dist/src/storage/kysely/sync-remote-storage.d.ts +0 -13
  150. package/dist/src/storage/kysely/sync-remote-storage.d.ts.map +0 -1
  151. package/dist/src/storage/kysely/types.d.ts +0 -157
  152. package/dist/src/storage/kysely/types.d.ts.map +0 -1
  153. package/dist/src/storage/migrations/001_create_operation_table.d.ts +0 -3
  154. package/dist/src/storage/migrations/001_create_operation_table.d.ts.map +0 -1
  155. package/dist/src/storage/migrations/002_create_keyframe_table.d.ts +0 -3
  156. package/dist/src/storage/migrations/002_create_keyframe_table.d.ts.map +0 -1
  157. package/dist/src/storage/migrations/003_create_document_table.d.ts +0 -3
  158. package/dist/src/storage/migrations/003_create_document_table.d.ts.map +0 -1
  159. package/dist/src/storage/migrations/004_create_document_relationship_table.d.ts +0 -3
  160. package/dist/src/storage/migrations/004_create_document_relationship_table.d.ts.map +0 -1
  161. package/dist/src/storage/migrations/005_create_indexer_state_table.d.ts +0 -3
  162. package/dist/src/storage/migrations/005_create_indexer_state_table.d.ts.map +0 -1
  163. package/dist/src/storage/migrations/006_create_document_snapshot_table.d.ts +0 -3
  164. package/dist/src/storage/migrations/006_create_document_snapshot_table.d.ts.map +0 -1
  165. package/dist/src/storage/migrations/007_create_slug_mapping_table.d.ts +0 -3
  166. package/dist/src/storage/migrations/007_create_slug_mapping_table.d.ts.map +0 -1
  167. package/dist/src/storage/migrations/008_create_view_state_table.d.ts +0 -3
  168. package/dist/src/storage/migrations/008_create_view_state_table.d.ts.map +0 -1
  169. package/dist/src/storage/migrations/009_create_operation_index_tables.d.ts +0 -3
  170. package/dist/src/storage/migrations/009_create_operation_index_tables.d.ts.map +0 -1
  171. package/dist/src/storage/migrations/010_create_sync_tables.d.ts +0 -3
  172. package/dist/src/storage/migrations/010_create_sync_tables.d.ts.map +0 -1
  173. package/dist/src/storage/migrations/011_add_cursor_type_column.d.ts +0 -3
  174. package/dist/src/storage/migrations/011_add_cursor_type_column.d.ts.map +0 -1
  175. package/dist/src/storage/migrations/012_add_source_remote_column.d.ts +0 -3
  176. package/dist/src/storage/migrations/012_add_source_remote_column.d.ts.map +0 -1
  177. package/dist/src/storage/migrations/013_create_sync_dead_letters_table.d.ts +0 -3
  178. package/dist/src/storage/migrations/013_create_sync_dead_letters_table.d.ts.map +0 -1
  179. package/dist/src/storage/migrations/014_create_processor_cursor_table.d.ts +0 -3
  180. package/dist/src/storage/migrations/014_create_processor_cursor_table.d.ts.map +0 -1
  181. package/dist/src/storage/migrations/index.d.ts +0 -3
  182. package/dist/src/storage/migrations/index.d.ts.map +0 -1
  183. package/dist/src/storage/migrations/migrator.d.ts +0 -6
  184. package/dist/src/storage/migrations/migrator.d.ts.map +0 -1
  185. package/dist/src/storage/migrations/run-migrations.d.ts +0 -2
  186. package/dist/src/storage/migrations/run-migrations.d.ts.map +0 -1
  187. package/dist/src/storage/migrations/types.d.ts +0 -9
  188. package/dist/src/storage/migrations/types.d.ts.map +0 -1
  189. package/dist/src/storage/txn.d.ts +0 -15
  190. package/dist/src/storage/txn.d.ts.map +0 -1
  191. package/dist/src/subs/default-error-handler.d.ts +0 -13
  192. package/dist/src/subs/default-error-handler.d.ts.map +0 -1
  193. package/dist/src/subs/react-subscription-manager.d.ts +0 -45
  194. package/dist/src/subs/react-subscription-manager.d.ts.map +0 -1
  195. package/dist/src/subs/subscription-notification-read-model.d.ts +0 -18
  196. package/dist/src/subs/subscription-notification-read-model.d.ts.map +0 -1
  197. package/dist/src/subs/types.d.ts +0 -64
  198. package/dist/src/subs/types.d.ts.map +0 -1
  199. package/dist/src/sync/batch-aggregator.d.ts +0 -25
  200. package/dist/src/sync/batch-aggregator.d.ts.map +0 -1
  201. package/dist/src/sync/buffered-mailbox.d.ts +0 -37
  202. package/dist/src/sync/buffered-mailbox.d.ts.map +0 -1
  203. package/dist/src/sync/channels/gql-req-channel.d.ts +0 -133
  204. package/dist/src/sync/channels/gql-req-channel.d.ts.map +0 -1
  205. package/dist/src/sync/channels/gql-request-channel-factory.d.ts +0 -32
  206. package/dist/src/sync/channels/gql-request-channel-factory.d.ts.map +0 -1
  207. package/dist/src/sync/channels/gql-res-channel.d.ts +0 -31
  208. package/dist/src/sync/channels/gql-res-channel.d.ts.map +0 -1
  209. package/dist/src/sync/channels/gql-response-channel-factory.d.ts +0 -13
  210. package/dist/src/sync/channels/gql-response-channel-factory.d.ts.map +0 -1
  211. package/dist/src/sync/channels/index.d.ts +0 -8
  212. package/dist/src/sync/channels/index.d.ts.map +0 -1
  213. package/dist/src/sync/channels/interval-poll-timer.d.ts +0 -40
  214. package/dist/src/sync/channels/interval-poll-timer.d.ts.map +0 -1
  215. package/dist/src/sync/channels/poll-timer.d.ts +0 -14
  216. package/dist/src/sync/channels/poll-timer.d.ts.map +0 -1
  217. package/dist/src/sync/channels/utils.d.ts +0 -44
  218. package/dist/src/sync/channels/utils.d.ts.map +0 -1
  219. package/dist/src/sync/errors.d.ts +0 -16
  220. package/dist/src/sync/errors.d.ts.map +0 -1
  221. package/dist/src/sync/index.d.ts +0 -16
  222. package/dist/src/sync/index.d.ts.map +0 -1
  223. package/dist/src/sync/interfaces.d.ts +0 -203
  224. package/dist/src/sync/interfaces.d.ts.map +0 -1
  225. package/dist/src/sync/mailbox.d.ts +0 -62
  226. package/dist/src/sync/mailbox.d.ts.map +0 -1
  227. package/dist/src/sync/sync-awaiter.d.ts +0 -34
  228. package/dist/src/sync/sync-awaiter.d.ts.map +0 -1
  229. package/dist/src/sync/sync-builder.d.ts +0 -23
  230. package/dist/src/sync/sync-builder.d.ts.map +0 -1
  231. package/dist/src/sync/sync-manager.d.ts +0 -51
  232. package/dist/src/sync/sync-manager.d.ts.map +0 -1
  233. package/dist/src/sync/sync-operation.d.ts +0 -30
  234. package/dist/src/sync/sync-operation.d.ts.map +0 -1
  235. package/dist/src/sync/sync-status-tracker.d.ts +0 -31
  236. package/dist/src/sync/sync-status-tracker.d.ts.map +0 -1
  237. package/dist/src/sync/types.d.ts +0 -165
  238. package/dist/src/sync/types.d.ts.map +0 -1
  239. package/dist/src/sync/utils.d.ts +0 -71
  240. package/dist/src/sync/utils.d.ts.map +0 -1
  241. package/dist/src/utils/reshuffle.d.ts +0 -47
  242. package/dist/src/utils/reshuffle.d.ts.map +0 -1
@@ -1,53 +0,0 @@
1
- import type { ISigner } from "document-model";
2
- import { ReactorClient } from "../client/reactor-client.js";
3
- import type { IEventBus } from "../events/interfaces.js";
4
- import type { ILogger } from "../logging/types.js";
5
- import { type IJobAwaiter } from "../shared/awaiter.js";
6
- import type { SignerConfig } from "../signer/types.js";
7
- import type { IDocumentModelLoader } from "../registry/interfaces.js";
8
- import type { IDocumentIndexer, IDocumentView } from "../storage/interfaces.js";
9
- import type { IReactorSubscriptionManager } from "../subs/types.js";
10
- import type { ReactorBuilder } from "./reactor-builder.js";
11
- import type { IReactor, ReactorClientModule } from "./types.js";
12
- /**
13
- * Builder class for constructing ReactorClient instances with proper configuration
14
- */
15
- export declare class ReactorClientBuilder {
16
- private logger?;
17
- private reactorBuilder?;
18
- private reactor?;
19
- private eventBus?;
20
- private documentIndexer?;
21
- private documentView?;
22
- private signer?;
23
- private signatureVerifier?;
24
- private subscriptionManager?;
25
- private jobAwaiter?;
26
- private documentModelLoader?;
27
- /**
28
- * Sets the logger for the ReactorClient.
29
- * @param logger - The logger to use.
30
- * @returns The ReactorClientBuilder instance.
31
- */
32
- withLogger(logger: ILogger): this;
33
- /**
34
- * Either this or withReactor must be set.
35
- */
36
- withReactorBuilder(reactorBuilder: ReactorBuilder): this;
37
- /**
38
- * Either this or withReactorBuilder must be set.
39
- */
40
- withReactor(reactor: IReactor, eventBus: IEventBus, documentIndexer: IDocumentIndexer, documentView: IDocumentView): this;
41
- /**
42
- * Sets the signer configuration for signing and verifying actions.
43
- *
44
- * @param config - Either an ISigner for signing only, or a SignerConfig for both signing and verification
45
- */
46
- withSigner(config: ISigner | SignerConfig): this;
47
- withSubscriptionManager(subscriptionManager: IReactorSubscriptionManager): this;
48
- withJobAwaiter(jobAwaiter: IJobAwaiter): this;
49
- withDocumentModelLoader(loader: IDocumentModelLoader): this;
50
- build(): Promise<ReactorClient>;
51
- buildModule(): Promise<ReactorClientModule>;
52
- }
53
- //# sourceMappingURL=reactor-client-builder.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"reactor-client-builder.d.ts","sourceRoot":"","sources":["../../../src/core/reactor-client-builder.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAEzD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAc,KAAK,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAEpE,OAAO,KAAK,EAEV,YAAY,EACb,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACtE,OAAO,KAAK,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAGhF,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,kBAAkB,CAAC;AACpE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,KAAK,EAAE,QAAQ,EAAE,mBAAmB,EAAiB,MAAM,YAAY,CAAC;AAE/E;;GAEG;AACH,qBAAa,oBAAoB;IAC/B,OAAO,CAAC,MAAM,CAAC,CAAU;IACzB,OAAO,CAAC,cAAc,CAAC,CAAiB;IACxC,OAAO,CAAC,OAAO,CAAC,CAAW;IAC3B,OAAO,CAAC,QAAQ,CAAC,CAAY;IAC7B,OAAO,CAAC,eAAe,CAAC,CAAmB;IAC3C,OAAO,CAAC,YAAY,CAAC,CAAgB;IACrC,OAAO,CAAC,MAAM,CAAC,CAAU;IACzB,OAAO,CAAC,iBAAiB,CAAC,CAA+B;IACzD,OAAO,CAAC,mBAAmB,CAAC,CAA8B;IAC1D,OAAO,CAAC,UAAU,CAAC,CAAc;IACjC,OAAO,CAAC,mBAAmB,CAAC,CAAuB;IAEnD;;;;OAIG;IACI,UAAU,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI;IAKxC;;OAEG;IACI,kBAAkB,CAAC,cAAc,EAAE,cAAc,GAAG,IAAI;IAS/D;;OAEG;IACI,WAAW,CAChB,OAAO,EAAE,QAAQ,EACjB,QAAQ,EAAE,SAAS,EACnB,eAAe,EAAE,gBAAgB,EACjC,YAAY,EAAE,aAAa,GAC1B,IAAI;IAYP;;;;OAIG;IACI,UAAU,CAAC,MAAM,EAAE,OAAO,GAAG,YAAY,GAAG,IAAI;IAUhD,uBAAuB,CAC5B,mBAAmB,EAAE,2BAA2B,GAC/C,IAAI;IAKA,cAAc,CAAC,UAAU,EAAE,WAAW,GAAG,IAAI;IAK7C,uBAAuB,CAAC,MAAM,EAAE,oBAAoB,GAAG,IAAI;IAKrD,KAAK,IAAI,OAAO,CAAC,aAAa,CAAC;IAK/B,WAAW,IAAI,OAAO,CAAC,mBAAmB,CAAC;CA2EzD"}
@@ -1,56 +0,0 @@
1
- import type { Action, DocumentModelModule, ISigner, Operation, PHDocument } from "document-model";
2
- import type { IEventBus } from "../events/interfaces.js";
3
- import type { IJobExecutorManager } from "../executor/interfaces.js";
4
- import type { IJobTracker } from "../job-tracker/interfaces.js";
5
- import type { ILogger } from "../logging/types.js";
6
- import type { IQueue } from "../queue/interfaces.js";
7
- import type { IReadModelCoordinator } from "../read-models/interfaces.js";
8
- import type { IDocumentModelRegistry } from "../registry/interfaces.js";
9
- import type { ConsistencyToken, JobInfo, PagedResults, PagingOptions, SearchFilter, ShutdownStatus, ViewFilter } from "../shared/types.js";
10
- import type { IDocumentIndexer, IDocumentView, IOperationStore, OperationFilter } from "../storage/interfaces.js";
11
- import type { BatchExecutionRequest, BatchExecutionResult, BatchLoadRequest, BatchLoadResult, IReactor, ReactorFeatures } from "./types.js";
12
- /**
13
- * This class implements the IReactor interface and serves as the main entry point
14
- * for the new Reactor architecture.
15
- */
16
- export declare class Reactor implements IReactor {
17
- private logger;
18
- private documentModelRegistry;
19
- private shutdownStatus;
20
- private setShutdown;
21
- private setCompleted;
22
- private queue;
23
- private jobTracker;
24
- private readModelCoordinator;
25
- private features;
26
- private documentView;
27
- private documentIndexer;
28
- private operationStore;
29
- private eventBus;
30
- private executorManager;
31
- constructor(logger: ILogger, documentModelRegistry: IDocumentModelRegistry, queue: IQueue, jobTracker: IJobTracker, readModelCoordinator: IReadModelCoordinator, features: ReactorFeatures, documentView: IDocumentView, documentIndexer: IDocumentIndexer, operationStore: IOperationStore, eventBus: IEventBus, executorManager: IJobExecutorManager);
32
- kill(): ShutdownStatus;
33
- getDocumentModels(namespace?: string, paging?: PagingOptions, signal?: AbortSignal): Promise<PagedResults<DocumentModelModule>>;
34
- get<TDocument extends PHDocument>(id: string, view?: ViewFilter, consistencyToken?: ConsistencyToken, signal?: AbortSignal): Promise<TDocument>;
35
- getBySlug<TDocument extends PHDocument>(slug: string, view?: ViewFilter, consistencyToken?: ConsistencyToken, signal?: AbortSignal): Promise<TDocument>;
36
- getByIdOrSlug<TDocument extends PHDocument>(identifier: string, view?: ViewFilter, consistencyToken?: ConsistencyToken, signal?: AbortSignal): Promise<TDocument>;
37
- getChildren(documentId: string, consistencyToken?: ConsistencyToken, signal?: AbortSignal): Promise<string[]>;
38
- getParents(childId: string, consistencyToken?: ConsistencyToken, signal?: AbortSignal): Promise<string[]>;
39
- getOperations(documentId: string, view?: ViewFilter, filter?: OperationFilter, paging?: PagingOptions, consistencyToken?: ConsistencyToken, signal?: AbortSignal): Promise<Record<string, PagedResults<Operation>>>;
40
- find(search: SearchFilter, view?: ViewFilter, paging?: PagingOptions, consistencyToken?: ConsistencyToken, signal?: AbortSignal): Promise<PagedResults<PHDocument>>;
41
- create(document: PHDocument, signer?: ISigner, signal?: AbortSignal, meta?: Record<string, unknown>): Promise<JobInfo>;
42
- deleteDocument(id: string, signer?: ISigner, signal?: AbortSignal, meta?: Record<string, unknown>): Promise<JobInfo>;
43
- execute(docId: string, branch: string, actions: Action[], signal?: AbortSignal, meta?: Record<string, unknown>): Promise<JobInfo>;
44
- load(docId: string, branch: string, operations: Operation[], signal?: AbortSignal, meta?: Record<string, unknown>): Promise<JobInfo>;
45
- executeBatch(request: BatchExecutionRequest, signal?: AbortSignal, meta?: Record<string, unknown>): Promise<BatchExecutionResult>;
46
- loadBatch(request: BatchLoadRequest, signal?: AbortSignal, meta?: Record<string, unknown>): Promise<BatchLoadResult>;
47
- addChildren(parentId: string, documentIds: string[], branch?: string, signer?: ISigner, signal?: AbortSignal): Promise<JobInfo>;
48
- removeChildren(parentId: string, documentIds: string[], branch?: string, signer?: ISigner, signal?: AbortSignal): Promise<JobInfo>;
49
- getJobStatus(jobId: string, signal?: AbortSignal): Promise<JobInfo>;
50
- private findByIds;
51
- private findBySlugs;
52
- private findByParentId;
53
- private findByType;
54
- private emitJobPending;
55
- }
56
- //# sourceMappingURL=reactor.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"reactor.d.ts","sourceRoot":"","sources":["../../../src/core/reactor.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,MAAM,EAEN,mBAAmB,EACnB,OAAO,EACP,SAAS,EACT,UAAU,EAC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AU,EAAE,SAAS,EAAE,EACvB,MAAM,CAAC,EAAE,WAAW,EACpB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC7B,OAAO,CAAC,OAAO,CAAC;IA4Db,YAAY,CAChB,OAAO,EAAE,qBAAqB,EAC9B,MAAM,CAAC,EAAE,WAAW,EACpB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC7B,OAAO,CAAC,oBAAoB,CAAC;IA4F1B,SAAS,CACb,OAAO,EAAE,gBAAgB,EACzB,MAAM,CAAC,EAAE,WAAW,EACpB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC7B,OAAO,CAAC,eAAe,CAAC;IA4FrB,WAAW,CACf,QAAQ,EAAE,MAAM,EAChB,WAAW,EAAE,MAAM,EAAE,EACrB,MAAM,GAAE,MAAe,EACvB,MAAM,CAAC,EAAE,OAAO,EAChB,MAAM,CAAC,EAAE,WAAW,GACnB,OAAO,CAAC,OAAO,CAAC;IAuBb,cAAc,CAClB,QAAQ,EAAE,MAAM,EAChB,WAAW,EAAE,MAAM,EAAE,EACrB,MAAM,GAAE,MAAe,EACvB,MAAM,CAAC,EAAE,OAAO,EAChB,MAAM,CAAC,EAAE,WAAW,GACnB,OAAO,CAAC,OAAO,CAAC;IAuBnB,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,OAAO,CAAC;YA6BrD,SAAS;YA8BT,WAAW;YAmBX,cAAc;YAqBd,UAAU;IAkBxB,OAAO,CAAC,cAAc;CASvB"}
@@ -1,312 +0,0 @@
1
- import type { Action, DocumentModelModule, ISigner, Operation, PHDocument } from "document-model";
2
- import type { Kysely } from "kysely";
3
- import type { IProcessorManager } from "@powerhousedao/shared/processors";
4
- import type { IOperationIndex } from "../cache/operation-index-types.js";
5
- import type { IWriteCache } from "../cache/write/interfaces.js";
6
- import type { ReactorClient } from "../client/reactor-client.js";
7
- import type { IEventBus } from "../events/interfaces.js";
8
- import type { IJobExecutorManager } from "../executor/interfaces.js";
9
- import type { IJobTracker } from "../job-tracker/interfaces.js";
10
- import type { IQueue } from "../queue/interfaces.js";
11
- import type { IReadModelCoordinator } from "../read-models/interfaces.js";
12
- import type { DocumentViewDatabase } from "../read-models/types.js";
13
- import type { IDocumentModelRegistry } from "../registry/interfaces.js";
14
- import type { IJobAwaiter } from "../shared/awaiter.js";
15
- import type { IConsistencyTracker } from "../shared/consistency-tracker.js";
16
- import type { ConsistencyToken, JobInfo, PagedResults, PagingOptions, SearchFilter, ShutdownStatus, ViewFilter } from "../shared/types.js";
17
- import type { IDocumentIndexer, IDocumentView, IKeyframeStore, IOperationStore, ISyncCursorStorage, ISyncDeadLetterStorage, ISyncRemoteStorage, OperationFilter } from "../storage/interfaces.js";
18
- import type { DocumentIndexerDatabase, Database as StorageDatabase } from "../storage/kysely/types.js";
19
- import type { IReactorSubscriptionManager } from "../subs/types.js";
20
- import type { IChannelFactory, ISyncManager } from "../sync/interfaces.js";
21
- /**
22
- * A single mutation job within a batch request.
23
- */
24
- export type ExecutionJobPlan = {
25
- key: string;
26
- documentId: string;
27
- scope: string;
28
- branch: string;
29
- actions: Action[];
30
- dependsOn: string[];
31
- };
32
- /**
33
- * Request for batch mutation operation.
34
- */
35
- export type BatchExecutionRequest = {
36
- jobs: ExecutionJobPlan[];
37
- };
38
- /**
39
- * Result from batch mutation operation.
40
- */
41
- export type BatchExecutionResult = {
42
- jobs: Record<string, JobInfo>;
43
- };
44
- /**
45
- * A single load job within a batch request.
46
- */
47
- export type LoadJobPlan = {
48
- key: string;
49
- documentId: string;
50
- scope: string;
51
- branch: string;
52
- operations: Operation[];
53
- dependsOn: string[];
54
- };
55
- /**
56
- * Request for batch load operation.
57
- */
58
- export type BatchLoadRequest = {
59
- jobs: LoadJobPlan[];
60
- };
61
- /**
62
- * Result from batch load operation.
63
- */
64
- export type BatchLoadResult = {
65
- jobs: Record<string, JobInfo>;
66
- };
67
- /**
68
- * The main Reactor interface that serves as a facade for document operations.
69
- * This interface provides a unified API for document management, including
70
- * creation, retrieval, mutation, and deletion operations.
71
- */
72
- export interface IReactor {
73
- /**
74
- * Signals that the reactor should shutdown.
75
- */
76
- kill(): ShutdownStatus;
77
- /**
78
- * Retrieves a list of document model modules.
79
- *
80
- * @param namespace - Optional namespace like "powerhouse" or "sky", defaults to ""
81
- * @param paging - Optional options for paging data in large queries.
82
- * @param signal - Optional abort signal to cancel the request
83
- * @returns List of document model modules
84
- */
85
- getDocumentModels(namespace?: string, paging?: PagingOptions, signal?: AbortSignal): Promise<PagedResults<DocumentModelModule>>;
86
- /**
87
- * Retrieves a specific PHDocument by id
88
- *
89
- * @param id - Required, this is the document id
90
- * @param view - Optional filter containing branch and scopes information
91
- * @param consistencyToken - Optional token for read-after-write consistency
92
- * @param signal - Optional abort signal to cancel the request
93
- * @returns The up-to-date PHDocument
94
- */
95
- get<TDocument extends PHDocument>(id: string, view?: ViewFilter, consistencyToken?: ConsistencyToken, signal?: AbortSignal): Promise<TDocument>;
96
- /**
97
- * Retrieves a specific PHDocument by slug
98
- *
99
- * @param slug - Required, this is the document slug
100
- * @param view - Optional filter containing branch and scopes information
101
- * @param consistencyToken - Optional token for read-after-write consistency
102
- * @param signal - Optional abort signal to cancel the request
103
- * @returns The up-to-date PHDocument with scopes and list of child document ids
104
- */
105
- getBySlug<TDocument extends PHDocument>(slug: string, view?: ViewFilter, consistencyToken?: ConsistencyToken, signal?: AbortSignal): Promise<TDocument>;
106
- /**
107
- * Retrieves a specific PHDocument by identifier (either id or slug).
108
- * Throws an error if the identifier matches both an id and a slug that refer to different documents.
109
- *
110
- * @param identifier - Required, this is the document id or slug
111
- * @param view - Optional filter containing branch and scopes information
112
- * @param consistencyToken - Optional token for read-after-write consistency
113
- * @param signal - Optional abort signal to cancel the request
114
- * @returns The up-to-date PHDocument with scopes and list of child document ids
115
- * @throws {Error} If identifier matches both an ID and slug referring to different documents
116
- */
117
- getByIdOrSlug<TDocument extends PHDocument>(identifier: string, view?: ViewFilter, consistencyToken?: ConsistencyToken, signal?: AbortSignal): Promise<TDocument>;
118
- /**
119
- * Retrieves the children of a document
120
- *
121
- * @param parentId - The parent document id
122
- * @param consistencyToken - Optional token for read-after-write consistency
123
- * @param signal - Optional abort signal to cancel the request
124
- * @returns The list of child document ids
125
- */
126
- getChildren(parentId: string, consistencyToken?: ConsistencyToken, signal?: AbortSignal): Promise<string[]>;
127
- /**
128
- * Retrieves the parents of a document
129
- *
130
- * @param childId - The child document id
131
- * @param consistencyToken - Optional token for read-after-write consistency
132
- * @param signal - Optional abort signal to cancel the request
133
- * @returns The list of parent document ids
134
- */
135
- getParents(childId: string, consistencyToken?: ConsistencyToken, signal?: AbortSignal): Promise<string[]>;
136
- /**
137
- * Retrieves the operations for a document
138
- *
139
- * @param documentId - The document id
140
- * @param view - Optional filter containing branch and scopes information
141
- * @param filter - Optional filter for actionTypes, timestamps, and revision
142
- * @param paging - Optional pagination options
143
- * @param consistencyToken - Optional token for read-after-write consistency
144
- * @param signal - Optional abort signal to cancel the request
145
- * @returns The list of operations
146
- */
147
- getOperations(documentId: string, view?: ViewFilter, filter?: OperationFilter, paging?: PagingOptions, consistencyToken?: ConsistencyToken, signal?: AbortSignal): Promise<Record<string, PagedResults<Operation>>>;
148
- /**
149
- * Filters documents by criteria and returns a list of them
150
- *
151
- * @param search - Search filter options (type, parentId, identifiers)
152
- * @param view - Optional filter containing branch and scopes information
153
- * @param paging - Optional pagination options
154
- * @param consistencyToken - Optional token for read-after-write consistency
155
- * @param signal - Optional abort signal to cancel the request
156
- * @returns List of documents matching criteria and pagination cursor
157
- */
158
- find(search: SearchFilter, view?: ViewFilter, paging?: PagingOptions, consistencyToken?: ConsistencyToken, signal?: AbortSignal): Promise<PagedResults<PHDocument>>;
159
- /**
160
- * Creates a document
161
- *
162
- * @param document - Document with optional id, slug, parent, model type, and initial state
163
- * @param signer - Optional signer to sign the actions
164
- * @param signal - Optional abort signal to cancel the request
165
- * @param meta - Optional metadata that flows through the job lifecycle
166
- * @returns The job status
167
- */
168
- create(document: PHDocument, signer?: ISigner, signal?: AbortSignal, meta?: Record<string, unknown>): Promise<JobInfo>;
169
- /**
170
- * Deletes a document
171
- *
172
- * @param id - Document id
173
- * @param signer - Optional signer to sign the actions
174
- * @param signal - Optional abort signal to cancel the request
175
- * @param meta - Optional metadata that flows through the job lifecycle
176
- * @returns The job id and status
177
- */
178
- deleteDocument(id: string, signer?: ISigner, signal?: AbortSignal, meta?: Record<string, unknown>): Promise<JobInfo>;
179
- /**
180
- * Applies a list of actions to a document.
181
- *
182
- * @param docId - Document id
183
- * @param branch - Branch to apply actions to
184
- * @param actions - List of actions to apply
185
- * @param signal - Optional abort signal to cancel the request
186
- * @param meta - Optional metadata that flows through the job lifecycle
187
- * @returns The job id and status
188
- */
189
- execute(docId: string, branch: string, actions: Action[], signal?: AbortSignal, meta?: Record<string, unknown>): Promise<JobInfo>;
190
- /**
191
- * Loads existing operations generated elsewhere into this reactor.
192
- *
193
- * @param docId - Document id
194
- * @param branch - Branch to load operations to
195
- * @param operations - List of operations to load
196
- * @param signal - Optional abort signal to cancel the request
197
- * @param meta - Optional metadata that flows through the job lifecycle
198
- * @returns The job id and status
199
- */
200
- load(docId: string, branch: string, operations: Operation[], signal?: AbortSignal, meta?: Record<string, unknown>): Promise<JobInfo>;
201
- /**
202
- * Applies multiple mutations across documents with dependency management.
203
- *
204
- * @param request - Batch mutation request containing jobs with dependencies
205
- * @param signal - Optional abort signal to cancel the request
206
- * @param meta - Optional metadata that flows through the job lifecycle
207
- * @returns Map of job keys to job information
208
- */
209
- executeBatch(request: BatchExecutionRequest, signal?: AbortSignal, meta?: Record<string, unknown>): Promise<BatchExecutionResult>;
210
- /**
211
- * Loads multiple batches of pre-existing operations across documents with dependency management.
212
- *
213
- * @param request - Batch load request containing jobs with dependencies
214
- * @param signal - Optional abort signal to cancel the request
215
- * @param meta - Optional metadata that flows through the job lifecycle
216
- * @returns Map of job keys to job information
217
- */
218
- loadBatch(request: BatchLoadRequest, signal?: AbortSignal, meta?: Record<string, unknown>): Promise<BatchLoadResult>;
219
- /**
220
- * Adds multiple documents as children to another
221
- *
222
- * @param parentId - Parent document id
223
- * @param documentIds - List of document ids to add as children
224
- * @param branch - Branch to add children to, defaults to "main"
225
- * @param signer - Optional signer to sign the actions
226
- * @param signal - Optional abort signal to cancel the request
227
- * @returns The job id and status
228
- */
229
- addChildren(parentId: string, documentIds: string[], branch?: string, signer?: ISigner, signal?: AbortSignal): Promise<JobInfo>;
230
- /**
231
- * Removes multiple documents as children from another
232
- *
233
- * @param parentId - Parent document id
234
- * @param documentIds - List of document ids to remove as children
235
- * @param branch - Branch to remove children from, defaults to "main"
236
- * @param signer - Optional signer to sign the actions
237
- * @param signal - Optional abort signal to cancel the request
238
- * @returns The job id and status
239
- */
240
- removeChildren(parentId: string, documentIds: string[], branch?: string, signer?: ISigner, signal?: AbortSignal): Promise<JobInfo>;
241
- /**
242
- * Retrieves the status of a job
243
- *
244
- * @param jobId - The job id
245
- * @returns The job status
246
- */
247
- getJobStatus(jobId: string, signal?: AbortSignal): Promise<JobInfo>;
248
- }
249
- /**
250
- * Feature flags for reactor configuration
251
- */
252
- export type ReactorFeatures = {
253
- [key: string]: boolean;
254
- };
255
- /**
256
- * Combined database type that includes all schemas
257
- */
258
- export type Database = StorageDatabase & DocumentViewDatabase & DocumentIndexerDatabase;
259
- /**
260
- * Container for all sync manager dependencies created during the build process.
261
- */
262
- export interface SyncModule {
263
- remoteStorage: ISyncRemoteStorage;
264
- cursorStorage: ISyncCursorStorage;
265
- deadLetterStorage: ISyncDeadLetterStorage;
266
- channelFactory: IChannelFactory;
267
- syncManager: ISyncManager;
268
- }
269
- /**
270
- * Container for all reactor dependencies created during the build process.
271
- * Provides direct access to internal components for advanced use cases,
272
- * testing, or integration scenarios.
273
- */
274
- export interface ReactorModule {
275
- eventBus: IEventBus;
276
- documentModelRegistry: IDocumentModelRegistry;
277
- queue: IQueue;
278
- jobTracker: IJobTracker;
279
- executorManager: IJobExecutorManager;
280
- database: Kysely<Database>;
281
- operationStore: IOperationStore;
282
- keyframeStore: IKeyframeStore;
283
- writeCache: IWriteCache;
284
- operationIndex: IOperationIndex;
285
- documentView: IDocumentView;
286
- documentViewConsistencyTracker: IConsistencyTracker;
287
- documentIndexer: IDocumentIndexer;
288
- documentIndexerConsistencyTracker: IConsistencyTracker;
289
- readModelCoordinator: IReadModelCoordinator;
290
- subscriptionManager: IReactorSubscriptionManager;
291
- processorManager: IProcessorManager;
292
- processorManagerConsistencyTracker: IConsistencyTracker;
293
- syncModule: SyncModule | undefined;
294
- reactor: IReactor;
295
- }
296
- /**
297
- * Container for all reactor client dependencies created during the build process.
298
- * Provides direct access to internal components for advanced use cases,
299
- * testing, or integration scenarios.
300
- */
301
- export interface ReactorClientModule {
302
- client: ReactorClient;
303
- reactor: IReactor;
304
- eventBus: IEventBus;
305
- documentIndexer: IDocumentIndexer;
306
- documentView: IDocumentView;
307
- signer: ISigner;
308
- subscriptionManager: IReactorSubscriptionManager;
309
- jobAwaiter: IJobAwaiter;
310
- reactorModule: ReactorModule | undefined;
311
- }
312
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/core/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,MAAM,EACN,mBAAmB,EACnB,OAAO,EACP,SAAS,EACT,UAAU,EACX,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAErC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AAC1E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AACzE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6B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AAE,eAAe,CAAC;IAChC,aAAa,EAAE,cAAc,CAAC;IAC9B,UAAU,EAAE,WAAW,CAAC;IACxB,cAAc,EAAE,eAAe,CAAC;IAChC,YAAY,EAAE,aAAa,CAAC;IAC5B,8BAA8B,EAAE,mBAAmB,CAAC;IACpD,eAAe,EAAE,gBAAgB,CAAC;IAClC,iCAAiC,EAAE,mBAAmB,CAAC;IACvD,oBAAoB,EAAE,qBAAqB,CAAC;IAC5C,mBAAmB,EAAE,2BAA2B,CAAC;IACjD,gBAAgB,EAAE,iBAAiB,CAAC;IACpC,kCAAkC,EAAE,mBAAmB,CAAC;IACxD,UAAU,EAAE,UAAU,GAAG,SAAS,CAAC;IACnC,OAAO,EAAE,QAAQ,CAAC;CACnB;AAED;;;;GAIG;AACH,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,aAAa,CAAC;IACtB,OAAO,EAAE,QAAQ,CAAC;IAClB,QAAQ,EAAE,SAAS,CAAC;IACpB,eAAe,EAAE,gBAAgB,CAAC;IAClC,YAAY,EAAE,aAAa,CAAC;IAC5B,MAAM,EAAE,OAAO,CAAC;IAChB,mBAAmB,EAAE,2BAA2B,CAAC;IACjD,UAAU,EAAE,WAAW,CAAC;IACxB,aAAa,EAAE,aAAa,GAAG,SAAS,CAAC;CAC1C"}
@@ -1,95 +0,0 @@
1
- import type { Action, ISigner, Operation, PHDocument } from "document-model";
2
- import type { ErrorInfo, JobMeta, PagedResults } from "../shared/types.js";
3
- /**
4
- * Represents a minimal job plan for validation purposes
5
- */
6
- export type JobPlanForValidation = {
7
- key: string;
8
- actions: Action[];
9
- dependsOn: string[];
10
- };
11
- /**
12
- * Represents a minimal load job plan for validation purposes
13
- */
14
- export type LoadJobPlanForValidation = {
15
- key: string;
16
- operations: Operation[];
17
- dependsOn: string[];
18
- };
19
- /**
20
- * Represents a job plan with scope information for action validation
21
- */
22
- export type JobPlanWithScope = {
23
- key: string;
24
- scope: string;
25
- actions: Action[];
26
- };
27
- /**
28
- * Represents a load job plan with scope information for operation validation
29
- */
30
- export type LoadJobPlanWithScope = {
31
- key: string;
32
- scope: string;
33
- operations: Operation[];
34
- };
35
- /**
36
- * Represents a job plan with dependencies for topological sorting
37
- */
38
- export type JobPlanForSorting = {
39
- key: string;
40
- dependsOn: string[];
41
- };
42
- /**
43
- * Validates structural properties shared by all batch requests:
44
- * duplicate keys, missing dependencies, and dependency cycles.
45
- */
46
- export declare function validateBatchStructure(jobs: JobPlanForSorting[]): void;
47
- /**
48
- * Validates a batch mutation request for common errors
49
- */
50
- export declare function validateBatchRequest(jobs: JobPlanForValidation[]): void;
51
- /**
52
- * Validates a batch load request for common errors
53
- */
54
- export declare function validateBatchLoadRequest(jobs: LoadJobPlanForValidation[]): void;
55
- /**
56
- * Validates that all actions in a job match the declared scope
57
- */
58
- export declare function validateActionScopes(job: JobPlanWithScope): void;
59
- /**
60
- * Validates that all operations in a job match the declared scope
61
- */
62
- export declare function validateOperationScopes(job: LoadJobPlanWithScope): void;
63
- /**
64
- * Performs topological sort on jobs based on dependencies
65
- */
66
- export declare function topologicalSort(jobs: JobPlanForSorting[]): string[];
67
- /**
68
- * Converts an Error or string to ErrorInfo
69
- */
70
- export declare function toErrorInfo(error: Error | string): ErrorInfo;
71
- /**
72
- * Filters paged results by document type
73
- */
74
- export declare function filterByType(results: PagedResults<PHDocument>, type: string): PagedResults<PHDocument>;
75
- /**
76
- * Validates that all operations share the same scope.
77
- * Throws an error if any operation has a different scope.
78
- */
79
- export declare function getSharedOperationScope(operations: Operation[]): string;
80
- /**
81
- * Validates that all actions share the same scope.
82
- * Throws an error if any action has a different scope.
83
- */
84
- export declare function getSharedActionScope(actions: Action[]): string;
85
- /**
86
- * Signs an action with the provided signer.
87
- * If the action already has valid signatures, it is returned unchanged.
88
- */
89
- export declare const signAction: (action: Action, signer: ISigner, signal?: AbortSignal) => Promise<Action>;
90
- /**
91
- * Signs multiple actions with the provided signer
92
- */
93
- export declare const signActions: (actions: Action[], signer: ISigner, signal?: AbortSignal) => Promise<Action[]>;
94
- export declare function buildSingleJobMeta(jobId: string, callerMeta?: Record<string, unknown>): JobMeta;
95
- //# sourceMappingURL=utils.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/core/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,MAAM,EACN,OAAO,EACP,SAAS,EACT,UAAU,EAEX,MAAM,gBAAgB,CAAC;AAExB,OAAO,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAE3E;;GAEG;AACH,MAAM,MAAM,oBAAoB,GAAG;IACjC,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,SAAS,EAAE,MAAM,EAAE,CAAC;CACrB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,wBAAwB,GAAG;IACrC,GAAG,EAAE,MAAM,CAAC;IACZ,UAAU,EAAE,SAAS,EAAE,CAAC;IACxB,SAAS,EAAE,MAAM,EAAE,CAAC;CACrB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC7B,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,oBAAoB,GAAG;IACjC,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,SAAS,EAAE,CAAC;CACzB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC9B,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,EAAE,MAAM,EAAE,CAAC;CACrB,CAAC;AAEF;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,iBAAiB,EAAE,GAAG,IAAI,CA4CtE;AAED;;GAEG;AACH,wBAAgB,oBAAoB,C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ubscribe } from "./types.js";
3
- export declare class EventBus implements IEventBus {
4
- readonly eventTypeToSubscribers: Map<number, Subscriber[]>;
5
- subscribe<K>(type: number, subscriber: (type: number, event: K) => void | Promise<void>): Unsubscribe;
6
- emit(type: number, data: any): Promise<void>;
7
- }
8
- //# sourceMappingURL=event-bus.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"event-bus.d.ts","sourceRoot":"","sources":["../../../src/events/event-bus.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAG1D,qBAAa,QAAS,YAAW,SAAS;IACxC,SAAgB,sBAAsB,4BAAmC;IAEzE,SAAS,CAAC,CAAC,EACT,IAAI,EAAE,MAAM,EACZ,UAAU,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,GAC3D,WAAW;IA8BR,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC;CAwBnD"}
@@ -1,27 +0,0 @@
1
- import type { Unsubscribe } from "./types.js";
2
- /**
3
- * Describes an object that manages event subscriptions and emissions.
4
- */
5
- export interface IEventBus {
6
- /**
7
- * Register a new subscriber.
8
- * Order is preserved by pushing to the end of the per-type array.
9
- *
10
- * @param type - The type of event to subscribe to.
11
- * @param subscriber - The subscriber function to call when the event is emitted.
12
- *
13
- * @returns A function to unsubscribe from the event.
14
- */
15
- subscribe<K>(type: number, subscriber: (type: number, event: K) => void | Promise<void>): Unsubscribe;
16
- /**
17
- * Emits an event and waits until **all** subscribers finish.
18
- * - Every subscriber present at emit-start is called, in registration order.
19
- * - Calls are invoked and settled sequentially.
20
- * - If subscribers throw/reject, `emit` rejects with an aggregate error of all errors.
21
- *
22
- * @param type - The type of event to emit.
23
- * @param data - The data to pass to the subscribers.
24
- */
25
- emit(type: number, data: any): Promise<void>;
26
- }
27
- //# sourceMappingURL=interfaces.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../src/events/interfaces.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE9C;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB;;;;;;;;OAQG;IACH,SAAS,CAAC,CAAC,EACT,IAAI,EAAE,MAAM,EACZ,UAAU,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,GAC3D,WAAW,CAAC;IAEf;;;;;;;;OAQG;IACH,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC9C"}