@api-client/core 0.11.11 → 0.12.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 (338) hide show
  1. package/Testing.md +1 -1
  2. package/bin/plugins/events/EventPlugin.ts +61 -0
  3. package/bin/plugins/events/assert.ts +193 -0
  4. package/bin/plugins/events/types.ts +6 -0
  5. package/bin/test.ts +8 -1
  6. package/build/src/amf/AmfShapeGenerator.d.ts +6 -3
  7. package/build/src/amf/AmfShapeGenerator.d.ts.map +1 -1
  8. package/build/src/amf/AmfShapeGenerator.js +7 -4
  9. package/build/src/amf/AmfShapeGenerator.js.map +1 -1
  10. package/build/src/amf/AmfTypes.d.ts +2 -2
  11. package/build/src/amf/AmfTypes.d.ts.map +1 -1
  12. package/build/src/amf/AmfTypes.js.map +1 -1
  13. package/build/src/amf/DataValueGenerator.d.ts +15 -15
  14. package/build/src/amf/DataValueGenerator.d.ts.map +1 -1
  15. package/build/src/amf/DataValueGenerator.js +17 -16
  16. package/build/src/amf/DataValueGenerator.js.map +1 -1
  17. package/build/src/amf/models/AmfDataNode.d.ts.map +1 -1
  18. package/build/src/amf/models/AmfDataNode.js +2 -2
  19. package/build/src/amf/models/AmfDataNode.js.map +1 -1
  20. package/build/src/browser.d.ts +12 -9
  21. package/build/src/browser.d.ts.map +1 -1
  22. package/build/src/browser.js +11 -8
  23. package/build/src/browser.js.map +1 -1
  24. package/build/src/exceptions/attach_exception.d.ts +11 -0
  25. package/build/src/exceptions/attach_exception.d.ts.map +1 -0
  26. package/build/src/exceptions/attach_exception.js +11 -0
  27. package/build/src/exceptions/attach_exception.js.map +1 -0
  28. package/build/src/exceptions/detach_exception.d.ts +11 -0
  29. package/build/src/exceptions/detach_exception.d.ts.map +1 -0
  30. package/build/src/exceptions/detach_exception.js +11 -0
  31. package/build/src/exceptions/detach_exception.js.map +1 -0
  32. package/build/src/exceptions/remove_model_exception.d.ts +8 -0
  33. package/build/src/exceptions/remove_model_exception.d.ts.map +1 -0
  34. package/build/src/exceptions/remove_model_exception.js +8 -0
  35. package/build/src/exceptions/remove_model_exception.js.map +1 -0
  36. package/build/src/exceptions/remove_namespace_exception.d.ts +8 -0
  37. package/build/src/exceptions/remove_namespace_exception.d.ts.map +1 -0
  38. package/build/src/exceptions/remove_namespace_exception.js +8 -0
  39. package/build/src/exceptions/remove_namespace_exception.js.map +1 -0
  40. package/build/src/index.d.ts +12 -9
  41. package/build/src/index.d.ts.map +1 -1
  42. package/build/src/index.js +11 -8
  43. package/build/src/index.js.map +1 -1
  44. package/build/src/legacy.d.ts +8 -0
  45. package/build/src/legacy.d.ts.map +1 -1
  46. package/build/src/legacy.js +9 -0
  47. package/build/src/legacy.js.map +1 -1
  48. package/build/src/lib/uuid.d.ts +1 -1
  49. package/build/src/lib/uuid.js +1 -1
  50. package/build/src/lib/uuid.js.map +1 -1
  51. package/build/src/mocking/lib/History.js +8 -8
  52. package/build/src/mocking/lib/History.js.map +1 -1
  53. package/build/src/mocking/lib/HostRules.js +1 -1
  54. package/build/src/mocking/lib/HostRules.js.map +1 -1
  55. package/build/src/mocking/lib/User.js +2 -2
  56. package/build/src/mocking/lib/User.js.map +1 -1
  57. package/build/src/modeling/Bindings.d.ts +2 -2
  58. package/build/src/modeling/Bindings.d.ts.map +1 -1
  59. package/build/src/modeling/Bindings.js.map +1 -1
  60. package/build/src/modeling/DataDomain.d.ts +601 -0
  61. package/build/src/modeling/DataDomain.d.ts.map +1 -0
  62. package/build/src/modeling/DataDomain.js +1141 -0
  63. package/build/src/modeling/DataDomain.js.map +1 -0
  64. package/build/src/modeling/DataFormat.d.ts +42 -41
  65. package/build/src/modeling/DataFormat.d.ts.map +1 -1
  66. package/build/src/modeling/DataFormat.js +30 -131
  67. package/build/src/modeling/DataFormat.js.map +1 -1
  68. package/build/src/modeling/DomainAssociation.d.ts +281 -0
  69. package/build/src/modeling/DomainAssociation.d.ts.map +1 -0
  70. package/build/src/modeling/DomainAssociation.js +440 -0
  71. package/build/src/modeling/DomainAssociation.js.map +1 -0
  72. package/build/src/modeling/DomainElement.d.ts +33 -0
  73. package/build/src/modeling/DomainElement.d.ts.map +1 -0
  74. package/build/src/modeling/DomainElement.js +32 -0
  75. package/build/src/modeling/DomainElement.js.map +1 -0
  76. package/build/src/modeling/DomainEntity.d.ts +383 -0
  77. package/build/src/modeling/DomainEntity.d.ts.map +1 -0
  78. package/build/src/modeling/DomainEntity.js +718 -0
  79. package/build/src/modeling/DomainEntity.js.map +1 -0
  80. package/build/src/modeling/DomainFile.d.ts +25 -0
  81. package/build/src/modeling/DomainFile.d.ts.map +1 -0
  82. package/build/src/modeling/DomainFile.js +86 -0
  83. package/build/src/modeling/DomainFile.js.map +1 -0
  84. package/build/src/modeling/DomainImpactAnalysis.d.ts +60 -47
  85. package/build/src/modeling/DomainImpactAnalysis.d.ts.map +1 -1
  86. package/build/src/modeling/DomainImpactAnalysis.js +201 -132
  87. package/build/src/modeling/DomainImpactAnalysis.js.map +1 -1
  88. package/build/src/modeling/DomainModel.d.ts +226 -0
  89. package/build/src/modeling/DomainModel.d.ts.map +1 -0
  90. package/build/src/modeling/DomainModel.js +401 -0
  91. package/build/src/modeling/DomainModel.js.map +1 -0
  92. package/build/src/modeling/DomainNamespace.d.ts +268 -0
  93. package/build/src/modeling/DomainNamespace.d.ts.map +1 -0
  94. package/build/src/modeling/DomainNamespace.js +512 -0
  95. package/build/src/modeling/DomainNamespace.js.map +1 -0
  96. package/build/src/modeling/DomainProperty.d.ts +281 -0
  97. package/build/src/modeling/DomainProperty.d.ts.map +1 -0
  98. package/build/src/modeling/DomainProperty.js +560 -0
  99. package/build/src/modeling/DomainProperty.js.map +1 -0
  100. package/build/src/modeling/DomainSerialization.d.ts +40 -0
  101. package/build/src/modeling/DomainSerialization.d.ts.map +1 -0
  102. package/build/src/modeling/DomainSerialization.js +288 -0
  103. package/build/src/modeling/DomainSerialization.js.map +1 -0
  104. package/build/src/modeling/DomainVersioning.d.ts +17 -0
  105. package/build/src/modeling/DomainVersioning.d.ts.map +1 -0
  106. package/build/src/modeling/DomainVersioning.js +124 -0
  107. package/build/src/modeling/DomainVersioning.js.map +1 -0
  108. package/build/src/modeling/GraphUtils.d.ts +8 -0
  109. package/build/src/modeling/GraphUtils.d.ts.map +1 -0
  110. package/build/src/modeling/GraphUtils.js +26 -0
  111. package/build/src/modeling/GraphUtils.js.map +1 -0
  112. package/build/src/modeling/amf/ShapeGenerator.d.ts +164 -0
  113. package/build/src/modeling/amf/ShapeGenerator.d.ts.map +1 -0
  114. package/build/src/modeling/amf/ShapeGenerator.js +492 -0
  115. package/build/src/modeling/amf/ShapeGenerator.js.map +1 -0
  116. package/build/src/modeling/{DataAssociation.d.ts → legacy/DataAssociation.d.ts} +10 -5
  117. package/build/src/modeling/legacy/DataAssociation.d.ts.map +1 -0
  118. package/build/src/modeling/{DataAssociation.js → legacy/DataAssociation.js} +11 -8
  119. package/build/src/modeling/legacy/DataAssociation.js.map +1 -0
  120. package/build/src/modeling/{DataEntity.d.ts → legacy/DataEntity.d.ts} +12 -7
  121. package/build/src/modeling/legacy/DataEntity.d.ts.map +1 -0
  122. package/build/src/modeling/{DataEntity.js → legacy/DataEntity.js} +21 -20
  123. package/build/src/modeling/legacy/DataEntity.js.map +1 -0
  124. package/build/src/modeling/{DataEntityBuilder.d.ts → legacy/DataEntityBuilder.d.ts} +3 -2
  125. package/build/src/modeling/legacy/DataEntityBuilder.d.ts.map +1 -0
  126. package/build/src/modeling/{DataEntityBuilder.js → legacy/DataEntityBuilder.js} +4 -3
  127. package/build/src/modeling/legacy/DataEntityBuilder.js.map +1 -0
  128. package/build/src/modeling/legacy/DataImpactAnalysis.d.ts +298 -0
  129. package/build/src/modeling/legacy/DataImpactAnalysis.d.ts.map +1 -0
  130. package/build/src/modeling/legacy/DataImpactAnalysis.js +441 -0
  131. package/build/src/modeling/legacy/DataImpactAnalysis.js.map +1 -0
  132. package/build/src/modeling/{DataModel.d.ts → legacy/DataModel.d.ts} +6 -4
  133. package/build/src/modeling/legacy/DataModel.d.ts.map +1 -0
  134. package/build/src/modeling/{DataModel.js → legacy/DataModel.js} +9 -8
  135. package/build/src/modeling/legacy/DataModel.js.map +1 -0
  136. package/build/src/modeling/{DataNamespace.d.ts → legacy/DataNamespace.d.ts} +22 -3
  137. package/build/src/modeling/legacy/DataNamespace.d.ts.map +1 -0
  138. package/build/src/modeling/{DataNamespace.js → legacy/DataNamespace.js} +9 -5
  139. package/build/src/modeling/legacy/DataNamespace.js.map +1 -0
  140. package/build/src/modeling/{DataProperty.d.ts → legacy/DataProperty.d.ts} +13 -5
  141. package/build/src/modeling/legacy/DataProperty.d.ts.map +1 -0
  142. package/build/src/modeling/{DataProperty.js → legacy/DataProperty.js} +10 -7
  143. package/build/src/modeling/legacy/DataProperty.js.map +1 -0
  144. package/build/src/modeling/observed.d.ts +67 -0
  145. package/build/src/modeling/observed.d.ts.map +1 -0
  146. package/build/src/modeling/observed.js +230 -0
  147. package/build/src/modeling/observed.js.map +1 -0
  148. package/build/src/modeling/types.d.ts +165 -1
  149. package/build/src/modeling/types.d.ts.map +1 -1
  150. package/build/src/modeling/types.js.map +1 -1
  151. package/build/src/models/AuthorizationData.js +3 -3
  152. package/build/src/models/AuthorizationData.js.map +1 -1
  153. package/build/src/models/CertificateFile.js +2 -2
  154. package/build/src/models/CertificateFile.js.map +1 -1
  155. package/build/src/models/ClientCertificate.js +5 -5
  156. package/build/src/models/ClientCertificate.js.map +1 -1
  157. package/build/src/models/Environment.js +6 -6
  158. package/build/src/models/Environment.js.map +1 -1
  159. package/build/src/models/Folder.js +2 -2
  160. package/build/src/models/Folder.js.map +1 -1
  161. package/build/src/models/HostRule.js +4 -4
  162. package/build/src/models/HostRule.js.map +1 -1
  163. package/build/src/models/HttpProject.js +12 -12
  164. package/build/src/models/HttpProject.js.map +1 -1
  165. package/build/src/models/Project.d.ts.map +1 -1
  166. package/build/src/models/Project.js +2 -2
  167. package/build/src/models/Project.js.map +1 -1
  168. package/build/src/models/ProjectFolder.d.ts.map +1 -1
  169. package/build/src/models/ProjectFolder.js +6 -6
  170. package/build/src/models/ProjectFolder.js.map +1 -1
  171. package/build/src/models/ProjectRequest.d.ts.map +1 -1
  172. package/build/src/models/ProjectRequest.js +8 -8
  173. package/build/src/models/ProjectRequest.js.map +1 -1
  174. package/build/src/models/ProjectSchema.js +6 -6
  175. package/build/src/models/ProjectSchema.js.map +1 -1
  176. package/build/src/models/Thing.d.ts +26 -5
  177. package/build/src/models/Thing.d.ts.map +1 -1
  178. package/build/src/models/Thing.js +193 -91
  179. package/build/src/models/Thing.js.map +1 -1
  180. package/build/src/models/kinds.d.ts +31 -6
  181. package/build/src/models/kinds.d.ts.map +1 -1
  182. package/build/src/models/kinds.js +31 -6
  183. package/build/src/models/kinds.js.map +1 -1
  184. package/build/src/models/store/DataFile.d.ts +3 -1
  185. package/build/src/models/store/DataFile.d.ts.map +1 -1
  186. package/build/src/models/store/DataFile.js +4 -2
  187. package/build/src/models/store/DataFile.js.map +1 -1
  188. package/build/src/models/store/File.d.ts.map +1 -1
  189. package/build/src/models/store/File.js +3 -3
  190. package/build/src/models/store/File.js.map +1 -1
  191. package/build/src/models/store/Organization.js +3 -3
  192. package/build/src/models/store/Organization.js.map +1 -1
  193. package/build/src/models/store/Permission.js +7 -7
  194. package/build/src/models/store/Permission.js.map +1 -1
  195. package/build/src/models/store/UserIdentity.js +3 -3
  196. package/build/src/models/store/UserIdentity.js.map +1 -1
  197. package/build/src/models/transformers/ArcDexieTransformer.js +4 -4
  198. package/build/src/models/transformers/ArcDexieTransformer.js.map +1 -1
  199. package/build/src/models/transformers/ArcLegacyTransformer.js +3 -3
  200. package/build/src/models/transformers/ArcLegacyTransformer.js.map +1 -1
  201. package/build/src/models/transformers/ArcPouchTransformer.js +2 -2
  202. package/build/src/models/transformers/ArcPouchTransformer.js.map +1 -1
  203. package/build/src/models/transformers/PostmanV21Transformer.js +2 -2
  204. package/build/src/models/transformers/PostmanV21Transformer.js.map +1 -1
  205. package/build/src/models/transformers/PostmanV2Transformer.js +2 -2
  206. package/build/src/models/transformers/PostmanV2Transformer.js.map +1 -1
  207. package/build/src/models/types.d.ts +12 -0
  208. package/build/src/models/types.d.ts.map +1 -0
  209. package/build/src/models/types.js +2 -0
  210. package/build/src/models/types.js.map +1 -0
  211. package/build/src/patch/PatchClient.js +2 -2
  212. package/build/src/patch/PatchClient.js.map +1 -1
  213. package/build/src/runtime/store/FilesSdk.d.ts +2 -2
  214. package/build/src/runtime/store/FilesSdk.d.ts.map +1 -1
  215. package/build/src/runtime/store/FilesSdk.js +3 -3
  216. package/build/src/runtime/store/FilesSdk.js.map +1 -1
  217. package/data/models/example-generator-api.json +8 -8
  218. package/package.json +20 -6
  219. package/readme.md +1 -1
  220. package/src/amf/AmfShapeGenerator.ts +10 -7
  221. package/src/amf/AmfTypes.ts +2 -2
  222. package/src/amf/DataValueGenerator.ts +24 -23
  223. package/src/amf/models/AmfDataNode.ts +2 -2
  224. package/src/exceptions/attach_exception.ts +11 -0
  225. package/src/exceptions/detach_exception.ts +11 -0
  226. package/src/exceptions/remove_model_exception.ts +8 -0
  227. package/src/exceptions/remove_namespace_exception.ts +8 -0
  228. package/src/lib/uuid.ts +1 -1
  229. package/src/mocking/lib/History.ts +8 -8
  230. package/src/mocking/lib/HostRules.ts +1 -1
  231. package/src/mocking/lib/User.ts +2 -2
  232. package/src/modeling/Bindings.ts +2 -2
  233. package/src/modeling/DataDomain.ts +1220 -0
  234. package/src/modeling/DataFormat.ts +54 -163
  235. package/src/modeling/DomainAssociation.ts +476 -0
  236. package/src/modeling/DomainElement.ts +50 -0
  237. package/src/modeling/DomainEntity.ts +769 -0
  238. package/src/modeling/DomainFile.ts +94 -0
  239. package/src/modeling/DomainImpactAnalysis.ts +218 -144
  240. package/src/modeling/DomainModel.ts +421 -0
  241. package/src/modeling/DomainNamespace.ts +537 -0
  242. package/src/modeling/DomainProperty.ts +548 -0
  243. package/src/modeling/DomainSerialization.ts +312 -0
  244. package/src/modeling/DomainVersioning.ts +144 -0
  245. package/src/modeling/GraphUtils.ts +28 -0
  246. package/src/modeling/amf/ShapeGenerator.ts +552 -0
  247. package/src/modeling/graph.md +115 -0
  248. package/src/modeling/{DataAssociation.ts → legacy/DataAssociation.ts} +15 -10
  249. package/src/modeling/{DataEntity.ts → legacy/DataEntity.ts} +30 -25
  250. package/src/modeling/{DataEntityBuilder.ts → legacy/DataEntityBuilder.ts} +5 -4
  251. package/src/modeling/legacy/DataImpactAnalysis.ts +530 -0
  252. package/src/modeling/{DataModel.ts → legacy/DataModel.ts} +12 -10
  253. package/src/modeling/{DataNamespace.ts → legacy/DataNamespace.ts} +25 -7
  254. package/src/modeling/{DataProperty.ts → legacy/DataProperty.ts} +17 -9
  255. package/src/modeling/observed.ts +267 -0
  256. package/src/modeling/types.ts +174 -1
  257. package/src/models/AuthorizationData.ts +3 -3
  258. package/src/models/CertificateFile.ts +2 -2
  259. package/src/models/ClientCertificate.ts +5 -5
  260. package/src/models/Environment.ts +6 -6
  261. package/src/models/Folder.ts +2 -2
  262. package/src/models/HostRule.ts +4 -4
  263. package/src/models/HttpProject.ts +12 -12
  264. package/src/models/Project.ts +2 -2
  265. package/src/models/ProjectFolder.ts +6 -6
  266. package/src/models/ProjectRequest.ts +8 -8
  267. package/src/models/ProjectSchema.ts +6 -6
  268. package/src/models/Thing.ts +70 -5
  269. package/src/models/kinds.ts +32 -6
  270. package/src/models/store/DataFile.ts +5 -3
  271. package/src/models/store/File.ts +3 -3
  272. package/src/models/store/Organization.ts +3 -3
  273. package/src/models/store/Permission.ts +7 -7
  274. package/src/models/store/UserIdentity.ts +3 -3
  275. package/src/models/transformers/ArcDexieTransformer.ts +4 -4
  276. package/src/models/transformers/ArcLegacyTransformer.ts +3 -3
  277. package/src/models/transformers/ArcPouchTransformer.ts +2 -2
  278. package/src/models/transformers/PostmanV21Transformer.ts +2 -2
  279. package/src/models/transformers/PostmanV2Transformer.ts +2 -2
  280. package/src/models/types.ts +11 -0
  281. package/src/patch/PatchClient.ts +2 -2
  282. package/src/runtime/store/FilesSdk.ts +5 -5
  283. package/tests/unit/amf/data_value_generator.spec.ts +15 -15
  284. package/tests/unit/legacy-transformers/ARC-legacy-import.spec.ts +1 -1
  285. package/tests/unit/modeling/amf/shape_generator.spec.ts +1174 -0
  286. package/tests/unit/modeling/data_domain.spec.ts +444 -0
  287. package/tests/unit/modeling/data_domain_associations.spec.ts +279 -0
  288. package/tests/unit/modeling/data_domain_change_observers.spec.ts +681 -0
  289. package/tests/unit/modeling/data_domain_entities.spec.ts +449 -0
  290. package/tests/unit/modeling/data_domain_foreign.spec.ts +355 -0
  291. package/tests/unit/modeling/data_domain_models.spec.ts +658 -0
  292. package/tests/unit/modeling/data_domain_namespaces.spec.ts +668 -0
  293. package/tests/unit/modeling/data_domain_property.spec.ts +264 -0
  294. package/tests/unit/modeling/data_domain_serialization.spec.ts +294 -0
  295. package/tests/unit/modeling/domain.property.spec.ts +822 -0
  296. package/tests/unit/modeling/domain_asociation.spec.ts +643 -0
  297. package/tests/unit/modeling/domain_asociation_targets.spec.ts +350 -0
  298. package/tests/unit/modeling/domain_entity.spec.ts +730 -0
  299. package/tests/unit/modeling/domain_entity_associations.spec.ts +330 -0
  300. package/tests/unit/modeling/domain_entity_example_generator_json.spec.ts +988 -0
  301. package/tests/unit/modeling/domain_entity_example_generator_xml.spec.ts +1451 -0
  302. package/tests/unit/modeling/domain_entity_fields.spec.ts +113 -0
  303. package/tests/unit/modeling/domain_entity_generators.spec.ts +20 -0
  304. package/tests/unit/modeling/domain_entity_parents.spec.ts +291 -0
  305. package/tests/unit/modeling/domain_entity_properties.spec.ts +305 -0
  306. package/tests/unit/modeling/{data_file.spec.ts → domain_file.spec.ts} +29 -85
  307. package/tests/unit/modeling/domain_impact_analysis.spec.ts +452 -0
  308. package/tests/unit/modeling/domain_model.spec.ts +568 -0
  309. package/tests/unit/modeling/domain_model_entities.spec.ts +408 -0
  310. package/tests/unit/modeling/domain_namespace.spec.ts +514 -0
  311. package/tests/unit/modeling/domain_namespace_models.spec.ts +324 -0
  312. package/tests/unit/modeling/domain_namespace_namespaces.spec.ts +404 -0
  313. package/tests/unit/modeling/domain_versioning.spec.ts +140 -0
  314. package/tests/unit/{amf → modeling/legacy}/amf_shape_generator.spec.ts +11 -11
  315. package/tests/unit/modeling/{data_association.spec.ts → legacy/data_association.spec.ts} +3 -11
  316. package/tests/unit/modeling/{data_entity.spec.ts → legacy/data_entity.spec.ts} +10 -8
  317. package/tests/unit/modeling/{data_entity_generator_json.spec.ts → legacy/data_entity_generator_json.spec.ts} +1 -1
  318. package/tests/unit/modeling/{data_entity_generator_xml.spec.ts → legacy/data_entity_generator_xml.spec.ts} +1 -1
  319. package/tests/unit/modeling/{data_model.spec.ts → legacy/data_model.spec.ts} +3 -3
  320. package/tests/unit/modeling/{data_namespace.spec.ts → legacy/data_namespace.spec.ts} +3 -10
  321. package/tests/unit/modeling/{data_property.spec.ts → legacy/data_property.spec.ts} +3 -6
  322. package/tests/unit/modeling/{impact_analysis.spec.ts → legacy/impact_analysis.spec.ts} +9 -9
  323. package/tests/unit/models/File/new.spec.ts +1 -1
  324. package/tests/unit/models/HttpProject.spec.ts +3 -3
  325. package/tests/unit/runtime/proxy/HttpProjectProxy.spec.ts +8 -8
  326. package/tsconfig.node.json +35 -0
  327. package/build/src/modeling/DataAssociation.d.ts.map +0 -1
  328. package/build/src/modeling/DataAssociation.js.map +0 -1
  329. package/build/src/modeling/DataEntity.d.ts.map +0 -1
  330. package/build/src/modeling/DataEntity.js.map +0 -1
  331. package/build/src/modeling/DataEntityBuilder.d.ts.map +0 -1
  332. package/build/src/modeling/DataEntityBuilder.js.map +0 -1
  333. package/build/src/modeling/DataModel.d.ts.map +0 -1
  334. package/build/src/modeling/DataModel.js.map +0 -1
  335. package/build/src/modeling/DataNamespace.d.ts.map +0 -1
  336. package/build/src/modeling/DataNamespace.js.map +0 -1
  337. package/build/src/modeling/DataProperty.d.ts.map +0 -1
  338. package/build/src/modeling/DataProperty.js.map +0 -1
@@ -42470,15 +42470,15 @@
42470
42470
  "@id": "#219"
42471
42471
  },
42472
42472
  {
42473
- "@id": "#216"
42474
- },
42475
- {
42476
42473
  "@id": "#210"
42477
42474
  },
42478
42475
  {
42479
42476
  "@id": "#213"
42480
42477
  },
42481
42478
  {
42479
+ "@id": "#216"
42480
+ },
42481
+ {
42482
42482
  "@id": "#219"
42483
42483
  }
42484
42484
  ],
@@ -43892,7 +43892,7 @@
43892
43892
  "doc:ExternalDomainElement",
43893
43893
  "doc:DomainElement"
43894
43894
  ],
43895
- "doc:raw": "type: 'GENERAL'\ncountryDialCode : '+32'\nareaCode : '21'\nsubscriberNumber: '12.87.00'\nformatted: '+32-(0)21 302099'\n",
43895
+ "doc:raw": "type: 'GENERAL'\ncountryDialCode : '+32'\nareaCode : '22'\nsubscriberNumber: '12.87.00'\nformatted: '+32-(0)22 000000'\n",
43896
43896
  "core:mediaType": "application/yaml",
43897
43897
  "sourcemaps:sources": [
43898
43898
  {
@@ -43913,7 +43913,7 @@
43913
43913
  "doc:ExternalDomainElement",
43914
43914
  "doc:DomainElement"
43915
43915
  ],
43916
- "doc:raw": "-\n type: 'GENERAL'\n value: 'info@company.be'\n-\n type: 'IT_DEPT'\n value: 'it-service@company.be'\n",
43916
+ "doc:raw": "type: 'GENERAL'\ncountryDialCode : '+32'\nareaCode : '21'\nsubscriberNumber: '12.87.00'\nformatted: '+32-(0)21 302099'\n",
43917
43917
  "core:mediaType": "application/yaml",
43918
43918
  "sourcemaps:sources": [
43919
43919
  {
@@ -43934,7 +43934,7 @@
43934
43934
  "doc:ExternalDomainElement",
43935
43935
  "doc:DomainElement"
43936
43936
  ],
43937
- "doc:raw": "type: 'GENERAL'\ncountryDialCode : '+32'\nareaCode : '22'\nsubscriberNumber: '12.87.00'\nformatted: '+32-(0)22 000000'\n",
43937
+ "doc:raw": "-\n type: 'GENERAL'\n value: 'info@company.be'\n-\n type: 'IT_DEPT'\n value: 'it-service@company.be'\n",
43938
43938
  "core:mediaType": "application/yaml",
43939
43939
  "sourcemaps:sources": [
43940
43940
  {
@@ -44781,12 +44781,12 @@
44781
44781
  {
44782
44782
  "@id": "#215/source-map/lexical/element_0",
44783
44783
  "sourcemaps:element": "amf://id#215",
44784
- "sourcemaps:value": "[(1,0)-(7,0)]"
44784
+ "sourcemaps:value": "[(1,0)-(6,0)]"
44785
44785
  },
44786
44786
  {
44787
44787
  "@id": "#218/source-map/lexical/element_0",
44788
44788
  "sourcemaps:element": "amf://id#218",
44789
- "sourcemaps:value": "[(1,0)-(6,0)]"
44789
+ "sourcemaps:value": "[(1,0)-(7,0)]"
44790
44790
  },
44791
44791
  {
44792
44792
  "@id": "#221/source-map/lexical/element_0",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@api-client/core",
3
3
  "description": "The API Client's core client library. Works in NodeJS and in a ES enabled browser.",
4
- "version": "0.11.11",
4
+ "version": "0.12.1",
5
5
  "license": "Apache-2.0",
6
6
  "exports": {
7
7
  "./browser.js": {
@@ -49,15 +49,16 @@
49
49
  "url": "https://github.com/api-client/core/issues"
50
50
  },
51
51
  "dependencies": {
52
+ "@api-client/graph": "^0.3.5",
52
53
  "@api-client/json": "^0.2.0",
53
54
  "@esm-bundle/chai": "^4.3.4-fix.0",
54
- "@material/web": "^2.2.0",
55
55
  "@metrichor/jmespath": "^0.3.1",
56
56
  "@pawel-up/data-mock": "^0.3.2",
57
57
  "@pawel-up/jexl": "^3.0.0",
58
58
  "@xmldom/xmldom": "^0.9.7",
59
59
  "amf-json-ld-lib": "^0.0.15",
60
60
  "console-table-printer": "^2.11.2",
61
+ "nanoid": "^5.1.5",
61
62
  "ws": "^8.12.0",
62
63
  "xpath": "^0.0.34"
63
64
  },
@@ -107,8 +108,9 @@
107
108
  "wireit": "^0.14.4"
108
109
  },
109
110
  "scripts": {
110
- "build:test": "wireit",
111
+ "build:browser": "wireit",
111
112
  "build:ts": "wireit",
113
+ "build:node": "wireit",
112
114
  "build": "npm run build:ts && npm run lint && npm run copy:assets",
113
115
  "lint": "wireit",
114
116
  "lint:old": "tsc --noEmit && eslint \"**/*.{js,ts}\" --quiet --fix",
@@ -125,8 +127,7 @@
125
127
  "test:node:watch": "node --import ts-node-maintained/register/esm --enable-source-maps bin/test.ts --watch",
126
128
  "build:api-models": "node data/model.js",
127
129
  "copy:assets": "cp -f ./oauth-popup.html ./build/oauth-popup.html",
128
- "start": "echo \"Use the npm run dev instead\"",
129
- "dev": "node --import ts-node-maintained/register/esm --enable-source-maps bin/dev.ts --watch"
130
+ "start": "echo \"Use the npm run dev instead\""
130
131
  },
131
132
  "wireit": {
132
133
  "test": {
@@ -183,7 +184,7 @@
183
184
  ".tsbuildinfo"
184
185
  ]
185
186
  },
186
- "build:test": {
187
+ "build:browser": {
187
188
  "command": "tsc --project tsconfig.browser.json",
188
189
  "clean": "if-file-deleted",
189
190
  "files": [
@@ -196,6 +197,19 @@
196
197
  ".tsbuildinfo"
197
198
  ]
198
199
  },
200
+ "build:node": {
201
+ "command": "tsc --project tsconfig.node.json",
202
+ "clean": "if-file-deleted",
203
+ "files": [
204
+ "src/**/*.ts",
205
+ "tests/**/*.ts",
206
+ "tsconfig.node.json"
207
+ ],
208
+ "output": [
209
+ ".tmp/node/**",
210
+ ".tsbuildinfo"
211
+ ]
212
+ },
199
213
  "lint": {
200
214
  "command": "eslint --color --cache --cache-location .eslintcache .",
201
215
  "files": [
package/readme.md CHANGED
@@ -54,7 +54,7 @@ Tasks planned for the future releases.
54
54
 
55
55
  WTC can't work in watch mode with Typescript projects with `concurently`. Because of that, we need two processes running:
56
56
 
57
- - `npm run build:test:watch` to start TSC for tests in the watch mode.
57
+ - `npm run build:watch` to start TSC for tests in the watch mode.
58
58
  - `npm run test:watch-only` to start the WTR process.
59
59
 
60
60
  It has a downside of not seeing both outputs at the same time so make sure you check the TSC output for errors.
@@ -1,7 +1,7 @@
1
1
  import { type PropertyWebBindings } from '../modeling/Bindings.js'
2
- import { DataAssociation } from '../modeling/DataAssociation.js'
3
- import { DataEntity } from '../modeling/DataEntity.js'
4
- import { DataProperty, type DataPropertySchema } from '../modeling/DataProperty.js'
2
+ import { DataAssociation } from '../modeling/legacy/DataAssociation.js'
3
+ import { DataEntity } from '../modeling/legacy/DataEntity.js'
4
+ import { DataProperty, type DataPropertySchema } from '../modeling/legacy/DataProperty.js'
5
5
  import { IAmfExampleTypes, modelTypeToAmfDataType } from './AmfTypes.js'
6
6
  import { AmfNamespace } from './definitions/Namespace.js'
7
7
  import {
@@ -25,7 +25,7 @@ import {
25
25
  unionShape,
26
26
  } from './definitions/Shapes.js'
27
27
  import { AmfDataNode } from './models/AmfDataNode.js'
28
- import v4 from '../lib/uuid.js'
28
+ import { nanoid } from 'nanoid'
29
29
  import { DataEntityKind, DataPropertyKind } from '../models/kinds.js'
30
30
  import { DataValueGenerator } from './DataValueGenerator.js'
31
31
 
@@ -34,6 +34,9 @@ import { DataValueGenerator } from './DataValueGenerator.js'
34
34
  *
35
35
  * This is used when defining entities (according to the `DataEntity` schema)
36
36
  * and then we want to translate this into AMF shapes.
37
+ *
38
+ * @deprecated This class refers to the deprecated old data domain model.
39
+ * Use the `ShapeGenerator` with the new domain model.
37
40
  */
38
41
  export class AmfShapeGenerator {
39
42
  #valueGenerator?: DataValueGenerator
@@ -253,7 +256,7 @@ export class AmfShapeGenerator {
253
256
  const { value } = schema.defaultValue
254
257
  if (dfFormat === 'function') {
255
258
  const tmp = this.valueGenerator.generate(value, input.type)
256
- if (tmp !== DataValueGenerator.novalue) {
259
+ if (tmp !== DataValueGenerator.noValue) {
257
260
  const dt = AmfDataNode.scalar(tmp as string, dfFormat)
258
261
  result.defaultValue = dt.toJSON()
259
262
  }
@@ -315,7 +318,7 @@ export class AmfShapeGenerator {
315
318
  return examples.map((current) => {
316
319
  const value = AmfDataNode.scalar(current, type).toJSON()
317
320
  const item: IApiDataExample = {
318
- id: v4(),
321
+ id: nanoid(),
319
322
  customDomainProperties: [],
320
323
  strict: true,
321
324
  types: IAmfExampleTypes,
@@ -327,7 +330,7 @@ export class AmfShapeGenerator {
327
330
 
328
331
  protected _generateArrayExamples(examples: string[], type: string): IApiDataExample[] {
329
332
  const item: IApiDataExample = {
330
- id: v4(),
333
+ id: nanoid(),
331
334
  customDomainProperties: [],
332
335
  strict: true,
333
336
  types: IAmfExampleTypes,
@@ -1,4 +1,4 @@
1
- import { type DataPropertyType } from '../modeling/DataFormat.js'
1
+ import { type DomainPropertyType } from '../modeling/DataFormat.js'
2
2
  import { PropertyWebBindings } from '../modeling/Bindings.js'
3
3
  import { AmfNamespace } from './definitions/Namespace.js'
4
4
 
@@ -107,7 +107,7 @@ export const IAmfExampleTypes = [
107
107
  * @param type The property data type
108
108
  * @returns AMF shape dataType
109
109
  */
110
- export function modelTypeToAmfDataType(type: DataPropertyType, bindings?: PropertyWebBindings): string {
110
+ export function modelTypeToAmfDataType(type: DomainPropertyType, bindings?: PropertyWebBindings): string {
111
111
  if (type === 'number') {
112
112
  if (bindings?.format === 'int32' || bindings?.format === 'int64') {
113
113
  return AmfNamespace.w3.xmlSchema.integer
@@ -1,8 +1,8 @@
1
+ import { nanoid } from 'nanoid'
1
2
  import uuidV4 from '../lib/uuid.js'
2
- import { randomString } from '../lib/math/Random.js'
3
- import { DataPropertyType } from '../modeling/DataFormat.js'
3
+ import { DomainPropertyType } from '../modeling/DataFormat.js'
4
4
 
5
- export const novalue = Symbol('novalue')
5
+ export const noValue = Symbol('noValue')
6
6
 
7
7
  /**
8
8
  * A class to be used for generating values from pre-defined functions.
@@ -18,15 +18,15 @@ export class DataValueGenerator {
18
18
  * A symbol representing the absence of a value.
19
19
  * Used as a return value when a function cannot generate a value of the requested type.
20
20
  */
21
- static readonly novalue = novalue
21
+ static readonly noValue = noValue
22
22
 
23
23
  /**
24
24
  * Generates a value based on the provided function name and data type.
25
25
  * @param fn The name of the function to use for value generation (e.g., 'random', 'uuid-v4', 'incremental').
26
26
  * @param type The data type of the value to generate (e.g., 'string', 'number', 'date', 'time', 'datetime').
27
- * @returns The generated value, or the `novalue` symbol if the function or type is not supported.
27
+ * @returns The generated value, or the `noValue` symbol if the function or type is not supported.
28
28
  */
29
- generate(fn: string, type: DataPropertyType): string | typeof novalue {
29
+ generate(fn: string, type: DomainPropertyType): string | typeof noValue {
30
30
  if (type === 'string') {
31
31
  return this.generateString(fn)
32
32
  }
@@ -42,36 +42,37 @@ export class DataValueGenerator {
42
42
  if (type === 'datetime') {
43
43
  return this.generateDateTime(fn)
44
44
  }
45
- return novalue
45
+ return noValue
46
46
  }
47
47
 
48
48
  /**
49
49
  * Generates a string value based on the function name.
50
50
  * @param fn The name of the string generation function.
51
- * @returns The generated string value, or `novalue` if the function is not supported.
51
+ * @returns The generated string value, or `noValue` if the function is not supported.
52
52
  */
53
- protected generateString(fn: string): string | typeof novalue {
53
+ protected generateString(fn: string): string | typeof noValue {
54
54
  switch (fn) {
55
55
  case 'random':
56
- return randomString(8)
56
+ // TODO: we need more settings controlling the random string generation.
57
+ return nanoid(8)
57
58
  case 'uuid-v4':
58
59
  return uuidV4()
59
60
  default:
60
- return novalue
61
+ return noValue
61
62
  }
62
63
  }
63
64
 
64
65
  /**
65
66
  * Generates a number value based on the function name.
66
67
  * @param fn The name of the number generation function.
67
- * @returns The generated number value (as a string), or `novalue` if the function is not supported.
68
+ * @returns The generated number value (as a string), or `noValue` if the function is not supported.
68
69
  */
69
- protected generateNumber(fn: string): string | typeof novalue {
70
+ protected generateNumber(fn: string): string | typeof noValue {
70
71
  switch (fn) {
71
72
  case 'incremental':
72
73
  return `${this.increment++}`
73
74
  default:
74
- return novalue
75
+ return noValue
75
76
  }
76
77
  }
77
78
 
@@ -79,9 +80,9 @@ export class DataValueGenerator {
79
80
  * Generates a date value based on the function name.
80
81
  * @param fn The name of the date generation function.
81
82
  * @returns The generated date value (as a string in YYYY-MM-DD format),
82
- * or `novalue` if the function is not supported.
83
+ * or `noValue` if the function is not supported.
83
84
  */
84
- protected generateDate(fn: string): string | typeof novalue {
85
+ protected generateDate(fn: string): string | typeof noValue {
85
86
  if (fn === 'now') {
86
87
  // Returns YYYY-MM-DD
87
88
  // @TODO: Replace with Temporal when widely available.
@@ -91,15 +92,15 @@ export class DataValueGenerator {
91
92
  const day = `${d.getDate()}`.padStart(2, '0')
92
93
  return `${year}-${month}-${day}`
93
94
  }
94
- return novalue
95
+ return noValue
95
96
  }
96
97
 
97
98
  /**
98
99
  * Generates a time value based on the function name.
99
100
  * @param fn The name of the time generation function.
100
- * @returns The generated time value (as a string in HH:mm:ss format), or `novalue` if the function is not supported.
101
+ * @returns The generated time value (as a string in HH:mm:ss format), or `noValue` if the function is not supported.
101
102
  */
102
- protected generateTime(fn: string): string | typeof novalue {
103
+ protected generateTime(fn: string): string | typeof noValue {
103
104
  if (fn === 'now') {
104
105
  // Returns HH:mm:ss
105
106
  // @TODO: Replace with Temporal when widely available.
@@ -109,16 +110,16 @@ export class DataValueGenerator {
109
110
  const second = `${d.getSeconds()}`.padStart(2, '0')
110
111
  return `${hour}:${minute}:${second}`
111
112
  }
112
- return novalue
113
+ return noValue
113
114
  }
114
115
 
115
116
  /**
116
117
  * Generates a datetime value based on the function name.
117
118
  * @param fn The name of the datetime generation function.
118
119
  * @returns The generated datetime value (as a string in YYYY-MM-DDTHH:mm:ss format),
119
- * or `novalue` if the function is not supported.
120
+ * or `noValue` if the function is not supported.
120
121
  */
121
- protected generateDateTime(fn: string): string | typeof novalue {
122
+ protected generateDateTime(fn: string): string | typeof noValue {
122
123
  if (fn === 'now') {
123
124
  // Returns YYYY-MM-DDTHH:mm:ss
124
125
  // @TODO: Replace with Temporal when widely available.
@@ -131,6 +132,6 @@ export class DataValueGenerator {
131
132
  const second = `${d.getSeconds()}`.padStart(2, '0')
132
133
  return `${year}-${month}-${day}T${hour}:${minute}:${second}`
133
134
  }
134
- return novalue
135
+ return noValue
135
136
  }
136
137
  }
@@ -1,4 +1,4 @@
1
- import v4 from '../../lib/uuid.js'
1
+ import { nanoid } from 'nanoid'
2
2
  import { IAmfArrayNodeTypes, IAmfObjectNodeTypes, IAmfScalarNodeTypes } from '../AmfTypes.js'
3
3
  import { IApiCustomDomainProperty } from '../definitions/Base.js'
4
4
  import { AmfNamespace } from '../definitions/Namespace.js'
@@ -16,7 +16,7 @@ export type IDataNodeInit = 'scalar' | 'object' | 'array'
16
16
  * A class that manipulates the AMF's DataNode node.
17
17
  */
18
18
  export class AmfDataNode {
19
- id = v4()
19
+ id = nanoid()
20
20
 
21
21
  /**
22
22
  * AMF domain types.
@@ -0,0 +1,11 @@
1
+ import { Exception } from './exception.js'
2
+
3
+ /**
4
+ * A generic exception for attaching objects.
5
+ */
6
+ export class AttachException extends Exception {
7
+ static override code = 'E_ATTACH'
8
+ static override status = 500
9
+ static override message = 'Error attaching the object.'
10
+ static override help = 'Make sure you are attaching the right object.'
11
+ }
@@ -0,0 +1,11 @@
1
+ import { Exception } from './exception.js'
2
+
3
+ /**
4
+ * A generic exception for detaching objects.
5
+ */
6
+ export class DetachException extends Exception {
7
+ static override code = 'E_DETACH'
8
+ static override status = 500
9
+ static override message = 'Error detaching the object.'
10
+ static override help = 'Make sure you are detaching the right object.'
11
+ }
@@ -0,0 +1,8 @@
1
+ import { Exception } from './exception.js'
2
+
3
+ export class RemoveModelException extends Exception {
4
+ static override code = 'E_REMOVE_MODEL'
5
+ static override status = 500
6
+ static override message = 'Error removing a domain model.'
7
+ static override help = 'Make sure the model exists and can be removed.'
8
+ }
@@ -0,0 +1,8 @@
1
+ import { Exception } from './exception.js'
2
+
3
+ export class RemoveNamespaceException extends Exception {
4
+ static override code = 'E_REMOVE_NAMESPACE'
5
+ static override status = 500
6
+ static override message = 'Error removing a domain namespace.'
7
+ static override help = 'Make sure the namespace exists and can be removed.'
8
+ }
package/src/lib/uuid.ts CHANGED
@@ -8,7 +8,7 @@ for (let i = 0; i < 256; i++) {
8
8
  *
9
9
  * @see http://stackoverflow.com/a/21963136/1127848
10
10
  * @example "92329D39-6F5C-4520-ABFC-AAB64544E172"
11
- * @return {string} Generated value
11
+ * @return Generated value
12
12
  */
13
13
  export default function v4(): string {
14
14
  const d0 = (Math.random() * 0xffffffff) | 0
@@ -106,7 +106,7 @@ export class History {
106
106
  } else if (Array.isArray(init.user)) {
107
107
  result.user = this.random.pickOne(init.user)
108
108
  } else {
109
- result.user = this.types.uuid()
109
+ result.user = this.types.string(21)
110
110
  }
111
111
 
112
112
  if (typeof init.project === 'string') {
@@ -114,7 +114,7 @@ export class History {
114
114
  } else if (Array.isArray(init.project)) {
115
115
  result.project = this.random.pickOne(init.project)
116
116
  } else if (init.project) {
117
- result.project = this.types.uuid()
117
+ result.project = this.types.string(21)
118
118
  }
119
119
 
120
120
  if (typeof init.request === 'string') {
@@ -122,7 +122,7 @@ export class History {
122
122
  } else if (Array.isArray(init.request)) {
123
123
  result.request = this.random.pickOne(init.request)
124
124
  } else if (init.request) {
125
- result.request = this.types.uuid()
125
+ result.request = this.types.string(21)
126
126
  }
127
127
 
128
128
  if (typeof init.app === 'string') {
@@ -130,7 +130,7 @@ export class History {
130
130
  } else if (Array.isArray(init.app)) {
131
131
  result.app = this.random.pickOne(init.app)
132
132
  } else if (init.app) {
133
- result.app = this.types.uuid()
133
+ result.app = this.types.string(21)
134
134
  }
135
135
  return result
136
136
  }
@@ -141,7 +141,7 @@ export class History {
141
141
  if (usersSize && typeof init.user === 'undefined') {
142
142
  const users: string[] = []
143
143
  for (let i = 0; i < usersSize; i++) {
144
- users.push(this.types.uuid())
144
+ users.push(this.types.string(21))
145
145
  }
146
146
  copy.user = users
147
147
  }
@@ -155,21 +155,21 @@ export class History {
155
155
  if (projectsSize && typeof init.project === 'undefined') {
156
156
  const project: string[] = []
157
157
  for (let i = 0; i < projectsSize; i++) {
158
- project.push(this.types.uuid())
158
+ project.push(this.types.string(21))
159
159
  }
160
160
  copy.project = project
161
161
  }
162
162
  if (requestsSize && typeof init.request === 'undefined') {
163
163
  const requests: string[] = []
164
164
  for (let i = 0; i < requestsSize; i++) {
165
- requests.push(this.types.uuid())
165
+ requests.push(this.types.string(21))
166
166
  }
167
167
  copy.request = requests
168
168
  }
169
169
  if (appsSize && typeof init.app === 'undefined') {
170
170
  const apps: string[] = []
171
171
  for (let i = 0; i < appsSize; i++) {
172
- apps.push(this.types.uuid())
172
+ apps.push(this.types.string(21))
173
173
  }
174
174
  copy.app = apps
175
175
  }
@@ -17,7 +17,7 @@ export class HostRules {
17
17
  */
18
18
  rule(): IHostRule {
19
19
  const result: IHostRule = {
20
- key: this.types.uuid(),
20
+ key: this.types.string(21),
21
21
  from: this.internet.uri(),
22
22
  to: this.internet.uri(),
23
23
  enabled: this.types.boolean(),
@@ -23,7 +23,7 @@ export class User {
23
23
  user(init: IUserInit = {}): IUser {
24
24
  const result: IUser = {
25
25
  kind: UserKind,
26
- key: this.types.uuid(),
26
+ key: this.types.string(21),
27
27
  name: this.person.name(),
28
28
  }
29
29
  if (!init.noEmail) {
@@ -41,7 +41,7 @@ export class User {
41
41
  }
42
42
  if (!init.noProvider) {
43
43
  result.provider = {
44
- refreshToken: this.types.uuid(),
44
+ refreshToken: this.types.string(21),
45
45
  }
46
46
  }
47
47
  return result
@@ -1,5 +1,5 @@
1
1
  import { IApiXmlSerializer } from '../amf/definitions/Shapes.js'
2
- import { DataPropertyFormat } from './DataFormat.js'
2
+ import { DomainPropertyFormat } from './DataFormat.js'
3
3
 
4
4
  interface Binding {
5
5
  /**
@@ -61,7 +61,7 @@ export interface PropertyWebBindings {
61
61
  /**
62
62
  * The format specifying the property data type.
63
63
  */
64
- format?: DataPropertyFormat
64
+ format?: DomainPropertyFormat
65
65
  /**
66
66
  * When set it overrides the `name` of the property.
67
67
  */