xjs-node 3.0.0 → 3.1.0

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.
@@ -53,6 +53,10 @@ export interface HttpResponse<T = string> {
53
53
  * response payload which has a type depends on {@link RequestOption.responseType}.
54
54
  */
55
55
  payload?: T;
56
+ /**
57
+ * http status code.
58
+ */
59
+ status: number;
56
60
  }
57
61
  export interface HttpClient {
58
62
  /**
@@ -248,13 +248,7 @@ class HttpResolverContext {
248
248
  else if (contentEncofing == "br")
249
249
  retBuf = zlib.brotliDecompressSync(retBuf);
250
250
  const data = rc.responseType === "buffer" ? retBuf : retBuf.toString("utf8");
251
- if (sc !== 2) {
252
- if (xjs_common_1.UType.isString(data) && data.trim())
253
- this.warn(data);
254
- reject(new xjs_common_1.XjsErr(s_errCode, `Https received an error status ${res.statusCode}`));
255
- }
256
- else
257
- resolve({ payload: data, headers: res.headers });
251
+ resolve({ payload: data, headers: res.headers, status: res.statusCode });
258
252
  }
259
253
  catch (e) {
260
254
  this.handleError(reject, e, "something went wrong in processing response.");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xjs-node",
3
- "version": "3.0.0",
3
+ "version": "3.1.0",
4
4
  "description": "library modules for nodejs + typescript that bundled general-purpose implementations.",
5
5
  "repository": {
6
6
  "type": "git",