@cratis/chronicle 6.57.0 → 6.59.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.
- package/EventStore.ts +2 -2
- package/README.md +1 -1
- package/connection/ChronicleConnection.ts +2 -2
- package/connection/ChronicleConnectionString.spec.ts +21 -0
- package/connection/ChronicleConnectionString.ts +16 -6
- package/connection/LeastConnectionsLoadBalancerStrategy.ts +1 -1
- package/connection/LoadBalancerStrategyFactory.ts +2 -2
- package/connection/TokenProvider.ts +2 -1
- package/connection/fetchOAuthAccessToken.ts +3 -3
- package/connection/for_ChronicleConnection/when_warning_about_tls_validation/tls_validation_warning.spec.ts +6 -1
- package/dist/EventStore.js +2 -2
- package/dist/EventStore.js.map +1 -1
- package/dist/connection/ChronicleConnection.js +2 -2
- package/dist/connection/ChronicleConnection.js.map +1 -1
- package/dist/connection/ChronicleConnectionString.d.ts +7 -2
- package/dist/connection/ChronicleConnectionString.d.ts.map +1 -1
- package/dist/connection/ChronicleConnectionString.js +14 -6
- package/dist/connection/ChronicleConnectionString.js.map +1 -1
- package/dist/connection/LeastConnectionsLoadBalancerStrategy.d.ts +1 -1
- package/dist/connection/LeastConnectionsLoadBalancerStrategy.js +1 -1
- package/dist/connection/LoadBalancerStrategyFactory.d.ts +2 -2
- package/dist/connection/LoadBalancerStrategyFactory.js +2 -2
- package/dist/connection/TokenProvider.d.ts +2 -1
- package/dist/connection/TokenProvider.d.ts.map +1 -1
- package/dist/connection/TokenProvider.js +2 -1
- package/dist/connection/TokenProvider.js.map +1 -1
- package/dist/connection/fetchOAuthAccessToken.d.ts +1 -1
- package/dist/connection/fetchOAuthAccessToken.js +3 -3
- package/dist/connection/fetchOAuthAccessToken.js.map +1 -1
- package/dist/observation/batches/BatchContext.d.ts +43 -0
- package/dist/observation/batches/BatchContext.d.ts.map +1 -0
- package/dist/observation/batches/BatchContext.js +60 -0
- package/dist/observation/batches/BatchContext.js.map +1 -0
- package/dist/observation/batches/BatchContextObserver.d.ts +14 -0
- package/dist/observation/batches/BatchContextObserver.d.ts.map +1 -0
- package/dist/observation/batches/BatchContextObserver.js +4 -0
- package/dist/observation/batches/BatchContextObserver.js.map +1 -0
- package/dist/observation/batches/BatchContextValues.d.ts +13 -0
- package/dist/observation/batches/BatchContextValues.d.ts.map +1 -0
- package/dist/observation/batches/BatchContextValues.js +4 -0
- package/dist/observation/batches/BatchContextValues.js.map +1 -0
- package/dist/observation/batches/BatchMethod.d.ts +9 -0
- package/dist/observation/batches/BatchMethod.d.ts.map +1 -0
- package/dist/observation/batches/BatchMethod.js +4 -0
- package/dist/observation/batches/BatchMethod.js.map +1 -0
- package/dist/observation/batches/BatchMethodReturnedAValue.d.ts +12 -0
- package/dist/observation/batches/BatchMethodReturnedAValue.d.ts.map +1 -0
- package/dist/observation/batches/BatchMethodReturnedAValue.js +20 -0
- package/dist/observation/batches/BatchMethodReturnedAValue.js.map +1 -0
- package/dist/observation/batches/BatchMethods.d.ts +31 -0
- package/dist/observation/batches/BatchMethods.d.ts.map +1 -0
- package/dist/observation/batches/BatchMethods.js +81 -0
- package/dist/observation/batches/BatchMethods.js.map +1 -0
- package/dist/observation/batches/BatchOutcome.d.ts +15 -0
- package/dist/observation/batches/BatchOutcome.d.ts.map +1 -0
- package/dist/observation/batches/BatchOutcome.js +4 -0
- package/dist/observation/batches/BatchOutcome.js.map +1 -0
- package/dist/observation/batches/BatchOutcomeKind.d.ts +8 -0
- package/dist/observation/batches/BatchOutcomeKind.d.ts.map +1 -0
- package/dist/observation/batches/BatchOutcomeKind.js +11 -0
- package/dist/observation/batches/BatchOutcomeKind.js.map +1 -0
- package/dist/observation/batches/DeferralNotSupportedByKernel.d.ts +13 -0
- package/dist/observation/batches/DeferralNotSupportedByKernel.d.ts.map +1 -0
- package/dist/observation/batches/DeferralNotSupportedByKernel.js +19 -0
- package/dist/observation/batches/DeferralNotSupportedByKernel.js.map +1 -0
- package/dist/observation/batches/DeliveredPartition.d.ts +11 -0
- package/dist/observation/batches/DeliveredPartition.d.ts.map +1 -0
- package/dist/observation/batches/DeliveredPartition.js +4 -0
- package/dist/observation/batches/DeliveredPartition.js.map +1 -0
- package/dist/observation/batches/EventAndContext.d.ts +28 -0
- package/dist/observation/batches/EventAndContext.d.ts.map +1 -0
- package/dist/observation/batches/EventAndContext.js +35 -0
- package/dist/observation/batches/EventAndContext.js.map +1 -0
- package/dist/observation/batches/EventBatch.d.ts +52 -0
- package/dist/observation/batches/EventBatch.d.ts.map +1 -0
- package/dist/observation/batches/EventBatch.js +92 -0
- package/dist/observation/batches/EventBatch.js.map +1 -0
- package/dist/observation/batches/EventTypeObservedByMoreThanOneMethod.d.ts +14 -0
- package/dist/observation/batches/EventTypeObservedByMoreThanOneMethod.d.ts.map +1 -0
- package/dist/observation/batches/EventTypeObservedByMoreThanOneMethod.js +23 -0
- package/dist/observation/batches/EventTypeObservedByMoreThanOneMethod.js.map +1 -0
- package/dist/observation/batches/InvalidBatchMethod.d.ts +13 -0
- package/dist/observation/batches/InvalidBatchMethod.d.ts.map +1 -0
- package/dist/observation/batches/InvalidBatchMethod.js +20 -0
- package/dist/observation/batches/InvalidBatchMethod.js.map +1 -0
- package/dist/observation/batches/ObservationOrigin.d.ts +21 -0
- package/dist/observation/batches/ObservationOrigin.d.ts.map +1 -0
- package/dist/observation/batches/ObservationOrigin.js +32 -0
- package/dist/observation/batches/ObservationOrigin.js.map +1 -0
- package/dist/observation/batches/ObservedEventType.d.ts +11 -0
- package/dist/observation/batches/ObservedEventType.d.ts.map +1 -0
- package/dist/observation/batches/ObservedEventType.js +4 -0
- package/dist/observation/batches/ObservedEventType.js.map +1 -0
- package/dist/observation/batches/PageMessages.d.ts +22 -0
- package/dist/observation/batches/PageMessages.d.ts.map +1 -0
- package/dist/observation/batches/PageMessages.js +32 -0
- package/dist/observation/batches/PageMessages.js.map +1 -0
- package/dist/observation/batches/PartitionFailedInBatch.d.ts +10 -0
- package/dist/observation/batches/PartitionFailedInBatch.d.ts.map +1 -0
- package/dist/observation/batches/PartitionFailedInBatch.js +16 -0
- package/dist/observation/batches/PartitionFailedInBatch.js.map +1 -0
- package/dist/observation/batches/PartitionNotInBatch.d.ts +10 -0
- package/dist/observation/batches/PartitionNotInBatch.d.ts.map +1 -0
- package/dist/observation/batches/PartitionNotInBatch.js +16 -0
- package/dist/observation/batches/PartitionNotInBatch.js.map +1 -0
- package/dist/observation/batches/PartitionOutcome.d.ts +19 -0
- package/dist/observation/batches/PartitionOutcome.d.ts.map +1 -0
- package/dist/observation/batches/PartitionOutcome.js +4 -0
- package/dist/observation/batches/PartitionOutcome.js.map +1 -0
- package/dist/observation/batches/PartitionProblem.d.ts +17 -0
- package/dist/observation/batches/PartitionProblem.d.ts.map +1 -0
- package/dist/observation/batches/PartitionProblem.js +4 -0
- package/dist/observation/batches/PartitionProblem.js.map +1 -0
- package/dist/observation/batches/PartitionSettlement.d.ts +29 -0
- package/dist/observation/batches/PartitionSettlement.d.ts.map +1 -0
- package/dist/observation/batches/PartitionSettlement.js +64 -0
- package/dist/observation/batches/PartitionSettlement.js.map +1 -0
- package/dist/observation/batches/ReducerMixesBatchAndPerEventMethods.d.ts +12 -0
- package/dist/observation/batches/ReducerMixesBatchAndPerEventMethods.d.ts.map +1 -0
- package/dist/observation/batches/ReducerMixesBatchAndPerEventMethods.js +20 -0
- package/dist/observation/batches/ReducerMixesBatchAndPerEventMethods.js.map +1 -0
- package/dist/observation/batches/batchSize.d.ts +42 -0
- package/dist/observation/batches/batchSize.d.ts.map +1 -0
- package/dist/observation/batches/batchSize.js +55 -0
- package/dist/observation/batches/batchSize.js.map +1 -0
- package/dist/observation/batches/createBatchContext.d.ts +13 -0
- package/dist/observation/batches/createBatchContext.d.ts.map +1 -0
- package/dist/observation/batches/createBatchContext.js +27 -0
- package/dist/observation/batches/createBatchContext.js.map +1 -0
- package/dist/observation/batches/observes.d.ts +39 -0
- package/dist/observation/batches/observes.d.ts.map +1 -0
- package/dist/observation/batches/observes.js +63 -0
- package/dist/observation/batches/observes.js.map +1 -0
- package/dist/observation/batches/runConcurrently.d.ts +9 -0
- package/dist/observation/batches/runConcurrently.d.ts.map +1 -0
- package/dist/observation/batches/runConcurrently.js +22 -0
- package/dist/observation/batches/runConcurrently.js.map +1 -0
- package/dist/observation/createHandlerInstanceValidator.d.ts +1 -1
- package/dist/observation/createHandlerInstanceValidator.d.ts.map +1 -1
- package/dist/observation/createHandlerInstanceValidator.js +5 -7
- package/dist/observation/createHandlerInstanceValidator.js.map +1 -1
- package/dist/observation/getInstanceMethods.d.ts +3 -1
- package/dist/observation/getInstanceMethods.d.ts.map +1 -1
- package/dist/observation/getInstanceMethods.js +13 -4
- package/dist/observation/getInstanceMethods.js.map +1 -1
- package/dist/observation/index.d.ts +14 -0
- package/dist/observation/index.d.ts.map +1 -1
- package/dist/observation/index.js +13 -0
- package/dist/observation/index.js.map +1 -1
- package/dist/reactors/ReactorDispatcher.d.ts +15 -0
- package/dist/reactors/ReactorDispatcher.d.ts.map +1 -1
- package/dist/reactors/ReactorDispatcher.js +25 -2
- package/dist/reactors/ReactorDispatcher.js.map +1 -1
- package/dist/reactors/ReactorObservationTarget.d.ts +45 -0
- package/dist/reactors/ReactorObservationTarget.d.ts.map +1 -0
- package/dist/reactors/ReactorObservationTarget.js +4 -0
- package/dist/reactors/ReactorObservationTarget.js.map +1 -0
- package/dist/reactors/ReactorPageDispatcher.d.ts +33 -0
- package/dist/reactors/ReactorPageDispatcher.d.ts.map +1 -0
- package/dist/reactors/ReactorPageDispatcher.js +293 -0
- package/dist/reactors/ReactorPageDispatcher.js.map +1 -0
- package/dist/reactors/Reactors.d.ts.map +1 -1
- package/dist/reactors/Reactors.js +21 -149
- package/dist/reactors/Reactors.js.map +1 -1
- package/dist/reactors/for_Reactors/given/observe_reactor_messages.d.ts +14 -0
- package/dist/reactors/for_Reactors/given/observe_reactor_messages.d.ts.map +1 -0
- package/dist/reactors/for_Reactors/given/observe_reactor_messages.js +61 -0
- package/dist/reactors/for_Reactors/given/observe_reactor_messages.js.map +1 -0
- package/dist/reactors/index.d.ts +2 -0
- package/dist/reactors/index.d.ts.map +1 -1
- package/dist/reactors/index.js +1 -0
- package/dist/reactors/index.js.map +1 -1
- package/dist/reducers/ReducerEventDispatcher.d.ts +26 -1
- package/dist/reducers/ReducerEventDispatcher.d.ts.map +1 -1
- package/dist/reducers/ReducerEventDispatcher.js +35 -3
- package/dist/reducers/ReducerEventDispatcher.js.map +1 -1
- package/dist/reducers/Reducers.d.ts +2 -0
- package/dist/reducers/Reducers.d.ts.map +1 -1
- package/dist/reducers/Reducers.js +94 -22
- package/dist/reducers/Reducers.js.map +1 -1
- package/dist/reducers/ReductionOutcome.d.ts +27 -3
- package/dist/reducers/ReductionOutcome.d.ts.map +1 -1
- package/dist/reducers/ReductionOutcome.js +51 -7
- package/dist/reducers/ReductionOutcome.js.map +1 -1
- package/dist/reducers/for_Reducers/given/observe_reducer_messages.d.ts +19 -0
- package/dist/reducers/for_Reducers/given/observe_reducer_messages.d.ts.map +1 -0
- package/dist/reducers/for_Reducers/given/observe_reducer_messages.js +61 -0
- package/dist/reducers/for_Reducers/given/observe_reducer_messages.js.map +1 -0
- package/dist/reducers/index.d.ts +2 -0
- package/dist/reducers/index.d.ts.map +1 -1
- package/dist/reducers/index.js +1 -0
- package/dist/reducers/index.js.map +1 -1
- package/dist/testing/ReactorScenario.d.ts.map +1 -1
- package/dist/testing/ReactorScenario.js +4 -1
- package/dist/testing/ReactorScenario.js.map +1 -1
- package/dist/testing/ReducerReadModelProcessor.d.ts +1 -0
- package/dist/testing/ReducerReadModelProcessor.d.ts.map +1 -1
- package/dist/testing/ReducerReadModelProcessor.js +45 -0
- package/dist/testing/ReducerReadModelProcessor.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/observation/batches/BatchContext.ts +75 -0
- package/observation/batches/BatchContextObserver.ts +16 -0
- package/observation/batches/BatchContextValues.ts +16 -0
- package/observation/batches/BatchMethod.ts +13 -0
- package/observation/batches/BatchMethodReturnedAValue.ts +16 -0
- package/observation/batches/BatchMethods.ts +90 -0
- package/observation/batches/BatchOutcome.ts +22 -0
- package/observation/batches/BatchOutcomeKind.ts +11 -0
- package/observation/batches/DeferralNotSupportedByKernel.ts +17 -0
- package/observation/batches/DeliveredPartition.ts +16 -0
- package/observation/batches/EventAndContext.ts +37 -0
- package/observation/batches/EventBatch.ts +105 -0
- package/observation/batches/EventTypeObservedByMoreThanOneMethod.ts +17 -0
- package/observation/batches/InvalidBatchMethod.ts +16 -0
- package/observation/batches/ObservationOrigin.ts +37 -0
- package/observation/batches/ObservedEventType.ts +16 -0
- package/observation/batches/PageMessages.ts +37 -0
- package/observation/batches/PartitionFailedInBatch.ts +14 -0
- package/observation/batches/PartitionNotInBatch.ts +14 -0
- package/observation/batches/PartitionOutcome.ts +22 -0
- package/observation/batches/PartitionProblem.ts +25 -0
- package/observation/batches/PartitionSettlement.ts +70 -0
- package/observation/batches/ReducerMixesBatchAndPerEventMethods.ts +16 -0
- package/observation/batches/batchSize.ts +79 -0
- package/observation/batches/createBatchContext.ts +32 -0
- package/observation/batches/for_BatchMethods/when_discovering_batch_methods.spec.ts +155 -0
- package/observation/batches/for_EventBatch/when_reporting_outcomes.spec.ts +66 -0
- package/observation/batches/for_PartitionSettlement/when_settling_a_partition.spec.ts +31 -0
- package/observation/batches/for_batchSize/when_declaring_bounds.spec.ts +23 -0
- package/observation/batches/for_observes/when_decorating_methods.legacy.spec.ts +28 -0
- package/observation/batches/for_observes/when_decorating_methods.spec.ts +33 -0
- package/observation/batches/for_runConcurrently/when_running_items.spec.ts +22 -0
- package/observation/batches/observes.ts +68 -0
- package/observation/batches/runConcurrently.ts +23 -0
- package/observation/createHandlerInstanceValidator.ts +5 -7
- package/observation/getInstanceMethods.ts +13 -4
- package/observation/index.ts +14 -0
- package/package.json +1 -1
- package/reactors/ReactorDispatcher.ts +27 -2
- package/reactors/ReactorObservationTarget.ts +48 -0
- package/reactors/ReactorPageDispatcher.ts +321 -0
- package/reactors/Reactors.ts +22 -164
- package/reactors/for_Reactors/given/observe_reactor_messages.ts +72 -0
- package/reactors/for_Reactors/when_delivering_pages/as_a_legacy_single_partition.spec.ts +51 -0
- package/reactors/for_Reactors/when_delivering_pages/returning_a_value_from_a_batch_method.spec.ts +34 -0
- package/reactors/for_Reactors/when_delivering_pages/with_batch_and_per_event_methods.spec.ts +81 -0
- package/reactors/for_Reactors/when_delivering_pages/with_batch_outcomes.spec.ts +86 -0
- package/reactors/for_Reactors/when_delivering_pages/with_per_event_handlers.spec.ts +52 -0
- package/reactors/index.ts +2 -0
- package/reducers/ReducerEventDispatcher.ts +44 -3
- package/reducers/Reducers.ts +109 -25
- package/reducers/ReductionOutcome.ts +55 -8
- package/reducers/for_Reducers/given/observe_reducer_messages.ts +77 -0
- package/reducers/for_Reducers/when_delivering_pages/to_a_batch_reducer.spec.ts +111 -0
- package/reducers/for_Reducers/when_delivering_pages/to_a_per_event_reducer.spec.ts +53 -0
- package/reducers/index.ts +2 -0
- package/testing/ReactorScenario.ts +5 -1
- package/testing/ReducerReadModelProcessor.ts +44 -0
- package/testing/for_ReactorScenario/when_the_reactor_has_a_batch_method.spec.ts +26 -0
- package/testing/for_ReadModelScenario/when_reducing_with_a_batch_method/with_events_for_two_event_sources.spec.ts +43 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PartitionSettlement.d.ts","sourceRoot":"","sources":["../../../observation/batches/PartitionSettlement.ts"],"names":[],"mappings":"AAGA,OAAO,EAAoB,KAAK,eAAe,EAAE,MAAM,6BAA6B,CAAC;AACrF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAE9D,uFAAuF;AACvF,eAAO,MAAM,2BAA2B,cAAc,CAAC;AAEvD;;;;;;GAMG;AACH,wBAAgB,QAAQ,CAAC,SAAS,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,gBAAgB,CAOxF;AAED;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,SAAS,EAAE,MAAM,EAAE,eAAe,EAAE,SAAS,MAAM,EAAE,EAAE,QAAQ,EAAE,SAAS,gBAAgB,EAAE,GAAG,gBAAgB,CAkB9I;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,gBAAgB,GAAG,eAAe,CAU5E"}
|
|
@@ -0,0 +1,64 @@
|
|
|
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 { ObservationState } from '@cratis/chronicle.contracts';
|
|
4
|
+
/** Sequence number reported when no event of a partition was observed successfully. */
|
|
5
|
+
export const SEQUENCE_NUMBER_UNAVAILABLE = 4294967295n;
|
|
6
|
+
/**
|
|
7
|
+
* Creates a {@link PartitionProblem} for a failure.
|
|
8
|
+
* @param partition - The partition.
|
|
9
|
+
* @param at - The sequence number of the event it failed at.
|
|
10
|
+
* @param error - What went wrong.
|
|
11
|
+
* @returns The {@link PartitionProblem}.
|
|
12
|
+
*/
|
|
13
|
+
export function failedAt(partition, at, error) {
|
|
14
|
+
return {
|
|
15
|
+
partition, at, state: ObservationState.Failed,
|
|
16
|
+
exceptionMessages: [String(error)],
|
|
17
|
+
exceptionStackTrace: error instanceof Error ? (error.stack ?? '') : '',
|
|
18
|
+
retryAfterMilliseconds: 0
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Settles a partition: it succeeds when no method reported a problem for it, and otherwise settles at its earliest problem.
|
|
23
|
+
* Events before that problem count as observed.
|
|
24
|
+
* @param partition - The partition.
|
|
25
|
+
* @param sequenceNumbers - The sequence numbers of the partition's events, in order.
|
|
26
|
+
* @param problems - The problems reported by any method, for any partition.
|
|
27
|
+
* @returns The {@link PartitionOutcome}.
|
|
28
|
+
*/
|
|
29
|
+
export function settlePartition(partition, sequenceNumbers, problems) {
|
|
30
|
+
const earliest = problems
|
|
31
|
+
.filter(problem => problem.partition === partition)
|
|
32
|
+
.reduce((first, problem) => !first || problem.at < first.at ? problem : first, undefined);
|
|
33
|
+
if (!earliest) {
|
|
34
|
+
return {
|
|
35
|
+
partition, state: ObservationState.Success,
|
|
36
|
+
lastSuccessfulObservation: sequenceNumbers.at(-1) ?? SEQUENCE_NUMBER_UNAVAILABLE,
|
|
37
|
+
exceptionMessages: [], exceptionStackTrace: '', retryAfterMilliseconds: 0
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
const handled = sequenceNumbers.filter(sequenceNumber => sequenceNumber < earliest.at);
|
|
41
|
+
return {
|
|
42
|
+
partition, state: earliest.state,
|
|
43
|
+
lastSuccessfulObservation: handled.at(-1) ?? SEQUENCE_NUMBER_UNAVAILABLE,
|
|
44
|
+
exceptionMessages: earliest.exceptionMessages, exceptionStackTrace: earliest.exceptionStackTrace,
|
|
45
|
+
retryAfterMilliseconds: earliest.retryAfterMilliseconds
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Converts a {@link PartitionOutcome} to the {@link PartitionResult} sent to the kernel.
|
|
50
|
+
* @param outcome - The outcome.
|
|
51
|
+
* @returns The {@link PartitionResult}.
|
|
52
|
+
*/
|
|
53
|
+
export function toPartitionResult(outcome) {
|
|
54
|
+
return {
|
|
55
|
+
Partition: outcome.partition,
|
|
56
|
+
State: outcome.state,
|
|
57
|
+
LastSuccessfulObservation: outcome.lastSuccessfulObservation,
|
|
58
|
+
ExceptionMessages: [...outcome.exceptionMessages],
|
|
59
|
+
ExceptionStackTrace: outcome.exceptionStackTrace,
|
|
60
|
+
RetryAfterMilliseconds: BigInt(Math.max(0, Math.round(outcome.retryAfterMilliseconds))),
|
|
61
|
+
ReadModelState: outcome.readModelState ?? ''
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=PartitionSettlement.js.map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AAE,EAAE,EAAE,mBAAmB,EAAE,EAAE,EAAE,sBAAsB,EAAE,CAAC;SAC5E,CAAC;IACN,CAAC;IACD,MAAM,OAAO,GAAG,eAAe,CAAC,MAAM,CAAC,cAAc,CAAC,EAAE,CAAC,cAAc,GAAG,QAAQ,CAAC,EAAE,CAAC,CAAC;IACvF,OAAO;QACH,SAAS,EAAE,KAAK,EAAE,QAAQ,CAAC,KAAK;QAChC,yBAAyB,EAAE,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,2BAA2B;QACxE,iBAAiB,EAAE,QAAQ,CAAC,iBAAiB,EAAE,mBAAmB,EAAE,QAAQ,CAAC,mBAAmB;QAChG,sBAAsB,EAAE,QAAQ,CAAC,sBAAsB;KAC1D,CAAC;AACN,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,iBAAiB,CAAC,OAAyB;IACvD,OAAO;QACH,SAAS,EAAE,OAAO,CAAC,SAAS;QAC5B,KAAK,EAAE,OAAO,CAAC,KAAK;QACpB,yBAAyB,EAAE,OAAO,CAAC,yBAAyB;QAC5D,iBAAiB,EAAE,CAAC,GAAG,OAAO,CAAC,iBAAiB,CAAC;QACjD,mBAAmB,EAAE,OAAO,CAAC,mBAAmB;QAChD,sBAAsB,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,sBAAsB,CAAC,CAAC,CAAC;QACvF,cAAc,EAAE,OAAO,CAAC,cAAc,IAAI,EAAE;KAC/C,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/** Thrown at registration when a reducer declares a batch method and per-event methods, or more than one batch method. */
|
|
2
|
+
export declare class ReducerMixesBatchAndPerEventMethods extends Error {
|
|
3
|
+
readonly reducerType: string;
|
|
4
|
+
readonly methods: readonly string[];
|
|
5
|
+
/**
|
|
6
|
+
* Creates a new {@link ReducerMixesBatchAndPerEventMethods}.
|
|
7
|
+
* @param reducerType - The name of the reducer class.
|
|
8
|
+
* @param methods - The methods that conflict.
|
|
9
|
+
*/
|
|
10
|
+
constructor(reducerType: string, methods: readonly string[]);
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=ReducerMixesBatchAndPerEventMethods.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ReducerMixesBatchAndPerEventMethods.d.ts","sourceRoot":"","sources":["../../../observation/batches/ReducerMixesBatchAndPerEventMethods.ts"],"names":[],"mappings":"AAGA,0HAA0H;AAC1H,qBAAa,mCAAoC,SAAQ,KAAK;IAM9C,QAAQ,CAAC,WAAW,EAAE,MAAM;IAAE,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE;IAL7E;;;;OAIG;IACH,YAAqB,WAAW,EAAE,MAAM,EAAW,OAAO,EAAE,SAAS,MAAM,EAAE,EAI5E;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
|
+
/** Thrown at registration when a reducer declares a batch method and per-event methods, or more than one batch method. */
|
|
4
|
+
export class ReducerMixesBatchAndPerEventMethods extends Error {
|
|
5
|
+
reducerType;
|
|
6
|
+
methods;
|
|
7
|
+
/**
|
|
8
|
+
* Creates a new {@link ReducerMixesBatchAndPerEventMethods}.
|
|
9
|
+
* @param reducerType - The name of the reducer class.
|
|
10
|
+
* @param methods - The methods that conflict.
|
|
11
|
+
*/
|
|
12
|
+
constructor(reducerType, methods) {
|
|
13
|
+
super(`Reducer '${reducerType}' declares ${methods.map(method => `'${method}'`).join(', ')}. ` +
|
|
14
|
+
'A reducer has either per-event methods or exactly one batch method, never both, because it is a single fold over one event source.');
|
|
15
|
+
this.reducerType = reducerType;
|
|
16
|
+
this.methods = methods;
|
|
17
|
+
this.name = 'ReducerMixesBatchAndPerEventMethods';
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=ReducerMixesBatchAndPerEventMethods.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ReducerMixesBatchAndPerEventMethods.js","sourceRoot":"","sources":["../../../observation/batches/ReducerMixesBatchAndPerEventMethods.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,qGAAqG;AAErG,0HAA0H;AAC1H,MAAM,OAAO,mCAAoC,SAAQ,KAAK;IAMrC,WAAW;IAAmB,OAAO;IAL1D;;;;OAIG;IACH,YAAqB,WAAmB,EAAW,OAA0B;QACzE,KAAK,CAAC,YAAY,WAAW,cAAc,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,IAAI,MAAM,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI;YAC1F,oIAAoI,CAAC,CAAC;2BAFzH,WAAW;uBAAmB,OAAO;QAGtD,IAAI,CAAC,IAAI,GAAG,qCAAqC,CAAC;IACtD,CAAC;CACJ"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import 'reflect-metadata';
|
|
2
|
+
import type { PageDelivery } from '@cratis/chronicle.contracts';
|
|
3
|
+
/** The bounds an observer declares for the pages the kernel delivers to it. */
|
|
4
|
+
export interface BatchSizeOptions {
|
|
5
|
+
/** The most events in one page. The kernel's own maximum caps it. Defaults to the kernel's default. */
|
|
6
|
+
readonly maxEvents?: number;
|
|
7
|
+
/** The most bytes in one page. The kernel's own maximum caps it. Defaults to the kernel's default. */
|
|
8
|
+
readonly maxBytes?: number;
|
|
9
|
+
/** How long, in milliseconds, the kernel may wait to fill a live page. Defaults to no delay. */
|
|
10
|
+
readonly maxDelayMilliseconds?: number;
|
|
11
|
+
/**
|
|
12
|
+
* How many event sources of one page a reducer reduces at the same time. Defaults to the number of processors;
|
|
13
|
+
* `1` reduces them one after another. Reactors call their methods for a page in order and ignore it.
|
|
14
|
+
*/
|
|
15
|
+
readonly maxConcurrency?: number;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Declares the bounds of the pages a reactor or reducer receives, the TypeScript equivalent of the C# `[BatchSize]` attribute.
|
|
19
|
+
* @param options - The {@link BatchSizeOptions}.
|
|
20
|
+
* @returns A class decorator for legacy and standard TypeScript decorators.
|
|
21
|
+
*/
|
|
22
|
+
export declare function batchSize(options: BatchSizeOptions): ClassDecorator & ((value: Function, context: ClassDecoratorContext) => void);
|
|
23
|
+
/**
|
|
24
|
+
* Gets the {@link BatchSizeOptions} declared on an observer class.
|
|
25
|
+
* @param target - The observer class.
|
|
26
|
+
* @returns The declared options, or an empty object when none are declared.
|
|
27
|
+
*/
|
|
28
|
+
export declare function getBatchSize(target: Function): BatchSizeOptions;
|
|
29
|
+
/**
|
|
30
|
+
* Gets how many event sources of one page a reducer reduces at the same time.
|
|
31
|
+
* @param target - The reducer class.
|
|
32
|
+
* @returns The declared concurrency, or the number of processors.
|
|
33
|
+
*/
|
|
34
|
+
export declare function getMaxConcurrency(target: Function): number;
|
|
35
|
+
/**
|
|
36
|
+
* Creates the page delivery the client opts in to at registration. A kernel that does not know page delivery ignores it
|
|
37
|
+
* and keeps delivering one partition at a time.
|
|
38
|
+
* @param target - The observer class.
|
|
39
|
+
* @returns The {@link PageDelivery} for the registration.
|
|
40
|
+
*/
|
|
41
|
+
export declare function toPageDelivery(target: Function): PageDelivery;
|
|
42
|
+
//# sourceMappingURL=batchSize.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"batchSize.d.ts","sourceRoot":"","sources":["../../../observation/batches/batchSize.ts"],"names":[],"mappings":"AAGA,OAAO,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAKhE,+EAA+E;AAC/E,MAAM,WAAW,gBAAgB;IAC7B,uGAAuG;IACvG,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAE5B,sGAAsG;IACtG,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAE3B,gGAAgG;IAChG,QAAQ,CAAC,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAEvC;;;OAGG;IACH,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC;CACpC;AAED;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,OAAO,EAAE,gBAAgB,GAAG,cAAc,GAAG,CAAC,CAAC,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,qBAAqB,KAAK,IAAI,CAAC,CAYjI;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,QAAQ,GAAG,gBAAgB,CAE/D;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,QAAQ,GAAG,MAAM,CAE1D;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,QAAQ,GAAG,YAAY,CAQ7D"}
|
|
@@ -0,0 +1,55 @@
|
|
|
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 'reflect-metadata';
|
|
4
|
+
import { availableParallelism } from 'node:os';
|
|
5
|
+
const METADATA_KEY = 'chronicle:observation:batchSize';
|
|
6
|
+
/**
|
|
7
|
+
* Declares the bounds of the pages a reactor or reducer receives, the TypeScript equivalent of the C# `[BatchSize]` attribute.
|
|
8
|
+
* @param options - The {@link BatchSizeOptions}.
|
|
9
|
+
* @returns A class decorator for legacy and standard TypeScript decorators.
|
|
10
|
+
*/
|
|
11
|
+
export function batchSize(options) {
|
|
12
|
+
for (const [name, value] of Object.entries(options)) {
|
|
13
|
+
if (value !== undefined && (!Number.isInteger(value) || value < (name === 'maxDelayMilliseconds' ? 0 : 1))) {
|
|
14
|
+
throw new RangeError(`Batch size '${name}' must be a ${name === 'maxDelayMilliseconds' ? 'non-negative' : 'positive'} integer.`);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
return (target, context) => {
|
|
18
|
+
if (context !== undefined && context.kind !== 'class') {
|
|
19
|
+
throw new TypeError('Batch size can only decorate a reactor or reducer class.');
|
|
20
|
+
}
|
|
21
|
+
Reflect.defineMetadata(METADATA_KEY, Object.freeze({ ...options }), target);
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Gets the {@link BatchSizeOptions} declared on an observer class.
|
|
26
|
+
* @param target - The observer class.
|
|
27
|
+
* @returns The declared options, or an empty object when none are declared.
|
|
28
|
+
*/
|
|
29
|
+
export function getBatchSize(target) {
|
|
30
|
+
return Reflect.getOwnMetadata(METADATA_KEY, target) ?? {};
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Gets how many event sources of one page a reducer reduces at the same time.
|
|
34
|
+
* @param target - The reducer class.
|
|
35
|
+
* @returns The declared concurrency, or the number of processors.
|
|
36
|
+
*/
|
|
37
|
+
export function getMaxConcurrency(target) {
|
|
38
|
+
return getBatchSize(target).maxConcurrency ?? availableParallelism();
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Creates the page delivery the client opts in to at registration. A kernel that does not know page delivery ignores it
|
|
42
|
+
* and keeps delivering one partition at a time.
|
|
43
|
+
* @param target - The observer class.
|
|
44
|
+
* @returns The {@link PageDelivery} for the registration.
|
|
45
|
+
*/
|
|
46
|
+
export function toPageDelivery(target) {
|
|
47
|
+
const options = getBatchSize(target);
|
|
48
|
+
return {
|
|
49
|
+
Enabled: true,
|
|
50
|
+
MaxEventsPerPage: options.maxEvents ?? 0,
|
|
51
|
+
MaxBytesPerPage: options.maxBytes ?? 0,
|
|
52
|
+
MaxDelayMilliseconds: options.maxDelayMilliseconds ?? 0
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=batchSize.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"batchSize.js","sourceRoot":"","sources":["../../../observation/batches/batchSize.ts"],"names":[],"mappings":"AAA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CAAC,cAAc,IAAI,oBAAoB,EAAE,CAAC;AACzE,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,cAAc,CAAC,MAAgB;IAC3C,MAAM,OAAO,GAAG,YAAY,CAAC,MAAM,CAAC,CAAC;IACrC,OAAO;QACH,OAAO,EAAE,IAAI;QACb,gBAAgB,EAAE,OAAO,CAAC,SAAS,IAAI,CAAC;QACxC,eAAe,EAAE,OAAO,CAAC,QAAQ,IAAI,CAAC;QACtC,oBAAoB,EAAE,OAAO,CAAC,oBAAoB,IAAI,CAAC;KAC1D,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { EventsToObserve, ReduceOperationMessage } from '@cratis/chronicle.contracts';
|
|
2
|
+
import { BatchContext } from './BatchContext.js';
|
|
3
|
+
import type { BatchContextObserver } from './BatchContextObserver.js';
|
|
4
|
+
import type { DeliveredPartition } from './DeliveredPartition.js';
|
|
5
|
+
/**
|
|
6
|
+
* Creates the {@link BatchContext} describing a delivered page.
|
|
7
|
+
* @param observer - The observer the page is delivered to.
|
|
8
|
+
* @param message - The delivered message.
|
|
9
|
+
* @param partitions - The partitions of the delivery.
|
|
10
|
+
* @returns The {@link BatchContext}.
|
|
11
|
+
*/
|
|
12
|
+
export declare function createBatchContext(observer: BatchContextObserver, message: EventsToObserve | ReduceOperationMessage, partitions: readonly DeliveredPartition[]): BatchContext;
|
|
13
|
+
//# sourceMappingURL=createBatchContext.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createBatchContext.d.ts","sourceRoot":"","sources":["../../../observation/batches/createBatchContext.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAC3F,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACtE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAIlE;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,oBAAoB,EAAE,OAAO,EAAE,eAAe,GAAG,sBAAsB,EAChH,UAAU,EAAE,SAAS,kBAAkB,EAAE,GAAG,YAAY,CAa3D"}
|
|
@@ -0,0 +1,27 @@
|
|
|
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 { BatchContext } from './BatchContext.js';
|
|
4
|
+
import { toObservationOrigin } from './ObservationOrigin.js';
|
|
5
|
+
import { isPage } from './PageMessages.js';
|
|
6
|
+
/**
|
|
7
|
+
* Creates the {@link BatchContext} describing a delivered page.
|
|
8
|
+
* @param observer - The observer the page is delivered to.
|
|
9
|
+
* @param message - The delivered message.
|
|
10
|
+
* @param partitions - The partitions of the delivery.
|
|
11
|
+
* @returns The {@link BatchContext}.
|
|
12
|
+
*/
|
|
13
|
+
export function createBatchContext(observer, message, partitions) {
|
|
14
|
+
const sequenceNumbers = partitions.flatMap(partition => partition.events.map(event => event.Context.SequenceNumber));
|
|
15
|
+
const deliverWithin = Number(message.DeliverWithinMilliseconds ?? 0n);
|
|
16
|
+
return new BatchContext({
|
|
17
|
+
...observer,
|
|
18
|
+
origin: toObservationOrigin(message.Origin),
|
|
19
|
+
partitions: partitions.map(partition => partition.partition),
|
|
20
|
+
eventCount: sequenceNumbers.length,
|
|
21
|
+
firstSequenceNumber: sequenceNumbers.length > 0 ? sequenceNumbers.reduce((min, value) => value < min ? value : min) : undefined,
|
|
22
|
+
lastSequenceNumber: sequenceNumbers.length > 0 ? sequenceNumbers.reduce((max, value) => value > max ? value : max) : undefined,
|
|
23
|
+
deadline: deliverWithin > 0 ? new Date(Date.now() + deliverWithin) : undefined,
|
|
24
|
+
canDefer: isPage(message)
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=createBatchContext.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,EAAE,EAAE,CAAC,KAAK,GAAG,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS;QAC9H,QAAQ,EAAE,aAAa,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,aAAa,CAAC,CAAC,CAAC,CAAC,SAAS;QAC9E,QAAQ,EAAE,MAAM,CAAC,OAAO,CAAC;KAC5B,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import 'reflect-metadata';
|
|
2
|
+
import type { Constructor } from '@cratis/fundamentals';
|
|
3
|
+
/**
|
|
4
|
+
* Makes a reactor or reducer method a batch method and declares one event type it observes. Apply it once per event
|
|
5
|
+
* type; it is the TypeScript equivalent of the C# `[Observes<TEvent>]` attribute.
|
|
6
|
+
*
|
|
7
|
+
* A batch method receives an {@link EventBatch} of every event of the types it observes, in sequence order, and a
|
|
8
|
+
* {@link BatchContext} describing the page. Each event type reaches exactly one method of an observer: a batch method
|
|
9
|
+
* or a per-event method, never both.
|
|
10
|
+
*
|
|
11
|
+
* @param eventType - The event constructor observed by this method. The event type must be registered with the owning event store.
|
|
12
|
+
* @returns A method decorator for legacy and standard TypeScript decorators.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```typescript
|
|
16
|
+
* @reactor()
|
|
17
|
+
* class Users {
|
|
18
|
+
* @observes(UserRegistered)
|
|
19
|
+
* @observes(UserRenamed)
|
|
20
|
+
* async index(batch: EventBatch, context: BatchContext): Promise<void> {
|
|
21
|
+
* // ...
|
|
22
|
+
* }
|
|
23
|
+
* }
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
export declare function observes(eventType: Constructor): MethodDecorator & ((value: Function, context: ClassMethodDecoratorContext) => void);
|
|
27
|
+
/**
|
|
28
|
+
* Gets the event constructors a batch method observes, without inheriting metadata.
|
|
29
|
+
* @param method - The method.
|
|
30
|
+
* @returns The observed event constructors, or an empty array when the method is not a batch method.
|
|
31
|
+
*/
|
|
32
|
+
export declare function getObservedEventTypes(method: Function): readonly Constructor[];
|
|
33
|
+
/**
|
|
34
|
+
* Checks whether a method is a batch method, that is decorated with {@link observes}.
|
|
35
|
+
* @param method - The method.
|
|
36
|
+
* @returns True when it is a batch method.
|
|
37
|
+
*/
|
|
38
|
+
export declare function isBatchMethod(method: Function): boolean;
|
|
39
|
+
//# sourceMappingURL=observes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"observes.d.ts","sourceRoot":"","sources":["../../../observation/batches/observes.ts"],"names":[],"mappings":"AAGA,OAAO,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAIxD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,QAAQ,CAAC,SAAS,EAAE,WAAW,GAAG,eAAe,GAAG,CAAC,CAAC,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,2BAA2B,KAAK,IAAI,CAAC,CAkBpI;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,QAAQ,GAAG,SAAS,WAAW,EAAE,CAE9E;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,QAAQ,GAAG,OAAO,CAEvD"}
|
|
@@ -0,0 +1,63 @@
|
|
|
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 'reflect-metadata';
|
|
4
|
+
const METADATA_KEY = 'chronicle:observation:observes';
|
|
5
|
+
/**
|
|
6
|
+
* Makes a reactor or reducer method a batch method and declares one event type it observes. Apply it once per event
|
|
7
|
+
* type; it is the TypeScript equivalent of the C# `[Observes<TEvent>]` attribute.
|
|
8
|
+
*
|
|
9
|
+
* A batch method receives an {@link EventBatch} of every event of the types it observes, in sequence order, and a
|
|
10
|
+
* {@link BatchContext} describing the page. Each event type reaches exactly one method of an observer: a batch method
|
|
11
|
+
* or a per-event method, never both.
|
|
12
|
+
*
|
|
13
|
+
* @param eventType - The event constructor observed by this method. The event type must be registered with the owning event store.
|
|
14
|
+
* @returns A method decorator for legacy and standard TypeScript decorators.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```typescript
|
|
18
|
+
* @reactor()
|
|
19
|
+
* class Users {
|
|
20
|
+
* @observes(UserRegistered)
|
|
21
|
+
* @observes(UserRenamed)
|
|
22
|
+
* async index(batch: EventBatch, context: BatchContext): Promise<void> {
|
|
23
|
+
* // ...
|
|
24
|
+
* }
|
|
25
|
+
* }
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
export function observes(eventType) {
|
|
29
|
+
return (target, propertyOrContext, descriptor) => {
|
|
30
|
+
const isStandard = typeof propertyOrContext === 'object';
|
|
31
|
+
const method = isStandard ? target : descriptor?.value;
|
|
32
|
+
const name = isStandard ? propertyOrContext.name : propertyOrContext;
|
|
33
|
+
if ((isStandard && (propertyOrContext.kind !== 'method' || propertyOrContext.static || propertyOrContext.private)) ||
|
|
34
|
+
(!isStandard && typeof target === 'function') || typeof name !== 'string' || typeof method !== 'function') {
|
|
35
|
+
throw new TypeError('Observes requires a public, string-named instance method.');
|
|
36
|
+
}
|
|
37
|
+
if (typeof eventType !== 'function') {
|
|
38
|
+
throw new TypeError('Observes requires an event constructor.');
|
|
39
|
+
}
|
|
40
|
+
const observed = Reflect.getOwnMetadata(METADATA_KEY, method) ?? [];
|
|
41
|
+
if (observed.includes(eventType)) {
|
|
42
|
+
throw new TypeError(`Batch method '${name}' observes '${eventType.name}' more than once.`);
|
|
43
|
+
}
|
|
44
|
+
Reflect.defineMetadata(METADATA_KEY, [...observed, eventType], method);
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Gets the event constructors a batch method observes, without inheriting metadata.
|
|
49
|
+
* @param method - The method.
|
|
50
|
+
* @returns The observed event constructors, or an empty array when the method is not a batch method.
|
|
51
|
+
*/
|
|
52
|
+
export function getObservedEventTypes(method) {
|
|
53
|
+
return Reflect.getOwnMetadata(METADATA_KEY, method) ?? [];
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Checks whether a method is a batch method, that is decorated with {@link observes}.
|
|
57
|
+
* @param method - The method.
|
|
58
|
+
* @returns True when it is a batch method.
|
|
59
|
+
*/
|
|
60
|
+
export function isBatchMethod(method) {
|
|
61
|
+
return getObservedEventTypes(method).length > 0;
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=observes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"observes.js","sourceRoot":"","sources":["../../../observation/batches/observes.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,qGAAqG;AAErG,OAAO,kBAAkB,CAAC;AAG1B,MAAM,YAAY,GAAG,gCAAgC,CAAC;AAEtD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,UAAU,QAAQ,CAAC,SAAsB;IAC3C,OAAO,CAAC,MAAc,EAAE,iBAAgE,EAAE,UAA+B,EAAE,EAAE;QACzH,MAAM,UAAU,GAAG,OAAO,iBAAiB,KAAK,QAAQ,CAAC;QACzD,MAAM,MAAM,GAAG,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,UAAU,EAAE,KAAK,CAAC;QACvD,MAAM,IAAI,GAAG,UAAU,CAAC,CAAC,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC,CAAC,iBAAiB,CAAC;QACrE,IAAI,CAAC,UAAU,IAAI,CAAC,iBAAiB,CAAC,IAAI,KAAK,QAAQ,IAAI,iBAAiB,CAAC,MAAM,IAAI,iBAAiB,CAAC,OAAO,CAAC,CAAC;YAC9G,CAAC,CAAC,UAAU,IAAI,OAAO,MAAM,KAAK,UAAU,CAAC,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,OAAO,MAAM,KAAK,UAAU,EAAE,CAAC;YAC5G,MAAM,IAAI,SAAS,CAAC,2DAA2D,CAAC,CAAC;QACrF,CAAC;QACD,IAAI,OAAO,SAAS,KAAK,UAAU,EAAE,CAAC;YAClC,MAAM,IAAI,SAAS,CAAC,yCAAyC,CAAC,CAAC;QACnE,CAAC;QACD,MAAM,QAAQ,GAAI,OAAO,CAAC,cAAc,CAAC,YAAY,EAAE,MAAM,CAA+B,IAAI,EAAE,CAAC;QACnG,IAAI,QAAQ,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC;YAC/B,MAAM,IAAI,SAAS,CAAC,iBAAiB,IAAI,eAAgB,SAAsB,CAAC,IAAI,mBAAmB,CAAC,CAAC;QAC7G,CAAC;QACD,OAAO,CAAC,cAAc,CAAC,YAAY,EAAE,CAAC,GAAG,QAAQ,EAAE,SAAS,CAAC,EAAE,MAAM,CAAC,CAAC;IAC3E,CAAC,CAAC;AACN,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,qBAAqB,CAAC,MAAgB;IAClD,OAAQ,OAAO,CAAC,cAAc,CAAC,YAAY,EAAE,MAAM,CAA+B,IAAI,EAAE,CAAC;AAC7F,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,aAAa,CAAC,MAAgB;IAC1C,OAAO,qBAAqB,CAAC,MAAM,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC;AACpD,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Runs a callback for every item, with at most a given number running at the same time, and keeps the results in item order.
|
|
3
|
+
* @param items - The items.
|
|
4
|
+
* @param maxConcurrency - The most callbacks running at the same time; `1` runs them one after another.
|
|
5
|
+
* @param callback - The callback for one item.
|
|
6
|
+
* @returns The results, in the order of the items.
|
|
7
|
+
*/
|
|
8
|
+
export declare function runConcurrently<TItem, TResult>(items: readonly TItem[], maxConcurrency: number, callback: (item: TItem, index: number) => Promise<TResult>): Promise<TResult[]>;
|
|
9
|
+
//# sourceMappingURL=runConcurrently.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runConcurrently.d.ts","sourceRoot":"","sources":["../../../observation/batches/runConcurrently.ts"],"names":[],"mappings":"AAGA;;;;;;GAMG;AACH,wBAAsB,eAAe,CAAC,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,KAAK,EAAE,EAAE,cAAc,EAAE,MAAM,EACjG,QAAQ,EAAE,CAAC,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC,CAWlF"}
|
|
@@ -0,0 +1,22 @@
|
|
|
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
|
+
* Runs a callback for every item, with at most a given number running at the same time, and keeps the results in item order.
|
|
5
|
+
* @param items - The items.
|
|
6
|
+
* @param maxConcurrency - The most callbacks running at the same time; `1` runs them one after another.
|
|
7
|
+
* @param callback - The callback for one item.
|
|
8
|
+
* @returns The results, in the order of the items.
|
|
9
|
+
*/
|
|
10
|
+
export async function runConcurrently(items, maxConcurrency, callback) {
|
|
11
|
+
const results = new Array(items.length);
|
|
12
|
+
let next = 0;
|
|
13
|
+
const worker = async () => {
|
|
14
|
+
while (next < items.length) {
|
|
15
|
+
const index = next++;
|
|
16
|
+
results[index] = await callback(items[index], index);
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
await Promise.all(Array.from({ length: Math.max(1, Math.min(maxConcurrency, items.length)) }, worker));
|
|
20
|
+
return results;
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=runConcurrently.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runConcurrently.js","sourceRoot":"","sources":["../../../observation/batches/runConcurrently.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,qGAAqG;AAErG;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,eAAe,CAAiB,KAAuB,EAAE,cAAsB,EACjG,QAA0D;IAC1D,MAAM,OAAO,GAAG,IAAI,KAAK,CAAU,KAAK,CAAC,MAAM,CAAC,CAAC;IACjD,IAAI,IAAI,GAAG,CAAC,CAAC;IACb,MAAM,MAAM,GAAG,KAAK,IAAI,EAAE;QACtB,OAAO,IAAI,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC;YACzB,MAAM,KAAK,GAAG,IAAI,EAAE,CAAC;YACrB,OAAO,CAAC,KAAK,CAAC,GAAG,MAAM,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,KAAK,CAAC,CAAC;QACzD,CAAC;IACL,CAAC,CAAC;IACF,MAAM,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,cAAc,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC,CAAC;IACvG,OAAO,OAAO,CAAC;AACnB,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { Constructor } from '@cratis/fundamentals';
|
|
2
|
-
/** Captures @handles prototype methods during preflight and rejects instance properties hiding them, except bound methods. */
|
|
2
|
+
/** Captures @handles and @observes prototype methods during preflight and rejects instance properties hiding them, except bound methods. */
|
|
3
3
|
export declare function createHandlerInstanceValidator(type: Constructor, names: Iterable<string>, methods?: Map<string, Function>): (instance: object) => void;
|
|
4
4
|
//# sourceMappingURL=createHandlerInstanceValidator.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createHandlerInstanceValidator.d.ts","sourceRoot":"","sources":["../../observation/createHandlerInstanceValidator.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"createHandlerInstanceValidator.d.ts","sourceRoot":"","sources":["../../observation/createHandlerInstanceValidator.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAGxD,4IAA4I;AAC5I,wBAAgB,8BAA8B,CAAC,IAAI,EAAE,WAAW,EAAE,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,wBAA2B,GACzH,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAqB7B"}
|
|
@@ -1,17 +1,15 @@
|
|
|
1
1
|
// Copyright (c) Cratis. All rights reserved.
|
|
2
2
|
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
/** Captures @handles prototype methods during preflight and rejects instance properties hiding them, except bound methods. */
|
|
3
|
+
import { describeExplicitHandler, getInstanceMethods } from './getInstanceMethods.js';
|
|
4
|
+
/** Captures @handles and @observes prototype methods during preflight and rejects instance properties hiding them, except bound methods. */
|
|
6
5
|
export function createHandlerInstanceValidator(type, names, methods = getInstanceMethods(type)) {
|
|
7
|
-
const handlers = [...new Set(names)].filter(name =>
|
|
6
|
+
const handlers = [...new Set(names)].filter(name => describeExplicitHandler(methods.get(name)) !== undefined).map(name => {
|
|
8
7
|
const method = methods.get(name);
|
|
9
8
|
let declaring = type.prototype;
|
|
10
9
|
while (declaring && Object.getOwnPropertyDescriptor(declaring, name)?.value !== method) {
|
|
11
10
|
declaring = Object.getPrototypeOf(declaring);
|
|
12
11
|
}
|
|
13
|
-
const
|
|
14
|
-
const declaration = `@handles(${eventType.name})`;
|
|
12
|
+
const declaration = describeExplicitHandler(method);
|
|
15
13
|
return { name, method, declaration, declaringType: declaring?.constructor.name ?? type.name };
|
|
16
14
|
});
|
|
17
15
|
return instance => {
|
|
@@ -23,7 +21,7 @@ export function createHandlerInstanceValidator(type, names, methods = getInstanc
|
|
|
23
21
|
if (current === instance && typeof value === 'function' && isBoundCopyOf(value, method))
|
|
24
22
|
continue;
|
|
25
23
|
if (current === instance || !current || value !== method) {
|
|
26
|
-
throw new Error(`Override '${name}' on '${type.name}' hides ${declaration} declared on '${declaringType}'; use a method with @handles instead of an instance field.`);
|
|
24
|
+
throw new Error(`Override '${name}' on '${type.name}' hides ${declaration} declared on '${declaringType}'; use a method with ${declaration.startsWith('@observes') ? '@observes' : '@handles'} instead of an instance field.`);
|
|
27
25
|
}
|
|
28
26
|
}
|
|
29
27
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createHandlerInstanceValidator.js","sourceRoot":"","sources":["../../observation/createHandlerInstanceValidator.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,qGAAqG;AAGrG,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"createHandlerInstanceValidator.js","sourceRoot":"","sources":["../../observation/createHandlerInstanceValidator.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,qGAAqG;AAGrG,OAAO,EAAE,uBAAuB,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAEtF,4IAA4I;AAC5I,MAAM,UAAU,8BAA8B,CAAC,IAAiB,EAAE,KAAuB,EAAE,OAAO,GAAG,kBAAkB,CAAC,IAAI,CAAC;IAEzH,MAAM,QAAQ,GAAG,CAAC,GAAG,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,uBAAuB,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAE,CAAC,KAAK,SAAS,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE;QACtH,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,IAAI,CAAE,CAAC;QAClC,IAAI,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC;QAC/B,OAAO,SAAS,IAAI,MAAM,CAAC,wBAAwB,CAAC,SAAS,EAAE,IAAI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C;AAED;;;;;GAKG;AACH,SAAS,aAAa,CAAC,KAAe,EAAE,MAAgB;IACpD,OAAO,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,YAAY,EAAE,EAAE,CAAC,KAAK,MAAM,CAAC,IAAI,CAAC;AACnG,CAAC"}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import type { Constructor } from '@cratis/fundamentals';
|
|
2
|
-
/** Finds prototype methods without invoking getters; explicit handlers require explicitly decorated overrides. */
|
|
2
|
+
/** Finds prototype methods without invoking getters; explicit handlers and batch methods require explicitly decorated overrides. */
|
|
3
3
|
export declare function getInstanceMethods(type: Constructor): Map<string, Function>;
|
|
4
|
+
/** Describes the explicit handler decorator of a method, or undefined when it has none. */
|
|
5
|
+
export declare function describeExplicitHandler(method: Function): string | undefined;
|
|
4
6
|
//# sourceMappingURL=getInstanceMethods.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getInstanceMethods.d.ts","sourceRoot":"","sources":["../../observation/getInstanceMethods.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"getInstanceMethods.d.ts","sourceRoot":"","sources":["../../observation/getInstanceMethods.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAIxD,oIAAoI;AACpI,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,WAAW,GAAG,GAAG,CAAC,MAAM,EAAE,QAAQ,CAAC,CAqB3E;AAED,2FAA2F;AAC3F,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,QAAQ,GAAG,MAAM,GAAG,SAAS,CAK5E"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
// Copyright (c) Cratis. All rights reserved.
|
|
2
2
|
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
3
3
|
import { getHandledEventType } from '../events/handles.js';
|
|
4
|
-
|
|
4
|
+
import { getObservedEventTypes } from './batches/observes.js';
|
|
5
|
+
/** Finds prototype methods without invoking getters; explicit handlers and batch methods require explicitly decorated overrides. */
|
|
5
6
|
export function getInstanceMethods(type) {
|
|
6
7
|
const methods = new Map();
|
|
7
8
|
const declaringTypes = new Map();
|
|
@@ -12,10 +13,10 @@ export function getInstanceMethods(type) {
|
|
|
12
13
|
const method = Object.getOwnPropertyDescriptor(current, name)?.value;
|
|
13
14
|
const declaringType = declaringTypes.get(name);
|
|
14
15
|
if (declaringType !== undefined) {
|
|
15
|
-
const
|
|
16
|
+
const declaration = typeof method === 'function' ? describeExplicitHandler(method) : undefined;
|
|
16
17
|
const override = methods.get(name);
|
|
17
|
-
if (
|
|
18
|
-
throw new Error(`Override '${name}' on '${declaringType}' hides
|
|
18
|
+
if (declaration && (!override || describeExplicitHandler(override) === undefined)) {
|
|
19
|
+
throw new Error(`Override '${name}' on '${declaringType}' hides ${declaration} declared on '${current.constructor.name}'; redecorate the override.`);
|
|
19
20
|
}
|
|
20
21
|
continue;
|
|
21
22
|
}
|
|
@@ -26,4 +27,12 @@ export function getInstanceMethods(type) {
|
|
|
26
27
|
}
|
|
27
28
|
return methods;
|
|
28
29
|
}
|
|
30
|
+
/** Describes the explicit handler decorator of a method, or undefined when it has none. */
|
|
31
|
+
export function describeExplicitHandler(method) {
|
|
32
|
+
const eventType = getHandledEventType(method);
|
|
33
|
+
if (eventType)
|
|
34
|
+
return `@handles(${eventType.name})`;
|
|
35
|
+
const observed = getObservedEventTypes(method);
|
|
36
|
+
return observed.length > 0 ? observed.map(type => `@observes(${type.name})`).join(' ') : undefined;
|
|
37
|
+
}
|
|
29
38
|
//# sourceMappingURL=getInstanceMethods.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getInstanceMethods.js","sourceRoot":"","sources":["../../observation/getInstanceMethods.ts"],"names":[],"mappings":"AA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SAAS,CAAC,EAAE,CAAC;oBAChF,MAAM,IAAI,KAAK,CAAC,aAAa,IAAI,SAAS,aAAa,WAAW,WAAW,iBAAiB,OAAO,CAAC,WAAW,CAAC,IAAI,6BAA6B,CAAC,CAAC;gBACzJ,CAAC;gBACD,SAAS;YACb,CAAC;YACD,cAAc,CAAC,GAAG,CAAC,IAAI,EAAE,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;YACnD,IAAI,OAAO,MAAM,KAAK,UAAU;gBAAE,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QAChE,CAAC;IACL,CAAC;IACD,OAAO,OAAO,CAAC;AACnB,CAAC;AAED,2FAA2F;AAC3F,MAAM,UAAU,uBAAuB,CAAC,MAAgB;IACpD,MAAM,SAAS,GAAG,mBAAmB,CAAC,MAAM,CAAC,CAAC;IAC9C,IAAI,SAAS;QAAE,OAAO,YAAa,SAAsB,CAAC,IAAI,GAAG,CAAC;IAClE,MAAM,QAAQ,GAAG,qBAAqB,CAAC,MAAM,CAAC,CAAC;IAC/C,OAAO,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,aAAc,IAAiB,CAAC,IAAI,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;AACrH,CAAC"}
|
|
@@ -18,4 +18,18 @@ export type { IObservers } from './IObservers.js';
|
|
|
18
18
|
export { Observers } from './Observers.js';
|
|
19
19
|
export type { ICanBeNotifiedWhenReplay } from './ICanBeNotifiedWhenReplay.js';
|
|
20
20
|
export type { ICanBeNotifiedWhenPartitionReplayed } from './ICanBeNotifiedWhenPartitionReplayed.js';
|
|
21
|
+
export { observes } from './batches/observes.js';
|
|
22
|
+
export { batchSize } from './batches/batchSize.js';
|
|
23
|
+
export type { BatchSizeOptions } from './batches/batchSize.js';
|
|
24
|
+
export { EventBatch } from './batches/EventBatch.js';
|
|
25
|
+
export { EventAndContext } from './batches/EventAndContext.js';
|
|
26
|
+
export { BatchContext } from './batches/BatchContext.js';
|
|
27
|
+
export { ObservationOrigin } from './batches/ObservationOrigin.js';
|
|
28
|
+
export { PartitionNotInBatch } from './batches/PartitionNotInBatch.js';
|
|
29
|
+
export { PartitionFailedInBatch } from './batches/PartitionFailedInBatch.js';
|
|
30
|
+
export { DeferralNotSupportedByKernel } from './batches/DeferralNotSupportedByKernel.js';
|
|
31
|
+
export { EventTypeObservedByMoreThanOneMethod } from './batches/EventTypeObservedByMoreThanOneMethod.js';
|
|
32
|
+
export { InvalidBatchMethod } from './batches/InvalidBatchMethod.js';
|
|
33
|
+
export { ReducerMixesBatchAndPerEventMethods } from './batches/ReducerMixesBatchAndPerEventMethods.js';
|
|
34
|
+
export { BatchMethodReturnedAValue } from './batches/BatchMethodReturnedAValue.js';
|
|
21
35
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../observation/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,YAAY,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC5D,YAAY,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAC1E,YAAY,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,YAAY,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AACpE,OAAO,EAAE,qBAAqB,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;A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|
|
@@ -11,4 +11,17 @@ export { toObserverRemovalOutcome, toObserverRemovalResult } from './toObserverR
|
|
|
11
11
|
export { FastForwardOutcome } from './FastForwardOutcome.js';
|
|
12
12
|
export { toFastForwardOutcome, toFastForwardResult } from './toFastForwardResult.js';
|
|
13
13
|
export { Observers } from './Observers.js';
|
|
14
|
+
export { observes } from './batches/observes.js';
|
|
15
|
+
export { batchSize } from './batches/batchSize.js';
|
|
16
|
+
export { EventBatch } from './batches/EventBatch.js';
|
|
17
|
+
export { EventAndContext } from './batches/EventAndContext.js';
|
|
18
|
+
export { BatchContext } from './batches/BatchContext.js';
|
|
19
|
+
export { ObservationOrigin } from './batches/ObservationOrigin.js';
|
|
20
|
+
export { PartitionNotInBatch } from './batches/PartitionNotInBatch.js';
|
|
21
|
+
export { PartitionFailedInBatch } from './batches/PartitionFailedInBatch.js';
|
|
22
|
+
export { DeferralNotSupportedByKernel } from './batches/DeferralNotSupportedByKernel.js';
|
|
23
|
+
export { EventTypeObservedByMoreThanOneMethod } from './batches/EventTypeObservedByMoreThanOneMethod.js';
|
|
24
|
+
export { InvalidBatchMethod } from './batches/InvalidBatchMethod.js';
|
|
25
|
+
export { ReducerMixesBatchAndPerEventMethods } from './batches/ReducerMixesBatchAndPerEventMethods.js';
|
|
26
|
+
export { BatchMethodReturnedAValue } from './batches/BatchMethodReturnedAValue.js';
|
|
14
27
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../observation/index.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,qGAAqG;AAErG,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAIjE,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EAAE,YA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