@cratis/chronicle 6.32.0 → 6.32.1

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.
@@ -27,16 +27,16 @@ export declare class JsonSchemaGenerator {
27
27
  private static mapRuntimeTypeToSchema;
28
28
  /**
29
29
  * Maps an array-typed member to a schema, resolving the element type from a
30
- * `@field(Array, { genericArguments: [ItemType] })` declaration when present.
30
+ * `@childrenFrom` child type or `@field(Array, { genericArguments: [ItemType] })` declaration when present.
31
31
  * @param declaringType - The class constructor that declares the array property.
32
32
  * @param propertyName - The array property name.
33
33
  * @returns The array schema, with the element's own compliance metadata carried onto `items` when the element is a PII concept.
34
34
  */
35
35
  private static mapArrayTypeToSchema;
36
36
  /**
37
- * Resolves the element type of an array property from its `@field(Array, { genericArguments: [...] })`
38
- * declaration. TypeScript erases generic type arguments at runtime, so without an explicit
39
- * `@field` declaration the element type cannot be recovered.
37
+ * Resolves the element type from an explicit `@childrenFrom` child type, then from
38
+ * `@field(Array, { genericArguments: [...] })`. TypeScript erases generic type arguments
39
+ * at runtime, so an explicit declaration is needed to recover the element type.
40
40
  * @param declaringType - The class constructor that declares the array property.
41
41
  * @param propertyName - The array property name.
42
42
  * @returns The element type constructor, or undefined when it cannot be resolved.
@@ -1 +1 @@
1
- {"version":3,"file":"JsonSchemaGenerator.d.ts","sourceRoot":"","sources":["../../schemas/JsonSchemaGenerator.ts"],"names":[],"mappings":"AAGA,OAAO,kBAAkB,CAAC;AAE1B,OAAO,EAA4B,UAAU,EAA0B,MAAM,iBAAiB,CAAC;AAW/F;;GAEG;AACH,MAAM,WAAW,2BAA2B;IACxC,gHAAgH;IAChH,QAAQ,CAAC,oBAAoB,CAAC,EAAE,OAAO,CAAC;CAC3C;AAED,qBAAa,mBAAmB;IAC5B,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,iBAAiB,CAGtC;IAEH,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,cAAc,CAEnC;IAE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;;OAYG;IACH,OAAO,CAAC,MAAM,CAAC,6BAA6B;CAK/C"}
@@ -44,7 +44,9 @@ export class JsonSchemaGenerator {
44
44
  const membersToUse = members ?? TypeIntrospector.getMembers(target);
45
45
  const schemaProperties = {};
46
46
  const prototype = target.prototype;
47
- for (const [memberName, memberType] of membersToUse.entries()) {
47
+ for (const [memberName, reflectedMemberType] of membersToUse.entries()) {
48
+ // A children collection is an array even when neither design:type nor an initializer is available.
49
+ const memberType = reflectedMemberType ?? (getChildrenFromMetadata(prototype, memberName).length > 0 ? Array : undefined);
48
50
  if (!memberType && requireResolvedTypes) {
49
51
  throw new TypeError(`Cannot determine the type of ${target.name}.${memberName}; declare @field with its runtime type.`);
50
52
  }
@@ -116,7 +118,7 @@ export class JsonSchemaGenerator {
116
118
  }
117
119
  /**
118
120
  * Maps an array-typed member to a schema, resolving the element type from a
119
- * `@field(Array, { genericArguments: [ItemType] })` declaration when present.
121
+ * `@childrenFrom` child type or `@field(Array, { genericArguments: [ItemType] })` declaration when present.
120
122
  * @param declaringType - The class constructor that declares the array property.
121
123
  * @param propertyName - The array property name.
122
124
  * @returns The array schema, with the element's own compliance metadata carried onto `items` when the element is a PII concept.
@@ -142,14 +144,27 @@ export class JsonSchemaGenerator {
142
144
  }
143
145
  return { type: 'array', items: { type: 'object' } };
144
146
  }
145
- if (!requireResolvedTypes)
146
- return { type: 'array', items: { type: 'object' } }; // Legacy schema compatibility.
147
- return { type: 'array', items: this.mapRuntimeTypeToSchema(elementType, undefined, undefined, true) };
147
+ const childrenMetadata = declaringType && propertyName ? getChildrenFromMetadata(declaringType.prototype, propertyName) : [];
148
+ if (!requireResolvedTypes && !childrenMetadata.length)
149
+ return { type: 'array', items: { type: 'object' } }; // Legacy schema compatibility outside children.
150
+ const items = this.mapRuntimeTypeToSchema(elementType, undefined, undefined, requireResolvedTypes);
151
+ if (!requireResolvedTypes && childrenMetadata.length) {
152
+ // Match buildChildrenEntry's identifier discovery, including members whose types are unresolved.
153
+ const members = [...TypeIntrospector.getMembers(elementType).keys()];
154
+ const eventKey = childrenMetadata[0]?.key;
155
+ const identifiedBy = childrenMetadata.find(metadata => metadata.identifiedBy)?.identifiedBy ??
156
+ members.find(name => name.toLowerCase() === 'id') ??
157
+ (eventKey !== undefined ? members.find(name => name.toLowerCase() === eventKey.toLowerCase()) : undefined) ?? '$eventSourceId';
158
+ if (!items.properties || !Object.hasOwn(items.properties, identifiedBy)) {
159
+ return { type: 'array', items: { type: 'object' } };
160
+ }
161
+ }
162
+ return { type: 'array', items };
148
163
  }
149
164
  /**
150
- * Resolves the element type of an array property from its `@field(Array, { genericArguments: [...] })`
151
- * declaration. TypeScript erases generic type arguments at runtime, so without an explicit
152
- * `@field` declaration the element type cannot be recovered.
165
+ * Resolves the element type from an explicit `@childrenFrom` child type, then from
166
+ * `@field(Array, { genericArguments: [...] })`. TypeScript erases generic type arguments
167
+ * at runtime, so an explicit declaration is needed to recover the element type.
153
168
  * @param declaringType - The class constructor that declares the array property.
154
169
  * @param propertyName - The array property name.
155
170
  * @returns The element type constructor, or undefined when it cannot be resolved.
@@ -1 +1 @@
1
- {"version":3,"file":"JsonSchemaGenerator.js","sourceRoot":"","sources":["../../schemas/JsonSchemaGenerator.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,qGAAqG;AAErG,OAAO,kBAAkB,CAAC;AAC1B,OAAO,EAAE,gBAAgB,EAAe,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAE9F,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAAE,uBAAuB,EAAE,MAAM,2CAA2C,CAAC;AACpF,OAAO,EAAE,sBAAsB,EAAE,MAAM,uCAAuC,CAAC;AAE/E,OAAO,EAAE,0BAA0B,EAAE,MAAM,6CAA6C,CAAC;AAEzF,OAAO,EAAE,wBAAwB,EAAE,MAAM,gD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Q,GAAG,MAAM,CAAC,QAAQ,IAAI,EAAE,CAAC;QACvC,KAAK,MAAM,IAAI,IAAI,QAAQ,EAAE,CAAC;YAC1B,MAAM,YAAY,GAAG,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC;YACxD,IAAI,CAAC,IAAI,CAAC,yBAAyB,CAAC,QAAQ,EAAE,YAAY,CAAC,EAAE,CAAC;gBAC1D,QAAQ,CAAC,IAAI,CAAC,EAAE,YAAY,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC;YAC3D,CAAC;QACL,CAAC;QAED,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACtB,MAAM,CAAC,QAAQ,GAAG,QAAQ,CAAC;QAC/B,CAAC;IACL,CAAC;IAED;;;;;OAKG;IACK,MAAM,CAAC,yBAAyB,CAAC,QAAkC,EAAE,YAAoB;QAC7F,OAAO,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,YAAY,KAAK,YAAY,CAAC,CAAC;IACrE,CAAC;IAED;;;;;;;;;;;;OAYG;IACK,MAAM,CAAC,6BAA6B,CAAC,IAAY,EAAE,kBAAwC,EAAE,gBAAoC;QACrI,IAAI,kBAAkB,CAAC,MAAM,GAAG,CAAC,IAAI,gBAAgB,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAC/D,MAAM,IAAI,mCAAmC,CAAC,IAAI,CAAC,CAAC;QACxD,CAAC;IACL,CAAC;CACJ"}
@@ -20,7 +20,8 @@ export interface ChildrenValidationContext {
20
20
  }
21
21
  /**
22
22
  * Validates one level of children collections against the packaged-kernel fixtures
23
- * (`children-from-keyed`, `children-identified-removed`, `children-untyped-items`).
23
+ * (`children-from-keyed`, `children-identified-removed`, `children-typed-items`,
24
+ * `children-untyped-items`, `children-identifier-equals-key`).
24
25
  */
25
26
  export declare class ProjectionChildrenCapabilities {
26
27
  /**
@@ -1 +1 @@
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EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,CAAC;IAC9D,QAAQ,CAAC,kBAAkB,EAAE,CAAC,SAAS,EAAE,iBAAiB,EAAE,IAAI,EAAE,MAAM,KAAK,UAAU,CAAC;IACxF,QAAQ,CAAC,YAAY,EAAE,YAAY,CAAC;IACpC,QAAQ,CAAC,MAAM,EAAE,eAAe,CAAC;CACpC;AAID;;;;GAIG;AACH,qBAAa,8BAA8B;IACvC;;;;OAIG;IACH,MAAM,CAAC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,sBAAsB,CAAC,EAAE,OAAO,EAAE,yBAAyB,GAAG,IAAI,CAmF1G;CACJ"}
@@ -5,7 +5,8 @@ import { eventContractPath } from '../../projections/eventContractPath.js';
5
5
  const kernelBacked = 'require a kernel-backed test (ChronicleKernelScenario / live kernel)';
6
6
  /**
7
7
  * Validates one level of children collections against the packaged-kernel fixtures
8
- * (`children-from-keyed`, `children-identified-removed`, `children-untyped-items`).
8
+ * (`children-from-keyed`, `children-identified-removed`, `children-typed-items`,
9
+ * `children-untyped-items`, `children-identifier-equals-key`).
9
10
  */
10
11
  export class ProjectionChildrenCapabilities {
11
12
  /**
@@ -95,8 +96,13 @@ export class ProjectionChildrenCapabilities {
95
96
  if (!candidates.length)
96
97
  continue;
97
98
  const mappingPath = `${path}.AutoMap.${destination}`;
98
- if (destination === identifiedBy)
99
- reject(mappingPath, `AutoMap into the child identifier ${kernelBacked}`);
99
+ if (destination === identifiedBy) {
100
+ if (candidates.length !== 1 || candidates[0] !== entry.Value.Key) {
101
+ reject(mappingPath, `AutoMap into the child identifier ${kernelBacked}`);
102
+ }
103
+ // Changeset.AddChild initializes the identifier from this same key.
104
+ continue;
105
+ }
100
106
  if (candidates.length > 1)
101
107
  reject(mappingPath, `inferred AutoMap source is ambiguous: ${candidates.join(', ')}`);
102
108
  context.checkMapping(items, eventSchema, destination, candidates[0], mappingPath);
@@ -1 +1 @@
1
- {"version":3,"file":"Projection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GAAG,GAAG,IAAI,YAAY,WAAW,EAAE,CAAC;oBACrD,IAAI,WAAW,KAAK,YAAY;wBAAE,MAAM,CAAC,WAAW,EAAE,qCAAqC,YAAY,EAAE,CAAC,CAAC;oBAC3G,IAAI,UAAU,CAAC,MAAM,GAAG,CAAC;wBAAE,MAAM,CAAC,WAAW,EAAE,yCAAyC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;oBACjH,OAAO,CAAC,YAAY,CAAC,KAAM,EAAE,WAAW,EAAE,WAAW,EAAE,UAAU,CAAC,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC;gBACvF,CAAC;YACL,CAAC;QACL,CAAC;IACL,CAAC;CACJ"}
1
+ {"version":3,"file":"ProjectionChildrenCapabilities.js","sourceRoot":"","sources":["../../../testing/projections/ProjectionChildrenCapabilities.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,qGAAqG;AAErG,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAC;AAwB3E,MAAM,YAAY,GAAG,sEAAsE,CAAC;AAE5F;;;;GAIG;AACH,MAAM,OAAO,8BAA8B;IACvC;;;;OAIG;IACH,MAAM,CAAC,QAAQ,CAAC,QAAgD,EAAE,OAAkC;QAChG,IAAI,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,MAAM,IAAI,OAAO,CAAC,oBAAoB,EAAE,CAAC;YAC/D,OAAO,CAAC,MAAM,CAAC,mBAAmB,EAAE,qCAAqC,YAAY,EAAE,CAAC,CAAC;QAC7F,CAAC;QACD,MAAM,MAAM,GAAG,IAAI,GAAG,EAAkB,CAAC;QACzC,KAAK,MAAM,CAAC,QAAQ,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC;YACvD,MAAM,IAAI,GAAG,YAAY,QAAQ,EAAE,CAAC;YACpC,MAAM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AC,UAAU,IAAI,EAAE,CAAC,EAAE,CAAC;oBAC7D,IAAI,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,WAAW,EAAE,KAAK,WAAW,CAAC,WAAW,EAAE,CAAC;wBAAE,SAAS;oBACrG,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,UAAU,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,WAAW,EAAE,KAAK,WAAW,CAAC,WAAW,EAAE,CAAC,CAAC;oBAClI,IAAI,CAAC,UAAU,CAAC,MAAM;wBAAE,SAAS;oBACjC,MAAM,WAAW,GAAG,GAAG,IAAI,YAAY,WAAW,EAAE,CAAC;oBACrD,IAAI,WAAW,KAAK,YAAY,EAAE,CAAC;wBAC/B,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC,IAAI,UAAU,CAAC,CAAC,CAAC,KAAK,KAAK,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC;4BAC/D,MAAM,CAAC,WAAW,EAAE,qCAAqC,YAAY,EAAE,CAAC,CAAC;wBAC7E,CAAC;wBACD,oEAAoE;wBACpE,SAAS;oBACb,CAAC;oBACD,IAAI,UAAU,CAAC,MAAM,GAAG,CAAC;wBAAE,MAAM,CAAC,WAAW,EAAE,yCAAyC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;oBACjH,OAAO,CAAC,YAAY,CAAC,KAAM,EAAE,WAAW,EAAE,WAAW,EAAE,UAAU,CAAC,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC;gBACvF,CAAC;YACL,CAAC;QACL,CAAC;IACL,CAAC;CACJ"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cratis/chronicle",
3
- "version": "6.32.0",
3
+ "version": "6.32.1",
4
4
  "description": "Event sourcing for TypeScript and Node.js — the idiomatic client for Cratis Chronicle, the open-source event-sourcing database",
5
5
  "author": "Cratis",
6
6
  "license": "MIT",
@@ -168,7 +168,7 @@
168
168
  "clean": "rm -rf dist",
169
169
  "test": "vitest run",
170
170
  "test:integration": "vitest run --config vitest.integration.config.ts",
171
- "test:standard-types": "tsc --ignoreConfig --noEmit --target es2022 --module es2022 --moduleResolution bundler --lib es2022,esnext.decorators --types node --skipLibCheck --strict schemas/decorators.standard.spec.ts projections/declarative/addChildCompatibility.standard.spec.ts projections/modelBound/decorators.standard.spec.ts events/classDecorators.standard.spec.ts reactors/decorators.standard.spec.ts readModels/standardFallbacks.standard.spec.ts readModels/registration.standard.spec.ts for_ChronicleClient/when_registering_artifacts/with_standard_property_mappings.standard.spec.ts artifacts/validateArtifactSchemas.spec.ts testing/for_EventScenario/when_appending_concept_fields/with_standard_decorators.standard.spec.ts testing/for_EventScenario/when_appending_scoped_constraints/with_standard_decorators.standard.spec.ts",
171
+ "test:standard-types": "tsc --ignoreConfig --noEmit --target es2022 --module es2022 --moduleResolution bundler --lib es2022,esnext.decorators --types node --skipLibCheck --strict schemas/decorators.standard.spec.ts projections/declarative/addChildCompatibility.standard.spec.ts projections/modelBound/decorators.standard.spec.ts events/classDecorators.standard.spec.ts reactors/decorators.standard.spec.ts readModels/standardFallbacks.standard.spec.ts readModels/registration.standard.spec.ts for_ChronicleClient/when_registering_artifacts/with_standard_property_mappings.standard.spec.ts artifacts/validateArtifactSchemas.spec.ts testing/for_EventScenario/when_appending_concept_fields/with_standard_decorators.standard.spec.ts testing/for_EventScenario/when_appending_scoped_constraints/with_standard_decorators.standard.spec.ts schemas/for_JsonSchemaGenerator/when_generating_children/with_standard_decorators.standard.spec.ts",
172
172
  "test:native": "node ./scripts/check-native-esm.mjs"
173
173
  },
174
174
  "dependencies": {
@@ -61,7 +61,9 @@ export class JsonSchemaGenerator {
61
61
  const schemaProperties: Record<string, JsonSchema> = {};
62
62
  const prototype = target.prototype;
63
63
 
64
- for (const [memberName, memberType] of membersToUse.entries()) {
64
+ for (const [memberName, reflectedMemberType] of membersToUse.entries()) {
65
+ // A children collection is an array even when neither design:type nor an initializer is available.
66
+ const memberType = reflectedMemberType ?? (getChildrenFromMetadata(prototype, memberName).length > 0 ? Array : undefined);
65
67
  if (!memberType && requireResolvedTypes) {
66
68
  throw new TypeError(`Cannot determine the type of ${target.name}.${memberName}; declare @field with its runtime type.`);
67
69
  }
@@ -144,7 +146,7 @@ export class JsonSchemaGenerator {
144
146
 
145
147
  /**
146
148
  * Maps an array-typed member to a schema, resolving the element type from a
147
- * `@field(Array, { genericArguments: [ItemType] })` declaration when present.
149
+ * `@childrenFrom` child type or `@field(Array, { genericArguments: [ItemType] })` declaration when present.
148
150
  * @param declaringType - The class constructor that declares the array property.
149
151
  * @param propertyName - The array property name.
150
152
  * @returns The array schema, with the element's own compliance metadata carried onto `items` when the element is a PII concept.
@@ -173,14 +175,27 @@ export class JsonSchemaGenerator {
173
175
  return { type: 'array', items: { type: 'object' } };
174
176
  }
175
177
 
176
- if (!requireResolvedTypes) return { type: 'array', items: { type: 'object' } }; // Legacy schema compatibility.
177
- return { type: 'array', items: this.mapRuntimeTypeToSchema(elementType, undefined, undefined, true) };
178
+ const childrenMetadata = declaringType && propertyName ? getChildrenFromMetadata(declaringType.prototype, propertyName) : [];
179
+ if (!requireResolvedTypes && !childrenMetadata.length) return { type: 'array', items: { type: 'object' } }; // Legacy schema compatibility outside children.
180
+ const items = this.mapRuntimeTypeToSchema(elementType, undefined, undefined, requireResolvedTypes);
181
+ if (!requireResolvedTypes && childrenMetadata.length) {
182
+ // Match buildChildrenEntry's identifier discovery, including members whose types are unresolved.
183
+ const members = [...TypeIntrospector.getMembers(elementType).keys()];
184
+ const eventKey = childrenMetadata[0]?.key;
185
+ const identifiedBy = childrenMetadata.find(metadata => metadata.identifiedBy)?.identifiedBy ??
186
+ members.find(name => name.toLowerCase() === 'id') ??
187
+ (eventKey !== undefined ? members.find(name => name.toLowerCase() === eventKey.toLowerCase()) : undefined) ?? '$eventSourceId';
188
+ if (!items.properties || !Object.hasOwn(items.properties, identifiedBy)) {
189
+ return { type: 'array', items: { type: 'object' } };
190
+ }
191
+ }
192
+ return { type: 'array', items };
178
193
  }
179
194
 
180
195
  /**
181
- * Resolves the element type of an array property from its `@field(Array, { genericArguments: [...] })`
182
- * declaration. TypeScript erases generic type arguments at runtime, so without an explicit
183
- * `@field` declaration the element type cannot be recovered.
196
+ * Resolves the element type from an explicit `@childrenFrom` child type, then from
197
+ * `@field(Array, { genericArguments: [...] })`. TypeScript erases generic type arguments
198
+ * at runtime, so an explicit declaration is needed to recover the element type.
184
199
  * @param declaringType - The class constructor that declares the array property.
185
200
  * @param propertyName - The array property name.
186
201
  * @returns The element type constructor, or undefined when it cannot be resolved.
@@ -0,0 +1,143 @@
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 'reflect-metadata';
5
+ import { field } from '@cratis/fundamentals';
6
+ import { chai, describe, it } from 'vitest';
7
+ import { childrenFrom } from '../../../projections/modelBound/childrenFrom.js';
8
+ import { JsonSchemaGenerator } from '../../JsonSchemaGenerator.js';
9
+
10
+ chai.should();
11
+
12
+ class ItemAdded {
13
+ itemId = '';
14
+ name = '';
15
+ }
16
+
17
+ class Item {
18
+ id = '';
19
+ name = '';
20
+ quantity = 0;
21
+ }
22
+
23
+ class Order {
24
+ @childrenFrom(ItemAdded, { childType: Item, key: 'itemId' })
25
+ options: Item[] = [];
26
+
27
+ @childrenFrom(ItemAdded, Item)
28
+ positional: Item[] = [];
29
+
30
+ @childrenFrom(ItemAdded, { childType: Item, key: 'itemId' })
31
+ withoutInitializer!: Item[];
32
+
33
+ @field(Array, { genericArguments: [Item] })
34
+ @childrenFrom(ItemAdded, 'itemId')
35
+ fieldMetadata: Item[] = [];
36
+
37
+ @childrenFrom(ItemAdded, { key: 'itemId', identifiedBy: 'id' })
38
+ unknown: Item[] = [];
39
+
40
+ @field(Array, { genericArguments: [Item] })
41
+ unrelated: Item[] = [];
42
+ }
43
+
44
+ class DeclaredItem {
45
+ @field(String) id!: string;
46
+ @field(String) name!: string;
47
+ }
48
+
49
+ class DeclaredOrder {
50
+ @childrenFrom(ItemAdded, { childType: DeclaredItem, key: 'itemId' })
51
+ items!: DeclaredItem[];
52
+ }
53
+
54
+ class UnresolvedItem {
55
+ id!: string;
56
+ name!: string;
57
+ }
58
+
59
+ class PartiallyResolvedItem {
60
+ id = '';
61
+ name!: string;
62
+ }
63
+
64
+ class MissingIdentifierItem {
65
+ id!: string;
66
+ name = '';
67
+ }
68
+
69
+ class CustomIdentifierItem {
70
+ itemId = '';
71
+ name!: string;
72
+ }
73
+
74
+ class CapitalizedIdentifierItem {
75
+ Id = '';
76
+ name!: string;
77
+ }
78
+
79
+ class FallbackOrder {
80
+ @childrenFrom(ItemAdded, { childType: UnresolvedItem, key: 'itemId', identifiedBy: 'id' })
81
+ unresolved!: UnresolvedItem[];
82
+
83
+ @childrenFrom(ItemAdded, { childType: MissingIdentifierItem, key: 'itemId', identifiedBy: 'id' })
84
+ missingIdentifier!: MissingIdentifierItem[];
85
+
86
+ @childrenFrom(ItemAdded, { childType: PartiallyResolvedItem, key: 'itemId' })
87
+ partial!: PartiallyResolvedItem[];
88
+
89
+ @childrenFrom(ItemAdded, { childType: CustomIdentifierItem, key: 'itemId' })
90
+ custom!: CustomIdentifierItem[];
91
+
92
+ @childrenFrom(ItemAdded, { childType: CapitalizedIdentifierItem, key: 'itemId' })
93
+ capitalized!: CapitalizedIdentifierItem[];
94
+
95
+ @childrenFrom(ItemAdded, { childType: MissingIdentifierItem, key: 'itemId' })
96
+ undiscoverableIdentifier!: MissingIdentifierItem[];
97
+ }
98
+
99
+ const schema = JsonSchemaGenerator.generate(Order);
100
+
101
+ describe('for JsonSchemaGenerator', () => {
102
+ describe('when generating children with legacy decorators without design metadata', () => {
103
+ for (const property of ['options', 'positional', 'withoutInitializer', 'fieldMetadata']) {
104
+ it(`should register typed items for ${property}`, () => {
105
+ chai.should().not.exist(Reflect.getMetadata('design:type', Order.prototype, property));
106
+ schema.properties![property].should.deep.equal({ type: 'array', items: JsonSchemaGenerator.generate(Item) });
107
+ schema.properties![property].items!.properties!.should.deep.equal({
108
+ id: { type: 'string' }, name: { type: 'string' }, quantity: { type: 'number' }
109
+ });
110
+ });
111
+ }
112
+
113
+ it('should resolve child properties from explicit field metadata without initializers', () => {
114
+ JsonSchemaGenerator.generate(DeclaredOrder).properties!.items.items!.properties!.should.deep.equal({
115
+ id: { type: 'string' }, name: { type: 'string' }
116
+ });
117
+ });
118
+
119
+ it('should retain untyped items when the child type is unknown', () => {
120
+ schema.properties!.unknown.should.deep.equal({ type: 'array', items: { type: 'object' } });
121
+ });
122
+
123
+ it('should retain untyped items for child members declared only with definite assignment', () => {
124
+ JsonSchemaGenerator.generate(FallbackOrder).properties!.unresolved.should.deep.equal({ type: 'array', items: { type: 'object' } });
125
+ });
126
+
127
+ for (const property of ['missingIdentifier', 'undiscoverableIdentifier']) {
128
+ it(`should retain untyped items for ${property} despite a resolved non-identifier property`, () => {
129
+ JsonSchemaGenerator.generate(FallbackOrder).properties![property].should.deep.equal({ type: 'array', items: { type: 'object' } });
130
+ });
131
+ }
132
+
133
+ for (const [property, childType] of [['partial', PartiallyResolvedItem], ['custom', CustomIdentifierItem], ['capitalized', CapitalizedIdentifierItem]] as const) {
134
+ it(`should retain typed items for ${property} with a resolved identifier`, () => {
135
+ JsonSchemaGenerator.generate(FallbackOrder).properties![property].should.deep.equal({ type: 'array', items: JsonSchemaGenerator.generate(childType) });
136
+ });
137
+ }
138
+
139
+ it('should preserve legacy array schemas outside children collections', () => {
140
+ schema.properties!.unrelated.should.deep.equal({ type: 'array', items: { type: 'object' } });
141
+ });
142
+ });
143
+ });
@@ -0,0 +1,66 @@
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 { field } from '@cratis/fundamentals';
5
+ import { chai, describe, it } from 'vitest';
6
+ import { childrenFrom } from '../../../projections/modelBound/childrenFrom.js';
7
+ import { JsonSchemaGenerator } from '../../JsonSchemaGenerator.js';
8
+
9
+ chai.should();
10
+
11
+ function should(value: unknown): ReturnType<typeof chai.expect> {
12
+ return (value as { should: ReturnType<typeof chai.expect> }).should;
13
+ }
14
+
15
+ class ItemAdded {
16
+ @field(String) itemId!: string;
17
+ @field(String) name!: string;
18
+ }
19
+
20
+ class Item {
21
+ @field(String) id!: string;
22
+ @field(String) name!: string;
23
+ @field(Number) quantity!: number;
24
+ }
25
+
26
+ class Order {
27
+ @field(Array)
28
+ @childrenFrom(ItemAdded, { childType: Item, key: 'itemId' })
29
+ options!: Item[];
30
+
31
+ @field(Array)
32
+ @childrenFrom(ItemAdded, Item)
33
+ positional!: Item[];
34
+
35
+ @childrenFrom(ItemAdded, { childType: Item, key: 'itemId' })
36
+ withoutField!: Item[];
37
+
38
+ @field(Array, { genericArguments: [Item] })
39
+ @childrenFrom(ItemAdded, 'itemId')
40
+ fieldMetadata!: Item[];
41
+ }
42
+
43
+ class UnknownOrder {
44
+ @field(Array)
45
+ @childrenFrom(ItemAdded, { key: 'itemId', identifiedBy: 'id' })
46
+ items!: Item[];
47
+ }
48
+
49
+ const schema = JsonSchemaGenerator.generate(Order);
50
+
51
+ describe('for JsonSchemaGenerator', () => {
52
+ describe('when generating children with standard decorators', () => {
53
+ for (const property of ['options', 'positional', 'withoutField', 'fieldMetadata']) {
54
+ it(`should register typed items for ${property}`, () => {
55
+ should(schema.properties![property]).deep.equal({ type: 'array', items: JsonSchemaGenerator.generate(Item) });
56
+ should(schema.properties![property].items!.properties!).deep.equal({
57
+ id: { type: 'string' }, name: { type: 'string' }, quantity: { type: 'number' }
58
+ });
59
+ });
60
+ }
61
+
62
+ it('should still reject an unresolved child type', () => {
63
+ should(() => JsonSchemaGenerator.generate(UnknownOrder)).throw(TypeError, 'Cannot determine the element type of UnknownOrder.items');
64
+ });
65
+ });
66
+ });
@@ -1,11 +1,13 @@
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 { readFileSync } from 'node:fs';
4
5
  import { chai, describe, it } from 'vitest';
5
6
  import { eventType } from '../events/eventTypeDecorator.js';
6
7
  import { childrenFrom } from '../projections/modelBound/childrenFrom.js';
7
8
  import { fromEvent } from '../projections/modelBound/fromEvent.js';
8
9
  import { setFrom } from '../projections/modelBound/setFrom.js';
10
+ import { JsonSchemaGenerator } from '../schemas/JsonSchemaGenerator.js';
9
11
  import { ReadModelScenario, UnsupportedProjectionOperation } from './index.js';
10
12
 
11
13
  chai.should();
@@ -27,6 +29,18 @@ class ScenarioOrder {
27
29
  childrenFrom(ScenarioItemAdded, { childType: ScenarioItem, key: 'itemId' })(ScenarioOrder.prototype, 'items');
28
30
  fromEvent(ScenarioItemAdded)(ScenarioOrder);
29
31
 
32
+ class ScenarioKeyedItem {
33
+ itemId = '';
34
+ name = '';
35
+ }
36
+
37
+ class ScenarioKeyedOrder {
38
+ id = '';
39
+ items: ScenarioKeyedItem[] = [];
40
+ }
41
+ childrenFrom(ScenarioItemAdded, { childType: ScenarioKeyedItem, key: 'itemId' })(ScenarioKeyedOrder.prototype, 'items');
42
+ fromEvent(ScenarioItemAdded)(ScenarioKeyedOrder);
43
+
30
44
  class ScenarioNamedItem {
31
45
  id = '';
32
46
  name = '';
@@ -40,17 +54,70 @@ class ScenarioNamedOrder {
40
54
  childrenFrom(ScenarioItemAdded, { childType: ScenarioNamedItem, key: 'itemId' })(ScenarioNamedOrder.prototype, 'items');
41
55
  fromEvent(ScenarioItemAdded)(ScenarioNamedOrder);
42
56
 
57
+ class ScenarioUnknownOrder {
58
+ id = '';
59
+ items: ScenarioItem[] = [];
60
+ }
61
+ childrenFrom(ScenarioItemAdded, { key: 'itemId', identifiedBy: 'id' })(ScenarioUnknownOrder.prototype, 'items');
62
+ fromEvent(ScenarioItemAdded)(ScenarioUnknownOrder);
63
+
64
+ class ScenarioUnresolvedItem {
65
+ id!: string;
66
+ name!: string;
67
+ }
68
+
69
+ class ScenarioUnresolvedOrder {
70
+ id = '';
71
+ items: ScenarioUnresolvedItem[] = [];
72
+ }
73
+ childrenFrom(ScenarioItemAdded, { childType: ScenarioUnresolvedItem, key: 'itemId', identifiedBy: 'id' })(ScenarioUnresolvedOrder.prototype, 'items');
74
+ fromEvent(ScenarioItemAdded)(ScenarioUnresolvedOrder);
75
+
43
76
  const artifacts = { eventTypes: [ScenarioItemAdded], reducers: [], projections: [] };
44
77
 
45
78
  describe('when a read model scenario evaluates keyed children from the options form', () => {
46
- it('should add one child per key and update an existing child in place (children-untyped-items)', async () => {
79
+ it('should add one child per key and update an existing child in place (children-typed-items)', async () => {
47
80
  const scenario = new ReadModelScenario(ScenarioOrder, artifacts);
48
81
  scenario.given.forEventSource('order-1').events(
49
82
  new ScenarioItemAdded('a', 'first'), new ScenarioItemAdded('b', 'second'), new ScenarioItemAdded('a', 'again'));
50
83
  const order = await scenario.instanceForEventSourceId('order-1');
51
84
  order!.id.should.equal('order-1');
52
- // The kernel's AutoMap is schema-driven, and legacy decorators register an untyped child item schema.
53
- order!.items.map(item => ({ id: item.id, name: item.name })).should.deep.equal([{ id: 'a', name: '' }, { id: 'b', name: '' }]);
85
+ // The explicit child type registers a typed item schema, so AutoMap preserves the event's name.
86
+ order!.items.map(item => ({ id: item.id, name: item.name })).should.deep.equal([{ id: 'a', name: 'again' }, { id: 'b', name: 'second' }]);
87
+ });
88
+
89
+ it('should register the same typed items schema as the oracle fixture', () => {
90
+ const fixture = JSON.parse(readFileSync(new URL('./projections/fixtures/children-typed-items.json', import.meta.url), 'utf8'));
91
+ JsonSchemaGenerator.generate(ScenarioOrder).properties!.items.should.deep.equal(fixture.readModel.schema.properties.items);
92
+ });
93
+
94
+ it('should add and update typed legacy children whose discovered identifier equals the event key (children-identifier-equals-key)', async () => {
95
+ const fixture = JSON.parse(readFileSync(new URL('./projections/fixtures/children-identifier-equals-key.json', import.meta.url), 'utf8'));
96
+ JsonSchemaGenerator.generate(ScenarioKeyedOrder).properties!.items.should.deep.equal(fixture.readModel.schema.properties.items);
97
+ const scenario = new ReadModelScenario(ScenarioKeyedOrder, artifacts);
98
+ for (let step = 0; step < 3; step++) {
99
+ const { itemId, name } = fixture.events[step].content;
100
+ scenario.given.forEventSource('order-1').events(new ScenarioItemAdded(itemId, name));
101
+ const order = await scenario.instanceForEventSourceId('order-1');
102
+ order!.should.deep.equal(fixture.expected[step].publicRead['order-1']);
103
+ }
104
+ });
105
+
106
+ it('should retain only the identifier when the child type is unknown (children-untyped-items)', async () => {
107
+ const scenario = new ReadModelScenario(ScenarioUnknownOrder, artifacts);
108
+ scenario.given.forEventSource('order-1').events(new ScenarioItemAdded('a', 'first'));
109
+ const order = await scenario.instanceForEventSourceId('order-1');
110
+ order!.items.should.deep.equal([{ id: 'a' }]);
111
+ });
112
+
113
+ it('should retain only the identifier when the declared child members have no runtime types (children-untyped-items)', async () => {
114
+ const fixture = JSON.parse(readFileSync(new URL('./projections/fixtures/children-untyped-items.json', import.meta.url), 'utf8'));
115
+ JsonSchemaGenerator.generate(ScenarioUnresolvedOrder).properties!.items.should.deep.equal(fixture.readModel.schema.properties.items);
116
+ const scenario = new ReadModelScenario(ScenarioUnresolvedOrder, artifacts);
117
+ scenario.given.forEventSource('order-1').events(
118
+ new ScenarioItemAdded('a', 'first'), new ScenarioItemAdded('b', 'second'), new ScenarioItemAdded('a', 'again'));
119
+ const order = await scenario.instanceForEventSourceId('order-1');
120
+ order!.items.map(item => ({ id: item.id, name: item.name })).should.deep.equal([{ id: 'a', name: undefined }, { id: 'b', name: undefined }]);
54
121
  });
55
122
 
56
123
  it('should reject explicit child property mappings', () => {
@@ -30,7 +30,8 @@ const kernelBacked = 'require a kernel-backed test (ChronicleKernelScenario / li
30
30
 
31
31
  /**
32
32
  * Validates one level of children collections against the packaged-kernel fixtures
33
- * (`children-from-keyed`, `children-identified-removed`, `children-untyped-items`).
33
+ * (`children-from-keyed`, `children-identified-removed`, `children-typed-items`,
34
+ * `children-untyped-items`, `children-identifier-equals-key`).
34
35
  */
35
36
  export class ProjectionChildrenCapabilities {
36
37
  /**
@@ -109,7 +110,13 @@ export class ProjectionChildrenCapabilities {
109
110
  const candidates = Object.keys(eventSchema.properties ?? {}).filter(source => source.toLowerCase() === destination.toLowerCase());
110
111
  if (!candidates.length) continue;
111
112
  const mappingPath = `${path}.AutoMap.${destination}`;
112
- if (destination === identifiedBy) reject(mappingPath, `AutoMap into the child identifier ${kernelBacked}`);
113
+ if (destination === identifiedBy) {
114
+ if (candidates.length !== 1 || candidates[0] !== entry.Value.Key) {
115
+ reject(mappingPath, `AutoMap into the child identifier ${kernelBacked}`);
116
+ }
117
+ // Changeset.AddChild initializes the identifier from this same key.
118
+ continue;
119
+ }
113
120
  if (candidates.length > 1) reject(mappingPath, `inferred AutoMap source is ambiguous: ${candidates.join(', ')}`);
114
121
  context.checkMapping(items!, eventSchema, destination, candidates[0], mappingPath);
115
122
  }
@@ -8,6 +8,7 @@ import { chai, describe, it } from 'vitest';
8
8
  import { eventType } from '../../../events/eventTypeDecorator.js';
9
9
  import type { ChildrenDefinitionLike } from '../../../projections/modelBound/childrenAndNestedBuilder.js';
10
10
  import { childrenFrom } from '../../../projections/modelBound/childrenFrom.js';
11
+ import type { JsonSchema } from '../../../schemas/JsonSchema.js';
11
12
  import { ProjectionCapabilities } from '../ProjectionCapabilities.js';
12
13
  import { UnsupportedProjectionOperation } from '../UnsupportedProjectionOperation.js';
13
14
  import { Changed } from './given/Changed.js';
@@ -32,12 +33,45 @@ function compileChildren() {
32
33
  return { ...result, wire, child: wire.Children.labels };
33
34
  }
34
35
 
36
+ function compileTypedChildren() {
37
+ const result = compileChildren();
38
+ result.child.IdentifiedBy = 'itemId';
39
+ result.child.From[0].Value.Properties = {};
40
+ const schema = JSON.parse(result.compiled.readModels[0].Schema) as JsonSchema;
41
+ schema.properties!.labels.items = {
42
+ type: 'object', properties: { itemId: { type: 'string' }, name: { type: 'string' } }
43
+ };
44
+ result.compiled.readModels[0].Schema = JSON.stringify(schema);
45
+ return result;
46
+ }
47
+
35
48
  describe('when rejecting unsupported children operations before any event is seeded', () => {
36
49
  it('should accept the fixture-backed keyed children shape', () => {
37
50
  const { compiled, definition } = compileChildren();
38
51
  (() => ProjectionCapabilities.validate(compiled, definition)).should.not.throw();
39
52
  });
40
53
 
54
+ it('should accept AutoMap into a typed child identifier from the entry key alone', () => {
55
+ const { compiled, definition } = compileTypedChildren();
56
+ (() => ProjectionCapabilities.validate(compiled, definition)).should.not.throw();
57
+ });
58
+
59
+ it('should reject AutoMap into a typed child identifier from a property other than the entry key', () => {
60
+ const { compiled, definition, child } = compileTypedChildren();
61
+ child.From[0].Value.Key = 'name';
62
+ (() => ProjectionCapabilities.validate(compiled, definition)).should.throw(UnsupportedProjectionOperation)
63
+ .with.property('message').that.includes('Children.labels.From[capability-child-added:1].AutoMap.itemId')
64
+ .and.includes('AutoMap into the child identifier');
65
+ });
66
+
67
+ it('should reject ambiguous AutoMap into a typed child identifier even if one candidate is the entry key', () => {
68
+ const { compiled, definition } = compileTypedChildren();
69
+ compiled.eventSchemas.get(definition)!.get('capability-child-added:1:0')!.schema.properties!.ItemId = { type: 'string' };
70
+ (() => ProjectionCapabilities.validate(compiled, definition)).should.throw(UnsupportedProjectionOperation)
71
+ .with.property('message').that.includes('Children.labels.From[capability-child-added:1].AutoMap.itemId')
72
+ .and.includes('AutoMap into the child identifier');
73
+ });
74
+
41
75
  const cases: Array<{ name: string; change: (child: ChildrenDefinitionLike, wire: Wire) => void; path: string; reason: string }> = [
42
76
  { name: 'a join inside children', change: child => { child.Join = [{}]; }, path: 'Children.labels.Join', reason: 'joins require a kernel-backed test' },
43
77
  { name: 'nested children collections', change: child => { child.Children = { inner: child }; }, path: 'Children.labels.Children', reason: 'nested children collections' },