@memberjunction/ai-vector-sync 2.1.1 → 2.1.2
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/index.d.ts +1268 -9
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/package.json +12 -12
package/dist/index.d.ts
CHANGED
|
@@ -4,18 +4,1280 @@ import { BaseEntity, RunViewParams, UserInfo, EntityField, EntityInfo } from '@m
|
|
|
4
4
|
import { TemplateEntityExtended } from '@memberjunction/templates-base-types';
|
|
5
5
|
import { VectorBase } from '@memberjunction/ai-vectors';
|
|
6
6
|
|
|
7
|
+
declare type Primitive = string | number | symbol | bigint | boolean | null | undefined;
|
|
8
|
+
|
|
9
|
+
declare namespace util {
|
|
10
|
+
type AssertEqual<T, U> = (<V>() => V extends T ? 1 : 2) extends <V>() => V extends U ? 1 : 2 ? true : false;
|
|
11
|
+
export type isAny<T> = 0 extends 1 & T ? true : false;
|
|
12
|
+
export const assertEqual: <A, B>(val: AssertEqual<A, B>) => AssertEqual<A, B>;
|
|
13
|
+
export function assertIs<T>(_arg: T): void;
|
|
14
|
+
export function assertNever(_x: never): never;
|
|
15
|
+
export type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
|
|
16
|
+
export type OmitKeys<T, K extends string> = Pick<T, Exclude<keyof T, K>>;
|
|
17
|
+
export type MakePartial<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
|
|
18
|
+
export type Exactly<T, X> = T & Record<Exclude<keyof X, keyof T>, never>;
|
|
19
|
+
export const arrayToEnum: <T extends string, U extends [T, ...T[]]>(items: U) => { [k in U[number]]: k; };
|
|
20
|
+
export const getValidEnumValues: (obj: any) => any[];
|
|
21
|
+
export const objectValues: (obj: any) => any[];
|
|
22
|
+
export const objectKeys: ObjectConstructor["keys"];
|
|
23
|
+
export const find: <T>(arr: T[], checker: (arg: T) => any) => T | undefined;
|
|
24
|
+
export type identity<T> = objectUtil.identity<T>;
|
|
25
|
+
export type flatten<T> = objectUtil.flatten<T>;
|
|
26
|
+
export type noUndefined<T> = T extends undefined ? never : T;
|
|
27
|
+
export const isInteger: NumberConstructor["isInteger"];
|
|
28
|
+
export function joinValues<T extends any[]>(array: T, separator?: string): string;
|
|
29
|
+
export const jsonStringifyReplacer: (_: string, value: any) => any;
|
|
30
|
+
export { };
|
|
31
|
+
}
|
|
32
|
+
declare namespace objectUtil {
|
|
33
|
+
export type MergeShapes<U, V> = {
|
|
34
|
+
[k in Exclude<keyof U, keyof V>]: U[k];
|
|
35
|
+
} & V;
|
|
36
|
+
type optionalKeys<T extends object> = {
|
|
37
|
+
[k in keyof T]: undefined extends T[k] ? k : never;
|
|
38
|
+
}[keyof T];
|
|
39
|
+
type requiredKeys<T extends object> = {
|
|
40
|
+
[k in keyof T]: undefined extends T[k] ? never : k;
|
|
41
|
+
}[keyof T];
|
|
42
|
+
export type addQuestionMarks<T extends object, _O = any> = {
|
|
43
|
+
[K in requiredKeys<T>]: T[K];
|
|
44
|
+
} & {
|
|
45
|
+
[K in optionalKeys<T>]?: T[K];
|
|
46
|
+
} & {
|
|
47
|
+
[k in keyof T]?: unknown;
|
|
48
|
+
};
|
|
49
|
+
export type identity<T> = T;
|
|
50
|
+
export type flatten<T> = identity<{
|
|
51
|
+
[k in keyof T]: T[k];
|
|
52
|
+
}>;
|
|
53
|
+
export type noNeverKeys<T> = {
|
|
54
|
+
[k in keyof T]: [T[k]] extends [never] ? never : k;
|
|
55
|
+
}[keyof T];
|
|
56
|
+
export type noNever<T> = identity<{
|
|
57
|
+
[k in noNeverKeys<T>]: k extends keyof T ? T[k] : never;
|
|
58
|
+
}>;
|
|
59
|
+
export const mergeShapes: <U, T>(first: U, second: T) => T & U;
|
|
60
|
+
export type extendShape<A extends object, B extends object> = {
|
|
61
|
+
[K in keyof A as K extends keyof B ? never : K]: A[K];
|
|
62
|
+
} & {
|
|
63
|
+
[K in keyof B]: B[K];
|
|
64
|
+
};
|
|
65
|
+
export { };
|
|
66
|
+
}
|
|
67
|
+
declare const ZodParsedType: {
|
|
68
|
+
function: "function";
|
|
69
|
+
number: "number";
|
|
70
|
+
string: "string";
|
|
71
|
+
nan: "nan";
|
|
72
|
+
integer: "integer";
|
|
73
|
+
float: "float";
|
|
74
|
+
boolean: "boolean";
|
|
75
|
+
date: "date";
|
|
76
|
+
bigint: "bigint";
|
|
77
|
+
symbol: "symbol";
|
|
78
|
+
undefined: "undefined";
|
|
79
|
+
null: "null";
|
|
80
|
+
array: "array";
|
|
81
|
+
object: "object";
|
|
82
|
+
unknown: "unknown";
|
|
83
|
+
promise: "promise";
|
|
84
|
+
void: "void";
|
|
85
|
+
never: "never";
|
|
86
|
+
map: "map";
|
|
87
|
+
set: "set";
|
|
88
|
+
};
|
|
89
|
+
declare type ZodParsedType = keyof typeof ZodParsedType;
|
|
90
|
+
|
|
91
|
+
declare type allKeys<T> = T extends any ? keyof T : never;
|
|
92
|
+
declare type typeToFlattenedError<T, U = string> = {
|
|
93
|
+
formErrors: U[];
|
|
94
|
+
fieldErrors: {
|
|
95
|
+
[P in allKeys<T>]?: U[];
|
|
96
|
+
};
|
|
97
|
+
};
|
|
98
|
+
declare const ZodIssueCode: {
|
|
99
|
+
invalid_type: "invalid_type";
|
|
100
|
+
invalid_literal: "invalid_literal";
|
|
101
|
+
custom: "custom";
|
|
102
|
+
invalid_union: "invalid_union";
|
|
103
|
+
invalid_union_discriminator: "invalid_union_discriminator";
|
|
104
|
+
invalid_enum_value: "invalid_enum_value";
|
|
105
|
+
unrecognized_keys: "unrecognized_keys";
|
|
106
|
+
invalid_arguments: "invalid_arguments";
|
|
107
|
+
invalid_return_type: "invalid_return_type";
|
|
108
|
+
invalid_date: "invalid_date";
|
|
109
|
+
invalid_string: "invalid_string";
|
|
110
|
+
too_small: "too_small";
|
|
111
|
+
too_big: "too_big";
|
|
112
|
+
invalid_intersection_types: "invalid_intersection_types";
|
|
113
|
+
not_multiple_of: "not_multiple_of";
|
|
114
|
+
not_finite: "not_finite";
|
|
115
|
+
};
|
|
116
|
+
declare type ZodIssueCode = keyof typeof ZodIssueCode;
|
|
117
|
+
declare type ZodIssueBase = {
|
|
118
|
+
path: (string | number)[];
|
|
119
|
+
message?: string;
|
|
120
|
+
};
|
|
121
|
+
interface ZodInvalidTypeIssue extends ZodIssueBase {
|
|
122
|
+
code: typeof ZodIssueCode.invalid_type;
|
|
123
|
+
expected: ZodParsedType;
|
|
124
|
+
received: ZodParsedType;
|
|
125
|
+
}
|
|
126
|
+
interface ZodInvalidLiteralIssue extends ZodIssueBase {
|
|
127
|
+
code: typeof ZodIssueCode.invalid_literal;
|
|
128
|
+
expected: unknown;
|
|
129
|
+
received: unknown;
|
|
130
|
+
}
|
|
131
|
+
interface ZodUnrecognizedKeysIssue extends ZodIssueBase {
|
|
132
|
+
code: typeof ZodIssueCode.unrecognized_keys;
|
|
133
|
+
keys: string[];
|
|
134
|
+
}
|
|
135
|
+
interface ZodInvalidUnionIssue extends ZodIssueBase {
|
|
136
|
+
code: typeof ZodIssueCode.invalid_union;
|
|
137
|
+
unionErrors: ZodError[];
|
|
138
|
+
}
|
|
139
|
+
interface ZodInvalidUnionDiscriminatorIssue extends ZodIssueBase {
|
|
140
|
+
code: typeof ZodIssueCode.invalid_union_discriminator;
|
|
141
|
+
options: Primitive[];
|
|
142
|
+
}
|
|
143
|
+
interface ZodInvalidEnumValueIssue extends ZodIssueBase {
|
|
144
|
+
received: string | number;
|
|
145
|
+
code: typeof ZodIssueCode.invalid_enum_value;
|
|
146
|
+
options: (string | number)[];
|
|
147
|
+
}
|
|
148
|
+
interface ZodInvalidArgumentsIssue extends ZodIssueBase {
|
|
149
|
+
code: typeof ZodIssueCode.invalid_arguments;
|
|
150
|
+
argumentsError: ZodError;
|
|
151
|
+
}
|
|
152
|
+
interface ZodInvalidReturnTypeIssue extends ZodIssueBase {
|
|
153
|
+
code: typeof ZodIssueCode.invalid_return_type;
|
|
154
|
+
returnTypeError: ZodError;
|
|
155
|
+
}
|
|
156
|
+
interface ZodInvalidDateIssue extends ZodIssueBase {
|
|
157
|
+
code: typeof ZodIssueCode.invalid_date;
|
|
158
|
+
}
|
|
159
|
+
declare type StringValidation = "email" | "url" | "emoji" | "uuid" | "nanoid" | "regex" | "cuid" | "cuid2" | "ulid" | "datetime" | "date" | "time" | "duration" | "ip" | "base64" | {
|
|
160
|
+
includes: string;
|
|
161
|
+
position?: number;
|
|
162
|
+
} | {
|
|
163
|
+
startsWith: string;
|
|
164
|
+
} | {
|
|
165
|
+
endsWith: string;
|
|
166
|
+
};
|
|
167
|
+
interface ZodInvalidStringIssue extends ZodIssueBase {
|
|
168
|
+
code: typeof ZodIssueCode.invalid_string;
|
|
169
|
+
validation: StringValidation;
|
|
170
|
+
}
|
|
171
|
+
interface ZodTooSmallIssue extends ZodIssueBase {
|
|
172
|
+
code: typeof ZodIssueCode.too_small;
|
|
173
|
+
minimum: number | bigint;
|
|
174
|
+
inclusive: boolean;
|
|
175
|
+
exact?: boolean;
|
|
176
|
+
type: "array" | "string" | "number" | "set" | "date" | "bigint";
|
|
177
|
+
}
|
|
178
|
+
interface ZodTooBigIssue extends ZodIssueBase {
|
|
179
|
+
code: typeof ZodIssueCode.too_big;
|
|
180
|
+
maximum: number | bigint;
|
|
181
|
+
inclusive: boolean;
|
|
182
|
+
exact?: boolean;
|
|
183
|
+
type: "array" | "string" | "number" | "set" | "date" | "bigint";
|
|
184
|
+
}
|
|
185
|
+
interface ZodInvalidIntersectionTypesIssue extends ZodIssueBase {
|
|
186
|
+
code: typeof ZodIssueCode.invalid_intersection_types;
|
|
187
|
+
}
|
|
188
|
+
interface ZodNotMultipleOfIssue extends ZodIssueBase {
|
|
189
|
+
code: typeof ZodIssueCode.not_multiple_of;
|
|
190
|
+
multipleOf: number | bigint;
|
|
191
|
+
}
|
|
192
|
+
interface ZodNotFiniteIssue extends ZodIssueBase {
|
|
193
|
+
code: typeof ZodIssueCode.not_finite;
|
|
194
|
+
}
|
|
195
|
+
interface ZodCustomIssue extends ZodIssueBase {
|
|
196
|
+
code: typeof ZodIssueCode.custom;
|
|
197
|
+
params?: {
|
|
198
|
+
[k: string]: any;
|
|
199
|
+
};
|
|
200
|
+
}
|
|
201
|
+
declare type ZodIssueOptionalMessage = ZodInvalidTypeIssue | ZodInvalidLiteralIssue | ZodUnrecognizedKeysIssue | ZodInvalidUnionIssue | ZodInvalidUnionDiscriminatorIssue | ZodInvalidEnumValueIssue | ZodInvalidArgumentsIssue | ZodInvalidReturnTypeIssue | ZodInvalidDateIssue | ZodInvalidStringIssue | ZodTooSmallIssue | ZodTooBigIssue | ZodInvalidIntersectionTypesIssue | ZodNotMultipleOfIssue | ZodNotFiniteIssue | ZodCustomIssue;
|
|
202
|
+
declare type ZodIssue = ZodIssueOptionalMessage & {
|
|
203
|
+
fatal?: boolean;
|
|
204
|
+
message: string;
|
|
205
|
+
};
|
|
206
|
+
declare type recursiveZodFormattedError<T> = T extends [any, ...any[]] ? {
|
|
207
|
+
[K in keyof T]?: ZodFormattedError<T[K]>;
|
|
208
|
+
} : T extends any[] ? {
|
|
209
|
+
[k: number]: ZodFormattedError<T[number]>;
|
|
210
|
+
} : T extends object ? {
|
|
211
|
+
[K in keyof T]?: ZodFormattedError<T[K]>;
|
|
212
|
+
} : unknown;
|
|
213
|
+
declare type ZodFormattedError<T, U = string> = {
|
|
214
|
+
_errors: U[];
|
|
215
|
+
} & recursiveZodFormattedError<NonNullable<T>>;
|
|
216
|
+
declare class ZodError<T = any> extends Error {
|
|
217
|
+
issues: ZodIssue[];
|
|
218
|
+
get errors(): ZodIssue[];
|
|
219
|
+
constructor(issues: ZodIssue[]);
|
|
220
|
+
format(): ZodFormattedError<T>;
|
|
221
|
+
format<U>(mapper: (issue: ZodIssue) => U): ZodFormattedError<T, U>;
|
|
222
|
+
static create: (issues: ZodIssue[]) => ZodError<any>;
|
|
223
|
+
static assert(value: unknown): asserts value is ZodError;
|
|
224
|
+
toString(): string;
|
|
225
|
+
get message(): string;
|
|
226
|
+
get isEmpty(): boolean;
|
|
227
|
+
addIssue: (sub: ZodIssue) => void;
|
|
228
|
+
addIssues: (subs?: ZodIssue[]) => void;
|
|
229
|
+
flatten(): typeToFlattenedError<T>;
|
|
230
|
+
flatten<U>(mapper?: (issue: ZodIssue) => U): typeToFlattenedError<T, U>;
|
|
231
|
+
get formErrors(): typeToFlattenedError<T, string>;
|
|
232
|
+
}
|
|
233
|
+
declare type stripPath<T extends object> = T extends any ? util.OmitKeys<T, "path"> : never;
|
|
234
|
+
declare type IssueData = stripPath<ZodIssueOptionalMessage> & {
|
|
235
|
+
path?: (string | number)[];
|
|
236
|
+
fatal?: boolean;
|
|
237
|
+
};
|
|
238
|
+
declare type ErrorMapCtx = {
|
|
239
|
+
defaultError: string;
|
|
240
|
+
data: any;
|
|
241
|
+
};
|
|
242
|
+
declare type ZodErrorMap = (issue: ZodIssueOptionalMessage, _ctx: ErrorMapCtx) => {
|
|
243
|
+
message: string;
|
|
244
|
+
};
|
|
245
|
+
|
|
246
|
+
declare type ParseParams = {
|
|
247
|
+
path: (string | number)[];
|
|
248
|
+
errorMap: ZodErrorMap;
|
|
249
|
+
async: boolean;
|
|
250
|
+
};
|
|
251
|
+
declare type ParsePathComponent = string | number;
|
|
252
|
+
declare type ParsePath = ParsePathComponent[];
|
|
253
|
+
interface ParseContext {
|
|
254
|
+
readonly common: {
|
|
255
|
+
readonly issues: ZodIssue[];
|
|
256
|
+
readonly contextualErrorMap?: ZodErrorMap;
|
|
257
|
+
readonly async: boolean;
|
|
258
|
+
};
|
|
259
|
+
readonly path: ParsePath;
|
|
260
|
+
readonly schemaErrorMap?: ZodErrorMap;
|
|
261
|
+
readonly parent: ParseContext | null;
|
|
262
|
+
readonly data: any;
|
|
263
|
+
readonly parsedType: ZodParsedType;
|
|
264
|
+
}
|
|
265
|
+
declare type ParseInput = {
|
|
266
|
+
data: any;
|
|
267
|
+
path: (string | number)[];
|
|
268
|
+
parent: ParseContext;
|
|
269
|
+
};
|
|
270
|
+
declare class ParseStatus {
|
|
271
|
+
value: "aborted" | "dirty" | "valid";
|
|
272
|
+
dirty(): void;
|
|
273
|
+
abort(): void;
|
|
274
|
+
static mergeArray(status: ParseStatus, results: SyncParseReturnType<any>[]): SyncParseReturnType;
|
|
275
|
+
static mergeObjectAsync(status: ParseStatus, pairs: {
|
|
276
|
+
key: ParseReturnType<any>;
|
|
277
|
+
value: ParseReturnType<any>;
|
|
278
|
+
}[]): Promise<SyncParseReturnType<any>>;
|
|
279
|
+
static mergeObjectSync(status: ParseStatus, pairs: {
|
|
280
|
+
key: SyncParseReturnType<any>;
|
|
281
|
+
value: SyncParseReturnType<any>;
|
|
282
|
+
alwaysSet?: boolean;
|
|
283
|
+
}[]): SyncParseReturnType;
|
|
284
|
+
}
|
|
285
|
+
declare type INVALID = {
|
|
286
|
+
status: "aborted";
|
|
287
|
+
};
|
|
288
|
+
declare const INVALID: INVALID;
|
|
289
|
+
declare type DIRTY<T> = {
|
|
290
|
+
status: "dirty";
|
|
291
|
+
value: T;
|
|
292
|
+
};
|
|
293
|
+
declare const DIRTY: <T>(value: T) => DIRTY<T>;
|
|
294
|
+
declare type OK<T> = {
|
|
295
|
+
status: "valid";
|
|
296
|
+
value: T;
|
|
297
|
+
};
|
|
298
|
+
declare const OK: <T>(value: T) => OK<T>;
|
|
299
|
+
declare type SyncParseReturnType<T = any> = OK<T> | DIRTY<T> | INVALID;
|
|
300
|
+
declare type AsyncParseReturnType<T> = Promise<SyncParseReturnType<T>>;
|
|
301
|
+
declare type ParseReturnType<T> = SyncParseReturnType<T> | AsyncParseReturnType<T>;
|
|
302
|
+
|
|
303
|
+
declare namespace enumUtil {
|
|
304
|
+
type UnionToIntersectionFn<T> = (T extends unknown ? (k: () => T) => void : never) extends (k: infer Intersection) => void ? Intersection : never;
|
|
305
|
+
type GetUnionLast<T> = UnionToIntersectionFn<T> extends () => infer Last ? Last : never;
|
|
306
|
+
type UnionToTuple<T, Tuple extends unknown[] = []> = [T] extends [never] ? Tuple : UnionToTuple<Exclude<T, GetUnionLast<T>>, [GetUnionLast<T>, ...Tuple]>;
|
|
307
|
+
type CastToStringTuple<T> = T extends [string, ...string[]] ? T : never;
|
|
308
|
+
export type UnionToTupleString<T> = CastToStringTuple<UnionToTuple<T>>;
|
|
309
|
+
export { };
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
declare namespace errorUtil {
|
|
313
|
+
type ErrMessage = string | {
|
|
314
|
+
message?: string;
|
|
315
|
+
};
|
|
316
|
+
const errToObj: (message?: ErrMessage | undefined) => {
|
|
317
|
+
message?: string | undefined;
|
|
318
|
+
};
|
|
319
|
+
const toString: (message?: ErrMessage | undefined) => string | undefined;
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
declare namespace partialUtil {
|
|
323
|
+
type DeepPartial<T extends ZodTypeAny> = T extends ZodObject<ZodRawShape> ? ZodObject<{
|
|
324
|
+
[k in keyof T["shape"]]: ZodOptional<DeepPartial<T["shape"][k]>>;
|
|
325
|
+
}, T["_def"]["unknownKeys"], T["_def"]["catchall"]> : T extends ZodArray<infer Type, infer Card> ? ZodArray<DeepPartial<Type>, Card> : T extends ZodOptional<infer Type> ? ZodOptional<DeepPartial<Type>> : T extends ZodNullable<infer Type> ? ZodNullable<DeepPartial<Type>> : T extends ZodTuple<infer Items> ? {
|
|
326
|
+
[k in keyof Items]: Items[k] extends ZodTypeAny ? DeepPartial<Items[k]> : never;
|
|
327
|
+
} extends infer PI ? PI extends ZodTupleItems ? ZodTuple<PI> : never : never : T;
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
interface RefinementCtx {
|
|
331
|
+
addIssue: (arg: IssueData) => void;
|
|
332
|
+
path: (string | number)[];
|
|
333
|
+
}
|
|
334
|
+
declare type ZodRawShape = {
|
|
335
|
+
[k: string]: ZodTypeAny;
|
|
336
|
+
};
|
|
337
|
+
declare type ZodTypeAny = ZodType<any, any, any>;
|
|
338
|
+
declare type TypeOf<T extends ZodType<any, any, any>> = T["_output"];
|
|
339
|
+
declare type input<T extends ZodType<any, any, any>> = T["_input"];
|
|
340
|
+
declare type output<T extends ZodType<any, any, any>> = T["_output"];
|
|
341
|
+
|
|
342
|
+
declare type CustomErrorParams = Partial<util.Omit<ZodCustomIssue, "code">>;
|
|
343
|
+
interface ZodTypeDef {
|
|
344
|
+
errorMap?: ZodErrorMap;
|
|
345
|
+
description?: string;
|
|
346
|
+
}
|
|
347
|
+
declare type RawCreateParams = {
|
|
348
|
+
errorMap?: ZodErrorMap;
|
|
349
|
+
invalid_type_error?: string;
|
|
350
|
+
required_error?: string;
|
|
351
|
+
message?: string;
|
|
352
|
+
description?: string;
|
|
353
|
+
} | undefined;
|
|
354
|
+
declare type SafeParseSuccess<Output> = {
|
|
355
|
+
success: true;
|
|
356
|
+
data: Output;
|
|
357
|
+
error?: never;
|
|
358
|
+
};
|
|
359
|
+
declare type SafeParseError<Input> = {
|
|
360
|
+
success: false;
|
|
361
|
+
error: ZodError<Input>;
|
|
362
|
+
data?: never;
|
|
363
|
+
};
|
|
364
|
+
declare type SafeParseReturnType<Input, Output> = SafeParseSuccess<Output> | SafeParseError<Input>;
|
|
365
|
+
declare abstract class ZodType<Output = any, Def extends ZodTypeDef = ZodTypeDef, Input = Output> {
|
|
366
|
+
readonly _type: Output;
|
|
367
|
+
readonly _output: Output;
|
|
368
|
+
readonly _input: Input;
|
|
369
|
+
readonly _def: Def;
|
|
370
|
+
get description(): string | undefined;
|
|
371
|
+
abstract _parse(input: ParseInput): ParseReturnType<Output>;
|
|
372
|
+
_getType(input: ParseInput): string;
|
|
373
|
+
_getOrReturnCtx(input: ParseInput, ctx?: ParseContext | undefined): ParseContext;
|
|
374
|
+
_processInputParams(input: ParseInput): {
|
|
375
|
+
status: ParseStatus;
|
|
376
|
+
ctx: ParseContext;
|
|
377
|
+
};
|
|
378
|
+
_parseSync(input: ParseInput): SyncParseReturnType<Output>;
|
|
379
|
+
_parseAsync(input: ParseInput): AsyncParseReturnType<Output>;
|
|
380
|
+
parse(data: unknown, params?: Partial<ParseParams>): Output;
|
|
381
|
+
safeParse(data: unknown, params?: Partial<ParseParams>): SafeParseReturnType<Input, Output>;
|
|
382
|
+
parseAsync(data: unknown, params?: Partial<ParseParams>): Promise<Output>;
|
|
383
|
+
safeParseAsync(data: unknown, params?: Partial<ParseParams>): Promise<SafeParseReturnType<Input, Output>>;
|
|
384
|
+
/** Alias of safeParseAsync */
|
|
385
|
+
spa: (data: unknown, params?: Partial<ParseParams> | undefined) => Promise<SafeParseReturnType<Input, Output>>;
|
|
386
|
+
refine<RefinedOutput extends Output>(check: (arg: Output) => arg is RefinedOutput, message?: string | CustomErrorParams | ((arg: Output) => CustomErrorParams)): ZodEffects<this, RefinedOutput, Input>;
|
|
387
|
+
refine(check: (arg: Output) => unknown | Promise<unknown>, message?: string | CustomErrorParams | ((arg: Output) => CustomErrorParams)): ZodEffects<this, Output, Input>;
|
|
388
|
+
refinement<RefinedOutput extends Output>(check: (arg: Output) => arg is RefinedOutput, refinementData: IssueData | ((arg: Output, ctx: RefinementCtx) => IssueData)): ZodEffects<this, RefinedOutput, Input>;
|
|
389
|
+
refinement(check: (arg: Output) => boolean, refinementData: IssueData | ((arg: Output, ctx: RefinementCtx) => IssueData)): ZodEffects<this, Output, Input>;
|
|
390
|
+
_refinement(refinement: RefinementEffect<Output>["refinement"]): ZodEffects<this, Output, Input>;
|
|
391
|
+
superRefine<RefinedOutput extends Output>(refinement: (arg: Output, ctx: RefinementCtx) => arg is RefinedOutput): ZodEffects<this, RefinedOutput, Input>;
|
|
392
|
+
superRefine(refinement: (arg: Output, ctx: RefinementCtx) => void): ZodEffects<this, Output, Input>;
|
|
393
|
+
superRefine(refinement: (arg: Output, ctx: RefinementCtx) => Promise<void>): ZodEffects<this, Output, Input>;
|
|
394
|
+
constructor(def: Def);
|
|
395
|
+
optional(): ZodOptional<this>;
|
|
396
|
+
nullable(): ZodNullable<this>;
|
|
397
|
+
nullish(): ZodOptional<ZodNullable<this>>;
|
|
398
|
+
array(): ZodArray<this>;
|
|
399
|
+
promise(): ZodPromise<this>;
|
|
400
|
+
or<T extends ZodTypeAny>(option: T): ZodUnion<[this, T]>;
|
|
401
|
+
and<T extends ZodTypeAny>(incoming: T): ZodIntersection<this, T>;
|
|
402
|
+
transform<NewOut>(transform: (arg: Output, ctx: RefinementCtx) => NewOut | Promise<NewOut>): ZodEffects<this, NewOut>;
|
|
403
|
+
default(def: util.noUndefined<Input>): ZodDefault<this>;
|
|
404
|
+
default(def: () => util.noUndefined<Input>): ZodDefault<this>;
|
|
405
|
+
brand<B extends string | number | symbol>(brand?: B): ZodBranded<this, B>;
|
|
406
|
+
catch(def: Output): ZodCatch<this>;
|
|
407
|
+
catch(def: (ctx: {
|
|
408
|
+
error: ZodError;
|
|
409
|
+
input: Input;
|
|
410
|
+
}) => Output): ZodCatch<this>;
|
|
411
|
+
describe(description: string): this;
|
|
412
|
+
pipe<T extends ZodTypeAny>(target: T): ZodPipeline<this, T>;
|
|
413
|
+
readonly(): ZodReadonly<this>;
|
|
414
|
+
isOptional(): boolean;
|
|
415
|
+
isNullable(): boolean;
|
|
416
|
+
}
|
|
417
|
+
declare type IpVersion = "v4" | "v6";
|
|
418
|
+
declare type ZodStringCheck = {
|
|
419
|
+
kind: "min";
|
|
420
|
+
value: number;
|
|
421
|
+
message?: string;
|
|
422
|
+
} | {
|
|
423
|
+
kind: "max";
|
|
424
|
+
value: number;
|
|
425
|
+
message?: string;
|
|
426
|
+
} | {
|
|
427
|
+
kind: "length";
|
|
428
|
+
value: number;
|
|
429
|
+
message?: string;
|
|
430
|
+
} | {
|
|
431
|
+
kind: "email";
|
|
432
|
+
message?: string;
|
|
433
|
+
} | {
|
|
434
|
+
kind: "url";
|
|
435
|
+
message?: string;
|
|
436
|
+
} | {
|
|
437
|
+
kind: "emoji";
|
|
438
|
+
message?: string;
|
|
439
|
+
} | {
|
|
440
|
+
kind: "uuid";
|
|
441
|
+
message?: string;
|
|
442
|
+
} | {
|
|
443
|
+
kind: "nanoid";
|
|
444
|
+
message?: string;
|
|
445
|
+
} | {
|
|
446
|
+
kind: "cuid";
|
|
447
|
+
message?: string;
|
|
448
|
+
} | {
|
|
449
|
+
kind: "includes";
|
|
450
|
+
value: string;
|
|
451
|
+
position?: number;
|
|
452
|
+
message?: string;
|
|
453
|
+
} | {
|
|
454
|
+
kind: "cuid2";
|
|
455
|
+
message?: string;
|
|
456
|
+
} | {
|
|
457
|
+
kind: "ulid";
|
|
458
|
+
message?: string;
|
|
459
|
+
} | {
|
|
460
|
+
kind: "startsWith";
|
|
461
|
+
value: string;
|
|
462
|
+
message?: string;
|
|
463
|
+
} | {
|
|
464
|
+
kind: "endsWith";
|
|
465
|
+
value: string;
|
|
466
|
+
message?: string;
|
|
467
|
+
} | {
|
|
468
|
+
kind: "regex";
|
|
469
|
+
regex: RegExp;
|
|
470
|
+
message?: string;
|
|
471
|
+
} | {
|
|
472
|
+
kind: "trim";
|
|
473
|
+
message?: string;
|
|
474
|
+
} | {
|
|
475
|
+
kind: "toLowerCase";
|
|
476
|
+
message?: string;
|
|
477
|
+
} | {
|
|
478
|
+
kind: "toUpperCase";
|
|
479
|
+
message?: string;
|
|
480
|
+
} | {
|
|
481
|
+
kind: "datetime";
|
|
482
|
+
offset: boolean;
|
|
483
|
+
local: boolean;
|
|
484
|
+
precision: number | null;
|
|
485
|
+
message?: string;
|
|
486
|
+
} | {
|
|
487
|
+
kind: "date";
|
|
488
|
+
message?: string;
|
|
489
|
+
} | {
|
|
490
|
+
kind: "time";
|
|
491
|
+
precision: number | null;
|
|
492
|
+
message?: string;
|
|
493
|
+
} | {
|
|
494
|
+
kind: "duration";
|
|
495
|
+
message?: string;
|
|
496
|
+
} | {
|
|
497
|
+
kind: "ip";
|
|
498
|
+
version?: IpVersion;
|
|
499
|
+
message?: string;
|
|
500
|
+
} | {
|
|
501
|
+
kind: "base64";
|
|
502
|
+
message?: string;
|
|
503
|
+
};
|
|
504
|
+
interface ZodStringDef extends ZodTypeDef {
|
|
505
|
+
checks: ZodStringCheck[];
|
|
506
|
+
typeName: ZodFirstPartyTypeKind.ZodString;
|
|
507
|
+
coerce: boolean;
|
|
508
|
+
}
|
|
509
|
+
declare class ZodString extends ZodType<string, ZodStringDef, string> {
|
|
510
|
+
_parse(input: ParseInput): ParseReturnType<string>;
|
|
511
|
+
protected _regex(regex: RegExp, validation: StringValidation, message?: errorUtil.ErrMessage): ZodEffects<this, string, string>;
|
|
512
|
+
_addCheck(check: ZodStringCheck): ZodString;
|
|
513
|
+
email(message?: errorUtil.ErrMessage): ZodString;
|
|
514
|
+
url(message?: errorUtil.ErrMessage): ZodString;
|
|
515
|
+
emoji(message?: errorUtil.ErrMessage): ZodString;
|
|
516
|
+
uuid(message?: errorUtil.ErrMessage): ZodString;
|
|
517
|
+
nanoid(message?: errorUtil.ErrMessage): ZodString;
|
|
518
|
+
cuid(message?: errorUtil.ErrMessage): ZodString;
|
|
519
|
+
cuid2(message?: errorUtil.ErrMessage): ZodString;
|
|
520
|
+
ulid(message?: errorUtil.ErrMessage): ZodString;
|
|
521
|
+
base64(message?: errorUtil.ErrMessage): ZodString;
|
|
522
|
+
ip(options?: string | {
|
|
523
|
+
version?: "v4" | "v6";
|
|
524
|
+
message?: string;
|
|
525
|
+
}): ZodString;
|
|
526
|
+
datetime(options?: string | {
|
|
527
|
+
message?: string | undefined;
|
|
528
|
+
precision?: number | null;
|
|
529
|
+
offset?: boolean;
|
|
530
|
+
local?: boolean;
|
|
531
|
+
}): ZodString;
|
|
532
|
+
date(message?: string): ZodString;
|
|
533
|
+
time(options?: string | {
|
|
534
|
+
message?: string | undefined;
|
|
535
|
+
precision?: number | null;
|
|
536
|
+
}): ZodString;
|
|
537
|
+
duration(message?: errorUtil.ErrMessage): ZodString;
|
|
538
|
+
regex(regex: RegExp, message?: errorUtil.ErrMessage): ZodString;
|
|
539
|
+
includes(value: string, options?: {
|
|
540
|
+
message?: string;
|
|
541
|
+
position?: number;
|
|
542
|
+
}): ZodString;
|
|
543
|
+
startsWith(value: string, message?: errorUtil.ErrMessage): ZodString;
|
|
544
|
+
endsWith(value: string, message?: errorUtil.ErrMessage): ZodString;
|
|
545
|
+
min(minLength: number, message?: errorUtil.ErrMessage): ZodString;
|
|
546
|
+
max(maxLength: number, message?: errorUtil.ErrMessage): ZodString;
|
|
547
|
+
length(len: number, message?: errorUtil.ErrMessage): ZodString;
|
|
548
|
+
/**
|
|
549
|
+
* @deprecated Use z.string().min(1) instead.
|
|
550
|
+
* @see {@link ZodString.min}
|
|
551
|
+
*/
|
|
552
|
+
nonempty(message?: errorUtil.ErrMessage): ZodString;
|
|
553
|
+
trim(): ZodString;
|
|
554
|
+
toLowerCase(): ZodString;
|
|
555
|
+
toUpperCase(): ZodString;
|
|
556
|
+
get isDatetime(): boolean;
|
|
557
|
+
get isDate(): boolean;
|
|
558
|
+
get isTime(): boolean;
|
|
559
|
+
get isDuration(): boolean;
|
|
560
|
+
get isEmail(): boolean;
|
|
561
|
+
get isURL(): boolean;
|
|
562
|
+
get isEmoji(): boolean;
|
|
563
|
+
get isUUID(): boolean;
|
|
564
|
+
get isNANOID(): boolean;
|
|
565
|
+
get isCUID(): boolean;
|
|
566
|
+
get isCUID2(): boolean;
|
|
567
|
+
get isULID(): boolean;
|
|
568
|
+
get isIP(): boolean;
|
|
569
|
+
get isBase64(): boolean;
|
|
570
|
+
get minLength(): number | null;
|
|
571
|
+
get maxLength(): number | null;
|
|
572
|
+
static create: (params?: ({
|
|
573
|
+
errorMap?: ZodErrorMap | undefined;
|
|
574
|
+
invalid_type_error?: string | undefined;
|
|
575
|
+
required_error?: string | undefined;
|
|
576
|
+
message?: string | undefined;
|
|
577
|
+
description?: string | undefined;
|
|
578
|
+
} & {
|
|
579
|
+
coerce?: true | undefined;
|
|
580
|
+
}) | undefined) => ZodString;
|
|
581
|
+
}
|
|
582
|
+
declare type ZodNumberCheck = {
|
|
583
|
+
kind: "min";
|
|
584
|
+
value: number;
|
|
585
|
+
inclusive: boolean;
|
|
586
|
+
message?: string;
|
|
587
|
+
} | {
|
|
588
|
+
kind: "max";
|
|
589
|
+
value: number;
|
|
590
|
+
inclusive: boolean;
|
|
591
|
+
message?: string;
|
|
592
|
+
} | {
|
|
593
|
+
kind: "int";
|
|
594
|
+
message?: string;
|
|
595
|
+
} | {
|
|
596
|
+
kind: "multipleOf";
|
|
597
|
+
value: number;
|
|
598
|
+
message?: string;
|
|
599
|
+
} | {
|
|
600
|
+
kind: "finite";
|
|
601
|
+
message?: string;
|
|
602
|
+
};
|
|
603
|
+
interface ZodNumberDef extends ZodTypeDef {
|
|
604
|
+
checks: ZodNumberCheck[];
|
|
605
|
+
typeName: ZodFirstPartyTypeKind.ZodNumber;
|
|
606
|
+
coerce: boolean;
|
|
607
|
+
}
|
|
608
|
+
declare class ZodNumber extends ZodType<number, ZodNumberDef, number> {
|
|
609
|
+
_parse(input: ParseInput): ParseReturnType<number>;
|
|
610
|
+
static create: (params?: ({
|
|
611
|
+
errorMap?: ZodErrorMap | undefined;
|
|
612
|
+
invalid_type_error?: string | undefined;
|
|
613
|
+
required_error?: string | undefined;
|
|
614
|
+
message?: string | undefined;
|
|
615
|
+
description?: string | undefined;
|
|
616
|
+
} & {
|
|
617
|
+
coerce?: boolean | undefined;
|
|
618
|
+
}) | undefined) => ZodNumber;
|
|
619
|
+
gte(value: number, message?: errorUtil.ErrMessage): ZodNumber;
|
|
620
|
+
min: (value: number, message?: errorUtil.ErrMessage | undefined) => ZodNumber;
|
|
621
|
+
gt(value: number, message?: errorUtil.ErrMessage): ZodNumber;
|
|
622
|
+
lte(value: number, message?: errorUtil.ErrMessage): ZodNumber;
|
|
623
|
+
max: (value: number, message?: errorUtil.ErrMessage | undefined) => ZodNumber;
|
|
624
|
+
lt(value: number, message?: errorUtil.ErrMessage): ZodNumber;
|
|
625
|
+
protected setLimit(kind: "min" | "max", value: number, inclusive: boolean, message?: string): ZodNumber;
|
|
626
|
+
_addCheck(check: ZodNumberCheck): ZodNumber;
|
|
627
|
+
int(message?: errorUtil.ErrMessage): ZodNumber;
|
|
628
|
+
positive(message?: errorUtil.ErrMessage): ZodNumber;
|
|
629
|
+
negative(message?: errorUtil.ErrMessage): ZodNumber;
|
|
630
|
+
nonpositive(message?: errorUtil.ErrMessage): ZodNumber;
|
|
631
|
+
nonnegative(message?: errorUtil.ErrMessage): ZodNumber;
|
|
632
|
+
multipleOf(value: number, message?: errorUtil.ErrMessage): ZodNumber;
|
|
633
|
+
step: (value: number, message?: errorUtil.ErrMessage | undefined) => ZodNumber;
|
|
634
|
+
finite(message?: errorUtil.ErrMessage): ZodNumber;
|
|
635
|
+
safe(message?: errorUtil.ErrMessage): ZodNumber;
|
|
636
|
+
get minValue(): number | null;
|
|
637
|
+
get maxValue(): number | null;
|
|
638
|
+
get isInt(): boolean;
|
|
639
|
+
get isFinite(): boolean;
|
|
640
|
+
}
|
|
641
|
+
interface ZodBooleanDef extends ZodTypeDef {
|
|
642
|
+
typeName: ZodFirstPartyTypeKind.ZodBoolean;
|
|
643
|
+
coerce: boolean;
|
|
644
|
+
}
|
|
645
|
+
declare class ZodBoolean extends ZodType<boolean, ZodBooleanDef, boolean> {
|
|
646
|
+
_parse(input: ParseInput): ParseReturnType<boolean>;
|
|
647
|
+
static create: (params?: ({
|
|
648
|
+
errorMap?: ZodErrorMap | undefined;
|
|
649
|
+
invalid_type_error?: string | undefined;
|
|
650
|
+
required_error?: string | undefined;
|
|
651
|
+
message?: string | undefined;
|
|
652
|
+
description?: string | undefined;
|
|
653
|
+
} & {
|
|
654
|
+
coerce?: boolean | undefined;
|
|
655
|
+
}) | undefined) => ZodBoolean;
|
|
656
|
+
}
|
|
657
|
+
declare type ZodDateCheck = {
|
|
658
|
+
kind: "min";
|
|
659
|
+
value: number;
|
|
660
|
+
message?: string;
|
|
661
|
+
} | {
|
|
662
|
+
kind: "max";
|
|
663
|
+
value: number;
|
|
664
|
+
message?: string;
|
|
665
|
+
};
|
|
666
|
+
interface ZodDateDef extends ZodTypeDef {
|
|
667
|
+
checks: ZodDateCheck[];
|
|
668
|
+
coerce: boolean;
|
|
669
|
+
typeName: ZodFirstPartyTypeKind.ZodDate;
|
|
670
|
+
}
|
|
671
|
+
declare class ZodDate extends ZodType<Date, ZodDateDef, Date> {
|
|
672
|
+
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
|
673
|
+
_addCheck(check: ZodDateCheck): ZodDate;
|
|
674
|
+
min(minDate: Date, message?: errorUtil.ErrMessage): ZodDate;
|
|
675
|
+
max(maxDate: Date, message?: errorUtil.ErrMessage): ZodDate;
|
|
676
|
+
get minDate(): Date | null;
|
|
677
|
+
get maxDate(): Date | null;
|
|
678
|
+
static create: (params?: ({
|
|
679
|
+
errorMap?: ZodErrorMap | undefined;
|
|
680
|
+
invalid_type_error?: string | undefined;
|
|
681
|
+
required_error?: string | undefined;
|
|
682
|
+
message?: string | undefined;
|
|
683
|
+
description?: string | undefined;
|
|
684
|
+
} & {
|
|
685
|
+
coerce?: boolean | undefined;
|
|
686
|
+
}) | undefined) => ZodDate;
|
|
687
|
+
}
|
|
688
|
+
interface ZodArrayDef<T extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
|
|
689
|
+
type: T;
|
|
690
|
+
typeName: ZodFirstPartyTypeKind.ZodArray;
|
|
691
|
+
exactLength: {
|
|
692
|
+
value: number;
|
|
693
|
+
message?: string;
|
|
694
|
+
} | null;
|
|
695
|
+
minLength: {
|
|
696
|
+
value: number;
|
|
697
|
+
message?: string;
|
|
698
|
+
} | null;
|
|
699
|
+
maxLength: {
|
|
700
|
+
value: number;
|
|
701
|
+
message?: string;
|
|
702
|
+
} | null;
|
|
703
|
+
}
|
|
704
|
+
declare type ArrayCardinality = "many" | "atleastone";
|
|
705
|
+
declare type arrayOutputType<T extends ZodTypeAny, Cardinality extends ArrayCardinality = "many"> = Cardinality extends "atleastone" ? [T["_output"], ...T["_output"][]] : T["_output"][];
|
|
706
|
+
declare class ZodArray<T extends ZodTypeAny, Cardinality extends ArrayCardinality = "many"> extends ZodType<arrayOutputType<T, Cardinality>, ZodArrayDef<T>, Cardinality extends "atleastone" ? [T["_input"], ...T["_input"][]] : T["_input"][]> {
|
|
707
|
+
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
|
708
|
+
get element(): T;
|
|
709
|
+
min(minLength: number, message?: errorUtil.ErrMessage): this;
|
|
710
|
+
max(maxLength: number, message?: errorUtil.ErrMessage): this;
|
|
711
|
+
length(len: number, message?: errorUtil.ErrMessage): this;
|
|
712
|
+
nonempty(message?: errorUtil.ErrMessage): ZodArray<T, "atleastone">;
|
|
713
|
+
static create: <T_1 extends ZodTypeAny>(schema: T_1, params?: RawCreateParams) => ZodArray<T_1, "many">;
|
|
714
|
+
}
|
|
715
|
+
declare type UnknownKeysParam = "passthrough" | "strict" | "strip";
|
|
716
|
+
interface ZodObjectDef<T extends ZodRawShape = ZodRawShape, UnknownKeys extends UnknownKeysParam = UnknownKeysParam, Catchall extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
|
|
717
|
+
typeName: ZodFirstPartyTypeKind.ZodObject;
|
|
718
|
+
shape: () => T;
|
|
719
|
+
catchall: Catchall;
|
|
720
|
+
unknownKeys: UnknownKeys;
|
|
721
|
+
}
|
|
722
|
+
declare type objectOutputType<Shape extends ZodRawShape, Catchall extends ZodTypeAny, UnknownKeys extends UnknownKeysParam = UnknownKeysParam> = objectUtil.flatten<objectUtil.addQuestionMarks<baseObjectOutputType<Shape>>> & CatchallOutput<Catchall> & PassthroughType<UnknownKeys>;
|
|
723
|
+
declare type baseObjectOutputType<Shape extends ZodRawShape> = {
|
|
724
|
+
[k in keyof Shape]: Shape[k]["_output"];
|
|
725
|
+
};
|
|
726
|
+
declare type objectInputType<Shape extends ZodRawShape, Catchall extends ZodTypeAny, UnknownKeys extends UnknownKeysParam = UnknownKeysParam> = objectUtil.flatten<baseObjectInputType<Shape>> & CatchallInput<Catchall> & PassthroughType<UnknownKeys>;
|
|
727
|
+
declare type baseObjectInputType<Shape extends ZodRawShape> = objectUtil.addQuestionMarks<{
|
|
728
|
+
[k in keyof Shape]: Shape[k]["_input"];
|
|
729
|
+
}>;
|
|
730
|
+
declare type CatchallOutput<T extends ZodType> = ZodType extends T ? unknown : {
|
|
731
|
+
[k: string]: T["_output"];
|
|
732
|
+
};
|
|
733
|
+
declare type CatchallInput<T extends ZodType> = ZodType extends T ? unknown : {
|
|
734
|
+
[k: string]: T["_input"];
|
|
735
|
+
};
|
|
736
|
+
declare type PassthroughType<T extends UnknownKeysParam> = T extends "passthrough" ? {
|
|
737
|
+
[k: string]: unknown;
|
|
738
|
+
} : unknown;
|
|
739
|
+
declare type deoptional<T extends ZodTypeAny> = T extends ZodOptional<infer U> ? deoptional<U> : T extends ZodNullable<infer U> ? ZodNullable<deoptional<U>> : T;
|
|
740
|
+
declare class ZodObject<T extends ZodRawShape, UnknownKeys extends UnknownKeysParam = UnknownKeysParam, Catchall extends ZodTypeAny = ZodTypeAny, Output = objectOutputType<T, Catchall, UnknownKeys>, Input = objectInputType<T, Catchall, UnknownKeys>> extends ZodType<Output, ZodObjectDef<T, UnknownKeys, Catchall>, Input> {
|
|
741
|
+
private _cached;
|
|
742
|
+
_getCached(): {
|
|
743
|
+
shape: T;
|
|
744
|
+
keys: string[];
|
|
745
|
+
};
|
|
746
|
+
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
|
747
|
+
get shape(): T;
|
|
748
|
+
strict(message?: errorUtil.ErrMessage): ZodObject<T, "strict", Catchall>;
|
|
749
|
+
strip(): ZodObject<T, "strip", Catchall>;
|
|
750
|
+
passthrough(): ZodObject<T, "passthrough", Catchall>;
|
|
751
|
+
/**
|
|
752
|
+
* @deprecated In most cases, this is no longer needed - unknown properties are now silently stripped.
|
|
753
|
+
* If you want to pass through unknown properties, use `.passthrough()` instead.
|
|
754
|
+
*/
|
|
755
|
+
nonstrict: () => ZodObject<T, "passthrough", Catchall>;
|
|
756
|
+
extend<Augmentation extends ZodRawShape>(augmentation: Augmentation): ZodObject<objectUtil.extendShape<T, Augmentation>, UnknownKeys, Catchall>;
|
|
757
|
+
/**
|
|
758
|
+
* @deprecated Use `.extend` instead
|
|
759
|
+
* */
|
|
760
|
+
augment: <Augmentation extends ZodRawShape>(augmentation: Augmentation) => ZodObject<objectUtil.extendShape<T, Augmentation>, UnknownKeys, Catchall, objectOutputType<objectUtil.extendShape<T, Augmentation>, Catchall, UnknownKeys>, objectInputType<objectUtil.extendShape<T, Augmentation>, Catchall, UnknownKeys>>;
|
|
761
|
+
/**
|
|
762
|
+
* Prior to zod@1.0.12 there was a bug in the
|
|
763
|
+
* inferred type of merged objects. Please
|
|
764
|
+
* upgrade if you are experiencing issues.
|
|
765
|
+
*/
|
|
766
|
+
merge<Incoming extends AnyZodObject, Augmentation extends Incoming["shape"]>(merging: Incoming): ZodObject<objectUtil.extendShape<T, Augmentation>, Incoming["_def"]["unknownKeys"], Incoming["_def"]["catchall"]>;
|
|
767
|
+
setKey<Key extends string, Schema extends ZodTypeAny>(key: Key, schema: Schema): ZodObject<T & {
|
|
768
|
+
[k in Key]: Schema;
|
|
769
|
+
}, UnknownKeys, Catchall>;
|
|
770
|
+
catchall<Index extends ZodTypeAny>(index: Index): ZodObject<T, UnknownKeys, Index>;
|
|
771
|
+
pick<Mask extends util.Exactly<{
|
|
772
|
+
[k in keyof T]?: true;
|
|
773
|
+
}, Mask>>(mask: Mask): ZodObject<Pick<T, Extract<keyof T, keyof Mask>>, UnknownKeys, Catchall>;
|
|
774
|
+
omit<Mask extends util.Exactly<{
|
|
775
|
+
[k in keyof T]?: true;
|
|
776
|
+
}, Mask>>(mask: Mask): ZodObject<Omit<T, keyof Mask>, UnknownKeys, Catchall>;
|
|
777
|
+
/**
|
|
778
|
+
* @deprecated
|
|
779
|
+
*/
|
|
780
|
+
deepPartial(): partialUtil.DeepPartial<this>;
|
|
781
|
+
partial(): ZodObject<{
|
|
782
|
+
[k in keyof T]: ZodOptional<T[k]>;
|
|
783
|
+
}, UnknownKeys, Catchall>;
|
|
784
|
+
partial<Mask extends util.Exactly<{
|
|
785
|
+
[k in keyof T]?: true;
|
|
786
|
+
}, Mask>>(mask: Mask): ZodObject<objectUtil.noNever<{
|
|
787
|
+
[k in keyof T]: k extends keyof Mask ? ZodOptional<T[k]> : T[k];
|
|
788
|
+
}>, UnknownKeys, Catchall>;
|
|
789
|
+
required(): ZodObject<{
|
|
790
|
+
[k in keyof T]: deoptional<T[k]>;
|
|
791
|
+
}, UnknownKeys, Catchall>;
|
|
792
|
+
required<Mask extends util.Exactly<{
|
|
793
|
+
[k in keyof T]?: true;
|
|
794
|
+
}, Mask>>(mask: Mask): ZodObject<objectUtil.noNever<{
|
|
795
|
+
[k in keyof T]: k extends keyof Mask ? deoptional<T[k]> : T[k];
|
|
796
|
+
}>, UnknownKeys, Catchall>;
|
|
797
|
+
keyof(): ZodEnum<enumUtil.UnionToTupleString<keyof T>>;
|
|
798
|
+
static create: <T_1 extends ZodRawShape>(shape: T_1, params?: RawCreateParams) => ZodObject<T_1, "strip", ZodTypeAny, { [k in keyof objectUtil.addQuestionMarks<baseObjectOutputType<T_1>, any>]: objectUtil.addQuestionMarks<baseObjectOutputType<T_1>, any>[k]; }, { [k_1 in keyof baseObjectInputType<T_1>]: baseObjectInputType<T_1>[k_1]; }>;
|
|
799
|
+
static strictCreate: <T_1 extends ZodRawShape>(shape: T_1, params?: RawCreateParams) => ZodObject<T_1, "strict", ZodTypeAny, { [k in keyof objectUtil.addQuestionMarks<baseObjectOutputType<T_1>, any>]: objectUtil.addQuestionMarks<baseObjectOutputType<T_1>, any>[k]; }, { [k_1 in keyof baseObjectInputType<T_1>]: baseObjectInputType<T_1>[k_1]; }>;
|
|
800
|
+
static lazycreate: <T_1 extends ZodRawShape>(shape: () => T_1, params?: RawCreateParams) => ZodObject<T_1, "strip", ZodTypeAny, { [k in keyof objectUtil.addQuestionMarks<baseObjectOutputType<T_1>, any>]: objectUtil.addQuestionMarks<baseObjectOutputType<T_1>, any>[k]; }, { [k_1 in keyof baseObjectInputType<T_1>]: baseObjectInputType<T_1>[k_1]; }>;
|
|
801
|
+
}
|
|
802
|
+
declare type AnyZodObject = ZodObject<any, any, any>;
|
|
803
|
+
declare type ZodUnionOptions = Readonly<[ZodTypeAny, ...ZodTypeAny[]]>;
|
|
804
|
+
interface ZodUnionDef<T extends ZodUnionOptions = Readonly<[
|
|
805
|
+
ZodTypeAny,
|
|
806
|
+
ZodTypeAny,
|
|
807
|
+
...ZodTypeAny[]
|
|
808
|
+
]>> extends ZodTypeDef {
|
|
809
|
+
options: T;
|
|
810
|
+
typeName: ZodFirstPartyTypeKind.ZodUnion;
|
|
811
|
+
}
|
|
812
|
+
declare class ZodUnion<T extends ZodUnionOptions> extends ZodType<T[number]["_output"], ZodUnionDef<T>, T[number]["_input"]> {
|
|
813
|
+
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
|
814
|
+
get options(): T;
|
|
815
|
+
static create: <T_1 extends readonly [ZodTypeAny, ZodTypeAny, ...ZodTypeAny[]]>(types: T_1, params?: RawCreateParams) => ZodUnion<T_1>;
|
|
816
|
+
}
|
|
817
|
+
interface ZodIntersectionDef<T extends ZodTypeAny = ZodTypeAny, U extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
|
|
818
|
+
left: T;
|
|
819
|
+
right: U;
|
|
820
|
+
typeName: ZodFirstPartyTypeKind.ZodIntersection;
|
|
821
|
+
}
|
|
822
|
+
declare class ZodIntersection<T extends ZodTypeAny, U extends ZodTypeAny> extends ZodType<T["_output"] & U["_output"], ZodIntersectionDef<T, U>, T["_input"] & U["_input"]> {
|
|
823
|
+
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
|
824
|
+
static create: <T_1 extends ZodTypeAny, U_1 extends ZodTypeAny>(left: T_1, right: U_1, params?: RawCreateParams) => ZodIntersection<T_1, U_1>;
|
|
825
|
+
}
|
|
826
|
+
declare type ZodTupleItems = [ZodTypeAny, ...ZodTypeAny[]];
|
|
827
|
+
declare type AssertArray<T> = T extends any[] ? T : never;
|
|
828
|
+
declare type OutputTypeOfTuple<T extends ZodTupleItems | []> = AssertArray<{
|
|
829
|
+
[k in keyof T]: T[k] extends ZodType<any, any, any> ? T[k]["_output"] : never;
|
|
830
|
+
}>;
|
|
831
|
+
declare type OutputTypeOfTupleWithRest<T extends ZodTupleItems | [], Rest extends ZodTypeAny | null = null> = Rest extends ZodTypeAny ? [...OutputTypeOfTuple<T>, ...Rest["_output"][]] : OutputTypeOfTuple<T>;
|
|
832
|
+
declare type InputTypeOfTuple<T extends ZodTupleItems | []> = AssertArray<{
|
|
833
|
+
[k in keyof T]: T[k] extends ZodType<any, any, any> ? T[k]["_input"] : never;
|
|
834
|
+
}>;
|
|
835
|
+
declare type InputTypeOfTupleWithRest<T extends ZodTupleItems | [], Rest extends ZodTypeAny | null = null> = Rest extends ZodTypeAny ? [...InputTypeOfTuple<T>, ...Rest["_input"][]] : InputTypeOfTuple<T>;
|
|
836
|
+
interface ZodTupleDef<T extends ZodTupleItems | [] = ZodTupleItems, Rest extends ZodTypeAny | null = null> extends ZodTypeDef {
|
|
837
|
+
items: T;
|
|
838
|
+
rest: Rest;
|
|
839
|
+
typeName: ZodFirstPartyTypeKind.ZodTuple;
|
|
840
|
+
}
|
|
841
|
+
declare class ZodTuple<T extends [ZodTypeAny, ...ZodTypeAny[]] | [] = [ZodTypeAny, ...ZodTypeAny[]], Rest extends ZodTypeAny | null = null> extends ZodType<OutputTypeOfTupleWithRest<T, Rest>, ZodTupleDef<T, Rest>, InputTypeOfTupleWithRest<T, Rest>> {
|
|
842
|
+
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
|
843
|
+
get items(): T;
|
|
844
|
+
rest<Rest extends ZodTypeAny>(rest: Rest): ZodTuple<T, Rest>;
|
|
845
|
+
static create: <T_1 extends [] | [ZodTypeAny, ...ZodTypeAny[]]>(schemas: T_1, params?: RawCreateParams) => ZodTuple<T_1, null>;
|
|
846
|
+
}
|
|
847
|
+
interface ZodLiteralDef<T = any> extends ZodTypeDef {
|
|
848
|
+
value: T;
|
|
849
|
+
typeName: ZodFirstPartyTypeKind.ZodLiteral;
|
|
850
|
+
}
|
|
851
|
+
declare class ZodLiteral<T> extends ZodType<T, ZodLiteralDef<T>, T> {
|
|
852
|
+
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
|
853
|
+
get value(): T;
|
|
854
|
+
static create: <T_1 extends Primitive>(value: T_1, params?: RawCreateParams) => ZodLiteral<T_1>;
|
|
855
|
+
}
|
|
856
|
+
declare type EnumValues<T extends string = string> = readonly [T, ...T[]];
|
|
857
|
+
declare type Values<T extends EnumValues> = {
|
|
858
|
+
[k in T[number]]: k;
|
|
859
|
+
};
|
|
860
|
+
interface ZodEnumDef<T extends EnumValues = EnumValues> extends ZodTypeDef {
|
|
861
|
+
values: T;
|
|
862
|
+
typeName: ZodFirstPartyTypeKind.ZodEnum;
|
|
863
|
+
}
|
|
864
|
+
declare type Writeable<T> = {
|
|
865
|
+
-readonly [P in keyof T]: T[P];
|
|
866
|
+
};
|
|
867
|
+
declare type FilterEnum<Values, ToExclude> = Values extends [] ? [] : Values extends [infer Head, ...infer Rest] ? Head extends ToExclude ? FilterEnum<Rest, ToExclude> : [Head, ...FilterEnum<Rest, ToExclude>] : never;
|
|
868
|
+
declare type typecast<A, T> = A extends T ? A : never;
|
|
869
|
+
declare function createZodEnum<U extends string, T extends Readonly<[U, ...U[]]>>(values: T, params?: RawCreateParams): ZodEnum<Writeable<T>>;
|
|
870
|
+
declare function createZodEnum<U extends string, T extends [U, ...U[]]>(values: T, params?: RawCreateParams): ZodEnum<T>;
|
|
871
|
+
declare class ZodEnum<T extends [string, ...string[]]> extends ZodType<T[number], ZodEnumDef<T>, T[number]> {
|
|
872
|
+
#private;
|
|
873
|
+
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
|
874
|
+
get options(): T;
|
|
875
|
+
get enum(): Values<T>;
|
|
876
|
+
get Values(): Values<T>;
|
|
877
|
+
get Enum(): Values<T>;
|
|
878
|
+
extract<ToExtract extends readonly [T[number], ...T[number][]]>(values: ToExtract, newDef?: RawCreateParams): ZodEnum<Writeable<ToExtract>>;
|
|
879
|
+
exclude<ToExclude extends readonly [T[number], ...T[number][]]>(values: ToExclude, newDef?: RawCreateParams): ZodEnum<typecast<Writeable<FilterEnum<T, ToExclude[number]>>, [string, ...string[]]>>;
|
|
880
|
+
static create: typeof createZodEnum;
|
|
881
|
+
}
|
|
882
|
+
interface ZodPromiseDef<T extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
|
|
883
|
+
type: T;
|
|
884
|
+
typeName: ZodFirstPartyTypeKind.ZodPromise;
|
|
885
|
+
}
|
|
886
|
+
declare class ZodPromise<T extends ZodTypeAny> extends ZodType<Promise<T["_output"]>, ZodPromiseDef<T>, Promise<T["_input"]>> {
|
|
887
|
+
unwrap(): T;
|
|
888
|
+
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
|
889
|
+
static create: <T_1 extends ZodTypeAny>(schema: T_1, params?: RawCreateParams) => ZodPromise<T_1>;
|
|
890
|
+
}
|
|
891
|
+
declare type RefinementEffect<T> = {
|
|
892
|
+
type: "refinement";
|
|
893
|
+
refinement: (arg: T, ctx: RefinementCtx) => any;
|
|
894
|
+
};
|
|
895
|
+
declare type TransformEffect<T> = {
|
|
896
|
+
type: "transform";
|
|
897
|
+
transform: (arg: T, ctx: RefinementCtx) => any;
|
|
898
|
+
};
|
|
899
|
+
declare type PreprocessEffect<T> = {
|
|
900
|
+
type: "preprocess";
|
|
901
|
+
transform: (arg: T, ctx: RefinementCtx) => any;
|
|
902
|
+
};
|
|
903
|
+
declare type Effect<T> = RefinementEffect<T> | TransformEffect<T> | PreprocessEffect<T>;
|
|
904
|
+
interface ZodEffectsDef<T extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
|
|
905
|
+
schema: T;
|
|
906
|
+
typeName: ZodFirstPartyTypeKind.ZodEffects;
|
|
907
|
+
effect: Effect<any>;
|
|
908
|
+
}
|
|
909
|
+
declare class ZodEffects<T extends ZodTypeAny, Output = output<T>, Input = input<T>> extends ZodType<Output, ZodEffectsDef<T>, Input> {
|
|
910
|
+
innerType(): T;
|
|
911
|
+
sourceType(): T;
|
|
912
|
+
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
|
913
|
+
static create: <I extends ZodTypeAny>(schema: I, effect: Effect<I["_output"]>, params?: RawCreateParams) => ZodEffects<I, I["_output"], input<I>>;
|
|
914
|
+
static createWithPreprocess: <I extends ZodTypeAny>(preprocess: (arg: unknown, ctx: RefinementCtx) => unknown, schema: I, params?: RawCreateParams) => ZodEffects<I, I["_output"], unknown>;
|
|
915
|
+
}
|
|
916
|
+
|
|
917
|
+
interface ZodOptionalDef<T extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
|
|
918
|
+
innerType: T;
|
|
919
|
+
typeName: ZodFirstPartyTypeKind.ZodOptional;
|
|
920
|
+
}
|
|
921
|
+
declare class ZodOptional<T extends ZodTypeAny> extends ZodType<T["_output"] | undefined, ZodOptionalDef<T>, T["_input"] | undefined> {
|
|
922
|
+
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
|
923
|
+
unwrap(): T;
|
|
924
|
+
static create: <T_1 extends ZodTypeAny>(type: T_1, params?: RawCreateParams) => ZodOptional<T_1>;
|
|
925
|
+
}
|
|
926
|
+
interface ZodNullableDef<T extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
|
|
927
|
+
innerType: T;
|
|
928
|
+
typeName: ZodFirstPartyTypeKind.ZodNullable;
|
|
929
|
+
}
|
|
930
|
+
declare class ZodNullable<T extends ZodTypeAny> extends ZodType<T["_output"] | null, ZodNullableDef<T>, T["_input"] | null> {
|
|
931
|
+
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
|
932
|
+
unwrap(): T;
|
|
933
|
+
static create: <T_1 extends ZodTypeAny>(type: T_1, params?: RawCreateParams) => ZodNullable<T_1>;
|
|
934
|
+
}
|
|
935
|
+
interface ZodDefaultDef<T extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
|
|
936
|
+
innerType: T;
|
|
937
|
+
defaultValue: () => util.noUndefined<T["_input"]>;
|
|
938
|
+
typeName: ZodFirstPartyTypeKind.ZodDefault;
|
|
939
|
+
}
|
|
940
|
+
declare class ZodDefault<T extends ZodTypeAny> extends ZodType<util.noUndefined<T["_output"]>, ZodDefaultDef<T>, T["_input"] | undefined> {
|
|
941
|
+
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
|
942
|
+
removeDefault(): T;
|
|
943
|
+
static create: <T_1 extends ZodTypeAny>(type: T_1, params: {
|
|
944
|
+
errorMap?: ZodErrorMap | undefined;
|
|
945
|
+
invalid_type_error?: string | undefined;
|
|
946
|
+
required_error?: string | undefined;
|
|
947
|
+
message?: string | undefined;
|
|
948
|
+
description?: string | undefined;
|
|
949
|
+
} & {
|
|
950
|
+
default: T_1["_input"] | (() => util.noUndefined<T_1["_input"]>);
|
|
951
|
+
}) => ZodDefault<T_1>;
|
|
952
|
+
}
|
|
953
|
+
interface ZodCatchDef<T extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
|
|
954
|
+
innerType: T;
|
|
955
|
+
catchValue: (ctx: {
|
|
956
|
+
error: ZodError;
|
|
957
|
+
input: unknown;
|
|
958
|
+
}) => T["_input"];
|
|
959
|
+
typeName: ZodFirstPartyTypeKind.ZodCatch;
|
|
960
|
+
}
|
|
961
|
+
declare class ZodCatch<T extends ZodTypeAny> extends ZodType<T["_output"], ZodCatchDef<T>, unknown> {
|
|
962
|
+
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
|
963
|
+
removeCatch(): T;
|
|
964
|
+
static create: <T_1 extends ZodTypeAny>(type: T_1, params: {
|
|
965
|
+
errorMap?: ZodErrorMap | undefined;
|
|
966
|
+
invalid_type_error?: string | undefined;
|
|
967
|
+
required_error?: string | undefined;
|
|
968
|
+
message?: string | undefined;
|
|
969
|
+
description?: string | undefined;
|
|
970
|
+
} & {
|
|
971
|
+
catch: T_1["_output"] | (() => T_1["_output"]);
|
|
972
|
+
}) => ZodCatch<T_1>;
|
|
973
|
+
}
|
|
974
|
+
interface ZodBrandedDef<T extends ZodTypeAny> extends ZodTypeDef {
|
|
975
|
+
type: T;
|
|
976
|
+
typeName: ZodFirstPartyTypeKind.ZodBranded;
|
|
977
|
+
}
|
|
978
|
+
declare const BRAND: unique symbol;
|
|
979
|
+
declare type BRAND<T extends string | number | symbol> = {
|
|
980
|
+
[BRAND]: {
|
|
981
|
+
[k in T]: true;
|
|
982
|
+
};
|
|
983
|
+
};
|
|
984
|
+
declare class ZodBranded<T extends ZodTypeAny, B extends string | number | symbol> extends ZodType<T["_output"] & BRAND<B>, ZodBrandedDef<T>, T["_input"]> {
|
|
985
|
+
_parse(input: ParseInput): ParseReturnType<any>;
|
|
986
|
+
unwrap(): T;
|
|
987
|
+
}
|
|
988
|
+
interface ZodPipelineDef<A extends ZodTypeAny, B extends ZodTypeAny> extends ZodTypeDef {
|
|
989
|
+
in: A;
|
|
990
|
+
out: B;
|
|
991
|
+
typeName: ZodFirstPartyTypeKind.ZodPipeline;
|
|
992
|
+
}
|
|
993
|
+
declare class ZodPipeline<A extends ZodTypeAny, B extends ZodTypeAny> extends ZodType<B["_output"], ZodPipelineDef<A, B>, A["_input"]> {
|
|
994
|
+
_parse(input: ParseInput): ParseReturnType<any>;
|
|
995
|
+
static create<A extends ZodTypeAny, B extends ZodTypeAny>(a: A, b: B): ZodPipeline<A, B>;
|
|
996
|
+
}
|
|
997
|
+
declare type BuiltIn = (((...args: any[]) => any) | (new (...args: any[]) => any)) | {
|
|
998
|
+
readonly [Symbol.toStringTag]: string;
|
|
999
|
+
} | Date | Error | Generator | Promise<unknown> | RegExp;
|
|
1000
|
+
declare type MakeReadonly<T> = T extends Map<infer K, infer V> ? ReadonlyMap<K, V> : T extends Set<infer V> ? ReadonlySet<V> : T extends [infer Head, ...infer Tail] ? readonly [Head, ...Tail] : T extends Array<infer V> ? ReadonlyArray<V> : T extends BuiltIn ? T : Readonly<T>;
|
|
1001
|
+
interface ZodReadonlyDef<T extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
|
|
1002
|
+
innerType: T;
|
|
1003
|
+
typeName: ZodFirstPartyTypeKind.ZodReadonly;
|
|
1004
|
+
}
|
|
1005
|
+
declare class ZodReadonly<T extends ZodTypeAny> extends ZodType<MakeReadonly<T["_output"]>, ZodReadonlyDef<T>, MakeReadonly<T["_input"]>> {
|
|
1006
|
+
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
|
1007
|
+
static create: <T_1 extends ZodTypeAny>(type: T_1, params?: RawCreateParams) => ZodReadonly<T_1>;
|
|
1008
|
+
unwrap(): T;
|
|
1009
|
+
}
|
|
1010
|
+
declare enum ZodFirstPartyTypeKind {
|
|
1011
|
+
ZodString = "ZodString",
|
|
1012
|
+
ZodNumber = "ZodNumber",
|
|
1013
|
+
ZodNaN = "ZodNaN",
|
|
1014
|
+
ZodBigInt = "ZodBigInt",
|
|
1015
|
+
ZodBoolean = "ZodBoolean",
|
|
1016
|
+
ZodDate = "ZodDate",
|
|
1017
|
+
ZodSymbol = "ZodSymbol",
|
|
1018
|
+
ZodUndefined = "ZodUndefined",
|
|
1019
|
+
ZodNull = "ZodNull",
|
|
1020
|
+
ZodAny = "ZodAny",
|
|
1021
|
+
ZodUnknown = "ZodUnknown",
|
|
1022
|
+
ZodNever = "ZodNever",
|
|
1023
|
+
ZodVoid = "ZodVoid",
|
|
1024
|
+
ZodArray = "ZodArray",
|
|
1025
|
+
ZodObject = "ZodObject",
|
|
1026
|
+
ZodUnion = "ZodUnion",
|
|
1027
|
+
ZodDiscriminatedUnion = "ZodDiscriminatedUnion",
|
|
1028
|
+
ZodIntersection = "ZodIntersection",
|
|
1029
|
+
ZodTuple = "ZodTuple",
|
|
1030
|
+
ZodRecord = "ZodRecord",
|
|
1031
|
+
ZodMap = "ZodMap",
|
|
1032
|
+
ZodSet = "ZodSet",
|
|
1033
|
+
ZodFunction = "ZodFunction",
|
|
1034
|
+
ZodLazy = "ZodLazy",
|
|
1035
|
+
ZodLiteral = "ZodLiteral",
|
|
1036
|
+
ZodEnum = "ZodEnum",
|
|
1037
|
+
ZodEffects = "ZodEffects",
|
|
1038
|
+
ZodNativeEnum = "ZodNativeEnum",
|
|
1039
|
+
ZodOptional = "ZodOptional",
|
|
1040
|
+
ZodNullable = "ZodNullable",
|
|
1041
|
+
ZodDefault = "ZodDefault",
|
|
1042
|
+
ZodCatch = "ZodCatch",
|
|
1043
|
+
ZodPromise = "ZodPromise",
|
|
1044
|
+
ZodBranded = "ZodBranded",
|
|
1045
|
+
ZodPipeline = "ZodPipeline",
|
|
1046
|
+
ZodReadonly = "ZodReadonly"
|
|
1047
|
+
}
|
|
1048
|
+
|
|
1049
|
+
/**
|
|
1050
|
+
* zod schema definition for the entity AI Models
|
|
1051
|
+
*/
|
|
1052
|
+
declare const AIModelSchema: ZodObject<{
|
|
1053
|
+
ID: ZodString;
|
|
1054
|
+
Name: ZodString;
|
|
1055
|
+
Description: ZodOptional<ZodNullable<ZodString>>;
|
|
1056
|
+
Vendor: ZodOptional<ZodNullable<ZodString>>;
|
|
1057
|
+
AIModelTypeID: ZodString;
|
|
1058
|
+
PowerRank: ZodOptional<ZodNullable<ZodNumber>>;
|
|
1059
|
+
IsActive: ZodBoolean;
|
|
1060
|
+
DriverClass: ZodOptional<ZodNullable<ZodString>>;
|
|
1061
|
+
DriverImportPath: ZodOptional<ZodNullable<ZodString>>;
|
|
1062
|
+
APIName: ZodOptional<ZodNullable<ZodString>>;
|
|
1063
|
+
__mj_CreatedAt: ZodDate;
|
|
1064
|
+
__mj_UpdatedAt: ZodDate;
|
|
1065
|
+
AIModelType: ZodString;
|
|
1066
|
+
}, "strip", ZodTypeAny, {
|
|
1067
|
+
ID?: string;
|
|
1068
|
+
__mj_CreatedAt?: Date;
|
|
1069
|
+
__mj_UpdatedAt?: Date;
|
|
1070
|
+
Name?: string;
|
|
1071
|
+
Description?: string;
|
|
1072
|
+
IsActive?: boolean;
|
|
1073
|
+
Vendor?: string;
|
|
1074
|
+
AIModelTypeID?: string;
|
|
1075
|
+
PowerRank?: number;
|
|
1076
|
+
DriverClass?: string;
|
|
1077
|
+
DriverImportPath?: string;
|
|
1078
|
+
APIName?: string;
|
|
1079
|
+
AIModelType?: string;
|
|
1080
|
+
}, {
|
|
1081
|
+
ID?: string;
|
|
1082
|
+
__mj_CreatedAt?: Date;
|
|
1083
|
+
__mj_UpdatedAt?: Date;
|
|
1084
|
+
Name?: string;
|
|
1085
|
+
Description?: string;
|
|
1086
|
+
IsActive?: boolean;
|
|
1087
|
+
Vendor?: string;
|
|
1088
|
+
AIModelTypeID?: string;
|
|
1089
|
+
PowerRank?: number;
|
|
1090
|
+
DriverClass?: string;
|
|
1091
|
+
DriverImportPath?: string;
|
|
1092
|
+
APIName?: string;
|
|
1093
|
+
AIModelType?: string;
|
|
1094
|
+
}>;
|
|
1095
|
+
type AIModelEntityType = TypeOf<typeof AIModelSchema>;
|
|
1096
|
+
/**
|
|
1097
|
+
* zod schema definition for the entity Entity Documents
|
|
1098
|
+
*/
|
|
1099
|
+
declare const EntityDocumentSchema: ZodObject<{
|
|
1100
|
+
ID: ZodString;
|
|
1101
|
+
Name: ZodString;
|
|
1102
|
+
TypeID: ZodString;
|
|
1103
|
+
EntityID: ZodString;
|
|
1104
|
+
VectorDatabaseID: ZodString;
|
|
1105
|
+
Status: ZodUnion<[ZodLiteral<"Active">, ZodLiteral<"Inactive">]>;
|
|
1106
|
+
TemplateID: ZodString;
|
|
1107
|
+
AIModelID: ZodString;
|
|
1108
|
+
PotentialMatchThreshold: ZodNumber;
|
|
1109
|
+
AbsoluteMatchThreshold: ZodNumber;
|
|
1110
|
+
__mj_CreatedAt: ZodDate;
|
|
1111
|
+
__mj_UpdatedAt: ZodDate;
|
|
1112
|
+
Type: ZodString;
|
|
1113
|
+
Entity: ZodString;
|
|
1114
|
+
VectorDatabase: ZodString;
|
|
1115
|
+
Template: ZodString;
|
|
1116
|
+
AIModel: ZodString;
|
|
1117
|
+
}, "strip", ZodTypeAny, {
|
|
1118
|
+
ID?: string;
|
|
1119
|
+
__mj_CreatedAt?: Date;
|
|
1120
|
+
__mj_UpdatedAt?: Date;
|
|
1121
|
+
Name?: string;
|
|
1122
|
+
Status?: "Active" | "Inactive";
|
|
1123
|
+
Type?: string;
|
|
1124
|
+
AIModelID?: string;
|
|
1125
|
+
AIModel?: string;
|
|
1126
|
+
EntityID?: string;
|
|
1127
|
+
Entity?: string;
|
|
1128
|
+
TypeID?: string;
|
|
1129
|
+
VectorDatabaseID?: string;
|
|
1130
|
+
TemplateID?: string;
|
|
1131
|
+
PotentialMatchThreshold?: number;
|
|
1132
|
+
AbsoluteMatchThreshold?: number;
|
|
1133
|
+
VectorDatabase?: string;
|
|
1134
|
+
Template?: string;
|
|
1135
|
+
}, {
|
|
1136
|
+
ID?: string;
|
|
1137
|
+
__mj_CreatedAt?: Date;
|
|
1138
|
+
__mj_UpdatedAt?: Date;
|
|
1139
|
+
Name?: string;
|
|
1140
|
+
Status?: "Active" | "Inactive";
|
|
1141
|
+
Type?: string;
|
|
1142
|
+
AIModelID?: string;
|
|
1143
|
+
AIModel?: string;
|
|
1144
|
+
EntityID?: string;
|
|
1145
|
+
Entity?: string;
|
|
1146
|
+
TypeID?: string;
|
|
1147
|
+
VectorDatabaseID?: string;
|
|
1148
|
+
TemplateID?: string;
|
|
1149
|
+
PotentialMatchThreshold?: number;
|
|
1150
|
+
AbsoluteMatchThreshold?: number;
|
|
1151
|
+
VectorDatabase?: string;
|
|
1152
|
+
Template?: string;
|
|
1153
|
+
}>;
|
|
1154
|
+
type EntityDocumentEntityType = TypeOf<typeof EntityDocumentSchema>;
|
|
1155
|
+
/**
|
|
1156
|
+
* zod schema definition for the entity Template Contents
|
|
1157
|
+
*/
|
|
1158
|
+
declare const TemplateContentSchema: ZodObject<{
|
|
1159
|
+
ID: ZodString;
|
|
1160
|
+
TemplateID: ZodString;
|
|
1161
|
+
TypeID: ZodString;
|
|
1162
|
+
TemplateText: ZodOptional<ZodNullable<ZodString>>;
|
|
1163
|
+
Priority: ZodNumber;
|
|
1164
|
+
IsActive: ZodBoolean;
|
|
1165
|
+
__mj_CreatedAt: ZodDate;
|
|
1166
|
+
__mj_UpdatedAt: ZodDate;
|
|
1167
|
+
Template: ZodString;
|
|
1168
|
+
Type: ZodString;
|
|
1169
|
+
}, "strip", ZodTypeAny, {
|
|
1170
|
+
ID?: string;
|
|
1171
|
+
__mj_CreatedAt?: Date;
|
|
1172
|
+
__mj_UpdatedAt?: Date;
|
|
1173
|
+
Type?: string;
|
|
1174
|
+
IsActive?: boolean;
|
|
1175
|
+
Priority?: number;
|
|
1176
|
+
TypeID?: string;
|
|
1177
|
+
TemplateID?: string;
|
|
1178
|
+
Template?: string;
|
|
1179
|
+
TemplateText?: string;
|
|
1180
|
+
}, {
|
|
1181
|
+
ID?: string;
|
|
1182
|
+
__mj_CreatedAt?: Date;
|
|
1183
|
+
__mj_UpdatedAt?: Date;
|
|
1184
|
+
Type?: string;
|
|
1185
|
+
IsActive?: boolean;
|
|
1186
|
+
Priority?: number;
|
|
1187
|
+
TypeID?: string;
|
|
1188
|
+
TemplateID?: string;
|
|
1189
|
+
Template?: string;
|
|
1190
|
+
TemplateText?: string;
|
|
1191
|
+
}>;
|
|
1192
|
+
type TemplateContentEntityType = TypeOf<typeof TemplateContentSchema>;
|
|
1193
|
+
/**
|
|
1194
|
+
* zod schema definition for the entity Templates
|
|
1195
|
+
*/
|
|
1196
|
+
declare const TemplateSchema: ZodObject<{
|
|
1197
|
+
ID: ZodString;
|
|
1198
|
+
Name: ZodString;
|
|
1199
|
+
Description: ZodOptional<ZodNullable<ZodString>>;
|
|
1200
|
+
CategoryID: ZodOptional<ZodNullable<ZodString>>;
|
|
1201
|
+
UserPrompt: ZodOptional<ZodNullable<ZodString>>;
|
|
1202
|
+
UserID: ZodString;
|
|
1203
|
+
ActiveAt: ZodOptional<ZodNullable<ZodDate>>;
|
|
1204
|
+
DisabledAt: ZodOptional<ZodNullable<ZodDate>>;
|
|
1205
|
+
IsActive: ZodBoolean;
|
|
1206
|
+
__mj_CreatedAt: ZodDate;
|
|
1207
|
+
__mj_UpdatedAt: ZodDate;
|
|
1208
|
+
Category: ZodOptional<ZodNullable<ZodString>>;
|
|
1209
|
+
User: ZodString;
|
|
1210
|
+
}, "strip", ZodTypeAny, {
|
|
1211
|
+
Category?: string;
|
|
1212
|
+
ID?: string;
|
|
1213
|
+
__mj_CreatedAt?: Date;
|
|
1214
|
+
__mj_UpdatedAt?: Date;
|
|
1215
|
+
Name?: string;
|
|
1216
|
+
Description?: string;
|
|
1217
|
+
UserID?: string;
|
|
1218
|
+
User?: string;
|
|
1219
|
+
CategoryID?: string;
|
|
1220
|
+
UserPrompt?: string;
|
|
1221
|
+
IsActive?: boolean;
|
|
1222
|
+
ActiveAt?: Date;
|
|
1223
|
+
DisabledAt?: Date;
|
|
1224
|
+
}, {
|
|
1225
|
+
Category?: string;
|
|
1226
|
+
ID?: string;
|
|
1227
|
+
__mj_CreatedAt?: Date;
|
|
1228
|
+
__mj_UpdatedAt?: Date;
|
|
1229
|
+
Name?: string;
|
|
1230
|
+
Description?: string;
|
|
1231
|
+
UserID?: string;
|
|
1232
|
+
User?: string;
|
|
1233
|
+
CategoryID?: string;
|
|
1234
|
+
UserPrompt?: string;
|
|
1235
|
+
IsActive?: boolean;
|
|
1236
|
+
ActiveAt?: Date;
|
|
1237
|
+
DisabledAt?: Date;
|
|
1238
|
+
}>;
|
|
1239
|
+
type TemplateEntityType = TypeOf<typeof TemplateSchema>;
|
|
1240
|
+
/**
|
|
1241
|
+
* zod schema definition for the entity Vector Databases
|
|
1242
|
+
*/
|
|
1243
|
+
declare const VectorDatabaseSchema: ZodObject<{
|
|
1244
|
+
ID: ZodString;
|
|
1245
|
+
Name: ZodString;
|
|
1246
|
+
Description: ZodOptional<ZodNullable<ZodString>>;
|
|
1247
|
+
DefaultURL: ZodOptional<ZodNullable<ZodString>>;
|
|
1248
|
+
ClassKey: ZodOptional<ZodNullable<ZodString>>;
|
|
1249
|
+
__mj_CreatedAt: ZodDate;
|
|
1250
|
+
__mj_UpdatedAt: ZodDate;
|
|
1251
|
+
}, "strip", ZodTypeAny, {
|
|
1252
|
+
ID?: string;
|
|
1253
|
+
__mj_CreatedAt?: Date;
|
|
1254
|
+
__mj_UpdatedAt?: Date;
|
|
1255
|
+
Name?: string;
|
|
1256
|
+
Description?: string;
|
|
1257
|
+
DefaultURL?: string;
|
|
1258
|
+
ClassKey?: string;
|
|
1259
|
+
}, {
|
|
1260
|
+
ID?: string;
|
|
1261
|
+
__mj_CreatedAt?: Date;
|
|
1262
|
+
__mj_UpdatedAt?: Date;
|
|
1263
|
+
Name?: string;
|
|
1264
|
+
Description?: string;
|
|
1265
|
+
DefaultURL?: string;
|
|
1266
|
+
ClassKey?: string;
|
|
1267
|
+
}>;
|
|
1268
|
+
type VectorDatabaseEntityType = TypeOf<typeof VectorDatabaseSchema>;
|
|
7
1269
|
/**
|
|
8
1270
|
* AI Models - strongly typed entity sub-class
|
|
9
1271
|
* * Schema: __mj
|
|
10
1272
|
* * Base Table: AIModel
|
|
11
1273
|
* * Base View: vwAIModels
|
|
12
|
-
* * @description Catalog of all AI Models configured in the system
|
|
1274
|
+
* * @description Catalog of all AI Models configured in the system
|
|
13
1275
|
* * Primary Key: ID
|
|
14
1276
|
* @extends {BaseEntity}
|
|
15
1277
|
* @class
|
|
16
1278
|
* @public
|
|
17
1279
|
*/
|
|
18
|
-
declare class AIModelEntity extends BaseEntity {
|
|
1280
|
+
declare class AIModelEntity extends BaseEntity<AIModelEntityType> {
|
|
19
1281
|
/**
|
|
20
1282
|
* Loads the AI Models record from the database
|
|
21
1283
|
* @param ID: string - primary key value to load the AI Models record.
|
|
@@ -133,7 +1395,7 @@ declare class AIModelEntity extends BaseEntity {
|
|
|
133
1395
|
* @class
|
|
134
1396
|
* @public
|
|
135
1397
|
*/
|
|
136
|
-
declare class EntityDocumentEntity extends BaseEntity {
|
|
1398
|
+
declare class EntityDocumentEntity extends BaseEntity<EntityDocumentEntityType> {
|
|
137
1399
|
/**
|
|
138
1400
|
* Loads the Entity Documents record from the database
|
|
139
1401
|
* @param ID: string - primary key value to load the Entity Documents record.
|
|
@@ -269,21 +1531,18 @@ declare class EntityDocumentEntity extends BaseEntity {
|
|
|
269
1531
|
* * Field Name: VectorDatabase
|
|
270
1532
|
* * Display Name: Vector Database
|
|
271
1533
|
* * SQL Data Type: nvarchar(100)
|
|
272
|
-
* * Default Value: null
|
|
273
1534
|
*/
|
|
274
1535
|
get VectorDatabase(): string;
|
|
275
1536
|
/**
|
|
276
1537
|
* * Field Name: Template
|
|
277
1538
|
* * Display Name: Template
|
|
278
1539
|
* * SQL Data Type: nvarchar(255)
|
|
279
|
-
* * Default Value: null
|
|
280
1540
|
*/
|
|
281
1541
|
get Template(): string;
|
|
282
1542
|
/**
|
|
283
1543
|
* * Field Name: AIModel
|
|
284
1544
|
* * Display Name: AIModel
|
|
285
1545
|
* * SQL Data Type: nvarchar(50)
|
|
286
|
-
* * Default Value: null
|
|
287
1546
|
*/
|
|
288
1547
|
get AIModel(): string;
|
|
289
1548
|
}
|
|
@@ -298,7 +1557,7 @@ declare class EntityDocumentEntity extends BaseEntity {
|
|
|
298
1557
|
* @class
|
|
299
1558
|
* @public
|
|
300
1559
|
*/
|
|
301
|
-
declare class TemplateContentEntity extends BaseEntity {
|
|
1560
|
+
declare class TemplateContentEntity extends BaseEntity<TemplateContentEntityType> {
|
|
302
1561
|
/**
|
|
303
1562
|
* Loads the Template Contents record from the database
|
|
304
1563
|
* @param ID: string - primary key value to load the Template Contents record.
|
|
@@ -406,7 +1665,7 @@ declare class TemplateContentEntity extends BaseEntity {
|
|
|
406
1665
|
* @class
|
|
407
1666
|
* @public
|
|
408
1667
|
*/
|
|
409
|
-
declare class TemplateEntity extends BaseEntity {
|
|
1668
|
+
declare class TemplateEntity extends BaseEntity<TemplateEntityType> {
|
|
410
1669
|
/**
|
|
411
1670
|
* Loads the Templates record from the database
|
|
412
1671
|
* @param ID: string - primary key value to load the Templates record.
|
|
@@ -537,7 +1796,7 @@ declare class TemplateEntity extends BaseEntity {
|
|
|
537
1796
|
* @class
|
|
538
1797
|
* @public
|
|
539
1798
|
*/
|
|
540
|
-
declare class VectorDatabaseEntity extends BaseEntity {
|
|
1799
|
+
declare class VectorDatabaseEntity extends BaseEntity<VectorDatabaseEntityType> {
|
|
541
1800
|
/**
|
|
542
1801
|
* Loads the Vector Databases record from the database
|
|
543
1802
|
* @param ID: string - primary key value to load the Vector Databases record.
|