@api-client/core 0.19.9 → 0.19.11

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 (523) hide show
  1. package/LICENSE.md +9 -63
  2. package/Testing.md +1 -1
  3. package/bin/test.ts +1 -12
  4. package/build/src/browser.d.ts +0 -15
  5. package/build/src/browser.d.ts.map +1 -1
  6. package/build/src/browser.js +0 -17
  7. package/build/src/browser.js.map +1 -1
  8. package/build/src/decorators/observed.d.ts.map +1 -1
  9. package/build/src/decorators/observed.js +91 -0
  10. package/build/src/decorators/observed.js.map +1 -1
  11. package/build/src/events/EventTypes.d.ts +0 -6
  12. package/build/src/events/EventTypes.d.ts.map +1 -1
  13. package/build/src/events/EventTypes.js +0 -2
  14. package/build/src/events/EventTypes.js.map +1 -1
  15. package/build/src/events/Events.d.ts +0 -2
  16. package/build/src/events/Events.d.ts.map +1 -1
  17. package/build/src/events/Events.js +0 -2
  18. package/build/src/events/Events.js.map +1 -1
  19. package/build/src/index.d.ts +0 -15
  20. package/build/src/index.d.ts.map +1 -1
  21. package/build/src/index.js +0 -17
  22. package/build/src/index.js.map +1 -1
  23. package/build/src/modeling/ApiModel.d.ts +21 -7
  24. package/build/src/modeling/ApiModel.d.ts.map +1 -1
  25. package/build/src/modeling/ApiModel.js +70 -29
  26. package/build/src/modeling/ApiModel.js.map +1 -1
  27. package/build/src/modeling/Bindings.d.ts +3 -3
  28. package/build/src/modeling/Bindings.d.ts.map +1 -1
  29. package/build/src/modeling/Bindings.js.map +1 -1
  30. package/build/src/modeling/DomainAssociation.d.ts +5 -5
  31. package/build/src/modeling/DomainAssociation.d.ts.map +1 -1
  32. package/build/src/modeling/DomainAssociation.js.map +1 -1
  33. package/build/src/modeling/DomainEntity.d.ts +2 -3
  34. package/build/src/modeling/DomainEntity.d.ts.map +1 -1
  35. package/build/src/modeling/DomainEntity.js +1 -1
  36. package/build/src/modeling/DomainEntity.js.map +1 -1
  37. package/build/src/modeling/DomainProperty.d.ts +2 -3
  38. package/build/src/modeling/DomainProperty.d.ts.map +1 -1
  39. package/build/src/modeling/DomainProperty.js +1 -1
  40. package/build/src/modeling/DomainProperty.js.map +1 -1
  41. package/build/src/modeling/DomainValidation.d.ts +1 -1
  42. package/build/src/modeling/DomainValidation.d.ts.map +1 -1
  43. package/build/src/modeling/DomainValidation.js.map +1 -1
  44. package/build/src/modeling/ExposedEntity.d.ts +14 -0
  45. package/build/src/modeling/ExposedEntity.d.ts.map +1 -1
  46. package/build/src/modeling/ExposedEntity.js +59 -6
  47. package/build/src/modeling/ExposedEntity.js.map +1 -1
  48. package/build/src/modeling/actions/Action.d.ts +11 -1
  49. package/build/src/modeling/actions/Action.d.ts.map +1 -1
  50. package/build/src/modeling/actions/Action.js +21 -3
  51. package/build/src/modeling/actions/Action.js.map +1 -1
  52. package/build/src/modeling/actions/CreateAction.d.ts +2 -1
  53. package/build/src/modeling/actions/CreateAction.d.ts.map +1 -1
  54. package/build/src/modeling/actions/CreateAction.js +2 -2
  55. package/build/src/modeling/actions/CreateAction.js.map +1 -1
  56. package/build/src/modeling/actions/DeleteAction.d.ts +2 -1
  57. package/build/src/modeling/actions/DeleteAction.d.ts.map +1 -1
  58. package/build/src/modeling/actions/DeleteAction.js +2 -2
  59. package/build/src/modeling/actions/DeleteAction.js.map +1 -1
  60. package/build/src/modeling/actions/ListAction.d.ts +2 -1
  61. package/build/src/modeling/actions/ListAction.d.ts.map +1 -1
  62. package/build/src/modeling/actions/ListAction.js +2 -2
  63. package/build/src/modeling/actions/ListAction.js.map +1 -1
  64. package/build/src/modeling/actions/ReadAction.d.ts +2 -1
  65. package/build/src/modeling/actions/ReadAction.d.ts.map +1 -1
  66. package/build/src/modeling/actions/ReadAction.js +2 -2
  67. package/build/src/modeling/actions/ReadAction.js.map +1 -1
  68. package/build/src/modeling/actions/SearchAction.d.ts +2 -1
  69. package/build/src/modeling/actions/SearchAction.d.ts.map +1 -1
  70. package/build/src/modeling/actions/SearchAction.js +2 -2
  71. package/build/src/modeling/actions/SearchAction.js.map +1 -1
  72. package/build/src/modeling/actions/UpdateAction.d.ts +2 -1
  73. package/build/src/modeling/actions/UpdateAction.d.ts.map +1 -1
  74. package/build/src/modeling/actions/UpdateAction.js +2 -2
  75. package/build/src/modeling/actions/UpdateAction.js.map +1 -1
  76. package/build/src/modeling/actions/index.d.ts +2 -1
  77. package/build/src/modeling/actions/index.d.ts.map +1 -1
  78. package/build/src/modeling/actions/index.js +7 -7
  79. package/build/src/modeling/actions/index.js.map +1 -1
  80. package/build/src/modeling/ai/types.d.ts +2 -2
  81. package/build/src/modeling/ai/types.d.ts.map +1 -1
  82. package/build/src/modeling/ai/types.js.map +1 -1
  83. package/build/src/{amf → modeling/amf}/DataValueGenerator.d.ts +1 -1
  84. package/build/src/modeling/amf/DataValueGenerator.d.ts.map +1 -0
  85. package/build/src/{amf → modeling/amf}/DataValueGenerator.js +2 -3
  86. package/build/src/modeling/amf/DataValueGenerator.js.map +1 -0
  87. package/build/src/modeling/amf/ShapeGenerator.d.ts +20 -20
  88. package/build/src/modeling/amf/ShapeGenerator.d.ts.map +1 -1
  89. package/build/src/modeling/amf/ShapeGenerator.js +16 -18
  90. package/build/src/modeling/amf/ShapeGenerator.js.map +1 -1
  91. package/build/src/modeling/amf/core_types.d.ts +9 -0
  92. package/build/src/modeling/amf/core_types.d.ts.map +1 -0
  93. package/build/src/modeling/amf/core_types.js +45 -0
  94. package/build/src/modeling/amf/core_types.js.map +1 -0
  95. package/build/src/modeling/index.d.ts +1 -0
  96. package/build/src/modeling/index.d.ts.map +1 -1
  97. package/build/src/modeling/index.js +1 -0
  98. package/build/src/modeling/index.js.map +1 -1
  99. package/build/src/modeling/types.d.ts +67 -0
  100. package/build/src/modeling/types.d.ts.map +1 -1
  101. package/build/src/modeling/types.js.map +1 -1
  102. package/build/src/modeling/validation/api_model_rules.d.ts +15 -0
  103. package/build/src/modeling/validation/api_model_rules.d.ts.map +1 -0
  104. package/build/src/modeling/validation/api_model_rules.js +599 -0
  105. package/build/src/modeling/validation/api_model_rules.js.map +1 -0
  106. package/build/src/modeling/validation/association_validation.d.ts.map +1 -1
  107. package/build/src/modeling/validation/association_validation.js +1 -3
  108. package/build/src/modeling/validation/association_validation.js.map +1 -1
  109. package/build/src/models/http-flows/LegacyTranslator.js +1 -1
  110. package/build/src/models/http-flows/LegacyTranslator.js.map +1 -1
  111. package/build/src/runtime/http-runner/HttpFlows.js +1 -1
  112. package/build/src/runtime/http-runner/HttpFlows.js.map +1 -1
  113. package/build/tsconfig.tsbuildinfo +1 -1
  114. package/eslint.config.js +0 -2
  115. package/package.json +27 -135
  116. package/src/decorators/observed.ts +91 -0
  117. package/src/events/EventTypes.ts +0 -2
  118. package/src/events/Events.ts +0 -2
  119. package/src/modeling/ApiModel.ts +73 -33
  120. package/src/modeling/Bindings.ts +3 -3
  121. package/src/modeling/DomainAssociation.ts +5 -5
  122. package/src/modeling/DomainEntity.ts +3 -4
  123. package/src/modeling/DomainProperty.ts +3 -4
  124. package/src/modeling/DomainValidation.ts +1 -1
  125. package/src/modeling/ExposedEntity.ts +63 -9
  126. package/src/modeling/actions/Action.ts +25 -2
  127. package/src/modeling/actions/CreateAction.ts +3 -2
  128. package/src/modeling/actions/DeleteAction.ts +3 -2
  129. package/src/modeling/actions/ListAction.ts +3 -2
  130. package/src/modeling/actions/ReadAction.ts +3 -2
  131. package/src/modeling/actions/SearchAction.ts +3 -2
  132. package/src/modeling/actions/UpdateAction.ts +3 -2
  133. package/src/modeling/ai/types.ts +2 -2
  134. package/src/{amf → modeling/amf}/DataValueGenerator.ts +3 -4
  135. package/src/modeling/amf/ShapeGenerator.ts +45 -61
  136. package/src/modeling/amf/core_types.ts +47 -0
  137. package/src/modeling/types.ts +70 -0
  138. package/src/modeling/validation/api_model_rules.ts +640 -0
  139. package/src/modeling/validation/api_model_validation_rules.md +58 -0
  140. package/src/modeling/validation/association_validation.ts +1 -3
  141. package/src/models/http-flows/LegacyTranslator.ts +1 -1
  142. package/src/runtime/http-runner/HttpFlows.ts +1 -1
  143. package/tests/unit/modeling/actions/Action.spec.ts +40 -8
  144. package/tests/unit/modeling/actions/CreateAction.spec.ts +5 -5
  145. package/tests/unit/modeling/actions/DeleteAction.spec.ts +6 -6
  146. package/tests/unit/modeling/actions/ListAction.spec.ts +7 -7
  147. package/tests/unit/modeling/actions/ReadAction.spec.ts +6 -6
  148. package/tests/unit/modeling/actions/SearchAction.spec.ts +6 -6
  149. package/tests/unit/modeling/actions/UpdateAction.spec.ts +6 -6
  150. package/tests/unit/{amf → modeling/amf}/data_value_generator.spec.ts +2 -2
  151. package/tests/unit/modeling/amf/shape_generator.spec.ts +146 -167
  152. package/tests/unit/modeling/api_model.spec.ts +190 -13
  153. package/tests/unit/modeling/api_model_expose_entity.spec.ts +43 -19
  154. package/tests/unit/modeling/api_model_remove_entity.spec.ts +6 -6
  155. package/tests/unit/modeling/domain_asociation.spec.ts +13 -13
  156. package/tests/unit/modeling/exposed_entity.spec.ts +123 -3
  157. package/tests/unit/modeling/exposed_entity_actions.spec.ts +41 -18
  158. package/tests/unit/modeling/exposed_entity_setter_validation.spec.ts +1 -1
  159. package/tests/unit/modeling/rules/restoring_rules.spec.ts +9 -5
  160. package/tests/unit/modeling/validation/api_model_rules.spec.ts +324 -0
  161. package/tests/unit/runtime/runners/http_assertion_runner.spec.ts +1 -1
  162. package/tests/unit/runtime/runners/http_flow_runner.spec.ts +1 -1
  163. package/tests/unit/runtime/runners/project_runner.spec.ts +1 -1
  164. package/tests/unit/runtime/runners/request_runner.spec.ts +1 -1
  165. package/tests/unit/runtime/runners/serial_runner.spec.ts +1 -1
  166. package/tsconfig.browser.json +1 -1
  167. package/tsconfig.node.json +1 -1
  168. package/bin/test-web.ts +0 -6
  169. package/build/src/amf/AmfMixin.d.ts +0 -396
  170. package/build/src/amf/AmfMixin.d.ts.map +0 -1
  171. package/build/src/amf/AmfMixin.js +0 -1138
  172. package/build/src/amf/AmfMixin.js.map +0 -1
  173. package/build/src/amf/AmfSerializer.d.ts +0 -137
  174. package/build/src/amf/AmfSerializer.d.ts.map +0 -1
  175. package/build/src/amf/AmfSerializer.js +0 -1947
  176. package/build/src/amf/AmfSerializer.js.map +0 -1
  177. package/build/src/amf/AmfTypes.d.ts +0 -25
  178. package/build/src/amf/AmfTypes.d.ts.map +0 -1
  179. package/build/src/amf/AmfTypes.js +0 -143
  180. package/build/src/amf/AmfTypes.js.map +0 -1
  181. package/build/src/amf/ApiExampleGenerator.d.ts +0 -40
  182. package/build/src/amf/ApiExampleGenerator.d.ts.map +0 -1
  183. package/build/src/amf/ApiExampleGenerator.js +0 -112
  184. package/build/src/amf/ApiExampleGenerator.js.map +0 -1
  185. package/build/src/amf/ApiMonacoSchemaGenerator.d.ts +0 -68
  186. package/build/src/amf/ApiMonacoSchemaGenerator.d.ts.map +0 -1
  187. package/build/src/amf/ApiMonacoSchemaGenerator.js +0 -248
  188. package/build/src/amf/ApiMonacoSchemaGenerator.js.map +0 -1
  189. package/build/src/amf/ApiSchemaGenerator.d.ts +0 -56
  190. package/build/src/amf/ApiSchemaGenerator.d.ts.map +0 -1
  191. package/build/src/amf/ApiSchemaGenerator.js +0 -94
  192. package/build/src/amf/ApiSchemaGenerator.js.map +0 -1
  193. package/build/src/amf/ApiSchemaValues.d.ts +0 -111
  194. package/build/src/amf/ApiSchemaValues.d.ts.map +0 -1
  195. package/build/src/amf/ApiSchemaValues.js +0 -463
  196. package/build/src/amf/ApiSchemaValues.js.map +0 -1
  197. package/build/src/amf/DataValueGenerator.d.ts.map +0 -1
  198. package/build/src/amf/DataValueGenerator.js.map +0 -1
  199. package/build/src/amf/Parsing.d.ts +0 -48
  200. package/build/src/amf/Parsing.d.ts.map +0 -1
  201. package/build/src/amf/Parsing.js +0 -2
  202. package/build/src/amf/Parsing.js.map +0 -1
  203. package/build/src/amf/Utils.d.ts +0 -37
  204. package/build/src/amf/Utils.d.ts.map +0 -1
  205. package/build/src/amf/Utils.js +0 -169
  206. package/build/src/amf/Utils.js.map +0 -1
  207. package/build/src/amf/data-node/DataNodeBase.d.ts +0 -34
  208. package/build/src/amf/data-node/DataNodeBase.d.ts.map +0 -1
  209. package/build/src/amf/data-node/DataNodeBase.js +0 -77
  210. package/build/src/amf/data-node/DataNodeBase.js.map +0 -1
  211. package/build/src/amf/data-node/JsonDataNodeGenerator.d.ts +0 -15
  212. package/build/src/amf/data-node/JsonDataNodeGenerator.d.ts.map +0 -1
  213. package/build/src/amf/data-node/JsonDataNodeGenerator.js +0 -23
  214. package/build/src/amf/data-node/JsonDataNodeGenerator.js.map +0 -1
  215. package/build/src/amf/data-node/UrlEncodedDataNodeGenerator.d.ts +0 -14
  216. package/build/src/amf/data-node/UrlEncodedDataNodeGenerator.d.ts.map +0 -1
  217. package/build/src/amf/data-node/UrlEncodedDataNodeGenerator.js +0 -48
  218. package/build/src/amf/data-node/UrlEncodedDataNodeGenerator.js.map +0 -1
  219. package/build/src/amf/data-node/XmlDataNodeGenerator.d.ts +0 -22
  220. package/build/src/amf/data-node/XmlDataNodeGenerator.d.ts.map +0 -1
  221. package/build/src/amf/data-node/XmlDataNodeGenerator.js +0 -34
  222. package/build/src/amf/data-node/XmlDataNodeGenerator.js.map +0 -1
  223. package/build/src/amf/definitions/Amf.d.ts +0 -363
  224. package/build/src/amf/definitions/Amf.d.ts.map +0 -1
  225. package/build/src/amf/definitions/Amf.js +0 -3
  226. package/build/src/amf/definitions/Amf.js.map +0 -1
  227. package/build/src/amf/definitions/Api.d.ts +0 -383
  228. package/build/src/amf/definitions/Api.d.ts.map +0 -1
  229. package/build/src/amf/definitions/Api.js +0 -2
  230. package/build/src/amf/definitions/Api.js.map +0 -1
  231. package/build/src/amf/definitions/Base.d.ts +0 -12
  232. package/build/src/amf/definitions/Base.d.ts.map +0 -1
  233. package/build/src/amf/definitions/Base.js +0 -2
  234. package/build/src/amf/definitions/Base.js.map +0 -1
  235. package/build/src/amf/definitions/Namespace.d.ts +0 -327
  236. package/build/src/amf/definitions/Namespace.d.ts.map +0 -1
  237. package/build/src/amf/definitions/Namespace.js +0 -346
  238. package/build/src/amf/definitions/Namespace.js.map +0 -1
  239. package/build/src/amf/definitions/Shapes.d.ts +0 -312
  240. package/build/src/amf/definitions/Shapes.d.ts.map +0 -1
  241. package/build/src/amf/definitions/Shapes.js +0 -87
  242. package/build/src/amf/definitions/Shapes.js.map +0 -1
  243. package/build/src/amf/models/AmfDataNode.d.ts +0 -67
  244. package/build/src/amf/models/AmfDataNode.d.ts.map +0 -1
  245. package/build/src/amf/models/AmfDataNode.js +0 -192
  246. package/build/src/amf/models/AmfDataNode.js.map +0 -1
  247. package/build/src/amf/shape/ShapeBase.d.ts +0 -74
  248. package/build/src/amf/shape/ShapeBase.d.ts.map +0 -1
  249. package/build/src/amf/shape/ShapeBase.js +0 -93
  250. package/build/src/amf/shape/ShapeBase.js.map +0 -1
  251. package/build/src/amf/shape/ShapeJsonSchemaGenerator.d.ts +0 -47
  252. package/build/src/amf/shape/ShapeJsonSchemaGenerator.d.ts.map +0 -1
  253. package/build/src/amf/shape/ShapeJsonSchemaGenerator.js +0 -420
  254. package/build/src/amf/shape/ShapeJsonSchemaGenerator.js.map +0 -1
  255. package/build/src/amf/shape/ShapeXmlSchemaGenerator.d.ts +0 -85
  256. package/build/src/amf/shape/ShapeXmlSchemaGenerator.d.ts.map +0 -1
  257. package/build/src/amf/shape/ShapeXmlSchemaGenerator.js +0 -852
  258. package/build/src/amf/shape/ShapeXmlSchemaGenerator.js.map +0 -1
  259. package/build/src/events/amf/AmfEventTypes.d.ts +0 -7
  260. package/build/src/events/amf/AmfEventTypes.d.ts.map +0 -1
  261. package/build/src/events/amf/AmfEventTypes.js +0 -7
  262. package/build/src/events/amf/AmfEventTypes.js.map +0 -1
  263. package/build/src/events/amf/AmfEvents.d.ts +0 -34
  264. package/build/src/events/amf/AmfEvents.d.ts.map +0 -1
  265. package/build/src/events/amf/AmfEvents.js +0 -63
  266. package/build/src/events/amf/AmfEvents.js.map +0 -1
  267. package/build/src/mocking/RandExp.d.ts +0 -55
  268. package/build/src/mocking/RandExp.d.ts.map +0 -1
  269. package/build/src/mocking/RandExp.js +0 -302
  270. package/build/src/mocking/RandExp.js.map +0 -1
  271. package/build/src/mocking/lib/ret.d.ts +0 -16
  272. package/build/src/mocking/lib/ret.d.ts.map +0 -1
  273. package/build/src/mocking/lib/ret.js +0 -284
  274. package/build/src/mocking/lib/ret.js.map +0 -1
  275. package/data/apis/APIC-187/APIC-187.raml +0 -21
  276. package/data/apis/APIC-187/dataType.raml +0 -132
  277. package/data/apis/APIC-187/example.raml +0 -84
  278. package/data/apis/APIC-188/APIC-188.raml +0 -21
  279. package/data/apis/APIC-188/dataType.raml +0 -132
  280. package/data/apis/APIC-188/example.raml +0 -84
  281. package/data/apis/APIC-233/APIC-233.raml +0 -15
  282. package/data/apis/APIC-391/APIC-391.raml +0 -44
  283. package/data/apis/APIC-391/examples/post-body-request-example.raml +0 -7
  284. package/data/apis/APIC-483/APIC-483.raml +0 -16
  285. package/data/apis/APIC-483/example/list-of-bank-succ.json +0 -32
  286. package/data/apis/APIC-483/schema/response-retrieve-list-bank.json +0 -68
  287. package/data/apis/APIC-487/APIC-487.raml +0 -36
  288. package/data/apis/APIC-655/APIC-655.raml +0 -44
  289. package/data/apis/APIC-655/delivery.json +0 -12
  290. package/data/apis/APIC-689/APIC-689.raml +0 -20
  291. package/data/apis/APIC-690/APIC-690.raml +0 -17
  292. package/data/apis/APIC-690/datatypes/Address.raml +0 -10
  293. package/data/apis/APIC-690/datatypes/Customer.raml +0 -17
  294. package/data/apis/APIC-690/examples/CustomerExample2.raml +0 -17
  295. package/data/apis/APIC-690/examples/CustomersExample.raml +0 -34
  296. package/data/apis/SE-10469/Purchase-Order-oagis-id-dd32f9c6c01048a19e15c423c9c741ae.json +0 -1383
  297. package/data/apis/SE-10469/SE-10469.raml +0 -11
  298. package/data/apis/SE-13092/Examples/PersonExample.raml +0 -7
  299. package/data/apis/SE-13092/SE-13092.raml +0 -37
  300. package/data/apis/SE-13092/datatypes/Address.raml +0 -5
  301. package/data/apis/SE-13092/datatypes/InlineType.raml +0 -5
  302. package/data/apis/SE-13092/datatypes/Person.raml +0 -15
  303. package/data/apis/SE-22063/SE-22063.raml +0 -14
  304. package/data/apis/SE-22063/stock.raml +0 -41
  305. package/data/apis/amf-helper-api/amf-helper-api.raml +0 -1024
  306. package/data/apis/amf-helper-api/examples/comment-example.json +0 -42
  307. package/data/apis/amf-helper-api/examples/commentCreateRequest-example.json +0 -7
  308. package/data/apis/amf-helper-api/examples/commentList-example.json +0 -48
  309. package/data/apis/amf-helper-api/examples/person.json +0 -14
  310. package/data/apis/amf-helper-api/examples/person.raml +0 -13
  311. package/data/apis/amf-helper-api/examples/person.xml +0 -14
  312. package/data/apis/amf-helper-api/libraries/comment-lib.raml +0 -143
  313. package/data/apis/amf-helper-api/library.raml +0 -7
  314. package/data/apis/amf-helper-api/schemas/person.json +0 -104
  315. package/data/apis/amf-helper-api/schemas/person.xsd +0 -26
  316. package/data/apis/amf-helper-api/traits/file.raml +0 -33
  317. package/data/apis/amf-helper-api/traits/pagination.raml +0 -80
  318. package/data/apis/amf-helper-api/traits/results.raml +0 -19
  319. package/data/apis/amf-helper-api/traits/visibility.raml +0 -14
  320. package/data/apis/amf-helper-api/types/app-person.raml +0 -101
  321. package/data/apis/amf-helper-api/types/dimensions.raml +0 -24
  322. package/data/apis/amf-helper-api/types/external-type.raml +0 -7
  323. package/data/apis/amf-helper-api/types/image.raml +0 -23
  324. package/data/apis/amf-helper-api/types/product.raml +0 -52
  325. package/data/apis/amf-helper-api/types/resource.raml +0 -11
  326. package/data/apis/amf-helper-api/types/standard-request.raml +0 -50
  327. package/data/apis/amf-helper-api/types/user.raml +0 -37
  328. package/data/apis/arc-demo-api/arc-demo-api.raml +0 -468
  329. package/data/apis/arc-demo-api/examples/e400.xml +0 -4
  330. package/data/apis/arc-demo-api/examples/e401.xml +0 -4
  331. package/data/apis/arc-demo-api/examples/e404.xml +0 -4
  332. package/data/apis/arc-demo-api/examples/image.xml +0 -5
  333. package/data/apis/arc-demo-api/examples/messages-example.json +0 -22
  334. package/data/apis/arc-demo-api/examples/messages-sent-example.json +0 -15
  335. package/data/apis/arc-demo-api/examples/person.json +0 -14
  336. package/data/apis/arc-demo-api/examples/person.url.encoded +0 -1
  337. package/data/apis/arc-demo-api/examples/person.xml +0 -14
  338. package/data/apis/arc-demo-api/examples/product.xml +0 -9
  339. package/data/apis/arc-demo-api/library.raml +0 -36
  340. package/data/apis/arc-demo-api/resourceTypes/app-person.raml +0 -49
  341. package/data/apis/arc-demo-api/resourceTypes/example-types.raml +0 -45
  342. package/data/apis/arc-demo-api/resourceTypes/image.raml +0 -23
  343. package/data/apis/arc-demo-api/resourceTypes/message-sent-type.raml +0 -23
  344. package/data/apis/arc-demo-api/resourceTypes/message-type.raml +0 -33
  345. package/data/apis/arc-demo-api/resourceTypes/product.raml +0 -52
  346. package/data/apis/arc-demo-api/resourceTypes/resource.raml +0 -11
  347. package/data/apis/arc-demo-api/schemas/error-response.xsd +0 -11
  348. package/data/apis/arc-demo-api/schemas/image.xsd +0 -11
  349. package/data/apis/arc-demo-api/schemas/person.json +0 -104
  350. package/data/apis/arc-demo-api/schemas/person.xsd +0 -26
  351. package/data/apis/arc-demo-api/schemas/product.xsd +0 -17
  352. package/data/apis/arc-demo-api/securitySchemes/basic.raml +0 -5
  353. package/data/apis/arc-demo-api/securitySchemes/oauth_2_0.raml +0 -29
  354. package/data/apis/arc-demo-api/securitySchemes/x-custom.raml +0 -26
  355. package/data/apis/arc-demo-api/traits/adminable.raml +0 -23
  356. package/data/apis/arc-demo-api/traits/pagination.raml +0 -83
  357. package/data/apis/arc-demo-api/traits/rate-limited.raml +0 -9
  358. package/data/apis/async-api/async-api.yaml +0 -96
  359. package/data/apis/example-generator-api/contact-email-example.raml +0 -6
  360. package/data/apis/example-generator-api/contact-example.raml +0 -5
  361. package/data/apis/example-generator-api/contact-fax-example.raml +0 -5
  362. package/data/apis/example-generator-api/contact-website-example.raml +0 -2
  363. package/data/apis/example-generator-api/example-1.raml +0 -6
  364. package/data/apis/example-generator-api/example-2.raml +0 -9
  365. package/data/apis/example-generator-api/example-3.raml +0 -4
  366. package/data/apis/example-generator-api/example-4.raml +0 -2
  367. package/data/apis/example-generator-api/example-5.raml +0 -4
  368. package/data/apis/example-generator-api/example-6.raml +0 -2
  369. package/data/apis/example-generator-api/example-7.raml +0 -5
  370. package/data/apis/example-generator-api/example-generator-api.raml +0 -423
  371. package/data/apis/example-generator-api/example.json +0 -14
  372. package/data/apis/example-generator-api/example.xml +0 -15
  373. package/data/apis/example-generator-api/example.xsd +0 -26
  374. package/data/apis/example-generator-api/examples/employee.raml +0 -7
  375. package/data/apis/example-generator-api/examples/employees.raml +0 -7
  376. package/data/apis/example-generator-api/linked-named-example.raml +0 -21
  377. package/data/apis/example-generator-api/named-example-with-link.raml +0 -5
  378. package/data/apis/example-generator-api/named-example.raml +0 -9
  379. package/data/apis/example-generator-api/user-json-example.raml +0 -17
  380. package/data/apis/example-generator-api/user-raml-example.raml +0 -37
  381. package/data/apis/example-generator-api/user.json +0 -8
  382. package/data/apis/example-generator-api/user.raml +0 -18
  383. package/data/apis/example-generator-api/users-json-example.raml +0 -17
  384. package/data/apis/example-generator-api/users-raml-example.raml +0 -32
  385. package/data/apis/example-generator-api/users.json +0 -8
  386. package/data/apis/expanded-api/expanded-api.raml +0 -8
  387. package/data/apis/flattened-api/flattened-api.raml +0 -8
  388. package/data/apis/multiple-servers/multiple-servers.yaml +0 -112
  389. package/data/apis/oas-3-api/oas-3-api.yaml +0 -356
  390. package/data/apis/oas-date/oas-date.yaml +0 -28
  391. package/data/apis/oas-types/oas-types.yaml +0 -159
  392. package/data/apis/oas-unions/oas-unions.yaml +0 -75
  393. package/data/apis/petstore/petstore.yaml +0 -954
  394. package/data/apis/raml-date/raml-date.raml +0 -28
  395. package/data/apis/recursive/recursive.raml +0 -14
  396. package/data/apis/schema-api/examples/person.json +0 -14
  397. package/data/apis/schema-api/examples/person.raml +0 -14
  398. package/data/apis/schema-api/examples/person.url.encoded +0 -1
  399. package/data/apis/schema-api/examples/person.xml +0 -14
  400. package/data/apis/schema-api/library/demo-types.raml +0 -43
  401. package/data/apis/schema-api/schema-api.raml +0 -656
  402. package/data/apis/schema-api/schemas/person.json +0 -104
  403. package/data/apis/schema-api/schemas/person.xsd +0 -26
  404. package/data/apis/schema-api/types/DemoPerson.raml +0 -67
  405. package/data/apis/secured-api/oauth-2-custom-settings.raml +0 -143
  406. package/data/apis/secured-api/oauth2-header-delivery.raml +0 -13
  407. package/data/apis/secured-api/oauth2-no-delivery.raml +0 -8
  408. package/data/apis/secured-api/oauth2-no-grants.raml +0 -12
  409. package/data/apis/secured-api/oauth2-pkce.raml +0 -13
  410. package/data/apis/secured-api/oauth2-query-delivery.raml +0 -13
  411. package/data/apis/secured-api/oauth_1_0.raml +0 -8
  412. package/data/apis/secured-api/oauth_1_0_no-settings.raml +0 -3
  413. package/data/apis/secured-api/oauth_1_0_no-signature.raml +0 -7
  414. package/data/apis/secured-api/oauth_1_0_signature.raml +0 -8
  415. package/data/apis/secured-api/passthrough-querystring.raml +0 -16
  416. package/data/apis/secured-api/passthrough.raml +0 -24
  417. package/data/apis/secured-api/secured-api.raml +0 -231
  418. package/data/apis/secured-api/x-custom.raml +0 -33
  419. package/data/apis/secured-api/x-other.raml +0 -29
  420. package/data/apis/secured-api/x-query-string.raml +0 -16
  421. package/data/apis/tracked-examples/datatypes/employee.raml +0 -5
  422. package/data/apis/tracked-examples/examples/employee.raml +0 -4
  423. package/data/apis/tracked-examples/examples/employees.raml +0 -8
  424. package/data/apis/tracked-examples/tracked-to-linked.raml +0 -28
  425. package/data/model.js +0 -129
  426. package/data/models/APIC-187.json +0 -11416
  427. package/data/models/APIC-188.json +0 -11416
  428. package/data/models/APIC-233.json +0 -539
  429. package/data/models/APIC-391.json +0 -1903
  430. package/data/models/APIC-483.json +0 -3110
  431. package/data/models/APIC-487.json +0 -1225
  432. package/data/models/APIC-655.json +0 -3145
  433. package/data/models/APIC-689.json +0 -797
  434. package/data/models/APIC-690.json +0 -5992
  435. package/data/models/SE-10469.json +0 -22898
  436. package/data/models/SE-13092.json +0 -2769
  437. package/data/models/SE-22063.json +0 -2314
  438. package/data/models/amf-helper-api.json +0 -84457
  439. package/data/models/arc-demo-api.json +0 -52041
  440. package/data/models/async-api.json +0 -3227
  441. package/data/models/example-generator-api.json +0 -45209
  442. package/data/models/expanded-api.json +0 -251
  443. package/data/models/flattened-api.json +0 -251
  444. package/data/models/multiple-servers.json +0 -2769
  445. package/data/models/oas-3-api.json +0 -10590
  446. package/data/models/oas-date.json +0 -637
  447. package/data/models/oas-types.json +0 -5352
  448. package/data/models/oas-unions.json +0 -1935
  449. package/data/models/petstore.json +0 -27712
  450. package/data/models/raml-date.json +0 -1114
  451. package/data/models/recursive.json +0 -610
  452. package/data/models/schema-api.json +0 -35527
  453. package/data/models/secured-api.json +0 -21071
  454. package/data/models/tracked-to-linked.json +0 -1914
  455. package/src/amf/AmfMixin.ts +0 -1726
  456. package/src/amf/AmfSerializer.ts +0 -2358
  457. package/src/amf/AmfTypes.ts +0 -147
  458. package/src/amf/ApiExampleGenerator.ts +0 -122
  459. package/src/amf/ApiMonacoSchemaGenerator.ts +0 -332
  460. package/src/amf/ApiSchemaGenerator.ts +0 -115
  461. package/src/amf/ApiSchemaValues.ts +0 -509
  462. package/src/amf/Parsing.ts +0 -50
  463. package/src/amf/Utils.ts +0 -172
  464. package/src/amf/data-node/DataNodeBase.ts +0 -83
  465. package/src/amf/data-node/JsonDataNodeGenerator.ts +0 -24
  466. package/src/amf/data-node/README.md +0 -3
  467. package/src/amf/data-node/UrlEncodedDataNodeGenerator.ts +0 -49
  468. package/src/amf/data-node/XmlDataNodeGenerator.ts +0 -46
  469. package/src/amf/definitions/Amf.ts +0 -440
  470. package/src/amf/definitions/Api.ts +0 -445
  471. package/src/amf/definitions/Base.ts +0 -13
  472. package/src/amf/definitions/Namespace.ts +0 -357
  473. package/src/amf/definitions/Shapes.ts +0 -438
  474. package/src/amf/models/AmfDataNode.ts +0 -210
  475. package/src/amf/shape/README.md +0 -4
  476. package/src/amf/shape/ShapeBase.ts +0 -174
  477. package/src/amf/shape/ShapeJsonSchemaGenerator.ts +0 -457
  478. package/src/amf/shape/ShapeXmlSchemaGenerator.ts +0 -933
  479. package/src/events/amf/AmfEventTypes.ts +0 -6
  480. package/src/events/amf/AmfEvents.ts +0 -78
  481. package/src/mocking/RandExp.ts +0 -335
  482. package/src/mocking/lib/ret.ts +0 -279
  483. package/tests/unit/amf/APIC-187.spec.ts +0 -41
  484. package/tests/unit/amf/APIC-188.spec.ts +0 -30
  485. package/tests/unit/amf/APIC-233.spec.ts +0 -32
  486. package/tests/unit/amf/APIC-391.spec.ts +0 -39
  487. package/tests/unit/amf/APIC-487.spec.ts +0 -44
  488. package/tests/unit/amf/APIC-655.spec.ts +0 -41
  489. package/tests/unit/amf/APIC-689.spec.ts +0 -28
  490. package/tests/unit/amf/APIC-690.spec.ts +0 -93
  491. package/tests/unit/amf/AmfLoader.ts +0 -538
  492. package/tests/unit/amf/AmfMixin.spec.ts +0 -1707
  493. package/tests/unit/amf/ApiExampleGenerator.spec.ts +0 -250
  494. package/tests/unit/amf/ApiMonacoSchemaGenerator.spec.ts +0 -183
  495. package/tests/unit/amf/ApiSchemaValues.spec.ts +0 -602
  496. package/tests/unit/amf/Namepsace.spec.ts +0 -494
  497. package/tests/unit/amf/SE-10469.spec.ts +0 -35
  498. package/tests/unit/amf/SE-13092.spec.ts +0 -64
  499. package/tests/unit/amf/SE-22063.spec.ts +0 -45
  500. package/tests/unit/amf/raml-examples.spec.ts +0 -43
  501. package/tests/unit/amf/schema_gen_array.spec.ts +0 -199
  502. package/tests/unit/amf/schema_gen_oas.spec.ts +0 -140
  503. package/tests/unit/amf/schema_gen_object.spec.ts +0 -279
  504. package/tests/unit/amf/schema_gen_scalar.spec.ts +0 -143
  505. package/tests/unit/amf/schema_gen_union.spec.ts +0 -401
  506. package/tests/unit/amf/schema_gen_unknown.spec.ts +0 -42
  507. package/tests/unit/amf/schema_gen_xml.spec.ts +0 -726
  508. package/tests/unit/amf/serializer/APIC-483.spec.ts +0 -36
  509. package/tests/unit/amf/serializer/Anotations.spec.ts +0 -50
  510. package/tests/unit/amf/serializer/Api.spec.ts +0 -210
  511. package/tests/unit/amf/serializer/Documentation.spec.ts +0 -52
  512. package/tests/unit/amf/serializer/Endpoints.spec.ts +0 -172
  513. package/tests/unit/amf/serializer/Operations.spec.ts +0 -330
  514. package/tests/unit/amf/serializer/Parameters.spec.ts +0 -149
  515. package/tests/unit/amf/serializer/PayloadExamples.spec.ts +0 -152
  516. package/tests/unit/amf/serializer/Security.spec.ts +0 -626
  517. package/tests/unit/amf/serializer/Server.spec.ts +0 -78
  518. package/tests/unit/amf/serializer/Shapes.spec.ts +0 -304
  519. package/tests/unit/amf/serializer/SourceMaps.spec.ts +0 -52
  520. package/tests/unit/amf/shapes/ShapeXmlSchemaGenerator.spec.ts +0 -28
  521. package/tests/unit/amf/tracked-to-linked.spec.ts +0 -90
  522. package/tests/unit/amf/xml-data-processing.spec.ts +0 -217
  523. package/tests/unit/events/amf.spec.ts +0 -151
@@ -1 +1 @@
1
- {"version":3,"file":"SearchAction.js","sourceRoot":"","sources":["../../../../src/modeling/actions/SearchAction.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAqB,MAAM,aAAa,CAAA;AACvD,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,8BAA8B,CAAA;AAe9D;;;GAGG;IACU,YAAY;sBAAS,MAAM;;;;;;;iBAA3B,YAAa,SAAQ,WAAM;;;gCACrC,QAAQ,EAAE;kCACV,QAAQ,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;YADb,iKAAkB,IAAI,6BAAJ,IAAI,mFAAU;YAClB,uKAAS,MAAM,6BAAN,MAAM,uFAAU;;;QADvC,6EAAgC;QAAhC,IAAkB,IAAI,0CAAU;QAAhC,IAAkB,IAAI,gDAAU;QAClB,qIAAyB;QAAzB,IAAS,MAAM,4CAAU;QAAzB,IAAS,MAAM,kDAAU;QAEnD,YAAY,QAAqC,EAAE;YACjD,KAAK,CAAC,KAAK,CAAC,CAAA;;YACZ,IAAI,CAAC,IAAI,GAAG,QAAQ,CAAA;YACpB,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,CAAA;SACpD;QAEQ,MAAM;YACb,OAAO;gBACL,GAAI,KAAK,CAAC,MAAM,EAAyB;gBACzC,IAAI,EAAE,QAAQ;gBACd,MAAM,EAAE,eAAe,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,CAAa;aAC9D,CAAA;QACH,CAAC;QAED,MAAM,CAAC,oBAAoB,CAAC,MAAoB;YAC9C,OAAO,MAAM,CAAC,IAAI,KAAK,QAAQ,CAAA;QACjC,CAAC;QAED,MAAM,CAAC,cAAc,CAAC,MAAc;YAClC,OAAO,MAAM,CAAC,IAAI,KAAK,QAAQ,CAAA;QACjC,CAAC;;;SAxBU,YAAY","sourcesContent":["import { Action, type ActionSchema } from './Action.js'\nimport { observed, toRaw } from '../../decorators/observed.js'\n\n/**\n * Enables keyword-based search across specified fields.\n * Endpoint: GET /[entity-collection-name]/search\n */\nexport interface SearchActionSchema extends ActionSchema {\n kind: 'search'\n /**\n * The fields within the entity to be included in the search scope.\n * Must be \"indexable\" and typically text-based.\n */\n fields: string[]\n}\n\n/**\n * Enables keyword-based search across specified fields.\n * Endpoint: GET /[entity-collection-name]/search\n */\nexport class SearchAction extends Action implements SearchActionSchema {\n @observed() override accessor kind: 'search'\n @observed({ deep: true }) accessor fields: string[]\n\n constructor(state: Partial<SearchActionSchema> = {}) {\n super(state)\n this.kind = 'search'\n this.fields = state.fields ? [...state.fields] : []\n }\n\n override toJSON(): SearchActionSchema {\n return {\n ...(super.toJSON() as SearchActionSchema),\n kind: 'search',\n fields: structuredClone(toRaw(this, this.fields)) as string[],\n }\n }\n\n static isSearchActionSchema(schema: ActionSchema): schema is SearchActionSchema {\n return schema.kind === 'search'\n }\n\n static isSearchAction(action: Action): action is SearchAction {\n return action.kind === 'search'\n }\n}\n"]}
1
+ {"version":3,"file":"SearchAction.js","sourceRoot":"","sources":["../../../../src/modeling/actions/SearchAction.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAqB,MAAM,aAAa,CAAA;AACvD,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,8BAA8B,CAAA;AAgB9D;;;GAGG;IACU,YAAY;sBAAS,MAAM;;;;;;;iBAA3B,YAAa,SAAQ,WAAM;;;gCACrC,QAAQ,EAAE;kCACV,QAAQ,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;YADb,iKAAkB,IAAI,6BAAJ,IAAI,mFAAU;YAClB,uKAAS,MAAM,6BAAN,MAAM,uFAAU;;;QADvC,6EAAgC;QAAhC,IAAkB,IAAI,0CAAU;QAAhC,IAAkB,IAAI,gDAAU;QAClB,qIAAyB;QAAzB,IAAS,MAAM,4CAAU;QAAzB,IAAS,MAAM,kDAAU;QAEnD,YAAY,MAAqB,EAAE,QAAqC,EAAE;YACxE,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,CAAA;;YACpB,IAAI,CAAC,IAAI,GAAG,QAAQ,CAAA;YACpB,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,CAAA;SACpD;QAEQ,MAAM;YACb,OAAO;gBACL,GAAI,KAAK,CAAC,MAAM,EAAyB;gBACzC,IAAI,EAAE,QAAQ;gBACd,MAAM,EAAE,eAAe,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,CAAa;aAC9D,CAAA;QACH,CAAC;QAED,MAAM,CAAC,oBAAoB,CAAC,MAAoB;YAC9C,OAAO,MAAM,CAAC,IAAI,KAAK,QAAQ,CAAA;QACjC,CAAC;QAED,MAAM,CAAC,cAAc,CAAC,MAAc;YAClC,OAAO,MAAM,CAAC,IAAI,KAAK,QAAQ,CAAA;QACjC,CAAC;;;SAxBU,YAAY","sourcesContent":["import { Action, type ActionSchema } from './Action.js'\nimport { observed, toRaw } from '../../decorators/observed.js'\nimport type { ExposedEntity } from '../ExposedEntity.js'\n\n/**\n * Enables keyword-based search across specified fields.\n * Endpoint: GET /[entity-collection-name]/search\n */\nexport interface SearchActionSchema extends ActionSchema {\n kind: 'search'\n /**\n * The fields within the entity to be included in the search scope.\n * Must be \"indexable\" and typically text-based.\n */\n fields: string[]\n}\n\n/**\n * Enables keyword-based search across specified fields.\n * Endpoint: GET /[entity-collection-name]/search\n */\nexport class SearchAction extends Action implements SearchActionSchema {\n @observed() override accessor kind: 'search'\n @observed({ deep: true }) accessor fields: string[]\n\n constructor(parent: ExposedEntity, state: Partial<SearchActionSchema> = {}) {\n super(parent, state)\n this.kind = 'search'\n this.fields = state.fields ? [...state.fields] : []\n }\n\n override toJSON(): SearchActionSchema {\n return {\n ...(super.toJSON() as SearchActionSchema),\n kind: 'search',\n fields: structuredClone(toRaw(this, this.fields)) as string[],\n }\n }\n\n static isSearchActionSchema(schema: ActionSchema): schema is SearchActionSchema {\n return schema.kind === 'search'\n }\n\n static isSearchAction(action: Action): action is SearchAction {\n return action.kind === 'search'\n }\n}\n"]}
@@ -1,4 +1,5 @@
1
1
  import { Action, type ActionSchema } from './Action.js';
2
+ import type { ExposedEntity } from '../ExposedEntity.js';
2
3
  /**
3
4
  * Enables modifying an existing resource.
4
5
  * Endpoints: PUT or PATCH /[entity-collection-name]/{id}
@@ -21,7 +22,7 @@ export interface UpdateActionSchema extends ActionSchema {
21
22
  export declare class UpdateAction extends Action implements UpdateActionSchema {
22
23
  accessor kind: 'update';
23
24
  accessor allowedMethods: ('PUT' | 'PATCH')[];
24
- constructor(state?: Partial<UpdateActionSchema>);
25
+ constructor(parent: ExposedEntity, state?: Partial<UpdateActionSchema>);
25
26
  toJSON(): UpdateActionSchema;
26
27
  static isUpdateAction(action: Action): action is UpdateAction;
27
28
  static isUpdateActionSchema(schema: ActionSchema): schema is UpdateActionSchema;
@@ -1 +1 @@
1
- {"version":3,"file":"UpdateAction.d.ts","sourceRoot":"","sources":["../../../../src/modeling/actions/UpdateAction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,KAAK,YAAY,EAAE,MAAM,aAAa,CAAA;AAGvD;;;GAGG;AACH,MAAM,WAAW,kBAAmB,SAAQ,YAAY;IACtD,IAAI,EAAE,QAAQ,CAAA;IACd;;;;;;OAMG;IACH,cAAc,EAAE,CAAC,KAAK,GAAG,OAAO,CAAC,EAAE,CAAA;CACpC;AAED;;;GAGG;AACH,qBAAa,YAAa,SAAQ,MAAO,YAAW,kBAAkB;IACpE,SAA8B,IAAI,EAAE,QAAQ,CAAA;IAClB,QAAQ,CAAC,cAAc,EAAE,CAAC,KAAK,GAAG,OAAO,CAAC,EAAE,CAAA;gBAE1D,KAAK,GAAE,OAAO,CAAC,kBAAkB,CAAM;IAM1C,MAAM,IAAI,kBAAkB;IAQrC,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,IAAI,YAAY;IAI7D,MAAM,CAAC,oBAAoB,CAAC,MAAM,EAAE,YAAY,GAAG,MAAM,IAAI,kBAAkB;CAGhF"}
1
+ {"version":3,"file":"UpdateAction.d.ts","sourceRoot":"","sources":["../../../../src/modeling/actions/UpdateAction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,KAAK,YAAY,EAAE,MAAM,aAAa,CAAA;AAEvD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAExD;;;GAGG;AACH,MAAM,WAAW,kBAAmB,SAAQ,YAAY;IACtD,IAAI,EAAE,QAAQ,CAAA;IACd;;;;;;OAMG;IACH,cAAc,EAAE,CAAC,KAAK,GAAG,OAAO,CAAC,EAAE,CAAA;CACpC;AAED;;;GAGG;AACH,qBAAa,YAAa,SAAQ,MAAO,YAAW,kBAAkB;IACpE,SAA8B,IAAI,EAAE,QAAQ,CAAA;IAClB,QAAQ,CAAC,cAAc,EAAE,CAAC,KAAK,GAAG,OAAO,CAAC,EAAE,CAAA;gBAE1D,MAAM,EAAE,aAAa,EAAE,KAAK,GAAE,OAAO,CAAC,kBAAkB,CAAM;IAMjE,MAAM,IAAI,kBAAkB;IAQrC,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,IAAI,YAAY;IAI7D,MAAM,CAAC,oBAAoB,CAAC,MAAM,EAAE,YAAY,GAAG,MAAM,IAAI,kBAAkB;CAGhF"}
@@ -28,8 +28,8 @@ let UpdateAction = (() => {
28
28
  #allowedMethods_accessor_storage = (__runInitializers(this, _kind_extraInitializers), __runInitializers(this, _allowedMethods_initializers, void 0));
29
29
  get allowedMethods() { return this.#allowedMethods_accessor_storage; }
30
30
  set allowedMethods(value) { this.#allowedMethods_accessor_storage = value; }
31
- constructor(state = {}) {
32
- super(state);
31
+ constructor(parent, state = {}) {
32
+ super(parent, state);
33
33
  __runInitializers(this, _allowedMethods_extraInitializers);
34
34
  this.kind = 'update';
35
35
  this.allowedMethods = state.allowedMethods ? [...state.allowedMethods] : ['PATCH'];
@@ -1 +1 @@
1
- {"version":3,"file":"UpdateAction.js","sourceRoot":"","sources":["../../../../src/modeling/actions/UpdateAction.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAqB,MAAM,aAAa,CAAA;AACvD,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,8BAA8B,CAAA;AAkB9D;;;GAGG;IACU,YAAY;sBAAS,MAAM;;;;;;;iBAA3B,YAAa,SAAQ,WAAM;;;gCACrC,QAAQ,EAAE;0CACV,QAAQ,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;YADb,iKAAkB,IAAI,6BAAJ,IAAI,mFAAU;YAClB,+LAAS,cAAc,6BAAd,cAAc,uGAAqB;;;QAD1D,6EAAgC;QAAhC,IAAkB,IAAI,0CAAU;QAAhC,IAAkB,IAAI,gDAAU;QAClB,qJAA4C;QAA5C,IAAS,cAAc,oDAAqB;QAA5C,IAAS,cAAc,0DAAqB;QAEtE,YAAY,QAAqC,EAAE;YACjD,KAAK,CAAC,KAAK,CAAC,CAAA;;YACZ,IAAI,CAAC,IAAI,GAAG,QAAQ,CAAA;YACpB,IAAI,CAAC,cAAc,GAAG,KAAK,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAA;SACnF;QAEQ,MAAM;YACb,OAAO;gBACL,GAAI,KAAK,CAAC,MAAM,EAAyB;gBACzC,IAAI,EAAE,QAAQ;gBACd,cAAc,EAAE,eAAe,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,cAAc,CAAC,CAAwB;aACzF,CAAA;QACH,CAAC;QAED,MAAM,CAAC,cAAc,CAAC,MAAc;YAClC,OAAO,MAAM,CAAC,IAAI,KAAK,QAAQ,CAAA;QACjC,CAAC;QAED,MAAM,CAAC,oBAAoB,CAAC,MAAoB;YAC9C,OAAO,MAAM,CAAC,IAAI,KAAK,QAAQ,CAAA;QACjC,CAAC;;;SAxBU,YAAY","sourcesContent":["import { Action, type ActionSchema } from './Action.js'\nimport { observed, toRaw } from '../../decorators/observed.js'\n\n/**\n * Enables modifying an existing resource.\n * Endpoints: PUT or PATCH /[entity-collection-name]/{id}\n */\nexport interface UpdateActionSchema extends ActionSchema {\n kind: 'update'\n /**\n * The allowed HTTP methods for updates. Default: PATCH only.\n *\n * These two methods represent the two common ways to update a resource:\n * - PUT: Replaces the entire resource with the provided data.\n * - PATCH: Applies a partial update to the resource, allowing for specific fields to be modified.\n */\n allowedMethods: ('PUT' | 'PATCH')[]\n}\n\n/**\n * Enables modifying an existing resource.\n * Endpoints: PUT or PATCH /[entity-collection-name]/{id}\n */\nexport class UpdateAction extends Action implements UpdateActionSchema {\n @observed() override accessor kind: 'update'\n @observed({ deep: true }) accessor allowedMethods: ('PUT' | 'PATCH')[]\n\n constructor(state: Partial<UpdateActionSchema> = {}) {\n super(state)\n this.kind = 'update'\n this.allowedMethods = state.allowedMethods ? [...state.allowedMethods] : ['PATCH']\n }\n\n override toJSON(): UpdateActionSchema {\n return {\n ...(super.toJSON() as UpdateActionSchema),\n kind: 'update',\n allowedMethods: structuredClone(toRaw(this, this.allowedMethods)) as ('PUT' | 'PATCH')[],\n }\n }\n\n static isUpdateAction(action: Action): action is UpdateAction {\n return action.kind === 'update'\n }\n\n static isUpdateActionSchema(schema: ActionSchema): schema is UpdateActionSchema {\n return schema.kind === 'update'\n }\n}\n"]}
1
+ {"version":3,"file":"UpdateAction.js","sourceRoot":"","sources":["../../../../src/modeling/actions/UpdateAction.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAqB,MAAM,aAAa,CAAA;AACvD,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,8BAA8B,CAAA;AAmB9D;;;GAGG;IACU,YAAY;sBAAS,MAAM;;;;;;;iBAA3B,YAAa,SAAQ,WAAM;;;gCACrC,QAAQ,EAAE;0CACV,QAAQ,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;YADb,iKAAkB,IAAI,6BAAJ,IAAI,mFAAU;YAClB,+LAAS,cAAc,6BAAd,cAAc,uGAAqB;;;QAD1D,6EAAgC;QAAhC,IAAkB,IAAI,0CAAU;QAAhC,IAAkB,IAAI,gDAAU;QAClB,qJAA4C;QAA5C,IAAS,cAAc,oDAAqB;QAA5C,IAAS,cAAc,0DAAqB;QAEtE,YAAY,MAAqB,EAAE,QAAqC,EAAE;YACxE,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,CAAA;;YACpB,IAAI,CAAC,IAAI,GAAG,QAAQ,CAAA;YACpB,IAAI,CAAC,cAAc,GAAG,KAAK,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAA;SACnF;QAEQ,MAAM;YACb,OAAO;gBACL,GAAI,KAAK,CAAC,MAAM,EAAyB;gBACzC,IAAI,EAAE,QAAQ;gBACd,cAAc,EAAE,eAAe,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,cAAc,CAAC,CAAwB;aACzF,CAAA;QACH,CAAC;QAED,MAAM,CAAC,cAAc,CAAC,MAAc;YAClC,OAAO,MAAM,CAAC,IAAI,KAAK,QAAQ,CAAA;QACjC,CAAC;QAED,MAAM,CAAC,oBAAoB,CAAC,MAAoB;YAC9C,OAAO,MAAM,CAAC,IAAI,KAAK,QAAQ,CAAA;QACjC,CAAC;;;SAxBU,YAAY","sourcesContent":["import { Action, type ActionSchema } from './Action.js'\nimport { observed, toRaw } from '../../decorators/observed.js'\nimport type { ExposedEntity } from '../ExposedEntity.js'\n\n/**\n * Enables modifying an existing resource.\n * Endpoints: PUT or PATCH /[entity-collection-name]/{id}\n */\nexport interface UpdateActionSchema extends ActionSchema {\n kind: 'update'\n /**\n * The allowed HTTP methods for updates. Default: PATCH only.\n *\n * These two methods represent the two common ways to update a resource:\n * - PUT: Replaces the entire resource with the provided data.\n * - PATCH: Applies a partial update to the resource, allowing for specific fields to be modified.\n */\n allowedMethods: ('PUT' | 'PATCH')[]\n}\n\n/**\n * Enables modifying an existing resource.\n * Endpoints: PUT or PATCH /[entity-collection-name]/{id}\n */\nexport class UpdateAction extends Action implements UpdateActionSchema {\n @observed() override accessor kind: 'update'\n @observed({ deep: true }) accessor allowedMethods: ('PUT' | 'PATCH')[]\n\n constructor(parent: ExposedEntity, state: Partial<UpdateActionSchema> = {}) {\n super(parent, state)\n this.kind = 'update'\n this.allowedMethods = state.allowedMethods ? [...state.allowedMethods] : ['PATCH']\n }\n\n override toJSON(): UpdateActionSchema {\n return {\n ...(super.toJSON() as UpdateActionSchema),\n kind: 'update',\n allowedMethods: structuredClone(toRaw(this, this.allowedMethods)) as ('PUT' | 'PATCH')[],\n }\n }\n\n static isUpdateAction(action: Action): action is UpdateAction {\n return action.kind === 'update'\n }\n\n static isUpdateActionSchema(schema: ActionSchema): schema is UpdateActionSchema {\n return schema.kind === 'update'\n }\n}\n"]}
@@ -6,6 +6,7 @@ import { ReadAction, type ReadActionSchema } from './ReadAction.js';
6
6
  import { SearchAction, type SearchActionSchema } from './SearchAction.js';
7
7
  import { UpdateAction, type UpdateActionSchema } from './UpdateAction.js';
8
8
  import type { ActionSchema } from './Action.js';
9
+ import type { ExposedEntity } from '../ExposedEntity.js';
9
10
  export { CreateAction, DeleteAction, ListAction, ReadAction, SearchAction, UpdateAction };
10
11
  export type { CreateActionSchema, DeleteActionSchema, ListActionSchema, ReadActionSchema, SearchActionSchema, UpdateActionSchema, };
11
12
  /**
@@ -30,5 +31,5 @@ export type ActionKind = 'list' | 'read' | 'create' | 'update' | 'delete' | 'sea
30
31
  * @param schema The schema to restore the action from.
31
32
  * @returns The restored action.
32
33
  */
33
- export declare function restoreAction(schema: ActionSchema): ApiAction;
34
+ export declare function restoreAction(parent: ExposedEntity, schema: ActionSchema): ApiAction;
34
35
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/modeling/actions/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,KAAK,YAAY,EAAE,MAAM,aAAa,CAAA;AACvD,OAAO,EAAE,YAAY,EAAE,KAAK,kBAAkB,EAAE,MAAM,mBAAmB,CAAA;AACzE,OAAO,EAAE,YAAY,EAAE,KAAK,kBAAkB,EAAE,MAAM,mBAAmB,CAAA;AACzE,OAAO,EAAE,UAAU,EAAE,KAAK,gBAAg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mB,CAAA;AACzE,OAAO,EAAE,UAAU,EAAE,KAAK,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AACnE,OAAO,EAAE,UAAU,EAAE,KAAK,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AACnE,OAAO,EAAE,YAAY,EAAE,KAAK,kBAAkB,EAAE,MAAM,mBAAmB,CAAA;AACzE,OAAO,EAAE,YAAY,EAAE,KAAK,kBAAkB,EAAE,MAAM,mBAAmB,CAAA;AAEzE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAC/C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAExD,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,UAAU,EAAE,UAAU,EAAE,YAAY,EAAE,YAAY,EAAE,CAAA;AACzF,YAAY,EACV,kBAAkB,EAClB,kBAAkB,EAClB,gBAAgB,EAChB,gBAAgB,EAChB,kBAAkB,EAClB,kBAAkB,GACnB,CAAA;AAED;;;GAGG;AACH,MAAM,MAAM,SAAS,GAAG,YAAY,GAAG,YAAY,GAAG,UAAU,GAAG,UAAU,GAAG,YAAY,GAAG,YAAY,CAAA;AAE3G;;;GAGG;AACH,MAAM,MAAM,eAAe,GACvB,kBAAkB,GAClB,kBAAkB,GAClB,gBAAgB,GAChB,gBAAgB,GAChB,kBAAkB,GAClB,kBAAkB,CAAA;AAEtB;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,MAAM,GAAG,QAAQ,GAAG,QAAQ,GAAG,QAAQ,GAAG,QAAQ,CAAA;AAEpF;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,YAAY,GAAG,SAAS,CAoBpF"}
@@ -15,20 +15,20 @@ export { CreateAction, DeleteAction, ListAction, ReadAction, SearchAction, Updat
15
15
  * @param schema The schema to restore the action from.
16
16
  * @returns The restored action.
17
17
  */
18
- export function restoreAction(schema) {
18
+ export function restoreAction(parent, schema) {
19
19
  switch (schema.kind) {
20
20
  case 'list':
21
- return new ListAction(schema);
21
+ return new ListAction(parent, schema);
22
22
  case 'read':
23
- return new ReadAction(schema);
23
+ return new ReadAction(parent, schema);
24
24
  case 'create':
25
- return new CreateAction(schema);
25
+ return new CreateAction(parent, schema);
26
26
  case 'update':
27
- return new UpdateAction(schema);
27
+ return new UpdateAction(parent, schema);
28
28
  case 'delete':
29
- return new DeleteAction(schema);
29
+ return new DeleteAction(parent, schema);
30
30
  case 'search':
31
- return new SearchAction(schema);
31
+ return new SearchAction(parent, schema);
32
32
  default:
33
33
  throw new Exception('Unknown action kind', {
34
34
  code: 'E_UNKNOWN_ACTION_KIND',
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/modeling/actions/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAqB,MAAM,aAAa,CAAA;AACvD,OAAO,EAAE,YAAY,EAA2B,MAAM,mBAAmB,CAAA;AACzE,OAAO,EAAE,YAAY,EAA2B,MAAM,mBAAmB,CAAA;AACzE,OAAO,EAAE,UAAU,EAAyB,MAAM,iBAAiB,CAAA;AACnE,OAAO,EAAE,UAAU,EAAyB,MAAM,iBAAiB,CAAA;AACnE,OAAO,EAAE,YAAY,EAA2B,MAAM,mBAAmB,CAAA;AACzE,OAAO,EAAE,YAAY,EAA2B,MAAM,mBAAmB,CAAA;AACzE,OAAO,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAA;AAGzD,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,UAAU,EAAE,UAAU,EAAE,YAAY,EAAE,YAAY,EAAE,CAAA;AAiCzF;;;;;;;GAOG;AACH,MAAM,UAAU,aAAa,CAAC,MAAoB;IAChD,QAAQ,MAAM,CAAC,IAAI,EAAE,CAAC;QACpB,KAAK,MAAM;YACT,OAAO,IAAI,UAAU,CAAC,MAA0B,CAAC,CAAA;QACnD,KAAK,MAAM;YACT,OAAO,IAAI,UAAU,CAAC,MAA0B,CAAC,CAAA;QACnD,KAAK,QAAQ;YACX,OAAO,IAAI,YAAY,CAAC,MAA4B,CAAC,CAAA;QACvD,KAAK,QAAQ;YACX,OAAO,IAAI,YAAY,CAAC,MAA4B,CAAC,CAAA;QACvD,KAAK,QAAQ;YACX,OAAO,IAAI,YAAY,CAAC,MAA4B,CAAC,CAAA;QACvD,KAAK,QAAQ;YACX,OAAO,IAAI,YAAY,CAAC,MAA4B,CAAC,CAAA;QACvD;YACE,MAAM,IAAI,SAAS,CAAC,qBAAqB,EAAE;gBACzC,IAAI,EAAE,uBAAuB;gBAC7B,MAAM,EAAE,GAAG;aACZ,CAAC,CAAA;IACN,CAAC;AACH,CAAC","sourcesContent":["export { Action, type ActionSchema } from './Action.js'\nimport { CreateAction, type CreateActionSchema } from './CreateAction.js'\nimport { DeleteAction, type DeleteActionSchema } from './DeleteAction.js'\nimport { ListAction, type ListActionSchema } from './ListAction.js'\nimport { ReadAction, type ReadActionSchema } from './ReadAction.js'\nimport { SearchAction, type SearchActionSchema } from './SearchAction.js'\nimport { UpdateAction, type UpdateActionSchema } from './UpdateAction.js'\nimport { Exception } from '../../exceptions/exception.js'\nimport type { ActionSchema } from './Action.js'\n\nexport { CreateAction, DeleteAction, ListAction, ReadAction, SearchAction, UpdateAction }\nexport type {\n CreateActionSchema,\n DeleteActionSchema,\n ListActionSchema,\n ReadActionSchema,\n SearchActionSchema,\n UpdateActionSchema,\n}\n\n/**\n * Represents a specific, configurable API operation applied to a Data Entity.\n * Corresponds to common RESTful interactions.\n */\nexport type ApiAction = CreateAction | DeleteAction | ListAction | ReadAction | SearchAction | UpdateAction\n\n/**\n * Schema representation of a specific, configurable API operation applied to a Data Entity.\n * Corresponds to common RESTful interactions.\n */\nexport type ApiActionSchema =\n | CreateActionSchema\n | DeleteActionSchema\n | ListActionSchema\n | ReadActionSchema\n | SearchActionSchema\n | UpdateActionSchema\n\n/**\n * The kind of action to perform.\n */\nexport type ActionKind = 'list' | 'read' | 'create' | 'update' | 'delete' | 'search'\n\n/**\n * Restores an action from a schema.\n *\n * It is a helper function to restore actions from schema.\n *\n * @param schema The schema to restore the action from.\n * @returns The restored action.\n */\nexport function restoreAction(schema: ActionSchema): ApiAction {\n switch (schema.kind) {\n case 'list':\n return new ListAction(schema as ListActionSchema)\n case 'read':\n return new ReadAction(schema as ReadActionSchema)\n case 'create':\n return new CreateAction(schema as CreateActionSchema)\n case 'update':\n return new UpdateAction(schema as UpdateActionSchema)\n case 'delete':\n return new DeleteAction(schema as DeleteActionSchema)\n case 'search':\n return new SearchAction(schema as SearchActionSchema)\n default:\n throw new Exception('Unknown action kind', {\n code: 'E_UNKNOWN_ACTION_KIND',\n status: 422,\n })\n }\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/modeling/actions/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAqB,MAAM,aAAa,CAAA;AACvD,OAAO,EAAE,YAAY,EAA2B,MAAM,mBAAmB,CAAA;AACzE,OAAO,EAAE,YAAY,EAA2B,MAAM,mBAAmB,CAAA;AACzE,OAAO,EAAE,UAAU,EAAyB,MAAM,iBAAiB,CAAA;AACnE,OAAO,EAAE,UAAU,EAAyB,MAAM,iBAAiB,CAAA;AACnE,OAAO,EAAE,YAAY,EAA2B,MAAM,mBAAmB,CAAA;AACzE,OAAO,EAAE,YAAY,EAA2B,MAAM,mBAAmB,CAAA;AACzE,OAAO,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAA;AAIzD,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,UAAU,EAAE,UAAU,EAAE,YAAY,EAAE,YAAY,EAAE,CAAA;AAiCzF;;;;;;;GAOG;AACH,MAAM,UAAU,aAAa,CAAC,MAAqB,EAAE,MAAoB;IACvE,QAAQ,MAAM,CAAC,IAAI,EAAE,CAAC;QACpB,KAAK,MAAM;YACT,OAAO,IAAI,UAAU,CAAC,MAAM,EAAE,MAA0B,CAAC,CAAA;QAC3D,KAAK,MAAM;YACT,OAAO,IAAI,UAAU,CAAC,MAAM,EAAE,MAA0B,CAAC,CAAA;QAC3D,KAAK,QAAQ;YACX,OAAO,IAAI,YAAY,CAAC,MAAM,EAAE,MAA4B,CAAC,CAAA;QAC/D,KAAK,QAAQ;YACX,OAAO,IAAI,YAAY,CAAC,MAAM,EAAE,MAA4B,CAAC,CAAA;QAC/D,KAAK,QAAQ;YACX,OAAO,IAAI,YAAY,CAAC,MAAM,EAAE,MAA4B,CAAC,CAAA;QAC/D,KAAK,QAAQ;YACX,OAAO,IAAI,YAAY,CAAC,MAAM,EAAE,MAA4B,CAAC,CAAA;QAC/D;YACE,MAAM,IAAI,SAAS,CAAC,qBAAqB,EAAE;gBACzC,IAAI,EAAE,uBAAuB;gBAC7B,MAAM,EAAE,GAAG;aACZ,CAAC,CAAA;IACN,CAAC;AACH,CAAC","sourcesContent":["export { Action, type ActionSchema } from './Action.js'\nimport { CreateAction, type CreateActionSchema } from './CreateAction.js'\nimport { DeleteAction, type DeleteActionSchema } from './DeleteAction.js'\nimport { ListAction, type ListActionSchema } from './ListAction.js'\nimport { ReadAction, type ReadActionSchema } from './ReadAction.js'\nimport { SearchAction, type SearchActionSchema } from './SearchAction.js'\nimport { UpdateAction, type UpdateActionSchema } from './UpdateAction.js'\nimport { Exception } from '../../exceptions/exception.js'\nimport type { ActionSchema } from './Action.js'\nimport type { ExposedEntity } from '../ExposedEntity.js'\n\nexport { CreateAction, DeleteAction, ListAction, ReadAction, SearchAction, UpdateAction }\nexport type {\n CreateActionSchema,\n DeleteActionSchema,\n ListActionSchema,\n ReadActionSchema,\n SearchActionSchema,\n UpdateActionSchema,\n}\n\n/**\n * Represents a specific, configurable API operation applied to a Data Entity.\n * Corresponds to common RESTful interactions.\n */\nexport type ApiAction = CreateAction | DeleteAction | ListAction | ReadAction | SearchAction | UpdateAction\n\n/**\n * Schema representation of a specific, configurable API operation applied to a Data Entity.\n * Corresponds to common RESTful interactions.\n */\nexport type ApiActionSchema =\n | CreateActionSchema\n | DeleteActionSchema\n | ListActionSchema\n | ReadActionSchema\n | SearchActionSchema\n | UpdateActionSchema\n\n/**\n * The kind of action to perform.\n */\nexport type ActionKind = 'list' | 'read' | 'create' | 'update' | 'delete' | 'search'\n\n/**\n * Restores an action from a schema.\n *\n * It is a helper function to restore actions from schema.\n *\n * @param schema The schema to restore the action from.\n * @returns The restored action.\n */\nexport function restoreAction(parent: ExposedEntity, schema: ActionSchema): ApiAction {\n switch (schema.kind) {\n case 'list':\n return new ListAction(parent, schema as ListActionSchema)\n case 'read':\n return new ReadAction(parent, schema as ReadActionSchema)\n case 'create':\n return new CreateAction(parent, schema as CreateActionSchema)\n case 'update':\n return new UpdateAction(parent, schema as UpdateActionSchema)\n case 'delete':\n return new DeleteAction(parent, schema as DeleteActionSchema)\n case 'search':\n return new SearchAction(parent, schema as SearchActionSchema)\n default:\n throw new Exception('Unknown action kind', {\n code: 'E_UNKNOWN_ACTION_KIND',\n status: 422,\n })\n }\n}\n"]}
@@ -1,4 +1,4 @@
1
- import type { IApiAssociationShape } from '../../amf/definitions/Shapes.js';
1
+ import type { Shapes } from '@api-client/amf-core';
2
2
  import type { Exception } from '../../exceptions/exception.js';
3
3
  import type { AiSessionSchema } from '../../models/AiSession.js';
4
4
  import type { DomainPropertyType } from '../DataFormat.js';
@@ -142,7 +142,7 @@ export interface AiDomainAssociation {
142
142
  multiple?: boolean;
143
143
  onDelete?: OnDeleteRule;
144
144
  semantics?: AiDomainSemantic[];
145
- schema?: IApiAssociationShape;
145
+ schema?: Shapes.IApiAssociationShape;
146
146
  }
147
147
  /**
148
148
  * The core structure representing a set of modifications (a delta) proposed by the AI.
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/modeling/ai/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAA;AAC3E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,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AY,GAAG,IAAI,CAAA;IAE9B,cAAc,CAAC,EAAE,gBAAgB,EAAE,CAAA;IACnC,iBAAiB,CAAC,EAAE,gBAAgB,EAAE,CAAA;IACtC,kBAAkB,CAAC,EAAE,YAAY,EAAE,CAAA;CACpC;AAED;;;;;GAKG;AACH,MAAM,WAAW,uBAAwB,SAAQ,cAAc;IAC7D;;OAEG;IACH,KAAK,CAAC,EAAE,aAAa,CAAA;IACrB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB"}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/modeling/ai/types.ts"],"names":[],"mappings":"AASA;;;GAGG;AACH,MAAM,CAAN,IAAY,IAiCX;AAjCD,WAAY,IAAI;IACd;;OAEG;IACH,6CAAqC,CAAA;IACrC;;OAEG;IACH,yBAAiB,CAAA;IACjB;;OAEG;IACH,yBAAiB,CAAA;IACjB;;OAEG;IACH,2BAAmB,CAAA;IACnB;;OAEG;IACH,2BAAmB,CAAA;IACnB;;OAEG;IACH,uBAAe,CAAA;IACf;;OAEG;IACH,yBAAiB,CAAA;IACjB;;OAEG;IACH,qBAAa,CAAA;AACf,CAAC,EAjCW,IAAI,KAAJ,IAAI,QAiCf","sourcesContent":["import type { IApiAssociationShape } from '../../amf/definitions/Shapes.js'\nimport type { Exception } from '../../exceptions/exception.js'\nimport type { AiSessionSchema } from '../../models/AiSession.js'\nimport type { DomainPropertyType } from '../DataFormat.js'\nimport type { OnDeleteRule } from '../index.js'\nimport { SemanticType } from '../Semantics.js'\nimport type { AssociationTarget, PropertySchema } from '../types.js'\nimport type { AiModelMessageSchema, AiModelMessage, AiUserMessageSchema } from '../../models/AiMessage.js'\n\n/**\n * A copy of the `Type` enum from the `@google/genai` package.\n * It's here so we don't need to import the nodejs only package.\n */\nexport enum Type {\n /**\n * Not specified, should not be used.\n */\n TYPE_UNSPECIFIED = 'TYPE_UNSPECIFIED',\n /**\n * OpenAPI string type\n */\n STRING = 'STRING',\n /**\n * OpenAPI number type\n */\n NUMBER = 'NUMBER',\n /**\n * OpenAPI integer type\n */\n INTEGER = 'INTEGER',\n /**\n * OpenAPI boolean type\n */\n BOOLEAN = 'BOOLEAN',\n /**\n * OpenAPI array type\n */\n ARRAY = 'ARRAY',\n /**\n * OpenAPI object type\n */\n OBJECT = 'OBJECT',\n /**\n * Null type\n */\n NULL = 'NULL',\n}\n\n/**\n * A lightweight representation of the `DataDomain` used specifically for serializing\n * the current domain state and sending it as context to the AI endpoint.\n * It omits complex internal graph structures, including only essential keys, names,\n * descriptions, and the hierarchical structure of models and entities.\n */\nexport interface AiDataDomainSchema {\n key: string\n name: string\n models: AiDataModelSchema[]\n entities: AiDomainEntitySchema[]\n}\n\n/**\n * A stripped-down representation of a `DomainModel` sent to the AI as part of the\n * domain context. It provides the AI with the existing model hierarchy and descriptions.\n */\nexport interface AiDataModelSchema {\n key: string\n name?: string\n description?: string\n}\n\n/**\n * Represents a semantic annotation applied to an entity, property, or association\n * within the AI's understanding or response. It defines the \"meaning\" of a field\n * (e.g., \"Email\", \"Password\", \"Address\").\n */\nexport interface AiDomainSemantic {\n id: SemanticType\n config?: Record<string, unknown>\n}\n\n/**\n * Represents a full or partial entity schema as generated by the AI in its response delta.\n * It defines a new entity or updates to an existing one, including its properties,\n * associations, semantics, and tags. This is also used by the `get_entity_details` tool\n * to send detailed serialized entity information back to the AI.\n */\nexport interface AiDomainEntityResponseSchema {\n key: string\n modelKey: string\n name?: string\n displayName?: string\n description?: string\n tags?: string[]\n semantics?: AiDomainSemantic[]\n properties?: AiDomainProperty[]\n associations?: AiDomainAssociation[]\n}\n\n/**\n * A minimal representation of an entity used purely for context-setting when\n * sending the current domain structure to the AI. It excludes deeply nested\n * properties and associations to save token space.\n */\nexport interface AiDomainEntitySchema {\n key: string\n modelKey: string\n name?: string\n description?: string\n}\n\n/**\n * Represents a property definition generated by the AI. It maps the complex internal\n * domain property structure into a simpler, flat structure that the AI generates,\n * including data types, constraints, schema metadata, and semantics.\n */\nexport interface AiDomainProperty {\n key?: string\n name?: string\n displayName?: string\n description?: string\n type: DomainPropertyType\n constraints?: {\n required?: boolean\n unique?: boolean\n index?: boolean\n primary?: boolean\n multiple?: boolean\n readOnly?: boolean\n writeOnly?: boolean\n }\n deprecated?: boolean\n schema?: PropertySchema\n semantics?: AiDomainSemantic[]\n tags?: string[] | null\n}\n\n/**\n * Represents an association definition generated by the AI, linking an entity\n * to one or more target entities. It includes relationship rules (like onDelete)\n * and semantic annotations.\n */\nexport interface AiDomainAssociation {\n key: string\n name?: string\n displayName?: string\n description?: string\n targets: AssociationTarget[]\n required?: boolean\n multiple?: boolean\n onDelete?: OnDeleteRule\n semantics?: AiDomainSemantic[]\n schema?: IApiAssociationShape\n}\n\n/**\n * The core structure representing a set of modifications (a delta) proposed by the AI.\n * It contains arrays of models and entities to add, delete, or modify. The application\n * processes this delta to transition the data domain to the new requested state.\n */\nexport interface AiDomainDelta {\n /**\n * Models to add to the domain.\n */\n addedModels?: AiDataModelSchema[]\n /**\n * Keys of models to delete from the domain.\n */\n deletedModelKeys?: string[]\n /**\n * Models to modify in the domain.\n */\n modifiedModels?: AiDataModelSchema[]\n /**\n * Entities to add to the domain.\n */\n addedEntities?: AiDomainEntityResponseSchema[]\n /**\n * Keys of entities to delete from the domain.\n */\n deletedEntityKeys?: string[]\n /**\n * Entities to modify in the domain.\n */\n modifiedEntities?: AiDomainEntityDelta[]\n}\n\n/**\n * The expected JSON schema structure returned by the AI endpoint when performing\n * data domain manipulation. It includes the AI's step-by-step reasoning and the\n * actionable delta to be applied.\n */\nexport interface AiDomainDeltaResponse {\n /**\n * The LLM reasoning.\n */\n reasoning: string\n /**\n * Domain changes delta\n */\n delta?: AiDomainDelta\n}\n\n/**\n * Union type for progressive SSE stream chunks\n * received from the AI generation endpoint.\n */\nexport type AiStreamEvent =\n | { event: 'user-message'; data: AiUserMessageSchema }\n | { event: 'agent-message'; data: AiModelMessageSchema }\n | { event: 'thought-chunk'; data: string }\n | { event: 'text-chunk'; data: string }\n | { event: 'done'; data: AiModelMessageSchema }\n | { event: 'error'; data: Exception }\n | { event: 'session-updated'; data: AiSessionSchema }\n\n/**\n * Represents a targeted modification to an existing entity generated by the AI.\n * Instead of providing the full entity state, the AI provides explicit arrays\n * of properties, associations, and semantics to add, modify, or delete, enabling\n * precise, non-destructive updates.\n */\nexport interface AiDomainEntityDelta {\n key: string\n modelKey?: string // Provide to move the entity to a different model\n name?: string\n displayName?: string\n description?: string\n tags?: string[] | null\n // Entity semantics delta\n addedSemantics?: AiDomainSemantic[]\n modifiedSemantics?: AiDomainSemantic[]\n deletedSemanticIds?: SemanticType[]\n // Explicit deltas so the LLM doesn't have to list untouched properties\n addedProperties?: AiDomainProperty[]\n modifiedProperties?: AiDomainPropertyDelta[]\n deletedPropertyKeys?: string[]\n addedAssociations?: AiDomainAssociation[]\n modifiedAssociations?: AiDomainAssociationDelta[]\n deletedAssociationKeys?: string[]\n}\n\nexport type NullablePropertySchema = {\n [K in keyof PropertySchema]?: PropertySchema[K] | null\n}\n\n/**\n * Represents a targeted modification to an existing property generated by the AI.\n * It captures changes to superficial properties (name, description), type changes,\n * constraint updates, and semantic alterations.\n */\nexport interface AiDomainPropertyDelta {\n key: string\n name?: string\n displayName?: string\n description?: string\n type?: DomainPropertyType\n constraints?: {\n required?: boolean | null\n unique?: boolean | null\n index?: boolean | null\n primary?: boolean | null\n multiple?: boolean | null\n readOnly?: boolean | null\n writeOnly?: boolean | null\n } | null\n deprecated?: boolean | null\n // Property semantics delta\n addedSemantics?: AiDomainSemantic[]\n modifiedSemantics?: AiDomainSemantic[]\n deletedSemanticIds?: SemanticType[]\n schema?: NullablePropertySchema\n}\n\n/**\n * Represents a targeted modification to an existing association generated by the AI.\n * It captures updates to relationship cardinality, target entities, deletion rules,\n * and applied semantics.\n */\nexport interface AiDomainAssociationDelta {\n key: string\n name?: string\n displayName?: string\n description?: string\n targets?: AssociationTarget[]\n required?: boolean | null\n multiple?: boolean | null\n onDelete?: OnDeleteRule | null\n // Association semantics delta\n addedSemantics?: AiDomainSemantic[]\n modifiedSemantics?: AiDomainSemantic[]\n deletedSemanticIds?: SemanticType[]\n}\n\n/**\n * An enriched, in-memory representation of a model's message that includes the globally\n * parsed `AiDomainDelta` object.\n * This is not stored directly in the datastore as-is; instead, the raw JSON text is stored,\n * and this structure is assembled at runtime when the chat history is loaded into the UI.\n */\nexport interface AiModelMessageWithDelta extends AiModelMessage {\n /**\n * The delta of the message, if any.\n */\n delta?: AiDomainDelta\n /**\n * The reasoning of the delta.\n * Format in markdown.\n */\n reasoning?: string\n}\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/modeling/ai/types.ts"],"names":[],"mappings":"AASA;;;GAGG;AACH,MAAM,CAAN,IAAY,IAiCX;AAjCD,WAAY,IAAI;IACd;;OAEG;IACH,6CAAqC,CAAA;IACrC;;OAEG;IACH,yBAAiB,CAAA;IACjB;;OAEG;IACH,yBAAiB,CAAA;IACjB;;OAEG;IACH,2BAAmB,CAAA;IACnB;;OAEG;IACH,2BAAmB,CAAA;IACnB;;OAEG;IACH,uBAAe,CAAA;IACf;;OAEG;IACH,yBAAiB,CAAA;IACjB;;OAEG;IACH,qBAAa,CAAA;AACf,CAAC,EAjCW,IAAI,KAAJ,IAAI,QAiCf","sourcesContent":["import type { Shapes } from '@api-client/amf-core'\nimport type { Exception } from '../../exceptions/exception.js'\nimport type { AiSessionSchema } from '../../models/AiSession.js'\nimport type { DomainPropertyType } from '../DataFormat.js'\nimport type { OnDeleteRule } from '../index.js'\nimport { SemanticType } from '../Semantics.js'\nimport type { AssociationTarget, PropertySchema } from '../types.js'\nimport type { AiModelMessageSchema, AiModelMessage, AiUserMessageSchema } from '../../models/AiMessage.js'\n\n/**\n * A copy of the `Type` enum from the `@google/genai` package.\n * It's here so we don't need to import the nodejs only package.\n */\nexport enum Type {\n /**\n * Not specified, should not be used.\n */\n TYPE_UNSPECIFIED = 'TYPE_UNSPECIFIED',\n /**\n * OpenAPI string type\n */\n STRING = 'STRING',\n /**\n * OpenAPI number type\n */\n NUMBER = 'NUMBER',\n /**\n * OpenAPI integer type\n */\n INTEGER = 'INTEGER',\n /**\n * OpenAPI boolean type\n */\n BOOLEAN = 'BOOLEAN',\n /**\n * OpenAPI array type\n */\n ARRAY = 'ARRAY',\n /**\n * OpenAPI object type\n */\n OBJECT = 'OBJECT',\n /**\n * Null type\n */\n NULL = 'NULL',\n}\n\n/**\n * A lightweight representation of the `DataDomain` used specifically for serializing\n * the current domain state and sending it as context to the AI endpoint.\n * It omits complex internal graph structures, including only essential keys, names,\n * descriptions, and the hierarchical structure of models and entities.\n */\nexport interface AiDataDomainSchema {\n key: string\n name: string\n models: AiDataModelSchema[]\n entities: AiDomainEntitySchema[]\n}\n\n/**\n * A stripped-down representation of a `DomainModel` sent to the AI as part of the\n * domain context. It provides the AI with the existing model hierarchy and descriptions.\n */\nexport interface AiDataModelSchema {\n key: string\n name?: string\n description?: string\n}\n\n/**\n * Represents a semantic annotation applied to an entity, property, or association\n * within the AI's understanding or response. It defines the \"meaning\" of a field\n * (e.g., \"Email\", \"Password\", \"Address\").\n */\nexport interface AiDomainSemantic {\n id: SemanticType\n config?: Record<string, unknown>\n}\n\n/**\n * Represents a full or partial entity schema as generated by the AI in its response delta.\n * It defines a new entity or updates to an existing one, including its properties,\n * associations, semantics, and tags. This is also used by the `get_entity_details` tool\n * to send detailed serialized entity information back to the AI.\n */\nexport interface AiDomainEntityResponseSchema {\n key: string\n modelKey: string\n name?: string\n displayName?: string\n description?: string\n tags?: string[]\n semantics?: AiDomainSemantic[]\n properties?: AiDomainProperty[]\n associations?: AiDomainAssociation[]\n}\n\n/**\n * A minimal representation of an entity used purely for context-setting when\n * sending the current domain structure to the AI. It excludes deeply nested\n * properties and associations to save token space.\n */\nexport interface AiDomainEntitySchema {\n key: string\n modelKey: string\n name?: string\n description?: string\n}\n\n/**\n * Represents a property definition generated by the AI. It maps the complex internal\n * domain property structure into a simpler, flat structure that the AI generates,\n * including data types, constraints, schema metadata, and semantics.\n */\nexport interface AiDomainProperty {\n key?: string\n name?: string\n displayName?: string\n description?: string\n type: DomainPropertyType\n constraints?: {\n required?: boolean\n unique?: boolean\n index?: boolean\n primary?: boolean\n multiple?: boolean\n readOnly?: boolean\n writeOnly?: boolean\n }\n deprecated?: boolean\n schema?: PropertySchema\n semantics?: AiDomainSemantic[]\n tags?: string[] | null\n}\n\n/**\n * Represents an association definition generated by the AI, linking an entity\n * to one or more target entities. It includes relationship rules (like onDelete)\n * and semantic annotations.\n */\nexport interface AiDomainAssociation {\n key: string\n name?: string\n displayName?: string\n description?: string\n targets: AssociationTarget[]\n required?: boolean\n multiple?: boolean\n onDelete?: OnDeleteRule\n semantics?: AiDomainSemantic[]\n schema?: Shapes.IApiAssociationShape\n}\n\n/**\n * The core structure representing a set of modifications (a delta) proposed by the AI.\n * It contains arrays of models and entities to add, delete, or modify. The application\n * processes this delta to transition the data domain to the new requested state.\n */\nexport interface AiDomainDelta {\n /**\n * Models to add to the domain.\n */\n addedModels?: AiDataModelSchema[]\n /**\n * Keys of models to delete from the domain.\n */\n deletedModelKeys?: string[]\n /**\n * Models to modify in the domain.\n */\n modifiedModels?: AiDataModelSchema[]\n /**\n * Entities to add to the domain.\n */\n addedEntities?: AiDomainEntityResponseSchema[]\n /**\n * Keys of entities to delete from the domain.\n */\n deletedEntityKeys?: string[]\n /**\n * Entities to modify in the domain.\n */\n modifiedEntities?: AiDomainEntityDelta[]\n}\n\n/**\n * The expected JSON schema structure returned by the AI endpoint when performing\n * data domain manipulation. It includes the AI's step-by-step reasoning and the\n * actionable delta to be applied.\n */\nexport interface AiDomainDeltaResponse {\n /**\n * The LLM reasoning.\n */\n reasoning: string\n /**\n * Domain changes delta\n */\n delta?: AiDomainDelta\n}\n\n/**\n * Union type for progressive SSE stream chunks\n * received from the AI generation endpoint.\n */\nexport type AiStreamEvent =\n | { event: 'user-message'; data: AiUserMessageSchema }\n | { event: 'agent-message'; data: AiModelMessageSchema }\n | { event: 'thought-chunk'; data: string }\n | { event: 'text-chunk'; data: string }\n | { event: 'done'; data: AiModelMessageSchema }\n | { event: 'error'; data: Exception }\n | { event: 'session-updated'; data: AiSessionSchema }\n\n/**\n * Represents a targeted modification to an existing entity generated by the AI.\n * Instead of providing the full entity state, the AI provides explicit arrays\n * of properties, associations, and semantics to add, modify, or delete, enabling\n * precise, non-destructive updates.\n */\nexport interface AiDomainEntityDelta {\n key: string\n modelKey?: string // Provide to move the entity to a different model\n name?: string\n displayName?: string\n description?: string\n tags?: string[] | null\n // Entity semantics delta\n addedSemantics?: AiDomainSemantic[]\n modifiedSemantics?: AiDomainSemantic[]\n deletedSemanticIds?: SemanticType[]\n // Explicit deltas so the LLM doesn't have to list untouched properties\n addedProperties?: AiDomainProperty[]\n modifiedProperties?: AiDomainPropertyDelta[]\n deletedPropertyKeys?: string[]\n addedAssociations?: AiDomainAssociation[]\n modifiedAssociations?: AiDomainAssociationDelta[]\n deletedAssociationKeys?: string[]\n}\n\nexport type NullablePropertySchema = {\n [K in keyof PropertySchema]?: PropertySchema[K] | null\n}\n\n/**\n * Represents a targeted modification to an existing property generated by the AI.\n * It captures changes to superficial properties (name, description), type changes,\n * constraint updates, and semantic alterations.\n */\nexport interface AiDomainPropertyDelta {\n key: string\n name?: string\n displayName?: string\n description?: string\n type?: DomainPropertyType\n constraints?: {\n required?: boolean | null\n unique?: boolean | null\n index?: boolean | null\n primary?: boolean | null\n multiple?: boolean | null\n readOnly?: boolean | null\n writeOnly?: boolean | null\n } | null\n deprecated?: boolean | null\n // Property semantics delta\n addedSemantics?: AiDomainSemantic[]\n modifiedSemantics?: AiDomainSemantic[]\n deletedSemanticIds?: SemanticType[]\n schema?: NullablePropertySchema\n}\n\n/**\n * Represents a targeted modification to an existing association generated by the AI.\n * It captures updates to relationship cardinality, target entities, deletion rules,\n * and applied semantics.\n */\nexport interface AiDomainAssociationDelta {\n key: string\n name?: string\n displayName?: string\n description?: string\n targets?: AssociationTarget[]\n required?: boolean | null\n multiple?: boolean | null\n onDelete?: OnDeleteRule | null\n // Association semantics delta\n addedSemantics?: AiDomainSemantic[]\n modifiedSemantics?: AiDomainSemantic[]\n deletedSemanticIds?: SemanticType[]\n}\n\n/**\n * An enriched, in-memory representation of a model's message that includes the globally\n * parsed `AiDomainDelta` object.\n * This is not stored directly in the datastore as-is; instead, the raw JSON text is stored,\n * and this structure is assembled at runtime when the chat history is loaded into the UI.\n */\nexport interface AiModelMessageWithDelta extends AiModelMessage {\n /**\n * The delta of the message, if any.\n */\n delta?: AiDomainDelta\n /**\n * The reasoning of the delta.\n * Format in markdown.\n */\n reasoning?: string\n}\n"]}
@@ -1,4 +1,4 @@
1
- import { DomainPropertyType } from '../modeling/DataFormat.js';
1
+ import { DomainPropertyType } from '../DataFormat.js';
2
2
  export declare const noValue: unique symbol;
3
3
  /**
4
4
  * A class to be used for generating values from pre-defined functions.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DataValueGenerator.d.ts","sourceRoot":"","sources":["../../../../src/modeling/amf/DataValueGenerator.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAA;AAErD,eAAO,MAAM,OAAO,eAAoB,CAAA;AAExC;;;GAGG;AACH,qBAAa,kBAAkB;IAC7B;;;OAGG;IACH,SAAS,CAAC,SAAS,SAAI;IACvB;;;OAGG;IACH,MAAM,CAAC,QAAQ,CAAC,OAAO,SAAU;IAEjC;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,kBAAkB,GAAG,MAAM,GAAG,OAAO,OAAO;IAmBvE;;;;OAIG;IACH,SAAS,CAAC,cAAc,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,OAAO;IAY7D;;;;OAIG;IACH,SAAS,CAAC,cAAc,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,OAAO;IAS7D;;;;;OAKG;IACH,SAAS,CAAC,YAAY,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,OAAO;IAa3D;;;;OAIG;IACH,SAAS,CAAC,YAAY,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,OAAO;IAa3D;;;;;OAKG;IACH,SAAS,CAAC,gBAAgB,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,OAAO;CAehE"}
@@ -1,5 +1,4 @@
1
- import { nanoid } from '../nanoid.js';
2
- import uuidV4 from '../lib/uuid.js';
1
+ import { nanoid } from '../../nanoid.js';
3
2
  export const noValue = Symbol('noValue');
4
3
  /**
5
4
  * A class to be used for generating values from pre-defined functions.
@@ -51,7 +50,7 @@ export class DataValueGenerator {
51
50
  // TODO: we need more settings controlling the random string generation.
52
51
  return nanoid(8);
53
52
  case 'uuid-v4':
54
- return uuidV4();
53
+ return crypto.randomUUID();
55
54
  default:
56
55
  return noValue;
57
56
  }
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DataValueGenerator.js","sourceRoot":"","sources":["../../../../src/modeling/amf/DataValueGenerator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AAGxC,MAAM,CAAC,MAAM,OAAO,GAAG,MAAM,CAAC,SAAS,CAAC,CAAA;AAExC;;;GAGG;AACH,MAAM,OAAO,kBAAkB;IAC7B;;;OAGG;IACO,SAAS,GAAG,CAAC,CAAA;IACvB;;;OAGG;IACH,MAAM,CAAU,OAAO,GAAG,OAAO,CAAA;IAEjC;;;;;OAKG;IACH,QAAQ,CAAC,EAAU,EAAE,IAAwB;QAC3C,IAAI,IAAI,KAAK,QAAQ,EAAE,CAAC;YACtB,OAAO,IAAI,CAAC,cAAc,CAAC,EAAE,CAAC,CAAA;QAChC,CAAC;QACD,IAAI,IAAI,KAAK,QAAQ,EAAE,CAAC;YACtB,OAAO,IAAI,CAAC,cAAc,CAAC,EAAE,CAAC,CAAA;QACh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C,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAA;YAC/C,MAAM,MAAM,GAAG,GAAG,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAA;YACnD,MAAM,MAAM,GAAG,GAAG,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAA;YACnD,OAAO,GAAG,IAAI,IAAI,KAAK,IAAI,GAAG,IAAI,IAAI,IAAI,MAAM,IAAI,MAAM,EAAE,CAAA;QAC9D,CAAC;QACD,OAAO,OAAO,CAAA;IAChB,CAAC","sourcesContent":["import { nanoid } from '../../nanoid.js'\nimport { DomainPropertyType } from '../DataFormat.js'\n\nexport const noValue = Symbol('noValue')\n\n/**\n * A class to be used for generating values from pre-defined functions.\n * This is used to provide default values for data properties based on specified functions.\n */\nexport class DataValueGenerator {\n /**\n * The current value for the `number.incremental` function.\n * This counter is incremented each time an incremental number is generated.\n */\n protected increment = 0\n /**\n * A symbol representing the absence of a value.\n * Used as a return value when a function cannot generate a value of the requested type.\n */\n static readonly noValue = noValue\n\n /**\n * Generates a value based on the provided function name and data type.\n * @param fn The name of the function to use for value generation (e.g., 'random', 'uuid-v4', 'incremental').\n * @param type The data type of the value to generate (e.g., 'string', 'number', 'date', 'time', 'datetime').\n * @returns The generated value, or the `noValue` symbol if the function or type is not supported.\n */\n generate(fn: string, type: DomainPropertyType): string | typeof noValue {\n if (type === 'string') {\n return this.generateString(fn)\n }\n if (type === 'number') {\n return this.generateNumber(fn)\n }\n if (type === 'date') {\n return this.generateDate(fn)\n }\n if (type === 'time') {\n return this.generateTime(fn)\n }\n if (type === 'datetime') {\n return this.generateDateTime(fn)\n }\n return noValue\n }\n\n /**\n * Generates a string value based on the function name.\n * @param fn The name of the string generation function.\n * @returns The generated string value, or `noValue` if the function is not supported.\n */\n protected generateString(fn: string): string | typeof noValue {\n switch (fn) {\n case 'random':\n // TODO: we need more settings controlling the random string generation.\n return nanoid(8)\n case 'uuid-v4':\n return crypto.randomUUID()\n default:\n return noValue\n }\n }\n\n /**\n * Generates a number value based on the function name.\n * @param fn The name of the number generation function.\n * @returns The generated number value (as a string), or `noValue` if the function is not supported.\n */\n protected generateNumber(fn: string): string | typeof noValue {\n switch (fn) {\n case 'incremental':\n return `${this.increment++}`\n default:\n return noValue\n }\n }\n\n /**\n * Generates a date value based on the function name.\n * @param fn The name of the date generation function.\n * @returns The generated date value (as a string in YYYY-MM-DD format),\n * or `noValue` if the function is not supported.\n */\n protected generateDate(fn: string): string | typeof noValue {\n if (fn === 'now') {\n // Returns YYYY-MM-DD\n // @TODO: Replace with Temporal when widely available.\n const d = new Date()\n const year = d.getFullYear()\n const month = `${d.getMonth() + 1}`.padStart(2, '0')\n const day = `${d.getDate()}`.padStart(2, '0')\n return `${year}-${month}-${day}`\n }\n return noValue\n }\n\n /**\n * Generates a time value based on the function name.\n * @param fn The name of the time generation function.\n * @returns The generated time value (as a string in HH:mm:ss format), or `noValue` if the function is not supported.\n */\n protected generateTime(fn: string): string | typeof noValue {\n if (fn === 'now') {\n // Returns HH:mm:ss\n // @TODO: Replace with Temporal when widely available.\n const d = new Date()\n const hour = `${d.getHours()}`.padStart(2, '0')\n const minute = `${d.getMinutes()}`.padStart(2, '0')\n const second = `${d.getSeconds()}`.padStart(2, '0')\n return `${hour}:${minute}:${second}`\n }\n return noValue\n }\n\n /**\n * Generates a datetime value based on the function name.\n * @param fn The name of the datetime generation function.\n * @returns The generated datetime value (as a string in YYYY-MM-DDTHH:mm:ss format),\n * or `noValue` if the function is not supported.\n */\n protected generateDateTime(fn: string): string | typeof noValue {\n if (fn === 'now') {\n // Returns YYYY-MM-DDTHH:mm:ss\n // @TODO: Replace with Temporal when widely available.\n const d = new Date()\n const year = d.getFullYear()\n const month = `${d.getMonth() + 1}`.padStart(2, '0')\n const day = `${d.getDate()}`.padStart(2, '0')\n const hour = `${d.getHours()}`.padStart(2, '0')\n const minute = `${d.getMinutes()}`.padStart(2, '0')\n const second = `${d.getSeconds()}`.padStart(2, '0')\n return `${year}-${month}-${day}T${hour}:${minute}:${second}`\n }\n return noValue\n }\n}\n"]}
@@ -2,8 +2,8 @@ import { type PropertyWebBindings } from '../Bindings.js';
2
2
  import type { DomainAssociation } from '../DomainAssociation.js';
3
3
  import type { DomainProperty } from '../DomainProperty.js';
4
4
  import type { DomainEntity } from '../DomainEntity.js';
5
- import { IApiAnyShape, IApiArrayShape, IApiDataExample, IApiFileShape, IApiNodeShape, IApiPropertyShape, IApiRecursiveShape, IApiScalarShape, IApiShape, IApiUnionShape, IShapeUnion } from '../../amf/definitions/Shapes.js';
6
- import { DataValueGenerator } from '../../amf/DataValueGenerator.js';
5
+ import { type Shapes } from '@api-client/amf-core';
6
+ import { DataValueGenerator } from './DataValueGenerator.js';
7
7
  import type { PropertySchema } from '../types.js';
8
8
  /**
9
9
  * Serializes Data Domain elements (DomainEntity, DomainProperty, DomainAssociation)
@@ -65,7 +65,7 @@ export declare class ShapeGenerator {
65
65
  * const amfShape = generator.entity(myDomainEntity);
66
66
  * ```
67
67
  */
68
- entity(input: DomainEntity, visited?: Set<string>): IApiNodeShape | IApiRecursiveShape;
68
+ entity(input: DomainEntity, visited?: Set<string>): Shapes.IApiNodeShape | Shapes.IApiRecursiveShape;
69
69
  /**
70
70
  * Serializes a `DomainProperty` to an AMF property shape.
71
71
  *
@@ -81,7 +81,7 @@ export declare class ShapeGenerator {
81
81
  * const amfShape = generator.property(myDomainProperty);
82
82
  * ```
83
83
  */
84
- property(input: DomainProperty): IApiPropertyShape;
84
+ property(input: DomainProperty): Shapes.IApiPropertyShape;
85
85
  /**
86
86
  * Serializes a `DomainAssociation` to an AMF property shape, handling the
87
87
  * association's target entity or entities.
@@ -102,7 +102,7 @@ export declare class ShapeGenerator {
102
102
  * const amfShape = generator.associationProperty(myDomainAssociation);
103
103
  * ```
104
104
  */
105
- associationProperty(input: DomainAssociation, visited?: Set<string>): IApiPropertyShape;
105
+ associationProperty(input: DomainAssociation, visited?: Set<string>): Shapes.IApiPropertyShape;
106
106
  /**
107
107
  * Generates a shape for an association. Most likely you want to use the `associationProperty()` method instead.
108
108
  *
@@ -111,20 +111,20 @@ export declare class ShapeGenerator {
111
111
  * recursive shape generation and avoids infinite loops. Defaults to a new empty `Set`.
112
112
  * @returns The range value for the PropertyShape.
113
113
  */
114
- associationShape(input: DomainAssociation, visited?: Set<string>): IShapeUnion | undefined;
114
+ associationShape(input: DomainAssociation, visited?: Set<string>): Shapes.IShapeUnion | undefined;
115
115
  /**
116
116
  * @param input The data association instance.
117
117
  * @returns An AMF API scalar shape with the link to the schema.
118
118
  */
119
- protected createLinkedShape(input: DomainAssociation): IApiScalarShape;
120
- protected createUnionShape(input: DomainAssociation, items: IShapeUnion[]): IApiUnionShape | IApiArrayShape;
119
+ protected createLinkedShape(input: DomainAssociation): Shapes.IApiScalarShape;
120
+ protected createUnionShape(input: DomainAssociation, items: Shapes.IShapeUnion[]): Shapes.IApiUnionShape | Shapes.IApiArrayShape;
121
121
  /**
122
122
  * Generates a shape list for an union. Most likely you want to use the `associationProperty()` method instead.
123
123
  *
124
124
  * @param input The data association instance.
125
125
  * @returns The range value for the PropertyShape.
126
126
  */
127
- associationUnion(input: DomainAssociation, visited?: Set<string>): IShapeUnion | IShapeUnion[] | undefined;
127
+ associationUnion(input: DomainAssociation, visited?: Set<string>): Shapes.IShapeUnion | Shapes.IShapeUnion[] | undefined;
128
128
  /**
129
129
  * The DomainProperty may have both the `schema` and the `bindings`. For AMF shape we read `schema` for
130
130
  * default value, examples, and enum values. We also look for the `web`
@@ -132,7 +132,7 @@ export declare class ShapeGenerator {
132
132
  *
133
133
  * @param input
134
134
  */
135
- protected getRange(input: DomainProperty): IApiArrayShape | IApiFileShape | IApiScalarShape;
135
+ protected getRange(input: DomainProperty): Shapes.IApiArrayShape | Shapes.IApiFileShape | Shapes.IApiScalarShape;
136
136
  /**
137
137
  * Normally this would be part of generating a scalar schema but the the property is an array this
138
138
  * is generated on the array and not on the range.
@@ -142,15 +142,15 @@ export declare class ShapeGenerator {
142
142
  * @param type The data type of the parent property as set on the `range`
143
143
  * @param isArray Whether the DomainProperty is multiple
144
144
  */
145
- protected setShapeSchema(input: DomainProperty, result: IApiAnyShape, schema: PropertySchema, type: string, isArray?: boolean): void;
146
- protected createArrayShape(input: DomainProperty, schema?: PropertySchema, bindings?: PropertyWebBindings): IApiArrayShape;
147
- protected createScalarShape(input: DomainProperty, schema?: PropertySchema, bindings?: PropertyWebBindings): IApiScalarShape;
148
- protected createExamples(examples: string[], type: string): IApiDataExample[];
149
- protected createArrayExamples(examples: string[], type: string): IApiDataExample[];
150
- protected createFileShape(input: DomainProperty, bindings?: PropertyWebBindings): IApiFileShape;
151
- protected setScalarCommonProperties(result: IApiFileShape | IApiScalarShape, input: DomainProperty, bindings?: PropertyWebBindings): void;
152
- protected updateBaseProperties(input: DomainProperty | DomainAssociation | DomainEntity, target: IApiShape): void;
153
- protected createRecursiveShape(input: DomainEntity): IApiRecursiveShape;
145
+ protected setShapeSchema(input: DomainProperty, result: Shapes.IApiAnyShape, schema: PropertySchema, type: string, isArray?: boolean): void;
146
+ protected createArrayShape(input: DomainProperty, schema?: PropertySchema, bindings?: PropertyWebBindings): Shapes.IApiArrayShape;
147
+ protected createScalarShape(input: DomainProperty, schema?: PropertySchema, bindings?: PropertyWebBindings): Shapes.IApiScalarShape;
148
+ protected createExamples(examples: string[], type: string): Shapes.IApiDataExample[];
149
+ protected createArrayExamples(examples: string[], type: string): Shapes.IApiDataExample[];
150
+ protected createFileShape(input: DomainProperty, bindings?: PropertyWebBindings): Shapes.IApiFileShape;
151
+ protected setScalarCommonProperties(result: Shapes.IApiFileShape | Shapes.IApiScalarShape, input: DomainProperty, bindings?: PropertyWebBindings): void;
152
+ protected updateBaseProperties(input: DomainProperty | DomainAssociation | DomainEntity, target: Shapes.IApiShape): void;
153
+ protected createRecursiveShape(input: DomainEntity): Shapes.IApiRecursiveShape;
154
154
  /**
155
155
  * Translates the shape to an array shape. This happens when data model property
156
156
  * is changed from 'multiple' to not-multiple and back.
@@ -159,6 +159,6 @@ export declare class ShapeGenerator {
159
159
  * @param shape The shape to wrap as an array.
160
160
  * @returns Array shape.
161
161
  */
162
- protected refactorShapeToArray(id: string, shape: IShapeUnion): IApiArrayShape;
162
+ protected refactorShapeToArray(id: string, shape: Shapes.IShapeUnion): Shapes.IApiArrayShape;
163
163
  }
164
164
  //# sourceMappingURL=ShapeGenerator.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ShapeGenerator.d.ts","sourceRoot":"","sources":["../../../../src/modeling/amf/ShapeGenerator.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,KAAK,mBAAmB,EAAE,MAAM,gBAAgB,CAAA;AACnF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAA;AAChE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAC1D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAGtD,OAAO,EAIL,YAAY,EACZ,cAAc,EACd,eAAe,EACf,aAAa,EACb,aAAa,EACb,iBAAiB,EACjB,kBAAkB,EAClB,eAAe,EACf,SAAS,EACT,cAAc,EACd,WAAW,EAMZ,MAAM,iCAAiC,CAAA;AAExC,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAA;AAGpE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AASjD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,qBAAa,cAAc;;IAGzB;;;;OAIG;IACH,IAAI,cAAc,IAAI,kBAAkB,CAOvC;IAED;;;;;;;;;;;;;;;;;OAiBG;IACH,MAAM,CAAC,KAAK,EAAE,YAAY,EAAE,OAAO,cAAoB,GAAG,aAAa,GAAG,kBAAkB;IAoC5F;;;;;;;;;;;;;;OAc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
1
- import { IAmfExampleTypes, modelTypeToAmfDataType } from '../../amf/AmfTypes.js';
2
- import { AmfNamespace } from '../../amf/definitions/Namespace.js';
3
- import { anyShape, arrayShape, fileShape, nodeShape, propertyShape, recursiveShape, scalarShape, unionShape, } from '../../amf/definitions/Shapes.js';
4
- import { AmfDataNode } from '../../amf/models/AmfDataNode.js';
5
- import { DataValueGenerator } from '../../amf/DataValueGenerator.js';
1
+ import { modelTypeToAmfDataType } from './core_types.js';
2
+ import { AmfNamespace, AmfDataNode, AmfTypes, ShapeHelpers } from '@api-client/amf-core';
3
+ import { DataValueGenerator } from './DataValueGenerator.js';
6
4
  import { nanoid } from '../../nanoid.js';
7
5
  import { DomainEntityKind, DomainPropertyKind } from '../../models/kinds.js';
8
6
  const UNION_TYPE_ANY_OF = 'anyOf';
@@ -84,7 +82,7 @@ export class ShapeGenerator {
84
82
  return this.createRecursiveShape(input);
85
83
  }
86
84
  visited.add(input.key);
87
- const result = nodeShape(input.key);
85
+ const result = ShapeHelpers.nodeShape(input.key);
88
86
  result.id = input.key;
89
87
  this.updateBaseProperties(input, result);
90
88
  result.properties = [];
@@ -130,7 +128,7 @@ export class ShapeGenerator {
130
128
  */
131
129
  property(input) {
132
130
  const { required, key } = input;
133
- const result = propertyShape(key);
131
+ const result = ShapeHelpers.propertyShape(key);
134
132
  result.path = `${AmfNamespace.aml.vocabularies.data.key}${input.info.name}`;
135
133
  if (required) {
136
134
  result.minCount = 1;
@@ -167,7 +165,7 @@ export class ShapeGenerator {
167
165
  */
168
166
  associationProperty(input, visited = new Set()) {
169
167
  const { required, key } = input;
170
- const result = propertyShape(key);
168
+ const result = ShapeHelpers.propertyShape(key);
171
169
  result.path = `${AmfNamespace.aml.vocabularies.data.key}${input.info.name}`;
172
170
  if (required) {
173
171
  result.minCount = 1;
@@ -200,7 +198,7 @@ export class ShapeGenerator {
200
198
  if (unionType === UNION_TYPE_NOT) {
201
199
  // Need to investigate more about "not" union type.
202
200
  // AMF supports it, but I am not sure how to handle it.
203
- const wrapper = anyShape(input.key);
201
+ const wrapper = ShapeHelpers.anyShape(input.key);
204
202
  wrapper.id = `not-shape-${input.key}`;
205
203
  wrapper.not = items;
206
204
  return wrapper;
@@ -217,13 +215,13 @@ export class ShapeGenerator {
217
215
  createLinkedShape(input) {
218
216
  // This is a link to the schema. In an API that would be the id
219
217
  // of a resource to request the data from.
220
- const range = scalarShape(input.key);
218
+ const range = ShapeHelpers.scalarShape(input.key);
221
219
  range.id = `link-${input.key}`;
222
220
  range.dataType = modelTypeToAmfDataType(DATA_TYPE_STRING);
223
221
  return range;
224
222
  }
225
223
  createUnionShape(input, items) {
226
- const range = unionShape(input.key);
224
+ const range = ShapeHelpers.unionShape(input.key);
227
225
  this.updateBaseProperties(input, range);
228
226
  range.anyOf = [];
229
227
  const unionType = (input.schema && input.schema.unionType) || UNION_TYPE_ANY_OF;
@@ -326,7 +324,7 @@ export class ShapeGenerator {
326
324
  }
327
325
  }
328
326
  createArrayShape(input, schema, bindings) {
329
- const result = arrayShape(input.key);
327
+ const result = ShapeHelpers.arrayShape(input.key);
330
328
  const { type } = input;
331
329
  if (type === DATA_TYPE_BINARY) {
332
330
  // we do not pass schema to the range generator as we set schema's properties on the array shape.
@@ -342,7 +340,7 @@ export class ShapeGenerator {
342
340
  return result;
343
341
  }
344
342
  createScalarShape(input, schema, bindings) {
345
- const result = scalarShape(input.key);
343
+ const result = ShapeHelpers.scalarShape(input.key);
346
344
  this.updateBaseProperties(input, result);
347
345
  this.setScalarCommonProperties(result, input, bindings);
348
346
  if (!result.dataType) {
@@ -360,7 +358,7 @@ export class ShapeGenerator {
360
358
  id: nanoid(),
361
359
  customDomainProperties: [],
362
360
  strict: true,
363
- types: IAmfExampleTypes,
361
+ types: [...AmfTypes.IAmfExampleTypes],
364
362
  structuredValue: AmfDataNode.scalar(current, type).toJSON(),
365
363
  };
366
364
  result.push(item);
@@ -372,7 +370,7 @@ export class ShapeGenerator {
372
370
  id: nanoid(),
373
371
  customDomainProperties: [],
374
372
  strict: true,
375
- types: IAmfExampleTypes,
373
+ types: [...AmfTypes.IAmfExampleTypes],
376
374
  };
377
375
  const value = new AmfDataNode('array');
378
376
  for (const item of examples) {
@@ -383,7 +381,7 @@ export class ShapeGenerator {
383
381
  return [item];
384
382
  }
385
383
  createFileShape(input, bindings) {
386
- const result = fileShape(input.key);
384
+ const result = ShapeHelpers.fileShape(input.key);
387
385
  this.updateBaseProperties(input, result);
388
386
  if (bindings) {
389
387
  if (Array.isArray(bindings.fileTypes)) {
@@ -473,7 +471,7 @@ export class ShapeGenerator {
473
471
  }
474
472
  }
475
473
  createRecursiveShape(input) {
476
- return recursiveShape(input.key, input.key);
474
+ return ShapeHelpers.recursiveShape(input.key, input.key);
477
475
  }
478
476
  /**
479
477
  * Translates the shape to an array shape. This happens when data model property
@@ -484,7 +482,7 @@ export class ShapeGenerator {
484
482
  * @returns Array shape.
485
483
  */
486
484
  refactorShapeToArray(id, shape) {
487
- const result = arrayShape(id);
485
+ const result = ShapeHelpers.arrayShape(id);
488
486
  result.items = shape;
489
487
  return result;
490
488
  }