@coana-tech/cli 13.19.15 → 13.19.18

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.
Files changed (2) hide show
  1. package/cli.js +148 -112
  2. package/package.json +1 -1
package/cli.js CHANGED
@@ -7063,7 +7063,7 @@ var require_buffer_list = __commonJS({
7063
7063
  }
7064
7064
  }, {
7065
7065
  key: "join",
7066
- value: function join11(s3) {
7066
+ value: function join12(s3) {
7067
7067
  if (this.length === 0) return "";
7068
7068
  var p2 = this.head;
7069
7069
  var ret = "" + p2.data;
@@ -13661,7 +13661,7 @@ var require_lodash = __commonJS({
13661
13661
  }
13662
13662
  return mapped.length && mapped[0] === arrays[0] ? baseIntersection(mapped, undefined2, comparator) : [];
13663
13663
  });
13664
- function join11(array, separator) {
13664
+ function join12(array, separator) {
13665
13665
  return array == null ? "" : nativeJoin.call(array, separator);
13666
13666
  }
13667
13667
  function last2(array) {
@@ -13813,7 +13813,7 @@ var require_lodash = __commonJS({
13813
13813
  comparator = typeof comparator == "function" ? comparator : undefined2;
13814
13814
  return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined2, comparator);
13815
13815
  });
13816
- function uniq(array) {
13816
+ function uniq2(array) {
13817
13817
  return array && array.length ? baseUniq(array) : [];
13818
13818
  }
13819
13819
  function uniqBy(array, iteratee2) {
@@ -15475,7 +15475,7 @@ var require_lodash = __commonJS({
15475
15475
  lodash.union = union;
15476
15476
  lodash.unionBy = unionBy;
15477
15477
  lodash.unionWith = unionWith;
15478
- lodash.uniq = uniq;
15478
+ lodash.uniq = uniq2;
15479
15479
  lodash.uniqBy = uniqBy;
15480
15480
  lodash.uniqWith = uniqWith;
15481
15481
  lodash.unset = unset;
@@ -15580,7 +15580,7 @@ var require_lodash = __commonJS({
15580
15580
  lodash.isUndefined = isUndefined2;
15581
15581
  lodash.isWeakMap = isWeakMap;
15582
15582
  lodash.isWeakSet = isWeakSet;
15583
- lodash.join = join11;
15583
+ lodash.join = join12;
15584
15584
  lodash.kebabCase = kebabCase;
15585
15585
  lodash.last = last2;
15586
15586
  lodash.lastIndexOf = lastIndexOf;
@@ -17300,7 +17300,7 @@ var require_safe_stable_stringify = __commonJS({
17300
17300
  return circularValue;
17301
17301
  }
17302
17302
  let res = "";
17303
- let join11 = ",";
17303
+ let join12 = ",";
17304
17304
  const originalIndentation = indentation;
17305
17305
  if (Array.isArray(value)) {
17306
17306
  if (value.length === 0) {
@@ -17314,7 +17314,7 @@ var require_safe_stable_stringify = __commonJS({
17314
17314
  indentation += spacer;
17315
17315
  res += `
17316
17316
  ${indentation}`;
17317
- join11 = `,
17317
+ join12 = `,
17318
17318
  ${indentation}`;
17319
17319
  }
17320
17320
  const maximumValuesToStringify = Math.min(value.length, maximumBreadth);
@@ -17322,13 +17322,13 @@ ${indentation}`;
17322
17322
  for (; i5 < maximumValuesToStringify - 1; i5++) {
17323
17323
  const tmp2 = stringifyFnReplacer(String(i5), value, stack2, replacer, spacer, indentation);
17324
17324
  res += tmp2 !== void 0 ? tmp2 : "null";
17325
- res += join11;
17325
+ res += join12;
17326
17326
  }
17327
17327
  const tmp = stringifyFnReplacer(String(i5), value, stack2, replacer, spacer, indentation);
17328
17328
  res += tmp !== void 0 ? tmp : "null";
17329
17329
  if (value.length - 1 > maximumBreadth) {
17330
17330
  const removedKeys = value.length - maximumBreadth - 1;
17331
- res += `${join11}"... ${getItemCount(removedKeys)} not stringified"`;
17331
+ res += `${join12}"... ${getItemCount(removedKeys)} not stringified"`;
17332
17332
  }
17333
17333
  if (spacer !== "") {
17334
17334
  res += `
@@ -17349,7 +17349,7 @@ ${originalIndentation}`;
17349
17349
  let separator = "";
17350
17350
  if (spacer !== "") {
17351
17351
  indentation += spacer;
17352
- join11 = `,
17352
+ join12 = `,
17353
17353
  ${indentation}`;
17354
17354
  whitespace2 = " ";
17355
17355
  }
@@ -17363,13 +17363,13 @@ ${indentation}`;
17363
17363
  const tmp = stringifyFnReplacer(key2, value, stack2, replacer, spacer, indentation);
17364
17364
  if (tmp !== void 0) {
17365
17365
  res += `${separator}${strEscape(key2)}:${whitespace2}${tmp}`;
17366
- separator = join11;
17366
+ separator = join12;
17367
17367
  }
17368
17368
  }
17369
17369
  if (keyLength > maximumBreadth) {
17370
17370
  const removedKeys = keyLength - maximumBreadth;
17371
17371
  res += `${separator}"...":${whitespace2}"${getItemCount(removedKeys)} not stringified"`;
17372
- separator = join11;
17372
+ separator = join12;
17373
17373
  }
17374
17374
  if (spacer !== "" && separator.length > 1) {
17375
17375
  res = `
@@ -17410,7 +17410,7 @@ ${originalIndentation}`;
17410
17410
  }
17411
17411
  const originalIndentation = indentation;
17412
17412
  let res = "";
17413
- let join11 = ",";
17413
+ let join12 = ",";
17414
17414
  if (Array.isArray(value)) {
17415
17415
  if (value.length === 0) {
17416
17416
  return "[]";
@@ -17423,7 +17423,7 @@ ${originalIndentation}`;
17423
17423
  indentation += spacer;
17424
17424
  res += `
17425
17425
  ${indentation}`;
17426
- join11 = `,
17426
+ join12 = `,
17427
17427
  ${indentation}`;
17428
17428
  }
17429
17429
  const maximumValuesToStringify = Math.min(value.length, maximumBreadth);
@@ -17431,13 +17431,13 @@ ${indentation}`;
17431
17431
  for (; i5 < maximumValuesToStringify - 1; i5++) {
17432
17432
  const tmp2 = stringifyArrayReplacer(String(i5), value[i5], stack2, replacer, spacer, indentation);
17433
17433
  res += tmp2 !== void 0 ? tmp2 : "null";
17434
- res += join11;
17434
+ res += join12;
17435
17435
  }
17436
17436
  const tmp = stringifyArrayReplacer(String(i5), value[i5], stack2, replacer, spacer, indentation);
17437
17437
  res += tmp !== void 0 ? tmp : "null";
17438
17438
  if (value.length - 1 > maximumBreadth) {
17439
17439
  const removedKeys = value.length - maximumBreadth - 1;
17440
- res += `${join11}"... ${getItemCount(removedKeys)} not stringified"`;
17440
+ res += `${join12}"... ${getItemCount(removedKeys)} not stringified"`;
17441
17441
  }
17442
17442
  if (spacer !== "") {
17443
17443
  res += `
@@ -17450,7 +17450,7 @@ ${originalIndentation}`;
17450
17450
  let whitespace2 = "";
17451
17451
  if (spacer !== "") {
17452
17452
  indentation += spacer;
17453
- join11 = `,
17453
+ join12 = `,
17454
17454
  ${indentation}`;
17455
17455
  whitespace2 = " ";
17456
17456
  }
@@ -17459,7 +17459,7 @@ ${indentation}`;
17459
17459
  const tmp = stringifyArrayReplacer(key2, value[key2], stack2, replacer, spacer, indentation);
17460
17460
  if (tmp !== void 0) {
17461
17461
  res += `${separator}${strEscape(key2)}:${whitespace2}${tmp}`;
17462
- separator = join11;
17462
+ separator = join12;
17463
17463
  }
17464
17464
  }
17465
17465
  if (spacer !== "" && separator.length > 1) {
@@ -17517,20 +17517,20 @@ ${originalIndentation}`;
17517
17517
  indentation += spacer;
17518
17518
  let res2 = `
17519
17519
  ${indentation}`;
17520
- const join12 = `,
17520
+ const join13 = `,
17521
17521
  ${indentation}`;
17522
17522
  const maximumValuesToStringify = Math.min(value.length, maximumBreadth);
17523
17523
  let i5 = 0;
17524
17524
  for (; i5 < maximumValuesToStringify - 1; i5++) {
17525
17525
  const tmp2 = stringifyIndent(String(i5), value[i5], stack2, spacer, indentation);
17526
17526
  res2 += tmp2 !== void 0 ? tmp2 : "null";
17527
- res2 += join12;
17527
+ res2 += join13;
17528
17528
  }
17529
17529
  const tmp = stringifyIndent(String(i5), value[i5], stack2, spacer, indentation);
17530
17530
  res2 += tmp !== void 0 ? tmp : "null";
17531
17531
  if (value.length - 1 > maximumBreadth) {
17532
17532
  const removedKeys = value.length - maximumBreadth - 1;
17533
- res2 += `${join12}"... ${getItemCount(removedKeys)} not stringified"`;
17533
+ res2 += `${join13}"... ${getItemCount(removedKeys)} not stringified"`;
17534
17534
  }
17535
17535
  res2 += `
17536
17536
  ${originalIndentation}`;
@@ -17546,16 +17546,16 @@ ${originalIndentation}`;
17546
17546
  return '"[Object]"';
17547
17547
  }
17548
17548
  indentation += spacer;
17549
- const join11 = `,
17549
+ const join12 = `,
17550
17550
  ${indentation}`;
17551
17551
  let res = "";
17552
17552
  let separator = "";
17553
17553
  let maximumPropertiesToStringify = Math.min(keyLength, maximumBreadth);
17554
17554
  if (isTypedArrayWithEntries(value)) {
17555
- res += stringifyTypedArray(value, join11, maximumBreadth);
17555
+ res += stringifyTypedArray(value, join12, maximumBreadth);
17556
17556
  keys = keys.slice(value.length);
17557
17557
  maximumPropertiesToStringify -= value.length;
17558
- separator = join11;
17558
+ separator = join12;
17559
17559
  }
17560
17560
  if (deterministic) {
17561
17561
  keys = insertSort(keys);
@@ -17566,13 +17566,13 @@ ${indentation}`;
17566
17566
  const tmp = stringifyIndent(key2, value[key2], stack2, spacer, indentation);
17567
17567
  if (tmp !== void 0) {
17568
17568
  res += `${separator}${strEscape(key2)}: ${tmp}`;
17569
- separator = join11;
17569
+ separator = join12;
17570
17570
  }
17571
17571
  }
17572
17572
  if (keyLength > maximumBreadth) {
17573
17573
  const removedKeys = keyLength - maximumBreadth;
17574
17574
  res += `${separator}"...": "${getItemCount(removedKeys)} not stringified"`;
17575
- separator = join11;
17575
+ separator = join12;
17576
17576
  }
17577
17577
  if (separator !== "") {
17578
17578
  res = `
@@ -92458,6 +92458,11 @@ var init_docker_spec = __esm({
92458
92458
  "use strict";
92459
92459
  import_path14 = require("path");
92460
92460
  builderSpecs = [
92461
+ {
92462
+ name: "maven-builder",
92463
+ file: (0, import_path14.join)("builders", "maven", "Dockerfile"),
92464
+ isBuilder: true
92465
+ },
92461
92466
  {
92462
92467
  name: "python-builder",
92463
92468
  file: (0, import_path14.join)("builders", "python", "Dockerfile"),
@@ -92492,6 +92497,9 @@ var init_docker_spec = __esm({
92492
92497
  jdk19: { JDK_VERSION: "19", ALPINE_COMMUNITY_REPOSITORY_VERSION: "3.19" },
92493
92498
  jdk20: { JDK_VERSION: "20", ALPINE_COMMUNITY_REPOSITORY_VERSION: "3.19" },
92494
92499
  jdk21: { JDK_VERSION: "21" }
92500
+ },
92501
+ from: {
92502
+ name: "maven-builder"
92495
92503
  }
92496
92504
  },
92497
92505
  {
@@ -95295,7 +95303,9 @@ var require_file_utils = __commonJS({
95295
95303
  exports2.excludeFiles = excludeFiles;
95296
95304
  exports2.copyFiles = copyFiles;
95297
95305
  exports2.findParent = findParent2;
95306
+ exports2.getAllFilesRec = getAllFilesRec;
95298
95307
  var promises_12 = require("fs/promises");
95308
+ var lodash_1 = require_lodash();
95299
95309
  var micromatch_1 = require_micromatch();
95300
95310
  var path_1 = require("path");
95301
95311
  var async_1 = (init_async(), __toCommonJS(async_exports));
@@ -95323,6 +95333,23 @@ var require_file_utils = __commonJS({
95323
95333
  } while (curr !== last2);
95324
95334
  return void 0;
95325
95335
  }
95336
+ async function getAllFilesRec(dir, excludeDirs) {
95337
+ async function helper(dir2, arrayOfFiles) {
95338
+ const files = await (0, promises_12.readdir)(dir2);
95339
+ for (const file of files) {
95340
+ const filePath = (0, path_1.join)(dir2, file);
95341
+ const info = await (0, promises_12.stat)(filePath);
95342
+ if (info.isDirectory()) {
95343
+ if (!excludeDirs?.includes(file))
95344
+ await helper(filePath, arrayOfFiles);
95345
+ } else {
95346
+ arrayOfFiles.push(filePath);
95347
+ }
95348
+ }
95349
+ return arrayOfFiles;
95350
+ }
95351
+ return (0, lodash_1.uniq)(await helper(dir, []));
95352
+ }
95326
95353
  }
95327
95354
  });
95328
95355
 
@@ -95577,10 +95604,11 @@ function findParent(dir, predicate, wholePath) {
95577
95604
  } while (curr !== last2);
95578
95605
  return void 0;
95579
95606
  }
95580
- var import_micromatch, import_path17;
95607
+ var import_lodash4, import_micromatch, import_path17;
95581
95608
  var init_file_utils = __esm({
95582
95609
  "../utils/src/file-utils.ts"() {
95583
95610
  "use strict";
95611
+ import_lodash4 = __toESM(require_lodash());
95584
95612
  import_micromatch = __toESM(require_micromatch());
95585
95613
  import_path17 = require("path");
95586
95614
  init_async();
@@ -95588,21 +95616,21 @@ var init_file_utils = __esm({
95588
95616
  });
95589
95617
 
95590
95618
  // ../utils/src/constants.ts
95591
- var import_path18, import_lodash4, COANA_ROOT2, COANA_REPOS_PATH, REQUIREMENTS_FILES_SEARCH_DEPTH;
95619
+ var import_path18, import_lodash5, COANA_ROOT2, COANA_REPOS_PATH, REQUIREMENTS_FILES_SEARCH_DEPTH;
95592
95620
  var init_constants2 = __esm({
95593
95621
  "../utils/src/constants.ts"() {
95594
95622
  "use strict";
95595
95623
  import_path18 = require("path");
95596
95624
  init_file_utils();
95597
- import_lodash4 = __toESM(require_lodash());
95598
- COANA_ROOT2 = (0, import_lodash4.once)(() => {
95625
+ import_lodash5 = __toESM(require_lodash());
95626
+ COANA_ROOT2 = (0, import_lodash5.once)(() => {
95599
95627
  const coanaRoot = process.env.COANA_ROOT ?? findParent(__dirname, (d2) => ["coana-package-manager", "coana"].includes(d2));
95600
95628
  if (!coanaRoot) {
95601
95629
  throw new Error("COANA_ROOT not set and could not be found");
95602
95630
  }
95603
95631
  return coanaRoot;
95604
95632
  });
95605
- COANA_REPOS_PATH = (0, import_lodash4.once)(() => {
95633
+ COANA_REPOS_PATH = (0, import_lodash5.once)(() => {
95606
95634
  return process.env.COANA_REPOS_PATH ?? (0, import_path18.resolve)(COANA_ROOT2(), "coana-repos");
95607
95635
  });
95608
95636
  REQUIREMENTS_FILES_SEARCH_DEPTH = 2;
@@ -95610,17 +95638,17 @@ var init_constants2 = __esm({
95610
95638
  });
95611
95639
 
95612
95640
  // ../other-modules-communicator/src/constants.ts
95613
- var import_lodash5, import_path19, PACKAGE_MANAGER_SCRIPT_PATH, REACHABILITY_ANALYZERS_SCRIPT_PATH, DOCKER_ENV_VARS_BLACKLIST;
95641
+ var import_lodash6, import_path19, PACKAGE_MANAGER_SCRIPT_PATH, REACHABILITY_ANALYZERS_SCRIPT_PATH, DOCKER_ENV_VARS_BLACKLIST;
95614
95642
  var init_constants3 = __esm({
95615
95643
  "../other-modules-communicator/src/constants.ts"() {
95616
95644
  "use strict";
95617
- import_lodash5 = __toESM(require_lodash());
95645
+ import_lodash6 = __toESM(require_lodash());
95618
95646
  import_path19 = require("path");
95619
95647
  init_constants2();
95620
- PACKAGE_MANAGER_SCRIPT_PATH = (0, import_lodash5.once)(() => {
95648
+ PACKAGE_MANAGER_SCRIPT_PATH = (0, import_lodash6.once)(() => {
95621
95649
  return process.env.PACKAGE_MANAGER_SCRIPT_PATH ?? (0, import_path19.resolve)(COANA_ROOT2(), "packages", "package-management", "dist", "package-management-cli.js");
95622
95650
  });
95623
- REACHABILITY_ANALYZERS_SCRIPT_PATH = (0, import_lodash5.once)(() => {
95651
+ REACHABILITY_ANALYZERS_SCRIPT_PATH = (0, import_lodash6.once)(() => {
95624
95652
  return process.env.REACHABILITY_ANALYZERS_SCRIPT_PATH ?? (0, import_path19.resolve)(COANA_ROOT2(), "packages", "reachability-analyzers", "dist", "reachability-analyzers-cli.js");
95625
95653
  });
95626
95654
  DOCKER_ENV_VARS_BLACKLIST = [
@@ -95642,13 +95670,13 @@ var other_modules_communicator_exports = {};
95642
95670
  __export(other_modules_communicator_exports, {
95643
95671
  OtherModulesCommunicator: () => OtherModulesCommunicator
95644
95672
  });
95645
- var import_promises11, import_lodash6, import_path20, import_logger_singleton7, OtherModulesCommunicator;
95673
+ var import_promises11, import_lodash7, import_path20, import_logger_singleton7, OtherModulesCommunicator;
95646
95674
  var init_other_modules_communicator = __esm({
95647
95675
  "../other-modules-communicator/src/other-modules-communicator.ts"() {
95648
95676
  "use strict";
95649
95677
  init_docker_manager();
95650
95678
  import_promises11 = require("fs/promises");
95651
- import_lodash6 = __toESM(require_lodash());
95679
+ import_lodash7 = __toESM(require_lodash());
95652
95680
  import_path20 = require("path");
95653
95681
  init_command_utils();
95654
95682
  init_tmp_file();
@@ -95662,7 +95690,7 @@ var init_other_modules_communicator = __esm({
95662
95690
  this.options = options;
95663
95691
  }
95664
95692
  // Memoize temporary directory per subprojectPath
95665
- getTmpDirForSubproject = (0, import_lodash6.memoize)(
95693
+ getTmpDirForSubproject = (0, import_lodash7.memoize)(
95666
95694
  async (_subprojectPath) => createTmpDirectory(`coana-other-modules-communicator`)
95667
95695
  );
95668
95696
  getSpinnerTextForPackageManagerCommand(cmd, packageManagerName, subprojectPath) {
@@ -95697,7 +95725,7 @@ var init_other_modules_communicator = __esm({
95697
95725
  return this.options.runWithoutDocker ? subprojectPath : (0, import_path20.resolve)("/project", (0, import_path20.relative)(this.rootWorkingDir, subprojectPath));
95698
95726
  }
95699
95727
  // options shared between package-management and reachability-analyzers
95700
- commonOptions = (0, import_lodash6.once)(
95728
+ commonOptions = (0, import_lodash7.once)(
95701
95729
  () => argt`${this.options.debug && "--debug"} ${this.options.silent && "--silent"}
95702
95730
  --coana-log-path=${this.options.coanaLogPath} --silent-spinner`
95703
95731
  );
@@ -123322,7 +123350,7 @@ function prettyPrintAxiosError(error) {
123322
123350
  requestBodyExcerpt = error.config?.data.toString();
123323
123351
  }
123324
123352
  }
123325
- const errorContext = (0, import_lodash7.pickBy)(
123353
+ const errorContext = (0, import_lodash8.pickBy)(
123326
123354
  {
123327
123355
  url: error.config?.url,
123328
123356
  method: error.config?.method,
@@ -123341,11 +123369,11 @@ function prettyPrintAxiosError(error) {
123341
123369
  console.error("Unknown Axios error", error.message);
123342
123370
  }
123343
123371
  }
123344
- var import_lodash7;
123372
+ var import_lodash8;
123345
123373
  var init_axios_error = __esm({
123346
123374
  "../utils/src/dashboard-api/axios-error.ts"() {
123347
123375
  "use strict";
123348
- import_lodash7 = __toESM(require_lodash());
123376
+ import_lodash8 = __toESM(require_lodash());
123349
123377
  }
123350
123378
  });
123351
123379
 
@@ -124074,7 +124102,7 @@ function convertDetectedOccurrenceToLegacyFormat(detectedOccurrence, ecosystem)
124074
124102
  affectedPackages: detectedOccurrence.affectedPackages,
124075
124103
  type: getTypeFromEcosystem(ecosystem),
124076
124104
  match: {},
124077
- affectedAppCodePoints: (0, import_lodash8.map)(detectedOccurrence.stacks, "0.sourceLocation")
124105
+ affectedAppCodePoints: (0, import_lodash9.map)(detectedOccurrence.stacks, "0.sourceLocation")
124078
124106
  };
124079
124107
  }
124080
124108
  return {
@@ -124105,11 +124133,11 @@ function getTypeFromEcosystem(ecosystem) {
124105
124133
  throw new Error(`Unsupported ecosystem: ${ecosystem}`);
124106
124134
  }
124107
124135
  }
124108
- var import_lodash8;
124136
+ var import_lodash9;
124109
124137
  var init_detected_occurrence_utils = __esm({
124110
124138
  "../web-compat-utils/src/detected-occurrence-utils.ts"() {
124111
124139
  "use strict";
124112
- import_lodash8 = __toESM(require_lodash());
124140
+ import_lodash9 = __toESM(require_lodash());
124113
124141
  init_dist();
124114
124142
  }
124115
124143
  });
@@ -129900,7 +129928,7 @@ var init_ecosystem_manager = __esm({
129900
129928
  });
129901
129929
 
129902
129930
  // ../utils/src/python-versions-manager.ts
129903
- var import_semver4, import_child_process2, import_lodash9, systemPython;
129931
+ var import_semver4, import_child_process2, import_lodash10, systemPython;
129904
129932
  var init_python_versions_manager = __esm({
129905
129933
  "../utils/src/python-versions-manager.ts"() {
129906
129934
  "use strict";
@@ -129909,8 +129937,8 @@ var init_python_versions_manager = __esm({
129909
129937
  init_logger_singleton();
129910
129938
  init_pip_utils();
129911
129939
  import_child_process2 = require("child_process");
129912
- import_lodash9 = __toESM(require_lodash());
129913
- systemPython = (0, import_lodash9.once)(() => (0, import_child_process2.execFileSync)("which", ["python"], { encoding: "utf8" }).trim());
129940
+ import_lodash10 = __toESM(require_lodash());
129941
+ systemPython = (0, import_lodash10.once)(() => (0, import_child_process2.execFileSync)("which", ["python"], { encoding: "utf8" }).trim());
129914
129942
  }
129915
129943
  });
129916
129944
 
@@ -171241,13 +171269,13 @@ var init_esm11 = __esm({
171241
171269
  function getUrlForArtifact(repository, groupId, artifactId, type, classifier, version2) {
171242
171270
  return `${repository}/${groupId.replaceAll(".", "/")}/${artifactId}/${version2}/${artifactId}-${version2}${classifier ? `-${classifier}` : ""}.${type ?? "jar"}`;
171243
171271
  }
171244
- var import_lodash10, MAVEN_PUBLIC_REPOSITORIES, memoizedParseShellArgs;
171272
+ var import_lodash11, MAVEN_PUBLIC_REPOSITORIES, memoizedParseShellArgs;
171245
171273
  var init_maven_utils = __esm({
171246
171274
  "../utils/src/maven-utils.ts"() {
171247
171275
  "use strict";
171248
171276
  init_command_utils();
171249
171277
  init_esm11();
171250
- import_lodash10 = __toESM(require_lodash());
171278
+ import_lodash11 = __toESM(require_lodash());
171251
171279
  MAVEN_PUBLIC_REPOSITORIES = [
171252
171280
  "https://repo1.maven.org/maven2",
171253
171281
  "https://packages.atlassian.com/artifactory/maven-atlassian-external",
@@ -171257,7 +171285,7 @@ var init_maven_utils = __esm({
171257
171285
  "https://maven.wso2.org/nexus/content/repositories/public",
171258
171286
  "https://nexus.bedatadriven.com/content/groups/public"
171259
171287
  ];
171260
- memoizedParseShellArgs = (0, import_lodash10.memoize)(parseShellArgs);
171288
+ memoizedParseShellArgs = (0, import_lodash11.memoize)(parseShellArgs);
171261
171289
  }
171262
171290
  });
171263
171291
 
@@ -171515,8 +171543,8 @@ var init_vulnerabilities_supported_db = __esm({
171515
171543
  async getAllActiveCoanaSupportedVulnerabilities() {
171516
171544
  return this.vulnerabilitiesSupportedCollection.find({ active: true, withdrawnAt: null }).toArray();
171517
171545
  }
171518
- async getAllCoanaSupportedVulnerabilities() {
171519
- return this.vulnerabilitiesSupportedCollection.find({}).toArray();
171546
+ async getAllCoanaSupportedVulnerabilities(ecosystem) {
171547
+ return this.vulnerabilitiesSupportedCollection.find(ecosystem !== void 0 ? { ecosystem } : {}).toArray();
171520
171548
  }
171521
171549
  async getCoanaSupportedVulnerability(ecosystem, advisory) {
171522
171550
  return this.vulnerabilitiesSupportedCollection.findOne({
@@ -171578,35 +171606,41 @@ var coana_supported_vulnerabilities_loader_exports = {};
171578
171606
  __export(coana_supported_vulnerabilities_loader_exports, {
171579
171607
  CoanaSupportedVulnerabilitiesLoader: () => CoanaSupportedVulnerabilitiesLoader
171580
171608
  });
171581
- var CoanaSupportedVulnerabilitiesLoader;
171609
+ var CoanaSupportedVulnerabilitiesLoader, OfflineCoanaSupportedVulnerabilitiesLoader, DatabaseCoanaSupportedVulnerabilitiesLoader;
171582
171610
  var init_coana_supported_vulnerabilities_loader = __esm({
171583
171611
  "../security-auditor/security-auditor-api/src/package-meta-data/coana-supported-vulnerabilities-loader.ts"() {
171584
171612
  "use strict";
171585
171613
  init_vulnerabilities_supported_db();
171586
171614
  CoanaSupportedVulnerabilitiesLoader = class {
171587
- // only used if ecosystemToUrlToVulnerabilityDetails is not provided
171588
- /**
171589
- * Uses the database from mongodb if ecosystemToUrlToVulnerabilityDetails is not provided.
171590
- * @param ecosystemToUrlToCoanaVulnerabilityMeta
171591
- */
171592
- constructor(ecosystemToUrlToCoanaVulnerabilityMeta, vulnerabilitiesSupportedDbInterface) {
171593
- this.ecosystemToUrlToCoanaVulnerabilityMeta = ecosystemToUrlToCoanaVulnerabilityMeta;
171594
- if (!ecosystemToUrlToCoanaVulnerabilityMeta) {
171595
- this.coanaSupportedVulnerabilitiesPromise = vulnerabilitiesSupportedDbInterface ? Promise.resolve(vulnerabilitiesSupportedDbInterface) : CoanaSupportedVulnerabilitiesDBInterface.create();
171596
- }
171615
+ static create(ecosystemToUrlToVulnerabilityDetails) {
171616
+ return ecosystemToUrlToVulnerabilityDetails ? new OfflineCoanaSupportedVulnerabilitiesLoader(ecosystemToUrlToVulnerabilityDetails) : new DatabaseCoanaSupportedVulnerabilitiesLoader();
171617
+ }
171618
+ };
171619
+ OfflineCoanaSupportedVulnerabilitiesLoader = class extends CoanaSupportedVulnerabilitiesLoader {
171620
+ constructor(ecosystemToUrlToVulnerabilityDetails) {
171621
+ super();
171622
+ this.ecosystemToUrlToVulnerabilityDetails = ecosystemToUrlToVulnerabilityDetails;
171597
171623
  }
171624
+ async getCoanaSupportedVulnerability(ecosystem, advisoryUrl) {
171625
+ return { type: "offline", data: this.ecosystemToUrlToVulnerabilityDetails[ecosystem]?.[advisoryUrl] };
171626
+ }
171627
+ };
171628
+ DatabaseCoanaSupportedVulnerabilitiesLoader = class extends CoanaSupportedVulnerabilitiesLoader {
171598
171629
  coanaSupportedVulnerabilitiesPromise;
171630
+ constructor(vulnerabilitiesSupportedDbInterface) {
171631
+ super();
171632
+ this.coanaSupportedVulnerabilitiesPromise = vulnerabilitiesSupportedDbInterface ? Promise.resolve(vulnerabilitiesSupportedDbInterface) : CoanaSupportedVulnerabilitiesDBInterface.create();
171633
+ }
171599
171634
  async getCoanaSupportedVulnerability(ecosystem, advisoryUrl) {
171600
- if (this.ecosystemToUrlToCoanaVulnerabilityMeta)
171601
- return { type: "offline", data: this.ecosystemToUrlToCoanaVulnerabilityMeta[ecosystem]?.[advisoryUrl] };
171602
171635
  const vulnSupportDBEntry = await (await this.coanaSupportedVulnerabilitiesPromise).getCoanaSupportedVulnerability(ecosystem, advisoryUrl.replace("https://github.com/advisories/", ""));
171603
171636
  if (!vulnSupportDBEntry) return void 0;
171604
171637
  return { type: "database", data: vulnSupportDBEntry };
171605
171638
  }
171606
171639
  async close() {
171607
- if (this.coanaSupportedVulnerabilitiesPromise) {
171608
- await (await this.coanaSupportedVulnerabilitiesPromise).close();
171609
- }
171640
+ await (await this.coanaSupportedVulnerabilitiesPromise).close();
171641
+ }
171642
+ async getCoanaSupportedVulnerabilities(ecosystem) {
171643
+ return (await this.coanaSupportedVulnerabilitiesPromise).getAllCoanaSupportedVulnerabilities(ecosystem);
171610
171644
  }
171611
171645
  };
171612
171646
  }
@@ -189405,11 +189439,9 @@ var init_in_memory_vulnerability_metadata_store = __esm({
189405
189439
  init_vulnerability_collection_builder();
189406
189440
  init_coana_supported_vulnerabilities_loader();
189407
189441
  InMemoryVulnerabilityMetadataStore = class {
189408
- vulnerabilityDB;
189409
- vulnerabilitiesAccessPathsLoader;
189410
- constructor(vulnerabilityDB, vulnerabilitiesAccessPathsLoader) {
189411
- this.vulnerabilityDB = vulnerabilityDB ?? computeAdvisoryDB();
189412
- this.vulnerabilitiesAccessPathsLoader = vulnerabilitiesAccessPathsLoader ?? new CoanaSupportedVulnerabilitiesLoader();
189442
+ constructor(vulnerabilityDB = computeAdvisoryDB(), vulnerabilitiesAccessPathsLoader = CoanaSupportedVulnerabilitiesLoader.create()) {
189443
+ this.vulnerabilityDB = vulnerabilityDB;
189444
+ this.vulnerabilitiesAccessPathsLoader = vulnerabilitiesAccessPathsLoader;
189413
189445
  }
189414
189446
  async getVulnerabilities(ecosystem, packageName) {
189415
189447
  const cves = (await this.vulnerabilityDB)[ecosystem][packageName];
@@ -189938,18 +189970,17 @@ var init_security_auditor = __esm({
189938
189970
  /**
189939
189971
  * @param enableMissingVulnerabilitySupportReporting - if true, then slack reporting is enabled. Still requires SLACK_OAUTH_TOKEN and SLACK_CHANNEL_ID to be set.
189940
189972
  */
189941
- constructor(pms, vms, enableMissingVulnerabilitySupportReporting, coanaSupportedVulnerabilitiesLoader = void 0) {
189973
+ constructor(pms, vms, enableMissingVulnerabilitySupportReporting, coanaSupportedVulnerabilitiesLoader = CoanaSupportedVulnerabilitiesLoader.create()) {
189942
189974
  this.pms = pms;
189943
189975
  this.vms = vms;
189944
189976
  this.enableMissingVulnerabilitySupportReporting = enableMissingVulnerabilitySupportReporting;
189977
+ this.coanaSupportedVulnerabilitiesLoader = coanaSupportedVulnerabilitiesLoader;
189945
189978
  if (enableMissingVulnerabilitySupportReporting) {
189946
189979
  this.slackReporter = new SlackReporter();
189947
189980
  this.coanaSupportedVulnerabilitiesDbInterface = CoanaSupportedVulnerabilitiesDBInterface.create();
189948
189981
  }
189949
- this.coanaSupportedVulnerabilitiesLoader = coanaSupportedVulnerabilitiesLoader ?? new CoanaSupportedVulnerabilitiesLoader();
189950
189982
  }
189951
189983
  slackReporter;
189952
- coanaSupportedVulnerabilitiesLoader;
189953
189984
  coanaSupportedVulnerabilitiesDbInterface;
189954
189985
  /**
189955
189986
  * If vulnerabilitiesMap is provided, then it's used to look for vulnerabilities instead
@@ -190121,7 +190152,7 @@ var init_security_auditor = __esm({
190121
190152
  if (this.coanaSupportedVulnerabilitiesDbInterface) {
190122
190153
  await (await this.coanaSupportedVulnerabilitiesDbInterface).close();
190123
190154
  }
190124
- await this.coanaSupportedVulnerabilitiesLoader.close();
190155
+ await this.coanaSupportedVulnerabilitiesLoader.close?.();
190125
190156
  }
190126
190157
  };
190127
190158
  }
@@ -190181,8 +190212,8 @@ var require_vulnerability_scanning = __commonJS({
190181
190212
  logger_singleton_1.logger.info("using offline vulnerability scanner db");
190182
190213
  const offlineVulnerabilityScannerDB = JSON.parse(await (0, promises_12.readFile)(offlineVulnerabilityScannerDBPath, "utf-8"));
190183
190214
  const { ecosystemToUrlToVulnerabilityDetails, vulnerabilityDatabase } = offlineVulnerabilityScannerDB;
190184
- const coanaSupportedVulnerabilitiesLoader = new coana_supported_vulnerabilities_loader_1.CoanaSupportedVulnerabilitiesLoader(ecosystemToUrlToVulnerabilityDetails);
190185
- const vulnerabilityAccessPathLoader = new coana_supported_vulnerabilities_loader_1.CoanaSupportedVulnerabilitiesLoader(ecosystemToUrlToVulnerabilityDetails);
190215
+ const coanaSupportedVulnerabilitiesLoader = coana_supported_vulnerabilities_loader_1.CoanaSupportedVulnerabilitiesLoader.create(ecosystemToUrlToVulnerabilityDetails);
190216
+ const vulnerabilityAccessPathLoader = coana_supported_vulnerabilities_loader_1.CoanaSupportedVulnerabilitiesLoader.create(ecosystemToUrlToVulnerabilityDetails);
190186
190217
  const pms = new in_memory_package_metadata_store_1.InMemoryPackageMetadataStore(
190187
190218
  // packageMetaData is left as an empty object since it's only used during
190188
190219
  // the vulnerability fix algorithm, which isn't currently supported in offline mode
@@ -190204,7 +190235,7 @@ var require_version = __commonJS({
190204
190235
  "use strict";
190205
190236
  Object.defineProperty(exports2, "__esModule", { value: true });
190206
190237
  exports2.version = void 0;
190207
- exports2.version = "13.19.15";
190238
+ exports2.version = "13.19.18";
190208
190239
  }
190209
190240
  });
190210
190241
 
@@ -190591,7 +190622,7 @@ var require_cli_core = __commonJS({
190591
190622
  }
190592
190623
  return workspacePaths.map((workspacePath) => {
190593
190624
  const codeAwareScanResultsForAllPackages = [];
190594
- codeAwareScanResultsForAllPackages.push(...transformToReportVulnerabilities(workspaceToAugmentedVulnerabilities[workspacePath], projectInfo[workspacePath].directDependenciesMap ?? {}, subprojectPath, workspacePath, rootWorkingDirectory));
190625
+ codeAwareScanResultsForAllPackages.push(...this.transformToReportVulnerabilities(workspaceToAugmentedVulnerabilities[workspacePath], projectInfo[workspacePath].directDependenciesMap ?? {}, subprojectPath, workspacePath, rootWorkingDirectory));
190595
190626
  return {
190596
190627
  subprojectPath: (0, path_1.relative)(rootWorkingDirectory, subprojectPath) || ".",
190597
190628
  workspacePath,
@@ -190627,38 +190658,43 @@ var require_cli_core = __commonJS({
190627
190658
  ...workspacePath ? { workspacePath } : {}
190628
190659
  }, isStartEvent, this.reportId, this.options.apiKey);
190629
190660
  }
190661
+ /**
190662
+ * Augment the results field of the `vulns` with metadata.
190663
+ */
190664
+ transformToReportVulnerabilities(vulns, directDependencies, subprojectPath, workspacePath, projectDir) {
190665
+ return vulns.map((v) => {
190666
+ const vulnerableNode = Object.values(v.vulnChainDetails?.transitiveDependencies ?? []).find((node) => node.vulnerable);
190667
+ if (!vulnerableNode) {
190668
+ throw new Error(`AssertionError: Unable to find vulnerable node in vulnChainDetails ${JSON.stringify(v.vulnChainDetails)}} for vulnerability ${v.url}`);
190669
+ }
190670
+ const reachability = (0, vulnerability_reachability_1.getVulnReachability)(v.results);
190671
+ let dependencyType = getDependencyType(v.vulnChainDetails, v.results, directDependencies, reachability);
190672
+ if (!dependencyType || dependencyType === "unknown") {
190673
+ dependencyType = "prod&dev";
190674
+ if (this.options.apiKey) {
190675
+ (0, dashboard_integration_1.sendWarningToDashboard)("Unable to determine dependency type", { subprojectPath, workspacePath }, { vulnChainDetails: v.vulnChainDetails, results: v.results, directDependencies, reachability }, this.reportId, this.options.apiKey);
190676
+ }
190677
+ }
190678
+ return {
190679
+ vulnerabilityUrl: v.url,
190680
+ vulnerabilityUnreachableByPrecomputation: v.unreachableByPrecomputation ? v.unreachableByPrecomputation : "NOT_COMPUTED",
190681
+ // vulnChainDetails is always present
190682
+ // we only keep it as optional (potentially undefined) to
190683
+ // handle requests to the backend from old version of the CLI.
190684
+ vulnChainDetails: v.vulnChainDetails,
190685
+ subprojectPath: getRelativeSubprojectPath(subprojectPath, projectDir),
190686
+ workspacePath,
190687
+ codeAwareScanResult: v.results,
190688
+ packageName: vulnerableNode.packageName,
190689
+ packageVersion: vulnerableNode.version ?? "",
190690
+ ecosystem: v.ecosystem ?? "NPM",
190691
+ dependencyType,
190692
+ reachability
190693
+ };
190694
+ });
190695
+ }
190630
190696
  };
190631
190697
  exports2.CliCore = CliCore;
190632
- function transformToReportVulnerabilities(vulns, directDependencies, subprojectPath, workspacePath, projectDir) {
190633
- return vulns.map((v) => {
190634
- const vulnerableNode = Object.values(v.vulnChainDetails?.transitiveDependencies ?? []).find((node) => node.vulnerable);
190635
- if (!vulnerableNode) {
190636
- throw new Error(`AssertionError: Unable to find vulnerable node in vulnChainDetails ${JSON.stringify(v.vulnChainDetails)}} for vulnerability ${v.url}`);
190637
- }
190638
- const reachability = (0, vulnerability_reachability_1.getVulnReachability)(v.results);
190639
- const dependencyType = getDependencyType(v.vulnChainDetails, v.results, directDependencies, reachability);
190640
- if (dependencyType === "unknown") {
190641
- logger_singleton_1.logger.info(JSON.stringify(v.vulnChainDetails, null, 2), JSON.stringify(v.results, null, 2), directDependencies, reachability);
190642
- throw new Error(`AssertionError: Unable to determine dependency type for vulnerability ${v.url} with reachability ${reachability}`);
190643
- }
190644
- return {
190645
- vulnerabilityUrl: v.url,
190646
- vulnerabilityUnreachableByPrecomputation: v.unreachableByPrecomputation ? v.unreachableByPrecomputation : "NOT_COMPUTED",
190647
- // vulnChainDetails is always present
190648
- // we only keep it as optional (potentially undefined) to
190649
- // handle requests to the backend from old version of the CLI.
190650
- vulnChainDetails: v.vulnChainDetails,
190651
- subprojectPath: getRelativeSubprojectPath(subprojectPath, projectDir),
190652
- workspacePath,
190653
- codeAwareScanResult: v.results,
190654
- packageName: vulnerableNode.packageName,
190655
- packageVersion: vulnerableNode.version ?? "",
190656
- ecosystem: v.ecosystem ?? "NPM",
190657
- dependencyType,
190658
- reachability
190659
- };
190660
- });
190661
- }
190662
190698
  function getRelativeSubprojectPath(subprojectPath, projectDir) {
190663
190699
  return (0, path_1.relative)(projectDir, subprojectPath) || ".";
190664
190700
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coana-tech/cli",
3
- "version": "13.19.15",
3
+ "version": "13.19.18",
4
4
  "description": "Coana CLI",
5
5
  "bin": {
6
6
  "@coana-tech/cli": "./cli.js"