@1szx1/vite-plugin-swagger2ts 1.0.9 → 1.0.11
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/adapters/index.cjs +51 -0
- package/dist/adapters/index.js +3 -28
- package/dist/{index.mjs → index.cjs} +1032 -1002
- package/dist/index.js +1002 -1032
- package/package.json +9 -10
- package/dist/adapters/index.mjs +0 -26
- /package/dist/{chunk-TTFRSOOU.mjs → chunk-O6HOO6WA.js} +0 -0
package/package.json
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@1szx1/vite-plugin-swagger2ts",
|
|
3
3
|
"description": "fork for https://github.com/1SZX1/vite-plugin-swagger2ts",
|
|
4
|
-
"version": "1.0.
|
|
5
|
-
"main": "dist/index.
|
|
6
|
-
"module": "dist/index.
|
|
7
|
-
"types": "index.d.ts",
|
|
4
|
+
"version": "1.0.11",
|
|
5
|
+
"main": "dist/index.cjs",
|
|
6
|
+
"module": "dist/index.js",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"type": "module",
|
|
8
9
|
"license": "MIT",
|
|
9
10
|
"author": "1SZX1 <2414126198@qq.com>",
|
|
10
11
|
"repository": {
|
|
@@ -18,14 +19,12 @@
|
|
|
18
19
|
],
|
|
19
20
|
"exports": {
|
|
20
21
|
".": {
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
"import": "./dist/index.mjs"
|
|
22
|
+
"require": "./dist/index.cjs",
|
|
23
|
+
"import": "./dist/index.js"
|
|
24
24
|
},
|
|
25
25
|
"./adapters": {
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
"import": "./dist/adapters/index.mjs"
|
|
26
|
+
"require": "./dist/adapters/index.cjs",
|
|
27
|
+
"import": "./dist/adapters/index.js"
|
|
29
28
|
}
|
|
30
29
|
},
|
|
31
30
|
"scripts": {
|
package/dist/adapters/index.mjs
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import "../chunk-TTFRSOOU.mjs";
|
|
2
|
-
|
|
3
|
-
// src/adapters/utils.ts
|
|
4
|
-
function mergeUrlParam(url, paths) {
|
|
5
|
-
return url.replace(/{(.*?)}/g, (_, key) => paths[key]);
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
// src/adapters/axios.ts
|
|
9
|
-
function axiosAdapter(httpInstance) {
|
|
10
|
-
async function request(url, method, param, config) {
|
|
11
|
-
if (config?.path)
|
|
12
|
-
url = mergeUrlParam(url, config.path);
|
|
13
|
-
const response = await httpInstance.request({
|
|
14
|
-
url,
|
|
15
|
-
method,
|
|
16
|
-
params: method === "get" ? param : config?.params,
|
|
17
|
-
data: method !== "get" ? param : config?.data,
|
|
18
|
-
...config
|
|
19
|
-
});
|
|
20
|
-
return response.data;
|
|
21
|
-
}
|
|
22
|
-
return { request };
|
|
23
|
-
}
|
|
24
|
-
export {
|
|
25
|
-
axiosAdapter
|
|
26
|
-
};
|
|
File without changes
|