@speclynx/apidom-ns-json-schema-2019-09 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 (61) 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-2019-09.browser.js +1 -0
  10. package/package.json +65 -0
  11. package/src/elements/JSONSchema.cjs +214 -0
  12. package/src/elements/JSONSchema.mjs +211 -0
  13. package/src/elements/LinkDescription.cjs +48 -0
  14. package/src/elements/LinkDescription.mjs +44 -0
  15. package/src/index.cjs +73 -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 +257 -0
  26. package/src/refractor/plugins/replace-empty-element.mjs +250 -0
  27. package/src/refractor/registration.cjs +13 -0
  28. package/src/refractor/registration.mjs +6 -0
  29. package/src/refractor/specification.cjs +26 -0
  30. package/src/refractor/specification.mjs +21 -0
  31. package/src/refractor/toolbox.cjs +21 -0
  32. package/src/refractor/toolbox.mjs +15 -0
  33. package/src/refractor/visitors/json-schema/$defsVisitor.cjs +24 -0
  34. package/src/refractor/visitors/json-schema/$defsVisitor.mjs +21 -0
  35. package/src/refractor/visitors/json-schema/$refVisitor.cjs +16 -0
  36. package/src/refractor/visitors/json-schema/$refVisitor.mjs +12 -0
  37. package/src/refractor/visitors/json-schema/$vocabularyVisitor.cjs +16 -0
  38. package/src/refractor/visitors/json-schema/$vocabularyVisitor.mjs +12 -0
  39. package/src/refractor/visitors/json-schema/AllOfVisitor.cjs +30 -0
  40. package/src/refractor/visitors/json-schema/AllOfVisitor.mjs +27 -0
  41. package/src/refractor/visitors/json-schema/AnyOfVisitor.cjs +30 -0
  42. package/src/refractor/visitors/json-schema/AnyOfVisitor.mjs +27 -0
  43. package/src/refractor/visitors/json-schema/DependentRequiredVisitor.cjs +16 -0
  44. package/src/refractor/visitors/json-schema/DependentRequiredVisitor.mjs +12 -0
  45. package/src/refractor/visitors/json-schema/DependentSchemasVisitor.cjs +24 -0
  46. package/src/refractor/visitors/json-schema/DependentSchemasVisitor.mjs +21 -0
  47. package/src/refractor/visitors/json-schema/ItemsVisitor.cjs +35 -0
  48. package/src/refractor/visitors/json-schema/ItemsVisitor.mjs +32 -0
  49. package/src/refractor/visitors/json-schema/OneOfVisitor.cjs +30 -0
  50. package/src/refractor/visitors/json-schema/OneOfVisitor.mjs +27 -0
  51. package/src/refractor/visitors/json-schema/PatternPropertiesVisitor.cjs +24 -0
  52. package/src/refractor/visitors/json-schema/PatternPropertiesVisitor.mjs +21 -0
  53. package/src/refractor/visitors/json-schema/PropertiesVisitor.cjs +24 -0
  54. package/src/refractor/visitors/json-schema/PropertiesVisitor.mjs +21 -0
  55. package/src/refractor/visitors/json-schema/index.cjs +36 -0
  56. package/src/refractor/visitors/json-schema/index.mjs +31 -0
  57. package/src/refractor/visitors/json-schema/link-description/index.cjs +17 -0
  58. package/src/refractor/visitors/json-schema/link-description/index.mjs +12 -0
  59. package/src/traversal/visitor.cjs +15 -0
  60. package/src/traversal/visitor.mjs +11 -0
  61. package/types/apidom-ns-json-schema-2019-09.d.ts +648 -0
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+
3
+ exports.__esModule = true;
4
+ exports.default = void 0;
5
+ var _tsMixer = require("ts-mixer");
6
+ var _ramda = require("ramda");
7
+ var _apidomCore = require("@speclynx/apidom-core");
8
+ var _apidomNsJsonSchemaDraft = require("@speclynx/apidom-ns-json-schema-draft-7");
9
+ /**
10
+ * @public
11
+ */
12
+
13
+ /**
14
+ * @public
15
+ */
16
+ class DependentSchemasVisitor extends (0, _tsMixer.Mixin)(_apidomNsJsonSchemaDraft.MapVisitor, _apidomNsJsonSchemaDraft.ParentSchemaAwareVisitor, _apidomNsJsonSchemaDraft.FallbackVisitor) {
17
+ constructor(options) {
18
+ super(options);
19
+ this.element = new _apidomCore.ObjectElement();
20
+ this.element.classes.push('json-schema-dependentSchemas');
21
+ this.specPath = (0, _ramda.always)(['document', 'objects', 'JSONSchema']);
22
+ }
23
+ }
24
+ var _default = exports.default = DependentSchemasVisitor;
@@ -0,0 +1,21 @@
1
+ import { Mixin } from 'ts-mixer';
2
+ import { always } from 'ramda';
3
+ import { ObjectElement } from '@speclynx/apidom-core';
4
+ import { FallbackVisitor, MapVisitor, ParentSchemaAwareVisitor } from '@speclynx/apidom-ns-json-schema-draft-7';
5
+
6
+ /**
7
+ * @public
8
+ */
9
+
10
+ /**
11
+ * @public
12
+ */
13
+ class DependentSchemasVisitor extends Mixin(MapVisitor, ParentSchemaAwareVisitor, FallbackVisitor) {
14
+ constructor(options) {
15
+ super(options);
16
+ this.element = new ObjectElement();
17
+ this.element.classes.push('json-schema-dependentSchemas');
18
+ this.specPath = always(['document', 'objects', 'JSONSchema']);
19
+ }
20
+ }
21
+ export default DependentSchemasVisitor;
@@ -0,0 +1,35 @@
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 _apidomNsJsonSchemaDraft = require("@speclynx/apidom-ns-json-schema-draft-7");
8
+ /**
9
+ * @public
10
+ */
11
+
12
+ /**
13
+ * @public
14
+ */
15
+ class ItemsVisitor extends (0, _tsMixer.Mixin)(_apidomNsJsonSchemaDraft.SpecificationVisitor, _apidomNsJsonSchemaDraft.ParentSchemaAwareVisitor, _apidomNsJsonSchemaDraft.FallbackVisitor) {
16
+ ObjectElement(objectElement) {
17
+ this.element = this.toRefractedElement(['document', 'objects', 'JSONSchema'], objectElement);
18
+ return _apidomCore.BREAK;
19
+ }
20
+ ArrayElement(arrayElement) {
21
+ this.element = new _apidomCore.ArrayElement();
22
+ this.element.classes.push('json-schema-items');
23
+ arrayElement.forEach(item => {
24
+ const element = this.toRefractedElement(['document', 'objects', 'JSONSchema'], item);
25
+ this.element.push(element);
26
+ });
27
+ this.copyMetaAndAttributes(arrayElement, this.element);
28
+ return _apidomCore.BREAK;
29
+ }
30
+ BooleanElement(booleanElement) {
31
+ this.element = this.toRefractedElement(['document', 'objects', 'JSONSchema'], booleanElement);
32
+ return _apidomCore.BREAK;
33
+ }
34
+ }
35
+ var _default = exports.default = ItemsVisitor;
@@ -0,0 +1,32 @@
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-draft-7';
4
+
5
+ /**
6
+ * @public
7
+ */
8
+
9
+ /**
10
+ * @public
11
+ */
12
+ class ItemsVisitor extends Mixin(SpecificationVisitor, ParentSchemaAwareVisitor, FallbackVisitor) {
13
+ ObjectElement(objectElement) {
14
+ this.element = this.toRefractedElement(['document', 'objects', 'JSONSchema'], objectElement);
15
+ return BREAK;
16
+ }
17
+ ArrayElement(arrayElement) {
18
+ this.element = new ArrayElement();
19
+ this.element.classes.push('json-schema-items');
20
+ arrayElement.forEach(item => {
21
+ const element = this.toRefractedElement(['document', 'objects', 'JSONSchema'], item);
22
+ this.element.push(element);
23
+ });
24
+ this.copyMetaAndAttributes(arrayElement, this.element);
25
+ return BREAK;
26
+ }
27
+ BooleanElement(booleanElement) {
28
+ this.element = this.toRefractedElement(['document', 'objects', 'JSONSchema'], booleanElement);
29
+ return BREAK;
30
+ }
31
+ }
32
+ export default ItemsVisitor;
@@ -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 _apidomNsJsonSchemaDraft = require("@speclynx/apidom-ns-json-schema-draft-7");
8
+ /**
9
+ * @public
10
+ */
11
+
12
+ /**
13
+ * @public
14
+ */
15
+ class OneOfVisitor extends (0, _tsMixer.Mixin)(_apidomNsJsonSchemaDraft.SpecificationVisitor, _apidomNsJsonSchemaDraft.ParentSchemaAwareVisitor, _apidomNsJsonSchemaDraft.FallbackVisitor) {
16
+ constructor(options) {
17
+ super(options);
18
+ this.element = new _apidomCore.ArrayElement();
19
+ this.element.classes.push('json-schema-oneOf');
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 = OneOfVisitor;
@@ -0,0 +1,27 @@
1
+ import { Mixin } from 'ts-mixer';
2
+ import { ArrayElement, BREAK } from '@speclynx/apidom-core';
3
+ import { FallbackVisitor, SpecificationVisitor, ParentSchemaAwareVisitor } from '@speclynx/apidom-ns-json-schema-draft-7';
4
+
5
+ /**
6
+ * @public
7
+ */
8
+
9
+ /**
10
+ * @public
11
+ */
12
+ class OneOfVisitor extends Mixin(SpecificationVisitor, ParentSchemaAwareVisitor, FallbackVisitor) {
13
+ constructor(options) {
14
+ super(options);
15
+ this.element = new ArrayElement();
16
+ this.element.classes.push('json-schema-oneOf');
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 OneOfVisitor;
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+
3
+ exports.__esModule = true;
4
+ exports.default = void 0;
5
+ var _tsMixer = require("ts-mixer");
6
+ var _ramda = require("ramda");
7
+ var _apidomCore = require("@speclynx/apidom-core");
8
+ var _apidomNsJsonSchemaDraft = require("@speclynx/apidom-ns-json-schema-draft-7");
9
+ /**
10
+ * @public
11
+ */
12
+
13
+ /**
14
+ * @public
15
+ */
16
+ class PatternPropertiesVisitor extends (0, _tsMixer.Mixin)(_apidomNsJsonSchemaDraft.MapVisitor, _apidomNsJsonSchemaDraft.ParentSchemaAwareVisitor, _apidomNsJsonSchemaDraft.FallbackVisitor) {
17
+ constructor(options) {
18
+ super(options);
19
+ this.element = new _apidomCore.ObjectElement();
20
+ this.element.classes.push('json-schema-patternProperties');
21
+ this.specPath = (0, _ramda.always)(['document', 'objects', 'JSONSchema']);
22
+ }
23
+ }
24
+ var _default = exports.default = PatternPropertiesVisitor;
@@ -0,0 +1,21 @@
1
+ import { Mixin } from 'ts-mixer';
2
+ import { always } from 'ramda';
3
+ import { ObjectElement } from '@speclynx/apidom-core';
4
+ import { FallbackVisitor, MapVisitor, ParentSchemaAwareVisitor } from '@speclynx/apidom-ns-json-schema-draft-7';
5
+
6
+ /**
7
+ * @public
8
+ */
9
+
10
+ /**
11
+ * @public
12
+ */
13
+ class PatternPropertiesVisitor extends Mixin(MapVisitor, ParentSchemaAwareVisitor, FallbackVisitor) {
14
+ constructor(options) {
15
+ super(options);
16
+ this.element = new ObjectElement();
17
+ this.element.classes.push('json-schema-patternProperties');
18
+ this.specPath = always(['document', 'objects', 'JSONSchema']);
19
+ }
20
+ }
21
+ export default PatternPropertiesVisitor;
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+
3
+ exports.__esModule = true;
4
+ exports.default = void 0;
5
+ var _tsMixer = require("ts-mixer");
6
+ var _ramda = require("ramda");
7
+ var _apidomCore = require("@speclynx/apidom-core");
8
+ var _apidomNsJsonSchemaDraft = require("@speclynx/apidom-ns-json-schema-draft-7");
9
+ /**
10
+ * @public
11
+ */
12
+
13
+ /**
14
+ * @public
15
+ */
16
+ class PropertiesVisitor extends (0, _tsMixer.Mixin)(_apidomNsJsonSchemaDraft.MapVisitor, _apidomNsJsonSchemaDraft.ParentSchemaAwareVisitor, _apidomNsJsonSchemaDraft.FallbackVisitor) {
17
+ constructor(options) {
18
+ super(options);
19
+ this.element = new _apidomCore.ObjectElement();
20
+ this.element.classes.push('json-schema-properties');
21
+ this.specPath = (0, _ramda.always)(['document', 'objects', 'JSONSchema']);
22
+ }
23
+ }
24
+ var _default = exports.default = PropertiesVisitor;
@@ -0,0 +1,21 @@
1
+ import { Mixin } from 'ts-mixer';
2
+ import { always } from 'ramda';
3
+ import { ObjectElement } from '@speclynx/apidom-core';
4
+ import { FallbackVisitor, MapVisitor, ParentSchemaAwareVisitor } from '@speclynx/apidom-ns-json-schema-draft-7';
5
+
6
+ /**
7
+ * @public
8
+ */
9
+
10
+ /**
11
+ * @public
12
+ */
13
+ class PropertiesVisitor extends Mixin(MapVisitor, ParentSchemaAwareVisitor, FallbackVisitor) {
14
+ constructor(options) {
15
+ super(options);
16
+ this.element = new ObjectElement();
17
+ this.element.classes.push('json-schema-properties');
18
+ this.specPath = always(['document', 'objects', 'JSONSchema']);
19
+ }
20
+ }
21
+ export default PropertiesVisitor;
@@ -0,0 +1,36 @@
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 _apidomCore = require("@speclynx/apidom-core");
7
+ var _apidomNsJsonSchemaDraft = require("@speclynx/apidom-ns-json-schema-draft-7");
8
+ var _JSONSchema = _interopRequireDefault(require("../../../elements/JSONSchema.cjs"));
9
+ /**
10
+ * @public
11
+ */
12
+ class JSONSchemaVisitor extends _apidomNsJsonSchemaDraft.JSONSchemaVisitor {
13
+ constructor(options) {
14
+ super(options);
15
+ this.element = new _JSONSchema.default();
16
+ }
17
+ get defaultDialectIdentifier() {
18
+ return 'https://json-schema.org/draft/2019-09/schema';
19
+ }
20
+ ObjectElement(objectElement) {
21
+ this.handleDialectIdentifier(objectElement);
22
+ this.handleSchemaIdentifier(objectElement);
23
+
24
+ // for further processing consider this Schema Element as parent for all embedded Schema Elements
25
+ this.parent = this.element;
26
+ const result = _apidomNsJsonSchemaDraft.FixedFieldsVisitor.prototype.ObjectElement.call(this, objectElement);
27
+
28
+ // mark this SchemaElement with reference metadata
29
+ if ((0, _apidomCore.isStringElement)(this.element.$ref)) {
30
+ this.element.classes.push('reference-element');
31
+ this.element.setMetaProperty('referenced-element', 'schema');
32
+ }
33
+ return result;
34
+ }
35
+ }
36
+ var _default = exports.default = JSONSchemaVisitor;
@@ -0,0 +1,31 @@
1
+ import { isStringElement } from '@speclynx/apidom-core';
2
+ import { FixedFieldsVisitor, JSONSchemaVisitor as JSONSchemaDraft7Visitor } from '@speclynx/apidom-ns-json-schema-draft-7';
3
+ import JSONSchemaElement from "../../../elements/JSONSchema.mjs";
4
+ /**
5
+ * @public
6
+ */
7
+ class JSONSchemaVisitor extends JSONSchemaDraft7Visitor {
8
+ constructor(options) {
9
+ super(options);
10
+ this.element = new JSONSchemaElement();
11
+ }
12
+ get defaultDialectIdentifier() {
13
+ return 'https://json-schema.org/draft/2019-09/schema';
14
+ }
15
+ ObjectElement(objectElement) {
16
+ this.handleDialectIdentifier(objectElement);
17
+ this.handleSchemaIdentifier(objectElement);
18
+
19
+ // for further processing consider this Schema Element as parent for all embedded Schema Elements
20
+ this.parent = this.element;
21
+ const result = FixedFieldsVisitor.prototype.ObjectElement.call(this, objectElement);
22
+
23
+ // mark this SchemaElement with reference metadata
24
+ if (isStringElement(this.element.$ref)) {
25
+ this.element.classes.push('reference-element');
26
+ this.element.setMetaProperty('referenced-element', 'schema');
27
+ }
28
+ return result;
29
+ }
30
+ }
31
+ 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 _apidomNsJsonSchemaDraft = require("@speclynx/apidom-ns-json-schema-draft-7");
7
+ var _LinkDescription = _interopRequireDefault(require("../../../../elements/LinkDescription.cjs"));
8
+ /**
9
+ * @public
10
+ */
11
+ class LinkDescriptionVisitor extends _apidomNsJsonSchemaDraft.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 JSONSchemaDraft7LinkDescriptionVisitor } from '@speclynx/apidom-ns-json-schema-draft-7';
2
+ import LinkDescriptionElement from "../../../../elements/LinkDescription.mjs";
3
+ /**
4
+ * @public
5
+ */
6
+ class LinkDescriptionVisitor extends JSONSchemaDraft7LinkDescriptionVisitor {
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 _apidomNsJsonSchemaDraft = require("@speclynx/apidom-ns-json-schema-draft-7");
7
+ exports.getNodeType = _apidomNsJsonSchemaDraft.getNodeType;
8
+ /**
9
+ * @public
10
+ */
11
+ const keyMap = exports.keyMap = {
12
+ JSONSchema201909Element: ['content'],
13
+ LinkDescriptionElement: ['content'],
14
+ ..._apidomCore.keyMap
15
+ };
@@ -0,0 +1,11 @@
1
+ import { keyMap as keyMapBase } from '@speclynx/apidom-core';
2
+ export { getNodeType } from '@speclynx/apidom-ns-json-schema-draft-7';
3
+
4
+ /**
5
+ * @public
6
+ */
7
+ export const keyMap = {
8
+ JSONSchema201909Element: ['content'],
9
+ LinkDescriptionElement: ['content'],
10
+ ...keyMapBase
11
+ };