@kaito-http/core 4.0.0-beta.2 → 4.0.0-beta.21
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/dist/chunk-TL3E52YN.js +835 -0
- package/dist/cors/cors.cjs +85 -17
- package/dist/cors/cors.d.cts +122 -26
- package/dist/cors/cors.d.ts +122 -26
- package/dist/cors/cors.js +85 -17
- package/dist/index.cjs +955 -85
- package/dist/index.d.cts +97 -104
- package/dist/index.d.ts +97 -104
- package/dist/index.js +140 -84
- package/dist/schema/schema.cjs +875 -0
- package/dist/schema/schema.d.cts +333 -0
- package/dist/schema/schema.d.ts +333 -0
- package/dist/schema/schema.js +38 -0
- package/dist/stream/stream.cjs +6 -9
- package/dist/stream/stream.d.cts +11 -8
- package/dist/stream/stream.d.ts +11 -8
- package/dist/stream/stream.js +6 -9
- package/package.json +6 -9
|
@@ -0,0 +1,333 @@
|
|
|
1
|
+
import { SchemaObject, ReferenceObject } from 'openapi3-ts/oas31';
|
|
2
|
+
|
|
3
|
+
type JSONPrimitive = string | number | boolean | null;
|
|
4
|
+
type JSONValue = JSONPrimitive | JSONValue[] | {
|
|
5
|
+
[key: string]: JSONValue;
|
|
6
|
+
};
|
|
7
|
+
declare function isPrimitiveJSONValue(value: unknown): value is JSONPrimitive;
|
|
8
|
+
interface BaseSchemaDef<Input extends JSONValue> {
|
|
9
|
+
example?: Input | undefined;
|
|
10
|
+
description?: string | undefined;
|
|
11
|
+
}
|
|
12
|
+
interface Issue {
|
|
13
|
+
message: string;
|
|
14
|
+
path: string[];
|
|
15
|
+
}
|
|
16
|
+
type ParseResult<T> = {
|
|
17
|
+
success: true;
|
|
18
|
+
result: T;
|
|
19
|
+
} | {
|
|
20
|
+
success: false;
|
|
21
|
+
issues: Set<Issue>;
|
|
22
|
+
};
|
|
23
|
+
declare class SchemaError extends Error {
|
|
24
|
+
readonly issues: Set<Issue>;
|
|
25
|
+
constructor(issues: Set<Issue>);
|
|
26
|
+
}
|
|
27
|
+
declare class ParseContext {
|
|
28
|
+
#private;
|
|
29
|
+
private static readonly ISSUE;
|
|
30
|
+
readonly ISSUE: typeof ParseContext.ISSUE;
|
|
31
|
+
addIssue(message: string, path: string[]): typeof ParseContext.ISSUE;
|
|
32
|
+
addIssues(issues: Iterable<Issue>, path: string[]): typeof ParseContext.ISSUE;
|
|
33
|
+
get issues(): Set<Issue>;
|
|
34
|
+
static result<T>(fn: (ctx: ParseContext) => T | typeof ParseContext.ISSUE): ParseResult<T>;
|
|
35
|
+
static with<T>(fn: (ctx: ParseContext) => T | typeof ParseContext.ISSUE): {
|
|
36
|
+
type: "FATAL";
|
|
37
|
+
issues: Set<Issue>;
|
|
38
|
+
data?: never;
|
|
39
|
+
} | {
|
|
40
|
+
type: "PARSED";
|
|
41
|
+
issues: Set<Issue>;
|
|
42
|
+
data: T;
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
type AnySchemaFor<T extends JSONValue> = BaseSchema<T, T, BaseSchemaDef<T>>;
|
|
46
|
+
declare abstract class BaseSchema<Input extends JSONValue, Output, Def extends BaseSchemaDef<Input>> {
|
|
47
|
+
/** @internal */
|
|
48
|
+
readonly _input: Input;
|
|
49
|
+
/** @internal */
|
|
50
|
+
readonly _output: Output;
|
|
51
|
+
abstract parse(json: unknown): Output;
|
|
52
|
+
abstract parseSafe(json: unknown): ParseResult<Output>;
|
|
53
|
+
abstract serialize(value: Output): Input;
|
|
54
|
+
protected readonly def: Def;
|
|
55
|
+
abstract toOpenAPI(): SchemaObject | ReferenceObject;
|
|
56
|
+
protected getSchemaObject(): SchemaObject;
|
|
57
|
+
protected clone(def: Partial<Def>): this;
|
|
58
|
+
protected constructor(def: Def);
|
|
59
|
+
or<OtherInput extends JSONValue, OtherOutput, Def extends BaseSchemaDef<OtherInput>>(other: BaseSchema<OtherInput, OtherOutput, Def>): KUnion<(this | BaseSchema<OtherInput, OtherOutput, Def>)["_input"], (this | BaseSchema<OtherInput, OtherOutput, Def>)["_output"]>;
|
|
60
|
+
example(example: Input): this;
|
|
61
|
+
example(): Input | undefined;
|
|
62
|
+
description(description: string): this;
|
|
63
|
+
description(): string | undefined;
|
|
64
|
+
}
|
|
65
|
+
type Check<T extends string, P extends {} = {}> = {
|
|
66
|
+
type: T;
|
|
67
|
+
message?: string | undefined;
|
|
68
|
+
} & Omit<P, 'message'>;
|
|
69
|
+
type StringFormat = 'date' | 'date-time' | 'password' | 'byte' | 'binary' | 'email' | 'uuid' | 'uri' | 'hostname' | 'ipv4' | 'ipv6';
|
|
70
|
+
declare const STRING_FORMAT_REGEXES: {
|
|
71
|
+
readonly uuid: RegExp;
|
|
72
|
+
readonly email: RegExp;
|
|
73
|
+
readonly ipv4: RegExp;
|
|
74
|
+
readonly ipv6: RegExp;
|
|
75
|
+
readonly date: RegExp;
|
|
76
|
+
readonly uri: RegExp;
|
|
77
|
+
readonly hostname: RegExp;
|
|
78
|
+
};
|
|
79
|
+
interface StringChecks {
|
|
80
|
+
min?: Check<'min', {
|
|
81
|
+
val: number;
|
|
82
|
+
}>;
|
|
83
|
+
max?: Check<'max', {
|
|
84
|
+
val: number;
|
|
85
|
+
}>;
|
|
86
|
+
regex?: Check<'regex', {
|
|
87
|
+
regex: RegExp;
|
|
88
|
+
}>;
|
|
89
|
+
format?: Check<'format', {
|
|
90
|
+
format: StringFormat;
|
|
91
|
+
}>;
|
|
92
|
+
startsWith?: Check<'startsWith', {
|
|
93
|
+
prefix: string;
|
|
94
|
+
}>;
|
|
95
|
+
endsWith?: Check<'endsWith', {
|
|
96
|
+
suffix: string;
|
|
97
|
+
}>;
|
|
98
|
+
}
|
|
99
|
+
interface StringDef extends BaseSchemaDef<string>, StringChecks {
|
|
100
|
+
}
|
|
101
|
+
declare class KString extends BaseSchema<string, string, StringDef> {
|
|
102
|
+
static create: () => KString;
|
|
103
|
+
serialize(value: string): string;
|
|
104
|
+
private setCheck;
|
|
105
|
+
toOpenAPI(): SchemaObject | ReferenceObject;
|
|
106
|
+
/**
|
|
107
|
+
* Sets the minimum length of the string
|
|
108
|
+
*
|
|
109
|
+
* @param min The minimum length of the string
|
|
110
|
+
* @returns A clone of the schema with the minimum length set
|
|
111
|
+
*/
|
|
112
|
+
min(min: number, message?: string): this;
|
|
113
|
+
/**
|
|
114
|
+
* Sets the maximum length of the string
|
|
115
|
+
*
|
|
116
|
+
* @param max The maximum length of the string
|
|
117
|
+
* @returns A clone of the schema with the maximum length set
|
|
118
|
+
*/
|
|
119
|
+
max(max: number, message?: string): this;
|
|
120
|
+
regex(regex: RegExp, message?: string): this;
|
|
121
|
+
startsWith(prefix: string, message?: string): this;
|
|
122
|
+
endsWith(suffix: string, message?: string): this;
|
|
123
|
+
private format;
|
|
124
|
+
uri(message?: string): this;
|
|
125
|
+
/**
|
|
126
|
+
* Deprecated because OpenAPI uses the term "uri"
|
|
127
|
+
* but this method exists for making migration from
|
|
128
|
+
* Zod easier.
|
|
129
|
+
*
|
|
130
|
+
* @deprecated Use {@link uri} instead
|
|
131
|
+
*/
|
|
132
|
+
url(message?: string): this;
|
|
133
|
+
email(message?: string): this;
|
|
134
|
+
uuid(message?: string): this;
|
|
135
|
+
ipv4(message?: string): this;
|
|
136
|
+
ipv6(message?: string): this;
|
|
137
|
+
date(message?: string): this;
|
|
138
|
+
dateTime(message?: string): this;
|
|
139
|
+
password(message?: string): this;
|
|
140
|
+
byte(message?: string): this;
|
|
141
|
+
binary(message?: string): this;
|
|
142
|
+
hostname(message?: string): this;
|
|
143
|
+
parseSafe(json: unknown): ParseResult<string>;
|
|
144
|
+
parse(json: unknown): string;
|
|
145
|
+
}
|
|
146
|
+
type NumberFormat = 'float' | 'double' | 'int32' | 'int64';
|
|
147
|
+
interface NumberChecks {
|
|
148
|
+
min?: Check<'min', {
|
|
149
|
+
val: number;
|
|
150
|
+
}>;
|
|
151
|
+
max?: Check<'max', {
|
|
152
|
+
val: number;
|
|
153
|
+
}>;
|
|
154
|
+
integer?: Check<'integer'>;
|
|
155
|
+
multipleOf?: Check<'multipleOf', {
|
|
156
|
+
val: number;
|
|
157
|
+
}>;
|
|
158
|
+
format?: Check<'format', {
|
|
159
|
+
format: NumberFormat;
|
|
160
|
+
}>;
|
|
161
|
+
}
|
|
162
|
+
interface NumberDef extends BaseSchemaDef<number>, NumberChecks {
|
|
163
|
+
}
|
|
164
|
+
declare class KNumber extends BaseSchema<number, number, NumberDef> {
|
|
165
|
+
static create: () => KNumber;
|
|
166
|
+
serialize(value: number): number;
|
|
167
|
+
private setCheck;
|
|
168
|
+
toOpenAPI(): SchemaObject | ReferenceObject;
|
|
169
|
+
min(min: number): this;
|
|
170
|
+
max(max: number): this;
|
|
171
|
+
integer(): this;
|
|
172
|
+
multipleOf(multipleOf: number): this;
|
|
173
|
+
float(): this;
|
|
174
|
+
double(): this;
|
|
175
|
+
int32(): this;
|
|
176
|
+
int64(): this;
|
|
177
|
+
parseSafe(json: unknown): ParseResult<number>;
|
|
178
|
+
parse(json: unknown): number;
|
|
179
|
+
}
|
|
180
|
+
interface BooleanDef extends BaseSchemaDef<boolean> {
|
|
181
|
+
}
|
|
182
|
+
declare class KBoolean extends BaseSchema<boolean, boolean, BooleanDef> {
|
|
183
|
+
static create: () => KBoolean;
|
|
184
|
+
serialize(value: boolean): boolean;
|
|
185
|
+
toOpenAPI(): SchemaObject | ReferenceObject;
|
|
186
|
+
parseSafe(json: unknown): ParseResult<boolean>;
|
|
187
|
+
parse(json: unknown): boolean;
|
|
188
|
+
}
|
|
189
|
+
interface ArrayChecks {
|
|
190
|
+
minItems?: Check<'minItems', {
|
|
191
|
+
val: number;
|
|
192
|
+
}>;
|
|
193
|
+
maxItems?: Check<'maxItems', {
|
|
194
|
+
val: number;
|
|
195
|
+
}>;
|
|
196
|
+
uniqueItems?: Check<'uniqueItems', {
|
|
197
|
+
val: boolean;
|
|
198
|
+
}>;
|
|
199
|
+
}
|
|
200
|
+
interface ArrayDef<Input extends JSONValue, Output> extends BaseSchemaDef<Input[]>, ArrayChecks {
|
|
201
|
+
items: BaseSchema<Input, Output, BaseSchemaDef<Input>>;
|
|
202
|
+
}
|
|
203
|
+
declare class KArray<Input extends JSONValue, Output> extends BaseSchema<Input[], Output[], ArrayDef<Input, Output>> {
|
|
204
|
+
static create: <ItemsInput extends JSONValue, ItemsOutput, Def extends BaseSchemaDef<ItemsInput>>(items: BaseSchema<ItemsInput, ItemsOutput, Def>) => KArray<ItemsInput, ItemsOutput>;
|
|
205
|
+
serialize(value: Output[]): Input[];
|
|
206
|
+
private setCheck;
|
|
207
|
+
toOpenAPI(): SchemaObject | ReferenceObject;
|
|
208
|
+
min(minItems: number): this;
|
|
209
|
+
max(maxItems: number): this;
|
|
210
|
+
unique(): this;
|
|
211
|
+
notUnique(): this;
|
|
212
|
+
parseSafe(json: unknown): ParseResult<Output[]>;
|
|
213
|
+
parse(json: unknown): Output[];
|
|
214
|
+
}
|
|
215
|
+
interface NullDef extends BaseSchemaDef<null> {
|
|
216
|
+
}
|
|
217
|
+
declare class KNull extends BaseSchema<null, null, NullDef> {
|
|
218
|
+
static create: () => KNull;
|
|
219
|
+
serialize(value: null): null;
|
|
220
|
+
toOpenAPI(): SchemaObject | ReferenceObject;
|
|
221
|
+
parseSafe(json: unknown): ParseResult<null>;
|
|
222
|
+
parse(json: unknown): null;
|
|
223
|
+
}
|
|
224
|
+
interface ObjectDef<Input extends Record<keyof Output, JSONValue>, Output extends Record<keyof Input, JSONValue>> extends BaseSchemaDef<Input> {
|
|
225
|
+
shape: {
|
|
226
|
+
[K in keyof Input]: BaseSchema<Input[K], Output[K], BaseSchemaDef<Input[K]>>;
|
|
227
|
+
};
|
|
228
|
+
}
|
|
229
|
+
declare class KObject<Input extends Record<keyof Output, JSONValue>, Output extends Record<keyof Input, any>> extends BaseSchema<Input, Output, ObjectDef<Input, Output>> {
|
|
230
|
+
static create: <Input_1 extends Record<keyof Output_1, any>, Output_1 extends Record<keyof Input_1, any>>(shape: { [K in keyof Input_1 | keyof Output_1]: BaseSchema<Input_1[K], Output_1[K], BaseSchemaDef<Input_1[K]>>; }) => KObject<Input_1, Output_1>;
|
|
231
|
+
serialize(value: Output): Input;
|
|
232
|
+
toOpenAPI(): SchemaObject;
|
|
233
|
+
parseSafe(json: unknown): ParseResult<Output>;
|
|
234
|
+
parse(json: unknown): Output;
|
|
235
|
+
get shape(): { [K in keyof Input]: BaseSchema<Input[K], Output[K], BaseSchemaDef<Input[K]>>; };
|
|
236
|
+
}
|
|
237
|
+
declare class KObjectFromURLSearchParams<Input extends Record<keyof Output, JSONValue>, Output extends Record<keyof Input, JSONValue>> extends KObject<Input, Output> {
|
|
238
|
+
static create: <Input_1 extends Record<keyof Output_1, JSONValue>, Output_1 extends Record<keyof Input_1, JSONValue>>(shape: { [K in keyof Input_1 | keyof Output_1]: BaseSchema<Input_1[K], Output_1[K], BaseSchemaDef<Input_1[K]>>; }) => KObjectFromURLSearchParams<Input_1, Output_1>;
|
|
239
|
+
serialize(value: Output): Input;
|
|
240
|
+
toOpenAPI(): SchemaObject;
|
|
241
|
+
parseSafe(json: unknown): ParseResult<Output>;
|
|
242
|
+
}
|
|
243
|
+
interface RefDef<Input extends Record<keyof Output, JSONValue>, Output extends Record<keyof Input, JSONValue>> extends ObjectDef<Input, Output> {
|
|
244
|
+
name: string;
|
|
245
|
+
summary?: string | undefined;
|
|
246
|
+
}
|
|
247
|
+
declare class KRef<Input extends Record<keyof Output, JSONValue>, Output extends Record<keyof Input, JSONValue>> extends BaseSchema<Input, Output, RefDef<Input, Output>> {
|
|
248
|
+
static create: <Input_1 extends Record<keyof Output_1, JSONValue>, Output_1 extends Record<keyof Input_1, JSONValue>>(name: string, shape: { [K in keyof Input_1 | keyof Output_1]: BaseSchema<Input_1[K], Output_1[K], BaseSchemaDef<Input_1[K]>>; }) => KRef<Input_1, Output_1>;
|
|
249
|
+
serialize(value: Output): Input;
|
|
250
|
+
example(): never;
|
|
251
|
+
toOpenAPI(): ReferenceObject;
|
|
252
|
+
parseSafe(json: unknown): ParseResult<Output>;
|
|
253
|
+
parse(json: unknown): Output;
|
|
254
|
+
summary(): string | undefined;
|
|
255
|
+
summary(summary: string): this;
|
|
256
|
+
get shape(): { [K in keyof Input]: BaseSchema<Input[K], Output[K], BaseSchemaDef<Input[K]>>; };
|
|
257
|
+
get name(): string;
|
|
258
|
+
}
|
|
259
|
+
interface ScalarOptions<ClientRepresentation extends JSONValue, ServerRepresentation> {
|
|
260
|
+
/**
|
|
261
|
+
* Parse the value from the unsafe JSON
|
|
262
|
+
*/
|
|
263
|
+
schema: BaseSchema<ClientRepresentation, ClientRepresentation, BaseSchemaDef<ClientRepresentation>>;
|
|
264
|
+
/**
|
|
265
|
+
* Turn the parsed JSON value into something the server can use
|
|
266
|
+
* @param jsonValue The parsed JSON value
|
|
267
|
+
* @returns The server representation
|
|
268
|
+
*/
|
|
269
|
+
toServer: (jsonValue: ClientRepresentation) => ServerRepresentation;
|
|
270
|
+
/**
|
|
271
|
+
* Turn the server respresentation back into a JSON value
|
|
272
|
+
* @param serverValue The value from the server we want to convert back into the client
|
|
273
|
+
* @returns Convert the data back into a JSON value that the server can understand
|
|
274
|
+
*/
|
|
275
|
+
toClient: (serverValue: ServerRepresentation) => ClientRepresentation;
|
|
276
|
+
}
|
|
277
|
+
interface ScalarDef<ClientRepresentation extends JSONPrimitive, ServerRepresentation> extends BaseSchemaDef<ClientRepresentation>, ScalarOptions<ClientRepresentation, ServerRepresentation> {
|
|
278
|
+
}
|
|
279
|
+
declare class KScalar<ClientRepresentation extends JSONPrimitive, ServerRepresentation> extends BaseSchema<ClientRepresentation, ServerRepresentation, ScalarDef<ClientRepresentation, ServerRepresentation>> {
|
|
280
|
+
static create: <ClientRepresentation_1 extends JSONPrimitive, ServerRepresentation_1>(options: ScalarOptions<ClientRepresentation_1, ServerRepresentation_1>) => KScalar<ClientRepresentation_1, ServerRepresentation_1>;
|
|
281
|
+
constructor(def: ScalarDef<ClientRepresentation, ServerRepresentation>);
|
|
282
|
+
serialize(value: ServerRepresentation): ClientRepresentation;
|
|
283
|
+
toOpenAPI(): SchemaObject | ReferenceObject;
|
|
284
|
+
parseSafe(json: unknown): ParseResult<ServerRepresentation>;
|
|
285
|
+
example(example: ClientRepresentation): this;
|
|
286
|
+
example(): ClientRepresentation | undefined;
|
|
287
|
+
description(description: string): this;
|
|
288
|
+
description(): string | undefined;
|
|
289
|
+
parse(json: unknown): ServerRepresentation;
|
|
290
|
+
}
|
|
291
|
+
interface UnionDef<Input extends JSONValue, Output> extends BaseSchemaDef<Input> {
|
|
292
|
+
items: [
|
|
293
|
+
a: BaseSchema<Input, Output, BaseSchemaDef<Input>>,
|
|
294
|
+
b: BaseSchema<Input, Output, BaseSchemaDef<Input>>,
|
|
295
|
+
...remaining: BaseSchema<Input, Output, BaseSchemaDef<Input>>[]
|
|
296
|
+
];
|
|
297
|
+
}
|
|
298
|
+
declare class KUnion<Input extends JSONValue, Output> extends BaseSchema<Input, Output, UnionDef<Input, Output>> {
|
|
299
|
+
static create: <Items extends [a: BaseSchema<JSONValue, unknown, BaseSchemaDef<JSONValue>>, b: BaseSchema<JSONValue, unknown, BaseSchemaDef<JSONValue>>, ...remaining: BaseSchema<JSONValue, unknown, BaseSchemaDef<JSONValue>>[]]>(items: Items) => KUnion<Items[number]["_input"], Items[number]["_output"]>;
|
|
300
|
+
serialize(value: Output): Input;
|
|
301
|
+
toOpenAPI(): SchemaObject | ReferenceObject;
|
|
302
|
+
parseSafe(json: unknown): ParseResult<Output>;
|
|
303
|
+
parse(json: unknown): Output;
|
|
304
|
+
}
|
|
305
|
+
interface LiteralDef<Value extends string | number | boolean> extends BaseSchemaDef<Value> {
|
|
306
|
+
value: Value;
|
|
307
|
+
}
|
|
308
|
+
declare class KLiteral<Value extends string | number | boolean> extends BaseSchema<Value, Value, LiteralDef<Value>> {
|
|
309
|
+
parse(json: unknown): Value;
|
|
310
|
+
static create: <Value_1 extends string | number | boolean>(value: Value_1) => KLiteral<Value_1>;
|
|
311
|
+
serialize(value: Value): Value;
|
|
312
|
+
toOpenAPI(): SchemaObject;
|
|
313
|
+
parseSafe(json: unknown): ParseResult<Value>;
|
|
314
|
+
}
|
|
315
|
+
declare const k: {
|
|
316
|
+
string: () => KString;
|
|
317
|
+
number: () => KNumber;
|
|
318
|
+
boolean: () => KBoolean;
|
|
319
|
+
array: <ItemsInput extends JSONValue, ItemsOutput, Def extends BaseSchemaDef<ItemsInput>>(items: BaseSchema<ItemsInput, ItemsOutput, Def>) => KArray<ItemsInput, ItemsOutput>;
|
|
320
|
+
null: () => KNull;
|
|
321
|
+
ref: <Input extends Record<keyof Output, JSONValue>, Output extends Record<keyof Input, JSONValue>>(name: string, shape: { [K in keyof Input | keyof Output]: BaseSchema<Input[K], Output[K], BaseSchemaDef<Input[K]>>; }) => KRef<Input, Output>;
|
|
322
|
+
object: <Input extends Record<keyof Output, any>, Output extends Record<keyof Input, any>>(shape: { [K in keyof Input | keyof Output]: BaseSchema<Input[K], Output[K], BaseSchemaDef<Input[K]>>; }) => KObject<Input, Output>;
|
|
323
|
+
scalar: <ClientRepresentation extends JSONPrimitive, ServerRepresentation>(options: ScalarOptions<ClientRepresentation, ServerRepresentation>) => KScalar<ClientRepresentation, ServerRepresentation>;
|
|
324
|
+
literal: <Value extends string | number | boolean>(value: Value) => KLiteral<Value>;
|
|
325
|
+
union: <Items extends [a: BaseSchema<JSONValue, unknown, BaseSchemaDef<JSONValue>>, b: BaseSchema<JSONValue, unknown, BaseSchemaDef<JSONValue>>, ...remaining: BaseSchema<JSONValue, unknown, BaseSchemaDef<JSONValue>>[]]>(items: Items) => KUnion<Items[number]["_input"], Items[number]["_output"]>;
|
|
326
|
+
/**
|
|
327
|
+
* @internal
|
|
328
|
+
* @experimental
|
|
329
|
+
*/
|
|
330
|
+
objectFromURLSearchParams: <Input extends Record<keyof Output, JSONValue>, Output extends Record<keyof Input, JSONValue>>(shape: { [K in keyof Input | keyof Output]: BaseSchema<Input[K], Output[K], BaseSchemaDef<Input[K]>>; }) => KObjectFromURLSearchParams<Input, Output>;
|
|
331
|
+
};
|
|
332
|
+
|
|
333
|
+
export { type AnySchemaFor, type ArrayChecks, type ArrayDef, BaseSchema, type BaseSchemaDef, type BooleanDef, type Issue, type JSONPrimitive, type JSONValue, KArray, KBoolean, KLiteral, KNull, KNumber, KObject, KObjectFromURLSearchParams, KRef, KScalar, KString, KUnion, type LiteralDef, type NullDef, type NumberChecks, type NumberDef, type NumberFormat, type ObjectDef, ParseContext, type ParseResult, type RefDef, STRING_FORMAT_REGEXES, type ScalarDef, type ScalarOptions, SchemaError, type StringChecks, type StringDef, type StringFormat, type UnionDef, isPrimitiveJSONValue, k };
|
|
@@ -0,0 +1,333 @@
|
|
|
1
|
+
import { SchemaObject, ReferenceObject } from 'openapi3-ts/oas31';
|
|
2
|
+
|
|
3
|
+
type JSONPrimitive = string | number | boolean | null;
|
|
4
|
+
type JSONValue = JSONPrimitive | JSONValue[] | {
|
|
5
|
+
[key: string]: JSONValue;
|
|
6
|
+
};
|
|
7
|
+
declare function isPrimitiveJSONValue(value: unknown): value is JSONPrimitive;
|
|
8
|
+
interface BaseSchemaDef<Input extends JSONValue> {
|
|
9
|
+
example?: Input | undefined;
|
|
10
|
+
description?: string | undefined;
|
|
11
|
+
}
|
|
12
|
+
interface Issue {
|
|
13
|
+
message: string;
|
|
14
|
+
path: string[];
|
|
15
|
+
}
|
|
16
|
+
type ParseResult<T> = {
|
|
17
|
+
success: true;
|
|
18
|
+
result: T;
|
|
19
|
+
} | {
|
|
20
|
+
success: false;
|
|
21
|
+
issues: Set<Issue>;
|
|
22
|
+
};
|
|
23
|
+
declare class SchemaError extends Error {
|
|
24
|
+
readonly issues: Set<Issue>;
|
|
25
|
+
constructor(issues: Set<Issue>);
|
|
26
|
+
}
|
|
27
|
+
declare class ParseContext {
|
|
28
|
+
#private;
|
|
29
|
+
private static readonly ISSUE;
|
|
30
|
+
readonly ISSUE: typeof ParseContext.ISSUE;
|
|
31
|
+
addIssue(message: string, path: string[]): typeof ParseContext.ISSUE;
|
|
32
|
+
addIssues(issues: Iterable<Issue>, path: string[]): typeof ParseContext.ISSUE;
|
|
33
|
+
get issues(): Set<Issue>;
|
|
34
|
+
static result<T>(fn: (ctx: ParseContext) => T | typeof ParseContext.ISSUE): ParseResult<T>;
|
|
35
|
+
static with<T>(fn: (ctx: ParseContext) => T | typeof ParseContext.ISSUE): {
|
|
36
|
+
type: "FATAL";
|
|
37
|
+
issues: Set<Issue>;
|
|
38
|
+
data?: never;
|
|
39
|
+
} | {
|
|
40
|
+
type: "PARSED";
|
|
41
|
+
issues: Set<Issue>;
|
|
42
|
+
data: T;
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
type AnySchemaFor<T extends JSONValue> = BaseSchema<T, T, BaseSchemaDef<T>>;
|
|
46
|
+
declare abstract class BaseSchema<Input extends JSONValue, Output, Def extends BaseSchemaDef<Input>> {
|
|
47
|
+
/** @internal */
|
|
48
|
+
readonly _input: Input;
|
|
49
|
+
/** @internal */
|
|
50
|
+
readonly _output: Output;
|
|
51
|
+
abstract parse(json: unknown): Output;
|
|
52
|
+
abstract parseSafe(json: unknown): ParseResult<Output>;
|
|
53
|
+
abstract serialize(value: Output): Input;
|
|
54
|
+
protected readonly def: Def;
|
|
55
|
+
abstract toOpenAPI(): SchemaObject | ReferenceObject;
|
|
56
|
+
protected getSchemaObject(): SchemaObject;
|
|
57
|
+
protected clone(def: Partial<Def>): this;
|
|
58
|
+
protected constructor(def: Def);
|
|
59
|
+
or<OtherInput extends JSONValue, OtherOutput, Def extends BaseSchemaDef<OtherInput>>(other: BaseSchema<OtherInput, OtherOutput, Def>): KUnion<(this | BaseSchema<OtherInput, OtherOutput, Def>)["_input"], (this | BaseSchema<OtherInput, OtherOutput, Def>)["_output"]>;
|
|
60
|
+
example(example: Input): this;
|
|
61
|
+
example(): Input | undefined;
|
|
62
|
+
description(description: string): this;
|
|
63
|
+
description(): string | undefined;
|
|
64
|
+
}
|
|
65
|
+
type Check<T extends string, P extends {} = {}> = {
|
|
66
|
+
type: T;
|
|
67
|
+
message?: string | undefined;
|
|
68
|
+
} & Omit<P, 'message'>;
|
|
69
|
+
type StringFormat = 'date' | 'date-time' | 'password' | 'byte' | 'binary' | 'email' | 'uuid' | 'uri' | 'hostname' | 'ipv4' | 'ipv6';
|
|
70
|
+
declare const STRING_FORMAT_REGEXES: {
|
|
71
|
+
readonly uuid: RegExp;
|
|
72
|
+
readonly email: RegExp;
|
|
73
|
+
readonly ipv4: RegExp;
|
|
74
|
+
readonly ipv6: RegExp;
|
|
75
|
+
readonly date: RegExp;
|
|
76
|
+
readonly uri: RegExp;
|
|
77
|
+
readonly hostname: RegExp;
|
|
78
|
+
};
|
|
79
|
+
interface StringChecks {
|
|
80
|
+
min?: Check<'min', {
|
|
81
|
+
val: number;
|
|
82
|
+
}>;
|
|
83
|
+
max?: Check<'max', {
|
|
84
|
+
val: number;
|
|
85
|
+
}>;
|
|
86
|
+
regex?: Check<'regex', {
|
|
87
|
+
regex: RegExp;
|
|
88
|
+
}>;
|
|
89
|
+
format?: Check<'format', {
|
|
90
|
+
format: StringFormat;
|
|
91
|
+
}>;
|
|
92
|
+
startsWith?: Check<'startsWith', {
|
|
93
|
+
prefix: string;
|
|
94
|
+
}>;
|
|
95
|
+
endsWith?: Check<'endsWith', {
|
|
96
|
+
suffix: string;
|
|
97
|
+
}>;
|
|
98
|
+
}
|
|
99
|
+
interface StringDef extends BaseSchemaDef<string>, StringChecks {
|
|
100
|
+
}
|
|
101
|
+
declare class KString extends BaseSchema<string, string, StringDef> {
|
|
102
|
+
static create: () => KString;
|
|
103
|
+
serialize(value: string): string;
|
|
104
|
+
private setCheck;
|
|
105
|
+
toOpenAPI(): SchemaObject | ReferenceObject;
|
|
106
|
+
/**
|
|
107
|
+
* Sets the minimum length of the string
|
|
108
|
+
*
|
|
109
|
+
* @param min The minimum length of the string
|
|
110
|
+
* @returns A clone of the schema with the minimum length set
|
|
111
|
+
*/
|
|
112
|
+
min(min: number, message?: string): this;
|
|
113
|
+
/**
|
|
114
|
+
* Sets the maximum length of the string
|
|
115
|
+
*
|
|
116
|
+
* @param max The maximum length of the string
|
|
117
|
+
* @returns A clone of the schema with the maximum length set
|
|
118
|
+
*/
|
|
119
|
+
max(max: number, message?: string): this;
|
|
120
|
+
regex(regex: RegExp, message?: string): this;
|
|
121
|
+
startsWith(prefix: string, message?: string): this;
|
|
122
|
+
endsWith(suffix: string, message?: string): this;
|
|
123
|
+
private format;
|
|
124
|
+
uri(message?: string): this;
|
|
125
|
+
/**
|
|
126
|
+
* Deprecated because OpenAPI uses the term "uri"
|
|
127
|
+
* but this method exists for making migration from
|
|
128
|
+
* Zod easier.
|
|
129
|
+
*
|
|
130
|
+
* @deprecated Use {@link uri} instead
|
|
131
|
+
*/
|
|
132
|
+
url(message?: string): this;
|
|
133
|
+
email(message?: string): this;
|
|
134
|
+
uuid(message?: string): this;
|
|
135
|
+
ipv4(message?: string): this;
|
|
136
|
+
ipv6(message?: string): this;
|
|
137
|
+
date(message?: string): this;
|
|
138
|
+
dateTime(message?: string): this;
|
|
139
|
+
password(message?: string): this;
|
|
140
|
+
byte(message?: string): this;
|
|
141
|
+
binary(message?: string): this;
|
|
142
|
+
hostname(message?: string): this;
|
|
143
|
+
parseSafe(json: unknown): ParseResult<string>;
|
|
144
|
+
parse(json: unknown): string;
|
|
145
|
+
}
|
|
146
|
+
type NumberFormat = 'float' | 'double' | 'int32' | 'int64';
|
|
147
|
+
interface NumberChecks {
|
|
148
|
+
min?: Check<'min', {
|
|
149
|
+
val: number;
|
|
150
|
+
}>;
|
|
151
|
+
max?: Check<'max', {
|
|
152
|
+
val: number;
|
|
153
|
+
}>;
|
|
154
|
+
integer?: Check<'integer'>;
|
|
155
|
+
multipleOf?: Check<'multipleOf', {
|
|
156
|
+
val: number;
|
|
157
|
+
}>;
|
|
158
|
+
format?: Check<'format', {
|
|
159
|
+
format: NumberFormat;
|
|
160
|
+
}>;
|
|
161
|
+
}
|
|
162
|
+
interface NumberDef extends BaseSchemaDef<number>, NumberChecks {
|
|
163
|
+
}
|
|
164
|
+
declare class KNumber extends BaseSchema<number, number, NumberDef> {
|
|
165
|
+
static create: () => KNumber;
|
|
166
|
+
serialize(value: number): number;
|
|
167
|
+
private setCheck;
|
|
168
|
+
toOpenAPI(): SchemaObject | ReferenceObject;
|
|
169
|
+
min(min: number): this;
|
|
170
|
+
max(max: number): this;
|
|
171
|
+
integer(): this;
|
|
172
|
+
multipleOf(multipleOf: number): this;
|
|
173
|
+
float(): this;
|
|
174
|
+
double(): this;
|
|
175
|
+
int32(): this;
|
|
176
|
+
int64(): this;
|
|
177
|
+
parseSafe(json: unknown): ParseResult<number>;
|
|
178
|
+
parse(json: unknown): number;
|
|
179
|
+
}
|
|
180
|
+
interface BooleanDef extends BaseSchemaDef<boolean> {
|
|
181
|
+
}
|
|
182
|
+
declare class KBoolean extends BaseSchema<boolean, boolean, BooleanDef> {
|
|
183
|
+
static create: () => KBoolean;
|
|
184
|
+
serialize(value: boolean): boolean;
|
|
185
|
+
toOpenAPI(): SchemaObject | ReferenceObject;
|
|
186
|
+
parseSafe(json: unknown): ParseResult<boolean>;
|
|
187
|
+
parse(json: unknown): boolean;
|
|
188
|
+
}
|
|
189
|
+
interface ArrayChecks {
|
|
190
|
+
minItems?: Check<'minItems', {
|
|
191
|
+
val: number;
|
|
192
|
+
}>;
|
|
193
|
+
maxItems?: Check<'maxItems', {
|
|
194
|
+
val: number;
|
|
195
|
+
}>;
|
|
196
|
+
uniqueItems?: Check<'uniqueItems', {
|
|
197
|
+
val: boolean;
|
|
198
|
+
}>;
|
|
199
|
+
}
|
|
200
|
+
interface ArrayDef<Input extends JSONValue, Output> extends BaseSchemaDef<Input[]>, ArrayChecks {
|
|
201
|
+
items: BaseSchema<Input, Output, BaseSchemaDef<Input>>;
|
|
202
|
+
}
|
|
203
|
+
declare class KArray<Input extends JSONValue, Output> extends BaseSchema<Input[], Output[], ArrayDef<Input, Output>> {
|
|
204
|
+
static create: <ItemsInput extends JSONValue, ItemsOutput, Def extends BaseSchemaDef<ItemsInput>>(items: BaseSchema<ItemsInput, ItemsOutput, Def>) => KArray<ItemsInput, ItemsOutput>;
|
|
205
|
+
serialize(value: Output[]): Input[];
|
|
206
|
+
private setCheck;
|
|
207
|
+
toOpenAPI(): SchemaObject | ReferenceObject;
|
|
208
|
+
min(minItems: number): this;
|
|
209
|
+
max(maxItems: number): this;
|
|
210
|
+
unique(): this;
|
|
211
|
+
notUnique(): this;
|
|
212
|
+
parseSafe(json: unknown): ParseResult<Output[]>;
|
|
213
|
+
parse(json: unknown): Output[];
|
|
214
|
+
}
|
|
215
|
+
interface NullDef extends BaseSchemaDef<null> {
|
|
216
|
+
}
|
|
217
|
+
declare class KNull extends BaseSchema<null, null, NullDef> {
|
|
218
|
+
static create: () => KNull;
|
|
219
|
+
serialize(value: null): null;
|
|
220
|
+
toOpenAPI(): SchemaObject | ReferenceObject;
|
|
221
|
+
parseSafe(json: unknown): ParseResult<null>;
|
|
222
|
+
parse(json: unknown): null;
|
|
223
|
+
}
|
|
224
|
+
interface ObjectDef<Input extends Record<keyof Output, JSONValue>, Output extends Record<keyof Input, JSONValue>> extends BaseSchemaDef<Input> {
|
|
225
|
+
shape: {
|
|
226
|
+
[K in keyof Input]: BaseSchema<Input[K], Output[K], BaseSchemaDef<Input[K]>>;
|
|
227
|
+
};
|
|
228
|
+
}
|
|
229
|
+
declare class KObject<Input extends Record<keyof Output, JSONValue>, Output extends Record<keyof Input, any>> extends BaseSchema<Input, Output, ObjectDef<Input, Output>> {
|
|
230
|
+
static create: <Input_1 extends Record<keyof Output_1, any>, Output_1 extends Record<keyof Input_1, any>>(shape: { [K in keyof Input_1 | keyof Output_1]: BaseSchema<Input_1[K], Output_1[K], BaseSchemaDef<Input_1[K]>>; }) => KObject<Input_1, Output_1>;
|
|
231
|
+
serialize(value: Output): Input;
|
|
232
|
+
toOpenAPI(): SchemaObject;
|
|
233
|
+
parseSafe(json: unknown): ParseResult<Output>;
|
|
234
|
+
parse(json: unknown): Output;
|
|
235
|
+
get shape(): { [K in keyof Input]: BaseSchema<Input[K], Output[K], BaseSchemaDef<Input[K]>>; };
|
|
236
|
+
}
|
|
237
|
+
declare class KObjectFromURLSearchParams<Input extends Record<keyof Output, JSONValue>, Output extends Record<keyof Input, JSONValue>> extends KObject<Input, Output> {
|
|
238
|
+
static create: <Input_1 extends Record<keyof Output_1, JSONValue>, Output_1 extends Record<keyof Input_1, JSONValue>>(shape: { [K in keyof Input_1 | keyof Output_1]: BaseSchema<Input_1[K], Output_1[K], BaseSchemaDef<Input_1[K]>>; }) => KObjectFromURLSearchParams<Input_1, Output_1>;
|
|
239
|
+
serialize(value: Output): Input;
|
|
240
|
+
toOpenAPI(): SchemaObject;
|
|
241
|
+
parseSafe(json: unknown): ParseResult<Output>;
|
|
242
|
+
}
|
|
243
|
+
interface RefDef<Input extends Record<keyof Output, JSONValue>, Output extends Record<keyof Input, JSONValue>> extends ObjectDef<Input, Output> {
|
|
244
|
+
name: string;
|
|
245
|
+
summary?: string | undefined;
|
|
246
|
+
}
|
|
247
|
+
declare class KRef<Input extends Record<keyof Output, JSONValue>, Output extends Record<keyof Input, JSONValue>> extends BaseSchema<Input, Output, RefDef<Input, Output>> {
|
|
248
|
+
static create: <Input_1 extends Record<keyof Output_1, JSONValue>, Output_1 extends Record<keyof Input_1, JSONValue>>(name: string, shape: { [K in keyof Input_1 | keyof Output_1]: BaseSchema<Input_1[K], Output_1[K], BaseSchemaDef<Input_1[K]>>; }) => KRef<Input_1, Output_1>;
|
|
249
|
+
serialize(value: Output): Input;
|
|
250
|
+
example(): never;
|
|
251
|
+
toOpenAPI(): ReferenceObject;
|
|
252
|
+
parseSafe(json: unknown): ParseResult<Output>;
|
|
253
|
+
parse(json: unknown): Output;
|
|
254
|
+
summary(): string | undefined;
|
|
255
|
+
summary(summary: string): this;
|
|
256
|
+
get shape(): { [K in keyof Input]: BaseSchema<Input[K], Output[K], BaseSchemaDef<Input[K]>>; };
|
|
257
|
+
get name(): string;
|
|
258
|
+
}
|
|
259
|
+
interface ScalarOptions<ClientRepresentation extends JSONValue, ServerRepresentation> {
|
|
260
|
+
/**
|
|
261
|
+
* Parse the value from the unsafe JSON
|
|
262
|
+
*/
|
|
263
|
+
schema: BaseSchema<ClientRepresentation, ClientRepresentation, BaseSchemaDef<ClientRepresentation>>;
|
|
264
|
+
/**
|
|
265
|
+
* Turn the parsed JSON value into something the server can use
|
|
266
|
+
* @param jsonValue The parsed JSON value
|
|
267
|
+
* @returns The server representation
|
|
268
|
+
*/
|
|
269
|
+
toServer: (jsonValue: ClientRepresentation) => ServerRepresentation;
|
|
270
|
+
/**
|
|
271
|
+
* Turn the server respresentation back into a JSON value
|
|
272
|
+
* @param serverValue The value from the server we want to convert back into the client
|
|
273
|
+
* @returns Convert the data back into a JSON value that the server can understand
|
|
274
|
+
*/
|
|
275
|
+
toClient: (serverValue: ServerRepresentation) => ClientRepresentation;
|
|
276
|
+
}
|
|
277
|
+
interface ScalarDef<ClientRepresentation extends JSONPrimitive, ServerRepresentation> extends BaseSchemaDef<ClientRepresentation>, ScalarOptions<ClientRepresentation, ServerRepresentation> {
|
|
278
|
+
}
|
|
279
|
+
declare class KScalar<ClientRepresentation extends JSONPrimitive, ServerRepresentation> extends BaseSchema<ClientRepresentation, ServerRepresentation, ScalarDef<ClientRepresentation, ServerRepresentation>> {
|
|
280
|
+
static create: <ClientRepresentation_1 extends JSONPrimitive, ServerRepresentation_1>(options: ScalarOptions<ClientRepresentation_1, ServerRepresentation_1>) => KScalar<ClientRepresentation_1, ServerRepresentation_1>;
|
|
281
|
+
constructor(def: ScalarDef<ClientRepresentation, ServerRepresentation>);
|
|
282
|
+
serialize(value: ServerRepresentation): ClientRepresentation;
|
|
283
|
+
toOpenAPI(): SchemaObject | ReferenceObject;
|
|
284
|
+
parseSafe(json: unknown): ParseResult<ServerRepresentation>;
|
|
285
|
+
example(example: ClientRepresentation): this;
|
|
286
|
+
example(): ClientRepresentation | undefined;
|
|
287
|
+
description(description: string): this;
|
|
288
|
+
description(): string | undefined;
|
|
289
|
+
parse(json: unknown): ServerRepresentation;
|
|
290
|
+
}
|
|
291
|
+
interface UnionDef<Input extends JSONValue, Output> extends BaseSchemaDef<Input> {
|
|
292
|
+
items: [
|
|
293
|
+
a: BaseSchema<Input, Output, BaseSchemaDef<Input>>,
|
|
294
|
+
b: BaseSchema<Input, Output, BaseSchemaDef<Input>>,
|
|
295
|
+
...remaining: BaseSchema<Input, Output, BaseSchemaDef<Input>>[]
|
|
296
|
+
];
|
|
297
|
+
}
|
|
298
|
+
declare class KUnion<Input extends JSONValue, Output> extends BaseSchema<Input, Output, UnionDef<Input, Output>> {
|
|
299
|
+
static create: <Items extends [a: BaseSchema<JSONValue, unknown, BaseSchemaDef<JSONValue>>, b: BaseSchema<JSONValue, unknown, BaseSchemaDef<JSONValue>>, ...remaining: BaseSchema<JSONValue, unknown, BaseSchemaDef<JSONValue>>[]]>(items: Items) => KUnion<Items[number]["_input"], Items[number]["_output"]>;
|
|
300
|
+
serialize(value: Output): Input;
|
|
301
|
+
toOpenAPI(): SchemaObject | ReferenceObject;
|
|
302
|
+
parseSafe(json: unknown): ParseResult<Output>;
|
|
303
|
+
parse(json: unknown): Output;
|
|
304
|
+
}
|
|
305
|
+
interface LiteralDef<Value extends string | number | boolean> extends BaseSchemaDef<Value> {
|
|
306
|
+
value: Value;
|
|
307
|
+
}
|
|
308
|
+
declare class KLiteral<Value extends string | number | boolean> extends BaseSchema<Value, Value, LiteralDef<Value>> {
|
|
309
|
+
parse(json: unknown): Value;
|
|
310
|
+
static create: <Value_1 extends string | number | boolean>(value: Value_1) => KLiteral<Value_1>;
|
|
311
|
+
serialize(value: Value): Value;
|
|
312
|
+
toOpenAPI(): SchemaObject;
|
|
313
|
+
parseSafe(json: unknown): ParseResult<Value>;
|
|
314
|
+
}
|
|
315
|
+
declare const k: {
|
|
316
|
+
string: () => KString;
|
|
317
|
+
number: () => KNumber;
|
|
318
|
+
boolean: () => KBoolean;
|
|
319
|
+
array: <ItemsInput extends JSONValue, ItemsOutput, Def extends BaseSchemaDef<ItemsInput>>(items: BaseSchema<ItemsInput, ItemsOutput, Def>) => KArray<ItemsInput, ItemsOutput>;
|
|
320
|
+
null: () => KNull;
|
|
321
|
+
ref: <Input extends Record<keyof Output, JSONValue>, Output extends Record<keyof Input, JSONValue>>(name: string, shape: { [K in keyof Input | keyof Output]: BaseSchema<Input[K], Output[K], BaseSchemaDef<Input[K]>>; }) => KRef<Input, Output>;
|
|
322
|
+
object: <Input extends Record<keyof Output, any>, Output extends Record<keyof Input, any>>(shape: { [K in keyof Input | keyof Output]: BaseSchema<Input[K], Output[K], BaseSchemaDef<Input[K]>>; }) => KObject<Input, Output>;
|
|
323
|
+
scalar: <ClientRepresentation extends JSONPrimitive, ServerRepresentation>(options: ScalarOptions<ClientRepresentation, ServerRepresentation>) => KScalar<ClientRepresentation, ServerRepresentation>;
|
|
324
|
+
literal: <Value extends string | number | boolean>(value: Value) => KLiteral<Value>;
|
|
325
|
+
union: <Items extends [a: BaseSchema<JSONValue, unknown, BaseSchemaDef<JSONValue>>, b: BaseSchema<JSONValue, unknown, BaseSchemaDef<JSONValue>>, ...remaining: BaseSchema<JSONValue, unknown, BaseSchemaDef<JSONValue>>[]]>(items: Items) => KUnion<Items[number]["_input"], Items[number]["_output"]>;
|
|
326
|
+
/**
|
|
327
|
+
* @internal
|
|
328
|
+
* @experimental
|
|
329
|
+
*/
|
|
330
|
+
objectFromURLSearchParams: <Input extends Record<keyof Output, JSONValue>, Output extends Record<keyof Input, JSONValue>>(shape: { [K in keyof Input | keyof Output]: BaseSchema<Input[K], Output[K], BaseSchemaDef<Input[K]>>; }) => KObjectFromURLSearchParams<Input, Output>;
|
|
331
|
+
};
|
|
332
|
+
|
|
333
|
+
export { type AnySchemaFor, type ArrayChecks, type ArrayDef, BaseSchema, type BaseSchemaDef, type BooleanDef, type Issue, type JSONPrimitive, type JSONValue, KArray, KBoolean, KLiteral, KNull, KNumber, KObject, KObjectFromURLSearchParams, KRef, KScalar, KString, KUnion, type LiteralDef, type NullDef, type NumberChecks, type NumberDef, type NumberFormat, type ObjectDef, ParseContext, type ParseResult, type RefDef, STRING_FORMAT_REGEXES, type ScalarDef, type ScalarOptions, SchemaError, type StringChecks, type StringDef, type StringFormat, type UnionDef, isPrimitiveJSONValue, k };
|