snyk 1.918.0 → 1.919.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.
@@ -109,7 +109,7 @@ async function monitor(...args0) {
109
109
  }
110
110
  const ecosystem = ecosystems_1.getEcosystem(options);
111
111
  if (ecosystem) {
112
- const commandResult = await ecosystems_1.monitorEcosystem(ecosystem, paths, options);
112
+ const commandResult = await ecosystems_1.monitorEcosystem(ecosystem, paths, options, contributors);
113
113
  const [monitorResults, monitorErrors] = commandResult;
114
114
  return await monitor_2.getFormattedMonitorOutput(results, monitorResults, monitorErrors, options);
115
115
  }
@@ -615,7 +615,7 @@ const monitor_1 = __webpack_require__(3708);
615
615
  const common_1 = __webpack_require__(69813);
616
616
  const policy_2 = __webpack_require__(32615);
617
617
  const SEPARATOR = '\n-------------------------------------------------------\n';
618
- async function monitorEcosystem(ecosystem, paths, options) {
618
+ async function monitorEcosystem(ecosystem, paths, options, contributors) {
619
619
  const plugin = plugins_1.getPlugin(ecosystem);
620
620
  monitor_1.validateTags(options);
621
621
  monitor_1.validateProjectAttributes(options);
@@ -646,13 +646,13 @@ async function monitorEcosystem(ecosystem, paths, options) {
646
646
  spinner_1.spinner.clearAll();
647
647
  }
648
648
  }
649
- const [monitorResults, errors] = await selectAndExecuteMonitorStrategy(ecosystem, scanResultsByPath, options);
649
+ const [monitorResults, errors] = await selectAndExecuteMonitorStrategy(ecosystem, scanResultsByPath, options, contributors);
650
650
  return [monitorResults, errors];
651
651
  }
652
652
  exports.monitorEcosystem = monitorEcosystem;
653
- async function selectAndExecuteMonitorStrategy(ecosystem, scanResultsByPath, options) {
653
+ async function selectAndExecuteMonitorStrategy(ecosystem, scanResultsByPath, options, contributors) {
654
654
  return common_1.isUnmanagedEcosystem(ecosystem)
655
- ? await resolve_monitor_facts_1.resolveAndMonitorFacts(scanResultsByPath, options)
655
+ ? await resolve_monitor_facts_1.resolveAndMonitorFacts(scanResultsByPath, options, contributors)
656
656
  : await monitorDependencies(scanResultsByPath, options);
657
657
  }
658
658
  async function generateMonitorDependenciesRequest(scanResult, options) {
@@ -880,7 +880,7 @@ const polling_monitor_1 = __webpack_require__(59354);
880
880
  const plugin_analytics_1 = __webpack_require__(33077);
881
881
  const errors_1 = __webpack_require__(55191);
882
882
  const common_1 = __webpack_require__(74434);
883
- async function resolveAndMonitorFacts(scans, options) {
883
+ async function resolveAndMonitorFacts(scans, options, contributors) {
884
884
  const results = [];
885
885
  const errors = [];
886
886
  for (const [path, scanResults] of Object.entries(scans)) {
@@ -894,7 +894,7 @@ async function resolveAndMonitorFacts(scans, options) {
894
894
  const resolutionMeta = common_1.extractResolutionMetaFromScanResult(scanResult);
895
895
  const { maxAttempts, pollInterval } = res.pollingTask;
896
896
  const attemptsCount = 0;
897
- const response = await polling_monitor_1.pollingMonitorWithTokenUntilDone(res.token, true, options, pollInterval, attemptsCount, maxAttempts, resolutionMeta);
897
+ const response = await polling_monitor_1.pollingMonitorWithTokenUntilDone(res.token, true, options, pollInterval, attemptsCount, maxAttempts, resolutionMeta, contributors);
898
898
  const ecosystemMonitorResult = {
899
899
  ...response,
900
900
  path,
@@ -2313,7 +2313,11 @@ function getIacDisplayedIssues(results, outputMeta) {
2313
2313
  .map((severity) => {
2314
2314
  const severityResults = formattedResults.results[severity];
2315
2315
  const titleOutput = color_utils_1.colors.severities[severity](`${capitalize(severity)} Severity Issues: ${severityResults.length}`);
2316
- const issuesOutput = severityResults.map(issue_1.formatIssue).join(os_1.EOL.repeat(2));
2316
+ const issuesOutput = severityResults
2317
+ .sort((severityResult1, severityResult2) => severityResult1.targetFile.localeCompare(severityResult2.targetFile) ||
2318
+ severityResult1.issue.id.localeCompare(severityResult2.issue.id))
2319
+ .map(issue_1.formatIssue)
2320
+ .join(os_1.EOL.repeat(2));
2317
2321
  debug(`iac display output - ${severity} severity ${severityResults.length} issues`);
2318
2322
  return titleOutput + os_1.EOL.repeat(2) + issuesOutput;
2319
2323
  })
@@ -5765,7 +5769,7 @@ async function requestMonitorPollingToken(options, isAsync, scanResult) {
5765
5769
  return await promise_1.makeRequest(payload);
5766
5770
  }
5767
5771
  exports.requestMonitorPollingToken = requestMonitorPollingToken;
5768
- async function pollingMonitorWithTokenUntilDone(token, isAsync, options, pollInterval, attemptsCount, maxAttempts = Infinity, resolutionMeta) {
5772
+ async function pollingMonitorWithTokenUntilDone(token, isAsync, options, pollInterval, attemptsCount, maxAttempts = Infinity, resolutionMeta, contributors = []) {
5769
5773
  const payload = {
5770
5774
  method: 'PUT',
5771
5775
  url: `${config_1.default.API}/monitor-dependencies/${token}`,
@@ -5778,6 +5782,7 @@ async function pollingMonitorWithTokenUntilDone(token, isAsync, options, pollInt
5778
5782
  body: {
5779
5783
  isAsync,
5780
5784
  resolutionMeta,
5785
+ contributors,
5781
5786
  method: 'cli',
5782
5787
  tags: monitor_1.generateTags(options),
5783
5788
  attributes: monitor_1.generateProjectAttributes(options),
@@ -5789,7 +5794,7 @@ async function pollingMonitorWithTokenUntilDone(token, isAsync, options, pollInt
5789
5794
  return response;
5790
5795
  }
5791
5796
  await common_2.delayNextStep(attemptsCount, maxAttempts, pollInterval);
5792
- return await pollingMonitorWithTokenUntilDone(token, isAsync, options, pollInterval, attemptsCount, maxAttempts, resolutionMeta);
5797
+ return await pollingMonitorWithTokenUntilDone(token, isAsync, options, pollInterval, attemptsCount, maxAttempts, resolutionMeta, contributors);
5793
5798
  }
5794
5799
  exports.pollingMonitorWithTokenUntilDone = pollingMonitorWithTokenUntilDone;
5795
5800