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.
- package/dist/bin/jscrambler.js +2 -2
- package/dist/client.js +21 -9
- package/dist/constants.js +1 -1
- package/dist/generate-signed-params.js +1 -1
- package/dist/get-protection-default-fragments.js +1 -1
- package/dist/index.js +73 -83
- package/dist/introspection.js +2 -2
- package/dist/mutations.js +9 -9
- package/dist/queries.js +4 -4
- package/dist/zip.js +3 -3
- package/package.json +1 -1
package/dist/bin/jscrambler.js
CHANGED
|
@@ -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
|
|
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 =
|
|
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
|
|
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 =
|
|
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";
|
|
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 } });
|
|
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
|
|
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.
|
|
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";
|
|
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";
|
|
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";
|
|
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
|
|
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
|
|
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,
|
|
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 =
|
|
169
|
+
_context.next = 8;
|
|
179
170
|
break;
|
|
180
171
|
}
|
|
181
172
|
|
|
182
173
|
if (!(appProfiling && appProfiling.data && appProfiling.data.state === 'READY')) {
|
|
183
|
-
_context.next =
|
|
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
|
|
190
|
-
|
|
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 =
|
|
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 =
|
|
208
|
+
_context.next = 14;
|
|
213
209
|
return (0, _zip.zip)(_filesSrc, cwd);
|
|
214
210
|
|
|
215
|
-
case
|
|
211
|
+
case 14:
|
|
216
212
|
zipped = _context.sent;
|
|
217
|
-
_context.next =
|
|
213
|
+
_context.next = 22;
|
|
218
214
|
break;
|
|
219
215
|
|
|
220
|
-
case
|
|
216
|
+
case 17:
|
|
221
217
|
if (!sources) {
|
|
222
|
-
_context.next =
|
|
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 =
|
|
226
|
+
_context.next = 21;
|
|
231
227
|
return (0, _zip.zipSources)(sources);
|
|
232
228
|
|
|
233
|
-
case
|
|
229
|
+
case 21:
|
|
234
230
|
zipped = _context.sent;
|
|
235
231
|
|
|
236
|
-
case
|
|
232
|
+
case 22:
|
|
237
233
|
if (!zipped) {
|
|
238
|
-
_context.next =
|
|
234
|
+
_context.next = 33;
|
|
239
235
|
break;
|
|
240
236
|
}
|
|
241
237
|
|
|
242
|
-
_context.next =
|
|
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
|
|
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
|
-
|
|
265
|
-
|
|
266
|
-
|
|
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
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
promise: promise
|
|
275
|
-
});
|
|
264
|
+
case 31:
|
|
265
|
+
_context.t1 = _context.sent;
|
|
266
|
+
(0, _context.t0)(_context.t1);
|
|
276
267
|
|
|
277
|
-
case
|
|
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,
|
|
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 =
|
|
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
|
-
|
|
417
|
-
|
|
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
|
|
414
|
+
case 26:
|
|
423
415
|
console.log('Update source files SKIPPED');
|
|
424
416
|
|
|
425
|
-
case
|
|
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 =
|
|
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 =
|
|
459
|
+
_context4.next = 35;
|
|
468
460
|
return intoObjectType(client, updateData, 'Application');
|
|
469
461
|
|
|
470
|
-
case
|
|
462
|
+
case 35:
|
|
471
463
|
applicationUpdate = _context4.sent;
|
|
472
|
-
_context4.next =
|
|
464
|
+
_context4.next = 38;
|
|
473
465
|
return _this2.updateApplication(client, applicationUpdate);
|
|
474
466
|
|
|
475
|
-
case
|
|
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
|
|
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 =
|
|
512
|
-
return
|
|
503
|
+
_context4.next = 47;
|
|
504
|
+
return _this2.createApplicationProtections(client, applicationId, protectionOptions);
|
|
513
505
|
|
|
514
|
-
case
|
|
515
|
-
|
|
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 =
|
|
573
|
+
_context4.next = 58;
|
|
584
574
|
return (0, _getProtectionDefaultFragments.default)(client);
|
|
585
575
|
|
|
586
|
-
case
|
|
576
|
+
case 58:
|
|
587
577
|
_context4.t4 = _context4.sent;
|
|
588
|
-
_context4.next =
|
|
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
|
|
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 =
|
|
709
|
+
_context4.next = 66;
|
|
720
710
|
break;
|
|
721
711
|
}
|
|
722
712
|
|
|
723
713
|
return _context4.abrupt("return", handleProtection(processedProtections[0]));
|
|
724
714
|
|
|
725
|
-
case
|
|
715
|
+
case 66:
|
|
726
716
|
console.log("Protections stored in ".concat(filesDest, "/[protection-id]"));
|
|
727
717
|
i = 0;
|
|
728
718
|
|
|
729
|
-
case
|
|
719
|
+
case 68:
|
|
730
720
|
if (!(i < processedProtections.length)) {
|
|
731
|
-
_context4.next =
|
|
721
|
+
_context4.next = 81;
|
|
732
722
|
break;
|
|
733
723
|
}
|
|
734
724
|
|
|
735
725
|
protection = processedProtections[i];
|
|
736
|
-
_context4.prev =
|
|
737
|
-
_context4.next =
|
|
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
|
|
744
|
-
_context4.next =
|
|
733
|
+
case 73:
|
|
734
|
+
_context4.next = 78;
|
|
745
735
|
break;
|
|
746
736
|
|
|
747
|
-
case
|
|
748
|
-
_context4.prev =
|
|
749
|
-
_context4.t5 = _context4["catch"](
|
|
737
|
+
case 75:
|
|
738
|
+
_context4.prev = 75;
|
|
739
|
+
_context4.t5 = _context4["catch"](70);
|
|
750
740
|
console.error(_context4.t5);
|
|
751
741
|
|
|
752
|
-
case
|
|
742
|
+
case 78:
|
|
753
743
|
i++;
|
|
754
|
-
_context4.next =
|
|
744
|
+
_context4.next = 68;
|
|
755
745
|
break;
|
|
756
746
|
|
|
757
|
-
case
|
|
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
|
|
751
|
+
case 83:
|
|
762
752
|
case "end":
|
|
763
753
|
return _context4.stop();
|
|
764
754
|
}
|
|
765
755
|
}
|
|
766
|
-
}, _callee4, null, [[
|
|
756
|
+
}, _callee4, null, [[70, 75]]);
|
|
767
757
|
}))();
|
|
768
758
|
},
|
|
769
759
|
|
package/dist/introspection.js
CHANGED
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.type = type;
|
|
7
7
|
exports.mutation = mutation;
|
|
8
8
|
exports.query = query;
|
|
9
|
-
exports.
|
|
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.
|
|
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.
|
|
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
|
|
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 =
|
|
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
|
|