@coana-tech/cli 15.2.7 → 15.2.9

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/cli.mjs CHANGED
@@ -204277,10 +204277,14 @@ function parseSocketResponse(responseData) {
204277
204277
  }
204278
204278
  function parseComputeArtifactsResponse(responseData) {
204279
204279
  const response = parseSocketResponse(responseData);
204280
+ const errorRecord = response.findLast(
204281
+ (r3) => r3.type === "error"
204282
+ );
204280
204283
  return {
204281
204284
  artifacts: response.filter((r3) => r3.type === "artifact").map((r3) => r3.value),
204282
- metadata: response.filter((r3) => r3.type === "metadata").flatMap((r3) => r3.value)
204285
+ metadata: response.filter((r3) => r3.type === "metadata").flatMap((r3) => r3.value),
204283
204286
  // There should always only be one metadata object
204287
+ error: errorRecord?.value
204284
204288
  };
204285
204289
  }
204286
204290
  async function createSocketTier1Scan(cliOptions, coanaCliVersion, systemInformation) {
@@ -204534,6 +204538,14 @@ async function fetchArtifactsFromManifestsTarHash(manifestsTarHash, includePreco
204534
204538
  const url2 = getSocketApiUrl(`orgs/${process.env.SOCKET_ORG_SLUG}/compute-artifacts?${params.toString()}`);
204535
204539
  responseData = (await axios2.post(url2, {}, { headers: getAuthHeaders() })).data;
204536
204540
  const result = parseComputeArtifactsResponse(responseData);
204541
+ if (result.error) {
204542
+ logger.debug(
204543
+ `compute-artifacts terminal error record: code=${result.error.code} retryable=${result.error.retryable}`
204544
+ );
204545
+ throw new Error(
204546
+ `Socket compute-artifacts failed: ${result.error.message} (code=${result.error.code})`
204547
+ );
204548
+ }
204537
204549
  if (useOnlyPregeneratedSboms) {
204538
204550
  const matcher = await initializePregeneratedSbomMatcher();
204539
204551
  result.artifacts = result.artifacts.filter(
@@ -234590,14 +234602,14 @@ function getEcosystemsFromManifestFileNames(fileNames) {
234590
234602
  }
234591
234603
  return [...ecosystems];
234592
234604
  }
234593
- async function validateExternalDependencies(ecosystems, command, manifestFileNames) {
234605
+ async function validateExternalDependencies(ecosystems, command, manifestFileNames, packageManagers) {
234594
234606
  const checks = [];
234595
234607
  const ecosystemSet = new Set(ecosystems);
234596
234608
  if (ecosystemSet.has("NPM")) {
234597
- checks.push(...getNpmChecks(command, manifestFileNames));
234609
+ checks.push(...getNpmChecks(command, manifestFileNames, packageManagers));
234598
234610
  }
234599
234611
  if (ecosystemSet.has("PIP")) {
234600
- checks.push(...getPipChecks(command, manifestFileNames));
234612
+ checks.push(...getPipChecks(command, manifestFileNames, packageManagers));
234601
234613
  }
234602
234614
  if (ecosystemSet.has("MAVEN") && command === "run") {
234603
234615
  checks.push(checkJavaAvailable());
@@ -234637,9 +234649,10 @@ async function validateExternalDependencies(ecosystems, command, manifestFileNam
234637
234649
  throw new Error(message2);
234638
234650
  }
234639
234651
  }
234640
- function getNpmChecks(command, manifestFileNames) {
234652
+ function getNpmChecks(command, manifestFileNames, packageManagers) {
234641
234653
  const checks = [];
234642
234654
  const nexe = isNexeMode();
234655
+ const isAllowed = (pm) => !packageManagers || packageManagers.includes(pm);
234643
234656
  if (command === "run") {
234644
234657
  checks.push(Promise.resolve(checkNodeVersion(20)));
234645
234658
  if (!nexe) {
@@ -234647,21 +234660,22 @@ function getNpmChecks(command, manifestFileNames) {
234647
234660
  }
234648
234661
  } else {
234649
234662
  const files = manifestFileNames ?? [];
234650
- if (files.some((f5) => f5.endsWith("package-lock.json")) && !nexe) {
234663
+ if (files.some((f5) => f5.endsWith("package-lock.json")) && !nexe && isAllowed("NPM")) {
234651
234664
  checks.push(checkTool("npm", "NPM", "Required for NPM dependency management. Install from https://nodejs.org"));
234652
234665
  }
234653
- if (files.some((f5) => f5.endsWith("pnpm-lock.yaml"))) {
234666
+ if (files.some((f5) => f5.endsWith("pnpm-lock.yaml")) && isAllowed("PNPM")) {
234654
234667
  checks.push(checkTool("pnpm", "NPM", "Required for pnpm dependency management. Install from https://pnpm.io"));
234655
234668
  }
234656
- if (files.some((f5) => f5.endsWith("yarn.lock"))) {
234669
+ if (files.some((f5) => f5.endsWith("yarn.lock")) && isAllowed("YARN")) {
234657
234670
  checks.push(checkTool("yarn", "NPM", "Required for Yarn dependency management. Install from https://yarnpkg.com"));
234658
234671
  }
234659
234672
  }
234660
234673
  return checks;
234661
234674
  }
234662
- function getPipChecks(command, manifestFileNames) {
234675
+ function getPipChecks(command, manifestFileNames, packageManagers) {
234663
234676
  const checks = [];
234664
234677
  const nexe = isNexeMode();
234678
+ const isAllowed = (pm) => !packageManagers || packageManagers.includes(pm);
234665
234679
  if (command === "run") {
234666
234680
  checks.push(checkEitherTool("python3", "python", "Python (PIP)", "python3 (or python)", "Required for Python dependency management. Install from https://python.org"));
234667
234681
  if (!nexe) {
@@ -234669,7 +234683,7 @@ function getPipChecks(command, manifestFileNames) {
234669
234683
  }
234670
234684
  } else {
234671
234685
  const files = manifestFileNames ?? [];
234672
- if (files.some((f5) => f5.endsWith("uv.lock")) && !nexe) {
234686
+ if (files.some((f5) => f5.endsWith("uv.lock")) && !nexe && isAllowed("UV")) {
234673
234687
  checks.push(checkTool("uv", "Python (PIP)", "Required for Python dependency management. Install from https://docs.astral.sh/uv/"));
234674
234688
  }
234675
234689
  }
@@ -234771,7 +234785,7 @@ ${Array.from(upgrades).map(([idx, upgradeVersion]) => ` ${prettyPrintPurlUpgrade
234771
234785
  }
234772
234786
  const detectedEcosystems = Array.from(ecosystemToSocketArtifactUpgrades.keys());
234773
234787
  if (!options.disableExternalToolChecks) {
234774
- await validateExternalDependencies(detectedEcosystems, "compute-fixes-and-upgrade-purls", manifestFiles);
234788
+ await validateExternalDependencies(detectedEcosystems, "compute-fixes-and-upgrade-purls", manifestFiles, options.packageManagers);
234775
234789
  }
234776
234790
  let anyErrors = false;
234777
234791
  let anySkipped = false;
@@ -252347,7 +252361,7 @@ async function onlineScan(dependencyTree, apiKey, timeout) {
252347
252361
  }
252348
252362
 
252349
252363
  // dist/version.js
252350
- var version3 = "15.2.7";
252364
+ var version3 = "15.2.9";
252351
252365
 
252352
252366
  // dist/cli-core.js
252353
252367
  var { mapValues, omit, partition, pickBy: pickBy2 } = import_lodash15.default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coana-tech/cli",
3
- "version": "15.2.7",
3
+ "version": "15.2.9",
4
4
  "description": "Coana CLI",
5
5
  "type": "module",
6
6
  "bin": {