jscrambler 6.1.4 → 6.2.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.
@@ -19,9 +19,9 @@ var _utils = require("../utils");
19
19
 
20
20
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
21
21
 
22
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
22
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
23
23
 
24
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
24
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
25
25
 
26
26
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
27
27
 
package/dist/client.js CHANGED
@@ -8,6 +8,8 @@ var _lodash2 = _interopRequireDefault(require("lodash.keys"));
8
8
 
9
9
  var _axios = _interopRequireDefault(require("axios"));
10
10
 
11
+ var _zlib = require("zlib");
12
+
11
13
  var _url = _interopRequireDefault(require("url"));
12
14
 
13
15
  var _https = _interopRequireDefault(require("https"));
@@ -28,21 +30,17 @@ var _package = require("../package.json");
28
30
 
29
31
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
30
32
 
31
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
33
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
32
34
 
33
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
35
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
34
36
 
35
37
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
36
38
 
37
- function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
38
-
39
- function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
40
-
41
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
39
+ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
42
40
 
43
41
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
44
42
 
45
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
43
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
46
44
 
47
45
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
48
46
 
@@ -64,6 +62,7 @@ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.g
64
62
 
65
63
  var debug = !!process.env.DEBUG;
66
64
  var metrics = !!process.env.METRICS;
65
+ var noCompression = !!process.env.NO_COMPRESSION;
67
66
 
68
67
  var ClientError = /*#__PURE__*/function (_Error) {
69
68
  _inherits(ClientError, _Error);
@@ -80,7 +79,7 @@ var ClientError = /*#__PURE__*/function (_Error) {
80
79
  return _this;
81
80
  }
82
81
 
83
- return _createClass(ClientError);
82
+ return ClientError;
84
83
  }( /*#__PURE__*/_wrapNativeSuper(Error));
85
84
  /**
86
85
  * @class JScramblerClient
@@ -118,6 +117,19 @@ function JScramblerClient(options) {
118
117
  jscramblerVersion: jscramblerVersion,
119
118
  clientId: clientId
120
119
  },
120
+ transformRequest: _axios.default.defaults.transformRequest.concat(function (data, headers) {
121
+ // gzip request with more than 1KiB
122
+ if (!noCompression && typeof data === 'string' && data.length > 1024) {
123
+ headers['Content-Encoding'] = 'gzip';
124
+ data = (0, _zlib.gzipSync)(data);
125
+
126
+ if (metrics) {
127
+ process.stdout.write("[gzip ".concat(data.length, "B] "));
128
+ }
129
+ }
130
+
131
+ return data;
132
+ }),
121
133
  maxBodyLength: 100 * 1000 * 1000 // 100 MB
122
134
 
123
135
  });
package/dist/constants.js CHANGED
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.JSCRAMBLER_ERROR_CODES = exports.HTTP_STATUS_CODES = exports.CLIENT_PACKAGES = exports.CLIENT_IDS = void 0;
6
+ exports.CLIENT_PACKAGES = exports.CLIENT_IDS = exports.JSCRAMBLER_ERROR_CODES = exports.HTTP_STATUS_CODES = void 0;
7
7
 
8
8
  var _Object$freeze;
9
9
 
@@ -15,7 +15,7 @@ var _lodash3 = _interopRequireDefault(require("lodash.keys"));
15
15
 
16
16
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17
17
 
18
- function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
18
+ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
19
19
 
20
20
  var debug = !!process.env.DEBUG;
21
21
 
@@ -11,7 +11,7 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
11
11
 
12
12
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
13
13
 
14
- function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
14
+ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
15
15
 
16
16
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
17
17
 
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
 
3
- function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
3
+ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
4
4
 
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
@@ -49,25 +49,17 @@ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableTo
49
49
 
50
50
  function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
51
51
 
52
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
53
+
52
54
  function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
53
55
 
54
56
  function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
55
57
 
56
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
57
-
58
- function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
59
-
60
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
61
-
62
58
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
63
59
 
64
- function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
65
-
66
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
60
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
67
61
 
68
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
69
-
70
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
62
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
71
63
 
72
64
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
73
65
 
@@ -165,33 +157,37 @@ var _default = {
165
157
  var _this = this;
166
158
 
167
159
  return _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
168
- var sources, filesSrc, cwd, appProfiling, promise, zipped, source, _filesSrc, i, l, content;
160
+ var sources, filesSrc, cwd, appProfiling, removeSourceRes, zipped, source, _filesSrc, i, l, content;
169
161
 
170
162
  return regeneratorRuntime.wrap(function _callee$(_context) {
171
163
  while (1) {
172
164
  switch (_context.prev = _context.next) {
173
165
  case 0:
174
166
  sources = _ref.sources, filesSrc = _ref.filesSrc, cwd = _ref.cwd, appProfiling = _ref.appProfiling;
175
- promise = Promise.resolve();
176
167
 
177
168
  if (!(sources || filesSrc && filesSrc.length)) {
178
- _context.next = 6;
169
+ _context.next = 8;
179
170
  break;
180
171
  }
181
172
 
182
173
  if (!(appProfiling && appProfiling.data && appProfiling.data.state === 'READY')) {
183
- _context.next = 5;
174
+ _context.next = 4;
184
175
  break;
185
176
  }
186
177
 
187
178
  throw new Error('You have a finished Profiling for this application so you are NOT ALLOWED to update sources. To override this behavior use *--remove-profiling-data* or *--skip-sources*.');
188
179
 
189
- case 5:
190
- promise = _this.removeSourceFromApplication(client, '', applicationId);
180
+ case 4:
181
+ _context.next = 6;
182
+ return _this.removeSourceFromApplication(client, '', applicationId);
191
183
 
192
184
  case 6:
185
+ removeSourceRes = _context.sent;
186
+ errorHandler(removeSourceRes);
187
+
188
+ case 8:
193
189
  if (!(filesSrc && filesSrc.length)) {
194
- _context.next = 15;
190
+ _context.next = 17;
195
191
  break;
196
192
  }
197
193
 
@@ -209,17 +205,17 @@ var _default = {
209
205
  console.log('Creating zip from source files');
210
206
  }
211
207
 
212
- _context.next = 12;
208
+ _context.next = 14;
213
209
  return (0, _zip.zip)(_filesSrc, cwd);
214
210
 
215
- case 12:
211
+ case 14:
216
212
  zipped = _context.sent;
217
- _context.next = 20;
213
+ _context.next = 22;
218
214
  break;
219
215
 
220
- case 15:
216
+ case 17:
221
217
  if (!sources) {
222
- _context.next = 20;
218
+ _context.next = 22;
223
219
  break;
224
220
  }
225
221
 
@@ -227,19 +223,19 @@ var _default = {
227
223
  console.log('Creating zip from sources');
228
224
  }
229
225
 
230
- _context.next = 19;
226
+ _context.next = 21;
231
227
  return (0, _zip.zipSources)(sources);
232
228
 
233
- case 19:
229
+ case 21:
234
230
  zipped = _context.sent;
235
231
 
236
- case 20:
232
+ case 22:
237
233
  if (!zipped) {
238
- _context.next = 27;
234
+ _context.next = 33;
239
235
  break;
240
236
  }
241
237
 
242
- _context.next = 23;
238
+ _context.next = 25;
243
239
  return zipped.generateAsync({
244
240
  type: 'base64',
245
241
  compression: 'DEFLATE',
@@ -249,7 +245,7 @@ var _default = {
249
245
  }
250
246
  });
251
247
 
252
- case 23:
248
+ case 25:
253
249
  content = _context.sent;
254
250
 
255
251
  if (debug) {
@@ -261,20 +257,18 @@ var _default = {
261
257
  filename: 'application.zip',
262
258
  extension: 'zip'
263
259
  };
264
- promise = promise.then(function (removeRes) {
265
- errorHandler(removeRes);
266
- return _this.addApplicationSource(client, applicationId, source);
267
- }).then(errorHandler).catch(function (e) {
268
- console.warn("Update application sources failed with ".concat(e.message));
269
- });
260
+ _context.t0 = errorHandler;
261
+ _context.next = 31;
262
+ return _this.addApplicationSource(client, applicationId, source);
270
263
 
271
- case 27:
272
- return _context.abrupt("return", {
273
- source: source,
274
- promise: promise
275
- });
264
+ case 31:
265
+ _context.t1 = _context.sent;
266
+ (0, _context.t0)(_context.t1);
276
267
 
277
- case 28:
268
+ case 33:
269
+ return _context.abrupt("return", source);
270
+
271
+ case 34:
278
272
  case "end":
279
273
  return _context.stop();
280
274
  }
@@ -329,7 +323,7 @@ var _default = {
329
323
  var _this2 = this;
330
324
 
331
325
  return _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee4() {
332
- var start, finalConfig, applicationId, host, port, basePath, protocol, cafile, keys, sources, _finalConfig$stream, stream, cwd, params, applicationTypes, languageSpecifications, sourceMaps, randomizationSeed, areSubscribersOrdered, useRecommendedOrder, _finalConfig$bail, bail, jscramblerVersion, debugMode, proxy, utc, clientId, tolerateMinification, codeHardeningThreshold, useProfilingData, browsers, useAppClassification, profilingDataMode, removeProfilingData, skipSources, inputSymbolTable, entryPoint, excludeList, numberOfProtections, forceAppEnvironment, accessKey, secretKey, client, filesSrc, filesDest, source, updateApplicationSourcePromise, appProfiling, _yield$_this2$updateA, updateData, dataToValidate, prop, value, applicationUpdate, updateApplicationRes, protectionOptions, inputSymbolTableContents, _yield$Promise$all, _yield$Promise$all2, createApplicationProtectionRes, protectionIds, onExitCancelProtection, processedProtections, handleProtection, i, protection;
326
+ var start, finalConfig, applicationId, host, port, basePath, protocol, cafile, keys, sources, _finalConfig$stream, stream, cwd, params, applicationTypes, languageSpecifications, sourceMaps, randomizationSeed, areSubscribersOrdered, useRecommendedOrder, _finalConfig$bail, bail, jscramblerVersion, debugMode, proxy, utc, clientId, tolerateMinification, codeHardeningThreshold, useProfilingData, browsers, useAppClassification, profilingDataMode, removeProfilingData, skipSources, inputSymbolTable, entryPoint, excludeList, numberOfProtections, forceAppEnvironment, accessKey, secretKey, client, filesSrc, filesDest, source, appProfiling, updateData, dataToValidate, prop, value, applicationUpdate, updateApplicationRes, protectionOptions, inputSymbolTableContents, createApplicationProtectionRes, protectionIds, onExitCancelProtection, processedProtections, handleProtection, i, protection;
333
327
 
334
328
  return regeneratorRuntime.wrap(function _callee4$(_context4) {
335
329
  while (1) {
@@ -380,7 +374,7 @@ var _default = {
380
374
 
381
375
  case 13:
382
376
  if (skipSources) {
383
- _context4.next = 28;
377
+ _context4.next = 26;
384
378
  break;
385
379
  }
386
380
 
@@ -413,16 +407,14 @@ var _default = {
413
407
  });
414
408
 
415
409
  case 23:
416
- _yield$_this2$updateA = _context4.sent;
417
- source = _yield$_this2$updateA.source;
418
- updateApplicationSourcePromise = _yield$_this2$updateA.promise;
419
- _context4.next = 29;
410
+ source = _context4.sent;
411
+ _context4.next = 27;
420
412
  break;
421
413
 
422
- case 28:
414
+ case 26:
423
415
  console.log('Update source files SKIPPED');
424
416
 
425
- case 29:
417
+ case 27:
426
418
  updateData = {
427
419
  _id: applicationId,
428
420
  debugMode: !!debugMode,
@@ -456,7 +448,7 @@ var _default = {
456
448
  }
457
449
 
458
450
  if (!(updateData.parameters || updateData.applicationTypes || updateData.languageSpecifications || updateData.browsers || typeof updateData.areSubscribersOrdered !== 'undefined')) {
459
- _context4.next = 43;
451
+ _context4.next = 41;
460
452
  break;
461
453
  }
462
454
 
@@ -464,15 +456,15 @@ var _default = {
464
456
  console.log('Updating parameters of protection');
465
457
  }
466
458
 
467
- _context4.next = 37;
459
+ _context4.next = 35;
468
460
  return intoObjectType(client, updateData, 'Application');
469
461
 
470
- case 37:
462
+ case 35:
471
463
  applicationUpdate = _context4.sent;
472
- _context4.next = 40;
464
+ _context4.next = 38;
473
465
  return _this2.updateApplication(client, applicationUpdate);
474
466
 
475
- case 40:
467
+ case 38:
476
468
  updateApplicationRes = _context4.sent;
477
469
 
478
470
  if (debug) {
@@ -482,7 +474,7 @@ var _default = {
482
474
 
483
475
  errorHandler(updateApplicationRes);
484
476
 
485
- case 43:
477
+ case 41:
486
478
  if (debug) {
487
479
  console.log('Creating Application Protection');
488
480
  }
@@ -508,13 +500,11 @@ var _default = {
508
500
  protectionOptions.inputSymbolTable = inputSymbolTableContents;
509
501
  }
510
502
 
511
- _context4.next = 49;
512
- return Promise.all([_this2.createApplicationProtections(client, applicationId, protectionOptions), updateApplicationSourcePromise]);
503
+ _context4.next = 47;
504
+ return _this2.createApplicationProtections(client, applicationId, protectionOptions);
513
505
 
514
- case 49:
515
- _yield$Promise$all = _context4.sent;
516
- _yield$Promise$all2 = _slicedToArray(_yield$Promise$all, 1);
517
- createApplicationProtectionRes = _yield$Promise$all2[0];
506
+ case 47:
507
+ createApplicationProtectionRes = _context4.sent;
518
508
  errorHandler(createApplicationProtectionRes);
519
509
  protectionIds = createApplicationProtectionRes.data.protections.map(function (_ref2) {
520
510
  var _id = _ref2._id;
@@ -580,15 +570,15 @@ var _default = {
580
570
  _context4.t1 = client;
581
571
  _context4.t2 = applicationId;
582
572
  _context4.t3 = protectionIds;
583
- _context4.next = 62;
573
+ _context4.next = 58;
584
574
  return (0, _getProtectionDefaultFragments.default)(client);
585
575
 
586
- case 62:
576
+ case 58:
587
577
  _context4.t4 = _context4.sent;
588
- _context4.next = 65;
578
+ _context4.next = 61;
589
579
  return _context4.t0.pollProtections.call(_context4.t0, _context4.t1, _context4.t2, _context4.t3, _context4.t4);
590
580
 
591
- case 65:
581
+ case 61:
592
582
  processedProtections = _context4.sent;
593
583
  process.removeListener('SIGINT', onExitCancelProtection).removeListener('SIGTERM', onExitCancelProtection);
594
584
 
@@ -716,54 +706,54 @@ var _default = {
716
706
  }();
717
707
 
718
708
  if (!(processedProtections.length === 1)) {
719
- _context4.next = 70;
709
+ _context4.next = 66;
720
710
  break;
721
711
  }
722
712
 
723
713
  return _context4.abrupt("return", handleProtection(processedProtections[0]));
724
714
 
725
- case 70:
715
+ case 66:
726
716
  console.log("Protections stored in ".concat(filesDest, "/[protection-id]"));
727
717
  i = 0;
728
718
 
729
- case 72:
719
+ case 68:
730
720
  if (!(i < processedProtections.length)) {
731
- _context4.next = 85;
721
+ _context4.next = 81;
732
722
  break;
733
723
  }
734
724
 
735
725
  protection = processedProtections[i];
736
- _context4.prev = 74;
737
- _context4.next = 77;
726
+ _context4.prev = 70;
727
+ _context4.next = 73;
738
728
  return handleProtection(protection, {
739
729
  outPrefix: "/".concat(protection._id, "/"),
740
730
  printProtectionId: false
741
731
  });
742
732
 
743
- case 77:
744
- _context4.next = 82;
733
+ case 73:
734
+ _context4.next = 78;
745
735
  break;
746
736
 
747
- case 79:
748
- _context4.prev = 79;
749
- _context4.t5 = _context4["catch"](74);
737
+ case 75:
738
+ _context4.prev = 75;
739
+ _context4.t5 = _context4["catch"](70);
750
740
  console.error(_context4.t5);
751
741
 
752
- case 82:
742
+ case 78:
753
743
  i++;
754
- _context4.next = 72;
744
+ _context4.next = 68;
755
745
  break;
756
746
 
757
- case 85:
747
+ case 81:
758
748
  console.log("Runtime: ".concat(processedProtections.length, " protections in ").concat(Math.round((Date.now() - start) / 1000), "s"));
759
749
  return _context4.abrupt("return", protectionIds);
760
750
 
761
- case 87:
751
+ case 83:
762
752
  case "end":
763
753
  return _context4.stop();
764
754
  }
765
755
  }
766
- }, _callee4, null, [[74, 79]]);
756
+ }, _callee4, null, [[70, 75]]);
767
757
  }))();
768
758
  },
769
759
 
@@ -3,10 +3,10 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.intoObjectType = intoObjectType;
6
+ exports.type = type;
7
7
  exports.mutation = mutation;
8
8
  exports.query = query;
9
- exports.type = type;
9
+ exports.intoObjectType = intoObjectType;
10
10
 
11
11
  var _lodash = _interopRequireDefault(require("lodash.clonedeep"));
12
12
 
package/dist/mutations.js CHANGED
@@ -3,22 +3,22 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.addApplicationSource = addApplicationSource;
7
- exports.applyTemplate = applyTemplate;
8
- exports.cancelProtection = cancelProtection;
9
6
  exports.createApplication = createApplication;
10
- exports.createApplicationProtection = createApplicationProtection;
11
- exports.createApplicationProtections = createApplicationProtections;
12
- exports.createTemplate = createTemplate;
13
7
  exports.duplicateApplication = duplicateApplication;
14
8
  exports.removeApplication = removeApplication;
15
9
  exports.removeProtection = removeProtection;
16
- exports.removeSourceFromApplication = removeSourceFromApplication;
17
- exports.removeTemplate = removeTemplate;
18
- exports.unlockApplication = unlockApplication;
10
+ exports.cancelProtection = cancelProtection;
19
11
  exports.updateApplication = updateApplication;
12
+ exports.unlockApplication = unlockApplication;
13
+ exports.addApplicationSource = addApplicationSource;
20
14
  exports.updateApplicationSource = updateApplicationSource;
15
+ exports.removeSourceFromApplication = removeSourceFromApplication;
16
+ exports.createTemplate = createTemplate;
17
+ exports.removeTemplate = removeTemplate;
21
18
  exports.updateTemplate = updateTemplate;
19
+ exports.createApplicationProtection = createApplicationProtection;
20
+ exports.createApplicationProtections = createApplicationProtections;
21
+ exports.applyTemplate = applyTemplate;
22
22
 
23
23
  var _cleanupInputFields3 = _interopRequireDefault(require("./cleanup-input-fields"));
24
24
 
package/dist/queries.js CHANGED
@@ -4,16 +4,16 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.getApplication = getApplication;
7
+ exports.getApplicationSource = getApplicationSource;
7
8
  exports.getApplicationProtections = getApplicationProtections;
8
9
  exports.getApplicationProtectionsCount = getApplicationProtectionsCount;
9
- exports.getApplicationSource = getApplicationSource;
10
+ exports.getTemplates = getTemplates;
10
11
  exports.getApplications = getApplications;
11
12
  exports.getProtection = getProtection;
12
- exports.getTemplates = getTemplates;
13
13
 
14
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
14
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
15
15
 
16
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
16
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
17
17
 
18
18
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
19
19
 
package/dist/zip.js CHANGED
@@ -3,15 +3,15 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
+ exports.zip = zip;
7
+ exports.zipSources = zipSources;
8
+ exports.unzip = unzip;
6
9
  Object.defineProperty(exports, "outputFileSync", {
7
10
  enumerable: true,
8
11
  get: function get() {
9
12
  return _fsExtra.outputFileSync;
10
13
  }
11
14
  });
12
- exports.unzip = unzip;
13
- exports.zip = zip;
14
- exports.zipSources = zipSources;
15
15
 
16
16
  var _lodash = _interopRequireDefault(require("lodash.size"));
17
17
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "jscrambler",
3
3
  "description": "Jscrambler API client.",
4
- "version": "6.1.4",
4
+ "version": "6.2.0",
5
5
  "homepage": "https://github.com/jscrambler/jscrambler",
6
6
  "author": "Jscrambler <code@jscrambler.com>",
7
7
  "repository": {