@cratis/chronicle 6.71.1 → 6.71.2

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 (28) hide show
  1. package/dist/testing/for_ReadModelScenario/when_adding_with_children/given/compiled_projection.d.ts +142 -0
  2. package/dist/testing/for_ReadModelScenario/when_adding_with_children/given/compiled_projection.d.ts.map +1 -0
  3. package/dist/testing/for_ReadModelScenario/when_adding_with_children/given/compiled_projection.js +142 -0
  4. package/dist/testing/for_ReadModelScenario/when_adding_with_children/given/compiled_projection.js.map +1 -0
  5. package/dist/testing/for_ReadModelScenario/when_adding_with_children/given/lifecycle.d.ts +24 -0
  6. package/dist/testing/for_ReadModelScenario/when_adding_with_children/given/lifecycle.d.ts.map +1 -0
  7. package/dist/testing/for_ReadModelScenario/when_adding_with_children/given/lifecycle.js +34 -0
  8. package/dist/testing/for_ReadModelScenario/when_adding_with_children/given/lifecycle.js.map +1 -0
  9. package/dist/testing/projections/ProjectionArithmeticChildrenCapabilities.d.ts +17 -0
  10. package/dist/testing/projections/ProjectionArithmeticChildrenCapabilities.d.ts.map +1 -0
  11. package/dist/testing/projections/{ProjectionCountChildrenCapabilities.js → ProjectionArithmeticChildrenCapabilities.js} +24 -12
  12. package/dist/testing/projections/ProjectionArithmeticChildrenCapabilities.js.map +1 -0
  13. package/dist/testing/projections/ProjectionRootCapabilities.js +4 -4
  14. package/dist/testing/projections/ProjectionRootCapabilities.js.map +1 -1
  15. package/dist/tsconfig.tsbuildinfo +1 -1
  16. package/package.json +2 -2
  17. package/testing/for_ReadModelScenario/when_adding_with_children/given/compiled_projection.ts +71 -0
  18. package/testing/for_ReadModelScenario/when_adding_with_children/given/lifecycle.ts +38 -0
  19. package/testing/for_ReadModelScenario/when_adding_with_children/with_a_fluent_projection.spec.ts +64 -0
  20. package/testing/for_ReadModelScenario/when_adding_with_children/with_legacy_decorators.legacy.spec.ts +41 -0
  21. package/testing/for_ReadModelScenario/when_adding_with_children/with_standard_decorators.standard.spec.ts +42 -0
  22. package/testing/projections/{ProjectionCountChildrenCapabilities.ts → ProjectionArithmeticChildrenCapabilities.ts} +22 -11
  23. package/testing/projections/ProjectionRootCapabilities.ts +4 -4
  24. package/testing/projections/for_ProjectionCapabilities/when_validating_add_with_children.spec.ts +91 -0
  25. package/testing/projections/for_ProjectionCapabilities/when_validating_count_with_children.spec.ts +12 -2
  26. package/dist/testing/projections/ProjectionCountChildrenCapabilities.d.ts +0 -15
  27. package/dist/testing/projections/ProjectionCountChildrenCapabilities.d.ts.map +0 -1
  28. package/dist/testing/projections/ProjectionCountChildrenCapabilities.js.map +0 -1
@@ -4,30 +4,41 @@
4
4
  import type { ChildrenDefinition } from '@cratis/chronicle.contracts';
5
5
  import type { FromRecord, RemovedWithRecord } from '../../projections/declarative/ProjectionBuilderCore.js';
6
6
  import type { JsonSchema } from '../../schemas/JsonSchema.js';
7
+ import { eventContractPath } from '../../projections/eventContractPath.js';
8
+ import type { ProjectionEventSchemaResolver } from './ProjectionEventSchemaResolver.js';
7
9
 
8
- /** The measured intersection of root counting and independent typed children. */
9
- export class ProjectionCountChildrenCapabilities {
10
- static supports(schema: JsonSchema, wire: Record<string, unknown>): boolean {
10
+ /** The measured intersection of one root accumulator and independent typed children. */
11
+ export class ProjectionArithmeticChildrenCapabilities {
12
+ static supports(schema: JsonSchema, wire: Record<string, unknown>, require: ProjectionEventSchemaResolver['require']): boolean {
11
13
  const from = wire.From as FromRecord[] ?? [];
12
14
  const children = Object.entries(wire.Children as Record<string, ChildrenDefinition> ?? {});
13
- if (!this.singleCount(from) || children.length !== 1) return false;
15
+ if (from.length !== 1 || children.length !== 1) return false;
16
+ const mappings = Object.entries(from[0].Value.Properties ?? {});
17
+ if (mappings.length !== 1) return false;
18
+ const [accumulator, expression] = mappings[0];
19
+ if (!this.accumulator(schema.properties?.[accumulator], expression, from[0], require)) return false;
14
20
  const [collection, child] = children[0];
15
- const count = Object.keys(from[0].Value.Properties)[0];
16
- return this.rootShape(schema, count, collection)
21
+ return this.rootShape(schema, accumulator, collection)
17
22
  && this.childShape(schema.properties?.[collection], child)
18
23
  && this.independentEvents(from, wire, child) && this.noInteractions(wire);
19
24
  }
20
25
 
21
- private static singleCount(from: FromRecord[]): boolean {
22
- if (from.length !== 1) return false;
23
- const expressions = Object.values(from[0].Value.Properties ?? {});
24
- return expressions.length === 1 && expressions[0] === '$count';
26
+ private static accumulator(target: JsonSchema | undefined, expression: string, from: FromRecord, require: ProjectionEventSchemaResolver['require']): boolean {
27
+ if (expression === '$count') return this.countTarget(target);
28
+ const operand = /^\$add\(([A-Za-z_][A-Za-z0-9]*)\)$/.exec(expression)?.[1];
29
+ if (!operand || !this.unformattedNumber(target)) return false;
30
+ const event = require(from.Key, eventContractPath('From', from.Key));
31
+ return this.unformattedNumber(event.properties?.[operand]);
32
+ }
33
+
34
+ private static unformattedNumber(schema?: JsonSchema): boolean {
35
+ return schema?.type === 'number' && schema.format === undefined;
25
36
  }
26
37
 
27
38
  private static rootShape(schema: JsonSchema, count: string, collection: string): boolean {
28
39
  const properties = schema.properties ?? {};
29
40
  return this.exactRootMembers(properties, count, collection)
30
- && this.plainString(properties.id) && this.countTarget(properties[count]);
41
+ && this.plainString(properties.id);
31
42
  }
32
43
 
33
44
  private static exactRootMembers(properties: Record<string, JsonSchema>, count: string, collection: string): boolean {
@@ -6,7 +6,7 @@ import type { FromRecord, RemovedWithRecord } from '../../projections/declarativ
6
6
  import { eventContractPath } from '../../projections/eventContractPath.js';
7
7
  import type { JsonSchema } from '../../schemas/JsonSchema.js';
8
8
  import { ProjectionArithmetic } from './ProjectionArithmetic.js';
9
- import { ProjectionCountChildrenCapabilities } from './ProjectionCountChildrenCapabilities.js';
9
+ import { ProjectionArithmeticChildrenCapabilities } from './ProjectionArithmeticChildrenCapabilities.js';
10
10
  import type { ProjectionCapabilityReject } from './ProjectionCapabilityReject.js';
11
11
  import type { ProjectionEventSchemaResolver } from './ProjectionEventSchemaResolver.js';
12
12
  import { ProjectionMappingCapabilities } from './ProjectionMappingCapabilities.js';
@@ -25,7 +25,7 @@ export class ProjectionRootCapabilities {
25
25
  this.checkOverlaps();
26
26
  const accumulators = new Set(this.from.flatMap(entry => Object.entries(entry.Value.Properties ?? {})
27
27
  .filter(([, expression]) => ProjectionArithmetic.isArithmetic(expression)).map(([property]) => property)));
28
- this.checkAccumulatorChildren(accumulators);
28
+ this.checkAccumulatorChildren(accumulators, resolver);
29
29
  for (const entry of this.from) this.checkClearedAccumulators(entry, accumulators);
30
30
  const mappings = new ProjectionMappingCapabilities(this.schema, this.reject, accumulators);
31
31
  for (const entry of [...this.from, ...this.removedWith]) this.subscription(entry, resolver, mappings);
@@ -39,10 +39,10 @@ export class ProjectionRootCapabilities {
39
39
  }
40
40
  }
41
41
 
42
- private checkAccumulatorChildren(accumulators: Set<string>): void {
42
+ private checkAccumulatorChildren(accumulators: Set<string>, resolver: ProjectionEventSchemaResolver): void {
43
43
  if (!accumulators.size) return;
44
44
  if (!Object.keys(this.wire.Children as object ?? {}).length) return;
45
- if (!ProjectionCountChildrenCapabilities.supports(this.schema, this.wire)) {
45
+ if (!ProjectionArithmeticChildrenCapabilities.supports(this.schema, this.wire, resolver.require)) {
46
46
  this.reject('Children', 'root arithmetic combined with children requires a kernel-backed test');
47
47
  }
48
48
  }
@@ -0,0 +1,91 @@
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 { beforeEach, chai, describe, it } from 'vitest';
5
+ import type { ProjectionDefinition } from '@cratis/chronicle.contracts';
6
+ import { EventType } from '../../../events/EventType.js';
7
+ import type { JsonSchema } from '../../../schemas/JsonSchema.js';
8
+ import { compile, Totals } from '../../for_ReadModelScenario/when_adding_with_children/given/compiled_projection.js';
9
+ import type { ScenarioEvent } from '../../ScenarioEvent.js';
10
+ import { ProjectionReadModelProcessor } from '../ProjectionReadModelProcessor.js';
11
+ import { UnsupportedProjectionOperation } from '../UnsupportedProjectionOperation.js';
12
+
13
+ chai.should();
14
+ type Candidate = { compiled: ReturnType<typeof compile>; definition: ProjectionDefinition; schema: JsonSchema; operand: JsonSchema };
15
+ type Mutation = (candidate: Candidate) => void;
16
+ const boundaries: Array<[string, Mutation]> = [
17
+ ...['$increment', '$decrement', '$subtract(amount)', '$add(amount + 1)', '$add(nested.amount)', '$add($eventSourceId)',
18
+ '$add(1)', '$add(true)', '$add(snake_case)', '$add(missing)', '$add(amount', '$add(_snake_case)'].map(expression =>
19
+ [expression, ({ definition }: Candidate) => { definition.From[0].Value.Properties.total = expression; }] as [string, Mutation]),
20
+ ...['int32', 'uint32', 'float', 'double', ''].flatMap(format => [
21
+ [`${format || 'empty'} operand format`, ({ operand }: Candidate) => { operand.format = format; }],
22
+ [`${format || 'empty'} target format`, ({ schema }: Candidate) => { schema.properties!.total.format = format; }]
23
+ ] as Array<[string, Mutation]>),
24
+ ['integer operand', ({ operand }) => { operand.type = 'integer'; operand.format = 'int32'; }],
25
+ ['integer target', ({ schema }) => { schema.properties!.total = { type: 'integer', format: 'int32' }; }],
26
+ ['non-numeric operand', ({ operand }) => { operand.type = 'string'; }],
27
+ ['non-numeric target', ({ schema }) => { schema.properties!.total = { type: 'string' }; }],
28
+ ['nullable operand', ({ operand }) => { Object.assign(operand, { type: ['number', 'null'] }); }],
29
+ ['nullable target', ({ schema }) => { Object.assign(schema.properties!.total, { type: ['number', 'null'] }); }],
30
+ ['protected operand', ({ operand }) => { operand.security = [{ metadataType: 'EncryptedSubject', details: '' }]; }],
31
+ ['compliance operand', ({ operand }) => { operand.compliance = [{ metadataType: 'PII', details: '' }]; }],
32
+ ['protected target', ({ schema }) => { schema.properties!.total.security = [{ metadataType: 'EncryptedSubject', details: '' }]; }],
33
+ ['compliance target', ({ schema }) => { schema.properties!.total.compliance = [{ metadataType: 'PII', details: '' }]; }],
34
+ ['GUID root identifier', ({ schema }) => { schema.properties!.id.format = 'uuid'; }],
35
+ ['extra root property', ({ schema }) => { schema.properties!.name = { type: 'string' }; }],
36
+ ['extra root mapping', ({ definition }) => { definition.From[0].Value.Properties.id = '$eventSourceId'; }],
37
+ ['multiple root subscriptions', ({ definition }) => { definition.From.push(structuredClone(definition.From[0])); }],
38
+ ['initial values', ({ definition }) => { definition.InitialModelState = '{"total":0}'; }],
39
+ ['root join', ({ definition }) => { definition.Join.push({ Key: definition.From[0].Key, Value: { On: 'id', Properties: {}, Key: '$eventSourceId' } }); }],
40
+ ['multiple child collections', ({ definition }) => { definition.Children.other = structuredClone(definition.Children.items); }],
41
+ ['untyped children', ({ schema }) => { delete schema.properties!.items.items!.properties; }],
42
+ ['numeric child property', ({ schema }) => { schema.properties!.items.items!.properties!.name = { type: 'number' }; }],
43
+ ['missing child identifier', ({ schema }) => { delete schema.properties!.items.items!.properties!.itemId; }],
44
+ ['child From without event Key', ({ definition }) => { delete definition.Children.items.From[0].Key; }],
45
+ ['child removal without event Key', ({ definition }) => { delete definition.Children.items.RemovedWith[0].Key; }],
46
+ ['shared root and child From', ({ definition }) => { definition.Children.items.From[0].Key = definition.From[0].Key; }],
47
+ ['shared root From and child removal', ({ definition }) => { definition.Children.items.RemovedWith[0].Key = definition.From[0].Key; }],
48
+ ['shared root removal and child From', ({ definition }) => { definition.Children.items.From[0].Key = definition.RemovedWith[0].Key; }],
49
+ ['shared root and child removal', ({ definition }) => { definition.Children.items.RemovedWith[0].Key = definition.RemovedWith[0].Key; }],
50
+ ['shared root From and removal', ({ definition }) => { definition.RemovedWith[0].Key = definition.From[0].Key; }],
51
+ ['custom root key', ({ definition }) => { definition.From[0].Value.Key = 'amount'; }],
52
+ ['custom root parent key', ({ definition }) => { definition.From[0].Value.ParentKey = 'amount'; }],
53
+ ['custom child parent key', ({ definition }) => { definition.Children.items.From[0].Value.ParentKey = 'itemId'; }],
54
+ ['child join', ({ definition }) => { definition.Children.items.Join.push({}); }],
55
+ ['nested children', ({ definition }) => { definition.Children.items.Children.nested = structuredClone(definition.Children.items); }],
56
+ ['value children', ({ definition }) => { definition.Children.items.FromEventProperty = 'items'; }],
57
+ ['unknown child expression', ({ definition }) => { definition.Children.items.From[0].Value.Properties.name = '$unknown(name)'; }],
58
+ ['unknown root expression', ({ definition }) => { definition.From[0].Value.Properties.total = '$unknown(amount)'; }]
59
+ ];
60
+
61
+ function candidate(): Candidate {
62
+ const compiled = compile();
63
+ const definition = compiled.definitions[0];
64
+ const operand = [...compiled.eventSchemas.get(definition)!.values()].find(entry => entry.eventType.Id === 'Added')!.schema.properties!.amount;
65
+ return { compiled, definition, schema: JSON.parse(compiled.readModels[0].Schema), operand };
66
+ }
67
+ const seeded: ScenarioEvent = {
68
+ sourceId: 'A', content: { amount: 2.5 },
69
+ context: {
70
+ eventSourceId: 'A', eventType: EventType.parse('Added+1'), sequenceNumber: 0n,
71
+ occurred: new Date('2025-01-01T00:00:00Z'), correlationId: '00000000-0000-0000-0000-000000000000',
72
+ causation: [], tags: []
73
+ }
74
+ };
75
+ for (const [name, mutate] of boundaries) {
76
+ for (const [historyName, history] of [['empty', []], ['seeded', [seeded]]] as const) {
77
+ describe(`when rejecting addition with children: ${name}, ${historyName} history`, () => {
78
+ let act: () => Promise<unknown>;
79
+ beforeEach(() => {
80
+ const value = candidate();
81
+ mutate(value);
82
+ value.compiled.readModels[0].Schema = JSON.stringify(value.schema);
83
+ act = () => new ProjectionReadModelProcessor(Totals, value.compiled, value.definition).process(history);
84
+ });
85
+ it('should reject before replay with the model and contract path', () => {
86
+ act.should.throw(UnsupportedProjectionOperation).and.satisfy((error: Error) =>
87
+ error.message.includes('Totals') && /Children|From|Join|Schema|Definition/.test(error.message));
88
+ });
89
+ });
90
+ }
91
+ }
@@ -15,7 +15,7 @@ chai.should();
15
15
  type Candidate = { compiled: ReturnType<typeof compile>; definition: ProjectionDefinition; schema: JsonSchema };
16
16
  type Mutation = (candidate: Candidate) => void;
17
17
  const boundaries: Array<[string, Mutation]> = [
18
- ...['$increment', '$decrement', '$add(total)', '$subtract(total)'].map(expression => [expression,
18
+ ...['$increment', '$decrement', '$subtract(total)'].map(expression => [expression,
19
19
  ({ definition }: Candidate) => { definition.From[0].Value.Properties.total = expression; }] as [string, Mutation]),
20
20
  ['int32 count', ({ schema }) => { schema.properties!.total = { type: 'integer', format: 'int32' }; }],
21
21
  ['float count', ({ schema }) => { schema.properties!.total = { type: 'number', format: 'float' }; }],
@@ -52,7 +52,7 @@ function candidate(): Candidate {
52
52
  const seeded: ScenarioEvent = {
53
53
  sourceId: 'A', content: { total: 9000 },
54
54
  context: {
55
- eventSourceId: 'A', eventType: new EventType('Counted', 1), sequenceNumber: 0n,
55
+ eventSourceId: 'A', eventType: EventType.parse('Counted+1'), sequenceNumber: 0n,
56
56
  occurred: new Date('2025-01-01T00:00:00Z'), correlationId: '00000000-0000-0000-0000-000000000000',
57
57
  causation: [], tags: []
58
58
  }
@@ -73,6 +73,16 @@ for (const [name, mutate] of boundaries) {
73
73
  }
74
74
  }
75
75
 
76
+ describe('when adding the unformatted same-name operand in the previously rejected count boundary', () => {
77
+ it('should admit the fixture-backed addition rather than count or assign', async () => {
78
+ const value = candidate();
79
+ value.definition.From[0].Value.Properties.total = '$add(total)';
80
+ const processor = new ProjectionReadModelProcessor(Totals, value.compiled, value.definition);
81
+ await processor.process([seeded, { ...seeded, context: { ...seeded.context, sequenceNumber: 1n } }]);
82
+ processor.publicRead.A.total.should.equal(18000);
83
+ });
84
+ });
85
+
76
86
  for (const format of [undefined, 'double']) {
77
87
  describe(`when admitting count with ${format ?? 'unformatted number'} and typed children`, () => {
78
88
  let act: () => ProjectionReadModelProcessor<Totals>;
@@ -1,15 +0,0 @@
1
- import type { JsonSchema } from '../../schemas/JsonSchema.js';
2
- /** The measured intersection of root counting and independent typed children. */
3
- export declare class ProjectionCountChildrenCapabilities {
4
- static supports(schema: JsonSchema, wire: Record<string, unknown>): boolean;
5
- private static singleCount;
6
- private static rootShape;
7
- private static exactRootMembers;
8
- private static countTarget;
9
- private static plainString;
10
- private static childShape;
11
- private static stringItems;
12
- private static independentEvents;
13
- private static noInteractions;
14
- }
15
- //# sourceMappingURL=ProjectionCountChildrenCapabilities.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ProjectionCountChildrenCapabilities.d.ts","sourceRoot":"","sources":["../../../testing/projections/ProjectionCountChildrenCapabilities.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAE9D,iFAAiF;AACjF,qBAAa,mCAAmC;IAC5C,MAAM,CAAC,QAAQ,CAAC,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAS1E;IAED,OAAO,CAAC,MAAM,CAAC,WAAW;IAM1B,OAAO,CAAC,MAAM,CAAC,SAAS;IAMxB,OAAO,CAAC,MAAM,CAAC,gBAAgB;IAM/B,OAAO,CAAC,MAAM,CAAC,WAAW;IAI1B,OAAO,CAAC,MAAM,CAAC,WAAW;IAI1B,OAAO,CAAC,MAAM,CAAC,UAAU;IAKzB,OAAO,CAAC,MAAM,CAAC,WAAW;IAM1B,OAAO,CAAC,MAAM,CAAC,iBAAiB;IAShC,OAAO,CAAC,MAAM,CAAC,cAAc;CAIhC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"ProjectionCountChildrenCapabilities.js","sourceRoot":"","sources":["../../../testing/projections/ProjectionCountChildrenCapabilities.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,qGAAqG;AAMrG,iFAAiF;AACjF,MAAM,OAAO,mCAAmC;IAC5C,MAAM,CAAC,QAAQ,CAAC,MAAkB,EAAE,IAA6B;QAC7D,MAAM,IAAI,GAAG,IAAI,CAAC,IAAoB,IAAI,EAAE,CAAC;QAC7C,MAAM,QAAQ,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,QAA8C,IAAI,EAAE,CAAC,CAAC;QAC3F,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,QAAQ,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