@kubb/plugin-client 3.0.0-alpha.10 → 3.0.0-alpha.12
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/chunk-3NQF7BGA.cjs +26 -29
- package/dist/chunk-3NQF7BGA.cjs.map +1 -1
- package/dist/chunk-AZDWYBLW.cjs +4 -1
- package/dist/chunk-AZDWYBLW.cjs.map +1 -1
- package/dist/chunk-PO22ZUSH.cjs +37 -40
- package/dist/chunk-PO22ZUSH.cjs.map +1 -1
- package/dist/chunk-QBFKND4S.js +10 -16
- package/dist/chunk-QBFKND4S.js.map +1 -1
- package/dist/chunk-QLVGX3VO.js +8 -13
- package/dist/chunk-QLVGX3VO.js.map +1 -1
- package/dist/chunk-YJOVLRSC.js +2 -0
- package/dist/chunk-YJOVLRSC.js.map +1 -1
- package/dist/client.cjs +16 -7
- package/dist/client.cjs.map +1 -1
- package/dist/client.js +5 -6
- package/dist/client.js.map +1 -1
- package/dist/components.cjs +12 -5
- package/dist/components.cjs.map +1 -1
- package/dist/components.js +3 -9
- package/dist/components.js.map +1 -1
- package/dist/generators.cjs +8 -3
- package/dist/generators.cjs.map +1 -1
- package/dist/generators.js +3 -7
- package/dist/generators.js.map +1 -1
- package/dist/index.cjs +34 -34
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +11 -18
- package/dist/index.js.map +1 -1
- package/package.json +13 -13
package/dist/chunk-3NQF7BGA.cjs
CHANGED
|
@@ -1,61 +1,58 @@
|
|
|
1
|
-
|
|
1
|
+
'use strict';
|
|
2
2
|
|
|
3
|
+
var chunkPO22ZUSH_cjs = require('./chunk-PO22ZUSH.cjs');
|
|
4
|
+
var pluginOas = require('@kubb/plugin-oas');
|
|
5
|
+
var hooks = require('@kubb/plugin-oas/hooks');
|
|
6
|
+
var pluginTs = require('@kubb/plugin-ts');
|
|
7
|
+
var react = require('@kubb/react');
|
|
8
|
+
var jsxRuntime = require('@kubb/react/jsx-runtime');
|
|
3
9
|
|
|
4
|
-
var
|
|
5
|
-
|
|
6
|
-
// src/generators/axiosGenerator.tsx
|
|
7
|
-
var _pluginoas = require('@kubb/plugin-oas');
|
|
8
|
-
var _hooks = require('@kubb/plugin-oas/hooks');
|
|
9
|
-
var _plugints = require('@kubb/plugin-ts');
|
|
10
|
-
var _react = require('@kubb/react');
|
|
11
|
-
var _jsxruntime = require('@kubb/react/jsx-runtime');
|
|
12
|
-
var axiosGenerator = _pluginoas.createReactGenerator.call(void 0, {
|
|
10
|
+
var axiosGenerator = pluginOas.createReactGenerator({
|
|
13
11
|
name: "plugin-client",
|
|
14
12
|
Operations({ options, operations }) {
|
|
15
|
-
const { pluginManager } =
|
|
13
|
+
const { pluginManager } = react.useApp();
|
|
16
14
|
if (!options.templates.operations) {
|
|
17
15
|
return null;
|
|
18
16
|
}
|
|
19
|
-
const Template = options.templates.operations ||
|
|
17
|
+
const Template = options.templates.operations || chunkPO22ZUSH_cjs.Operations;
|
|
20
18
|
const name = "operations";
|
|
21
19
|
const file = pluginManager.getFile({ name, extName: ".ts", pluginKey: ["plugin-client"] });
|
|
22
|
-
return /* @__PURE__ */
|
|
20
|
+
return /* @__PURE__ */ jsxRuntime.jsx(react.File, { baseName: file.baseName, path: file.path, meta: file.meta, children: /* @__PURE__ */ jsxRuntime.jsx(Template, { name, operations }) });
|
|
23
21
|
},
|
|
24
22
|
Operation({ options, operation }) {
|
|
25
|
-
const { getSchemas, getName, getFile } =
|
|
23
|
+
const { getSchemas, getName, getFile } = hooks.useOperationManager();
|
|
26
24
|
const name = getName(operation, { type: "function" });
|
|
27
|
-
const typedSchemas = getSchemas(operation, { pluginKey: [
|
|
25
|
+
const typedSchemas = getSchemas(operation, { pluginKey: [pluginTs.pluginTsName], type: "type" });
|
|
28
26
|
const file = getFile(operation);
|
|
29
|
-
const fileType = getFile(operation, { pluginKey: [
|
|
27
|
+
const fileType = getFile(operation, { pluginKey: [pluginTs.pluginTsName] });
|
|
30
28
|
if (!options.templates.client) {
|
|
31
29
|
return null;
|
|
32
30
|
}
|
|
33
|
-
const Template = options.templates.client ||
|
|
34
|
-
return /* @__PURE__ */
|
|
35
|
-
/* @__PURE__ */
|
|
36
|
-
/* @__PURE__ */
|
|
37
|
-
/* @__PURE__ */
|
|
38
|
-
|
|
31
|
+
const Template = options.templates.client || chunkPO22ZUSH_cjs.Client;
|
|
32
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(react.File, { baseName: file.baseName, path: file.path, meta: file.meta, children: [
|
|
33
|
+
/* @__PURE__ */ jsxRuntime.jsx(react.File.Import, { name: "client", path: options.client.importPath }),
|
|
34
|
+
/* @__PURE__ */ jsxRuntime.jsx(react.File.Import, { name: ["ResponseConfig"], path: options.client.importPath, isTypeOnly: true }),
|
|
35
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
36
|
+
react.File.Import,
|
|
39
37
|
{
|
|
40
38
|
extName: options.extName,
|
|
41
39
|
name: [
|
|
42
|
-
|
|
40
|
+
typedSchemas.request?.name,
|
|
43
41
|
typedSchemas.response.name,
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
42
|
+
typedSchemas.pathParams?.name,
|
|
43
|
+
typedSchemas.queryParams?.name,
|
|
44
|
+
typedSchemas.headerParams?.name
|
|
47
45
|
].filter(Boolean),
|
|
48
46
|
root: file.path,
|
|
49
47
|
path: fileType.path,
|
|
50
48
|
isTypeOnly: true
|
|
51
49
|
}
|
|
52
50
|
),
|
|
53
|
-
/* @__PURE__ */
|
|
51
|
+
/* @__PURE__ */ jsxRuntime.jsx(Template, { name, options, typedSchemas, operation })
|
|
54
52
|
] });
|
|
55
53
|
}
|
|
56
54
|
});
|
|
57
55
|
|
|
58
|
-
|
|
59
|
-
|
|
60
56
|
exports.axiosGenerator = axiosGenerator;
|
|
57
|
+
//# sourceMappingURL=chunk-3NQF7BGA.cjs.map
|
|
61
58
|
//# sourceMappingURL=chunk-3NQF7BGA.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["../src/generators/axiosGenerator.tsx"],"names":["createReactGenerator","useApp","Operations","jsx","File","useOperationManager","pluginTsName","Client","jsxs"],"mappings":";;;;;;;;;AAQO,IAAM,iBAAiBA,8BAAmC,CAAA;AAAA,EAC/D,IAAM,EAAA,eAAA;AAAA,EACN,UAAW,CAAA,EAAE,OAAS,EAAA,UAAA,EAAc,EAAA;AAClC,IAAM,MAAA,EAAE,aAAc,EAAA,GAAIC,YAAqB,EAAA,CAAA;AAE/C,IAAI,IAAA,CAAC,OAAQ,CAAA,SAAA,CAAU,UAAY,EAAA;AACjC,MAAO,OAAA,IAAA,CAAA;AAAA,KACT;AAEA,IAAM,MAAA,QAAA,GAAW,OAAQ,CAAA,SAAA,CAAU,UAAc,IAAAC,4BAAA,CAAA;AACjD,IAAA,MAAM,IAAO,GAAA,YAAA,CAAA;AACb,IAAM,MAAA,IAAA,GAAO,aAAc,CAAA,OAAA,CAAQ,EAAE,IAAA,EAAM,OAAS,EAAA,KAAA,EAAO,SAAW,EAAA,CAAC,eAAe,CAAA,EAAG,CAAA,CAAA;AAEzF,IAAA,uBACGC,cAAA,CAAAC,UAAA,EAAA,EAAK,QAAU,EAAA,IAAA,CAAK,UAAU,IAAM,EAAA,IAAA,CAAK,IAAM,EAAA,IAAA,EAAM,KAAK,IACzD,EAAA,QAAA,kBAAAD,cAAA,CAAC,QAAS,EAAA,EAAA,IAAA,EAAY,YAAwB,CAChD,EAAA,CAAA,CAAA;AAAA,GAEJ;AAAA,EACA,SAAU,CAAA,EAAE,OAAS,EAAA,SAAA,EAAa,EAAA;AAChC,IAAA,MAAM,EAAE,UAAA,EAAY,OAAS,EAAA,OAAA,KAAYE,yBAAoB,EAAA,CAAA;AAE7D,IAAA,MAAM,OAAO,OAAQ,CAAA,SAAA,EAAW,EAAE,IAAA,EAAM,YAAY,CAAA,CAAA;AACpD,IAAM,MAAA,YAAA,GAAe,UAAW,CAAA,SAAA,EAAW,EAA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K,CAAA,IAAA;AAAA,UACX,MAAM,QAAS,CAAA,IAAA;AAAA,UACf,UAAU,EAAA,IAAA;AAAA,SAAA;AAAA,OACZ;AAAA,sBACCD,cAAA,CAAA,QAAA,EAAA,EAAS,IAAY,EAAA,OAAA,EAAkB,cAA4B,SAAsB,EAAA,CAAA;AAAA,KAC5F,EAAA,CAAA,CAAA;AAAA,GAEJ;AACF,CAAC","file":"chunk-3NQF7BGA.cjs","sourcesContent":["import { createReactGenerator } from '@kubb/plugin-oas'\nimport { useOperationManager } from '@kubb/plugin-oas/hooks'\nimport { pluginTsName } from '@kubb/plugin-ts'\nimport { File, useApp } from '@kubb/react'\nimport { Client } from '../components/Client'\nimport { Operations } from '../components/Operations'\nimport type { PluginClient } from '../types'\n\nexport const axiosGenerator = createReactGenerator<PluginClient>({\n name: 'plugin-client',\n Operations({ options, operations }) {\n const { pluginManager } = useApp<PluginClient>()\n\n if (!options.templates.operations) {\n return null\n }\n\n const Template = options.templates.operations || Operations\n const name = 'operations'\n const file = pluginManager.getFile({ name, extName: '.ts', pluginKey: ['plugin-client'] })\n\n return (\n <File baseName={file.baseName} path={file.path} meta={file.meta}>\n <Template name={name} operations={operations} />\n </File>\n )\n },\n Operation({ options, operation }) {\n const { getSchemas, getName, getFile } = useOperationManager()\n\n const name = getName(operation, { type: 'function' })\n const typedSchemas = getSchemas(operation, { pluginKey: [pluginTsName], type: 'type' })\n const file = getFile(operation)\n const fileType = getFile(operation, { pluginKey: [pluginTsName] })\n\n if (!options.templates.client) {\n return null\n }\n\n const Template = options.templates.client || Client\n\n return (\n <File baseName={file.baseName} path={file.path} meta={file.meta}>\n <File.Import name={'client'} path={options.client.importPath} />\n <File.Import name={['ResponseConfig']} path={options.client.importPath} isTypeOnly />\n <File.Import\n extName={options.extName}\n name={[\n typedSchemas.request?.name,\n typedSchemas.response.name,\n typedSchemas.pathParams?.name,\n typedSchemas.queryParams?.name,\n typedSchemas.headerParams?.name,\n ].filter(Boolean)}\n root={file.path}\n path={fileType.path}\n isTypeOnly\n />\n <Template name={name} options={options} typedSchemas={typedSchemas} operation={operation} />\n </File>\n )\n },\n})\n"]}
|
package/dist/chunk-AZDWYBLW.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"chunk-AZDWYBLW.cjs"}
|
package/dist/chunk-PO22ZUSH.cjs
CHANGED
|
@@ -1,41 +1,44 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
var
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var utils = require('@kubb/core/utils');
|
|
4
|
+
var oas = require('@kubb/oas');
|
|
5
|
+
var utils$1 = require('@kubb/plugin-oas/utils');
|
|
6
|
+
var react = require('@kubb/react');
|
|
7
|
+
var jsxRuntime = require('@kubb/react/jsx-runtime');
|
|
8
|
+
|
|
9
|
+
// src/components/Client.tsx
|
|
7
10
|
function Client({ name, options, typedSchemas, operation }) {
|
|
8
11
|
const contentType = operation.getContentType();
|
|
9
12
|
const baseURL = options.client.importPath === "@kubb/plugin-client/client" ? options.baseURL : void 0;
|
|
10
|
-
const path = new
|
|
13
|
+
const path = new utils.URLPath(operation.path);
|
|
11
14
|
const isFormData = contentType === "multipart/form-data";
|
|
12
15
|
const headers = [
|
|
13
16
|
contentType !== "application/json" ? `'Content-Type': '${contentType}'` : void 0,
|
|
14
|
-
|
|
17
|
+
typedSchemas.headerParams?.name ? "...headers" : void 0
|
|
15
18
|
].filter(Boolean);
|
|
16
|
-
const params =
|
|
19
|
+
const params = react.createFunctionParams({
|
|
17
20
|
pathParams: {
|
|
18
21
|
mode: options.pathParamsType === "object" ? "object" : "inlineSpread",
|
|
19
|
-
children:
|
|
22
|
+
children: utils$1.getPathParams(typedSchemas.pathParams, { typed: true })
|
|
20
23
|
},
|
|
21
|
-
data:
|
|
22
|
-
type:
|
|
23
|
-
optional:
|
|
24
|
+
data: typedSchemas.request?.name ? {
|
|
25
|
+
type: typedSchemas.request?.name,
|
|
26
|
+
optional: oas.isOptional(typedSchemas.request?.schema)
|
|
24
27
|
} : void 0,
|
|
25
|
-
params:
|
|
26
|
-
type:
|
|
27
|
-
optional:
|
|
28
|
+
params: typedSchemas.queryParams?.name ? {
|
|
29
|
+
type: typedSchemas.queryParams?.name,
|
|
30
|
+
optional: oas.isOptional(typedSchemas.queryParams?.schema)
|
|
28
31
|
} : void 0,
|
|
29
|
-
headers:
|
|
30
|
-
type:
|
|
31
|
-
optional:
|
|
32
|
+
headers: typedSchemas.headerParams?.name ? {
|
|
33
|
+
type: typedSchemas.headerParams?.name,
|
|
34
|
+
optional: oas.isOptional(typedSchemas.headerParams?.schema)
|
|
32
35
|
} : void 0,
|
|
33
36
|
options: {
|
|
34
37
|
type: "Partial<Parameters<typeof client>[0]>",
|
|
35
38
|
default: "{}"
|
|
36
39
|
}
|
|
37
40
|
});
|
|
38
|
-
const clientParams =
|
|
41
|
+
const clientParams = react.createFunctionParams({
|
|
39
42
|
data: {
|
|
40
43
|
mode: "object",
|
|
41
44
|
children: {
|
|
@@ -51,10 +54,10 @@ function Client({ name, options, typedSchemas, operation }) {
|
|
|
51
54
|
type: "string",
|
|
52
55
|
value: JSON.stringify(baseURL)
|
|
53
56
|
} : void 0,
|
|
54
|
-
params:
|
|
57
|
+
params: typedSchemas.queryParams?.name ? {
|
|
55
58
|
type: "any"
|
|
56
59
|
} : void 0,
|
|
57
|
-
data:
|
|
60
|
+
data: typedSchemas.request?.name ? {
|
|
58
61
|
type: "any",
|
|
59
62
|
value: isFormData ? "formData" : void 0
|
|
60
63
|
} : void 0,
|
|
@@ -80,8 +83,8 @@ function Client({ name, options, typedSchemas, operation }) {
|
|
|
80
83
|
})
|
|
81
84
|
}
|
|
82
85
|
` : void 0;
|
|
83
|
-
return /* @__PURE__ */
|
|
84
|
-
|
|
86
|
+
return /* @__PURE__ */ jsxRuntime.jsx(react.File.Source, { name, isExportable: true, isIndexable: true, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
87
|
+
react.Function,
|
|
85
88
|
{
|
|
86
89
|
name,
|
|
87
90
|
async: true,
|
|
@@ -89,40 +92,34 @@ function Client({ name, options, typedSchemas, operation }) {
|
|
|
89
92
|
returnType: options.dataReturnType === "data" ? `ResponseConfig<${typedSchemas.response.name}>["data"]` : `ResponseConfig<${typedSchemas.response.name}>`,
|
|
90
93
|
params,
|
|
91
94
|
JSDoc: {
|
|
92
|
-
comments:
|
|
95
|
+
comments: utils$1.getComments(operation)
|
|
93
96
|
},
|
|
94
97
|
children: [
|
|
95
98
|
formData || "",
|
|
96
|
-
/* @__PURE__ */
|
|
97
|
-
|
|
99
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
100
|
+
react.Function.Call,
|
|
98
101
|
{
|
|
99
102
|
name: "res",
|
|
100
|
-
to: /* @__PURE__ */
|
|
103
|
+
to: /* @__PURE__ */ jsxRuntime.jsx(react.Function, { name: "client", async: true, generics: [typedSchemas.response.name, typedSchemas.request?.name].filter(Boolean), params: clientParams })
|
|
101
104
|
}
|
|
102
105
|
),
|
|
103
|
-
/* @__PURE__ */
|
|
106
|
+
/* @__PURE__ */ jsxRuntime.jsx(react.Function.Return, { children: options.dataReturnType === "data" ? "res.data" : "res" })
|
|
104
107
|
]
|
|
105
108
|
}
|
|
106
109
|
) });
|
|
107
110
|
}
|
|
108
|
-
|
|
109
|
-
// src/components/Operations.tsx
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
111
|
function Operations({ name, operations }) {
|
|
114
112
|
const operationsObject = {};
|
|
115
113
|
operations.forEach((operation) => {
|
|
116
114
|
operationsObject[operation.getOperationId()] = {
|
|
117
|
-
path: new
|
|
115
|
+
path: new utils.URLPath(operation.path).URL,
|
|
118
116
|
method: operation.method
|
|
119
117
|
};
|
|
120
118
|
});
|
|
121
|
-
return /* @__PURE__ */
|
|
119
|
+
return /* @__PURE__ */ jsxRuntime.jsx(react.File.Source, { name, isExportable: true, isIndexable: true, children: /* @__PURE__ */ jsxRuntime.jsx(react.Const, { name, export: true, asConst: true, children: JSON.stringify(operationsObject, void 0, 2) }) });
|
|
122
120
|
}
|
|
123
121
|
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
exports.Client = Client; exports.Operations = Operations;
|
|
122
|
+
exports.Client = Client;
|
|
123
|
+
exports.Operations = Operations;
|
|
124
|
+
//# sourceMappingURL=chunk-PO22ZUSH.cjs.map
|
|
128
125
|
//# sourceMappingURL=chunk-PO22ZUSH.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["../src/components/Client.tsx","../src/components/Operations.tsx"],"names":["URLPath","createFunctionParams","getPathParams","isOptional","jsx","File","jsxs","Function","getComments","Const"],"mappings":";;;;;;;;;AAmBO,SAAS,OAAO,EAAE,IAAA,EAAM,OAAS,EAAA,YAAA,EAAc,WAA8B,EAAA;AAClF,EAAM,MAAA,WAAA,GAAc,UAAU,cAAe,EAAA,CAAA;AAC7C,EAAA,MAAM,UAAU,OAAQ,CAAA,MAAA,CAAO,UAAe,KAAA,4BAAA,GAA+B,QAAQ,OAAU,GAAA,KAAA,CAAA,CAAA;AAC/F,EAAA,MAAM,IAAO,GAAA,IAAIA,aAAQ,CAAA,SAAA,CAAU,IAAI,CAAA,CAAA;AACvC,EAAA,MAAM,aAAa,WAAgB,KAAA,qBAAA,CAAA;AACnC,EAAA,MAAM,OAAU,GAAA;AAAA,IACd,WAAgB,KAAA,kBAAA,GAAqB,CAAoB,iBAAA,EAAA,WAAW,CAAM,CAAA,CAAA,GAAA,KAAA,CAAA;AAAA,IAC1E,YAAA,CAAa,YAAc,EAAA,IAAA,GAAO,YAAe,GAAA,KAAA,CAAA;AAAA,GACnD,CAAE,OAAO,OAAO,CAAA,CAAA;AAEhB,EAAA,MAAM,SAASC,0BAAqB,CAAA;AAAA,IAClC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CAAA;AAED,EACE,uBAAAI,cAACC,CAAAA,UAAAA,CAAK,MAAL,EAAA,EAAY,MAAY,YAAY,EAAA,IAAA,EAAC,WAAW,EAAA,IAAA,EAC/C,QAAAD,kBAAAA,cAAAA,CAACK,eAAM,IAAY,EAAA,MAAA,EAAM,IAAC,EAAA,OAAA,EAAO,IAC9B,EAAA,QAAA,EAAA,IAAA,CAAK,UAAU,gBAAkB,EAAA,KAAA,CAAA,EAAW,CAAC,CAAA,EAChD,CACF,EAAA,CAAA,CAAA;AAEJ","file":"chunk-PO22ZUSH.cjs","sourcesContent":["import { URLPath } from '@kubb/core/utils'\n\nimport { type Operation, isOptional } from '@kubb/oas'\nimport type { OperationSchemas } from '@kubb/plugin-oas'\nimport { getComments, getPathParams } from '@kubb/plugin-oas/utils'\nimport { File, Function, createFunctionParams } from '@kubb/react'\nimport type { KubbNode, Params } from '@kubb/react/types'\nimport type { PluginClient } from '../types.ts'\n\ntype Props = {\n /**\n * Name of the function\n */\n name: string\n options: PluginClient['resolvedOptions']\n typedSchemas: OperationSchemas\n operation: Operation\n}\n\nexport function Client({ name, options, typedSchemas, operation }: Props): KubbNode {\n const contentType = operation.getContentType()\n const baseURL = options.client.importPath === '@kubb/plugin-client/client' ? options.baseURL : undefined\n const path = new URLPath(operation.path)\n const isFormData = contentType === 'multipart/form-data'\n const headers = [\n contentType !== 'application/json' ? `'Content-Type': '${contentType}'` : undefined,\n typedSchemas.headerParams?.name ? '...headers' : undefined,\n ].filter(Boolean)\n\n const params = createFunctionParams({\n pathParams: {\n mode: options.pathParamsType === 'object' ? 'object' : 'inlineSpread',\n children: getPathParams(typedSchemas.pathParams, { typed: true }),\n },\n data: typedSchemas.request?.name\n ? {\n type: typedSchemas.request?.name,\n optional: isOptional(typedSchemas.request?.schema),\n }\n : undefined,\n params: typedSchemas.queryParams?.name\n ? {\n type: typedSchemas.queryParams?.name,\n optional: isOptional(typedSchemas.queryParams?.schema),\n }\n : undefined,\n headers: typedSchemas.headerParams?.name\n ? {\n type: typedSchemas.headerParams?.name,\n optional: isOptional(typedSchemas.headerParams?.schema),\n }\n : undefined,\n options: {\n type: 'Partial<Parameters<typeof client>[0]>',\n default: '{}',\n },\n })\n\n const clientParams = createFunctionParams({\n data: {\n mode: 'object',\n children: {\n method: {\n type: 'string',\n value: JSON.stringify(operation.method),\n },\n url: {\n type: 'string',\n value: path.template,\n },\n baseURL: baseURL\n ? {\n type: 'string',\n value: JSON.stringify(baseURL),\n }\n : undefined,\n params: typedSchemas.queryParams?.name\n ? {\n type: 'any',\n }\n : undefined,\n data: typedSchemas.request?.name\n ? {\n type: 'any',\n value: isFormData ? 'formData' : undefined,\n }\n : undefined,\n headers: headers.length\n ? {\n type: 'any',\n value: headers.length ? `{ ${headers.join(', ')}, ...options.headers }` : undefined,\n }\n : undefined,\n options: {\n type: 'any',\n mode: 'inlineSpread',\n },\n },\n },\n })\n\n const formData = isFormData\n ? `\n const formData = new FormData()\n if(data) {\n Object.keys(data).forEach((key) => {\n const value = data[key];\n if (typeof key === \"string\" && (typeof value === \"string\" || value instanceof Blob)) {\n formData.append(key, value);\n }\n })\n }\n `\n : undefined\n\n return (\n <File.Source name={name} isExportable isIndexable>\n <Function\n name={name}\n async\n export\n returnType={\n options.dataReturnType === 'data' ? `ResponseConfig<${typedSchemas.response.name}>[\"data\"]` : `ResponseConfig<${typedSchemas.response.name}>`\n }\n params={params}\n JSDoc={{\n comments: getComments(operation),\n }}\n >\n {formData || ''}\n <Function.Call\n name=\"res\"\n to={<Function name=\"client\" async generics={[typedSchemas.response.name, typedSchemas.request?.name].filter(Boolean)} params={clientParams} />}\n />\n <Function.Return>{options.dataReturnType === 'data' ? 'res.data' : 'res'}</Function.Return>\n </Function>\n </File.Source>\n )\n}\n","import { URLPath } from '@kubb/core/utils'\nimport { Const, File } from '@kubb/react'\n\nimport type { HttpMethod, Operation } from '@kubb/oas'\n\ntype OperationsProps = {\n name: string\n operations: Array<Operation>\n}\n\nexport function Operations({ name, operations }: OperationsProps) {\n const operationsObject: Record<string, { path: string; method: HttpMethod }> = {}\n\n operations.forEach((operation) => {\n operationsObject[operation.getOperationId()] = {\n path: new URLPath(operation.path).URL,\n method: operation.method,\n }\n })\n\n return (\n <File.Source name={name} isExportable isIndexable>\n <Const name={name} export asConst>\n {JSON.stringify(operationsObject, undefined, 2)}\n </Const>\n </File.Source>\n )\n}\n"]}
|
package/dist/chunk-QBFKND4S.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import { URLPath } from '@kubb/core/utils';
|
|
2
|
+
import { isOptional } from '@kubb/oas';
|
|
3
|
+
import { getPathParams, getComments } from '@kubb/plugin-oas/utils';
|
|
4
|
+
import { createFunctionParams, File, Function, Const } from '@kubb/react';
|
|
5
|
+
import { jsx, jsxs } from '@kubb/react/jsx-runtime';
|
|
6
|
+
|
|
1
7
|
// src/components/Client.tsx
|
|
2
|
-
import { URLPath } from "@kubb/core/utils";
|
|
3
|
-
import { isOptional } from "@kubb/oas";
|
|
4
|
-
import { getComments, getPathParams } from "@kubb/plugin-oas/utils";
|
|
5
|
-
import { File, Function, createFunctionParams } from "@kubb/react";
|
|
6
|
-
import { jsx, jsxs } from "@kubb/react/jsx-runtime";
|
|
7
8
|
function Client({ name, options, typedSchemas, operation }) {
|
|
8
9
|
const contentType = operation.getContentType();
|
|
9
10
|
const baseURL = options.client.importPath === "@kubb/plugin-client/client" ? options.baseURL : void 0;
|
|
@@ -105,24 +106,17 @@ function Client({ name, options, typedSchemas, operation }) {
|
|
|
105
106
|
}
|
|
106
107
|
) });
|
|
107
108
|
}
|
|
108
|
-
|
|
109
|
-
// src/components/Operations.tsx
|
|
110
|
-
import { URLPath as URLPath2 } from "@kubb/core/utils";
|
|
111
|
-
import { Const, File as File2 } from "@kubb/react";
|
|
112
|
-
import { jsx as jsx2 } from "@kubb/react/jsx-runtime";
|
|
113
109
|
function Operations({ name, operations }) {
|
|
114
110
|
const operationsObject = {};
|
|
115
111
|
operations.forEach((operation) => {
|
|
116
112
|
operationsObject[operation.getOperationId()] = {
|
|
117
|
-
path: new
|
|
113
|
+
path: new URLPath(operation.path).URL,
|
|
118
114
|
method: operation.method
|
|
119
115
|
};
|
|
120
116
|
});
|
|
121
|
-
return /* @__PURE__ */
|
|
117
|
+
return /* @__PURE__ */ jsx(File.Source, { name, isExportable: true, isIndexable: true, children: /* @__PURE__ */ jsx(Const, { name, export: true, asConst: true, children: JSON.stringify(operationsObject, void 0, 2) }) });
|
|
122
118
|
}
|
|
123
119
|
|
|
124
|
-
export {
|
|
125
|
-
|
|
126
|
-
Operations
|
|
127
|
-
};
|
|
120
|
+
export { Client, Operations };
|
|
121
|
+
//# sourceMappingURL=chunk-QBFKND4S.js.map
|
|
128
122
|
//# sourceMappingURL=chunk-QBFKND4S.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/Client.tsx","../src/components/Operations.tsx"],"sourcesContent":["import { URLPath } from '@kubb/core/utils'\n\nimport { type Operation, isOptional } from '@kubb/oas'\nimport type { OperationSchemas } from '@kubb/plugin-oas'\nimport { getComments, getPathParams } from '@kubb/plugin-oas/utils'\nimport { File, Function, createFunctionParams } from '@kubb/react'\nimport type { KubbNode, Params } from '@kubb/react/types'\nimport type { PluginClient } from '../types.ts'\n\ntype Props = {\n /**\n * Name of the function\n */\n name: string\n options: PluginClient['resolvedOptions']\n typedSchemas: OperationSchemas\n operation: Operation\n}\n\nexport function Client({ name, options, typedSchemas, operation }: Props): KubbNode {\n const contentType = operation.getContentType()\n const baseURL = options.client.importPath === '@kubb/plugin-client/client' ? options.baseURL : undefined\n const path = new URLPath(operation.path)\n const isFormData = contentType === 'multipart/form-data'\n const headers = [\n contentType !== 'application/json' ? `'Content-Type': '${contentType}'` : undefined,\n typedSchemas.headerParams?.name ? '...headers' : undefined,\n ].filter(Boolean)\n\n const params = createFunctionParams({\n pathParams: {\n mode: options.pathParamsType === 'object' ? 'object' : 'inlineSpread',\n children: getPathParams(typedSchemas.pathParams, { typed: true }),\n },\n data: typedSchemas.request?.name\n ? {\n type: typedSchemas.request?.name,\n optional: isOptional(typedSchemas.request?.schema),\n }\n : undefined,\n params: typedSchemas.queryParams?.name\n ? {\n type: typedSchemas.queryParams?.name,\n optional: isOptional(typedSchemas.queryParams?.schema),\n }\n : undefined,\n headers: typedSchemas.headerParams?.name\n ? {\n type: typedSchemas.headerParams?.name,\n optional: isOptional(typedSchemas.headerParams?.schema),\n }\n : undefined,\n options: {\n type: 'Partial<Parameters<typeof client>[0]>',\n default: '{}',\n },\n })\n\n const clientParams = createFunctionParams({\n data: {\n mode: 'object',\n children: {\n method: {\n type: 'string',\n value: JSON.stringify(operation.method),\n },\n url: {\n type: 'string',\n value: path.template,\n },\n baseURL: baseURL\n ? {\n type: 'string',\n value: JSON.stringify(baseURL),\n }\n : undefined,\n params: typedSchemas.queryParams?.name\n ? {\n type: 'any',\n }\n : undefined,\n data: typedSchemas.request?.name\n ? {\n type: 'any',\n value: isFormData ? 'formData' : undefined,\n }\n : undefined,\n headers: headers.length\n ? {\n type: 'any',\n value: headers.length ? `{ ${headers.join(', ')}, ...options.headers }` : undefined,\n }\n : undefined,\n options: {\n type: 'any',\n mode: 'inlineSpread',\n },\n },\n },\n })\n\n const formData = isFormData\n ? `\n const formData = new FormData()\n if(data) {\n Object.keys(data).forEach((key) => {\n const value = data[key];\n if (typeof key === \"string\" && (typeof value === \"string\" || value instanceof Blob)) {\n formData.append(key, value);\n }\n })\n }\n `\n : undefined\n\n return (\n <File.Source name={name} isExportable isIndexable>\n <Function\n name={name}\n async\n export\n returnType={\n options.dataReturnType === 'data' ? `ResponseConfig<${typedSchemas.response.name}>[\"data\"]` : `ResponseConfig<${typedSchemas.response.name}>`\n }\n params={params}\n JSDoc={{\n comments: getComments(operation),\n }}\n >\n {formData || ''}\n <Function.Call\n name=\"res\"\n to={<Function name=\"client\" async generics={[typedSchemas.response.name, typedSchemas.request?.name].filter(Boolean)} params={clientParams} />}\n />\n <Function.Return>{options.dataReturnType === 'data' ? 'res.data' : 'res'}</Function.Return>\n </Function>\n </File.Source>\n )\n}\n","import { URLPath } from '@kubb/core/utils'\nimport { Const, File } from '@kubb/react'\n\nimport type { HttpMethod, Operation } from '@kubb/oas'\n\ntype OperationsProps = {\n name: string\n operations: Array<Operation>\n}\n\nexport function Operations({ name, operations }: OperationsProps) {\n const operationsObject: Record<string, { path: string; method: HttpMethod }> = {}\n\n operations.forEach((operation) => {\n operationsObject[operation.getOperationId()] = {\n path: new URLPath(operation.path).URL,\n method: operation.method,\n }\n })\n\n return (\n <File.Source name={name} isExportable isIndexable>\n <Const name={name} export asConst>\n {JSON.stringify(operationsObject, undefined, 2)}\n </Const>\n </File.Source>\n )\n}\n"]
|
|
1
|
+
{"version":3,"sources":["../src/components/Client.tsx","../src/components/Operations.tsx"],"names":["URLPath","jsx","File"],"mappings":";;;;;;;AAmBO,SAAS,OAAO,EAAE,IAAA,EAAM,OAAS,EAAA,YAAA,EAAc,WAA8B,EAAA;AAClF,EAAM,MAAA,WAAA,GAAc,UAAU,cAAe,EAAA,CAAA;AAC7C,EAAA,MAAM,UAAU,OAAQ,CAAA,MAAA,CAAO,UAAe,KAAA,4BAAA,GAA+B,QAAQ,OAAU,GAAA,KAAA,CAAA,CAAA;AAC/F,EAAA,MAAM,IAAO,GAAA,IAAI,OAAQ,CAAA,SAAA,CAAU,IAAI,CAAA,CAAA;AACvC,EAAA,MAAM,aAAa,WAAgB,KAAA,qBAAA,CAAA;AACnC,EAAA,MAAM,OAAU,GAAA;AAAA,IACd,WAAgB,KAAA,kBAAA,GAAqB,CAAoB,iBAAA,EAAA,WAAW,CAAM,CAAA,CAAA,GAAA,KAAA,CAAA;AAAA,IAC1E,YAAA,CAAa,YAAc,EAAA,IAAA,GAAO,YAAe,GAAA,KAAA,CAAA;AAAA,GACnD,CAAE,OAAO,OAAO,CAAA,CAAA;AAEhB,EAAA,MAAM,SAAS,oBAAqB,CAAA;AAAA,IAClC,UAAY,EAAA;AAAA,MACV,I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A,CAAK,MAAL,EAAA,EAAY,MAAY,YAAY,EAAA,IAAA,EAAC,WAAW,EAAA,IAAA,EAC/C,QAAAD,kBAAAA,GAAAA,CAAC,SAAM,IAAY,EAAA,MAAA,EAAM,IAAC,EAAA,OAAA,EAAO,IAC9B,EAAA,QAAA,EAAA,IAAA,CAAK,UAAU,gBAAkB,EAAA,KAAA,CAAA,EAAW,CAAC,CAAA,EAChD,CACF,EAAA,CAAA,CAAA;AAEJ","file":"chunk-QBFKND4S.js","sourcesContent":["import { URLPath } from '@kubb/core/utils'\n\nimport { type Operation, isOptional } from '@kubb/oas'\nimport type { OperationSchemas } from '@kubb/plugin-oas'\nimport { getComments, getPathParams } from '@kubb/plugin-oas/utils'\nimport { File, Function, createFunctionParams } from '@kubb/react'\nimport type { KubbNode, Params } from '@kubb/react/types'\nimport type { PluginClient } from '../types.ts'\n\ntype Props = {\n /**\n * Name of the function\n */\n name: string\n options: PluginClient['resolvedOptions']\n typedSchemas: OperationSchemas\n operation: Operation\n}\n\nexport function Client({ name, options, typedSchemas, operation }: Props): KubbNode {\n const contentType = operation.getContentType()\n const baseURL = options.client.importPath === '@kubb/plugin-client/client' ? options.baseURL : undefined\n const path = new URLPath(operation.path)\n const isFormData = contentType === 'multipart/form-data'\n const headers = [\n contentType !== 'application/json' ? `'Content-Type': '${contentType}'` : undefined,\n typedSchemas.headerParams?.name ? '...headers' : undefined,\n ].filter(Boolean)\n\n const params = createFunctionParams({\n pathParams: {\n mode: options.pathParamsType === 'object' ? 'object' : 'inlineSpread',\n children: getPathParams(typedSchemas.pathParams, { typed: true }),\n },\n data: typedSchemas.request?.name\n ? {\n type: typedSchemas.request?.name,\n optional: isOptional(typedSchemas.request?.schema),\n }\n : undefined,\n params: typedSchemas.queryParams?.name\n ? {\n type: typedSchemas.queryParams?.name,\n optional: isOptional(typedSchemas.queryParams?.schema),\n }\n : undefined,\n headers: typedSchemas.headerParams?.name\n ? {\n type: typedSchemas.headerParams?.name,\n optional: isOptional(typedSchemas.headerParams?.schema),\n }\n : undefined,\n options: {\n type: 'Partial<Parameters<typeof client>[0]>',\n default: '{}',\n },\n })\n\n const clientParams = createFunctionParams({\n data: {\n mode: 'object',\n children: {\n method: {\n type: 'string',\n value: JSON.stringify(operation.method),\n },\n url: {\n type: 'string',\n value: path.template,\n },\n baseURL: baseURL\n ? {\n type: 'string',\n value: JSON.stringify(baseURL),\n }\n : undefined,\n params: typedSchemas.queryParams?.name\n ? {\n type: 'any',\n }\n : undefined,\n data: typedSchemas.request?.name\n ? {\n type: 'any',\n value: isFormData ? 'formData' : undefined,\n }\n : undefined,\n headers: headers.length\n ? {\n type: 'any',\n value: headers.length ? `{ ${headers.join(', ')}, ...options.headers }` : undefined,\n }\n : undefined,\n options: {\n type: 'any',\n mode: 'inlineSpread',\n },\n },\n },\n })\n\n const formData = isFormData\n ? `\n const formData = new FormData()\n if(data) {\n Object.keys(data).forEach((key) => {\n const value = data[key];\n if (typeof key === \"string\" && (typeof value === \"string\" || value instanceof Blob)) {\n formData.append(key, value);\n }\n })\n }\n `\n : undefined\n\n return (\n <File.Source name={name} isExportable isIndexable>\n <Function\n name={name}\n async\n export\n returnType={\n options.dataReturnType === 'data' ? `ResponseConfig<${typedSchemas.response.name}>[\"data\"]` : `ResponseConfig<${typedSchemas.response.name}>`\n }\n params={params}\n JSDoc={{\n comments: getComments(operation),\n }}\n >\n {formData || ''}\n <Function.Call\n name=\"res\"\n to={<Function name=\"client\" async generics={[typedSchemas.response.name, typedSchemas.request?.name].filter(Boolean)} params={clientParams} />}\n />\n <Function.Return>{options.dataReturnType === 'data' ? 'res.data' : 'res'}</Function.Return>\n </Function>\n </File.Source>\n )\n}\n","import { URLPath } from '@kubb/core/utils'\nimport { Const, File } from '@kubb/react'\n\nimport type { HttpMethod, Operation } from '@kubb/oas'\n\ntype OperationsProps = {\n name: string\n operations: Array<Operation>\n}\n\nexport function Operations({ name, operations }: OperationsProps) {\n const operationsObject: Record<string, { path: string; method: HttpMethod }> = {}\n\n operations.forEach((operation) => {\n operationsObject[operation.getOperationId()] = {\n path: new URLPath(operation.path).URL,\n method: operation.method,\n }\n })\n\n return (\n <File.Source name={name} isExportable isIndexable>\n <Const name={name} export asConst>\n {JSON.stringify(operationsObject, undefined, 2)}\n </Const>\n </File.Source>\n )\n}\n"]}
|
package/dist/chunk-QLVGX3VO.js
CHANGED
|
@@ -1,14 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
} from
|
|
1
|
+
import { Operations, Client } from './chunk-QBFKND4S.js';
|
|
2
|
+
import { createReactGenerator } from '@kubb/plugin-oas';
|
|
3
|
+
import { useOperationManager } from '@kubb/plugin-oas/hooks';
|
|
4
|
+
import { pluginTsName } from '@kubb/plugin-ts';
|
|
5
|
+
import { useApp, File } from '@kubb/react';
|
|
6
|
+
import { jsx, jsxs } from '@kubb/react/jsx-runtime';
|
|
5
7
|
|
|
6
|
-
// src/generators/axiosGenerator.tsx
|
|
7
|
-
import { createReactGenerator } from "@kubb/plugin-oas";
|
|
8
|
-
import { useOperationManager } from "@kubb/plugin-oas/hooks";
|
|
9
|
-
import { pluginTsName } from "@kubb/plugin-ts";
|
|
10
|
-
import { File, useApp } from "@kubb/react";
|
|
11
|
-
import { jsx, jsxs } from "@kubb/react/jsx-runtime";
|
|
12
8
|
var axiosGenerator = createReactGenerator({
|
|
13
9
|
name: "plugin-client",
|
|
14
10
|
Operations({ options, operations }) {
|
|
@@ -55,7 +51,6 @@ var axiosGenerator = createReactGenerator({
|
|
|
55
51
|
}
|
|
56
52
|
});
|
|
57
53
|
|
|
58
|
-
export {
|
|
59
|
-
|
|
60
|
-
};
|
|
54
|
+
export { axiosGenerator };
|
|
55
|
+
//# sourceMappingURL=chunk-QLVGX3VO.js.map
|
|
61
56
|
//# sourceMappingURL=chunk-QLVGX3VO.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/generators/axiosGenerator.tsx"],"sourcesContent":["import { createReactGenerator } from '@kubb/plugin-oas'\nimport { useOperationManager } from '@kubb/plugin-oas/hooks'\nimport { pluginTsName } from '@kubb/plugin-ts'\nimport { File, useApp } from '@kubb/react'\nimport { Client } from '../components/Client'\nimport { Operations } from '../components/Operations'\nimport type { PluginClient } from '../types'\n\nexport const axiosGenerator = createReactGenerator<PluginClient>({\n name: 'plugin-client',\n Operations({ options, operations }) {\n const { pluginManager } = useApp<PluginClient>()\n\n if (!options.templates.operations) {\n return null\n }\n\n const Template = options.templates.operations || Operations\n const name = 'operations'\n const file = pluginManager.getFile({ name, extName: '.ts', pluginKey: ['plugin-client'] })\n\n return (\n <File baseName={file.baseName} path={file.path} meta={file.meta}>\n <Template name={name} operations={operations} />\n </File>\n )\n },\n Operation({ options, operation }) {\n const { getSchemas, getName, getFile } = useOperationManager()\n\n const name = getName(operation, { type: 'function' })\n const typedSchemas = getSchemas(operation, { pluginKey: [pluginTsName], type: 'type' })\n const file = getFile(operation)\n const fileType = getFile(operation, { pluginKey: [pluginTsName] })\n\n if (!options.templates.client) {\n return null\n }\n\n const Template = options.templates.client || Client\n\n return (\n <File baseName={file.baseName} path={file.path} meta={file.meta}>\n <File.Import name={'client'} path={options.client.importPath} />\n <File.Import name={['ResponseConfig']} path={options.client.importPath} isTypeOnly />\n <File.Import\n extName={options.extName}\n name={[\n typedSchemas.request?.name,\n typedSchemas.response.name,\n typedSchemas.pathParams?.name,\n typedSchemas.queryParams?.name,\n typedSchemas.headerParams?.name,\n ].filter(Boolean)}\n root={file.path}\n path={fileType.path}\n isTypeOnly\n />\n <Template name={name} options={options} typedSchemas={typedSchemas} operation={operation} />\n </File>\n )\n },\n})\n"]
|
|
1
|
+
{"version":3,"sources":["../src/generators/axiosGenerator.tsx"],"names":[],"mappings":";;;;;;;AAQO,IAAM,iBAAiB,oBAAmC,CAAA;AAAA,EAC/D,IAAM,EAAA,eAAA;AAAA,EACN,UAAW,CAAA,EAAE,OAAS,EAAA,UAAA,EAAc,EAAA;AAClC,IAAM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from '@kubb/plugin-oas'\nimport { useOperationManager } from '@kubb/plugin-oas/hooks'\nimport { pluginTsName } from '@kubb/plugin-ts'\nimport { File, useApp } from '@kubb/react'\nimport { Client } from '../components/Client'\nimport { Operations } from '../components/Operations'\nimport type { PluginClient } from '../types'\n\nexport const axiosGenerator = createReactGenerator<PluginClient>({\n name: 'plugin-client',\n Operations({ options, operations }) {\n const { pluginManager } = useApp<PluginClient>()\n\n if (!options.templates.operations) {\n return null\n }\n\n const Template = options.templates.operations || Operations\n const name = 'operations'\n const file = pluginManager.getFile({ name, extName: '.ts', pluginKey: ['plugin-client'] })\n\n return (\n <File baseName={file.baseName} path={file.path} meta={file.meta}>\n <Template name={name} operations={operations} />\n </File>\n )\n },\n Operation({ options, operation }) {\n const { getSchemas, getName, getFile } = useOperationManager()\n\n const name = getName(operation, { type: 'function' })\n const typedSchemas = getSchemas(operation, { pluginKey: [pluginTsName], type: 'type' })\n const file = getFile(operation)\n const fileType = getFile(operation, { pluginKey: [pluginTsName] })\n\n if (!options.templates.client) {\n return null\n }\n\n const Template = options.templates.client || Client\n\n return (\n <File baseName={file.baseName} path={file.path} meta={file.meta}>\n <File.Import name={'client'} path={options.client.importPath} />\n <File.Import name={['ResponseConfig']} path={options.client.importPath} isTypeOnly />\n <File.Import\n extName={options.extName}\n name={[\n typedSchemas.request?.name,\n typedSchemas.response.name,\n typedSchemas.pathParams?.name,\n typedSchemas.queryParams?.name,\n typedSchemas.headerParams?.name,\n ].filter(Boolean)}\n root={file.path}\n path={fileType.path}\n isTypeOnly\n />\n <Template name={name} options={options} typedSchemas={typedSchemas} operation={operation} />\n </File>\n )\n },\n})\n"]}
|
package/dist/chunk-YJOVLRSC.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"chunk-YJOVLRSC.js"}
|
package/dist/client.cjs
CHANGED
|
@@ -1,6 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var axios = require('axios');
|
|
6
|
+
|
|
7
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
8
|
+
|
|
9
|
+
var axios__default = /*#__PURE__*/_interopDefault(axios);
|
|
10
|
+
|
|
11
|
+
// client.ts
|
|
12
|
+
var axiosInstance = axios__default.default.create({
|
|
4
13
|
baseURL: typeof AXIOS_BASE !== "undefined" ? AXIOS_BASE : void 0,
|
|
5
14
|
headers: typeof AXIOS_HEADERS !== "undefined" ? JSON.parse(AXIOS_HEADERS) : void 0
|
|
6
15
|
});
|
|
@@ -12,8 +21,8 @@ var axiosClient = async (config) => {
|
|
|
12
21
|
};
|
|
13
22
|
var client_default = axiosClient;
|
|
14
23
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
24
|
+
exports.axiosClient = axiosClient;
|
|
25
|
+
exports.axiosInstance = axiosInstance;
|
|
26
|
+
exports.default = client_default;
|
|
27
|
+
//# sourceMappingURL=client.cjs.map
|
|
19
28
|
//# sourceMappingURL=client.cjs.map
|
package/dist/client.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["../client.ts"],"names":["axios"],"mappings":";;;;;;;;;;;AA8Ba,IAAA,aAAA,GAAgBA,uBAAM,MAAO,CAAA;AAAA,EACxC,OAAS,EAAA,OAAO,UAAe,KAAA,WAAA,GAAc,UAAa,GAAA,KAAA,CAAA;AAAA,EAC1D,SAAS,OAAO,aAAA,KAAkB,cAAe,IAAK,CAAA,KAAA,CAAM,aAAa,CAAqB,GAAA,KAAA,CAAA;AAChG,CAAC,EAAA;AAEY,IAAA,WAAA,GAAc,OAAsD,MAAsE,KAAA;AACrJ,EAAA,MAAM,UAAU,aAAc,CAAA,OAAA,CAAsC,MAAM,CAAE,CAAA,KAAA,CAAM,CAAC,CAA0B,KAAA;AAC3G,IAAM,MAAA,CAAA,CAAA;AAAA,GACP,CAAA,CAAA;AAED,EAAO,OAAA,OAAA,CAAA;AACT,EAAA;AAEA,IAAO,cAAQ,GAAA","file":"client.cjs","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' | 'options'\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"]}
|
package/dist/client.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import axios from 'axios';
|
|
2
|
+
|
|
1
3
|
// client.ts
|
|
2
|
-
import axios from "axios";
|
|
3
4
|
var axiosInstance = axios.create({
|
|
4
5
|
baseURL: typeof AXIOS_BASE !== "undefined" ? AXIOS_BASE : void 0,
|
|
5
6
|
headers: typeof AXIOS_HEADERS !== "undefined" ? JSON.parse(AXIOS_HEADERS) : void 0
|
|
@@ -11,9 +12,7 @@ var axiosClient = async (config) => {
|
|
|
11
12
|
return promise;
|
|
12
13
|
};
|
|
13
14
|
var client_default = axiosClient;
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
client_default as default
|
|
18
|
-
};
|
|
15
|
+
|
|
16
|
+
export { axiosClient, axiosInstance, client_default as default };
|
|
17
|
+
//# sourceMappingURL=client.js.map
|
|
19
18
|
//# sourceMappingURL=client.js.map
|
package/dist/client.js.map
CHANGED
|
@@ -1 +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' | 'options'\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"]
|
|
1
|
+
{"version":3,"sources":["../client.ts"],"names":[],"mappings":";;;AA8Ba,IAAA,aAAA,GAAgB,MAAM,MAAO,CAAA;AAAA,EACxC,OAAS,EAAA,OAAO,UAAe,KAAA,WAAA,GAAc,UAAa,GAAA,KAAA,CAAA;AAAA,EAC1D,SAAS,OAAO,aAAA,KAAkB,cAAe,IAAK,CAAA,KAAA,CAAM,aAAa,CAAqB,GAAA,KAAA,CAAA;AAChG,CAAC,EAAA;AAEY,IAAA,WAAA,GAAc,OAAsD,MAAsE,KAAA;AACrJ,EAAA,MAAM,UAAU,aAAc,CAAA,OAAA,CAAsC,MAAM,CAAE,CAAA,KAAA,CAAM,CAAC,CAA0B,KAAA;AAC3G,IAAM,MAAA,CAAA,CAAA;AAAA,GACP,CAAA,CAAA;AAED,EAAO,OAAA,OAAA,CAAA;AACT,EAAA;AAEA,IAAO,cAAQ,GAAA","file":"client.js","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' | 'options'\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"]}
|
package/dist/components.cjs
CHANGED
|
@@ -1,10 +1,17 @@
|
|
|
1
|
-
|
|
1
|
+
'use strict';
|
|
2
2
|
|
|
3
|
+
require('./chunk-AZDWYBLW.cjs');
|
|
4
|
+
var chunkPO22ZUSH_cjs = require('./chunk-PO22ZUSH.cjs');
|
|
3
5
|
|
|
4
6
|
|
|
5
|
-
var _chunkPO22ZUSHcjs = require('./chunk-PO22ZUSH.cjs');
|
|
6
7
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
Object.defineProperty(exports, "Client", {
|
|
9
|
+
enumerable: true,
|
|
10
|
+
get: function () { return chunkPO22ZUSH_cjs.Client; }
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "Operations", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () { return chunkPO22ZUSH_cjs.Operations; }
|
|
15
|
+
});
|
|
16
|
+
//# sourceMappingURL=components.cjs.map
|
|
10
17
|
//# sourceMappingURL=components.cjs.map
|
package/dist/components.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"components.cjs"}
|
package/dist/components.js
CHANGED
|
@@ -1,10 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
Operations
|
|
5
|
-
} from "./chunk-QBFKND4S.js";
|
|
6
|
-
export {
|
|
7
|
-
Client,
|
|
8
|
-
Operations
|
|
9
|
-
};
|
|
1
|
+
import './chunk-YJOVLRSC.js';
|
|
2
|
+
export { Client, Operations } from './chunk-QBFKND4S.js';
|
|
3
|
+
//# sourceMappingURL=components.js.map
|
|
10
4
|
//# sourceMappingURL=components.js.map
|
package/dist/components.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"components.js"}
|
package/dist/generators.cjs
CHANGED
|
@@ -1,8 +1,13 @@
|
|
|
1
|
-
|
|
1
|
+
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunk3NQF7BGA_cjs = require('./chunk-3NQF7BGA.cjs');
|
|
4
4
|
require('./chunk-PO22ZUSH.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
|
|
8
|
+
Object.defineProperty(exports, "axiosGenerator", {
|
|
9
|
+
enumerable: true,
|
|
10
|
+
get: function () { return chunk3NQF7BGA_cjs.axiosGenerator; }
|
|
11
|
+
});
|
|
12
|
+
//# sourceMappingURL=generators.cjs.map
|
|
8
13
|
//# sourceMappingURL=generators.cjs.map
|
package/dist/generators.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"generators.cjs"}
|
package/dist/generators.js
CHANGED
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import "./chunk-QBFKND4S.js";
|
|
5
|
-
export {
|
|
6
|
-
axiosGenerator
|
|
7
|
-
};
|
|
1
|
+
export { axiosGenerator } from './chunk-QLVGX3VO.js';
|
|
2
|
+
import './chunk-QBFKND4S.js';
|
|
3
|
+
//# sourceMappingURL=generators.js.map
|
|
8
4
|
//# sourceMappingURL=generators.js.map
|
package/dist/generators.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"generators.js"}
|
package/dist/index.cjs
CHANGED
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
|
|
1
|
+
'use strict';
|
|
2
2
|
|
|
3
|
+
require('./chunk-AZDWYBLW.cjs');
|
|
4
|
+
var chunk3NQF7BGA_cjs = require('./chunk-3NQF7BGA.cjs');
|
|
5
|
+
var chunkPO22ZUSH_cjs = require('./chunk-PO22ZUSH.cjs');
|
|
6
|
+
var path = require('path');
|
|
7
|
+
var core = require('@kubb/core');
|
|
8
|
+
var transformers = require('@kubb/core/transformers');
|
|
9
|
+
var utils = require('@kubb/core/utils');
|
|
10
|
+
var pluginOas = require('@kubb/plugin-oas');
|
|
3
11
|
|
|
4
|
-
|
|
12
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
5
13
|
|
|
14
|
+
var path__default = /*#__PURE__*/_interopDefault(path);
|
|
6
15
|
|
|
7
|
-
|
|
8
|
-
var _chunkPO22ZUSHcjs = require('./chunk-PO22ZUSH.cjs');
|
|
9
|
-
|
|
10
|
-
// src/plugin.ts
|
|
11
|
-
var _path = require('path'); var _path2 = _interopRequireDefault(_path);
|
|
12
|
-
var _core = require('@kubb/core');
|
|
13
|
-
var _transformers = require('@kubb/core/transformers');
|
|
14
|
-
var _utils = require('@kubb/core/utils');
|
|
15
|
-
var _pluginoas = require('@kubb/plugin-oas');
|
|
16
16
|
var pluginClientName = "plugin-client";
|
|
17
|
-
var pluginClient =
|
|
17
|
+
var pluginClient = core.createPlugin((options) => {
|
|
18
18
|
const {
|
|
19
19
|
output = { path: "clients" },
|
|
20
20
|
group,
|
|
21
21
|
exclude = [],
|
|
22
22
|
include,
|
|
23
23
|
override = [],
|
|
24
|
-
transformers = {},
|
|
24
|
+
transformers: transformers$1 = {},
|
|
25
25
|
dataReturnType = "data",
|
|
26
26
|
pathParamsType = "inline",
|
|
27
27
|
templates
|
|
28
28
|
} = options;
|
|
29
|
-
const template =
|
|
29
|
+
const template = group?.output ? group.output : `${output.path}/{{tag}}Controller`;
|
|
30
30
|
return {
|
|
31
31
|
name: pluginClientName,
|
|
32
32
|
output: {
|
|
@@ -43,39 +43,39 @@ var pluginClient = _core.createPlugin.call(void 0, (options) => {
|
|
|
43
43
|
},
|
|
44
44
|
pathParamsType,
|
|
45
45
|
templates: {
|
|
46
|
-
operations:
|
|
47
|
-
client:
|
|
46
|
+
operations: chunkPO22ZUSH_cjs.Operations,
|
|
47
|
+
client: chunkPO22ZUSH_cjs.Client,
|
|
48
48
|
...templates
|
|
49
49
|
},
|
|
50
50
|
baseURL: void 0
|
|
51
51
|
},
|
|
52
|
-
pre: [
|
|
52
|
+
pre: [pluginOas.pluginOasName],
|
|
53
53
|
resolvePath(baseName, pathMode, options2) {
|
|
54
|
-
const root =
|
|
55
|
-
const mode =
|
|
54
|
+
const root = path__default.default.resolve(this.config.root, this.config.output.path);
|
|
55
|
+
const mode = pathMode ?? core.FileManager.getMode(path__default.default.resolve(root, output.path));
|
|
56
56
|
if (mode === "single") {
|
|
57
|
-
return
|
|
57
|
+
return path__default.default.resolve(root, output.path);
|
|
58
58
|
}
|
|
59
|
-
if (
|
|
60
|
-
const tag =
|
|
61
|
-
return
|
|
59
|
+
if (options2?.tag && group?.type === "tag") {
|
|
60
|
+
const tag = transformers.camelCase(options2.tag);
|
|
61
|
+
return path__default.default.resolve(root, utils.renderTemplate(template, { tag }), baseName);
|
|
62
62
|
}
|
|
63
|
-
return
|
|
63
|
+
return path__default.default.resolve(root, output.path, baseName);
|
|
64
64
|
},
|
|
65
65
|
resolveName(name, type) {
|
|
66
|
-
const resolvedName =
|
|
66
|
+
const resolvedName = transformers.camelCase(name, { isFile: type === "file" });
|
|
67
67
|
if (type) {
|
|
68
|
-
return
|
|
68
|
+
return transformers$1?.name?.(resolvedName, type) || resolvedName;
|
|
69
69
|
}
|
|
70
70
|
return resolvedName;
|
|
71
71
|
},
|
|
72
72
|
async buildStart() {
|
|
73
|
-
const [swaggerPlugin] =
|
|
73
|
+
const [swaggerPlugin] = core.PluginManager.getDependedPlugins(this.plugins, [pluginOas.pluginOasName]);
|
|
74
74
|
const oas = await swaggerPlugin.context.getOas();
|
|
75
|
-
const root =
|
|
76
|
-
const mode =
|
|
75
|
+
const root = path__default.default.resolve(this.config.root, this.config.output.path);
|
|
76
|
+
const mode = core.FileManager.getMode(path__default.default.resolve(root, output.path));
|
|
77
77
|
const baseURL = await swaggerPlugin.context.getBaseURL();
|
|
78
|
-
const operationGenerator = new
|
|
78
|
+
const operationGenerator = new pluginOas.OperationGenerator(
|
|
79
79
|
{
|
|
80
80
|
...this.plugin.options,
|
|
81
81
|
baseURL
|
|
@@ -91,7 +91,7 @@ var pluginClient = _core.createPlugin.call(void 0, (options) => {
|
|
|
91
91
|
mode
|
|
92
92
|
}
|
|
93
93
|
);
|
|
94
|
-
const files = await operationGenerator.build(
|
|
94
|
+
const files = await operationGenerator.build(chunk3NQF7BGA_cjs.axiosGenerator);
|
|
95
95
|
await this.addFile(...files);
|
|
96
96
|
if (this.config.output.exportType) {
|
|
97
97
|
const barrelFiles = await this.fileManager.getBarrelFiles({
|
|
@@ -109,7 +109,7 @@ var pluginClient = _core.createPlugin.call(void 0, (options) => {
|
|
|
109
109
|
};
|
|
110
110
|
});
|
|
111
111
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
112
|
+
exports.pluginClient = pluginClient;
|
|
113
|
+
exports.pluginClientName = pluginClientName;
|
|
114
|
+
//# sourceMappingURL=index.cjs.map
|
|
115
115
|
//# sourceMappingURL=index.cjs.map
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["../src/plugin.ts"],"names":["createPlugin","transformers","Operations","Client","pluginOasName","options","path","FileManager","camelCase","renderTemplate","PluginManager","OperationGenerator","axiosGenerator"],"mappings":";;;;;;;;;;;;;;;AAcO,IAAM,gBAAmB,GAAA,gBAAA;AAEnB,IAAA,YAAA,GAAeA,iBAA2B,CAAA,CAAC,OAAY,KAAA;AAClE,EAAM,MAAA;AAAA,IACJ,MAAA,GAAS,EAAE,IAAA,EAAM,SAAU,EAAA;AAAA,IAC3B,KAAA;AAAA,IACA,UAAU,EAAC;AAAA,IACX,OAAA;AAAA,IACA,WAAW,EAAC;AA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qBAAA,CAAK,QAAQ,IAAM,EAAA,MAAA,CAAO,IAAI,CAAC,CAAA,CAAA;AAChE,MAAA,MAAM,OAAU,GAAA,MAAM,aAAc,CAAA,OAAA,CAAQ,UAAW,EAAA,CAAA;AAEvD,MAAA,MAAM,qBAAqB,IAAIK,4BAAA;AAAA,QAC7B;AAAA,UACE,GAAG,KAAK,MAAO,CAAA,OAAA;AAAA,UACf,OAAA;AAAA,SACF;AAAA,QACA;AAAA,UACE,GAAA;AAAA,UACA,eAAe,IAAK,CAAA,aAAA;AAAA,UACpB,QAAQ,IAAK,CAAA,MAAA;AAAA,UACb,WAAA,EAAa,cAAc,OAAQ,CAAA,WAAA;AAAA,UACnC,OAAA;AAAA,UACA,OAAA;AAAA,UACA,QAAA;AAAA,UACA,IAAA;AAAA,SACF;AAAA,OACF,CAAA;AAEA,MAAA,MAAM,KAAQ,GAAA,MAAM,kBAAmB,CAAA,KAAA,CAAMC,gCAAc,CAAA,CAAA;AAE3D,MAAM,MAAA,IAAA,CAAK,OAAQ,CAAA,GAAG,KAAK,CAAA,CAAA;AAE3B,MAAI,IAAA,IAAA,CAAK,MAAO,CAAA,MAAA,CAAO,UAAY,EAAA;AACjC,QAAA,MAAM,WAAc,GAAA,MAAM,IAAK,CAAA,WAAA,CAAY,cAAe,CAAA;AAAA,UACxD,IAAA;AAAA,UACA,MAAA;AAAA,UACA,KAAA,EAAO,KAAK,WAAY,CAAA,KAAA;AAAA,UACxB,IAAM,EAAA;AAAA,YACJ,SAAA,EAAW,KAAK,MAAO,CAAA,GAAA;AAAA,WACzB;AAAA,UACA,QAAQ,IAAK,CAAA,MAAA;AAAA,SACd,CAAA,CAAA;AAED,QAAM,MAAA,IAAA,CAAK,OAAQ,CAAA,GAAG,WAAW,CAAA,CAAA;AAAA,OACnC;AAAA,KACF;AAAA,GACF,CAAA;AACF,CAAC","file":"index.cjs","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 { OperationGenerator, pluginOasName } from '@kubb/plugin-oas'\n\nimport { Client, Operations } from './components/index.ts'\n\nimport type { Plugin } from '@kubb/core'\nimport type { PluginOas as SwaggerPluginOptions } from '@kubb/plugin-oas'\nimport { axiosGenerator } from './generators/axiosGenerator.tsx'\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 output: {\n exportType: 'barrelNamed',\n ...output,\n },\n options: {\n extName: output.extName,\n dataReturnType,\n client: {\n importPath: '@kubb/plugin-client/client',\n methods: ['get', 'post', 'delete', 'put'],\n ...options.client,\n },\n pathParamsType,\n templates: {\n operations: Operations,\n client: Client,\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 buildStart() {\n const [swaggerPlugin]: [Plugin<SwaggerPluginOptions>] = PluginManager.getDependedPlugins<SwaggerPluginOptions>(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 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.context.contentType,\n exclude,\n include,\n override,\n mode,\n },\n )\n\n const files = await operationGenerator.build(axiosGenerator)\n\n await this.addFile(...files)\n\n if (this.config.output.exportType) {\n const barrelFiles = await this.fileManager.getBarrelFiles({\n root,\n output,\n files: this.fileManager.files,\n meta: {\n pluginKey: this.plugin.key,\n },\n logger: this.logger,\n })\n\n await this.addFile(...barrelFiles)\n }\n },\n }\n})\n"]}
|
package/dist/index.js
CHANGED
|
@@ -1,18 +1,12 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
} from
|
|
1
|
+
import './chunk-YJOVLRSC.js';
|
|
2
|
+
import { axiosGenerator } from './chunk-QLVGX3VO.js';
|
|
3
|
+
import { Operations, Client } from './chunk-QBFKND4S.js';
|
|
4
|
+
import path from 'node:path';
|
|
5
|
+
import { createPlugin, FileManager, PluginManager } from '@kubb/core';
|
|
6
|
+
import { camelCase } from '@kubb/core/transformers';
|
|
7
|
+
import { renderTemplate } from '@kubb/core/utils';
|
|
8
|
+
import { pluginOasName, OperationGenerator } from '@kubb/plugin-oas';
|
|
9
9
|
|
|
10
|
-
// src/plugin.ts
|
|
11
|
-
import path from "node:path";
|
|
12
|
-
import { FileManager, PluginManager, createPlugin } from "@kubb/core";
|
|
13
|
-
import { camelCase } from "@kubb/core/transformers";
|
|
14
|
-
import { renderTemplate } from "@kubb/core/utils";
|
|
15
|
-
import { OperationGenerator, pluginOasName } from "@kubb/plugin-oas";
|
|
16
10
|
var pluginClientName = "plugin-client";
|
|
17
11
|
var pluginClient = createPlugin((options) => {
|
|
18
12
|
const {
|
|
@@ -108,8 +102,7 @@ var pluginClient = createPlugin((options) => {
|
|
|
108
102
|
}
|
|
109
103
|
};
|
|
110
104
|
});
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
};
|
|
105
|
+
|
|
106
|
+
export { pluginClient, pluginClientName };
|
|
107
|
+
//# sourceMappingURL=index.js.map
|
|
115
108
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/plugin.ts"],"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 { OperationGenerator, pluginOasName } from '@kubb/plugin-oas'\n\nimport { Client, Operations } from './components/index.ts'\n\nimport type { Plugin } from '@kubb/core'\nimport type { PluginOas as SwaggerPluginOptions } from '@kubb/plugin-oas'\nimport { axiosGenerator } from './generators/axiosGenerator.tsx'\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 output: {\n exportType: 'barrelNamed',\n ...output,\n },\n options: {\n extName: output.extName,\n dataReturnType,\n client: {\n importPath: '@kubb/plugin-client/client',\n methods: ['get', 'post', 'delete', 'put'],\n ...options.client,\n },\n pathParamsType,\n templates: {\n operations: Operations,\n client: Client,\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 buildStart() {\n const [swaggerPlugin]: [Plugin<SwaggerPluginOptions>] = PluginManager.getDependedPlugins<SwaggerPluginOptions>(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 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.context.contentType,\n exclude,\n include,\n override,\n mode,\n },\n )\n\n const files = await operationGenerator.build(axiosGenerator)\n\n await this.addFile(...files)\n\n if (this.config.output.exportType) {\n const barrelFiles = await this.fileManager.getBarrelFiles({\n root,\n output,\n files: this.fileManager.files,\n meta: {\n pluginKey: this.plugin.key,\n },\n logger: this.logger,\n })\n\n await this.addFile(...barrelFiles)\n }\n },\n }\n})\n"]
|
|
1
|
+
{"version":3,"sources":["../src/plugin.ts"],"names":["options"],"mappings":";;;;;;;;;AAcO,IAAM,gBAAmB,GAAA,gBAAA;AAEnB,IAAA,YAAA,GAAe,YAA2B,CAAA,CAAC,OAAY,KAAA;AAClE,EAAM,MAAA;AAAA,IACJ,MAAA,GAAS,EAAE,IAAA,EAAM,SAAU,EAAA;AAAA,IAC3B,KAAA;AAAA,IACA,U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port { camelCase } from '@kubb/core/transformers'\nimport { renderTemplate } from '@kubb/core/utils'\nimport { OperationGenerator, pluginOasName } from '@kubb/plugin-oas'\n\nimport { Client, Operations } from './components/index.ts'\n\nimport type { Plugin } from '@kubb/core'\nimport type { PluginOas as SwaggerPluginOptions } from '@kubb/plugin-oas'\nimport { axiosGenerator } from './generators/axiosGenerator.tsx'\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 output: {\n exportType: 'barrelNamed',\n ...output,\n },\n options: {\n extName: output.extName,\n dataReturnType,\n client: {\n importPath: '@kubb/plugin-client/client',\n methods: ['get', 'post', 'delete', 'put'],\n ...options.client,\n },\n pathParamsType,\n templates: {\n operations: Operations,\n client: Client,\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 buildStart() {\n const [swaggerPlugin]: [Plugin<SwaggerPluginOptions>] = PluginManager.getDependedPlugins<SwaggerPluginOptions>(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 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.context.contentType,\n exclude,\n include,\n override,\n mode,\n },\n )\n\n const files = await operationGenerator.build(axiosGenerator)\n\n await this.addFile(...files)\n\n if (this.config.output.exportType) {\n const barrelFiles = await this.fileManager.getBarrelFiles({\n root,\n output,\n files: this.fileManager.files,\n meta: {\n pluginKey: this.plugin.key,\n },\n logger: this.logger,\n })\n\n await this.addFile(...barrelFiles)\n }\n },\n }\n})\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kubb/plugin-client",
|
|
3
|
-
"version": "3.0.0-alpha.
|
|
3
|
+
"version": "3.0.0-alpha.12",
|
|
4
4
|
"description": "Generator plugin-client",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"typescript",
|
|
@@ -72,27 +72,27 @@
|
|
|
72
72
|
"!/**/__tests__/**"
|
|
73
73
|
],
|
|
74
74
|
"dependencies": {
|
|
75
|
-
"@kubb/core": "3.0.0-alpha.
|
|
76
|
-
"@kubb/fs": "3.0.0-alpha.
|
|
77
|
-
"@kubb/oas": "3.0.0-alpha.
|
|
78
|
-
"@kubb/parser-ts": "3.0.0-alpha.
|
|
79
|
-
"@kubb/plugin-oas": "3.0.0-alpha.
|
|
80
|
-
"@kubb/plugin-ts": "3.0.0-alpha.
|
|
81
|
-
"@kubb/react": "3.0.0-alpha.
|
|
75
|
+
"@kubb/core": "3.0.0-alpha.12",
|
|
76
|
+
"@kubb/fs": "3.0.0-alpha.12",
|
|
77
|
+
"@kubb/oas": "3.0.0-alpha.12",
|
|
78
|
+
"@kubb/parser-ts": "3.0.0-alpha.12",
|
|
79
|
+
"@kubb/plugin-oas": "3.0.0-alpha.12",
|
|
80
|
+
"@kubb/plugin-ts": "3.0.0-alpha.12",
|
|
81
|
+
"@kubb/react": "3.0.0-alpha.12"
|
|
82
82
|
},
|
|
83
83
|
"devDependencies": {
|
|
84
84
|
"@types/react": "^18.3.5",
|
|
85
|
-
"axios": "^1.7.
|
|
85
|
+
"axios": "^1.7.7",
|
|
86
86
|
"react": "^18.3.1",
|
|
87
87
|
"tsup": "^8.2.4",
|
|
88
88
|
"typescript": "^5.5.4",
|
|
89
|
-
"@kubb/config-biome": "3.0.0-alpha.
|
|
90
|
-
"@kubb/config-ts": "3.0.0-alpha.
|
|
91
|
-
"@kubb/config-tsup": "3.0.0-alpha.
|
|
89
|
+
"@kubb/config-biome": "3.0.0-alpha.12",
|
|
90
|
+
"@kubb/config-ts": "3.0.0-alpha.12",
|
|
91
|
+
"@kubb/config-tsup": "3.0.0-alpha.12"
|
|
92
92
|
},
|
|
93
93
|
"peerDependencies": {
|
|
94
94
|
"axios": "^1.7.2",
|
|
95
|
-
"@kubb/react": "3.0.0-alpha.
|
|
95
|
+
"@kubb/react": "3.0.0-alpha.12"
|
|
96
96
|
},
|
|
97
97
|
"peerDependenciesMeta": {
|
|
98
98
|
"axios": {
|