@picked/analytics 0.0.0-main.250121051314-d7736d6
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/README.md +19 -0
- package/dist/index.cjs +1528 -0
- package/dist/index.d.cts +1956 -0
- package/dist/index.d.ts +1956 -0
- package/dist/index.js +1485 -0
- package/package.json +50 -0
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,1956 @@
|
|
|
1
|
+
import * as _snowplow_browser_tracker from '@snowplow/browser-tracker';
|
|
2
|
+
import { SelfDescribingEvent, CommonEventProperties, ActivityCallbackData } from '@snowplow/browser-tracker';
|
|
3
|
+
|
|
4
|
+
declare type And$1<BOOL_A, BOOL_B> = BOOL_A extends true ? BOOL_B extends true ? true : false : false;
|
|
5
|
+
|
|
6
|
+
declare type DoesExtend$1<TYPE_A, TYPE_B> = [TYPE_A] extends [TYPE_B] ? true : false;
|
|
7
|
+
declare type ArrayKeys = keyof [];
|
|
8
|
+
declare type IsObject<TYPE> = TYPE extends object ? ArrayKeys extends Extract<keyof TYPE, ArrayKeys> ? false : true : false;
|
|
9
|
+
declare type IsArray<TYPE> = TYPE extends object ? ArrayKeys extends Extract<keyof TYPE, ArrayKeys> ? true : false : false;
|
|
10
|
+
|
|
11
|
+
declare type If<CONDITION extends boolean, THEN, ELSE = never> = CONDITION extends true ? THEN : ELSE;
|
|
12
|
+
|
|
13
|
+
declare type IntersectUnion$1<UNION> = (UNION extends unknown ? (arg: UNION) => void : never) extends (arg: infer INTERSECTION) => void ? INTERSECTION : never;
|
|
14
|
+
|
|
15
|
+
declare type IsNever<TYPE> = [TYPE] extends [never] ? true : false;
|
|
16
|
+
|
|
17
|
+
declare type DeepMergeUnsafe<TYPE_A, TYPE_B> = IsObject<TYPE_A> extends true ? IsObject<TYPE_B> extends true ? {
|
|
18
|
+
[KEY in keyof (TYPE_A & TYPE_B)]: KEY extends keyof TYPE_B ? KEY extends keyof TYPE_A ? DeepMergeUnsafe<TYPE_A[KEY], TYPE_B[KEY]> : TYPE_B[KEY] : KEY extends keyof TYPE_A ? TYPE_A[KEY] : never;
|
|
19
|
+
} : TYPE_B : IsArray<TYPE_A> extends true ? IsArray<TYPE_B> extends true ? TYPE_B extends unknown[] ? [
|
|
20
|
+
...(TYPE_A extends unknown[] ? TYPE_A : never),
|
|
21
|
+
TYPE_B
|
|
22
|
+
] : never : TYPE_B : TYPE_B;
|
|
23
|
+
|
|
24
|
+
declare type Not$1<BOOL extends boolean> = BOOL extends false ? true : BOOL extends true ? false : never;
|
|
25
|
+
|
|
26
|
+
declare type Or<BOOL_A extends boolean, BOOL_B extends boolean> = BOOL_A extends true ? true : BOOL_B extends true ? true : false;
|
|
27
|
+
|
|
28
|
+
declare type Prettify<TYPE> = IsObject<TYPE> extends true ? {
|
|
29
|
+
[KEY in keyof TYPE]: KEY extends keyof TYPE ? TYPE[KEY] : never;
|
|
30
|
+
} : TYPE;
|
|
31
|
+
|
|
32
|
+
declare type Tail$1<ARRAY extends unknown[]> = ARRAY extends readonly [] ? ARRAY : ARRAY extends readonly [unknown?, ...infer TAIL] ? TAIL : ARRAY;
|
|
33
|
+
|
|
34
|
+
declare type UnionLast<UNION> = IntersectUnion$1<UNION extends unknown ? (x: UNION) => void : never> extends (x: infer LAST) => void ? LAST : never;
|
|
35
|
+
|
|
36
|
+
declare type UnionPop<UNION> = Exclude<UNION, UnionLast<UNION>>;
|
|
37
|
+
|
|
38
|
+
declare type NeverTypeId = "never";
|
|
39
|
+
declare type Never = {
|
|
40
|
+
type: NeverTypeId;
|
|
41
|
+
};
|
|
42
|
+
declare type NeverType = Never;
|
|
43
|
+
declare type ResolveNever = never;
|
|
44
|
+
|
|
45
|
+
declare type IsSerialized<SERIALIZABLE_META_TYPE extends SerializableType> = SERIALIZABLE_META_TYPE["isSerialized"];
|
|
46
|
+
declare type Deserialized<SERIALIZABLE_META_TYPE extends SerializableType> = SERIALIZABLE_META_TYPE["deserialized"];
|
|
47
|
+
|
|
48
|
+
declare type ConstTypeId = "const";
|
|
49
|
+
declare type Const<VALUE, IS_SERIALIZED extends boolean = false, DESERIALIZED = never> = If<IsNever<VALUE>, Never, {
|
|
50
|
+
type: ConstTypeId;
|
|
51
|
+
value: VALUE;
|
|
52
|
+
isSerialized: IS_SERIALIZED;
|
|
53
|
+
deserialized: DESERIALIZED;
|
|
54
|
+
}>;
|
|
55
|
+
declare type ConstType = {
|
|
56
|
+
type: ConstTypeId;
|
|
57
|
+
value: unknown;
|
|
58
|
+
isSerialized: boolean;
|
|
59
|
+
deserialized: unknown;
|
|
60
|
+
};
|
|
61
|
+
declare type ConstValue<META_CONST extends ConstType> = META_CONST["value"];
|
|
62
|
+
declare type ResolveConst<META_CONST extends ConstType, OPTIONS extends ResolveOptions> = If<And$1<OPTIONS["deserialize"], IsSerialized<META_CONST>>, Deserialized<META_CONST>, ConstValue<META_CONST>>;
|
|
63
|
+
|
|
64
|
+
declare type EnumTypeId = "enum";
|
|
65
|
+
declare type Enum<VALUES, IS_SERIALIZED extends boolean = false, DESERIALIZED = never> = If<IsNever<VALUES>, Never, {
|
|
66
|
+
type: EnumTypeId;
|
|
67
|
+
values: VALUES;
|
|
68
|
+
isSerialized: IS_SERIALIZED;
|
|
69
|
+
deserialized: DESERIALIZED;
|
|
70
|
+
}>;
|
|
71
|
+
declare type EnumType = {
|
|
72
|
+
type: EnumTypeId;
|
|
73
|
+
values: unknown;
|
|
74
|
+
isSerialized: boolean;
|
|
75
|
+
deserialized: unknown;
|
|
76
|
+
};
|
|
77
|
+
declare type EnumValues<META_ENUM extends EnumType> = META_ENUM["values"];
|
|
78
|
+
declare type ResolveEnum<META_ENUM extends EnumType, OPTIONS extends ResolveOptions> = If<And$1<OPTIONS["deserialize"], IsSerialized<META_ENUM>>, Deserialized<META_ENUM>, EnumValues<META_ENUM>>;
|
|
79
|
+
|
|
80
|
+
declare type ObjectTypeId = "object";
|
|
81
|
+
declare type _Object<VALUES extends Record<string, Type> = {}, REQUIRED_KEYS extends string = never, OPEN_PROPS extends Type = Never, CLOSE_ON_RESOLVE extends boolean = false, IS_SERIALIZED extends boolean = false, DESERIALIZED = never> = _$Object<VALUES, REQUIRED_KEYS, OPEN_PROPS, CLOSE_ON_RESOLVE, IS_SERIALIZED, DESERIALIZED>;
|
|
82
|
+
declare type _$Object<VALUES = {}, REQUIRED_KEYS = never, OPEN_PROPS = Never, CLOSE_ON_RESOLVE = false, IS_SERIALIZED = false, DESERIALIZED = never> = DoesExtend$1<true, {
|
|
83
|
+
[KEY in Extract<REQUIRED_KEYS, string>]: KEY extends keyof VALUES ? DoesExtend$1<VALUES[KEY], NeverType> : DoesExtend$1<OPEN_PROPS, NeverType>;
|
|
84
|
+
}[Extract<REQUIRED_KEYS, string>]> extends true ? Never : {
|
|
85
|
+
type: ObjectTypeId;
|
|
86
|
+
values: VALUES;
|
|
87
|
+
required: REQUIRED_KEYS;
|
|
88
|
+
isOpen: Not$1<DoesExtend$1<OPEN_PROPS, NeverType>>;
|
|
89
|
+
openProps: OPEN_PROPS;
|
|
90
|
+
closeOnResolve: CLOSE_ON_RESOLVE;
|
|
91
|
+
isSerialized: IS_SERIALIZED;
|
|
92
|
+
deserialized: DESERIALIZED;
|
|
93
|
+
};
|
|
94
|
+
declare type ObjectType = {
|
|
95
|
+
type: ObjectTypeId;
|
|
96
|
+
values: Record<string, Type>;
|
|
97
|
+
required: string;
|
|
98
|
+
isOpen: boolean;
|
|
99
|
+
openProps: Type;
|
|
100
|
+
closeOnResolve: boolean;
|
|
101
|
+
isSerialized: boolean;
|
|
102
|
+
deserialized: unknown;
|
|
103
|
+
};
|
|
104
|
+
declare type ObjectValues<META_OBJECT extends ObjectType> = META_OBJECT["values"];
|
|
105
|
+
declare type ObjectValue<META_OBJECT extends ObjectType, KEY extends string> = KEY extends keyof ObjectValues<META_OBJECT> ? ObjectValues<META_OBJECT>[KEY] : IsObjectOpen<META_OBJECT> extends true ? ObjectOpenProps<META_OBJECT> : Never;
|
|
106
|
+
declare type ObjectRequiredKeys<META_OBJECT extends ObjectType> = META_OBJECT["required"];
|
|
107
|
+
declare type IsObjectOpen<META_OBJECT extends ObjectType> = META_OBJECT["isOpen"];
|
|
108
|
+
declare type ObjectOpenProps<META_OBJECT extends ObjectType> = META_OBJECT["openProps"];
|
|
109
|
+
declare type IsObjectClosedOnResolve<META_OBJECT extends ObjectType> = META_OBJECT["closeOnResolve"];
|
|
110
|
+
declare type IsObjectEmpty<META_OBJECT extends ObjectType> = IsNever<keyof ObjectValues<META_OBJECT>>;
|
|
111
|
+
declare type ResolveObject<META_OBJECT extends ObjectType, OPTIONS extends ResolveOptions> = If<And$1<OPTIONS["deserialize"], IsSerialized<META_OBJECT>>, Deserialized<META_OBJECT>, DeepMergeUnsafe<If<And$1<IsObjectOpen<META_OBJECT>, Not$1<IsObjectClosedOnResolve<META_OBJECT>>>, If<IsObjectEmpty<META_OBJECT>, {
|
|
112
|
+
[KEY: string]: Resolve<ObjectOpenProps<META_OBJECT>, OPTIONS>;
|
|
113
|
+
}, {
|
|
114
|
+
[KEY: string]: Resolve<Any, OPTIONS>;
|
|
115
|
+
}>, {}>, DeepMergeUnsafe<{
|
|
116
|
+
[KEY in Exclude<keyof ObjectValues<META_OBJECT>, ObjectRequiredKeys<META_OBJECT>>]?: Resolve<ObjectValues<META_OBJECT>[KEY], OPTIONS>;
|
|
117
|
+
}, {
|
|
118
|
+
[KEY in ObjectRequiredKeys<META_OBJECT>]: KEY extends keyof ObjectValues<META_OBJECT> ? Resolve<ObjectValues<META_OBJECT>[KEY], OPTIONS> : Resolve<Any, OPTIONS>;
|
|
119
|
+
}>>>;
|
|
120
|
+
|
|
121
|
+
declare type PrimitiveTypeId = "primitive";
|
|
122
|
+
declare type Primitive<VALUE extends null | boolean | number | string, IS_SERIALIZED extends boolean = false, DESERIALIZED = never> = $Primitive<VALUE, IS_SERIALIZED, DESERIALIZED>;
|
|
123
|
+
declare type $Primitive<VALUE, IS_SERIALIZED = false, DESERIALIZED = never> = If<IsNever<VALUE>, Never, {
|
|
124
|
+
type: PrimitiveTypeId;
|
|
125
|
+
value: VALUE;
|
|
126
|
+
isSerialized: IS_SERIALIZED;
|
|
127
|
+
deserialized: DESERIALIZED;
|
|
128
|
+
}>;
|
|
129
|
+
declare type PrimitiveType = {
|
|
130
|
+
type: PrimitiveTypeId;
|
|
131
|
+
value: null | boolean | number | string;
|
|
132
|
+
isSerialized: boolean;
|
|
133
|
+
deserialized: unknown;
|
|
134
|
+
};
|
|
135
|
+
declare type PrimitiveValue<META_PRIMITIVE extends PrimitiveType> = META_PRIMITIVE["value"];
|
|
136
|
+
declare type ResolvePrimitive<META_PRIMITIVE extends PrimitiveType, OPTIONS extends ResolveOptions> = If<And$1<OPTIONS["deserialize"], IsSerialized<META_PRIMITIVE>>, Deserialized<META_PRIMITIVE>, PrimitiveValue<META_PRIMITIVE>>;
|
|
137
|
+
|
|
138
|
+
declare type TupleTypeId = "tuple";
|
|
139
|
+
declare type Tuple<VALUES extends Type[], OPEN_PROPS extends Type = Never, IS_SERIALIZED extends boolean = false, DESERIALIZED = never> = $Tuple<VALUES, OPEN_PROPS, IS_SERIALIZED, DESERIALIZED>;
|
|
140
|
+
declare type $Tuple<VALUES, OPEN_PROPS = Never, IS_SERIALIZED = false, DESERIALIZED = never> = IsAnyValueNever<VALUES> extends true ? Never : {
|
|
141
|
+
type: TupleTypeId;
|
|
142
|
+
values: VALUES;
|
|
143
|
+
isOpen: Not$1<DoesExtend$1<OPEN_PROPS, NeverType>>;
|
|
144
|
+
openProps: OPEN_PROPS;
|
|
145
|
+
isSerialized: IS_SERIALIZED;
|
|
146
|
+
deserialized: DESERIALIZED;
|
|
147
|
+
};
|
|
148
|
+
declare type IsAnyValueNever<TUPLE> = TUPLE extends [
|
|
149
|
+
infer TUPLE_HEAD,
|
|
150
|
+
...infer TUPLE_TAIL
|
|
151
|
+
] ? TUPLE_HEAD extends NeverType ? true : IsAnyValueNever<TUPLE_TAIL> : false;
|
|
152
|
+
declare type TupleType = {
|
|
153
|
+
type: TupleTypeId;
|
|
154
|
+
values: Type[];
|
|
155
|
+
isOpen: boolean;
|
|
156
|
+
openProps: Type;
|
|
157
|
+
isSerialized: boolean;
|
|
158
|
+
deserialized: unknown;
|
|
159
|
+
};
|
|
160
|
+
declare type TupleValues<META_TUPLE extends TupleType> = META_TUPLE["values"];
|
|
161
|
+
declare type IsTupleOpen<META_TUPLE extends TupleType> = META_TUPLE["isOpen"];
|
|
162
|
+
declare type TupleOpenProps<META_TUPLE extends TupleType> = META_TUPLE["openProps"];
|
|
163
|
+
declare type ResolveTuple<META_TUPLE extends TupleType, OPTIONS extends ResolveOptions> = If<And$1<OPTIONS["deserialize"], IsSerialized<META_TUPLE>>, Deserialized<META_TUPLE>, If<IsTupleOpen<META_TUPLE>, [
|
|
164
|
+
...RecurseOnTuple<TupleValues<META_TUPLE>, OPTIONS>,
|
|
165
|
+
...Resolve<TupleOpenProps<META_TUPLE>, OPTIONS>[]
|
|
166
|
+
], RecurseOnTuple<TupleValues<META_TUPLE>, OPTIONS>>>;
|
|
167
|
+
declare type RecurseOnTuple<VALUES extends Type[], OPTIONS extends ResolveOptions, RESULT extends unknown[] = []> = VALUES extends [infer VALUES_HEAD, ...infer VALUES_TAIL] ? VALUES_HEAD extends Type ? VALUES_TAIL extends Type[] ? RecurseOnTuple<VALUES_TAIL, OPTIONS, [
|
|
168
|
+
...RESULT,
|
|
169
|
+
Resolve<VALUES_HEAD, OPTIONS>
|
|
170
|
+
]> : never : never : RESULT;
|
|
171
|
+
|
|
172
|
+
declare type UnionTypeId = "union";
|
|
173
|
+
declare type Union<VALUES extends Type> = $Union<VALUES>;
|
|
174
|
+
declare type $Union<VALUES> = If<IsNever<VALUES>, Never, DoesExtend$1<VALUES, NeverType> extends true ? Never : {
|
|
175
|
+
type: UnionTypeId;
|
|
176
|
+
values: VALUES;
|
|
177
|
+
}>;
|
|
178
|
+
declare type UnionType = {
|
|
179
|
+
type: UnionTypeId;
|
|
180
|
+
values: Type;
|
|
181
|
+
};
|
|
182
|
+
declare type UnionValues<META_UNION extends UnionType> = META_UNION["values"];
|
|
183
|
+
declare type ResolveUnion<META_UNION extends UnionType, OPTIONS extends ResolveOptions> = RecurseOnUnion<UnionValues<META_UNION>, OPTIONS>;
|
|
184
|
+
declare type RecurseOnUnion<VALUES extends Type, OPTIONS extends ResolveOptions> = VALUES extends infer META_TYPE ? $Resolve<META_TYPE, OPTIONS> : never;
|
|
185
|
+
|
|
186
|
+
declare type Type = NeverType | AnyType | ConstType | EnumType | PrimitiveType | ArrayType | TupleType | ObjectType | UnionType;
|
|
187
|
+
declare type SerializableType = Type extends infer META_TYPE ? META_TYPE extends {
|
|
188
|
+
isSerialized: boolean;
|
|
189
|
+
deserialized: unknown;
|
|
190
|
+
} ? META_TYPE : never : never;
|
|
191
|
+
|
|
192
|
+
declare type ArrayTypeId = "array";
|
|
193
|
+
declare type _Array<VALUES extends Type = Any, IS_SERIALIZED extends boolean = false, DESERIALIZED = never> = _$Array<VALUES, IS_SERIALIZED, DESERIALIZED>;
|
|
194
|
+
declare type _$Array<VALUES = Any, IS_SERIALIZED = false, DESERIALIZED = never> = {
|
|
195
|
+
type: ArrayTypeId;
|
|
196
|
+
values: VALUES;
|
|
197
|
+
isSerialized: IS_SERIALIZED;
|
|
198
|
+
deserialized: DESERIALIZED;
|
|
199
|
+
};
|
|
200
|
+
declare type ArrayType = {
|
|
201
|
+
type: ArrayTypeId;
|
|
202
|
+
values: Type;
|
|
203
|
+
isSerialized: boolean;
|
|
204
|
+
deserialized: unknown;
|
|
205
|
+
};
|
|
206
|
+
declare type ArrayValues<META_ARRAY extends ArrayType> = META_ARRAY["values"];
|
|
207
|
+
declare type ResolveArray<META_ARRAY extends ArrayType, OPTIONS extends ResolveOptions> = If<And$1<OPTIONS["deserialize"], IsSerialized<META_ARRAY>>, Deserialized<META_ARRAY>, ArrayValues<META_ARRAY> extends NeverType ? [] : Prettify<Resolve<ArrayValues<META_ARRAY>, OPTIONS>[]>>;
|
|
208
|
+
|
|
209
|
+
declare type ResolveOptions = {
|
|
210
|
+
deserialize: boolean;
|
|
211
|
+
};
|
|
212
|
+
declare type ResolveDefaultOptions = {
|
|
213
|
+
deserialize: true;
|
|
214
|
+
};
|
|
215
|
+
declare type Resolve<META_TYPE extends Type, OPTIONS extends ResolveOptions = ResolveDefaultOptions> = $Resolve<META_TYPE, OPTIONS>;
|
|
216
|
+
declare type $Resolve<META_TYPE, OPTIONS extends ResolveOptions = ResolveDefaultOptions> = META_TYPE extends AnyType ? ResolveAny<META_TYPE, OPTIONS> : META_TYPE extends NeverType ? ResolveNever : META_TYPE extends ConstType ? ResolveConst<META_TYPE, OPTIONS> : META_TYPE extends EnumType ? ResolveEnum<META_TYPE, OPTIONS> : META_TYPE extends PrimitiveType ? ResolvePrimitive<META_TYPE, OPTIONS> : META_TYPE extends ArrayType ? ResolveArray<META_TYPE, OPTIONS> : META_TYPE extends TupleType ? ResolveTuple<META_TYPE, OPTIONS> : META_TYPE extends ObjectType ? ResolveObject<META_TYPE, OPTIONS> : META_TYPE extends UnionType ? ResolveUnion<META_TYPE, OPTIONS> : never;
|
|
217
|
+
|
|
218
|
+
declare type AnyTypeId = "any";
|
|
219
|
+
declare type Any<IS_SERIALIZED extends boolean = false, DESERIALIZED = never> = {
|
|
220
|
+
type: AnyTypeId;
|
|
221
|
+
isSerialized: IS_SERIALIZED;
|
|
222
|
+
deserialized: DESERIALIZED;
|
|
223
|
+
};
|
|
224
|
+
declare type AnyType = {
|
|
225
|
+
type: AnyTypeId;
|
|
226
|
+
isSerialized: boolean;
|
|
227
|
+
deserialized: unknown;
|
|
228
|
+
};
|
|
229
|
+
declare type ResolveAny<META_ANY extends AnyType, OPTIONS extends ResolveOptions> = If<And$1<OPTIONS["deserialize"], IsSerialized<META_ANY>>, Deserialized<META_ANY>, unknown>;
|
|
230
|
+
|
|
231
|
+
declare type IntersectUnion<META_UNION extends UnionType, META_TYPE> = META_TYPE extends Type ? META_TYPE extends NeverType ? META_TYPE : META_TYPE extends AnyType ? META_UNION : META_TYPE extends ConstType ? DistributeIntersection<META_UNION, META_TYPE> : META_TYPE extends EnumType ? DistributeIntersection<META_UNION, META_TYPE> : META_TYPE extends PrimitiveType ? DistributeIntersection<META_UNION, META_TYPE> : META_TYPE extends ArrayType ? DistributeIntersection<META_UNION, META_TYPE> : META_TYPE extends TupleType ? DistributeIntersection<META_UNION, META_TYPE> : META_TYPE extends ObjectType ? DistributeIntersection<META_UNION, META_TYPE> : META_TYPE extends UnionType ? DistributeIntersection<META_UNION, META_TYPE> : Never : Never;
|
|
232
|
+
declare type DistributeIntersection<META_UNION extends UnionType, META_TYPE> = $Union<UnionValues<META_UNION> extends infer UNION_VALUE ? $Intersect<UNION_VALUE, META_TYPE> : never>;
|
|
233
|
+
|
|
234
|
+
declare type IntersectIsSerialized<SERIALIZABLE_META_TYPE_A extends SerializableType, SERIALIZABLE_META_TYPE_B extends SerializableType> = Or<IsSerialized<SERIALIZABLE_META_TYPE_A>, IsSerialized<SERIALIZABLE_META_TYPE_B>>;
|
|
235
|
+
declare type IntersectDeserialized<SERIALIZABLE_META_TYPE_A extends SerializableType, SERIALIZABLE_META_TYPE_B extends SerializableType> = If<IsSerialized<SERIALIZABLE_META_TYPE_A>, If<IsSerialized<SERIALIZABLE_META_TYPE_B>, Deserialized<SERIALIZABLE_META_TYPE_A> & Deserialized<SERIALIZABLE_META_TYPE_B>, Deserialized<SERIALIZABLE_META_TYPE_A>>, If<IsSerialized<SERIALIZABLE_META_TYPE_B>, Deserialized<SERIALIZABLE_META_TYPE_B>>>;
|
|
236
|
+
|
|
237
|
+
declare type IntersectConstSerializationParams<META_CONST extends ConstType, SERIALIZABLE_META_TYPE extends SerializableType> = Const<ConstValue<META_CONST>, IntersectIsSerialized<META_CONST, SERIALIZABLE_META_TYPE>, IntersectDeserialized<META_CONST, SERIALIZABLE_META_TYPE>>;
|
|
238
|
+
declare type IntersectConst<META_CONST extends ConstType, META_TYPE> = META_TYPE extends Type ? META_TYPE extends NeverType ? META_TYPE : META_TYPE extends AnyType ? IntersectConstSerializationParams<META_CONST, META_TYPE> : META_TYPE extends ConstType ? CheckExtendsResolved<META_CONST, META_TYPE> : META_TYPE extends EnumType ? IntersectConstToEnum<META_CONST, META_TYPE> : META_TYPE extends PrimitiveType ? IntersectConstToPrimitive<META_CONST, META_TYPE> : META_TYPE extends ArrayType ? IntersectConstToArray<META_CONST, META_TYPE> : META_TYPE extends TupleType ? IntersectConstToTuple<META_CONST, META_TYPE> : META_TYPE extends ObjectType ? IntersectConstToObject<META_CONST, META_TYPE> : META_TYPE extends UnionType ? DistributeIntersection<META_TYPE, META_CONST> : Never : Never;
|
|
239
|
+
declare type CheckExtendsResolved<META_CONST extends ConstType, SERIALIZABLE_META_TYPE extends SerializableType> = ConstValue<META_CONST> extends Resolve<SERIALIZABLE_META_TYPE, {
|
|
240
|
+
deserialize: false;
|
|
241
|
+
}> ? IntersectConstSerializationParams<META_CONST, SERIALIZABLE_META_TYPE> : Never;
|
|
242
|
+
declare type IntersectConstToEnum<META_CONST extends ConstType, META_ENUM extends EnumType> = CheckExtendsResolved<META_CONST, META_ENUM>;
|
|
243
|
+
declare type IntersectConstToPrimitive<META_CONST extends ConstType, META_PRIMITIVE extends PrimitiveType> = CheckExtendsResolved<META_CONST, META_PRIMITIVE>;
|
|
244
|
+
declare type IntersectConstToArray<META_CONST extends ConstType, META_ARRAY extends ArrayType> = CheckExtendsResolved<META_CONST, META_ARRAY>;
|
|
245
|
+
declare type IntersectConstToTuple<META_CONST extends ConstType, META_TUPLE extends TupleType> = CheckExtendsResolved<META_CONST, META_TUPLE>;
|
|
246
|
+
declare type IntersectConstToObject<META_CONST extends ConstType, META_OBJECT extends ObjectType> = If<IsObject<ConstValue<META_CONST>>, IntersectObjectConstToObject<META_CONST, META_OBJECT>, Never>;
|
|
247
|
+
declare type IntersectObjectConstToObject<META_CONST extends ConstType, META_OBJECT extends ObjectType, INTERSECTED_META_OBJECT = IntersectConstValuesToObjectValues<ConstValue<META_CONST>, META_OBJECT>> = If<IsNever<NeverKeys<INTERSECTED_META_OBJECT>>, IntersectConstSerializationParams<META_CONST, META_OBJECT>, Never>;
|
|
248
|
+
declare type IntersectConstValuesToObjectValues<CONST_VALUE, META_OBJECT extends ObjectType> = {
|
|
249
|
+
[KEY in Extract<keyof CONST_VALUE | ObjectRequiredKeys<META_OBJECT>, string>]: KEY extends keyof CONST_VALUE ? Intersect<Const<CONST_VALUE[KEY]>, ObjectValue<META_OBJECT, KEY>> : Never;
|
|
250
|
+
};
|
|
251
|
+
declare type NeverKeys<META_OBJECT> = {
|
|
252
|
+
[KEY in keyof META_OBJECT]: META_OBJECT[KEY] extends Never ? KEY : never;
|
|
253
|
+
}[keyof META_OBJECT];
|
|
254
|
+
|
|
255
|
+
declare type IntersectEnumSerializationParams<META_ENUM_VALUES, META_ENUM extends EnumType, SERIALIZABLE_META_TYPE extends SerializableType> = Enum<META_ENUM_VALUES, IntersectIsSerialized<META_ENUM, SERIALIZABLE_META_TYPE>, IntersectDeserialized<META_ENUM, SERIALIZABLE_META_TYPE>>;
|
|
256
|
+
declare type IntersectEnum<META_ENUM extends EnumType, META_TYPE> = META_TYPE extends Type ? META_TYPE extends NeverType ? META_TYPE : META_TYPE extends AnyType ? IntersectEnumSerializationParams<EnumValues<META_ENUM>, META_ENUM, META_TYPE> : META_TYPE extends ConstType ? IntersectConstToEnum<META_TYPE, META_ENUM> : META_TYPE extends EnumType ? FilterEnum<META_ENUM, META_TYPE> : META_TYPE extends PrimitiveType ? IntersectEnumToPrimitive<META_ENUM, META_TYPE> : META_TYPE extends ArrayType ? FilterEnum<META_ENUM, META_TYPE> : META_TYPE extends TupleType ? FilterEnum<META_ENUM, META_TYPE> : META_TYPE extends ObjectType ? FilterEnum<META_ENUM, META_TYPE> : META_TYPE extends UnionType ? DistributeIntersection<META_TYPE, META_ENUM> : Never : Never;
|
|
257
|
+
declare type FilterEnum<META_ENUM extends EnumType, SERIALIZABLE_META_TYPE extends SerializableType> = IntersectEnumSerializationParams<FilterEnumValues<EnumValues<META_ENUM>, SERIALIZABLE_META_TYPE>, META_ENUM, SERIALIZABLE_META_TYPE>;
|
|
258
|
+
declare type FilterEnumValues<ENUM_VALUES, SERIALIZABLE_META_TYPE> = ENUM_VALUES extends infer ENUM_VALUE ? $Intersect<Const<ENUM_VALUE>, SERIALIZABLE_META_TYPE> extends Never ? never : ENUM_VALUE : never;
|
|
259
|
+
declare type IntersectEnumToPrimitive<META_ENUM extends EnumType, META_PRIMITIVE extends PrimitiveType> = FilterEnum<META_ENUM, META_PRIMITIVE>;
|
|
260
|
+
declare type IntersectEnumToArray<META_ENUM extends EnumType, META_ARRAY extends ArrayType> = FilterEnum<META_ENUM, META_ARRAY>;
|
|
261
|
+
declare type IntersectEnumToTuple<META_ENUM extends EnumType, META_TUPLE extends TupleType> = FilterEnum<META_ENUM, META_TUPLE>;
|
|
262
|
+
declare type IntersectEnumToObject<META_ENUM extends EnumType, META_OBJECT extends ObjectType> = FilterEnum<META_ENUM, META_OBJECT>;
|
|
263
|
+
|
|
264
|
+
declare type IntersectTupleSerializationParams<VALUES extends Type[], OPEN_PROPS extends Type, META_TUPLE extends TupleType, SERIALIZABLE_META_TYPE extends SerializableType> = $MergeTuplePropsToSerializable<VALUES, OPEN_PROPS, META_TUPLE, SERIALIZABLE_META_TYPE>;
|
|
265
|
+
declare type $MergeTuplePropsToSerializable<VALUES, OPEN_PROPS, META_TUPLE extends TupleType, SERIALIZABLE_META_TYPE extends SerializableType> = $Tuple<VALUES, OPEN_PROPS, IntersectIsSerialized<META_TUPLE, SERIALIZABLE_META_TYPE>, IntersectDeserialized<META_TUPLE, SERIALIZABLE_META_TYPE>>;
|
|
266
|
+
declare type IntersectTuple<META_TUPLE extends TupleType, META_TYPE> = META_TYPE extends NeverType ? META_TYPE : META_TYPE extends AnyType ? IntersectTupleSerializationParams<TupleValues<META_TUPLE>, TupleOpenProps<META_TUPLE>, META_TUPLE, META_TYPE> : META_TYPE extends ConstType ? IntersectConstToTuple<META_TYPE, META_TUPLE> : META_TYPE extends EnumType ? IntersectEnumToTuple<META_TYPE, META_TUPLE> : META_TYPE extends PrimitiveType ? Never : META_TYPE extends ArrayType ? IntersectTupleToArray<META_TUPLE, META_TYPE> : META_TYPE extends TupleType ? IntersectTuples<META_TUPLE, META_TYPE> : META_TYPE extends ObjectType ? Never : META_TYPE extends UnionType ? DistributeIntersection<META_TYPE, META_TUPLE> : Never;
|
|
267
|
+
declare type IntersectTupleToArray<META_TUPLE extends TupleType, META_ARRAY extends ArrayType, INTERSECTED_VALUES extends unknown[] = IntersectTupleToArrayValues<TupleValues<META_TUPLE>, ArrayValues<META_ARRAY>>, INTERSECTED_OPEN_PROPS = $Intersect<TupleOpenProps<META_TUPLE>, ArrayValues<META_ARRAY>>> = $MergeTuplePropsToSerializable<INTERSECTED_VALUES, INTERSECTED_OPEN_PROPS, META_TUPLE, META_ARRAY>;
|
|
268
|
+
declare type IntersectTupleToArrayValues<TUPLE_VALUES extends Type[], ARRAY_VALUES extends Type, RESULT extends unknown[] = []> = TUPLE_VALUES extends [infer TUPLE_VALUES_HEAD, ...infer TUPLE_VALUES_TAIL] ? TUPLE_VALUES_HEAD extends Type ? TUPLE_VALUES_TAIL extends Type[] ? IntersectTupleToArrayValues<TUPLE_VALUES_TAIL, ARRAY_VALUES, [
|
|
269
|
+
...RESULT,
|
|
270
|
+
Intersect<TUPLE_VALUES_HEAD, ARRAY_VALUES>
|
|
271
|
+
]> : never : never : RESULT;
|
|
272
|
+
declare type IntersectTuples<META_TUPLE_A extends TupleType, META_TUPLE_B extends TupleType, INTERSECTED_VALUES extends unknown[] = IntersectTupleValues<TupleValues<META_TUPLE_A>, TupleValues<META_TUPLE_B>, IsTupleOpen<META_TUPLE_A>, IsTupleOpen<META_TUPLE_B>, TupleOpenProps<META_TUPLE_A>, TupleOpenProps<META_TUPLE_B>>, INTERSECTED_OPEN_PROPS = $Intersect<TupleOpenProps<META_TUPLE_A>, TupleOpenProps<META_TUPLE_B>>> = $MergeTuplePropsToSerializable<INTERSECTED_VALUES, INTERSECTED_OPEN_PROPS, META_TUPLE_A, META_TUPLE_B>;
|
|
273
|
+
declare type IntersectTupleValues<TUPLE_A_VALUES extends Type[], TUPLE_B_VALUES extends Type[], TUPLE_A_IS_OPEN extends boolean, TUPLE_B_IS_OPEN extends boolean, TUPLE_A_OPEN_PROPS extends Type, TUPLE_B_OPEN_PROPS extends Type, RESULT extends unknown[] = []> = TUPLE_A_VALUES extends [
|
|
274
|
+
infer TUPLE_A_VALUES_HEAD,
|
|
275
|
+
...infer TUPLE_A_VALUES_TAIL
|
|
276
|
+
] ? TUPLE_A_VALUES_HEAD extends Type ? TUPLE_A_VALUES_TAIL extends Type[] ? TUPLE_B_VALUES extends [
|
|
277
|
+
infer TUPLE_B_VALUES_HEAD,
|
|
278
|
+
...infer TUPLE_B_VALUES_TAIL
|
|
279
|
+
] ? TUPLE_B_VALUES_HEAD extends Type ? TUPLE_B_VALUES_TAIL extends Type[] ? IntersectTupleValues<TUPLE_A_VALUES_TAIL, TUPLE_B_VALUES_TAIL, TUPLE_A_IS_OPEN, TUPLE_B_IS_OPEN, TUPLE_A_OPEN_PROPS, TUPLE_B_OPEN_PROPS, [
|
|
280
|
+
...RESULT,
|
|
281
|
+
Intersect<TUPLE_A_VALUES_HEAD, TUPLE_B_VALUES_HEAD>
|
|
282
|
+
]> : never : never : IntersectTupleValues<TUPLE_A_VALUES_TAIL, TUPLE_B_VALUES, TUPLE_A_IS_OPEN, TUPLE_B_IS_OPEN, TUPLE_A_OPEN_PROPS, TUPLE_B_OPEN_PROPS, [
|
|
283
|
+
...RESULT,
|
|
284
|
+
TUPLE_B_IS_OPEN extends true ? Intersect<TUPLE_A_VALUES_HEAD, TUPLE_B_OPEN_PROPS> : Never
|
|
285
|
+
]> : never : never : TUPLE_B_VALUES extends [
|
|
286
|
+
infer TUPLE_B_VALUES_HEAD,
|
|
287
|
+
...infer TUPLE_B_VALUES_TAIL
|
|
288
|
+
] ? TUPLE_B_VALUES_HEAD extends Type ? TUPLE_B_VALUES_TAIL extends Type[] ? IntersectTupleValues<TUPLE_A_VALUES, TUPLE_B_VALUES_TAIL, TUPLE_A_IS_OPEN, TUPLE_B_IS_OPEN, TUPLE_A_OPEN_PROPS, TUPLE_B_OPEN_PROPS, [
|
|
289
|
+
...RESULT,
|
|
290
|
+
TUPLE_A_IS_OPEN extends true ? Intersect<TUPLE_B_VALUES_HEAD, TUPLE_A_OPEN_PROPS> : Never
|
|
291
|
+
]> : never : never : RESULT;
|
|
292
|
+
|
|
293
|
+
declare type IntersectArraySerializationParams<VALUES extends Type, META_ARRAY extends ArrayType, SERIALIZABLE_META_TYPE extends SerializableType> = $MergeArrayValuesToSerializable<VALUES, META_ARRAY, SERIALIZABLE_META_TYPE>;
|
|
294
|
+
declare type $MergeArrayValuesToSerializable<VALUES, META_ARRAY extends ArrayType, SERIALIZABLE_META_TYPE extends SerializableType> = _$Array<VALUES, IntersectIsSerialized<META_ARRAY, SERIALIZABLE_META_TYPE>, IntersectDeserialized<META_ARRAY, SERIALIZABLE_META_TYPE>>;
|
|
295
|
+
declare type IntersectArray<META_ARRAY extends ArrayType, META_TYPE> = META_TYPE extends Type ? META_TYPE extends NeverType ? META_TYPE : META_TYPE extends AnyType ? IntersectArraySerializationParams<ArrayValues<META_ARRAY>, META_ARRAY, META_TYPE> : META_TYPE extends ConstType ? IntersectConstToArray<META_TYPE, META_ARRAY> : META_TYPE extends EnumType ? IntersectEnumToArray<META_TYPE, META_ARRAY> : META_TYPE extends PrimitiveType ? Never : META_TYPE extends ArrayType ? IntersectArrays<META_ARRAY, META_TYPE> : META_TYPE extends TupleType ? IntersectTupleToArray<META_TYPE, META_ARRAY> : META_TYPE extends ObjectType ? Never : META_TYPE extends UnionType ? DistributeIntersection<META_TYPE, META_ARRAY> : Never : Never;
|
|
296
|
+
declare type IntersectArrays<META_ARRAY_A extends ArrayType, META_ARRAY_B extends ArrayType> = $MergeArrayValuesToSerializable<Intersect<ArrayValues<META_ARRAY_A>, ArrayValues<META_ARRAY_B>>, META_ARRAY_A, META_ARRAY_B>;
|
|
297
|
+
|
|
298
|
+
declare type IntersectObjectSerializationParams<VALUES extends Record<string, Type>, REQUIRED_KEYS extends string, OPEN_PROPS extends Type, CLOSE_ON_RESOLVE extends boolean, META_OBJECT extends ObjectType, SERIALIZABLE_META_TYPE extends SerializableType> = $MergeObjectPropsToSerializable<VALUES, REQUIRED_KEYS, OPEN_PROPS, CLOSE_ON_RESOLVE, META_OBJECT, SERIALIZABLE_META_TYPE>;
|
|
299
|
+
declare type $MergeObjectPropsToSerializable<VALUES, REQUIRED_KEYS, OPEN_PROPS, CLOSE_ON_RESOLVE, META_OBJECT extends ObjectType, SERIALIZABLE_META_TYPE extends SerializableType> = _$Object<VALUES, REQUIRED_KEYS, OPEN_PROPS, CLOSE_ON_RESOLVE, IntersectIsSerialized<META_OBJECT, SERIALIZABLE_META_TYPE>, IntersectDeserialized<META_OBJECT, SERIALIZABLE_META_TYPE>>;
|
|
300
|
+
declare type IntersectObject<META_OBJECT extends ObjectType, META_TYPE> = META_TYPE extends Type ? META_TYPE extends NeverType ? META_TYPE : META_TYPE extends AnyType ? IntersectObjectSerializationParams<ObjectValues<META_OBJECT>, ObjectRequiredKeys<META_OBJECT>, ObjectOpenProps<META_OBJECT>, IsObjectClosedOnResolve<META_OBJECT>, META_OBJECT, META_TYPE> : META_TYPE extends ConstType ? IntersectConstToObject<META_TYPE, META_OBJECT> : META_TYPE extends EnumType ? IntersectEnumToObject<META_TYPE, META_OBJECT> : META_TYPE extends PrimitiveType ? Never : META_TYPE extends ArrayType ? Never : META_TYPE extends TupleType ? Never : META_TYPE extends ObjectType ? IntersectObjects<META_OBJECT, META_TYPE> : META_TYPE extends UnionType ? DistributeIntersection<META_TYPE, META_OBJECT> : Never : Never;
|
|
301
|
+
declare type IntersectObjects<META_OBJECT_A extends ObjectType, META_OBJECT_B extends ObjectType, INTERSECTED_VALUES extends Record<string, unknown> = IntersectObjectsValues<META_OBJECT_A, META_OBJECT_B>, INTERSECTED_OPEN_PROPS = Intersect<ObjectOpenProps<META_OBJECT_A>, ObjectOpenProps<META_OBJECT_B>>, INTERSECTED_CLOSE_ON_RESOLVE = Or<IsObjectClosedOnResolve<META_OBJECT_A>, IsObjectClosedOnResolve<META_OBJECT_B>>> = $MergeObjectPropsToSerializable<{
|
|
302
|
+
[KEY in keyof INTERSECTED_VALUES]: INTERSECTED_VALUES[KEY];
|
|
303
|
+
}, ObjectRequiredKeys<META_OBJECT_A> | ObjectRequiredKeys<META_OBJECT_B>, INTERSECTED_OPEN_PROPS, INTERSECTED_CLOSE_ON_RESOLVE, META_OBJECT_A, META_OBJECT_B>;
|
|
304
|
+
declare type IntersectObjectsValues<META_OBJECT_A extends ObjectType, META_OBJECT_B extends ObjectType> = {
|
|
305
|
+
[KEY in Extract<keyof ObjectValues<META_OBJECT_A> | keyof ObjectValues<META_OBJECT_B>, string>]: $Intersect<ObjectValue<META_OBJECT_A, KEY>, ObjectValue<META_OBJECT_B, KEY>>;
|
|
306
|
+
};
|
|
307
|
+
|
|
308
|
+
declare type IntersectPrimitiveSerializationParams<META_PRIMITIVE extends PrimitiveType, SERIALIZABLE_META_TYPE extends SerializableType> = Primitive<PrimitiveValue<META_PRIMITIVE>, IntersectIsSerialized<META_PRIMITIVE, SERIALIZABLE_META_TYPE>, IntersectDeserialized<META_PRIMITIVE, SERIALIZABLE_META_TYPE>>;
|
|
309
|
+
declare type IntersectPrimitive<META_PRIMITIVE extends PrimitiveType, META_TYPE> = META_TYPE extends Type ? META_TYPE extends NeverType ? META_TYPE : META_TYPE extends AnyType ? IntersectPrimitiveSerializationParams<META_PRIMITIVE, META_TYPE> : META_TYPE extends ConstType ? IntersectConstToPrimitive<META_TYPE, META_PRIMITIVE> : META_TYPE extends EnumType ? IntersectEnumToPrimitive<META_TYPE, META_PRIMITIVE> : META_TYPE extends PrimitiveType ? If<And$1<DoesExtend$1<PrimitiveValue<META_PRIMITIVE>, PrimitiveValue<META_TYPE>>, DoesExtend$1<PrimitiveValue<META_TYPE>, PrimitiveValue<META_PRIMITIVE>>>, IntersectPrimitiveSerializationParams<META_PRIMITIVE, META_TYPE>, Never> : META_TYPE extends ArrayType ? Never : META_TYPE extends TupleType ? Never : META_TYPE extends ObjectType ? Never : META_TYPE extends UnionType ? DistributeIntersection<META_TYPE, META_PRIMITIVE> : Never : Never;
|
|
310
|
+
|
|
311
|
+
declare type IntersectAny<META_ANY extends AnyType, META_TYPE> = META_TYPE extends Type ? META_TYPE extends NeverType ? META_TYPE : META_TYPE extends AnyType ? Any<IntersectIsSerialized<META_ANY, META_TYPE>, IntersectDeserialized<META_ANY, META_TYPE>> : META_TYPE extends ConstType ? IntersectConstSerializationParams<META_TYPE, META_ANY> : META_TYPE extends EnumType ? IntersectEnumSerializationParams<EnumValues<META_TYPE>, META_TYPE, META_ANY> : META_TYPE extends PrimitiveType ? IntersectPrimitiveSerializationParams<META_TYPE, META_ANY> : META_TYPE extends ArrayType ? IntersectArraySerializationParams<ArrayValues<META_TYPE>, META_TYPE, META_ANY> : META_TYPE extends TupleType ? IntersectTupleSerializationParams<TupleValues<META_TYPE>, TupleOpenProps<META_TYPE>, META_TYPE, META_ANY> : META_TYPE extends ObjectType ? IntersectObjectSerializationParams<ObjectValues<META_TYPE>, ObjectRequiredKeys<META_TYPE>, ObjectOpenProps<META_TYPE>, IsObjectClosedOnResolve<META_TYPE>, META_TYPE, META_ANY> : META_TYPE extends UnionType ? DistributeIntersection<META_TYPE, META_ANY> : Never : Never;
|
|
312
|
+
|
|
313
|
+
declare type Intersect<META_TYPE_A extends Type, META_TYPE_B extends Type> = $Intersect<META_TYPE_A, META_TYPE_B>;
|
|
314
|
+
declare type $Intersect<META_TYPE_A, META_TYPE_B> = META_TYPE_A extends NeverType ? META_TYPE_A : META_TYPE_A extends AnyType ? IntersectAny<META_TYPE_A, META_TYPE_B> : META_TYPE_A extends ConstType ? IntersectConst<META_TYPE_A, META_TYPE_B> : META_TYPE_A extends EnumType ? IntersectEnum<META_TYPE_A, META_TYPE_B> : META_TYPE_A extends PrimitiveType ? IntersectPrimitive<META_TYPE_A, META_TYPE_B> : META_TYPE_A extends ArrayType ? IntersectArray<META_TYPE_A, META_TYPE_B> : META_TYPE_A extends TupleType ? IntersectTuple<META_TYPE_A, META_TYPE_B> : META_TYPE_A extends ObjectType ? IntersectObject<META_TYPE_A, META_TYPE_B> : META_TYPE_A extends UnionType ? IntersectUnion<META_TYPE_A, META_TYPE_B> : Never;
|
|
315
|
+
|
|
316
|
+
declare type ExcludeFromUnion<META_UNION extends UnionType, META_TYPE> = $Union<UnionValues<META_UNION> extends infer META_UNION_VALUE ? _$Exclude<META_UNION_VALUE, META_TYPE> : never>;
|
|
317
|
+
declare type ExcludeUnion<META_TYPE, META_UNION extends UnionType> = If<IsNever<UnionValues<META_UNION>>, META_TYPE, RecurseOnUnionValues<META_TYPE, UnionLast<UnionValues<META_UNION>>, META_UNION>>;
|
|
318
|
+
declare type RecurseOnUnionValues<META_TYPE, META_UNION_VALUE, META_UNION extends UnionType> = $Intersect<_$Exclude<META_TYPE, META_UNION_VALUE>, _$Exclude<META_TYPE, $Union<Exclude<UnionValues<META_UNION>, META_UNION_VALUE>>>>;
|
|
319
|
+
|
|
320
|
+
declare type ExcludeFromAny<META_ANY extends AnyType, META_TYPE> = META_TYPE extends Type ? META_TYPE extends NeverType ? META_ANY : META_TYPE extends AnyType ? Never : META_TYPE extends ConstType ? META_ANY : META_TYPE extends EnumType ? META_ANY : META_TYPE extends PrimitiveType ? META_ANY : META_TYPE extends ArrayType ? META_ANY : META_TYPE extends TupleType ? META_ANY : META_TYPE extends ObjectType ? META_ANY : META_TYPE extends UnionType ? ExcludeUnion<META_ANY, META_TYPE> : Never : Never;
|
|
321
|
+
|
|
322
|
+
declare type ExcludeFromArray<META_ARRAY extends ArrayType, META_TYPE> = META_TYPE extends Type ? META_TYPE extends NeverType ? META_ARRAY : META_TYPE extends AnyType ? Never : META_TYPE extends ConstType ? META_ARRAY : META_TYPE extends EnumType ? META_ARRAY : META_TYPE extends PrimitiveType ? META_ARRAY : META_TYPE extends ArrayType ? ExcludeArrays<META_ARRAY, META_TYPE> : META_TYPE extends TupleType ? And$1<DoesExtend$1<TupleValues<META_TYPE>, []>, IsTupleOpen<META_TYPE>> extends true ? ExcludeArrays<META_ARRAY, _Array<TupleOpenProps<META_TYPE>>> : META_ARRAY : META_TYPE extends ObjectType ? META_ARRAY : META_TYPE extends UnionType ? ExcludeUnion<META_ARRAY, META_TYPE> : Never : Never;
|
|
323
|
+
declare type ExcludeArrays<META_ARRAY_A extends ArrayType, META_ARRAY_B extends ArrayType> = _Exclude<ArrayValues<META_ARRAY_A>, ArrayValues<META_ARRAY_B>> extends NeverType ? NeverType : META_ARRAY_A;
|
|
324
|
+
|
|
325
|
+
declare type ExcludeFromConst<META_CONST extends ConstType, META_TYPE> = META_TYPE extends Type ? META_TYPE extends NeverType ? META_CONST : META_TYPE extends AnyType ? Never : META_TYPE extends ConstType ? CheckNotExtendsResolved<META_CONST, META_TYPE> : META_TYPE extends EnumType ? CheckNotExtendsResolved<META_CONST, META_TYPE> : META_TYPE extends PrimitiveType ? CheckNotExtendsResolved<META_CONST, META_TYPE> : META_TYPE extends ArrayType ? CheckNotExtendsResolved<META_CONST, META_TYPE> : META_TYPE extends TupleType ? CheckNotExtendsResolved<META_CONST, META_TYPE> : META_TYPE extends ObjectType ? ExcludeObject<META_CONST, META_TYPE> : META_TYPE extends UnionType ? ExcludeUnion<META_CONST, META_TYPE> : Never : Never;
|
|
326
|
+
declare type CheckNotExtendsResolved<META_CONST extends ConstType, META_TYPE extends Type> = ConstValue<META_CONST> extends Resolve<META_TYPE, {
|
|
327
|
+
deserialize: false;
|
|
328
|
+
}> ? Never : META_CONST;
|
|
329
|
+
declare type ExcludeObject<META_CONST extends ConstType, META_OBJECT extends ObjectType> = If<IsObject<ConstValue<META_CONST>>, ObjectRequiredKeys<META_OBJECT> extends keyof ConstValue<META_CONST> ? ExcludeObjectFromConst<META_CONST, META_OBJECT> : META_CONST, META_CONST>;
|
|
330
|
+
declare type ExcludeObjectFromConst<META_CONST extends ConstType, META_OBJECT extends ObjectType, EXCLUDED_CONST_VALUES = ExcludeConstValues<ConstValue<META_CONST>, META_OBJECT>> = If<IsNever<RepresentableKeys$1<EXCLUDED_CONST_VALUES>>, Never, META_CONST>;
|
|
331
|
+
declare type ExcludeConstValues<VALUE, META_OBJECT extends ObjectType> = {
|
|
332
|
+
[KEY in keyof VALUE]: KEY extends keyof ObjectValues<META_OBJECT> ? _Exclude<Const<VALUE[KEY]>, ObjectValues<META_OBJECT>[KEY]> : IsObjectOpen<META_OBJECT> extends true ? _Exclude<Const<VALUE[KEY]>, ObjectOpenProps<META_OBJECT>> : Const<VALUE[KEY]>;
|
|
333
|
+
};
|
|
334
|
+
declare type RepresentableKeys$1<VALUES> = {
|
|
335
|
+
[KEY in keyof VALUES]: VALUES[KEY] extends Never ? never : KEY;
|
|
336
|
+
}[keyof VALUES];
|
|
337
|
+
|
|
338
|
+
declare type ExcludeFromEnum<META_ENUM extends EnumType, META_TYPE> = META_TYPE extends Type ? META_TYPE extends NeverType ? META_ENUM : META_TYPE extends AnyType ? Never : META_TYPE extends ConstType ? FilterEnumExcluded<META_ENUM, META_TYPE> : META_TYPE extends EnumType ? FilterEnumExcluded<META_ENUM, META_TYPE> : META_TYPE extends PrimitiveType ? FilterEnumExcluded<META_ENUM, META_TYPE> : META_TYPE extends ArrayType ? FilterEnumExcluded<META_ENUM, META_TYPE> : META_TYPE extends TupleType ? FilterEnumExcluded<META_ENUM, META_TYPE> : META_TYPE extends ObjectType ? FilterEnumExcluded<META_ENUM, META_TYPE> : META_TYPE extends UnionType ? ExcludeUnion<META_ENUM, META_TYPE> : Never : Never;
|
|
339
|
+
declare type FilterEnumExcluded<META_ENUM extends EnumType, META_TYPE extends Type> = Enum<FilterEnumExcludedValues<EnumValues<META_ENUM>, META_TYPE>>;
|
|
340
|
+
declare type FilterEnumExcludedValues<ENUM_VALUES, META_TYPE extends Type> = ENUM_VALUES extends infer ENUM_VALUE ? _Exclude<Const<ENUM_VALUE>, META_TYPE> extends NeverType ? never : ENUM_VALUE : never;
|
|
341
|
+
declare type ExcludeEnum<META_TYPE extends Type, ENUM_TYPE extends EnumType, ENUM_VALUES = EnumValues<ENUM_TYPE>> = ExcludeEnumValue<META_TYPE, UnionLast<ENUM_VALUES>, ENUM_VALUES>;
|
|
342
|
+
declare type ExcludeEnumValue<META_TYPE extends Type, LAST_ENUM_VALUE, ENUM_VALUES> = $Intersect<_Exclude<META_TYPE, Const<LAST_ENUM_VALUE>>, _Exclude<META_TYPE, Enum<Exclude<ENUM_VALUES, LAST_ENUM_VALUE>>>>;
|
|
343
|
+
|
|
344
|
+
declare type ValueExclusionResult<VALUE_A extends Type, IS_ALLOWED_IN_A extends boolean, IS_REQUIRED_IN_A extends boolean, VALUE_B extends Type, IS_ALLOWED_IN_B extends boolean, IS_REQUIRED_IN_B extends boolean> = {
|
|
345
|
+
sourceValue: VALUE_A;
|
|
346
|
+
isAllowedInSource: IS_ALLOWED_IN_A;
|
|
347
|
+
isRequiredInSource: IS_REQUIRED_IN_A;
|
|
348
|
+
isAllowedInExcluded: IS_ALLOWED_IN_B;
|
|
349
|
+
isRequiredInExcluded: IS_REQUIRED_IN_B;
|
|
350
|
+
exclusionResult: _$Exclude<VALUE_A, VALUE_B>;
|
|
351
|
+
};
|
|
352
|
+
declare type ValueExclusionResultType = {
|
|
353
|
+
sourceValue: Type;
|
|
354
|
+
isAllowedInSource: boolean;
|
|
355
|
+
isRequiredInSource: boolean;
|
|
356
|
+
isAllowedInExcluded: boolean;
|
|
357
|
+
isRequiredInExcluded: boolean;
|
|
358
|
+
exclusionResult: any;
|
|
359
|
+
};
|
|
360
|
+
declare type SourceValue<VALUE_EXCLUSION_RESULT extends ValueExclusionResultType> = VALUE_EXCLUSION_RESULT["sourceValue"];
|
|
361
|
+
declare type IsAllowedInSource<VALUE_EXCLUSION_RESULT extends ValueExclusionResultType> = VALUE_EXCLUSION_RESULT["isAllowedInSource"];
|
|
362
|
+
declare type IsRequiredInSource<VALUE_EXCLUSION_RESULT extends ValueExclusionResultType> = VALUE_EXCLUSION_RESULT["isRequiredInSource"];
|
|
363
|
+
declare type ExclusionResult<VALUE_EXCLUSION_RESULT extends ValueExclusionResultType> = VALUE_EXCLUSION_RESULT["exclusionResult"];
|
|
364
|
+
declare type IsAllowedInExcluded<VALUE_EXCLUSION_RESULT extends ValueExclusionResultType> = VALUE_EXCLUSION_RESULT["isAllowedInExcluded"];
|
|
365
|
+
declare type IsRequiredInExcluded<VALUE_EXCLUSION_RESULT extends ValueExclusionResultType> = VALUE_EXCLUSION_RESULT["isRequiredInExcluded"];
|
|
366
|
+
declare type IsOutsideOfSourceScope<VALUE_EXCLUSION_RESULT extends ValueExclusionResultType> = And$1<Not$1<IsAllowedInSource<VALUE_EXCLUSION_RESULT>>, IsRequiredInExcluded<VALUE_EXCLUSION_RESULT>>;
|
|
367
|
+
declare type IsOutsideOfExcludedScope<VALUE_EXCLUSION_RESULT extends ValueExclusionResultType> = And$1<IsRequiredInSource<VALUE_EXCLUSION_RESULT>, Not$1<IsAllowedInExcluded<VALUE_EXCLUSION_RESULT>>>;
|
|
368
|
+
declare type IsOmittable<VALUE_EXCLUSION_RESULT extends ValueExclusionResultType> = And$1<Not$1<IsRequiredInSource<VALUE_EXCLUSION_RESULT>>, IsRequiredInExcluded<VALUE_EXCLUSION_RESULT>>;
|
|
369
|
+
declare type PropagateExclusion<VALUE_EXCLUSION_RESULT extends ValueExclusionResultType> = ExclusionResult<VALUE_EXCLUSION_RESULT> extends NeverType ? SourceValue<VALUE_EXCLUSION_RESULT> : ExclusionResult<VALUE_EXCLUSION_RESULT>;
|
|
370
|
+
|
|
371
|
+
declare type ExcludeFromObject<META_OBJECT extends ObjectType, META_TYPE> = META_TYPE extends Type ? META_TYPE extends NeverType ? META_OBJECT : META_TYPE extends AnyType ? Never : META_TYPE extends ConstType ? ExcludeConstFromObject<META_OBJECT, META_TYPE> : META_TYPE extends EnumType ? ExcludeEnum<META_OBJECT, META_TYPE> : META_TYPE extends PrimitiveType ? META_OBJECT : META_TYPE extends ArrayType ? META_OBJECT : META_TYPE extends TupleType ? META_OBJECT : META_TYPE extends ObjectType ? ExcludeObjects<META_OBJECT, META_TYPE> : META_TYPE extends UnionType ? ExcludeUnion<META_OBJECT, META_TYPE> : Never : Never;
|
|
372
|
+
declare type ExcludeObjects<META_OBJECT_A extends ObjectType, META_OBJECT_B extends ObjectType, VALUE_EXCLUSION_RESULTS extends Record<string, ValueExclusionResultType> = ExcludeObjectValues<META_OBJECT_A, META_OBJECT_B>, REPRESENTABLE_KEYS extends string = RepresentableKeys<VALUE_EXCLUSION_RESULTS>, OPEN_PROPS_EXCLUSION = _Exclude<ObjectOpenProps<META_OBJECT_A>, ObjectOpenProps<META_OBJECT_B>>> = DoesObjectSizesMatch<META_OBJECT_A, META_OBJECT_B, VALUE_EXCLUSION_RESULTS> extends true ? {
|
|
373
|
+
moreThanTwo: META_OBJECT_A;
|
|
374
|
+
onlyOne: PropagateExclusions$1<META_OBJECT_A, VALUE_EXCLUSION_RESULTS>;
|
|
375
|
+
none: OmitOmittableKeys<META_OBJECT_A, VALUE_EXCLUSION_RESULTS>;
|
|
376
|
+
}[And$1<IsObjectOpen<META_OBJECT_A>, Not$1<DoesExtend$1<OPEN_PROPS_EXCLUSION, NeverType>>> extends true ? "moreThanTwo" : GetUnionLength<REPRESENTABLE_KEYS>] : META_OBJECT_A;
|
|
377
|
+
declare type ExcludeObjectValues<META_OBJECT_A extends ObjectType, META_OBJECT_B extends ObjectType> = {
|
|
378
|
+
[KEY in Extract<keyof ObjectValues<META_OBJECT_A> | keyof ObjectValues<META_OBJECT_B> | ObjectRequiredKeys<META_OBJECT_A> | ObjectRequiredKeys<META_OBJECT_B>, string>]: ValueExclusionResult<ObjectValue<META_OBJECT_A, KEY>, IsAllowedIn<META_OBJECT_A, KEY>, IsRequiredIn<META_OBJECT_A, KEY>, ObjectValue<META_OBJECT_B, KEY>, IsAllowedIn<META_OBJECT_B, KEY>, IsRequiredIn<META_OBJECT_B, KEY>>;
|
|
379
|
+
};
|
|
380
|
+
declare type GetUnionLength<UNION> = If<IsNever<UNION>, "none", If<IsNever<UnionPop<UNION>>, "onlyOne", "moreThanTwo">>;
|
|
381
|
+
declare type IsAllowedIn<META_OBJECT extends ObjectType, KEY extends string> = Or<DoesExtend$1<KEY, keyof ObjectValues<META_OBJECT>>, IsObjectOpen<META_OBJECT>>;
|
|
382
|
+
declare type IsRequiredIn<META_OBJECT extends ObjectType, KEY extends string> = DoesExtend$1<KEY, ObjectRequiredKeys<META_OBJECT>>;
|
|
383
|
+
declare type DoesObjectSizesMatch<META_OBJECT_A extends ObjectType, META_OBJECT_B extends ObjectType, VALUE_EXCLUSION_RESULTS extends Record<string, ValueExclusionResultType>> = If<And$1<IsObjectOpen<META_OBJECT_A>, Not$1<IsObjectOpen<META_OBJECT_B>>>, false, And$1<IsExcludedSmallEnough$1<VALUE_EXCLUSION_RESULTS>, IsExcludedBigEnough$1<VALUE_EXCLUSION_RESULTS>>>;
|
|
384
|
+
declare type IsExcludedSmallEnough$1<VALUE_EXCLUSION_RESULTS extends Record<string, ValueExclusionResultType>> = Not$1<DoesExtend$1<true, {
|
|
385
|
+
[KEY in keyof VALUE_EXCLUSION_RESULTS]: IsOutsideOfSourceScope<VALUE_EXCLUSION_RESULTS[KEY]>;
|
|
386
|
+
}[keyof VALUE_EXCLUSION_RESULTS]>>;
|
|
387
|
+
declare type IsExcludedBigEnough$1<VALUE_EXCLUSION_RESULTS extends Record<string, ValueExclusionResultType>> = Not$1<DoesExtend$1<true, {
|
|
388
|
+
[KEY in keyof VALUE_EXCLUSION_RESULTS]: IsOutsideOfExcludedScope<VALUE_EXCLUSION_RESULTS[KEY]>;
|
|
389
|
+
}[keyof VALUE_EXCLUSION_RESULTS]>>;
|
|
390
|
+
declare type RepresentableKeys<VALUE_EXCLUSION_RESULTS extends Record<string, ValueExclusionResultType>> = {
|
|
391
|
+
[KEY in Extract<keyof VALUE_EXCLUSION_RESULTS, string>]: ExclusionResult<VALUE_EXCLUSION_RESULTS[KEY]> extends NeverType ? never : KEY;
|
|
392
|
+
}[Extract<keyof VALUE_EXCLUSION_RESULTS, string>];
|
|
393
|
+
declare type PropagateExclusions$1<META_OBJECT extends ObjectType, VALUE_EXCLUSION_RESULTS extends Record<string, ValueExclusionResultType>> = _Object<{
|
|
394
|
+
[KEY in keyof VALUE_EXCLUSION_RESULTS]: PropagateExclusion<VALUE_EXCLUSION_RESULTS[KEY]>;
|
|
395
|
+
}, ObjectRequiredKeys<META_OBJECT>, ObjectOpenProps<META_OBJECT>, IsObjectClosedOnResolve<META_OBJECT>, IsSerialized<META_OBJECT>, Deserialized<META_OBJECT>>;
|
|
396
|
+
declare type OmitOmittableKeys<META_OBJECT extends ObjectType, VALUE_EXCLUSION_RESULTS extends Record<string, ValueExclusionResultType>, OMITTABLE_KEYS extends string = OmittableKeys<VALUE_EXCLUSION_RESULTS>, OMITTABLE_KEYS_COUNT extends string = GetUnionLength<OMITTABLE_KEYS>> = OMITTABLE_KEYS_COUNT extends "moreThanTwo" ? META_OBJECT : OMITTABLE_KEYS_COUNT extends "onlyOne" ? _Object<{
|
|
397
|
+
[KEY in keyof VALUE_EXCLUSION_RESULTS]: KEY extends OMITTABLE_KEYS ? Never : SourceValue<VALUE_EXCLUSION_RESULTS[KEY]>;
|
|
398
|
+
}, ObjectRequiredKeys<META_OBJECT>, ObjectOpenProps<META_OBJECT>, IsObjectClosedOnResolve<META_OBJECT>, IsSerialized<META_OBJECT>, Deserialized<META_OBJECT>> : Never;
|
|
399
|
+
declare type OmittableKeys<VALUE_EXCLUSION_RESULTS extends Record<string, ValueExclusionResultType>> = {
|
|
400
|
+
[KEY in Extract<keyof VALUE_EXCLUSION_RESULTS, string>]: IsOmittable<VALUE_EXCLUSION_RESULTS[KEY]> extends true ? KEY : never;
|
|
401
|
+
}[Extract<keyof VALUE_EXCLUSION_RESULTS, string>];
|
|
402
|
+
declare type ExcludeConstFromObject<META_OBJECT extends ObjectType, META_CONST extends ConstType, CONST_VALUE = ConstValue<META_CONST>> = If<IsObject<CONST_VALUE>, _$Exclude<META_OBJECT, _Object<{
|
|
403
|
+
[KEY in Extract<keyof CONST_VALUE, string>]: Const<CONST_VALUE[KEY]>;
|
|
404
|
+
}, Extract<keyof CONST_VALUE, string>, Never, IsObjectClosedOnResolve<META_OBJECT>, IsSerialized<META_CONST>, Deserialized<META_CONST>>>, META_OBJECT>;
|
|
405
|
+
|
|
406
|
+
declare type ExcludeFromPrimitive<META_PRIMITIVE extends PrimitiveType, META_TYPE> = META_TYPE extends Type ? META_TYPE extends NeverType ? META_PRIMITIVE : META_TYPE extends AnyType ? Never : META_TYPE extends ConstType ? META_PRIMITIVE : META_TYPE extends EnumType ? META_PRIMITIVE : META_TYPE extends PrimitiveType ? PrimitiveValue<META_PRIMITIVE> extends PrimitiveValue<META_TYPE> ? Never : META_PRIMITIVE : META_TYPE extends ArrayType ? META_PRIMITIVE : META_TYPE extends TupleType ? META_PRIMITIVE : META_TYPE extends ObjectType ? META_PRIMITIVE : META_TYPE extends UnionType ? ExcludeUnion<META_PRIMITIVE, META_TYPE> : Never : Never;
|
|
407
|
+
|
|
408
|
+
declare type ExcludeFromTuple<META_TUPLE extends TupleType, META_TYPE> = META_TYPE extends Type ? META_TYPE extends NeverType ? META_TUPLE : META_TYPE extends AnyType ? Never : META_TYPE extends ConstType ? ExcludeConst<META_TUPLE, META_TYPE> : META_TYPE extends EnumType ? ExcludeEnum<META_TUPLE, META_TYPE> : META_TYPE extends PrimitiveType ? META_TUPLE : META_TYPE extends ArrayType ? ExcludeArray<META_TUPLE, META_TYPE> : META_TYPE extends TupleType ? ExcludeTuples<META_TUPLE, META_TYPE> : META_TYPE extends ObjectType ? META_TUPLE : META_TYPE extends UnionType ? ExcludeUnion<META_TUPLE, META_TYPE> : Never : Never;
|
|
409
|
+
declare type ExcludeArray<META_TUPLE extends TupleType, META_ARRAY extends ArrayType> = ExcludeTuples<META_TUPLE, Tuple<[
|
|
410
|
+
], ArrayValues<META_ARRAY>, IsSerialized<META_ARRAY>, Deserialized<META_ARRAY>>>;
|
|
411
|
+
declare type ExcludeTuples<META_TUPLE_A extends TupleType, META_TUPLE_B extends TupleType, VALUE_EXCLUSION_RESULTS extends ValueExclusionResultType[] = ExcludeTupleValues<TupleValues<META_TUPLE_A>, TupleValues<META_TUPLE_B>, IsTupleOpen<META_TUPLE_A>, IsTupleOpen<META_TUPLE_B>, TupleOpenProps<META_TUPLE_A>, TupleOpenProps<META_TUPLE_B>>, REPRESENTABLE_VALUE_EXCLUSION_RESULTS extends ValueExclusionResultType[] = RepresentableExcludedValues<VALUE_EXCLUSION_RESULTS>, EXCLUDED_OPEN_PROPS = _Exclude<TupleOpenProps<META_TUPLE_A>, TupleOpenProps<META_TUPLE_B>>, IS_OPEN_PROPS_EXCLUSION_REPRESENTABLE = Not$1<DoesExtend$1<EXCLUDED_OPEN_PROPS, NeverType>>> = If<DoesTupleSizesMatch<META_TUPLE_A, META_TUPLE_B, VALUE_EXCLUSION_RESULTS>, {
|
|
412
|
+
moreThanTwo: META_TUPLE_A;
|
|
413
|
+
onlyOne: $Tuple<PropagateExclusions<VALUE_EXCLUSION_RESULTS>, TupleOpenProps<META_TUPLE_A>, IsSerialized<META_TUPLE_A>, Deserialized<META_TUPLE_A>>;
|
|
414
|
+
none: OmitOmittableExcludedItems<META_TUPLE_A, VALUE_EXCLUSION_RESULTS>;
|
|
415
|
+
}[And$1<IsTupleOpen<META_TUPLE_A>, IS_OPEN_PROPS_EXCLUSION_REPRESENTABLE> extends true ? "moreThanTwo" : GetTupleLength<REPRESENTABLE_VALUE_EXCLUSION_RESULTS>], META_TUPLE_A>;
|
|
416
|
+
declare type ExcludeTupleValues<META_TUPLE_A_VALUES extends Type[], META_TUPLE_B_VALUES extends Type[], IS_META_TUPLE_A_OPEN extends boolean, IS_META_TUPLE_B_OPEN extends boolean, META_TUPLE_A_OPEN_PROPS extends Type, META_TUPLE_B_OPEN_PROPS extends Type, VALUE_EXCLUSION_RESULTS extends ValueExclusionResultType[] = []> = META_TUPLE_A_VALUES extends [
|
|
417
|
+
infer META_TUPLE_A_VALUES_HEAD,
|
|
418
|
+
...infer META_TUPLE_A_VALUES_TAIL
|
|
419
|
+
] ? META_TUPLE_A_VALUES_HEAD extends Type ? META_TUPLE_A_VALUES_TAIL extends Type[] ? META_TUPLE_B_VALUES extends [
|
|
420
|
+
infer META_TUPLE_B_VALUES_HEAD,
|
|
421
|
+
...infer META_TUPLE_B_VALUES_TAIL
|
|
422
|
+
] ? META_TUPLE_B_VALUES_HEAD extends Type ? META_TUPLE_B_VALUES_TAIL extends Type[] ? ExcludeTupleValues<META_TUPLE_A_VALUES_TAIL, META_TUPLE_B_VALUES_TAIL, IS_META_TUPLE_A_OPEN, IS_META_TUPLE_B_OPEN, META_TUPLE_A_OPEN_PROPS, META_TUPLE_B_OPEN_PROPS, [
|
|
423
|
+
...VALUE_EXCLUSION_RESULTS,
|
|
424
|
+
ValueExclusionResult<META_TUPLE_A_VALUES_HEAD, true, true, META_TUPLE_B_VALUES_HEAD, true, true>
|
|
425
|
+
]> : never : never : ExcludeTupleValues<META_TUPLE_A_VALUES_TAIL, [
|
|
426
|
+
], IS_META_TUPLE_A_OPEN, IS_META_TUPLE_B_OPEN, META_TUPLE_A_OPEN_PROPS, META_TUPLE_B_OPEN_PROPS, [
|
|
427
|
+
...VALUE_EXCLUSION_RESULTS,
|
|
428
|
+
ValueExclusionResult<META_TUPLE_A_VALUES_HEAD, true, true, META_TUPLE_B_OPEN_PROPS, IS_META_TUPLE_B_OPEN, false>
|
|
429
|
+
]> : never : never : META_TUPLE_B_VALUES extends [
|
|
430
|
+
infer META_TUPLE_B_VALUES_HEAD,
|
|
431
|
+
...infer META_TUPLE_B_VALUES_TAIL
|
|
432
|
+
] ? META_TUPLE_B_VALUES_HEAD extends Type ? META_TUPLE_B_VALUES_TAIL extends Type[] ? ExcludeTupleValues<[
|
|
433
|
+
], META_TUPLE_B_VALUES_TAIL, IS_META_TUPLE_A_OPEN, IS_META_TUPLE_B_OPEN, META_TUPLE_A_OPEN_PROPS, META_TUPLE_B_OPEN_PROPS, [
|
|
434
|
+
...VALUE_EXCLUSION_RESULTS,
|
|
435
|
+
ValueExclusionResult<META_TUPLE_A_OPEN_PROPS, IS_META_TUPLE_A_OPEN, false, META_TUPLE_B_VALUES_HEAD, true, true>
|
|
436
|
+
]> : never : never : VALUE_EXCLUSION_RESULTS;
|
|
437
|
+
declare type GetTupleLength<ANY_TUPLE extends unknown[], TAIL extends unknown[] = Tail$1<ANY_TUPLE>> = If<DoesExtend$1<ANY_TUPLE, []>, "none", If<DoesExtend$1<TAIL, []>, "onlyOne", "moreThanTwo">>;
|
|
438
|
+
declare type DoesTupleSizesMatch<META_TUPLE_A extends TupleType, META_TUPLE_B extends TupleType, VALUE_EXCLUSION_RESULTS extends ValueExclusionResultType[]> = If<And$1<IsTupleOpen<META_TUPLE_A>, Not$1<IsTupleOpen<META_TUPLE_B>>>, false, And$1<IsExcludedSmallEnough<VALUE_EXCLUSION_RESULTS>, IsExcludedBigEnough<VALUE_EXCLUSION_RESULTS>>>;
|
|
439
|
+
declare type IsExcludedSmallEnough<VALUE_EXCLUSION_RESULTS extends ValueExclusionResultType[]> = VALUE_EXCLUSION_RESULTS extends [
|
|
440
|
+
infer VALUE_EXCLUSION_RESULTS_HEAD,
|
|
441
|
+
...infer VALUE_EXCLUSION_RESULTS_TAIL
|
|
442
|
+
] ? VALUE_EXCLUSION_RESULTS_HEAD extends ValueExclusionResultType ? VALUE_EXCLUSION_RESULTS_TAIL extends ValueExclusionResultType[] ? If<IsOutsideOfSourceScope<VALUE_EXCLUSION_RESULTS_HEAD>, false, IsExcludedSmallEnough<VALUE_EXCLUSION_RESULTS_TAIL>> : never : never : true;
|
|
443
|
+
declare type IsExcludedBigEnough<VALUE_EXCLUSION_RESULTS extends ValueExclusionResultType[]> = VALUE_EXCLUSION_RESULTS extends [
|
|
444
|
+
infer VALUE_EXCLUSION_RESULTS_HEAD,
|
|
445
|
+
...infer VALUE_EXCLUSION_RESULTS_TAIL
|
|
446
|
+
] ? VALUE_EXCLUSION_RESULTS_HEAD extends ValueExclusionResultType ? VALUE_EXCLUSION_RESULTS_TAIL extends ValueExclusionResultType[] ? If<IsOutsideOfExcludedScope<VALUE_EXCLUSION_RESULTS_HEAD>, false, IsExcludedBigEnough<VALUE_EXCLUSION_RESULTS_TAIL>> : never : never : true;
|
|
447
|
+
declare type RepresentableExcludedValues<VALUE_EXCLUSION_RESULTS extends ValueExclusionResultType[], REPRESENTABLE_VALUE_EXCLUSION_RESULTS extends ValueExclusionResultType[] = []> = VALUE_EXCLUSION_RESULTS extends [
|
|
448
|
+
infer VALUE_EXCLUSION_RESULTS_HEAD,
|
|
449
|
+
...infer VALUE_EXCLUSION_RESULTS_TAIL
|
|
450
|
+
] ? VALUE_EXCLUSION_RESULTS_HEAD extends ValueExclusionResultType ? VALUE_EXCLUSION_RESULTS_TAIL extends ValueExclusionResultType[] ? ExclusionResult<VALUE_EXCLUSION_RESULTS_HEAD> extends NeverType ? RepresentableExcludedValues<VALUE_EXCLUSION_RESULTS_TAIL, REPRESENTABLE_VALUE_EXCLUSION_RESULTS> : RepresentableExcludedValues<VALUE_EXCLUSION_RESULTS_TAIL, [
|
|
451
|
+
...REPRESENTABLE_VALUE_EXCLUSION_RESULTS,
|
|
452
|
+
VALUE_EXCLUSION_RESULTS_HEAD
|
|
453
|
+
]> : never : never : REPRESENTABLE_VALUE_EXCLUSION_RESULTS;
|
|
454
|
+
declare type PropagateExclusions<VALUE_EXCLUSION_RESULTS extends ValueExclusionResultType[], RESULT extends unknown[] = []> = VALUE_EXCLUSION_RESULTS extends [
|
|
455
|
+
infer VALUE_EXCLUSION_RESULTS_HEAD,
|
|
456
|
+
...infer VALUE_EXCLUSION_RESULTS_TAIL
|
|
457
|
+
] ? VALUE_EXCLUSION_RESULTS_HEAD extends ValueExclusionResultType ? VALUE_EXCLUSION_RESULTS_TAIL extends ValueExclusionResultType[] ? PropagateExclusions<VALUE_EXCLUSION_RESULTS_TAIL, [
|
|
458
|
+
...RESULT,
|
|
459
|
+
PropagateExclusion<VALUE_EXCLUSION_RESULTS_HEAD>
|
|
460
|
+
]> : never : never : RESULT;
|
|
461
|
+
declare type OmitOmittableExcludedItems<META_TUPLE extends TupleType, ITEM_EXCLUSION_RESULTS extends ValueExclusionResultType[], OMITTABLE_ITEM_EXCLUSION_RESULTS extends ValueExclusionResultType[] = OmittableExcludedItems<ITEM_EXCLUSION_RESULTS>, OMITTABLE_ITEMS_COUNT extends string = GetTupleLength<OMITTABLE_ITEM_EXCLUSION_RESULTS>> = OMITTABLE_ITEMS_COUNT extends "moreThanTwo" ? META_TUPLE : OMITTABLE_ITEMS_COUNT extends "onlyOne" ? $Tuple<RequiredExcludedItems<ITEM_EXCLUSION_RESULTS>, Never, IsSerialized<META_TUPLE>, Deserialized<META_TUPLE>> : Never;
|
|
462
|
+
declare type OmittableExcludedItems<ITEM_EXCLUSION_RESULTS extends ValueExclusionResultType[], RESULT extends ValueExclusionResultType[] = []> = ITEM_EXCLUSION_RESULTS extends [
|
|
463
|
+
infer VALUE_EXCLUSION_RESULTS_HEAD,
|
|
464
|
+
...infer VALUE_EXCLUSION_RESULTS_TAIL
|
|
465
|
+
] ? VALUE_EXCLUSION_RESULTS_HEAD extends ValueExclusionResultType ? VALUE_EXCLUSION_RESULTS_TAIL extends ValueExclusionResultType[] ? If<IsOmittable<VALUE_EXCLUSION_RESULTS_HEAD>, OmittableExcludedItems<VALUE_EXCLUSION_RESULTS_TAIL, [
|
|
466
|
+
...RESULT,
|
|
467
|
+
VALUE_EXCLUSION_RESULTS_HEAD
|
|
468
|
+
]>, OmittableExcludedItems<VALUE_EXCLUSION_RESULTS_TAIL, RESULT>> : never : never : RESULT;
|
|
469
|
+
declare type RequiredExcludedItems<ITEM_EXCLUSION_RESULTS extends ValueExclusionResultType[], RESULT extends Type[] = []> = ITEM_EXCLUSION_RESULTS extends [
|
|
470
|
+
infer VALUE_EXCLUSION_RESULTS_HEAD,
|
|
471
|
+
...infer VALUE_EXCLUSION_RESULTS_TAIL
|
|
472
|
+
] ? VALUE_EXCLUSION_RESULTS_HEAD extends ValueExclusionResultType ? VALUE_EXCLUSION_RESULTS_TAIL extends ValueExclusionResultType[] ? IsOmittable<VALUE_EXCLUSION_RESULTS_HEAD> extends true ? RESULT : RequiredExcludedItems<VALUE_EXCLUSION_RESULTS_TAIL, [
|
|
473
|
+
...RESULT,
|
|
474
|
+
SourceValue<VALUE_EXCLUSION_RESULTS_HEAD>
|
|
475
|
+
]> : never : never : RESULT;
|
|
476
|
+
declare type ExcludeConst<META_TUPLE extends TupleType, META_CONST extends ConstType, META_CONST_VALUE = ConstValue<META_CONST>> = META_CONST_VALUE extends unknown[] ? _Exclude<META_TUPLE, $Tuple<ExtractConstValues<META_CONST_VALUE>, Never, IsSerialized<META_CONST>, Deserialized<META_CONST>>> : META_TUPLE;
|
|
477
|
+
declare type ExtractConstValues<CONST_VALUES extends unknown[], RESULT extends unknown[] = []> = CONST_VALUES extends [infer CONST_VALUES_HEAD, ...infer CONST_VALUES_TAIL] ? ExtractConstValues<CONST_VALUES_TAIL, [...RESULT, Const<CONST_VALUES_HEAD>]> : RESULT;
|
|
478
|
+
|
|
479
|
+
declare type _Exclude<META_TYPE_A extends Type, META_TYPE_B extends Type> = _$Exclude<META_TYPE_A, META_TYPE_B>;
|
|
480
|
+
declare type _$Exclude<META_TYPE_A, META_TYPE_B> = META_TYPE_A extends NeverType ? META_TYPE_A : META_TYPE_A extends AnyType ? ExcludeFromAny<META_TYPE_A, META_TYPE_B> : META_TYPE_A extends ConstType ? ExcludeFromConst<META_TYPE_A, META_TYPE_B> : META_TYPE_A extends EnumType ? ExcludeFromEnum<META_TYPE_A, META_TYPE_B> : META_TYPE_A extends PrimitiveType ? ExcludeFromPrimitive<META_TYPE_A, META_TYPE_B> : META_TYPE_A extends ArrayType ? ExcludeFromArray<META_TYPE_A, META_TYPE_B> : META_TYPE_A extends TupleType ? ExcludeFromTuple<META_TYPE_A, META_TYPE_B> : META_TYPE_A extends ObjectType ? ExcludeFromObject<META_TYPE_A, META_TYPE_B> : META_TYPE_A extends UnionType ? ExcludeFromUnion<META_TYPE_A, META_TYPE_B> : Never;
|
|
481
|
+
|
|
482
|
+
type DeserializationPattern = Readonly<{
|
|
483
|
+
pattern: unknown;
|
|
484
|
+
output: unknown;
|
|
485
|
+
}>;
|
|
486
|
+
|
|
487
|
+
declare const $JSONSchema: unique symbol;
|
|
488
|
+
type $JSONSchema = typeof $JSONSchema;
|
|
489
|
+
type JSONSchemaType = "string" | "number" | "integer" | "boolean" | "object" | "array" | "null";
|
|
490
|
+
type JSONSchema = boolean | Readonly<{
|
|
491
|
+
[$JSONSchema]?: $JSONSchema;
|
|
492
|
+
$id?: string | undefined;
|
|
493
|
+
$ref?: string | undefined;
|
|
494
|
+
$schema?: string | undefined;
|
|
495
|
+
$comment?: string | undefined;
|
|
496
|
+
type?: JSONSchemaType | readonly JSONSchemaType[];
|
|
497
|
+
const?: unknown;
|
|
498
|
+
enum?: unknown;
|
|
499
|
+
multipleOf?: number | undefined;
|
|
500
|
+
maximum?: number | undefined;
|
|
501
|
+
exclusiveMaximum?: number | undefined;
|
|
502
|
+
minimum?: number | undefined;
|
|
503
|
+
exclusiveMinimum?: number | undefined;
|
|
504
|
+
maxLength?: number | undefined;
|
|
505
|
+
minLength?: number | undefined;
|
|
506
|
+
pattern?: string | undefined;
|
|
507
|
+
items?: JSONSchema | readonly JSONSchema[];
|
|
508
|
+
additionalItems?: JSONSchema;
|
|
509
|
+
contains?: JSONSchema;
|
|
510
|
+
maxItems?: number | undefined;
|
|
511
|
+
minItems?: number | undefined;
|
|
512
|
+
uniqueItems?: boolean | undefined;
|
|
513
|
+
maxProperties?: number | undefined;
|
|
514
|
+
minProperties?: number | undefined;
|
|
515
|
+
required?: readonly string[];
|
|
516
|
+
properties?: Readonly<Record<string, JSONSchema>>;
|
|
517
|
+
patternProperties?: Readonly<Record<string, JSONSchema>>;
|
|
518
|
+
additionalProperties?: JSONSchema;
|
|
519
|
+
unevaluatedProperties?: JSONSchema;
|
|
520
|
+
dependencies?: Readonly<Record<string, JSONSchema | readonly string[]>>;
|
|
521
|
+
propertyNames?: JSONSchema;
|
|
522
|
+
if?: JSONSchema;
|
|
523
|
+
then?: JSONSchema;
|
|
524
|
+
else?: JSONSchema;
|
|
525
|
+
allOf?: readonly JSONSchema[];
|
|
526
|
+
anyOf?: readonly JSONSchema[];
|
|
527
|
+
oneOf?: readonly JSONSchema[];
|
|
528
|
+
not?: JSONSchema;
|
|
529
|
+
format?: string | undefined;
|
|
530
|
+
contentMediaType?: string | undefined;
|
|
531
|
+
contentEncoding?: string | undefined;
|
|
532
|
+
definitions?: Readonly<Record<string, JSONSchema>>;
|
|
533
|
+
title?: string | undefined;
|
|
534
|
+
description?: string | undefined;
|
|
535
|
+
default?: unknown;
|
|
536
|
+
readOnly?: boolean | undefined;
|
|
537
|
+
writeOnly?: boolean | undefined;
|
|
538
|
+
examples?: readonly unknown[];
|
|
539
|
+
nullable?: boolean;
|
|
540
|
+
}>;
|
|
541
|
+
type JSONSchemaReference = JSONSchema & Readonly<{
|
|
542
|
+
$id: string;
|
|
543
|
+
}>;
|
|
544
|
+
|
|
545
|
+
type FromSchemaOptions = {
|
|
546
|
+
parseNotKeyword?: boolean;
|
|
547
|
+
parseIfThenElseKeywords?: boolean;
|
|
548
|
+
keepDefaultedPropertiesOptional?: boolean;
|
|
549
|
+
references?: JSONSchemaReference[] | false;
|
|
550
|
+
deserialize?: DeserializationPattern[] | false;
|
|
551
|
+
};
|
|
552
|
+
type FromSchemaDefaultOptions = {
|
|
553
|
+
parseNotKeyword: false;
|
|
554
|
+
parseIfThenElseKeywords: false;
|
|
555
|
+
keepDefaultedPropertiesOptional: false;
|
|
556
|
+
references: false;
|
|
557
|
+
deserialize: false;
|
|
558
|
+
};
|
|
559
|
+
|
|
560
|
+
type IndexReferencesById<SCHEMA_REFERENCES extends readonly JSONSchemaReference[]> = {
|
|
561
|
+
[REF_SCHEMA in SCHEMA_REFERENCES[number] as REF_SCHEMA["$id"]]: REF_SCHEMA;
|
|
562
|
+
};
|
|
563
|
+
type ParseOptions<ROOT_SCHEMA extends JSONSchema, OPTIONS extends FromSchemaOptions> = {
|
|
564
|
+
parseNotKeyword: OPTIONS["parseNotKeyword"] extends boolean ? OPTIONS["parseNotKeyword"] : FromSchemaDefaultOptions["parseNotKeyword"];
|
|
565
|
+
parseIfThenElseKeywords: OPTIONS["parseIfThenElseKeywords"] extends boolean ? OPTIONS["parseIfThenElseKeywords"] : FromSchemaDefaultOptions["parseIfThenElseKeywords"];
|
|
566
|
+
keepDefaultedPropertiesOptional: OPTIONS["keepDefaultedPropertiesOptional"] extends boolean ? OPTIONS["keepDefaultedPropertiesOptional"] : FromSchemaDefaultOptions["keepDefaultedPropertiesOptional"];
|
|
567
|
+
rootSchema: ROOT_SCHEMA;
|
|
568
|
+
references: OPTIONS["references"] extends JSONSchemaReference[] ? IndexReferencesById<OPTIONS["references"]> : {};
|
|
569
|
+
deserialize: OPTIONS["deserialize"] extends DeserializationPattern[] | false ? OPTIONS["deserialize"] : FromSchemaDefaultOptions["deserialize"];
|
|
570
|
+
};
|
|
571
|
+
|
|
572
|
+
type And<CONDITION_A, CONDITION_B> = CONDITION_A extends true ? CONDITION_B extends true ? true : false : false;
|
|
573
|
+
|
|
574
|
+
type DoesExtend<TYPE_A, TYPE_B> = [TYPE_A] extends [TYPE_B] ? true : false;
|
|
575
|
+
|
|
576
|
+
type DeepGet<OBJECT, PATH extends string[], DEFAULT = undefined> = PATH extends [infer PATH_HEAD, ...infer PATH_TAIL] ? PATH_HEAD extends string ? PATH_TAIL extends string[] ? PATH_HEAD extends keyof OBJECT ? DeepGet<OBJECT[PATH_HEAD], PATH_TAIL, DEFAULT> : DEFAULT : never : never : OBJECT;
|
|
577
|
+
|
|
578
|
+
type Join<STRINGS extends string[], SEPARATOR extends string = ","> = STRINGS extends [] ? "" : STRINGS extends [string] ? `${STRINGS[0]}` : STRINGS extends [string, ...infer STRINGS_TAIL] ? STRINGS_TAIL extends string[] ? `${STRINGS[0]}${SEPARATOR}${Join<STRINGS_TAIL, SEPARATOR>}` : never : string;
|
|
579
|
+
|
|
580
|
+
type Not<BOOL> = BOOL extends false ? true : BOOL extends true ? false : never;
|
|
581
|
+
|
|
582
|
+
type Pop<ARRAY extends unknown[]> = ARRAY extends readonly [...infer ARRAY_BODY, unknown] | readonly [...infer ARRAY_BODY, unknown?] ? ARRAY_BODY : ARRAY;
|
|
583
|
+
|
|
584
|
+
type RecursiveSplit<STRING extends string, SEPARATOR extends string = ""> = STRING extends `${infer BEFORE}${SEPARATOR}${infer AFTER}` ? [BEFORE, ...RecursiveSplit<AFTER, SEPARATOR>] : [STRING];
|
|
585
|
+
type Split<STRING extends string, SEPARATOR extends string = "", RESULT extends string[] = RecursiveSplit<STRING, SEPARATOR>> = SEPARATOR extends "" ? Pop<RESULT> : RESULT;
|
|
586
|
+
|
|
587
|
+
type Tail<ARRAY extends unknown[]> = ARRAY extends readonly [] ? ARRAY : ARRAY extends readonly [unknown?, ...infer ARRAY_TAIL] ? ARRAY_TAIL : ARRAY;
|
|
588
|
+
|
|
589
|
+
type Writable<TYPE> = TYPE extends ((...args: unknown[]) => unknown) | Date | RegExp ? TYPE : TYPE extends ReadonlyMap<infer KEYS, infer VALUES> ? Map<Writable<KEYS>, Writable<VALUES>> : TYPE extends ReadonlySet<infer VALUES> ? Set<Writable<VALUES>> : TYPE extends ReadonlyArray<unknown> ? `${bigint}` extends `${keyof TYPE & any}` ? {
|
|
590
|
+
-readonly [KEY in keyof TYPE]: Writable<TYPE[KEY]>;
|
|
591
|
+
} : Writable<TYPE[number]>[] : TYPE extends object ? {
|
|
592
|
+
-readonly [KEY in keyof TYPE]: Writable<TYPE[KEY]>;
|
|
593
|
+
} : TYPE;
|
|
594
|
+
|
|
595
|
+
type RemoveInvalidAdditionalItems<SCHEMA extends JSONSchema> = SCHEMA extends Readonly<{
|
|
596
|
+
items: JSONSchema | readonly JSONSchema[];
|
|
597
|
+
}> ? SCHEMA extends Readonly<{
|
|
598
|
+
additionalItems: JSONSchema;
|
|
599
|
+
}> ? SCHEMA : SCHEMA & Readonly<{
|
|
600
|
+
additionalItems: true;
|
|
601
|
+
}> : SCHEMA extends boolean ? SCHEMA : Omit<SCHEMA, "additionalItems">;
|
|
602
|
+
type RemoveInvalidAdditionalProperties<SCHEMA extends JSONSchema> = SCHEMA extends Readonly<{
|
|
603
|
+
additionalProperties: JSONSchema;
|
|
604
|
+
}> ? SCHEMA extends Readonly<{
|
|
605
|
+
properties: Readonly<Record<string, JSONSchema>>;
|
|
606
|
+
}> ? SCHEMA : SCHEMA & Readonly<{
|
|
607
|
+
properties: {};
|
|
608
|
+
}> : SCHEMA extends boolean ? SCHEMA : Omit<SCHEMA, "additionalProperties">;
|
|
609
|
+
type MergeSubSchema<PARENT_SCHEMA extends JSONSchema, SUB_SCHEMA extends JSONSchema, CLEANED_SUB_SCHEMA extends JSONSchema = RemoveInvalidAdditionalProperties<RemoveInvalidAdditionalItems<SUB_SCHEMA>>> = Omit<PARENT_SCHEMA, keyof CLEANED_SUB_SCHEMA | "additionalProperties" | "patternProperties" | "unevaluatedProperties" | "required" | "additionalItems"> & CLEANED_SUB_SCHEMA;
|
|
610
|
+
|
|
611
|
+
type AllOfSchema = JSONSchema & Readonly<{
|
|
612
|
+
allOf: readonly JSONSchema[];
|
|
613
|
+
}>;
|
|
614
|
+
type ParseAllOfSchema<ALL_OF_SCHEMA extends AllOfSchema, OPTIONS extends ParseSchemaOptions> = RecurseOnAllOfSchema<ALL_OF_SCHEMA["allOf"], ALL_OF_SCHEMA, OPTIONS, ParseSchema<Omit<ALL_OF_SCHEMA, "allOf">, OPTIONS>>;
|
|
615
|
+
type RecurseOnAllOfSchema<SUB_SCHEMAS extends readonly JSONSchema[], ROOT_ALL_OF_SCHEMA extends AllOfSchema, OPTIONS extends ParseSchemaOptions, PARSED_ROOT_ALL_OF_SCHEMA> = SUB_SCHEMAS extends readonly [
|
|
616
|
+
infer SUB_SCHEMAS_HEAD,
|
|
617
|
+
...infer SUB_SCHEMAS_TAIL
|
|
618
|
+
] ? SUB_SCHEMAS_HEAD extends JSONSchema ? SUB_SCHEMAS_TAIL extends readonly JSONSchema[] ? RecurseOnAllOfSchema<SUB_SCHEMAS_TAIL, ROOT_ALL_OF_SCHEMA, OPTIONS, $Intersect<ParseSchema<MergeSubSchema<Omit<ROOT_ALL_OF_SCHEMA, "allOf">, SUB_SCHEMAS_HEAD>, OPTIONS>, PARSED_ROOT_ALL_OF_SCHEMA>> : never : never : PARSED_ROOT_ALL_OF_SCHEMA;
|
|
619
|
+
|
|
620
|
+
type AnyOfSchema = JSONSchema & Readonly<{
|
|
621
|
+
anyOf: readonly JSONSchema[];
|
|
622
|
+
}>;
|
|
623
|
+
type ParseAnyOfSchema<ANY_OF_SCHEMA extends AnyOfSchema, OPTIONS extends ParseSchemaOptions> = $Union<RecurseOnAnyOfSchema<ANY_OF_SCHEMA["anyOf"], ANY_OF_SCHEMA, OPTIONS>>;
|
|
624
|
+
type RecurseOnAnyOfSchema<SUB_SCHEMAS extends readonly JSONSchema[], ROOT_ANY_OF_SCHEMA extends AnyOfSchema, OPTIONS extends ParseSchemaOptions, RESULT = never> = SUB_SCHEMAS extends readonly [
|
|
625
|
+
infer SUB_SCHEMAS_HEAD,
|
|
626
|
+
...infer SUB_SCHEMAS_TAIL
|
|
627
|
+
] ? SUB_SCHEMAS_HEAD extends JSONSchema ? SUB_SCHEMAS_TAIL extends readonly JSONSchema[] ? RecurseOnAnyOfSchema<SUB_SCHEMAS_TAIL, ROOT_ANY_OF_SCHEMA, OPTIONS, RESULT | $Intersect<ParseSchema<Omit<ROOT_ANY_OF_SCHEMA, "anyOf">, OPTIONS>, ParseSchema<MergeSubSchema<Omit<ROOT_ANY_OF_SCHEMA, "anyOf">, SUB_SCHEMAS_HEAD>, OPTIONS>>> : never : never : RESULT;
|
|
628
|
+
|
|
629
|
+
type ConstSchema = JSONSchema & Readonly<{
|
|
630
|
+
const: unknown;
|
|
631
|
+
}>;
|
|
632
|
+
type ParseConstSchema<CONST_SCHEMA extends ConstSchema, OPTIONS extends ParseSchemaOptions> = $Intersect<ParseConst<CONST_SCHEMA>, ParseSchema<Omit<CONST_SCHEMA, "const">, OPTIONS>>;
|
|
633
|
+
type ParseConst<CONST_SCHEMA extends ConstSchema> = Const<Writable<CONST_SCHEMA["const"]>>;
|
|
634
|
+
|
|
635
|
+
type DeserializeSchema<SCHEMA extends JSONSchema, OPTIONS extends Omit<ParseSchemaOptions, "deserialize"> & {
|
|
636
|
+
deserialize: DeserializationPattern[];
|
|
637
|
+
}> = RecurseOnDeserializationPatterns<SCHEMA, OPTIONS["deserialize"]>;
|
|
638
|
+
type RecurseOnDeserializationPatterns<SCHEMA extends JSONSchema, DESERIALIZATION_PATTERNS extends DeserializationPattern[], RESULT = Any> = DESERIALIZATION_PATTERNS extends [
|
|
639
|
+
infer DESERIALIZATION_PATTERNS_HEAD,
|
|
640
|
+
...infer DESERIALIZATION_PATTERNS_TAIL
|
|
641
|
+
] ? DESERIALIZATION_PATTERNS_HEAD extends DeserializationPattern ? DESERIALIZATION_PATTERNS_TAIL extends DeserializationPattern[] ? RecurseOnDeserializationPatterns<SCHEMA, DESERIALIZATION_PATTERNS_TAIL, SCHEMA extends DESERIALIZATION_PATTERNS_HEAD["pattern"] ? $Intersect<Any<true, DESERIALIZATION_PATTERNS_HEAD["output"]>, RESULT> : RESULT> : never : never : RESULT;
|
|
642
|
+
|
|
643
|
+
type EnumSchema = JSONSchema & Readonly<{
|
|
644
|
+
enum: readonly unknown[];
|
|
645
|
+
}>;
|
|
646
|
+
type ParseEnumSchema<ENUM_SCHEMA extends EnumSchema, OPTIONS extends ParseSchemaOptions> = $Intersect<ParseEnum<ENUM_SCHEMA>, ParseSchema<Omit<ENUM_SCHEMA, "enum">, OPTIONS>>;
|
|
647
|
+
type ParseEnum<ENUM_SCHEMA extends EnumSchema> = Enum<Writable<ENUM_SCHEMA["enum"][number]>>;
|
|
648
|
+
|
|
649
|
+
type IfThenElseSchema = JSONSchema & {
|
|
650
|
+
if: JSONSchema;
|
|
651
|
+
then?: JSONSchema;
|
|
652
|
+
else?: JSONSchema;
|
|
653
|
+
};
|
|
654
|
+
type ParseIfThenElseSchema<IF_THEN_ELSE_SCHEMA extends IfThenElseSchema, OPTIONS extends ParseSchemaOptions, REST_SCHEMA extends JSONSchema = Omit<IF_THEN_ELSE_SCHEMA, "if" | "then" | "else">, IF_SCHEMA extends JSONSchema = MergeSubSchema<REST_SCHEMA, IF_THEN_ELSE_SCHEMA["if"]>, PARSED_THEN_SCHEMA = IF_THEN_ELSE_SCHEMA extends {
|
|
655
|
+
then: JSONSchema;
|
|
656
|
+
} ? $Intersect<ParseSchema<IF_SCHEMA, OPTIONS>, ParseSchema<MergeSubSchema<REST_SCHEMA, IF_THEN_ELSE_SCHEMA["then"]>, OPTIONS>> : ParseSchema<IF_SCHEMA, OPTIONS>, PARSED_ELSE_SCHEMA = IF_THEN_ELSE_SCHEMA extends {
|
|
657
|
+
else: JSONSchema;
|
|
658
|
+
} ? $Intersect<_$Exclude<ParseSchema<REST_SCHEMA, OPTIONS>, ParseSchema<IF_SCHEMA, OPTIONS>>, ParseSchema<MergeSubSchema<REST_SCHEMA, IF_THEN_ELSE_SCHEMA["else"]>, OPTIONS>> : _$Exclude<ParseSchema<REST_SCHEMA, OPTIONS>, ParseSchema<IF_SCHEMA, OPTIONS>>> = $Intersect<$Union<PARSED_THEN_SCHEMA | PARSED_ELSE_SCHEMA>, ParseSchema<REST_SCHEMA, OPTIONS>>;
|
|
659
|
+
|
|
660
|
+
type MultipleTypesSchema = JSONSchema & Readonly<{
|
|
661
|
+
type: readonly JSONSchemaType[];
|
|
662
|
+
}>;
|
|
663
|
+
type ParseMultipleTypesSchema<MULTI_TYPE_SCHEMA extends MultipleTypesSchema, OPTIONS extends ParseSchemaOptions> = $Union<RecurseOnMixedSchema<MULTI_TYPE_SCHEMA["type"], MULTI_TYPE_SCHEMA, OPTIONS>>;
|
|
664
|
+
type RecurseOnMixedSchema<TYPES extends readonly JSONSchemaType[], ROOT_MULTI_TYPE_SCHEMA extends MultipleTypesSchema, OPTIONS extends ParseSchemaOptions, RESULT = never> = TYPES extends readonly [infer TYPES_HEAD, ...infer TYPES_TAIL] ? TYPES_HEAD extends JSONSchemaType ? TYPES_TAIL extends readonly JSONSchemaType[] ? RecurseOnMixedSchema<TYPES_TAIL, ROOT_MULTI_TYPE_SCHEMA, OPTIONS, RESULT | ParseSchema<Omit<ROOT_MULTI_TYPE_SCHEMA, "type"> & {
|
|
665
|
+
type: TYPES_HEAD;
|
|
666
|
+
}, OPTIONS>> : never : never : RESULT;
|
|
667
|
+
|
|
668
|
+
type NotSchema = JSONSchema & Readonly<{
|
|
669
|
+
not: JSONSchema;
|
|
670
|
+
}>;
|
|
671
|
+
type AllTypes = Union<Primitive<null> | Primitive<boolean> | Primitive<number> | Primitive<string> | _Array | _Object<{}, never, Any>>;
|
|
672
|
+
type ParseNotSchema<NOT_SCHEMA extends NotSchema, OPTIONS extends ParseSchemaOptions, PARSED_REST_SCHEMA = ParseSchema<Omit<NOT_SCHEMA, "not">, OPTIONS>, EXCLUSION = _$Exclude<PARSED_REST_SCHEMA extends AnyType ? $Intersect<AllTypes, PARSED_REST_SCHEMA> : PARSED_REST_SCHEMA, ParseSchema<MergeSubSchema<Omit<NOT_SCHEMA, "not">, NOT_SCHEMA["not"]>, OPTIONS>>> = EXCLUSION extends Never ? PARSED_REST_SCHEMA : EXCLUSION;
|
|
673
|
+
|
|
674
|
+
type NullableSchema = JSONSchema & Readonly<{
|
|
675
|
+
nullable: boolean;
|
|
676
|
+
}>;
|
|
677
|
+
type ParseNullableSchema<NULLABLE_SCHEMA extends NullableSchema, OPTIONS extends ParseSchemaOptions, PARSED_REST_SCHEMA = ParseSchema<Omit<NULLABLE_SCHEMA, "nullable">, OPTIONS>> = NULLABLE_SCHEMA extends Readonly<{
|
|
678
|
+
nullable: true;
|
|
679
|
+
}> ? $Union<Primitive<null> | PARSED_REST_SCHEMA> : PARSED_REST_SCHEMA;
|
|
680
|
+
|
|
681
|
+
type OneOfSchema = JSONSchema & Readonly<{
|
|
682
|
+
oneOf: readonly JSONSchema[];
|
|
683
|
+
}>;
|
|
684
|
+
type ParseOneOfSchema<ONE_OF_SCHEMA extends OneOfSchema, OPTIONS extends ParseSchemaOptions> = $Union<RecurseOnOneOfSchema<ONE_OF_SCHEMA["oneOf"], ONE_OF_SCHEMA, OPTIONS>>;
|
|
685
|
+
type RecurseOnOneOfSchema<SUB_SCHEMAS extends readonly JSONSchema[], ROOT_ONE_OF_SCHEMA extends OneOfSchema, OPTIONS extends ParseSchemaOptions, RESULT = never> = SUB_SCHEMAS extends readonly [
|
|
686
|
+
infer SUB_SCHEMAS_HEAD,
|
|
687
|
+
...infer SUB_SCHEMAS_TAIL
|
|
688
|
+
] ? SUB_SCHEMAS_HEAD extends JSONSchema ? SUB_SCHEMAS_TAIL extends readonly JSONSchema[] ? RecurseOnOneOfSchema<SUB_SCHEMAS_TAIL, ROOT_ONE_OF_SCHEMA, OPTIONS, RESULT | $Intersect<ParseSchema<Omit<ROOT_ONE_OF_SCHEMA, "oneOf">, OPTIONS>, ParseSchema<MergeSubSchema<Omit<ROOT_ONE_OF_SCHEMA, "oneOf">, SUB_SCHEMAS_HEAD>, OPTIONS>>> : never : never : RESULT;
|
|
689
|
+
|
|
690
|
+
type ParseReference<SCHEMA extends JSONSchema, OPTIONS extends ParseSchemaOptions, REFERENCE_SOURCE extends JSONSchema, PATH_IN_SOURCE extends string | undefined, MATCHING_REFERENCE extends JSONSchema = PATH_IN_SOURCE extends string ? DeepGet<REFERENCE_SOURCE, Tail<Split<PATH_IN_SOURCE, "/">>, false> : REFERENCE_SOURCE> = $Intersect<ParseSchema<MATCHING_REFERENCE, OPTIONS>, ParseSchema<MergeSubSchema<MATCHING_REFERENCE, SCHEMA>, OPTIONS>>;
|
|
691
|
+
|
|
692
|
+
type ParseExternalReferenceSchema<REF_SCHEMA extends ReferencingSchema, OPTIONS extends ParseSchemaOptions, EXTERNAL_REFERENCE_ID extends string, SUB_PATH extends string | undefined> = OPTIONS["references"] extends {
|
|
693
|
+
[KEY in EXTERNAL_REFERENCE_ID]: JSONSchema;
|
|
694
|
+
} ? ParseReference<Omit<REF_SCHEMA, "$ref">, OPTIONS, OPTIONS["references"][EXTERNAL_REFERENCE_ID], SUB_PATH> : OPTIONS extends {
|
|
695
|
+
rootSchema: IdSchema;
|
|
696
|
+
} ? ParseExternalReferenceWithoutDirectorySchema<Omit<REF_SCHEMA, "$ref">, OPTIONS, EXTERNAL_REFERENCE_ID, SUB_PATH> : Never;
|
|
697
|
+
type ParseDirectory<REFERENCE extends string> = Join<Pop<Split<REFERENCE, "/">>, "/">;
|
|
698
|
+
type IdSchema = JSONSchema & {
|
|
699
|
+
$id: string;
|
|
700
|
+
};
|
|
701
|
+
type ParseExternalReferenceWithoutDirectorySchema<SUB_SCHEMA extends JSONSchema, OPTIONS extends ParseSchemaOptions & {
|
|
702
|
+
rootSchema: IdSchema;
|
|
703
|
+
}, EXTERNAL_REFERENCE_ID extends string, SUB_PATH extends string | undefined, DIRECTORY extends string = ParseDirectory<OPTIONS["rootSchema"]["$id"]>, COMPLETE_REFERENCE extends string = Join<[
|
|
704
|
+
DIRECTORY,
|
|
705
|
+
EXTERNAL_REFERENCE_ID
|
|
706
|
+
], "/">> = COMPLETE_REFERENCE extends keyof OPTIONS["references"] ? ParseReference<SUB_SCHEMA, OPTIONS, OPTIONS["references"][COMPLETE_REFERENCE], SUB_PATH> : Never;
|
|
707
|
+
|
|
708
|
+
type ParseInternalReferenceSchema<REFERENCING_SCHEMA extends ReferencingSchema, OPTIONS extends ParseSchemaOptions, PATH extends string> = ParseReference<Omit<REFERENCING_SCHEMA, "$ref">, OPTIONS, OPTIONS["rootSchema"], PATH>;
|
|
709
|
+
|
|
710
|
+
type ReferencingSchema = JSONSchema & {
|
|
711
|
+
$ref: string;
|
|
712
|
+
};
|
|
713
|
+
type ParseReferenceSchema<REFERENCING_SCHEMA extends ReferencingSchema, OPTIONS extends ParseSchemaOptions, REFERENCE_ID_AND_PATH extends string[] = Split<REFERENCING_SCHEMA["$ref"], "#">> = REFERENCE_ID_AND_PATH[0] extends "" ? ParseInternalReferenceSchema<REFERENCING_SCHEMA, OPTIONS, REFERENCE_ID_AND_PATH[1]> : ParseExternalReferenceSchema<REFERENCING_SCHEMA, OPTIONS, REFERENCE_ID_AND_PATH[0], REFERENCE_ID_AND_PATH[1]>;
|
|
714
|
+
|
|
715
|
+
type ArrayOrTupleSchema = JSONSchema & Readonly<{
|
|
716
|
+
type: "array";
|
|
717
|
+
}>;
|
|
718
|
+
type ArraySchema = Omit<JSONSchema, "items"> & Readonly<{
|
|
719
|
+
type: "array";
|
|
720
|
+
items: JSONSchema;
|
|
721
|
+
}>;
|
|
722
|
+
type TupleSchema = JSONSchema & Readonly<{
|
|
723
|
+
type: "array";
|
|
724
|
+
items: readonly JSONSchema[];
|
|
725
|
+
}>;
|
|
726
|
+
type ParseArrayOrTupleSchema<ARRAY_OR_TUPLE_SCHEMA extends ArrayOrTupleSchema, OPTIONS extends ParseSchemaOptions> = ARRAY_OR_TUPLE_SCHEMA extends ArraySchema ? _$Array<ParseSchema<ARRAY_OR_TUPLE_SCHEMA["items"], OPTIONS>> : ARRAY_OR_TUPLE_SCHEMA extends TupleSchema ? $Union<ApplyMinMaxAndAdditionalItems<ParseTupleItems<ARRAY_OR_TUPLE_SCHEMA["items"], OPTIONS>, ARRAY_OR_TUPLE_SCHEMA, OPTIONS>> : _$Array;
|
|
727
|
+
type ParseTupleItems<ITEM_SCHEMAS extends readonly JSONSchema[], OPTIONS extends ParseSchemaOptions> = ITEM_SCHEMAS extends readonly [
|
|
728
|
+
infer ITEM_SCHEMAS_HEAD,
|
|
729
|
+
...infer ITEM_SCHEMAS_TAIL
|
|
730
|
+
] ? ITEM_SCHEMAS_HEAD extends JSONSchema ? ITEM_SCHEMAS_TAIL extends readonly JSONSchema[] ? [
|
|
731
|
+
ParseSchema<ITEM_SCHEMAS_HEAD, OPTIONS>,
|
|
732
|
+
...ParseTupleItems<ITEM_SCHEMAS_TAIL, OPTIONS>
|
|
733
|
+
] : never : never : [];
|
|
734
|
+
type ApplyMinMaxAndAdditionalItems<PARSED_ITEM_SCHEMAS extends any[], ROOT_SCHEMA extends ArrayOrTupleSchema, OPTIONS extends ParseSchemaOptions> = ApplyAdditionalItems<ApplyMinMax<PARSED_ITEM_SCHEMAS, ROOT_SCHEMA extends Readonly<{
|
|
735
|
+
minItems: number;
|
|
736
|
+
}> ? ROOT_SCHEMA["minItems"] : 0, ROOT_SCHEMA extends Readonly<{
|
|
737
|
+
maxItems: number;
|
|
738
|
+
}> ? ROOT_SCHEMA["maxItems"] : undefined>, ROOT_SCHEMA extends Readonly<{
|
|
739
|
+
additionalItems: JSONSchema;
|
|
740
|
+
}> ? ROOT_SCHEMA["additionalItems"] : true, OPTIONS>;
|
|
741
|
+
type ApplyMinMax<RECURSED_PARSED_ITEM_SCHEMAS extends any[], MIN extends number, MAX extends number | undefined, RESULT = never, HAS_ENCOUNTERED_MIN extends boolean = false, HAS_ENCOUNTERED_MAX extends boolean = false, INITIAL_PARSED_ITEM_SCHEMAS extends any[] = RECURSED_PARSED_ITEM_SCHEMAS> = And<Not<DoesExtend<MIN, RECURSED_PARSED_ITEM_SCHEMAS["length"]>>, DoesExtend<RECURSED_PARSED_ITEM_SCHEMAS, [any, ...any[]]>> extends true ? RECURSED_PARSED_ITEM_SCHEMAS extends [
|
|
742
|
+
...infer RECURSED_PARSED_ITEM_SCHEMAS_BODY,
|
|
743
|
+
unknown
|
|
744
|
+
] ? ApplyMinMax<RECURSED_PARSED_ITEM_SCHEMAS_BODY, MIN, MAX, RECURSED_PARSED_ITEM_SCHEMAS["length"] extends MAX ? $Tuple<RECURSED_PARSED_ITEM_SCHEMAS> : RESULT | $Tuple<RECURSED_PARSED_ITEM_SCHEMAS>, HAS_ENCOUNTERED_MIN extends true ? true : DoesExtend<MIN, RECURSED_PARSED_ITEM_SCHEMAS["length"]>, HAS_ENCOUNTERED_MAX extends true ? true : DoesExtend<MAX, RECURSED_PARSED_ITEM_SCHEMAS["length"]>, INITIAL_PARSED_ITEM_SCHEMAS> : never : {
|
|
745
|
+
result: MAX extends undefined ? RESULT | $Tuple<RECURSED_PARSED_ITEM_SCHEMAS> : HAS_ENCOUNTERED_MAX extends true ? RESULT | $Tuple<RECURSED_PARSED_ITEM_SCHEMAS> : MAX extends RECURSED_PARSED_ITEM_SCHEMAS["length"] ? $Tuple<RECURSED_PARSED_ITEM_SCHEMAS> : IsLongerThan<Tail<RECURSED_PARSED_ITEM_SCHEMAS>, MAX> extends true ? never : RESULT | $Tuple<RECURSED_PARSED_ITEM_SCHEMAS>;
|
|
746
|
+
hasEncounteredMin: DoesExtend<MIN, RECURSED_PARSED_ITEM_SCHEMAS["length"]>;
|
|
747
|
+
hasEncounteredMax: HAS_ENCOUNTERED_MAX extends true ? true : MAX extends RECURSED_PARSED_ITEM_SCHEMAS["length"] ? true : IsLongerThan<Tail<RECURSED_PARSED_ITEM_SCHEMAS>, MAX>;
|
|
748
|
+
completeTuple: INITIAL_PARSED_ITEM_SCHEMAS;
|
|
749
|
+
};
|
|
750
|
+
type IsLongerThan<TUPLE extends any[], LENGTH extends number | undefined, RESULT extends boolean = false> = LENGTH extends undefined ? false : TUPLE["length"] extends LENGTH ? true : TUPLE extends [any, ...infer TUPLE_TAIL] ? IsLongerThan<TUPLE_TAIL, LENGTH> : RESULT;
|
|
751
|
+
type ApplyAdditionalItems<APPLY_MIN_MAX_RESULT extends {
|
|
752
|
+
result: any;
|
|
753
|
+
hasEncounteredMin: boolean;
|
|
754
|
+
hasEncounteredMax: boolean;
|
|
755
|
+
completeTuple: any[];
|
|
756
|
+
}, ADDITIONAL_ITEMS_SCHEMA extends JSONSchema, OPTIONS extends ParseSchemaOptions> = APPLY_MIN_MAX_RESULT extends {
|
|
757
|
+
hasEncounteredMax: true;
|
|
758
|
+
} ? APPLY_MIN_MAX_RESULT extends {
|
|
759
|
+
hasEncounteredMin: true;
|
|
760
|
+
} ? APPLY_MIN_MAX_RESULT["result"] : Never : ADDITIONAL_ITEMS_SCHEMA extends false ? APPLY_MIN_MAX_RESULT extends {
|
|
761
|
+
hasEncounteredMin: true;
|
|
762
|
+
} ? APPLY_MIN_MAX_RESULT["result"] : Never : ADDITIONAL_ITEMS_SCHEMA extends true ? APPLY_MIN_MAX_RESULT extends {
|
|
763
|
+
hasEncounteredMin: true;
|
|
764
|
+
} ? APPLY_MIN_MAX_RESULT["result"] | $Tuple<APPLY_MIN_MAX_RESULT["completeTuple"], Any> : $Tuple<APPLY_MIN_MAX_RESULT["completeTuple"], Any> : APPLY_MIN_MAX_RESULT extends {
|
|
765
|
+
hasEncounteredMin: true;
|
|
766
|
+
} ? APPLY_MIN_MAX_RESULT["result"] | $Tuple<APPLY_MIN_MAX_RESULT["completeTuple"], ParseSchema<ADDITIONAL_ITEMS_SCHEMA, OPTIONS>> : $Tuple<APPLY_MIN_MAX_RESULT["completeTuple"], ParseSchema<ADDITIONAL_ITEMS_SCHEMA, OPTIONS>>;
|
|
767
|
+
|
|
768
|
+
type ObjectSchema = JSONSchema & Readonly<{
|
|
769
|
+
type: "object";
|
|
770
|
+
}>;
|
|
771
|
+
type ParseObjectSchema<OBJECT_SCHEMA extends ObjectSchema, OPTIONS extends ParseSchemaOptions> = OBJECT_SCHEMA extends Readonly<{
|
|
772
|
+
properties: Readonly<Record<string, JSONSchema>>;
|
|
773
|
+
}> ? _$Object<{
|
|
774
|
+
[KEY in keyof OBJECT_SCHEMA["properties"]]: ParseSchema<OBJECT_SCHEMA["properties"][KEY], OPTIONS>;
|
|
775
|
+
}, GetRequired<OBJECT_SCHEMA, OPTIONS>, GetOpenProps<OBJECT_SCHEMA, OPTIONS>, GetClosedOnResolve<OBJECT_SCHEMA>> : _$Object<{}, GetRequired<OBJECT_SCHEMA, OPTIONS>, GetOpenProps<OBJECT_SCHEMA, OPTIONS>, GetClosedOnResolve<OBJECT_SCHEMA>>;
|
|
776
|
+
type GetRequired<OBJECT_SCHEMA extends ObjectSchema, OPTIONS extends ParseSchemaOptions> = (OBJECT_SCHEMA extends Readonly<{
|
|
777
|
+
required: ReadonlyArray<string>;
|
|
778
|
+
}> ? OBJECT_SCHEMA["required"][number] : never) | (OPTIONS["keepDefaultedPropertiesOptional"] extends true ? never : OBJECT_SCHEMA extends Readonly<{
|
|
779
|
+
properties: Readonly<Record<string, JSONSchema>>;
|
|
780
|
+
}> ? {
|
|
781
|
+
[KEY in keyof OBJECT_SCHEMA["properties"] & string]: OBJECT_SCHEMA["properties"][KEY] extends Readonly<{
|
|
782
|
+
default: unknown;
|
|
783
|
+
}> ? KEY : never;
|
|
784
|
+
}[keyof OBJECT_SCHEMA["properties"] & string] : never);
|
|
785
|
+
type GetOpenProps<OBJECT_SCHEMA extends ObjectSchema, OPTIONS extends ParseSchemaOptions> = OBJECT_SCHEMA extends Readonly<{
|
|
786
|
+
additionalProperties: JSONSchema;
|
|
787
|
+
}> ? OBJECT_SCHEMA extends Readonly<{
|
|
788
|
+
patternProperties: Record<string, JSONSchema>;
|
|
789
|
+
}> ? AdditionalAndPatternProps<OBJECT_SCHEMA["additionalProperties"], OBJECT_SCHEMA["patternProperties"], OPTIONS> : ParseSchema<OBJECT_SCHEMA["additionalProperties"], OPTIONS> : OBJECT_SCHEMA extends Readonly<{
|
|
790
|
+
patternProperties: Record<string, JSONSchema>;
|
|
791
|
+
}> ? PatternProps<OBJECT_SCHEMA["patternProperties"], OPTIONS> : Any;
|
|
792
|
+
type GetClosedOnResolve<OBJECT_SCHEMA extends ObjectSchema> = OBJECT_SCHEMA extends Readonly<{
|
|
793
|
+
unevaluatedProperties: false;
|
|
794
|
+
}> ? true : false;
|
|
795
|
+
type PatternProps<PATTERN_PROPERTY_SCHEMAS extends Readonly<Record<string, JSONSchema>>, OPTIONS extends ParseSchemaOptions> = $Union<{
|
|
796
|
+
[KEY in keyof PATTERN_PROPERTY_SCHEMAS]: ParseSchema<PATTERN_PROPERTY_SCHEMAS[KEY], OPTIONS>;
|
|
797
|
+
}[keyof PATTERN_PROPERTY_SCHEMAS]>;
|
|
798
|
+
type AdditionalAndPatternProps<ADDITIONAL_PROPERTIES_SCHEMA extends JSONSchema, PATTERN_PROPERTY_SCHEMAS extends Readonly<Record<string, JSONSchema>>, OPTIONS extends ParseSchemaOptions> = ADDITIONAL_PROPERTIES_SCHEMA extends boolean ? PatternProps<PATTERN_PROPERTY_SCHEMAS, OPTIONS> : $Union<ParseSchema<ADDITIONAL_PROPERTIES_SCHEMA, OPTIONS> | {
|
|
799
|
+
[KEY in keyof PATTERN_PROPERTY_SCHEMAS]: ParseSchema<PATTERN_PROPERTY_SCHEMAS[KEY], OPTIONS>;
|
|
800
|
+
}[keyof PATTERN_PROPERTY_SCHEMAS]>;
|
|
801
|
+
|
|
802
|
+
type SingleTypeSchema = JSONSchema & Readonly<{
|
|
803
|
+
type: JSONSchemaType;
|
|
804
|
+
}>;
|
|
805
|
+
type ParseSingleTypeSchema<SINGLE_TYPE_SCHEMA extends SingleTypeSchema, OPTIONS extends ParseSchemaOptions> = SINGLE_TYPE_SCHEMA extends Readonly<{
|
|
806
|
+
type: "null";
|
|
807
|
+
}> ? Primitive<null> : SINGLE_TYPE_SCHEMA extends Readonly<{
|
|
808
|
+
type: "boolean";
|
|
809
|
+
}> ? Primitive<boolean> : SINGLE_TYPE_SCHEMA extends Readonly<{
|
|
810
|
+
type: "integer";
|
|
811
|
+
}> ? Primitive<number> : SINGLE_TYPE_SCHEMA extends Readonly<{
|
|
812
|
+
type: "number";
|
|
813
|
+
}> ? Primitive<number> : SINGLE_TYPE_SCHEMA extends Readonly<{
|
|
814
|
+
type: "string";
|
|
815
|
+
}> ? Primitive<string> : SINGLE_TYPE_SCHEMA extends ArrayOrTupleSchema ? ParseArrayOrTupleSchema<SINGLE_TYPE_SCHEMA, OPTIONS> : SINGLE_TYPE_SCHEMA extends ObjectSchema ? ParseObjectSchema<SINGLE_TYPE_SCHEMA, OPTIONS> : Never;
|
|
816
|
+
|
|
817
|
+
type ParseSchemaOptions = {
|
|
818
|
+
parseNotKeyword: boolean;
|
|
819
|
+
parseIfThenElseKeywords: boolean;
|
|
820
|
+
keepDefaultedPropertiesOptional: boolean;
|
|
821
|
+
rootSchema: JSONSchema;
|
|
822
|
+
references: Record<string, JSONSchema>;
|
|
823
|
+
deserialize: DeserializationPattern[] | false;
|
|
824
|
+
};
|
|
825
|
+
type ParseSchema<SCHEMA extends JSONSchema, OPTIONS extends ParseSchemaOptions, RESULT = JSONSchema extends SCHEMA ? Any : SCHEMA extends true | string ? Any : SCHEMA extends false ? Never : SCHEMA extends NullableSchema ? ParseNullableSchema<SCHEMA, OPTIONS> : SCHEMA extends ReferencingSchema ? ParseReferenceSchema<SCHEMA, OPTIONS> : And<DoesExtend<OPTIONS["parseIfThenElseKeywords"], true>, DoesExtend<SCHEMA, IfThenElseSchema>> extends true ? SCHEMA extends IfThenElseSchema ? ParseIfThenElseSchema<SCHEMA, OPTIONS> : never : And<DoesExtend<OPTIONS["parseNotKeyword"], true>, DoesExtend<SCHEMA, NotSchema>> extends true ? SCHEMA extends NotSchema ? ParseNotSchema<SCHEMA, OPTIONS> : never : SCHEMA extends AllOfSchema ? ParseAllOfSchema<SCHEMA, OPTIONS> : SCHEMA extends OneOfSchema ? ParseOneOfSchema<SCHEMA, OPTIONS> : SCHEMA extends AnyOfSchema ? ParseAnyOfSchema<SCHEMA, OPTIONS> : SCHEMA extends EnumSchema ? ParseEnumSchema<SCHEMA, OPTIONS> : SCHEMA extends ConstSchema ? ParseConstSchema<SCHEMA, OPTIONS> : SCHEMA extends MultipleTypesSchema ? ParseMultipleTypesSchema<SCHEMA, OPTIONS> : SCHEMA extends SingleTypeSchema ? ParseSingleTypeSchema<SCHEMA, OPTIONS> : Any> = OPTIONS extends {
|
|
826
|
+
deserialize: DeserializationPattern[];
|
|
827
|
+
} ? $Intersect<DeserializeSchema<SCHEMA, OPTIONS>, RESULT> : RESULT;
|
|
828
|
+
|
|
829
|
+
type FromSchema<SCHEMA extends JSONSchema, OPTIONS extends FromSchemaOptions = FromSchemaDefaultOptions> = $Resolve<ParseSchema<SCHEMA, ParseOptions<SCHEMA, OPTIONS>>>;
|
|
830
|
+
|
|
831
|
+
declare const schema$f: {
|
|
832
|
+
readonly $schema: "http://iglucentral.com/schemas/com.snowplowanalytics.self-desc/schema/jsonschema/1-0-0#";
|
|
833
|
+
readonly additionalProperties: true;
|
|
834
|
+
readonly description: "Schema for an answer list";
|
|
835
|
+
readonly minProperties: 1;
|
|
836
|
+
readonly properties: {
|
|
837
|
+
readonly items: {
|
|
838
|
+
readonly description: "A list of questions with answers";
|
|
839
|
+
readonly type: "array";
|
|
840
|
+
readonly items: {
|
|
841
|
+
readonly type: "object";
|
|
842
|
+
readonly description: "Questions and answers groups";
|
|
843
|
+
readonly properties: {
|
|
844
|
+
readonly question_id: {
|
|
845
|
+
readonly description: "The ID of the question being answered";
|
|
846
|
+
readonly type: "string";
|
|
847
|
+
readonly maxLength: 255;
|
|
848
|
+
};
|
|
849
|
+
readonly values: {
|
|
850
|
+
readonly description: "The values associated with the answer";
|
|
851
|
+
readonly type: "array";
|
|
852
|
+
readonly items: {
|
|
853
|
+
readonly type: "object";
|
|
854
|
+
readonly description: "The answer values";
|
|
855
|
+
readonly properties: {
|
|
856
|
+
readonly value: {
|
|
857
|
+
readonly description: "The answer value";
|
|
858
|
+
readonly type: readonly ["string", "number", "object", "boolean", "array", "null"];
|
|
859
|
+
readonly maxLength: 255;
|
|
860
|
+
readonly maximum: 9999999999;
|
|
861
|
+
readonly minimum: -9999999999;
|
|
862
|
+
};
|
|
863
|
+
};
|
|
864
|
+
readonly required: readonly ["value"];
|
|
865
|
+
};
|
|
866
|
+
};
|
|
867
|
+
readonly meta: {
|
|
868
|
+
readonly description: "Additional metadata";
|
|
869
|
+
readonly additionalProperties: true;
|
|
870
|
+
readonly type: readonly ["object", "null"];
|
|
871
|
+
};
|
|
872
|
+
};
|
|
873
|
+
readonly required: readonly ["question_id", "values"];
|
|
874
|
+
};
|
|
875
|
+
};
|
|
876
|
+
readonly meta: {
|
|
877
|
+
readonly description: "Additional metadata";
|
|
878
|
+
readonly additionalProperties: true;
|
|
879
|
+
readonly type: readonly ["object", "null"];
|
|
880
|
+
};
|
|
881
|
+
};
|
|
882
|
+
readonly required: readonly ["items"];
|
|
883
|
+
readonly self: {
|
|
884
|
+
readonly vendor: "dev.pckd";
|
|
885
|
+
readonly name: "answer_list";
|
|
886
|
+
readonly format: "jsonschema";
|
|
887
|
+
readonly version: "1-0-0";
|
|
888
|
+
};
|
|
889
|
+
readonly type: "object";
|
|
890
|
+
};
|
|
891
|
+
type Schema$f = FromSchema<typeof schema$f>;
|
|
892
|
+
type Version$f = typeof schema$f.self.version;
|
|
893
|
+
|
|
894
|
+
declare const name$f = "answer_list";
|
|
895
|
+
type CurrentSchema$f = Schema$f;
|
|
896
|
+
type CurrentVersion$f = Version$f;
|
|
897
|
+
type Url$f = SchemaUrl<typeof name$f, CurrentVersion$f>;
|
|
898
|
+
|
|
899
|
+
declare const schema$e: {
|
|
900
|
+
readonly $schema: "http://iglucentral.com/schemas/com.snowplowanalytics.self-desc/schema/jsonschema/1-0-0#";
|
|
901
|
+
readonly additionalProperties: true;
|
|
902
|
+
readonly description: "Schema for an app";
|
|
903
|
+
readonly minProperties: 1;
|
|
904
|
+
readonly properties: {
|
|
905
|
+
readonly organization_id: {
|
|
906
|
+
readonly description: "The organisation ID";
|
|
907
|
+
readonly type: "string";
|
|
908
|
+
readonly maxLength: 255;
|
|
909
|
+
};
|
|
910
|
+
readonly project_id: {
|
|
911
|
+
readonly description: "The project ID";
|
|
912
|
+
readonly type: "string";
|
|
913
|
+
readonly maxLength: 255;
|
|
914
|
+
};
|
|
915
|
+
readonly meta: {
|
|
916
|
+
readonly description: "Additional metadata";
|
|
917
|
+
readonly additionalProperties: true;
|
|
918
|
+
readonly type: readonly ["object", "null"];
|
|
919
|
+
};
|
|
920
|
+
};
|
|
921
|
+
readonly required: readonly ["organization_id", "project_id"];
|
|
922
|
+
readonly self: {
|
|
923
|
+
readonly vendor: "dev.pckd";
|
|
924
|
+
readonly name: "app";
|
|
925
|
+
readonly format: "jsonschema";
|
|
926
|
+
readonly version: "1-0-0";
|
|
927
|
+
};
|
|
928
|
+
readonly type: "object";
|
|
929
|
+
};
|
|
930
|
+
type Schema$e = FromSchema<typeof schema$e>;
|
|
931
|
+
type Version$e = typeof schema$e.self.version;
|
|
932
|
+
|
|
933
|
+
declare const name$e = "app";
|
|
934
|
+
type CurrentSchema$e = Schema$e;
|
|
935
|
+
type CurrentVersion$e = Version$e;
|
|
936
|
+
type Url$e = SchemaUrl<typeof name$e, CurrentVersion$e>;
|
|
937
|
+
|
|
938
|
+
declare const schema$d: {
|
|
939
|
+
readonly $schema: "http://iglucentral.com/schemas/com.snowplowanalytics.self-desc/schema/jsonschema/1-0-0#";
|
|
940
|
+
readonly additionalProperties: true;
|
|
941
|
+
readonly description: "Schema for Convincely Funnel environment details";
|
|
942
|
+
readonly minProperties: 1;
|
|
943
|
+
readonly properties: {
|
|
944
|
+
readonly version: {
|
|
945
|
+
readonly description: "The version of the funnel";
|
|
946
|
+
readonly type: "string";
|
|
947
|
+
readonly maxLength: 255;
|
|
948
|
+
};
|
|
949
|
+
readonly meta: {
|
|
950
|
+
readonly description: "Additional metadata";
|
|
951
|
+
readonly additionalProperties: true;
|
|
952
|
+
readonly type: readonly ["object", "null"];
|
|
953
|
+
};
|
|
954
|
+
};
|
|
955
|
+
readonly required: readonly ["version"];
|
|
956
|
+
readonly self: {
|
|
957
|
+
readonly vendor: "dev.pckd";
|
|
958
|
+
readonly name: "cvly_funnel";
|
|
959
|
+
readonly format: "jsonschema";
|
|
960
|
+
readonly version: "1-0-0";
|
|
961
|
+
};
|
|
962
|
+
readonly type: "object";
|
|
963
|
+
};
|
|
964
|
+
type Schema$d = FromSchema<typeof schema$d>;
|
|
965
|
+
type Version$d = typeof schema$d.self.version;
|
|
966
|
+
|
|
967
|
+
declare const name$d = "cvly_funnel";
|
|
968
|
+
type CurrentSchema$d = Schema$d;
|
|
969
|
+
type CurrentVersion$d = Version$d;
|
|
970
|
+
type Url$d = SchemaUrl<typeof name$d, CurrentVersion$d>;
|
|
971
|
+
|
|
972
|
+
declare const schema$c: {
|
|
973
|
+
readonly $schema: "http://iglucentral.com/schemas/com.snowplowanalytics.self-desc/schema/jsonschema/1-0-0#";
|
|
974
|
+
readonly additionalProperties: true;
|
|
975
|
+
readonly description: "Schema for CVLY-X environment details";
|
|
976
|
+
readonly minProperties: 1;
|
|
977
|
+
readonly properties: {
|
|
978
|
+
readonly git_commit_sha: {
|
|
979
|
+
readonly description: "The git commit SHA";
|
|
980
|
+
readonly type: "string";
|
|
981
|
+
readonly maxLength: 255;
|
|
982
|
+
};
|
|
983
|
+
readonly vercel_deployment_id: {
|
|
984
|
+
readonly description: "The Vercel deployment ID";
|
|
985
|
+
readonly type: "string";
|
|
986
|
+
readonly maxLength: 255;
|
|
987
|
+
};
|
|
988
|
+
readonly vercel_env: {
|
|
989
|
+
readonly description: "The Vercel environment";
|
|
990
|
+
readonly type: "string";
|
|
991
|
+
readonly maxLength: 255;
|
|
992
|
+
};
|
|
993
|
+
readonly vercel_url: {
|
|
994
|
+
readonly description: "The Vercel deployment URL";
|
|
995
|
+
readonly type: "string";
|
|
996
|
+
readonly maxLength: 255;
|
|
997
|
+
};
|
|
998
|
+
readonly meta: {
|
|
999
|
+
readonly description: "Additional metadata";
|
|
1000
|
+
readonly additionalProperties: true;
|
|
1001
|
+
readonly type: readonly ["object", "null"];
|
|
1002
|
+
};
|
|
1003
|
+
};
|
|
1004
|
+
readonly required: readonly ["git_commit_sha", "vercel_deployment_id", "vercel_env", "vercel_url"];
|
|
1005
|
+
readonly self: {
|
|
1006
|
+
readonly vendor: "dev.pckd";
|
|
1007
|
+
readonly name: "cvly_x";
|
|
1008
|
+
readonly format: "jsonschema";
|
|
1009
|
+
readonly version: "1-0-0";
|
|
1010
|
+
};
|
|
1011
|
+
readonly type: "object";
|
|
1012
|
+
};
|
|
1013
|
+
type Schema$c = FromSchema<typeof schema$c>;
|
|
1014
|
+
type Version$c = typeof schema$c.self.version;
|
|
1015
|
+
|
|
1016
|
+
declare const name$c = "cvly_x";
|
|
1017
|
+
type CurrentSchema$c = Schema$c;
|
|
1018
|
+
type CurrentVersion$c = Version$c;
|
|
1019
|
+
type Url$c = SchemaUrl<typeof name$c, CurrentVersion$c>;
|
|
1020
|
+
|
|
1021
|
+
declare const schema$b: {
|
|
1022
|
+
readonly $schema: "http://iglucentral.com/schemas/com.snowplowanalytics.self-desc/schema/jsonschema/1-0-0#";
|
|
1023
|
+
readonly additionalProperties: true;
|
|
1024
|
+
readonly description: "Schema for an element";
|
|
1025
|
+
readonly minProperties: 1;
|
|
1026
|
+
readonly properties: {
|
|
1027
|
+
readonly id: {
|
|
1028
|
+
readonly description: "The ID of the element";
|
|
1029
|
+
readonly type: readonly ["string", "null"];
|
|
1030
|
+
readonly maxLength: 255;
|
|
1031
|
+
};
|
|
1032
|
+
readonly text: {
|
|
1033
|
+
readonly description: "The text content of the element";
|
|
1034
|
+
readonly type: readonly ["string", "null"];
|
|
1035
|
+
readonly maxLength: 255;
|
|
1036
|
+
};
|
|
1037
|
+
readonly node_type: {
|
|
1038
|
+
readonly description: "The type of HTML node";
|
|
1039
|
+
readonly type: "string";
|
|
1040
|
+
readonly maxLength: 255;
|
|
1041
|
+
};
|
|
1042
|
+
readonly label: {
|
|
1043
|
+
readonly description: "The label for the element";
|
|
1044
|
+
readonly type: readonly ["string", "null"];
|
|
1045
|
+
readonly maxLength: 255;
|
|
1046
|
+
};
|
|
1047
|
+
readonly meta: {
|
|
1048
|
+
readonly description: "Additional metadata";
|
|
1049
|
+
readonly additionalProperties: true;
|
|
1050
|
+
readonly type: readonly ["object", "null"];
|
|
1051
|
+
};
|
|
1052
|
+
};
|
|
1053
|
+
readonly required: readonly ["node_type"];
|
|
1054
|
+
readonly self: {
|
|
1055
|
+
readonly vendor: "dev.pckd";
|
|
1056
|
+
readonly name: "element";
|
|
1057
|
+
readonly format: "jsonschema";
|
|
1058
|
+
readonly version: "1-0-0";
|
|
1059
|
+
};
|
|
1060
|
+
readonly type: "object";
|
|
1061
|
+
};
|
|
1062
|
+
type Schema$b = FromSchema<typeof schema$b>;
|
|
1063
|
+
type Version$b = typeof schema$b.self.version;
|
|
1064
|
+
|
|
1065
|
+
declare const name$b = "element";
|
|
1066
|
+
type CurrentSchema$b = Schema$b;
|
|
1067
|
+
type CurrentVersion$b = Version$b;
|
|
1068
|
+
type Url$b = SchemaUrl<typeof name$b, CurrentVersion$b>;
|
|
1069
|
+
|
|
1070
|
+
declare const schema$a: {
|
|
1071
|
+
readonly $schema: "http://iglucentral.com/schemas/com.snowplowanalytics.self-desc/schema/jsonschema/1-0-0#";
|
|
1072
|
+
readonly additionalProperties: true;
|
|
1073
|
+
readonly description: "Schema for an event";
|
|
1074
|
+
readonly minProperties: 1;
|
|
1075
|
+
readonly properties: {
|
|
1076
|
+
readonly type: {
|
|
1077
|
+
readonly description: "The type of event";
|
|
1078
|
+
readonly type: "string";
|
|
1079
|
+
readonly maxLength: 255;
|
|
1080
|
+
};
|
|
1081
|
+
readonly meta: {
|
|
1082
|
+
readonly description: "Additional metadata";
|
|
1083
|
+
readonly additionalProperties: true;
|
|
1084
|
+
readonly type: readonly ["object", "null"];
|
|
1085
|
+
};
|
|
1086
|
+
};
|
|
1087
|
+
readonly required: readonly ["type"];
|
|
1088
|
+
readonly self: {
|
|
1089
|
+
readonly vendor: "dev.pckd";
|
|
1090
|
+
readonly name: "event";
|
|
1091
|
+
readonly format: "jsonschema";
|
|
1092
|
+
readonly version: "1-0-0";
|
|
1093
|
+
};
|
|
1094
|
+
readonly type: "object";
|
|
1095
|
+
};
|
|
1096
|
+
type Schema$a = FromSchema<typeof schema$a>;
|
|
1097
|
+
type Version$a = typeof schema$a.self.version;
|
|
1098
|
+
|
|
1099
|
+
declare const name$a = "event";
|
|
1100
|
+
type CurrentSchema$a = Schema$a;
|
|
1101
|
+
type CurrentVersion$a = Version$a;
|
|
1102
|
+
type Url$a = SchemaUrl<typeof name$a, CurrentVersion$a>;
|
|
1103
|
+
|
|
1104
|
+
declare const schema$9: {
|
|
1105
|
+
readonly $schema: "http://iglucentral.com/schemas/com.snowplowanalytics.self-desc/schema/jsonschema/1-0-0#";
|
|
1106
|
+
readonly additionalProperties: true;
|
|
1107
|
+
readonly description: "Schema for an exception";
|
|
1108
|
+
readonly minProperties: 1;
|
|
1109
|
+
readonly properties: {
|
|
1110
|
+
readonly reason: {
|
|
1111
|
+
readonly description: "The reason for the exception";
|
|
1112
|
+
readonly type: "string";
|
|
1113
|
+
readonly maxLength: 255;
|
|
1114
|
+
};
|
|
1115
|
+
readonly meta: {
|
|
1116
|
+
readonly description: "Additional metadata";
|
|
1117
|
+
readonly additionalProperties: true;
|
|
1118
|
+
readonly type: readonly ["object", "null"];
|
|
1119
|
+
};
|
|
1120
|
+
};
|
|
1121
|
+
readonly required: readonly ["reason"];
|
|
1122
|
+
readonly self: {
|
|
1123
|
+
readonly vendor: "dev.pckd";
|
|
1124
|
+
readonly name: "exception";
|
|
1125
|
+
readonly format: "jsonschema";
|
|
1126
|
+
readonly version: "1-0-0";
|
|
1127
|
+
};
|
|
1128
|
+
readonly type: "object";
|
|
1129
|
+
};
|
|
1130
|
+
type Schema$9 = FromSchema<typeof schema$9>;
|
|
1131
|
+
type Version$9 = typeof schema$9.self.version;
|
|
1132
|
+
|
|
1133
|
+
declare const name$9 = "exception";
|
|
1134
|
+
type CurrentSchema$9 = Schema$9;
|
|
1135
|
+
type CurrentVersion$9 = Version$9;
|
|
1136
|
+
type Url$9 = SchemaUrl<typeof name$9, CurrentVersion$9>;
|
|
1137
|
+
|
|
1138
|
+
declare const schema$8: {
|
|
1139
|
+
readonly $schema: "http://iglucentral.com/schemas/com.snowplowanalytics.self-desc/schema/jsonschema/1-0-0#";
|
|
1140
|
+
readonly additionalProperties: true;
|
|
1141
|
+
readonly description: "Schema for an experience";
|
|
1142
|
+
readonly minProperties: 1;
|
|
1143
|
+
readonly properties: {
|
|
1144
|
+
readonly id: {
|
|
1145
|
+
readonly description: "The experience ID";
|
|
1146
|
+
readonly type: "string";
|
|
1147
|
+
readonly maxLength: 255;
|
|
1148
|
+
};
|
|
1149
|
+
readonly type: {
|
|
1150
|
+
readonly description: "The experience type";
|
|
1151
|
+
readonly type: "string";
|
|
1152
|
+
readonly maxLength: 255;
|
|
1153
|
+
};
|
|
1154
|
+
readonly title: {
|
|
1155
|
+
readonly description: "The experience title";
|
|
1156
|
+
readonly type: "string";
|
|
1157
|
+
readonly maxLength: 255;
|
|
1158
|
+
};
|
|
1159
|
+
readonly meta: {
|
|
1160
|
+
readonly description: "Additional metadata";
|
|
1161
|
+
readonly additionalProperties: true;
|
|
1162
|
+
readonly type: readonly ["object", "null"];
|
|
1163
|
+
};
|
|
1164
|
+
};
|
|
1165
|
+
readonly required: readonly ["id", "type", "title"];
|
|
1166
|
+
readonly self: {
|
|
1167
|
+
readonly vendor: "dev.pckd";
|
|
1168
|
+
readonly name: "experience";
|
|
1169
|
+
readonly format: "jsonschema";
|
|
1170
|
+
readonly version: "1-0-0";
|
|
1171
|
+
};
|
|
1172
|
+
readonly type: "object";
|
|
1173
|
+
};
|
|
1174
|
+
type Schema$8 = FromSchema<typeof schema$8>;
|
|
1175
|
+
type Version$8 = typeof schema$8.self.version;
|
|
1176
|
+
|
|
1177
|
+
declare const name$8 = "experience";
|
|
1178
|
+
type CurrentSchema$8 = Schema$8;
|
|
1179
|
+
type CurrentVersion$8 = Version$8;
|
|
1180
|
+
type Url$8 = SchemaUrl<typeof name$8, CurrentVersion$8>;
|
|
1181
|
+
|
|
1182
|
+
declare const schema$7: {
|
|
1183
|
+
readonly $schema: "http://iglucentral.com/schemas/com.snowplowanalytics.self-desc/schema/jsonschema/1-0-0#";
|
|
1184
|
+
readonly additionalProperties: true;
|
|
1185
|
+
readonly description: "Schema for a feature list";
|
|
1186
|
+
readonly minProperties: 1;
|
|
1187
|
+
readonly properties: {
|
|
1188
|
+
readonly items: {
|
|
1189
|
+
readonly description: "A list of features";
|
|
1190
|
+
readonly type: "array";
|
|
1191
|
+
readonly items: {
|
|
1192
|
+
readonly type: "object";
|
|
1193
|
+
readonly description: "Features enabled for the session";
|
|
1194
|
+
readonly properties: {
|
|
1195
|
+
readonly ab_feature: {
|
|
1196
|
+
readonly description: "The feature identifier";
|
|
1197
|
+
readonly type: "string";
|
|
1198
|
+
readonly maxLength: 255;
|
|
1199
|
+
};
|
|
1200
|
+
readonly ab_name: {
|
|
1201
|
+
readonly description: "The name of the A/B feature";
|
|
1202
|
+
readonly type: "string";
|
|
1203
|
+
readonly maxLength: 255;
|
|
1204
|
+
};
|
|
1205
|
+
readonly ab_key: {
|
|
1206
|
+
readonly description: "The key for the A/B feature";
|
|
1207
|
+
readonly type: "string";
|
|
1208
|
+
readonly maxLength: 255;
|
|
1209
|
+
};
|
|
1210
|
+
readonly ab_weight: {
|
|
1211
|
+
readonly description: "The weight of the A/B feature";
|
|
1212
|
+
readonly type: readonly ["number"];
|
|
1213
|
+
readonly maximum: 100;
|
|
1214
|
+
readonly minimum: 0;
|
|
1215
|
+
};
|
|
1216
|
+
readonly meta: {
|
|
1217
|
+
readonly description: "Additional metadata";
|
|
1218
|
+
readonly additionalProperties: true;
|
|
1219
|
+
readonly type: readonly ["object", "null"];
|
|
1220
|
+
};
|
|
1221
|
+
};
|
|
1222
|
+
readonly required: readonly ["ab_feature", "ab_name", "ab_key", "ab_weight"];
|
|
1223
|
+
};
|
|
1224
|
+
};
|
|
1225
|
+
readonly meta: {
|
|
1226
|
+
readonly description: "Additional metadata";
|
|
1227
|
+
readonly additionalProperties: true;
|
|
1228
|
+
readonly type: readonly ["object", "null"];
|
|
1229
|
+
};
|
|
1230
|
+
};
|
|
1231
|
+
readonly required: readonly ["items"];
|
|
1232
|
+
readonly self: {
|
|
1233
|
+
readonly vendor: "dev.pckd";
|
|
1234
|
+
readonly name: "feature_list";
|
|
1235
|
+
readonly format: "jsonschema";
|
|
1236
|
+
readonly version: "1-0-0";
|
|
1237
|
+
};
|
|
1238
|
+
readonly type: "object";
|
|
1239
|
+
};
|
|
1240
|
+
type Schema$7 = FromSchema<typeof schema$7>;
|
|
1241
|
+
type Version$7 = typeof schema$7.self.version;
|
|
1242
|
+
|
|
1243
|
+
declare const name$7 = "feature_list";
|
|
1244
|
+
type CurrentSchema$7 = Schema$7;
|
|
1245
|
+
type CurrentVersion$7 = Version$7;
|
|
1246
|
+
type Url$7 = SchemaUrl<typeof name$7, CurrentVersion$7>;
|
|
1247
|
+
|
|
1248
|
+
declare const schema$6: {
|
|
1249
|
+
readonly $schema: "http://iglucentral.com/schemas/com.snowplowanalytics.self-desc/schema/jsonschema/1-0-0#";
|
|
1250
|
+
readonly additionalProperties: true;
|
|
1251
|
+
readonly description: "Schema for a form";
|
|
1252
|
+
readonly minProperties: 1;
|
|
1253
|
+
readonly properties: {
|
|
1254
|
+
readonly id: {
|
|
1255
|
+
readonly description: "The ID of the form";
|
|
1256
|
+
readonly type: "string";
|
|
1257
|
+
readonly maxLength: 255;
|
|
1258
|
+
};
|
|
1259
|
+
readonly title: {
|
|
1260
|
+
readonly description: "The title of the form";
|
|
1261
|
+
readonly type: readonly ["string", "null"];
|
|
1262
|
+
readonly maxLength: 255;
|
|
1263
|
+
};
|
|
1264
|
+
readonly meta: {
|
|
1265
|
+
readonly description: "Additional metadata";
|
|
1266
|
+
readonly additionalProperties: true;
|
|
1267
|
+
readonly type: readonly ["object", "null"];
|
|
1268
|
+
};
|
|
1269
|
+
};
|
|
1270
|
+
readonly required: readonly ["id"];
|
|
1271
|
+
readonly self: {
|
|
1272
|
+
readonly vendor: "dev.pckd";
|
|
1273
|
+
readonly name: "form";
|
|
1274
|
+
readonly format: "jsonschema";
|
|
1275
|
+
readonly version: "1-0-0";
|
|
1276
|
+
};
|
|
1277
|
+
readonly type: "object";
|
|
1278
|
+
};
|
|
1279
|
+
type Schema$6 = FromSchema<typeof schema$6>;
|
|
1280
|
+
type Version$6 = typeof schema$6.self.version;
|
|
1281
|
+
|
|
1282
|
+
declare const name$6 = "form";
|
|
1283
|
+
type CurrentSchema$6 = Schema$6;
|
|
1284
|
+
type CurrentVersion$6 = Version$6;
|
|
1285
|
+
type Url$6 = SchemaUrl<typeof name$6, CurrentVersion$6>;
|
|
1286
|
+
|
|
1287
|
+
declare const schema$5: {
|
|
1288
|
+
readonly $schema: "http://iglucentral.com/schemas/com.snowplowanalytics.self-desc/schema/jsonschema/1-0-0#";
|
|
1289
|
+
readonly additionalProperties: true;
|
|
1290
|
+
readonly description: "Schema for a modal";
|
|
1291
|
+
readonly minProperties: 1;
|
|
1292
|
+
readonly properties: {
|
|
1293
|
+
readonly id: {
|
|
1294
|
+
readonly description: "The ID of the modal";
|
|
1295
|
+
readonly type: "string";
|
|
1296
|
+
readonly maxLength: 255;
|
|
1297
|
+
};
|
|
1298
|
+
readonly title: {
|
|
1299
|
+
readonly description: "The title of the modal";
|
|
1300
|
+
readonly type: "string";
|
|
1301
|
+
readonly maxLength: 255;
|
|
1302
|
+
};
|
|
1303
|
+
readonly meta: {
|
|
1304
|
+
readonly description: "Additional metadata";
|
|
1305
|
+
readonly additionalProperties: true;
|
|
1306
|
+
readonly type: readonly ["object", "null"];
|
|
1307
|
+
};
|
|
1308
|
+
};
|
|
1309
|
+
readonly required: readonly ["id", "title"];
|
|
1310
|
+
readonly self: {
|
|
1311
|
+
readonly vendor: "dev.pckd";
|
|
1312
|
+
readonly name: "modal";
|
|
1313
|
+
readonly format: "jsonschema";
|
|
1314
|
+
readonly version: "1-0-0";
|
|
1315
|
+
};
|
|
1316
|
+
readonly type: "object";
|
|
1317
|
+
};
|
|
1318
|
+
type Schema$5 = FromSchema<typeof schema$5>;
|
|
1319
|
+
type Version$5 = typeof schema$5.self.version;
|
|
1320
|
+
|
|
1321
|
+
declare const name$5 = "modal";
|
|
1322
|
+
type CurrentSchema$5 = Schema$5;
|
|
1323
|
+
type CurrentVersion$5 = Version$5;
|
|
1324
|
+
type Url$5 = SchemaUrl<typeof name$5, CurrentVersion$5>;
|
|
1325
|
+
|
|
1326
|
+
declare const schema$4: {
|
|
1327
|
+
readonly $schema: "http://iglucentral.com/schemas/com.snowplowanalytics.self-desc/schema/jsonschema/1-0-0#";
|
|
1328
|
+
readonly additionalProperties: true;
|
|
1329
|
+
readonly description: "Schema for Picked SDK";
|
|
1330
|
+
readonly minProperties: 1;
|
|
1331
|
+
readonly properties: {
|
|
1332
|
+
readonly sdk_version: {
|
|
1333
|
+
readonly description: "The SDK version";
|
|
1334
|
+
readonly type: "string";
|
|
1335
|
+
readonly maxLength: 255;
|
|
1336
|
+
};
|
|
1337
|
+
readonly meta: {
|
|
1338
|
+
readonly description: "Additional metadata";
|
|
1339
|
+
readonly additionalProperties: true;
|
|
1340
|
+
readonly type: readonly ["object", "null"];
|
|
1341
|
+
};
|
|
1342
|
+
};
|
|
1343
|
+
readonly required: readonly ["sdk_version"];
|
|
1344
|
+
readonly self: {
|
|
1345
|
+
readonly vendor: "dev.pckd";
|
|
1346
|
+
readonly name: "picked";
|
|
1347
|
+
readonly format: "jsonschema";
|
|
1348
|
+
readonly version: "1-0-0";
|
|
1349
|
+
};
|
|
1350
|
+
readonly type: "object";
|
|
1351
|
+
};
|
|
1352
|
+
type Schema$4 = FromSchema<typeof schema$4>;
|
|
1353
|
+
type Version$4 = typeof schema$4.self.version;
|
|
1354
|
+
|
|
1355
|
+
declare const name$4 = "picked";
|
|
1356
|
+
type CurrentSchema$4 = Schema$4;
|
|
1357
|
+
type CurrentVersion$4 = Version$4;
|
|
1358
|
+
type Url$4 = SchemaUrl<typeof name$4, CurrentVersion$4>;
|
|
1359
|
+
|
|
1360
|
+
declare const schema$3: {
|
|
1361
|
+
readonly $schema: "http://iglucentral.com/schemas/com.snowplowanalytics.self-desc/schema/jsonschema/1-0-0#";
|
|
1362
|
+
readonly additionalProperties: true;
|
|
1363
|
+
readonly description: "Schema for a product list";
|
|
1364
|
+
readonly minProperties: 1;
|
|
1365
|
+
readonly properties: {
|
|
1366
|
+
readonly title: {
|
|
1367
|
+
readonly description: "The title of the product list";
|
|
1368
|
+
readonly type: readonly ["string", "null"];
|
|
1369
|
+
readonly maxLength: 255;
|
|
1370
|
+
};
|
|
1371
|
+
readonly items: {
|
|
1372
|
+
readonly description: "A list of products";
|
|
1373
|
+
readonly type: "array";
|
|
1374
|
+
readonly items: {
|
|
1375
|
+
readonly type: "object";
|
|
1376
|
+
readonly description: "Products in the list";
|
|
1377
|
+
readonly properties: {
|
|
1378
|
+
readonly item_id: {
|
|
1379
|
+
readonly type: readonly ["string", "null"];
|
|
1380
|
+
readonly description: "The product ID";
|
|
1381
|
+
readonly maxLength: 255;
|
|
1382
|
+
};
|
|
1383
|
+
readonly item_name: {
|
|
1384
|
+
readonly type: readonly ["string", "null"];
|
|
1385
|
+
readonly description: "The product name";
|
|
1386
|
+
readonly maxLength: 255;
|
|
1387
|
+
};
|
|
1388
|
+
readonly affiliation: {
|
|
1389
|
+
readonly type: readonly ["string", "null"];
|
|
1390
|
+
readonly description: "The affiliation";
|
|
1391
|
+
readonly maxLength: 255;
|
|
1392
|
+
};
|
|
1393
|
+
readonly coupon: {
|
|
1394
|
+
readonly type: readonly ["string", "null"];
|
|
1395
|
+
readonly description: "The coupon code";
|
|
1396
|
+
readonly maxLength: 255;
|
|
1397
|
+
};
|
|
1398
|
+
readonly currency: {
|
|
1399
|
+
readonly type: readonly ["string", "null"];
|
|
1400
|
+
readonly description: "The currency";
|
|
1401
|
+
readonly maxLength: 255;
|
|
1402
|
+
};
|
|
1403
|
+
readonly creative_name: {
|
|
1404
|
+
readonly type: readonly ["string", "null"];
|
|
1405
|
+
readonly description: "The creative name";
|
|
1406
|
+
readonly maxLength: 255;
|
|
1407
|
+
};
|
|
1408
|
+
readonly creative_slot: {
|
|
1409
|
+
readonly type: readonly ["string", "null"];
|
|
1410
|
+
readonly description: "The creative slot";
|
|
1411
|
+
readonly maxLength: 255;
|
|
1412
|
+
};
|
|
1413
|
+
readonly discount: {
|
|
1414
|
+
readonly type: readonly ["number", "null"];
|
|
1415
|
+
readonly description: "The discount";
|
|
1416
|
+
readonly minimum: -9999999999;
|
|
1417
|
+
readonly maximum: 9999999999;
|
|
1418
|
+
};
|
|
1419
|
+
readonly index: {
|
|
1420
|
+
readonly type: readonly ["number", "null"];
|
|
1421
|
+
readonly description: "The index";
|
|
1422
|
+
readonly minimum: -9999999999;
|
|
1423
|
+
readonly maximum: 9999999999;
|
|
1424
|
+
};
|
|
1425
|
+
readonly item_brand: {
|
|
1426
|
+
readonly type: readonly ["string", "null"];
|
|
1427
|
+
readonly description: "The item brand";
|
|
1428
|
+
readonly maxLength: 255;
|
|
1429
|
+
};
|
|
1430
|
+
readonly item_category: {
|
|
1431
|
+
readonly type: readonly ["string", "null"];
|
|
1432
|
+
readonly description: "The item category";
|
|
1433
|
+
readonly maxLength: 255;
|
|
1434
|
+
};
|
|
1435
|
+
readonly item_category2: {
|
|
1436
|
+
readonly type: readonly ["string", "null"];
|
|
1437
|
+
readonly description: "The item category 2";
|
|
1438
|
+
readonly maxLength: 255;
|
|
1439
|
+
};
|
|
1440
|
+
readonly item_category3: {
|
|
1441
|
+
readonly type: readonly ["string", "null"];
|
|
1442
|
+
readonly description: "The item category 3";
|
|
1443
|
+
readonly maxLength: 255;
|
|
1444
|
+
};
|
|
1445
|
+
readonly item_category4: {
|
|
1446
|
+
readonly type: readonly ["string", "null"];
|
|
1447
|
+
readonly description: "The item category 4";
|
|
1448
|
+
readonly maxLength: 255;
|
|
1449
|
+
};
|
|
1450
|
+
readonly item_category5: {
|
|
1451
|
+
readonly type: readonly ["string", "null"];
|
|
1452
|
+
readonly description: "The item category 5";
|
|
1453
|
+
readonly maxLength: 255;
|
|
1454
|
+
};
|
|
1455
|
+
readonly item_list_id: {
|
|
1456
|
+
readonly type: readonly ["string", "null"];
|
|
1457
|
+
readonly description: "The item list ID";
|
|
1458
|
+
readonly maxLength: 255;
|
|
1459
|
+
};
|
|
1460
|
+
readonly item_list_name: {
|
|
1461
|
+
readonly type: readonly ["string", "null"];
|
|
1462
|
+
readonly description: "The item list";
|
|
1463
|
+
readonly maxLength: 255;
|
|
1464
|
+
};
|
|
1465
|
+
readonly item_variant: {
|
|
1466
|
+
readonly type: readonly ["string", "null"];
|
|
1467
|
+
readonly description: "The item variant";
|
|
1468
|
+
readonly maxLength: 255;
|
|
1469
|
+
};
|
|
1470
|
+
readonly location_id: {
|
|
1471
|
+
readonly type: readonly ["string", "null"];
|
|
1472
|
+
readonly description: "The location ID";
|
|
1473
|
+
readonly maxLength: 255;
|
|
1474
|
+
};
|
|
1475
|
+
readonly price: {
|
|
1476
|
+
readonly type: readonly ["number", "null"];
|
|
1477
|
+
readonly description: "The price";
|
|
1478
|
+
readonly minimum: -9999999999;
|
|
1479
|
+
readonly maximum: 9999999999;
|
|
1480
|
+
};
|
|
1481
|
+
readonly promotion_id: {
|
|
1482
|
+
readonly type: readonly ["string", "null"];
|
|
1483
|
+
readonly description: "The promotion ID";
|
|
1484
|
+
readonly maxLength: 255;
|
|
1485
|
+
};
|
|
1486
|
+
readonly promotion_name: {
|
|
1487
|
+
readonly type: readonly ["string", "null"];
|
|
1488
|
+
readonly description: "The promotion name";
|
|
1489
|
+
readonly maxLength: 255;
|
|
1490
|
+
};
|
|
1491
|
+
readonly quantity: {
|
|
1492
|
+
readonly type: readonly ["number", "null"];
|
|
1493
|
+
readonly description: "The quantity";
|
|
1494
|
+
readonly minimum: -9999999999;
|
|
1495
|
+
readonly maximum: 9999999999;
|
|
1496
|
+
};
|
|
1497
|
+
readonly meta: {
|
|
1498
|
+
readonly description: "Additional metadata";
|
|
1499
|
+
readonly additionalProperties: true;
|
|
1500
|
+
readonly type: readonly ["object", "null"];
|
|
1501
|
+
};
|
|
1502
|
+
};
|
|
1503
|
+
};
|
|
1504
|
+
};
|
|
1505
|
+
readonly meta: {
|
|
1506
|
+
readonly description: "Additional metadata";
|
|
1507
|
+
readonly additionalProperties: true;
|
|
1508
|
+
readonly type: readonly ["object", "null"];
|
|
1509
|
+
};
|
|
1510
|
+
};
|
|
1511
|
+
readonly required: readonly ["items"];
|
|
1512
|
+
readonly self: {
|
|
1513
|
+
readonly vendor: "dev.pckd";
|
|
1514
|
+
readonly name: "product_list";
|
|
1515
|
+
readonly format: "jsonschema";
|
|
1516
|
+
readonly version: "2-0-0";
|
|
1517
|
+
};
|
|
1518
|
+
readonly type: "object";
|
|
1519
|
+
};
|
|
1520
|
+
type Schema$3 = FromSchema<typeof schema$3>;
|
|
1521
|
+
type Version$3 = typeof schema$3.self.version;
|
|
1522
|
+
|
|
1523
|
+
declare const name$3 = "product_list";
|
|
1524
|
+
type CurrentSchema$3 = Schema$3;
|
|
1525
|
+
type CurrentVersion$3 = Version$3;
|
|
1526
|
+
type Url$3 = SchemaUrl<typeof name$3, CurrentVersion$3>;
|
|
1527
|
+
|
|
1528
|
+
declare const schema$2: {
|
|
1529
|
+
readonly $schema: "http://iglucentral.com/schemas/com.snowplowanalytics.self-desc/schema/jsonschema/1-0-0#";
|
|
1530
|
+
readonly additionalProperties: true;
|
|
1531
|
+
readonly description: "Schema for a question list";
|
|
1532
|
+
readonly minProperties: 1;
|
|
1533
|
+
readonly properties: {
|
|
1534
|
+
readonly items: {
|
|
1535
|
+
readonly description: "A list of questions";
|
|
1536
|
+
readonly type: "array";
|
|
1537
|
+
readonly items: {
|
|
1538
|
+
readonly type: "object";
|
|
1539
|
+
readonly description: "Questions in the list";
|
|
1540
|
+
readonly properties: {
|
|
1541
|
+
readonly id: {
|
|
1542
|
+
readonly description: "The question ID";
|
|
1543
|
+
readonly type: "string";
|
|
1544
|
+
readonly maxLength: 255;
|
|
1545
|
+
};
|
|
1546
|
+
readonly type: {
|
|
1547
|
+
readonly description: "The question type";
|
|
1548
|
+
readonly type: "string";
|
|
1549
|
+
readonly maxLength: 255;
|
|
1550
|
+
};
|
|
1551
|
+
readonly title: {
|
|
1552
|
+
readonly description: "The question title";
|
|
1553
|
+
readonly type: "string";
|
|
1554
|
+
readonly maxLength: 255;
|
|
1555
|
+
};
|
|
1556
|
+
readonly options: {
|
|
1557
|
+
readonly description: "The available options for the question";
|
|
1558
|
+
readonly type: readonly ["array", "null"];
|
|
1559
|
+
readonly items: {
|
|
1560
|
+
readonly type: "object";
|
|
1561
|
+
readonly description: "Options available as responses to the question";
|
|
1562
|
+
readonly properties: {
|
|
1563
|
+
readonly id: {
|
|
1564
|
+
readonly description: "The option ID";
|
|
1565
|
+
readonly type: "string";
|
|
1566
|
+
readonly maxLength: 255;
|
|
1567
|
+
};
|
|
1568
|
+
readonly title: {
|
|
1569
|
+
readonly description: "The option title";
|
|
1570
|
+
readonly type: "string";
|
|
1571
|
+
readonly maxLength: 255;
|
|
1572
|
+
};
|
|
1573
|
+
readonly value: {
|
|
1574
|
+
readonly description: "The answer value";
|
|
1575
|
+
readonly type: readonly ["string", "number", "object", "boolean", "array", "null"];
|
|
1576
|
+
readonly maxLength: 255;
|
|
1577
|
+
readonly maximum: 9999999999;
|
|
1578
|
+
readonly minimum: -9999999999;
|
|
1579
|
+
};
|
|
1580
|
+
readonly meta: {
|
|
1581
|
+
readonly description: "Additional metadata";
|
|
1582
|
+
readonly additionalProperties: true;
|
|
1583
|
+
readonly type: readonly ["object", "null"];
|
|
1584
|
+
};
|
|
1585
|
+
};
|
|
1586
|
+
readonly required: readonly ["id", "title", "value"];
|
|
1587
|
+
};
|
|
1588
|
+
};
|
|
1589
|
+
readonly meta: {
|
|
1590
|
+
readonly description: "Additional metadata";
|
|
1591
|
+
readonly additionalProperties: true;
|
|
1592
|
+
readonly type: readonly ["object", "null"];
|
|
1593
|
+
};
|
|
1594
|
+
};
|
|
1595
|
+
readonly required: readonly ["id", "type", "title"];
|
|
1596
|
+
};
|
|
1597
|
+
};
|
|
1598
|
+
readonly meta: {
|
|
1599
|
+
readonly description: "Additional metadata";
|
|
1600
|
+
readonly additionalProperties: true;
|
|
1601
|
+
readonly type: readonly ["object", "null"];
|
|
1602
|
+
};
|
|
1603
|
+
};
|
|
1604
|
+
readonly required: readonly ["items"];
|
|
1605
|
+
readonly self: {
|
|
1606
|
+
readonly vendor: "dev.pckd";
|
|
1607
|
+
readonly name: "question_list";
|
|
1608
|
+
readonly format: "jsonschema";
|
|
1609
|
+
readonly version: "1-0-0";
|
|
1610
|
+
};
|
|
1611
|
+
readonly type: "object";
|
|
1612
|
+
};
|
|
1613
|
+
type Schema$2 = FromSchema<typeof schema$2>;
|
|
1614
|
+
type Version$2 = typeof schema$2.self.version;
|
|
1615
|
+
|
|
1616
|
+
declare const name$2 = "question_list";
|
|
1617
|
+
type CurrentSchema$2 = Schema$2;
|
|
1618
|
+
type CurrentVersion$2 = Version$2;
|
|
1619
|
+
type Url$2 = SchemaUrl<typeof name$2, CurrentVersion$2>;
|
|
1620
|
+
|
|
1621
|
+
declare const schema$1: {
|
|
1622
|
+
readonly $schema: "http://iglucentral.com/schemas/com.snowplowanalytics.self-desc/schema/jsonschema/1-0-0#";
|
|
1623
|
+
readonly additionalProperties: true;
|
|
1624
|
+
readonly description: "Schema for a session";
|
|
1625
|
+
readonly minProperties: 1;
|
|
1626
|
+
readonly properties: {
|
|
1627
|
+
readonly id: {
|
|
1628
|
+
readonly description: "The session ID";
|
|
1629
|
+
readonly type: readonly ["string", "null"];
|
|
1630
|
+
readonly maxLength: 255;
|
|
1631
|
+
};
|
|
1632
|
+
readonly gaid: {
|
|
1633
|
+
readonly description: "The session Google Analytics Client ID";
|
|
1634
|
+
readonly type: readonly ["string", "null"];
|
|
1635
|
+
readonly maxLength: 255;
|
|
1636
|
+
};
|
|
1637
|
+
readonly meta: {
|
|
1638
|
+
readonly description: "Additional metadata";
|
|
1639
|
+
readonly additionalProperties: true;
|
|
1640
|
+
readonly type: readonly ["object", "null"];
|
|
1641
|
+
};
|
|
1642
|
+
};
|
|
1643
|
+
readonly self: {
|
|
1644
|
+
readonly vendor: "dev.pckd";
|
|
1645
|
+
readonly name: "session";
|
|
1646
|
+
readonly format: "jsonschema";
|
|
1647
|
+
readonly version: "1-0-1";
|
|
1648
|
+
};
|
|
1649
|
+
readonly type: "object";
|
|
1650
|
+
};
|
|
1651
|
+
type Schema$1 = FromSchema<typeof schema$1>;
|
|
1652
|
+
type Version$1 = typeof schema$1.self.version;
|
|
1653
|
+
|
|
1654
|
+
declare const name$1 = "session";
|
|
1655
|
+
type CurrentSchema$1 = Schema$1;
|
|
1656
|
+
type CurrentVersion$1 = Version$1;
|
|
1657
|
+
type Url$1 = SchemaUrl<typeof name$1, CurrentVersion$1>;
|
|
1658
|
+
|
|
1659
|
+
declare const schema: {
|
|
1660
|
+
readonly $schema: "http://iglucentral.com/schemas/com.snowplowanalytics.self-desc/schema/jsonschema/1-0-0#";
|
|
1661
|
+
readonly additionalProperties: true;
|
|
1662
|
+
readonly description: "Schema for a step";
|
|
1663
|
+
readonly minProperties: 1;
|
|
1664
|
+
readonly properties: {
|
|
1665
|
+
readonly id: {
|
|
1666
|
+
readonly description: "The step ID";
|
|
1667
|
+
readonly type: "string";
|
|
1668
|
+
readonly maxLength: 255;
|
|
1669
|
+
};
|
|
1670
|
+
readonly title: {
|
|
1671
|
+
readonly description: "The step title";
|
|
1672
|
+
readonly type: "string";
|
|
1673
|
+
readonly maxLength: 255;
|
|
1674
|
+
};
|
|
1675
|
+
readonly meta: {
|
|
1676
|
+
readonly description: "Additional metadata";
|
|
1677
|
+
readonly additionalProperties: true;
|
|
1678
|
+
readonly type: readonly ["object", "null"];
|
|
1679
|
+
};
|
|
1680
|
+
};
|
|
1681
|
+
readonly required: readonly ["id", "title"];
|
|
1682
|
+
readonly self: {
|
|
1683
|
+
readonly vendor: "dev.pckd";
|
|
1684
|
+
readonly name: "step";
|
|
1685
|
+
readonly format: "jsonschema";
|
|
1686
|
+
readonly version: "1-0-0";
|
|
1687
|
+
};
|
|
1688
|
+
readonly type: "object";
|
|
1689
|
+
};
|
|
1690
|
+
type Schema = FromSchema<typeof schema>;
|
|
1691
|
+
type Version = typeof schema.self.version;
|
|
1692
|
+
|
|
1693
|
+
declare const name = "step";
|
|
1694
|
+
type CurrentSchema = Schema;
|
|
1695
|
+
type CurrentVersion = Version;
|
|
1696
|
+
type Url = SchemaUrl<typeof name, CurrentVersion>;
|
|
1697
|
+
|
|
1698
|
+
type SnowplowSelfDescribingEvent = SelfDescribingEvent & CommonEventProperties;
|
|
1699
|
+
type SchemaUrl<Schema extends string, Version extends string> = `iglu:dev.pckd/${Schema}/jsonschema/${Version}`;
|
|
1700
|
+
interface Context<Url extends string, Schema extends Record<string, unknown>> {
|
|
1701
|
+
schema: Url;
|
|
1702
|
+
data: Schema;
|
|
1703
|
+
}
|
|
1704
|
+
type EventContext<T extends CurrentSchema$a> = Context<Url$a, T>;
|
|
1705
|
+
type TopLevelEvent<Type extends string> = EventContext<{
|
|
1706
|
+
type: Type;
|
|
1707
|
+
}>;
|
|
1708
|
+
type ContextItem = Context<string, Record<string, unknown>>;
|
|
1709
|
+
type ContextArray = ContextItem[];
|
|
1710
|
+
/**
|
|
1711
|
+
* Type representing an event with its required and conditional context.
|
|
1712
|
+
*
|
|
1713
|
+
* @template EventType - The event type.
|
|
1714
|
+
* @template RequiredContext - The required context for the event.
|
|
1715
|
+
* @template ConditionalContext - The conditional context for the event which should be supplied when available.
|
|
1716
|
+
*/
|
|
1717
|
+
interface SnowplowEventWithContext<EventType extends string, RequiredContext extends ContextArray, ConditionalContext extends ContextArray = []> {
|
|
1718
|
+
event: TopLevelEvent<EventType>;
|
|
1719
|
+
context: ConditionalContext extends ContextArray ? [...RequiredContext, ...Partial<ConditionalContext>[number][]] : RequiredContext;
|
|
1720
|
+
}
|
|
1721
|
+
type AnswerListContext = Context<Url$f, CurrentSchema$f>;
|
|
1722
|
+
type AppContext = Context<Url$e, CurrentSchema$e>;
|
|
1723
|
+
type CvlyFunnelContext = Context<Url$d, CurrentSchema$d>;
|
|
1724
|
+
type CvlyXContext = Context<Url$c, CurrentSchema$c>;
|
|
1725
|
+
type ElementContext = Context<Url$b, CurrentSchema$b>;
|
|
1726
|
+
type ExceptionContext = Context<Url$9, CurrentSchema$9>;
|
|
1727
|
+
type ExperienceContext = Context<Url$8, CurrentSchema$8>;
|
|
1728
|
+
type FeatureListContext = Context<Url$7, CurrentSchema$7>;
|
|
1729
|
+
type FormContext = Context<Url$6, CurrentSchema$6>;
|
|
1730
|
+
type ModalContext = Context<Url$5, CurrentSchema$5>;
|
|
1731
|
+
type PickedContext = Context<Url$4, CurrentSchema$4>;
|
|
1732
|
+
type ProductListContext = Context<Url$3, CurrentSchema$3>;
|
|
1733
|
+
type QuestionListContext = Context<Url$2, CurrentSchema$2>;
|
|
1734
|
+
type SessionContext = Context<Url$1, CurrentSchema$1>;
|
|
1735
|
+
type StepContext = Context<Url, CurrentSchema>;
|
|
1736
|
+
interface CreateTrackerOptions {
|
|
1737
|
+
/**
|
|
1738
|
+
* The application ID. Defaults to the value of VITE_SNOWPLOW_APP_ID.
|
|
1739
|
+
* @see https://docs.snowplow.io/docs/collecting-data/collecting-from-own-applications/javascript-trackers/web-tracker/tracker-setup/initialization-options/
|
|
1740
|
+
*/
|
|
1741
|
+
appId?: string;
|
|
1742
|
+
/**
|
|
1743
|
+
* The collector URL. Defaults to the value of VITE_SNOWPLOW_COLLECTOR_URL.
|
|
1744
|
+
* @see https://docs.snowplow.io/docs/collecting-data/collecting-from-own-applications/javascript-trackers/web-tracker/tracker-setup/initialization-options/
|
|
1745
|
+
*/
|
|
1746
|
+
collectorUrl?: string;
|
|
1747
|
+
/**
|
|
1748
|
+
* Enable activity tracking page pings
|
|
1749
|
+
* @see https://docs.snowplow.io/docs/collecting-data/collecting-from-own-applications/javascript-trackers/web-tracker/previous-versions/javascript-tracker-v3/tracking-events/#activity-tracking-page-pings
|
|
1750
|
+
*/
|
|
1751
|
+
trackActivity?: boolean;
|
|
1752
|
+
/**
|
|
1753
|
+
* Callback for activity tracking
|
|
1754
|
+
* @see https://docs.snowplow.io/docs/collecting-data/collecting-from-own-applications/javascript-trackers/web-tracker/previous-versions/javascript-tracker-v3/tracking-events/#enableactivitytrackingcallback
|
|
1755
|
+
*/
|
|
1756
|
+
trackActivityCallback?: (data: ActivityCallbackData) => void;
|
|
1757
|
+
/**
|
|
1758
|
+
* Attach the page view ID to all events
|
|
1759
|
+
* @see https://docs.snowplow.io/docs/collecting-data/collecting-from-own-applications/javascript-trackers/web-tracker/tracking-events/page-views/#webpage-page-view-id-context-entity
|
|
1760
|
+
*/
|
|
1761
|
+
trackWebPage?: boolean;
|
|
1762
|
+
/**
|
|
1763
|
+
* Attach the session to all events
|
|
1764
|
+
* @see https://docs.snowplow.io/docs/collecting-data/collecting-from-own-applications/javascript-trackers/web-tracker/tracking-events/session/
|
|
1765
|
+
*/
|
|
1766
|
+
trackSessions?: boolean;
|
|
1767
|
+
/**
|
|
1768
|
+
* Attach the browser context to all events
|
|
1769
|
+
* @see https://docs.snowplow.io/docs/collecting-data/collecting-from-own-applications/javascript-trackers/web-tracker/browsers/
|
|
1770
|
+
*/
|
|
1771
|
+
trackBrowser?: boolean;
|
|
1772
|
+
/**
|
|
1773
|
+
* Enable the error tracking plugin
|
|
1774
|
+
* @see https://docs.snowplow.io/docs/collecting-data/collecting-from-own-applications/javascript-trackers/web-tracker/tracking-events/errors/
|
|
1775
|
+
*/
|
|
1776
|
+
trackErrors?: boolean;
|
|
1777
|
+
/**
|
|
1778
|
+
* Enable the core web vitals tracking plugin
|
|
1779
|
+
* @see https://docs.snowplow.io/docs/collecting-data/collecting-from-own-applications/javascript-trackers/web-tracker/tracking-events/web-vitals/
|
|
1780
|
+
*/
|
|
1781
|
+
trackVitals?: boolean;
|
|
1782
|
+
/**
|
|
1783
|
+
* Enable the navigation performance tracking plugin
|
|
1784
|
+
* @see https://docs.snowplow.io/docs/collecting-data/collecting-from-own-applications/javascript-trackers/web-tracker/tracking-events/timings/
|
|
1785
|
+
*/
|
|
1786
|
+
trackPerformance?: boolean;
|
|
1787
|
+
/**
|
|
1788
|
+
* CSS selector allowlist for button click tracking
|
|
1789
|
+
* @see https://docs.snowplow.io/docs/collecting-data/collecting-from-own-applications/javascript-trackers/web-tracker/tracking-events/timings/
|
|
1790
|
+
*/
|
|
1791
|
+
trackButtonClickAllowList?: string[];
|
|
1792
|
+
/**
|
|
1793
|
+
* Filter function for button click tracking
|
|
1794
|
+
* @see https://docs.snowplow.io/docs/collecting-data/collecting-from-own-applications/javascript-trackers/web-tracker/tracking-events/button-click/#filter-function
|
|
1795
|
+
*/
|
|
1796
|
+
trackButtonClickFilter?: (element: HTMLElement) => boolean;
|
|
1797
|
+
/**
|
|
1798
|
+
* Parameters related to the CVLY-X environment
|
|
1799
|
+
*/
|
|
1800
|
+
cvlyX?: {
|
|
1801
|
+
/**
|
|
1802
|
+
* The Git commit SHA of the current deployment (GIT_COMMIT_SHA)
|
|
1803
|
+
*/
|
|
1804
|
+
gitCommitSha: string;
|
|
1805
|
+
/**
|
|
1806
|
+
* The Vercel deployment ID (VERCEL_DEPLOYMENT_ID)
|
|
1807
|
+
*/
|
|
1808
|
+
vercelDeploymentId: string;
|
|
1809
|
+
/**
|
|
1810
|
+
* The Vercel environment in which the application is running (e.g., production, preview, development) (VERCEL_ENV)
|
|
1811
|
+
*/
|
|
1812
|
+
vercelEnv: string;
|
|
1813
|
+
/**
|
|
1814
|
+
* The Vercel URL of the current deployment (VERCEL_URL)
|
|
1815
|
+
*/
|
|
1816
|
+
vercelUrl: string;
|
|
1817
|
+
};
|
|
1818
|
+
}
|
|
1819
|
+
interface AnalyticsExperience {
|
|
1820
|
+
id: string;
|
|
1821
|
+
type: string;
|
|
1822
|
+
title: string;
|
|
1823
|
+
}
|
|
1824
|
+
interface AnalyticsStep {
|
|
1825
|
+
id: string;
|
|
1826
|
+
title: string;
|
|
1827
|
+
}
|
|
1828
|
+
interface AnalyticsForm {
|
|
1829
|
+
id: string;
|
|
1830
|
+
title: string;
|
|
1831
|
+
}
|
|
1832
|
+
interface AnalyticsQuestionOption {
|
|
1833
|
+
id: string;
|
|
1834
|
+
title: string;
|
|
1835
|
+
value: string | number | Record<string, unknown> | boolean;
|
|
1836
|
+
}
|
|
1837
|
+
interface AnalyticsModal {
|
|
1838
|
+
id: string;
|
|
1839
|
+
title: string;
|
|
1840
|
+
}
|
|
1841
|
+
interface AnalyticsQuestion {
|
|
1842
|
+
id: string;
|
|
1843
|
+
type: 'input' | 'multiple-choice' | 'text';
|
|
1844
|
+
title: string;
|
|
1845
|
+
options?: AnalyticsQuestionOption[];
|
|
1846
|
+
}
|
|
1847
|
+
interface AnalyticsAnswer {
|
|
1848
|
+
questionId: string;
|
|
1849
|
+
values: (string | number | Record<string, unknown> | boolean)[];
|
|
1850
|
+
}
|
|
1851
|
+
interface AnalyticsAbConfig {
|
|
1852
|
+
feature: string;
|
|
1853
|
+
name: string;
|
|
1854
|
+
key: string;
|
|
1855
|
+
weight: number;
|
|
1856
|
+
}
|
|
1857
|
+
interface AnalyticsProduct {
|
|
1858
|
+
itemId?: string;
|
|
1859
|
+
itemName?: string;
|
|
1860
|
+
affiliation?: string;
|
|
1861
|
+
coupon?: string;
|
|
1862
|
+
currency?: string;
|
|
1863
|
+
creativeName?: string;
|
|
1864
|
+
creativeSlot?: string;
|
|
1865
|
+
discount?: number | string;
|
|
1866
|
+
index?: number | string;
|
|
1867
|
+
itemBrand?: string;
|
|
1868
|
+
itemCategory?: string;
|
|
1869
|
+
itemCategory2?: string;
|
|
1870
|
+
itemCategory3?: string;
|
|
1871
|
+
itemCategory4?: string;
|
|
1872
|
+
itemCategory5?: string;
|
|
1873
|
+
itemListId?: string;
|
|
1874
|
+
itemListName?: string;
|
|
1875
|
+
itemVariant?: string;
|
|
1876
|
+
locationId?: string;
|
|
1877
|
+
price?: number | string;
|
|
1878
|
+
promotionId?: string;
|
|
1879
|
+
promotionName?: string;
|
|
1880
|
+
quantity?: number | string;
|
|
1881
|
+
}
|
|
1882
|
+
interface AnalyticsException {
|
|
1883
|
+
reason: string;
|
|
1884
|
+
}
|
|
1885
|
+
interface AnalyticsEvent {
|
|
1886
|
+
sessionId?: string;
|
|
1887
|
+
projectId: string;
|
|
1888
|
+
organizationId: string;
|
|
1889
|
+
abConfig?: AnalyticsAbConfig[];
|
|
1890
|
+
experience?: AnalyticsExperience;
|
|
1891
|
+
step?: AnalyticsStep;
|
|
1892
|
+
form?: AnalyticsForm;
|
|
1893
|
+
questions?: AnalyticsQuestion[];
|
|
1894
|
+
answers?: AnalyticsAnswer[];
|
|
1895
|
+
modal?: AnalyticsModal;
|
|
1896
|
+
productList?: AnalyticsProduct[];
|
|
1897
|
+
exception?: AnalyticsException;
|
|
1898
|
+
}
|
|
1899
|
+
|
|
1900
|
+
declare function createTracker(options: CreateTrackerOptions): _snowplow_browser_tracker.BrowserTracker | null | undefined;
|
|
1901
|
+
|
|
1902
|
+
declare const trackAppCloseEvent: (eventPayload: AnalyticsEvent) => void;
|
|
1903
|
+
|
|
1904
|
+
declare const trackAppLoadEvent: (eventPayload: AnalyticsEvent) => void;
|
|
1905
|
+
|
|
1906
|
+
declare const trackAppOpenEvent: (eventPayload: AnalyticsEvent) => void;
|
|
1907
|
+
|
|
1908
|
+
declare const trackCartAddEvent: (eventPayload: AnalyticsEvent) => void;
|
|
1909
|
+
|
|
1910
|
+
declare const trackCartRemoveEvent: (eventPayload: AnalyticsEvent) => void;
|
|
1911
|
+
|
|
1912
|
+
declare const trackWishlistAddEvent: (eventPayload: AnalyticsEvent) => void;
|
|
1913
|
+
|
|
1914
|
+
declare const trackCheckoutCompleteEvent: (eventPayload: AnalyticsEvent) => void;
|
|
1915
|
+
|
|
1916
|
+
declare const trackExperienceLoadEvent: (eventPayload: AnalyticsEvent) => void;
|
|
1917
|
+
|
|
1918
|
+
declare const trackFieldValidationErrorEvent: (eventPayload: AnalyticsEvent) => void;
|
|
1919
|
+
|
|
1920
|
+
declare const trackFormSubmitEvent: (eventPayload: AnalyticsEvent) => void;
|
|
1921
|
+
|
|
1922
|
+
declare const trackFormSubmitErrorEvent: (eventPayload: AnalyticsEvent) => void;
|
|
1923
|
+
|
|
1924
|
+
declare const trackFormSubmitSuccessEvent: (eventPayload: AnalyticsEvent) => void;
|
|
1925
|
+
|
|
1926
|
+
declare const trackLeadCaptureEvent: (eventPayload: AnalyticsEvent) => void;
|
|
1927
|
+
|
|
1928
|
+
declare const trackModalCloseEvent: (eventPayload: AnalyticsEvent) => void;
|
|
1929
|
+
|
|
1930
|
+
declare const trackModalOpenEvent: (eventPayload: AnalyticsEvent) => void;
|
|
1931
|
+
|
|
1932
|
+
declare const trackPageViewEvent: (eventPayload: AnalyticsEvent) => void;
|
|
1933
|
+
|
|
1934
|
+
declare const trackProductViewDetailsEvent: (eventPayload: AnalyticsEvent) => void;
|
|
1935
|
+
|
|
1936
|
+
declare const trackRecommendationPresentEvent: (eventPayload: AnalyticsEvent) => void;
|
|
1937
|
+
|
|
1938
|
+
declare const trackStepComplete: (eventPayload: AnalyticsEvent) => void;
|
|
1939
|
+
|
|
1940
|
+
declare const trackStepEnterEvent: (eventPayload: AnalyticsEvent) => void;
|
|
1941
|
+
|
|
1942
|
+
declare const trackStepSubmitEvent: (eventPayload: AnalyticsEvent) => void;
|
|
1943
|
+
|
|
1944
|
+
declare const trackStepSubmitErrorEvent: (eventPayload: AnalyticsEvent) => void;
|
|
1945
|
+
|
|
1946
|
+
declare const trackStepSubmitSuccessEvent: (eventPayload: AnalyticsEvent) => void;
|
|
1947
|
+
|
|
1948
|
+
declare const trackSearchResultsListViewEvent: (eventPayload: AnalyticsEvent) => void;
|
|
1949
|
+
|
|
1950
|
+
declare const trackProductSelectEvent: (eventPayload: AnalyticsEvent) => void;
|
|
1951
|
+
|
|
1952
|
+
declare const trackProductListViewEvent: (eventPayload: AnalyticsEvent) => void;
|
|
1953
|
+
|
|
1954
|
+
declare function bindUserInteractionListeners(target: EventTarget): void;
|
|
1955
|
+
|
|
1956
|
+
export { type AnalyticsAbConfig, type AnalyticsAnswer, type AnalyticsEvent, type AnalyticsExperience, type AnalyticsProduct, type AnalyticsQuestion, type AnalyticsQuestionOption, type AnalyticsStep, type AnswerListContext, type AppContext, type Context, type ContextArray, type ContextItem, type CreateTrackerOptions, type CvlyFunnelContext, type CvlyXContext, type ElementContext, type ExceptionContext, type ExperienceContext, type FeatureListContext, type FormContext, type ModalContext, type PickedContext, type ProductListContext, type QuestionListContext, type SchemaUrl, type SessionContext, type SnowplowEventWithContext, type SnowplowSelfDescribingEvent, type StepContext, bindUserInteractionListeners, createTracker, trackAppCloseEvent, trackAppLoadEvent, trackAppOpenEvent, trackCartAddEvent, trackCartRemoveEvent, trackCheckoutCompleteEvent, trackExperienceLoadEvent, trackFieldValidationErrorEvent, trackFormSubmitErrorEvent, trackFormSubmitEvent, trackFormSubmitSuccessEvent, trackLeadCaptureEvent, trackModalCloseEvent, trackModalOpenEvent, trackPageViewEvent, trackProductListViewEvent, trackProductSelectEvent, trackProductViewDetailsEvent, trackRecommendationPresentEvent, trackSearchResultsListViewEvent, trackStepComplete, trackStepEnterEvent, trackStepSubmitErrorEvent, trackStepSubmitEvent, trackStepSubmitSuccessEvent, trackWishlistAddEvent };
|