snyk 1.1063.0 → 1.1065.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.
@@ -17342,7 +17342,7 @@ function getAllDeps(lockfilePath) {
17342
17342
  throw new Error(`Error while parsing ${LOCKFILE_NAME}:\n${error.message}`);
17343
17343
  }
17344
17344
  const graph = parser.toDepGraph();
17345
- return legacy_1.graphToDepTree(graph, "cocoapods");
17345
+ return (0, legacy_1.graphToDepTree)(graph, "cocoapods");
17346
17346
  });
17347
17347
  }
17348
17348
  function cocoapodsVersion(root) {
@@ -17387,11 +17387,13 @@ exports.OutOfSyncError = OutOfSyncError;
17387
17387
  Object.defineProperty(exports, "__esModule", ({ value: true }));
17388
17388
  exports.execute = void 0;
17389
17389
  const childProcess = __webpack_require__(63129);
17390
+ const shescape_1 = __webpack_require__(79114);
17390
17391
  function execute(command, args = [], options) {
17391
17392
  const spawnOptions = { shell: true };
17392
17393
  if (options && options.cwd) {
17393
17394
  spawnOptions.cwd = options.cwd;
17394
17395
  }
17396
+ args = (0, shescape_1.quoteAll)(args, spawnOptions);
17395
17397
  return new Promise((resolve, reject) => {
17396
17398
  let stdout = '';
17397
17399
  let stderr = '';
@@ -19227,6 +19229,7 @@ exports.init = init;
19227
19229
  "use strict";
19228
19230
 
19229
19231
  Object.defineProperty(exports, "__esModule", ({ value: true }));
19232
+ exports.inspect = exports.scan = void 0;
19230
19233
  var scan_1 = __webpack_require__(3113);
19231
19234
  Object.defineProperty(exports, "scan", ({ enumerable: true, get: function () { return scan_1.scan; } }));
19232
19235
  var inspect_1 = __webpack_require__(12442);
@@ -19248,7 +19251,7 @@ const PLUGIN_NAME = 'snyk-hex-plugin';
19248
19251
  async function inspect(root, targetFile, options = {}) {
19249
19252
  const { debug, dev, allProjects, 'project-name': projectName } = options;
19250
19253
  const [scanResult, pluginVersion] = await Promise.all([
19251
- scan_1.scan({ debug, dev, allProjects, projectName, path: root, targetFile }),
19254
+ (0, scan_1.scan)({ debug, dev, allProjects, projectName, path: root, targetFile }),
19252
19255
  getPluginVersion(),
19253
19256
  ]);
19254
19257
  const scannedProjects = scanResult.scanResults.map(({ identity, facts: [{ data: depGraph }], name }) => ({
@@ -19291,14 +19294,14 @@ const debug_1 = __webpack_require__(39410);
19291
19294
  const copy_elixir_code_to_temp_dir_1 = __webpack_require__(88395);
19292
19295
  const MANIFEST_FILE_NAME = 'mix.exs';
19293
19296
  async function scan(options) {
19294
- debug_1.init(options.debug);
19297
+ (0, debug_1.init)(options.debug);
19295
19298
  const targetFile = path.parse(path.resolve(options.path, options.targetFile || MANIFEST_FILE_NAME));
19296
19299
  if (targetFile.base !== MANIFEST_FILE_NAME) {
19297
19300
  throw new Error("target file must be 'mix.exs'.");
19298
19301
  }
19299
19302
  await verifyMixInstalled();
19300
19303
  const mixResult = await getMixResult(targetFile.dir);
19301
- const depGraphMap = mix_parser_1.buildDepGraphs(mixResult, !!options.dev, true, options.allProjects);
19304
+ const depGraphMap = (0, mix_parser_1.buildDepGraphs)(mixResult, !!options.dev, true, options.allProjects);
19302
19305
  const scanResults = Object.entries(depGraphMap).map(([name, depGraph], index) => {
19303
19306
  const isRoot = index === 0;
19304
19307
  const relativePathToManifest = getRelativePathToManifest(options, targetFile, isRoot, name);
@@ -19324,28 +19327,28 @@ exports.scan = scan;
19324
19327
  async function verifyMixInstalled() {
19325
19328
  try {
19326
19329
  const mixVersion = await subProcess.execute('mix', ['-v']);
19327
- debug_1.debug(`mix version: `, mixVersion);
19330
+ (0, debug_1.debug)(`mix version: `, mixVersion);
19328
19331
  }
19329
19332
  catch (_a) {
19330
19333
  throw new Error('mix is not installed. please make sure Elixir is installed and try again.');
19331
19334
  }
19332
19335
  }
19333
19336
  async function getMixResult(root) {
19334
- const elixirTmpDir = copy_elixir_code_to_temp_dir_1.copyElixirCodeToTempDir();
19337
+ const elixirTmpDir = (0, copy_elixir_code_to_temp_dir_1.copyElixirCodeToTempDir)();
19335
19338
  const cwd = elixirTmpDir.name;
19336
19339
  let filePath;
19337
19340
  try {
19338
19341
  const output = await subProcess.execute('mix', ['read.mix', root], { cwd });
19339
- debug_1.debug(`read.mix output: ${output}`);
19342
+ (0, debug_1.debug)(`read.mix output: ${output}`);
19340
19343
  const fileName = output.trim().split('\n').pop();
19341
- debug_1.debug(`fileName: ${fileName}`);
19344
+ (0, debug_1.debug)(`fileName: ${fileName}`);
19342
19345
  filePath = path.resolve(cwd, fileName);
19343
19346
  const result = (await fs.promises.readFile(filePath, 'utf8'));
19344
19347
  return JSON.parse(result);
19345
19348
  }
19346
19349
  catch (err) {
19347
19350
  const errorMessage = `Error parsing manifest file on ${root}`;
19348
- debug_1.debug(errorMessage, err);
19351
+ (0, debug_1.debug)(errorMessage, err);
19349
19352
  throw new Error(errorMessage);
19350
19353
  }
19351
19354
  finally {
@@ -19353,7 +19356,7 @@ async function getMixResult(root) {
19353
19356
  elixirTmpDir.removeCallback();
19354
19357
  }
19355
19358
  catch (err) {
19356
- debug_1.debug(`can't remove ${elixirTmpDir.name}`, err);
19359
+ (0, debug_1.debug)(`can't remove ${elixirTmpDir.name}`, err);
19357
19360
  }
19358
19361
  }
19359
19362
  }
@@ -19383,28 +19386,31 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
19383
19386
  exports.execute = void 0;
19384
19387
  const childProcess = __webpack_require__(63129);
19385
19388
  const debug_1 = __webpack_require__(39410);
19389
+ const shescape_1 = __webpack_require__(79114);
19386
19390
  function execute(command, args, options) {
19387
- debug_1.debug(`running "${command} ${args.join(' ')}"`);
19391
+ (0, debug_1.debug)(`running "${command} ${args.join(' ')}"`);
19388
19392
  const spawnOptions = { shell: true };
19389
19393
  if (options && options.cwd) {
19390
19394
  spawnOptions.cwd = options.cwd;
19391
19395
  }
19396
+ args = (0, shescape_1.quoteAll)(args, spawnOptions);
19392
19397
  return new Promise((resolve, reject) => {
19398
+ var _a, _b;
19393
19399
  let stdout = '';
19394
19400
  let stderr = '';
19395
19401
  const proc = childProcess.spawn(command, args, spawnOptions);
19396
- proc.stdout.on('data', (data) => {
19402
+ (_a = proc.stdout) === null || _a === void 0 ? void 0 : _a.on('data', (data) => {
19397
19403
  stdout = stdout + data;
19398
19404
  });
19399
- proc.stderr.on('data', (data) => {
19405
+ (_b = proc.stderr) === null || _b === void 0 ? void 0 : _b.on('data', (data) => {
19400
19406
  stderr = stderr + data;
19401
19407
  });
19402
19408
  proc.on('close', (code) => {
19403
19409
  if (code !== 0) {
19404
- debug_1.debug(`Error running "${command} ${args.join(' ')}", exit code: ${code}`);
19410
+ (0, debug_1.debug)(`Error running "${command} ${args.join(' ')}", exit code: ${code}`);
19405
19411
  return reject(stdout || stderr);
19406
19412
  }
19407
- debug_1.debug(`Sub process stderr:`, stderr);
19413
+ (0, debug_1.debug)(`Sub process stderr:`, stderr);
19408
19414
  resolve(stdout || stderr);
19409
19415
  });
19410
19416
  });
@@ -141694,11 +141700,11 @@ class Docker {
141694
141700
  return await dockerPull.pull(registry, repo, tag, opt);
141695
141701
  }
141696
141702
  async pullCli(targetImage, options) {
141697
- const opts = ["pull", targetImage];
141703
+ const args = ["pull", targetImage];
141698
141704
  if (options === null || options === void 0 ? void 0 : options.platform) {
141699
- opts.push(`--platform=${options.platform}`);
141705
+ args.push(`--platform=${options.platform}`);
141700
141706
  }
141701
- return subProcess.execute("docker", opts);
141707
+ return subProcess.execute("docker", args);
141702
141708
  }
141703
141709
  async save(targetImage, destination) {
141704
141710
  const request = {
@@ -144679,11 +144685,13 @@ exports.streamToJson = streamToJson;
144679
144685
  Object.defineProperty(exports, "__esModule", ({ value: true }));
144680
144686
  exports.execute = void 0;
144681
144687
  const childProcess = __webpack_require__(63129);
144688
+ const shescape_1 = __webpack_require__(79114);
144682
144689
  function execute(command, args, options) {
144683
144690
  const spawnOptions = { shell: true };
144684
144691
  if (options && options.cwd) {
144685
144692
  spawnOptions.cwd = options.cwd;
144686
144693
  }
144694
+ args = (0, shescape_1.quoteAll)(args, spawnOptions);
144687
144695
  return new Promise((resolve, reject) => {
144688
144696
  let stdout = "";
144689
144697
  let stderr = "";
@@ -165294,11 +165302,15 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
165294
165302
  exports.execute = void 0;
165295
165303
  const childProcess = __webpack_require__(63129);
165296
165304
  const index_1 = __webpack_require__(29615);
165305
+ const shescape_1 = __webpack_require__(79114);
165297
165306
  function execute(command, args, options) {
165298
165307
  const spawnOptions = { shell: true };
165299
165308
  if (options && options.cwd) {
165300
165309
  spawnOptions.cwd = options.cwd;
165301
165310
  }
165311
+ if (args) {
165312
+ args = (0, shescape_1.quoteAll)(args, spawnOptions);
165313
+ }
165302
165314
  return new Promise((resolve, reject) => {
165303
165315
  let stdout = '';
165304
165316
  let stderr = '';
@@ -192933,6 +192945,7 @@ exports.getPoetryDependencies = getPoetryDependencies;
192933
192945
  Object.defineProperty(exports, "__esModule", ({ value: true }));
192934
192946
  exports.executeSync = exports.execute = void 0;
192935
192947
  const child_process_1 = __webpack_require__(63129);
192948
+ const shescape_1 = __webpack_require__(79114);
192936
192949
  function makeSpawnOptions(options) {
192937
192950
  const spawnOptions = { shell: true };
192938
192951
  if (options && options.cwd) {
@@ -192945,6 +192958,7 @@ function makeSpawnOptions(options) {
192945
192958
  }
192946
192959
  function execute(command, args, options) {
192947
192960
  const spawnOptions = makeSpawnOptions(options);
192961
+ args = (0, shescape_1.quoteAll)(args, spawnOptions);
192948
192962
  return new Promise((resolve, reject) => {
192949
192963
  let stdout = '';
192950
192964
  let stderr = '';
@@ -192966,6 +192980,7 @@ function execute(command, args, options) {
192966
192980
  exports.execute = execute;
192967
192981
  function executeSync(command, args, options) {
192968
192982
  const spawnOptions = makeSpawnOptions(options);
192983
+ args = (0, shescape_1.quoteAll)(args, spawnOptions);
192969
192984
  return (0, child_process_1.spawnSync)(command, args, spawnOptions);
192970
192985
  }
192971
192986
  exports.executeSync = executeSync;
@@ -196566,7 +196581,7 @@ function buildHintMessage(options) {
196566
196581
  }
196567
196582
  function buildArgs(sbtArgs, isCoursierProject, isOutputGraph) {
196568
196583
  // force plain output so we don't have to parse colour codes
196569
- let args = ['"-Dsbt.log.noformat=true"'];
196584
+ let args = ['-Dsbt.log.noformat=true'];
196570
196585
  if (sbtArgs) {
196571
196586
  args = args.concat(sbtArgs);
196572
196587
  }
@@ -196788,11 +196803,11 @@ function parseSbtPluginResults(sbtOutput, packageName, packageVersion) {
196788
196803
  return depTree;
196789
196804
  }
196790
196805
  exports.parseSbtPluginResults = parseSbtPluginResults;
196806
+ const PRODUCTION_SCOPES = ['compile', 'runtime', 'provided'];
196791
196807
  function parseSbtPluginProjectResultToDepTree(projectKey, sbtProjectOutput) {
196792
196808
  const pkgs = Object.keys(sbtProjectOutput.modules)
196793
196809
  .filter((module) => {
196794
- // filtering for the `compile` configuration only, otherwise, there can be multiple graph roots
196795
- return sbtProjectOutput.modules[module].configurations.includes('compile');
196810
+ return sbtProjectOutput.modules[module].configurations.some((c) => PRODUCTION_SCOPES.includes(c));
196796
196811
  });
196797
196812
  const getDependenciesFor = (name) => {
196798
196813
  if (!sbtProjectOutput.dependencies[name]) {
@@ -196803,7 +196818,7 @@ function parseSbtPluginProjectResultToDepTree(projectKey, sbtProjectOutput) {
196803
196818
  }
196804
196819
  const dependencies = {};
196805
196820
  for (const subDepName of sbtProjectOutput.dependencies[name]) {
196806
- if (pkgs.indexOf(subDepName) > -1) { // dependency is in compile configuration
196821
+ if (pkgs.indexOf(subDepName) > -1) { // dependency is in production configuration
196807
196822
  dependencies[subDepName] = getDependenciesFor(subDepName);
196808
196823
  }
196809
196824
  }
@@ -196900,6 +196915,7 @@ exports.execute = void 0;
196900
196915
  const childProcess = __webpack_require__(63129);
196901
196916
  const treeKill = __webpack_require__(28);
196902
196917
  const debugModule = __webpack_require__(15158);
196918
+ const shescape_1 = __webpack_require__(79114);
196903
196919
  // To enable debugging output, run the CLI as `DEBUG=snyk-sbt-plugin snyk ...`
196904
196920
  const debugLogging = debugModule('snyk-sbt-plugin');
196905
196921
  // Disabled by default, to set run the CLI as `PROC_TIMEOUT=100000 snyk ...`
@@ -196910,6 +196926,7 @@ const execute = (command, args, options) => {
196910
196926
  if (options && options.cwd) {
196911
196927
  spawnOptions.cwd = options.cwd;
196912
196928
  }
196929
+ args = (0, shescape_1.quoteAll)(args, spawnOptions);
196913
196930
  return new Promise((resolve, reject) => {
196914
196931
  const out = {
196915
196932
  stdout: '',