@vouchfor/sdk 1.1.35 → 1.1.36

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.
@@ -2,10 +2,11 @@ const tasks = require('../shared/tasks');
2
2
 
3
3
  class CallbackService {
4
4
  response(id, body) {
5
- const { status, json } = body || {};
5
+ const { status = '', json } = body || {};
6
+ const statusCode = Number(status.split(' ')[0]);
6
7
  if (!(id && status)) {
7
8
  // invalid - do nothing
8
- } else if (status < 400) {
9
+ } else if (statusCode > 0 && statusCode < 400) {
9
10
  tasks.respond(id, body);
10
11
  } else {
11
12
  tasks.fail(id, body);
@@ -108,7 +108,7 @@ module.exports = {
108
108
 
109
109
  const errors = [
110
110
  502, // bad gateway, the BE is deploying
111
- //504 gateway timeout, do not retry!!
111
+ //504 gateway timeout is deliberatly excluded here
112
112
  ];
113
113
  const maxAttempts = 8;
114
114
  const interval = 1000;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vouchfor/sdk",
3
- "version": "1.1.35",
3
+ "version": "1.1.36",
4
4
  "description": "Vouch API SDK",
5
5
  "main": "lib/index.js",
6
6
  "repository": {