jscrambler 6.4.8 → 6.4.9

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.
Files changed (2) hide show
  1. package/dist/index.js +13 -5
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -302,11 +302,19 @@ var _default = {
302
302
  }
303
303
  _context4.next = 16;
304
304
  return _this2.getApplicationProfiling(client, applicationId).catch(function (e) {
305
- if (![_constants.HTTP_STATUS_CODES.NOT_FOUND, _constants.HTTP_STATUS_CODES.FORBIDDEN, _constants.HTTP_STATUS_CODES.SERVICE_UNAVAILABLE].includes(e.statusCode)) throw e;else if (_constants.HTTP_STATUS_CODES.NOT_FOUND === e.statusCode) {
306
- // if applicationProfiling is not found then then it hasn't been done yet
307
- // profiling cannot be done with automatic mode if it has never been done before
308
- if (profilingDataMode === 'automatic') {
309
- throw new Error('You can not use the automatic mode without previous profiling having been done.');
305
+ if (typeof profilingDataMode === 'string' && profilingDataMode !== 'off') {
306
+ switch (e.statusCode) {
307
+ case _constants.HTTP_STATUS_CODES.FORBIDDEN:
308
+ throw new Error("No ".concat(profilingDataMode, " profiling feature in your plan. Please set profilingDataMode to \"off\" or contact the Jscrambler Support."));
309
+ case _constants.HTTP_STATUS_CODES.NOT_FOUND:
310
+ if (profilingDataMode === 'automatic') {
311
+ throw new Error('You can not use the automatic mode without previous profiling having been done.');
312
+ }
313
+ break;
314
+ case _constants.HTTP_STATUS_CODES.SERVICE_UNAVAILABLE:
315
+ if (profilingDataMode === 'automatic') {
316
+ throw e;
317
+ }
310
318
  }
311
319
  }
312
320
  });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "jscrambler",
3
3
  "description": "Jscrambler API client.",
4
- "version": "6.4.8",
4
+ "version": "6.4.9",
5
5
  "homepage": "https://github.com/jscrambler/jscrambler",
6
6
  "author": "Jscrambler <code@jscrambler.com>",
7
7
  "repository": {