@featurevisor/core 2.10.0 → 2.12.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 +22 -0
- package/coverage/clover.xml +684 -3
- package/coverage/coverage-final.json +4 -0
- package/coverage/lcov-report/builder/allocator.ts.html +1 -1
- package/coverage/lcov-report/builder/buildScopedConditions.ts.html +1 -1
- package/coverage/lcov-report/builder/buildScopedDatafile.ts.html +1 -1
- package/coverage/lcov-report/builder/buildScopedSegments.ts.html +1 -1
- package/coverage/lcov-report/builder/index.html +1 -1
- package/coverage/lcov-report/builder/revision.ts.html +1 -1
- package/coverage/lcov-report/builder/traffic.ts.html +1 -1
- package/coverage/lcov-report/index.html +25 -10
- package/coverage/lcov-report/linter/conditionSchema.ts.html +775 -0
- package/coverage/lcov-report/linter/featureSchema.ts.html +4924 -0
- package/coverage/lcov-report/linter/index.html +161 -0
- package/coverage/lcov-report/linter/schema.ts.html +1471 -0
- package/coverage/lcov-report/linter/segmentSchema.ts.html +130 -0
- package/coverage/lcov-report/list/index.html +1 -1
- package/coverage/lcov-report/list/matrix.ts.html +1 -1
- package/coverage/lcov-report/parsers/index.html +1 -1
- package/coverage/lcov-report/parsers/json.ts.html +1 -1
- package/coverage/lcov-report/parsers/yml.ts.html +1 -1
- package/coverage/lcov-report/tester/helpers.ts.html +1 -1
- package/coverage/lcov-report/tester/index.html +1 -1
- package/coverage/lcov.info +1471 -0
- package/lib/builder/buildDatafile.js +15 -1
- package/lib/builder/buildDatafile.js.map +1 -1
- package/lib/config/projectConfig.d.ts +2 -0
- package/lib/config/projectConfig.js +3 -1
- package/lib/config/projectConfig.js.map +1 -1
- package/lib/datasource/datasource.d.ts +6 -1
- package/lib/datasource/datasource.js +16 -0
- package/lib/datasource/datasource.js.map +1 -1
- package/lib/datasource/filesystemAdapter.js +10 -0
- package/lib/datasource/filesystemAdapter.js.map +1 -1
- package/lib/generate-code/typescript.js +283 -49
- package/lib/generate-code/typescript.js.map +1 -1
- package/lib/linter/conditionSchema.spec.d.ts +1 -0
- package/lib/linter/conditionSchema.spec.js +331 -0
- package/lib/linter/conditionSchema.spec.js.map +1 -0
- package/lib/linter/featureSchema.d.ts +153 -17
- package/lib/linter/featureSchema.js +536 -49
- package/lib/linter/featureSchema.js.map +1 -1
- package/lib/linter/featureSchema.spec.d.ts +1 -0
- package/lib/linter/featureSchema.spec.js +978 -0
- package/lib/linter/featureSchema.spec.js.map +1 -0
- package/lib/linter/lintProject.js +67 -1
- package/lib/linter/lintProject.js.map +1 -1
- package/lib/linter/schema.d.ts +42 -0
- package/lib/linter/schema.js +417 -0
- package/lib/linter/schema.js.map +1 -0
- package/lib/linter/schema.spec.d.ts +1 -0
- package/lib/linter/schema.spec.js +483 -0
- package/lib/linter/schema.spec.js.map +1 -0
- package/lib/linter/segmentSchema.spec.d.ts +1 -0
- package/lib/linter/segmentSchema.spec.js +231 -0
- package/lib/linter/segmentSchema.spec.js.map +1 -0
- package/lib/tester/testFeature.js +5 -3
- package/lib/tester/testFeature.js.map +1 -1
- package/lib/utils/git.js +3 -0
- package/lib/utils/git.js.map +1 -1
- package/package.json +5 -5
- package/src/builder/buildDatafile.ts +17 -1
- package/src/config/projectConfig.ts +3 -0
- package/src/datasource/datasource.ts +23 -0
- package/src/datasource/filesystemAdapter.ts +7 -0
- package/src/generate-code/typescript.ts +333 -52
- package/src/linter/conditionSchema.spec.ts +446 -0
- package/src/linter/featureSchema.spec.ts +1218 -0
- package/src/linter/featureSchema.ts +747 -70
- package/src/linter/lintProject.ts +84 -0
- package/src/linter/schema.spec.ts +617 -0
- package/src/linter/schema.ts +462 -0
- package/src/linter/segmentSchema.spec.ts +273 -0
- package/src/tester/testFeature.ts +5 -3
- package/src/utils/git.ts +2 -0
- package/lib/linter/propertySchema.d.ts +0 -5
- package/lib/linter/propertySchema.js +0 -43
- package/lib/linter/propertySchema.js.map +0 -1
- package/src/linter/propertySchema.ts +0 -47
|
@@ -0,0 +1,417 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.propertyTypeEnum = exports.valueZodSchema = void 0;
|
|
4
|
+
exports.refineEnumMatchesType = refineEnumMatchesType;
|
|
5
|
+
exports.refineMinimumMaximum = refineMinimumMaximum;
|
|
6
|
+
exports.refineStringLengthPattern = refineStringLengthPattern;
|
|
7
|
+
exports.refineArrayItems = refineArrayItems;
|
|
8
|
+
exports.getSchemaZodSchema = getSchemaZodSchema;
|
|
9
|
+
const zod_1 = require("zod");
|
|
10
|
+
/** Returns true if value matches the schema type. */
|
|
11
|
+
function valueMatchesType(v, type) {
|
|
12
|
+
switch (type) {
|
|
13
|
+
case "string":
|
|
14
|
+
return typeof v === "string";
|
|
15
|
+
case "boolean":
|
|
16
|
+
return typeof v === "boolean";
|
|
17
|
+
case "integer":
|
|
18
|
+
return typeof v === "number" && Number.isInteger(v);
|
|
19
|
+
case "double":
|
|
20
|
+
return typeof v === "number";
|
|
21
|
+
case "object":
|
|
22
|
+
return typeof v === "object" && v !== null && !Array.isArray(v);
|
|
23
|
+
case "array":
|
|
24
|
+
return Array.isArray(v);
|
|
25
|
+
default:
|
|
26
|
+
return true;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Recursively validates that when a schema has both `type` and `enum`, every enum value matches the type.
|
|
31
|
+
* Also recurses into oneOf branches.
|
|
32
|
+
*/
|
|
33
|
+
function refineEnumMatchesType(schema, pathPrefix, ctx) {
|
|
34
|
+
if (!schema || typeof schema !== "object")
|
|
35
|
+
return;
|
|
36
|
+
const type = schema.type;
|
|
37
|
+
const enumArr = schema.enum;
|
|
38
|
+
if (type && Array.isArray(enumArr) && enumArr.length > 0) {
|
|
39
|
+
for (let i = 0; i < enumArr.length; i++) {
|
|
40
|
+
const v = enumArr[i];
|
|
41
|
+
if (!valueMatchesType(v, type)) {
|
|
42
|
+
ctx.addIssue({
|
|
43
|
+
code: zod_1.z.ZodIssueCode.custom,
|
|
44
|
+
message: `Enum value at index ${i} (${JSON.stringify(v)}) does not match type "${type}". All enum values must be of the same type as \`type\`.`,
|
|
45
|
+
path: [...pathPrefix, "enum", i],
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
if (schema.items && typeof schema.items === "object") {
|
|
51
|
+
refineEnumMatchesType(schema.items, [...pathPrefix, "items"], ctx);
|
|
52
|
+
}
|
|
53
|
+
if (schema.properties && typeof schema.properties === "object") {
|
|
54
|
+
for (const k of Object.keys(schema.properties)) {
|
|
55
|
+
refineEnumMatchesType(schema.properties[k], [...pathPrefix, "properties", k], ctx);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
if (schema.oneOf && Array.isArray(schema.oneOf)) {
|
|
59
|
+
schema.oneOf.forEach((branch, i) => {
|
|
60
|
+
if (branch && typeof branch === "object") {
|
|
61
|
+
refineEnumMatchesType(branch, [...pathPrefix, "oneOf", i], ctx);
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Validates that when a schema has type "integer" or "double", minimum <= maximum when both set,
|
|
68
|
+
* and const/enum values (if present) fall within the range.
|
|
69
|
+
*/
|
|
70
|
+
function refineMinimumMaximum(schema, pathPrefix, ctx) {
|
|
71
|
+
if (!schema || typeof schema !== "object")
|
|
72
|
+
return;
|
|
73
|
+
const type = schema.type;
|
|
74
|
+
const min = schema.minimum;
|
|
75
|
+
const max = schema.maximum;
|
|
76
|
+
const isNumeric = type === "integer" || type === "double";
|
|
77
|
+
if (isNumeric && min !== undefined && max !== undefined && min > max) {
|
|
78
|
+
ctx.addIssue({
|
|
79
|
+
code: zod_1.z.ZodIssueCode.custom,
|
|
80
|
+
message: `When \`type\` is "${type}", \`minimum\` (${min}) must be less than or equal to \`maximum\` (${max}).`,
|
|
81
|
+
path: [...pathPrefix, "minimum"],
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
if (isNumeric && min !== undefined && schema.const !== undefined) {
|
|
85
|
+
const v = schema.const;
|
|
86
|
+
if (typeof v === "number" && v < min) {
|
|
87
|
+
ctx.addIssue({
|
|
88
|
+
code: zod_1.z.ZodIssueCode.custom,
|
|
89
|
+
message: `\`const\` value ${v} is less than \`minimum\` (${min}).`,
|
|
90
|
+
path: [...pathPrefix, "const"],
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
if (isNumeric && max !== undefined && schema.const !== undefined) {
|
|
95
|
+
const v = schema.const;
|
|
96
|
+
if (typeof v === "number" && v > max) {
|
|
97
|
+
ctx.addIssue({
|
|
98
|
+
code: zod_1.z.ZodIssueCode.custom,
|
|
99
|
+
message: `\`const\` value ${v} is greater than \`maximum\` (${max}).`,
|
|
100
|
+
path: [...pathPrefix, "const"],
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
if (isNumeric && Array.isArray(schema.enum) && schema.enum.length > 0) {
|
|
105
|
+
for (let i = 0; i < schema.enum.length; i++) {
|
|
106
|
+
const v = schema.enum[i];
|
|
107
|
+
if (typeof v === "number") {
|
|
108
|
+
if (min !== undefined && v < min) {
|
|
109
|
+
ctx.addIssue({
|
|
110
|
+
code: zod_1.z.ZodIssueCode.custom,
|
|
111
|
+
message: `Enum value at index ${i} (${v}) is less than \`minimum\` (${min}).`,
|
|
112
|
+
path: [...pathPrefix, "enum", i],
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
if (max !== undefined && v > max) {
|
|
116
|
+
ctx.addIssue({
|
|
117
|
+
code: zod_1.z.ZodIssueCode.custom,
|
|
118
|
+
message: `Enum value at index ${i} (${v}) is greater than \`maximum\` (${max}).`,
|
|
119
|
+
path: [...pathPrefix, "enum", i],
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
if (schema.items && typeof schema.items === "object") {
|
|
126
|
+
refineMinimumMaximum(schema.items, [...pathPrefix, "items"], ctx);
|
|
127
|
+
}
|
|
128
|
+
if (schema.properties && typeof schema.properties === "object") {
|
|
129
|
+
for (const k of Object.keys(schema.properties)) {
|
|
130
|
+
refineMinimumMaximum(schema.properties[k], [...pathPrefix, "properties", k], ctx);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
if (schema.oneOf && Array.isArray(schema.oneOf)) {
|
|
134
|
+
schema.oneOf.forEach((branch, i) => {
|
|
135
|
+
if (branch && typeof branch === "object") {
|
|
136
|
+
refineMinimumMaximum(branch, [...pathPrefix, "oneOf", i], ctx);
|
|
137
|
+
}
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Validates that when a schema has type "string", minLength <= maxLength when both set,
|
|
143
|
+
* pattern is a valid RegExp (if set), and const/enum string values satisfy length and pattern.
|
|
144
|
+
*/
|
|
145
|
+
function refineStringLengthPattern(schema, pathPrefix, ctx) {
|
|
146
|
+
if (!schema || typeof schema !== "object")
|
|
147
|
+
return;
|
|
148
|
+
const type = schema.type;
|
|
149
|
+
const minLen = schema.minLength;
|
|
150
|
+
const maxLen = schema.maxLength;
|
|
151
|
+
const patternStr = schema.pattern;
|
|
152
|
+
const isString = type === "string";
|
|
153
|
+
if (isString && minLen !== undefined && maxLen !== undefined && minLen > maxLen) {
|
|
154
|
+
ctx.addIssue({
|
|
155
|
+
code: zod_1.z.ZodIssueCode.custom,
|
|
156
|
+
message: `When \`type\` is "string", \`minLength\` (${minLen}) must be less than or equal to \`maxLength\` (${maxLen}).`,
|
|
157
|
+
path: [...pathPrefix, "minLength"],
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
if (isString && patternStr !== undefined) {
|
|
161
|
+
try {
|
|
162
|
+
new RegExp(patternStr);
|
|
163
|
+
}
|
|
164
|
+
catch {
|
|
165
|
+
ctx.addIssue({
|
|
166
|
+
code: zod_1.z.ZodIssueCode.custom,
|
|
167
|
+
message: `\`pattern\` must be a valid ECMA-262 regular expression; "${patternStr}" is invalid.`,
|
|
168
|
+
path: [...pathPrefix, "pattern"],
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
const testString = (s) => {
|
|
173
|
+
const minOk = minLen === undefined || s.length >= minLen;
|
|
174
|
+
const maxOk = maxLen === undefined || s.length <= maxLen;
|
|
175
|
+
let patternOk = true;
|
|
176
|
+
if (patternStr !== undefined) {
|
|
177
|
+
try {
|
|
178
|
+
patternOk = new RegExp(patternStr).test(s);
|
|
179
|
+
}
|
|
180
|
+
catch {
|
|
181
|
+
patternOk = true;
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
return { minOk, maxOk, patternOk };
|
|
185
|
+
};
|
|
186
|
+
if (isString && schema.const !== undefined && typeof schema.const === "string") {
|
|
187
|
+
const { minOk, maxOk, patternOk } = testString(schema.const);
|
|
188
|
+
if (!minOk) {
|
|
189
|
+
ctx.addIssue({
|
|
190
|
+
code: zod_1.z.ZodIssueCode.custom,
|
|
191
|
+
message: `\`const\` value length (${schema.const.length}) is less than \`minLength\` (${minLen}).`,
|
|
192
|
+
path: [...pathPrefix, "const"],
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
if (!maxOk) {
|
|
196
|
+
ctx.addIssue({
|
|
197
|
+
code: zod_1.z.ZodIssueCode.custom,
|
|
198
|
+
message: `\`const\` value length (${schema.const.length}) is greater than \`maxLength\` (${maxLen}).`,
|
|
199
|
+
path: [...pathPrefix, "const"],
|
|
200
|
+
});
|
|
201
|
+
}
|
|
202
|
+
if (!patternOk) {
|
|
203
|
+
ctx.addIssue({
|
|
204
|
+
code: zod_1.z.ZodIssueCode.custom,
|
|
205
|
+
message: `\`const\` value does not match \`pattern\`.`,
|
|
206
|
+
path: [...pathPrefix, "const"],
|
|
207
|
+
});
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
if (isString && Array.isArray(schema.enum) && schema.enum.length > 0) {
|
|
211
|
+
for (let i = 0; i < schema.enum.length; i++) {
|
|
212
|
+
const v = schema.enum[i];
|
|
213
|
+
if (typeof v === "string") {
|
|
214
|
+
const { minOk, maxOk, patternOk } = testString(v);
|
|
215
|
+
if (!minOk) {
|
|
216
|
+
ctx.addIssue({
|
|
217
|
+
code: zod_1.z.ZodIssueCode.custom,
|
|
218
|
+
message: `Enum value at index ${i} length (${v.length}) is less than \`minLength\` (${minLen}).`,
|
|
219
|
+
path: [...pathPrefix, "enum", i],
|
|
220
|
+
});
|
|
221
|
+
}
|
|
222
|
+
if (!maxOk) {
|
|
223
|
+
ctx.addIssue({
|
|
224
|
+
code: zod_1.z.ZodIssueCode.custom,
|
|
225
|
+
message: `Enum value at index ${i} length (${v.length}) is greater than \`maxLength\` (${maxLen}).`,
|
|
226
|
+
path: [...pathPrefix, "enum", i],
|
|
227
|
+
});
|
|
228
|
+
}
|
|
229
|
+
if (!patternOk) {
|
|
230
|
+
ctx.addIssue({
|
|
231
|
+
code: zod_1.z.ZodIssueCode.custom,
|
|
232
|
+
message: `Enum value at index ${i} does not match \`pattern\`.`,
|
|
233
|
+
path: [...pathPrefix, "enum", i],
|
|
234
|
+
});
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
if (schema.items && typeof schema.items === "object") {
|
|
240
|
+
refineStringLengthPattern(schema.items, [...pathPrefix, "items"], ctx);
|
|
241
|
+
}
|
|
242
|
+
if (schema.properties && typeof schema.properties === "object") {
|
|
243
|
+
for (const k of Object.keys(schema.properties)) {
|
|
244
|
+
refineStringLengthPattern(schema.properties[k], [...pathPrefix, "properties", k], ctx);
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
if (schema.oneOf && Array.isArray(schema.oneOf)) {
|
|
248
|
+
schema.oneOf.forEach((branch, i) => {
|
|
249
|
+
if (branch && typeof branch === "object") {
|
|
250
|
+
refineStringLengthPattern(branch, [...pathPrefix, "oneOf", i], ctx);
|
|
251
|
+
}
|
|
252
|
+
});
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
/** Deep equality for primitive/array/object values (used for uniqueItems check). */
|
|
256
|
+
function valueDeepEqualForRefine(a, b) {
|
|
257
|
+
if (a === b)
|
|
258
|
+
return true;
|
|
259
|
+
if (typeof a !== typeof b)
|
|
260
|
+
return false;
|
|
261
|
+
if (a === null || b === null)
|
|
262
|
+
return a === b;
|
|
263
|
+
if (typeof a === "object" && typeof b === "object") {
|
|
264
|
+
if (Array.isArray(a) !== Array.isArray(b))
|
|
265
|
+
return false;
|
|
266
|
+
if (Array.isArray(a) && Array.isArray(b)) {
|
|
267
|
+
if (a.length !== b.length)
|
|
268
|
+
return false;
|
|
269
|
+
return a.every((v, i) => valueDeepEqualForRefine(v, b[i]));
|
|
270
|
+
}
|
|
271
|
+
const keysA = Object.keys(a).sort();
|
|
272
|
+
const keysB = Object.keys(b).sort();
|
|
273
|
+
if (keysA.length !== keysB.length || keysA.some((k, i) => k !== keysB[i]))
|
|
274
|
+
return false;
|
|
275
|
+
return keysA.every((k) => valueDeepEqualForRefine(a[k], b[k]));
|
|
276
|
+
}
|
|
277
|
+
return false;
|
|
278
|
+
}
|
|
279
|
+
/**
|
|
280
|
+
* Validates that when a schema has type "array", minItems <= maxItems when both set,
|
|
281
|
+
* and const/enum array values (if present) satisfy length and uniqueItems.
|
|
282
|
+
*/
|
|
283
|
+
function refineArrayItems(schema, pathPrefix, ctx) {
|
|
284
|
+
if (!schema || typeof schema !== "object")
|
|
285
|
+
return;
|
|
286
|
+
const type = schema.type;
|
|
287
|
+
const minItems = schema.minItems;
|
|
288
|
+
const maxItems = schema.maxItems;
|
|
289
|
+
const uniqueItems = schema.uniqueItems;
|
|
290
|
+
const isArray = type === "array";
|
|
291
|
+
if (isArray && minItems !== undefined && maxItems !== undefined && minItems > maxItems) {
|
|
292
|
+
ctx.addIssue({
|
|
293
|
+
code: zod_1.z.ZodIssueCode.custom,
|
|
294
|
+
message: `When \`type\` is "array", \`minItems\` (${minItems}) must be less than or equal to \`maxItems\` (${maxItems}).`,
|
|
295
|
+
path: [...pathPrefix, "minItems"],
|
|
296
|
+
});
|
|
297
|
+
}
|
|
298
|
+
const checkArray = (arr, pathSuffix) => {
|
|
299
|
+
if (minItems !== undefined && arr.length < minItems) {
|
|
300
|
+
ctx.addIssue({
|
|
301
|
+
code: zod_1.z.ZodIssueCode.custom,
|
|
302
|
+
message: `Array length (${arr.length}) is less than \`minItems\` (${minItems}).`,
|
|
303
|
+
path: pathSuffix,
|
|
304
|
+
});
|
|
305
|
+
}
|
|
306
|
+
if (maxItems !== undefined && arr.length > maxItems) {
|
|
307
|
+
ctx.addIssue({
|
|
308
|
+
code: zod_1.z.ZodIssueCode.custom,
|
|
309
|
+
message: `Array length (${arr.length}) is greater than \`maxItems\` (${maxItems}).`,
|
|
310
|
+
path: pathSuffix,
|
|
311
|
+
});
|
|
312
|
+
}
|
|
313
|
+
if (uniqueItems) {
|
|
314
|
+
for (let i = 0; i < arr.length; i++) {
|
|
315
|
+
for (let j = i + 1; j < arr.length; j++) {
|
|
316
|
+
if (valueDeepEqualForRefine(arr[i], arr[j])) {
|
|
317
|
+
ctx.addIssue({
|
|
318
|
+
code: zod_1.z.ZodIssueCode.custom,
|
|
319
|
+
message: `Array has duplicate items at indices ${i} and ${j} but \`uniqueItems\` is true.`,
|
|
320
|
+
path: pathSuffix,
|
|
321
|
+
});
|
|
322
|
+
return;
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
};
|
|
328
|
+
if (isArray && Array.isArray(schema.const)) {
|
|
329
|
+
checkArray(schema.const, [...pathPrefix, "const"]);
|
|
330
|
+
}
|
|
331
|
+
if (isArray && Array.isArray(schema.enum) && schema.enum.length > 0) {
|
|
332
|
+
for (let i = 0; i < schema.enum.length; i++) {
|
|
333
|
+
const v = schema.enum[i];
|
|
334
|
+
if (Array.isArray(v))
|
|
335
|
+
checkArray(v, [...pathPrefix, "enum", i]);
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
if (schema.items && typeof schema.items === "object") {
|
|
339
|
+
refineArrayItems(schema.items, [...pathPrefix, "items"], ctx);
|
|
340
|
+
}
|
|
341
|
+
if (schema.properties && typeof schema.properties === "object") {
|
|
342
|
+
for (const k of Object.keys(schema.properties)) {
|
|
343
|
+
refineArrayItems(schema.properties[k], [...pathPrefix, "properties", k], ctx);
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
if (schema.oneOf && Array.isArray(schema.oneOf)) {
|
|
347
|
+
schema.oneOf.forEach((branch, i) => {
|
|
348
|
+
if (branch && typeof branch === "object") {
|
|
349
|
+
refineArrayItems(branch, [...pathPrefix, "oneOf", i], ctx);
|
|
350
|
+
}
|
|
351
|
+
});
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
// Recursive schema for Value: boolean | string | number | ObjectValue | Value[]
|
|
355
|
+
exports.valueZodSchema = zod_1.z.lazy(() => zod_1.z.union([
|
|
356
|
+
zod_1.z.boolean(),
|
|
357
|
+
zod_1.z.string(),
|
|
358
|
+
zod_1.z.number(),
|
|
359
|
+
// | Date // @TODO: support in future
|
|
360
|
+
zod_1.z.record(zod_1.z.string(), exports.valueZodSchema),
|
|
361
|
+
zod_1.z.array(exports.valueZodSchema),
|
|
362
|
+
]));
|
|
363
|
+
// @TODO: support "date" in future
|
|
364
|
+
// @TODO: consider "semver" in future
|
|
365
|
+
// @TODO: consider "url" in future
|
|
366
|
+
exports.propertyTypeEnum = zod_1.z.enum([
|
|
367
|
+
"boolean",
|
|
368
|
+
"string",
|
|
369
|
+
"integer",
|
|
370
|
+
"double",
|
|
371
|
+
"object",
|
|
372
|
+
"array",
|
|
373
|
+
]);
|
|
374
|
+
function getSchemaZodSchema(schemaKeys = []) {
|
|
375
|
+
const schemaZodSchema = zod_1.z.lazy(() => zod_1.z
|
|
376
|
+
.object({
|
|
377
|
+
description: zod_1.z.string().optional(),
|
|
378
|
+
type: exports.propertyTypeEnum.optional(),
|
|
379
|
+
enum: zod_1.z.array(exports.valueZodSchema).optional(),
|
|
380
|
+
const: exports.valueZodSchema.optional(),
|
|
381
|
+
minimum: zod_1.z.number().optional(),
|
|
382
|
+
maximum: zod_1.z.number().optional(),
|
|
383
|
+
minLength: zod_1.z.number().optional(),
|
|
384
|
+
maxLength: zod_1.z.number().optional(),
|
|
385
|
+
pattern: zod_1.z.string().optional(),
|
|
386
|
+
items: schemaZodSchema.optional(),
|
|
387
|
+
minItems: zod_1.z.number().optional(),
|
|
388
|
+
maxItems: zod_1.z.number().optional(),
|
|
389
|
+
uniqueItems: zod_1.z.boolean().optional(),
|
|
390
|
+
required: zod_1.z.array(zod_1.z.string()).optional(),
|
|
391
|
+
properties: zod_1.z.record(zod_1.z.string(), schemaZodSchema).optional(),
|
|
392
|
+
// Annotations: default?: Value; examples?: Value[];
|
|
393
|
+
schema: zod_1.z
|
|
394
|
+
.string()
|
|
395
|
+
.refine((value) => schemaKeys.includes(value), (value) => ({
|
|
396
|
+
message: `Unknown schema "${value}"`,
|
|
397
|
+
}))
|
|
398
|
+
.optional(),
|
|
399
|
+
oneOf: zod_1.z.array(schemaZodSchema).min(2).optional(),
|
|
400
|
+
})
|
|
401
|
+
.strict()
|
|
402
|
+
.superRefine((data, ctx) => {
|
|
403
|
+
if (data.type === "array" && data.items === undefined) {
|
|
404
|
+
ctx.addIssue({
|
|
405
|
+
code: zod_1.z.ZodIssueCode.custom,
|
|
406
|
+
message: 'When `type` is "array", `items` is required. Define the schema for array elements.',
|
|
407
|
+
path: ["items"],
|
|
408
|
+
});
|
|
409
|
+
}
|
|
410
|
+
})
|
|
411
|
+
.superRefine((data, ctx) => refineEnumMatchesType(data, [], ctx))
|
|
412
|
+
.superRefine((data, ctx) => refineMinimumMaximum(data, [], ctx))
|
|
413
|
+
.superRefine((data, ctx) => refineStringLengthPattern(data, [], ctx))
|
|
414
|
+
.superRefine((data, ctx) => refineArrayItems(data, [], ctx)));
|
|
415
|
+
return schemaZodSchema;
|
|
416
|
+
}
|
|
417
|
+
//# sourceMappingURL=schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../src/linter/schema.ts"],"names":[],"mappings":";;;AA4CA,sDAuCC;AAMD,oDA6EC;AAMD,8DAkHC;AA2BD,4CAwEC;AA0BD,gDAkDC;AA5cD,6BAAwB;AAExB,qDAAqD;AACrD,SAAS,gBAAgB,CAAC,CAAU,EAAE,IAAY;IAChD,QAAQ,IAAI,EAAE,CAAC;QACb,KAAK,QAAQ;YACX,OAAO,OAAO,CAAC,KAAK,QAAQ,CAAC;QAC/B,KAAK,SAAS;YACZ,OAAO,OAAO,CAAC,KAAK,SAAS,CAAC;QAChC,KAAK,SAAS;YACZ,OAAO,OAAO,CAAC,KAAK,QAAQ,IAAI,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;QACtD,KAAK,QAAQ;YACX,OAAO,OAAO,CAAC,KAAK,QAAQ,CAAC;QAC/B,KAAK,QAAQ;YACX,OAAO,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;QAClE,KAAK,OAAO;YACV,OAAO,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;QAC1B;YACE,OAAO,IAAI,CAAC;IAChB,CAAC;AACH,CAAC;AAmBD;;;GAGG;AACH,SAAgB,qBAAqB,CACnC,MAAkB,EAClB,UAA+B,EAC/B,GAAoB;IAEpB,IAAI,CAAC,MAAM,IAAI,OAAO,MAAM,KAAK,QAAQ;QAAE,OAAO;IAClD,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC;IACzB,MAAM,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC;IAC5B,IAAI,IAAI,IAAI,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,OAAO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