@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.
Files changed (174) 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 +3 -4
  37. package/build/src/modeling/DomainFile.d.ts.map +1 -1
  38. package/build/src/modeling/DomainFile.js +5 -9
  39. package/build/src/modeling/DomainFile.js.map +1 -1
  40. package/build/src/modeling/DomainImpactAnalysis.d.ts +1 -1
  41. package/build/src/modeling/DomainImpactAnalysis.d.ts.map +1 -1
  42. package/build/src/modeling/DomainImpactAnalysis.js +3 -3
  43. package/build/src/modeling/DomainImpactAnalysis.js.map +1 -1
  44. package/build/src/modeling/DomainModel.d.ts +2 -2
  45. package/build/src/modeling/DomainModel.js +2 -2
  46. package/build/src/modeling/DomainModel.js.map +1 -1
  47. package/build/src/modeling/DomainProperty.d.ts +28 -12
  48. package/build/src/modeling/DomainProperty.d.ts.map +1 -1
  49. package/build/src/modeling/DomainProperty.js +61 -26
  50. package/build/src/modeling/DomainProperty.js.map +1 -1
  51. package/build/src/modeling/Semantics.d.ts +109 -0
  52. package/build/src/modeling/Semantics.d.ts.map +1 -0
  53. package/build/src/modeling/Semantics.js +97 -0
  54. package/build/src/modeling/Semantics.js.map +1 -0
  55. package/build/src/models/CertificateFile.d.ts +2 -3
  56. package/build/src/models/CertificateFile.d.ts.map +1 -1
  57. package/build/src/models/CertificateFile.js +4 -8
  58. package/build/src/models/CertificateFile.js.map +1 -1
  59. package/build/src/models/Folder.d.ts +1 -2
  60. package/build/src/models/Folder.d.ts.map +1 -1
  61. package/build/src/models/Folder.js +2 -4
  62. package/build/src/models/Folder.js.map +1 -1
  63. package/build/src/models/Project.d.ts +2 -3
  64. package/build/src/models/Project.d.ts.map +1 -1
  65. package/build/src/models/Project.js +4 -8
  66. package/build/src/models/Project.js.map +1 -1
  67. package/build/src/models/kinds.d.ts +0 -24
  68. package/build/src/models/kinds.d.ts.map +1 -1
  69. package/build/src/models/kinds.js +0 -24
  70. package/build/src/models/kinds.js.map +1 -1
  71. package/build/src/models/store/File.d.ts +1 -21
  72. package/build/src/models/store/File.d.ts.map +1 -1
  73. package/build/src/models/store/File.js +3 -23
  74. package/build/src/models/store/File.js.map +1 -1
  75. package/build/src/models/store/data_catalog.d.ts +1 -1
  76. package/build/src/models/store/data_catalog.js.map +1 -1
  77. package/build/src/sdk/FilesSdk.js +1 -1
  78. package/build/src/sdk/FilesSdk.js.map +1 -1
  79. package/build/tsconfig.tsbuildinfo +1 -1
  80. package/data/models/example-generator-api.json +22 -22
  81. package/eslint.config.js +1 -0
  82. package/package.json +5 -5
  83. package/src/amf/AmfTypes.ts +1 -1
  84. package/src/amf/Utils.ts +0 -15
  85. package/src/modeling/Bindings.ts +1 -1
  86. package/src/modeling/DataDomain.ts +2 -2
  87. package/src/modeling/DataFormat.ts +0 -48
  88. package/src/modeling/DomainAssociation.ts +66 -3
  89. package/src/modeling/DomainEntity.ts +56 -17
  90. package/src/modeling/DomainFile.ts +5 -9
  91. package/src/modeling/DomainImpactAnalysis.ts +3 -3
  92. package/src/modeling/DomainModel.ts +2 -2
  93. package/src/modeling/DomainProperty.ts +60 -21
  94. package/src/modeling/Semantics.ts +178 -0
  95. package/src/modeling/graph.md +14 -14
  96. package/src/modeling/readme.md +29 -29
  97. package/src/models/CertificateFile.ts +4 -12
  98. package/src/models/Folder.ts +2 -4
  99. package/src/models/Project.ts +4 -8
  100. package/src/models/kinds.ts +0 -25
  101. package/src/models/store/File.ts +4 -35
  102. package/src/models/store/data_catalog.ts +1 -1
  103. package/src/sdk/FilesSdk.ts +1 -1
  104. package/tests/unit/modeling/data_domain_change_observers.spec.ts +11 -10
  105. package/tests/unit/modeling/data_domain_entities.spec.ts +129 -1
  106. package/tests/unit/modeling/data_domain_property.spec.ts +1 -1
  107. package/tests/unit/modeling/domain_asociation.spec.ts +177 -0
  108. package/tests/unit/modeling/domain_entity.spec.ts +27 -26
  109. package/tests/unit/modeling/domain_entity_example_generator_json.spec.ts +11 -11
  110. package/tests/unit/modeling/domain_entity_example_generator_xml.spec.ts +10 -10
  111. package/tests/unit/modeling/domain_file.spec.ts +4 -27
  112. package/tests/unit/modeling/{domain.property.spec.ts → domain_property.spec.ts} +139 -23
  113. package/tests/unit/models/Certificate/from_name.spec.ts +3 -15
  114. package/tests/unit/models/File/constructor.spec.ts +0 -1
  115. package/tests/unit/models/File/new.spec.ts +0 -13
  116. package/tests/unit/models/File/shortcutTo.spec.ts +1 -2
  117. package/tests/unit/models/File/toJSON.spec.ts +0 -13
  118. package/tests/unit/models/File/updateByMeMeta.spec.ts +4 -6
  119. package/tests/unit/models/Folder/create.spec.ts +2 -23
  120. package/tests/unit/models/Project/create.spec.ts +6 -32
  121. package/build/src/amf/AmfShapeGenerator.d.ts +0 -103
  122. package/build/src/amf/AmfShapeGenerator.d.ts.map +0 -1
  123. package/build/src/amf/AmfShapeGenerator.js +0 -416
  124. package/build/src/amf/AmfShapeGenerator.js.map +0 -1
  125. package/build/src/modeling/legacy/DataAssociation.d.ts +0 -284
  126. package/build/src/modeling/legacy/DataAssociation.d.ts.map +0 -1
  127. package/build/src/modeling/legacy/DataAssociation.js +0 -443
  128. package/build/src/modeling/legacy/DataAssociation.js.map +0 -1
  129. package/build/src/modeling/legacy/DataEntity.d.ts +0 -358
  130. package/build/src/modeling/legacy/DataEntity.d.ts.map +0 -1
  131. package/build/src/modeling/legacy/DataEntity.js +0 -855
  132. package/build/src/modeling/legacy/DataEntity.js.map +0 -1
  133. package/build/src/modeling/legacy/DataEntityBuilder.d.ts +0 -162
  134. package/build/src/modeling/legacy/DataEntityBuilder.d.ts.map +0 -1
  135. package/build/src/modeling/legacy/DataEntityBuilder.js +0 -221
  136. package/build/src/modeling/legacy/DataEntityBuilder.js.map +0 -1
  137. package/build/src/modeling/legacy/DataImpactAnalysis.d.ts +0 -298
  138. package/build/src/modeling/legacy/DataImpactAnalysis.d.ts.map +0 -1
  139. package/build/src/modeling/legacy/DataImpactAnalysis.js +0 -441
  140. package/build/src/modeling/legacy/DataImpactAnalysis.js.map +0 -1
  141. package/build/src/modeling/legacy/DataModel.d.ts +0 -99
  142. package/build/src/modeling/legacy/DataModel.d.ts.map +0 -1
  143. package/build/src/modeling/legacy/DataModel.js +0 -237
  144. package/build/src/modeling/legacy/DataModel.js.map +0 -1
  145. package/build/src/modeling/legacy/DataNamespace.d.ts +0 -340
  146. package/build/src/modeling/legacy/DataNamespace.d.ts.map +0 -1
  147. package/build/src/modeling/legacy/DataNamespace.js +0 -784
  148. package/build/src/modeling/legacy/DataNamespace.js.map +0 -1
  149. package/build/src/modeling/legacy/DataProperty.d.ts +0 -332
  150. package/build/src/modeling/legacy/DataProperty.d.ts.map +0 -1
  151. package/build/src/modeling/legacy/DataProperty.js +0 -415
  152. package/build/src/modeling/legacy/DataProperty.js.map +0 -1
  153. package/build/src/models/store/DataFile.d.ts +0 -31
  154. package/build/src/models/store/DataFile.d.ts.map +0 -1
  155. package/build/src/models/store/DataFile.js +0 -92
  156. package/build/src/models/store/DataFile.js.map +0 -1
  157. package/src/amf/AmfShapeGenerator.ts +0 -477
  158. package/src/modeling/legacy/DataAssociation.ts +0 -554
  159. package/src/modeling/legacy/DataEntity.ts +0 -1019
  160. package/src/modeling/legacy/DataEntityBuilder.ts +0 -236
  161. package/src/modeling/legacy/DataImpactAnalysis.ts +0 -530
  162. package/src/modeling/legacy/DataModel.ts +0 -276
  163. package/src/modeling/legacy/DataNamespace.ts +0 -929
  164. package/src/modeling/legacy/DataProperty.ts +0 -630
  165. package/src/models/store/DataFile.ts +0 -100
  166. package/tests/unit/modeling/legacy/amf_shape_generator.spec.ts +0 -1041
  167. package/tests/unit/modeling/legacy/data_association.spec.ts +0 -710
  168. package/tests/unit/modeling/legacy/data_entity.spec.ts +0 -2061
  169. package/tests/unit/modeling/legacy/data_entity_generator_json.spec.ts +0 -987
  170. package/tests/unit/modeling/legacy/data_entity_generator_xml.spec.ts +0 -1451
  171. package/tests/unit/modeling/legacy/data_model.spec.ts +0 -395
  172. package/tests/unit/modeling/legacy/data_namespace.spec.ts +0 -1312
  173. package/tests/unit/modeling/legacy/data_property.spec.ts +0 -887
  174. 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
- }