@maxclicks/core 1.0.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/LICENSE +21 -0
- package/README.md +32 -0
- package/dist/helpers/deepClone.d.ts +4 -0
- package/dist/helpers/deepClone.d.ts.map +1 -0
- package/dist/helpers/deepClone.js +11 -0
- package/dist/helpers/deepClone.js.map +1 -0
- package/dist/helpers/delay.d.ts +5 -0
- package/dist/helpers/delay.d.ts.map +1 -0
- package/dist/helpers/delay.js +40 -0
- package/dist/helpers/delay.js.map +1 -0
- package/dist/helpers/error-warning/alterError.d.ts +6 -0
- package/dist/helpers/error-warning/alterError.d.ts.map +1 -0
- package/dist/helpers/error-warning/alterError.js +30 -0
- package/dist/helpers/error-warning/alterError.js.map +1 -0
- package/dist/helpers/error-warning/combineMessages.d.ts +17 -0
- package/dist/helpers/error-warning/combineMessages.d.ts.map +1 -0
- package/dist/helpers/error-warning/combineMessages.js +19 -0
- package/dist/helpers/error-warning/combineMessages.js.map +1 -0
- package/dist/helpers/error-warning/getErrorMessage.d.ts +2 -0
- package/dist/helpers/error-warning/getErrorMessage.d.ts.map +1 -0
- package/dist/helpers/error-warning/getErrorMessage.js +5 -0
- package/dist/helpers/error-warning/getErrorMessage.js.map +1 -0
- package/dist/helpers/error-warning/prependMessage.d.ts +2 -0
- package/dist/helpers/error-warning/prependMessage.d.ts.map +1 -0
- package/dist/helpers/error-warning/prependMessage.js +9 -0
- package/dist/helpers/error-warning/prependMessage.js.map +1 -0
- package/dist/helpers/error-warning/throwError.d.ts +2 -0
- package/dist/helpers/error-warning/throwError.d.ts.map +1 -0
- package/dist/helpers/error-warning/throwError.js +4 -0
- package/dist/helpers/error-warning/throwError.js.map +1 -0
- package/dist/helpers/escapeForRegExp.d.ts +2 -0
- package/dist/helpers/escapeForRegExp.d.ts.map +1 -0
- package/dist/helpers/escapeForRegExp.js +4 -0
- package/dist/helpers/escapeForRegExp.js.map +1 -0
- package/dist/helpers/formatCurrencyUsd.d.ts +2 -0
- package/dist/helpers/formatCurrencyUsd.d.ts.map +1 -0
- package/dist/helpers/formatCurrencyUsd.js +8 -0
- package/dist/helpers/formatCurrencyUsd.js.map +1 -0
- package/dist/helpers/generateRandomKey.d.ts +10 -0
- package/dist/helpers/generateRandomKey.d.ts.map +1 -0
- package/dist/helpers/generateRandomKey.js +24 -0
- package/dist/helpers/generateRandomKey.js.map +1 -0
- package/dist/helpers/generateRuntimeId.d.ts +2 -0
- package/dist/helpers/generateRuntimeId.d.ts.map +1 -0
- package/dist/helpers/generateRuntimeId.js +6 -0
- package/dist/helpers/generateRuntimeId.js.map +1 -0
- package/dist/helpers/generateSequence.d.ts +7 -0
- package/dist/helpers/generateSequence.d.ts.map +1 -0
- package/dist/helpers/generateSequence.js +9 -0
- package/dist/helpers/generateSequence.js.map +1 -0
- package/dist/helpers/getEnumKeyValues.d.ts +5 -0
- package/dist/helpers/getEnumKeyValues.d.ts.map +1 -0
- package/dist/helpers/getEnumKeyValues.js +7 -0
- package/dist/helpers/getEnumKeyValues.js.map +1 -0
- package/dist/helpers/haveSameContents.d.ts +2 -0
- package/dist/helpers/haveSameContents.d.ts.map +1 -0
- package/dist/helpers/haveSameContents.js +32 -0
- package/dist/helpers/haveSameContents.js.map +1 -0
- package/dist/helpers/isOneOf.d.ts +13 -0
- package/dist/helpers/isOneOf.d.ts.map +1 -0
- package/dist/helpers/isOneOf.js +2 -0
- package/dist/helpers/isOneOf.js.map +1 -0
- package/dist/helpers/native/arrayHelpers.d.ts +38 -0
- package/dist/helpers/native/arrayHelpers.d.ts.map +1 -0
- package/dist/helpers/native/arrayHelpers.js +151 -0
- package/dist/helpers/native/arrayHelpers.js.map +1 -0
- package/dist/helpers/native/objectHelpers.d.ts +23 -0
- package/dist/helpers/native/objectHelpers.d.ts.map +1 -0
- package/dist/helpers/native/objectHelpers.js +81 -0
- package/dist/helpers/native/objectHelpers.js.map +1 -0
- package/dist/helpers/native/stringHelpers.d.ts +8 -0
- package/dist/helpers/native/stringHelpers.d.ts.map +1 -0
- package/dist/helpers/native/stringHelpers.js +12 -0
- package/dist/helpers/native/stringHelpers.js.map +1 -0
- package/dist/helpers/optional.d.ts +10 -0
- package/dist/helpers/optional.d.ts.map +1 -0
- package/dist/helpers/optional.js +14 -0
- package/dist/helpers/optional.js.map +1 -0
- package/dist/helpers/percent.d.ts +5 -0
- package/dist/helpers/percent.d.ts.map +1 -0
- package/dist/helpers/percent.js +17 -0
- package/dist/helpers/percent.js.map +1 -0
- package/dist/helpers/typed.d.ts +2 -0
- package/dist/helpers/typed.d.ts.map +1 -0
- package/dist/helpers/typed.js +4 -0
- package/dist/helpers/typed.js.map +1 -0
- package/dist/index.d.ts +42 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +42 -0
- package/dist/index.js.map +1 -0
- package/dist/modules/common-normalizers/descriptionNormalizer.d.ts +3 -0
- package/dist/modules/common-normalizers/descriptionNormalizer.d.ts.map +1 -0
- package/dist/modules/common-normalizers/descriptionNormalizer.js +3 -0
- package/dist/modules/common-normalizers/descriptionNormalizer.js.map +1 -0
- package/dist/modules/common-normalizers/labelNormalizer.d.ts +3 -0
- package/dist/modules/common-normalizers/labelNormalizer.d.ts.map +1 -0
- package/dist/modules/common-normalizers/labelNormalizer.js +3 -0
- package/dist/modules/common-normalizers/labelNormalizer.js.map +1 -0
- package/dist/modules/common-normalizers/nameNormalizer.d.ts +2 -0
- package/dist/modules/common-normalizers/nameNormalizer.d.ts.map +1 -0
- package/dist/modules/common-normalizers/nameNormalizer.js +3 -0
- package/dist/modules/common-normalizers/nameNormalizer.js.map +1 -0
- package/dist/modules/common-normalizers/widthHeightNormalizer.d.ts +3 -0
- package/dist/modules/common-normalizers/widthHeightNormalizer.d.ts.map +1 -0
- package/dist/modules/common-normalizers/widthHeightNormalizer.js +3 -0
- package/dist/modules/common-normalizers/widthHeightNormalizer.js.map +1 -0
- package/dist/types/Address.d.ts +16 -0
- package/dist/types/Address.d.ts.map +1 -0
- package/dist/types/Address.js +34 -0
- package/dist/types/Address.js.map +1 -0
- package/dist/types/Color.d.ts +6 -0
- package/dist/types/Color.d.ts.map +1 -0
- package/dist/types/Color.js +19 -0
- package/dist/types/Color.js.map +1 -0
- package/dist/types/DateOnly.d.ts +6 -0
- package/dist/types/DateOnly.d.ts.map +1 -0
- package/dist/types/DateOnly.js +18 -0
- package/dist/types/DateOnly.js.map +1 -0
- package/dist/types/DateTime.d.ts +6 -0
- package/dist/types/DateTime.d.ts.map +1 -0
- package/dist/types/DateTime.js +18 -0
- package/dist/types/DateTime.js.map +1 -0
- package/dist/types/Decimal.d.ts +6 -0
- package/dist/types/Decimal.d.ts.map +1 -0
- package/dist/types/Decimal.js +22 -0
- package/dist/types/Decimal.js.map +1 -0
- package/dist/types/Email.d.ts +6 -0
- package/dist/types/Email.d.ts.map +1 -0
- package/dist/types/Email.js +14 -0
- package/dist/types/Email.js.map +1 -0
- package/dist/types/Geolocation.d.ts +16 -0
- package/dist/types/Geolocation.d.ts.map +1 -0
- package/dist/types/Geolocation.js +22 -0
- package/dist/types/Geolocation.js.map +1 -0
- package/dist/types/Json/Json.d.ts +81 -0
- package/dist/types/Json/Json.d.ts.map +1 -0
- package/dist/types/Json/Json.js +43 -0
- package/dist/types/Json/Json.js.map +1 -0
- package/dist/types/Json/jsonNormalizer.d.ts +4 -0
- package/dist/types/Json/jsonNormalizer.d.ts.map +1 -0
- package/dist/types/Json/jsonNormalizer.js +20 -0
- package/dist/types/Json/jsonNormalizer.js.map +1 -0
- package/dist/types/Json/jsonNormalizerWithSchemaFactory.d.ts +4 -0
- package/dist/types/Json/jsonNormalizerWithSchemaFactory.d.ts.map +1 -0
- package/dist/types/Json/jsonNormalizerWithSchemaFactory.js +161 -0
- package/dist/types/Json/jsonNormalizerWithSchemaFactory.js.map +1 -0
- package/dist/types/Json/jsonSchemaNormalizer.d.ts +3 -0
- package/dist/types/Json/jsonSchemaNormalizer.d.ts.map +1 -0
- package/dist/types/Json/jsonSchemaNormalizer.js +172 -0
- package/dist/types/Json/jsonSchemaNormalizer.js.map +1 -0
- package/dist/types/Json/jsonSchemaSatisfies.d.ts +3 -0
- package/dist/types/Json/jsonSchemaSatisfies.d.ts.map +1 -0
- package/dist/types/Json/jsonSchemaSatisfies.js +239 -0
- package/dist/types/Json/jsonSchemaSatisfies.js.map +1 -0
- package/dist/types/Json/jsonSchemaSimplifiedSatisfies.d.ts +3 -0
- package/dist/types/Json/jsonSchemaSimplifiedSatisfies.d.ts.map +1 -0
- package/dist/types/Json/jsonSchemaSimplifiedSatisfies.js +221 -0
- package/dist/types/Json/jsonSchemaSimplifiedSatisfies.js.map +1 -0
- package/dist/types/Lazily.d.ts +27 -0
- package/dist/types/Lazily.d.ts.map +1 -0
- package/dist/types/Lazily.js +31 -0
- package/dist/types/Lazily.js.map +1 -0
- package/dist/types/Normalizer.d.ts +79 -0
- package/dist/types/Normalizer.d.ts.map +1 -0
- package/dist/types/Normalizer.js +257 -0
- package/dist/types/Normalizer.js.map +1 -0
- package/dist/types/Phone.d.ts +6 -0
- package/dist/types/Phone.d.ts.map +1 -0
- package/dist/types/Phone.js +16 -0
- package/dist/types/Phone.js.map +1 -0
- package/dist/types/Slug.d.ts +6 -0
- package/dist/types/Slug.d.ts.map +1 -0
- package/dist/types/Slug.js +17 -0
- package/dist/types/Slug.js.map +1 -0
- package/dist/types/TimeOnly.d.ts +6 -0
- package/dist/types/TimeOnly.d.ts.map +1 -0
- package/dist/types/TimeOnly.js +23 -0
- package/dist/types/TimeOnly.js.map +1 -0
- package/dist/types/Url.d.ts +6 -0
- package/dist/types/Url.d.ts.map +1 -0
- package/dist/types/Url.js +17 -0
- package/dist/types/Url.js.map +1 -0
- package/dist/types/Uuid.d.ts +9 -0
- package/dist/types/Uuid.d.ts.map +1 -0
- package/dist/types/Uuid.js +17 -0
- package/dist/types/Uuid.js.map +1 -0
- package/dist/types.d.ts +29 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/package.json +63 -0
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
import { objectHelpers } from '../../helpers/native/objectHelpers';
|
|
2
|
+
import { Json } from './Json';
|
|
3
|
+
import { jsonNormalizer } from './jsonNormalizer';
|
|
4
|
+
export const jsonSchemaNormalizer = jsonNormalizer.chain((value, warn) => {
|
|
5
|
+
if (value === null)
|
|
6
|
+
return null;
|
|
7
|
+
if (typeof value !== 'object' || Array.isArray(value))
|
|
8
|
+
throw new Error('Schema must be an object.');
|
|
9
|
+
const schema = value;
|
|
10
|
+
const { $comment, title, description, default: defaultValue, examples, ...rest } = schema;
|
|
11
|
+
if ($comment !== undefined && typeof $comment !== 'string')
|
|
12
|
+
throw new Error('"$comment" must be a string.');
|
|
13
|
+
if (title !== undefined && typeof title !== 'string')
|
|
14
|
+
throw new Error('"title" must be a string.');
|
|
15
|
+
if (description !== undefined && typeof description !== 'string')
|
|
16
|
+
throw new Error('"description" must be a string.');
|
|
17
|
+
if (examples !== undefined && !Array.isArray(examples))
|
|
18
|
+
throw new Error('"examples" must be an array.');
|
|
19
|
+
if ('const' in rest) {
|
|
20
|
+
const { const: constValue, ...afterConst } = rest;
|
|
21
|
+
const unsupportedKeys = objectHelpers.keys(afterConst);
|
|
22
|
+
if (unsupportedKeys.length > 0)
|
|
23
|
+
throw new Error(`When "const" is declared, these properties are not supported: ${unsupportedKeys.map(k => `"${k}"`).join(', ')}.`);
|
|
24
|
+
return value;
|
|
25
|
+
}
|
|
26
|
+
if ('enum' in rest) {
|
|
27
|
+
const { enum: enumValue, ...afterEnum } = rest;
|
|
28
|
+
if (!Array.isArray(enumValue))
|
|
29
|
+
throw new Error('"enum" must be an array.');
|
|
30
|
+
if (enumValue.length === 0)
|
|
31
|
+
throw new Error('"enum" must have at least one value.');
|
|
32
|
+
const unsupportedKeys = objectHelpers.keys(afterEnum);
|
|
33
|
+
if (unsupportedKeys.length > 0)
|
|
34
|
+
throw new Error(`When "enum" is declared, these properties are not supported: ${unsupportedKeys.map(k => `"${k}"`).join(', ')}.`);
|
|
35
|
+
return value;
|
|
36
|
+
}
|
|
37
|
+
const { type, ...afterType } = rest;
|
|
38
|
+
if (type === undefined || type === 'any') {
|
|
39
|
+
const unsupportedKeys = objectHelpers.keys(afterType);
|
|
40
|
+
if (unsupportedKeys.length > 0)
|
|
41
|
+
throw new Error(`When ${type === undefined ? 'no type is specified' : 'type is "any"'}, these properties are not supported: ${unsupportedKeys.map(k => `"${k}"`).join(', ')}.`);
|
|
42
|
+
return value;
|
|
43
|
+
}
|
|
44
|
+
const typeArray = Array.isArray(type) ? type : null;
|
|
45
|
+
const nullable = typeArray !== null && typeArray.includes('null');
|
|
46
|
+
const typeValues = typeArray ? typeArray.filter(t => t !== 'null') : [type];
|
|
47
|
+
if (typeValues.length !== 1)
|
|
48
|
+
throw new Error('Type must be a single type or a tuple of [type, "null"] for nullable types.');
|
|
49
|
+
const typeValue = typeValues[0];
|
|
50
|
+
if (typeof typeValue !== 'string')
|
|
51
|
+
throw new Error('"type" must be a string or an array of strings.');
|
|
52
|
+
if (typeValue === 'null') {
|
|
53
|
+
const unsupportedKeys = objectHelpers.keys(afterType);
|
|
54
|
+
if (unsupportedKeys.length > 0)
|
|
55
|
+
throw new Error(`When type is "null", these properties are not supported: ${unsupportedKeys.map(k => `"${k}"`).join(', ')}.`);
|
|
56
|
+
return value;
|
|
57
|
+
}
|
|
58
|
+
if (typeValue === 'string') {
|
|
59
|
+
const { minLength, maxLength, format, ...remaining } = afterType;
|
|
60
|
+
const unsupportedKeys = objectHelpers.keys(remaining);
|
|
61
|
+
if (unsupportedKeys.length > 0)
|
|
62
|
+
throw new Error(`When type is "string", these properties are not supported: ${unsupportedKeys.map(k => `"${k}"`).join(', ')}.`);
|
|
63
|
+
if (minLength !== undefined) {
|
|
64
|
+
if (typeof minLength !== 'number')
|
|
65
|
+
throw new Error('"minLength" must be a number.');
|
|
66
|
+
if (minLength < 0)
|
|
67
|
+
throw new Error('"minLength" cannot be negative.');
|
|
68
|
+
if (minLength % 1 !== 0)
|
|
69
|
+
throw new Error('"minLength" must be an integer.');
|
|
70
|
+
}
|
|
71
|
+
if (maxLength !== undefined) {
|
|
72
|
+
if (typeof maxLength !== 'number')
|
|
73
|
+
throw new Error('"maxLength" must be a number.');
|
|
74
|
+
if (maxLength < 0)
|
|
75
|
+
throw new Error('"maxLength" cannot be negative.');
|
|
76
|
+
if (maxLength % 1 !== 0)
|
|
77
|
+
throw new Error('"maxLength" must be an integer.');
|
|
78
|
+
if (minLength !== undefined && maxLength < minLength)
|
|
79
|
+
throw new Error('"maxLength" cannot be less than "minLength".');
|
|
80
|
+
}
|
|
81
|
+
if (format !== undefined && typeof format !== 'string')
|
|
82
|
+
throw new Error('"format" must be a string.');
|
|
83
|
+
return value;
|
|
84
|
+
}
|
|
85
|
+
if (typeValue === 'number' || typeValue === 'integer') {
|
|
86
|
+
const { minimum, maximum, exclusiveMinimum, exclusiveMaximum, multipleOf, ...remaining } = afterType;
|
|
87
|
+
const unsupportedKeys = objectHelpers.keys(remaining);
|
|
88
|
+
if (unsupportedKeys.length > 0)
|
|
89
|
+
throw new Error(`When type is "${typeValue}", these properties are not supported: ${unsupportedKeys.map(k => `"${k}"`).join(', ')}.`);
|
|
90
|
+
if (minimum !== undefined && typeof minimum !== 'number')
|
|
91
|
+
throw new Error('"minimum" must be a number.');
|
|
92
|
+
if (maximum !== undefined && typeof maximum !== 'number')
|
|
93
|
+
throw new Error('"maximum" must be a number.');
|
|
94
|
+
if (minimum !== undefined && maximum !== undefined && maximum < minimum)
|
|
95
|
+
throw new Error('"maximum" cannot be less than "minimum".');
|
|
96
|
+
if (exclusiveMinimum !== undefined && typeof exclusiveMinimum !== 'number')
|
|
97
|
+
throw new Error('"exclusiveMinimum" must be a number.');
|
|
98
|
+
if (exclusiveMaximum !== undefined && typeof exclusiveMaximum !== 'number')
|
|
99
|
+
throw new Error('"exclusiveMaximum" must be a number.');
|
|
100
|
+
if (exclusiveMinimum !== undefined &&
|
|
101
|
+
exclusiveMaximum !== undefined &&
|
|
102
|
+
exclusiveMaximum <= exclusiveMinimum)
|
|
103
|
+
throw new Error('"exclusiveMaximum" must be greater than "exclusiveMinimum".');
|
|
104
|
+
if (multipleOf !== undefined) {
|
|
105
|
+
if (typeof multipleOf !== 'number')
|
|
106
|
+
throw new Error('"multipleOf" must be a number.');
|
|
107
|
+
if (multipleOf <= 0)
|
|
108
|
+
throw new Error('"multipleOf" must be positive.');
|
|
109
|
+
}
|
|
110
|
+
return value;
|
|
111
|
+
}
|
|
112
|
+
if (typeValue === 'boolean') {
|
|
113
|
+
const unsupportedKeys = objectHelpers.keys(afterType);
|
|
114
|
+
if (unsupportedKeys.length > 0)
|
|
115
|
+
throw new Error(`When type is "boolean", these properties are not supported: ${unsupportedKeys.map(k => `"${k}"`).join(', ')}.`);
|
|
116
|
+
return value;
|
|
117
|
+
}
|
|
118
|
+
if (typeValue === 'array') {
|
|
119
|
+
const { items, minItems, maxItems, ...remaining } = afterType;
|
|
120
|
+
const unsupportedKeys = objectHelpers.keys(remaining);
|
|
121
|
+
if (unsupportedKeys.length > 0)
|
|
122
|
+
throw new Error(`When type is "array", these properties are not supported: ${unsupportedKeys.map(k => `"${k}"`).join(', ')}.`);
|
|
123
|
+
if (items !== undefined)
|
|
124
|
+
jsonSchemaNormalizer.required.normalize(items).getValue('items', warn);
|
|
125
|
+
if (minItems !== undefined) {
|
|
126
|
+
if (typeof minItems !== 'number')
|
|
127
|
+
throw new Error('"minItems" must be a number.');
|
|
128
|
+
if (minItems < 0)
|
|
129
|
+
throw new Error('"minItems" cannot be negative.');
|
|
130
|
+
if (minItems % 1 !== 0)
|
|
131
|
+
throw new Error('"minItems" must be an integer.');
|
|
132
|
+
}
|
|
133
|
+
if (maxItems !== undefined) {
|
|
134
|
+
if (typeof maxItems !== 'number')
|
|
135
|
+
throw new Error('"maxItems" must be a number.');
|
|
136
|
+
if (maxItems < 0)
|
|
137
|
+
throw new Error('"maxItems" cannot be negative.');
|
|
138
|
+
if (maxItems % 1 !== 0)
|
|
139
|
+
throw new Error('"maxItems" must be an integer.');
|
|
140
|
+
if (minItems !== undefined && maxItems < minItems)
|
|
141
|
+
throw new Error('"maxItems" cannot be less than "minItems".');
|
|
142
|
+
}
|
|
143
|
+
return value;
|
|
144
|
+
}
|
|
145
|
+
if (typeValue === 'object') {
|
|
146
|
+
const { properties, additionalProperties, required, ...remaining } = afterType;
|
|
147
|
+
const unsupportedKeys = objectHelpers.keys(remaining);
|
|
148
|
+
if (unsupportedKeys.length > 0)
|
|
149
|
+
throw new Error(`When type is "object", these properties are not supported: ${unsupportedKeys.map(k => `"${k}"`).join(', ')}.`);
|
|
150
|
+
if (properties !== undefined) {
|
|
151
|
+
if (typeof properties !== 'object' || properties === null || Array.isArray(properties))
|
|
152
|
+
throw new Error('"properties" must be an object.');
|
|
153
|
+
for (const [key, propertySchema] of Object.entries(properties)) {
|
|
154
|
+
jsonSchemaNormalizer.required.normalize(propertySchema).getValue(`properties.${key}`, warn);
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
if (additionalProperties !== undefined && additionalProperties !== true) {
|
|
158
|
+
jsonSchemaNormalizer.required.normalize(additionalProperties).getValue('additionalProperties', warn);
|
|
159
|
+
}
|
|
160
|
+
if (required !== undefined) {
|
|
161
|
+
if (!Array.isArray(required))
|
|
162
|
+
throw new Error('"required" must be an array.');
|
|
163
|
+
for (const item of required) {
|
|
164
|
+
if (typeof item !== 'string')
|
|
165
|
+
throw new Error('"required" array must contain only strings.');
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
return value;
|
|
169
|
+
}
|
|
170
|
+
throw new Error(`Unsupported type "${typeValue}".`);
|
|
171
|
+
});
|
|
172
|
+
//# sourceMappingURL=jsonSchemaNormalizer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jsonSchemaNormalizer.js","sourceRoot":"","sources":["../../../src/types/Json/jsonSchemaNormalizer.ts"],"names":[],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0,0 +1,239 @@
|
|
|
1
|
+
import { haveSameContents } from '../../helpers/haveSameContents';
|
|
2
|
+
import { Json } from './Json';
|
|
3
|
+
export function jsonSchemaSatisfies(provided, required) {
|
|
4
|
+
if (isAnySchema(provided))
|
|
5
|
+
return true;
|
|
6
|
+
if (isAnySchema(required))
|
|
7
|
+
return isAnySchema(provided);
|
|
8
|
+
if ('const' in required) {
|
|
9
|
+
if ('const' in provided)
|
|
10
|
+
return haveSameContents(provided.const, required.const);
|
|
11
|
+
if ('enum' in provided)
|
|
12
|
+
return provided.enum.some(value => haveSameContents(value, required.const));
|
|
13
|
+
return schemaAcceptsValue(provided, required.const);
|
|
14
|
+
}
|
|
15
|
+
if ('enum' in required) {
|
|
16
|
+
if ('const' in provided)
|
|
17
|
+
return required.enum.length === 1 && haveSameContents(provided.const, required.enum[0]);
|
|
18
|
+
if ('enum' in provided)
|
|
19
|
+
return required.enum.every(requiredValue => provided.enum.some(providedValue => haveSameContents(providedValue, requiredValue)));
|
|
20
|
+
return required.enum.every(value => schemaAcceptsValue(provided, value));
|
|
21
|
+
}
|
|
22
|
+
if ('const' in provided || 'enum' in provided)
|
|
23
|
+
return false;
|
|
24
|
+
const providedBaseType = getBaseType(provided.type);
|
|
25
|
+
const requiredBaseType = getBaseType(required.type);
|
|
26
|
+
const providedNullable = isNullable(provided.type);
|
|
27
|
+
const requiredNullable = isNullable(required.type);
|
|
28
|
+
if (requiredNullable && !providedNullable)
|
|
29
|
+
return false;
|
|
30
|
+
if (requiredBaseType === 'null')
|
|
31
|
+
return providedBaseType === 'null' || providedNullable;
|
|
32
|
+
if (providedBaseType !== requiredBaseType) {
|
|
33
|
+
if (!(providedBaseType === 'number' && requiredBaseType === 'integer'))
|
|
34
|
+
return false;
|
|
35
|
+
}
|
|
36
|
+
switch (requiredBaseType) {
|
|
37
|
+
case 'string':
|
|
38
|
+
return stringSchemasSatisfy(provided, required);
|
|
39
|
+
case 'number':
|
|
40
|
+
case 'integer':
|
|
41
|
+
return numberSchemasSatisfy(provided, required);
|
|
42
|
+
case 'boolean':
|
|
43
|
+
return true;
|
|
44
|
+
case 'array':
|
|
45
|
+
return arraySchemasSatisfy(provided, required);
|
|
46
|
+
case 'object':
|
|
47
|
+
return objectSchemasSatisfy(provided, required);
|
|
48
|
+
default:
|
|
49
|
+
return false;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
function isAnySchema(schema) {
|
|
53
|
+
return !('const' in schema) && !('enum' in schema) && (schema.type === undefined || schema.type === 'any');
|
|
54
|
+
}
|
|
55
|
+
function getBaseType(type) {
|
|
56
|
+
if (type === undefined)
|
|
57
|
+
return 'any';
|
|
58
|
+
if (Array.isArray(type))
|
|
59
|
+
return type.find(t => t !== 'null');
|
|
60
|
+
return type;
|
|
61
|
+
}
|
|
62
|
+
function isNullable(type) {
|
|
63
|
+
if (type === 'null')
|
|
64
|
+
return true;
|
|
65
|
+
if (Array.isArray(type))
|
|
66
|
+
return type.includes('null');
|
|
67
|
+
return false;
|
|
68
|
+
}
|
|
69
|
+
function schemaAcceptsValue(schema, value) {
|
|
70
|
+
if (isAnySchema(schema))
|
|
71
|
+
return true;
|
|
72
|
+
const baseType = getBaseType(schema.type);
|
|
73
|
+
const nullable = isNullable(schema.type);
|
|
74
|
+
if (value === null)
|
|
75
|
+
return nullable || baseType === 'null';
|
|
76
|
+
switch (baseType) {
|
|
77
|
+
case 'null':
|
|
78
|
+
return value === null;
|
|
79
|
+
case 'string': {
|
|
80
|
+
if (typeof value !== 'string')
|
|
81
|
+
return false;
|
|
82
|
+
const stringSchema = schema;
|
|
83
|
+
if (stringSchema.minLength !== undefined && value.length < stringSchema.minLength)
|
|
84
|
+
return false;
|
|
85
|
+
if (stringSchema.maxLength !== undefined && value.length > stringSchema.maxLength)
|
|
86
|
+
return false;
|
|
87
|
+
return true;
|
|
88
|
+
}
|
|
89
|
+
case 'number':
|
|
90
|
+
case 'integer': {
|
|
91
|
+
if (typeof value !== 'number')
|
|
92
|
+
return false;
|
|
93
|
+
if (baseType === 'integer' && value % 1 !== 0)
|
|
94
|
+
return false;
|
|
95
|
+
const numberSchema = schema;
|
|
96
|
+
if (numberSchema.minimum !== undefined && value < numberSchema.minimum)
|
|
97
|
+
return false;
|
|
98
|
+
if (numberSchema.maximum !== undefined && value > numberSchema.maximum)
|
|
99
|
+
return false;
|
|
100
|
+
if (numberSchema.exclusiveMinimum !== undefined && value <= numberSchema.exclusiveMinimum)
|
|
101
|
+
return false;
|
|
102
|
+
if (numberSchema.exclusiveMaximum !== undefined && value >= numberSchema.exclusiveMaximum)
|
|
103
|
+
return false;
|
|
104
|
+
if (numberSchema.multipleOf !== undefined && value % numberSchema.multipleOf !== 0)
|
|
105
|
+
return false;
|
|
106
|
+
return true;
|
|
107
|
+
}
|
|
108
|
+
case 'boolean':
|
|
109
|
+
return typeof value === 'boolean';
|
|
110
|
+
case 'array': {
|
|
111
|
+
if (!Array.isArray(value))
|
|
112
|
+
return false;
|
|
113
|
+
const arraySchema = schema;
|
|
114
|
+
if (arraySchema.minItems !== undefined && value.length < arraySchema.minItems)
|
|
115
|
+
return false;
|
|
116
|
+
if (arraySchema.maxItems !== undefined && value.length > arraySchema.maxItems)
|
|
117
|
+
return false;
|
|
118
|
+
if (arraySchema.items !== undefined)
|
|
119
|
+
return value.every(item => schemaAcceptsValue(arraySchema.items, item));
|
|
120
|
+
return true;
|
|
121
|
+
}
|
|
122
|
+
case 'object': {
|
|
123
|
+
if (typeof value !== 'object' || Array.isArray(value) || value === null)
|
|
124
|
+
return false;
|
|
125
|
+
const objectSchema = schema;
|
|
126
|
+
const objectValue = value;
|
|
127
|
+
if (objectSchema.required) {
|
|
128
|
+
for (const key of objectSchema.required) {
|
|
129
|
+
if (!(key in objectValue))
|
|
130
|
+
return false;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
for (const [key, propertyValue] of Object.entries(objectValue)) {
|
|
134
|
+
if (objectSchema.properties && key in objectSchema.properties) {
|
|
135
|
+
if (!schemaAcceptsValue(objectSchema.properties[key], propertyValue))
|
|
136
|
+
return false;
|
|
137
|
+
}
|
|
138
|
+
else if (objectSchema.additionalProperties !== undefined && objectSchema.additionalProperties !== true) {
|
|
139
|
+
if (!schemaAcceptsValue(objectSchema.additionalProperties, propertyValue))
|
|
140
|
+
return false;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
return true;
|
|
144
|
+
}
|
|
145
|
+
default:
|
|
146
|
+
return false;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
function stringSchemasSatisfy(provided, required) {
|
|
150
|
+
if (required.minLength !== undefined) {
|
|
151
|
+
if (provided.minLength !== undefined && provided.minLength > required.minLength)
|
|
152
|
+
return false;
|
|
153
|
+
}
|
|
154
|
+
if (required.maxLength !== undefined) {
|
|
155
|
+
if (provided.maxLength !== undefined && provided.maxLength < required.maxLength)
|
|
156
|
+
return false;
|
|
157
|
+
}
|
|
158
|
+
if (required.format !== undefined) {
|
|
159
|
+
if (provided.format !== undefined && provided.format !== required.format)
|
|
160
|
+
return false;
|
|
161
|
+
}
|
|
162
|
+
return true;
|
|
163
|
+
}
|
|
164
|
+
function numberSchemasSatisfy(provided, required) {
|
|
165
|
+
if (required.minimum !== undefined) {
|
|
166
|
+
if (provided.minimum !== undefined && provided.minimum > required.minimum)
|
|
167
|
+
return false;
|
|
168
|
+
}
|
|
169
|
+
if (required.maximum !== undefined) {
|
|
170
|
+
if (provided.maximum !== undefined && provided.maximum < required.maximum)
|
|
171
|
+
return false;
|
|
172
|
+
}
|
|
173
|
+
if (required.exclusiveMinimum !== undefined) {
|
|
174
|
+
if (provided.exclusiveMinimum !== undefined && provided.exclusiveMinimum > required.exclusiveMinimum)
|
|
175
|
+
return false;
|
|
176
|
+
}
|
|
177
|
+
if (required.exclusiveMaximum !== undefined) {
|
|
178
|
+
if (provided.exclusiveMaximum !== undefined && provided.exclusiveMaximum < required.exclusiveMaximum)
|
|
179
|
+
return false;
|
|
180
|
+
}
|
|
181
|
+
if (required.multipleOf !== undefined) {
|
|
182
|
+
if (provided.multipleOf !== undefined && required.multipleOf % provided.multipleOf !== 0)
|
|
183
|
+
return false;
|
|
184
|
+
}
|
|
185
|
+
return true;
|
|
186
|
+
}
|
|
187
|
+
function arraySchemasSatisfy(provided, required) {
|
|
188
|
+
if (required.minItems !== undefined) {
|
|
189
|
+
if (provided.minItems !== undefined && provided.minItems > required.minItems)
|
|
190
|
+
return false;
|
|
191
|
+
}
|
|
192
|
+
if (required.maxItems !== undefined) {
|
|
193
|
+
if (provided.maxItems !== undefined && provided.maxItems < required.maxItems)
|
|
194
|
+
return false;
|
|
195
|
+
}
|
|
196
|
+
if (required.items !== undefined) {
|
|
197
|
+
if (provided.items === undefined)
|
|
198
|
+
return true;
|
|
199
|
+
return jsonSchemaSatisfies(provided.items, required.items);
|
|
200
|
+
}
|
|
201
|
+
return true;
|
|
202
|
+
}
|
|
203
|
+
function objectSchemasSatisfy(provided, required) {
|
|
204
|
+
if (provided.required) {
|
|
205
|
+
for (const key of provided.required) {
|
|
206
|
+
if (!required.required?.includes(key)) {
|
|
207
|
+
return false;
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
if (required.properties) {
|
|
212
|
+
for (const [key, requiredPropertySchema] of Object.entries(required.properties)) {
|
|
213
|
+
if (provided.properties && key in provided.properties) {
|
|
214
|
+
if (!jsonSchemaSatisfies(provided.properties[key], requiredPropertySchema))
|
|
215
|
+
return false;
|
|
216
|
+
}
|
|
217
|
+
else if (provided.additionalProperties !== undefined) {
|
|
218
|
+
if (provided.additionalProperties === true)
|
|
219
|
+
continue;
|
|
220
|
+
if (!jsonSchemaSatisfies(provided.additionalProperties, requiredPropertySchema))
|
|
221
|
+
return false;
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
if (required.additionalProperties !== undefined) {
|
|
226
|
+
if (provided.additionalProperties === undefined) {
|
|
227
|
+
return true;
|
|
228
|
+
}
|
|
229
|
+
if (required.additionalProperties === true) {
|
|
230
|
+
return provided.additionalProperties === true;
|
|
231
|
+
}
|
|
232
|
+
if (provided.additionalProperties === true) {
|
|
233
|
+
return true;
|
|
234
|
+
}
|
|
235
|
+
return jsonSchemaSatisfies(provided.additionalProperties, required.additionalProperties);
|
|
236
|
+
}
|
|
237
|
+
return true;
|
|
238
|
+
}
|
|
239
|
+
//# sourceMappingURL=jsonSchemaSatisfies.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jsonSchemaSatisfies.js","sourceRoot":"","sources":["../../../src/types/Json/jsonSchemaSatisfies.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAA;AACjE,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAW7B,MAAM,UAAU,mBAAmB,CAAC,QAAqB,EAAE,QAAqB;IAE9E,IAAI,WAAW,CAAC,QAAQ,CAAC;QAAE,OAAO,IAAI,CAAA;IAGtC,IAAI,WAAW,CAAC,QAAQ,CAAC;QAAE,OAAO,WAAW,CAAC,QAAQ,CAAC,CAAA;IAGvD,IAAI,OAAO,IAAI,QAAQ,EAAE,CAAC;QACxB,IAAI,OAAO,IAAI,QAAQ;YAAE,OAAO,gBAAgB,CAAC,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC,KAAK,CAAC,CAAA;QAChF,IAAI,MAAM,IAAI,QAAQ;YAAE,OAAO,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,gBAAgB,CAAC,KAAK,EAAE,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAA;QAEnG,OAAO,kBAAkB,CAAC,QAAQ,EAAE,QAAQ,CAAC,KAAK,CAAC,CAAA;IACrD,CAAC;IAGD,IAAI,MAAM,IAAI,QAAQ,EAAE,CAAC;QACvB,IAAI,OAAO,IAAI,QAAQ;YAAE,OAAO,QAAQ,CAAC,IAAI,CAAC,MAAM,KAAK,CAAC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