@speclynx/apidom-ns-json-schema-2020-12 1.12.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/CHANGELOG.md +82 -0
  2. package/LICENSE +202 -0
  3. package/LICENSES/AFL-3.0.txt +182 -0
  4. package/LICENSES/Apache-2.0.txt +202 -0
  5. package/LICENSES/BSD-3-Clause.txt +26 -0
  6. package/LICENSES/MIT.txt +9 -0
  7. package/NOTICE +65 -0
  8. package/README.md +186 -0
  9. package/dist/apidom-ns-json-schema-2020-12.browser.js +1 -0
  10. package/package.json +65 -0
  11. package/src/elements/JSONSchema.cjs +60 -0
  12. package/src/elements/JSONSchema.mjs +57 -0
  13. package/src/elements/LinkDescription.cjs +48 -0
  14. package/src/elements/LinkDescription.mjs +44 -0
  15. package/src/index.cjs +61 -0
  16. package/src/index.mjs +26 -0
  17. package/src/media-types.cjs +34 -0
  18. package/src/media-types.mjs +30 -0
  19. package/src/namespace.cjs +21 -0
  20. package/src/namespace.mjs +16 -0
  21. package/src/predicates.cjs +29 -0
  22. package/src/predicates.mjs +24 -0
  23. package/src/refractor/index.cjs +54 -0
  24. package/src/refractor/index.mjs +48 -0
  25. package/src/refractor/plugins/replace-empty-element.cjs +264 -0
  26. package/src/refractor/plugins/replace-empty-element.mjs +257 -0
  27. package/src/refractor/registration.cjs +13 -0
  28. package/src/refractor/registration.mjs +6 -0
  29. package/src/refractor/specification.cjs +16 -0
  30. package/src/refractor/specification.mjs +11 -0
  31. package/src/refractor/toolbox.cjs +21 -0
  32. package/src/refractor/toolbox.mjs +15 -0
  33. package/src/refractor/visitors/json-schema/PrefixItemsVisitor.cjs +30 -0
  34. package/src/refractor/visitors/json-schema/PrefixItemsVisitor.mjs +27 -0
  35. package/src/refractor/visitors/json-schema/index.cjs +20 -0
  36. package/src/refractor/visitors/json-schema/index.mjs +15 -0
  37. package/src/refractor/visitors/json-schema/link-description/index.cjs +17 -0
  38. package/src/refractor/visitors/json-schema/link-description/index.mjs +12 -0
  39. package/src/traversal/visitor.cjs +15 -0
  40. package/src/traversal/visitor.mjs +10 -0
  41. package/types/apidom-ns-json-schema-2020-12.d.ts +475 -0
@@ -0,0 +1,257 @@
1
+ import { ArrayElement, ObjectElement, isStringElement, isArrayElement, isElement, isMemberElement, includesClasses, cloneDeep, toValue } from '@speclynx/apidom-core';
2
+ /**
3
+ * JSON Schema 2020-12 specification elements.
4
+ */
5
+ import JSONSchemaElement from "../../elements/JSONSchema.mjs";
6
+ import LinkDescriptionElement from "../../elements/LinkDescription.mjs";
7
+ import { getNodeType } from "../../traversal/visitor.mjs";
8
+ /**
9
+ * This plugin is specific to YAML 1.2 format, which allows defining key-value pairs
10
+ * with empty key, empty value, or both. If the value is not provided in YAML format,
11
+ * this plugin compensates for this missing value with the most appropriate semantic element type.
12
+ *
13
+ * https://yaml.org/spec/1.2.2/#72-empty-nodes
14
+ *
15
+ * @example
16
+ *
17
+ * ```yaml
18
+ * $schema: https://json-schema.org/draft/2020-12/schema
19
+ * items:
20
+ * ```
21
+ * Refracting result without this plugin:
22
+ *
23
+ * (JSONSchemaElement
24
+ * (MemberElement
25
+ * (StringElement)
26
+ * (StringElement))
27
+ * (MemberElement
28
+ * (StringElement)
29
+ * (StringElement))
30
+ *
31
+ * Refracting result with this plugin:
32
+ *
33
+ * (JSONSchemaElement
34
+ * (MemberElement
35
+ * (StringElement)
36
+ * (StringElement))
37
+ * (MemberElement
38
+ * (StringElement)
39
+ * (JSONSchemaElement))
40
+ */
41
+ const isEmptyElement = element => isStringElement(element) && includesClasses(['yaml-e-node', 'yaml-e-scalar'], element);
42
+ const schema = {
43
+ JSONSchema202012Element: {
44
+ prefixItems(...args) {
45
+ const element = new ArrayElement(...args);
46
+ element.classes.push('json-schema-prefixItems');
47
+ return element;
48
+ },
49
+ items(...args) {
50
+ return new JSONSchemaElement(...args);
51
+ },
52
+ contains(...args) {
53
+ return new JSONSchemaElement(...args);
54
+ },
55
+ required(...args) {
56
+ const element = new ArrayElement(...args);
57
+ element.classes.push('json-schema-required');
58
+ return element;
59
+ },
60
+ properties(...args) {
61
+ const element = new ObjectElement(...args);
62
+ element.classes.push('json-schema-properties');
63
+ return element;
64
+ },
65
+ additionalProperties(...args) {
66
+ return new JSONSchemaElement(...args);
67
+ },
68
+ patternProperties(...args) {
69
+ const element = new ObjectElement(...args);
70
+ element.classes.push('json-schema-patternProperties');
71
+ return element;
72
+ },
73
+ dependentSchemas(...args) {
74
+ const element = new ObjectElement(...args);
75
+ element.classes.push('json-schema-dependentSchemas');
76
+ return element;
77
+ },
78
+ propertyNames(...args) {
79
+ return new JSONSchemaElement(...args);
80
+ },
81
+ enum(...args) {
82
+ const element = new ArrayElement(...args);
83
+ element.classes.push('json-schema-enum');
84
+ return element;
85
+ },
86
+ allOf(...args) {
87
+ const element = new ArrayElement(...args);
88
+ element.classes.push('json-schema-allOf');
89
+ return element;
90
+ },
91
+ anyOf(...args) {
92
+ const element = new ArrayElement(...args);
93
+ element.classes.push('json-schema-anyOf');
94
+ return element;
95
+ },
96
+ oneOf(...args) {
97
+ const element = new ArrayElement(...args);
98
+ element.classes.push('json-schema-oneOf');
99
+ return element;
100
+ },
101
+ if(...args) {
102
+ return new JSONSchemaElement(...args);
103
+ },
104
+ then(...args) {
105
+ return new JSONSchemaElement(...args);
106
+ },
107
+ else(...args) {
108
+ return new JSONSchemaElement(...args);
109
+ },
110
+ not(...args) {
111
+ return new JSONSchemaElement(...args);
112
+ },
113
+ $defs(...args) {
114
+ const element = new ObjectElement(...args);
115
+ element.classes.push('json-schema-$defs');
116
+ return element;
117
+ },
118
+ examples(...args) {
119
+ const element = new ArrayElement(...args);
120
+ element.classes.push('json-schema-examples');
121
+ return element;
122
+ },
123
+ links(...args) {
124
+ const element = new ArrayElement(...args);
125
+ element.classes.push('json-schema-links');
126
+ return element;
127
+ },
128
+ $vocabulary(...args) {
129
+ const element = new ObjectElement(...args);
130
+ element.classes.push('json-schema-$vocabulary');
131
+ return element;
132
+ },
133
+ unevaluatedItems(...args) {
134
+ return new JSONSchemaElement(...args);
135
+ },
136
+ unevaluatedProperties(...args) {
137
+ return new JSONSchemaElement(...args);
138
+ },
139
+ $dependentRequired(...args) {
140
+ const element = new ObjectElement(...args);
141
+ element.classes.push('json-schema-$dependentRequired');
142
+ return element;
143
+ },
144
+ contentSchema(...args) {
145
+ return new JSONSchemaElement(...args);
146
+ },
147
+ type(...args) {
148
+ const element = new ArrayElement(...args);
149
+ element.classes.push('json-schema-type');
150
+ return element;
151
+ }
152
+ },
153
+ LinkDescriptionElement: {
154
+ hrefSchema(...args) {
155
+ return new JSONSchemaElement(...args);
156
+ },
157
+ targetSchema(...args) {
158
+ return new JSONSchemaElement(...args);
159
+ },
160
+ submissionSchema(...args) {
161
+ return new JSONSchemaElement(...args);
162
+ },
163
+ templatePointers(...args) {
164
+ return new ObjectElement(...args);
165
+ },
166
+ templateRequired(...args) {
167
+ return new ArrayElement(...args);
168
+ },
169
+ targetHints(...args) {
170
+ return new ObjectElement(...args);
171
+ },
172
+ headerSchema(...args) {
173
+ return new JSONSchemaElement(...args);
174
+ }
175
+ },
176
+ 'json-schema-prefixItems': {
177
+ '<*>': function asterisk(...args) {
178
+ return new JSONSchemaElement(...args);
179
+ }
180
+ },
181
+ 'json-schema-properties': {
182
+ '[key: *]': function key(...args) {
183
+ return new JSONSchemaElement(...args);
184
+ }
185
+ },
186
+ 'json-schema-patternProperties': {
187
+ '[key: *]': function key(...args) {
188
+ return new JSONSchemaElement(...args);
189
+ }
190
+ },
191
+ 'json-schema-dependentSchemas': {
192
+ '[key: *]': function key(...args) {
193
+ return new JSONSchemaElement(...args);
194
+ }
195
+ },
196
+ 'json-schema-allOf': {
197
+ '<*>': function asterisk(...args) {
198
+ return new JSONSchemaElement(...args);
199
+ }
200
+ },
201
+ 'json-schema-anyOf': {
202
+ '<*>': function asterisk(...args) {
203
+ return new JSONSchemaElement(...args);
204
+ }
205
+ },
206
+ 'json-schema-oneOf': {
207
+ '<*>': function asterisk(...args) {
208
+ return new JSONSchemaElement(...args);
209
+ }
210
+ },
211
+ 'json-schema-$defs': {
212
+ '[key: *]': function key(...args) {
213
+ return new JSONSchemaElement(...args);
214
+ }
215
+ },
216
+ 'json-schema-links': {
217
+ '<*>': function asterisk(...args) {
218
+ return new LinkDescriptionElement(...args);
219
+ }
220
+ }
221
+ };
222
+ const findElementFactory = (ancestor, keyName) => {
223
+ const elementType = getNodeType(ancestor); // @ts-ignore
224
+ const keyMapping = schema[elementType] || schema[toValue(ancestor.classes.first)];
225
+ return typeof keyMapping === 'undefined' ? undefined : Object.hasOwn(keyMapping, '[key: *]') ? keyMapping['[key: *]'] : keyMapping[keyName];
226
+ };
227
+
228
+ /**
229
+ * @public
230
+ */
231
+ const plugin = () => () => {
232
+ return {
233
+ visitor: {
234
+ StringElement(element, key, parent, path, ancestors) {
235
+ if (!isEmptyElement(element)) return undefined;
236
+ const lineage = [...ancestors, parent].filter(isElement);
237
+ const parentElement = lineage.at(-1);
238
+ let elementFactory;
239
+ let context;
240
+ if (isArrayElement(parentElement)) {
241
+ context = element;
242
+ elementFactory = findElementFactory(parentElement, '<*>');
243
+ } else if (isMemberElement(parentElement)) {
244
+ context = lineage.at(-2);
245
+ elementFactory = findElementFactory(context, toValue(parentElement.key));
246
+ }
247
+
248
+ // no element factory found
249
+ if (typeof elementFactory !== 'function') return undefined;
250
+ return elementFactory.call({
251
+ context
252
+ }, undefined, cloneDeep(element.meta), cloneDeep(element.attributes));
253
+ }
254
+ }
255
+ };
256
+ };
257
+ export default plugin;
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault").default;
4
+ exports.__esModule = true;
5
+ var _JSONSchema = _interopRequireDefault(require("../elements/JSONSchema.cjs"));
6
+ exports.JSONSchemaElement = _JSONSchema.default;
7
+ var _LinkDescription = _interopRequireDefault(require("../elements/LinkDescription.cjs"));
8
+ exports.LinkDescriptionElement = _LinkDescription.default;
9
+ var _index = require("./index.cjs");
10
+ // register refractors specific to element types
11
+
12
+ _JSONSchema.default.refract = (0, _index.createRefractor)(['visitors', 'document', 'objects', 'JSONSchema', '$visitor']);
13
+ _LinkDescription.default.refract = (0, _index.createRefractor)(['visitors', 'document', 'objects', 'LinkDescription', '$visitor']);
@@ -0,0 +1,6 @@
1
+ import JSONSchemaElement from "../elements/JSONSchema.mjs";
2
+ import LinkDescriptionElement from "../elements/LinkDescription.mjs";
3
+ import { createRefractor } from "./index.mjs"; // register refractors specific to element types
4
+ JSONSchemaElement.refract = createRefractor(['visitors', 'document', 'objects', 'JSONSchema', '$visitor']);
5
+ LinkDescriptionElement.refract = createRefractor(['visitors', 'document', 'objects', 'LinkDescription', '$visitor']);
6
+ export { JSONSchemaElement, LinkDescriptionElement };
@@ -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 _ramda = require("ramda");
7
+ var _apidomNsJsonSchema = require("@speclynx/apidom-ns-json-schema-2019-09");
8
+ var _index = _interopRequireDefault(require("./visitors/json-schema/index.cjs"));
9
+ var _PrefixItemsVisitor = _interopRequireDefault(require("./visitors/json-schema/PrefixItemsVisitor.cjs"));
10
+ var _index2 = _interopRequireDefault(require("./visitors/json-schema/link-description/index.cjs"));
11
+ const specification = (0, _ramda.pipe)(
12
+ // JSON Schema object modifications
13
+ (0, _ramda.assocPath)(['visitors', 'document', 'objects', 'JSONSchema', '$visitor'], _index.default), (0, _ramda.dissocPath)(['visitors', 'document', 'objects', 'JSONSchema', 'fixedFields', '$recursiveAnchor']), (0, _ramda.assocPath)(['visitors', 'document', 'objects', 'JSONSchema', 'fixedFields', '$dynamicAnchor'], _apidomNsJsonSchema.specificationObj.visitors.value), (0, _ramda.dissocPath)(['visitors', 'document', 'objects', 'JSONSchema', 'fixedFields', '$recursiveRef']), (0, _ramda.assocPath)(['visitors', 'document', 'objects', 'JSONSchema', 'fixedFields', '$dynamicRef'], _apidomNsJsonSchema.specificationObj.visitors.value), (0, _ramda.assocPath)(['visitors', 'document', 'objects', 'JSONSchema', 'fixedFields', 'not'], _index.default), (0, _ramda.assocPath)(['visitors', 'document', 'objects', 'JSONSchema', 'fixedFields', 'if'], _index.default), (0, _ramda.assocPath)(['visitors', 'document', 'objects', 'JSONSchema', 'fixedFields', 'then'], _index.default), (0, _ramda.assocPath)(['visitors', 'document', 'objects', 'JSONSchema', 'fixedFields', 'else'], _index.default), (0, _ramda.assocPath)(['visitors', 'document', 'objects', 'JSONSchema', 'fixedFields', 'prefixItems'], _PrefixItemsVisitor.default), (0, _ramda.assocPath)(['visitors', 'document', 'objects', 'JSONSchema', 'fixedFields', 'items'], _index.default), (0, _ramda.assocPath)(['visitors', 'document', 'objects', 'JSONSchema', 'fixedFields', 'contains'], _index.default), (0, _ramda.assocPath)(['visitors', 'document', 'objects', 'JSONSchema', 'fixedFields', 'additionalProperties'], _index.default), (0, _ramda.dissocPath)(['visitors', 'document', 'objects', 'JSONSchema', 'fixedFields', 'additionalItems']), (0, _ramda.assocPath)(['visitors', 'document', 'objects', 'JSONSchema', 'fixedFields', 'propertyNames'], _index.default), (0, _ramda.assocPath)(['visitors', 'document', 'objects', 'JSONSchema', 'fixedFields', 'unevaluatedItems'], _index.default), (0, _ramda.assocPath)(['visitors', 'document', 'objects', 'JSONSchema', 'fixedFields', 'unevaluatedProperties'], _index.default), (0, _ramda.assocPath)(['visitors', 'document', 'objects', 'JSONSchema', 'fixedFields', 'contentSchema'], _index.default),
14
+ // Link Description object modifications
15
+ (0, _ramda.assocPath)(['visitors', 'document', 'objects', 'LinkDescription', '$visitor'], _index2.default), (0, _ramda.assocPath)(['visitors', 'document', 'objects', 'LinkDescription', 'fixedFields', 'targetSchema'], _index.default), (0, _ramda.assocPath)(['visitors', 'document', 'objects', 'LinkDescription', 'fixedFields', 'hrefSchema'], _index.default), (0, _ramda.assocPath)(['visitors', 'document', 'objects', 'LinkDescription', 'fixedFields', 'headerSchema'], _index.default), (0, _ramda.assocPath)(['visitors', 'document', 'objects', 'LinkDescription', 'fixedFields', 'submissionSchema'], _index.default))(_apidomNsJsonSchema.specificationObj);
16
+ var _default = exports.default = specification;
@@ -0,0 +1,11 @@
1
+ import { pipe, assocPath, dissocPath } from 'ramda';
2
+ import { specificationObj } from '@speclynx/apidom-ns-json-schema-2019-09';
3
+ import JSONSchemaVisitor from "./visitors/json-schema/index.mjs";
4
+ import JSONSchemaPrefixItemsVisitor from "./visitors/json-schema/PrefixItemsVisitor.mjs";
5
+ import JSONSchemaLinkDescriptionVisitor from "./visitors/json-schema/link-description/index.mjs";
6
+ const specification = pipe(
7
+ // JSON Schema object modifications
8
+ assocPath(['visitors', 'document', 'objects', 'JSONSchema', '$visitor'], JSONSchemaVisitor), dissocPath(['visitors', 'document', 'objects', 'JSONSchema', 'fixedFields', '$recursiveAnchor']), assocPath(['visitors', 'document', 'objects', 'JSONSchema', 'fixedFields', '$dynamicAnchor'], specificationObj.visitors.value), dissocPath(['visitors', 'document', 'objects', 'JSONSchema', 'fixedFields', '$recursiveRef']), assocPath(['visitors', 'document', 'objects', 'JSONSchema', 'fixedFields', '$dynamicRef'], specificationObj.visitors.value), assocPath(['visitors', 'document', 'objects', 'JSONSchema', 'fixedFields', 'not'], JSONSchemaVisitor), assocPath(['visitors', 'document', 'objects', 'JSONSchema', 'fixedFields', 'if'], JSONSchemaVisitor), assocPath(['visitors', 'document', 'objects', 'JSONSchema', 'fixedFields', 'then'], JSONSchemaVisitor), assocPath(['visitors', 'document', 'objects', 'JSONSchema', 'fixedFields', 'else'], JSONSchemaVisitor), assocPath(['visitors', 'document', 'objects', 'JSONSchema', 'fixedFields', 'prefixItems'], JSONSchemaPrefixItemsVisitor), assocPath(['visitors', 'document', 'objects', 'JSONSchema', 'fixedFields', 'items'], JSONSchemaVisitor), assocPath(['visitors', 'document', 'objects', 'JSONSchema', 'fixedFields', 'contains'], JSONSchemaVisitor), assocPath(['visitors', 'document', 'objects', 'JSONSchema', 'fixedFields', 'additionalProperties'], JSONSchemaVisitor), dissocPath(['visitors', 'document', 'objects', 'JSONSchema', 'fixedFields', 'additionalItems']), assocPath(['visitors', 'document', 'objects', 'JSONSchema', 'fixedFields', 'propertyNames'], JSONSchemaVisitor), assocPath(['visitors', 'document', 'objects', 'JSONSchema', 'fixedFields', 'unevaluatedItems'], JSONSchemaVisitor), assocPath(['visitors', 'document', 'objects', 'JSONSchema', 'fixedFields', 'unevaluatedProperties'], JSONSchemaVisitor), assocPath(['visitors', 'document', 'objects', 'JSONSchema', 'fixedFields', 'contentSchema'], JSONSchemaVisitor),
9
+ // Link Description object modifications
10
+ assocPath(['visitors', 'document', 'objects', 'LinkDescription', '$visitor'], JSONSchemaLinkDescriptionVisitor), assocPath(['visitors', 'document', 'objects', 'LinkDescription', 'fixedFields', 'targetSchema'], JSONSchemaVisitor), assocPath(['visitors', 'document', 'objects', 'LinkDescription', 'fixedFields', 'hrefSchema'], JSONSchemaVisitor), assocPath(['visitors', 'document', 'objects', 'LinkDescription', 'fixedFields', 'headerSchema'], JSONSchemaVisitor), assocPath(['visitors', 'document', 'objects', 'LinkDescription', 'fixedFields', 'submissionSchema'], JSONSchemaVisitor))(specificationObj);
11
+ export default specification;
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault").default;
4
+ var _interopRequireWildcard = require("@babel/runtime-corejs3/helpers/interopRequireWildcard").default;
5
+ exports.__esModule = true;
6
+ exports.default = void 0;
7
+ var _apidomCore = require("@speclynx/apidom-core");
8
+ var jsonSchema202012Predicates = _interopRequireWildcard(require("../predicates.cjs"));
9
+ var _namespace = _interopRequireDefault(require("../namespace.cjs"));
10
+ const createToolbox = () => {
11
+ const namespace = (0, _apidomCore.createNamespace)(_namespace.default);
12
+ const predicates = {
13
+ ...jsonSchema202012Predicates,
14
+ isStringElement: _apidomCore.isStringElement
15
+ };
16
+ return {
17
+ predicates,
18
+ namespace
19
+ };
20
+ };
21
+ var _default = exports.default = createToolbox;
@@ -0,0 +1,15 @@
1
+ import { createNamespace, isStringElement } from '@speclynx/apidom-core';
2
+ import * as jsonSchema202012Predicates from "../predicates.mjs";
3
+ import jsonSchema202012Namespace from "../namespace.mjs";
4
+ const createToolbox = () => {
5
+ const namespace = createNamespace(jsonSchema202012Namespace);
6
+ const predicates = {
7
+ ...jsonSchema202012Predicates,
8
+ isStringElement
9
+ };
10
+ return {
11
+ predicates,
12
+ namespace
13
+ };
14
+ };
15
+ export default createToolbox;
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+
3
+ exports.__esModule = true;
4
+ exports.default = void 0;
5
+ var _tsMixer = require("ts-mixer");
6
+ var _apidomCore = require("@speclynx/apidom-core");
7
+ var _apidomNsJsonSchema = require("@speclynx/apidom-ns-json-schema-2019-09");
8
+ /**
9
+ * @public
10
+ */
11
+
12
+ /**
13
+ * @public
14
+ */
15
+ class PrefixItemsVisitor extends (0, _tsMixer.Mixin)(_apidomNsJsonSchema.SpecificationVisitor, _apidomNsJsonSchema.ParentSchemaAwareVisitor, _apidomNsJsonSchema.FallbackVisitor) {
16
+ constructor(options) {
17
+ super(options);
18
+ this.element = new _apidomCore.ArrayElement();
19
+ this.element.classes.push('json-schema-prefixItems');
20
+ }
21
+ ArrayElement(arrayElement) {
22
+ arrayElement.forEach(item => {
23
+ const element = this.toRefractedElement(['document', 'objects', 'JSONSchema'], item);
24
+ this.element.push(element);
25
+ });
26
+ this.copyMetaAndAttributes(arrayElement, this.element);
27
+ return _apidomCore.BREAK;
28
+ }
29
+ }
30
+ var _default = exports.default = PrefixItemsVisitor;
@@ -0,0 +1,27 @@
1
+ import { Mixin } from 'ts-mixer';
2
+ import { ArrayElement, BREAK } from '@speclynx/apidom-core';
3
+ import { SpecificationVisitor, FallbackVisitor, ParentSchemaAwareVisitor } from '@speclynx/apidom-ns-json-schema-2019-09';
4
+
5
+ /**
6
+ * @public
7
+ */
8
+
9
+ /**
10
+ * @public
11
+ */
12
+ class PrefixItemsVisitor extends Mixin(SpecificationVisitor, ParentSchemaAwareVisitor, FallbackVisitor) {
13
+ constructor(options) {
14
+ super(options);
15
+ this.element = new ArrayElement();
16
+ this.element.classes.push('json-schema-prefixItems');
17
+ }
18
+ ArrayElement(arrayElement) {
19
+ arrayElement.forEach(item => {
20
+ const element = this.toRefractedElement(['document', 'objects', 'JSONSchema'], item);
21
+ this.element.push(element);
22
+ });
23
+ this.copyMetaAndAttributes(arrayElement, this.element);
24
+ return BREAK;
25
+ }
26
+ }
27
+ export default PrefixItemsVisitor;
@@ -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 _apidomNsJsonSchema = require("@speclynx/apidom-ns-json-schema-2019-09");
7
+ var _JSONSchema = _interopRequireDefault(require("../../../elements/JSONSchema.cjs"));
8
+ /**
9
+ * @public
10
+ */
11
+ class JSONSchemaVisitor extends _apidomNsJsonSchema.JSONSchemaVisitor {
12
+ constructor(options) {
13
+ super(options);
14
+ this.element = new _JSONSchema.default();
15
+ }
16
+ get defaultDialectIdentifier() {
17
+ return 'https://json-schema.org/draft/2020-12/schema';
18
+ }
19
+ }
20
+ var _default = exports.default = JSONSchemaVisitor;
@@ -0,0 +1,15 @@
1
+ import { JSONSchemaVisitor as JSONSchema201909Visitor } from '@speclynx/apidom-ns-json-schema-2019-09';
2
+ import JSONSchemaElement from "../../../elements/JSONSchema.mjs";
3
+ /**
4
+ * @public
5
+ */
6
+ class JSONSchemaVisitor extends JSONSchema201909Visitor {
7
+ constructor(options) {
8
+ super(options);
9
+ this.element = new JSONSchemaElement();
10
+ }
11
+ get defaultDialectIdentifier() {
12
+ return 'https://json-schema.org/draft/2020-12/schema';
13
+ }
14
+ }
15
+ export default JSONSchemaVisitor;
@@ -0,0 +1,17 @@
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 _apidomNsJsonSchema = require("@speclynx/apidom-ns-json-schema-2019-09");
7
+ var _LinkDescription = _interopRequireDefault(require("../../../../elements/LinkDescription.cjs"));
8
+ /**
9
+ * @public
10
+ */
11
+ class LinkDescriptionVisitor extends _apidomNsJsonSchema.LinkDescriptionVisitor {
12
+ constructor(options) {
13
+ super(options);
14
+ this.element = new _LinkDescription.default();
15
+ }
16
+ }
17
+ var _default = exports.default = LinkDescriptionVisitor;
@@ -0,0 +1,12 @@
1
+ import { LinkDescriptionVisitor as JSONSchemaDraft201909LinkDescriptionVisitor } from '@speclynx/apidom-ns-json-schema-2019-09';
2
+ import LinkDescriptionElement from "../../../../elements/LinkDescription.mjs";
3
+ /**
4
+ * @public
5
+ */
6
+ class LinkDescriptionVisitor extends JSONSchemaDraft201909LinkDescriptionVisitor {
7
+ constructor(options) {
8
+ super(options);
9
+ this.element = new LinkDescriptionElement();
10
+ }
11
+ }
12
+ export default LinkDescriptionVisitor;
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+
3
+ exports.__esModule = true;
4
+ exports.keyMap = exports.getNodeType = void 0;
5
+ var _apidomCore = require("@speclynx/apidom-core");
6
+ var _apidomNsJsonSchema = require("@speclynx/apidom-ns-json-schema-2019-09");
7
+ exports.getNodeType = _apidomNsJsonSchema.getNodeType;
8
+ /**
9
+ * @public
10
+ */
11
+ const keyMap = exports.keyMap = {
12
+ JSONSchema202012Element: ['content'],
13
+ LinkDescriptionElement: ['content'],
14
+ ..._apidomCore.keyMap
15
+ };
@@ -0,0 +1,10 @@
1
+ import { keyMap as keyMapBase } from '@speclynx/apidom-core';
2
+ export { getNodeType } from '@speclynx/apidom-ns-json-schema-2019-09';
3
+ /**
4
+ * @public
5
+ */
6
+ export const keyMap = {
7
+ JSONSchema202012Element: ['content'],
8
+ LinkDescriptionElement: ['content'],
9
+ ...keyMapBase
10
+ };