@speclynx/apidom-ns-openapi-2 4.0.3 → 4.0.4

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 (112) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/apidom-ns-openapi-2.browser.js +7 -7
  3. package/dist/apidom-ns-openapi-2.browser.min.js +1 -1
  4. package/package.json +9 -8
  5. package/src/elements/Contact.ts +0 -42
  6. package/src/elements/Definitions.ts +0 -13
  7. package/src/elements/Example.ts +0 -13
  8. package/src/elements/ExternalDocumentation.ts +0 -34
  9. package/src/elements/Header.ts +0 -261
  10. package/src/elements/Headers.ts +0 -13
  11. package/src/elements/Info.ts +0 -70
  12. package/src/elements/Items.ts +0 -264
  13. package/src/elements/License.ts +0 -34
  14. package/src/elements/Operation.ts +0 -106
  15. package/src/elements/Parameter.ts +0 -326
  16. package/src/elements/ParametersDefinitions.ts +0 -13
  17. package/src/elements/PathItem.ts +0 -93
  18. package/src/elements/Paths.ts +0 -13
  19. package/src/elements/Reference.ts +0 -27
  20. package/src/elements/Response.ts +0 -54
  21. package/src/elements/Responses.ts +0 -24
  22. package/src/elements/ResponsesDefinitions.ts +0 -13
  23. package/src/elements/Schema.ts +0 -204
  24. package/src/elements/Scopes.ts +0 -13
  25. package/src/elements/SecurityDefinitions.ts +0 -13
  26. package/src/elements/SecurityRequirement.ts +0 -13
  27. package/src/elements/SecurityScheme.ts +0 -83
  28. package/src/elements/Swagger.ts +0 -149
  29. package/src/elements/SwaggerVersion.ts +0 -15
  30. package/src/elements/Tag.ts +0 -44
  31. package/src/elements/Xml.ts +0 -59
  32. package/src/elements/nces/OperationConsumes.ts +0 -15
  33. package/src/elements/nces/OperationParameters.ts +0 -16
  34. package/src/elements/nces/OperationProduces.ts +0 -15
  35. package/src/elements/nces/OperationSchemes.ts +0 -15
  36. package/src/elements/nces/OperationSecurity.ts +0 -16
  37. package/src/elements/nces/OperationTags.ts +0 -16
  38. package/src/elements/nces/PathItemParameters.ts +0 -16
  39. package/src/elements/nces/SwaggerConsumes.ts +0 -15
  40. package/src/elements/nces/SwaggerProduces.ts +0 -15
  41. package/src/elements/nces/SwaggerSchemes.ts +0 -15
  42. package/src/elements/nces/SwaggerSecurity.ts +0 -16
  43. package/src/elements/nces/SwaggerTags.ts +0 -15
  44. package/src/index.ts +0 -368
  45. package/src/media-types.ts +0 -42
  46. package/src/namespace.ts +0 -70
  47. package/src/predicates.ts +0 -194
  48. package/src/refractor/index.ts +0 -330
  49. package/src/refractor/inspect.ts +0 -181
  50. package/src/refractor/plugins/replace-empty-element.ts +0 -389
  51. package/src/refractor/predicates.ts +0 -29
  52. package/src/refractor/specification.ts +0 -444
  53. package/src/refractor/toolbox.ts +0 -24
  54. package/src/refractor/visitors/FallbackVisitor.ts +0 -25
  55. package/src/refractor/visitors/SpecificationExtensionVisitor.ts +0 -22
  56. package/src/refractor/visitors/SpecificationVisitor.ts +0 -83
  57. package/src/refractor/visitors/Visitor.ts +0 -47
  58. package/src/refractor/visitors/generics/AlternatingVisitor.ts +0 -45
  59. package/src/refractor/visitors/generics/FixedFieldsVisitor.ts +0 -109
  60. package/src/refractor/visitors/generics/MapVisitor.ts +0 -25
  61. package/src/refractor/visitors/generics/MixedFieldsVisitor.ts +0 -77
  62. package/src/refractor/visitors/generics/PatternedFieldsVisitor.ts +0 -99
  63. package/src/refractor/visitors/open-api-2/BasePathVisitor.ts +0 -20
  64. package/src/refractor/visitors/open-api-2/ConsumesVisitor.ts +0 -29
  65. package/src/refractor/visitors/open-api-2/HostVisitor.ts +0 -20
  66. package/src/refractor/visitors/open-api-2/ProducesVisitor.ts +0 -29
  67. package/src/refractor/visitors/open-api-2/SchemesVisitor.ts +0 -29
  68. package/src/refractor/visitors/open-api-2/SecurityVisitor.ts +0 -34
  69. package/src/refractor/visitors/open-api-2/SwaggerVisitor.ts +0 -29
  70. package/src/refractor/visitors/open-api-2/TagsVisitor.ts +0 -34
  71. package/src/refractor/visitors/open-api-2/bases.ts +0 -82
  72. package/src/refractor/visitors/open-api-2/contact/index.ts +0 -27
  73. package/src/refractor/visitors/open-api-2/definitions/index.ts +0 -48
  74. package/src/refractor/visitors/open-api-2/example/index.ts +0 -27
  75. package/src/refractor/visitors/open-api-2/external-documentation/index.ts +0 -27
  76. package/src/refractor/visitors/open-api-2/header/index.ts +0 -27
  77. package/src/refractor/visitors/open-api-2/headers/index.ts +0 -27
  78. package/src/refractor/visitors/open-api-2/index.ts +0 -28
  79. package/src/refractor/visitors/open-api-2/info/VersionVisitor.ts +0 -21
  80. package/src/refractor/visitors/open-api-2/info/index.ts +0 -27
  81. package/src/refractor/visitors/open-api-2/items/index.ts +0 -27
  82. package/src/refractor/visitors/open-api-2/license/index.ts +0 -27
  83. package/src/refractor/visitors/open-api-2/operation/ConsumesVisitor.ts +0 -29
  84. package/src/refractor/visitors/open-api-2/operation/ParametersVisitor.ts +0 -44
  85. package/src/refractor/visitors/open-api-2/operation/ProducesVisitor.ts +0 -29
  86. package/src/refractor/visitors/open-api-2/operation/SchemesVisitor.ts +0 -29
  87. package/src/refractor/visitors/open-api-2/operation/SecurityVisitor.ts +0 -34
  88. package/src/refractor/visitors/open-api-2/operation/TagsVisitor.ts +0 -29
  89. package/src/refractor/visitors/open-api-2/operation/index.ts +0 -24
  90. package/src/refractor/visitors/open-api-2/parameter/index.ts +0 -27
  91. package/src/refractor/visitors/open-api-2/parameters-definitions/index.ts +0 -24
  92. package/src/refractor/visitors/open-api-2/path-item/$RefVisitor.ts +0 -20
  93. package/src/refractor/visitors/open-api-2/path-item/ParametersVisitor.ts +0 -44
  94. package/src/refractor/visitors/open-api-2/path-item/index.ts +0 -48
  95. package/src/refractor/visitors/open-api-2/paths/index.ts +0 -48
  96. package/src/refractor/visitors/open-api-2/reference/$RefVisitor.ts +0 -20
  97. package/src/refractor/visitors/open-api-2/reference/index.ts +0 -38
  98. package/src/refractor/visitors/open-api-2/response/index.ts +0 -27
  99. package/src/refractor/visitors/open-api-2/responses/DefaultVisitor.ts +0 -36
  100. package/src/refractor/visitors/open-api-2/responses/index.ts +0 -64
  101. package/src/refractor/visitors/open-api-2/responses-definitions/index.ts +0 -24
  102. package/src/refractor/visitors/open-api-2/schema/AllOfVisitor.ts +0 -35
  103. package/src/refractor/visitors/open-api-2/schema/ItemsVisitor.ts +0 -38
  104. package/src/refractor/visitors/open-api-2/schema/PropertiesVisitor.ts +0 -35
  105. package/src/refractor/visitors/open-api-2/schema/SchemaOrJSONReferenceVisitor.ts +0 -37
  106. package/src/refractor/visitors/open-api-2/schema/index.ts +0 -27
  107. package/src/refractor/visitors/open-api-2/scopes/index.ts +0 -27
  108. package/src/refractor/visitors/open-api-2/security-definitions/index.ts +0 -24
  109. package/src/refractor/visitors/open-api-2/security-requirement/index.ts +0 -24
  110. package/src/refractor/visitors/open-api-2/security-scheme/index.ts +0 -27
  111. package/src/refractor/visitors/open-api-2/tag/index.ts +0 -27
  112. package/src/refractor/visitors/open-api-2/xml/index.ts +0 -27
@@ -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,48 +0,0 @@
1
- import { ObjectElement } from '@speclynx/apidom-datamodel';
2
- import { Path } from '@speclynx/apidom-traverse';
3
- import {
4
- isJSONReferenceLikeElement,
5
- isJSONReferenceElement,
6
- JSONReferenceElement,
7
- } from '@speclynx/apidom-ns-json-schema-draft-4';
8
-
9
- import DefinitionsElement from '../../../../elements/Definitions.ts';
10
- import { SpecPath } from '../../generics/MapVisitor.ts';
11
- import { BaseMapVisitor, BaseMapVisitorOptions } from '../bases.ts';
12
-
13
- export type { BaseMapVisitorOptions as DefinitionsVisitorOptions };
14
-
15
- /**
16
- * @public
17
- */
18
- class DefinitionsVisitor extends BaseMapVisitor {
19
- declare public readonly element: DefinitionsElement;
20
-
21
- declare protected readonly specPath: SpecPath<
22
- ['document', 'objects', 'JSONReference'] | ['document', 'objects', 'Schema']
23
- >;
24
-
25
- constructor(options: BaseMapVisitorOptions) {
26
- super(options);
27
- this.element = new DefinitionsElement();
28
- this.specPath = (element: unknown) => {
29
- return isJSONReferenceLikeElement(element)
30
- ? ['document', 'objects', 'JSONReference']
31
- : ['document', 'objects', 'Schema'];
32
- };
33
- }
34
-
35
- ObjectElement(path: Path<ObjectElement>) {
36
- BaseMapVisitor.prototype.ObjectElement.call(this, path);
37
-
38
- // decorate every JSONReferenceElement with metadata about their referencing type
39
- this.element
40
- .filter(isJSONReferenceElement)
41
- // @ts-ignore
42
- .forEach((referenceElement: JSONReferenceElement) => {
43
- referenceElement.meta.set('referenced-element', 'schema');
44
- });
45
- }
46
- }
47
-
48
- export default DefinitionsVisitor;
@@ -1,27 +0,0 @@
1
- import { always } from 'ramda';
2
-
3
- import ExampleElement from '../../../../elements/Example.ts';
4
- import { SpecPath } from '../../generics/MapVisitor.ts';
5
- import { BaseMapVisitor, BaseMapVisitorOptions } from '../bases.ts';
6
-
7
- export type { BaseMapVisitorOptions as ExampleVisitorOptions };
8
-
9
- /**
10
- * @public
11
- */
12
- class ExampleVisitor extends BaseMapVisitor {
13
- declare public readonly element: ExampleElement;
14
-
15
- declare protected readonly specPath: SpecPath<['value']>;
16
-
17
- declare protected readonly canSupportSpecificationExtensions: false;
18
-
19
- constructor(options: BaseMapVisitorOptions) {
20
- super(options);
21
- this.element = new ExampleElement();
22
- this.specPath = always(['value']);
23
- this.canSupportSpecificationExtensions = false;
24
- }
25
- }
26
-
27
- 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,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,27 +0,0 @@
1
- import { always } from 'ramda';
2
-
3
- import { SpecPath } from '../../generics/MapVisitor.ts';
4
- import HeadersElement from '../../../../elements/Headers.ts';
5
- import { BaseMapVisitor, BaseMapVisitorOptions } from '../bases.ts';
6
-
7
- export type { BaseMapVisitorOptions as HeadersVisitorOptions };
8
-
9
- /**
10
- * @public
11
- */
12
- class HeadersVisitor extends BaseMapVisitor {
13
- declare public readonly element: HeadersElement;
14
-
15
- declare protected readonly specPath: SpecPath<['document', 'objects', 'Header']>;
16
-
17
- declare protected readonly canSupportSpecificationExtensions: false;
18
-
19
- constructor(options: BaseMapVisitorOptions) {
20
- super(options);
21
- this.element = new HeadersElement();
22
- this.specPath = always(['document', 'objects', 'Header']);
23
- this.canSupportSpecificationExtensions = false;
24
- }
25
- }
26
-
27
- export default HeadersVisitor;
@@ -1,28 +0,0 @@
1
- import { always } from 'ramda';
2
-
3
- import SwaggerElement from '../../../elements/Swagger.ts';
4
- import { SpecPath } from '../generics/FixedFieldsVisitor.ts';
5
- import { BaseFixedFieldsVisitor, BaseFixedFieldsVisitorOptions } from './bases.ts';
6
-
7
- export type { BaseFixedFieldsVisitorOptions as SwaggerVisitorOptions };
8
-
9
- /**
10
- * @public
11
- */
12
- class SwaggerVisitor extends BaseFixedFieldsVisitor {
13
- declare public readonly element: SwaggerElement;
14
-
15
- declare protected readonly specPath: SpecPath<['document', 'objects', 'Swagger']>;
16
-
17
- declare protected readonly canSupportSpecificationExtensions: true;
18
-
19
- constructor(options: BaseFixedFieldsVisitorOptions) {
20
- super(options);
21
- this.element = new SwaggerElement();
22
- this.consumeSafe = true;
23
- this.specPath = always(['document', 'objects', 'Swagger']);
24
- this.canSupportSpecificationExtensions = true;
25
- }
26
- }
27
-
28
- export default SwaggerVisitor;
@@ -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 ItemsElement from '../../../../elements/Items.ts';
4
- import { SpecPath } from '../../generics/FixedFieldsVisitor.ts';
5
- import { BaseFixedFieldsVisitor, BaseFixedFieldsVisitorOptions } from '../bases.ts';
6
-
7
- export type { BaseFixedFieldsVisitorOptions as ItemsVisitorOptions };
8
-
9
- /**
10
- * @public
11
- */
12
- class ItemsVisitor extends BaseFixedFieldsVisitor {
13
- declare public readonly element: ItemsElement;
14
-
15
- protected readonly specPath: SpecPath<['document', 'objects', 'Items']>;
16
-
17
- protected readonly canSupportSpecificationExtensions: true;
18
-
19
- constructor(options: BaseFixedFieldsVisitorOptions) {
20
- super(options);
21
- this.element = new ItemsElement();
22
- this.specPath = always(['document', 'objects', 'Items']);
23
- this.canSupportSpecificationExtensions = true;
24
- }
25
- }
26
-
27
- export default ItemsVisitor;
@@ -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,29 +0,0 @@
1
- import { ArrayElement, cloneDeep } from '@speclynx/apidom-datamodel';
2
- import { Path } from '@speclynx/apidom-traverse';
3
-
4
- import OperationConsumesElement from '../../../../elements/nces/OperationConsumes.ts';
5
- import FallbackVisitor, { FallbackVisitorOptions } from '../../FallbackVisitor.ts';
6
-
7
- export type { FallbackVisitorOptions as ConsumesVisitorOptions };
8
-
9
- /**
10
- * @public
11
- */
12
- class ConsumesVisitor extends FallbackVisitor {
13
- declare public element: OperationConsumesElement;
14
-
15
- constructor(options: FallbackVisitorOptions) {
16
- super(options);
17
- this.element = new OperationConsumesElement();
18
- }
19
-
20
- ArrayElement(path: Path<ArrayElement>) {
21
- const arrayElement = path.node;
22
-
23
- this.element = this.element.concat(cloneDeep(arrayElement));
24
-
25
- path.stop();
26
- }
27
- }
28
-
29
- export default ConsumesVisitor;
@@ -1,44 +0,0 @@
1
- import { ArrayElement, Element } from '@speclynx/apidom-datamodel';
2
- import { Path } from '@speclynx/apidom-traverse';
3
-
4
- import { isReferenceLikeElement } from '../../../predicates.ts';
5
- import { isReferenceElement } from '../../../../predicates.ts';
6
- import OperationParametersElement from '../../../../elements/nces/OperationParameters.ts';
7
- import { BaseSpecificationVisitor, BaseSpecificationVisitorOptions } from '../bases.ts';
8
-
9
- export type { BaseSpecificationVisitorOptions as ParametersVisitorOptions };
10
-
11
- /**
12
- * @public
13
- */
14
- class ParametersVisitor extends BaseSpecificationVisitor {
15
- declare public readonly element: OperationParametersElement;
16
-
17
- constructor(options: BaseSpecificationVisitorOptions) {
18
- super(options);
19
- this.element = new OperationParametersElement();
20
- }
21
-
22
- ArrayElement(path: Path<ArrayElement>) {
23
- const arrayElement = path.node;
24
-
25
- arrayElement.forEach((item: Element): void => {
26
- const specPath = isReferenceLikeElement(item)
27
- ? ['document', 'objects', 'Reference']
28
- : ['document', 'objects', 'Parameter'];
29
- const element = this.toRefractedElement(specPath, item);
30
-
31
- if (isReferenceElement(element)) {
32
- element.meta.set('referenced-element', 'parameter');
33
- }
34
-
35
- this.element.push(element);
36
- });
37
-
38
- this.copyMetaAndAttributes(arrayElement, this.element);
39
-
40
- path.stop();
41
- }
42
- }
43
-
44
- export default ParametersVisitor;
@@ -1,29 +0,0 @@
1
- import { ArrayElement, cloneDeep } from '@speclynx/apidom-datamodel';
2
- import { Path } from '@speclynx/apidom-traverse';
3
-
4
- import OperationProducesElement from '../../../../elements/nces/OperationProduces.ts';
5
- import FallbackVisitor, { FallbackVisitorOptions } from '../../FallbackVisitor.ts';
6
-
7
- export type { FallbackVisitorOptions as ProducesVisitorOptions };
8
-
9
- /**
10
- * @public
11
- */
12
- class ProducesVisitor extends FallbackVisitor {
13
- declare public element: OperationProducesElement;
14
-
15
- constructor(options: FallbackVisitorOptions) {
16
- super(options);
17
- this.element = new OperationProducesElement();
18
- }
19
-
20
- ArrayElement(path: Path<ArrayElement>) {
21
- const arrayElement = path.node;
22
-
23
- this.element = this.element.concat(cloneDeep(arrayElement));
24
-
25
- path.stop();
26
- }
27
- }
28
-
29
- export default ProducesVisitor;
@@ -1,29 +0,0 @@
1
- import { ArrayElement, cloneDeep } from '@speclynx/apidom-datamodel';
2
- import { Path } from '@speclynx/apidom-traverse';
3
-
4
- import OperationSchemesElement from '../../../../elements/nces/OperationSchemes.ts';
5
- import FallbackVisitor, { FallbackVisitorOptions } from '../../FallbackVisitor.ts';
6
-
7
- export type { FallbackVisitorOptions as SchemesVisitorOptions };
8
-
9
- /**
10
- * @public
11
- */
12
- class SchemesVisitor extends FallbackVisitor {
13
- declare public element: OperationSchemesElement;
14
-
15
- constructor(options: FallbackVisitorOptions) {
16
- super(options);
17
- this.element = new OperationSchemesElement();
18
- }
19
-
20
- ArrayElement(path: Path<ArrayElement>) {
21
- const arrayElement = path.node;
22
-
23
- this.element = this.element.concat(cloneDeep(arrayElement));
24
-
25
- path.stop();
26
- }
27
- }
28
-
29
- export default SchemesVisitor;
@@ -1,34 +0,0 @@
1
- import { ArrayElement, Element } from '@speclynx/apidom-datamodel';
2
- import { Path } from '@speclynx/apidom-traverse';
3
-
4
- import OperationSecurityElement from '../../../../elements/nces/OperationSecurity.ts';
5
- import { BaseSpecificationVisitor, BaseSpecificationVisitorOptions } from '../bases.ts';
6
-
7
- export type { BaseSpecificationVisitorOptions as SecurityVisitorOptions };
8
-
9
- /**
10
- * @public
11
- */
12
- class SecurityVisitor extends BaseSpecificationVisitor {
13
- declare public readonly element: OperationSecurityElement;
14
-
15
- constructor(options: BaseSpecificationVisitorOptions) {
16
- super(options);
17
- this.element = new OperationSecurityElement();
18
- }
19
-
20
- ArrayElement(path: Path<ArrayElement>) {
21
- const arrayElement = path.node;
22
-
23
- arrayElement.forEach((item: Element): void => {
24
- const specPath = ['document', 'objects', 'SecurityRequirement'];
25
- const element = this.toRefractedElement(specPath, item);
26
- this.element.push(element);
27
- });
28
- this.copyMetaAndAttributes(arrayElement, this.element);
29
-
30
- path.stop();
31
- }
32
- }
33
-
34
- export default SecurityVisitor;
@@ -1,29 +0,0 @@
1
- import { ArrayElement, cloneDeep } from '@speclynx/apidom-datamodel';
2
- import { Path } from '@speclynx/apidom-traverse';
3
-
4
- import OperationTagsElement from '../../../../elements/nces/OperationTags.ts';
5
- import FallbackVisitor, { FallbackVisitorOptions } from '../../FallbackVisitor.ts';
6
-
7
- export type { FallbackVisitorOptions as TagsVisitorOptions };
8
-
9
- /**
10
- * @public
11
- */
12
- class TagsVisitor extends FallbackVisitor {
13
- declare public element: OperationTagsElement;
14
-
15
- constructor(options: FallbackVisitorOptions) {
16
- super(options);
17
- this.element = new OperationTagsElement();
18
- }
19
-
20
- ArrayElement(path: Path<ArrayElement>) {
21
- const arrayElement = path.node;
22
-
23
- this.element = this.element.concat(cloneDeep(arrayElement));
24
-
25
- path.stop();
26
- }
27
- }
28
-
29
- export default TagsVisitor;
@@ -1,24 +0,0 @@
1
- import { always } from 'ramda';
2
-
3
- import OperationElement from '../../../../elements/Operation.ts';
4
- import { SpecPath } from '../../generics/FixedFieldsVisitor.ts';
5
- import { BaseFixedFieldsVisitor, BaseFixedFieldsVisitorOptions } from '../bases.ts';
6
-
7
- export type { BaseFixedFieldsVisitorOptions as OperationVisitorOptions };
8
-
9
- /**
10
- * @public
11
- */
12
- class OperationVisitor extends BaseFixedFieldsVisitor {
13
- declare public readonly element: OperationElement;
14
-
15
- declare protected readonly specPath: SpecPath<['document', 'objects', 'Operation']>;
16
-
17
- constructor(options: BaseFixedFieldsVisitorOptions) {
18
- super(options);
19
- this.element = new OperationElement();
20
- this.specPath = always(['document', 'objects', 'Operation']);
21
- }
22
- }
23
-
24
- export default OperationVisitor;
@@ -1,27 +0,0 @@
1
- import { always } from 'ramda';
2
-
3
- import ParameterElement from '../../../../elements/Parameter.ts';
4
- import { SpecPath } from '../../generics/FixedFieldsVisitor.ts';
5
- import { BaseFixedFieldsVisitor, BaseFixedFieldsVisitorOptions } from '../bases.ts';
6
-
7
- export type { BaseFixedFieldsVisitorOptions as ParameterVisitorOptions };
8
-
9
- /**
10
- * @public
11
- */
12
- class ParameterVisitor extends BaseFixedFieldsVisitor {
13
- declare public readonly element: ParameterElement;
14
-
15
- declare protected readonly specPath: SpecPath<['document', 'objects', 'Parameter']>;
16
-
17
- declare protected readonly canSupportSpecificationExtensions: true;
18
-
19
- constructor(options: BaseFixedFieldsVisitorOptions) {
20
- super(options);
21
- this.element = new ParameterElement();
22
- this.specPath = always(['document', 'objects', 'Parameter']);
23
- this.canSupportSpecificationExtensions = true;
24
- }
25
- }
26
-
27
- export default ParameterVisitor;
@@ -1,24 +0,0 @@
1
- import { always } from 'ramda';
2
-
3
- import ParametersDefinitionsElement from '../../../../elements/ParametersDefinitions.ts';
4
- import { SpecPath } from '../../generics/MapVisitor.ts';
5
- import { BaseMapVisitor, BaseMapVisitorOptions } from '../bases.ts';
6
-
7
- export type { BaseMapVisitorOptions as ParametersDefinitionsVisitorOptions };
8
-
9
- /**
10
- * @public
11
- */
12
- class ParametersDefinitionsVisitor extends BaseMapVisitor {
13
- declare public readonly element: ParametersDefinitionsElement;
14
-
15
- declare protected readonly specPath: SpecPath<['document', 'objects', 'Parameter']>;
16
-
17
- constructor(options: BaseMapVisitorOptions) {
18
- super(options);
19
- this.element = new ParametersDefinitionsElement();
20
- this.specPath = always(['document', 'objects', 'Parameter']);
21
- }
22
- }
23
-
24
- export default ParametersDefinitionsVisitor;
@@ -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 $RefVisitorOptions };
7
-
8
- /**
9
- * @public
10
- */
11
- class $RefVisitor 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 $RefVisitor;
@@ -1,44 +0,0 @@
1
- import { ArrayElement, Element } from '@speclynx/apidom-datamodel';
2
- import { Path } from '@speclynx/apidom-traverse';
3
-
4
- import { isReferenceLikeElement } from '../../../predicates.ts';
5
- import { isReferenceElement } from '../../../../predicates.ts';
6
- import PathItemParametersElement from '../../../../elements/nces/PathItemParameters.ts';
7
- import { BaseSpecificationVisitor, BaseSpecificationVisitorOptions } from '../bases.ts';
8
-
9
- export type { BaseSpecificationVisitorOptions as ParametersVisitorOptions };
10
-
11
- /**
12
- * @public
13
- */
14
- class ParametersVisitor extends BaseSpecificationVisitor {
15
- declare public readonly element: PathItemParametersElement;
16
-
17
- constructor(options: BaseSpecificationVisitorOptions) {
18
- super(options);
19
- this.element = new PathItemParametersElement();
20
- }
21
-
22
- ArrayElement(path: Path<ArrayElement>) {
23
- const arrayElement = path.node;
24
-
25
- arrayElement.forEach((item: Element): void => {
26
- const specPath = isReferenceLikeElement(item)
27
- ? ['document', 'objects', 'Reference']
28
- : ['document', 'objects', 'Parameter'];
29
- const element = this.toRefractedElement(specPath, item);
30
-
31
- if (isReferenceElement(element)) {
32
- element.meta.set('referenced-element', 'parameter');
33
- }
34
-
35
- this.element.push(element);
36
- });
37
-
38
- this.copyMetaAndAttributes(arrayElement, this.element);
39
-
40
- path.stop();
41
- }
42
- }
43
-
44
- export default ParametersVisitor;