@kubb/plugin-client 3.0.0-alpha.0

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.
@@ -0,0 +1,29 @@
1
+ import * as axios from 'axios';
2
+ import { AxiosRequestConfig, AxiosResponse } from 'axios';
3
+
4
+ /**
5
+ * Subset of AxiosRequestConfig
6
+ */
7
+ type RequestConfig<TData = unknown> = {
8
+ baseURL?: string;
9
+ url?: string;
10
+ method: 'get' | 'put' | 'patch' | 'post' | 'delete';
11
+ params?: unknown;
12
+ data?: TData;
13
+ responseType?: 'arraybuffer' | 'blob' | 'document' | 'json' | 'text' | 'stream';
14
+ signal?: AbortSignal;
15
+ headers?: AxiosRequestConfig['headers'];
16
+ };
17
+ /**
18
+ * Subset of AxiosResponse
19
+ */
20
+ type ResponseConfig<TData = unknown> = {
21
+ data: TData;
22
+ status: number;
23
+ statusText: string;
24
+ headers?: AxiosResponse['headers'];
25
+ };
26
+ declare const axiosInstance: axios.AxiosInstance;
27
+ declare const axiosClient: <TData, TError = unknown, TVariables = unknown>(config: RequestConfig<TVariables>) => Promise<ResponseConfig<TData>>;
28
+
29
+ export { type RequestConfig, type ResponseConfig, axiosClient, axiosInstance, axiosClient as default };
@@ -0,0 +1,29 @@
1
+ import * as axios from 'axios';
2
+ import { AxiosRequestConfig, AxiosResponse } from 'axios';
3
+
4
+ /**
5
+ * Subset of AxiosRequestConfig
6
+ */
7
+ type RequestConfig<TData = unknown> = {
8
+ baseURL?: string;
9
+ url?: string;
10
+ method: 'get' | 'put' | 'patch' | 'post' | 'delete';
11
+ params?: unknown;
12
+ data?: TData;
13
+ responseType?: 'arraybuffer' | 'blob' | 'document' | 'json' | 'text' | 'stream';
14
+ signal?: AbortSignal;
15
+ headers?: AxiosRequestConfig['headers'];
16
+ };
17
+ /**
18
+ * Subset of AxiosResponse
19
+ */
20
+ type ResponseConfig<TData = unknown> = {
21
+ data: TData;
22
+ status: number;
23
+ statusText: string;
24
+ headers?: AxiosResponse['headers'];
25
+ };
26
+ declare const axiosInstance: axios.AxiosInstance;
27
+ declare const axiosClient: <TData, TError = unknown, TVariables = unknown>(config: RequestConfig<TVariables>) => Promise<ResponseConfig<TData>>;
28
+
29
+ export { type RequestConfig, type ResponseConfig, axiosClient, axiosInstance, axiosClient as default };
package/dist/client.js ADDED
@@ -0,0 +1,19 @@
1
+ // client.ts
2
+ import axios from "axios";
3
+ var axiosInstance = axios.create({
4
+ baseURL: typeof AXIOS_BASE !== "undefined" ? AXIOS_BASE : void 0,
5
+ headers: typeof AXIOS_HEADERS !== "undefined" ? JSON.parse(AXIOS_HEADERS) : void 0
6
+ });
7
+ var axiosClient = async (config) => {
8
+ const promise = axiosInstance.request(config).catch((e) => {
9
+ throw e;
10
+ });
11
+ return promise;
12
+ };
13
+ var client_default = axiosClient;
14
+ export {
15
+ axiosClient,
16
+ axiosInstance,
17
+ client_default as default
18
+ };
19
+ //# sourceMappingURL=client.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../client.ts"],"sourcesContent":["import axios from 'axios'\n\nimport type { AxiosError, AxiosHeaders, AxiosRequestConfig, AxiosResponse } from 'axios'\n\ndeclare const AXIOS_BASE: string\ndeclare const AXIOS_HEADERS: string\n\n/**\n * Subset of AxiosRequestConfig\n */\nexport type RequestConfig<TData = unknown> = {\n baseURL?: string\n url?: string\n method: 'get' | 'put' | 'patch' | 'post' | 'delete'\n params?: unknown\n data?: TData\n responseType?: 'arraybuffer' | 'blob' | 'document' | 'json' | 'text' | 'stream'\n signal?: AbortSignal\n headers?: AxiosRequestConfig['headers']\n}\n/**\n * Subset of AxiosResponse\n */\nexport type ResponseConfig<TData = unknown> = {\n data: TData\n status: number\n statusText: string\n headers?: AxiosResponse['headers']\n}\n\nexport const axiosInstance = axios.create({\n baseURL: typeof AXIOS_BASE !== 'undefined' ? AXIOS_BASE : undefined,\n headers: typeof AXIOS_HEADERS !== 'undefined' ? (JSON.parse(AXIOS_HEADERS) as AxiosHeaders) : undefined,\n})\n\nexport const axiosClient = async <TData, TError = unknown, TVariables = unknown>(config: RequestConfig<TVariables>): Promise<ResponseConfig<TData>> => {\n const promise = axiosInstance.request<TData, ResponseConfig<TData>>(config).catch((e: AxiosError<TError>) => {\n throw e\n })\n\n return promise\n}\n\nexport default axiosClient\n"],"mappings":";AAAA,OAAO,WAAW;AA8BX,IAAM,gBAAgB,MAAM,OAAO;AAAA,EACxC,SAAS,OAAO,eAAe,cAAc,aAAa;AAAA,EAC1D,SAAS,OAAO,kBAAkB,cAAe,KAAK,MAAM,aAAa,IAAqB;AAChG,CAAC;AAEM,IAAM,cAAc,OAAsD,WAAsE;AACrJ,QAAM,UAAU,cAAc,QAAsC,MAAM,EAAE,MAAM,CAAC,MAA0B;AAC3G,UAAM;AAAA,EACR,CAAC;AAED,SAAO;AACT;AAEA,IAAO,iBAAQ;","names":[]}
@@ -0,0 +1,9 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+
4
+ var _chunkW7F5CMU6cjs = require('./chunk-W7F5CMU6.cjs');
5
+
6
+
7
+
8
+ exports.Client = _chunkW7F5CMU6cjs.Client; exports.Operations = _chunkW7F5CMU6cjs.Operations;
9
+ //# sourceMappingURL=components.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["/home/runner/work/kubb/kubb/packages/plugin-client/dist/components.cjs"],"names":[],"mappings":"AAAA;AACE;AACA;AACF,wDAA6B;AAC7B;AACE;AACA;AACF,6FAAC","file":"/home/runner/work/kubb/kubb/packages/plugin-client/dist/components.cjs"}
@@ -0,0 +1,8 @@
1
+ export { C as Client, a as Operations } from './types-DWYt1NR3.cjs';
2
+ import '@kubb/core';
3
+ import '@kubb/fs/types';
4
+ import '@kubb/plugin-oas';
5
+ import '@kubb/core/utils';
6
+ import '@kubb/oas';
7
+ import '@kubb/react';
8
+ import 'react';
@@ -0,0 +1,8 @@
1
+ export { C as Client, a as Operations } from './types-DWYt1NR3.js';
2
+ import '@kubb/core';
3
+ import '@kubb/fs/types';
4
+ import '@kubb/plugin-oas';
5
+ import '@kubb/core/utils';
6
+ import '@kubb/oas';
7
+ import '@kubb/react';
8
+ import 'react';
@@ -0,0 +1,9 @@
1
+ import {
2
+ Client,
3
+ Operations
4
+ } from "./chunk-W57BRY5O.js";
5
+ export {
6
+ Client,
7
+ Operations
8
+ };
9
+ //# sourceMappingURL=components.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
package/dist/index.cjs ADDED
@@ -0,0 +1,168 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
2
+
3
+
4
+ var _chunkW7F5CMU6cjs = require('./chunk-W7F5CMU6.cjs');
5
+
6
+ // src/plugin.ts
7
+ var _path = require('path'); var _path2 = _interopRequireDefault(_path);
8
+ var _core = require('@kubb/core');
9
+ var _transformers = require('@kubb/core/transformers');
10
+ var _utils = require('@kubb/core/utils');
11
+ var _pluginoas = require('@kubb/plugin-oas');
12
+ var _utils3 = require('@kubb/plugin-oas/utils');
13
+
14
+ // src/OperationGenerator.tsx
15
+
16
+ var _components = require('@kubb/plugin-oas/components');
17
+ var _react = require('@kubb/react');
18
+ var _jsxruntime = require('@kubb/react/jsx-runtime');
19
+ var OperationGenerator = class extends _pluginoas.OperationGenerator {
20
+ async all(operations, _operationsByMethod) {
21
+ const { pluginManager, oas, plugin, mode } = this.context;
22
+ const root = _react.createRoot.call(void 0, {
23
+ logger: pluginManager.logger
24
+ });
25
+ const templates = {
26
+ operations: _chunkW7F5CMU6cjs.Operations.templates,
27
+ client: _chunkW7F5CMU6cjs.Client.templates,
28
+ ...this.options.templates
29
+ };
30
+ root.render(
31
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _react.App, { pluginManager, plugin, mode, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _components.Oas, { oas, operations, generator: this, children: templates.operations && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkW7F5CMU6cjs.Operations.File, { baseURL: this.options.baseURL, templates: templates.operations }) }) })
32
+ );
33
+ return root.files;
34
+ }
35
+ async operation(operation, options) {
36
+ const { oas, pluginManager, plugin, mode } = this.context;
37
+ const root = _react.createRoot.call(void 0, {
38
+ logger: pluginManager.logger
39
+ });
40
+ const templates = {
41
+ operations: _chunkW7F5CMU6cjs.Operations.templates,
42
+ client: _chunkW7F5CMU6cjs.Client.templates,
43
+ ...options.templates
44
+ };
45
+ if (!templates.client) {
46
+ return [];
47
+ }
48
+ root.render(
49
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _react.App, { pluginManager, plugin: { ...plugin, options }, mode, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _components.Oas, { oas, operations: [operation], generator: this, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _components.Oas.Operation, { operation, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkW7F5CMU6cjs.Client.File, { baseURL: this.options.baseURL, templates: templates.client }) }) }) })
50
+ );
51
+ return root.files;
52
+ }
53
+ };
54
+
55
+ // src/plugin.ts
56
+ var pluginClientName = "plugin-client";
57
+ var pluginClient = _core.createPlugin.call(void 0, (options) => {
58
+ const {
59
+ output = { path: "clients" },
60
+ group,
61
+ exclude = [],
62
+ include,
63
+ override = [],
64
+ transformers = {},
65
+ dataReturnType = "data",
66
+ pathParamsType = "inline",
67
+ templates
68
+ } = options;
69
+ const template = _optionalChain([group, 'optionalAccess', _ => _.output]) ? group.output : `${output.path}/{{tag}}Controller`;
70
+ return {
71
+ name: pluginClientName,
72
+ options: {
73
+ extName: output.extName,
74
+ dataReturnType,
75
+ client: {
76
+ importPath: "@kubb/plugin-client/client",
77
+ ...options.client
78
+ },
79
+ pathParamsType,
80
+ templates: {
81
+ operations: _chunkW7F5CMU6cjs.Operations.templates,
82
+ client: _chunkW7F5CMU6cjs.Client.templates,
83
+ ...templates
84
+ },
85
+ baseURL: void 0
86
+ },
87
+ pre: [_pluginoas.pluginOasName],
88
+ resolvePath(baseName, pathMode, options2) {
89
+ const root = _path2.default.resolve(this.config.root, this.config.output.path);
90
+ const mode = _nullishCoalesce(pathMode, () => ( _core.FileManager.getMode(_path2.default.resolve(root, output.path))));
91
+ if (mode === "single") {
92
+ return _path2.default.resolve(root, output.path);
93
+ }
94
+ if (_optionalChain([options2, 'optionalAccess', _2 => _2.tag]) && _optionalChain([group, 'optionalAccess', _3 => _3.type]) === "tag") {
95
+ const tag = _transformers.camelCase.call(void 0, options2.tag);
96
+ return _path2.default.resolve(root, _utils.renderTemplate.call(void 0, template, { tag }), baseName);
97
+ }
98
+ return _path2.default.resolve(root, output.path, baseName);
99
+ },
100
+ resolveName(name, type) {
101
+ const resolvedName = _transformers.camelCase.call(void 0, name, { isFile: type === "file" });
102
+ if (type) {
103
+ return _optionalChain([transformers, 'optionalAccess', _4 => _4.name, 'optionalCall', _5 => _5(resolvedName, type)]) || resolvedName;
104
+ }
105
+ return resolvedName;
106
+ },
107
+ async writeFile(path2, source) {
108
+ if (!source) {
109
+ return;
110
+ }
111
+ return this.fileManager.write(path2, source, { sanity: false });
112
+ },
113
+ async buildStart() {
114
+ const [swaggerPlugin] = _core.PluginManager.getDependedPlugins(this.plugins, [_pluginoas.pluginOasName]);
115
+ const oas = await swaggerPlugin.api.getOas();
116
+ const root = _path2.default.resolve(this.config.root, this.config.output.path);
117
+ const mode = _core.FileManager.getMode(_path2.default.resolve(root, output.path));
118
+ const baseURL = await swaggerPlugin.api.getBaseURL();
119
+ const operationGenerator = new OperationGenerator(
120
+ {
121
+ ...this.plugin.options,
122
+ baseURL
123
+ },
124
+ {
125
+ oas,
126
+ pluginManager: this.pluginManager,
127
+ plugin: this.plugin,
128
+ contentType: swaggerPlugin.api.contentType,
129
+ exclude,
130
+ include,
131
+ override,
132
+ mode
133
+ }
134
+ );
135
+ const files = await operationGenerator.build();
136
+ await this.addFile(...files);
137
+ },
138
+ async buildEnd() {
139
+ if (this.config.output.write === false) {
140
+ return;
141
+ }
142
+ const root = _path2.default.resolve(this.config.root, this.config.output.path);
143
+ if (_optionalChain([group, 'optionalAccess', _6 => _6.type]) === "tag") {
144
+ const rootFiles = await _utils3.getGroupedByTagFiles.call(void 0, {
145
+ logger: this.logger,
146
+ files: this.fileManager.files,
147
+ plugin: this.plugin,
148
+ template,
149
+ exportAs: group.exportAs || "{{tag}}Service",
150
+ root,
151
+ output
152
+ });
153
+ await this.addFile(...rootFiles);
154
+ }
155
+ await this.fileManager.addIndexes({
156
+ root,
157
+ output,
158
+ meta: { pluginKey: this.plugin.key },
159
+ logger: this.logger
160
+ });
161
+ }
162
+ };
163
+ });
164
+
165
+
166
+
167
+ exports.pluginClient = pluginClient; exports.pluginClientName = pluginClientName;
168
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["/home/runner/work/kubb/kubb/packages/plugin-client/dist/index.cjs","../src/plugin.ts","../src/OperationGenerator.tsx"],"names":[],"mappings":"AAAA;AACE;AACA;AACF,wDAA6B;AAC7B;AACA;ACLA,wEAAiB;AAEjB,kCAAyD;AACzD,uDAA0B;AAC1B,yCAA+B;AAC/B,6CAA8B;AAC9B,gDAAqC;ADMrC;AACA;AEbA;AACA,yDAAoB;AACpB,oCAAgC;AAyBG,qDAAA;AAjB5B,IAAM,mBAAA,EAAN,MAAA,QAAiC,8BAAyD;AAAA,EAC/F,MAAM,GAAA,CAA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C,IAAA;AACG,IAAA;AACS,MAAA;AAChB,MAAA;AACQ,MAAA;AACM,QAAA;AACD,QAAA;AACb,MAAA;AACA,MAAA;AACW,MAAA;AACc,QAAA;AACR,QAAA;AACZ,QAAA;AACL,MAAA;AACS,MAAA;AACX,IAAA;AACmB,IAAA;AACsB,IAAA;AACK,MAAA;AACC,MAAA;AAEtB,MAAA;AAKgB,QAAA;AACvC,MAAA;AAE2C,MAAA;AACR,QAAA;AAEQ,QAAA;AAC3C,MAAA;AAEuC,MAAA;AACzC,IAAA;AACwB,IAAA;AACiB,MAAA;AAE7B,MAAA;AACkC,QAAA;AAC5C,MAAA;AAEO,MAAA;AACT,IAAA;AAC8B,IAAA;AACf,MAAA;AACX,QAAA;AACF,MAAA;AAE4C,MAAA;AAC9C,IAAA;AACmB,IAAA;AACqD,MAAA;AAE3B,MAAA;AACC,MAAA;AACN,MAAA;AACE,MAAA;AAET,MAAA;AAC7B,QAAA;AACiB,UAAA;AACf,UAAA;AACF,QAAA;AACA,QAAA;AACE,UAAA;AACoB,UAAA;AACP,UAAA;AACkB,UAAA;AAC/B,UAAA;AACA,UAAA;AACA,UAAA;AACA,UAAA;AACF,QAAA;AACF,MAAA;AAE6C,MAAA;AAElB,MAAA;AAC7B,IAAA;AACiB,IAAA;AACyB,MAAA;AACtC,QAAA;AACF,MAAA;AAE4C,MAAA;AAEjB,MAAA;AACD,QAAA;AACT,UAAA;AACW,UAAA;AACX,UAAA;AACb,UAAA;AAC4B,UAAA;AAC5B,UAAA;AACA,UAAA;AACD,QAAA;AAE8B,QAAA;AACjC,MAAA;AAEkC,MAAA;AAChC,QAAA;AACA,QAAA;AACmC,QAAA;AACtB,QAAA;AACd,MAAA;AACH,IAAA;AACF,EAAA;AACD;ADmBkD;AACA;AACA;AACA","file":"/home/runner/work/kubb/kubb/packages/plugin-client/dist/index.cjs","sourcesContent":[null,"import path from 'node:path'\n\nimport { FileManager, PluginManager, createPlugin } from '@kubb/core'\nimport { camelCase } from '@kubb/core/transformers'\nimport { renderTemplate } from '@kubb/core/utils'\nimport { pluginOasName } from '@kubb/plugin-oas'\nimport { getGroupedByTagFiles } from '@kubb/plugin-oas/utils'\n\nimport { OperationGenerator } from './OperationGenerator.tsx'\nimport { Client, Operations } from './components/index.ts'\n\nimport type { Plugin } from '@kubb/core'\nimport type { PluginOas as SwaggerPluginOptions } from '@kubb/plugin-oas'\nimport type { PluginClient } from './types.ts'\n\nexport const pluginClientName = 'plugin-client' satisfies PluginClient['name']\n\nexport const pluginClient = createPlugin<PluginClient>((options) => {\n const {\n output = { path: 'clients' },\n group,\n exclude = [],\n include,\n override = [],\n transformers = {},\n dataReturnType = 'data',\n pathParamsType = 'inline',\n templates,\n } = options\n\n const template = group?.output ? group.output : `${output.path}/{{tag}}Controller`\n\n return {\n name: pluginClientName,\n options: {\n extName: output.extName,\n dataReturnType,\n client: {\n importPath: '@kubb/plugin-client/client',\n ...options.client,\n },\n pathParamsType,\n templates: {\n operations: Operations.templates,\n client: Client.templates,\n ...templates,\n },\n baseURL: undefined,\n },\n pre: [pluginOasName],\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 (options?.tag && group?.type === 'tag') {\n const tag = camelCase(options.tag)\n\n return path.resolve(root, renderTemplate(template, { tag }), baseName)\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 writeFile(path, source) {\n if (!source) {\n return\n }\n\n return this.fileManager.write(path, source, { sanity: false })\n },\n async buildStart() {\n const [swaggerPlugin]: [Plugin<SwaggerPluginOptions>] = PluginManager.getDependedPlugins<SwaggerPluginOptions>(this.plugins, [pluginOasName])\n\n const oas = await swaggerPlugin.api.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.api.getBaseURL()\n\n const operationGenerator = new OperationGenerator(\n {\n ...this.plugin.options,\n baseURL,\n },\n {\n oas,\n pluginManager: this.pluginManager,\n plugin: this.plugin,\n contentType: swaggerPlugin.api.contentType,\n exclude,\n include,\n override,\n mode,\n },\n )\n\n const files = await operationGenerator.build()\n\n await this.addFile(...files)\n },\n async buildEnd() {\n if (this.config.output.write === false) {\n return\n }\n\n const root = path.resolve(this.config.root, this.config.output.path)\n\n if (group?.type === 'tag') {\n const rootFiles = await getGroupedByTagFiles({\n logger: this.logger,\n files: this.fileManager.files,\n plugin: this.plugin,\n template,\n exportAs: group.exportAs || '{{tag}}Service',\n root,\n output,\n })\n\n await this.addFile(...rootFiles)\n }\n\n await this.fileManager.addIndexes({\n root,\n output,\n meta: { pluginKey: this.plugin.key },\n logger: this.logger,\n })\n },\n }\n})\n","import { OperationGenerator as Generator } from '@kubb/plugin-oas'\nimport { Oas } from '@kubb/plugin-oas/components'\nimport { App, createRoot } from '@kubb/react'\n\nimport { Client, Operations } from './components/index.ts'\n\nimport type { Operation } from '@kubb/oas'\nimport type { OperationMethodResult, OperationsByMethod } from '@kubb/plugin-oas'\nimport type { FileMeta, PluginClient } from './types.ts'\n\nexport class OperationGenerator extends Generator<PluginClient['resolvedOptions'], PluginClient> {\n async all(operations: Operation[], _operationsByMethod: OperationsByMethod): OperationMethodResult<FileMeta> {\n const { pluginManager, oas, plugin, mode } = this.context\n\n const root = createRoot({\n logger: pluginManager.logger,\n })\n\n const templates = {\n operations: Operations.templates,\n client: Client.templates,\n ...this.options.templates,\n }\n\n root.render(\n <App pluginManager={pluginManager} plugin={plugin} mode={mode}>\n <Oas oas={oas} operations={operations} generator={this}>\n {templates.operations && <Operations.File baseURL={this.options.baseURL} templates={templates.operations} />}\n </Oas>\n </App>,\n )\n\n return root.files\n }\n\n async operation(operation: Operation, options: PluginClient['resolvedOptions']): OperationMethodResult<FileMeta> {\n const { oas, pluginManager, plugin, mode } = this.context\n\n const root = createRoot({\n logger: pluginManager.logger,\n })\n\n const templates = {\n operations: Operations.templates,\n client: Client.templates,\n ...options.templates,\n }\n\n if (!templates.client) {\n return []\n }\n\n root.render(\n <App pluginManager={pluginManager} plugin={{ ...plugin, options }} mode={mode}>\n <Oas oas={oas} operations={[operation]} generator={this}>\n <Oas.Operation operation={operation}>\n <Client.File baseURL={this.options.baseURL} templates={templates.client} />\n </Oas.Operation>\n </Oas>\n </App>,\n )\n\n return root.files\n }\n}\n"]}
@@ -0,0 +1,13 @@
1
+ import * as _kubb_core from '@kubb/core';
2
+ import { O as Options, P as PluginClient } from './types-DWYt1NR3.cjs';
3
+ import '@kubb/fs/types';
4
+ import '@kubb/plugin-oas';
5
+ import '@kubb/core/utils';
6
+ import '@kubb/oas';
7
+ import '@kubb/react';
8
+ import 'react';
9
+
10
+ declare const pluginClientName = "plugin-client";
11
+ declare const pluginClient: (options?: Options | undefined) => _kubb_core.UserPluginWithLifeCycle<PluginClient>;
12
+
13
+ export { PluginClient, pluginClient, pluginClientName };
@@ -0,0 +1,13 @@
1
+ import * as _kubb_core from '@kubb/core';
2
+ import { O as Options, P as PluginClient } from './types-DWYt1NR3.js';
3
+ import '@kubb/fs/types';
4
+ import '@kubb/plugin-oas';
5
+ import '@kubb/core/utils';
6
+ import '@kubb/oas';
7
+ import '@kubb/react';
8
+ import 'react';
9
+
10
+ declare const pluginClientName = "plugin-client";
11
+ declare const pluginClient: (options?: Options | undefined) => _kubb_core.UserPluginWithLifeCycle<PluginClient>;
12
+
13
+ export { PluginClient, pluginClient, pluginClientName };
package/dist/index.js ADDED
@@ -0,0 +1,168 @@
1
+ import {
2
+ Client,
3
+ Operations
4
+ } from "./chunk-W57BRY5O.js";
5
+
6
+ // src/plugin.ts
7
+ import path from "path";
8
+ import { FileManager, PluginManager, createPlugin } from "@kubb/core";
9
+ import { camelCase } from "@kubb/core/transformers";
10
+ import { renderTemplate } from "@kubb/core/utils";
11
+ import { pluginOasName } from "@kubb/plugin-oas";
12
+ import { getGroupedByTagFiles } from "@kubb/plugin-oas/utils";
13
+
14
+ // src/OperationGenerator.tsx
15
+ import { OperationGenerator as Generator } from "@kubb/plugin-oas";
16
+ import { Oas } from "@kubb/plugin-oas/components";
17
+ import { App, createRoot } from "@kubb/react";
18
+ import { jsx } from "@kubb/react/jsx-runtime";
19
+ var OperationGenerator = class extends Generator {
20
+ async all(operations, _operationsByMethod) {
21
+ const { pluginManager, oas, plugin, mode } = this.context;
22
+ const root = createRoot({
23
+ logger: pluginManager.logger
24
+ });
25
+ const templates = {
26
+ operations: Operations.templates,
27
+ client: Client.templates,
28
+ ...this.options.templates
29
+ };
30
+ root.render(
31
+ /* @__PURE__ */ jsx(App, { pluginManager, plugin, mode, children: /* @__PURE__ */ jsx(Oas, { oas, operations, generator: this, children: templates.operations && /* @__PURE__ */ jsx(Operations.File, { baseURL: this.options.baseURL, templates: templates.operations }) }) })
32
+ );
33
+ return root.files;
34
+ }
35
+ async operation(operation, options) {
36
+ const { oas, pluginManager, plugin, mode } = this.context;
37
+ const root = createRoot({
38
+ logger: pluginManager.logger
39
+ });
40
+ const templates = {
41
+ operations: Operations.templates,
42
+ client: Client.templates,
43
+ ...options.templates
44
+ };
45
+ if (!templates.client) {
46
+ return [];
47
+ }
48
+ root.render(
49
+ /* @__PURE__ */ jsx(App, { pluginManager, plugin: { ...plugin, options }, mode, children: /* @__PURE__ */ jsx(Oas, { oas, operations: [operation], generator: this, children: /* @__PURE__ */ jsx(Oas.Operation, { operation, children: /* @__PURE__ */ jsx(Client.File, { baseURL: this.options.baseURL, templates: templates.client }) }) }) })
50
+ );
51
+ return root.files;
52
+ }
53
+ };
54
+
55
+ // src/plugin.ts
56
+ var pluginClientName = "plugin-client";
57
+ var pluginClient = createPlugin((options) => {
58
+ const {
59
+ output = { path: "clients" },
60
+ group,
61
+ exclude = [],
62
+ include,
63
+ override = [],
64
+ transformers = {},
65
+ dataReturnType = "data",
66
+ pathParamsType = "inline",
67
+ templates
68
+ } = options;
69
+ const template = group?.output ? group.output : `${output.path}/{{tag}}Controller`;
70
+ return {
71
+ name: pluginClientName,
72
+ options: {
73
+ extName: output.extName,
74
+ dataReturnType,
75
+ client: {
76
+ importPath: "@kubb/plugin-client/client",
77
+ ...options.client
78
+ },
79
+ pathParamsType,
80
+ templates: {
81
+ operations: Operations.templates,
82
+ client: Client.templates,
83
+ ...templates
84
+ },
85
+ baseURL: void 0
86
+ },
87
+ pre: [pluginOasName],
88
+ resolvePath(baseName, pathMode, options2) {
89
+ const root = path.resolve(this.config.root, this.config.output.path);
90
+ const mode = pathMode ?? FileManager.getMode(path.resolve(root, output.path));
91
+ if (mode === "single") {
92
+ return path.resolve(root, output.path);
93
+ }
94
+ if (options2?.tag && group?.type === "tag") {
95
+ const tag = camelCase(options2.tag);
96
+ return path.resolve(root, renderTemplate(template, { tag }), baseName);
97
+ }
98
+ return path.resolve(root, output.path, baseName);
99
+ },
100
+ resolveName(name, type) {
101
+ const resolvedName = camelCase(name, { isFile: type === "file" });
102
+ if (type) {
103
+ return transformers?.name?.(resolvedName, type) || resolvedName;
104
+ }
105
+ return resolvedName;
106
+ },
107
+ async writeFile(path2, source) {
108
+ if (!source) {
109
+ return;
110
+ }
111
+ return this.fileManager.write(path2, source, { sanity: false });
112
+ },
113
+ async buildStart() {
114
+ const [swaggerPlugin] = PluginManager.getDependedPlugins(this.plugins, [pluginOasName]);
115
+ const oas = await swaggerPlugin.api.getOas();
116
+ const root = path.resolve(this.config.root, this.config.output.path);
117
+ const mode = FileManager.getMode(path.resolve(root, output.path));
118
+ const baseURL = await swaggerPlugin.api.getBaseURL();
119
+ const operationGenerator = new OperationGenerator(
120
+ {
121
+ ...this.plugin.options,
122
+ baseURL
123
+ },
124
+ {
125
+ oas,
126
+ pluginManager: this.pluginManager,
127
+ plugin: this.plugin,
128
+ contentType: swaggerPlugin.api.contentType,
129
+ exclude,
130
+ include,
131
+ override,
132
+ mode
133
+ }
134
+ );
135
+ const files = await operationGenerator.build();
136
+ await this.addFile(...files);
137
+ },
138
+ async buildEnd() {
139
+ if (this.config.output.write === false) {
140
+ return;
141
+ }
142
+ const root = path.resolve(this.config.root, this.config.output.path);
143
+ if (group?.type === "tag") {
144
+ const rootFiles = await getGroupedByTagFiles({
145
+ logger: this.logger,
146
+ files: this.fileManager.files,
147
+ plugin: this.plugin,
148
+ template,
149
+ exportAs: group.exportAs || "{{tag}}Service",
150
+ root,
151
+ output
152
+ });
153
+ await this.addFile(...rootFiles);
154
+ }
155
+ await this.fileManager.addIndexes({
156
+ root,
157
+ output,
158
+ meta: { pluginKey: this.plugin.key },
159
+ logger: this.logger
160
+ });
161
+ }
162
+ };
163
+ });
164
+ export {
165
+ pluginClient,
166
+ pluginClientName
167
+ };
168
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/plugin.ts","../src/OperationGenerator.tsx"],"sourcesContent":["import path from 'node:path'\n\nimport { FileManager, PluginManager, createPlugin } from '@kubb/core'\nimport { camelCase } from '@kubb/core/transformers'\nimport { renderTemplate } from '@kubb/core/utils'\nimport { pluginOasName } from '@kubb/plugin-oas'\nimport { getGroupedByTagFiles } from '@kubb/plugin-oas/utils'\n\nimport { OperationGenerator } from './OperationGenerator.tsx'\nimport { Client, Operations } from './components/index.ts'\n\nimport type { Plugin } from '@kubb/core'\nimport type { PluginOas as SwaggerPluginOptions } from '@kubb/plugin-oas'\nimport type { PluginClient } from './types.ts'\n\nexport const pluginClientName = 'plugin-client' satisfies PluginClient['name']\n\nexport const pluginClient = createPlugin<PluginClient>((options) => {\n const {\n output = { path: 'clients' },\n group,\n exclude = [],\n include,\n override = [],\n transformers = {},\n dataReturnType = 'data',\n pathParamsType = 'inline',\n templates,\n } = options\n\n const template = group?.output ? group.output : `${output.path}/{{tag}}Controller`\n\n return {\n name: pluginClientName,\n options: {\n extName: output.extName,\n dataReturnType,\n client: {\n importPath: '@kubb/plugin-client/client',\n ...options.client,\n },\n pathParamsType,\n templates: {\n operations: Operations.templates,\n client: Client.templates,\n ...templates,\n },\n baseURL: undefined,\n },\n pre: [pluginOasName],\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 (options?.tag && group?.type === 'tag') {\n const tag = camelCase(options.tag)\n\n return path.resolve(root, renderTemplate(template, { tag }), baseName)\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 writeFile(path, source) {\n if (!source) {\n return\n }\n\n return this.fileManager.write(path, source, { sanity: false })\n },\n async buildStart() {\n const [swaggerPlugin]: [Plugin<SwaggerPluginOptions>] = PluginManager.getDependedPlugins<SwaggerPluginOptions>(this.plugins, [pluginOasName])\n\n const oas = await swaggerPlugin.api.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.api.getBaseURL()\n\n const operationGenerator = new OperationGenerator(\n {\n ...this.plugin.options,\n baseURL,\n },\n {\n oas,\n pluginManager: this.pluginManager,\n plugin: this.plugin,\n contentType: swaggerPlugin.api.contentType,\n exclude,\n include,\n override,\n mode,\n },\n )\n\n const files = await operationGenerator.build()\n\n await this.addFile(...files)\n },\n async buildEnd() {\n if (this.config.output.write === false) {\n return\n }\n\n const root = path.resolve(this.config.root, this.config.output.path)\n\n if (group?.type === 'tag') {\n const rootFiles = await getGroupedByTagFiles({\n logger: this.logger,\n files: this.fileManager.files,\n plugin: this.plugin,\n template,\n exportAs: group.exportAs || '{{tag}}Service',\n root,\n output,\n })\n\n await this.addFile(...rootFiles)\n }\n\n await this.fileManager.addIndexes({\n root,\n output,\n meta: { pluginKey: this.plugin.key },\n logger: this.logger,\n })\n },\n }\n})\n","import { OperationGenerator as Generator } from '@kubb/plugin-oas'\nimport { Oas } from '@kubb/plugin-oas/components'\nimport { App, createRoot } from '@kubb/react'\n\nimport { Client, Operations } from './components/index.ts'\n\nimport type { Operation } from '@kubb/oas'\nimport type { OperationMethodResult, OperationsByMethod } from '@kubb/plugin-oas'\nimport type { FileMeta, PluginClient } from './types.ts'\n\nexport class OperationGenerator extends Generator<PluginClient['resolvedOptions'], PluginClient> {\n async all(operations: Operation[], _operationsByMethod: OperationsByMethod): OperationMethodResult<FileMeta> {\n const { pluginManager, oas, plugin, mode } = this.context\n\n const root = createRoot({\n logger: pluginManager.logger,\n })\n\n const templates = {\n operations: Operations.templates,\n client: Client.templates,\n ...this.options.templates,\n }\n\n root.render(\n <App pluginManager={pluginManager} plugin={plugin} mode={mode}>\n <Oas oas={oas} operations={operations} generator={this}>\n {templates.operations && <Operations.File baseURL={this.options.baseURL} templates={templates.operations} />}\n </Oas>\n </App>,\n )\n\n return root.files\n }\n\n async operation(operation: Operation, options: PluginClient['resolvedOptions']): OperationMethodResult<FileMeta> {\n const { oas, pluginManager, plugin, mode } = this.context\n\n const root = createRoot({\n logger: pluginManager.logger,\n })\n\n const templates = {\n operations: Operations.templates,\n client: Client.templates,\n ...options.templates,\n }\n\n if (!templates.client) {\n return []\n }\n\n root.render(\n <App pluginManager={pluginManager} plugin={{ ...plugin, options }} mode={mode}>\n <Oas oas={oas} operations={[operation]} generator={this}>\n <Oas.Operation operation={operation}>\n <Client.File baseURL={this.options.baseURL} templates={templates.client} />\n </Oas.Operation>\n </Oas>\n </App>,\n )\n\n return root.files\n }\n}\n"],"mappings":";;;;;;AAAA,OA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