@kubb/agent 5.0.0-alpha.20 → 5.0.0-alpha.21
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.
|
@@ -4702,7 +4702,7 @@ function createPrinterFactory(getKey) {
|
|
|
4702
4702
|
const { name, options: resolvedOptions, nodes, print: printOverride } = build(options != null ? options : {});
|
|
4703
4703
|
const context = {
|
|
4704
4704
|
options: resolvedOptions,
|
|
4705
|
-
|
|
4705
|
+
transform: (node) => {
|
|
4706
4706
|
const key = getKey(node);
|
|
4707
4707
|
if (key === void 0) return null;
|
|
4708
4708
|
const handler = nodes[key];
|
|
@@ -4713,7 +4713,8 @@ function createPrinterFactory(getKey) {
|
|
|
4713
4713
|
return {
|
|
4714
4714
|
name,
|
|
4715
4715
|
options: resolvedOptions,
|
|
4716
|
-
|
|
4716
|
+
transform: context.transform,
|
|
4717
|
+
print: printOverride ? printOverride.bind(context) : context.transform
|
|
4717
4718
|
};
|
|
4718
4719
|
};
|
|
4719
4720
|
};
|
|
@@ -6107,7 +6108,7 @@ const fsStorage = createStorage(() => ({
|
|
|
6107
6108
|
await clean(resolve(base));
|
|
6108
6109
|
}
|
|
6109
6110
|
}));
|
|
6110
|
-
var version$1 = "5.0.0-alpha.
|
|
6111
|
+
var version$1 = "5.0.0-alpha.21";
|
|
6111
6112
|
function getDiagnosticInfo() {
|
|
6112
6113
|
return {
|
|
6113
6114
|
nodeVersion: version$2,
|
|
@@ -6402,6 +6403,9 @@ function inputToAdapterSource(config) {
|
|
|
6402
6403
|
function createPlugin(build2) {
|
|
6403
6404
|
return (options) => build2(options != null ? options : {});
|
|
6404
6405
|
}
|
|
6406
|
+
function defineBuilder(build2) {
|
|
6407
|
+
return build2();
|
|
6408
|
+
}
|
|
6405
6409
|
function defineGenerator(generator) {
|
|
6406
6410
|
if (generator.type === "react") return {
|
|
6407
6411
|
version: "2",
|
|
@@ -6430,11 +6434,12 @@ function defineGenerator(generator) {
|
|
|
6430
6434
|
...generator
|
|
6431
6435
|
};
|
|
6432
6436
|
}
|
|
6433
|
-
function definePreset(name, { resolvers, transformers }) {
|
|
6437
|
+
function definePreset(name, { resolvers, transformers, generators }) {
|
|
6434
6438
|
return {
|
|
6435
6439
|
name,
|
|
6436
6440
|
resolvers,
|
|
6437
|
-
transformers
|
|
6441
|
+
transformers,
|
|
6442
|
+
generators
|
|
6438
6443
|
};
|
|
6439
6444
|
}
|
|
6440
6445
|
function definePresets(presets) {
|
|
@@ -6493,25 +6498,98 @@ function defaultResolveOptions(node, { options, exclude = [], include, override
|
|
|
6493
6498
|
}
|
|
6494
6499
|
return options;
|
|
6495
6500
|
}
|
|
6501
|
+
function defaultResolvePath({ baseName, pathMode, tag, path: groupPath }, { root, output, group }) {
|
|
6502
|
+
if ((pathMode != null ? pathMode : getMode(path$2.resolve(root, output.path))) === "single") return path$2.resolve(root, output.path);
|
|
6503
|
+
if (group && (groupPath || tag)) {
|
|
6504
|
+
const groupName = group.name ? group.name : (ctx) => {
|
|
6505
|
+
if (group.type === "path") return `${ctx.group.split("/")[1]}`;
|
|
6506
|
+
return `${camelCase$e(ctx.group)}Controller`;
|
|
6507
|
+
};
|
|
6508
|
+
return path$2.resolve(root, output.path, groupName({ group: group.type === "path" ? groupPath : tag }), baseName);
|
|
6509
|
+
}
|
|
6510
|
+
return path$2.resolve(root, output.path, baseName);
|
|
6511
|
+
}
|
|
6512
|
+
function defaultResolveFile({ name, extname: extname2, tag, path: groupPath }, context) {
|
|
6513
|
+
const pathMode = getMode(path$2.resolve(context.root, context.output.path));
|
|
6514
|
+
const baseName = `${pathMode === "single" ? "" : this.default(name, "file")}${extname2}`;
|
|
6515
|
+
const filePath = this.resolvePath({
|
|
6516
|
+
baseName,
|
|
6517
|
+
pathMode,
|
|
6518
|
+
tag,
|
|
6519
|
+
path: groupPath
|
|
6520
|
+
}, context);
|
|
6521
|
+
return {
|
|
6522
|
+
path: filePath,
|
|
6523
|
+
baseName: path$2.basename(filePath),
|
|
6524
|
+
meta: { pluginName: this.pluginName },
|
|
6525
|
+
sources: [],
|
|
6526
|
+
imports: [],
|
|
6527
|
+
exports: []
|
|
6528
|
+
};
|
|
6529
|
+
}
|
|
6530
|
+
function buildDefaultBanner({ title, description, version: version2, config }) {
|
|
6531
|
+
try {
|
|
6532
|
+
let source = "";
|
|
6533
|
+
if (Array.isArray(config.input)) {
|
|
6534
|
+
const first = config.input[0];
|
|
6535
|
+
if (first && "path" in first) source = path$2.basename(first.path);
|
|
6536
|
+
} else if ("path" in config.input) source = path$2.basename(config.input.path);
|
|
6537
|
+
else if ("data" in config.input) source = "text content";
|
|
6538
|
+
let banner = "/**\n* Generated by Kubb (https://kubb.dev/).\n* Do not edit manually.\n";
|
|
6539
|
+
if (config.output.defaultBanner === "simple") {
|
|
6540
|
+
banner += "*/\n";
|
|
6541
|
+
return banner;
|
|
6542
|
+
}
|
|
6543
|
+
if (source) banner += `* Source: ${source}
|
|
6544
|
+
`;
|
|
6545
|
+
if (title) banner += `* Title: ${title}
|
|
6546
|
+
`;
|
|
6547
|
+
if (description) {
|
|
6548
|
+
const formattedDescription = description.replace(/\n/gm, "\n* ");
|
|
6549
|
+
banner += `* Description: ${formattedDescription}
|
|
6550
|
+
`;
|
|
6551
|
+
}
|
|
6552
|
+
if (version2) banner += `* OpenAPI spec version: ${version2}
|
|
6553
|
+
`;
|
|
6554
|
+
banner += "*/\n";
|
|
6555
|
+
return banner;
|
|
6556
|
+
} catch (_error) {
|
|
6557
|
+
return "/**\n* Generated by Kubb (https://kubb.dev/).\n* Do not edit manually.\n*/";
|
|
6558
|
+
}
|
|
6559
|
+
}
|
|
6560
|
+
function defaultResolveBanner(node, { output, config }) {
|
|
6561
|
+
if (typeof (output == null ? void 0 : output.banner) === "function") return node ? output.banner(node) : buildDefaultBanner({ config });
|
|
6562
|
+
if (typeof (output == null ? void 0 : output.banner) === "string") return output.banner;
|
|
6563
|
+
if (config.output.defaultBanner === false) return;
|
|
6564
|
+
return buildDefaultBanner({ config });
|
|
6565
|
+
}
|
|
6566
|
+
function defaultResolveFooter(node, { output }) {
|
|
6567
|
+
if (typeof (output == null ? void 0 : output.footer) === "function") return node ? output.footer(node) : void 0;
|
|
6568
|
+
if (typeof (output == null ? void 0 : output.footer) === "string") return output.footer;
|
|
6569
|
+
}
|
|
6496
6570
|
function defineResolver(build2) {
|
|
6497
6571
|
return {
|
|
6498
6572
|
default: defaultResolver,
|
|
6499
6573
|
resolveOptions: defaultResolveOptions,
|
|
6574
|
+
resolvePath: defaultResolvePath,
|
|
6575
|
+
resolveFile: defaultResolveFile,
|
|
6576
|
+
resolveBanner: defaultResolveBanner,
|
|
6577
|
+
resolveFooter: defaultResolveFooter,
|
|
6500
6578
|
...build2()
|
|
6501
6579
|
};
|
|
6502
6580
|
}
|
|
6503
6581
|
async function renderOperation$1(node, options) {
|
|
6504
|
-
const { config, fabric, plugin, Component, adapter, driver
|
|
6582
|
+
const { config, fabric, plugin, Component, adapter, driver } = options;
|
|
6505
6583
|
if (!Component) return;
|
|
6506
6584
|
const fabricChild = createReactFabric();
|
|
6507
6585
|
await fabricChild.render(/* @__PURE__ */ jsx(Fabric, {
|
|
6508
6586
|
meta: {
|
|
6509
6587
|
plugin,
|
|
6510
|
-
driver
|
|
6511
|
-
mode
|
|
6588
|
+
driver
|
|
6512
6589
|
},
|
|
6513
6590
|
children: /* @__PURE__ */ jsx(Component, {
|
|
6514
6591
|
config,
|
|
6592
|
+
plugin,
|
|
6515
6593
|
adapter,
|
|
6516
6594
|
node,
|
|
6517
6595
|
options: options.options
|
|
@@ -6521,17 +6599,17 @@ async function renderOperation$1(node, options) {
|
|
|
6521
6599
|
fabricChild.unmount();
|
|
6522
6600
|
}
|
|
6523
6601
|
async function renderSchema$1(node, options) {
|
|
6524
|
-
const { config, fabric, plugin, Component, adapter, driver
|
|
6602
|
+
const { config, fabric, plugin, Component, adapter, driver } = options;
|
|
6525
6603
|
if (!Component) return;
|
|
6526
6604
|
const fabricChild = createReactFabric();
|
|
6527
6605
|
await fabricChild.render(/* @__PURE__ */ jsx(Fabric, {
|
|
6528
6606
|
meta: {
|
|
6529
6607
|
plugin,
|
|
6530
|
-
driver
|
|
6531
|
-
mode
|
|
6608
|
+
driver
|
|
6532
6609
|
},
|
|
6533
6610
|
children: /* @__PURE__ */ jsx(Component, {
|
|
6534
6611
|
config,
|
|
6612
|
+
plugin,
|
|
6535
6613
|
adapter,
|
|
6536
6614
|
node,
|
|
6537
6615
|
options: options.options
|
|
@@ -6806,7 +6884,7 @@ function getBarrelFilesByRoot(root, files) {
|
|
|
6806
6884
|
const cachedFiles = /* @__PURE__ */ new Map();
|
|
6807
6885
|
(_a2 = TreeNode.build(files, root)) == null ? void 0 : _a2.forEach((treeNode) => {
|
|
6808
6886
|
var _a3, _b2, _c2;
|
|
6809
|
-
if (!treeNode
|
|
6887
|
+
if (!(treeNode == null ? void 0 : treeNode.children) || !((_a3 = treeNode.parent) == null ? void 0 : _a3.data.path)) return;
|
|
6810
6888
|
const barrelFile = {
|
|
6811
6889
|
path: join((_b2 = treeNode.parent) == null ? void 0 : _b2.data.path, "index.ts"),
|
|
6812
6890
|
baseName: "index.ts",
|
|
@@ -6883,15 +6961,18 @@ function mergeResolvers(...resolvers) {
|
|
|
6883
6961
|
}), resolvers[0]);
|
|
6884
6962
|
}
|
|
6885
6963
|
function getPreset(params) {
|
|
6886
|
-
var _a2, _b2;
|
|
6887
|
-
const { preset: presetName, presets, resolvers, transformers: userTransformers } = params;
|
|
6964
|
+
var _a2, _b2, _c2, _d2, _e2;
|
|
6965
|
+
const { preset: presetName, presets, resolvers, transformers: userTransformers, generators: userGenerators } = params;
|
|
6888
6966
|
const [defaultResolver2, ...userResolvers] = resolvers;
|
|
6889
6967
|
const preset = presets[presetName];
|
|
6890
|
-
const
|
|
6968
|
+
const resolver = mergeResolvers(mergeResolvers(defaultResolver2, ...(_a2 = preset == null ? void 0 : preset.resolvers) != null ? _a2 : []), ...userResolvers != null ? userResolvers : []);
|
|
6969
|
+
const transformers = [...(_b2 = preset == null ? void 0 : preset.transformers) != null ? _b2 : [], ...userTransformers != null ? userTransformers : []];
|
|
6970
|
+
const presetGenerators = (_c2 = preset == null ? void 0 : preset.generators) != null ? _c2 : [];
|
|
6971
|
+
const defaultPresetGenerators = (_e2 = (_d2 = presets["default"]) == null ? void 0 : _d2.generators) != null ? _e2 : [];
|
|
6891
6972
|
return {
|
|
6892
|
-
|
|
6893
|
-
|
|
6894
|
-
|
|
6973
|
+
resolver,
|
|
6974
|
+
transformers,
|
|
6975
|
+
generators: presetGenerators.length > 0 || userGenerators.length ? [...presetGenerators, ...userGenerators] : defaultPresetGenerators,
|
|
6895
6976
|
preset
|
|
6896
6977
|
};
|
|
6897
6978
|
}
|
|
@@ -6940,7 +7021,7 @@ function satisfiesDependency(dependency, version2, cwd) {
|
|
|
6940
7021
|
return satisfies(semVer, version2);
|
|
6941
7022
|
}
|
|
6942
7023
|
|
|
6943
|
-
var version = "5.0.0-alpha.
|
|
7024
|
+
var version = "5.0.0-alpha.21";
|
|
6944
7025
|
|
|
6945
7026
|
function isCommandMessage(msg) {
|
|
6946
7027
|
return msg.type === "command";
|
|
@@ -9425,7 +9506,7 @@ function getImports(tree) {
|
|
|
9425
9506
|
}).filter((x) => x !== void 0);
|
|
9426
9507
|
}
|
|
9427
9508
|
function getASTParams(operationSchema, { typed = false, casing, override } = {}) {
|
|
9428
|
-
if (!operationSchema
|
|
9509
|
+
if (!(operationSchema == null ? void 0 : operationSchema.schema.properties) || !operationSchema.name) return [];
|
|
9429
9510
|
const requiredFields = Array.isArray(operationSchema.schema.required) ? operationSchema.schema.required : [];
|
|
9430
9511
|
return Object.entries(operationSchema.schema.properties).map(([name]) => {
|
|
9431
9512
|
const accessName = casing === "camelcase" ? camelCase$d(name) : name;
|
|
@@ -9454,7 +9535,7 @@ function getPathParams(operationSchema, options = {}) {
|
|
|
9454
9535
|
}, {});
|
|
9455
9536
|
}
|
|
9456
9537
|
function getParamsMapping(operationSchema, options = {}) {
|
|
9457
|
-
if (!operationSchema
|
|
9538
|
+
if (!(operationSchema == null ? void 0 : operationSchema.schema.properties)) return;
|
|
9458
9539
|
const allEntries = [];
|
|
9459
9540
|
let hasTransformation = false;
|
|
9460
9541
|
Object.entries(operationSchema.schema.properties).forEach(([originalName]) => {
|
|
@@ -11361,6 +11442,116 @@ var __name$5 = (target, value) => __defProp$c(target, "name", {
|
|
|
11361
11442
|
configurable: true
|
|
11362
11443
|
});
|
|
11363
11444
|
|
|
11445
|
+
const builderTs = defineBuilder(() => ({
|
|
11446
|
+
name: "default",
|
|
11447
|
+
buildParams({ params, node, resolver }) {
|
|
11448
|
+
return createSchema({
|
|
11449
|
+
type: "object",
|
|
11450
|
+
properties: params.map((param) => createProperty({
|
|
11451
|
+
name: param.name,
|
|
11452
|
+
required: param.required,
|
|
11453
|
+
schema: createSchema({
|
|
11454
|
+
type: "ref",
|
|
11455
|
+
name: resolver.resolveParamName(node, param)
|
|
11456
|
+
})
|
|
11457
|
+
}))
|
|
11458
|
+
});
|
|
11459
|
+
},
|
|
11460
|
+
buildData({ node, resolver }) {
|
|
11461
|
+
var _a;
|
|
11462
|
+
const pathParams = node.parameters.filter((p) => p.in === "path");
|
|
11463
|
+
const queryParams = node.parameters.filter((p) => p.in === "query");
|
|
11464
|
+
const headerParams = node.parameters.filter((p) => p.in === "header");
|
|
11465
|
+
return createSchema({
|
|
11466
|
+
type: "object",
|
|
11467
|
+
deprecated: node.deprecated,
|
|
11468
|
+
properties: [
|
|
11469
|
+
createProperty({
|
|
11470
|
+
name: "data",
|
|
11471
|
+
schema: ((_a = node.requestBody) == null ? void 0 : _a.schema) ? createSchema({
|
|
11472
|
+
type: "ref",
|
|
11473
|
+
name: resolver.resolveDataTypedName(node),
|
|
11474
|
+
optional: true
|
|
11475
|
+
}) : createSchema({
|
|
11476
|
+
type: "never",
|
|
11477
|
+
optional: true
|
|
11478
|
+
})
|
|
11479
|
+
}),
|
|
11480
|
+
createProperty({
|
|
11481
|
+
name: "pathParams",
|
|
11482
|
+
required: pathParams.length > 0,
|
|
11483
|
+
schema: pathParams.length > 0 ? this.buildParams({
|
|
11484
|
+
params: pathParams,
|
|
11485
|
+
node,
|
|
11486
|
+
resolver
|
|
11487
|
+
}) : createSchema({ type: "never" })
|
|
11488
|
+
}),
|
|
11489
|
+
createProperty({
|
|
11490
|
+
name: "queryParams",
|
|
11491
|
+
schema: queryParams.length > 0 ? createSchema({
|
|
11492
|
+
...this.buildParams({
|
|
11493
|
+
params: queryParams,
|
|
11494
|
+
node,
|
|
11495
|
+
resolver
|
|
11496
|
+
}),
|
|
11497
|
+
optional: true
|
|
11498
|
+
}) : createSchema({
|
|
11499
|
+
type: "never",
|
|
11500
|
+
optional: true
|
|
11501
|
+
})
|
|
11502
|
+
}),
|
|
11503
|
+
createProperty({
|
|
11504
|
+
name: "headerParams",
|
|
11505
|
+
schema: headerParams.length > 0 ? createSchema({
|
|
11506
|
+
...this.buildParams({
|
|
11507
|
+
params: headerParams,
|
|
11508
|
+
node,
|
|
11509
|
+
resolver
|
|
11510
|
+
}),
|
|
11511
|
+
optional: true
|
|
11512
|
+
}) : createSchema({
|
|
11513
|
+
type: "never",
|
|
11514
|
+
optional: true
|
|
11515
|
+
})
|
|
11516
|
+
}),
|
|
11517
|
+
createProperty({
|
|
11518
|
+
name: "url",
|
|
11519
|
+
required: true,
|
|
11520
|
+
schema: createSchema({
|
|
11521
|
+
type: "url",
|
|
11522
|
+
path: node.path
|
|
11523
|
+
})
|
|
11524
|
+
})
|
|
11525
|
+
]
|
|
11526
|
+
});
|
|
11527
|
+
},
|
|
11528
|
+
buildResponses({ node, resolver }) {
|
|
11529
|
+
if (node.responses.length === 0) return null;
|
|
11530
|
+
return createSchema({
|
|
11531
|
+
type: "object",
|
|
11532
|
+
properties: node.responses.map((res) => createProperty({
|
|
11533
|
+
name: String(res.statusCode),
|
|
11534
|
+
required: true,
|
|
11535
|
+
schema: createSchema({
|
|
11536
|
+
type: "ref",
|
|
11537
|
+
name: resolver.resolveResponseStatusTypedName(node, res.statusCode)
|
|
11538
|
+
})
|
|
11539
|
+
}))
|
|
11540
|
+
});
|
|
11541
|
+
},
|
|
11542
|
+
buildResponseUnion({ node, resolver }) {
|
|
11543
|
+
const responsesWithSchema = node.responses.filter((res) => res.schema);
|
|
11544
|
+
if (responsesWithSchema.length === 0) return null;
|
|
11545
|
+
return createSchema({
|
|
11546
|
+
type: "union",
|
|
11547
|
+
members: responsesWithSchema.map((res) => createSchema({
|
|
11548
|
+
type: "ref",
|
|
11549
|
+
name: resolver.resolveResponseStatusTypedName(node, res.statusCode)
|
|
11550
|
+
}))
|
|
11551
|
+
});
|
|
11552
|
+
}
|
|
11553
|
+
}));
|
|
11554
|
+
|
|
11364
11555
|
function toCamelOrPascal$a(text, pascal) {
|
|
11365
11556
|
return text.trim().replace(/([a-z\d])([A-Z])/g, "$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g, "$1 $2").replace(/(\d)([a-z])/g, "$1 $2").split(/[\s\-_./\\:]+/).filter(Boolean).map((word, i) => {
|
|
11366
11557
|
if (word.length > 1 && word === word.toUpperCase()) return word;
|
|
@@ -209651,37 +209842,37 @@ const printerTs = definePrinter((options) => {
|
|
|
209651
209842
|
nodes: [keywordTypeNodes.string, createTypeLiteralNode([])],
|
|
209652
209843
|
withParentheses: true
|
|
209653
209844
|
});
|
|
209654
|
-
return this.
|
|
209845
|
+
return this.transform(m);
|
|
209655
209846
|
}).filter(Boolean)
|
|
209656
209847
|
})) != null ? _b : void 0;
|
|
209657
209848
|
return (_c = createUnionDeclaration({
|
|
209658
209849
|
withParentheses: true,
|
|
209659
|
-
nodes: buildMemberNodes(members, this.
|
|
209850
|
+
nodes: buildMemberNodes(members, this.transform)
|
|
209660
209851
|
})) != null ? _c : void 0;
|
|
209661
209852
|
},
|
|
209662
209853
|
intersection(node) {
|
|
209663
209854
|
var _a;
|
|
209664
209855
|
return (_a = createIntersectionDeclaration({
|
|
209665
209856
|
withParentheses: true,
|
|
209666
|
-
nodes: buildMemberNodes(node.members, this.
|
|
209857
|
+
nodes: buildMemberNodes(node.members, this.transform)
|
|
209667
209858
|
})) != null ? _a : void 0;
|
|
209668
209859
|
},
|
|
209669
209860
|
array(node) {
|
|
209670
209861
|
var _a, _b;
|
|
209671
209862
|
return (_b = createArrayDeclaration({
|
|
209672
|
-
nodes: ((_a = node.items) != null ? _a : []).map((item) => this.
|
|
209863
|
+
nodes: ((_a = node.items) != null ? _a : []).map((item) => this.transform(item)).filter(Boolean),
|
|
209673
209864
|
arrayType: this.options.arrayType
|
|
209674
209865
|
})) != null ? _b : void 0;
|
|
209675
209866
|
},
|
|
209676
209867
|
tuple(node) {
|
|
209677
|
-
return buildTupleNode(node, this.
|
|
209868
|
+
return buildTupleNode(node, this.transform);
|
|
209678
209869
|
},
|
|
209679
209870
|
object(node) {
|
|
209680
|
-
const {
|
|
209871
|
+
const { transform, options: options2 } = this;
|
|
209681
209872
|
const addsQuestionToken = OPTIONAL_ADDS_QUESTION_TOKEN.has(options2.optionalType);
|
|
209682
209873
|
const propertyNodes = node.properties.map((prop) => {
|
|
209683
209874
|
var _a;
|
|
209684
|
-
const baseType = (_a =
|
|
209875
|
+
const baseType = (_a = transform(prop.schema)) != null ? _a : keywordTypeNodes.unknown;
|
|
209685
209876
|
const type = buildPropertyType(prop.schema, baseType, options2.optionalType);
|
|
209686
209877
|
return appendJSDocToNode({
|
|
209687
209878
|
node: createPropertySignature({
|
|
@@ -209693,20 +209884,20 @@ const printerTs = definePrinter((options) => {
|
|
|
209693
209884
|
comments: buildPropertyJSDocComments(prop.schema)
|
|
209694
209885
|
});
|
|
209695
209886
|
});
|
|
209696
|
-
const allElements = [...propertyNodes, ...buildIndexSignatures(node, propertyNodes.length,
|
|
209887
|
+
const allElements = [...propertyNodes, ...buildIndexSignatures(node, propertyNodes.length, transform)];
|
|
209697
209888
|
if (!allElements.length) return keywordTypeNodes.object;
|
|
209698
209889
|
return createTypeLiteralNode(allElements);
|
|
209699
209890
|
}
|
|
209700
209891
|
},
|
|
209701
209892
|
print(node) {
|
|
209702
|
-
let type = this.
|
|
209703
|
-
if (!type) return;
|
|
209893
|
+
let type = this.transform(node);
|
|
209894
|
+
if (!type) return null;
|
|
209704
209895
|
if (node.nullable) type = createUnionDeclaration({ nodes: [type, keywordTypeNodes.null] });
|
|
209705
209896
|
if ((node.nullish || node.optional) && addsUndefined) type = createUnionDeclaration({ nodes: [type, keywordTypeNodes.undefined] });
|
|
209706
209897
|
const { typeName, syntaxType = "type", description, keysToOmit } = this.options;
|
|
209707
|
-
if (!typeName) return type;
|
|
209898
|
+
if (!typeName) return safePrint(type);
|
|
209708
209899
|
const useTypeGeneration = syntaxType === "type" || type.kind === syntaxKind.union || !!(keysToOmit == null ? void 0 : keysToOmit.length);
|
|
209709
|
-
return createTypeDeclaration({
|
|
209900
|
+
return safePrint(createTypeDeclaration({
|
|
209710
209901
|
name: typeName,
|
|
209711
209902
|
isExportable: true,
|
|
209712
209903
|
type: (keysToOmit == null ? void 0 : keysToOmit.length) ? createOmitDeclaration({
|
|
@@ -209725,10 +209916,11 @@ const printerTs = definePrinter((options) => {
|
|
|
209725
209916
|
(node == null ? void 0 : node.default) ? `@default ${node.default}` : void 0,
|
|
209726
209917
|
(node == null ? void 0 : node.example) ? `@example ${node.example}` : void 0
|
|
209727
209918
|
]
|
|
209728
|
-
});
|
|
209919
|
+
}));
|
|
209729
209920
|
}
|
|
209730
209921
|
};
|
|
209731
209922
|
});
|
|
209923
|
+
|
|
209732
209924
|
function getEnumNames({ node, enumType, resolver }) {
|
|
209733
209925
|
const resolved = resolver.default(node.name, "type");
|
|
209734
209926
|
return {
|
|
@@ -209782,7 +209974,7 @@ function Type({ name, typedName, node, keysToOmit, optionalType, arrayType, synt
|
|
|
209782
209974
|
const enumNode = narrowSchema(n, schemaTypes.enum);
|
|
209783
209975
|
if (enumNode == null ? void 0 : enumNode.name) return enumNode;
|
|
209784
209976
|
} });
|
|
209785
|
-
const
|
|
209977
|
+
const output = printerTs({
|
|
209786
209978
|
optionalType,
|
|
209787
209979
|
arrayType,
|
|
209788
209980
|
enumType,
|
|
@@ -209792,7 +209984,7 @@ function Type({ name, typedName, node, keysToOmit, optionalType, arrayType, synt
|
|
|
209792
209984
|
keysToOmit,
|
|
209793
209985
|
resolver
|
|
209794
209986
|
}).print(node);
|
|
209795
|
-
if (!
|
|
209987
|
+
if (!output) return;
|
|
209796
209988
|
const enums = [...new Map(enumSchemaNodes.map((n) => [n.name, n])).values()].map((node2) => {
|
|
209797
209989
|
return {
|
|
209798
209990
|
node: node2,
|
|
@@ -209815,194 +210007,337 @@ function Type({ name, typedName, node, keysToOmit, optionalType, arrayType, synt
|
|
|
209815
210007
|
isTypeOnly: true,
|
|
209816
210008
|
isExportable: true,
|
|
209817
210009
|
isIndexable: true,
|
|
209818
|
-
children:
|
|
210010
|
+
children: output
|
|
209819
210011
|
})] });
|
|
209820
210012
|
}
|
|
209821
210013
|
|
|
209822
|
-
function
|
|
209823
|
-
|
|
209824
|
-
let source = "";
|
|
209825
|
-
if (Array.isArray(config.input)) {
|
|
209826
|
-
const first = config.input[0];
|
|
209827
|
-
if (first && "path" in first) source = path$2.basename(first.path);
|
|
209828
|
-
} else if ("path" in config.input) source = path$2.basename(config.input.path);
|
|
209829
|
-
else if ("data" in config.input) source = "text content";
|
|
209830
|
-
let banner = "/**\n* Generated by Kubb (https://kubb.dev/).\n* Do not edit manually.\n";
|
|
209831
|
-
if (config.output.defaultBanner === "simple") {
|
|
209832
|
-
banner += "*/\n";
|
|
209833
|
-
return banner;
|
|
209834
|
-
}
|
|
209835
|
-
if (source) banner += `* Source: ${source}
|
|
209836
|
-
`;
|
|
209837
|
-
if (title) banner += `* Title: ${title}
|
|
209838
|
-
`;
|
|
209839
|
-
if (description) {
|
|
209840
|
-
const formattedDescription = description.replace(/\n/gm, "\n* ");
|
|
209841
|
-
banner += `* Description: ${formattedDescription}
|
|
209842
|
-
`;
|
|
209843
|
-
}
|
|
209844
|
-
if (version) banner += `* OpenAPI spec version: ${version}
|
|
209845
|
-
`;
|
|
209846
|
-
banner += "*/\n";
|
|
209847
|
-
return banner;
|
|
209848
|
-
} catch (_error) {
|
|
209849
|
-
return "/**\n* Generated by Kubb (https://kubb.dev/).\n* Do not edit manually.\n*/";
|
|
209850
|
-
}
|
|
210014
|
+
function resolveName(name, type) {
|
|
210015
|
+
return pascalCase$6(name, { isFile: type === "file" });
|
|
209851
210016
|
}
|
|
209852
|
-
|
|
209853
|
-
var _a;
|
|
209854
|
-
const { meta } = useFabric();
|
|
209855
|
-
const config = meta.driver.config;
|
|
209856
|
-
const defaultPluginName = meta.plugin.name;
|
|
209857
|
-
const output = (_a = meta.plugin.options) == null ? void 0 : _a.output;
|
|
210017
|
+
const resolverTs = defineResolver(() => {
|
|
209858
210018
|
return {
|
|
209859
|
-
|
|
209860
|
-
|
|
209861
|
-
|
|
209862
|
-
|
|
209863
|
-
|
|
209864
|
-
|
|
209865
|
-
|
|
209866
|
-
}
|
|
209867
|
-
|
|
209868
|
-
|
|
209869
|
-
...rest
|
|
209870
|
-
}),
|
|
209871
|
-
resolvePath: ({ pluginName = defaultPluginName, ...rest }) => meta.driver.resolvePath.call(meta.driver, {
|
|
209872
|
-
pluginName,
|
|
209873
|
-
...rest
|
|
209874
|
-
}),
|
|
209875
|
-
resolveBanner: (node) => {
|
|
209876
|
-
if (typeof (output == null ? void 0 : output.banner) === "function") return node ? output.banner(node) : buildDefaultBanner({ config });
|
|
209877
|
-
if (typeof (output == null ? void 0 : output.banner) === "string") return output.banner;
|
|
209878
|
-
if (config.output.defaultBanner === false) return;
|
|
209879
|
-
return buildDefaultBanner({ config });
|
|
210019
|
+
name: "default",
|
|
210020
|
+
pluginName: "plugin-ts",
|
|
210021
|
+
default(name, type) {
|
|
210022
|
+
return resolveName(name, type);
|
|
210023
|
+
},
|
|
210024
|
+
resolveName(name) {
|
|
210025
|
+
return this.default(name, "function");
|
|
210026
|
+
},
|
|
210027
|
+
resolveTypedName(name) {
|
|
210028
|
+
return this.default(name, "type");
|
|
209880
210029
|
},
|
|
209881
|
-
|
|
209882
|
-
|
|
209883
|
-
|
|
210030
|
+
resolvePathName(name, type) {
|
|
210031
|
+
return this.default(name, type);
|
|
210032
|
+
},
|
|
210033
|
+
resolveParamName(node, param) {
|
|
210034
|
+
return this.resolveName(`${node.operationId} ${this.default(param.in)} ${param.name}`);
|
|
210035
|
+
},
|
|
210036
|
+
resolveParamTypedName(node, param) {
|
|
210037
|
+
return this.resolveTypedName(`${node.operationId} ${this.default(param.in)} ${param.name}`);
|
|
210038
|
+
},
|
|
210039
|
+
resolveResponseStatusName(node, statusCode) {
|
|
210040
|
+
return this.resolveName(`${node.operationId} Status ${statusCode}`);
|
|
210041
|
+
},
|
|
210042
|
+
resolveResponseStatusTypedName(node, statusCode) {
|
|
210043
|
+
return this.resolveTypedName(`${node.operationId} Status ${statusCode}`);
|
|
210044
|
+
},
|
|
210045
|
+
resolveDataName(node) {
|
|
210046
|
+
return this.resolveName(`${node.operationId} Data`);
|
|
210047
|
+
},
|
|
210048
|
+
resolveDataTypedName(node) {
|
|
210049
|
+
return this.resolveTypedName(`${node.operationId} Data`);
|
|
210050
|
+
},
|
|
210051
|
+
resolveRequestConfigName(node) {
|
|
210052
|
+
return this.resolveName(`${node.operationId} RequestConfig`);
|
|
210053
|
+
},
|
|
210054
|
+
resolveRequestConfigTypedName(node) {
|
|
210055
|
+
return this.resolveTypedName(`${node.operationId} RequestConfig`);
|
|
210056
|
+
},
|
|
210057
|
+
resolveResponsesName(node) {
|
|
210058
|
+
return this.resolveName(`${node.operationId} Responses`);
|
|
210059
|
+
},
|
|
210060
|
+
resolveResponsesTypedName(node) {
|
|
210061
|
+
return this.resolveTypedName(`${node.operationId} Responses`);
|
|
210062
|
+
},
|
|
210063
|
+
resolveResponseName(node) {
|
|
210064
|
+
return this.resolveName(`${node.operationId} Response`);
|
|
210065
|
+
},
|
|
210066
|
+
resolveResponseTypedName(node) {
|
|
210067
|
+
return this.resolveTypedName(`${node.operationId} Response`);
|
|
210068
|
+
},
|
|
210069
|
+
resolveEnumKeyTypedName(node) {
|
|
210070
|
+
var _a;
|
|
210071
|
+
return `${this.resolveTypedName((_a = node.name) != null ? _a : "")}Key`;
|
|
210072
|
+
},
|
|
210073
|
+
resolvePathParamsName(_node) {
|
|
210074
|
+
throw new Error("resolvePathParamsName is only available with compatibilityPreset: 'kubbV4'. Use resolveParamName per individual parameter instead.");
|
|
210075
|
+
},
|
|
210076
|
+
resolvePathParamsTypedName(_node) {
|
|
210077
|
+
throw new Error("resolvePathParamsTypedName is only available with compatibilityPreset: 'kubbV4'. Use resolveParamTypedName per individual parameter instead.");
|
|
210078
|
+
},
|
|
210079
|
+
resolveQueryParamsName(_node) {
|
|
210080
|
+
throw new Error("resolveQueryParamsName is only available with compatibilityPreset: 'kubbV4'. Use resolveParamName per individual parameter instead.");
|
|
210081
|
+
},
|
|
210082
|
+
resolveQueryParamsTypedName(_node) {
|
|
210083
|
+
throw new Error("resolveQueryParamsTypedName is only available with compatibilityPreset: 'kubbV4'. Use resolveParamTypedName per individual parameter instead.");
|
|
210084
|
+
},
|
|
210085
|
+
resolveHeaderParamsName(_node) {
|
|
210086
|
+
throw new Error("resolveHeaderParamsName is only available with compatibilityPreset: 'kubbV4'. Use resolveParamName per individual parameter instead.");
|
|
210087
|
+
},
|
|
210088
|
+
resolveHeaderParamsTypedName(_node) {
|
|
210089
|
+
throw new Error("resolveHeaderParamsTypedName is only available with compatibilityPreset: 'kubbV4'. Use resolveParamTypedName per individual parameter instead.");
|
|
209884
210090
|
}
|
|
209885
210091
|
};
|
|
209886
|
-
}
|
|
209887
|
-
|
|
209888
|
-
|
|
209889
|
-
|
|
209890
|
-
|
|
209891
|
-
|
|
209892
|
-
|
|
209893
|
-
|
|
209894
|
-
}
|
|
209895
|
-
|
|
209896
|
-
|
|
209897
|
-
|
|
209898
|
-
}
|
|
210092
|
+
});
|
|
210093
|
+
const resolverTsLegacy = defineResolver(() => {
|
|
210094
|
+
return {
|
|
210095
|
+
...resolverTs,
|
|
210096
|
+
pluginName: "plugin-ts",
|
|
210097
|
+
resolveResponseStatusName(node, statusCode) {
|
|
210098
|
+
if (statusCode === "default") return this.resolveName(`${node.operationId} Error`);
|
|
210099
|
+
return this.resolveName(`${node.operationId} ${statusCode}`);
|
|
210100
|
+
},
|
|
210101
|
+
resolveResponseStatusTypedName(node, statusCode) {
|
|
210102
|
+
if (statusCode === "default") return this.resolveTypedName(`${node.operationId} Error`);
|
|
210103
|
+
return this.resolveTypedName(`${node.operationId} ${statusCode}`);
|
|
210104
|
+
},
|
|
210105
|
+
resolveDataName(node) {
|
|
210106
|
+
const suffix = node.method === "GET" ? "QueryRequest" : "MutationRequest";
|
|
210107
|
+
return this.resolveName(`${node.operationId} ${suffix}`);
|
|
210108
|
+
},
|
|
210109
|
+
resolveDataTypedName(node) {
|
|
210110
|
+
const suffix = node.method === "GET" ? "QueryRequest" : "MutationRequest";
|
|
210111
|
+
return this.resolveTypedName(`${node.operationId} ${suffix}`);
|
|
210112
|
+
},
|
|
210113
|
+
resolveResponsesName(node) {
|
|
210114
|
+
const suffix = node.method === "GET" ? "Query" : "Mutation";
|
|
210115
|
+
return `${this.default(node.operationId, "function")}${suffix}`;
|
|
210116
|
+
},
|
|
210117
|
+
resolveResponsesTypedName(node) {
|
|
210118
|
+
const suffix = node.method === "GET" ? "Query" : "Mutation";
|
|
210119
|
+
return `${this.default(node.operationId, "type")}${suffix}`;
|
|
210120
|
+
},
|
|
210121
|
+
resolveResponseName(node) {
|
|
210122
|
+
const suffix = node.method === "GET" ? "QueryResponse" : "MutationResponse";
|
|
210123
|
+
return this.resolveName(`${node.operationId} ${suffix}`);
|
|
210124
|
+
},
|
|
210125
|
+
resolveResponseTypedName(node) {
|
|
210126
|
+
const suffix = node.method === "GET" ? "QueryResponse" : "MutationResponse";
|
|
210127
|
+
return this.resolveTypedName(`${node.operationId} ${suffix}`);
|
|
210128
|
+
},
|
|
210129
|
+
resolvePathParamsName(node) {
|
|
210130
|
+
return this.resolveName(`${node.operationId} PathParams`);
|
|
210131
|
+
},
|
|
210132
|
+
resolvePathParamsTypedName(node) {
|
|
210133
|
+
return this.resolveTypedName(`${node.operationId} PathParams`);
|
|
210134
|
+
},
|
|
210135
|
+
resolveQueryParamsName(node) {
|
|
210136
|
+
return this.resolveName(`${node.operationId} QueryParams`);
|
|
210137
|
+
},
|
|
210138
|
+
resolveQueryParamsTypedName(node) {
|
|
210139
|
+
return this.resolveTypedName(`${node.operationId} QueryParams`);
|
|
210140
|
+
},
|
|
210141
|
+
resolveHeaderParamsName(node) {
|
|
210142
|
+
return this.resolveName(`${node.operationId} HeaderParams`);
|
|
210143
|
+
},
|
|
210144
|
+
resolveHeaderParamsTypedName(node) {
|
|
210145
|
+
return this.resolveTypedName(`${node.operationId} HeaderParams`);
|
|
210146
|
+
}
|
|
210147
|
+
};
|
|
210148
|
+
});
|
|
209899
210149
|
|
|
209900
|
-
|
|
209901
|
-
|
|
209902
|
-
|
|
209903
|
-
|
|
209904
|
-
|
|
209905
|
-
|
|
209906
|
-
|
|
209907
|
-
|
|
209908
|
-
|
|
209909
|
-
|
|
209910
|
-
|
|
209911
|
-
|
|
209912
|
-
|
|
209913
|
-
|
|
209914
|
-
|
|
209915
|
-
|
|
209916
|
-
|
|
209917
|
-
|
|
209918
|
-
|
|
209919
|
-
|
|
209920
|
-
|
|
209921
|
-
|
|
209922
|
-
|
|
209923
|
-
name: "
|
|
209924
|
-
|
|
209925
|
-
|
|
209926
|
-
|
|
209927
|
-
|
|
209928
|
-
|
|
209929
|
-
|
|
209930
|
-
|
|
209931
|
-
})
|
|
210150
|
+
const typeGenerator = defineGenerator({
|
|
210151
|
+
name: "typescript",
|
|
210152
|
+
type: "react",
|
|
210153
|
+
Operation({ node, adapter, options, config }) {
|
|
210154
|
+
var _a, _b, _c;
|
|
210155
|
+
const { enumType, enumKeyCasing, optionalType, arrayType, syntaxType, paramsCasing, group, output, resolver, transformers = [] } = options;
|
|
210156
|
+
const root = path$2.resolve(config.root, config.output.path);
|
|
210157
|
+
const mode = getMode(path$2.resolve(root, output.path));
|
|
210158
|
+
const file = resolver.resolveFile({
|
|
210159
|
+
name: node.operationId,
|
|
210160
|
+
extname: ".ts",
|
|
210161
|
+
tag: (_a = node.tags[0]) != null ? _a : "default",
|
|
210162
|
+
path: node.path
|
|
210163
|
+
}, {
|
|
210164
|
+
root,
|
|
210165
|
+
output,
|
|
210166
|
+
group
|
|
210167
|
+
});
|
|
210168
|
+
const params = caseParams(node.parameters, paramsCasing);
|
|
210169
|
+
function renderSchemaType({ node: schemaNode, name, typedName, description, keysToOmit }) {
|
|
210170
|
+
if (!schemaNode) return null;
|
|
210171
|
+
const transformedNode = transform(schemaNode, composeTransformers(...transformers));
|
|
210172
|
+
const imports = adapter.getImports(transformedNode, (schemaName) => ({
|
|
210173
|
+
name: resolver.default(schemaName, "type"),
|
|
210174
|
+
path: resolver.resolveFile({
|
|
210175
|
+
name: schemaName,
|
|
210176
|
+
extname: ".ts"
|
|
210177
|
+
}, {
|
|
210178
|
+
root,
|
|
210179
|
+
output,
|
|
210180
|
+
group
|
|
210181
|
+
}).path
|
|
210182
|
+
}));
|
|
210183
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [mode === "split" && imports.map((imp) => /* @__PURE__ */ jsx(File.Import, {
|
|
210184
|
+
root: file.path,
|
|
210185
|
+
path: imp.path,
|
|
210186
|
+
name: imp.name,
|
|
210187
|
+
isTypeOnly: true
|
|
210188
|
+
}, [
|
|
210189
|
+
name,
|
|
210190
|
+
imp.path,
|
|
210191
|
+
imp.isTypeOnly
|
|
210192
|
+
].join("-"))), /* @__PURE__ */ jsx(Type, {
|
|
210193
|
+
name,
|
|
210194
|
+
typedName,
|
|
210195
|
+
node: transformedNode,
|
|
210196
|
+
description,
|
|
210197
|
+
enumType,
|
|
210198
|
+
enumKeyCasing,
|
|
210199
|
+
optionalType,
|
|
210200
|
+
arrayType,
|
|
210201
|
+
syntaxType,
|
|
210202
|
+
resolver,
|
|
210203
|
+
keysToOmit
|
|
210204
|
+
})] });
|
|
210205
|
+
}
|
|
210206
|
+
const paramTypes = params.map((param) => renderSchemaType({
|
|
210207
|
+
node: param.schema,
|
|
210208
|
+
name: resolver.resolveParamName(node, param),
|
|
210209
|
+
typedName: resolver.resolveParamTypedName(node, param)
|
|
210210
|
+
}));
|
|
210211
|
+
const requestType = ((_b = node.requestBody) == null ? void 0 : _b.schema) ? renderSchemaType({
|
|
210212
|
+
node: node.requestBody.schema,
|
|
210213
|
+
name: resolver.resolveDataName(node),
|
|
210214
|
+
typedName: resolver.resolveDataTypedName(node),
|
|
210215
|
+
description: (_c = node.requestBody.description) != null ? _c : node.requestBody.schema.description,
|
|
210216
|
+
keysToOmit: node.requestBody.keysToOmit
|
|
210217
|
+
}) : null;
|
|
210218
|
+
const responseTypes = node.responses.map((res) => renderSchemaType({
|
|
210219
|
+
node: res.schema,
|
|
210220
|
+
name: resolver.resolveResponseStatusName(node, res.statusCode),
|
|
210221
|
+
typedName: resolver.resolveResponseStatusTypedName(node, res.statusCode),
|
|
210222
|
+
description: res.description,
|
|
210223
|
+
keysToOmit: res.keysToOmit
|
|
210224
|
+
}));
|
|
210225
|
+
const dataType = renderSchemaType({
|
|
210226
|
+
node: builderTs.buildData({
|
|
210227
|
+
node: {
|
|
210228
|
+
...node,
|
|
210229
|
+
parameters: params
|
|
210230
|
+
},
|
|
210231
|
+
resolver
|
|
209932
210232
|
}),
|
|
209933
|
-
|
|
209934
|
-
|
|
209935
|
-
|
|
209936
|
-
|
|
209937
|
-
|
|
209938
|
-
|
|
209939
|
-
|
|
209940
|
-
}) : createSchema({ type: "never" })
|
|
210233
|
+
name: resolver.resolveRequestConfigName(node),
|
|
210234
|
+
typedName: resolver.resolveRequestConfigTypedName(node)
|
|
210235
|
+
});
|
|
210236
|
+
const responsesType = renderSchemaType({
|
|
210237
|
+
node: builderTs.buildResponses({
|
|
210238
|
+
node,
|
|
210239
|
+
resolver
|
|
209941
210240
|
}),
|
|
209942
|
-
|
|
209943
|
-
|
|
209944
|
-
|
|
209945
|
-
|
|
209946
|
-
|
|
209947
|
-
|
|
209948
|
-
|
|
209949
|
-
}),
|
|
209950
|
-
optional: true
|
|
209951
|
-
}) : createSchema({
|
|
209952
|
-
type: "never",
|
|
209953
|
-
optional: true
|
|
209954
|
-
})
|
|
210241
|
+
name: resolver.resolveResponsesName(node),
|
|
210242
|
+
typedName: resolver.resolveResponsesTypedName(node)
|
|
210243
|
+
});
|
|
210244
|
+
const responseType = renderSchemaType({
|
|
210245
|
+
node: builderTs.buildResponseUnion({
|
|
210246
|
+
node,
|
|
210247
|
+
resolver
|
|
209955
210248
|
}),
|
|
209956
|
-
|
|
209957
|
-
|
|
209958
|
-
|
|
209959
|
-
|
|
209960
|
-
|
|
209961
|
-
|
|
209962
|
-
|
|
209963
|
-
|
|
209964
|
-
|
|
209965
|
-
|
|
209966
|
-
|
|
209967
|
-
optional: true
|
|
209968
|
-
})
|
|
210249
|
+
name: resolver.resolveResponseName(node),
|
|
210250
|
+
typedName: resolver.resolveResponseTypedName(node),
|
|
210251
|
+
description: "Union of all possible responses"
|
|
210252
|
+
});
|
|
210253
|
+
return /* @__PURE__ */ jsxs(File, {
|
|
210254
|
+
baseName: file.baseName,
|
|
210255
|
+
path: file.path,
|
|
210256
|
+
meta: file.meta,
|
|
210257
|
+
banner: resolver.resolveBanner(adapter.rootNode, {
|
|
210258
|
+
output,
|
|
210259
|
+
config
|
|
209969
210260
|
}),
|
|
209970
|
-
|
|
209971
|
-
|
|
209972
|
-
|
|
209973
|
-
|
|
209974
|
-
|
|
209975
|
-
|
|
209976
|
-
|
|
209977
|
-
|
|
209978
|
-
|
|
209979
|
-
|
|
209980
|
-
|
|
209981
|
-
|
|
209982
|
-
|
|
209983
|
-
|
|
209984
|
-
|
|
209985
|
-
|
|
209986
|
-
|
|
209987
|
-
|
|
209988
|
-
|
|
209989
|
-
|
|
209990
|
-
|
|
210261
|
+
footer: resolver.resolveFooter(adapter.rootNode, {
|
|
210262
|
+
output,
|
|
210263
|
+
config
|
|
210264
|
+
}),
|
|
210265
|
+
children: [
|
|
210266
|
+
paramTypes,
|
|
210267
|
+
responseTypes,
|
|
210268
|
+
requestType,
|
|
210269
|
+
dataType,
|
|
210270
|
+
responsesType,
|
|
210271
|
+
responseType
|
|
210272
|
+
]
|
|
210273
|
+
});
|
|
210274
|
+
},
|
|
210275
|
+
Schema({ node, adapter, options, config }) {
|
|
210276
|
+
const { enumType, enumKeyCasing, syntaxType, optionalType, arrayType, output, group, resolver, transformers = [] } = options;
|
|
210277
|
+
const root = path$2.resolve(config.root, config.output.path);
|
|
210278
|
+
const mode = getMode(path$2.resolve(root, output.path));
|
|
210279
|
+
if (!node.name) return;
|
|
210280
|
+
const transformedNode = transform(node, composeTransformers(...transformers));
|
|
210281
|
+
const imports = adapter.getImports(transformedNode, (schemaName) => ({
|
|
210282
|
+
name: resolver.default(schemaName, "type"),
|
|
210283
|
+
path: resolver.resolveFile({
|
|
210284
|
+
name: schemaName,
|
|
210285
|
+
extname: ".ts"
|
|
210286
|
+
}, {
|
|
210287
|
+
root,
|
|
210288
|
+
output,
|
|
210289
|
+
group
|
|
210290
|
+
}).path
|
|
210291
|
+
}));
|
|
210292
|
+
const isEnumSchema = !!narrowSchema(node, schemaTypes.enum);
|
|
210293
|
+
const typedName = ENUM_TYPES_WITH_KEY_SUFFIX.has(enumType) && isEnumSchema ? resolver.resolveEnumKeyTypedName(node) : resolver.resolveTypedName(node.name);
|
|
210294
|
+
const type = {
|
|
210295
|
+
name: resolver.resolveName(node.name),
|
|
210296
|
+
typedName,
|
|
210297
|
+
file: resolver.resolveFile({
|
|
210298
|
+
name: node.name,
|
|
210299
|
+
extname: ".ts"
|
|
210300
|
+
}, {
|
|
210301
|
+
root,
|
|
210302
|
+
output,
|
|
210303
|
+
group
|
|
209991
210304
|
})
|
|
209992
|
-
}
|
|
209993
|
-
|
|
209994
|
-
|
|
209995
|
-
|
|
209996
|
-
|
|
209997
|
-
|
|
209998
|
-
|
|
209999
|
-
|
|
210000
|
-
|
|
210001
|
-
|
|
210002
|
-
|
|
210003
|
-
|
|
210004
|
-
|
|
210005
|
-
|
|
210305
|
+
};
|
|
210306
|
+
return /* @__PURE__ */ jsxs(File, {
|
|
210307
|
+
baseName: type.file.baseName,
|
|
210308
|
+
path: type.file.path,
|
|
210309
|
+
meta: type.file.meta,
|
|
210310
|
+
banner: resolver.resolveBanner(adapter.rootNode, {
|
|
210311
|
+
output,
|
|
210312
|
+
config
|
|
210313
|
+
}),
|
|
210314
|
+
footer: resolver.resolveFooter(adapter.rootNode, {
|
|
210315
|
+
output,
|
|
210316
|
+
config
|
|
210317
|
+
}),
|
|
210318
|
+
children: [mode === "split" && imports.map((imp) => /* @__PURE__ */ jsx(File.Import, {
|
|
210319
|
+
root: type.file.path,
|
|
210320
|
+
path: imp.path,
|
|
210321
|
+
name: imp.name,
|
|
210322
|
+
isTypeOnly: true
|
|
210323
|
+
}, [
|
|
210324
|
+
node.name,
|
|
210325
|
+
imp.path,
|
|
210326
|
+
imp.isTypeOnly
|
|
210327
|
+
].join("-"))), /* @__PURE__ */ jsx(Type, {
|
|
210328
|
+
name: type.name,
|
|
210329
|
+
typedName: type.typedName,
|
|
210330
|
+
node: transformedNode,
|
|
210331
|
+
enumType,
|
|
210332
|
+
enumKeyCasing,
|
|
210333
|
+
optionalType,
|
|
210334
|
+
arrayType,
|
|
210335
|
+
syntaxType,
|
|
210336
|
+
resolver
|
|
210337
|
+
})]
|
|
210338
|
+
});
|
|
210339
|
+
}
|
|
210340
|
+
});
|
|
210006
210341
|
function buildGroupedParamsSchema({ params, parentName }) {
|
|
210007
210342
|
return createSchema({
|
|
210008
210343
|
type: "object",
|
|
@@ -210142,19 +210477,23 @@ function nameUnnamedEnums(node, parentName) {
|
|
|
210142
210477
|
}
|
|
210143
210478
|
});
|
|
210144
210479
|
}
|
|
210145
|
-
const
|
|
210146
|
-
name: "typescript",
|
|
210480
|
+
const typeGeneratorLegacy = defineGenerator({
|
|
210481
|
+
name: "typescript-legacy",
|
|
210147
210482
|
type: "react",
|
|
210148
|
-
Operation({ node, adapter, options }) {
|
|
210483
|
+
Operation({ node, adapter, options, config }) {
|
|
210149
210484
|
var _a, _b, _c;
|
|
210150
|
-
const { enumType, enumKeyCasing, optionalType, arrayType, syntaxType, paramsCasing, group,
|
|
210151
|
-
const
|
|
210152
|
-
const
|
|
210153
|
-
const file =
|
|
210485
|
+
const { enumType, enumKeyCasing, optionalType, arrayType, syntaxType, paramsCasing, group, output, resolver, transformers = [] } = options;
|
|
210486
|
+
const root = path$2.resolve(config.root, config.output.path);
|
|
210487
|
+
const mode = getMode(path$2.resolve(root, output.path));
|
|
210488
|
+
const file = resolver.resolveFile({
|
|
210154
210489
|
name: node.operationId,
|
|
210155
210490
|
extname: ".ts",
|
|
210156
|
-
|
|
210157
|
-
|
|
210491
|
+
tag: (_a = node.tags[0]) != null ? _a : "default",
|
|
210492
|
+
path: node.path
|
|
210493
|
+
}, {
|
|
210494
|
+
root,
|
|
210495
|
+
output,
|
|
210496
|
+
group
|
|
210158
210497
|
});
|
|
210159
210498
|
const params = caseParams(node.parameters, paramsCasing);
|
|
210160
210499
|
function renderSchemaType({ node: schemaNode, name, typedName, description, keysToOmit }) {
|
|
@@ -210162,10 +210501,13 @@ const typeGenerator = defineGenerator({
|
|
|
210162
210501
|
const transformedNode = transform(schemaNode, composeTransformers(...transformers));
|
|
210163
210502
|
const imports = adapter.getImports(transformedNode, (schemaName) => ({
|
|
210164
210503
|
name: resolver.default(schemaName, "type"),
|
|
210165
|
-
path:
|
|
210504
|
+
path: resolver.resolveFile({
|
|
210166
210505
|
name: schemaName,
|
|
210167
|
-
extname: ".ts"
|
|
210168
|
-
|
|
210506
|
+
extname: ".ts"
|
|
210507
|
+
}, {
|
|
210508
|
+
root,
|
|
210509
|
+
output,
|
|
210510
|
+
group
|
|
210169
210511
|
}).path
|
|
210170
210512
|
}));
|
|
210171
210513
|
return /* @__PURE__ */ jsxs(Fragment, { children: [mode === "split" && imports.map((imp) => /* @__PURE__ */ jsx(File.Import, {
|
|
@@ -210188,13 +210530,15 @@ const typeGenerator = defineGenerator({
|
|
|
210188
210530
|
arrayType,
|
|
210189
210531
|
syntaxType,
|
|
210190
210532
|
resolver,
|
|
210191
|
-
keysToOmit
|
|
210192
|
-
legacy: isKubbV4Compatibility
|
|
210533
|
+
keysToOmit
|
|
210193
210534
|
})] });
|
|
210194
210535
|
}
|
|
210195
|
-
const
|
|
210536
|
+
const pathParams = params.filter((p) => p.in === "path");
|
|
210537
|
+
const queryParams = params.filter((p) => p.in === "query");
|
|
210538
|
+
const headerParams = params.filter((p) => p.in === "header");
|
|
210539
|
+
const responseTypes = node.responses.map((res) => {
|
|
210196
210540
|
const responseName = resolver.resolveResponseStatusName(node, res.statusCode);
|
|
210197
|
-
const baseResponseName =
|
|
210541
|
+
const baseResponseName = resolverTsLegacy.resolveResponseStatusName(node, res.statusCode);
|
|
210198
210542
|
return renderSchemaType({
|
|
210199
210543
|
node: res.schema ? nameUnnamedEnums(res.schema, baseResponseName) : res.schema,
|
|
210200
210544
|
name: responseName,
|
|
@@ -210202,153 +210546,92 @@ const typeGenerator = defineGenerator({
|
|
|
210202
210546
|
description: res.description,
|
|
210203
210547
|
keysToOmit: res.keysToOmit
|
|
210204
210548
|
});
|
|
210205
|
-
})
|
|
210206
|
-
node: res.schema,
|
|
210207
|
-
name: resolver.resolveResponseStatusName(node, res.statusCode),
|
|
210208
|
-
typedName: resolver.resolveResponseStatusTypedName(node, res.statusCode),
|
|
210209
|
-
description: res.description,
|
|
210210
|
-
keysToOmit: res.keysToOmit
|
|
210211
|
-
}));
|
|
210549
|
+
});
|
|
210212
210550
|
const requestType = ((_b = node.requestBody) == null ? void 0 : _b.schema) ? renderSchemaType({
|
|
210213
|
-
node:
|
|
210551
|
+
node: nameUnnamedEnums(node.requestBody.schema, resolverTsLegacy.resolveDataName(node)),
|
|
210214
210552
|
name: resolver.resolveDataName(node),
|
|
210215
210553
|
typedName: resolver.resolveDataTypedName(node),
|
|
210216
210554
|
description: (_c = node.requestBody.description) != null ? _c : node.requestBody.schema.description,
|
|
210217
210555
|
keysToOmit: node.requestBody.keysToOmit
|
|
210218
210556
|
}) : null;
|
|
210219
|
-
|
|
210220
|
-
|
|
210221
|
-
|
|
210222
|
-
|
|
210223
|
-
|
|
210224
|
-
pathParams.length > 0 ? renderSchemaType({
|
|
210225
|
-
node: buildGroupedParamsSchema({
|
|
210226
|
-
params: pathParams,
|
|
210227
|
-
parentName: baseResolver.resolvePathParamsName(node)
|
|
210228
|
-
}),
|
|
210229
|
-
name: resolver.resolvePathParamsName(node),
|
|
210230
|
-
typedName: resolver.resolvePathParamsTypedName(node)
|
|
210231
|
-
}) : null,
|
|
210232
|
-
queryParams.length > 0 ? renderSchemaType({
|
|
210233
|
-
node: buildGroupedParamsSchema({
|
|
210234
|
-
params: queryParams,
|
|
210235
|
-
parentName: baseResolver.resolveQueryParamsName(node)
|
|
210236
|
-
}),
|
|
210237
|
-
name: resolver.resolveQueryParamsName(node),
|
|
210238
|
-
typedName: resolver.resolveQueryParamsTypedName(node)
|
|
210239
|
-
}) : null,
|
|
210240
|
-
headerParams.length > 0 ? renderSchemaType({
|
|
210241
|
-
node: buildGroupedParamsSchema({
|
|
210242
|
-
params: headerParams,
|
|
210243
|
-
parentName: baseResolver.resolveHeaderParamsName(node)
|
|
210244
|
-
}),
|
|
210245
|
-
name: resolver.resolveHeaderParamsName(node),
|
|
210246
|
-
typedName: resolver.resolveHeaderParamsTypedName(node)
|
|
210247
|
-
}) : null
|
|
210248
|
-
];
|
|
210249
|
-
const legacyResponsesType = renderSchemaType({
|
|
210250
|
-
node: buildLegacyResponsesSchemaNode({
|
|
210251
|
-
node,
|
|
210252
|
-
resolver
|
|
210557
|
+
const legacyParamTypes = [
|
|
210558
|
+
pathParams.length > 0 ? renderSchemaType({
|
|
210559
|
+
node: buildGroupedParamsSchema({
|
|
210560
|
+
params: pathParams,
|
|
210561
|
+
parentName: resolverTsLegacy.resolvePathParamsName(node)
|
|
210253
210562
|
}),
|
|
210254
|
-
name: resolver.
|
|
210255
|
-
typedName: resolver.
|
|
210256
|
-
})
|
|
210257
|
-
|
|
210258
|
-
node:
|
|
210259
|
-
|
|
210260
|
-
|
|
210563
|
+
name: resolver.resolvePathParamsName(node),
|
|
210564
|
+
typedName: resolver.resolvePathParamsTypedName(node)
|
|
210565
|
+
}) : null,
|
|
210566
|
+
queryParams.length > 0 ? renderSchemaType({
|
|
210567
|
+
node: buildGroupedParamsSchema({
|
|
210568
|
+
params: queryParams,
|
|
210569
|
+
parentName: resolverTsLegacy.resolveQueryParamsName(node)
|
|
210261
210570
|
}),
|
|
210262
|
-
name: resolver.
|
|
210263
|
-
typedName: resolver.
|
|
210264
|
-
})
|
|
210265
|
-
|
|
210266
|
-
|
|
210267
|
-
|
|
210268
|
-
|
|
210269
|
-
|
|
210270
|
-
|
|
210271
|
-
|
|
210272
|
-
|
|
210273
|
-
|
|
210274
|
-
|
|
210275
|
-
|
|
210276
|
-
legacyResponsesType
|
|
210277
|
-
]
|
|
210278
|
-
});
|
|
210279
|
-
}
|
|
210280
|
-
const paramTypes = params.map((param) => renderSchemaType({
|
|
210281
|
-
node: param.schema,
|
|
210282
|
-
name: resolver.resolveParamName(node, param),
|
|
210283
|
-
typedName: resolver.resolveParamTypedName(node, param)
|
|
210284
|
-
}));
|
|
210285
|
-
const queryParamsList = params.filter((p) => p.in === "query");
|
|
210286
|
-
const queryParamsType = queryParamsList.length > 0 ? renderSchemaType({
|
|
210287
|
-
node: buildParamsSchema({
|
|
210288
|
-
params: queryParamsList,
|
|
210289
|
-
node,
|
|
210290
|
-
resolver
|
|
210291
|
-
}),
|
|
210292
|
-
name: resolver.resolveQueryParamsName(node),
|
|
210293
|
-
typedName: resolver.resolveQueryParamsTypedName(node)
|
|
210294
|
-
}) : null;
|
|
210295
|
-
const dataType = renderSchemaType({
|
|
210296
|
-
node: buildDataSchemaNode({
|
|
210297
|
-
node: {
|
|
210298
|
-
...node,
|
|
210299
|
-
parameters: params
|
|
210300
|
-
},
|
|
210301
|
-
resolver
|
|
210302
|
-
}),
|
|
210303
|
-
name: resolver.resolveRequestConfigName(node),
|
|
210304
|
-
typedName: resolver.resolveRequestConfigTypedName(node)
|
|
210305
|
-
});
|
|
210306
|
-
const responsesType = renderSchemaType({
|
|
210307
|
-
node: buildResponsesSchemaNode({
|
|
210571
|
+
name: resolver.resolveQueryParamsName(node),
|
|
210572
|
+
typedName: resolver.resolveQueryParamsTypedName(node)
|
|
210573
|
+
}) : null,
|
|
210574
|
+
headerParams.length > 0 ? renderSchemaType({
|
|
210575
|
+
node: buildGroupedParamsSchema({
|
|
210576
|
+
params: headerParams,
|
|
210577
|
+
parentName: resolverTsLegacy.resolveHeaderParamsName(node)
|
|
210578
|
+
}),
|
|
210579
|
+
name: resolver.resolveHeaderParamsName(node),
|
|
210580
|
+
typedName: resolver.resolveHeaderParamsTypedName(node)
|
|
210581
|
+
}) : null
|
|
210582
|
+
];
|
|
210583
|
+
const legacyResponsesType = renderSchemaType({
|
|
210584
|
+
node: buildLegacyResponsesSchemaNode({
|
|
210308
210585
|
node,
|
|
210309
210586
|
resolver
|
|
210310
210587
|
}),
|
|
210311
210588
|
name: resolver.resolveResponsesName(node),
|
|
210312
210589
|
typedName: resolver.resolveResponsesTypedName(node)
|
|
210313
210590
|
});
|
|
210314
|
-
const
|
|
210315
|
-
node:
|
|
210591
|
+
const legacyResponseType = renderSchemaType({
|
|
210592
|
+
node: buildLegacyResponseUnionSchemaNode({
|
|
210316
210593
|
node,
|
|
210317
210594
|
resolver
|
|
210318
210595
|
}),
|
|
210319
210596
|
name: resolver.resolveResponseName(node),
|
|
210320
|
-
typedName: resolver.resolveResponseTypedName(node)
|
|
210321
|
-
description: "Union of all possible responses"
|
|
210597
|
+
typedName: resolver.resolveResponseTypedName(node)
|
|
210322
210598
|
});
|
|
210323
210599
|
return /* @__PURE__ */ jsxs(File, {
|
|
210324
210600
|
baseName: file.baseName,
|
|
210325
210601
|
path: file.path,
|
|
210326
210602
|
meta: file.meta,
|
|
210327
|
-
banner: resolveBanner(
|
|
210328
|
-
|
|
210603
|
+
banner: resolver.resolveBanner(adapter.rootNode, {
|
|
210604
|
+
output,
|
|
210605
|
+
config
|
|
210606
|
+
}),
|
|
210607
|
+
footer: resolver.resolveFooter(adapter.rootNode, {
|
|
210608
|
+
output,
|
|
210609
|
+
config
|
|
210610
|
+
}),
|
|
210329
210611
|
children: [
|
|
210330
|
-
|
|
210331
|
-
queryParamsType,
|
|
210612
|
+
legacyParamTypes,
|
|
210332
210613
|
responseTypes,
|
|
210333
210614
|
requestType,
|
|
210334
|
-
|
|
210335
|
-
|
|
210336
|
-
responseType
|
|
210615
|
+
legacyResponseType,
|
|
210616
|
+
legacyResponsesType
|
|
210337
210617
|
]
|
|
210338
210618
|
});
|
|
210339
210619
|
},
|
|
210340
|
-
Schema({ node, adapter, options }) {
|
|
210341
|
-
const { enumType, enumKeyCasing, syntaxType, optionalType, arrayType,
|
|
210342
|
-
const
|
|
210343
|
-
const
|
|
210620
|
+
Schema({ node, adapter, options, config }) {
|
|
210621
|
+
const { enumType, enumKeyCasing, syntaxType, optionalType, arrayType, output, group, resolver, transformers = [] } = options;
|
|
210622
|
+
const root = path$2.resolve(config.root, config.output.path);
|
|
210623
|
+
const mode = getMode(path$2.resolve(root, output.path));
|
|
210344
210624
|
if (!node.name) return;
|
|
210345
210625
|
const transformedNode = transform(node, composeTransformers(...transformers));
|
|
210346
210626
|
const imports = adapter.getImports(transformedNode, (schemaName) => ({
|
|
210347
210627
|
name: resolver.default(schemaName, "type"),
|
|
210348
|
-
path:
|
|
210628
|
+
path: resolver.resolveFile({
|
|
210349
210629
|
name: schemaName,
|
|
210350
|
-
extname: ".ts"
|
|
210351
|
-
|
|
210630
|
+
extname: ".ts"
|
|
210631
|
+
}, {
|
|
210632
|
+
root,
|
|
210633
|
+
output,
|
|
210634
|
+
group
|
|
210352
210635
|
}).path
|
|
210353
210636
|
}));
|
|
210354
210637
|
const isEnumSchema = !!narrowSchema(node, schemaTypes.enum);
|
|
@@ -210356,18 +210639,27 @@ const typeGenerator = defineGenerator({
|
|
|
210356
210639
|
const type = {
|
|
210357
210640
|
name: resolver.resolveName(node.name),
|
|
210358
210641
|
typedName,
|
|
210359
|
-
file:
|
|
210642
|
+
file: resolver.resolveFile({
|
|
210360
210643
|
name: node.name,
|
|
210361
|
-
extname: ".ts"
|
|
210362
|
-
|
|
210644
|
+
extname: ".ts"
|
|
210645
|
+
}, {
|
|
210646
|
+
root,
|
|
210647
|
+
output,
|
|
210648
|
+
group
|
|
210363
210649
|
})
|
|
210364
210650
|
};
|
|
210365
210651
|
return /* @__PURE__ */ jsxs(File, {
|
|
210366
210652
|
baseName: type.file.baseName,
|
|
210367
210653
|
path: type.file.path,
|
|
210368
210654
|
meta: type.file.meta,
|
|
210369
|
-
banner: resolveBanner(
|
|
210370
|
-
|
|
210655
|
+
banner: resolver.resolveBanner(adapter.rootNode, {
|
|
210656
|
+
output,
|
|
210657
|
+
config
|
|
210658
|
+
}),
|
|
210659
|
+
footer: resolver.resolveFooter(adapter.rootNode, {
|
|
210660
|
+
output,
|
|
210661
|
+
config
|
|
210662
|
+
}),
|
|
210371
210663
|
children: [mode === "split" && imports.map((imp) => /* @__PURE__ */ jsx(File.Import, {
|
|
210372
210664
|
root: type.file.path,
|
|
210373
210665
|
path: imp.path,
|
|
@@ -210386,158 +210678,29 @@ const typeGenerator = defineGenerator({
|
|
|
210386
210678
|
optionalType,
|
|
210387
210679
|
arrayType,
|
|
210388
210680
|
syntaxType,
|
|
210389
|
-
resolver
|
|
210390
|
-
legacy: isKubbV4Compatibility
|
|
210681
|
+
resolver
|
|
210391
210682
|
})]
|
|
210392
210683
|
});
|
|
210393
210684
|
}
|
|
210394
210685
|
});
|
|
210395
210686
|
|
|
210396
|
-
function resolveName(name, type) {
|
|
210397
|
-
return pascalCase$6(name, { isFile: type === "file" });
|
|
210398
|
-
}
|
|
210399
|
-
const resolverTs = defineResolver(() => {
|
|
210400
|
-
return {
|
|
210401
|
-
name: "default",
|
|
210402
|
-
default(name, type) {
|
|
210403
|
-
return resolveName(name, type);
|
|
210404
|
-
},
|
|
210405
|
-
resolveName(name) {
|
|
210406
|
-
return this.default(name, "function");
|
|
210407
|
-
},
|
|
210408
|
-
resolveTypedName(name) {
|
|
210409
|
-
return this.default(name, "type");
|
|
210410
|
-
},
|
|
210411
|
-
resolvePathName(name, type) {
|
|
210412
|
-
return this.default(name, type);
|
|
210413
|
-
},
|
|
210414
|
-
resolveParamName(node, param) {
|
|
210415
|
-
return this.resolveName(`${node.operationId} ${this.default(param.in)} ${param.name}`);
|
|
210416
|
-
},
|
|
210417
|
-
resolveParamTypedName(node, param) {
|
|
210418
|
-
return this.resolveTypedName(`${node.operationId} ${this.default(param.in)} ${param.name}`);
|
|
210419
|
-
},
|
|
210420
|
-
resolveResponseStatusName(node, statusCode) {
|
|
210421
|
-
return this.resolveName(`${node.operationId} Status ${statusCode}`);
|
|
210422
|
-
},
|
|
210423
|
-
resolveResponseStatusTypedName(node, statusCode) {
|
|
210424
|
-
return this.resolveTypedName(`${node.operationId} Status ${statusCode}`);
|
|
210425
|
-
},
|
|
210426
|
-
resolveDataName(node) {
|
|
210427
|
-
return this.resolveName(`${node.operationId} Data`);
|
|
210428
|
-
},
|
|
210429
|
-
resolveDataTypedName(node) {
|
|
210430
|
-
return this.resolveTypedName(`${node.operationId} Data`);
|
|
210431
|
-
},
|
|
210432
|
-
resolveRequestConfigName(node) {
|
|
210433
|
-
return this.resolveName(`${node.operationId} RequestConfig`);
|
|
210434
|
-
},
|
|
210435
|
-
resolveRequestConfigTypedName(node) {
|
|
210436
|
-
return this.resolveTypedName(`${node.operationId} RequestConfig`);
|
|
210437
|
-
},
|
|
210438
|
-
resolveResponsesName(node) {
|
|
210439
|
-
return this.resolveName(`${node.operationId} Responses`);
|
|
210440
|
-
},
|
|
210441
|
-
resolveResponsesTypedName(node) {
|
|
210442
|
-
return this.resolveTypedName(`${node.operationId} Responses`);
|
|
210443
|
-
},
|
|
210444
|
-
resolveResponseName(node) {
|
|
210445
|
-
return this.resolveName(`${node.operationId} Response`);
|
|
210446
|
-
},
|
|
210447
|
-
resolveResponseTypedName(node) {
|
|
210448
|
-
return this.resolveTypedName(`${node.operationId} Response`);
|
|
210449
|
-
},
|
|
210450
|
-
resolveEnumKeyTypedName(node) {
|
|
210451
|
-
var _a;
|
|
210452
|
-
return `${this.resolveTypedName((_a = node.name) != null ? _a : "")}Key`;
|
|
210453
|
-
},
|
|
210454
|
-
resolvePathParamsName(_node) {
|
|
210455
|
-
throw new Error("resolvePathParamsName is only available with compatibilityPreset: 'kubbV4'. Use resolveParamName per individual parameter instead.");
|
|
210456
|
-
},
|
|
210457
|
-
resolvePathParamsTypedName(_node) {
|
|
210458
|
-
throw new Error("resolvePathParamsTypedName is only available with compatibilityPreset: 'kubbV4'. Use resolveParamTypedName per individual parameter instead.");
|
|
210459
|
-
},
|
|
210460
|
-
resolveQueryParamsName(node) {
|
|
210461
|
-
return this.resolveName(`${node.operationId} QueryParams`);
|
|
210462
|
-
},
|
|
210463
|
-
resolveQueryParamsTypedName(node) {
|
|
210464
|
-
return this.resolveTypedName(`${node.operationId} QueryParams`);
|
|
210465
|
-
},
|
|
210466
|
-
resolveHeaderParamsName(_node) {
|
|
210467
|
-
throw new Error("resolveHeaderParamsName is only available with compatibilityPreset: 'kubbV4'. Use resolveParamName per individual parameter instead.");
|
|
210468
|
-
},
|
|
210469
|
-
resolveHeaderParamsTypedName(_node) {
|
|
210470
|
-
throw new Error("resolveHeaderParamsTypedName is only available with compatibilityPreset: 'kubbV4'. Use resolveParamTypedName per individual parameter instead.");
|
|
210471
|
-
}
|
|
210472
|
-
};
|
|
210473
|
-
});
|
|
210474
|
-
const resolverTsLegacy = defineResolver(() => {
|
|
210475
|
-
return {
|
|
210476
|
-
...resolverTs,
|
|
210477
|
-
name: "legacy",
|
|
210478
|
-
resolveResponseStatusName(node, statusCode) {
|
|
210479
|
-
if (statusCode === "default") return this.resolveName(`${node.operationId} Error`);
|
|
210480
|
-
return this.resolveName(`${node.operationId} ${statusCode}`);
|
|
210481
|
-
},
|
|
210482
|
-
resolveResponseStatusTypedName(node, statusCode) {
|
|
210483
|
-
if (statusCode === "default") return this.resolveTypedName(`${node.operationId} Error`);
|
|
210484
|
-
return this.resolveTypedName(`${node.operationId} ${statusCode}`);
|
|
210485
|
-
},
|
|
210486
|
-
resolveDataName(node) {
|
|
210487
|
-
const suffix = node.method === "GET" ? "QueryRequest" : "MutationRequest";
|
|
210488
|
-
return this.resolveName(`${node.operationId} ${suffix}`);
|
|
210489
|
-
},
|
|
210490
|
-
resolveDataTypedName(node) {
|
|
210491
|
-
const suffix = node.method === "GET" ? "QueryRequest" : "MutationRequest";
|
|
210492
|
-
return this.resolveTypedName(`${node.operationId} ${suffix}`);
|
|
210493
|
-
},
|
|
210494
|
-
resolveResponsesName(node) {
|
|
210495
|
-
const suffix = node.method === "GET" ? "Query" : "Mutation";
|
|
210496
|
-
return `${this.default(node.operationId, "function")}${suffix}`;
|
|
210497
|
-
},
|
|
210498
|
-
resolveResponsesTypedName(node) {
|
|
210499
|
-
const suffix = node.method === "GET" ? "Query" : "Mutation";
|
|
210500
|
-
return `${this.default(node.operationId, "type")}${suffix}`;
|
|
210501
|
-
},
|
|
210502
|
-
resolveResponseName(node) {
|
|
210503
|
-
const suffix = node.method === "GET" ? "QueryResponse" : "MutationResponse";
|
|
210504
|
-
return this.resolveName(`${node.operationId} ${suffix}`);
|
|
210505
|
-
},
|
|
210506
|
-
resolveResponseTypedName(node) {
|
|
210507
|
-
const suffix = node.method === "GET" ? "QueryResponse" : "MutationResponse";
|
|
210508
|
-
return this.resolveTypedName(`${node.operationId} ${suffix}`);
|
|
210509
|
-
},
|
|
210510
|
-
resolvePathParamsName(node) {
|
|
210511
|
-
return this.resolveName(`${node.operationId} PathParams`);
|
|
210512
|
-
},
|
|
210513
|
-
resolvePathParamsTypedName(node) {
|
|
210514
|
-
return this.resolveTypedName(`${node.operationId} PathParams`);
|
|
210515
|
-
},
|
|
210516
|
-
resolveQueryParamsName(node) {
|
|
210517
|
-
return this.resolveName(`${node.operationId} QueryParams`);
|
|
210518
|
-
},
|
|
210519
|
-
resolveQueryParamsTypedName(node) {
|
|
210520
|
-
return this.resolveTypedName(`${node.operationId} QueryParams`);
|
|
210521
|
-
},
|
|
210522
|
-
resolveHeaderParamsName(node) {
|
|
210523
|
-
return this.resolveName(`${node.operationId} HeaderParams`);
|
|
210524
|
-
},
|
|
210525
|
-
resolveHeaderParamsTypedName(node) {
|
|
210526
|
-
return this.resolveTypedName(`${node.operationId} HeaderParams`);
|
|
210527
|
-
}
|
|
210528
|
-
};
|
|
210529
|
-
});
|
|
210530
|
-
|
|
210531
210687
|
const presets = definePresets({
|
|
210532
|
-
default: definePreset("default", {
|
|
210533
|
-
|
|
210688
|
+
default: definePreset("default", {
|
|
210689
|
+
resolvers: [resolverTs],
|
|
210690
|
+
generators: [typeGenerator]
|
|
210691
|
+
}),
|
|
210692
|
+
kubbV4: definePreset("kubbV4", {
|
|
210693
|
+
resolvers: [resolverTsLegacy],
|
|
210694
|
+
generators: [typeGeneratorLegacy]
|
|
210695
|
+
})
|
|
210534
210696
|
});
|
|
210535
|
-
function getPreset$1(preset, { resolvers, transformers
|
|
210697
|
+
function getPreset$1(preset, { resolvers, transformers, generators }) {
|
|
210536
210698
|
return getPreset({
|
|
210537
210699
|
preset,
|
|
210538
210700
|
presets,
|
|
210539
210701
|
resolvers: [resolverTs, ...resolvers != null ? resolvers : []],
|
|
210540
|
-
transformers
|
|
210702
|
+
transformers,
|
|
210703
|
+
generators
|
|
210541
210704
|
});
|
|
210542
210705
|
}
|
|
210543
210706
|
__name$5(getPreset$1, "getPreset");
|
|
@@ -210546,46 +210709,48 @@ const pluginTs = createPlugin((options) => {
|
|
|
210546
210709
|
const { output = {
|
|
210547
210710
|
path: "types",
|
|
210548
210711
|
barrelType: "named"
|
|
210549
|
-
}, group, exclude = [], include, override = [], enumType = "asConst", enumKeyCasing = "none", optionalType = "questionToken", arrayType = "array", syntaxType = "type", paramsCasing,
|
|
210550
|
-
const {
|
|
210712
|
+
}, group, exclude = [], include, override = [], enumType = "asConst", enumKeyCasing = "none", optionalType = "questionToken", arrayType = "array", syntaxType = "type", paramsCasing, compatibilityPreset = "default", resolvers: userResolvers = [], transformers: userTransformers = [], generators: userGenerators = [] } = options;
|
|
210713
|
+
const { resolver, transformers, generators } = getPreset$1(compatibilityPreset, {
|
|
210551
210714
|
resolvers: userResolvers,
|
|
210552
|
-
transformers: userTransformers
|
|
210715
|
+
transformers: userTransformers,
|
|
210716
|
+
generators: userGenerators
|
|
210553
210717
|
});
|
|
210554
210718
|
let resolveNameWarning = false;
|
|
210719
|
+
let resolvePathWarning = false;
|
|
210555
210720
|
return {
|
|
210556
210721
|
name: pluginTsName,
|
|
210557
210722
|
options: {
|
|
210558
210723
|
output,
|
|
210559
210724
|
optionalType,
|
|
210725
|
+
group,
|
|
210560
210726
|
arrayType,
|
|
210561
210727
|
enumType,
|
|
210562
210728
|
enumKeyCasing,
|
|
210563
210729
|
syntaxType,
|
|
210564
|
-
group,
|
|
210565
|
-
override,
|
|
210566
210730
|
paramsCasing,
|
|
210567
|
-
compatibilityPreset,
|
|
210568
|
-
baseResolver,
|
|
210569
210731
|
resolver,
|
|
210570
210732
|
transformers
|
|
210571
210733
|
},
|
|
210572
210734
|
resolvePath(baseName, pathMode, options2) {
|
|
210573
210735
|
var _a, _b;
|
|
210574
|
-
|
|
210575
|
-
|
|
210576
|
-
|
|
210577
|
-
if (group && (((_a = options2 == null ? void 0 : options2.group) == null ? void 0 : _a.path) || ((_b = options2 == null ? void 0 : options2.group) == null ? void 0 : _b.tag))) {
|
|
210578
|
-
const groupName = (group == null ? void 0 : group.name) ? group.name : (ctx) => {
|
|
210579
|
-
if ((group == null ? void 0 : group.type) === "path") return `${ctx.group.split("/")[1]}`;
|
|
210580
|
-
return `${camelCase$a(ctx.group)}Controller`;
|
|
210581
|
-
};
|
|
210582
|
-
return path$2.resolve(root, output.path, groupName({ group: group.type === "path" ? options2.group.path : options2.group.tag }), baseName);
|
|
210736
|
+
if (!resolvePathWarning) {
|
|
210737
|
+
this.driver.events.emit("warn", "Do not use resolvePath for pluginTs, use resolverTs.resolvePath instead");
|
|
210738
|
+
resolvePathWarning = true;
|
|
210583
210739
|
}
|
|
210584
|
-
return
|
|
210740
|
+
return resolver.resolvePath({
|
|
210741
|
+
baseName,
|
|
210742
|
+
pathMode,
|
|
210743
|
+
tag: (_a = options2 == null ? void 0 : options2.group) == null ? void 0 : _a.tag,
|
|
210744
|
+
path: (_b = options2 == null ? void 0 : options2.group) == null ? void 0 : _b.path
|
|
210745
|
+
}, {
|
|
210746
|
+
root: path$2.resolve(this.config.root, this.config.output.path),
|
|
210747
|
+
output,
|
|
210748
|
+
group
|
|
210749
|
+
});
|
|
210585
210750
|
},
|
|
210586
210751
|
resolveName(name, type) {
|
|
210587
210752
|
if (!resolveNameWarning) {
|
|
210588
|
-
this.driver.events.emit("warn", "Do not use resolveName for pluginTs, use resolverTs instead");
|
|
210753
|
+
this.driver.events.emit("warn", "Do not use resolveName for pluginTs, use resolverTs.default instead");
|
|
210589
210754
|
resolveNameWarning = true;
|
|
210590
210755
|
}
|
|
210591
210756
|
return resolver.default(name, type);
|
|
@@ -210594,7 +210759,6 @@ const pluginTs = createPlugin((options) => {
|
|
|
210594
210759
|
var _a;
|
|
210595
210760
|
const { config, fabric, plugin, adapter, rootNode, driver, openInStudio } = this;
|
|
210596
210761
|
const root = path$2.resolve(config.root, config.output.path);
|
|
210597
|
-
const mode = getMode(path$2.resolve(root, output.path));
|
|
210598
210762
|
if (!adapter) throw new Error("Plugin cannot work without adapter being set");
|
|
210599
210763
|
await openInStudio({ ast: true });
|
|
210600
210764
|
await walk(rootNode, {
|
|
@@ -210616,8 +210780,7 @@ const pluginTs = createPlugin((options) => {
|
|
|
210616
210780
|
fabric,
|
|
210617
210781
|
Component: generator.Schema,
|
|
210618
210782
|
plugin,
|
|
210619
|
-
driver
|
|
210620
|
-
mode
|
|
210783
|
+
driver
|
|
210621
210784
|
});
|
|
210622
210785
|
}
|
|
210623
210786
|
});
|
|
@@ -210640,8 +210803,7 @@ const pluginTs = createPlugin((options) => {
|
|
|
210640
210803
|
fabric,
|
|
210641
210804
|
Component: generator.Operation,
|
|
210642
210805
|
plugin,
|
|
210643
|
-
driver
|
|
210644
|
-
mode
|
|
210806
|
+
driver
|
|
210645
210807
|
});
|
|
210646
210808
|
}
|
|
210647
210809
|
});
|
|
@@ -210659,13 +210821,26 @@ const pluginTs = createPlugin((options) => {
|
|
|
210659
210821
|
};
|
|
210660
210822
|
});
|
|
210661
210823
|
|
|
210824
|
+
function useDriver() {
|
|
210825
|
+
const { meta } = useFabric();
|
|
210826
|
+
return meta.driver;
|
|
210827
|
+
}
|
|
210828
|
+
function useMode() {
|
|
210829
|
+
const { meta } = useFabric();
|
|
210830
|
+
return meta.mode;
|
|
210831
|
+
}
|
|
210832
|
+
function usePlugin() {
|
|
210833
|
+
const { meta } = useFabric();
|
|
210834
|
+
return meta.plugin;
|
|
210835
|
+
}
|
|
210836
|
+
|
|
210662
210837
|
function useOas() {
|
|
210663
210838
|
const { meta } = useFabric();
|
|
210664
210839
|
return meta.oas;
|
|
210665
210840
|
}
|
|
210666
210841
|
function useOperationManager(generator) {
|
|
210667
210842
|
const plugin = usePlugin();
|
|
210668
|
-
const driver =
|
|
210843
|
+
const driver = useDriver();
|
|
210669
210844
|
const defaultPluginName = plugin.name;
|
|
210670
210845
|
const getName = (operation, { prefix = "", suffix = "", pluginName = defaultPluginName, type }) => {
|
|
210671
210846
|
return driver.resolveName({
|
|
@@ -210787,7 +210962,7 @@ function useOperationManager(generator) {
|
|
|
210787
210962
|
}
|
|
210788
210963
|
function useSchemaManager() {
|
|
210789
210964
|
const plugin = usePlugin();
|
|
210790
|
-
const driver =
|
|
210965
|
+
const driver = useDriver();
|
|
210791
210966
|
const getName = (name, { pluginName = plugin.name, type }) => {
|
|
210792
210967
|
return driver.resolveName({
|
|
210793
210968
|
name,
|
|
@@ -210829,7 +211004,7 @@ const operationsGenerator$1 = createReactGenerator({
|
|
|
210829
211004
|
name: "operations",
|
|
210830
211005
|
Operations({ operations, generator, plugin }) {
|
|
210831
211006
|
const { name: pluginName, options: { output, importPath } } = plugin;
|
|
210832
|
-
const driver =
|
|
211007
|
+
const driver = useDriver();
|
|
210833
211008
|
const oas = useOas();
|
|
210834
211009
|
const { getFile, groupSchemasByName } = useOperationManager(generator);
|
|
210835
211010
|
const name = "operations";
|
|
@@ -210889,7 +211064,7 @@ const zodGenerator = createReactGenerator({
|
|
|
210889
211064
|
Operation({ config, operation, generator, plugin }) {
|
|
210890
211065
|
const { options, options: { coercion: globalCoercion, inferred, typed, mapper, wrapOutput, version, guidType, mini } } = plugin;
|
|
210891
211066
|
const mode = useMode();
|
|
210892
|
-
const driver =
|
|
211067
|
+
const driver = useDriver();
|
|
210893
211068
|
const oas = useOas();
|
|
210894
211069
|
const { getSchemas, getFile, getGroup } = useOperationManager(generator);
|
|
210895
211070
|
const schemaManager = useSchemaManager();
|
|
@@ -211022,7 +211197,7 @@ const zodGenerator = createReactGenerator({
|
|
|
211022
211197
|
Schema({ config, schema, plugin }) {
|
|
211023
211198
|
const { getName, getFile } = useSchemaManager();
|
|
211024
211199
|
const { options: { output, emptySchemaType, coercion, inferred, typed, mapper, importPath, wrapOutput, version, guidType, mini } } = plugin;
|
|
211025
|
-
const driver =
|
|
211200
|
+
const driver = useDriver();
|
|
211026
211201
|
const oas = useOas();
|
|
211027
211202
|
const imports = getImports(schema.tree);
|
|
211028
211203
|
const zod = {
|
|
@@ -211253,7 +211428,7 @@ const classClientGenerator = createReactGenerator({
|
|
|
211253
211428
|
name: "classClient",
|
|
211254
211429
|
Operations({ operations, generator, plugin, config }) {
|
|
211255
211430
|
const { options, name: pluginName } = plugin;
|
|
211256
|
-
const driver =
|
|
211431
|
+
const driver = useDriver();
|
|
211257
211432
|
const oas = useOas();
|
|
211258
211433
|
const { getName, getFile, getGroup, getSchemas } = useOperationManager(generator);
|
|
211259
211434
|
function renderOperationData(operation) {
|
|
@@ -211509,7 +211684,7 @@ const clientGenerator = createReactGenerator({
|
|
|
211509
211684
|
name: "client",
|
|
211510
211685
|
Operation({ config, plugin, operation, generator }) {
|
|
211511
211686
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
211512
|
-
const driver =
|
|
211687
|
+
const driver = useDriver();
|
|
211513
211688
|
const { options, options: { output, urlType } } = plugin;
|
|
211514
211689
|
const oas = useOas();
|
|
211515
211690
|
const { getSchemas, getName, getFile } = useOperationManager(generator);
|
|
@@ -211634,7 +211809,7 @@ const groupedClientGenerator = createReactGenerator({
|
|
|
211634
211809
|
name: "groupedClient",
|
|
211635
211810
|
Operations({ operations, generator, plugin }) {
|
|
211636
211811
|
const { options, name: pluginName } = plugin;
|
|
211637
|
-
const driver =
|
|
211812
|
+
const driver = useDriver();
|
|
211638
211813
|
const oas = useOas();
|
|
211639
211814
|
const { getName, getFile, getGroup } = useOperationManager(generator);
|
|
211640
211815
|
return operations.reduce((acc, operation) => {
|
|
@@ -211698,7 +211873,7 @@ const operationsGenerator = createReactGenerator({
|
|
|
211698
211873
|
name: "client",
|
|
211699
211874
|
Operations({ operations, plugin }) {
|
|
211700
211875
|
const { name: pluginName, options: { output } } = plugin;
|
|
211701
|
-
const driver =
|
|
211876
|
+
const driver = useDriver();
|
|
211702
211877
|
const oas = useOas();
|
|
211703
211878
|
const name = "operations";
|
|
211704
211879
|
const file = driver.getFile({
|
|
@@ -211730,7 +211905,7 @@ const staticClassClientGenerator = createReactGenerator({
|
|
|
211730
211905
|
name: "staticClassClient",
|
|
211731
211906
|
Operations({ operations, generator, plugin, config }) {
|
|
211732
211907
|
const { options, name: pluginName } = plugin;
|
|
211733
|
-
const driver =
|
|
211908
|
+
const driver = useDriver();
|
|
211734
211909
|
const oas = useOas();
|
|
211735
211910
|
const { getName, getFile, getGroup, getSchemas } = useOperationManager(generator);
|
|
211736
211911
|
function renderOperationData(operation) {
|
|
@@ -212328,7 +212503,7 @@ const cypressGenerator = createReactGenerator({
|
|
|
212328
212503
|
Operation({ operation, generator, plugin }) {
|
|
212329
212504
|
var _a, _b, _c, _d, _e;
|
|
212330
212505
|
const { options: { output, baseURL, dataReturnType, paramsCasing, paramsType, pathParamsType } } = plugin;
|
|
212331
|
-
const driver =
|
|
212506
|
+
const driver = useDriver();
|
|
212332
212507
|
const oas = useOas();
|
|
212333
212508
|
const { getSchemas, getName, getFile } = useOperationManager(generator);
|
|
212334
212509
|
const request = {
|
|
@@ -212839,7 +213014,7 @@ const fakerGenerator = createReactGenerator({
|
|
|
212839
213014
|
Operation({ operation, generator, plugin }) {
|
|
212840
213015
|
const { options, options: { dateParser, regexGenerator, seed, mapper } } = plugin;
|
|
212841
213016
|
const mode = useMode();
|
|
212842
|
-
const driver =
|
|
213017
|
+
const driver = useDriver();
|
|
212843
213018
|
const oas = useOas();
|
|
212844
213019
|
const { getSchemas, getFile, getGroup } = useOperationManager(generator);
|
|
212845
213020
|
const schemaManager = useSchemaManager();
|
|
@@ -212948,7 +213123,7 @@ const fakerGenerator = createReactGenerator({
|
|
|
212948
213123
|
Schema({ schema, plugin }) {
|
|
212949
213124
|
const { getName, getFile } = useSchemaManager();
|
|
212950
213125
|
const { options: { output, dateParser, regexGenerator, seed, mapper } } = plugin;
|
|
212951
|
-
const driver =
|
|
213126
|
+
const driver = useDriver();
|
|
212952
213127
|
const oas = useOas();
|
|
212953
213128
|
const imports = getImports(schema.tree);
|
|
212954
213129
|
const faker = {
|
|
@@ -213407,7 +213582,7 @@ const serverGenerator = createReactGenerator({
|
|
|
213407
213582
|
name: "operations",
|
|
213408
213583
|
Operations({ operations, generator, plugin }) {
|
|
213409
213584
|
var _a, _b;
|
|
213410
|
-
const driver =
|
|
213585
|
+
const driver = useDriver();
|
|
213411
213586
|
const { options } = plugin;
|
|
213412
213587
|
const oas = useOas();
|
|
213413
213588
|
const { getFile, getName, getSchemas } = useOperationManager(generator);
|
|
@@ -213921,7 +214096,7 @@ function Response$1({ name, typeName, operation, statusCode }) {
|
|
|
213921
214096
|
const handlersGenerator = createReactGenerator({
|
|
213922
214097
|
name: "plugin-msw",
|
|
213923
214098
|
Operations({ operations, generator, plugin }) {
|
|
213924
|
-
const driver =
|
|
214099
|
+
const driver = useDriver();
|
|
213925
214100
|
const oas = useOas();
|
|
213926
214101
|
const { getName, getFile } = useOperationManager(generator);
|
|
213927
214102
|
const file = driver.getFile({
|
|
@@ -213970,7 +214145,7 @@ const mswGenerator = createReactGenerator({
|
|
|
213970
214145
|
Operation({ operation, generator, plugin }) {
|
|
213971
214146
|
var _a;
|
|
213972
214147
|
const { options: { output, parser, baseURL } } = plugin;
|
|
213973
|
-
const driver =
|
|
214148
|
+
const driver = useDriver();
|
|
213974
214149
|
const oas = useOas();
|
|
213975
214150
|
const { getSchemas, getName, getFile } = useOperationManager(generator);
|
|
213976
214151
|
const mock = {
|
|
@@ -215650,7 +215825,7 @@ const customHookOptionsFileGenerator = createReactGenerator({
|
|
|
215650
215825
|
Operations({ operations, generator, plugin, config }) {
|
|
215651
215826
|
var _a, _b;
|
|
215652
215827
|
const { options, options: { output }, name: pluginName } = plugin;
|
|
215653
|
-
const driver =
|
|
215828
|
+
const driver = useDriver();
|
|
215654
215829
|
const { getFile } = useOperationManager(generator);
|
|
215655
215830
|
if (!options.customOptions) return null;
|
|
215656
215831
|
const override = (_b = (_a = output.override) != null ? _a : config.output.override) != null ? _b : false;
|
|
@@ -215734,7 +215909,7 @@ const hookOptionsGenerator = createReactGenerator({
|
|
|
215734
215909
|
name: "react-query-hook-options",
|
|
215735
215910
|
Operations({ operations, plugin, generator }) {
|
|
215736
215911
|
const { options, options: { output }, name: pluginName } = plugin;
|
|
215737
|
-
const driver =
|
|
215912
|
+
const driver = useDriver();
|
|
215738
215913
|
const oas = useOas();
|
|
215739
215914
|
const { getName, getFile } = useOperationManager(generator);
|
|
215740
215915
|
if (!options.customOptions) return null;
|
|
@@ -215932,7 +216107,7 @@ const infiniteQueryGenerator$1 = createReactGenerator({
|
|
|
215932
216107
|
Operation({ config, operation, generator, plugin }) {
|
|
215933
216108
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n;
|
|
215934
216109
|
const { options, options: { output } } = plugin;
|
|
215935
|
-
const driver =
|
|
216110
|
+
const driver = useDriver();
|
|
215936
216111
|
const oas = useOas();
|
|
215937
216112
|
const { getSchemas, getName, getFile } = useOperationManager(generator);
|
|
215938
216113
|
const isQuery = typeof options.query === "boolean" ? true : (_a = options.query) == null ? void 0 : _a.methods.some((method) => operation.method === method);
|
|
@@ -216177,7 +216352,7 @@ const mutationGenerator$4 = createReactGenerator({
|
|
|
216177
216352
|
Operation({ config, plugin, operation, generator }) {
|
|
216178
216353
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
216179
216354
|
const { options, options: { output } } = plugin;
|
|
216180
|
-
const driver =
|
|
216355
|
+
const driver = useDriver();
|
|
216181
216356
|
const oas = useOas();
|
|
216182
216357
|
const { getSchemas, getName, getFile } = useOperationManager(generator);
|
|
216183
216358
|
const isQuery = !!options.query && ((_a = options.query) == null ? void 0 : _a.methods.some((method) => operation.method === method));
|
|
@@ -216387,7 +216562,7 @@ const queryGenerator$4 = createReactGenerator({
|
|
|
216387
216562
|
Operation({ config, plugin, operation, generator }) {
|
|
216388
216563
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
216389
216564
|
const { options, options: { output } } = plugin;
|
|
216390
|
-
const driver =
|
|
216565
|
+
const driver = useDriver();
|
|
216391
216566
|
const oas = useOas();
|
|
216392
216567
|
const { getSchemas, getName, getFile } = useOperationManager(generator);
|
|
216393
216568
|
const isQuery = typeof options.query === "boolean" ? true : (_a = options.query) == null ? void 0 : _a.methods.some((method) => operation.method === method);
|
|
@@ -216600,7 +216775,7 @@ const suspenseInfiniteQueryGenerator = createReactGenerator({
|
|
|
216600
216775
|
Operation({ config, operation, generator, plugin }) {
|
|
216601
216776
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
216602
216777
|
const { options, options: { output } } = plugin;
|
|
216603
|
-
const driver =
|
|
216778
|
+
const driver = useDriver();
|
|
216604
216779
|
const oas = useOas();
|
|
216605
216780
|
const { getSchemas, getName, getFile } = useOperationManager(generator);
|
|
216606
216781
|
const isQuery = typeof options.query === "boolean" ? true : (_a = options.query) == null ? void 0 : _a.methods.some((method) => operation.method === method);
|
|
@@ -216835,7 +217010,7 @@ const suspenseQueryGenerator = createReactGenerator({
|
|
|
216835
217010
|
Operation({ config, operation, generator, plugin }) {
|
|
216836
217011
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
216837
217012
|
const { options, options: { output } } = plugin;
|
|
216838
|
-
const driver =
|
|
217013
|
+
const driver = useDriver();
|
|
216839
217014
|
const oas = useOas();
|
|
216840
217015
|
const { getSchemas, getName, getFile } = useOperationManager(generator);
|
|
216841
217016
|
const isQuery = typeof options.query === "boolean" ? true : (_a = options.query) == null ? void 0 : _a.methods.some((method) => operation.method === method);
|
|
@@ -217928,7 +218103,7 @@ const mutationGenerator$3 = createReactGenerator({
|
|
|
217928
218103
|
Operation({ config, operation, generator, plugin }) {
|
|
217929
218104
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
217930
218105
|
const { options, options: { output } } = plugin;
|
|
217931
|
-
const driver =
|
|
218106
|
+
const driver = useDriver();
|
|
217932
218107
|
const oas = useOas();
|
|
217933
218108
|
const { getSchemas, getName, getFile } = useOperationManager(generator);
|
|
217934
218109
|
const isQuery = !!options.query && ((_a = options.query) == null ? void 0 : _a.methods.some((method) => operation.method === method));
|
|
@@ -218112,7 +218287,7 @@ const queryGenerator$3 = createReactGenerator({
|
|
|
218112
218287
|
Operation({ config, operation, generator, plugin }) {
|
|
218113
218288
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
218114
218289
|
const { options, options: { output } } = plugin;
|
|
218115
|
-
const driver =
|
|
218290
|
+
const driver = useDriver();
|
|
218116
218291
|
const oas = useOas();
|
|
218117
218292
|
const { getSchemas, getName, getFile } = useOperationManager(generator);
|
|
218118
218293
|
const isQuery = typeof options.query === "boolean" ? true : (_a = options.query) == null ? void 0 : _a.methods.some((method) => operation.method === method);
|
|
@@ -219122,7 +219297,7 @@ const mutationGenerator$2 = createReactGenerator({
|
|
|
219122
219297
|
Operation({ config, operation, generator, plugin }) {
|
|
219123
219298
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
219124
219299
|
const { options, options: { output } } = plugin;
|
|
219125
|
-
const driver =
|
|
219300
|
+
const driver = useDriver();
|
|
219126
219301
|
const oas = useOas();
|
|
219127
219302
|
const { getSchemas, getName, getFile } = useOperationManager(generator);
|
|
219128
219303
|
const isQuery = !!options.query && ((_a = options.query) == null ? void 0 : _a.methods.some((method) => operation.method === method));
|
|
@@ -219310,7 +219485,7 @@ const queryGenerator$2 = createReactGenerator({
|
|
|
219310
219485
|
Operation({ config, operation, generator, plugin }) {
|
|
219311
219486
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
219312
219487
|
const { options, options: { output } } = plugin;
|
|
219313
|
-
const driver =
|
|
219488
|
+
const driver = useDriver();
|
|
219314
219489
|
const oas = useOas();
|
|
219315
219490
|
const { getSchemas, getName, getFile } = useOperationManager(generator);
|
|
219316
219491
|
const isQuery = typeof options.query === "boolean" ? true : (_a = options.query) == null ? void 0 : _a.methods.some((method) => operation.method === method);
|
|
@@ -220353,7 +220528,7 @@ const mutationGenerator$1 = createReactGenerator({
|
|
|
220353
220528
|
Operation({ config, operation, generator, plugin }) {
|
|
220354
220529
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
220355
220530
|
const { options, options: { output } } = plugin;
|
|
220356
|
-
const driver =
|
|
220531
|
+
const driver = useDriver();
|
|
220357
220532
|
const oas = useOas();
|
|
220358
220533
|
const { getSchemas, getName, getFile } = useOperationManager(generator);
|
|
220359
220534
|
const isQuery = !!options.query && ((_a = options.query) == null ? void 0 : _a.methods.some((method) => operation.method === method));
|
|
@@ -220537,7 +220712,7 @@ const queryGenerator$1 = createReactGenerator({
|
|
|
220537
220712
|
Operation({ config, operation, generator, plugin }) {
|
|
220538
220713
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
220539
220714
|
const { options, options: { output } } = plugin;
|
|
220540
|
-
const driver =
|
|
220715
|
+
const driver = useDriver();
|
|
220541
220716
|
const oas = useOas();
|
|
220542
220717
|
const { getSchemas, getName, getFile } = useOperationManager(generator);
|
|
220543
220718
|
const isQuery = typeof options.query === "boolean" ? true : (_a = options.query) == null ? void 0 : _a.methods.some((method) => operation.method === method);
|
|
@@ -221884,7 +222059,7 @@ const infiniteQueryGenerator = createReactGenerator({
|
|
|
221884
222059
|
Operation({ config, operation, generator, plugin }) {
|
|
221885
222060
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
221886
222061
|
const { options, options: { output } } = plugin;
|
|
221887
|
-
const driver =
|
|
222062
|
+
const driver = useDriver();
|
|
221888
222063
|
const oas = useOas();
|
|
221889
222064
|
const { getSchemas, getName, getFile } = useOperationManager(generator);
|
|
221890
222065
|
const isQuery = typeof options.query === "boolean" ? true : (_a = options.query) == null ? void 0 : _a.methods.some((method) => operation.method === method);
|
|
@@ -222120,7 +222295,7 @@ const mutationGenerator = createReactGenerator({
|
|
|
222120
222295
|
Operation({ config, operation, generator, plugin }) {
|
|
222121
222296
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
222122
222297
|
const { options, options: { output } } = plugin;
|
|
222123
|
-
const driver =
|
|
222298
|
+
const driver = useDriver();
|
|
222124
222299
|
const oas = useOas();
|
|
222125
222300
|
const { getSchemas, getName, getFile } = useOperationManager(generator);
|
|
222126
222301
|
const isQuery = !!options.query && ((_a = options.query) == null ? void 0 : _a.methods.some((method) => operation.method === method));
|
|
@@ -222309,7 +222484,7 @@ const queryGenerator = createReactGenerator({
|
|
|
222309
222484
|
Operation({ config, operation, generator, plugin }) {
|
|
222310
222485
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
222311
222486
|
const { options, options: { output } } = plugin;
|
|
222312
|
-
const driver =
|
|
222487
|
+
const driver = useDriver();
|
|
222313
222488
|
const oas = useOas();
|
|
222314
222489
|
const { getSchemas, getName, getFile } = useOperationManager(generator);
|
|
222315
222490
|
const isQuery = typeof options.query === "boolean" ? true : (_a = options.query) == null ? void 0 : _a.methods.some((method) => operation.method === method);
|