@cratis/chronicle 6.57.0 → 6.58.0

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 (234) hide show
  1. package/EventStore.ts +2 -2
  2. package/dist/EventStore.js +2 -2
  3. package/dist/EventStore.js.map +1 -1
  4. package/dist/observation/batches/BatchContext.d.ts +43 -0
  5. package/dist/observation/batches/BatchContext.d.ts.map +1 -0
  6. package/dist/observation/batches/BatchContext.js +60 -0
  7. package/dist/observation/batches/BatchContext.js.map +1 -0
  8. package/dist/observation/batches/BatchContextObserver.d.ts +14 -0
  9. package/dist/observation/batches/BatchContextObserver.d.ts.map +1 -0
  10. package/dist/observation/batches/BatchContextObserver.js +4 -0
  11. package/dist/observation/batches/BatchContextObserver.js.map +1 -0
  12. package/dist/observation/batches/BatchContextValues.d.ts +13 -0
  13. package/dist/observation/batches/BatchContextValues.d.ts.map +1 -0
  14. package/dist/observation/batches/BatchContextValues.js +4 -0
  15. package/dist/observation/batches/BatchContextValues.js.map +1 -0
  16. package/dist/observation/batches/BatchMethod.d.ts +9 -0
  17. package/dist/observation/batches/BatchMethod.d.ts.map +1 -0
  18. package/dist/observation/batches/BatchMethod.js +4 -0
  19. package/dist/observation/batches/BatchMethod.js.map +1 -0
  20. package/dist/observation/batches/BatchMethodReturnedAValue.d.ts +12 -0
  21. package/dist/observation/batches/BatchMethodReturnedAValue.d.ts.map +1 -0
  22. package/dist/observation/batches/BatchMethodReturnedAValue.js +20 -0
  23. package/dist/observation/batches/BatchMethodReturnedAValue.js.map +1 -0
  24. package/dist/observation/batches/BatchMethods.d.ts +31 -0
  25. package/dist/observation/batches/BatchMethods.d.ts.map +1 -0
  26. package/dist/observation/batches/BatchMethods.js +81 -0
  27. package/dist/observation/batches/BatchMethods.js.map +1 -0
  28. package/dist/observation/batches/BatchOutcome.d.ts +15 -0
  29. package/dist/observation/batches/BatchOutcome.d.ts.map +1 -0
  30. package/dist/observation/batches/BatchOutcome.js +4 -0
  31. package/dist/observation/batches/BatchOutcome.js.map +1 -0
  32. package/dist/observation/batches/BatchOutcomeKind.d.ts +8 -0
  33. package/dist/observation/batches/BatchOutcomeKind.d.ts.map +1 -0
  34. package/dist/observation/batches/BatchOutcomeKind.js +11 -0
  35. package/dist/observation/batches/BatchOutcomeKind.js.map +1 -0
  36. package/dist/observation/batches/DeferralNotSupportedByKernel.d.ts +13 -0
  37. package/dist/observation/batches/DeferralNotSupportedByKernel.d.ts.map +1 -0
  38. package/dist/observation/batches/DeferralNotSupportedByKernel.js +19 -0
  39. package/dist/observation/batches/DeferralNotSupportedByKernel.js.map +1 -0
  40. package/dist/observation/batches/DeliveredPartition.d.ts +11 -0
  41. package/dist/observation/batches/DeliveredPartition.d.ts.map +1 -0
  42. package/dist/observation/batches/DeliveredPartition.js +4 -0
  43. package/dist/observation/batches/DeliveredPartition.js.map +1 -0
  44. package/dist/observation/batches/EventAndContext.d.ts +28 -0
  45. package/dist/observation/batches/EventAndContext.d.ts.map +1 -0
  46. package/dist/observation/batches/EventAndContext.js +35 -0
  47. package/dist/observation/batches/EventAndContext.js.map +1 -0
  48. package/dist/observation/batches/EventBatch.d.ts +52 -0
  49. package/dist/observation/batches/EventBatch.d.ts.map +1 -0
  50. package/dist/observation/batches/EventBatch.js +92 -0
  51. package/dist/observation/batches/EventBatch.js.map +1 -0
  52. package/dist/observation/batches/EventTypeObservedByMoreThanOneMethod.d.ts +14 -0
  53. package/dist/observation/batches/EventTypeObservedByMoreThanOneMethod.d.ts.map +1 -0
  54. package/dist/observation/batches/EventTypeObservedByMoreThanOneMethod.js +23 -0
  55. package/dist/observation/batches/EventTypeObservedByMoreThanOneMethod.js.map +1 -0
  56. package/dist/observation/batches/InvalidBatchMethod.d.ts +13 -0
  57. package/dist/observation/batches/InvalidBatchMethod.d.ts.map +1 -0
  58. package/dist/observation/batches/InvalidBatchMethod.js +20 -0
  59. package/dist/observation/batches/InvalidBatchMethod.js.map +1 -0
  60. package/dist/observation/batches/ObservationOrigin.d.ts +21 -0
  61. package/dist/observation/batches/ObservationOrigin.d.ts.map +1 -0
  62. package/dist/observation/batches/ObservationOrigin.js +32 -0
  63. package/dist/observation/batches/ObservationOrigin.js.map +1 -0
  64. package/dist/observation/batches/ObservedEventType.d.ts +11 -0
  65. package/dist/observation/batches/ObservedEventType.d.ts.map +1 -0
  66. package/dist/observation/batches/ObservedEventType.js +4 -0
  67. package/dist/observation/batches/ObservedEventType.js.map +1 -0
  68. package/dist/observation/batches/PageMessages.d.ts +22 -0
  69. package/dist/observation/batches/PageMessages.d.ts.map +1 -0
  70. package/dist/observation/batches/PageMessages.js +32 -0
  71. package/dist/observation/batches/PageMessages.js.map +1 -0
  72. package/dist/observation/batches/PartitionFailedInBatch.d.ts +10 -0
  73. package/dist/observation/batches/PartitionFailedInBatch.d.ts.map +1 -0
  74. package/dist/observation/batches/PartitionFailedInBatch.js +16 -0
  75. package/dist/observation/batches/PartitionFailedInBatch.js.map +1 -0
  76. package/dist/observation/batches/PartitionNotInBatch.d.ts +10 -0
  77. package/dist/observation/batches/PartitionNotInBatch.d.ts.map +1 -0
  78. package/dist/observation/batches/PartitionNotInBatch.js +16 -0
  79. package/dist/observation/batches/PartitionNotInBatch.js.map +1 -0
  80. package/dist/observation/batches/PartitionOutcome.d.ts +19 -0
  81. package/dist/observation/batches/PartitionOutcome.d.ts.map +1 -0
  82. package/dist/observation/batches/PartitionOutcome.js +4 -0
  83. package/dist/observation/batches/PartitionOutcome.js.map +1 -0
  84. package/dist/observation/batches/PartitionProblem.d.ts +17 -0
  85. package/dist/observation/batches/PartitionProblem.d.ts.map +1 -0
  86. package/dist/observation/batches/PartitionProblem.js +4 -0
  87. package/dist/observation/batches/PartitionProblem.js.map +1 -0
  88. package/dist/observation/batches/PartitionSettlement.d.ts +29 -0
  89. package/dist/observation/batches/PartitionSettlement.d.ts.map +1 -0
  90. package/dist/observation/batches/PartitionSettlement.js +64 -0
  91. package/dist/observation/batches/PartitionSettlement.js.map +1 -0
  92. package/dist/observation/batches/ReducerMixesBatchAndPerEventMethods.d.ts +12 -0
  93. package/dist/observation/batches/ReducerMixesBatchAndPerEventMethods.d.ts.map +1 -0
  94. package/dist/observation/batches/ReducerMixesBatchAndPerEventMethods.js +20 -0
  95. package/dist/observation/batches/ReducerMixesBatchAndPerEventMethods.js.map +1 -0
  96. package/dist/observation/batches/batchSize.d.ts +42 -0
  97. package/dist/observation/batches/batchSize.d.ts.map +1 -0
  98. package/dist/observation/batches/batchSize.js +55 -0
  99. package/dist/observation/batches/batchSize.js.map +1 -0
  100. package/dist/observation/batches/createBatchContext.d.ts +13 -0
  101. package/dist/observation/batches/createBatchContext.d.ts.map +1 -0
  102. package/dist/observation/batches/createBatchContext.js +27 -0
  103. package/dist/observation/batches/createBatchContext.js.map +1 -0
  104. package/dist/observation/batches/observes.d.ts +39 -0
  105. package/dist/observation/batches/observes.d.ts.map +1 -0
  106. package/dist/observation/batches/observes.js +63 -0
  107. package/dist/observation/batches/observes.js.map +1 -0
  108. package/dist/observation/batches/runConcurrently.d.ts +9 -0
  109. package/dist/observation/batches/runConcurrently.d.ts.map +1 -0
  110. package/dist/observation/batches/runConcurrently.js +22 -0
  111. package/dist/observation/batches/runConcurrently.js.map +1 -0
  112. package/dist/observation/createHandlerInstanceValidator.d.ts +1 -1
  113. package/dist/observation/createHandlerInstanceValidator.d.ts.map +1 -1
  114. package/dist/observation/createHandlerInstanceValidator.js +5 -7
  115. package/dist/observation/createHandlerInstanceValidator.js.map +1 -1
  116. package/dist/observation/getInstanceMethods.d.ts +3 -1
  117. package/dist/observation/getInstanceMethods.d.ts.map +1 -1
  118. package/dist/observation/getInstanceMethods.js +13 -4
  119. package/dist/observation/getInstanceMethods.js.map +1 -1
  120. package/dist/observation/index.d.ts +14 -0
  121. package/dist/observation/index.d.ts.map +1 -1
  122. package/dist/observation/index.js +13 -0
  123. package/dist/observation/index.js.map +1 -1
  124. package/dist/reactors/ReactorDispatcher.d.ts +15 -0
  125. package/dist/reactors/ReactorDispatcher.d.ts.map +1 -1
  126. package/dist/reactors/ReactorDispatcher.js +25 -2
  127. package/dist/reactors/ReactorDispatcher.js.map +1 -1
  128. package/dist/reactors/ReactorObservationTarget.d.ts +45 -0
  129. package/dist/reactors/ReactorObservationTarget.d.ts.map +1 -0
  130. package/dist/reactors/ReactorObservationTarget.js +4 -0
  131. package/dist/reactors/ReactorObservationTarget.js.map +1 -0
  132. package/dist/reactors/ReactorPageDispatcher.d.ts +33 -0
  133. package/dist/reactors/ReactorPageDispatcher.d.ts.map +1 -0
  134. package/dist/reactors/ReactorPageDispatcher.js +293 -0
  135. package/dist/reactors/ReactorPageDispatcher.js.map +1 -0
  136. package/dist/reactors/Reactors.d.ts.map +1 -1
  137. package/dist/reactors/Reactors.js +21 -149
  138. package/dist/reactors/Reactors.js.map +1 -1
  139. package/dist/reactors/for_Reactors/given/observe_reactor_messages.d.ts +14 -0
  140. package/dist/reactors/for_Reactors/given/observe_reactor_messages.d.ts.map +1 -0
  141. package/dist/reactors/for_Reactors/given/observe_reactor_messages.js +61 -0
  142. package/dist/reactors/for_Reactors/given/observe_reactor_messages.js.map +1 -0
  143. package/dist/reactors/index.d.ts +2 -0
  144. package/dist/reactors/index.d.ts.map +1 -1
  145. package/dist/reactors/index.js +1 -0
  146. package/dist/reactors/index.js.map +1 -1
  147. package/dist/reducers/ReducerEventDispatcher.d.ts +26 -1
  148. package/dist/reducers/ReducerEventDispatcher.d.ts.map +1 -1
  149. package/dist/reducers/ReducerEventDispatcher.js +35 -3
  150. package/dist/reducers/ReducerEventDispatcher.js.map +1 -1
  151. package/dist/reducers/Reducers.d.ts +2 -0
  152. package/dist/reducers/Reducers.d.ts.map +1 -1
  153. package/dist/reducers/Reducers.js +94 -22
  154. package/dist/reducers/Reducers.js.map +1 -1
  155. package/dist/reducers/ReductionOutcome.d.ts +27 -3
  156. package/dist/reducers/ReductionOutcome.d.ts.map +1 -1
  157. package/dist/reducers/ReductionOutcome.js +51 -7
  158. package/dist/reducers/ReductionOutcome.js.map +1 -1
  159. package/dist/reducers/for_Reducers/given/observe_reducer_messages.d.ts +19 -0
  160. package/dist/reducers/for_Reducers/given/observe_reducer_messages.d.ts.map +1 -0
  161. package/dist/reducers/for_Reducers/given/observe_reducer_messages.js +61 -0
  162. package/dist/reducers/for_Reducers/given/observe_reducer_messages.js.map +1 -0
  163. package/dist/reducers/index.d.ts +2 -0
  164. package/dist/reducers/index.d.ts.map +1 -1
  165. package/dist/reducers/index.js +1 -0
  166. package/dist/reducers/index.js.map +1 -1
  167. package/dist/testing/ReactorScenario.d.ts.map +1 -1
  168. package/dist/testing/ReactorScenario.js +4 -1
  169. package/dist/testing/ReactorScenario.js.map +1 -1
  170. package/dist/testing/ReducerReadModelProcessor.d.ts +1 -0
  171. package/dist/testing/ReducerReadModelProcessor.d.ts.map +1 -1
  172. package/dist/testing/ReducerReadModelProcessor.js +45 -0
  173. package/dist/testing/ReducerReadModelProcessor.js.map +1 -1
  174. package/dist/tsconfig.tsbuildinfo +1 -1
  175. package/observation/batches/BatchContext.ts +75 -0
  176. package/observation/batches/BatchContextObserver.ts +16 -0
  177. package/observation/batches/BatchContextValues.ts +16 -0
  178. package/observation/batches/BatchMethod.ts +13 -0
  179. package/observation/batches/BatchMethodReturnedAValue.ts +16 -0
  180. package/observation/batches/BatchMethods.ts +90 -0
  181. package/observation/batches/BatchOutcome.ts +22 -0
  182. package/observation/batches/BatchOutcomeKind.ts +11 -0
  183. package/observation/batches/DeferralNotSupportedByKernel.ts +17 -0
  184. package/observation/batches/DeliveredPartition.ts +16 -0
  185. package/observation/batches/EventAndContext.ts +37 -0
  186. package/observation/batches/EventBatch.ts +105 -0
  187. package/observation/batches/EventTypeObservedByMoreThanOneMethod.ts +17 -0
  188. package/observation/batches/InvalidBatchMethod.ts +16 -0
  189. package/observation/batches/ObservationOrigin.ts +37 -0
  190. package/observation/batches/ObservedEventType.ts +16 -0
  191. package/observation/batches/PageMessages.ts +37 -0
  192. package/observation/batches/PartitionFailedInBatch.ts +14 -0
  193. package/observation/batches/PartitionNotInBatch.ts +14 -0
  194. package/observation/batches/PartitionOutcome.ts +22 -0
  195. package/observation/batches/PartitionProblem.ts +25 -0
  196. package/observation/batches/PartitionSettlement.ts +70 -0
  197. package/observation/batches/ReducerMixesBatchAndPerEventMethods.ts +16 -0
  198. package/observation/batches/batchSize.ts +79 -0
  199. package/observation/batches/createBatchContext.ts +32 -0
  200. package/observation/batches/for_BatchMethods/when_discovering_batch_methods.spec.ts +155 -0
  201. package/observation/batches/for_EventBatch/when_reporting_outcomes.spec.ts +66 -0
  202. package/observation/batches/for_PartitionSettlement/when_settling_a_partition.spec.ts +31 -0
  203. package/observation/batches/for_batchSize/when_declaring_bounds.spec.ts +23 -0
  204. package/observation/batches/for_observes/when_decorating_methods.legacy.spec.ts +28 -0
  205. package/observation/batches/for_observes/when_decorating_methods.spec.ts +33 -0
  206. package/observation/batches/for_runConcurrently/when_running_items.spec.ts +22 -0
  207. package/observation/batches/observes.ts +68 -0
  208. package/observation/batches/runConcurrently.ts +23 -0
  209. package/observation/createHandlerInstanceValidator.ts +5 -7
  210. package/observation/getInstanceMethods.ts +13 -4
  211. package/observation/index.ts +14 -0
  212. package/package.json +1 -1
  213. package/reactors/ReactorDispatcher.ts +27 -2
  214. package/reactors/ReactorObservationTarget.ts +48 -0
  215. package/reactors/ReactorPageDispatcher.ts +321 -0
  216. package/reactors/Reactors.ts +22 -164
  217. package/reactors/for_Reactors/given/observe_reactor_messages.ts +72 -0
  218. package/reactors/for_Reactors/when_delivering_pages/as_a_legacy_single_partition.spec.ts +51 -0
  219. package/reactors/for_Reactors/when_delivering_pages/returning_a_value_from_a_batch_method.spec.ts +34 -0
  220. package/reactors/for_Reactors/when_delivering_pages/with_batch_and_per_event_methods.spec.ts +81 -0
  221. package/reactors/for_Reactors/when_delivering_pages/with_batch_outcomes.spec.ts +86 -0
  222. package/reactors/for_Reactors/when_delivering_pages/with_per_event_handlers.spec.ts +52 -0
  223. package/reactors/index.ts +2 -0
  224. package/reducers/ReducerEventDispatcher.ts +44 -3
  225. package/reducers/Reducers.ts +109 -25
  226. package/reducers/ReductionOutcome.ts +55 -8
  227. package/reducers/for_Reducers/given/observe_reducer_messages.ts +77 -0
  228. package/reducers/for_Reducers/when_delivering_pages/to_a_batch_reducer.spec.ts +111 -0
  229. package/reducers/for_Reducers/when_delivering_pages/to_a_per_event_reducer.spec.ts +53 -0
  230. package/reducers/index.ts +2 -0
  231. package/testing/ReactorScenario.ts +5 -1
  232. package/testing/ReducerReadModelProcessor.ts +44 -0
  233. package/testing/for_ReactorScenario/when_the_reactor_has_a_batch_method.spec.ts +26 -0
  234. package/testing/for_ReadModelScenario/when_reducing_with_a_batch_method/with_events_for_two_event_sources.spec.ts +43 -0
package/EventStore.ts CHANGED
@@ -26,7 +26,7 @@ import { Projections } from './projections/Projections.js';
26
26
  import { IProjections } from './projections/IProjections.js';
27
27
  import { Reactors } from './reactors/Reactors.js';
28
28
  import { getReactorEventTypes } from './reactors/ReactorDispatcher.js';
29
- import { getEventHandlers } from './observation/getEventHandlers.js';
29
+ import { ReducerEventDispatcher } from './reducers/ReducerEventDispatcher.js';
30
30
  import type { ReactorResultHandler } from './reactors/ReactorResultHandler.js';
31
31
  import type { ClientArtifactsActivator } from './artifacts/ClientArtifactsActivator.js';
32
32
  import type { ReadModelNamingPolicy } from './readModels/ReadModelNamingPolicy.js';
@@ -163,7 +163,7 @@ export class EventStore implements IEventStore {
163
163
  getReactorEventTypes(type, this._artifacts.eventTypes);
164
164
  }
165
165
  for (const type of this._artifacts.reducers) {
166
- getEventHandlers(type, this._artifacts.eventTypes);
166
+ new ReducerEventDispatcher(type, this._artifacts.eventTypes);
167
167
  }
168
168
 
169
169
  this._logger.debug('Registering discovered artifacts', {
@@ -14,7 +14,7 @@ import { Constraints } from './events/constraints/Constraints.js';
14
14
  import { Projections } from './projections/Projections.js';
15
15
  import { Reactors } from './reactors/Reactors.js';
16
16
  import { getReactorEventTypes } from './reactors/ReactorDispatcher.js';
17
- import { getEventHandlers } from './observation/getEventHandlers.js';
17
+ import { ReducerEventDispatcher } from './reducers/ReducerEventDispatcher.js';
18
18
  import { Reducers } from './reducers/Reducers.js';
19
19
  import { ReadModels } from './readModels/ReadModels.js';
20
20
  import { EventSeeding } from './seeding/EventSeeding.js';
@@ -126,7 +126,7 @@ export class EventStore {
126
126
  getReactorEventTypes(type, this._artifacts.eventTypes);
127
127
  }
128
128
  for (const type of this._artifacts.reducers) {
129
- getEventHandlers(type, this._artifacts.eventTypes);
129
+ new ReducerEventDispatcher(type, this._artifacts.eventTypes);
130
130
  }
131
131
  this._logger.debug('Registering discovered artifacts', {
132
132
  eventStore: this.name.value,
@@ -1 +1 @@
1
- {"version":3,"file":"EventStore.js","sourceRoot":"","sources":["../EventStore.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,qGAAqG;AAErG,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAEzD,OAAO,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AAC3F,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEpD,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAG9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAClE,OAAO,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAItE,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AAEvE,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAEpD,OAAO,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAC;AAElE,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAE3D,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD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,CAAC,gBAAgB,EAAE,QAAQ,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE,CAAC,IAAI,uBAAuB,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC;gBAC5H,IAAI,CAAC,SAAS,CAAC,EAAE,IAAI,EAAE,cAAc,CAAC,EAAE,EAAE,CAAC,CAAC;gBAC5C,OAAO,MAAM,CAAC;YAClB,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACb,mBAAmB,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;gBACjC,MAAM,KAAK,CAAC;YAChB,CAAC;oBAAS,CAAC;gBACP,IAAI,CAAC,GAAG,EAAE,CAAC;YACf,CAAC;QACL,CAAC,CAAC,CAAC;IACP,CAAC;CACJ"}
@@ -0,0 +1,43 @@
1
+ import { ObservationOrigin } from './ObservationOrigin.js';
2
+ import type { BatchContextValues } from './BatchContextValues.js';
3
+ /**
4
+ * Describes the page of events a batch method is called for. It is read-only, and only batch methods receive it:
5
+ * per-event methods never get a {@link BatchContext}.
6
+ */
7
+ export declare class BatchContext {
8
+ /** The identifier of the observer (reactor or reducer). */
9
+ readonly observerId: string;
10
+ /** The event store the events come from. */
11
+ readonly eventStore: string;
12
+ /** The namespace the events come from. */
13
+ readonly namespace: string;
14
+ /** The event sequence the events come from. */
15
+ readonly eventSequenceId: string;
16
+ /** The path the page came from: live, catch-up, replay or retry. */
17
+ readonly origin: ObservationOrigin;
18
+ /** The partitions (event source identifiers) in the page, in the order the kernel delivered them. */
19
+ readonly partitions: readonly string[];
20
+ /** The number of events in the page. */
21
+ readonly eventCount: number;
22
+ /** The sequence number of the first event in the page, or undefined when the page is empty. */
23
+ readonly firstSequenceNumber: bigint | undefined;
24
+ /** The sequence number of the last event in the page, or undefined when the page is empty. */
25
+ readonly lastSequenceNumber: bigint | undefined;
26
+ /** When the kernel stops waiting for the result, or undefined when it waits without a deadline. */
27
+ readonly deadline: Date | undefined;
28
+ /** Aborted when the observation disconnects or the client is disposed. */
29
+ readonly signal: AbortSignal;
30
+ /**
31
+ * Whether the kernel accepts deferred partitions for this page. A kernel that delivers single partitions
32
+ * instead of pages cannot defer; a deferral is then reported as a failure.
33
+ */
34
+ readonly canDefer: boolean;
35
+ /**
36
+ * Creates a new {@link BatchContext}.
37
+ * @param values - The values describing the page.
38
+ */
39
+ constructor(values: BatchContextValues);
40
+ /** Whether the page is part of a replay. */
41
+ get isReplay(): boolean;
42
+ }
43
+ //# sourceMappingURL=BatchContext.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BatchContext.d.ts","sourceRoot":"","sources":["../../../observation/batches/BatchContext.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAElE;;;GAGG;AACH,qBAAa,YAAY;IACrB,2DAA2D;IAC3D,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAE5B,4CAA4C;IAC5C,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAE5B,0CAA0C;IAC1C,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAE3B,+CAA+C;IAC/C,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;IAEjC,oEAAoE;IACpE,QAAQ,CAAC,MAAM,EAAE,iBAAiB,CAAC;IAEnC,qGAAqG;IACrG,QAAQ,CAAC,UAAU,EAAE,SAAS,MAAM,EAAE,CAAC;IAEvC,wCAAwC;IACxC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAE5B,+FAA+F;IAC/F,QAAQ,CAAC,mBAAmB,EAAE,MAAM,GAAG,SAAS,CAAC;IAEjD,8FAA8F;IAC9F,QAAQ,CAAC,kBAAkB,EAAE,MAAM,GAAG,SAAS,CAAC;IAEhD,mGAAmG;IACnG,QAAQ,CAAC,QAAQ,EAAE,IAAI,GAAG,SAAS,CAAC;IAEpC,0EAA0E;IAC1E,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC;IAE7B;;;OAGG;IACH,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAE3B;;;OAGG;IACH,YAAY,MAAM,EAAE,kBAAkB,EAcrC;IAED,4CAA4C;IAC5C,IAAI,QAAQ,IAAI,OAAO,CAEtB;CACJ"}
@@ -0,0 +1,60 @@
1
+ // Copyright (c) Cratis. All rights reserved.
2
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
+ import { ObservationOrigin } from './ObservationOrigin.js';
4
+ /**
5
+ * Describes the page of events a batch method is called for. It is read-only, and only batch methods receive it:
6
+ * per-event methods never get a {@link BatchContext}.
7
+ */
8
+ export class BatchContext {
9
+ /** The identifier of the observer (reactor or reducer). */
10
+ observerId;
11
+ /** The event store the events come from. */
12
+ eventStore;
13
+ /** The namespace the events come from. */
14
+ namespace;
15
+ /** The event sequence the events come from. */
16
+ eventSequenceId;
17
+ /** The path the page came from: live, catch-up, replay or retry. */
18
+ origin;
19
+ /** The partitions (event source identifiers) in the page, in the order the kernel delivered them. */
20
+ partitions;
21
+ /** The number of events in the page. */
22
+ eventCount;
23
+ /** The sequence number of the first event in the page, or undefined when the page is empty. */
24
+ firstSequenceNumber;
25
+ /** The sequence number of the last event in the page, or undefined when the page is empty. */
26
+ lastSequenceNumber;
27
+ /** When the kernel stops waiting for the result, or undefined when it waits without a deadline. */
28
+ deadline;
29
+ /** Aborted when the observation disconnects or the client is disposed. */
30
+ signal;
31
+ /**
32
+ * Whether the kernel accepts deferred partitions for this page. A kernel that delivers single partitions
33
+ * instead of pages cannot defer; a deferral is then reported as a failure.
34
+ */
35
+ canDefer;
36
+ /**
37
+ * Creates a new {@link BatchContext}.
38
+ * @param values - The values describing the page.
39
+ */
40
+ constructor(values) {
41
+ this.observerId = values.observerId;
42
+ this.eventStore = values.eventStore;
43
+ this.namespace = values.namespace;
44
+ this.eventSequenceId = values.eventSequenceId;
45
+ this.origin = values.origin;
46
+ this.partitions = Object.freeze([...values.partitions]);
47
+ this.eventCount = values.eventCount;
48
+ this.firstSequenceNumber = values.firstSequenceNumber;
49
+ this.lastSequenceNumber = values.lastSequenceNumber;
50
+ this.deadline = values.deadline;
51
+ this.signal = values.signal;
52
+ this.canDefer = values.canDefer;
53
+ Object.freeze(this);
54
+ }
55
+ /** Whether the page is part of a replay. */
56
+ get isReplay() {
57
+ return this.origin === ObservationOrigin.Replay;
58
+ }
59
+ }
60
+ //# sourceMappingURL=BatchContext.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BatchContext.js","sourceRoot":"","sources":["../../../observation/batches/BatchContext.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,qGAAqG;AAErG,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAG3D;;;GAGG;AACH,MAAM,OAAO,YAAY;IACrB,2DAA2D;IAClD,UAAU,CAAS;IAE5B,4CAA4C;IACnC,UAAU,CAAS;IAE5B,0CAA0C;IACjC,SAAS,CAAS;IAE3B,+CAA+C;IACtC,eAAe,CAAS;IAEjC,oEAAoE;IAC3D,MAAM,CAAoB;IAEnC,qGAAqG;IAC5F,UAAU,CAAoB;IAEvC,wCAAwC;IAC/B,UAAU,CAAS;IAE5B,+FAA+F;IACtF,mBAAmB,CAAqB;IAEjD,8FAA8F;IACrF,kBAAkB,CAAqB;IAEhD,mGAAmG;IAC1F,QAAQ,CAAmB;IAEpC,0EAA0E;IACjE,MAAM,CAAc;IAE7B;;;OAGG;IACM,QAAQ,CAAU;IAE3B;;;OAGG;IACH,YAAY,MAA0B;QAClC,IAAI,CAAC,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;QACpC,IAAI,CAAC,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;QACpC,IAAI,CAAC,SAAS,GAAG,MAAM,CAAC,SAAS,CAAC;QAClC,IAAI,CAAC,eAAe,GAAG,MAAM,CAAC,eAAe,CAAC;QAC9C,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;QAC5B,IAAI,CAAC,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC;QACxD,IAAI,CAAC,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;QACpC,IAAI,CAAC,mBAAmB,GAAG,MAAM,CAAC,mBAAmB,CAAC;QACtD,IAAI,CAAC,kBAAkB,GAAG,MAAM,CAAC,kBAAkB,CAAC;QACpD,IAAI,CAAC,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;QAChC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;QAC5B,IAAI,CAAC,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;QAChC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IACxB,CAAC;IAED,4CAA4C;IAC5C,IAAI,QAAQ;QACR,OAAO,IAAI,CAAC,MAAM,KAAK,iBAAiB,CAAC,MAAM,CAAC;IACpD,CAAC;CACJ"}
@@ -0,0 +1,14 @@
1
+ /** The observer a {@link BatchContext} is created for. */
2
+ export type BatchContextObserver = {
3
+ /** The identifier of the observer. */
4
+ readonly observerId: string;
5
+ /** The event store the observer is registered with. */
6
+ readonly eventStore: string;
7
+ /** The namespace the observer is registered in. */
8
+ readonly namespace: string;
9
+ /** The event sequence the observer observes. */
10
+ readonly eventSequenceId: string;
11
+ /** Aborted when the observation stops. */
12
+ readonly signal: AbortSignal;
13
+ };
14
+ //# sourceMappingURL=BatchContextObserver.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BatchContextObserver.d.ts","sourceRoot":"","sources":["../../../observation/batches/BatchContextObserver.ts"],"names":[],"mappings":"AAGA,0DAA0D;AAC1D,MAAM,MAAM,oBAAoB,GAAG;IAC/B,sCAAsC;IACtC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,uDAAuD;IACvD,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,mDAAmD;IACnD,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,gDAAgD;IAChD,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;IACjC,0CAA0C;IAC1C,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC;CAChC,CAAC"}
@@ -0,0 +1,4 @@
1
+ // Copyright (c) Cratis. All rights reserved.
2
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
+ export {};
4
+ //# sourceMappingURL=BatchContextObserver.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BatchContextObserver.js","sourceRoot":"","sources":["../../../observation/batches/BatchContextObserver.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,qGAAqG"}
@@ -0,0 +1,13 @@
1
+ import type { BatchContextObserver } from './BatchContextObserver.js';
2
+ import type { ObservationOrigin } from './ObservationOrigin.js';
3
+ /** The values a {@link BatchContext} is created from. See {@link BatchContext} for what each value means. */
4
+ export type BatchContextValues = BatchContextObserver & {
5
+ readonly origin: ObservationOrigin;
6
+ readonly partitions: readonly string[];
7
+ readonly eventCount: number;
8
+ readonly firstSequenceNumber: bigint | undefined;
9
+ readonly lastSequenceNumber: bigint | undefined;
10
+ readonly deadline: Date | undefined;
11
+ readonly canDefer: boolean;
12
+ };
13
+ //# sourceMappingURL=BatchContextValues.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BatchContextValues.d.ts","sourceRoot":"","sources":["../../../observation/batches/BatchContextValues.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACtE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAEhE,6GAA6G;AAC7G,MAAM,MAAM,kBAAkB,GAAG,oBAAoB,GAAG;IACpD,QAAQ,CAAC,MAAM,EAAE,iBAAiB,CAAC;IACnC,QAAQ,CAAC,UAAU,EAAE,SAAS,MAAM,EAAE,CAAC;IACvC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,mBAAmB,EAAE,MAAM,GAAG,SAAS,CAAC;IACjD,QAAQ,CAAC,kBAAkB,EAAE,MAAM,GAAG,SAAS,CAAC;IAChD,QAAQ,CAAC,QAAQ,EAAE,IAAI,GAAG,SAAS,CAAC;IACpC,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;CAC9B,CAAC"}
@@ -0,0 +1,4 @@
1
+ // Copyright (c) Cratis. All rights reserved.
2
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
+ export {};
4
+ //# sourceMappingURL=BatchContextValues.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BatchContextValues.js","sourceRoot":"","sources":["../../../observation/batches/BatchContextValues.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,qGAAqG"}
@@ -0,0 +1,9 @@
1
+ import type { ObservedEventType } from './ObservedEventType.js';
2
+ /** A method of an observer that takes an {@link EventBatch}. */
3
+ export interface BatchMethod {
4
+ /** The name of the method. */
5
+ readonly methodName: string;
6
+ /** The event types the method observes, by event type identifier. */
7
+ readonly eventTypes: ReadonlyMap<string, ObservedEventType>;
8
+ }
9
+ //# sourceMappingURL=BatchMethod.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BatchMethod.d.ts","sourceRoot":"","sources":["../../../observation/batches/BatchMethod.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAEhE,gEAAgE;AAChE,MAAM,WAAW,WAAW;IACxB,8BAA8B;IAC9B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAE5B,qEAAqE;IACrE,QAAQ,CAAC,UAAU,EAAE,WAAW,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC;CAC/D"}
@@ -0,0 +1,4 @@
1
+ // Copyright (c) Cratis. All rights reserved.
2
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
+ export {};
4
+ //# sourceMappingURL=BatchMethod.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BatchMethod.js","sourceRoot":"","sources":["../../../observation/batches/BatchMethod.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,qGAAqG"}
@@ -0,0 +1,12 @@
1
+ /** Reported when a reactor batch method returns a value. Batch reactor methods do not return events or other side effects. */
2
+ export declare class BatchMethodReturnedAValue extends Error {
3
+ readonly observerType: string;
4
+ readonly method: string;
5
+ /**
6
+ * Creates a new {@link BatchMethodReturnedAValue}.
7
+ * @param observerType - The name of the reactor class.
8
+ * @param method - The name of the batch method.
9
+ */
10
+ constructor(observerType: string, method: string);
11
+ }
12
+ //# sourceMappingURL=BatchMethodReturnedAValue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BatchMethodReturnedAValue.d.ts","sourceRoot":"","sources":["../../../observation/batches/BatchMethodReturnedAValue.ts"],"names":[],"mappings":"AAGA,8HAA8H;AAC9H,qBAAa,yBAA0B,SAAQ,KAAK;IAMpC,QAAQ,CAAC,YAAY,EAAE,MAAM;IAAE,QAAQ,CAAC,MAAM,EAAE,MAAM;IALlE;;;;OAIG;IACH,YAAqB,YAAY,EAAE,MAAM,EAAW,MAAM,EAAE,MAAM,EAIjE;CACJ"}
@@ -0,0 +1,20 @@
1
+ // Copyright (c) Cratis. All rights reserved.
2
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
+ /** Reported when a reactor batch method returns a value. Batch reactor methods do not return events or other side effects. */
4
+ export class BatchMethodReturnedAValue extends Error {
5
+ observerType;
6
+ method;
7
+ /**
8
+ * Creates a new {@link BatchMethodReturnedAValue}.
9
+ * @param observerType - The name of the reactor class.
10
+ * @param method - The name of the batch method.
11
+ */
12
+ constructor(observerType, method) {
13
+ super(`Batch method '${method}' on reactor '${observerType}' returned a value. Batch reactor methods return nothing; ` +
14
+ 'append through an event log instead of returning events.');
15
+ this.observerType = observerType;
16
+ this.method = method;
17
+ this.name = 'BatchMethodReturnedAValue';
18
+ }
19
+ }
20
+ //# sourceMappingURL=BatchMethodReturnedAValue.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BatchMethodReturnedAValue.js","sourceRoot":"","sources":["../../../observation/batches/BatchMethodReturnedAValue.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,qGAAqG;AAErG,8HAA8H;AAC9H,MAAM,OAAO,yBAA0B,SAAQ,KAAK;IAM3B,YAAY;IAAmB,MAAM;IAL1D;;;;OAIG;IACH,YAAqB,YAAoB,EAAW,MAAc;QAC9D,KAAK,CAAC,iBAAiB,MAAM,iBAAiB,YAAY,4DAA4D;YAClH,0DAA0D,CAAC,CAAC;4BAF/C,YAAY;sBAAmB,MAAM;QAGtD,IAAI,CAAC,IAAI,GAAG,2BAA2B,CAAC;IAC5C,CAAC;CACJ"}
@@ -0,0 +1,31 @@
1
+ import type { Constructor } from '@cratis/fundamentals';
2
+ import type { BatchMethod } from './BatchMethod.js';
3
+ /**
4
+ * Discovers the batch methods of an observer: the methods decorated with `@observes`.
5
+ * @param observerType - The observer class.
6
+ * @param registeredTypes - The event types registered with the event store.
7
+ * @param methods - The instance methods of the observer.
8
+ * @returns The {@link BatchMethod} instances.
9
+ * @throws {@link InvalidBatchMethod} when a batch method also declares a per-event decorator or observes an unregistered type.
10
+ * @throws {@link EventTypeObservedByMoreThanOneMethod} when two batch methods observe the same event type.
11
+ */
12
+ export declare function getBatchMethods(observerType: Constructor, registeredTypes: readonly Constructor[], methods?: ReadonlyMap<string, Function>): BatchMethod[];
13
+ /**
14
+ * Gets the instance methods of an observer that are not batch methods, for per-event discovery.
15
+ * @param methods - The instance methods.
16
+ * @param batchMethods - The batch methods.
17
+ * @returns The methods without the batch methods.
18
+ */
19
+ export declare function withoutBatchMethods(methods: ReadonlyMap<string, Function>, batchMethods: readonly BatchMethod[]): Map<string, Function>;
20
+ /**
21
+ * Throws when an event type observed by a batch method is also handled by a per-event method.
22
+ * @param observerType - The observer class.
23
+ * @param batchMethods - The batch methods.
24
+ * @param handlers - The per-event handlers, each with the event type identifier and the methods it reaches.
25
+ * @throws {@link EventTypeObservedByMoreThanOneMethod} when an event type reaches both.
26
+ */
27
+ export declare function assertEachEventTypeReachesOneMethod(observerType: Constructor, batchMethods: readonly BatchMethod[], handlers: readonly {
28
+ readonly id: string;
29
+ readonly methodNames: readonly string[];
30
+ }[]): void;
31
+ //# sourceMappingURL=BatchMethods.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BatchMethods.d.ts","sourceRoot":"","sources":["../../../observation/batches/BatchMethods.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AASxD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAGpD;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAAC,YAAY,EAAE,WAAW,EAAE,eAAe,EAAE,SAAS,WAAW,EAAE,EAC9F,OAAO,GAAE,WAAW,CAAC,MAAM,EAAE,QAAQ,CAAoC,GAAG,WAAW,EAAE,CAkC5F;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,WAAW,CAAC,MAAM,EAAE,QAAQ,CAAC,EAAE,YAAY,EAAE,SAAS,WAAW,EAAE,GAAG,GAAG,CAAC,MAAM,EAAE,QAAQ,CAAC,CAGvI;AAED;;;;;;GAMG;AACH,wBAAgB,mCAAmC,CAAC,YAAY,EAAE,WAAW,EAAE,YAAY,EAAE,SAAS,WAAW,EAAE,EAC/G,QAAQ,EAAE,SAAS;IAAE,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,WAAW,EAAE,SAAS,MAAM,EAAE,CAAA;CAAE,EAAE,GAAG,IAAI,CAS/F"}
@@ -0,0 +1,81 @@
1
+ // Copyright (c) Cratis. All rights reserved.
2
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
+ import { getEventTypeMetadata } from '../../events/eventTypeDecorator.js';
4
+ import { getHandledEventType } from '../../events/handles.js';
5
+ import { isOnceOnly } from '../../reactors/onceOnly.js';
6
+ import { getReplayEventType } from '../../reactors/replay.js';
7
+ import { getInstanceMethods } from '../getInstanceMethods.js';
8
+ import { EventTypeObservedByMoreThanOneMethod } from './EventTypeObservedByMoreThanOneMethod.js';
9
+ import { InvalidBatchMethod } from './InvalidBatchMethod.js';
10
+ import { getObservedEventTypes } from './observes.js';
11
+ /**
12
+ * Discovers the batch methods of an observer: the methods decorated with `@observes`.
13
+ * @param observerType - The observer class.
14
+ * @param registeredTypes - The event types registered with the event store.
15
+ * @param methods - The instance methods of the observer.
16
+ * @returns The {@link BatchMethod} instances.
17
+ * @throws {@link InvalidBatchMethod} when a batch method also declares a per-event decorator or observes an unregistered type.
18
+ * @throws {@link EventTypeObservedByMoreThanOneMethod} when two batch methods observe the same event type.
19
+ */
20
+ export function getBatchMethods(observerType, registeredTypes, methods = getInstanceMethods(observerType)) {
21
+ const typeName = observerType.name;
22
+ const observedBy = new Map();
23
+ const batchMethods = [];
24
+ for (const [name, method] of methods) {
25
+ const observed = getObservedEventTypes(method);
26
+ if (observed.length === 0)
27
+ continue;
28
+ if (getHandledEventType(method) !== undefined) {
29
+ throw new InvalidBatchMethod(typeName, name, 'it cannot also declare @handles. A batch method declares its event types with @observes only.');
30
+ }
31
+ if (getReplayEventType(method) !== undefined) {
32
+ throw new InvalidBatchMethod(typeName, name, 'it cannot also declare @replay. Batch methods receive replayed pages; check BatchContext.isReplay.');
33
+ }
34
+ if (isOnceOnly(method)) {
35
+ throw new InvalidBatchMethod(typeName, name, 'it cannot be @onceOnly. Mark the whole reactor @onceOnly, or check BatchContext.isReplay.');
36
+ }
37
+ const eventTypes = new Map();
38
+ for (const eventType of observed) {
39
+ const metadata = registeredTypes.includes(eventType) ? getEventTypeMetadata(eventType) : undefined;
40
+ if (!metadata) {
41
+ throw new InvalidBatchMethod(typeName, name, `it observes '${eventType.name}', which has no registered event type. Register that event constructor with the event store.`);
42
+ }
43
+ const id = metadata.eventType.id.value;
44
+ const previous = observedBy.get(id);
45
+ if (previous !== undefined) {
46
+ throw new EventTypeObservedByMoreThanOneMethod(typeName, eventType.name, [previous, name]);
47
+ }
48
+ observedBy.set(id, name);
49
+ eventTypes.set(id, { type: eventType, id, generation: metadata.eventType.generation.value });
50
+ }
51
+ batchMethods.push({ methodName: name, eventTypes });
52
+ }
53
+ return batchMethods;
54
+ }
55
+ /**
56
+ * Gets the instance methods of an observer that are not batch methods, for per-event discovery.
57
+ * @param methods - The instance methods.
58
+ * @param batchMethods - The batch methods.
59
+ * @returns The methods without the batch methods.
60
+ */
61
+ export function withoutBatchMethods(methods, batchMethods) {
62
+ const names = new Set(batchMethods.map(method => method.methodName));
63
+ return new Map([...methods].filter(([name]) => !names.has(name)));
64
+ }
65
+ /**
66
+ * Throws when an event type observed by a batch method is also handled by a per-event method.
67
+ * @param observerType - The observer class.
68
+ * @param batchMethods - The batch methods.
69
+ * @param handlers - The per-event handlers, each with the event type identifier and the methods it reaches.
70
+ * @throws {@link EventTypeObservedByMoreThanOneMethod} when an event type reaches both.
71
+ */
72
+ export function assertEachEventTypeReachesOneMethod(observerType, batchMethods, handlers) {
73
+ for (const handler of handlers) {
74
+ const batchMethod = batchMethods.find(method => method.eventTypes.has(handler.id));
75
+ if (batchMethod) {
76
+ const observed = batchMethod.eventTypes.get(handler.id);
77
+ throw new EventTypeObservedByMoreThanOneMethod(observerType.name, observed.type.name, [batchMethod.methodName, ...handler.methodNames]);
78
+ }
79
+ }
80
+ }
81
+ //# sourceMappingURL=BatchMethods.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BatchMethods.js","sourceRoot":"","sources":["../../../observation/batches/BatchMethods.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,qGAAqG;AAGrG,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAC1E,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAy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AC,CAAC;IACrE,OAAO,IAAI,GAAG,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACtE,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,mCAAmC,CAAC,YAAyB,EAAE,YAAoC,EAC/G,QAAqF;IACrF,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;QAC7B,MAAM,WAAW,GAAG,YAAY,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,UAAU,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC;QACnF,IAAI,WAAW,EAAE,CAAC;YACd,MAAM,QAAQ,GAAG,WAAW,CAAC,UAAU,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAE,CAAC;YACzD,MAAM,IAAI,oCAAoC,CAAE,YAAyB,CAAC,IAAI,EAAG,QAAQ,CAAC,IAAiB,CAAC,IAAI,EAC5G,CAAC,WAAW,CAAC,UAAU,EAAE,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC;QAC1D,CAAC;IACL,CAAC;AACL,CAAC"}
@@ -0,0 +1,15 @@
1
+ import type { BatchOutcomeKind } from './BatchOutcomeKind.js';
2
+ /** A partition a batch method reported it could not handle. */
3
+ export interface BatchOutcome {
4
+ /** The partition. */
5
+ readonly partition: string;
6
+ /** The sequence number of the first event not handled. */
7
+ readonly at: bigint;
8
+ /** Whether the partition failed or was deferred. */
9
+ readonly kind: BatchOutcomeKind;
10
+ /** The error describing a failure. */
11
+ readonly error?: unknown;
12
+ /** How long to wait before delivering the partition again, for a deferral. */
13
+ readonly retryAfterMilliseconds: number;
14
+ }
15
+ //# sourceMappingURL=BatchOutcome.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BatchOutcome.d.ts","sourceRoot":"","sources":["../../../observation/batches/BatchOutcome.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAE9D,+DAA+D;AAC/D,MAAM,WAAW,YAAY;IACzB,qBAAqB;IACrB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAE3B,0DAA0D;IAC1D,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IAEpB,oDAAoD;IACpD,QAAQ,CAAC,IAAI,EAAE,gBAAgB,CAAC;IAEhC,sCAAsC;IACtC,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC;IAEzB,8EAA8E;IAC9E,QAAQ,CAAC,sBAAsB,EAAE,MAAM,CAAC;CAC3C"}
@@ -0,0 +1,4 @@
1
+ // Copyright (c) Cratis. All rights reserved.
2
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
+ export {};
4
+ //# sourceMappingURL=BatchOutcome.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BatchOutcome.js","sourceRoot":"","sources":["../../../observation/batches/BatchOutcome.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,qGAAqG"}
@@ -0,0 +1,8 @@
1
+ /** What a batch method reported for a partition. */
2
+ export declare enum BatchOutcomeKind {
3
+ /** The partition failed. */
4
+ Failed = "failed",
5
+ /** The partition is delivered again later, without failing. */
6
+ Deferred = "deferred"
7
+ }
8
+ //# sourceMappingURL=BatchOutcomeKind.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BatchOutcomeKind.d.ts","sourceRoot":"","sources":["../../../observation/batches/BatchOutcomeKind.ts"],"names":[],"mappings":"AAGA,oDAAoD;AACpD,oBAAY,gBAAgB;IACxB,4BAA4B;IAC5B,MAAM,WAAW;IAEjB,+DAA+D;IAC/D,QAAQ,aAAa;CACxB"}
@@ -0,0 +1,11 @@
1
+ // Copyright (c) Cratis. All rights reserved.
2
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
+ /** What a batch method reported for a partition. */
4
+ export var BatchOutcomeKind;
5
+ (function (BatchOutcomeKind) {
6
+ /** The partition failed. */
7
+ BatchOutcomeKind["Failed"] = "failed";
8
+ /** The partition is delivered again later, without failing. */
9
+ BatchOutcomeKind["Deferred"] = "deferred";
10
+ })(BatchOutcomeKind || (BatchOutcomeKind = {}));
11
+ //# sourceMappingURL=BatchOutcomeKind.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BatchOutcomeKind.js","sourceRoot":"","sources":["../../../observation/batches/BatchOutcomeKind.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,qGAAqG;AAErG,oDAAoD;AACpD,MAAM,CAAN,IAAY,gBAMX;AAND,WAAY,gBAAgB;IACxB,4BAA4B;IAC5B,qCAAiB,CAAA;IAEjB,+DAA+D;IAC/D,yCAAqB,CAAA;AACzB,CAAC,EANW,gBAAgB,KAAhB,gBAAgB,QAM3B"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Reported when a batch method defers a partition but the kernel does not accept deferred partitions,
3
+ * so the partition is failed instead.
4
+ */
5
+ export declare class DeferralNotSupportedByKernel extends Error {
6
+ readonly partition: string;
7
+ /**
8
+ * Creates a new {@link DeferralNotSupportedByKernel}.
9
+ * @param partition - The partition that was deferred.
10
+ */
11
+ constructor(partition: string);
12
+ }
13
+ //# sourceMappingURL=DeferralNotSupportedByKernel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DeferralNotSupportedByKernel.d.ts","sourceRoot":"","sources":["../../../observation/batches/DeferralNotSupportedByKernel.ts"],"names":[],"mappings":"AAGA;;;GAGG;AACH,qBAAa,4BAA6B,SAAQ,KAAK;IAKvC,QAAQ,CAAC,SAAS,EAAE,MAAM;IAJtC;;;OAGG;IACH,YAAqB,SAAS,EAAE,MAAM,EAGrC;CACJ"}
@@ -0,0 +1,19 @@
1
+ // Copyright (c) Cratis. All rights reserved.
2
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
+ /**
4
+ * Reported when a batch method defers a partition but the kernel does not accept deferred partitions,
5
+ * so the partition is failed instead.
6
+ */
7
+ export class DeferralNotSupportedByKernel extends Error {
8
+ partition;
9
+ /**
10
+ * Creates a new {@link DeferralNotSupportedByKernel}.
11
+ * @param partition - The partition that was deferred.
12
+ */
13
+ constructor(partition) {
14
+ super(`Partition '${partition}' was deferred, but the kernel does not accept deferred partitions. The partition is failed instead.`);
15
+ this.partition = partition;
16
+ this.name = 'DeferralNotSupportedByKernel';
17
+ }
18
+ }
19
+ //# sourceMappingURL=DeferralNotSupportedByKernel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DeferralNotSupportedByKernel.js","sourceRoot":"","sources":["../../../observation/batches/DeferralNotSupportedByKernel.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,qGAAqG;AAErG;;;GAGG;AACH,MAAM,OAAO,4BAA6B,SAAQ,KAAK;IAK9B,SAAS;IAJ9B;;;OAGG;IACH,YAAqB,SAAiB;QAClC,KAAK,CAAC,cAAc,SAAS,sGAAsG,CAAC,CAAC;yBADpH,SAAS;QAE1B,IAAI,CAAC,IAAI,GAAG,8BAA8B,CAAC;IAC/C,CAAC;CACJ"}
@@ -0,0 +1,11 @@
1
+ import type { AppendedEvent } from '@cratis/chronicle.contracts';
2
+ /** The events of one partition in a delivery. */
3
+ export interface DeliveredPartition {
4
+ /** The partition. */
5
+ readonly partition: string;
6
+ /** The events of the partition, in sequence order. */
7
+ readonly events: readonly AppendedEvent[];
8
+ /** The stored read model state as JSON, for reducers. */
9
+ readonly initialState: string;
10
+ }
11
+ //# sourceMappingURL=DeliveredPartition.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DeliveredPartition.d.ts","sourceRoot":"","sources":["../../../observation/batches/DeliveredPartition.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAEjE,iDAAiD;AACjD,MAAM,WAAW,kBAAkB;IAC/B,qBAAqB;IACrB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAE3B,sDAAsD;IACtD,QAAQ,CAAC,MAAM,EAAE,SAAS,aAAa,EAAE,CAAC;IAE1C,yDAAyD;IACzD,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;CACjC"}
@@ -0,0 +1,4 @@
1
+ // Copyright (c) Cratis. All rights reserved.
2
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
+ export {};
4
+ //# sourceMappingURL=DeliveredPartition.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DeliveredPartition.js","sourceRoot":"","sources":["../../../observation/batches/DeliveredPartition.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,qGAAqG"}
@@ -0,0 +1,28 @@
1
+ import type { Constructor } from '@cratis/fundamentals';
2
+ import type { EventContext } from '../../events/EventContext.js';
3
+ import type { ReactorDelivery } from '../../reactors/ReactorDelivery.js';
4
+ /**
5
+ * One event in an {@link EventBatch}: its content, its context and the event type it was registered as.
6
+ * The content is the deserialized JSON of the event, as per-event handlers receive it.
7
+ */
8
+ export declare class EventAndContext<TEvent = unknown> {
9
+ readonly event: TEvent;
10
+ readonly context: EventContext;
11
+ readonly eventType: Constructor;
12
+ readonly delivery?: ReactorDelivery | undefined;
13
+ /**
14
+ * Creates a new {@link EventAndContext}.
15
+ * @param event - The content of the event.
16
+ * @param context - The {@link EventContext} of the event.
17
+ * @param eventType - The registered event constructor the event was appended as.
18
+ * @param delivery - The {@link ReactorDelivery} identifying the event's delivery, for reactors.
19
+ */
20
+ constructor(event: TEvent, context: EventContext, eventType: Constructor, delivery?: ReactorDelivery | undefined);
21
+ /**
22
+ * Checks whether the event is of a given event type, narrowing {@link event} to it.
23
+ * @param eventType - The event constructor to check for.
24
+ * @returns True when the event was appended as that event type.
25
+ */
26
+ is<T>(eventType: Constructor<T>): this is EventAndContext<T>;
27
+ }
28
+ //# sourceMappingURL=EventAndContext.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EventAndContext.d.ts","sourceRoot":"","sources":["../../../observation/batches/EventAndContext.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AAEzE;;;GAGG;AACH,qBAAa,eAAe,CAAC,MAAM,GAAG,OAAO;IASrC,QAAQ,CAAC,KAAK,EAAE,MAAM;IACtB,QAAQ,CAAC,OAAO,EAAE,YAAY;IAC9B,QAAQ,CAAC,SAAS,EAAE,WAAW;IAC/B,QAAQ,CAAC,QAAQ,CAAC,EAAE,eAAe;IAXvC;;;;;;OAMG;IACH,YACa,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,YAAY,EACrB,SAAS,EAAE,WAAW,EACtB,QAAQ,CAAC,EAAE,eAAe,YAAA,EAGtC;IAED;;;;OAIG;IACH,EAAE,CAAC,CAAC,EAAE,SAAS,EAAE,WAAW,CAAC,CAAC,CAAC,GAAG,IAAI,IAAI,eAAe,CAAC,CAAC,CAAC,CAE3D;CACJ"}