jscrambler
Advanced tools
Comparing version 5.4.0 to 5.4.2
@@ -60,3 +60,3 @@ #!/usr/bin/env node | ||
_commander2.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('--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('--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('--tolerate-minification <bool>', 'Don\'t detect minification as malicious tampering (default: true)', validateBool('tolerate-minification')).option('--use-profiling-data <bool>', 'Protection should use the existing profiling data (default: true)', validateBool('use-profiling-data')).option('--jscramblerVersion <version>', 'Use a specific Jscrambler version').option('--debugMode', 'Protect in debug mode').parse(process.argv); | ||
_commander2.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('--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('--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('--tolerate-minification <bool>', 'Don\'t detect minification as malicious tampering (default: true)', validateBool('tolerate-minification')).option('--use-profiling-data <bool>', 'Protection should use the existing profiling data (default: true)', validateBool('use-profiling-data')).option('--use-app-classification <bool>', 'Protection should use Application Classification metadata when protecting (default: true)', validateBool('--use-app-classification')).option('--jscramblerVersion <version>', 'Use a specific Jscrambler version').option('--debugMode', 'Protect in debug mode').parse(process.argv); | ||
@@ -102,2 +102,5 @@ var globSrc = void 0, | ||
} | ||
if (_commander2.default.useAppClassification) { | ||
config.useAppClassification = _commander2.default.useAppClassification !== 'false'; | ||
} | ||
@@ -182,3 +185,5 @@ if (config.jscramblerVersion && !/^(?:\d+\.\d+(?:-f)?|stable|latest)$/.test(config.jscramblerVersion)) { | ||
codeHardeningThreshold = _config2.codeHardeningThreshold, | ||
useProfilingData = _config2.useProfilingData; | ||
useProfilingData = _config2.useProfilingData, | ||
browsers = _config2.browsers, | ||
useAppClassification = _config2.useAppClassification; | ||
@@ -262,3 +267,5 @@ | ||
codeHardeningThreshold: codeHardeningThreshold, | ||
useProfilingData: useProfilingData | ||
useProfilingData: useProfilingData, | ||
browsers: browsers, | ||
useAppClassification: useAppClassification | ||
}; | ||
@@ -265,0 +272,0 @@ _context2.prev = 1; |
@@ -29,5 +29,5 @@ 'use strict'; | ||
['tolerateMinification', 'useProfilingData'].forEach(fieldCleanUp); | ||
['tolerateMinification', 'useProfilingData', 'useAppClassification'].forEach(fieldCleanUp); | ||
return [options, cleanedUpFragments]; | ||
} |
@@ -162,3 +162,3 @@ 'use strict'; | ||
var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(configPathOrObject, destCallback) { | ||
var _config, finalConfig, applicationId, host, port, protocol, cafile, keys, sources, _finalConfig$stream, stream, cwd, params, applicationTypes, languageSpecifications, sourceMaps, randomizationSeed, areSubscribersOrdered, useRecommendedOrder, _finalConfig$bail, bail, jscramblerVersion, debugMode, proxy, clientId, tolerateMinification, codeHardeningThreshold, useProfilingData, accessKey, secretKey, client, filesSrc, filesDest, source, removeSourceRes, zipped, _filesSrc, i, l, content, updateData, applicationUpdate, updateApplicationRes, createApplicationProtectionRes, protectionId, protection, url, sourcesErrors, _url, download; | ||
var _config, finalConfig, applicationId, host, port, protocol, cafile, keys, sources, _finalConfig$stream, stream, cwd, params, applicationTypes, languageSpecifications, sourceMaps, randomizationSeed, areSubscribersOrdered, useRecommendedOrder, _finalConfig$bail, bail, jscramblerVersion, debugMode, proxy, clientId, tolerateMinification, codeHardeningThreshold, useProfilingData, browsers, useAppClassification, accessKey, secretKey, client, filesSrc, filesDest, source, removeSourceRes, zipped, _filesSrc, i, l, content, updateData, applicationUpdate, updateApplicationRes, createApplicationProtectionRes, protectionId, protection, url, sourcesErrors, _url, download; | ||
@@ -171,3 +171,3 @@ return regeneratorRuntime.wrap(function _callee$(_context) { | ||
finalConfig = (0, _lodash2.default)(_config, _config3.default); | ||
applicationId = finalConfig.applicationId, host = finalConfig.host, port = finalConfig.port, protocol = finalConfig.protocol, cafile = finalConfig.cafile, keys = finalConfig.keys, sources = finalConfig.sources, _finalConfig$stream = finalConfig.stream, stream = _finalConfig$stream === undefined ? true : _finalConfig$stream, cwd = finalConfig.cwd, params = finalConfig.params, applicationTypes = finalConfig.applicationTypes, languageSpecifications = finalConfig.languageSpecifications, sourceMaps = finalConfig.sourceMaps, randomizationSeed = finalConfig.randomizationSeed, areSubscribersOrdered = finalConfig.areSubscribersOrdered, useRecommendedOrder = finalConfig.useRecommendedOrder, _finalConfig$bail = finalConfig.bail, bail = _finalConfig$bail === undefined ? true : _finalConfig$bail, jscramblerVersion = finalConfig.jscramblerVersion, debugMode = finalConfig.debugMode, proxy = finalConfig.proxy, clientId = finalConfig.clientId, tolerateMinification = finalConfig.tolerateMinification, codeHardeningThreshold = finalConfig.codeHardeningThreshold, useProfilingData = finalConfig.useProfilingData; | ||
applicationId = finalConfig.applicationId, host = finalConfig.host, port = finalConfig.port, protocol = finalConfig.protocol, cafile = finalConfig.cafile, keys = finalConfig.keys, sources = finalConfig.sources, _finalConfig$stream = finalConfig.stream, stream = _finalConfig$stream === undefined ? true : _finalConfig$stream, cwd = finalConfig.cwd, params = finalConfig.params, applicationTypes = finalConfig.applicationTypes, languageSpecifications = finalConfig.languageSpecifications, sourceMaps = finalConfig.sourceMaps, randomizationSeed = finalConfig.randomizationSeed, areSubscribersOrdered = finalConfig.areSubscribersOrdered, useRecommendedOrder = finalConfig.useRecommendedOrder, _finalConfig$bail = finalConfig.bail, bail = _finalConfig$bail === undefined ? true : _finalConfig$bail, jscramblerVersion = finalConfig.jscramblerVersion, debugMode = finalConfig.debugMode, proxy = finalConfig.proxy, clientId = finalConfig.clientId, tolerateMinification = finalConfig.tolerateMinification, codeHardeningThreshold = finalConfig.codeHardeningThreshold, useProfilingData = finalConfig.useProfilingData, browsers = finalConfig.browsers, useAppClassification = finalConfig.useAppClassification; | ||
accessKey = keys.accessKey, secretKey = keys.secretKey; | ||
@@ -343,5 +343,12 @@ client = new this.Client({ | ||
} | ||
if (useAppClassification !== undefined) { | ||
updateData.useAppClassification = useAppClassification; | ||
} | ||
if (!(updateData.parameters || updateData.applicationTypes || updateData.languageSpecifications || typeof updateData.areSubscribersOrdered !== 'undefined')) { | ||
_context.next = 61; | ||
if (browsers) { | ||
updateData.browsers = browsers; | ||
} | ||
if (!(updateData.parameters || updateData.applicationTypes || updateData.languageSpecifications || updateData.browsers || typeof updateData.areSubscribersOrdered !== 'undefined')) { | ||
_context.next = 63; | ||
break; | ||
@@ -354,11 +361,11 @@ } | ||
_context.next = 55; | ||
_context.next = 57; | ||
return intoObjectType(client, updateData, 'Application'); | ||
case 55: | ||
case 57: | ||
applicationUpdate = _context.sent; | ||
_context.next = 58; | ||
_context.next = 60; | ||
return this.updateApplication(client, applicationUpdate); | ||
case 58: | ||
case 60: | ||
updateApplicationRes = _context.sent; | ||
@@ -372,3 +379,3 @@ | ||
case 61: | ||
case 63: | ||
@@ -380,6 +387,6 @@ if (debug) { | ||
delete updateData._id; | ||
_context.next = 65; | ||
_context.next = 67; | ||
return this.createApplicationProtection(client, applicationId, Object.assign({ bail: bail, randomizationSeed: randomizationSeed, tolerateMinification: tolerateMinification, source: source }, updateData)); | ||
case 65: | ||
case 67: | ||
createApplicationProtectionRes = _context.sent; | ||
@@ -394,11 +401,11 @@ | ||
_context.t5 = protectionId; | ||
_context.next = 74; | ||
_context.next = 76; | ||
return (0, _getProtectionDefaultFragments2.default)(client); | ||
case 74: | ||
case 76: | ||
_context.t6 = _context.sent; | ||
_context.next = 77; | ||
_context.next = 79; | ||
return _context.t2.pollProtection.call(_context.t2, _context.t3, _context.t4, _context.t5, _context.t6); | ||
case 77: | ||
case 79: | ||
protection = _context.sent; | ||
@@ -439,3 +446,3 @@ | ||
if (!(protection.state === 'errored')) { | ||
_context.next = 92; | ||
_context.next = 94; | ||
break; | ||
@@ -453,5 +460,5 @@ } | ||
case 92: | ||
case 94: | ||
if (!(sourcesErrors.length > 0)) { | ||
_context.next = 99; | ||
_context.next = 101; | ||
break; | ||
@@ -461,3 +468,3 @@ } | ||
if (!protection.bail) { | ||
_context.next = 98; | ||
_context.next = 100; | ||
break; | ||
@@ -469,3 +476,3 @@ } | ||
case 98: | ||
case 100: | ||
sourcesErrors.forEach(function (e) { | ||
@@ -475,3 +482,3 @@ return console.warn('Non-fatal error: "' + e.message + '" in ' + e.filename); | ||
case 99: | ||
case 101: | ||
@@ -481,6 +488,6 @@ if (debug) { | ||
} | ||
_context.next = 102; | ||
_context.next = 104; | ||
return this.downloadApplicationProtection(client, protectionId); | ||
case 102: | ||
case 104: | ||
download = _context.sent; | ||
@@ -505,3 +512,3 @@ | ||
case 109: | ||
case 111: | ||
case 'end': | ||
@@ -508,0 +515,0 @@ return _context.stop(); |
{ | ||
"name": "jscrambler", | ||
"description": "Jscrambler API client.", | ||
"version": "5.4.0", | ||
"version": "5.4.2", | ||
"homepage": "https://github.com/jscrambler/jscrambler", | ||
@@ -6,0 +6,0 @@ "author": { |
@@ -92,2 +92,3 @@ # [![Jscrambler](https://media.jscrambler.com/images/logo_500px.png)](https://jscrambler.com/?utm_source=github.com&utm_medium=referral) | ||
--use-profiling-data <bool> Protection should use the existing profiling data (default: true) | ||
--use-app-classification <bool> Protection should use Application Classification metadata when protecting (default: true) | ||
--jscramblerVersion <version> Use a specific Jscrambler version | ||
@@ -94,0 +95,0 @@ --debugMode Protect in debug mode |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
120201
326
18
2560