@kubb/plugin-solid-query 3.16.2 → 3.16.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components-CNM6UaoG.js +320 -0
- package/dist/components-CNM6UaoG.js.map +1 -0
- package/dist/components-LAcBpjX8.cjs +366 -0
- package/dist/components-LAcBpjX8.cjs.map +1 -0
- package/dist/components.cjs +4 -19
- package/dist/components.d.cts +143 -57
- package/dist/components.d.ts +143 -57
- package/dist/components.js +3 -3
- package/dist/generators-DS71XOIi.cjs +199 -0
- package/dist/generators-DS71XOIi.cjs.map +1 -0
- package/dist/generators-DU74wsZY.js +194 -0
- package/dist/generators-DU74wsZY.js.map +1 -0
- package/dist/generators.cjs +3 -12
- package/dist/generators.d.cts +5 -7
- package/dist/generators.d.ts +5 -7
- package/dist/generators.js +4 -4
- package/dist/index.cjs +97 -128
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6 -8
- package/dist/index.d.ts +6 -8
- package/dist/index.js +97 -122
- package/dist/index.js.map +1 -1
- package/dist/types-C4Kxe-X1.d.ts +1335 -0
- package/dist/types-DULzisVA.d.cts +1335 -0
- package/package.json +23 -28
- package/dist/chunk-DVQAS6QW.cjs +0 -265
- package/dist/chunk-DVQAS6QW.cjs.map +0 -1
- package/dist/chunk-IH7LFLIP.cjs +0 -161
- package/dist/chunk-IH7LFLIP.cjs.map +0 -1
- package/dist/chunk-U7KQKXOC.js +0 -159
- package/dist/chunk-U7KQKXOC.js.map +0 -1
- package/dist/chunk-XXQM3BYJ.js +0 -261
- package/dist/chunk-XXQM3BYJ.js.map +0 -1
- package/dist/components.cjs.map +0 -1
- package/dist/components.js.map +0 -1
- package/dist/generators.cjs.map +0 -1
- package/dist/generators.js.map +0 -1
- package/dist/types-Cx6RgBxP.d.cts +0 -114
- package/dist/types-Cx6RgBxP.d.ts +0 -114
package/dist/generators.cjs
CHANGED
|
@@ -1,13 +1,4 @@
|
|
|
1
|
-
'
|
|
1
|
+
require('./components-LAcBpjX8.cjs');
|
|
2
|
+
const require_generators = require('./generators-DS71XOIi.cjs');
|
|
2
3
|
|
|
3
|
-
|
|
4
|
-
require('./chunk-DVQAS6QW.cjs');
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
Object.defineProperty(exports, "queryGenerator", {
|
|
9
|
-
enumerable: true,
|
|
10
|
-
get: function () { return chunkIH7LFLIP_cjs.queryGenerator; }
|
|
11
|
-
});
|
|
12
|
-
//# sourceMappingURL=generators.cjs.map
|
|
13
|
-
//# sourceMappingURL=generators.cjs.map
|
|
4
|
+
exports.queryGenerator = require_generators.queryGenerator;
|
package/dist/generators.d.cts
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { P as PluginSolidQuery } from './types-Cx6RgBxP.cjs';
|
|
3
|
-
import '@kubb/core';
|
|
4
|
-
import '@kubb/oas';
|
|
5
|
-
import '@kubb/plugin-client';
|
|
6
|
-
|
|
7
|
-
declare const queryGenerator: _kubb_plugin_oas.Generator<PluginSolidQuery>;
|
|
1
|
+
import { Generator, PluginSolidQuery } from "./types-DULzisVA.cjs";
|
|
8
2
|
|
|
3
|
+
//#region src/generators/queryGenerator.d.ts
|
|
4
|
+
declare const queryGenerator: Generator<PluginSolidQuery>;
|
|
5
|
+
//#endregion
|
|
9
6
|
export { queryGenerator };
|
|
7
|
+
//# sourceMappingURL=generators.d.cts.map
|
package/dist/generators.d.ts
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { P as PluginSolidQuery } from './types-Cx6RgBxP.js';
|
|
3
|
-
import '@kubb/core';
|
|
4
|
-
import '@kubb/oas';
|
|
5
|
-
import '@kubb/plugin-client';
|
|
6
|
-
|
|
7
|
-
declare const queryGenerator: _kubb_plugin_oas.Generator<PluginSolidQuery>;
|
|
1
|
+
import { Generator, PluginSolidQuery } from "./types-C4Kxe-X1.js";
|
|
8
2
|
|
|
3
|
+
//#region src/generators/queryGenerator.d.ts
|
|
4
|
+
declare const queryGenerator: Generator<PluginSolidQuery>;
|
|
5
|
+
//#endregion
|
|
9
6
|
export { queryGenerator };
|
|
7
|
+
//# sourceMappingURL=generators.d.ts.map
|
package/dist/generators.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import "./components-CNM6UaoG.js";
|
|
2
|
+
import { queryGenerator } from "./generators-DU74wsZY.js";
|
|
3
|
+
|
|
4
|
+
export { queryGenerator };
|
package/dist/index.cjs
CHANGED
|
@@ -1,134 +1,103 @@
|
|
|
1
|
-
|
|
1
|
+
const require_components = require('./components-LAcBpjX8.cjs');
|
|
2
|
+
const require_generators = require('./generators-DS71XOIi.cjs');
|
|
3
|
+
const node_path = require_components.__toESM(require("node:path"));
|
|
4
|
+
const __kubb_core = require_components.__toESM(require("@kubb/core"));
|
|
5
|
+
const __kubb_core_transformers = require_components.__toESM(require("@kubb/core/transformers"));
|
|
6
|
+
const __kubb_plugin_oas = require_components.__toESM(require("@kubb/plugin-oas"));
|
|
7
|
+
const __kubb_plugin_ts = require_components.__toESM(require("@kubb/plugin-ts"));
|
|
8
|
+
const __kubb_plugin_zod = require_components.__toESM(require("@kubb/plugin-zod"));
|
|
2
9
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
if (type) {
|
|
92
|
-
return transformers$1?.name?.(resolvedName, type) || resolvedName;
|
|
93
|
-
}
|
|
94
|
-
return resolvedName;
|
|
95
|
-
},
|
|
96
|
-
async buildStart() {
|
|
97
|
-
const [swaggerPlugin] = core.PluginManager.getDependedPlugins(this.plugins, [pluginOas.pluginOasName]);
|
|
98
|
-
const oas = await swaggerPlugin.context.getOas();
|
|
99
|
-
const root = path__default.default.resolve(this.config.root, this.config.output.path);
|
|
100
|
-
const mode = core.FileManager.getMode(path__default.default.resolve(root, output.path));
|
|
101
|
-
const baseURL = await swaggerPlugin.context.getBaseURL();
|
|
102
|
-
if (baseURL) {
|
|
103
|
-
this.plugin.options.client.baseURL = baseURL;
|
|
104
|
-
}
|
|
105
|
-
const operationGenerator = new pluginOas.OperationGenerator(this.plugin.options, {
|
|
106
|
-
oas,
|
|
107
|
-
pluginManager: this.pluginManager,
|
|
108
|
-
plugin: this.plugin,
|
|
109
|
-
contentType,
|
|
110
|
-
exclude,
|
|
111
|
-
include,
|
|
112
|
-
override,
|
|
113
|
-
mode
|
|
114
|
-
});
|
|
115
|
-
const files = await operationGenerator.build(...generators);
|
|
116
|
-
await this.addFile(...files);
|
|
117
|
-
const barrelFiles = await this.fileManager.getBarrelFiles({
|
|
118
|
-
type: output.barrelType ?? "named",
|
|
119
|
-
root,
|
|
120
|
-
output,
|
|
121
|
-
meta: {
|
|
122
|
-
pluginKey: this.plugin.key
|
|
123
|
-
},
|
|
124
|
-
logger: this.logger
|
|
125
|
-
});
|
|
126
|
-
await this.addFile(...barrelFiles);
|
|
127
|
-
}
|
|
128
|
-
};
|
|
10
|
+
//#region src/plugin.ts
|
|
11
|
+
const pluginSolidQueryName = "plugin-solid-query";
|
|
12
|
+
const pluginSolidQuery = (0, __kubb_core.createPlugin)((options) => {
|
|
13
|
+
const { output = {
|
|
14
|
+
path: "hooks",
|
|
15
|
+
barrelType: "named"
|
|
16
|
+
}, group, exclude = [], include, override = [], parser = "client", transformers = {}, paramsType = "inline", pathParamsType = paramsType === "object" ? "object" : options.pathParamsType || "inline", queryKey = require_components.QueryKey.getTransformer, generators = [require_generators.queryGenerator].filter(Boolean), query = {}, paramsCasing, contentType } = options;
|
|
17
|
+
return {
|
|
18
|
+
name: pluginSolidQueryName,
|
|
19
|
+
options: {
|
|
20
|
+
output,
|
|
21
|
+
client: {
|
|
22
|
+
importPath: "@kubb/plugin-client/clients/axios",
|
|
23
|
+
dataReturnType: "data",
|
|
24
|
+
pathParamsType,
|
|
25
|
+
...options.client
|
|
26
|
+
},
|
|
27
|
+
queryKey,
|
|
28
|
+
query: query === false ? false : {
|
|
29
|
+
methods: ["get"],
|
|
30
|
+
importPath: "@tanstack/solid-query",
|
|
31
|
+
...query
|
|
32
|
+
},
|
|
33
|
+
paramsType,
|
|
34
|
+
pathParamsType,
|
|
35
|
+
parser,
|
|
36
|
+
group,
|
|
37
|
+
paramsCasing
|
|
38
|
+
},
|
|
39
|
+
pre: [
|
|
40
|
+
__kubb_plugin_oas.pluginOasName,
|
|
41
|
+
__kubb_plugin_ts.pluginTsName,
|
|
42
|
+
parser === "zod" ? __kubb_plugin_zod.pluginZodName : void 0
|
|
43
|
+
].filter(Boolean),
|
|
44
|
+
resolvePath(baseName, pathMode, options$1) {
|
|
45
|
+
const root = node_path.default.resolve(this.config.root, this.config.output.path);
|
|
46
|
+
const mode = pathMode ?? __kubb_core.FileManager.getMode(node_path.default.resolve(root, output.path));
|
|
47
|
+
if (mode === "single")
|
|
48
|
+
/**
|
|
49
|
+
* when output is a file then we will always append to the same file(output file), see fileManager.addOrAppend
|
|
50
|
+
* Other plugins then need to call addOrAppend instead of just add from the fileManager class
|
|
51
|
+
*/
|
|
52
|
+
return node_path.default.resolve(root, output.path);
|
|
53
|
+
if (group && (options$1?.group?.path || options$1?.group?.tag)) {
|
|
54
|
+
const groupName = group?.name ? group.name : (ctx) => {
|
|
55
|
+
if (group?.type === "path") return `${ctx.group.split("/")[1]}`;
|
|
56
|
+
return `${(0, __kubb_core_transformers.camelCase)(ctx.group)}Controller`;
|
|
57
|
+
};
|
|
58
|
+
return node_path.default.resolve(root, output.path, groupName({ group: group.type === "path" ? options$1.group.path : options$1.group.tag }), baseName);
|
|
59
|
+
}
|
|
60
|
+
return node_path.default.resolve(root, output.path, baseName);
|
|
61
|
+
},
|
|
62
|
+
resolveName(name, type) {
|
|
63
|
+
let resolvedName = (0, __kubb_core_transformers.camelCase)(name);
|
|
64
|
+
if (type === "file" || type === "function") resolvedName = (0, __kubb_core_transformers.camelCase)(name, { isFile: type === "file" });
|
|
65
|
+
if (type === "type") resolvedName = (0, __kubb_core_transformers.pascalCase)(name);
|
|
66
|
+
if (type) return transformers?.name?.(resolvedName, type) || resolvedName;
|
|
67
|
+
return resolvedName;
|
|
68
|
+
},
|
|
69
|
+
async buildStart() {
|
|
70
|
+
const [swaggerPlugin] = __kubb_core.PluginManager.getDependedPlugins(this.plugins, [__kubb_plugin_oas.pluginOasName]);
|
|
71
|
+
const oas = await swaggerPlugin.context.getOas();
|
|
72
|
+
const root = node_path.default.resolve(this.config.root, this.config.output.path);
|
|
73
|
+
const mode = __kubb_core.FileManager.getMode(node_path.default.resolve(root, output.path));
|
|
74
|
+
const baseURL = await swaggerPlugin.context.getBaseURL();
|
|
75
|
+
if (baseURL) this.plugin.options.client.baseURL = baseURL;
|
|
76
|
+
const operationGenerator = new __kubb_plugin_oas.OperationGenerator(this.plugin.options, {
|
|
77
|
+
oas,
|
|
78
|
+
pluginManager: this.pluginManager,
|
|
79
|
+
plugin: this.plugin,
|
|
80
|
+
contentType,
|
|
81
|
+
exclude,
|
|
82
|
+
include,
|
|
83
|
+
override,
|
|
84
|
+
mode
|
|
85
|
+
});
|
|
86
|
+
const files = await operationGenerator.build(...generators);
|
|
87
|
+
await this.addFile(...files);
|
|
88
|
+
const barrelFiles = await this.fileManager.getBarrelFiles({
|
|
89
|
+
type: output.barrelType ?? "named",
|
|
90
|
+
root,
|
|
91
|
+
output,
|
|
92
|
+
meta: { pluginKey: this.plugin.key },
|
|
93
|
+
logger: this.logger
|
|
94
|
+
});
|
|
95
|
+
await this.addFile(...barrelFiles);
|
|
96
|
+
}
|
|
97
|
+
};
|
|
129
98
|
});
|
|
130
99
|
|
|
100
|
+
//#endregion
|
|
131
101
|
exports.pluginSolidQuery = pluginSolidQuery;
|
|
132
102
|
exports.pluginSolidQueryName = pluginSolidQueryName;
|
|
133
|
-
//# sourceMappingURL=index.cjs.map
|
|
134
103
|
//# sourceMappingURL=index.cjs.map
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["QueryKey","queryGenerator","pluginOasName","pluginTsName","pluginZodName","options","path","FileManager","groupName: Group['name']","PluginManager","OperationGenerator"],"sources":["../src/plugin.ts"],"sourcesContent":["import path from 'node:path'\n\nimport { FileManager, type Group, PluginManager, createPlugin } from '@kubb/core'\nimport { camelCase, pascalCase } from '@kubb/core/transformers'\nimport { OperationGenerator, pluginOasName } from '@kubb/plugin-oas'\n\nimport { pluginTsName } from '@kubb/plugin-ts'\nimport { pluginZodName } from '@kubb/plugin-zod'\n\nimport type { Plugin } from '@kubb/core'\nimport type { PluginOas } from '@kubb/plugin-oas'\nimport { QueryKey } from './components'\nimport { queryGenerator } from './generators'\nimport type { PluginSolidQuery } from './types.ts'\n\nexport const pluginSolidQueryName = 'plugin-solid-query' satisfies PluginSolidQuery['name']\n\nexport const pluginSolidQuery = createPlugin<PluginSolidQuery>((options) => {\n const {\n output = { path: 'hooks', barrelType: 'named' },\n group,\n exclude = [],\n include,\n override = [],\n parser = 'client',\n transformers = {},\n paramsType = 'inline',\n pathParamsType = paramsType === 'object' ? 'object' : options.pathParamsType || 'inline',\n queryKey = QueryKey.getTransformer,\n generators = [queryGenerator].filter(Boolean),\n query = {},\n paramsCasing,\n contentType,\n } = options\n\n return {\n name: pluginSolidQueryName,\n options: {\n output,\n client: {\n importPath: '@kubb/plugin-client/clients/axios',\n dataReturnType: 'data',\n pathParamsType,\n ...options.client,\n },\n queryKey,\n query:\n query === false\n ? false\n : {\n methods: ['get'],\n importPath: '@tanstack/solid-query',\n ...query,\n },\n paramsType,\n pathParamsType,\n parser,\n group,\n paramsCasing,\n },\n pre: [pluginOasName, pluginTsName, parser === 'zod' ? pluginZodName : undefined].filter(Boolean),\n resolvePath(baseName, pathMode, options) {\n const root = path.resolve(this.config.root, this.config.output.path)\n const mode = pathMode ?? FileManager.getMode(path.resolve(root, output.path))\n\n if (mode === 'single') {\n /**\n * when output is a file then we will always append to the same file(output file), see fileManager.addOrAppend\n * Other plugins then need to call addOrAppend instead of just add from the fileManager class\n */\n return path.resolve(root, output.path)\n }\n\n if (group && (options?.group?.path || options?.group?.tag)) {\n const groupName: Group['name'] = group?.name\n ? group.name\n : (ctx) => {\n if (group?.type === 'path') {\n return `${ctx.group.split('/')[1]}`\n }\n return `${camelCase(ctx.group)}Controller`\n }\n\n return path.resolve(\n root,\n output.path,\n groupName({\n group: group.type === 'path' ? options.group.path! : options.group.tag!,\n }),\n baseName,\n )\n }\n\n return path.resolve(root, output.path, baseName)\n },\n resolveName(name, type) {\n let resolvedName = camelCase(name)\n\n if (type === 'file' || type === 'function') {\n resolvedName = camelCase(name, {\n isFile: type === 'file',\n })\n }\n if (type === 'type') {\n resolvedName = pascalCase(name)\n }\n\n if (type) {\n return transformers?.name?.(resolvedName, type) || resolvedName\n }\n\n return resolvedName\n },\n async buildStart() {\n const [swaggerPlugin]: [Plugin<PluginOas>] = PluginManager.getDependedPlugins<PluginOas>(this.plugins, [pluginOasName])\n\n const oas = await swaggerPlugin.context.getOas()\n const root = path.resolve(this.config.root, this.config.output.path)\n const mode = FileManager.getMode(path.resolve(root, output.path))\n const baseURL = await swaggerPlugin.context.getBaseURL()\n\n if (baseURL) {\n this.plugin.options.client.baseURL = baseURL\n }\n\n const operationGenerator = new OperationGenerator(this.plugin.options, {\n oas,\n pluginManager: this.pluginManager,\n plugin: this.plugin,\n contentType,\n exclude,\n include,\n override,\n mode,\n })\n\n const files = await operationGenerator.build(...generators)\n await this.addFile(...files)\n\n const barrelFiles = await this.fileManager.getBarrelFiles({\n type: output.barrelType ?? 'named',\n root,\n output,\n meta: {\n pluginKey: this.plugin.key,\n },\n logger: this.logger,\n })\n\n await this.addFile(...barrelFiles)\n },\n }\n})\n"],"mappings":"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"}
|
package/dist/index.d.cts
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { O as Options, P as PluginSolidQuery } from './types-Cx6RgBxP.cjs';
|
|
3
|
-
import '@kubb/oas';
|
|
4
|
-
import '@kubb/plugin-client';
|
|
5
|
-
import '@kubb/plugin-oas';
|
|
1
|
+
import { Options, PluginSolidQuery, UserPluginWithLifeCycle } from "./types-DULzisVA.cjs";
|
|
6
2
|
|
|
3
|
+
//#region src/plugin.d.ts
|
|
7
4
|
declare const pluginSolidQueryName = "plugin-solid-query";
|
|
8
|
-
declare const pluginSolidQuery: (options?: Options | undefined) =>
|
|
9
|
-
|
|
10
|
-
export { PluginSolidQuery, pluginSolidQuery, pluginSolidQueryName };
|
|
5
|
+
declare const pluginSolidQuery: (options?: Options | undefined) => UserPluginWithLifeCycle<PluginSolidQuery>;
|
|
6
|
+
//#endregion
|
|
7
|
+
export { type PluginSolidQuery, pluginSolidQuery, pluginSolidQueryName };
|
|
8
|
+
//# sourceMappingURL=index.d.cts.map
|
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { O as Options, P as PluginSolidQuery } from './types-Cx6RgBxP.js';
|
|
3
|
-
import '@kubb/oas';
|
|
4
|
-
import '@kubb/plugin-client';
|
|
5
|
-
import '@kubb/plugin-oas';
|
|
1
|
+
import { Options, PluginSolidQuery, UserPluginWithLifeCycle } from "./types-C4Kxe-X1.js";
|
|
6
2
|
|
|
3
|
+
//#region src/plugin.d.ts
|
|
7
4
|
declare const pluginSolidQueryName = "plugin-solid-query";
|
|
8
|
-
declare const pluginSolidQuery: (options?: Options | undefined) =>
|
|
9
|
-
|
|
10
|
-
export { PluginSolidQuery, pluginSolidQuery, pluginSolidQueryName };
|
|
5
|
+
declare const pluginSolidQuery: (options?: Options | undefined) => UserPluginWithLifeCycle<PluginSolidQuery>;
|
|
6
|
+
//#endregion
|
|
7
|
+
export { type PluginSolidQuery, pluginSolidQuery, pluginSolidQueryName };
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.js
CHANGED
|
@@ -1,127 +1,102 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import path from
|
|
4
|
-
import {
|
|
5
|
-
import { camelCase, pascalCase } from
|
|
6
|
-
import {
|
|
7
|
-
import { pluginTsName } from
|
|
8
|
-
import { pluginZodName } from
|
|
1
|
+
import { QueryKey } from "./components-CNM6UaoG.js";
|
|
2
|
+
import { queryGenerator } from "./generators-DU74wsZY.js";
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
import { FileManager, PluginManager, createPlugin } from "@kubb/core";
|
|
5
|
+
import { camelCase, pascalCase } from "@kubb/core/transformers";
|
|
6
|
+
import { OperationGenerator, pluginOasName } from "@kubb/plugin-oas";
|
|
7
|
+
import { pluginTsName } from "@kubb/plugin-ts";
|
|
8
|
+
import { pluginZodName } from "@kubb/plugin-zod";
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
}
|
|
99
|
-
const operationGenerator = new OperationGenerator(this.plugin.options, {
|
|
100
|
-
oas,
|
|
101
|
-
pluginManager: this.pluginManager,
|
|
102
|
-
plugin: this.plugin,
|
|
103
|
-
contentType,
|
|
104
|
-
exclude,
|
|
105
|
-
include,
|
|
106
|
-
override,
|
|
107
|
-
mode
|
|
108
|
-
});
|
|
109
|
-
const files = await operationGenerator.build(...generators);
|
|
110
|
-
await this.addFile(...files);
|
|
111
|
-
const barrelFiles = await this.fileManager.getBarrelFiles({
|
|
112
|
-
type: output.barrelType ?? "named",
|
|
113
|
-
root,
|
|
114
|
-
output,
|
|
115
|
-
meta: {
|
|
116
|
-
pluginKey: this.plugin.key
|
|
117
|
-
},
|
|
118
|
-
logger: this.logger
|
|
119
|
-
});
|
|
120
|
-
await this.addFile(...barrelFiles);
|
|
121
|
-
}
|
|
122
|
-
};
|
|
10
|
+
//#region src/plugin.ts
|
|
11
|
+
const pluginSolidQueryName = "plugin-solid-query";
|
|
12
|
+
const pluginSolidQuery = createPlugin((options) => {
|
|
13
|
+
const { output = {
|
|
14
|
+
path: "hooks",
|
|
15
|
+
barrelType: "named"
|
|
16
|
+
}, group, exclude = [], include, override = [], parser = "client", transformers = {}, paramsType = "inline", pathParamsType = paramsType === "object" ? "object" : options.pathParamsType || "inline", queryKey = QueryKey.getTransformer, generators = [queryGenerator].filter(Boolean), query = {}, paramsCasing, contentType } = options;
|
|
17
|
+
return {
|
|
18
|
+
name: pluginSolidQueryName,
|
|
19
|
+
options: {
|
|
20
|
+
output,
|
|
21
|
+
client: {
|
|
22
|
+
importPath: "@kubb/plugin-client/clients/axios",
|
|
23
|
+
dataReturnType: "data",
|
|
24
|
+
pathParamsType,
|
|
25
|
+
...options.client
|
|
26
|
+
},
|
|
27
|
+
queryKey,
|
|
28
|
+
query: query === false ? false : {
|
|
29
|
+
methods: ["get"],
|
|
30
|
+
importPath: "@tanstack/solid-query",
|
|
31
|
+
...query
|
|
32
|
+
},
|
|
33
|
+
paramsType,
|
|
34
|
+
pathParamsType,
|
|
35
|
+
parser,
|
|
36
|
+
group,
|
|
37
|
+
paramsCasing
|
|
38
|
+
},
|
|
39
|
+
pre: [
|
|
40
|
+
pluginOasName,
|
|
41
|
+
pluginTsName,
|
|
42
|
+
parser === "zod" ? pluginZodName : void 0
|
|
43
|
+
].filter(Boolean),
|
|
44
|
+
resolvePath(baseName, pathMode, options$1) {
|
|
45
|
+
const root = path.resolve(this.config.root, this.config.output.path);
|
|
46
|
+
const mode = pathMode ?? FileManager.getMode(path.resolve(root, output.path));
|
|
47
|
+
if (mode === "single")
|
|
48
|
+
/**
|
|
49
|
+
* when output is a file then we will always append to the same file(output file), see fileManager.addOrAppend
|
|
50
|
+
* Other plugins then need to call addOrAppend instead of just add from the fileManager class
|
|
51
|
+
*/
|
|
52
|
+
return path.resolve(root, output.path);
|
|
53
|
+
if (group && (options$1?.group?.path || options$1?.group?.tag)) {
|
|
54
|
+
const groupName = group?.name ? group.name : (ctx) => {
|
|
55
|
+
if (group?.type === "path") return `${ctx.group.split("/")[1]}`;
|
|
56
|
+
return `${camelCase(ctx.group)}Controller`;
|
|
57
|
+
};
|
|
58
|
+
return path.resolve(root, output.path, groupName({ group: group.type === "path" ? options$1.group.path : options$1.group.tag }), baseName);
|
|
59
|
+
}
|
|
60
|
+
return path.resolve(root, output.path, baseName);
|
|
61
|
+
},
|
|
62
|
+
resolveName(name, type) {
|
|
63
|
+
let resolvedName = camelCase(name);
|
|
64
|
+
if (type === "file" || type === "function") resolvedName = camelCase(name, { isFile: type === "file" });
|
|
65
|
+
if (type === "type") resolvedName = pascalCase(name);
|
|
66
|
+
if (type) return transformers?.name?.(resolvedName, type) || resolvedName;
|
|
67
|
+
return resolvedName;
|
|
68
|
+
},
|
|
69
|
+
async buildStart() {
|
|
70
|
+
const [swaggerPlugin] = PluginManager.getDependedPlugins(this.plugins, [pluginOasName]);
|
|
71
|
+
const oas = await swaggerPlugin.context.getOas();
|
|
72
|
+
const root = path.resolve(this.config.root, this.config.output.path);
|
|
73
|
+
const mode = FileManager.getMode(path.resolve(root, output.path));
|
|
74
|
+
const baseURL = await swaggerPlugin.context.getBaseURL();
|
|
75
|
+
if (baseURL) this.plugin.options.client.baseURL = baseURL;
|
|
76
|
+
const operationGenerator = new OperationGenerator(this.plugin.options, {
|
|
77
|
+
oas,
|
|
78
|
+
pluginManager: this.pluginManager,
|
|
79
|
+
plugin: this.plugin,
|
|
80
|
+
contentType,
|
|
81
|
+
exclude,
|
|
82
|
+
include,
|
|
83
|
+
override,
|
|
84
|
+
mode
|
|
85
|
+
});
|
|
86
|
+
const files = await operationGenerator.build(...generators);
|
|
87
|
+
await this.addFile(...files);
|
|
88
|
+
const barrelFiles = await this.fileManager.getBarrelFiles({
|
|
89
|
+
type: output.barrelType ?? "named",
|
|
90
|
+
root,
|
|
91
|
+
output,
|
|
92
|
+
meta: { pluginKey: this.plugin.key },
|
|
93
|
+
logger: this.logger
|
|
94
|
+
});
|
|
95
|
+
await this.addFile(...barrelFiles);
|
|
96
|
+
}
|
|
97
|
+
};
|
|
123
98
|
});
|
|
124
99
|
|
|
100
|
+
//#endregion
|
|
125
101
|
export { pluginSolidQuery, pluginSolidQueryName };
|
|
126
|
-
//# sourceMappingURL=index.js.map
|
|
127
102
|
//# sourceMappingURL=index.js.map
|