@speclynx/apidom-ns-openapi-3-1 1.12.1 → 2.0.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 (70) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/NOTICE +16 -7
  3. package/README.md +16 -29
  4. package/dist/apidom-ns-openapi-3-1.browser.js +11148 -16196
  5. package/dist/apidom-ns-openapi-3-1.browser.min.js +1 -1
  6. package/package.json +11 -11
  7. package/src/elements/JsonSchemaDialect.cjs +2 -2
  8. package/src/elements/JsonSchemaDialect.mjs +1 -1
  9. package/src/elements/OpenApi3-1.cjs +2 -2
  10. package/src/elements/OpenApi3-1.mjs +1 -1
  11. package/src/elements/PathItem.cjs +24 -24
  12. package/src/elements/PathItem.mjs +24 -24
  13. package/src/elements/nces/ComponentsPathItems.cjs +2 -2
  14. package/src/elements/nces/ComponentsPathItems.mjs +1 -1
  15. package/src/elements/nces/Webhooks.cjs +2 -2
  16. package/src/elements/nces/Webhooks.mjs +1 -1
  17. package/src/index.cjs +73 -49
  18. package/src/index.mjs +6 -3
  19. package/src/namespace.cjs +0 -1
  20. package/src/predicates.cjs +56 -187
  21. package/src/predicates.mjs +29 -186
  22. package/src/refractor/index.cjs +338 -17
  23. package/src/refractor/index.mjs +305 -16
  24. package/src/refractor/inspect.cjs +207 -0
  25. package/src/refractor/inspect.mjs +171 -0
  26. package/src/refractor/plugins/normalize-header-examples/NormalizeStorage.cjs +5 -5
  27. package/src/refractor/plugins/normalize-header-examples/NormalizeStorage.mjs +1 -1
  28. package/src/refractor/plugins/normalize-header-examples/index.cjs +11 -7
  29. package/src/refractor/plugins/normalize-header-examples/index.mjs +8 -4
  30. package/src/refractor/plugins/normalize-operation-ids.cjs +13 -6
  31. package/src/refractor/plugins/normalize-operation-ids.mjs +13 -6
  32. package/src/refractor/plugins/normalize-parameter-examples.cjs +11 -7
  33. package/src/refractor/plugins/normalize-parameter-examples.mjs +8 -4
  34. package/src/refractor/plugins/normalize-parameters.cjs +11 -5
  35. package/src/refractor/plugins/normalize-parameters.mjs +11 -5
  36. package/src/refractor/plugins/normalize-security-requirements.cjs +8 -4
  37. package/src/refractor/plugins/normalize-security-requirements.mjs +8 -4
  38. package/src/refractor/plugins/normalize-servers.cjs +15 -9
  39. package/src/refractor/plugins/normalize-servers.mjs +15 -9
  40. package/src/refractor/plugins/replace-empty-element.cjs +32 -30
  41. package/src/refractor/plugins/replace-empty-element.mjs +16 -15
  42. package/src/refractor/predicates.cjs +36 -0
  43. package/src/refractor/predicates.mjs +31 -0
  44. package/src/refractor/specification.cjs +43 -4
  45. package/src/refractor/specification.mjs +43 -4
  46. package/src/refractor/toolbox.cjs +12 -21
  47. package/src/refractor/toolbox.mjs +9 -16
  48. package/src/refractor/visitors/open-api-3-1/JsonSchemaDialectVisitor.cjs +5 -5
  49. package/src/refractor/visitors/open-api-3-1/JsonSchemaDialectVisitor.mjs +6 -6
  50. package/src/refractor/visitors/open-api-3-1/OpenapiVisitor.cjs +25 -0
  51. package/src/refractor/visitors/open-api-3-1/OpenapiVisitor.mjs +19 -0
  52. package/src/refractor/visitors/open-api-3-1/WebhooksVisitor.cjs +4 -5
  53. package/src/refractor/visitors/open-api-3-1/WebhooksVisitor.mjs +5 -6
  54. package/src/refractor/visitors/open-api-3-1/bases.cjs +46 -0
  55. package/src/refractor/visitors/open-api-3-1/bases.mjs +43 -0
  56. package/src/refractor/visitors/open-api-3-1/callback/index.cjs +2 -3
  57. package/src/refractor/visitors/open-api-3-1/callback/index.mjs +2 -3
  58. package/src/refractor/visitors/open-api-3-1/components/PathItemsVisitor.cjs +4 -5
  59. package/src/refractor/visitors/open-api-3-1/components/PathItemsVisitor.mjs +5 -6
  60. package/src/refractor/visitors/open-api-3-1/components/SchemasVisitor.cjs +2 -2
  61. package/src/refractor/visitors/open-api-3-1/components/SchemasVisitor.mjs +3 -5
  62. package/src/refractor/visitors/open-api-3-1/index.cjs +5 -4
  63. package/src/refractor/visitors/open-api-3-1/index.mjs +6 -5
  64. package/src/refractor/visitors/open-api-3-1/schema/index.cjs +11 -10
  65. package/src/refractor/visitors/open-api-3-1/schema/index.mjs +12 -11
  66. package/types/apidom-ns-openapi-3-1.d.ts +435 -274
  67. package/src/refractor/registration.cjs +0 -102
  68. package/src/refractor/registration.mjs +0 -66
  69. package/src/traversal/visitor.cjs +0 -57
  70. package/src/traversal/visitor.mjs +0 -54
package/CHANGELOG.md CHANGED
@@ -3,6 +3,31 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [2.0.1](https://github.com/speclynx/apidom/compare/v2.0.0...v2.0.1) (2026-01-14)
7
+
8
+ **Note:** Version bump only for package @speclynx/apidom-ns-openapi-3-1
9
+
10
+ # [2.0.0](https://github.com/speclynx/apidom/compare/v1.12.2...v2.0.0) (2026-01-14)
11
+
12
+ ### Bug Fixes
13
+
14
+ - limit source maps memory consuption ([#20](https://github.com/speclynx/apidom/issues/20)) ([4a0574f](https://github.com/speclynx/apidom/commit/4a0574fd6d466be7c33c8a5871baacd384918d22))
15
+
16
+ ### Features
17
+
18
+ - apply innovations learned during last 3 years ([#11](https://github.com/speclynx/apidom/issues/11)) ([cfdbbfc](https://github.com/speclynx/apidom/commit/cfdbbfc2721b0dadc77eeba31dd4e8768c078d22))
19
+ - **traverse:** move traverse operations to apidom-traverse package ([#18](https://github.com/speclynx/apidom/issues/18)) ([36c9d49](https://github.com/speclynx/apidom/commit/36c9d490ceac2ea961e2b23fbbc72df7fb54bbf3))
20
+
21
+ ### BREAKING CHANGES
22
+
23
+ - source maps have been completely rewritten
24
+ - **traverse:** move traverse operations from core to traverse package
25
+ - breaking changes introduced to every package public API
26
+
27
+ ## [1.12.2](https://github.com/speclynx/apidom/compare/v1.12.1...v1.12.2) (2025-12-23)
28
+
29
+ **Note:** Version bump only for package @speclynx/apidom-ns-openapi-3-1
30
+
6
31
  ## [1.12.1](https://github.com/speclynx/apidom/compare/v1.12.0...v1.12.1) (2025-12-23)
7
32
 
8
33
  **Note:** Version bump only for package @speclynx/apidom-ns-openapi-3-1
package/NOTICE CHANGED
@@ -5,11 +5,6 @@ This distribution includes modifications by SpecLynx.
5
5
  All such modifications are licensed under the Apache License, Version 2.0.
6
6
  A copy of the Apache 2.0 license can be found in `LICENSES/Apache-2.0.txt`.
7
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
8
  json-schema-ref-parser
14
9
  Copyright (c) 2015 James Messinger
15
10
  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.
@@ -18,8 +13,8 @@ Copy of the MIT license can be found in `LICENSES/MIT.txt` file.
18
13
 
19
14
  graphql-js
20
15
  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.
16
+ File packages/apidom-traverse/src/traversal.ts (the file) was originally inspired by https://github.com/graphql/graphql-js repository.
17
+ All modifications are licensed under Apache 2.0 License.
23
18
  Copy of the MIT license can be found in `LICENSES/MIT.txt` file.
24
19
 
25
20
  babel-plugin-add-import-extension
@@ -54,6 +49,20 @@ Copyright (c) 2012 James Halliday, Josh Duff, and other contributors
54
49
  Copy of the MIT license can be found in `LICENSES/MIT.txt` file.
55
50
  All modifications are licensed under Apache 2.0 License.
56
51
 
52
+ ApiDOM
53
+ Copyright 2020 SmartBear Software Inc.
54
+ ApiDOM is licensed under Apache 2.0 license.
55
+ Copy of the Apache 2.0 license can be found in `LICENSES/Apache-2.0.txt` file.
56
+
57
+ minim
58
+ Copyright (c) 2014 Stephen Mizell
59
+ The apidom-datamodel package contains code originally created under the MIT
60
+ License as part of the Minim project (https://github.com/refractproject/minim).
61
+ This code has been copied into this project and modified.
62
+ The original portions remain licensed under the MIT License. Our modifications
63
+ to that code are licensed under the Apache License 2.0.
64
+ Copy of the MIT license can be found in `LICENSES/MIT.txt` file.
65
+
57
66
  ---
58
67
 
59
68
  If the SPDX-FileCopyrightText and SPDX-License-Identifier tags are not present in the file,
package/README.md CHANGED
@@ -14,25 +14,12 @@ You can install this package via [npm CLI](https://docs.npmjs.com/cli) by runnin
14
14
  $ npm install @speclynx/apidom-ns-openapi-3-1
15
15
  ```
16
16
 
17
- ## OpenAPI 3.1.0 namespace
17
+ ## OpenAPI 3.1.x namespace
18
18
 
19
- OpenAPI 3.1.0 namespace consists of [number of elements](https://github.com/speclynx/apidom/tree/main/packages/apidom-ns-openapi-3-1/src/elements) implemented on top
20
- of [primitive ones](https://github.com/refractproject/minim/tree/master/lib/primitives).
19
+ OpenAPI 3.1.x namespace consists of [number of elements](https://github.com/speclynx/apidom/tree/main/packages/apidom-ns-openapi-3-1/src/elements) implemented on top
20
+ of [primitive ones](https://github.com/speclynx/apidom/tree/main/packages/apidom-datamodel/src/primitives).
21
21
 
22
- ```js
23
- import { createNamespace } from '@speclynx/apidom-core';
24
- import openApi3_1Namespace from '@speclynx/apidom-ns-openapi-3-1';
25
-
26
- const namespace = createNamespace(openApi3_1Namespace);
27
-
28
- const objectElement = new namespace.elements.Object();
29
- const openApiElement = new namespace.elements.OpenApi3_1();
30
- ```
31
-
32
- When namespace instance is created in this way, it will extend the base namespace
33
- with the namespace provided as an argument.
34
-
35
- Elements from the namespace can also be used directly by importing them.
22
+ Elements from the namespace can be used directly by importing them.
36
23
 
37
24
  ```js
38
25
  import { OpenApi3_1Element, InfoElement } from '@speclynx/apidom-ns-openapi-3-1';
@@ -56,23 +43,23 @@ isOpenApi3_1Element(openApiElement); // => true
56
43
 
57
44
  ## Traversal
58
45
 
59
- Traversing ApiDOM in this namespace is possible by using `visit` function from `apidom` package.
60
- This package comes with its own [keyMap](https://github.com/speclynx/apidom/blob/main/packages/apidom-ns-openapi-3-1/src/traversal/visitor.ts#L11) and [nodeTypeGetter](https://github.com/speclynx/apidom/blob/main/packages/apidom-ns-openapi-3-1/src/traversal/visitor.ts#L4).
61
- 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).
46
+ Traversing ApiDOM in this namespace is possible by using `traverse` function from `@speclynx/apidom-traverse` package.
47
+ This package comes with its own [nodeTypeGetter](https://github.com/speclynx/apidom/blob/main/packages/apidom-ns-openapi-3-1/src/traversal/visitor.ts#L4).
48
+ To learn more about these `traverse` configuration options please refer to [@speclynx/apidom-traverse documentation](https://github.com/speclynx/apidom/blob/main/packages/apidom-traverse/README.md).
62
49
 
63
50
  ```js
64
- import { visit } from '@speclynx/apidom-core';
65
- import { OpenApi3_1Element, keyMap, getNodeType } from '@speclynx/apidom-ns-openapi-3-1';
51
+ import { traverse, getNodePrimitiveType } from '@speclynx/apidom-traverse';
52
+ import { OpenApi3_1Element } from '@speclynx/apidom-ns-openapi-3-1';
66
53
 
67
54
  const element = new OpenApi3_1Element();
68
55
 
69
56
  const visitor = {
70
- OpenApi3_1Element(openApiElement) {
71
- console.dir(openApiElement);
57
+ OpenApi3_1Element(path) {
58
+ console.dir(path.node);
72
59
  },
73
60
  };
74
61
 
75
- visit(element, visitor, { keyMap, nodeTypeGetter: getNodeType });
62
+ traverse(element, visitor, { nodeTypeGetter: getNodePrimitiveType });
76
63
  ```
77
64
 
78
65
  ## Refractors
@@ -97,7 +84,7 @@ InfoElement.refract(object); // => InfoElement({ title, description, version })
97
84
  **Refracting generic ApiDOM structures**:
98
85
 
99
86
  ```js
100
- import { ObjectElement } from '@speclynx/apidom-core';
87
+ import { ObjectElement } from '@speclynx/apidom-datamodel';
101
88
  import { InfoElement } from '@speclynx/apidom-ns-openapi-3-1';
102
89
 
103
90
  const objectElement = new ObjectElement({
@@ -114,7 +101,7 @@ InfoElement.refract(objectElement); // => InfoElement({ title = 'my title', desc
114
101
  Refractors can accept plugins as a second argument of refract static method.
115
102
 
116
103
  ```js
117
- import { ObjectElement } from '@speclynx/apidom-core';
104
+ import { ObjectElement } from '@speclynx/apidom-datamodel';
118
105
  import { InfoElement } from '@speclynx/apidom-ns-openapi-3-1';
119
106
 
120
107
  const objectElement = new ObjectElement({
@@ -129,8 +116,8 @@ const plugin = ({ predicates, namespace }) => ({
129
116
  console.dir('runs before traversal');
130
117
  },
131
118
  visitor: {
132
- InfoElement(infoElement) {
133
- infoElement.version = '2.0.0';
119
+ InfoElement(path) {
120
+ path.node.version = '2.0.0';
134
121
  },
135
122
  },
136
123
  post() {