@api-client/core 0.18.15 → 0.18.17
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/modeling/DataDomain.d.ts +7 -2
- package/build/src/modeling/DataDomain.d.ts.map +1 -1
- package/build/src/modeling/DataDomain.js +15 -2
- package/build/src/modeling/DataDomain.js.map +1 -1
- package/build/src/modeling/DomainSerialization.d.ts +6 -3
- package/build/src/modeling/DomainSerialization.d.ts.map +1 -1
- package/build/src/modeling/DomainSerialization.js +374 -52
- package/build/src/modeling/DomainSerialization.js.map +1 -1
- package/build/src/modeling/importers/SchemaFilteringStrategy.d.ts.map +1 -1
- package/build/src/modeling/importers/SchemaFilteringStrategy.js +3 -9
- package/build/src/modeling/importers/SchemaFilteringStrategy.js.map +1 -1
- package/build/src/modeling/types.d.ts +69 -2
- package/build/src/modeling/types.d.ts.map +1 -1
- package/build/src/modeling/types.js.map +1 -1
- package/build/tsconfig.tsbuildinfo +1 -1
- package/data/models/example-generator-api.json +15 -15
- package/package.json +1 -1
- package/src/modeling/DataDomain.ts +24 -3
- package/src/modeling/DomainSerialization.ts +442 -56
- package/src/modeling/importers/SchemaFilteringStrategy.ts +3 -11
- package/src/modeling/types.ts +73 -2
- package/tests/unit/modeling/data_domain_serialization.spec.ts +504 -0
- package/tests/unit/modeling/importers/schema_filtering.spec.ts +47 -3
|
@@ -42068,10 +42068,10 @@
|
|
|
42068
42068
|
"@id": "#194"
|
|
42069
42069
|
},
|
|
42070
42070
|
{
|
|
42071
|
-
"@id": "#
|
|
42071
|
+
"@id": "#200"
|
|
42072
42072
|
},
|
|
42073
42073
|
{
|
|
42074
|
-
"@id": "#
|
|
42074
|
+
"@id": "#197"
|
|
42075
42075
|
},
|
|
42076
42076
|
{
|
|
42077
42077
|
"@id": "#203"
|
|
@@ -42813,13 +42813,13 @@
|
|
|
42813
42813
|
"@id": "#210"
|
|
42814
42814
|
},
|
|
42815
42815
|
{
|
|
42816
|
-
"@id": "#219"
|
|
42817
|
-
},
|
|
42818
|
-
{
|
|
42819
42816
|
"@id": "#213"
|
|
42820
42817
|
},
|
|
42821
42818
|
{
|
|
42822
42819
|
"@id": "#216"
|
|
42820
|
+
},
|
|
42821
|
+
{
|
|
42822
|
+
"@id": "#219"
|
|
42823
42823
|
}
|
|
42824
42824
|
],
|
|
42825
42825
|
"doc:root": false,
|
|
@@ -43478,7 +43478,7 @@
|
|
|
43478
43478
|
"doc:ExternalDomainElement",
|
|
43479
43479
|
"doc:DomainElement"
|
|
43480
43480
|
],
|
|
43481
|
-
"doc:raw": "
|
|
43481
|
+
"doc:raw": "class: '3'\ndescription: '150 - 300'\nnumberOfFte: 5500\nnumberOfEmployees: 5232\n",
|
|
43482
43482
|
"core:mediaType": "application/yaml",
|
|
43483
43483
|
"sourcemaps:sources": [
|
|
43484
43484
|
{
|
|
@@ -43499,7 +43499,7 @@
|
|
|
43499
43499
|
"doc:ExternalDomainElement",
|
|
43500
43500
|
"doc:DomainElement"
|
|
43501
43501
|
],
|
|
43502
|
-
"doc:raw": "
|
|
43502
|
+
"doc:raw": "code: '5'\ndescription: 'Limited company'\n",
|
|
43503
43503
|
"core:mediaType": "application/yaml",
|
|
43504
43504
|
"sourcemaps:sources": [
|
|
43505
43505
|
{
|
|
@@ -44253,7 +44253,7 @@
|
|
|
44253
44253
|
"doc:ExternalDomainElement",
|
|
44254
44254
|
"doc:DomainElement"
|
|
44255
44255
|
],
|
|
44256
|
-
"doc:raw": "
|
|
44256
|
+
"doc:raw": "type: 'GENERAL'\ncountryDialCode : '+32'\nareaCode : '21'\nsubscriberNumber: '12.87.00'\nformatted: '+32-(0)21 302099'\n",
|
|
44257
44257
|
"core:mediaType": "application/yaml",
|
|
44258
44258
|
"sourcemaps:sources": [
|
|
44259
44259
|
{
|
|
@@ -44274,7 +44274,7 @@
|
|
|
44274
44274
|
"doc:ExternalDomainElement",
|
|
44275
44275
|
"doc:DomainElement"
|
|
44276
44276
|
],
|
|
44277
|
-
"doc:raw": "type:
|
|
44277
|
+
"doc:raw": "-\n type: 'GENERAL'\n value: 'info@company.be'\n-\n type: 'IT_DEPT'\n value: 'it-service@company.be'\n",
|
|
44278
44278
|
"core:mediaType": "application/yaml",
|
|
44279
44279
|
"sourcemaps:sources": [
|
|
44280
44280
|
{
|
|
@@ -44295,7 +44295,7 @@
|
|
|
44295
44295
|
"doc:ExternalDomainElement",
|
|
44296
44296
|
"doc:DomainElement"
|
|
44297
44297
|
],
|
|
44298
|
-
"doc:raw": "type:
|
|
44298
|
+
"doc:raw": "type: \"GENERAL\"\nvalue: \"www.company.be\"\n",
|
|
44299
44299
|
"core:mediaType": "application/yaml",
|
|
44300
44300
|
"sourcemaps:sources": [
|
|
44301
44301
|
{
|
|
@@ -44766,12 +44766,12 @@
|
|
|
44766
44766
|
{
|
|
44767
44767
|
"@id": "#199/source-map/lexical/element_0",
|
|
44768
44768
|
"sourcemaps:element": "amf://id#199",
|
|
44769
|
-
"sourcemaps:value": "[(1,0)-(
|
|
44769
|
+
"sourcemaps:value": "[(1,0)-(5,0)]"
|
|
44770
44770
|
},
|
|
44771
44771
|
{
|
|
44772
44772
|
"@id": "#202/source-map/lexical/element_0",
|
|
44773
44773
|
"sourcemaps:element": "amf://id#202",
|
|
44774
|
-
"sourcemaps:value": "[(1,0)-(
|
|
44774
|
+
"sourcemaps:value": "[(1,0)-(3,0)]"
|
|
44775
44775
|
},
|
|
44776
44776
|
{
|
|
44777
44777
|
"@id": "#205/source-map/lexical/element_0",
|
|
@@ -45121,17 +45121,17 @@
|
|
|
45121
45121
|
{
|
|
45122
45122
|
"@id": "#215/source-map/lexical/element_0",
|
|
45123
45123
|
"sourcemaps:element": "amf://id#215",
|
|
45124
|
-
"sourcemaps:value": "[(1,0)-(
|
|
45124
|
+
"sourcemaps:value": "[(1,0)-(6,0)]"
|
|
45125
45125
|
},
|
|
45126
45126
|
{
|
|
45127
45127
|
"@id": "#218/source-map/lexical/element_0",
|
|
45128
45128
|
"sourcemaps:element": "amf://id#218",
|
|
45129
|
-
"sourcemaps:value": "[(1,0)-(
|
|
45129
|
+
"sourcemaps:value": "[(1,0)-(7,0)]"
|
|
45130
45130
|
},
|
|
45131
45131
|
{
|
|
45132
45132
|
"@id": "#221/source-map/lexical/element_0",
|
|
45133
45133
|
"sourcemaps:element": "amf://id#221",
|
|
45134
|
-
"sourcemaps:value": "[(1,0)-(
|
|
45134
|
+
"sourcemaps:value": "[(1,0)-(3,0)]"
|
|
45135
45135
|
},
|
|
45136
45136
|
{
|
|
45137
45137
|
"@id": "#338/source-map/synthesized-field/element_1",
|
package/package.json
CHANGED
|
@@ -8,7 +8,14 @@ import {
|
|
|
8
8
|
DomainNamespaceKind,
|
|
9
9
|
DomainPropertyKind,
|
|
10
10
|
} from '../models/kinds.js'
|
|
11
|
-
import type {
|
|
11
|
+
import type {
|
|
12
|
+
AssociationAddOptions,
|
|
13
|
+
DeserializationIssue,
|
|
14
|
+
DeserializationMode,
|
|
15
|
+
DomainGraphEdge,
|
|
16
|
+
DomainGraphNodeType,
|
|
17
|
+
SerializedGraph,
|
|
18
|
+
} from './types.js'
|
|
12
19
|
import { type DomainNamespaceSchema, DomainNamespace, type NamespaceOrderedItem } from './DomainNamespace.js'
|
|
13
20
|
import { type DomainModelSchema, DomainModel } from './DomainModel.js'
|
|
14
21
|
import { type DomainEntitySchema, DomainEntity } from './DomainEntity.js'
|
|
@@ -146,6 +153,12 @@ export class DataDomain extends DependentModel {
|
|
|
146
153
|
*/
|
|
147
154
|
accessor fields: NamespaceOrderedItem[]
|
|
148
155
|
|
|
156
|
+
/**
|
|
157
|
+
* The list of issues encountered during deserialization.
|
|
158
|
+
* This is only populated when deserialization fails in lenient mode.
|
|
159
|
+
*/
|
|
160
|
+
issues: DeserializationIssue[] = []
|
|
161
|
+
|
|
149
162
|
static createSchema(input: Partial<DataDomainSchema> = {}): DataDomainSchema {
|
|
150
163
|
const { key = nanoid(), fields } = input
|
|
151
164
|
const info = Thing.fromJSON(input.info, { name: 'Unnamed domain' }).toJSON()
|
|
@@ -178,7 +191,7 @@ export class DataDomain extends DependentModel {
|
|
|
178
191
|
* @param state The previously serialized state of the graph.
|
|
179
192
|
* @param dependencies An array of foreign data domains to register with this domain.
|
|
180
193
|
*/
|
|
181
|
-
constructor(state?: Partial<DataDomainSchema>, dependencies: DomainDependency[] = []) {
|
|
194
|
+
constructor(state?: Partial<DataDomainSchema>, dependencies: DomainDependency[] = [], mode?: DeserializationMode) {
|
|
182
195
|
const init = DataDomain.createSchema(state)
|
|
183
196
|
const instances: DataDomain[] = []
|
|
184
197
|
for (const dep of dependencies) {
|
|
@@ -195,7 +208,15 @@ export class DataDomain extends DependentModel {
|
|
|
195
208
|
this.kind = init.kind
|
|
196
209
|
this.key = init.key
|
|
197
210
|
this.info = new Thing(init.info)
|
|
198
|
-
|
|
211
|
+
const result = deserialize(this, {
|
|
212
|
+
json: init.graph,
|
|
213
|
+
dependencies: instances,
|
|
214
|
+
mode: mode || 'strict',
|
|
215
|
+
})
|
|
216
|
+
this.graph = result.graph
|
|
217
|
+
if (result.issues.length > 0 && mode === 'lenient') {
|
|
218
|
+
this.issues = result.issues
|
|
219
|
+
}
|
|
199
220
|
if (Array.isArray(init.fields)) {
|
|
200
221
|
this.fields = [...init.fields]
|
|
201
222
|
} else {
|