@boboddy/sdk 0.1.1-alpha → 0.1.2-alpha
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.
|
@@ -11986,6 +11986,20 @@ function deriveSignalType(schema, path) {
|
|
|
11986
11986
|
}
|
|
11987
11987
|
}
|
|
11988
11988
|
function defineStep(config2) {
|
|
11989
|
+
const features = config2.features ?? [];
|
|
11990
|
+
let effectiveResult = config2.result;
|
|
11991
|
+
for (const feature of features) {
|
|
11992
|
+
effectiveResult = effectiveResult ? effectiveResult.extend(feature._resultExtension.shape) : feature._resultExtension;
|
|
11993
|
+
}
|
|
11994
|
+
let effectivePrompt = config2.prompt ?? null;
|
|
11995
|
+
for (const feature of features) {
|
|
11996
|
+
if (feature._promptAddition) {
|
|
11997
|
+
effectivePrompt = effectivePrompt ? `${effectivePrompt}
|
|
11998
|
+
|
|
11999
|
+
${feature._promptAddition}` : feature._promptAddition;
|
|
12000
|
+
}
|
|
12001
|
+
}
|
|
12002
|
+
const featureSignals = features.flatMap((f) => f._signals);
|
|
11989
12003
|
const spec = {
|
|
11990
12004
|
key: config2.key,
|
|
11991
12005
|
name: config2.name,
|
|
@@ -11993,16 +12007,25 @@ function defineStep(config2) {
|
|
|
11993
12007
|
version: config2.version ?? 1,
|
|
11994
12008
|
kind: "user_defined",
|
|
11995
12009
|
status: config2.status ?? "active",
|
|
11996
|
-
prompt:
|
|
12010
|
+
prompt: effectivePrompt,
|
|
11997
12011
|
inputSchemaJson: config2.input ? toJSONSchema(config2.input) : null,
|
|
11998
|
-
resultSchemaJson:
|
|
11999
|
-
signalExtractorDefinitions:
|
|
12000
|
-
|
|
12001
|
-
|
|
12002
|
-
|
|
12003
|
-
|
|
12004
|
-
|
|
12005
|
-
|
|
12012
|
+
resultSchemaJson: effectiveResult ? toJSONSchema(effectiveResult) : null,
|
|
12013
|
+
signalExtractorDefinitions: [
|
|
12014
|
+
...(config2.signals ?? []).map((s) => ({
|
|
12015
|
+
key: s.key ?? s.sourcePath,
|
|
12016
|
+
sourcePath: s.sourcePath,
|
|
12017
|
+
type: s.type ?? deriveSignalType(config2.result, s.sourcePath),
|
|
12018
|
+
required: s.required ?? true,
|
|
12019
|
+
availableWhenResultStatusIn: s.availableWhenResultStatusIn ?? null
|
|
12020
|
+
})),
|
|
12021
|
+
...featureSignals.map((s) => ({
|
|
12022
|
+
key: s.key,
|
|
12023
|
+
sourcePath: s.sourcePath,
|
|
12024
|
+
type: s.type,
|
|
12025
|
+
required: s.required ?? true,
|
|
12026
|
+
availableWhenResultStatusIn: s.availableWhenResultStatusIn ?? null
|
|
12027
|
+
}))
|
|
12028
|
+
],
|
|
12006
12029
|
computedSignalDefinitions: (config2.computedSignals ?? []).map((cs) => ({
|
|
12007
12030
|
key: cs.key,
|
|
12008
12031
|
type: cs.type,
|
|
@@ -13296,7 +13319,2394 @@ var buildStepDefinitionsClient = (stepDefinitions) => {
|
|
|
13296
13319
|
}
|
|
13297
13320
|
};
|
|
13298
13321
|
};
|
|
13322
|
+
// ../../../node_modules/.bun/zod@4.4.3/node_modules/zod/v4/classic/external.js
|
|
13323
|
+
var exports_external = {};
|
|
13324
|
+
__export(exports_external, {
|
|
13325
|
+
xor: () => xor,
|
|
13326
|
+
xid: () => xid2,
|
|
13327
|
+
void: () => _void2,
|
|
13328
|
+
uuidv7: () => uuidv7,
|
|
13329
|
+
uuidv6: () => uuidv6,
|
|
13330
|
+
uuidv4: () => uuidv4,
|
|
13331
|
+
uuid: () => uuid2,
|
|
13332
|
+
util: () => exports_util,
|
|
13333
|
+
url: () => url,
|
|
13334
|
+
uppercase: () => _uppercase,
|
|
13335
|
+
unknown: () => unknown,
|
|
13336
|
+
union: () => union,
|
|
13337
|
+
undefined: () => _undefined3,
|
|
13338
|
+
ulid: () => ulid2,
|
|
13339
|
+
uint64: () => uint64,
|
|
13340
|
+
uint32: () => uint32,
|
|
13341
|
+
tuple: () => tuple,
|
|
13342
|
+
trim: () => _trim,
|
|
13343
|
+
treeifyError: () => treeifyError,
|
|
13344
|
+
transform: () => transform,
|
|
13345
|
+
toUpperCase: () => _toUpperCase,
|
|
13346
|
+
toLowerCase: () => _toLowerCase,
|
|
13347
|
+
toJSONSchema: () => toJSONSchema,
|
|
13348
|
+
templateLiteral: () => templateLiteral,
|
|
13349
|
+
symbol: () => symbol,
|
|
13350
|
+
superRefine: () => superRefine,
|
|
13351
|
+
success: () => success,
|
|
13352
|
+
stringbool: () => stringbool,
|
|
13353
|
+
stringFormat: () => stringFormat,
|
|
13354
|
+
string: () => string2,
|
|
13355
|
+
strictObject: () => strictObject,
|
|
13356
|
+
startsWith: () => _startsWith,
|
|
13357
|
+
slugify: () => _slugify,
|
|
13358
|
+
size: () => _size,
|
|
13359
|
+
setErrorMap: () => setErrorMap,
|
|
13360
|
+
set: () => set,
|
|
13361
|
+
safeParseAsync: () => safeParseAsync2,
|
|
13362
|
+
safeParse: () => safeParse2,
|
|
13363
|
+
safeEncodeAsync: () => safeEncodeAsync2,
|
|
13364
|
+
safeEncode: () => safeEncode2,
|
|
13365
|
+
safeDecodeAsync: () => safeDecodeAsync2,
|
|
13366
|
+
safeDecode: () => safeDecode2,
|
|
13367
|
+
registry: () => registry,
|
|
13368
|
+
regexes: () => exports_regexes,
|
|
13369
|
+
regex: () => _regex,
|
|
13370
|
+
refine: () => refine,
|
|
13371
|
+
record: () => record,
|
|
13372
|
+
readonly: () => readonly,
|
|
13373
|
+
property: () => _property,
|
|
13374
|
+
promise: () => promise,
|
|
13375
|
+
prettifyError: () => prettifyError,
|
|
13376
|
+
preprocess: () => preprocess,
|
|
13377
|
+
prefault: () => prefault,
|
|
13378
|
+
positive: () => _positive,
|
|
13379
|
+
pipe: () => pipe,
|
|
13380
|
+
partialRecord: () => partialRecord,
|
|
13381
|
+
parseAsync: () => parseAsync2,
|
|
13382
|
+
parse: () => parse3,
|
|
13383
|
+
overwrite: () => _overwrite,
|
|
13384
|
+
optional: () => optional,
|
|
13385
|
+
object: () => object,
|
|
13386
|
+
number: () => number2,
|
|
13387
|
+
nullish: () => nullish2,
|
|
13388
|
+
nullable: () => nullable,
|
|
13389
|
+
null: () => _null3,
|
|
13390
|
+
normalize: () => _normalize,
|
|
13391
|
+
nonpositive: () => _nonpositive,
|
|
13392
|
+
nonoptional: () => nonoptional,
|
|
13393
|
+
nonnegative: () => _nonnegative,
|
|
13394
|
+
never: () => never,
|
|
13395
|
+
negative: () => _negative,
|
|
13396
|
+
nativeEnum: () => nativeEnum,
|
|
13397
|
+
nanoid: () => nanoid2,
|
|
13398
|
+
nan: () => nan,
|
|
13399
|
+
multipleOf: () => _multipleOf,
|
|
13400
|
+
minSize: () => _minSize,
|
|
13401
|
+
minLength: () => _minLength,
|
|
13402
|
+
mime: () => _mime,
|
|
13403
|
+
meta: () => meta2,
|
|
13404
|
+
maxSize: () => _maxSize,
|
|
13405
|
+
maxLength: () => _maxLength,
|
|
13406
|
+
map: () => map,
|
|
13407
|
+
mac: () => mac2,
|
|
13408
|
+
lte: () => _lte,
|
|
13409
|
+
lt: () => _lt,
|
|
13410
|
+
lowercase: () => _lowercase,
|
|
13411
|
+
looseRecord: () => looseRecord,
|
|
13412
|
+
looseObject: () => looseObject,
|
|
13413
|
+
locales: () => exports_locales,
|
|
13414
|
+
literal: () => literal,
|
|
13415
|
+
length: () => _length,
|
|
13416
|
+
lazy: () => lazy,
|
|
13417
|
+
ksuid: () => ksuid2,
|
|
13418
|
+
keyof: () => keyof,
|
|
13419
|
+
jwt: () => jwt,
|
|
13420
|
+
json: () => json,
|
|
13421
|
+
iso: () => exports_iso,
|
|
13422
|
+
ipv6: () => ipv62,
|
|
13423
|
+
ipv4: () => ipv42,
|
|
13424
|
+
invertCodec: () => invertCodec,
|
|
13425
|
+
intersection: () => intersection,
|
|
13426
|
+
int64: () => int64,
|
|
13427
|
+
int32: () => int32,
|
|
13428
|
+
int: () => int,
|
|
13429
|
+
instanceof: () => _instanceof,
|
|
13430
|
+
includes: () => _includes,
|
|
13431
|
+
httpUrl: () => httpUrl,
|
|
13432
|
+
hostname: () => hostname2,
|
|
13433
|
+
hex: () => hex2,
|
|
13434
|
+
hash: () => hash,
|
|
13435
|
+
guid: () => guid2,
|
|
13436
|
+
gte: () => _gte,
|
|
13437
|
+
gt: () => _gt,
|
|
13438
|
+
globalRegistry: () => globalRegistry,
|
|
13439
|
+
getErrorMap: () => getErrorMap,
|
|
13440
|
+
function: () => _function,
|
|
13441
|
+
fromJSONSchema: () => fromJSONSchema,
|
|
13442
|
+
formatError: () => formatError,
|
|
13443
|
+
float64: () => float64,
|
|
13444
|
+
float32: () => float32,
|
|
13445
|
+
flattenError: () => flattenError,
|
|
13446
|
+
file: () => file,
|
|
13447
|
+
exactOptional: () => exactOptional,
|
|
13448
|
+
enum: () => _enum2,
|
|
13449
|
+
endsWith: () => _endsWith,
|
|
13450
|
+
encodeAsync: () => encodeAsync2,
|
|
13451
|
+
encode: () => encode2,
|
|
13452
|
+
emoji: () => emoji2,
|
|
13453
|
+
email: () => email2,
|
|
13454
|
+
e164: () => e1642,
|
|
13455
|
+
discriminatedUnion: () => discriminatedUnion,
|
|
13456
|
+
describe: () => describe2,
|
|
13457
|
+
decodeAsync: () => decodeAsync2,
|
|
13458
|
+
decode: () => decode2,
|
|
13459
|
+
date: () => date3,
|
|
13460
|
+
custom: () => custom,
|
|
13461
|
+
cuid2: () => cuid22,
|
|
13462
|
+
cuid: () => cuid3,
|
|
13463
|
+
core: () => exports_core2,
|
|
13464
|
+
config: () => config,
|
|
13465
|
+
coerce: () => exports_coerce,
|
|
13466
|
+
codec: () => codec,
|
|
13467
|
+
clone: () => clone,
|
|
13468
|
+
cidrv6: () => cidrv62,
|
|
13469
|
+
cidrv4: () => cidrv42,
|
|
13470
|
+
check: () => check,
|
|
13471
|
+
catch: () => _catch2,
|
|
13472
|
+
boolean: () => boolean2,
|
|
13473
|
+
bigint: () => bigint2,
|
|
13474
|
+
base64url: () => base64url2,
|
|
13475
|
+
base64: () => base642,
|
|
13476
|
+
array: () => array,
|
|
13477
|
+
any: () => any,
|
|
13478
|
+
_function: () => _function,
|
|
13479
|
+
_default: () => _default2,
|
|
13480
|
+
_ZodString: () => _ZodString,
|
|
13481
|
+
ZodXor: () => ZodXor,
|
|
13482
|
+
ZodXID: () => ZodXID,
|
|
13483
|
+
ZodVoid: () => ZodVoid,
|
|
13484
|
+
ZodUnknown: () => ZodUnknown,
|
|
13485
|
+
ZodUnion: () => ZodUnion,
|
|
13486
|
+
ZodUndefined: () => ZodUndefined,
|
|
13487
|
+
ZodUUID: () => ZodUUID,
|
|
13488
|
+
ZodURL: () => ZodURL,
|
|
13489
|
+
ZodULID: () => ZodULID,
|
|
13490
|
+
ZodType: () => ZodType,
|
|
13491
|
+
ZodTuple: () => ZodTuple,
|
|
13492
|
+
ZodTransform: () => ZodTransform,
|
|
13493
|
+
ZodTemplateLiteral: () => ZodTemplateLiteral,
|
|
13494
|
+
ZodSymbol: () => ZodSymbol,
|
|
13495
|
+
ZodSuccess: () => ZodSuccess,
|
|
13496
|
+
ZodStringFormat: () => ZodStringFormat,
|
|
13497
|
+
ZodString: () => ZodString,
|
|
13498
|
+
ZodSet: () => ZodSet,
|
|
13499
|
+
ZodRecord: () => ZodRecord,
|
|
13500
|
+
ZodRealError: () => ZodRealError,
|
|
13501
|
+
ZodReadonly: () => ZodReadonly,
|
|
13502
|
+
ZodPromise: () => ZodPromise,
|
|
13503
|
+
ZodPreprocess: () => ZodPreprocess,
|
|
13504
|
+
ZodPrefault: () => ZodPrefault,
|
|
13505
|
+
ZodPipe: () => ZodPipe,
|
|
13506
|
+
ZodOptional: () => ZodOptional,
|
|
13507
|
+
ZodObject: () => ZodObject,
|
|
13508
|
+
ZodNumberFormat: () => ZodNumberFormat,
|
|
13509
|
+
ZodNumber: () => ZodNumber,
|
|
13510
|
+
ZodNullable: () => ZodNullable,
|
|
13511
|
+
ZodNull: () => ZodNull,
|
|
13512
|
+
ZodNonOptional: () => ZodNonOptional,
|
|
13513
|
+
ZodNever: () => ZodNever,
|
|
13514
|
+
ZodNanoID: () => ZodNanoID,
|
|
13515
|
+
ZodNaN: () => ZodNaN,
|
|
13516
|
+
ZodMap: () => ZodMap,
|
|
13517
|
+
ZodMAC: () => ZodMAC,
|
|
13518
|
+
ZodLiteral: () => ZodLiteral,
|
|
13519
|
+
ZodLazy: () => ZodLazy,
|
|
13520
|
+
ZodKSUID: () => ZodKSUID,
|
|
13521
|
+
ZodJWT: () => ZodJWT,
|
|
13522
|
+
ZodIssueCode: () => ZodIssueCode,
|
|
13523
|
+
ZodIntersection: () => ZodIntersection,
|
|
13524
|
+
ZodISOTime: () => ZodISOTime,
|
|
13525
|
+
ZodISODuration: () => ZodISODuration,
|
|
13526
|
+
ZodISODateTime: () => ZodISODateTime,
|
|
13527
|
+
ZodISODate: () => ZodISODate,
|
|
13528
|
+
ZodIPv6: () => ZodIPv6,
|
|
13529
|
+
ZodIPv4: () => ZodIPv4,
|
|
13530
|
+
ZodGUID: () => ZodGUID,
|
|
13531
|
+
ZodFunction: () => ZodFunction,
|
|
13532
|
+
ZodFirstPartyTypeKind: () => ZodFirstPartyTypeKind,
|
|
13533
|
+
ZodFile: () => ZodFile,
|
|
13534
|
+
ZodExactOptional: () => ZodExactOptional,
|
|
13535
|
+
ZodError: () => ZodError,
|
|
13536
|
+
ZodEnum: () => ZodEnum,
|
|
13537
|
+
ZodEmoji: () => ZodEmoji,
|
|
13538
|
+
ZodEmail: () => ZodEmail,
|
|
13539
|
+
ZodE164: () => ZodE164,
|
|
13540
|
+
ZodDiscriminatedUnion: () => ZodDiscriminatedUnion,
|
|
13541
|
+
ZodDefault: () => ZodDefault,
|
|
13542
|
+
ZodDate: () => ZodDate,
|
|
13543
|
+
ZodCustomStringFormat: () => ZodCustomStringFormat,
|
|
13544
|
+
ZodCustom: () => ZodCustom,
|
|
13545
|
+
ZodCodec: () => ZodCodec,
|
|
13546
|
+
ZodCatch: () => ZodCatch,
|
|
13547
|
+
ZodCUID2: () => ZodCUID2,
|
|
13548
|
+
ZodCUID: () => ZodCUID,
|
|
13549
|
+
ZodCIDRv6: () => ZodCIDRv6,
|
|
13550
|
+
ZodCIDRv4: () => ZodCIDRv4,
|
|
13551
|
+
ZodBoolean: () => ZodBoolean,
|
|
13552
|
+
ZodBigIntFormat: () => ZodBigIntFormat,
|
|
13553
|
+
ZodBigInt: () => ZodBigInt,
|
|
13554
|
+
ZodBase64URL: () => ZodBase64URL,
|
|
13555
|
+
ZodBase64: () => ZodBase64,
|
|
13556
|
+
ZodArray: () => ZodArray,
|
|
13557
|
+
ZodAny: () => ZodAny,
|
|
13558
|
+
TimePrecision: () => TimePrecision,
|
|
13559
|
+
NEVER: () => NEVER,
|
|
13560
|
+
$output: () => $output,
|
|
13561
|
+
$input: () => $input,
|
|
13562
|
+
$brand: () => $brand
|
|
13563
|
+
});
|
|
13564
|
+
|
|
13565
|
+
// ../../../node_modules/.bun/zod@4.4.3/node_modules/zod/v4/classic/schemas.js
|
|
13566
|
+
var exports_schemas2 = {};
|
|
13567
|
+
__export(exports_schemas2, {
|
|
13568
|
+
xor: () => xor,
|
|
13569
|
+
xid: () => xid2,
|
|
13570
|
+
void: () => _void2,
|
|
13571
|
+
uuidv7: () => uuidv7,
|
|
13572
|
+
uuidv6: () => uuidv6,
|
|
13573
|
+
uuidv4: () => uuidv4,
|
|
13574
|
+
uuid: () => uuid2,
|
|
13575
|
+
url: () => url,
|
|
13576
|
+
unknown: () => unknown,
|
|
13577
|
+
union: () => union,
|
|
13578
|
+
undefined: () => _undefined3,
|
|
13579
|
+
ulid: () => ulid2,
|
|
13580
|
+
uint64: () => uint64,
|
|
13581
|
+
uint32: () => uint32,
|
|
13582
|
+
tuple: () => tuple,
|
|
13583
|
+
transform: () => transform,
|
|
13584
|
+
templateLiteral: () => templateLiteral,
|
|
13585
|
+
symbol: () => symbol,
|
|
13586
|
+
superRefine: () => superRefine,
|
|
13587
|
+
success: () => success,
|
|
13588
|
+
stringbool: () => stringbool,
|
|
13589
|
+
stringFormat: () => stringFormat,
|
|
13590
|
+
string: () => string2,
|
|
13591
|
+
strictObject: () => strictObject,
|
|
13592
|
+
set: () => set,
|
|
13593
|
+
refine: () => refine,
|
|
13594
|
+
record: () => record,
|
|
13595
|
+
readonly: () => readonly,
|
|
13596
|
+
promise: () => promise,
|
|
13597
|
+
preprocess: () => preprocess,
|
|
13598
|
+
prefault: () => prefault,
|
|
13599
|
+
pipe: () => pipe,
|
|
13600
|
+
partialRecord: () => partialRecord,
|
|
13601
|
+
optional: () => optional,
|
|
13602
|
+
object: () => object,
|
|
13603
|
+
number: () => number2,
|
|
13604
|
+
nullish: () => nullish2,
|
|
13605
|
+
nullable: () => nullable,
|
|
13606
|
+
null: () => _null3,
|
|
13607
|
+
nonoptional: () => nonoptional,
|
|
13608
|
+
never: () => never,
|
|
13609
|
+
nativeEnum: () => nativeEnum,
|
|
13610
|
+
nanoid: () => nanoid2,
|
|
13611
|
+
nan: () => nan,
|
|
13612
|
+
meta: () => meta2,
|
|
13613
|
+
map: () => map,
|
|
13614
|
+
mac: () => mac2,
|
|
13615
|
+
looseRecord: () => looseRecord,
|
|
13616
|
+
looseObject: () => looseObject,
|
|
13617
|
+
literal: () => literal,
|
|
13618
|
+
lazy: () => lazy,
|
|
13619
|
+
ksuid: () => ksuid2,
|
|
13620
|
+
keyof: () => keyof,
|
|
13621
|
+
jwt: () => jwt,
|
|
13622
|
+
json: () => json,
|
|
13623
|
+
ipv6: () => ipv62,
|
|
13624
|
+
ipv4: () => ipv42,
|
|
13625
|
+
invertCodec: () => invertCodec,
|
|
13626
|
+
intersection: () => intersection,
|
|
13627
|
+
int64: () => int64,
|
|
13628
|
+
int32: () => int32,
|
|
13629
|
+
int: () => int,
|
|
13630
|
+
instanceof: () => _instanceof,
|
|
13631
|
+
httpUrl: () => httpUrl,
|
|
13632
|
+
hostname: () => hostname2,
|
|
13633
|
+
hex: () => hex2,
|
|
13634
|
+
hash: () => hash,
|
|
13635
|
+
guid: () => guid2,
|
|
13636
|
+
function: () => _function,
|
|
13637
|
+
float64: () => float64,
|
|
13638
|
+
float32: () => float32,
|
|
13639
|
+
file: () => file,
|
|
13640
|
+
exactOptional: () => exactOptional,
|
|
13641
|
+
enum: () => _enum2,
|
|
13642
|
+
emoji: () => emoji2,
|
|
13643
|
+
email: () => email2,
|
|
13644
|
+
e164: () => e1642,
|
|
13645
|
+
discriminatedUnion: () => discriminatedUnion,
|
|
13646
|
+
describe: () => describe2,
|
|
13647
|
+
date: () => date3,
|
|
13648
|
+
custom: () => custom,
|
|
13649
|
+
cuid2: () => cuid22,
|
|
13650
|
+
cuid: () => cuid3,
|
|
13651
|
+
codec: () => codec,
|
|
13652
|
+
cidrv6: () => cidrv62,
|
|
13653
|
+
cidrv4: () => cidrv42,
|
|
13654
|
+
check: () => check,
|
|
13655
|
+
catch: () => _catch2,
|
|
13656
|
+
boolean: () => boolean2,
|
|
13657
|
+
bigint: () => bigint2,
|
|
13658
|
+
base64url: () => base64url2,
|
|
13659
|
+
base64: () => base642,
|
|
13660
|
+
array: () => array,
|
|
13661
|
+
any: () => any,
|
|
13662
|
+
_function: () => _function,
|
|
13663
|
+
_default: () => _default2,
|
|
13664
|
+
_ZodString: () => _ZodString,
|
|
13665
|
+
ZodXor: () => ZodXor,
|
|
13666
|
+
ZodXID: () => ZodXID,
|
|
13667
|
+
ZodVoid: () => ZodVoid,
|
|
13668
|
+
ZodUnknown: () => ZodUnknown,
|
|
13669
|
+
ZodUnion: () => ZodUnion,
|
|
13670
|
+
ZodUndefined: () => ZodUndefined,
|
|
13671
|
+
ZodUUID: () => ZodUUID,
|
|
13672
|
+
ZodURL: () => ZodURL,
|
|
13673
|
+
ZodULID: () => ZodULID,
|
|
13674
|
+
ZodType: () => ZodType,
|
|
13675
|
+
ZodTuple: () => ZodTuple,
|
|
13676
|
+
ZodTransform: () => ZodTransform,
|
|
13677
|
+
ZodTemplateLiteral: () => ZodTemplateLiteral,
|
|
13678
|
+
ZodSymbol: () => ZodSymbol,
|
|
13679
|
+
ZodSuccess: () => ZodSuccess,
|
|
13680
|
+
ZodStringFormat: () => ZodStringFormat,
|
|
13681
|
+
ZodString: () => ZodString,
|
|
13682
|
+
ZodSet: () => ZodSet,
|
|
13683
|
+
ZodRecord: () => ZodRecord,
|
|
13684
|
+
ZodReadonly: () => ZodReadonly,
|
|
13685
|
+
ZodPromise: () => ZodPromise,
|
|
13686
|
+
ZodPreprocess: () => ZodPreprocess,
|
|
13687
|
+
ZodPrefault: () => ZodPrefault,
|
|
13688
|
+
ZodPipe: () => ZodPipe,
|
|
13689
|
+
ZodOptional: () => ZodOptional,
|
|
13690
|
+
ZodObject: () => ZodObject,
|
|
13691
|
+
ZodNumberFormat: () => ZodNumberFormat,
|
|
13692
|
+
ZodNumber: () => ZodNumber,
|
|
13693
|
+
ZodNullable: () => ZodNullable,
|
|
13694
|
+
ZodNull: () => ZodNull,
|
|
13695
|
+
ZodNonOptional: () => ZodNonOptional,
|
|
13696
|
+
ZodNever: () => ZodNever,
|
|
13697
|
+
ZodNanoID: () => ZodNanoID,
|
|
13698
|
+
ZodNaN: () => ZodNaN,
|
|
13699
|
+
ZodMap: () => ZodMap,
|
|
13700
|
+
ZodMAC: () => ZodMAC,
|
|
13701
|
+
ZodLiteral: () => ZodLiteral,
|
|
13702
|
+
ZodLazy: () => ZodLazy,
|
|
13703
|
+
ZodKSUID: () => ZodKSUID,
|
|
13704
|
+
ZodJWT: () => ZodJWT,
|
|
13705
|
+
ZodIntersection: () => ZodIntersection,
|
|
13706
|
+
ZodIPv6: () => ZodIPv6,
|
|
13707
|
+
ZodIPv4: () => ZodIPv4,
|
|
13708
|
+
ZodGUID: () => ZodGUID,
|
|
13709
|
+
ZodFunction: () => ZodFunction,
|
|
13710
|
+
ZodFile: () => ZodFile,
|
|
13711
|
+
ZodExactOptional: () => ZodExactOptional,
|
|
13712
|
+
ZodEnum: () => ZodEnum,
|
|
13713
|
+
ZodEmoji: () => ZodEmoji,
|
|
13714
|
+
ZodEmail: () => ZodEmail,
|
|
13715
|
+
ZodE164: () => ZodE164,
|
|
13716
|
+
ZodDiscriminatedUnion: () => ZodDiscriminatedUnion,
|
|
13717
|
+
ZodDefault: () => ZodDefault,
|
|
13718
|
+
ZodDate: () => ZodDate,
|
|
13719
|
+
ZodCustomStringFormat: () => ZodCustomStringFormat,
|
|
13720
|
+
ZodCustom: () => ZodCustom,
|
|
13721
|
+
ZodCodec: () => ZodCodec,
|
|
13722
|
+
ZodCatch: () => ZodCatch,
|
|
13723
|
+
ZodCUID2: () => ZodCUID2,
|
|
13724
|
+
ZodCUID: () => ZodCUID,
|
|
13725
|
+
ZodCIDRv6: () => ZodCIDRv6,
|
|
13726
|
+
ZodCIDRv4: () => ZodCIDRv4,
|
|
13727
|
+
ZodBoolean: () => ZodBoolean,
|
|
13728
|
+
ZodBigIntFormat: () => ZodBigIntFormat,
|
|
13729
|
+
ZodBigInt: () => ZodBigInt,
|
|
13730
|
+
ZodBase64URL: () => ZodBase64URL,
|
|
13731
|
+
ZodBase64: () => ZodBase64,
|
|
13732
|
+
ZodArray: () => ZodArray,
|
|
13733
|
+
ZodAny: () => ZodAny
|
|
13734
|
+
});
|
|
13735
|
+
|
|
13736
|
+
// ../../../node_modules/.bun/zod@4.4.3/node_modules/zod/v4/classic/checks.js
|
|
13737
|
+
var exports_checks2 = {};
|
|
13738
|
+
__export(exports_checks2, {
|
|
13739
|
+
uppercase: () => _uppercase,
|
|
13740
|
+
trim: () => _trim,
|
|
13741
|
+
toUpperCase: () => _toUpperCase,
|
|
13742
|
+
toLowerCase: () => _toLowerCase,
|
|
13743
|
+
startsWith: () => _startsWith,
|
|
13744
|
+
slugify: () => _slugify,
|
|
13745
|
+
size: () => _size,
|
|
13746
|
+
regex: () => _regex,
|
|
13747
|
+
property: () => _property,
|
|
13748
|
+
positive: () => _positive,
|
|
13749
|
+
overwrite: () => _overwrite,
|
|
13750
|
+
normalize: () => _normalize,
|
|
13751
|
+
nonpositive: () => _nonpositive,
|
|
13752
|
+
nonnegative: () => _nonnegative,
|
|
13753
|
+
negative: () => _negative,
|
|
13754
|
+
multipleOf: () => _multipleOf,
|
|
13755
|
+
minSize: () => _minSize,
|
|
13756
|
+
minLength: () => _minLength,
|
|
13757
|
+
mime: () => _mime,
|
|
13758
|
+
maxSize: () => _maxSize,
|
|
13759
|
+
maxLength: () => _maxLength,
|
|
13760
|
+
lte: () => _lte,
|
|
13761
|
+
lt: () => _lt,
|
|
13762
|
+
lowercase: () => _lowercase,
|
|
13763
|
+
length: () => _length,
|
|
13764
|
+
includes: () => _includes,
|
|
13765
|
+
gte: () => _gte,
|
|
13766
|
+
gt: () => _gt,
|
|
13767
|
+
endsWith: () => _endsWith
|
|
13768
|
+
});
|
|
13769
|
+
|
|
13770
|
+
// ../../../node_modules/.bun/zod@4.4.3/node_modules/zod/v4/classic/iso.js
|
|
13771
|
+
var exports_iso = {};
|
|
13772
|
+
__export(exports_iso, {
|
|
13773
|
+
time: () => time2,
|
|
13774
|
+
duration: () => duration2,
|
|
13775
|
+
datetime: () => datetime2,
|
|
13776
|
+
date: () => date2,
|
|
13777
|
+
ZodISOTime: () => ZodISOTime,
|
|
13778
|
+
ZodISODuration: () => ZodISODuration,
|
|
13779
|
+
ZodISODateTime: () => ZodISODateTime,
|
|
13780
|
+
ZodISODate: () => ZodISODate
|
|
13781
|
+
});
|
|
13782
|
+
var ZodISODateTime = /* @__PURE__ */ $constructor("ZodISODateTime", (inst, def) => {
|
|
13783
|
+
$ZodISODateTime.init(inst, def);
|
|
13784
|
+
ZodStringFormat.init(inst, def);
|
|
13785
|
+
});
|
|
13786
|
+
function datetime2(params) {
|
|
13787
|
+
return _isoDateTime(ZodISODateTime, params);
|
|
13788
|
+
}
|
|
13789
|
+
var ZodISODate = /* @__PURE__ */ $constructor("ZodISODate", (inst, def) => {
|
|
13790
|
+
$ZodISODate.init(inst, def);
|
|
13791
|
+
ZodStringFormat.init(inst, def);
|
|
13792
|
+
});
|
|
13793
|
+
function date2(params) {
|
|
13794
|
+
return _isoDate(ZodISODate, params);
|
|
13795
|
+
}
|
|
13796
|
+
var ZodISOTime = /* @__PURE__ */ $constructor("ZodISOTime", (inst, def) => {
|
|
13797
|
+
$ZodISOTime.init(inst, def);
|
|
13798
|
+
ZodStringFormat.init(inst, def);
|
|
13799
|
+
});
|
|
13800
|
+
function time2(params) {
|
|
13801
|
+
return _isoTime(ZodISOTime, params);
|
|
13802
|
+
}
|
|
13803
|
+
var ZodISODuration = /* @__PURE__ */ $constructor("ZodISODuration", (inst, def) => {
|
|
13804
|
+
$ZodISODuration.init(inst, def);
|
|
13805
|
+
ZodStringFormat.init(inst, def);
|
|
13806
|
+
});
|
|
13807
|
+
function duration2(params) {
|
|
13808
|
+
return _isoDuration(ZodISODuration, params);
|
|
13809
|
+
}
|
|
13810
|
+
|
|
13811
|
+
// ../../../node_modules/.bun/zod@4.4.3/node_modules/zod/v4/classic/errors.js
|
|
13812
|
+
var initializer2 = (inst, issues) => {
|
|
13813
|
+
$ZodError.init(inst, issues);
|
|
13814
|
+
inst.name = "ZodError";
|
|
13815
|
+
Object.defineProperties(inst, {
|
|
13816
|
+
format: {
|
|
13817
|
+
value: (mapper) => formatError(inst, mapper)
|
|
13818
|
+
},
|
|
13819
|
+
flatten: {
|
|
13820
|
+
value: (mapper) => flattenError(inst, mapper)
|
|
13821
|
+
},
|
|
13822
|
+
addIssue: {
|
|
13823
|
+
value: (issue2) => {
|
|
13824
|
+
inst.issues.push(issue2);
|
|
13825
|
+
inst.message = JSON.stringify(inst.issues, jsonStringifyReplacer, 2);
|
|
13826
|
+
}
|
|
13827
|
+
},
|
|
13828
|
+
addIssues: {
|
|
13829
|
+
value: (issues2) => {
|
|
13830
|
+
inst.issues.push(...issues2);
|
|
13831
|
+
inst.message = JSON.stringify(inst.issues, jsonStringifyReplacer, 2);
|
|
13832
|
+
}
|
|
13833
|
+
},
|
|
13834
|
+
isEmpty: {
|
|
13835
|
+
get() {
|
|
13836
|
+
return inst.issues.length === 0;
|
|
13837
|
+
}
|
|
13838
|
+
}
|
|
13839
|
+
});
|
|
13840
|
+
};
|
|
13841
|
+
var ZodError = /* @__PURE__ */ $constructor("ZodError", initializer2);
|
|
13842
|
+
var ZodRealError = /* @__PURE__ */ $constructor("ZodError", initializer2, {
|
|
13843
|
+
Parent: Error
|
|
13844
|
+
});
|
|
13845
|
+
|
|
13846
|
+
// ../../../node_modules/.bun/zod@4.4.3/node_modules/zod/v4/classic/parse.js
|
|
13847
|
+
var parse3 = /* @__PURE__ */ _parse(ZodRealError);
|
|
13848
|
+
var parseAsync2 = /* @__PURE__ */ _parseAsync(ZodRealError);
|
|
13849
|
+
var safeParse2 = /* @__PURE__ */ _safeParse(ZodRealError);
|
|
13850
|
+
var safeParseAsync2 = /* @__PURE__ */ _safeParseAsync(ZodRealError);
|
|
13851
|
+
var encode2 = /* @__PURE__ */ _encode(ZodRealError);
|
|
13852
|
+
var decode2 = /* @__PURE__ */ _decode(ZodRealError);
|
|
13853
|
+
var encodeAsync2 = /* @__PURE__ */ _encodeAsync(ZodRealError);
|
|
13854
|
+
var decodeAsync2 = /* @__PURE__ */ _decodeAsync(ZodRealError);
|
|
13855
|
+
var safeEncode2 = /* @__PURE__ */ _safeEncode(ZodRealError);
|
|
13856
|
+
var safeDecode2 = /* @__PURE__ */ _safeDecode(ZodRealError);
|
|
13857
|
+
var safeEncodeAsync2 = /* @__PURE__ */ _safeEncodeAsync(ZodRealError);
|
|
13858
|
+
var safeDecodeAsync2 = /* @__PURE__ */ _safeDecodeAsync(ZodRealError);
|
|
13859
|
+
|
|
13860
|
+
// ../../../node_modules/.bun/zod@4.4.3/node_modules/zod/v4/classic/schemas.js
|
|
13861
|
+
var _installedGroups = /* @__PURE__ */ new WeakMap;
|
|
13862
|
+
function _installLazyMethods(inst, group, methods) {
|
|
13863
|
+
const proto = Object.getPrototypeOf(inst);
|
|
13864
|
+
let installed = _installedGroups.get(proto);
|
|
13865
|
+
if (!installed) {
|
|
13866
|
+
installed = new Set;
|
|
13867
|
+
_installedGroups.set(proto, installed);
|
|
13868
|
+
}
|
|
13869
|
+
if (installed.has(group))
|
|
13870
|
+
return;
|
|
13871
|
+
installed.add(group);
|
|
13872
|
+
for (const key in methods) {
|
|
13873
|
+
const fn = methods[key];
|
|
13874
|
+
Object.defineProperty(proto, key, {
|
|
13875
|
+
configurable: true,
|
|
13876
|
+
enumerable: false,
|
|
13877
|
+
get() {
|
|
13878
|
+
const bound = fn.bind(this);
|
|
13879
|
+
Object.defineProperty(this, key, {
|
|
13880
|
+
configurable: true,
|
|
13881
|
+
writable: true,
|
|
13882
|
+
enumerable: true,
|
|
13883
|
+
value: bound
|
|
13884
|
+
});
|
|
13885
|
+
return bound;
|
|
13886
|
+
},
|
|
13887
|
+
set(v) {
|
|
13888
|
+
Object.defineProperty(this, key, {
|
|
13889
|
+
configurable: true,
|
|
13890
|
+
writable: true,
|
|
13891
|
+
enumerable: true,
|
|
13892
|
+
value: v
|
|
13893
|
+
});
|
|
13894
|
+
}
|
|
13895
|
+
});
|
|
13896
|
+
}
|
|
13897
|
+
}
|
|
13898
|
+
var ZodType = /* @__PURE__ */ $constructor("ZodType", (inst, def) => {
|
|
13899
|
+
$ZodType.init(inst, def);
|
|
13900
|
+
Object.assign(inst["~standard"], {
|
|
13901
|
+
jsonSchema: {
|
|
13902
|
+
input: createStandardJSONSchemaMethod(inst, "input"),
|
|
13903
|
+
output: createStandardJSONSchemaMethod(inst, "output")
|
|
13904
|
+
}
|
|
13905
|
+
});
|
|
13906
|
+
inst.toJSONSchema = createToJSONSchemaMethod(inst, {});
|
|
13907
|
+
inst.def = def;
|
|
13908
|
+
inst.type = def.type;
|
|
13909
|
+
Object.defineProperty(inst, "_def", { value: def });
|
|
13910
|
+
inst.parse = (data, params) => parse3(inst, data, params, { callee: inst.parse });
|
|
13911
|
+
inst.safeParse = (data, params) => safeParse2(inst, data, params);
|
|
13912
|
+
inst.parseAsync = async (data, params) => parseAsync2(inst, data, params, { callee: inst.parseAsync });
|
|
13913
|
+
inst.safeParseAsync = async (data, params) => safeParseAsync2(inst, data, params);
|
|
13914
|
+
inst.spa = inst.safeParseAsync;
|
|
13915
|
+
inst.encode = (data, params) => encode2(inst, data, params);
|
|
13916
|
+
inst.decode = (data, params) => decode2(inst, data, params);
|
|
13917
|
+
inst.encodeAsync = async (data, params) => encodeAsync2(inst, data, params);
|
|
13918
|
+
inst.decodeAsync = async (data, params) => decodeAsync2(inst, data, params);
|
|
13919
|
+
inst.safeEncode = (data, params) => safeEncode2(inst, data, params);
|
|
13920
|
+
inst.safeDecode = (data, params) => safeDecode2(inst, data, params);
|
|
13921
|
+
inst.safeEncodeAsync = async (data, params) => safeEncodeAsync2(inst, data, params);
|
|
13922
|
+
inst.safeDecodeAsync = async (data, params) => safeDecodeAsync2(inst, data, params);
|
|
13923
|
+
_installLazyMethods(inst, "ZodType", {
|
|
13924
|
+
check(...chks) {
|
|
13925
|
+
const def2 = this.def;
|
|
13926
|
+
return this.clone(exports_util.mergeDefs(def2, {
|
|
13927
|
+
checks: [
|
|
13928
|
+
...def2.checks ?? [],
|
|
13929
|
+
...chks.map((ch) => typeof ch === "function" ? { _zod: { check: ch, def: { check: "custom" }, onattach: [] } } : ch)
|
|
13930
|
+
]
|
|
13931
|
+
}), { parent: true });
|
|
13932
|
+
},
|
|
13933
|
+
with(...chks) {
|
|
13934
|
+
return this.check(...chks);
|
|
13935
|
+
},
|
|
13936
|
+
clone(def2, params) {
|
|
13937
|
+
return clone(this, def2, params);
|
|
13938
|
+
},
|
|
13939
|
+
brand() {
|
|
13940
|
+
return this;
|
|
13941
|
+
},
|
|
13942
|
+
register(reg, meta2) {
|
|
13943
|
+
reg.add(this, meta2);
|
|
13944
|
+
return this;
|
|
13945
|
+
},
|
|
13946
|
+
refine(check, params) {
|
|
13947
|
+
return this.check(refine(check, params));
|
|
13948
|
+
},
|
|
13949
|
+
superRefine(refinement, params) {
|
|
13950
|
+
return this.check(superRefine(refinement, params));
|
|
13951
|
+
},
|
|
13952
|
+
overwrite(fn) {
|
|
13953
|
+
return this.check(_overwrite(fn));
|
|
13954
|
+
},
|
|
13955
|
+
optional() {
|
|
13956
|
+
return optional(this);
|
|
13957
|
+
},
|
|
13958
|
+
exactOptional() {
|
|
13959
|
+
return exactOptional(this);
|
|
13960
|
+
},
|
|
13961
|
+
nullable() {
|
|
13962
|
+
return nullable(this);
|
|
13963
|
+
},
|
|
13964
|
+
nullish() {
|
|
13965
|
+
return optional(nullable(this));
|
|
13966
|
+
},
|
|
13967
|
+
nonoptional(params) {
|
|
13968
|
+
return nonoptional(this, params);
|
|
13969
|
+
},
|
|
13970
|
+
array() {
|
|
13971
|
+
return array(this);
|
|
13972
|
+
},
|
|
13973
|
+
or(arg) {
|
|
13974
|
+
return union([this, arg]);
|
|
13975
|
+
},
|
|
13976
|
+
and(arg) {
|
|
13977
|
+
return intersection(this, arg);
|
|
13978
|
+
},
|
|
13979
|
+
transform(tx) {
|
|
13980
|
+
return pipe(this, transform(tx));
|
|
13981
|
+
},
|
|
13982
|
+
default(d) {
|
|
13983
|
+
return _default2(this, d);
|
|
13984
|
+
},
|
|
13985
|
+
prefault(d) {
|
|
13986
|
+
return prefault(this, d);
|
|
13987
|
+
},
|
|
13988
|
+
catch(params) {
|
|
13989
|
+
return _catch2(this, params);
|
|
13990
|
+
},
|
|
13991
|
+
pipe(target) {
|
|
13992
|
+
return pipe(this, target);
|
|
13993
|
+
},
|
|
13994
|
+
readonly() {
|
|
13995
|
+
return readonly(this);
|
|
13996
|
+
},
|
|
13997
|
+
describe(description) {
|
|
13998
|
+
const cl = this.clone();
|
|
13999
|
+
globalRegistry.add(cl, { description });
|
|
14000
|
+
return cl;
|
|
14001
|
+
},
|
|
14002
|
+
meta(...args) {
|
|
14003
|
+
if (args.length === 0)
|
|
14004
|
+
return globalRegistry.get(this);
|
|
14005
|
+
const cl = this.clone();
|
|
14006
|
+
globalRegistry.add(cl, args[0]);
|
|
14007
|
+
return cl;
|
|
14008
|
+
},
|
|
14009
|
+
isOptional() {
|
|
14010
|
+
return this.safeParse(undefined).success;
|
|
14011
|
+
},
|
|
14012
|
+
isNullable() {
|
|
14013
|
+
return this.safeParse(null).success;
|
|
14014
|
+
},
|
|
14015
|
+
apply(fn) {
|
|
14016
|
+
return fn(this);
|
|
14017
|
+
}
|
|
14018
|
+
});
|
|
14019
|
+
Object.defineProperty(inst, "description", {
|
|
14020
|
+
get() {
|
|
14021
|
+
return globalRegistry.get(inst)?.description;
|
|
14022
|
+
},
|
|
14023
|
+
configurable: true
|
|
14024
|
+
});
|
|
14025
|
+
return inst;
|
|
14026
|
+
});
|
|
14027
|
+
var _ZodString = /* @__PURE__ */ $constructor("_ZodString", (inst, def) => {
|
|
14028
|
+
$ZodString.init(inst, def);
|
|
14029
|
+
ZodType.init(inst, def);
|
|
14030
|
+
inst._zod.processJSONSchema = (ctx, json, params) => stringProcessor(inst, ctx, json, params);
|
|
14031
|
+
const bag = inst._zod.bag;
|
|
14032
|
+
inst.format = bag.format ?? null;
|
|
14033
|
+
inst.minLength = bag.minimum ?? null;
|
|
14034
|
+
inst.maxLength = bag.maximum ?? null;
|
|
14035
|
+
_installLazyMethods(inst, "_ZodString", {
|
|
14036
|
+
regex(...args) {
|
|
14037
|
+
return this.check(_regex(...args));
|
|
14038
|
+
},
|
|
14039
|
+
includes(...args) {
|
|
14040
|
+
return this.check(_includes(...args));
|
|
14041
|
+
},
|
|
14042
|
+
startsWith(...args) {
|
|
14043
|
+
return this.check(_startsWith(...args));
|
|
14044
|
+
},
|
|
14045
|
+
endsWith(...args) {
|
|
14046
|
+
return this.check(_endsWith(...args));
|
|
14047
|
+
},
|
|
14048
|
+
min(...args) {
|
|
14049
|
+
return this.check(_minLength(...args));
|
|
14050
|
+
},
|
|
14051
|
+
max(...args) {
|
|
14052
|
+
return this.check(_maxLength(...args));
|
|
14053
|
+
},
|
|
14054
|
+
length(...args) {
|
|
14055
|
+
return this.check(_length(...args));
|
|
14056
|
+
},
|
|
14057
|
+
nonempty(...args) {
|
|
14058
|
+
return this.check(_minLength(1, ...args));
|
|
14059
|
+
},
|
|
14060
|
+
lowercase(params) {
|
|
14061
|
+
return this.check(_lowercase(params));
|
|
14062
|
+
},
|
|
14063
|
+
uppercase(params) {
|
|
14064
|
+
return this.check(_uppercase(params));
|
|
14065
|
+
},
|
|
14066
|
+
trim() {
|
|
14067
|
+
return this.check(_trim());
|
|
14068
|
+
},
|
|
14069
|
+
normalize(...args) {
|
|
14070
|
+
return this.check(_normalize(...args));
|
|
14071
|
+
},
|
|
14072
|
+
toLowerCase() {
|
|
14073
|
+
return this.check(_toLowerCase());
|
|
14074
|
+
},
|
|
14075
|
+
toUpperCase() {
|
|
14076
|
+
return this.check(_toUpperCase());
|
|
14077
|
+
},
|
|
14078
|
+
slugify() {
|
|
14079
|
+
return this.check(_slugify());
|
|
14080
|
+
}
|
|
14081
|
+
});
|
|
14082
|
+
});
|
|
14083
|
+
var ZodString = /* @__PURE__ */ $constructor("ZodString", (inst, def) => {
|
|
14084
|
+
$ZodString.init(inst, def);
|
|
14085
|
+
_ZodString.init(inst, def);
|
|
14086
|
+
inst.email = (params) => inst.check(_email(ZodEmail, params));
|
|
14087
|
+
inst.url = (params) => inst.check(_url(ZodURL, params));
|
|
14088
|
+
inst.jwt = (params) => inst.check(_jwt(ZodJWT, params));
|
|
14089
|
+
inst.emoji = (params) => inst.check(_emoji2(ZodEmoji, params));
|
|
14090
|
+
inst.guid = (params) => inst.check(_guid(ZodGUID, params));
|
|
14091
|
+
inst.uuid = (params) => inst.check(_uuid(ZodUUID, params));
|
|
14092
|
+
inst.uuidv4 = (params) => inst.check(_uuidv4(ZodUUID, params));
|
|
14093
|
+
inst.uuidv6 = (params) => inst.check(_uuidv6(ZodUUID, params));
|
|
14094
|
+
inst.uuidv7 = (params) => inst.check(_uuidv7(ZodUUID, params));
|
|
14095
|
+
inst.nanoid = (params) => inst.check(_nanoid(ZodNanoID, params));
|
|
14096
|
+
inst.guid = (params) => inst.check(_guid(ZodGUID, params));
|
|
14097
|
+
inst.cuid = (params) => inst.check(_cuid(ZodCUID, params));
|
|
14098
|
+
inst.cuid2 = (params) => inst.check(_cuid2(ZodCUID2, params));
|
|
14099
|
+
inst.ulid = (params) => inst.check(_ulid(ZodULID, params));
|
|
14100
|
+
inst.base64 = (params) => inst.check(_base64(ZodBase64, params));
|
|
14101
|
+
inst.base64url = (params) => inst.check(_base64url(ZodBase64URL, params));
|
|
14102
|
+
inst.xid = (params) => inst.check(_xid(ZodXID, params));
|
|
14103
|
+
inst.ksuid = (params) => inst.check(_ksuid(ZodKSUID, params));
|
|
14104
|
+
inst.ipv4 = (params) => inst.check(_ipv4(ZodIPv4, params));
|
|
14105
|
+
inst.ipv6 = (params) => inst.check(_ipv6(ZodIPv6, params));
|
|
14106
|
+
inst.cidrv4 = (params) => inst.check(_cidrv4(ZodCIDRv4, params));
|
|
14107
|
+
inst.cidrv6 = (params) => inst.check(_cidrv6(ZodCIDRv6, params));
|
|
14108
|
+
inst.e164 = (params) => inst.check(_e164(ZodE164, params));
|
|
14109
|
+
inst.datetime = (params) => inst.check(datetime2(params));
|
|
14110
|
+
inst.date = (params) => inst.check(date2(params));
|
|
14111
|
+
inst.time = (params) => inst.check(time2(params));
|
|
14112
|
+
inst.duration = (params) => inst.check(duration2(params));
|
|
14113
|
+
});
|
|
14114
|
+
function string2(params) {
|
|
14115
|
+
return _string(ZodString, params);
|
|
14116
|
+
}
|
|
14117
|
+
var ZodStringFormat = /* @__PURE__ */ $constructor("ZodStringFormat", (inst, def) => {
|
|
14118
|
+
$ZodStringFormat.init(inst, def);
|
|
14119
|
+
_ZodString.init(inst, def);
|
|
14120
|
+
});
|
|
14121
|
+
var ZodEmail = /* @__PURE__ */ $constructor("ZodEmail", (inst, def) => {
|
|
14122
|
+
$ZodEmail.init(inst, def);
|
|
14123
|
+
ZodStringFormat.init(inst, def);
|
|
14124
|
+
});
|
|
14125
|
+
function email2(params) {
|
|
14126
|
+
return _email(ZodEmail, params);
|
|
14127
|
+
}
|
|
14128
|
+
var ZodGUID = /* @__PURE__ */ $constructor("ZodGUID", (inst, def) => {
|
|
14129
|
+
$ZodGUID.init(inst, def);
|
|
14130
|
+
ZodStringFormat.init(inst, def);
|
|
14131
|
+
});
|
|
14132
|
+
function guid2(params) {
|
|
14133
|
+
return _guid(ZodGUID, params);
|
|
14134
|
+
}
|
|
14135
|
+
var ZodUUID = /* @__PURE__ */ $constructor("ZodUUID", (inst, def) => {
|
|
14136
|
+
$ZodUUID.init(inst, def);
|
|
14137
|
+
ZodStringFormat.init(inst, def);
|
|
14138
|
+
});
|
|
14139
|
+
function uuid2(params) {
|
|
14140
|
+
return _uuid(ZodUUID, params);
|
|
14141
|
+
}
|
|
14142
|
+
function uuidv4(params) {
|
|
14143
|
+
return _uuidv4(ZodUUID, params);
|
|
14144
|
+
}
|
|
14145
|
+
function uuidv6(params) {
|
|
14146
|
+
return _uuidv6(ZodUUID, params);
|
|
14147
|
+
}
|
|
14148
|
+
function uuidv7(params) {
|
|
14149
|
+
return _uuidv7(ZodUUID, params);
|
|
14150
|
+
}
|
|
14151
|
+
var ZodURL = /* @__PURE__ */ $constructor("ZodURL", (inst, def) => {
|
|
14152
|
+
$ZodURL.init(inst, def);
|
|
14153
|
+
ZodStringFormat.init(inst, def);
|
|
14154
|
+
});
|
|
14155
|
+
function url(params) {
|
|
14156
|
+
return _url(ZodURL, params);
|
|
14157
|
+
}
|
|
14158
|
+
function httpUrl(params) {
|
|
14159
|
+
return _url(ZodURL, {
|
|
14160
|
+
protocol: exports_regexes.httpProtocol,
|
|
14161
|
+
hostname: exports_regexes.domain,
|
|
14162
|
+
...exports_util.normalizeParams(params)
|
|
14163
|
+
});
|
|
14164
|
+
}
|
|
14165
|
+
var ZodEmoji = /* @__PURE__ */ $constructor("ZodEmoji", (inst, def) => {
|
|
14166
|
+
$ZodEmoji.init(inst, def);
|
|
14167
|
+
ZodStringFormat.init(inst, def);
|
|
14168
|
+
});
|
|
14169
|
+
function emoji2(params) {
|
|
14170
|
+
return _emoji2(ZodEmoji, params);
|
|
14171
|
+
}
|
|
14172
|
+
var ZodNanoID = /* @__PURE__ */ $constructor("ZodNanoID", (inst, def) => {
|
|
14173
|
+
$ZodNanoID.init(inst, def);
|
|
14174
|
+
ZodStringFormat.init(inst, def);
|
|
14175
|
+
});
|
|
14176
|
+
function nanoid2(params) {
|
|
14177
|
+
return _nanoid(ZodNanoID, params);
|
|
14178
|
+
}
|
|
14179
|
+
var ZodCUID = /* @__PURE__ */ $constructor("ZodCUID", (inst, def) => {
|
|
14180
|
+
$ZodCUID.init(inst, def);
|
|
14181
|
+
ZodStringFormat.init(inst, def);
|
|
14182
|
+
});
|
|
14183
|
+
function cuid3(params) {
|
|
14184
|
+
return _cuid(ZodCUID, params);
|
|
14185
|
+
}
|
|
14186
|
+
var ZodCUID2 = /* @__PURE__ */ $constructor("ZodCUID2", (inst, def) => {
|
|
14187
|
+
$ZodCUID2.init(inst, def);
|
|
14188
|
+
ZodStringFormat.init(inst, def);
|
|
14189
|
+
});
|
|
14190
|
+
function cuid22(params) {
|
|
14191
|
+
return _cuid2(ZodCUID2, params);
|
|
14192
|
+
}
|
|
14193
|
+
var ZodULID = /* @__PURE__ */ $constructor("ZodULID", (inst, def) => {
|
|
14194
|
+
$ZodULID.init(inst, def);
|
|
14195
|
+
ZodStringFormat.init(inst, def);
|
|
14196
|
+
});
|
|
14197
|
+
function ulid2(params) {
|
|
14198
|
+
return _ulid(ZodULID, params);
|
|
14199
|
+
}
|
|
14200
|
+
var ZodXID = /* @__PURE__ */ $constructor("ZodXID", (inst, def) => {
|
|
14201
|
+
$ZodXID.init(inst, def);
|
|
14202
|
+
ZodStringFormat.init(inst, def);
|
|
14203
|
+
});
|
|
14204
|
+
function xid2(params) {
|
|
14205
|
+
return _xid(ZodXID, params);
|
|
14206
|
+
}
|
|
14207
|
+
var ZodKSUID = /* @__PURE__ */ $constructor("ZodKSUID", (inst, def) => {
|
|
14208
|
+
$ZodKSUID.init(inst, def);
|
|
14209
|
+
ZodStringFormat.init(inst, def);
|
|
14210
|
+
});
|
|
14211
|
+
function ksuid2(params) {
|
|
14212
|
+
return _ksuid(ZodKSUID, params);
|
|
14213
|
+
}
|
|
14214
|
+
var ZodIPv4 = /* @__PURE__ */ $constructor("ZodIPv4", (inst, def) => {
|
|
14215
|
+
$ZodIPv4.init(inst, def);
|
|
14216
|
+
ZodStringFormat.init(inst, def);
|
|
14217
|
+
});
|
|
14218
|
+
function ipv42(params) {
|
|
14219
|
+
return _ipv4(ZodIPv4, params);
|
|
14220
|
+
}
|
|
14221
|
+
var ZodMAC = /* @__PURE__ */ $constructor("ZodMAC", (inst, def) => {
|
|
14222
|
+
$ZodMAC.init(inst, def);
|
|
14223
|
+
ZodStringFormat.init(inst, def);
|
|
14224
|
+
});
|
|
14225
|
+
function mac2(params) {
|
|
14226
|
+
return _mac(ZodMAC, params);
|
|
14227
|
+
}
|
|
14228
|
+
var ZodIPv6 = /* @__PURE__ */ $constructor("ZodIPv6", (inst, def) => {
|
|
14229
|
+
$ZodIPv6.init(inst, def);
|
|
14230
|
+
ZodStringFormat.init(inst, def);
|
|
14231
|
+
});
|
|
14232
|
+
function ipv62(params) {
|
|
14233
|
+
return _ipv6(ZodIPv6, params);
|
|
14234
|
+
}
|
|
14235
|
+
var ZodCIDRv4 = /* @__PURE__ */ $constructor("ZodCIDRv4", (inst, def) => {
|
|
14236
|
+
$ZodCIDRv4.init(inst, def);
|
|
14237
|
+
ZodStringFormat.init(inst, def);
|
|
14238
|
+
});
|
|
14239
|
+
function cidrv42(params) {
|
|
14240
|
+
return _cidrv4(ZodCIDRv4, params);
|
|
14241
|
+
}
|
|
14242
|
+
var ZodCIDRv6 = /* @__PURE__ */ $constructor("ZodCIDRv6", (inst, def) => {
|
|
14243
|
+
$ZodCIDRv6.init(inst, def);
|
|
14244
|
+
ZodStringFormat.init(inst, def);
|
|
14245
|
+
});
|
|
14246
|
+
function cidrv62(params) {
|
|
14247
|
+
return _cidrv6(ZodCIDRv6, params);
|
|
14248
|
+
}
|
|
14249
|
+
var ZodBase64 = /* @__PURE__ */ $constructor("ZodBase64", (inst, def) => {
|
|
14250
|
+
$ZodBase64.init(inst, def);
|
|
14251
|
+
ZodStringFormat.init(inst, def);
|
|
14252
|
+
});
|
|
14253
|
+
function base642(params) {
|
|
14254
|
+
return _base64(ZodBase64, params);
|
|
14255
|
+
}
|
|
14256
|
+
var ZodBase64URL = /* @__PURE__ */ $constructor("ZodBase64URL", (inst, def) => {
|
|
14257
|
+
$ZodBase64URL.init(inst, def);
|
|
14258
|
+
ZodStringFormat.init(inst, def);
|
|
14259
|
+
});
|
|
14260
|
+
function base64url2(params) {
|
|
14261
|
+
return _base64url(ZodBase64URL, params);
|
|
14262
|
+
}
|
|
14263
|
+
var ZodE164 = /* @__PURE__ */ $constructor("ZodE164", (inst, def) => {
|
|
14264
|
+
$ZodE164.init(inst, def);
|
|
14265
|
+
ZodStringFormat.init(inst, def);
|
|
14266
|
+
});
|
|
14267
|
+
function e1642(params) {
|
|
14268
|
+
return _e164(ZodE164, params);
|
|
14269
|
+
}
|
|
14270
|
+
var ZodJWT = /* @__PURE__ */ $constructor("ZodJWT", (inst, def) => {
|
|
14271
|
+
$ZodJWT.init(inst, def);
|
|
14272
|
+
ZodStringFormat.init(inst, def);
|
|
14273
|
+
});
|
|
14274
|
+
function jwt(params) {
|
|
14275
|
+
return _jwt(ZodJWT, params);
|
|
14276
|
+
}
|
|
14277
|
+
var ZodCustomStringFormat = /* @__PURE__ */ $constructor("ZodCustomStringFormat", (inst, def) => {
|
|
14278
|
+
$ZodCustomStringFormat.init(inst, def);
|
|
14279
|
+
ZodStringFormat.init(inst, def);
|
|
14280
|
+
});
|
|
14281
|
+
function stringFormat(format, fnOrRegex, _params = {}) {
|
|
14282
|
+
return _stringFormat(ZodCustomStringFormat, format, fnOrRegex, _params);
|
|
14283
|
+
}
|
|
14284
|
+
function hostname2(_params) {
|
|
14285
|
+
return _stringFormat(ZodCustomStringFormat, "hostname", exports_regexes.hostname, _params);
|
|
14286
|
+
}
|
|
14287
|
+
function hex2(_params) {
|
|
14288
|
+
return _stringFormat(ZodCustomStringFormat, "hex", exports_regexes.hex, _params);
|
|
14289
|
+
}
|
|
14290
|
+
function hash(alg, params) {
|
|
14291
|
+
const enc = params?.enc ?? "hex";
|
|
14292
|
+
const format = `${alg}_${enc}`;
|
|
14293
|
+
const regex = exports_regexes[format];
|
|
14294
|
+
if (!regex)
|
|
14295
|
+
throw new Error(`Unrecognized hash format: ${format}`);
|
|
14296
|
+
return _stringFormat(ZodCustomStringFormat, format, regex, params);
|
|
14297
|
+
}
|
|
14298
|
+
var ZodNumber = /* @__PURE__ */ $constructor("ZodNumber", (inst, def) => {
|
|
14299
|
+
$ZodNumber.init(inst, def);
|
|
14300
|
+
ZodType.init(inst, def);
|
|
14301
|
+
inst._zod.processJSONSchema = (ctx, json, params) => numberProcessor(inst, ctx, json, params);
|
|
14302
|
+
_installLazyMethods(inst, "ZodNumber", {
|
|
14303
|
+
gt(value, params) {
|
|
14304
|
+
return this.check(_gt(value, params));
|
|
14305
|
+
},
|
|
14306
|
+
gte(value, params) {
|
|
14307
|
+
return this.check(_gte(value, params));
|
|
14308
|
+
},
|
|
14309
|
+
min(value, params) {
|
|
14310
|
+
return this.check(_gte(value, params));
|
|
14311
|
+
},
|
|
14312
|
+
lt(value, params) {
|
|
14313
|
+
return this.check(_lt(value, params));
|
|
14314
|
+
},
|
|
14315
|
+
lte(value, params) {
|
|
14316
|
+
return this.check(_lte(value, params));
|
|
14317
|
+
},
|
|
14318
|
+
max(value, params) {
|
|
14319
|
+
return this.check(_lte(value, params));
|
|
14320
|
+
},
|
|
14321
|
+
int(params) {
|
|
14322
|
+
return this.check(int(params));
|
|
14323
|
+
},
|
|
14324
|
+
safe(params) {
|
|
14325
|
+
return this.check(int(params));
|
|
14326
|
+
},
|
|
14327
|
+
positive(params) {
|
|
14328
|
+
return this.check(_gt(0, params));
|
|
14329
|
+
},
|
|
14330
|
+
nonnegative(params) {
|
|
14331
|
+
return this.check(_gte(0, params));
|
|
14332
|
+
},
|
|
14333
|
+
negative(params) {
|
|
14334
|
+
return this.check(_lt(0, params));
|
|
14335
|
+
},
|
|
14336
|
+
nonpositive(params) {
|
|
14337
|
+
return this.check(_lte(0, params));
|
|
14338
|
+
},
|
|
14339
|
+
multipleOf(value, params) {
|
|
14340
|
+
return this.check(_multipleOf(value, params));
|
|
14341
|
+
},
|
|
14342
|
+
step(value, params) {
|
|
14343
|
+
return this.check(_multipleOf(value, params));
|
|
14344
|
+
},
|
|
14345
|
+
finite() {
|
|
14346
|
+
return this;
|
|
14347
|
+
}
|
|
14348
|
+
});
|
|
14349
|
+
const bag = inst._zod.bag;
|
|
14350
|
+
inst.minValue = Math.max(bag.minimum ?? Number.NEGATIVE_INFINITY, bag.exclusiveMinimum ?? Number.NEGATIVE_INFINITY) ?? null;
|
|
14351
|
+
inst.maxValue = Math.min(bag.maximum ?? Number.POSITIVE_INFINITY, bag.exclusiveMaximum ?? Number.POSITIVE_INFINITY) ?? null;
|
|
14352
|
+
inst.isInt = (bag.format ?? "").includes("int") || Number.isSafeInteger(bag.multipleOf ?? 0.5);
|
|
14353
|
+
inst.isFinite = true;
|
|
14354
|
+
inst.format = bag.format ?? null;
|
|
14355
|
+
});
|
|
14356
|
+
function number2(params) {
|
|
14357
|
+
return _number(ZodNumber, params);
|
|
14358
|
+
}
|
|
14359
|
+
var ZodNumberFormat = /* @__PURE__ */ $constructor("ZodNumberFormat", (inst, def) => {
|
|
14360
|
+
$ZodNumberFormat.init(inst, def);
|
|
14361
|
+
ZodNumber.init(inst, def);
|
|
14362
|
+
});
|
|
14363
|
+
function int(params) {
|
|
14364
|
+
return _int(ZodNumberFormat, params);
|
|
14365
|
+
}
|
|
14366
|
+
function float32(params) {
|
|
14367
|
+
return _float32(ZodNumberFormat, params);
|
|
14368
|
+
}
|
|
14369
|
+
function float64(params) {
|
|
14370
|
+
return _float64(ZodNumberFormat, params);
|
|
14371
|
+
}
|
|
14372
|
+
function int32(params) {
|
|
14373
|
+
return _int32(ZodNumberFormat, params);
|
|
14374
|
+
}
|
|
14375
|
+
function uint32(params) {
|
|
14376
|
+
return _uint32(ZodNumberFormat, params);
|
|
14377
|
+
}
|
|
14378
|
+
var ZodBoolean = /* @__PURE__ */ $constructor("ZodBoolean", (inst, def) => {
|
|
14379
|
+
$ZodBoolean.init(inst, def);
|
|
14380
|
+
ZodType.init(inst, def);
|
|
14381
|
+
inst._zod.processJSONSchema = (ctx, json, params) => booleanProcessor(inst, ctx, json, params);
|
|
14382
|
+
});
|
|
14383
|
+
function boolean2(params) {
|
|
14384
|
+
return _boolean(ZodBoolean, params);
|
|
14385
|
+
}
|
|
14386
|
+
var ZodBigInt = /* @__PURE__ */ $constructor("ZodBigInt", (inst, def) => {
|
|
14387
|
+
$ZodBigInt.init(inst, def);
|
|
14388
|
+
ZodType.init(inst, def);
|
|
14389
|
+
inst._zod.processJSONSchema = (ctx, json, params) => bigintProcessor(inst, ctx, json, params);
|
|
14390
|
+
inst.gte = (value, params) => inst.check(_gte(value, params));
|
|
14391
|
+
inst.min = (value, params) => inst.check(_gte(value, params));
|
|
14392
|
+
inst.gt = (value, params) => inst.check(_gt(value, params));
|
|
14393
|
+
inst.gte = (value, params) => inst.check(_gte(value, params));
|
|
14394
|
+
inst.min = (value, params) => inst.check(_gte(value, params));
|
|
14395
|
+
inst.lt = (value, params) => inst.check(_lt(value, params));
|
|
14396
|
+
inst.lte = (value, params) => inst.check(_lte(value, params));
|
|
14397
|
+
inst.max = (value, params) => inst.check(_lte(value, params));
|
|
14398
|
+
inst.positive = (params) => inst.check(_gt(BigInt(0), params));
|
|
14399
|
+
inst.negative = (params) => inst.check(_lt(BigInt(0), params));
|
|
14400
|
+
inst.nonpositive = (params) => inst.check(_lte(BigInt(0), params));
|
|
14401
|
+
inst.nonnegative = (params) => inst.check(_gte(BigInt(0), params));
|
|
14402
|
+
inst.multipleOf = (value, params) => inst.check(_multipleOf(value, params));
|
|
14403
|
+
const bag = inst._zod.bag;
|
|
14404
|
+
inst.minValue = bag.minimum ?? null;
|
|
14405
|
+
inst.maxValue = bag.maximum ?? null;
|
|
14406
|
+
inst.format = bag.format ?? null;
|
|
14407
|
+
});
|
|
14408
|
+
function bigint2(params) {
|
|
14409
|
+
return _bigint(ZodBigInt, params);
|
|
14410
|
+
}
|
|
14411
|
+
var ZodBigIntFormat = /* @__PURE__ */ $constructor("ZodBigIntFormat", (inst, def) => {
|
|
14412
|
+
$ZodBigIntFormat.init(inst, def);
|
|
14413
|
+
ZodBigInt.init(inst, def);
|
|
14414
|
+
});
|
|
14415
|
+
function int64(params) {
|
|
14416
|
+
return _int64(ZodBigIntFormat, params);
|
|
14417
|
+
}
|
|
14418
|
+
function uint64(params) {
|
|
14419
|
+
return _uint64(ZodBigIntFormat, params);
|
|
14420
|
+
}
|
|
14421
|
+
var ZodSymbol = /* @__PURE__ */ $constructor("ZodSymbol", (inst, def) => {
|
|
14422
|
+
$ZodSymbol.init(inst, def);
|
|
14423
|
+
ZodType.init(inst, def);
|
|
14424
|
+
inst._zod.processJSONSchema = (ctx, json, params) => symbolProcessor(inst, ctx, json, params);
|
|
14425
|
+
});
|
|
14426
|
+
function symbol(params) {
|
|
14427
|
+
return _symbol(ZodSymbol, params);
|
|
14428
|
+
}
|
|
14429
|
+
var ZodUndefined = /* @__PURE__ */ $constructor("ZodUndefined", (inst, def) => {
|
|
14430
|
+
$ZodUndefined.init(inst, def);
|
|
14431
|
+
ZodType.init(inst, def);
|
|
14432
|
+
inst._zod.processJSONSchema = (ctx, json, params) => undefinedProcessor(inst, ctx, json, params);
|
|
14433
|
+
});
|
|
14434
|
+
function _undefined3(params) {
|
|
14435
|
+
return _undefined2(ZodUndefined, params);
|
|
14436
|
+
}
|
|
14437
|
+
var ZodNull = /* @__PURE__ */ $constructor("ZodNull", (inst, def) => {
|
|
14438
|
+
$ZodNull.init(inst, def);
|
|
14439
|
+
ZodType.init(inst, def);
|
|
14440
|
+
inst._zod.processJSONSchema = (ctx, json, params) => nullProcessor(inst, ctx, json, params);
|
|
14441
|
+
});
|
|
14442
|
+
function _null3(params) {
|
|
14443
|
+
return _null2(ZodNull, params);
|
|
14444
|
+
}
|
|
14445
|
+
var ZodAny = /* @__PURE__ */ $constructor("ZodAny", (inst, def) => {
|
|
14446
|
+
$ZodAny.init(inst, def);
|
|
14447
|
+
ZodType.init(inst, def);
|
|
14448
|
+
inst._zod.processJSONSchema = (ctx, json, params) => anyProcessor(inst, ctx, json, params);
|
|
14449
|
+
});
|
|
14450
|
+
function any() {
|
|
14451
|
+
return _any(ZodAny);
|
|
14452
|
+
}
|
|
14453
|
+
var ZodUnknown = /* @__PURE__ */ $constructor("ZodUnknown", (inst, def) => {
|
|
14454
|
+
$ZodUnknown.init(inst, def);
|
|
14455
|
+
ZodType.init(inst, def);
|
|
14456
|
+
inst._zod.processJSONSchema = (ctx, json, params) => unknownProcessor(inst, ctx, json, params);
|
|
14457
|
+
});
|
|
14458
|
+
function unknown() {
|
|
14459
|
+
return _unknown(ZodUnknown);
|
|
14460
|
+
}
|
|
14461
|
+
var ZodNever = /* @__PURE__ */ $constructor("ZodNever", (inst, def) => {
|
|
14462
|
+
$ZodNever.init(inst, def);
|
|
14463
|
+
ZodType.init(inst, def);
|
|
14464
|
+
inst._zod.processJSONSchema = (ctx, json, params) => neverProcessor(inst, ctx, json, params);
|
|
14465
|
+
});
|
|
14466
|
+
function never(params) {
|
|
14467
|
+
return _never(ZodNever, params);
|
|
14468
|
+
}
|
|
14469
|
+
var ZodVoid = /* @__PURE__ */ $constructor("ZodVoid", (inst, def) => {
|
|
14470
|
+
$ZodVoid.init(inst, def);
|
|
14471
|
+
ZodType.init(inst, def);
|
|
14472
|
+
inst._zod.processJSONSchema = (ctx, json, params) => voidProcessor(inst, ctx, json, params);
|
|
14473
|
+
});
|
|
14474
|
+
function _void2(params) {
|
|
14475
|
+
return _void(ZodVoid, params);
|
|
14476
|
+
}
|
|
14477
|
+
var ZodDate = /* @__PURE__ */ $constructor("ZodDate", (inst, def) => {
|
|
14478
|
+
$ZodDate.init(inst, def);
|
|
14479
|
+
ZodType.init(inst, def);
|
|
14480
|
+
inst._zod.processJSONSchema = (ctx, json, params) => dateProcessor(inst, ctx, json, params);
|
|
14481
|
+
inst.min = (value, params) => inst.check(_gte(value, params));
|
|
14482
|
+
inst.max = (value, params) => inst.check(_lte(value, params));
|
|
14483
|
+
const c = inst._zod.bag;
|
|
14484
|
+
inst.minDate = c.minimum ? new Date(c.minimum) : null;
|
|
14485
|
+
inst.maxDate = c.maximum ? new Date(c.maximum) : null;
|
|
14486
|
+
});
|
|
14487
|
+
function date3(params) {
|
|
14488
|
+
return _date(ZodDate, params);
|
|
14489
|
+
}
|
|
14490
|
+
var ZodArray = /* @__PURE__ */ $constructor("ZodArray", (inst, def) => {
|
|
14491
|
+
$ZodArray.init(inst, def);
|
|
14492
|
+
ZodType.init(inst, def);
|
|
14493
|
+
inst._zod.processJSONSchema = (ctx, json, params) => arrayProcessor(inst, ctx, json, params);
|
|
14494
|
+
inst.element = def.element;
|
|
14495
|
+
_installLazyMethods(inst, "ZodArray", {
|
|
14496
|
+
min(n, params) {
|
|
14497
|
+
return this.check(_minLength(n, params));
|
|
14498
|
+
},
|
|
14499
|
+
nonempty(params) {
|
|
14500
|
+
return this.check(_minLength(1, params));
|
|
14501
|
+
},
|
|
14502
|
+
max(n, params) {
|
|
14503
|
+
return this.check(_maxLength(n, params));
|
|
14504
|
+
},
|
|
14505
|
+
length(n, params) {
|
|
14506
|
+
return this.check(_length(n, params));
|
|
14507
|
+
},
|
|
14508
|
+
unwrap() {
|
|
14509
|
+
return this.element;
|
|
14510
|
+
}
|
|
14511
|
+
});
|
|
14512
|
+
});
|
|
14513
|
+
function array(element, params) {
|
|
14514
|
+
return _array(ZodArray, element, params);
|
|
14515
|
+
}
|
|
14516
|
+
function keyof(schema) {
|
|
14517
|
+
const shape = schema._zod.def.shape;
|
|
14518
|
+
return _enum2(Object.keys(shape));
|
|
14519
|
+
}
|
|
14520
|
+
var ZodObject = /* @__PURE__ */ $constructor("ZodObject", (inst, def) => {
|
|
14521
|
+
$ZodObjectJIT.init(inst, def);
|
|
14522
|
+
ZodType.init(inst, def);
|
|
14523
|
+
inst._zod.processJSONSchema = (ctx, json, params) => objectProcessor(inst, ctx, json, params);
|
|
14524
|
+
exports_util.defineLazy(inst, "shape", () => {
|
|
14525
|
+
return def.shape;
|
|
14526
|
+
});
|
|
14527
|
+
_installLazyMethods(inst, "ZodObject", {
|
|
14528
|
+
keyof() {
|
|
14529
|
+
return _enum2(Object.keys(this._zod.def.shape));
|
|
14530
|
+
},
|
|
14531
|
+
catchall(catchall) {
|
|
14532
|
+
return this.clone({ ...this._zod.def, catchall });
|
|
14533
|
+
},
|
|
14534
|
+
passthrough() {
|
|
14535
|
+
return this.clone({ ...this._zod.def, catchall: unknown() });
|
|
14536
|
+
},
|
|
14537
|
+
loose() {
|
|
14538
|
+
return this.clone({ ...this._zod.def, catchall: unknown() });
|
|
14539
|
+
},
|
|
14540
|
+
strict() {
|
|
14541
|
+
return this.clone({ ...this._zod.def, catchall: never() });
|
|
14542
|
+
},
|
|
14543
|
+
strip() {
|
|
14544
|
+
return this.clone({ ...this._zod.def, catchall: undefined });
|
|
14545
|
+
},
|
|
14546
|
+
extend(incoming) {
|
|
14547
|
+
return exports_util.extend(this, incoming);
|
|
14548
|
+
},
|
|
14549
|
+
safeExtend(incoming) {
|
|
14550
|
+
return exports_util.safeExtend(this, incoming);
|
|
14551
|
+
},
|
|
14552
|
+
merge(other) {
|
|
14553
|
+
return exports_util.merge(this, other);
|
|
14554
|
+
},
|
|
14555
|
+
pick(mask) {
|
|
14556
|
+
return exports_util.pick(this, mask);
|
|
14557
|
+
},
|
|
14558
|
+
omit(mask) {
|
|
14559
|
+
return exports_util.omit(this, mask);
|
|
14560
|
+
},
|
|
14561
|
+
partial(...args) {
|
|
14562
|
+
return exports_util.partial(ZodOptional, this, args[0]);
|
|
14563
|
+
},
|
|
14564
|
+
required(...args) {
|
|
14565
|
+
return exports_util.required(ZodNonOptional, this, args[0]);
|
|
14566
|
+
}
|
|
14567
|
+
});
|
|
14568
|
+
});
|
|
14569
|
+
function object(shape, params) {
|
|
14570
|
+
const def = {
|
|
14571
|
+
type: "object",
|
|
14572
|
+
shape: shape ?? {},
|
|
14573
|
+
...exports_util.normalizeParams(params)
|
|
14574
|
+
};
|
|
14575
|
+
return new ZodObject(def);
|
|
14576
|
+
}
|
|
14577
|
+
function strictObject(shape, params) {
|
|
14578
|
+
return new ZodObject({
|
|
14579
|
+
type: "object",
|
|
14580
|
+
shape,
|
|
14581
|
+
catchall: never(),
|
|
14582
|
+
...exports_util.normalizeParams(params)
|
|
14583
|
+
});
|
|
14584
|
+
}
|
|
14585
|
+
function looseObject(shape, params) {
|
|
14586
|
+
return new ZodObject({
|
|
14587
|
+
type: "object",
|
|
14588
|
+
shape,
|
|
14589
|
+
catchall: unknown(),
|
|
14590
|
+
...exports_util.normalizeParams(params)
|
|
14591
|
+
});
|
|
14592
|
+
}
|
|
14593
|
+
var ZodUnion = /* @__PURE__ */ $constructor("ZodUnion", (inst, def) => {
|
|
14594
|
+
$ZodUnion.init(inst, def);
|
|
14595
|
+
ZodType.init(inst, def);
|
|
14596
|
+
inst._zod.processJSONSchema = (ctx, json, params) => unionProcessor(inst, ctx, json, params);
|
|
14597
|
+
inst.options = def.options;
|
|
14598
|
+
});
|
|
14599
|
+
function union(options, params) {
|
|
14600
|
+
return new ZodUnion({
|
|
14601
|
+
type: "union",
|
|
14602
|
+
options,
|
|
14603
|
+
...exports_util.normalizeParams(params)
|
|
14604
|
+
});
|
|
14605
|
+
}
|
|
14606
|
+
var ZodXor = /* @__PURE__ */ $constructor("ZodXor", (inst, def) => {
|
|
14607
|
+
ZodUnion.init(inst, def);
|
|
14608
|
+
$ZodXor.init(inst, def);
|
|
14609
|
+
inst._zod.processJSONSchema = (ctx, json, params) => unionProcessor(inst, ctx, json, params);
|
|
14610
|
+
inst.options = def.options;
|
|
14611
|
+
});
|
|
14612
|
+
function xor(options, params) {
|
|
14613
|
+
return new ZodXor({
|
|
14614
|
+
type: "union",
|
|
14615
|
+
options,
|
|
14616
|
+
inclusive: false,
|
|
14617
|
+
...exports_util.normalizeParams(params)
|
|
14618
|
+
});
|
|
14619
|
+
}
|
|
14620
|
+
var ZodDiscriminatedUnion = /* @__PURE__ */ $constructor("ZodDiscriminatedUnion", (inst, def) => {
|
|
14621
|
+
ZodUnion.init(inst, def);
|
|
14622
|
+
$ZodDiscriminatedUnion.init(inst, def);
|
|
14623
|
+
});
|
|
14624
|
+
function discriminatedUnion(discriminator, options, params) {
|
|
14625
|
+
return new ZodDiscriminatedUnion({
|
|
14626
|
+
type: "union",
|
|
14627
|
+
options,
|
|
14628
|
+
discriminator,
|
|
14629
|
+
...exports_util.normalizeParams(params)
|
|
14630
|
+
});
|
|
14631
|
+
}
|
|
14632
|
+
var ZodIntersection = /* @__PURE__ */ $constructor("ZodIntersection", (inst, def) => {
|
|
14633
|
+
$ZodIntersection.init(inst, def);
|
|
14634
|
+
ZodType.init(inst, def);
|
|
14635
|
+
inst._zod.processJSONSchema = (ctx, json, params) => intersectionProcessor(inst, ctx, json, params);
|
|
14636
|
+
});
|
|
14637
|
+
function intersection(left, right) {
|
|
14638
|
+
return new ZodIntersection({
|
|
14639
|
+
type: "intersection",
|
|
14640
|
+
left,
|
|
14641
|
+
right
|
|
14642
|
+
});
|
|
14643
|
+
}
|
|
14644
|
+
var ZodTuple = /* @__PURE__ */ $constructor("ZodTuple", (inst, def) => {
|
|
14645
|
+
$ZodTuple.init(inst, def);
|
|
14646
|
+
ZodType.init(inst, def);
|
|
14647
|
+
inst._zod.processJSONSchema = (ctx, json, params) => tupleProcessor(inst, ctx, json, params);
|
|
14648
|
+
inst.rest = (rest) => inst.clone({
|
|
14649
|
+
...inst._zod.def,
|
|
14650
|
+
rest
|
|
14651
|
+
});
|
|
14652
|
+
});
|
|
14653
|
+
function tuple(items, _paramsOrRest, _params) {
|
|
14654
|
+
const hasRest = _paramsOrRest instanceof $ZodType;
|
|
14655
|
+
const params = hasRest ? _params : _paramsOrRest;
|
|
14656
|
+
const rest = hasRest ? _paramsOrRest : null;
|
|
14657
|
+
return new ZodTuple({
|
|
14658
|
+
type: "tuple",
|
|
14659
|
+
items,
|
|
14660
|
+
rest,
|
|
14661
|
+
...exports_util.normalizeParams(params)
|
|
14662
|
+
});
|
|
14663
|
+
}
|
|
14664
|
+
var ZodRecord = /* @__PURE__ */ $constructor("ZodRecord", (inst, def) => {
|
|
14665
|
+
$ZodRecord.init(inst, def);
|
|
14666
|
+
ZodType.init(inst, def);
|
|
14667
|
+
inst._zod.processJSONSchema = (ctx, json, params) => recordProcessor(inst, ctx, json, params);
|
|
14668
|
+
inst.keyType = def.keyType;
|
|
14669
|
+
inst.valueType = def.valueType;
|
|
14670
|
+
});
|
|
14671
|
+
function record(keyType, valueType, params) {
|
|
14672
|
+
if (!valueType || !valueType._zod) {
|
|
14673
|
+
return new ZodRecord({
|
|
14674
|
+
type: "record",
|
|
14675
|
+
keyType: string2(),
|
|
14676
|
+
valueType: keyType,
|
|
14677
|
+
...exports_util.normalizeParams(valueType)
|
|
14678
|
+
});
|
|
14679
|
+
}
|
|
14680
|
+
return new ZodRecord({
|
|
14681
|
+
type: "record",
|
|
14682
|
+
keyType,
|
|
14683
|
+
valueType,
|
|
14684
|
+
...exports_util.normalizeParams(params)
|
|
14685
|
+
});
|
|
14686
|
+
}
|
|
14687
|
+
function partialRecord(keyType, valueType, params) {
|
|
14688
|
+
const k = clone(keyType);
|
|
14689
|
+
k._zod.values = undefined;
|
|
14690
|
+
return new ZodRecord({
|
|
14691
|
+
type: "record",
|
|
14692
|
+
keyType: k,
|
|
14693
|
+
valueType,
|
|
14694
|
+
...exports_util.normalizeParams(params)
|
|
14695
|
+
});
|
|
14696
|
+
}
|
|
14697
|
+
function looseRecord(keyType, valueType, params) {
|
|
14698
|
+
return new ZodRecord({
|
|
14699
|
+
type: "record",
|
|
14700
|
+
keyType,
|
|
14701
|
+
valueType,
|
|
14702
|
+
mode: "loose",
|
|
14703
|
+
...exports_util.normalizeParams(params)
|
|
14704
|
+
});
|
|
14705
|
+
}
|
|
14706
|
+
var ZodMap = /* @__PURE__ */ $constructor("ZodMap", (inst, def) => {
|
|
14707
|
+
$ZodMap.init(inst, def);
|
|
14708
|
+
ZodType.init(inst, def);
|
|
14709
|
+
inst._zod.processJSONSchema = (ctx, json, params) => mapProcessor(inst, ctx, json, params);
|
|
14710
|
+
inst.keyType = def.keyType;
|
|
14711
|
+
inst.valueType = def.valueType;
|
|
14712
|
+
inst.min = (...args) => inst.check(_minSize(...args));
|
|
14713
|
+
inst.nonempty = (params) => inst.check(_minSize(1, params));
|
|
14714
|
+
inst.max = (...args) => inst.check(_maxSize(...args));
|
|
14715
|
+
inst.size = (...args) => inst.check(_size(...args));
|
|
14716
|
+
});
|
|
14717
|
+
function map(keyType, valueType, params) {
|
|
14718
|
+
return new ZodMap({
|
|
14719
|
+
type: "map",
|
|
14720
|
+
keyType,
|
|
14721
|
+
valueType,
|
|
14722
|
+
...exports_util.normalizeParams(params)
|
|
14723
|
+
});
|
|
14724
|
+
}
|
|
14725
|
+
var ZodSet = /* @__PURE__ */ $constructor("ZodSet", (inst, def) => {
|
|
14726
|
+
$ZodSet.init(inst, def);
|
|
14727
|
+
ZodType.init(inst, def);
|
|
14728
|
+
inst._zod.processJSONSchema = (ctx, json, params) => setProcessor(inst, ctx, json, params);
|
|
14729
|
+
inst.min = (...args) => inst.check(_minSize(...args));
|
|
14730
|
+
inst.nonempty = (params) => inst.check(_minSize(1, params));
|
|
14731
|
+
inst.max = (...args) => inst.check(_maxSize(...args));
|
|
14732
|
+
inst.size = (...args) => inst.check(_size(...args));
|
|
14733
|
+
});
|
|
14734
|
+
function set(valueType, params) {
|
|
14735
|
+
return new ZodSet({
|
|
14736
|
+
type: "set",
|
|
14737
|
+
valueType,
|
|
14738
|
+
...exports_util.normalizeParams(params)
|
|
14739
|
+
});
|
|
14740
|
+
}
|
|
14741
|
+
var ZodEnum = /* @__PURE__ */ $constructor("ZodEnum", (inst, def) => {
|
|
14742
|
+
$ZodEnum.init(inst, def);
|
|
14743
|
+
ZodType.init(inst, def);
|
|
14744
|
+
inst._zod.processJSONSchema = (ctx, json, params) => enumProcessor(inst, ctx, json, params);
|
|
14745
|
+
inst.enum = def.entries;
|
|
14746
|
+
inst.options = Object.values(def.entries);
|
|
14747
|
+
const keys = new Set(Object.keys(def.entries));
|
|
14748
|
+
inst.extract = (values, params) => {
|
|
14749
|
+
const newEntries = {};
|
|
14750
|
+
for (const value of values) {
|
|
14751
|
+
if (keys.has(value)) {
|
|
14752
|
+
newEntries[value] = def.entries[value];
|
|
14753
|
+
} else
|
|
14754
|
+
throw new Error(`Key ${value} not found in enum`);
|
|
14755
|
+
}
|
|
14756
|
+
return new ZodEnum({
|
|
14757
|
+
...def,
|
|
14758
|
+
checks: [],
|
|
14759
|
+
...exports_util.normalizeParams(params),
|
|
14760
|
+
entries: newEntries
|
|
14761
|
+
});
|
|
14762
|
+
};
|
|
14763
|
+
inst.exclude = (values, params) => {
|
|
14764
|
+
const newEntries = { ...def.entries };
|
|
14765
|
+
for (const value of values) {
|
|
14766
|
+
if (keys.has(value)) {
|
|
14767
|
+
delete newEntries[value];
|
|
14768
|
+
} else
|
|
14769
|
+
throw new Error(`Key ${value} not found in enum`);
|
|
14770
|
+
}
|
|
14771
|
+
return new ZodEnum({
|
|
14772
|
+
...def,
|
|
14773
|
+
checks: [],
|
|
14774
|
+
...exports_util.normalizeParams(params),
|
|
14775
|
+
entries: newEntries
|
|
14776
|
+
});
|
|
14777
|
+
};
|
|
14778
|
+
});
|
|
14779
|
+
function _enum2(values, params) {
|
|
14780
|
+
const entries = Array.isArray(values) ? Object.fromEntries(values.map((v) => [v, v])) : values;
|
|
14781
|
+
return new ZodEnum({
|
|
14782
|
+
type: "enum",
|
|
14783
|
+
entries,
|
|
14784
|
+
...exports_util.normalizeParams(params)
|
|
14785
|
+
});
|
|
14786
|
+
}
|
|
14787
|
+
function nativeEnum(entries, params) {
|
|
14788
|
+
return new ZodEnum({
|
|
14789
|
+
type: "enum",
|
|
14790
|
+
entries,
|
|
14791
|
+
...exports_util.normalizeParams(params)
|
|
14792
|
+
});
|
|
14793
|
+
}
|
|
14794
|
+
var ZodLiteral = /* @__PURE__ */ $constructor("ZodLiteral", (inst, def) => {
|
|
14795
|
+
$ZodLiteral.init(inst, def);
|
|
14796
|
+
ZodType.init(inst, def);
|
|
14797
|
+
inst._zod.processJSONSchema = (ctx, json, params) => literalProcessor(inst, ctx, json, params);
|
|
14798
|
+
inst.values = new Set(def.values);
|
|
14799
|
+
Object.defineProperty(inst, "value", {
|
|
14800
|
+
get() {
|
|
14801
|
+
if (def.values.length > 1) {
|
|
14802
|
+
throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");
|
|
14803
|
+
}
|
|
14804
|
+
return def.values[0];
|
|
14805
|
+
}
|
|
14806
|
+
});
|
|
14807
|
+
});
|
|
14808
|
+
function literal(value, params) {
|
|
14809
|
+
return new ZodLiteral({
|
|
14810
|
+
type: "literal",
|
|
14811
|
+
values: Array.isArray(value) ? value : [value],
|
|
14812
|
+
...exports_util.normalizeParams(params)
|
|
14813
|
+
});
|
|
14814
|
+
}
|
|
14815
|
+
var ZodFile = /* @__PURE__ */ $constructor("ZodFile", (inst, def) => {
|
|
14816
|
+
$ZodFile.init(inst, def);
|
|
14817
|
+
ZodType.init(inst, def);
|
|
14818
|
+
inst._zod.processJSONSchema = (ctx, json, params) => fileProcessor(inst, ctx, json, params);
|
|
14819
|
+
inst.min = (size, params) => inst.check(_minSize(size, params));
|
|
14820
|
+
inst.max = (size, params) => inst.check(_maxSize(size, params));
|
|
14821
|
+
inst.mime = (types, params) => inst.check(_mime(Array.isArray(types) ? types : [types], params));
|
|
14822
|
+
});
|
|
14823
|
+
function file(params) {
|
|
14824
|
+
return _file(ZodFile, params);
|
|
14825
|
+
}
|
|
14826
|
+
var ZodTransform = /* @__PURE__ */ $constructor("ZodTransform", (inst, def) => {
|
|
14827
|
+
$ZodTransform.init(inst, def);
|
|
14828
|
+
ZodType.init(inst, def);
|
|
14829
|
+
inst._zod.processJSONSchema = (ctx, json, params) => transformProcessor(inst, ctx, json, params);
|
|
14830
|
+
inst._zod.parse = (payload, _ctx) => {
|
|
14831
|
+
if (_ctx.direction === "backward") {
|
|
14832
|
+
throw new $ZodEncodeError(inst.constructor.name);
|
|
14833
|
+
}
|
|
14834
|
+
payload.addIssue = (issue2) => {
|
|
14835
|
+
if (typeof issue2 === "string") {
|
|
14836
|
+
payload.issues.push(exports_util.issue(issue2, payload.value, def));
|
|
14837
|
+
} else {
|
|
14838
|
+
const _issue = issue2;
|
|
14839
|
+
if (_issue.fatal)
|
|
14840
|
+
_issue.continue = false;
|
|
14841
|
+
_issue.code ?? (_issue.code = "custom");
|
|
14842
|
+
_issue.input ?? (_issue.input = payload.value);
|
|
14843
|
+
_issue.inst ?? (_issue.inst = inst);
|
|
14844
|
+
payload.issues.push(exports_util.issue(_issue));
|
|
14845
|
+
}
|
|
14846
|
+
};
|
|
14847
|
+
const output = def.transform(payload.value, payload);
|
|
14848
|
+
if (output instanceof Promise) {
|
|
14849
|
+
return output.then((output2) => {
|
|
14850
|
+
payload.value = output2;
|
|
14851
|
+
payload.fallback = true;
|
|
14852
|
+
return payload;
|
|
14853
|
+
});
|
|
14854
|
+
}
|
|
14855
|
+
payload.value = output;
|
|
14856
|
+
payload.fallback = true;
|
|
14857
|
+
return payload;
|
|
14858
|
+
};
|
|
14859
|
+
});
|
|
14860
|
+
function transform(fn) {
|
|
14861
|
+
return new ZodTransform({
|
|
14862
|
+
type: "transform",
|
|
14863
|
+
transform: fn
|
|
14864
|
+
});
|
|
14865
|
+
}
|
|
14866
|
+
var ZodOptional = /* @__PURE__ */ $constructor("ZodOptional", (inst, def) => {
|
|
14867
|
+
$ZodOptional.init(inst, def);
|
|
14868
|
+
ZodType.init(inst, def);
|
|
14869
|
+
inst._zod.processJSONSchema = (ctx, json, params) => optionalProcessor(inst, ctx, json, params);
|
|
14870
|
+
inst.unwrap = () => inst._zod.def.innerType;
|
|
14871
|
+
});
|
|
14872
|
+
function optional(innerType) {
|
|
14873
|
+
return new ZodOptional({
|
|
14874
|
+
type: "optional",
|
|
14875
|
+
innerType
|
|
14876
|
+
});
|
|
14877
|
+
}
|
|
14878
|
+
var ZodExactOptional = /* @__PURE__ */ $constructor("ZodExactOptional", (inst, def) => {
|
|
14879
|
+
$ZodExactOptional.init(inst, def);
|
|
14880
|
+
ZodType.init(inst, def);
|
|
14881
|
+
inst._zod.processJSONSchema = (ctx, json, params) => optionalProcessor(inst, ctx, json, params);
|
|
14882
|
+
inst.unwrap = () => inst._zod.def.innerType;
|
|
14883
|
+
});
|
|
14884
|
+
function exactOptional(innerType) {
|
|
14885
|
+
return new ZodExactOptional({
|
|
14886
|
+
type: "optional",
|
|
14887
|
+
innerType
|
|
14888
|
+
});
|
|
14889
|
+
}
|
|
14890
|
+
var ZodNullable = /* @__PURE__ */ $constructor("ZodNullable", (inst, def) => {
|
|
14891
|
+
$ZodNullable.init(inst, def);
|
|
14892
|
+
ZodType.init(inst, def);
|
|
14893
|
+
inst._zod.processJSONSchema = (ctx, json, params) => nullableProcessor(inst, ctx, json, params);
|
|
14894
|
+
inst.unwrap = () => inst._zod.def.innerType;
|
|
14895
|
+
});
|
|
14896
|
+
function nullable(innerType) {
|
|
14897
|
+
return new ZodNullable({
|
|
14898
|
+
type: "nullable",
|
|
14899
|
+
innerType
|
|
14900
|
+
});
|
|
14901
|
+
}
|
|
14902
|
+
function nullish2(innerType) {
|
|
14903
|
+
return optional(nullable(innerType));
|
|
14904
|
+
}
|
|
14905
|
+
var ZodDefault = /* @__PURE__ */ $constructor("ZodDefault", (inst, def) => {
|
|
14906
|
+
$ZodDefault.init(inst, def);
|
|
14907
|
+
ZodType.init(inst, def);
|
|
14908
|
+
inst._zod.processJSONSchema = (ctx, json, params) => defaultProcessor(inst, ctx, json, params);
|
|
14909
|
+
inst.unwrap = () => inst._zod.def.innerType;
|
|
14910
|
+
inst.removeDefault = inst.unwrap;
|
|
14911
|
+
});
|
|
14912
|
+
function _default2(innerType, defaultValue) {
|
|
14913
|
+
return new ZodDefault({
|
|
14914
|
+
type: "default",
|
|
14915
|
+
innerType,
|
|
14916
|
+
get defaultValue() {
|
|
14917
|
+
return typeof defaultValue === "function" ? defaultValue() : exports_util.shallowClone(defaultValue);
|
|
14918
|
+
}
|
|
14919
|
+
});
|
|
14920
|
+
}
|
|
14921
|
+
var ZodPrefault = /* @__PURE__ */ $constructor("ZodPrefault", (inst, def) => {
|
|
14922
|
+
$ZodPrefault.init(inst, def);
|
|
14923
|
+
ZodType.init(inst, def);
|
|
14924
|
+
inst._zod.processJSONSchema = (ctx, json, params) => prefaultProcessor(inst, ctx, json, params);
|
|
14925
|
+
inst.unwrap = () => inst._zod.def.innerType;
|
|
14926
|
+
});
|
|
14927
|
+
function prefault(innerType, defaultValue) {
|
|
14928
|
+
return new ZodPrefault({
|
|
14929
|
+
type: "prefault",
|
|
14930
|
+
innerType,
|
|
14931
|
+
get defaultValue() {
|
|
14932
|
+
return typeof defaultValue === "function" ? defaultValue() : exports_util.shallowClone(defaultValue);
|
|
14933
|
+
}
|
|
14934
|
+
});
|
|
14935
|
+
}
|
|
14936
|
+
var ZodNonOptional = /* @__PURE__ */ $constructor("ZodNonOptional", (inst, def) => {
|
|
14937
|
+
$ZodNonOptional.init(inst, def);
|
|
14938
|
+
ZodType.init(inst, def);
|
|
14939
|
+
inst._zod.processJSONSchema = (ctx, json, params) => nonoptionalProcessor(inst, ctx, json, params);
|
|
14940
|
+
inst.unwrap = () => inst._zod.def.innerType;
|
|
14941
|
+
});
|
|
14942
|
+
function nonoptional(innerType, params) {
|
|
14943
|
+
return new ZodNonOptional({
|
|
14944
|
+
type: "nonoptional",
|
|
14945
|
+
innerType,
|
|
14946
|
+
...exports_util.normalizeParams(params)
|
|
14947
|
+
});
|
|
14948
|
+
}
|
|
14949
|
+
var ZodSuccess = /* @__PURE__ */ $constructor("ZodSuccess", (inst, def) => {
|
|
14950
|
+
$ZodSuccess.init(inst, def);
|
|
14951
|
+
ZodType.init(inst, def);
|
|
14952
|
+
inst._zod.processJSONSchema = (ctx, json, params) => successProcessor(inst, ctx, json, params);
|
|
14953
|
+
inst.unwrap = () => inst._zod.def.innerType;
|
|
14954
|
+
});
|
|
14955
|
+
function success(innerType) {
|
|
14956
|
+
return new ZodSuccess({
|
|
14957
|
+
type: "success",
|
|
14958
|
+
innerType
|
|
14959
|
+
});
|
|
14960
|
+
}
|
|
14961
|
+
var ZodCatch = /* @__PURE__ */ $constructor("ZodCatch", (inst, def) => {
|
|
14962
|
+
$ZodCatch.init(inst, def);
|
|
14963
|
+
ZodType.init(inst, def);
|
|
14964
|
+
inst._zod.processJSONSchema = (ctx, json, params) => catchProcessor(inst, ctx, json, params);
|
|
14965
|
+
inst.unwrap = () => inst._zod.def.innerType;
|
|
14966
|
+
inst.removeCatch = inst.unwrap;
|
|
14967
|
+
});
|
|
14968
|
+
function _catch2(innerType, catchValue) {
|
|
14969
|
+
return new ZodCatch({
|
|
14970
|
+
type: "catch",
|
|
14971
|
+
innerType,
|
|
14972
|
+
catchValue: typeof catchValue === "function" ? catchValue : () => catchValue
|
|
14973
|
+
});
|
|
14974
|
+
}
|
|
14975
|
+
var ZodNaN = /* @__PURE__ */ $constructor("ZodNaN", (inst, def) => {
|
|
14976
|
+
$ZodNaN.init(inst, def);
|
|
14977
|
+
ZodType.init(inst, def);
|
|
14978
|
+
inst._zod.processJSONSchema = (ctx, json, params) => nanProcessor(inst, ctx, json, params);
|
|
14979
|
+
});
|
|
14980
|
+
function nan(params) {
|
|
14981
|
+
return _nan(ZodNaN, params);
|
|
14982
|
+
}
|
|
14983
|
+
var ZodPipe = /* @__PURE__ */ $constructor("ZodPipe", (inst, def) => {
|
|
14984
|
+
$ZodPipe.init(inst, def);
|
|
14985
|
+
ZodType.init(inst, def);
|
|
14986
|
+
inst._zod.processJSONSchema = (ctx, json, params) => pipeProcessor(inst, ctx, json, params);
|
|
14987
|
+
inst.in = def.in;
|
|
14988
|
+
inst.out = def.out;
|
|
14989
|
+
});
|
|
14990
|
+
function pipe(in_, out) {
|
|
14991
|
+
return new ZodPipe({
|
|
14992
|
+
type: "pipe",
|
|
14993
|
+
in: in_,
|
|
14994
|
+
out
|
|
14995
|
+
});
|
|
14996
|
+
}
|
|
14997
|
+
var ZodCodec = /* @__PURE__ */ $constructor("ZodCodec", (inst, def) => {
|
|
14998
|
+
ZodPipe.init(inst, def);
|
|
14999
|
+
$ZodCodec.init(inst, def);
|
|
15000
|
+
});
|
|
15001
|
+
function codec(in_, out, params) {
|
|
15002
|
+
return new ZodCodec({
|
|
15003
|
+
type: "pipe",
|
|
15004
|
+
in: in_,
|
|
15005
|
+
out,
|
|
15006
|
+
transform: params.decode,
|
|
15007
|
+
reverseTransform: params.encode
|
|
15008
|
+
});
|
|
15009
|
+
}
|
|
15010
|
+
function invertCodec(codec2) {
|
|
15011
|
+
const def = codec2._zod.def;
|
|
15012
|
+
return new ZodCodec({
|
|
15013
|
+
type: "pipe",
|
|
15014
|
+
in: def.out,
|
|
15015
|
+
out: def.in,
|
|
15016
|
+
transform: def.reverseTransform,
|
|
15017
|
+
reverseTransform: def.transform
|
|
15018
|
+
});
|
|
15019
|
+
}
|
|
15020
|
+
var ZodPreprocess = /* @__PURE__ */ $constructor("ZodPreprocess", (inst, def) => {
|
|
15021
|
+
ZodPipe.init(inst, def);
|
|
15022
|
+
$ZodPreprocess.init(inst, def);
|
|
15023
|
+
});
|
|
15024
|
+
var ZodReadonly = /* @__PURE__ */ $constructor("ZodReadonly", (inst, def) => {
|
|
15025
|
+
$ZodReadonly.init(inst, def);
|
|
15026
|
+
ZodType.init(inst, def);
|
|
15027
|
+
inst._zod.processJSONSchema = (ctx, json, params) => readonlyProcessor(inst, ctx, json, params);
|
|
15028
|
+
inst.unwrap = () => inst._zod.def.innerType;
|
|
15029
|
+
});
|
|
15030
|
+
function readonly(innerType) {
|
|
15031
|
+
return new ZodReadonly({
|
|
15032
|
+
type: "readonly",
|
|
15033
|
+
innerType
|
|
15034
|
+
});
|
|
15035
|
+
}
|
|
15036
|
+
var ZodTemplateLiteral = /* @__PURE__ */ $constructor("ZodTemplateLiteral", (inst, def) => {
|
|
15037
|
+
$ZodTemplateLiteral.init(inst, def);
|
|
15038
|
+
ZodType.init(inst, def);
|
|
15039
|
+
inst._zod.processJSONSchema = (ctx, json, params) => templateLiteralProcessor(inst, ctx, json, params);
|
|
15040
|
+
});
|
|
15041
|
+
function templateLiteral(parts, params) {
|
|
15042
|
+
return new ZodTemplateLiteral({
|
|
15043
|
+
type: "template_literal",
|
|
15044
|
+
parts,
|
|
15045
|
+
...exports_util.normalizeParams(params)
|
|
15046
|
+
});
|
|
15047
|
+
}
|
|
15048
|
+
var ZodLazy = /* @__PURE__ */ $constructor("ZodLazy", (inst, def) => {
|
|
15049
|
+
$ZodLazy.init(inst, def);
|
|
15050
|
+
ZodType.init(inst, def);
|
|
15051
|
+
inst._zod.processJSONSchema = (ctx, json, params) => lazyProcessor(inst, ctx, json, params);
|
|
15052
|
+
inst.unwrap = () => inst._zod.def.getter();
|
|
15053
|
+
});
|
|
15054
|
+
function lazy(getter) {
|
|
15055
|
+
return new ZodLazy({
|
|
15056
|
+
type: "lazy",
|
|
15057
|
+
getter
|
|
15058
|
+
});
|
|
15059
|
+
}
|
|
15060
|
+
var ZodPromise = /* @__PURE__ */ $constructor("ZodPromise", (inst, def) => {
|
|
15061
|
+
$ZodPromise.init(inst, def);
|
|
15062
|
+
ZodType.init(inst, def);
|
|
15063
|
+
inst._zod.processJSONSchema = (ctx, json, params) => promiseProcessor(inst, ctx, json, params);
|
|
15064
|
+
inst.unwrap = () => inst._zod.def.innerType;
|
|
15065
|
+
});
|
|
15066
|
+
function promise(innerType) {
|
|
15067
|
+
return new ZodPromise({
|
|
15068
|
+
type: "promise",
|
|
15069
|
+
innerType
|
|
15070
|
+
});
|
|
15071
|
+
}
|
|
15072
|
+
var ZodFunction = /* @__PURE__ */ $constructor("ZodFunction", (inst, def) => {
|
|
15073
|
+
$ZodFunction.init(inst, def);
|
|
15074
|
+
ZodType.init(inst, def);
|
|
15075
|
+
inst._zod.processJSONSchema = (ctx, json, params) => functionProcessor(inst, ctx, json, params);
|
|
15076
|
+
});
|
|
15077
|
+
function _function(params) {
|
|
15078
|
+
return new ZodFunction({
|
|
15079
|
+
type: "function",
|
|
15080
|
+
input: Array.isArray(params?.input) ? tuple(params?.input) : params?.input ?? array(unknown()),
|
|
15081
|
+
output: params?.output ?? unknown()
|
|
15082
|
+
});
|
|
15083
|
+
}
|
|
15084
|
+
var ZodCustom = /* @__PURE__ */ $constructor("ZodCustom", (inst, def) => {
|
|
15085
|
+
$ZodCustom.init(inst, def);
|
|
15086
|
+
ZodType.init(inst, def);
|
|
15087
|
+
inst._zod.processJSONSchema = (ctx, json, params) => customProcessor(inst, ctx, json, params);
|
|
15088
|
+
});
|
|
15089
|
+
function check(fn) {
|
|
15090
|
+
const ch = new $ZodCheck({
|
|
15091
|
+
check: "custom"
|
|
15092
|
+
});
|
|
15093
|
+
ch._zod.check = fn;
|
|
15094
|
+
return ch;
|
|
15095
|
+
}
|
|
15096
|
+
function custom(fn, _params) {
|
|
15097
|
+
return _custom(ZodCustom, fn ?? (() => true), _params);
|
|
15098
|
+
}
|
|
15099
|
+
function refine(fn, _params = {}) {
|
|
15100
|
+
return _refine(ZodCustom, fn, _params);
|
|
15101
|
+
}
|
|
15102
|
+
function superRefine(fn, params) {
|
|
15103
|
+
return _superRefine(fn, params);
|
|
15104
|
+
}
|
|
15105
|
+
var describe2 = describe;
|
|
15106
|
+
var meta2 = meta;
|
|
15107
|
+
function _instanceof(cls, params = {}) {
|
|
15108
|
+
const inst = new ZodCustom({
|
|
15109
|
+
type: "custom",
|
|
15110
|
+
check: "custom",
|
|
15111
|
+
fn: (data) => data instanceof cls,
|
|
15112
|
+
abort: true,
|
|
15113
|
+
...exports_util.normalizeParams(params)
|
|
15114
|
+
});
|
|
15115
|
+
inst._zod.bag.Class = cls;
|
|
15116
|
+
inst._zod.check = (payload) => {
|
|
15117
|
+
if (!(payload.value instanceof cls)) {
|
|
15118
|
+
payload.issues.push({
|
|
15119
|
+
code: "invalid_type",
|
|
15120
|
+
expected: cls.name,
|
|
15121
|
+
input: payload.value,
|
|
15122
|
+
inst,
|
|
15123
|
+
path: [...inst._zod.def.path ?? []]
|
|
15124
|
+
});
|
|
15125
|
+
}
|
|
15126
|
+
};
|
|
15127
|
+
return inst;
|
|
15128
|
+
}
|
|
15129
|
+
var stringbool = (...args) => _stringbool({
|
|
15130
|
+
Codec: ZodCodec,
|
|
15131
|
+
Boolean: ZodBoolean,
|
|
15132
|
+
String: ZodString
|
|
15133
|
+
}, ...args);
|
|
15134
|
+
function json(params) {
|
|
15135
|
+
const jsonSchema = lazy(() => {
|
|
15136
|
+
return union([string2(params), number2(), boolean2(), _null3(), array(jsonSchema), record(string2(), jsonSchema)]);
|
|
15137
|
+
});
|
|
15138
|
+
return jsonSchema;
|
|
15139
|
+
}
|
|
15140
|
+
function preprocess(fn, schema) {
|
|
15141
|
+
return new ZodPreprocess({
|
|
15142
|
+
type: "pipe",
|
|
15143
|
+
in: transform(fn),
|
|
15144
|
+
out: schema
|
|
15145
|
+
});
|
|
15146
|
+
}
|
|
15147
|
+
// ../../../node_modules/.bun/zod@4.4.3/node_modules/zod/v4/classic/compat.js
|
|
15148
|
+
var ZodIssueCode = {
|
|
15149
|
+
invalid_type: "invalid_type",
|
|
15150
|
+
too_big: "too_big",
|
|
15151
|
+
too_small: "too_small",
|
|
15152
|
+
invalid_format: "invalid_format",
|
|
15153
|
+
not_multiple_of: "not_multiple_of",
|
|
15154
|
+
unrecognized_keys: "unrecognized_keys",
|
|
15155
|
+
invalid_union: "invalid_union",
|
|
15156
|
+
invalid_key: "invalid_key",
|
|
15157
|
+
invalid_element: "invalid_element",
|
|
15158
|
+
invalid_value: "invalid_value",
|
|
15159
|
+
custom: "custom"
|
|
15160
|
+
};
|
|
15161
|
+
function setErrorMap(map2) {
|
|
15162
|
+
config({
|
|
15163
|
+
customError: map2
|
|
15164
|
+
});
|
|
15165
|
+
}
|
|
15166
|
+
function getErrorMap() {
|
|
15167
|
+
return config().customError;
|
|
15168
|
+
}
|
|
15169
|
+
var ZodFirstPartyTypeKind;
|
|
15170
|
+
(function(ZodFirstPartyTypeKind2) {})(ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {}));
|
|
15171
|
+
// ../../../node_modules/.bun/zod@4.4.3/node_modules/zod/v4/classic/from-json-schema.js
|
|
15172
|
+
var z = {
|
|
15173
|
+
...exports_schemas2,
|
|
15174
|
+
...exports_checks2,
|
|
15175
|
+
iso: exports_iso
|
|
15176
|
+
};
|
|
15177
|
+
var RECOGNIZED_KEYS = /* @__PURE__ */ new Set([
|
|
15178
|
+
"$schema",
|
|
15179
|
+
"$ref",
|
|
15180
|
+
"$defs",
|
|
15181
|
+
"definitions",
|
|
15182
|
+
"$id",
|
|
15183
|
+
"id",
|
|
15184
|
+
"$comment",
|
|
15185
|
+
"$anchor",
|
|
15186
|
+
"$vocabulary",
|
|
15187
|
+
"$dynamicRef",
|
|
15188
|
+
"$dynamicAnchor",
|
|
15189
|
+
"type",
|
|
15190
|
+
"enum",
|
|
15191
|
+
"const",
|
|
15192
|
+
"anyOf",
|
|
15193
|
+
"oneOf",
|
|
15194
|
+
"allOf",
|
|
15195
|
+
"not",
|
|
15196
|
+
"properties",
|
|
15197
|
+
"required",
|
|
15198
|
+
"additionalProperties",
|
|
15199
|
+
"patternProperties",
|
|
15200
|
+
"propertyNames",
|
|
15201
|
+
"minProperties",
|
|
15202
|
+
"maxProperties",
|
|
15203
|
+
"items",
|
|
15204
|
+
"prefixItems",
|
|
15205
|
+
"additionalItems",
|
|
15206
|
+
"minItems",
|
|
15207
|
+
"maxItems",
|
|
15208
|
+
"uniqueItems",
|
|
15209
|
+
"contains",
|
|
15210
|
+
"minContains",
|
|
15211
|
+
"maxContains",
|
|
15212
|
+
"minLength",
|
|
15213
|
+
"maxLength",
|
|
15214
|
+
"pattern",
|
|
15215
|
+
"format",
|
|
15216
|
+
"minimum",
|
|
15217
|
+
"maximum",
|
|
15218
|
+
"exclusiveMinimum",
|
|
15219
|
+
"exclusiveMaximum",
|
|
15220
|
+
"multipleOf",
|
|
15221
|
+
"description",
|
|
15222
|
+
"default",
|
|
15223
|
+
"contentEncoding",
|
|
15224
|
+
"contentMediaType",
|
|
15225
|
+
"contentSchema",
|
|
15226
|
+
"unevaluatedItems",
|
|
15227
|
+
"unevaluatedProperties",
|
|
15228
|
+
"if",
|
|
15229
|
+
"then",
|
|
15230
|
+
"else",
|
|
15231
|
+
"dependentSchemas",
|
|
15232
|
+
"dependentRequired",
|
|
15233
|
+
"nullable",
|
|
15234
|
+
"readOnly"
|
|
15235
|
+
]);
|
|
15236
|
+
function detectVersion(schema, defaultTarget) {
|
|
15237
|
+
const $schema = schema.$schema;
|
|
15238
|
+
if ($schema === "https://json-schema.org/draft/2020-12/schema") {
|
|
15239
|
+
return "draft-2020-12";
|
|
15240
|
+
}
|
|
15241
|
+
if ($schema === "http://json-schema.org/draft-07/schema#") {
|
|
15242
|
+
return "draft-7";
|
|
15243
|
+
}
|
|
15244
|
+
if ($schema === "http://json-schema.org/draft-04/schema#") {
|
|
15245
|
+
return "draft-4";
|
|
15246
|
+
}
|
|
15247
|
+
return defaultTarget ?? "draft-2020-12";
|
|
15248
|
+
}
|
|
15249
|
+
function resolveRef(ref, ctx) {
|
|
15250
|
+
if (!ref.startsWith("#")) {
|
|
15251
|
+
throw new Error("External $ref is not supported, only local refs (#/...) are allowed");
|
|
15252
|
+
}
|
|
15253
|
+
const path = ref.slice(1).split("/").filter(Boolean);
|
|
15254
|
+
if (path.length === 0) {
|
|
15255
|
+
return ctx.rootSchema;
|
|
15256
|
+
}
|
|
15257
|
+
const defsKey = ctx.version === "draft-2020-12" ? "$defs" : "definitions";
|
|
15258
|
+
if (path[0] === defsKey) {
|
|
15259
|
+
const key = path[1];
|
|
15260
|
+
if (!key || !ctx.defs[key]) {
|
|
15261
|
+
throw new Error(`Reference not found: ${ref}`);
|
|
15262
|
+
}
|
|
15263
|
+
return ctx.defs[key];
|
|
15264
|
+
}
|
|
15265
|
+
throw new Error(`Reference not found: ${ref}`);
|
|
15266
|
+
}
|
|
15267
|
+
function convertBaseSchema(schema, ctx) {
|
|
15268
|
+
if (schema.not !== undefined) {
|
|
15269
|
+
if (typeof schema.not === "object" && Object.keys(schema.not).length === 0) {
|
|
15270
|
+
return z.never();
|
|
15271
|
+
}
|
|
15272
|
+
throw new Error("not is not supported in Zod (except { not: {} } for never)");
|
|
15273
|
+
}
|
|
15274
|
+
if (schema.unevaluatedItems !== undefined) {
|
|
15275
|
+
throw new Error("unevaluatedItems is not supported");
|
|
15276
|
+
}
|
|
15277
|
+
if (schema.unevaluatedProperties !== undefined) {
|
|
15278
|
+
throw new Error("unevaluatedProperties is not supported");
|
|
15279
|
+
}
|
|
15280
|
+
if (schema.if !== undefined || schema.then !== undefined || schema.else !== undefined) {
|
|
15281
|
+
throw new Error("Conditional schemas (if/then/else) are not supported");
|
|
15282
|
+
}
|
|
15283
|
+
if (schema.dependentSchemas !== undefined || schema.dependentRequired !== undefined) {
|
|
15284
|
+
throw new Error("dependentSchemas and dependentRequired are not supported");
|
|
15285
|
+
}
|
|
15286
|
+
if (schema.$ref) {
|
|
15287
|
+
const refPath = schema.$ref;
|
|
15288
|
+
if (ctx.refs.has(refPath)) {
|
|
15289
|
+
return ctx.refs.get(refPath);
|
|
15290
|
+
}
|
|
15291
|
+
if (ctx.processing.has(refPath)) {
|
|
15292
|
+
return z.lazy(() => {
|
|
15293
|
+
if (!ctx.refs.has(refPath)) {
|
|
15294
|
+
throw new Error(`Circular reference not resolved: ${refPath}`);
|
|
15295
|
+
}
|
|
15296
|
+
return ctx.refs.get(refPath);
|
|
15297
|
+
});
|
|
15298
|
+
}
|
|
15299
|
+
ctx.processing.add(refPath);
|
|
15300
|
+
const resolved = resolveRef(refPath, ctx);
|
|
15301
|
+
const zodSchema2 = convertSchema(resolved, ctx);
|
|
15302
|
+
ctx.refs.set(refPath, zodSchema2);
|
|
15303
|
+
ctx.processing.delete(refPath);
|
|
15304
|
+
return zodSchema2;
|
|
15305
|
+
}
|
|
15306
|
+
if (schema.enum !== undefined) {
|
|
15307
|
+
const enumValues = schema.enum;
|
|
15308
|
+
if (ctx.version === "openapi-3.0" && schema.nullable === true && enumValues.length === 1 && enumValues[0] === null) {
|
|
15309
|
+
return z.null();
|
|
15310
|
+
}
|
|
15311
|
+
if (enumValues.length === 0) {
|
|
15312
|
+
return z.never();
|
|
15313
|
+
}
|
|
15314
|
+
if (enumValues.length === 1) {
|
|
15315
|
+
return z.literal(enumValues[0]);
|
|
15316
|
+
}
|
|
15317
|
+
if (enumValues.every((v) => typeof v === "string")) {
|
|
15318
|
+
return z.enum(enumValues);
|
|
15319
|
+
}
|
|
15320
|
+
const literalSchemas = enumValues.map((v) => z.literal(v));
|
|
15321
|
+
if (literalSchemas.length < 2) {
|
|
15322
|
+
return literalSchemas[0];
|
|
15323
|
+
}
|
|
15324
|
+
return z.union([literalSchemas[0], literalSchemas[1], ...literalSchemas.slice(2)]);
|
|
15325
|
+
}
|
|
15326
|
+
if (schema.const !== undefined) {
|
|
15327
|
+
return z.literal(schema.const);
|
|
15328
|
+
}
|
|
15329
|
+
const type = schema.type;
|
|
15330
|
+
if (Array.isArray(type)) {
|
|
15331
|
+
const typeSchemas = type.map((t) => {
|
|
15332
|
+
const typeSchema = { ...schema, type: t };
|
|
15333
|
+
return convertBaseSchema(typeSchema, ctx);
|
|
15334
|
+
});
|
|
15335
|
+
if (typeSchemas.length === 0) {
|
|
15336
|
+
return z.never();
|
|
15337
|
+
}
|
|
15338
|
+
if (typeSchemas.length === 1) {
|
|
15339
|
+
return typeSchemas[0];
|
|
15340
|
+
}
|
|
15341
|
+
return z.union(typeSchemas);
|
|
15342
|
+
}
|
|
15343
|
+
if (!type) {
|
|
15344
|
+
return z.any();
|
|
15345
|
+
}
|
|
15346
|
+
let zodSchema;
|
|
15347
|
+
switch (type) {
|
|
15348
|
+
case "string": {
|
|
15349
|
+
let stringSchema = z.string();
|
|
15350
|
+
if (schema.format) {
|
|
15351
|
+
const format = schema.format;
|
|
15352
|
+
if (format === "email") {
|
|
15353
|
+
stringSchema = stringSchema.check(z.email());
|
|
15354
|
+
} else if (format === "uri" || format === "uri-reference") {
|
|
15355
|
+
stringSchema = stringSchema.check(z.url());
|
|
15356
|
+
} else if (format === "uuid" || format === "guid") {
|
|
15357
|
+
stringSchema = stringSchema.check(z.uuid());
|
|
15358
|
+
} else if (format === "date-time") {
|
|
15359
|
+
stringSchema = stringSchema.check(z.iso.datetime());
|
|
15360
|
+
} else if (format === "date") {
|
|
15361
|
+
stringSchema = stringSchema.check(z.iso.date());
|
|
15362
|
+
} else if (format === "time") {
|
|
15363
|
+
stringSchema = stringSchema.check(z.iso.time());
|
|
15364
|
+
} else if (format === "duration") {
|
|
15365
|
+
stringSchema = stringSchema.check(z.iso.duration());
|
|
15366
|
+
} else if (format === "ipv4") {
|
|
15367
|
+
stringSchema = stringSchema.check(z.ipv4());
|
|
15368
|
+
} else if (format === "ipv6") {
|
|
15369
|
+
stringSchema = stringSchema.check(z.ipv6());
|
|
15370
|
+
} else if (format === "mac") {
|
|
15371
|
+
stringSchema = stringSchema.check(z.mac());
|
|
15372
|
+
} else if (format === "cidr") {
|
|
15373
|
+
stringSchema = stringSchema.check(z.cidrv4());
|
|
15374
|
+
} else if (format === "cidr-v6") {
|
|
15375
|
+
stringSchema = stringSchema.check(z.cidrv6());
|
|
15376
|
+
} else if (format === "base64") {
|
|
15377
|
+
stringSchema = stringSchema.check(z.base64());
|
|
15378
|
+
} else if (format === "base64url") {
|
|
15379
|
+
stringSchema = stringSchema.check(z.base64url());
|
|
15380
|
+
} else if (format === "e164") {
|
|
15381
|
+
stringSchema = stringSchema.check(z.e164());
|
|
15382
|
+
} else if (format === "jwt") {
|
|
15383
|
+
stringSchema = stringSchema.check(z.jwt());
|
|
15384
|
+
} else if (format === "emoji") {
|
|
15385
|
+
stringSchema = stringSchema.check(z.emoji());
|
|
15386
|
+
} else if (format === "nanoid") {
|
|
15387
|
+
stringSchema = stringSchema.check(z.nanoid());
|
|
15388
|
+
} else if (format === "cuid") {
|
|
15389
|
+
stringSchema = stringSchema.check(z.cuid());
|
|
15390
|
+
} else if (format === "cuid2") {
|
|
15391
|
+
stringSchema = stringSchema.check(z.cuid2());
|
|
15392
|
+
} else if (format === "ulid") {
|
|
15393
|
+
stringSchema = stringSchema.check(z.ulid());
|
|
15394
|
+
} else if (format === "xid") {
|
|
15395
|
+
stringSchema = stringSchema.check(z.xid());
|
|
15396
|
+
} else if (format === "ksuid") {
|
|
15397
|
+
stringSchema = stringSchema.check(z.ksuid());
|
|
15398
|
+
}
|
|
15399
|
+
}
|
|
15400
|
+
if (typeof schema.minLength === "number") {
|
|
15401
|
+
stringSchema = stringSchema.min(schema.minLength);
|
|
15402
|
+
}
|
|
15403
|
+
if (typeof schema.maxLength === "number") {
|
|
15404
|
+
stringSchema = stringSchema.max(schema.maxLength);
|
|
15405
|
+
}
|
|
15406
|
+
if (schema.pattern) {
|
|
15407
|
+
stringSchema = stringSchema.regex(new RegExp(schema.pattern));
|
|
15408
|
+
}
|
|
15409
|
+
zodSchema = stringSchema;
|
|
15410
|
+
break;
|
|
15411
|
+
}
|
|
15412
|
+
case "number":
|
|
15413
|
+
case "integer": {
|
|
15414
|
+
let numberSchema = type === "integer" ? z.number().int() : z.number();
|
|
15415
|
+
if (typeof schema.minimum === "number") {
|
|
15416
|
+
numberSchema = numberSchema.min(schema.minimum);
|
|
15417
|
+
}
|
|
15418
|
+
if (typeof schema.maximum === "number") {
|
|
15419
|
+
numberSchema = numberSchema.max(schema.maximum);
|
|
15420
|
+
}
|
|
15421
|
+
if (typeof schema.exclusiveMinimum === "number") {
|
|
15422
|
+
numberSchema = numberSchema.gt(schema.exclusiveMinimum);
|
|
15423
|
+
} else if (schema.exclusiveMinimum === true && typeof schema.minimum === "number") {
|
|
15424
|
+
numberSchema = numberSchema.gt(schema.minimum);
|
|
15425
|
+
}
|
|
15426
|
+
if (typeof schema.exclusiveMaximum === "number") {
|
|
15427
|
+
numberSchema = numberSchema.lt(schema.exclusiveMaximum);
|
|
15428
|
+
} else if (schema.exclusiveMaximum === true && typeof schema.maximum === "number") {
|
|
15429
|
+
numberSchema = numberSchema.lt(schema.maximum);
|
|
15430
|
+
}
|
|
15431
|
+
if (typeof schema.multipleOf === "number") {
|
|
15432
|
+
numberSchema = numberSchema.multipleOf(schema.multipleOf);
|
|
15433
|
+
}
|
|
15434
|
+
zodSchema = numberSchema;
|
|
15435
|
+
break;
|
|
15436
|
+
}
|
|
15437
|
+
case "boolean": {
|
|
15438
|
+
zodSchema = z.boolean();
|
|
15439
|
+
break;
|
|
15440
|
+
}
|
|
15441
|
+
case "null": {
|
|
15442
|
+
zodSchema = z.null();
|
|
15443
|
+
break;
|
|
15444
|
+
}
|
|
15445
|
+
case "object": {
|
|
15446
|
+
const shape = {};
|
|
15447
|
+
const properties = schema.properties || {};
|
|
15448
|
+
const requiredSet = new Set(schema.required || []);
|
|
15449
|
+
for (const [key, propSchema] of Object.entries(properties)) {
|
|
15450
|
+
const propZodSchema = convertSchema(propSchema, ctx);
|
|
15451
|
+
shape[key] = requiredSet.has(key) ? propZodSchema : propZodSchema.optional();
|
|
15452
|
+
}
|
|
15453
|
+
if (schema.propertyNames) {
|
|
15454
|
+
const keySchema = convertSchema(schema.propertyNames, ctx);
|
|
15455
|
+
const valueSchema = schema.additionalProperties && typeof schema.additionalProperties === "object" ? convertSchema(schema.additionalProperties, ctx) : z.any();
|
|
15456
|
+
if (Object.keys(shape).length === 0) {
|
|
15457
|
+
zodSchema = z.record(keySchema, valueSchema);
|
|
15458
|
+
break;
|
|
15459
|
+
}
|
|
15460
|
+
const objectSchema2 = z.object(shape).passthrough();
|
|
15461
|
+
const recordSchema = z.looseRecord(keySchema, valueSchema);
|
|
15462
|
+
zodSchema = z.intersection(objectSchema2, recordSchema);
|
|
15463
|
+
break;
|
|
15464
|
+
}
|
|
15465
|
+
if (schema.patternProperties) {
|
|
15466
|
+
const patternProps = schema.patternProperties;
|
|
15467
|
+
const patternKeys = Object.keys(patternProps);
|
|
15468
|
+
const looseRecords = [];
|
|
15469
|
+
for (const pattern of patternKeys) {
|
|
15470
|
+
const patternValue = convertSchema(patternProps[pattern], ctx);
|
|
15471
|
+
const keySchema = z.string().regex(new RegExp(pattern));
|
|
15472
|
+
looseRecords.push(z.looseRecord(keySchema, patternValue));
|
|
15473
|
+
}
|
|
15474
|
+
const schemasToIntersect = [];
|
|
15475
|
+
if (Object.keys(shape).length > 0) {
|
|
15476
|
+
schemasToIntersect.push(z.object(shape).passthrough());
|
|
15477
|
+
}
|
|
15478
|
+
schemasToIntersect.push(...looseRecords);
|
|
15479
|
+
if (schemasToIntersect.length === 0) {
|
|
15480
|
+
zodSchema = z.object({}).passthrough();
|
|
15481
|
+
} else if (schemasToIntersect.length === 1) {
|
|
15482
|
+
zodSchema = schemasToIntersect[0];
|
|
15483
|
+
} else {
|
|
15484
|
+
let result = z.intersection(schemasToIntersect[0], schemasToIntersect[1]);
|
|
15485
|
+
for (let i = 2;i < schemasToIntersect.length; i++) {
|
|
15486
|
+
result = z.intersection(result, schemasToIntersect[i]);
|
|
15487
|
+
}
|
|
15488
|
+
zodSchema = result;
|
|
15489
|
+
}
|
|
15490
|
+
break;
|
|
15491
|
+
}
|
|
15492
|
+
const objectSchema = z.object(shape);
|
|
15493
|
+
if (schema.additionalProperties === false) {
|
|
15494
|
+
zodSchema = objectSchema.strict();
|
|
15495
|
+
} else if (typeof schema.additionalProperties === "object") {
|
|
15496
|
+
zodSchema = objectSchema.catchall(convertSchema(schema.additionalProperties, ctx));
|
|
15497
|
+
} else {
|
|
15498
|
+
zodSchema = objectSchema.passthrough();
|
|
15499
|
+
}
|
|
15500
|
+
break;
|
|
15501
|
+
}
|
|
15502
|
+
case "array": {
|
|
15503
|
+
const prefixItems = schema.prefixItems;
|
|
15504
|
+
const items = schema.items;
|
|
15505
|
+
if (prefixItems && Array.isArray(prefixItems)) {
|
|
15506
|
+
const tupleItems = prefixItems.map((item) => convertSchema(item, ctx));
|
|
15507
|
+
const rest = items && typeof items === "object" && !Array.isArray(items) ? convertSchema(items, ctx) : undefined;
|
|
15508
|
+
if (rest) {
|
|
15509
|
+
zodSchema = z.tuple(tupleItems).rest(rest);
|
|
15510
|
+
} else {
|
|
15511
|
+
zodSchema = z.tuple(tupleItems);
|
|
15512
|
+
}
|
|
15513
|
+
if (typeof schema.minItems === "number") {
|
|
15514
|
+
zodSchema = zodSchema.check(z.minLength(schema.minItems));
|
|
15515
|
+
}
|
|
15516
|
+
if (typeof schema.maxItems === "number") {
|
|
15517
|
+
zodSchema = zodSchema.check(z.maxLength(schema.maxItems));
|
|
15518
|
+
}
|
|
15519
|
+
} else if (Array.isArray(items)) {
|
|
15520
|
+
const tupleItems = items.map((item) => convertSchema(item, ctx));
|
|
15521
|
+
const rest = schema.additionalItems && typeof schema.additionalItems === "object" ? convertSchema(schema.additionalItems, ctx) : undefined;
|
|
15522
|
+
if (rest) {
|
|
15523
|
+
zodSchema = z.tuple(tupleItems).rest(rest);
|
|
15524
|
+
} else {
|
|
15525
|
+
zodSchema = z.tuple(tupleItems);
|
|
15526
|
+
}
|
|
15527
|
+
if (typeof schema.minItems === "number") {
|
|
15528
|
+
zodSchema = zodSchema.check(z.minLength(schema.minItems));
|
|
15529
|
+
}
|
|
15530
|
+
if (typeof schema.maxItems === "number") {
|
|
15531
|
+
zodSchema = zodSchema.check(z.maxLength(schema.maxItems));
|
|
15532
|
+
}
|
|
15533
|
+
} else if (items !== undefined) {
|
|
15534
|
+
const element = convertSchema(items, ctx);
|
|
15535
|
+
let arraySchema = z.array(element);
|
|
15536
|
+
if (typeof schema.minItems === "number") {
|
|
15537
|
+
arraySchema = arraySchema.min(schema.minItems);
|
|
15538
|
+
}
|
|
15539
|
+
if (typeof schema.maxItems === "number") {
|
|
15540
|
+
arraySchema = arraySchema.max(schema.maxItems);
|
|
15541
|
+
}
|
|
15542
|
+
zodSchema = arraySchema;
|
|
15543
|
+
} else {
|
|
15544
|
+
zodSchema = z.array(z.any());
|
|
15545
|
+
}
|
|
15546
|
+
break;
|
|
15547
|
+
}
|
|
15548
|
+
default:
|
|
15549
|
+
throw new Error(`Unsupported type: ${type}`);
|
|
15550
|
+
}
|
|
15551
|
+
return zodSchema;
|
|
15552
|
+
}
|
|
15553
|
+
function convertSchema(schema, ctx) {
|
|
15554
|
+
if (typeof schema === "boolean") {
|
|
15555
|
+
return schema ? z.any() : z.never();
|
|
15556
|
+
}
|
|
15557
|
+
let baseSchema = convertBaseSchema(schema, ctx);
|
|
15558
|
+
const hasExplicitType = schema.type || schema.enum !== undefined || schema.const !== undefined;
|
|
15559
|
+
if (schema.anyOf && Array.isArray(schema.anyOf)) {
|
|
15560
|
+
const options = schema.anyOf.map((s) => convertSchema(s, ctx));
|
|
15561
|
+
const anyOfUnion = z.union(options);
|
|
15562
|
+
baseSchema = hasExplicitType ? z.intersection(baseSchema, anyOfUnion) : anyOfUnion;
|
|
15563
|
+
}
|
|
15564
|
+
if (schema.oneOf && Array.isArray(schema.oneOf)) {
|
|
15565
|
+
const options = schema.oneOf.map((s) => convertSchema(s, ctx));
|
|
15566
|
+
const oneOfUnion = z.xor(options);
|
|
15567
|
+
baseSchema = hasExplicitType ? z.intersection(baseSchema, oneOfUnion) : oneOfUnion;
|
|
15568
|
+
}
|
|
15569
|
+
if (schema.allOf && Array.isArray(schema.allOf)) {
|
|
15570
|
+
if (schema.allOf.length === 0) {
|
|
15571
|
+
baseSchema = hasExplicitType ? baseSchema : z.any();
|
|
15572
|
+
} else {
|
|
15573
|
+
let result = hasExplicitType ? baseSchema : convertSchema(schema.allOf[0], ctx);
|
|
15574
|
+
const startIdx = hasExplicitType ? 0 : 1;
|
|
15575
|
+
for (let i = startIdx;i < schema.allOf.length; i++) {
|
|
15576
|
+
result = z.intersection(result, convertSchema(schema.allOf[i], ctx));
|
|
15577
|
+
}
|
|
15578
|
+
baseSchema = result;
|
|
15579
|
+
}
|
|
15580
|
+
}
|
|
15581
|
+
if (schema.nullable === true && ctx.version === "openapi-3.0") {
|
|
15582
|
+
baseSchema = z.nullable(baseSchema);
|
|
15583
|
+
}
|
|
15584
|
+
if (schema.readOnly === true) {
|
|
15585
|
+
baseSchema = z.readonly(baseSchema);
|
|
15586
|
+
}
|
|
15587
|
+
if (schema.default !== undefined) {
|
|
15588
|
+
baseSchema = baseSchema.default(schema.default);
|
|
15589
|
+
}
|
|
15590
|
+
const extraMeta = {};
|
|
15591
|
+
const coreMetadataKeys = ["$id", "id", "$comment", "$anchor", "$vocabulary", "$dynamicRef", "$dynamicAnchor"];
|
|
15592
|
+
for (const key of coreMetadataKeys) {
|
|
15593
|
+
if (key in schema) {
|
|
15594
|
+
extraMeta[key] = schema[key];
|
|
15595
|
+
}
|
|
15596
|
+
}
|
|
15597
|
+
const contentMetadataKeys = ["contentEncoding", "contentMediaType", "contentSchema"];
|
|
15598
|
+
for (const key of contentMetadataKeys) {
|
|
15599
|
+
if (key in schema) {
|
|
15600
|
+
extraMeta[key] = schema[key];
|
|
15601
|
+
}
|
|
15602
|
+
}
|
|
15603
|
+
for (const key of Object.keys(schema)) {
|
|
15604
|
+
if (!RECOGNIZED_KEYS.has(key)) {
|
|
15605
|
+
extraMeta[key] = schema[key];
|
|
15606
|
+
}
|
|
15607
|
+
}
|
|
15608
|
+
if (Object.keys(extraMeta).length > 0) {
|
|
15609
|
+
ctx.registry.add(baseSchema, extraMeta);
|
|
15610
|
+
}
|
|
15611
|
+
if (schema.description) {
|
|
15612
|
+
baseSchema = baseSchema.describe(schema.description);
|
|
15613
|
+
}
|
|
15614
|
+
return baseSchema;
|
|
15615
|
+
}
|
|
15616
|
+
function fromJSONSchema(schema, params) {
|
|
15617
|
+
if (typeof schema === "boolean") {
|
|
15618
|
+
return schema ? z.any() : z.never();
|
|
15619
|
+
}
|
|
15620
|
+
let normalized;
|
|
15621
|
+
try {
|
|
15622
|
+
normalized = JSON.parse(JSON.stringify(schema));
|
|
15623
|
+
} catch {
|
|
15624
|
+
throw new Error("fromJSONSchema input is not valid JSON (possibly cyclic); use $defs/$ref for recursive schemas");
|
|
15625
|
+
}
|
|
15626
|
+
const version2 = detectVersion(normalized, params?.defaultTarget);
|
|
15627
|
+
const defs = normalized.$defs || normalized.definitions || {};
|
|
15628
|
+
const ctx = {
|
|
15629
|
+
version: version2,
|
|
15630
|
+
defs,
|
|
15631
|
+
refs: new Map,
|
|
15632
|
+
processing: new Set,
|
|
15633
|
+
rootSchema: normalized,
|
|
15634
|
+
registry: params?.registry ?? globalRegistry
|
|
15635
|
+
};
|
|
15636
|
+
return convertSchema(normalized, ctx);
|
|
15637
|
+
}
|
|
15638
|
+
// ../../../node_modules/.bun/zod@4.4.3/node_modules/zod/v4/classic/coerce.js
|
|
15639
|
+
var exports_coerce = {};
|
|
15640
|
+
__export(exports_coerce, {
|
|
15641
|
+
string: () => string3,
|
|
15642
|
+
number: () => number3,
|
|
15643
|
+
date: () => date4,
|
|
15644
|
+
boolean: () => boolean3,
|
|
15645
|
+
bigint: () => bigint3
|
|
15646
|
+
});
|
|
15647
|
+
function string3(params) {
|
|
15648
|
+
return _coercedString(ZodString, params);
|
|
15649
|
+
}
|
|
15650
|
+
function number3(params) {
|
|
15651
|
+
return _coercedNumber(ZodNumber, params);
|
|
15652
|
+
}
|
|
15653
|
+
function boolean3(params) {
|
|
15654
|
+
return _coercedBoolean(ZodBoolean, params);
|
|
15655
|
+
}
|
|
15656
|
+
function bigint3(params) {
|
|
15657
|
+
return _coercedBigint(ZodBigInt, params);
|
|
15658
|
+
}
|
|
15659
|
+
function date4(params) {
|
|
15660
|
+
return _coercedDate(ZodDate, params);
|
|
15661
|
+
}
|
|
15662
|
+
|
|
15663
|
+
// ../../../node_modules/.bun/zod@4.4.3/node_modules/zod/v4/classic/external.js
|
|
15664
|
+
config(en_default());
|
|
15665
|
+
// src/definitions/steps/step-features.ts
|
|
15666
|
+
var FEEDBACK_REQUEST_SIGNAL_KEY = "$boboddy_feedback_request_v1";
|
|
15667
|
+
var feedbackRequestItemSchema = exports_external.object({
|
|
15668
|
+
question: exports_external.string(),
|
|
15669
|
+
category: exports_external.string(),
|
|
15670
|
+
suggestedKey: exports_external.string().optional()
|
|
15671
|
+
});
|
|
15672
|
+
var feedbackRequestsFeature = {
|
|
15673
|
+
_resultExtension: exports_external.object({
|
|
15674
|
+
feedbackRequests: exports_external.array(feedbackRequestItemSchema).optional()
|
|
15675
|
+
}),
|
|
15676
|
+
_promptAddition: [
|
|
15677
|
+
"## Feedback Requests",
|
|
15678
|
+
"",
|
|
15679
|
+
"If you encounter anything that warrants human review, populate the `feedbackRequests` array:",
|
|
15680
|
+
"- **question**: The specific question to pose to a human reviewer",
|
|
15681
|
+
'- **category**: A grouping label for the feedback (e.g. `"accuracy"`, `"completeness"`)',
|
|
15682
|
+
"- **suggestedKey** *(optional)*: A suggested answer key for reference"
|
|
15683
|
+
].join(`
|
|
15684
|
+
`),
|
|
15685
|
+
_signals: [
|
|
15686
|
+
{
|
|
15687
|
+
key: FEEDBACK_REQUEST_SIGNAL_KEY,
|
|
15688
|
+
sourcePath: "feedbackRequests",
|
|
15689
|
+
type: "array",
|
|
15690
|
+
required: false
|
|
15691
|
+
}
|
|
15692
|
+
]
|
|
15693
|
+
};
|
|
15694
|
+
var Features = {
|
|
15695
|
+
feedbackRequests: Object.assign(() => feedbackRequestsFeature, {
|
|
15696
|
+
signal: {
|
|
15697
|
+
key: FEEDBACK_REQUEST_SIGNAL_KEY,
|
|
15698
|
+
find(signals) {
|
|
15699
|
+
const match = signals.find((s) => s.key === FEEDBACK_REQUEST_SIGNAL_KEY);
|
|
15700
|
+
if (!match)
|
|
15701
|
+
return;
|
|
15702
|
+
const parsed = exports_external.array(feedbackRequestItemSchema).safeParse(match.valueJson);
|
|
15703
|
+
return parsed.success ? parsed.data : undefined;
|
|
15704
|
+
}
|
|
15705
|
+
}
|
|
15706
|
+
})
|
|
15707
|
+
};
|
|
13299
15708
|
export {
|
|
13300
15709
|
defineStep,
|
|
13301
|
-
createStepDefinitionsClient
|
|
15710
|
+
createStepDefinitionsClient,
|
|
15711
|
+
Features
|
|
13302
15712
|
};
|