@api-client/core 0.14.0 → 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.
Files changed (140) hide show
  1. package/build/src/amf/AmfTypes.d.ts +1 -1
  2. package/build/src/amf/AmfTypes.js +1 -1
  3. package/build/src/amf/AmfTypes.js.map +1 -1
  4. package/build/src/amf/Utils.d.ts +0 -6
  5. package/build/src/amf/Utils.d.ts.map +1 -1
  6. package/build/src/amf/Utils.js +0 -14
  7. package/build/src/amf/Utils.js.map +1 -1
  8. package/build/src/browser.d.ts +1 -0
  9. package/build/src/browser.d.ts.map +1 -1
  10. package/build/src/browser.js +1 -0
  11. package/build/src/browser.js.map +1 -1
  12. package/build/src/index.d.ts +1 -0
  13. package/build/src/index.d.ts.map +1 -1
  14. package/build/src/index.js +1 -0
  15. package/build/src/index.js.map +1 -1
  16. package/build/src/legacy.d.ts +0 -8
  17. package/build/src/legacy.d.ts.map +1 -1
  18. package/build/src/legacy.js +0 -9
  19. package/build/src/legacy.js.map +1 -1
  20. package/build/src/modeling/Bindings.d.ts +1 -1
  21. package/build/src/modeling/Bindings.js.map +1 -1
  22. package/build/src/modeling/DataDomain.js +2 -2
  23. package/build/src/modeling/DataDomain.js.map +1 -1
  24. package/build/src/modeling/DataFormat.d.ts +0 -40
  25. package/build/src/modeling/DataFormat.d.ts.map +1 -1
  26. package/build/src/modeling/DataFormat.js +0 -27
  27. package/build/src/modeling/DataFormat.js.map +1 -1
  28. package/build/src/modeling/DomainAssociation.d.ts +28 -0
  29. package/build/src/modeling/DomainAssociation.d.ts.map +1 -1
  30. package/build/src/modeling/DomainAssociation.js +73 -4
  31. package/build/src/modeling/DomainAssociation.js.map +1 -1
  32. package/build/src/modeling/DomainEntity.d.ts +25 -9
  33. package/build/src/modeling/DomainEntity.d.ts.map +1 -1
  34. package/build/src/modeling/DomainEntity.js +65 -21
  35. package/build/src/modeling/DomainEntity.js.map +1 -1
  36. package/build/src/modeling/DomainFile.d.ts +1 -1
  37. package/build/src/modeling/DomainFile.js +1 -1
  38. package/build/src/modeling/DomainFile.js.map +1 -1
  39. package/build/src/modeling/DomainImpactAnalysis.d.ts +1 -1
  40. package/build/src/modeling/DomainImpactAnalysis.d.ts.map +1 -1
  41. package/build/src/modeling/DomainImpactAnalysis.js +3 -3
  42. package/build/src/modeling/DomainImpactAnalysis.js.map +1 -1
  43. package/build/src/modeling/DomainModel.d.ts +2 -2
  44. package/build/src/modeling/DomainModel.js +2 -2
  45. package/build/src/modeling/DomainModel.js.map +1 -1
  46. package/build/src/modeling/DomainProperty.d.ts +28 -12
  47. package/build/src/modeling/DomainProperty.d.ts.map +1 -1
  48. package/build/src/modeling/DomainProperty.js +61 -26
  49. package/build/src/modeling/DomainProperty.js.map +1 -1
  50. package/build/src/modeling/Semantics.d.ts +109 -0
  51. package/build/src/modeling/Semantics.d.ts.map +1 -0
  52. package/build/src/modeling/Semantics.js +97 -0
  53. package/build/src/modeling/Semantics.js.map +1 -0
  54. package/build/src/models/kinds.d.ts +0 -24
  55. package/build/src/models/kinds.d.ts.map +1 -1
  56. package/build/src/models/kinds.js +0 -24
  57. package/build/src/models/kinds.js.map +1 -1
  58. package/build/src/models/store/data_catalog.d.ts +1 -1
  59. package/build/src/models/store/data_catalog.js.map +1 -1
  60. package/build/tsconfig.tsbuildinfo +1 -1
  61. package/data/models/example-generator-api.json +11 -11
  62. package/package.json +1 -1
  63. package/src/amf/AmfTypes.ts +1 -1
  64. package/src/amf/Utils.ts +0 -15
  65. package/src/modeling/Bindings.ts +1 -1
  66. package/src/modeling/DataDomain.ts +2 -2
  67. package/src/modeling/DataFormat.ts +0 -48
  68. package/src/modeling/DomainAssociation.ts +66 -3
  69. package/src/modeling/DomainEntity.ts +56 -17
  70. package/src/modeling/DomainFile.ts +1 -1
  71. package/src/modeling/DomainImpactAnalysis.ts +3 -3
  72. package/src/modeling/DomainModel.ts +2 -2
  73. package/src/modeling/DomainProperty.ts +60 -21
  74. package/src/modeling/Semantics.ts +178 -0
  75. package/src/modeling/graph.md +14 -14
  76. package/src/modeling/readme.md +29 -29
  77. package/src/models/kinds.ts +0 -25
  78. package/src/models/store/data_catalog.ts +1 -1
  79. package/tests/unit/modeling/data_domain_change_observers.spec.ts +11 -10
  80. package/tests/unit/modeling/data_domain_entities.spec.ts +129 -1
  81. package/tests/unit/modeling/data_domain_property.spec.ts +1 -1
  82. package/tests/unit/modeling/domain_asociation.spec.ts +177 -0
  83. package/tests/unit/modeling/domain_entity.spec.ts +27 -26
  84. package/tests/unit/modeling/domain_entity_example_generator_json.spec.ts +11 -11
  85. package/tests/unit/modeling/domain_entity_example_generator_xml.spec.ts +10 -10
  86. package/tests/unit/modeling/{domain.property.spec.ts → domain_property.spec.ts} +139 -23
  87. package/build/src/amf/AmfShapeGenerator.d.ts +0 -103
  88. package/build/src/amf/AmfShapeGenerator.d.ts.map +0 -1
  89. package/build/src/amf/AmfShapeGenerator.js +0 -416
  90. package/build/src/amf/AmfShapeGenerator.js.map +0 -1
  91. package/build/src/modeling/legacy/DataAssociation.d.ts +0 -284
  92. package/build/src/modeling/legacy/DataAssociation.d.ts.map +0 -1
  93. package/build/src/modeling/legacy/DataAssociation.js +0 -443
  94. package/build/src/modeling/legacy/DataAssociation.js.map +0 -1
  95. package/build/src/modeling/legacy/DataEntity.d.ts +0 -358
  96. package/build/src/modeling/legacy/DataEntity.d.ts.map +0 -1
  97. package/build/src/modeling/legacy/DataEntity.js +0 -855
  98. package/build/src/modeling/legacy/DataEntity.js.map +0 -1
  99. package/build/src/modeling/legacy/DataEntityBuilder.d.ts +0 -162
  100. package/build/src/modeling/legacy/DataEntityBuilder.d.ts.map +0 -1
  101. package/build/src/modeling/legacy/DataEntityBuilder.js +0 -221
  102. package/build/src/modeling/legacy/DataEntityBuilder.js.map +0 -1
  103. package/build/src/modeling/legacy/DataImpactAnalysis.d.ts +0 -298
  104. package/build/src/modeling/legacy/DataImpactAnalysis.d.ts.map +0 -1
  105. package/build/src/modeling/legacy/DataImpactAnalysis.js +0 -441
  106. package/build/src/modeling/legacy/DataImpactAnalysis.js.map +0 -1
  107. package/build/src/modeling/legacy/DataModel.d.ts +0 -99
  108. package/build/src/modeling/legacy/DataModel.d.ts.map +0 -1
  109. package/build/src/modeling/legacy/DataModel.js +0 -237
  110. package/build/src/modeling/legacy/DataModel.js.map +0 -1
  111. package/build/src/modeling/legacy/DataNamespace.d.ts +0 -340
  112. package/build/src/modeling/legacy/DataNamespace.d.ts.map +0 -1
  113. package/build/src/modeling/legacy/DataNamespace.js +0 -784
  114. package/build/src/modeling/legacy/DataNamespace.js.map +0 -1
  115. package/build/src/modeling/legacy/DataProperty.d.ts +0 -332
  116. package/build/src/modeling/legacy/DataProperty.d.ts.map +0 -1
  117. package/build/src/modeling/legacy/DataProperty.js +0 -415
  118. package/build/src/modeling/legacy/DataProperty.js.map +0 -1
  119. package/build/src/models/store/DataFile.d.ts +0 -29
  120. package/build/src/models/store/DataFile.d.ts.map +0 -1
  121. package/build/src/models/store/DataFile.js +0 -87
  122. package/build/src/models/store/DataFile.js.map +0 -1
  123. package/src/amf/AmfShapeGenerator.ts +0 -477
  124. package/src/modeling/legacy/DataAssociation.ts +0 -554
  125. package/src/modeling/legacy/DataEntity.ts +0 -1019
  126. package/src/modeling/legacy/DataEntityBuilder.ts +0 -236
  127. package/src/modeling/legacy/DataImpactAnalysis.ts +0 -530
  128. package/src/modeling/legacy/DataModel.ts +0 -276
  129. package/src/modeling/legacy/DataNamespace.ts +0 -929
  130. package/src/modeling/legacy/DataProperty.ts +0 -630
  131. package/src/models/store/DataFile.ts +0 -95
  132. package/tests/unit/modeling/legacy/amf_shape_generator.spec.ts +0 -1041
  133. package/tests/unit/modeling/legacy/data_association.spec.ts +0 -710
  134. package/tests/unit/modeling/legacy/data_entity.spec.ts +0 -2061
  135. package/tests/unit/modeling/legacy/data_entity_generator_json.spec.ts +0 -987
  136. package/tests/unit/modeling/legacy/data_entity_generator_xml.spec.ts +0 -1451
  137. package/tests/unit/modeling/legacy/data_model.spec.ts +0 -395
  138. package/tests/unit/modeling/legacy/data_namespace.spec.ts +0 -1312
  139. package/tests/unit/modeling/legacy/data_property.spec.ts +0 -887
  140. 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
- }