@kubb/agent 4.33.5 → 4.34.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/.output/nitro.json +1 -1
- package/.output/server/chunks/nitro/nitro.mjs +22 -4176
- package/.output/server/chunks/nitro/nitro.mjs.map +1 -1
- package/.output/server/chunks/routes/api/health.get.mjs +1 -0
- package/.output/server/chunks/routes/api/health.get.mjs.map +1 -1
- package/.output/server/index.mjs +1 -0
- package/.output/server/index.mjs.map +1 -1
- package/.output/server/node_modules/@stoplight/ordered-object-literal/package.json +53 -0
- package/.output/server/node_modules/@stoplight/ordered-object-literal/src/index.cjs +221 -0
- package/.output/server/node_modules/@stoplight/types/dist/index.js +129 -0
- package/.output/server/node_modules/@stoplight/types/package.json +81 -0
- package/.output/server/node_modules/@stoplight/yaml/buildJsonPath.js +41 -0
- package/.output/server/node_modules/@stoplight/yaml/dereferenceAnchor.js +38 -0
- package/.output/server/node_modules/@stoplight/yaml/getJsonPathForPosition.js +98 -0
- package/.output/server/node_modules/@stoplight/yaml/getLocationForJsonPath.js +145 -0
- package/.output/server/node_modules/@stoplight/yaml/index.js +16 -0
- package/.output/server/node_modules/@stoplight/yaml/lineForPosition.js +31 -0
- package/.output/server/node_modules/@stoplight/yaml/package.json +33 -0
- package/.output/server/node_modules/@stoplight/yaml/parse.js +5 -0
- package/.output/server/node_modules/@stoplight/yaml/parseWithPointers.js +456 -0
- package/.output/server/node_modules/@stoplight/yaml/safeStringify.js +5 -0
- package/.output/server/node_modules/@stoplight/yaml/trapAccess.js +11 -0
- package/.output/server/node_modules/@stoplight/yaml/types.js +6 -0
- package/.output/server/node_modules/@stoplight/yaml/utils.js +4 -0
- package/.output/server/node_modules/@stoplight/yaml-ast-parser/dist/src/common.js +45 -0
- package/.output/server/node_modules/@stoplight/yaml-ast-parser/dist/src/dumper.js +710 -0
- package/.output/server/node_modules/@stoplight/yaml-ast-parser/dist/src/exception.js +35 -0
- package/.output/server/node_modules/@stoplight/yaml-ast-parser/dist/src/index.js +22 -0
- package/.output/server/node_modules/@stoplight/yaml-ast-parser/dist/src/loader.js +1414 -0
- package/.output/server/node_modules/@stoplight/yaml-ast-parser/dist/src/mark.js +58 -0
- package/.output/server/node_modules/@stoplight/yaml-ast-parser/dist/src/scalarInference.js +90 -0
- package/.output/server/node_modules/@stoplight/yaml-ast-parser/dist/src/schema/core.js +8 -0
- package/.output/server/node_modules/@stoplight/yaml-ast-parser/dist/src/schema/default_full.js +14 -0
- package/.output/server/node_modules/@stoplight/yaml-ast-parser/dist/src/schema/default_safe.js +19 -0
- package/.output/server/node_modules/@stoplight/yaml-ast-parser/dist/src/schema/failsafe.js +10 -0
- package/.output/server/node_modules/@stoplight/yaml-ast-parser/dist/src/schema/json.js +14 -0
- package/.output/server/node_modules/@stoplight/yaml-ast-parser/dist/src/schema.js +77 -0
- package/.output/server/node_modules/@stoplight/yaml-ast-parser/dist/src/type/binary.js +92 -0
- package/.output/server/node_modules/@stoplight/yaml-ast-parser/dist/src/type/bool.js +32 -0
- package/.output/server/node_modules/@stoplight/yaml-ast-parser/dist/src/type/float.js +94 -0
- package/.output/server/node_modules/@stoplight/yaml-ast-parser/dist/src/type/int.js +159 -0
- package/.output/server/node_modules/@stoplight/yaml-ast-parser/dist/src/type/js/regexp.js +64 -0
- package/.output/server/node_modules/@stoplight/yaml-ast-parser/dist/src/type/js/undefined.js +22 -0
- package/.output/server/node_modules/@stoplight/yaml-ast-parser/dist/src/type/map.js +7 -0
- package/.output/server/node_modules/@stoplight/yaml-ast-parser/dist/src/type/merge.js +10 -0
- package/.output/server/node_modules/@stoplight/yaml-ast-parser/dist/src/type/null.js +30 -0
- package/.output/server/node_modules/@stoplight/yaml-ast-parser/dist/src/type/omap.js +46 -0
- package/.output/server/node_modules/@stoplight/yaml-ast-parser/dist/src/type/pairs.js +55 -0
- package/.output/server/node_modules/@stoplight/yaml-ast-parser/dist/src/type/seq.js +7 -0
- package/.output/server/node_modules/@stoplight/yaml-ast-parser/dist/src/type/set.js +22 -0
- package/.output/server/node_modules/@stoplight/yaml-ast-parser/dist/src/type/str.js +7 -0
- package/.output/server/node_modules/@stoplight/yaml-ast-parser/dist/src/type/timestamp.js +70 -0
- package/.output/server/node_modules/@stoplight/yaml-ast-parser/dist/src/type.js +53 -0
- package/.output/server/node_modules/@stoplight/yaml-ast-parser/dist/src/yamlAST.js +81 -0
- package/.output/server/node_modules/@stoplight/yaml-ast-parser/package.json +38 -0
- package/.output/server/node_modules/tslib/package.json +47 -0
- package/.output/server/node_modules/tslib/tslib.js +484 -0
- package/.output/server/package.json +6 -1
- package/package.json +16 -16
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
const type_1 = require("../../type");
|
|
3
|
+
function resolveJavascriptRegExp(data) {
|
|
4
|
+
if (null === data) {
|
|
5
|
+
return false;
|
|
6
|
+
}
|
|
7
|
+
if (0 === data.length) {
|
|
8
|
+
return false;
|
|
9
|
+
}
|
|
10
|
+
var regexp = data, tail = /\/([gim]*)$/.exec(data), modifiers = '';
|
|
11
|
+
if ('/' === regexp[0]) {
|
|
12
|
+
if (tail) {
|
|
13
|
+
modifiers = tail[1];
|
|
14
|
+
}
|
|
15
|
+
if (modifiers.length > 3) {
|
|
16
|
+
return false;
|
|
17
|
+
}
|
|
18
|
+
if (regexp[regexp.length - modifiers.length - 1] !== '/') {
|
|
19
|
+
return false;
|
|
20
|
+
}
|
|
21
|
+
regexp = regexp.slice(1, regexp.length - modifiers.length - 1);
|
|
22
|
+
}
|
|
23
|
+
try {
|
|
24
|
+
var dummy = new RegExp(regexp, modifiers);
|
|
25
|
+
return true;
|
|
26
|
+
}
|
|
27
|
+
catch (error) {
|
|
28
|
+
return false;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
function constructJavascriptRegExp(data) {
|
|
32
|
+
var regexp = data, tail = /\/([gim]*)$/.exec(data), modifiers = '';
|
|
33
|
+
if ('/' === regexp[0]) {
|
|
34
|
+
if (tail) {
|
|
35
|
+
modifiers = tail[1];
|
|
36
|
+
}
|
|
37
|
+
regexp = regexp.slice(1, regexp.length - modifiers.length - 1);
|
|
38
|
+
}
|
|
39
|
+
return new RegExp(regexp, modifiers);
|
|
40
|
+
}
|
|
41
|
+
function representJavascriptRegExp(object) {
|
|
42
|
+
var result = '/' + object.source + '/';
|
|
43
|
+
if (object.global) {
|
|
44
|
+
result += 'g';
|
|
45
|
+
}
|
|
46
|
+
if (object.multiline) {
|
|
47
|
+
result += 'm';
|
|
48
|
+
}
|
|
49
|
+
if (object.ignoreCase) {
|
|
50
|
+
result += 'i';
|
|
51
|
+
}
|
|
52
|
+
return result;
|
|
53
|
+
}
|
|
54
|
+
function isRegExp(object) {
|
|
55
|
+
return '[object RegExp]' === Object.prototype.toString.call(object);
|
|
56
|
+
}
|
|
57
|
+
module.exports = new type_1.Type('tag:yaml.org,2002:js/regexp', {
|
|
58
|
+
kind: 'scalar',
|
|
59
|
+
resolve: resolveJavascriptRegExp,
|
|
60
|
+
construct: constructJavascriptRegExp,
|
|
61
|
+
predicate: isRegExp,
|
|
62
|
+
represent: representJavascriptRegExp
|
|
63
|
+
});
|
|
64
|
+
//# sourceMappingURL=regexp.js.map
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
const type_1 = require("../../type");
|
|
3
|
+
function resolveJavascriptUndefined() {
|
|
4
|
+
return true;
|
|
5
|
+
}
|
|
6
|
+
function constructJavascriptUndefined() {
|
|
7
|
+
return undefined;
|
|
8
|
+
}
|
|
9
|
+
function representJavascriptUndefined() {
|
|
10
|
+
return '';
|
|
11
|
+
}
|
|
12
|
+
function isUndefined(object) {
|
|
13
|
+
return 'undefined' === typeof object;
|
|
14
|
+
}
|
|
15
|
+
module.exports = new type_1.Type('tag:yaml.org,2002:js/undefined', {
|
|
16
|
+
kind: 'scalar',
|
|
17
|
+
resolve: resolveJavascriptUndefined,
|
|
18
|
+
construct: constructJavascriptUndefined,
|
|
19
|
+
predicate: isUndefined,
|
|
20
|
+
represent: representJavascriptUndefined
|
|
21
|
+
});
|
|
22
|
+
//# sourceMappingURL=undefined.js.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
const type_1 = require("../type");
|
|
3
|
+
function resolveYamlMerge(data) {
|
|
4
|
+
return '<<' === data || null === data;
|
|
5
|
+
}
|
|
6
|
+
module.exports = new type_1.Type('tag:yaml.org,2002:merge', {
|
|
7
|
+
kind: 'scalar',
|
|
8
|
+
resolve: resolveYamlMerge
|
|
9
|
+
});
|
|
10
|
+
//# sourceMappingURL=merge.js.map
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
const type_1 = require("../type");
|
|
3
|
+
function resolveYamlNull(data) {
|
|
4
|
+
if (null === data) {
|
|
5
|
+
return true;
|
|
6
|
+
}
|
|
7
|
+
var max = data.length;
|
|
8
|
+
return (max === 1 && data === '~') ||
|
|
9
|
+
(max === 4 && (data === 'null' || data === 'Null' || data === 'NULL'));
|
|
10
|
+
}
|
|
11
|
+
function constructYamlNull() {
|
|
12
|
+
return null;
|
|
13
|
+
}
|
|
14
|
+
function isNull(object) {
|
|
15
|
+
return null === object;
|
|
16
|
+
}
|
|
17
|
+
module.exports = new type_1.Type('tag:yaml.org,2002:null', {
|
|
18
|
+
kind: 'scalar',
|
|
19
|
+
resolve: resolveYamlNull,
|
|
20
|
+
construct: constructYamlNull,
|
|
21
|
+
predicate: isNull,
|
|
22
|
+
represent: {
|
|
23
|
+
canonical: function () { return '~'; },
|
|
24
|
+
lowercase: function () { return 'null'; },
|
|
25
|
+
uppercase: function () { return 'NULL'; },
|
|
26
|
+
camelcase: function () { return 'Null'; }
|
|
27
|
+
},
|
|
28
|
+
defaultStyle: 'lowercase'
|
|
29
|
+
});
|
|
30
|
+
//# sourceMappingURL=null.js.map
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
const type_1 = require("../type");
|
|
3
|
+
var _hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
4
|
+
var _toString = Object.prototype.toString;
|
|
5
|
+
function resolveYamlOmap(data) {
|
|
6
|
+
if (null === data) {
|
|
7
|
+
return true;
|
|
8
|
+
}
|
|
9
|
+
var objectKeys = [], index, length, pair, pairKey, pairHasKey, object = data;
|
|
10
|
+
for (index = 0, length = object.length; index < length; index += 1) {
|
|
11
|
+
pair = object[index];
|
|
12
|
+
pairHasKey = false;
|
|
13
|
+
if ('[object Object]' !== _toString.call(pair)) {
|
|
14
|
+
return false;
|
|
15
|
+
}
|
|
16
|
+
for (pairKey in pair) {
|
|
17
|
+
if (_hasOwnProperty.call(pair, pairKey)) {
|
|
18
|
+
if (!pairHasKey) {
|
|
19
|
+
pairHasKey = true;
|
|
20
|
+
}
|
|
21
|
+
else {
|
|
22
|
+
return false;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
if (!pairHasKey) {
|
|
27
|
+
return false;
|
|
28
|
+
}
|
|
29
|
+
if (-1 === objectKeys.indexOf(pairKey)) {
|
|
30
|
+
objectKeys.push(pairKey);
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
return false;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
return true;
|
|
37
|
+
}
|
|
38
|
+
function constructYamlOmap(data) {
|
|
39
|
+
return null !== data ? data : [];
|
|
40
|
+
}
|
|
41
|
+
module.exports = new type_1.Type('tag:yaml.org,2002:omap', {
|
|
42
|
+
kind: 'sequence',
|
|
43
|
+
resolve: resolveYamlOmap,
|
|
44
|
+
construct: constructYamlOmap
|
|
45
|
+
});
|
|
46
|
+
//# sourceMappingURL=omap.js.map
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
const type_1 = require("../type");
|
|
3
|
+
const ast = require("../yamlAST");
|
|
4
|
+
var _toString = Object.prototype.toString;
|
|
5
|
+
function resolveYamlPairs(data) {
|
|
6
|
+
if (null === data) {
|
|
7
|
+
return true;
|
|
8
|
+
}
|
|
9
|
+
if (data.kind != ast.Kind.SEQ) {
|
|
10
|
+
return false;
|
|
11
|
+
}
|
|
12
|
+
var index, length, pair, keys, result, object = data.items;
|
|
13
|
+
for (index = 0, length = object.length; index < length; index += 1) {
|
|
14
|
+
pair = object[index];
|
|
15
|
+
if ('[object Object]' !== _toString.call(pair)) {
|
|
16
|
+
return false;
|
|
17
|
+
}
|
|
18
|
+
if (!Array.isArray(pair.mappings)) {
|
|
19
|
+
return false;
|
|
20
|
+
}
|
|
21
|
+
if (1 !== pair.mappings.length) {
|
|
22
|
+
return false;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
return true;
|
|
26
|
+
}
|
|
27
|
+
function constructYamlPairs(data) {
|
|
28
|
+
if (null === data || !Array.isArray(data.items)) {
|
|
29
|
+
return [];
|
|
30
|
+
}
|
|
31
|
+
let index, length, keys, result, object = data.items;
|
|
32
|
+
result = ast.newItems();
|
|
33
|
+
result.parent = data.parent;
|
|
34
|
+
result.startPosition = data.startPosition;
|
|
35
|
+
result.endPosition = data.endPosition;
|
|
36
|
+
for (index = 0, length = object.length; index < length; index += 1) {
|
|
37
|
+
let pair = object[index];
|
|
38
|
+
let mapping = pair.mappings[0];
|
|
39
|
+
let pairSeq = ast.newItems();
|
|
40
|
+
pairSeq.parent = result;
|
|
41
|
+
pairSeq.startPosition = mapping.key.startPosition;
|
|
42
|
+
pairSeq.endPosition = mapping.value.startPosition;
|
|
43
|
+
mapping.key.parent = pairSeq;
|
|
44
|
+
mapping.value.parent = pairSeq;
|
|
45
|
+
pairSeq.items = [mapping.key, mapping.value];
|
|
46
|
+
result.items.push(pairSeq);
|
|
47
|
+
}
|
|
48
|
+
return result;
|
|
49
|
+
}
|
|
50
|
+
module.exports = new type_1.Type('tag:yaml.org,2002:pairs', {
|
|
51
|
+
kind: 'sequence',
|
|
52
|
+
resolve: resolveYamlPairs,
|
|
53
|
+
construct: constructYamlPairs
|
|
54
|
+
});
|
|
55
|
+
//# sourceMappingURL=pairs.js.map
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
const type_1 = require("../type");
|
|
3
|
+
const ast = require("../yamlAST");
|
|
4
|
+
var _hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
5
|
+
function resolveYamlSet(data) {
|
|
6
|
+
if (null === data) {
|
|
7
|
+
return true;
|
|
8
|
+
}
|
|
9
|
+
if (data.kind != ast.Kind.MAP) {
|
|
10
|
+
return false;
|
|
11
|
+
}
|
|
12
|
+
return true;
|
|
13
|
+
}
|
|
14
|
+
function constructYamlSet(data) {
|
|
15
|
+
return null !== data ? data : {};
|
|
16
|
+
}
|
|
17
|
+
module.exports = new type_1.Type('tag:yaml.org,2002:set', {
|
|
18
|
+
kind: 'mapping',
|
|
19
|
+
resolve: resolveYamlSet,
|
|
20
|
+
construct: constructYamlSet
|
|
21
|
+
});
|
|
22
|
+
//# sourceMappingURL=set.js.map
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
const type_1 = require("../type");
|
|
3
|
+
var YAML_TIMESTAMP_REGEXP = new RegExp('^([0-9][0-9][0-9][0-9])' +
|
|
4
|
+
'-([0-9][0-9]?)' +
|
|
5
|
+
'-([0-9][0-9]?)' +
|
|
6
|
+
'(?:(?:[Tt]|[ \\t]+)' +
|
|
7
|
+
'([0-9][0-9]?)' +
|
|
8
|
+
':([0-9][0-9])' +
|
|
9
|
+
':([0-9][0-9])' +
|
|
10
|
+
'(?:\\.([0-9]*))?' +
|
|
11
|
+
'(?:[ \\t]*(Z|([-+])([0-9][0-9]?)' +
|
|
12
|
+
'(?::([0-9][0-9]))?))?)?$');
|
|
13
|
+
function resolveYamlTimestamp(data) {
|
|
14
|
+
if (null === data) {
|
|
15
|
+
return false;
|
|
16
|
+
}
|
|
17
|
+
var match, year, month, day, hour, minute, second, fraction = 0, delta = null, tz_hour, tz_minute, date;
|
|
18
|
+
match = YAML_TIMESTAMP_REGEXP.exec(data);
|
|
19
|
+
if (null === match) {
|
|
20
|
+
return false;
|
|
21
|
+
}
|
|
22
|
+
return true;
|
|
23
|
+
}
|
|
24
|
+
function constructYamlTimestamp(data) {
|
|
25
|
+
var match, year, month, day, hour, minute, second, fraction = 0, delta = null, tz_hour, tz_minute, date;
|
|
26
|
+
match = YAML_TIMESTAMP_REGEXP.exec(data);
|
|
27
|
+
if (null === match) {
|
|
28
|
+
throw new Error('Date resolve error');
|
|
29
|
+
}
|
|
30
|
+
year = +(match[1]);
|
|
31
|
+
month = +(match[2]) - 1;
|
|
32
|
+
day = +(match[3]);
|
|
33
|
+
if (!match[4]) {
|
|
34
|
+
return new Date(Date.UTC(year, month, day));
|
|
35
|
+
}
|
|
36
|
+
hour = +(match[4]);
|
|
37
|
+
minute = +(match[5]);
|
|
38
|
+
second = +(match[6]);
|
|
39
|
+
if (match[7]) {
|
|
40
|
+
fraction = match[7].slice(0, 3);
|
|
41
|
+
while (fraction.length < 3) {
|
|
42
|
+
fraction = fraction + '0';
|
|
43
|
+
}
|
|
44
|
+
fraction = +fraction;
|
|
45
|
+
}
|
|
46
|
+
if (match[9]) {
|
|
47
|
+
tz_hour = +(match[10]);
|
|
48
|
+
tz_minute = +(match[11] || 0);
|
|
49
|
+
delta = (tz_hour * 60 + tz_minute) * 60000;
|
|
50
|
+
if ('-' === match[9]) {
|
|
51
|
+
delta = -delta;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
date = new Date(Date.UTC(year, month, day, hour, minute, second, fraction));
|
|
55
|
+
if (delta) {
|
|
56
|
+
date.setTime(date.getTime() - delta);
|
|
57
|
+
}
|
|
58
|
+
return date;
|
|
59
|
+
}
|
|
60
|
+
function representYamlTimestamp(object) {
|
|
61
|
+
return object.toISOString();
|
|
62
|
+
}
|
|
63
|
+
module.exports = new type_1.Type('tag:yaml.org,2002:timestamp', {
|
|
64
|
+
kind: 'scalar',
|
|
65
|
+
resolve: resolveYamlTimestamp,
|
|
66
|
+
construct: constructYamlTimestamp,
|
|
67
|
+
instanceOf: Date,
|
|
68
|
+
represent: representYamlTimestamp
|
|
69
|
+
});
|
|
70
|
+
//# sourceMappingURL=timestamp.js.map
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const YAMLException = require("./exception");
|
|
4
|
+
var TYPE_CONSTRUCTOR_OPTIONS = [
|
|
5
|
+
'kind',
|
|
6
|
+
'resolve',
|
|
7
|
+
'construct',
|
|
8
|
+
'instanceOf',
|
|
9
|
+
'predicate',
|
|
10
|
+
'represent',
|
|
11
|
+
'defaultStyle',
|
|
12
|
+
'styleAliases'
|
|
13
|
+
];
|
|
14
|
+
var YAML_NODE_KINDS = [
|
|
15
|
+
'scalar',
|
|
16
|
+
'sequence',
|
|
17
|
+
'mapping'
|
|
18
|
+
];
|
|
19
|
+
function compileStyleAliases(map) {
|
|
20
|
+
var result = {};
|
|
21
|
+
if (null !== map) {
|
|
22
|
+
Object.keys(map).forEach(function (style) {
|
|
23
|
+
map[style].forEach(function (alias) {
|
|
24
|
+
result[String(alias)] = style;
|
|
25
|
+
});
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
return result;
|
|
29
|
+
}
|
|
30
|
+
class Type {
|
|
31
|
+
constructor(tag, options) {
|
|
32
|
+
options = options || {};
|
|
33
|
+
Object.keys(options).forEach(function (name) {
|
|
34
|
+
if (-1 === TYPE_CONSTRUCTOR_OPTIONS.indexOf(name)) {
|
|
35
|
+
throw new YAMLException('Unknown option "' + name + '" is met in definition of "' + tag + '" YAML type.');
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
this.tag = tag;
|
|
39
|
+
this.kind = options['kind'] || null;
|
|
40
|
+
this.resolve = options['resolve'] || function () { return true; };
|
|
41
|
+
this.construct = options['construct'] || function (data) { return data; };
|
|
42
|
+
this.instanceOf = options['instanceOf'] || null;
|
|
43
|
+
this.predicate = options['predicate'] || null;
|
|
44
|
+
this.represent = options['represent'] || null;
|
|
45
|
+
this.defaultStyle = options['defaultStyle'] || null;
|
|
46
|
+
this.styleAliases = compileStyleAliases(options['styleAliases'] || null);
|
|
47
|
+
if (-1 === YAML_NODE_KINDS.indexOf(this.kind)) {
|
|
48
|
+
throw new YAMLException('Unknown kind "' + this.kind + '" is specified for "' + tag + '" YAML type.');
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
exports.Type = Type;
|
|
53
|
+
//# sourceMappingURL=type.js.map
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var Kind;
|
|
4
|
+
(function (Kind) {
|
|
5
|
+
Kind[Kind["SCALAR"] = 0] = "SCALAR";
|
|
6
|
+
Kind[Kind["MAPPING"] = 1] = "MAPPING";
|
|
7
|
+
Kind[Kind["MAP"] = 2] = "MAP";
|
|
8
|
+
Kind[Kind["SEQ"] = 3] = "SEQ";
|
|
9
|
+
Kind[Kind["ANCHOR_REF"] = 4] = "ANCHOR_REF";
|
|
10
|
+
Kind[Kind["INCLUDE_REF"] = 5] = "INCLUDE_REF";
|
|
11
|
+
})(Kind = exports.Kind || (exports.Kind = {}));
|
|
12
|
+
function newMapping(key, value) {
|
|
13
|
+
var end = (value ? value.endPosition : key.endPosition + 1);
|
|
14
|
+
var node = {
|
|
15
|
+
key: key,
|
|
16
|
+
value: value,
|
|
17
|
+
startPosition: key.startPosition,
|
|
18
|
+
endPosition: end,
|
|
19
|
+
kind: Kind.MAPPING,
|
|
20
|
+
parent: null,
|
|
21
|
+
errors: []
|
|
22
|
+
};
|
|
23
|
+
return node;
|
|
24
|
+
}
|
|
25
|
+
exports.newMapping = newMapping;
|
|
26
|
+
function newAnchorRef(key, start, end, value) {
|
|
27
|
+
return {
|
|
28
|
+
errors: [],
|
|
29
|
+
referencesAnchor: key,
|
|
30
|
+
value: value,
|
|
31
|
+
startPosition: start,
|
|
32
|
+
endPosition: end,
|
|
33
|
+
kind: Kind.ANCHOR_REF,
|
|
34
|
+
parent: null
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
exports.newAnchorRef = newAnchorRef;
|
|
38
|
+
function newScalar(v = "") {
|
|
39
|
+
const result = {
|
|
40
|
+
errors: [],
|
|
41
|
+
startPosition: -1,
|
|
42
|
+
endPosition: -1,
|
|
43
|
+
value: "" + v,
|
|
44
|
+
kind: Kind.SCALAR,
|
|
45
|
+
parent: null,
|
|
46
|
+
doubleQuoted: false,
|
|
47
|
+
rawValue: "" + v,
|
|
48
|
+
};
|
|
49
|
+
if (typeof v !== "string") {
|
|
50
|
+
result.valueObject = v;
|
|
51
|
+
}
|
|
52
|
+
return result;
|
|
53
|
+
}
|
|
54
|
+
exports.newScalar = newScalar;
|
|
55
|
+
function newItems() {
|
|
56
|
+
return {
|
|
57
|
+
errors: [],
|
|
58
|
+
startPosition: -1,
|
|
59
|
+
endPosition: -1,
|
|
60
|
+
items: [],
|
|
61
|
+
kind: Kind.SEQ,
|
|
62
|
+
parent: null
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
exports.newItems = newItems;
|
|
66
|
+
function newSeq() {
|
|
67
|
+
return newItems();
|
|
68
|
+
}
|
|
69
|
+
exports.newSeq = newSeq;
|
|
70
|
+
function newMap(mappings) {
|
|
71
|
+
return {
|
|
72
|
+
errors: [],
|
|
73
|
+
startPosition: -1,
|
|
74
|
+
endPosition: -1,
|
|
75
|
+
mappings: mappings ? mappings : [],
|
|
76
|
+
kind: Kind.MAP,
|
|
77
|
+
parent: null
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
exports.newMap = newMap;
|
|
81
|
+
//# sourceMappingURL=yamlAST.js.map
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@stoplight/yaml-ast-parser",
|
|
3
|
+
"version": "0.0.50",
|
|
4
|
+
"main": "dist/src/index.js",
|
|
5
|
+
"scripts": {
|
|
6
|
+
"build": "rimraf dist && tsc",
|
|
7
|
+
"pullall": "dev-env-installer pullall",
|
|
8
|
+
"buildall": "dev-env-installer buildall",
|
|
9
|
+
"testall": "dev-env-installer testall",
|
|
10
|
+
"devInstall": "dev-env-installer install",
|
|
11
|
+
"test": "npm run build && mocha --ui tdd dist/test"
|
|
12
|
+
},
|
|
13
|
+
"typings": "dist/src/index.d.ts",
|
|
14
|
+
"repository": {
|
|
15
|
+
"type": "git",
|
|
16
|
+
"url": "https://github.com/stoplightio/yaml-ast-parser.git"
|
|
17
|
+
},
|
|
18
|
+
"keywords": [
|
|
19
|
+
"raml",
|
|
20
|
+
"ast",
|
|
21
|
+
"yaml"
|
|
22
|
+
],
|
|
23
|
+
"homepage": "https://github.com/stoplightio/yaml-ast-parser",
|
|
24
|
+
"license": "Apache-2.0",
|
|
25
|
+
"bugs": {
|
|
26
|
+
"url": "https://github.com/stoplightio/yaml-ast-parser/issues"
|
|
27
|
+
},
|
|
28
|
+
"devDependencies": {
|
|
29
|
+
"@types/chai": "4.0.1",
|
|
30
|
+
"@types/mocha": "2.2.41",
|
|
31
|
+
"@types/node": "4.2.20",
|
|
32
|
+
"chai": "4.0.2",
|
|
33
|
+
"dev-env-installer": "0.0.14",
|
|
34
|
+
"mocha": "3.4.2",
|
|
35
|
+
"rimraf": "*",
|
|
36
|
+
"typescript": "3.8.3"
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "tslib",
|
|
3
|
+
"author": "Microsoft Corp.",
|
|
4
|
+
"homepage": "https://www.typescriptlang.org/",
|
|
5
|
+
"version": "2.8.1",
|
|
6
|
+
"license": "0BSD",
|
|
7
|
+
"description": "Runtime library for TypeScript helper functions",
|
|
8
|
+
"keywords": [
|
|
9
|
+
"TypeScript",
|
|
10
|
+
"Microsoft",
|
|
11
|
+
"compiler",
|
|
12
|
+
"language",
|
|
13
|
+
"javascript",
|
|
14
|
+
"tslib",
|
|
15
|
+
"runtime"
|
|
16
|
+
],
|
|
17
|
+
"bugs": {
|
|
18
|
+
"url": "https://github.com/Microsoft/TypeScript/issues"
|
|
19
|
+
},
|
|
20
|
+
"repository": {
|
|
21
|
+
"type": "git",
|
|
22
|
+
"url": "https://github.com/Microsoft/tslib.git"
|
|
23
|
+
},
|
|
24
|
+
"main": "tslib.js",
|
|
25
|
+
"module": "tslib.es6.js",
|
|
26
|
+
"jsnext:main": "tslib.es6.js",
|
|
27
|
+
"typings": "tslib.d.ts",
|
|
28
|
+
"sideEffects": false,
|
|
29
|
+
"exports": {
|
|
30
|
+
".": {
|
|
31
|
+
"module": {
|
|
32
|
+
"types": "./modules/index.d.ts",
|
|
33
|
+
"default": "./tslib.es6.mjs"
|
|
34
|
+
},
|
|
35
|
+
"import": {
|
|
36
|
+
"node": "./modules/index.js",
|
|
37
|
+
"default": {
|
|
38
|
+
"types": "./modules/index.d.ts",
|
|
39
|
+
"default": "./tslib.es6.mjs"
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
"default": "./tslib.js"
|
|
43
|
+
},
|
|
44
|
+
"./*": "./*",
|
|
45
|
+
"./": "./"
|
|
46
|
+
}
|
|
47
|
+
}
|