@speclynx/apidom-ns-json-schema-draft-4 4.0.1 → 4.0.3
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.
- package/CHANGELOG.md +10 -0
- package/package.json +6 -7
- package/src/elements/JSONReference.cjs +29 -0
- package/src/elements/JSONReference.mjs +25 -0
- package/src/elements/JSONReference.ts +33 -0
- package/src/elements/JSONSchema.cjs +296 -0
- package/src/elements/JSONSchema.mjs +292 -0
- package/src/elements/JSONSchema.ts +391 -0
- package/src/elements/LinkDescription.cjs +65 -0
- package/src/elements/LinkDescription.mjs +61 -0
- package/src/elements/LinkDescription.ts +85 -0
- package/src/elements/Media.cjs +29 -0
- package/src/elements/Media.mjs +25 -0
- package/src/elements/Media.ts +35 -0
- package/src/index.cjs +69 -0
- package/src/index.mjs +23 -0
- package/src/index.ts +142 -0
- package/src/media-types.cjs +34 -0
- package/src/media-types.mjs +30 -0
- package/src/media-types.ts +40 -0
- package/src/namespace.cjs +25 -0
- package/src/namespace.mjs +20 -0
- package/src/namespace.ts +24 -0
- package/src/predicates.cjs +32 -0
- package/src/predicates.mjs +23 -0
- package/src/predicates.ts +28 -0
- package/src/refractor/index.cjs +96 -0
- package/src/refractor/index.mjs +85 -0
- package/src/refractor/index.ts +110 -0
- package/src/refractor/inspect.cjs +55 -0
- package/src/refractor/inspect.mjs +47 -0
- package/src/refractor/inspect.ts +61 -0
- package/src/refractor/plugins/replace-empty-element.cjs +208 -0
- package/src/refractor/plugins/replace-empty-element.mjs +202 -0
- package/src/refractor/plugins/replace-empty-element.ts +233 -0
- package/src/refractor/predicates.cjs +16 -0
- package/src/refractor/predicates.mjs +12 -0
- package/src/refractor/predicates.ts +17 -0
- package/src/refractor/specification.cjs +193 -0
- package/src/refractor/specification.mjs +188 -0
- package/src/refractor/specification.ts +134 -0
- package/src/refractor/toolbox.cjs +28 -0
- package/src/refractor/toolbox.mjs +21 -0
- package/src/refractor/toolbox.ts +24 -0
- package/src/refractor/visitors/FallbackVisitor.cjs +25 -0
- package/src/refractor/visitors/FallbackVisitor.mjs +19 -0
- package/src/refractor/visitors/FallbackVisitor.ts +25 -0
- package/src/refractor/visitors/SpecificationVisitor.cjs +75 -0
- package/src/refractor/visitors/SpecificationVisitor.mjs +69 -0
- package/src/refractor/visitors/SpecificationVisitor.ts +82 -0
- package/src/refractor/visitors/Visitor.cjs +36 -0
- package/src/refractor/visitors/Visitor.mjs +33 -0
- package/src/refractor/visitors/Visitor.ts +49 -0
- package/src/refractor/visitors/generics/AlternatingVisitor.cjs +42 -0
- package/src/refractor/visitors/generics/AlternatingVisitor.mjs +35 -0
- package/src/refractor/visitors/generics/AlternatingVisitor.ts +45 -0
- package/src/refractor/visitors/generics/FixedFieldsVisitor.cjs +57 -0
- package/src/refractor/visitors/generics/FixedFieldsVisitor.mjs +50 -0
- package/src/refractor/visitors/generics/FixedFieldsVisitor.ts +79 -0
- package/src/refractor/visitors/generics/MapVisitor.cjs +21 -0
- package/src/refractor/visitors/generics/MapVisitor.mjs +15 -0
- package/src/refractor/visitors/generics/MapVisitor.ts +25 -0
- package/src/refractor/visitors/generics/PatternedFieldsVisitor.cjs +58 -0
- package/src/refractor/visitors/generics/PatternedFieldsVisitor.mjs +52 -0
- package/src/refractor/visitors/generics/PatternedFieldsVisitor.ts +76 -0
- package/src/refractor/visitors/json-schema/AllOfVisitor.cjs +32 -0
- package/src/refractor/visitors/json-schema/AllOfVisitor.mjs +27 -0
- package/src/refractor/visitors/json-schema/AllOfVisitor.ts +44 -0
- package/src/refractor/visitors/json-schema/AnyOfVisitor.cjs +32 -0
- package/src/refractor/visitors/json-schema/AnyOfVisitor.mjs +27 -0
- package/src/refractor/visitors/json-schema/AnyOfVisitor.ts +44 -0
- package/src/refractor/visitors/json-schema/DefinitionsVisitor.cjs +23 -0
- package/src/refractor/visitors/json-schema/DefinitionsVisitor.mjs +18 -0
- package/src/refractor/visitors/json-schema/DefinitionsVisitor.ts +36 -0
- package/src/refractor/visitors/json-schema/DependenciesVisitor.cjs +23 -0
- package/src/refractor/visitors/json-schema/DependenciesVisitor.mjs +18 -0
- package/src/refractor/visitors/json-schema/DependenciesVisitor.ts +36 -0
- package/src/refractor/visitors/json-schema/EnumVisitor.cjs +16 -0
- package/src/refractor/visitors/json-schema/EnumVisitor.mjs +11 -0
- package/src/refractor/visitors/json-schema/EnumVisitor.ts +20 -0
- package/src/refractor/visitors/json-schema/ItemsVisitor.cjs +35 -0
- package/src/refractor/visitors/json-schema/ItemsVisitor.mjs +30 -0
- package/src/refractor/visitors/json-schema/ItemsVisitor.ts +52 -0
- package/src/refractor/visitors/json-schema/JSONSchemaOrJSONReferenceVisitor.cjs +24 -0
- package/src/refractor/visitors/json-schema/JSONSchemaOrJSONReferenceVisitor.mjs +19 -0
- package/src/refractor/visitors/json-schema/JSONSchemaOrJSONReferenceVisitor.ts +21 -0
- package/src/refractor/visitors/json-schema/LinksVisitor.cjs +30 -0
- package/src/refractor/visitors/json-schema/LinksVisitor.mjs +25 -0
- package/src/refractor/visitors/json-schema/LinksVisitor.ts +43 -0
- package/src/refractor/visitors/json-schema/OneOfVisitor.cjs +32 -0
- package/src/refractor/visitors/json-schema/OneOfVisitor.mjs +27 -0
- package/src/refractor/visitors/json-schema/OneOfVisitor.ts +44 -0
- package/src/refractor/visitors/json-schema/ParentSchemaAwareVisitor.cjs +20 -0
- package/src/refractor/visitors/json-schema/ParentSchemaAwareVisitor.mjs +16 -0
- package/src/refractor/visitors/json-schema/ParentSchemaAwareVisitor.ts +21 -0
- package/src/refractor/visitors/json-schema/PatternPropertiesVisitor.cjs +23 -0
- package/src/refractor/visitors/json-schema/PatternPropertiesVisitor.mjs +18 -0
- package/src/refractor/visitors/json-schema/PatternPropertiesVisitor.ts +36 -0
- package/src/refractor/visitors/json-schema/PropertiesVisitor.cjs +23 -0
- package/src/refractor/visitors/json-schema/PropertiesVisitor.mjs +18 -0
- package/src/refractor/visitors/json-schema/PropertiesVisitor.ts +36 -0
- package/src/refractor/visitors/json-schema/RequiredVisitor.cjs +16 -0
- package/src/refractor/visitors/json-schema/RequiredVisitor.mjs +11 -0
- package/src/refractor/visitors/json-schema/RequiredVisitor.ts +20 -0
- package/src/refractor/visitors/json-schema/TypeVisitor.cjs +20 -0
- package/src/refractor/visitors/json-schema/TypeVisitor.mjs +15 -0
- package/src/refractor/visitors/json-schema/TypeVisitor.ts +25 -0
- package/src/refractor/visitors/json-schema/bases.cjs +45 -0
- package/src/refractor/visitors/json-schema/bases.mjs +39 -0
- package/src/refractor/visitors/json-schema/bases.ts +70 -0
- package/src/refractor/visitors/json-schema/index.cjs +65 -0
- package/src/refractor/visitors/json-schema/index.mjs +59 -0
- package/src/refractor/visitors/json-schema/index.ts +85 -0
- package/src/refractor/visitors/json-schema/json-reference/$RefVisitor.cjs +16 -0
- package/src/refractor/visitors/json-schema/json-reference/$RefVisitor.mjs +11 -0
- package/src/refractor/visitors/json-schema/json-reference/$RefVisitor.ts +20 -0
- package/src/refractor/visitors/json-schema/json-reference/index.cjs +33 -0
- package/src/refractor/visitors/json-schema/json-reference/index.mjs +27 -0
- package/src/refractor/visitors/json-schema/json-reference/index.ts +41 -0
- package/src/refractor/visitors/json-schema/link-description/index.cjs +23 -0
- package/src/refractor/visitors/json-schema/link-description/index.mjs +17 -0
- package/src/refractor/visitors/json-schema/link-description/index.ts +30 -0
- package/src/refractor/visitors/json-schema/media/index.cjs +23 -0
- package/src/refractor/visitors/json-schema/media/index.mjs +17 -0
- package/src/refractor/visitors/json-schema/media/index.ts +29 -0
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault").default;
|
|
4
|
+
exports.__esModule = true;
|
|
5
|
+
exports.default = void 0;
|
|
6
|
+
var _FallbackVisitor = _interopRequireDefault(require("../FallbackVisitor.cjs"));
|
|
7
|
+
/**
|
|
8
|
+
* @public
|
|
9
|
+
*/
|
|
10
|
+
class TypeVisitor extends _FallbackVisitor.default {
|
|
11
|
+
StringElement(path) {
|
|
12
|
+
super.enter(path);
|
|
13
|
+
this.element.classes.push('json-schema-type');
|
|
14
|
+
}
|
|
15
|
+
ArrayElement(path) {
|
|
16
|
+
super.enter(path);
|
|
17
|
+
this.element.classes.push('json-schema-type');
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
var _default = exports.default = TypeVisitor;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import FallbackVisitor from "../FallbackVisitor.mjs";
|
|
2
|
+
/**
|
|
3
|
+
* @public
|
|
4
|
+
*/
|
|
5
|
+
class TypeVisitor extends FallbackVisitor {
|
|
6
|
+
StringElement(path) {
|
|
7
|
+
super.enter(path);
|
|
8
|
+
this.element.classes.push('json-schema-type');
|
|
9
|
+
}
|
|
10
|
+
ArrayElement(path) {
|
|
11
|
+
super.enter(path);
|
|
12
|
+
this.element.classes.push('json-schema-type');
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
export default TypeVisitor;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { StringElement, ArrayElement } 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 TypeVisitorOptions };
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* @public
|
|
10
|
+
*/
|
|
11
|
+
class TypeVisitor extends FallbackVisitor {
|
|
12
|
+
declare public readonly element: StringElement | ArrayElement;
|
|
13
|
+
|
|
14
|
+
StringElement(path: Path<StringElement>) {
|
|
15
|
+
super.enter(path);
|
|
16
|
+
this.element.classes.push('json-schema-type');
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
ArrayElement(path: Path<ArrayElement>) {
|
|
20
|
+
super.enter(path);
|
|
21
|
+
this.element.classes.push('json-schema-type');
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export default TypeVisitor;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault").default;
|
|
4
|
+
exports.__esModule = true;
|
|
5
|
+
exports.PropertiesVisitorBase = exports.PatternPropertiesVisitorBase = exports.OneOfVisitorBase = exports.MediaVisitorBase = exports.LinksVisitorBase = exports.LinkDescriptionVisitorBase = exports.JSONSchemaVisitorBase = exports.JSONReferenceVisitorBase = exports.ItemsVisitorBase = exports.DependenciesVisitorBase = exports.DefinitionsVisitorBase = exports.AnyOfVisitorBase = exports.AllOfVisitorBase = void 0;
|
|
6
|
+
var _tsMixer = require("ts-mixer");
|
|
7
|
+
var _FallbackVisitor = _interopRequireDefault(require("../FallbackVisitor.cjs"));
|
|
8
|
+
var _SpecificationVisitor = _interopRequireDefault(require("../SpecificationVisitor.cjs"));
|
|
9
|
+
var _FixedFieldsVisitor = _interopRequireDefault(require("../generics/FixedFieldsVisitor.cjs"));
|
|
10
|
+
var _MapVisitor = _interopRequireDefault(require("../generics/MapVisitor.cjs"));
|
|
11
|
+
var _ParentSchemaAwareVisitor = _interopRequireDefault(require("./ParentSchemaAwareVisitor.cjs"));
|
|
12
|
+
/**
|
|
13
|
+
* These base classes are exported to satisfy api-extractor's ae-forgotten-export warnings.
|
|
14
|
+
* When ts-mixer creates mixin classes, TypeScript generates internal *_base types that
|
|
15
|
+
* need to be exported from the entry point.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
/** @public */
|
|
19
|
+
const JSONSchemaVisitorBase = exports.JSONSchemaVisitorBase = (0, _tsMixer.Mixin)(_FixedFieldsVisitor.default, _ParentSchemaAwareVisitor.default, _FallbackVisitor.default);
|
|
20
|
+
/** @public */
|
|
21
|
+
const JSONReferenceVisitorBase = exports.JSONReferenceVisitorBase = (0, _tsMixer.Mixin)(_FixedFieldsVisitor.default, _FallbackVisitor.default);
|
|
22
|
+
/** @public */
|
|
23
|
+
const LinkDescriptionVisitorBase = exports.LinkDescriptionVisitorBase = (0, _tsMixer.Mixin)(_FixedFieldsVisitor.default, _FallbackVisitor.default);
|
|
24
|
+
/** @public */
|
|
25
|
+
const MediaVisitorBase = exports.MediaVisitorBase = (0, _tsMixer.Mixin)(_FixedFieldsVisitor.default, _FallbackVisitor.default);
|
|
26
|
+
|
|
27
|
+
/** @public */
|
|
28
|
+
const AllOfVisitorBase = exports.AllOfVisitorBase = (0, _tsMixer.Mixin)(_SpecificationVisitor.default, _ParentSchemaAwareVisitor.default, _FallbackVisitor.default);
|
|
29
|
+
/** @public */
|
|
30
|
+
const AnyOfVisitorBase = exports.AnyOfVisitorBase = (0, _tsMixer.Mixin)(_SpecificationVisitor.default, _ParentSchemaAwareVisitor.default, _FallbackVisitor.default);
|
|
31
|
+
/** @public */
|
|
32
|
+
const OneOfVisitorBase = exports.OneOfVisitorBase = (0, _tsMixer.Mixin)(_SpecificationVisitor.default, _ParentSchemaAwareVisitor.default, _FallbackVisitor.default);
|
|
33
|
+
/** @public */
|
|
34
|
+
const ItemsVisitorBase = exports.ItemsVisitorBase = (0, _tsMixer.Mixin)(_SpecificationVisitor.default, _ParentSchemaAwareVisitor.default, _FallbackVisitor.default);
|
|
35
|
+
/** @public */
|
|
36
|
+
const LinksVisitorBase = exports.LinksVisitorBase = (0, _tsMixer.Mixin)(_SpecificationVisitor.default, _ParentSchemaAwareVisitor.default, _FallbackVisitor.default);
|
|
37
|
+
|
|
38
|
+
/** @public */
|
|
39
|
+
const DefinitionsVisitorBase = exports.DefinitionsVisitorBase = (0, _tsMixer.Mixin)(_MapVisitor.default, _ParentSchemaAwareVisitor.default, _FallbackVisitor.default);
|
|
40
|
+
/** @public */
|
|
41
|
+
const DependenciesVisitorBase = exports.DependenciesVisitorBase = (0, _tsMixer.Mixin)(_MapVisitor.default, _ParentSchemaAwareVisitor.default, _FallbackVisitor.default);
|
|
42
|
+
/** @public */
|
|
43
|
+
const PatternPropertiesVisitorBase = exports.PatternPropertiesVisitorBase = (0, _tsMixer.Mixin)(_MapVisitor.default, _ParentSchemaAwareVisitor.default, _FallbackVisitor.default);
|
|
44
|
+
/** @public */
|
|
45
|
+
const PropertiesVisitorBase = exports.PropertiesVisitorBase = (0, _tsMixer.Mixin)(_MapVisitor.default, _ParentSchemaAwareVisitor.default, _FallbackVisitor.default);
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { Mixin } from 'ts-mixer';
|
|
2
|
+
import FallbackVisitor from "../FallbackVisitor.mjs";
|
|
3
|
+
import SpecificationVisitor from "../SpecificationVisitor.mjs";
|
|
4
|
+
import FixedFieldsVisitor from "../generics/FixedFieldsVisitor.mjs";
|
|
5
|
+
import MapVisitor from "../generics/MapVisitor.mjs";
|
|
6
|
+
import ParentSchemaAwareVisitor from "./ParentSchemaAwareVisitor.mjs";
|
|
7
|
+
/**
|
|
8
|
+
* These base classes are exported to satisfy api-extractor's ae-forgotten-export warnings.
|
|
9
|
+
* When ts-mixer creates mixin classes, TypeScript generates internal *_base types that
|
|
10
|
+
* need to be exported from the entry point.
|
|
11
|
+
*/
|
|
12
|
+
/** @public */
|
|
13
|
+
export const JSONSchemaVisitorBase = Mixin(FixedFieldsVisitor, ParentSchemaAwareVisitor, FallbackVisitor);
|
|
14
|
+
/** @public */
|
|
15
|
+
export const JSONReferenceVisitorBase = Mixin(FixedFieldsVisitor, FallbackVisitor);
|
|
16
|
+
/** @public */
|
|
17
|
+
export const LinkDescriptionVisitorBase = Mixin(FixedFieldsVisitor, FallbackVisitor);
|
|
18
|
+
/** @public */
|
|
19
|
+
export const MediaVisitorBase = Mixin(FixedFieldsVisitor, FallbackVisitor);
|
|
20
|
+
|
|
21
|
+
/** @public */
|
|
22
|
+
export const AllOfVisitorBase = Mixin(SpecificationVisitor, ParentSchemaAwareVisitor, FallbackVisitor);
|
|
23
|
+
/** @public */
|
|
24
|
+
export const AnyOfVisitorBase = Mixin(SpecificationVisitor, ParentSchemaAwareVisitor, FallbackVisitor);
|
|
25
|
+
/** @public */
|
|
26
|
+
export const OneOfVisitorBase = Mixin(SpecificationVisitor, ParentSchemaAwareVisitor, FallbackVisitor);
|
|
27
|
+
/** @public */
|
|
28
|
+
export const ItemsVisitorBase = Mixin(SpecificationVisitor, ParentSchemaAwareVisitor, FallbackVisitor);
|
|
29
|
+
/** @public */
|
|
30
|
+
export const LinksVisitorBase = Mixin(SpecificationVisitor, ParentSchemaAwareVisitor, FallbackVisitor);
|
|
31
|
+
|
|
32
|
+
/** @public */
|
|
33
|
+
export const DefinitionsVisitorBase = Mixin(MapVisitor, ParentSchemaAwareVisitor, FallbackVisitor);
|
|
34
|
+
/** @public */
|
|
35
|
+
export const DependenciesVisitorBase = Mixin(MapVisitor, ParentSchemaAwareVisitor, FallbackVisitor);
|
|
36
|
+
/** @public */
|
|
37
|
+
export const PatternPropertiesVisitorBase = Mixin(MapVisitor, ParentSchemaAwareVisitor, FallbackVisitor);
|
|
38
|
+
/** @public */
|
|
39
|
+
export const PropertiesVisitorBase = Mixin(MapVisitor, ParentSchemaAwareVisitor, FallbackVisitor);
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { Mixin } from 'ts-mixer';
|
|
2
|
+
|
|
3
|
+
import FallbackVisitor from '../FallbackVisitor.ts';
|
|
4
|
+
import SpecificationVisitor from '../SpecificationVisitor.ts';
|
|
5
|
+
import FixedFieldsVisitor from '../generics/FixedFieldsVisitor.ts';
|
|
6
|
+
import MapVisitor from '../generics/MapVisitor.ts';
|
|
7
|
+
import ParentSchemaAwareVisitor from './ParentSchemaAwareVisitor.ts';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* These base classes are exported to satisfy api-extractor's ae-forgotten-export warnings.
|
|
11
|
+
* When ts-mixer creates mixin classes, TypeScript generates internal *_base types that
|
|
12
|
+
* need to be exported from the entry point.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
/** @public */
|
|
16
|
+
export const JSONSchemaVisitorBase = Mixin(
|
|
17
|
+
FixedFieldsVisitor,
|
|
18
|
+
ParentSchemaAwareVisitor,
|
|
19
|
+
FallbackVisitor,
|
|
20
|
+
);
|
|
21
|
+
/** @public */
|
|
22
|
+
export const JSONReferenceVisitorBase = Mixin(FixedFieldsVisitor, FallbackVisitor);
|
|
23
|
+
/** @public */
|
|
24
|
+
export const LinkDescriptionVisitorBase = Mixin(FixedFieldsVisitor, FallbackVisitor);
|
|
25
|
+
/** @public */
|
|
26
|
+
export const MediaVisitorBase = Mixin(FixedFieldsVisitor, FallbackVisitor);
|
|
27
|
+
|
|
28
|
+
/** @public */
|
|
29
|
+
export const AllOfVisitorBase = Mixin(
|
|
30
|
+
SpecificationVisitor,
|
|
31
|
+
ParentSchemaAwareVisitor,
|
|
32
|
+
FallbackVisitor,
|
|
33
|
+
);
|
|
34
|
+
/** @public */
|
|
35
|
+
export const AnyOfVisitorBase = Mixin(
|
|
36
|
+
SpecificationVisitor,
|
|
37
|
+
ParentSchemaAwareVisitor,
|
|
38
|
+
FallbackVisitor,
|
|
39
|
+
);
|
|
40
|
+
/** @public */
|
|
41
|
+
export const OneOfVisitorBase = Mixin(
|
|
42
|
+
SpecificationVisitor,
|
|
43
|
+
ParentSchemaAwareVisitor,
|
|
44
|
+
FallbackVisitor,
|
|
45
|
+
);
|
|
46
|
+
/** @public */
|
|
47
|
+
export const ItemsVisitorBase = Mixin(
|
|
48
|
+
SpecificationVisitor,
|
|
49
|
+
ParentSchemaAwareVisitor,
|
|
50
|
+
FallbackVisitor,
|
|
51
|
+
);
|
|
52
|
+
/** @public */
|
|
53
|
+
export const LinksVisitorBase = Mixin(
|
|
54
|
+
SpecificationVisitor,
|
|
55
|
+
ParentSchemaAwareVisitor,
|
|
56
|
+
FallbackVisitor,
|
|
57
|
+
);
|
|
58
|
+
|
|
59
|
+
/** @public */
|
|
60
|
+
export const DefinitionsVisitorBase = Mixin(MapVisitor, ParentSchemaAwareVisitor, FallbackVisitor);
|
|
61
|
+
/** @public */
|
|
62
|
+
export const DependenciesVisitorBase = Mixin(MapVisitor, ParentSchemaAwareVisitor, FallbackVisitor);
|
|
63
|
+
/** @public */
|
|
64
|
+
export const PatternPropertiesVisitorBase = Mixin(
|
|
65
|
+
MapVisitor,
|
|
66
|
+
ParentSchemaAwareVisitor,
|
|
67
|
+
FallbackVisitor,
|
|
68
|
+
);
|
|
69
|
+
/** @public */
|
|
70
|
+
export const PropertiesVisitorBase = Mixin(MapVisitor, ParentSchemaAwareVisitor, FallbackVisitor);
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault").default;
|
|
4
|
+
exports.__esModule = true;
|
|
5
|
+
exports.default = void 0;
|
|
6
|
+
var _ramda = require("ramda");
|
|
7
|
+
var _ramdaAdjunct = require("ramda-adjunct");
|
|
8
|
+
var _apidomDatamodel = require("@speclynx/apidom-datamodel");
|
|
9
|
+
var _apidomCore = require("@speclynx/apidom-core");
|
|
10
|
+
var _FixedFieldsVisitor = _interopRequireDefault(require("../generics/FixedFieldsVisitor.cjs"));
|
|
11
|
+
var _bases = require("./bases.cjs");
|
|
12
|
+
var _JSONSchema = _interopRequireDefault(require("../../../elements/JSONSchema.cjs"));
|
|
13
|
+
var _predicates = require("../../../predicates.cjs");
|
|
14
|
+
/**
|
|
15
|
+
* @public
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* @public
|
|
20
|
+
*/
|
|
21
|
+
class JSONSchemaVisitor extends _bases.JSONSchemaVisitorBase {
|
|
22
|
+
constructor(options) {
|
|
23
|
+
super(options);
|
|
24
|
+
this.element = new _JSONSchema.default();
|
|
25
|
+
this.consumeSafe = true;
|
|
26
|
+
this.specPath = (0, _ramda.always)(['document', 'objects', 'JSONSchema']);
|
|
27
|
+
}
|
|
28
|
+
get defaultDialectIdentifier() {
|
|
29
|
+
return 'http://json-schema.org/draft-04/schema#';
|
|
30
|
+
}
|
|
31
|
+
ObjectElement(path) {
|
|
32
|
+
const objectElement = path.node;
|
|
33
|
+
this.handleDialectIdentifier(objectElement);
|
|
34
|
+
this.handleSchemaIdentifier(objectElement);
|
|
35
|
+
|
|
36
|
+
// for further processing consider this JSONSchema Element as parent for all sub-schemas
|
|
37
|
+
this.parent = this.element;
|
|
38
|
+
return _FixedFieldsVisitor.default.prototype.ObjectElement.call(this, path);
|
|
39
|
+
}
|
|
40
|
+
handleDialectIdentifier(objectElement) {
|
|
41
|
+
// handle $schema keyword in embedded resources
|
|
42
|
+
if ((0, _ramdaAdjunct.isUndefined)(this.parent) && !(0, _apidomDatamodel.isStringElement)(objectElement.get('$schema'))) {
|
|
43
|
+
// no parent available and no $schema is defined, set default $schema
|
|
44
|
+
this.element.meta.set('inheritedDialectIdentifier', this.defaultDialectIdentifier);
|
|
45
|
+
} else if ((0, _predicates.isJSONSchemaElement)(this.parent) && !(0, _apidomDatamodel.isStringElement)(objectElement.get('$schema'))) {
|
|
46
|
+
// parent is available and no $schema is defined, set parent $schema
|
|
47
|
+
const inheritedDialectIdentifier = (0, _ramda.defaultTo)(this.parent.meta.get('inheritedDialectIdentifier'), (0, _apidomCore.toValue)(this.parent.$schema));
|
|
48
|
+
this.element.meta.set('inheritedDialectIdentifier', inheritedDialectIdentifier);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
handleSchemaIdentifier(objectElement, identifierKeyword = 'id') {
|
|
52
|
+
// handle schema identifier in embedded resources
|
|
53
|
+
// fetch parent's ancestorsSchemaIdentifiers (stored as plain string[])
|
|
54
|
+
const ancestorsSchemaIdentifiers = this.parent !== undefined ? [...(this.parent.meta.get('ancestorsSchemaIdentifiers') ?? [])] : [];
|
|
55
|
+
// get current schema identifier
|
|
56
|
+
const schemaIdentifier = (0, _apidomCore.toValue)(objectElement.get(identifierKeyword));
|
|
57
|
+
|
|
58
|
+
// remember schema identifier if it's a non-empty string
|
|
59
|
+
if ((0, _ramdaAdjunct.isNonEmptyString)(schemaIdentifier)) {
|
|
60
|
+
ancestorsSchemaIdentifiers.push(schemaIdentifier);
|
|
61
|
+
}
|
|
62
|
+
this.element.meta.set('ancestorsSchemaIdentifiers', ancestorsSchemaIdentifiers);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
var _default = exports.default = JSONSchemaVisitor;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { always, defaultTo } from 'ramda';
|
|
2
|
+
import { isNonEmptyString, isUndefined } from 'ramda-adjunct';
|
|
3
|
+
import { isStringElement } from '@speclynx/apidom-datamodel';
|
|
4
|
+
import { toValue } from '@speclynx/apidom-core';
|
|
5
|
+
import FixedFieldsVisitor from "../generics/FixedFieldsVisitor.mjs";
|
|
6
|
+
import { JSONSchemaVisitorBase } from "./bases.mjs";
|
|
7
|
+
import JSONSchemaElement from "../../../elements/JSONSchema.mjs";
|
|
8
|
+
import { isJSONSchemaElement } from "../../../predicates.mjs";
|
|
9
|
+
/**
|
|
10
|
+
* @public
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* @public
|
|
14
|
+
*/
|
|
15
|
+
class JSONSchemaVisitor extends JSONSchemaVisitorBase {
|
|
16
|
+
constructor(options) {
|
|
17
|
+
super(options);
|
|
18
|
+
this.element = new JSONSchemaElement();
|
|
19
|
+
this.consumeSafe = true;
|
|
20
|
+
this.specPath = always(['document', 'objects', 'JSONSchema']);
|
|
21
|
+
}
|
|
22
|
+
get defaultDialectIdentifier() {
|
|
23
|
+
return 'http://json-schema.org/draft-04/schema#';
|
|
24
|
+
}
|
|
25
|
+
ObjectElement(path) {
|
|
26
|
+
const objectElement = path.node;
|
|
27
|
+
this.handleDialectIdentifier(objectElement);
|
|
28
|
+
this.handleSchemaIdentifier(objectElement);
|
|
29
|
+
|
|
30
|
+
// for further processing consider this JSONSchema Element as parent for all sub-schemas
|
|
31
|
+
this.parent = this.element;
|
|
32
|
+
return FixedFieldsVisitor.prototype.ObjectElement.call(this, path);
|
|
33
|
+
}
|
|
34
|
+
handleDialectIdentifier(objectElement) {
|
|
35
|
+
// handle $schema keyword in embedded resources
|
|
36
|
+
if (isUndefined(this.parent) && !isStringElement(objectElement.get('$schema'))) {
|
|
37
|
+
// no parent available and no $schema is defined, set default $schema
|
|
38
|
+
this.element.meta.set('inheritedDialectIdentifier', this.defaultDialectIdentifier);
|
|
39
|
+
} else if (isJSONSchemaElement(this.parent) && !isStringElement(objectElement.get('$schema'))) {
|
|
40
|
+
// parent is available and no $schema is defined, set parent $schema
|
|
41
|
+
const inheritedDialectIdentifier = defaultTo(this.parent.meta.get('inheritedDialectIdentifier'), toValue(this.parent.$schema));
|
|
42
|
+
this.element.meta.set('inheritedDialectIdentifier', inheritedDialectIdentifier);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
handleSchemaIdentifier(objectElement, identifierKeyword = 'id') {
|
|
46
|
+
// handle schema identifier in embedded resources
|
|
47
|
+
// fetch parent's ancestorsSchemaIdentifiers (stored as plain string[])
|
|
48
|
+
const ancestorsSchemaIdentifiers = this.parent !== undefined ? [...(this.parent.meta.get('ancestorsSchemaIdentifiers') ?? [])] : [];
|
|
49
|
+
// get current schema identifier
|
|
50
|
+
const schemaIdentifier = toValue(objectElement.get(identifierKeyword));
|
|
51
|
+
|
|
52
|
+
// remember schema identifier if it's a non-empty string
|
|
53
|
+
if (isNonEmptyString(schemaIdentifier)) {
|
|
54
|
+
ancestorsSchemaIdentifiers.push(schemaIdentifier);
|
|
55
|
+
}
|
|
56
|
+
this.element.meta.set('ancestorsSchemaIdentifiers', ancestorsSchemaIdentifiers);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
export default JSONSchemaVisitor;
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { always, defaultTo } from 'ramda';
|
|
2
|
+
import { isNonEmptyString, isUndefined } from 'ramda-adjunct';
|
|
3
|
+
import { ObjectElement, isStringElement } from '@speclynx/apidom-datamodel';
|
|
4
|
+
import { Path } from '@speclynx/apidom-traverse';
|
|
5
|
+
import { toValue } from '@speclynx/apidom-core';
|
|
6
|
+
|
|
7
|
+
import FixedFieldsVisitor, { SpecPath } from '../generics/FixedFieldsVisitor.ts';
|
|
8
|
+
import { FixedFieldsVisitorOptions } from '../generics/FixedFieldsVisitor.ts';
|
|
9
|
+
import { ParentSchemaAwareVisitorOptions } from './ParentSchemaAwareVisitor.ts';
|
|
10
|
+
import { FallbackVisitorOptions } from '../FallbackVisitor.ts';
|
|
11
|
+
import { JSONSchemaVisitorBase } from './bases.ts';
|
|
12
|
+
import JSONSchemaElement from '../../../elements/JSONSchema.ts';
|
|
13
|
+
import { isJSONSchemaElement } from '../../../predicates.ts';
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* @public
|
|
17
|
+
*/
|
|
18
|
+
export interface JSONSchemaVisitorOptions
|
|
19
|
+
extends FixedFieldsVisitorOptions, ParentSchemaAwareVisitorOptions, FallbackVisitorOptions {}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* @public
|
|
23
|
+
*/
|
|
24
|
+
class JSONSchemaVisitor extends JSONSchemaVisitorBase {
|
|
25
|
+
declare public element: JSONSchemaElement;
|
|
26
|
+
|
|
27
|
+
declare protected readonly specPath: SpecPath<['document', 'objects', 'JSONSchema']>;
|
|
28
|
+
|
|
29
|
+
constructor(options: JSONSchemaVisitorOptions) {
|
|
30
|
+
super(options);
|
|
31
|
+
this.element = new JSONSchemaElement();
|
|
32
|
+
this.consumeSafe = true;
|
|
33
|
+
this.specPath = always(['document', 'objects', 'JSONSchema']);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
get defaultDialectIdentifier(): string {
|
|
37
|
+
return 'http://json-schema.org/draft-04/schema#';
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
ObjectElement(path: Path<ObjectElement>) {
|
|
41
|
+
const objectElement = path.node;
|
|
42
|
+
this.handleDialectIdentifier(objectElement);
|
|
43
|
+
this.handleSchemaIdentifier(objectElement);
|
|
44
|
+
|
|
45
|
+
// for further processing consider this JSONSchema Element as parent for all sub-schemas
|
|
46
|
+
this.parent = this.element;
|
|
47
|
+
|
|
48
|
+
return FixedFieldsVisitor.prototype.ObjectElement.call(this, path);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
handleDialectIdentifier(objectElement: ObjectElement): void {
|
|
52
|
+
// handle $schema keyword in embedded resources
|
|
53
|
+
if (isUndefined(this.parent) && !isStringElement(objectElement.get('$schema'))) {
|
|
54
|
+
// no parent available and no $schema is defined, set default $schema
|
|
55
|
+
this.element.meta.set('inheritedDialectIdentifier', this.defaultDialectIdentifier);
|
|
56
|
+
} else if (isJSONSchemaElement(this.parent) && !isStringElement(objectElement.get('$schema'))) {
|
|
57
|
+
// parent is available and no $schema is defined, set parent $schema
|
|
58
|
+
const inheritedDialectIdentifier = defaultTo(
|
|
59
|
+
this.parent.meta.get('inheritedDialectIdentifier') as string,
|
|
60
|
+
toValue(this.parent.$schema),
|
|
61
|
+
);
|
|
62
|
+
this.element.meta.set('inheritedDialectIdentifier', inheritedDialectIdentifier);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
handleSchemaIdentifier(objectElement: ObjectElement, identifierKeyword: string = 'id'): void {
|
|
67
|
+
// handle schema identifier in embedded resources
|
|
68
|
+
// fetch parent's ancestorsSchemaIdentifiers (stored as plain string[])
|
|
69
|
+
const ancestorsSchemaIdentifiers: string[] =
|
|
70
|
+
this.parent !== undefined
|
|
71
|
+
? [...((this.parent.meta.get('ancestorsSchemaIdentifiers') as string[]) ?? [])]
|
|
72
|
+
: [];
|
|
73
|
+
// get current schema identifier
|
|
74
|
+
const schemaIdentifier = toValue(objectElement.get(identifierKeyword));
|
|
75
|
+
|
|
76
|
+
// remember schema identifier if it's a non-empty string
|
|
77
|
+
if (isNonEmptyString(schemaIdentifier)) {
|
|
78
|
+
ancestorsSchemaIdentifiers.push(schemaIdentifier as string);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
this.element.meta.set('ancestorsSchemaIdentifiers', ancestorsSchemaIdentifiers);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export default JSONSchemaVisitor;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault").default;
|
|
4
|
+
exports.__esModule = true;
|
|
5
|
+
exports.default = void 0;
|
|
6
|
+
var _FallbackVisitor = _interopRequireDefault(require("../../FallbackVisitor.cjs"));
|
|
7
|
+
/**
|
|
8
|
+
* @public
|
|
9
|
+
*/
|
|
10
|
+
class $RefVisitor extends _FallbackVisitor.default {
|
|
11
|
+
StringElement(path) {
|
|
12
|
+
super.enter(path);
|
|
13
|
+
this.element.classes.push('reference-value');
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
var _default = exports.default = $RefVisitor;
|
|
@@ -0,0 +1,20 @@
|
|
|
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;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault").default;
|
|
4
|
+
exports.__esModule = true;
|
|
5
|
+
exports.default = void 0;
|
|
6
|
+
var _ramda = require("ramda");
|
|
7
|
+
var _apidomDatamodel = require("@speclynx/apidom-datamodel");
|
|
8
|
+
var _JSONReference = _interopRequireDefault(require("../../../../elements/JSONReference.cjs"));
|
|
9
|
+
var _FixedFieldsVisitor = _interopRequireDefault(require("../../generics/FixedFieldsVisitor.cjs"));
|
|
10
|
+
var _bases = require("../bases.cjs");
|
|
11
|
+
/**
|
|
12
|
+
* @public
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* @public
|
|
17
|
+
*/
|
|
18
|
+
class JSONReferenceVisitor extends _bases.JSONReferenceVisitorBase {
|
|
19
|
+
constructor(options) {
|
|
20
|
+
super(options);
|
|
21
|
+
this.element = new _JSONReference.default();
|
|
22
|
+
this.specPath = (0, _ramda.always)(['document', 'objects', 'JSONReference']);
|
|
23
|
+
}
|
|
24
|
+
ObjectElement(path) {
|
|
25
|
+
_FixedFieldsVisitor.default.prototype.ObjectElement.call(this, path);
|
|
26
|
+
|
|
27
|
+
// mark this JSONReferenceElement with reference metadata
|
|
28
|
+
if ((0, _apidomDatamodel.isStringElement)(this.element.$ref)) {
|
|
29
|
+
this.element.classes.push('reference-element');
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
var _default = exports.default = JSONReferenceVisitor;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { always } from 'ramda';
|
|
2
|
+
import { isStringElement } from '@speclynx/apidom-datamodel';
|
|
3
|
+
import JSONReferenceElement from "../../../../elements/JSONReference.mjs";
|
|
4
|
+
import FixedFieldsVisitor from "../../generics/FixedFieldsVisitor.mjs";
|
|
5
|
+
import { JSONReferenceVisitorBase } from "../bases.mjs";
|
|
6
|
+
/**
|
|
7
|
+
* @public
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* @public
|
|
11
|
+
*/
|
|
12
|
+
class JSONReferenceVisitor extends JSONReferenceVisitorBase {
|
|
13
|
+
constructor(options) {
|
|
14
|
+
super(options);
|
|
15
|
+
this.element = new JSONReferenceElement();
|
|
16
|
+
this.specPath = always(['document', 'objects', 'JSONReference']);
|
|
17
|
+
}
|
|
18
|
+
ObjectElement(path) {
|
|
19
|
+
FixedFieldsVisitor.prototype.ObjectElement.call(this, path);
|
|
20
|
+
|
|
21
|
+
// mark this JSONReferenceElement with reference metadata
|
|
22
|
+
if (isStringElement(this.element.$ref)) {
|
|
23
|
+
this.element.classes.push('reference-element');
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
export default JSONReferenceVisitor;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { always } from 'ramda';
|
|
2
|
+
import { ObjectElement, isStringElement } from '@speclynx/apidom-datamodel';
|
|
3
|
+
import { Path } from '@speclynx/apidom-traverse';
|
|
4
|
+
|
|
5
|
+
import JSONReferenceElement from '../../../../elements/JSONReference.ts';
|
|
6
|
+
import FixedFieldsVisitor, { SpecPath } from '../../generics/FixedFieldsVisitor.ts';
|
|
7
|
+
import { FixedFieldsVisitorOptions } from '../../generics/FixedFieldsVisitor.ts';
|
|
8
|
+
import { FallbackVisitorOptions } from '../../FallbackVisitor.ts';
|
|
9
|
+
import { JSONReferenceVisitorBase } from '../bases.ts';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* @public
|
|
13
|
+
*/
|
|
14
|
+
export interface JSONReferenceVisitorOptions
|
|
15
|
+
extends FixedFieldsVisitorOptions, FallbackVisitorOptions {}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* @public
|
|
19
|
+
*/
|
|
20
|
+
class JSONReferenceVisitor extends JSONReferenceVisitorBase {
|
|
21
|
+
declare public readonly element: JSONReferenceElement;
|
|
22
|
+
|
|
23
|
+
declare protected readonly specPath: SpecPath<['document', 'objects', 'JSONReference']>;
|
|
24
|
+
|
|
25
|
+
constructor(options: JSONReferenceVisitorOptions) {
|
|
26
|
+
super(options);
|
|
27
|
+
this.element = new JSONReferenceElement();
|
|
28
|
+
this.specPath = always(['document', 'objects', 'JSONReference']);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
ObjectElement(path: Path<ObjectElement>) {
|
|
32
|
+
FixedFieldsVisitor.prototype.ObjectElement.call(this, path);
|
|
33
|
+
|
|
34
|
+
// mark this JSONReferenceElement with reference metadata
|
|
35
|
+
if (isStringElement(this.element.$ref)) {
|
|
36
|
+
this.element.classes.push('reference-element');
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export default JSONReferenceVisitor;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault").default;
|
|
4
|
+
exports.__esModule = true;
|
|
5
|
+
exports.default = void 0;
|
|
6
|
+
var _ramda = require("ramda");
|
|
7
|
+
var _LinkDescription = _interopRequireDefault(require("../../../../elements/LinkDescription.cjs"));
|
|
8
|
+
var _bases = require("../bases.cjs");
|
|
9
|
+
/**
|
|
10
|
+
* @public
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* @public
|
|
15
|
+
*/
|
|
16
|
+
class LinkDescriptionVisitor extends _bases.LinkDescriptionVisitorBase {
|
|
17
|
+
constructor(options) {
|
|
18
|
+
super(options);
|
|
19
|
+
this.element = new _LinkDescription.default();
|
|
20
|
+
this.specPath = (0, _ramda.always)(['document', 'objects', 'LinkDescription']);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
var _default = exports.default = LinkDescriptionVisitor;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { always } from 'ramda';
|
|
2
|
+
import LinkDescriptionElement from "../../../../elements/LinkDescription.mjs";
|
|
3
|
+
import { LinkDescriptionVisitorBase } from "../bases.mjs";
|
|
4
|
+
/**
|
|
5
|
+
* @public
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* @public
|
|
9
|
+
*/
|
|
10
|
+
class LinkDescriptionVisitor extends LinkDescriptionVisitorBase {
|
|
11
|
+
constructor(options) {
|
|
12
|
+
super(options);
|
|
13
|
+
this.element = new LinkDescriptionElement();
|
|
14
|
+
this.specPath = always(['document', 'objects', 'LinkDescription']);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
export default LinkDescriptionVisitor;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { always } from 'ramda';
|
|
2
|
+
|
|
3
|
+
import LinkDescriptionElement from '../../../../elements/LinkDescription.ts';
|
|
4
|
+
import { SpecPath } from '../../generics/FixedFieldsVisitor.ts';
|
|
5
|
+
import { FixedFieldsVisitorOptions } from '../../generics/FixedFieldsVisitor.ts';
|
|
6
|
+
import { FallbackVisitorOptions } from '../../FallbackVisitor.ts';
|
|
7
|
+
import { LinkDescriptionVisitorBase } from '../bases.ts';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* @public
|
|
11
|
+
*/
|
|
12
|
+
export interface LinkDescriptionVisitorOptions
|
|
13
|
+
extends FixedFieldsVisitorOptions, FallbackVisitorOptions {}
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* @public
|
|
17
|
+
*/
|
|
18
|
+
class LinkDescriptionVisitor extends LinkDescriptionVisitorBase {
|
|
19
|
+
declare public readonly element: LinkDescriptionElement;
|
|
20
|
+
|
|
21
|
+
declare protected readonly specPath: SpecPath<['document', 'objects', 'LinkDescription']>;
|
|
22
|
+
|
|
23
|
+
constructor(options: LinkDescriptionVisitorOptions) {
|
|
24
|
+
super(options);
|
|
25
|
+
this.element = new LinkDescriptionElement();
|
|
26
|
+
this.specPath = always(['document', 'objects', 'LinkDescription']);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export default LinkDescriptionVisitor;
|