@1szx1/vite-plugin-swagger2ts 1.1.3 → 1.1.5
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.d.ts +2 -1
- package/dist/index.cjs +1 -2
- package/dist/index.mjs +1 -2
- package/package.json +1 -1
package/dist/adapters.d.ts
CHANGED
|
@@ -12,11 +12,12 @@ declare function axiosAdapter<T>(httpInstance: AxiosInstance): {
|
|
|
12
12
|
}) | undefined) => Promise<T[U][M]["response" & keyof T[U][M]]>;
|
|
13
13
|
};
|
|
14
14
|
|
|
15
|
-
declare function LuchAdapter<T extends Record<string, any
|
|
15
|
+
declare function LuchAdapter<T extends Record<string, any>, C extends HttpRequestConfig['custom'] = HttpRequestConfig['custom']>(httpInstance: Request__default): {
|
|
16
16
|
request: <U extends keyof T, M extends string & keyof T[U]>(url: U & string, method: M, param?: Get<T[U][M]["param" & keyof T[U][M]], M extends "get" ? "query" : "body"> | undefined, config?: (HttpRequestConfig<Request.HttpTask> & {
|
|
17
17
|
data?: Get<T[U][M]["param" & keyof T[U][M]], "body"> | undefined;
|
|
18
18
|
params?: Get<T[U][M]["param" & keyof T[U][M]], "query"> | undefined;
|
|
19
19
|
path?: Get<T[U][M]["param" & keyof T[U][M]], "path"> | undefined;
|
|
20
|
+
custom?: C | undefined;
|
|
20
21
|
}) | undefined) => Promise<T[U][M]["response" & keyof T[U][M]]>;
|
|
21
22
|
upload: <U_1 extends { [K in keyof T]: T[K] extends {
|
|
22
23
|
post: any;
|
package/dist/index.cjs
CHANGED
|
@@ -236,7 +236,6 @@ function swagger2TsPlugin(userOptions) {
|
|
|
236
236
|
return "";
|
|
237
237
|
}
|
|
238
238
|
const apistrings = generateDocs(openapiDocs, { docsName, baseUrl: docs.basePath ?? "", formatSchema });
|
|
239
|
-
console.log(`%c[vite-plugin-swagger2ts]: ${docsName} succeeded`, "color: #00ff00;");
|
|
240
239
|
return apistrings;
|
|
241
240
|
} catch (error) {
|
|
242
241
|
console.log(`%c[vite-plugin-swagger2ts]: ${docsName} error`, "color: #ff0000;", error);
|
|
@@ -250,7 +249,7 @@ function swagger2TsPlugin(userOptions) {
|
|
|
250
249
|
const code = (await Promise.all(sources.map(genCode))).reduce((a, b, index, list) => {
|
|
251
250
|
let res = a + b;
|
|
252
251
|
if (index === list.length - 1) {
|
|
253
|
-
const suffix = `export type ${getPathsName("
|
|
252
|
+
const suffix = `export type ${getPathsName("_Intersection")} = ${sources.map(({ name }) => getPathsName(name)).join("&")}
|
|
254
253
|
`;
|
|
255
254
|
res += suffix;
|
|
256
255
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -228,7 +228,6 @@ function swagger2TsPlugin(userOptions) {
|
|
|
228
228
|
return "";
|
|
229
229
|
}
|
|
230
230
|
const apistrings = generateDocs(openapiDocs, { docsName, baseUrl: docs.basePath ?? "", formatSchema });
|
|
231
|
-
console.log(`%c[vite-plugin-swagger2ts]: ${docsName} succeeded`, "color: #00ff00;");
|
|
232
231
|
return apistrings;
|
|
233
232
|
} catch (error) {
|
|
234
233
|
console.log(`%c[vite-plugin-swagger2ts]: ${docsName} error`, "color: #ff0000;", error);
|
|
@@ -242,7 +241,7 @@ function swagger2TsPlugin(userOptions) {
|
|
|
242
241
|
const code = (await Promise.all(sources.map(genCode))).reduce((a, b, index, list) => {
|
|
243
242
|
let res = a + b;
|
|
244
243
|
if (index === list.length - 1) {
|
|
245
|
-
const suffix = `export type ${getPathsName("
|
|
244
|
+
const suffix = `export type ${getPathsName("_Intersection")} = ${sources.map(({ name }) => getPathsName(name)).join("&")}
|
|
246
245
|
`;
|
|
247
246
|
res += suffix;
|
|
248
247
|
}
|
package/package.json
CHANGED