@ekhein/http-request 2.0.4 → 2.0.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/http-request.d.ts +1 -1
- package/dist/http-request.js +5 -4
- package/package.json +1 -1
package/dist/http-request.d.ts
CHANGED
|
@@ -7,5 +7,5 @@ export declare class HttpRequest {
|
|
|
7
7
|
post<R = any>(url: string, data?: any, opts?: HttpRequestConfig): Promise<R>;
|
|
8
8
|
invoke<R = any>(path: string, data: object, opts?: HttpRequestConfig): Promise<R>;
|
|
9
9
|
hook<R = any>(url: string, args: ArrayLike<any>, opts?: HttpRequestConfig): Promise<R>;
|
|
10
|
-
call<R = any>(method: string,
|
|
10
|
+
call<R = any>(method: string, args: ArrayLike<any>, opts?: HttpRequestConfig): Promise<R>;
|
|
11
11
|
}
|
package/dist/http-request.js
CHANGED
|
@@ -181,7 +181,8 @@ class HttpRequest {
|
|
|
181
181
|
});
|
|
182
182
|
}
|
|
183
183
|
if (request.serviceType == 4) {
|
|
184
|
-
request.baseURL = String(`http://${request.clientIp}:
|
|
184
|
+
request.baseURL = String(`http://${request.clientIp}:65001/`);
|
|
185
|
+
request.body.params = Array.from(request.args);
|
|
185
186
|
request.body.jsonrpc = String("2.0");
|
|
186
187
|
request.body.id = (0, crypto_1.randomUUID)();
|
|
187
188
|
}
|
|
@@ -250,10 +251,10 @@ class HttpRequest {
|
|
|
250
251
|
.request(Object.assign(Object.assign({}, opts), { method: "POST", serviceType: 3, args, url }));
|
|
251
252
|
});
|
|
252
253
|
}
|
|
253
|
-
call(method_1,
|
|
254
|
-
return __awaiter(this, arguments, void 0, function* (method,
|
|
254
|
+
call(method_1, args_1) {
|
|
255
|
+
return __awaiter(this, arguments, void 0, function* (method, args, opts = {}) {
|
|
255
256
|
return this.instance
|
|
256
|
-
.request(Object.assign(Object.assign({}, opts), { method: "POST", serviceType: 4, body: { method
|
|
257
|
+
.request(Object.assign(Object.assign({}, opts), { method: "POST", serviceType: 4, args, body: { method } }));
|
|
257
258
|
});
|
|
258
259
|
}
|
|
259
260
|
}
|