@api-client/core 0.18.61 → 0.18.63
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/API_MODELING_EXPLAINER.md +57 -0
- package/DATA_MODELING_EXPLAINER.md +74 -0
- package/build/src/modeling/DataDomain.d.ts +6 -5
- package/build/src/modeling/DataDomain.d.ts.map +1 -1
- package/build/src/modeling/DataDomain.js +5 -4
- package/build/src/modeling/DataDomain.js.map +1 -1
- package/build/src/modeling/DomainAssociation.js +1 -1
- package/build/src/modeling/DomainAssociation.js.map +1 -1
- package/build/src/modeling/DomainEntity.d.ts +9 -6
- package/build/src/modeling/DomainEntity.d.ts.map +1 -1
- package/build/src/modeling/DomainEntity.js +34 -18
- package/build/src/modeling/DomainEntity.js.map +1 -1
- package/build/src/modeling/helpers/Intelisense.d.ts.map +1 -1
- package/build/src/modeling/helpers/Intelisense.js +2 -2
- package/build/src/modeling/helpers/Intelisense.js.map +1 -1
- package/build/src/modeling/importers/JsonSchemaImporter.js +1 -1
- package/build/src/modeling/importers/JsonSchemaImporter.js.map +1 -1
- package/build/src/modeling/types.d.ts +0 -14
- package/build/src/modeling/types.d.ts.map +1 -1
- package/build/src/modeling/types.js.map +1 -1
- package/build/src/sdk/DataCatalogSdk.d.ts +8 -1
- package/build/src/sdk/DataCatalogSdk.d.ts.map +1 -1
- package/build/src/sdk/DataCatalogSdk.js +12 -2
- package/build/src/sdk/DataCatalogSdk.js.map +1 -1
- package/build/tsconfig.tsbuildinfo +1 -1
- package/data/models/example-generator-api.json +10 -10
- package/package.json +4 -4
- package/src/modeling/DataDomain.ts +6 -6
- package/src/modeling/DomainAssociation.ts +1 -1
- package/src/modeling/DomainEntity.ts +36 -18
- package/src/modeling/helpers/Intelisense.ts +8 -14
- package/src/modeling/importers/JsonSchemaImporter.ts +1 -1
- package/src/modeling/types.ts +0 -15
- package/src/sdk/DataCatalogSdk.ts +12 -2
- package/tests/unit/modeling/amf/shape_generator.spec.ts +4 -4
- package/tests/unit/modeling/api_model_expose_entity.spec.ts +11 -11
- package/tests/unit/modeling/api_model_remove_entity.spec.ts +1 -1
- package/tests/unit/modeling/data_domain_associations.spec.ts +6 -6
- package/tests/unit/modeling/data_domain_foreign.spec.ts +2 -2
- package/tests/unit/modeling/data_domain_namespaces.spec.ts +1 -1
- package/tests/unit/modeling/data_domain_serialization.spec.ts +15 -15
- package/tests/unit/modeling/domain_asociation.spec.ts +15 -15
- package/tests/unit/modeling/domain_entity.spec.ts +3 -3
- package/tests/unit/modeling/domain_entity_associations.spec.ts +4 -4
- package/tests/unit/modeling/domain_entity_example_generator_json.spec.ts +16 -16
- package/tests/unit/modeling/domain_entity_example_generator_xml.spec.ts +14 -14
- package/tests/unit/modeling/domain_property.spec.ts +1 -1
- package/tests/unit/modeling/domain_validation.spec.ts +3 -3
- package/tests/unit/modeling/domain_versioning.spec.ts +5 -5
- package/tests/unit/modeling/exposed_entity_setter_validation.spec.ts +1 -1
- package/tests/unit/modeling/validation/association_validation.spec.ts +40 -56
- package/tests/unit/modeling/validation/entity_validation.spec.ts +2 -2
|
@@ -139,7 +139,7 @@ test.group('DataDomain Serialization and Deserialization', () => {
|
|
|
139
139
|
const m1 = domain.addModel()
|
|
140
140
|
const e1 = m1.addEntity()
|
|
141
141
|
const e2 = m1.addEntity()
|
|
142
|
-
const a1 = e1.addAssociation({ key: e2.key })
|
|
142
|
+
const a1 = e1.addAssociation({ targets: [{ key: e2.key }] })
|
|
143
143
|
|
|
144
144
|
const serialized = domain.toJSON()
|
|
145
145
|
const restored = new DataDomain(serialized)
|
|
@@ -168,7 +168,7 @@ test.group('DataDomain Serialization and Deserialization', () => {
|
|
|
168
168
|
e2.addParent(e1.key)
|
|
169
169
|
const p1 = e1.addProperty({ type: 'string' })
|
|
170
170
|
const p2 = e2.addProperty({ type: 'number' })
|
|
171
|
-
const a1 = e1.addAssociation({ key: e2.key })
|
|
171
|
+
const a1 = e1.addAssociation({ targets: [{ key: e2.key }] })
|
|
172
172
|
|
|
173
173
|
const serialized = domain.toJSON()
|
|
174
174
|
const restored = new DataDomain(serialized)
|
|
@@ -249,7 +249,7 @@ test.group('DataDomain Serialization and Deserialization', () => {
|
|
|
249
249
|
domain.registerForeignDomain(fd)
|
|
250
250
|
const m1 = domain.addModel({ key: 'm1' })
|
|
251
251
|
const e1 = m1.addEntity({ key: 'e1' })
|
|
252
|
-
const a1 = e1.addAssociation({ key: fe1.key, domain: fd.key }
|
|
252
|
+
const a1 = e1.addAssociation({ key: 'a1', targets: [{ key: fe1.key, domain: fd.key }] })
|
|
253
253
|
const serialized = domain.toJSON()
|
|
254
254
|
const restored = new DataDomain(serialized, [fd])
|
|
255
255
|
|
|
@@ -278,7 +278,7 @@ test.group('DataDomain Serialization and Deserialization', () => {
|
|
|
278
278
|
domain.registerForeignDomain(fd)
|
|
279
279
|
const m1 = domain.addModel()
|
|
280
280
|
const e1 = m1.addEntity()
|
|
281
|
-
const a1 = e1.addAssociation({ key: fe1.key, domain: fd.key })
|
|
281
|
+
const a1 = e1.addAssociation({ targets: [{ key: fe1.key, domain: fd.key }] })
|
|
282
282
|
|
|
283
283
|
const serialized = domain.toJSON()
|
|
284
284
|
const restored = new DataDomain(serialized)
|
|
@@ -311,7 +311,7 @@ test.group('DataDomain Serialization and Deserialization', () => {
|
|
|
311
311
|
// Add properties and associations
|
|
312
312
|
const p1 = e1.addProperty({ type: 'string', key: 'p1' })
|
|
313
313
|
const p2 = e2.addProperty({ type: 'number', key: 'p2' })
|
|
314
|
-
const a1 = e1.addAssociation({ key: e3.key },
|
|
314
|
+
const a1 = e1.addAssociation({ targets: [{ key: e3.key }], key: 'a1' })
|
|
315
315
|
|
|
316
316
|
const serialized = domain.toJSON()
|
|
317
317
|
const restored = new DataDomain(serialized)
|
|
@@ -411,7 +411,7 @@ test.group('Validation Tests', () => {
|
|
|
411
411
|
const m1 = domain.addModel()
|
|
412
412
|
const e1 = m1.addEntity()
|
|
413
413
|
const e2 = m1.addEntity()
|
|
414
|
-
const a1 = e1.addAssociation({ key: e2.key })
|
|
414
|
+
const a1 = e1.addAssociation({ targets: [{ key: e2.key }] })
|
|
415
415
|
|
|
416
416
|
// Manually break the graph by removing the association edge to parent
|
|
417
417
|
domain.graph.removeEdge(e1.key, a1.key)
|
|
@@ -461,7 +461,7 @@ test.group('Validation Tests', () => {
|
|
|
461
461
|
const m1 = domain.addModel()
|
|
462
462
|
const e1 = m1.addEntity()
|
|
463
463
|
const e2 = m1.addEntity()
|
|
464
|
-
const a1 = e1.addAssociation({ key: e2.key })
|
|
464
|
+
const a1 = e1.addAssociation({ targets: [{ key: e2.key }] })
|
|
465
465
|
|
|
466
466
|
// Remove the association target edge
|
|
467
467
|
domain.graph.removeEdge(a1.key, e2.key)
|
|
@@ -478,7 +478,7 @@ test.group('Validation Tests', () => {
|
|
|
478
478
|
const m1 = domain.addModel()
|
|
479
479
|
const e1 = m1.addEntity()
|
|
480
480
|
const e2 = m1.addEntity()
|
|
481
|
-
const a1 = e1.addAssociation({ key: e2.key })
|
|
481
|
+
const a1 = e1.addAssociation({ targets: [{ key: e2.key }] })
|
|
482
482
|
|
|
483
483
|
// Remove the target entity but keep the edge pointing to it
|
|
484
484
|
domain.graph.removeNode(e2.key)
|
|
@@ -493,7 +493,7 @@ test.group('Validation Tests', () => {
|
|
|
493
493
|
const m1 = domain.addModel()
|
|
494
494
|
const e1 = m1.addEntity()
|
|
495
495
|
const e2 = m1.addEntity()
|
|
496
|
-
const a1 = e1.addAssociation({ key: e2.key })
|
|
496
|
+
const a1 = e1.addAssociation({ targets: [{ key: e2.key }] })
|
|
497
497
|
|
|
498
498
|
// Remove the proper target and make it point to the model instead
|
|
499
499
|
domain.graph.removeEdge(a1.key, e2.key)
|
|
@@ -512,7 +512,7 @@ test.group('Validation Tests', () => {
|
|
|
512
512
|
const e1 = m1.addEntity()
|
|
513
513
|
const e2 = m2.addEntity()
|
|
514
514
|
e1.addProperty({ type: 'string' })
|
|
515
|
-
e1.addAssociation({ key: e2.key })
|
|
515
|
+
e1.addAssociation({ targets: [{ key: e2.key }] })
|
|
516
516
|
|
|
517
517
|
// This should not throw any validation errors
|
|
518
518
|
assert.doesNotThrow(() => {
|
|
@@ -529,7 +529,7 @@ test.group('Validation Tests', () => {
|
|
|
529
529
|
const e1 = m1.addEntity()
|
|
530
530
|
const e2 = m2.addEntity()
|
|
531
531
|
e1.addProperty({ type: 'string' })
|
|
532
|
-
e1.addAssociation({ key: e2.key })
|
|
532
|
+
e1.addAssociation({ targets: [{ key: e2.key }] })
|
|
533
533
|
|
|
534
534
|
// This should not throw any validation errors
|
|
535
535
|
assert.doesNotThrow(() => {
|
|
@@ -547,7 +547,7 @@ test.group('Validation Tests', () => {
|
|
|
547
547
|
domain.registerForeignDomain(fd)
|
|
548
548
|
const m1 = domain.addModel()
|
|
549
549
|
const e1 = m1.addEntity()
|
|
550
|
-
e1.addAssociation({ key: fe1.key, domain: fd.key })
|
|
550
|
+
e1.addAssociation({ targets: [{ key: fe1.key, domain: fd.key }] })
|
|
551
551
|
|
|
552
552
|
// Foreign associations should pass validation
|
|
553
553
|
assert.doesNotThrow(() => {
|
|
@@ -630,7 +630,7 @@ test.group('DataDomain Lenient Mode Deserialization', () => {
|
|
|
630
630
|
const m1 = domain.addModel()
|
|
631
631
|
const e1 = m1.addEntity()
|
|
632
632
|
const e2 = m1.addEntity()
|
|
633
|
-
const a1 = e1.addAssociation({ key: e2.key })
|
|
633
|
+
const a1 = e1.addAssociation({ targets: [{ key: e2.key }] })
|
|
634
634
|
|
|
635
635
|
const serialized = domain.toJSON()
|
|
636
636
|
|
|
@@ -701,7 +701,7 @@ test.group('DataDomain Lenient Mode Deserialization', () => {
|
|
|
701
701
|
domain.registerForeignDomain(fd)
|
|
702
702
|
const m1 = domain.addModel()
|
|
703
703
|
const e1 = m1.addEntity()
|
|
704
|
-
e1.addAssociation({ key: fe1.key, domain: fd.key })
|
|
704
|
+
e1.addAssociation({ targets: [{ key: fe1.key, domain: fd.key }] })
|
|
705
705
|
|
|
706
706
|
const serialized = domain.toJSON()
|
|
707
707
|
|
|
@@ -762,7 +762,7 @@ test.group('DataDomain Lenient Mode Deserialization', () => {
|
|
|
762
762
|
const e1 = m1.addEntity()
|
|
763
763
|
const e2 = m1.addEntity()
|
|
764
764
|
const p1 = e1.addProperty({ type: 'string' })
|
|
765
|
-
e1.addAssociation({ key: e2.key })
|
|
765
|
+
e1.addAssociation({ targets: [{ key: e2.key }] })
|
|
766
766
|
|
|
767
767
|
const serialized = domain.toJSON()
|
|
768
768
|
|
|
@@ -916,7 +916,7 @@ test.group('DomainAssociation.duplicate()', () => {
|
|
|
916
916
|
const entity = model.addEntity()
|
|
917
917
|
const targetEntity = model.addEntity()
|
|
918
918
|
|
|
919
|
-
const association = entity.addAssociation({ key: targetEntity.key })
|
|
919
|
+
const association = entity.addAssociation({ targets: [{ key: targetEntity.key }] })
|
|
920
920
|
association.info.name = 'originalAssociation'
|
|
921
921
|
association.required = true
|
|
922
922
|
association.multiple = false
|
|
@@ -938,7 +938,7 @@ test.group('DomainAssociation.duplicate()', () => {
|
|
|
938
938
|
|
|
939
939
|
// Add multiple fields to test ordering
|
|
940
940
|
const property1 = entity.addProperty({ info: { name: 'first' } })
|
|
941
|
-
const association1 = entity.addAssociation({ key: targetEntity.key })
|
|
941
|
+
const association1 = entity.addAssociation({ targets: [{ key: targetEntity.key }] })
|
|
942
942
|
association1.info.name = 'originalAssoc'
|
|
943
943
|
const property2 = entity.addProperty({ info: { name: 'second' } })
|
|
944
944
|
|
|
@@ -959,10 +959,10 @@ test.group('DomainAssociation.duplicate()', () => {
|
|
|
959
959
|
const entity = model.addEntity()
|
|
960
960
|
const targetEntity = model.addEntity()
|
|
961
961
|
|
|
962
|
-
const association = entity.addAssociation({ key: targetEntity.key })
|
|
962
|
+
const association = entity.addAssociation({ targets: [{ key: targetEntity.key }] })
|
|
963
963
|
association.info.name = 'test'
|
|
964
964
|
// Add another association that conflicts with the first generated name
|
|
965
|
-
const conflictAssoc = entity.addAssociation({ key: targetEntity.key })
|
|
965
|
+
const conflictAssoc = entity.addAssociation({ targets: [{ key: targetEntity.key }] })
|
|
966
966
|
conflictAssoc.info.name = 'test_copy'
|
|
967
967
|
|
|
968
968
|
const duplicate = association.duplicate()
|
|
@@ -976,7 +976,7 @@ test.group('DomainAssociation.duplicate()', () => {
|
|
|
976
976
|
const entity = model.addEntity()
|
|
977
977
|
const targetEntity = model.addEntity()
|
|
978
978
|
|
|
979
|
-
const association = entity.addAssociation({ key: targetEntity.key })
|
|
979
|
+
const association = entity.addAssociation({ targets: [{ key: targetEntity.key }] })
|
|
980
980
|
// The association gets the default name "new_association" from schema creation
|
|
981
981
|
assert.equal(association.info.name, 'new_association')
|
|
982
982
|
|
|
@@ -991,7 +991,7 @@ test.group('DomainAssociation.duplicate()', () => {
|
|
|
991
991
|
const entity = model.addEntity()
|
|
992
992
|
const targetEntity = model.addEntity()
|
|
993
993
|
|
|
994
|
-
const association = entity.addAssociation({ key: targetEntity.key })
|
|
994
|
+
const association = entity.addAssociation({ targets: [{ key: targetEntity.key }] })
|
|
995
995
|
association.info.name = 'test'
|
|
996
996
|
// Manually set name to undefined to test the fallback logic
|
|
997
997
|
association.info.name = undefined
|
|
@@ -1007,7 +1007,7 @@ test.group('DomainAssociation.duplicate()', () => {
|
|
|
1007
1007
|
const entity = model.addEntity()
|
|
1008
1008
|
const targetEntity = model.addEntity()
|
|
1009
1009
|
|
|
1010
|
-
const association = entity.addAssociation({ key: targetEntity.key })
|
|
1010
|
+
const association = entity.addAssociation({ targets: [{ key: targetEntity.key }] })
|
|
1011
1011
|
const originalKey = association.key
|
|
1012
1012
|
|
|
1013
1013
|
const duplicate = association.duplicate()
|
|
@@ -1022,7 +1022,7 @@ test.group('DomainAssociation.duplicate()', () => {
|
|
|
1022
1022
|
const targetEntity1 = model.addEntity()
|
|
1023
1023
|
const targetEntity2 = model.addEntity()
|
|
1024
1024
|
|
|
1025
|
-
const association = entity.addAssociation({ key: targetEntity1.key })
|
|
1025
|
+
const association = entity.addAssociation({ targets: [{ key: targetEntity1.key }] })
|
|
1026
1026
|
association.addTarget(targetEntity2.key)
|
|
1027
1027
|
association.info.name = 'multiTarget'
|
|
1028
1028
|
|
|
@@ -1047,7 +1047,7 @@ test.group('DomainAssociation.duplicate()', () => {
|
|
|
1047
1047
|
const entity = model.addEntity()
|
|
1048
1048
|
const targetEntity = model.addEntity()
|
|
1049
1049
|
|
|
1050
|
-
const association = entity.addAssociation({ key: targetEntity.key })
|
|
1050
|
+
const association = entity.addAssociation({ targets: [{ key: targetEntity.key }] })
|
|
1051
1051
|
association.info.name = 'complexAssociation'
|
|
1052
1052
|
association.info.description = 'A complex association'
|
|
1053
1053
|
association.required = true
|
|
@@ -1077,7 +1077,7 @@ test.group('DomainAssociation.duplicate()', () => {
|
|
|
1077
1077
|
const entity = model.addEntity()
|
|
1078
1078
|
const targetEntity = model.addEntity()
|
|
1079
1079
|
|
|
1080
|
-
const association = entity.addAssociation({ key: targetEntity.key })
|
|
1080
|
+
const association = entity.addAssociation({ targets: [{ key: targetEntity.key }] })
|
|
1081
1081
|
association.info.name = 'original'
|
|
1082
1082
|
association.schema = { linked: false, unionType: 'anyOf' }
|
|
1083
1083
|
association.bindings = [{ type: 'web', schema: { hidden: false } }]
|
|
@@ -1134,7 +1134,7 @@ test.group('DomainAssociation.duplicate()', () => {
|
|
|
1134
1134
|
const entity = model.addEntity()
|
|
1135
1135
|
const targetEntity = model.addEntity()
|
|
1136
1136
|
|
|
1137
|
-
const association = entity.addAssociation({ key: targetEntity.key })
|
|
1137
|
+
const association = entity.addAssociation({ targets: [{ key: targetEntity.key }] })
|
|
1138
1138
|
association.info.name = 'test'
|
|
1139
1139
|
|
|
1140
1140
|
let notificationCalled = false
|
|
@@ -1184,7 +1184,7 @@ test.group('DomainAssociation.duplicate()', () => {
|
|
|
1184
1184
|
const model = dataDomain.addModel()
|
|
1185
1185
|
const entity = model.addEntity()
|
|
1186
1186
|
const targetEntity = model.addEntity()
|
|
1187
|
-
const association = entity.addAssociation({ key: targetEntity.key })
|
|
1187
|
+
const association = entity.addAssociation({ targets: [{ key: targetEntity.key }] })
|
|
1188
1188
|
association.info.name = 'only'
|
|
1189
1189
|
|
|
1190
1190
|
const duplicate = association.duplicate()
|
|
@@ -1201,7 +1201,7 @@ test.group('DomainAssociation.duplicate()', () => {
|
|
|
1201
1201
|
const targetEntity = model.addEntity()
|
|
1202
1202
|
|
|
1203
1203
|
const property1 = entity.addProperty({ info: { name: 'prop1' } })
|
|
1204
|
-
const association1 = entity.addAssociation({ key: targetEntity.key })
|
|
1204
|
+
const association1 = entity.addAssociation({ targets: [{ key: targetEntity.key }] })
|
|
1205
1205
|
association1.info.name = 'assoc1'
|
|
1206
1206
|
const property2 = entity.addProperty({ info: { name: 'prop2' } })
|
|
1207
1207
|
|
|
@@ -1217,7 +1217,7 @@ test.group('DomainAssociation.duplicate()', () => {
|
|
|
1217
1217
|
const model = dataDomain.addModel()
|
|
1218
1218
|
const entity = model.addEntity()
|
|
1219
1219
|
const targetEntity = model.addEntity()
|
|
1220
|
-
const association = entity.addAssociation({ key: targetEntity.key })
|
|
1220
|
+
const association = entity.addAssociation({ targets: [{ key: targetEntity.key }] })
|
|
1221
1221
|
|
|
1222
1222
|
const duplicate = association.duplicate()
|
|
1223
1223
|
|
|
@@ -1268,7 +1268,7 @@ test.group('DomainAssociation.duplicate()', () => {
|
|
|
1268
1268
|
const entity = model.addEntity()
|
|
1269
1269
|
dataDomain.registerForeignDomain(fd)
|
|
1270
1270
|
|
|
1271
|
-
const association = entity.addAssociation({ key: fe1.key, domain: fd.key })
|
|
1271
|
+
const association = entity.addAssociation({ targets: [{ key: fe1.key, domain: fd.key }] })
|
|
1272
1272
|
|
|
1273
1273
|
const duplicate = association.duplicate()
|
|
1274
1274
|
|
|
@@ -785,7 +785,7 @@ test.group('DomainEntity.generateUniqueName()', () => {
|
|
|
785
785
|
const targetEntity = model.addEntity()
|
|
786
786
|
|
|
787
787
|
// Add an association that conflicts with the first generated name
|
|
788
|
-
const association = entity.addAssociation({ key: targetEntity.key })
|
|
788
|
+
const association = entity.addAssociation({ targets: [{ key: targetEntity.key }] })
|
|
789
789
|
association.info.name = 'test_copy'
|
|
790
790
|
|
|
791
791
|
const uniqueName = entity.generateUniqueName('test')
|
|
@@ -800,7 +800,7 @@ test.group('DomainEntity.generateUniqueName()', () => {
|
|
|
800
800
|
|
|
801
801
|
// Add property and association with conflicting names
|
|
802
802
|
entity.addProperty({ info: { name: 'test_copy' } })
|
|
803
|
-
const association = entity.addAssociation({ key: targetEntity.key })
|
|
803
|
+
const association = entity.addAssociation({ targets: [{ key: targetEntity.key }] })
|
|
804
804
|
association.info.name = 'test_copy_2'
|
|
805
805
|
|
|
806
806
|
const uniqueName = entity.generateUniqueName('test')
|
|
@@ -816,7 +816,7 @@ test.group('DomainEntity.generateUniqueName()', () => {
|
|
|
816
816
|
// Add property without a name (undefined name)
|
|
817
817
|
entity.addProperty({ info: {} })
|
|
818
818
|
// Add association without a name
|
|
819
|
-
entity.addAssociation({ key: targetEntity.key })
|
|
819
|
+
entity.addAssociation({ targets: [{ key: targetEntity.key }] })
|
|
820
820
|
|
|
821
821
|
const uniqueName = entity.generateUniqueName('test')
|
|
822
822
|
assert.equal(uniqueName, 'test_copy')
|
|
@@ -16,7 +16,7 @@ test.group('DomainEntity.addAssociation()', () => {
|
|
|
16
16
|
const model = dataDomain.addModel()
|
|
17
17
|
const entity1 = model.addEntity({ key: 'entity1' })
|
|
18
18
|
const entity2 = model.addEntity({ key: 'entity2' })
|
|
19
|
-
const association = entity1.addAssociation({ key: entity2.key })
|
|
19
|
+
const association = entity1.addAssociation({ targets: [{ key: entity2.key }] })
|
|
20
20
|
assert.instanceOf(association, DomainAssociation)
|
|
21
21
|
assert.isTrue(dataDomain.graph.hasNode(association.key))
|
|
22
22
|
assert.deepEqual(association.targets, [{ key: entity2.key }])
|
|
@@ -27,7 +27,7 @@ test.group('DomainEntity.addAssociation()', () => {
|
|
|
27
27
|
const model = dataDomain.addModel()
|
|
28
28
|
const entity = model.addEntity()
|
|
29
29
|
assert.throws(() => {
|
|
30
|
-
entity.addAssociation({ key: 'non-existent-entity' })
|
|
30
|
+
entity.addAssociation({ targets: [{ key: 'non-existent-entity' }] })
|
|
31
31
|
}, 'Target entity non-existent-entity not found')
|
|
32
32
|
})
|
|
33
33
|
|
|
@@ -84,7 +84,7 @@ test.group('DomainEntity.addAssociation()', () => {
|
|
|
84
84
|
root2.info.version = '1.0.0'
|
|
85
85
|
root1.registerForeignDomain(root2)
|
|
86
86
|
|
|
87
|
-
const association = e1.addAssociation({ key: e2.key, domain: root2.key })
|
|
87
|
+
const association = e1.addAssociation({ targets: [{ key: e2.key, domain: root2.key }] })
|
|
88
88
|
assert.instanceOf(association, DomainAssociation)
|
|
89
89
|
assert.isTrue(root1.graph.hasNode(association.key))
|
|
90
90
|
assert.deepEqual(association.targets, [{ key: e2.key, domain: root2.key }])
|
|
@@ -98,7 +98,7 @@ test.group('DomainEntity.addAssociation()', () => {
|
|
|
98
98
|
root2.info.version = '1.0.0'
|
|
99
99
|
root1.registerForeignDomain(root2)
|
|
100
100
|
assert.throws(() => {
|
|
101
|
-
entity.addAssociation({ key: 'non-existent-entity', domain: root2.key })
|
|
101
|
+
entity.addAssociation({ targets: [{ key: 'non-existent-entity', domain: root2.key }] })
|
|
102
102
|
}, `Foreign entity ${root2.key}:non-existent-entity not found`)
|
|
103
103
|
})
|
|
104
104
|
})
|
|
@@ -730,7 +730,7 @@ test.group('JSON DomainEntity Generator: associations', (group) => {
|
|
|
730
730
|
|
|
731
731
|
test('creates a property from an association', ({ assert }) => {
|
|
732
732
|
e2.addProperty({ type: 'number', key: 'n1', info: { name: 'n1' } })
|
|
733
|
-
e1.addAssociation({ key: e2.key },
|
|
733
|
+
e1.addAssociation({ targets: [{ key: e2.key }], key: 'a1', info: { name: 'a1' } })
|
|
734
734
|
|
|
735
735
|
const result = e1.toExample(mime) as string
|
|
736
736
|
|
|
@@ -744,8 +744,8 @@ test.group('JSON DomainEntity Generator: associations', (group) => {
|
|
|
744
744
|
const e3 = d1.addEntity({ key: 'e3', info: { name: 'e3' } })
|
|
745
745
|
e3.addProperty({ type: 'number', key: 'i1', info: { name: 'i1' } })
|
|
746
746
|
e2.addProperty({ type: 'number', key: 'n1', info: { name: 'n1' } })
|
|
747
|
-
e1.addAssociation({ key: e2.key },
|
|
748
|
-
e2.addAssociation({ key: e3.key },
|
|
747
|
+
e1.addAssociation({ targets: [{ key: e2.key }], key: 'a1', info: { name: 'a1' } })
|
|
748
|
+
e2.addAssociation({ targets: [{ key: e3.key }], key: 'a2', info: { name: 'a2' } })
|
|
749
749
|
|
|
750
750
|
const result = e1.toExample(mime) as string
|
|
751
751
|
|
|
@@ -758,7 +758,7 @@ test.group('JSON DomainEntity Generator: associations', (group) => {
|
|
|
758
758
|
})
|
|
759
759
|
|
|
760
760
|
test('does not make associations to self (recursive #1)', ({ assert }) => {
|
|
761
|
-
e1.addAssociation({ key: e1.key },
|
|
761
|
+
e1.addAssociation({ targets: [{ key: e1.key }], key: 'a1' })
|
|
762
762
|
const result = e1.toExample(mime) as string
|
|
763
763
|
assert.equal(result, '{}')
|
|
764
764
|
})
|
|
@@ -767,9 +767,9 @@ test.group('JSON DomainEntity Generator: associations', (group) => {
|
|
|
767
767
|
const e3 = d1.addEntity({ key: 'e3', info: { name: 'e3' } })
|
|
768
768
|
e3.addProperty({ type: 'number', key: 'i1', info: { name: 'i1' } })
|
|
769
769
|
e2.addProperty({ type: 'number', key: 'n1', info: { name: 'n1' } })
|
|
770
|
-
e1.addAssociation({ key: e2.key },
|
|
771
|
-
e2.addAssociation({ key: e3.key },
|
|
772
|
-
e3.addAssociation({ key: e1.key },
|
|
770
|
+
e1.addAssociation({ targets: [{ key: e2.key }], key: 'a1', info: { name: 'a1' } })
|
|
771
|
+
e2.addAssociation({ targets: [{ key: e3.key }], key: 'a2', info: { name: 'a2' } })
|
|
772
|
+
e3.addAssociation({ targets: [{ key: e1.key }], key: 'a3', info: { name: 'a3' } })
|
|
773
773
|
|
|
774
774
|
const result = e1.toExample(mime) as string
|
|
775
775
|
|
|
@@ -786,7 +786,7 @@ test.group('JSON DomainEntity Generator: associations', (group) => {
|
|
|
786
786
|
const e3 = d1.addEntity({ key: 'e3', info: { name: 'e3' } })
|
|
787
787
|
e3.addProperty({ type: 'number', key: 'i1', info: { name: 'i1' } })
|
|
788
788
|
e2.addProperty({ type: 'string', key: 's1', info: { name: 's1' } })
|
|
789
|
-
const a1 = e1.addAssociation({ key: e2.key },
|
|
789
|
+
const a1 = e1.addAssociation({ targets: [{ key: e2.key }], key: 'a1', info: { name: 'a1' } })
|
|
790
790
|
a1.addTarget(e3.key)
|
|
791
791
|
|
|
792
792
|
const result = e1.toExample(mime) as string
|
|
@@ -801,7 +801,7 @@ test.group('JSON DomainEntity Generator: associations', (group) => {
|
|
|
801
801
|
const e3 = d1.addEntity({ key: 'e3', info: { name: 'e3' } })
|
|
802
802
|
e3.addProperty({ type: 'number', key: 'i1', info: { name: 'i1' } })
|
|
803
803
|
e2.addProperty({ type: 'string', key: 's1', info: { name: 's1' } })
|
|
804
|
-
const a1 = e1.addAssociation({ key: e2.key },
|
|
804
|
+
const a1 = e1.addAssociation({ targets: [{ key: e2.key }], key: 'a1', info: { name: 'a1' } })
|
|
805
805
|
a1.addTarget(e3.key)
|
|
806
806
|
a1.multiple = true
|
|
807
807
|
|
|
@@ -821,7 +821,7 @@ test.group('JSON DomainEntity Generator: associations', (group) => {
|
|
|
821
821
|
e2.addProperty({ type: 'string', key: 's1', info: { name: 's1' } })
|
|
822
822
|
e3.addProperty({ type: 'number', key: 'i1', info: { name: 'i1' } })
|
|
823
823
|
|
|
824
|
-
const a1 = e1.addAssociation({ key: e2.key },
|
|
824
|
+
const a1 = e1.addAssociation({ targets: [{ key: e2.key }], key: 'a1', info: { name: 'a1' } })
|
|
825
825
|
a1.addTarget(e3.key)
|
|
826
826
|
a1.schema = { unionType: 'anyOf' }
|
|
827
827
|
|
|
@@ -838,7 +838,7 @@ test.group('JSON DomainEntity Generator: associations', (group) => {
|
|
|
838
838
|
const e3 = d1.addEntity({ key: 'e3', info: { name: 'e3' } })
|
|
839
839
|
e3.addProperty({ type: 'number', key: 'i1', info: { name: 'i1' } })
|
|
840
840
|
e2.addProperty({ type: 'string', key: 's1', info: { name: 's1' } })
|
|
841
|
-
const a1 = e1.addAssociation({ key: e2.key },
|
|
841
|
+
const a1 = e1.addAssociation({ targets: [{ key: e2.key }], key: 'a1', info: { name: 'a1' } })
|
|
842
842
|
a1.addTarget(e3.key)
|
|
843
843
|
a1.schema = { unionType: 'allOf' }
|
|
844
844
|
|
|
@@ -857,7 +857,7 @@ test.group('JSON DomainEntity Generator: associations', (group) => {
|
|
|
857
857
|
e2.addProperty({ type: 'string', key: 's1', info: { name: 's1' } })
|
|
858
858
|
e3.addProperty({ type: 'number', key: 'i1', info: { name: 'i1' } })
|
|
859
859
|
|
|
860
|
-
const a1 = e1.addAssociation({ key: e2.key },
|
|
860
|
+
const a1 = e1.addAssociation({ targets: [{ key: e2.key }], key: 'a1', info: { name: 'a1' } })
|
|
861
861
|
a1.addTarget(e3.key)
|
|
862
862
|
|
|
863
863
|
a1.schema = { unionType: 'oneOf' }
|
|
@@ -877,7 +877,7 @@ test.group('JSON DomainEntity Generator: associations', (group) => {
|
|
|
877
877
|
e2.addProperty({ type: 'string', key: 's1', info: { name: 's1' } })
|
|
878
878
|
e3.addProperty({ type: 'number', key: 'i1', info: { name: 'i1' } })
|
|
879
879
|
|
|
880
|
-
const a1 = e1.addAssociation({ key: e2.key },
|
|
880
|
+
const a1 = e1.addAssociation({ targets: [{ key: e2.key }], key: 'a1', info: { name: 'a1' } })
|
|
881
881
|
a1.addTarget(e3.key)
|
|
882
882
|
a1.schema = { unionType: 'oneOf' }
|
|
883
883
|
|
|
@@ -897,7 +897,7 @@ test.group('JSON DomainEntity Generator: associations', (group) => {
|
|
|
897
897
|
e3.addProperty({ type: 'number', key: 'n1', info: { name: 'n1' } })
|
|
898
898
|
n2.info.version = '1.0.0'
|
|
899
899
|
n1.registerForeignDomain(n2)
|
|
900
|
-
e1.addAssociation({ key: e3.key, domain: n2.key },
|
|
900
|
+
e1.addAssociation({ targets: [{ key: e3.key, domain: n2.key }], key: 'a3', info: { name: 'a3' } })
|
|
901
901
|
const result = e1.toExample(mime) as string
|
|
902
902
|
assert.typeOf(result, 'string', 'result is a string')
|
|
903
903
|
const data = JSON.parse(result)
|
|
@@ -945,7 +945,7 @@ test.group('JSON DomainEntity Generator: parents', (group) => {
|
|
|
945
945
|
e2.addParent(e1.key)
|
|
946
946
|
const e3 = d1.addEntity({ key: 'e3', info: { name: 'e3' } })
|
|
947
947
|
e3.addProperty({ type: 'string', key: 'p3', info: { name: 'p3' } })
|
|
948
|
-
e2.addAssociation({ key: e3.key },
|
|
948
|
+
e2.addAssociation({ targets: [{ key: e3.key }], key: 'a1', info: { name: 'a1' } })
|
|
949
949
|
|
|
950
950
|
const result = e2.toExample(mime) as string
|
|
951
951
|
|
|
@@ -963,7 +963,7 @@ test.group('JSON DomainEntity Generator: parents', (group) => {
|
|
|
963
963
|
e2.addParent(e1.key)
|
|
964
964
|
const e3 = d1.addEntity({ key: 'e3', info: { name: 'e3' } })
|
|
965
965
|
e3.addProperty({ type: 'string', key: 'p3', info: { name: 'p3' } })
|
|
966
|
-
e1.addAssociation({ key: e3.key },
|
|
966
|
+
e1.addAssociation({ targets: [{ key: e3.key }], key: 'a1', info: { name: 'a1' } })
|
|
967
967
|
|
|
968
968
|
const result = e2.toExample(mime) as string
|
|
969
969
|
|
|
@@ -1108,7 +1108,7 @@ test.group('XML DomainEntity Generator: associations', (group) => {
|
|
|
1108
1108
|
|
|
1109
1109
|
test('creates a property from an association', ({ assert }) => {
|
|
1110
1110
|
e2.addProperty({ type: 'number', key: 'n1', info: { name: 'n1' } })
|
|
1111
|
-
e1.addAssociation({ key: e2.key },
|
|
1111
|
+
e1.addAssociation({ targets: [{ key: e2.key }], key: 'a1', info: { name: 'a1' } })
|
|
1112
1112
|
|
|
1113
1113
|
const result = e1.toExample(mime) as string
|
|
1114
1114
|
|
|
@@ -1131,8 +1131,8 @@ test.group('XML DomainEntity Generator: associations', (group) => {
|
|
|
1131
1131
|
const e3 = d1.addEntity({ key: 'e3', info: { name: 'e3' } })
|
|
1132
1132
|
e3.addProperty({ type: 'number', key: 'i1', info: { name: 'i1' } })
|
|
1133
1133
|
e2.addProperty({ type: 'number', key: 'n1', info: { name: 'n1' } })
|
|
1134
|
-
e1.addAssociation({ key: e2.key },
|
|
1135
|
-
e2.addAssociation({ key: e3.key },
|
|
1134
|
+
e1.addAssociation({ targets: [{ key: e2.key }], key: 'a1', info: { name: 'a1' } })
|
|
1135
|
+
e2.addAssociation({ targets: [{ key: e3.key }], key: 'a2', info: { name: 'a2' } })
|
|
1136
1136
|
|
|
1137
1137
|
const result = e1.toExample(mime) as string
|
|
1138
1138
|
|
|
@@ -1160,7 +1160,7 @@ test.group('XML DomainEntity Generator: associations', (group) => {
|
|
|
1160
1160
|
})
|
|
1161
1161
|
|
|
1162
1162
|
test('does not make associations to self (recursive #1)', ({ assert }) => {
|
|
1163
|
-
e1.addAssociation({ key: e1.key },
|
|
1163
|
+
e1.addAssociation({ targets: [{ key: e1.key }], key: 'a1' })
|
|
1164
1164
|
const result = e1.toExample(mime) as string
|
|
1165
1165
|
|
|
1166
1166
|
const dom = new JSDOM(result, { contentType: mime })
|
|
@@ -1174,9 +1174,9 @@ test.group('XML DomainEntity Generator: associations', (group) => {
|
|
|
1174
1174
|
const e3 = d1.addEntity({ key: 'e3', info: { name: 'e3' } })
|
|
1175
1175
|
e3.addProperty({ type: 'number', key: 'i1', info: { name: 'i1' } })
|
|
1176
1176
|
e2.addProperty({ type: 'number', key: 'n1', info: { name: 'n1' } })
|
|
1177
|
-
e1.addAssociation({ key: e2.key },
|
|
1178
|
-
e2.addAssociation({ key: e3.key },
|
|
1179
|
-
e3.addAssociation({ key: e1.key },
|
|
1177
|
+
e1.addAssociation({ targets: [{ key: e2.key }], key: 'a1', info: { name: 'a1' } })
|
|
1178
|
+
e2.addAssociation({ targets: [{ key: e3.key }], key: 'a2', info: { name: 'a2' } })
|
|
1179
|
+
e3.addAssociation({ targets: [{ key: e1.key }], key: 'a3', info: { name: 'a3' } })
|
|
1180
1180
|
|
|
1181
1181
|
const result = e1.toExample(mime) as string
|
|
1182
1182
|
assert.typeOf(result, 'string', 'result is a string')
|
|
@@ -1192,7 +1192,7 @@ test.group('XML DomainEntity Generator: associations', (group) => {
|
|
|
1192
1192
|
const e3 = d1.addEntity({ key: 'e3', info: { name: 'e3' } })
|
|
1193
1193
|
e3.addProperty({ type: 'number', key: 'i1', info: { name: 'i1' } })
|
|
1194
1194
|
e2.addProperty({ type: 'string', key: 's1', info: { name: 's1' } })
|
|
1195
|
-
const a1 = e1.addAssociation({ key: e2.key },
|
|
1195
|
+
const a1 = e1.addAssociation({ targets: [{ key: e2.key }], key: 'a1', info: { name: 'a1' } })
|
|
1196
1196
|
a1.addTarget(e3.key)
|
|
1197
1197
|
|
|
1198
1198
|
const result = e1.toExample(mime) as string
|
|
@@ -1233,7 +1233,7 @@ test.group('XML DomainEntity Generator: associations', (group) => {
|
|
|
1233
1233
|
e2.addProperty({ type: 'string', key: 's1', info: { name: 's1' } })
|
|
1234
1234
|
e3.addProperty({ type: 'number', key: 'i1', info: { name: 'i1' } })
|
|
1235
1235
|
|
|
1236
|
-
const a1 = e1.addAssociation({ key: e2.key },
|
|
1236
|
+
const a1 = e1.addAssociation({ targets: [{ key: e2.key }], key: 'a1', info: { name: 'a1' } })
|
|
1237
1237
|
a1.addTarget(e3.key)
|
|
1238
1238
|
|
|
1239
1239
|
a1.schema = { unionType: 'anyOf' }
|
|
@@ -1255,7 +1255,7 @@ test.group('XML DomainEntity Generator: associations', (group) => {
|
|
|
1255
1255
|
const e3 = d1.addEntity({ key: 'e3', info: { name: 'e3' } })
|
|
1256
1256
|
e3.addProperty({ type: 'number', key: 'i1', info: { name: 'i1' } })
|
|
1257
1257
|
e2.addProperty({ type: 'string', key: 's1', info: { name: 's1' } })
|
|
1258
|
-
const a1 = e1.addAssociation({ key: e2.key },
|
|
1258
|
+
const a1 = e1.addAssociation({ targets: [{ key: e2.key }], key: 'a1', info: { name: 'a1' } })
|
|
1259
1259
|
a1.addTarget(e3.key)
|
|
1260
1260
|
|
|
1261
1261
|
a1.schema = { unionType: 'allOf' }
|
|
@@ -1278,7 +1278,7 @@ test.group('XML DomainEntity Generator: associations', (group) => {
|
|
|
1278
1278
|
e2.addProperty({ type: 'string', key: 's1', info: { name: 's1' } })
|
|
1279
1279
|
e3.addProperty({ type: 'number', key: 'i1', info: { name: 'i1' } })
|
|
1280
1280
|
|
|
1281
|
-
const a1 = e1.addAssociation({ key: e2.key },
|
|
1281
|
+
const a1 = e1.addAssociation({ targets: [{ key: e2.key }], key: 'a1', info: { name: 'a1' } })
|
|
1282
1282
|
a1.addTarget(e3.key)
|
|
1283
1283
|
|
|
1284
1284
|
a1.schema = { unionType: 'oneOf' }
|
|
@@ -1301,7 +1301,7 @@ test.group('XML DomainEntity Generator: associations', (group) => {
|
|
|
1301
1301
|
e2.addProperty({ type: 'string', key: 's1', info: { name: 's1' } })
|
|
1302
1302
|
e3.addProperty({ type: 'number', key: 'i1', info: { name: 'i1' } })
|
|
1303
1303
|
|
|
1304
|
-
const a1 = e1.addAssociation({ key: e2.key },
|
|
1304
|
+
const a1 = e1.addAssociation({ targets: [{ key: e2.key }], key: 'a1', info: { name: 'a1' } })
|
|
1305
1305
|
a1.addTarget(e3.key)
|
|
1306
1306
|
|
|
1307
1307
|
a1.schema = { unionType: 'oneOf' }
|
|
@@ -1374,7 +1374,7 @@ test.group('XML DomainEntity Generator: parents', (group) => {
|
|
|
1374
1374
|
e2.addParent(e1.key)
|
|
1375
1375
|
const e3 = d1.addEntity({ key: 'e3', info: { name: 'e3' } })
|
|
1376
1376
|
e3.addProperty({ type: 'string', key: 'p3', info: { name: 'p3' } })
|
|
1377
|
-
e2.addAssociation({ key: e3.key },
|
|
1377
|
+
e2.addAssociation({ targets: [{ key: e3.key }], key: 'a1', info: { name: 'a1' } })
|
|
1378
1378
|
|
|
1379
1379
|
const result = e2.toExample(mime) as string
|
|
1380
1380
|
assert.typeOf(result, 'string', 'result is a string')
|
|
@@ -1406,7 +1406,7 @@ test.group('XML DomainEntity Generator: parents', (group) => {
|
|
|
1406
1406
|
e2.addParent(e1.key)
|
|
1407
1407
|
const e3 = d1.addEntity({ key: 'e3', info: { name: 'e3' } })
|
|
1408
1408
|
e3.addProperty({ type: 'string', key: 'p3', info: { name: 'p3' } })
|
|
1409
|
-
e1.addAssociation({ key: e3.key },
|
|
1409
|
+
e1.addAssociation({ targets: [{ key: e3.key }], key: 'a1', info: { name: 'a1' } })
|
|
1410
1410
|
|
|
1411
1411
|
const result = e2.toExample(mime) as string
|
|
1412
1412
|
assert.typeOf(result, 'string', 'result is a string')
|
|
@@ -1623,7 +1623,7 @@ test.group('DomainProperty.duplicate()', () => {
|
|
|
1623
1623
|
const targetEntity = model.addEntity()
|
|
1624
1624
|
|
|
1625
1625
|
const property1 = entity.addProperty({ info: { name: 'prop1' } })
|
|
1626
|
-
const association = entity.addAssociation({ key: targetEntity.key })
|
|
1626
|
+
const association = entity.addAssociation({ targets: [{ key: targetEntity.key }] })
|
|
1627
1627
|
association.info.name = 'assoc1'
|
|
1628
1628
|
const property2 = entity.addProperty({ info: { name: 'prop2' } })
|
|
1629
1629
|
|
|
@@ -45,7 +45,7 @@ test.group('DomainImpactAnalysis.validate()', (group) => {
|
|
|
45
45
|
const model = domain.addModel({ key: 'model' })
|
|
46
46
|
const entity1 = model.addEntity({ key: 'entity1', info: { name: 'entity1' } })
|
|
47
47
|
const entity2 = model.addEntity({ key: 'entity2', info: { name: 'entity2' } })
|
|
48
|
-
entity1.addAssociation({ key: entity2.key },
|
|
48
|
+
entity1.addAssociation({ targets: [{ key: entity2.key }], info: { name: 'Invalid-Name' } })
|
|
49
49
|
|
|
50
50
|
const report = analysis.validate()
|
|
51
51
|
assert.lengthOf(report.impact, 12)
|
|
@@ -57,7 +57,7 @@ test.group('DomainImpactAnalysis.validate()', (group) => {
|
|
|
57
57
|
const entity1 = model.addEntity({ key: 'invalid-entity', info: { name: 'Invalid-Entity' } })
|
|
58
58
|
entity1.addProperty({ key: 'invalid-property', type: 'string', info: { name: 'Invalid-Property' } })
|
|
59
59
|
const entity2 = model.addEntity({ key: 'entity2', info: { name: 'entity2' } })
|
|
60
|
-
entity1.addAssociation({ key: entity2.key },
|
|
60
|
+
entity1.addAssociation({ targets: [{ key: entity2.key }], info: { name: 'Invalid-Name' } })
|
|
61
61
|
|
|
62
62
|
const report = analysis.validate()
|
|
63
63
|
assert.lengthOf(report.impact, 16)
|
|
@@ -74,7 +74,7 @@ test.group('DomainImpactAnalysis.validate()', (group) => {
|
|
|
74
74
|
entity2.addProperty({ key: 'p4', type: 'string', primary: true, info: { name: 'property4' } })
|
|
75
75
|
const p5e2 = entity2.addProperty({ key: 'p5', type: 'datetime', info: { name: 'property5' } })
|
|
76
76
|
const p6e2 = entity2.addProperty({ key: 'p6', type: 'datetime', info: { name: 'property6' } })
|
|
77
|
-
entity1.addAssociation({ key: entity2.key },
|
|
77
|
+
entity1.addAssociation({ targets: [{ key: entity2.key }], info: { name: 'name' } })
|
|
78
78
|
const p3e1 = entity1.addProperty({ type: 'datetime', info: { name: 'p3e1' } })
|
|
79
79
|
const p4e1 = entity1.addProperty({ type: 'datetime', info: { name: 'p4e1' } })
|
|
80
80
|
const p5e1 = entity1.addProperty({ type: 'boolean', info: { name: 'p5e1' } })
|
|
@@ -26,7 +26,7 @@ test.group('DomainVersioning', () => {
|
|
|
26
26
|
fd.info.version = '1.0.0'
|
|
27
27
|
root.registerForeignDomain(fd)
|
|
28
28
|
|
|
29
|
-
e1.addAssociation({ domain: fd.key, key: fe1.key },
|
|
29
|
+
e1.addAssociation({ targets: [{ domain: fd.key, key: fe1.key }], key: 'a1' })
|
|
30
30
|
|
|
31
31
|
const serialized = DomainVersioning.serializeForVersionRelease(root)
|
|
32
32
|
|
|
@@ -65,11 +65,11 @@ test.group('DomainVersioning', () => {
|
|
|
65
65
|
const fm1 = fd1.addModel({ key: 'fm1' })
|
|
66
66
|
const fe1 = fm1.addEntity({ key: 'fe1' })
|
|
67
67
|
const fe2 = fm1.addEntity({ key: 'fe2' }) // This should be included
|
|
68
|
-
fe1.addAssociation({ key: fe2.key },
|
|
68
|
+
fe1.addAssociation({ targets: [{ key: fe2.key }], key: 'a1' })
|
|
69
69
|
fd1.info.version = '1.0.0'
|
|
70
70
|
root.registerForeignDomain(fd1)
|
|
71
71
|
|
|
72
|
-
e1.addAssociation({ domain: fd1.key, key: fe1.key },
|
|
72
|
+
e1.addAssociation({ targets: [{ domain: fd1.key, key: fe1.key }], key: 'a2' })
|
|
73
73
|
|
|
74
74
|
const serialized = DomainVersioning.serializeForVersionRelease(root)
|
|
75
75
|
|
|
@@ -99,11 +99,11 @@ test.group('DomainVersioning', () => {
|
|
|
99
99
|
fd2.registerForeignDomain(fd1)
|
|
100
100
|
const fm2 = fd2.addModel({ key: 'fm2' }) // not serialized
|
|
101
101
|
const fe2 = fm2.addEntity({ key: 'fe2' }) // serialized
|
|
102
|
-
const fa1 = fe2.addAssociation({ domain: fd1.key, key: fe1.key },
|
|
102
|
+
const fa1 = fe2.addAssociation({ targets: [{ domain: fd1.key, key: fe1.key }], key: 'a1' })
|
|
103
103
|
fd2.info.version = '1.0.0'
|
|
104
104
|
root.registerForeignDomain(fd2) // serialized
|
|
105
105
|
|
|
106
|
-
const a2 = e1.addAssociation({ domain: fd2.key, key: fe2.key },
|
|
106
|
+
const a2 = e1.addAssociation({ targets: [{ domain: fd2.key, key: fe2.key }], key: 'a2' }) // serialized
|
|
107
107
|
|
|
108
108
|
const serialized = DomainVersioning.serializeForVersionRelease(root)
|
|
109
109
|
|
|
@@ -77,7 +77,7 @@ test.group('ExposedEntity Path Setter Validation', () => {
|
|
|
77
77
|
const dm = domain.addModel()
|
|
78
78
|
const eA = dm.addEntity({ info: { name: 'A' } })
|
|
79
79
|
const eB = dm.addEntity({ info: { name: 'B' } })
|
|
80
|
-
eA.addAssociation({ key: eB.key },
|
|
80
|
+
eA.addAssociation({ targets: [{ key: eB.key }], key: 'toB' })
|
|
81
81
|
|
|
82
82
|
const model = new ApiModel()
|
|
83
83
|
model.attachDataDomain(domain)
|