@xube/kit-request 0.0.90 → 0.0.91

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.
@@ -5,10 +5,10 @@ const kit_log_1 = require("@xube/kit-log");
5
5
  const kit_constants_1 = require("@xube/kit-constants");
6
6
  const helpers_1 = require("../helpers");
7
7
  class XubeResponse {
8
- statusCode;
9
- error;
10
- data;
11
8
  constructor(props) {
9
+ this.isSuccessful = () => (0, exports.xubeResponseSucceeded)(this);
10
+ this.hasFailed = () => (0, exports.xubeResponseFailed)(this);
11
+ this.switchXubeResponseType = () => (0, exports.switchXubeResponseType)(this);
12
12
  this.statusCode = props[kit_constants_1.STATUS_CODE];
13
13
  this.error =
14
14
  props[kit_constants_1.ERROR] && props[kit_constants_1.STATUS_CODE] >= 500
@@ -16,9 +16,6 @@ class XubeResponse {
16
16
  : undefined;
17
17
  this.data = props[kit_constants_1.DATA];
18
18
  }
19
- isSuccessful = () => (0, exports.xubeResponseSucceeded)(this);
20
- hasFailed = () => (0, exports.xubeResponseFailed)(this);
21
- switchXubeResponseType = () => (0, exports.switchXubeResponseType)(this);
22
19
  }
23
20
  exports.XubeResponse = XubeResponse;
24
21
  const xubeResponseSucceeded = (xubeResponse) => xubeResponse.statusCode <= 300;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xube/kit-request",
3
- "version": "0.0.90",
3
+ "version": "0.0.91",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -17,11 +17,11 @@
17
17
  },
18
18
  "homepage": "https://github.com/XubeLtd/data-logger#readme",
19
19
  "dependencies": {
20
- "@xube/kit-constants": "^0.0.90",
21
- "@xube/kit-generator": "^0.0.90",
22
- "@xube/kit-log": "^0.0.90"
20
+ "@xube/kit-constants": "^0.0.91",
21
+ "@xube/kit-generator": "^0.0.91",
22
+ "@xube/kit-log": "^0.0.91"
23
23
  },
24
24
  "devDependencies": {
25
- "@xube/kit-build": "^0.0.90"
25
+ "@xube/kit-build": "^0.0.91"
26
26
  }
27
27
  }
@@ -13,7 +13,7 @@ export const xubePostRequest = async <TResponse = any>(
13
13
  body: JSON.stringify(body),
14
14
  });
15
15
 
16
- const responseBody = await response.json();
16
+ const responseBody: any = await response.json();
17
17
 
18
18
  if (response.ok) {
19
19
  console.log("Xube request successful");