@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.
@@ -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, params: ArrayLike<any>, opts?: HttpRequestConfig): Promise<R>;
10
+ call<R = any>(method: string, args: ArrayLike<any>, opts?: HttpRequestConfig): Promise<R>;
11
11
  }
@@ -181,7 +181,8 @@ class HttpRequest {
181
181
  });
182
182
  }
183
183
  if (request.serviceType == 4) {
184
- request.baseURL = String(`http://${request.clientIp}:3000/`);
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, params_1) {
254
- return __awaiter(this, arguments, void 0, function* (method, params, opts = {}) {
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, params } }));
257
+ .request(Object.assign(Object.assign({}, opts), { method: "POST", serviceType: 4, args, body: { method } }));
257
258
  });
258
259
  }
259
260
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ekhein/http-request",
3
- "version": "2.0.4",
3
+ "version": "2.0.6",
4
4
  "license": "MIT",
5
5
  "author": "ekhein",
6
6
  "main": "./dist/index.js",