@speclynx/apidom-ns-json-schema-draft-7 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 (39) 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 +188 -0
  9. package/dist/apidom-ns-json-schema-draft-7.browser.js +1 -0
  10. package/package.json +65 -0
  11. package/src/elements/JSONSchema.cjs +121 -0
  12. package/src/elements/JSONSchema.mjs +118 -0
  13. package/src/elements/LinkDescription.cjs +138 -0
  14. package/src/elements/LinkDescription.mjs +134 -0
  15. package/src/index.cjs +54 -0
  16. package/src/index.mjs +16 -0
  17. package/src/media-types.cjs +34 -0
  18. package/src/media-types.mjs +30 -0
  19. package/src/namespace.cjs +23 -0
  20. package/src/namespace.mjs +18 -0
  21. package/src/predicates.cjs +31 -0
  22. package/src/predicates.mjs +26 -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 +233 -0
  26. package/src/refractor/plugins/replace-empty-element.mjs +226 -0
  27. package/src/refractor/registration.cjs +13 -0
  28. package/src/refractor/registration.mjs +6 -0
  29. package/src/refractor/specification.cjs +15 -0
  30. package/src/refractor/specification.mjs +10 -0
  31. package/src/refractor/toolbox.cjs +21 -0
  32. package/src/refractor/toolbox.mjs +15 -0
  33. package/src/refractor/visitors/json-schema/index.cjs +20 -0
  34. package/src/refractor/visitors/json-schema/index.mjs +15 -0
  35. package/src/refractor/visitors/json-schema/link-description/index.cjs +17 -0
  36. package/src/refractor/visitors/json-schema/link-description/index.mjs +12 -0
  37. package/src/traversal/visitor.cjs +16 -0
  38. package/src/traversal/visitor.mjs +12 -0
  39. package/types/apidom-ns-json-schema-draft-7.d.ts +551 -0
package/package.json ADDED
@@ -0,0 +1,65 @@
1
+ {
2
+ "name": "@speclynx/apidom-ns-json-schema-draft-7",
3
+ "version": "1.12.1",
4
+ "description": "JSON Schema Draft 7 namespace for ApiDOM.",
5
+ "publishConfig": {
6
+ "access": "public",
7
+ "registry": "https://registry.npmjs.org",
8
+ "provenance": true
9
+ },
10
+ "type": "module",
11
+ "sideEffects": [
12
+ "./src/refractor/registration.mjs",
13
+ "./src/refractor/registration.cjs"
14
+ ],
15
+ "unpkg": "./dist/apidom-ns-json-schema-draft-7.browser.min.js",
16
+ "main": "./src/index.cjs",
17
+ "exports": {
18
+ "types": "./types/apidom-ns-json-schema-draft-7.d.ts",
19
+ "import": "./src/index.mjs",
20
+ "require": "./src/index.cjs"
21
+ },
22
+ "types": "./types/apidom-ns-json-schema-draft-7.d.ts",
23
+ "scripts": {
24
+ "build": "npm run clean && run-p --max-parallel ${CPU_CORES:-2} typescript:declaration build:es build:cjs build:umd:browser",
25
+ "build:es": "cross-env BABEL_ENV=es babel src --out-dir src --extensions '.ts' --out-file-extension '.mjs' --root-mode 'upward'",
26
+ "build:cjs": "cross-env BABEL_ENV=cjs babel src --out-dir src --extensions '.ts' --out-file-extension '.cjs' --root-mode 'upward'",
27
+ "build:umd:browser": "cross-env BABEL_ENV=browser webpack --config config/webpack/browser.config.js --progress",
28
+ "lint": "eslint ./",
29
+ "lint:fix": "eslint ./ --fix",
30
+ "clean": "rimraf --glob 'src/**/*.mjs' 'src/**/*.cjs' 'test/**/*.mjs' ./dist ./types",
31
+ "test": "npm run build:es && cross-env BABEL_ENV=es babel test --out-dir test --extensions '.ts' --out-file-extension '.mjs' --root-mode 'upward' && cross-env NODE_ENV=test mocha",
32
+ "test:update-snapshots": "cross-env UPDATE_SNAPSHOT=1 mocha",
33
+ "typescript:check-types": "tsc --noEmit && tsc -p ./test/tsconfig.json --noEmit",
34
+ "typescript:declaration": "tsc -p tsconfig.declaration.json && api-extractor run -l -c ./config/api-extractor/api-extractor.json 2>&1 | shx grep -v 'Visitor_base'",
35
+ "prepack": "copyfiles -u 3 ../../LICENSES/* LICENSES && copyfiles -u 2 ../../NOTICE .",
36
+ "postpack": "rimraf NOTICE LICENSES"
37
+ },
38
+ "repository": {
39
+ "type": "git",
40
+ "url": "git+https://github.com/speclynx/apidom.git"
41
+ },
42
+ "author": "Vladimir Gorej",
43
+ "license": "Apache-2.0",
44
+ "dependencies": {
45
+ "@babel/runtime-corejs3": "^7.28.4",
46
+ "@speclynx/apidom-core": "^1.12.1",
47
+ "@speclynx/apidom-error": "^1.12.1",
48
+ "@speclynx/apidom-ns-json-schema-draft-6": "^1.12.1",
49
+ "@types/ramda": "~0.30.0",
50
+ "ramda": "~0.32.0",
51
+ "ramda-adjunct": "^6.0.0",
52
+ "ts-mixer": "^6.0.4"
53
+ },
54
+ "files": [
55
+ "src/**/*.mjs",
56
+ "src/**/*.cjs",
57
+ "dist/",
58
+ "types/apidom-ns-json-schema-draft-7.d.ts",
59
+ "LICENSES",
60
+ "NOTICE",
61
+ "README.md",
62
+ "CHANGELOG.md"
63
+ ],
64
+ "gitHead": "49be88493f922c4ace2e4ebc0f23387ccb62c4fc"
65
+ }
@@ -0,0 +1,121 @@
1
+ "use strict";
2
+
3
+ exports.__esModule = true;
4
+ exports.default = void 0;
5
+ var _apidomError = require("@speclynx/apidom-error");
6
+ var _apidomNsJsonSchemaDraft = require("@speclynx/apidom-ns-json-schema-draft-6");
7
+ /**
8
+ * @public
9
+ */
10
+ class JSONSchema extends _apidomNsJsonSchemaDraft.JSONSchemaElement {
11
+ constructor(content, meta, attributes) {
12
+ super(content, meta, attributes);
13
+ this.element = 'JSONSchemaDraft7';
14
+ }
15
+
16
+ /**
17
+ * Core vocabulary
18
+ *
19
+ * URI: https://datatracker.ietf.org/doc/html/draft-handrews-json-schema-01
20
+ */
21
+
22
+ get $comment() {
23
+ return this.get('$comment');
24
+ }
25
+ set $comment($comment) {
26
+ this.set('$comment', $comment);
27
+ }
28
+
29
+ /**
30
+ * Validation vocabulary
31
+ *
32
+ * URI: https://datatracker.ietf.org/doc/html/draft-handrews-json-schema-validation-01
33
+ */
34
+
35
+ /**
36
+ * Validation keywords for arrays
37
+ */
38
+ get items() {
39
+ return this.get('items');
40
+ }
41
+ set items(items) {
42
+ this.set('items', items);
43
+ }
44
+
45
+ /**
46
+ * Keywords for Applying Subschemas Conditionally
47
+ *
48
+ * URI: https://datatracker.ietf.org/doc/html/draft-handrews-json-schema-validation-01#section-6.6
49
+ */
50
+
51
+ get if() {
52
+ return this.get('if');
53
+ }
54
+ set if(ifValue) {
55
+ this.set('if', ifValue);
56
+ }
57
+ get then() {
58
+ return this.get('then');
59
+ }
60
+ set then(then) {
61
+ this.set('then', then);
62
+ }
63
+ get else() {
64
+ return this.get('else');
65
+ }
66
+ set else(elseValue) {
67
+ this.set('else', elseValue);
68
+ }
69
+
70
+ /**
71
+ * Keywords for Applying Subschemas With Boolean Logic
72
+ *
73
+ * URI: https://datatracker.ietf.org/doc/html/draft-handrews-json-schema-validation-01#section-6.7
74
+ */
75
+
76
+ get not() {
77
+ return this.get('not');
78
+ }
79
+ set not(not) {
80
+ this.set('not', not);
81
+ }
82
+
83
+ /**
84
+ * String-Encoding Non-JSON Data
85
+ *
86
+ * URI: https://datatracker.ietf.org/doc/html/draft-handrews-json-schema-validation-00#section-8
87
+ */
88
+
89
+ get contentEncoding() {
90
+ return this.get('contentEncoding');
91
+ }
92
+ set contentEncoding(contentEncoding) {
93
+ this.set('contentEncoding', contentEncoding);
94
+ }
95
+ get contentMediaType() {
96
+ return this.get('contentMediaType');
97
+ }
98
+ set contentMediaType(contentMediaType) {
99
+ this.set('contentMediaType', contentMediaType);
100
+ }
101
+ get media() {
102
+ throw new _apidomError.UnsupportedOperationError('media keyword from Hyper-Schema vocabulary has been moved to validation vocabulary as "contentMediaType" / "contentEncoding"');
103
+ }
104
+ set media(media) {
105
+ throw new _apidomError.UnsupportedOperationError('media keyword from Hyper-Schema vocabulary has been moved to validation vocabulary as "contentMediaType" / "contentEncoding"');
106
+ }
107
+
108
+ /**
109
+ * Schema annotations
110
+ *
111
+ * URI: https://datatracker.ietf.org/doc/html/draft-handrews-json-schema-validation-01#section-10
112
+ */
113
+
114
+ get writeOnly() {
115
+ return this.get('writeOnly');
116
+ }
117
+ set writeOnly(writeOnly) {
118
+ this.set('writeOnly', writeOnly);
119
+ }
120
+ }
121
+ var _default = exports.default = JSONSchema;
@@ -0,0 +1,118 @@
1
+ import { UnsupportedOperationError } from '@speclynx/apidom-error';
2
+ import { JSONSchemaElement } from '@speclynx/apidom-ns-json-schema-draft-6';
3
+
4
+ /**
5
+ * @public
6
+ */
7
+ class JSONSchema extends JSONSchemaElement {
8
+ constructor(content, meta, attributes) {
9
+ super(content, meta, attributes);
10
+ this.element = 'JSONSchemaDraft7';
11
+ }
12
+
13
+ /**
14
+ * Core vocabulary
15
+ *
16
+ * URI: https://datatracker.ietf.org/doc/html/draft-handrews-json-schema-01
17
+ */
18
+
19
+ get $comment() {
20
+ return this.get('$comment');
21
+ }
22
+ set $comment($comment) {
23
+ this.set('$comment', $comment);
24
+ }
25
+
26
+ /**
27
+ * Validation vocabulary
28
+ *
29
+ * URI: https://datatracker.ietf.org/doc/html/draft-handrews-json-schema-validation-01
30
+ */
31
+
32
+ /**
33
+ * Validation keywords for arrays
34
+ */
35
+ get items() {
36
+ return this.get('items');
37
+ }
38
+ set items(items) {
39
+ this.set('items', items);
40
+ }
41
+
42
+ /**
43
+ * Keywords for Applying Subschemas Conditionally
44
+ *
45
+ * URI: https://datatracker.ietf.org/doc/html/draft-handrews-json-schema-validation-01#section-6.6
46
+ */
47
+
48
+ get if() {
49
+ return this.get('if');
50
+ }
51
+ set if(ifValue) {
52
+ this.set('if', ifValue);
53
+ }
54
+ get then() {
55
+ return this.get('then');
56
+ }
57
+ set then(then) {
58
+ this.set('then', then);
59
+ }
60
+ get else() {
61
+ return this.get('else');
62
+ }
63
+ set else(elseValue) {
64
+ this.set('else', elseValue);
65
+ }
66
+
67
+ /**
68
+ * Keywords for Applying Subschemas With Boolean Logic
69
+ *
70
+ * URI: https://datatracker.ietf.org/doc/html/draft-handrews-json-schema-validation-01#section-6.7
71
+ */
72
+
73
+ get not() {
74
+ return this.get('not');
75
+ }
76
+ set not(not) {
77
+ this.set('not', not);
78
+ }
79
+
80
+ /**
81
+ * String-Encoding Non-JSON Data
82
+ *
83
+ * URI: https://datatracker.ietf.org/doc/html/draft-handrews-json-schema-validation-00#section-8
84
+ */
85
+
86
+ get contentEncoding() {
87
+ return this.get('contentEncoding');
88
+ }
89
+ set contentEncoding(contentEncoding) {
90
+ this.set('contentEncoding', contentEncoding);
91
+ }
92
+ get contentMediaType() {
93
+ return this.get('contentMediaType');
94
+ }
95
+ set contentMediaType(contentMediaType) {
96
+ this.set('contentMediaType', contentMediaType);
97
+ }
98
+ get media() {
99
+ throw new UnsupportedOperationError('media keyword from Hyper-Schema vocabulary has been moved to validation vocabulary as "contentMediaType" / "contentEncoding"');
100
+ }
101
+ set media(media) {
102
+ throw new UnsupportedOperationError('media keyword from Hyper-Schema vocabulary has been moved to validation vocabulary as "contentMediaType" / "contentEncoding"');
103
+ }
104
+
105
+ /**
106
+ * Schema annotations
107
+ *
108
+ * URI: https://datatracker.ietf.org/doc/html/draft-handrews-json-schema-validation-01#section-10
109
+ */
110
+
111
+ get writeOnly() {
112
+ return this.get('writeOnly');
113
+ }
114
+ set writeOnly(writeOnly) {
115
+ this.set('writeOnly', writeOnly);
116
+ }
117
+ }
118
+ export default JSONSchema;
@@ -0,0 +1,138 @@
1
+ "use strict";
2
+
3
+ exports.__esModule = true;
4
+ exports.default = void 0;
5
+ var _apidomError = require("@speclynx/apidom-error");
6
+ var _apidomNsJsonSchemaDraft = require("@speclynx/apidom-ns-json-schema-draft-6");
7
+ /**
8
+ * URI: https://datatracker.ietf.org/doc/html/draft-wright-json-schema-hyperschema-01#section-6
9
+ * @public
10
+ */
11
+
12
+ class LinkDescription extends _apidomNsJsonSchemaDraft.LinkDescriptionElement {
13
+ /**
14
+ * Link context.
15
+ *
16
+ * URI: https://datatracker.ietf.org/doc/html/draft-handrews-json-schema-hyperschema-01#section-6.1
17
+ */
18
+
19
+ get anchor() {
20
+ return this.get('anchor');
21
+ }
22
+ set anchor(anchor) {
23
+ this.set('anchor', anchor);
24
+ }
25
+ get anchorPointer() {
26
+ return this.get('anchorPointer');
27
+ }
28
+ set anchorPointer(anchorPointer) {
29
+ this.set('anchorPointer', anchorPointer);
30
+ }
31
+
32
+ /**
33
+ * Adjusting URI Template Resolution.
34
+ *
35
+ * URI: https://datatracker.ietf.org/doc/html/draft-handrews-json-schema-hyperschema-01#section-6.4
36
+ */
37
+
38
+ get templatePointers() {
39
+ return this.get('templatePointers');
40
+ }
41
+ set templatePointers(templatePointers) {
42
+ this.set('templatePointers', templatePointers);
43
+ }
44
+ get templateRequired() {
45
+ return this.get('templateRequired');
46
+ }
47
+ set templateRequired(templateRequired) {
48
+ this.set('templateRequired', templateRequired);
49
+ }
50
+
51
+ /**
52
+ * Link Target Attributes.
53
+ *
54
+ * URI: https://datatracker.ietf.org/doc/html/draft-handrews-json-schema-hyperschema-01#section-6.5
55
+ */
56
+
57
+ get targetSchema() {
58
+ return this.get('targetSchema');
59
+ }
60
+ set targetSchema(targetSchema) {
61
+ this.set('targetSchema', targetSchema);
62
+ }
63
+ get mediaType() {
64
+ throw new _apidomError.UnsupportedOperationError('mediaType keyword from Hyper-Schema vocabulary has been renamed to targetMediaType.');
65
+ }
66
+ set mediaType(mediaType) {
67
+ throw new _apidomError.UnsupportedOperationError('mediaType keyword from Hyper-Schema vocabulary has been renamed to targetMediaType.');
68
+ }
69
+ get targetMediaType() {
70
+ return this.get('targetMediaType');
71
+ }
72
+ set targetMediaType(targetMediaType) {
73
+ this.set('targetMediaType', targetMediaType);
74
+ }
75
+ get targetHints() {
76
+ return this.get('targetHints');
77
+ }
78
+ set targetHints(targetHints) {
79
+ this.set('targetHints', targetHints);
80
+ }
81
+ get description() {
82
+ return this.get('description');
83
+ }
84
+ set description(description) {
85
+ this.set('description', description);
86
+ }
87
+ get $comment() {
88
+ return this.get('$comment');
89
+ }
90
+ set $comment($comment) {
91
+ this.set('$comment', $comment);
92
+ }
93
+
94
+ /**
95
+ * Link Input.
96
+ *
97
+ * URI: https://datatracker.ietf.org/doc/html/draft-handrews-json-schema-hyperschema-01#section-6.6
98
+ */
99
+
100
+ get hrefSchema() {
101
+ return this.get('hrefSchema');
102
+ }
103
+ set hrefSchema(hrefSchema) {
104
+ this.set('hrefSchema', hrefSchema);
105
+ }
106
+ get headerSchema() {
107
+ return this.get('headerSchema');
108
+ }
109
+ set headerSchema(headerSchema) {
110
+ this.set('headerSchema', headerSchema);
111
+ }
112
+
113
+ /**
114
+ * Submitting Data for Processing.
115
+ *
116
+ * URI: https://datatracker.ietf.org/doc/html/draft-handrews-json-schema-hyperschema-01#section-6.6.4
117
+ */
118
+
119
+ get submissionSchema() {
120
+ return this.get('submissionSchema');
121
+ }
122
+ set submissionSchema(submissionSchema) {
123
+ this.set('submissionSchema', submissionSchema);
124
+ }
125
+ get submissionEncType() {
126
+ throw new _apidomError.UnsupportedOperationError('submissionEncType keyword from Hyper-Schema vocabulary has been renamed to submissionMediaType.');
127
+ }
128
+ set submissionEncType(submissionEncType) {
129
+ throw new _apidomError.UnsupportedOperationError('submissionEncType keyword from Hyper-Schema vocabulary has been renamed to submissionMediaType.');
130
+ }
131
+ get submissionMediaType() {
132
+ return this.get('submissionMediaType');
133
+ }
134
+ set submissionMediaType(submissionMediaType) {
135
+ this.set('submissionMediaType', submissionMediaType);
136
+ }
137
+ }
138
+ var _default = exports.default = LinkDescription;
@@ -0,0 +1,134 @@
1
+ import { UnsupportedOperationError } from '@speclynx/apidom-error';
2
+ import { LinkDescriptionElement } from '@speclynx/apidom-ns-json-schema-draft-6';
3
+ /**
4
+ * URI: https://datatracker.ietf.org/doc/html/draft-wright-json-schema-hyperschema-01#section-6
5
+ * @public
6
+ */
7
+
8
+ class LinkDescription extends LinkDescriptionElement {
9
+ /**
10
+ * Link context.
11
+ *
12
+ * URI: https://datatracker.ietf.org/doc/html/draft-handrews-json-schema-hyperschema-01#section-6.1
13
+ */
14
+
15
+ get anchor() {
16
+ return this.get('anchor');
17
+ }
18
+ set anchor(anchor) {
19
+ this.set('anchor', anchor);
20
+ }
21
+ get anchorPointer() {
22
+ return this.get('anchorPointer');
23
+ }
24
+ set anchorPointer(anchorPointer) {
25
+ this.set('anchorPointer', anchorPointer);
26
+ }
27
+
28
+ /**
29
+ * Adjusting URI Template Resolution.
30
+ *
31
+ * URI: https://datatracker.ietf.org/doc/html/draft-handrews-json-schema-hyperschema-01#section-6.4
32
+ */
33
+
34
+ get templatePointers() {
35
+ return this.get('templatePointers');
36
+ }
37
+ set templatePointers(templatePointers) {
38
+ this.set('templatePointers', templatePointers);
39
+ }
40
+ get templateRequired() {
41
+ return this.get('templateRequired');
42
+ }
43
+ set templateRequired(templateRequired) {
44
+ this.set('templateRequired', templateRequired);
45
+ }
46
+
47
+ /**
48
+ * Link Target Attributes.
49
+ *
50
+ * URI: https://datatracker.ietf.org/doc/html/draft-handrews-json-schema-hyperschema-01#section-6.5
51
+ */
52
+
53
+ get targetSchema() {
54
+ return this.get('targetSchema');
55
+ }
56
+ set targetSchema(targetSchema) {
57
+ this.set('targetSchema', targetSchema);
58
+ }
59
+ get mediaType() {
60
+ throw new UnsupportedOperationError('mediaType keyword from Hyper-Schema vocabulary has been renamed to targetMediaType.');
61
+ }
62
+ set mediaType(mediaType) {
63
+ throw new UnsupportedOperationError('mediaType keyword from Hyper-Schema vocabulary has been renamed to targetMediaType.');
64
+ }
65
+ get targetMediaType() {
66
+ return this.get('targetMediaType');
67
+ }
68
+ set targetMediaType(targetMediaType) {
69
+ this.set('targetMediaType', targetMediaType);
70
+ }
71
+ get targetHints() {
72
+ return this.get('targetHints');
73
+ }
74
+ set targetHints(targetHints) {
75
+ this.set('targetHints', targetHints);
76
+ }
77
+ get description() {
78
+ return this.get('description');
79
+ }
80
+ set description(description) {
81
+ this.set('description', description);
82
+ }
83
+ get $comment() {
84
+ return this.get('$comment');
85
+ }
86
+ set $comment($comment) {
87
+ this.set('$comment', $comment);
88
+ }
89
+
90
+ /**
91
+ * Link Input.
92
+ *
93
+ * URI: https://datatracker.ietf.org/doc/html/draft-handrews-json-schema-hyperschema-01#section-6.6
94
+ */
95
+
96
+ get hrefSchema() {
97
+ return this.get('hrefSchema');
98
+ }
99
+ set hrefSchema(hrefSchema) {
100
+ this.set('hrefSchema', hrefSchema);
101
+ }
102
+ get headerSchema() {
103
+ return this.get('headerSchema');
104
+ }
105
+ set headerSchema(headerSchema) {
106
+ this.set('headerSchema', headerSchema);
107
+ }
108
+
109
+ /**
110
+ * Submitting Data for Processing.
111
+ *
112
+ * URI: https://datatracker.ietf.org/doc/html/draft-handrews-json-schema-hyperschema-01#section-6.6.4
113
+ */
114
+
115
+ get submissionSchema() {
116
+ return this.get('submissionSchema');
117
+ }
118
+ set submissionSchema(submissionSchema) {
119
+ this.set('submissionSchema', submissionSchema);
120
+ }
121
+ get submissionEncType() {
122
+ throw new UnsupportedOperationError('submissionEncType keyword from Hyper-Schema vocabulary has been renamed to submissionMediaType.');
123
+ }
124
+ set submissionEncType(submissionEncType) {
125
+ throw new UnsupportedOperationError('submissionEncType keyword from Hyper-Schema vocabulary has been renamed to submissionMediaType.');
126
+ }
127
+ get submissionMediaType() {
128
+ return this.get('submissionMediaType');
129
+ }
130
+ set submissionMediaType(submissionMediaType) {
131
+ this.set('submissionMediaType', submissionMediaType);
132
+ }
133
+ }
134
+ export default LinkDescription;
package/src/index.cjs ADDED
@@ -0,0 +1,54 @@
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.specificationObj = exports.refractorPluginReplaceEmptyElement = exports.refract = exports.mediaTypes = exports.keyMap = exports.isStringElement = exports.isRefElement = exports.isObjectElement = exports.isNumberElement = exports.isNullElement = exports.isMemberElement = exports.isLinkElement = exports.isLinkDescriptionElement = exports.isJSONSchemaElement = exports.isJSONReferenceLikeElement = exports.isJSONReferenceElement = exports.isElement = exports.isBooleanElement = exports.isArrayElement = exports.getNodeType = exports.default = exports.createRefractor = exports.Visitor = exports.SpecificationVisitor = exports.PatternedFieldsVisitor = exports.ParentSchemaAwareVisitor = exports.MapVisitor = exports.LinkDescriptionVisitor = exports.LinkDescriptionElement = exports.JSONSchemaVisitor = exports.JSONSchemaElement = exports.JSONSchemaDraft7MediaTypes = exports.JSONReferenceElement = exports.FixedFieldsVisitor = exports.FallbackVisitor = exports.AlternatingVisitor = void 0;
7
+ var _apidomCore = require("@speclynx/apidom-core");
8
+ exports.isRefElement = _apidomCore.isRefElement;
9
+ exports.isLinkElement = _apidomCore.isLinkElement;
10
+ exports.isMemberElement = _apidomCore.isMemberElement;
11
+ exports.isObjectElement = _apidomCore.isObjectElement;
12
+ exports.isArrayElement = _apidomCore.isArrayElement;
13
+ exports.isBooleanElement = _apidomCore.isBooleanElement;
14
+ exports.isNullElement = _apidomCore.isNullElement;
15
+ exports.isElement = _apidomCore.isElement;
16
+ exports.isNumberElement = _apidomCore.isNumberElement;
17
+ exports.isStringElement = _apidomCore.isStringElement;
18
+ var _mediaTypes = _interopRequireWildcard(require("./media-types.cjs"));
19
+ exports.mediaTypes = _mediaTypes.default;
20
+ exports.JSONSchemaDraft7MediaTypes = _mediaTypes.JSONSchemaDraft7MediaTypes;
21
+ var _namespace = _interopRequireDefault(require("./namespace.cjs"));
22
+ exports.default = _namespace.default;
23
+ var _replaceEmptyElement = _interopRequireDefault(require("./refractor/plugins/replace-empty-element.cjs"));
24
+ exports.refractorPluginReplaceEmptyElement = _replaceEmptyElement.default;
25
+ var _index = _interopRequireWildcard(require("./refractor/index.cjs"));
26
+ exports.refract = _index.default;
27
+ exports.createRefractor = _index.createRefractor;
28
+ var _specification = _interopRequireDefault(require("./refractor/specification.cjs"));
29
+ exports.specificationObj = _specification.default;
30
+ var _predicates = require("./predicates.cjs");
31
+ exports.isJSONReferenceElement = _predicates.isJSONReferenceElement;
32
+ exports.isJSONSchemaElement = _predicates.isJSONSchemaElement;
33
+ exports.isLinkDescriptionElement = _predicates.isLinkDescriptionElement;
34
+ var _apidomNsJsonSchemaDraft = require("@speclynx/apidom-ns-json-schema-draft-6");
35
+ exports.isJSONReferenceLikeElement = _apidomNsJsonSchemaDraft.isJSONReferenceLikeElement;
36
+ exports.SpecificationVisitor = _apidomNsJsonSchemaDraft.SpecificationVisitor;
37
+ exports.FallbackVisitor = _apidomNsJsonSchemaDraft.FallbackVisitor;
38
+ exports.FixedFieldsVisitor = _apidomNsJsonSchemaDraft.FixedFieldsVisitor;
39
+ exports.PatternedFieldsVisitor = _apidomNsJsonSchemaDraft.PatternedFieldsVisitor;
40
+ exports.MapVisitor = _apidomNsJsonSchemaDraft.MapVisitor;
41
+ exports.AlternatingVisitor = _apidomNsJsonSchemaDraft.AlternatingVisitor;
42
+ exports.ParentSchemaAwareVisitor = _apidomNsJsonSchemaDraft.ParentSchemaAwareVisitor;
43
+ exports.Visitor = _apidomNsJsonSchemaDraft.Visitor;
44
+ exports.JSONReferenceElement = _apidomNsJsonSchemaDraft.JSONReferenceElement;
45
+ var _index2 = _interopRequireDefault(require("./refractor/visitors/json-schema/index.cjs"));
46
+ exports.JSONSchemaVisitor = _index2.default;
47
+ var _index3 = _interopRequireDefault(require("./refractor/visitors/json-schema/link-description/index.cjs"));
48
+ exports.LinkDescriptionVisitor = _index3.default;
49
+ var _visitor = require("./traversal/visitor.cjs");
50
+ exports.keyMap = _visitor.keyMap;
51
+ exports.getNodeType = _visitor.getNodeType;
52
+ var _registration = require("./refractor/registration.cjs");
53
+ exports.JSONSchemaElement = _registration.JSONSchemaElement;
54
+ exports.LinkDescriptionElement = _registration.LinkDescriptionElement;
package/src/index.mjs ADDED
@@ -0,0 +1,16 @@
1
+ export { isRefElement, isLinkElement, isMemberElement, isObjectElement, isArrayElement, isBooleanElement, isNullElement, isElement, isNumberElement, isStringElement } from '@speclynx/apidom-core';
2
+ export { default as mediaTypes, JSONSchemaDraft7MediaTypes } from "./media-types.mjs";
3
+ export { default } from "./namespace.mjs";
4
+ export { default as refractorPluginReplaceEmptyElement } from "./refractor/plugins/replace-empty-element.mjs";
5
+ export { default as refract, createRefractor } from "./refractor/index.mjs";
6
+ export { default as specificationObj } from "./refractor/specification.mjs";
7
+ export { isJSONReferenceElement, isJSONSchemaElement, isLinkDescriptionElement } from "./predicates.mjs";
8
+ export { isJSONReferenceLikeElement, SpecificationVisitor, FallbackVisitor, FixedFieldsVisitor, PatternedFieldsVisitor, MapVisitor, AlternatingVisitor, ParentSchemaAwareVisitor, Visitor } from '@speclynx/apidom-ns-json-schema-draft-6';
9
+ export { default as JSONSchemaVisitor } from "./refractor/visitors/json-schema/index.mjs";
10
+ export { default as LinkDescriptionVisitor } from "./refractor/visitors/json-schema/link-description/index.mjs";
11
+ export { keyMap, getNodeType } from "./traversal/visitor.mjs";
12
+ /**
13
+ * JSON Schema Draft 7 specification elements.
14
+ */
15
+ export { JSONSchemaElement, LinkDescriptionElement } from "./refractor/registration.mjs";
16
+ export { JSONReferenceElement } from '@speclynx/apidom-ns-json-schema-draft-6';
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+
3
+ exports.__esModule = true;
4
+ exports.default = exports.JSONSchemaDraft7MediaTypes = void 0;
5
+ var _ramda = require("ramda");
6
+ var _apidomCore = require("@speclynx/apidom-core");
7
+ /**
8
+ * @public
9
+ */
10
+
11
+ /**
12
+ * @public
13
+ */
14
+ class JSONSchemaDraft7MediaTypes extends _apidomCore.MediaTypes {
15
+ filterByFormat(format = 'generic') {
16
+ const effectiveFormat = format === 'generic' ? 'schema;version' : format;
17
+ return this.filter(mediaType => mediaType.includes(effectiveFormat));
18
+ }
19
+ findBy(version = 'draft-07', format = 'generic') {
20
+ const search = format === 'generic' ? `schema;version=${version}` : `schema+${format};version=${version}`;
21
+ const found = this.find(mediaType => mediaType.includes(search));
22
+ return found || this.unknownMediaType;
23
+ }
24
+ latest(format = 'generic') {
25
+ return (0, _ramda.last)(this.filterByFormat(format));
26
+ }
27
+ }
28
+
29
+ /**
30
+ * @public
31
+ */
32
+ exports.JSONSchemaDraft7MediaTypes = JSONSchemaDraft7MediaTypes;
33
+ const mediaTypes = new JSONSchemaDraft7MediaTypes('application/schema;version=draft-07', 'application/schema+json;version=draft-07', 'application/schema+yaml;version=draft-07');
34
+ var _default = exports.default = mediaTypes;