@kubb/plugin-client 4.27.3 → 4.27.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/{StaticClassClient-InXfCDQs.js → StaticClassClient-uqlvmwoJ.js} +3 -3
- package/dist/{StaticClassClient-InXfCDQs.js.map → StaticClassClient-uqlvmwoJ.js.map} +1 -1
- package/dist/{StaticClassClient-D7DWLX5M.cjs → StaticClassClient-zUX04A4W.cjs} +2 -2
- package/dist/{StaticClassClient-D7DWLX5M.cjs.map → StaticClassClient-zUX04A4W.cjs.map} +1 -1
- package/dist/axios.source-CDcg9aL-.js +6 -0
- package/dist/axios.source-CDcg9aL-.js.map +1 -0
- package/dist/axios.source-CRSmc9GC.cjs +12 -0
- package/dist/axios.source-CRSmc9GC.cjs.map +1 -0
- package/dist/clients/axios.d.cts +1 -1
- package/dist/clients/axios.d.ts +1 -1
- package/dist/clients/axios.js +1 -1
- package/dist/clients/fetch.d.cts +1 -1
- package/dist/clients/fetch.d.ts +1 -1
- package/dist/clients/fetch.js +1 -1
- package/dist/components.cjs +1 -1
- package/dist/components.d.cts +2 -2
- package/dist/components.d.ts +2 -2
- package/dist/components.js +1 -1
- package/dist/config.source-CiegvD_s.cjs +12 -0
- package/dist/config.source-CiegvD_s.cjs.map +1 -0
- package/dist/config.source-VWEtFolK.js +6 -0
- package/dist/config.source-VWEtFolK.js.map +1 -0
- package/dist/fetch.source-BVpZ9vJe.cjs +12 -0
- package/dist/fetch.source-BVpZ9vJe.cjs.map +1 -0
- package/dist/fetch.source-DkBhuGC1.js +6 -0
- package/dist/fetch.source-DkBhuGC1.js.map +1 -0
- package/dist/{generators-B7HJgl12.js → generators-C3iBxAkk.js} +3 -3
- package/dist/{generators-B7HJgl12.js.map → generators-C3iBxAkk.js.map} +1 -1
- package/dist/{generators-DU-pLWf_.cjs → generators-C4H4RSpu.cjs} +2 -2
- package/dist/{generators-DU-pLWf_.cjs.map → generators-C4H4RSpu.cjs.map} +1 -1
- package/dist/generators.cjs +1 -1
- package/dist/generators.d.cts +2 -2
- package/dist/generators.d.ts +3 -3
- package/dist/generators.js +1 -1
- package/dist/index.cjs +6 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +7 -5
- package/dist/index.js.map +1 -1
- package/dist/templates/clients/axios.source.cjs +3 -0
- package/dist/templates/clients/axios.source.d.cts +7 -0
- package/dist/templates/clients/axios.source.d.ts +7 -0
- package/dist/templates/clients/axios.source.js +3 -0
- package/dist/templates/clients/fetch.source.cjs +3 -0
- package/dist/templates/clients/fetch.source.d.cts +7 -0
- package/dist/templates/clients/fetch.source.d.ts +7 -0
- package/dist/templates/clients/fetch.source.js +3 -0
- package/dist/templates/config.source.cjs +3 -0
- package/dist/templates/config.source.d.cts +7 -0
- package/dist/templates/config.source.d.ts +7 -0
- package/dist/templates/config.source.js +3 -0
- package/dist/{types-CaJayxuD.d.cts → types-B-chJOb6.d.cts} +2 -2
- package/dist/{types-FZAT4tqW.d.ts → types-BCu9gRSm.d.ts} +2 -2
- package/package.json +27 -6
- package/src/plugin.ts +5 -5
- package/src/templates/clients/axios.source.ts +4 -0
- package/src/templates/clients/fetch.source.ts +4 -0
- package/src/templates/config.source.ts +4 -0
- /package/dist/{chunk-iVr_oF3V.js → chunk-Cd3iupn7.js} +0 -0
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as __name } from "./chunk-
|
|
2
|
-
import { n as Options, r as PluginClient, t as ClientImportPath } from "./types-
|
|
1
|
+
import { t as __name } from "./chunk-Cd3iupn7.js";
|
|
2
|
+
import { n as Options, r as PluginClient, t as ClientImportPath } from "./types-BCu9gRSm.js";
|
|
3
3
|
import * as _kubb_core0 from "@kubb/core";
|
|
4
4
|
|
|
5
5
|
//#region src/plugin.d.ts
|
package/dist/index.js
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import { t as __name } from "./chunk-
|
|
2
|
-
import { a as classClientGenerator, i as clientGenerator, n as operationsGenerator, r as groupedClientGenerator, t as staticClassClientGenerator } from "./generators-
|
|
1
|
+
import { t as __name } from "./chunk-Cd3iupn7.js";
|
|
2
|
+
import { a as classClientGenerator, i as clientGenerator, n as operationsGenerator, r as groupedClientGenerator, t as staticClassClientGenerator } from "./generators-C3iBxAkk.js";
|
|
3
|
+
import { t as source } from "./axios.source-CDcg9aL-.js";
|
|
4
|
+
import { t as source$1 } from "./fetch.source-DkBhuGC1.js";
|
|
5
|
+
import { t as source$2 } from "./config.source-VWEtFolK.js";
|
|
3
6
|
import path from "node:path";
|
|
4
7
|
import { definePlugin, getBarrelFiles, getMode } from "@kubb/core";
|
|
5
8
|
import { camelCase } from "@kubb/core/transformers";
|
|
6
|
-
import { resolveModuleSource } from "@kubb/core/utils";
|
|
7
9
|
import { OperationGenerator, pluginOasName } from "@kubb/plugin-oas";
|
|
8
10
|
import { pluginZodName } from "@kubb/plugin-zod";
|
|
9
11
|
|
|
@@ -71,7 +73,7 @@ const pluginClient = definePlugin((options) => {
|
|
|
71
73
|
path: path.resolve(root, ".kubb/fetch.ts"),
|
|
72
74
|
sources: [{
|
|
73
75
|
name: "fetch",
|
|
74
|
-
value:
|
|
76
|
+
value: this.plugin.options.client === "fetch" ? source$1 : source,
|
|
75
77
|
isExportable: true,
|
|
76
78
|
isIndexable: true
|
|
77
79
|
}],
|
|
@@ -83,7 +85,7 @@ const pluginClient = definePlugin((options) => {
|
|
|
83
85
|
path: path.resolve(root, ".kubb/config.ts"),
|
|
84
86
|
sources: [{
|
|
85
87
|
name: "config",
|
|
86
|
-
value:
|
|
88
|
+
value: source$2,
|
|
87
89
|
isExportable: false,
|
|
88
90
|
isIndexable: false
|
|
89
91
|
}],
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["options","baseURL"],"sources":["../src/plugin.ts"],"sourcesContent":["import path from 'node:path'\nimport { definePlugin, type Group, getBarrelFiles, getMode } from '@kubb/core'\nimport { camelCase } from '@kubb/core/transformers'\nimport {
|
|
1
|
+
{"version":3,"file":"index.js","names":["options","baseURL","fetchClientSource","axiosClientSource","configSource"],"sources":["../src/plugin.ts"],"sourcesContent":["import path from 'node:path'\nimport { definePlugin, type Group, getBarrelFiles, getMode } from '@kubb/core'\nimport { camelCase } from '@kubb/core/transformers'\nimport { OperationGenerator, pluginOasName } from '@kubb/plugin-oas'\nimport { pluginZodName } from '@kubb/plugin-zod'\nimport { classClientGenerator, operationsGenerator } from './generators'\nimport { clientGenerator } from './generators/clientGenerator.tsx'\nimport { groupedClientGenerator } from './generators/groupedClientGenerator.tsx'\nimport { staticClassClientGenerator } from './generators/staticClassClientGenerator.tsx'\nimport { source as axiosClientSource } from './templates/clients/axios.source.ts'\nimport { source as fetchClientSource } from './templates/clients/fetch.source.ts'\nimport { source as configSource } from './templates/config.source.ts'\nimport type { PluginClient } from './types.ts'\n\nexport const pluginClientName = 'plugin-client' satisfies PluginClient['name']\n\nexport const pluginClient = definePlugin<PluginClient>((options) => {\n const {\n output = { path: 'clients', barrelType: 'named' },\n group,\n urlType = false,\n exclude = [],\n include,\n override = [],\n transformers = {},\n dataReturnType = 'data',\n paramsType = 'inline',\n pathParamsType = paramsType === 'object' ? 'object' : options.pathParamsType || 'inline',\n operations = false,\n baseURL,\n paramsCasing,\n clientType = 'function',\n parser = 'client',\n client = 'axios',\n importPath,\n contentType,\n bundle = false,\n } = options\n\n const resolvedImportPath = importPath ?? (!bundle ? `@kubb/plugin-client/clients/${client}` : undefined)\n\n const defaultGenerators = [\n clientType === 'staticClass' ? staticClassClientGenerator : clientType === 'class' ? classClientGenerator : clientGenerator,\n group && clientType === 'function' ? groupedClientGenerator : undefined,\n operations ? operationsGenerator : undefined,\n ].filter(Boolean)\n\n const generators = options.generators ?? defaultGenerators\n\n return {\n name: pluginClientName,\n options: {\n client,\n clientType,\n bundle,\n output,\n group,\n parser,\n dataReturnType,\n importPath: resolvedImportPath,\n paramsType,\n paramsCasing,\n pathParamsType,\n baseURL,\n urlType,\n },\n pre: [pluginOasName, 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 ?? 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 const resolvedName = camelCase(name, { isFile: type === 'file' })\n\n if (type) {\n return transformers?.name?.(resolvedName, type) || resolvedName\n }\n\n return resolvedName\n },\n async install() {\n const root = path.resolve(this.config.root, this.config.output.path)\n const mode = getMode(path.resolve(root, output.path))\n const oas = await this.getOas()\n const baseURL = await this.getBaseURL()\n\n // pre add bundled fetch\n if (bundle && !this.plugin.options.importPath) {\n await this.addFile({\n baseName: 'fetch.ts',\n path: path.resolve(root, '.kubb/fetch.ts'),\n sources: [\n {\n name: 'fetch',\n value: this.plugin.options.client === 'fetch' ? fetchClientSource : axiosClientSource,\n isExportable: true,\n isIndexable: true,\n },\n ],\n imports: [],\n exports: [],\n })\n }\n\n await this.addFile({\n baseName: 'config.ts',\n path: path.resolve(root, '.kubb/config.ts'),\n sources: [\n {\n name: 'config',\n value: configSource,\n isExportable: false,\n isIndexable: false,\n },\n ],\n imports: [],\n exports: [],\n })\n\n const operationGenerator = new OperationGenerator(\n baseURL\n ? {\n ...this.plugin.options,\n baseURL,\n }\n : this.plugin.options,\n {\n fabric: this.fabric,\n oas,\n pluginManager: this.pluginManager,\n events: this.events,\n plugin: this.plugin,\n contentType,\n exclude,\n include,\n override,\n mode,\n },\n )\n\n const files = await operationGenerator.build(...generators)\n\n await this.upsertFile(...files)\n\n const barrelFiles = await getBarrelFiles(this.fabric.files, {\n type: output.barrelType ?? 'named',\n root,\n output,\n meta: {\n pluginKey: this.plugin.key,\n },\n })\n\n await this.upsertFile(...barrelFiles)\n },\n }\n})\n"],"mappings":"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"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as __name } from "./chunk-
|
|
1
|
+
import { t as __name } from "./chunk-DOWcaBl9.cjs";
|
|
2
2
|
import { Oas, contentType } from "@kubb/oas";
|
|
3
3
|
import { Exclude, Include, Override, ResolvePathOptions } from "@kubb/plugin-oas";
|
|
4
4
|
import { Group, Output, PluginFactoryOptions, ResolveNameParams } from "@kubb/core";
|
|
@@ -157,4 +157,4 @@ type ResolvedOptions = {
|
|
|
157
157
|
type PluginClient = PluginFactoryOptions<'plugin-client', Options, ResolvedOptions, never, ResolvePathOptions>;
|
|
158
158
|
//#endregion
|
|
159
159
|
export { Options as n, PluginClient as r, ClientImportPath as t };
|
|
160
|
-
//# sourceMappingURL=types-
|
|
160
|
+
//# sourceMappingURL=types-B-chJOb6.d.cts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as __name } from "./chunk-
|
|
1
|
+
import { t as __name } from "./chunk-Cd3iupn7.js";
|
|
2
2
|
import { Group, Output, PluginFactoryOptions, ResolveNameParams } from "@kubb/core";
|
|
3
3
|
import { Exclude, Include, Override, ResolvePathOptions } from "@kubb/plugin-oas";
|
|
4
4
|
import { Generator } from "@kubb/plugin-oas/generators";
|
|
@@ -157,4 +157,4 @@ type ResolvedOptions = {
|
|
|
157
157
|
type PluginClient = PluginFactoryOptions<'plugin-client', Options, ResolvedOptions, never, ResolvePathOptions>;
|
|
158
158
|
//#endregion
|
|
159
159
|
export { Options as n, PluginClient as r, ClientImportPath as t };
|
|
160
|
-
//# sourceMappingURL=types-
|
|
160
|
+
//# sourceMappingURL=types-BCu9gRSm.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kubb/plugin-client",
|
|
3
|
-
"version": "4.27.
|
|
3
|
+
"version": "4.27.4",
|
|
4
4
|
"description": "API client generator plugin for Kubb, creating type-safe HTTP clients (Axios, Fetch) from OpenAPI specifications for making API requests.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"api-client",
|
|
@@ -50,6 +50,18 @@
|
|
|
50
50
|
"import": "./dist/clients/fetch.js",
|
|
51
51
|
"require": "./dist/clients/fetch.cjs"
|
|
52
52
|
},
|
|
53
|
+
"./templates/config.source": {
|
|
54
|
+
"import": "./dist/templates/config.source.js",
|
|
55
|
+
"require": "./dist/templates/config.source.cjs"
|
|
56
|
+
},
|
|
57
|
+
"./templates/clients/axios.source": {
|
|
58
|
+
"import": "./dist/templates/clients/axios.source.js",
|
|
59
|
+
"require": "./dist/templates/clients/axios.source.cjs"
|
|
60
|
+
},
|
|
61
|
+
"./templates/clients/fetch.source": {
|
|
62
|
+
"import": "./dist/templates/clients/fetch.source.js",
|
|
63
|
+
"require": "./dist/templates/clients/fetch.source.cjs"
|
|
64
|
+
},
|
|
53
65
|
"./templates/*": "./templates/*",
|
|
54
66
|
"./package.json": "./package.json"
|
|
55
67
|
},
|
|
@@ -69,6 +81,15 @@
|
|
|
69
81
|
],
|
|
70
82
|
"clients/fetch": [
|
|
71
83
|
"./dist/clients/fetch.d.ts"
|
|
84
|
+
],
|
|
85
|
+
"templates/config.source": [
|
|
86
|
+
"./dist/templates/config.source.d.ts"
|
|
87
|
+
],
|
|
88
|
+
"templates/clients/axios.source": [
|
|
89
|
+
"./dist/templates/clients/axios.source.d.ts"
|
|
90
|
+
],
|
|
91
|
+
"templates/clients/fetch.source": [
|
|
92
|
+
"./dist/templates/clients/fetch.source.d.ts"
|
|
72
93
|
]
|
|
73
94
|
}
|
|
74
95
|
},
|
|
@@ -90,11 +111,11 @@
|
|
|
90
111
|
],
|
|
91
112
|
"dependencies": {
|
|
92
113
|
"@kubb/react-fabric": "0.12.11",
|
|
93
|
-
"@kubb/core": "4.27.
|
|
94
|
-
"@kubb/oas": "4.27.
|
|
95
|
-
"@kubb/plugin-
|
|
96
|
-
"@kubb/plugin-
|
|
97
|
-
"@kubb/
|
|
114
|
+
"@kubb/core": "4.27.4",
|
|
115
|
+
"@kubb/plugin-oas": "4.27.4",
|
|
116
|
+
"@kubb/plugin-ts": "4.27.4",
|
|
117
|
+
"@kubb/plugin-zod": "4.27.4",
|
|
118
|
+
"@kubb/oas": "4.27.4"
|
|
98
119
|
},
|
|
99
120
|
"devDependencies": {
|
|
100
121
|
"axios": "^1.13.5"
|
package/src/plugin.ts
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import path from 'node:path'
|
|
2
2
|
import { definePlugin, type Group, getBarrelFiles, getMode } from '@kubb/core'
|
|
3
3
|
import { camelCase } from '@kubb/core/transformers'
|
|
4
|
-
import { resolveModuleSource } from '@kubb/core/utils'
|
|
5
4
|
import { OperationGenerator, pluginOasName } from '@kubb/plugin-oas'
|
|
6
5
|
import { pluginZodName } from '@kubb/plugin-zod'
|
|
7
6
|
import { classClientGenerator, operationsGenerator } from './generators'
|
|
8
7
|
import { clientGenerator } from './generators/clientGenerator.tsx'
|
|
9
8
|
import { groupedClientGenerator } from './generators/groupedClientGenerator.tsx'
|
|
10
9
|
import { staticClassClientGenerator } from './generators/staticClassClientGenerator.tsx'
|
|
10
|
+
import { source as axiosClientSource } from './templates/clients/axios.source.ts'
|
|
11
|
+
import { source as fetchClientSource } from './templates/clients/fetch.source.ts'
|
|
12
|
+
import { source as configSource } from './templates/config.source.ts'
|
|
11
13
|
import type { PluginClient } from './types.ts'
|
|
12
14
|
|
|
13
15
|
export const pluginClientName = 'plugin-client' satisfies PluginClient['name']
|
|
@@ -120,9 +122,7 @@ export const pluginClient = definePlugin<PluginClient>((options) => {
|
|
|
120
122
|
sources: [
|
|
121
123
|
{
|
|
122
124
|
name: 'fetch',
|
|
123
|
-
value:
|
|
124
|
-
this.plugin.options.client === 'fetch' ? '@kubb/plugin-client/templates/clients/fetch' : '@kubb/plugin-client/templates/clients/axios',
|
|
125
|
-
).source,
|
|
125
|
+
value: this.plugin.options.client === 'fetch' ? fetchClientSource : axiosClientSource,
|
|
126
126
|
isExportable: true,
|
|
127
127
|
isIndexable: true,
|
|
128
128
|
},
|
|
@@ -138,7 +138,7 @@ export const pluginClient = definePlugin<PluginClient>((options) => {
|
|
|
138
138
|
sources: [
|
|
139
139
|
{
|
|
140
140
|
name: 'config',
|
|
141
|
-
value:
|
|
141
|
+
value: configSource,
|
|
142
142
|
isExportable: false,
|
|
143
143
|
isIndexable: false,
|
|
144
144
|
},
|
|
File without changes
|