@speclynx/apidom-ns-openapi-3-0 4.0.3 → 4.0.5

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 (176) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/dist/apidom-ns-openapi-3-0.browser.js +30 -6
  3. package/dist/apidom-ns-openapi-3-0.browser.min.js +1 -1
  4. package/package.json +9 -8
  5. package/src/elements/Callback.ts +0 -13
  6. package/src/elements/Components.ts +0 -85
  7. package/src/elements/Contact.ts +0 -42
  8. package/src/elements/Discriminator.ts +0 -34
  9. package/src/elements/Encoding.ts +0 -59
  10. package/src/elements/Example.ts +0 -51
  11. package/src/elements/ExternalDocumentation.ts +0 -34
  12. package/src/elements/Header.ts +0 -119
  13. package/src/elements/Info.ts +0 -70
  14. package/src/elements/License.ts +0 -34
  15. package/src/elements/Link.ts +0 -85
  16. package/src/elements/MediaType.ts +0 -48
  17. package/src/elements/OAuthFlow.ts +0 -50
  18. package/src/elements/OAuthFlows.ts +0 -47
  19. package/src/elements/OpenApi3-0.ts +0 -90
  20. package/src/elements/Openapi.ts +0 -15
  21. package/src/elements/Operation.ts +0 -124
  22. package/src/elements/Parameter.ts +0 -135
  23. package/src/elements/PathItem.ts +0 -125
  24. package/src/elements/Paths.ts +0 -13
  25. package/src/elements/Reference.ts +0 -27
  26. package/src/elements/RequestBody.ts +0 -46
  27. package/src/elements/Response.ts +0 -50
  28. package/src/elements/Responses.ts +0 -24
  29. package/src/elements/Schema.ts +0 -230
  30. package/src/elements/SecurityRequirement.ts +0 -13
  31. package/src/elements/SecurityScheme.ts +0 -84
  32. package/src/elements/Server.ts +0 -42
  33. package/src/elements/ServerVariable.ts +0 -43
  34. package/src/elements/Tag.ts +0 -44
  35. package/src/elements/Xml.ts +0 -59
  36. package/src/elements/nces/ComponentsCallbacks.ts +0 -15
  37. package/src/elements/nces/ComponentsExamples.ts +0 -16
  38. package/src/elements/nces/ComponentsHeaders.ts +0 -15
  39. package/src/elements/nces/ComponentsLinks.ts +0 -15
  40. package/src/elements/nces/ComponentsParameters.ts +0 -16
  41. package/src/elements/nces/ComponentsRequestBodies.ts +0 -15
  42. package/src/elements/nces/ComponentsResponses.ts +0 -15
  43. package/src/elements/nces/ComponentsSchemas.ts +0 -15
  44. package/src/elements/nces/ComponentsSecuritySchemes.ts +0 -15
  45. package/src/elements/nces/DiscriminatorMapping.ts +0 -15
  46. package/src/elements/nces/EncodingHeaders.ts +0 -15
  47. package/src/elements/nces/HeaderContent.ts +0 -16
  48. package/src/elements/nces/HeaderExamples.ts +0 -16
  49. package/src/elements/nces/LinkParameters.ts +0 -15
  50. package/src/elements/nces/MediaTypeEncoding.ts +0 -15
  51. package/src/elements/nces/MediaTypeExamples.ts +0 -16
  52. package/src/elements/nces/OAuthFlowScopes.ts +0 -15
  53. package/src/elements/nces/OperationCallbacks.ts +0 -15
  54. package/src/elements/nces/OperationParameters.ts +0 -16
  55. package/src/elements/nces/OperationSecurity.ts +0 -16
  56. package/src/elements/nces/OperationServers.ts +0 -16
  57. package/src/elements/nces/OperationTags.ts +0 -15
  58. package/src/elements/nces/ParameterContent.ts +0 -16
  59. package/src/elements/nces/ParameterExamples.ts +0 -16
  60. package/src/elements/nces/PathItemParameters.ts +0 -16
  61. package/src/elements/nces/PathItemServers.ts +0 -16
  62. package/src/elements/nces/RequestBodyContent.ts +0 -16
  63. package/src/elements/nces/ResponseContent.ts +0 -16
  64. package/src/elements/nces/ResponseHeaders.ts +0 -15
  65. package/src/elements/nces/ResponseLinks.ts +0 -15
  66. package/src/elements/nces/Security.ts +0 -15
  67. package/src/elements/nces/ServerVariables.ts +0 -15
  68. package/src/elements/nces/Servers.ts +0 -15
  69. package/src/elements/nces/Tags.ts +0 -15
  70. package/src/index.ts +0 -550
  71. package/src/media-types.ts +0 -52
  72. package/src/namespace.ts +0 -78
  73. package/src/predicates.ts +0 -185
  74. package/src/refractor/index.ts +0 -370
  75. package/src/refractor/inspect.ts +0 -239
  76. package/src/refractor/plugins/replace-empty-element.ts +0 -656
  77. package/src/refractor/predicates.ts +0 -39
  78. package/src/refractor/specification.ts +0 -557
  79. package/src/refractor/toolbox.ts +0 -24
  80. package/src/refractor/visitors/FallbackVisitor.ts +0 -24
  81. package/src/refractor/visitors/SpecificationExtensionVisitor.ts +0 -22
  82. package/src/refractor/visitors/SpecificationVisitor.ts +0 -112
  83. package/src/refractor/visitors/Visitor.ts +0 -47
  84. package/src/refractor/visitors/generics/AlternatingVisitor.ts +0 -45
  85. package/src/refractor/visitors/generics/FixedFieldsVisitor.ts +0 -110
  86. package/src/refractor/visitors/generics/MapVisitor.ts +0 -25
  87. package/src/refractor/visitors/generics/MixedFieldsVisitor.ts +0 -77
  88. package/src/refractor/visitors/generics/PatternedFieldsVisitor.ts +0 -99
  89. package/src/refractor/visitors/open-api-3-0/ContentVisitor.ts +0 -28
  90. package/src/refractor/visitors/open-api-3-0/ExamplesVisitor.ts +0 -48
  91. package/src/refractor/visitors/open-api-3-0/OpenapiVisitor.ts +0 -30
  92. package/src/refractor/visitors/open-api-3-0/ParametersVisitor.ts +0 -47
  93. package/src/refractor/visitors/open-api-3-0/SecurityVisitor.ts +0 -44
  94. package/src/refractor/visitors/open-api-3-0/ServersVisitor.ts +0 -40
  95. package/src/refractor/visitors/open-api-3-0/TagsVisitor.ts +0 -40
  96. package/src/refractor/visitors/open-api-3-0/bases.ts +0 -82
  97. package/src/refractor/visitors/open-api-3-0/callback/index.ts +0 -49
  98. package/src/refractor/visitors/open-api-3-0/components/CallbacksVisitor.ts +0 -45
  99. package/src/refractor/visitors/open-api-3-0/components/ExamplesVisitor.ts +0 -46
  100. package/src/refractor/visitors/open-api-3-0/components/HeadersVisitor.ts +0 -53
  101. package/src/refractor/visitors/open-api-3-0/components/LinksVisitor.ts +0 -45
  102. package/src/refractor/visitors/open-api-3-0/components/ParametersVisitor.ts +0 -46
  103. package/src/refractor/visitors/open-api-3-0/components/RequestBodiesVisitor.ts +0 -45
  104. package/src/refractor/visitors/open-api-3-0/components/ResponsesVisitor.ts +0 -53
  105. package/src/refractor/visitors/open-api-3-0/components/SchemasVisitor.ts +0 -46
  106. package/src/refractor/visitors/open-api-3-0/components/SecuritySchemesVisitor.ts +0 -45
  107. package/src/refractor/visitors/open-api-3-0/components/index.ts +0 -31
  108. package/src/refractor/visitors/open-api-3-0/contact/index.ts +0 -27
  109. package/src/refractor/visitors/open-api-3-0/distriminator/MappingVisitor.ts +0 -24
  110. package/src/refractor/visitors/open-api-3-0/distriminator/index.ts +0 -27
  111. package/src/refractor/visitors/open-api-3-0/encoding/HeadersVisitor.ts +0 -57
  112. package/src/refractor/visitors/open-api-3-0/encoding/index.ts +0 -49
  113. package/src/refractor/visitors/open-api-3-0/example/ExternalValueVisitor.ts +0 -20
  114. package/src/refractor/visitors/open-api-3-0/example/index.ts +0 -38
  115. package/src/refractor/visitors/open-api-3-0/external-documentation/index.ts +0 -27
  116. package/src/refractor/visitors/open-api-3-0/header/ContentVisitor.ts +0 -18
  117. package/src/refractor/visitors/open-api-3-0/header/ExamplesVisitor.ts +0 -18
  118. package/src/refractor/visitors/open-api-3-0/header/SchemaVisitor.ts +0 -33
  119. package/src/refractor/visitors/open-api-3-0/header/index.ts +0 -27
  120. package/src/refractor/visitors/open-api-3-0/index.ts +0 -39
  121. package/src/refractor/visitors/open-api-3-0/info/VersionVisitor.ts +0 -21
  122. package/src/refractor/visitors/open-api-3-0/info/index.ts +0 -27
  123. package/src/refractor/visitors/open-api-3-0/license/index.ts +0 -27
  124. package/src/refractor/visitors/open-api-3-0/link/OperationIdVisitor.ts +0 -20
  125. package/src/refractor/visitors/open-api-3-0/link/OperationRefVisitor.ts +0 -20
  126. package/src/refractor/visitors/open-api-3-0/link/ParametersVisitor.ts +0 -24
  127. package/src/refractor/visitors/open-api-3-0/link/index.ts +0 -38
  128. package/src/refractor/visitors/open-api-3-0/media-type/EncodingVisitor.ts +0 -24
  129. package/src/refractor/visitors/open-api-3-0/media-type/ExamplesVisitor.ts +0 -18
  130. package/src/refractor/visitors/open-api-3-0/media-type/SchemaVisitor.ts +0 -33
  131. package/src/refractor/visitors/open-api-3-0/media-type/index.ts +0 -27
  132. package/src/refractor/visitors/open-api-3-0/oauth-flow/ScopesVisitor.ts +0 -24
  133. package/src/refractor/visitors/open-api-3-0/oauth-flow/index.ts +0 -27
  134. package/src/refractor/visitors/open-api-3-0/oauth-flows/index.ts +0 -27
  135. package/src/refractor/visitors/open-api-3-0/operation/CallbacksVisitor.ts +0 -45
  136. package/src/refractor/visitors/open-api-3-0/operation/ParametersVisitor.ts +0 -18
  137. package/src/refractor/visitors/open-api-3-0/operation/RequestBodyVisitor.ts +0 -39
  138. package/src/refractor/visitors/open-api-3-0/operation/SecurityVisitor.ts +0 -41
  139. package/src/refractor/visitors/open-api-3-0/operation/ServersVisitor.ts +0 -18
  140. package/src/refractor/visitors/open-api-3-0/operation/TagsVisitor.ts +0 -32
  141. package/src/refractor/visitors/open-api-3-0/operation/index.ts +0 -27
  142. package/src/refractor/visitors/open-api-3-0/parameter/ContentVisitor.ts +0 -18
  143. package/src/refractor/visitors/open-api-3-0/parameter/ExamplesVisitor.ts +0 -18
  144. package/src/refractor/visitors/open-api-3-0/parameter/SchemaVisitor.ts +0 -36
  145. package/src/refractor/visitors/open-api-3-0/parameter/index.ts +0 -49
  146. package/src/refractor/visitors/open-api-3-0/path-item/$RefVisitor.ts +0 -20
  147. package/src/refractor/visitors/open-api-3-0/path-item/ParametersVisitor.ts +0 -18
  148. package/src/refractor/visitors/open-api-3-0/path-item/ServersVisitor.ts +0 -18
  149. package/src/refractor/visitors/open-api-3-0/path-item/index.ts +0 -53
  150. package/src/refractor/visitors/open-api-3-0/paths/index.ts +0 -51
  151. package/src/refractor/visitors/open-api-3-0/reference/$RefVisitor.ts +0 -20
  152. package/src/refractor/visitors/open-api-3-0/reference/index.ts +0 -41
  153. package/src/refractor/visitors/open-api-3-0/request-body/ContentVisitor.ts +0 -18
  154. package/src/refractor/visitors/open-api-3-0/request-body/index.ts +0 -46
  155. package/src/refractor/visitors/open-api-3-0/response/ContentVisitor.ts +0 -18
  156. package/src/refractor/visitors/open-api-3-0/response/HeadersVisitor.ts +0 -57
  157. package/src/refractor/visitors/open-api-3-0/response/LinksVisitor.ts +0 -45
  158. package/src/refractor/visitors/open-api-3-0/response/index.ts +0 -57
  159. package/src/refractor/visitors/open-api-3-0/responses/DefaultVisitor.ts +0 -39
  160. package/src/refractor/visitors/open-api-3-0/responses/index.ts +0 -64
  161. package/src/refractor/visitors/open-api-3-0/schema/AllOfVisitor.ts +0 -34
  162. package/src/refractor/visitors/open-api-3-0/schema/AnyOfVisitor.ts +0 -34
  163. package/src/refractor/visitors/open-api-3-0/schema/ItemsVisitor.ts +0 -31
  164. package/src/refractor/visitors/open-api-3-0/schema/OneOfVisitor.ts +0 -34
  165. package/src/refractor/visitors/open-api-3-0/schema/PropertiesVisitor.ts +0 -34
  166. package/src/refractor/visitors/open-api-3-0/schema/SchemaOrReferenceVisitor.ts +0 -36
  167. package/src/refractor/visitors/open-api-3-0/schema/TypeVisitor.ts +0 -26
  168. package/src/refractor/visitors/open-api-3-0/schema/index.ts +0 -30
  169. package/src/refractor/visitors/open-api-3-0/security-requirement/index.ts +0 -24
  170. package/src/refractor/visitors/open-api-3-0/security-scheme/index.ts +0 -27
  171. package/src/refractor/visitors/open-api-3-0/server/UrlVisitor.ts +0 -20
  172. package/src/refractor/visitors/open-api-3-0/server/VariablesVisitor.ts +0 -24
  173. package/src/refractor/visitors/open-api-3-0/server/index.ts +0 -27
  174. package/src/refractor/visitors/open-api-3-0/server-variable/index.ts +0 -27
  175. package/src/refractor/visitors/open-api-3-0/tag/index.ts +0 -27
  176. package/src/refractor/visitors/open-api-3-0/xml/index.ts +0 -27
@@ -1,45 +0,0 @@
1
- import { ObjectElement } from '@speclynx/apidom-datamodel';
2
- import { Path } from '@speclynx/apidom-traverse';
3
-
4
- import ReferenceElement from '../../../../elements/Reference.ts';
5
- import ComponentsSecuritySchemesElement from '../../../../elements/nces/ComponentsSecuritySchemes.ts';
6
- import MapVisitor, { SpecPath } from '../../generics/MapVisitor.ts';
7
- import { BaseMapVisitor, BaseMapVisitorOptions } from '../bases.ts';
8
- import { isReferenceLikeElement } from '../../../predicates.ts';
9
- import { isReferenceElement } from '../../../../predicates.ts';
10
-
11
- /**
12
- * @public
13
- */
14
- export type { BaseMapVisitorOptions as SecuritySchemesVisitorOptions };
15
-
16
- /**
17
- * @public
18
- */
19
- class SecuritySchemesVisitor extends BaseMapVisitor {
20
- declare public readonly element: ComponentsSecuritySchemesElement;
21
-
22
- declare protected readonly specPath: SpecPath<
23
- ['document', 'objects', 'Reference'] | ['document', 'objects', 'SecurityScheme']
24
- >;
25
-
26
- constructor(options: BaseMapVisitorOptions) {
27
- super(options);
28
- this.element = new ComponentsSecuritySchemesElement();
29
- this.specPath = (element: unknown) =>
30
- isReferenceLikeElement(element)
31
- ? ['document', 'objects', 'Reference']
32
- : ['document', 'objects', 'SecurityScheme'];
33
- }
34
-
35
- ObjectElement(path: Path<ObjectElement>) {
36
- MapVisitor.prototype.ObjectElement.call(this, path);
37
-
38
- // @ts-ignore
39
- this.element.filter(isReferenceElement).forEach((referenceElement: ReferenceElement) => {
40
- referenceElement.meta.set('referenced-element', 'securityScheme');
41
- });
42
- }
43
- }
44
-
45
- export default SecuritySchemesVisitor;
@@ -1,31 +0,0 @@
1
- import { always } from 'ramda';
2
-
3
- import ComponentsElement from '../../../../elements/Components.ts';
4
- import { SpecPath } from '../../generics/FixedFieldsVisitor.ts';
5
- import { BaseFixedFieldsVisitor, BaseFixedFieldsVisitorOptions } from '../bases.ts';
6
-
7
- /**
8
- * @public
9
- */
10
- export type { BaseFixedFieldsVisitorOptions as ComponentsVisitorOptions };
11
-
12
- /**
13
- * @public
14
- */
15
- class ComponentsVisitor extends BaseFixedFieldsVisitor {
16
- declare public readonly element: ComponentsElement;
17
-
18
- declare protected readonly specPath: SpecPath<['document', 'objects', 'Components']>;
19
-
20
- declare protected readonly canSupportSpecificationExtensions: true;
21
-
22
- constructor(options: BaseFixedFieldsVisitorOptions) {
23
- super(options);
24
- this.element = new ComponentsElement();
25
- this.specPath = always(['document', 'objects', 'Components']);
26
- this.canSupportSpecificationExtensions = true;
27
- this.consumeSafe = true;
28
- }
29
- }
30
-
31
- export default ComponentsVisitor;
@@ -1,27 +0,0 @@
1
- import { always } from 'ramda';
2
-
3
- import ContactElement from '../../../../elements/Contact.ts';
4
- import { SpecPath } from '../../generics/FixedFieldsVisitor.ts';
5
- import { BaseFixedFieldsVisitor, BaseFixedFieldsVisitorOptions } from '../bases.ts';
6
-
7
- export type { BaseFixedFieldsVisitorOptions as ContactVisitorOptions };
8
-
9
- /**
10
- * @public
11
- */
12
- class ContactVisitor extends BaseFixedFieldsVisitor {
13
- declare public readonly element: ContactElement;
14
-
15
- declare protected readonly specPath: SpecPath<['document', 'objects', 'Contact']>;
16
-
17
- declare protected readonly canSupportSpecificationExtensions: true;
18
-
19
- constructor(options: BaseFixedFieldsVisitorOptions) {
20
- super(options);
21
- this.element = new ContactElement();
22
- this.specPath = always(['document', 'objects', 'Contact']);
23
- this.canSupportSpecificationExtensions = true;
24
- }
25
- }
26
-
27
- export default ContactVisitor;
@@ -1,24 +0,0 @@
1
- import { always } from 'ramda';
2
-
3
- import { SpecPath } from '../../generics/MapVisitor.ts';
4
- import DiscriminatorMappingElement from '../../../../elements/nces/DiscriminatorMapping.ts';
5
- import { BaseMapVisitor, BaseMapVisitorOptions } from '../bases.ts';
6
-
7
- export type { BaseMapVisitorOptions as MappingVisitorOptions };
8
-
9
- /**
10
- * @public
11
- */
12
- class MappingVisitor extends BaseMapVisitor {
13
- declare public readonly element: DiscriminatorMappingElement;
14
-
15
- declare protected readonly specPath: SpecPath<['value']>;
16
-
17
- constructor(options: BaseMapVisitorOptions) {
18
- super(options);
19
- this.element = new DiscriminatorMappingElement();
20
- this.specPath = always(['value']);
21
- }
22
- }
23
-
24
- export default MappingVisitor;
@@ -1,27 +0,0 @@
1
- import { always } from 'ramda';
2
-
3
- import DiscriminatorElement from '../../../../elements/Discriminator.ts';
4
- import { SpecPath } from '../../generics/FixedFieldsVisitor.ts';
5
- import { BaseFixedFieldsVisitor, BaseFixedFieldsVisitorOptions } from '../bases.ts';
6
-
7
- export type { BaseFixedFieldsVisitorOptions as DiscriminatorVisitorOptions };
8
-
9
- /**
10
- * @public
11
- */
12
- class DiscriminatorVisitor extends BaseFixedFieldsVisitor {
13
- declare public readonly element: DiscriminatorElement;
14
-
15
- declare protected readonly specPath: SpecPath<['document', 'objects', 'Discriminator']>;
16
-
17
- declare protected canSupportSpecificationExtensions: boolean;
18
-
19
- constructor(options: BaseFixedFieldsVisitorOptions) {
20
- super(options);
21
- this.element = new DiscriminatorElement();
22
- this.specPath = always(['document', 'objects', 'Discriminator']);
23
- this.canSupportSpecificationExtensions = false;
24
- }
25
- }
26
-
27
- export default DiscriminatorVisitor;
@@ -1,57 +0,0 @@
1
- import { Element, ObjectElement, StringElement } from '@speclynx/apidom-datamodel';
2
- import { toValue } from '@speclynx/apidom-core';
3
- import { Path } from '@speclynx/apidom-traverse';
4
-
5
- import MapVisitor, { SpecPath } from '../../generics/MapVisitor.ts';
6
- import { isReferenceLikeElement } from '../../../predicates.ts';
7
- import { isHeaderElement, isReferenceElement } from '../../../../predicates.ts';
8
- import EncodingHeadersElement from '../../../../elements/nces/EncodingHeaders.ts';
9
- import ReferenceElement from '../../../../elements/Reference.ts';
10
- import { BaseMapVisitor, BaseMapVisitorOptions } from '../bases.ts';
11
-
12
- /**
13
- * @public
14
- */
15
- export type { BaseMapVisitorOptions as HeadersVisitorOptions };
16
-
17
- /**
18
- * @public
19
- */
20
- class HeadersVisitor extends BaseMapVisitor {
21
- declare public readonly element: EncodingHeadersElement;
22
-
23
- declare protected readonly specPath: SpecPath<
24
- ['document', 'objects', 'Reference'] | ['document', 'objects', 'Header']
25
- >;
26
-
27
- constructor(options: BaseMapVisitorOptions) {
28
- super(options);
29
- this.element = new EncodingHeadersElement();
30
- this.specPath = (element: unknown) =>
31
- isReferenceLikeElement(element)
32
- ? ['document', 'objects', 'Reference']
33
- : ['document', 'objects', 'Header'];
34
- }
35
-
36
- ObjectElement(path: Path<ObjectElement>) {
37
- MapVisitor.prototype.ObjectElement.call(this, path);
38
-
39
- // decorate every ReferenceElement with metadata about their referencing type
40
- // @ts-ignore
41
- this.element.filter(isReferenceElement).forEach((referenceElement: ReferenceElement) => {
42
- referenceElement.meta.set('referenced-element', 'header');
43
- });
44
-
45
- // decorate every HeaderElement with metadata about their name
46
- // @ts-ignore
47
- this.element.forEach((value: Element, key: StringElement): void => {
48
- if (!isHeaderElement(value)) return;
49
-
50
- const headerName = toValue(key);
51
-
52
- value.meta.set('headerName', headerName);
53
- });
54
- }
55
- }
56
-
57
- export default HeadersVisitor;
@@ -1,49 +0,0 @@
1
- import { always } from 'ramda';
2
- import { isObjectElement, ObjectElement, StringElement } from '@speclynx/apidom-datamodel';
3
- import { toValue } from '@speclynx/apidom-core';
4
- import { Path } from '@speclynx/apidom-traverse';
5
-
6
- import EncodingElement from '../../../../elements/Encoding.ts';
7
- import HeaderElement from '../../../../elements/Header.ts';
8
- import FixedFieldsVisitor, { SpecPath } from '../../generics/FixedFieldsVisitor.ts';
9
- import { isHeaderElement } from '../../../../predicates.ts';
10
- import { BaseFixedFieldsVisitor, BaseFixedFieldsVisitorOptions } from '../bases.ts';
11
-
12
- /**
13
- * @public
14
- */
15
- export type { BaseFixedFieldsVisitorOptions as EncodingVisitorOptions };
16
-
17
- /**
18
- * @public
19
- */
20
- class EncodingVisitor extends BaseFixedFieldsVisitor {
21
- declare public readonly element: EncodingElement;
22
-
23
- declare protected readonly specPath: SpecPath<['document', 'objects', 'Encoding']>;
24
-
25
- declare protected readonly canSupportSpecificationExtensions: true;
26
-
27
- constructor(options: BaseFixedFieldsVisitorOptions) {
28
- super(options);
29
- this.element = new EncodingElement();
30
- this.specPath = always(['document', 'objects', 'Encoding']);
31
- this.canSupportSpecificationExtensions = true;
32
- }
33
-
34
- ObjectElement(path: Path<ObjectElement>) {
35
- FixedFieldsVisitor.prototype.ObjectElement.call(this, path);
36
-
37
- // decorate every Header with media type metadata
38
- if (isObjectElement(this.element.headers)) {
39
- this.element.headers
40
- .filter(isHeaderElement)
41
- // @ts-ignore
42
- .forEach((headerElement: HeaderElement, key: StringElement) => {
43
- headerElement.meta.set('header-name', toValue(key));
44
- });
45
- }
46
- }
47
- }
48
-
49
- export default EncodingVisitor;
@@ -1,20 +0,0 @@
1
- import { StringElement } from '@speclynx/apidom-datamodel';
2
- import { Path } from '@speclynx/apidom-traverse';
3
-
4
- import FallbackVisitor, { FallbackVisitorOptions } from '../../FallbackVisitor.ts';
5
-
6
- export type { FallbackVisitorOptions as ExternalValueVisitorOptions };
7
-
8
- /**
9
- * @public
10
- */
11
- class ExternalValueVisitor extends FallbackVisitor {
12
- declare public readonly element: StringElement;
13
-
14
- StringElement(path: Path<StringElement>) {
15
- super.enter(path);
16
- this.element.classes.push('reference-value');
17
- }
18
- }
19
-
20
- export default ExternalValueVisitor;
@@ -1,38 +0,0 @@
1
- import { always } from 'ramda';
2
- import { ObjectElement, isStringElement } from '@speclynx/apidom-datamodel';
3
- import { Path } from '@speclynx/apidom-traverse';
4
-
5
- import ExampleElement from '../../../../elements/Example.ts';
6
- import { SpecPath } from '../../generics/FixedFieldsVisitor.ts';
7
- import { BaseFixedFieldsVisitor, BaseFixedFieldsVisitorOptions } from '../bases.ts';
8
-
9
- export type { BaseFixedFieldsVisitorOptions as ExampleVisitorOptions };
10
-
11
- /**
12
- * @public
13
- */
14
- class ExampleVisitor extends BaseFixedFieldsVisitor {
15
- declare public readonly element: ExampleElement;
16
-
17
- declare protected readonly specPath: SpecPath<['document', 'objects', 'Example']>;
18
-
19
- declare protected readonly canSupportSpecificationExtensions: true;
20
-
21
- constructor(options: BaseFixedFieldsVisitorOptions) {
22
- super(options);
23
- this.element = new ExampleElement();
24
- this.specPath = always(['document', 'objects', 'Example']);
25
- this.canSupportSpecificationExtensions = true;
26
- }
27
-
28
- ObjectElement(path: Path<ObjectElement>) {
29
- BaseFixedFieldsVisitor.prototype.ObjectElement.call(this, path);
30
-
31
- // mark this ExampleElement with reference metadata
32
- if (isStringElement(this.element.externalValue)) {
33
- this.element.classes.push('reference-element');
34
- }
35
- }
36
- }
37
-
38
- export default ExampleVisitor;
@@ -1,27 +0,0 @@
1
- import { always } from 'ramda';
2
-
3
- import ExternalDocumentationElement from '../../../../elements/ExternalDocumentation.ts';
4
- import { SpecPath } from '../../generics/FixedFieldsVisitor.ts';
5
- import { BaseFixedFieldsVisitor, BaseFixedFieldsVisitorOptions } from '../bases.ts';
6
-
7
- export type { BaseFixedFieldsVisitorOptions as ExternalDocumentationVisitorOptions };
8
-
9
- /**
10
- * @public
11
- */
12
- class ExternalDocumentationVisitor extends BaseFixedFieldsVisitor {
13
- declare public readonly element: ExternalDocumentationElement;
14
-
15
- declare protected readonly specPath: SpecPath<['document', 'objects', 'ExternalDocumentation']>;
16
-
17
- declare protected readonly canSupportSpecificationExtensions: true;
18
-
19
- constructor(options: BaseFixedFieldsVisitorOptions) {
20
- super(options);
21
- this.element = new ExternalDocumentationElement();
22
- this.specPath = always(['document', 'objects', 'ExternalDocumentation']);
23
- this.canSupportSpecificationExtensions = true;
24
- }
25
- }
26
-
27
- export default ExternalDocumentationVisitor;
@@ -1,18 +0,0 @@
1
- import BaseContentVisitor, { ContentVisitorOptions } from '../ContentVisitor.ts';
2
- import HeaderContentElement from '../../../../elements/nces/HeaderContent.ts';
3
-
4
- export type { ContentVisitorOptions };
5
-
6
- /**
7
- * @public
8
- */
9
- class ContentVisitor extends BaseContentVisitor {
10
- declare public readonly element: HeaderContentElement;
11
-
12
- constructor(options: ContentVisitorOptions) {
13
- super(options);
14
- this.element = new HeaderContentElement();
15
- }
16
- }
17
-
18
- export default ContentVisitor;
@@ -1,18 +0,0 @@
1
- import BaseExamplesVisitor, { ExamplesVisitorOptions } from '../ExamplesVisitor.ts';
2
- import HeaderExamplesElement from '../../../../elements/nces/HeaderExamples.ts';
3
-
4
- export type { ExamplesVisitorOptions };
5
-
6
- /**
7
- * @public
8
- */
9
- class ExamplesVisitor extends BaseExamplesVisitor {
10
- declare public readonly element: HeaderExamplesElement;
11
-
12
- constructor(options: ExamplesVisitorOptions) {
13
- super(options);
14
- this.element = new HeaderExamplesElement();
15
- }
16
- }
17
-
18
- export default ExamplesVisitor;
@@ -1,33 +0,0 @@
1
- import { T as stubTrue } from 'ramda';
2
- import { ObjectElement } from '@speclynx/apidom-datamodel';
3
- import { Path } from '@speclynx/apidom-traverse';
4
-
5
- import { BaseAlternatingVisitor, BaseAlternatingVisitorOptions } from '../bases.ts';
6
- import AlternatingVisitor from '../../generics/AlternatingVisitor.ts';
7
- import { isReferenceLikeElement } from '../../../predicates.ts';
8
- import { isReferenceElement } from '../../../../predicates.ts';
9
-
10
- export type { BaseAlternatingVisitorOptions as SchemaVisitorOptions };
11
-
12
- /**
13
- * @public
14
- */
15
- class SchemaVisitor extends BaseAlternatingVisitor {
16
- constructor(options: BaseAlternatingVisitorOptions) {
17
- super(options);
18
- this.alternator = [
19
- { predicate: isReferenceLikeElement, specPath: ['document', 'objects', 'Reference'] },
20
- { predicate: stubTrue, specPath: ['document', 'objects', 'Schema'] },
21
- ];
22
- }
23
-
24
- ObjectElement(path: Path<ObjectElement>) {
25
- AlternatingVisitor.prototype.enter.call(this, path);
26
-
27
- if (isReferenceElement(this.element)) {
28
- this.element.meta.set('referenced-element', 'schema');
29
- }
30
- }
31
- }
32
-
33
- export default SchemaVisitor;
@@ -1,27 +0,0 @@
1
- import { always } from 'ramda';
2
-
3
- import HeaderElement from '../../../../elements/Header.ts';
4
- import { SpecPath } from '../../generics/FixedFieldsVisitor.ts';
5
- import { BaseFixedFieldsVisitor, BaseFixedFieldsVisitorOptions } from '../bases.ts';
6
-
7
- export type { BaseFixedFieldsVisitorOptions as HeaderVisitorOptions };
8
-
9
- /**
10
- * @public
11
- */
12
- class HeaderVisitor extends BaseFixedFieldsVisitor {
13
- declare public readonly element: HeaderElement;
14
-
15
- declare protected readonly specPath: SpecPath<['document', 'objects', 'Header']>;
16
-
17
- declare protected readonly canSupportSpecificationExtensions: true;
18
-
19
- constructor(options: BaseFixedFieldsVisitorOptions) {
20
- super(options);
21
- this.element = new HeaderElement();
22
- this.specPath = always(['document', 'objects', 'Header']);
23
- this.canSupportSpecificationExtensions = true;
24
- }
25
- }
26
-
27
- export default HeaderVisitor;
@@ -1,39 +0,0 @@
1
- import { always } from 'ramda';
2
- import { ObjectElement } from '@speclynx/apidom-datamodel';
3
- import { Path } from '@speclynx/apidom-traverse';
4
-
5
- import { SpecPath } from '../generics/FixedFieldsVisitor.ts';
6
- import { BaseFixedFieldsVisitor, BaseFixedFieldsVisitorOptions } from './bases.ts';
7
- import OpenApi3_0Element from '../../../elements/OpenApi3-0.ts';
8
-
9
- /**
10
- * @public
11
- */
12
-
13
- export type { BaseFixedFieldsVisitorOptions as OpenApi3_0VisitorOptions };
14
-
15
- /**
16
- * @public
17
- */
18
-
19
- class OpenApi3_0Visitor extends BaseFixedFieldsVisitor {
20
- declare public readonly element: OpenApi3_0Element;
21
-
22
- declare protected readonly specPath: SpecPath<['document', 'objects', 'OpenApi']>;
23
-
24
- declare protected readonly canSupportSpecificationExtensions: true;
25
-
26
- constructor(options: BaseFixedFieldsVisitorOptions) {
27
- super(options);
28
- this.element = new OpenApi3_0Element();
29
- this.specPath = always(['document', 'objects', 'OpenApi']);
30
- this.canSupportSpecificationExtensions = true;
31
- this.consumeSafe = true;
32
- }
33
-
34
- ObjectElement(path: Path<ObjectElement>) {
35
- BaseFixedFieldsVisitor.prototype.ObjectElement.call(this, path);
36
- }
37
- }
38
-
39
- export default OpenApi3_0Visitor;
@@ -1,21 +0,0 @@
1
- import { StringElement } from '@speclynx/apidom-datamodel';
2
- import { Path } from '@speclynx/apidom-traverse';
3
-
4
- import FallbackVisitor, { FallbackVisitorOptions } from '../../FallbackVisitor.ts';
5
-
6
- export type { FallbackVisitorOptions as VersionVisitorOptions };
7
-
8
- /**
9
- * @public
10
- */
11
- class VersionVisitor extends FallbackVisitor {
12
- declare public readonly element: StringElement;
13
-
14
- StringElement(path: Path<StringElement>) {
15
- super.enter(path);
16
- this.element.classes.push('api-version');
17
- this.element.classes.push('version');
18
- }
19
- }
20
-
21
- export default VersionVisitor;
@@ -1,27 +0,0 @@
1
- import { always } from 'ramda';
2
-
3
- import InfoElement from '../../../../elements/Info.ts';
4
- import { SpecPath } from '../../generics/FixedFieldsVisitor.ts';
5
- import { BaseFixedFieldsVisitor, BaseFixedFieldsVisitorOptions } from '../bases.ts';
6
-
7
- export type { BaseFixedFieldsVisitorOptions as InfoVisitorOptions };
8
-
9
- /**
10
- * @public
11
- */
12
- class InfoVisitor extends BaseFixedFieldsVisitor {
13
- declare public readonly element: InfoElement;
14
-
15
- declare protected readonly specPath: SpecPath<['document', 'objects', 'Info']>;
16
-
17
- declare protected readonly canSupportSpecificationExtensions: true;
18
-
19
- constructor(options: BaseFixedFieldsVisitorOptions) {
20
- super(options);
21
- this.element = new InfoElement();
22
- this.specPath = always(['document', 'objects', 'Info']);
23
- this.canSupportSpecificationExtensions = true;
24
- }
25
- }
26
-
27
- export default InfoVisitor;
@@ -1,27 +0,0 @@
1
- import { always } from 'ramda';
2
-
3
- import LicenseElement from '../../../../elements/License.ts';
4
- import { SpecPath } from '../../generics/FixedFieldsVisitor.ts';
5
- import { BaseFixedFieldsVisitor, BaseFixedFieldsVisitorOptions } from '../bases.ts';
6
-
7
- export type { BaseFixedFieldsVisitorOptions as LicenseVisitorOptions };
8
-
9
- /**
10
- * @public
11
- */
12
- class LicenseVisitor extends BaseFixedFieldsVisitor {
13
- declare public readonly element: LicenseElement;
14
-
15
- declare protected readonly specPath: SpecPath<['document', 'objects', 'License']>;
16
-
17
- declare protected readonly canSupportSpecificationExtensions: true;
18
-
19
- constructor(options: BaseFixedFieldsVisitorOptions) {
20
- super(options);
21
- this.element = new LicenseElement();
22
- this.specPath = always(['document', 'objects', 'License']);
23
- this.canSupportSpecificationExtensions = true;
24
- }
25
- }
26
-
27
- export default LicenseVisitor;
@@ -1,20 +0,0 @@
1
- import { StringElement } from '@speclynx/apidom-datamodel';
2
- import { Path } from '@speclynx/apidom-traverse';
3
-
4
- import FallbackVisitor, { FallbackVisitorOptions } from '../../FallbackVisitor.ts';
5
-
6
- export type { FallbackVisitorOptions as OperationIdVisitorOptions };
7
-
8
- /**
9
- * @public
10
- */
11
- class OperationIdVisitor extends FallbackVisitor {
12
- declare public readonly element: StringElement;
13
-
14
- StringElement(path: Path<StringElement>) {
15
- super.enter(path);
16
- this.element.classes.push('reference-value');
17
- }
18
- }
19
-
20
- export default OperationIdVisitor;
@@ -1,20 +0,0 @@
1
- import { StringElement } from '@speclynx/apidom-datamodel';
2
- import { Path } from '@speclynx/apidom-traverse';
3
-
4
- import FallbackVisitor, { FallbackVisitorOptions } from '../../FallbackVisitor.ts';
5
-
6
- export type { FallbackVisitorOptions as OperationRefVisitorOptions };
7
-
8
- /**
9
- * @public
10
- */
11
- class OperationRefVisitor extends FallbackVisitor {
12
- declare public readonly element: StringElement;
13
-
14
- StringElement(path: Path<StringElement>) {
15
- super.enter(path);
16
- this.element.classes.push('reference-value');
17
- }
18
- }
19
-
20
- export default OperationRefVisitor;
@@ -1,24 +0,0 @@
1
- import { always } from 'ramda';
2
-
3
- import { SpecPath } from '../../generics/MapVisitor.ts';
4
- import { BaseMapVisitor, BaseMapVisitorOptions } from '../bases.ts';
5
- import LinkParametersElement from '../../../../elements/nces/LinkParameters.ts';
6
-
7
- export type { BaseMapVisitorOptions as ParametersVisitorOptions };
8
-
9
- /**
10
- * @public
11
- */
12
- class ParametersVisitor extends BaseMapVisitor {
13
- declare public readonly element: LinkParametersElement;
14
-
15
- declare protected readonly specPath: SpecPath<['value']>;
16
-
17
- constructor(options: BaseMapVisitorOptions) {
18
- super(options);
19
- this.element = new LinkParametersElement();
20
- this.specPath = always(['value']);
21
- }
22
- }
23
-
24
- export default ParametersVisitor;