@cratis/chronicle 6.16.1 → 6.18.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 (141) hide show
  1. package/artifacts/ActivatedArtifact.ts +5 -1
  2. package/artifacts/ArtifactCompletionFailed.ts +20 -0
  3. package/artifacts/ArtifactInvocationContext.ts +21 -0
  4. package/artifacts/for_withActivatedArtifact/when_completing/after_processing_failure.spec.ts +34 -0
  5. package/artifacts/index.ts +2 -0
  6. package/artifacts/withActivatedArtifact.ts +20 -3
  7. package/dist/artifacts/ActivatedArtifact.d.ts +4 -1
  8. package/dist/artifacts/ActivatedArtifact.d.ts.map +1 -1
  9. package/dist/artifacts/ArtifactCompletionFailed.d.ts +9 -0
  10. package/dist/artifacts/ArtifactCompletionFailed.d.ts.map +1 -0
  11. package/dist/artifacts/ArtifactCompletionFailed.js +19 -0
  12. package/dist/artifacts/ArtifactCompletionFailed.js.map +1 -0
  13. package/dist/artifacts/ArtifactInvocationContext.d.ts +18 -0
  14. package/dist/artifacts/ArtifactInvocationContext.d.ts.map +1 -0
  15. package/dist/artifacts/ArtifactInvocationContext.js +4 -0
  16. package/dist/artifacts/ArtifactInvocationContext.js.map +1 -0
  17. package/dist/artifacts/index.d.ts +2 -0
  18. package/dist/artifacts/index.d.ts.map +1 -1
  19. package/dist/artifacts/index.js +1 -0
  20. package/dist/artifacts/index.js.map +1 -1
  21. package/dist/artifacts/withActivatedArtifact.d.ts +2 -1
  22. package/dist/artifacts/withActivatedArtifact.d.ts.map +1 -1
  23. package/dist/artifacts/withActivatedArtifact.js +22 -3
  24. package/dist/artifacts/withActivatedArtifact.js.map +1 -1
  25. package/dist/projections/CompiledProjectionDefinitions.d.ts +6 -0
  26. package/dist/projections/CompiledProjectionDefinitions.d.ts.map +1 -1
  27. package/dist/projections/ProjectionCapabilityProvenance.d.ts +8 -0
  28. package/dist/projections/ProjectionCapabilityProvenance.d.ts.map +1 -0
  29. package/dist/projections/ProjectionCapabilityProvenance.js +4 -0
  30. package/dist/projections/ProjectionCapabilityProvenance.js.map +1 -0
  31. package/dist/projections/ProjectionDefinitionCompiler.d.ts +1 -0
  32. package/dist/projections/ProjectionDefinitionCompiler.d.ts.map +1 -1
  33. package/dist/projections/ProjectionDefinitionCompiler.js +130 -4
  34. package/dist/projections/ProjectionDefinitionCompiler.js.map +1 -1
  35. package/dist/projections/ProjectionEventSchema.d.ts +10 -0
  36. package/dist/projections/ProjectionEventSchema.d.ts.map +1 -0
  37. package/dist/projections/ProjectionEventSchema.js +4 -0
  38. package/dist/projections/ProjectionEventSchema.js.map +1 -0
  39. package/dist/projections/VariantReclassifier.d.ts +2 -0
  40. package/dist/projections/VariantReclassifier.d.ts.map +1 -1
  41. package/dist/projections/VariantReclassifier.js.map +1 -1
  42. package/dist/projections/captureProjectionProvenance.d.ts +4 -0
  43. package/dist/projections/captureProjectionProvenance.d.ts.map +1 -0
  44. package/dist/projections/captureProjectionProvenance.js +56 -0
  45. package/dist/projections/captureProjectionProvenance.js.map +1 -0
  46. package/dist/projections/declarative/AddChildBuilder.d.ts +13 -2
  47. package/dist/projections/declarative/AddChildBuilder.d.ts.map +1 -1
  48. package/dist/projections/declarative/AddChildBuilder.js +27 -1
  49. package/dist/projections/declarative/AddChildBuilder.js.map +1 -1
  50. package/dist/projections/declarative/FromBuilder.d.ts +4 -0
  51. package/dist/projections/declarative/FromBuilder.d.ts.map +1 -1
  52. package/dist/projections/declarative/FromBuilder.js +10 -2
  53. package/dist/projections/declarative/FromBuilder.js.map +1 -1
  54. package/dist/projections/declarative/IAddChildBuilder.d.ts +12 -0
  55. package/dist/projections/declarative/IAddChildBuilder.d.ts.map +1 -1
  56. package/dist/projections/declarative/IReadModelPropertiesBuilder.d.ts +16 -1
  57. package/dist/projections/declarative/IReadModelPropertiesBuilder.d.ts.map +1 -1
  58. package/dist/projections/declarative/JoinBuilder.d.ts +4 -0
  59. package/dist/projections/declarative/JoinBuilder.d.ts.map +1 -1
  60. package/dist/projections/declarative/JoinBuilder.js +1 -2
  61. package/dist/projections/declarative/JoinBuilder.js.map +1 -1
  62. package/dist/projections/declarative/ProjectionBuilderCore.d.ts.map +1 -1
  63. package/dist/projections/declarative/ProjectionBuilderCore.js +9 -1
  64. package/dist/projections/declarative/ProjectionBuilderCore.js.map +1 -1
  65. package/dist/projections/declarative/projectionBuilderProvenance.d.ts +16 -0
  66. package/dist/projections/declarative/projectionBuilderProvenance.d.ts.map +1 -0
  67. package/dist/projections/declarative/projectionBuilderProvenance.js +28 -0
  68. package/dist/projections/declarative/projectionBuilderProvenance.js.map +1 -0
  69. package/dist/projections/eventContractPath.d.ts +4 -0
  70. package/dist/projections/eventContractPath.d.ts.map +1 -0
  71. package/dist/projections/eventContractPath.js +7 -0
  72. package/dist/projections/eventContractPath.js.map +1 -0
  73. package/dist/projections/modelBound/childrenAndNestedBuilder.d.ts.map +1 -1
  74. package/dist/projections/modelBound/childrenAndNestedBuilder.js +41 -10
  75. package/dist/projections/modelBound/childrenAndNestedBuilder.js.map +1 -1
  76. package/dist/reactors/Reactors.d.ts.map +1 -1
  77. package/dist/reactors/Reactors.js +12 -3
  78. package/dist/reactors/Reactors.js.map +1 -1
  79. package/dist/reducers/Reducers.d.ts.map +1 -1
  80. package/dist/reducers/Reducers.js +12 -3
  81. package/dist/reducers/Reducers.js.map +1 -1
  82. package/dist/testing/projections/ProjectionCapabilities.d.ts +17 -0
  83. package/dist/testing/projections/ProjectionCapabilities.d.ts.map +1 -0
  84. package/dist/testing/projections/ProjectionCapabilities.js +233 -0
  85. package/dist/testing/projections/ProjectionCapabilities.js.map +1 -0
  86. package/dist/testing/projections/UnsupportedProjectionOperation.d.ts +11 -0
  87. package/dist/testing/projections/UnsupportedProjectionOperation.d.ts.map +1 -0
  88. package/dist/testing/projections/UnsupportedProjectionOperation.js +16 -0
  89. package/dist/testing/projections/UnsupportedProjectionOperation.js.map +1 -0
  90. package/dist/testing/projections/for_ProjectionCapabilities/given/Changed.d.ts +7 -0
  91. package/dist/testing/projections/for_ProjectionCapabilities/given/Changed.d.ts.map +1 -0
  92. package/dist/testing/projections/for_ProjectionCapabilities/given/Changed.js +16 -0
  93. package/dist/testing/projections/for_ProjectionCapabilities/given/Changed.js.map +1 -0
  94. package/dist/testing/projections/for_ProjectionCapabilities/given/Model.d.ts +10 -0
  95. package/dist/testing/projections/for_ProjectionCapabilities/given/Model.d.ts.map +1 -0
  96. package/dist/testing/projections/for_ProjectionCapabilities/given/Model.js +20 -0
  97. package/dist/testing/projections/for_ProjectionCapabilities/given/Model.js.map +1 -0
  98. package/dist/testing/projections/for_ProjectionCapabilities/given/Removed.d.ts +3 -0
  99. package/dist/testing/projections/for_ProjectionCapabilities/given/Removed.d.ts.map +1 -0
  100. package/dist/testing/projections/for_ProjectionCapabilities/given/Removed.js +7 -0
  101. package/dist/testing/projections/for_ProjectionCapabilities/given/Removed.js.map +1 -0
  102. package/dist/testing/projections/for_ProjectionCapabilities/given/compile.d.ts +12 -0
  103. package/dist/testing/projections/for_ProjectionCapabilities/given/compile.d.ts.map +1 -0
  104. package/dist/testing/projections/for_ProjectionCapabilities/given/compile.js +34 -0
  105. package/dist/testing/projections/for_ProjectionCapabilities/given/compile.js.map +1 -0
  106. package/dist/tsconfig.tsbuildinfo +1 -1
  107. package/package.json +2 -2
  108. package/projections/CompiledProjectionDefinitions.ts +6 -0
  109. package/projections/ProjectionCapabilityProvenance.ts +10 -0
  110. package/projections/ProjectionDefinitionCompiler.registration.spec.ts +4 -2
  111. package/projections/ProjectionDefinitionCompiler.ts +127 -4
  112. package/projections/ProjectionEventSchema.ts +13 -0
  113. package/projections/Projections.childrenAndNested.spec.ts +250 -1
  114. package/projections/VariantReclassifier.ts +2 -0
  115. package/projections/captureProjectionProvenance.ts +50 -0
  116. package/projections/declarative/AddChildBuilder.ts +33 -2
  117. package/projections/declarative/FromBuilder.ts +18 -1
  118. package/projections/declarative/IAddChildBuilder.ts +14 -0
  119. package/projections/declarative/IReadModelPropertiesBuilder.ts +18 -1
  120. package/projections/declarative/JoinBuilder.ts +9 -1
  121. package/projections/declarative/ProjectionBuilderCore.ts +8 -1
  122. package/projections/declarative/addChildCompatibility.standard.spec.ts +80 -0
  123. package/projections/declarative/projectionBuilderProvenance.ts +40 -0
  124. package/projections/eventContextExpressions.spec.ts +20 -0
  125. package/projections/eventContractPath.ts +9 -0
  126. package/projections/modelBound/childrenAndNestedBuilder.ts +45 -11
  127. package/reactors/Reactors.ts +13 -3
  128. package/reactors/for_Reactors/when_delivering/with_activation.spec.ts +93 -2
  129. package/reducers/Reducers.ts +14 -3
  130. package/reducers/for_Reducers/when_delivering/with_activation.spec.ts +67 -1
  131. package/testing/projections/ProjectionCapabilities.ts +213 -0
  132. package/testing/projections/UnsupportedProjectionOperation.ts +16 -0
  133. package/testing/projections/for_ProjectionCapabilities/given/Changed.ts +12 -0
  134. package/testing/projections/for_ProjectionCapabilities/given/Model.ts +13 -0
  135. package/testing/projections/for_ProjectionCapabilities/given/Removed.ts +7 -0
  136. package/testing/projections/for_ProjectionCapabilities/given/compile.ts +39 -0
  137. package/testing/projections/for_ProjectionCapabilities/when_compiling_capability_evidence.spec.ts +68 -0
  138. package/testing/projections/for_ProjectionCapabilities/when_rejecting_unsupported_operations.spec.ts +230 -0
  139. package/testing/projections/for_ProjectionCapabilities/when_validating_numeric_schemas.spec.ts +73 -0
  140. package/testing/projections/for_ProjectionCapabilities/when_validating_schema_boundaries.spec.ts +118 -0
  141. package/testing/projections/for_ProjectionCapabilities/when_validating_supported_operations.spec.ts +103 -0
@@ -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
 
4
+ import type { ArtifactInvocationContext } from './ArtifactInvocationContext.js';
5
+
4
6
  /** A leased artifact instance. The activator owns its lifetime; the SDK releases only this lease. */
5
7
  export interface ActivatedArtifact<T> {
6
8
  /** The instance used for every event in this delivery batch. */
@@ -8,5 +10,7 @@ export interface ActivatedArtifact<T> {
8
10
  /** Releases the lease after handling, even on failure. Cleanup errors are logged, not acknowledged as failures. */
9
11
  dispose?(): void | Promise<void>;
10
12
  /** Runs an individual handler (and any returned effects) inside the activator's execution boundary. */
11
- run?<R>(callback: () => R | Promise<R>): Promise<R>;
13
+ run?<R>(callback: () => R | Promise<R>, invocation?: ArtifactInvocationContext): Promise<R>;
14
+ /** Completes the lease before acknowledgement, even after processing fails. A rejection fails delivery. */
15
+ complete?(): void | Promise<void>;
12
16
  }
@@ -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
+
4
+ /** A lease completion failure that prevents acknowledgement, including when processing also failed. */
5
+ export class ArtifactCompletionFailed extends Error {
6
+ /** The original completion rejection. */
7
+ readonly completionError: unknown;
8
+ /** The original processing rejection, if processing also failed. */
9
+ readonly processingError: unknown;
10
+
11
+ constructor(completionError: unknown, processingError?: unknown) {
12
+ super(`Artifact completion failed: ${String(completionError)}`, { cause: completionError });
13
+ this.name = 'ArtifactCompletionFailed';
14
+ this.completionError = completionError;
15
+ this.processingError = processingError;
16
+ if (processingError instanceof Error) {
17
+ this.stack += `\nProcessing failure:\n${processingError.stack ?? String(processingError)}`;
18
+ }
19
+ }
20
+ }
@@ -0,0 +1,21 @@
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
+ import type { ReplayState } from '@cratis/chronicle.contracts';
5
+ import type { EventContext } from '../events/EventContext.js';
6
+ import { ArtifactDelivery } from './ArtifactDelivery.js';
7
+
8
+ /** Metadata for a single invocation within an activated artifact's delivery lease. */
9
+ export type ArtifactInvocationContext = {
10
+ /** An event handler invocation; each event has its own context, even within a shared batch lease. */
11
+ readonly delivery: ArtifactDelivery.Events;
12
+ /** The context of the event currently being handled. */
13
+ readonly eventContext: EventContext;
14
+ /** The handler method invoked for this event. */
15
+ readonly methodName: string;
16
+ } | {
17
+ /** A replay lifecycle notification, activated separately from event batches. */
18
+ readonly delivery: ArtifactDelivery.ReplayNotification;
19
+ /** The replay transition being notified. */
20
+ readonly replayState: ReplayState;
21
+ };
@@ -0,0 +1,34 @@
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
+ import { chai, describe, it } from 'vitest';
5
+ import type { ArtifactActivationContext } from '../../ArtifactActivationContext.js';
6
+ import { ArtifactCompletionFailed } from '../../ArtifactCompletionFailed.js';
7
+ import { withActivatedArtifact } from '../../withActivatedArtifact.js';
8
+
9
+ chai.should();
10
+
11
+ describe('when completing a lease after a processing failure', () => {
12
+ it('should retain both original errors and dispose after completion', async () => {
13
+ const processingError = new Error('processing');
14
+ const completionError = new Error('completion');
15
+ const steps: string[] = [];
16
+ const activator = () => ({ instance: {}, complete: () => { steps.push('complete'); throw completionError; },
17
+ dispose: () => { steps.push('dispose'); } });
18
+ let failure: unknown;
19
+ try {
20
+ await withActivatedArtifact(Object, {} as ArtifactActivationContext, activator, async () => {
21
+ steps.push('process');
22
+ throw processingError;
23
+ });
24
+ } catch (error) {
25
+ failure = error;
26
+ }
27
+ failure.should.be.instanceOf(ArtifactCompletionFailed);
28
+ const completionFailure = failure as ArtifactCompletionFailed;
29
+ completionFailure.processingError.should.equal(processingError);
30
+ completionFailure.completionError.should.equal(completionError);
31
+ completionFailure.cause.should.equal(completionError);
32
+ steps.should.deep.equal(['process', 'complete', 'dispose']);
33
+ });
34
+ });
@@ -4,6 +4,8 @@
4
4
  export { ArtifactKind } from './ArtifactKind.js';
5
5
  export { ArtifactDelivery } from './ArtifactDelivery.js';
6
6
  export type { ArtifactActivationContext } from './ArtifactActivationContext.js';
7
+ export type { ArtifactInvocationContext } from './ArtifactInvocationContext.js';
8
+ export { ArtifactCompletionFailed } from './ArtifactCompletionFailed.js';
7
9
  export type { ActivatedArtifact } from './ActivatedArtifact.js';
8
10
  export type { ClientArtifactsActivator } from './ClientArtifactsActivator.js';
9
11
 
@@ -5,6 +5,8 @@ import { diag } from '@opentelemetry/api';
5
5
  import type { Constructor } from '@cratis/fundamentals';
6
6
  import type { ActivatedArtifact } from './ActivatedArtifact.js';
7
7
  import type { ArtifactActivationContext } from './ArtifactActivationContext.js';
8
+ import type { ArtifactInvocationContext } from './ArtifactInvocationContext.js';
9
+ import { ArtifactCompletionFailed } from './ArtifactCompletionFailed.js';
8
10
  import type { ClientArtifactsActivator } from './ClientArtifactsActivator.js';
9
11
 
10
12
  const logger = diag.createComponentLogger({ namespace: '@cratis/chronicle/artifacts' });
@@ -16,7 +18,22 @@ export async function withActivatedArtifact<T, R>(
16
18
  ): Promise<R> {
17
19
  const artifact = await activator(type, context);
18
20
  try {
19
- return await callback(artifact);
21
+ let result!: R;
22
+ let processingFailed = false;
23
+ let processingError: unknown;
24
+ try {
25
+ result = await callback(artifact);
26
+ } catch (error) {
27
+ processingFailed = true;
28
+ processingError = error;
29
+ }
30
+ try {
31
+ await artifact.complete?.();
32
+ } catch (error) {
33
+ throw new ArtifactCompletionFailed(error, processingFailed ? processingError : undefined);
34
+ }
35
+ if (processingFailed) throw processingError;
36
+ return result;
20
37
  } finally {
21
38
  try {
22
39
  await artifact.dispose?.();
@@ -27,6 +44,6 @@ export async function withActivatedArtifact<T, R>(
27
44
  }
28
45
 
29
46
  /** Enters an optional execution boundary for one handler and all of its returned effects. */
30
- export async function runActivated<R>(artifact: ActivatedArtifact<unknown>, callback: () => R | Promise<R>): Promise<R> {
31
- return artifact.run ? artifact.run(callback) : callback();
47
+ export async function runActivated<R>(artifact: ActivatedArtifact<unknown>, callback: () => R | Promise<R>, invocation: ArtifactInvocationContext): Promise<R> {
48
+ return artifact.run ? artifact.run(callback, invocation) : callback();
32
49
  }
@@ -1,3 +1,4 @@
1
+ import type { ArtifactInvocationContext } from './ArtifactInvocationContext.js';
1
2
  /** A leased artifact instance. The activator owns its lifetime; the SDK releases only this lease. */
2
3
  export interface ActivatedArtifact<T> {
3
4
  /** The instance used for every event in this delivery batch. */
@@ -5,6 +6,8 @@ export interface ActivatedArtifact<T> {
5
6
  /** Releases the lease after handling, even on failure. Cleanup errors are logged, not acknowledged as failures. */
6
7
  dispose?(): void | Promise<void>;
7
8
  /** Runs an individual handler (and any returned effects) inside the activator's execution boundary. */
8
- run?<R>(callback: () => R | Promise<R>): Promise<R>;
9
+ run?<R>(callback: () => R | Promise<R>, invocation?: ArtifactInvocationContext): Promise<R>;
10
+ /** Completes the lease before acknowledgement, even after processing fails. A rejection fails delivery. */
11
+ complete?(): void | Promise<void>;
9
12
  }
10
13
  //# sourceMappingURL=ActivatedArtifact.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ActivatedArtifact.d.ts","sourceRoot":"","sources":["../../artifacts/ActivatedArtifact.ts"],"names":[],"mappings":"AAGA,qGAAqG;AACrG,MAAM,WAAW,iBAAiB,CAAC,CAAC;IAChC,gEAAgE;IAChE,QAAQ,CAAC,QAAQ,EAAE,CAAC,CAAC;IACrB,mHAAmH;IACnH,OAAO,CAAC,IAAI,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACjC,uGAAuG;IACvG,GAAG,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;CACvD"}
1
+ {"version":3,"file":"ActivatedArtifact.d.ts","sourceRoot":"","sources":["../../artifacts/ActivatedArtifact.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAEhF,qGAAqG;AACrG,MAAM,WAAW,iBAAiB,CAAC,CAAC;IAChC,gEAAgE;IAChE,QAAQ,CAAC,QAAQ,EAAE,CAAC,CAAC;IACrB,mHAAmH;IACnH,OAAO,CAAC,IAAI,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACjC,uGAAuG;IACvG,GAAG,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,EAAE,UAAU,CAAC,EAAE,yBAAyB,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;IAC5F,2GAA2G;IAC3G,QAAQ,CAAC,IAAI,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACrC"}
@@ -0,0 +1,9 @@
1
+ /** A lease completion failure that prevents acknowledgement, including when processing also failed. */
2
+ export declare class ArtifactCompletionFailed extends Error {
3
+ /** The original completion rejection. */
4
+ readonly completionError: unknown;
5
+ /** The original processing rejection, if processing also failed. */
6
+ readonly processingError: unknown;
7
+ constructor(completionError: unknown, processingError?: unknown);
8
+ }
9
+ //# sourceMappingURL=ArtifactCompletionFailed.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ArtifactCompletionFailed.d.ts","sourceRoot":"","sources":["../../artifacts/ArtifactCompletionFailed.ts"],"names":[],"mappings":"AAGA,uGAAuG;AACvG,qBAAa,wBAAyB,SAAQ,KAAK;IAC/C,yCAAyC;IACzC,QAAQ,CAAC,eAAe,EAAE,OAAO,CAAC;IAClC,oEAAoE;IACpE,QAAQ,CAAC,eAAe,EAAE,OAAO,CAAC;IAElC,YAAY,eAAe,EAAE,OAAO,EAAE,eAAe,CAAC,EAAE,OAAO,EAQ9D;CACJ"}
@@ -0,0 +1,19 @@
1
+ // Copyright (c) Cratis. All rights reserved.
2
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
+ /** A lease completion failure that prevents acknowledgement, including when processing also failed. */
4
+ export class ArtifactCompletionFailed extends Error {
5
+ /** The original completion rejection. */
6
+ completionError;
7
+ /** The original processing rejection, if processing also failed. */
8
+ processingError;
9
+ constructor(completionError, processingError) {
10
+ super(`Artifact completion failed: ${String(completionError)}`, { cause: completionError });
11
+ this.name = 'ArtifactCompletionFailed';
12
+ this.completionError = completionError;
13
+ this.processingError = processingError;
14
+ if (processingError instanceof Error) {
15
+ this.stack += `\nProcessing failure:\n${processingError.stack ?? String(processingError)}`;
16
+ }
17
+ }
18
+ }
19
+ //# sourceMappingURL=ArtifactCompletionFailed.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ArtifactCompletionFailed.js","sourceRoot":"","sources":["../../artifacts/ArtifactCompletionFailed.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,qGAAqG;AAErG,uGAAuG;AACvG,MAAM,OAAO,wBAAyB,SAAQ,KAAK;IAC/C,yCAAyC;IAChC,eAAe,CAAU;IAClC,oEAAoE;IAC3D,eAAe,CAAU;IAElC,YAAY,eAAwB,EAAE,eAAyB;QAC3D,KAAK,CAAC,+BAA+B,MAAM,CAAC,eAAe,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,eAAe,EAAE,CAAC,CAAC;QAC5F,IAAI,CAAC,IAAI,GAAG,0BAA0B,CAAC;QACvC,IAAI,CAAC,eAAe,GAAG,eAAe,CAAC;QACvC,IAAI,CAAC,eAAe,GAAG,eAAe,CAAC;QACvC,IAAI,eAAe,YAAY,KAAK,EAAE,CAAC;YACnC,IAAI,CAAC,KAAK,IAAI,0BAA0B,eAAe,CAAC,KAAK,IAAI,MAAM,CAAC,eAAe,CAAC,EAAE,CAAC;QAC/F,CAAC;IACL,CAAC;CACJ"}
@@ -0,0 +1,18 @@
1
+ import type { ReplayState } from '@cratis/chronicle.contracts';
2
+ import type { EventContext } from '../events/EventContext.js';
3
+ import { ArtifactDelivery } from './ArtifactDelivery.js';
4
+ /** Metadata for a single invocation within an activated artifact's delivery lease. */
5
+ export type ArtifactInvocationContext = {
6
+ /** An event handler invocation; each event has its own context, even within a shared batch lease. */
7
+ readonly delivery: ArtifactDelivery.Events;
8
+ /** The context of the event currently being handled. */
9
+ readonly eventContext: EventContext;
10
+ /** The handler method invoked for this event. */
11
+ readonly methodName: string;
12
+ } | {
13
+ /** A replay lifecycle notification, activated separately from event batches. */
14
+ readonly delivery: ArtifactDelivery.ReplayNotification;
15
+ /** The replay transition being notified. */
16
+ readonly replayState: ReplayState;
17
+ };
18
+ //# sourceMappingURL=ArtifactInvocationContext.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ArtifactInvocationContext.d.ts","sourceRoot":"","sources":["../../artifacts/ArtifactInvocationContext.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAEzD,sFAAsF;AACtF,MAAM,MAAM,yBAAyB,GAAG;IACpC,qGAAqG;IACrG,QAAQ,CAAC,QAAQ,EAAE,gBAAgB,CAAC,MAAM,CAAC;IAC3C,wDAAwD;IACxD,QAAQ,CAAC,YAAY,EAAE,YAAY,CAAC;IACpC,iDAAiD;IACjD,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;CAC/B,GAAG;IACA,gFAAgF;IAChF,QAAQ,CAAC,QAAQ,EAAE,gBAAgB,CAAC,kBAAkB,CAAC;IACvD,4CAA4C;IAC5C,QAAQ,CAAC,WAAW,EAAE,WAAW,CAAC;CACrC,CAAC"}
@@ -0,0 +1,4 @@
1
+ // Copyright (c) Cratis. All rights reserved.
2
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
+ export {};
4
+ //# sourceMappingURL=ArtifactInvocationContext.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ArtifactInvocationContext.js","sourceRoot":"","sources":["../../artifacts/ArtifactInvocationContext.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,qGAAqG"}
@@ -1,6 +1,8 @@
1
1
  export { ArtifactKind } from './ArtifactKind.js';
2
2
  export { ArtifactDelivery } from './ArtifactDelivery.js';
3
3
  export type { ArtifactActivationContext } from './ArtifactActivationContext.js';
4
+ export type { ArtifactInvocationContext } from './ArtifactInvocationContext.js';
5
+ export { ArtifactCompletionFailed } from './ArtifactCompletionFailed.js';
4
6
  export type { ActivatedArtifact } from './ActivatedArtifact.js';
5
7
  export type { ClientArtifactsActivator } from './ClientArtifactsActivator.js';
6
8
  export type { IClientArtifactsProvider } from './IClientArtifactsProvider.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../artifacts/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,YAAY,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAChF,YAAY,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAChE,YAAY,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AAE9E,YAAY,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AAC9E,OAAO,EAAE,8BAA8B,EAAE,MAAM,qCAAqC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../artifacts/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,YAAY,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAChF,YAAY,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAChF,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AACzE,YAAY,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAChE,YAAY,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AAE9E,YAAY,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AAC9E,OAAO,EAAE,8BAA8B,EAAE,MAAM,qCAAqC,CAAC"}
@@ -2,5 +2,6 @@
2
2
  // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
3
  export { ArtifactKind } from './ArtifactKind.js';
4
4
  export { ArtifactDelivery } from './ArtifactDelivery.js';
5
+ export { ArtifactCompletionFailed } from './ArtifactCompletionFailed.js';
5
6
  export { DefaultClientArtifactsProvider } from './DefaultClientArtifactsProvider.js';
6
7
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../artifacts/index.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,qGAAqG;AAErG,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAMzD,OAAO,EAAE,8BAA8B,EAAE,MAAM,qCAAqC,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../artifacts/index.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,qGAAqG;AAErG,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAGzD,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AAKzE,OAAO,EAAE,8BAA8B,EAAE,MAAM,qCAAqC,CAAC"}
@@ -1,9 +1,10 @@
1
1
  import type { Constructor } from '@cratis/fundamentals';
2
2
  import type { ActivatedArtifact } from './ActivatedArtifact.js';
3
3
  import type { ArtifactActivationContext } from './ArtifactActivationContext.js';
4
+ import type { ArtifactInvocationContext } from './ArtifactInvocationContext.js';
4
5
  import type { ClientArtifactsActivator } from './ClientArtifactsActivator.js';
5
6
  /** Activates once per delivery and always releases the lease before acknowledgement. */
6
7
  export declare function withActivatedArtifact<T, R>(type: Constructor<T>, context: ArtifactActivationContext, activator: ClientArtifactsActivator, callback: (artifact: ActivatedArtifact<T>) => Promise<R>): Promise<R>;
7
8
  /** Enters an optional execution boundary for one handler and all of its returned effects. */
8
- export declare function runActivated<R>(artifact: ActivatedArtifact<unknown>, callback: () => R | Promise<R>): Promise<R>;
9
+ export declare function runActivated<R>(artifact: ActivatedArtifact<unknown>, callback: () => R | Promise<R>, invocation: ArtifactInvocationContext): Promise<R>;
9
10
  //# sourceMappingURL=withActivatedArtifact.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"withActivatedArtifact.d.ts","sourceRoot":"","sources":["../../artifacts/withActivatedArtifact.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAChF,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AAI9E,wFAAwF;AACxF,wBAAsB,qBAAqB,CAAC,CAAC,EAAE,CAAC,EAC5C,IAAI,EAAE,WAAW,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,yBAAyB,EAAE,SAAS,EAAE,wBAAwB,EAC7F,QAAQ,EAAE,CAAC,QAAQ,EAAE,iBAAiB,CAAC,CAAC,CAAC,KAAK,OAAO,CAAC,CAAC,CAAC,GACzD,OAAO,CAAC,CAAC,CAAC,CAWZ;AAED,6FAA6F;AAC7F,wBAAsB,YAAY,CAAC,CAAC,EAAE,QAAQ,EAAE,iBAAiB,CAAC,OAAO,CAAC,EAAE,QAAQ,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAEtH"}
1
+ {"version":3,"file":"withActivatedArtifact.d.ts","sourceRoot":"","sources":["../../artifacts/withActivatedArtifact.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAChF,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAEhF,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AAI9E,wFAAwF;AACxF,wBAAsB,qBAAqB,CAAC,CAAC,EAAE,CAAC,EAC5C,IAAI,EAAE,WAAW,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,yBAAyB,EAAE,SAAS,EAAE,wBAAwB,EAC7F,QAAQ,EAAE,CAAC,QAAQ,EAAE,iBAAiB,CAAC,CAAC,CAAC,KAAK,OAAO,CAAC,CAAC,CAAC,GACzD,OAAO,CAAC,CAAC,CAAC,CA0BZ;AAED,6FAA6F;AAC7F,wBAAsB,YAAY,CAAC,CAAC,EAAE,QAAQ,EAAE,iBAAiB,CAAC,OAAO,CAAC,EAAE,QAAQ,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,yBAAyB,GAAG,OAAO,CAAC,CAAC,CAAC,CAE7J"}
@@ -1,12 +1,31 @@
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 { diag } from '@opentelemetry/api';
4
+ import { ArtifactCompletionFailed } from './ArtifactCompletionFailed.js';
4
5
  const logger = diag.createComponentLogger({ namespace: '@cratis/chronicle/artifacts' });
5
6
  /** Activates once per delivery and always releases the lease before acknowledgement. */
6
7
  export async function withActivatedArtifact(type, context, activator, callback) {
7
8
  const artifact = await activator(type, context);
8
9
  try {
9
- return await callback(artifact);
10
+ let result;
11
+ let processingFailed = false;
12
+ let processingError;
13
+ try {
14
+ result = await callback(artifact);
15
+ }
16
+ catch (error) {
17
+ processingFailed = true;
18
+ processingError = error;
19
+ }
20
+ try {
21
+ await artifact.complete?.();
22
+ }
23
+ catch (error) {
24
+ throw new ArtifactCompletionFailed(error, processingFailed ? processingError : undefined);
25
+ }
26
+ if (processingFailed)
27
+ throw processingError;
28
+ return result;
10
29
  }
11
30
  finally {
12
31
  try {
@@ -18,7 +37,7 @@ export async function withActivatedArtifact(type, context, activator, callback)
18
37
  }
19
38
  }
20
39
  /** Enters an optional execution boundary for one handler and all of its returned effects. */
21
- export async function runActivated(artifact, callback) {
22
- return artifact.run ? artifact.run(callback) : callback();
40
+ export async function runActivated(artifact, callback, invocation) {
41
+ return artifact.run ? artifact.run(callback, invocation) : callback();
23
42
  }
24
43
  //# sourceMappingURL=withActivatedArtifact.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"withActivatedArtifact.js","sourceRoot":"","sources":["../../artifacts/withActivatedArtifact.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,qGAAqG;AAErG,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAM1C,MAAM,MAAM,GAAG,IAAI,CAAC,qBAAqB,CAAC,EAAE,SAAS,EAAE,6BAA6B,EAAE,CAAC,CAAC;AAExF,wFAAwF;AACxF,MAAM,CAAC,KAAK,UAAU,qBAAqB,CACvC,IAAoB,EAAE,OAAkC,EAAE,SAAmC,EAC7F,QAAwD;IAExD,MAAM,QAAQ,GAAG,MAAM,SAAS,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IAChD,IAAI,CAAC;QACD,OAAO,MAAM,QAAQ,CAAC,QAAQ,CAAC,CAAC;IACpC,CAAC;YAAS,CAAC;QACP,IAAI,CAAC;YACD,MAAM,QAAQ,CAAC,OAAO,EAAE,EAAE,CAAC;QAC/B,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACb,MAAM,CAAC,KAAK,CAAC,oCAAoC,EAAE,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,UAAU,EAAE,OAAO,CAAC,UAAU,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;QACrI,CAAC;IACL,CAAC;AACL,CAAC;AAED,6FAA6F;AAC7F,MAAM,CAAC,KAAK,UAAU,YAAY,CAAI,QAAoC,EAAE,QAA8B;IACtG,OA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,CAAC;YAAS,CAAC;QACP,IAAI,CAAC;YACD,MAAM,QAAQ,CAAC,OAAO,EAAE,EAAE,CAAC;QAC/B,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACb,MAAM,CAAC,KAAK,CAAC,oCAAoC,EAAE,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,UAAU,EAAE,OAAO,CAAC,UAAU,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;QACrI,CAAC;IACL,CAAC;AACL,CAAC;AAED,6FAA6F;AAC7F,MAAM,CAAC,KAAK,UAAU,YAAY,CAAI,QAAoC,EAAE,QAA8B,EAAE,UAAqC;IAC7I,OAAO,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC;AAC1E,CAAC"}
@@ -1,10 +1,16 @@
1
1
  import type { ProjectionDefinition } from '@cratis/chronicle.contracts';
2
2
  import type { buildReadModelDefinition } from '../readModels/buildReadModelDefinition.js';
3
+ import type { ProjectionCapabilityProvenance } from './ProjectionCapabilityProvenance.js';
4
+ import type { ProjectionEventSchema } from './ProjectionEventSchema.js';
3
5
  /** Connection-independent contracts produced for projection registration. */
4
6
  export interface CompiledProjectionDefinitions {
5
7
  /** The final wire definitions, including variant cross-wiring and LastUpdated hashes. */
6
8
  readonly definitions: ProjectionDefinition[];
7
9
  /** Read models registered before the projections. */
8
10
  readonly readModels: ReturnType<typeof buildReadModelDefinition>[];
11
+ /** Pre-lowering declaration-to-contract paths, keyed by final definition identity. */
12
+ readonly provenance: ReadonlyMap<ProjectionDefinition, readonly ProjectionCapabilityProvenance[]>;
13
+ /** Isolated schemas for every event referenced by each definition, keyed by id:generation:tombstone. */
14
+ readonly eventSchemas: ReadonlyMap<ProjectionDefinition, ReadonlyMap<string, ProjectionEventSchema>>;
9
15
  }
10
16
  //# sourceMappingURL=CompiledProjectionDefinitions.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"CompiledProjectionDefinitions.d.ts","sourceRoot":"","sources":["../../projections/CompiledProjectionDefinitions.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AACxE,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,2CAA2C,CAAC;AAE1F,6EAA6E;AAC7E,MAAM,WAAW,6BAA6B;IAC1C,yFAAyF;IACzF,QAAQ,CAAC,WAAW,EAAE,oBAAoB,EAAE,CAAC;IAC7C,qDAAqD;IACrD,QAAQ,CAAC,UAAU,EAAE,UAAU,CAAC,OAAO,wBAAwB,CAAC,EAAE,CAAC;CACtE"}
1
+ {"version":3,"file":"CompiledProjectionDefinitions.d.ts","sourceRoot":"","sources":["../../projections/CompiledProjectionDefinitions.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AACxE,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,2CAA2C,CAAC;AAC1F,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,qCAAqC,CAAC;AAC1F,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAExE,6EAA6E;AAC7E,MAAM,WAAW,6BAA6B;IAC1C,yFAAyF;IACzF,QAAQ,CAAC,WAAW,EAAE,oBAAoB,EAAE,CAAC;IAC7C,qDAAqD;IACrD,QAAQ,CAAC,UAAU,EAAE,UAAU,CAAC,OAAO,wBAAwB,CAAC,EAAE,CAAC;IACnE,sFAAsF;IACtF,QAAQ,CAAC,UAAU,EAAE,WAAW,CAAC,oBAAoB,EAAE,SAAS,8BAA8B,EAAE,CAAC,CAAC;IAClG,wGAAwG;IACxG,QAAQ,CAAC,YAAY,EAAE,WAAW,CAAC,oBAAoB,EAAE,WAAW,CAAC,MAAM,EAAE,qBAAqB,CAAC,CAAC,CAAC;CACxG"}
@@ -0,0 +1,8 @@
1
+ /** A declaration and the contract path it produced, captured before variant lowering. */
2
+ export interface ProjectionCapabilityProvenance {
3
+ /** Stable path into the compiled projection contract. */
4
+ readonly contractPath: string;
5
+ /** Source declaration responsible for the contract entry. */
6
+ readonly declaration: string;
7
+ }
8
+ //# sourceMappingURL=ProjectionCapabilityProvenance.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ProjectionCapabilityProvenance.d.ts","sourceRoot":"","sources":["../../projections/ProjectionCapabilityProvenance.ts"],"names":[],"mappings":"AAGA,yFAAyF;AACzF,MAAM,WAAW,8BAA8B;IAC3C,yDAAyD;IACzD,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,6DAA6D;IAC7D,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;CAChC"}
@@ -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=ProjectionCapabilityProvenance.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ProjectionCapabilityProvenance.js","sourceRoot":"","sources":["../../projections/ProjectionCapabilityProvenance.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,qGAAqG"}
@@ -17,6 +17,7 @@ export declare class ProjectionDefinitionCompiler {
17
17
  * @returns Projection definitions and read-model registrations ready for the wire.
18
18
  */
19
19
  compile(declarative: Iterable<Constructor>, modelBound: Iterable<Constructor>): CompiledProjectionDefinitions;
20
+ private buildEventSchemaCatalog;
20
21
  private buildWithContextValidation;
21
22
  private buildReadModelDefinitions;
22
23
  private getReadModelType;
@@ -1 +1 @@
1
- {"version":3,"file":"ProjectionDefinitionCompiler.d.ts","sourceRoot":"","sources":["../../projections/ProjectionDefinitionCompiler.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,wBAAwB,EAAE,MAAM,uB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