@cratis/chronicle 6.49.0 → 6.51.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 (223) hide show
  1. package/dist/eventSequences/AppendOptions.d.ts +10 -0
  2. package/dist/eventSequences/AppendOptions.d.ts.map +1 -1
  3. package/dist/eventSequences/EventForEventSourceId.d.ts +6 -0
  4. package/dist/eventSequences/EventForEventSourceId.d.ts.map +1 -1
  5. package/dist/eventSequences/EventSequence.d.ts.map +1 -1
  6. package/dist/eventSequences/EventSequence.js +28 -8
  7. package/dist/eventSequences/EventSequence.js.map +1 -1
  8. package/dist/eventSequences/ITransactionalEventSequence.d.ts +5 -5
  9. package/dist/eventSequences/ITransactionalEventSequence.d.ts.map +1 -1
  10. package/dist/eventSequences/NamedTagsWithRegisteredEventSourceNotSupported.d.ts +5 -0
  11. package/dist/eventSequences/NamedTagsWithRegisteredEventSourceNotSupported.d.ts.map +1 -0
  12. package/dist/eventSequences/NamedTagsWithRegisteredEventSourceNotSupported.js +12 -0
  13. package/dist/eventSequences/NamedTagsWithRegisteredEventSourceNotSupported.js.map +1 -0
  14. package/dist/eventSequences/TransactionalEventSequence.d.ts +3 -3
  15. package/dist/eventSequences/TransactionalEventSequence.d.ts.map +1 -1
  16. package/dist/eventSequences/TransactionalEventSequence.js +7 -4
  17. package/dist/eventSequences/TransactionalEventSequence.js.map +1 -1
  18. package/dist/eventSequences/createAppendNotification.d.ts +2 -1
  19. package/dist/eventSequences/createAppendNotification.d.ts.map +1 -1
  20. package/dist/eventSequences/createAppendNotification.js +3 -2
  21. package/dist/eventSequences/createAppendNotification.js.map +1 -1
  22. package/dist/eventSequences/ensureNamedTagBatchIsSupported.d.ts +3 -0
  23. package/dist/eventSequences/ensureNamedTagBatchIsSupported.d.ts.map +1 -0
  24. package/dist/eventSequences/ensureNamedTagBatchIsSupported.js +10 -0
  25. package/dist/eventSequences/ensureNamedTagBatchIsSupported.js.map +1 -0
  26. package/dist/eventSequences/index.d.ts +1 -0
  27. package/dist/eventSequences/index.d.ts.map +1 -1
  28. package/dist/eventSequences/index.js +1 -0
  29. package/dist/eventSequences/index.js.map +1 -1
  30. package/dist/eventSequences/prepareBatchAppend.d.ts +1 -0
  31. package/dist/eventSequences/prepareBatchAppend.d.ts.map +1 -1
  32. package/dist/eventSequences/prepareBatchAppend.js +4 -1
  33. package/dist/eventSequences/prepareBatchAppend.js.map +1 -1
  34. package/dist/eventSequences/prepareSingleAppend.d.ts +1 -0
  35. package/dist/eventSequences/prepareSingleAppend.d.ts.map +1 -1
  36. package/dist/eventSequences/prepareSingleAppend.js +3 -1
  37. package/dist/eventSequences/prepareSingleAppend.js.map +1 -1
  38. package/dist/events/EventContext.d.ts +7 -0
  39. package/dist/events/EventContext.d.ts.map +1 -1
  40. package/dist/events/InvalidNamedTag.d.ts +8 -0
  41. package/dist/events/InvalidNamedTag.d.ts.map +1 -0
  42. package/dist/events/InvalidNamedTag.js +13 -0
  43. package/dist/events/InvalidNamedTag.js.map +1 -0
  44. package/dist/events/NamedTag.d.ts +25 -0
  45. package/dist/events/NamedTag.d.ts.map +1 -0
  46. package/dist/events/NamedTag.js +39 -0
  47. package/dist/events/NamedTag.js.map +1 -0
  48. package/dist/events/constraints/ConstraintBuilder.d.ts +7 -0
  49. package/dist/events/constraints/ConstraintBuilder.d.ts.map +1 -1
  50. package/dist/events/constraints/ConstraintBuilder.js +13 -0
  51. package/dist/events/constraints/ConstraintBuilder.js.map +1 -1
  52. package/dist/events/constraints/ConstraintEventSequences.d.ts +19 -0
  53. package/dist/events/constraints/ConstraintEventSequences.d.ts.map +1 -0
  54. package/dist/events/constraints/ConstraintEventSequences.js +39 -0
  55. package/dist/events/constraints/ConstraintEventSequences.js.map +1 -0
  56. package/dist/events/constraints/Constraints.d.ts.map +1 -1
  57. package/dist/events/constraints/Constraints.js +24 -3
  58. package/dist/events/constraints/Constraints.js.map +1 -1
  59. package/dist/events/constraints/IConstraintBuilder.d.ts +18 -0
  60. package/dist/events/constraints/IConstraintBuilder.d.ts.map +1 -1
  61. package/dist/events/constraints/UniqueOptions.d.ts +15 -0
  62. package/dist/events/constraints/UniqueOptions.d.ts.map +1 -0
  63. package/dist/events/constraints/UniqueOptions.js +4 -0
  64. package/dist/events/constraints/UniqueOptions.js.map +1 -0
  65. package/dist/events/constraints/for_Constraints/when_scoping_to_event_sequences/given/registered_constraints.d.ts +9 -0
  66. package/dist/events/constraints/for_Constraints/when_scoping_to_event_sequences/given/registered_constraints.d.ts.map +1 -0
  67. package/dist/events/constraints/for_Constraints/when_scoping_to_event_sequences/given/registered_constraints.js +22 -0
  68. package/dist/events/constraints/for_Constraints/when_scoping_to_event_sequences/given/registered_constraints.js.map +1 -0
  69. package/dist/events/constraints/index.d.ts +2 -0
  70. package/dist/events/constraints/index.d.ts.map +1 -1
  71. package/dist/events/constraints/index.js.map +1 -1
  72. package/dist/events/constraints/unique.d.ts +10 -0
  73. package/dist/events/constraints/unique.d.ts.map +1 -1
  74. package/dist/events/constraints/unique.js +11 -10
  75. package/dist/events/constraints/unique.js.map +1 -1
  76. package/dist/events/index.d.ts +3 -0
  77. package/dist/events/index.d.ts.map +1 -1
  78. package/dist/events/index.js +3 -0
  79. package/dist/events/index.js.map +1 -1
  80. package/dist/events/mergeNamedTags.d.ts +13 -0
  81. package/dist/events/mergeNamedTags.d.ts.map +1 -0
  82. package/dist/events/mergeNamedTags.js +39 -0
  83. package/dist/events/mergeNamedTags.js.map +1 -0
  84. package/dist/events/toClientEventContext.d.ts.map +1 -1
  85. package/dist/events/toClientEventContext.js +3 -1
  86. package/dist/events/toClientEventContext.js.map +1 -1
  87. package/dist/projections/eventContextPropertyExpression.d.ts.map +1 -1
  88. package/dist/projections/eventContextPropertyExpression.js +2 -1
  89. package/dist/projections/eventContextPropertyExpression.js.map +1 -1
  90. package/dist/testing/EventScenario.d.ts.map +1 -1
  91. package/dist/testing/EventScenario.js +8 -3
  92. package/dist/testing/EventScenario.js.map +1 -1
  93. package/dist/testing/InProcessConstraints.d.ts +4 -1
  94. package/dist/testing/InProcessConstraints.d.ts.map +1 -1
  95. package/dist/testing/InProcessConstraints.js +5 -1
  96. package/dist/testing/InProcessConstraints.js.map +1 -1
  97. package/dist/testing/InProcessEventSequence.d.ts.map +1 -1
  98. package/dist/testing/InProcessEventSequence.js +19 -8
  99. package/dist/testing/InProcessEventSequence.js.map +1 -1
  100. package/dist/testing/ReactorScenario.d.ts.map +1 -1
  101. package/dist/testing/ReactorScenario.js +6 -0
  102. package/dist/testing/ReactorScenario.js.map +1 -1
  103. package/dist/testing/singleAppendRoute.d.ts +5 -0
  104. package/dist/testing/singleAppendRoute.d.ts.map +1 -1
  105. package/dist/testing/singleAppendRoute.js +12 -1
  106. package/dist/testing/singleAppendRoute.js.map +1 -1
  107. package/dist/transactions/ConflictingConcurrencyScopesInUnitOfWork.d.ts +14 -0
  108. package/dist/transactions/ConflictingConcurrencyScopesInUnitOfWork.d.ts.map +1 -0
  109. package/dist/transactions/ConflictingConcurrencyScopesInUnitOfWork.js +20 -0
  110. package/dist/transactions/ConflictingConcurrencyScopesInUnitOfWork.js.map +1 -0
  111. package/dist/transactions/IUnitOfWork.d.ts +5 -3
  112. package/dist/transactions/IUnitOfWork.d.ts.map +1 -1
  113. package/dist/transactions/TransactionalAppendOptions.d.ts +35 -0
  114. package/dist/transactions/TransactionalAppendOptions.d.ts.map +1 -0
  115. package/dist/transactions/TransactionalAppendOptions.js +4 -0
  116. package/dist/transactions/TransactionalAppendOptions.js.map +1 -0
  117. package/dist/transactions/UnitOfWork.d.ts +3 -2
  118. package/dist/transactions/UnitOfWork.d.ts.map +1 -1
  119. package/dist/transactions/UnitOfWork.js +32 -11
  120. package/dist/transactions/UnitOfWork.js.map +1 -1
  121. package/dist/transactions/concurrencyScopesAreEqual.d.ts +9 -0
  122. package/dist/transactions/concurrencyScopesAreEqual.d.ts.map +1 -0
  123. package/dist/transactions/concurrencyScopesAreEqual.js +19 -0
  124. package/dist/transactions/concurrencyScopesAreEqual.js.map +1 -0
  125. package/dist/transactions/for_UnitOfWork/given/a_unit_of_work_with_a_recording_store.d.ts +26 -0
  126. package/dist/transactions/for_UnitOfWork/given/a_unit_of_work_with_a_recording_store.d.ts.map +1 -0
  127. package/dist/transactions/for_UnitOfWork/given/a_unit_of_work_with_a_recording_store.js +31 -0
  128. package/dist/transactions/for_UnitOfWork/given/a_unit_of_work_with_a_recording_store.js.map +1 -0
  129. package/dist/transactions/index.d.ts +2 -0
  130. package/dist/transactions/index.d.ts.map +1 -1
  131. package/dist/transactions/index.js +1 -0
  132. package/dist/transactions/index.js.map +1 -1
  133. package/dist/transactions/toEventForEventSourceId.d.ts +13 -0
  134. package/dist/transactions/toEventForEventSourceId.d.ts.map +1 -0
  135. package/dist/transactions/toEventForEventSourceId.js +29 -0
  136. package/dist/transactions/toEventForEventSourceId.js.map +1 -0
  137. package/dist/tsconfig.tsbuildinfo +1 -1
  138. package/eventSequences/AppendOptions.ts +11 -0
  139. package/eventSequences/EventForEventSourceId.ts +7 -0
  140. package/eventSequences/EventSequence.ts +30 -8
  141. package/eventSequences/ITransactionalEventSequence.ts +5 -5
  142. package/eventSequences/NamedTagsWithRegisteredEventSourceNotSupported.ts +12 -0
  143. package/eventSequences/TransactionalEventSequence.ts +8 -5
  144. package/eventSequences/createAppendNotification.ts +4 -2
  145. package/eventSequences/ensureNamedTagBatchIsSupported.ts +11 -0
  146. package/eventSequences/for_EventSequence/against_a_kernel/when_appending_named_tags.integration.spec.ts +107 -0
  147. package/eventSequences/for_EventSequence/when_appending_named_tags/given.fixture.ts +38 -0
  148. package/eventSequences/for_EventSequence/when_appending_named_tags/with_a_batch.spec.ts +49 -0
  149. package/eventSequences/for_EventSequence/when_appending_named_tags/with_a_single_event.spec.ts +47 -0
  150. package/eventSequences/for_EventSequence/when_appending_named_tags/with_an_invalid_tag.spec.ts +36 -0
  151. package/eventSequences/for_EventSequence/when_appending_named_tags/with_registered_sources.spec.ts +74 -0
  152. package/eventSequences/for_TransactionalEventSequence/when_appending_many_with_named_tags.spec.ts +41 -0
  153. package/eventSequences/for_TransactionalEventSequence/when_appending_many_with_options.spec.ts +29 -0
  154. package/eventSequences/index.ts +1 -0
  155. package/eventSequences/prepareBatchAppend.ts +4 -1
  156. package/eventSequences/prepareSingleAppend.ts +3 -1
  157. package/events/EventContext.ts +8 -0
  158. package/events/InvalidNamedTag.ts +13 -0
  159. package/events/NamedTag.ts +44 -0
  160. package/events/constraints/ConstraintBuilder.ts +16 -0
  161. package/events/constraints/ConstraintEventSequences.ts +41 -0
  162. package/events/constraints/Constraints.ts +22 -3
  163. package/events/constraints/IConstraintBuilder.ts +20 -0
  164. package/events/constraints/UniqueOptions.ts +20 -0
  165. package/events/constraints/for_Constraints/against_a_kernel/when_appending_to_event_sequences_a_constraint_is_scoped_to.integration.spec.ts +118 -0
  166. package/events/constraints/for_Constraints/when_scoping_to_event_sequences/given/registered_constraints.ts +26 -0
  167. package/events/constraints/for_Constraints/when_scoping_to_event_sequences/with_fluent_builder.spec.ts +40 -0
  168. package/events/constraints/for_Constraints/when_scoping_to_event_sequences/with_legacy_decorators.legacy.spec.ts +47 -0
  169. package/events/constraints/for_Constraints/when_scoping_to_event_sequences/with_merged_declarations.spec.ts +36 -0
  170. package/events/constraints/for_Constraints/when_scoping_to_event_sequences/with_standard_decorators.standard.spec.ts +46 -0
  171. package/events/constraints/index.ts +2 -0
  172. package/events/constraints/unique.ts +22 -2
  173. package/events/for_NamedTag/when_constructing/with_invalid_values.spec.ts +17 -0
  174. package/events/for_NamedTag/when_constructing/with_valid_values.spec.ts +19 -0
  175. package/events/for_mergeNamedTags/when_merging/with_event_and_call_tags.spec.ts +31 -0
  176. package/events/for_mergeNamedTags/when_merging/with_invalid_entries.spec.ts +17 -0
  177. package/events/for_toClientEventContext/when_converting_named_tags.spec.ts +31 -0
  178. package/events/index.ts +3 -0
  179. package/events/mergeNamedTags.ts +37 -0
  180. package/events/toClientEventContext.ts +3 -1
  181. package/package.json +6 -6
  182. package/projections/eventContextPropertyExpression.ts +3 -2
  183. package/testing/EventScenario.fixtures.spec.ts +1 -1
  184. package/testing/EventScenario.ts +10 -4
  185. package/testing/InProcessConstraints.ts +5 -1
  186. package/testing/InProcessEventSequence.ts +19 -8
  187. package/testing/ReactorScenario.ts +6 -0
  188. package/testing/for_EventScenario/when_appending_event_sequence_constraints/event_sequence_scenario_behaviors.fixture.ts +101 -0
  189. package/testing/for_EventScenario/when_appending_event_sequence_constraints/other_sequence_extended_key.legacy.spec.ts +28 -0
  190. package/testing/for_EventScenario/when_appending_event_sequence_constraints/other_sequence_extended_key.standard.spec.ts +27 -0
  191. package/testing/for_EventScenario/when_appending_event_sequence_constraints/other_sequence_extended_key_behaviors.fixture.ts +40 -0
  192. package/testing/for_EventScenario/when_appending_event_sequence_constraints/with_legacy_decorators.legacy.spec.ts +55 -0
  193. package/testing/for_EventScenario/when_appending_event_sequence_constraints/with_standard_decorators.standard.spec.ts +54 -0
  194. package/testing/for_EventScenario/when_appending_named_tags/with_named_tags.spec.ts +48 -0
  195. package/testing/for_ReactorScenario/when_recording_side_effects/with_named_tags.spec.ts +119 -0
  196. package/testing/for_ReadModelScenario/when_seeding_with_options/with_named_tags.spec.ts +35 -0
  197. package/testing/singleAppendRoute.ts +13 -1
  198. package/transactions/ConflictingConcurrencyScopesInUnitOfWork.ts +19 -0
  199. package/transactions/IUnitOfWork.ts +5 -3
  200. package/transactions/TransactionalAppendOptions.ts +45 -0
  201. package/transactions/UnitOfWork.ts +37 -12
  202. package/transactions/concurrencyScopesAreEqual.ts +23 -0
  203. package/transactions/for_UnitOfWork/against_a_kernel/when_committing_with_append_metadata.integration.spec.ts +70 -0
  204. package/transactions/for_UnitOfWork/given/a_unit_of_work_with_a_recording_store.ts +54 -0
  205. package/transactions/for_UnitOfWork/when_adding_events_with_concurrency_scopes/and_the_event_type_filters_are_equivalent.spec.ts +32 -0
  206. package/transactions/for_UnitOfWork/when_adding_events_with_concurrency_scopes/and_the_event_type_filters_differ.spec.ts +40 -0
  207. package/transactions/for_UnitOfWork/when_adding_events_with_concurrency_scopes/and_the_scopes_are_equal_or_omitted.spec.ts +29 -0
  208. package/transactions/for_UnitOfWork/when_adding_events_with_concurrency_scopes/and_the_scopes_differ_for_one_event_source.spec.ts +29 -0
  209. package/transactions/for_UnitOfWork/when_committing_events_with_append_metadata/and_a_later_event_sequence_fails.spec.ts +30 -0
  210. package/transactions/for_UnitOfWork/when_committing_events_with_append_metadata/and_events_span_event_sequences.spec.ts +34 -0
  211. package/transactions/for_UnitOfWork/when_committing_events_with_append_metadata/and_options_differ_per_event.spec.ts +45 -0
  212. package/transactions/for_UnitOfWork/when_committing_events_with_append_metadata/and_the_append_is_rejected.spec.ts +26 -0
  213. package/transactions/for_UnitOfWork/when_committing_events_with_named_tags.spec.ts +112 -0
  214. package/transactions/for_UnitOfWork/when_rolling_back_events_with_append_metadata.spec.ts +24 -0
  215. package/transactions/index.ts +2 -0
  216. package/transactions/toEventForEventSourceId.ts +32 -0
  217. package/vitest.integration.config.ts +2 -0
  218. package/webhooks/for_Webhooks/against_a_kernel/given/ReceivedWebhookRequest.fixture.ts +21 -0
  219. package/webhooks/for_Webhooks/against_a_kernel/given/WebhookReceiver.fixture.ts +99 -0
  220. package/webhooks/for_Webhooks/against_a_kernel/when_delivering_events_to_a_failing_webhook.integration.spec.ts +101 -0
  221. package/webhooks/for_Webhooks/against_a_kernel/when_delivering_events_to_a_webhook.integration.spec.ts +130 -0
  222. package/webhooks/for_Webhooks/against_a_kernel/when_registering_a_webhook_that_is_not_replayable_and_not_active.integration.spec.ts +101 -0
  223. package/webhooks/for_Webhooks/when_registering_a_webhook_that_is_not_replayable_and_not_active.spec.ts +43 -0
@@ -1 +1 @@
1
- {"version":3,"file":"prepareSingleAppend.d.ts","sourceRoot":"","sources":["../../eventSequences/prepareSingleAppend.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,IAAI,EAAkB,MAAM,sBAAsB,CAAC;AAQ5D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAExD,oGAAoG;AACpG,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,aAAa;;;;;;;;EAYzE"}
1
+ {"version":3,"file":"prepareSingleAppend.d.ts","sourceRoot":"","sources":["../../eventSequences/prepareSingleAppend.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,IAAI,EAAkB,MAAM,sBAAsB,CAAC;AAS5D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAExD,oGAAoG;AACpG,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,aAAa;;;;;;;;;EAazE"}
@@ -4,6 +4,7 @@ import { Guid, JsonSerializer } from '@cratis/fundamentals';
4
4
  import { getEventTypeFor } from '../events/eventTypeDecorator.js';
5
5
  import { getTagsFor } from '../events/tagDecorator.js';
6
6
  import { mergeTags } from '../events/mergeTags.js';
7
+ import { mergeNamedTags } from '../events/mergeNamedTags.js';
7
8
  import { identityProvider } from '../identity/index.js';
8
9
  import { causationManager, CausationType } from '../auditing/index.js';
9
10
  import { correlationIdManager } from '../correlation/index.js';
@@ -17,8 +18,9 @@ export function prepareSingleAppend(event, options) {
17
18
  const subject = options?.subject ?? resolveEventSubject(event);
18
19
  const content = JsonSerializer.serialize(event);
19
20
  const tags = mergeTags(getTagsFor(event.constructor), options?.tags);
21
+ const namedTags = mergeNamedTags(options?.namedTags);
20
22
  const causationChain = causationManager.run(CausationType.appendEvent, { eventType: eventType.id.value }, () => causationManager.getCurrentChain());
21
23
  const identity = identityProvider.getCurrent();
22
- return { eventType, correlationId, content, tags, causationChain, identity, subject };
24
+ return { eventType, correlationId, content, tags, namedTags, causationChain, identity, subject };
23
25
  }
24
26
  //# sourceMappingURL=prepareSingleAppend.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"prepareSingleAppend.js","sourceRoot":"","sources":["../../eventSequences/prepare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AO,IAAI,mBAAmB,CAAC,KAAK,CAAC,CAAC;IAC/D,MAAM,OAAO,GAAG,cAAc,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;IAChD,MAAM,IAAI,GAAG,SAAS,CAAC,UAAU,CAAC,KAAK,CAAC,WAAuB,CAAC,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC;IACjF,MAAM,SAAS,GAAG,cAAc,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;IACrD,MAAM,cAAc,GAAG,gBAAgB,CAAC,GAAG,CAAC,aAAa,CAAC,WAAW,EAAE,EAAE,SAAS,EAAE,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,EACpG,GAAG,EAAE,CAAC,gBAAgB,CAAC,eAAe,EAAE,CAAC,CAAC;IAC9C,MAAM,QAAQ,GAAG,gBAAgB,CAAC,UAAU,EAAE,CAAC;IAC/C,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,cAAc,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC;AACrG,CAAC"}
@@ -1,6 +1,7 @@
1
1
  import { EventType } from './EventType.js';
2
2
  import { CausationEntry } from './CausationEntry.js';
3
3
  import { Tag } from './Tag.js';
4
+ import type { NamedTag } from './NamedTag.js';
4
5
  import type { Identity } from '../identity/Identity.js';
5
6
  /**
6
7
  * Represents contextual information about an appended event.
@@ -43,5 +44,11 @@ export interface EventContext {
43
44
  readonly causation: ReadonlyArray<CausationEntry>;
44
45
  /** The tags the event carries. */
45
46
  readonly tags: ReadonlyArray<Tag>;
47
+ /**
48
+ * The structured named tags the event carries, in the order the kernel stored them.
49
+ * Always present on events read from or delivered by the kernel (empty when the event has none);
50
+ * optional so that contexts constructed by hand remain valid.
51
+ */
52
+ readonly namedTags?: ReadonlyArray<NamedTag>;
46
53
  }
47
54
  //# sourceMappingURL=EventContext.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"EventContext.d.ts","sourceRoot":"","sources":["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AC;IAE7B,qDAAqD;IACrD,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAEnC,6BAA6B;IAC7B,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAC;IAE9B,6CAA6C;IAC7C,QAAQ,CAAC,QAAQ,EAAE,IAAI,CAAC;IAExB,gDAAgD;IAChD,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAE/B,yCAAyC;IACzC,QAAQ,CAAC,SAAS,EAAE,aAAa,CAAC,cAAc,CAAC,CAAC;IAElD,kCAAkC;IAClC,QAAQ,CAAC,IAAI,EAAE,aAAa,CAAC,GAAG,CAAC,CAAC;IAElC;;;;OAIG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,aAAa,CAAC,QAAQ,CAAC,CAAC;CAChD"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * The error that is thrown when a named tag has a blank name or a non-string value, or a named tag
3
+ * collection contains an entry that is not a named tag. Mirrors the .NET client's `InvalidNamedTag`.
4
+ */
5
+ export declare class InvalidNamedTag extends Error {
6
+ constructor();
7
+ }
8
+ //# sourceMappingURL=InvalidNamedTag.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InvalidNamedTag.d.ts","sourceRoot":"","sources":["../../events/InvalidNamedTag.ts"],"names":[],"mappings":"AAGA;;;GAGG;AACH,qBAAa,eAAgB,SAAQ,KAAK;IACtC,cAGC;CACJ"}
@@ -0,0 +1,13 @@
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
+ * The error that is thrown when a named tag has a blank name or a non-string value, or a named tag
5
+ * collection contains an entry that is not a named tag. Mirrors the .NET client's `InvalidNamedTag`.
6
+ */
7
+ export class InvalidNamedTag extends Error {
8
+ constructor() {
9
+ super('Named tags require a nonblank name and a non-null value; named tag collections cannot contain null elements.');
10
+ this.name = 'InvalidNamedTag';
11
+ }
12
+ }
13
+ //# sourceMappingURL=InvalidNamedTag.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InvalidNamedTag.js","sourceRoot":"","sources":["../../events/InvalidNamedTag.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,qGAAqG;AAErG;;;GAGG;AACH,MAAM,OAAO,eAAgB,SAAQ,KAAK;IACtC;QACI,KAAK,CAAC,8GAA8G,CAAC,CAAC;QACtH,IAAI,CAAC,IAAI,GAAG,iBAAiB,CAAC;IAClC,CAAC;CACJ"}
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Associates a name with an exact, opaque event tag value. Names and values are compared exactly
3
+ * (ordinal and case-sensitive); one name may carry several values on the same event.
4
+ * Mirrors the .NET client's `NamedTag`.
5
+ */
6
+ export declare class NamedTag {
7
+ /** The name of the tag. Never blank. */
8
+ readonly name: string;
9
+ /** The exact, opaque value of the tag. May be empty. */
10
+ readonly value: string;
11
+ /**
12
+ * Initializes a new instance of {@link NamedTag}.
13
+ * @param name - The name. Must be a nonblank string.
14
+ * @param value - The opaque value. Must be a string; the empty string is allowed.
15
+ * @throws {@link InvalidNamedTag} when the name is blank or not a string, or the value is not a string.
16
+ */
17
+ constructor(name: string, value: string);
18
+ /**
19
+ * Determines whether this tag has the same name and value as another, compared exactly.
20
+ * @param other - The tag to compare with.
21
+ * @returns True when both name and value are equal.
22
+ */
23
+ equals(other: NamedTag): boolean;
24
+ }
25
+ //# sourceMappingURL=NamedTag.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NamedTag.d.ts","sourceRoot":"","sources":["../../events/NamedTag.ts"],"names":[],"mappings":"AAQA;;;;GAIG;AACH,qBAAa,QAAQ;IACjB,wCAAwC;IACxC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAEtB,wDAAwD;IACxD,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IAEvB;;;;;OAKG;IACH,YAAY,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAOtC;IAED;;;;OAIG;IACH,MAAM,CAAC,KAAK,EAAE,QAAQ,GAAG,OAAO,CAE/B;CACJ"}
@@ -0,0 +1,39 @@
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 { InvalidNamedTag } from './InvalidNamedTag.js';
4
+ // Matches .NET string.IsNullOrWhiteSpace, which also treats U+0085 and other Unicode white space as blank.
5
+ const blank = /^\p{White_Space}*$/u;
6
+ /**
7
+ * Associates a name with an exact, opaque event tag value. Names and values are compared exactly
8
+ * (ordinal and case-sensitive); one name may carry several values on the same event.
9
+ * Mirrors the .NET client's `NamedTag`.
10
+ */
11
+ export class NamedTag {
12
+ /** The name of the tag. Never blank. */
13
+ name;
14
+ /** The exact, opaque value of the tag. May be empty. */
15
+ value;
16
+ /**
17
+ * Initializes a new instance of {@link NamedTag}.
18
+ * @param name - The name. Must be a nonblank string.
19
+ * @param value - The opaque value. Must be a string; the empty string is allowed.
20
+ * @throws {@link InvalidNamedTag} when the name is blank or not a string, or the value is not a string.
21
+ */
22
+ constructor(name, value) {
23
+ if (typeof name !== 'string' || blank.test(name) || typeof value !== 'string') {
24
+ throw new InvalidNamedTag();
25
+ }
26
+ this.name = name;
27
+ this.value = value;
28
+ Object.freeze(this);
29
+ }
30
+ /**
31
+ * Determines whether this tag has the same name and value as another, compared exactly.
32
+ * @param other - The tag to compare with.
33
+ * @returns True when both name and value are equal.
34
+ */
35
+ equals(other) {
36
+ return other instanceof NamedTag && other.name === this.name && other.value === this.value;
37
+ }
38
+ }
39
+ //# sourceMappingURL=NamedTag.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NamedTag.js","sourceRoot":"","sources":["../../events/NamedTag.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,qGAAqG;AAErG,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAEvD,2GAA2G;AAC3G,MAAM,KAAK,GAAG,qBAAqB,CAAC;AAEpC;;;;GAIG;AACH,MAAM,OAAO,QAAQ;IACjB,wCAAwC;IAC/B,IAAI,CAAS;IAEtB,wDAAwD;IAC/C,KAAK,CAAS;IAEvB;;;;;OAKG;IACH,YAAY,IAAY,EAAE,KAAa;QACnC,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;YAC5E,MAAM,IAAI,eAAe,EAAE,CAAC;QAChC,CAAC;QACD,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IACxB,CAAC;IAED;;;;OAIG;IACH,MAAM,CAAC,KAAe;QAClB,OAAO,KAAK,YAAY,QAAQ,IAAI,KAAK,CAAC,IAAI,KAAK,IAAI,CAAC,IAAI,IAAI,KAAK,CAAC,KAAK,KAAK,IAAI,CAAC,KAAK,CAAC;IAC/F,CAAC;CACJ"}
@@ -1,3 +1,4 @@
1
+ import { ConstraintEventSequence } from './ConstraintEventSequences.js';
1
2
  import { IConstraintBuilder } from './IConstraintBuilder.js';
2
3
  import { IUniqueConstraintBuilder } from './IUniqueConstraintBuilder.js';
3
4
  import { UniqueConstraintCapture } from './UniqueConstraintBuilder.js';
@@ -21,6 +22,8 @@ export interface ConstraintCapture {
21
22
  scope: ConstraintScopeCapture;
22
23
  uniqueConstraint?: UniqueConstraintCapture;
23
24
  uniqueEventType?: UniqueEventTypeCapture;
25
+ /** Identifiers of the event sequences the constraint applies to; empty or omitted means every event sequence. */
26
+ eventSequences?: string[];
24
27
  }
25
28
  /**
26
29
  * Implements {@link IConstraintBuilder}, capturing the constraint definition
@@ -37,6 +40,10 @@ export declare class ConstraintBuilder implements IConstraintBuilder {
37
40
  /** @inheritdoc */
38
41
  perEventStreamId(): IConstraintBuilder;
39
42
  /** @inheritdoc */
43
+ forEventSequences(...eventSequenceIds: ConstraintEventSequence[]): IConstraintBuilder;
44
+ /** @inheritdoc */
45
+ forEventLog(): IConstraintBuilder;
46
+ /** @inheritdoc */
40
47
  unique(callback: (builder: IUniqueConstraintBuilder) => void): IConstraintBuilder;
41
48
  /** @inheritdoc */
42
49
  uniqueFor(eventType: Function, message?: string, name?: string): IConstraintBuilder;
@@ -1 +1 @@
1
- {"version":3,"file":"ConstraintBuilder.d.ts","sourceRoot":"","sources":["../../../events/constraints/ConstraintBuilder.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AACzE,OAAO,EAA2B,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AAEhG,sDAAsD;AACtD,MAAM,WAAW,sBAAsB;IACnC,kBAAkB,EAAE,OAAO,CAAC;IAC5B,kBAAkB,EAAE,OAAO,CAAC;IAC5B,gBAAgB,EAAE,OAAO,CAAC;CAC7B;AAED,4EAA4E;AAC5E,MAAM,WAAW,sBAAsB;IACnC,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,uBAAuB,CAAC,EAAE,MAAM,EAAE,CAAC;IACnC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,+DAA+D;AAC/D,MAAM,WAAW,iBAAiB;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,sBAAsB,CAAC;IAC9B,gBAAgB,CAAC,EAAE,uBAAuB,CAAC;IAC3C,eAAe,CAAC,EAAE,sBAAsB,CAAC;CAC5C;AAED;;;GAGG;AACH,qBAAa,iBAAkB,YAAW,kBAAkB;IACxD,QAAQ,CAAC,OAAO,EAAE,iBAAiB,CAAC;IACpC,OAAO,CAAC,cAAc,CAAC,CAA0B;IAEjD,YAAY,IAAI,EAAE,MAAM,EAKvB;IAED,kBAAkB;IAClB,kBAAkB,I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sB,CAAC;IACzC,iHAAiH;IACjH,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;CAC7B;AAED;;;GAGG;AACH,qBAAa,iBAAkB,YAAW,kBAAkB;IACxD,QAAQ,CAAC,OAAO,EAAE,iBAAiB,CAAC;IACpC,OAAO,CAAC,cAAc,CAAC,CAA0B;IAEjD,YAAY,IAAI,EAAE,MAAM,EAKvB;IAED,kBAAkB;IAClB,kBAAkB,IAAI,kBAAkB,CAGvC;IAED,kBAAkB;IAClB,kBAAkB,IAAI,kBAAkB,CAGvC;IAED,kBAAkB;IAClB,gBAAgB,IAAI,kBAAkB,CAGrC;IAED,kBAAkB;IAClB,iBAAiB,CAAC,GAAG,gBAAgB,EAAE,uBAAuB,EAAE,GAAG,kBAAkB,CAIpF;IAED,kBAAkB;IAClB,WAAW,IAAI,kBAAkB,CAEhC;IAED,kBAAkB;IAClB,MAAM,CAAC,QAAQ,EAAE,CAAC,OAAO,EAAE,wBAAwB,KAAK,IAAI,GAAG,kBAAkB,CAShF;IAED,kBAAkB;IAClB,SAAS,CAAC,SAAS,EAAE,QAAQ,EAAE,OAAO,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,kBAAkB,CAQlF;CACJ"}
@@ -1,6 +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 { getEventTypeFor } from '../eventTypeDecorator.js';
4
+ import { EventSequenceId } from '../../eventSequences/EventSequenceId.js';
5
+ import { normalizeConstraintEventSequences } from './ConstraintEventSequences.js';
4
6
  import { UniqueConstraintBuilder } from './UniqueConstraintBuilder.js';
5
7
  /**
6
8
  * Implements {@link IConstraintBuilder}, capturing the constraint definition
@@ -31,6 +33,17 @@ export class ConstraintBuilder {
31
33
  return this;
32
34
  }
33
35
  /** @inheritdoc */
36
+ forEventSequences(...eventSequenceIds) {
37
+ const eventSequences = normalizeConstraintEventSequences([...(this.capture.eventSequences ?? []), ...eventSequenceIds]);
38
+ if (eventSequences.length > 0)
39
+ this.capture.eventSequences = eventSequences;
40
+ return this;
41
+ }
42
+ /** @inheritdoc */
43
+ forEventLog() {
44
+ return this.forEventSequences(EventSequenceId.eventLog);
45
+ }
46
+ /** @inheritdoc */
34
47
  unique(callback) {
35
48
  const uniqueCapture = {
36
49
  eventDefinitions: [],
@@ -1 +1 @@
1
- {"version":3,"file":"ConstraintBuilder.js","sourceRoot":"","sources":["../../../events/constraints/ConstraintBuilder.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,qGAAqG;AAErG,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAG3D,OAAO,EAAE,uBAAuB,EAA2B,MAAM,8BAA8B,CAAC;AA0BhG;;;GAGG;AACH,MAAM,OAAO,iBAAiB;IACjB,OAAO,CAAoB;IAC5B,cAAc,CAA2B;IAEjD,YAAY,IAAY;QACpB,IAAI,CAAC,OAAO,GAAG;YACX,IAAI;YACJ,KAAK,EAAE,EAAE,kBAAkB,EAAE,KAAK,EAAE,kBAAkB,EAAE,KAAK,EAAE,gBAAgB,EAAE,KAAK,EAAE;SAC3F,CAAC;IACN,CAAC;IAED,kBAAkB;IAClB,kBAAkB;QACd,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,kBAAkB,GAAG,IAAI,CAAC;QAC7C,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,kBAAkB;IAClB,kBAAkB;QACd,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,kBAAkB,GAAG,IAAI,CAAC;QAC7C,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,kBAAkB;IAClB,gBAAgB;QACZ,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,gBAAgB,GAAG,IAAI,CAAC;QAC3C,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,kBAAkB;IAClB,MAAM,CAAC,QAAqD;QACxD,MAAM,aAAa,GAA4B;YAC3C,gBAAgB,EAAE,EAAE;YACpB,Y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3B,WAAW,EAAE,EAAE,CAAC,EAAE,CAAC,KAAK;YACxB,OAAO;YACP,IAAI;SACP,CAAC;QACF,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ"}
@@ -0,0 +1,19 @@
1
+ import { EventSequenceId } from '../../eventSequences/EventSequenceId.js';
2
+ /** An event sequence a constraint can be scoped to, by identifier or by its string value. */
3
+ export type ConstraintEventSequence = EventSequenceId | string;
4
+ /**
5
+ * Normalizes declared event sequences to distinct, nonblank identifier values in declaration order.
6
+ * @param eventSequences - The declared event sequences.
7
+ * @returns The normalized identifier values.
8
+ */
9
+ export declare function normalizeConstraintEventSequences(eventSequences: readonly ConstraintEventSequence[]): string[];
10
+ /**
11
+ * Combines the event sequences declared for one constraint in more than one place.
12
+ * An empty declaration means every event sequence and wins: combining never narrows a constraint that
13
+ * one declaration applies everywhere. Otherwise the result is the distinct union in declaration order.
14
+ * Mirrors ConstraintEventSequences.Combine in the .NET client.
15
+ * @param declarations - The declarations to combine; undefined or empty means every event sequence.
16
+ * @returns The combined declaration, empty for every event sequence.
17
+ */
18
+ export declare function combineConstraintEventSequences(declarations: ReadonlyArray<readonly string[] | undefined>): string[];
19
+ //# sourceMappingURL=ConstraintEventSequences.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ConstraintEventSequences.d.ts","sourceRoot":"","sources":["../../../events/constraints/ConstraintEventSequences.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,eAAe,EAAE,MAAM,yCAAyC,CAAC;AAE1E,6FAA6F;AAC7F,MAAM,MAAM,uBAAuB,GAAG,eAAe,GAAG,MAAM,CAAC;AAE/D;;;;GAIG;AACH,wBAAgB,iCAAiC,CAAC,cAAc,EAAE,SAAS,uBAAuB,EAAE,GAAG,MAAM,EAAE,CAQ9G;AAED;;;;;;;GAOG;AACH,wBAAgB,+BAA+B,CAAC,YAAY,EAAE,aAAa,CAAC,SAAS,MAAM,EAAE,GAAG,SAAS,CAAC,GAAG,MAAM,EAAE,CASpH"}
@@ -0,0 +1,39 @@
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 { EventSequenceId } from '../../eventSequences/EventSequenceId.js';
4
+ /**
5
+ * Normalizes declared event sequences to distinct, nonblank identifier values in declaration order.
6
+ * @param eventSequences - The declared event sequences.
7
+ * @returns The normalized identifier values.
8
+ */
9
+ export function normalizeConstraintEventSequences(eventSequences) {
10
+ const values = [];
11
+ for (const eventSequence of eventSequences) {
12
+ const value = eventSequence instanceof EventSequenceId ? eventSequence.value : eventSequence;
13
+ if (typeof value !== 'string' || value.trim().length === 0 || values.includes(value))
14
+ continue;
15
+ values.push(value);
16
+ }
17
+ return values;
18
+ }
19
+ /**
20
+ * Combines the event sequences declared for one constraint in more than one place.
21
+ * An empty declaration means every event sequence and wins: combining never narrows a constraint that
22
+ * one declaration applies everywhere. Otherwise the result is the distinct union in declaration order.
23
+ * Mirrors ConstraintEventSequences.Combine in the .NET client.
24
+ * @param declarations - The declarations to combine; undefined or empty means every event sequence.
25
+ * @returns The combined declaration, empty for every event sequence.
26
+ */
27
+ export function combineConstraintEventSequences(declarations) {
28
+ if (declarations.length === 0 || declarations.some(declaration => !declaration || declaration.length === 0))
29
+ return [];
30
+ const combined = [];
31
+ for (const declaration of declarations) {
32
+ for (const value of declaration) {
33
+ if (!combined.includes(value))
34
+ combined.push(value);
35
+ }
36
+ }
37
+ return combined;
38
+ }
39
+ //# sourceMappingURL=ConstraintEventSequences.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ConstraintEventSequences.js","sourceRoot":"","sources":["../../../events/constraints/ConstraintEventSequences.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,qGAAqG;AAErG,OAAO,EAAE,eAAe,EAAE,MAAM,yCAAyC,CAAC;AAK1E;;;;GAIG;AACH,MAAM,UAAU,iCAAiC,CAAC,cAAkD;IAChG,MAAM,MAAM,GAAa,EAAE,CAAC;IAC5B,KAAK,MAAM,aAAa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AE,MAAM,2BAA2B,CAAC;AACrE,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAqB,iBAAiB,EAA0B,MAAM,wBAAwB,CAAC;AAmCtG,wFAAwF;AACxF,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,IAAI,CAAC,wBAAwB,EAAE,YAAY,GAAG,aAAa,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE,iBAAiB,CAAC,CA+GzI;AAED,oFAAoF;AACpF,wBAAgB,wBAAwB,CAAC,QAAQ,EAAE,WAAW,CAAC,MAAM,EAAE,iBAAiB,CAAC,EAAE,SAAS,EAAE,mBAAmB,GAAG,mBAAmB,CAS9I;AAED,mFAAmF;AACnF,qBAAa,WAAY,YAAW,YAAY;IAUxC,OAAO,CAAC,QAAQ,CAAC,WAAW;IAC5B,OAAO,CAAC,QAAQ,CAAC,WAAW;IAC5B,OAAO,CAAC,QAAQ,CAAC,gBAAgB;IAXrC,OAAO,CAAC,SAAS,CAAwC;IAEzD;;;;;OAKG;IACH,YACqB,WAAW,EAAE,MAAM,EACnB,WAAW,EAAE,mBAAmB,EAChC,gBAAgB,EAAE,wBAAwB,EAC3D;IAEJ,kBAAkB;IACZ,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC,CAE9B;IAED,kBAAkB;IACZ,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC,CA2E9B;IAED,kBAAkB;IAClB,MAAM,CAAC,EAAE,EAAE,YAAY,GAAG,OAAO,CAEhC;IAED;;;;OAIG;IACH,iBAAiB,CAAC,SAAS,EAAE,mBAAmB,GAAG,mBAAmB,CAErE;CACJ"}
@@ -8,10 +8,19 @@ import { getUniqueEventMetadata, getUniquePropertyMetadata } from './unique.js';
8
8
  import { getRemovedConstraintNames } from './removeConstraint.js';
9
9
  import { TypeIntrospector } from '../../types/TypeIntrospector.js';
10
10
  import { getEventTypeFor } from '../eventTypeDecorator.js';
11
+ import { combineConstraintEventSequences } from './ConstraintEventSequences.js';
11
12
  /** Resolves the name registered with the Chronicle Kernel. */
12
13
  function wireNameOf(capture) {
13
14
  return capture.uniqueEventType?.name ?? capture.name;
14
15
  }
16
+ /** Combine another declaration's event sequences into a capture; an empty result means every event sequence. */
17
+ function combineEventSequencesInto(capture, declared) {
18
+ const combined = combineConstraintEventSequences([capture.eventSequences, declared]);
19
+ if (combined.length > 0)
20
+ capture.eventSequences = combined;
21
+ else
22
+ delete capture.eventSequences;
23
+ }
15
24
  const decoratorScope = {
16
25
  perEventSourceType: false,
17
26
  perEventStreamType: false,
@@ -57,6 +66,7 @@ export function compileConstraints(provider) {
57
66
  if (!removedWith.includes(id))
58
67
  removedWith.push(id);
59
68
  }
69
+ combineEventSequencesInto(existing, capture.eventSequences);
60
70
  }
61
71
  else if (existing) {
62
72
  throw new Error(`Duplicate constraint name '${name}'.`);
@@ -81,6 +91,7 @@ export function compileConstraints(provider) {
81
91
  if (!capture) {
82
92
  const builder = new ConstraintBuilder(name);
83
93
  builder.uniqueFor(eventType, eventMetadata.message, name);
94
+ builder.forEventSequences(...(eventMetadata.eventSequences ?? []));
84
95
  capture = builder.capture;
85
96
  captures.set(name, capture);
86
97
  }
@@ -89,6 +100,7 @@ export function compileConstraints(provider) {
89
100
  }
90
101
  else {
91
102
  assertMatchingScope(name, capture.scope, decoratorScope);
103
+ combineEventSequencesInto(capture, eventMetadata.eventSequences);
92
104
  if (eventMetadata.message && !capture.uniqueEventType.message)
93
105
  capture.uniqueEventType.message = eventMetadata.message;
94
106
  capture.uniqueEventType.eventTypeIds ??= [capture.uniqueEventType.eventTypeId];
@@ -106,9 +118,13 @@ export function compileConstraints(provider) {
106
118
  if (!capture) {
107
119
  const builder = new ConstraintBuilder(name);
108
120
  builder.unique(() => { });
121
+ builder.forEventSequences(...(metadata.eventSequences ?? []));
109
122
  capture = builder.capture;
110
123
  captures.set(name, capture);
111
124
  }
125
+ else {
126
+ combineEventSequencesInto(capture, metadata.eventSequences);
127
+ }
112
128
  if (!capture.uniqueConstraint)
113
129
  throw new Error(`Constraint '${name}' is not a unique property constraint.`);
114
130
  assertMatchingScope(name, capture.scope, decoratorScope);
@@ -189,6 +205,8 @@ export class Constraints {
189
205
  EventStreamType: capture.scope.perEventStreamType ? '*' : '',
190
206
  EventStreamId: capture.scope.perEventStreamId ? '*' : ''
191
207
  };
208
+ // Empty means every event sequence, which is what the Kernel assumes when the field is omitted.
209
+ const eventSequences = [...new Set(capture.eventSequences ?? [])];
192
210
  if (capture.uniqueConstraint) {
193
211
  const uc = capture.uniqueConstraint;
194
212
  const removalEventTypeIds = uc.removedWithEventTypeIds ?? [];
@@ -210,7 +228,8 @@ export class Constraints {
210
228
  },
211
229
  Value1: undefined
212
230
  },
213
- Scope: scope
231
+ Scope: scope,
232
+ EventSequences: eventSequences
214
233
  };
215
234
  }
216
235
  if (capture.uniqueEventType) {
@@ -225,7 +244,8 @@ export class Constraints {
225
244
  EventTypeIds: uet.eventTypeIds ?? [uet.eventTypeId]
226
245
  }
227
246
  },
228
- Scope: scope
247
+ Scope: scope,
248
+ EventSequences: eventSequences
229
249
  };
230
250
  }
231
251
  return {
@@ -233,7 +253,8 @@ export class Constraints {
233
253
  Type: ConstraintType.Unknown,
234
254
  RemovedWith: [],
235
255
  Definition: undefined,
236
- Scope: scope
256
+ Scope: scope,
257
+ EventSequences: eventSequences
237
258
  };
238
259
  });
239
260
  if (constraints.length === 0) {
@@ -1 +1 @@
1
- {"version":3,"file":"Constraints.js","sourceRoot":"","sources":["../../../events/constraints/Constraints.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,qGAAqG;AAErG,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAO7D,OAAO,EAAE,iBAAiB,EAA6C,MAAM,wBAAwB,CAAC;AACtG,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,EAAE,qBAAqB,EAAE,M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EAAE,KAAK;gBACZ,cAAc,EAAE,cAAc;aACjC,CAAC;QACN,CAAC,CAAC,CAAC;QAEH,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAC3B,OAAO;QACX,CAAC;QAED,MAAM,IAAI,CAAC,WAAW,CAAC,WAAW,CAAC,QAAQ,CAAC;YACxC,UAAU,EAAE,IAAI,CAAC,WAAW;YAC5B,WAAW,EAAE,WAAW;SAC3B,CAAC,CAAC;IACP,CAAC;IAED,kBAAkB;IAClB,MAAM,CAAC,EAAgB;QACnB,OAAO,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC;IACxC,CAAC;IAED;;;;OAIG;IACH,iBAAiB,CAAC,SAA8B;QAC5C,OAAO,wBAAwB,CAAC,IAAI,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;IAC/D,CAAC;CACJ"}
@@ -1,3 +1,4 @@
1
+ import type { ConstraintEventSequence } from './ConstraintEventSequences.js';
1
2
  import { IUniqueConstraintBuilder } from './IUniqueConstraintBuilder.js';
2
3
  /**
3
4
  * Defines the builder for building constraints.
@@ -19,6 +20,23 @@ export interface IConstraintBuilder {
19
20
  * @returns This builder for fluent chaining.
20
21
  */
21
22
  perEventStreamId(): IConstraintBuilder;
23
+ /**
24
+ * Applies the constraints defined on this builder only to specific event sequences.
25
+ * By default a constraint applies to every event sequence its event types are appended to, and each
26
+ * sequence keeps its own index. The Kernel neither validates nor indexes a constraint for a sequence it does
27
+ * not apply to, so a fact forwarded to another sequence (such as the outbox) does not claim a value there.
28
+ * It applies to every constraint on this builder wherever in the chain it is called; calling it again adds
29
+ * to the event sequences already declared.
30
+ * @param eventSequenceIds - The event sequences the constraints apply to.
31
+ * @returns This builder for fluent chaining.
32
+ */
33
+ forEventSequences(...eventSequenceIds: ConstraintEventSequence[]): IConstraintBuilder;
34
+ /**
35
+ * Applies the constraints defined on this builder only to the event log.
36
+ * Shorthand for {@link IConstraintBuilder.forEventSequences} with `EventSequenceId.eventLog`.
37
+ * @returns This builder for fluent chaining.
38
+ */
39
+ forEventLog(): IConstraintBuilder;
22
40
  /**
23
41
  * Starts building a unique constraint using a fluent builder callback.
24
42
  * @param callback - Callback that configures the unique constraint via {@link IUniqueConstraintBuilder}.
@@ -1 +1 @@
1
- {"version":3,"file":"IConstraintBuilder.d.ts","sourceRoot":"","sources":["../../../events/constraints/IConstraintBuilder.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AAEzE;;;GAGG;AACH,MAAM,WAAW,kBAAkB;IAC/B;;;OAGG;IACH,kBAAkB,IAAI,kBAAkB,CAAC;IAEzC;;;OAGG;IACH,kBAAkB,IAAI,kBAAkB,CAAC;IAEzC;;;OAGG;IACH,gBAAgB,IAAI,kBAAkB,CAAC;IAEvC;;;;OAIG;IACH,MAAM,CAAC,QAAQ,EAAE,CAAC,OAAO,EAAE,wBAAwB,KAAK,IAAI,GAAG,kBAAkB,CAAC;IAElF;;;;;;OAMG;IACH,SAAS,CAAC,SAAS,EAAE,QAAQ,EAAE,OAAO,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,kBAAkB,CAAC;CACvF"}
1
+ {"version":3,"file":"IConstraintBuilder.d.ts","sourceRoot":"","sources":["../../../events/constraints/IConstraintBuilder.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAAC;AAC7E,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AAEzE;;;GAGG;AACH,MAAM,WAAW,kBAAkB;IAC/B;;;OAGG;IACH,kBAAkB,IAAI,kBAAkB,CAAC;IAEzC;;;OAGG;IACH,kBAAkB,IAAI,kBAAkB,CAAC;IAEzC;;;OAGG;IACH,gBAAgB,IAAI,kBAAkB,CAAC;IAEvC;;;;;;;;;OASG;IACH,iBAAiB,CAAC,GAAG,gBAAgB,EAAE,uBAAuB,EAAE,GAAG,kBAAkB,CAAC;IAEtF;;;;OAIG;IACH,WAAW,IAAI,kBAAkB,CAAC;IAElC;;;;OAIG;IACH,MAAM,CAAC,QAAQ,EAAE,CAAC,OAAO,EAAE,wBAAwB,KAAK,IAAI,GAAG,kBAAkB,CAAC;IAElF;;;;;;OAMG;IACH,SAAS,CAAC,SAAS,EAAE,QAAQ,EAAE,OAAO,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,kBAAkB,CAAC;CACvF"}
@@ -0,0 +1,15 @@
1
+ import type { ConstraintEventSequence } from './ConstraintEventSequences.js';
2
+ /** Options for the {@link unique} decorator. Mirrors the .NET UniqueAttribute. */
3
+ export interface UniqueOptions {
4
+ /** Optional shared constraint name; defaults to the class or property name. */
5
+ name?: string;
6
+ /** Optional fixed violation message. */
7
+ message?: string;
8
+ /**
9
+ * The event sequences the constraint applies to. Empty or omitted means every event sequence.
10
+ * When several declarations share a constraint name, their event sequences are combined, and a
11
+ * declaration naming none keeps the constraint applying to every event sequence.
12
+ */
13
+ eventSequences?: ConstraintEventSequence[];
14
+ }
15
+ //# sourceMappingURL=UniqueOptions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UniqueOptions.d.ts","sourceRoot":"","sources":["../../../events/constraints/UniqueOptions.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAAC;AAE7E,kFAAkF;AAClF,MAAM,WAAW,aAAa;IAC1B,+EAA+E;IAC/E,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd,wCAAwC;IACxC,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;;;OAIG;IACH,cAAc,CAAC,EAAE,uBAAuB,EAAE,CAAC;CAC9C"}
@@ -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=UniqueOptions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UniqueOptions.js","sourceRoot":"","sources":["../../../events/constraints/UniqueOptions.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,qGAAqG"}
@@ -0,0 +1,9 @@
1
+ import type { Constraint } from '@cratis/chronicle.contracts';
2
+ /**
3
+ * Registers the given constraint classes and decorated event types and returns the registered wire definitions by name.
4
+ * @param constraints - The constraint classes.
5
+ * @param eventTypes - The event types whose decorators contribute constraints.
6
+ * @returns The registered constraints keyed by name.
7
+ */
8
+ export declare function registeredConstraints(constraints: Function[], eventTypes?: Function[]): Promise<Map<string, Constraint>>;
9
+ //# sourceMappingURL=registered_constraints.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registered_constraints.d.ts","sourceRoot":"","sources":["../../../../../../events/constraints/for_Constraints/when_scoping_to_event_sequences/given/registered_constraints.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,UAAU,EAA8B,MAAM,6BAA6B,CAAC;AAK1F;;;;;GAKG;AACH,wBAAsB,qBAAqB,CAAC,WAAW,EAAE,QAAQ,EAAE,EAAE,UAAU,GAAE,QAAQ,EAAO,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC,CAUlI"}
@@ -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
+ import { vi } from 'vitest';
4
+ import { Constraints } from '../../../Constraints.js';
5
+ /**
6
+ * Registers the given constraint classes and decorated event types and returns the registered wire definitions by name.
7
+ * @param constraints - The constraint classes.
8
+ * @param eventTypes - The event types whose decorators contribute constraints.
9
+ * @returns The registered constraints keyed by name.
10
+ */
11
+ export async function registeredConstraints(constraints, eventTypes = []) {
12
+ const register = vi.fn().mockResolvedValue({});
13
+ const connection = { constraints: { register } };
14
+ const artifacts = {
15
+ eventTypes, readModels: [], reactors: [], reducers: [], seeders: [], constraints,
16
+ projections: [], webhooks: [], eventTypeMigrations: [], globalForHandlers: []
17
+ };
18
+ await new Constraints('store', connection, artifacts).register();
19
+ const request = register.mock.calls[0][0];
20
+ return new Map(request.Constraints.map(registered => [registered.Name, registered]));
21
+ }
22
+ //# sourceMappingURL=registered_constraints.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registered_constraints.js","sourceRoot":"","sources":["../../../../../../events/constraints/for_Constraints/when_scoping_to_event_sequences/given/registered_constraints.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,qGAAqG;AAErG,OAAO,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAI5B,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAEtD;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,qBAAqB,CAAC,WAAuB,EAAE,UAAU,GAAe,EAAE;IAC5F,MAAM,QAAQ,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC,iBAAiB,CAAC,EAAE,CAAC,CAAC;IAC/C,MAAM,UAAU,GAAG,EAAE,WAAW,EAAE,EAAE,QAAQ,EAAE,EAAoC,CAAC;IACnF,MAAM,SAAS,GAAG;QACd,UAAU,EAAE,UAAU,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,WAAW;QAChF,WAAW,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,mBAAmB,EAAE,EAAE,EAAE,iBAAiB,EAAE,EAAE;KACzC,CAAC;IACzC,MAAM,IAAI,WAAW,CAAC,OAAO,EAAE,UAAU,EAAE,SAAS,CAAC,CAAC,QAAQ,EAAE,CAAC;IACjE,MAAM,OAAO,GAAG,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAA+B,CAAC;IACxE,OAAO,IAAI,GAAG,CAAC,OAAO,CAAC,WAAW,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC,UAAU,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC;AACzF,CAAC"}
@@ -4,6 +4,8 @@ export type { IConstraintBuilder } from './IConstraintBuilder.js';
4
4
  export type { IUniqueConstraintBuilder } from './IUniqueConstraintBuilder.js';
5
5
  export { constraint, getConstraintMetadata, isConstraint } from './constraint.js';
6
6
  export { unique } from './unique.js';
7
+ export type { UniqueOptions } from './UniqueOptions.js';
8
+ export type { ConstraintEventSequence } from './ConstraintEventSequences.js';
7
9
  export { removeConstraint } from './removeConstraint.js';
8
10
  export type { ConstraintMetadata } from './constraint.js';
9
11
  export type { IConstraints } from './IConstraints.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../events/constraints/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,YAAY,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpD,YAAY,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAClE,YAAY,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AAC9E,OAAO,EAAE,UAAU,EAAE,qBAAqB,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAClF,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,YAAY,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAC1D,YAAY,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,YAAY,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAChH,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACvE,YAAY,EAAE,uBAAuB,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../events/constraints/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,YAAY,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpD,YAAY,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAClE,YAAY,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AAC9E,OAAO,EAAE,UAAU,EAAE,qBAAqB,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAClF,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,YAAY,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxD,YAAY,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAAC;AAC7E,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,YAAY,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAC1D,YAAY,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,YAAY,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAChH,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACvE,YAAY,EAAE,uBAAuB,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../events/constraints/index.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,qGAAqG;AAErG,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAIjD,OAAO,EAAE,UAAU,EAAE,qBAAqB,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAClF,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAGzD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAE3D,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../events/constraints/index.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,qGAAqG;AAErG,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAIjD,OAAO,EAAE,UAAU,EAAE,qBAAqB,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAClF,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAGrC,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAGzD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAE3D,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC"}