@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
|
@@ -1,236 +0,0 @@
|
|
|
1
|
-
import { DataEntity } from './DataEntity.js'
|
|
2
|
-
import { DataNamespace } from './DataNamespace.js'
|
|
3
|
-
import { type DataPropertyType } from '../DataFormat.js'
|
|
4
|
-
import { type IThing, Thing } from '../../models/Thing.js'
|
|
5
|
-
import { nanoid } from '../../nanoid.js'
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* A fluent builder for constructing `DataEntity` instances.
|
|
9
|
-
*
|
|
10
|
-
* @example
|
|
11
|
-
* ```typescript
|
|
12
|
-
* const ns = new DataNamespace();
|
|
13
|
-
* const userEntity = DataEntityBuilder.withName(namespace, 'User')
|
|
14
|
-
* .addTypedProperty('string', 'firstName')
|
|
15
|
-
* .addTypedProperty('string', 'lastName')
|
|
16
|
-
* .addTypedProperty('integer', 'age')
|
|
17
|
-
* .addNamedAssociation('address')
|
|
18
|
-
* .addTag('user')
|
|
19
|
-
* .addTaxonomy(['user', 'person'])
|
|
20
|
-
* .build();
|
|
21
|
-
*
|
|
22
|
-
* const addressEntity = DataEntityBuilder.withName(namespace, 'Address')
|
|
23
|
-
* .addTypedProperty('string', 'street')
|
|
24
|
-
* .addTypedProperty('string', 'city')
|
|
25
|
-
* .addTag('address')
|
|
26
|
-
* .build();
|
|
27
|
-
*
|
|
28
|
-
* // Adding a target association after entities creation:
|
|
29
|
-
* userEntity.associations[0].addTarget(addressEntity)
|
|
30
|
-
* ```
|
|
31
|
-
*
|
|
32
|
-
* @example
|
|
33
|
-
* ```typescript
|
|
34
|
-
* const newEntity = DataEntityBuilder.newEntity(namespace)
|
|
35
|
-
* .withInfo({name: "test entity", description: "test desc"})
|
|
36
|
-
* .build();
|
|
37
|
-
*
|
|
38
|
-
* // with parents
|
|
39
|
-
* const baseEntity = DataEntityBuilder.withName(namespace, 'Base')
|
|
40
|
-
* .build()
|
|
41
|
-
*
|
|
42
|
-
* const specializedEntity = DataEntityBuilder.withName(namespace, 'Specialized')
|
|
43
|
-
* .addParent(baseEntity.key)
|
|
44
|
-
* .build()
|
|
45
|
-
* ```
|
|
46
|
-
* @deprecated
|
|
47
|
-
*/
|
|
48
|
-
export class DataEntityBuilder {
|
|
49
|
-
private entity: DataEntity
|
|
50
|
-
private root: DataNamespace
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
* Creates a new DataEntityBuilder.
|
|
54
|
-
* @param root The namespace the entity will belong to.
|
|
55
|
-
* @param name Optional name of the entity.
|
|
56
|
-
*/
|
|
57
|
-
private constructor(root: DataNamespace, name?: string) {
|
|
58
|
-
this.root = root
|
|
59
|
-
this.entity = new DataEntity(root)
|
|
60
|
-
if (name) {
|
|
61
|
-
this.entity.info = Thing.fromName(name)
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
/**
|
|
66
|
-
* Creates a new DataEntityBuilder instance with a name.
|
|
67
|
-
* @param root The namespace the entity will belong to.
|
|
68
|
-
* @param name The name of the entity.
|
|
69
|
-
* @returns A new DataEntityBuilder instance.
|
|
70
|
-
*/
|
|
71
|
-
static withName(root: DataNamespace, name: string): DataEntityBuilder {
|
|
72
|
-
return new DataEntityBuilder(root, name)
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
/**
|
|
76
|
-
* Creates a new DataEntityBuilder instance without a name.
|
|
77
|
-
* @param root The namespace the entity will belong to.
|
|
78
|
-
* @returns A new DataEntityBuilder instance.
|
|
79
|
-
*/
|
|
80
|
-
static newEntity(root: DataNamespace): DataEntityBuilder {
|
|
81
|
-
return new DataEntityBuilder(root)
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
/**
|
|
85
|
-
* Sets the key of the entity.
|
|
86
|
-
* @param key The key of the entity.
|
|
87
|
-
* @returns The current DataEntityBuilder instance.
|
|
88
|
-
*/
|
|
89
|
-
withKey(key: string): DataEntityBuilder {
|
|
90
|
-
this.entity.key = key
|
|
91
|
-
return this
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
/**
|
|
95
|
-
* Adds a description to the entity.
|
|
96
|
-
* @param description The description of the entity.
|
|
97
|
-
* @returns The current DataEntityBuilder instance.
|
|
98
|
-
*/
|
|
99
|
-
withDescription(description: string): DataEntityBuilder {
|
|
100
|
-
this.entity.info.description = description
|
|
101
|
-
return this
|
|
102
|
-
}
|
|
103
|
-
/**
|
|
104
|
-
* Adds info object to the entity
|
|
105
|
-
* @param info The info object
|
|
106
|
-
* @returns The current DataEntityBuilder instance.
|
|
107
|
-
*/
|
|
108
|
-
withInfo(info: IThing): DataEntityBuilder {
|
|
109
|
-
this.entity.info = new Thing(info)
|
|
110
|
-
return this
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
/**
|
|
114
|
-
* Adds a tag to the entity.
|
|
115
|
-
* @param tag The tag to add.
|
|
116
|
-
* @returns The current DataEntityBuilder instance.
|
|
117
|
-
*/
|
|
118
|
-
addTag(tag: string): DataEntityBuilder {
|
|
119
|
-
this.entity.addTag(tag)
|
|
120
|
-
return this
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
/**
|
|
124
|
-
* Adds multiple tags to the entity.
|
|
125
|
-
* @param tags The tags to add.
|
|
126
|
-
* @returns The current DataEntityBuilder instance.
|
|
127
|
-
*/
|
|
128
|
-
addTags(tags: string[]): DataEntityBuilder {
|
|
129
|
-
tags.forEach((tag) => this.entity.addTag(tag))
|
|
130
|
-
return this
|
|
131
|
-
}
|
|
132
|
-
/**
|
|
133
|
-
* Adds taxonomy to the entity.
|
|
134
|
-
* @param taxonomy The taxonomy to add.
|
|
135
|
-
* @returns The current DataEntityBuilder instance.
|
|
136
|
-
*/
|
|
137
|
-
addTaxonomy(taxonomy: string[]): DataEntityBuilder {
|
|
138
|
-
this.entity.taxonomy.push(...taxonomy)
|
|
139
|
-
return this
|
|
140
|
-
}
|
|
141
|
-
/**
|
|
142
|
-
* Adds a typed property to the entity.
|
|
143
|
-
* @param type The type of the property.
|
|
144
|
-
* @param name The name of the property.
|
|
145
|
-
* @returns The current DataEntityBuilder instance.
|
|
146
|
-
*/
|
|
147
|
-
addTypedProperty(type: DataPropertyType, name?: string): DataEntityBuilder {
|
|
148
|
-
this.entity.addTypedProperty(type, name)
|
|
149
|
-
return this
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
/**
|
|
153
|
-
* Adds a named property to the entity.
|
|
154
|
-
* @param name The name of the property.
|
|
155
|
-
* @returns The current DataEntityBuilder instance.
|
|
156
|
-
*/
|
|
157
|
-
addNamedProperty(name: string): DataEntityBuilder {
|
|
158
|
-
this.entity.addNamedProperty(name)
|
|
159
|
-
return this
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
/**
|
|
163
|
-
* Adds a named association to the entity.
|
|
164
|
-
* @param name The name of the association.
|
|
165
|
-
* @returns The current DataEntityBuilder instance.
|
|
166
|
-
*/
|
|
167
|
-
addNamedAssociation(name: string): DataEntityBuilder {
|
|
168
|
-
this.entity.addNamedAssociation(name)
|
|
169
|
-
return this
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
/**
|
|
173
|
-
* Adds a target association to the entity.
|
|
174
|
-
* @param target The target entity key of the association.
|
|
175
|
-
* @param name Optional name of the association.
|
|
176
|
-
* @returns The current DataEntityBuilder instance.
|
|
177
|
-
*/
|
|
178
|
-
addTargetAssociation(target: string, name?: string): DataEntityBuilder {
|
|
179
|
-
this.entity.addTargetAssociation(target, name)
|
|
180
|
-
return this
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
/**
|
|
184
|
-
* Adds a foreign association to the entity.
|
|
185
|
-
* @param target The target entity key of the association.
|
|
186
|
-
* @param namespace The target entity namespace.
|
|
187
|
-
* @param name Optional name of the association.
|
|
188
|
-
* @returns The current DataEntityBuilder instance.
|
|
189
|
-
*/
|
|
190
|
-
addForeignAssociation(target: string, namespace: string, name?: string): DataEntityBuilder {
|
|
191
|
-
this.entity.addForeignAssociation(target, namespace, name)
|
|
192
|
-
return this
|
|
193
|
-
}
|
|
194
|
-
/**
|
|
195
|
-
* Sets the entity as deprecated.
|
|
196
|
-
* @param deprecated
|
|
197
|
-
* @returns The current DataEntityBuilder instance.
|
|
198
|
-
*/
|
|
199
|
-
setDeprecated(deprecated: boolean): DataEntityBuilder {
|
|
200
|
-
this.entity.deprecated = deprecated
|
|
201
|
-
return this
|
|
202
|
-
}
|
|
203
|
-
/**
|
|
204
|
-
* Adds a parent to the entity.
|
|
205
|
-
* @param parentKey The key of the parent entity.
|
|
206
|
-
* @returns The current DataEntityBuilder instance.
|
|
207
|
-
*/
|
|
208
|
-
addParent(parentKey: string): DataEntityBuilder {
|
|
209
|
-
this.entity.addParent(parentKey)
|
|
210
|
-
return this
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
/**
|
|
214
|
-
* Adds multiple parents to the entity.
|
|
215
|
-
* @param parentKeys The keys of the parent entities.
|
|
216
|
-
* @returns The current DataEntityBuilder instance.
|
|
217
|
-
*/
|
|
218
|
-
addParents(parentKeys: string[]): DataEntityBuilder {
|
|
219
|
-
parentKeys.forEach((key) => {
|
|
220
|
-
this.addParent(key)
|
|
221
|
-
})
|
|
222
|
-
return this
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
/**
|
|
226
|
-
* Builds and returns the `DataEntity` instance.
|
|
227
|
-
* @returns The constructed DataEntity instance.
|
|
228
|
-
*/
|
|
229
|
-
build(): DataEntity {
|
|
230
|
-
if (!this.entity.key) {
|
|
231
|
-
this.entity.key = nanoid()
|
|
232
|
-
}
|
|
233
|
-
this.root.definitions.entities.push(this.entity)
|
|
234
|
-
return this.entity
|
|
235
|
-
}
|
|
236
|
-
}
|