@kubb/agent 5.0.0-alpha.6 → 5.0.0-alpha.7
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.
|
@@ -4906,7 +4906,7 @@ var __privateWrapper$1 = (obj, member, setter, getter) => ({
|
|
|
4906
4906
|
return __privateGet$c(obj, member, getter);
|
|
4907
4907
|
}
|
|
4908
4908
|
});
|
|
4909
|
-
var _emitter, _a$c, _options$c, _URLPath_instances$a, transformParam_fn$a, eachParam_fn$a, _b$2, _head$1, _tail$1, _size$1, _c,
|
|
4909
|
+
var _emitter, _a$c, _options$c, _URLPath_instances$a, transformParam_fn$a, eachParam_fn$a, _b$2, _head$1, _tail$1, _size$1, _c, _studioIsOpen, _plugins, _usedPluginNames, _PluginDriver_instances, getSortedPlugins_fn, emitProcessingEnd_fn, execute_fn, executeSync_fn, parse_fn, _d, _e, _cache, _cwd, _PackageManager_instances, match_fn, _items, _FunctionParams_static, _f, orderItems_fn, addParams_fn, _cachedLeaves, _g;
|
|
4910
4910
|
var ValidationPluginError = class extends Error {
|
|
4911
4911
|
};
|
|
4912
4912
|
function toError(value) {
|
|
@@ -5073,6 +5073,9 @@ function setUniqueName(originalName, data) {
|
|
|
5073
5073
|
data[originalName] = 1;
|
|
5074
5074
|
return originalName;
|
|
5075
5075
|
}
|
|
5076
|
+
function isPromiseRejectedResult(result) {
|
|
5077
|
+
return result.status === "rejected";
|
|
5078
|
+
}
|
|
5076
5079
|
const reservedWords = [
|
|
5077
5080
|
"abstract",
|
|
5078
5081
|
"arguments",
|
|
@@ -5486,28 +5489,14 @@ function hookParallel(promises, concurrency = Number.POSITIVE_INFINITY) {
|
|
|
5486
5489
|
const tasks = promises.filter(Boolean).map((promise) => limit(() => promise()));
|
|
5487
5490
|
return Promise.allSettled(tasks);
|
|
5488
5491
|
}
|
|
5489
|
-
var PromiseManager = (_d = class {
|
|
5490
|
-
constructor(options = {}) {
|
|
5491
|
-
__privateAdd$c(this, _options2$1, {});
|
|
5492
|
-
__privateSet$c(this, _options2$1, options);
|
|
5493
|
-
}
|
|
5494
|
-
run(strategy, promises, { concurrency = Number.POSITIVE_INFINITY } = {}) {
|
|
5495
|
-
if (strategy === "seq") return hookSeq(promises);
|
|
5496
|
-
if (strategy === "first") return hookFirst(promises, __privateGet$c(this, _options2$1).nullCheck);
|
|
5497
|
-
if (strategy === "parallel") return hookParallel(promises, concurrency);
|
|
5498
|
-
throw new Error(`${strategy} not implemented`);
|
|
5499
|
-
}
|
|
5500
|
-
}, _options2$1 = new WeakMap(), _d);
|
|
5501
|
-
function isPromiseRejectedResult(result) {
|
|
5502
|
-
return result.status === "rejected";
|
|
5503
|
-
}
|
|
5504
5492
|
function getMode(fileOrFolder) {
|
|
5505
5493
|
if (!fileOrFolder) return "split";
|
|
5506
5494
|
return extname(fileOrFolder) ? "single" : "split";
|
|
5507
5495
|
}
|
|
5508
|
-
|
|
5496
|
+
const hookFirstNullCheck = (state) => !!(state == null ? void 0 : state.result);
|
|
5497
|
+
var PluginDriver = (_d = class {
|
|
5509
5498
|
constructor(config, options) {
|
|
5510
|
-
__privateAdd$c(this,
|
|
5499
|
+
__privateAdd$c(this, _PluginDriver_instances);
|
|
5511
5500
|
__publicField$b(this, "config");
|
|
5512
5501
|
__publicField$b(this, "options");
|
|
5513
5502
|
/**
|
|
@@ -5519,7 +5508,6 @@ var PluginManager = (_e = class {
|
|
|
5519
5508
|
__privateAdd$c(this, _studioIsOpen, false);
|
|
5520
5509
|
__privateAdd$c(this, _plugins, /* @__PURE__ */ new Set());
|
|
5521
5510
|
__privateAdd$c(this, _usedPluginNames, {});
|
|
5522
|
-
__privateAdd$c(this, _promiseManager);
|
|
5523
5511
|
__publicField$b(this, "resolvePath", (params) => {
|
|
5524
5512
|
var _a2, _b2;
|
|
5525
5513
|
const defaultPath = resolve(resolve(this.config.root, this.config.output.path), params.baseName);
|
|
@@ -5559,9 +5547,8 @@ var PluginManager = (_e = class {
|
|
|
5559
5547
|
});
|
|
5560
5548
|
this.config = config;
|
|
5561
5549
|
this.options = options;
|
|
5562
|
-
__privateSet$c(this, _promiseManager, new PromiseManager({ nullCheck: (state) => !!(state == null ? void 0 : state.result) }));
|
|
5563
5550
|
[...config.plugins || []].forEach((plugin) => {
|
|
5564
|
-
const parsedPlugin = __privateMethod$c(this,
|
|
5551
|
+
const parsedPlugin = __privateMethod$c(this, _PluginDriver_instances, parse_fn).call(this, plugin);
|
|
5565
5552
|
__privateGet$c(this, _plugins).add(parsedPlugin);
|
|
5566
5553
|
});
|
|
5567
5554
|
}
|
|
@@ -5570,13 +5557,13 @@ var PluginManager = (_e = class {
|
|
|
5570
5557
|
}
|
|
5571
5558
|
getContext(plugin) {
|
|
5572
5559
|
const plugins = [...__privateGet$c(this, _plugins)];
|
|
5573
|
-
const
|
|
5560
|
+
const driver = this;
|
|
5574
5561
|
const baseContext = {
|
|
5575
5562
|
fabric: this.options.fabric,
|
|
5576
5563
|
config: this.config,
|
|
5577
5564
|
plugin,
|
|
5578
5565
|
events: this.options.events,
|
|
5579
|
-
|
|
5566
|
+
driver: this,
|
|
5580
5567
|
mode: getMode(resolve(this.config.root, this.config.output.path)),
|
|
5581
5568
|
addFile: async (...files) => {
|
|
5582
5569
|
await this.options.fabric.addFile(...files);
|
|
@@ -5585,19 +5572,19 @@ var PluginManager = (_e = class {
|
|
|
5585
5572
|
await this.options.fabric.upsertFile(...files);
|
|
5586
5573
|
},
|
|
5587
5574
|
get rootNode() {
|
|
5588
|
-
return
|
|
5575
|
+
return driver.rootNode;
|
|
5589
5576
|
},
|
|
5590
5577
|
get adapter() {
|
|
5591
|
-
return
|
|
5578
|
+
return driver.adapter;
|
|
5592
5579
|
},
|
|
5593
5580
|
openInStudio(options) {
|
|
5594
5581
|
var _a2, _b2;
|
|
5595
|
-
if (!
|
|
5596
|
-
if (typeof
|
|
5597
|
-
if (!
|
|
5598
|
-
__privateSet$c(
|
|
5599
|
-
const studioUrl = (_b2 = (_a2 =
|
|
5600
|
-
return openInStudio(
|
|
5582
|
+
if (!driver.config.devtools || __privateGet$c(driver, _studioIsOpen)) return;
|
|
5583
|
+
if (typeof driver.config.devtools !== "object") throw new Error("Devtools must be an object");
|
|
5584
|
+
if (!driver.rootNode || !driver.adapter) throw new Error("adapter is not defined, make sure you have set the parser in kubb.config.ts");
|
|
5585
|
+
__privateSet$c(driver, _studioIsOpen, true);
|
|
5586
|
+
const studioUrl = (_b2 = (_a2 = driver.config.devtools) == null ? void 0 : _a2.studioUrl) != null ? _b2 : "https://studio.kubb.dev";
|
|
5587
|
+
return openInStudio(driver.rootNode, studioUrl, options);
|
|
5601
5588
|
}
|
|
5602
5589
|
};
|
|
5603
5590
|
const mergedExtras = {};
|
|
@@ -5611,7 +5598,7 @@ var PluginManager = (_e = class {
|
|
|
5611
5598
|
};
|
|
5612
5599
|
}
|
|
5613
5600
|
get plugins() {
|
|
5614
|
-
return __privateMethod$c(this,
|
|
5601
|
+
return __privateMethod$c(this, _PluginDriver_instances, getSortedPlugins_fn).call(this);
|
|
5615
5602
|
}
|
|
5616
5603
|
getFile({ name, mode, extname: extname2, pluginName, options }) {
|
|
5617
5604
|
const resolvedName = mode ? mode === "single" ? "" : this.resolveName({
|
|
@@ -5646,7 +5633,7 @@ var PluginManager = (_e = class {
|
|
|
5646
5633
|
});
|
|
5647
5634
|
const items = [];
|
|
5648
5635
|
for (const plugin of plugins) {
|
|
5649
|
-
const result = await __privateMethod$c(this,
|
|
5636
|
+
const result = await __privateMethod$c(this, _PluginDriver_instances, execute_fn).call(this, {
|
|
5650
5637
|
strategy: "hookFirst",
|
|
5651
5638
|
hookName,
|
|
5652
5639
|
parameters,
|
|
@@ -5662,7 +5649,7 @@ var PluginManager = (_e = class {
|
|
|
5662
5649
|
*/
|
|
5663
5650
|
hookForPluginSync({ pluginName, hookName, parameters }) {
|
|
5664
5651
|
return this.getPluginsByName(hookName, pluginName).map((plugin) => {
|
|
5665
|
-
return __privateMethod$c(this,
|
|
5652
|
+
return __privateMethod$c(this, _PluginDriver_instances, executeSync_fn).call(this, {
|
|
5666
5653
|
strategy: "hookFirst",
|
|
5667
5654
|
hookName,
|
|
5668
5655
|
parameters,
|
|
@@ -5674,16 +5661,16 @@ var PluginManager = (_e = class {
|
|
|
5674
5661
|
* Returns the first non-null result.
|
|
5675
5662
|
*/
|
|
5676
5663
|
async hookFirst({ hookName, parameters, skipped }) {
|
|
5677
|
-
const plugins = __privateMethod$c(this,
|
|
5664
|
+
const plugins = __privateMethod$c(this, _PluginDriver_instances, getSortedPlugins_fn).call(this, hookName).filter((plugin) => {
|
|
5678
5665
|
return skipped ? !skipped.has(plugin) : true;
|
|
5679
5666
|
});
|
|
5680
5667
|
this.events.emit("plugins:hook:progress:start", {
|
|
5681
5668
|
hookName,
|
|
5682
5669
|
plugins
|
|
5683
5670
|
});
|
|
5684
|
-
const
|
|
5671
|
+
const result = await hookFirst(plugins.map((plugin) => {
|
|
5685
5672
|
return async () => {
|
|
5686
|
-
const value = await __privateMethod$c(this,
|
|
5673
|
+
const value = await __privateMethod$c(this, _PluginDriver_instances, execute_fn).call(this, {
|
|
5687
5674
|
strategy: "hookFirst",
|
|
5688
5675
|
hookName,
|
|
5689
5676
|
parameters,
|
|
@@ -5694,8 +5681,7 @@ var PluginManager = (_e = class {
|
|
|
5694
5681
|
result: value
|
|
5695
5682
|
});
|
|
5696
5683
|
};
|
|
5697
|
-
});
|
|
5698
|
-
const result = await __privateGet$c(this, _promiseManager).run("first", promises);
|
|
5684
|
+
}), hookFirstNullCheck);
|
|
5699
5685
|
this.events.emit("plugins:hook:progress:end", { hookName });
|
|
5700
5686
|
return result;
|
|
5701
5687
|
}
|
|
@@ -5704,12 +5690,12 @@ var PluginManager = (_e = class {
|
|
|
5704
5690
|
*/
|
|
5705
5691
|
hookFirstSync({ hookName, parameters, skipped }) {
|
|
5706
5692
|
let parseResult = null;
|
|
5707
|
-
const plugins = __privateMethod$c(this,
|
|
5693
|
+
const plugins = __privateMethod$c(this, _PluginDriver_instances, getSortedPlugins_fn).call(this, hookName).filter((plugin) => {
|
|
5708
5694
|
return skipped ? !skipped.has(plugin) : true;
|
|
5709
5695
|
});
|
|
5710
5696
|
for (const plugin of plugins) {
|
|
5711
5697
|
parseResult = {
|
|
5712
|
-
result: __privateMethod$c(this,
|
|
5698
|
+
result: __privateMethod$c(this, _PluginDriver_instances, executeSync_fn).call(this, {
|
|
5713
5699
|
strategy: "hookFirst",
|
|
5714
5700
|
hookName,
|
|
5715
5701
|
parameters,
|
|
@@ -5725,28 +5711,27 @@ var PluginManager = (_e = class {
|
|
|
5725
5711
|
* Runs all plugins in parallel based on `this.plugin` order and `pre`/`post` settings.
|
|
5726
5712
|
*/
|
|
5727
5713
|
async hookParallel({ hookName, parameters }) {
|
|
5728
|
-
const plugins = __privateMethod$c(this,
|
|
5714
|
+
const plugins = __privateMethod$c(this, _PluginDriver_instances, getSortedPlugins_fn).call(this, hookName);
|
|
5729
5715
|
this.events.emit("plugins:hook:progress:start", {
|
|
5730
5716
|
hookName,
|
|
5731
5717
|
plugins
|
|
5732
5718
|
});
|
|
5733
5719
|
const pluginStartTimes = /* @__PURE__ */ new Map();
|
|
5734
|
-
const
|
|
5720
|
+
const results = await hookParallel(plugins.map((plugin) => {
|
|
5735
5721
|
return () => {
|
|
5736
5722
|
pluginStartTimes.set(plugin, performance$1.now());
|
|
5737
|
-
return __privateMethod$c(this,
|
|
5723
|
+
return __privateMethod$c(this, _PluginDriver_instances, execute_fn).call(this, {
|
|
5738
5724
|
strategy: "hookParallel",
|
|
5739
5725
|
hookName,
|
|
5740
5726
|
parameters,
|
|
5741
5727
|
plugin
|
|
5742
5728
|
});
|
|
5743
5729
|
};
|
|
5744
|
-
});
|
|
5745
|
-
const results = await __privateGet$c(this, _promiseManager).run("parallel", promises, { concurrency: this.options.concurrency });
|
|
5730
|
+
}), this.options.concurrency);
|
|
5746
5731
|
results.forEach((result, index) => {
|
|
5747
5732
|
var _a2;
|
|
5748
5733
|
if (isPromiseRejectedResult(result)) {
|
|
5749
|
-
const plugin = __privateMethod$c(this,
|
|
5734
|
+
const plugin = __privateMethod$c(this, _PluginDriver_instances, getSortedPlugins_fn).call(this, hookName)[index];
|
|
5750
5735
|
if (plugin) {
|
|
5751
5736
|
const startTime = (_a2 = pluginStartTimes.get(plugin)) != null ? _a2 : performance$1.now();
|
|
5752
5737
|
this.events.emit("error", result.reason, {
|
|
@@ -5769,20 +5754,19 @@ var PluginManager = (_e = class {
|
|
|
5769
5754
|
* Chains plugins
|
|
5770
5755
|
*/
|
|
5771
5756
|
async hookSeq({ hookName, parameters }) {
|
|
5772
|
-
const plugins = __privateMethod$c(this,
|
|
5757
|
+
const plugins = __privateMethod$c(this, _PluginDriver_instances, getSortedPlugins_fn).call(this, hookName);
|
|
5773
5758
|
this.events.emit("plugins:hook:progress:start", {
|
|
5774
5759
|
hookName,
|
|
5775
5760
|
plugins
|
|
5776
5761
|
});
|
|
5777
|
-
|
|
5778
|
-
return () => __privateMethod$c(this,
|
|
5762
|
+
await hookSeq(plugins.map((plugin) => {
|
|
5763
|
+
return () => __privateMethod$c(this, _PluginDriver_instances, execute_fn).call(this, {
|
|
5779
5764
|
strategy: "hookSeq",
|
|
5780
5765
|
hookName,
|
|
5781
5766
|
parameters,
|
|
5782
5767
|
plugin
|
|
5783
5768
|
});
|
|
5784
|
-
});
|
|
5785
|
-
await __privateGet$c(this, _promiseManager).run("seq", promises);
|
|
5769
|
+
}));
|
|
5786
5770
|
this.events.emit("plugins:hook:progress:end", { hookName });
|
|
5787
5771
|
}
|
|
5788
5772
|
getPluginByName(pluginName) {
|
|
@@ -5797,7 +5781,7 @@ var PluginManager = (_e = class {
|
|
|
5797
5781
|
}
|
|
5798
5782
|
return pluginByPluginName;
|
|
5799
5783
|
}
|
|
5800
|
-
}, _studioIsOpen = new WeakMap(), _plugins = new WeakMap(), _usedPluginNames = new WeakMap(),
|
|
5784
|
+
}, _studioIsOpen = new WeakMap(), _plugins = new WeakMap(), _usedPluginNames = new WeakMap(), _PluginDriver_instances = new WeakSet(), getSortedPlugins_fn = function(hookName) {
|
|
5801
5785
|
const plugins = [...__privateGet$c(this, _plugins)];
|
|
5802
5786
|
if (hookName) return plugins.filter((plugin) => hookName in plugin);
|
|
5803
5787
|
return plugins.map((plugin) => {
|
|
@@ -5841,7 +5825,7 @@ emitProcessingEnd_fn = function({ startTime, output, strategy, hookName, plugin,
|
|
|
5841
5825
|
return (async () => {
|
|
5842
5826
|
try {
|
|
5843
5827
|
const output = typeof hook === "function" ? await Promise.resolve(hook.apply(this.getContext(plugin), parameters != null ? parameters : [])) : hook;
|
|
5844
|
-
__privateMethod$c(this,
|
|
5828
|
+
__privateMethod$c(this, _PluginDriver_instances, emitProcessingEnd_fn).call(this, {
|
|
5845
5829
|
startTime,
|
|
5846
5830
|
output,
|
|
5847
5831
|
strategy,
|
|
@@ -5878,7 +5862,7 @@ executeSync_fn = function({ strategy, hookName, parameters, plugin }) {
|
|
|
5878
5862
|
const startTime = performance$1.now();
|
|
5879
5863
|
try {
|
|
5880
5864
|
const output = typeof hook === "function" ? hook.apply(this.getContext(plugin), parameters) : hook;
|
|
5881
|
-
__privateMethod$c(this,
|
|
5865
|
+
__privateMethod$c(this, _PluginDriver_instances, emitProcessingEnd_fn).call(this, {
|
|
5882
5866
|
startTime,
|
|
5883
5867
|
output,
|
|
5884
5868
|
strategy,
|
|
@@ -5906,7 +5890,7 @@ executeSync_fn = function({ strategy, hookName, parameters, plugin }) {
|
|
|
5906
5890
|
},
|
|
5907
5891
|
...plugin
|
|
5908
5892
|
};
|
|
5909
|
-
},
|
|
5893
|
+
}, _d);
|
|
5910
5894
|
function defineStorage(build2) {
|
|
5911
5895
|
return (options) => build2(options != null ? options : {});
|
|
5912
5896
|
}
|
|
@@ -5956,7 +5940,7 @@ const fsStorage = defineStorage(() => ({
|
|
|
5956
5940
|
await clean(resolve(base));
|
|
5957
5941
|
}
|
|
5958
5942
|
}));
|
|
5959
|
-
var version$1 = "5.0.0-alpha.
|
|
5943
|
+
var version$1 = "5.0.0-alpha.7";
|
|
5960
5944
|
function getDiagnosticInfo() {
|
|
5961
5945
|
return {
|
|
5962
5946
|
nodeVersion: version$2,
|
|
@@ -6064,7 +6048,7 @@ async function setup(options) {
|
|
|
6064
6048
|
` \u2022 Barrel type: ${definedConfig.output.barrelType || "none"}`
|
|
6065
6049
|
]
|
|
6066
6050
|
});
|
|
6067
|
-
const
|
|
6051
|
+
const pluginDriver = new PluginDriver(definedConfig, {
|
|
6068
6052
|
fabric,
|
|
6069
6053
|
events,
|
|
6070
6054
|
concurrency: 15
|
|
@@ -6075,33 +6059,33 @@ async function setup(options) {
|
|
|
6075
6059
|
date: /* @__PURE__ */ new Date(),
|
|
6076
6060
|
logs: [`Running adapter: ${definedConfig.adapter.name}`]
|
|
6077
6061
|
});
|
|
6078
|
-
|
|
6079
|
-
|
|
6062
|
+
pluginDriver.adapter = definedConfig.adapter;
|
|
6063
|
+
pluginDriver.rootNode = await definedConfig.adapter.parse(source);
|
|
6080
6064
|
await events.emit("debug", {
|
|
6081
6065
|
date: /* @__PURE__ */ new Date(),
|
|
6082
6066
|
logs: [
|
|
6083
6067
|
`\u2713 Adapter '${definedConfig.adapter.name}' resolved RootNode`,
|
|
6084
|
-
` \u2022 Schemas: ${
|
|
6085
|
-
` \u2022 Operations: ${
|
|
6068
|
+
` \u2022 Schemas: ${pluginDriver.rootNode.schemas.length}`,
|
|
6069
|
+
` \u2022 Operations: ${pluginDriver.rootNode.operations.length}`
|
|
6086
6070
|
]
|
|
6087
6071
|
});
|
|
6088
6072
|
}
|
|
6089
6073
|
return {
|
|
6090
6074
|
events,
|
|
6091
6075
|
fabric,
|
|
6092
|
-
|
|
6076
|
+
driver: pluginDriver,
|
|
6093
6077
|
sources
|
|
6094
6078
|
};
|
|
6095
6079
|
}
|
|
6096
6080
|
async function safeBuild(options, overrides) {
|
|
6097
6081
|
var _a2, _b2, _c2;
|
|
6098
|
-
const { fabric,
|
|
6082
|
+
const { fabric, driver, events, sources } = overrides ? overrides : await setup(options);
|
|
6099
6083
|
const failedPlugins = /* @__PURE__ */ new Set();
|
|
6100
6084
|
const pluginTimings = /* @__PURE__ */ new Map();
|
|
6101
|
-
const config =
|
|
6085
|
+
const config = driver.config;
|
|
6102
6086
|
try {
|
|
6103
|
-
for (const plugin of
|
|
6104
|
-
const context =
|
|
6087
|
+
for (const plugin of driver.plugins) {
|
|
6088
|
+
const context = driver.getContext(plugin);
|
|
6105
6089
|
const hrStart = process.hrtime();
|
|
6106
6090
|
const installer = plugin.install.bind(context);
|
|
6107
6091
|
try {
|
|
@@ -6174,7 +6158,7 @@ async function safeBuild(options, overrides) {
|
|
|
6174
6158
|
rootDir,
|
|
6175
6159
|
existingExports: new Set((_b2 = (_a2 = existingBarrel == null ? void 0 : existingBarrel.exports) == null ? void 0 : _a2.flatMap((e) => Array.isArray(e.name) ? e.name : [e.name]).filter((n) => Boolean(n))) != null ? _b2 : []),
|
|
6176
6160
|
config,
|
|
6177
|
-
|
|
6161
|
+
driver
|
|
6178
6162
|
}),
|
|
6179
6163
|
sources: [],
|
|
6180
6164
|
imports: [],
|
|
@@ -6192,7 +6176,7 @@ async function safeBuild(options, overrides) {
|
|
|
6192
6176
|
failedPlugins,
|
|
6193
6177
|
fabric,
|
|
6194
6178
|
files,
|
|
6195
|
-
|
|
6179
|
+
driver,
|
|
6196
6180
|
pluginTimings,
|
|
6197
6181
|
sources
|
|
6198
6182
|
};
|
|
@@ -6201,16 +6185,16 @@ async function safeBuild(options, overrides) {
|
|
|
6201
6185
|
failedPlugins,
|
|
6202
6186
|
fabric,
|
|
6203
6187
|
files: [],
|
|
6204
|
-
|
|
6188
|
+
driver,
|
|
6205
6189
|
pluginTimings,
|
|
6206
6190
|
error,
|
|
6207
6191
|
sources
|
|
6208
6192
|
};
|
|
6209
6193
|
}
|
|
6210
6194
|
}
|
|
6211
|
-
function buildBarrelExports({ barrelFiles, rootDir, existingExports, config,
|
|
6195
|
+
function buildBarrelExports({ barrelFiles, rootDir, existingExports, config, driver }) {
|
|
6212
6196
|
const pluginNameMap = /* @__PURE__ */ new Map();
|
|
6213
|
-
for (const plugin of
|
|
6197
|
+
for (const plugin of driver.plugins) pluginNameMap.set(plugin.name, plugin);
|
|
6214
6198
|
return barrelFiles.flatMap((file) => {
|
|
6215
6199
|
var _a2, _b2;
|
|
6216
6200
|
const containsOnlyTypes = (_a2 = file.sources) == null ? void 0 : _a2.every((source) => source.isTypeOnly);
|
|
@@ -6275,7 +6259,7 @@ function defineGenerator(generator) {
|
|
|
6275
6259
|
function definePlugin(build2) {
|
|
6276
6260
|
return (options) => build2(options != null ? options : {});
|
|
6277
6261
|
}
|
|
6278
|
-
var PackageManager = (
|
|
6262
|
+
var PackageManager = (_e = class {
|
|
6279
6263
|
constructor(workspace) {
|
|
6280
6264
|
__privateAdd$c(this, _PackageManager_instances);
|
|
6281
6265
|
__privateAdd$c(this, _cwd);
|
|
@@ -6317,16 +6301,16 @@ var PackageManager = (_f = class {
|
|
|
6317
6301
|
return JSON.parse(json);
|
|
6318
6302
|
}
|
|
6319
6303
|
static setVersion(dependency, version2) {
|
|
6320
|
-
__privateGet$c(
|
|
6304
|
+
__privateGet$c(_e, _cache)[dependency] = version2;
|
|
6321
6305
|
}
|
|
6322
6306
|
async getVersion(dependency) {
|
|
6323
|
-
if (typeof dependency === "string" && __privateGet$c(
|
|
6307
|
+
if (typeof dependency === "string" && __privateGet$c(_e, _cache)[dependency]) return __privateGet$c(_e, _cache)[dependency];
|
|
6324
6308
|
const packageJSON = await this.getPackageJSON();
|
|
6325
6309
|
if (!packageJSON) return;
|
|
6326
6310
|
return __privateMethod$c(this, _PackageManager_instances, match_fn).call(this, packageJSON, dependency);
|
|
6327
6311
|
}
|
|
6328
6312
|
getVersionSync(dependency) {
|
|
6329
|
-
if (typeof dependency === "string" && __privateGet$c(
|
|
6313
|
+
if (typeof dependency === "string" && __privateGet$c(_e, _cache)[dependency]) return __privateGet$c(_e, _cache)[dependency];
|
|
6330
6314
|
const packageJSON = this.getPackageJSONSync();
|
|
6331
6315
|
if (!packageJSON) return;
|
|
6332
6316
|
return __privateMethod$c(this, _PackageManager_instances, match_fn).call(this, packageJSON, dependency);
|
|
@@ -6355,7 +6339,7 @@ var PackageManager = (_f = class {
|
|
|
6355
6339
|
if (typeof dependency === "string" && dependencies[dependency]) return dependencies[dependency];
|
|
6356
6340
|
const matchedDependency = Object.keys(dependencies).find((dep) => dep.match(dependency));
|
|
6357
6341
|
return matchedDependency ? dependencies[matchedDependency] : void 0;
|
|
6358
|
-
}, __privateAdd$c(
|
|
6342
|
+
}, __privateAdd$c(_e, _cache, {}), _e);
|
|
6359
6343
|
const memoryStorage = defineStorage(() => {
|
|
6360
6344
|
const store = /* @__PURE__ */ new Map();
|
|
6361
6345
|
return {
|
|
@@ -6386,7 +6370,7 @@ const memoryStorage = defineStorage(() => {
|
|
|
6386
6370
|
}
|
|
6387
6371
|
};
|
|
6388
6372
|
});
|
|
6389
|
-
(
|
|
6373
|
+
(_f = class {
|
|
6390
6374
|
constructor() {
|
|
6391
6375
|
__privateAdd$c(this, _items, []);
|
|
6392
6376
|
}
|
|
@@ -6412,11 +6396,11 @@ const memoryStorage = defineStorage(() => {
|
|
|
6412
6396
|
const required = (_b2 = items.every((item) => item.required)) != null ? _b2 : true;
|
|
6413
6397
|
items.forEach((item) => {
|
|
6414
6398
|
var _a3, _b3;
|
|
6415
|
-
name = __privateMethod$c(_a3 =
|
|
6399
|
+
name = __privateMethod$c(_a3 = _f, _FunctionParams_static, addParams_fn).call(_a3, name, {
|
|
6416
6400
|
...item,
|
|
6417
6401
|
type: void 0
|
|
6418
6402
|
});
|
|
6419
|
-
if (items.some((item2) => item2.type)) type = __privateMethod$c(_b3 =
|
|
6403
|
+
if (items.some((item2) => item2.type)) type = __privateMethod$c(_b3 = _f, _FunctionParams_static, addParams_fn).call(_b3, type, item);
|
|
6420
6404
|
});
|
|
6421
6405
|
return {
|
|
6422
6406
|
name: `{ ${name.join(", ")} }`,
|
|
@@ -6427,26 +6411,26 @@ const memoryStorage = defineStorage(() => {
|
|
|
6427
6411
|
}
|
|
6428
6412
|
toObject() {
|
|
6429
6413
|
var _a2;
|
|
6430
|
-
const items = __privateMethod$c(_a2 =
|
|
6431
|
-
return
|
|
6414
|
+
const items = __privateMethod$c(_a2 = _f, _FunctionParams_static, orderItems_fn).call(_a2, __privateGet$c(this, _items)).flat();
|
|
6415
|
+
return _f.toObject(items);
|
|
6432
6416
|
}
|
|
6433
6417
|
static toString(items) {
|
|
6434
6418
|
var _a2;
|
|
6435
|
-
return __privateMethod$c(_a2 =
|
|
6419
|
+
return __privateMethod$c(_a2 = _f, _FunctionParams_static, orderItems_fn).call(_a2, items).reduce((acc, item) => {
|
|
6436
6420
|
var _a3, _b2, _c2;
|
|
6437
6421
|
if (Array.isArray(item)) {
|
|
6438
6422
|
if (item.length <= 0) return acc;
|
|
6439
|
-
const subItems = __privateMethod$c(_a3 =
|
|
6440
|
-
const objectItem =
|
|
6441
|
-
return __privateMethod$c(_b2 =
|
|
6423
|
+
const subItems = __privateMethod$c(_a3 = _f, _FunctionParams_static, orderItems_fn).call(_a3, item);
|
|
6424
|
+
const objectItem = _f.toObject(subItems);
|
|
6425
|
+
return __privateMethod$c(_b2 = _f, _FunctionParams_static, addParams_fn).call(_b2, acc, objectItem);
|
|
6442
6426
|
}
|
|
6443
|
-
return __privateMethod$c(_c2 =
|
|
6427
|
+
return __privateMethod$c(_c2 = _f, _FunctionParams_static, addParams_fn).call(_c2, acc, item);
|
|
6444
6428
|
}, []).join(", ");
|
|
6445
6429
|
}
|
|
6446
6430
|
toString() {
|
|
6447
6431
|
var _a2;
|
|
6448
|
-
const items = __privateMethod$c(_a2 =
|
|
6449
|
-
return
|
|
6432
|
+
const items = __privateMethod$c(_a2 = _f, _FunctionParams_static, orderItems_fn).call(_a2, __privateGet$c(this, _items));
|
|
6433
|
+
return _f.toString(items);
|
|
6450
6434
|
}
|
|
6451
6435
|
}, _items = new WeakMap(), _FunctionParams_static = new WeakSet(), orderItems_fn = function(items) {
|
|
6452
6436
|
return sortBy(items.filter(Boolean), [(item) => Array.isArray(item), "desc"], [(item) => !Array.isArray(item) && item.default !== void 0, "asc"], [(item) => {
|
|
@@ -6465,7 +6449,7 @@ const memoryStorage = defineStorage(() => {
|
|
|
6465
6449
|
else acc.push(`${parameterName}?: ${type}`);
|
|
6466
6450
|
else acc.push(`${parameterName}`);
|
|
6467
6451
|
return acc;
|
|
6468
|
-
}, __privateAdd$c(
|
|
6452
|
+
}, __privateAdd$c(_f, _FunctionParams_static), _f);
|
|
6469
6453
|
async function isFormatterAvailable(formatter) {
|
|
6470
6454
|
try {
|
|
6471
6455
|
await x(formatter, ["--version"], { nodeOptions: { stdio: "ignore" } });
|
|
@@ -6481,7 +6465,7 @@ async function detectFormatter() {
|
|
|
6481
6465
|
"prettier"
|
|
6482
6466
|
]) if (await isFormatterAvailable(formatter)) return formatter;
|
|
6483
6467
|
}
|
|
6484
|
-
var TreeNode = (
|
|
6468
|
+
var TreeNode = (_g = class {
|
|
6485
6469
|
constructor(data, parent) {
|
|
6486
6470
|
__publicField$b(this, "data");
|
|
6487
6471
|
__publicField$b(this, "parent");
|
|
@@ -6491,7 +6475,7 @@ var TreeNode = (_h = class {
|
|
|
6491
6475
|
this.parent = parent;
|
|
6492
6476
|
}
|
|
6493
6477
|
addChild(data) {
|
|
6494
|
-
const child = new
|
|
6478
|
+
const child = new _g(data, this);
|
|
6495
6479
|
if (!this.children) this.children = [];
|
|
6496
6480
|
this.children.push(child);
|
|
6497
6481
|
return child;
|
|
@@ -6535,7 +6519,7 @@ var TreeNode = (_h = class {
|
|
|
6535
6519
|
try {
|
|
6536
6520
|
const filteredTree = buildDirectoryTree(files, root);
|
|
6537
6521
|
if (!filteredTree) return null;
|
|
6538
|
-
const treeNode = new
|
|
6522
|
+
const treeNode = new _g({
|
|
6539
6523
|
name: filteredTree.name,
|
|
6540
6524
|
path: filteredTree.path,
|
|
6541
6525
|
file: filteredTree.file,
|
|
@@ -6561,7 +6545,7 @@ var TreeNode = (_h = class {
|
|
|
6561
6545
|
throw new Error("Something went wrong with creating barrel files with the TreeNode class", { cause: error });
|
|
6562
6546
|
}
|
|
6563
6547
|
}
|
|
6564
|
-
}, _cachedLeaves = new WeakMap(),
|
|
6548
|
+
}, _cachedLeaves = new WeakMap(), _g);
|
|
6565
6549
|
const normalizePath = (p) => p.replaceAll("\\", "/");
|
|
6566
6550
|
function buildDirectoryTree(files, rootFolder = "") {
|
|
6567
6551
|
const normalizedRootFolder = normalizePath(rootFolder);
|
|
@@ -6601,50 +6585,48 @@ function buildDirectoryTree(files, rootFolder = "") {
|
|
|
6601
6585
|
});
|
|
6602
6586
|
return root;
|
|
6603
6587
|
}
|
|
6604
|
-
|
|
6605
|
-
|
|
6606
|
-
|
|
6607
|
-
|
|
6608
|
-
|
|
6609
|
-
|
|
6610
|
-
|
|
6611
|
-
|
|
6612
|
-
|
|
6613
|
-
|
|
6614
|
-
|
|
6615
|
-
|
|
6616
|
-
|
|
6617
|
-
|
|
6618
|
-
|
|
6619
|
-
|
|
6620
|
-
|
|
6621
|
-
|
|
6622
|
-
|
|
6623
|
-
|
|
6624
|
-
|
|
6625
|
-
|
|
6626
|
-
|
|
6627
|
-
|
|
6628
|
-
|
|
6629
|
-
|
|
6630
|
-
|
|
6631
|
-
|
|
6632
|
-
|
|
6633
|
-
|
|
6634
|
-
|
|
6635
|
-
|
|
6636
|
-
isIndexable: false
|
|
6637
|
-
});
|
|
6588
|
+
function getBarrelFilesByRoot(root, files) {
|
|
6589
|
+
var _a2;
|
|
6590
|
+
const cachedFiles = /* @__PURE__ */ new Map();
|
|
6591
|
+
(_a2 = TreeNode.build(files, root)) == null ? void 0 : _a2.forEach((treeNode) => {
|
|
6592
|
+
var _a3, _b2, _c2;
|
|
6593
|
+
if (!treeNode || !treeNode.children || !((_a3 = treeNode.parent) == null ? void 0 : _a3.data.path)) return;
|
|
6594
|
+
const barrelFile = {
|
|
6595
|
+
path: join((_b2 = treeNode.parent) == null ? void 0 : _b2.data.path, "index.ts"),
|
|
6596
|
+
baseName: "index.ts",
|
|
6597
|
+
exports: [],
|
|
6598
|
+
imports: [],
|
|
6599
|
+
sources: []
|
|
6600
|
+
};
|
|
6601
|
+
const previousBarrelFile = cachedFiles.get(barrelFile.path);
|
|
6602
|
+
treeNode.leaves.forEach((item) => {
|
|
6603
|
+
var _a4;
|
|
6604
|
+
if (!item.data.name) return;
|
|
6605
|
+
(((_a4 = item.data.file) == null ? void 0 : _a4.sources) || []).forEach((source) => {
|
|
6606
|
+
var _a5, _b3;
|
|
6607
|
+
if (!((_a5 = item.data.file) == null ? void 0 : _a5.path) || !source.isIndexable || !source.name) return;
|
|
6608
|
+
if (previousBarrelFile == null ? void 0 : previousBarrelFile.sources.some((item2) => item2.name === source.name && item2.isTypeOnly === source.isTypeOnly)) return;
|
|
6609
|
+
barrelFile.exports.push({
|
|
6610
|
+
name: [source.name],
|
|
6611
|
+
path: getRelativePath((_b3 = treeNode.parent) == null ? void 0 : _b3.data.path, item.data.path),
|
|
6612
|
+
isTypeOnly: source.isTypeOnly
|
|
6613
|
+
});
|
|
6614
|
+
barrelFile.sources.push({
|
|
6615
|
+
name: source.name,
|
|
6616
|
+
isTypeOnly: source.isTypeOnly,
|
|
6617
|
+
value: "",
|
|
6618
|
+
isExportable: false,
|
|
6619
|
+
isIndexable: false
|
|
6638
6620
|
});
|
|
6639
6621
|
});
|
|
6640
|
-
if (previousBarrelFile) {
|
|
6641
|
-
previousBarrelFile.sources.push(...barrelFile.sources);
|
|
6642
|
-
(_c2 = previousBarrelFile.exports) == null ? void 0 : _c2.push(...barrelFile.exports || []);
|
|
6643
|
-
} else cachedFiles.set(barrelFile.path, barrelFile);
|
|
6644
6622
|
});
|
|
6645
|
-
|
|
6646
|
-
|
|
6647
|
-
|
|
6623
|
+
if (previousBarrelFile) {
|
|
6624
|
+
previousBarrelFile.sources.push(...barrelFile.sources);
|
|
6625
|
+
(_c2 = previousBarrelFile.exports) == null ? void 0 : _c2.push(...barrelFile.exports || []);
|
|
6626
|
+
} else cachedFiles.set(barrelFile.path, barrelFile);
|
|
6627
|
+
});
|
|
6628
|
+
return [...cachedFiles.values()];
|
|
6629
|
+
}
|
|
6648
6630
|
function trimExtName$1(text) {
|
|
6649
6631
|
const dotIndex = text.lastIndexOf(".");
|
|
6650
6632
|
if (dotIndex > 0 && !text.includes("/", dotIndex)) return text.slice(0, dotIndex);
|
|
@@ -6652,14 +6634,9 @@ function trimExtName$1(text) {
|
|
|
6652
6634
|
}
|
|
6653
6635
|
async function getBarrelFiles(files, { type, meta = {}, root, output }) {
|
|
6654
6636
|
if (!type || type === "propagate") return [];
|
|
6655
|
-
const barrelManager = new BarrelManager();
|
|
6656
6637
|
const pathToBuildFrom = join(root, output.path);
|
|
6657
6638
|
if (trimExtName$1(pathToBuildFrom).endsWith("index")) return [];
|
|
6658
|
-
const barrelFiles =
|
|
6659
|
-
files,
|
|
6660
|
-
root: pathToBuildFrom,
|
|
6661
|
-
meta
|
|
6662
|
-
});
|
|
6639
|
+
const barrelFiles = getBarrelFilesByRoot(pathToBuildFrom, files);
|
|
6663
6640
|
if (type === "all") return barrelFiles.map((file) => {
|
|
6664
6641
|
var _a2;
|
|
6665
6642
|
return {
|
|
@@ -6766,7 +6743,7 @@ function resolveOptions(node, { options, exclude = [], include, override = [] })
|
|
|
6766
6743
|
return options;
|
|
6767
6744
|
}
|
|
6768
6745
|
|
|
6769
|
-
var version = "5.0.0-alpha.
|
|
6746
|
+
var version = "5.0.0-alpha.7";
|
|
6770
6747
|
|
|
6771
6748
|
function isCommandMessage(msg) {
|
|
6772
6749
|
return msg.type === "command";
|
|
@@ -6820,7 +6797,7 @@ async function executeHooks({ hooks, events }) {
|
|
|
6820
6797
|
async function generate({ config, events }) {
|
|
6821
6798
|
await events.emit("generation:start", config);
|
|
6822
6799
|
await events.emit("info", config.name ? `Setup generation ${config.name}` : "Setup generation");
|
|
6823
|
-
const { sources, fabric,
|
|
6800
|
+
const { sources, fabric, driver } = await setup({
|
|
6824
6801
|
config,
|
|
6825
6802
|
events
|
|
6826
6803
|
});
|
|
@@ -6830,7 +6807,7 @@ async function generate({ config, events }) {
|
|
|
6830
6807
|
config,
|
|
6831
6808
|
events
|
|
6832
6809
|
},
|
|
6833
|
-
{
|
|
6810
|
+
{ driver, fabric, events, sources }
|
|
6834
6811
|
);
|
|
6835
6812
|
await events.emit("info", "Load summary");
|
|
6836
6813
|
const hasFailures = failedPlugins.size > 0 || error;
|
|
@@ -7977,10 +7954,10 @@ async function buildOperations(operationsOrNodes, options) {
|
|
|
7977
7954
|
const fabricChild = createReactFabric();
|
|
7978
7955
|
if (isBuildOperationsV1Options(options)) {
|
|
7979
7956
|
const { generator, Component } = options;
|
|
7980
|
-
const {
|
|
7957
|
+
const { driver, oas, mode } = generator.context;
|
|
7981
7958
|
await fabricChild.render(/* @__PURE__ */ jsx(Fabric, {
|
|
7982
7959
|
meta: {
|
|
7983
|
-
|
|
7960
|
+
driver,
|
|
7984
7961
|
plugin,
|
|
7985
7962
|
mode,
|
|
7986
7963
|
oas
|
|
@@ -8017,10 +7994,10 @@ async function buildOperation(operationOrNode, options) {
|
|
|
8017
7994
|
const fabricChild = createReactFabric();
|
|
8018
7995
|
if (isBuildOperationV1Options(options)) {
|
|
8019
7996
|
const { generator, Component } = options;
|
|
8020
|
-
const {
|
|
7997
|
+
const { driver, oas, mode } = generator.context;
|
|
8021
7998
|
await fabricChild.render(/* @__PURE__ */ jsx(Fabric, {
|
|
8022
7999
|
meta: {
|
|
8023
|
-
|
|
8000
|
+
driver,
|
|
8024
8001
|
plugin,
|
|
8025
8002
|
mode,
|
|
8026
8003
|
oas
|
|
@@ -8033,11 +8010,11 @@ async function buildOperation(operationOrNode, options) {
|
|
|
8033
8010
|
})
|
|
8034
8011
|
}));
|
|
8035
8012
|
} else {
|
|
8036
|
-
const { Component, adapter,
|
|
8013
|
+
const { Component, adapter, driver, mode } = options;
|
|
8037
8014
|
await fabricChild.render(/* @__PURE__ */ jsx(Fabric, {
|
|
8038
8015
|
meta: {
|
|
8039
8016
|
plugin,
|
|
8040
|
-
|
|
8017
|
+
driver,
|
|
8041
8018
|
mode
|
|
8042
8019
|
},
|
|
8043
8020
|
children: /* @__PURE__ */ jsx(Component, {
|
|
@@ -8061,10 +8038,10 @@ async function buildSchema(schema, options) {
|
|
|
8061
8038
|
const fabricChild = createReactFabric();
|
|
8062
8039
|
if (isBuildSchemaV1Options(options)) {
|
|
8063
8040
|
const { generator, Component } = options;
|
|
8064
|
-
const {
|
|
8041
|
+
const { driver, oas, mode } = generator.context;
|
|
8065
8042
|
await fabricChild.render(/* @__PURE__ */ jsx(Fabric, {
|
|
8066
8043
|
meta: {
|
|
8067
|
-
|
|
8044
|
+
driver,
|
|
8068
8045
|
plugin,
|
|
8069
8046
|
mode,
|
|
8070
8047
|
oas
|
|
@@ -8077,11 +8054,11 @@ async function buildSchema(schema, options) {
|
|
|
8077
8054
|
})
|
|
8078
8055
|
}));
|
|
8079
8056
|
} else {
|
|
8080
|
-
const { Component, adapter,
|
|
8057
|
+
const { Component, adapter, driver, mode } = options;
|
|
8081
8058
|
await fabricChild.render(/* @__PURE__ */ jsx(Fabric, {
|
|
8082
8059
|
meta: {
|
|
8083
8060
|
plugin,
|
|
8084
|
-
|
|
8061
|
+
driver,
|
|
8085
8062
|
mode
|
|
8086
8063
|
},
|
|
8087
8064
|
children: /* @__PURE__ */ jsx(Component, {
|
|
@@ -8401,17 +8378,17 @@ getRefAlias_fn = function(schemaObject, name) {
|
|
|
8401
8378
|
__privateMethod$a(this, _SchemaGenerator_instances, ensureNameMapping_fn).call(this);
|
|
8402
8379
|
const originalName = $ref.replace(/.+\//, "");
|
|
8403
8380
|
const resolvedName = __privateGet$a(this, _schemaNameMapping).get($ref) || originalName;
|
|
8404
|
-
const propertyName = this.context.
|
|
8381
|
+
const propertyName = this.context.driver.resolveName({
|
|
8405
8382
|
name: resolvedName,
|
|
8406
8383
|
pluginName: this.context.plugin.name,
|
|
8407
8384
|
type: "function"
|
|
8408
8385
|
});
|
|
8409
|
-
const fileName = this.context.
|
|
8386
|
+
const fileName = this.context.driver.resolveName({
|
|
8410
8387
|
name: resolvedName,
|
|
8411
8388
|
pluginName: this.context.plugin.name,
|
|
8412
8389
|
type: "file"
|
|
8413
8390
|
});
|
|
8414
|
-
const file = this.context.
|
|
8391
|
+
const file = this.context.driver.getFile({
|
|
8415
8392
|
name: fileName,
|
|
8416
8393
|
pluginName: this.context.plugin.name,
|
|
8417
8394
|
extname: ".ts"
|
|
@@ -8721,7 +8698,7 @@ parseSchemaObject_fn = function({ schema: _schemaObject, name, parentName, rootN
|
|
|
8721
8698
|
options.enumSuffix
|
|
8722
8699
|
];
|
|
8723
8700
|
const enumName = useCollisionDetection ? pascalCase$9(enumNameParts.join(" ")) : getUniqueName(pascalCase$9(enumNameParts.join(" ")), this.options.usedEnumNames || {});
|
|
8724
|
-
const typeName = this.context.
|
|
8701
|
+
const typeName = this.context.driver.resolveName({
|
|
8725
8702
|
name: enumName,
|
|
8726
8703
|
pluginName: this.context.plugin.name,
|
|
8727
8704
|
type: "type"
|
|
@@ -9035,7 +9012,7 @@ parseSchemaObject_fn = function({ schema: _schemaObject, name, parentName, rootN
|
|
|
9035
9012
|
value: schemaObject,
|
|
9036
9013
|
tree
|
|
9037
9014
|
}, {
|
|
9038
|
-
config: this.context.
|
|
9015
|
+
config: this.context.driver.config,
|
|
9039
9016
|
fabric: this.context.fabric,
|
|
9040
9017
|
Component: v1Generator.Schema,
|
|
9041
9018
|
generator: this,
|
|
@@ -9050,7 +9027,7 @@ parseSchemaObject_fn = function({ schema: _schemaObject, name, parentName, rootN
|
|
|
9050
9027
|
return [];
|
|
9051
9028
|
}
|
|
9052
9029
|
return (_b2 = await ((_a2 = v1Generator.schema) == null ? void 0 : _a2.call(v1Generator, {
|
|
9053
|
-
config: this.context.
|
|
9030
|
+
config: this.context.driver.config,
|
|
9054
9031
|
generator: this,
|
|
9055
9032
|
schema: {
|
|
9056
9033
|
name,
|
|
@@ -9935,9 +9912,9 @@ function createReactGenerator(generator) {
|
|
|
9935
9912
|
const jsonGenerator = createGenerator({
|
|
9936
9913
|
name: "plugin-oas",
|
|
9937
9914
|
async schema({ schema, generator }) {
|
|
9938
|
-
const {
|
|
9915
|
+
const { driver, plugin } = generator.context;
|
|
9939
9916
|
return [{
|
|
9940
|
-
...
|
|
9917
|
+
...driver.getFile({
|
|
9941
9918
|
name: camelCase$d(schema.name),
|
|
9942
9919
|
extname: ".json",
|
|
9943
9920
|
mode: "split",
|
|
@@ -9952,7 +9929,7 @@ const jsonGenerator = createGenerator({
|
|
|
9952
9929
|
banner: getBanner({
|
|
9953
9930
|
oas: generator.context.oas,
|
|
9954
9931
|
output: plugin.options.output,
|
|
9955
|
-
config:
|
|
9932
|
+
config: driver.config
|
|
9956
9933
|
}),
|
|
9957
9934
|
format: getFooter({
|
|
9958
9935
|
oas: generator.context.oas,
|
|
@@ -10131,7 +10108,7 @@ var OperationGenerator = (_a$7 = class {
|
|
|
10131
10108
|
const options = this.getOptions(operation, method);
|
|
10132
10109
|
if (v1Generator.type === "react") {
|
|
10133
10110
|
await buildOperation(operation, {
|
|
10134
|
-
config: this.context.
|
|
10111
|
+
config: this.context.driver.config,
|
|
10135
10112
|
fabric: this.context.fabric,
|
|
10136
10113
|
Component: v1Generator.Operation,
|
|
10137
10114
|
generator: this,
|
|
@@ -10147,7 +10124,7 @@ var OperationGenerator = (_a$7 = class {
|
|
|
10147
10124
|
}
|
|
10148
10125
|
return (_b = await ((_a4 = v1Generator.operation) == null ? void 0 : _a4.call(v1Generator, {
|
|
10149
10126
|
generator: this,
|
|
10150
|
-
config: this.context.
|
|
10127
|
+
config: this.context.driver.config,
|
|
10151
10128
|
operation,
|
|
10152
10129
|
plugin: {
|
|
10153
10130
|
...this.context.plugin,
|
|
@@ -10162,7 +10139,7 @@ var OperationGenerator = (_a$7 = class {
|
|
|
10162
10139
|
if (v1Generator.type === "react") {
|
|
10163
10140
|
await buildOperations(operations.map((op) => op.operation), {
|
|
10164
10141
|
fabric: this.context.fabric,
|
|
10165
|
-
config: this.context.
|
|
10142
|
+
config: this.context.driver.config,
|
|
10166
10143
|
Component: v1Generator.Operations,
|
|
10167
10144
|
generator: this,
|
|
10168
10145
|
plugin: this.context.plugin
|
|
@@ -10171,7 +10148,7 @@ var OperationGenerator = (_a$7 = class {
|
|
|
10171
10148
|
}
|
|
10172
10149
|
const operationsResult = await ((_a3 = v1Generator.operations) == null ? void 0 : _a3.call(v1Generator, {
|
|
10173
10150
|
generator: this,
|
|
10174
|
-
config: this.context.
|
|
10151
|
+
config: this.context.driver.config,
|
|
10175
10152
|
operations: operations.map((op) => op.operation),
|
|
10176
10153
|
plugin: this.context.plugin
|
|
10177
10154
|
}));
|
|
@@ -10287,7 +10264,7 @@ const pluginOas = definePlugin((options) => {
|
|
|
10287
10264
|
}, {
|
|
10288
10265
|
fabric: this.fabric,
|
|
10289
10266
|
oas,
|
|
10290
|
-
|
|
10267
|
+
driver: this.driver,
|
|
10291
10268
|
events: this.events,
|
|
10292
10269
|
plugin: this.plugin,
|
|
10293
10270
|
contentType,
|
|
@@ -10300,7 +10277,7 @@ const pluginOas = definePlugin((options) => {
|
|
|
10300
10277
|
const operationFiles = await new OperationGenerator(this.plugin.options, {
|
|
10301
10278
|
fabric: this.fabric,
|
|
10302
10279
|
oas,
|
|
10303
|
-
|
|
10280
|
+
driver: this.driver,
|
|
10304
10281
|
events: this.events,
|
|
10305
10282
|
plugin: this.plugin,
|
|
10306
10283
|
contentType,
|
|
@@ -209607,26 +209584,68 @@ function Type$1({ name, typedName, tree, keysToOmit, schema, optionalType, array
|
|
|
209607
209584
|
})] });
|
|
209608
209585
|
}
|
|
209609
209586
|
|
|
209587
|
+
function buildDefaultBanner({ title, description, version, config }) {
|
|
209588
|
+
try {
|
|
209589
|
+
let source = "";
|
|
209590
|
+
if (Array.isArray(config.input)) {
|
|
209591
|
+
const first = config.input[0];
|
|
209592
|
+
if (first && "path" in first) source = path$2.basename(first.path);
|
|
209593
|
+
} else if ("path" in config.input) source = path$2.basename(config.input.path);
|
|
209594
|
+
else if ("data" in config.input) source = "text content";
|
|
209595
|
+
let banner = "/**\n* Generated by Kubb (https://kubb.dev/).\n* Do not edit manually.\n";
|
|
209596
|
+
if (config.output.defaultBanner === "simple") {
|
|
209597
|
+
banner += "*/\n";
|
|
209598
|
+
return banner;
|
|
209599
|
+
}
|
|
209600
|
+
if (source) banner += `* Source: ${source}
|
|
209601
|
+
`;
|
|
209602
|
+
if (title) banner += `* Title: ${title}
|
|
209603
|
+
`;
|
|
209604
|
+
if (description) {
|
|
209605
|
+
const formattedDescription = description.replace(/\n/gm, "\n* ");
|
|
209606
|
+
banner += `* Description: ${formattedDescription}
|
|
209607
|
+
`;
|
|
209608
|
+
}
|
|
209609
|
+
if (version) banner += `* OpenAPI spec version: ${version}
|
|
209610
|
+
`;
|
|
209611
|
+
banner += "*/\n";
|
|
209612
|
+
return banner;
|
|
209613
|
+
} catch (_error) {
|
|
209614
|
+
return "/**\n* Generated by Kubb (https://kubb.dev/).\n* Do not edit manually.\n*/";
|
|
209615
|
+
}
|
|
209616
|
+
}
|
|
209610
209617
|
function useKubb() {
|
|
209618
|
+
var _a;
|
|
209611
209619
|
const { meta } = useFabric();
|
|
209620
|
+
const config = meta.driver.config;
|
|
209612
209621
|
const defaultPluginName = meta.plugin.name;
|
|
209622
|
+
const output = (_a = meta.plugin.options) == null ? void 0 : _a.output;
|
|
209613
209623
|
return {
|
|
209614
209624
|
plugin: meta.plugin,
|
|
209615
209625
|
mode: meta.mode,
|
|
209616
|
-
config
|
|
209617
|
-
getPluginByName: (pluginName = defaultPluginName) => meta.
|
|
209618
|
-
getFile: ({ pluginName = defaultPluginName, ...rest }) => meta.
|
|
209626
|
+
config,
|
|
209627
|
+
getPluginByName: (pluginName = defaultPluginName) => meta.driver.getPluginByName.call(meta.driver, pluginName),
|
|
209628
|
+
getFile: ({ pluginName = defaultPluginName, ...rest }) => meta.driver.getFile.call(meta.driver, {
|
|
209619
209629
|
pluginName,
|
|
209620
209630
|
...rest
|
|
209621
209631
|
}),
|
|
209622
|
-
resolveName: ({ pluginName = defaultPluginName, ...rest }) => meta.
|
|
209632
|
+
resolveName: ({ pluginName = defaultPluginName, ...rest }) => meta.driver.resolveName.call(meta.driver, {
|
|
209623
209633
|
pluginName,
|
|
209624
209634
|
...rest
|
|
209625
209635
|
}),
|
|
209626
|
-
resolvePath: ({ pluginName = defaultPluginName, ...rest }) => meta.
|
|
209636
|
+
resolvePath: ({ pluginName = defaultPluginName, ...rest }) => meta.driver.resolvePath.call(meta.driver, {
|
|
209627
209637
|
pluginName,
|
|
209628
209638
|
...rest
|
|
209629
|
-
})
|
|
209639
|
+
}),
|
|
209640
|
+
resolveBanner: (node) => {
|
|
209641
|
+
if (typeof (output == null ? void 0 : output.banner) === "function") return output.banner(node);
|
|
209642
|
+
if (typeof (output == null ? void 0 : output.banner) === "string") return output.banner;
|
|
209643
|
+
return buildDefaultBanner({ config });
|
|
209644
|
+
},
|
|
209645
|
+
resolveFooter: (node) => {
|
|
209646
|
+
if (typeof (output == null ? void 0 : output.footer) === "function") return output.footer(node);
|
|
209647
|
+
if (typeof (output == null ? void 0 : output.footer) === "string") return output.footer;
|
|
209648
|
+
}
|
|
209630
209649
|
};
|
|
209631
209650
|
}
|
|
209632
209651
|
function useMode() {
|
|
@@ -209637,9 +209656,9 @@ function usePlugin() {
|
|
|
209637
209656
|
const { meta } = useFabric();
|
|
209638
209657
|
return meta.plugin;
|
|
209639
209658
|
}
|
|
209640
|
-
function
|
|
209659
|
+
function usePluginDriver() {
|
|
209641
209660
|
const { meta } = useFabric();
|
|
209642
|
-
return meta.
|
|
209661
|
+
return meta.driver;
|
|
209643
209662
|
}
|
|
209644
209663
|
|
|
209645
209664
|
function useOas() {
|
|
@@ -209648,9 +209667,9 @@ function useOas() {
|
|
|
209648
209667
|
}
|
|
209649
209668
|
function useOperationManager(generator) {
|
|
209650
209669
|
const plugin = usePlugin();
|
|
209651
|
-
const
|
|
209670
|
+
const driver = usePluginDriver();
|
|
209652
209671
|
const getName = (operation, { prefix = "", suffix = "", pluginName = plugin.name, type }) => {
|
|
209653
|
-
return
|
|
209672
|
+
return driver.resolveName({
|
|
209654
209673
|
name: `${prefix} ${operation.getOperationId()} ${suffix}`,
|
|
209655
209674
|
pluginName,
|
|
209656
209675
|
type
|
|
@@ -209665,7 +209684,7 @@ function useOperationManager(generator) {
|
|
|
209665
209684
|
};
|
|
209666
209685
|
const getSchemas = (operation, params) => {
|
|
209667
209686
|
if (!generator) throw new Error(`useOperationManager: 'generator' parameter is required but was not provided`);
|
|
209668
|
-
return generator.getSchemas(operation, { resolveName: (name) =>
|
|
209687
|
+
return generator.getSchemas(operation, { resolveName: (name) => driver.resolveName({
|
|
209669
209688
|
name,
|
|
209670
209689
|
pluginName: params == null ? void 0 : params.pluginName,
|
|
209671
209690
|
type: params == null ? void 0 : params.type
|
|
@@ -209679,7 +209698,7 @@ function useOperationManager(generator) {
|
|
|
209679
209698
|
suffix
|
|
209680
209699
|
});
|
|
209681
209700
|
const group = getGroup(operation);
|
|
209682
|
-
const file =
|
|
209701
|
+
const file = driver.getFile({
|
|
209683
209702
|
name,
|
|
209684
209703
|
extname,
|
|
209685
209704
|
pluginName,
|
|
@@ -209705,7 +209724,7 @@ function useOperationManager(generator) {
|
|
|
209705
209724
|
const schemas = generator.getSchemas(operation);
|
|
209706
209725
|
const errors = (schemas.errors || []).reduce((prev, acc) => {
|
|
209707
209726
|
if (!acc.statusCode) return prev;
|
|
209708
|
-
prev[acc.statusCode] =
|
|
209727
|
+
prev[acc.statusCode] = driver.resolveName({
|
|
209709
209728
|
name: acc.name,
|
|
209710
209729
|
pluginName,
|
|
209711
209730
|
type
|
|
@@ -209714,7 +209733,7 @@ function useOperationManager(generator) {
|
|
|
209714
209733
|
}, {});
|
|
209715
209734
|
const responses = (schemas.responses || []).reduce((prev, acc) => {
|
|
209716
209735
|
if (!acc.statusCode) return prev;
|
|
209717
|
-
prev[acc.statusCode] =
|
|
209736
|
+
prev[acc.statusCode] = driver.resolveName({
|
|
209718
209737
|
name: acc.name,
|
|
209719
209738
|
pluginName,
|
|
209720
209739
|
type
|
|
@@ -209722,23 +209741,23 @@ function useOperationManager(generator) {
|
|
|
209722
209741
|
return prev;
|
|
209723
209742
|
}, {});
|
|
209724
209743
|
return {
|
|
209725
|
-
request: ((_a = schemas.request) == null ? void 0 : _a.name) ?
|
|
209744
|
+
request: ((_a = schemas.request) == null ? void 0 : _a.name) ? driver.resolveName({
|
|
209726
209745
|
name: schemas.request.name,
|
|
209727
209746
|
pluginName,
|
|
209728
209747
|
type
|
|
209729
209748
|
}) : void 0,
|
|
209730
209749
|
parameters: {
|
|
209731
|
-
path: ((_b = schemas.pathParams) == null ? void 0 : _b.name) ?
|
|
209750
|
+
path: ((_b = schemas.pathParams) == null ? void 0 : _b.name) ? driver.resolveName({
|
|
209732
209751
|
name: schemas.pathParams.name,
|
|
209733
209752
|
pluginName,
|
|
209734
209753
|
type
|
|
209735
209754
|
}) : void 0,
|
|
209736
|
-
query: ((_c = schemas.queryParams) == null ? void 0 : _c.name) ?
|
|
209755
|
+
query: ((_c = schemas.queryParams) == null ? void 0 : _c.name) ? driver.resolveName({
|
|
209737
209756
|
name: schemas.queryParams.name,
|
|
209738
209757
|
pluginName,
|
|
209739
209758
|
type
|
|
209740
209759
|
}) : void 0,
|
|
209741
|
-
header: ((_d = schemas.headerParams) == null ? void 0 : _d.name) ?
|
|
209760
|
+
header: ((_d = schemas.headerParams) == null ? void 0 : _d.name) ? driver.resolveName({
|
|
209742
209761
|
name: schemas.headerParams.name,
|
|
209743
209762
|
pluginName,
|
|
209744
209763
|
type
|
|
@@ -209746,7 +209765,7 @@ function useOperationManager(generator) {
|
|
|
209746
209765
|
},
|
|
209747
209766
|
responses: {
|
|
209748
209767
|
...responses,
|
|
209749
|
-
["default"]:
|
|
209768
|
+
["default"]: driver.resolveName({
|
|
209750
209769
|
name: schemas.response.name,
|
|
209751
209770
|
pluginName,
|
|
209752
209771
|
type
|
|
@@ -209766,9 +209785,9 @@ function useOperationManager(generator) {
|
|
|
209766
209785
|
}
|
|
209767
209786
|
function useSchemaManager() {
|
|
209768
209787
|
const plugin = usePlugin();
|
|
209769
|
-
const
|
|
209788
|
+
const driver = usePluginDriver();
|
|
209770
209789
|
const getName = (name, { pluginName = plugin.name, type }) => {
|
|
209771
|
-
return
|
|
209790
|
+
return driver.resolveName({
|
|
209772
209791
|
name,
|
|
209773
209792
|
pluginName,
|
|
209774
209793
|
type
|
|
@@ -209779,7 +209798,7 @@ function useSchemaManager() {
|
|
|
209779
209798
|
type: "file",
|
|
209780
209799
|
pluginName
|
|
209781
209800
|
});
|
|
209782
|
-
const file =
|
|
209801
|
+
const file = driver.getFile({
|
|
209783
209802
|
name: resolvedName,
|
|
209784
209803
|
extname,
|
|
209785
209804
|
pluginName,
|
|
@@ -209808,37 +209827,37 @@ function stringify$1(value) {
|
|
|
209808
209827
|
if (value === void 0 || value === null) return '""';
|
|
209809
209828
|
return JSON.stringify(trimQuotes$1(value.toString()));
|
|
209810
209829
|
}
|
|
209811
|
-
function printCombinedSchema({ name, schemas,
|
|
209830
|
+
function printCombinedSchema({ name, schemas, driver }) {
|
|
209812
209831
|
const properties = {};
|
|
209813
209832
|
if (schemas.response) properties["response"] = createUnionDeclaration({ nodes: schemas.responses.map((res) => {
|
|
209814
|
-
return createTypeReferenceNode(createIdentifier(
|
|
209833
|
+
return createTypeReferenceNode(createIdentifier(driver.resolveName({
|
|
209815
209834
|
name: res.name,
|
|
209816
209835
|
pluginName: pluginTsName,
|
|
209817
209836
|
type: "function"
|
|
209818
209837
|
})), void 0);
|
|
209819
209838
|
}) });
|
|
209820
|
-
if (schemas.request) properties["request"] = createTypeReferenceNode(createIdentifier(
|
|
209839
|
+
if (schemas.request) properties["request"] = createTypeReferenceNode(createIdentifier(driver.resolveName({
|
|
209821
209840
|
name: schemas.request.name,
|
|
209822
209841
|
pluginName: pluginTsName,
|
|
209823
209842
|
type: "function"
|
|
209824
209843
|
})), void 0);
|
|
209825
|
-
if (schemas.pathParams) properties["pathParams"] = createTypeReferenceNode(createIdentifier(
|
|
209844
|
+
if (schemas.pathParams) properties["pathParams"] = createTypeReferenceNode(createIdentifier(driver.resolveName({
|
|
209826
209845
|
name: schemas.pathParams.name,
|
|
209827
209846
|
pluginName: pluginTsName,
|
|
209828
209847
|
type: "function"
|
|
209829
209848
|
})), void 0);
|
|
209830
|
-
if (schemas.queryParams) properties["queryParams"] = createTypeReferenceNode(createIdentifier(
|
|
209849
|
+
if (schemas.queryParams) properties["queryParams"] = createTypeReferenceNode(createIdentifier(driver.resolveName({
|
|
209831
209850
|
name: schemas.queryParams.name,
|
|
209832
209851
|
pluginName: pluginTsName,
|
|
209833
209852
|
type: "function"
|
|
209834
209853
|
})), void 0);
|
|
209835
|
-
if (schemas.headerParams) properties["headerParams"] = createTypeReferenceNode(createIdentifier(
|
|
209854
|
+
if (schemas.headerParams) properties["headerParams"] = createTypeReferenceNode(createIdentifier(driver.resolveName({
|
|
209836
209855
|
name: schemas.headerParams.name,
|
|
209837
209856
|
pluginName: pluginTsName,
|
|
209838
209857
|
type: "function"
|
|
209839
209858
|
})), void 0);
|
|
209840
209859
|
if (schemas.errors) properties["errors"] = createUnionDeclaration({ nodes: schemas.errors.map((error) => {
|
|
209841
|
-
return createTypeReferenceNode(createIdentifier(
|
|
209860
|
+
return createTypeReferenceNode(createIdentifier(driver.resolveName({
|
|
209842
209861
|
name: error.name,
|
|
209843
209862
|
pluginName: pluginTsName,
|
|
209844
209863
|
type: "function"
|
|
@@ -209857,8 +209876,8 @@ function printCombinedSchema({ name, schemas, pluginManager }) {
|
|
|
209857
209876
|
modifiers: [modifiers.export]
|
|
209858
209877
|
}));
|
|
209859
209878
|
}
|
|
209860
|
-
function printRequestSchema({ baseName, operation, schemas,
|
|
209861
|
-
const name =
|
|
209879
|
+
function printRequestSchema({ baseName, operation, schemas, driver }) {
|
|
209880
|
+
const name = driver.resolveName({
|
|
209862
209881
|
name: `${baseName} Request`,
|
|
209863
209882
|
pluginName: pluginTsName,
|
|
209864
209883
|
type: "type"
|
|
@@ -209866,7 +209885,7 @@ function printRequestSchema({ baseName, operation, schemas, pluginManager }) {
|
|
|
209866
209885
|
const results = [];
|
|
209867
209886
|
const dataRequestProperties = [];
|
|
209868
209887
|
if (schemas.request) {
|
|
209869
|
-
const identifier =
|
|
209888
|
+
const identifier = driver.resolveName({
|
|
209870
209889
|
name: schemas.request.name,
|
|
209871
209890
|
pluginName: pluginTsName,
|
|
209872
209891
|
type: "type"
|
|
@@ -209882,7 +209901,7 @@ function printRequestSchema({ baseName, operation, schemas, pluginManager }) {
|
|
|
209882
209901
|
type: keywordTypeNodes.never
|
|
209883
209902
|
}));
|
|
209884
209903
|
if (schemas.pathParams) {
|
|
209885
|
-
const identifier =
|
|
209904
|
+
const identifier = driver.resolveName({
|
|
209886
209905
|
name: schemas.pathParams.name,
|
|
209887
209906
|
pluginName: pluginTsName,
|
|
209888
209907
|
type: "type"
|
|
@@ -209897,7 +209916,7 @@ function printRequestSchema({ baseName, operation, schemas, pluginManager }) {
|
|
|
209897
209916
|
type: keywordTypeNodes.never
|
|
209898
209917
|
}));
|
|
209899
209918
|
if (schemas.queryParams) {
|
|
209900
|
-
const identifier =
|
|
209919
|
+
const identifier = driver.resolveName({
|
|
209901
209920
|
name: schemas.queryParams.name,
|
|
209902
209921
|
pluginName: pluginTsName,
|
|
209903
209922
|
type: "type"
|
|
@@ -209913,7 +209932,7 @@ function printRequestSchema({ baseName, operation, schemas, pluginManager }) {
|
|
|
209913
209932
|
type: keywordTypeNodes.never
|
|
209914
209933
|
}));
|
|
209915
209934
|
if (schemas.headerParams) {
|
|
209916
|
-
const identifier =
|
|
209935
|
+
const identifier = driver.resolveName({
|
|
209917
209936
|
name: schemas.headerParams.name,
|
|
209918
209937
|
pluginName: pluginTsName,
|
|
209919
209938
|
type: "type"
|
|
@@ -209940,9 +209959,9 @@ function printRequestSchema({ baseName, operation, schemas, pluginManager }) {
|
|
|
209940
209959
|
results.push(safePrint(dataRequestNode));
|
|
209941
209960
|
return results.join("\n\n");
|
|
209942
209961
|
}
|
|
209943
|
-
function printResponseSchema({ baseName, schemas,
|
|
209962
|
+
function printResponseSchema({ baseName, schemas, driver, unknownType }) {
|
|
209944
209963
|
const results = [];
|
|
209945
|
-
const name =
|
|
209964
|
+
const name = driver.resolveName({
|
|
209946
209965
|
name: `${baseName} ResponseData`,
|
|
209947
209966
|
pluginName: pluginTsName,
|
|
209948
209967
|
type: "type"
|
|
@@ -209950,7 +209969,7 @@ function printResponseSchema({ baseName, schemas, pluginManager, unknownType })
|
|
|
209950
209969
|
if (schemas.responses && schemas.responses.length > 0) {
|
|
209951
209970
|
const responsesProperties = schemas.responses.map((res) => {
|
|
209952
209971
|
var _a, _b;
|
|
209953
|
-
const identifier =
|
|
209972
|
+
const identifier = driver.resolveName({
|
|
209954
209973
|
name: res.name,
|
|
209955
209974
|
pluginName: pluginTsName,
|
|
209956
209975
|
type: "type"
|
|
@@ -209987,7 +210006,7 @@ const typeGenerator$1 = createReactGenerator({
|
|
|
209987
210006
|
Operation({ operation, generator, plugin }) {
|
|
209988
210007
|
const { options, options: { enumType, enumKeyCasing, syntaxType, optionalType, arrayType, unknownType, paramsCasing } } = plugin;
|
|
209989
210008
|
const mode = useMode();
|
|
209990
|
-
const
|
|
210009
|
+
const driver = usePluginDriver();
|
|
209991
210010
|
const oas = useOas();
|
|
209992
210011
|
const { getSchemas, getFile, getName, getGroup } = useOperationManager(generator);
|
|
209993
210012
|
const schemaManager = useSchemaManager();
|
|
@@ -210002,7 +210021,7 @@ const typeGenerator$1 = createReactGenerator({
|
|
|
210002
210021
|
oas,
|
|
210003
210022
|
events: generator.context.events,
|
|
210004
210023
|
plugin,
|
|
210005
|
-
|
|
210024
|
+
driver,
|
|
210006
210025
|
mode,
|
|
210007
210026
|
override: options.override
|
|
210008
210027
|
});
|
|
@@ -210061,7 +210080,7 @@ const typeGenerator$1 = createReactGenerator({
|
|
|
210061
210080
|
banner: getBanner({
|
|
210062
210081
|
oas,
|
|
210063
210082
|
output: plugin.options.output,
|
|
210064
|
-
config:
|
|
210083
|
+
config: driver.config
|
|
210065
210084
|
}),
|
|
210066
210085
|
footer: getFooter({
|
|
210067
210086
|
oas,
|
|
@@ -210076,7 +210095,7 @@ const typeGenerator$1 = createReactGenerator({
|
|
|
210076
210095
|
baseName: name,
|
|
210077
210096
|
operation,
|
|
210078
210097
|
schemas,
|
|
210079
|
-
|
|
210098
|
+
driver
|
|
210080
210099
|
})
|
|
210081
210100
|
}), /* @__PURE__ */ jsx(File.Source, {
|
|
210082
210101
|
name: responseName,
|
|
@@ -210086,7 +210105,7 @@ const typeGenerator$1 = createReactGenerator({
|
|
|
210086
210105
|
children: printResponseSchema({
|
|
210087
210106
|
baseName: name,
|
|
210088
210107
|
schemas,
|
|
210089
|
-
|
|
210108
|
+
driver,
|
|
210090
210109
|
unknownType
|
|
210091
210110
|
})
|
|
210092
210111
|
})] }) : /* @__PURE__ */ jsx(File.Source, {
|
|
@@ -210097,7 +210116,7 @@ const typeGenerator$1 = createReactGenerator({
|
|
|
210097
210116
|
children: printCombinedSchema({
|
|
210098
210117
|
name: combinedSchemaName,
|
|
210099
210118
|
schemas,
|
|
210100
|
-
|
|
210119
|
+
driver
|
|
210101
210120
|
})
|
|
210102
210121
|
})]
|
|
210103
210122
|
});
|
|
@@ -210106,7 +210125,7 @@ const typeGenerator$1 = createReactGenerator({
|
|
|
210106
210125
|
const { options: { enumType, enumKeyCasing, syntaxType, optionalType, arrayType, output } } = plugin;
|
|
210107
210126
|
const mode = useMode();
|
|
210108
210127
|
const oas = useOas();
|
|
210109
|
-
const
|
|
210128
|
+
const driver = usePluginDriver();
|
|
210110
210129
|
const { getName, getFile } = useSchemaManager();
|
|
210111
210130
|
const imports = getImports(schema.tree);
|
|
210112
210131
|
const schemaFromTree = schema.tree.find((item) => item.keyword === schemaKeywords.schema);
|
|
@@ -210124,7 +210143,7 @@ const typeGenerator$1 = createReactGenerator({
|
|
|
210124
210143
|
banner: getBanner({
|
|
210125
210144
|
oas,
|
|
210126
210145
|
output,
|
|
210127
|
-
config:
|
|
210146
|
+
config: driver.config
|
|
210128
210147
|
}),
|
|
210129
210148
|
footer: getFooter({
|
|
210130
210149
|
oas,
|
|
@@ -210797,7 +210816,7 @@ const pluginTs = definePlugin((options) => {
|
|
|
210797
210816
|
},
|
|
210798
210817
|
async install() {
|
|
210799
210818
|
var _a, _b;
|
|
210800
|
-
const { config, fabric, plugin, adapter, rootNode,
|
|
210819
|
+
const { config, fabric, plugin, adapter, rootNode, driver, openInStudio } = this;
|
|
210801
210820
|
const root = path$2.resolve(config.root, config.output.path);
|
|
210802
210821
|
const mode = getMode(path$2.resolve(root, output.path));
|
|
210803
210822
|
if (adapter) {
|
|
@@ -210820,7 +210839,7 @@ const pluginTs = definePlugin((options) => {
|
|
|
210820
210839
|
fabric,
|
|
210821
210840
|
Component: generator.Schema,
|
|
210822
210841
|
plugin,
|
|
210823
|
-
|
|
210842
|
+
driver,
|
|
210824
210843
|
mode,
|
|
210825
210844
|
version: generator.version
|
|
210826
210845
|
});
|
|
@@ -210845,7 +210864,7 @@ const pluginTs = definePlugin((options) => {
|
|
|
210845
210864
|
fabric,
|
|
210846
210865
|
Component: generator.Operation,
|
|
210847
210866
|
plugin,
|
|
210848
|
-
|
|
210867
|
+
driver,
|
|
210849
210868
|
mode,
|
|
210850
210869
|
version: generator.version
|
|
210851
210870
|
});
|
|
@@ -210867,7 +210886,7 @@ const pluginTs = definePlugin((options) => {
|
|
|
210867
210886
|
const schemaFiles = await new SchemaGenerator(this.plugin.options, {
|
|
210868
210887
|
fabric: this.fabric,
|
|
210869
210888
|
oas,
|
|
210870
|
-
|
|
210889
|
+
driver: this.driver,
|
|
210871
210890
|
events: this.events,
|
|
210872
210891
|
plugin: this.plugin,
|
|
210873
210892
|
contentType,
|
|
@@ -210880,7 +210899,7 @@ const pluginTs = definePlugin((options) => {
|
|
|
210880
210899
|
const operationFiles = await new OperationGenerator(this.plugin.options, {
|
|
210881
210900
|
fabric: this.fabric,
|
|
210882
210901
|
oas,
|
|
210883
|
-
|
|
210902
|
+
driver: this.driver,
|
|
210884
210903
|
events: this.events,
|
|
210885
210904
|
plugin: this.plugin,
|
|
210886
210905
|
contentType,
|
|
@@ -210906,11 +210925,11 @@ const operationsGenerator$1 = createReactGenerator({
|
|
|
210906
210925
|
name: "operations",
|
|
210907
210926
|
Operations({ operations, generator, plugin }) {
|
|
210908
210927
|
const { name: pluginName, options: { output, importPath } } = plugin;
|
|
210909
|
-
const
|
|
210928
|
+
const driver = usePluginDriver();
|
|
210910
210929
|
const oas = useOas();
|
|
210911
210930
|
const { getFile, groupSchemasByName } = useOperationManager(generator);
|
|
210912
210931
|
const name = "operations";
|
|
210913
|
-
const file =
|
|
210932
|
+
const file = driver.getFile({
|
|
210914
210933
|
name,
|
|
210915
210934
|
extname: ".ts",
|
|
210916
210935
|
pluginName
|
|
@@ -210939,7 +210958,7 @@ const operationsGenerator$1 = createReactGenerator({
|
|
|
210939
210958
|
banner: getBanner({
|
|
210940
210959
|
oas,
|
|
210941
210960
|
output,
|
|
210942
|
-
config:
|
|
210961
|
+
config: driver.config
|
|
210943
210962
|
}),
|
|
210944
210963
|
footer: getFooter({
|
|
210945
210964
|
oas,
|
|
@@ -210966,7 +210985,7 @@ const zodGenerator = createReactGenerator({
|
|
|
210966
210985
|
Operation({ config, operation, generator, plugin }) {
|
|
210967
210986
|
const { options, options: { coercion: globalCoercion, inferred, typed, mapper, wrapOutput, version, guidType, mini } } = plugin;
|
|
210968
210987
|
const mode = useMode();
|
|
210969
|
-
const
|
|
210988
|
+
const driver = usePluginDriver();
|
|
210970
210989
|
const oas = useOas();
|
|
210971
210990
|
const { getSchemas, getFile, getGroup } = useOperationManager(generator);
|
|
210972
210991
|
const schemaManager = useSchemaManager();
|
|
@@ -210976,7 +210995,7 @@ const zodGenerator = createReactGenerator({
|
|
|
210976
210995
|
fabric: generator.context.fabric,
|
|
210977
210996
|
oas,
|
|
210978
210997
|
plugin,
|
|
210979
|
-
|
|
210998
|
+
driver,
|
|
210980
210999
|
events: generator.context.events,
|
|
210981
211000
|
mode,
|
|
210982
211001
|
override: options.override
|
|
@@ -211074,7 +211093,7 @@ const zodGenerator = createReactGenerator({
|
|
|
211074
211093
|
banner: getBanner({
|
|
211075
211094
|
oas,
|
|
211076
211095
|
output: plugin.options.output,
|
|
211077
|
-
config:
|
|
211096
|
+
config: driver.config
|
|
211078
211097
|
}),
|
|
211079
211098
|
footer: getFooter({
|
|
211080
211099
|
oas,
|
|
@@ -211099,7 +211118,7 @@ const zodGenerator = createReactGenerator({
|
|
|
211099
211118
|
Schema({ config, schema, plugin }) {
|
|
211100
211119
|
const { getName, getFile } = useSchemaManager();
|
|
211101
211120
|
const { options: { output, emptySchemaType, coercion, inferred, typed, mapper, importPath, wrapOutput, version, guidType, mini } } = plugin;
|
|
211102
|
-
const
|
|
211121
|
+
const driver = usePluginDriver();
|
|
211103
211122
|
const oas = useOas();
|
|
211104
211123
|
const imports = getImports(schema.tree);
|
|
211105
211124
|
const zod = {
|
|
@@ -211123,7 +211142,7 @@ const zodGenerator = createReactGenerator({
|
|
|
211123
211142
|
banner: getBanner({
|
|
211124
211143
|
oas,
|
|
211125
211144
|
output,
|
|
211126
|
-
config:
|
|
211145
|
+
config: driver.config
|
|
211127
211146
|
}),
|
|
211128
211147
|
footer: getFooter({
|
|
211129
211148
|
oas,
|
|
@@ -211277,7 +211296,7 @@ const pluginZod = definePlugin((options) => {
|
|
|
211277
211296
|
const schemaFiles = await new SchemaGenerator(this.plugin.options, {
|
|
211278
211297
|
fabric: this.fabric,
|
|
211279
211298
|
oas,
|
|
211280
|
-
|
|
211299
|
+
driver: this.driver,
|
|
211281
211300
|
events: this.events,
|
|
211282
211301
|
plugin: this.plugin,
|
|
211283
211302
|
contentType,
|
|
@@ -211290,7 +211309,7 @@ const pluginZod = definePlugin((options) => {
|
|
|
211290
211309
|
const operationFiles = await new OperationGenerator(this.plugin.options, {
|
|
211291
211310
|
fabric: this.fabric,
|
|
211292
211311
|
oas,
|
|
211293
|
-
|
|
211312
|
+
driver: this.driver,
|
|
211294
211313
|
events: this.events,
|
|
211295
211314
|
plugin: this.plugin,
|
|
211296
211315
|
contentType,
|
|
@@ -211330,7 +211349,7 @@ const classClientGenerator = createReactGenerator({
|
|
|
211330
211349
|
name: "classClient",
|
|
211331
211350
|
Operations({ operations, generator, plugin, config }) {
|
|
211332
211351
|
const { options, name: pluginName } = plugin;
|
|
211333
|
-
const
|
|
211352
|
+
const driver = usePluginDriver();
|
|
211334
211353
|
const oas = useOas();
|
|
211335
211354
|
const { getName, getFile, getGroup, getSchemas } = useOperationManager(generator);
|
|
211336
211355
|
function buildOperationData(operation) {
|
|
@@ -211363,7 +211382,7 @@ const classClientGenerator = createReactGenerator({
|
|
|
211363
211382
|
const groupName = (group == null ? void 0 : group.tag) ? (_c = (_b = (_a = options.group) == null ? void 0 : _a.name) == null ? void 0 : _b.call(_a, { group: camelCase$b(group.tag) })) != null ? _c : pascalCase$7(group.tag) : "Client";
|
|
211364
211383
|
if (!(group == null ? void 0 : group.tag) && !options.group) {
|
|
211365
211384
|
const name = "ApiClient";
|
|
211366
|
-
const file =
|
|
211385
|
+
const file = driver.getFile({
|
|
211367
211386
|
name,
|
|
211368
211387
|
extname: ".ts",
|
|
211369
211388
|
pluginName
|
|
@@ -211378,7 +211397,7 @@ const classClientGenerator = createReactGenerator({
|
|
|
211378
211397
|
});
|
|
211379
211398
|
} else if (group == null ? void 0 : group.tag) {
|
|
211380
211399
|
const name = groupName;
|
|
211381
|
-
const file =
|
|
211400
|
+
const file = driver.getFile({
|
|
211382
211401
|
name,
|
|
211383
211402
|
extname: ".ts",
|
|
211384
211403
|
pluginName,
|
|
@@ -211449,7 +211468,7 @@ const classClientGenerator = createReactGenerator({
|
|
|
211449
211468
|
banner: getBanner({
|
|
211450
211469
|
oas,
|
|
211451
211470
|
output: options.output,
|
|
211452
|
-
config:
|
|
211471
|
+
config: driver.config
|
|
211453
211472
|
}),
|
|
211454
211473
|
footer: getFooter({
|
|
211455
211474
|
oas,
|
|
@@ -211538,7 +211557,7 @@ const classClientGenerator = createReactGenerator({
|
|
|
211538
211557
|
}, file.path);
|
|
211539
211558
|
});
|
|
211540
211559
|
if (options.wrapper) {
|
|
211541
|
-
const wrapperFile =
|
|
211560
|
+
const wrapperFile = driver.getFile({
|
|
211542
211561
|
name: options.wrapper.className,
|
|
211543
211562
|
extname: ".ts",
|
|
211544
211563
|
pluginName
|
|
@@ -211550,7 +211569,7 @@ const classClientGenerator = createReactGenerator({
|
|
|
211550
211569
|
banner: getBanner({
|
|
211551
211570
|
oas,
|
|
211552
211571
|
output: options.output,
|
|
211553
|
-
config:
|
|
211572
|
+
config: driver.config
|
|
211554
211573
|
}),
|
|
211555
211574
|
footer: getFooter({
|
|
211556
211575
|
oas,
|
|
@@ -211586,7 +211605,7 @@ const clientGenerator = createReactGenerator({
|
|
|
211586
211605
|
name: "client",
|
|
211587
211606
|
Operation({ config, plugin, operation, generator }) {
|
|
211588
211607
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
211589
|
-
const
|
|
211608
|
+
const driver = usePluginDriver();
|
|
211590
211609
|
const { options, options: { output, urlType } } = plugin;
|
|
211591
211610
|
const oas = useOas();
|
|
211592
211611
|
const { getSchemas, getName, getFile } = useOperationManager(generator);
|
|
@@ -211624,7 +211643,7 @@ const clientGenerator = createReactGenerator({
|
|
|
211624
211643
|
banner: getBanner({
|
|
211625
211644
|
oas,
|
|
211626
211645
|
output,
|
|
211627
|
-
config:
|
|
211646
|
+
config: driver.config
|
|
211628
211647
|
}),
|
|
211629
211648
|
footer: getFooter({
|
|
211630
211649
|
oas,
|
|
@@ -211711,7 +211730,7 @@ const groupedClientGenerator = createReactGenerator({
|
|
|
211711
211730
|
name: "groupedClient",
|
|
211712
211731
|
Operations({ operations, generator, plugin }) {
|
|
211713
211732
|
const { options, name: pluginName } = plugin;
|
|
211714
|
-
const
|
|
211733
|
+
const driver = usePluginDriver();
|
|
211715
211734
|
const oas = useOas();
|
|
211716
211735
|
const { getName, getFile, getGroup } = useOperationManager(generator);
|
|
211717
211736
|
return operations.reduce((acc, operation) => {
|
|
@@ -211720,7 +211739,7 @@ const groupedClientGenerator = createReactGenerator({
|
|
|
211720
211739
|
const group = getGroup(operation);
|
|
211721
211740
|
const name = (group == null ? void 0 : group.tag) ? (_c = (_b = options.group) == null ? void 0 : _b.name) == null ? void 0 : _c.call(_b, { group: camelCase$b(group.tag) }) : void 0;
|
|
211722
211741
|
if (!(group == null ? void 0 : group.tag) || !name) return acc;
|
|
211723
|
-
const file =
|
|
211742
|
+
const file = driver.getFile({
|
|
211724
211743
|
name,
|
|
211725
211744
|
extname: ".ts",
|
|
211726
211745
|
pluginName,
|
|
@@ -211747,7 +211766,7 @@ const groupedClientGenerator = createReactGenerator({
|
|
|
211747
211766
|
banner: getBanner({
|
|
211748
211767
|
oas,
|
|
211749
211768
|
output: options.output,
|
|
211750
|
-
config:
|
|
211769
|
+
config: driver.config
|
|
211751
211770
|
}),
|
|
211752
211771
|
footer: getFooter({
|
|
211753
211772
|
oas,
|
|
@@ -211775,10 +211794,10 @@ const operationsGenerator = createReactGenerator({
|
|
|
211775
211794
|
name: "client",
|
|
211776
211795
|
Operations({ operations, plugin }) {
|
|
211777
211796
|
const { name: pluginName, options: { output } } = plugin;
|
|
211778
|
-
const
|
|
211797
|
+
const driver = usePluginDriver();
|
|
211779
211798
|
const oas = useOas();
|
|
211780
211799
|
const name = "operations";
|
|
211781
|
-
const file =
|
|
211800
|
+
const file = driver.getFile({
|
|
211782
211801
|
name,
|
|
211783
211802
|
extname: ".ts",
|
|
211784
211803
|
pluginName
|
|
@@ -211790,7 +211809,7 @@ const operationsGenerator = createReactGenerator({
|
|
|
211790
211809
|
banner: getBanner({
|
|
211791
211810
|
oas,
|
|
211792
211811
|
output,
|
|
211793
|
-
config:
|
|
211812
|
+
config: driver.config
|
|
211794
211813
|
}),
|
|
211795
211814
|
footer: getFooter({
|
|
211796
211815
|
oas,
|
|
@@ -211807,7 +211826,7 @@ const staticClassClientGenerator = createReactGenerator({
|
|
|
211807
211826
|
name: "staticClassClient",
|
|
211808
211827
|
Operations({ operations, generator, plugin, config }) {
|
|
211809
211828
|
const { options, name: pluginName } = plugin;
|
|
211810
|
-
const
|
|
211829
|
+
const driver = usePluginDriver();
|
|
211811
211830
|
const oas = useOas();
|
|
211812
211831
|
const { getName, getFile, getGroup, getSchemas } = useOperationManager(generator);
|
|
211813
211832
|
function buildOperationData(operation) {
|
|
@@ -211840,7 +211859,7 @@ const staticClassClientGenerator = createReactGenerator({
|
|
|
211840
211859
|
const groupName = (group == null ? void 0 : group.tag) ? (_c = (_b = (_a = options.group) == null ? void 0 : _a.name) == null ? void 0 : _b.call(_a, { group: camelCase$b(group.tag) })) != null ? _c : pascalCase$7(group.tag) : "Client";
|
|
211841
211860
|
if (!(group == null ? void 0 : group.tag) && !options.group) {
|
|
211842
211861
|
const name = "ApiClient";
|
|
211843
|
-
const file =
|
|
211862
|
+
const file = driver.getFile({
|
|
211844
211863
|
name,
|
|
211845
211864
|
extname: ".ts",
|
|
211846
211865
|
pluginName
|
|
@@ -211855,7 +211874,7 @@ const staticClassClientGenerator = createReactGenerator({
|
|
|
211855
211874
|
});
|
|
211856
211875
|
} else if (group == null ? void 0 : group.tag) {
|
|
211857
211876
|
const name = groupName;
|
|
211858
|
-
const file =
|
|
211877
|
+
const file = driver.getFile({
|
|
211859
211878
|
name,
|
|
211860
211879
|
extname: ".ts",
|
|
211861
211880
|
pluginName,
|
|
@@ -211926,7 +211945,7 @@ const staticClassClientGenerator = createReactGenerator({
|
|
|
211926
211945
|
banner: getBanner({
|
|
211927
211946
|
oas,
|
|
211928
211947
|
output: options.output,
|
|
211929
|
-
config:
|
|
211948
|
+
config: driver.config
|
|
211930
211949
|
}),
|
|
211931
211950
|
footer: getFooter({
|
|
211932
211951
|
oas,
|
|
@@ -212112,7 +212131,7 @@ const pluginClient = definePlugin((options) => {
|
|
|
212112
212131
|
} : this.plugin.options, {
|
|
212113
212132
|
fabric: this.fabric,
|
|
212114
212133
|
oas,
|
|
212115
|
-
|
|
212134
|
+
driver: this.driver,
|
|
212116
212135
|
events: this.events,
|
|
212117
212136
|
plugin: this.plugin,
|
|
212118
212137
|
contentType,
|
|
@@ -212362,7 +212381,7 @@ const cypressGenerator = createReactGenerator({
|
|
|
212362
212381
|
Operation({ operation, generator, plugin }) {
|
|
212363
212382
|
var _a, _b, _c, _d, _e;
|
|
212364
212383
|
const { options: { output, baseURL, dataReturnType, paramsCasing, paramsType, pathParamsType } } = plugin;
|
|
212365
|
-
const
|
|
212384
|
+
const driver = usePluginDriver();
|
|
212366
212385
|
const oas = useOas();
|
|
212367
212386
|
const { getSchemas, getName, getFile } = useOperationManager(generator);
|
|
212368
212387
|
const request = {
|
|
@@ -212383,7 +212402,7 @@ const cypressGenerator = createReactGenerator({
|
|
|
212383
212402
|
banner: getBanner({
|
|
212384
212403
|
oas,
|
|
212385
212404
|
output,
|
|
212386
|
-
config:
|
|
212405
|
+
config: driver.config
|
|
212387
212406
|
}),
|
|
212388
212407
|
footer: getFooter({
|
|
212389
212408
|
oas,
|
|
@@ -212462,7 +212481,7 @@ const pluginCypress = definePlugin((options) => {
|
|
|
212462
212481
|
const files = await new OperationGenerator(this.plugin.options, {
|
|
212463
212482
|
fabric: this.fabric,
|
|
212464
212483
|
oas,
|
|
212465
|
-
|
|
212484
|
+
driver: this.driver,
|
|
212466
212485
|
events: this.events,
|
|
212467
212486
|
plugin: this.plugin,
|
|
212468
212487
|
contentType,
|
|
@@ -212873,7 +212892,7 @@ const fakerGenerator = createReactGenerator({
|
|
|
212873
212892
|
Operation({ operation, generator, plugin }) {
|
|
212874
212893
|
const { options, options: { dateParser, regexGenerator, seed, mapper } } = plugin;
|
|
212875
212894
|
const mode = useMode();
|
|
212876
|
-
const
|
|
212895
|
+
const driver = usePluginDriver();
|
|
212877
212896
|
const oas = useOas();
|
|
212878
212897
|
const { getSchemas, getFile, getGroup } = useOperationManager(generator);
|
|
212879
212898
|
const schemaManager = useSchemaManager();
|
|
@@ -212884,7 +212903,7 @@ const fakerGenerator = createReactGenerator({
|
|
|
212884
212903
|
oas,
|
|
212885
212904
|
plugin,
|
|
212886
212905
|
events: generator.context.events,
|
|
212887
|
-
|
|
212906
|
+
driver,
|
|
212888
212907
|
mode,
|
|
212889
212908
|
override: options.override
|
|
212890
212909
|
});
|
|
@@ -212956,7 +212975,7 @@ const fakerGenerator = createReactGenerator({
|
|
|
212956
212975
|
banner: getBanner({
|
|
212957
212976
|
oas,
|
|
212958
212977
|
output: plugin.options.output,
|
|
212959
|
-
config:
|
|
212978
|
+
config: driver.config
|
|
212960
212979
|
}),
|
|
212961
212980
|
footer: getFooter({
|
|
212962
212981
|
oas,
|
|
@@ -212982,7 +213001,7 @@ const fakerGenerator = createReactGenerator({
|
|
|
212982
213001
|
Schema({ schema, plugin }) {
|
|
212983
213002
|
const { getName, getFile } = useSchemaManager();
|
|
212984
213003
|
const { options: { output, dateParser, regexGenerator, seed, mapper } } = plugin;
|
|
212985
|
-
const
|
|
213004
|
+
const driver = usePluginDriver();
|
|
212986
213005
|
const oas = useOas();
|
|
212987
213006
|
const imports = getImports(schema.tree);
|
|
212988
213007
|
const faker = {
|
|
@@ -213004,7 +213023,7 @@ const fakerGenerator = createReactGenerator({
|
|
|
213004
213023
|
banner: getBanner({
|
|
213005
213024
|
oas,
|
|
213006
213025
|
output,
|
|
213007
|
-
config:
|
|
213026
|
+
config: driver.config
|
|
213008
213027
|
}),
|
|
213009
213028
|
footer: getFooter({
|
|
213010
213029
|
oas,
|
|
@@ -213128,7 +213147,7 @@ const pluginFaker = definePlugin((options) => {
|
|
|
213128
213147
|
const schemaFiles = await new SchemaGenerator(this.plugin.options, {
|
|
213129
213148
|
fabric: this.fabric,
|
|
213130
213149
|
oas,
|
|
213131
|
-
|
|
213150
|
+
driver: this.driver,
|
|
213132
213151
|
events: this.events,
|
|
213133
213152
|
plugin: this.plugin,
|
|
213134
213153
|
contentType,
|
|
@@ -213141,7 +213160,7 @@ const pluginFaker = definePlugin((options) => {
|
|
|
213141
213160
|
const operationFiles = await new OperationGenerator(this.plugin.options, {
|
|
213142
213161
|
fabric: this.fabric,
|
|
213143
213162
|
oas,
|
|
213144
|
-
|
|
213163
|
+
driver: this.driver,
|
|
213145
213164
|
events: this.events,
|
|
213146
213165
|
plugin: this.plugin,
|
|
213147
213166
|
contentType,
|
|
@@ -213441,17 +213460,17 @@ const serverGenerator = createReactGenerator({
|
|
|
213441
213460
|
name: "operations",
|
|
213442
213461
|
Operations({ operations, generator, plugin }) {
|
|
213443
213462
|
var _a, _b;
|
|
213444
|
-
const
|
|
213463
|
+
const driver = usePluginDriver();
|
|
213445
213464
|
const { options } = plugin;
|
|
213446
213465
|
const oas = useOas();
|
|
213447
213466
|
const { getFile, getName, getSchemas } = useOperationManager(generator);
|
|
213448
213467
|
const name = "server";
|
|
213449
|
-
const file =
|
|
213468
|
+
const file = driver.getFile({
|
|
213450
213469
|
name,
|
|
213451
213470
|
extname: ".ts",
|
|
213452
213471
|
pluginName: plugin.name
|
|
213453
213472
|
});
|
|
213454
|
-
const jsonFile =
|
|
213473
|
+
const jsonFile = driver.getFile({
|
|
213455
213474
|
name: ".mcp",
|
|
213456
213475
|
extname: ".json",
|
|
213457
213476
|
pluginName: plugin.name
|
|
@@ -213512,7 +213531,7 @@ const serverGenerator = createReactGenerator({
|
|
|
213512
213531
|
banner: getBanner({
|
|
213513
213532
|
oas,
|
|
213514
213533
|
output: options.output,
|
|
213515
|
-
config:
|
|
213534
|
+
config: driver.config
|
|
213516
213535
|
}),
|
|
213517
213536
|
footer: getFooter({
|
|
213518
213537
|
oas,
|
|
@@ -213619,7 +213638,7 @@ const pluginMcp = definePlugin((options) => {
|
|
|
213619
213638
|
const oas = await this.getOas();
|
|
213620
213639
|
const baseURL = await this.getBaseURL();
|
|
213621
213640
|
if (baseURL) this.plugin.options.client.baseURL = baseURL;
|
|
213622
|
-
const hasClientPlugin = !!this.
|
|
213641
|
+
const hasClientPlugin = !!this.driver.getPluginByName(pluginClientName);
|
|
213623
213642
|
if (this.plugin.options.client.bundle && !hasClientPlugin && !this.plugin.options.client.importPath) await this.addFile({
|
|
213624
213643
|
baseName: "fetch.ts",
|
|
213625
213644
|
path: path$2.resolve(root, ".kubb/fetch.ts"),
|
|
@@ -213647,7 +213666,7 @@ const pluginMcp = definePlugin((options) => {
|
|
|
213647
213666
|
const files = await new OperationGenerator(this.plugin.options, {
|
|
213648
213667
|
fabric: this.fabric,
|
|
213649
213668
|
oas,
|
|
213650
|
-
|
|
213669
|
+
driver: this.driver,
|
|
213651
213670
|
events: this.events,
|
|
213652
213671
|
plugin: this.plugin,
|
|
213653
213672
|
contentType,
|
|
@@ -213912,10 +213931,10 @@ function Response$1({ name, typeName, operation, statusCode }) {
|
|
|
213912
213931
|
const handlersGenerator = createReactGenerator({
|
|
213913
213932
|
name: "plugin-msw",
|
|
213914
213933
|
Operations({ operations, generator, plugin }) {
|
|
213915
|
-
const
|
|
213934
|
+
const driver = usePluginDriver();
|
|
213916
213935
|
const oas = useOas();
|
|
213917
213936
|
const { getName, getFile } = useOperationManager(generator);
|
|
213918
|
-
const file =
|
|
213937
|
+
const file = driver.getFile({
|
|
213919
213938
|
name: "handlers",
|
|
213920
213939
|
extname: ".ts",
|
|
213921
213940
|
pluginName: plugin.name
|
|
@@ -213943,7 +213962,7 @@ const handlersGenerator = createReactGenerator({
|
|
|
213943
213962
|
banner: getBanner({
|
|
213944
213963
|
oas,
|
|
213945
213964
|
output: plugin.options.output,
|
|
213946
|
-
config:
|
|
213965
|
+
config: driver.config
|
|
213947
213966
|
}),
|
|
213948
213967
|
footer: getFooter({
|
|
213949
213968
|
oas,
|
|
@@ -213961,7 +213980,7 @@ const mswGenerator = createReactGenerator({
|
|
|
213961
213980
|
Operation({ operation, generator, plugin }) {
|
|
213962
213981
|
var _a;
|
|
213963
213982
|
const { options: { output, parser, baseURL } } = plugin;
|
|
213964
|
-
const
|
|
213983
|
+
const driver = usePluginDriver();
|
|
213965
213984
|
const oas = useOas();
|
|
213966
213985
|
const { getSchemas, getName, getFile } = useOperationManager(generator);
|
|
213967
213986
|
const mock = {
|
|
@@ -214003,7 +214022,7 @@ const mswGenerator = createReactGenerator({
|
|
|
214003
214022
|
banner: getBanner({
|
|
214004
214023
|
oas,
|
|
214005
214024
|
output,
|
|
214006
|
-
config:
|
|
214025
|
+
config: driver.config
|
|
214007
214026
|
}),
|
|
214008
214027
|
footer: getFooter({
|
|
214009
214028
|
oas,
|
|
@@ -214105,7 +214124,7 @@ const pluginMsw = definePlugin((options) => {
|
|
|
214105
214124
|
const files = await new OperationGenerator(this.plugin.options, {
|
|
214106
214125
|
fabric: this.fabric,
|
|
214107
214126
|
oas,
|
|
214108
|
-
|
|
214127
|
+
driver: this.driver,
|
|
214109
214128
|
events: this.events,
|
|
214110
214129
|
plugin: this.plugin,
|
|
214111
214130
|
contentType,
|
|
@@ -215598,7 +215617,7 @@ const customHookOptionsFileGenerator = createReactGenerator({
|
|
|
215598
215617
|
Operations({ operations, generator, plugin, config }) {
|
|
215599
215618
|
var _a, _b;
|
|
215600
215619
|
const { options, options: { output }, name: pluginName } = plugin;
|
|
215601
|
-
const
|
|
215620
|
+
const driver = usePluginDriver();
|
|
215602
215621
|
const { getFile } = useOperationManager(generator);
|
|
215603
215622
|
if (!options.customOptions) return null;
|
|
215604
215623
|
const override = (_b = (_a = output.override) != null ? _a : config.output.override) != null ? _b : false;
|
|
@@ -215608,7 +215627,7 @@ const customHookOptionsFileGenerator = createReactGenerator({
|
|
|
215608
215627
|
const getHookFilePath = (operations2) => {
|
|
215609
215628
|
const firstOperation = operations2[0];
|
|
215610
215629
|
if (firstOperation != null) return getFile(firstOperation, { prefix: "use" }).path;
|
|
215611
|
-
return
|
|
215630
|
+
return driver.getFile({
|
|
215612
215631
|
name: "index",
|
|
215613
215632
|
extname: ".ts",
|
|
215614
215633
|
pluginName
|
|
@@ -215682,12 +215701,12 @@ const hookOptionsGenerator = createReactGenerator({
|
|
|
215682
215701
|
name: "react-query-hook-options",
|
|
215683
215702
|
Operations({ operations, plugin, generator }) {
|
|
215684
215703
|
const { options, options: { output }, name: pluginName } = plugin;
|
|
215685
|
-
const
|
|
215704
|
+
const driver = usePluginDriver();
|
|
215686
215705
|
const oas = useOas();
|
|
215687
215706
|
const { getName, getFile } = useOperationManager(generator);
|
|
215688
215707
|
if (!options.customOptions) return null;
|
|
215689
215708
|
const name = "HookOptions";
|
|
215690
|
-
const file =
|
|
215709
|
+
const file = driver.getFile({
|
|
215691
215710
|
name,
|
|
215692
215711
|
extname: ".ts",
|
|
215693
215712
|
pluginName
|
|
@@ -215855,7 +215874,7 @@ const hookOptionsGenerator = createReactGenerator({
|
|
|
215855
215874
|
banner: getBanner({
|
|
215856
215875
|
oas,
|
|
215857
215876
|
output,
|
|
215858
|
-
config:
|
|
215877
|
+
config: driver.config
|
|
215859
215878
|
}),
|
|
215860
215879
|
footer: getFooter({
|
|
215861
215880
|
oas,
|
|
@@ -215880,7 +215899,7 @@ const infiniteQueryGenerator$1 = createReactGenerator({
|
|
|
215880
215899
|
Operation({ config, operation, generator, plugin }) {
|
|
215881
215900
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n;
|
|
215882
215901
|
const { options, options: { output } } = plugin;
|
|
215883
|
-
const
|
|
215902
|
+
const driver = usePluginDriver();
|
|
215884
215903
|
const oas = useOas();
|
|
215885
215904
|
const { getSchemas, getName, getFile } = useOperationManager(generator);
|
|
215886
215905
|
const isQuery = typeof options.query === "boolean" ? true : (_a = options.query) == null ? void 0 : _a.methods.some((method) => operation.method === method);
|
|
@@ -215899,7 +215918,7 @@ const infiniteQueryGenerator$1 = createReactGenerator({
|
|
|
215899
215918
|
suffix: "infinite"
|
|
215900
215919
|
})
|
|
215901
215920
|
};
|
|
215902
|
-
const shouldUseClientPlugin = !!
|
|
215921
|
+
const shouldUseClientPlugin = !!driver.getPluginByName(pluginClientName) && options.client.clientType !== "class";
|
|
215903
215922
|
const client = {
|
|
215904
215923
|
name: shouldUseClientPlugin ? getName(operation, {
|
|
215905
215924
|
type: "function",
|
|
@@ -215957,7 +215976,7 @@ const infiniteQueryGenerator$1 = createReactGenerator({
|
|
|
215957
215976
|
banner: getBanner({
|
|
215958
215977
|
oas,
|
|
215959
215978
|
output,
|
|
215960
|
-
config:
|
|
215979
|
+
config: driver.config
|
|
215961
215980
|
}),
|
|
215962
215981
|
footer: getFooter({
|
|
215963
215982
|
oas,
|
|
@@ -216125,7 +216144,7 @@ const mutationGenerator$4 = createReactGenerator({
|
|
|
216125
216144
|
Operation({ config, plugin, operation, generator }) {
|
|
216126
216145
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
216127
216146
|
const { options, options: { output } } = plugin;
|
|
216128
|
-
const
|
|
216147
|
+
const driver = usePluginDriver();
|
|
216129
216148
|
const oas = useOas();
|
|
216130
216149
|
const { getSchemas, getName, getFile } = useOperationManager(generator);
|
|
216131
216150
|
const isQuery = !!options.query && ((_a = options.query) == null ? void 0 : _a.methods.some((method) => operation.method === method));
|
|
@@ -216153,7 +216172,7 @@ const mutationGenerator$4 = createReactGenerator({
|
|
|
216153
216172
|
type: "function"
|
|
216154
216173
|
})
|
|
216155
216174
|
};
|
|
216156
|
-
const shouldUseClientPlugin = !!
|
|
216175
|
+
const shouldUseClientPlugin = !!driver.getPluginByName(pluginClientName) && options.client.clientType !== "class";
|
|
216157
216176
|
const client = {
|
|
216158
216177
|
name: shouldUseClientPlugin ? getName(operation, {
|
|
216159
216178
|
type: "function",
|
|
@@ -216183,7 +216202,7 @@ const mutationGenerator$4 = createReactGenerator({
|
|
|
216183
216202
|
banner: getBanner({
|
|
216184
216203
|
oas,
|
|
216185
216204
|
output,
|
|
216186
|
-
config:
|
|
216205
|
+
config: driver.config
|
|
216187
216206
|
}),
|
|
216188
216207
|
footer: getFooter({
|
|
216189
216208
|
oas,
|
|
@@ -216335,7 +216354,7 @@ const queryGenerator$4 = createReactGenerator({
|
|
|
216335
216354
|
Operation({ config, plugin, operation, generator }) {
|
|
216336
216355
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
216337
216356
|
const { options, options: { output } } = plugin;
|
|
216338
|
-
const
|
|
216357
|
+
const driver = usePluginDriver();
|
|
216339
216358
|
const oas = useOas();
|
|
216340
216359
|
const { getSchemas, getName, getFile } = useOperationManager(generator);
|
|
216341
216360
|
const isQuery = typeof options.query === "boolean" ? true : (_a = options.query) == null ? void 0 : _a.methods.some((method) => operation.method === method);
|
|
@@ -216349,7 +216368,7 @@ const queryGenerator$4 = createReactGenerator({
|
|
|
216349
216368
|
typeName: getName(operation, { type: "type" }),
|
|
216350
216369
|
file: getFile(operation, { prefix: "use" })
|
|
216351
216370
|
};
|
|
216352
|
-
const shouldUseClientPlugin = !!
|
|
216371
|
+
const shouldUseClientPlugin = !!driver.getPluginByName(pluginClientName) && options.client.clientType !== "class";
|
|
216353
216372
|
const client = {
|
|
216354
216373
|
name: shouldUseClientPlugin ? getName(operation, {
|
|
216355
216374
|
type: "function",
|
|
@@ -216393,7 +216412,7 @@ const queryGenerator$4 = createReactGenerator({
|
|
|
216393
216412
|
banner: getBanner({
|
|
216394
216413
|
oas,
|
|
216395
216414
|
output,
|
|
216396
|
-
config:
|
|
216415
|
+
config: driver.config
|
|
216397
216416
|
}),
|
|
216398
216417
|
footer: getFooter({
|
|
216399
216418
|
oas,
|
|
@@ -216548,7 +216567,7 @@ const suspenseInfiniteQueryGenerator = createReactGenerator({
|
|
|
216548
216567
|
Operation({ config, operation, generator, plugin }) {
|
|
216549
216568
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
216550
216569
|
const { options, options: { output } } = plugin;
|
|
216551
|
-
const
|
|
216570
|
+
const driver = usePluginDriver();
|
|
216552
216571
|
const oas = useOas();
|
|
216553
216572
|
const { getSchemas, getName, getFile } = useOperationManager(generator);
|
|
216554
216573
|
const isQuery = typeof options.query === "boolean" ? true : (_a = options.query) == null ? void 0 : _a.methods.some((method) => operation.method === method);
|
|
@@ -216568,7 +216587,7 @@ const suspenseInfiniteQueryGenerator = createReactGenerator({
|
|
|
216568
216587
|
suffix: "suspenseInfinite"
|
|
216569
216588
|
})
|
|
216570
216589
|
};
|
|
216571
|
-
const shouldUseClientPlugin = !!
|
|
216590
|
+
const shouldUseClientPlugin = !!driver.getPluginByName(pluginClientName) && options.client.clientType !== "class";
|
|
216572
216591
|
const client = {
|
|
216573
216592
|
name: shouldUseClientPlugin ? getName(operation, {
|
|
216574
216593
|
type: "function",
|
|
@@ -216615,7 +216634,7 @@ const suspenseInfiniteQueryGenerator = createReactGenerator({
|
|
|
216615
216634
|
banner: getBanner({
|
|
216616
216635
|
oas,
|
|
216617
216636
|
output,
|
|
216618
|
-
config:
|
|
216637
|
+
config: driver.config
|
|
216619
216638
|
}),
|
|
216620
216639
|
footer: getFooter({
|
|
216621
216640
|
oas,
|
|
@@ -216783,7 +216802,7 @@ const suspenseQueryGenerator = createReactGenerator({
|
|
|
216783
216802
|
Operation({ config, operation, generator, plugin }) {
|
|
216784
216803
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
216785
216804
|
const { options, options: { output } } = plugin;
|
|
216786
|
-
const
|
|
216805
|
+
const driver = usePluginDriver();
|
|
216787
216806
|
const oas = useOas();
|
|
216788
216807
|
const { getSchemas, getName, getFile } = useOperationManager(generator);
|
|
216789
216808
|
const isQuery = typeof options.query === "boolean" ? true : (_a = options.query) == null ? void 0 : _a.methods.some((method) => operation.method === method);
|
|
@@ -216802,7 +216821,7 @@ const suspenseQueryGenerator = createReactGenerator({
|
|
|
216802
216821
|
suffix: "suspense"
|
|
216803
216822
|
})
|
|
216804
216823
|
};
|
|
216805
|
-
const shouldUseClientPlugin = !!
|
|
216824
|
+
const shouldUseClientPlugin = !!driver.getPluginByName(pluginClientName) && options.client.clientType !== "class";
|
|
216806
216825
|
const client = {
|
|
216807
216826
|
name: shouldUseClientPlugin ? getName(operation, {
|
|
216808
216827
|
type: "function",
|
|
@@ -216849,7 +216868,7 @@ const suspenseQueryGenerator = createReactGenerator({
|
|
|
216849
216868
|
banner: getBanner({
|
|
216850
216869
|
oas,
|
|
216851
216870
|
output,
|
|
216852
|
-
config:
|
|
216871
|
+
config: driver.config
|
|
216853
216872
|
}),
|
|
216854
216873
|
footer: getFooter({
|
|
216855
216874
|
oas,
|
|
@@ -217100,7 +217119,7 @@ const pluginReactQuery = definePlugin((options) => {
|
|
|
217100
217119
|
const oas = await this.getOas();
|
|
217101
217120
|
const baseURL = await this.getBaseURL();
|
|
217102
217121
|
if (baseURL) this.plugin.options.client.baseURL = baseURL;
|
|
217103
|
-
const hasClientPlugin = !!this.
|
|
217122
|
+
const hasClientPlugin = !!this.driver.getPluginByName(pluginClientName);
|
|
217104
217123
|
if (this.plugin.options.client.bundle && !hasClientPlugin && !this.plugin.options.client.importPath) await this.upsertFile({
|
|
217105
217124
|
baseName: "fetch.ts",
|
|
217106
217125
|
path: path$2.resolve(root, ".kubb/fetch.ts"),
|
|
@@ -217128,7 +217147,7 @@ const pluginReactQuery = definePlugin((options) => {
|
|
|
217128
217147
|
const files = await new OperationGenerator(this.plugin.options, {
|
|
217129
217148
|
fabric: this.fabric,
|
|
217130
217149
|
oas,
|
|
217131
|
-
|
|
217150
|
+
driver: this.driver,
|
|
217132
217151
|
events: this.events,
|
|
217133
217152
|
plugin: this.plugin,
|
|
217134
217153
|
contentType,
|
|
@@ -217830,7 +217849,7 @@ const mutationGenerator$3 = createReactGenerator({
|
|
|
217830
217849
|
Operation({ config, operation, generator, plugin }) {
|
|
217831
217850
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
217832
217851
|
const { options, options: { output } } = plugin;
|
|
217833
|
-
const
|
|
217852
|
+
const driver = usePluginDriver();
|
|
217834
217853
|
const oas = useOas();
|
|
217835
217854
|
const { getSchemas, getName, getFile } = useOperationManager(generator);
|
|
217836
217855
|
const isQuery = !!options.query && ((_a = options.query) == null ? void 0 : _a.methods.some((method) => operation.method === method));
|
|
@@ -217858,7 +217877,7 @@ const mutationGenerator$3 = createReactGenerator({
|
|
|
217858
217877
|
type: "function"
|
|
217859
217878
|
})
|
|
217860
217879
|
};
|
|
217861
|
-
const shouldUseClientPlugin = !!
|
|
217880
|
+
const shouldUseClientPlugin = !!driver.getPluginByName(pluginClientName) && options.client.clientType !== "class";
|
|
217862
217881
|
const client = {
|
|
217863
217882
|
name: shouldUseClientPlugin ? getName(operation, {
|
|
217864
217883
|
type: "function",
|
|
@@ -217884,7 +217903,7 @@ const mutationGenerator$3 = createReactGenerator({
|
|
|
217884
217903
|
banner: getBanner({
|
|
217885
217904
|
oas,
|
|
217886
217905
|
output,
|
|
217887
|
-
config:
|
|
217906
|
+
config: driver.config
|
|
217888
217907
|
}),
|
|
217889
217908
|
footer: getFooter({
|
|
217890
217909
|
oas,
|
|
@@ -218014,7 +218033,7 @@ const queryGenerator$3 = createReactGenerator({
|
|
|
218014
218033
|
Operation({ config, operation, generator, plugin }) {
|
|
218015
218034
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
218016
218035
|
const { options, options: { output } } = plugin;
|
|
218017
|
-
const
|
|
218036
|
+
const driver = usePluginDriver();
|
|
218018
218037
|
const oas = useOas();
|
|
218019
218038
|
const { getSchemas, getName, getFile } = useOperationManager(generator);
|
|
218020
218039
|
const isQuery = typeof options.query === "boolean" ? true : (_a = options.query) == null ? void 0 : _a.methods.some((method) => operation.method === method);
|
|
@@ -218033,7 +218052,7 @@ const queryGenerator$3 = createReactGenerator({
|
|
|
218033
218052
|
typeName: getName(operation, { type: "type" }),
|
|
218034
218053
|
file: getFile(operation, { prefix: "create" })
|
|
218035
218054
|
};
|
|
218036
|
-
const shouldUseClientPlugin = !!
|
|
218055
|
+
const shouldUseClientPlugin = !!driver.getPluginByName(pluginClientName) && options.client.clientType !== "class";
|
|
218037
218056
|
const client = {
|
|
218038
218057
|
name: shouldUseClientPlugin ? getName(operation, {
|
|
218039
218058
|
type: "function",
|
|
@@ -218077,7 +218096,7 @@ const queryGenerator$3 = createReactGenerator({
|
|
|
218077
218096
|
banner: getBanner({
|
|
218078
218097
|
oas,
|
|
218079
218098
|
output,
|
|
218080
|
-
config:
|
|
218099
|
+
config: driver.config
|
|
218081
218100
|
}),
|
|
218082
218101
|
footer: getFooter({
|
|
218083
218102
|
oas,
|
|
@@ -218302,7 +218321,7 @@ const pluginSolidQuery = definePlugin((options) => {
|
|
|
218302
218321
|
const oas = await this.getOas();
|
|
218303
218322
|
const baseURL = await this.getBaseURL();
|
|
218304
218323
|
if (baseURL) this.plugin.options.client.baseURL = baseURL;
|
|
218305
|
-
const hasClientPlugin = !!this.
|
|
218324
|
+
const hasClientPlugin = !!this.driver.getPluginByName(pluginClientName);
|
|
218306
218325
|
if (this.plugin.options.client.bundle && !hasClientPlugin && !this.plugin.options.client.importPath) await this.upsertFile({
|
|
218307
218326
|
baseName: "fetch.ts",
|
|
218308
218327
|
path: path$2.resolve(root, ".kubb/fetch.ts"),
|
|
@@ -218330,7 +218349,7 @@ const pluginSolidQuery = definePlugin((options) => {
|
|
|
218330
218349
|
const files = await new OperationGenerator(this.plugin.options, {
|
|
218331
218350
|
fabric: this.fabric,
|
|
218332
218351
|
oas,
|
|
218333
|
-
|
|
218352
|
+
driver: this.driver,
|
|
218334
218353
|
events: this.events,
|
|
218335
218354
|
plugin: this.plugin,
|
|
218336
218355
|
contentType,
|
|
@@ -218981,7 +219000,7 @@ const mutationGenerator$2 = createReactGenerator({
|
|
|
218981
219000
|
Operation({ config, operation, generator, plugin }) {
|
|
218982
219001
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
218983
219002
|
const { options, options: { output } } = plugin;
|
|
218984
|
-
const
|
|
219003
|
+
const driver = usePluginDriver();
|
|
218985
219004
|
const oas = useOas();
|
|
218986
219005
|
const { getSchemas, getName, getFile } = useOperationManager(generator);
|
|
218987
219006
|
const isQuery = !!options.query && ((_a = options.query) == null ? void 0 : _a.methods.some((method) => operation.method === method));
|
|
@@ -219009,7 +219028,7 @@ const mutationGenerator$2 = createReactGenerator({
|
|
|
219009
219028
|
type: "function"
|
|
219010
219029
|
})
|
|
219011
219030
|
};
|
|
219012
|
-
const shouldUseClientPlugin = !!
|
|
219031
|
+
const shouldUseClientPlugin = !!driver.getPluginByName(pluginClientName) && options.client.clientType !== "class";
|
|
219013
219032
|
const client = {
|
|
219014
219033
|
name: shouldUseClientPlugin ? getName(operation, {
|
|
219015
219034
|
type: "function",
|
|
@@ -219035,7 +219054,7 @@ const mutationGenerator$2 = createReactGenerator({
|
|
|
219035
219054
|
banner: getBanner({
|
|
219036
219055
|
oas,
|
|
219037
219056
|
output,
|
|
219038
|
-
config:
|
|
219057
|
+
config: driver.config
|
|
219039
219058
|
}),
|
|
219040
219059
|
footer: getFooter({
|
|
219041
219060
|
oas,
|
|
@@ -219169,7 +219188,7 @@ const queryGenerator$2 = createReactGenerator({
|
|
|
219169
219188
|
Operation({ config, operation, generator, plugin }) {
|
|
219170
219189
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
219171
219190
|
const { options, options: { output } } = plugin;
|
|
219172
|
-
const
|
|
219191
|
+
const driver = usePluginDriver();
|
|
219173
219192
|
const oas = useOas();
|
|
219174
219193
|
const { getSchemas, getName, getFile } = useOperationManager(generator);
|
|
219175
219194
|
const isQuery = typeof options.query === "boolean" ? true : (_a = options.query) == null ? void 0 : _a.methods.some((method) => operation.method === method);
|
|
@@ -219183,7 +219202,7 @@ const queryGenerator$2 = createReactGenerator({
|
|
|
219183
219202
|
typeName: getName(operation, { type: "type" }),
|
|
219184
219203
|
file: getFile(operation, { prefix: "create" })
|
|
219185
219204
|
};
|
|
219186
|
-
const shouldUseClientPlugin = !!
|
|
219205
|
+
const shouldUseClientPlugin = !!driver.getPluginByName(pluginClientName) && options.client.clientType !== "class";
|
|
219187
219206
|
const client = {
|
|
219188
219207
|
name: shouldUseClientPlugin ? getName(operation, {
|
|
219189
219208
|
type: "function",
|
|
@@ -219227,7 +219246,7 @@ const queryGenerator$2 = createReactGenerator({
|
|
|
219227
219246
|
banner: getBanner({
|
|
219228
219247
|
oas,
|
|
219229
219248
|
output,
|
|
219230
|
-
config:
|
|
219249
|
+
config: driver.config
|
|
219231
219250
|
}),
|
|
219232
219251
|
footer: getFooter({
|
|
219233
219252
|
oas,
|
|
@@ -219452,7 +219471,7 @@ const pluginSvelteQuery = definePlugin((options) => {
|
|
|
219452
219471
|
const oas = await this.getOas();
|
|
219453
219472
|
const baseURL = await this.getBaseURL();
|
|
219454
219473
|
if (baseURL) this.plugin.options.client.baseURL = baseURL;
|
|
219455
|
-
const hasClientPlugin = !!this.
|
|
219474
|
+
const hasClientPlugin = !!this.driver.getPluginByName(pluginClientName);
|
|
219456
219475
|
if (this.plugin.options.client.bundle && !hasClientPlugin && !this.plugin.options.client.importPath) await this.upsertFile({
|
|
219457
219476
|
baseName: "fetch.ts",
|
|
219458
219477
|
path: path$2.resolve(root, ".kubb/fetch.ts"),
|
|
@@ -219480,7 +219499,7 @@ const pluginSvelteQuery = definePlugin((options) => {
|
|
|
219480
219499
|
const files = await new OperationGenerator(this.plugin.options, {
|
|
219481
219500
|
fabric: this.fabric,
|
|
219482
219501
|
oas,
|
|
219483
|
-
|
|
219502
|
+
driver: this.driver,
|
|
219484
219503
|
events: this.events,
|
|
219485
219504
|
plugin: this.plugin,
|
|
219486
219505
|
contentType,
|
|
@@ -220169,7 +220188,7 @@ const mutationGenerator$1 = createReactGenerator({
|
|
|
220169
220188
|
Operation({ config, operation, generator, plugin }) {
|
|
220170
220189
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
220171
220190
|
const { options, options: { output } } = plugin;
|
|
220172
|
-
const
|
|
220191
|
+
const driver = usePluginDriver();
|
|
220173
220192
|
const oas = useOas();
|
|
220174
220193
|
const { getSchemas, getName, getFile } = useOperationManager(generator);
|
|
220175
220194
|
const isQuery = !!options.query && ((_a = options.query) == null ? void 0 : _a.methods.some((method) => operation.method === method));
|
|
@@ -220197,7 +220216,7 @@ const mutationGenerator$1 = createReactGenerator({
|
|
|
220197
220216
|
type: "function"
|
|
220198
220217
|
})
|
|
220199
220218
|
};
|
|
220200
|
-
const shouldUseClientPlugin = !!
|
|
220219
|
+
const shouldUseClientPlugin = !!driver.getPluginByName(pluginClientName) && options.client.clientType !== "class";
|
|
220201
220220
|
const client = {
|
|
220202
220221
|
name: shouldUseClientPlugin ? getName(operation, {
|
|
220203
220222
|
type: "function",
|
|
@@ -220223,7 +220242,7 @@ const mutationGenerator$1 = createReactGenerator({
|
|
|
220223
220242
|
banner: getBanner({
|
|
220224
220243
|
oas,
|
|
220225
220244
|
output,
|
|
220226
|
-
config:
|
|
220245
|
+
config: driver.config
|
|
220227
220246
|
}),
|
|
220228
220247
|
footer: getFooter({
|
|
220229
220248
|
oas,
|
|
@@ -220353,7 +220372,7 @@ const queryGenerator$1 = createReactGenerator({
|
|
|
220353
220372
|
Operation({ config, operation, generator, plugin }) {
|
|
220354
220373
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
220355
220374
|
const { options, options: { output } } = plugin;
|
|
220356
|
-
const
|
|
220375
|
+
const driver = usePluginDriver();
|
|
220357
220376
|
const oas = useOas();
|
|
220358
220377
|
const { getSchemas, getName, getFile } = useOperationManager(generator);
|
|
220359
220378
|
const isQuery = typeof options.query === "boolean" ? true : (_a = options.query) == null ? void 0 : _a.methods.some((method) => operation.method === method);
|
|
@@ -220367,7 +220386,7 @@ const queryGenerator$1 = createReactGenerator({
|
|
|
220367
220386
|
typeName: getName(operation, { type: "type" }),
|
|
220368
220387
|
file: getFile(operation, { prefix: "use" })
|
|
220369
220388
|
};
|
|
220370
|
-
const shouldUseClientPlugin = !!
|
|
220389
|
+
const shouldUseClientPlugin = !!driver.getPluginByName(pluginClientName) && options.client.clientType !== "class";
|
|
220371
220390
|
const client = {
|
|
220372
220391
|
name: shouldUseClientPlugin ? getName(operation, {
|
|
220373
220392
|
type: "function",
|
|
@@ -220411,7 +220430,7 @@ const queryGenerator$1 = createReactGenerator({
|
|
|
220411
220430
|
banner: getBanner({
|
|
220412
220431
|
oas,
|
|
220413
220432
|
output,
|
|
220414
|
-
config:
|
|
220433
|
+
config: driver.config
|
|
220415
220434
|
}),
|
|
220416
220435
|
footer: getFooter({
|
|
220417
220436
|
oas,
|
|
@@ -220624,7 +220643,7 @@ const pluginSwr = definePlugin((options) => {
|
|
|
220624
220643
|
const oas = await this.getOas();
|
|
220625
220644
|
const baseURL = await this.getBaseURL();
|
|
220626
220645
|
if (baseURL) this.plugin.options.client.baseURL = baseURL;
|
|
220627
|
-
const hasClientPlugin = !!this.
|
|
220646
|
+
const hasClientPlugin = !!this.driver.getPluginByName(pluginClientName);
|
|
220628
220647
|
if (this.plugin.options.client.bundle && !hasClientPlugin && !this.plugin.options.client.importPath) await this.upsertFile({
|
|
220629
220648
|
baseName: "fetch.ts",
|
|
220630
220649
|
path: path$2.resolve(root, ".kubb/fetch.ts"),
|
|
@@ -220652,7 +220671,7 @@ const pluginSwr = definePlugin((options) => {
|
|
|
220652
220671
|
const files = await new OperationGenerator(this.plugin.options, {
|
|
220653
220672
|
fabric: this.fabric,
|
|
220654
220673
|
oas,
|
|
220655
|
-
|
|
220674
|
+
driver: this.driver,
|
|
220656
220675
|
events: this.events,
|
|
220657
220676
|
plugin: this.plugin,
|
|
220658
220677
|
contentType,
|
|
@@ -221657,7 +221676,7 @@ const infiniteQueryGenerator = createReactGenerator({
|
|
|
221657
221676
|
Operation({ config, operation, generator, plugin }) {
|
|
221658
221677
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
221659
221678
|
const { options, options: { output } } = plugin;
|
|
221660
|
-
const
|
|
221679
|
+
const driver = usePluginDriver();
|
|
221661
221680
|
const oas = useOas();
|
|
221662
221681
|
const { getSchemas, getName, getFile } = useOperationManager(generator);
|
|
221663
221682
|
const isQuery = typeof options.query === "boolean" ? true : (_a = options.query) == null ? void 0 : _a.methods.some((method) => operation.method === method);
|
|
@@ -221676,7 +221695,7 @@ const infiniteQueryGenerator = createReactGenerator({
|
|
|
221676
221695
|
suffix: "infinite"
|
|
221677
221696
|
})
|
|
221678
221697
|
};
|
|
221679
|
-
const shouldUseClientPlugin = !!
|
|
221698
|
+
const shouldUseClientPlugin = !!driver.getPluginByName(pluginClientName) && options.client.clientType !== "class";
|
|
221680
221699
|
const client = {
|
|
221681
221700
|
name: shouldUseClientPlugin ? getName(operation, {
|
|
221682
221701
|
type: "function",
|
|
@@ -221723,7 +221742,7 @@ const infiniteQueryGenerator = createReactGenerator({
|
|
|
221723
221742
|
banner: getBanner({
|
|
221724
221743
|
oas,
|
|
221725
221744
|
output,
|
|
221726
|
-
config:
|
|
221745
|
+
config: driver.config
|
|
221727
221746
|
}),
|
|
221728
221747
|
footer: getFooter({
|
|
221729
221748
|
oas,
|
|
@@ -221893,7 +221912,7 @@ const mutationGenerator = createReactGenerator({
|
|
|
221893
221912
|
Operation({ config, operation, generator, plugin }) {
|
|
221894
221913
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
221895
221914
|
const { options, options: { output } } = plugin;
|
|
221896
|
-
const
|
|
221915
|
+
const driver = usePluginDriver();
|
|
221897
221916
|
const oas = useOas();
|
|
221898
221917
|
const { getSchemas, getName, getFile } = useOperationManager(generator);
|
|
221899
221918
|
const isQuery = !!options.query && ((_a = options.query) == null ? void 0 : _a.methods.some((method) => operation.method === method));
|
|
@@ -221921,7 +221940,7 @@ const mutationGenerator = createReactGenerator({
|
|
|
221921
221940
|
type: "function"
|
|
221922
221941
|
})
|
|
221923
221942
|
};
|
|
221924
|
-
const shouldUseClientPlugin = !!
|
|
221943
|
+
const shouldUseClientPlugin = !!driver.getPluginByName(pluginClientName) && options.client.clientType !== "class";
|
|
221925
221944
|
const client = {
|
|
221926
221945
|
name: shouldUseClientPlugin ? getName(operation, {
|
|
221927
221946
|
type: "function",
|
|
@@ -221947,7 +221966,7 @@ const mutationGenerator = createReactGenerator({
|
|
|
221947
221966
|
banner: getBanner({
|
|
221948
221967
|
oas,
|
|
221949
221968
|
output,
|
|
221950
|
-
config:
|
|
221969
|
+
config: driver.config
|
|
221951
221970
|
}),
|
|
221952
221971
|
footer: getFooter({
|
|
221953
221972
|
oas,
|
|
@@ -222082,7 +222101,7 @@ const queryGenerator = createReactGenerator({
|
|
|
222082
222101
|
Operation({ config, operation, generator, plugin }) {
|
|
222083
222102
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
222084
222103
|
const { options, options: { output } } = plugin;
|
|
222085
|
-
const
|
|
222104
|
+
const driver = usePluginDriver();
|
|
222086
222105
|
const oas = useOas();
|
|
222087
222106
|
const { getSchemas, getName, getFile } = useOperationManager(generator);
|
|
222088
222107
|
const isQuery = typeof options.query === "boolean" ? true : (_a = options.query) == null ? void 0 : _a.methods.some((method) => operation.method === method);
|
|
@@ -222096,7 +222115,7 @@ const queryGenerator = createReactGenerator({
|
|
|
222096
222115
|
typeName: getName(operation, { type: "type" }),
|
|
222097
222116
|
file: getFile(operation, { prefix: "use" })
|
|
222098
222117
|
};
|
|
222099
|
-
const shouldUseClientPlugin = !!
|
|
222118
|
+
const shouldUseClientPlugin = !!driver.getPluginByName(pluginClientName) && options.client.clientType !== "class";
|
|
222100
222119
|
const client = {
|
|
222101
222120
|
name: shouldUseClientPlugin ? getName(operation, {
|
|
222102
222121
|
type: "function",
|
|
@@ -222140,7 +222159,7 @@ const queryGenerator = createReactGenerator({
|
|
|
222140
222159
|
banner: getBanner({
|
|
222141
222160
|
oas,
|
|
222142
222161
|
output,
|
|
222143
|
-
config:
|
|
222162
|
+
config: driver.config
|
|
222144
222163
|
}),
|
|
222145
222164
|
footer: getFooter({
|
|
222146
222165
|
oas,
|
|
@@ -222386,7 +222405,7 @@ const pluginVueQuery = definePlugin((options) => {
|
|
|
222386
222405
|
const oas = await this.getOas();
|
|
222387
222406
|
const baseURL = await this.getBaseURL();
|
|
222388
222407
|
if (baseURL) this.plugin.options.client.baseURL = baseURL;
|
|
222389
|
-
const hasClientPlugin = !!this.
|
|
222408
|
+
const hasClientPlugin = !!this.driver.getPluginByName(pluginClientName);
|
|
222390
222409
|
if (this.plugin.options.client.bundle && !hasClientPlugin && !this.plugin.options.client.importPath) await this.upsertFile({
|
|
222391
222410
|
baseName: "fetch.ts",
|
|
222392
222411
|
path: path$2.resolve(root, ".kubb/fetch.ts"),
|
|
@@ -222414,7 +222433,7 @@ const pluginVueQuery = definePlugin((options) => {
|
|
|
222414
222433
|
const files = await new OperationGenerator(this.plugin.options, {
|
|
222415
222434
|
fabric: this.fabric,
|
|
222416
222435
|
oas,
|
|
222417
|
-
|
|
222436
|
+
driver: this.driver,
|
|
222418
222437
|
events: this.events,
|
|
222419
222438
|
plugin: this.plugin,
|
|
222420
222439
|
contentType,
|