devbcn-mcp-server 0.0.0-202512151700 → 0.0.0-202512160510
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bun.lock +3 -3
- package/dist/index.js +279 -72
- package/package.json +1 -1
package/bun.lock
CHANGED
|
@@ -149,9 +149,9 @@
|
|
|
149
149
|
|
|
150
150
|
"safer-buffer": ["safer-buffer@2.1.2", "", {}, "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg=="],
|
|
151
151
|
|
|
152
|
-
"send": ["send@1.2.
|
|
152
|
+
"send": ["send@1.2.1", "", { "dependencies": { "debug": "^4.4.3", "encodeurl": "^2.0.0", "escape-html": "^1.0.3", "etag": "^1.8.1", "fresh": "^2.0.0", "http-errors": "^2.0.1", "mime-types": "^3.0.2", "ms": "^2.1.3", "on-finished": "^2.4.1", "range-parser": "^1.2.1", "statuses": "^2.0.2" } }, "sha512-1gnZf7DFcoIcajTjTwjwuDjzuz4PPcY2StKPlsGAQ1+YH20IRVrBaXSWmdjowTJ6u8Rc01PoYOGHXfP1mYcZNQ=="],
|
|
153
153
|
|
|
154
|
-
"serve-static": ["serve-static@2.2.
|
|
154
|
+
"serve-static": ["serve-static@2.2.1", "", { "dependencies": { "encodeurl": "^2.0.0", "escape-html": "^1.0.3", "parseurl": "^1.3.3", "send": "^1.2.0" } }, "sha512-xRXBn0pPqQTVQiC8wyQrKs2MOlX24zQ0POGaj0kultvoOCstBQM5yvOhAVSUwOMjQtTvsPWoNCHfPGwaaQJhTw=="],
|
|
155
155
|
|
|
156
156
|
"setprototypeof": ["setprototypeof@1.2.0", "", {}, "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw=="],
|
|
157
157
|
|
|
@@ -181,7 +181,7 @@
|
|
|
181
181
|
|
|
182
182
|
"wrappy": ["wrappy@1.0.2", "", {}, "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ=="],
|
|
183
183
|
|
|
184
|
-
"zod": ["zod@4.2.
|
|
184
|
+
"zod": ["zod@4.2.1", "", {}, "sha512-0wZ1IRqGGhMP76gLqz8EyfBXKk0J2qo2+H3fi4mcUP/KtTocoX08nmIAHl1Z2kJIZbZee8KOpBCSNPRgauucjw=="],
|
|
185
185
|
|
|
186
186
|
"zod-to-json-schema": ["zod-to-json-schema@3.25.0", "", { "peerDependencies": { "zod": "^3.25 || ^4" } }, "sha512-HvWtU2UG41LALjajJrML6uQejQhNJx+JBO9IflpSja4R03iNWfKXrj6W2h7ljuLyc1nKS+9yDyL/9tD1U/yBnQ=="],
|
|
187
187
|
}
|
package/dist/index.js
CHANGED
|
@@ -35449,7 +35449,7 @@ class Doc {
|
|
|
35449
35449
|
var version = {
|
|
35450
35450
|
major: 4,
|
|
35451
35451
|
minor: 2,
|
|
35452
|
-
patch:
|
|
35452
|
+
patch: 1
|
|
35453
35453
|
};
|
|
35454
35454
|
|
|
35455
35455
|
// node_modules/zod/v4/core/schemas.js
|
|
@@ -45334,6 +45334,208 @@ __export(exports_external, {
|
|
|
45334
45334
|
$input: () => $input,
|
|
45335
45335
|
$brand: () => $brand
|
|
45336
45336
|
});
|
|
45337
|
+
|
|
45338
|
+
// node_modules/zod/v4/classic/schemas.js
|
|
45339
|
+
var exports_schemas2 = {};
|
|
45340
|
+
__export(exports_schemas2, {
|
|
45341
|
+
xor: () => xor,
|
|
45342
|
+
xid: () => xid2,
|
|
45343
|
+
void: () => _void2,
|
|
45344
|
+
uuidv7: () => uuidv7,
|
|
45345
|
+
uuidv6: () => uuidv6,
|
|
45346
|
+
uuidv4: () => uuidv4,
|
|
45347
|
+
uuid: () => uuid2,
|
|
45348
|
+
url: () => url,
|
|
45349
|
+
unknown: () => unknown,
|
|
45350
|
+
union: () => union,
|
|
45351
|
+
undefined: () => _undefined3,
|
|
45352
|
+
ulid: () => ulid2,
|
|
45353
|
+
uint64: () => uint64,
|
|
45354
|
+
uint32: () => uint32,
|
|
45355
|
+
tuple: () => tuple,
|
|
45356
|
+
transform: () => transform,
|
|
45357
|
+
templateLiteral: () => templateLiteral,
|
|
45358
|
+
symbol: () => symbol,
|
|
45359
|
+
superRefine: () => superRefine,
|
|
45360
|
+
success: () => success,
|
|
45361
|
+
stringbool: () => stringbool,
|
|
45362
|
+
stringFormat: () => stringFormat,
|
|
45363
|
+
string: () => string2,
|
|
45364
|
+
strictObject: () => strictObject,
|
|
45365
|
+
set: () => set,
|
|
45366
|
+
refine: () => refine,
|
|
45367
|
+
record: () => record,
|
|
45368
|
+
readonly: () => readonly,
|
|
45369
|
+
promise: () => promise,
|
|
45370
|
+
preprocess: () => preprocess,
|
|
45371
|
+
prefault: () => prefault,
|
|
45372
|
+
pipe: () => pipe,
|
|
45373
|
+
partialRecord: () => partialRecord,
|
|
45374
|
+
optional: () => optional,
|
|
45375
|
+
object: () => object2,
|
|
45376
|
+
number: () => number2,
|
|
45377
|
+
nullish: () => nullish2,
|
|
45378
|
+
nullable: () => nullable,
|
|
45379
|
+
null: () => _null3,
|
|
45380
|
+
nonoptional: () => nonoptional,
|
|
45381
|
+
never: () => never,
|
|
45382
|
+
nativeEnum: () => nativeEnum,
|
|
45383
|
+
nanoid: () => nanoid2,
|
|
45384
|
+
nan: () => nan,
|
|
45385
|
+
meta: () => meta2,
|
|
45386
|
+
map: () => map,
|
|
45387
|
+
mac: () => mac2,
|
|
45388
|
+
looseRecord: () => looseRecord,
|
|
45389
|
+
looseObject: () => looseObject,
|
|
45390
|
+
literal: () => literal,
|
|
45391
|
+
lazy: () => lazy,
|
|
45392
|
+
ksuid: () => ksuid2,
|
|
45393
|
+
keyof: () => keyof,
|
|
45394
|
+
jwt: () => jwt,
|
|
45395
|
+
json: () => json,
|
|
45396
|
+
ipv6: () => ipv62,
|
|
45397
|
+
ipv4: () => ipv42,
|
|
45398
|
+
intersection: () => intersection,
|
|
45399
|
+
int64: () => int64,
|
|
45400
|
+
int32: () => int32,
|
|
45401
|
+
int: () => int,
|
|
45402
|
+
instanceof: () => _instanceof,
|
|
45403
|
+
httpUrl: () => httpUrl,
|
|
45404
|
+
hostname: () => hostname2,
|
|
45405
|
+
hex: () => hex2,
|
|
45406
|
+
hash: () => hash,
|
|
45407
|
+
guid: () => guid2,
|
|
45408
|
+
function: () => _function,
|
|
45409
|
+
float64: () => float64,
|
|
45410
|
+
float32: () => float32,
|
|
45411
|
+
file: () => file,
|
|
45412
|
+
enum: () => _enum2,
|
|
45413
|
+
emoji: () => emoji2,
|
|
45414
|
+
email: () => email2,
|
|
45415
|
+
e164: () => e1642,
|
|
45416
|
+
discriminatedUnion: () => discriminatedUnion,
|
|
45417
|
+
describe: () => describe2,
|
|
45418
|
+
date: () => date3,
|
|
45419
|
+
custom: () => custom,
|
|
45420
|
+
cuid2: () => cuid22,
|
|
45421
|
+
cuid: () => cuid3,
|
|
45422
|
+
codec: () => codec,
|
|
45423
|
+
cidrv6: () => cidrv62,
|
|
45424
|
+
cidrv4: () => cidrv42,
|
|
45425
|
+
check: () => check,
|
|
45426
|
+
catch: () => _catch2,
|
|
45427
|
+
boolean: () => boolean2,
|
|
45428
|
+
bigint: () => bigint2,
|
|
45429
|
+
base64url: () => base64url2,
|
|
45430
|
+
base64: () => base642,
|
|
45431
|
+
array: () => array,
|
|
45432
|
+
any: () => any,
|
|
45433
|
+
_function: () => _function,
|
|
45434
|
+
_default: () => _default2,
|
|
45435
|
+
_ZodString: () => _ZodString,
|
|
45436
|
+
ZodXor: () => ZodXor,
|
|
45437
|
+
ZodXID: () => ZodXID,
|
|
45438
|
+
ZodVoid: () => ZodVoid2,
|
|
45439
|
+
ZodUnknown: () => ZodUnknown2,
|
|
45440
|
+
ZodUnion: () => ZodUnion2,
|
|
45441
|
+
ZodUndefined: () => ZodUndefined2,
|
|
45442
|
+
ZodUUID: () => ZodUUID,
|
|
45443
|
+
ZodURL: () => ZodURL,
|
|
45444
|
+
ZodULID: () => ZodULID,
|
|
45445
|
+
ZodType: () => ZodType2,
|
|
45446
|
+
ZodTuple: () => ZodTuple2,
|
|
45447
|
+
ZodTransform: () => ZodTransform,
|
|
45448
|
+
ZodTemplateLiteral: () => ZodTemplateLiteral,
|
|
45449
|
+
ZodSymbol: () => ZodSymbol2,
|
|
45450
|
+
ZodSuccess: () => ZodSuccess,
|
|
45451
|
+
ZodStringFormat: () => ZodStringFormat,
|
|
45452
|
+
ZodString: () => ZodString2,
|
|
45453
|
+
ZodSet: () => ZodSet2,
|
|
45454
|
+
ZodRecord: () => ZodRecord2,
|
|
45455
|
+
ZodReadonly: () => ZodReadonly2,
|
|
45456
|
+
ZodPromise: () => ZodPromise2,
|
|
45457
|
+
ZodPrefault: () => ZodPrefault,
|
|
45458
|
+
ZodPipe: () => ZodPipe,
|
|
45459
|
+
ZodOptional: () => ZodOptional2,
|
|
45460
|
+
ZodObject: () => ZodObject2,
|
|
45461
|
+
ZodNumberFormat: () => ZodNumberFormat,
|
|
45462
|
+
ZodNumber: () => ZodNumber2,
|
|
45463
|
+
ZodNullable: () => ZodNullable2,
|
|
45464
|
+
ZodNull: () => ZodNull2,
|
|
45465
|
+
ZodNonOptional: () => ZodNonOptional,
|
|
45466
|
+
ZodNever: () => ZodNever2,
|
|
45467
|
+
ZodNanoID: () => ZodNanoID,
|
|
45468
|
+
ZodNaN: () => ZodNaN2,
|
|
45469
|
+
ZodMap: () => ZodMap2,
|
|
45470
|
+
ZodMAC: () => ZodMAC,
|
|
45471
|
+
ZodLiteral: () => ZodLiteral2,
|
|
45472
|
+
ZodLazy: () => ZodLazy2,
|
|
45473
|
+
ZodKSUID: () => ZodKSUID,
|
|
45474
|
+
ZodJWT: () => ZodJWT,
|
|
45475
|
+
ZodIntersection: () => ZodIntersection2,
|
|
45476
|
+
ZodIPv6: () => ZodIPv6,
|
|
45477
|
+
ZodIPv4: () => ZodIPv4,
|
|
45478
|
+
ZodGUID: () => ZodGUID,
|
|
45479
|
+
ZodFunction: () => ZodFunction2,
|
|
45480
|
+
ZodFile: () => ZodFile,
|
|
45481
|
+
ZodEnum: () => ZodEnum2,
|
|
45482
|
+
ZodEmoji: () => ZodEmoji,
|
|
45483
|
+
ZodEmail: () => ZodEmail,
|
|
45484
|
+
ZodE164: () => ZodE164,
|
|
45485
|
+
ZodDiscriminatedUnion: () => ZodDiscriminatedUnion2,
|
|
45486
|
+
ZodDefault: () => ZodDefault2,
|
|
45487
|
+
ZodDate: () => ZodDate2,
|
|
45488
|
+
ZodCustomStringFormat: () => ZodCustomStringFormat,
|
|
45489
|
+
ZodCustom: () => ZodCustom,
|
|
45490
|
+
ZodCodec: () => ZodCodec,
|
|
45491
|
+
ZodCatch: () => ZodCatch2,
|
|
45492
|
+
ZodCUID2: () => ZodCUID2,
|
|
45493
|
+
ZodCUID: () => ZodCUID,
|
|
45494
|
+
ZodCIDRv6: () => ZodCIDRv6,
|
|
45495
|
+
ZodCIDRv4: () => ZodCIDRv4,
|
|
45496
|
+
ZodBoolean: () => ZodBoolean2,
|
|
45497
|
+
ZodBigIntFormat: () => ZodBigIntFormat,
|
|
45498
|
+
ZodBigInt: () => ZodBigInt2,
|
|
45499
|
+
ZodBase64URL: () => ZodBase64URL,
|
|
45500
|
+
ZodBase64: () => ZodBase64,
|
|
45501
|
+
ZodArray: () => ZodArray2,
|
|
45502
|
+
ZodAny: () => ZodAny2
|
|
45503
|
+
});
|
|
45504
|
+
|
|
45505
|
+
// node_modules/zod/v4/classic/checks.js
|
|
45506
|
+
var exports_checks2 = {};
|
|
45507
|
+
__export(exports_checks2, {
|
|
45508
|
+
uppercase: () => _uppercase,
|
|
45509
|
+
trim: () => _trim,
|
|
45510
|
+
toUpperCase: () => _toUpperCase,
|
|
45511
|
+
toLowerCase: () => _toLowerCase,
|
|
45512
|
+
startsWith: () => _startsWith,
|
|
45513
|
+
slugify: () => _slugify,
|
|
45514
|
+
size: () => _size,
|
|
45515
|
+
regex: () => _regex,
|
|
45516
|
+
property: () => _property,
|
|
45517
|
+
positive: () => _positive,
|
|
45518
|
+
overwrite: () => _overwrite,
|
|
45519
|
+
normalize: () => _normalize,
|
|
45520
|
+
nonpositive: () => _nonpositive,
|
|
45521
|
+
nonnegative: () => _nonnegative,
|
|
45522
|
+
negative: () => _negative,
|
|
45523
|
+
multipleOf: () => _multipleOf,
|
|
45524
|
+
minSize: () => _minSize,
|
|
45525
|
+
minLength: () => _minLength,
|
|
45526
|
+
mime: () => _mime,
|
|
45527
|
+
maxSize: () => _maxSize,
|
|
45528
|
+
maxLength: () => _maxLength,
|
|
45529
|
+
lte: () => _lte,
|
|
45530
|
+
lt: () => _lt,
|
|
45531
|
+
lowercase: () => _lowercase,
|
|
45532
|
+
length: () => _length,
|
|
45533
|
+
includes: () => _includes,
|
|
45534
|
+
gte: () => _gte,
|
|
45535
|
+
gt: () => _gt,
|
|
45536
|
+
endsWith: () => _endsWith
|
|
45537
|
+
});
|
|
45538
|
+
|
|
45337
45539
|
// node_modules/zod/v4/classic/iso.js
|
|
45338
45540
|
var exports_iso2 = {};
|
|
45339
45541
|
__export(exports_iso2, {
|
|
@@ -46495,6 +46697,11 @@ function getErrorMap2() {
|
|
|
46495
46697
|
var ZodFirstPartyTypeKind2;
|
|
46496
46698
|
(function(ZodFirstPartyTypeKind3) {})(ZodFirstPartyTypeKind2 || (ZodFirstPartyTypeKind2 = {}));
|
|
46497
46699
|
// node_modules/zod/v4/classic/from-json-schema.js
|
|
46700
|
+
var z = {
|
|
46701
|
+
...exports_schemas2,
|
|
46702
|
+
...exports_checks2,
|
|
46703
|
+
iso: exports_iso2
|
|
46704
|
+
};
|
|
46498
46705
|
function detectVersion(schema, defaultTarget) {
|
|
46499
46706
|
const $schema = schema.$schema;
|
|
46500
46707
|
if ($schema === "https://json-schema.org/draft/2020-12/schema") {
|
|
@@ -46529,7 +46736,7 @@ function resolveRef(ref, ctx) {
|
|
|
46529
46736
|
function convertBaseSchema(schema, ctx) {
|
|
46530
46737
|
if (schema.not !== undefined) {
|
|
46531
46738
|
if (typeof schema.not === "object" && Object.keys(schema.not).length === 0) {
|
|
46532
|
-
return never();
|
|
46739
|
+
return z.never();
|
|
46533
46740
|
}
|
|
46534
46741
|
throw new Error("not is not supported in Zod (except { not: {} } for never)");
|
|
46535
46742
|
}
|
|
@@ -46551,7 +46758,7 @@ function convertBaseSchema(schema, ctx) {
|
|
|
46551
46758
|
return ctx.refs.get(refPath);
|
|
46552
46759
|
}
|
|
46553
46760
|
if (ctx.processing.has(refPath)) {
|
|
46554
|
-
return lazy(() => {
|
|
46761
|
+
return z.lazy(() => {
|
|
46555
46762
|
if (!ctx.refs.has(refPath)) {
|
|
46556
46763
|
throw new Error(`Circular reference not resolved: ${refPath}`);
|
|
46557
46764
|
}
|
|
@@ -46568,25 +46775,25 @@ function convertBaseSchema(schema, ctx) {
|
|
|
46568
46775
|
if (schema.enum !== undefined) {
|
|
46569
46776
|
const enumValues = schema.enum;
|
|
46570
46777
|
if (ctx.version === "openapi-3.0" && schema.nullable === true && enumValues.length === 1 && enumValues[0] === null) {
|
|
46571
|
-
return
|
|
46778
|
+
return z.null();
|
|
46572
46779
|
}
|
|
46573
46780
|
if (enumValues.length === 0) {
|
|
46574
|
-
return never();
|
|
46781
|
+
return z.never();
|
|
46575
46782
|
}
|
|
46576
46783
|
if (enumValues.length === 1) {
|
|
46577
|
-
return literal(enumValues[0]);
|
|
46784
|
+
return z.literal(enumValues[0]);
|
|
46578
46785
|
}
|
|
46579
46786
|
if (enumValues.every((v) => typeof v === "string")) {
|
|
46580
|
-
return
|
|
46787
|
+
return z.enum(enumValues);
|
|
46581
46788
|
}
|
|
46582
|
-
const literalSchemas = enumValues.map((v) => literal(v));
|
|
46789
|
+
const literalSchemas = enumValues.map((v) => z.literal(v));
|
|
46583
46790
|
if (literalSchemas.length < 2) {
|
|
46584
46791
|
return literalSchemas[0];
|
|
46585
46792
|
}
|
|
46586
|
-
return union([literalSchemas[0], literalSchemas[1], ...literalSchemas.slice(2)]);
|
|
46793
|
+
return z.union([literalSchemas[0], literalSchemas[1], ...literalSchemas.slice(2)]);
|
|
46587
46794
|
}
|
|
46588
46795
|
if (schema.const !== undefined) {
|
|
46589
|
-
return literal(schema.const);
|
|
46796
|
+
return z.literal(schema.const);
|
|
46590
46797
|
}
|
|
46591
46798
|
const type = schema.type;
|
|
46592
46799
|
if (Array.isArray(type)) {
|
|
@@ -46595,68 +46802,68 @@ function convertBaseSchema(schema, ctx) {
|
|
|
46595
46802
|
return convertBaseSchema(typeSchema, ctx);
|
|
46596
46803
|
});
|
|
46597
46804
|
if (typeSchemas.length === 0) {
|
|
46598
|
-
return never();
|
|
46805
|
+
return z.never();
|
|
46599
46806
|
}
|
|
46600
46807
|
if (typeSchemas.length === 1) {
|
|
46601
46808
|
return typeSchemas[0];
|
|
46602
46809
|
}
|
|
46603
|
-
return union(typeSchemas);
|
|
46810
|
+
return z.union(typeSchemas);
|
|
46604
46811
|
}
|
|
46605
46812
|
if (!type) {
|
|
46606
|
-
return any();
|
|
46813
|
+
return z.any();
|
|
46607
46814
|
}
|
|
46608
46815
|
let zodSchema;
|
|
46609
46816
|
switch (type) {
|
|
46610
46817
|
case "string": {
|
|
46611
|
-
let stringSchema =
|
|
46818
|
+
let stringSchema = z.string();
|
|
46612
46819
|
if (schema.format) {
|
|
46613
46820
|
const format = schema.format;
|
|
46614
46821
|
if (format === "email") {
|
|
46615
|
-
stringSchema = stringSchema.check(
|
|
46822
|
+
stringSchema = stringSchema.check(z.email());
|
|
46616
46823
|
} else if (format === "uri" || format === "uri-reference") {
|
|
46617
|
-
stringSchema = stringSchema.check(url());
|
|
46824
|
+
stringSchema = stringSchema.check(z.url());
|
|
46618
46825
|
} else if (format === "uuid" || format === "guid") {
|
|
46619
|
-
stringSchema = stringSchema.check(
|
|
46826
|
+
stringSchema = stringSchema.check(z.uuid());
|
|
46620
46827
|
} else if (format === "date-time") {
|
|
46621
|
-
stringSchema = stringSchema.check(
|
|
46828
|
+
stringSchema = stringSchema.check(z.iso.datetime());
|
|
46622
46829
|
} else if (format === "date") {
|
|
46623
|
-
stringSchema = stringSchema.check(
|
|
46830
|
+
stringSchema = stringSchema.check(z.iso.date());
|
|
46624
46831
|
} else if (format === "time") {
|
|
46625
|
-
stringSchema = stringSchema.check(
|
|
46832
|
+
stringSchema = stringSchema.check(z.iso.time());
|
|
46626
46833
|
} else if (format === "duration") {
|
|
46627
|
-
stringSchema = stringSchema.check(
|
|
46834
|
+
stringSchema = stringSchema.check(z.iso.duration());
|
|
46628
46835
|
} else if (format === "ipv4") {
|
|
46629
|
-
stringSchema = stringSchema.check(
|
|
46836
|
+
stringSchema = stringSchema.check(z.ipv4());
|
|
46630
46837
|
} else if (format === "ipv6") {
|
|
46631
|
-
stringSchema = stringSchema.check(
|
|
46838
|
+
stringSchema = stringSchema.check(z.ipv6());
|
|
46632
46839
|
} else if (format === "mac") {
|
|
46633
|
-
stringSchema = stringSchema.check(
|
|
46840
|
+
stringSchema = stringSchema.check(z.mac());
|
|
46634
46841
|
} else if (format === "cidr") {
|
|
46635
|
-
stringSchema = stringSchema.check(
|
|
46842
|
+
stringSchema = stringSchema.check(z.cidrv4());
|
|
46636
46843
|
} else if (format === "cidr-v6") {
|
|
46637
|
-
stringSchema = stringSchema.check(
|
|
46844
|
+
stringSchema = stringSchema.check(z.cidrv6());
|
|
46638
46845
|
} else if (format === "base64") {
|
|
46639
|
-
stringSchema = stringSchema.check(
|
|
46846
|
+
stringSchema = stringSchema.check(z.base64());
|
|
46640
46847
|
} else if (format === "base64url") {
|
|
46641
|
-
stringSchema = stringSchema.check(
|
|
46848
|
+
stringSchema = stringSchema.check(z.base64url());
|
|
46642
46849
|
} else if (format === "e164") {
|
|
46643
|
-
stringSchema = stringSchema.check(
|
|
46850
|
+
stringSchema = stringSchema.check(z.e164());
|
|
46644
46851
|
} else if (format === "jwt") {
|
|
46645
|
-
stringSchema = stringSchema.check(jwt());
|
|
46852
|
+
stringSchema = stringSchema.check(z.jwt());
|
|
46646
46853
|
} else if (format === "emoji") {
|
|
46647
|
-
stringSchema = stringSchema.check(
|
|
46854
|
+
stringSchema = stringSchema.check(z.emoji());
|
|
46648
46855
|
} else if (format === "nanoid") {
|
|
46649
|
-
stringSchema = stringSchema.check(
|
|
46856
|
+
stringSchema = stringSchema.check(z.nanoid());
|
|
46650
46857
|
} else if (format === "cuid") {
|
|
46651
|
-
stringSchema = stringSchema.check(
|
|
46858
|
+
stringSchema = stringSchema.check(z.cuid());
|
|
46652
46859
|
} else if (format === "cuid2") {
|
|
46653
|
-
stringSchema = stringSchema.check(
|
|
46860
|
+
stringSchema = stringSchema.check(z.cuid2());
|
|
46654
46861
|
} else if (format === "ulid") {
|
|
46655
|
-
stringSchema = stringSchema.check(
|
|
46862
|
+
stringSchema = stringSchema.check(z.ulid());
|
|
46656
46863
|
} else if (format === "xid") {
|
|
46657
|
-
stringSchema = stringSchema.check(
|
|
46864
|
+
stringSchema = stringSchema.check(z.xid());
|
|
46658
46865
|
} else if (format === "ksuid") {
|
|
46659
|
-
stringSchema = stringSchema.check(
|
|
46866
|
+
stringSchema = stringSchema.check(z.ksuid());
|
|
46660
46867
|
}
|
|
46661
46868
|
}
|
|
46662
46869
|
if (typeof schema.minLength === "number") {
|
|
@@ -46673,7 +46880,7 @@ function convertBaseSchema(schema, ctx) {
|
|
|
46673
46880
|
}
|
|
46674
46881
|
case "number":
|
|
46675
46882
|
case "integer": {
|
|
46676
|
-
let numberSchema = type === "integer" ?
|
|
46883
|
+
let numberSchema = type === "integer" ? z.number().int() : z.number();
|
|
46677
46884
|
if (typeof schema.minimum === "number") {
|
|
46678
46885
|
numberSchema = numberSchema.min(schema.minimum);
|
|
46679
46886
|
}
|
|
@@ -46697,11 +46904,11 @@ function convertBaseSchema(schema, ctx) {
|
|
|
46697
46904
|
break;
|
|
46698
46905
|
}
|
|
46699
46906
|
case "boolean": {
|
|
46700
|
-
zodSchema =
|
|
46907
|
+
zodSchema = z.boolean();
|
|
46701
46908
|
break;
|
|
46702
46909
|
}
|
|
46703
46910
|
case "null": {
|
|
46704
|
-
zodSchema =
|
|
46911
|
+
zodSchema = z.null();
|
|
46705
46912
|
break;
|
|
46706
46913
|
}
|
|
46707
46914
|
case "object": {
|
|
@@ -46714,14 +46921,14 @@ function convertBaseSchema(schema, ctx) {
|
|
|
46714
46921
|
}
|
|
46715
46922
|
if (schema.propertyNames) {
|
|
46716
46923
|
const keySchema = convertSchema(schema.propertyNames, ctx);
|
|
46717
|
-
const valueSchema = schema.additionalProperties && typeof schema.additionalProperties === "object" ? convertSchema(schema.additionalProperties, ctx) : any();
|
|
46924
|
+
const valueSchema = schema.additionalProperties && typeof schema.additionalProperties === "object" ? convertSchema(schema.additionalProperties, ctx) : z.any();
|
|
46718
46925
|
if (Object.keys(shape).length === 0) {
|
|
46719
|
-
zodSchema = record(keySchema, valueSchema);
|
|
46926
|
+
zodSchema = z.record(keySchema, valueSchema);
|
|
46720
46927
|
break;
|
|
46721
46928
|
}
|
|
46722
|
-
const objectSchema2 =
|
|
46723
|
-
const recordSchema = looseRecord(keySchema, valueSchema);
|
|
46724
|
-
zodSchema = intersection(objectSchema2, recordSchema);
|
|
46929
|
+
const objectSchema2 = z.object(shape).passthrough();
|
|
46930
|
+
const recordSchema = z.looseRecord(keySchema, valueSchema);
|
|
46931
|
+
zodSchema = z.intersection(objectSchema2, recordSchema);
|
|
46725
46932
|
break;
|
|
46726
46933
|
}
|
|
46727
46934
|
if (schema.patternProperties) {
|
|
@@ -46730,28 +46937,28 @@ function convertBaseSchema(schema, ctx) {
|
|
|
46730
46937
|
const looseRecords = [];
|
|
46731
46938
|
for (const pattern of patternKeys) {
|
|
46732
46939
|
const patternValue = convertSchema(patternProps[pattern], ctx);
|
|
46733
|
-
const keySchema =
|
|
46734
|
-
looseRecords.push(looseRecord(keySchema, patternValue));
|
|
46940
|
+
const keySchema = z.string().regex(new RegExp(pattern));
|
|
46941
|
+
looseRecords.push(z.looseRecord(keySchema, patternValue));
|
|
46735
46942
|
}
|
|
46736
46943
|
const schemasToIntersect = [];
|
|
46737
46944
|
if (Object.keys(shape).length > 0) {
|
|
46738
|
-
schemasToIntersect.push(
|
|
46945
|
+
schemasToIntersect.push(z.object(shape).passthrough());
|
|
46739
46946
|
}
|
|
46740
46947
|
schemasToIntersect.push(...looseRecords);
|
|
46741
46948
|
if (schemasToIntersect.length === 0) {
|
|
46742
|
-
zodSchema =
|
|
46949
|
+
zodSchema = z.object({}).passthrough();
|
|
46743
46950
|
} else if (schemasToIntersect.length === 1) {
|
|
46744
46951
|
zodSchema = schemasToIntersect[0];
|
|
46745
46952
|
} else {
|
|
46746
|
-
let result = intersection(schemasToIntersect[0], schemasToIntersect[1]);
|
|
46953
|
+
let result = z.intersection(schemasToIntersect[0], schemasToIntersect[1]);
|
|
46747
46954
|
for (let i = 2;i < schemasToIntersect.length; i++) {
|
|
46748
|
-
result = intersection(result, schemasToIntersect[i]);
|
|
46955
|
+
result = z.intersection(result, schemasToIntersect[i]);
|
|
46749
46956
|
}
|
|
46750
46957
|
zodSchema = result;
|
|
46751
46958
|
}
|
|
46752
46959
|
break;
|
|
46753
46960
|
}
|
|
46754
|
-
const objectSchema =
|
|
46961
|
+
const objectSchema = z.object(shape);
|
|
46755
46962
|
if (schema.additionalProperties === false) {
|
|
46756
46963
|
zodSchema = objectSchema.strict();
|
|
46757
46964
|
} else if (typeof schema.additionalProperties === "object") {
|
|
@@ -46768,33 +46975,33 @@ function convertBaseSchema(schema, ctx) {
|
|
|
46768
46975
|
const tupleItems = prefixItems.map((item) => convertSchema(item, ctx));
|
|
46769
46976
|
const rest = items && typeof items === "object" && !Array.isArray(items) ? convertSchema(items, ctx) : undefined;
|
|
46770
46977
|
if (rest) {
|
|
46771
|
-
zodSchema = tuple(tupleItems).rest(rest);
|
|
46978
|
+
zodSchema = z.tuple(tupleItems).rest(rest);
|
|
46772
46979
|
} else {
|
|
46773
|
-
zodSchema = tuple(tupleItems);
|
|
46980
|
+
zodSchema = z.tuple(tupleItems);
|
|
46774
46981
|
}
|
|
46775
46982
|
if (typeof schema.minItems === "number") {
|
|
46776
|
-
zodSchema = zodSchema.check(
|
|
46983
|
+
zodSchema = zodSchema.check(z.minLength(schema.minItems));
|
|
46777
46984
|
}
|
|
46778
46985
|
if (typeof schema.maxItems === "number") {
|
|
46779
|
-
zodSchema = zodSchema.check(
|
|
46986
|
+
zodSchema = zodSchema.check(z.maxLength(schema.maxItems));
|
|
46780
46987
|
}
|
|
46781
46988
|
} else if (Array.isArray(items)) {
|
|
46782
46989
|
const tupleItems = items.map((item) => convertSchema(item, ctx));
|
|
46783
46990
|
const rest = schema.additionalItems && typeof schema.additionalItems === "object" ? convertSchema(schema.additionalItems, ctx) : undefined;
|
|
46784
46991
|
if (rest) {
|
|
46785
|
-
zodSchema = tuple(tupleItems).rest(rest);
|
|
46992
|
+
zodSchema = z.tuple(tupleItems).rest(rest);
|
|
46786
46993
|
} else {
|
|
46787
|
-
zodSchema = tuple(tupleItems);
|
|
46994
|
+
zodSchema = z.tuple(tupleItems);
|
|
46788
46995
|
}
|
|
46789
46996
|
if (typeof schema.minItems === "number") {
|
|
46790
|
-
zodSchema = zodSchema.check(
|
|
46997
|
+
zodSchema = zodSchema.check(z.minLength(schema.minItems));
|
|
46791
46998
|
}
|
|
46792
46999
|
if (typeof schema.maxItems === "number") {
|
|
46793
|
-
zodSchema = zodSchema.check(
|
|
47000
|
+
zodSchema = zodSchema.check(z.maxLength(schema.maxItems));
|
|
46794
47001
|
}
|
|
46795
47002
|
} else if (items !== undefined) {
|
|
46796
47003
|
const element = convertSchema(items, ctx);
|
|
46797
|
-
let arraySchema = array(element);
|
|
47004
|
+
let arraySchema = z.array(element);
|
|
46798
47005
|
if (typeof schema.minItems === "number") {
|
|
46799
47006
|
arraySchema = arraySchema.min(schema.minItems);
|
|
46800
47007
|
}
|
|
@@ -46803,7 +47010,7 @@ function convertBaseSchema(schema, ctx) {
|
|
|
46803
47010
|
}
|
|
46804
47011
|
zodSchema = arraySchema;
|
|
46805
47012
|
} else {
|
|
46806
|
-
zodSchema = array(any());
|
|
47013
|
+
zodSchema = z.array(z.any());
|
|
46807
47014
|
}
|
|
46808
47015
|
break;
|
|
46809
47016
|
}
|
|
@@ -46820,43 +47027,43 @@ function convertBaseSchema(schema, ctx) {
|
|
|
46820
47027
|
}
|
|
46821
47028
|
function convertSchema(schema, ctx) {
|
|
46822
47029
|
if (typeof schema === "boolean") {
|
|
46823
|
-
return schema ? any() : never();
|
|
47030
|
+
return schema ? z.any() : z.never();
|
|
46824
47031
|
}
|
|
46825
47032
|
let baseSchema = convertBaseSchema(schema, ctx);
|
|
46826
47033
|
const hasExplicitType = schema.type || schema.enum !== undefined || schema.const !== undefined;
|
|
46827
47034
|
if (schema.anyOf && Array.isArray(schema.anyOf)) {
|
|
46828
47035
|
const options = schema.anyOf.map((s) => convertSchema(s, ctx));
|
|
46829
|
-
const anyOfUnion = union(options);
|
|
46830
|
-
baseSchema = hasExplicitType ? intersection(baseSchema, anyOfUnion) : anyOfUnion;
|
|
47036
|
+
const anyOfUnion = z.union(options);
|
|
47037
|
+
baseSchema = hasExplicitType ? z.intersection(baseSchema, anyOfUnion) : anyOfUnion;
|
|
46831
47038
|
}
|
|
46832
47039
|
if (schema.oneOf && Array.isArray(schema.oneOf)) {
|
|
46833
47040
|
const options = schema.oneOf.map((s) => convertSchema(s, ctx));
|
|
46834
|
-
const oneOfUnion = xor(options);
|
|
46835
|
-
baseSchema = hasExplicitType ? intersection(baseSchema, oneOfUnion) : oneOfUnion;
|
|
47041
|
+
const oneOfUnion = z.xor(options);
|
|
47042
|
+
baseSchema = hasExplicitType ? z.intersection(baseSchema, oneOfUnion) : oneOfUnion;
|
|
46836
47043
|
}
|
|
46837
47044
|
if (schema.allOf && Array.isArray(schema.allOf)) {
|
|
46838
47045
|
if (schema.allOf.length === 0) {
|
|
46839
|
-
baseSchema = hasExplicitType ? baseSchema : any();
|
|
47046
|
+
baseSchema = hasExplicitType ? baseSchema : z.any();
|
|
46840
47047
|
} else {
|
|
46841
47048
|
let result = hasExplicitType ? baseSchema : convertSchema(schema.allOf[0], ctx);
|
|
46842
47049
|
const startIdx = hasExplicitType ? 0 : 1;
|
|
46843
47050
|
for (let i = startIdx;i < schema.allOf.length; i++) {
|
|
46844
|
-
result = intersection(result, convertSchema(schema.allOf[i], ctx));
|
|
47051
|
+
result = z.intersection(result, convertSchema(schema.allOf[i], ctx));
|
|
46845
47052
|
}
|
|
46846
47053
|
baseSchema = result;
|
|
46847
47054
|
}
|
|
46848
47055
|
}
|
|
46849
47056
|
if (schema.nullable === true && ctx.version === "openapi-3.0") {
|
|
46850
|
-
baseSchema = nullable(baseSchema);
|
|
47057
|
+
baseSchema = z.nullable(baseSchema);
|
|
46851
47058
|
}
|
|
46852
47059
|
if (schema.readOnly === true) {
|
|
46853
|
-
baseSchema = readonly(baseSchema);
|
|
47060
|
+
baseSchema = z.readonly(baseSchema);
|
|
46854
47061
|
}
|
|
46855
47062
|
return baseSchema;
|
|
46856
47063
|
}
|
|
46857
47064
|
function fromJSONSchema(schema, params) {
|
|
46858
47065
|
if (typeof schema === "boolean") {
|
|
46859
|
-
return schema ? any() : never();
|
|
47066
|
+
return schema ? z.any() : z.never();
|
|
46860
47067
|
}
|
|
46861
47068
|
const version2 = detectVersion(schema, params?.defaultTarget);
|
|
46862
47069
|
const defs = schema.$defs || schema.definitions || {};
|