@speclynx/apidom-ns-arazzo-1 1.12.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (204) hide show
  1. package/CHANGELOG.md +84 -0
  2. package/LICENSE +202 -0
  3. package/LICENSES/AFL-3.0.txt +182 -0
  4. package/LICENSES/Apache-2.0.txt +202 -0
  5. package/LICENSES/BSD-3-Clause.txt +26 -0
  6. package/LICENSES/MIT.txt +9 -0
  7. package/NOTICE +65 -0
  8. package/README.md +206 -0
  9. package/dist/apidom-ns-arazzo-1.browser.js +24106 -0
  10. package/dist/apidom-ns-arazzo-1.browser.min.js +1 -0
  11. package/package.json +64 -0
  12. package/src/elements/Arazzo.cjs +17 -0
  13. package/src/elements/Arazzo.mjs +14 -0
  14. package/src/elements/ArazzoSpecification1.cjs +47 -0
  15. package/src/elements/ArazzoSpecification1.mjs +43 -0
  16. package/src/elements/Components.cjs +39 -0
  17. package/src/elements/Components.mjs +35 -0
  18. package/src/elements/Criterion.cjs +33 -0
  19. package/src/elements/Criterion.mjs +29 -0
  20. package/src/elements/CriterionExpressionType.cjs +27 -0
  21. package/src/elements/CriterionExpressionType.mjs +24 -0
  22. package/src/elements/FailureAction.cjs +57 -0
  23. package/src/elements/FailureAction.mjs +53 -0
  24. package/src/elements/Info.cjs +40 -0
  25. package/src/elements/Info.mjs +37 -0
  26. package/src/elements/JSONSchema.cjs +10 -0
  27. package/src/elements/JSONSchema.mjs +7 -0
  28. package/src/elements/Parameter.cjs +33 -0
  29. package/src/elements/Parameter.mjs +30 -0
  30. package/src/elements/PayloadReplacement.cjs +27 -0
  31. package/src/elements/PayloadReplacement.mjs +24 -0
  32. package/src/elements/RequestBody.cjs +33 -0
  33. package/src/elements/RequestBody.mjs +29 -0
  34. package/src/elements/Reusable.cjs +28 -0
  35. package/src/elements/Reusable.mjs +25 -0
  36. package/src/elements/SourceDescription.cjs +33 -0
  37. package/src/elements/SourceDescription.mjs +30 -0
  38. package/src/elements/Step.cjs +81 -0
  39. package/src/elements/Step.mjs +77 -0
  40. package/src/elements/SuccessAction.cjs +45 -0
  41. package/src/elements/SuccessAction.mjs +41 -0
  42. package/src/elements/Workflow.cjs +75 -0
  43. package/src/elements/Workflow.mjs +71 -0
  44. package/src/elements/nces/ComponentsFailureActions.cjs +16 -0
  45. package/src/elements/nces/ComponentsFailureActions.mjs +13 -0
  46. package/src/elements/nces/ComponentsInputs.cjs +16 -0
  47. package/src/elements/nces/ComponentsInputs.mjs +13 -0
  48. package/src/elements/nces/ComponentsParameters.cjs +17 -0
  49. package/src/elements/nces/ComponentsParameters.mjs +14 -0
  50. package/src/elements/nces/ComponentsSuccessActions.cjs +16 -0
  51. package/src/elements/nces/ComponentsSuccessActions.mjs +13 -0
  52. package/src/elements/nces/FailureActionCriteria.cjs +17 -0
  53. package/src/elements/nces/FailureActionCriteria.mjs +14 -0
  54. package/src/elements/nces/RequestBodyReplacements.cjs +16 -0
  55. package/src/elements/nces/RequestBodyReplacements.mjs +13 -0
  56. package/src/elements/nces/SourceDescriptions.cjs +16 -0
  57. package/src/elements/nces/SourceDescriptions.mjs +13 -0
  58. package/src/elements/nces/StepDependsOn.cjs +16 -0
  59. package/src/elements/nces/StepDependsOn.mjs +13 -0
  60. package/src/elements/nces/StepOnFailure.cjs +16 -0
  61. package/src/elements/nces/StepOnFailure.mjs +13 -0
  62. package/src/elements/nces/StepOnSuccess.cjs +16 -0
  63. package/src/elements/nces/StepOnSuccess.mjs +13 -0
  64. package/src/elements/nces/StepOutputs.cjs +16 -0
  65. package/src/elements/nces/StepOutputs.mjs +13 -0
  66. package/src/elements/nces/StepParameters.cjs +17 -0
  67. package/src/elements/nces/StepParameters.mjs +14 -0
  68. package/src/elements/nces/StepSuccessCriteria.cjs +17 -0
  69. package/src/elements/nces/StepSuccessCriteria.mjs +14 -0
  70. package/src/elements/nces/SuccessActionCriteria.cjs +17 -0
  71. package/src/elements/nces/SuccessActionCriteria.mjs +14 -0
  72. package/src/elements/nces/WorkflowDependsOn.cjs +16 -0
  73. package/src/elements/nces/WorkflowDependsOn.mjs +13 -0
  74. package/src/elements/nces/WorkflowFailureActions.cjs +16 -0
  75. package/src/elements/nces/WorkflowFailureActions.mjs +13 -0
  76. package/src/elements/nces/WorkflowOutputs.cjs +16 -0
  77. package/src/elements/nces/WorkflowOutputs.mjs +13 -0
  78. package/src/elements/nces/WorkflowParameters.cjs +17 -0
  79. package/src/elements/nces/WorkflowParameters.mjs +14 -0
  80. package/src/elements/nces/WorkflowSteps.cjs +16 -0
  81. package/src/elements/nces/WorkflowSteps.mjs +13 -0
  82. package/src/elements/nces/WorkflowSuccessActions.cjs +16 -0
  83. package/src/elements/nces/WorkflowSuccessActions.mjs +13 -0
  84. package/src/elements/nces/Workflows.cjs +16 -0
  85. package/src/elements/nces/Workflows.mjs +13 -0
  86. package/src/index.cjs +146 -0
  87. package/src/index.mjs +38 -0
  88. package/src/media-types.cjs +34 -0
  89. package/src/media-types.mjs +30 -0
  90. package/src/namespace.cjs +49 -0
  91. package/src/namespace.mjs +44 -0
  92. package/src/predicates.cjs +467 -0
  93. package/src/predicates.mjs +461 -0
  94. package/src/refractor/index.cjs +52 -0
  95. package/src/refractor/index.mjs +46 -0
  96. package/src/refractor/plugins/replace-empty-element.cjs +89 -0
  97. package/src/refractor/plugins/replace-empty-element.mjs +83 -0
  98. package/src/refractor/predicates.cjs +17 -0
  99. package/src/refractor/predicates.mjs +11 -0
  100. package/src/refractor/registration.cjs +53 -0
  101. package/src/refractor/registration.mjs +34 -0
  102. package/src/refractor/specification.cjs +294 -0
  103. package/src/refractor/specification.mjs +289 -0
  104. package/src/refractor/toolbox.cjs +31 -0
  105. package/src/refractor/toolbox.mjs +23 -0
  106. package/src/refractor/visitors/FallbackVisitor.cjs +24 -0
  107. package/src/refractor/visitors/FallbackVisitor.mjs +18 -0
  108. package/src/refractor/visitors/SpecificationExtensionVisitor.cjs +18 -0
  109. package/src/refractor/visitors/SpecificationExtensionVisitor.mjs +13 -0
  110. package/src/refractor/visitors/SpecificationVisitor.cjs +74 -0
  111. package/src/refractor/visitors/SpecificationVisitor.mjs +68 -0
  112. package/src/refractor/visitors/Visitor.cjs +31 -0
  113. package/src/refractor/visitors/Visitor.mjs +28 -0
  114. package/src/refractor/visitors/arazzo-1/ArazzoVisitor.cjs +26 -0
  115. package/src/refractor/visitors/arazzo-1/ArazzoVisitor.mjs +20 -0
  116. package/src/refractor/visitors/arazzo-1/SourceDescriptionsVisitor.cjs +34 -0
  117. package/src/refractor/visitors/arazzo-1/SourceDescriptionsVisitor.mjs +28 -0
  118. package/src/refractor/visitors/arazzo-1/WorkflowsVisitor.cjs +34 -0
  119. package/src/refractor/visitors/arazzo-1/WorkflowsVisitor.mjs +28 -0
  120. package/src/refractor/visitors/arazzo-1/components/FailureActionsVisitor.cjs +26 -0
  121. package/src/refractor/visitors/arazzo-1/components/FailureActionsVisitor.mjs +20 -0
  122. package/src/refractor/visitors/arazzo-1/components/InputsVisitor.cjs +26 -0
  123. package/src/refractor/visitors/arazzo-1/components/InputsVisitor.mjs +20 -0
  124. package/src/refractor/visitors/arazzo-1/components/ParametersVisitor.cjs +26 -0
  125. package/src/refractor/visitors/arazzo-1/components/ParametersVisitor.mjs +20 -0
  126. package/src/refractor/visitors/arazzo-1/components/SuccessActionsVisitor.cjs +26 -0
  127. package/src/refractor/visitors/arazzo-1/components/SuccessActionsVisitor.mjs +20 -0
  128. package/src/refractor/visitors/arazzo-1/components/index.cjs +26 -0
  129. package/src/refractor/visitors/arazzo-1/components/index.mjs +20 -0
  130. package/src/refractor/visitors/arazzo-1/criterion/TypeVisitor.cjs +22 -0
  131. package/src/refractor/visitors/arazzo-1/criterion/TypeVisitor.mjs +16 -0
  132. package/src/refractor/visitors/arazzo-1/criterion/index.cjs +26 -0
  133. package/src/refractor/visitors/arazzo-1/criterion/index.mjs +20 -0
  134. package/src/refractor/visitors/arazzo-1/criterion-expression-type/VersionVisitor.cjs +17 -0
  135. package/src/refractor/visitors/arazzo-1/criterion-expression-type/VersionVisitor.mjs +12 -0
  136. package/src/refractor/visitors/arazzo-1/criterion-expression-type/index.cjs +26 -0
  137. package/src/refractor/visitors/arazzo-1/criterion-expression-type/index.mjs +20 -0
  138. package/src/refractor/visitors/arazzo-1/failure-action/CriteriaVisitor.cjs +34 -0
  139. package/src/refractor/visitors/arazzo-1/failure-action/CriteriaVisitor.mjs +28 -0
  140. package/src/refractor/visitors/arazzo-1/failure-action/index.cjs +26 -0
  141. package/src/refractor/visitors/arazzo-1/failure-action/index.mjs +20 -0
  142. package/src/refractor/visitors/arazzo-1/index.cjs +32 -0
  143. package/src/refractor/visitors/arazzo-1/index.mjs +26 -0
  144. package/src/refractor/visitors/arazzo-1/info/VersionVisitor.cjs +18 -0
  145. package/src/refractor/visitors/arazzo-1/info/VersionVisitor.mjs +13 -0
  146. package/src/refractor/visitors/arazzo-1/info/index.cjs +26 -0
  147. package/src/refractor/visitors/arazzo-1/info/index.mjs +20 -0
  148. package/src/refractor/visitors/arazzo-1/json-schema/index.cjs +17 -0
  149. package/src/refractor/visitors/arazzo-1/json-schema/index.mjs +12 -0
  150. package/src/refractor/visitors/arazzo-1/parameter/index.cjs +26 -0
  151. package/src/refractor/visitors/arazzo-1/parameter/index.mjs +20 -0
  152. package/src/refractor/visitors/arazzo-1/payload-replacement/index.cjs +26 -0
  153. package/src/refractor/visitors/arazzo-1/payload-replacement/index.mjs +20 -0
  154. package/src/refractor/visitors/arazzo-1/request-body/Replacements.cjs +34 -0
  155. package/src/refractor/visitors/arazzo-1/request-body/Replacements.mjs +28 -0
  156. package/src/refractor/visitors/arazzo-1/request-body/index.cjs +26 -0
  157. package/src/refractor/visitors/arazzo-1/request-body/index.mjs +20 -0
  158. package/src/refractor/visitors/arazzo-1/reusable/ReferenceVisitor.cjs +18 -0
  159. package/src/refractor/visitors/arazzo-1/reusable/ReferenceVisitor.mjs +12 -0
  160. package/src/refractor/visitors/arazzo-1/reusable/index.cjs +36 -0
  161. package/src/refractor/visitors/arazzo-1/reusable/index.mjs +30 -0
  162. package/src/refractor/visitors/arazzo-1/source-description/UrlVisitor.cjs +17 -0
  163. package/src/refractor/visitors/arazzo-1/source-description/UrlVisitor.mjs +12 -0
  164. package/src/refractor/visitors/arazzo-1/source-description/index.cjs +26 -0
  165. package/src/refractor/visitors/arazzo-1/source-description/index.mjs +20 -0
  166. package/src/refractor/visitors/arazzo-1/step/OnFailureVisitor.cjs +38 -0
  167. package/src/refractor/visitors/arazzo-1/step/OnFailureVisitor.mjs +32 -0
  168. package/src/refractor/visitors/arazzo-1/step/OnSuccessVisitor.cjs +38 -0
  169. package/src/refractor/visitors/arazzo-1/step/OnSuccessVisitor.mjs +32 -0
  170. package/src/refractor/visitors/arazzo-1/step/OutputsVisitor.cjs +25 -0
  171. package/src/refractor/visitors/arazzo-1/step/OutputsVisitor.mjs +19 -0
  172. package/src/refractor/visitors/arazzo-1/step/ParametersVisitor.cjs +38 -0
  173. package/src/refractor/visitors/arazzo-1/step/ParametersVisitor.mjs +32 -0
  174. package/src/refractor/visitors/arazzo-1/step/SuccessCriteriaVisitor.cjs +33 -0
  175. package/src/refractor/visitors/arazzo-1/step/SuccessCriteriaVisitor.mjs +27 -0
  176. package/src/refractor/visitors/arazzo-1/step/index.cjs +26 -0
  177. package/src/refractor/visitors/arazzo-1/step/index.mjs +20 -0
  178. package/src/refractor/visitors/arazzo-1/success-action/CriteriaVisitor.cjs +34 -0
  179. package/src/refractor/visitors/arazzo-1/success-action/CriteriaVisitor.mjs +28 -0
  180. package/src/refractor/visitors/arazzo-1/success-action/index.cjs +26 -0
  181. package/src/refractor/visitors/arazzo-1/success-action/index.mjs +20 -0
  182. package/src/refractor/visitors/arazzo-1/workflow/DependsOnVisitor.cjs +34 -0
  183. package/src/refractor/visitors/arazzo-1/workflow/DependsOnVisitor.mjs +28 -0
  184. package/src/refractor/visitors/arazzo-1/workflow/FailureActionsVisitor.cjs +38 -0
  185. package/src/refractor/visitors/arazzo-1/workflow/FailureActionsVisitor.mjs +32 -0
  186. package/src/refractor/visitors/arazzo-1/workflow/OutputsVisitor.cjs +25 -0
  187. package/src/refractor/visitors/arazzo-1/workflow/OutputsVisitor.mjs +19 -0
  188. package/src/refractor/visitors/arazzo-1/workflow/ParametersVisitor.cjs +38 -0
  189. package/src/refractor/visitors/arazzo-1/workflow/ParametersVisitor.mjs +32 -0
  190. package/src/refractor/visitors/arazzo-1/workflow/StepsVisitor.cjs +33 -0
  191. package/src/refractor/visitors/arazzo-1/workflow/StepsVisitor.mjs +27 -0
  192. package/src/refractor/visitors/arazzo-1/workflow/SuccessActionsVisitor.cjs +38 -0
  193. package/src/refractor/visitors/arazzo-1/workflow/SuccessActionsVisitor.mjs +32 -0
  194. package/src/refractor/visitors/arazzo-1/workflow/index.cjs +26 -0
  195. package/src/refractor/visitors/arazzo-1/workflow/index.mjs +20 -0
  196. package/src/refractor/visitors/generics/FixedFieldsVisitor.cjs +67 -0
  197. package/src/refractor/visitors/generics/FixedFieldsVisitor.mjs +60 -0
  198. package/src/refractor/visitors/generics/MapVisitor.cjs +21 -0
  199. package/src/refractor/visitors/generics/MapVisitor.mjs +15 -0
  200. package/src/refractor/visitors/generics/PatternedFieldsVisitor.cjs +67 -0
  201. package/src/refractor/visitors/generics/PatternedFieldsVisitor.mjs +61 -0
  202. package/src/traversal/visitor.cjs +38 -0
  203. package/src/traversal/visitor.mjs +35 -0
  204. package/types/apidom-ns-arazzo-1.d.ts +1852 -0
@@ -0,0 +1,26 @@
1
+ Redistribution and use in source and binary forms, with or without
2
+ modification, are permitted provided that the following conditions are
3
+ met:
4
+
5
+ 1. Redistributions of source code must retain the above copyright
6
+ notice, this list of conditions and the following disclaimer.
7
+
8
+ 2. Redistributions in binary form must reproduce the above copyright
9
+ notice, this list of conditions and the following disclaimer in the
10
+ documentation and/or other materials provided with the distribution.
11
+
12
+ 3. Neither the name of the copyright holder nor the names of its
13
+ contributors may be used to endorse or promote products derived from
14
+ this software without specific prior written permission.
15
+
16
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20
+ HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
22
+ TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
23
+ PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
24
+ LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
25
+ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
26
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -0,0 +1,9 @@
1
+ MIT License
2
+
3
+ Copyright (c) <year> <copyright holders>
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
+
7
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8
+
9
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/NOTICE ADDED
@@ -0,0 +1,65 @@
1
+ Additional Notices for SpecLynx Distribution
2
+ Copyright 2025 SpecLynx
3
+ This distribution is known as "SpecLynx ApiDOM". It is a fork of the ApiDOM project maintained by SmartBear.
4
+ This distribution includes modifications by SpecLynx.
5
+ All such modifications are licensed under the Apache License, Version 2.0.
6
+ A copy of the Apache 2.0 license can be found in `LICENSES/Apache-2.0.txt`.
7
+
8
+ ApiDOM
9
+ Copyright 2020 SmartBear Software Inc.
10
+ ApiDOM is licensed under Apache 2.0 license.
11
+ Copy of the Apache 2.0 license can be found in `LICENSES/Apache-2.0.txt` file.
12
+
13
+ json-schema-ref-parser
14
+ Copyright (c) 2015 James Messinger
15
+ File packages/apidom-reference/src/util/url.ts (the file) was originally created under MIT license in https://github.com/APIDevTools/json-schema-ref-parser repository.
16
+ The file has been copied into this project and modified. All modifications are licensed under Apache 2.0 License.
17
+ Copy of the MIT license can be found in `LICENSES/MIT.txt` file.
18
+
19
+ graphql-js
20
+ Copyright (c) GraphQL Contributors
21
+ File packages/apidom-ast/src/traversal/visitor.ts (the file) was originally created under MIT license in https://github.com/graphql/graphql-js repository.
22
+ The file has been copied into this project and modified. All modifications are licensed under Apache 2.0 License.
23
+ Copy of the MIT license can be found in `LICENSES/MIT.txt` file.
24
+
25
+ babel-plugin-add-import-extension
26
+ Copyright (c) 2019 Karl Prieb
27
+ File scripts/babel-plugin-add-import-extension.cjs (the file) was originally created under MIT license in https://codeberg.org/karl/babel-plugin-add-import-extension.
28
+ The file has been copied into this project and modified. All modifications are licensed under Apache 2.0 License.
29
+ Copy of the MIT license can be found in `LICENSES/MIT.txt` file.
30
+
31
+ refract-spec
32
+ Copyright (c) 2015 refractproject
33
+ Specific texts in README.md (the file) were originally created under MIT license in https://github.com/refractproject/refract-spec repository.
34
+ Specific texts have been copied into this project and modified. All modifications are licensed under Apache 2.0 License.
35
+ Copy of the MIT license can be found in `LICENSES/MIT.txt` file.
36
+
37
+ api-elements
38
+ Copyright (c) 2015 Apiary Inc.
39
+ Specific texts in README.md (the file) were originally created under MIT license in https://github.com/refractproject/refract-spec repository.
40
+ Specific texts have been copied into this project and modified. All modifications are licensed under Apache 2.0 License.
41
+ Copy of the MIT license can be found in `LICENSES/MIT.txt` file.
42
+
43
+ deepmerge
44
+ Copyright (c) 2012 James Halliday, Josh Duff, and other contributors
45
+ - File packages/apidom-core/src/deepmerge.ts contains algorithms that we originally created
46
+ in https://github.com/TehShrike/deepmerge/blob/master/index.js to handle deep merging of JavaScript Objects and Arrays.
47
+ These algorithms have been reverse engineered and adapted to support deep merging of ApiDOM structures.
48
+ - File packages/apidom-core/test/deepmerge.ts contains tests and fixtures that were originally created
49
+ in https://github.com/TehShrike/deepmerge/blob/master/test/merge.js to test deep merging of JavaScript Objects and Arrays.
50
+ These tests have been adapted to support testing deep merging of ApiDOM structures.
51
+ - File packages/apidom-core/README.md contains text fragments that were originally created
52
+ in https://github.com/TehShrike/deepmerge/blob/master/readme.md to document deepmerge library.
53
+ These text fragments have been amended to describe merging of ApiDOM structures.
54
+ Copy of the MIT license can be found in `LICENSES/MIT.txt` file.
55
+ All modifications are licensed under Apache 2.0 License.
56
+
57
+ ---
58
+
59
+ If the SPDX-FileCopyrightText and SPDX-License-Identifier tags are not present in the file,
60
+ it is assumed that these tags have following implicit value:
61
+
62
+ SPDX-FileCopyrightText: Copyright 2025 SpecLynx
63
+ SPDX-FileCopyrightText: Copyright 2020-2021 SmartBear Software Inc.
64
+ SPDX-License-Identifier: Apache-2.0
65
+
package/README.md ADDED
@@ -0,0 +1,206 @@
1
+ # @speclynx/apidom-ns-arazzo-1
2
+
3
+ `@speclynx/apidom-ns-arazzo-1` contains ApiDOM namespace specific to **Arazzo 1.x.y specification**, supporting the following versions:
4
+
5
+ - [Arazzo 1.0.0](https://spec.openapis.org/arazzo/v1.0.0.html)
6
+ - [Arazzo 1.0.1](https://spec.openapis.org/arazzo/v1.0.1.html)
7
+
8
+ ## Installation
9
+
10
+ You can install this package via [npm CLI](https://docs.npmjs.com/cli) by running the following command:
11
+
12
+ ```sh
13
+ $ npm install @speclynx/apidom-ns-arazzo-1
14
+ ```
15
+
16
+ ## Arazzo 1.0.1 namespace
17
+
18
+ Arazzo 1.0.1 namespace consists of [number of elements](https://github.com/speclynx/apidom/tree/main/packages/apidom-ns-arazzo-1/src/elements) implemented on top
19
+ of [primitive ones](https://github.com/refractproject/minim/tree/master/lib/primitives).
20
+
21
+ ```js
22
+ import { createNamespace } from '@speclynx/apidom-core';
23
+ import arazzo1Namespace from '@speclynx/apidom-ns-arazzo-1';
24
+
25
+ const namespace = createNamespace(arazzo1Namespace);
26
+
27
+ const objectElement = new namespace.elements.Object();
28
+ const arazzoElement = new namespace.elements.ArazzoSpecification1();
29
+ ```
30
+
31
+ When namespace instance is created in this way, it will extend the base namespace
32
+ with the namespace provided as an argument.
33
+
34
+ Elements from the namespace can also be used directly by importing them.
35
+
36
+ ```js
37
+ import { ArazzoSpecification1Element, InfoElement } from '@speclynx/apidom-ns-arazzo-1';
38
+
39
+ const infoElement = new InfoElement();
40
+ const arazzoElement = new ArazzoSpecification1Element();
41
+ ```
42
+
43
+ ## Predicates
44
+
45
+ This package exposes [predicates](https://github.com/speclynx/apidom/blob/main/packages/apidom-ns-arazzo-1/src/predicates.ts)
46
+ for all higher order elements that are part of this namespace.
47
+
48
+ ```js
49
+ import { isArazzoSpecification1Element, ArazzoSpecification1Element } from '@speclynx/apidom-ns-arazzo-1';
50
+
51
+ const arazzoElement = new ArazzoSpecification1Element();
52
+
53
+ isArazzoSpecification1Element(arazzoElement); // => true
54
+ ```
55
+
56
+ ## Traversal
57
+
58
+ Traversing ApiDOM in this namespace is possible by using `visit` function from `apidom` package.
59
+ This package comes with its own [keyMap](https://github.com/speclynx/apidom/blob/main/packages/apidom-ns-arazzo-1/src/traversal/visitor.ts) and [nodeTypeGetter](https://github.com/speclynx/apidom/blob/main/packages/apidom-ns-arazzo-1/src/traversal/visitor.ts).
60
+ To learn more about these `visit` configuration options please refer to [@speclynx/apidom-ast documentation](https://github.com/speclynx/apidom/blob/main/packages/apidom-ast/README.md#visit).
61
+
62
+ ```js
63
+ import { visit } from '@speclynx/apidom-core';
64
+ import { ArazzoSpecification1Element, keyMap, getNodeType } from '@speclynx/apidom-ns-arazzo-1';
65
+
66
+ const element = new ArazzoSpecification1Element();
67
+
68
+ const visitor = {
69
+ ArazzoSpecification1Element(arazzoElement) {
70
+ console.dir(arazzoElement);
71
+ },
72
+ };
73
+
74
+ visit(element, visitor, { keyMap, nodeTypeGetter: getNodeType });
75
+ ```
76
+
77
+ ## Refractors
78
+
79
+ Refractor is a special layer inside the namespace that can transform either JavaScript structures
80
+ or generic ApiDOM structures into structures built from elements of this namespace.
81
+
82
+ **Refracting JavaScript structures**:
83
+
84
+ ```js
85
+ import { InfoElement } from '@speclynx/apidom-ns-arazzo-1';
86
+
87
+ const object = {
88
+ title: 'my title',
89
+ summary: 'my summary',
90
+ description: 'my description',
91
+ version: '0.1.0',
92
+ };
93
+
94
+ InfoElement.refract(object); // => InfoElement({ title, summary, description, version })
95
+ ```
96
+
97
+ **Refracting generic ApiDOM structures**:
98
+
99
+ ```js
100
+ import { ObjectElement } from '@speclynx/apidom-core';
101
+ import { InfoElement } from '@speclynx/apidom-ns-arazzo-1';
102
+
103
+ const objectElement = new ObjectElement({
104
+ title: 'my title',
105
+ summary: 'my summary',
106
+ description: 'my description',
107
+ version: '0.1.0',
108
+ });
109
+
110
+ InfoElement.refract(objectElement); // => InfoElement({ title = 'my title', summary = 'my summary', description = 'my description', version = '0.1.0' })
111
+ ```
112
+
113
+ ### Refractor plugins
114
+
115
+ Refractors can accept plugins as a second argument of refract static method.
116
+
117
+ ```js
118
+ import { ObjectElement } from '@speclynx/apidom-core';
119
+ import { InfoElement } from '@speclynx/apidom-ns-arazzo-1';
120
+
121
+ const objectElement = new ObjectElement({
122
+ title: 'my title',
123
+ summary: 'my summary',
124
+ description: 'my description',
125
+ version: '0.1.0',
126
+ });
127
+
128
+ const plugin = ({ predicates, namespace }) => ({
129
+ name: 'plugin',
130
+ pre() {
131
+ console.dir('runs before traversal');
132
+ },
133
+ visitor: {
134
+ InfoElement(infoElement) {
135
+ infoElement.version = '2.0.0';
136
+ },
137
+ },
138
+ post() {
139
+ console.dir('runs after traversal');
140
+ },
141
+ });
142
+
143
+ InfoElement.refract(objectElement, { plugins: [plugin] }); // => InfoElement({ title = 'my title', description = 'my description', version = '2.0.0' })
144
+ ```
145
+
146
+ You can define as many plugins as needed to enhance the resulting namespaced ApiDOM structure.
147
+ If multiple plugins with the same visitor method are defined, they run in parallel (just like in Babel).
148
+
149
+ #### Replace Empty Element plugin
150
+
151
+ This plugin is specific to YAML 1.2 format, which allows defining key-value pairs with empty key,
152
+ empty value, or both. If the value is not provided in YAML format, this plugin compensates for
153
+ this missing value with the most appropriate semantic element type.
154
+
155
+ ```js
156
+ import { parse } from '@speclynx/apidom-parser-adapter-yaml-1-2';
157
+ import { refractorPluginReplaceEmptyElement, ArazzoSpecification1Element } from '@speclynx/apidom-ns-arazzo-1';
158
+
159
+ const yamlDefinition = `
160
+ arazzo: 1.0.1
161
+ info:
162
+ `;
163
+ const apiDOM = await parse(yamlDefinition);
164
+ const arazzoElement = ArazzoSpecification1Element.refract(apiDOM.result, {
165
+ plugins: [refractorPluginReplaceEmptyElement()],
166
+ });
167
+
168
+ // =>
169
+ // (ArazzoSpecification1Element
170
+ // (MemberElement
171
+ // (StringElement)
172
+ // (StringElement))
173
+ // (MemberElement
174
+ // (StringElement)
175
+ // (InfoElement)))
176
+
177
+ // => without the plugin the result would be as follows:
178
+ // (ArazzoSpecification1Element
179
+ // (MemberElement
180
+ // (StringElement)
181
+ // (StringElement))
182
+ // (MemberElement
183
+ // (StringElement)
184
+ // (StringElement)))
185
+ ```
186
+
187
+ ## Implementation progress
188
+
189
+ Only fully implemented specification objects should be checked here.
190
+
191
+ - [x] [Arazzo Specification Object](https://spec.openapis.org/arazzo/latest.html#arazzo-specification-object)
192
+ - [x] [Info Object](https://spec.openapis.org/arazzo/latest.html#info-object)
193
+ - [x] [Source Description Object](https://spec.openapis.org/arazzo/latest.html#source-description-object)
194
+ - [x] [Workflow Object](https://spec.openapis.org/arazzo/latest.html#workflow-object)
195
+ - [x] [Step Object](https://spec.openapis.org/arazzo/latest.html#step-object)
196
+ - [x] [Parameter Object](https://spec.openapis.org/arazzo/latest.html#parameter-object)
197
+ - [x] [Success Action Object](https://spec.openapis.org/arazzo/latest.html#success-action-object)
198
+ - [x] [Failure Action Object](https://spec.openapis.org/arazzo/latest.html#failure-action-object)
199
+ - [x] [Components Object](https://spec.openapis.org/arazzo/latest.html#components-object)
200
+ - [x] [Reusable Object](https://spec.openapis.org/arazzo/latest.html#reusable-object)
201
+ - [x] [Criterion Object](https://spec.openapis.org/arazzo/latest.html#criterion-object)
202
+ - [x] [Criterion Expression Type Object](https://spec.openapis.org/arazzo/latest.html#criterion-expression-type-object)
203
+ - [x] [Request Body Object](https://spec.openapis.org/arazzo/latest.html#request-body-object)
204
+ - [x] [Payload Replacement Object](https://spec.openapis.org/arazzo/latest.html#payload-replacement-object)
205
+ - [x] [JSON Schema](https://json-schema.org/specification-links#2020-12)
206
+ - [x] [Specification extensions](https://spec.openapis.org/arazzo/latest.html#specification-extensions)