jscrambler 6.4.28 → 8.0.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 CHANGED
@@ -1,5 +1,24 @@
1
1
  # jscrambler
2
2
 
3
+ ## 8.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - [542cef9]: Added the newly developed `--delete-protection-on-success` flag to the README.
8
+
9
+ ## 7.0.0
10
+
11
+ ### Major Changes
12
+
13
+ - [26fdf6e]: Addition of a new flag `--delete-protection-on-success` that allows for the deletion of a protection after it has been run and was successful.
14
+ By default `--delete-protection-on-success` is set to `false` and must be explicitly set to `true`.
15
+
16
+ This flag was added in order to delete successful protections after the files were downloaded: protections might not be needed anymore after being used one single time and will take up space unnecessarily.
17
+
18
+ ### Patch Changes
19
+
20
+ - [6758a7f]: Better package metadata. This may assist tooling like Renovate bot.
21
+
3
22
  ## 6.4.28
4
23
 
5
24
  ### Patch Changes
package/README.md CHANGED
@@ -127,6 +127,7 @@ Options:
127
127
  --use-app-classification <bool> (version 6.3 and above) Protection should use Application Classification metadata when protecting (default: true)
128
128
  --input-symbol-table <file> (version 6.3 and above) Protection should use symbol table when protecting. (default: no file)
129
129
  --output-symbol-table <id> (version 6.3 and above) Download symbol table (json)
130
+ --delete-protection-on-success <bool> Delete a protection when it was successful (default: false)
130
131
  --jscramblerVersion <version> Use a specific Jscrambler version
131
132
  --debugMode Protect in debug mode
132
133
  --skip-sources Prevent source files from being updated
@@ -108,7 +108,7 @@ const validateBeforeProtection = function () {
108
108
  });
109
109
  return beforeProtectionArray;
110
110
  };
111
- _commander.default.version(require('../../package.json').version).usage('[options] <file ...>').option('-a, --access-key <accessKey>', 'Access key').option('-c, --config <config>', 'Jscrambler configuration options').option('-H, --host <host>', 'Hostname').option('-i, --application-id <id>', 'Application ID').option('-o, --output-dir <dir>', 'Output directory').option('-p, --port <port>', 'Port').option('--base-path <path>', 'Base Path').option('--protocol <protocol>', 'Protocol (http or https)').option('--cafile <path>', 'Internal certificate authority').option('-C, --cwd <dir>', 'Current Working Directory').option('-s, --secret-key <secretKey>', 'Secret key').option('-m, --source-maps <id>', 'Download source maps').option('-R, --randomization-seed <seed>', 'Set randomization seed').option('--instrument', 'Instrument file(s) before start profiling. ATTENTION: previous profiling information will be deleted').option('--start-profiling', 'Starts profiling (assumes an already instrumented application)').option('--stop-profiling', 'Stops profiling').option('--code-hardening-threshold <threshold>', 'Set code hardening file size threshold. Format: {value}{unit="b,kb,mb"}. Example: 200kb', validateCodeHardeningThreshold).option('--recommended-order <bool>', 'Use recommended order', validateBool('recommended-order')).option('-W, --werror <bool>', 'Set werror flag value (default: true)', validateBool('werror')).option('--utc <bool>', 'Set UTC as the request time zone. Otherwise it uses the local time zone (default: true)', validateBool('utc')).option('--tolerate-minification <bool>', "Don't detect minification as malicious tampering (default: true)", validateBool('tolerate-minification')).option('--use-profiling-data <bool>', "(version 6.2 only) Protection should use the existing profiling data (default: true)", validateBool('use-profiling-data')).option('--profiling-data-mode <mode>', "(version 6.3 and above) Select profiling mode (default: automatic)", validateProfilingDataMode).option('--remove-profiling-data', "Removes the current application profiling information").option('--use-app-classification <bool>', '(version 6.3 and above) Protection should use Application Classification metadata when protecting (default: true)', validateBool('--use-app-classification')).option('--input-symbol-table <file>', '(version 6.3 and above) Protection should use symbol table when protecting. (default: no file)').option('--output-symbol-table <id>', '(version 6.3 and above) Download output symbol table (json)').option('--jscramblerVersion <version>', 'Use a specific Jscrambler version').option('--debugMode', 'Protect in debug mode').option('--skip-sources', 'Prevent source files from being updated').option('--force-app-environment <environment>', "(version 7.1 and above) Override application's environment detected automatically. Possible values: ".concat(availableEnvironments.toString()), validateForceAppEnvironment).option('--ensure-code-annotation <bool>', "(version 7.3 and above) Fail protection if no annotations are found on the source code (default: false)", validateBool('ensure-code-annotation')).option('-n <number>', "(version 7.2 and above) Create multiple protections at once.").parse(process.argv);
111
+ _commander.default.version(require('../../package.json').version).usage('[options] <file ...>').option('-a, --access-key <accessKey>', 'Access key').option('-c, --config <config>', 'Jscrambler configuration options').option('-H, --host <host>', 'Hostname').option('-i, --application-id <id>', 'Application ID').option('-o, --output-dir <dir>', 'Output directory').option('-p, --port <port>', 'Port').option('--base-path <path>', 'Base Path').option('--protocol <protocol>', 'Protocol (http or https)').option('--cafile <path>', 'Internal certificate authority').option('-C, --cwd <dir>', 'Current Working Directory').option('-s, --secret-key <secretKey>', 'Secret key').option('-m, --source-maps <id>', 'Download source maps').option('-R, --randomization-seed <seed>', 'Set randomization seed').option('--instrument', 'Instrument file(s) before start profiling. ATTENTION: previous profiling information will be deleted').option('--start-profiling', 'Starts profiling (assumes an already instrumented application)').option('--stop-profiling', 'Stops profiling').option('--code-hardening-threshold <threshold>', 'Set code hardening file size threshold. Format: {value}{unit="b,kb,mb"}. Example: 200kb', validateCodeHardeningThreshold).option('--recommended-order <bool>', 'Use recommended order', validateBool('recommended-order')).option('-W, --werror <bool>', 'Set werror flag value (default: true)', validateBool('werror')).option('--utc <bool>', 'Set UTC as the request time zone. Otherwise it uses the local time zone (default: true)', validateBool('utc')).option('--tolerate-minification <bool>', "Don't detect minification as malicious tampering (default: true)", validateBool('tolerate-minification')).option('--use-profiling-data <bool>', "(version 6.2 only) Protection should use the existing profiling data (default: true)", validateBool('use-profiling-data')).option('--profiling-data-mode <mode>', "(version 6.3 and above) Select profiling mode (default: automatic)", validateProfilingDataMode).option('--remove-profiling-data', "Removes the current application profiling information").option('--use-app-classification <bool>', '(version 6.3 and above) Protection should use Application Classification metadata when protecting (default: true)', validateBool('--use-app-classification')).option('--input-symbol-table <file>', '(version 6.3 and above) Protection should use symbol table when protecting. (default: no file)').option('--output-symbol-table <id>', '(version 6.3 and above) Download output symbol table (json)').option('--jscramblerVersion <version>', 'Use a specific Jscrambler version').option('--debugMode', 'Protect in debug mode').option('--skip-sources', 'Prevent source files from being updated').option('--force-app-environment <environment>', "(version 7.1 and above) Override application's environment detected automatically. Possible values: ".concat(availableEnvironments.toString()), validateForceAppEnvironment).option('--ensure-code-annotation <bool>', "(version 7.3 and above) Fail protection if no annotations are found on the source code (default: false)", validateBool('ensure-code-annotation')).option('-n <number>', "(version 7.2 and above) Create multiple protections at once.").option('--delete-protection-on-success <bool>', 'Deletes the protection files after they have been protected and downloaded (default: false)', validateBool('--delete-protection-on-success')).parse(process.argv);
112
112
  let globSrc, filesSrc, config;
113
113
 
114
114
  // If -c, --config file was provided
@@ -183,6 +183,9 @@ if (config.profilingDataMode) {
183
183
  if (config.beforeProtection) {
184
184
  config.beforeProtection = validateBeforeProtection(config.beforeProtection);
185
185
  }
186
+ if (_commander.default.deleteProtectionOnSuccess) {
187
+ config.deleteProtectionOnSuccess = _commander.default.deleteProtectionOnSuccess === 'true';
188
+ }
186
189
  globSrc = config.filesSrc;
187
190
  // If src paths have been provided
188
191
  if (_commander.default.args.length > 0) {
@@ -262,7 +265,8 @@ const {
262
265
  numberOfProtections,
263
266
  ensureCodeAnnotation,
264
267
  forceAppEnvironment,
265
- beforeProtection
268
+ beforeProtection,
269
+ deleteProtectionOnSuccess
266
270
  } = config;
267
271
  const params = config.params;
268
272
  const incompatibleOptions = ['sourceMaps', 'instrument', 'startProfiling', 'stopProfiling'];
@@ -373,7 +377,8 @@ if (_commander.default.sourceMaps) {
373
377
  ensureCodeAnnotation,
374
378
  numberOfProtections,
375
379
  forceAppEnvironment,
376
- beforeProtection
380
+ beforeProtection,
381
+ deleteProtectionOnSuccess
377
382
  });
378
383
  try {
379
384
  if (typeof werror !== 'undefined') {
package/dist/index.js CHANGED
@@ -267,7 +267,8 @@ var _default = exports.default = {
267
267
  excludeList,
268
268
  numberOfProtections,
269
269
  ensureCodeAnnotation,
270
- forceAppEnvironment
270
+ forceAppEnvironment,
271
+ deleteProtectionOnSuccess
271
272
  } = finalConfig;
272
273
  const {
273
274
  accessKey,
@@ -478,6 +479,15 @@ var _default = exports.default = {
478
479
  if (printProtectionId) {
479
480
  console.log(protection._id);
480
481
  }
482
+
483
+ // change this to have the variable that checks if the protection is to be removed
484
+ if (deleteProtectionOnSuccess) {
485
+ _this.removeProtection(client, protection._id, applicationId).then(() => {
486
+ if (debug) {
487
+ console.log('Protection has been successful and will now be deleted');
488
+ }
489
+ }).catch(error => console.error(error));
490
+ }
481
491
  return protection._id;
482
492
  };
483
493
  if (processedProtections.length === 1) {
package/package.json CHANGED
@@ -1,12 +1,13 @@
1
1
  {
2
2
  "name": "jscrambler",
3
3
  "description": "Jscrambler API client.",
4
- "version": "6.4.28",
4
+ "version": "8.0.0",
5
5
  "homepage": "https://github.com/jscrambler/jscrambler",
6
6
  "author": "Jscrambler <support@jscrambler.com>",
7
7
  "repository": {
8
8
  "type": "git",
9
- "url": "https://github.com/jscrambler/jscrambler.git"
9
+ "url": "https://github.com/jscrambler/jscrambler.git",
10
+ "directory": "packages/jscrambler-cli"
10
11
  },
11
12
  "bugs": {
12
13
  "url": "https://github.com/jscrambler/jscrambler/issues"