@hapaul/api 0.1.5 → 0.1.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/index.d.ts +5 -5
- package/dist/index.js +10 -10
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -2261,11 +2261,11 @@ declare class Client<C = {}> {
|
|
|
2261
2261
|
constructor(config?: ClientConfig);
|
|
2262
2262
|
use(middleware: Middleware<C>): void;
|
|
2263
2263
|
request<T extends PathsWithMethod<paths, M>, M extends Methods>(method: M, path: T, ...params: RequestParams<T, M, C>): RequestResponse<T, M>;
|
|
2264
|
-
get<T extends PathsWithMethod<paths, 'get'>>(path: T, params:
|
|
2265
|
-
post<T extends PathsWithMethod<paths, 'post'>>(path: T, params:
|
|
2266
|
-
patch<T extends PathsWithMethod<paths, 'patch'>>(path: T, params:
|
|
2267
|
-
put<T extends PathsWithMethod<paths, 'put'>>(path: T, params:
|
|
2268
|
-
delete<T extends PathsWithMethod<paths, 'delete'>>(path: T, params:
|
|
2264
|
+
get<T extends PathsWithMethod<paths, 'get'>>(path: T, ...params: RequestParams<T, 'get', C>): RequestResponse<T, 'get'>;
|
|
2265
|
+
post<T extends PathsWithMethod<paths, 'post'>>(path: T, ...params: RequestParams<T, 'post', C>): RequestResponse<T, 'post'>;
|
|
2266
|
+
patch<T extends PathsWithMethod<paths, 'patch'>>(path: T, ...params: RequestParams<T, 'patch', C>): RequestResponse<T, 'patch'>;
|
|
2267
|
+
put<T extends PathsWithMethod<paths, 'put'>>(path: T, ...params: RequestParams<T, 'put', C>): RequestResponse<T, 'put'>;
|
|
2268
|
+
delete<T extends PathsWithMethod<paths, 'delete'>>(path: T, ...params: RequestParams<T, 'delete', C>): RequestResponse<T, 'delete'>;
|
|
2269
2269
|
beforeRequest(params: {
|
|
2270
2270
|
config: any;
|
|
2271
2271
|
}): Promise<any>;
|
package/dist/index.js
CHANGED
|
@@ -58,20 +58,20 @@ var Client = class {
|
|
|
58
58
|
throw error;
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
|
-
get(path, params) {
|
|
62
|
-
return this.request("get", path, params);
|
|
61
|
+
get(path, ...params) {
|
|
62
|
+
return this.request("get", path, ...params);
|
|
63
63
|
}
|
|
64
|
-
post(path, params) {
|
|
65
|
-
return this.request("post", path, params);
|
|
64
|
+
post(path, ...params) {
|
|
65
|
+
return this.request("post", path, ...params);
|
|
66
66
|
}
|
|
67
|
-
patch(path, params) {
|
|
68
|
-
return this.request("patch", path, params);
|
|
67
|
+
patch(path, ...params) {
|
|
68
|
+
return this.request("patch", path, ...params);
|
|
69
69
|
}
|
|
70
|
-
put(path, params) {
|
|
71
|
-
return this.request("put", path, params);
|
|
70
|
+
put(path, ...params) {
|
|
71
|
+
return this.request("put", path, ...params);
|
|
72
72
|
}
|
|
73
|
-
delete(path, params) {
|
|
74
|
-
return this.request("delete", path, params);
|
|
73
|
+
delete(path, ...params) {
|
|
74
|
+
return this.request("delete", path, ...params);
|
|
75
75
|
}
|
|
76
76
|
async beforeRequest(params) {
|
|
77
77
|
let config = params.config;
|