@blueking/bkui-form 1.0.1-beta.3 → 1.0.1-beta.5
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/dist/adapter/common/FieldGroupWrap.d.ts +209 -0
- package/dist/adapter/field/ArrayField.d.ts +147 -0
- package/dist/adapter/field/BooleanField.d.ts +145 -0
- package/dist/adapter/field/CompositionField.d.ts +151 -0
- package/dist/adapter/field/FieldProps.d.ts +70 -0
- package/dist/adapter/field/NumberField.d.ts +145 -0
- package/dist/adapter/field/ObjectField.d.ts +147 -0
- package/dist/adapter/field/SchemaField.d.ts +145 -0
- package/dist/adapter/field/StringField.d.ts +4 -0
- package/dist/adapter/widget/ArrayWidget.d.ts +154 -0
- package/dist/adapter/widget/ButtonWidget.d.ts +16 -0
- package/dist/adapter/widget/CheckboxWidget.d.ts +34 -0
- package/dist/adapter/widget/CollapseGroupWidget.d.ts +196 -0
- package/dist/adapter/widget/ColorPickerWidget.d.ts +8 -0
- package/dist/adapter/widget/InputWidget.d.ts +30 -0
- package/dist/adapter/widget/KeyValueArrayWidget.d.ts +157 -0
- package/dist/adapter/widget/RadioWidget.d.ts +37 -0
- package/dist/adapter/widget/SelectWidget.d.ts +37 -0
- package/dist/adapter/widget/SwitchWidget.d.ts +10 -0
- package/dist/adapter/widget/TabGroupWidget.d.ts +187 -0
- package/dist/adapter/widget/TableWidget.d.ts +154 -0
- package/dist/adapter/widget/Widget.d.ts +182 -0
- package/dist/controller/form.d.ts +141 -0
- package/dist/controller/props.d.ts +62 -0
- package/dist/core/events.d.ts +10 -0
- package/dist/core/expression.d.ts +13 -0
- package/dist/core/form.d.ts +5 -0
- package/dist/core/lang.d.ts +1 -0
- package/dist/core/layout.d.ts +20 -0
- package/dist/core/lifecycle.d.ts +0 -0
- package/dist/core/path.d.ts +9 -0
- package/dist/core/proxy.d.ts +3 -0
- package/dist/core/reaction.d.ts +5 -0
- package/dist/core/register.d.ts +19 -0
- package/dist/core/schema.d.ts +26 -0
- package/dist/core/validator.d.ts +35 -0
- package/dist/core/widgetTree.d.ts +40 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.es.js +7443 -0
- package/dist/index.umd.js +12 -0
- package/dist/style.css +1 -0
- package/dist/util/fetch.d.ts +10 -0
- package/dist/util/index.d.ts +23 -0
- package/package.json +24 -12
- package/esm/adapter/common/FieldGroupWrap.tsx.js +0 -199
- package/esm/adapter/field/ArrayField.tsx.js +0 -55
- package/esm/adapter/field/BooleanField.tsx.js +0 -41
- package/esm/adapter/field/CompositionField.tsx.js +0 -113
- package/esm/adapter/field/FieldProps.ts.js +0 -85
- package/esm/adapter/field/NumberField.tsx.js +0 -19
- package/esm/adapter/field/ObjectField.tsx.js +0 -58
- package/esm/adapter/field/SchemaField.tsx.js +0 -28
- package/esm/adapter/field/StringField.tsx.js +0 -4
- package/esm/adapter/widget/ArrayWidget.ts.js +0 -196
- package/esm/adapter/widget/ButtonWidget.ts.js +0 -76
- package/esm/adapter/widget/CheckboxWidget.ts.js +0 -101
- package/esm/adapter/widget/CollapseGroupWidget.ts.js +0 -140
- package/esm/adapter/widget/ColorPickerWidget.ts.js +0 -71
- package/esm/adapter/widget/InputWidget.ts.js +0 -79
- package/esm/adapter/widget/KeyValueArrayWidget.tsx.js +0 -156
- package/esm/adapter/widget/RadioWidget.ts.js +0 -98
- package/esm/adapter/widget/SelectWidget.ts.js +0 -98
- package/esm/adapter/widget/SwitchWidget.ts.js +0 -73
- package/esm/adapter/widget/TabGroupWidget.ts.js +0 -145
- package/esm/adapter/widget/TableWidget.ts.js +0 -205
- package/esm/adapter/widget/Widget.ts.js +0 -497
- package/esm/assets/fonts/iconcool.eot +0 -0
- package/esm/assets/fonts/iconcool.svg +0 -53
- package/esm/assets/fonts/iconcool.ttf +0 -0
- package/esm/assets/fonts/iconcool.woff +0 -0
- package/esm/assets/style.css +0 -43
- package/esm/controller/form.css +0 -164
- package/esm/controller/form.tsx.js +0 -159
- package/esm/controller/props.ts.js +0 -75
- package/esm/core/events.ts.js +0 -74
- package/esm/core/expression.ts.js +0 -67
- package/esm/core/lang.ts.js +0 -25
- package/esm/core/layout.ts.js +0 -149
- package/esm/core/path.ts.js +0 -60
- package/esm/core/proxy.ts.js +0 -10
- package/esm/core/reaction.ts.js +0 -116
- package/esm/core/register.ts.js +0 -74
- package/esm/core/schema.ts.js +0 -302
- package/esm/core/validator.ts.js +0 -248
- package/esm/core/widgetTree.ts.js +0 -163
- package/esm/index.ts.js +0 -6
- package/esm/node_modules/@blueking/cli-service/dist/lib/path.js +0 -35
- package/esm/node_modules/@blueking/cli-service/dist/lib/util.js +0 -233
- package/esm/node_modules/@blueking/cli-service/dist/tools/rust/helper/path.js +0 -172
- package/esm/node_modules/ajv/dist/ajv.js +0 -50
- package/esm/node_modules/ajv/dist/compile/codegen/code.js +0 -156
- package/esm/node_modules/ajv/dist/compile/codegen/index.js +0 -697
- package/esm/node_modules/ajv/dist/compile/codegen/scope.js +0 -143
- package/esm/node_modules/ajv/dist/compile/errors.js +0 -123
- package/esm/node_modules/ajv/dist/compile/index.js +0 -242
- package/esm/node_modules/ajv/dist/compile/names.js +0 -28
- package/esm/node_modules/ajv/dist/compile/ref_error.js +0 -12
- package/esm/node_modules/ajv/dist/compile/resolve.js +0 -155
- package/esm/node_modules/ajv/dist/compile/rules.js +0 -26
- package/esm/node_modules/ajv/dist/compile/util.js +0 -178
- package/esm/node_modules/ajv/dist/compile/validate/applicability.js +0 -19
- package/esm/node_modules/ajv/dist/compile/validate/boolSchema.js +0 -50
- package/esm/node_modules/ajv/dist/compile/validate/dataType.js +0 -203
- package/esm/node_modules/ajv/dist/compile/validate/defaults.js +0 -35
- package/esm/node_modules/ajv/dist/compile/validate/index.js +0 -520
- package/esm/node_modules/ajv/dist/compile/validate/keyword.js +0 -124
- package/esm/node_modules/ajv/dist/compile/validate/subschema.js +0 -81
- package/esm/node_modules/ajv/dist/core.js +0 -618
- package/esm/node_modules/ajv/dist/refs/data.json +0 -13
- package/esm/node_modules/ajv/dist/refs/json-schema-draft-07.json +0 -151
- package/esm/node_modules/ajv/dist/runtime/equal.js +0 -7
- package/esm/node_modules/ajv/dist/runtime/ucs2length.js +0 -24
- package/esm/node_modules/ajv/dist/runtime/uri.js +0 -6
- package/esm/node_modules/ajv/dist/runtime/validation_error.js +0 -11
- package/esm/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js +0 -49
- package/esm/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js +0 -106
- package/esm/node_modules/ajv/dist/vocabularies/applicator/allOf.js +0 -23
- package/esm/node_modules/ajv/dist/vocabularies/applicator/anyOf.js +0 -12
- package/esm/node_modules/ajv/dist/vocabularies/applicator/contains.js +0 -95
- package/esm/node_modules/ajv/dist/vocabularies/applicator/dependencies.js +0 -85
- package/esm/node_modules/ajv/dist/vocabularies/applicator/if.js +0 -66
- package/esm/node_modules/ajv/dist/vocabularies/applicator/index.js +0 -44
- package/esm/node_modules/ajv/dist/vocabularies/applicator/items.js +0 -52
- package/esm/node_modules/ajv/dist/vocabularies/applicator/items2020.js +0 -30
- package/esm/node_modules/ajv/dist/vocabularies/applicator/not.js +0 -26
- package/esm/node_modules/ajv/dist/vocabularies/applicator/oneOf.js +0 -60
- package/esm/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js +0 -75
- package/esm/node_modules/ajv/dist/vocabularies/applicator/prefixItems.js +0 -12
- package/esm/node_modules/ajv/dist/vocabularies/applicator/properties.js +0 -54
- package/esm/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js +0 -38
- package/esm/node_modules/ajv/dist/vocabularies/applicator/thenElse.js +0 -13
- package/esm/node_modules/ajv/dist/vocabularies/code.js +0 -131
- package/esm/node_modules/ajv/dist/vocabularies/core/id.js +0 -10
- package/esm/node_modules/ajv/dist/vocabularies/core/index.js +0 -16
- package/esm/node_modules/ajv/dist/vocabularies/core/ref.js +0 -122
- package/esm/node_modules/ajv/dist/vocabularies/discriminator/index.js +0 -104
- package/esm/node_modules/ajv/dist/vocabularies/discriminator/types.js +0 -9
- package/esm/node_modules/ajv/dist/vocabularies/draft7.js +0 -17
- package/esm/node_modules/ajv/dist/vocabularies/format/format.js +0 -92
- package/esm/node_modules/ajv/dist/vocabularies/format/index.js +0 -6
- package/esm/node_modules/ajv/dist/vocabularies/metadata.js +0 -18
- package/esm/node_modules/ajv/dist/vocabularies/validation/const.js +0 -25
- package/esm/node_modules/ajv/dist/vocabularies/validation/enum.js +0 -48
- package/esm/node_modules/ajv/dist/vocabularies/validation/index.js +0 -33
- package/esm/node_modules/ajv/dist/vocabularies/validation/limitItems.js +0 -24
- package/esm/node_modules/ajv/dist/vocabularies/validation/limitLength.js +0 -27
- package/esm/node_modules/ajv/dist/vocabularies/validation/limitNumber.js +0 -27
- package/esm/node_modules/ajv/dist/vocabularies/validation/limitProperties.js +0 -24
- package/esm/node_modules/ajv/dist/vocabularies/validation/multipleOf.js +0 -26
- package/esm/node_modules/ajv/dist/vocabularies/validation/pattern.js +0 -24
- package/esm/node_modules/ajv/dist/vocabularies/validation/required.js +0 -79
- package/esm/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js +0 -64
- package/esm/node_modules/ajv-formats/dist/formats.js +0 -173
- package/esm/node_modules/ajv-formats/dist/index.js +0 -37
- package/esm/node_modules/ajv-formats/dist/limit.js +0 -69
- package/esm/node_modules/ajv-i18n/localize/zh/index.js +0 -154
- package/esm/node_modules/fast-deep-equal/index.js +0 -46
- package/esm/node_modules/fast-uri/index.js +0 -303
- package/esm/node_modules/fast-uri/lib/schemes.js +0 -188
- package/esm/node_modules/fast-uri/lib/scopedChars.js +0 -30
- package/esm/node_modules/fast-uri/lib/utils.js +0 -244
- package/esm/node_modules/json-schema-traverse/index.js +0 -89
- package/esm/node_modules/semver/classes/comparator.js +0 -143
- package/esm/node_modules/semver/classes/range.js +0 -557
- package/esm/node_modules/semver/classes/semver.js +0 -333
- package/esm/node_modules/semver/functions/clean.js +0 -8
- package/esm/node_modules/semver/functions/cmp.js +0 -54
- package/esm/node_modules/semver/functions/coerce.js +0 -62
- package/esm/node_modules/semver/functions/compare-build.js +0 -9
- package/esm/node_modules/semver/functions/compare-loose.js +0 -5
- package/esm/node_modules/semver/functions/compare.js +0 -7
- package/esm/node_modules/semver/functions/diff.js +0 -60
- package/esm/node_modules/semver/functions/eq.js +0 -5
- package/esm/node_modules/semver/functions/gt.js +0 -5
- package/esm/node_modules/semver/functions/gte.js +0 -5
- package/esm/node_modules/semver/functions/inc.js +0 -21
- package/esm/node_modules/semver/functions/lt.js +0 -5
- package/esm/node_modules/semver/functions/lte.js +0 -5
- package/esm/node_modules/semver/functions/major.js +0 -5
- package/esm/node_modules/semver/functions/minor.js +0 -5
- package/esm/node_modules/semver/functions/neq.js +0 -5
- package/esm/node_modules/semver/functions/parse.js +0 -18
- package/esm/node_modules/semver/functions/patch.js +0 -5
- package/esm/node_modules/semver/functions/prerelease.js +0 -8
- package/esm/node_modules/semver/functions/rcompare.js +0 -5
- package/esm/node_modules/semver/functions/rsort.js +0 -5
- package/esm/node_modules/semver/functions/satisfies.js +0 -12
- package/esm/node_modules/semver/functions/sort.js +0 -5
- package/esm/node_modules/semver/functions/valid.js +0 -8
- package/esm/node_modules/semver/index.js +0 -91
- package/esm/node_modules/semver/internal/constants.js +0 -37
- package/esm/node_modules/semver/internal/debug.js +0 -11
- package/esm/node_modules/semver/internal/identifiers.js +0 -29
- package/esm/node_modules/semver/internal/lrucache.js +0 -42
- package/esm/node_modules/semver/internal/parse-options.js +0 -17
- package/esm/node_modules/semver/internal/re.js +0 -223
- package/esm/node_modules/semver/ranges/gtr.js +0 -6
- package/esm/node_modules/semver/ranges/intersects.js +0 -9
- package/esm/node_modules/semver/ranges/ltr.js +0 -6
- package/esm/node_modules/semver/ranges/max-satisfying.js +0 -27
- package/esm/node_modules/semver/ranges/min-satisfying.js +0 -26
- package/esm/node_modules/semver/ranges/min-version.js +0 -63
- package/esm/node_modules/semver/ranges/outside.js +0 -82
- package/esm/node_modules/semver/ranges/simplify.js +0 -49
- package/esm/node_modules/semver/ranges/subset.js +0 -249
- package/esm/node_modules/semver/ranges/to-comparators.js +0 -10
- package/esm/node_modules/semver/ranges/valid.js +0 -13
- package/esm/util/fetch.ts.js +0 -190
- package/esm/util/index.ts.js +0 -276
|
@@ -1,143 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ValueScope = exports.ValueScopeName = exports.Scope = exports.varKinds = exports.UsedValueState = void 0;
|
|
4
|
-
const code_1 = require('./code.js');
|
|
5
|
-
class ValueError extends Error {
|
|
6
|
-
constructor(name) {
|
|
7
|
-
super(`CodeGen: "code" for ${name} not defined`);
|
|
8
|
-
this.value = name.value;
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
var UsedValueState;
|
|
12
|
-
(function (UsedValueState) {
|
|
13
|
-
UsedValueState[UsedValueState["Started"] = 0] = "Started";
|
|
14
|
-
UsedValueState[UsedValueState["Completed"] = 1] = "Completed";
|
|
15
|
-
})(UsedValueState || (exports.UsedValueState = UsedValueState = {}));
|
|
16
|
-
exports.varKinds = {
|
|
17
|
-
const: new code_1.Name("const"),
|
|
18
|
-
let: new code_1.Name("let"),
|
|
19
|
-
var: new code_1.Name("var"),
|
|
20
|
-
};
|
|
21
|
-
class Scope {
|
|
22
|
-
constructor({ prefixes, parent } = {}) {
|
|
23
|
-
this._names = {};
|
|
24
|
-
this._prefixes = prefixes;
|
|
25
|
-
this._parent = parent;
|
|
26
|
-
}
|
|
27
|
-
toName(nameOrPrefix) {
|
|
28
|
-
return nameOrPrefix instanceof code_1.Name ? nameOrPrefix : this.name(nameOrPrefix);
|
|
29
|
-
}
|
|
30
|
-
name(prefix) {
|
|
31
|
-
return new code_1.Name(this._newName(prefix));
|
|
32
|
-
}
|
|
33
|
-
_newName(prefix) {
|
|
34
|
-
const ng = this._names[prefix] || this._nameGroup(prefix);
|
|
35
|
-
return `${prefix}${ng.index++}`;
|
|
36
|
-
}
|
|
37
|
-
_nameGroup(prefix) {
|
|
38
|
-
var _a, _b;
|
|
39
|
-
if (((_b = (_a = this._parent) === null || _a === void 0 ? void 0 : _a._prefixes) === null || _b === void 0 ? void 0 : _b.has(prefix)) || (this._prefixes && !this._prefixes.has(prefix))) {
|
|
40
|
-
throw new Error(`CodeGen: prefix "${prefix}" is not allowed in this scope`);
|
|
41
|
-
}
|
|
42
|
-
return (this._names[prefix] = { prefix, index: 0 });
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
exports.Scope = Scope;
|
|
46
|
-
class ValueScopeName extends code_1.Name {
|
|
47
|
-
constructor(prefix, nameStr) {
|
|
48
|
-
super(nameStr);
|
|
49
|
-
this.prefix = prefix;
|
|
50
|
-
}
|
|
51
|
-
setValue(value, { property, itemIndex }) {
|
|
52
|
-
this.value = value;
|
|
53
|
-
this.scopePath = (0, code_1._) `.${new code_1.Name(property)}[${itemIndex}]`;
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
exports.ValueScopeName = ValueScopeName;
|
|
57
|
-
const line = (0, code_1._) `\n`;
|
|
58
|
-
class ValueScope extends Scope {
|
|
59
|
-
constructor(opts) {
|
|
60
|
-
super(opts);
|
|
61
|
-
this._values = {};
|
|
62
|
-
this._scope = opts.scope;
|
|
63
|
-
this.opts = { ...opts, _n: opts.lines ? line : code_1.nil };
|
|
64
|
-
}
|
|
65
|
-
get() {
|
|
66
|
-
return this._scope;
|
|
67
|
-
}
|
|
68
|
-
name(prefix) {
|
|
69
|
-
return new ValueScopeName(prefix, this._newName(prefix));
|
|
70
|
-
}
|
|
71
|
-
value(nameOrPrefix, value) {
|
|
72
|
-
var _a;
|
|
73
|
-
if (value.ref === undefined)
|
|
74
|
-
throw new Error("CodeGen: ref must be passed in value");
|
|
75
|
-
const name = this.toName(nameOrPrefix);
|
|
76
|
-
const { prefix } = name;
|
|
77
|
-
const valueKey = (_a = value.key) !== null && _a !== void 0 ? _a : value.ref;
|
|
78
|
-
let vs = this._values[prefix];
|
|
79
|
-
if (vs) {
|
|
80
|
-
const _name = vs.get(valueKey);
|
|
81
|
-
if (_name)
|
|
82
|
-
return _name;
|
|
83
|
-
}
|
|
84
|
-
else {
|
|
85
|
-
vs = this._values[prefix] = new Map();
|
|
86
|
-
}
|
|
87
|
-
vs.set(valueKey, name);
|
|
88
|
-
const s = this._scope[prefix] || (this._scope[prefix] = []);
|
|
89
|
-
const itemIndex = s.length;
|
|
90
|
-
s[itemIndex] = value.ref;
|
|
91
|
-
name.setValue(value, { property: prefix, itemIndex });
|
|
92
|
-
return name;
|
|
93
|
-
}
|
|
94
|
-
getValue(prefix, keyOrRef) {
|
|
95
|
-
const vs = this._values[prefix];
|
|
96
|
-
if (!vs)
|
|
97
|
-
return;
|
|
98
|
-
return vs.get(keyOrRef);
|
|
99
|
-
}
|
|
100
|
-
scopeRefs(scopeName, values = this._values) {
|
|
101
|
-
return this._reduceValues(values, (name) => {
|
|
102
|
-
if (name.scopePath === undefined)
|
|
103
|
-
throw new Error(`CodeGen: name "${name}" has no value`);
|
|
104
|
-
return (0, code_1._) `${scopeName}${name.scopePath}`;
|
|
105
|
-
});
|
|
106
|
-
}
|
|
107
|
-
scopeCode(values = this._values, usedValues, getCode) {
|
|
108
|
-
return this._reduceValues(values, (name) => {
|
|
109
|
-
if (name.value === undefined)
|
|
110
|
-
throw new Error(`CodeGen: name "${name}" has no value`);
|
|
111
|
-
return name.value.code;
|
|
112
|
-
}, usedValues, getCode);
|
|
113
|
-
}
|
|
114
|
-
_reduceValues(values, valueCode, usedValues = {}, getCode) {
|
|
115
|
-
let code = code_1.nil;
|
|
116
|
-
for (const prefix in values) {
|
|
117
|
-
const vs = values[prefix];
|
|
118
|
-
if (!vs)
|
|
119
|
-
continue;
|
|
120
|
-
const nameSet = (usedValues[prefix] = usedValues[prefix] || new Map());
|
|
121
|
-
vs.forEach((name) => {
|
|
122
|
-
if (nameSet.has(name))
|
|
123
|
-
return;
|
|
124
|
-
nameSet.set(name, UsedValueState.Started);
|
|
125
|
-
let c = valueCode(name);
|
|
126
|
-
if (c) {
|
|
127
|
-
const def = this.opts.es5 ? exports.varKinds.var : exports.varKinds.const;
|
|
128
|
-
code = (0, code_1._) `${code}${def} ${name} = ${c};${this.opts._n}`;
|
|
129
|
-
}
|
|
130
|
-
else if ((c = getCode === null || getCode === void 0 ? void 0 : getCode(name))) {
|
|
131
|
-
code = (0, code_1._) `${code}${c}${this.opts._n}`;
|
|
132
|
-
}
|
|
133
|
-
else {
|
|
134
|
-
throw new ValueError(name);
|
|
135
|
-
}
|
|
136
|
-
nameSet.set(name, UsedValueState.Completed);
|
|
137
|
-
});
|
|
138
|
-
}
|
|
139
|
-
return code;
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
exports.ValueScope = ValueScope;
|
|
143
|
-
//# sourceMappingURL=scope.js.map
|
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.extendErrors = exports.resetErrorsCount = exports.reportExtraError = exports.reportError = exports.keyword$DataError = exports.keywordError = void 0;
|
|
4
|
-
const codegen_1 = require('./codegen/index.js');
|
|
5
|
-
const util_1 = require('./util.js');
|
|
6
|
-
const names_1 = require('./names.js');
|
|
7
|
-
exports.keywordError = {
|
|
8
|
-
message: ({ keyword }) => (0, codegen_1.str) `must pass "${keyword}" keyword validation`,
|
|
9
|
-
};
|
|
10
|
-
exports.keyword$DataError = {
|
|
11
|
-
message: ({ keyword, schemaType }) => schemaType
|
|
12
|
-
? (0, codegen_1.str) `"${keyword}" keyword must be ${schemaType} ($data)`
|
|
13
|
-
: (0, codegen_1.str) `"${keyword}" keyword is invalid ($data)`,
|
|
14
|
-
};
|
|
15
|
-
function reportError(cxt, error = exports.keywordError, errorPaths, overrideAllErrors) {
|
|
16
|
-
const { it } = cxt;
|
|
17
|
-
const { gen, compositeRule, allErrors } = it;
|
|
18
|
-
const errObj = errorObjectCode(cxt, error, errorPaths);
|
|
19
|
-
if (overrideAllErrors !== null && overrideAllErrors !== void 0 ? overrideAllErrors : (compositeRule || allErrors)) {
|
|
20
|
-
addError(gen, errObj);
|
|
21
|
-
}
|
|
22
|
-
else {
|
|
23
|
-
returnErrors(it, (0, codegen_1._) `[${errObj}]`);
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
exports.reportError = reportError;
|
|
27
|
-
function reportExtraError(cxt, error = exports.keywordError, errorPaths) {
|
|
28
|
-
const { it } = cxt;
|
|
29
|
-
const { gen, compositeRule, allErrors } = it;
|
|
30
|
-
const errObj = errorObjectCode(cxt, error, errorPaths);
|
|
31
|
-
addError(gen, errObj);
|
|
32
|
-
if (!(compositeRule || allErrors)) {
|
|
33
|
-
returnErrors(it, names_1.default.vErrors);
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
exports.reportExtraError = reportExtraError;
|
|
37
|
-
function resetErrorsCount(gen, errsCount) {
|
|
38
|
-
gen.assign(names_1.default.errors, errsCount);
|
|
39
|
-
gen.if((0, codegen_1._) `${names_1.default.vErrors} !== null`, () => gen.if(errsCount, () => gen.assign((0, codegen_1._) `${names_1.default.vErrors}.length`, errsCount), () => gen.assign(names_1.default.vErrors, null)));
|
|
40
|
-
}
|
|
41
|
-
exports.resetErrorsCount = resetErrorsCount;
|
|
42
|
-
function extendErrors({ gen, keyword, schemaValue, data, errsCount, it, }) {
|
|
43
|
-
/* istanbul ignore if */
|
|
44
|
-
if (errsCount === undefined)
|
|
45
|
-
throw new Error("ajv implementation error");
|
|
46
|
-
const err = gen.name("err");
|
|
47
|
-
gen.forRange("i", errsCount, names_1.default.errors, (i) => {
|
|
48
|
-
gen.const(err, (0, codegen_1._) `${names_1.default.vErrors}[${i}]`);
|
|
49
|
-
gen.if((0, codegen_1._) `${err}.instancePath === undefined`, () => gen.assign((0, codegen_1._) `${err}.instancePath`, (0, codegen_1.strConcat)(names_1.default.instancePath, it.errorPath)));
|
|
50
|
-
gen.assign((0, codegen_1._) `${err}.schemaPath`, (0, codegen_1.str) `${it.errSchemaPath}/${keyword}`);
|
|
51
|
-
if (it.opts.verbose) {
|
|
52
|
-
gen.assign((0, codegen_1._) `${err}.schema`, schemaValue);
|
|
53
|
-
gen.assign((0, codegen_1._) `${err}.data`, data);
|
|
54
|
-
}
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
exports.extendErrors = extendErrors;
|
|
58
|
-
function addError(gen, errObj) {
|
|
59
|
-
const err = gen.const("err", errObj);
|
|
60
|
-
gen.if((0, codegen_1._) `${names_1.default.vErrors} === null`, () => gen.assign(names_1.default.vErrors, (0, codegen_1._) `[${err}]`), (0, codegen_1._) `${names_1.default.vErrors}.push(${err})`);
|
|
61
|
-
gen.code((0, codegen_1._) `${names_1.default.errors}++`);
|
|
62
|
-
}
|
|
63
|
-
function returnErrors(it, errs) {
|
|
64
|
-
const { gen, validateName, schemaEnv } = it;
|
|
65
|
-
if (schemaEnv.$async) {
|
|
66
|
-
gen.throw((0, codegen_1._) `new ${it.ValidationError}(${errs})`);
|
|
67
|
-
}
|
|
68
|
-
else {
|
|
69
|
-
gen.assign((0, codegen_1._) `${validateName}.errors`, errs);
|
|
70
|
-
gen.return(false);
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
const E = {
|
|
74
|
-
keyword: new codegen_1.Name("keyword"),
|
|
75
|
-
schemaPath: new codegen_1.Name("schemaPath"), // also used in JTD errors
|
|
76
|
-
params: new codegen_1.Name("params"),
|
|
77
|
-
propertyName: new codegen_1.Name("propertyName"),
|
|
78
|
-
message: new codegen_1.Name("message"),
|
|
79
|
-
schema: new codegen_1.Name("schema"),
|
|
80
|
-
parentSchema: new codegen_1.Name("parentSchema"),
|
|
81
|
-
};
|
|
82
|
-
function errorObjectCode(cxt, error, errorPaths) {
|
|
83
|
-
const { createErrors } = cxt.it;
|
|
84
|
-
if (createErrors === false)
|
|
85
|
-
return (0, codegen_1._) `{}`;
|
|
86
|
-
return errorObject(cxt, error, errorPaths);
|
|
87
|
-
}
|
|
88
|
-
function errorObject(cxt, error, errorPaths = {}) {
|
|
89
|
-
const { gen, it } = cxt;
|
|
90
|
-
const keyValues = [
|
|
91
|
-
errorInstancePath(it, errorPaths),
|
|
92
|
-
errorSchemaPath(cxt, errorPaths),
|
|
93
|
-
];
|
|
94
|
-
extraErrorProps(cxt, error, keyValues);
|
|
95
|
-
return gen.object(...keyValues);
|
|
96
|
-
}
|
|
97
|
-
function errorInstancePath({ errorPath }, { instancePath }) {
|
|
98
|
-
const instPath = instancePath
|
|
99
|
-
? (0, codegen_1.str) `${errorPath}${(0, util_1.getErrorPath)(instancePath, util_1.Type.Str)}`
|
|
100
|
-
: errorPath;
|
|
101
|
-
return [names_1.default.instancePath, (0, codegen_1.strConcat)(names_1.default.instancePath, instPath)];
|
|
102
|
-
}
|
|
103
|
-
function errorSchemaPath({ keyword, it: { errSchemaPath } }, { schemaPath, parentSchema }) {
|
|
104
|
-
let schPath = parentSchema ? errSchemaPath : (0, codegen_1.str) `${errSchemaPath}/${keyword}`;
|
|
105
|
-
if (schemaPath) {
|
|
106
|
-
schPath = (0, codegen_1.str) `${schPath}${(0, util_1.getErrorPath)(schemaPath, util_1.Type.Str)}`;
|
|
107
|
-
}
|
|
108
|
-
return [E.schemaPath, schPath];
|
|
109
|
-
}
|
|
110
|
-
function extraErrorProps(cxt, { params, message }, keyValues) {
|
|
111
|
-
const { keyword, data, schemaValue, it } = cxt;
|
|
112
|
-
const { opts, propertyName, topSchemaRef, schemaPath } = it;
|
|
113
|
-
keyValues.push([E.keyword, keyword], [E.params, typeof params == "function" ? params(cxt) : params || (0, codegen_1._) `{}`]);
|
|
114
|
-
if (opts.messages) {
|
|
115
|
-
keyValues.push([E.message, typeof message == "function" ? message(cxt) : message]);
|
|
116
|
-
}
|
|
117
|
-
if (opts.verbose) {
|
|
118
|
-
keyValues.push([E.schema, schemaValue], [E.parentSchema, (0, codegen_1._) `${topSchemaRef}${schemaPath}`], [names_1.default.data, data]);
|
|
119
|
-
}
|
|
120
|
-
if (propertyName)
|
|
121
|
-
keyValues.push([E.propertyName, propertyName]);
|
|
122
|
-
}
|
|
123
|
-
//# sourceMappingURL=errors.js.map
|
|
@@ -1,242 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.resolveSchema = exports.getCompilingSchema = exports.resolveRef = exports.compileSchema = exports.SchemaEnv = void 0;
|
|
4
|
-
const codegen_1 = require('./codegen/index.js');
|
|
5
|
-
const validation_error_1 = require('../runtime/validation_error.js');
|
|
6
|
-
const names_1 = require('./names.js');
|
|
7
|
-
const resolve_1 = require('./resolve.js');
|
|
8
|
-
const util_1 = require('./util.js');
|
|
9
|
-
const validate_1 = require('./validate/index.js');
|
|
10
|
-
class SchemaEnv {
|
|
11
|
-
constructor(env) {
|
|
12
|
-
var _a;
|
|
13
|
-
this.refs = {};
|
|
14
|
-
this.dynamicAnchors = {};
|
|
15
|
-
let schema;
|
|
16
|
-
if (typeof env.schema == "object")
|
|
17
|
-
schema = env.schema;
|
|
18
|
-
this.schema = env.schema;
|
|
19
|
-
this.schemaId = env.schemaId;
|
|
20
|
-
this.root = env.root || this;
|
|
21
|
-
this.baseId = (_a = env.baseId) !== null && _a !== void 0 ? _a : (0, resolve_1.normalizeId)(schema === null || schema === void 0 ? void 0 : schema[env.schemaId || "$id"]);
|
|
22
|
-
this.schemaPath = env.schemaPath;
|
|
23
|
-
this.localRefs = env.localRefs;
|
|
24
|
-
this.meta = env.meta;
|
|
25
|
-
this.$async = schema === null || schema === void 0 ? void 0 : schema.$async;
|
|
26
|
-
this.refs = {};
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
exports.SchemaEnv = SchemaEnv;
|
|
30
|
-
// let codeSize = 0
|
|
31
|
-
// let nodeCount = 0
|
|
32
|
-
// Compiles schema in SchemaEnv
|
|
33
|
-
function compileSchema(sch) {
|
|
34
|
-
// TODO refactor - remove compilations
|
|
35
|
-
const _sch = getCompilingSchema.call(this, sch);
|
|
36
|
-
if (_sch)
|
|
37
|
-
return _sch;
|
|
38
|
-
const rootId = (0, resolve_1.getFullPath)(this.opts.uriResolver, sch.root.baseId); // TODO if getFullPath removed 1 tests fails
|
|
39
|
-
const { es5, lines } = this.opts.code;
|
|
40
|
-
const { ownProperties } = this.opts;
|
|
41
|
-
const gen = new codegen_1.CodeGen(this.scope, { es5, lines, ownProperties });
|
|
42
|
-
let _ValidationError;
|
|
43
|
-
if (sch.$async) {
|
|
44
|
-
_ValidationError = gen.scopeValue("Error", {
|
|
45
|
-
ref: validation_error_1.default,
|
|
46
|
-
code: (0, codegen_1._) `require("ajv/dist/runtime/validation_error").default`,
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
const validateName = gen.scopeName("validate");
|
|
50
|
-
sch.validateName = validateName;
|
|
51
|
-
const schemaCxt = {
|
|
52
|
-
gen,
|
|
53
|
-
allErrors: this.opts.allErrors,
|
|
54
|
-
data: names_1.default.data,
|
|
55
|
-
parentData: names_1.default.parentData,
|
|
56
|
-
parentDataProperty: names_1.default.parentDataProperty,
|
|
57
|
-
dataNames: [names_1.default.data],
|
|
58
|
-
dataPathArr: [codegen_1.nil], // TODO can its length be used as dataLevel if nil is removed?
|
|
59
|
-
dataLevel: 0,
|
|
60
|
-
dataTypes: [],
|
|
61
|
-
definedProperties: new Set(),
|
|
62
|
-
topSchemaRef: gen.scopeValue("schema", this.opts.code.source === true
|
|
63
|
-
? { ref: sch.schema, code: (0, codegen_1.stringify)(sch.schema) }
|
|
64
|
-
: { ref: sch.schema }),
|
|
65
|
-
validateName,
|
|
66
|
-
ValidationError: _ValidationError,
|
|
67
|
-
schema: sch.schema,
|
|
68
|
-
schemaEnv: sch,
|
|
69
|
-
rootId,
|
|
70
|
-
baseId: sch.baseId || rootId,
|
|
71
|
-
schemaPath: codegen_1.nil,
|
|
72
|
-
errSchemaPath: sch.schemaPath || (this.opts.jtd ? "" : "#"),
|
|
73
|
-
errorPath: (0, codegen_1._) `""`,
|
|
74
|
-
opts: this.opts,
|
|
75
|
-
self: this,
|
|
76
|
-
};
|
|
77
|
-
let sourceCode;
|
|
78
|
-
try {
|
|
79
|
-
this._compilations.add(sch);
|
|
80
|
-
(0, validate_1.validateFunctionCode)(schemaCxt);
|
|
81
|
-
gen.optimize(this.opts.code.optimize);
|
|
82
|
-
// gen.optimize(1)
|
|
83
|
-
const validateCode = gen.toString();
|
|
84
|
-
sourceCode = `${gen.scopeRefs(names_1.default.scope)}return ${validateCode}`;
|
|
85
|
-
// console.log((codeSize += sourceCode.length), (nodeCount += gen.nodeCount))
|
|
86
|
-
if (this.opts.code.process)
|
|
87
|
-
sourceCode = this.opts.code.process(sourceCode, sch);
|
|
88
|
-
// console.log("\n\n\n *** \n", sourceCode)
|
|
89
|
-
const makeValidate = new Function(`${names_1.default.self}`, `${names_1.default.scope}`, sourceCode);
|
|
90
|
-
const validate = makeValidate(this, this.scope.get());
|
|
91
|
-
this.scope.value(validateName, { ref: validate });
|
|
92
|
-
validate.errors = null;
|
|
93
|
-
validate.schema = sch.schema;
|
|
94
|
-
validate.schemaEnv = sch;
|
|
95
|
-
if (sch.$async)
|
|
96
|
-
validate.$async = true;
|
|
97
|
-
if (this.opts.code.source === true) {
|
|
98
|
-
validate.source = { validateName, validateCode, scopeValues: gen._values };
|
|
99
|
-
}
|
|
100
|
-
if (this.opts.unevaluated) {
|
|
101
|
-
const { props, items } = schemaCxt;
|
|
102
|
-
validate.evaluated = {
|
|
103
|
-
props: props instanceof codegen_1.Name ? undefined : props,
|
|
104
|
-
items: items instanceof codegen_1.Name ? undefined : items,
|
|
105
|
-
dynamicProps: props instanceof codegen_1.Name,
|
|
106
|
-
dynamicItems: items instanceof codegen_1.Name,
|
|
107
|
-
};
|
|
108
|
-
if (validate.source)
|
|
109
|
-
validate.source.evaluated = (0, codegen_1.stringify)(validate.evaluated);
|
|
110
|
-
}
|
|
111
|
-
sch.validate = validate;
|
|
112
|
-
return sch;
|
|
113
|
-
}
|
|
114
|
-
catch (e) {
|
|
115
|
-
delete sch.validate;
|
|
116
|
-
delete sch.validateName;
|
|
117
|
-
if (sourceCode)
|
|
118
|
-
this.logger.error("Error compiling schema, function code:", sourceCode);
|
|
119
|
-
// console.log("\n\n\n *** \n", sourceCode, this.opts)
|
|
120
|
-
throw e;
|
|
121
|
-
}
|
|
122
|
-
finally {
|
|
123
|
-
this._compilations.delete(sch);
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
exports.compileSchema = compileSchema;
|
|
127
|
-
function resolveRef(root, baseId, ref) {
|
|
128
|
-
var _a;
|
|
129
|
-
ref = (0, resolve_1.resolveUrl)(this.opts.uriResolver, baseId, ref);
|
|
130
|
-
const schOrFunc = root.refs[ref];
|
|
131
|
-
if (schOrFunc)
|
|
132
|
-
return schOrFunc;
|
|
133
|
-
let _sch = resolve.call(this, root, ref);
|
|
134
|
-
if (_sch === undefined) {
|
|
135
|
-
const schema = (_a = root.localRefs) === null || _a === void 0 ? void 0 : _a[ref]; // TODO maybe localRefs should hold SchemaEnv
|
|
136
|
-
const { schemaId } = this.opts;
|
|
137
|
-
if (schema)
|
|
138
|
-
_sch = new SchemaEnv({ schema, schemaId, root, baseId });
|
|
139
|
-
}
|
|
140
|
-
if (_sch === undefined)
|
|
141
|
-
return;
|
|
142
|
-
return (root.refs[ref] = inlineOrCompile.call(this, _sch));
|
|
143
|
-
}
|
|
144
|
-
exports.resolveRef = resolveRef;
|
|
145
|
-
function inlineOrCompile(sch) {
|
|
146
|
-
if ((0, resolve_1.inlineRef)(sch.schema, this.opts.inlineRefs))
|
|
147
|
-
return sch.schema;
|
|
148
|
-
return sch.validate ? sch : compileSchema.call(this, sch);
|
|
149
|
-
}
|
|
150
|
-
// Index of schema compilation in the currently compiled list
|
|
151
|
-
function getCompilingSchema(schEnv) {
|
|
152
|
-
for (const sch of this._compilations) {
|
|
153
|
-
if (sameSchemaEnv(sch, schEnv))
|
|
154
|
-
return sch;
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
exports.getCompilingSchema = getCompilingSchema;
|
|
158
|
-
function sameSchemaEnv(s1, s2) {
|
|
159
|
-
return s1.schema === s2.schema && s1.root === s2.root && s1.baseId === s2.baseId;
|
|
160
|
-
}
|
|
161
|
-
// resolve and compile the references ($ref)
|
|
162
|
-
// TODO returns AnySchemaObject (if the schema can be inlined) or validation function
|
|
163
|
-
function resolve(root, // information about the root schema for the current schema
|
|
164
|
-
ref // reference to resolve
|
|
165
|
-
) {
|
|
166
|
-
let sch;
|
|
167
|
-
while (typeof (sch = this.refs[ref]) == "string")
|
|
168
|
-
ref = sch;
|
|
169
|
-
return sch || this.schemas[ref] || resolveSchema.call(this, root, ref);
|
|
170
|
-
}
|
|
171
|
-
// Resolve schema, its root and baseId
|
|
172
|
-
function resolveSchema(root, // root object with properties schema, refs TODO below SchemaEnv is assigned to it
|
|
173
|
-
ref // reference to resolve
|
|
174
|
-
) {
|
|
175
|
-
const p = this.opts.uriResolver.parse(ref);
|
|
176
|
-
const refPath = (0, resolve_1._getFullPath)(this.opts.uriResolver, p);
|
|
177
|
-
let baseId = (0, resolve_1.getFullPath)(this.opts.uriResolver, root.baseId, undefined);
|
|
178
|
-
// TODO `Object.keys(root.schema).length > 0` should not be needed - but removing breaks 2 tests
|
|
179
|
-
if (Object.keys(root.schema).length > 0 && refPath === baseId) {
|
|
180
|
-
return getJsonPointer.call(this, p, root);
|
|
181
|
-
}
|
|
182
|
-
const id = (0, resolve_1.normalizeId)(refPath);
|
|
183
|
-
const schOrRef = this.refs[id] || this.schemas[id];
|
|
184
|
-
if (typeof schOrRef == "string") {
|
|
185
|
-
const sch = resolveSchema.call(this, root, schOrRef);
|
|
186
|
-
if (typeof (sch === null || sch === void 0 ? void 0 : sch.schema) !== "object")
|
|
187
|
-
return;
|
|
188
|
-
return getJsonPointer.call(this, p, sch);
|
|
189
|
-
}
|
|
190
|
-
if (typeof (schOrRef === null || schOrRef === void 0 ? void 0 : schOrRef.schema) !== "object")
|
|
191
|
-
return;
|
|
192
|
-
if (!schOrRef.validate)
|
|
193
|
-
compileSchema.call(this, schOrRef);
|
|
194
|
-
if (id === (0, resolve_1.normalizeId)(ref)) {
|
|
195
|
-
const { schema } = schOrRef;
|
|
196
|
-
const { schemaId } = this.opts;
|
|
197
|
-
const schId = schema[schemaId];
|
|
198
|
-
if (schId)
|
|
199
|
-
baseId = (0, resolve_1.resolveUrl)(this.opts.uriResolver, baseId, schId);
|
|
200
|
-
return new SchemaEnv({ schema, schemaId, root, baseId });
|
|
201
|
-
}
|
|
202
|
-
return getJsonPointer.call(this, p, schOrRef);
|
|
203
|
-
}
|
|
204
|
-
exports.resolveSchema = resolveSchema;
|
|
205
|
-
const PREVENT_SCOPE_CHANGE = new Set([
|
|
206
|
-
"properties",
|
|
207
|
-
"patternProperties",
|
|
208
|
-
"enum",
|
|
209
|
-
"dependencies",
|
|
210
|
-
"definitions",
|
|
211
|
-
]);
|
|
212
|
-
function getJsonPointer(parsedRef, { baseId, schema, root }) {
|
|
213
|
-
var _a;
|
|
214
|
-
if (((_a = parsedRef.fragment) === null || _a === void 0 ? void 0 : _a[0]) !== "/")
|
|
215
|
-
return;
|
|
216
|
-
for (const part of parsedRef.fragment.slice(1).split("/")) {
|
|
217
|
-
if (typeof schema === "boolean")
|
|
218
|
-
return;
|
|
219
|
-
const partSchema = schema[(0, util_1.unescapeFragment)(part)];
|
|
220
|
-
if (partSchema === undefined)
|
|
221
|
-
return;
|
|
222
|
-
schema = partSchema;
|
|
223
|
-
// TODO PREVENT_SCOPE_CHANGE could be defined in keyword def?
|
|
224
|
-
const schId = typeof schema === "object" && schema[this.opts.schemaId];
|
|
225
|
-
if (!PREVENT_SCOPE_CHANGE.has(part) && schId) {
|
|
226
|
-
baseId = (0, resolve_1.resolveUrl)(this.opts.uriResolver, baseId, schId);
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
|
-
let env;
|
|
230
|
-
if (typeof schema != "boolean" && schema.$ref && !(0, util_1.schemaHasRulesButRef)(schema, this.RULES)) {
|
|
231
|
-
const $ref = (0, resolve_1.resolveUrl)(this.opts.uriResolver, baseId, schema.$ref);
|
|
232
|
-
env = resolveSchema.call(this, root, $ref);
|
|
233
|
-
}
|
|
234
|
-
// even though resolution failed we need to return SchemaEnv to throw exception
|
|
235
|
-
// so that compileAsync loads missing schema.
|
|
236
|
-
const { schemaId } = this.opts;
|
|
237
|
-
env = env || new SchemaEnv({ schema, schemaId, root, baseId });
|
|
238
|
-
if (env.schema !== env.root.schema)
|
|
239
|
-
return env;
|
|
240
|
-
return undefined;
|
|
241
|
-
}
|
|
242
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const codegen_1 = require('./codegen/index.js');
|
|
4
|
-
const names = {
|
|
5
|
-
// validation function arguments
|
|
6
|
-
data: new codegen_1.Name("data"), // data passed to validation function
|
|
7
|
-
// args passed from referencing schema
|
|
8
|
-
valCxt: new codegen_1.Name("valCxt"), // validation/data context - should not be used directly, it is destructured to the names below
|
|
9
|
-
instancePath: new codegen_1.Name("instancePath"),
|
|
10
|
-
parentData: new codegen_1.Name("parentData"),
|
|
11
|
-
parentDataProperty: new codegen_1.Name("parentDataProperty"),
|
|
12
|
-
rootData: new codegen_1.Name("rootData"), // root data - same as the data passed to the first/top validation function
|
|
13
|
-
dynamicAnchors: new codegen_1.Name("dynamicAnchors"), // used to support recursiveRef and dynamicRef
|
|
14
|
-
// function scoped variables
|
|
15
|
-
vErrors: new codegen_1.Name("vErrors"), // null or array of validation errors
|
|
16
|
-
errors: new codegen_1.Name("errors"), // counter of validation errors
|
|
17
|
-
this: new codegen_1.Name("this"),
|
|
18
|
-
// "globals"
|
|
19
|
-
self: new codegen_1.Name("self"),
|
|
20
|
-
scope: new codegen_1.Name("scope"),
|
|
21
|
-
// JTD serialize/parse name for JSON string and position
|
|
22
|
-
json: new codegen_1.Name("json"),
|
|
23
|
-
jsonPos: new codegen_1.Name("jsonPos"),
|
|
24
|
-
jsonLen: new codegen_1.Name("jsonLen"),
|
|
25
|
-
jsonPart: new codegen_1.Name("jsonPart"),
|
|
26
|
-
};
|
|
27
|
-
exports.default = names;
|
|
28
|
-
//# sourceMappingURL=names.js.map
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const resolve_1 = require('./resolve.js');
|
|
4
|
-
class MissingRefError extends Error {
|
|
5
|
-
constructor(resolver, baseId, ref, msg) {
|
|
6
|
-
super(msg || `can't resolve reference ${ref} from id ${baseId}`);
|
|
7
|
-
this.missingRef = (0, resolve_1.resolveUrl)(resolver, baseId, ref);
|
|
8
|
-
this.missingSchema = (0, resolve_1.normalizeId)((0, resolve_1.getFullPath)(resolver, this.missingRef));
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
exports.default = MissingRefError;
|
|
12
|
-
//# sourceMappingURL=ref_error.js.map
|