@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,26 +1,5 @@
1
1
  import { test } from '@japa/runner'
2
- import {
3
- IApiArrayShape,
4
- IApiDataExample,
5
- IApiFileShape,
6
- IApiNodeShape,
7
- IApiScalarNode,
8
- IApiScalarShape,
9
- IApiUnionShape,
10
- IApiXmlSerializer,
11
- IShapeUnion,
12
- } from '../../../../src/amf/definitions/Shapes.js'
13
- import {
14
- IAmfAnyTypes,
15
- IAmfArrayTypes,
16
- IAmfExampleTypes,
17
- IAmfFileTypes,
18
- IAmfNodeTypes,
19
- IAmfPropertyTypes,
20
- IAmfScalarTypes,
21
- IAmfUnionTypes,
22
- } from '../../../../src/amf/AmfTypes.js'
23
- import { AmfNamespace } from '../../../../src/amf/definitions/Namespace.js'
2
+ import { Shapes, AmfTypes, AmfNamespace } from '@api-client/amf-core'
24
3
  import { ShapeGenerator } from '../../../../src/modeling/amf/ShapeGenerator.js'
25
4
  import {
26
5
  type PropertyWebBindings,
@@ -43,10 +22,10 @@ test.group('entity()', (group) => {
43
22
  })
44
23
 
45
24
  test('returns the basic shape', ({ assert }) => {
46
- const result = e1.toApiShape() as IApiNodeShape
25
+ const result = e1.toApiShape() as Shapes.IApiNodeShape
47
26
 
48
27
  assert.equal(result.id, e1.key, 'has the id')
49
- assert.deepEqual(result.types, IAmfNodeTypes, 'has the types')
28
+ assert.deepEqual(result.types, AmfTypes.IAmfNodeTypes, 'has the types')
50
29
  assert.deepEqual(result.values, [], 'has the values')
51
30
  assert.deepEqual(result.inherits, [], 'has the inherits')
52
31
  assert.deepEqual(result.or, [], 'has the or')
@@ -60,35 +39,35 @@ test.group('entity()', (group) => {
60
39
 
61
40
  test('returns the display name', ({ assert }) => {
62
41
  e1.info.displayName = 'e 1 name'
63
- const result = e1.toApiShape() as IApiNodeShape
42
+ const result = e1.toApiShape() as Shapes.IApiNodeShape
64
43
 
65
44
  assert.equal(result.displayName, 'e 1 name')
66
45
  })
67
46
 
68
47
  test('returns the description', ({ assert }) => {
69
48
  e1.info.description = 'e 1 description'
70
- const result = e1.toApiShape() as IApiNodeShape
49
+ const result = e1.toApiShape() as Shapes.IApiNodeShape
71
50
 
72
51
  assert.equal(result.description, 'e 1 description')
73
52
  })
74
53
 
75
54
  test('returns the deprecated', ({ assert }) => {
76
55
  e1.deprecated = true
77
- const result = e1.toApiShape() as IApiNodeShape
56
+ const result = e1.toApiShape() as Shapes.IApiNodeShape
78
57
 
79
58
  assert.isTrue(result.deprecated)
80
59
  })
81
60
 
82
61
  test('returns empty properties', ({ assert }) => {
83
62
  e1.info.description = 'e 1 description'
84
- const result = e1.toApiShape() as IApiNodeShape
63
+ const result = e1.toApiShape() as Shapes.IApiNodeShape
85
64
 
86
65
  assert.deepEqual(result.properties, [])
87
66
  })
88
67
 
89
68
  test('returns defined properties', ({ assert }) => {
90
69
  e1.addProperty({ key: 'test', info: { name: 'test' } })
91
- const result = e1.toApiShape() as IApiNodeShape
70
+ const result = e1.toApiShape() as Shapes.IApiNodeShape
92
71
 
93
72
  assert.lengthOf(result.properties, 1)
94
73
  })
@@ -96,7 +75,7 @@ test.group('entity()', (group) => {
96
75
  test('adds associations to the properties', ({ assert }) => {
97
76
  e1.addProperty({ key: 'test', info: { name: 'test' } })
98
77
  e1.addAssociation({ info: { name: 'test association' } })
99
- const result = e1.toApiShape() as IApiNodeShape
78
+ const result = e1.toApiShape() as Shapes.IApiNodeShape
100
79
 
101
80
  assert.lengthOf(result.properties, 2)
102
81
  assert.equal(result.properties[1].name, 'test association')
@@ -105,7 +84,7 @@ test.group('entity()', (group) => {
105
84
  test('adds parents to the inherits', ({ assert }) => {
106
85
  const e2 = m1.addEntity({ key: 'e2', info: { name: 'e2' } })
107
86
  e1.addParent(e2.key)
108
- const result = e1.toApiShape() as IApiNodeShape
87
+ const result = e1.toApiShape() as Shapes.IApiNodeShape
109
88
 
110
89
  assert.lengthOf(result.inherits, 1)
111
90
  assert.equal(result.inherits[0].name, 'e2')
@@ -128,7 +107,7 @@ test.group('property() / just data model', (group) => {
128
107
  test('returns the basic shape', ({ assert }) => {
129
108
  const result = p1.toApiShape()
130
109
  assert.equal(result.id, p1.key, 'has the id')
131
- assert.deepEqual(result.types, IAmfPropertyTypes, 'has the types')
110
+ assert.deepEqual(result.types, AmfTypes.IAmfPropertyTypes, 'has the types')
132
111
  assert.deepEqual(result.values, [], 'has the values')
133
112
  assert.deepEqual(result.inherits, [], 'has the inherits')
134
113
  assert.deepEqual(result.or, [], 'has the or')
@@ -149,11 +128,11 @@ test.group('property() / just data model', (group) => {
149
128
  p1.info.displayName = 'string dn'
150
129
  p1.info.description = 'string desc'
151
130
  const result = p1.toApiShape()
152
- const range = result.range as IApiScalarShape
131
+ const range = result.range as Shapes.IApiScalarShape
153
132
 
154
133
  assert.typeOf(range, 'object', 'has the range')
155
134
  assert.equal(range.id, `scalar-shape-${p1.key}`, 'has the id')
156
- assert.deepEqual(range.types, IAmfScalarTypes, 'has the types')
135
+ assert.deepEqual(range.types, AmfTypes.IAmfScalarTypes, 'has the types')
157
136
  assert.equal(range.dataType, AmfNamespace.w3.xmlSchema.string, 'has the dataType')
158
137
  assert.equal(range.name, 'p1', 'has the name')
159
138
  assert.equal(range.displayName, 'string dn', 'has the displayName')
@@ -163,7 +142,7 @@ test.group('property() / just data model', (group) => {
163
142
  test('handles examples', ({ assert }) => {
164
143
  p1.schema = { examples: ['example1', 'example2'] }
165
144
  const result = p1.toApiShape()
166
- const range = result.range as IApiScalarShape
145
+ const range = result.range as Shapes.IApiScalarShape
167
146
  assert.lengthOf(range.examples, 2)
168
147
  assert.property(range.examples[0], 'structuredValue')
169
148
  assert.property(range.examples[1], 'structuredValue')
@@ -172,7 +151,7 @@ test.group('property() / just data model', (group) => {
172
151
  test('handles defaultValue', ({ assert }) => {
173
152
  p1.schema = { defaultValue: { value: 'defaultValue', type: 'literal' } }
174
153
  const result = p1.toApiShape()
175
- const range = result.range as IApiScalarShape
154
+ const range = result.range as Shapes.IApiScalarShape
176
155
  assert.property(range, 'defaultValue')
177
156
  assert.containsSubset(range.defaultValue, {
178
157
  value: 'defaultValue',
@@ -182,7 +161,7 @@ test.group('property() / just data model', (group) => {
182
161
  test('handles enum', ({ assert }) => {
183
162
  p1.schema = { enum: ['enum1', 'enum2'] }
184
163
  const result = p1.toApiShape()
185
- const range = result.range as IApiScalarShape
164
+ const range = result.range as Shapes.IApiScalarShape
186
165
  assert.lengthOf(range.values, 2)
187
166
  assert.containsSubset(range.values[0], {
188
167
  dataType: AmfNamespace.w3.xmlSchema.string,
@@ -197,7 +176,7 @@ test.group('property() / just data model', (group) => {
197
176
  test('has the default range for a number', ({ assert }) => {
198
177
  p1.type = 'number'
199
178
  const result = p1.toApiShape()
200
- const range = result.range as IApiScalarShape
179
+ const range = result.range as Shapes.IApiScalarShape
201
180
 
202
181
  assert.typeOf(range, 'object', 'has the range')
203
182
  assert.equal(range.dataType, AmfNamespace.w3.xmlSchema.number, 'has the dataType')
@@ -220,7 +199,7 @@ test.group('property() / just data model', (group) => {
220
199
  test('handles multiple properties', ({ assert }) => {
221
200
  p1.multiple = true
222
201
  const result = p1.toApiShape()
223
- const range = result.range as IApiArrayShape
202
+ const range = result.range as Shapes.IApiArrayShape
224
203
  assert.property(range, 'items')
225
204
  })
226
205
 
@@ -229,7 +208,7 @@ test.group('property() / just data model', (group) => {
229
208
  const bindings = p1.getWebBinding() as PropertyWebBindings
230
209
  bindings.format = 'base64'
231
210
  const result = p1.toApiShape()
232
- const range = result.range as IApiFileShape
211
+ const range = result.range as Shapes.IApiFileShape
233
212
  assert.equal(range.format, AmfNamespace.w3.xmlSchema.base64Binary)
234
213
  })
235
214
 
@@ -238,7 +217,7 @@ test.group('property() / just data model', (group) => {
238
217
  const bindings = p1.getWebBinding()
239
218
  bindings.format = 'int32'
240
219
  const result = p1.toApiShape()
241
- const range = result.range as IApiScalarShape
220
+ const range = result.range as Shapes.IApiScalarShape
242
221
 
243
222
  assert.typeOf(range, 'object', 'has the range')
244
223
  assert.equal(range.dataType, AmfNamespace.w3.xmlSchema.integer, 'has the dataType')
@@ -249,7 +228,7 @@ test.group('property() / just data model', (group) => {
249
228
  const bindings = p1.getWebBinding()
250
229
  bindings.format = 'int64'
251
230
  const result = p1.toApiShape()
252
- const range = result.range as IApiScalarShape
231
+ const range = result.range as Shapes.IApiScalarShape
253
232
 
254
233
  assert.typeOf(range, 'object', 'has the range')
255
234
  assert.equal(range.dataType, AmfNamespace.w3.xmlSchema.integer, 'has the dataType')
@@ -258,7 +237,7 @@ test.group('property() / just data model', (group) => {
258
237
  test('has the default range for a date', ({ assert }) => {
259
238
  p1.type = 'date'
260
239
  const result = p1.toApiShape()
261
- const range = result.range as IApiScalarShape
240
+ const range = result.range as Shapes.IApiScalarShape
262
241
 
263
242
  assert.typeOf(range, 'object', 'has the range')
264
243
  assert.equal(range.dataType, AmfNamespace.w3.xmlSchema.date, 'has the dataType')
@@ -267,7 +246,7 @@ test.group('property() / just data model', (group) => {
267
246
  test('has the default range for a datetime', ({ assert }) => {
268
247
  p1.type = 'datetime'
269
248
  const result = p1.toApiShape()
270
- const range = result.range as IApiScalarShape
249
+ const range = result.range as Shapes.IApiScalarShape
271
250
 
272
251
  assert.typeOf(range, 'object', 'has the range')
273
252
  assert.equal(range.dataType, AmfNamespace.w3.xmlSchema.dateTime, 'has the dataType')
@@ -276,7 +255,7 @@ test.group('property() / just data model', (group) => {
276
255
  test('has the default range for a time', ({ assert }) => {
277
256
  p1.type = 'time'
278
257
  const result = p1.toApiShape()
279
- const range = result.range as IApiScalarShape
258
+ const range = result.range as Shapes.IApiScalarShape
280
259
 
281
260
  assert.typeOf(range, 'object', 'has the range')
282
261
  assert.equal(range.dataType, AmfNamespace.aml.vocabularies.shapes.dateTimeOnly, 'has the dataType')
@@ -285,7 +264,7 @@ test.group('property() / just data model', (group) => {
285
264
  // test('has the default range for a nil', ({ assert }) => {
286
265
  // p1.type = 'nil'
287
266
  // const result = p1.toApiShape()
288
- // const range = result.range as IApiScalarShape
267
+ // const range = result.range as Shapes.IApiScalarShape
289
268
 
290
269
  // assert.typeOf(range, 'object', 'has the range')
291
270
  // assert.equal(range.dataType, AmfNamespace.aml.vocabularies.shapes.nil, 'has the dataType')
@@ -294,7 +273,7 @@ test.group('property() / just data model', (group) => {
294
273
  test('has the default range for a boolean', ({ assert }) => {
295
274
  p1.type = 'boolean'
296
275
  const result = p1.toApiShape()
297
- const range = result.range as IApiScalarShape
276
+ const range = result.range as Shapes.IApiScalarShape
298
277
 
299
278
  assert.typeOf(range, 'object', 'has the range')
300
279
  assert.equal(range.dataType, AmfNamespace.aml.vocabularies.shapes.boolean, 'has the dataType')
@@ -303,7 +282,7 @@ test.group('property() / just data model', (group) => {
303
282
  // test('has the default range for an any', ({ assert }) => {
304
283
  // p1.type = 'any'
305
284
  // const result = p1.toApiShape()
306
- // const range = result.range as IApiScalarShape
285
+ // const range = result.range as Shapes.IApiScalarShape
307
286
 
308
287
  // assert.typeOf(range, 'object', 'has the range')
309
288
  // assert.equal(range.dataType, AmfNamespace.aml.vocabularies.shapes.AnyShape, 'has the dataType')
@@ -314,11 +293,11 @@ test.group('property() / just data model', (group) => {
314
293
  p1.info.displayName = 'string dn'
315
294
  p1.info.description = 'string desc'
316
295
  const result = p1.toApiShape()
317
- const range = result.range as IApiFileShape
296
+ const range = result.range as Shapes.IApiFileShape
318
297
 
319
298
  assert.typeOf(range, 'object', 'has the range')
320
299
  assert.equal(range.id, `file-shape-${p1.key}`, 'has the id')
321
- assert.deepEqual(range.types, IAmfFileTypes, 'has the types')
300
+ assert.deepEqual(range.types, AmfTypes.IAmfFileTypes, 'has the types')
322
301
  assert.equal(range.name, 'p1', 'has the name')
323
302
  assert.equal(range.displayName, 'string dn', 'has the displayName')
324
303
  assert.equal(range.description, 'string desc', 'has the description')
@@ -329,17 +308,17 @@ test.group('property() / just data model', (group) => {
329
308
  p1.info.displayName = 'string dn'
330
309
  p1.info.description = 'string desc'
331
310
  const result = p1.toApiShape()
332
- const range = result.range as IApiArrayShape
311
+ const range = result.range as Shapes.IApiArrayShape
333
312
 
334
313
  assert.typeOf(range, 'object', 'has the range')
335
314
  assert.equal(range.id, `array-shape-${p1.key}`, 'has the id')
336
- assert.deepEqual(range.types, IAmfArrayTypes, 'has the types')
315
+ assert.deepEqual(range.types, AmfTypes.IAmfArrayTypes, 'has the types')
337
316
 
338
- const items = range.items as IApiScalarShape
317
+ const items = range.items as Shapes.IApiScalarShape
339
318
 
340
319
  assert.typeOf(items, 'object', 'has the items')
341
320
  assert.equal(items.id, `scalar-shape-${p1.key}`, 'has the id')
342
- assert.deepEqual(items.types, IAmfScalarTypes, 'has the types')
321
+ assert.deepEqual(items.types, AmfTypes.IAmfScalarTypes, 'has the types')
343
322
 
344
323
  assert.equal(items.name, 'p1', 'has the name')
345
324
  assert.equal(items.displayName, 'string dn', 'has the displayName')
@@ -352,17 +331,17 @@ test.group('property() / just data model', (group) => {
352
331
  p1.info.displayName = 'string dn'
353
332
  p1.info.description = 'string desc'
354
333
  const result = p1.toApiShape()
355
- const range = result.range as IApiArrayShape
334
+ const range = result.range as Shapes.IApiArrayShape
356
335
 
357
336
  assert.typeOf(range, 'object', 'has the range')
358
337
  assert.equal(range.id, `array-shape-${p1.key}`, 'has the id')
359
- assert.deepEqual(range.types, IAmfArrayTypes, 'has the types')
338
+ assert.deepEqual(range.types, AmfTypes.IAmfArrayTypes, 'has the types')
360
339
 
361
- const items = range.items as IApiFileShape
340
+ const items = range.items as Shapes.IApiFileShape
362
341
 
363
342
  assert.typeOf(items, 'object', 'has the items')
364
343
  assert.equal(items.id, `file-shape-${p1.key}`, 'has the id')
365
- assert.deepEqual(items.types, IAmfFileTypes, 'has the types')
344
+ assert.deepEqual(items.types, AmfTypes.IAmfFileTypes, 'has the types')
366
345
 
367
346
  assert.equal(items.name, 'p1', 'has the name')
368
347
  assert.equal(items.displayName, 'string dn', 'has the displayName')
@@ -392,7 +371,7 @@ test.group('property() / with web bindings', (group) => {
392
371
  },
393
372
  ]
394
373
  const result = p1.toApiShape()
395
- const string = result.range as IApiScalarShape
374
+ const string = result.range as Shapes.IApiScalarShape
396
375
 
397
376
  assert.equal(string.name, 'other', 'the range has the changed name')
398
377
  assert.equal(result.name, 'other', 'the property has the changed name')
@@ -409,13 +388,13 @@ test.group('property() / with web bindings', (group) => {
409
388
  // },
410
389
  // ]
411
390
  // const result = p1.toApiShape()
412
- // const string = result.range as IApiScalarShape
391
+ // const string = result.range as Shapes.IApiScalarShape
413
392
  // assert.equal(string.dataType, AmfNamespace.w3.xmlSchema.date)
414
393
  // })
415
394
 
416
395
  test('sets the xml serialization', ({ assert }) => {
417
396
  const p1 = e1.addProperty({ key: 'p1', type: 'string', info: { name: 'p1' } })
418
- const value: IApiXmlSerializer = {
397
+ const value: Shapes.IApiXmlSerializer = {
419
398
  id: '',
420
399
  types: [],
421
400
  customDomainProperties: [],
@@ -430,7 +409,7 @@ test.group('property() / with web bindings', (group) => {
430
409
  },
431
410
  ]
432
411
  const result = p1.toApiShape()
433
- const string = result.range as IApiScalarShape
412
+ const string = result.range as Shapes.IApiScalarShape
434
413
  assert.deepEqual(string.xmlSerialization, value)
435
414
  })
436
415
 
@@ -446,7 +425,7 @@ test.group('property() / with web bindings', (group) => {
446
425
  },
447
426
  ]
448
427
  const result = p1.toApiShape()
449
- const file = result.range as IApiFileShape
428
+ const file = result.range as Shapes.IApiFileShape
450
429
  assert.deepEqual(file.fileTypes, value)
451
430
  })
452
431
 
@@ -456,7 +435,7 @@ test.group('property() / with web bindings', (group) => {
456
435
  pattern: 'a-z',
457
436
  }
458
437
  const result = p1.toApiShape()
459
- const string = result.range as IApiScalarShape
438
+ const string = result.range as Shapes.IApiScalarShape
460
439
  assert.equal(string.pattern, 'a-z')
461
440
  })
462
441
 
@@ -466,7 +445,7 @@ test.group('property() / with web bindings', (group) => {
466
445
  minimum: 1,
467
446
  }
468
447
  const result = p1.toApiShape()
469
- const string = result.range as IApiScalarShape
448
+ const string = result.range as Shapes.IApiScalarShape
470
449
  assert.equal(string.minLength, 1)
471
450
  })
472
451
 
@@ -476,7 +455,7 @@ test.group('property() / with web bindings', (group) => {
476
455
  maximum: 1,
477
456
  }
478
457
  const result = p1.toApiShape()
479
- const string = result.range as IApiScalarShape
458
+ const string = result.range as Shapes.IApiScalarShape
480
459
  assert.equal(string.maxLength, 1)
481
460
  })
482
461
 
@@ -486,7 +465,7 @@ test.group('property() / with web bindings', (group) => {
486
465
  minimum: 1,
487
466
  }
488
467
  const result = p1.toApiShape()
489
- const string = result.range as IApiScalarShape
468
+ const string = result.range as Shapes.IApiScalarShape
490
469
  assert.equal(string.minimum, 1)
491
470
  })
492
471
 
@@ -496,7 +475,7 @@ test.group('property() / with web bindings', (group) => {
496
475
  maximum: 1,
497
476
  }
498
477
  const result = p1.toApiShape()
499
- const string = result.range as IApiScalarShape
478
+ const string = result.range as Shapes.IApiScalarShape
500
479
  assert.equal(string.maximum, 1)
501
480
  })
502
481
 
@@ -506,7 +485,7 @@ test.group('property() / with web bindings', (group) => {
506
485
  multipleOf: 1,
507
486
  }
508
487
  const result = p1.toApiShape()
509
- const string = result.range as IApiScalarShape
488
+ const string = result.range as Shapes.IApiScalarShape
510
489
  assert.equal(string.multipleOf, 1)
511
490
  })
512
491
 
@@ -516,7 +495,7 @@ test.group('property() / with web bindings', (group) => {
516
495
  exclusiveMinimum: true,
517
496
  }
518
497
  const result = p1.toApiShape()
519
- const string = result.range as IApiScalarShape
498
+ const string = result.range as Shapes.IApiScalarShape
520
499
  assert.isTrue(string.exclusiveMinimum)
521
500
  })
522
501
 
@@ -526,7 +505,7 @@ test.group('property() / with web bindings', (group) => {
526
505
  exclusiveMaximum: false,
527
506
  }
528
507
  const result = p1.toApiShape()
529
- const string = result.range as IApiScalarShape
508
+ const string = result.range as Shapes.IApiScalarShape
530
509
  assert.isFalse(string.exclusiveMaximum)
531
510
  })
532
511
 
@@ -536,7 +515,7 @@ test.group('property() / with web bindings', (group) => {
536
515
  exclusiveMaximum: true,
537
516
  }
538
517
  const result = p1.toApiShape()
539
- const string = result.range as IApiScalarShape
518
+ const string = result.range as Shapes.IApiScalarShape
540
519
  assert.isTrue(string.exclusiveMaximum)
541
520
  })
542
521
 
@@ -551,7 +530,7 @@ test.group('property() / with web bindings', (group) => {
551
530
  },
552
531
  ]
553
532
  const result = p1.toApiShape()
554
- const string = result.range as IApiScalarShape
533
+ const string = result.range as Shapes.IApiScalarShape
555
534
  assert.equal(string.format, AmfNamespace.w3.xmlSchema.float)
556
535
  })
557
536
  })
@@ -573,9 +552,9 @@ test.group('property() / with schema', (group) => {
573
552
  defaultValue: { value: '123', type: 'literal' },
574
553
  }
575
554
  const result = p1.toApiShape()
576
- const range = result.range as IApiScalarShape
555
+ const range = result.range as Shapes.IApiScalarShape
577
556
  assert.typeOf(range.defaultValue, 'object', 'has the defaultValue')
578
- const value = range.defaultValue as IApiScalarNode
557
+ const value = range.defaultValue as Shapes.IApiScalarNode
579
558
  assert.strictEqual(value.value, '123', 'has the value')
580
559
  assert.equal(value.dataType, AmfNamespace.w3.xmlSchema.number, 'has the range data type')
581
560
  })
@@ -586,9 +565,9 @@ test.group('property() / with schema', (group) => {
586
565
  enum: ['123'],
587
566
  }
588
567
  const result = p1.toApiShape()
589
- const range = result.range as IApiScalarShape
568
+ const range = result.range as Shapes.IApiScalarShape
590
569
  assert.typeOf(range.values, 'array', 'has the values')
591
- const value = range.values[0] as IApiScalarNode
570
+ const value = range.values[0] as Shapes.IApiScalarNode
592
571
  assert.strictEqual(value.value, '123', 'has the value')
593
572
  assert.equal(value.dataType, AmfNamespace.w3.xmlSchema.number, 'has the range data type')
594
573
  })
@@ -599,16 +578,16 @@ test.group('property() / with schema', (group) => {
599
578
  examples: ['123'],
600
579
  }
601
580
  const result = p1.toApiShape()
602
- const range = result.range as IApiScalarShape
581
+ const range = result.range as Shapes.IApiScalarShape
603
582
  assert.typeOf(range.examples, 'array', 'has the examples')
604
- const example = range.examples[0] as IApiDataExample
583
+ const example = range.examples[0] as Shapes.IApiDataExample
605
584
 
606
585
  assert.typeOf(example.id, 'string', 'has the example.id')
607
586
  assert.isNotEmpty(example.id, 'the example.id is not empty')
608
- assert.deepEqual(example.types, IAmfExampleTypes, 'the example.types')
587
+ assert.deepEqual(example.types, AmfTypes.IAmfExampleTypes, 'the example.types')
609
588
  assert.typeOf(example.structuredValue, 'object', 'has the example.structuredValue')
610
589
 
611
- const value = example.structuredValue as IApiScalarNode
590
+ const value = example.structuredValue as Shapes.IApiScalarNode
612
591
  assert.strictEqual(value.value, '123', 'has the value')
613
592
  assert.equal(value.dataType, AmfNamespace.w3.xmlSchema.string, 'has the range data type')
614
593
  })
@@ -631,9 +610,9 @@ test.group('property() / default value functions', (group) => {
631
610
  p1.schema = { defaultValue: { value: 'random', type: 'function' } }
632
611
  const generator = new ShapeGenerator()
633
612
  const result = generator.property(p1)
634
- const range = result.range as IApiScalarShape
613
+ const range = result.range as Shapes.IApiScalarShape
635
614
  assert.typeOf(range.defaultValue, 'object')
636
- const value = range.defaultValue as IApiScalarNode
615
+ const value = range.defaultValue as Shapes.IApiScalarNode
637
616
  assert.typeOf(value.value, 'string')
638
617
  assert.lengthOf(value.value as string, 8)
639
618
  })
@@ -642,9 +621,9 @@ test.group('property() / default value functions', (group) => {
642
621
  p1.schema = { defaultValue: { value: 'uuid-v4', type: 'function' } }
643
622
  const generator = new ShapeGenerator()
644
623
  const result = generator.property(p1)
645
- const range = result.range as IApiScalarShape
624
+ const range = result.range as Shapes.IApiScalarShape
646
625
  assert.typeOf(range.defaultValue, 'object')
647
- const value = range.defaultValue as IApiScalarNode
626
+ const value = range.defaultValue as Shapes.IApiScalarNode
648
627
  assert.typeOf(value.value, 'string')
649
628
  assert.lengthOf(value.value as string, 36)
650
629
  assert.match(value.value as string, /^[0-9a-f-]+$/)
@@ -655,16 +634,16 @@ test.group('property() / default value functions', (group) => {
655
634
  p1.schema = { defaultValue: { value: 'incremental', type: 'function' } }
656
635
  const generator = new ShapeGenerator()
657
636
  const result1 = generator.property(p1)
658
- const range1 = result1.range as IApiScalarShape
637
+ const range1 = result1.range as Shapes.IApiScalarShape
659
638
  assert.typeOf(range1.defaultValue, 'object')
660
- const value1 = range1.defaultValue as IApiScalarNode
639
+ const value1 = range1.defaultValue as Shapes.IApiScalarNode
661
640
  assert.typeOf(value1.value, 'string')
662
641
  assert.equal(parseInt(value1.value as string), 0)
663
642
 
664
643
  const result2 = generator.property(p1)
665
- const range2 = result2.range as IApiScalarShape
644
+ const range2 = result2.range as Shapes.IApiScalarShape
666
645
  assert.typeOf(range2.defaultValue, 'object')
667
- const value2 = range2.defaultValue as IApiScalarNode
646
+ const value2 = range2.defaultValue as Shapes.IApiScalarNode
668
647
  assert.typeOf(value2.value, 'string')
669
648
  assert.equal(parseInt(value2.value as string), 1)
670
649
  })
@@ -674,9 +653,9 @@ test.group('property() / default value functions', (group) => {
674
653
  p1.schema = { defaultValue: { value: 'now', type: 'function' } }
675
654
  const generator = new ShapeGenerator()
676
655
  const result = generator.property(p1)
677
- const range = result.range as IApiScalarShape
656
+ const range = result.range as Shapes.IApiScalarShape
678
657
  assert.typeOf(range.defaultValue, 'object')
679
- const value = range.defaultValue as IApiScalarNode
658
+ const value = range.defaultValue as Shapes.IApiScalarNode
680
659
  assert.typeOf(value.value, 'string')
681
660
  assert.match(value.value as string, /^\d{4}-\d{2}-\d{2}$/)
682
661
  })
@@ -686,9 +665,9 @@ test.group('property() / default value functions', (group) => {
686
665
  p1.schema = { defaultValue: { value: 'now', type: 'function' } }
687
666
  const generator = new ShapeGenerator()
688
667
  const result = generator.property(p1)
689
- const range = result.range as IApiScalarShape
668
+ const range = result.range as Shapes.IApiScalarShape
690
669
  assert.typeOf(range.defaultValue, 'object')
691
- const value = range.defaultValue as IApiScalarNode
670
+ const value = range.defaultValue as Shapes.IApiScalarNode
692
671
  assert.typeOf(value.value, 'string')
693
672
  assert.match(value.value as string, /^\d{2}:\d{2}:\d{2}$/)
694
673
  })
@@ -698,9 +677,9 @@ test.group('property() / default value functions', (group) => {
698
677
  p1.schema = { defaultValue: { value: 'now', type: 'function' } }
699
678
  const generator = new ShapeGenerator()
700
679
  const result = generator.property(p1)
701
- const range = result.range as IApiScalarShape
680
+ const range = result.range as Shapes.IApiScalarShape
702
681
  assert.typeOf(range.defaultValue, 'object')
703
- const value = range.defaultValue as IApiScalarNode
682
+ const value = range.defaultValue as Shapes.IApiScalarNode
704
683
  assert.typeOf(value.value, 'string')
705
684
  assert.match(value.value as string, /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}$/)
706
685
  })
@@ -709,7 +688,7 @@ test.group('property() / default value functions', (group) => {
709
688
  p1.schema = { defaultValue: { value: 'unsupported', type: 'function' } }
710
689
  const generator = new ShapeGenerator()
711
690
  const result = generator.property(p1)
712
- const range = result.range as IApiScalarShape
691
+ const range = result.range as Shapes.IApiScalarShape
713
692
  assert.isUndefined(range.defaultValue)
714
693
  })
715
694
  })
@@ -730,8 +709,8 @@ test.group('refactorArrayToShape()', (group) => {
730
709
  test('returns the array items', ({ assert }) => {
731
710
  p1.multiple = true
732
711
  const parameter = p1.toApiShape()
733
- const range = parameter.range as IApiArrayShape
734
- const shape = range.items as IApiScalarShape
712
+ const range = parameter.range as Shapes.IApiArrayShape
713
+ const shape = range.items as Shapes.IApiScalarShape
735
714
  assert.deepEqual(range.items, shape)
736
715
  })
737
716
  })
@@ -751,15 +730,15 @@ test.group('refactorShapeToArray()', (group) => {
751
730
 
752
731
  test('returns the array items', ({ assert }) => {
753
732
  const parameter = p1.toApiShape()
754
- const range = parameter.range as IApiScalarShape
733
+ const range = parameter.range as Shapes.IApiScalarShape
755
734
  const generator = new ShapeGenerator()
756
735
  const result = generator['refactorShapeToArray'](p1.key, range)
757
736
 
758
737
  assert.typeOf(result, 'object', 'has the range')
759
738
  assert.equal(result.id, `array-shape-${p1.key}`, 'has the id')
760
- assert.deepEqual(result.types, IAmfArrayTypes, 'has the types')
739
+ assert.deepEqual(result.types, AmfTypes.IAmfArrayTypes, 'has the types')
761
740
 
762
- const items = result.items as IApiScalarShape
741
+ const items = result.items as Shapes.IApiScalarShape
763
742
  assert.deepEqual(items, range)
764
743
  })
765
744
  })
@@ -787,7 +766,7 @@ test.group('associationProperty()', (group) => {
787
766
  assert.typeOf(result, 'object')
788
767
 
789
768
  assert.equal(result.id, a1.key, 'has the id')
790
- assert.deepEqual(result.types, IAmfPropertyTypes, 'has the types')
769
+ assert.deepEqual(result.types, AmfTypes.IAmfPropertyTypes, 'has the types')
791
770
  assert.deepEqual(result.values, [], 'has the values')
792
771
  assert.deepEqual(result.inherits, [], 'has the inherits')
793
772
  assert.deepEqual(result.or, [], 'has the or')
@@ -795,19 +774,19 @@ test.group('associationProperty()', (group) => {
795
774
  assert.deepEqual(result.xone, [], 'has the xone')
796
775
  assert.equal(result.path, AmfNamespace.aml.vocabularies.data.key + 'a1', 'has the path')
797
776
 
798
- const range = result.range as IApiNodeShape
777
+ const range = result.range as Shapes.IApiNodeShape
799
778
  assert.typeOf(range, 'object', 'has the range')
800
- assert.deepEqual(range.types, IAmfNodeTypes, 'range has the types')
779
+ assert.deepEqual(range.types, AmfTypes.IAmfNodeTypes, 'range has the types')
801
780
  assert.equal(range.name, 'e2', 'range has the name')
802
781
  assert.lengthOf(range.properties, 1, 'range has the properties')
803
782
 
804
783
  const [prop] = range.properties
805
784
  assert.equal(prop.id, p2.key, 'property has the id')
806
- assert.deepEqual(prop.types, IAmfPropertyTypes, 'property has the types')
785
+ assert.deepEqual(prop.types, AmfTypes.IAmfPropertyTypes, 'property has the types')
807
786
 
808
- const pRange = prop.range as IApiScalarShape
787
+ const pRange = prop.range as Shapes.IApiScalarShape
809
788
  assert.typeOf(pRange, 'object', 'property range is an object')
810
- assert.deepEqual(pRange.types, IAmfScalarTypes, 'property range has the types')
789
+ assert.deepEqual(pRange.types, AmfTypes.IAmfScalarTypes, 'property range has the types')
811
790
  assert.equal(pRange.name, 'p2', 'property range has the name')
812
791
  assert.equal(pRange.dataType, AmfNamespace.w3.xmlSchema.number, 'property range has the dataType')
813
792
  })
@@ -836,9 +815,9 @@ test.group('associationProperty()', (group) => {
836
815
  test('returns a link definition when created on the schema', ({ assert }) => {
837
816
  a1.schema = { linked: true }
838
817
  const result = a1.toApiShape()
839
- const range = result.range as IApiScalarShape
818
+ const range = result.range as Shapes.IApiScalarShape
840
819
  assert.equal(range.id, `link-${a1.key}`)
841
- assert.deepEqual(range.types, IAmfScalarTypes)
820
+ assert.deepEqual(range.types, AmfTypes.IAmfScalarTypes)
842
821
  assert.equal(range.dataType, AmfNamespace.w3.xmlSchema.string)
843
822
  })
844
823
 
@@ -846,16 +825,16 @@ test.group('associationProperty()', (group) => {
846
825
  const e3 = m1.addEntity({ key: 'e3', info: { name: 'e3' } })
847
826
  a1.addTarget(e3)
848
827
  const result = a1.toApiShape()
849
- const range = result.range as IApiUnionShape
828
+ const range = result.range as Shapes.IApiUnionShape
850
829
 
851
830
  assert.typeOf(range, 'object', 'has the range')
852
831
  assert.equal(range.id, `union-shape-${a1.key}`, 'the range has the id')
853
- assert.deepEqual(range.types, IAmfUnionTypes, 'the range has the types')
832
+ assert.deepEqual(range.types, AmfTypes.IAmfUnionTypes, 'the range has the types')
854
833
  assert.lengthOf(range.anyOf, 2, 'has the anyOf array')
855
- const [p1, p2] = range.anyOf as IApiNodeShape[]
834
+ const [p1, p2] = range.anyOf as Shapes.IApiNodeShape[]
856
835
 
857
- assert.deepEqual(p1.types, IAmfNodeTypes, 'p1 has the types')
858
- assert.deepEqual(p2.types, IAmfNodeTypes, 'p2 has the types')
836
+ assert.deepEqual(p1.types, AmfTypes.IAmfNodeTypes, 'p1 has the types')
837
+ assert.deepEqual(p2.types, AmfTypes.IAmfNodeTypes, 'p2 has the types')
859
838
  assert.lengthOf(p1.properties, 1, 'p1 has the properties')
860
839
  assert.lengthOf(p2.properties, 0, 'p2 has the properties')
861
840
  })
@@ -869,12 +848,12 @@ test.group('associationProperty()', (group) => {
869
848
  test('returns an array shape when multiple', ({ assert }) => {
870
849
  a1.multiple = true
871
850
  const result = a1.toApiShape()
872
- const range = result.range as IApiArrayShape
873
- assert.deepEqual(range.types, IAmfArrayTypes)
851
+ const range = result.range as Shapes.IApiArrayShape
852
+ assert.deepEqual(range.types, AmfTypes.IAmfArrayTypes)
874
853
 
875
- const arrayRange = range.items as IApiNodeShape
854
+ const arrayRange = range.items as Shapes.IApiNodeShape
876
855
  assert.typeOf(arrayRange, 'object', 'has the range')
877
- assert.deepEqual(arrayRange.types, IAmfNodeTypes, 'range has the types')
856
+ assert.deepEqual(arrayRange.types, AmfTypes.IAmfNodeTypes, 'range has the types')
878
857
  assert.equal(arrayRange.name, 'e2', 'range has the name')
879
858
  assert.lengthOf(arrayRange.properties, 1, 'range has the properties')
880
859
  })
@@ -885,16 +864,16 @@ test.group('associationProperty()', (group) => {
885
864
  const e3 = m1.addEntity({ key: 'e3', info: { name: 'e3' } })
886
865
  a1.addTarget(e3)
887
866
  const result = a1.toApiShape()
888
- const range = result.range as IApiUnionShape
867
+ const range = result.range as Shapes.IApiUnionShape
889
868
 
890
869
  assert.typeOf(range, 'object', 'has the range')
891
870
  assert.equal(range.id, `union-shape-${a1.key}`, 'the range has the id')
892
- assert.deepEqual(range.types, IAmfUnionTypes, 'the range has the types')
871
+ assert.deepEqual(range.types, AmfTypes.IAmfUnionTypes, 'the range has the types')
893
872
  assert.lengthOf(range.anyOf, 2, 'has the anyOf array')
894
- const [p1, p2] = range.anyOf as IApiNodeShape[]
873
+ const [p1, p2] = range.anyOf as Shapes.IApiNodeShape[]
895
874
 
896
- assert.deepEqual(p1.types, IAmfNodeTypes, 'p1 has the types')
897
- assert.deepEqual(p2.types, IAmfNodeTypes, 'p2 has the types')
875
+ assert.deepEqual(p1.types, AmfTypes.IAmfNodeTypes, 'p1 has the types')
876
+ assert.deepEqual(p2.types, AmfTypes.IAmfNodeTypes, 'p2 has the types')
898
877
  assert.lengthOf(p1.properties, 1, 'p1 has the properties')
899
878
  assert.lengthOf(p2.properties, 0, 'p2 has the properties')
900
879
  })
@@ -905,16 +884,16 @@ test.group('associationProperty()', (group) => {
905
884
  const e3 = m1.addEntity({ key: 'e3', info: { name: 'e3' } })
906
885
  a1.addTarget(e3)
907
886
  const result = a1.toApiShape()
908
- const range = result.range as IApiUnionShape
887
+ const range = result.range as Shapes.IApiUnionShape
909
888
 
910
889
  assert.typeOf(range, 'object', 'has the range')
911
890
  assert.equal(range.id, `union-shape-${a1.key}`, 'the range has the id')
912
- assert.deepEqual(range.types, IAmfUnionTypes, 'the range has the types')
891
+ assert.deepEqual(range.types, AmfTypes.IAmfUnionTypes, 'the range has the types')
913
892
  assert.lengthOf(range.and, 2, 'has the anyOf array')
914
- const [p1, p2] = range.and as IApiNodeShape[]
893
+ const [p1, p2] = range.and as Shapes.IApiNodeShape[]
915
894
 
916
- assert.deepEqual(p1.types, IAmfNodeTypes, 'p1 has the types')
917
- assert.deepEqual(p2.types, IAmfNodeTypes, 'p2 has the types')
895
+ assert.deepEqual(p1.types, AmfTypes.IAmfNodeTypes, 'p1 has the types')
896
+ assert.deepEqual(p2.types, AmfTypes.IAmfNodeTypes, 'p2 has the types')
918
897
  assert.lengthOf(p1.properties, 1, 'p1 has the properties')
919
898
  assert.lengthOf(p2.properties, 0, 'p2 has the properties')
920
899
  })
@@ -925,16 +904,16 @@ test.group('associationProperty()', (group) => {
925
904
  const e3 = m1.addEntity({ key: 'e3', info: { name: 'e3' } })
926
905
  a1.addTarget(e3)
927
906
  const result = a1.toApiShape()
928
- const range = result.range as IApiUnionShape
907
+ const range = result.range as Shapes.IApiUnionShape
929
908
 
930
909
  assert.typeOf(range, 'object', 'has the range')
931
910
  assert.equal(range.id, `union-shape-${a1.key}`, 'the range has the id')
932
- assert.deepEqual(range.types, IAmfUnionTypes, 'the range has the types')
911
+ assert.deepEqual(range.types, AmfTypes.IAmfUnionTypes, 'the range has the types')
933
912
  assert.lengthOf(range.xone, 2, 'has the oneOf array')
934
- const [p1, p2] = range.xone as IApiNodeShape[]
913
+ const [p1, p2] = range.xone as Shapes.IApiNodeShape[]
935
914
 
936
- assert.deepEqual(p1.types, IAmfNodeTypes, 'p1 has the types')
937
- assert.deepEqual(p2.types, IAmfNodeTypes, 'p2 has the types')
915
+ assert.deepEqual(p1.types, AmfTypes.IAmfNodeTypes, 'p1 has the types')
916
+ assert.deepEqual(p2.types, AmfTypes.IAmfNodeTypes, 'p2 has the types')
938
917
  assert.lengthOf(p1.properties, 1, 'p1 has the properties')
939
918
  assert.lengthOf(p2.properties, 0, 'p2 has the properties')
940
919
  })
@@ -945,16 +924,16 @@ test.group('associationProperty()', (group) => {
945
924
  const e3 = m1.addEntity({ key: 'e3', info: { name: 'e3' } })
946
925
  a1.addTarget(e3)
947
926
  const result = a1.toApiShape()
948
- const range = result.range as IApiUnionShape
927
+ const range = result.range as Shapes.IApiUnionShape
949
928
 
950
929
  assert.typeOf(range, 'object', 'has the range')
951
930
  assert.equal(range.id, `union-shape-${a1.key}`, 'the range has the id')
952
- assert.deepEqual(range.types, IAmfUnionTypes, 'the range has the types')
931
+ assert.deepEqual(range.types, AmfTypes.IAmfUnionTypes, 'the range has the types')
953
932
  assert.typeOf(range.not, 'object', 'has the not object')
954
933
 
955
- const not = range.not as IApiNodeShape
956
- assert.deepEqual(not.types, IAmfNodeTypes, 'p1 has the types')
957
- assert.deepEqual(not.types, IAmfNodeTypes, 'p2 has the types')
934
+ const not = range.not as Shapes.IApiNodeShape
935
+ assert.deepEqual(not.types, AmfTypes.IAmfNodeTypes, 'p1 has the types')
936
+ assert.deepEqual(not.types, AmfTypes.IAmfNodeTypes, 'p2 has the types')
958
937
  assert.lengthOf(not.properties, 1, 'p1 has the properties')
959
938
  })
960
939
 
@@ -962,16 +941,16 @@ test.group('associationProperty()', (group) => {
962
941
  a1.schema = { unionType: 'not' }
963
942
 
964
943
  const result = a1.toApiShape()
965
- const range = result.range as IApiUnionShape
944
+ const range = result.range as Shapes.IApiUnionShape
966
945
 
967
946
  assert.typeOf(range, 'object', 'has the range')
968
947
  assert.equal(range.id, `not-shape-${a1.key}`, 'the range has the id')
969
- assert.deepEqual(range.types, IAmfAnyTypes, 'the range has the types')
948
+ assert.deepEqual(range.types, AmfTypes.IAmfAnyTypes, 'the range has the types')
970
949
  assert.typeOf(range.not, 'object', 'has the not object')
971
950
 
972
- const not = range.not as IApiNodeShape
973
- assert.deepEqual(not.types, IAmfNodeTypes, 'p1 has the types')
974
- assert.deepEqual(not.types, IAmfNodeTypes, 'p2 has the types')
951
+ const not = range.not as Shapes.IApiNodeShape
952
+ assert.deepEqual(not.types, AmfTypes.IAmfNodeTypes, 'p1 has the types')
953
+ assert.deepEqual(not.types, AmfTypes.IAmfNodeTypes, 'p2 has the types')
975
954
  assert.lengthOf(not.properties, 1, 'p1 has the properties')
976
955
  })
977
956
 
@@ -982,19 +961,19 @@ test.group('associationProperty()', (group) => {
982
961
  const e3 = m1.addEntity({ key: 'e3', info: { name: 'e3' } })
983
962
  a1.addTarget(e3)
984
963
  const result = a1.toApiShape()
985
- const range = result.range as IApiArrayShape
964
+ const range = result.range as Shapes.IApiArrayShape
986
965
 
987
966
  assert.typeOf(range, 'object', 'has the range')
988
967
  assert.equal(range.id, `array-shape-${a1.key}`, 'the range has the id')
989
- assert.deepEqual(range.types, IAmfArrayTypes, 'the range has the types')
968
+ assert.deepEqual(range.types, AmfTypes.IAmfArrayTypes, 'the range has the types')
990
969
 
991
- const items = range.items as IApiUnionShape
970
+ const items = range.items as Shapes.IApiUnionShape
992
971
 
993
972
  assert.lengthOf(items.anyOf, 2, 'has the anyOf array')
994
- const [p1, p2] = items.anyOf as IApiNodeShape[]
973
+ const [p1, p2] = items.anyOf as Shapes.IApiNodeShape[]
995
974
 
996
- assert.deepEqual(p1.types, IAmfNodeTypes, 'p1 has the types')
997
- assert.deepEqual(p2.types, IAmfNodeTypes, 'p2 has the types')
975
+ assert.deepEqual(p1.types, AmfTypes.IAmfNodeTypes, 'p1 has the types')
976
+ assert.deepEqual(p2.types, AmfTypes.IAmfNodeTypes, 'p2 has the types')
998
977
  assert.lengthOf(p1.properties, 1, 'p1 has the properties')
999
978
  assert.lengthOf(p2.properties, 0, 'p2 has the properties')
1000
979
  })
@@ -1002,7 +981,7 @@ test.group('associationProperty()', (group) => {
1002
981
  test('handles linked schema', ({ assert }) => {
1003
982
  a1.schema = { linked: true }
1004
983
  const result = a1.toApiShape()
1005
- const range = result.range as IApiScalarShape
984
+ const range = result.range as Shapes.IApiScalarShape
1006
985
  assert.equal(range.dataType, AmfNamespace.w3.xmlSchema.string)
1007
986
  })
1008
987
 
@@ -1010,7 +989,7 @@ test.group('associationProperty()', (group) => {
1010
989
  const e3 = m1.addEntity({ key: 'e3', info: { name: 'e3' } })
1011
990
  a1.addTarget(e3)
1012
991
  const result = a1.toApiShape()
1013
- const range = result.range as IApiUnionShape
992
+ const range = result.range as Shapes.IApiUnionShape
1014
993
  assert.lengthOf(range.anyOf, 2)
1015
994
  })
1016
995
 
@@ -1019,7 +998,7 @@ test.group('associationProperty()', (group) => {
1019
998
  const e3 = m1.addEntity({ key: 'e3', info: { name: 'e3' } })
1020
999
  a1.addTarget(e3)
1021
1000
  const result = a1.toApiShape()
1022
- const range = result.range as IApiUnionShape
1001
+ const range = result.range as Shapes.IApiUnionShape
1023
1002
  assert.lengthOf(range.and, 2)
1024
1003
  })
1025
1004
 
@@ -1029,8 +1008,8 @@ test.group('associationProperty()', (group) => {
1029
1008
  const e3 = m1.addEntity({ key: 'e3', info: { name: 'e3' } })
1030
1009
  a1.addTarget(e3)
1031
1010
  const result = a1.toApiShape()
1032
- const range = result.range as IApiArrayShape
1033
- const items = range.items as IShapeUnion
1011
+ const range = result.range as Shapes.IApiArrayShape
1012
+ const items = range.items as Shapes.IApiUnionShape
1034
1013
  assert.lengthOf(items.and, 2)
1035
1014
  })
1036
1015
  })
@@ -1056,7 +1035,7 @@ test.group('AI Generated tests', (group) => {
1056
1035
  const p3 = e1.addProperty({ key: 'p3', info: { name: 'p3' } })
1057
1036
  const bindings = p3.getWebBinding()
1058
1037
  bindings.hidden = true
1059
- const result = e1.toApiShape() as IApiNodeShape
1038
+ const result = e1.toApiShape() as Shapes.IApiNodeShape
1060
1039
  assert.lengthOf(result.properties, 2)
1061
1040
  assert.isFalse(result.properties.some((prop) => prop.id === p3.key))
1062
1041
  })
@@ -1068,7 +1047,7 @@ test.group('AI Generated tests', (group) => {
1068
1047
  fd1.info.version = '1.0.0'
1069
1048
  root.registerForeignDomain(fd1)
1070
1049
  const a2 = e1.addAssociation({ targets: [{ key: e3.key, domain: fd1.key }], key: 'a2', info: { name: 'a2' } })
1071
- const result = e1.toApiShape() as IApiNodeShape
1050
+ const result = e1.toApiShape() as Shapes.IApiNodeShape
1072
1051
  assert.lengthOf(result.properties, 3)
1073
1052
  assert.isTrue(result.properties.some((prop) => prop.id === a2.key))
1074
1053
  })
@@ -1077,7 +1056,7 @@ test.group('AI Generated tests', (group) => {
1077
1056
  p1.multiple = true
1078
1057
  p1.schema = { examples: ['example1', 'example2'] }
1079
1058
  const result = p1.toApiShape()
1080
- const range = result.range as IApiArrayShape
1059
+ const range = result.range as Shapes.IApiArrayShape
1081
1060
  assert.include(range.types, AmfNamespace.aml.vocabularies.shapes.ArrayShape)
1082
1061
  assert.lengthOf(range.examples, 1)
1083
1062
  assert.property(range.examples[0], 'structuredValue')
@@ -1087,7 +1066,7 @@ test.group('AI Generated tests', (group) => {
1087
1066
  p1.multiple = true
1088
1067
  p1.schema = { defaultValue: { value: 'defaultValue', type: 'literal' } }
1089
1068
  const result = p1.toApiShape()
1090
- const range = result.range as IApiArrayShape
1069
+ const range = result.range as Shapes.IApiArrayShape
1091
1070
  assert.include(range.types, AmfNamespace.aml.vocabularies.shapes.ArrayShape)
1092
1071
  assert.property(range, 'defaultValue')
1093
1072
  assert.containsSubset(range.defaultValue, {
@@ -1099,7 +1078,7 @@ test.group('AI Generated tests', (group) => {
1099
1078
  p1.multiple = true
1100
1079
  p1.schema = { enum: ['enum1', 'enum2'] }
1101
1080
  const result = p1.toApiShape()
1102
- const range = result.range as IApiArrayShape
1081
+ const range = result.range as Shapes.IApiArrayShape
1103
1082
  assert.include(range.types, AmfNamespace.aml.vocabularies.shapes.ArrayShape)
1104
1083
  assert.lengthOf(range.values, 2)
1105
1084
  assert.containsSubset(range.values[0], {
@@ -1116,9 +1095,9 @@ test.group('AI Generated tests', (group) => {
1116
1095
  p1.multiple = true
1117
1096
  p1.schema = { minimum: 1, maximum: 10 }
1118
1097
  const result = p1.toApiShape()
1119
- const range = result.range as IApiArrayShape
1098
+ const range = result.range as Shapes.IApiArrayShape
1120
1099
  assert.include(range.types, AmfNamespace.aml.vocabularies.shapes.ArrayShape)
1121
- const items = range.items as IApiScalarShape
1100
+ const items = range.items as Shapes.IApiScalarShape
1122
1101
  assert.equal(items.minLength, 1)
1123
1102
  assert.equal(items.maxLength, 10)
1124
1103
  })
@@ -1134,8 +1113,8 @@ test.group('AI Generated tests', (group) => {
1134
1113
  },
1135
1114
  ]
1136
1115
  const result = p1.toApiShape()
1137
- const range = result.range as IApiArrayShape
1138
- const items = range.items as IApiScalarShape
1116
+ const range = result.range as Shapes.IApiArrayShape
1117
+ const items = range.items as Shapes.IApiScalarShape
1139
1118
  assert.include(range.types, AmfNamespace.aml.vocabularies.shapes.ArrayShape)
1140
1119
  assert.equal(items.format, AmfNamespace.w3.xmlSchema.integer)
1141
1120
  })
@@ -1144,9 +1123,9 @@ test.group('AI Generated tests', (group) => {
1144
1123
  a1.multiple = true
1145
1124
  a1.schema = { linked: false }
1146
1125
  const result = a1.toApiShape()
1147
- const range = result.range as IApiArrayShape
1126
+ const range = result.range as Shapes.IApiArrayShape
1148
1127
  assert.include(range.types, AmfNamespace.aml.vocabularies.shapes.ArrayShape)
1149
- const items = range.items as IApiScalarShape
1128
+ const items = range.items as Shapes.IApiScalarShape
1150
1129
  assert.ok(items)
1151
1130
  })
1152
1131
 
@@ -1161,9 +1140,9 @@ test.group('AI Generated tests', (group) => {
1161
1140
  },
1162
1141
  ]
1163
1142
  const result = a1.toApiShape()
1164
- const range = result.range as IApiArrayShape
1143
+ const range = result.range as Shapes.IApiArrayShape
1165
1144
  assert.include(range.types, AmfNamespace.aml.vocabularies.shapes.ArrayShape)
1166
- const items = range.items as IApiNodeShape
1145
+ const items = range.items as Shapes.IApiNodeShape
1167
1146
  assert.ok(items.properties)
1168
1147
  })
1169
1148
  })