@api-client/core 0.14.0 → 0.14.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/src/amf/AmfTypes.d.ts +1 -1
- package/build/src/amf/AmfTypes.js +1 -1
- package/build/src/amf/AmfTypes.js.map +1 -1
- package/build/src/amf/Utils.d.ts +0 -6
- package/build/src/amf/Utils.d.ts.map +1 -1
- package/build/src/amf/Utils.js +0 -14
- package/build/src/amf/Utils.js.map +1 -1
- package/build/src/browser.d.ts +2 -1
- package/build/src/browser.d.ts.map +1 -1
- package/build/src/browser.js +1 -0
- package/build/src/browser.js.map +1 -1
- package/build/src/index.d.ts +2 -1
- package/build/src/index.d.ts.map +1 -1
- package/build/src/index.js +1 -0
- package/build/src/index.js.map +1 -1
- package/build/src/legacy.d.ts +0 -8
- package/build/src/legacy.d.ts.map +1 -1
- package/build/src/legacy.js +0 -9
- package/build/src/legacy.js.map +1 -1
- package/build/src/modeling/Bindings.d.ts +1 -1
- package/build/src/modeling/Bindings.js.map +1 -1
- package/build/src/modeling/DataDomain.js +2 -2
- package/build/src/modeling/DataDomain.js.map +1 -1
- package/build/src/modeling/DataFormat.d.ts +0 -40
- package/build/src/modeling/DataFormat.d.ts.map +1 -1
- package/build/src/modeling/DataFormat.js +0 -27
- package/build/src/modeling/DataFormat.js.map +1 -1
- package/build/src/modeling/DomainAssociation.d.ts +63 -0
- package/build/src/modeling/DomainAssociation.d.ts.map +1 -1
- package/build/src/modeling/DomainAssociation.js +110 -4
- package/build/src/modeling/DomainAssociation.js.map +1 -1
- package/build/src/modeling/DomainEntity.d.ts +25 -9
- package/build/src/modeling/DomainEntity.d.ts.map +1 -1
- package/build/src/modeling/DomainEntity.js +65 -21
- package/build/src/modeling/DomainEntity.js.map +1 -1
- package/build/src/modeling/DomainFile.d.ts +1 -1
- package/build/src/modeling/DomainFile.js +1 -1
- package/build/src/modeling/DomainFile.js.map +1 -1
- package/build/src/modeling/DomainImpactAnalysis.d.ts +1 -1
- package/build/src/modeling/DomainImpactAnalysis.d.ts.map +1 -1
- package/build/src/modeling/DomainImpactAnalysis.js +3 -3
- package/build/src/modeling/DomainImpactAnalysis.js.map +1 -1
- package/build/src/modeling/DomainModel.d.ts +2 -2
- package/build/src/modeling/DomainModel.js +2 -2
- package/build/src/modeling/DomainModel.js.map +1 -1
- package/build/src/modeling/DomainProperty.d.ts +28 -12
- package/build/src/modeling/DomainProperty.d.ts.map +1 -1
- package/build/src/modeling/DomainProperty.js +61 -26
- package/build/src/modeling/DomainProperty.js.map +1 -1
- package/build/src/modeling/Semantics.d.ts +117 -0
- package/build/src/modeling/Semantics.d.ts.map +1 -0
- package/build/src/modeling/Semantics.js +112 -0
- package/build/src/modeling/Semantics.js.map +1 -0
- package/build/src/models/kinds.d.ts +0 -24
- package/build/src/models/kinds.d.ts.map +1 -1
- package/build/src/models/kinds.js +0 -24
- package/build/src/models/kinds.js.map +1 -1
- package/build/src/models/store/data_catalog.d.ts +1 -1
- package/build/src/models/store/data_catalog.js.map +1 -1
- package/build/tsconfig.tsbuildinfo +1 -1
- package/data/models/APIC-187.json +3 -3
- package/data/models/APIC-188.json +3 -3
- package/data/models/APIC-233.json +1 -1
- package/data/models/APIC-391.json +2 -2
- package/data/models/APIC-483.json +1 -1
- package/data/models/APIC-487.json +1 -1
- package/data/models/APIC-655.json +1 -1
- package/data/models/APIC-689.json +1 -1
- package/data/models/APIC-690.json +5 -5
- package/data/models/SE-10469.json +1 -1
- package/data/models/SE-13092.json +5 -5
- package/data/models/SE-22063.json +12 -2
- package/data/models/amf-helper-api.json +154 -14
- package/data/models/arc-demo-api.json +95 -15
- package/data/models/async-api.json +1 -1
- package/data/models/example-generator-api.json +369 -29
- package/data/models/expanded-api.json +1 -1
- package/data/models/flattened-api.json +1 -1
- package/data/models/multiple-servers.json +1 -1
- package/data/models/oas-3-api.json +1 -1
- package/data/models/oas-date.json +1 -1
- package/data/models/oas-types.json +1 -1
- package/data/models/oas-unions.json +1 -1
- package/data/models/petstore.json +1 -1
- package/data/models/raml-date.json +1 -1
- package/data/models/recursive.json +1 -1
- package/data/models/schema-api.json +62 -2
- package/data/models/secured-api.json +16 -16
- package/data/models/tracked-to-linked.json +4 -4
- package/package.json +2 -2
- package/src/amf/AmfTypes.ts +1 -1
- package/src/amf/Utils.ts +0 -15
- package/src/modeling/Bindings.ts +1 -1
- package/src/modeling/DataDomain.ts +2 -2
- package/src/modeling/DataFormat.ts +0 -48
- package/src/modeling/DomainAssociation.ts +122 -3
- package/src/modeling/DomainEntity.ts +56 -17
- package/src/modeling/DomainFile.ts +1 -1
- package/src/modeling/DomainImpactAnalysis.ts +3 -3
- package/src/modeling/DomainModel.ts +2 -2
- package/src/modeling/DomainProperty.ts +60 -21
- package/src/modeling/Semantics.ts +195 -0
- package/src/modeling/graph.md +14 -14
- package/src/modeling/readme.md +29 -29
- package/src/models/kinds.ts +0 -25
- package/src/models/store/data_catalog.ts +1 -1
- package/tests/unit/modeling/data_domain_change_observers.spec.ts +11 -10
- package/tests/unit/modeling/data_domain_entities.spec.ts +129 -1
- package/tests/unit/modeling/data_domain_property.spec.ts +1 -1
- package/tests/unit/modeling/domain_asociation.spec.ts +267 -0
- package/tests/unit/modeling/domain_entity.spec.ts +27 -26
- package/tests/unit/modeling/domain_entity_example_generator_json.spec.ts +11 -11
- package/tests/unit/modeling/domain_entity_example_generator_xml.spec.ts +10 -10
- package/tests/unit/modeling/{domain.property.spec.ts → domain_property.spec.ts} +139 -23
- package/tests/unit/modeling/semantics.spec.ts +149 -0
- package/build/src/amf/AmfShapeGenerator.d.ts +0 -103
- package/build/src/amf/AmfShapeGenerator.d.ts.map +0 -1
- package/build/src/amf/AmfShapeGenerator.js +0 -416
- package/build/src/amf/AmfShapeGenerator.js.map +0 -1
- package/build/src/modeling/legacy/DataAssociation.d.ts +0 -284
- package/build/src/modeling/legacy/DataAssociation.d.ts.map +0 -1
- package/build/src/modeling/legacy/DataAssociation.js +0 -443
- package/build/src/modeling/legacy/DataAssociation.js.map +0 -1
- package/build/src/modeling/legacy/DataEntity.d.ts +0 -358
- package/build/src/modeling/legacy/DataEntity.d.ts.map +0 -1
- package/build/src/modeling/legacy/DataEntity.js +0 -855
- package/build/src/modeling/legacy/DataEntity.js.map +0 -1
- package/build/src/modeling/legacy/DataEntityBuilder.d.ts +0 -162
- package/build/src/modeling/legacy/DataEntityBuilder.d.ts.map +0 -1
- package/build/src/modeling/legacy/DataEntityBuilder.js +0 -221
- package/build/src/modeling/legacy/DataEntityBuilder.js.map +0 -1
- package/build/src/modeling/legacy/DataImpactAnalysis.d.ts +0 -298
- package/build/src/modeling/legacy/DataImpactAnalysis.d.ts.map +0 -1
- package/build/src/modeling/legacy/DataImpactAnalysis.js +0 -441
- package/build/src/modeling/legacy/DataImpactAnalysis.js.map +0 -1
- package/build/src/modeling/legacy/DataModel.d.ts +0 -99
- package/build/src/modeling/legacy/DataModel.d.ts.map +0 -1
- package/build/src/modeling/legacy/DataModel.js +0 -237
- package/build/src/modeling/legacy/DataModel.js.map +0 -1
- package/build/src/modeling/legacy/DataNamespace.d.ts +0 -340
- package/build/src/modeling/legacy/DataNamespace.d.ts.map +0 -1
- package/build/src/modeling/legacy/DataNamespace.js +0 -784
- package/build/src/modeling/legacy/DataNamespace.js.map +0 -1
- package/build/src/modeling/legacy/DataProperty.d.ts +0 -332
- package/build/src/modeling/legacy/DataProperty.d.ts.map +0 -1
- package/build/src/modeling/legacy/DataProperty.js +0 -415
- package/build/src/modeling/legacy/DataProperty.js.map +0 -1
- package/build/src/models/store/DataFile.d.ts +0 -29
- package/build/src/models/store/DataFile.d.ts.map +0 -1
- package/build/src/models/store/DataFile.js +0 -87
- package/build/src/models/store/DataFile.js.map +0 -1
- package/src/amf/AmfShapeGenerator.ts +0 -477
- package/src/modeling/legacy/DataAssociation.ts +0 -554
- package/src/modeling/legacy/DataEntity.ts +0 -1019
- package/src/modeling/legacy/DataEntityBuilder.ts +0 -236
- package/src/modeling/legacy/DataImpactAnalysis.ts +0 -530
- package/src/modeling/legacy/DataModel.ts +0 -276
- package/src/modeling/legacy/DataNamespace.ts +0 -929
- package/src/modeling/legacy/DataProperty.ts +0 -630
- package/src/models/store/DataFile.ts +0 -95
- package/tests/unit/modeling/legacy/amf_shape_generator.spec.ts +0 -1041
- package/tests/unit/modeling/legacy/data_association.spec.ts +0 -710
- package/tests/unit/modeling/legacy/data_entity.spec.ts +0 -2061
- package/tests/unit/modeling/legacy/data_entity_generator_json.spec.ts +0 -987
- package/tests/unit/modeling/legacy/data_entity_generator_xml.spec.ts +0 -1451
- package/tests/unit/modeling/legacy/data_model.spec.ts +0 -395
- package/tests/unit/modeling/legacy/data_namespace.spec.ts +0 -1312
- package/tests/unit/modeling/legacy/data_property.spec.ts +0 -887
- package/tests/unit/modeling/legacy/impact_analysis.spec.ts +0 -373
|
@@ -7,6 +7,26 @@ import type { IApiAssociationShape, IApiPropertyShape } from '../amf/definitions
|
|
|
7
7
|
import type { AssociationBinding, AssociationBindings, AssociationWebBindings } from './Bindings.js';
|
|
8
8
|
import { DomainAttributeAttribute } from './DataFormat.js';
|
|
9
9
|
import type { AssociationTarget } from './types.js';
|
|
10
|
+
import { type SemanticType, type AppliedDataSemantic } from './Semantics.js';
|
|
11
|
+
/**
|
|
12
|
+
* Defines the behavior when a parent entity in an association is deleted.
|
|
13
|
+
*
|
|
14
|
+
* - `restrict`: Prevents the deletion of a parent entity if it has any associated child entities.
|
|
15
|
+
* The generated API should return a clear and specific error message (e.g., 409 Conflict).
|
|
16
|
+
* - _Example_: Do not allow a Department to be deleted if it still has Employees.
|
|
17
|
+
* - `cascade`: Automatically deletes all associated child entities when the parent entity is deleted.
|
|
18
|
+
* - _Example_: Deleting a User will also delete all their associated Posts and Comments.
|
|
19
|
+
* - `setNull`: Sets the foreign key of the associated child entities to NULL. This is only valid if the
|
|
20
|
+
* association property on the child entity is nullable.
|
|
21
|
+
* - _Example_: When a `Project` is deleted, the `project_id` on associated `Tasks` is set to NULL,
|
|
22
|
+
* making them unassigned but not deleting them.
|
|
23
|
+
* - `doNothing`: No action is taken on the associated child entities when the parent entity is deleted.
|
|
24
|
+
* - _Example_: Deleting a `Category` does not affect associated `Products`, which remain in the database
|
|
25
|
+
* but may become orphaned.
|
|
26
|
+
* This is useful when the association is optional or when child entities should not be deleted
|
|
27
|
+
* or modified upon the deletion of a parent entity.
|
|
28
|
+
*/
|
|
29
|
+
export type OnDeleteRule = 'restrict' | 'cascade' | 'setNull' | 'doNothing';
|
|
10
30
|
export interface DomainAssociationSchema extends DomainElementSchema {
|
|
11
31
|
kind: typeof DomainAssociationKind;
|
|
12
32
|
/**
|
|
@@ -43,6 +63,20 @@ export interface DomainAssociationSchema extends DomainElementSchema {
|
|
|
43
63
|
* When multiple associations are set then we are dealing with an union.
|
|
44
64
|
*/
|
|
45
65
|
targets?: AssociationTarget[];
|
|
66
|
+
/**
|
|
67
|
+
* The semantics applied to this association.
|
|
68
|
+
* This is a list of applied semantics that can be used to
|
|
69
|
+
* describe the association in more detail.
|
|
70
|
+
*/
|
|
71
|
+
semantics?: AppliedDataSemantic[];
|
|
72
|
+
/**
|
|
73
|
+
* Defines the behavior when a parent entity in an association is deleted.
|
|
74
|
+
*/
|
|
75
|
+
onDelete?: OnDeleteRule;
|
|
76
|
+
/**
|
|
77
|
+
* Whether the association is read-only.
|
|
78
|
+
*/
|
|
79
|
+
readOnly?: boolean;
|
|
46
80
|
}
|
|
47
81
|
/**
|
|
48
82
|
* Represents an association between entities in a data domain.
|
|
@@ -128,6 +162,18 @@ export declare class DomainAssociation extends DomainElement {
|
|
|
128
162
|
* When multiple associations are set then we are dealing with an union.
|
|
129
163
|
*/
|
|
130
164
|
accessor targets: AssociationTarget[];
|
|
165
|
+
/**
|
|
166
|
+
* Semantics applied to this association.
|
|
167
|
+
*/
|
|
168
|
+
accessor semantics: AppliedDataSemantic[];
|
|
169
|
+
/**
|
|
170
|
+
* Defines the behavior when a parent entity in an association is deleted.
|
|
171
|
+
*/
|
|
172
|
+
accessor onDelete: OnDeleteRule | undefined;
|
|
173
|
+
/**
|
|
174
|
+
* Whether the association is read-only.
|
|
175
|
+
*/
|
|
176
|
+
accessor readOnly: boolean | undefined;
|
|
131
177
|
/**
|
|
132
178
|
* Creates a full data association schema with defaults.
|
|
133
179
|
*
|
|
@@ -277,5 +323,22 @@ export declare class DomainAssociation extends DomainElement {
|
|
|
277
323
|
* @returns AMF property shape definition.
|
|
278
324
|
*/
|
|
279
325
|
toApiShape(): IApiPropertyShape;
|
|
326
|
+
/**
|
|
327
|
+
* Adds or updates a semantic to the association.
|
|
328
|
+
* @param semantic The semantic to add to the association.
|
|
329
|
+
* @throws Error if the semantic is not an association semantic.
|
|
330
|
+
*/
|
|
331
|
+
addSemantic(semantic: AppliedDataSemantic): void;
|
|
332
|
+
/**
|
|
333
|
+
* Removes a semantic from the association.
|
|
334
|
+
* @param semanticId The ID of the semantic to remove.
|
|
335
|
+
*/
|
|
336
|
+
removeSemantic(semanticId: SemanticType): void;
|
|
337
|
+
/**
|
|
338
|
+
* Checks if the association has a specific semantic.
|
|
339
|
+
* @param semanticId The ID of the semantic to check.
|
|
340
|
+
* @returns True if the semantic is present, false otherwise.
|
|
341
|
+
*/
|
|
342
|
+
hasSemantic(semanticId: SemanticType): boolean;
|
|
280
343
|
}
|
|
281
344
|
//# sourceMappingURL=DomainAssociation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DomainAssociation.d.ts","sourceRoot":"","sources":["../../../src/modeling/DomainAssociation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AACjD,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAA;AAC1D,OAAO,EAAE,aAAa,EAAE,KAAK,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AAE5E,OAAO,EAAE,KAAK,MAAM,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAA;AAEvD,OAAO,KAA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YAAY,GAAG,IAAI;IAQ9C;;;;OAIG;IACH,WAAW,CAAC,UAAU,EAAE,YAAY,GAAG,OAAO;CAG/C"}
|
|
@@ -6,6 +6,7 @@ import { Thing } from '../models/Thing.js';
|
|
|
6
6
|
import { observed, retargetChange, toRaw } from './observed.js';
|
|
7
7
|
import { DomainAttributeAttributes } from './DataFormat.js';
|
|
8
8
|
import { ShapeGenerator } from './amf/ShapeGenerator.js';
|
|
9
|
+
import { DataSemantics, isAssociationSemantic } from './Semantics.js';
|
|
9
10
|
/**
|
|
10
11
|
* Represents an association between entities in a data domain.
|
|
11
12
|
*
|
|
@@ -70,6 +71,15 @@ let DomainAssociation = (() => {
|
|
|
70
71
|
let _targets_decorators;
|
|
71
72
|
let _targets_initializers = [];
|
|
72
73
|
let _targets_extraInitializers = [];
|
|
74
|
+
let _semantics_decorators;
|
|
75
|
+
let _semantics_initializers = [];
|
|
76
|
+
let _semantics_extraInitializers = [];
|
|
77
|
+
let _onDelete_decorators;
|
|
78
|
+
let _onDelete_initializers = [];
|
|
79
|
+
let _onDelete_extraInitializers = [];
|
|
80
|
+
let _readOnly_decorators;
|
|
81
|
+
let _readOnly_initializers = [];
|
|
82
|
+
let _readOnly_extraInitializers = [];
|
|
73
83
|
return class DomainAssociation extends _classSuper {
|
|
74
84
|
static {
|
|
75
85
|
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
@@ -79,12 +89,18 @@ let DomainAssociation = (() => {
|
|
|
79
89
|
_schema_decorators = [observed({ deep: true })];
|
|
80
90
|
_bindings_decorators = [observed({ deep: true })];
|
|
81
91
|
_targets_decorators = [observed({ deep: true })];
|
|
92
|
+
_semantics_decorators = [observed({ deep: true })];
|
|
93
|
+
_onDelete_decorators = [observed()];
|
|
94
|
+
_readOnly_decorators = [observed()];
|
|
82
95
|
__esDecorate(this, null, _info_decorators, { kind: "accessor", name: "info", static: false, private: false, access: { has: obj => "info" in obj, get: obj => obj.info, set: (obj, value) => { obj.info = value; } }, metadata: _metadata }, _info_initializers, _info_extraInitializers);
|
|
83
96
|
__esDecorate(this, null, _required_decorators, { kind: "accessor", name: "required", static: false, private: false, access: { has: obj => "required" in obj, get: obj => obj.required, set: (obj, value) => { obj.required = value; } }, metadata: _metadata }, _required_initializers, _required_extraInitializers);
|
|
84
97
|
__esDecorate(this, null, _multiple_decorators, { kind: "accessor", name: "multiple", static: false, private: false, access: { has: obj => "multiple" in obj, get: obj => obj.multiple, set: (obj, value) => { obj.multiple = value; } }, metadata: _metadata }, _multiple_initializers, _multiple_extraInitializers);
|
|
85
98
|
__esDecorate(this, null, _schema_decorators, { kind: "accessor", name: "schema", static: false, private: false, access: { has: obj => "schema" in obj, get: obj => obj.schema, set: (obj, value) => { obj.schema = value; } }, metadata: _metadata }, _schema_initializers, _schema_extraInitializers);
|
|
86
99
|
__esDecorate(this, null, _bindings_decorators, { kind: "accessor", name: "bindings", static: false, private: false, access: { has: obj => "bindings" in obj, get: obj => obj.bindings, set: (obj, value) => { obj.bindings = value; } }, metadata: _metadata }, _bindings_initializers, _bindings_extraInitializers);
|
|
87
100
|
__esDecorate(this, null, _targets_decorators, { kind: "accessor", name: "targets", static: false, private: false, access: { has: obj => "targets" in obj, get: obj => obj.targets, set: (obj, value) => { obj.targets = value; } }, metadata: _metadata }, _targets_initializers, _targets_extraInitializers);
|
|
101
|
+
__esDecorate(this, null, _semantics_decorators, { kind: "accessor", name: "semantics", static: false, private: false, access: { has: obj => "semantics" in obj, get: obj => obj.semantics, set: (obj, value) => { obj.semantics = value; } }, metadata: _metadata }, _semantics_initializers, _semantics_extraInitializers);
|
|
102
|
+
__esDecorate(this, null, _onDelete_decorators, { kind: "accessor", name: "onDelete", static: false, private: false, access: { has: obj => "onDelete" in obj, get: obj => obj.onDelete, set: (obj, value) => { obj.onDelete = value; } }, metadata: _metadata }, _onDelete_initializers, _onDelete_extraInitializers);
|
|
103
|
+
__esDecorate(this, null, _readOnly_decorators, { kind: "accessor", name: "readOnly", static: false, private: false, access: { has: obj => "readOnly" in obj, get: obj => obj.readOnly, set: (obj, value) => { obj.readOnly = value; } }, metadata: _metadata }, _readOnly_initializers, _readOnly_extraInitializers);
|
|
88
104
|
if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
89
105
|
}
|
|
90
106
|
/**
|
|
@@ -138,6 +154,28 @@ let DomainAssociation = (() => {
|
|
|
138
154
|
*/
|
|
139
155
|
get targets() { return this.#targets_accessor_storage; }
|
|
140
156
|
set targets(value) { this.#targets_accessor_storage = value; }
|
|
157
|
+
#semantics_accessor_storage = (__runInitializers(this, _targets_extraInitializers), __runInitializers(this, _semantics_initializers, []
|
|
158
|
+
/**
|
|
159
|
+
* Defines the behavior when a parent entity in an association is deleted.
|
|
160
|
+
*/
|
|
161
|
+
));
|
|
162
|
+
/**
|
|
163
|
+
* Semantics applied to this association.
|
|
164
|
+
*/
|
|
165
|
+
get semantics() { return this.#semantics_accessor_storage; }
|
|
166
|
+
set semantics(value) { this.#semantics_accessor_storage = value; }
|
|
167
|
+
#onDelete_accessor_storage = (__runInitializers(this, _semantics_extraInitializers), __runInitializers(this, _onDelete_initializers, void 0));
|
|
168
|
+
/**
|
|
169
|
+
* Defines the behavior when a parent entity in an association is deleted.
|
|
170
|
+
*/
|
|
171
|
+
get onDelete() { return this.#onDelete_accessor_storage; }
|
|
172
|
+
set onDelete(value) { this.#onDelete_accessor_storage = value; }
|
|
173
|
+
#readOnly_accessor_storage = (__runInitializers(this, _onDelete_extraInitializers), __runInitializers(this, _readOnly_initializers, void 0));
|
|
174
|
+
/**
|
|
175
|
+
* Whether the association is read-only.
|
|
176
|
+
*/
|
|
177
|
+
get readOnly() { return this.#readOnly_accessor_storage; }
|
|
178
|
+
set readOnly(value) { this.#readOnly_accessor_storage = value; }
|
|
141
179
|
/**
|
|
142
180
|
* Creates a full data association schema with defaults.
|
|
143
181
|
*
|
|
@@ -145,13 +183,22 @@ let DomainAssociation = (() => {
|
|
|
145
183
|
* @returns The data association schema.
|
|
146
184
|
*/
|
|
147
185
|
static createSchema(input = {}) {
|
|
148
|
-
const { key = nanoid() } = input;
|
|
186
|
+
const { key = nanoid(), semantics = [] } = input;
|
|
149
187
|
const info = Thing.fromJSON(input.info, { name: 'new_association' }).toJSON();
|
|
150
188
|
const result = {
|
|
151
189
|
kind: DomainAssociationKind,
|
|
152
190
|
key,
|
|
153
191
|
info,
|
|
154
192
|
};
|
|
193
|
+
if (Array.isArray(semantics)) {
|
|
194
|
+
result.semantics = [...semantics];
|
|
195
|
+
}
|
|
196
|
+
if (input.onDelete) {
|
|
197
|
+
result.onDelete = input.onDelete;
|
|
198
|
+
}
|
|
199
|
+
if (typeof input.readOnly === 'boolean') {
|
|
200
|
+
result.readOnly = input.readOnly;
|
|
201
|
+
}
|
|
155
202
|
if (input.schema) {
|
|
156
203
|
result.schema = structuredClone(input.schema);
|
|
157
204
|
}
|
|
@@ -181,7 +228,7 @@ let DomainAssociation = (() => {
|
|
|
181
228
|
constructor(root, parent, input) {
|
|
182
229
|
const init = DomainAssociation.createSchema(input);
|
|
183
230
|
super(root, init.key);
|
|
184
|
-
__runInitializers(this,
|
|
231
|
+
__runInitializers(this, _readOnly_extraInitializers);
|
|
185
232
|
this.parent = parent;
|
|
186
233
|
this.kind = DomainAssociationKind;
|
|
187
234
|
this.info = new Thing(init.info);
|
|
@@ -206,6 +253,18 @@ let DomainAssociation = (() => {
|
|
|
206
253
|
else {
|
|
207
254
|
this.targets = [];
|
|
208
255
|
}
|
|
256
|
+
if (Array.isArray(init.semantics)) {
|
|
257
|
+
this.semantics = init.semantics.map((item) => structuredClone(item));
|
|
258
|
+
}
|
|
259
|
+
else {
|
|
260
|
+
this.semantics = [];
|
|
261
|
+
}
|
|
262
|
+
if (init.onDelete) {
|
|
263
|
+
this.onDelete = init.onDelete;
|
|
264
|
+
}
|
|
265
|
+
if (typeof init.readOnly === 'boolean') {
|
|
266
|
+
this.readOnly = init.readOnly;
|
|
267
|
+
}
|
|
209
268
|
}
|
|
210
269
|
/**
|
|
211
270
|
* Generates a JSON representation of the association.
|
|
@@ -228,10 +287,19 @@ let DomainAssociation = (() => {
|
|
|
228
287
|
result.required = this.required;
|
|
229
288
|
}
|
|
230
289
|
if (Array.isArray(this.bindings) && this.bindings.length) {
|
|
231
|
-
result.bindings = toRaw(this, this.bindings)
|
|
290
|
+
result.bindings = toRaw(this, this.bindings)?.map((i) => structuredClone(i));
|
|
232
291
|
}
|
|
233
292
|
if (Array.isArray(this.targets) && this.targets.length) {
|
|
234
|
-
result.targets = toRaw(this, this.targets)
|
|
293
|
+
result.targets = toRaw(this, this.targets)?.map((i) => ({ ...i }));
|
|
294
|
+
}
|
|
295
|
+
if (Array.isArray(this.semantics) && this.semantics.length) {
|
|
296
|
+
result.semantics = toRaw(this, this.semantics)?.map((i) => structuredClone(i));
|
|
297
|
+
}
|
|
298
|
+
if (this.onDelete) {
|
|
299
|
+
result.onDelete = this.onDelete;
|
|
300
|
+
}
|
|
301
|
+
if (typeof this.readOnly === 'boolean' && this.readOnly) {
|
|
302
|
+
result.readOnly = this.readOnly;
|
|
235
303
|
}
|
|
236
304
|
return result;
|
|
237
305
|
}
|
|
@@ -433,6 +501,44 @@ let DomainAssociation = (() => {
|
|
|
433
501
|
const serializer = new ShapeGenerator();
|
|
434
502
|
return serializer.associationProperty(this);
|
|
435
503
|
}
|
|
504
|
+
/**
|
|
505
|
+
* Adds or updates a semantic to the association.
|
|
506
|
+
* @param semantic The semantic to add to the association.
|
|
507
|
+
* @throws Error if the semantic is not an association semantic.
|
|
508
|
+
*/
|
|
509
|
+
addSemantic(semantic) {
|
|
510
|
+
const sem = DataSemantics[semantic.id];
|
|
511
|
+
if (!isAssociationSemantic(sem)) {
|
|
512
|
+
throw new Error(`Invalid semantic type: ${semantic.id}. Expected an association semantic.`);
|
|
513
|
+
}
|
|
514
|
+
const index = this.semantics.findIndex((s) => s.id === semantic.id);
|
|
515
|
+
if (index >= 0) {
|
|
516
|
+
this.semantics[index] = semantic;
|
|
517
|
+
}
|
|
518
|
+
else {
|
|
519
|
+
this.semantics.push(semantic);
|
|
520
|
+
}
|
|
521
|
+
this.domain.notifyChange();
|
|
522
|
+
}
|
|
523
|
+
/**
|
|
524
|
+
* Removes a semantic from the association.
|
|
525
|
+
* @param semanticId The ID of the semantic to remove.
|
|
526
|
+
*/
|
|
527
|
+
removeSemantic(semanticId) {
|
|
528
|
+
const index = this.semantics.findIndex((s) => s.id === semanticId);
|
|
529
|
+
if (index >= 0) {
|
|
530
|
+
this.semantics.splice(index, 1);
|
|
531
|
+
this.domain.notifyChange();
|
|
532
|
+
}
|
|
533
|
+
}
|
|
534
|
+
/**
|
|
535
|
+
* Checks if the association has a specific semantic.
|
|
536
|
+
* @param semanticId The ID of the semantic to check.
|
|
537
|
+
* @returns True if the semantic is present, false otherwise.
|
|
538
|
+
*/
|
|
539
|
+
hasSemantic(semanticId) {
|
|
540
|
+
return this.semantics.some((s) => s.id === semanticId);
|
|
541
|
+
}
|
|
436
542
|
};
|
|
437
543
|
})();
|
|
438
544
|
export { DomainAssociation };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DomainAssociation.js","sourceRoot":"","sources":["../../../src/modeling/DomainAssociation.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAA;AAC1D,OAAO,EAAE,aAAa,EAA4B,MAAM,oBAAoB,CAAA;AAC5E,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AACrC,OAAO,EAAe,KAAK,EAAE,MAAM,oBAAoB,CAAA;AACvD,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;AAI/D,OAAO,EAA4B,yBAAyB,EAAE,MAAM,iBAAiB,CAAA;AAErF,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AAwCxD;;;;;;;;;;;;;;;;;;;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AAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,MAAM,CAAA;gBAC9B,MAAM,SAAS,GAAG,MAAM,CAAC,CAAC,CAAC,GAAG,MAAM,IAAI,GAAG,EAAE,CAAC,CAAC,CAAC,GAAG,CAAA;gBACnD,MAAM,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAA6B,CAAA;gBAC1E,IAAI,MAAM,EAAE,CAAC;oBACX,MAAM,MAAM,CAAA;gBACd,CAAC;YACH,CAAC;QACH,CAAC;QAED;;;;;;;;;WASG;QACH,UAAU;YACR,MAAM,UAAU,GAAG,IAAI,cAAc,EAAE,CAAA;YACvC,OAAO,UAAU,CAAC,mBAAmB,CAAC,IAAI,CAAC,CAAA;QAC7C,CAAC;;;SA1XU,iBAAiB","sourcesContent":["import type { DataDomain } from './DataDomain.js'\nimport { DomainAssociationKind } from '../models/kinds.js'\nimport { DomainElement, type DomainElementSchema } from './DomainElement.js'\nimport { nanoid } from '../nanoid.js'\nimport { type IThing, Thing } from '../models/Thing.js'\nimport { observed, retargetChange, toRaw } from './observed.js'\nimport type { DomainEntity } from './DomainEntity.js'\nimport type { IApiAssociationShape, IApiPropertyShape } from '../amf/definitions/Shapes.js'\nimport type { AssociationBinding, AssociationBindings, AssociationWebBindings } from './Bindings.js'\nimport { DomainAttributeAttribute, DomainAttributeAttributes } from './DataFormat.js'\nimport type { AssociationTarget, DomainGraphEdge } from './types.js'\nimport { ShapeGenerator } from './amf/ShapeGenerator.js'\n\nexport interface DomainAssociationSchema extends DomainElementSchema {\n kind: typeof DomainAssociationKind\n /**\n * The data association description.\n */\n info: IThing\n /**\n * Wether the data association is required.\n */\n required?: boolean\n /**\n * Whether the data association allows multiple items.\n */\n multiple?: boolean\n /**\n * The schema allowing to translate the model into a specific format (like JSON, RAML, XML, etc.)\n *\n * When this is defined then it is used as the schema. When this is not defined it uses\n * referenced entities schemas. Note, changes in the referenced entities may not be propagated\n * to schemas altered by the user.\n */\n schema?: IApiAssociationShape\n /**\n * The list of bindings for this property.\n *\n * A binding defines a translation from a data model to a specific format.\n * For example allows to define properties required to generate AMF shape and therefore RAML/OAS shapes for web APIs\n * or a protocol buffer schema.\n */\n bindings?: AssociationBinding[]\n /**\n * The list of keys associated with the entity through this association.\n * An association without a target is considered invalid and discarded when processing the values.\n * When multiple associations are set then we are dealing with an union.\n */\n targets?: AssociationTarget[]\n}\n\n/**\n * Represents an association between entities in a data domain.\n *\n * A `DomainAssociation` defines a relationship between a\n * `DomainEntity` and one or more other entities. It specifies\n * how entities are connected and can represent various types\n * of relationships, such as one-to-one, one-to-many, or\n * many-to-many.\n *\n * **Key Features:**\n *\n * - **Target Entities:** Specifies the entities that are\n * the target of the association.\n * - **Cardinality:** Defines whether the association is\n * single-valued or multi-valued (e.g., one-to-one vs.\n * one-to-many).\n * - **Required Status:** Indicates whether the association\n * is mandatory or optional.\n * - **Schema Customization:** Allows defining a custom\n * schema for the association, overriding the default\n * schema derived from the target entities.\n * - **Bindings:** Supports defining how the association is\n * represented in different formats (e.g., web APIs,\n * protocol buffers).\n * - **Foreign Namespaces:** Can target entities in other\n * namespaces, enabling cross-namespace relationships.\n *\n * **Usage:**\n *\n * The preferred way to create a `DomainAssociation` is\n * through the `DomainEntity.addAssociation()` method.\n *\n * **Example:**\n *\n * ```typescript\n * const dataDomain = new DataDomain();\n * const userModel = dataDomain.addModel({ key: 'userModel' });\n * const userEntity = userModel.addEntity({ key: 'user' });\n * const addressEntity = userModel.addEntity({ key: 'address' });\n * // Add an association from User to Address\n * const addressAssociation = userEntity.addAssociation();\n * addressAssociation.addTarget(addressEntity);\n * ```\n */\nexport class DomainAssociation extends DomainElement {\n /**\n * The kind of the domain element.\n */\n override kind: typeof DomainAssociationKind\n\n /**\n * The description of the association namespace.\n */\n @retargetChange() accessor info: Thing\n\n /**\n * Wether the data association is required.\n */\n @observed() accessor required: boolean | undefined\n\n /**\n * Whether the data association allows multiple items.\n */\n @observed() accessor multiple: boolean | undefined\n\n /**\n * The schema allowing to translate the model into a\n * specific format (like JSON, RAML, XML, etc.)\n */\n @observed({ deep: true }) accessor schema: IApiAssociationShape | undefined\n\n /**\n * The list of bindings for this property.\n *\n * A binding defines a translation from a data model to a specific format.\n * For example allows to define properties required to generate AMF shape and therefore RAML/OAS shapes for web APIs\n * or a protocol buffer schema.\n */\n @observed({ deep: true }) accessor bindings: AssociationBinding[]\n\n /**\n * The key of the parent entity.\n */\n protected parent: string\n\n /**\n * The list of keys associated with the entity through this association.\n * An association without a target is considered invalid and discarded when processing the values.\n * When multiple associations are set then we are dealing with an union.\n */\n @observed({ deep: true }) accessor targets: AssociationTarget[]\n\n /**\n * Creates a full data association schema with defaults.\n *\n * @param input The partial data association schema.\n * @returns The data association schema.\n */\n static createSchema(input: Partial<DomainAssociationSchema> = {}): DomainAssociationSchema {\n const { key = nanoid() } = input\n const info = Thing.fromJSON(input.info, { name: 'new_association' }).toJSON()\n const result: DomainAssociationSchema = {\n kind: DomainAssociationKind,\n key,\n info,\n }\n if (input.schema) {\n result.schema = structuredClone(input.schema)\n }\n if (typeof input.multiple === 'boolean') {\n result.multiple = input.multiple\n }\n if (typeof input.required === 'boolean') {\n result.required = input.required\n }\n if (Array.isArray(input.bindings)) {\n result.bindings = input.bindings.map((i) => structuredClone(i))\n }\n if (Array.isArray(input.targets)) {\n result.targets = input.targets.map((i) => ({ ...i }))\n }\n return result\n }\n\n /**\n * Creates a new data association instance.\n *\n * You probably want to use the `DomainEntity.addAssociation()` method instead.\n *\n * @param root A reference to the root DataDomain instance.\n * @param parent The key of the parent entity.\n * @param input The partial data association schema.\n */\n constructor(root: DataDomain, parent: string, input?: Partial<DomainAssociationSchema>) {\n const init = DomainAssociation.createSchema(input)\n super(root, init.key)\n this.parent = parent\n this.kind = DomainAssociationKind\n this.info = new Thing(init.info)\n if (init.schema) {\n this.schema = structuredClone(init.schema)\n }\n if (typeof init.multiple === 'boolean') {\n this.multiple = init.multiple\n }\n if (typeof init.required === 'boolean') {\n this.required = init.required\n }\n if (Array.isArray(init.bindings)) {\n this.bindings = init.bindings.map((i) => structuredClone(i))\n } else {\n this.bindings = []\n }\n if (Array.isArray(init.targets)) {\n this.targets = init.targets.map((i) => ({ ...i }))\n } else {\n this.targets = []\n }\n }\n\n /**\n * Generates a JSON representation of the association.\n *\n * @returns A plain object representation of the `DomainAssociation`.\n */\n toJSON(): DomainAssociationSchema {\n const result: DomainAssociationSchema = {\n kind: this.kind,\n key: this.key,\n info: this.info.toJSON(),\n }\n if (this.schema) {\n result.schema = structuredClone(toRaw(this, this.schema))\n }\n if (typeof this.multiple === 'boolean') {\n result.multiple = this.multiple\n }\n if (typeof this.required === 'boolean') {\n result.required = this.required\n }\n if (Array.isArray(this.bindings) && this.bindings.length) {\n result.bindings = (toRaw(this, this.bindings) as AssociationBinding[]).map((i) => structuredClone(i))\n }\n if (Array.isArray(this.targets) && this.targets.length) {\n result.targets = (toRaw(this, this.targets) as AssociationTarget[]).map((i) => ({ ...i }))\n }\n return result\n }\n\n /**\n * Returns a parent data entity where this data property exist.\n *\n * @returns The parent `DomainEntity` or undefined if not found.\n */\n getParentInstance(): DomainEntity | undefined {\n return this.root.graph.node(this.parent) as DomainEntity | undefined\n }\n\n /**\n * Removes this property from the parent entity.\n *\n * This method removes the association from the parent\n * entity's list of associations.\n *\n * @example\n * ```typescript\n * association.remove();\n * ```\n */\n remove(): void {\n const parent = this.getParentInstance()\n parent?.removeAssociation(this.key)\n }\n\n /**\n * Creates the `schema` object if missing and returns it.\n *\n * @returns The schema object.\n * @example\n * ```typescript\n * const schema = association.ensureSchema();\n * ```\n */\n ensureSchema(): IApiAssociationShape {\n if (!this.schema) {\n this.schema = {}\n }\n return this.schema\n }\n\n /**\n * Checks whether the passed value is one of the supported\n * data property attributes.\n *\n * @param value The value to test\n * @returns True when the passed value is one of the\n * supported data property attributes.\n */\n static isValidAttribute(value: unknown): value is DomainAttributeAttribute {\n if (typeof value !== 'string') {\n return false\n }\n return DomainAttributeAttributes.includes(value as DomainAttributeAttribute)\n }\n\n /**\n * Creates if not existing and returns web bindings\n * definition.\n *\n * @returns The web binding definition\n * @example\n * ```typescript\n * const webBindings = association.getWebBinding();\n * webBindings.hidden = true;\n * ```\n */\n getWebBinding(): AssociationWebBindings {\n let object = this.bindings.find((i) => i.type === 'web') as AssociationBinding | undefined\n if (!object) {\n object = { type: 'web', schema: {} } as AssociationBinding\n this.bindings.push(object)\n this.domain.notifyChange()\n }\n return object.schema as AssociationWebBindings\n }\n\n /**\n * Returns the schema value of the binding, if any was\n * created.\n *\n * @param type The type of the binding to read.\n * @returns The binding schema, if any\n * @example\n * ```typescript\n * const webBindings = association.readBinding('web');\n * if (webBindings) {\n * // ...\n * }\n * ```\n */\n readBinding(type: 'web' | 'protobuf'): AssociationBindings | undefined {\n const item = this.bindings.find((i) => i.type === type) as AssociationBinding\n return item?.schema || undefined\n }\n\n /**\n * Adds a target entity to the association.\n *\n * If the entity comes from another namespace then it is\n * set as a foreign entity.\n *\n * @param entity - The `DomainEntity` instance to add.\n * @example\n * ```typescript\n * association.addTarget(addressEntity);\n * ```\n */\n addTarget(entity: DomainEntity): void\n\n /**\n * Adds a target entity to the association.\n *\n * @param entity - The `DomainEntity` definition or just\n * its key.\n * @param namespace - The key of the foreign namespace this\n * entity belongs to. Do not set this value for local\n * entities.\n * @example\n * ```typescript\n * association.addTarget('address', 'foreignNamespace');\n * ```\n */\n addTarget(entity: string, namespace?: string): void\n\n /**\n * Adds a target entity to the association.\n *\n * @param init The key of an entity, its instance, or schema.\n * @param namespace - The key of the foreign namespace this\n * entity belongs to. Do not set this value for local entities.\n */\n addTarget(init: string | DomainEntity, namespace?: string): void {\n let key: string\n if (typeof init === 'string') {\n key = init\n } else {\n key = init.key\n if (init.domain.key !== this.root.key) {\n namespace = init.domain.key\n }\n }\n if (this.targets.some((i) => i.key === key && i.domain === namespace)) {\n const message = `Target ${key} already exists.`\n throw new Error(message)\n }\n if (namespace && !this.root.dependencies.has(namespace)) {\n throw new Error(`Foreign namespace \"${namespace}\" does not exist.`)\n }\n const info: AssociationTarget = {\n key,\n }\n if (namespace) {\n info.domain = namespace\n }\n this.targets.push(info)\n const targetKey = namespace ? `${namespace}:${key}` : key\n const label: DomainGraphEdge = {\n type: 'association',\n }\n if (namespace) {\n label.domain = namespace\n label.foreign = true\n }\n // We need to associate the target with the association\n // in the graph. This way, when looking for associations\n // on a target entities we can easily locate the\n // association.\n this.root.graph.setEdge(this.key, targetKey, label)\n // this.root.notifyChange()\n }\n\n /**\n * Removes a target entity from the targets list.\n *\n * @param init The key of an entity, its instance, or\n * schema.\n * @example\n * ```typescript\n * association.removeTarget(addressEntity);\n * ```\n */\n removeTarget(init: string | DomainEntity): void {\n let key: string\n if (typeof init === 'string') {\n key = init\n } else {\n key = init.key\n }\n const index = this.targets.findIndex((i) => i.key === key)\n if (index >= 0) {\n this.targets.splice(index, 1)\n // this.root.notifyChange()\n }\n this.root.graph.removeEdge(this.key, key)\n }\n\n /**\n * Lists all target entities of this association.\n *\n * @returns A generator that yields each target\n * `DomainEntity`.\n * @example\n * ```typescript\n * for (const target of association.listTargets()) {\n * console.log(target.key);\n * }\n * ```\n */\n *listTargets(): Generator<DomainEntity> {\n for (const target of this.targets) {\n const { key, domain } = target\n const targetKey = domain ? `${domain}:${key}` : key\n const entity = this.root.graph.node(targetKey) as DomainEntity | undefined\n if (entity) {\n yield entity\n }\n }\n }\n\n /**\n * Creates a Property Shape of AMF.\n * The property itself is auto-generated. If the `schema` is defined then it is used\n * as the `range` of the property. Otherwise basic shape is generated for the range.\n *\n * This is a preferred way of reading the AMF shape as this synchronizes changed\n * data properties with the shape definition.\n *\n * @returns AMF property shape definition.\n */\n toApiShape(): IApiPropertyShape {\n const serializer = new ShapeGenerator()\n return serializer.associationProperty(this)\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"DomainAssociation.js","sourceRoot":"","sources":["../../../src/modeling/DomainAssociation.ts"],"names":[],"mappings":";AACA,OAAO,EAA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AS,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,UAAU,CAAC,CAAA;YAClE,IAAI,KAAK,IAAI,CAAC,EAAE,CAAC;gBACf,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAA;gBAC/B,IAAI,CAAC,MAAM,CAAC,YAAY,EAAE,CAAA;YAC5B,CAAC;QACH,CAAC;QAED;;;;WAIG;QACH,WAAW,CAAC,UAAwB;YAClC,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,UAAU,CAAC,CAAA;QACxD,CAAC;;;SA9cU,iBAAiB","sourcesContent":["import type { DataDomain } from './DataDomain.js'\nimport { DomainAssociationKind } from '../models/kinds.js'\nimport { DomainElement, type DomainElementSchema } from './DomainElement.js'\nimport { nanoid } from '../nanoid.js'\nimport { type IThing, Thing } from '../models/Thing.js'\nimport { observed, retargetChange, toRaw } from './observed.js'\nimport type { DomainEntity } from './DomainEntity.js'\nimport type { IApiAssociationShape, IApiPropertyShape } from '../amf/definitions/Shapes.js'\nimport type { AssociationBinding, AssociationBindings, AssociationWebBindings } from './Bindings.js'\nimport { DomainAttributeAttribute, DomainAttributeAttributes } from './DataFormat.js'\nimport type { AssociationTarget, DomainGraphEdge } from './types.js'\nimport { ShapeGenerator } from './amf/ShapeGenerator.js'\nimport { DataSemantics, isAssociationSemantic, type SemanticType, type AppliedDataSemantic } from './Semantics.js'\n\n/**\n * Defines the behavior when a parent entity in an association is deleted.\n *\n * - `restrict`: Prevents the deletion of a parent entity if it has any associated child entities.\n * The generated API should return a clear and specific error message (e.g., 409 Conflict).\n * - _Example_: Do not allow a Department to be deleted if it still has Employees.\n * - `cascade`: Automatically deletes all associated child entities when the parent entity is deleted.\n * - _Example_: Deleting a User will also delete all their associated Posts and Comments.\n * - `setNull`: Sets the foreign key of the associated child entities to NULL. This is only valid if the\n * association property on the child entity is nullable.\n * - _Example_: When a `Project` is deleted, the `project_id` on associated `Tasks` is set to NULL,\n * making them unassigned but not deleting them.\n * - `doNothing`: No action is taken on the associated child entities when the parent entity is deleted.\n * - _Example_: Deleting a `Category` does not affect associated `Products`, which remain in the database\n * but may become orphaned.\n * This is useful when the association is optional or when child entities should not be deleted\n * or modified upon the deletion of a parent entity.\n */\nexport type OnDeleteRule = 'restrict' | 'cascade' | 'setNull' | 'doNothing'\n\nexport interface DomainAssociationSchema extends DomainElementSchema {\n kind: typeof DomainAssociationKind\n /**\n * The data association description.\n */\n info: IThing\n /**\n * Wether the data association is required.\n */\n required?: boolean\n /**\n * Whether the data association allows multiple items.\n */\n multiple?: boolean\n /**\n * The schema allowing to translate the model into a specific format (like JSON, RAML, XML, etc.)\n *\n * When this is defined then it is used as the schema. When this is not defined it uses\n * referenced entities schemas. Note, changes in the referenced entities may not be propagated\n * to schemas altered by the user.\n */\n schema?: IApiAssociationShape\n /**\n * The list of bindings for this property.\n *\n * A binding defines a translation from a data model to a specific format.\n * For example allows to define properties required to generate AMF shape and therefore RAML/OAS shapes for web APIs\n * or a protocol buffer schema.\n */\n bindings?: AssociationBinding[]\n /**\n * The list of keys associated with the entity through this association.\n * An association without a target is considered invalid and discarded when processing the values.\n * When multiple associations are set then we are dealing with an union.\n */\n targets?: AssociationTarget[]\n /**\n * The semantics applied to this association.\n * This is a list of applied semantics that can be used to\n * describe the association in more detail.\n */\n semantics?: AppliedDataSemantic[]\n /**\n * Defines the behavior when a parent entity in an association is deleted.\n */\n onDelete?: OnDeleteRule\n /**\n * Whether the association is read-only.\n */\n readOnly?: boolean\n}\n\n/**\n * Represents an association between entities in a data domain.\n *\n * A `DomainAssociation` defines a relationship between a\n * `DomainEntity` and one or more other entities. It specifies\n * how entities are connected and can represent various types\n * of relationships, such as one-to-one, one-to-many, or\n * many-to-many.\n *\n * **Key Features:**\n *\n * - **Target Entities:** Specifies the entities that are\n * the target of the association.\n * - **Cardinality:** Defines whether the association is\n * single-valued or multi-valued (e.g., one-to-one vs.\n * one-to-many).\n * - **Required Status:** Indicates whether the association\n * is mandatory or optional.\n * - **Schema Customization:** Allows defining a custom\n * schema for the association, overriding the default\n * schema derived from the target entities.\n * - **Bindings:** Supports defining how the association is\n * represented in different formats (e.g., web APIs,\n * protocol buffers).\n * - **Foreign Namespaces:** Can target entities in other\n * namespaces, enabling cross-namespace relationships.\n *\n * **Usage:**\n *\n * The preferred way to create a `DomainAssociation` is\n * through the `DomainEntity.addAssociation()` method.\n *\n * **Example:**\n *\n * ```typescript\n * const dataDomain = new DataDomain();\n * const userModel = dataDomain.addModel({ key: 'userModel' });\n * const userEntity = userModel.addEntity({ key: 'user' });\n * const addressEntity = userModel.addEntity({ key: 'address' });\n * // Add an association from User to Address\n * const addressAssociation = userEntity.addAssociation();\n * addressAssociation.addTarget(addressEntity);\n * ```\n */\nexport class DomainAssociation extends DomainElement {\n /**\n * The kind of the domain element.\n */\n override kind: typeof DomainAssociationKind\n\n /**\n * The description of the association namespace.\n */\n @retargetChange() accessor info: Thing\n\n /**\n * Wether the data association is required.\n */\n @observed() accessor required: boolean | undefined\n\n /**\n * Whether the data association allows multiple items.\n */\n @observed() accessor multiple: boolean | undefined\n\n /**\n * The schema allowing to translate the model into a\n * specific format (like JSON, RAML, XML, etc.)\n */\n @observed({ deep: true }) accessor schema: IApiAssociationShape | undefined\n\n /**\n * The list of bindings for this property.\n *\n * A binding defines a translation from a data model to a specific format.\n * For example allows to define properties required to generate AMF shape and therefore RAML/OAS shapes for web APIs\n * or a protocol buffer schema.\n */\n @observed({ deep: true }) accessor bindings: AssociationBinding[]\n\n /**\n * The key of the parent entity.\n */\n protected parent: string\n\n /**\n * The list of keys associated with the entity through this association.\n * An association without a target is considered invalid and discarded when processing the values.\n * When multiple associations are set then we are dealing with an union.\n */\n @observed({ deep: true }) accessor targets: AssociationTarget[]\n\n /**\n * Semantics applied to this association.\n */\n @observed({ deep: true }) accessor semantics: AppliedDataSemantic[] = []\n\n /**\n * Defines the behavior when a parent entity in an association is deleted.\n */\n @observed() accessor onDelete: OnDeleteRule | undefined\n\n /**\n * Whether the association is read-only.\n */\n @observed() accessor readOnly: boolean | undefined\n\n /**\n * Creates a full data association schema with defaults.\n *\n * @param input The partial data association schema.\n * @returns The data association schema.\n */\n static createSchema(input: Partial<DomainAssociationSchema> = {}): DomainAssociationSchema {\n const { key = nanoid(), semantics = [] } = input\n const info = Thing.fromJSON(input.info, { name: 'new_association' }).toJSON()\n const result: DomainAssociationSchema = {\n kind: DomainAssociationKind,\n key,\n info,\n }\n if (Array.isArray(semantics)) {\n result.semantics = [...semantics]\n }\n if (input.onDelete) {\n result.onDelete = input.onDelete\n }\n if (typeof input.readOnly === 'boolean') {\n result.readOnly = input.readOnly\n }\n if (input.schema) {\n result.schema = structuredClone(input.schema)\n }\n if (typeof input.multiple === 'boolean') {\n result.multiple = input.multiple\n }\n if (typeof input.required === 'boolean') {\n result.required = input.required\n }\n if (Array.isArray(input.bindings)) {\n result.bindings = input.bindings.map((i) => structuredClone(i))\n }\n if (Array.isArray(input.targets)) {\n result.targets = input.targets.map((i) => ({ ...i }))\n }\n return result\n }\n\n /**\n * Creates a new data association instance.\n *\n * You probably want to use the `DomainEntity.addAssociation()` method instead.\n *\n * @param root A reference to the root DataDomain instance.\n * @param parent The key of the parent entity.\n * @param input The partial data association schema.\n */\n constructor(root: DataDomain, parent: string, input?: Partial<DomainAssociationSchema>) {\n const init = DomainAssociation.createSchema(input)\n super(root, init.key)\n this.parent = parent\n this.kind = DomainAssociationKind\n this.info = new Thing(init.info)\n if (init.schema) {\n this.schema = structuredClone(init.schema)\n }\n if (typeof init.multiple === 'boolean') {\n this.multiple = init.multiple\n }\n if (typeof init.required === 'boolean') {\n this.required = init.required\n }\n if (Array.isArray(init.bindings)) {\n this.bindings = init.bindings.map((i) => structuredClone(i))\n } else {\n this.bindings = []\n }\n if (Array.isArray(init.targets)) {\n this.targets = init.targets.map((i) => ({ ...i }))\n } else {\n this.targets = []\n }\n if (Array.isArray(init.semantics)) {\n this.semantics = init.semantics.map((item) => structuredClone(item))\n } else {\n this.semantics = []\n }\n if (init.onDelete) {\n this.onDelete = init.onDelete\n }\n if (typeof init.readOnly === 'boolean') {\n this.readOnly = init.readOnly\n }\n }\n\n /**\n * Generates a JSON representation of the association.\n *\n * @returns A plain object representation of the `DomainAssociation`.\n */\n toJSON(): DomainAssociationSchema {\n const result: DomainAssociationSchema = {\n kind: this.kind,\n key: this.key,\n info: this.info.toJSON(),\n }\n if (this.schema) {\n result.schema = structuredClone(toRaw(this, this.schema))\n }\n if (typeof this.multiple === 'boolean') {\n result.multiple = this.multiple\n }\n if (typeof this.required === 'boolean') {\n result.required = this.required\n }\n if (Array.isArray(this.bindings) && this.bindings.length) {\n result.bindings = toRaw(this, this.bindings)?.map((i) => structuredClone(i))\n }\n if (Array.isArray(this.targets) && this.targets.length) {\n result.targets = toRaw(this, this.targets)?.map((i) => ({ ...i }))\n }\n if (Array.isArray(this.semantics) && this.semantics.length) {\n result.semantics = toRaw(this, this.semantics)?.map((i) => structuredClone(i))\n }\n if (this.onDelete) {\n result.onDelete = this.onDelete\n }\n if (typeof this.readOnly === 'boolean' && this.readOnly) {\n result.readOnly = this.readOnly\n }\n return result\n }\n\n /**\n * Returns a parent data entity where this data property exist.\n *\n * @returns The parent `DomainEntity` or undefined if not found.\n */\n getParentInstance(): DomainEntity | undefined {\n return this.root.graph.node(this.parent) as DomainEntity | undefined\n }\n\n /**\n * Removes this property from the parent entity.\n *\n * This method removes the association from the parent\n * entity's list of associations.\n *\n * @example\n * ```typescript\n * association.remove();\n * ```\n */\n remove(): void {\n const parent = this.getParentInstance()\n parent?.removeAssociation(this.key)\n }\n\n /**\n * Creates the `schema` object if missing and returns it.\n *\n * @returns The schema object.\n * @example\n * ```typescript\n * const schema = association.ensureSchema();\n * ```\n */\n ensureSchema(): IApiAssociationShape {\n if (!this.schema) {\n this.schema = {}\n }\n return this.schema\n }\n\n /**\n * Checks whether the passed value is one of the supported\n * data property attributes.\n *\n * @param value The value to test\n * @returns True when the passed value is one of the\n * supported data property attributes.\n */\n static isValidAttribute(value: unknown): value is DomainAttributeAttribute {\n if (typeof value !== 'string') {\n return false\n }\n return DomainAttributeAttributes.includes(value as DomainAttributeAttribute)\n }\n\n /**\n * Creates if not existing and returns web bindings\n * definition.\n *\n * @returns The web binding definition\n * @example\n * ```typescript\n * const webBindings = association.getWebBinding();\n * webBindings.hidden = true;\n * ```\n */\n getWebBinding(): AssociationWebBindings {\n let object = this.bindings.find((i) => i.type === 'web') as AssociationBinding | undefined\n if (!object) {\n object = { type: 'web', schema: {} } as AssociationBinding\n this.bindings.push(object)\n this.domain.notifyChange()\n }\n return object.schema as AssociationWebBindings\n }\n\n /**\n * Returns the schema value of the binding, if any was\n * created.\n *\n * @param type The type of the binding to read.\n * @returns The binding schema, if any\n * @example\n * ```typescript\n * const webBindings = association.readBinding('web');\n * if (webBindings) {\n * // ...\n * }\n * ```\n */\n readBinding(type: 'web' | 'protobuf'): AssociationBindings | undefined {\n const item = this.bindings.find((i) => i.type === type) as AssociationBinding\n return item?.schema || undefined\n }\n\n /**\n * Adds a target entity to the association.\n *\n * If the entity comes from another namespace then it is\n * set as a foreign entity.\n *\n * @param entity - The `DomainEntity` instance to add.\n * @example\n * ```typescript\n * association.addTarget(addressEntity);\n * ```\n */\n addTarget(entity: DomainEntity): void\n\n /**\n * Adds a target entity to the association.\n *\n * @param entity - The `DomainEntity` definition or just\n * its key.\n * @param namespace - The key of the foreign namespace this\n * entity belongs to. Do not set this value for local\n * entities.\n * @example\n * ```typescript\n * association.addTarget('address', 'foreignNamespace');\n * ```\n */\n addTarget(entity: string, namespace?: string): void\n\n /**\n * Adds a target entity to the association.\n *\n * @param init The key of an entity, its instance, or schema.\n * @param namespace - The key of the foreign namespace this\n * entity belongs to. Do not set this value for local entities.\n */\n addTarget(init: string | DomainEntity, namespace?: string): void {\n let key: string\n if (typeof init === 'string') {\n key = init\n } else {\n key = init.key\n if (init.domain.key !== this.root.key) {\n namespace = init.domain.key\n }\n }\n if (this.targets.some((i) => i.key === key && i.domain === namespace)) {\n const message = `Target ${key} already exists.`\n throw new Error(message)\n }\n if (namespace && !this.root.dependencies.has(namespace)) {\n throw new Error(`Foreign namespace \"${namespace}\" does not exist.`)\n }\n const info: AssociationTarget = {\n key,\n }\n if (namespace) {\n info.domain = namespace\n }\n this.targets.push(info)\n const targetKey = namespace ? `${namespace}:${key}` : key\n const label: DomainGraphEdge = {\n type: 'association',\n }\n if (namespace) {\n label.domain = namespace\n label.foreign = true\n }\n // We need to associate the target with the association\n // in the graph. This way, when looking for associations\n // on a target entities we can easily locate the\n // association.\n this.root.graph.setEdge(this.key, targetKey, label)\n // this.root.notifyChange()\n }\n\n /**\n * Removes a target entity from the targets list.\n *\n * @param init The key of an entity, its instance, or\n * schema.\n * @example\n * ```typescript\n * association.removeTarget(addressEntity);\n * ```\n */\n removeTarget(init: string | DomainEntity): void {\n let key: string\n if (typeof init === 'string') {\n key = init\n } else {\n key = init.key\n }\n const index = this.targets.findIndex((i) => i.key === key)\n if (index >= 0) {\n this.targets.splice(index, 1)\n // this.root.notifyChange()\n }\n this.root.graph.removeEdge(this.key, key)\n }\n\n /**\n * Lists all target entities of this association.\n *\n * @returns A generator that yields each target\n * `DomainEntity`.\n * @example\n * ```typescript\n * for (const target of association.listTargets()) {\n * console.log(target.key);\n * }\n * ```\n */\n *listTargets(): Generator<DomainEntity> {\n for (const target of this.targets) {\n const { key, domain } = target\n const targetKey = domain ? `${domain}:${key}` : key\n const entity = this.root.graph.node(targetKey) as DomainEntity | undefined\n if (entity) {\n yield entity\n }\n }\n }\n\n /**\n * Creates a Property Shape of AMF.\n * The property itself is auto-generated. If the `schema` is defined then it is used\n * as the `range` of the property. Otherwise basic shape is generated for the range.\n *\n * This is a preferred way of reading the AMF shape as this synchronizes changed\n * data properties with the shape definition.\n *\n * @returns AMF property shape definition.\n */\n toApiShape(): IApiPropertyShape {\n const serializer = new ShapeGenerator()\n return serializer.associationProperty(this)\n }\n\n /**\n * Adds or updates a semantic to the association.\n * @param semantic The semantic to add to the association.\n * @throws Error if the semantic is not an association semantic.\n */\n addSemantic(semantic: AppliedDataSemantic): void {\n const sem = DataSemantics[semantic.id]\n if (!isAssociationSemantic(sem)) {\n throw new Error(`Invalid semantic type: ${semantic.id}. Expected an association semantic.`)\n }\n const index = this.semantics.findIndex((s) => s.id === semantic.id)\n if (index >= 0) {\n this.semantics[index] = semantic\n } else {\n this.semantics.push(semantic)\n }\n this.domain.notifyChange()\n }\n\n /**\n * Removes a semantic from the association.\n * @param semanticId The ID of the semantic to remove.\n */\n removeSemantic(semanticId: SemanticType): void {\n const index = this.semantics.findIndex((s) => s.id === semanticId)\n if (index >= 0) {\n this.semantics.splice(index, 1)\n this.domain.notifyChange()\n }\n }\n\n /**\n * Checks if the association has a specific semantic.\n * @param semanticId The ID of the semantic to check.\n * @returns True if the semantic is present, false otherwise.\n */\n hasSemantic(semanticId: SemanticType): boolean {\n return this.semantics.some((s) => s.id === semanticId)\n }\n}\n"]}
|
|
@@ -9,6 +9,7 @@ import type { AssociationAddOptions } from './types.js';
|
|
|
9
9
|
import type { FileBreadcrumb } from '../models/store/File.js';
|
|
10
10
|
import type { DomainModel } from './DomainModel.js';
|
|
11
11
|
import type { IShapeRenderOptions } from '../amf/shape/ShapeBase.js';
|
|
12
|
+
import { type SemanticType, type AppliedDataSemantic } from './Semantics.js';
|
|
12
13
|
export interface EntityOrderedItem {
|
|
13
14
|
/**
|
|
14
15
|
* The type of the ordered item.
|
|
@@ -30,11 +31,11 @@ export interface DomainEntitySchema extends DomainElementSchema {
|
|
|
30
31
|
*/
|
|
31
32
|
tags?: string[];
|
|
32
33
|
/**
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
34
|
+
* The semantics applied to this entity.
|
|
35
|
+
* This is a list of applied semantics that can be used to
|
|
36
|
+
* describe the entity in more detail.
|
|
36
37
|
*/
|
|
37
|
-
|
|
38
|
+
semantics?: AppliedDataSemantic[];
|
|
38
39
|
/**
|
|
39
40
|
* The ordered list of fields (properties and associations) in the schema.
|
|
40
41
|
* These only keep references to the properties and associations.
|
|
@@ -60,7 +61,7 @@ export interface DomainEntitySchema extends DomainElementSchema {
|
|
|
60
61
|
* - **Properties:** Defines the data elements (fields) within the entity.
|
|
61
62
|
* - **Associations:** Defines relationships to other entities.
|
|
62
63
|
* - **Inheritance:** Supports inheriting properties and associations from parent entities.
|
|
63
|
-
* - **Metadata:** Supports tags,
|
|
64
|
+
* - **Metadata:** Supports tags, semantics, and deprecation status.
|
|
64
65
|
* - **AMF Shape Generation:** Can be serialized to an AMF (API Modeling Framework) shape.
|
|
65
66
|
* - **Example Generation:** Can generate example databased on its schema.
|
|
66
67
|
*
|
|
@@ -120,11 +121,9 @@ export declare class DomainEntity extends DomainElement {
|
|
|
120
121
|
*/
|
|
121
122
|
accessor tags: string[];
|
|
122
123
|
/**
|
|
123
|
-
*
|
|
124
|
-
*
|
|
125
|
-
* The keys of the taxonomy items associated with the entity.
|
|
124
|
+
* Semantics applied to this property.
|
|
126
125
|
*/
|
|
127
|
-
accessor
|
|
126
|
+
accessor semantics: AppliedDataSemantic[];
|
|
128
127
|
/**
|
|
129
128
|
* The ordered list of fields (properties and associations) in the schema.
|
|
130
129
|
* These only keep references to the properties and associations.
|
|
@@ -425,5 +424,22 @@ export declare class DomainEntity extends DomainElement {
|
|
|
425
424
|
* @returns The primary key property of this entity or undefined if not found.
|
|
426
425
|
*/
|
|
427
426
|
primaryKey(): DomainProperty | undefined;
|
|
427
|
+
/**
|
|
428
|
+
* Adds or updates a semantic to the entity.
|
|
429
|
+
* @param semantic The semantic to add to the entity.
|
|
430
|
+
* @throws Error if the semantic is not an entity semantic.
|
|
431
|
+
*/
|
|
432
|
+
addSemantic(semantic: AppliedDataSemantic): void;
|
|
433
|
+
/**
|
|
434
|
+
* Removes a semantic from the entity.
|
|
435
|
+
* @param semanticId The ID of the semantic to remove.
|
|
436
|
+
*/
|
|
437
|
+
removeSemantic(semanticId: SemanticType): void;
|
|
438
|
+
/**
|
|
439
|
+
* Checks if the entity has a specific semantic.
|
|
440
|
+
* @param semanticId The ID of the semantic to check.
|
|
441
|
+
* @returns True if the semantic is present, false otherwise.
|
|
442
|
+
*/
|
|
443
|
+
hasSemantic(semanticId: SemanticType): boolean;
|
|
428
444
|
}
|
|
429
445
|
//# sourceMappingURL=DomainEntity.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DomainEntity.d.ts","sourceRoot":"","sources":["../../../src/modeling/DomainEntity.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AACjD,OAAO,EAAyB,gBAAgB,EAAsB,MAAM,oBAAoB,CAAA;AAChG,OAAO,EAAE,aAAa,EAAE,KAAK,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AAE5E,OAAO,EAAE,KAAK,MAAM,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAA;AAEvD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAA;AAC/D,OAAO,EAAE,cAAc,EAAE,KAAK,oBAAoB,EAAE,MAAM,qBAAqB,CAAA;AAE/E,OAAO,EAAE,iBAAiB,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAA;AACnF,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAA;AACvD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AAC7D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAInD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAA;
|
|
1
|
+
{"version":3,"file":"DomainEntity.d.ts","sourceRoot":"","sources":["../../../src/modeling/DomainEntity.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB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