@api-client/core 0.14.0 → 0.14.2

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 (169) 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 +2 -1
  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 +2 -1
  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 +63 -0
  29. package/build/src/modeling/DomainAssociation.d.ts.map +1 -1
  30. package/build/src/modeling/DomainAssociation.js +110 -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 +117 -0
  51. package/build/src/modeling/Semantics.d.ts.map +1 -0
  52. package/build/src/modeling/Semantics.js +112 -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/APIC-187.json +3 -3
  62. package/data/models/APIC-188.json +3 -3
  63. package/data/models/APIC-233.json +1 -1
  64. package/data/models/APIC-391.json +2 -2
  65. package/data/models/APIC-483.json +1 -1
  66. package/data/models/APIC-487.json +1 -1
  67. package/data/models/APIC-655.json +1 -1
  68. package/data/models/APIC-689.json +1 -1
  69. package/data/models/APIC-690.json +5 -5
  70. package/data/models/SE-10469.json +1 -1
  71. package/data/models/SE-13092.json +5 -5
  72. package/data/models/SE-22063.json +12 -2
  73. package/data/models/amf-helper-api.json +154 -14
  74. package/data/models/arc-demo-api.json +95 -15
  75. package/data/models/async-api.json +1 -1
  76. package/data/models/example-generator-api.json +369 -29
  77. package/data/models/expanded-api.json +1 -1
  78. package/data/models/flattened-api.json +1 -1
  79. package/data/models/multiple-servers.json +1 -1
  80. package/data/models/oas-3-api.json +1 -1
  81. package/data/models/oas-date.json +1 -1
  82. package/data/models/oas-types.json +1 -1
  83. package/data/models/oas-unions.json +1 -1
  84. package/data/models/petstore.json +1 -1
  85. package/data/models/raml-date.json +1 -1
  86. package/data/models/recursive.json +1 -1
  87. package/data/models/schema-api.json +62 -2
  88. package/data/models/secured-api.json +16 -16
  89. package/data/models/tracked-to-linked.json +4 -4
  90. package/package.json +2 -2
  91. package/src/amf/AmfTypes.ts +1 -1
  92. package/src/amf/Utils.ts +0 -15
  93. package/src/modeling/Bindings.ts +1 -1
  94. package/src/modeling/DataDomain.ts +2 -2
  95. package/src/modeling/DataFormat.ts +0 -48
  96. package/src/modeling/DomainAssociation.ts +122 -3
  97. package/src/modeling/DomainEntity.ts +56 -17
  98. package/src/modeling/DomainFile.ts +1 -1
  99. package/src/modeling/DomainImpactAnalysis.ts +3 -3
  100. package/src/modeling/DomainModel.ts +2 -2
  101. package/src/modeling/DomainProperty.ts +60 -21
  102. package/src/modeling/Semantics.ts +195 -0
  103. package/src/modeling/graph.md +14 -14
  104. package/src/modeling/readme.md +29 -29
  105. package/src/models/kinds.ts +0 -25
  106. package/src/models/store/data_catalog.ts +1 -1
  107. package/tests/unit/modeling/data_domain_change_observers.spec.ts +11 -10
  108. package/tests/unit/modeling/data_domain_entities.spec.ts +129 -1
  109. package/tests/unit/modeling/data_domain_property.spec.ts +1 -1
  110. package/tests/unit/modeling/domain_asociation.spec.ts +267 -0
  111. package/tests/unit/modeling/domain_entity.spec.ts +27 -26
  112. package/tests/unit/modeling/domain_entity_example_generator_json.spec.ts +11 -11
  113. package/tests/unit/modeling/domain_entity_example_generator_xml.spec.ts +10 -10
  114. package/tests/unit/modeling/{domain.property.spec.ts → domain_property.spec.ts} +139 -23
  115. package/tests/unit/modeling/semantics.spec.ts +149 -0
  116. package/build/src/amf/AmfShapeGenerator.d.ts +0 -103
  117. package/build/src/amf/AmfShapeGenerator.d.ts.map +0 -1
  118. package/build/src/amf/AmfShapeGenerator.js +0 -416
  119. package/build/src/amf/AmfShapeGenerator.js.map +0 -1
  120. package/build/src/modeling/legacy/DataAssociation.d.ts +0 -284
  121. package/build/src/modeling/legacy/DataAssociation.d.ts.map +0 -1
  122. package/build/src/modeling/legacy/DataAssociation.js +0 -443
  123. package/build/src/modeling/legacy/DataAssociation.js.map +0 -1
  124. package/build/src/modeling/legacy/DataEntity.d.ts +0 -358
  125. package/build/src/modeling/legacy/DataEntity.d.ts.map +0 -1
  126. package/build/src/modeling/legacy/DataEntity.js +0 -855
  127. package/build/src/modeling/legacy/DataEntity.js.map +0 -1
  128. package/build/src/modeling/legacy/DataEntityBuilder.d.ts +0 -162
  129. package/build/src/modeling/legacy/DataEntityBuilder.d.ts.map +0 -1
  130. package/build/src/modeling/legacy/DataEntityBuilder.js +0 -221
  131. package/build/src/modeling/legacy/DataEntityBuilder.js.map +0 -1
  132. package/build/src/modeling/legacy/DataImpactAnalysis.d.ts +0 -298
  133. package/build/src/modeling/legacy/DataImpactAnalysis.d.ts.map +0 -1
  134. package/build/src/modeling/legacy/DataImpactAnalysis.js +0 -441
  135. package/build/src/modeling/legacy/DataImpactAnalysis.js.map +0 -1
  136. package/build/src/modeling/legacy/DataModel.d.ts +0 -99
  137. package/build/src/modeling/legacy/DataModel.d.ts.map +0 -1
  138. package/build/src/modeling/legacy/DataModel.js +0 -237
  139. package/build/src/modeling/legacy/DataModel.js.map +0 -1
  140. package/build/src/modeling/legacy/DataNamespace.d.ts +0 -340
  141. package/build/src/modeling/legacy/DataNamespace.d.ts.map +0 -1
  142. package/build/src/modeling/legacy/DataNamespace.js +0 -784
  143. package/build/src/modeling/legacy/DataNamespace.js.map +0 -1
  144. package/build/src/modeling/legacy/DataProperty.d.ts +0 -332
  145. package/build/src/modeling/legacy/DataProperty.d.ts.map +0 -1
  146. package/build/src/modeling/legacy/DataProperty.js +0 -415
  147. package/build/src/modeling/legacy/DataProperty.js.map +0 -1
  148. package/build/src/models/store/DataFile.d.ts +0 -29
  149. package/build/src/models/store/DataFile.d.ts.map +0 -1
  150. package/build/src/models/store/DataFile.js +0 -87
  151. package/build/src/models/store/DataFile.js.map +0 -1
  152. package/src/amf/AmfShapeGenerator.ts +0 -477
  153. package/src/modeling/legacy/DataAssociation.ts +0 -554
  154. package/src/modeling/legacy/DataEntity.ts +0 -1019
  155. package/src/modeling/legacy/DataEntityBuilder.ts +0 -236
  156. package/src/modeling/legacy/DataImpactAnalysis.ts +0 -530
  157. package/src/modeling/legacy/DataModel.ts +0 -276
  158. package/src/modeling/legacy/DataNamespace.ts +0 -929
  159. package/src/modeling/legacy/DataProperty.ts +0 -630
  160. package/src/models/store/DataFile.ts +0 -95
  161. package/tests/unit/modeling/legacy/amf_shape_generator.spec.ts +0 -1041
  162. package/tests/unit/modeling/legacy/data_association.spec.ts +0 -710
  163. package/tests/unit/modeling/legacy/data_entity.spec.ts +0 -2061
  164. package/tests/unit/modeling/legacy/data_entity_generator_json.spec.ts +0 -987
  165. package/tests/unit/modeling/legacy/data_entity_generator_xml.spec.ts +0 -1451
  166. package/tests/unit/modeling/legacy/data_model.spec.ts +0 -395
  167. package/tests/unit/modeling/legacy/data_namespace.spec.ts +0 -1312
  168. package/tests/unit/modeling/legacy/data_property.spec.ts +0 -887
  169. 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
- }