jscrambler 8.12.0-next.0 → 8.13.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/CHANGELOG.md +7 -1
- package/dist/client.js +5 -2
- package/dist/config.js +2 -0
- package/dist/index.js +19 -9
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/dist/client.js
CHANGED
|
@@ -38,6 +38,7 @@ class ClientError extends Error {
|
|
|
38
38
|
* @param {String} [options.port=443]
|
|
39
39
|
* @param {String} [options.basePath]
|
|
40
40
|
* @param {String} [options.clientId=0]
|
|
41
|
+
* @param {String} [options.clientVersion]
|
|
41
42
|
* @author Jscrambler
|
|
42
43
|
* @license MIT <http://opensource.org/licenses/MIT>
|
|
43
44
|
*/
|
|
@@ -57,12 +58,14 @@ function JScramblerClient(options) {
|
|
|
57
58
|
this.options = (0, _lodash.default)(options || {}, _config.default);
|
|
58
59
|
const {
|
|
59
60
|
jscramblerVersion,
|
|
60
|
-
clientId
|
|
61
|
+
clientId,
|
|
62
|
+
clientVersion
|
|
61
63
|
} = this.options;
|
|
62
64
|
this.axiosInstance = _axios.default.create({
|
|
63
65
|
headers: {
|
|
64
66
|
jscramblerVersion,
|
|
65
|
-
clientId
|
|
67
|
+
clientId,
|
|
68
|
+
clientVersion
|
|
66
69
|
},
|
|
67
70
|
transformRequest: _axios.default.defaults.transformRequest.concat(function (data, headers) {
|
|
68
71
|
// gzip request with more than 1KiB
|
package/dist/config.js
CHANGED
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _rc = _interopRequireDefault(require("rc"));
|
|
8
8
|
var _constants = require("./constants");
|
|
9
|
+
var _package = require("../package.json");
|
|
9
10
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
11
|
// Load RC configuration if present. Pass `[]` as last argument to avoid
|
|
11
12
|
// getting variables from `argv`.
|
|
@@ -16,6 +17,7 @@ const config = (0, _rc.default)('jscrambler', {
|
|
|
16
17
|
jscramblerVersion: 'stable',
|
|
17
18
|
werror: true,
|
|
18
19
|
clientId: _constants.CLIENT_IDS.CLI,
|
|
20
|
+
clientVersion: _package.version,
|
|
19
21
|
utc: true,
|
|
20
22
|
maxRetries: 5,
|
|
21
23
|
saveSrc: true
|
package/dist/index.js
CHANGED
|
@@ -272,6 +272,7 @@ var _default = exports.default = {
|
|
|
272
272
|
proxy,
|
|
273
273
|
utc,
|
|
274
274
|
clientId,
|
|
275
|
+
clientVersion,
|
|
275
276
|
tolerateMinification,
|
|
276
277
|
codeHardeningThreshold,
|
|
277
278
|
codeHardening,
|
|
@@ -310,7 +311,8 @@ var _default = exports.default = {
|
|
|
310
311
|
jscramblerVersion,
|
|
311
312
|
proxy,
|
|
312
313
|
utc,
|
|
313
|
-
clientId
|
|
314
|
+
clientId,
|
|
315
|
+
clientVersion
|
|
314
316
|
});
|
|
315
317
|
let filesSrc = finalConfig.filesSrc;
|
|
316
318
|
let filesDest = finalConfig.filesDest;
|
|
@@ -596,7 +598,8 @@ var _default = exports.default = {
|
|
|
596
598
|
proxy,
|
|
597
599
|
utc,
|
|
598
600
|
skipSources,
|
|
599
|
-
clientId
|
|
601
|
+
clientId,
|
|
602
|
+
clientVersion
|
|
600
603
|
} = finalConfig;
|
|
601
604
|
const {
|
|
602
605
|
accessKey,
|
|
@@ -613,7 +616,8 @@ var _default = exports.default = {
|
|
|
613
616
|
jscramblerVersion,
|
|
614
617
|
proxy,
|
|
615
618
|
utc,
|
|
616
|
-
clientId
|
|
619
|
+
clientId,
|
|
620
|
+
clientVersion
|
|
617
621
|
});
|
|
618
622
|
let {
|
|
619
623
|
filesSrc,
|
|
@@ -685,7 +689,8 @@ var _default = exports.default = {
|
|
|
685
689
|
proxy,
|
|
686
690
|
utc,
|
|
687
691
|
jscramblerVersion,
|
|
688
|
-
clientId
|
|
692
|
+
clientId,
|
|
693
|
+
clientVersion
|
|
689
694
|
} = finalConfig;
|
|
690
695
|
const {
|
|
691
696
|
accessKey,
|
|
@@ -702,7 +707,8 @@ var _default = exports.default = {
|
|
|
702
707
|
proxy,
|
|
703
708
|
utc,
|
|
704
709
|
jscramblerVersion,
|
|
705
|
-
clientId
|
|
710
|
+
clientId,
|
|
711
|
+
clientVersion
|
|
706
712
|
});
|
|
707
713
|
const instrumentation = await client.get('/profiling-run', {
|
|
708
714
|
applicationId
|
|
@@ -1186,7 +1192,8 @@ var _default = exports.default = {
|
|
|
1186
1192
|
jscramblerVersion,
|
|
1187
1193
|
proxy,
|
|
1188
1194
|
utc,
|
|
1189
|
-
clientId
|
|
1195
|
+
clientId,
|
|
1196
|
+
clientVersion
|
|
1190
1197
|
} = finalConfig;
|
|
1191
1198
|
const {
|
|
1192
1199
|
accessKey,
|
|
@@ -1203,7 +1210,8 @@ var _default = exports.default = {
|
|
|
1203
1210
|
jscramblerVersion,
|
|
1204
1211
|
proxy,
|
|
1205
1212
|
utc,
|
|
1206
|
-
clientId
|
|
1213
|
+
clientId,
|
|
1214
|
+
clientVersion
|
|
1207
1215
|
});
|
|
1208
1216
|
const appSource = await (0, _getProtectionDefaultFragments.getIntrospection)(client, 'ApplicationSource');
|
|
1209
1217
|
if (!appSource.fields.some(_ref6 => {
|
|
@@ -1262,7 +1270,8 @@ var _default = exports.default = {
|
|
|
1262
1270
|
jscramblerVersion,
|
|
1263
1271
|
proxy,
|
|
1264
1272
|
utc,
|
|
1265
|
-
clientId
|
|
1273
|
+
clientId,
|
|
1274
|
+
clientVersion
|
|
1266
1275
|
} = finalConfig;
|
|
1267
1276
|
const {
|
|
1268
1277
|
accessKey,
|
|
@@ -1279,7 +1288,8 @@ var _default = exports.default = {
|
|
|
1279
1288
|
jscramblerVersion,
|
|
1280
1289
|
proxy,
|
|
1281
1290
|
utc,
|
|
1282
|
-
clientId
|
|
1291
|
+
clientId,
|
|
1292
|
+
clientVersion
|
|
1283
1293
|
});
|
|
1284
1294
|
const balance = await client.get('/balance');
|
|
1285
1295
|
console.log(balance);
|
package/package.json
CHANGED