@hey-api/openapi-ts 0.90.3 → 0.90.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +24 -3
- package/dist/clients/fetch/client.ts +7 -1
- package/dist/clients/ky/client.ts +7 -1
- package/dist/clients/next/client.ts +7 -1
- package/dist/{config-kLkHIaUr.d.mts → config-BCMpBYUB.d.mts} +105 -35
- package/dist/{config-Cmhj4J0r.d.cts → config-CtVXEKSL.d.cts} +105 -35
- package/dist/index.cjs +2 -2
- package/dist/index.d.cts +2 -1
- package/dist/index.d.mts +2 -1
- package/dist/index.mjs +2 -2
- package/dist/internal.cjs +1 -1
- package/dist/internal.d.cts +1 -1
- package/dist/internal.d.mts +1 -1
- package/dist/internal.mjs +1 -1
- package/dist/{openApi-Ci-wjGgv.mjs → openApi-B6J9qPwL.mjs} +312 -65
- package/dist/openApi-B6J9qPwL.mjs.map +1 -0
- package/dist/{openApi-BetJIgjU.cjs → openApi-BZ7m5ia5.cjs} +312 -65
- package/dist/openApi-BZ7m5ia5.cjs.map +1 -0
- package/dist/run.cjs +3 -3
- package/dist/run.mjs +3 -3
- package/dist/{src-CV7EsNIp.mjs → src-BehyjtZ7.mjs} +2 -2
- package/dist/src-BehyjtZ7.mjs.map +1 -0
- package/dist/{src-CJqsBn3S.cjs → src-BkOFTEi8.cjs} +2 -2
- package/dist/src-BkOFTEi8.cjs.map +1 -0
- package/package.json +3 -2
- package/dist/openApi-BetJIgjU.cjs.map +0 -1
- package/dist/openApi-Ci-wjGgv.mjs.map +0 -1
- package/dist/src-CJqsBn3S.cjs.map +0 -1
- package/dist/src-CV7EsNIp.mjs.map +0 -1
|
@@ -5499,7 +5499,7 @@ const operationAuth = ({ operation, plugin }) => {
|
|
|
5499
5499
|
for (const securitySchemeObject of operation.security) {
|
|
5500
5500
|
const authObject = securitySchemeObjectToAuthObject({ securitySchemeObject });
|
|
5501
5501
|
if (authObject) auth.push(authObject);
|
|
5502
|
-
else console.warn(`❗️ SDK warning: unsupported security scheme. Please open an issue if you'd like it added https://github.com/hey-api/openapi-ts/issues\n${JSON.stringify(securitySchemeObject, null, 2)}`);
|
|
5502
|
+
else if (securitySchemeObject.type !== "mutualTLS") console.warn(`❗️ SDK warning: unsupported security scheme. Please open an issue if you'd like it added https://github.com/hey-api/openapi-ts/issues\n${JSON.stringify(securitySchemeObject, null, 2)}`);
|
|
5503
5503
|
}
|
|
5504
5504
|
return auth;
|
|
5505
5505
|
};
|
|
@@ -11209,20 +11209,82 @@ const booleanToAst$3 = ({ plugin, schema }) => {
|
|
|
11209
11209
|
|
|
11210
11210
|
//#endregion
|
|
11211
11211
|
//#region src/plugins/valibot/v1/toAst/enum.ts
|
|
11212
|
-
|
|
11212
|
+
function itemsNode$3(ctx$1) {
|
|
11213
|
+
const { schema } = ctx$1;
|
|
11213
11214
|
const enumMembers = [];
|
|
11214
11215
|
let isNullable = false;
|
|
11215
11216
|
for (const item of schema.items ?? []) if (item.type === "string" && typeof item.const === "string") enumMembers.push($.literal(item.const));
|
|
11216
11217
|
else if (item.type === "null" || item.const === null) isNullable = true;
|
|
11218
|
+
return {
|
|
11219
|
+
enumMembers,
|
|
11220
|
+
isNullable
|
|
11221
|
+
};
|
|
11222
|
+
}
|
|
11223
|
+
function baseNode$15(ctx$1) {
|
|
11224
|
+
const { symbols } = ctx$1;
|
|
11225
|
+
const { v } = symbols;
|
|
11226
|
+
const { enumMembers } = ctx$1.nodes.items(ctx$1);
|
|
11227
|
+
return $(v).attr(identifiers$1.schemas.picklist).call($.array(...enumMembers));
|
|
11228
|
+
}
|
|
11229
|
+
function nullableNode$3(ctx$1) {
|
|
11230
|
+
const { symbols } = ctx$1;
|
|
11231
|
+
const { v } = symbols;
|
|
11232
|
+
const { isNullable } = ctx$1.nodes.items(ctx$1);
|
|
11233
|
+
if (!isNullable) return;
|
|
11234
|
+
const currentNode = ctx$1.pipes.toNode(ctx$1.pipes.current, ctx$1.plugin);
|
|
11235
|
+
return $(v).attr(identifiers$1.schemas.nullable).call(currentNode);
|
|
11236
|
+
}
|
|
11237
|
+
function enumResolver$3(ctx$1) {
|
|
11238
|
+
const { enumMembers } = ctx$1.nodes.items(ctx$1);
|
|
11239
|
+
if (!enumMembers.length) return ctx$1.pipes.current;
|
|
11240
|
+
const baseExpression = ctx$1.nodes.base(ctx$1);
|
|
11241
|
+
ctx$1.pipes.push(ctx$1.pipes.current, baseExpression);
|
|
11242
|
+
const nullableExpression = ctx$1.nodes.nullable(ctx$1);
|
|
11243
|
+
if (nullableExpression) return nullableExpression;
|
|
11244
|
+
return ctx$1.pipes.current;
|
|
11245
|
+
}
|
|
11246
|
+
const enumToAst$3 = ({ plugin, schema, state }) => {
|
|
11247
|
+
const v = plugin.external("valibot.v");
|
|
11248
|
+
const { enumMembers } = itemsNode$3({
|
|
11249
|
+
$,
|
|
11250
|
+
nodes: {
|
|
11251
|
+
base: baseNode$15,
|
|
11252
|
+
items: itemsNode$3,
|
|
11253
|
+
nullable: nullableNode$3
|
|
11254
|
+
},
|
|
11255
|
+
pipes: {
|
|
11256
|
+
...pipes,
|
|
11257
|
+
current: []
|
|
11258
|
+
},
|
|
11259
|
+
plugin,
|
|
11260
|
+
schema,
|
|
11261
|
+
symbols: { v },
|
|
11262
|
+
utils: { state }
|
|
11263
|
+
});
|
|
11217
11264
|
if (!enumMembers.length) return unknownToAst$3({
|
|
11218
11265
|
plugin,
|
|
11219
11266
|
schema: { type: "unknown" },
|
|
11220
11267
|
state
|
|
11221
11268
|
});
|
|
11222
|
-
const
|
|
11223
|
-
|
|
11224
|
-
|
|
11225
|
-
|
|
11269
|
+
const ctx$1 = {
|
|
11270
|
+
$,
|
|
11271
|
+
nodes: {
|
|
11272
|
+
base: baseNode$15,
|
|
11273
|
+
items: itemsNode$3,
|
|
11274
|
+
nullable: nullableNode$3
|
|
11275
|
+
},
|
|
11276
|
+
pipes: {
|
|
11277
|
+
...pipes,
|
|
11278
|
+
current: []
|
|
11279
|
+
},
|
|
11280
|
+
plugin,
|
|
11281
|
+
schema,
|
|
11282
|
+
symbols: { v },
|
|
11283
|
+
utils: { state }
|
|
11284
|
+
};
|
|
11285
|
+
const resolver = plugin.config["~resolvers"]?.enum;
|
|
11286
|
+
const node = resolver?.(ctx$1) ?? enumResolver$3(ctx$1);
|
|
11287
|
+
return ctx$1.pipes.toNode(node, plugin);
|
|
11226
11288
|
};
|
|
11227
11289
|
|
|
11228
11290
|
//#endregion
|
|
@@ -11267,7 +11329,7 @@ const getIntegerLimit = (format) => {
|
|
|
11267
11329
|
|
|
11268
11330
|
//#endregion
|
|
11269
11331
|
//#region src/plugins/valibot/v1/toAst/number.ts
|
|
11270
|
-
function baseNode$
|
|
11332
|
+
function baseNode$14(ctx$1) {
|
|
11271
11333
|
const { schema, symbols } = ctx$1;
|
|
11272
11334
|
const { v } = symbols;
|
|
11273
11335
|
if (ctx$1.utils.shouldCoerceToBigInt(schema.format)) return [$(v).attr(identifiers$1.schemas.union).call($.array($(v).attr(identifiers$1.schemas.number).call(), $(v).attr(identifiers$1.schemas.string).call(), $(v).attr(identifiers$1.schemas.bigInt).call())), $(v).attr(identifiers$1.actions.transform).call($.func().param("x").do($("BigInt").call("x").return()))];
|
|
@@ -11301,8 +11363,8 @@ function minNode$3(ctx$1) {
|
|
|
11301
11363
|
function numberResolver$3(ctx$1) {
|
|
11302
11364
|
const constNode$8 = ctx$1.nodes.const(ctx$1);
|
|
11303
11365
|
if (constNode$8) return ctx$1.pipes.push(ctx$1.pipes.current, constNode$8);
|
|
11304
|
-
const baseNode$
|
|
11305
|
-
if (baseNode$
|
|
11366
|
+
const baseNode$16 = ctx$1.nodes.base(ctx$1);
|
|
11367
|
+
if (baseNode$16) ctx$1.pipes.push(ctx$1.pipes.current, baseNode$16);
|
|
11306
11368
|
const minNode$4 = ctx$1.nodes.min(ctx$1);
|
|
11307
11369
|
if (minNode$4) ctx$1.pipes.push(ctx$1.pipes.current, minNode$4);
|
|
11308
11370
|
const maxNode$4 = ctx$1.nodes.max(ctx$1);
|
|
@@ -11313,7 +11375,7 @@ const numberToNode$3 = ({ plugin, schema }) => {
|
|
|
11313
11375
|
const ctx$1 = {
|
|
11314
11376
|
$,
|
|
11315
11377
|
nodes: {
|
|
11316
|
-
base: baseNode$
|
|
11378
|
+
base: baseNode$14,
|
|
11317
11379
|
const: constNode$7,
|
|
11318
11380
|
max: maxNode$3,
|
|
11319
11381
|
min: minNode$3
|
|
@@ -11353,7 +11415,7 @@ function additionalPropertiesNode$3(ctx$1) {
|
|
|
11353
11415
|
if (additionalAst.hasLazyExpression) ctx$1.utils.ast.hasLazyExpression = true;
|
|
11354
11416
|
return pipes.toNode(additionalAst.pipes, plugin);
|
|
11355
11417
|
}
|
|
11356
|
-
function baseNode$
|
|
11418
|
+
function baseNode$13(ctx$1) {
|
|
11357
11419
|
const { nodes, symbols } = ctx$1;
|
|
11358
11420
|
const { v } = symbols;
|
|
11359
11421
|
const additional = nodes.additionalProperties(ctx$1);
|
|
@@ -11396,7 +11458,7 @@ const objectToAst$3 = ({ plugin, schema, state }) => {
|
|
|
11396
11458
|
$,
|
|
11397
11459
|
nodes: {
|
|
11398
11460
|
additionalProperties: additionalPropertiesNode$3,
|
|
11399
|
-
base: baseNode$
|
|
11461
|
+
base: baseNode$13,
|
|
11400
11462
|
shape: shapeNode$3
|
|
11401
11463
|
},
|
|
11402
11464
|
pipes: {
|
|
@@ -11419,7 +11481,7 @@ const objectToAst$3 = ({ plugin, schema, state }) => {
|
|
|
11419
11481
|
|
|
11420
11482
|
//#endregion
|
|
11421
11483
|
//#region src/plugins/valibot/v1/toAst/string.ts
|
|
11422
|
-
function baseNode$
|
|
11484
|
+
function baseNode$12(ctx$1) {
|
|
11423
11485
|
const { v } = ctx$1.symbols;
|
|
11424
11486
|
return $(v).attr(identifiers$1.schemas.string).call();
|
|
11425
11487
|
}
|
|
@@ -11470,8 +11532,8 @@ function patternNode$3(ctx$1) {
|
|
|
11470
11532
|
function stringResolver$3(ctx$1) {
|
|
11471
11533
|
const constNode$8 = ctx$1.nodes.const(ctx$1);
|
|
11472
11534
|
if (constNode$8) return ctx$1.pipes.push(ctx$1.pipes.current, constNode$8);
|
|
11473
|
-
const baseNode$
|
|
11474
|
-
if (baseNode$
|
|
11535
|
+
const baseNode$16 = ctx$1.nodes.base(ctx$1);
|
|
11536
|
+
if (baseNode$16) ctx$1.pipes.push(ctx$1.pipes.current, baseNode$16);
|
|
11475
11537
|
const formatNode$4 = ctx$1.nodes.format(ctx$1);
|
|
11476
11538
|
if (formatNode$4) ctx$1.pipes.push(ctx$1.pipes.current, formatNode$4);
|
|
11477
11539
|
const lengthNode$4 = ctx$1.nodes.length(ctx$1);
|
|
@@ -11490,7 +11552,7 @@ const stringToNode$3 = ({ plugin, schema }) => {
|
|
|
11490
11552
|
const ctx$1 = {
|
|
11491
11553
|
$,
|
|
11492
11554
|
nodes: {
|
|
11493
|
-
base: baseNode$
|
|
11555
|
+
base: baseNode$12,
|
|
11494
11556
|
const: constNode$6,
|
|
11495
11557
|
format: formatNode$3,
|
|
11496
11558
|
length: lengthNode$3,
|
|
@@ -12494,9 +12556,9 @@ const booleanToAst$2 = ({ plugin, schema }) => {
|
|
|
12494
12556
|
|
|
12495
12557
|
//#endregion
|
|
12496
12558
|
//#region src/plugins/zod/mini/toAst/enum.ts
|
|
12497
|
-
|
|
12498
|
-
const
|
|
12499
|
-
const
|
|
12559
|
+
function itemsNode$2(ctx$1) {
|
|
12560
|
+
const { schema, symbols } = ctx$1;
|
|
12561
|
+
const { z } = symbols;
|
|
12500
12562
|
const enumMembers = [];
|
|
12501
12563
|
const literalMembers = [];
|
|
12502
12564
|
let isNullable = false;
|
|
@@ -12514,16 +12576,78 @@ const enumToAst$2 = ({ plugin, schema, state }) => {
|
|
|
12514
12576
|
const literal = $.literal(item.const);
|
|
12515
12577
|
literalMembers.push($(z).attr(identifiers.literal).call(literal));
|
|
12516
12578
|
} else if (item.type === "null" || item.const === null) isNullable = true;
|
|
12579
|
+
return {
|
|
12580
|
+
allStrings,
|
|
12581
|
+
enumMembers,
|
|
12582
|
+
isNullable,
|
|
12583
|
+
literalMembers
|
|
12584
|
+
};
|
|
12585
|
+
}
|
|
12586
|
+
function baseNode$11(ctx$1) {
|
|
12587
|
+
const { symbols } = ctx$1;
|
|
12588
|
+
const { z } = symbols;
|
|
12589
|
+
const { allStrings, enumMembers, literalMembers } = ctx$1.nodes.items(ctx$1);
|
|
12590
|
+
if (allStrings && enumMembers.length > 0) return $(z).attr(identifiers.enum).call($.array(...enumMembers));
|
|
12591
|
+
else if (literalMembers.length === 1) return literalMembers[0];
|
|
12592
|
+
else return $(z).attr(identifiers.union).call($.array(...literalMembers));
|
|
12593
|
+
}
|
|
12594
|
+
function nullableNode$2(ctx$1) {
|
|
12595
|
+
const { chain, symbols } = ctx$1;
|
|
12596
|
+
const { z } = symbols;
|
|
12597
|
+
const { isNullable } = ctx$1.nodes.items(ctx$1);
|
|
12598
|
+
if (!isNullable) return;
|
|
12599
|
+
return $(z).attr(identifiers.nullable).call(chain.current);
|
|
12600
|
+
}
|
|
12601
|
+
function enumResolver$2(ctx$1) {
|
|
12602
|
+
const { literalMembers } = ctx$1.nodes.items(ctx$1);
|
|
12603
|
+
if (!literalMembers.length) return ctx$1.chain.current;
|
|
12604
|
+
const baseExpression = ctx$1.nodes.base(ctx$1);
|
|
12605
|
+
ctx$1.chain.current = baseExpression;
|
|
12606
|
+
const nullableExpression = ctx$1.nodes.nullable(ctx$1);
|
|
12607
|
+
if (nullableExpression) ctx$1.chain.current = nullableExpression;
|
|
12608
|
+
return ctx$1.chain.current;
|
|
12609
|
+
}
|
|
12610
|
+
const enumToAst$2 = ({ plugin, schema, state }) => {
|
|
12611
|
+
const z = plugin.external("zod.z");
|
|
12612
|
+
const { literalMembers } = itemsNode$2({
|
|
12613
|
+
$,
|
|
12614
|
+
chain: { current: $(z) },
|
|
12615
|
+
nodes: {
|
|
12616
|
+
base: baseNode$11,
|
|
12617
|
+
items: itemsNode$2,
|
|
12618
|
+
nullable: nullableNode$2
|
|
12619
|
+
},
|
|
12620
|
+
plugin,
|
|
12621
|
+
schema,
|
|
12622
|
+
symbols: { z },
|
|
12623
|
+
utils: {
|
|
12624
|
+
ast: {},
|
|
12625
|
+
state
|
|
12626
|
+
}
|
|
12627
|
+
});
|
|
12517
12628
|
if (!literalMembers.length) return unknownToAst$2({
|
|
12518
12629
|
plugin,
|
|
12519
12630
|
schema: { type: "unknown" },
|
|
12520
12631
|
state
|
|
12521
12632
|
});
|
|
12522
|
-
|
|
12523
|
-
|
|
12524
|
-
|
|
12525
|
-
|
|
12526
|
-
|
|
12633
|
+
const ctx$1 = {
|
|
12634
|
+
$,
|
|
12635
|
+
chain: { current: $(z) },
|
|
12636
|
+
nodes: {
|
|
12637
|
+
base: baseNode$11,
|
|
12638
|
+
items: itemsNode$2,
|
|
12639
|
+
nullable: nullableNode$2
|
|
12640
|
+
},
|
|
12641
|
+
plugin,
|
|
12642
|
+
schema,
|
|
12643
|
+
symbols: { z },
|
|
12644
|
+
utils: {
|
|
12645
|
+
ast: {},
|
|
12646
|
+
state
|
|
12647
|
+
}
|
|
12648
|
+
};
|
|
12649
|
+
const resolver = plugin.config["~resolvers"]?.enum;
|
|
12650
|
+
return { expression: resolver?.(ctx$1) ?? enumResolver$2(ctx$1) };
|
|
12527
12651
|
};
|
|
12528
12652
|
|
|
12529
12653
|
//#endregion
|
|
@@ -12546,7 +12670,7 @@ const nullToAst$2 = ({ plugin }) => {
|
|
|
12546
12670
|
|
|
12547
12671
|
//#endregion
|
|
12548
12672
|
//#region src/plugins/zod/mini/toAst/number.ts
|
|
12549
|
-
function baseNode$
|
|
12673
|
+
function baseNode$10(ctx$1) {
|
|
12550
12674
|
const { schema, symbols } = ctx$1;
|
|
12551
12675
|
const { z } = symbols;
|
|
12552
12676
|
if (ctx$1.utils.shouldCoerceToBigInt(schema.format)) return $(z).attr(identifiers.coerce).attr(identifiers.bigint).call();
|
|
@@ -12582,8 +12706,8 @@ function numberResolver$2(ctx$1) {
|
|
|
12582
12706
|
ctx$1.chain.current = constNode$8;
|
|
12583
12707
|
return ctx$1.chain.current;
|
|
12584
12708
|
}
|
|
12585
|
-
const baseNode$
|
|
12586
|
-
if (baseNode$
|
|
12709
|
+
const baseNode$16 = ctx$1.nodes.base(ctx$1);
|
|
12710
|
+
if (baseNode$16) ctx$1.chain.current = baseNode$16;
|
|
12587
12711
|
const checks = [];
|
|
12588
12712
|
const minNode$4 = ctx$1.nodes.min(ctx$1);
|
|
12589
12713
|
if (minNode$4) checks.push(minNode$4);
|
|
@@ -12599,7 +12723,7 @@ const numberToNode$2 = ({ plugin, schema, state }) => {
|
|
|
12599
12723
|
$,
|
|
12600
12724
|
chain: { current: $(z) },
|
|
12601
12725
|
nodes: {
|
|
12602
|
-
base: baseNode$
|
|
12726
|
+
base: baseNode$10,
|
|
12603
12727
|
const: constNode$5,
|
|
12604
12728
|
max: maxNode$2,
|
|
12605
12729
|
min: minNode$2
|
|
@@ -12636,7 +12760,7 @@ function additionalPropertiesNode$2(ctx$1) {
|
|
|
12636
12760
|
if (additionalAst.hasLazyExpression) ctx$1.utils.ast.hasLazyExpression = true;
|
|
12637
12761
|
return additionalAst.expression;
|
|
12638
12762
|
}
|
|
12639
|
-
function baseNode$
|
|
12763
|
+
function baseNode$9(ctx$1) {
|
|
12640
12764
|
const { nodes, symbols } = ctx$1;
|
|
12641
12765
|
const { z } = symbols;
|
|
12642
12766
|
const additional = nodes.additionalProperties(ctx$1);
|
|
@@ -12680,7 +12804,7 @@ const objectToAst$2 = ({ plugin, schema, state }) => {
|
|
|
12680
12804
|
chain: { current: $(z) },
|
|
12681
12805
|
nodes: {
|
|
12682
12806
|
additionalProperties: additionalPropertiesNode$2,
|
|
12683
|
-
base: baseNode$
|
|
12807
|
+
base: baseNode$9,
|
|
12684
12808
|
shape: shapeNode$2
|
|
12685
12809
|
},
|
|
12686
12810
|
plugin,
|
|
@@ -12698,7 +12822,7 @@ const objectToAst$2 = ({ plugin, schema, state }) => {
|
|
|
12698
12822
|
|
|
12699
12823
|
//#endregion
|
|
12700
12824
|
//#region src/plugins/zod/mini/toAst/string.ts
|
|
12701
|
-
function baseNode$
|
|
12825
|
+
function baseNode$8(ctx$1) {
|
|
12702
12826
|
const { z } = ctx$1.symbols;
|
|
12703
12827
|
return $(z).attr(identifiers.string).call();
|
|
12704
12828
|
}
|
|
@@ -12755,8 +12879,8 @@ function stringResolver$2(ctx$1) {
|
|
|
12755
12879
|
ctx$1.chain.current = constNode$8;
|
|
12756
12880
|
return ctx$1.chain.current;
|
|
12757
12881
|
}
|
|
12758
|
-
const baseNode$
|
|
12759
|
-
if (baseNode$
|
|
12882
|
+
const baseNode$16 = ctx$1.nodes.base(ctx$1);
|
|
12883
|
+
if (baseNode$16) ctx$1.chain.current = baseNode$16;
|
|
12760
12884
|
const formatNode$4 = ctx$1.nodes.format(ctx$1);
|
|
12761
12885
|
if (formatNode$4) ctx$1.chain.current = formatNode$4;
|
|
12762
12886
|
const checks = [];
|
|
@@ -12779,7 +12903,7 @@ const stringToNode$2 = ({ plugin, schema }) => {
|
|
|
12779
12903
|
$,
|
|
12780
12904
|
chain: { current: $(z) },
|
|
12781
12905
|
nodes: {
|
|
12782
|
-
base: baseNode$
|
|
12906
|
+
base: baseNode$8,
|
|
12783
12907
|
const: constNode$4,
|
|
12784
12908
|
format: formatNode$2,
|
|
12785
12909
|
length: lengthNode$2,
|
|
@@ -13164,8 +13288,9 @@ const booleanToAst$1 = ({ plugin, schema }) => {
|
|
|
13164
13288
|
|
|
13165
13289
|
//#endregion
|
|
13166
13290
|
//#region src/plugins/zod/v3/toAst/enum.ts
|
|
13167
|
-
|
|
13168
|
-
const
|
|
13291
|
+
function itemsNode$1(ctx$1) {
|
|
13292
|
+
const { schema, symbols } = ctx$1;
|
|
13293
|
+
const { z } = symbols;
|
|
13169
13294
|
const enumMembers = [];
|
|
13170
13295
|
const literalMembers = [];
|
|
13171
13296
|
let isNullable = false;
|
|
@@ -13183,17 +13308,77 @@ const enumToAst$1 = ({ plugin, schema, state }) => {
|
|
|
13183
13308
|
const literal = $.literal(item.const);
|
|
13184
13309
|
literalMembers.push($(z).attr(identifiers.literal).call(literal));
|
|
13185
13310
|
} else if (item.type === "null" || item.const === null) isNullable = true;
|
|
13311
|
+
return {
|
|
13312
|
+
allStrings,
|
|
13313
|
+
enumMembers,
|
|
13314
|
+
isNullable,
|
|
13315
|
+
literalMembers
|
|
13316
|
+
};
|
|
13317
|
+
}
|
|
13318
|
+
function baseNode$7(ctx$1) {
|
|
13319
|
+
const { symbols } = ctx$1;
|
|
13320
|
+
const { z } = symbols;
|
|
13321
|
+
const { allStrings, enumMembers, literalMembers } = ctx$1.nodes.items(ctx$1);
|
|
13322
|
+
if (allStrings && enumMembers.length > 0) return $(z).attr(identifiers.enum).call($.array(...enumMembers));
|
|
13323
|
+
else if (literalMembers.length === 1) return literalMembers[0];
|
|
13324
|
+
else return $(z).attr(identifiers.union).call($.array(...literalMembers));
|
|
13325
|
+
}
|
|
13326
|
+
function nullableNode$1(ctx$1) {
|
|
13327
|
+
const { chain } = ctx$1;
|
|
13328
|
+
const { isNullable } = ctx$1.nodes.items(ctx$1);
|
|
13329
|
+
if (!isNullable) return;
|
|
13330
|
+
return chain.current.attr(identifiers.nullable).call();
|
|
13331
|
+
}
|
|
13332
|
+
function enumResolver$1(ctx$1) {
|
|
13333
|
+
const { literalMembers } = ctx$1.nodes.items(ctx$1);
|
|
13334
|
+
if (!literalMembers.length) return ctx$1.chain.current;
|
|
13335
|
+
const baseExpression = ctx$1.nodes.base(ctx$1);
|
|
13336
|
+
ctx$1.chain.current = baseExpression;
|
|
13337
|
+
const nullableExpression = ctx$1.nodes.nullable(ctx$1);
|
|
13338
|
+
if (nullableExpression) ctx$1.chain.current = nullableExpression;
|
|
13339
|
+
return ctx$1.chain.current;
|
|
13340
|
+
}
|
|
13341
|
+
const enumToAst$1 = ({ plugin, schema, state }) => {
|
|
13342
|
+
const z = plugin.external("zod.z");
|
|
13343
|
+
const { literalMembers } = itemsNode$1({
|
|
13344
|
+
$,
|
|
13345
|
+
chain: { current: $(z) },
|
|
13346
|
+
nodes: {
|
|
13347
|
+
base: baseNode$7,
|
|
13348
|
+
items: itemsNode$1,
|
|
13349
|
+
nullable: nullableNode$1
|
|
13350
|
+
},
|
|
13351
|
+
plugin,
|
|
13352
|
+
schema,
|
|
13353
|
+
symbols: { z },
|
|
13354
|
+
utils: {
|
|
13355
|
+
ast: {},
|
|
13356
|
+
state
|
|
13357
|
+
}
|
|
13358
|
+
});
|
|
13186
13359
|
if (!literalMembers.length) return unknownToAst$1({
|
|
13187
13360
|
plugin,
|
|
13188
13361
|
schema: { type: "unknown" },
|
|
13189
13362
|
state
|
|
13190
13363
|
});
|
|
13191
|
-
|
|
13192
|
-
|
|
13193
|
-
|
|
13194
|
-
|
|
13195
|
-
|
|
13196
|
-
|
|
13364
|
+
const ctx$1 = {
|
|
13365
|
+
$,
|
|
13366
|
+
chain: { current: $(z) },
|
|
13367
|
+
nodes: {
|
|
13368
|
+
base: baseNode$7,
|
|
13369
|
+
items: itemsNode$1,
|
|
13370
|
+
nullable: nullableNode$1
|
|
13371
|
+
},
|
|
13372
|
+
plugin,
|
|
13373
|
+
schema,
|
|
13374
|
+
symbols: { z },
|
|
13375
|
+
utils: {
|
|
13376
|
+
ast: {},
|
|
13377
|
+
state
|
|
13378
|
+
}
|
|
13379
|
+
};
|
|
13380
|
+
const resolver = plugin.config["~resolvers"]?.enum;
|
|
13381
|
+
return resolver?.(ctx$1) ?? enumResolver$1(ctx$1);
|
|
13197
13382
|
};
|
|
13198
13383
|
|
|
13199
13384
|
//#endregion
|
|
@@ -13210,7 +13395,7 @@ const nullToAst$1 = ({ plugin }) => {
|
|
|
13210
13395
|
|
|
13211
13396
|
//#endregion
|
|
13212
13397
|
//#region src/plugins/zod/v3/toAst/number.ts
|
|
13213
|
-
function baseNode$
|
|
13398
|
+
function baseNode$6(ctx$1) {
|
|
13214
13399
|
const { schema, symbols } = ctx$1;
|
|
13215
13400
|
const { z } = symbols;
|
|
13216
13401
|
if (ctx$1.utils.shouldCoerceToBigInt(schema.format)) return $(z).attr(identifiers.coerce).attr(identifiers.bigint).call();
|
|
@@ -13244,8 +13429,8 @@ function numberResolver$1(ctx$1) {
|
|
|
13244
13429
|
ctx$1.chain.current = constNode$8;
|
|
13245
13430
|
return ctx$1.chain.current;
|
|
13246
13431
|
}
|
|
13247
|
-
const baseNode$
|
|
13248
|
-
if (baseNode$
|
|
13432
|
+
const baseNode$16 = ctx$1.nodes.base(ctx$1);
|
|
13433
|
+
if (baseNode$16) ctx$1.chain.current = baseNode$16;
|
|
13249
13434
|
const minNode$4 = ctx$1.nodes.min(ctx$1);
|
|
13250
13435
|
if (minNode$4) ctx$1.chain.current = minNode$4;
|
|
13251
13436
|
const maxNode$4 = ctx$1.nodes.max(ctx$1);
|
|
@@ -13259,7 +13444,7 @@ const numberToNode$1 = ({ plugin, schema, state }) => {
|
|
|
13259
13444
|
$,
|
|
13260
13445
|
chain: { current: $(z) },
|
|
13261
13446
|
nodes: {
|
|
13262
|
-
base: baseNode$
|
|
13447
|
+
base: baseNode$6,
|
|
13263
13448
|
const: constNode$3,
|
|
13264
13449
|
max: maxNode$1,
|
|
13265
13450
|
min: minNode$1
|
|
@@ -13295,7 +13480,7 @@ function additionalPropertiesNode$1(ctx$1) {
|
|
|
13295
13480
|
if (additionalAst.hasLazyExpression) ctx$1.utils.ast.hasLazyExpression = true;
|
|
13296
13481
|
return additionalAst.expression;
|
|
13297
13482
|
}
|
|
13298
|
-
function baseNode$
|
|
13483
|
+
function baseNode$5(ctx$1) {
|
|
13299
13484
|
const { nodes, symbols } = ctx$1;
|
|
13300
13485
|
const { z } = symbols;
|
|
13301
13486
|
const additional = nodes.additionalProperties(ctx$1);
|
|
@@ -13337,7 +13522,7 @@ const objectToAst$1 = ({ plugin, schema, state }) => {
|
|
|
13337
13522
|
chain: { current: $(z) },
|
|
13338
13523
|
nodes: {
|
|
13339
13524
|
additionalProperties: additionalPropertiesNode$1,
|
|
13340
|
-
base: baseNode$
|
|
13525
|
+
base: baseNode$5,
|
|
13341
13526
|
shape: shapeNode$1
|
|
13342
13527
|
},
|
|
13343
13528
|
plugin,
|
|
@@ -13358,7 +13543,7 @@ const objectToAst$1 = ({ plugin, schema, state }) => {
|
|
|
13358
13543
|
|
|
13359
13544
|
//#endregion
|
|
13360
13545
|
//#region src/plugins/zod/v3/toAst/string.ts
|
|
13361
|
-
function baseNode$
|
|
13546
|
+
function baseNode$4(ctx$1) {
|
|
13362
13547
|
const { z } = ctx$1.symbols;
|
|
13363
13548
|
return $(z).attr(identifiers.string).call();
|
|
13364
13549
|
}
|
|
@@ -13410,8 +13595,8 @@ function stringResolver$1(ctx$1) {
|
|
|
13410
13595
|
ctx$1.chain.current = constNode$8;
|
|
13411
13596
|
return ctx$1.chain.current;
|
|
13412
13597
|
}
|
|
13413
|
-
const baseNode$
|
|
13414
|
-
if (baseNode$
|
|
13598
|
+
const baseNode$16 = ctx$1.nodes.base(ctx$1);
|
|
13599
|
+
if (baseNode$16) ctx$1.chain.current = baseNode$16;
|
|
13415
13600
|
const formatNode$4 = ctx$1.nodes.format(ctx$1);
|
|
13416
13601
|
if (formatNode$4) ctx$1.chain.current = formatNode$4;
|
|
13417
13602
|
const lengthNode$4 = ctx$1.nodes.length(ctx$1);
|
|
@@ -13432,7 +13617,7 @@ const stringToNode$1 = ({ plugin, schema }) => {
|
|
|
13432
13617
|
$,
|
|
13433
13618
|
chain: { current: $(z) },
|
|
13434
13619
|
nodes: {
|
|
13435
|
-
base: baseNode$
|
|
13620
|
+
base: baseNode$4,
|
|
13436
13621
|
const: constNode$2,
|
|
13437
13622
|
format: formatNode$1,
|
|
13438
13623
|
length: lengthNode$1,
|
|
@@ -13818,9 +14003,9 @@ const booleanToAst = ({ plugin, schema }) => {
|
|
|
13818
14003
|
|
|
13819
14004
|
//#endregion
|
|
13820
14005
|
//#region src/plugins/zod/v4/toAst/enum.ts
|
|
13821
|
-
|
|
13822
|
-
const
|
|
13823
|
-
const z =
|
|
14006
|
+
function itemsNode(ctx$1) {
|
|
14007
|
+
const { schema, symbols } = ctx$1;
|
|
14008
|
+
const { z } = symbols;
|
|
13824
14009
|
const enumMembers = [];
|
|
13825
14010
|
const literalMembers = [];
|
|
13826
14011
|
let isNullable = false;
|
|
@@ -13838,16 +14023,78 @@ const enumToAst = ({ plugin, schema, state }) => {
|
|
|
13838
14023
|
const literal = $.literal(item.const);
|
|
13839
14024
|
literalMembers.push($(z).attr(identifiers.literal).call(literal));
|
|
13840
14025
|
} else if (item.type === "null" || item.const === null) isNullable = true;
|
|
14026
|
+
return {
|
|
14027
|
+
allStrings,
|
|
14028
|
+
enumMembers,
|
|
14029
|
+
isNullable,
|
|
14030
|
+
literalMembers
|
|
14031
|
+
};
|
|
14032
|
+
}
|
|
14033
|
+
function baseNode$3(ctx$1) {
|
|
14034
|
+
const { symbols } = ctx$1;
|
|
14035
|
+
const { z } = symbols;
|
|
14036
|
+
const { allStrings, enumMembers, literalMembers } = ctx$1.nodes.items(ctx$1);
|
|
14037
|
+
if (allStrings && enumMembers.length > 0) return $(z).attr(identifiers.enum).call($.array(...enumMembers));
|
|
14038
|
+
else if (literalMembers.length === 1) return literalMembers[0];
|
|
14039
|
+
else return $(z).attr(identifiers.union).call($.array(...literalMembers));
|
|
14040
|
+
}
|
|
14041
|
+
function nullableNode(ctx$1) {
|
|
14042
|
+
const { chain, symbols } = ctx$1;
|
|
14043
|
+
const { z } = symbols;
|
|
14044
|
+
const { isNullable } = ctx$1.nodes.items(ctx$1);
|
|
14045
|
+
if (!isNullable) return;
|
|
14046
|
+
return $(z).attr(identifiers.nullable).call(chain.current);
|
|
14047
|
+
}
|
|
14048
|
+
function enumResolver(ctx$1) {
|
|
14049
|
+
const { literalMembers } = ctx$1.nodes.items(ctx$1);
|
|
14050
|
+
if (!literalMembers.length) return ctx$1.chain.current;
|
|
14051
|
+
const baseExpression = ctx$1.nodes.base(ctx$1);
|
|
14052
|
+
ctx$1.chain.current = baseExpression;
|
|
14053
|
+
const nullableExpression = ctx$1.nodes.nullable(ctx$1);
|
|
14054
|
+
if (nullableExpression) ctx$1.chain.current = nullableExpression;
|
|
14055
|
+
return ctx$1.chain.current;
|
|
14056
|
+
}
|
|
14057
|
+
const enumToAst = ({ plugin, schema, state }) => {
|
|
14058
|
+
const z = plugin.external("zod.z");
|
|
14059
|
+
const { literalMembers } = itemsNode({
|
|
14060
|
+
$,
|
|
14061
|
+
chain: { current: $(z) },
|
|
14062
|
+
nodes: {
|
|
14063
|
+
base: baseNode$3,
|
|
14064
|
+
items: itemsNode,
|
|
14065
|
+
nullable: nullableNode
|
|
14066
|
+
},
|
|
14067
|
+
plugin,
|
|
14068
|
+
schema,
|
|
14069
|
+
symbols: { z },
|
|
14070
|
+
utils: {
|
|
14071
|
+
ast: {},
|
|
14072
|
+
state
|
|
14073
|
+
}
|
|
14074
|
+
});
|
|
13841
14075
|
if (!literalMembers.length) return unknownToAst({
|
|
13842
14076
|
plugin,
|
|
13843
14077
|
schema: { type: "unknown" },
|
|
13844
14078
|
state
|
|
13845
14079
|
});
|
|
13846
|
-
|
|
13847
|
-
|
|
13848
|
-
|
|
13849
|
-
|
|
13850
|
-
|
|
14080
|
+
const ctx$1 = {
|
|
14081
|
+
$,
|
|
14082
|
+
chain: { current: $(z) },
|
|
14083
|
+
nodes: {
|
|
14084
|
+
base: baseNode$3,
|
|
14085
|
+
items: itemsNode,
|
|
14086
|
+
nullable: nullableNode
|
|
14087
|
+
},
|
|
14088
|
+
plugin,
|
|
14089
|
+
schema,
|
|
14090
|
+
symbols: { z },
|
|
14091
|
+
utils: {
|
|
14092
|
+
ast: {},
|
|
14093
|
+
state
|
|
14094
|
+
}
|
|
14095
|
+
};
|
|
14096
|
+
const resolver = plugin.config["~resolvers"]?.enum;
|
|
14097
|
+
return { expression: resolver?.(ctx$1) ?? enumResolver(ctx$1) };
|
|
13851
14098
|
};
|
|
13852
14099
|
|
|
13853
14100
|
//#endregion
|
|
@@ -13902,8 +14149,8 @@ function numberResolver(ctx$1) {
|
|
|
13902
14149
|
ctx$1.chain.current = constNode$8;
|
|
13903
14150
|
return ctx$1.chain.current;
|
|
13904
14151
|
}
|
|
13905
|
-
const baseNode$
|
|
13906
|
-
if (baseNode$
|
|
14152
|
+
const baseNode$16 = ctx$1.nodes.base(ctx$1);
|
|
14153
|
+
if (baseNode$16) ctx$1.chain.current = baseNode$16;
|
|
13907
14154
|
const minNode$4 = ctx$1.nodes.min(ctx$1);
|
|
13908
14155
|
if (minNode$4) ctx$1.chain.current = minNode$4;
|
|
13909
14156
|
const maxNode$4 = ctx$1.nodes.max(ctx$1);
|
|
@@ -14069,8 +14316,8 @@ function stringResolver(ctx$1) {
|
|
|
14069
14316
|
ctx$1.chain.current = constNode$8;
|
|
14070
14317
|
return ctx$1.chain.current;
|
|
14071
14318
|
}
|
|
14072
|
-
const baseNode$
|
|
14073
|
-
if (baseNode$
|
|
14319
|
+
const baseNode$16 = ctx$1.nodes.base(ctx$1);
|
|
14320
|
+
if (baseNode$16) ctx$1.chain.current = baseNode$16;
|
|
14074
14321
|
const formatNode$4 = ctx$1.nodes.format(ctx$1);
|
|
14075
14322
|
if (formatNode$4) ctx$1.chain.current = formatNode$4;
|
|
14076
14323
|
const lengthNode$4 = ctx$1.nodes.length(ctx$1);
|
|
@@ -21486,4 +21733,4 @@ const parseOpenApiSpec = ({ config, dependencies, logger, spec }) => {
|
|
|
21486
21733
|
|
|
21487
21734
|
//#endregion
|
|
21488
21735
|
export { openGitHubIssueWithCrashReport as A, defaultPaginationKeywords as C, ConfigValidationError as D, ConfigError as E, shouldReportCrash as M, loadPackageJson as N, JobError as O, definePluginConfig as S, getLogs as T, regexp as _, defaultPlugins as a, OperationPath as b, clientDefaultConfig as c, $ as d, TypeScriptRenderer as f, keywords as g, reserved as h, initConfigs as i, printCrashReport as j, logCrashReport as k, clientDefaultMeta as l, ctx as m, buildGraph as n, clientPluginHandler as o, TsDslContext as p, getSpec as r, generateClientBundle as s, parseOpenApiSpec as t, toCase as u, TsDsl as v, postprocessOutput as w, OperationStrategy as x, getClientPlugin as y };
|
|
21489
|
-
//# sourceMappingURL=openApi-
|
|
21736
|
+
//# sourceMappingURL=openApi-B6J9qPwL.mjs.map
|