@coana-tech/cli 14.12.199 → 14.12.200

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
@@ -25038,15 +25038,15 @@ var require_file = __commonJS({
25038
25038
  _incFile(callback) {
25039
25039
  debug("_incFile", this.filename);
25040
25040
  const ext2 = path9.extname(this._basename);
25041
- const basename12 = path9.basename(this._basename, ext2);
25041
+ const basename13 = path9.basename(this._basename, ext2);
25042
25042
  const tasks = [];
25043
25043
  if (this.zippedArchive) {
25044
25044
  tasks.push(
25045
25045
  function(cb) {
25046
25046
  const num = this._created > 0 && !this.tailable ? this._created : "";
25047
25047
  this._compressFile(
25048
- path9.join(this.dirname, `${basename12}${num}${ext2}`),
25049
- path9.join(this.dirname, `${basename12}${num}${ext2}.gz`),
25048
+ path9.join(this.dirname, `${basename13}${num}${ext2}`),
25049
+ path9.join(this.dirname, `${basename13}${num}${ext2}.gz`),
25050
25050
  cb
25051
25051
  );
25052
25052
  }.bind(this)
@@ -25056,9 +25056,9 @@ var require_file = __commonJS({
25056
25056
  function(cb) {
25057
25057
  if (!this.tailable) {
25058
25058
  this._created += 1;
25059
- this._checkMaxFilesIncrementing(ext2, basename12, cb);
25059
+ this._checkMaxFilesIncrementing(ext2, basename13, cb);
25060
25060
  } else {
25061
- this._checkMaxFilesTailable(ext2, basename12, cb);
25061
+ this._checkMaxFilesTailable(ext2, basename13, cb);
25062
25062
  }
25063
25063
  }.bind(this)
25064
25064
  );
@@ -25072,9 +25072,9 @@ var require_file = __commonJS({
25072
25072
  */
25073
25073
  _getFile() {
25074
25074
  const ext2 = path9.extname(this._basename);
25075
- const basename12 = path9.basename(this._basename, ext2);
25075
+ const basename13 = path9.basename(this._basename, ext2);
25076
25076
  const isRotation = this.rotationFormat ? this.rotationFormat() : this._created;
25077
- return !this.tailable && this._created ? `${basename12}${isRotation}${ext2}` : `${basename12}${ext2}`;
25077
+ return !this.tailable && this._created ? `${basename13}${isRotation}${ext2}` : `${basename13}${ext2}`;
25078
25078
  }
25079
25079
  /**
25080
25080
  * Increment the number of files created or checked by this instance.
@@ -25084,14 +25084,14 @@ var require_file = __commonJS({
25084
25084
  * @returns {undefined}
25085
25085
  * @private
25086
25086
  */
25087
- _checkMaxFilesIncrementing(ext2, basename12, callback) {
25087
+ _checkMaxFilesIncrementing(ext2, basename13, callback) {
25088
25088
  if (!this.maxFiles || this._created < this.maxFiles) {
25089
25089
  return setImmediate(callback);
25090
25090
  }
25091
25091
  const oldest = this._created - this.maxFiles;
25092
25092
  const isOldest = oldest !== 0 ? oldest : "";
25093
25093
  const isZipped = this.zippedArchive ? ".gz" : "";
25094
- const filePath = `${basename12}${isOldest}${ext2}${isZipped}`;
25094
+ const filePath = `${basename13}${isOldest}${ext2}${isZipped}`;
25095
25095
  const target = path9.join(this.dirname, filePath);
25096
25096
  fs11.unlink(target, callback);
25097
25097
  }
@@ -25106,7 +25106,7 @@ var require_file = __commonJS({
25106
25106
  * @returns {undefined}
25107
25107
  * @private
25108
25108
  */
25109
- _checkMaxFilesTailable(ext2, basename12, callback) {
25109
+ _checkMaxFilesTailable(ext2, basename13, callback) {
25110
25110
  const tasks = [];
25111
25111
  if (!this.maxFiles) {
25112
25112
  return;
@@ -25114,21 +25114,21 @@ var require_file = __commonJS({
25114
25114
  const isZipped = this.zippedArchive ? ".gz" : "";
25115
25115
  for (let x2 = this.maxFiles - 1; x2 > 1; x2--) {
25116
25116
  tasks.push(function(i7, cb) {
25117
- let fileName3 = `${basename12}${i7 - 1}${ext2}${isZipped}`;
25117
+ let fileName3 = `${basename13}${i7 - 1}${ext2}${isZipped}`;
25118
25118
  const tmppath = path9.join(this.dirname, fileName3);
25119
25119
  fs11.exists(tmppath, (exists2) => {
25120
25120
  if (!exists2) {
25121
25121
  return cb(null);
25122
25122
  }
25123
- fileName3 = `${basename12}${i7}${ext2}${isZipped}`;
25123
+ fileName3 = `${basename13}${i7}${ext2}${isZipped}`;
25124
25124
  fs11.rename(tmppath, path9.join(this.dirname, fileName3), cb);
25125
25125
  });
25126
25126
  }.bind(this, x2));
25127
25127
  }
25128
25128
  asyncSeries(tasks, () => {
25129
25129
  fs11.rename(
25130
- path9.join(this.dirname, `${basename12}${ext2}${isZipped}`),
25131
- path9.join(this.dirname, `${basename12}1${ext2}${isZipped}`),
25130
+ path9.join(this.dirname, `${basename13}${ext2}${isZipped}`),
25131
+ path9.join(this.dirname, `${basename13}1${ext2}${isZipped}`),
25132
25132
  callback
25133
25133
  );
25134
25134
  });
@@ -102682,7 +102682,7 @@ var require_parseParams = __commonJS({
102682
102682
  var require_basename = __commonJS({
102683
102683
  "../../node_modules/.pnpm/@fastify+busboy@2.1.1/node_modules/@fastify/busboy/lib/utils/basename.js"(exports2, module2) {
102684
102684
  "use strict";
102685
- module2.exports = function basename12(path9) {
102685
+ module2.exports = function basename13(path9) {
102686
102686
  if (typeof path9 !== "string") {
102687
102687
  return "";
102688
102688
  }
@@ -102709,7 +102709,7 @@ var require_multipart = __commonJS({
102709
102709
  var Dicer = require_Dicer();
102710
102710
  var parseParams = require_parseParams();
102711
102711
  var decodeText = require_decodeText();
102712
- var basename12 = require_basename();
102712
+ var basename13 = require_basename();
102713
102713
  var getLimit2 = require_getLimit();
102714
102714
  var RE_BOUNDARY = /^boundary$/i;
102715
102715
  var RE_FIELD = /^form-data$/i;
@@ -102826,7 +102826,7 @@ var require_multipart = __commonJS({
102826
102826
  } else if (RE_FILENAME.test(parsed[i7][0])) {
102827
102827
  filename = parsed[i7][1];
102828
102828
  if (!preservePath) {
102829
- filename = basename12(filename);
102829
+ filename = basename13(filename);
102830
102830
  }
102831
102831
  }
102832
102832
  }
@@ -121662,8 +121662,8 @@ var require_tmp = __commonJS({
121662
121662
  if (option === "name") {
121663
121663
  if (path9.isAbsolute(name2))
121664
121664
  throw new Error(`${option} option must not contain an absolute path, found "${name2}".`);
121665
- let basename12 = path9.basename(name2);
121666
- if (basename12 === ".." || basename12 === "." || basename12 !== name2)
121665
+ let basename13 = path9.basename(name2);
121666
+ if (basename13 === ".." || basename13 === "." || basename13 !== name2)
121667
121667
  throw new Error(`${option} option must not contain a path, found "${name2}".`);
121668
121668
  } else {
121669
121669
  if (path9.isAbsolute(name2) && !name2.startsWith(tmpDir)) {
@@ -155347,8 +155347,8 @@ var require_pattern = __commonJS({
155347
155347
  }
155348
155348
  exports2.endsWithSlashGlobStar = endsWithSlashGlobStar;
155349
155349
  function isAffectDepthOfReadingPattern(pattern) {
155350
- const basename12 = path9.basename(pattern);
155351
- return endsWithSlashGlobStar(pattern) || isStaticPattern(basename12);
155350
+ const basename13 = path9.basename(pattern);
155351
+ return endsWithSlashGlobStar(pattern) || isStaticPattern(basename13);
155352
155352
  }
155353
155353
  exports2.isAffectDepthOfReadingPattern = isAffectDepthOfReadingPattern;
155354
155354
  function expandPatternsWithBraceExpansion(patterns) {
@@ -234280,6 +234280,28 @@ function assertDefined(value2) {
234280
234280
  }
234281
234281
 
234282
234282
  // dist/internal/validate-external-dependencies.js
234283
+ import { basename as basename10 } from "path";
234284
+ function getEcosystemsFromManifestFileNames(fileNames) {
234285
+ const ecosystems = /* @__PURE__ */ new Set();
234286
+ for (const f6 of fileNames) {
234287
+ const base = basename10(f6);
234288
+ if (/^package(-lock)?\.json$|pnpm-lock\.yaml|yarn\.lock|rush\.json/.test(base))
234289
+ ecosystems.add("NPM");
234290
+ if (/^pom\.xml$|^gradlew$|^build\.sbt$/.test(base))
234291
+ ecosystems.add("MAVEN");
234292
+ if (/^go\.(mod|work)$/.test(base))
234293
+ ecosystems.add("GO");
234294
+ if (/\.(sln|csproj|vbproj|fsproj)$/.test(base))
234295
+ ecosystems.add("NUGET");
234296
+ if (/^[Cc]argo\.(toml|lock)$/.test(base))
234297
+ ecosystems.add("RUST");
234298
+ if (/^([Gg]emfile(\.lock)?|gems\.rb|[^/\\]+\.gemspec)$/.test(base))
234299
+ ecosystems.add("RUBYGEMS");
234300
+ if (/^(pyproject\.toml|setup\.py|poetry\.lock|Pipfile\.lock|uv\.lock|requirements.*\.txt)$/.test(base))
234301
+ ecosystems.add("PIP");
234302
+ }
234303
+ return [...ecosystems];
234304
+ }
234283
234305
  async function validateExternalDependencies(ecosystems, command, manifestFileNames) {
234284
234306
  const checks = [];
234285
234307
  const ecosystemSet = new Set(ecosystems);
@@ -235554,7 +235576,7 @@ var DEFAULT_REPORT_FILENAME_BASE = "coana-report";
235554
235576
  // dist/internal/exclude-dirs-from-configuration-files.js
235555
235577
  import { existsSync as existsSync25 } from "fs";
235556
235578
  import { readFile as readFile35 } from "fs/promises";
235557
- import { basename as basename10, resolve as resolve41 } from "path";
235579
+ import { basename as basename11, resolve as resolve41 } from "path";
235558
235580
  var import_yaml2 = __toESM(require_dist11(), 1);
235559
235581
  async function inferExcludeDirsFromConfigurationFiles(rootWorkingDir) {
235560
235582
  const socketYmlConfigFile = resolve41(rootWorkingDir, "socket.yml");
@@ -235574,7 +235596,7 @@ async function inferExcludeDirsFromSocketConfig(socketConfigFile) {
235574
235596
  return void 0;
235575
235597
  if (ignorePaths.some((ignorePath) => ignorePath.includes("!")))
235576
235598
  return void 0;
235577
- logger.info(`Inferring paths to exclude based on Socket config file: ${basename10(socketConfigFile)}`);
235599
+ logger.info(`Inferring paths to exclude based on Socket config file: ${basename11(socketConfigFile)}`);
235578
235600
  return config3.projectIgnorePaths;
235579
235601
  } catch (e) {
235580
235602
  return void 0;
@@ -235784,7 +235806,7 @@ function transformToVulnChainNode(dependencyTree) {
235784
235806
  }
235785
235807
 
235786
235808
  // dist/internal/socket-mode-helpers-socket-dependency-trees.js
235787
- import { basename as basename11, dirname as dirname25, join as join32, sep as sep5 } from "path";
235809
+ import { basename as basename12, dirname as dirname25, join as join32, sep as sep5 } from "path";
235788
235810
  var REQUIREMENTS_FILES_SEARCH_DEPTH2 = 3;
235789
235811
  var venvExcludes = [
235790
235812
  "venv",
@@ -235812,7 +235834,7 @@ var venvExcludes = [
235812
235834
  function inferWorkspaceFromManifestPath(ecosystem, manifestPath, properPythonProjects) {
235813
235835
  switch (ecosystem) {
235814
235836
  case "NPM": {
235815
- const base = basename11(manifestPath);
235837
+ const base = basename12(manifestPath);
235816
235838
  const dir = dirname25(manifestPath);
235817
235839
  return base === "package.json" ? dir || "." : void 0;
235818
235840
  }
@@ -235823,7 +235845,7 @@ function inferWorkspaceFromManifestPath(ecosystem, manifestPath, properPythonPro
235823
235845
  if (venvExcludes.some((exclude) => manifestPath.startsWith(`${exclude}/`) || manifestPath.includes(`/${exclude}/`))) {
235824
235846
  return void 0;
235825
235847
  }
235826
- const base = basename11(manifestPath);
235848
+ const base = basename12(manifestPath);
235827
235849
  const dir = dirname25(manifestPath);
235828
235850
  const workspaceDir = dir === "" ? "." : dir;
235829
235851
  if (properPythonProjects.includes(workspaceDir)) {
@@ -235850,7 +235872,7 @@ function inferWorkspaceFromManifestPath(ecosystem, manifestPath, properPythonPro
235850
235872
  return dirname25(manifestPath) || ".";
235851
235873
  }
235852
235874
  case "GO": {
235853
- const base = basename11(manifestPath);
235875
+ const base = basename12(manifestPath);
235854
235876
  const dir = dirname25(manifestPath);
235855
235877
  return base === "go.mod" ? dir || "." : void 0;
235856
235878
  }
@@ -235865,7 +235887,7 @@ function inferWorkspaceFromManifestPath(ecosystem, manifestPath, properPythonPro
235865
235887
  function inferProjectFromManifestPath(ecosystem, manifestPath) {
235866
235888
  switch (ecosystem) {
235867
235889
  case "NPM": {
235868
- const filename = basename11(manifestPath);
235890
+ const filename = basename12(manifestPath);
235869
235891
  if (["package-lock.json", "pnpm-lock.yaml", "pnpm-lock.yml", "yarn.lock"].includes(filename)) {
235870
235892
  return dirname25(manifestPath) || ".";
235871
235893
  }
@@ -235907,7 +235929,7 @@ async function fetchArtifactsFromSocket(rootWorkingDirectory, manifestsTarHash,
235907
235929
  }
235908
235930
  const allFiles = await getFilesRelative(rootWorkingDirectory, venvExcludes);
235909
235931
  for (const file of allFiles) {
235910
- const base = basename11(file);
235932
+ const base = basename12(file);
235911
235933
  const workspaceDir = dirname25(file) || ".";
235912
235934
  if (base === "pyproject.toml" || base === "setup.py" && await isSetupPySetuptools(join32(rootWorkingDirectory, file))) {
235913
235935
  if (!properPythonProjects.includes(workspaceDir)) {
@@ -251655,7 +251677,7 @@ async function onlineScan(dependencyTree, apiKey, timeout) {
251655
251677
  }
251656
251678
 
251657
251679
  // dist/version.js
251658
- var version3 = "14.12.199";
251680
+ var version3 = "14.12.200";
251659
251681
 
251660
251682
  // dist/cli-core.js
251661
251683
  var { mapValues, omit, partition, pickBy: pickBy2 } = import_lodash15.default;
@@ -251861,13 +251883,14 @@ var CliCore = class {
251861
251883
  }
251862
251884
  async computeAndOutputReportSocketMode(otherModulesCommunicator) {
251863
251885
  logger.info("Fetching artifacts from Socket backend");
251886
+ if (!this.options.disableExternalToolChecks) {
251887
+ const manifestFiles = await fetchManifestFilesFromManifestsTarHash(this.options.manifestsTarHash);
251888
+ const ecosystems = getEcosystemsFromManifestFileNames(manifestFiles);
251889
+ await validateExternalDependencies(ecosystems, "run", manifestFiles);
251890
+ }
251864
251891
  this.sendProgress("SCAN_FOR_VULNERABILITIES", true, ".", ".");
251865
251892
  const { artifacts, ecosystemToWorkspaceToAnalysisData, ecosystemToWorkspaceToVulnerabilities } = await fetchArtifactsFromSocket(this.rootWorkingDirectory, this.options.manifestsTarHash, "reachability", this.options.useUnreachableFromPrecomputation, this.options.useOnlyPregeneratedSboms);
251866
251893
  this.sendProgress("SCAN_FOR_VULNERABILITIES", false, ".", ".");
251867
- const detectedEcosystemsSocket = Object.keys(ecosystemToWorkspaceToAnalysisData);
251868
- if (!this.options.disableExternalToolChecks) {
251869
- await validateExternalDependencies(detectedEcosystemsSocket, "run");
251870
- }
251871
251894
  const subProjects = Object.entries(ecosystemToWorkspaceToAnalysisData).flatMap(([ecosystem, workspaceToAnalysisData]) => {
251872
251895
  return Object.entries(workspaceToAnalysisData).map(([workspace, analysisData]) => {
251873
251896
  return {
@@ -252009,10 +252032,6 @@ var CliCore = class {
252009
252032
  const manager = await ProjectManager.create(this.rootWorkingDirectory, otherModulesCommunicator, this.options.ecosystems, this.options.includeDirs, this.options.excludeDirs, this.options.changedFiles);
252010
252033
  this.sendProgress("CREATE_PROJECT_MANAGER", false);
252011
252034
  const { reachabilitySupport, traditionalScaSupport, noSupport } = manager.getSubprojectsWithWorkspacePaths();
252012
- const detectedEcosystemsSbom = [...new Set([...reachabilitySupport, ...traditionalScaSupport].map((s6) => s6.ecosystem))];
252013
- if (!this.options.disableExternalToolChecks) {
252014
- await validateExternalDependencies(detectedEcosystemsSbom, "run");
252015
- }
252016
252035
  await this.dashboardAPI.registerSubprojects([...reachabilitySupport, ...traditionalScaSupport, ...noSupport].map((sp) => ({
252017
252036
  ...sp,
252018
252037
  subprojectPath: relative22(this.rootWorkingDirectory, sp.subprojectPath) || "."
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coana-tech/cli",
3
- "version": "14.12.199",
3
+ "version": "14.12.200",
4
4
  "description": "Coana CLI",
5
5
  "type": "module",
6
6
  "bin": {