@coana-tech/cli 14.12.221 → 14.12.222

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
@@ -204489,7 +204489,11 @@ async function fetchArtifactsFromManifestsTarHash(manifestsTarHash, includePreco
204489
204489
  try {
204490
204490
  const params = new URLSearchParams({
204491
204491
  tarHash: manifestsTarHash,
204492
- includePrecomputedReachabilityResults: String(includePrecomputedReachabilityResults ?? false)
204492
+ includePrecomputedReachabilityResults: String(includePrecomputedReachabilityResults ?? false),
204493
+ // Opt in to depscan PR #19451: returns artifacts with `missingMetadata: true` for packages
204494
+ // whose precrawl metadata is unavailable (private registry, workspace, git deps). This CLI
204495
+ // version strips them after reachability analysis (see filterMissingMetadataArtifacts).
204496
+ includeMissingMetadata: "true"
204493
204497
  });
204494
204498
  const url2 = getSocketApiUrl(`orgs/${process.env.SOCKET_ORG_SLUG}/compute-artifacts?${params.toString()}`);
204495
204499
  responseData = (await axios2.post(url2, {}, { headers: getAuthHeaders() })).data;
@@ -236864,6 +236868,60 @@ function displayWorkspaceDiagnosticsSummaryInternal(diagnosticsEntries, vulns) {
236864
236868
  }
236865
236869
 
236866
236870
  // dist/internal/socket-report-socket-dependency-tree.js
236871
+ function filterMissingMetadataArtifacts(artifacts) {
236872
+ const missingIds = new Set(artifacts.filter((a4) => a4.missingMetadata).map((a4) => a4.id));
236873
+ if (missingIds.size === 0)
236874
+ return artifacts;
236875
+ const byId = new Map(artifacts.map((a4) => [a4.id, a4]));
236876
+ const resolveCache = /* @__PURE__ */ new Map();
236877
+ function resolveDependencies(id, visiting) {
236878
+ const cached = resolveCache.get(id);
236879
+ if (cached)
236880
+ return cached;
236881
+ if (visiting.has(id))
236882
+ return [];
236883
+ visiting.add(id);
236884
+ const node = byId.get(id);
236885
+ const out = /* @__PURE__ */ new Set();
236886
+ if (node) {
236887
+ for (const ref of node.dependencies ?? []) {
236888
+ if (missingIds.has(ref)) {
236889
+ for (const r3 of resolveDependencies(ref, visiting))
236890
+ out.add(r3);
236891
+ } else if (byId.has(ref)) {
236892
+ out.add(ref);
236893
+ }
236894
+ }
236895
+ }
236896
+ visiting.delete(id);
236897
+ const res = [...out];
236898
+ resolveCache.set(id, res);
236899
+ return res;
236900
+ }
236901
+ logger.debug(`Filtered out ${missingIds.size} missing-metadata component(s) after reachability analysis`);
236902
+ return artifacts.filter((a4) => !missingIds.has(a4.id)).map((a4) => {
236903
+ let dependencies = a4.dependencies;
236904
+ if (dependencies?.some((r3) => missingIds.has(r3))) {
236905
+ const out = /* @__PURE__ */ new Set();
236906
+ for (const r3 of dependencies) {
236907
+ if (missingIds.has(r3)) {
236908
+ for (const sub of resolveDependencies(r3, /* @__PURE__ */ new Set())) {
236909
+ if (sub !== a4.id)
236910
+ out.add(sub);
236911
+ }
236912
+ } else {
236913
+ out.add(r3);
236914
+ }
236915
+ }
236916
+ dependencies = [...out];
236917
+ }
236918
+ let toplevelAncestors = a4.toplevelAncestors;
236919
+ if (toplevelAncestors?.some((r3) => missingIds.has(r3))) {
236920
+ toplevelAncestors = toplevelAncestors.filter((r3) => !missingIds.has(r3));
236921
+ }
236922
+ return { ...a4, dependencies, toplevelAncestors };
236923
+ });
236924
+ }
236867
236925
  function filterOrphanedArtifacts(artifacts) {
236868
236926
  const reachable = /* @__PURE__ */ new Set();
236869
236927
  const queue = [];
@@ -236929,6 +236987,7 @@ function toSocketFactsSocketDependencyTree(artifacts, vulnerabilities, tier1Reac
236929
236987
  });
236930
236988
  }
236931
236989
  }
236990
+ artifacts = filterMissingMetadataArtifacts(artifacts);
236932
236991
  const componentsWithoutPatterns = artifacts.map((artifact) => {
236933
236992
  if (!artifact.vulnerabilities) {
236934
236993
  return { ...artifact };
@@ -251836,7 +251895,7 @@ async function onlineScan(dependencyTree, apiKey, timeout) {
251836
251895
  }
251837
251896
 
251838
251897
  // dist/version.js
251839
- var version3 = "14.12.221";
251898
+ var version3 = "14.12.222";
251840
251899
 
251841
251900
  // dist/cli-core.js
251842
251901
  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": "14.12.221",
3
+ "version": "14.12.222",
4
4
  "description": "Coana CLI",
5
5
  "type": "module",
6
6
  "bin": {