@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.
- package/CHANGELOG.md +82 -0
- package/LICENSE +202 -0
- package/LICENSES/AFL-3.0.txt +182 -0
- package/LICENSES/Apache-2.0.txt +202 -0
- package/LICENSES/BSD-3-Clause.txt +26 -0
- package/LICENSES/MIT.txt +9 -0
- package/NOTICE +65 -0
- package/README.md +188 -0
- package/dist/apidom-ns-json-schema-draft-7.browser.js +1 -0
- package/package.json +65 -0
- package/src/elements/JSONSchema.cjs +121 -0
- package/src/elements/JSONSchema.mjs +118 -0
- package/src/elements/LinkDescription.cjs +138 -0
- package/src/elements/LinkDescription.mjs +134 -0
- package/src/index.cjs +54 -0
- package/src/index.mjs +16 -0
- package/src/media-types.cjs +34 -0
- package/src/media-types.mjs +30 -0
- package/src/namespace.cjs +23 -0
- package/src/namespace.mjs +18 -0
- package/src/predicates.cjs +31 -0
- package/src/predicates.mjs +26 -0
- package/src/refractor/index.cjs +54 -0
- package/src/refractor/index.mjs +48 -0
- package/src/refractor/plugins/replace-empty-element.cjs +233 -0
- package/src/refractor/plugins/replace-empty-element.mjs +226 -0
- package/src/refractor/registration.cjs +13 -0
- package/src/refractor/registration.mjs +6 -0
- package/src/refractor/specification.cjs +15 -0
- package/src/refractor/specification.mjs +10 -0
- package/src/refractor/toolbox.cjs +21 -0
- package/src/refractor/toolbox.mjs +15 -0
- package/src/refractor/visitors/json-schema/index.cjs +20 -0
- package/src/refractor/visitors/json-schema/index.mjs +15 -0
- package/src/refractor/visitors/json-schema/link-description/index.cjs +17 -0
- package/src/refractor/visitors/json-schema/link-description/index.mjs +12 -0
- package/src/traversal/visitor.cjs +16 -0
- package/src/traversal/visitor.mjs +12 -0
- package/types/apidom-ns-json-schema-draft-7.d.ts +551 -0
|
@@ -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,15 @@
|
|
|
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 _apidomNsJsonSchemaDraft = require("@speclynx/apidom-ns-json-schema-draft-6");
|
|
8
|
+
var _index = _interopRequireDefault(require("./visitors/json-schema/index.cjs"));
|
|
9
|
+
var _index2 = _interopRequireDefault(require("./visitors/json-schema/link-description/index.cjs"));
|
|
10
|
+
const specification = (0, _ramda.pipe)(
|
|
11
|
+
// JSON Schema object modifications
|
|
12
|
+
(0, _ramda.assocPath)(['visitors', 'document', 'objects', 'JSONSchema', '$visitor'], _index.default), (0, _ramda.assocPath)(['visitors', 'document', 'objects', 'JSONSchema', 'fixedFields', '$comment'], _apidomNsJsonSchemaDraft.specificationObj.visitors.value), (0, _ramda.assocPath)(['visitors', 'document', 'objects', 'JSONSchema', 'fixedFields', 'if'], _apidomNsJsonSchemaDraft.specificationObj.visitors.JSONSchemaOrJSONReferenceVisitor), (0, _ramda.assocPath)(['visitors', 'document', 'objects', 'JSONSchema', 'fixedFields', 'then'], _apidomNsJsonSchemaDraft.specificationObj.visitors.JSONSchemaOrJSONReferenceVisitor), (0, _ramda.assocPath)(['visitors', 'document', 'objects', 'JSONSchema', 'fixedFields', 'else'], _apidomNsJsonSchemaDraft.specificationObj.visitors.JSONSchemaOrJSONReferenceVisitor), (0, _ramda.dissocPath)(['visitors', 'document', 'objects', 'JSONSchema', 'fixedFields', 'media']), (0, _ramda.assocPath)(['visitors', 'document', 'objects', 'JSONSchema', 'fixedFields', 'contentEncoding'], _apidomNsJsonSchemaDraft.specificationObj.visitors.value), (0, _ramda.assocPath)(['visitors', 'document', 'objects', 'JSONSchema', 'fixedFields', 'contentMediaType'], _apidomNsJsonSchemaDraft.specificationObj.visitors.value), (0, _ramda.assocPath)(['visitors', 'document', 'objects', 'JSONSchema', 'fixedFields', 'writeOnly'], _apidomNsJsonSchemaDraft.specificationObj.visitors.value),
|
|
13
|
+
// Link Description object modifications
|
|
14
|
+
(0, _ramda.assocPath)(['visitors', 'document', 'objects', 'LinkDescription', '$visitor'], _index2.default), (0, _ramda.assocPath)(['visitors', 'document', 'objects', 'LinkDescription', 'fixedFields', 'anchor'], _apidomNsJsonSchemaDraft.specificationObj.visitors.value), (0, _ramda.assocPath)(['visitors', 'document', 'objects', 'LinkDescription', 'fixedFields', 'anchorPointer'], _apidomNsJsonSchemaDraft.specificationObj.visitors.value), (0, _ramda.dissocPath)(['visitors', 'document', 'objects', 'LinkDescription', 'fixedFields', 'mediaType']), (0, _ramda.assocPath)(['visitors', 'document', 'objects', 'LinkDescription', 'fixedFields', 'targetMediaType'], _apidomNsJsonSchemaDraft.specificationObj.visitors.value), (0, _ramda.assocPath)(['visitors', 'document', 'objects', 'LinkDescription', 'fixedFields', 'targetHints'], _apidomNsJsonSchemaDraft.specificationObj.visitors.value), (0, _ramda.assocPath)(['visitors', 'document', 'objects', 'LinkDescription', 'fixedFields', 'description'], _apidomNsJsonSchemaDraft.specificationObj.visitors.value), (0, _ramda.assocPath)(['visitors', 'document', 'objects', 'LinkDescription', 'fixedFields', '$comment'], _apidomNsJsonSchemaDraft.specificationObj.visitors.value), (0, _ramda.assocPath)(['visitors', 'document', 'objects', 'LinkDescription', 'fixedFields', 'headerSchema'], _apidomNsJsonSchemaDraft.specificationObj.visitors.JSONSchemaOrJSONReferenceVisitor), (0, _ramda.dissocPath)(['visitors', 'document', 'objects', 'LinkDescription', 'fixedFields', 'submissionEncType']), (0, _ramda.assocPath)(['visitors', 'document', 'objects', 'LinkDescription', 'fixedFields', 'submissionMediaType'], _apidomNsJsonSchemaDraft.specificationObj.visitors.value))(_apidomNsJsonSchemaDraft.specificationObj);
|
|
15
|
+
var _default = exports.default = specification;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { pipe, assocPath, dissocPath } from 'ramda';
|
|
2
|
+
import { specificationObj } from '@speclynx/apidom-ns-json-schema-draft-6';
|
|
3
|
+
import JSONSchemaVisitor from "./visitors/json-schema/index.mjs";
|
|
4
|
+
import LinkDescriptionVisitor from "./visitors/json-schema/link-description/index.mjs";
|
|
5
|
+
const specification = pipe(
|
|
6
|
+
// JSON Schema object modifications
|
|
7
|
+
assocPath(['visitors', 'document', 'objects', 'JSONSchema', '$visitor'], JSONSchemaVisitor), assocPath(['visitors', 'document', 'objects', 'JSONSchema', 'fixedFields', '$comment'], specificationObj.visitors.value), assocPath(['visitors', 'document', 'objects', 'JSONSchema', 'fixedFields', 'if'], specificationObj.visitors.JSONSchemaOrJSONReferenceVisitor), assocPath(['visitors', 'document', 'objects', 'JSONSchema', 'fixedFields', 'then'], specificationObj.visitors.JSONSchemaOrJSONReferenceVisitor), assocPath(['visitors', 'document', 'objects', 'JSONSchema', 'fixedFields', 'else'], specificationObj.visitors.JSONSchemaOrJSONReferenceVisitor), dissocPath(['visitors', 'document', 'objects', 'JSONSchema', 'fixedFields', 'media']), assocPath(['visitors', 'document', 'objects', 'JSONSchema', 'fixedFields', 'contentEncoding'], specificationObj.visitors.value), assocPath(['visitors', 'document', 'objects', 'JSONSchema', 'fixedFields', 'contentMediaType'], specificationObj.visitors.value), assocPath(['visitors', 'document', 'objects', 'JSONSchema', 'fixedFields', 'writeOnly'], specificationObj.visitors.value),
|
|
8
|
+
// Link Description object modifications
|
|
9
|
+
assocPath(['visitors', 'document', 'objects', 'LinkDescription', '$visitor'], LinkDescriptionVisitor), assocPath(['visitors', 'document', 'objects', 'LinkDescription', 'fixedFields', 'anchor'], specificationObj.visitors.value), assocPath(['visitors', 'document', 'objects', 'LinkDescription', 'fixedFields', 'anchorPointer'], specificationObj.visitors.value), dissocPath(['visitors', 'document', 'objects', 'LinkDescription', 'fixedFields', 'mediaType']), assocPath(['visitors', 'document', 'objects', 'LinkDescription', 'fixedFields', 'targetMediaType'], specificationObj.visitors.value), assocPath(['visitors', 'document', 'objects', 'LinkDescription', 'fixedFields', 'targetHints'], specificationObj.visitors.value), assocPath(['visitors', 'document', 'objects', 'LinkDescription', 'fixedFields', 'description'], specificationObj.visitors.value), assocPath(['visitors', 'document', 'objects', 'LinkDescription', 'fixedFields', '$comment'], specificationObj.visitors.value), assocPath(['visitors', 'document', 'objects', 'LinkDescription', 'fixedFields', 'headerSchema'], specificationObj.visitors.JSONSchemaOrJSONReferenceVisitor), dissocPath(['visitors', 'document', 'objects', 'LinkDescription', 'fixedFields', 'submissionEncType']), assocPath(['visitors', 'document', 'objects', 'LinkDescription', 'fixedFields', 'submissionMediaType'], specificationObj.visitors.value))(specificationObj);
|
|
10
|
+
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 jsonSchemaDraft7Predicates = _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
|
+
...jsonSchemaDraft7Predicates,
|
|
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 jsonSchemaDraft7Predicates from "../predicates.mjs";
|
|
3
|
+
import jsonSchemaDraft7Namespace from "../namespace.mjs";
|
|
4
|
+
const createToolbox = () => {
|
|
5
|
+
const namespace = createNamespace(jsonSchemaDraft7Namespace);
|
|
6
|
+
const predicates = {
|
|
7
|
+
...jsonSchemaDraft7Predicates,
|
|
8
|
+
isStringElement
|
|
9
|
+
};
|
|
10
|
+
return {
|
|
11
|
+
predicates,
|
|
12
|
+
namespace
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
export default createToolbox;
|
|
@@ -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 _apidomNsJsonSchemaDraft = require("@speclynx/apidom-ns-json-schema-draft-6");
|
|
7
|
+
var _JSONSchema = _interopRequireDefault(require("../../../elements/JSONSchema.cjs"));
|
|
8
|
+
/**
|
|
9
|
+
* @public
|
|
10
|
+
*/
|
|
11
|
+
class JSONSchemaVisitor extends _apidomNsJsonSchemaDraft.JSONSchemaVisitor {
|
|
12
|
+
constructor(options) {
|
|
13
|
+
super(options);
|
|
14
|
+
this.element = new _JSONSchema.default();
|
|
15
|
+
}
|
|
16
|
+
get defaultDialectIdentifier() {
|
|
17
|
+
return 'http://json-schema.org/draft-07/schema#';
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
var _default = exports.default = JSONSchemaVisitor;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { JSONSchemaVisitor as JSONSchemaDraft6Visitor } from '@speclynx/apidom-ns-json-schema-draft-6';
|
|
2
|
+
import JSONSchemaElement from "../../../elements/JSONSchema.mjs";
|
|
3
|
+
/**
|
|
4
|
+
* @public
|
|
5
|
+
*/
|
|
6
|
+
class JSONSchemaVisitor extends JSONSchemaDraft6Visitor {
|
|
7
|
+
constructor(options) {
|
|
8
|
+
super(options);
|
|
9
|
+
this.element = new JSONSchemaElement();
|
|
10
|
+
}
|
|
11
|
+
get defaultDialectIdentifier() {
|
|
12
|
+
return 'http://json-schema.org/draft-07/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 _apidomNsJsonSchemaDraft = require("@speclynx/apidom-ns-json-schema-draft-6");
|
|
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 JSONSchemaDraft6LinkDescriptionVisitor } from '@speclynx/apidom-ns-json-schema-draft-6';
|
|
2
|
+
import LinkDescriptionElement from "../../../../elements/LinkDescription.mjs";
|
|
3
|
+
/**
|
|
4
|
+
* @public
|
|
5
|
+
*/
|
|
6
|
+
class LinkDescriptionVisitor extends JSONSchemaDraft6LinkDescriptionVisitor {
|
|
7
|
+
constructor(options) {
|
|
8
|
+
super(options);
|
|
9
|
+
this.element = new LinkDescriptionElement();
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
export default LinkDescriptionVisitor;
|
|
@@ -0,0 +1,16 @@
|
|
|
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-6");
|
|
7
|
+
exports.getNodeType = _apidomNsJsonSchemaDraft.getNodeType;
|
|
8
|
+
/**
|
|
9
|
+
* @public
|
|
10
|
+
*/
|
|
11
|
+
const keyMap = exports.keyMap = {
|
|
12
|
+
JSONSchemaDraft7Element: ['content'],
|
|
13
|
+
JSONReferenceElement: ['content'],
|
|
14
|
+
LinkDescriptionElement: ['content'],
|
|
15
|
+
..._apidomCore.keyMap
|
|
16
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { keyMap as keyMapBase } from '@speclynx/apidom-core';
|
|
2
|
+
export { getNodeType } from '@speclynx/apidom-ns-json-schema-draft-6';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* @public
|
|
6
|
+
*/
|
|
7
|
+
export const keyMap = {
|
|
8
|
+
JSONSchemaDraft7Element: ['content'],
|
|
9
|
+
JSONReferenceElement: ['content'],
|
|
10
|
+
LinkDescriptionElement: ['content'],
|
|
11
|
+
...keyMapBase
|
|
12
|
+
};
|