@api-client/core 0.19.30 → 0.19.32

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 (55) hide show
  1. package/build/src/modeling/ApiModel.d.ts.map +1 -1
  2. package/build/src/modeling/ApiModel.js +0 -8
  3. package/build/src/modeling/ApiModel.js.map +1 -1
  4. package/build/src/modeling/DomainAssociation.d.ts +4 -4
  5. package/build/src/modeling/DomainAssociation.d.ts.map +1 -1
  6. package/build/src/modeling/DomainAssociation.js.map +1 -1
  7. package/build/src/modeling/RuntimeApiModel.d.ts +16 -0
  8. package/build/src/modeling/RuntimeApiModel.d.ts.map +1 -1
  9. package/build/src/modeling/RuntimeApiModel.js +31 -0
  10. package/build/src/modeling/RuntimeApiModel.js.map +1 -1
  11. package/build/src/modeling/ai/domain_response_schema.d.ts +4 -2
  12. package/build/src/modeling/ai/domain_response_schema.d.ts.map +1 -1
  13. package/build/src/modeling/ai/domain_response_schema.js +1 -1
  14. package/build/src/modeling/ai/domain_response_schema.js.map +1 -1
  15. package/build/src/modeling/ai/types.d.ts +2 -3
  16. package/build/src/modeling/ai/types.d.ts.map +1 -1
  17. package/build/src/modeling/ai/types.js.map +1 -1
  18. package/build/src/modeling/amf/ShapeGenerator.js +1 -1
  19. package/build/src/modeling/amf/ShapeGenerator.js.map +1 -1
  20. package/build/src/modeling/generators/oas_312/OasGenerator.js +1 -1
  21. package/build/src/modeling/generators/oas_312/OasGenerator.js.map +1 -1
  22. package/build/src/modeling/generators/oas_312/OasSchemaGenerator.js +3 -3
  23. package/build/src/modeling/generators/oas_312/OasSchemaGenerator.js.map +1 -1
  24. package/build/src/modeling/generators/oas_320/OasSchemaGenerator.js +3 -3
  25. package/build/src/modeling/generators/oas_320/OasSchemaGenerator.js.map +1 -1
  26. package/build/src/modeling/types.d.ts +55 -15
  27. package/build/src/modeling/types.d.ts.map +1 -1
  28. package/build/src/modeling/types.js.map +1 -1
  29. package/build/src/modeling/validation/api_model_rules.d.ts.map +1 -1
  30. package/build/src/modeling/validation/api_model_rules.js +49 -46
  31. package/build/src/modeling/validation/api_model_rules.js.map +1 -1
  32. package/build/tsconfig.tsbuildinfo +1 -1
  33. package/package.json +1 -1
  34. package/src/modeling/ApiModel.ts +0 -10
  35. package/src/modeling/DomainAssociation.ts +4 -4
  36. package/src/modeling/RuntimeApiModel.ts +46 -0
  37. package/src/modeling/ai/domain_response_schema.ts +1 -1
  38. package/src/modeling/ai/types.ts +2 -3
  39. package/src/modeling/amf/ShapeGenerator.ts +1 -1
  40. package/src/modeling/generators/oas_312/OasGenerator.ts +1 -1
  41. package/src/modeling/generators/oas_312/OasSchemaGenerator.ts +3 -3
  42. package/src/modeling/generators/oas_320/OasSchemaGenerator.ts +3 -3
  43. package/src/modeling/readme.md +2 -2
  44. package/src/modeling/types.ts +56 -15
  45. package/src/modeling/validation/api_model_rules.ts +50 -48
  46. package/src/modeling/validation/api_model_validation_rules.md +2 -2
  47. package/tests/unit/modeling/RuntimeApiModel.spec.ts +31 -0
  48. package/tests/unit/modeling/amf/shape_generator.spec.ts +32 -14
  49. package/tests/unit/modeling/api_model.spec.ts +6 -6
  50. package/tests/unit/modeling/data_domain_change_observers.spec.ts +1 -1
  51. package/tests/unit/modeling/domain_asociation.spec.ts +18 -18
  52. package/tests/unit/modeling/domain_entity_example_generator_json.spec.ts +68 -23
  53. package/tests/unit/modeling/domain_entity_example_generator_xml.spec.ts +32 -9
  54. package/tests/unit/modeling/generators/OasGenerator.spec.ts +3 -5
  55. package/tests/unit/modeling/validation/api_model_rules.spec.ts +12 -12
@@ -310,8 +310,9 @@ export declare const DOMAIN_SCHEMA: {
310
310
  schema: {
311
311
  type: Type;
312
312
  properties: {
313
- linked: {
313
+ embedded: {
314
314
  type: Type;
315
+ description: string;
315
316
  };
316
317
  unionType: {
317
318
  type: Type;
@@ -772,8 +773,9 @@ export declare const DOMAIN_SCHEMA: {
772
773
  schema: {
773
774
  type: Type;
774
775
  properties: {
775
- linked: {
776
+ embedded: {
776
777
  type: Type;
778
+ description: string;
777
779
  };
778
780
  unionType: {
779
781
  type: Type;
@@ -1 +1 @@
1
- {"version":3,"file":"domain_response_schema.d.ts","sourceRoot":"","sources":["../../../../src/modeling/ai/domain_response_schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAA;AA0NjC;;GAEG;AACH,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+FzB,CAAA"}
@@ -87,7 +87,7 @@ const PropertySchema = {
87
87
  const AssociationSchemaShape = {
88
88
  type: Type.OBJECT,
89
89
  properties: {
90
- linked: { type: Type.BOOLEAN },
90
+ embedded: { type: Type.BOOLEAN, description: 'Whether the association should be embedded in the target entity' },
91
91
  unionType: { type: Type.STRING, description: 'Enum: allOf, anyOf, oneOf, not' },
92
92
  },
93
93
  };
@@ -1 +1 @@
1
- {"version":3,"file":"domain_response_schema.js","sourceRoot":"","sources":["../../../../src/modeling/ai/domain_response_schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAA;AAEjC,MAAM,cAAc,GAAG;IACrB,IAAI,EAAE,IAAI,CAAC,MAAM;IACjB,UAAU,EAAE;QACV,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,MAAM,EAAE;QACzB,MAAM,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,MAAM,EAAE;KAC9B;IACD,QAAQ,EAAE,CAAC,IAAI,CAAC;CACjB,CAAA;AAED,MAAM,iBAAiB,GAAG;IACxB,IAAI,EAAE,IAAI,CAAC,MAAM;IACjB,UAAU,EAAE;QACV,GAAG,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,MAAM,EAAE,WAAW,EAAE,+BAA+B,EAAE;QACxE,MAAM,EAAE;YACN,IAAI,EAAE,IAAI,CAAC,MAAM;YACjB,WAAW,EAAE,4FAA4F;SAC1G;KACF;IACD,QAAQ,EAAE,CAAC,KAAK,CAAC;CAClB,CAAA;AAED,MAAM,kBAAkB,GAAG;IACzB,IAAI,EAAE,IAAI,CAAC,MAAM;IACjB,UAAU,EAAE;QACV,IAAI,EAAE;YACJ,IAAI,EAAE,IAAI,CAAC,MAAM;YACjB,WA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ACL,oBAAoB;4BACpB,uBAAuB;4BACvB,wBAAwB;4BACxB,qBAAqB;4BACrB,wBAAwB;4BACxB,yBAAyB;4BACzB,uBAAuB;4BACvB,0BAA0B;4BAC1B,4BAA4B;yBAC7B;qBACF;oBACD,WAAW,EAAE,+FAA+F;iBAC7G;aACF;YACD,QAAQ,EAAE;gBACR,aAAa;gBACb,kBAAkB;gBAClB,gBAAgB;gBAChB,eAAe;gBACf,mBAAmB;gBACnB,kBAAkB;aACnB;SACF;KACF;IACD,QAAQ,EAAE,CAAC,WAAW,EAAE,OAAO,CAAC;CACjC,CAAA","sourcesContent":["import { Type } from './types.js'\n\nconst SemanticSchema = {\n type: Type.OBJECT,\n properties: {\n id: { type: Type.STRING },\n config: { type: Type.OBJECT },\n },\n required: ['id'],\n}\n\nconst AssociationTarget = {\n type: Type.OBJECT,\n properties: {\n key: { type: Type.STRING, description: 'The key of the target entity.' },\n domain: {\n type: Type.STRING,\n description: 'The key of the target data domain. Only set when the target is in a different data domain.',\n },\n },\n required: ['key'],\n}\n\nconst SchemaDefaultValue = {\n type: Type.OBJECT,\n properties: {\n type: {\n type: Type.STRING,\n description: 'Enum: literal, function',\n },\n value: {\n type: Type.STRING,\n description: 'The default value of the property',\n },\n },\n required: ['type'],\n}\n\nconst PropertySchemaShape = {\n type: Type.OBJECT,\n properties: {\n minimum: { type: Type.NUMBER, nullable: true },\n maximum: { type: Type.NUMBER, nullable: true },\n exclusiveMinimum: { type: Type.BOOLEAN, nullable: true },\n exclusiveMaximum: { type: Type.BOOLEAN, nullable: true },\n multipleOf: { type: Type.NUMBER, nullable: true },\n enum: { type: Type.ARRAY, items: { type: Type.STRING }, nullable: true },\n examples: { type: Type.ARRAY, items: { type: Type.STRING }, nullable: true },\n defaultValue: { ...SchemaDefaultValue, nullable: true },\n pattern: { type: Type.STRING, nullable: true },\n },\n}\n\nconst PropertyConstraintsSchema = {\n type: Type.OBJECT,\n properties: {\n required: { type: Type.BOOLEAN, nullable: true },\n unique: { type: Type.BOOLEAN, nullable: true },\n index: { type: Type.BOOLEAN, nullable: true },\n primary: { type: Type.BOOLEAN, nullable: true },\n multiple: { type: Type.BOOLEAN, nullable: true },\n readOnly: { type: Type.BOOLEAN, nullable: true },\n writeOnly: { type: Type.BOOLEAN, nullable: true },\n },\n}\n\n/**\n * Must comply with the `AiDomainProperty` type.\n */\nconst PropertySchema = {\n type: Type.OBJECT,\n properties: {\n key: { type: Type.STRING },\n name: { type: Type.STRING },\n displayName: { type: Type.STRING },\n description: { type: Type.STRING },\n type: {\n type: Type.STRING,\n description: 'Enum: string, number, boolean, date, datetime, time, binary',\n },\n constraints: PropertyConstraintsSchema,\n deprecated: { type: Type.BOOLEAN },\n schema: PropertySchemaShape,\n semantics: {\n type: Type.ARRAY,\n items: SemanticSchema,\n description: \"List of semantics applied to this property. Note: ONLY use semantics with scope='property'.\",\n },\n tags: { type: Type.ARRAY, items: { type: Type.STRING }, nullable: true },\n },\n required: ['key', 'name', 'type', 'displayName', 'description'],\n}\n\nconst AssociationSchemaShape = {\n type: Type.OBJECT,\n properties: {\n linked: { type: Type.BOOLEAN },\n unionType: { type: Type.STRING, description: 'Enum: allOf, anyOf, oneOf, not' },\n },\n}\n\n/**\n * Must comply with the `AiDomainAssociation` type.\n */\nconst AssociationSchema = {\n type: Type.OBJECT,\n properties: {\n key: { type: Type.STRING },\n name: { type: Type.STRING },\n displayName: { type: Type.STRING },\n description: { type: Type.STRING },\n targets: { type: Type.ARRAY, items: AssociationTarget },\n required: { type: Type.BOOLEAN },\n multiple: {\n type: Type.BOOLEAN,\n description: 'Whether the association can have multiple targets (like User has multiple addresses)',\n },\n onDelete: { type: Type.STRING, description: 'Enum: restrict, cascade, setNull, doNothing' },\n semantics: {\n type: Type.ARRAY,\n items: SemanticSchema,\n description: \"List of semantics applied to this association. Note: ONLY use semantics with scope='association'.\",\n },\n schema: AssociationSchemaShape,\n },\n required: ['key', 'name', 'targets', 'displayName', 'description'],\n}\n\n/**\n * Must comply with the `AiDataModel` type.\n */\nconst ModelSchema = {\n type: Type.OBJECT,\n properties: {\n key: { type: Type.STRING },\n name: { type: Type.STRING },\n description: { type: Type.STRING },\n },\n required: ['key', 'name'],\n}\n\n/**\n * Must comply with the `AiDomainEntityResponseSchema` type.\n */\nconst EntitySchema = {\n type: Type.OBJECT,\n properties: {\n key: { type: Type.STRING },\n modelKey: { type: Type.STRING, description: 'The Domain Model this entity belongs to (e.g. \"users\", \"shipping\")' },\n name: { type: Type.STRING },\n displayName: { type: Type.STRING },\n description: { type: Type.STRING },\n tags: { type: Type.ARRAY, items: { type: Type.STRING } },\n semantics: {\n type: Type.ARRAY,\n items: SemanticSchema,\n description: \"List of semantics applied to this entity. Note: ONLY use semantics with scope='entity'.\",\n },\n properties: { type: Type.ARRAY, items: PropertySchema },\n associations: { type: Type.ARRAY, items: AssociationSchema },\n },\n required: ['key', 'name', 'modelKey', 'displayName', 'description'],\n}\n\n/**\n * Allows modifying a property (not adding)\n */\nconst PropertyDeltaSchema = {\n type: Type.OBJECT,\n properties: {\n key: { type: Type.STRING },\n name: { type: Type.STRING },\n displayName: { type: Type.STRING },\n description: { type: Type.STRING },\n type: {\n type: Type.STRING,\n description: 'Enum: string, number, boolean, date, datetime, time, binary',\n },\n constraints: { ...PropertyConstraintsSchema, nullable: true },\n deprecated: { type: Type.BOOLEAN, nullable: true },\n schema: { ...PropertySchemaShape, nullable: true },\n addedSemantics: {\n type: Type.ARRAY,\n items: SemanticSchema,\n description: \"Semantics to add. Note: ONLY use semantics with scope='property'.\",\n },\n modifiedSemantics: { type: Type.ARRAY, items: SemanticSchema },\n deletedSemanticIds: { type: Type.ARRAY, items: { type: Type.STRING } },\n },\n required: ['key'],\n}\n\nconst AssociationDeltaSchema = {\n type: Type.OBJECT,\n properties: {\n key: { type: Type.STRING },\n name: { type: Type.STRING },\n displayName: { type: Type.STRING },\n description: { type: Type.STRING },\n targets: { type: Type.ARRAY, items: AssociationTarget },\n required: { type: Type.BOOLEAN, nullable: true },\n multiple: {\n type: Type.BOOLEAN,\n nullable: true,\n description: 'Whether the association can have multiple targets (like User has multiple addresses)',\n },\n onDelete: { type: Type.STRING, nullable: true, description: 'Enum: restrict, cascade, setNull, doNothing' },\n addedSemantics: {\n type: Type.ARRAY,\n items: SemanticSchema,\n description: \"Semantics to add. Note: ONLY use semantics with scope='association'.\",\n },\n modifiedSemantics: { type: Type.ARRAY, items: SemanticSchema },\n deletedSemanticIds: { type: Type.ARRAY, items: { type: Type.STRING } },\n },\n required: ['key'],\n}\n\n/**\n * Must comply with the `AiDomainDeltaResponse` type.\n */\nexport const DOMAIN_SCHEMA = {\n type: Type.OBJECT,\n properties: {\n sessionTitle: {\n type: Type.STRING,\n description: 'A short, 3-to-5 word descriptive title for this data modeling session.',\n },\n reasoning: {\n type: Type.STRING,\n description: 'Conversational response analyzing the request or explaining changes, in markdown format',\n },\n delta: {\n type: Type.OBJECT,\n properties: {\n addedModels: {\n type: Type.ARRAY,\n items: ModelSchema,\n description: 'Brand new models to create',\n },\n deletedModelKeys: {\n type: Type.ARRAY,\n items: { type: Type.STRING },\n description:\n 'Keys of completely removed models. This also removes all entities and associations in the model.',\n },\n modifiedModels: {\n type: Type.ARRAY,\n items: ModelSchema,\n description: 'Models to modify in the domain',\n },\n addedEntities: {\n type: Type.ARRAY,\n items: EntitySchema,\n description: 'Brand new entities to create',\n },\n deletedEntityKeys: {\n type: Type.ARRAY,\n items: { type: Type.STRING },\n description: 'Keys of completely removed entities',\n },\n modifiedEntities: {\n type: Type.ARRAY,\n items: {\n type: Type.OBJECT,\n properties: {\n key: { type: Type.STRING, description: 'The original key of the existing entity being modified' },\n modelKey: {\n type: Type.STRING,\n description: 'Change this to migrate the entity to a different model (boundary)',\n },\n name: { type: Type.STRING },\n displayName: { type: Type.STRING },\n description: { type: Type.STRING },\n tags: { type: Type.ARRAY, items: { type: Type.STRING }, nullable: true },\n addedSemantics: {\n type: Type.ARRAY,\n items: SemanticSchema,\n description: \"Semantics to add. Note: ONLY use semantics with scope='entity'.\",\n },\n modifiedSemantics: { type: Type.ARRAY, items: SemanticSchema },\n deletedSemanticIds: { type: Type.ARRAY, items: { type: Type.STRING } },\n addedProperties: { type: Type.ARRAY, items: PropertySchema },\n modifiedProperties: { type: Type.ARRAY, items: PropertyDeltaSchema },\n deletedPropertyKeys: { type: Type.ARRAY, items: { type: Type.STRING } },\n addedAssociations: { type: Type.ARRAY, items: AssociationSchema },\n modifiedAssociations: { type: Type.ARRAY, items: AssociationDeltaSchema },\n deletedAssociationKeys: { type: Type.ARRAY, items: { type: Type.STRING } },\n },\n required: [\n 'key',\n // 'addedSemantics',\n // 'modifiedSemantics',\n // 'deletedSemanticIds',\n // 'addedProperties',\n // 'modifiedProperties',\n // 'deletedPropertyKeys',\n // 'addedAssociations',\n // 'modifiedAssociations',\n // 'deletedAssociationKeys',\n ],\n },\n description: 'Modifications to existing entities like adding, removing, or changing properties/associations',\n },\n },\n required: [\n 'addedModels',\n 'deletedModelKeys',\n 'modifiedModels',\n 'addedEntities',\n 'deletedEntityKeys',\n 'modifiedEntities',\n ],\n },\n },\n required: ['reasoning', 'delta'],\n}\n"]}
1
+ {"version":3,"file":"domain_response_schema.js","sourceRoot":"","sources":["../../../../src/modeling/ai/domain_response_schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAA;AAEjC,MAAM,cAAc,GAAG;IACrB,IAAI,EAAE,IAAI,CAAC,MAAM;IACjB,UAAU,EAAE;QACV,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,MAAM,EAAE;QACzB,MAAM,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,MAAM,EAAE;KAC9B;IACD,QAAQ,EAAE,CAAC,IAAI,CAAC;CACjB,CAAA;AAED,MAAM,iBAAiB,GAAG;IACxB,IAAI,EAAE,IAAI,CAAC,MAAM;IACjB,UAAU,EAAE;QACV,GAAG,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,MAAM,EAAE,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B,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,KAAK,EAAE,KAAK,EAAE,iBAAiB,EAAE;4BACjE,oBAAoB,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,KAAK,EAAE,KAAK,EAAE,sBAAsB,EAAE;4BACzE,sBAAsB,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,MAAM,EAAE,EAAE;yBAC3E;wBACD,QAAQ,EAAE;4BACR,KAAK;4BACL,oBAAoB;4BACpB,uBAAuB;4BACvB,wBAAwB;4BACxB,qBAAqB;4BACrB,wBAAwB;4BACxB,yBAAyB;4BACzB,uBAAuB;4BACvB,0BAA0B;4BAC1B,4BAA4B;yBAC7B;qBACF;oBACD,WAAW,EAAE,+FAA+F;iBAC7G;aACF;YACD,QAAQ,EAAE;gBACR,aAAa;gBACb,kBAAkB;gBAClB,gBAAgB;gBAChB,eAAe;gBACf,mBAAmB;gBACnB,kBAAkB;aACnB;SACF;KACF;IACD,QAAQ,EAAE,CAAC,WAAW,EAAE,OAAO,CAAC;CACjC,CAAA","sourcesContent":["import { Type } from './types.js'\n\nconst SemanticSchema = {\n type: Type.OBJECT,\n properties: {\n id: { type: Type.STRING },\n config: { type: Type.OBJECT },\n },\n required: ['id'],\n}\n\nconst AssociationTarget = {\n type: Type.OBJECT,\n properties: {\n key: { type: Type.STRING, description: 'The key of the target entity.' },\n domain: {\n type: Type.STRING,\n description: 'The key of the target data domain. Only set when the target is in a different data domain.',\n },\n },\n required: ['key'],\n}\n\nconst SchemaDefaultValue = {\n type: Type.OBJECT,\n properties: {\n type: {\n type: Type.STRING,\n description: 'Enum: literal, function',\n },\n value: {\n type: Type.STRING,\n description: 'The default value of the property',\n },\n },\n required: ['type'],\n}\n\nconst PropertySchemaShape = {\n type: Type.OBJECT,\n properties: {\n minimum: { type: Type.NUMBER, nullable: true },\n maximum: { type: Type.NUMBER, nullable: true },\n exclusiveMinimum: { type: Type.BOOLEAN, nullable: true },\n exclusiveMaximum: { type: Type.BOOLEAN, nullable: true },\n multipleOf: { type: Type.NUMBER, nullable: true },\n enum: { type: Type.ARRAY, items: { type: Type.STRING }, nullable: true },\n examples: { type: Type.ARRAY, items: { type: Type.STRING }, nullable: true },\n defaultValue: { ...SchemaDefaultValue, nullable: true },\n pattern: { type: Type.STRING, nullable: true },\n },\n}\n\nconst PropertyConstraintsSchema = {\n type: Type.OBJECT,\n properties: {\n required: { type: Type.BOOLEAN, nullable: true },\n unique: { type: Type.BOOLEAN, nullable: true },\n index: { type: Type.BOOLEAN, nullable: true },\n primary: { type: Type.BOOLEAN, nullable: true },\n multiple: { type: Type.BOOLEAN, nullable: true },\n readOnly: { type: Type.BOOLEAN, nullable: true },\n writeOnly: { type: Type.BOOLEAN, nullable: true },\n },\n}\n\n/**\n * Must comply with the `AiDomainProperty` type.\n */\nconst PropertySchema = {\n type: Type.OBJECT,\n properties: {\n key: { type: Type.STRING },\n name: { type: Type.STRING },\n displayName: { type: Type.STRING },\n description: { type: Type.STRING },\n type: {\n type: Type.STRING,\n description: 'Enum: string, number, boolean, date, datetime, time, binary',\n },\n constraints: PropertyConstraintsSchema,\n deprecated: { type: Type.BOOLEAN },\n schema: PropertySchemaShape,\n semantics: {\n type: Type.ARRAY,\n items: SemanticSchema,\n description: \"List of semantics applied to this property. Note: ONLY use semantics with scope='property'.\",\n },\n tags: { type: Type.ARRAY, items: { type: Type.STRING }, nullable: true },\n },\n required: ['key', 'name', 'type', 'displayName', 'description'],\n}\n\nconst AssociationSchemaShape = {\n type: Type.OBJECT,\n properties: {\n embedded: { type: Type.BOOLEAN, description: 'Whether the association should be embedded in the target entity' },\n unionType: { type: Type.STRING, description: 'Enum: allOf, anyOf, oneOf, not' },\n },\n}\n\n/**\n * Must comply with the `AiDomainAssociation` type.\n */\nconst AssociationSchema = {\n type: Type.OBJECT,\n properties: {\n key: { type: Type.STRING },\n name: { type: Type.STRING },\n displayName: { type: Type.STRING },\n description: { type: Type.STRING },\n targets: { type: Type.ARRAY, items: AssociationTarget },\n required: { type: Type.BOOLEAN },\n multiple: {\n type: Type.BOOLEAN,\n description: 'Whether the association can have multiple targets (like User has multiple addresses)',\n },\n onDelete: { type: Type.STRING, description: 'Enum: restrict, cascade, setNull, doNothing' },\n semantics: {\n type: Type.ARRAY,\n items: SemanticSchema,\n description: \"List of semantics applied to this association. Note: ONLY use semantics with scope='association'.\",\n },\n schema: AssociationSchemaShape,\n },\n required: ['key', 'name', 'targets', 'displayName', 'description'],\n}\n\n/**\n * Must comply with the `AiDataModel` type.\n */\nconst ModelSchema = {\n type: Type.OBJECT,\n properties: {\n key: { type: Type.STRING },\n name: { type: Type.STRING },\n description: { type: Type.STRING },\n },\n required: ['key', 'name'],\n}\n\n/**\n * Must comply with the `AiDomainEntityResponseSchema` type.\n */\nconst EntitySchema = {\n type: Type.OBJECT,\n properties: {\n key: { type: Type.STRING },\n modelKey: { type: Type.STRING, description: 'The Domain Model this entity belongs to (e.g. \"users\", \"shipping\")' },\n name: { type: Type.STRING },\n displayName: { type: Type.STRING },\n description: { type: Type.STRING },\n tags: { type: Type.ARRAY, items: { type: Type.STRING } },\n semantics: {\n type: Type.ARRAY,\n items: SemanticSchema,\n description: \"List of semantics applied to this entity. Note: ONLY use semantics with scope='entity'.\",\n },\n properties: { type: Type.ARRAY, items: PropertySchema },\n associations: { type: Type.ARRAY, items: AssociationSchema },\n },\n required: ['key', 'name', 'modelKey', 'displayName', 'description'],\n}\n\n/**\n * Allows modifying a property (not adding)\n */\nconst PropertyDeltaSchema = {\n type: Type.OBJECT,\n properties: {\n key: { type: Type.STRING },\n name: { type: Type.STRING },\n displayName: { type: Type.STRING },\n description: { type: Type.STRING },\n type: {\n type: Type.STRING,\n description: 'Enum: string, number, boolean, date, datetime, time, binary',\n },\n constraints: { ...PropertyConstraintsSchema, nullable: true },\n deprecated: { type: Type.BOOLEAN, nullable: true },\n schema: { ...PropertySchemaShape, nullable: true },\n addedSemantics: {\n type: Type.ARRAY,\n items: SemanticSchema,\n description: \"Semantics to add. Note: ONLY use semantics with scope='property'.\",\n },\n modifiedSemantics: { type: Type.ARRAY, items: SemanticSchema },\n deletedSemanticIds: { type: Type.ARRAY, items: { type: Type.STRING } },\n },\n required: ['key'],\n}\n\nconst AssociationDeltaSchema = {\n type: Type.OBJECT,\n properties: {\n key: { type: Type.STRING },\n name: { type: Type.STRING },\n displayName: { type: Type.STRING },\n description: { type: Type.STRING },\n targets: { type: Type.ARRAY, items: AssociationTarget },\n required: { type: Type.BOOLEAN, nullable: true },\n multiple: {\n type: Type.BOOLEAN,\n nullable: true,\n description: 'Whether the association can have multiple targets (like User has multiple addresses)',\n },\n onDelete: { type: Type.STRING, nullable: true, description: 'Enum: restrict, cascade, setNull, doNothing' },\n addedSemantics: {\n type: Type.ARRAY,\n items: SemanticSchema,\n description: \"Semantics to add. Note: ONLY use semantics with scope='association'.\",\n },\n modifiedSemantics: { type: Type.ARRAY, items: SemanticSchema },\n deletedSemanticIds: { type: Type.ARRAY, items: { type: Type.STRING } },\n },\n required: ['key'],\n}\n\n/**\n * Must comply with the `AiDomainDeltaResponse` type.\n */\nexport const DOMAIN_SCHEMA = {\n type: Type.OBJECT,\n properties: {\n sessionTitle: {\n type: Type.STRING,\n description: 'A short, 3-to-5 word descriptive title for this data modeling session.',\n },\n reasoning: {\n type: Type.STRING,\n description: 'Conversational response analyzing the request or explaining changes, in markdown format',\n },\n delta: {\n type: Type.OBJECT,\n properties: {\n addedModels: {\n type: Type.ARRAY,\n items: ModelSchema,\n description: 'Brand new models to create',\n },\n deletedModelKeys: {\n type: Type.ARRAY,\n items: { type: Type.STRING },\n description:\n 'Keys of completely removed models. This also removes all entities and associations in the model.',\n },\n modifiedModels: {\n type: Type.ARRAY,\n items: ModelSchema,\n description: 'Models to modify in the domain',\n },\n addedEntities: {\n type: Type.ARRAY,\n items: EntitySchema,\n description: 'Brand new entities to create',\n },\n deletedEntityKeys: {\n type: Type.ARRAY,\n items: { type: Type.STRING },\n description: 'Keys of completely removed entities',\n },\n modifiedEntities: {\n type: Type.ARRAY,\n items: {\n type: Type.OBJECT,\n properties: {\n key: { type: Type.STRING, description: 'The original key of the existing entity being modified' },\n modelKey: {\n type: Type.STRING,\n description: 'Change this to migrate the entity to a different model (boundary)',\n },\n name: { type: Type.STRING },\n displayName: { type: Type.STRING },\n description: { type: Type.STRING },\n tags: { type: Type.ARRAY, items: { type: Type.STRING }, nullable: true },\n addedSemantics: {\n type: Type.ARRAY,\n items: SemanticSchema,\n description: \"Semantics to add. Note: ONLY use semantics with scope='entity'.\",\n },\n modifiedSemantics: { type: Type.ARRAY, items: SemanticSchema },\n deletedSemanticIds: { type: Type.ARRAY, items: { type: Type.STRING } },\n addedProperties: { type: Type.ARRAY, items: PropertySchema },\n modifiedProperties: { type: Type.ARRAY, items: PropertyDeltaSchema },\n deletedPropertyKeys: { type: Type.ARRAY, items: { type: Type.STRING } },\n addedAssociations: { type: Type.ARRAY, items: AssociationSchema },\n modifiedAssociations: { type: Type.ARRAY, items: AssociationDeltaSchema },\n deletedAssociationKeys: { type: Type.ARRAY, items: { type: Type.STRING } },\n },\n required: [\n 'key',\n // 'addedSemantics',\n // 'modifiedSemantics',\n // 'deletedSemanticIds',\n // 'addedProperties',\n // 'modifiedProperties',\n // 'deletedPropertyKeys',\n // 'addedAssociations',\n // 'modifiedAssociations',\n // 'deletedAssociationKeys',\n ],\n },\n description: 'Modifications to existing entities like adding, removing, or changing properties/associations',\n },\n },\n required: [\n 'addedModels',\n 'deletedModelKeys',\n 'modifiedModels',\n 'addedEntities',\n 'deletedEntityKeys',\n 'modifiedEntities',\n ],\n },\n },\n required: ['reasoning', 'delta'],\n}\n"]}
@@ -1,10 +1,9 @@
1
- import type { Shapes } from '@api-client/amf-core';
2
1
  import type { Exception } from '../../exceptions/exception.js';
3
2
  import type { AiSessionSchema } from '../../models/AiSession.js';
4
3
  import type { DomainPropertyType } from '../DataFormat.js';
5
4
  import type { OnDeleteRule } from '../index.js';
6
5
  import { SemanticType } from '../Semantics.js';
7
- import type { AssociationTarget, PropertySchema } from '../types.js';
6
+ import type { AssociationSchema, AssociationTarget, PropertySchema } from '../types.js';
8
7
  import type { AiModelMessageSchema, AiModelMessage, AiUserMessageSchema } from '../../models/AiMessage.js';
9
8
  /**
10
9
  * A copy of the `Type` enum from the `@google/genai` package.
@@ -142,7 +141,7 @@ export interface AiDomainAssociation {
142
141
  multiple?: boolean;
143
142
  onDelete?: OnDeleteRule;
144
143
  semantics?: AiDomainSemantic[];
145
- schema?: Shapes.IApiAssociationShape;
144
+ schema?: AssociationSchema;
146
145
  }
147
146
  /**
148
147
  * The core structure representing a set of modifications (a delta) proposed by the AI.
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/modeling/ai/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAClD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAA;AAC9D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAChE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAA;AAC1D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAC9C,OAAO,KAAK,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AACpE,OAAO,KAAK,EAAE,oBAAoB,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAA;AAE1G;;;GAGG;AACH,oBAAY,IAAI;IACd;;OAEG;IACH,gBAAgB,qBAAqB;IACrC;;OAEG;IACH,MAAM,WAAW;IACjB;;OAEG;IACH,MAAM,WAAW;IACjB;;OAEG;IACH,OAAO,YAAY;IACnB;;OAEG;IACH,OAAO,YAAY;IACnB;;OAEG;IACH,K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;OAEG;IACH,uBAAe,CAAA;IACf;;OAEG;IACH,yBAAiB,CAAA;IACjB;;OAEG;IACH,qBAAa,CAAA;AACf,CAAC,EAjCW,IAAI,KAAJ,IAAI,QAiCf","sourcesContent":["import type { Shapes } from '@api-client/amf-core'\nimport type { Exception } from '../../exceptions/exception.js'\nimport type { AiSessionSchema } from '../../models/AiSession.js'\nimport type { DomainPropertyType } from '../DataFormat.js'\nimport type { OnDeleteRule } from '../index.js'\nimport { SemanticType } from '../Semantics.js'\nimport type { AssociationTarget, PropertySchema } from '../types.js'\nimport type { AiModelMessageSchema, AiModelMessage, AiUserMessageSchema } from '../../models/AiMessage.js'\n\n/**\n * A copy of the `Type` enum from the `@google/genai` package.\n * It's here so we don't need to import the nodejs only package.\n */\nexport enum Type {\n /**\n * Not specified, should not be used.\n */\n TYPE_UNSPECIFIED = 'TYPE_UNSPECIFIED',\n /**\n * OpenAPI string type\n */\n STRING = 'STRING',\n /**\n * OpenAPI number type\n */\n NUMBER = 'NUMBER',\n /**\n * OpenAPI integer type\n */\n INTEGER = 'INTEGER',\n /**\n * OpenAPI boolean type\n */\n BOOLEAN = 'BOOLEAN',\n /**\n * OpenAPI array type\n */\n ARRAY = 'ARRAY',\n /**\n * OpenAPI object type\n */\n OBJECT = 'OBJECT',\n /**\n * Null type\n */\n NULL = 'NULL',\n}\n\n/**\n * A lightweight representation of the `DataDomain` used specifically for serializing\n * the current domain state and sending it as context to the AI endpoint.\n * It omits complex internal graph structures, including only essential keys, names,\n * descriptions, and the hierarchical structure of models and entities.\n */\nexport interface AiDataDomainSchema {\n key: string\n name: string\n models: AiDataModelSchema[]\n entities: AiDomainEntitySchema[]\n}\n\n/**\n * A stripped-down representation of a `DomainModel` sent to the AI as part of the\n * domain context. It provides the AI with the existing model hierarchy and descriptions.\n */\nexport interface AiDataModelSchema {\n key: string\n name?: string\n description?: string\n}\n\n/**\n * Represents a semantic annotation applied to an entity, property, or association\n * within the AI's understanding or response. It defines the \"meaning\" of a field\n * (e.g., \"Email\", \"Password\", \"Address\").\n */\nexport interface AiDomainSemantic {\n id: SemanticType\n config?: Record<string, unknown>\n}\n\n/**\n * Represents a full or partial entity schema as generated by the AI in its response delta.\n * It defines a new entity or updates to an existing one, including its properties,\n * associations, semantics, and tags. This is also used by the `get_entity_details` tool\n * to send detailed serialized entity information back to the AI.\n */\nexport interface AiDomainEntityResponseSchema {\n key: string\n modelKey: string\n name?: string\n displayName?: string\n description?: string\n tags?: string[]\n semantics?: AiDomainSemantic[]\n properties?: AiDomainProperty[]\n associations?: AiDomainAssociation[]\n}\n\n/**\n * A minimal representation of an entity used purely for context-setting when\n * sending the current domain structure to the AI. It excludes deeply nested\n * properties and associations to save token space.\n */\nexport interface AiDomainEntitySchema {\n key: string\n modelKey: string\n name?: string\n description?: string\n}\n\n/**\n * Represents a property definition generated by the AI. It maps the complex internal\n * domain property structure into a simpler, flat structure that the AI generates,\n * including data types, constraints, schema metadata, and semantics.\n */\nexport interface AiDomainProperty {\n key?: string\n name?: string\n displayName?: string\n description?: string\n type: DomainPropertyType\n constraints?: {\n required?: boolean\n unique?: boolean\n index?: boolean\n primary?: boolean\n multiple?: boolean\n readOnly?: boolean\n writeOnly?: boolean\n }\n deprecated?: boolean\n schema?: PropertySchema\n semantics?: AiDomainSemantic[]\n tags?: string[] | null\n}\n\n/**\n * Represents an association definition generated by the AI, linking an entity\n * to one or more target entities. It includes relationship rules (like onDelete)\n * and semantic annotations.\n */\nexport interface AiDomainAssociation {\n key: string\n name?: string\n displayName?: string\n description?: string\n targets: AssociationTarget[]\n required?: boolean\n multiple?: boolean\n onDelete?: OnDeleteRule\n semantics?: AiDomainSemantic[]\n schema?: Shapes.IApiAssociationShape\n}\n\n/**\n * The core structure representing a set of modifications (a delta) proposed by the AI.\n * It contains arrays of models and entities to add, delete, or modify. The application\n * processes this delta to transition the data domain to the new requested state.\n */\nexport interface AiDomainDelta {\n /**\n * Models to add to the domain.\n */\n addedModels?: AiDataModelSchema[]\n /**\n * Keys of models to delete from the domain.\n */\n deletedModelKeys?: string[]\n /**\n * Models to modify in the domain.\n */\n modifiedModels?: AiDataModelSchema[]\n /**\n * Entities to add to the domain.\n */\n addedEntities?: AiDomainEntityResponseSchema[]\n /**\n * Keys of entities to delete from the domain.\n */\n deletedEntityKeys?: string[]\n /**\n * Entities to modify in the domain.\n */\n modifiedEntities?: AiDomainEntityDelta[]\n}\n\n/**\n * The expected JSON schema structure returned by the AI endpoint when performing\n * data domain manipulation. It includes the AI's step-by-step reasoning and the\n * actionable delta to be applied.\n */\nexport interface AiDomainDeltaResponse {\n /**\n * The LLM reasoning.\n */\n reasoning: string\n /**\n * Domain changes delta\n */\n delta?: AiDomainDelta\n}\n\n/**\n * Union type for progressive SSE stream chunks\n * received from the AI generation endpoint.\n */\nexport type AiStreamEvent =\n | { event: 'user-message'; data: AiUserMessageSchema }\n | { event: 'agent-message'; data: AiModelMessageSchema }\n | { event: 'thought-chunk'; data: string }\n | { event: 'text-chunk'; data: string }\n | { event: 'done'; data: AiModelMessageSchema }\n | { event: 'error'; data: Exception }\n | { event: 'session-updated'; data: AiSessionSchema }\n\n/**\n * Represents a targeted modification to an existing entity generated by the AI.\n * Instead of providing the full entity state, the AI provides explicit arrays\n * of properties, associations, and semantics to add, modify, or delete, enabling\n * precise, non-destructive updates.\n */\nexport interface AiDomainEntityDelta {\n key: string\n modelKey?: string // Provide to move the entity to a different model\n name?: string\n displayName?: string\n description?: string\n tags?: string[] | null\n // Entity semantics delta\n addedSemantics?: AiDomainSemantic[]\n modifiedSemantics?: AiDomainSemantic[]\n deletedSemanticIds?: SemanticType[]\n // Explicit deltas so the LLM doesn't have to list untouched properties\n addedProperties?: AiDomainProperty[]\n modifiedProperties?: AiDomainPropertyDelta[]\n deletedPropertyKeys?: string[]\n addedAssociations?: AiDomainAssociation[]\n modifiedAssociations?: AiDomainAssociationDelta[]\n deletedAssociationKeys?: string[]\n}\n\nexport type NullablePropertySchema = {\n [K in keyof PropertySchema]?: PropertySchema[K] | null\n}\n\n/**\n * Represents a targeted modification to an existing property generated by the AI.\n * It captures changes to superficial properties (name, description), type changes,\n * constraint updates, and semantic alterations.\n */\nexport interface AiDomainPropertyDelta {\n key: string\n name?: string\n displayName?: string\n description?: string\n type?: DomainPropertyType\n constraints?: {\n required?: boolean | null\n unique?: boolean | null\n index?: boolean | null\n primary?: boolean | null\n multiple?: boolean | null\n readOnly?: boolean | null\n writeOnly?: boolean | null\n } | null\n deprecated?: boolean | null\n // Property semantics delta\n addedSemantics?: AiDomainSemantic[]\n modifiedSemantics?: AiDomainSemantic[]\n deletedSemanticIds?: SemanticType[]\n schema?: NullablePropertySchema\n}\n\n/**\n * Represents a targeted modification to an existing association generated by the AI.\n * It captures updates to relationship cardinality, target entities, deletion rules,\n * and applied semantics.\n */\nexport interface AiDomainAssociationDelta {\n key: string\n name?: string\n displayName?: string\n description?: string\n targets?: AssociationTarget[]\n required?: boolean | null\n multiple?: boolean | null\n onDelete?: OnDeleteRule | null\n // Association semantics delta\n addedSemantics?: AiDomainSemantic[]\n modifiedSemantics?: AiDomainSemantic[]\n deletedSemanticIds?: SemanticType[]\n}\n\n/**\n * An enriched, in-memory representation of a model's message that includes the globally\n * parsed `AiDomainDelta` object.\n * This is not stored directly in the datastore as-is; instead, the raw JSON text is stored,\n * and this structure is assembled at runtime when the chat history is loaded into the UI.\n */\nexport interface AiModelMessageWithDelta extends AiModelMessage {\n /**\n * The delta of the message, if any.\n */\n delta?: AiDomainDelta\n /**\n * The reasoning of the delta.\n * Format in markdown.\n */\n reasoning?: string\n}\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/modeling/ai/types.ts"],"names":[],"mappings":"AAQA;;;GAGG;AACH,MAAM,CAAN,IAAY,IAiCX;AAjCD,WAAY,IAAI;IACd;;OAEG;IACH,6CAAqC,CAAA;IACrC;;OAEG;IACH,yBAAiB,CAAA;IACjB;;OAEG;IACH,yBAAiB,CAAA;IACjB;;OAEG;IACH,2BAAmB,CAAA;IACnB;;OAEG;IACH,2BAAmB,CAAA;IACnB;;OAEG;IACH,uBAAe,CAAA;IACf;;OAEG;IACH,yBAAiB,CAAA;IACjB;;OAEG;IACH,qBAAa,CAAA;AACf,CAAC,EAjCW,IAAI,KAAJ,IAAI,QAiCf","sourcesContent":["import type { Exception } from '../../exceptions/exception.js'\nimport type { AiSessionSchema } from '../../models/AiSession.js'\nimport type { DomainPropertyType } from '../DataFormat.js'\nimport type { OnDeleteRule } from '../index.js'\nimport { SemanticType } from '../Semantics.js'\nimport type { AssociationSchema, AssociationTarget, PropertySchema } from '../types.js'\nimport type { AiModelMessageSchema, AiModelMessage, AiUserMessageSchema } from '../../models/AiMessage.js'\n\n/**\n * A copy of the `Type` enum from the `@google/genai` package.\n * It's here so we don't need to import the nodejs only package.\n */\nexport enum Type {\n /**\n * Not specified, should not be used.\n */\n TYPE_UNSPECIFIED = 'TYPE_UNSPECIFIED',\n /**\n * OpenAPI string type\n */\n STRING = 'STRING',\n /**\n * OpenAPI number type\n */\n NUMBER = 'NUMBER',\n /**\n * OpenAPI integer type\n */\n INTEGER = 'INTEGER',\n /**\n * OpenAPI boolean type\n */\n BOOLEAN = 'BOOLEAN',\n /**\n * OpenAPI array type\n */\n ARRAY = 'ARRAY',\n /**\n * OpenAPI object type\n */\n OBJECT = 'OBJECT',\n /**\n * Null type\n */\n NULL = 'NULL',\n}\n\n/**\n * A lightweight representation of the `DataDomain` used specifically for serializing\n * the current domain state and sending it as context to the AI endpoint.\n * It omits complex internal graph structures, including only essential keys, names,\n * descriptions, and the hierarchical structure of models and entities.\n */\nexport interface AiDataDomainSchema {\n key: string\n name: string\n models: AiDataModelSchema[]\n entities: AiDomainEntitySchema[]\n}\n\n/**\n * A stripped-down representation of a `DomainModel` sent to the AI as part of the\n * domain context. It provides the AI with the existing model hierarchy and descriptions.\n */\nexport interface AiDataModelSchema {\n key: string\n name?: string\n description?: string\n}\n\n/**\n * Represents a semantic annotation applied to an entity, property, or association\n * within the AI's understanding or response. It defines the \"meaning\" of a field\n * (e.g., \"Email\", \"Password\", \"Address\").\n */\nexport interface AiDomainSemantic {\n id: SemanticType\n config?: Record<string, unknown>\n}\n\n/**\n * Represents a full or partial entity schema as generated by the AI in its response delta.\n * It defines a new entity or updates to an existing one, including its properties,\n * associations, semantics, and tags. This is also used by the `get_entity_details` tool\n * to send detailed serialized entity information back to the AI.\n */\nexport interface AiDomainEntityResponseSchema {\n key: string\n modelKey: string\n name?: string\n displayName?: string\n description?: string\n tags?: string[]\n semantics?: AiDomainSemantic[]\n properties?: AiDomainProperty[]\n associations?: AiDomainAssociation[]\n}\n\n/**\n * A minimal representation of an entity used purely for context-setting when\n * sending the current domain structure to the AI. It excludes deeply nested\n * properties and associations to save token space.\n */\nexport interface AiDomainEntitySchema {\n key: string\n modelKey: string\n name?: string\n description?: string\n}\n\n/**\n * Represents a property definition generated by the AI. It maps the complex internal\n * domain property structure into a simpler, flat structure that the AI generates,\n * including data types, constraints, schema metadata, and semantics.\n */\nexport interface AiDomainProperty {\n key?: string\n name?: string\n displayName?: string\n description?: string\n type: DomainPropertyType\n constraints?: {\n required?: boolean\n unique?: boolean\n index?: boolean\n primary?: boolean\n multiple?: boolean\n readOnly?: boolean\n writeOnly?: boolean\n }\n deprecated?: boolean\n schema?: PropertySchema\n semantics?: AiDomainSemantic[]\n tags?: string[] | null\n}\n\n/**\n * Represents an association definition generated by the AI, linking an entity\n * to one or more target entities. It includes relationship rules (like onDelete)\n * and semantic annotations.\n */\nexport interface AiDomainAssociation {\n key: string\n name?: string\n displayName?: string\n description?: string\n targets: AssociationTarget[]\n required?: boolean\n multiple?: boolean\n onDelete?: OnDeleteRule\n semantics?: AiDomainSemantic[]\n schema?: AssociationSchema\n}\n\n/**\n * The core structure representing a set of modifications (a delta) proposed by the AI.\n * It contains arrays of models and entities to add, delete, or modify. The application\n * processes this delta to transition the data domain to the new requested state.\n */\nexport interface AiDomainDelta {\n /**\n * Models to add to the domain.\n */\n addedModels?: AiDataModelSchema[]\n /**\n * Keys of models to delete from the domain.\n */\n deletedModelKeys?: string[]\n /**\n * Models to modify in the domain.\n */\n modifiedModels?: AiDataModelSchema[]\n /**\n * Entities to add to the domain.\n */\n addedEntities?: AiDomainEntityResponseSchema[]\n /**\n * Keys of entities to delete from the domain.\n */\n deletedEntityKeys?: string[]\n /**\n * Entities to modify in the domain.\n */\n modifiedEntities?: AiDomainEntityDelta[]\n}\n\n/**\n * The expected JSON schema structure returned by the AI endpoint when performing\n * data domain manipulation. It includes the AI's step-by-step reasoning and the\n * actionable delta to be applied.\n */\nexport interface AiDomainDeltaResponse {\n /**\n * The LLM reasoning.\n */\n reasoning: string\n /**\n * Domain changes delta\n */\n delta?: AiDomainDelta\n}\n\n/**\n * Union type for progressive SSE stream chunks\n * received from the AI generation endpoint.\n */\nexport type AiStreamEvent =\n | { event: 'user-message'; data: AiUserMessageSchema }\n | { event: 'agent-message'; data: AiModelMessageSchema }\n | { event: 'thought-chunk'; data: string }\n | { event: 'text-chunk'; data: string }\n | { event: 'done'; data: AiModelMessageSchema }\n | { event: 'error'; data: Exception }\n | { event: 'session-updated'; data: AiSessionSchema }\n\n/**\n * Represents a targeted modification to an existing entity generated by the AI.\n * Instead of providing the full entity state, the AI provides explicit arrays\n * of properties, associations, and semantics to add, modify, or delete, enabling\n * precise, non-destructive updates.\n */\nexport interface AiDomainEntityDelta {\n key: string\n modelKey?: string // Provide to move the entity to a different model\n name?: string\n displayName?: string\n description?: string\n tags?: string[] | null\n // Entity semantics delta\n addedSemantics?: AiDomainSemantic[]\n modifiedSemantics?: AiDomainSemantic[]\n deletedSemanticIds?: SemanticType[]\n // Explicit deltas so the LLM doesn't have to list untouched properties\n addedProperties?: AiDomainProperty[]\n modifiedProperties?: AiDomainPropertyDelta[]\n deletedPropertyKeys?: string[]\n addedAssociations?: AiDomainAssociation[]\n modifiedAssociations?: AiDomainAssociationDelta[]\n deletedAssociationKeys?: string[]\n}\n\nexport type NullablePropertySchema = {\n [K in keyof PropertySchema]?: PropertySchema[K] | null\n}\n\n/**\n * Represents a targeted modification to an existing property generated by the AI.\n * It captures changes to superficial properties (name, description), type changes,\n * constraint updates, and semantic alterations.\n */\nexport interface AiDomainPropertyDelta {\n key: string\n name?: string\n displayName?: string\n description?: string\n type?: DomainPropertyType\n constraints?: {\n required?: boolean | null\n unique?: boolean | null\n index?: boolean | null\n primary?: boolean | null\n multiple?: boolean | null\n readOnly?: boolean | null\n writeOnly?: boolean | null\n } | null\n deprecated?: boolean | null\n // Property semantics delta\n addedSemantics?: AiDomainSemantic[]\n modifiedSemantics?: AiDomainSemantic[]\n deletedSemanticIds?: SemanticType[]\n schema?: NullablePropertySchema\n}\n\n/**\n * Represents a targeted modification to an existing association generated by the AI.\n * It captures updates to relationship cardinality, target entities, deletion rules,\n * and applied semantics.\n */\nexport interface AiDomainAssociationDelta {\n key: string\n name?: string\n displayName?: string\n description?: string\n targets?: AssociationTarget[]\n required?: boolean | null\n multiple?: boolean | null\n onDelete?: OnDeleteRule | null\n // Association semantics delta\n addedSemantics?: AiDomainSemantic[]\n modifiedSemantics?: AiDomainSemantic[]\n deletedSemanticIds?: SemanticType[]\n}\n\n/**\n * An enriched, in-memory representation of a model's message that includes the globally\n * parsed `AiDomainDelta` object.\n * This is not stored directly in the datastore as-is; instead, the raw JSON text is stored,\n * and this structure is assembled at runtime when the chat history is loaded into the UI.\n */\nexport interface AiModelMessageWithDelta extends AiModelMessage {\n /**\n * The delta of the message, if any.\n */\n delta?: AiDomainDelta\n /**\n * The reasoning of the delta.\n * Format in markdown.\n */\n reasoning?: string\n}\n"]}
@@ -184,7 +184,7 @@ export class ShapeGenerator {
184
184
  */
185
185
  associationShape(input, visited = new Set()) {
186
186
  const schema = input.schema;
187
- if (schema && schema.linked) {
187
+ if (!schema?.embedded) {
188
188
  return this.createLinkedShape(input);
189
189
  }
190
190
  const items = this.associationUnion(input, visited);
@@ -1 +1 @@
1
- {"version":3,"file":"ShapeGenerator.js","sourceRoot":"","sources":["../../../../src/mod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EAAU,EAAE,KAAyB;QAClE,MAAM,MAAM,GAAG,YAAY,CAAC,UAAU,CAAC,EAAE,CAAC,CAAA;QAC1C,MAAM,CAAC,KAAK,GAAG,KAAK,CAAA;QACpB,OAAO,MAAM,CAAA;IACf,CAAC;CACF","sourcesContent":["import { type AssociationBindings, type PropertyWebBindings } from '../Bindings.js'\nimport type { DomainAssociation } from '../DomainAssociation.js'\nimport type { DomainProperty } from '../DomainProperty.js'\nimport type { DomainEntity } from '../DomainEntity.js'\nimport { modelTypeToAmfDataType } from './core_types.js'\nimport { AmfNamespace, type Shapes, AmfDataNode, AmfTypes, ShapeHelpers } from '@api-client/amf-core'\nimport { DataValueGenerator } from './DataValueGenerator.js'\nimport { nanoid } from '../../nanoid.js'\nimport { DomainEntityKind, DomainPropertyKind } from '../../models/kinds.js'\nimport type { PropertySchema } from '../types.js'\n\nconst UNION_TYPE_ANY_OF = 'anyOf'\nconst UNION_TYPE_ALL_OF = 'allOf'\nconst UNION_TYPE_ONE_OF = 'oneOf'\nconst UNION_TYPE_NOT = 'not'\nconst DATA_TYPE_STRING = 'string'\nconst DATA_TYPE_BINARY = 'binary'\n\n/**\n * Serializes Data Domain elements (DomainEntity, DomainProperty, DomainAssociation)\n * to AMF shapes.\n *\n * This class provides a mechanism to translate a data domain model, defined using\n * custom classes like `DomainEntity`, `DomainProperty`, and `DomainAssociation`,\n * into AMF (API Modeling Framework) shapes. AMF shapes are a standardized way\n * to represent API structures and data models, enabling interoperability and tooling.\n *\n * This is particularly useful when you have a custom data model and need to\n * generate API definitions (e.g., RAML or OAS) from it.\n *\n * **Key Features:**\n *\n * - **Data Domain to AMF Translation:** Converts data domain elements into\n * their corresponding AMF shape representations.\n * - **Recursive Shape Handling:** Detects and handles recursive relationships\n * within the data model to prevent infinite loops during shape generation.\n * - **Union Type Support:** Supports the creation of union types in AMF\n * to represent associations that can point to multiple different entity types.\n * - **Binding Integration:** Leverages binding information (e.g., web bindings)\n * to customize the generated AMF shapes based on the target API format.\n * - **Example and Default Value Generation:** Integrates with a `DataValueGenerator`\n * to automatically generate example values and default values for properties\n * within the AMF shapes.\n *\n * **Usage:**\n *\n * 1. Create an instance of the `ShapeGenerator`.\n * 2. Call the appropriate method (e.g., `entity()`, `property()`, `associationShape()`)\n * to generate the AMF shape for a specific data domain element.\n * 3. The returned AMF shape can then be used with other AMF tools to generate\n * API definitions or perform other API-related tasks.\n */\nexport class ShapeGenerator {\n #valueGenerator?: DataValueGenerator\n\n /**\n * Used with data domain value generation for entity properties.\n * Lazily loaded class only when functions are used.\n * This needs to be a class instances because some functions are incremental\n */\n get valueGenerator(): DataValueGenerator {\n // we need a new instance of the generator for each shape generation\n // as the generator is stateful and we need to reset it for each shape.\n if (!this.#valueGenerator) {\n this.#valueGenerator = new DataValueGenerator()\n }\n return this.#valueGenerator\n }\n\n /**\n * Serializes a `DomainEntity` to an AMF node shape.\n *\n * This method is the entry point for converting a `DomainEntity` into its\n * AMF representation. It handles recursive relationships, property serialization,\n * and inheritance from parent entities.\n *\n * @param input The `DomainEntity` to serialize.\n * @param visited A `Set` of keys of already generated entities. This prevents\n * recursive shape generation and avoids infinite loops. Defaults to a new empty `Set`.\n * @returns An `IApiNodeShape` or `IApiRecursiveShape` representing the entity in AMF.\n * Returns a `IApiRecursiveShape` if a recursive loop is detected.\n * @example\n * ```typescript\n * const generator = new ShapeGenerator();\n * const amfShape = generator.entity(myDomainEntity);\n * ```\n */\n entity(input: DomainEntity, visited = new Set<string>()): Shapes.IApiNodeShape | Shapes.IApiRecursiveShape {\n if (visited.has(input.key)) {\n // create a recursive shape.\n return this.createRecursiveShape(input)\n }\n visited.add(input.key)\n const result = ShapeHelpers.nodeShape(input.key)\n result.id = input.key\n this.updateBaseProperties(input, result)\n result.properties = []\n for (const item of input.listProperties()) {\n // we check whether the property is hidden.\n // This is not happening when calling the `property()` because this method\n // always returns the AMF shape.\n const wb = item.readBinding('web') as PropertyWebBindings | undefined\n if (wb && wb.hidden) {\n continue\n }\n const shape = this.property(item)\n result.properties.push(shape)\n }\n for (const assoc of input.listAssociations()) {\n const wb = assoc.readBinding('web') as AssociationBindings | undefined\n if (wb && wb.hidden) {\n continue\n }\n const prop = this.associationProperty(assoc, visited)\n result.properties.push(prop)\n }\n for (const parent of input.listParents()) {\n const shape = this.entity(parent, visited)\n result.inherits.push(shape)\n }\n return result\n }\n\n /**\n * Serializes a `DomainProperty` to an AMF property shape.\n *\n * This method converts a `DomainProperty` into an `IApiPropertyShape`,\n * defining its characteristics such as data type, required status, and\n * range (the shape of the property's value).\n *\n * @param input The `DomainProperty` to serialize.\n * @returns An `IApiPropertyShape` representing the property in AMF.\n * @example\n * ```typescript\n * const generator = new ShapeGenerator();\n * const amfShape = generator.property(myDomainProperty);\n * ```\n */\n property(input: DomainProperty): Shapes.IApiPropertyShape {\n const { required, key } = input\n const result = ShapeHelpers.propertyShape(key)\n result.path = `${AmfNamespace.aml.vocabularies.data.key}${input.info.name}`\n if (required) {\n result.minCount = 1\n }\n result.range = this.getRange(input)\n\n // for example, Example generator needs to know the name of the property\n // as it does not look into the \"range\" object.\n this.updateBaseProperties(input, result)\n\n // sync the name of the property shape with the range, in case it was changed by the bindings\n if (result.range.name) {\n result.name = result.range.name\n }\n return result\n }\n\n /**\n * Serializes a `DomainAssociation` to an AMF property shape, handling the\n * association's target entity or entities.\n *\n * This method is similar to `property()`, but it specifically handles\n * associations between entities. It determines the range of the property\n * based on the association's target(s) and generates the appropriate\n * AMF shape (e.g., a scalar shape for a linked schema, a union shape for\n * multiple targets).\n *\n * @param input The `DomainAssociation` to serialize.\n * @param visited A `Set` of keys of already generated entities. This prevents\n * recursive shape generation and avoids infinite loops. Defaults to a new empty `Set`.\n * @returns An `IApiPropertyShape` representing the association in AMF.\n * @example\n * ```typescript\n * const generator = new ShapeGenerator();\n * const amfShape = generator.associationProperty(myDomainAssociation);\n * ```\n */\n associationProperty(input: DomainAssociation, visited: Set<string> = new Set<string>()): Shapes.IApiPropertyShape {\n const { required, key } = input\n const result = ShapeHelpers.propertyShape(key)\n result.path = `${AmfNamespace.aml.vocabularies.data.key}${input.info.name}`\n if (required) {\n result.minCount = 1\n }\n result.range = this.associationShape(input, visited)\n\n this.updateBaseProperties(input, result)\n return result\n }\n\n /**\n * Generates a shape for an association. Most likely you want to use the `associationProperty()` method instead.\n *\n * @param input The data association instance.\n * @param visited A `Set` of keys of already generated entities. This prevents\n * recursive shape generation and avoids infinite loops. Defaults to a new empty `Set`.\n * @returns The range value for the PropertyShape.\n */\n associationShape(input: DomainAssociation, visited: Set<string> = new Set<string>()): Shapes.IShapeUnion | undefined {\n const schema = input.schema\n if (schema && schema.linked) {\n return this.createLinkedShape(input)\n }\n const items = this.associationUnion(input, visited)\n if (!items) {\n return\n }\n if (Array.isArray(items)) {\n return this.createUnionShape(input, items)\n }\n const unionType = (schema && schema.unionType) || UNION_TYPE_ANY_OF\n if (unionType === UNION_TYPE_NOT) {\n // Need to investigate more about \"not\" union type.\n // AMF supports it, but I am not sure how to handle it.\n const wrapper = ShapeHelpers.anyShape(input.key)\n wrapper.id = `not-shape-${input.key}`\n wrapper.not = items\n return wrapper\n }\n if (input.multiple) {\n return this.refactorShapeToArray(input.key, items)\n }\n return items\n }\n\n /**\n * @param input The data association instance.\n * @returns An AMF API scalar shape with the link to the schema.\n */\n protected createLinkedShape(input: DomainAssociation): Shapes.IApiScalarShape {\n // This is a link to the schema. In an API that would be the id\n // of a resource to request the data from.\n const range = ShapeHelpers.scalarShape(input.key)\n range.id = `link-${input.key}`\n range.dataType = modelTypeToAmfDataType(DATA_TYPE_STRING)\n return range\n }\n\n protected createUnionShape(\n input: DomainAssociation,\n items: Shapes.IShapeUnion[]\n ): Shapes.IApiUnionShape | Shapes.IApiArrayShape {\n const range = ShapeHelpers.unionShape(input.key)\n this.updateBaseProperties(input, range)\n range.anyOf = []\n const unionType = (input.schema && input.schema.unionType) || UNION_TYPE_ANY_OF\n if (unionType === UNION_TYPE_ANY_OF) {\n range.anyOf = items\n } else if (unionType === UNION_TYPE_ALL_OF) {\n range.and = items\n } else if (unionType === UNION_TYPE_ONE_OF) {\n range.xone = items\n } else {\n // the \"not\" union type only supports a single schema.\n // I am not sure how this should be handled. Will take the first one\n // for now.\n range.not = items[0]\n }\n if (input.multiple) {\n return this.refactorShapeToArray(input.key, range)\n }\n return range\n }\n\n /**\n * Generates a shape list for an union. Most likely you want to use the `associationProperty()` method instead.\n *\n * @param input The data association instance.\n * @returns The range value for the PropertyShape.\n */\n associationUnion(\n input: DomainAssociation,\n visited: Set<string> = new Set<string>()\n ): Shapes.IShapeUnion | Shapes.IShapeUnion[] | undefined {\n const result: Shapes.IShapeUnion[] = []\n for (const item of input.listTargets()) {\n result.push(this.entity(item, visited))\n }\n if (!result.length) {\n return undefined\n }\n if (result.length > 1) {\n return result\n }\n return result[0]\n }\n\n /**\n * The DomainProperty may have both the `schema` and the `bindings`. For AMF shape we read `schema` for\n * default value, examples, and enum values. We also look for the `web`\n * bindings for more detailed definition of a shape.\n *\n * @param input\n */\n protected getRange(input: DomainProperty): Shapes.IApiArrayShape | Shapes.IApiFileShape | Shapes.IApiScalarShape {\n const bindings = input.readBinding('web') as PropertyWebBindings | undefined\n let schema: PropertySchema | undefined\n if (input.schema) {\n schema = input.schema\n }\n const { multiple, type } = input\n if (multiple) {\n return this.createArrayShape(input, schema, bindings)\n }\n if (type === DATA_TYPE_BINARY) {\n return this.createFileShape(input, bindings)\n }\n return this.createScalarShape(input, schema, bindings)\n }\n\n /**\n * Normally this would be part of generating a scalar schema but the the property is an array this\n * is generated on the array and not on the range.\n *\n * @param result The scalar or array shape.\n * @param schema The property schema\n * @param type The data type of the parent property as set on the `range`\n * @param isArray Whether the DomainProperty is multiple\n */\n protected setShapeSchema(\n input: DomainProperty,\n result: Shapes.IApiAnyShape,\n schema: PropertySchema,\n type: string,\n isArray?: boolean\n ): void {\n if (schema.defaultValue) {\n const { type: dfFormat } = schema.defaultValue\n const { value } = schema.defaultValue\n if (dfFormat === 'function') {\n const tmp = this.valueGenerator.generate(value, input.type)\n if (tmp !== DataValueGenerator.noValue) {\n const dt = AmfDataNode.scalar(tmp as string, dfFormat)\n result.defaultValue = dt.toJSON()\n }\n } else {\n const dt = AmfDataNode.scalar(value, type)\n result.defaultValue = dt.toJSON()\n }\n }\n if (Array.isArray(schema.enum)) {\n result.values = schema.enum.map((i) => AmfDataNode.scalar(i, type).toJSON())\n }\n if (Array.isArray(schema.examples)) {\n if (isArray) {\n result.examples = this.createArrayExamples(schema.examples, type)\n } else {\n result.examples = this.createExamples(schema.examples, type)\n }\n }\n }\n\n protected createArrayShape(\n input: DomainProperty,\n schema?: PropertySchema,\n bindings?: PropertyWebBindings\n ): Shapes.IApiArrayShape {\n const result = ShapeHelpers.arrayShape(input.key)\n const { type } = input\n if (type === DATA_TYPE_BINARY) {\n // we do not pass schema to the range generator as we set schema's properties on the array shape.\n result.items = this.createFileShape(input, bindings)\n } else {\n result.items = this.createScalarShape(input, undefined, bindings)\n }\n if (schema) {\n const type = (result.items as Shapes.IApiScalarShape).dataType as string\n this.setShapeSchema(input, result, schema, type, input.multiple)\n }\n return result\n }\n\n protected createScalarShape(\n input: DomainProperty,\n schema?: PropertySchema,\n bindings?: PropertyWebBindings\n ): Shapes.IApiScalarShape {\n const result = ShapeHelpers.scalarShape(input.key)\n this.updateBaseProperties(input, result)\n this.setScalarCommonProperties(result, input, bindings)\n if (!result.dataType) {\n result.dataType = modelTypeToAmfDataType(input.type, bindings)\n }\n if (schema) {\n this.setShapeSchema(input, result, schema, result.dataType as string, input.multiple)\n }\n return result\n }\n\n protected createExamples(examples: string[], type: string): Shapes.IApiDataExample[] {\n const result: Shapes.IApiDataExample[] = []\n for (const current of examples) {\n const item: Shapes.IApiDataExample = {\n id: nanoid(),\n customDomainProperties: [],\n strict: true,\n types: [...AmfTypes.IAmfExampleTypes],\n structuredValue: AmfDataNode.scalar(current, type).toJSON(),\n }\n result.push(item)\n }\n return result\n }\n\n protected createArrayExamples(examples: string[], type: string): Shapes.IApiDataExample[] {\n const item: Shapes.IApiDataExample = {\n id: nanoid(),\n customDomainProperties: [],\n strict: true,\n types: [...AmfTypes.IAmfExampleTypes],\n }\n const value = new AmfDataNode('array')\n for (const item of examples) {\n const member = AmfDataNode.scalar(item, type)\n value.addMember(member)\n }\n item.structuredValue = value.toJSON()\n return [item]\n }\n\n protected createFileShape(input: DomainProperty, bindings?: PropertyWebBindings): Shapes.IApiFileShape {\n const result = ShapeHelpers.fileShape(input.key)\n this.updateBaseProperties(input, result)\n if (bindings) {\n if (Array.isArray(bindings.fileTypes)) {\n result.fileTypes = bindings.fileTypes\n }\n this.setScalarCommonProperties(result, input, bindings)\n if (bindings.format === 'base64') {\n result.format = AmfNamespace.w3.xmlSchema.base64Binary\n }\n }\n return result\n }\n\n protected setScalarCommonProperties(\n result: Shapes.IApiFileShape | Shapes.IApiScalarShape,\n input: DomainProperty,\n bindings?: PropertyWebBindings\n ): void {\n if (bindings?.name) {\n result.name = bindings.name\n }\n if (bindings?.xml) {\n result.xmlSerialization = bindings.xml\n }\n const { schema, type } = input\n if (schema) {\n if (schema.pattern) {\n result.pattern = schema.pattern\n }\n if (typeof schema.multipleOf === 'number') {\n result.multipleOf = schema.multipleOf\n }\n if (typeof schema.minimum === 'number') {\n if (type === DATA_TYPE_STRING) {\n result.minLength = schema.minimum\n } else {\n result.minimum = schema.minimum\n }\n }\n if (typeof schema.maximum === 'number') {\n if (type === DATA_TYPE_STRING) {\n result.maxLength = schema.maximum\n } else {\n result.maximum = schema.maximum\n }\n }\n if (typeof schema.exclusiveMinimum === 'boolean') {\n result.exclusiveMinimum = schema.exclusiveMinimum\n }\n if (typeof schema.exclusiveMaximum === 'boolean') {\n result.exclusiveMaximum = schema.exclusiveMaximum\n }\n }\n if (bindings?.format) {\n switch (bindings.format) {\n case 'base64':\n result.format = AmfNamespace.w3.xmlSchema.base64Binary\n break\n case 'double':\n result.format = AmfNamespace.w3.xmlSchema.double\n break\n case 'float':\n result.format = AmfNamespace.w3.xmlSchema.float\n break\n case 'int32':\n result.format = AmfNamespace.w3.xmlSchema.integer\n break\n case 'int64':\n result.format = AmfNamespace.w3.xmlSchema.integer\n break\n }\n // result.format = bindings.format\n }\n if (typeof input.readOnly === 'boolean') {\n result.readOnly = input.readOnly\n }\n if (typeof input.writeOnly === 'boolean') {\n result.writeOnly = input.writeOnly\n }\n }\n\n protected updateBaseProperties(\n input: DomainProperty | DomainAssociation | DomainEntity,\n target: Shapes.IApiShape\n ): void {\n target.name = input.info.name\n target.displayName = input.info.displayName\n target.description = input.info.description\n if (input.kind === DomainPropertyKind) {\n target.deprecated = (input as DomainProperty).deprecated\n } else if (input.kind === DomainEntityKind) {\n target.deprecated = (input as DomainEntity).deprecated\n }\n }\n\n protected createRecursiveShape(input: DomainEntity): Shapes.IApiRecursiveShape {\n return ShapeHelpers.recursiveShape(input.key, input.key)\n }\n\n /**\n * Translates the shape to an array shape. This happens when data model property\n * is changed from 'multiple' to not-multiple and back.\n *\n * @param id The key of the parameter or an association\n * @param shape The shape to wrap as an array.\n * @returns Array shape.\n */\n protected refactorShapeToArray(id: string, shape: Shapes.IShapeUnion): Shapes.IApiArrayShape {\n const result = ShapeHelpers.arrayShape(id)\n result.items = shape\n return result\n }\n}\n"]}
1
+ {"version":3,"file":"ShapeGenerator.js","sourceRoot":"","sources":["../../../../src/modeling/amf/ShapeGenerator.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAA;AACxD,OAAO,EAAE,YAAY,EAAe,WAAW,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AACrG,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AACxC,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAA;AAG5E,MAAM,iBAAiB,GAAG,OAAO,CAAA;AACjC,MAAM,iBAAiB,GAAG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AAC;QACD,IAAI,OAAO,KAAK,CAAC,SAAS,KAAK,SAAS,EAAE,CAAC;YACzC,MAAM,CAAC,SAAS,GAAG,KAAK,CAAC,SAAS,CAAA;QACpC,CAAC;IACH,CAAC;IAES,oBAAoB,CAC5B,KAAwD,EACxD,MAAwB;QAExB,MAAM,CAAC,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAA;QAC7B,MAAM,CAAC,WAAW,GAAG,KAAK,CAAC,IAAI,CAAC,WAAW,CAAA;QAC3C,MAAM,CAAC,WAAW,GAAG,KAAK,CAAC,IAAI,CAAC,WAAW,CAAA;QAC3C,IAAI,KAAK,CAAC,IAAI,KAAK,kBAAkB,EAAE,CAAC;YACtC,MAAM,CAAC,UAAU,GAAI,KAAwB,CAAC,UAAU,CAAA;QAC1D,CAAC;aAAM,IAAI,KAAK,CAAC,IAAI,KAAK,gBAAgB,EAAE,CAAC;YAC3C,MAAM,CAAC,UAAU,GAAI,KAAsB,CAAC,UAAU,CAAA;QACxD,CAAC;IACH,CAAC;IAES,oBAAoB,CAAC,KAAmB;QAChD,OAAO,YAAY,CAAC,cAAc,CAAC,KAAK,CAAC,GAAG,EAAE,KAAK,CAAC,GAAG,CAAC,CAAA;IAC1D,CAAC;IAED;;;;;;;OAOG;IACO,oBAAoB,CAAC,EAAU,EAAE,KAAyB;QAClE,MAAM,MAAM,GAAG,YAAY,CAAC,UAAU,CAAC,EAAE,CAAC,CAAA;QAC1C,MAAM,CAAC,KAAK,GAAG,KAAK,CAAA;QACpB,OAAO,MAAM,CAAA;IACf,CAAC;CACF","sourcesContent":["import { type AssociationBindings, type PropertyWebBindings } from '../Bindings.js'\nimport type { DomainAssociation } from '../DomainAssociation.js'\nimport type { DomainProperty } from '../DomainProperty.js'\nimport type { DomainEntity } from '../DomainEntity.js'\nimport { modelTypeToAmfDataType } from './core_types.js'\nimport { AmfNamespace, type Shapes, AmfDataNode, AmfTypes, ShapeHelpers } from '@api-client/amf-core'\nimport { DataValueGenerator } from './DataValueGenerator.js'\nimport { nanoid } from '../../nanoid.js'\nimport { DomainEntityKind, DomainPropertyKind } from '../../models/kinds.js'\nimport type { PropertySchema } from '../types.js'\n\nconst UNION_TYPE_ANY_OF = 'anyOf'\nconst UNION_TYPE_ALL_OF = 'allOf'\nconst UNION_TYPE_ONE_OF = 'oneOf'\nconst UNION_TYPE_NOT = 'not'\nconst DATA_TYPE_STRING = 'string'\nconst DATA_TYPE_BINARY = 'binary'\n\n/**\n * Serializes Data Domain elements (DomainEntity, DomainProperty, DomainAssociation)\n * to AMF shapes.\n *\n * This class provides a mechanism to translate a data domain model, defined using\n * custom classes like `DomainEntity`, `DomainProperty`, and `DomainAssociation`,\n * into AMF (API Modeling Framework) shapes. AMF shapes are a standardized way\n * to represent API structures and data models, enabling interoperability and tooling.\n *\n * This is particularly useful when you have a custom data model and need to\n * generate API definitions (e.g., RAML or OAS) from it.\n *\n * **Key Features:**\n *\n * - **Data Domain to AMF Translation:** Converts data domain elements into\n * their corresponding AMF shape representations.\n * - **Recursive Shape Handling:** Detects and handles recursive relationships\n * within the data model to prevent infinite loops during shape generation.\n * - **Union Type Support:** Supports the creation of union types in AMF\n * to represent associations that can point to multiple different entity types.\n * - **Binding Integration:** Leverages binding information (e.g., web bindings)\n * to customize the generated AMF shapes based on the target API format.\n * - **Example and Default Value Generation:** Integrates with a `DataValueGenerator`\n * to automatically generate example values and default values for properties\n * within the AMF shapes.\n *\n * **Usage:**\n *\n * 1. Create an instance of the `ShapeGenerator`.\n * 2. Call the appropriate method (e.g., `entity()`, `property()`, `associationShape()`)\n * to generate the AMF shape for a specific data domain element.\n * 3. The returned AMF shape can then be used with other AMF tools to generate\n * API definitions or perform other API-related tasks.\n */\nexport class ShapeGenerator {\n #valueGenerator?: DataValueGenerator\n\n /**\n * Used with data domain value generation for entity properties.\n * Lazily loaded class only when functions are used.\n * This needs to be a class instances because some functions are incremental\n */\n get valueGenerator(): DataValueGenerator {\n // we need a new instance of the generator for each shape generation\n // as the generator is stateful and we need to reset it for each shape.\n if (!this.#valueGenerator) {\n this.#valueGenerator = new DataValueGenerator()\n }\n return this.#valueGenerator\n }\n\n /**\n * Serializes a `DomainEntity` to an AMF node shape.\n *\n * This method is the entry point for converting a `DomainEntity` into its\n * AMF representation. It handles recursive relationships, property serialization,\n * and inheritance from parent entities.\n *\n * @param input The `DomainEntity` to serialize.\n * @param visited A `Set` of keys of already generated entities. This prevents\n * recursive shape generation and avoids infinite loops. Defaults to a new empty `Set`.\n * @returns An `IApiNodeShape` or `IApiRecursiveShape` representing the entity in AMF.\n * Returns a `IApiRecursiveShape` if a recursive loop is detected.\n * @example\n * ```typescript\n * const generator = new ShapeGenerator();\n * const amfShape = generator.entity(myDomainEntity);\n * ```\n */\n entity(input: DomainEntity, visited = new Set<string>()): Shapes.IApiNodeShape | Shapes.IApiRecursiveShape {\n if (visited.has(input.key)) {\n // create a recursive shape.\n return this.createRecursiveShape(input)\n }\n visited.add(input.key)\n const result = ShapeHelpers.nodeShape(input.key)\n result.id = input.key\n this.updateBaseProperties(input, result)\n result.properties = []\n for (const item of input.listProperties()) {\n // we check whether the property is hidden.\n // This is not happening when calling the `property()` because this method\n // always returns the AMF shape.\n const wb = item.readBinding('web') as PropertyWebBindings | undefined\n if (wb && wb.hidden) {\n continue\n }\n const shape = this.property(item)\n result.properties.push(shape)\n }\n for (const assoc of input.listAssociations()) {\n const wb = assoc.readBinding('web') as AssociationBindings | undefined\n if (wb && wb.hidden) {\n continue\n }\n const prop = this.associationProperty(assoc, visited)\n result.properties.push(prop)\n }\n for (const parent of input.listParents()) {\n const shape = this.entity(parent, visited)\n result.inherits.push(shape)\n }\n return result\n }\n\n /**\n * Serializes a `DomainProperty` to an AMF property shape.\n *\n * This method converts a `DomainProperty` into an `IApiPropertyShape`,\n * defining its characteristics such as data type, required status, and\n * range (the shape of the property's value).\n *\n * @param input The `DomainProperty` to serialize.\n * @returns An `IApiPropertyShape` representing the property in AMF.\n * @example\n * ```typescript\n * const generator = new ShapeGenerator();\n * const amfShape = generator.property(myDomainProperty);\n * ```\n */\n property(input: DomainProperty): Shapes.IApiPropertyShape {\n const { required, key } = input\n const result = ShapeHelpers.propertyShape(key)\n result.path = `${AmfNamespace.aml.vocabularies.data.key}${input.info.name}`\n if (required) {\n result.minCount = 1\n }\n result.range = this.getRange(input)\n\n // for example, Example generator needs to know the name of the property\n // as it does not look into the \"range\" object.\n this.updateBaseProperties(input, result)\n\n // sync the name of the property shape with the range, in case it was changed by the bindings\n if (result.range.name) {\n result.name = result.range.name\n }\n return result\n }\n\n /**\n * Serializes a `DomainAssociation` to an AMF property shape, handling the\n * association's target entity or entities.\n *\n * This method is similar to `property()`, but it specifically handles\n * associations between entities. It determines the range of the property\n * based on the association's target(s) and generates the appropriate\n * AMF shape (e.g., a scalar shape for a linked schema, a union shape for\n * multiple targets).\n *\n * @param input The `DomainAssociation` to serialize.\n * @param visited A `Set` of keys of already generated entities. This prevents\n * recursive shape generation and avoids infinite loops. Defaults to a new empty `Set`.\n * @returns An `IApiPropertyShape` representing the association in AMF.\n * @example\n * ```typescript\n * const generator = new ShapeGenerator();\n * const amfShape = generator.associationProperty(myDomainAssociation);\n * ```\n */\n associationProperty(input: DomainAssociation, visited: Set<string> = new Set<string>()): Shapes.IApiPropertyShape {\n const { required, key } = input\n const result = ShapeHelpers.propertyShape(key)\n result.path = `${AmfNamespace.aml.vocabularies.data.key}${input.info.name}`\n if (required) {\n result.minCount = 1\n }\n result.range = this.associationShape(input, visited)\n\n this.updateBaseProperties(input, result)\n return result\n }\n\n /**\n * Generates a shape for an association. Most likely you want to use the `associationProperty()` method instead.\n *\n * @param input The data association instance.\n * @param visited A `Set` of keys of already generated entities. This prevents\n * recursive shape generation and avoids infinite loops. Defaults to a new empty `Set`.\n * @returns The range value for the PropertyShape.\n */\n associationShape(input: DomainAssociation, visited: Set<string> = new Set<string>()): Shapes.IShapeUnion | undefined {\n const schema = input.schema\n if (!schema?.embedded) {\n return this.createLinkedShape(input)\n }\n const items = this.associationUnion(input, visited)\n if (!items) {\n return\n }\n if (Array.isArray(items)) {\n return this.createUnionShape(input, items)\n }\n const unionType = (schema && schema.unionType) || UNION_TYPE_ANY_OF\n if (unionType === UNION_TYPE_NOT) {\n // Need to investigate more about \"not\" union type.\n // AMF supports it, but I am not sure how to handle it.\n const wrapper = ShapeHelpers.anyShape(input.key)\n wrapper.id = `not-shape-${input.key}`\n wrapper.not = items\n return wrapper\n }\n if (input.multiple) {\n return this.refactorShapeToArray(input.key, items)\n }\n return items\n }\n\n /**\n * @param input The data association instance.\n * @returns An AMF API scalar shape with the link to the schema.\n */\n protected createLinkedShape(input: DomainAssociation): Shapes.IApiScalarShape {\n // This is a link to the schema. In an API that would be the id\n // of a resource to request the data from.\n const range = ShapeHelpers.scalarShape(input.key)\n range.id = `link-${input.key}`\n range.dataType = modelTypeToAmfDataType(DATA_TYPE_STRING)\n return range\n }\n\n protected createUnionShape(\n input: DomainAssociation,\n items: Shapes.IShapeUnion[]\n ): Shapes.IApiUnionShape | Shapes.IApiArrayShape {\n const range = ShapeHelpers.unionShape(input.key)\n this.updateBaseProperties(input, range)\n range.anyOf = []\n const unionType = (input.schema && input.schema.unionType) || UNION_TYPE_ANY_OF\n if (unionType === UNION_TYPE_ANY_OF) {\n range.anyOf = items\n } else if (unionType === UNION_TYPE_ALL_OF) {\n range.and = items\n } else if (unionType === UNION_TYPE_ONE_OF) {\n range.xone = items\n } else {\n // the \"not\" union type only supports a single schema.\n // I am not sure how this should be handled. Will take the first one\n // for now.\n range.not = items[0]\n }\n if (input.multiple) {\n return this.refactorShapeToArray(input.key, range)\n }\n return range\n }\n\n /**\n * Generates a shape list for an union. Most likely you want to use the `associationProperty()` method instead.\n *\n * @param input The data association instance.\n * @returns The range value for the PropertyShape.\n */\n associationUnion(\n input: DomainAssociation,\n visited: Set<string> = new Set<string>()\n ): Shapes.IShapeUnion | Shapes.IShapeUnion[] | undefined {\n const result: Shapes.IShapeUnion[] = []\n for (const item of input.listTargets()) {\n result.push(this.entity(item, visited))\n }\n if (!result.length) {\n return undefined\n }\n if (result.length > 1) {\n return result\n }\n return result[0]\n }\n\n /**\n * The DomainProperty may have both the `schema` and the `bindings`. For AMF shape we read `schema` for\n * default value, examples, and enum values. We also look for the `web`\n * bindings for more detailed definition of a shape.\n *\n * @param input\n */\n protected getRange(input: DomainProperty): Shapes.IApiArrayShape | Shapes.IApiFileShape | Shapes.IApiScalarShape {\n const bindings = input.readBinding('web') as PropertyWebBindings | undefined\n let schema: PropertySchema | undefined\n if (input.schema) {\n schema = input.schema\n }\n const { multiple, type } = input\n if (multiple) {\n return this.createArrayShape(input, schema, bindings)\n }\n if (type === DATA_TYPE_BINARY) {\n return this.createFileShape(input, bindings)\n }\n return this.createScalarShape(input, schema, bindings)\n }\n\n /**\n * Normally this would be part of generating a scalar schema but the the property is an array this\n * is generated on the array and not on the range.\n *\n * @param result The scalar or array shape.\n * @param schema The property schema\n * @param type The data type of the parent property as set on the `range`\n * @param isArray Whether the DomainProperty is multiple\n */\n protected setShapeSchema(\n input: DomainProperty,\n result: Shapes.IApiAnyShape,\n schema: PropertySchema,\n type: string,\n isArray?: boolean\n ): void {\n if (schema.defaultValue) {\n const { type: dfFormat } = schema.defaultValue\n const { value } = schema.defaultValue\n if (dfFormat === 'function') {\n const tmp = this.valueGenerator.generate(value, input.type)\n if (tmp !== DataValueGenerator.noValue) {\n const dt = AmfDataNode.scalar(tmp as string, dfFormat)\n result.defaultValue = dt.toJSON()\n }\n } else {\n const dt = AmfDataNode.scalar(value, type)\n result.defaultValue = dt.toJSON()\n }\n }\n if (Array.isArray(schema.enum)) {\n result.values = schema.enum.map((i) => AmfDataNode.scalar(i, type).toJSON())\n }\n if (Array.isArray(schema.examples)) {\n if (isArray) {\n result.examples = this.createArrayExamples(schema.examples, type)\n } else {\n result.examples = this.createExamples(schema.examples, type)\n }\n }\n }\n\n protected createArrayShape(\n input: DomainProperty,\n schema?: PropertySchema,\n bindings?: PropertyWebBindings\n ): Shapes.IApiArrayShape {\n const result = ShapeHelpers.arrayShape(input.key)\n const { type } = input\n if (type === DATA_TYPE_BINARY) {\n // we do not pass schema to the range generator as we set schema's properties on the array shape.\n result.items = this.createFileShape(input, bindings)\n } else {\n result.items = this.createScalarShape(input, undefined, bindings)\n }\n if (schema) {\n const type = (result.items as Shapes.IApiScalarShape).dataType as string\n this.setShapeSchema(input, result, schema, type, input.multiple)\n }\n return result\n }\n\n protected createScalarShape(\n input: DomainProperty,\n schema?: PropertySchema,\n bindings?: PropertyWebBindings\n ): Shapes.IApiScalarShape {\n const result = ShapeHelpers.scalarShape(input.key)\n this.updateBaseProperties(input, result)\n this.setScalarCommonProperties(result, input, bindings)\n if (!result.dataType) {\n result.dataType = modelTypeToAmfDataType(input.type, bindings)\n }\n if (schema) {\n this.setShapeSchema(input, result, schema, result.dataType as string, input.multiple)\n }\n return result\n }\n\n protected createExamples(examples: string[], type: string): Shapes.IApiDataExample[] {\n const result: Shapes.IApiDataExample[] = []\n for (const current of examples) {\n const item: Shapes.IApiDataExample = {\n id: nanoid(),\n customDomainProperties: [],\n strict: true,\n types: [...AmfTypes.IAmfExampleTypes],\n structuredValue: AmfDataNode.scalar(current, type).toJSON(),\n }\n result.push(item)\n }\n return result\n }\n\n protected createArrayExamples(examples: string[], type: string): Shapes.IApiDataExample[] {\n const item: Shapes.IApiDataExample = {\n id: nanoid(),\n customDomainProperties: [],\n strict: true,\n types: [...AmfTypes.IAmfExampleTypes],\n }\n const value = new AmfDataNode('array')\n for (const item of examples) {\n const member = AmfDataNode.scalar(item, type)\n value.addMember(member)\n }\n item.structuredValue = value.toJSON()\n return [item]\n }\n\n protected createFileShape(input: DomainProperty, bindings?: PropertyWebBindings): Shapes.IApiFileShape {\n const result = ShapeHelpers.fileShape(input.key)\n this.updateBaseProperties(input, result)\n if (bindings) {\n if (Array.isArray(bindings.fileTypes)) {\n result.fileTypes = bindings.fileTypes\n }\n this.setScalarCommonProperties(result, input, bindings)\n if (bindings.format === 'base64') {\n result.format = AmfNamespace.w3.xmlSchema.base64Binary\n }\n }\n return result\n }\n\n protected setScalarCommonProperties(\n result: Shapes.IApiFileShape | Shapes.IApiScalarShape,\n input: DomainProperty,\n bindings?: PropertyWebBindings\n ): void {\n if (bindings?.name) {\n result.name = bindings.name\n }\n if (bindings?.xml) {\n result.xmlSerialization = bindings.xml\n }\n const { schema, type } = input\n if (schema) {\n if (schema.pattern) {\n result.pattern = schema.pattern\n }\n if (typeof schema.multipleOf === 'number') {\n result.multipleOf = schema.multipleOf\n }\n if (typeof schema.minimum === 'number') {\n if (type === DATA_TYPE_STRING) {\n result.minLength = schema.minimum\n } else {\n result.minimum = schema.minimum\n }\n }\n if (typeof schema.maximum === 'number') {\n if (type === DATA_TYPE_STRING) {\n result.maxLength = schema.maximum\n } else {\n result.maximum = schema.maximum\n }\n }\n if (typeof schema.exclusiveMinimum === 'boolean') {\n result.exclusiveMinimum = schema.exclusiveMinimum\n }\n if (typeof schema.exclusiveMaximum === 'boolean') {\n result.exclusiveMaximum = schema.exclusiveMaximum\n }\n }\n if (bindings?.format) {\n switch (bindings.format) {\n case 'base64':\n result.format = AmfNamespace.w3.xmlSchema.base64Binary\n break\n case 'double':\n result.format = AmfNamespace.w3.xmlSchema.double\n break\n case 'float':\n result.format = AmfNamespace.w3.xmlSchema.float\n break\n case 'int32':\n result.format = AmfNamespace.w3.xmlSchema.integer\n break\n case 'int64':\n result.format = AmfNamespace.w3.xmlSchema.integer\n break\n }\n // result.format = bindings.format\n }\n if (typeof input.readOnly === 'boolean') {\n result.readOnly = input.readOnly\n }\n if (typeof input.writeOnly === 'boolean') {\n result.writeOnly = input.writeOnly\n }\n }\n\n protected updateBaseProperties(\n input: DomainProperty | DomainAssociation | DomainEntity,\n target: Shapes.IApiShape\n ): void {\n target.name = input.info.name\n target.displayName = input.info.displayName\n target.description = input.info.description\n if (input.kind === DomainPropertyKind) {\n target.deprecated = (input as DomainProperty).deprecated\n } else if (input.kind === DomainEntityKind) {\n target.deprecated = (input as DomainEntity).deprecated\n }\n }\n\n protected createRecursiveShape(input: DomainEntity): Shapes.IApiRecursiveShape {\n return ShapeHelpers.recursiveShape(input.key, input.key)\n }\n\n /**\n * Translates the shape to an array shape. This happens when data model property\n * is changed from 'multiple' to not-multiple and back.\n *\n * @param id The key of the parameter or an association\n * @param shape The shape to wrap as an array.\n * @returns Array shape.\n */\n protected refactorShapeToArray(id: string, shape: Shapes.IShapeUnion): Shapes.IApiArrayShape {\n const result = ShapeHelpers.arrayShape(id)\n result.items = shape\n return result\n }\n}\n"]}
@@ -309,7 +309,7 @@ export class OasGenerator {
309
309
  }
310
310
  const links = {};
311
311
  for (const assoc of domainEntity.associations) {
312
- if (assoc.schema?.linked === false) {
312
+ if (assoc.schema?.embedded === true) {
313
313
  continue;
314
314
  }
315
315
  const targets = Array.from(assoc.listTargets());