@api-client/core 0.6.4 → 0.6.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (87) hide show
  1. package/build/browser.d.ts +8 -0
  2. package/build/browser.js +8 -0
  3. package/build/browser.js.map +1 -1
  4. package/build/index.d.ts +8 -0
  5. package/build/index.js +8 -0
  6. package/build/index.js.map +1 -1
  7. package/build/src/Platform.d.ts +12 -0
  8. package/build/src/Platform.js +13 -0
  9. package/build/src/Platform.js.map +1 -0
  10. package/build/src/authorization/OAuth2Authorization.d.ts +1 -1
  11. package/build/src/authorization/OidcAuthorization.d.ts +1 -0
  12. package/build/src/authorization/OidcAuthorization.js +3 -0
  13. package/build/src/authorization/OidcAuthorization.js.map +1 -1
  14. package/build/src/authorization/Utils.js +1 -1
  15. package/build/src/authorization/Utils.js.map +1 -1
  16. package/build/src/authorization/lib/SecurityProcessor.d.ts +33 -0
  17. package/build/src/authorization/lib/SecurityProcessor.js +118 -0
  18. package/build/src/authorization/lib/SecurityProcessor.js.map +1 -0
  19. package/build/src/authorization/lib/Utils.d.ts +41 -0
  20. package/build/src/authorization/lib/Utils.js +85 -0
  21. package/build/src/authorization/lib/Utils.js.map +1 -0
  22. package/build/src/lib/transformers/PayloadSerializer.d.ts +0 -3
  23. package/build/src/lib/transformers/PayloadSerializer.js +1 -3
  24. package/build/src/lib/transformers/PayloadSerializer.js.map +1 -1
  25. package/build/src/models/SerializablePayload.js +2 -1
  26. package/build/src/models/SerializablePayload.js.map +1 -1
  27. package/build/src/models/data/DataAssociation.d.ts +76 -0
  28. package/build/src/models/data/DataAssociation.js +151 -0
  29. package/build/src/models/data/DataAssociation.js.map +1 -0
  30. package/build/src/models/data/DataAssociationSchema.d.ts +32 -0
  31. package/build/src/models/data/DataAssociationSchema.js +2 -0
  32. package/build/src/models/data/DataAssociationSchema.js.map +1 -0
  33. package/build/src/models/data/DataEntity.d.ts +195 -0
  34. package/build/src/models/data/DataEntity.js +415 -0
  35. package/build/src/models/data/DataEntity.js.map +1 -0
  36. package/build/src/models/data/DataModel.d.ts +74 -0
  37. package/build/src/models/data/DataModel.js +173 -0
  38. package/build/src/models/data/DataModel.js.map +1 -0
  39. package/build/src/models/data/DataNamespace.d.ts +174 -0
  40. package/build/src/models/data/DataNamespace.js +424 -0
  41. package/build/src/models/data/DataNamespace.js.map +1 -0
  42. package/build/src/models/data/DataProperty.d.ts +159 -0
  43. package/build/src/models/data/DataProperty.js +216 -0
  44. package/build/src/models/data/DataProperty.js.map +1 -0
  45. package/build/src/models/data/DataPropertySchema.d.ts +125 -0
  46. package/build/src/models/data/DataPropertySchema.js +33 -0
  47. package/build/src/models/data/DataPropertySchema.js.map +1 -0
  48. package/build/src/models/legacy/Normalizer.js +1 -1
  49. package/build/src/models/legacy/Normalizer.js.map +1 -1
  50. package/build/src/models/store/File.d.ts +17 -0
  51. package/build/src/models/store/File.js +53 -1
  52. package/build/src/models/store/File.js.map +1 -1
  53. package/build/src/runtime/store/FilesSdk.d.ts +41 -6
  54. package/build/src/runtime/store/FilesSdk.js +77 -6
  55. package/build/src/runtime/store/FilesSdk.js.map +1 -1
  56. package/build/src/runtime/store/Http.d.ts +1 -0
  57. package/build/src/runtime/store/Http.js.map +1 -1
  58. package/build/src/runtime/store/HttpNode.d.ts +1 -0
  59. package/build/src/runtime/store/HttpNode.js +6 -4
  60. package/build/src/runtime/store/HttpNode.js.map +1 -1
  61. package/build/src/runtime/store/HttpWeb.d.ts +1 -0
  62. package/build/src/runtime/store/HttpWeb.js +4 -0
  63. package/build/src/runtime/store/HttpWeb.js.map +1 -1
  64. package/build/src/runtime/store/SdkBase.d.ts +1 -1
  65. package/package.json +1 -1
  66. package/src/Platform.ts +12 -0
  67. package/src/authorization/OAuth2Authorization.ts +1 -1
  68. package/src/authorization/OidcAuthorization.ts +4 -0
  69. package/src/authorization/Utils.ts +1 -1
  70. package/src/authorization/lib/SecurityProcessor.ts +141 -0
  71. package/src/authorization/lib/Utils.ts +89 -0
  72. package/src/lib/transformers/PayloadSerializer.ts +2 -4
  73. package/src/models/SerializablePayload.ts +2 -1
  74. package/src/models/data/DataAssociation.ts +189 -0
  75. package/src/models/data/DataAssociationSchema.ts +32 -0
  76. package/src/models/data/DataEntity.ts +496 -0
  77. package/src/models/data/DataModel.ts +206 -0
  78. package/src/models/data/DataNamespace.ts +503 -0
  79. package/src/models/data/DataProperty.ts +306 -0
  80. package/src/models/data/DataPropertySchema.ts +156 -0
  81. package/src/models/legacy/Normalizer.ts +1 -1
  82. package/src/models/store/File.ts +55 -1
  83. package/src/runtime/store/FilesSdk.ts +95 -9
  84. package/src/runtime/store/Http.ts +2 -0
  85. package/src/runtime/store/HttpNode.ts +7 -4
  86. package/src/runtime/store/HttpWeb.ts +5 -0
  87. package/src/runtime/store/SdkBase.ts +1 -1
@@ -0,0 +1,174 @@
1
+ import { IThing, Thing } from "../Thing.js";
2
+ import { IDataAssociation, DataAssociation } from "./DataAssociation.js";
3
+ import { IDataEntity, DataEntity } from "./DataEntity.js";
4
+ import { IDataModel, DataModel, Kind as DataModelKind } from "./DataModel.js";
5
+ import { IDataProperty, DataProperty } from "./DataProperty.js";
6
+ export declare const Kind = "Core#DataNamespace";
7
+ declare type ItemKind = typeof Kind | typeof DataModelKind;
8
+ interface IDataDefinitions {
9
+ models?: IDataModel[];
10
+ entities?: IDataEntity[];
11
+ properties?: IDataProperty[];
12
+ associations?: IDataAssociation[];
13
+ namespaces?: IDataNamespace[];
14
+ }
15
+ interface DataDefinitions {
16
+ models: DataModel[];
17
+ entities: DataEntity[];
18
+ properties: DataProperty[];
19
+ associations: DataAssociation[];
20
+ namespaces: DataNamespace[];
21
+ }
22
+ interface IDataNamespaceParent {
23
+ kind: typeof Kind;
24
+ /**
25
+ * The key of the namespace.
26
+ */
27
+ key: string;
28
+ /**
29
+ * The ordered list of items in this namespace.
30
+ */
31
+ items: IDataItem[];
32
+ /**
33
+ * The data namespace description.
34
+ */
35
+ info: IThing;
36
+ }
37
+ /**
38
+ * Data namespace is a logical description of the hierarchy in the data.
39
+ */
40
+ export interface IDataNamespace extends IDataNamespaceParent {
41
+ /**
42
+ * The list of definitions used in the namespace.
43
+ */
44
+ definitions: IDataDefinitions;
45
+ }
46
+ /**
47
+ * Data item is a reference to an object in the top namespace definitions
48
+ * to the namespace items.
49
+ */
50
+ export interface IDataItem {
51
+ /**
52
+ * The kind of the item.
53
+ */
54
+ kind: ItemKind;
55
+ /**
56
+ * The identifier in the `definitions` array of the namespace.
57
+ */
58
+ key: string;
59
+ }
60
+ declare class DataNamespaceParent {
61
+ kind: string;
62
+ key: string;
63
+ /**
64
+ * The ordered list of items in this namespace.
65
+ */
66
+ items: DataItem[];
67
+ /**
68
+ * The description of the data namespace.
69
+ */
70
+ info: Thing;
71
+ /**
72
+ * When a namespace is a sub-namespace this is the reference to the
73
+ * root namespace with all definitions.
74
+ */
75
+ root?: DataNamespace;
76
+ constructor(root?: DataNamespace);
77
+ /**
78
+ * @returns The parent namespace of this namespace. It returns `undefined` when this is the root namespace.
79
+ */
80
+ getParent(): DataNamespace | undefined;
81
+ /**
82
+ * Adds a data namespace to the structure.
83
+ * @param init The name of the namespace to add, namespace's schema, or instance.
84
+ * @param parent The optional key of the parent namespace to add the new namespace to.
85
+ */
86
+ addNamespace(init: string | IDataNamespace | DataNamespace): DataNamespace;
87
+ /**
88
+ * Lists namespaces that are in this namespace items.
89
+ */
90
+ listNamespaces(): DataNamespace[];
91
+ /**
92
+ * Lists namespaces that are in this namespace items.
93
+ */
94
+ listDataModels(): DataModel[];
95
+ /**
96
+ * @returns The root of the namespaces tree. It might be the same object.
97
+ */
98
+ getRoot(): DataNamespace;
99
+ /**
100
+ * Removes self from the parent namespace with all data models.
101
+ * This does noting for the root namespace.
102
+ */
103
+ remove(): void;
104
+ }
105
+ export declare class DataItem implements IDataItem {
106
+ kind: ItemKind;
107
+ key: string;
108
+ /**
109
+ * A reference to the top level namespace.
110
+ */
111
+ private root;
112
+ static isDataItem(input: unknown): boolean;
113
+ static dataNamespace(root: DataNamespace, key: string): DataItem;
114
+ static dataModel(root: DataNamespace, key: string): DataItem;
115
+ /**
116
+ * @param root The top-most data namespace.
117
+ * @param input The project item definition used to restore the state.
118
+ */
119
+ constructor(root: DataNamespace, input: string | IDataItem);
120
+ new(init: IDataItem): void;
121
+ toJSON(): IDataItem;
122
+ getItem(): DataNamespace | DataModel | undefined;
123
+ }
124
+ /**
125
+ * Data namespace is a logical description of the hierarchy in the data.
126
+ */
127
+ export declare class DataNamespace extends DataNamespaceParent {
128
+ definitions: DataDefinitions;
129
+ /**
130
+ * Creates a new data namespace from a name.
131
+ * @param name The name to set.
132
+ */
133
+ static fromName(name: string, root?: DataNamespace): DataNamespace;
134
+ static definitions(): DataDefinitions;
135
+ constructor(input?: string | IDataNamespace, root?: DataNamespace);
136
+ new(init: IDataNamespace): void;
137
+ toJSON(): IDataNamespace;
138
+ findParent(key: string): DataNamespace | undefined;
139
+ /**
140
+ * Adds a data namespace to the structure.
141
+ * @param init The name of the namespace to add, namespace's schema, or instance.
142
+ * @param parent The optional key of the parent namespace to add the new namespace to.
143
+ */
144
+ addNamespace(init: string | IDataNamespace | DataNamespace, parent?: string): DataNamespace;
145
+ /**
146
+ * Finds a namespace in the definitions.
147
+ * @param key The key of the namespace to find.
148
+ * @returns The namespace definition or undefined when not found.
149
+ */
150
+ findNamespace(key: string): DataNamespace | undefined;
151
+ /**
152
+ * Finds a namespace and calls the `remove()` on it.
153
+ * @param key The key of the namespace to find.
154
+ */
155
+ removeNamespace(key: string): void;
156
+ /**
157
+ * Adds a data model to a namespace.
158
+ * @param init The name of the data model to add, data model's schema, or its instance.
159
+ * @param parent The optional key of the parent namespace to add the new data model to.
160
+ */
161
+ addDataModel(init: string | IDataModel | DataModel, parent?: string): DataModel;
162
+ /**
163
+ * Finds a data model in the definitions.
164
+ * @param key The key of the data model to find.
165
+ * @returns The data model definition or undefined when not found.
166
+ */
167
+ findDataModel(key: string): DataModel | undefined;
168
+ /**
169
+ * Finds a data model and calls the `remove()` on it.
170
+ * @param key The key of the data model to find.
171
+ */
172
+ removeDataModel(key: string): void;
173
+ }
174
+ export {};
@@ -0,0 +1,424 @@
1
+ import { Thing } from "../Thing.js";
2
+ import { DataAssociation } from "./DataAssociation.js";
3
+ import { DataEntity } from "./DataEntity.js";
4
+ import { DataModel, Kind as DataModelKind } from "./DataModel.js";
5
+ import v4 from '../../lib/uuid.js';
6
+ export const Kind = 'Core#DataNamespace';
7
+ class DataNamespaceParent {
8
+ kind = Kind;
9
+ key = '';
10
+ /**
11
+ * The ordered list of items in this namespace.
12
+ */
13
+ items = [];
14
+ /**
15
+ * The description of the data namespace.
16
+ */
17
+ info = Thing.fromName('');
18
+ /**
19
+ * When a namespace is a sub-namespace this is the reference to the
20
+ * root namespace with all definitions.
21
+ */
22
+ root;
23
+ constructor(root) {
24
+ this.root = root;
25
+ }
26
+ /**
27
+ * @returns The parent namespace of this namespace. It returns `undefined` when this is the root namespace.
28
+ */
29
+ getParent() {
30
+ const { root, key } = this;
31
+ if (root) {
32
+ const result = root.findParent(key);
33
+ if (result === this.root) {
34
+ return undefined;
35
+ }
36
+ return result;
37
+ }
38
+ // we are the root namespace.
39
+ return undefined;
40
+ }
41
+ /**
42
+ * Adds a data namespace to the structure.
43
+ * @param init The name of the namespace to add, namespace's schema, or instance.
44
+ * @param parent The optional key of the parent namespace to add the new namespace to.
45
+ */
46
+ addNamespace(init) {
47
+ return this.root.addNamespace(init, this.key);
48
+ }
49
+ /**
50
+ * Lists namespaces that are in this namespace items.
51
+ */
52
+ listNamespaces() {
53
+ const result = [];
54
+ const { items } = this;
55
+ const root = this.getRoot();
56
+ const { namespaces } = root.definitions;
57
+ items.forEach(i => {
58
+ if (i.kind !== Kind) {
59
+ return;
60
+ }
61
+ const def = namespaces.find(j => j.key === i.key);
62
+ if (def) {
63
+ result.push(def);
64
+ }
65
+ });
66
+ return result;
67
+ }
68
+ /**
69
+ * Lists namespaces that are in this namespace items.
70
+ */
71
+ listDataModels() {
72
+ const result = [];
73
+ const { items } = this;
74
+ const root = this.getRoot();
75
+ const { models } = root.definitions;
76
+ items.forEach(i => {
77
+ if (i.kind !== DataModelKind) {
78
+ return;
79
+ }
80
+ const def = models.find(j => j.key === i.key);
81
+ if (def) {
82
+ result.push(def);
83
+ }
84
+ });
85
+ return result;
86
+ }
87
+ /**
88
+ * @returns The root of the namespaces tree. It might be the same object.
89
+ */
90
+ getRoot() {
91
+ if (this.root) {
92
+ return this.root;
93
+ }
94
+ return this;
95
+ }
96
+ /**
97
+ * Removes self from the parent namespace with all data models.
98
+ * This does noting for the root namespace.
99
+ */
100
+ remove() {
101
+ const { root } = this;
102
+ if (!root) {
103
+ return;
104
+ }
105
+ const models = this.listDataModels();
106
+ const children = this.listNamespaces();
107
+ models.forEach(m => m.remove());
108
+ children.forEach(c => c.remove());
109
+ const index = root.definitions.namespaces.findIndex(i => i.key === this.key);
110
+ if (index >= 0) {
111
+ root.definitions.namespaces.splice(index, 1);
112
+ }
113
+ }
114
+ }
115
+ export class DataItem {
116
+ kind = DataModelKind;
117
+ key = '';
118
+ /**
119
+ * A reference to the top level namespace.
120
+ */
121
+ root;
122
+ static isDataItem(input) {
123
+ const typed = input;
124
+ if (!input || ![DataModelKind, Kind].includes(typed.kind)) {
125
+ return false;
126
+ }
127
+ return true;
128
+ }
129
+ static dataNamespace(root, key) {
130
+ const item = new DataItem(root, {
131
+ kind: Kind,
132
+ key,
133
+ });
134
+ return item;
135
+ }
136
+ static dataModel(root, key) {
137
+ const item = new DataItem(root, {
138
+ kind: DataModelKind,
139
+ key,
140
+ });
141
+ return item;
142
+ }
143
+ /**
144
+ * @param root The top-most data namespace.
145
+ * @param input The project item definition used to restore the state.
146
+ */
147
+ constructor(root, input) {
148
+ this.root = root;
149
+ let init;
150
+ if (typeof input === 'string') {
151
+ init = JSON.parse(input);
152
+ }
153
+ else if (typeof input === 'object') {
154
+ init = input;
155
+ }
156
+ else {
157
+ throw new Error('Specify the type of the item.');
158
+ }
159
+ this.new(init);
160
+ }
161
+ new(init) {
162
+ if (!DataItem.isDataItem(init)) {
163
+ throw new Error(`Not a data item.`);
164
+ }
165
+ const { kind, key } = init;
166
+ this.kind = kind;
167
+ this.key = key;
168
+ }
169
+ toJSON() {
170
+ const result = {
171
+ kind: this.kind,
172
+ key: this.key,
173
+ };
174
+ return result;
175
+ }
176
+ getItem() {
177
+ const { root, key, kind } = this;
178
+ const { definitions } = root;
179
+ if (kind === DataModelKind) {
180
+ return definitions.models.find(i => i.key === key);
181
+ }
182
+ if (kind === kind) {
183
+ return definitions.namespaces.find(i => i.key === key);
184
+ }
185
+ }
186
+ }
187
+ /**
188
+ * Data namespace is a logical description of the hierarchy in the data.
189
+ */
190
+ export class DataNamespace extends DataNamespaceParent {
191
+ definitions;
192
+ /**
193
+ * Creates a new data namespace from a name.
194
+ * @param name The name to set.
195
+ */
196
+ static fromName(name, root) {
197
+ const ns = new DataNamespace(undefined, root);
198
+ const info = Thing.fromName(name);
199
+ ns.info = info;
200
+ return ns;
201
+ }
202
+ static definitions() {
203
+ return {
204
+ models: [],
205
+ associations: [],
206
+ entities: [],
207
+ properties: [],
208
+ namespaces: [],
209
+ };
210
+ }
211
+ constructor(input, root) {
212
+ super(root);
213
+ this.definitions = DataNamespace.definitions();
214
+ let init;
215
+ if (typeof input === 'string') {
216
+ init = JSON.parse(input);
217
+ }
218
+ else if (typeof input === 'object') {
219
+ init = input;
220
+ if (!init.kind) {
221
+ init.kind = Kind;
222
+ }
223
+ }
224
+ else {
225
+ init = {
226
+ kind: Kind,
227
+ key: v4(),
228
+ definitions: {},
229
+ items: [],
230
+ info: Thing.fromName('').toJSON(),
231
+ };
232
+ }
233
+ this.new(init);
234
+ }
235
+ new(init) {
236
+ if (!init || !init.definitions || !init.items) {
237
+ throw new Error(`Not a namespace.`);
238
+ }
239
+ const { key = v4(), definitions = {}, items, info } = init;
240
+ this.key = key;
241
+ if (info) {
242
+ this.info = new Thing(info);
243
+ }
244
+ else {
245
+ this.info = Thing.fromName('');
246
+ }
247
+ if (Array.isArray(items)) {
248
+ this.items = items.map(i => new DataItem(this, i));
249
+ }
250
+ else {
251
+ this.items = [];
252
+ }
253
+ if (Array.isArray(definitions.associations)) {
254
+ this.definitions.associations = definitions.associations.map(i => new DataAssociation(this, i));
255
+ }
256
+ else {
257
+ this.definitions.associations = [];
258
+ }
259
+ if (Array.isArray(definitions.entities)) {
260
+ this.definitions.entities = definitions.entities.map(i => new DataEntity(this, i));
261
+ }
262
+ else {
263
+ this.definitions.entities = [];
264
+ }
265
+ if (Array.isArray(definitions.models)) {
266
+ this.definitions.models = definitions.models.map(i => new DataModel(this, i));
267
+ }
268
+ else {
269
+ this.definitions.models = [];
270
+ }
271
+ if (Array.isArray(definitions.namespaces)) {
272
+ this.definitions.namespaces = definitions.namespaces.map(i => new DataNamespace(i, this));
273
+ }
274
+ else {
275
+ this.definitions.namespaces = [];
276
+ }
277
+ }
278
+ toJSON() {
279
+ const result = {
280
+ key: this.key,
281
+ kind: Kind,
282
+ info: this.info.toJSON(),
283
+ items: this.items.map(i => i.toJSON()),
284
+ definitions: {},
285
+ };
286
+ const { associations, entities, models, namespaces } = this.definitions;
287
+ if (Array.isArray(associations) && associations.length) {
288
+ result.definitions.associations = associations.map(i => i.toJSON());
289
+ }
290
+ if (Array.isArray(entities) && entities.length) {
291
+ result.definitions.entities = entities.map(i => i.toJSON());
292
+ }
293
+ if (Array.isArray(models) && models.length) {
294
+ result.definitions.models = models.map(i => i.toJSON());
295
+ }
296
+ if (Array.isArray(namespaces) && namespaces.length) {
297
+ result.definitions.namespaces = namespaces.map(i => i.toJSON());
298
+ }
299
+ return result;
300
+ }
301
+ findParent(key) {
302
+ const { definitions, items = [] } = this;
303
+ const rootIndex = items.findIndex(i => i.key === key);
304
+ if (rootIndex >= 0) {
305
+ return this;
306
+ }
307
+ const definition = definitions.namespaces.find(i => i.items.some(item => item.key === key));
308
+ if (definition) {
309
+ return definition;
310
+ }
311
+ return undefined;
312
+ }
313
+ /**
314
+ * Adds a data namespace to the structure.
315
+ * @param init The name of the namespace to add, namespace's schema, or instance.
316
+ * @param parent The optional key of the parent namespace to add the new namespace to.
317
+ */
318
+ addNamespace(init, parent) {
319
+ let root;
320
+ if (parent) {
321
+ const rootCandidate = this.findParent(parent);
322
+ if (!rootCandidate) {
323
+ throw new Error(`Unable to find the parent namespace ${parent}`);
324
+ }
325
+ root = rootCandidate;
326
+ }
327
+ else {
328
+ root = this;
329
+ }
330
+ let definition;
331
+ if (typeof init === 'string') {
332
+ definition = DataNamespace.fromName(init, this.root || this);
333
+ }
334
+ else if (init instanceof DataNamespace) {
335
+ definition = init;
336
+ }
337
+ else {
338
+ definition = new DataNamespace(init, this.root || this);
339
+ }
340
+ (this.root || this).definitions.namespaces.push(definition);
341
+ const item = DataItem.dataNamespace(this.root || this, definition.key);
342
+ if (!Array.isArray(root.items)) {
343
+ root.items = [];
344
+ }
345
+ root.items.push(item);
346
+ return definition;
347
+ }
348
+ /**
349
+ * Finds a namespace in the definitions.
350
+ * @param key The key of the namespace to find.
351
+ * @returns The namespace definition or undefined when not found.
352
+ */
353
+ findNamespace(key) {
354
+ const { definitions } = this.root || this;
355
+ return definitions.namespaces.find(i => i.key === key);
356
+ }
357
+ /**
358
+ * Finds a namespace and calls the `remove()` on it.
359
+ * @param key The key of the namespace to find.
360
+ */
361
+ removeNamespace(key) {
362
+ const { definitions } = this.root || this;
363
+ const space = definitions.namespaces.find(i => i.key === key);
364
+ if (space) {
365
+ space.remove();
366
+ }
367
+ }
368
+ /**
369
+ * Adds a data model to a namespace.
370
+ * @param init The name of the data model to add, data model's schema, or its instance.
371
+ * @param parent The optional key of the parent namespace to add the new data model to.
372
+ */
373
+ addDataModel(init, parent) {
374
+ let root;
375
+ if (parent) {
376
+ const rootCandidate = this.findParent(parent);
377
+ if (!rootCandidate) {
378
+ throw new Error(`Unable to find the parent namespace ${parent}`);
379
+ }
380
+ root = rootCandidate;
381
+ }
382
+ else {
383
+ root = this;
384
+ }
385
+ let definition;
386
+ if (typeof init === 'string') {
387
+ definition = DataModel.fromName(this.root || this, init);
388
+ }
389
+ else if (init instanceof DataModel) {
390
+ definition = init;
391
+ }
392
+ else {
393
+ definition = new DataModel(this.root || this, init);
394
+ }
395
+ (this.root || this).definitions.models.push(definition);
396
+ const item = DataItem.dataModel(this.root || this, definition.key);
397
+ if (!Array.isArray(root.items)) {
398
+ root.items = [];
399
+ }
400
+ root.items.push(item);
401
+ return definition;
402
+ }
403
+ /**
404
+ * Finds a data model in the definitions.
405
+ * @param key The key of the data model to find.
406
+ * @returns The data model definition or undefined when not found.
407
+ */
408
+ findDataModel(key) {
409
+ const { definitions } = this.root || this;
410
+ return definitions.models.find(i => i.key === key);
411
+ }
412
+ /**
413
+ * Finds a data model and calls the `remove()` on it.
414
+ * @param key The key of the data model to find.
415
+ */
416
+ removeDataModel(key) {
417
+ const { definitions } = this.root || this;
418
+ const model = definitions.models.find(i => i.key === key);
419
+ if (model) {
420
+ model.remove();
421
+ }
422
+ }
423
+ }
424
+ //# sourceMappingURL=DataNamespace.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DataNamespace.js","sourceRoot":"","sources":["../../../../src/models/data/DataNamespace.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,KAAK,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAoB,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACzE,OAAO,EAAe,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC1D,OAAO,EAAc,SAAS,EAAE,IAAI,IAAI,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAE9E,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAEnC,MAAM,CAAC,MAAM,IAAI,GAAG,oBAAoB,CAAC;AA4DzC,MAAM,mBAAmB;IACvB,IAAI,GAAG,IAAI,CAAC;IAEZ,GAAG,GAAG,EAAE,CAAC;IAET;;OAEG;IACH,KAAK,GAAe,EAAE,CAAC;IAEvB;;OAEG;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