vibedgames 0.8.1 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +17 -8
- package/assets/align-framing.py +242 -0
- package/assets/render-model.py +406 -0
- package/assets/tilemap-editor.html +630 -0
- package/dist/THIRD_PARTY_NOTICES.txt +59 -7
- package/dist/chunk-2KVQJKIZ.js +6495 -0
- package/dist/chunk-2SBBKY5C.js +16993 -0
- package/dist/chunk-2ZKS7V72.js +170 -0
- package/dist/{chunk-RAUJA3OY.js → chunk-3HGBIUM5.js} +21 -18
- package/dist/chunk-3UGGMFJJ.js +22 -0
- package/dist/{chunk-I6O4HIDY.js → chunk-42K3BJJH.js} +163 -131
- package/dist/chunk-43P4U7CB.js +104 -0
- package/dist/chunk-4FJXCS3K.js +741 -0
- package/dist/{chunk-NC5XCGYU.js → chunk-4UU622RK.js} +6 -5
- package/dist/{chunk-2QBYTIMH.js → chunk-5535KDYI.js} +1 -1
- package/dist/chunk-5YPLKGY3.js +87 -0
- package/dist/chunk-6KXXZXSO.js +475 -0
- package/dist/chunk-7RPLQWR2.js +91 -0
- package/dist/{chunk-C2IRIRAA.js → chunk-A556KALN.js} +15 -14
- package/dist/{chunk-N3XAUFKH.js → chunk-ABTUEIRC.js} +576 -301
- package/dist/{chunk-PEUP4MZR.js → chunk-AWJNAGPE.js} +6 -3
- package/dist/{chunk-QGEITHUP.js → chunk-BN3Q7UEC.js} +22 -19
- package/dist/chunk-BZOMEG3X.js +412 -0
- package/dist/{chunk-ZYCSYJWX.js → chunk-COSLGSVO.js} +14 -24
- package/dist/{chunk-PQDBCZRT.js → chunk-CTY2WZQK.js} +204 -158
- package/dist/{chunk-CU7UY5YJ.js → chunk-D2RF35HJ.js} +1 -1
- package/dist/chunk-DB7WVFS7.js +80 -0
- package/dist/chunk-DOOQUFPG.js +73 -0
- package/dist/chunk-E3FJUPLT.js +177 -0
- package/dist/chunk-E7NDOZ27.js +428 -0
- package/dist/chunk-F42QKWBB.js +39 -0
- package/dist/chunk-FXXVXDTW.js +168 -0
- package/dist/{chunk-VFFOT7KD.js → chunk-G66HRVDW.js} +1 -1
- package/dist/{chunk-CAKBGDCY.js → chunk-GKDUYJ7R.js} +5 -0
- package/dist/chunk-GLEW7VJQ.js +45 -0
- package/dist/{chunk-MGIASPED.js → chunk-H2C4QUTG.js} +9 -8
- package/dist/{chunk-HCMTSR7E.js → chunk-HRKVAXNN.js} +21 -17
- package/dist/{chunk-TLRL6FHW.js → chunk-HSMG6U7J.js} +10 -9
- package/dist/chunk-HX5Q63UA.js +48 -0
- package/dist/chunk-HYOXGNWS.js +53 -0
- package/dist/chunk-I5LELJSK.js +22 -0
- package/dist/{chunk-6FZPPUQH.js → chunk-JN4WZCR7.js} +5 -4
- package/dist/{chunk-QJZ72MSY.js → chunk-K36EOII3.js} +7 -6
- package/dist/chunk-KAGVI3CE.js +62 -0
- package/dist/chunk-KJK5CB6E.js +58 -0
- package/dist/chunk-KLFBAFXD.js +25 -0
- package/dist/{chunk-7MKUR7Y3.js → chunk-LONQWRTR.js} +112 -81
- package/dist/chunk-LORGE2NB.js +2484 -0
- package/dist/{chunk-HKA5LBYW.js → chunk-MEAO33XW.js} +22 -19
- package/dist/{chunk-PM5UOIKR.js → chunk-MR5KIFI7.js} +22 -21
- package/dist/{chunk-GCX5KQ6A.js → chunk-N2UHAQXC.js} +18 -11
- package/dist/chunk-NCX6LYNJ.js +117 -0
- package/dist/chunk-OGX4DKIS.js +215 -0
- package/dist/chunk-OPUCUUID.js +41 -0
- package/dist/chunk-Q2QC6KAZ.js +132 -0
- package/dist/{chunk-2GL2WJZX.js → chunk-Q3XQPNF6.js} +14 -14
- package/dist/{chunk-RYFO3ZPO.js → chunk-Q5NZNXJE.js} +15 -12
- package/dist/{chunk-JT2AU24K.js → chunk-QARXJGI5.js} +1 -1
- package/dist/chunk-QLCVLCPM.js +126 -0
- package/dist/chunk-R2WVORGD.js +91 -0
- package/dist/chunk-RKS7SI5L.js +64 -0
- package/dist/{chunk-4BGCA3W7.js → chunk-RPJR3S5S.js} +32 -18
- package/dist/chunk-RPSUFZAG.js +3307 -0
- package/dist/chunk-RRI23NK2.js +40 -0
- package/dist/chunk-S7HYWITX.js +57 -0
- package/dist/chunk-SBXCK2I2.js +48 -0
- package/dist/chunk-SUSX3QIA.js +62 -0
- package/dist/{chunk-PHEDW6C7.js → chunk-SXYQL4GK.js} +16 -7
- package/dist/{chunk-ZI6PKVXG.js → chunk-TMPBGXT4.js} +6 -5
- package/dist/chunk-TXOE5UY5.js +72 -0
- package/dist/chunk-U6DTE5IX.js +124 -0
- package/dist/chunk-UPHB5HWO.js +115 -0
- package/dist/chunk-UQ7VO6B3.js +91 -0
- package/dist/chunk-VB4WLJR2.js +47 -0
- package/dist/{chunk-FNYBZNW2.js → chunk-VIEKOGKG.js} +21 -3
- package/dist/{chunk-QIVCBUYD.js → chunk-VZEJ2ZHE.js} +18 -18
- package/dist/chunk-X75Y7LUW.js +126 -0
- package/dist/{chunk-Z4Z24FWO.js → chunk-YNCYMWER.js} +8 -5
- package/dist/chunk-ZHLPE6LI.js +71 -0
- package/dist/index.js +48 -34
- package/package.json +32 -16
- package/templates/none/src/main.ts +4 -0
- package/templates/none/vite.config.ts +0 -2
- package/templates/phaser/src/main.ts +0 -1
- package/templates/phaser/src/scenes/game-scene.ts +10 -8
- package/templates/phaser/vite.config.ts +0 -2
- package/templates/react-r3f/src/app.tsx +3 -1
- package/templates/react-r3f/src/main.tsx +1 -0
- package/templates/react-r3f/vite.config.ts +0 -2
- package/templates/threejs/src/main.ts +10 -1
- package/templates/threejs/vite.config.ts +0 -2
- package/LICENSE +0 -21
- package/dist/chunk-AYJQVZXY.js +0 -39
- package/dist/chunk-J6PKNPI2.js +0 -26
- package/dist/chunk-MJQSHP3Y.js +0 -415
- package/dist/chunk-MYFLYNPO.js +0 -68
|
@@ -0,0 +1,3307 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from "node:module";
|
|
2
|
+
import { dirname as __pathDirname } from "node:path";
|
|
3
|
+
import { fileURLToPath as __fileURLToPath } from "node:url";
|
|
4
|
+
const require = __createRequire(import.meta.url);
|
|
5
|
+
var __filename = __fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = __pathDirname(__filename);
|
|
7
|
+
import {
|
|
8
|
+
$ZodAny,
|
|
9
|
+
$ZodArray,
|
|
10
|
+
$ZodBase64,
|
|
11
|
+
$ZodBase64URL,
|
|
12
|
+
$ZodBigInt,
|
|
13
|
+
$ZodBigIntFormat,
|
|
14
|
+
$ZodBoolean,
|
|
15
|
+
$ZodCIDRv4,
|
|
16
|
+
$ZodCIDRv6,
|
|
17
|
+
$ZodCUID,
|
|
18
|
+
$ZodCUID2,
|
|
19
|
+
$ZodCatch,
|
|
20
|
+
$ZodCheck,
|
|
21
|
+
$ZodCodec,
|
|
22
|
+
$ZodCreditCard,
|
|
23
|
+
$ZodCustom,
|
|
24
|
+
$ZodCustomStringFormat,
|
|
25
|
+
$ZodDate,
|
|
26
|
+
$ZodDefault,
|
|
27
|
+
$ZodDiscriminatedUnion,
|
|
28
|
+
$ZodE164,
|
|
29
|
+
$ZodEmail,
|
|
30
|
+
$ZodEmoji,
|
|
31
|
+
$ZodEncodeError,
|
|
32
|
+
$ZodEnum,
|
|
33
|
+
$ZodError,
|
|
34
|
+
$ZodExactOptional,
|
|
35
|
+
$ZodFile,
|
|
36
|
+
$ZodFunction,
|
|
37
|
+
$ZodGUID,
|
|
38
|
+
$ZodIBAN,
|
|
39
|
+
$ZodIPv4,
|
|
40
|
+
$ZodIPv6,
|
|
41
|
+
$ZodISODate,
|
|
42
|
+
$ZodISODateTime,
|
|
43
|
+
$ZodISODuration,
|
|
44
|
+
$ZodISOTime,
|
|
45
|
+
$ZodIntersection,
|
|
46
|
+
$ZodJWT,
|
|
47
|
+
$ZodKSUID,
|
|
48
|
+
$ZodLazy,
|
|
49
|
+
$ZodLiteral,
|
|
50
|
+
$ZodMAC,
|
|
51
|
+
$ZodMap,
|
|
52
|
+
$ZodNaN,
|
|
53
|
+
$ZodNanoID,
|
|
54
|
+
$ZodNever,
|
|
55
|
+
$ZodNonOptional,
|
|
56
|
+
$ZodNull,
|
|
57
|
+
$ZodNullable,
|
|
58
|
+
$ZodNumber,
|
|
59
|
+
$ZodNumberFormat,
|
|
60
|
+
$ZodObjectJIT,
|
|
61
|
+
$ZodOptional,
|
|
62
|
+
$ZodPipe,
|
|
63
|
+
$ZodPrefault,
|
|
64
|
+
$ZodPreprocess,
|
|
65
|
+
$ZodPromise,
|
|
66
|
+
$ZodReadonly,
|
|
67
|
+
$ZodRecord,
|
|
68
|
+
$ZodSet,
|
|
69
|
+
$ZodString,
|
|
70
|
+
$ZodStringFormat,
|
|
71
|
+
$ZodSuccess,
|
|
72
|
+
$ZodSymbol,
|
|
73
|
+
$ZodTemplateLiteral,
|
|
74
|
+
$ZodTransform,
|
|
75
|
+
$ZodTuple,
|
|
76
|
+
$ZodType,
|
|
77
|
+
$ZodULID,
|
|
78
|
+
$ZodURL,
|
|
79
|
+
$ZodUUID,
|
|
80
|
+
$ZodUndefined,
|
|
81
|
+
$ZodUnion,
|
|
82
|
+
$ZodUnknown,
|
|
83
|
+
$ZodVoid,
|
|
84
|
+
$ZodXID,
|
|
85
|
+
$ZodXor,
|
|
86
|
+
$brand,
|
|
87
|
+
$constructor,
|
|
88
|
+
$input,
|
|
89
|
+
$output,
|
|
90
|
+
INVALID,
|
|
91
|
+
NEVER,
|
|
92
|
+
TimePrecision,
|
|
93
|
+
ZodCompileAsyncError,
|
|
94
|
+
ZodCompileUnsupportedError,
|
|
95
|
+
_any,
|
|
96
|
+
_array,
|
|
97
|
+
_base64,
|
|
98
|
+
_base64url,
|
|
99
|
+
_bigint,
|
|
100
|
+
_boolean,
|
|
101
|
+
_cidrv4,
|
|
102
|
+
_cidrv6,
|
|
103
|
+
_coercedBigint,
|
|
104
|
+
_coercedBoolean,
|
|
105
|
+
_coercedDate,
|
|
106
|
+
_coercedNumber,
|
|
107
|
+
_coercedString,
|
|
108
|
+
_creditCard,
|
|
109
|
+
_cuid,
|
|
110
|
+
_cuid2,
|
|
111
|
+
_custom,
|
|
112
|
+
_date,
|
|
113
|
+
_decode,
|
|
114
|
+
_decodeAsync,
|
|
115
|
+
_e164,
|
|
116
|
+
_email,
|
|
117
|
+
_emoji,
|
|
118
|
+
_encode,
|
|
119
|
+
_encodeAsync,
|
|
120
|
+
_endsWith,
|
|
121
|
+
_file,
|
|
122
|
+
_float32,
|
|
123
|
+
_float64,
|
|
124
|
+
_gt,
|
|
125
|
+
_gte,
|
|
126
|
+
_guid,
|
|
127
|
+
_iban,
|
|
128
|
+
_includes,
|
|
129
|
+
_int,
|
|
130
|
+
_int32,
|
|
131
|
+
_int64,
|
|
132
|
+
_ipv4,
|
|
133
|
+
_ipv6,
|
|
134
|
+
_isoDate,
|
|
135
|
+
_isoDateTime,
|
|
136
|
+
_isoDuration,
|
|
137
|
+
_isoTime,
|
|
138
|
+
_jwt,
|
|
139
|
+
_ksuid,
|
|
140
|
+
_length,
|
|
141
|
+
_lowercase,
|
|
142
|
+
_lt,
|
|
143
|
+
_lte,
|
|
144
|
+
_mac,
|
|
145
|
+
_maxLength,
|
|
146
|
+
_maxSize,
|
|
147
|
+
_mime,
|
|
148
|
+
_minLength,
|
|
149
|
+
_minSize,
|
|
150
|
+
_multipleOf,
|
|
151
|
+
_nan,
|
|
152
|
+
_nanoid,
|
|
153
|
+
_negative,
|
|
154
|
+
_never,
|
|
155
|
+
_nonnegative,
|
|
156
|
+
_nonpositive,
|
|
157
|
+
_normalize,
|
|
158
|
+
_null,
|
|
159
|
+
_number,
|
|
160
|
+
_overwrite,
|
|
161
|
+
_parse,
|
|
162
|
+
_parseAsync,
|
|
163
|
+
_positive,
|
|
164
|
+
_properties,
|
|
165
|
+
_property,
|
|
166
|
+
_refine,
|
|
167
|
+
_regex,
|
|
168
|
+
_safeDecode,
|
|
169
|
+
_safeDecodeAsync,
|
|
170
|
+
_safeEncode,
|
|
171
|
+
_safeEncodeAsync,
|
|
172
|
+
_safeParse,
|
|
173
|
+
_safeParseAsync,
|
|
174
|
+
_size,
|
|
175
|
+
_slugify,
|
|
176
|
+
_startsWith,
|
|
177
|
+
_string,
|
|
178
|
+
_stringFormat,
|
|
179
|
+
_stringbool,
|
|
180
|
+
_superRefine,
|
|
181
|
+
_symbol,
|
|
182
|
+
_toLowerCase,
|
|
183
|
+
_toUpperCase,
|
|
184
|
+
_trim,
|
|
185
|
+
_uint32,
|
|
186
|
+
_uint64,
|
|
187
|
+
_ulid,
|
|
188
|
+
_undefined,
|
|
189
|
+
_unknown,
|
|
190
|
+
_uppercase,
|
|
191
|
+
_url,
|
|
192
|
+
_uuid,
|
|
193
|
+
_uuidv4,
|
|
194
|
+
_uuidv6,
|
|
195
|
+
_uuidv7,
|
|
196
|
+
_void,
|
|
197
|
+
_xid,
|
|
198
|
+
aggregateChecks,
|
|
199
|
+
anyProcessor,
|
|
200
|
+
arrayProcessor,
|
|
201
|
+
assignProp,
|
|
202
|
+
bigintProcessor,
|
|
203
|
+
booleanProcessor,
|
|
204
|
+
catchProcessor,
|
|
205
|
+
clone,
|
|
206
|
+
compile,
|
|
207
|
+
config,
|
|
208
|
+
core_exports,
|
|
209
|
+
createStandardJSONSchemaMethod,
|
|
210
|
+
createToJSONSchemaMethod,
|
|
211
|
+
currencyCode,
|
|
212
|
+
customProcessor,
|
|
213
|
+
dateProcessor,
|
|
214
|
+
defaultProcessor,
|
|
215
|
+
describe,
|
|
216
|
+
domain,
|
|
217
|
+
en_default,
|
|
218
|
+
enumProcessor,
|
|
219
|
+
fileProcessor,
|
|
220
|
+
flattenError,
|
|
221
|
+
formatError,
|
|
222
|
+
functionProcessor,
|
|
223
|
+
getDiscriminatedOption,
|
|
224
|
+
globalConfig,
|
|
225
|
+
globalRegistry,
|
|
226
|
+
hex,
|
|
227
|
+
hostname,
|
|
228
|
+
httpProtocol,
|
|
229
|
+
intersectionProcessor,
|
|
230
|
+
isPlainObject,
|
|
231
|
+
jsonStringifyReplacer,
|
|
232
|
+
lazyProcessor,
|
|
233
|
+
literalProcessor,
|
|
234
|
+
locales_exports,
|
|
235
|
+
mapProcessor,
|
|
236
|
+
memoizer,
|
|
237
|
+
mergeDefs,
|
|
238
|
+
meta,
|
|
239
|
+
nanProcessor,
|
|
240
|
+
neverProcessor,
|
|
241
|
+
nonoptionalProcessor,
|
|
242
|
+
nullProcessor,
|
|
243
|
+
nullableProcessor,
|
|
244
|
+
numberProcessor,
|
|
245
|
+
objectProcessor,
|
|
246
|
+
optionalProcessor,
|
|
247
|
+
pipeProcessor,
|
|
248
|
+
prefaultProcessor,
|
|
249
|
+
prettifyError,
|
|
250
|
+
promiseProcessor,
|
|
251
|
+
readonlyProcessor,
|
|
252
|
+
recordProcessor,
|
|
253
|
+
regexes_exports,
|
|
254
|
+
registry,
|
|
255
|
+
setProcessor,
|
|
256
|
+
standardProps,
|
|
257
|
+
stringProcessor,
|
|
258
|
+
successProcessor,
|
|
259
|
+
symbolProcessor,
|
|
260
|
+
templateLiteralProcessor,
|
|
261
|
+
toJSONSchema,
|
|
262
|
+
toZod,
|
|
263
|
+
transformProcessor,
|
|
264
|
+
treeifyError,
|
|
265
|
+
tupleProcessor,
|
|
266
|
+
undefinedProcessor,
|
|
267
|
+
unionProcessor,
|
|
268
|
+
unknownProcessor,
|
|
269
|
+
util_exports,
|
|
270
|
+
validate,
|
|
271
|
+
validateAsync,
|
|
272
|
+
voidProcessor,
|
|
273
|
+
withParser
|
|
274
|
+
} from "./chunk-2SBBKY5C.js";
|
|
275
|
+
import {
|
|
276
|
+
__export
|
|
277
|
+
} from "./chunk-GKDUYJ7R.js";
|
|
278
|
+
|
|
279
|
+
// ../../node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/classic/external.js
|
|
280
|
+
var external_exports = {};
|
|
281
|
+
__export(external_exports, {
|
|
282
|
+
$brand: () => $brand,
|
|
283
|
+
$input: () => $input,
|
|
284
|
+
$output: () => $output,
|
|
285
|
+
INVALID: () => INVALID,
|
|
286
|
+
NEVER: () => NEVER,
|
|
287
|
+
TimePrecision: () => TimePrecision,
|
|
288
|
+
ZodAny: () => ZodAny,
|
|
289
|
+
ZodArray: () => ZodArray,
|
|
290
|
+
ZodBase64: () => ZodBase64,
|
|
291
|
+
ZodBase64URL: () => ZodBase64URL,
|
|
292
|
+
ZodBigInt: () => ZodBigInt,
|
|
293
|
+
ZodBigIntFormat: () => ZodBigIntFormat,
|
|
294
|
+
ZodBoolean: () => ZodBoolean,
|
|
295
|
+
ZodCIDRv4: () => ZodCIDRv4,
|
|
296
|
+
ZodCIDRv6: () => ZodCIDRv6,
|
|
297
|
+
ZodCUID: () => ZodCUID,
|
|
298
|
+
ZodCUID2: () => ZodCUID2,
|
|
299
|
+
ZodCatch: () => ZodCatch,
|
|
300
|
+
ZodCodec: () => ZodCodec,
|
|
301
|
+
ZodCompileAsyncError: () => ZodCompileAsyncError,
|
|
302
|
+
ZodCompileUnsupportedError: () => ZodCompileUnsupportedError,
|
|
303
|
+
ZodCreditCard: () => ZodCreditCard,
|
|
304
|
+
ZodCustom: () => ZodCustom,
|
|
305
|
+
ZodCustomStringFormat: () => ZodCustomStringFormat,
|
|
306
|
+
ZodDate: () => ZodDate,
|
|
307
|
+
ZodDefault: () => ZodDefault,
|
|
308
|
+
ZodDiscriminatedUnion: () => ZodDiscriminatedUnion,
|
|
309
|
+
ZodE164: () => ZodE164,
|
|
310
|
+
ZodEmail: () => ZodEmail,
|
|
311
|
+
ZodEmoji: () => ZodEmoji,
|
|
312
|
+
ZodEnum: () => ZodEnum,
|
|
313
|
+
ZodError: () => ZodError,
|
|
314
|
+
ZodExactOptional: () => ZodExactOptional,
|
|
315
|
+
ZodFile: () => ZodFile,
|
|
316
|
+
ZodFirstPartyTypeKind: () => ZodFirstPartyTypeKind,
|
|
317
|
+
ZodFunction: () => ZodFunction,
|
|
318
|
+
ZodGUID: () => ZodGUID,
|
|
319
|
+
ZodIBAN: () => ZodIBAN,
|
|
320
|
+
ZodIPv4: () => ZodIPv4,
|
|
321
|
+
ZodIPv6: () => ZodIPv6,
|
|
322
|
+
ZodISODate: () => ZodISODate,
|
|
323
|
+
ZodISODateTime: () => ZodISODateTime,
|
|
324
|
+
ZodISODuration: () => ZodISODuration,
|
|
325
|
+
ZodISOTime: () => ZodISOTime,
|
|
326
|
+
ZodInstanceOf: () => ZodInstanceOf,
|
|
327
|
+
ZodIntersection: () => ZodIntersection,
|
|
328
|
+
ZodIssueCode: () => ZodIssueCode,
|
|
329
|
+
ZodJWT: () => ZodJWT,
|
|
330
|
+
ZodKSUID: () => ZodKSUID,
|
|
331
|
+
ZodLazy: () => ZodLazy,
|
|
332
|
+
ZodLiteral: () => ZodLiteral,
|
|
333
|
+
ZodMAC: () => ZodMAC,
|
|
334
|
+
ZodMap: () => ZodMap,
|
|
335
|
+
ZodNaN: () => ZodNaN,
|
|
336
|
+
ZodNanoID: () => ZodNanoID,
|
|
337
|
+
ZodNever: () => ZodNever,
|
|
338
|
+
ZodNonOptional: () => ZodNonOptional,
|
|
339
|
+
ZodNull: () => ZodNull,
|
|
340
|
+
ZodNullable: () => ZodNullable,
|
|
341
|
+
ZodNumber: () => ZodNumber,
|
|
342
|
+
ZodNumberFormat: () => ZodNumberFormat,
|
|
343
|
+
ZodObject: () => ZodObject,
|
|
344
|
+
ZodOptional: () => ZodOptional,
|
|
345
|
+
ZodPipe: () => ZodPipe,
|
|
346
|
+
ZodPrefault: () => ZodPrefault,
|
|
347
|
+
ZodPreprocess: () => ZodPreprocess,
|
|
348
|
+
ZodPromise: () => ZodPromise,
|
|
349
|
+
ZodReadonly: () => ZodReadonly,
|
|
350
|
+
ZodRealError: () => ZodRealError,
|
|
351
|
+
ZodRecord: () => ZodRecord,
|
|
352
|
+
ZodSet: () => ZodSet,
|
|
353
|
+
ZodString: () => ZodString,
|
|
354
|
+
ZodStringFormat: () => ZodStringFormat,
|
|
355
|
+
ZodSuccess: () => ZodSuccess,
|
|
356
|
+
ZodSymbol: () => ZodSymbol,
|
|
357
|
+
ZodTemplateLiteral: () => ZodTemplateLiteral,
|
|
358
|
+
ZodTransform: () => ZodTransform,
|
|
359
|
+
ZodTuple: () => ZodTuple,
|
|
360
|
+
ZodType: () => ZodType,
|
|
361
|
+
ZodULID: () => ZodULID,
|
|
362
|
+
ZodURL: () => ZodURL,
|
|
363
|
+
ZodUUID: () => ZodUUID,
|
|
364
|
+
ZodUndefined: () => ZodUndefined,
|
|
365
|
+
ZodUnion: () => ZodUnion,
|
|
366
|
+
ZodUnknown: () => ZodUnknown,
|
|
367
|
+
ZodVoid: () => ZodVoid,
|
|
368
|
+
ZodXID: () => ZodXID,
|
|
369
|
+
ZodXor: () => ZodXor,
|
|
370
|
+
_ZodString: () => _ZodString,
|
|
371
|
+
_default: () => _default,
|
|
372
|
+
_function: () => _function,
|
|
373
|
+
any: () => any,
|
|
374
|
+
array: () => array,
|
|
375
|
+
base64: () => base64,
|
|
376
|
+
base64url: () => base64url,
|
|
377
|
+
bigint: () => bigint,
|
|
378
|
+
boolean: () => boolean,
|
|
379
|
+
catch: () => _catch,
|
|
380
|
+
check: () => check,
|
|
381
|
+
cidrv4: () => cidrv4,
|
|
382
|
+
cidrv6: () => cidrv6,
|
|
383
|
+
clone: () => clone,
|
|
384
|
+
codec: () => codec,
|
|
385
|
+
coerce: () => coerce_exports,
|
|
386
|
+
compile: () => compile,
|
|
387
|
+
config: () => config,
|
|
388
|
+
core: () => core_exports,
|
|
389
|
+
creditCard: () => creditCard,
|
|
390
|
+
cuid: () => cuid,
|
|
391
|
+
cuid2: () => cuid2,
|
|
392
|
+
currencyCode: () => currencyCode2,
|
|
393
|
+
custom: () => custom,
|
|
394
|
+
date: () => date,
|
|
395
|
+
decode: () => decode,
|
|
396
|
+
decodeAsync: () => decodeAsync,
|
|
397
|
+
deepPartial: () => deepPartial,
|
|
398
|
+
describe: () => describe2,
|
|
399
|
+
discriminatedUnion: () => discriminatedUnion,
|
|
400
|
+
e164: () => e164,
|
|
401
|
+
email: () => email,
|
|
402
|
+
emoji: () => emoji,
|
|
403
|
+
encode: () => encode,
|
|
404
|
+
encodeAsync: () => encodeAsync,
|
|
405
|
+
endsWith: () => _endsWith,
|
|
406
|
+
enum: () => _enum,
|
|
407
|
+
exactOptional: () => exactOptional,
|
|
408
|
+
file: () => file,
|
|
409
|
+
flattenError: () => flattenError,
|
|
410
|
+
float32: () => float32,
|
|
411
|
+
float64: () => float64,
|
|
412
|
+
formatError: () => formatError,
|
|
413
|
+
fromJSONSchema: () => fromJSONSchema,
|
|
414
|
+
function: () => _function,
|
|
415
|
+
getDiscriminatedOption: () => getDiscriminatedOption,
|
|
416
|
+
getErrorMap: () => getErrorMap,
|
|
417
|
+
globalRegistry: () => globalRegistry,
|
|
418
|
+
gt: () => _gt,
|
|
419
|
+
gte: () => _gte,
|
|
420
|
+
guid: () => guid,
|
|
421
|
+
hash: () => hash,
|
|
422
|
+
hex: () => hex2,
|
|
423
|
+
hostname: () => hostname2,
|
|
424
|
+
httpUrl: () => httpUrl,
|
|
425
|
+
iban: () => iban,
|
|
426
|
+
includes: () => _includes,
|
|
427
|
+
input: () => input,
|
|
428
|
+
instanceof: () => _instanceof,
|
|
429
|
+
int: () => int,
|
|
430
|
+
int32: () => int32,
|
|
431
|
+
int64: () => int64,
|
|
432
|
+
intersection: () => intersection,
|
|
433
|
+
invertCodec: () => invertCodec,
|
|
434
|
+
ipv4: () => ipv4,
|
|
435
|
+
ipv6: () => ipv6,
|
|
436
|
+
iso: () => iso_exports,
|
|
437
|
+
json: () => json,
|
|
438
|
+
jwt: () => jwt,
|
|
439
|
+
keyof: () => keyof,
|
|
440
|
+
ksuid: () => ksuid,
|
|
441
|
+
lazy: () => lazy,
|
|
442
|
+
length: () => _length,
|
|
443
|
+
literal: () => literal,
|
|
444
|
+
locales: () => locales_exports,
|
|
445
|
+
looseObject: () => looseObject,
|
|
446
|
+
looseRecord: () => looseRecord,
|
|
447
|
+
lowercase: () => _lowercase,
|
|
448
|
+
lt: () => _lt,
|
|
449
|
+
lte: () => _lte,
|
|
450
|
+
mac: () => mac,
|
|
451
|
+
map: () => map,
|
|
452
|
+
maxLength: () => _maxLength,
|
|
453
|
+
maxSize: () => _maxSize,
|
|
454
|
+
memoizer: () => memoizer,
|
|
455
|
+
meta: () => meta2,
|
|
456
|
+
mime: () => _mime,
|
|
457
|
+
minLength: () => _minLength,
|
|
458
|
+
minSize: () => _minSize,
|
|
459
|
+
multipleOf: () => _multipleOf,
|
|
460
|
+
nan: () => nan,
|
|
461
|
+
nanoid: () => nanoid,
|
|
462
|
+
nativeEnum: () => nativeEnum,
|
|
463
|
+
negative: () => _negative,
|
|
464
|
+
never: () => never,
|
|
465
|
+
nonnegative: () => _nonnegative,
|
|
466
|
+
nonoptional: () => nonoptional,
|
|
467
|
+
nonpositive: () => _nonpositive,
|
|
468
|
+
normalize: () => _normalize,
|
|
469
|
+
null: () => _null2,
|
|
470
|
+
nullable: () => nullable,
|
|
471
|
+
nullish: () => nullish,
|
|
472
|
+
number: () => number,
|
|
473
|
+
object: () => object,
|
|
474
|
+
optional: () => optional,
|
|
475
|
+
output: () => output,
|
|
476
|
+
overwrite: () => _overwrite,
|
|
477
|
+
parse: () => parse,
|
|
478
|
+
parseAsync: () => parseAsync,
|
|
479
|
+
partialRecord: () => partialRecord,
|
|
480
|
+
pipe: () => pipe,
|
|
481
|
+
positive: () => _positive,
|
|
482
|
+
prefault: () => prefault,
|
|
483
|
+
preprocess: () => preprocess,
|
|
484
|
+
prettifyError: () => prettifyError,
|
|
485
|
+
promise: () => promise,
|
|
486
|
+
properties: () => _properties,
|
|
487
|
+
property: () => _property,
|
|
488
|
+
readonly: () => readonly,
|
|
489
|
+
record: () => record,
|
|
490
|
+
refine: () => refine,
|
|
491
|
+
regex: () => _regex,
|
|
492
|
+
regexes: () => regexes_exports,
|
|
493
|
+
registry: () => registry,
|
|
494
|
+
safeDecode: () => safeDecode,
|
|
495
|
+
safeDecodeAsync: () => safeDecodeAsync,
|
|
496
|
+
safeEncode: () => safeEncode,
|
|
497
|
+
safeEncodeAsync: () => safeEncodeAsync,
|
|
498
|
+
safeParse: () => safeParse,
|
|
499
|
+
safeParseAsync: () => safeParseAsync,
|
|
500
|
+
set: () => set,
|
|
501
|
+
setErrorMap: () => setErrorMap,
|
|
502
|
+
size: () => _size,
|
|
503
|
+
slugify: () => _slugify,
|
|
504
|
+
startsWith: () => _startsWith,
|
|
505
|
+
strictObject: () => strictObject,
|
|
506
|
+
string: () => string,
|
|
507
|
+
stringFormat: () => stringFormat,
|
|
508
|
+
stringbool: () => stringbool,
|
|
509
|
+
success: () => success,
|
|
510
|
+
superRefine: () => superRefine,
|
|
511
|
+
symbol: () => symbol,
|
|
512
|
+
templateLiteral: () => templateLiteral,
|
|
513
|
+
toJSONSchema: () => toJSONSchema,
|
|
514
|
+
toLowerCase: () => _toLowerCase,
|
|
515
|
+
toUpperCase: () => _toUpperCase,
|
|
516
|
+
toZod: () => toZod,
|
|
517
|
+
transform: () => transform,
|
|
518
|
+
treeifyError: () => treeifyError,
|
|
519
|
+
trim: () => _trim,
|
|
520
|
+
tuple: () => tuple,
|
|
521
|
+
uint32: () => uint32,
|
|
522
|
+
uint64: () => uint64,
|
|
523
|
+
ulid: () => ulid,
|
|
524
|
+
undefined: () => _undefined2,
|
|
525
|
+
union: () => union,
|
|
526
|
+
unknown: () => unknown,
|
|
527
|
+
uppercase: () => _uppercase,
|
|
528
|
+
url: () => url,
|
|
529
|
+
util: () => util_exports,
|
|
530
|
+
uuid: () => uuid,
|
|
531
|
+
uuidv4: () => uuidv4,
|
|
532
|
+
uuidv6: () => uuidv6,
|
|
533
|
+
uuidv7: () => uuidv7,
|
|
534
|
+
validate: () => validate,
|
|
535
|
+
validateAsync: () => validateAsync,
|
|
536
|
+
void: () => _void2,
|
|
537
|
+
withParser: () => withParser,
|
|
538
|
+
xid: () => xid,
|
|
539
|
+
xor: () => xor
|
|
540
|
+
});
|
|
541
|
+
|
|
542
|
+
// ../../node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/classic/schemas.js
|
|
543
|
+
var schemas_exports = {};
|
|
544
|
+
__export(schemas_exports, {
|
|
545
|
+
ZodAny: () => ZodAny,
|
|
546
|
+
ZodArray: () => ZodArray,
|
|
547
|
+
ZodBase64: () => ZodBase64,
|
|
548
|
+
ZodBase64URL: () => ZodBase64URL,
|
|
549
|
+
ZodBigInt: () => ZodBigInt,
|
|
550
|
+
ZodBigIntFormat: () => ZodBigIntFormat,
|
|
551
|
+
ZodBoolean: () => ZodBoolean,
|
|
552
|
+
ZodCIDRv4: () => ZodCIDRv4,
|
|
553
|
+
ZodCIDRv6: () => ZodCIDRv6,
|
|
554
|
+
ZodCUID: () => ZodCUID,
|
|
555
|
+
ZodCUID2: () => ZodCUID2,
|
|
556
|
+
ZodCatch: () => ZodCatch,
|
|
557
|
+
ZodCodec: () => ZodCodec,
|
|
558
|
+
ZodCreditCard: () => ZodCreditCard,
|
|
559
|
+
ZodCustom: () => ZodCustom,
|
|
560
|
+
ZodCustomStringFormat: () => ZodCustomStringFormat,
|
|
561
|
+
ZodDate: () => ZodDate,
|
|
562
|
+
ZodDefault: () => ZodDefault,
|
|
563
|
+
ZodDiscriminatedUnion: () => ZodDiscriminatedUnion,
|
|
564
|
+
ZodE164: () => ZodE164,
|
|
565
|
+
ZodEmail: () => ZodEmail,
|
|
566
|
+
ZodEmoji: () => ZodEmoji,
|
|
567
|
+
ZodEnum: () => ZodEnum,
|
|
568
|
+
ZodExactOptional: () => ZodExactOptional,
|
|
569
|
+
ZodFile: () => ZodFile,
|
|
570
|
+
ZodFunction: () => ZodFunction,
|
|
571
|
+
ZodGUID: () => ZodGUID,
|
|
572
|
+
ZodIBAN: () => ZodIBAN,
|
|
573
|
+
ZodIPv4: () => ZodIPv4,
|
|
574
|
+
ZodIPv6: () => ZodIPv6,
|
|
575
|
+
ZodISODate: () => ZodISODate,
|
|
576
|
+
ZodISODateTime: () => ZodISODateTime,
|
|
577
|
+
ZodISODuration: () => ZodISODuration,
|
|
578
|
+
ZodISOTime: () => ZodISOTime,
|
|
579
|
+
ZodInstanceOf: () => ZodInstanceOf,
|
|
580
|
+
ZodIntersection: () => ZodIntersection,
|
|
581
|
+
ZodJWT: () => ZodJWT,
|
|
582
|
+
ZodKSUID: () => ZodKSUID,
|
|
583
|
+
ZodLazy: () => ZodLazy,
|
|
584
|
+
ZodLiteral: () => ZodLiteral,
|
|
585
|
+
ZodMAC: () => ZodMAC,
|
|
586
|
+
ZodMap: () => ZodMap,
|
|
587
|
+
ZodNaN: () => ZodNaN,
|
|
588
|
+
ZodNanoID: () => ZodNanoID,
|
|
589
|
+
ZodNever: () => ZodNever,
|
|
590
|
+
ZodNonOptional: () => ZodNonOptional,
|
|
591
|
+
ZodNull: () => ZodNull,
|
|
592
|
+
ZodNullable: () => ZodNullable,
|
|
593
|
+
ZodNumber: () => ZodNumber,
|
|
594
|
+
ZodNumberFormat: () => ZodNumberFormat,
|
|
595
|
+
ZodObject: () => ZodObject,
|
|
596
|
+
ZodOptional: () => ZodOptional,
|
|
597
|
+
ZodPipe: () => ZodPipe,
|
|
598
|
+
ZodPrefault: () => ZodPrefault,
|
|
599
|
+
ZodPreprocess: () => ZodPreprocess,
|
|
600
|
+
ZodPromise: () => ZodPromise,
|
|
601
|
+
ZodReadonly: () => ZodReadonly,
|
|
602
|
+
ZodRecord: () => ZodRecord,
|
|
603
|
+
ZodSet: () => ZodSet,
|
|
604
|
+
ZodString: () => ZodString,
|
|
605
|
+
ZodStringFormat: () => ZodStringFormat,
|
|
606
|
+
ZodSuccess: () => ZodSuccess,
|
|
607
|
+
ZodSymbol: () => ZodSymbol,
|
|
608
|
+
ZodTemplateLiteral: () => ZodTemplateLiteral,
|
|
609
|
+
ZodTransform: () => ZodTransform,
|
|
610
|
+
ZodTuple: () => ZodTuple,
|
|
611
|
+
ZodType: () => ZodType,
|
|
612
|
+
ZodULID: () => ZodULID,
|
|
613
|
+
ZodURL: () => ZodURL,
|
|
614
|
+
ZodUUID: () => ZodUUID,
|
|
615
|
+
ZodUndefined: () => ZodUndefined,
|
|
616
|
+
ZodUnion: () => ZodUnion,
|
|
617
|
+
ZodUnknown: () => ZodUnknown,
|
|
618
|
+
ZodVoid: () => ZodVoid,
|
|
619
|
+
ZodXID: () => ZodXID,
|
|
620
|
+
ZodXor: () => ZodXor,
|
|
621
|
+
_ZodString: () => _ZodString,
|
|
622
|
+
_default: () => _default,
|
|
623
|
+
_function: () => _function,
|
|
624
|
+
any: () => any,
|
|
625
|
+
array: () => array,
|
|
626
|
+
base64: () => base64,
|
|
627
|
+
base64url: () => base64url,
|
|
628
|
+
bigint: () => bigint,
|
|
629
|
+
boolean: () => boolean,
|
|
630
|
+
catch: () => _catch,
|
|
631
|
+
check: () => check,
|
|
632
|
+
cidrv4: () => cidrv4,
|
|
633
|
+
cidrv6: () => cidrv6,
|
|
634
|
+
codec: () => codec,
|
|
635
|
+
creditCard: () => creditCard,
|
|
636
|
+
cuid: () => cuid,
|
|
637
|
+
cuid2: () => cuid2,
|
|
638
|
+
currencyCode: () => currencyCode2,
|
|
639
|
+
custom: () => custom,
|
|
640
|
+
date: () => date,
|
|
641
|
+
describe: () => describe2,
|
|
642
|
+
discriminatedUnion: () => discriminatedUnion,
|
|
643
|
+
e164: () => e164,
|
|
644
|
+
email: () => email,
|
|
645
|
+
emoji: () => emoji,
|
|
646
|
+
enum: () => _enum,
|
|
647
|
+
exactOptional: () => exactOptional,
|
|
648
|
+
file: () => file,
|
|
649
|
+
float32: () => float32,
|
|
650
|
+
float64: () => float64,
|
|
651
|
+
function: () => _function,
|
|
652
|
+
guid: () => guid,
|
|
653
|
+
hash: () => hash,
|
|
654
|
+
hex: () => hex2,
|
|
655
|
+
hostname: () => hostname2,
|
|
656
|
+
httpUrl: () => httpUrl,
|
|
657
|
+
iban: () => iban,
|
|
658
|
+
instanceof: () => _instanceof,
|
|
659
|
+
int: () => int,
|
|
660
|
+
int32: () => int32,
|
|
661
|
+
int64: () => int64,
|
|
662
|
+
intersection: () => intersection,
|
|
663
|
+
invertCodec: () => invertCodec,
|
|
664
|
+
ipv4: () => ipv4,
|
|
665
|
+
ipv6: () => ipv6,
|
|
666
|
+
json: () => json,
|
|
667
|
+
jwt: () => jwt,
|
|
668
|
+
keyof: () => keyof,
|
|
669
|
+
ksuid: () => ksuid,
|
|
670
|
+
lazy: () => lazy,
|
|
671
|
+
literal: () => literal,
|
|
672
|
+
looseObject: () => looseObject,
|
|
673
|
+
looseRecord: () => looseRecord,
|
|
674
|
+
mac: () => mac,
|
|
675
|
+
map: () => map,
|
|
676
|
+
meta: () => meta2,
|
|
677
|
+
nan: () => nan,
|
|
678
|
+
nanoid: () => nanoid,
|
|
679
|
+
nativeEnum: () => nativeEnum,
|
|
680
|
+
never: () => never,
|
|
681
|
+
nonoptional: () => nonoptional,
|
|
682
|
+
null: () => _null2,
|
|
683
|
+
nullable: () => nullable,
|
|
684
|
+
nullish: () => nullish,
|
|
685
|
+
number: () => number,
|
|
686
|
+
object: () => object,
|
|
687
|
+
optional: () => optional,
|
|
688
|
+
partialRecord: () => partialRecord,
|
|
689
|
+
pipe: () => pipe,
|
|
690
|
+
prefault: () => prefault,
|
|
691
|
+
preprocess: () => preprocess,
|
|
692
|
+
promise: () => promise,
|
|
693
|
+
readonly: () => readonly,
|
|
694
|
+
record: () => record,
|
|
695
|
+
refine: () => refine,
|
|
696
|
+
set: () => set,
|
|
697
|
+
strictObject: () => strictObject,
|
|
698
|
+
string: () => string,
|
|
699
|
+
stringFormat: () => stringFormat,
|
|
700
|
+
stringbool: () => stringbool,
|
|
701
|
+
success: () => success,
|
|
702
|
+
superRefine: () => superRefine,
|
|
703
|
+
symbol: () => symbol,
|
|
704
|
+
templateLiteral: () => templateLiteral,
|
|
705
|
+
transform: () => transform,
|
|
706
|
+
tuple: () => tuple,
|
|
707
|
+
uint32: () => uint32,
|
|
708
|
+
uint64: () => uint64,
|
|
709
|
+
ulid: () => ulid,
|
|
710
|
+
undefined: () => _undefined2,
|
|
711
|
+
union: () => union,
|
|
712
|
+
unknown: () => unknown,
|
|
713
|
+
url: () => url,
|
|
714
|
+
uuid: () => uuid,
|
|
715
|
+
uuidv4: () => uuidv4,
|
|
716
|
+
uuidv6: () => uuidv6,
|
|
717
|
+
uuidv7: () => uuidv7,
|
|
718
|
+
void: () => _void2,
|
|
719
|
+
xid: () => xid,
|
|
720
|
+
xor: () => xor
|
|
721
|
+
});
|
|
722
|
+
|
|
723
|
+
// ../../node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/classic/checks.js
|
|
724
|
+
var checks_exports = {};
|
|
725
|
+
__export(checks_exports, {
|
|
726
|
+
endsWith: () => _endsWith,
|
|
727
|
+
gt: () => _gt,
|
|
728
|
+
gte: () => _gte,
|
|
729
|
+
includes: () => _includes,
|
|
730
|
+
length: () => _length,
|
|
731
|
+
lowercase: () => _lowercase,
|
|
732
|
+
lt: () => _lt,
|
|
733
|
+
lte: () => _lte,
|
|
734
|
+
maxLength: () => _maxLength,
|
|
735
|
+
maxSize: () => _maxSize,
|
|
736
|
+
mime: () => _mime,
|
|
737
|
+
minLength: () => _minLength,
|
|
738
|
+
minSize: () => _minSize,
|
|
739
|
+
multipleOf: () => _multipleOf,
|
|
740
|
+
negative: () => _negative,
|
|
741
|
+
nonnegative: () => _nonnegative,
|
|
742
|
+
nonpositive: () => _nonpositive,
|
|
743
|
+
normalize: () => _normalize,
|
|
744
|
+
overwrite: () => _overwrite,
|
|
745
|
+
positive: () => _positive,
|
|
746
|
+
properties: () => _properties,
|
|
747
|
+
property: () => _property,
|
|
748
|
+
regex: () => _regex,
|
|
749
|
+
size: () => _size,
|
|
750
|
+
slugify: () => _slugify,
|
|
751
|
+
startsWith: () => _startsWith,
|
|
752
|
+
toLowerCase: () => _toLowerCase,
|
|
753
|
+
toUpperCase: () => _toUpperCase,
|
|
754
|
+
trim: () => _trim,
|
|
755
|
+
uppercase: () => _uppercase
|
|
756
|
+
});
|
|
757
|
+
|
|
758
|
+
// ../../node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/classic/errors.js
|
|
759
|
+
var _installedErrorProtos = /* @__PURE__ */ new WeakSet([Object.prototype, Error.prototype]);
|
|
760
|
+
function _lazyMethod(proto, key, make) {
|
|
761
|
+
Object.defineProperty(proto, key, {
|
|
762
|
+
configurable: true,
|
|
763
|
+
enumerable: false,
|
|
764
|
+
get() {
|
|
765
|
+
const value = make(this);
|
|
766
|
+
Object.defineProperty(this, key, { value, configurable: true, writable: true });
|
|
767
|
+
return value;
|
|
768
|
+
},
|
|
769
|
+
set(value) {
|
|
770
|
+
Object.defineProperty(this, key, { value, configurable: true, writable: true });
|
|
771
|
+
}
|
|
772
|
+
});
|
|
773
|
+
}
|
|
774
|
+
var initializer = (inst, issues) => {
|
|
775
|
+
$ZodError.init(inst, issues);
|
|
776
|
+
inst.name = "ZodError";
|
|
777
|
+
const proto = Object.getPrototypeOf(inst);
|
|
778
|
+
if (_installedErrorProtos.has(proto))
|
|
779
|
+
return;
|
|
780
|
+
_installedErrorProtos.add(proto);
|
|
781
|
+
_lazyMethod(proto, "format", (self) => (mapper) => formatError(self, mapper));
|
|
782
|
+
_lazyMethod(proto, "flatten", (self) => (mapper) => flattenError(self, mapper));
|
|
783
|
+
_lazyMethod(proto, "addIssue", (self) => (issue) => {
|
|
784
|
+
self.issues.push(issue);
|
|
785
|
+
self.message = JSON.stringify(self.issues, jsonStringifyReplacer, 2);
|
|
786
|
+
});
|
|
787
|
+
_lazyMethod(proto, "addIssues", (self) => (issues2) => {
|
|
788
|
+
self.issues.push(...issues2);
|
|
789
|
+
self.message = JSON.stringify(self.issues, jsonStringifyReplacer, 2);
|
|
790
|
+
});
|
|
791
|
+
Object.defineProperty(proto, "isEmpty", {
|
|
792
|
+
configurable: true,
|
|
793
|
+
enumerable: false,
|
|
794
|
+
get() {
|
|
795
|
+
return this.issues.length === 0;
|
|
796
|
+
}
|
|
797
|
+
});
|
|
798
|
+
};
|
|
799
|
+
var ZodError = /* @__PURE__ */ $constructor("ZodError", initializer);
|
|
800
|
+
var ZodRealError = /* @__PURE__ */ $constructor("ZodError", initializer, void 0, {
|
|
801
|
+
Parent: Error
|
|
802
|
+
});
|
|
803
|
+
|
|
804
|
+
// ../../node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/classic/parse.js
|
|
805
|
+
var parse = /* @__PURE__ */ _parse(ZodRealError);
|
|
806
|
+
var parseAsync = /* @__PURE__ */ _parseAsync(ZodRealError);
|
|
807
|
+
var safeParse = /* @__PURE__ */ _safeParse(ZodRealError);
|
|
808
|
+
var safeParseAsync = /* @__PURE__ */ _safeParseAsync(ZodRealError);
|
|
809
|
+
var encode = /* @__PURE__ */ _encode(ZodRealError);
|
|
810
|
+
var decode = /* @__PURE__ */ _decode(ZodRealError);
|
|
811
|
+
var encodeAsync = /* @__PURE__ */ _encodeAsync(ZodRealError);
|
|
812
|
+
var decodeAsync = /* @__PURE__ */ _decodeAsync(ZodRealError);
|
|
813
|
+
var safeEncode = /* @__PURE__ */ _safeEncode(ZodRealError);
|
|
814
|
+
var safeDecode = /* @__PURE__ */ _safeDecode(ZodRealError);
|
|
815
|
+
var safeEncodeAsync = /* @__PURE__ */ _safeEncodeAsync(ZodRealError);
|
|
816
|
+
var safeDecodeAsync = /* @__PURE__ */ _safeDecodeAsync(ZodRealError);
|
|
817
|
+
|
|
818
|
+
// ../../node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/classic/schemas.js
|
|
819
|
+
function _ensureDefaultLocale() {
|
|
820
|
+
if (!globalConfig.localeError)
|
|
821
|
+
config(en_default());
|
|
822
|
+
}
|
|
823
|
+
function _ensureDefaultMemoizer() {
|
|
824
|
+
if (!globalConfig.memoizer)
|
|
825
|
+
config({ memoizer: memoizer() });
|
|
826
|
+
}
|
|
827
|
+
var ZodType = /* @__PURE__ */ $constructor("ZodType", (inst, def) => {
|
|
828
|
+
_ensureDefaultLocale();
|
|
829
|
+
$ZodType.init(inst, def);
|
|
830
|
+
inst.def = def;
|
|
831
|
+
inst.type = def.type;
|
|
832
|
+
return inst;
|
|
833
|
+
}, {
|
|
834
|
+
check(...chks) {
|
|
835
|
+
const def = this.def;
|
|
836
|
+
return this.clone(util_exports.mergeDefs(def, {
|
|
837
|
+
checks: [
|
|
838
|
+
...def.checks ?? [],
|
|
839
|
+
...chks.map((ch) => typeof ch === "function" ? { _zod: { check: ch, def: { check: "custom" }, onattach: [] } } : ch)
|
|
840
|
+
]
|
|
841
|
+
}), { parent: true });
|
|
842
|
+
},
|
|
843
|
+
with(...chks) {
|
|
844
|
+
return this.check(...chks);
|
|
845
|
+
},
|
|
846
|
+
clone(def, params) {
|
|
847
|
+
return clone(this, def, params);
|
|
848
|
+
},
|
|
849
|
+
brand() {
|
|
850
|
+
return this;
|
|
851
|
+
},
|
|
852
|
+
register(reg, meta3) {
|
|
853
|
+
reg.add(this, meta3);
|
|
854
|
+
return this;
|
|
855
|
+
},
|
|
856
|
+
refine(check2, params) {
|
|
857
|
+
return this.check(refine(check2, params));
|
|
858
|
+
},
|
|
859
|
+
superRefine(refinement, params) {
|
|
860
|
+
return this.check(superRefine(refinement, params));
|
|
861
|
+
},
|
|
862
|
+
overwrite(fn) {
|
|
863
|
+
return this.check(_overwrite(fn));
|
|
864
|
+
},
|
|
865
|
+
optional() {
|
|
866
|
+
return optional(this);
|
|
867
|
+
},
|
|
868
|
+
exactOptional() {
|
|
869
|
+
return exactOptional(this);
|
|
870
|
+
},
|
|
871
|
+
nullable() {
|
|
872
|
+
return nullable(this);
|
|
873
|
+
},
|
|
874
|
+
nullish() {
|
|
875
|
+
return optional(nullable(this));
|
|
876
|
+
},
|
|
877
|
+
nonoptional(params) {
|
|
878
|
+
return nonoptional(this, params);
|
|
879
|
+
},
|
|
880
|
+
array() {
|
|
881
|
+
return array(this);
|
|
882
|
+
},
|
|
883
|
+
or(arg) {
|
|
884
|
+
return union([this, arg]);
|
|
885
|
+
},
|
|
886
|
+
and(arg) {
|
|
887
|
+
return intersection(this, arg);
|
|
888
|
+
},
|
|
889
|
+
transform(tx) {
|
|
890
|
+
return pipe(this, transform(tx));
|
|
891
|
+
},
|
|
892
|
+
default(d) {
|
|
893
|
+
return _default(this, d);
|
|
894
|
+
},
|
|
895
|
+
prefault(d) {
|
|
896
|
+
return prefault(this, d);
|
|
897
|
+
},
|
|
898
|
+
catch(params) {
|
|
899
|
+
return _catch(this, params);
|
|
900
|
+
},
|
|
901
|
+
pipe(target) {
|
|
902
|
+
return pipe(this, target);
|
|
903
|
+
},
|
|
904
|
+
readonly() {
|
|
905
|
+
return readonly(this);
|
|
906
|
+
},
|
|
907
|
+
describe(description) {
|
|
908
|
+
const cl = this.clone();
|
|
909
|
+
globalRegistry.add(cl, { description });
|
|
910
|
+
return cl;
|
|
911
|
+
},
|
|
912
|
+
meta(...args) {
|
|
913
|
+
if (args.length === 0)
|
|
914
|
+
return globalRegistry.get(this);
|
|
915
|
+
const cl = this.clone();
|
|
916
|
+
globalRegistry.add(cl, args[0]);
|
|
917
|
+
return cl;
|
|
918
|
+
},
|
|
919
|
+
isOptional() {
|
|
920
|
+
return this.safeParse(void 0).success;
|
|
921
|
+
},
|
|
922
|
+
isNullable() {
|
|
923
|
+
return this.safeParse(null).success;
|
|
924
|
+
},
|
|
925
|
+
apply(fn, ...args) {
|
|
926
|
+
return args.length === 0 ? fn(this) : fn(this, ...args);
|
|
927
|
+
},
|
|
928
|
+
// Overrides core's `~standard` to add `jsonSchema`. Must stay a prototype entry: redefining it per instance demotes instances to dictionary mode.
|
|
929
|
+
get "~standard"() {
|
|
930
|
+
return util_exports.hide(this, "~standard", {
|
|
931
|
+
...standardProps(this),
|
|
932
|
+
jsonSchema: {
|
|
933
|
+
input: createStandardJSONSchemaMethod(this, "input"),
|
|
934
|
+
output: createStandardJSONSchemaMethod(this, "output")
|
|
935
|
+
}
|
|
936
|
+
});
|
|
937
|
+
},
|
|
938
|
+
set "~standard"(value) {
|
|
939
|
+
util_exports.own(this, "~standard", value);
|
|
940
|
+
},
|
|
941
|
+
parse: function _parse2(data, params) {
|
|
942
|
+
return parse(this, data, params, { callee: _parse2 });
|
|
943
|
+
},
|
|
944
|
+
parseAsync: async function _parseAsync2(data, params) {
|
|
945
|
+
return await parseAsync(this, data, params, { callee: _parseAsync2 });
|
|
946
|
+
},
|
|
947
|
+
safeParse(data, params) {
|
|
948
|
+
return safeParse(this, data, params);
|
|
949
|
+
},
|
|
950
|
+
async safeParseAsync(data, params) {
|
|
951
|
+
return safeParseAsync(this, data, params);
|
|
952
|
+
},
|
|
953
|
+
// `spa` is an alias: same function object as `safeParseAsync`, as before.
|
|
954
|
+
get spa() {
|
|
955
|
+
return this?.safeParseAsync;
|
|
956
|
+
},
|
|
957
|
+
set spa(value) {
|
|
958
|
+
util_exports.own(this, "spa", value);
|
|
959
|
+
},
|
|
960
|
+
validate(data, params) {
|
|
961
|
+
return validate(this, data, params);
|
|
962
|
+
},
|
|
963
|
+
validateAsync(data, params) {
|
|
964
|
+
return validateAsync(this, data, params);
|
|
965
|
+
},
|
|
966
|
+
encode: function _encode2(data, params) {
|
|
967
|
+
return encode(this, data, params, { callee: _encode2 });
|
|
968
|
+
},
|
|
969
|
+
decode: function _decode2(data, params) {
|
|
970
|
+
return decode(this, data, params, { callee: _decode2 });
|
|
971
|
+
},
|
|
972
|
+
encodeAsync: async function _encodeAsync2(data, params) {
|
|
973
|
+
return await encodeAsync(this, data, params, { callee: _encodeAsync2 });
|
|
974
|
+
},
|
|
975
|
+
decodeAsync: async function _decodeAsync2(data, params) {
|
|
976
|
+
return await decodeAsync(this, data, params, { callee: _decodeAsync2 });
|
|
977
|
+
},
|
|
978
|
+
safeEncode(data, params) {
|
|
979
|
+
return safeEncode(this, data, params);
|
|
980
|
+
},
|
|
981
|
+
safeDecode(data, params) {
|
|
982
|
+
return safeDecode(this, data, params);
|
|
983
|
+
},
|
|
984
|
+
async safeEncodeAsync(data, params) {
|
|
985
|
+
return safeEncodeAsync(this, data, params);
|
|
986
|
+
},
|
|
987
|
+
async safeDecodeAsync(data, params) {
|
|
988
|
+
return safeDecodeAsync(this, data, params);
|
|
989
|
+
},
|
|
990
|
+
toJSONSchema(params) {
|
|
991
|
+
return createToJSONSchemaMethod(this, {})(params);
|
|
992
|
+
},
|
|
993
|
+
// Reads through to the registry on every access, so it must not cache.
|
|
994
|
+
get description() {
|
|
995
|
+
return globalRegistry.get(this)?.description;
|
|
996
|
+
},
|
|
997
|
+
// No setter: `schema._def = x` throws, as it did when `_def` was a non-writable own property.
|
|
998
|
+
get _def() {
|
|
999
|
+
return this._zod.def;
|
|
1000
|
+
}
|
|
1001
|
+
});
|
|
1002
|
+
var _ZodString = /* @__PURE__ */ $constructor(
|
|
1003
|
+
"_ZodString",
|
|
1004
|
+
(inst, def) => {
|
|
1005
|
+
$ZodString.init(inst, def);
|
|
1006
|
+
ZodType.init(inst, def);
|
|
1007
|
+
inst._zod.processJSONSchema = (ctx, json2, params) => stringProcessor(inst, ctx, json2, params);
|
|
1008
|
+
},
|
|
1009
|
+
/* @__PURE__ */ util_exports.derived({
|
|
1010
|
+
format: (inst) => aggregateChecks(inst).format ?? null,
|
|
1011
|
+
minLength: (inst) => aggregateChecks(inst).minimum ?? null,
|
|
1012
|
+
maxLength: (inst) => aggregateChecks(inst).maximum ?? null
|
|
1013
|
+
}, {
|
|
1014
|
+
regex(...args) {
|
|
1015
|
+
return this.check(_regex(...args));
|
|
1016
|
+
},
|
|
1017
|
+
includes(...args) {
|
|
1018
|
+
return this.check(_includes(...args));
|
|
1019
|
+
},
|
|
1020
|
+
startsWith(...args) {
|
|
1021
|
+
return this.check(_startsWith(...args));
|
|
1022
|
+
},
|
|
1023
|
+
endsWith(...args) {
|
|
1024
|
+
return this.check(_endsWith(...args));
|
|
1025
|
+
},
|
|
1026
|
+
min(...args) {
|
|
1027
|
+
return this.check(_minLength(...args));
|
|
1028
|
+
},
|
|
1029
|
+
max(...args) {
|
|
1030
|
+
return this.check(_maxLength(...args));
|
|
1031
|
+
},
|
|
1032
|
+
length(...args) {
|
|
1033
|
+
return this.check(_length(...args));
|
|
1034
|
+
},
|
|
1035
|
+
nonempty(...args) {
|
|
1036
|
+
return this.check(_minLength(1, ...args));
|
|
1037
|
+
},
|
|
1038
|
+
lowercase(params) {
|
|
1039
|
+
return this.check(_lowercase(params));
|
|
1040
|
+
},
|
|
1041
|
+
uppercase(params) {
|
|
1042
|
+
return this.check(_uppercase(params));
|
|
1043
|
+
},
|
|
1044
|
+
trim() {
|
|
1045
|
+
return this.check(_trim());
|
|
1046
|
+
},
|
|
1047
|
+
normalize(...args) {
|
|
1048
|
+
return this.check(_normalize(...args));
|
|
1049
|
+
},
|
|
1050
|
+
toLowerCase() {
|
|
1051
|
+
return this.check(_toLowerCase());
|
|
1052
|
+
},
|
|
1053
|
+
toUpperCase() {
|
|
1054
|
+
return this.check(_toUpperCase());
|
|
1055
|
+
},
|
|
1056
|
+
slugify() {
|
|
1057
|
+
return this.check(_slugify());
|
|
1058
|
+
}
|
|
1059
|
+
})
|
|
1060
|
+
);
|
|
1061
|
+
var ZodString = /* @__PURE__ */ $constructor("ZodString", (inst, def) => {
|
|
1062
|
+
$ZodString.init(inst, def);
|
|
1063
|
+
_ZodString.init(inst, def);
|
|
1064
|
+
}, {
|
|
1065
|
+
email(params) {
|
|
1066
|
+
return this.check(_email(ZodEmail, params));
|
|
1067
|
+
},
|
|
1068
|
+
url(params) {
|
|
1069
|
+
return this.check(_url(ZodURL, params));
|
|
1070
|
+
},
|
|
1071
|
+
jwt(params) {
|
|
1072
|
+
return this.check(_jwt(ZodJWT, params));
|
|
1073
|
+
},
|
|
1074
|
+
emoji(params) {
|
|
1075
|
+
return this.check(_emoji(ZodEmoji, params));
|
|
1076
|
+
},
|
|
1077
|
+
guid(params) {
|
|
1078
|
+
return this.check(_guid(ZodGUID, params));
|
|
1079
|
+
},
|
|
1080
|
+
uuid(params) {
|
|
1081
|
+
return this.check(_uuid(ZodUUID, params));
|
|
1082
|
+
},
|
|
1083
|
+
uuidv4(params) {
|
|
1084
|
+
return this.check(_uuidv4(ZodUUID, params));
|
|
1085
|
+
},
|
|
1086
|
+
uuidv6(params) {
|
|
1087
|
+
return this.check(_uuidv6(ZodUUID, params));
|
|
1088
|
+
},
|
|
1089
|
+
uuidv7(params) {
|
|
1090
|
+
return this.check(_uuidv7(ZodUUID, params));
|
|
1091
|
+
},
|
|
1092
|
+
nanoid(params) {
|
|
1093
|
+
return this.check(_nanoid(ZodNanoID, params));
|
|
1094
|
+
},
|
|
1095
|
+
cuid(params) {
|
|
1096
|
+
return this.check(_cuid(ZodCUID, params));
|
|
1097
|
+
},
|
|
1098
|
+
cuid2(params) {
|
|
1099
|
+
return this.check(_cuid2(ZodCUID2, params));
|
|
1100
|
+
},
|
|
1101
|
+
ulid(params) {
|
|
1102
|
+
return this.check(_ulid(ZodULID, params));
|
|
1103
|
+
},
|
|
1104
|
+
base64(params) {
|
|
1105
|
+
return this.check(_base64(ZodBase64, params));
|
|
1106
|
+
},
|
|
1107
|
+
base64url(params) {
|
|
1108
|
+
return this.check(_base64url(ZodBase64URL, params));
|
|
1109
|
+
},
|
|
1110
|
+
xid(params) {
|
|
1111
|
+
return this.check(_xid(ZodXID, params));
|
|
1112
|
+
},
|
|
1113
|
+
ksuid(params) {
|
|
1114
|
+
return this.check(_ksuid(ZodKSUID, params));
|
|
1115
|
+
},
|
|
1116
|
+
ipv4(params) {
|
|
1117
|
+
return this.check(_ipv4(ZodIPv4, params));
|
|
1118
|
+
},
|
|
1119
|
+
ipv6(params) {
|
|
1120
|
+
return this.check(_ipv6(ZodIPv6, params));
|
|
1121
|
+
},
|
|
1122
|
+
cidrv4(params) {
|
|
1123
|
+
return this.check(_cidrv4(ZodCIDRv4, params));
|
|
1124
|
+
},
|
|
1125
|
+
cidrv6(params) {
|
|
1126
|
+
return this.check(_cidrv6(ZodCIDRv6, params));
|
|
1127
|
+
},
|
|
1128
|
+
e164(params) {
|
|
1129
|
+
return this.check(_e164(ZodE164, params));
|
|
1130
|
+
},
|
|
1131
|
+
datetime(params) {
|
|
1132
|
+
return this.check(_isoDateTime(ZodISODateTime, params));
|
|
1133
|
+
},
|
|
1134
|
+
date(params) {
|
|
1135
|
+
return this.check(_isoDate(ZodISODate, params));
|
|
1136
|
+
},
|
|
1137
|
+
time(params) {
|
|
1138
|
+
return this.check(_isoTime(ZodISOTime, params));
|
|
1139
|
+
},
|
|
1140
|
+
duration(params) {
|
|
1141
|
+
return this.check(_isoDuration(ZodISODuration, params));
|
|
1142
|
+
}
|
|
1143
|
+
});
|
|
1144
|
+
function string(params) {
|
|
1145
|
+
return _string(ZodString, params);
|
|
1146
|
+
}
|
|
1147
|
+
var ZodStringFormat = /* @__PURE__ */ $constructor("ZodStringFormat", (inst, def) => {
|
|
1148
|
+
$ZodStringFormat.init(inst, def);
|
|
1149
|
+
_ZodString.init(inst, def);
|
|
1150
|
+
});
|
|
1151
|
+
var ZodISODateTime = /* @__PURE__ */ $constructor("ZodISODateTime", (inst, def) => {
|
|
1152
|
+
$ZodISODateTime.init(inst, def);
|
|
1153
|
+
ZodStringFormat.init(inst, def);
|
|
1154
|
+
});
|
|
1155
|
+
var ZodISODate = /* @__PURE__ */ $constructor("ZodISODate", (inst, def) => {
|
|
1156
|
+
$ZodISODate.init(inst, def);
|
|
1157
|
+
ZodStringFormat.init(inst, def);
|
|
1158
|
+
});
|
|
1159
|
+
var ZodISOTime = /* @__PURE__ */ $constructor("ZodISOTime", (inst, def) => {
|
|
1160
|
+
$ZodISOTime.init(inst, def);
|
|
1161
|
+
ZodStringFormat.init(inst, def);
|
|
1162
|
+
});
|
|
1163
|
+
var ZodISODuration = /* @__PURE__ */ $constructor("ZodISODuration", (inst, def) => {
|
|
1164
|
+
$ZodISODuration.init(inst, def);
|
|
1165
|
+
ZodStringFormat.init(inst, def);
|
|
1166
|
+
});
|
|
1167
|
+
var ZodEmail = /* @__PURE__ */ $constructor("ZodEmail", (inst, def) => {
|
|
1168
|
+
$ZodEmail.init(inst, def);
|
|
1169
|
+
ZodStringFormat.init(inst, def);
|
|
1170
|
+
});
|
|
1171
|
+
function email(params) {
|
|
1172
|
+
return _email(ZodEmail, params);
|
|
1173
|
+
}
|
|
1174
|
+
var ZodGUID = /* @__PURE__ */ $constructor("ZodGUID", (inst, def) => {
|
|
1175
|
+
$ZodGUID.init(inst, def);
|
|
1176
|
+
ZodStringFormat.init(inst, def);
|
|
1177
|
+
});
|
|
1178
|
+
function guid(params) {
|
|
1179
|
+
return _guid(ZodGUID, params);
|
|
1180
|
+
}
|
|
1181
|
+
var ZodUUID = /* @__PURE__ */ $constructor("ZodUUID", (inst, def) => {
|
|
1182
|
+
$ZodUUID.init(inst, def);
|
|
1183
|
+
ZodStringFormat.init(inst, def);
|
|
1184
|
+
});
|
|
1185
|
+
function uuid(params) {
|
|
1186
|
+
return _uuid(ZodUUID, params);
|
|
1187
|
+
}
|
|
1188
|
+
function uuidv4(params) {
|
|
1189
|
+
return _uuidv4(ZodUUID, params);
|
|
1190
|
+
}
|
|
1191
|
+
function uuidv6(params) {
|
|
1192
|
+
return _uuidv6(ZodUUID, params);
|
|
1193
|
+
}
|
|
1194
|
+
function uuidv7(params) {
|
|
1195
|
+
return _uuidv7(ZodUUID, params);
|
|
1196
|
+
}
|
|
1197
|
+
var ZodURL = /* @__PURE__ */ $constructor("ZodURL", (inst, def) => {
|
|
1198
|
+
$ZodURL.init(inst, def);
|
|
1199
|
+
ZodStringFormat.init(inst, def);
|
|
1200
|
+
});
|
|
1201
|
+
function url(params) {
|
|
1202
|
+
return _url(ZodURL, params);
|
|
1203
|
+
}
|
|
1204
|
+
function httpUrl(params) {
|
|
1205
|
+
return _url(ZodURL, {
|
|
1206
|
+
protocol: httpProtocol,
|
|
1207
|
+
hostname: domain,
|
|
1208
|
+
...util_exports.normalizeParams(params)
|
|
1209
|
+
});
|
|
1210
|
+
}
|
|
1211
|
+
var ZodEmoji = /* @__PURE__ */ $constructor("ZodEmoji", (inst, def) => {
|
|
1212
|
+
$ZodEmoji.init(inst, def);
|
|
1213
|
+
ZodStringFormat.init(inst, def);
|
|
1214
|
+
});
|
|
1215
|
+
function emoji(params) {
|
|
1216
|
+
return _emoji(ZodEmoji, params);
|
|
1217
|
+
}
|
|
1218
|
+
var ZodNanoID = /* @__PURE__ */ $constructor("ZodNanoID", (inst, def) => {
|
|
1219
|
+
$ZodNanoID.init(inst, def);
|
|
1220
|
+
ZodStringFormat.init(inst, def);
|
|
1221
|
+
});
|
|
1222
|
+
function nanoid(params) {
|
|
1223
|
+
return _nanoid(ZodNanoID, params);
|
|
1224
|
+
}
|
|
1225
|
+
var ZodCUID = /* @__PURE__ */ $constructor("ZodCUID", (inst, def) => {
|
|
1226
|
+
$ZodCUID.init(inst, def);
|
|
1227
|
+
ZodStringFormat.init(inst, def);
|
|
1228
|
+
});
|
|
1229
|
+
function cuid(params) {
|
|
1230
|
+
return _cuid(ZodCUID, params);
|
|
1231
|
+
}
|
|
1232
|
+
var ZodCUID2 = /* @__PURE__ */ $constructor("ZodCUID2", (inst, def) => {
|
|
1233
|
+
$ZodCUID2.init(inst, def);
|
|
1234
|
+
ZodStringFormat.init(inst, def);
|
|
1235
|
+
});
|
|
1236
|
+
function cuid2(params) {
|
|
1237
|
+
return _cuid2(ZodCUID2, params);
|
|
1238
|
+
}
|
|
1239
|
+
var ZodULID = /* @__PURE__ */ $constructor("ZodULID", (inst, def) => {
|
|
1240
|
+
$ZodULID.init(inst, def);
|
|
1241
|
+
ZodStringFormat.init(inst, def);
|
|
1242
|
+
});
|
|
1243
|
+
function ulid(params) {
|
|
1244
|
+
return _ulid(ZodULID, params);
|
|
1245
|
+
}
|
|
1246
|
+
var ZodXID = /* @__PURE__ */ $constructor("ZodXID", (inst, def) => {
|
|
1247
|
+
$ZodXID.init(inst, def);
|
|
1248
|
+
ZodStringFormat.init(inst, def);
|
|
1249
|
+
});
|
|
1250
|
+
function xid(params) {
|
|
1251
|
+
return _xid(ZodXID, params);
|
|
1252
|
+
}
|
|
1253
|
+
var ZodKSUID = /* @__PURE__ */ $constructor("ZodKSUID", (inst, def) => {
|
|
1254
|
+
$ZodKSUID.init(inst, def);
|
|
1255
|
+
ZodStringFormat.init(inst, def);
|
|
1256
|
+
});
|
|
1257
|
+
function ksuid(params) {
|
|
1258
|
+
return _ksuid(ZodKSUID, params);
|
|
1259
|
+
}
|
|
1260
|
+
var ZodIPv4 = /* @__PURE__ */ $constructor("ZodIPv4", (inst, def) => {
|
|
1261
|
+
$ZodIPv4.init(inst, def);
|
|
1262
|
+
ZodStringFormat.init(inst, def);
|
|
1263
|
+
});
|
|
1264
|
+
function ipv4(params) {
|
|
1265
|
+
return _ipv4(ZodIPv4, params);
|
|
1266
|
+
}
|
|
1267
|
+
var ZodMAC = /* @__PURE__ */ $constructor("ZodMAC", (inst, def) => {
|
|
1268
|
+
$ZodMAC.init(inst, def);
|
|
1269
|
+
ZodStringFormat.init(inst, def);
|
|
1270
|
+
});
|
|
1271
|
+
function mac(params) {
|
|
1272
|
+
return _mac(ZodMAC, params);
|
|
1273
|
+
}
|
|
1274
|
+
var ZodIPv6 = /* @__PURE__ */ $constructor("ZodIPv6", (inst, def) => {
|
|
1275
|
+
$ZodIPv6.init(inst, def);
|
|
1276
|
+
ZodStringFormat.init(inst, def);
|
|
1277
|
+
});
|
|
1278
|
+
function ipv6(params) {
|
|
1279
|
+
return _ipv6(ZodIPv6, params);
|
|
1280
|
+
}
|
|
1281
|
+
var ZodCIDRv4 = /* @__PURE__ */ $constructor("ZodCIDRv4", (inst, def) => {
|
|
1282
|
+
$ZodCIDRv4.init(inst, def);
|
|
1283
|
+
ZodStringFormat.init(inst, def);
|
|
1284
|
+
});
|
|
1285
|
+
function cidrv4(params) {
|
|
1286
|
+
return _cidrv4(ZodCIDRv4, params);
|
|
1287
|
+
}
|
|
1288
|
+
var ZodCIDRv6 = /* @__PURE__ */ $constructor("ZodCIDRv6", (inst, def) => {
|
|
1289
|
+
$ZodCIDRv6.init(inst, def);
|
|
1290
|
+
ZodStringFormat.init(inst, def);
|
|
1291
|
+
});
|
|
1292
|
+
function cidrv6(params) {
|
|
1293
|
+
return _cidrv6(ZodCIDRv6, params);
|
|
1294
|
+
}
|
|
1295
|
+
var ZodBase64 = /* @__PURE__ */ $constructor("ZodBase64", (inst, def) => {
|
|
1296
|
+
$ZodBase64.init(inst, def);
|
|
1297
|
+
ZodStringFormat.init(inst, def);
|
|
1298
|
+
});
|
|
1299
|
+
function base64(params) {
|
|
1300
|
+
return _base64(ZodBase64, params);
|
|
1301
|
+
}
|
|
1302
|
+
var ZodBase64URL = /* @__PURE__ */ $constructor("ZodBase64URL", (inst, def) => {
|
|
1303
|
+
$ZodBase64URL.init(inst, def);
|
|
1304
|
+
ZodStringFormat.init(inst, def);
|
|
1305
|
+
});
|
|
1306
|
+
function base64url(params) {
|
|
1307
|
+
return _base64url(ZodBase64URL, params);
|
|
1308
|
+
}
|
|
1309
|
+
var ZodE164 = /* @__PURE__ */ $constructor("ZodE164", (inst, def) => {
|
|
1310
|
+
$ZodE164.init(inst, def);
|
|
1311
|
+
ZodStringFormat.init(inst, def);
|
|
1312
|
+
});
|
|
1313
|
+
function e164(params) {
|
|
1314
|
+
return _e164(ZodE164, params);
|
|
1315
|
+
}
|
|
1316
|
+
var ZodCreditCard = /* @__PURE__ */ $constructor("ZodCreditCard", (inst, def) => {
|
|
1317
|
+
$ZodCreditCard.init(inst, def);
|
|
1318
|
+
ZodStringFormat.init(inst, def);
|
|
1319
|
+
});
|
|
1320
|
+
function creditCard(params) {
|
|
1321
|
+
return _creditCard(ZodCreditCard, params);
|
|
1322
|
+
}
|
|
1323
|
+
var ZodIBAN = /* @__PURE__ */ $constructor("ZodIBAN", (inst, def) => {
|
|
1324
|
+
$ZodIBAN.init(inst, def);
|
|
1325
|
+
ZodStringFormat.init(inst, def);
|
|
1326
|
+
});
|
|
1327
|
+
function iban(params) {
|
|
1328
|
+
return _iban(ZodIBAN, params);
|
|
1329
|
+
}
|
|
1330
|
+
var ZodJWT = /* @__PURE__ */ $constructor("ZodJWT", (inst, def) => {
|
|
1331
|
+
$ZodJWT.init(inst, def);
|
|
1332
|
+
ZodStringFormat.init(inst, def);
|
|
1333
|
+
});
|
|
1334
|
+
function jwt(params) {
|
|
1335
|
+
return _jwt(ZodJWT, params);
|
|
1336
|
+
}
|
|
1337
|
+
var ZodCustomStringFormat = /* @__PURE__ */ $constructor("ZodCustomStringFormat", (inst, def) => {
|
|
1338
|
+
$ZodCustomStringFormat.init(inst, def);
|
|
1339
|
+
ZodStringFormat.init(inst, def);
|
|
1340
|
+
});
|
|
1341
|
+
function stringFormat(format, fnOrRegex, _params = {}) {
|
|
1342
|
+
return _stringFormat(ZodCustomStringFormat, format, fnOrRegex, _params);
|
|
1343
|
+
}
|
|
1344
|
+
function hostname2(_params) {
|
|
1345
|
+
return _stringFormat(ZodCustomStringFormat, "hostname", hostname, _params);
|
|
1346
|
+
}
|
|
1347
|
+
function hex2(_params) {
|
|
1348
|
+
return _stringFormat(ZodCustomStringFormat, "hex", hex, _params);
|
|
1349
|
+
}
|
|
1350
|
+
function currencyCode2(_params) {
|
|
1351
|
+
return _stringFormat(ZodCustomStringFormat, "currency_code", currencyCode, _params);
|
|
1352
|
+
}
|
|
1353
|
+
function hash(alg, params) {
|
|
1354
|
+
const enc = params?.enc ?? "hex";
|
|
1355
|
+
const format = `${alg}_${enc}`;
|
|
1356
|
+
const regex = regexes_exports[format];
|
|
1357
|
+
if (!regex)
|
|
1358
|
+
throw new Error(`Unrecognized hash format: ${format}`);
|
|
1359
|
+
return _stringFormat(ZodCustomStringFormat, format, regex, params);
|
|
1360
|
+
}
|
|
1361
|
+
var ZodNumber = /* @__PURE__ */ $constructor(
|
|
1362
|
+
"ZodNumber",
|
|
1363
|
+
(inst, def) => {
|
|
1364
|
+
$ZodNumber.init(inst, def);
|
|
1365
|
+
ZodType.init(inst, def);
|
|
1366
|
+
inst._zod.processJSONSchema = (ctx, json2, params) => numberProcessor(inst, ctx, json2, params);
|
|
1367
|
+
inst.isFinite = true;
|
|
1368
|
+
},
|
|
1369
|
+
/* @__PURE__ */ util_exports.derived({
|
|
1370
|
+
minValue: (inst) => {
|
|
1371
|
+
const { minimum, exclusiveMinimum } = aggregateChecks(inst);
|
|
1372
|
+
return Math.max(minimum ?? Number.NEGATIVE_INFINITY, exclusiveMinimum ?? Number.NEGATIVE_INFINITY);
|
|
1373
|
+
},
|
|
1374
|
+
maxValue: (inst) => {
|
|
1375
|
+
const { maximum, exclusiveMaximum } = aggregateChecks(inst);
|
|
1376
|
+
return Math.min(maximum ?? Number.POSITIVE_INFINITY, exclusiveMaximum ?? Number.POSITIVE_INFINITY);
|
|
1377
|
+
},
|
|
1378
|
+
isInt: (inst) => {
|
|
1379
|
+
const { isInt, multipleOf } = aggregateChecks(inst);
|
|
1380
|
+
return !!isInt || !!multipleOf?.some(Number.isSafeInteger);
|
|
1381
|
+
},
|
|
1382
|
+
format: (inst) => aggregateChecks(inst).format ?? null
|
|
1383
|
+
}, {
|
|
1384
|
+
gt(value, params) {
|
|
1385
|
+
return this.check(_gt(value, params));
|
|
1386
|
+
},
|
|
1387
|
+
gte(value, params) {
|
|
1388
|
+
return this.check(_gte(value, params));
|
|
1389
|
+
},
|
|
1390
|
+
min(value, params) {
|
|
1391
|
+
return this.check(_gte(value, params));
|
|
1392
|
+
},
|
|
1393
|
+
lt(value, params) {
|
|
1394
|
+
return this.check(_lt(value, params));
|
|
1395
|
+
},
|
|
1396
|
+
lte(value, params) {
|
|
1397
|
+
return this.check(_lte(value, params));
|
|
1398
|
+
},
|
|
1399
|
+
max(value, params) {
|
|
1400
|
+
return this.check(_lte(value, params));
|
|
1401
|
+
},
|
|
1402
|
+
int(params) {
|
|
1403
|
+
return this.check(int(params));
|
|
1404
|
+
},
|
|
1405
|
+
safe(params) {
|
|
1406
|
+
return this.check(int(params));
|
|
1407
|
+
},
|
|
1408
|
+
positive(params) {
|
|
1409
|
+
return this.check(_gt(0, params));
|
|
1410
|
+
},
|
|
1411
|
+
nonnegative(params) {
|
|
1412
|
+
return this.check(_gte(0, params));
|
|
1413
|
+
},
|
|
1414
|
+
negative(params) {
|
|
1415
|
+
return this.check(_lt(0, params));
|
|
1416
|
+
},
|
|
1417
|
+
nonpositive(params) {
|
|
1418
|
+
return this.check(_lte(0, params));
|
|
1419
|
+
},
|
|
1420
|
+
multipleOf(value, params) {
|
|
1421
|
+
return this.check(_multipleOf(value, params));
|
|
1422
|
+
},
|
|
1423
|
+
step(value, params) {
|
|
1424
|
+
return this.check(_multipleOf(value, params));
|
|
1425
|
+
},
|
|
1426
|
+
finite() {
|
|
1427
|
+
return this;
|
|
1428
|
+
}
|
|
1429
|
+
})
|
|
1430
|
+
);
|
|
1431
|
+
function number(params) {
|
|
1432
|
+
return _number(ZodNumber, params);
|
|
1433
|
+
}
|
|
1434
|
+
var ZodNumberFormat = /* @__PURE__ */ $constructor("ZodNumberFormat", (inst, def) => {
|
|
1435
|
+
$ZodNumberFormat.init(inst, def);
|
|
1436
|
+
ZodNumber.init(inst, def);
|
|
1437
|
+
});
|
|
1438
|
+
function int(params) {
|
|
1439
|
+
return _int(ZodNumberFormat, params);
|
|
1440
|
+
}
|
|
1441
|
+
function float32(params) {
|
|
1442
|
+
return _float32(ZodNumberFormat, params);
|
|
1443
|
+
}
|
|
1444
|
+
function float64(params) {
|
|
1445
|
+
return _float64(ZodNumberFormat, params);
|
|
1446
|
+
}
|
|
1447
|
+
function int32(params) {
|
|
1448
|
+
return _int32(ZodNumberFormat, params);
|
|
1449
|
+
}
|
|
1450
|
+
function uint32(params) {
|
|
1451
|
+
return _uint32(ZodNumberFormat, params);
|
|
1452
|
+
}
|
|
1453
|
+
var ZodBoolean = /* @__PURE__ */ $constructor("ZodBoolean", (inst, def) => {
|
|
1454
|
+
$ZodBoolean.init(inst, def);
|
|
1455
|
+
ZodType.init(inst, def);
|
|
1456
|
+
inst._zod.processJSONSchema = (ctx, json2, params) => booleanProcessor(inst, ctx, json2, params);
|
|
1457
|
+
});
|
|
1458
|
+
function boolean(params) {
|
|
1459
|
+
return _boolean(ZodBoolean, params);
|
|
1460
|
+
}
|
|
1461
|
+
var ZodBigInt = /* @__PURE__ */ $constructor(
|
|
1462
|
+
"ZodBigInt",
|
|
1463
|
+
(inst, def) => {
|
|
1464
|
+
$ZodBigInt.init(inst, def);
|
|
1465
|
+
ZodType.init(inst, def);
|
|
1466
|
+
inst._zod.processJSONSchema = (ctx, json2, params) => bigintProcessor(inst, ctx, json2, params);
|
|
1467
|
+
},
|
|
1468
|
+
/* @__PURE__ */ util_exports.derived({
|
|
1469
|
+
minValue: (inst) => aggregateChecks(inst).minimum ?? null,
|
|
1470
|
+
maxValue: (inst) => aggregateChecks(inst).maximum ?? null,
|
|
1471
|
+
format: (inst) => aggregateChecks(inst).format ?? null
|
|
1472
|
+
}, {
|
|
1473
|
+
gte(value, params) {
|
|
1474
|
+
return this.check(_gte(value, params));
|
|
1475
|
+
},
|
|
1476
|
+
min(value, params) {
|
|
1477
|
+
return this.check(_gte(value, params));
|
|
1478
|
+
},
|
|
1479
|
+
gt(value, params) {
|
|
1480
|
+
return this.check(_gt(value, params));
|
|
1481
|
+
},
|
|
1482
|
+
lt(value, params) {
|
|
1483
|
+
return this.check(_lt(value, params));
|
|
1484
|
+
},
|
|
1485
|
+
lte(value, params) {
|
|
1486
|
+
return this.check(_lte(value, params));
|
|
1487
|
+
},
|
|
1488
|
+
max(value, params) {
|
|
1489
|
+
return this.check(_lte(value, params));
|
|
1490
|
+
},
|
|
1491
|
+
positive(params) {
|
|
1492
|
+
return this.check(_gt(BigInt(0), params));
|
|
1493
|
+
},
|
|
1494
|
+
negative(params) {
|
|
1495
|
+
return this.check(_lt(BigInt(0), params));
|
|
1496
|
+
},
|
|
1497
|
+
nonpositive(params) {
|
|
1498
|
+
return this.check(_lte(BigInt(0), params));
|
|
1499
|
+
},
|
|
1500
|
+
nonnegative(params) {
|
|
1501
|
+
return this.check(_gte(BigInt(0), params));
|
|
1502
|
+
},
|
|
1503
|
+
multipleOf(value, params) {
|
|
1504
|
+
return this.check(_multipleOf(value, params));
|
|
1505
|
+
}
|
|
1506
|
+
})
|
|
1507
|
+
);
|
|
1508
|
+
function bigint(params) {
|
|
1509
|
+
return _bigint(ZodBigInt, params);
|
|
1510
|
+
}
|
|
1511
|
+
var ZodBigIntFormat = /* @__PURE__ */ $constructor("ZodBigIntFormat", (inst, def) => {
|
|
1512
|
+
$ZodBigIntFormat.init(inst, def);
|
|
1513
|
+
ZodBigInt.init(inst, def);
|
|
1514
|
+
});
|
|
1515
|
+
function int64(params) {
|
|
1516
|
+
return _int64(ZodBigIntFormat, params);
|
|
1517
|
+
}
|
|
1518
|
+
function uint64(params) {
|
|
1519
|
+
return _uint64(ZodBigIntFormat, params);
|
|
1520
|
+
}
|
|
1521
|
+
var ZodSymbol = /* @__PURE__ */ $constructor("ZodSymbol", (inst, def) => {
|
|
1522
|
+
$ZodSymbol.init(inst, def);
|
|
1523
|
+
ZodType.init(inst, def);
|
|
1524
|
+
inst._zod.processJSONSchema = (ctx, json2, params) => symbolProcessor(inst, ctx, json2, params);
|
|
1525
|
+
});
|
|
1526
|
+
function symbol(params) {
|
|
1527
|
+
return _symbol(ZodSymbol, params);
|
|
1528
|
+
}
|
|
1529
|
+
var ZodUndefined = /* @__PURE__ */ $constructor("ZodUndefined", (inst, def) => {
|
|
1530
|
+
$ZodUndefined.init(inst, def);
|
|
1531
|
+
ZodType.init(inst, def);
|
|
1532
|
+
inst._zod.processJSONSchema = (ctx, json2, params) => undefinedProcessor(inst, ctx, json2, params);
|
|
1533
|
+
});
|
|
1534
|
+
function _undefined2(params) {
|
|
1535
|
+
return _undefined(ZodUndefined, params);
|
|
1536
|
+
}
|
|
1537
|
+
var ZodNull = /* @__PURE__ */ $constructor("ZodNull", (inst, def) => {
|
|
1538
|
+
$ZodNull.init(inst, def);
|
|
1539
|
+
ZodType.init(inst, def);
|
|
1540
|
+
inst._zod.processJSONSchema = (ctx, json2, params) => nullProcessor(inst, ctx, json2, params);
|
|
1541
|
+
});
|
|
1542
|
+
function _null2(params) {
|
|
1543
|
+
return _null(ZodNull, params);
|
|
1544
|
+
}
|
|
1545
|
+
var ZodAny = /* @__PURE__ */ $constructor("ZodAny", (inst, def) => {
|
|
1546
|
+
$ZodAny.init(inst, def);
|
|
1547
|
+
ZodType.init(inst, def);
|
|
1548
|
+
inst._zod.processJSONSchema = (ctx, json2, params) => anyProcessor(inst, ctx, json2, params);
|
|
1549
|
+
});
|
|
1550
|
+
function any() {
|
|
1551
|
+
return _any(ZodAny);
|
|
1552
|
+
}
|
|
1553
|
+
var ZodUnknown = /* @__PURE__ */ $constructor("ZodUnknown", (inst, def) => {
|
|
1554
|
+
$ZodUnknown.init(inst, def);
|
|
1555
|
+
ZodType.init(inst, def);
|
|
1556
|
+
inst._zod.processJSONSchema = (ctx, json2, params) => unknownProcessor(inst, ctx, json2, params);
|
|
1557
|
+
});
|
|
1558
|
+
function unknown() {
|
|
1559
|
+
return _unknown(ZodUnknown);
|
|
1560
|
+
}
|
|
1561
|
+
var ZodNever = /* @__PURE__ */ $constructor("ZodNever", (inst, def) => {
|
|
1562
|
+
$ZodNever.init(inst, def);
|
|
1563
|
+
ZodType.init(inst, def);
|
|
1564
|
+
inst._zod.processJSONSchema = (ctx, json2, params) => neverProcessor(inst, ctx, json2, params);
|
|
1565
|
+
});
|
|
1566
|
+
function never(params) {
|
|
1567
|
+
return _never(ZodNever, params);
|
|
1568
|
+
}
|
|
1569
|
+
var ZodVoid = /* @__PURE__ */ $constructor("ZodVoid", (inst, def) => {
|
|
1570
|
+
$ZodVoid.init(inst, def);
|
|
1571
|
+
ZodType.init(inst, def);
|
|
1572
|
+
inst._zod.processJSONSchema = (ctx, json2, params) => voidProcessor(inst, ctx, json2, params);
|
|
1573
|
+
});
|
|
1574
|
+
function _void2(params) {
|
|
1575
|
+
return _void(ZodVoid, params);
|
|
1576
|
+
}
|
|
1577
|
+
var ZodDate = /* @__PURE__ */ $constructor(
|
|
1578
|
+
"ZodDate",
|
|
1579
|
+
(inst, def) => {
|
|
1580
|
+
$ZodDate.init(inst, def);
|
|
1581
|
+
ZodType.init(inst, def);
|
|
1582
|
+
inst._zod.processJSONSchema = (ctx, json2, params) => dateProcessor(inst, ctx, json2, params);
|
|
1583
|
+
inst.min = (value, params) => inst.check(_gte(value, params));
|
|
1584
|
+
inst.max = (value, params) => inst.check(_lte(value, params));
|
|
1585
|
+
},
|
|
1586
|
+
/* @__PURE__ */ util_exports.derived({
|
|
1587
|
+
minDate: (inst) => {
|
|
1588
|
+
const { minimum } = aggregateChecks(inst);
|
|
1589
|
+
return minimum ? new Date(minimum) : null;
|
|
1590
|
+
},
|
|
1591
|
+
maxDate: (inst) => {
|
|
1592
|
+
const { maximum } = aggregateChecks(inst);
|
|
1593
|
+
return maximum ? new Date(maximum) : null;
|
|
1594
|
+
}
|
|
1595
|
+
}, {})
|
|
1596
|
+
);
|
|
1597
|
+
function date(params) {
|
|
1598
|
+
return _date(ZodDate, params);
|
|
1599
|
+
}
|
|
1600
|
+
var ZodArray = /* @__PURE__ */ $constructor("ZodArray", (inst, def) => {
|
|
1601
|
+
_ensureDefaultMemoizer();
|
|
1602
|
+
$ZodArray.init(inst, def);
|
|
1603
|
+
ZodType.init(inst, def);
|
|
1604
|
+
inst._zod.processJSONSchema = (ctx, json2, params) => arrayProcessor(inst, ctx, json2, params);
|
|
1605
|
+
inst.element = def.element;
|
|
1606
|
+
}, {
|
|
1607
|
+
min(n, params) {
|
|
1608
|
+
return this.check(_minLength(n, params));
|
|
1609
|
+
},
|
|
1610
|
+
nonempty(params) {
|
|
1611
|
+
return this.check(_minLength(1, params));
|
|
1612
|
+
},
|
|
1613
|
+
max(n, params) {
|
|
1614
|
+
return this.check(_maxLength(n, params));
|
|
1615
|
+
},
|
|
1616
|
+
length(n, params) {
|
|
1617
|
+
return this.check(_length(n, params));
|
|
1618
|
+
},
|
|
1619
|
+
unwrap() {
|
|
1620
|
+
return this.element;
|
|
1621
|
+
}
|
|
1622
|
+
});
|
|
1623
|
+
function array(element, params) {
|
|
1624
|
+
return _array(ZodArray, element, params);
|
|
1625
|
+
}
|
|
1626
|
+
function keyof(schema) {
|
|
1627
|
+
const shape = schema._zod.def.shape;
|
|
1628
|
+
return _enum(Object.keys(shape));
|
|
1629
|
+
}
|
|
1630
|
+
var ZodObject = /* @__PURE__ */ $constructor("ZodObject", (inst, def) => {
|
|
1631
|
+
_ensureDefaultMemoizer();
|
|
1632
|
+
$ZodObjectJIT.init(inst, def);
|
|
1633
|
+
ZodType.init(inst, def);
|
|
1634
|
+
inst._zod.processJSONSchema = (ctx, json2, params) => objectProcessor(inst, ctx, json2, params);
|
|
1635
|
+
util_exports.installLazyProp(inst, "shape", (self) => self._zod.def.shape, false);
|
|
1636
|
+
}, {
|
|
1637
|
+
keyof() {
|
|
1638
|
+
return _enum(Object.keys(this._zod.def.shape));
|
|
1639
|
+
},
|
|
1640
|
+
catchall(catchall) {
|
|
1641
|
+
return this.clone(util_exports.mergeDefs(this._zod.def, { catchall }));
|
|
1642
|
+
},
|
|
1643
|
+
passthrough() {
|
|
1644
|
+
return this.clone(util_exports.mergeDefs(this._zod.def, { catchall: unknown() }));
|
|
1645
|
+
},
|
|
1646
|
+
loose() {
|
|
1647
|
+
return this.clone(util_exports.mergeDefs(this._zod.def, { catchall: unknown() }));
|
|
1648
|
+
},
|
|
1649
|
+
strict() {
|
|
1650
|
+
return this.clone(util_exports.mergeDefs(this._zod.def, { catchall: never() }));
|
|
1651
|
+
},
|
|
1652
|
+
strip() {
|
|
1653
|
+
return this.clone(util_exports.mergeDefs(this._zod.def, { catchall: void 0 }));
|
|
1654
|
+
},
|
|
1655
|
+
extend(incoming) {
|
|
1656
|
+
return util_exports.extend(this, incoming);
|
|
1657
|
+
},
|
|
1658
|
+
safeExtend(incoming) {
|
|
1659
|
+
return util_exports.safeExtend(this, incoming);
|
|
1660
|
+
},
|
|
1661
|
+
merge(other) {
|
|
1662
|
+
return util_exports.merge(this, other);
|
|
1663
|
+
},
|
|
1664
|
+
pick(mask) {
|
|
1665
|
+
return util_exports.pick(this, mask);
|
|
1666
|
+
},
|
|
1667
|
+
omit(mask) {
|
|
1668
|
+
return util_exports.omit(this, mask);
|
|
1669
|
+
},
|
|
1670
|
+
partial(...args) {
|
|
1671
|
+
return util_exports.partial(ZodOptional, this, args[0]);
|
|
1672
|
+
},
|
|
1673
|
+
exactPartial(...args) {
|
|
1674
|
+
return util_exports.partial(ZodExactOptional, this, args[0], "exactPartial");
|
|
1675
|
+
},
|
|
1676
|
+
required(...args) {
|
|
1677
|
+
return util_exports.required(ZodNonOptional, this, args[0]);
|
|
1678
|
+
}
|
|
1679
|
+
});
|
|
1680
|
+
function object(shape, params) {
|
|
1681
|
+
const def = {
|
|
1682
|
+
type: "object",
|
|
1683
|
+
shape: shape ?? {},
|
|
1684
|
+
...util_exports.normalizeParams(params)
|
|
1685
|
+
};
|
|
1686
|
+
return new ZodObject(def);
|
|
1687
|
+
}
|
|
1688
|
+
function strictObject(shape, params) {
|
|
1689
|
+
return new ZodObject({
|
|
1690
|
+
type: "object",
|
|
1691
|
+
shape,
|
|
1692
|
+
catchall: never(),
|
|
1693
|
+
...util_exports.normalizeParams(params)
|
|
1694
|
+
});
|
|
1695
|
+
}
|
|
1696
|
+
function looseObject(shape, params) {
|
|
1697
|
+
return new ZodObject({
|
|
1698
|
+
type: "object",
|
|
1699
|
+
shape,
|
|
1700
|
+
catchall: unknown(),
|
|
1701
|
+
...util_exports.normalizeParams(params)
|
|
1702
|
+
});
|
|
1703
|
+
}
|
|
1704
|
+
var ZodUnion = /* @__PURE__ */ $constructor("ZodUnion", (inst, def) => {
|
|
1705
|
+
$ZodUnion.init(inst, def);
|
|
1706
|
+
ZodType.init(inst, def);
|
|
1707
|
+
inst._zod.processJSONSchema = (ctx, json2, params) => unionProcessor(inst, ctx, json2, params);
|
|
1708
|
+
inst.options = def.options;
|
|
1709
|
+
});
|
|
1710
|
+
function union(options, params) {
|
|
1711
|
+
return new ZodUnion({
|
|
1712
|
+
type: "union",
|
|
1713
|
+
options,
|
|
1714
|
+
...util_exports.normalizeParams(params)
|
|
1715
|
+
});
|
|
1716
|
+
}
|
|
1717
|
+
var ZodXor = /* @__PURE__ */ $constructor("ZodXor", (inst, def) => {
|
|
1718
|
+
ZodUnion.init(inst, def);
|
|
1719
|
+
$ZodXor.init(inst, def);
|
|
1720
|
+
inst._zod.processJSONSchema = (ctx, json2, params) => unionProcessor(inst, ctx, json2, params);
|
|
1721
|
+
inst.options = def.options;
|
|
1722
|
+
});
|
|
1723
|
+
function xor(options, params) {
|
|
1724
|
+
return new ZodXor({
|
|
1725
|
+
type: "union",
|
|
1726
|
+
options,
|
|
1727
|
+
inclusive: false,
|
|
1728
|
+
...util_exports.normalizeParams(params)
|
|
1729
|
+
});
|
|
1730
|
+
}
|
|
1731
|
+
var ZodDiscriminatedUnion = /* @__PURE__ */ $constructor("ZodDiscriminatedUnion", (inst, def) => {
|
|
1732
|
+
ZodUnion.init(inst, def);
|
|
1733
|
+
$ZodDiscriminatedUnion.init(inst, def);
|
|
1734
|
+
});
|
|
1735
|
+
function discriminatedUnion(discriminator, options, params) {
|
|
1736
|
+
return new ZodDiscriminatedUnion({
|
|
1737
|
+
type: "union",
|
|
1738
|
+
options,
|
|
1739
|
+
discriminator,
|
|
1740
|
+
...util_exports.normalizeParams(params)
|
|
1741
|
+
});
|
|
1742
|
+
}
|
|
1743
|
+
var ZodIntersection = /* @__PURE__ */ $constructor("ZodIntersection", (inst, def) => {
|
|
1744
|
+
$ZodIntersection.init(inst, def);
|
|
1745
|
+
ZodType.init(inst, def);
|
|
1746
|
+
inst._zod.processJSONSchema = (ctx, json2, params) => intersectionProcessor(inst, ctx, json2, params);
|
|
1747
|
+
});
|
|
1748
|
+
function intersection(left, right) {
|
|
1749
|
+
return new ZodIntersection({
|
|
1750
|
+
type: "intersection",
|
|
1751
|
+
left,
|
|
1752
|
+
right
|
|
1753
|
+
});
|
|
1754
|
+
}
|
|
1755
|
+
var ZodTuple = /* @__PURE__ */ $constructor("ZodTuple", (inst, def) => {
|
|
1756
|
+
_ensureDefaultMemoizer();
|
|
1757
|
+
$ZodTuple.init(inst, def);
|
|
1758
|
+
ZodType.init(inst, def);
|
|
1759
|
+
inst._zod.processJSONSchema = (ctx, json2, params) => tupleProcessor(inst, ctx, json2, params);
|
|
1760
|
+
}, {
|
|
1761
|
+
rest(rest) {
|
|
1762
|
+
return this.clone({
|
|
1763
|
+
...this._zod.def,
|
|
1764
|
+
rest
|
|
1765
|
+
});
|
|
1766
|
+
},
|
|
1767
|
+
partial() {
|
|
1768
|
+
const def = this._zod.def;
|
|
1769
|
+
if (def.checks?.length)
|
|
1770
|
+
throw new Error(".partial() cannot be used on tuple schemas containing refinements");
|
|
1771
|
+
return this.clone({
|
|
1772
|
+
...def,
|
|
1773
|
+
items: def.items.map((item) => new ZodOptional({ type: "optional", innerType: item }))
|
|
1774
|
+
});
|
|
1775
|
+
}
|
|
1776
|
+
});
|
|
1777
|
+
function tuple(items, _paramsOrRest, _params) {
|
|
1778
|
+
const hasRest = _paramsOrRest instanceof $ZodType;
|
|
1779
|
+
const params = hasRest ? _params : _paramsOrRest;
|
|
1780
|
+
const rest = hasRest ? _paramsOrRest : null;
|
|
1781
|
+
return new ZodTuple({
|
|
1782
|
+
type: "tuple",
|
|
1783
|
+
items,
|
|
1784
|
+
rest,
|
|
1785
|
+
...util_exports.normalizeParams(params)
|
|
1786
|
+
});
|
|
1787
|
+
}
|
|
1788
|
+
var ZodRecord = /* @__PURE__ */ $constructor("ZodRecord", (inst, def) => {
|
|
1789
|
+
_ensureDefaultMemoizer();
|
|
1790
|
+
$ZodRecord.init(inst, def);
|
|
1791
|
+
ZodType.init(inst, def);
|
|
1792
|
+
inst._zod.processJSONSchema = (ctx, json2, params) => recordProcessor(inst, ctx, json2, params);
|
|
1793
|
+
inst.keyType = def.keyType;
|
|
1794
|
+
inst.valueType = def.valueType;
|
|
1795
|
+
});
|
|
1796
|
+
function record(keyType, valueType, params) {
|
|
1797
|
+
if (!valueType || !valueType._zod) {
|
|
1798
|
+
return new ZodRecord({
|
|
1799
|
+
type: "record",
|
|
1800
|
+
keyType: string(),
|
|
1801
|
+
valueType: keyType,
|
|
1802
|
+
...util_exports.normalizeParams(valueType)
|
|
1803
|
+
});
|
|
1804
|
+
}
|
|
1805
|
+
return new ZodRecord({
|
|
1806
|
+
type: "record",
|
|
1807
|
+
keyType,
|
|
1808
|
+
valueType,
|
|
1809
|
+
...util_exports.normalizeParams(params)
|
|
1810
|
+
});
|
|
1811
|
+
}
|
|
1812
|
+
function partialRecord(keyType, valueType, params) {
|
|
1813
|
+
return new ZodRecord({
|
|
1814
|
+
type: "record",
|
|
1815
|
+
keyType,
|
|
1816
|
+
valueType,
|
|
1817
|
+
...util_exports.normalizeParams(params),
|
|
1818
|
+
partial: true
|
|
1819
|
+
});
|
|
1820
|
+
}
|
|
1821
|
+
function looseRecord(keyType, valueType, params) {
|
|
1822
|
+
return new ZodRecord({
|
|
1823
|
+
type: "record",
|
|
1824
|
+
keyType,
|
|
1825
|
+
valueType,
|
|
1826
|
+
mode: "loose",
|
|
1827
|
+
...util_exports.normalizeParams(params)
|
|
1828
|
+
});
|
|
1829
|
+
}
|
|
1830
|
+
var ZodMap = /* @__PURE__ */ $constructor("ZodMap", (inst, def) => {
|
|
1831
|
+
_ensureDefaultMemoizer();
|
|
1832
|
+
$ZodMap.init(inst, def);
|
|
1833
|
+
ZodType.init(inst, def);
|
|
1834
|
+
inst._zod.processJSONSchema = (ctx, json2, params) => mapProcessor(inst, ctx, json2, params);
|
|
1835
|
+
inst.keyType = def.keyType;
|
|
1836
|
+
inst.valueType = def.valueType;
|
|
1837
|
+
inst.min = (...args) => inst.check(_minSize(...args));
|
|
1838
|
+
inst.nonempty = (params) => inst.check(_minSize(1, params));
|
|
1839
|
+
inst.max = (...args) => inst.check(_maxSize(...args));
|
|
1840
|
+
inst.size = (...args) => inst.check(_size(...args));
|
|
1841
|
+
});
|
|
1842
|
+
function map(keyType, valueType, params) {
|
|
1843
|
+
return new ZodMap({
|
|
1844
|
+
type: "map",
|
|
1845
|
+
keyType,
|
|
1846
|
+
valueType,
|
|
1847
|
+
...util_exports.normalizeParams(params)
|
|
1848
|
+
});
|
|
1849
|
+
}
|
|
1850
|
+
var ZodSet = /* @__PURE__ */ $constructor("ZodSet", (inst, def) => {
|
|
1851
|
+
_ensureDefaultMemoizer();
|
|
1852
|
+
$ZodSet.init(inst, def);
|
|
1853
|
+
ZodType.init(inst, def);
|
|
1854
|
+
inst._zod.processJSONSchema = (ctx, json2, params) => setProcessor(inst, ctx, json2, params);
|
|
1855
|
+
inst.min = (...args) => inst.check(_minSize(...args));
|
|
1856
|
+
inst.nonempty = (params) => inst.check(_minSize(1, params));
|
|
1857
|
+
inst.max = (...args) => inst.check(_maxSize(...args));
|
|
1858
|
+
inst.size = (...args) => inst.check(_size(...args));
|
|
1859
|
+
});
|
|
1860
|
+
function set(valueType, params) {
|
|
1861
|
+
return new ZodSet({
|
|
1862
|
+
type: "set",
|
|
1863
|
+
valueType,
|
|
1864
|
+
...util_exports.normalizeParams(params)
|
|
1865
|
+
});
|
|
1866
|
+
}
|
|
1867
|
+
var ZodEnum = /* @__PURE__ */ $constructor("ZodEnum", (inst, def) => {
|
|
1868
|
+
$ZodEnum.init(inst, def);
|
|
1869
|
+
ZodType.init(inst, def);
|
|
1870
|
+
inst._zod.processJSONSchema = (ctx, json2, params) => enumProcessor(inst, ctx, json2, params);
|
|
1871
|
+
inst.enum = def.entries;
|
|
1872
|
+
inst.options = [...inst._zod.values];
|
|
1873
|
+
const keys = new Set(Object.keys(def.entries));
|
|
1874
|
+
inst.extract = (values, params) => {
|
|
1875
|
+
const newEntries = {};
|
|
1876
|
+
for (const value of values) {
|
|
1877
|
+
if (keys.has(value)) {
|
|
1878
|
+
newEntries[value] = def.entries[value];
|
|
1879
|
+
} else
|
|
1880
|
+
throw new Error(`Key ${value} not found in enum`);
|
|
1881
|
+
}
|
|
1882
|
+
return new ZodEnum({
|
|
1883
|
+
...def,
|
|
1884
|
+
checks: [],
|
|
1885
|
+
...util_exports.normalizeParams(params),
|
|
1886
|
+
entries: newEntries
|
|
1887
|
+
});
|
|
1888
|
+
};
|
|
1889
|
+
inst.exclude = (values, params) => {
|
|
1890
|
+
const newEntries = { ...def.entries };
|
|
1891
|
+
for (const value of values) {
|
|
1892
|
+
if (keys.has(value)) {
|
|
1893
|
+
delete newEntries[value];
|
|
1894
|
+
} else
|
|
1895
|
+
throw new Error(`Key ${value} not found in enum`);
|
|
1896
|
+
}
|
|
1897
|
+
return new ZodEnum({
|
|
1898
|
+
...def,
|
|
1899
|
+
checks: [],
|
|
1900
|
+
...util_exports.normalizeParams(params),
|
|
1901
|
+
entries: newEntries
|
|
1902
|
+
});
|
|
1903
|
+
};
|
|
1904
|
+
});
|
|
1905
|
+
function _enum(values, params) {
|
|
1906
|
+
const entries = Array.isArray(values) ? Object.fromEntries(values.map((v) => [v, v])) : values;
|
|
1907
|
+
return new ZodEnum({
|
|
1908
|
+
type: "enum",
|
|
1909
|
+
entries,
|
|
1910
|
+
...util_exports.normalizeParams(params)
|
|
1911
|
+
});
|
|
1912
|
+
}
|
|
1913
|
+
function nativeEnum(entries, params) {
|
|
1914
|
+
return new ZodEnum({
|
|
1915
|
+
type: "enum",
|
|
1916
|
+
entries,
|
|
1917
|
+
...util_exports.normalizeParams(params)
|
|
1918
|
+
});
|
|
1919
|
+
}
|
|
1920
|
+
var ZodLiteral = /* @__PURE__ */ $constructor("ZodLiteral", (inst, def) => {
|
|
1921
|
+
$ZodLiteral.init(inst, def);
|
|
1922
|
+
ZodType.init(inst, def);
|
|
1923
|
+
inst._zod.processJSONSchema = (ctx, json2, params) => literalProcessor(inst, ctx, json2, params);
|
|
1924
|
+
inst.values = new Set(def.values);
|
|
1925
|
+
Object.defineProperty(inst, "value", {
|
|
1926
|
+
get() {
|
|
1927
|
+
if (def.values.length > 1) {
|
|
1928
|
+
throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");
|
|
1929
|
+
}
|
|
1930
|
+
return def.values[0];
|
|
1931
|
+
}
|
|
1932
|
+
});
|
|
1933
|
+
});
|
|
1934
|
+
function literal(value, params) {
|
|
1935
|
+
return new ZodLiteral({
|
|
1936
|
+
type: "literal",
|
|
1937
|
+
values: Array.isArray(value) ? value : [value],
|
|
1938
|
+
...util_exports.normalizeParams(params)
|
|
1939
|
+
});
|
|
1940
|
+
}
|
|
1941
|
+
var ZodFile = /* @__PURE__ */ $constructor("ZodFile", (inst, def) => {
|
|
1942
|
+
$ZodFile.init(inst, def);
|
|
1943
|
+
ZodType.init(inst, def);
|
|
1944
|
+
inst._zod.processJSONSchema = (ctx, json2, params) => fileProcessor(inst, ctx, json2, params);
|
|
1945
|
+
inst.min = (size, params) => inst.check(_minSize(size, params));
|
|
1946
|
+
inst.max = (size, params) => inst.check(_maxSize(size, params));
|
|
1947
|
+
inst.mime = (types, params) => inst.check(_mime(Array.isArray(types) ? types : [types], params));
|
|
1948
|
+
});
|
|
1949
|
+
function file(params) {
|
|
1950
|
+
return _file(ZodFile, params);
|
|
1951
|
+
}
|
|
1952
|
+
var ZodTransform = /* @__PURE__ */ $constructor("ZodTransform", (inst, def) => {
|
|
1953
|
+
_ensureDefaultMemoizer();
|
|
1954
|
+
$ZodTransform.init(inst, def);
|
|
1955
|
+
ZodType.init(inst, def);
|
|
1956
|
+
inst._zod.processJSONSchema = (ctx, json2, params) => transformProcessor(inst, ctx, json2, params);
|
|
1957
|
+
inst._zod.parse = (payload, _ctx) => {
|
|
1958
|
+
if (_ctx.direction === "backward") {
|
|
1959
|
+
throw new $ZodEncodeError(inst.constructor.name);
|
|
1960
|
+
}
|
|
1961
|
+
payload.addIssue = (issue) => {
|
|
1962
|
+
if (typeof issue === "string") {
|
|
1963
|
+
payload.issues.push(util_exports.issue(issue, payload.value, def));
|
|
1964
|
+
} else {
|
|
1965
|
+
const _issue = issue;
|
|
1966
|
+
if (_issue.fatal)
|
|
1967
|
+
_issue.continue = false;
|
|
1968
|
+
_issue.code ?? (_issue.code = "custom");
|
|
1969
|
+
if (!("input" in _issue))
|
|
1970
|
+
_issue.input = payload.value;
|
|
1971
|
+
_issue.inst ?? (_issue.inst = inst);
|
|
1972
|
+
payload.issues.push(util_exports.issue(_issue));
|
|
1973
|
+
}
|
|
1974
|
+
};
|
|
1975
|
+
const output2 = def.transform(payload.value, payload);
|
|
1976
|
+
if (output2 instanceof Promise) {
|
|
1977
|
+
return output2.then((output3) => {
|
|
1978
|
+
payload.value = output3;
|
|
1979
|
+
return payload;
|
|
1980
|
+
});
|
|
1981
|
+
}
|
|
1982
|
+
payload.value = output2;
|
|
1983
|
+
return payload;
|
|
1984
|
+
};
|
|
1985
|
+
});
|
|
1986
|
+
function transform(fn) {
|
|
1987
|
+
return new ZodTransform({
|
|
1988
|
+
type: "transform",
|
|
1989
|
+
transform: fn
|
|
1990
|
+
});
|
|
1991
|
+
}
|
|
1992
|
+
var ZodOptional = /* @__PURE__ */ $constructor("ZodOptional", (inst, def) => {
|
|
1993
|
+
$ZodOptional.init(inst, def);
|
|
1994
|
+
ZodType.init(inst, def);
|
|
1995
|
+
inst._zod.processJSONSchema = (ctx, json2, params) => optionalProcessor(inst, ctx, json2, params);
|
|
1996
|
+
inst.unwrap = () => inst._zod.def.innerType;
|
|
1997
|
+
});
|
|
1998
|
+
function optional(innerType) {
|
|
1999
|
+
return new ZodOptional({
|
|
2000
|
+
type: "optional",
|
|
2001
|
+
innerType
|
|
2002
|
+
});
|
|
2003
|
+
}
|
|
2004
|
+
var ZodExactOptional = /* @__PURE__ */ $constructor("ZodExactOptional", (inst, def) => {
|
|
2005
|
+
$ZodExactOptional.init(inst, def);
|
|
2006
|
+
ZodType.init(inst, def);
|
|
2007
|
+
inst._zod.processJSONSchema = (ctx, json2, params) => optionalProcessor(inst, ctx, json2, params);
|
|
2008
|
+
inst.unwrap = () => inst._zod.def.innerType;
|
|
2009
|
+
});
|
|
2010
|
+
function exactOptional(innerType) {
|
|
2011
|
+
return new ZodExactOptional({
|
|
2012
|
+
type: "optional",
|
|
2013
|
+
innerType
|
|
2014
|
+
});
|
|
2015
|
+
}
|
|
2016
|
+
var ZodNullable = /* @__PURE__ */ $constructor("ZodNullable", (inst, def) => {
|
|
2017
|
+
$ZodNullable.init(inst, def);
|
|
2018
|
+
ZodType.init(inst, def);
|
|
2019
|
+
inst._zod.processJSONSchema = (ctx, json2, params) => nullableProcessor(inst, ctx, json2, params);
|
|
2020
|
+
inst.unwrap = () => inst._zod.def.innerType;
|
|
2021
|
+
});
|
|
2022
|
+
function nullable(innerType) {
|
|
2023
|
+
return new ZodNullable({
|
|
2024
|
+
type: "nullable",
|
|
2025
|
+
innerType
|
|
2026
|
+
});
|
|
2027
|
+
}
|
|
2028
|
+
function nullish(innerType) {
|
|
2029
|
+
return optional(nullable(innerType));
|
|
2030
|
+
}
|
|
2031
|
+
var ZodDefault = /* @__PURE__ */ $constructor("ZodDefault", (inst, def) => {
|
|
2032
|
+
$ZodDefault.init(inst, def);
|
|
2033
|
+
ZodType.init(inst, def);
|
|
2034
|
+
inst._zod.processJSONSchema = (ctx, json2, params) => defaultProcessor(inst, ctx, json2, params);
|
|
2035
|
+
inst.unwrap = () => inst._zod.def.innerType;
|
|
2036
|
+
inst.removeDefault = inst.unwrap;
|
|
2037
|
+
});
|
|
2038
|
+
function _default(innerType, defaultValue) {
|
|
2039
|
+
return new ZodDefault({
|
|
2040
|
+
type: "default",
|
|
2041
|
+
innerType,
|
|
2042
|
+
get defaultValue() {
|
|
2043
|
+
return typeof defaultValue === "function" ? defaultValue() : util_exports.shallowClone(defaultValue);
|
|
2044
|
+
}
|
|
2045
|
+
});
|
|
2046
|
+
}
|
|
2047
|
+
var ZodPrefault = /* @__PURE__ */ $constructor("ZodPrefault", (inst, def) => {
|
|
2048
|
+
$ZodPrefault.init(inst, def);
|
|
2049
|
+
ZodType.init(inst, def);
|
|
2050
|
+
inst._zod.processJSONSchema = (ctx, json2, params) => prefaultProcessor(inst, ctx, json2, params);
|
|
2051
|
+
inst.unwrap = () => inst._zod.def.innerType;
|
|
2052
|
+
});
|
|
2053
|
+
function prefault(innerType, defaultValue) {
|
|
2054
|
+
return new ZodPrefault({
|
|
2055
|
+
type: "prefault",
|
|
2056
|
+
innerType,
|
|
2057
|
+
get defaultValue() {
|
|
2058
|
+
return typeof defaultValue === "function" ? defaultValue() : util_exports.shallowClone(defaultValue);
|
|
2059
|
+
}
|
|
2060
|
+
});
|
|
2061
|
+
}
|
|
2062
|
+
var ZodNonOptional = /* @__PURE__ */ $constructor("ZodNonOptional", (inst, def) => {
|
|
2063
|
+
$ZodNonOptional.init(inst, def);
|
|
2064
|
+
ZodType.init(inst, def);
|
|
2065
|
+
inst._zod.processJSONSchema = (ctx, json2, params) => nonoptionalProcessor(inst, ctx, json2, params);
|
|
2066
|
+
inst.unwrap = () => inst._zod.def.innerType;
|
|
2067
|
+
});
|
|
2068
|
+
function nonoptional(innerType, params) {
|
|
2069
|
+
return new ZodNonOptional({
|
|
2070
|
+
type: "nonoptional",
|
|
2071
|
+
innerType,
|
|
2072
|
+
...util_exports.normalizeParams(params)
|
|
2073
|
+
});
|
|
2074
|
+
}
|
|
2075
|
+
var ZodSuccess = /* @__PURE__ */ $constructor("ZodSuccess", (inst, def) => {
|
|
2076
|
+
$ZodSuccess.init(inst, def);
|
|
2077
|
+
ZodType.init(inst, def);
|
|
2078
|
+
inst._zod.processJSONSchema = (ctx, json2, params) => successProcessor(inst, ctx, json2, params);
|
|
2079
|
+
inst.unwrap = () => inst._zod.def.innerType;
|
|
2080
|
+
});
|
|
2081
|
+
function success(innerType) {
|
|
2082
|
+
return new ZodSuccess({
|
|
2083
|
+
type: "success",
|
|
2084
|
+
innerType
|
|
2085
|
+
});
|
|
2086
|
+
}
|
|
2087
|
+
var ZodCatch = /* @__PURE__ */ $constructor("ZodCatch", (inst, def) => {
|
|
2088
|
+
$ZodCatch.init(inst, def);
|
|
2089
|
+
ZodType.init(inst, def);
|
|
2090
|
+
inst._zod.processJSONSchema = (ctx, json2, params) => catchProcessor(inst, ctx, json2, params);
|
|
2091
|
+
inst.unwrap = () => inst._zod.def.innerType;
|
|
2092
|
+
inst.removeCatch = inst.unwrap;
|
|
2093
|
+
});
|
|
2094
|
+
function _catch(innerType, catchValue) {
|
|
2095
|
+
return new ZodCatch({
|
|
2096
|
+
type: "catch",
|
|
2097
|
+
innerType,
|
|
2098
|
+
catchValue: typeof catchValue === "function" ? catchValue : util_exports.constantCatch(catchValue)
|
|
2099
|
+
});
|
|
2100
|
+
}
|
|
2101
|
+
var ZodNaN = /* @__PURE__ */ $constructor("ZodNaN", (inst, def) => {
|
|
2102
|
+
$ZodNaN.init(inst, def);
|
|
2103
|
+
ZodType.init(inst, def);
|
|
2104
|
+
inst._zod.processJSONSchema = (ctx, json2, params) => nanProcessor(inst, ctx, json2, params);
|
|
2105
|
+
});
|
|
2106
|
+
function nan(params) {
|
|
2107
|
+
return _nan(ZodNaN, params);
|
|
2108
|
+
}
|
|
2109
|
+
var ZodPipe = /* @__PURE__ */ $constructor("ZodPipe", (inst, def) => {
|
|
2110
|
+
$ZodPipe.init(inst, def);
|
|
2111
|
+
ZodType.init(inst, def);
|
|
2112
|
+
inst._zod.processJSONSchema = (ctx, json2, params) => pipeProcessor(inst, ctx, json2, params);
|
|
2113
|
+
inst.in = def.in;
|
|
2114
|
+
inst.out = def.out;
|
|
2115
|
+
});
|
|
2116
|
+
function pipe(in_, out) {
|
|
2117
|
+
return new ZodPipe({
|
|
2118
|
+
type: "pipe",
|
|
2119
|
+
in: in_,
|
|
2120
|
+
out
|
|
2121
|
+
// ...util.normalizeParams(params),
|
|
2122
|
+
});
|
|
2123
|
+
}
|
|
2124
|
+
var ZodCodec = /* @__PURE__ */ $constructor("ZodCodec", (inst, def) => {
|
|
2125
|
+
ZodPipe.init(inst, def);
|
|
2126
|
+
$ZodCodec.init(inst, def);
|
|
2127
|
+
});
|
|
2128
|
+
function codec(in_, out, params) {
|
|
2129
|
+
return new ZodCodec({
|
|
2130
|
+
type: "pipe",
|
|
2131
|
+
in: in_,
|
|
2132
|
+
out,
|
|
2133
|
+
transform: params.decode,
|
|
2134
|
+
reverseTransform: params.encode
|
|
2135
|
+
});
|
|
2136
|
+
}
|
|
2137
|
+
function invertCodec(codec2) {
|
|
2138
|
+
const def = codec2._zod.def;
|
|
2139
|
+
return new ZodCodec({
|
|
2140
|
+
type: "pipe",
|
|
2141
|
+
in: def.out,
|
|
2142
|
+
out: def.in,
|
|
2143
|
+
transform: def.reverseTransform,
|
|
2144
|
+
reverseTransform: def.transform
|
|
2145
|
+
});
|
|
2146
|
+
}
|
|
2147
|
+
var ZodPreprocess = /* @__PURE__ */ $constructor("ZodPreprocess", (inst, def) => {
|
|
2148
|
+
ZodPipe.init(inst, def);
|
|
2149
|
+
$ZodPreprocess.init(inst, def);
|
|
2150
|
+
});
|
|
2151
|
+
var ZodReadonly = /* @__PURE__ */ $constructor("ZodReadonly", (inst, def) => {
|
|
2152
|
+
$ZodReadonly.init(inst, def);
|
|
2153
|
+
ZodType.init(inst, def);
|
|
2154
|
+
inst._zod.processJSONSchema = (ctx, json2, params) => readonlyProcessor(inst, ctx, json2, params);
|
|
2155
|
+
inst.unwrap = () => inst._zod.def.innerType;
|
|
2156
|
+
});
|
|
2157
|
+
function readonly(innerType) {
|
|
2158
|
+
return new ZodReadonly({
|
|
2159
|
+
type: "readonly",
|
|
2160
|
+
innerType
|
|
2161
|
+
});
|
|
2162
|
+
}
|
|
2163
|
+
var ZodTemplateLiteral = /* @__PURE__ */ $constructor("ZodTemplateLiteral", (inst, def) => {
|
|
2164
|
+
$ZodTemplateLiteral.init(inst, def);
|
|
2165
|
+
ZodType.init(inst, def);
|
|
2166
|
+
inst._zod.processJSONSchema = (ctx, json2, params) => templateLiteralProcessor(inst, ctx, json2, params);
|
|
2167
|
+
});
|
|
2168
|
+
function templateLiteral(parts, params) {
|
|
2169
|
+
return new ZodTemplateLiteral({
|
|
2170
|
+
type: "template_literal",
|
|
2171
|
+
parts,
|
|
2172
|
+
...util_exports.normalizeParams(params)
|
|
2173
|
+
});
|
|
2174
|
+
}
|
|
2175
|
+
var ZodLazy = /* @__PURE__ */ $constructor("ZodLazy", (inst, def) => {
|
|
2176
|
+
$ZodLazy.init(inst, def);
|
|
2177
|
+
ZodType.init(inst, def);
|
|
2178
|
+
inst._zod.processJSONSchema = (ctx, json2, params) => lazyProcessor(inst, ctx, json2, params);
|
|
2179
|
+
inst.unwrap = () => inst._zod.def.getter();
|
|
2180
|
+
});
|
|
2181
|
+
function lazy(getter) {
|
|
2182
|
+
return new ZodLazy({
|
|
2183
|
+
type: "lazy",
|
|
2184
|
+
getter
|
|
2185
|
+
});
|
|
2186
|
+
}
|
|
2187
|
+
var ZodPromise = /* @__PURE__ */ $constructor("ZodPromise", (inst, def) => {
|
|
2188
|
+
$ZodPromise.init(inst, def);
|
|
2189
|
+
ZodType.init(inst, def);
|
|
2190
|
+
inst._zod.processJSONSchema = (ctx, json2, params) => promiseProcessor(inst, ctx, json2, params);
|
|
2191
|
+
inst.unwrap = () => inst._zod.def.innerType;
|
|
2192
|
+
});
|
|
2193
|
+
function promise(innerType) {
|
|
2194
|
+
return new ZodPromise({
|
|
2195
|
+
type: "promise",
|
|
2196
|
+
innerType
|
|
2197
|
+
});
|
|
2198
|
+
}
|
|
2199
|
+
var ZodFunction = /* @__PURE__ */ $constructor("ZodFunction", (inst, def) => {
|
|
2200
|
+
$ZodFunction.init(inst, def);
|
|
2201
|
+
ZodType.init(inst, def);
|
|
2202
|
+
inst._zod.processJSONSchema = (ctx, json2, params) => functionProcessor(inst, ctx, json2, params);
|
|
2203
|
+
});
|
|
2204
|
+
function _function(params) {
|
|
2205
|
+
return new ZodFunction({
|
|
2206
|
+
type: "function",
|
|
2207
|
+
input: Array.isArray(params?.input) ? tuple(params?.input) : params?.input ?? array(unknown()),
|
|
2208
|
+
output: params?.output ?? unknown()
|
|
2209
|
+
});
|
|
2210
|
+
}
|
|
2211
|
+
var ZodCustom = /* @__PURE__ */ $constructor("ZodCustom", (inst, def) => {
|
|
2212
|
+
$ZodCustom.init(inst, def);
|
|
2213
|
+
ZodType.init(inst, def);
|
|
2214
|
+
inst._zod.processJSONSchema = (ctx, json2, params) => customProcessor(inst, ctx, json2, params);
|
|
2215
|
+
});
|
|
2216
|
+
function check(fn) {
|
|
2217
|
+
const ch = new $ZodCheck({
|
|
2218
|
+
check: "custom"
|
|
2219
|
+
// ...util.normalizeParams(params),
|
|
2220
|
+
});
|
|
2221
|
+
ch._zod.check = fn;
|
|
2222
|
+
return ch;
|
|
2223
|
+
}
|
|
2224
|
+
function custom(fn, _params) {
|
|
2225
|
+
return _custom(ZodCustom, fn ?? (() => true), _params);
|
|
2226
|
+
}
|
|
2227
|
+
function refine(fn, _params = {}) {
|
|
2228
|
+
return _refine(ZodCustom, fn, _params);
|
|
2229
|
+
}
|
|
2230
|
+
function superRefine(fn, params) {
|
|
2231
|
+
return _superRefine(fn, params);
|
|
2232
|
+
}
|
|
2233
|
+
var describe2 = describe;
|
|
2234
|
+
var meta2 = meta;
|
|
2235
|
+
var ZodInstanceOf = /* @__PURE__ */ $constructor("ZodInstanceOf", (inst, def) => {
|
|
2236
|
+
ZodCustom.init(inst, def);
|
|
2237
|
+
}, {
|
|
2238
|
+
properties(shape, params) {
|
|
2239
|
+
return this.check(_properties(shape, params));
|
|
2240
|
+
}
|
|
2241
|
+
});
|
|
2242
|
+
function _instanceof(cls, params = {}) {
|
|
2243
|
+
const inst = new ZodInstanceOf({
|
|
2244
|
+
type: "custom",
|
|
2245
|
+
check: "custom",
|
|
2246
|
+
fn: (data) => data instanceof cls,
|
|
2247
|
+
abort: true,
|
|
2248
|
+
...util_exports.normalizeParams(params)
|
|
2249
|
+
});
|
|
2250
|
+
inst._zod.bag.Class = cls;
|
|
2251
|
+
inst._zod.check = (payload) => {
|
|
2252
|
+
if (!(payload.value instanceof cls)) {
|
|
2253
|
+
payload.issues.push({
|
|
2254
|
+
code: "invalid_type",
|
|
2255
|
+
expected: cls.name,
|
|
2256
|
+
input: payload.value,
|
|
2257
|
+
inst,
|
|
2258
|
+
path: [...inst._zod.def.path ?? []]
|
|
2259
|
+
});
|
|
2260
|
+
}
|
|
2261
|
+
};
|
|
2262
|
+
return inst;
|
|
2263
|
+
}
|
|
2264
|
+
var stringbool = (...args) => _stringbool({
|
|
2265
|
+
Codec: ZodCodec,
|
|
2266
|
+
Boolean: ZodBoolean,
|
|
2267
|
+
String: ZodString
|
|
2268
|
+
}, ...args);
|
|
2269
|
+
function json(params) {
|
|
2270
|
+
const jsonSchema = lazy(() => {
|
|
2271
|
+
return union([string(params), number(), boolean(), _null2(), array(jsonSchema), record(string(), jsonSchema)]);
|
|
2272
|
+
});
|
|
2273
|
+
return jsonSchema;
|
|
2274
|
+
}
|
|
2275
|
+
function preprocess(fn, schema) {
|
|
2276
|
+
return new ZodPreprocess({
|
|
2277
|
+
type: "pipe",
|
|
2278
|
+
in: transform(fn),
|
|
2279
|
+
out: schema
|
|
2280
|
+
});
|
|
2281
|
+
}
|
|
2282
|
+
|
|
2283
|
+
// ../../node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/classic/compat.js
|
|
2284
|
+
var ZodIssueCode = {
|
|
2285
|
+
invalid_type: "invalid_type",
|
|
2286
|
+
too_big: "too_big",
|
|
2287
|
+
too_small: "too_small",
|
|
2288
|
+
invalid_format: "invalid_format",
|
|
2289
|
+
not_multiple_of: "not_multiple_of",
|
|
2290
|
+
unrecognized_keys: "unrecognized_keys",
|
|
2291
|
+
invalid_union: "invalid_union",
|
|
2292
|
+
invalid_key: "invalid_key",
|
|
2293
|
+
invalid_element: "invalid_element",
|
|
2294
|
+
invalid_value: "invalid_value",
|
|
2295
|
+
custom: "custom"
|
|
2296
|
+
};
|
|
2297
|
+
function setErrorMap(map2) {
|
|
2298
|
+
config({
|
|
2299
|
+
customError: map2
|
|
2300
|
+
});
|
|
2301
|
+
}
|
|
2302
|
+
function getErrorMap() {
|
|
2303
|
+
return config().customError;
|
|
2304
|
+
}
|
|
2305
|
+
var ZodFirstPartyTypeKind;
|
|
2306
|
+
/* @__PURE__ */ (function(ZodFirstPartyTypeKind2) {
|
|
2307
|
+
})(ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {}));
|
|
2308
|
+
|
|
2309
|
+
// ../../node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/classic/iso.js
|
|
2310
|
+
var iso_exports = {};
|
|
2311
|
+
__export(iso_exports, {
|
|
2312
|
+
ZodISODate: () => ZodISODate,
|
|
2313
|
+
ZodISODateTime: () => ZodISODateTime,
|
|
2314
|
+
ZodISODuration: () => ZodISODuration,
|
|
2315
|
+
ZodISOTime: () => ZodISOTime,
|
|
2316
|
+
date: () => date2,
|
|
2317
|
+
datetime: () => datetime,
|
|
2318
|
+
duration: () => duration,
|
|
2319
|
+
time: () => time
|
|
2320
|
+
});
|
|
2321
|
+
function datetime(params) {
|
|
2322
|
+
return _isoDateTime(ZodISODateTime, params);
|
|
2323
|
+
}
|
|
2324
|
+
function date2(params) {
|
|
2325
|
+
return _isoDate(ZodISODate, params);
|
|
2326
|
+
}
|
|
2327
|
+
function time(params) {
|
|
2328
|
+
return _isoTime(ZodISOTime, params);
|
|
2329
|
+
}
|
|
2330
|
+
function duration(params) {
|
|
2331
|
+
return _isoDuration(ZodISODuration, params);
|
|
2332
|
+
}
|
|
2333
|
+
|
|
2334
|
+
// ../../node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/classic/from-json-schema.js
|
|
2335
|
+
var z = {
|
|
2336
|
+
...schemas_exports,
|
|
2337
|
+
...checks_exports,
|
|
2338
|
+
iso: iso_exports
|
|
2339
|
+
};
|
|
2340
|
+
var RECOGNIZED_KEYS = /* @__PURE__ */ new Set([
|
|
2341
|
+
// Schema identification
|
|
2342
|
+
"$schema",
|
|
2343
|
+
"$ref",
|
|
2344
|
+
"$defs",
|
|
2345
|
+
"definitions",
|
|
2346
|
+
// Core schema keywords
|
|
2347
|
+
"$id",
|
|
2348
|
+
"id",
|
|
2349
|
+
"$comment",
|
|
2350
|
+
"$anchor",
|
|
2351
|
+
"$vocabulary",
|
|
2352
|
+
"$dynamicRef",
|
|
2353
|
+
"$dynamicAnchor",
|
|
2354
|
+
// Type
|
|
2355
|
+
"type",
|
|
2356
|
+
"enum",
|
|
2357
|
+
"const",
|
|
2358
|
+
// Composition
|
|
2359
|
+
"anyOf",
|
|
2360
|
+
"oneOf",
|
|
2361
|
+
"allOf",
|
|
2362
|
+
"not",
|
|
2363
|
+
// Object
|
|
2364
|
+
"properties",
|
|
2365
|
+
"required",
|
|
2366
|
+
"additionalProperties",
|
|
2367
|
+
"patternProperties",
|
|
2368
|
+
"propertyNames",
|
|
2369
|
+
"minProperties",
|
|
2370
|
+
"maxProperties",
|
|
2371
|
+
// Array
|
|
2372
|
+
"items",
|
|
2373
|
+
"prefixItems",
|
|
2374
|
+
"additionalItems",
|
|
2375
|
+
"minItems",
|
|
2376
|
+
"maxItems",
|
|
2377
|
+
"uniqueItems",
|
|
2378
|
+
"contains",
|
|
2379
|
+
"minContains",
|
|
2380
|
+
"maxContains",
|
|
2381
|
+
// String
|
|
2382
|
+
"minLength",
|
|
2383
|
+
"maxLength",
|
|
2384
|
+
"pattern",
|
|
2385
|
+
"format",
|
|
2386
|
+
// Number
|
|
2387
|
+
"minimum",
|
|
2388
|
+
"maximum",
|
|
2389
|
+
"exclusiveMinimum",
|
|
2390
|
+
"exclusiveMaximum",
|
|
2391
|
+
"multipleOf",
|
|
2392
|
+
// Already handled metadata
|
|
2393
|
+
"description",
|
|
2394
|
+
"default",
|
|
2395
|
+
// Content
|
|
2396
|
+
"contentEncoding",
|
|
2397
|
+
"contentMediaType",
|
|
2398
|
+
"contentSchema",
|
|
2399
|
+
// Unsupported (error-throwing)
|
|
2400
|
+
"unevaluatedItems",
|
|
2401
|
+
"unevaluatedProperties",
|
|
2402
|
+
"if",
|
|
2403
|
+
"then",
|
|
2404
|
+
"else",
|
|
2405
|
+
"dependentSchemas",
|
|
2406
|
+
"dependentRequired",
|
|
2407
|
+
// OpenAPI
|
|
2408
|
+
"nullable",
|
|
2409
|
+
"readOnly"
|
|
2410
|
+
]);
|
|
2411
|
+
function detectVersion(schema, defaultTarget) {
|
|
2412
|
+
const $schema = schema.$schema;
|
|
2413
|
+
if ($schema === "https://json-schema.org/draft/2020-12/schema") {
|
|
2414
|
+
return "draft-2020-12";
|
|
2415
|
+
}
|
|
2416
|
+
if ($schema === "http://json-schema.org/draft-07/schema#") {
|
|
2417
|
+
return "draft-7";
|
|
2418
|
+
}
|
|
2419
|
+
if ($schema === "http://json-schema.org/draft-04/schema#") {
|
|
2420
|
+
return "draft-4";
|
|
2421
|
+
}
|
|
2422
|
+
return defaultTarget ?? "draft-2020-12";
|
|
2423
|
+
}
|
|
2424
|
+
function applyMinItems(items, minItems) {
|
|
2425
|
+
return items.map((item, index) => index < minItems ? item : item.optional());
|
|
2426
|
+
}
|
|
2427
|
+
function decodeJSONPointerSegment(segment) {
|
|
2428
|
+
return segment.replace(/~1/g, "/").replace(/~0/g, "~");
|
|
2429
|
+
}
|
|
2430
|
+
function resolveRef(ref, ctx) {
|
|
2431
|
+
if (!ref.startsWith("#")) {
|
|
2432
|
+
throw new Error("External $ref is not supported, only local refs (#/...) are allowed");
|
|
2433
|
+
}
|
|
2434
|
+
const path = ref.slice(1).split("/").filter(Boolean);
|
|
2435
|
+
if (path.length === 0) {
|
|
2436
|
+
return ctx.rootSchema;
|
|
2437
|
+
}
|
|
2438
|
+
const defsKey = ctx.version === "draft-2020-12" ? "$defs" : "definitions";
|
|
2439
|
+
if (path[0] === defsKey) {
|
|
2440
|
+
const key = path[1] === void 0 ? void 0 : decodeJSONPointerSegment(path[1]);
|
|
2441
|
+
if (!key || !ctx.defs[key]) {
|
|
2442
|
+
throw new Error(`Reference not found: ${ref}`);
|
|
2443
|
+
}
|
|
2444
|
+
return ctx.defs[key];
|
|
2445
|
+
}
|
|
2446
|
+
throw new Error(`Reference not found: ${ref}`);
|
|
2447
|
+
}
|
|
2448
|
+
function checkObjectGuards(objectSchema, guards) {
|
|
2449
|
+
const guard = z.transform((value) => value).check((payload) => {
|
|
2450
|
+
const value = payload.value;
|
|
2451
|
+
if (typeof value !== "object" || value === null || Array.isArray(value))
|
|
2452
|
+
return;
|
|
2453
|
+
const keys = Object.getOwnPropertyNames(value);
|
|
2454
|
+
if (guards.minProperties !== void 0 && keys.length < guards.minProperties) {
|
|
2455
|
+
payload.issues.push({
|
|
2456
|
+
origin: "object",
|
|
2457
|
+
code: "too_small",
|
|
2458
|
+
minimum: guards.minProperties,
|
|
2459
|
+
inclusive: true,
|
|
2460
|
+
message: `Too small: expected object to have >=${guards.minProperties} properties`,
|
|
2461
|
+
input: value,
|
|
2462
|
+
inst: objectSchema,
|
|
2463
|
+
continue: true
|
|
2464
|
+
});
|
|
2465
|
+
}
|
|
2466
|
+
if (guards.maxProperties !== void 0 && keys.length > guards.maxProperties) {
|
|
2467
|
+
payload.issues.push({
|
|
2468
|
+
origin: "object",
|
|
2469
|
+
code: "too_big",
|
|
2470
|
+
maximum: guards.maxProperties,
|
|
2471
|
+
inclusive: true,
|
|
2472
|
+
message: `Too big: expected object to have <=${guards.maxProperties} properties`,
|
|
2473
|
+
input: value,
|
|
2474
|
+
inst: objectSchema,
|
|
2475
|
+
continue: true
|
|
2476
|
+
});
|
|
2477
|
+
}
|
|
2478
|
+
if (guards.keySchema) {
|
|
2479
|
+
for (const key of keys) {
|
|
2480
|
+
const result = guards.keySchema.safeParse(key);
|
|
2481
|
+
if (result.success)
|
|
2482
|
+
continue;
|
|
2483
|
+
payload.issues.push({
|
|
2484
|
+
code: "invalid_key",
|
|
2485
|
+
origin: "record",
|
|
2486
|
+
issues: result.error.issues,
|
|
2487
|
+
input: key,
|
|
2488
|
+
path: [key],
|
|
2489
|
+
continue: true
|
|
2490
|
+
});
|
|
2491
|
+
}
|
|
2492
|
+
}
|
|
2493
|
+
});
|
|
2494
|
+
return guard.pipe(objectSchema);
|
|
2495
|
+
}
|
|
2496
|
+
function canonicalKey(value, seen) {
|
|
2497
|
+
if (value === null)
|
|
2498
|
+
return "z";
|
|
2499
|
+
const type = typeof value;
|
|
2500
|
+
if (type !== "object") {
|
|
2501
|
+
if (type === "number" && Number.isNaN(value))
|
|
2502
|
+
return null;
|
|
2503
|
+
const raw = String(value);
|
|
2504
|
+
return `${type[0]}${raw.length}:${raw}`;
|
|
2505
|
+
}
|
|
2506
|
+
if (seen.has(value))
|
|
2507
|
+
return null;
|
|
2508
|
+
seen.add(value);
|
|
2509
|
+
try {
|
|
2510
|
+
if (Array.isArray(value)) {
|
|
2511
|
+
const parts2 = [];
|
|
2512
|
+
for (const item of value) {
|
|
2513
|
+
const key = canonicalKey(item, seen);
|
|
2514
|
+
if (key === null)
|
|
2515
|
+
return null;
|
|
2516
|
+
parts2.push(key);
|
|
2517
|
+
}
|
|
2518
|
+
return `a${parts2.length}:[${parts2.join(",")}]`;
|
|
2519
|
+
}
|
|
2520
|
+
const keys = Object.keys(value).sort();
|
|
2521
|
+
const parts = [];
|
|
2522
|
+
for (const k of keys) {
|
|
2523
|
+
const key = canonicalKey(value[k], seen);
|
|
2524
|
+
if (key === null)
|
|
2525
|
+
return null;
|
|
2526
|
+
parts.push(`${k.length}:${k}=${key}`);
|
|
2527
|
+
}
|
|
2528
|
+
return `o${parts.length}:{${parts.join(",")}}`;
|
|
2529
|
+
} finally {
|
|
2530
|
+
seen.delete(value);
|
|
2531
|
+
}
|
|
2532
|
+
}
|
|
2533
|
+
var SCHEMA_KEYWORDS = /* @__PURE__ */ new Set([
|
|
2534
|
+
"items",
|
|
2535
|
+
"prefixItems",
|
|
2536
|
+
"additionalItems",
|
|
2537
|
+
"additionalProperties",
|
|
2538
|
+
"contains",
|
|
2539
|
+
"propertyNames",
|
|
2540
|
+
"not",
|
|
2541
|
+
"if",
|
|
2542
|
+
"then",
|
|
2543
|
+
"else",
|
|
2544
|
+
"allOf",
|
|
2545
|
+
"anyOf",
|
|
2546
|
+
"oneOf",
|
|
2547
|
+
"unevaluatedItems",
|
|
2548
|
+
"unevaluatedProperties",
|
|
2549
|
+
"contentSchema"
|
|
2550
|
+
]);
|
|
2551
|
+
var SCHEMA_MAP_KEYWORDS = /* @__PURE__ */ new Set([
|
|
2552
|
+
"properties",
|
|
2553
|
+
"patternProperties",
|
|
2554
|
+
"dependentSchemas",
|
|
2555
|
+
"dependencies",
|
|
2556
|
+
"$defs",
|
|
2557
|
+
"definitions"
|
|
2558
|
+
]);
|
|
2559
|
+
function containsRef(value) {
|
|
2560
|
+
if (typeof value !== "object" || value === null)
|
|
2561
|
+
return false;
|
|
2562
|
+
if (Array.isArray(value))
|
|
2563
|
+
return value.some(containsRef);
|
|
2564
|
+
if (typeof value.$ref === "string")
|
|
2565
|
+
return true;
|
|
2566
|
+
return Object.entries(value).some(([key, sub]) => {
|
|
2567
|
+
if (SCHEMA_KEYWORDS.has(key))
|
|
2568
|
+
return containsRef(sub);
|
|
2569
|
+
if (!SCHEMA_MAP_KEYWORDS.has(key) || typeof sub !== "object" || sub === null)
|
|
2570
|
+
return false;
|
|
2571
|
+
return Object.values(sub).some(containsRef);
|
|
2572
|
+
});
|
|
2573
|
+
}
|
|
2574
|
+
function plural(n) {
|
|
2575
|
+
return n === 1 ? "element" : "elements";
|
|
2576
|
+
}
|
|
2577
|
+
function checkArrayGuards(arraySchema, guards) {
|
|
2578
|
+
const guard = z.transform((value) => value).check((payload) => {
|
|
2579
|
+
const items = payload.value;
|
|
2580
|
+
if (!Array.isArray(items))
|
|
2581
|
+
return;
|
|
2582
|
+
if (guards.uniqueItems === true) {
|
|
2583
|
+
const firstSeen = /* @__PURE__ */ new Map();
|
|
2584
|
+
for (let i = 0; i < items.length; i++) {
|
|
2585
|
+
const key = canonicalKey(items[i], /* @__PURE__ */ new Set());
|
|
2586
|
+
if (key === null)
|
|
2587
|
+
continue;
|
|
2588
|
+
const first = firstSeen.get(key);
|
|
2589
|
+
if (first === void 0) {
|
|
2590
|
+
firstSeen.set(key, i);
|
|
2591
|
+
continue;
|
|
2592
|
+
}
|
|
2593
|
+
payload.issues.push({
|
|
2594
|
+
code: "custom",
|
|
2595
|
+
message: `Array items must be unique: element at index ${i} duplicates the one at index ${first}`,
|
|
2596
|
+
input: items,
|
|
2597
|
+
path: [i],
|
|
2598
|
+
continue: true
|
|
2599
|
+
});
|
|
2600
|
+
}
|
|
2601
|
+
}
|
|
2602
|
+
if (guards.containsSchema) {
|
|
2603
|
+
const minContains = guards.minContains ?? 1;
|
|
2604
|
+
const ceiling = guards.maxContains !== void 0 ? guards.maxContains + 1 : Number.POSITIVE_INFINITY;
|
|
2605
|
+
let matches = 0;
|
|
2606
|
+
for (const item of items) {
|
|
2607
|
+
if (guards.containsSchema.safeParse(item).success && ++matches >= ceiling)
|
|
2608
|
+
break;
|
|
2609
|
+
}
|
|
2610
|
+
if (matches < minContains) {
|
|
2611
|
+
payload.issues.push({
|
|
2612
|
+
code: "custom",
|
|
2613
|
+
message: `Array must contain at least ${minContains} matching ${plural(minContains)}; found ${matches}`,
|
|
2614
|
+
input: items,
|
|
2615
|
+
continue: true
|
|
2616
|
+
});
|
|
2617
|
+
}
|
|
2618
|
+
if (guards.maxContains !== void 0 && matches > guards.maxContains) {
|
|
2619
|
+
payload.issues.push({
|
|
2620
|
+
code: "custom",
|
|
2621
|
+
message: `Array must contain at most ${guards.maxContains} matching ${plural(guards.maxContains)}`,
|
|
2622
|
+
input: items,
|
|
2623
|
+
continue: true
|
|
2624
|
+
});
|
|
2625
|
+
}
|
|
2626
|
+
}
|
|
2627
|
+
});
|
|
2628
|
+
return guard.pipe(arraySchema);
|
|
2629
|
+
}
|
|
2630
|
+
function getTupleRest(restSchema, ctx) {
|
|
2631
|
+
if (restSchema === false) {
|
|
2632
|
+
return void 0;
|
|
2633
|
+
}
|
|
2634
|
+
if (restSchema === void 0 || restSchema === true) {
|
|
2635
|
+
return z.any();
|
|
2636
|
+
}
|
|
2637
|
+
return convertSchema(restSchema, ctx);
|
|
2638
|
+
}
|
|
2639
|
+
var fullTime = /^(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|[+-](?:[01]\d|2[0-3]):[0-5]\d)$/;
|
|
2640
|
+
function convertBaseSchema(schema, ctx) {
|
|
2641
|
+
if (schema.not !== void 0) {
|
|
2642
|
+
if (typeof schema.not === "object" && Object.keys(schema.not).length === 0) {
|
|
2643
|
+
return z.never();
|
|
2644
|
+
}
|
|
2645
|
+
throw new Error("not is not supported in Zod (except { not: {} } for never)");
|
|
2646
|
+
}
|
|
2647
|
+
if (schema.unevaluatedItems !== void 0) {
|
|
2648
|
+
throw new Error("unevaluatedItems is not supported");
|
|
2649
|
+
}
|
|
2650
|
+
if (schema.unevaluatedProperties !== void 0) {
|
|
2651
|
+
throw new Error("unevaluatedProperties is not supported");
|
|
2652
|
+
}
|
|
2653
|
+
if (schema.if !== void 0 || schema.then !== void 0 || schema.else !== void 0) {
|
|
2654
|
+
throw new Error("Conditional schemas (if/then/else) are not supported");
|
|
2655
|
+
}
|
|
2656
|
+
if (schema.dependentSchemas !== void 0 || schema.dependentRequired !== void 0) {
|
|
2657
|
+
throw new Error("dependentSchemas and dependentRequired are not supported");
|
|
2658
|
+
}
|
|
2659
|
+
if (schema.$ref) {
|
|
2660
|
+
const refPath = schema.$ref;
|
|
2661
|
+
if (ctx.refs.has(refPath)) {
|
|
2662
|
+
return ctx.refs.get(refPath);
|
|
2663
|
+
}
|
|
2664
|
+
if (ctx.processing.has(refPath)) {
|
|
2665
|
+
return z.lazy(() => {
|
|
2666
|
+
if (!ctx.refs.has(refPath)) {
|
|
2667
|
+
throw new Error(`Circular reference not resolved: ${refPath}`);
|
|
2668
|
+
}
|
|
2669
|
+
return ctx.refs.get(refPath);
|
|
2670
|
+
});
|
|
2671
|
+
}
|
|
2672
|
+
ctx.processing.add(refPath);
|
|
2673
|
+
const resolved = resolveRef(refPath, ctx);
|
|
2674
|
+
const zodSchema2 = convertSchema(resolved, ctx);
|
|
2675
|
+
ctx.refs.set(refPath, zodSchema2);
|
|
2676
|
+
ctx.processing.delete(refPath);
|
|
2677
|
+
return zodSchema2;
|
|
2678
|
+
}
|
|
2679
|
+
if (schema.enum !== void 0) {
|
|
2680
|
+
const enumValues = schema.enum;
|
|
2681
|
+
if (ctx.version === "openapi-3.0" && schema.nullable === true && enumValues.length === 1 && enumValues[0] === null) {
|
|
2682
|
+
return z.null();
|
|
2683
|
+
}
|
|
2684
|
+
if (enumValues.length === 0) {
|
|
2685
|
+
return z.never();
|
|
2686
|
+
}
|
|
2687
|
+
if (enumValues.length === 1) {
|
|
2688
|
+
return z.literal(enumValues[0]);
|
|
2689
|
+
}
|
|
2690
|
+
if (enumValues.every((v) => typeof v === "string")) {
|
|
2691
|
+
return z.enum(enumValues);
|
|
2692
|
+
}
|
|
2693
|
+
const literalSchemas = enumValues.map((v) => z.literal(v));
|
|
2694
|
+
if (literalSchemas.length < 2) {
|
|
2695
|
+
return literalSchemas[0];
|
|
2696
|
+
}
|
|
2697
|
+
return z.union([literalSchemas[0], literalSchemas[1], ...literalSchemas.slice(2)]);
|
|
2698
|
+
}
|
|
2699
|
+
if (schema.const !== void 0) {
|
|
2700
|
+
return z.literal(schema.const);
|
|
2701
|
+
}
|
|
2702
|
+
const type = schema.type;
|
|
2703
|
+
if (Array.isArray(type)) {
|
|
2704
|
+
const typeSchemas = type.map((t) => {
|
|
2705
|
+
const typeSchema = { ...schema, type: t };
|
|
2706
|
+
return convertBaseSchema(typeSchema, ctx);
|
|
2707
|
+
});
|
|
2708
|
+
if (typeSchemas.length === 0) {
|
|
2709
|
+
return z.never();
|
|
2710
|
+
}
|
|
2711
|
+
if (typeSchemas.length === 1) {
|
|
2712
|
+
return typeSchemas[0];
|
|
2713
|
+
}
|
|
2714
|
+
return z.union(typeSchemas);
|
|
2715
|
+
}
|
|
2716
|
+
if (!type) {
|
|
2717
|
+
return z.any();
|
|
2718
|
+
}
|
|
2719
|
+
let zodSchema;
|
|
2720
|
+
switch (type) {
|
|
2721
|
+
case "string": {
|
|
2722
|
+
let stringSchema = z.string();
|
|
2723
|
+
if (schema.format) {
|
|
2724
|
+
const format = schema.format;
|
|
2725
|
+
if (format === "email") {
|
|
2726
|
+
stringSchema = stringSchema.check(z.email());
|
|
2727
|
+
} else if (format === "uri" || format === "uri-reference") {
|
|
2728
|
+
stringSchema = stringSchema.check(z.url());
|
|
2729
|
+
} else if (format === "uuid" || format === "guid") {
|
|
2730
|
+
stringSchema = stringSchema.check(z.uuid());
|
|
2731
|
+
} else if (format === "date-time") {
|
|
2732
|
+
stringSchema = stringSchema.check(z.iso.datetime({ offset: true }));
|
|
2733
|
+
} else if (format === "date") {
|
|
2734
|
+
stringSchema = stringSchema.check(z.iso.date());
|
|
2735
|
+
} else if (format === "time") {
|
|
2736
|
+
stringSchema = stringSchema.check(z.regex(fullTime));
|
|
2737
|
+
} else if (format === "duration") {
|
|
2738
|
+
stringSchema = stringSchema.check(z.iso.duration());
|
|
2739
|
+
} else if (format === "hostname") {
|
|
2740
|
+
stringSchema = stringSchema.check(z.hostname());
|
|
2741
|
+
} else if (format === "ipv4") {
|
|
2742
|
+
stringSchema = stringSchema.check(z.ipv4());
|
|
2743
|
+
} else if (format === "ipv6") {
|
|
2744
|
+
stringSchema = stringSchema.check(z.ipv6());
|
|
2745
|
+
} else if (format === "mac") {
|
|
2746
|
+
stringSchema = stringSchema.check(z.mac());
|
|
2747
|
+
} else if (format === "cidr") {
|
|
2748
|
+
stringSchema = stringSchema.check(z.cidrv4());
|
|
2749
|
+
} else if (format === "cidr-v6") {
|
|
2750
|
+
stringSchema = stringSchema.check(z.cidrv6());
|
|
2751
|
+
} else if (format === "base64") {
|
|
2752
|
+
stringSchema = stringSchema.check(z.base64());
|
|
2753
|
+
} else if (format === "base64url") {
|
|
2754
|
+
stringSchema = stringSchema.check(z.base64url());
|
|
2755
|
+
} else if (format === "e164") {
|
|
2756
|
+
stringSchema = stringSchema.check(z.e164());
|
|
2757
|
+
} else if (format === "credit_card") {
|
|
2758
|
+
stringSchema = stringSchema.check(z.creditCard());
|
|
2759
|
+
} else if (format === "iban") {
|
|
2760
|
+
stringSchema = stringSchema.check(z.iban());
|
|
2761
|
+
} else if (format === "jwt") {
|
|
2762
|
+
stringSchema = stringSchema.check(z.jwt());
|
|
2763
|
+
} else if (format === "emoji") {
|
|
2764
|
+
stringSchema = stringSchema.check(z.emoji());
|
|
2765
|
+
} else if (format === "nanoid") {
|
|
2766
|
+
stringSchema = stringSchema.check(z.nanoid());
|
|
2767
|
+
} else if (format === "cuid") {
|
|
2768
|
+
stringSchema = stringSchema.check(z.cuid());
|
|
2769
|
+
} else if (format === "cuid2") {
|
|
2770
|
+
stringSchema = stringSchema.check(z.cuid2());
|
|
2771
|
+
} else if (format === "ulid") {
|
|
2772
|
+
stringSchema = stringSchema.check(z.ulid());
|
|
2773
|
+
} else if (format === "xid") {
|
|
2774
|
+
stringSchema = stringSchema.check(z.xid());
|
|
2775
|
+
} else if (format === "ksuid") {
|
|
2776
|
+
stringSchema = stringSchema.check(z.ksuid());
|
|
2777
|
+
}
|
|
2778
|
+
}
|
|
2779
|
+
if (typeof schema.minLength === "number") {
|
|
2780
|
+
stringSchema = stringSchema.min(schema.minLength);
|
|
2781
|
+
}
|
|
2782
|
+
if (typeof schema.maxLength === "number") {
|
|
2783
|
+
stringSchema = stringSchema.max(schema.maxLength);
|
|
2784
|
+
}
|
|
2785
|
+
if (schema.pattern) {
|
|
2786
|
+
stringSchema = stringSchema.regex(new RegExp(schema.pattern));
|
|
2787
|
+
}
|
|
2788
|
+
zodSchema = stringSchema;
|
|
2789
|
+
break;
|
|
2790
|
+
}
|
|
2791
|
+
case "number":
|
|
2792
|
+
case "integer": {
|
|
2793
|
+
let numberSchema = type === "integer" ? z.number().int() : z.number();
|
|
2794
|
+
if (typeof schema.minimum === "number" && schema.exclusiveMinimum !== true) {
|
|
2795
|
+
numberSchema = numberSchema.min(schema.minimum);
|
|
2796
|
+
}
|
|
2797
|
+
if (typeof schema.maximum === "number" && schema.exclusiveMaximum !== true) {
|
|
2798
|
+
numberSchema = numberSchema.max(schema.maximum);
|
|
2799
|
+
}
|
|
2800
|
+
if (typeof schema.exclusiveMinimum === "number") {
|
|
2801
|
+
numberSchema = numberSchema.gt(schema.exclusiveMinimum);
|
|
2802
|
+
} else if (schema.exclusiveMinimum === true && typeof schema.minimum === "number") {
|
|
2803
|
+
numberSchema = numberSchema.gt(schema.minimum);
|
|
2804
|
+
}
|
|
2805
|
+
if (typeof schema.exclusiveMaximum === "number") {
|
|
2806
|
+
numberSchema = numberSchema.lt(schema.exclusiveMaximum);
|
|
2807
|
+
} else if (schema.exclusiveMaximum === true && typeof schema.maximum === "number") {
|
|
2808
|
+
numberSchema = numberSchema.lt(schema.maximum);
|
|
2809
|
+
}
|
|
2810
|
+
if (typeof schema.multipleOf === "number") {
|
|
2811
|
+
numberSchema = numberSchema.multipleOf(schema.multipleOf);
|
|
2812
|
+
}
|
|
2813
|
+
zodSchema = numberSchema;
|
|
2814
|
+
break;
|
|
2815
|
+
}
|
|
2816
|
+
case "boolean": {
|
|
2817
|
+
zodSchema = z.boolean();
|
|
2818
|
+
break;
|
|
2819
|
+
}
|
|
2820
|
+
case "null": {
|
|
2821
|
+
zodSchema = z.null();
|
|
2822
|
+
break;
|
|
2823
|
+
}
|
|
2824
|
+
case "object": {
|
|
2825
|
+
const shape = {};
|
|
2826
|
+
const properties = schema.properties || {};
|
|
2827
|
+
const requiredSet = new Set(schema.required || []);
|
|
2828
|
+
const additionalSchema = typeof schema.additionalProperties === "object" ? convertSchema(schema.additionalProperties, ctx) : void 0;
|
|
2829
|
+
for (const [key, propSchema] of Object.entries(properties)) {
|
|
2830
|
+
const propZodSchema = convertSchema(propSchema, ctx);
|
|
2831
|
+
assignProp(shape, key, requiredSet.has(key) ? propZodSchema : propZodSchema.optional());
|
|
2832
|
+
}
|
|
2833
|
+
if (schema.patternProperties) {
|
|
2834
|
+
const patternProps = schema.patternProperties;
|
|
2835
|
+
const patternKeys = Object.keys(patternProps);
|
|
2836
|
+
const looseRecords = [];
|
|
2837
|
+
for (const pattern of patternKeys) {
|
|
2838
|
+
const patternValue = convertSchema(patternProps[pattern], ctx);
|
|
2839
|
+
const keySchema = z.string().regex(new RegExp(pattern));
|
|
2840
|
+
looseRecords.push(z.looseRecord(keySchema, patternValue));
|
|
2841
|
+
}
|
|
2842
|
+
const schemasToIntersect = [];
|
|
2843
|
+
if (Object.keys(shape).length > 0) {
|
|
2844
|
+
schemasToIntersect.push(z.object(shape).passthrough());
|
|
2845
|
+
}
|
|
2846
|
+
schemasToIntersect.push(...looseRecords);
|
|
2847
|
+
if (schemasToIntersect.length === 0) {
|
|
2848
|
+
zodSchema = z.object({}).passthrough();
|
|
2849
|
+
} else if (schemasToIntersect.length === 1) {
|
|
2850
|
+
zodSchema = schemasToIntersect[0];
|
|
2851
|
+
} else {
|
|
2852
|
+
let result = z.intersection(schemasToIntersect[0], schemasToIntersect[1]);
|
|
2853
|
+
for (let i = 2; i < schemasToIntersect.length; i++) {
|
|
2854
|
+
result = z.intersection(result, schemasToIntersect[i]);
|
|
2855
|
+
}
|
|
2856
|
+
zodSchema = result;
|
|
2857
|
+
}
|
|
2858
|
+
if (schema.additionalProperties === false) {
|
|
2859
|
+
const propertyKeys = Object.keys(shape);
|
|
2860
|
+
const patterns = patternKeys.map((p) => new RegExp(p));
|
|
2861
|
+
const basePatternSchema = zodSchema;
|
|
2862
|
+
zodSchema = zodSchema.check((payload) => {
|
|
2863
|
+
if (!isPlainObject(payload.value))
|
|
2864
|
+
return;
|
|
2865
|
+
const unrecognized = [];
|
|
2866
|
+
for (const key of Object.keys(payload.value)) {
|
|
2867
|
+
if (propertyKeys.includes(key))
|
|
2868
|
+
continue;
|
|
2869
|
+
if (patterns.some((regex) => regex.test(key)))
|
|
2870
|
+
continue;
|
|
2871
|
+
unrecognized.push(key);
|
|
2872
|
+
}
|
|
2873
|
+
if (unrecognized.length) {
|
|
2874
|
+
payload.issues.push({
|
|
2875
|
+
code: "unrecognized_keys",
|
|
2876
|
+
keys: unrecognized,
|
|
2877
|
+
input: payload.value,
|
|
2878
|
+
inst: basePatternSchema
|
|
2879
|
+
});
|
|
2880
|
+
}
|
|
2881
|
+
});
|
|
2882
|
+
}
|
|
2883
|
+
} else {
|
|
2884
|
+
const objectSchema = z.object(shape);
|
|
2885
|
+
if (schema.additionalProperties === false) {
|
|
2886
|
+
zodSchema = objectSchema.strict();
|
|
2887
|
+
} else if (additionalSchema) {
|
|
2888
|
+
zodSchema = objectSchema.catchall(additionalSchema);
|
|
2889
|
+
} else {
|
|
2890
|
+
zodSchema = objectSchema.passthrough();
|
|
2891
|
+
}
|
|
2892
|
+
}
|
|
2893
|
+
const hasKeyGuard = schema.propertyNames !== void 0 && schema.propertyNames !== true;
|
|
2894
|
+
const minProperties = typeof schema.minProperties === "number" ? schema.minProperties : void 0;
|
|
2895
|
+
const maxProperties = typeof schema.maxProperties === "number" ? schema.maxProperties : void 0;
|
|
2896
|
+
if (hasKeyGuard || minProperties !== void 0 || maxProperties !== void 0) {
|
|
2897
|
+
let keySchema;
|
|
2898
|
+
if (hasKeyGuard) {
|
|
2899
|
+
const keyJSONSchema = typeof schema.propertyNames === "object" && schema.propertyNames.type === void 0 ? { type: "string", ...schema.propertyNames } : schema.propertyNames;
|
|
2900
|
+
keySchema = convertSchema(keyJSONSchema, ctx);
|
|
2901
|
+
}
|
|
2902
|
+
zodSchema = checkObjectGuards(zodSchema, { keySchema, minProperties, maxProperties });
|
|
2903
|
+
}
|
|
2904
|
+
break;
|
|
2905
|
+
}
|
|
2906
|
+
case "array": {
|
|
2907
|
+
const prefixItems = schema.prefixItems;
|
|
2908
|
+
const items = schema.items;
|
|
2909
|
+
if (prefixItems && Array.isArray(prefixItems)) {
|
|
2910
|
+
const minItems = typeof schema.minItems === "number" ? schema.minItems : 0;
|
|
2911
|
+
const tupleItems = prefixItems.map((item) => convertSchema(item, ctx));
|
|
2912
|
+
const positionalItems = applyMinItems(tupleItems, minItems);
|
|
2913
|
+
const rest = !Array.isArray(items) ? getTupleRest(items, ctx) : void 0;
|
|
2914
|
+
const tupleSchema = z.tuple(positionalItems);
|
|
2915
|
+
zodSchema = rest ? tupleSchema.rest(rest) : tupleSchema;
|
|
2916
|
+
if (typeof schema.minItems === "number") {
|
|
2917
|
+
zodSchema = zodSchema.check(z.minLength(schema.minItems));
|
|
2918
|
+
}
|
|
2919
|
+
if (typeof schema.maxItems === "number") {
|
|
2920
|
+
zodSchema = zodSchema.check(z.maxLength(schema.maxItems));
|
|
2921
|
+
}
|
|
2922
|
+
} else if (Array.isArray(items)) {
|
|
2923
|
+
const minItems = typeof schema.minItems === "number" ? schema.minItems : 0;
|
|
2924
|
+
const tupleItems = items.map((item) => convertSchema(item, ctx));
|
|
2925
|
+
const positionalItems = applyMinItems(tupleItems, minItems);
|
|
2926
|
+
const rest = getTupleRest(schema.additionalItems, ctx);
|
|
2927
|
+
const tupleSchema = z.tuple(positionalItems);
|
|
2928
|
+
zodSchema = rest ? tupleSchema.rest(rest) : tupleSchema;
|
|
2929
|
+
if (typeof schema.minItems === "number") {
|
|
2930
|
+
zodSchema = zodSchema.check(z.minLength(schema.minItems));
|
|
2931
|
+
}
|
|
2932
|
+
if (typeof schema.maxItems === "number") {
|
|
2933
|
+
zodSchema = zodSchema.check(z.maxLength(schema.maxItems));
|
|
2934
|
+
}
|
|
2935
|
+
} else if (items !== void 0) {
|
|
2936
|
+
const element = convertSchema(items, ctx);
|
|
2937
|
+
let arraySchema = z.array(element);
|
|
2938
|
+
if (typeof schema.minItems === "number") {
|
|
2939
|
+
arraySchema = arraySchema.min(schema.minItems);
|
|
2940
|
+
}
|
|
2941
|
+
if (typeof schema.maxItems === "number") {
|
|
2942
|
+
arraySchema = arraySchema.max(schema.maxItems);
|
|
2943
|
+
}
|
|
2944
|
+
zodSchema = arraySchema;
|
|
2945
|
+
} else {
|
|
2946
|
+
zodSchema = z.array(z.any());
|
|
2947
|
+
}
|
|
2948
|
+
if (schema.uniqueItems === true || schema.contains !== void 0) {
|
|
2949
|
+
zodSchema = checkArrayGuards(zodSchema, {
|
|
2950
|
+
uniqueItems: schema.uniqueItems === true,
|
|
2951
|
+
containsSchema: schema.contains !== void 0 ? convertSchema(schema.contains, ctx) : void 0,
|
|
2952
|
+
minContains: typeof schema.minContains === "number" ? schema.minContains : void 0,
|
|
2953
|
+
maxContains: typeof schema.maxContains === "number" ? schema.maxContains : void 0
|
|
2954
|
+
});
|
|
2955
|
+
}
|
|
2956
|
+
break;
|
|
2957
|
+
}
|
|
2958
|
+
default:
|
|
2959
|
+
throw new Error(`Unsupported type: ${type}`);
|
|
2960
|
+
}
|
|
2961
|
+
return zodSchema;
|
|
2962
|
+
}
|
|
2963
|
+
function convertSchema(schema, ctx) {
|
|
2964
|
+
if (typeof schema === "boolean") {
|
|
2965
|
+
return schema ? z.any() : z.never();
|
|
2966
|
+
}
|
|
2967
|
+
let baseSchema = convertBaseSchema(schema, ctx);
|
|
2968
|
+
const hasExplicitType = schema.type || schema.enum !== void 0 || schema.const !== void 0;
|
|
2969
|
+
if (schema.anyOf && Array.isArray(schema.anyOf)) {
|
|
2970
|
+
const options = schema.anyOf.map((s) => convertSchema(s, ctx));
|
|
2971
|
+
const anyOfUnion = z.union(options);
|
|
2972
|
+
baseSchema = hasExplicitType ? z.intersection(baseSchema, anyOfUnion) : anyOfUnion;
|
|
2973
|
+
}
|
|
2974
|
+
if (schema.oneOf && Array.isArray(schema.oneOf)) {
|
|
2975
|
+
const options = schema.oneOf.map((s) => convertSchema(s, ctx));
|
|
2976
|
+
const oneOfUnion = z.xor(options);
|
|
2977
|
+
baseSchema = hasExplicitType ? z.intersection(baseSchema, oneOfUnion) : oneOfUnion;
|
|
2978
|
+
}
|
|
2979
|
+
if (schema.allOf && Array.isArray(schema.allOf)) {
|
|
2980
|
+
if (schema.allOf.length === 0) {
|
|
2981
|
+
baseSchema = hasExplicitType ? baseSchema : z.any();
|
|
2982
|
+
} else {
|
|
2983
|
+
let result = hasExplicitType ? baseSchema : convertSchema(schema.allOf[0], ctx);
|
|
2984
|
+
const startIdx = hasExplicitType ? 0 : 1;
|
|
2985
|
+
for (let i = startIdx; i < schema.allOf.length; i++) {
|
|
2986
|
+
result = z.intersection(result, convertSchema(schema.allOf[i], ctx));
|
|
2987
|
+
}
|
|
2988
|
+
baseSchema = result;
|
|
2989
|
+
}
|
|
2990
|
+
}
|
|
2991
|
+
if (schema.nullable === true && ctx.version === "openapi-3.0") {
|
|
2992
|
+
baseSchema = z.nullable(baseSchema);
|
|
2993
|
+
}
|
|
2994
|
+
if (schema.readOnly === true) {
|
|
2995
|
+
baseSchema = z.readonly(baseSchema);
|
|
2996
|
+
}
|
|
2997
|
+
if (schema.default !== void 0) {
|
|
2998
|
+
baseSchema = baseSchema.default(schema.default);
|
|
2999
|
+
}
|
|
3000
|
+
const extraMeta = {};
|
|
3001
|
+
const coreMetadataKeys = ["$id", "id", "$comment", "$anchor", "$vocabulary", "$dynamicRef", "$dynamicAnchor"];
|
|
3002
|
+
for (const key of coreMetadataKeys) {
|
|
3003
|
+
if (key in schema) {
|
|
3004
|
+
extraMeta[key] = schema[key];
|
|
3005
|
+
}
|
|
3006
|
+
}
|
|
3007
|
+
const contentMetadataKeys = ["contentEncoding", "contentMediaType", "contentSchema"];
|
|
3008
|
+
for (const key of contentMetadataKeys) {
|
|
3009
|
+
if (key in schema) {
|
|
3010
|
+
extraMeta[key] = schema[key];
|
|
3011
|
+
}
|
|
3012
|
+
}
|
|
3013
|
+
if (schema.type === "object" && schema.$ref === void 0) {
|
|
3014
|
+
if (schema.propertyNames !== void 0 && !containsRef(schema.propertyNames)) {
|
|
3015
|
+
extraMeta.propertyNames = schema.propertyNames;
|
|
3016
|
+
}
|
|
3017
|
+
for (const key of ["minProperties", "maxProperties"]) {
|
|
3018
|
+
if (schema[key] !== void 0)
|
|
3019
|
+
extraMeta[key] = schema[key];
|
|
3020
|
+
}
|
|
3021
|
+
}
|
|
3022
|
+
if (schema.type === "array" && schema.$ref === void 0) {
|
|
3023
|
+
if (schema.contains !== void 0 && !containsRef(schema.contains)) {
|
|
3024
|
+
extraMeta.contains = schema.contains;
|
|
3025
|
+
}
|
|
3026
|
+
for (const key of ["uniqueItems", "minContains", "maxContains"]) {
|
|
3027
|
+
if (schema[key] !== void 0)
|
|
3028
|
+
extraMeta[key] = schema[key];
|
|
3029
|
+
}
|
|
3030
|
+
}
|
|
3031
|
+
for (const key of Object.keys(schema)) {
|
|
3032
|
+
if (!RECOGNIZED_KEYS.has(key)) {
|
|
3033
|
+
assignProp(extraMeta, key, schema[key]);
|
|
3034
|
+
}
|
|
3035
|
+
}
|
|
3036
|
+
if (Object.keys(extraMeta).length > 0) {
|
|
3037
|
+
ctx.registry.add(baseSchema, extraMeta);
|
|
3038
|
+
}
|
|
3039
|
+
if (schema.description) {
|
|
3040
|
+
baseSchema = baseSchema.describe(schema.description);
|
|
3041
|
+
}
|
|
3042
|
+
return baseSchema;
|
|
3043
|
+
}
|
|
3044
|
+
function fromJSONSchema(schema, params) {
|
|
3045
|
+
if (typeof schema === "boolean") {
|
|
3046
|
+
return schema ? z.any() : z.never();
|
|
3047
|
+
}
|
|
3048
|
+
let normalized;
|
|
3049
|
+
try {
|
|
3050
|
+
normalized = JSON.parse(JSON.stringify(schema));
|
|
3051
|
+
} catch {
|
|
3052
|
+
throw new Error("fromJSONSchema input is not valid JSON (possibly cyclic); use $defs/$ref for recursive schemas");
|
|
3053
|
+
}
|
|
3054
|
+
const version = detectVersion(normalized, params?.defaultTarget);
|
|
3055
|
+
const defs = normalized.$defs || normalized.definitions || {};
|
|
3056
|
+
const ctx = {
|
|
3057
|
+
version,
|
|
3058
|
+
defs,
|
|
3059
|
+
refs: /* @__PURE__ */ new Map(),
|
|
3060
|
+
processing: /* @__PURE__ */ new Set(),
|
|
3061
|
+
rootSchema: normalized,
|
|
3062
|
+
registry: params?.registry ?? globalRegistry
|
|
3063
|
+
};
|
|
3064
|
+
return convertSchema(normalized, ctx);
|
|
3065
|
+
}
|
|
3066
|
+
|
|
3067
|
+
// ../../node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/visit.js
|
|
3068
|
+
var RESOLVING = /* @__PURE__ */ Symbol("z.visit/resolving");
|
|
3069
|
+
function visit(schema, fnOrHandlers) {
|
|
3070
|
+
const fn = typeof fnOrHandlers === "function" ? fnOrHandlers : (node, rewritten) => {
|
|
3071
|
+
const h = fnOrHandlers[node._zod.def.type];
|
|
3072
|
+
return h ? h(node, rewritten) : node;
|
|
3073
|
+
};
|
|
3074
|
+
const cache = /* @__PURE__ */ new Map();
|
|
3075
|
+
function run(s) {
|
|
3076
|
+
const cached = cache.get(s);
|
|
3077
|
+
if (cached === RESOLVING) {
|
|
3078
|
+
return new $ZodLazy({
|
|
3079
|
+
type: "lazy",
|
|
3080
|
+
getter: () => cache.get(s)
|
|
3081
|
+
});
|
|
3082
|
+
}
|
|
3083
|
+
if (cached !== void 0)
|
|
3084
|
+
return cached;
|
|
3085
|
+
cache.set(s, RESOLVING);
|
|
3086
|
+
const inner = mapInner(s);
|
|
3087
|
+
const mapped = fn(inner, inner !== s);
|
|
3088
|
+
cache.set(s, mapped);
|
|
3089
|
+
return mapped;
|
|
3090
|
+
}
|
|
3091
|
+
function mapInner(s) {
|
|
3092
|
+
const def = s._zod.def;
|
|
3093
|
+
const kind = def.type;
|
|
3094
|
+
switch (kind) {
|
|
3095
|
+
case "object": {
|
|
3096
|
+
const oldShape = def.shape;
|
|
3097
|
+
const keys = Object.keys(oldShape);
|
|
3098
|
+
let changed = false;
|
|
3099
|
+
const newShape = {};
|
|
3100
|
+
for (const k of keys) {
|
|
3101
|
+
const mapped = run(oldShape[k]);
|
|
3102
|
+
if (mapped !== oldShape[k])
|
|
3103
|
+
changed = true;
|
|
3104
|
+
newShape[k] = mapped;
|
|
3105
|
+
}
|
|
3106
|
+
let newCatchall = def.catchall;
|
|
3107
|
+
if (def.catchall) {
|
|
3108
|
+
newCatchall = run(def.catchall);
|
|
3109
|
+
if (newCatchall !== def.catchall)
|
|
3110
|
+
changed = true;
|
|
3111
|
+
}
|
|
3112
|
+
return changed ? clone(s, { ...def, shape: newShape, catchall: newCatchall }) : s;
|
|
3113
|
+
}
|
|
3114
|
+
case "array": {
|
|
3115
|
+
const mapped = run(def.element);
|
|
3116
|
+
return mapped === def.element ? s : clone(s, { ...def, element: mapped });
|
|
3117
|
+
}
|
|
3118
|
+
case "tuple": {
|
|
3119
|
+
const oldItems = def.items;
|
|
3120
|
+
let changed = false;
|
|
3121
|
+
const newItems = [];
|
|
3122
|
+
for (const item of oldItems) {
|
|
3123
|
+
const mapped = run(item);
|
|
3124
|
+
if (mapped !== item)
|
|
3125
|
+
changed = true;
|
|
3126
|
+
newItems.push(mapped);
|
|
3127
|
+
}
|
|
3128
|
+
let newRest = def.rest;
|
|
3129
|
+
if (def.rest) {
|
|
3130
|
+
newRest = run(def.rest);
|
|
3131
|
+
if (newRest !== def.rest)
|
|
3132
|
+
changed = true;
|
|
3133
|
+
}
|
|
3134
|
+
return changed ? clone(s, { ...def, items: newItems, rest: newRest }) : s;
|
|
3135
|
+
}
|
|
3136
|
+
case "record":
|
|
3137
|
+
case "map": {
|
|
3138
|
+
const newKey = run(def.keyType);
|
|
3139
|
+
const newVal = run(def.valueType);
|
|
3140
|
+
return newKey === def.keyType && newVal === def.valueType ? s : clone(s, { ...def, keyType: newKey, valueType: newVal });
|
|
3141
|
+
}
|
|
3142
|
+
case "set": {
|
|
3143
|
+
const newVal = run(def.valueType);
|
|
3144
|
+
return newVal === def.valueType ? s : clone(s, { ...def, valueType: newVal });
|
|
3145
|
+
}
|
|
3146
|
+
case "union": {
|
|
3147
|
+
const oldOptions = def.options;
|
|
3148
|
+
let changed = false;
|
|
3149
|
+
const newOptions = [];
|
|
3150
|
+
for (const opt of oldOptions) {
|
|
3151
|
+
const mapped = run(opt);
|
|
3152
|
+
if (mapped !== opt)
|
|
3153
|
+
changed = true;
|
|
3154
|
+
newOptions.push(mapped);
|
|
3155
|
+
}
|
|
3156
|
+
return changed ? clone(s, { ...def, options: newOptions }) : s;
|
|
3157
|
+
}
|
|
3158
|
+
case "intersection": {
|
|
3159
|
+
const newLeft = run(def.left);
|
|
3160
|
+
const newRight = run(def.right);
|
|
3161
|
+
return newLeft === def.left && newRight === def.right ? s : clone(s, { ...def, left: newLeft, right: newRight });
|
|
3162
|
+
}
|
|
3163
|
+
case "optional":
|
|
3164
|
+
case "nullable":
|
|
3165
|
+
case "default":
|
|
3166
|
+
case "prefault":
|
|
3167
|
+
case "catch":
|
|
3168
|
+
case "readonly":
|
|
3169
|
+
case "nonoptional":
|
|
3170
|
+
case "promise":
|
|
3171
|
+
case "success": {
|
|
3172
|
+
const newInner = run(def.innerType);
|
|
3173
|
+
return newInner === def.innerType ? s : clone(s, { ...def, innerType: newInner });
|
|
3174
|
+
}
|
|
3175
|
+
case "pipe": {
|
|
3176
|
+
const newIn = run(def.in);
|
|
3177
|
+
const newOut = run(def.out);
|
|
3178
|
+
return newIn === def.in && newOut === def.out ? s : clone(s, { ...def, in: newIn, out: newOut });
|
|
3179
|
+
}
|
|
3180
|
+
case "function": {
|
|
3181
|
+
const newInput = run(def.input);
|
|
3182
|
+
const newOutput = run(def.output);
|
|
3183
|
+
return newInput === def.input && newOutput === def.output ? s : clone(s, { ...def, input: newInput, output: newOutput });
|
|
3184
|
+
}
|
|
3185
|
+
case "lazy": {
|
|
3186
|
+
const original = def.getter;
|
|
3187
|
+
const { _cachedInner, ...rest } = def;
|
|
3188
|
+
return clone(s, { ...rest, getter: () => run(original()) });
|
|
3189
|
+
}
|
|
3190
|
+
// A leaf by choice: `parts` are regex fragments, not data positions.
|
|
3191
|
+
case "template_literal":
|
|
3192
|
+
// Leaves.
|
|
3193
|
+
case "string":
|
|
3194
|
+
case "number":
|
|
3195
|
+
case "int":
|
|
3196
|
+
case "boolean":
|
|
3197
|
+
case "bigint":
|
|
3198
|
+
case "symbol":
|
|
3199
|
+
case "undefined":
|
|
3200
|
+
case "null":
|
|
3201
|
+
case "void":
|
|
3202
|
+
case "never":
|
|
3203
|
+
case "any":
|
|
3204
|
+
case "unknown":
|
|
3205
|
+
case "date":
|
|
3206
|
+
case "nan":
|
|
3207
|
+
case "enum":
|
|
3208
|
+
case "literal":
|
|
3209
|
+
case "file":
|
|
3210
|
+
case "transform":
|
|
3211
|
+
case "custom":
|
|
3212
|
+
return s;
|
|
3213
|
+
default: {
|
|
3214
|
+
kind;
|
|
3215
|
+
return s;
|
|
3216
|
+
}
|
|
3217
|
+
}
|
|
3218
|
+
}
|
|
3219
|
+
return run(schema);
|
|
3220
|
+
}
|
|
3221
|
+
|
|
3222
|
+
// ../../node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/classic/deep-partial.js
|
|
3223
|
+
function deepPartial(schema) {
|
|
3224
|
+
return visit(schema, {
|
|
3225
|
+
object: (s) => s.partial(),
|
|
3226
|
+
// Every partialed option now admits `undefined`, which the constructor rejects as a duplicate.
|
|
3227
|
+
union: (s) => {
|
|
3228
|
+
const def = s._zod.def;
|
|
3229
|
+
return def.discriminator === void 0 ? s : union(def.options);
|
|
3230
|
+
}
|
|
3231
|
+
});
|
|
3232
|
+
}
|
|
3233
|
+
|
|
3234
|
+
// ../../node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/classic/in-out.js
|
|
3235
|
+
function withChecks(side, checks) {
|
|
3236
|
+
if (!checks?.length)
|
|
3237
|
+
return side;
|
|
3238
|
+
const def = side._zod.def;
|
|
3239
|
+
return clone(side, mergeDefs(def, { checks: [...def.checks ?? [], ...checks] }), { parent: true });
|
|
3240
|
+
}
|
|
3241
|
+
function outSide(def) {
|
|
3242
|
+
return withChecks(def.out, def.checks);
|
|
3243
|
+
}
|
|
3244
|
+
function inSide(def) {
|
|
3245
|
+
return def.in._zod.traits.has("$ZodTransform") ? outSide(def) : def.in;
|
|
3246
|
+
}
|
|
3247
|
+
function input(schema) {
|
|
3248
|
+
return visit(schema, {
|
|
3249
|
+
pipe: (s) => inSide(s._zod.def),
|
|
3250
|
+
// A default value belongs to the output side, so a rewritten inner type leaves it stranded. `.default()` widens the declared input type with `undefined`, and `optional` is what carries that across.
|
|
3251
|
+
default: (s, rewritten) => rewritten ? optional(s._zod.def.innerType) : s,
|
|
3252
|
+
// A catch value is output-side too, but `.catch()` leaves the declared input type alone, so the inner schema stands on its own.
|
|
3253
|
+
catch: (s, rewritten) => rewritten ? s._zod.def.innerType : s
|
|
3254
|
+
});
|
|
3255
|
+
}
|
|
3256
|
+
function output(schema) {
|
|
3257
|
+
return visit(schema, {
|
|
3258
|
+
pipe: (s) => outSide(s._zod.def),
|
|
3259
|
+
// A prefault value is fed through the schema, which makes it input-side, so a rewritten inner type leaves it stranded.
|
|
3260
|
+
prefault: (s, rewritten) => rewritten ? s._zod.def.innerType : s
|
|
3261
|
+
});
|
|
3262
|
+
}
|
|
3263
|
+
|
|
3264
|
+
// ../../node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/classic/coerce.js
|
|
3265
|
+
var coerce_exports = {};
|
|
3266
|
+
__export(coerce_exports, {
|
|
3267
|
+
bigint: () => bigint2,
|
|
3268
|
+
boolean: () => boolean2,
|
|
3269
|
+
date: () => date3,
|
|
3270
|
+
number: () => number2,
|
|
3271
|
+
string: () => string2
|
|
3272
|
+
});
|
|
3273
|
+
function string2(params) {
|
|
3274
|
+
return _coercedString(ZodString, params);
|
|
3275
|
+
}
|
|
3276
|
+
function number2(params) {
|
|
3277
|
+
return _coercedNumber(ZodNumber, params);
|
|
3278
|
+
}
|
|
3279
|
+
function boolean2(params) {
|
|
3280
|
+
return _coercedBoolean(ZodBoolean, params);
|
|
3281
|
+
}
|
|
3282
|
+
function bigint2(params) {
|
|
3283
|
+
return _coercedBigint(ZodBigInt, params);
|
|
3284
|
+
}
|
|
3285
|
+
function date3(params) {
|
|
3286
|
+
return _coercedDate(ZodDate, params);
|
|
3287
|
+
}
|
|
3288
|
+
|
|
3289
|
+
// ../../packages/contract/src/json.ts
|
|
3290
|
+
var jsonValueSchema = external_exports.json().meta({ id: "JsonValue" });
|
|
3291
|
+
var parseJson = (text) => {
|
|
3292
|
+
const value = jsonValueSchema.parse(JSON.parse(text));
|
|
3293
|
+
return value;
|
|
3294
|
+
};
|
|
3295
|
+
|
|
3296
|
+
// src/lib/types.ts
|
|
3297
|
+
var isJsonObject = (value) => Object(value) === value && !Array.isArray(value);
|
|
3298
|
+
var isJsonString = (value) => Object.prototype.toString.call(value) === "[object String]";
|
|
3299
|
+
var isJsonNumber = (value) => Number.isFinite(value);
|
|
3300
|
+
|
|
3301
|
+
export {
|
|
3302
|
+
external_exports,
|
|
3303
|
+
parseJson,
|
|
3304
|
+
isJsonObject,
|
|
3305
|
+
isJsonString,
|
|
3306
|
+
isJsonNumber
|
|
3307
|
+
};
|