@modern-js/utils 2.60.5 → 2.60.6-alpha.0
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/cjs/cli/require.js +7 -2
- package/dist/cjs/universal/formatWebpack.js +1 -1
- package/dist/compiled/ajv/codegen.js +1 -0
- package/dist/compiled/ajv/index.js +9 -0
- package/dist/compiled/ajv/license +22 -0
- package/dist/compiled/ajv/package.json +1 -0
- package/dist/compiled/ajv/types/ajv.d.ts +16 -0
- package/dist/compiled/ajv/types/compile/codegen/code.d.ts +40 -0
- package/dist/compiled/ajv/types/compile/codegen/index.d.ts +79 -0
- package/dist/compiled/ajv/types/compile/codegen/scope.d.ts +79 -0
- package/dist/compiled/ajv/types/compile/errors.d.ts +13 -0
- package/dist/compiled/ajv/types/compile/index.d.ts +80 -0
- package/dist/compiled/ajv/types/compile/ref_error.d.ts +6 -0
- package/dist/compiled/ajv/types/compile/resolve.d.ts +12 -0
- package/dist/compiled/ajv/types/compile/rules.d.ts +28 -0
- package/dist/compiled/ajv/types/compile/util.d.ts +40 -0
- package/dist/compiled/ajv/types/compile/validate/index.d.ts +42 -0
- package/dist/compiled/ajv/types/compile/validate/subschema.d.ts +47 -0
- package/dist/compiled/ajv/types/core.d.ts +173 -0
- package/dist/compiled/ajv/types/runtime/validation_error.d.ts +7 -0
- package/dist/compiled/ajv/types/types/index.d.ts +183 -0
- package/dist/compiled/ajv/types/types/json-schema.d.ts +124 -0
- package/dist/compiled/ajv/types/types/jtd-schema.d.ts +169 -0
- package/dist/compiled/ajv/types/vocabularies/errors.d.ts +1 -0
- package/dist/compiled/ajv/uri-js.d.ts +59 -0
- package/dist/compiled/ajv-keywords/index.d.ts +1 -0
- package/dist/compiled/ajv-keywords/index.js +1 -0
- package/dist/compiled/ajv-keywords/license +21 -0
- package/dist/compiled/ajv-keywords/package.json +1 -0
- package/dist/compiled/better-ajv-errors/index.d.ts +1 -0
- package/dist/compiled/better-ajv-errors/index.js +1 -0
- package/dist/compiled/better-ajv-errors/license +13 -0
- package/dist/compiled/better-ajv-errors/package.json +1 -0
- package/dist/compiled/recursive-readdir/index.d.ts +21 -0
- package/dist/compiled/recursive-readdir/index.js +1 -0
- package/dist/compiled/recursive-readdir/license +21 -0
- package/dist/compiled/recursive-readdir/package.json +1 -0
- package/dist/compiled/schema-utils3/index.d.ts +1 -0
- package/dist/compiled/schema-utils3/index.js +3 -0
- package/dist/compiled/schema-utils3/license +20 -0
- package/dist/compiled/schema-utils3/package.json +1 -0
- package/dist/compiled/webpack-dev-middleware/index.js +7 -0
- package/dist/compiled/webpack-dev-middleware/license +20 -0
- package/dist/compiled/webpack-dev-middleware/package.json +1 -0
- package/dist/compiled/webpack-dev-middleware/types/index.d.ts +262 -0
- package/dist/esm/cli/require.js +29 -11
- package/dist/esm/universal/formatWebpack.js +1 -1
- package/dist/esm-node/cli/require.js +7 -2
- package/dist/esm-node/universal/formatWebpack.js +1 -1
- package/package.json +1 -1
@@ -0,0 +1,183 @@
|
|
1
|
+
import * as URI from '../../uri-js';
|
2
|
+
import type { CodeGen, Code, Name, ScopeValueSets, ValueScopeName } from '../compile/codegen';
|
3
|
+
import type { SchemaEnv, SchemaCxt, SchemaObjCxt } from '../compile';
|
4
|
+
import type { JSONType } from '../compile/rules';
|
5
|
+
import type { KeywordCxt } from '../compile/validate';
|
6
|
+
import type Ajv from '../core';
|
7
|
+
interface _SchemaObject {
|
8
|
+
id?: string;
|
9
|
+
$id?: string;
|
10
|
+
$schema?: string;
|
11
|
+
[x: string]: any;
|
12
|
+
}
|
13
|
+
export interface SchemaObject extends _SchemaObject {
|
14
|
+
id?: string;
|
15
|
+
$id?: string;
|
16
|
+
$schema?: string;
|
17
|
+
$async?: false;
|
18
|
+
[x: string]: any;
|
19
|
+
}
|
20
|
+
export interface AsyncSchema extends _SchemaObject {
|
21
|
+
$async: true;
|
22
|
+
}
|
23
|
+
export declare type AnySchemaObject = SchemaObject | AsyncSchema;
|
24
|
+
export declare type Schema = SchemaObject | boolean;
|
25
|
+
export declare type AnySchema = Schema | AsyncSchema;
|
26
|
+
export declare type SchemaMap = {
|
27
|
+
[Key in string]?: AnySchema;
|
28
|
+
};
|
29
|
+
export interface SourceCode {
|
30
|
+
validateName: ValueScopeName;
|
31
|
+
validateCode: string;
|
32
|
+
scopeValues: ScopeValueSets;
|
33
|
+
evaluated?: Code;
|
34
|
+
}
|
35
|
+
export interface DataValidationCxt<T extends string | number = string | number> {
|
36
|
+
instancePath: string;
|
37
|
+
parentData: {
|
38
|
+
[K in T]: any;
|
39
|
+
};
|
40
|
+
parentDataProperty: T;
|
41
|
+
rootData: Record<string, any> | any[];
|
42
|
+
dynamicAnchors: {
|
43
|
+
[Ref in string]?: ValidateFunction;
|
44
|
+
};
|
45
|
+
}
|
46
|
+
export interface ValidateFunction<T = unknown> {
|
47
|
+
(this: Ajv | any, data: any, dataCxt?: DataValidationCxt): data is T;
|
48
|
+
errors?: null | ErrorObject[];
|
49
|
+
evaluated?: Evaluated;
|
50
|
+
schema: AnySchema;
|
51
|
+
schemaEnv: SchemaEnv;
|
52
|
+
source?: SourceCode;
|
53
|
+
}
|
54
|
+
export interface JTDParser<T = unknown> {
|
55
|
+
(json: string): T | undefined;
|
56
|
+
message?: string;
|
57
|
+
position?: number;
|
58
|
+
}
|
59
|
+
export declare type EvaluatedProperties = {
|
60
|
+
[K in string]?: true;
|
61
|
+
} | true;
|
62
|
+
export declare type EvaluatedItems = number | true;
|
63
|
+
export interface Evaluated {
|
64
|
+
props?: EvaluatedProperties;
|
65
|
+
items?: EvaluatedItems;
|
66
|
+
dynamicProps: boolean;
|
67
|
+
dynamicItems: boolean;
|
68
|
+
}
|
69
|
+
export interface AsyncValidateFunction<T = unknown> extends ValidateFunction<T> {
|
70
|
+
(...args: Parameters<ValidateFunction<T>>): Promise<T>;
|
71
|
+
$async: true;
|
72
|
+
}
|
73
|
+
export declare type AnyValidateFunction<T = any> = ValidateFunction<T> | AsyncValidateFunction<T>;
|
74
|
+
export interface ErrorObject<K extends string = string, P = Record<string, any>, S = unknown> {
|
75
|
+
keyword: K;
|
76
|
+
instancePath: string;
|
77
|
+
schemaPath: string;
|
78
|
+
params: P;
|
79
|
+
propertyName?: string;
|
80
|
+
message?: string;
|
81
|
+
schema?: S;
|
82
|
+
parentSchema?: AnySchemaObject;
|
83
|
+
data?: unknown;
|
84
|
+
}
|
85
|
+
export declare type ErrorNoParams<K extends string, S = unknown> = ErrorObject<K, Record<string, never>, S>;
|
86
|
+
interface _KeywordDef {
|
87
|
+
keyword: string | string[];
|
88
|
+
type?: JSONType | JSONType[];
|
89
|
+
schemaType?: JSONType | JSONType[];
|
90
|
+
allowUndefined?: boolean;
|
91
|
+
$data?: boolean;
|
92
|
+
implements?: string[];
|
93
|
+
before?: string;
|
94
|
+
post?: boolean;
|
95
|
+
metaSchema?: AnySchemaObject;
|
96
|
+
validateSchema?: AnyValidateFunction;
|
97
|
+
dependencies?: string[];
|
98
|
+
error?: KeywordErrorDefinition;
|
99
|
+
$dataError?: KeywordErrorDefinition;
|
100
|
+
}
|
101
|
+
export interface CodeKeywordDefinition extends _KeywordDef {
|
102
|
+
code: (cxt: KeywordCxt, ruleType?: string) => void;
|
103
|
+
trackErrors?: boolean;
|
104
|
+
}
|
105
|
+
export declare type MacroKeywordFunc = (schema: any, parentSchema: AnySchemaObject, it: SchemaCxt) => AnySchema;
|
106
|
+
export declare type CompileKeywordFunc = (schema: any, parentSchema: AnySchemaObject, it: SchemaObjCxt) => DataValidateFunction;
|
107
|
+
export interface DataValidateFunction {
|
108
|
+
(...args: Parameters<ValidateFunction>): boolean | Promise<any>;
|
109
|
+
errors?: Partial<ErrorObject>[];
|
110
|
+
}
|
111
|
+
export interface SchemaValidateFunction {
|
112
|
+
(schema: any, data: any, parentSchema?: AnySchemaObject, dataCxt?: DataValidationCxt): boolean | Promise<any>;
|
113
|
+
errors?: Partial<ErrorObject>[];
|
114
|
+
}
|
115
|
+
export interface FuncKeywordDefinition extends _KeywordDef {
|
116
|
+
validate?: SchemaValidateFunction | DataValidateFunction;
|
117
|
+
compile?: CompileKeywordFunc;
|
118
|
+
schema?: boolean;
|
119
|
+
modifying?: boolean;
|
120
|
+
async?: boolean;
|
121
|
+
valid?: boolean;
|
122
|
+
errors?: boolean | "full";
|
123
|
+
}
|
124
|
+
export interface MacroKeywordDefinition extends FuncKeywordDefinition {
|
125
|
+
macro: MacroKeywordFunc;
|
126
|
+
}
|
127
|
+
export declare type KeywordDefinition = CodeKeywordDefinition | FuncKeywordDefinition | MacroKeywordDefinition;
|
128
|
+
export declare type AddedKeywordDefinition = KeywordDefinition & {
|
129
|
+
type: JSONType[];
|
130
|
+
schemaType: JSONType[];
|
131
|
+
};
|
132
|
+
export interface KeywordErrorDefinition {
|
133
|
+
message: string | Code | ((cxt: KeywordErrorCxt) => string | Code);
|
134
|
+
params?: Code | ((cxt: KeywordErrorCxt) => Code);
|
135
|
+
}
|
136
|
+
export declare type Vocabulary = (KeywordDefinition | string)[];
|
137
|
+
export interface KeywordErrorCxt {
|
138
|
+
gen: CodeGen;
|
139
|
+
keyword: string;
|
140
|
+
data: Name;
|
141
|
+
$data?: string | false;
|
142
|
+
schema: any;
|
143
|
+
parentSchema?: AnySchemaObject;
|
144
|
+
schemaCode: Code | number | boolean;
|
145
|
+
schemaValue: Code | number | boolean;
|
146
|
+
schemaType?: JSONType[];
|
147
|
+
errsCount?: Name;
|
148
|
+
params: KeywordCxtParams;
|
149
|
+
it: SchemaCxt;
|
150
|
+
}
|
151
|
+
export declare type KeywordCxtParams = {
|
152
|
+
[P in string]?: Code | string | number;
|
153
|
+
};
|
154
|
+
export declare type FormatValidator<T extends string | number> = (data: T) => boolean;
|
155
|
+
export declare type FormatCompare<T extends string | number> = (data1: T, data2: T) => number | undefined;
|
156
|
+
export declare type AsyncFormatValidator<T extends string | number> = (data: T) => Promise<boolean>;
|
157
|
+
export interface FormatDefinition<T extends string | number> {
|
158
|
+
type?: T extends string ? "string" | undefined : "number";
|
159
|
+
validate: FormatValidator<T> | (T extends string ? string | RegExp : never);
|
160
|
+
async?: false | undefined;
|
161
|
+
compare?: FormatCompare<T>;
|
162
|
+
}
|
163
|
+
export interface AsyncFormatDefinition<T extends string | number> {
|
164
|
+
type?: T extends string ? "string" | undefined : "number";
|
165
|
+
validate: AsyncFormatValidator<T>;
|
166
|
+
async: true;
|
167
|
+
compare?: FormatCompare<T>;
|
168
|
+
}
|
169
|
+
export declare type AddedFormat = true | RegExp | FormatValidator<string> | FormatDefinition<string> | FormatDefinition<number> | AsyncFormatDefinition<string> | AsyncFormatDefinition<number>;
|
170
|
+
export declare type Format = AddedFormat | string;
|
171
|
+
export interface RegExpEngine {
|
172
|
+
(pattern: string, u: string): RegExpLike;
|
173
|
+
code: string;
|
174
|
+
}
|
175
|
+
export interface RegExpLike {
|
176
|
+
test: (s: string) => boolean;
|
177
|
+
}
|
178
|
+
export interface UriResolver {
|
179
|
+
parse(uri: string): URI.URIComponents;
|
180
|
+
resolve(base: string, path: string): string;
|
181
|
+
serialize(component: URI.URIComponents): string;
|
182
|
+
}
|
183
|
+
export {};
|
@@ -0,0 +1,124 @@
|
|
1
|
+
declare type StrictNullChecksWrapper<Name extends string, Type> = undefined extends null ? `strictNullChecks must be true in tsconfig to use ${Name}` : Type;
|
2
|
+
declare type UnionToIntersection<U> = (U extends any ? (_: U) => void : never) extends (_: infer I) => void ? I : never;
|
3
|
+
export declare type SomeJSONSchema = UncheckedJSONSchemaType<Known, true>;
|
4
|
+
declare type UncheckedPartialSchema<T> = Partial<UncheckedJSONSchemaType<T, true>>;
|
5
|
+
export declare type PartialSchema<T> = StrictNullChecksWrapper<"PartialSchema", UncheckedPartialSchema<T>>;
|
6
|
+
declare type JSONType<T extends string, IsPartial extends boolean> = IsPartial extends true ? T | undefined : T;
|
7
|
+
interface NumberKeywords {
|
8
|
+
minimum?: number;
|
9
|
+
maximum?: number;
|
10
|
+
exclusiveMinimum?: number;
|
11
|
+
exclusiveMaximum?: number;
|
12
|
+
multipleOf?: number;
|
13
|
+
format?: string;
|
14
|
+
}
|
15
|
+
interface StringKeywords {
|
16
|
+
minLength?: number;
|
17
|
+
maxLength?: number;
|
18
|
+
pattern?: string;
|
19
|
+
format?: string;
|
20
|
+
}
|
21
|
+
declare type UncheckedJSONSchemaType<T, IsPartial extends boolean> = (// these two unions allow arbitrary unions of types
|
22
|
+
{
|
23
|
+
anyOf: readonly UncheckedJSONSchemaType<T, IsPartial>[];
|
24
|
+
} | {
|
25
|
+
oneOf: readonly UncheckedJSONSchemaType<T, IsPartial>[];
|
26
|
+
} | ({
|
27
|
+
type: readonly (T extends number ? JSONType<"number" | "integer", IsPartial> : T extends string ? JSONType<"string", IsPartial> : T extends boolean ? JSONType<"boolean", IsPartial> : never)[];
|
28
|
+
} & UnionToIntersection<T extends number ? NumberKeywords : T extends string ? StringKeywords : T extends boolean ? {} : never>) | ((T extends number ? {
|
29
|
+
type: JSONType<"number" | "integer", IsPartial>;
|
30
|
+
} & NumberKeywords : T extends string ? {
|
31
|
+
type: JSONType<"string", IsPartial>;
|
32
|
+
} & StringKeywords : T extends boolean ? {
|
33
|
+
type: JSONType<"boolean", IsPartial>;
|
34
|
+
} : T extends readonly [any, ...any[]] ? {
|
35
|
+
type: JSONType<"array", IsPartial>;
|
36
|
+
items: {
|
37
|
+
readonly [K in keyof T]-?: UncheckedJSONSchemaType<T[K], false> & Nullable<T[K]>;
|
38
|
+
} & {
|
39
|
+
length: T["length"];
|
40
|
+
};
|
41
|
+
minItems: T["length"];
|
42
|
+
} & ({
|
43
|
+
maxItems: T["length"];
|
44
|
+
} | {
|
45
|
+
additionalItems: false;
|
46
|
+
}) : T extends readonly any[] ? {
|
47
|
+
type: JSONType<"array", IsPartial>;
|
48
|
+
items: UncheckedJSONSchemaType<T[0], false>;
|
49
|
+
contains?: UncheckedPartialSchema<T[0]>;
|
50
|
+
minItems?: number;
|
51
|
+
maxItems?: number;
|
52
|
+
minContains?: number;
|
53
|
+
maxContains?: number;
|
54
|
+
uniqueItems?: true;
|
55
|
+
additionalItems?: never;
|
56
|
+
} : T extends Record<string, any> ? {
|
57
|
+
type: JSONType<"object", IsPartial>;
|
58
|
+
additionalProperties?: boolean | UncheckedJSONSchemaType<T[string], false>;
|
59
|
+
unevaluatedProperties?: boolean | UncheckedJSONSchemaType<T[string], false>;
|
60
|
+
properties?: IsPartial extends true ? Partial<UncheckedPropertiesSchema<T>> : UncheckedPropertiesSchema<T>;
|
61
|
+
patternProperties?: Record<string, UncheckedJSONSchemaType<T[string], false>>;
|
62
|
+
propertyNames?: Omit<UncheckedJSONSchemaType<string, false>, "type"> & {
|
63
|
+
type?: "string";
|
64
|
+
};
|
65
|
+
dependencies?: {
|
66
|
+
[K in keyof T]?: Readonly<(keyof T)[]> | UncheckedPartialSchema<T>;
|
67
|
+
};
|
68
|
+
dependentRequired?: {
|
69
|
+
[K in keyof T]?: Readonly<(keyof T)[]>;
|
70
|
+
};
|
71
|
+
dependentSchemas?: {
|
72
|
+
[K in keyof T]?: UncheckedPartialSchema<T>;
|
73
|
+
};
|
74
|
+
minProperties?: number;
|
75
|
+
maxProperties?: number;
|
76
|
+
} & (IsPartial extends true ? {
|
77
|
+
required: Readonly<(keyof T)[]>;
|
78
|
+
} : [UncheckedRequiredMembers<T>] extends [never] ? {
|
79
|
+
required?: Readonly<UncheckedRequiredMembers<T>[]>;
|
80
|
+
} : {
|
81
|
+
required: Readonly<UncheckedRequiredMembers<T>[]>;
|
82
|
+
}) : T extends null ? {
|
83
|
+
type: JSONType<"null", IsPartial>;
|
84
|
+
nullable: true;
|
85
|
+
} : never) & {
|
86
|
+
allOf?: Readonly<UncheckedPartialSchema<T>[]>;
|
87
|
+
anyOf?: Readonly<UncheckedPartialSchema<T>[]>;
|
88
|
+
oneOf?: Readonly<UncheckedPartialSchema<T>[]>;
|
89
|
+
if?: UncheckedPartialSchema<T>;
|
90
|
+
then?: UncheckedPartialSchema<T>;
|
91
|
+
else?: UncheckedPartialSchema<T>;
|
92
|
+
not?: UncheckedPartialSchema<T>;
|
93
|
+
})) & {
|
94
|
+
[keyword: string]: any;
|
95
|
+
$id?: string;
|
96
|
+
$ref?: string;
|
97
|
+
$defs?: Record<string, UncheckedJSONSchemaType<Known, true>>;
|
98
|
+
definitions?: Record<string, UncheckedJSONSchemaType<Known, true>>;
|
99
|
+
};
|
100
|
+
export declare type JSONSchemaType<T> = StrictNullChecksWrapper<"JSONSchemaType", UncheckedJSONSchemaType<T, false>>;
|
101
|
+
declare type Known = {
|
102
|
+
[key: string]: Known;
|
103
|
+
} | [Known, ...Known[]] | Known[] | number | string | boolean | null;
|
104
|
+
declare type UncheckedPropertiesSchema<T> = {
|
105
|
+
[K in keyof T]-?: (UncheckedJSONSchemaType<T[K], false> & Nullable<T[K]>) | {
|
106
|
+
$ref: string;
|
107
|
+
};
|
108
|
+
};
|
109
|
+
export declare type PropertiesSchema<T> = StrictNullChecksWrapper<"PropertiesSchema", UncheckedPropertiesSchema<T>>;
|
110
|
+
declare type UncheckedRequiredMembers<T> = {
|
111
|
+
[K in keyof T]-?: undefined extends T[K] ? never : K;
|
112
|
+
}[keyof T];
|
113
|
+
export declare type RequiredMembers<T> = StrictNullChecksWrapper<"RequiredMembers", UncheckedRequiredMembers<T>>;
|
114
|
+
declare type Nullable<T> = undefined extends T ? {
|
115
|
+
nullable: true;
|
116
|
+
const?: null;
|
117
|
+
enum?: Readonly<(T | null)[]>;
|
118
|
+
default?: T | null;
|
119
|
+
} : {
|
120
|
+
const?: T;
|
121
|
+
enum?: Readonly<T[]>;
|
122
|
+
default?: T;
|
123
|
+
};
|
124
|
+
export {};
|
@@ -0,0 +1,169 @@
|
|
1
|
+
/** numeric strings */
|
2
|
+
declare type NumberType = "float32" | "float64" | "int8" | "uint8" | "int16" | "uint16" | "int32" | "uint32";
|
3
|
+
/** string strings */
|
4
|
+
declare type StringType = "string" | "timestamp";
|
5
|
+
/** Generic JTD Schema without inference of the represented type */
|
6
|
+
export declare type SomeJTDSchemaType = (// ref
|
7
|
+
{
|
8
|
+
ref: string;
|
9
|
+
} | {
|
10
|
+
type: NumberType | StringType | "boolean";
|
11
|
+
} | {
|
12
|
+
enum: string[];
|
13
|
+
} | {
|
14
|
+
elements: SomeJTDSchemaType;
|
15
|
+
} | {
|
16
|
+
values: SomeJTDSchemaType;
|
17
|
+
} | {
|
18
|
+
properties: Record<string, SomeJTDSchemaType>;
|
19
|
+
optionalProperties?: Record<string, SomeJTDSchemaType>;
|
20
|
+
additionalProperties?: boolean;
|
21
|
+
} | {
|
22
|
+
properties?: Record<string, SomeJTDSchemaType>;
|
23
|
+
optionalProperties: Record<string, SomeJTDSchemaType>;
|
24
|
+
additionalProperties?: boolean;
|
25
|
+
} | {
|
26
|
+
discriminator: string;
|
27
|
+
mapping: Record<string, SomeJTDSchemaType>;
|
28
|
+
} | {}) & {
|
29
|
+
nullable?: boolean;
|
30
|
+
metadata?: Record<string, unknown>;
|
31
|
+
definitions?: Record<string, SomeJTDSchemaType>;
|
32
|
+
};
|
33
|
+
/** required keys of an object, not undefined */
|
34
|
+
declare type RequiredKeys<T> = {
|
35
|
+
[K in keyof T]-?: undefined extends T[K] ? never : K;
|
36
|
+
}[keyof T];
|
37
|
+
/** optional or undifined-able keys of an object */
|
38
|
+
declare type OptionalKeys<T> = {
|
39
|
+
[K in keyof T]-?: undefined extends T[K] ? K : never;
|
40
|
+
}[keyof T];
|
41
|
+
/** type is true if T is a union type */
|
42
|
+
declare type IsUnion_<T, U extends T = T> = false extends (T extends unknown ? ([U] extends [T] ? false : true) : never) ? false : true;
|
43
|
+
declare type IsUnion<T> = IsUnion_<T>;
|
44
|
+
/** type is true if T is identically E */
|
45
|
+
declare type TypeEquality<T, E> = [T] extends [E] ? ([E] extends [T] ? true : false) : false;
|
46
|
+
/** type is true if T or null is identically E or null*/
|
47
|
+
declare type NullTypeEquality<T, E> = TypeEquality<T | null, E | null>;
|
48
|
+
/** gets only the string literals of a type or null if a type isn't a string literal */
|
49
|
+
declare type EnumString<T> = [T] extends [never] ? null : T extends string ? string extends T ? null : T : null;
|
50
|
+
/** true if type is a union of string literals */
|
51
|
+
declare type IsEnum<T> = null extends EnumString<Exclude<T, null>> ? false : true;
|
52
|
+
/** true only if all types are array types (not tuples) */
|
53
|
+
declare type IsElements<T> = false extends IsUnion<T> ? [T] extends [readonly unknown[]] ? undefined extends T[0.5] ? false : true : false : false;
|
54
|
+
/** true if the the type is a values type */
|
55
|
+
declare type IsValues<T> = false extends IsUnion<Exclude<T, null>> ? TypeEquality<keyof Exclude<T, null>, string> : false;
|
56
|
+
/** true if type is a proeprties type and Union is false, or type is a discriminator type and Union is true */
|
57
|
+
declare type IsRecord<T, Union extends boolean> = Union extends IsUnion<Exclude<T, null>> ? null extends EnumString<keyof Exclude<T, null>> ? false : true : false;
|
58
|
+
/** actual schema */
|
59
|
+
export declare type JTDSchemaType<T, D extends Record<string, unknown> = Record<string, never>> = (// refs - where null wasn't specified, must match exactly
|
60
|
+
(null extends EnumString<keyof D> ? never : ({
|
61
|
+
[K in keyof D]: [T] extends [D[K]] ? {
|
62
|
+
ref: K;
|
63
|
+
} : never;
|
64
|
+
}[keyof D] & {
|
65
|
+
nullable?: false;
|
66
|
+
}) | (null extends T ? {
|
67
|
+
[K in keyof D]: [Exclude<T, null>] extends [Exclude<D[K], null>] ? {
|
68
|
+
ref: K;
|
69
|
+
} : never;
|
70
|
+
}[keyof D] & {
|
71
|
+
nullable: true;
|
72
|
+
} : never)) | (unknown extends T ? {
|
73
|
+
nullable?: boolean;
|
74
|
+
} : never) | ((true extends NullTypeEquality<T, number> ? {
|
75
|
+
type: NumberType;
|
76
|
+
} : true extends NullTypeEquality<T, boolean> ? {
|
77
|
+
type: "boolean";
|
78
|
+
} : true extends NullTypeEquality<T, string> ? {
|
79
|
+
type: StringType;
|
80
|
+
} : true extends NullTypeEquality<T, Date> ? {
|
81
|
+
type: "timestamp";
|
82
|
+
} : true extends IsEnum<T> ? {
|
83
|
+
enum: EnumString<Exclude<T, null>>[];
|
84
|
+
} : true extends IsElements<Exclude<T, null>> ? T extends readonly (infer E)[] ? {
|
85
|
+
elements: JTDSchemaType<E, D>;
|
86
|
+
} : never : true extends IsValues<T> ? T extends Record<string, infer V> ? {
|
87
|
+
values: JTDSchemaType<V, D>;
|
88
|
+
} : never : true extends IsRecord<T, false> ? ([RequiredKeys<Exclude<T, null>>] extends [never] ? {
|
89
|
+
properties?: Record<string, never>;
|
90
|
+
} : {
|
91
|
+
properties: {
|
92
|
+
[K in RequiredKeys<T>]: JTDSchemaType<T[K], D>;
|
93
|
+
};
|
94
|
+
}) & ([OptionalKeys<Exclude<T, null>>] extends [never] ? {
|
95
|
+
optionalProperties?: Record<string, never>;
|
96
|
+
} : {
|
97
|
+
optionalProperties: {
|
98
|
+
[K in OptionalKeys<T>]: JTDSchemaType<Exclude<T[K], undefined>, D>;
|
99
|
+
};
|
100
|
+
}) & {
|
101
|
+
additionalProperties?: boolean;
|
102
|
+
} : true extends IsRecord<T, true> ? {
|
103
|
+
[K in keyof Exclude<T, null>]-?: Exclude<T, null>[K] extends string ? {
|
104
|
+
discriminator: K;
|
105
|
+
mapping: {
|
106
|
+
[M in Exclude<T, null>[K]]: JTDSchemaType<Omit<T extends {
|
107
|
+
[C in K]: M;
|
108
|
+
} ? T : never, K>, D>;
|
109
|
+
};
|
110
|
+
} : never;
|
111
|
+
}[keyof Exclude<T, null>] : never) & (null extends T ? {
|
112
|
+
nullable: true;
|
113
|
+
} : {
|
114
|
+
nullable?: false;
|
115
|
+
}))) & {
|
116
|
+
metadata?: Record<string, unknown>;
|
117
|
+
definitions?: {
|
118
|
+
[K in keyof D]: JTDSchemaType<D[K], D>;
|
119
|
+
};
|
120
|
+
};
|
121
|
+
declare type JTDDataDef<S, D extends Record<string, unknown>> = // ref
|
122
|
+
(S extends {
|
123
|
+
ref: string;
|
124
|
+
} ? D extends {
|
125
|
+
[K in S["ref"]]: infer V;
|
126
|
+
} ? JTDDataDef<V, D> : never : S extends {
|
127
|
+
type: NumberType;
|
128
|
+
} ? number : S extends {
|
129
|
+
type: "boolean";
|
130
|
+
} ? boolean : S extends {
|
131
|
+
type: "string";
|
132
|
+
} ? string : S extends {
|
133
|
+
type: "timestamp";
|
134
|
+
} ? string | Date : S extends {
|
135
|
+
enum: readonly (infer E)[];
|
136
|
+
} ? string extends E ? never : [E] extends [string] ? E : never : S extends {
|
137
|
+
elements: infer E;
|
138
|
+
} ? JTDDataDef<E, D>[] : S extends {
|
139
|
+
properties: Record<string, unknown>;
|
140
|
+
optionalProperties?: Record<string, unknown>;
|
141
|
+
additionalProperties?: boolean;
|
142
|
+
} ? {
|
143
|
+
-readonly [K in keyof S["properties"]]-?: JTDDataDef<S["properties"][K], D>;
|
144
|
+
} & {
|
145
|
+
-readonly [K in keyof S["optionalProperties"]]+?: JTDDataDef<S["optionalProperties"][K], D>;
|
146
|
+
} & ([S["additionalProperties"]] extends [true] ? Record<string, unknown> : unknown) : S extends {
|
147
|
+
properties?: Record<string, unknown>;
|
148
|
+
optionalProperties: Record<string, unknown>;
|
149
|
+
additionalProperties?: boolean;
|
150
|
+
} ? {
|
151
|
+
-readonly [K in keyof S["properties"]]-?: JTDDataDef<S["properties"][K], D>;
|
152
|
+
} & {
|
153
|
+
-readonly [K in keyof S["optionalProperties"]]+?: JTDDataDef<S["optionalProperties"][K], D>;
|
154
|
+
} & ([S["additionalProperties"]] extends [true] ? Record<string, unknown> : unknown) : S extends {
|
155
|
+
values: infer V;
|
156
|
+
} ? Record<string, JTDDataDef<V, D>> : S extends {
|
157
|
+
discriminator: infer M;
|
158
|
+
mapping: Record<string, unknown>;
|
159
|
+
} ? [M] extends [string] ? {
|
160
|
+
[K in keyof S["mapping"]]: JTDDataDef<S["mapping"][K], D> & {
|
161
|
+
[KM in M]: K;
|
162
|
+
};
|
163
|
+
}[keyof S["mapping"]] : never : unknown) | (S extends {
|
164
|
+
nullable: true;
|
165
|
+
} ? null : never);
|
166
|
+
export declare type JTDDataType<S> = S extends {
|
167
|
+
definitions: Record<string, unknown>;
|
168
|
+
} ? JTDDataDef<S, S["definitions"]> : JTDDataDef<S, Record<string, never>>;
|
169
|
+
export {};
|
@@ -0,0 +1 @@
|
|
1
|
+
export type DefinedError = any;
|
@@ -0,0 +1,59 @@
|
|
1
|
+
export interface URIComponents {
|
2
|
+
scheme?: string;
|
3
|
+
userinfo?: string;
|
4
|
+
host?: string;
|
5
|
+
port?: number | string;
|
6
|
+
path?: string;
|
7
|
+
query?: string;
|
8
|
+
fragment?: string;
|
9
|
+
reference?: string;
|
10
|
+
error?: string;
|
11
|
+
}
|
12
|
+
export interface URIOptions {
|
13
|
+
scheme?: string;
|
14
|
+
reference?: string;
|
15
|
+
tolerant?: boolean;
|
16
|
+
absolutePath?: boolean;
|
17
|
+
iri?: boolean;
|
18
|
+
unicodeSupport?: boolean;
|
19
|
+
domainHost?: boolean;
|
20
|
+
}
|
21
|
+
export interface URISchemeHandler<Components extends URIComponents = URIComponents, Options extends URIOptions = URIOptions, ParentComponents extends URIComponents = URIComponents> {
|
22
|
+
scheme: string;
|
23
|
+
parse(components: ParentComponents, options: Options): Components;
|
24
|
+
serialize(components: Components, options: Options): ParentComponents;
|
25
|
+
unicodeSupport?: boolean;
|
26
|
+
domainHost?: boolean;
|
27
|
+
absolutePath?: boolean;
|
28
|
+
}
|
29
|
+
export interface URIRegExps {
|
30
|
+
NOT_SCHEME: RegExp;
|
31
|
+
NOT_USERINFO: RegExp;
|
32
|
+
NOT_HOST: RegExp;
|
33
|
+
NOT_PATH: RegExp;
|
34
|
+
NOT_PATH_NOSCHEME: RegExp;
|
35
|
+
NOT_QUERY: RegExp;
|
36
|
+
NOT_FRAGMENT: RegExp;
|
37
|
+
ESCAPE: RegExp;
|
38
|
+
UNRESERVED: RegExp;
|
39
|
+
OTHER_CHARS: RegExp;
|
40
|
+
PCT_ENCODED: RegExp;
|
41
|
+
IPV4ADDRESS: RegExp;
|
42
|
+
IPV6ADDRESS: RegExp;
|
43
|
+
}
|
44
|
+
export declare const SCHEMES: {
|
45
|
+
[scheme: string]: URISchemeHandler;
|
46
|
+
};
|
47
|
+
export declare function pctEncChar(chr: string): string;
|
48
|
+
export declare function pctDecChars(str: string): string;
|
49
|
+
export declare function parse(uriString: string, options?: URIOptions): URIComponents;
|
50
|
+
export declare function removeDotSegments(input: string): string;
|
51
|
+
export declare function serialize(components: URIComponents, options?: URIOptions): string;
|
52
|
+
export declare function resolveComponents(base: URIComponents, relative: URIComponents, options?: URIOptions, skipNormalization?: boolean): URIComponents;
|
53
|
+
export declare function resolve(baseURI: string, relativeURI: string, options?: URIOptions): string;
|
54
|
+
export declare function normalize(uri: string, options?: URIOptions): string;
|
55
|
+
export declare function normalize(uri: URIComponents, options?: URIOptions): URIComponents;
|
56
|
+
export declare function equal(uriA: string, uriB: string, options?: URIOptions): boolean;
|
57
|
+
export declare function equal(uriA: URIComponents, uriB: URIComponents, options?: URIOptions): boolean;
|
58
|
+
export declare function escapeComponent(str: string, options?: URIOptions): string;
|
59
|
+
export declare function unescapeComponent(str: string, options?: URIOptions): string;
|
@@ -0,0 +1 @@
|
|
1
|
+
export = any;
|
@@ -0,0 +1 @@
|
|
1
|
+
(()=>{"use strict";var e={408:(e,t)=>{Object.defineProperty(t,"__esModule",{value:true});function getRangeDef(e){return()=>({keyword:e,type:"number",schemaType:"array",macro:function([t,r]){validateRangeSchema(t,r);return e==="range"?{minimum:t,maximum:r}:{exclusiveMinimum:t,exclusiveMaximum:r}},metaSchema:{type:"array",minItems:2,maxItems:2,items:{type:"number"}}});function validateRangeSchema(t,r){if(t>r||e==="exclusiveRange"&&t===r){throw new Error("There are no numbers in range")}}}t["default"]=getRangeDef},85:(e,t)=>{Object.defineProperty(t,"__esModule",{value:true});function getRequiredDef(e){return()=>({keyword:e,type:"object",schemaType:"array",macro(t){if(t.length===0)return true;if(t.length===1)return{required:t};const r=e==="anyRequired"?"anyOf":"oneOf";return{[r]:t.map((e=>({required:[e]})))}},metaSchema:{type:"array",items:{type:"string"}}})}t["default"]=getRequiredDef},503:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:true});t.usePattern=t.metaSchemaRef=void 0;const n=r(759);const o="http://json-schema.org/schema";function metaSchemaRef({defaultMeta:e}={}){return e===false?{}:{$ref:e||o}}t.metaSchemaRef=metaSchemaRef;function usePattern({gen:e,it:{opts:t}},r,o=(t.unicodeRegExp?"u":"")){const a=new RegExp(r,o);return e.scopeValue("pattern",{key:a.toString(),ref:a,code:(0,n._)`new RegExp(${r}, ${o})`})}t.usePattern=usePattern},160:(e,t)=>{Object.defineProperty(t,"__esModule",{value:true});function getDef(){return{keyword:"allRequired",type:"object",schemaType:"boolean",macro(e,t){if(!e)return true;const r=Object.keys(t.properties);if(r.length===0)return true;return{required:r}},dependencies:["properties"]}}t["default"]=getDef;e.exports=getDef},817:function(e,t,r){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});const o=n(r(85));const a=(0,o.default)("anyRequired");t["default"]=a;e.exports=a},165:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:true});const n=r(503);function getDef(e){return{keyword:"deepProperties",type:"object",schemaType:"object",macro:function(e){const t=[];for(const r in e)t.push(getSchema(r,e[r]));return{allOf:t}},metaSchema:{type:"object",propertyNames:{type:"string",format:"json-pointer"},additionalProperties:(0,n.metaSchemaRef)(e)}}}t["default"]=getDef;function getSchema(e,t){const r=e.split("/");const n={};let o=n;for(let e=1;e<r.length;e++){let n=r[e];const a=e===r.length-1;n=unescapeJsonPointer(n);const u=o.properties={};let s;if(/[0-9]+/.test(n)){let e=+n;s=o.items=[];o.type=["object","array"];while(e--)s.push({})}else{o.type="object"}o=a?t:{};u[n]=o;if(s)s.push(o)}return n}function unescapeJsonPointer(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}e.exports=getDef},592:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:true});const n=r(759);function getDef(){return{keyword:"deepRequired",type:"object",schemaType:"array",code(e){const{schema:t,data:r}=e;const o=t.map((e=>(0,n._)`(${getData(e)}) === undefined`));e.fail((0,n.or)(...o));function getData(e){if(e==="")throw new Error("empty JSON pointer not allowed");const t=e.split("/");let o=r;const a=t.map(((e,t)=>t?o=(0,n._)`${o}${(0,n.getProperty)(unescapeJPSegment(e))}`:o));return(0,n.and)(...a)}},metaSchema:{type:"array",items:{type:"string",format:"json-pointer"}}}}t["default"]=getDef;function unescapeJPSegment(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}e.exports=getDef},220:(e,t)=>{Object.defineProperty(t,"__esModule",{value:true});const r={};const n={timestamp:()=>()=>Date.now(),datetime:()=>()=>(new Date).toISOString(),date:()=>()=>(new Date).toISOString().slice(0,10),time:()=>()=>(new Date).toISOString().slice(11),random:()=>()=>Math.random(),randomint:e=>{var t;const r=(t=e===null||e===void 0?void 0:e.max)!==null&&t!==void 0?t:2;return()=>Math.floor(Math.random()*r)},seq:e=>{var t;const n=(t=e===null||e===void 0?void 0:e.name)!==null&&t!==void 0?t:"";r[n]||(r[n]=0);return()=>r[n]++}};const o=Object.assign(_getDef,{DEFAULTS:n});function _getDef(){return{keyword:"dynamicDefaults",type:"object",schemaType:["string","object"],modifying:true,valid:true,compile(e,t,r){if(!r.opts.useDefaults||r.compositeRule)return()=>true;const n={};for(const t in e)n[t]=getDefault(e[t]);const o=r.opts.useDefaults==="empty";return t=>{for(const r in e){if(t[r]===undefined||o&&(t[r]===null||t[r]==="")){t[r]=n[r]()}}return true}},metaSchema:{type:"object",additionalProperties:{anyOf:[{type:"string"},{type:"object",additionalProperties:false,required:["func","args"],properties:{func:{type:"string"},args:{type:"object"}}}]}}}}function getDefault(e){return typeof e=="object"?getObjDefault(e):getStrDefault(e)}function getObjDefault({func:e,args:t}){const r=n[e];assertDefined(e,r);return r(t)}function getStrDefault(e=""){const t=n[e];assertDefined(e,t);return t()}function assertDefined(e,t){if(!t)throw new Error(`invalid "dynamicDefaults" keyword property value: ${e}`)}t["default"]=o;e.exports=o},541:function(e,t,r){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});const o=n(r(408));const a=(0,o.default)("exclusiveRange");t["default"]=a;e.exports=a},785:(e,t)=>{Object.defineProperty(t,"__esModule",{value:true});const r={Object:Object,Array:Array,Function:Function,Number:Number,String:String,Date:Date,RegExp:RegExp};if(typeof Buffer!="undefined")r.Buffer=Buffer;if(typeof Promise!="undefined")r.Promise=Promise;const n=Object.assign(_getDef,{CONSTRUCTORS:r});function _getDef(){return{keyword:"instanceof",schemaType:["string","array"],compile(e){if(typeof e=="string"){const t=getConstructor(e);return e=>e instanceof t}if(Array.isArray(e)){const t=e.map(getConstructor);return e=>{for(const r of t){if(e instanceof r)return true}return false}}throw new Error("ajv implementation error")},metaSchema:{anyOf:[{type:"string"},{type:"array",items:{type:"string"}}]}}}function getConstructor(e){const t=r[e];if(t)return t;throw new Error(`invalid "instanceof" keyword value ${e}`)}t["default"]=n;e.exports=n},656:function(e,t,r){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});const o=n(r(85));const a=(0,o.default)("oneRequired");t["default"]=a;e.exports=a},818:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:true});const n=r(759);const o=r(503);const a={message:({params:{missingPattern:e}})=>(0,n.str)`should have property matching pattern '${e}'`,params:({params:{missingPattern:e}})=>(0,n._)`{missingPattern: ${e}}`};function getDef(){return{keyword:"patternRequired",type:"object",schemaType:"array",error:a,code(e){const{gen:t,schema:r,data:a}=e;if(r.length===0)return;const u=t.let("valid",true);for(const e of r)validateProperties(e);function validateProperties(r){const s=t.let("matched",false);t.forIn("key",a,(a=>{t.assign(s,(0,n._)`${(0,o.usePattern)(e,r)}.test(${a})`);t.if(s,(()=>t.break()))}));e.setParams({missingPattern:r});t.assign(u,(0,n.and)(u,s));e.pass(u)}},metaSchema:{type:"array",items:{type:"string",format:"regex"},uniqueItems:true}}}t["default"]=getDef;e.exports=getDef},506:(e,t)=>{Object.defineProperty(t,"__esModule",{value:true});function getDef(){return{keyword:"prohibited",type:"object",schemaType:"array",macro:function(e){if(e.length===0)return true;if(e.length===1)return{not:{required:e}};return{not:{anyOf:e.map((e=>({required:[e]})))}}},metaSchema:{type:"array",items:{type:"string"}}}}t["default"]=getDef;e.exports=getDef},669:function(e,t,r){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});const o=n(r(408));const a=(0,o.default)("range");t["default"]=a;e.exports=a},163:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:true});const n=r(759);const o=r(503);const a={type:"object",properties:{pattern:{type:"string"},flags:{type:"string",nullable:true}},required:["pattern"],additionalProperties:false};const u=/^\/(.*)\/([gimuy]*)$/;function getDef(){return{keyword:"regexp",type:"string",schemaType:["string","object"],code(e){const{data:t,schema:r}=e;const a=getRegExp(r);e.pass((0,n._)`${a}.test(${t})`);function getRegExp(t){if(typeof t=="object")return(0,o.usePattern)(e,t.pattern,t.flags);const r=u.exec(t);if(r)return(0,o.usePattern)(e,r[1],r[2]);throw new Error("cannot parse string into RegExp")}},metaSchema:{anyOf:[{type:"string"},a]}}}t["default"]=getDef;e.exports=getDef},730:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:true});const n=r(759);const o=r(503);const a={message:({params:{schemaProp:e}})=>e?(0,n.str)`should match case "${e}" schema`:(0,n.str)`should match default case schema`,params:({params:{schemaProp:e}})=>e?(0,n._)`{failingCase: ${e}}`:(0,n._)`{failingDefault: true}`};function getDef(e){const t=(0,o.metaSchemaRef)(e);return[{keyword:"select",schemaType:["string","number","boolean","null"],$data:true,error:a,dependencies:["selectCases"],code(e){const{gen:t,schemaCode:r,parentSchema:o}=e;e.block$data(n.nil,(()=>{const a=t.let("valid",true);const u=t.name("_valid");const s=t.const("value",(0,n._)`${r} === null ? "null" : ${r}`);t.if(false);for(const r in o.selectCases){e.setParams({schemaProp:r});t.elseIf((0,n._)`"" + ${s} == ${r}`);const o=e.subschema({keyword:"selectCases",schemaProp:r},u);e.mergeEvaluated(o,n.Name);t.assign(a,u)}t.else();if(o.selectDefault!==undefined){e.setParams({schemaProp:undefined});const r=e.subschema({keyword:"selectDefault"},u);e.mergeEvaluated(r,n.Name);t.assign(a,u)}t.endIf();e.pass(a)}))}},{keyword:"selectCases",dependencies:["select"],metaSchema:{type:"object",additionalProperties:t}},{keyword:"selectDefault",dependencies:["select","selectCases"],metaSchema:t}]}t["default"]=getDef;e.exports=getDef},678:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:true});const n=r(759);const o={trimStart:e=>e.trimStart(),trimEnd:e=>e.trimEnd(),trimLeft:e=>e.trimStart(),trimRight:e=>e.trimEnd(),trim:e=>e.trim(),toLowerCase:e=>e.toLowerCase(),toUpperCase:e=>e.toUpperCase(),toEnumCase:(e,t)=>(t===null||t===void 0?void 0:t.hash[configKey(e)])||e};const a=Object.assign(_getDef,{transform:o});function _getDef(){return{keyword:"transform",schemaType:"array",before:"enum",code(e){const{gen:t,data:r,schema:a,parentSchema:u,it:s}=e;const{parentData:i,parentDataProperty:f}=s;const c=a;if(!c.length)return;let l;if(c.includes("toEnumCase")){const e=getEnumCaseCfg(u);l=t.scopeValue("obj",{ref:e,code:(0,n.stringify)(e)})}t.if((0,n._)`typeof ${r} == "string" && ${i} !== undefined`,(()=>{t.assign(r,transformExpr(c.slice()));t.assign((0,n._)`${i}[${f}]`,r)}));function transformExpr(e){if(!e.length)return r;const a=e.pop();if(!(a in o))throw new Error(`transform: unknown transformation ${a}`);const u=t.scopeValue("func",{ref:o[a],code:(0,n._)`require("ajv-keywords/dist/definitions/transform").transform${(0,n.getProperty)(a)}`});const s=transformExpr(e);return l&&a==="toEnumCase"?(0,n._)`${u}(${s}, ${l})`:(0,n._)`${u}(${s})`}},metaSchema:{type:"array",items:{type:"string",enum:Object.keys(o)}}}}function getEnumCaseCfg(e){const t={hash:{}};if(!e.enum)throw new Error('transform: "toEnumCase" requires "enum"');for(const r of e.enum){if(typeof r!=="string")continue;const e=configKey(r);if(t.hash[e]){throw new Error('transform: "toEnumCase" requires all lowercased "enum" values to be unique')}t.hash[e]=r}return t}function configKey(e){return e.toLowerCase()}t["default"]=a;e.exports=a},518:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:true});const n=r(759);const o=["undefined","string","number","object","function","boolean","symbol"];function getDef(){return{keyword:"typeof",schemaType:["string","array"],code(e){const{data:t,schema:r,schemaValue:o}=e;e.fail(typeof r=="string"?(0,n._)`typeof ${t} != ${r}`:(0,n._)`${o}.indexOf(typeof ${t}) < 0`)},metaSchema:{anyOf:[{type:"string",enum:o},{type:"array",items:{type:"string",enum:o}}]}}}t["default"]=getDef;e.exports=getDef},530:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:true});const n=r(447);const o=["number","integer","string","boolean","null"];function getDef(){return{keyword:"uniqueItemProperties",type:"array",schemaType:"array",compile(e,t){const r=getScalarKeys(e,t);return t=>{if(t.length<=1)return true;for(let o=0;o<e.length;o++){const a=e[o];if(r[o]){const e={};for(const r of t){if(!r||typeof r!="object")continue;let t=r[a];if(t&&typeof t=="object")continue;if(typeof t=="string")t='"'+t;if(e[t])return false;e[t]=true}}else{for(let e=t.length;e--;){const r=t[e];if(!r||typeof r!="object")continue;for(let o=e;o--;){const e=t[o];if(e&&typeof e=="object"&&n(r[a],e[a]))return false}}}}return true}},metaSchema:{type:"array",items:{type:"string"}}}}t["default"]=getDef;function getScalarKeys(e,t){return e.map((e=>{var r,n,a;const u=(a=(n=(r=t.items)===null||r===void 0?void 0:r.properties)===null||n===void 0?void 0:n[e])===null||a===void 0?void 0:a.type;return Array.isArray(u)?!u.includes("object")&&!u.includes("array"):o.includes(u)}))}e.exports=getDef},563:function(e,t,r){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});const o=n(r(959));const ajvKeywords=(e,t)=>{if(Array.isArray(t)){for(const r of t)get(r)(e);return e}if(t){get(t)(e);return e}for(t in o.default)get(t)(e);return e};ajvKeywords.get=get;function get(e){const t=o.default[e];if(!t)throw new Error("Unknown keyword "+e);return t}t["default"]=ajvKeywords;e.exports=ajvKeywords;e.exports["default"]=ajvKeywords},237:function(e,t,r){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});const o=n(r(160));const allRequired=e=>e.addKeyword((0,o.default)());t["default"]=allRequired;e.exports=allRequired},484:function(e,t,r){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});const o=n(r(817));const anyRequired=e=>e.addKeyword((0,o.default)());t["default"]=anyRequired;e.exports=anyRequired},739:function(e,t,r){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});const o=n(r(165));const deepProperties=(e,t)=>e.addKeyword((0,o.default)(t));t["default"]=deepProperties;e.exports=deepProperties},360:function(e,t,r){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});const o=n(r(592));const deepRequired=e=>e.addKeyword((0,o.default)());t["default"]=deepRequired;e.exports=deepRequired},515:function(e,t,r){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});const o=n(r(220));const dynamicDefaults=e=>e.addKeyword((0,o.default)());t["default"]=dynamicDefaults;e.exports=dynamicDefaults},304:function(e,t,r){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});const o=n(r(541));const exclusiveRange=e=>e.addKeyword((0,o.default)());t["default"]=exclusiveRange;e.exports=exclusiveRange},959:function(e,t,r){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});const o=n(r(401));const a=n(r(499));const u=n(r(119));const s=n(r(304));const i=n(r(33));const f=n(r(573));const c=n(r(857));const l=n(r(237));const d=n(r(484));const p=n(r(207));const m=n(r(417));const y=n(r(832));const _=n(r(739));const g=n(r(360));const h=n(r(515));const v=n(r(520));const b={typeof:o.default,instanceof:a.default,range:u.default,exclusiveRange:s.default,regexp:i.default,transform:f.default,uniqueItemProperties:c.default,allRequired:l.default,anyRequired:d.default,oneRequired:p.default,patternRequired:m.default,prohibited:y.default,deepProperties:_.default,deepRequired:g.default,dynamicDefaults:h.default,select:v.default};t["default"]=b;e.exports=b},499:function(e,t,r){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});const o=n(r(785));const instanceofPlugin=e=>e.addKeyword((0,o.default)());t["default"]=instanceofPlugin;e.exports=instanceofPlugin},207:function(e,t,r){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});const o=n(r(656));const oneRequired=e=>e.addKeyword((0,o.default)());t["default"]=oneRequired;e.exports=oneRequired},417:function(e,t,r){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});const o=n(r(818));const patternRequired=e=>e.addKeyword((0,o.default)());t["default"]=patternRequired;e.exports=patternRequired},832:function(e,t,r){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});const o=n(r(506));const prohibited=e=>e.addKeyword((0,o.default)());t["default"]=prohibited;e.exports=prohibited},119:function(e,t,r){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});const o=n(r(669));const range=e=>e.addKeyword((0,o.default)());t["default"]=range;e.exports=range},33:function(e,t,r){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});const o=n(r(163));const regexp=e=>e.addKeyword((0,o.default)());t["default"]=regexp;e.exports=regexp},520:function(e,t,r){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});const o=n(r(730));const select=(e,t)=>{(0,o.default)(t).forEach((t=>e.addKeyword(t)));return e};t["default"]=select;e.exports=select},573:function(e,t,r){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});const o=n(r(678));const transform=e=>e.addKeyword((0,o.default)());t["default"]=transform;e.exports=transform},401:function(e,t,r){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});const o=n(r(518));const typeofPlugin=e=>e.addKeyword((0,o.default)());t["default"]=typeofPlugin;e.exports=typeofPlugin},857:function(e,t,r){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});const o=n(r(530));const uniqueItemProperties=e=>e.addKeyword((0,o.default)());t["default"]=uniqueItemProperties;e.exports=uniqueItemProperties},447:e=>{e.exports=function equal(e,t){if(e===t)return true;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return false;var r,n,o;if(Array.isArray(e)){r=e.length;if(r!=t.length)return false;for(n=r;n--!==0;)if(!equal(e[n],t[n]))return false;return true}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===t.toString();o=Object.keys(e);r=o.length;if(r!==Object.keys(t).length)return false;for(n=r;n--!==0;)if(!Object.prototype.hasOwnProperty.call(t,o[n]))return false;for(n=r;n--!==0;){var a=o[n];if(!equal(e[a],t[a]))return false}return true}return e!==e&&t!==t}},759:e=>{e.exports=require("../ajv/codegen")}};var t={};function __nccwpck_require__(r){var n=t[r];if(n!==undefined){return n.exports}var o=t[r]={exports:{}};var a=true;try{e[r].call(o.exports,o,o.exports,__nccwpck_require__);a=false}finally{if(a)delete t[r]}return o.exports}if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var r=__nccwpck_require__(563);module.exports=r})();
|
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2016 Evgeny Poberezkin
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
@@ -0,0 +1 @@
|
|
1
|
+
{"name":"ajv-keywords","author":"Evgeny Poberezkin","version":"5.1.0","license":"MIT","types":"index.d.ts"}
|
@@ -0,0 +1 @@
|
|
1
|
+
export = any;
|