cdk-common 2.0.368 → 2.0.369
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/.jsii +3 -3
- package/lib/main.js +1 -1
- package/node_modules/@aws-cdk/assert/LICENSE +1 -1
- package/node_modules/@aws-cdk/assert/NOTICE +1 -1
- package/node_modules/@aws-cdk/assert/package.json +8 -8
- package/node_modules/@aws-cdk/cfnspec/build-tools/template/LICENSE +1 -1
- package/node_modules/@aws-cdk/cfnspec/build-tools/template/NOTICE +1 -1
- package/node_modules/@aws-cdk/cfnspec/package.json +3 -3
- package/node_modules/@aws-cdk/cloudformation-diff/LICENSE +1 -1
- package/node_modules/@aws-cdk/cloudformation-diff/NOTICE +1 -1
- package/node_modules/@aws-cdk/cloudformation-diff/package.json +4 -4
- package/node_modules/table/node_modules/ajv/README.md +5 -4
- package/node_modules/table/node_modules/ajv/dist/compile/codegen/code.d.ts +5 -5
- package/node_modules/table/node_modules/ajv/dist/compile/codegen/index.d.ts +2 -2
- package/node_modules/table/node_modules/ajv/dist/compile/codegen/scope.d.ts +5 -5
- package/node_modules/table/node_modules/ajv/dist/compile/index.d.ts +1 -1
- package/node_modules/table/node_modules/ajv/dist/compile/jtd/serialize.js +18 -7
- package/node_modules/table/node_modules/ajv/dist/compile/jtd/serialize.js.map +1 -1
- package/node_modules/table/node_modules/ajv/dist/compile/jtd/types.d.ts +2 -2
- package/node_modules/table/node_modules/ajv/dist/compile/resolve.d.ts +1 -1
- package/node_modules/table/node_modules/ajv/dist/compile/rules.d.ts +2 -2
- package/node_modules/table/node_modules/ajv/dist/compile/util.d.ts +2 -2
- package/node_modules/table/node_modules/ajv/dist/compile/validate/dataType.d.ts +1 -1
- package/node_modules/table/node_modules/ajv/dist/compile/validate/index.js +11 -1
- package/node_modules/table/node_modules/ajv/dist/compile/validate/index.js.map +1 -1
- package/node_modules/table/node_modules/ajv/dist/compile/validate/subschema.d.ts +1 -1
- package/node_modules/table/node_modules/ajv/dist/core.d.ts +3 -3
- package/node_modules/table/node_modules/ajv/dist/jtd.d.ts +1 -1
- package/node_modules/table/node_modules/ajv/dist/runtime/equal.d.ts +1 -1
- package/node_modules/table/node_modules/ajv/dist/runtime/re2.d.ts +1 -1
- package/node_modules/table/node_modules/ajv/dist/runtime/uri.d.ts +1 -1
- package/node_modules/table/node_modules/ajv/dist/types/index.d.ts +19 -19
- package/node_modules/table/node_modules/ajv/dist/types/json-schema.d.ts +14 -14
- package/node_modules/table/node_modules/ajv/dist/types/jtd-schema.d.ts +30 -25
- package/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/additionalItems.d.ts +1 -1
- package/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.d.ts +1 -1
- package/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/anyOf.d.ts +1 -1
- package/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/contains.d.ts +1 -1
- package/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/dependencies.d.ts +2 -2
- package/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/if.d.ts +1 -1
- package/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/index.d.ts +1 -1
- package/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/items2020.d.ts +1 -1
- package/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/not.d.ts +1 -1
- package/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/oneOf.d.ts +1 -1
- package/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/propertyNames.d.ts +1 -1
- package/node_modules/table/node_modules/ajv/dist/vocabularies/discriminator/index.d.ts +1 -1
- package/node_modules/table/node_modules/ajv/dist/vocabularies/discriminator/types.d.ts +1 -1
- package/node_modules/table/node_modules/ajv/dist/vocabularies/errors.d.ts +1 -1
- package/node_modules/table/node_modules/ajv/dist/vocabularies/format/format.d.ts +1 -1
- package/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/discriminator.d.ts +1 -1
- package/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/elements.d.ts +1 -1
- package/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/enum.d.ts +1 -1
- package/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/error.d.ts +1 -1
- package/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/index.d.ts +1 -1
- package/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/properties.d.ts +3 -3
- package/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/properties.js +8 -5
- package/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/properties.js.map +1 -1
- package/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/type.d.ts +3 -3
- package/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/values.d.ts +1 -1
- package/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/values.js +10 -7
- package/node_modules/table/node_modules/ajv/dist/vocabularies/jtd/values.js.map +1 -1
- package/node_modules/table/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedItems.d.ts +1 -1
- package/node_modules/table/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedProperties.d.ts +1 -1
- package/node_modules/table/node_modules/ajv/dist/vocabularies/validation/const.d.ts +1 -1
- package/node_modules/table/node_modules/ajv/dist/vocabularies/validation/dependentRequired.d.ts +1 -1
- package/node_modules/table/node_modules/ajv/dist/vocabularies/validation/enum.d.ts +1 -1
- package/node_modules/table/node_modules/ajv/dist/vocabularies/validation/index.d.ts +2 -2
- package/node_modules/table/node_modules/ajv/dist/vocabularies/validation/limitNumber.d.ts +3 -3
- package/node_modules/table/node_modules/ajv/dist/vocabularies/validation/multipleOf.d.ts +1 -1
- package/node_modules/table/node_modules/ajv/dist/vocabularies/validation/pattern.d.ts +1 -1
- package/node_modules/table/node_modules/ajv/dist/vocabularies/validation/required.d.ts +1 -1
- package/node_modules/table/node_modules/ajv/dist/vocabularies/validation/uniqueItems.d.ts +1 -1
- package/node_modules/table/node_modules/ajv/lib/compile/jtd/serialize.ts +20 -14
- package/node_modules/table/node_modules/ajv/lib/compile/validate/index.ts +10 -1
- package/node_modules/table/node_modules/ajv/lib/types/jtd-schema.ts +21 -11
- package/node_modules/table/node_modules/ajv/lib/vocabularies/jtd/properties.ts +13 -6
- package/node_modules/table/node_modules/ajv/lib/vocabularies/jtd/values.ts +10 -7
- package/node_modules/table/node_modules/ajv/package.json +5 -5
- package/package.json +3 -3
|
@@ -20,10 +20,10 @@ export interface SchemaObject extends _SchemaObject {
|
|
|
20
20
|
export interface AsyncSchema extends _SchemaObject {
|
|
21
21
|
$async: true;
|
|
22
22
|
}
|
|
23
|
-
export
|
|
24
|
-
export
|
|
25
|
-
export
|
|
26
|
-
export
|
|
23
|
+
export type AnySchemaObject = SchemaObject | AsyncSchema;
|
|
24
|
+
export type Schema = SchemaObject | boolean;
|
|
25
|
+
export type AnySchema = Schema | AsyncSchema;
|
|
26
|
+
export type SchemaMap = {
|
|
27
27
|
[Key in string]?: AnySchema;
|
|
28
28
|
};
|
|
29
29
|
export interface SourceCode {
|
|
@@ -56,10 +56,10 @@ export interface JTDParser<T = unknown> {
|
|
|
56
56
|
message?: string;
|
|
57
57
|
position?: number;
|
|
58
58
|
}
|
|
59
|
-
export
|
|
59
|
+
export type EvaluatedProperties = {
|
|
60
60
|
[K in string]?: true;
|
|
61
61
|
} | true;
|
|
62
|
-
export
|
|
62
|
+
export type EvaluatedItems = number | true;
|
|
63
63
|
export interface Evaluated {
|
|
64
64
|
props?: EvaluatedProperties;
|
|
65
65
|
items?: EvaluatedItems;
|
|
@@ -70,7 +70,7 @@ export interface AsyncValidateFunction<T = unknown> extends ValidateFunction<T>
|
|
|
70
70
|
(...args: Parameters<ValidateFunction<T>>): Promise<T>;
|
|
71
71
|
$async: true;
|
|
72
72
|
}
|
|
73
|
-
export
|
|
73
|
+
export type AnyValidateFunction<T = any> = ValidateFunction<T> | AsyncValidateFunction<T>;
|
|
74
74
|
export interface ErrorObject<K extends string = string, P = Record<string, any>, S = unknown> {
|
|
75
75
|
keyword: K;
|
|
76
76
|
instancePath: string;
|
|
@@ -82,7 +82,7 @@ export interface ErrorObject<K extends string = string, P = Record<string, any>,
|
|
|
82
82
|
parentSchema?: AnySchemaObject;
|
|
83
83
|
data?: unknown;
|
|
84
84
|
}
|
|
85
|
-
export
|
|
85
|
+
export type ErrorNoParams<K extends string, S = unknown> = ErrorObject<K, Record<string, never>, S>;
|
|
86
86
|
interface _KeywordDef {
|
|
87
87
|
keyword: string | string[];
|
|
88
88
|
type?: JSONType | JSONType[];
|
|
@@ -102,8 +102,8 @@ export interface CodeKeywordDefinition extends _KeywordDef {
|
|
|
102
102
|
code: (cxt: KeywordCxt, ruleType?: string) => void;
|
|
103
103
|
trackErrors?: boolean;
|
|
104
104
|
}
|
|
105
|
-
export
|
|
106
|
-
export
|
|
105
|
+
export type MacroKeywordFunc = (schema: any, parentSchema: AnySchemaObject, it: SchemaCxt) => AnySchema;
|
|
106
|
+
export type CompileKeywordFunc = (schema: any, parentSchema: AnySchemaObject, it: SchemaObjCxt) => DataValidateFunction;
|
|
107
107
|
export interface DataValidateFunction {
|
|
108
108
|
(...args: Parameters<ValidateFunction>): boolean | Promise<any>;
|
|
109
109
|
errors?: Partial<ErrorObject>[];
|
|
@@ -124,8 +124,8 @@ export interface FuncKeywordDefinition extends _KeywordDef {
|
|
|
124
124
|
export interface MacroKeywordDefinition extends FuncKeywordDefinition {
|
|
125
125
|
macro: MacroKeywordFunc;
|
|
126
126
|
}
|
|
127
|
-
export
|
|
128
|
-
export
|
|
127
|
+
export type KeywordDefinition = CodeKeywordDefinition | FuncKeywordDefinition | MacroKeywordDefinition;
|
|
128
|
+
export type AddedKeywordDefinition = KeywordDefinition & {
|
|
129
129
|
type: JSONType[];
|
|
130
130
|
schemaType: JSONType[];
|
|
131
131
|
};
|
|
@@ -133,7 +133,7 @@ export interface KeywordErrorDefinition {
|
|
|
133
133
|
message: string | Code | ((cxt: KeywordErrorCxt) => string | Code);
|
|
134
134
|
params?: Code | ((cxt: KeywordErrorCxt) => Code);
|
|
135
135
|
}
|
|
136
|
-
export
|
|
136
|
+
export type Vocabulary = (KeywordDefinition | string)[];
|
|
137
137
|
export interface KeywordErrorCxt {
|
|
138
138
|
gen: CodeGen;
|
|
139
139
|
keyword: string;
|
|
@@ -148,12 +148,12 @@ export interface KeywordErrorCxt {
|
|
|
148
148
|
params: KeywordCxtParams;
|
|
149
149
|
it: SchemaCxt;
|
|
150
150
|
}
|
|
151
|
-
export
|
|
151
|
+
export type KeywordCxtParams = {
|
|
152
152
|
[P in string]?: Code | string | number;
|
|
153
153
|
};
|
|
154
|
-
export
|
|
155
|
-
export
|
|
156
|
-
export
|
|
154
|
+
export type FormatValidator<T extends string | number> = (data: T) => boolean;
|
|
155
|
+
export type FormatCompare<T extends string | number> = (data1: T, data2: T) => number | undefined;
|
|
156
|
+
export type AsyncFormatValidator<T extends string | number> = (data: T) => Promise<boolean>;
|
|
157
157
|
export interface FormatDefinition<T extends string | number> {
|
|
158
158
|
type?: T extends string ? "string" | undefined : "number";
|
|
159
159
|
validate: FormatValidator<T> | (T extends string ? string | RegExp : never);
|
|
@@ -166,8 +166,8 @@ export interface AsyncFormatDefinition<T extends string | number> {
|
|
|
166
166
|
async: true;
|
|
167
167
|
compare?: FormatCompare<T>;
|
|
168
168
|
}
|
|
169
|
-
export
|
|
170
|
-
export
|
|
169
|
+
export type AddedFormat = true | RegExp | FormatValidator<string> | FormatDefinition<string> | FormatDefinition<number> | AsyncFormatDefinition<string> | AsyncFormatDefinition<number>;
|
|
170
|
+
export type Format = AddedFormat | string;
|
|
171
171
|
export interface RegExpEngine {
|
|
172
172
|
(pattern: string, u: string): RegExpLike;
|
|
173
173
|
code: string;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export
|
|
4
|
-
|
|
5
|
-
export
|
|
6
|
-
|
|
1
|
+
type StrictNullChecksWrapper<Name extends string, Type> = undefined extends null ? `strictNullChecks must be true in tsconfig to use ${Name}` : Type;
|
|
2
|
+
type UnionToIntersection<U> = (U extends any ? (_: U) => void : never) extends (_: infer I) => void ? I : never;
|
|
3
|
+
export type SomeJSONSchema = UncheckedJSONSchemaType<Known, true>;
|
|
4
|
+
type UncheckedPartialSchema<T> = Partial<UncheckedJSONSchemaType<T, true>>;
|
|
5
|
+
export type PartialSchema<T> = StrictNullChecksWrapper<"PartialSchema", UncheckedPartialSchema<T>>;
|
|
6
|
+
type JSONType<T extends string, IsPartial extends boolean> = IsPartial extends true ? T | undefined : T;
|
|
7
7
|
interface NumberKeywords {
|
|
8
8
|
minimum?: number;
|
|
9
9
|
maximum?: number;
|
|
@@ -18,7 +18,7 @@ interface StringKeywords {
|
|
|
18
18
|
pattern?: string;
|
|
19
19
|
format?: string;
|
|
20
20
|
}
|
|
21
|
-
|
|
21
|
+
type UncheckedJSONSchemaType<T, IsPartial extends boolean> = (// these two unions allow arbitrary unions of types
|
|
22
22
|
{
|
|
23
23
|
anyOf: readonly UncheckedJSONSchemaType<T, IsPartial>[];
|
|
24
24
|
} | {
|
|
@@ -97,21 +97,21 @@ declare type UncheckedJSONSchemaType<T, IsPartial extends boolean> = (// these t
|
|
|
97
97
|
$defs?: Record<string, UncheckedJSONSchemaType<Known, true>>;
|
|
98
98
|
definitions?: Record<string, UncheckedJSONSchemaType<Known, true>>;
|
|
99
99
|
};
|
|
100
|
-
export
|
|
101
|
-
|
|
100
|
+
export type JSONSchemaType<T> = StrictNullChecksWrapper<"JSONSchemaType", UncheckedJSONSchemaType<T, false>>;
|
|
101
|
+
type Known = {
|
|
102
102
|
[key: string]: Known;
|
|
103
103
|
} | [Known, ...Known[]] | Known[] | number | string | boolean | null;
|
|
104
|
-
|
|
104
|
+
type UncheckedPropertiesSchema<T> = {
|
|
105
105
|
[K in keyof T]-?: (UncheckedJSONSchemaType<T[K], false> & Nullable<T[K]>) | {
|
|
106
106
|
$ref: string;
|
|
107
107
|
};
|
|
108
108
|
};
|
|
109
|
-
export
|
|
110
|
-
|
|
109
|
+
export type PropertiesSchema<T> = StrictNullChecksWrapper<"PropertiesSchema", UncheckedPropertiesSchema<T>>;
|
|
110
|
+
type UncheckedRequiredMembers<T> = {
|
|
111
111
|
[K in keyof T]-?: undefined extends T[K] ? never : K;
|
|
112
112
|
}[keyof T];
|
|
113
|
-
export
|
|
114
|
-
|
|
113
|
+
export type RequiredMembers<T> = StrictNullChecksWrapper<"RequiredMembers", UncheckedRequiredMembers<T>>;
|
|
114
|
+
type Nullable<T> = undefined extends T ? {
|
|
115
115
|
nullable: true;
|
|
116
116
|
const?: null;
|
|
117
117
|
enum?: Readonly<(T | null)[]>;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/** numeric strings */
|
|
2
|
-
|
|
2
|
+
type NumberType = "float32" | "float64" | "int8" | "uint8" | "int16" | "uint16" | "int32" | "uint32";
|
|
3
3
|
/** string strings */
|
|
4
|
-
|
|
4
|
+
type StringType = "string" | "timestamp";
|
|
5
5
|
/** Generic JTD Schema without inference of the represented type */
|
|
6
|
-
export
|
|
6
|
+
export type SomeJTDSchemaType = (// ref
|
|
7
7
|
{
|
|
8
8
|
ref: string;
|
|
9
9
|
} | {
|
|
@@ -31,32 +31,34 @@ export declare type SomeJTDSchemaType = (// ref
|
|
|
31
31
|
definitions?: Record<string, SomeJTDSchemaType>;
|
|
32
32
|
};
|
|
33
33
|
/** required keys of an object, not undefined */
|
|
34
|
-
|
|
34
|
+
type RequiredKeys<T> = {
|
|
35
35
|
[K in keyof T]-?: undefined extends T[K] ? never : K;
|
|
36
36
|
}[keyof T];
|
|
37
37
|
/** optional or undifined-able keys of an object */
|
|
38
|
-
|
|
38
|
+
type OptionalKeys<T> = {
|
|
39
39
|
[K in keyof T]-?: undefined extends T[K] ? K : never;
|
|
40
40
|
}[keyof T];
|
|
41
41
|
/** type is true if T is a union type */
|
|
42
|
-
|
|
43
|
-
|
|
42
|
+
type IsUnion_<T, U extends T = T> = false extends (T extends unknown ? ([U] extends [T] ? false : true) : never) ? false : true;
|
|
43
|
+
type IsUnion<T> = IsUnion_<T>;
|
|
44
44
|
/** type is true if T is identically E */
|
|
45
|
-
|
|
45
|
+
type TypeEquality<T, E> = [T] extends [E] ? ([E] extends [T] ? true : false) : false;
|
|
46
46
|
/** type is true if T or null is identically E or null*/
|
|
47
|
-
|
|
47
|
+
type NullTypeEquality<T, E> = TypeEquality<T | null, E | null>;
|
|
48
48
|
/** gets only the string literals of a type or null if a type isn't a string literal */
|
|
49
|
-
|
|
49
|
+
type EnumString<T> = [T] extends [never] ? null : T extends string ? string extends T ? null : T : null;
|
|
50
50
|
/** true if type is a union of string literals */
|
|
51
|
-
|
|
51
|
+
type IsEnum<T> = null extends EnumString<T> ? false : true;
|
|
52
52
|
/** true only if all types are array types (not tuples) */
|
|
53
|
-
|
|
53
|
+
type IsElements<T> = false extends IsUnion<T> ? [T] extends [readonly unknown[]] ? undefined extends T[0.5] ? false : true : false : false;
|
|
54
54
|
/** true if the the type is a values type */
|
|
55
|
-
|
|
56
|
-
/** true if type is a
|
|
57
|
-
|
|
55
|
+
type IsValues<T> = false extends IsUnion<T> ? TypeEquality<keyof T, string> : false;
|
|
56
|
+
/** true if type is a properties type and Union is false, or type is a discriminator type and Union is true */
|
|
57
|
+
type IsRecord<T, Union extends boolean> = Union extends IsUnion<T> ? null extends EnumString<keyof T> ? false : true : false;
|
|
58
|
+
/** true if type represents an empty record */
|
|
59
|
+
type IsEmptyRecord<T> = [T] extends [Record<string, never>] ? [T] extends [never] ? false : true : false;
|
|
58
60
|
/** actual schema */
|
|
59
|
-
export
|
|
61
|
+
export type JTDSchemaType<T, D extends Record<string, unknown> = Record<string, never>> = (// refs - where null wasn't specified, must match exactly
|
|
60
62
|
(null extends EnumString<keyof D> ? never : ({
|
|
61
63
|
[K in keyof D]: [T] extends [D[K]] ? {
|
|
62
64
|
ref: K;
|
|
@@ -79,13 +81,18 @@ export declare type JTDSchemaType<T, D extends Record<string, unknown> = Record<
|
|
|
79
81
|
type: StringType;
|
|
80
82
|
} : true extends NullTypeEquality<T, Date> ? {
|
|
81
83
|
type: "timestamp";
|
|
82
|
-
} : true extends IsEnum<T
|
|
84
|
+
} : true extends IsEnum<Exclude<T, null>> ? {
|
|
83
85
|
enum: EnumString<Exclude<T, null>>[];
|
|
84
86
|
} : true extends IsElements<Exclude<T, null>> ? T extends readonly (infer E)[] ? {
|
|
85
87
|
elements: JTDSchemaType<E, D>;
|
|
86
|
-
} : never : true extends
|
|
88
|
+
} : never : true extends IsEmptyRecord<Exclude<T, null>> ? {
|
|
89
|
+
properties: Record<string, never>;
|
|
90
|
+
optionalProperties?: Record<string, never>;
|
|
91
|
+
} | {
|
|
92
|
+
optionalProperties: Record<string, never>;
|
|
93
|
+
} : true extends IsValues<Exclude<T, null>> ? T extends Record<string, infer V> ? {
|
|
87
94
|
values: JTDSchemaType<V, D>;
|
|
88
|
-
} : never : true extends IsRecord<T, false> ? ([RequiredKeys<Exclude<T, null>>] extends [never] ? {
|
|
95
|
+
} : never : true extends IsRecord<Exclude<T, null>, false> ? ([RequiredKeys<Exclude<T, null>>] extends [never] ? {
|
|
89
96
|
properties?: Record<string, never>;
|
|
90
97
|
} : {
|
|
91
98
|
properties: {
|
|
@@ -99,13 +106,11 @@ export declare type JTDSchemaType<T, D extends Record<string, unknown> = Record<
|
|
|
99
106
|
};
|
|
100
107
|
}) & {
|
|
101
108
|
additionalProperties?: boolean;
|
|
102
|
-
} : true extends IsRecord<T, true> ? {
|
|
109
|
+
} : true extends IsRecord<Exclude<T, null>, true> ? {
|
|
103
110
|
[K in keyof Exclude<T, null>]-?: Exclude<T, null>[K] extends string ? {
|
|
104
111
|
discriminator: K;
|
|
105
112
|
mapping: {
|
|
106
|
-
[M in Exclude<T, null>[K]]: JTDSchemaType<Omit<T extends
|
|
107
|
-
[C in K]: M;
|
|
108
|
-
} ? T : never, K>, D>;
|
|
113
|
+
[M in Exclude<T, null>[K]]: JTDSchemaType<Omit<T extends Record<K, M> ? T : never, K>, D>;
|
|
109
114
|
};
|
|
110
115
|
} : never;
|
|
111
116
|
}[keyof Exclude<T, null>] : never) & (null extends T ? {
|
|
@@ -118,7 +123,7 @@ export declare type JTDSchemaType<T, D extends Record<string, unknown> = Record<
|
|
|
118
123
|
[K in keyof D]: JTDSchemaType<D[K], D>;
|
|
119
124
|
};
|
|
120
125
|
};
|
|
121
|
-
|
|
126
|
+
type JTDDataDef<S, D extends Record<string, unknown>> = // ref
|
|
122
127
|
(S extends {
|
|
123
128
|
ref: string;
|
|
124
129
|
} ? D extends {
|
|
@@ -163,7 +168,7 @@ declare type JTDDataDef<S, D extends Record<string, unknown>> = // ref
|
|
|
163
168
|
}[keyof S["mapping"]] : never : unknown) | (S extends {
|
|
164
169
|
nullable: true;
|
|
165
170
|
} ? null : never);
|
|
166
|
-
export
|
|
171
|
+
export type JTDDataType<S> = S extends {
|
|
167
172
|
definitions: Record<string, unknown>;
|
|
168
173
|
} ? JTDDataDef<S, S["definitions"]> : JTDDataDef<S, Record<string, never>>;
|
|
169
174
|
export {};
|
package/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/additionalItems.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { CodeKeywordDefinition, ErrorObject, AnySchema } from "../../types";
|
|
2
2
|
import type { KeywordCxt } from "../../compile/validate";
|
|
3
|
-
export
|
|
3
|
+
export type AdditionalItemsError = ErrorObject<"additionalItems", {
|
|
4
4
|
limit: number;
|
|
5
5
|
}, AnySchema>;
|
|
6
6
|
declare const def: CodeKeywordDefinition;
|
package/node_modules/table/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { CodeKeywordDefinition, AddedKeywordDefinition, ErrorObject, AnySchema } from "../../types";
|
|
2
|
-
export
|
|
2
|
+
export type AdditionalPropertiesError = ErrorObject<"additionalProperties", {
|
|
3
3
|
additionalProperty: string;
|
|
4
4
|
}, AnySchema>;
|
|
5
5
|
declare const def: CodeKeywordDefinition & AddedKeywordDefinition;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { CodeKeywordDefinition, ErrorNoParams, AnySchema } from "../../types";
|
|
2
|
-
export
|
|
2
|
+
export type AnyOfError = ErrorNoParams<"anyOf", AnySchema[]>;
|
|
3
3
|
declare const def: CodeKeywordDefinition;
|
|
4
4
|
export default def;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { CodeKeywordDefinition, ErrorObject, KeywordErrorDefinition, SchemaMap, AnySchema } from "../../types";
|
|
2
2
|
import type { KeywordCxt } from "../../compile/validate";
|
|
3
|
-
export
|
|
3
|
+
export type PropertyDependencies = {
|
|
4
4
|
[K in string]?: string[];
|
|
5
5
|
};
|
|
6
6
|
export interface DependenciesErrorParams {
|
|
@@ -9,7 +9,7 @@ export interface DependenciesErrorParams {
|
|
|
9
9
|
depsCount: number;
|
|
10
10
|
deps: string;
|
|
11
11
|
}
|
|
12
|
-
export
|
|
12
|
+
export type DependenciesError = ErrorObject<"dependencies", DependenciesErrorParams, {
|
|
13
13
|
[K in string]?: string[] | AnySchema;
|
|
14
14
|
}>;
|
|
15
15
|
export declare const error: KeywordErrorDefinition;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { CodeKeywordDefinition, ErrorObject, AnySchema } from "../../types";
|
|
2
|
-
export
|
|
2
|
+
export type IfKeywordError = ErrorObject<"if", {
|
|
3
3
|
failingKeyword: string;
|
|
4
4
|
}, AnySchema>;
|
|
5
5
|
declare const def: CodeKeywordDefinition;
|
|
@@ -10,4 +10,4 @@ import { AnyOfError } from "./anyOf";
|
|
|
10
10
|
import { OneOfError } from "./oneOf";
|
|
11
11
|
import { IfKeywordError } from "./if";
|
|
12
12
|
export default function getApplicator(draft2020?: boolean): Vocabulary;
|
|
13
|
-
export
|
|
13
|
+
export type ApplicatorKeywordError = ErrorNoParams<"false schema"> | AdditionalItemsError | ItemsError | ContainsError | AdditionalPropertiesError | DependenciesError | IfKeywordError | AnyOfError | OneOfError | NotKeywordError | PropertyNamesError;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { CodeKeywordDefinition, ErrorNoParams, AnySchema } from "../../types";
|
|
2
|
-
export
|
|
2
|
+
export type NotKeywordError = ErrorNoParams<"not", AnySchema>;
|
|
3
3
|
declare const def: CodeKeywordDefinition;
|
|
4
4
|
export default def;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { CodeKeywordDefinition, ErrorObject, AnySchema } from "../../types";
|
|
2
|
-
export
|
|
2
|
+
export type OneOfError = ErrorObject<"oneOf", {
|
|
3
3
|
passingSchemas: [number, number] | null;
|
|
4
4
|
}, AnySchema[]>;
|
|
5
5
|
declare const def: CodeKeywordDefinition;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { CodeKeywordDefinition, ErrorObject, AnySchema } from "../../types";
|
|
2
|
-
export
|
|
2
|
+
export type PropertyNamesError = ErrorObject<"propertyNames", {
|
|
3
3
|
propertyName: string;
|
|
4
4
|
}, AnySchema>;
|
|
5
5
|
declare const def: CodeKeywordDefinition;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { CodeKeywordDefinition } from "../../types";
|
|
2
2
|
import { DiscrError, DiscrErrorObj } from "../discriminator/types";
|
|
3
|
-
export
|
|
3
|
+
export type DiscriminatorError = DiscrErrorObj<DiscrError.Tag> | DiscrErrorObj<DiscrError.Mapping>;
|
|
4
4
|
declare const def: CodeKeywordDefinition;
|
|
5
5
|
export default def;
|
|
@@ -3,7 +3,7 @@ export declare enum DiscrError {
|
|
|
3
3
|
Tag = "tag",
|
|
4
4
|
Mapping = "mapping"
|
|
5
5
|
}
|
|
6
|
-
export
|
|
6
|
+
export type DiscrErrorObj<E extends DiscrError> = ErrorObject<"discriminator", {
|
|
7
7
|
error: E;
|
|
8
8
|
tag: string;
|
|
9
9
|
tagValue: unknown;
|
|
@@ -6,4 +6,4 @@ import type { UnevaluatedPropertiesError } from "./unevaluated/unevaluatedProper
|
|
|
6
6
|
import type { UnevaluatedItemsError } from "./unevaluated/unevaluatedItems";
|
|
7
7
|
import type { DependentRequiredError } from "./validation/dependentRequired";
|
|
8
8
|
import type { DiscriminatorError } from "./discriminator";
|
|
9
|
-
export
|
|
9
|
+
export type DefinedError = TypeError | ApplicatorKeywordError | ValidationKeywordError | FormatError | UnevaluatedPropertiesError | UnevaluatedItemsError | DependentRequiredError | DiscriminatorError;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { CodeKeywordDefinition } from "../../types";
|
|
2
2
|
import { _JTDTypeError } from "./error";
|
|
3
3
|
import { DiscrError, DiscrErrorObj } from "../discriminator/types";
|
|
4
|
-
export
|
|
4
|
+
export type JTDDiscriminatorError = _JTDTypeError<"discriminator", "object", string> | DiscrErrorObj<DiscrError.Tag> | DiscrErrorObj<DiscrError.Mapping>;
|
|
5
5
|
declare const def: CodeKeywordDefinition;
|
|
6
6
|
export default def;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { CodeKeywordDefinition, SchemaObject } from "../../types";
|
|
2
2
|
import { _JTDTypeError } from "./error";
|
|
3
|
-
export
|
|
3
|
+
export type JTDElementsError = _JTDTypeError<"elements", "array", SchemaObject>;
|
|
4
4
|
declare const def: CodeKeywordDefinition;
|
|
5
5
|
export default def;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { KeywordErrorDefinition, KeywordErrorCxt, ErrorObject } from "../../types";
|
|
2
2
|
import { Code } from "../../compile/codegen";
|
|
3
|
-
export
|
|
3
|
+
export type _JTDTypeError<K extends string, T extends string, S> = ErrorObject<K, {
|
|
4
4
|
type: T;
|
|
5
5
|
nullable: boolean;
|
|
6
6
|
}, S>;
|
|
@@ -7,4 +7,4 @@ import { JTDDiscriminatorError } from "./discriminator";
|
|
|
7
7
|
import { JTDValuesError } from "./values";
|
|
8
8
|
declare const jtdVocabulary: Vocabulary;
|
|
9
9
|
export default jtdVocabulary;
|
|
10
|
-
export
|
|
10
|
+
export type JTDErrorObject = JTDTypeError | JTDEnumError | JTDElementsError | JTDPropertiesError | JTDDiscriminatorError | JTDValuesError;
|
|
@@ -5,11 +5,11 @@ declare enum PropError {
|
|
|
5
5
|
Additional = "additional",
|
|
6
6
|
Missing = "missing"
|
|
7
7
|
}
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
type PropKeyword = "properties" | "optionalProperties";
|
|
9
|
+
type PropSchema = {
|
|
10
10
|
[P in string]?: SchemaObject;
|
|
11
11
|
};
|
|
12
|
-
export
|
|
12
|
+
export type JTDPropertiesError = _JTDTypeError<PropKeyword, "object", PropSchema> | ErrorObject<PropKeyword, {
|
|
13
13
|
error: PropError.Additional;
|
|
14
14
|
additionalProperty: string;
|
|
15
15
|
}, PropSchema> | ErrorObject<PropKeyword, {
|
|
@@ -109,8 +109,7 @@ function validateProperties(cxt) {
|
|
|
109
109
|
}
|
|
110
110
|
function validateAdditional() {
|
|
111
111
|
gen.forIn("key", data, (key) => {
|
|
112
|
-
const
|
|
113
|
-
const addProp = isAdditional(key, _allProps, "properties");
|
|
112
|
+
const addProp = isAdditional(key, allProps, "properties", it.jtdDiscriminator);
|
|
114
113
|
const addOptProp = isAdditional(key, allOptProps, "optionalProperties");
|
|
115
114
|
const extra = addProp === true ? addOptProp : addOptProp === true ? addProp : (0, codegen_1.and)(addProp, addOptProp);
|
|
116
115
|
gen.if(extra, () => {
|
|
@@ -125,15 +124,19 @@ function validateProperties(cxt) {
|
|
|
125
124
|
});
|
|
126
125
|
});
|
|
127
126
|
}
|
|
128
|
-
function isAdditional(key, props, keyword) {
|
|
127
|
+
function isAdditional(key, props, keyword, jtdDiscriminator) {
|
|
129
128
|
let additional;
|
|
130
129
|
if (props.length > 8) {
|
|
131
130
|
// TODO maybe an option instead of hard-coded 8?
|
|
132
131
|
const propsSchema = (0, util_1.schemaRefOrVal)(it, parentSchema[keyword], keyword);
|
|
133
132
|
additional = (0, codegen_1.not)((0, code_1.isOwnProperty)(gen, propsSchema, key));
|
|
133
|
+
if (jtdDiscriminator !== undefined) {
|
|
134
|
+
additional = (0, codegen_1.and)(additional, (0, codegen_1._) `${key} !== ${jtdDiscriminator}`);
|
|
135
|
+
}
|
|
134
136
|
}
|
|
135
|
-
else if (props.length) {
|
|
136
|
-
|
|
137
|
+
else if (props.length || jtdDiscriminator !== undefined) {
|
|
138
|
+
const ps = jtdDiscriminator === undefined ? props : [jtdDiscriminator].concat(props);
|
|
139
|
+
additional = (0, codegen_1.and)(...ps.map((p) => (0, codegen_1._) `${key} !== ${p}`));
|
|
137
140
|
}
|
|
138
141
|
else {
|
|
139
142
|
additional = true;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"properties.js","sourceRoot":"","sources":["../../../lib/vocabularies/jtd/properties.ts"],"names":[],"mappings":";;;AAOA,kCAA0E;AAC1E,6CAAoE;AACpE,mDAA6D;AAC7D,yCAAwC;AACxC,yCAA8C;AAC9C,mCAAwE;AAExE,IAAK,SAGJ;AAHD,WAAK,SAAS;IACZ,sCAAyB,CAAA;IACzB,gCAAmB,CAAA;AACrB,CAAC,EAHI,SAAS,KAAT,SAAS,QAGb;AAWY,QAAA,KAAK,GAA2B;IAC3C,OAAO,EAAE,CAAC,GAAG,EAAE,EAAE;QACf,MAAM,EAAC,MAAM,EAAC,GAAG,GAAG,CAAA;QACpB,OAAO,MAAM,CAAC,SAAS;YACrB,CAAC,CAAC,MAAM,CAAC,SAAS,KAAK,SAAS,CAAC,UAAU;gBACzC,CAAC,CAAC,qCAAqC;gBACvC,CAAC,CAAC,uBAAuB,MAAM,CAAC,eAAe,GAAG;YACpD,CAAC,CAAC,IAAA,wBAAgB,EAAC,GAAG,EAAE,QAAQ,CAAC,CAAA;IACrC,CAAC;IACD,MAAM,EAAE,CAAC,GAAG,EAAE,EAAE;QACd,MAAM,EAAC,MAAM,EAAC,GAAG,GAAG,CAAA;QACpB,OAAO,MAAM,CAAC,SAAS;YACrB,CAAC,CAAC,MAAM,CAAC,SAAS,KA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AAY,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,CAAA;YACtE,UAAU,GAAG,IAAA,aAAG,EAAC,IAAA,oBAAa,EAAC,GAAG,EAAE,WAAmB,EAAE,GAAG,CAAC,CAAC,CAAA;YAC9D,IAAI,gBAAgB,KAAK,SAAS,EAAE;gBAClC,UAAU,GAAG,IAAA,aAAG,EAAC,UAAU,EAAE,IAAA,WAAC,EAAA,GAAG,GAAG,QAAQ,gBAAgB,EAAE,CAAC,CAAA;aAChE;SACF;aAAM,IAAI,KAAK,CAAC,MAAM,IAAI,gBAAgB,KAAK,SAAS,EAAE;YACzD,MAAM,EAAE,GAAG,gBAAgB,KAAK,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;YACpF,UAAU,GAAG,IAAA,aAAG,EAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAA,WAAC,EAAA,GAAG,GAAG,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAA;SACvD;aAAM;YACL,UAAU,GAAG,IAAI,CAAA;SAClB;QACD,OAAO,UAAU,CAAA;IACnB,CAAC;AACH,CAAC;AA1HD,gDA0HC;AAED,kBAAe,GAAG,CAAA"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { CodeKeywordDefinition } from "../../types";
|
|
2
2
|
import { _JTDTypeError } from "./error";
|
|
3
|
-
export
|
|
4
|
-
export
|
|
3
|
+
export type JTDTypeError = _JTDTypeError<"type", JTDType, JTDType>;
|
|
4
|
+
export type IntType = "int8" | "uint8" | "int16" | "uint16" | "int32" | "uint32";
|
|
5
5
|
export declare const intRange: {
|
|
6
6
|
[T in IntType]: [number, number, number];
|
|
7
7
|
};
|
|
8
|
-
export
|
|
8
|
+
export type JTDType = "boolean" | "string" | "timestamp" | "float32" | "float64" | IntType;
|
|
9
9
|
declare const def: CodeKeywordDefinition;
|
|
10
10
|
export default def;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { CodeKeywordDefinition, SchemaObject } from "../../types";
|
|
2
2
|
import { _JTDTypeError } from "./error";
|
|
3
|
-
export
|
|
3
|
+
export type JTDValuesError = _JTDTypeError<"values", "object", SchemaObject>;
|
|
4
4
|
declare const def: CodeKeywordDefinition;
|
|
5
5
|
export default def;
|
|
@@ -12,14 +12,17 @@ const def = {
|
|
|
12
12
|
code(cxt) {
|
|
13
13
|
(0, metadata_1.checkMetadata)(cxt);
|
|
14
14
|
const { gen, data, schema, it } = cxt;
|
|
15
|
-
if ((0, util_1.alwaysValidSchema)(it, schema))
|
|
16
|
-
return;
|
|
17
15
|
const [valid, cond] = (0, nullable_1.checkNullableObject)(cxt, data);
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
16
|
+
if ((0, util_1.alwaysValidSchema)(it, schema)) {
|
|
17
|
+
gen.if((0, codegen_1.not)((0, codegen_1.or)(cond, valid)), () => cxt.error());
|
|
18
|
+
}
|
|
19
|
+
else {
|
|
20
|
+
gen.if(cond);
|
|
21
|
+
gen.assign(valid, validateMap());
|
|
22
|
+
gen.elseIf((0, codegen_1.not)(valid));
|
|
23
|
+
cxt.error();
|
|
24
|
+
gen.endIf();
|
|
25
|
+
}
|
|
23
26
|
cxt.ok(valid);
|
|
24
27
|
function validateMap() {
|
|
25
28
|
const _valid = gen.name("valid");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"values.js","sourceRoot":"","sources":["../../../lib/vocabularies/jtd/values.ts"],"names":[],"mappings":";;AAEA,6CAA0D;AAC1D,
|
|
1
|
+
{"version":3,"file":"values.js","sourceRoot":"","sources":["../../../lib/vocabularies/jtd/values.ts"],"names":[],"mappings":";;AAEA,6CAA0D;AAC1D,mDAAmD;AACnD,yCAAwC;AACxC,yCAA8C;AAC9C,mCAAgD;AAIhD,MAAM,GAAG,GAA0B;IACjC,O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