@api-client/core 0.13.6 → 0.14.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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 +1 -0
- 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 +1 -0
- 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 +28 -0
- package/build/src/modeling/DomainAssociation.d.ts.map +1 -1
- package/build/src/modeling/DomainAssociation.js +73 -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 +3 -4
- package/build/src/modeling/DomainFile.d.ts.map +1 -1
- package/build/src/modeling/DomainFile.js +5 -9
- 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 +109 -0
- package/build/src/modeling/Semantics.d.ts.map +1 -0
- package/build/src/modeling/Semantics.js +97 -0
- package/build/src/modeling/Semantics.js.map +1 -0
- package/build/src/models/CertificateFile.d.ts +2 -3
- package/build/src/models/CertificateFile.d.ts.map +1 -1
- package/build/src/models/CertificateFile.js +4 -8
- package/build/src/models/CertificateFile.js.map +1 -1
- package/build/src/models/Folder.d.ts +1 -2
- package/build/src/models/Folder.d.ts.map +1 -1
- package/build/src/models/Folder.js +2 -4
- package/build/src/models/Folder.js.map +1 -1
- package/build/src/models/Project.d.ts +2 -3
- package/build/src/models/Project.d.ts.map +1 -1
- package/build/src/models/Project.js +4 -8
- package/build/src/models/Project.js.map +1 -1
- 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/File.d.ts +1 -21
- package/build/src/models/store/File.d.ts.map +1 -1
- package/build/src/models/store/File.js +3 -23
- package/build/src/models/store/File.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/src/sdk/FilesSdk.js +1 -1
- package/build/src/sdk/FilesSdk.js.map +1 -1
- package/build/tsconfig.tsbuildinfo +1 -1
- package/data/models/example-generator-api.json +22 -22
- package/eslint.config.js +1 -0
- package/package.json +5 -5
- 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 +66 -3
- package/src/modeling/DomainEntity.ts +56 -17
- package/src/modeling/DomainFile.ts +5 -9
- 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 +178 -0
- package/src/modeling/graph.md +14 -14
- package/src/modeling/readme.md +29 -29
- package/src/models/CertificateFile.ts +4 -12
- package/src/models/Folder.ts +2 -4
- package/src/models/Project.ts +4 -8
- package/src/models/kinds.ts +0 -25
- package/src/models/store/File.ts +4 -35
- package/src/models/store/data_catalog.ts +1 -1
- package/src/sdk/FilesSdk.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 +177 -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_file.spec.ts +4 -27
- package/tests/unit/modeling/{domain.property.spec.ts → domain_property.spec.ts} +139 -23
- package/tests/unit/models/Certificate/from_name.spec.ts +3 -15
- package/tests/unit/models/File/constructor.spec.ts +0 -1
- package/tests/unit/models/File/new.spec.ts +0 -13
- package/tests/unit/models/File/shortcutTo.spec.ts +1 -2
- package/tests/unit/models/File/toJSON.spec.ts +0 -13
- package/tests/unit/models/File/updateByMeMeta.spec.ts +4 -6
- package/tests/unit/models/Folder/create.spec.ts +2 -23
- package/tests/unit/models/Project/create.spec.ts +6 -32
- 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 -31
- package/build/src/models/store/DataFile.d.ts.map +0 -1
- package/build/src/models/store/DataFile.js +0 -92
- 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 -100
- 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
|
@@ -41728,18 +41728,18 @@
|
|
|
41728
41728
|
"@id": "#194"
|
|
41729
41729
|
},
|
|
41730
41730
|
{
|
|
41731
|
-
"@id": "#197"
|
|
41732
|
-
},
|
|
41733
|
-
{
|
|
41734
41731
|
"@id": "#200"
|
|
41735
41732
|
},
|
|
41736
41733
|
{
|
|
41737
|
-
"@id": "#
|
|
41734
|
+
"@id": "#197"
|
|
41738
41735
|
},
|
|
41739
41736
|
{
|
|
41740
41737
|
"@id": "#203"
|
|
41741
41738
|
},
|
|
41742
41739
|
{
|
|
41740
|
+
"@id": "#206"
|
|
41741
|
+
},
|
|
41742
|
+
{
|
|
41743
41743
|
"@id": "#209"
|
|
41744
41744
|
}
|
|
41745
41745
|
],
|
|
@@ -42470,6 +42470,9 @@
|
|
|
42470
42470
|
"@id": "#219"
|
|
42471
42471
|
},
|
|
42472
42472
|
{
|
|
42473
|
+
"@id": "#219"
|
|
42474
|
+
},
|
|
42475
|
+
{
|
|
42473
42476
|
"@id": "#210"
|
|
42474
42477
|
},
|
|
42475
42478
|
{
|
|
@@ -42477,9 +42480,6 @@
|
|
|
42477
42480
|
},
|
|
42478
42481
|
{
|
|
42479
42482
|
"@id": "#216"
|
|
42480
|
-
},
|
|
42481
|
-
{
|
|
42482
|
-
"@id": "#219"
|
|
42483
42483
|
}
|
|
42484
42484
|
],
|
|
42485
42485
|
"doc:root": false,
|
|
@@ -43138,7 +43138,7 @@
|
|
|
43138
43138
|
"doc:ExternalDomainElement",
|
|
43139
43139
|
"doc:DomainElement"
|
|
43140
43140
|
],
|
|
43141
|
-
"doc:raw": "
|
|
43141
|
+
"doc:raw": "class: '3'\ndescription: '150 - 300'\nnumberOfFte: 5500\nnumberOfEmployees: 5232\n",
|
|
43142
43142
|
"core:mediaType": "application/yaml",
|
|
43143
43143
|
"sourcemaps:sources": [
|
|
43144
43144
|
{
|
|
@@ -43159,7 +43159,7 @@
|
|
|
43159
43159
|
"doc:ExternalDomainElement",
|
|
43160
43160
|
"doc:DomainElement"
|
|
43161
43161
|
],
|
|
43162
|
-
"doc:raw": "
|
|
43162
|
+
"doc:raw": "code: '5'\ndescription: 'Limited company'\n",
|
|
43163
43163
|
"core:mediaType": "application/yaml",
|
|
43164
43164
|
"sourcemaps:sources": [
|
|
43165
43165
|
{
|
|
@@ -43180,7 +43180,7 @@
|
|
|
43180
43180
|
"doc:ExternalDomainElement",
|
|
43181
43181
|
"doc:DomainElement"
|
|
43182
43182
|
],
|
|
43183
|
-
"doc:raw": "code: '
|
|
43183
|
+
"doc:raw": "code: 'J'\ndescription: 'Information and communication'\n",
|
|
43184
43184
|
"core:mediaType": "application/yaml",
|
|
43185
43185
|
"sourcemaps:sources": [
|
|
43186
43186
|
{
|
|
@@ -43201,7 +43201,7 @@
|
|
|
43201
43201
|
"doc:ExternalDomainElement",
|
|
43202
43202
|
"doc:DomainElement"
|
|
43203
43203
|
],
|
|
43204
|
-
"doc:raw": "code: '
|
|
43204
|
+
"doc:raw": "code: '7487'\ndescription: 'Financial and insurance activities'\ntype: \"PRIMARY\"\nclassificationCode: 'BE_NACEBEL2008'\nactivityGroupCode: 'ABCDE'\n",
|
|
43205
43205
|
"core:mediaType": "application/yaml",
|
|
43206
43206
|
"sourcemaps:sources": [
|
|
43207
43207
|
{
|
|
@@ -43892,7 +43892,7 @@
|
|
|
43892
43892
|
"doc:ExternalDomainElement",
|
|
43893
43893
|
"doc:DomainElement"
|
|
43894
43894
|
],
|
|
43895
|
-
"doc:raw": "type: 'GENERAL'\ncountryDialCode : '+32'\nareaCode : '
|
|
43895
|
+
"doc:raw": "type: 'GENERAL'\ncountryDialCode : '+32'\nareaCode : '21'\nsubscriberNumber: '12.87.00'\nformatted: '+32-(0)21 302099'\n",
|
|
43896
43896
|
"core:mediaType": "application/yaml",
|
|
43897
43897
|
"sourcemaps:sources": [
|
|
43898
43898
|
{
|
|
@@ -43913,7 +43913,7 @@
|
|
|
43913
43913
|
"doc:ExternalDomainElement",
|
|
43914
43914
|
"doc:DomainElement"
|
|
43915
43915
|
],
|
|
43916
|
-
"doc:raw": "type: 'GENERAL'\
|
|
43916
|
+
"doc:raw": "-\n type: 'GENERAL'\n value: 'info@company.be'\n-\n type: 'IT_DEPT'\n value: 'it-service@company.be'\n",
|
|
43917
43917
|
"core:mediaType": "application/yaml",
|
|
43918
43918
|
"sourcemaps:sources": [
|
|
43919
43919
|
{
|
|
@@ -43934,7 +43934,7 @@
|
|
|
43934
43934
|
"doc:ExternalDomainElement",
|
|
43935
43935
|
"doc:DomainElement"
|
|
43936
43936
|
],
|
|
43937
|
-
"doc:raw": "
|
|
43937
|
+
"doc:raw": "type: \"GENERAL\"\nvalue: \"www.company.be\"\n",
|
|
43938
43938
|
"core:mediaType": "application/yaml",
|
|
43939
43939
|
"sourcemaps:sources": [
|
|
43940
43940
|
{
|
|
@@ -43955,7 +43955,7 @@
|
|
|
43955
43955
|
"doc:ExternalDomainElement",
|
|
43956
43956
|
"doc:DomainElement"
|
|
43957
43957
|
],
|
|
43958
|
-
"doc:raw": "type:
|
|
43958
|
+
"doc:raw": "type: 'GENERAL'\ncountryDialCode : '+32'\nareaCode : '22'\nsubscriberNumber: '12.87.00'\nformatted: '+32-(0)22 000000'\n",
|
|
43959
43959
|
"core:mediaType": "application/yaml",
|
|
43960
43960
|
"sourcemaps:sources": [
|
|
43961
43961
|
{
|
|
@@ -44426,22 +44426,22 @@
|
|
|
44426
44426
|
{
|
|
44427
44427
|
"@id": "#199/source-map/lexical/element_0",
|
|
44428
44428
|
"sourcemaps:element": "amf://id#199",
|
|
44429
|
-
"sourcemaps:value": "[(1,0)-(
|
|
44429
|
+
"sourcemaps:value": "[(1,0)-(5,0)]"
|
|
44430
44430
|
},
|
|
44431
44431
|
{
|
|
44432
44432
|
"@id": "#202/source-map/lexical/element_0",
|
|
44433
44433
|
"sourcemaps:element": "amf://id#202",
|
|
44434
|
-
"sourcemaps:value": "[(1,0)-(
|
|
44434
|
+
"sourcemaps:value": "[(1,0)-(3,0)]"
|
|
44435
44435
|
},
|
|
44436
44436
|
{
|
|
44437
44437
|
"@id": "#205/source-map/lexical/element_0",
|
|
44438
44438
|
"sourcemaps:element": "amf://id#205",
|
|
44439
|
-
"sourcemaps:value": "[(1,0)-(
|
|
44439
|
+
"sourcemaps:value": "[(1,0)-(3,0)]"
|
|
44440
44440
|
},
|
|
44441
44441
|
{
|
|
44442
44442
|
"@id": "#208/source-map/lexical/element_0",
|
|
44443
44443
|
"sourcemaps:element": "amf://id#208",
|
|
44444
|
-
"sourcemaps:value": "[(1,0)-(
|
|
44444
|
+
"sourcemaps:value": "[(1,0)-(6,0)]"
|
|
44445
44445
|
},
|
|
44446
44446
|
{
|
|
44447
44447
|
"@id": "#223/source-map/lexical/element_0",
|
|
@@ -44781,17 +44781,17 @@
|
|
|
44781
44781
|
{
|
|
44782
44782
|
"@id": "#215/source-map/lexical/element_0",
|
|
44783
44783
|
"sourcemaps:element": "amf://id#215",
|
|
44784
|
-
"sourcemaps:value": "[(1,0)-(
|
|
44784
|
+
"sourcemaps:value": "[(1,0)-(7,0)]"
|
|
44785
44785
|
},
|
|
44786
44786
|
{
|
|
44787
44787
|
"@id": "#218/source-map/lexical/element_0",
|
|
44788
44788
|
"sourcemaps:element": "amf://id#218",
|
|
44789
|
-
"sourcemaps:value": "[(1,0)-(
|
|
44789
|
+
"sourcemaps:value": "[(1,0)-(3,0)]"
|
|
44790
44790
|
},
|
|
44791
44791
|
{
|
|
44792
44792
|
"@id": "#221/source-map/lexical/element_0",
|
|
44793
44793
|
"sourcemaps:element": "amf://id#221",
|
|
44794
|
-
"sourcemaps:value": "[(1,0)-(
|
|
44794
|
+
"sourcemaps:value": "[(1,0)-(6,0)]"
|
|
44795
44795
|
},
|
|
44796
44796
|
{
|
|
44797
44797
|
"@id": "#338/source-map/synthesized-field/element_1",
|
package/eslint.config.js
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@api-client/core",
|
|
3
3
|
"description": "The API Client's core client library. Works in NodeJS and in a ES enabled browser.",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.14.1",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"exports": {
|
|
7
7
|
"./browser.js": {
|
|
@@ -208,7 +208,7 @@
|
|
|
208
208
|
],
|
|
209
209
|
"output": [
|
|
210
210
|
".tmp/**",
|
|
211
|
-
".tsbuildinfo"
|
|
211
|
+
".tmp/testing/tsconfig.browser.tsbuildinfo"
|
|
212
212
|
]
|
|
213
213
|
},
|
|
214
214
|
"build:ts": {
|
|
@@ -220,7 +220,7 @@
|
|
|
220
220
|
],
|
|
221
221
|
"output": [
|
|
222
222
|
"build/**",
|
|
223
|
-
".tsbuildinfo"
|
|
223
|
+
"build/tsconfig.tsbuildinfo"
|
|
224
224
|
]
|
|
225
225
|
},
|
|
226
226
|
"build:browser": {
|
|
@@ -233,7 +233,7 @@
|
|
|
233
233
|
],
|
|
234
234
|
"output": [
|
|
235
235
|
".tmp/testing/**",
|
|
236
|
-
".tsbuildinfo"
|
|
236
|
+
".tmp/testing/tsconfig.browser.tsbuildinfo"
|
|
237
237
|
]
|
|
238
238
|
},
|
|
239
239
|
"build:node": {
|
|
@@ -246,7 +246,7 @@
|
|
|
246
246
|
],
|
|
247
247
|
"output": [
|
|
248
248
|
".tmp/node/**",
|
|
249
|
-
".tsbuildinfo"
|
|
249
|
+
".tmp/node/tsconfig.node.tsbuildinfo"
|
|
250
250
|
]
|
|
251
251
|
},
|
|
252
252
|
"lint:eslint": {
|
package/src/amf/AmfTypes.ts
CHANGED
|
@@ -103,7 +103,7 @@ export const IAmfExampleTypes = [
|
|
|
103
103
|
]
|
|
104
104
|
|
|
105
105
|
/**
|
|
106
|
-
* Translates the
|
|
106
|
+
* Translates the DomainProperty type to an AMF data type.
|
|
107
107
|
* @param type The property data type
|
|
108
108
|
* @returns AMF shape dataType
|
|
109
109
|
*/
|
package/src/amf/Utils.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { UrlEncoder } from '../lib/parsers/UrlEncoder.js'
|
|
2
1
|
import { AmfNamespace } from './definitions/Namespace.js'
|
|
3
2
|
import { IApiNodeShape, IApiPropertyShape, IShapeUnion, IApiUnionShape } from './definitions/Shapes.js'
|
|
4
3
|
|
|
@@ -45,20 +44,6 @@ export function formatXmlValue(fill: string, value: unknown): string {
|
|
|
45
44
|
return formatted
|
|
46
45
|
}
|
|
47
46
|
|
|
48
|
-
/**
|
|
49
|
-
* @param str A key or value to encode as x-www-form-urlencoded.
|
|
50
|
-
* @param replacePlus When set it replaces `%20` with `+`.
|
|
51
|
-
* @deprecated Use `UrlEncoder.encodeQueryString()` instead.
|
|
52
|
-
*/
|
|
53
|
-
export function wwwFormUrlEncode(str: string, replacePlus?: boolean): string {
|
|
54
|
-
// Spec says to normalize newlines to \r\n and replace %20 spaces with +.
|
|
55
|
-
// jQuery does this as well, so this is likely to be widely compatible.
|
|
56
|
-
if (str === undefined) {
|
|
57
|
-
return ''
|
|
58
|
-
}
|
|
59
|
-
return UrlEncoder.encodeQueryString(String(str), replacePlus)
|
|
60
|
-
}
|
|
61
|
-
|
|
62
47
|
/**
|
|
63
48
|
* Processes a value that should be a number.
|
|
64
49
|
*/
|
package/src/modeling/Bindings.ts
CHANGED
|
@@ -139,7 +139,7 @@ export type PropertyBindings = PropertyWebBindings | PropertyProtobufBindings
|
|
|
139
139
|
export interface PropertyBinding extends Binding {
|
|
140
140
|
/**
|
|
141
141
|
* The definition of the bindings.
|
|
142
|
-
* The bindings tells how to translated the
|
|
142
|
+
* The bindings tells how to translated the DomainProperty to a specific format.
|
|
143
143
|
* For example, it allows to define the `dataType` and `format` for RAML / OAS (via the AMF shapes)
|
|
144
144
|
* or the field number for protocol buffer.
|
|
145
145
|
*/
|
|
@@ -800,7 +800,7 @@ export class DataDomain extends EventTarget {
|
|
|
800
800
|
*/
|
|
801
801
|
addEntity(parent: string, input?: Partial<DomainEntitySchema>): DomainEntity {
|
|
802
802
|
if (!parent) {
|
|
803
|
-
throw new Error(`An entity expects a
|
|
803
|
+
throw new Error(`An entity expects a DomainModel parent`)
|
|
804
804
|
}
|
|
805
805
|
if (!this.graph.hasNode(parent)) {
|
|
806
806
|
throw new Error(`The parent ${parent} does not exist`)
|
|
@@ -1047,7 +1047,7 @@ export class DataDomain extends EventTarget {
|
|
|
1047
1047
|
*/
|
|
1048
1048
|
addProperty(parent: string, property?: Partial<DomainPropertySchema>): DomainProperty {
|
|
1049
1049
|
if (!parent) {
|
|
1050
|
-
throw new Error(`A property expects a
|
|
1050
|
+
throw new Error(`A property expects a DomainEntity parent`)
|
|
1051
1051
|
}
|
|
1052
1052
|
if (!this.graph.hasNode(parent)) {
|
|
1053
1053
|
throw new Error(`Parent entity ${parent} does not exist`)
|
|
@@ -9,11 +9,6 @@ export type DomainPropertyType =
|
|
|
9
9
|
// | 'any'
|
|
10
10
|
| 'binary'
|
|
11
11
|
|
|
12
|
-
/**
|
|
13
|
-
* @deprecated Use the {@link DomainPropertyType} instead.
|
|
14
|
-
*/
|
|
15
|
-
export type DataPropertyType = DomainPropertyType
|
|
16
|
-
|
|
17
12
|
export const DomainPropertyTypes: DomainPropertyType[] = [
|
|
18
13
|
'string',
|
|
19
14
|
'number',
|
|
@@ -36,11 +31,6 @@ export const DomainPropertyTypes: DomainPropertyType[] = [
|
|
|
36
31
|
'binary',
|
|
37
32
|
]
|
|
38
33
|
|
|
39
|
-
/**
|
|
40
|
-
* @deprecated Use the {@link DomainPropertyTypes} instead.
|
|
41
|
-
*/
|
|
42
|
-
export const DataPropertyTypes: DataPropertyType[] = DomainPropertyTypes
|
|
43
|
-
|
|
44
34
|
export enum DomainPropertyList {
|
|
45
35
|
string = 'string',
|
|
46
36
|
number = 'number',
|
|
@@ -53,21 +43,6 @@ export enum DomainPropertyList {
|
|
|
53
43
|
file = 'binary',
|
|
54
44
|
}
|
|
55
45
|
|
|
56
|
-
/**
|
|
57
|
-
* @deprecated Use the {@link DomainPropertyList} instead.
|
|
58
|
-
*/
|
|
59
|
-
export enum DataPropertyList {
|
|
60
|
-
string = 'string',
|
|
61
|
-
number = 'number',
|
|
62
|
-
// nil = 'nil',
|
|
63
|
-
boolean = 'boolean',
|
|
64
|
-
date = 'date',
|
|
65
|
-
datetime = 'datetime',
|
|
66
|
-
time = 'time',
|
|
67
|
-
// any = 'any',
|
|
68
|
-
file = 'binary',
|
|
69
|
-
}
|
|
70
|
-
|
|
71
46
|
/**
|
|
72
47
|
* The data property "attributes".
|
|
73
48
|
*/
|
|
@@ -80,11 +55,6 @@ export type DomainPropertyAttribute =
|
|
|
80
55
|
| 'writeOnly'
|
|
81
56
|
| 'deprecated'
|
|
82
57
|
|
|
83
|
-
/**
|
|
84
|
-
* @deprecated Use the {@link DomainPropertyAttribute} instead.
|
|
85
|
-
*/
|
|
86
|
-
export type DataPropertyAttribute = DomainPropertyAttribute
|
|
87
|
-
|
|
88
58
|
export const DomainPropertyAttributes: DomainPropertyAttribute[] = [
|
|
89
59
|
'required',
|
|
90
60
|
'multiple',
|
|
@@ -95,26 +65,12 @@ export const DomainPropertyAttributes: DomainPropertyAttribute[] = [
|
|
|
95
65
|
'deprecated',
|
|
96
66
|
]
|
|
97
67
|
|
|
98
|
-
/**
|
|
99
|
-
* @deprecated Use the {@link DomainPropertyAttributes} instead.
|
|
100
|
-
*/
|
|
101
|
-
export const DataPropertyAttributes: DataPropertyAttribute[] = DomainPropertyAttributes
|
|
102
|
-
|
|
103
68
|
/**
|
|
104
69
|
* The data attribute "attributes".
|
|
105
70
|
*/
|
|
106
71
|
export type DomainAttributeAttribute = 'required' | 'multiple'
|
|
107
72
|
|
|
108
|
-
/**
|
|
109
|
-
* @deprecated Use the {@link DomainAttributeAttribute} instead.
|
|
110
|
-
*/
|
|
111
|
-
export type DataAttributeAttribute = DomainAttributeAttribute
|
|
112
|
-
|
|
113
73
|
export const DomainAttributeAttributes: DomainAttributeAttribute[] = ['required', 'multiple']
|
|
114
|
-
/**
|
|
115
|
-
* @deprecated Use the {@link DomainAttributeAttributes} instead.
|
|
116
|
-
*/
|
|
117
|
-
export const DataAttributeAttributes: DataAttributeAttribute[] = DomainAttributeAttributes
|
|
118
74
|
|
|
119
75
|
/**
|
|
120
76
|
* Note, OAS supports the `integer` data type and not format.
|
|
@@ -138,7 +94,3 @@ export type BinaryFormat = 'hex' | 'base64'
|
|
|
138
94
|
export const BinaryFormats: BinaryFormat[] = ['hex', 'base64']
|
|
139
95
|
|
|
140
96
|
export type DomainPropertyFormat = NumberFormat | BinaryFormat
|
|
141
|
-
/**
|
|
142
|
-
* @deprecated Use the {@link DomainPropertyFormat} instead.
|
|
143
|
-
*/
|
|
144
|
-
export type DataPropertyFormat = NumberFormat | BinaryFormat
|
|
@@ -10,6 +10,7 @@ import type { AssociationBinding, AssociationBindings, AssociationWebBindings }
|
|
|
10
10
|
import { DomainAttributeAttribute, DomainAttributeAttributes } from './DataFormat.js'
|
|
11
11
|
import type { AssociationTarget, DomainGraphEdge } from './types.js'
|
|
12
12
|
import { ShapeGenerator } from './amf/ShapeGenerator.js'
|
|
13
|
+
import { DataSemantics, isAssociationSemantic, type SemanticType, type AppliedDataSemantic } from './Semantics.js'
|
|
13
14
|
|
|
14
15
|
export interface DomainAssociationSchema extends DomainElementSchema {
|
|
15
16
|
kind: typeof DomainAssociationKind
|
|
@@ -47,6 +48,12 @@ export interface DomainAssociationSchema extends DomainElementSchema {
|
|
|
47
48
|
* When multiple associations are set then we are dealing with an union.
|
|
48
49
|
*/
|
|
49
50
|
targets?: AssociationTarget[]
|
|
51
|
+
/**
|
|
52
|
+
* The semantics applied to this association.
|
|
53
|
+
* This is a list of applied semantics that can be used to
|
|
54
|
+
* describe the association in more detail.
|
|
55
|
+
*/
|
|
56
|
+
semantics?: AppliedDataSemantic[]
|
|
50
57
|
}
|
|
51
58
|
|
|
52
59
|
/**
|
|
@@ -141,6 +148,11 @@ export class DomainAssociation extends DomainElement {
|
|
|
141
148
|
*/
|
|
142
149
|
@observed({ deep: true }) accessor targets: AssociationTarget[]
|
|
143
150
|
|
|
151
|
+
/**
|
|
152
|
+
* Semantics applied to this association.
|
|
153
|
+
*/
|
|
154
|
+
@observed({ deep: true }) accessor semantics: AppliedDataSemantic[] = []
|
|
155
|
+
|
|
144
156
|
/**
|
|
145
157
|
* Creates a full data association schema with defaults.
|
|
146
158
|
*
|
|
@@ -148,13 +160,16 @@ export class DomainAssociation extends DomainElement {
|
|
|
148
160
|
* @returns The data association schema.
|
|
149
161
|
*/
|
|
150
162
|
static createSchema(input: Partial<DomainAssociationSchema> = {}): DomainAssociationSchema {
|
|
151
|
-
const { key = nanoid() } = input
|
|
163
|
+
const { key = nanoid(), semantics = [] } = input
|
|
152
164
|
const info = Thing.fromJSON(input.info, { name: 'new_association' }).toJSON()
|
|
153
165
|
const result: DomainAssociationSchema = {
|
|
154
166
|
kind: DomainAssociationKind,
|
|
155
167
|
key,
|
|
156
168
|
info,
|
|
157
169
|
}
|
|
170
|
+
if (Array.isArray(semantics)) {
|
|
171
|
+
result.semantics = [...semantics]
|
|
172
|
+
}
|
|
158
173
|
if (input.schema) {
|
|
159
174
|
result.schema = structuredClone(input.schema)
|
|
160
175
|
}
|
|
@@ -207,6 +222,11 @@ export class DomainAssociation extends DomainElement {
|
|
|
207
222
|
} else {
|
|
208
223
|
this.targets = []
|
|
209
224
|
}
|
|
225
|
+
if (Array.isArray(init.semantics)) {
|
|
226
|
+
this.semantics = init.semantics.map((item) => structuredClone(item))
|
|
227
|
+
} else {
|
|
228
|
+
this.semantics = []
|
|
229
|
+
}
|
|
210
230
|
}
|
|
211
231
|
|
|
212
232
|
/**
|
|
@@ -230,10 +250,13 @@ export class DomainAssociation extends DomainElement {
|
|
|
230
250
|
result.required = this.required
|
|
231
251
|
}
|
|
232
252
|
if (Array.isArray(this.bindings) && this.bindings.length) {
|
|
233
|
-
result.bindings =
|
|
253
|
+
result.bindings = toRaw(this, this.bindings)?.map((i) => structuredClone(i))
|
|
234
254
|
}
|
|
235
255
|
if (Array.isArray(this.targets) && this.targets.length) {
|
|
236
|
-
result.targets =
|
|
256
|
+
result.targets = toRaw(this, this.targets)?.map((i) => ({ ...i }))
|
|
257
|
+
}
|
|
258
|
+
if (Array.isArray(this.semantics) && this.semantics.length) {
|
|
259
|
+
result.semantics = toRaw(this, this.semantics)?.map((i) => structuredClone(i))
|
|
237
260
|
}
|
|
238
261
|
return result
|
|
239
262
|
}
|
|
@@ -472,4 +495,44 @@ export class DomainAssociation extends DomainElement {
|
|
|
472
495
|
const serializer = new ShapeGenerator()
|
|
473
496
|
return serializer.associationProperty(this)
|
|
474
497
|
}
|
|
498
|
+
|
|
499
|
+
/**
|
|
500
|
+
* Adds or updates a semantic to the association.
|
|
501
|
+
* @param semantic The semantic to add to the association.
|
|
502
|
+
* @throws Error if the semantic is not an association semantic.
|
|
503
|
+
*/
|
|
504
|
+
addSemantic(semantic: AppliedDataSemantic): void {
|
|
505
|
+
const sem = DataSemantics[semantic.id]
|
|
506
|
+
if (!isAssociationSemantic(sem)) {
|
|
507
|
+
throw new Error(`Invalid semantic type: ${semantic.id}. Expected an association semantic.`)
|
|
508
|
+
}
|
|
509
|
+
const index = this.semantics.findIndex((s) => s.id === semantic.id)
|
|
510
|
+
if (index >= 0) {
|
|
511
|
+
this.semantics[index] = semantic
|
|
512
|
+
} else {
|
|
513
|
+
this.semantics.push(semantic)
|
|
514
|
+
}
|
|
515
|
+
this.domain.notifyChange()
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
/**
|
|
519
|
+
* Removes a semantic from the association.
|
|
520
|
+
* @param semanticId The ID of the semantic to remove.
|
|
521
|
+
*/
|
|
522
|
+
removeSemantic(semanticId: SemanticType): void {
|
|
523
|
+
const index = this.semantics.findIndex((s) => s.id === semanticId)
|
|
524
|
+
if (index >= 0) {
|
|
525
|
+
this.semantics.splice(index, 1)
|
|
526
|
+
this.domain.notifyChange()
|
|
527
|
+
}
|
|
528
|
+
}
|
|
529
|
+
|
|
530
|
+
/**
|
|
531
|
+
* Checks if the association has a specific semantic.
|
|
532
|
+
* @param semanticId The ID of the semantic to check.
|
|
533
|
+
* @returns True if the semantic is present, false otherwise.
|
|
534
|
+
*/
|
|
535
|
+
hasSemantic(semanticId: SemanticType): boolean {
|
|
536
|
+
return this.semantics.some((s) => s.id === semanticId)
|
|
537
|
+
}
|
|
475
538
|
}
|
|
@@ -17,6 +17,7 @@ import { ShapeGenerator } from './amf/ShapeGenerator.js'
|
|
|
17
17
|
import type { IShapeRenderOptions } from '../amf/shape/ShapeBase.js'
|
|
18
18
|
import { ApiSchemaGenerator } from '../amf/ApiSchemaGenerator.js'
|
|
19
19
|
import { removeGraphNode } from './GraphUtils.js'
|
|
20
|
+
import { DataSemantics, isEntitySemantic, type SemanticType, type AppliedDataSemantic } from './Semantics.js'
|
|
20
21
|
|
|
21
22
|
export interface EntityOrderedItem {
|
|
22
23
|
/**
|
|
@@ -43,11 +44,11 @@ export interface DomainEntitySchema extends DomainElementSchema {
|
|
|
43
44
|
tags?: string[]
|
|
44
45
|
|
|
45
46
|
/**
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
-
*
|
|
47
|
+
* The semantics applied to this entity.
|
|
48
|
+
* This is a list of applied semantics that can be used to
|
|
49
|
+
* describe the entity in more detail.
|
|
49
50
|
*/
|
|
50
|
-
|
|
51
|
+
semantics?: AppliedDataSemantic[]
|
|
51
52
|
|
|
52
53
|
/**
|
|
53
54
|
* The ordered list of fields (properties and associations) in the schema.
|
|
@@ -76,7 +77,7 @@ export interface DomainEntitySchema extends DomainElementSchema {
|
|
|
76
77
|
* - **Properties:** Defines the data elements (fields) within the entity.
|
|
77
78
|
* - **Associations:** Defines relationships to other entities.
|
|
78
79
|
* - **Inheritance:** Supports inheriting properties and associations from parent entities.
|
|
79
|
-
* - **Metadata:** Supports tags,
|
|
80
|
+
* - **Metadata:** Supports tags, semantics, and deprecation status.
|
|
80
81
|
* - **AMF Shape Generation:** Can be serialized to an AMF (API Modeling Framework) shape.
|
|
81
82
|
* - **Example Generation:** Can generate example databased on its schema.
|
|
82
83
|
*
|
|
@@ -139,11 +140,9 @@ export class DomainEntity extends DomainElement {
|
|
|
139
140
|
@observed({ deep: true }) accessor tags: string[]
|
|
140
141
|
|
|
141
142
|
/**
|
|
142
|
-
*
|
|
143
|
-
*
|
|
144
|
-
* The keys of the taxonomy items associated with the entity.
|
|
143
|
+
* Semantics applied to this property.
|
|
145
144
|
*/
|
|
146
|
-
@observed({ deep: true }) accessor
|
|
145
|
+
@observed({ deep: true }) accessor semantics: AppliedDataSemantic[] = []
|
|
147
146
|
|
|
148
147
|
/**
|
|
149
148
|
* The ordered list of fields (properties and associations) in the schema.
|
|
@@ -165,7 +164,7 @@ export class DomainEntity extends DomainElement {
|
|
|
165
164
|
* @returns The data entity schema.
|
|
166
165
|
*/
|
|
167
166
|
static createSchema(input: Partial<DomainEntitySchema> = {}): DomainEntitySchema {
|
|
168
|
-
const { key = nanoid(), tags,
|
|
167
|
+
const { key = nanoid(), tags, semantics, fields, deprecated } = input
|
|
169
168
|
const info = Thing.fromJSON(input.info, { name: 'New entity' }).toJSON()
|
|
170
169
|
const result: DomainEntitySchema = {
|
|
171
170
|
kind: DomainEntityKind,
|
|
@@ -175,8 +174,8 @@ export class DomainEntity extends DomainElement {
|
|
|
175
174
|
if (Array.isArray(tags)) {
|
|
176
175
|
result.tags = [...tags]
|
|
177
176
|
}
|
|
178
|
-
if (Array.isArray(
|
|
179
|
-
result.
|
|
177
|
+
if (Array.isArray(semantics)) {
|
|
178
|
+
result.semantics = [...semantics]
|
|
180
179
|
}
|
|
181
180
|
if (Array.isArray(fields)) {
|
|
182
181
|
result.fields = [...fields]
|
|
@@ -206,10 +205,10 @@ export class DomainEntity extends DomainElement {
|
|
|
206
205
|
} else {
|
|
207
206
|
this.tags = []
|
|
208
207
|
}
|
|
209
|
-
if (Array.isArray(init.
|
|
210
|
-
this.
|
|
208
|
+
if (Array.isArray(init.semantics)) {
|
|
209
|
+
this.semantics = init.semantics.map((item) => structuredClone(item))
|
|
211
210
|
} else {
|
|
212
|
-
this.
|
|
211
|
+
this.semantics = []
|
|
213
212
|
}
|
|
214
213
|
if (Array.isArray(init.fields)) {
|
|
215
214
|
this.fields = [...init.fields]
|
|
@@ -235,8 +234,8 @@ export class DomainEntity extends DomainElement {
|
|
|
235
234
|
if (Array.isArray(this.fields) && this.fields.length) {
|
|
236
235
|
result.fields = [...this.fields]
|
|
237
236
|
}
|
|
238
|
-
if (Array.isArray(this.
|
|
239
|
-
result.
|
|
237
|
+
if (Array.isArray(this.semantics) && this.semantics.length) {
|
|
238
|
+
result.semantics = toRaw(this, this.semantics)?.map((i) => structuredClone(i))
|
|
240
239
|
}
|
|
241
240
|
if (Array.isArray(this.tags) && this.tags.length) {
|
|
242
241
|
result.tags = [...(toRaw(this, this.tags) as string[])]
|
|
@@ -841,4 +840,44 @@ export class DomainEntity extends DomainElement {
|
|
|
841
840
|
}
|
|
842
841
|
return property
|
|
843
842
|
}
|
|
843
|
+
|
|
844
|
+
/**
|
|
845
|
+
* Adds or updates a semantic to the entity.
|
|
846
|
+
* @param semantic The semantic to add to the entity.
|
|
847
|
+
* @throws Error if the semantic is not an entity semantic.
|
|
848
|
+
*/
|
|
849
|
+
addSemantic(semantic: AppliedDataSemantic): void {
|
|
850
|
+
const sem = DataSemantics[semantic.id]
|
|
851
|
+
if (!isEntitySemantic(sem)) {
|
|
852
|
+
throw new Error(`Invalid semantic type: ${semantic.id}. Expected an entity semantic.`)
|
|
853
|
+
}
|
|
854
|
+
const index = this.semantics.findIndex((s) => s.id === semantic.id)
|
|
855
|
+
if (index >= 0) {
|
|
856
|
+
this.semantics[index] = semantic
|
|
857
|
+
} else {
|
|
858
|
+
this.semantics.push(semantic)
|
|
859
|
+
}
|
|
860
|
+
this.domain.notifyChange()
|
|
861
|
+
}
|
|
862
|
+
|
|
863
|
+
/**
|
|
864
|
+
* Removes a semantic from the entity.
|
|
865
|
+
* @param semanticId The ID of the semantic to remove.
|
|
866
|
+
*/
|
|
867
|
+
removeSemantic(semanticId: SemanticType): void {
|
|
868
|
+
const index = this.semantics.findIndex((s) => s.id === semanticId)
|
|
869
|
+
if (index >= 0) {
|
|
870
|
+
this.semantics.splice(index, 1)
|
|
871
|
+
this.domain.notifyChange()
|
|
872
|
+
}
|
|
873
|
+
}
|
|
874
|
+
|
|
875
|
+
/**
|
|
876
|
+
* Checks if the entity has a specific semantic.
|
|
877
|
+
* @param semanticId The ID of the semantic to check.
|
|
878
|
+
* @returns True if the semantic is present, false otherwise.
|
|
879
|
+
*/
|
|
880
|
+
hasSemantic(semanticId: SemanticType): boolean {
|
|
881
|
+
return this.semantics.some((s) => s.id === semanticId)
|
|
882
|
+
}
|
|
844
883
|
}
|
|
@@ -14,17 +14,16 @@ export interface IDomainFile extends IFile {
|
|
|
14
14
|
export class DomainFile extends File {
|
|
15
15
|
override kind = DomainFileKind
|
|
16
16
|
|
|
17
|
-
static override fromName(name: string
|
|
18
|
-
return super.fromName(name,
|
|
17
|
+
static override fromName(name: string): DomainFile {
|
|
18
|
+
return super.fromName(name, DomainFileKind) as DomainFile
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
/**
|
|
22
|
-
* Creates the file definition for a
|
|
22
|
+
* Creates the file definition for a DomainNamespace contents.
|
|
23
23
|
*
|
|
24
24
|
* @param input The data namespace instance or schema.
|
|
25
|
-
* @param owner Optional owner to set.
|
|
26
25
|
*/
|
|
27
|
-
static fromDataDomain(input: DataDomain | DataDomainSchema
|
|
26
|
+
static fromDataDomain(input: DataDomain | DataDomainSchema): DomainFile {
|
|
28
27
|
let final: DataDomainSchema
|
|
29
28
|
if (typeof (input as DataDomain).toJSON === 'function') {
|
|
30
29
|
final = (input as DataDomain).toJSON()
|
|
@@ -34,10 +33,8 @@ export class DomainFile extends File {
|
|
|
34
33
|
const init: IDomainFile = {
|
|
35
34
|
kind: DomainFileKind,
|
|
36
35
|
key: final.key,
|
|
37
|
-
organization,
|
|
38
36
|
info: { ...final.info },
|
|
39
|
-
lastModified: { user:
|
|
40
|
-
owner,
|
|
37
|
+
lastModified: { user: '', time: 0, byMe: false },
|
|
41
38
|
parents: [],
|
|
42
39
|
permissionIds: [],
|
|
43
40
|
permissions: [],
|
|
@@ -56,7 +53,6 @@ export class DomainFile extends File {
|
|
|
56
53
|
init = {
|
|
57
54
|
kind: DomainFileKind,
|
|
58
55
|
key: nanoid(),
|
|
59
|
-
organization: '',
|
|
60
56
|
info: Thing.fromName('').toJSON(),
|
|
61
57
|
parents: [],
|
|
62
58
|
permissionIds: [],
|