@onekeyfe/hd-transport-http 0.1.57 → 0.1.59
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.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/package.json +4 -4
- package/src/http.ts +4 -1
package/dist/http.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../src/http.ts"],"names":[],"mappings":"AAGA,oBAAY,kBAAkB,GAAG;IAC/B,IAAI,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC;IACrD,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,GAAG,KAAK,CAAC;IACvB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AA4BF,wBAAsB,OAAO,CAAC,OAAO,EAAE,kBAAkB,
|
|
1
|
+
{"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../src/http.ts"],"names":[],"mappings":"AAGA,oBAAY,kBAAkB,GAAG;IAC/B,IAAI,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC;IACrD,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,GAAG,KAAK,CAAC;IACvB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AA4BF,wBAAsB,OAAO,CAAC,OAAO,EAAE,kBAAkB,gBA6BxD"}
|
package/dist/index.js
CHANGED
|
@@ -70,10 +70,11 @@ function request(options) {
|
|
|
70
70
|
'Content-Type': contentType(options.body == null ? '' : options.body),
|
|
71
71
|
},
|
|
72
72
|
timeout: (_a = options.timeout) !== null && _a !== void 0 ? _a : undefined,
|
|
73
|
+
transformResponse: data => data,
|
|
73
74
|
};
|
|
74
75
|
const res = yield axios__default["default"].request(fetchOptions);
|
|
75
76
|
if (+res.status === 200) {
|
|
76
|
-
return parseResult(res.
|
|
77
|
+
return parseResult(res.data);
|
|
77
78
|
}
|
|
78
79
|
const resJson = parseResult(res.data);
|
|
79
80
|
if (typeof resJson === 'object' && resJson != null && resJson.error != null) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@onekeyfe/hd-transport-http",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.59",
|
|
4
4
|
"description": "hardware http transport",
|
|
5
5
|
"author": "OneKey",
|
|
6
6
|
"homepage": "https://github.com/OneKeyHQ/hardware-js-sdk#readme",
|
|
@@ -25,9 +25,9 @@
|
|
|
25
25
|
"url": "https://github.com/OneKeyHQ/hardware-js-sdk/issues"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@onekeyfe/hd-shared": "^0.1.
|
|
29
|
-
"@onekeyfe/hd-transport": "^0.1.
|
|
28
|
+
"@onekeyfe/hd-shared": "^0.1.59",
|
|
29
|
+
"@onekeyfe/hd-transport": "^0.1.59",
|
|
30
30
|
"axios": "^0.27.2"
|
|
31
31
|
},
|
|
32
|
-
"gitHead": "
|
|
32
|
+
"gitHead": "0c3e0637734a8b23d0553cf3d6a81b1bcd038116"
|
|
33
33
|
}
|
package/src/http.ts
CHANGED
|
@@ -44,12 +44,15 @@ export async function request(options: HttpRequestOptions) {
|
|
|
44
44
|
'Content-Type': contentType(options.body == null ? '' : options.body),
|
|
45
45
|
},
|
|
46
46
|
timeout: options.timeout ?? undefined,
|
|
47
|
+
// Prevent string from converting to number
|
|
48
|
+
// see https://stackoverflow.com/questions/43787712/axios-how-to-deal-with-big-integers
|
|
49
|
+
transformResponse: data => data,
|
|
47
50
|
};
|
|
48
51
|
|
|
49
52
|
const res = await axios.request(fetchOptions);
|
|
50
53
|
|
|
51
54
|
if (+res.status === 200) {
|
|
52
|
-
return parseResult(res.
|
|
55
|
+
return parseResult(res.data);
|
|
53
56
|
}
|
|
54
57
|
const resJson = parseResult(res.data);
|
|
55
58
|
if (typeof resJson === 'object' && resJson != null && resJson.error != null) {
|