@1szx1/vite-plugin-swagger2ts 1.3.4 → 1.3.6
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.cjs +1 -1
- package/dist/adapters.d.cts +4 -5
- package/dist/adapters.d.mts +4 -5
- package/dist/adapters.d.ts +4 -5
- package/dist/adapters.mjs +1 -1
- package/package.json +1 -1
package/dist/adapters.cjs
CHANGED
package/dist/adapters.d.cts
CHANGED
|
@@ -1,16 +1,15 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { AxiosInstance, AxiosRequestConfig } from 'axios';
|
|
1
|
+
import { AxiosInstance, AxiosRequestConfig, AxiosResponse } from 'axios';
|
|
3
2
|
import * as luch_request from 'luch-request';
|
|
4
3
|
import luch_request__default, { HttpRequestConfig } from 'luch-request';
|
|
5
4
|
|
|
6
5
|
type Get<T, K> = T[K & keyof T];
|
|
7
6
|
|
|
8
|
-
declare function axiosAdapter<T>(httpInstance: AxiosInstance): {
|
|
7
|
+
declare function axiosAdapter<T, AxiosRes = true>(httpInstance: AxiosInstance): {
|
|
9
8
|
request: <U extends string & keyof T, M extends string & keyof T[U]>(url: U, method: M, param?: Get<T[U][M]["param" & keyof T[U][M]], M extends "get" ? "query" : "body"> | undefined, config?: (AxiosRequestConfig<any> & {
|
|
10
9
|
data?: Get<T[U][M]["param" & keyof T[U][M]], "body"> | undefined;
|
|
11
10
|
params?: Get<T[U][M]["param" & keyof T[U][M]], "query"> | undefined;
|
|
12
11
|
path?: Get<T[U][M]["param" & keyof T[U][M]], "path"> | undefined;
|
|
13
|
-
}) | undefined) => Promise<
|
|
12
|
+
}) | undefined) => Promise<AxiosRes extends true ? AxiosResponse<T[U][M]["response" & keyof T[U][M]], any> : T[U][M]["response" & keyof T[U][M]]>;
|
|
14
13
|
};
|
|
15
14
|
|
|
16
15
|
declare function LuchAdapter<T extends Record<string, any>, C extends HttpRequestConfig = HttpRequestConfig>(httpInstance: luch_request__default): {
|
|
@@ -18,7 +17,7 @@ declare function LuchAdapter<T extends Record<string, any>, C extends HttpReques
|
|
|
18
17
|
data?: Get<T[U][M]["param" & keyof T[U][M]], "body"> | undefined;
|
|
19
18
|
params?: Get<T[U][M]["param" & keyof T[U][M]], "query"> | undefined;
|
|
20
19
|
path?: Get<T[U][M]["param" & keyof T[U][M]], "path"> | undefined;
|
|
21
|
-
}) | undefined) => Promise<T[U][M]["response" & keyof T[U][M]]
|
|
20
|
+
}) | undefined) => Promise<luch_request.HttpResponse<T[U][M]["response" & keyof T[U][M]], luch_request.HttpTask>>;
|
|
22
21
|
upload: <U_1 extends { [K in keyof T]: T[K] extends {
|
|
23
22
|
post: any;
|
|
24
23
|
} ? K : never; }[keyof T], P extends Get<T[U_1]["post"]["param" & keyof T[U_1]["post"]], "body" | "query">, N extends keyof P>(url: U_1 & string, config: HttpRequestConfig<UniApp.UploadTask> & {
|
package/dist/adapters.d.mts
CHANGED
|
@@ -1,16 +1,15 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { AxiosInstance, AxiosRequestConfig } from 'axios';
|
|
1
|
+
import { AxiosInstance, AxiosRequestConfig, AxiosResponse } from 'axios';
|
|
3
2
|
import * as luch_request from 'luch-request';
|
|
4
3
|
import luch_request__default, { HttpRequestConfig } from 'luch-request';
|
|
5
4
|
|
|
6
5
|
type Get<T, K> = T[K & keyof T];
|
|
7
6
|
|
|
8
|
-
declare function axiosAdapter<T>(httpInstance: AxiosInstance): {
|
|
7
|
+
declare function axiosAdapter<T, AxiosRes = true>(httpInstance: AxiosInstance): {
|
|
9
8
|
request: <U extends string & keyof T, M extends string & keyof T[U]>(url: U, method: M, param?: Get<T[U][M]["param" & keyof T[U][M]], M extends "get" ? "query" : "body"> | undefined, config?: (AxiosRequestConfig<any> & {
|
|
10
9
|
data?: Get<T[U][M]["param" & keyof T[U][M]], "body"> | undefined;
|
|
11
10
|
params?: Get<T[U][M]["param" & keyof T[U][M]], "query"> | undefined;
|
|
12
11
|
path?: Get<T[U][M]["param" & keyof T[U][M]], "path"> | undefined;
|
|
13
|
-
}) | undefined) => Promise<
|
|
12
|
+
}) | undefined) => Promise<AxiosRes extends true ? AxiosResponse<T[U][M]["response" & keyof T[U][M]], any> : T[U][M]["response" & keyof T[U][M]]>;
|
|
14
13
|
};
|
|
15
14
|
|
|
16
15
|
declare function LuchAdapter<T extends Record<string, any>, C extends HttpRequestConfig = HttpRequestConfig>(httpInstance: luch_request__default): {
|
|
@@ -18,7 +17,7 @@ declare function LuchAdapter<T extends Record<string, any>, C extends HttpReques
|
|
|
18
17
|
data?: Get<T[U][M]["param" & keyof T[U][M]], "body"> | undefined;
|
|
19
18
|
params?: Get<T[U][M]["param" & keyof T[U][M]], "query"> | undefined;
|
|
20
19
|
path?: Get<T[U][M]["param" & keyof T[U][M]], "path"> | undefined;
|
|
21
|
-
}) | undefined) => Promise<T[U][M]["response" & keyof T[U][M]]
|
|
20
|
+
}) | undefined) => Promise<luch_request.HttpResponse<T[U][M]["response" & keyof T[U][M]], luch_request.HttpTask>>;
|
|
22
21
|
upload: <U_1 extends { [K in keyof T]: T[K] extends {
|
|
23
22
|
post: any;
|
|
24
23
|
} ? K : never; }[keyof T], P extends Get<T[U_1]["post"]["param" & keyof T[U_1]["post"]], "body" | "query">, N extends keyof P>(url: U_1 & string, config: HttpRequestConfig<UniApp.UploadTask> & {
|
package/dist/adapters.d.ts
CHANGED
|
@@ -1,16 +1,15 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { AxiosInstance, AxiosRequestConfig } from 'axios';
|
|
1
|
+
import { AxiosInstance, AxiosRequestConfig, AxiosResponse } from 'axios';
|
|
3
2
|
import * as luch_request from 'luch-request';
|
|
4
3
|
import luch_request__default, { HttpRequestConfig } from 'luch-request';
|
|
5
4
|
|
|
6
5
|
type Get<T, K> = T[K & keyof T];
|
|
7
6
|
|
|
8
|
-
declare function axiosAdapter<T>(httpInstance: AxiosInstance): {
|
|
7
|
+
declare function axiosAdapter<T, AxiosRes = true>(httpInstance: AxiosInstance): {
|
|
9
8
|
request: <U extends string & keyof T, M extends string & keyof T[U]>(url: U, method: M, param?: Get<T[U][M]["param" & keyof T[U][M]], M extends "get" ? "query" : "body"> | undefined, config?: (AxiosRequestConfig<any> & {
|
|
10
9
|
data?: Get<T[U][M]["param" & keyof T[U][M]], "body"> | undefined;
|
|
11
10
|
params?: Get<T[U][M]["param" & keyof T[U][M]], "query"> | undefined;
|
|
12
11
|
path?: Get<T[U][M]["param" & keyof T[U][M]], "path"> | undefined;
|
|
13
|
-
}) | undefined) => Promise<
|
|
12
|
+
}) | undefined) => Promise<AxiosRes extends true ? AxiosResponse<T[U][M]["response" & keyof T[U][M]], any> : T[U][M]["response" & keyof T[U][M]]>;
|
|
14
13
|
};
|
|
15
14
|
|
|
16
15
|
declare function LuchAdapter<T extends Record<string, any>, C extends HttpRequestConfig = HttpRequestConfig>(httpInstance: luch_request__default): {
|
|
@@ -18,7 +17,7 @@ declare function LuchAdapter<T extends Record<string, any>, C extends HttpReques
|
|
|
18
17
|
data?: Get<T[U][M]["param" & keyof T[U][M]], "body"> | undefined;
|
|
19
18
|
params?: Get<T[U][M]["param" & keyof T[U][M]], "query"> | undefined;
|
|
20
19
|
path?: Get<T[U][M]["param" & keyof T[U][M]], "path"> | undefined;
|
|
21
|
-
}) | undefined) => Promise<T[U][M]["response" & keyof T[U][M]]
|
|
20
|
+
}) | undefined) => Promise<luch_request.HttpResponse<T[U][M]["response" & keyof T[U][M]], luch_request.HttpTask>>;
|
|
22
21
|
upload: <U_1 extends { [K in keyof T]: T[K] extends {
|
|
23
22
|
post: any;
|
|
24
23
|
} ? K : never; }[keyof T], P extends Get<T[U_1]["post"]["param" & keyof T[U_1]["post"]], "body" | "query">, N extends keyof P>(url: U_1 & string, config: HttpRequestConfig<UniApp.UploadTask> & {
|
package/dist/adapters.mjs
CHANGED
package/package.json
CHANGED