@swagger-api/apidom-ns-api-design-systems 0.76.1 → 0.77.0
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/cjs/elements/Info.cjs +1 -2
- package/cjs/elements/Main.cjs +1 -2
- package/cjs/elements/Principle.cjs +1 -2
- package/cjs/elements/Requirement.cjs +1 -2
- package/cjs/elements/RequirementLevel.cjs +1 -2
- package/cjs/elements/Scenario.cjs +1 -2
- package/cjs/elements/Standard.cjs +1 -2
- package/cjs/elements/StandardIdentifier.cjs +1 -2
- package/cjs/index.cjs +3 -4
- package/cjs/media-types.cjs +1 -2
- package/cjs/namespace.cjs +2 -3
- package/cjs/predicates.cjs +10 -18
- package/cjs/refractor/index.cjs +2 -3
- package/cjs/refractor/plugins/openapi-3-1/standard-identifier-accessors.cjs +14 -19
- package/cjs/refractor/plugins/openapi-3-1/standard-identifier-selectors.cjs +10 -14
- package/cjs/refractor/registration.cjs +1 -1
- package/cjs/refractor/specification.cjs +2 -3
- package/cjs/refractor/toolbox.cjs +3 -5
- package/cjs/refractor/visitors/FallbackVisitor.cjs +3 -4
- package/cjs/refractor/visitors/SpecificationVisitor.cjs +3 -4
- package/cjs/refractor/visitors/Visitor.cjs +2 -3
- package/cjs/refractor/visitors/api-design-systems/info/DescriptionVisitor.cjs +2 -3
- package/cjs/refractor/visitors/api-design-systems/info/TitleVisitor.cjs +2 -3
- package/cjs/refractor/visitors/api-design-systems/info/index.cjs +2 -3
- package/cjs/refractor/visitors/api-design-systems/main/PrinciplesVisitor.cjs +2 -3
- package/cjs/refractor/visitors/api-design-systems/main/ScenariosVisitor.cjs +2 -3
- package/cjs/refractor/visitors/api-design-systems/main/StandardsVisitor.cjs +2 -3
- package/cjs/refractor/visitors/api-design-systems/main/VersionVisitor.cjs +2 -3
- package/cjs/refractor/visitors/api-design-systems/main/index.cjs +2 -3
- package/cjs/refractor/visitors/api-design-systems/principle/DescriptionVisitor.cjs +2 -3
- package/cjs/refractor/visitors/api-design-systems/principle/IriVisitor.cjs +2 -3
- package/cjs/refractor/visitors/api-design-systems/principle/NameVisitor.cjs +2 -3
- package/cjs/refractor/visitors/api-design-systems/principle/index.cjs +2 -3
- package/cjs/refractor/visitors/api-design-systems/requirement/FollowsVisitor.cjs +2 -3
- package/cjs/refractor/visitors/api-design-systems/requirement/ValuesVisitor.cjs +2 -3
- package/cjs/refractor/visitors/api-design-systems/requirement/index.cjs +2 -3
- package/cjs/refractor/visitors/api-design-systems/requirement-level/index.cjs +3 -4
- package/cjs/refractor/visitors/api-design-systems/scenario/DescriptionVisitor.cjs +2 -3
- package/cjs/refractor/visitors/api-design-systems/scenario/ThenVisitor.cjs +2 -3
- package/cjs/refractor/visitors/api-design-systems/scenario/index.cjs +2 -3
- package/cjs/refractor/visitors/api-design-systems/standard/DescriptionVisitor.cjs +2 -3
- package/cjs/refractor/visitors/api-design-systems/standard/IriVisitor.cjs +2 -3
- package/cjs/refractor/visitors/api-design-systems/standard/NameVisitor.cjs +2 -3
- package/cjs/refractor/visitors/api-design-systems/standard/index.cjs +2 -3
- package/cjs/refractor/visitors/api-design-systems/standard-identifier/index.cjs +2 -3
- package/cjs/refractor/visitors/generics/FixedFieldsVisitor.cjs +7 -8
- package/cjs/traversal/visitor.cjs +2 -3
- package/cjs/validator/openapi-3-1/accessor.cjs +3 -4
- package/cjs/validator/openapi-3-1/selector.cjs +5 -6
- package/cjs/validator/openapi-3-1/validator.cjs +9 -10
- package/dist/apidom-ns-api-design-systems.browser.js +17245 -18958
- package/dist/apidom-ns-api-design-systems.browser.min.js +1 -1
- package/es/{index.js → index.mjs} +8 -8
- package/es/{namespace.js → namespace.mjs} +8 -8
- package/es/{predicates.js → predicates.mjs} +8 -8
- package/es/refractor/{index.js → index.mjs} +6 -8
- package/es/refractor/plugins/openapi-3-1/{standard-identifier-accessors.js → standard-identifier-accessors.mjs} +14 -18
- package/es/refractor/plugins/openapi-3-1/{standard-identifier-selectors.js → standard-identifier-selectors.mjs} +9 -12
- package/es/refractor/{registration.js → registration.mjs} +9 -9
- package/es/refractor/{specification.js → specification.mjs} +25 -25
- package/es/refractor/toolbox.mjs +15 -0
- package/es/refractor/visitors/{FallbackVisitor.js → FallbackVisitor.mjs} +3 -3
- package/es/refractor/visitors/{SpecificationVisitor.js → SpecificationVisitor.mjs} +12 -12
- package/es/refractor/visitors/api-design-systems/info/DescriptionVisitor.mjs +3 -0
- package/es/refractor/visitors/api-design-systems/info/TitleVisitor.mjs +3 -0
- package/es/refractor/visitors/api-design-systems/info/{index.js → index.mjs} +3 -3
- package/es/refractor/visitors/api-design-systems/main/{PrinciplesVisitor.js → PrinciplesVisitor.mjs} +2 -2
- package/es/refractor/visitors/api-design-systems/main/{ScenariosVisitor.js → ScenariosVisitor.mjs} +2 -2
- package/es/refractor/visitors/api-design-systems/main/{StandardsVisitor.js → StandardsVisitor.mjs} +2 -2
- package/es/refractor/visitors/api-design-systems/main/VersionVisitor.mjs +3 -0
- package/es/refractor/visitors/api-design-systems/main/{index.js → index.mjs} +3 -3
- package/es/refractor/visitors/api-design-systems/principle/DescriptionVisitor.mjs +3 -0
- package/es/refractor/visitors/api-design-systems/principle/IriVisitor.mjs +3 -0
- package/es/refractor/visitors/api-design-systems/principle/NameVisitor.mjs +3 -0
- package/es/refractor/visitors/api-design-systems/principle/{index.js → index.mjs} +3 -3
- package/es/refractor/visitors/api-design-systems/requirement/FollowsVisitor.mjs +3 -0
- package/es/refractor/visitors/api-design-systems/requirement/ValuesVisitor.mjs +3 -0
- package/es/refractor/visitors/api-design-systems/requirement/{index.js → index.mjs} +3 -3
- package/es/refractor/visitors/api-design-systems/requirement-level/{index.js → index.mjs} +5 -5
- package/es/refractor/visitors/api-design-systems/scenario/DescriptionVisitor.mjs +3 -0
- package/es/refractor/visitors/api-design-systems/scenario/{ThenVisitor.js → ThenVisitor.mjs} +2 -2
- package/es/refractor/visitors/api-design-systems/scenario/{index.js → index.mjs} +3 -3
- package/es/refractor/visitors/api-design-systems/standard/DescriptionVisitor.mjs +3 -0
- package/es/refractor/visitors/api-design-systems/standard/IriVisitor.mjs +3 -0
- package/es/refractor/visitors/api-design-systems/standard/NameVisitor.mjs +3 -0
- package/es/refractor/visitors/api-design-systems/standard/{index.js → index.mjs} +3 -3
- package/es/refractor/visitors/api-design-systems/standard-identifier/{index.js → index.mjs} +3 -3
- package/es/refractor/visitors/generics/{FixedFieldsVisitor.js → FixedFieldsVisitor.mjs} +7 -7
- package/es/traversal/visitor.mjs +23 -0
- package/es/validator/openapi-3-1/{accessor.js → accessor.mjs} +3 -3
- package/es/validator/openapi-3-1/{selector.js → selector.mjs} +5 -5
- package/es/validator/openapi-3-1/{validator.js → validator.mjs} +11 -11
- package/package.json +9 -9
- package/es/refractor/toolbox.js +0 -17
- package/es/refractor/visitors/api-design-systems/info/DescriptionVisitor.js +0 -3
- package/es/refractor/visitors/api-design-systems/info/TitleVisitor.js +0 -3
- package/es/refractor/visitors/api-design-systems/main/VersionVisitor.js +0 -3
- package/es/refractor/visitors/api-design-systems/principle/DescriptionVisitor.js +0 -3
- package/es/refractor/visitors/api-design-systems/principle/IriVisitor.js +0 -3
- package/es/refractor/visitors/api-design-systems/principle/NameVisitor.js +0 -3
- package/es/refractor/visitors/api-design-systems/requirement/FollowsVisitor.js +0 -3
- package/es/refractor/visitors/api-design-systems/requirement/ValuesVisitor.js +0 -3
- package/es/refractor/visitors/api-design-systems/scenario/DescriptionVisitor.js +0 -3
- package/es/refractor/visitors/api-design-systems/standard/DescriptionVisitor.js +0 -3
- package/es/refractor/visitors/api-design-systems/standard/IriVisitor.js +0 -3
- package/es/refractor/visitors/api-design-systems/standard/NameVisitor.js +0 -3
- package/es/traversal/visitor.js +0 -25
- /package/es/elements/{Info.js → Info.mjs} +0 -0
- /package/es/elements/{Main.js → Main.mjs} +0 -0
- /package/es/elements/{Principle.js → Principle.mjs} +0 -0
- /package/es/elements/{Requirement.js → Requirement.mjs} +0 -0
- /package/es/elements/{RequirementLevel.js → RequirementLevel.mjs} +0 -0
- /package/es/elements/{Scenario.js → Scenario.mjs} +0 -0
- /package/es/elements/{Standard.js → Standard.mjs} +0 -0
- /package/es/elements/{StandardIdentifier.js → StandardIdentifier.mjs} +0 -0
- /package/es/{media-types.js → media-types.mjs} +0 -0
- /package/es/refractor/visitors/{Visitor.js → Visitor.mjs} +0 -0
- /package/es/validator/openapi-3-1/{requirement-level.js → requirement-level.mjs} +0 -0
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
export { isRefElement, isLinkElement, isMemberElement, isObjectElement, isArrayElement, isBooleanElement, isNullElement, isElement, isNumberElement, isStringElement } from '@swagger-api/apidom-core';
|
|
2
|
-
export { default as mediaTypes, ApiDesignSystemsMediaTypes } from "./media-types.
|
|
3
|
-
export { default } from "./namespace.
|
|
4
|
-
export { default as refractPluginOpenApi3_1StandardIdentifierSelectors } from "./refractor/plugins/openapi-3-1/standard-identifier-selectors.
|
|
5
|
-
export { default as refractPluginOpenApi3_1StandardIdentifierAccessors } from "./refractor/plugins/openapi-3-1/standard-identifier-accessors.
|
|
6
|
-
export { default as validateOpenAPI3_1 } from "./validator/openapi-3-1/validator.
|
|
7
|
-
export { isInfoElement, isMainElement, isPrincipleElement, isRequirementElement, isRequirementLevelElement, isScenarioElement, isStandardElement, isStandardIdentifierElement } from "./predicates.
|
|
8
|
-
export { keyMap, getNodeType } from "./traversal/visitor.
|
|
2
|
+
export { default as mediaTypes, ApiDesignSystemsMediaTypes } from "./media-types.mjs"; // eslint-disable-next-line no-restricted-exports
|
|
3
|
+
export { default } from "./namespace.mjs";
|
|
4
|
+
export { default as refractPluginOpenApi3_1StandardIdentifierSelectors } from "./refractor/plugins/openapi-3-1/standard-identifier-selectors.mjs";
|
|
5
|
+
export { default as refractPluginOpenApi3_1StandardIdentifierAccessors } from "./refractor/plugins/openapi-3-1/standard-identifier-accessors.mjs";
|
|
6
|
+
export { default as validateOpenAPI3_1 } from "./validator/openapi-3-1/validator.mjs";
|
|
7
|
+
export { isInfoElement, isMainElement, isPrincipleElement, isRequirementElement, isRequirementLevelElement, isScenarioElement, isStandardElement, isStandardIdentifierElement } from "./predicates.mjs";
|
|
8
|
+
export { keyMap, getNodeType } from "./traversal/visitor.mjs";
|
|
9
9
|
/**
|
|
10
10
|
* API Design Systems 2021-05-07 specification elements.
|
|
11
11
|
*/
|
|
12
|
-
export { MainElement, InfoElement, PrincipleElement, RequirementElement, RequirementLevelElement, ScenarioElement, StandardElement, StandardIdentifierElement } from "./refractor/registration.
|
|
12
|
+
export { MainElement, InfoElement, PrincipleElement, RequirementElement, RequirementLevelElement, ScenarioElement, StandardElement, StandardIdentifierElement } from "./refractor/registration.mjs";
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* API Design Systems 2021-05-07 specification elements.
|
|
3
3
|
*/
|
|
4
|
-
import InfoElement from "./elements/Info.
|
|
5
|
-
import MainElement from "./elements/Main.
|
|
6
|
-
import PrincipleElement from "./elements/Principle.
|
|
7
|
-
import RequirementElement from "./elements/Requirement.
|
|
8
|
-
import RequirementLevelElement from "./elements/RequirementLevel.
|
|
9
|
-
import ScenarioElement from "./elements/Scenario.
|
|
10
|
-
import StandardElement from "./elements/Standard.
|
|
11
|
-
import StandardIdentifierElement from "./elements/StandardIdentifier.
|
|
4
|
+
import InfoElement from "./elements/Info.mjs";
|
|
5
|
+
import MainElement from "./elements/Main.mjs";
|
|
6
|
+
import PrincipleElement from "./elements/Principle.mjs";
|
|
7
|
+
import RequirementElement from "./elements/Requirement.mjs";
|
|
8
|
+
import RequirementLevelElement from "./elements/RequirementLevel.mjs";
|
|
9
|
+
import ScenarioElement from "./elements/Scenario.mjs";
|
|
10
|
+
import StandardElement from "./elements/Standard.mjs";
|
|
11
|
+
import StandardIdentifierElement from "./elements/StandardIdentifier.mjs";
|
|
12
12
|
const apiDesignSystems = {
|
|
13
13
|
namespace: options => {
|
|
14
14
|
const {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { createPredicate } from '@swagger-api/apidom-core';
|
|
2
|
-
import MainElement from "./elements/Main.
|
|
3
|
-
import InfoElement from "./elements/Info.
|
|
4
|
-
import PrincipleElement from "./elements/Principle.
|
|
5
|
-
import RequirementElement from "./elements/Requirement.
|
|
6
|
-
import RequirementLevelElement from "./elements/RequirementLevel.
|
|
7
|
-
import ScenarioElement from "./elements/Scenario.
|
|
8
|
-
import StandardElement from "./elements/Standard.
|
|
9
|
-
import StandardIdentifierElement from "./elements/StandardIdentifier.
|
|
2
|
+
import MainElement from "./elements/Main.mjs";
|
|
3
|
+
import InfoElement from "./elements/Info.mjs";
|
|
4
|
+
import PrincipleElement from "./elements/Principle.mjs";
|
|
5
|
+
import RequirementElement from "./elements/Requirement.mjs";
|
|
6
|
+
import RequirementLevelElement from "./elements/RequirementLevel.mjs";
|
|
7
|
+
import ScenarioElement from "./elements/Scenario.mjs";
|
|
8
|
+
import StandardElement from "./elements/Standard.mjs";
|
|
9
|
+
import StandardIdentifierElement from "./elements/StandardIdentifier.mjs";
|
|
10
10
|
export const isMainElement = createPredicate(({
|
|
11
11
|
hasBasicElementProps,
|
|
12
12
|
isElementType,
|
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
import _defineProperty from "@babel/runtime-corejs3/helpers/esm/defineProperty";
|
|
2
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
1
|
import { visit, dereference, refract as baseRefract, dispatchRefractorPlugins } from '@swagger-api/apidom-core';
|
|
5
2
|
import { invokeArgs } from 'ramda-adjunct';
|
|
6
|
-
import specification from "./specification.
|
|
7
|
-
import { keyMap, getNodeType } from "../traversal/visitor.
|
|
8
|
-
import createToolbox from "./toolbox.
|
|
3
|
+
import specification from "./specification.mjs";
|
|
4
|
+
import { keyMap, getNodeType } from "../traversal/visitor.mjs";
|
|
5
|
+
import createToolbox from "./toolbox.mjs";
|
|
9
6
|
const refract = (value, {
|
|
10
7
|
specPath = ['visitors', 'document', 'objects', 'Main', '$visitor'],
|
|
11
8
|
plugins = []
|
|
@@ -37,7 +34,8 @@ const refract = (value, {
|
|
|
37
34
|
}
|
|
38
35
|
});
|
|
39
36
|
};
|
|
40
|
-
export const createRefractor = specPath => (value, options = {}) => refract(value,
|
|
37
|
+
export const createRefractor = specPath => (value, options = {}) => refract(value, {
|
|
38
|
+
...options,
|
|
41
39
|
specPath
|
|
42
|
-
})
|
|
40
|
+
});
|
|
43
41
|
export default refract;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { StringElement } from '@swagger-api/apidom-core';
|
|
1
|
+
import { StringElement, toValue, cloneDeep } from '@swagger-api/apidom-core';
|
|
2
2
|
import { isStringElement, isArrayElement, isObjectElement } from '@swagger-api/apidom-ns-openapi-3-1';
|
|
3
3
|
const plugin = () => () => {
|
|
4
4
|
return {
|
|
@@ -6,8 +6,8 @@ const plugin = () => () => {
|
|
|
6
6
|
OperationElement(element, ...rest) {
|
|
7
7
|
const [,,, ancestors] = rest;
|
|
8
8
|
const parentPathItem = ancestors[ancestors.length - 2];
|
|
9
|
-
const httpMethod = element.meta.get('http-method')
|
|
10
|
-
httpMethod.content =
|
|
9
|
+
const httpMethod = cloneDeep(element.meta.get('http-method'));
|
|
10
|
+
httpMethod.content = toValue(httpMethod).toLowerCase();
|
|
11
11
|
const standardIdentifiers = [{
|
|
12
12
|
subject: ['http', 'request', 'url'],
|
|
13
13
|
value: parentPathItem.meta.get('path')
|
|
@@ -18,16 +18,14 @@ const plugin = () => () => {
|
|
|
18
18
|
if (typeof parentPathItem.parameters !== 'undefined' && isArrayElement(parentPathItem.parameters)) {
|
|
19
19
|
// @ts-ignore
|
|
20
20
|
parentPathItem.parameters.forEach(parameter => {
|
|
21
|
-
|
|
22
|
-
if (isStringElement(parameter.in) && isStringElement(parameter.name) && ((_parameter$in = parameter.in) === null || _parameter$in === void 0 ? void 0 : _parameter$in.toValue()) === 'header') {
|
|
23
|
-
var _parameter$name, _parameter$name2;
|
|
21
|
+
if (isStringElement(parameter.in) && isStringElement(parameter.name) && toValue(parameter.in) === 'header') {
|
|
24
22
|
standardIdentifiers.push({
|
|
25
23
|
subject: ['http', 'request', 'header'],
|
|
26
|
-
value: (
|
|
24
|
+
value: cloneDeep.safe(parameter.name)
|
|
27
25
|
});
|
|
28
26
|
standardIdentifiers.push({
|
|
29
27
|
subject: ['http', 'message', 'header'],
|
|
30
|
-
value: (
|
|
28
|
+
value: cloneDeep.safe(parameter.name)
|
|
31
29
|
});
|
|
32
30
|
}
|
|
33
31
|
});
|
|
@@ -35,15 +33,13 @@ const plugin = () => () => {
|
|
|
35
33
|
element.setMetaProperty('ads-a-standard-identifier', standardIdentifiers);
|
|
36
34
|
},
|
|
37
35
|
ParameterElement(element) {
|
|
38
|
-
|
|
39
|
-
if (isStringElement(element.in) && isStringElement(element.name) && ((_element$in = element.in) === null || _element$in === void 0 ? void 0 : _element$in.toValue()) === 'header') {
|
|
40
|
-
var _element$name, _element$name2;
|
|
36
|
+
if (isStringElement(element.in) && isStringElement(element.name) && toValue(element.in) === 'header') {
|
|
41
37
|
element.setMetaProperty('ads-a-standard-identifier', [{
|
|
42
38
|
subject: ['http', 'request', 'header'],
|
|
43
|
-
value: (
|
|
39
|
+
value: cloneDeep.safe(element.name)
|
|
44
40
|
}, {
|
|
45
41
|
subject: ['http', 'message', 'header'],
|
|
46
|
-
value: (
|
|
42
|
+
value: cloneDeep.safe(element.name)
|
|
47
43
|
}]);
|
|
48
44
|
}
|
|
49
45
|
},
|
|
@@ -55,16 +51,16 @@ const plugin = () => () => {
|
|
|
55
51
|
element.contentProp.forEach((mediaType, key) => {
|
|
56
52
|
standardIdentifiers.push({
|
|
57
53
|
subject: ['http', 'request', 'header'],
|
|
58
|
-
value: new StringElement('Content-Type', key.meta
|
|
54
|
+
value: new StringElement('Content-Type', cloneDeep(key.meta))
|
|
59
55
|
}, {
|
|
60
56
|
subject: ['http', 'message', 'header'],
|
|
61
|
-
value: new StringElement('Content-Type', key.meta
|
|
57
|
+
value: new StringElement('Content-Type', cloneDeep(key.meta))
|
|
62
58
|
}, {
|
|
63
59
|
subject: ['http', 'request', 'header', 'Content-Type'],
|
|
64
|
-
value: key
|
|
60
|
+
value: cloneDeep(key)
|
|
65
61
|
}, {
|
|
66
62
|
subject: ['http', 'message', 'header', 'Content-Type'],
|
|
67
|
-
value: key
|
|
63
|
+
value: cloneDeep(key)
|
|
68
64
|
});
|
|
69
65
|
});
|
|
70
66
|
element.setMetaProperty('ads-a-standard-identifier', standardIdentifiers);
|
|
@@ -73,7 +69,7 @@ const plugin = () => () => {
|
|
|
73
69
|
if (!element.meta.hasKey('http-status-code')) return;
|
|
74
70
|
const standardIdentifiers = [{
|
|
75
71
|
subject: ['http', 'response', 'status_code'],
|
|
76
|
-
value: element.meta.get('http-status-code')
|
|
72
|
+
value: cloneDeep(element.meta.get('http-status-code'))
|
|
77
73
|
}];
|
|
78
74
|
element.setMetaProperty('ads-a-standard-identifier', standardIdentifiers);
|
|
79
75
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { toValue } from '@swagger-api/apidom-core';
|
|
1
2
|
import { isStringElement, isObjectElement } from '@swagger-api/apidom-ns-openapi-3-1';
|
|
2
3
|
const plugin = () => () => {
|
|
3
4
|
let operationIdentifiers = [];
|
|
@@ -9,15 +10,13 @@ const plugin = () => () => {
|
|
|
9
10
|
var _parentPathItem$param;
|
|
10
11
|
const [,,, ancestors] = rest;
|
|
11
12
|
const parentPathItem = ancestors[ancestors.length - 2];
|
|
12
|
-
operationIdentifiers.push(['http', 'transaction'], ['http', 'request'], ['http', 'request', 'url'], ['http', 'request', 'url', parentPathItem.meta.get('path')
|
|
13
|
+
operationIdentifiers.push(['http', 'transaction'], ['http', 'request'], ['http', 'request', 'url'], ['http', 'request', 'url', toValue(parentPathItem.meta.get('path'))], ['http', 'request', 'method'], ['http', 'request', 'method', toValue(element.meta.get('http-method')).toLowerCase()]);
|
|
13
14
|
|
|
14
15
|
// fold PathItem.parameters to Operation.parameters
|
|
15
16
|
// @ts-ignore
|
|
16
17
|
parentPathItem === null || parentPathItem === void 0 || (_parentPathItem$param = parentPathItem.parameters) === null || _parentPathItem$param === void 0 || _parentPathItem$param.forEach(parameter => {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
var _parameter$name, _parameter$name2;
|
|
20
|
-
operationIdentifiers.push(['http', 'request', 'header'], ['http', 'request', 'header', (_parameter$name = parameter.name) === null || _parameter$name === void 0 ? void 0 : _parameter$name.toValue()], ['http', 'message', 'header'], ['http', 'message', 'header', (_parameter$name2 = parameter.name) === null || _parameter$name2 === void 0 ? void 0 : _parameter$name2.toValue()]);
|
|
18
|
+
if (isStringElement(parameter.in) && isStringElement(parameter.name) && toValue(parameter.in) === 'header') {
|
|
19
|
+
operationIdentifiers.push(['http', 'request', 'header'], ['http', 'request', 'header', toValue(parameter.name)], ['http', 'message', 'header'], ['http', 'message', 'header', toValue(parameter.name)]);
|
|
21
20
|
}
|
|
22
21
|
});
|
|
23
22
|
},
|
|
@@ -27,10 +26,8 @@ const plugin = () => () => {
|
|
|
27
26
|
}
|
|
28
27
|
},
|
|
29
28
|
ParameterElement(element) {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
var _element$name, _element$name2;
|
|
33
|
-
operationIdentifiers.push(['http', 'request', 'header'], ['http', 'request', 'header', (_element$name = element.name) === null || _element$name === void 0 ? void 0 : _element$name.toValue()], ['http', 'message', 'header'], ['http', 'message', 'header', (_element$name2 = element.name) === null || _element$name2 === void 0 ? void 0 : _element$name2.toValue()]);
|
|
29
|
+
if (isStringElement(element.in) && isStringElement(element.name) && toValue(element.in) === 'header') {
|
|
30
|
+
operationIdentifiers.push(['http', 'request', 'header'], ['http', 'request', 'header', toValue(element.name)], ['http', 'message', 'header'], ['http', 'message', 'header', toValue(element.name)]);
|
|
34
31
|
}
|
|
35
32
|
},
|
|
36
33
|
RequestBodyElement(element) {
|
|
@@ -46,20 +43,20 @@ const plugin = () => () => {
|
|
|
46
43
|
enter(element) {
|
|
47
44
|
responseIdentifiers.push(['http', 'response']);
|
|
48
45
|
if (element.meta.hasKey('http-status-code')) {
|
|
49
|
-
const statusCode = String(element.meta.get('http-status-code')
|
|
46
|
+
const statusCode = String(toValue(element.meta.get('http-status-code')));
|
|
50
47
|
const statusCodeAlias = statusCode.startsWith('2') ? 'success' : statusCode.startsWith('3') ? 'redirect' : statusCode.startsWith('4') ? 'client_error' : statusCode.startsWith('5') ? 'sever_error' : 'unknown';
|
|
51
48
|
responseIdentifiers.push(['http', 'response', 'status_code'], ['http', 'response', 'status_code', statusCode], ['http', 'response', 'status_code', statusCodeAlias]);
|
|
52
49
|
}
|
|
53
50
|
if (typeof element.headers !== 'undefined' && isObjectElement(element.headers)) {
|
|
54
51
|
element.headers.forEach((value, key) => {
|
|
55
|
-
const headerName =
|
|
52
|
+
const headerName = toValue(key);
|
|
56
53
|
responseIdentifiers.push(['http', 'response', 'header'], ['http', 'response', 'header', headerName], ['http', 'message', 'header', headerName]);
|
|
57
54
|
});
|
|
58
55
|
}
|
|
59
56
|
if (typeof element.contentProp !== 'undefined' && isObjectElement(element.contentProp)) {
|
|
60
57
|
responseIdentifiers.push(['http', 'response', 'body'], ['http', 'message', 'body']);
|
|
61
58
|
element.contentProp.forEach((value, key) => {
|
|
62
|
-
const headerName =
|
|
59
|
+
const headerName = toValue(key);
|
|
63
60
|
responseIdentifiers.push(['http', 'response', 'header'], ['http', 'response', 'header', headerName], ['http', 'message', 'header', headerName]);
|
|
64
61
|
});
|
|
65
62
|
}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { createRefractor } from "./index.
|
|
1
|
+
import { createRefractor } from "./index.mjs";
|
|
2
2
|
/**
|
|
3
3
|
* API Design Systems 2021-05-07 specification elements.
|
|
4
4
|
*/
|
|
5
|
-
import MainElement from "../elements/Main.
|
|
6
|
-
import InfoElement from "../elements/Info.
|
|
7
|
-
import PrincipleElement from "../elements/Principle.
|
|
8
|
-
import RequirementElement from "../elements/Requirement.
|
|
9
|
-
import RequirementLevelElement from "../elements/RequirementLevel.
|
|
10
|
-
import ScenarioElement from "../elements/Scenario.
|
|
11
|
-
import StandardElement from "../elements/Standard.
|
|
12
|
-
import StandardIdentifierElement from "../elements/StandardIdentifier.
|
|
5
|
+
import MainElement from "../elements/Main.mjs";
|
|
6
|
+
import InfoElement from "../elements/Info.mjs";
|
|
7
|
+
import PrincipleElement from "../elements/Principle.mjs";
|
|
8
|
+
import RequirementElement from "../elements/Requirement.mjs";
|
|
9
|
+
import RequirementLevelElement from "../elements/RequirementLevel.mjs";
|
|
10
|
+
import ScenarioElement from "../elements/Scenario.mjs";
|
|
11
|
+
import StandardElement from "../elements/Standard.mjs";
|
|
12
|
+
import StandardIdentifierElement from "../elements/StandardIdentifier.mjs";
|
|
13
13
|
/**
|
|
14
14
|
* API Design Systems 2021-05-07 specification elements.
|
|
15
15
|
*/
|
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import FallbackVisitor from "./visitors/FallbackVisitor.
|
|
1
|
+
import FallbackVisitor from "./visitors/FallbackVisitor.mjs";
|
|
2
2
|
/**
|
|
3
3
|
* API Design Systems 2021-05-07 specification elements.
|
|
4
4
|
*/
|
|
5
|
-
import RequirementLevelVisitor from "./visitors/api-design-systems/requirement-level/index.
|
|
6
|
-
import StandardIdentifierVisitor from "./visitors/api-design-systems/standard-identifier/index.
|
|
7
|
-
import RequirementVisitor from "./visitors/api-design-systems/requirement/index.
|
|
8
|
-
import RequirementValuesVisitor from "./visitors/api-design-systems/requirement/ValuesVisitor.
|
|
9
|
-
import RequirementFollowsVisitor from "./visitors/api-design-systems/requirement/FollowsVisitor.
|
|
10
|
-
import ScenarioVisitor from "./visitors/api-design-systems/scenario/index.
|
|
11
|
-
import ScenarioDescriptionVisitor from "./visitors/api-design-systems/scenario/DescriptionVisitor.
|
|
12
|
-
import ScenarioThenVisitor from "./visitors/api-design-systems/scenario/ThenVisitor.
|
|
13
|
-
import StandardVisitor from "./visitors/api-design-systems/standard/index.
|
|
14
|
-
import StandardNameVisitor from "./visitors/api-design-systems/standard/NameVisitor.
|
|
15
|
-
import StandardDescriptionVisitor from "./visitors/api-design-systems/standard/DescriptionVisitor.
|
|
16
|
-
import StandardIriVisitor from "./visitors/api-design-systems/standard/IriVisitor.
|
|
17
|
-
import PrincipleVisitor from "./visitors/api-design-systems/principle/index.
|
|
18
|
-
import PrincipleNameVisitor from "./visitors/api-design-systems/principle/NameVisitor.
|
|
19
|
-
import PrincipleDescriptionVisitor from "./visitors/api-design-systems/principle/DescriptionVisitor.
|
|
20
|
-
import PrincipleIriVisitor from "./visitors/api-design-systems/principle/IriVisitor.
|
|
21
|
-
import InfoVisitor from "./visitors/api-design-systems/info/index.
|
|
22
|
-
import InfoTitleVisitor from "./visitors/api-design-systems/info/TitleVisitor.
|
|
23
|
-
import InfoDescriptionVisitor from "./visitors/api-design-systems/info/DescriptionVisitor.
|
|
24
|
-
import MainVisitor from "./visitors/api-design-systems/main/index.
|
|
25
|
-
import MainVersionVisitor from "./visitors/api-design-systems/main/VersionVisitor.
|
|
26
|
-
import MainPrinciplesVisitor from "./visitors/api-design-systems/main/PrinciplesVisitor.
|
|
27
|
-
import MainStandardsVisitor from "./visitors/api-design-systems/main/StandardsVisitor.
|
|
28
|
-
import MainScenariosVisitor from "./visitors/api-design-systems/main/ScenariosVisitor.
|
|
5
|
+
import RequirementLevelVisitor from "./visitors/api-design-systems/requirement-level/index.mjs";
|
|
6
|
+
import StandardIdentifierVisitor from "./visitors/api-design-systems/standard-identifier/index.mjs";
|
|
7
|
+
import RequirementVisitor from "./visitors/api-design-systems/requirement/index.mjs";
|
|
8
|
+
import RequirementValuesVisitor from "./visitors/api-design-systems/requirement/ValuesVisitor.mjs";
|
|
9
|
+
import RequirementFollowsVisitor from "./visitors/api-design-systems/requirement/FollowsVisitor.mjs";
|
|
10
|
+
import ScenarioVisitor from "./visitors/api-design-systems/scenario/index.mjs";
|
|
11
|
+
import ScenarioDescriptionVisitor from "./visitors/api-design-systems/scenario/DescriptionVisitor.mjs";
|
|
12
|
+
import ScenarioThenVisitor from "./visitors/api-design-systems/scenario/ThenVisitor.mjs";
|
|
13
|
+
import StandardVisitor from "./visitors/api-design-systems/standard/index.mjs";
|
|
14
|
+
import StandardNameVisitor from "./visitors/api-design-systems/standard/NameVisitor.mjs";
|
|
15
|
+
import StandardDescriptionVisitor from "./visitors/api-design-systems/standard/DescriptionVisitor.mjs";
|
|
16
|
+
import StandardIriVisitor from "./visitors/api-design-systems/standard/IriVisitor.mjs";
|
|
17
|
+
import PrincipleVisitor from "./visitors/api-design-systems/principle/index.mjs";
|
|
18
|
+
import PrincipleNameVisitor from "./visitors/api-design-systems/principle/NameVisitor.mjs";
|
|
19
|
+
import PrincipleDescriptionVisitor from "./visitors/api-design-systems/principle/DescriptionVisitor.mjs";
|
|
20
|
+
import PrincipleIriVisitor from "./visitors/api-design-systems/principle/IriVisitor.mjs";
|
|
21
|
+
import InfoVisitor from "./visitors/api-design-systems/info/index.mjs";
|
|
22
|
+
import InfoTitleVisitor from "./visitors/api-design-systems/info/TitleVisitor.mjs";
|
|
23
|
+
import InfoDescriptionVisitor from "./visitors/api-design-systems/info/DescriptionVisitor.mjs";
|
|
24
|
+
import MainVisitor from "./visitors/api-design-systems/main/index.mjs";
|
|
25
|
+
import MainVersionVisitor from "./visitors/api-design-systems/main/VersionVisitor.mjs";
|
|
26
|
+
import MainPrinciplesVisitor from "./visitors/api-design-systems/main/PrinciplesVisitor.mjs";
|
|
27
|
+
import MainStandardsVisitor from "./visitors/api-design-systems/main/StandardsVisitor.mjs";
|
|
28
|
+
import MainScenariosVisitor from "./visitors/api-design-systems/main/ScenariosVisitor.mjs";
|
|
29
29
|
/**
|
|
30
30
|
* Specification object allows us to have complete control over visitors
|
|
31
31
|
* when traversing the ApiDOM.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { createNamespace, isStringElement } from '@swagger-api/apidom-core';
|
|
2
|
+
import * as apiDesignSystemsPredicates from "../predicates.mjs";
|
|
3
|
+
import apiDesignSystemNamespace from "../namespace.mjs";
|
|
4
|
+
const createToolbox = () => {
|
|
5
|
+
const namespace = createNamespace(apiDesignSystemNamespace);
|
|
6
|
+
const predicates = {
|
|
7
|
+
...apiDesignSystemsPredicates,
|
|
8
|
+
isStringElement
|
|
9
|
+
};
|
|
10
|
+
return {
|
|
11
|
+
predicates,
|
|
12
|
+
namespace
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
export default createToolbox;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import stampit from 'stampit';
|
|
2
|
-
import { BREAK } from '@swagger-api/apidom-core';
|
|
3
|
-
import Visitor from "./Visitor.
|
|
2
|
+
import { BREAK, cloneDeep } from '@swagger-api/apidom-core';
|
|
3
|
+
import Visitor from "./Visitor.mjs";
|
|
4
4
|
/**
|
|
5
5
|
* This visitor is responsible for falling back to current traversed element
|
|
6
6
|
* Given AsyncApi2Visitor expects ObjectElement to be traversed. If
|
|
@@ -10,7 +10,7 @@ import Visitor from "./Visitor.js";
|
|
|
10
10
|
const FallbackVisitor = stampit(Visitor, {
|
|
11
11
|
methods: {
|
|
12
12
|
enter(element) {
|
|
13
|
-
this.element = element
|
|
13
|
+
this.element = cloneDeep(element);
|
|
14
14
|
return BREAK;
|
|
15
15
|
}
|
|
16
16
|
}
|
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
import _defineProperty from "@babel/runtime-corejs3/helpers/esm/defineProperty";
|
|
2
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
1
|
import stampit from 'stampit';
|
|
5
2
|
import { pathSatisfies, path, pick, pipe, keys } from 'ramda';
|
|
6
3
|
import { isFunction, isUndefined } from 'ramda-adjunct';
|
|
7
|
-
import { visit } from '@swagger-api/apidom-core';
|
|
8
|
-
import { keyMap, getNodeType } from "../../traversal/visitor.
|
|
9
|
-
import Visitor from "./Visitor.
|
|
4
|
+
import { visit, cloneDeep } from '@swagger-api/apidom-core';
|
|
5
|
+
import { keyMap, getNodeType } from "../../traversal/visitor.mjs";
|
|
6
|
+
import Visitor from "./Visitor.mjs";
|
|
10
7
|
/**
|
|
11
8
|
* This is a base Type for every visitor that does
|
|
12
9
|
* internal look-ups to retrieve other child visitors.
|
|
@@ -36,7 +33,10 @@ const SpecificationVisitor = stampit(Visitor, {
|
|
|
36
33
|
},
|
|
37
34
|
retrieveVisitorInstance(specPath, options = {}) {
|
|
38
35
|
const passingOpts = this.retrievePassingOptions();
|
|
39
|
-
return this.retrieveVisitor(specPath)(
|
|
36
|
+
return this.retrieveVisitor(specPath)({
|
|
37
|
+
...passingOpts,
|
|
38
|
+
...options
|
|
39
|
+
});
|
|
40
40
|
},
|
|
41
41
|
toRefractedElement(specPath, element, options = {}) {
|
|
42
42
|
/**
|
|
@@ -53,15 +53,15 @@ const SpecificationVisitor = stampit(Visitor, {
|
|
|
53
53
|
this.fallbackVisitorPrototype = Object.getPrototypeOf(this.retrieveVisitorInstance(['value']));
|
|
54
54
|
}
|
|
55
55
|
if (this.fallbackVisitorPrototype === visitorPrototype) {
|
|
56
|
-
return element
|
|
56
|
+
return cloneDeep(element);
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
// standard processing continues
|
|
60
|
-
visit(element, visitor,
|
|
61
|
-
keyMap
|
|
62
|
-
|
|
60
|
+
visit(element, visitor, {
|
|
61
|
+
keyMap,
|
|
62
|
+
...options,
|
|
63
63
|
nodeTypeGetter: getNodeType
|
|
64
|
-
})
|
|
64
|
+
});
|
|
65
65
|
return visitor.element;
|
|
66
66
|
}
|
|
67
67
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import stampit from 'stampit';
|
|
2
2
|
import { always } from 'ramda';
|
|
3
|
-
import InfoElement from "../../../../elements/Info.
|
|
4
|
-
import FallbackVisitor from "../../FallbackVisitor.
|
|
5
|
-
import FixedFieldsVisitor from "../../generics/FixedFieldsVisitor.
|
|
3
|
+
import InfoElement from "../../../../elements/Info.mjs";
|
|
4
|
+
import FallbackVisitor from "../../FallbackVisitor.mjs";
|
|
5
|
+
import FixedFieldsVisitor from "../../generics/FixedFieldsVisitor.mjs";
|
|
6
6
|
const InfoVisitor = stampit(FixedFieldsVisitor, FallbackVisitor, {
|
|
7
7
|
props: {
|
|
8
8
|
specPath: always(['document', 'objects', 'Info'])
|
package/es/refractor/visitors/api-design-systems/main/{PrinciplesVisitor.js → PrinciplesVisitor.mjs}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import stampit from 'stampit';
|
|
2
2
|
import { ArrayElement, BREAK } from '@swagger-api/apidom-core';
|
|
3
|
-
import FallbackVisitor from "../../FallbackVisitor.
|
|
4
|
-
import SpecificationVisitor from "../../SpecificationVisitor.
|
|
3
|
+
import FallbackVisitor from "../../FallbackVisitor.mjs";
|
|
4
|
+
import SpecificationVisitor from "../../SpecificationVisitor.mjs";
|
|
5
5
|
const PrinciplesVisitor = stampit(SpecificationVisitor, FallbackVisitor, {
|
|
6
6
|
init() {
|
|
7
7
|
this.element = new ArrayElement();
|
package/es/refractor/visitors/api-design-systems/main/{ScenariosVisitor.js → ScenariosVisitor.mjs}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import stampit from 'stampit';
|
|
2
2
|
import { ArrayElement, BREAK } from '@swagger-api/apidom-core';
|
|
3
|
-
import FallbackVisitor from "../../FallbackVisitor.
|
|
4
|
-
import SpecificationVisitor from "../../SpecificationVisitor.
|
|
3
|
+
import FallbackVisitor from "../../FallbackVisitor.mjs";
|
|
4
|
+
import SpecificationVisitor from "../../SpecificationVisitor.mjs";
|
|
5
5
|
const ScenariosVisitor = stampit(SpecificationVisitor, FallbackVisitor, {
|
|
6
6
|
init() {
|
|
7
7
|
this.element = new ArrayElement();
|
package/es/refractor/visitors/api-design-systems/main/{StandardsVisitor.js → StandardsVisitor.mjs}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import stampit from 'stampit';
|
|
2
2
|
import { ArrayElement, BREAK } from '@swagger-api/apidom-core';
|
|
3
|
-
import FallbackVisitor from "../../FallbackVisitor.
|
|
4
|
-
import SpecificationVisitor from "../../SpecificationVisitor.
|
|
3
|
+
import FallbackVisitor from "../../FallbackVisitor.mjs";
|
|
4
|
+
import SpecificationVisitor from "../../SpecificationVisitor.mjs";
|
|
5
5
|
const StandardsVisitor = stampit(SpecificationVisitor, FallbackVisitor, {
|
|
6
6
|
init() {
|
|
7
7
|
this.element = new ArrayElement();
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import stampit from 'stampit';
|
|
2
2
|
import { always } from 'ramda';
|
|
3
|
-
import MainElement from "../../../../elements/Main.
|
|
4
|
-
import FallbackVisitor from "../../FallbackVisitor.
|
|
5
|
-
import FixedFieldsVisitor from "../../generics/FixedFieldsVisitor.
|
|
3
|
+
import MainElement from "../../../../elements/Main.mjs";
|
|
4
|
+
import FallbackVisitor from "../../FallbackVisitor.mjs";
|
|
5
|
+
import FixedFieldsVisitor from "../../generics/FixedFieldsVisitor.mjs";
|
|
6
6
|
const MainVisitor = stampit(FixedFieldsVisitor, FallbackVisitor, {
|
|
7
7
|
props: {
|
|
8
8
|
specPath: always(['document', 'objects', 'Main'])
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import stampit from 'stampit';
|
|
2
2
|
import { always } from 'ramda';
|
|
3
|
-
import PrincipleElement from "../../../../elements/Principle.
|
|
4
|
-
import FallbackVisitor from "../../FallbackVisitor.
|
|
5
|
-
import FixedFieldsVisitor from "../../generics/FixedFieldsVisitor.
|
|
3
|
+
import PrincipleElement from "../../../../elements/Principle.mjs";
|
|
4
|
+
import FallbackVisitor from "../../FallbackVisitor.mjs";
|
|
5
|
+
import FixedFieldsVisitor from "../../generics/FixedFieldsVisitor.mjs";
|
|
6
6
|
const PrincipleVisitor = stampit(FixedFieldsVisitor, FallbackVisitor, {
|
|
7
7
|
props: {
|
|
8
8
|
specPath: always(['document', 'objects', 'Principle'])
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import stampit from 'stampit';
|
|
2
2
|
import { always } from 'ramda';
|
|
3
|
-
import RequirementElement from "../../../../elements/Requirement.
|
|
4
|
-
import FallbackVisitor from "../../FallbackVisitor.
|
|
5
|
-
import FixedFieldsVisitor from "../../generics/FixedFieldsVisitor.
|
|
3
|
+
import RequirementElement from "../../../../elements/Requirement.mjs";
|
|
4
|
+
import FallbackVisitor from "../../FallbackVisitor.mjs";
|
|
5
|
+
import FixedFieldsVisitor from "../../generics/FixedFieldsVisitor.mjs";
|
|
6
6
|
const RequirementVisitor = stampit(FixedFieldsVisitor, FallbackVisitor, {
|
|
7
7
|
props: {
|
|
8
8
|
specPath: always(['document', 'objects', 'Requirement'])
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import stampit from 'stampit';
|
|
2
|
-
import { BREAK } from '@swagger-api/apidom-core';
|
|
3
|
-
import FallbackVisitor from "../../FallbackVisitor.
|
|
4
|
-
import SpecificationVisitor from "../../SpecificationVisitor.
|
|
5
|
-
import RequirementLevelElement from "../../../../elements/RequirementLevel.
|
|
2
|
+
import { BREAK, toValue } from '@swagger-api/apidom-core';
|
|
3
|
+
import FallbackVisitor from "../../FallbackVisitor.mjs";
|
|
4
|
+
import SpecificationVisitor from "../../SpecificationVisitor.mjs";
|
|
5
|
+
import RequirementLevelElement from "../../../../elements/RequirementLevel.mjs";
|
|
6
6
|
const RequirementLevelVisitor = stampit(SpecificationVisitor, FallbackVisitor, {
|
|
7
7
|
methods: {
|
|
8
8
|
StringElement(stringElement) {
|
|
9
|
-
const requirementLevelElement = new RequirementLevelElement(
|
|
9
|
+
const requirementLevelElement = new RequirementLevelElement(toValue(stringElement));
|
|
10
10
|
this.copyMetaAndAttributes(stringElement, requirementLevelElement);
|
|
11
11
|
this.element = requirementLevelElement;
|
|
12
12
|
return BREAK;
|
package/es/refractor/visitors/api-design-systems/scenario/{ThenVisitor.js → ThenVisitor.mjs}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import stampit from 'stampit';
|
|
2
2
|
import { ArrayElement, BREAK } from '@swagger-api/apidom-core';
|
|
3
|
-
import FallbackVisitor from "../../FallbackVisitor.
|
|
4
|
-
import SpecificationVisitor from "../../SpecificationVisitor.
|
|
3
|
+
import FallbackVisitor from "../../FallbackVisitor.mjs";
|
|
4
|
+
import SpecificationVisitor from "../../SpecificationVisitor.mjs";
|
|
5
5
|
const ThenVisitor = stampit(SpecificationVisitor, FallbackVisitor, {
|
|
6
6
|
init() {
|
|
7
7
|
this.element = new ArrayElement();
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import stampit from 'stampit';
|
|
2
2
|
import { always } from 'ramda';
|
|
3
|
-
import ScenarioElement from "../../../../elements/Scenario.
|
|
4
|
-
import FallbackVisitor from "../../FallbackVisitor.
|
|
5
|
-
import FixedFieldsVisitor from "../../generics/FixedFieldsVisitor.
|
|
3
|
+
import ScenarioElement from "../../../../elements/Scenario.mjs";
|
|
4
|
+
import FallbackVisitor from "../../FallbackVisitor.mjs";
|
|
5
|
+
import FixedFieldsVisitor from "../../generics/FixedFieldsVisitor.mjs";
|
|
6
6
|
const ScenarioVisitor = stampit(FixedFieldsVisitor, FallbackVisitor, {
|
|
7
7
|
props: {
|
|
8
8
|
specPath: always(['document', 'objects', 'Scenario'])
|