@coana-tech/cli 13.19.0 → 13.19.1

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 +298 -248
  2. package/package.json +1 -1
package/cli.js CHANGED
@@ -10965,9 +10965,9 @@ var require_lodash = __commonJS({
10965
10965
  }
10966
10966
  return result;
10967
10967
  }
10968
- function mapToArray(map2) {
10969
- var index2 = -1, result = Array(map2.size);
10970
- map2.forEach(function(value, key) {
10968
+ function mapToArray(map3) {
10969
+ var index2 = -1, result = Array(map3.size);
10970
+ map3.forEach(function(value, key) {
10971
10971
  result[++index2] = [key, value];
10972
10972
  });
10973
10973
  return result;
@@ -13081,8 +13081,8 @@ var require_lodash = __commonJS({
13081
13081
  result2 = result2 === iteratee ? baseIteratee : result2;
13082
13082
  return arguments.length ? result2(arguments[0], arguments[1]) : result2;
13083
13083
  }
13084
- function getMapData(map3, key) {
13085
- var data2 = map3.__data__;
13084
+ function getMapData(map4, key) {
13085
+ var data2 = map4.__data__;
13086
13086
  return isKeyable(key) ? data2[typeof key == "string" ? "string" : "hash"] : data2.map;
13087
13087
  }
13088
13088
  function getMatchData(object) {
@@ -13986,14 +13986,14 @@ var require_lodash = __commonJS({
13986
13986
  var find4 = createFind(findIndex);
13987
13987
  var findLast = createFind(findLastIndex);
13988
13988
  function flatMap(collection, iteratee2) {
13989
- return baseFlatten(map2(collection, iteratee2), 1);
13989
+ return baseFlatten(map3(collection, iteratee2), 1);
13990
13990
  }
13991
13991
  function flatMapDeep(collection, iteratee2) {
13992
- return baseFlatten(map2(collection, iteratee2), INFINITY);
13992
+ return baseFlatten(map3(collection, iteratee2), INFINITY);
13993
13993
  }
13994
13994
  function flatMapDepth(collection, iteratee2, depth) {
13995
13995
  depth = depth === undefined2 ? 1 : toInteger(depth);
13996
- return baseFlatten(map2(collection, iteratee2), depth);
13996
+ return baseFlatten(map3(collection, iteratee2), depth);
13997
13997
  }
13998
13998
  function forEach2(collection, iteratee2) {
13999
13999
  var func = isArray2(collection) ? arrayEach : baseEach;
@@ -14029,7 +14029,7 @@ var require_lodash = __commonJS({
14029
14029
  var keyBy = createAggregator(function(result2, value, key) {
14030
14030
  baseAssignValue(result2, key, value);
14031
14031
  });
14032
- function map2(collection, iteratee2) {
14032
+ function map3(collection, iteratee2) {
14033
14033
  var func = isArray2(collection) ? arrayMap : baseMap;
14034
14034
  return func(collection, getIteratee(iteratee2, 3));
14035
14035
  }
@@ -15407,7 +15407,7 @@ var require_lodash = __commonJS({
15407
15407
  lodash.keyBy = keyBy;
15408
15408
  lodash.keys = keys;
15409
15409
  lodash.keysIn = keysIn;
15410
- lodash.map = map2;
15410
+ lodash.map = map3;
15411
15411
  lodash.mapKeys = mapKeys;
15412
15412
  lodash.mapValues = mapValues;
15413
15413
  lodash.matches = matches;
@@ -16706,9 +16706,9 @@ var require_colors = __commonJS({
16706
16706
  });
16707
16707
  return ret;
16708
16708
  }
16709
- var sequencer = function sequencer2(map3, str) {
16709
+ var sequencer = function sequencer2(map4, str) {
16710
16710
  var exploded = str.split("");
16711
- exploded = exploded.map(map3);
16711
+ exploded = exploded.map(map4);
16712
16712
  return exploded.join("");
16713
16713
  };
16714
16714
  colors.trap = require_trap();
@@ -16718,14 +16718,14 @@ var require_colors = __commonJS({
16718
16718
  colors.maps.zebra = require_zebra()(colors);
16719
16719
  colors.maps.rainbow = require_rainbow()(colors);
16720
16720
  colors.maps.random = require_random()(colors);
16721
- for (map2 in colors.maps) {
16722
- (function(map3) {
16723
- colors[map3] = function(str) {
16724
- return sequencer(colors.maps[map3], str);
16721
+ for (map3 in colors.maps) {
16722
+ (function(map4) {
16723
+ colors[map4] = function(str) {
16724
+ return sequencer(colors.maps[map4], str);
16725
16725
  };
16726
- })(map2);
16726
+ })(map3);
16727
16727
  }
16728
- var map2;
16728
+ var map3;
16729
16729
  defineProps(colors, init());
16730
16730
  }
16731
16731
  });
@@ -41175,9 +41175,9 @@ var require_createNode = __commonJS({
41175
41175
  if (identity.isNode(value))
41176
41176
  return value;
41177
41177
  if (identity.isPair(value)) {
41178
- const map2 = ctx.schema[identity.MAP].createNode?.(ctx.schema, null, ctx);
41179
- map2.items.push(value);
41180
- return map2;
41178
+ const map3 = ctx.schema[identity.MAP].createNode?.(ctx.schema, null, ctx);
41179
+ map3.items.push(value);
41180
+ return map3;
41181
41181
  }
41182
41182
  if (value instanceof String || value instanceof Number || value instanceof Boolean || typeof BigInt !== "undefined" && value instanceof BigInt) {
41183
41183
  value = value.valueOf();
@@ -42081,53 +42081,53 @@ var require_addPairToJSMap = __commonJS({
42081
42081
  var Scalar = require_Scalar();
42082
42082
  var toJS = require_toJS();
42083
42083
  var MERGE_KEY = "<<";
42084
- function addPairToJSMap(ctx, map2, { key, value }) {
42084
+ function addPairToJSMap(ctx, map3, { key, value }) {
42085
42085
  if (ctx?.doc.schema.merge && isMergeKey(key)) {
42086
42086
  value = identity.isAlias(value) ? value.resolve(ctx.doc) : value;
42087
42087
  if (identity.isSeq(value))
42088
42088
  for (const it of value.items)
42089
- mergeToJSMap(ctx, map2, it);
42089
+ mergeToJSMap(ctx, map3, it);
42090
42090
  else if (Array.isArray(value))
42091
42091
  for (const it of value)
42092
- mergeToJSMap(ctx, map2, it);
42092
+ mergeToJSMap(ctx, map3, it);
42093
42093
  else
42094
- mergeToJSMap(ctx, map2, value);
42094
+ mergeToJSMap(ctx, map3, value);
42095
42095
  } else {
42096
42096
  const jsKey = toJS.toJS(key, "", ctx);
42097
- if (map2 instanceof Map) {
42098
- map2.set(jsKey, toJS.toJS(value, jsKey, ctx));
42099
- } else if (map2 instanceof Set) {
42100
- map2.add(jsKey);
42097
+ if (map3 instanceof Map) {
42098
+ map3.set(jsKey, toJS.toJS(value, jsKey, ctx));
42099
+ } else if (map3 instanceof Set) {
42100
+ map3.add(jsKey);
42101
42101
  } else {
42102
42102
  const stringKey = stringifyKey(key, jsKey, ctx);
42103
42103
  const jsValue = toJS.toJS(value, stringKey, ctx);
42104
- if (stringKey in map2)
42105
- Object.defineProperty(map2, stringKey, {
42104
+ if (stringKey in map3)
42105
+ Object.defineProperty(map3, stringKey, {
42106
42106
  value: jsValue,
42107
42107
  writable: true,
42108
42108
  enumerable: true,
42109
42109
  configurable: true
42110
42110
  });
42111
42111
  else
42112
- map2[stringKey] = jsValue;
42112
+ map3[stringKey] = jsValue;
42113
42113
  }
42114
42114
  }
42115
- return map2;
42115
+ return map3;
42116
42116
  }
42117
42117
  var isMergeKey = (key) => key === MERGE_KEY || identity.isScalar(key) && key.value === MERGE_KEY && (!key.type || key.type === Scalar.Scalar.PLAIN);
42118
- function mergeToJSMap(ctx, map2, value) {
42118
+ function mergeToJSMap(ctx, map3, value) {
42119
42119
  const source = ctx && identity.isAlias(value) ? value.resolve(ctx.doc) : value;
42120
42120
  if (!identity.isMap(source))
42121
42121
  throw new Error("Merge sources must be maps or map aliases");
42122
42122
  const srcMap = source.toJSON(null, ctx, Map);
42123
42123
  for (const [key, value2] of srcMap) {
42124
- if (map2 instanceof Map) {
42125
- if (!map2.has(key))
42126
- map2.set(key, value2);
42127
- } else if (map2 instanceof Set) {
42128
- map2.add(key);
42129
- } else if (!Object.prototype.hasOwnProperty.call(map2, key)) {
42130
- Object.defineProperty(map2, key, {
42124
+ if (map3 instanceof Map) {
42125
+ if (!map3.has(key))
42126
+ map3.set(key, value2);
42127
+ } else if (map3 instanceof Set) {
42128
+ map3.add(key);
42129
+ } else if (!Object.prototype.hasOwnProperty.call(map3, key)) {
42130
+ Object.defineProperty(map3, key, {
42131
42131
  value: value2,
42132
42132
  writable: true,
42133
42133
  enumerable: true,
@@ -42135,7 +42135,7 @@ var require_addPairToJSMap = __commonJS({
42135
42135
  });
42136
42136
  }
42137
42137
  }
42138
- return map2;
42138
+ return map3;
42139
42139
  }
42140
42140
  function stringifyKey(key, jsKey, ctx) {
42141
42141
  if (jsKey === null)
@@ -42385,14 +42385,14 @@ var require_YAMLMap = __commonJS({
42385
42385
  */
42386
42386
  static from(schema, obj, ctx) {
42387
42387
  const { keepUndefined, replacer } = ctx;
42388
- const map2 = new this(schema);
42388
+ const map3 = new this(schema);
42389
42389
  const add2 = (key, value) => {
42390
42390
  if (typeof replacer === "function")
42391
42391
  value = replacer.call(obj, key, value);
42392
42392
  else if (Array.isArray(replacer) && !replacer.includes(key))
42393
42393
  return;
42394
42394
  if (value !== void 0 || keepUndefined)
42395
- map2.items.push(Pair.createPair(key, value, ctx));
42395
+ map3.items.push(Pair.createPair(key, value, ctx));
42396
42396
  };
42397
42397
  if (obj instanceof Map) {
42398
42398
  for (const [key, value] of obj)
@@ -42402,9 +42402,9 @@ var require_YAMLMap = __commonJS({
42402
42402
  add2(key, obj[key]);
42403
42403
  }
42404
42404
  if (typeof schema.sortMapEntries === "function") {
42405
- map2.items.sort(schema.sortMapEntries);
42405
+ map3.items.sort(schema.sortMapEntries);
42406
42406
  }
42407
- return map2;
42407
+ return map3;
42408
42408
  }
42409
42409
  /**
42410
42410
  * Adds a value to the collection.
@@ -42463,12 +42463,12 @@ var require_YAMLMap = __commonJS({
42463
42463
  * @returns Instance of Type, Map, or Object
42464
42464
  */
42465
42465
  toJSON(_, ctx, Type) {
42466
- const map2 = Type ? new Type() : ctx?.mapAsMap ? /* @__PURE__ */ new Map() : {};
42466
+ const map3 = Type ? new Type() : ctx?.mapAsMap ? /* @__PURE__ */ new Map() : {};
42467
42467
  if (ctx?.onCreate)
42468
- ctx.onCreate(map2);
42468
+ ctx.onCreate(map3);
42469
42469
  for (const item of this.items)
42470
- addPairToJSMap.addPairToJSMap(ctx, map2, item);
42471
- return map2;
42470
+ addPairToJSMap.addPairToJSMap(ctx, map3, item);
42471
+ return map3;
42472
42472
  }
42473
42473
  toString(ctx, onComment, onChompKeep) {
42474
42474
  if (!ctx)
@@ -42499,19 +42499,19 @@ var require_map = __commonJS({
42499
42499
  "use strict";
42500
42500
  var identity = require_identity();
42501
42501
  var YAMLMap = require_YAMLMap();
42502
- var map2 = {
42502
+ var map3 = {
42503
42503
  collection: "map",
42504
42504
  default: true,
42505
42505
  nodeClass: YAMLMap.YAMLMap,
42506
42506
  tag: "tag:yaml.org,2002:map",
42507
- resolve(map3, onError) {
42508
- if (!identity.isMap(map3))
42507
+ resolve(map4, onError) {
42508
+ if (!identity.isMap(map4))
42509
42509
  onError("Expected a mapping for this tag");
42510
- return map3;
42510
+ return map4;
42511
42511
  },
42512
42512
  createNode: (schema, obj, ctx) => YAMLMap.YAMLMap.from(schema, obj, ctx)
42513
42513
  };
42514
- exports2.map = map2;
42514
+ exports2.map = map3;
42515
42515
  }
42516
42516
  });
42517
42517
 
@@ -42836,7 +42836,7 @@ var require_int = __commonJS({
42836
42836
  var require_schema = __commonJS({
42837
42837
  "../../node_modules/.pnpm/yaml@2.5.1/node_modules/yaml/dist/schema/core/schema.js"(exports2) {
42838
42838
  "use strict";
42839
- var map2 = require_map();
42839
+ var map3 = require_map();
42840
42840
  var _null = require_null();
42841
42841
  var seq = require_seq();
42842
42842
  var string = require_string();
@@ -42844,7 +42844,7 @@ var require_schema = __commonJS({
42844
42844
  var float = require_float();
42845
42845
  var int = require_int();
42846
42846
  var schema = [
42847
- map2.map,
42847
+ map3.map,
42848
42848
  seq.seq,
42849
42849
  string.string,
42850
42850
  _null.nullTag,
@@ -42865,7 +42865,7 @@ var require_schema2 = __commonJS({
42865
42865
  "../../node_modules/.pnpm/yaml@2.5.1/node_modules/yaml/dist/schema/json/schema.js"(exports2) {
42866
42866
  "use strict";
42867
42867
  var Scalar = require_Scalar();
42868
- var map2 = require_map();
42868
+ var map3 = require_map();
42869
42869
  var seq = require_seq();
42870
42870
  function intIdentify(value) {
42871
42871
  return typeof value === "bigint" || Number.isInteger(value);
@@ -42922,7 +42922,7 @@ var require_schema2 = __commonJS({
42922
42922
  return str;
42923
42923
  }
42924
42924
  };
42925
- var schema = [map2.map, seq.seq].concat(jsonScalars, jsonError);
42925
+ var schema = [map3.map, seq.seq].concat(jsonScalars, jsonError);
42926
42926
  exports2.schema = schema;
42927
42927
  }
42928
42928
  });
@@ -43095,9 +43095,9 @@ var require_omap = __commonJS({
43095
43095
  toJSON(_, ctx) {
43096
43096
  if (!ctx)
43097
43097
  return super.toJSON(_);
43098
- const map2 = /* @__PURE__ */ new Map();
43098
+ const map3 = /* @__PURE__ */ new Map();
43099
43099
  if (ctx?.onCreate)
43100
- ctx.onCreate(map2);
43100
+ ctx.onCreate(map3);
43101
43101
  for (const pair of this.items) {
43102
43102
  let key, value;
43103
43103
  if (identity.isPair(pair)) {
@@ -43106,11 +43106,11 @@ var require_omap = __commonJS({
43106
43106
  } else {
43107
43107
  key = toJS.toJS(pair, "", ctx);
43108
43108
  }
43109
- if (map2.has(key))
43109
+ if (map3.has(key))
43110
43110
  throw new Error("Ordered maps must not include duplicate keys");
43111
- map2.set(key, value);
43111
+ map3.set(key, value);
43112
43112
  }
43113
- return map2;
43113
+ return map3;
43114
43114
  }
43115
43115
  static from(schema, iterable, ctx) {
43116
43116
  const pairs$1 = pairs.createPairs(schema, iterable, ctx);
@@ -43380,15 +43380,15 @@ var require_set = __commonJS({
43380
43380
  default: false,
43381
43381
  tag: "tag:yaml.org,2002:set",
43382
43382
  createNode: (schema, iterable, ctx) => YAMLSet.from(schema, iterable, ctx),
43383
- resolve(map2, onError) {
43384
- if (identity.isMap(map2)) {
43385
- if (map2.hasAllNullValues(true))
43386
- return Object.assign(new YAMLSet(), map2);
43383
+ resolve(map3, onError) {
43384
+ if (identity.isMap(map3)) {
43385
+ if (map3.hasAllNullValues(true))
43386
+ return Object.assign(new YAMLSet(), map3);
43387
43387
  else
43388
43388
  onError("Set items must all have null values");
43389
43389
  } else
43390
43390
  onError("Expected a mapping for this tag");
43391
- return map2;
43391
+ return map3;
43392
43392
  }
43393
43393
  };
43394
43394
  exports2.YAMLSet = YAMLSet;
@@ -43488,7 +43488,7 @@ var require_timestamp2 = __commonJS({
43488
43488
  var require_schema3 = __commonJS({
43489
43489
  "../../node_modules/.pnpm/yaml@2.5.1/node_modules/yaml/dist/schema/yaml-1.1/schema.js"(exports2) {
43490
43490
  "use strict";
43491
- var map2 = require_map();
43491
+ var map3 = require_map();
43492
43492
  var _null = require_null();
43493
43493
  var seq = require_seq();
43494
43494
  var string = require_string();
@@ -43501,7 +43501,7 @@ var require_schema3 = __commonJS({
43501
43501
  var set = require_set();
43502
43502
  var timestamp = require_timestamp2();
43503
43503
  var schema = [
43504
- map2.map,
43504
+ map3.map,
43505
43505
  seq.seq,
43506
43506
  string.string,
43507
43507
  _null.nullTag,
@@ -43530,7 +43530,7 @@ var require_schema3 = __commonJS({
43530
43530
  var require_tags = __commonJS({
43531
43531
  "../../node_modules/.pnpm/yaml@2.5.1/node_modules/yaml/dist/schema/tags.js"(exports2) {
43532
43532
  "use strict";
43533
- var map2 = require_map();
43533
+ var map3 = require_map();
43534
43534
  var _null = require_null();
43535
43535
  var seq = require_seq();
43536
43536
  var string = require_string();
@@ -43547,7 +43547,7 @@ var require_tags = __commonJS({
43547
43547
  var timestamp = require_timestamp2();
43548
43548
  var schemas = /* @__PURE__ */ new Map([
43549
43549
  ["core", schema.schema],
43550
- ["failsafe", [map2.map, seq.seq, string.string]],
43550
+ ["failsafe", [map3.map, seq.seq, string.string]],
43551
43551
  ["json", schema$1.schema],
43552
43552
  ["yaml11", schema$2.schema],
43553
43553
  ["yaml-1.1", schema$2.schema]
@@ -43563,7 +43563,7 @@ var require_tags = __commonJS({
43563
43563
  intHex: int.intHex,
43564
43564
  intOct: int.intOct,
43565
43565
  intTime: timestamp.intTime,
43566
- map: map2.map,
43566
+ map: map3.map,
43567
43567
  null: _null.nullTag,
43568
43568
  omap: omap.omap,
43569
43569
  pairs: pairs.pairs,
@@ -43614,7 +43614,7 @@ var require_Schema = __commonJS({
43614
43614
  "../../node_modules/.pnpm/yaml@2.5.1/node_modules/yaml/dist/schema/Schema.js"(exports2) {
43615
43615
  "use strict";
43616
43616
  var identity = require_identity();
43617
- var map2 = require_map();
43617
+ var map3 = require_map();
43618
43618
  var seq = require_seq();
43619
43619
  var string = require_string();
43620
43620
  var tags = require_tags();
@@ -43627,7 +43627,7 @@ var require_Schema = __commonJS({
43627
43627
  this.knownTags = resolveKnownTags ? tags.coreKnownTags : {};
43628
43628
  this.tags = tags.getTags(customTags, this.name);
43629
43629
  this.toStringOptions = toStringDefaults ?? null;
43630
- Object.defineProperty(this, identity.MAP, { value: map2.map });
43630
+ Object.defineProperty(this, identity.MAP, { value: map3.map });
43631
43631
  Object.defineProperty(this, identity.SCALAR, { value: string.string });
43632
43632
  Object.defineProperty(this, identity.SEQ, { value: seq.seq });
43633
43633
  this.sortMapEntries = typeof sortMapEntries === "function" ? sortMapEntries : sortMapEntries === true ? sortMapEntriesByKey : null;
@@ -44320,7 +44320,7 @@ var require_resolve_block_map = __commonJS({
44320
44320
  var startColMsg = "All mapping items must start at the same column";
44321
44321
  function resolveBlockMap({ composeNode, composeEmptyNode }, ctx, bm, onError, tag) {
44322
44322
  const NodeClass = tag?.nodeClass ?? YAMLMap.YAMLMap;
44323
- const map2 = new NodeClass(ctx.schema);
44323
+ const map3 = new NodeClass(ctx.schema);
44324
44324
  if (ctx.atRoot)
44325
44325
  ctx.atRoot = false;
44326
44326
  let offset = bm.offset;
@@ -44346,10 +44346,10 @@ var require_resolve_block_map = __commonJS({
44346
44346
  if (!keyProps.anchor && !keyProps.tag && !sep) {
44347
44347
  commentEnd = keyProps.end;
44348
44348
  if (keyProps.comment) {
44349
- if (map2.comment)
44350
- map2.comment += "\n" + keyProps.comment;
44349
+ if (map3.comment)
44350
+ map3.comment += "\n" + keyProps.comment;
44351
44351
  else
44352
- map2.comment = keyProps.comment;
44352
+ map3.comment = keyProps.comment;
44353
44353
  }
44354
44354
  continue;
44355
44355
  }
@@ -44363,7 +44363,7 @@ var require_resolve_block_map = __commonJS({
44363
44363
  const keyNode = key ? composeNode(ctx, key, keyProps, onError) : composeEmptyNode(ctx, keyStart, start, null, keyProps, onError);
44364
44364
  if (ctx.schema.compat)
44365
44365
  utilFlowIndentCheck.flowIndentCheck(bm.indent, key, onError);
44366
- if (utilMapIncludes.mapIncludes(ctx, map2.items, keyNode))
44366
+ if (utilMapIncludes.mapIncludes(ctx, map3.items, keyNode))
44367
44367
  onError(keyStart, "DUPLICATE_KEY", "Map keys must be unique");
44368
44368
  const valueProps = resolveProps.resolveProps(sep ?? [], {
44369
44369
  indicator: "map-value-ind",
@@ -44388,7 +44388,7 @@ var require_resolve_block_map = __commonJS({
44388
44388
  const pair = new Pair.Pair(keyNode, valueNode);
44389
44389
  if (ctx.options.keepSourceTokens)
44390
44390
  pair.srcToken = collItem;
44391
- map2.items.push(pair);
44391
+ map3.items.push(pair);
44392
44392
  } else {
44393
44393
  if (implicitKey)
44394
44394
  onError(keyNode.range, "MISSING_CHAR", "Implicit map keys need to be followed by map values");
@@ -44401,13 +44401,13 @@ var require_resolve_block_map = __commonJS({
44401
44401
  const pair = new Pair.Pair(keyNode);
44402
44402
  if (ctx.options.keepSourceTokens)
44403
44403
  pair.srcToken = collItem;
44404
- map2.items.push(pair);
44404
+ map3.items.push(pair);
44405
44405
  }
44406
44406
  }
44407
44407
  if (commentEnd && commentEnd < offset)
44408
44408
  onError(commentEnd, "IMPOSSIBLE", "Map comment with trailing content");
44409
- map2.range = [bm.offset, offset, commentEnd ?? offset];
44410
- return map2;
44409
+ map3.range = [bm.offset, offset, commentEnd ?? offset];
44410
+ return map3;
44411
44411
  }
44412
44412
  exports2.resolveBlockMap = resolveBlockMap;
44413
44413
  }
@@ -44650,17 +44650,17 @@ var require_resolve_flow_collection = __commonJS({
44650
44650
  if (ctx.options.keepSourceTokens)
44651
44651
  pair.srcToken = collItem;
44652
44652
  if (isMap) {
44653
- const map2 = coll;
44654
- if (utilMapIncludes.mapIncludes(ctx, map2.items, keyNode))
44653
+ const map3 = coll;
44654
+ if (utilMapIncludes.mapIncludes(ctx, map3.items, keyNode))
44655
44655
  onError(keyStart, "DUPLICATE_KEY", "Map keys must be unique");
44656
- map2.items.push(pair);
44656
+ map3.items.push(pair);
44657
44657
  } else {
44658
- const map2 = new YAMLMap.YAMLMap(ctx.schema);
44659
- map2.flow = true;
44660
- map2.items.push(pair);
44658
+ const map3 = new YAMLMap.YAMLMap(ctx.schema);
44659
+ map3.flow = true;
44660
+ map3.items.push(pair);
44661
44661
  const endRange = (valueNode ?? keyNode).range;
44662
- map2.range = [keyNode.range[0], endRange[1], endRange[2]];
44663
- coll.items.push(map2);
44662
+ map3.range = [keyNode.range[0], endRange[1], endRange[2]];
44663
+ coll.items.push(map3);
44664
44664
  }
44665
44665
  offset = valueNode ? valueNode.range[2] : valueProps.end;
44666
44666
  }
@@ -47000,14 +47000,14 @@ var require_parser = __commonJS({
47000
47000
  delete scalar.end;
47001
47001
  } else
47002
47002
  sep = [this.sourceToken];
47003
- const map2 = {
47003
+ const map3 = {
47004
47004
  type: "block-map",
47005
47005
  offset: scalar.offset,
47006
47006
  indent: scalar.indent,
47007
47007
  items: [{ start, key: scalar, sep }]
47008
47008
  };
47009
47009
  this.onKeyLine = true;
47010
- this.stack[this.stack.length - 1] = map2;
47010
+ this.stack[this.stack.length - 1] = map3;
47011
47011
  } else
47012
47012
  yield* this.lineEnd(scalar);
47013
47013
  }
@@ -47037,8 +47037,8 @@ var require_parser = __commonJS({
47037
47037
  yield* this.step();
47038
47038
  }
47039
47039
  }
47040
- *blockMap(map2) {
47041
- const it = map2.items[map2.items.length - 1];
47040
+ *blockMap(map3) {
47041
+ const it = map3.items[map3.items.length - 1];
47042
47042
  switch (this.type) {
47043
47043
  case "newline":
47044
47044
  this.onKeyLine = false;
@@ -47048,7 +47048,7 @@ var require_parser = __commonJS({
47048
47048
  if (last2?.type === "comment")
47049
47049
  end2?.push(this.sourceToken);
47050
47050
  else
47051
- map2.items.push({ start: [this.sourceToken] });
47051
+ map3.items.push({ start: [this.sourceToken] });
47052
47052
  } else if (it.sep) {
47053
47053
  it.sep.push(this.sourceToken);
47054
47054
  } else {
@@ -47058,17 +47058,17 @@ var require_parser = __commonJS({
47058
47058
  case "space":
47059
47059
  case "comment":
47060
47060
  if (it.value) {
47061
- map2.items.push({ start: [this.sourceToken] });
47061
+ map3.items.push({ start: [this.sourceToken] });
47062
47062
  } else if (it.sep) {
47063
47063
  it.sep.push(this.sourceToken);
47064
47064
  } else {
47065
- if (this.atIndentedComment(it.start, map2.indent)) {
47066
- const prev2 = map2.items[map2.items.length - 2];
47065
+ if (this.atIndentedComment(it.start, map3.indent)) {
47066
+ const prev2 = map3.items[map3.items.length - 2];
47067
47067
  const end2 = prev2?.value?.end;
47068
47068
  if (Array.isArray(end2)) {
47069
47069
  Array.prototype.push.apply(end2, it.start);
47070
47070
  end2.push(this.sourceToken);
47071
- map2.items.pop();
47071
+ map3.items.pop();
47072
47072
  return;
47073
47073
  }
47074
47074
  }
@@ -47076,8 +47076,8 @@ var require_parser = __commonJS({
47076
47076
  }
47077
47077
  return;
47078
47078
  }
47079
- if (this.indent >= map2.indent) {
47080
- const atMapIndent = !this.onKeyLine && this.indent === map2.indent;
47079
+ if (this.indent >= map3.indent) {
47080
+ const atMapIndent = !this.onKeyLine && this.indent === map3.indent;
47081
47081
  const atNextItem = atMapIndent && (it.sep || it.explicitKey) && this.type !== "seq-item-ind";
47082
47082
  let start = [];
47083
47083
  if (atNextItem && it.sep && !it.value) {
@@ -47091,7 +47091,7 @@ var require_parser = __commonJS({
47091
47091
  case "space":
47092
47092
  break;
47093
47093
  case "comment":
47094
- if (st.indent > map2.indent)
47094
+ if (st.indent > map3.indent)
47095
47095
  nl.length = 0;
47096
47096
  break;
47097
47097
  default:
@@ -47106,7 +47106,7 @@ var require_parser = __commonJS({
47106
47106
  case "tag":
47107
47107
  if (atNextItem || it.value) {
47108
47108
  start.push(this.sourceToken);
47109
- map2.items.push({ start });
47109
+ map3.items.push({ start });
47110
47110
  this.onKeyLine = true;
47111
47111
  } else if (it.sep) {
47112
47112
  it.sep.push(this.sourceToken);
@@ -47120,7 +47120,7 @@ var require_parser = __commonJS({
47120
47120
  it.explicitKey = true;
47121
47121
  } else if (atNextItem || it.value) {
47122
47122
  start.push(this.sourceToken);
47123
- map2.items.push({ start, explicitKey: true });
47123
+ map3.items.push({ start, explicitKey: true });
47124
47124
  } else {
47125
47125
  this.stack.push({
47126
47126
  type: "block-map",
@@ -47146,7 +47146,7 @@ var require_parser = __commonJS({
47146
47146
  });
47147
47147
  }
47148
47148
  } else if (it.value) {
47149
- map2.items.push({ start: [], key: null, sep: [this.sourceToken] });
47149
+ map3.items.push({ start: [], key: null, sep: [this.sourceToken] });
47150
47150
  } else if (includesToken(it.sep, "map-value-ind")) {
47151
47151
  this.stack.push({
47152
47152
  type: "block-map",
@@ -47176,7 +47176,7 @@ var require_parser = __commonJS({
47176
47176
  if (!it.sep) {
47177
47177
  Object.assign(it, { key: null, sep: [this.sourceToken] });
47178
47178
  } else if (it.value || atNextItem) {
47179
- map2.items.push({ start, key: null, sep: [this.sourceToken] });
47179
+ map3.items.push({ start, key: null, sep: [this.sourceToken] });
47180
47180
  } else if (includesToken(it.sep, "map-value-ind")) {
47181
47181
  this.stack.push({
47182
47182
  type: "block-map",
@@ -47196,7 +47196,7 @@ var require_parser = __commonJS({
47196
47196
  case "double-quoted-scalar": {
47197
47197
  const fs = this.flowScalar(this.type);
47198
47198
  if (atNextItem || it.value) {
47199
- map2.items.push({ start, key: fs, sep: [] });
47199
+ map3.items.push({ start, key: fs, sep: [] });
47200
47200
  this.onKeyLine = true;
47201
47201
  } else if (it.sep) {
47202
47202
  this.stack.push(fs);
@@ -47207,10 +47207,10 @@ var require_parser = __commonJS({
47207
47207
  return;
47208
47208
  }
47209
47209
  default: {
47210
- const bv = this.startBlockValue(map2);
47210
+ const bv = this.startBlockValue(map3);
47211
47211
  if (bv) {
47212
47212
  if (atMapIndent && bv.type !== "block-seq") {
47213
- map2.items.push({ start });
47213
+ map3.items.push({ start });
47214
47214
  }
47215
47215
  this.stack.push(bv);
47216
47216
  return;
@@ -47351,14 +47351,14 @@ var require_parser = __commonJS({
47351
47351
  fixFlowSeqItems(fc);
47352
47352
  const sep = fc.end.splice(1, fc.end.length);
47353
47353
  sep.push(this.sourceToken);
47354
- const map2 = {
47354
+ const map3 = {
47355
47355
  type: "block-map",
47356
47356
  offset: fc.offset,
47357
47357
  indent: fc.indent,
47358
47358
  items: [{ start, key: fc, sep }]
47359
47359
  };
47360
47360
  this.onKeyLine = true;
47361
- this.stack[this.stack.length - 1] = map2;
47361
+ this.stack[this.stack.length - 1] = map3;
47362
47362
  } else {
47363
47363
  yield* this.lineEnd(fc);
47364
47364
  }
@@ -47853,11 +47853,11 @@ var require_type = __commonJS({
47853
47853
  "sequence",
47854
47854
  "mapping"
47855
47855
  ];
47856
- function compileStyleAliases(map2) {
47856
+ function compileStyleAliases(map3) {
47857
47857
  var result = {};
47858
- if (map2 !== null) {
47859
- Object.keys(map2).forEach(function(style) {
47860
- map2[style].forEach(function(alias) {
47858
+ if (map3 !== null) {
47859
+ Object.keys(map3).forEach(function(style) {
47860
+ map3[style].forEach(function(alias) {
47861
47861
  result[String(alias)] = style;
47862
47862
  });
47863
47863
  });
@@ -48433,9 +48433,9 @@ var require_binary2 = __commonJS({
48433
48433
  var BASE64_MAP = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r";
48434
48434
  function resolveYamlBinary(data2) {
48435
48435
  if (data2 === null) return false;
48436
- var code, idx, bitlen = 0, max = data2.length, map2 = BASE64_MAP;
48436
+ var code, idx, bitlen = 0, max = data2.length, map3 = BASE64_MAP;
48437
48437
  for (idx = 0; idx < max; idx++) {
48438
- code = map2.indexOf(data2.charAt(idx));
48438
+ code = map3.indexOf(data2.charAt(idx));
48439
48439
  if (code > 64) continue;
48440
48440
  if (code < 0) return false;
48441
48441
  bitlen += 6;
@@ -48443,14 +48443,14 @@ var require_binary2 = __commonJS({
48443
48443
  return bitlen % 8 === 0;
48444
48444
  }
48445
48445
  function constructYamlBinary(data2) {
48446
- var idx, tailbits, input = data2.replace(/[\r\n=]/g, ""), max = input.length, map2 = BASE64_MAP, bits = 0, result = [];
48446
+ var idx, tailbits, input = data2.replace(/[\r\n=]/g, ""), max = input.length, map3 = BASE64_MAP, bits = 0, result = [];
48447
48447
  for (idx = 0; idx < max; idx++) {
48448
48448
  if (idx % 4 === 0 && idx) {
48449
48449
  result.push(bits >> 16 & 255);
48450
48450
  result.push(bits >> 8 & 255);
48451
48451
  result.push(bits & 255);
48452
48452
  }
48453
- bits = bits << 6 | map2.indexOf(input.charAt(idx));
48453
+ bits = bits << 6 | map3.indexOf(input.charAt(idx));
48454
48454
  }
48455
48455
  tailbits = max % 4 * 6;
48456
48456
  if (tailbits === 0) {
@@ -48466,32 +48466,32 @@ var require_binary2 = __commonJS({
48466
48466
  return new Uint8Array(result);
48467
48467
  }
48468
48468
  function representYamlBinary(object) {
48469
- var result = "", bits = 0, idx, tail, max = object.length, map2 = BASE64_MAP;
48469
+ var result = "", bits = 0, idx, tail, max = object.length, map3 = BASE64_MAP;
48470
48470
  for (idx = 0; idx < max; idx++) {
48471
48471
  if (idx % 3 === 0 && idx) {
48472
- result += map2[bits >> 18 & 63];
48473
- result += map2[bits >> 12 & 63];
48474
- result += map2[bits >> 6 & 63];
48475
- result += map2[bits & 63];
48472
+ result += map3[bits >> 18 & 63];
48473
+ result += map3[bits >> 12 & 63];
48474
+ result += map3[bits >> 6 & 63];
48475
+ result += map3[bits & 63];
48476
48476
  }
48477
48477
  bits = (bits << 8) + object[idx];
48478
48478
  }
48479
48479
  tail = max % 3;
48480
48480
  if (tail === 0) {
48481
- result += map2[bits >> 18 & 63];
48482
- result += map2[bits >> 12 & 63];
48483
- result += map2[bits >> 6 & 63];
48484
- result += map2[bits & 63];
48481
+ result += map3[bits >> 18 & 63];
48482
+ result += map3[bits >> 12 & 63];
48483
+ result += map3[bits >> 6 & 63];
48484
+ result += map3[bits & 63];
48485
48485
  } else if (tail === 2) {
48486
- result += map2[bits >> 10 & 63];
48487
- result += map2[bits >> 4 & 63];
48488
- result += map2[bits << 2 & 63];
48489
- result += map2[64];
48486
+ result += map3[bits >> 10 & 63];
48487
+ result += map3[bits >> 4 & 63];
48488
+ result += map3[bits << 2 & 63];
48489
+ result += map3[64];
48490
48490
  } else if (tail === 1) {
48491
- result += map2[bits >> 2 & 63];
48492
- result += map2[bits << 4 & 63];
48493
- result += map2[64];
48494
- result += map2[64];
48491
+ result += map3[bits >> 2 & 63];
48492
+ result += map3[bits << 4 & 63];
48493
+ result += map3[64];
48494
+ result += map3[64];
48495
48495
  }
48496
48496
  return result;
48497
48497
  }
@@ -49866,14 +49866,14 @@ var require_dumper = __commonJS({
49866
49866
  resolution: true,
49867
49867
  libc: true
49868
49868
  };
49869
- function compileStyleMap(schema, map2) {
49869
+ function compileStyleMap(schema, map3) {
49870
49870
  var result, keys, index2, length, tag, style, type;
49871
- if (map2 === null) return {};
49871
+ if (map3 === null) return {};
49872
49872
  result = {};
49873
- keys = Object.keys(map2);
49873
+ keys = Object.keys(map3);
49874
49874
  for (index2 = 0, length = keys.length; index2 < length; index2 += 1) {
49875
49875
  tag = keys[index2];
49876
- style = String(map2[tag]);
49876
+ style = String(map3[tag]);
49877
49877
  if (tag.slice(0, 2) === "!!") {
49878
49878
  tag = "tag:yaml.org,2002:" + tag.slice(2);
49879
49879
  }
@@ -66293,8 +66293,8 @@ var require_map4 = __commonJS({
66293
66293
  var _xmap = require_xmap();
66294
66294
  var curryN = require_curryN2();
66295
66295
  var keys = require_keys();
66296
- var map2 = /* @__PURE__ */ _curry2(
66297
- /* @__PURE__ */ _dispatchable(["fantasy-land/map", "map"], _xmap, function map3(fn2, functor) {
66296
+ var map3 = /* @__PURE__ */ _curry2(
66297
+ /* @__PURE__ */ _dispatchable(["fantasy-land/map", "map"], _xmap, function map4(fn2, functor) {
66298
66298
  switch (Object.prototype.toString.call(functor)) {
66299
66299
  case "[object Function]":
66300
66300
  return curryN(functor.length, function() {
@@ -66310,7 +66310,7 @@ var require_map4 = __commonJS({
66310
66310
  }
66311
66311
  })
66312
66312
  );
66313
- module2.exports = map2;
66313
+ module2.exports = map3;
66314
66314
  }
66315
66315
  });
66316
66316
 
@@ -67409,9 +67409,9 @@ function fixCatalogVersions(yamlAST, fixes) {
67409
67409
  }
67410
67410
  });
67411
67411
  }
67412
- function updateCatalog(update2, map2) {
67412
+ function updateCatalog(update2, map3) {
67413
67413
  if (!update2) return;
67414
- for (const catalogEntry of map2.items) {
67414
+ for (const catalogEntry of map3.items) {
67415
67415
  if (catalogEntry.key && catalogEntry.value) {
67416
67416
  const packageName = import_yaml.CST.resolveAsScalar(catalogEntry.key)?.value;
67417
67417
  if (!!packageName && update2[packageName]) {
@@ -71991,11 +71991,11 @@ var require_type3 = __commonJS({
71991
71991
  "sequence",
71992
71992
  "mapping"
71993
71993
  ];
71994
- function compileStyleAliases(map2) {
71994
+ function compileStyleAliases(map3) {
71995
71995
  var result = {};
71996
- if (map2 !== null) {
71997
- Object.keys(map2).forEach(function(style) {
71998
- map2[style].forEach(function(alias) {
71996
+ if (map3 !== null) {
71997
+ Object.keys(map3).forEach(function(style) {
71998
+ map3[style].forEach(function(alias) {
71999
71999
  result[String(alias)] = style;
72000
72000
  });
72001
72001
  });
@@ -72603,9 +72603,9 @@ var require_binary3 = __commonJS({
72603
72603
  var BASE64_MAP = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r";
72604
72604
  function resolveYamlBinary(data2) {
72605
72605
  if (data2 === null) return false;
72606
- var code, idx, bitlen = 0, max = data2.length, map2 = BASE64_MAP;
72606
+ var code, idx, bitlen = 0, max = data2.length, map3 = BASE64_MAP;
72607
72607
  for (idx = 0; idx < max; idx++) {
72608
- code = map2.indexOf(data2.charAt(idx));
72608
+ code = map3.indexOf(data2.charAt(idx));
72609
72609
  if (code > 64) continue;
72610
72610
  if (code < 0) return false;
72611
72611
  bitlen += 6;
@@ -72613,14 +72613,14 @@ var require_binary3 = __commonJS({
72613
72613
  return bitlen % 8 === 0;
72614
72614
  }
72615
72615
  function constructYamlBinary(data2) {
72616
- var idx, tailbits, input = data2.replace(/[\r\n=]/g, ""), max = input.length, map2 = BASE64_MAP, bits = 0, result = [];
72616
+ var idx, tailbits, input = data2.replace(/[\r\n=]/g, ""), max = input.length, map3 = BASE64_MAP, bits = 0, result = [];
72617
72617
  for (idx = 0; idx < max; idx++) {
72618
72618
  if (idx % 4 === 0 && idx) {
72619
72619
  result.push(bits >> 16 & 255);
72620
72620
  result.push(bits >> 8 & 255);
72621
72621
  result.push(bits & 255);
72622
72622
  }
72623
- bits = bits << 6 | map2.indexOf(input.charAt(idx));
72623
+ bits = bits << 6 | map3.indexOf(input.charAt(idx));
72624
72624
  }
72625
72625
  tailbits = max % 4 * 6;
72626
72626
  if (tailbits === 0) {
@@ -72639,32 +72639,32 @@ var require_binary3 = __commonJS({
72639
72639
  return result;
72640
72640
  }
72641
72641
  function representYamlBinary(object) {
72642
- var result = "", bits = 0, idx, tail, max = object.length, map2 = BASE64_MAP;
72642
+ var result = "", bits = 0, idx, tail, max = object.length, map3 = BASE64_MAP;
72643
72643
  for (idx = 0; idx < max; idx++) {
72644
72644
  if (idx % 3 === 0 && idx) {
72645
- result += map2[bits >> 18 & 63];
72646
- result += map2[bits >> 12 & 63];
72647
- result += map2[bits >> 6 & 63];
72648
- result += map2[bits & 63];
72645
+ result += map3[bits >> 18 & 63];
72646
+ result += map3[bits >> 12 & 63];
72647
+ result += map3[bits >> 6 & 63];
72648
+ result += map3[bits & 63];
72649
72649
  }
72650
72650
  bits = (bits << 8) + object[idx];
72651
72651
  }
72652
72652
  tail = max % 3;
72653
72653
  if (tail === 0) {
72654
- result += map2[bits >> 18 & 63];
72655
- result += map2[bits >> 12 & 63];
72656
- result += map2[bits >> 6 & 63];
72657
- result += map2[bits & 63];
72654
+ result += map3[bits >> 18 & 63];
72655
+ result += map3[bits >> 12 & 63];
72656
+ result += map3[bits >> 6 & 63];
72657
+ result += map3[bits & 63];
72658
72658
  } else if (tail === 2) {
72659
- result += map2[bits >> 10 & 63];
72660
- result += map2[bits >> 4 & 63];
72661
- result += map2[bits << 2 & 63];
72662
- result += map2[64];
72659
+ result += map3[bits >> 10 & 63];
72660
+ result += map3[bits >> 4 & 63];
72661
+ result += map3[bits << 2 & 63];
72662
+ result += map3[64];
72663
72663
  } else if (tail === 1) {
72664
- result += map2[bits >> 2 & 63];
72665
- result += map2[bits << 4 & 63];
72666
- result += map2[64];
72667
- result += map2[64];
72664
+ result += map3[bits >> 2 & 63];
72665
+ result += map3[bits << 4 & 63];
72666
+ result += map3[64];
72667
+ result += map3[64];
72668
72668
  }
72669
72669
  return result;
72670
72670
  }
@@ -74125,14 +74125,14 @@ var require_dumper2 = __commonJS({
74125
74125
  "Off",
74126
74126
  "OFF"
74127
74127
  ];
74128
- function compileStyleMap(schema, map2) {
74128
+ function compileStyleMap(schema, map3) {
74129
74129
  var result, keys, index2, length, tag, style, type;
74130
- if (map2 === null) return {};
74130
+ if (map3 === null) return {};
74131
74131
  result = {};
74132
- keys = Object.keys(map2);
74132
+ keys = Object.keys(map3);
74133
74133
  for (index2 = 0, length = keys.length; index2 < length; index2 += 1) {
74134
74134
  tag = keys[index2];
74135
- style = String(map2[tag]);
74135
+ style = String(map3[tag]);
74136
74136
  if (tag.slice(0, 2) === "!!") {
74137
74137
  tag = "tag:yaml.org,2002:" + tag.slice(2);
74138
74138
  }
@@ -99624,21 +99624,27 @@ __export(detected_occurrence_utils_exports, {
99624
99624
  extractSourceLocations: () => extractSourceLocations,
99625
99625
  getAffectedAppCodeLocations: () => getAffectedAppCodeLocations,
99626
99626
  getJavaHeading: () => getJavaHeading,
99627
+ hasReachableMatches: () => hasReachableMatches,
99628
+ isClassStack: () => isClassStack,
99627
99629
  isJavaClassReference: () => isJavaClassReference,
99628
99630
  isJavaCodePoint: () => isJavaCodePoint,
99629
99631
  truncateBeginning: () => truncateBeginning
99630
99632
  });
99633
+ function isClassStack(acp) {
99634
+ return "stacks" in acp;
99635
+ }
99631
99636
  function isJavaCodePoint(acp) {
99632
99637
  return "methodSignature" in acp;
99633
99638
  }
99634
99639
  function isJavaClassReference(acp) {
99635
99640
  return "appClass" in acp;
99636
99641
  }
99637
- function extractSourceLocations(codeAwareScanResults) {
99642
+ function extractSourceLocations(codeAwareScanResults, ecosystem) {
99638
99643
  return [
99639
99644
  ...getSourceLocations(
99640
99645
  "JavaScript",
99641
99646
  codeAwareScanResults?.detectedOccurrences,
99647
+ ecosystem,
99642
99648
  (acp) => acp.filename,
99643
99649
  (acp) => `${acp.start.line}-${acp.start.column}-${acp.end.line}-${acp.end.column}`,
99644
99650
  (a3, b) => a3.start.line - b.start.line || a3.start.column - b.start.column,
@@ -99647,18 +99653,23 @@ function extractSourceLocations(codeAwareScanResults) {
99647
99653
  ...getSourceLocations(
99648
99654
  "Java",
99649
99655
  codeAwareScanResults?.detectedOccurrences,
99650
- (acp) => isJavaCodePoint(acp) ? acp.methodSignature : acp.appClass,
99651
- (acp) => isJavaCodePoint(acp) ? acp.startLineNumber : acp.reference.class,
99652
- (a3, b) => isJavaCodePoint(a3) ? a3.methodSignature.localeCompare(b.methodSignature) : a3.appClass.localeCompare(b.appClass),
99656
+ ecosystem,
99657
+ (acp) => isJavaCodePoint(acp) ? acp.methodSignature : isClassStack(acp) ? acp[0].class : acp.appClass,
99658
+ (acp) => isJavaCodePoint(acp) ? acp.startLineNumber : isClassStack(acp) ? `${acp[1].package}-${acp[1].class}` : acp.reference.class,
99659
+ (a3, b) => isJavaCodePoint(a3) ? a3.methodSignature.localeCompare(b.methodSignature) : isClassStack(a3) ? a3[0].class.localeCompare(b[0].class) : a3.appClass.localeCompare(b.appClass),
99653
99660
  ([methodOrClassSignature, codePoints], type) => ({
99654
99661
  type,
99655
- codePoints,
99662
+ codePoints: !isClassStack(codePoints[0]) ? codePoints : codePoints.map((c2) => ({
99663
+ appClass: c2[0].class,
99664
+ reference: c2[1]
99665
+ })),
99656
99666
  methodOrClassSignature
99657
99667
  })
99658
99668
  ),
99659
99669
  ...getSourceLocations(
99660
99670
  "Python",
99661
99671
  codeAwareScanResults?.detectedOccurrences,
99672
+ ecosystem,
99662
99673
  (acp) => acp.filename,
99663
99674
  (acp) => `${acp.start.line}-${acp.start.column}-${acp.end.line}-${acp.end.column}`,
99664
99675
  (a3, b) => a3.start.line - b.start.line || a3.start.column - b.start.column,
@@ -99667,6 +99678,7 @@ function extractSourceLocations(codeAwareScanResults) {
99667
99678
  ...getSourceLocations(
99668
99679
  "Go",
99669
99680
  codeAwareScanResults?.detectedOccurrences,
99681
+ ecosystem,
99670
99682
  (acp) => acp.filename,
99671
99683
  (acp) => `${acp.start.line}-${acp.start.column}`,
99672
99684
  (a3, b) => a3.start.line - b.start.line || a3.start.column - b.start.column,
@@ -99675,6 +99687,7 @@ function extractSourceLocations(codeAwareScanResults) {
99675
99687
  ...getSourceLocations(
99676
99688
  "Dotnet",
99677
99689
  codeAwareScanResults?.detectedOccurrences,
99690
+ ecosystem,
99678
99691
  (acp) => acp[0].class,
99679
99692
  (acp) => `${acp[1].package}-${acp[1].class}`,
99680
99693
  (a3, b) => a3[0].class.localeCompare(b[0].class),
@@ -99689,18 +99702,17 @@ function extractSourceLocations(codeAwareScanResults) {
99689
99702
  )
99690
99703
  ];
99691
99704
  }
99692
- function getAffectedAppCodeLocations(VulnerabilityAggregate) {
99705
+ function getAffectedAppCodeLocations(VulnerabilityAggregate, ecosystem) {
99693
99706
  return Object.fromEntries(
99694
99707
  Object.entries(VulnerabilityAggregate).map(([wsPath, { CodeAwareScanResults }]) => [
99695
99708
  wsPath,
99696
- extractSourceLocations(CodeAwareScanResults)
99709
+ extractSourceLocations(CodeAwareScanResults, ecosystem)
99697
99710
  ])
99698
99711
  );
99699
99712
  }
99700
- function getSourceLocations(type, detectedOccurrences, groupByCB, uniqByCB, sortByCB, mapBy) {
99701
- const detectedOccurrencesOfType = detectedOccurrences?.filter(
99702
- (occ) => !("analysisLevel" in occ) && occ.type === type
99703
- );
99713
+ function getSourceLocations(type, detectedOccurrences, ecosystem, groupByCB, uniqByCB, sortByCB, mapBy) {
99714
+ const detectedOccurrencesLegacy = convertDetectedOccurrencesToLegacyFormat(detectedOccurrences, ecosystem, type);
99715
+ const detectedOccurrencesOfType = detectedOccurrencesLegacy?.filter((occ) => occ.type === type);
99704
99716
  if (!detectedOccurrencesOfType || detectedOccurrencesOfType.length === 0) return [];
99705
99717
  const res = i4(
99706
99718
  T(
@@ -99745,9 +99757,54 @@ function getJavaHeading(methodOrClassSignature, maxLength = 60) {
99745
99757
  if (heading.length <= maxLength) return heading;
99746
99758
  return truncateBeginning(heading, maxLength);
99747
99759
  }
99760
+ function convertDetectedOccurrencesToLegacyFormat(detectedOccurrences, ecosystem, type) {
99761
+ if (getTypeFromEcosystem(ecosystem) !== type) return [];
99762
+ if (!detectedOccurrences) return void 0;
99763
+ if (Array.isArray(detectedOccurrences)) return detectedOccurrences;
99764
+ return [convertDetectedOccurrenceToLegacyFormat(detectedOccurrences, ecosystem)];
99765
+ }
99766
+ function convertDetectedOccurrenceToLegacyFormat(detectedOccurrence, ecosystem) {
99767
+ if (detectedOccurrence.analysisLevel === "function-level") {
99768
+ return {
99769
+ affectedPackages: detectedOccurrence.affectedPackages,
99770
+ type: getTypeFromEcosystem(ecosystem),
99771
+ match: {},
99772
+ affectedAppCodePoints: (0, import_lodash7.map)(detectedOccurrence.stacks, "0.sourceLocation")
99773
+ };
99774
+ }
99775
+ return {
99776
+ affectedPackages: detectedOccurrence.affectedPackages,
99777
+ type: getTypeFromEcosystem(ecosystem),
99778
+ vulnerableMethod: "",
99779
+ // The vulnerableMethod property is not used
99780
+ affectedAppCodePoints: detectedOccurrence.stacks
99781
+ };
99782
+ }
99783
+ function hasReachableMatches(detectedOccurrences) {
99784
+ if (!detectedOccurrences) return false;
99785
+ return Array.isArray(detectedOccurrences) ? detectedOccurrences.some((occ) => occ.affectedAppCodePoints.length > 0) : detectedOccurrences.stacks.length > 0;
99786
+ }
99787
+ function getTypeFromEcosystem(ecosystem) {
99788
+ switch (ecosystem) {
99789
+ case "NPM":
99790
+ return "JavaScript";
99791
+ case "PIP":
99792
+ return "Python";
99793
+ case "NUGET":
99794
+ return "Dotnet";
99795
+ case "MAVEN":
99796
+ return "Java";
99797
+ case "GO":
99798
+ return "Go";
99799
+ default:
99800
+ throw new Error(`Unsupported ecosystem: ${ecosystem}`);
99801
+ }
99802
+ }
99803
+ var import_lodash7;
99748
99804
  var init_detected_occurrence_utils = __esm({
99749
99805
  "../web-compat-utils/src/detected-occurrence-utils.ts"() {
99750
99806
  "use strict";
99807
+ import_lodash7 = __toESM(require_lodash());
99751
99808
  init_dist();
99752
99809
  }
99753
99810
  });
@@ -100008,11 +100065,12 @@ function getVulnReachability(c2) {
100008
100065
  if (c2.type !== "success") {
100009
100066
  return "UNKNOWN";
100010
100067
  }
100011
- return c2.detectedOccurrences.some((occ) => occ.affectedAppCodePoints.length > 0) ? "REACHABLE" : "UNREACHABLE";
100068
+ return hasReachableMatches(c2.detectedOccurrences) ? "REACHABLE" : "UNREACHABLE";
100012
100069
  }
100013
100070
  var init_vulnerability_reachability = __esm({
100014
100071
  "../web-compat-utils/src/vulnerability-reachability.ts"() {
100015
100072
  "use strict";
100073
+ init_detected_occurrence_utils();
100016
100074
  }
100017
100075
  });
100018
100076
 
@@ -123326,7 +123384,7 @@ var require_github_pr_tools = __commonJS({
123326
123384
  }
123327
123385
  const codeAwareResult = reportVuln?.codeAwareScanResult;
123328
123386
  if (codeAwareResult.type === "success") {
123329
- const sourceLocationWrappers = (0, detected_occurrence_utils_1.extractSourceLocations)(codeAwareResult);
123387
+ const sourceLocationWrappers = (0, detected_occurrence_utils_1.extractSourceLocations)(codeAwareResult, reportVuln.ecosystem);
123330
123388
  for (const slWrapper of sourceLocationWrappers) {
123331
123389
  if (slWrapper.type === "JavaScript" || slWrapper.type === "Python" || slWrapper.type === "Go") {
123332
123390
  const { fileName, sourcelocations } = slWrapper;
@@ -123450,7 +123508,7 @@ var require_cli_compare_reports = __commonJS({
123450
123508
  if (reportVuln) {
123451
123509
  const codeAwareResult = reportVuln?.codeAwareScanResult;
123452
123510
  if (codeAwareResult.type === "success") {
123453
- const sourceLocationWrappers = (0, detected_occurrence_utils_1.extractSourceLocations)(codeAwareResult);
123511
+ const sourceLocationWrappers = (0, detected_occurrence_utils_1.extractSourceLocations)(codeAwareResult, reportVuln.ecosystem);
123454
123512
  for (const slWrapper of sourceLocationWrappers) {
123455
123513
  if (slWrapper.type === "JavaScript") {
123456
123514
  const { fileName, sourcelocations } = slWrapper;
@@ -124561,7 +124619,7 @@ var init_ecosystem_manager = __esm({
124561
124619
  });
124562
124620
 
124563
124621
  // ../utils/src/python-versions-manager.ts
124564
- var import_semver4, import_child_process2, import_lodash7, systemPython;
124622
+ var import_semver4, import_child_process2, import_lodash8, systemPython;
124565
124623
  var init_python_versions_manager = __esm({
124566
124624
  "../utils/src/python-versions-manager.ts"() {
124567
124625
  "use strict";
@@ -124570,8 +124628,8 @@ var init_python_versions_manager = __esm({
124570
124628
  init_logger_singleton();
124571
124629
  init_pip_utils();
124572
124630
  import_child_process2 = require("child_process");
124573
- import_lodash7 = __toESM(require_lodash());
124574
- systemPython = (0, import_lodash7.once)(() => (0, import_child_process2.execFileSync)("which", ["python"], { encoding: "utf8" }).trim());
124631
+ import_lodash8 = __toESM(require_lodash());
124632
+ systemPython = (0, import_lodash8.once)(() => (0, import_child_process2.execFileSync)("which", ["python"], { encoding: "utf8" }).trim());
124575
124633
  }
124576
124634
  });
124577
124635
 
@@ -130048,13 +130106,15 @@ __export(dashboard_integration_exports, {
130048
130106
  sendWarningToDashboard: () => sendWarningToDashboard,
130049
130107
  submitSubprojects: () => submitSubprojects
130050
130108
  });
130051
- async function createReport(repoUrl, projectName, cliVersion, commitSha, branchName, cliOptions, apiKey) {
130052
- return (await sendPostRequest(
130053
- coanaAPIUrls.CREATE_REPORT,
130054
- apiKey,
130055
- { repoUrl, projectName },
130056
- { reportType: "v5", cliVersion, commitSha, branchName, cliOptions }
130057
- )).data.id;
130109
+ async function createReport(repoUrl, projectName, cliVersion, commitSha, branchName, cliOptions, apiKey, cliRunEnv) {
130110
+ return (await sendPostRequest(coanaAPIUrls.CREATE_REPORT, apiKey, { repoUrl, projectName }, {
130111
+ reportType: "v6",
130112
+ cliVersion,
130113
+ commitSha,
130114
+ branchName,
130115
+ cliOptions,
130116
+ cliRunEnv
130117
+ })).data.id;
130058
130118
  }
130059
130119
  async function submitSubprojects(subprojects, reportId, apiKey) {
130060
130120
  if (!reportId) return;
@@ -157503,7 +157563,7 @@ function encodeXML(str) {
157503
157563
  }
157504
157564
  return ret + str.substr(lastIdx);
157505
157565
  }
157506
- function getEscaper(regex, map2) {
157566
+ function getEscaper(regex, map3) {
157507
157567
  return function escape2(data2) {
157508
157568
  let match;
157509
157569
  let lastIdx = 0;
@@ -157512,7 +157572,7 @@ function getEscaper(regex, map2) {
157512
157572
  if (lastIdx !== match.index) {
157513
157573
  result += data2.substring(lastIdx, match.index);
157514
157574
  }
157515
- result += map2.get(match[0].charCodeAt(0));
157575
+ result += map3.get(match[0].charCodeAt(0));
157516
157576
  lastIdx = match.index + 1;
157517
157577
  }
157518
157578
  return result + data2.substring(lastIdx);
@@ -160844,7 +160904,7 @@ __export(traversing_exports, {
160844
160904
  index: () => index,
160845
160905
  is: () => is3,
160846
160906
  last: () => last,
160847
- map: () => map,
160907
+ map: () => map2,
160848
160908
  next: () => next,
160849
160909
  nextAll: () => nextAll,
160850
160910
  nextUntil: () => nextUntil,
@@ -160955,7 +161015,7 @@ function each(fn2) {
160955
161015
  ++i5;
160956
161016
  return this;
160957
161017
  }
160958
- function map(fn2) {
161018
+ function map2(fn2) {
160959
161019
  let elems = [];
160960
161020
  for (let i5 = 0; i5 < this.length; i5++) {
160961
161021
  const el = this[i5];
@@ -171065,13 +171125,13 @@ var init_esm11 = __esm({
171065
171125
  function getUrlForArtifact(repository, groupId, artifactId, type, classifier, version2) {
171066
171126
  return `${repository}/${groupId.replaceAll(".", "/")}/${artifactId}/${version2}/${artifactId}-${version2}${classifier ? `-${classifier}` : ""}.${type ?? "jar"}`;
171067
171127
  }
171068
- var import_lodash8, MAVEN_PUBLIC_REPOSITORIES, memoizedParseShellArgs;
171128
+ var import_lodash9, MAVEN_PUBLIC_REPOSITORIES, memoizedParseShellArgs;
171069
171129
  var init_maven_utils = __esm({
171070
171130
  "../utils/src/maven-utils.ts"() {
171071
171131
  "use strict";
171072
171132
  init_command_utils();
171073
171133
  init_esm11();
171074
- import_lodash8 = __toESM(require_lodash());
171134
+ import_lodash9 = __toESM(require_lodash());
171075
171135
  MAVEN_PUBLIC_REPOSITORIES = [
171076
171136
  "https://repo1.maven.org/maven2",
171077
171137
  "https://packages.atlassian.com/artifactory/maven-atlassian-external",
@@ -171081,7 +171141,7 @@ var init_maven_utils = __esm({
171081
171141
  "https://maven.wso2.org/nexus/content/repositories/public",
171082
171142
  "https://nexus.bedatadriven.com/content/groups/public"
171083
171143
  ];
171084
- memoizedParseShellArgs = (0, import_lodash8.memoize)(parseShellArgs);
171144
+ memoizedParseShellArgs = (0, import_lodash9.memoize)(parseShellArgs);
171085
171145
  }
171086
171146
  });
171087
171147
 
@@ -174012,9 +174072,9 @@ var require_lib24 = __commonJS({
174012
174072
  throw new TypeError(`${value} is not a legal HTTP header value`);
174013
174073
  }
174014
174074
  }
174015
- function find4(map2, name) {
174075
+ function find4(map3, name) {
174016
174076
  name = name.toLowerCase();
174017
- for (const key in map2) {
174077
+ for (const key in map3) {
174018
174078
  if (key.toLowerCase() === name) {
174019
174079
  return key;
174020
174080
  }
@@ -178076,7 +178136,7 @@ var require_dist_node21 = __commonJS({
178076
178136
  return result;
178077
178137
  }
178078
178138
  function urlBuilderAuthorize(base, options) {
178079
- const map2 = {
178139
+ const map3 = {
178080
178140
  allowSignup: "allow_signup",
178081
178141
  clientId: "client_id",
178082
178142
  login: "login",
@@ -178085,11 +178145,11 @@ var require_dist_node21 = __commonJS({
178085
178145
  state: "state"
178086
178146
  };
178087
178147
  let url2 = base;
178088
- Object.keys(map2).filter((k) => options[k] !== null).filter((k) => {
178148
+ Object.keys(map3).filter((k) => options[k] !== null).filter((k) => {
178089
178149
  if (k !== "scopes") return true;
178090
178150
  if (options.clientType === "github-app") return false;
178091
178151
  return !Array.isArray(options[k]) || options[k].length > 0;
178092
- }).map((key) => [map2[key], `${options[key]}`]).forEach(([key, value], index2) => {
178152
+ }).map((key) => [map3[key], `${options[key]}`]).forEach(([key, value], index2) => {
178093
178153
  url2 += index2 === 0 ? `?` : "&";
178094
178154
  url2 += `${key}=${encodeURIComponent(value)}`;
178095
178155
  });
@@ -187885,10 +187945,10 @@ var require_dist13 = __commonJS({
187885
187945
  exports2.ConsoleLogger = ConsoleLogger;
187886
187946
  ConsoleLogger.labels = (() => {
187887
187947
  const entries = Object.entries(LogLevel);
187888
- const map2 = entries.map(([key, value]) => {
187948
+ const map3 = entries.map(([key, value]) => {
187889
187949
  return [value, `[${key}] `];
187890
187950
  });
187891
- return new Map(map2);
187951
+ return new Map(map3);
187892
187952
  })();
187893
187953
  ConsoleLogger.severity = {
187894
187954
  [LogLevel.ERROR]: 400,
@@ -189975,7 +190035,7 @@ var require_version = __commonJS({
189975
190035
  "use strict";
189976
190036
  Object.defineProperty(exports2, "__esModule", { value: true });
189977
190037
  exports2.version = void 0;
189978
- exports2.version = "13.19.0";
190038
+ exports2.version = "13.19.1";
189979
190039
  }
189980
190040
  });
189981
190041
 
@@ -190060,7 +190120,7 @@ var require_cli_core = __commonJS({
190060
190120
  try {
190061
190121
  if (this.shareWithDashboard) {
190062
190122
  const gitData = await getGitDataToMetadataIfAvailable(this.rootWorkingDirectory);
190063
- this.reportId = await (0, dashboard_integration_1.createReport)(this.options.repoUrl, this.options.projectName, version_12.version, gitData?.sha, gitData?.branchName, (0, lodash_1.omit)(this.options, "apiKey", "print-report", "repoUrl", "projectName", "writeReportToFile"), this.options.apiKey);
190123
+ this.reportId = await (0, dashboard_integration_1.createReport)(this.options.repoUrl, this.options.projectName, version_12.version, gitData?.sha, gitData?.branchName, (0, lodash_1.omit)(this.options, "apiKey", "print-report", "repoUrl", "projectName", "writeReportToFile"), this.options.apiKey, this.options.runEnv);
190064
190124
  }
190065
190125
  const report = await this.computeReport();
190066
190126
  await this.outputAndShareReport(report);
@@ -190274,39 +190334,29 @@ var require_cli_core = __commonJS({
190274
190334
  for (const workspaceToCodeAwareScanSuccess of Object.values(vulnerabilityToWorkspaceToCodeAwareScanSuccess)) {
190275
190335
  const trie = (0, vulnerable_paths_utils_1.mkTrie)();
190276
190336
  for (const codeAwareScanSuccess of Object.values(workspaceToCodeAwareScanSuccess)) {
190277
- const detectedOccurrences = codeAwareScanSuccess.detectedOccurrences;
190278
- detectedOccurrences.forEach((detectedOccurrence) => {
190279
- detectedOccurrence.affectedAppCodePoints.forEach((stack2) => {
190280
- (0, vulnerable_paths_utils_1.addPathToTrie)(trie, stack2.map(serialize3));
190281
- });
190337
+ const stacks = Array.isArray(codeAwareScanSuccess.detectedOccurrences) ? codeAwareScanSuccess.detectedOccurrences.flatMap((occ) => occ.affectedAppCodePoints) : codeAwareScanSuccess.detectedOccurrences.stacks;
190338
+ stacks.forEach((stack2) => {
190339
+ (0, vulnerable_paths_utils_1.addPathToTrie)(trie, stack2.map(serialize3));
190282
190340
  });
190283
190341
  }
190284
190342
  for (const codeAwareScanSuccess of Object.values(workspaceToCodeAwareScanSuccess)) {
190285
- const detectedOccurrences = codeAwareScanSuccess.detectedOccurrences;
190286
- codeAwareScanSuccess.detectedOccurrences = detectedOccurrences.map((detectedOccurrence) => {
190287
- detectedOccurrence.affectedAppCodePoints = detectedOccurrence.affectedAppCodePoints.filter((stack2) => {
190288
- return (0, vulnerable_paths_utils_1.isShortestPath)(trie, stack2.map(serialize3));
190289
- });
190290
- return detectedOccurrence;
190291
- });
190292
- if (ecosystem2 === "MAVEN") {
190293
- const detectedOccurences = codeAwareScanSuccess.detectedOccurrences;
190294
- codeAwareScanSuccess.detectedOccurrences = detectedOccurences.map((detectedOccurence) => {
190295
- const affectedAppCodePoints = detectedOccurence.affectedAppCodePoints.map((stack2) => {
190296
- if (stack2.length < 2)
190297
- throw new Error("The path should always have length at least two.");
190298
- return {
190299
- appClass: stack2[0].class,
190300
- reference: (0, lodash_1.omit)(stack2[1], ["confidence"])
190301
- };
190302
- });
190303
- return {
190304
- type: "Java",
190305
- vulnerableMethod: detectedOccurence.vulnerableMethod,
190306
- affectedPackages: detectedOccurence.affectedPackages,
190307
- affectedAppCodePoints
190308
- };
190343
+ if (Array.isArray(codeAwareScanSuccess.detectedOccurrences)) {
190344
+ codeAwareScanSuccess.detectedOccurrences = codeAwareScanSuccess.detectedOccurrences.filter((detectedOccurence) => {
190345
+ detectedOccurence.affectedAppCodePoints = detectedOccurence.affectedAppCodePoints.filter((affectedAppCodePoint) => (0, vulnerable_paths_utils_1.isShortestPath)(trie, affectedAppCodePoint.map(serialize3)));
190346
+ if (ecosystem2 === "MAVEN") {
190347
+ detectedOccurence.affectedAppCodePoints = detectedOccurence.affectedAppCodePoints.map((path2) => {
190348
+ if (path2.length < 2)
190349
+ throw new Error("The path should always have length at least two.");
190350
+ return {
190351
+ appClass: path2[0].class,
190352
+ reference: path2[1]
190353
+ };
190354
+ });
190355
+ }
190356
+ return detectedOccurence.affectedAppCodePoints.length > 0;
190309
190357
  });
190358
+ } else {
190359
+ codeAwareScanSuccess.detectedOccurrences.stacks = codeAwareScanSuccess.detectedOccurrences.stacks.filter((stack2) => (0, vulnerable_paths_utils_1.isShortestPath)(trie, stack2.map(serialize3)));
190310
190360
  }
190311
190361
  }
190312
190362
  }
@@ -190439,7 +190489,7 @@ var require_cli_core = __commonJS({
190439
190489
  }
190440
190490
  const detectedOccurrences = codeAwareScanResults.detectedOccurrences;
190441
190491
  let dependencyType = "unknown";
190442
- for (const detectedOccurrence of detectedOccurrences) {
190492
+ for (const detectedOccurrence of Array.isArray(detectedOccurrences) ? detectedOccurrences : [detectedOccurrences]) {
190443
190493
  const affectedPackages = detectedOccurrence.affectedPackages;
190444
190494
  const dependencyTypeForOccurrence = (0, vuln_chain_detail_utils_1.getDependencyTypeForReachableVulnerability)(vulnChainDetails, directDependencies, affectedPackages);
190445
190495
  if (dependencyType === "unknown") {
@@ -190477,7 +190527,7 @@ var cli_core_1 = require_cli_core();
190477
190527
  var version_1 = require_version();
190478
190528
  var program = new commander_1.Command();
190479
190529
  var run = new commander_1.Command();
190480
- run.name("run").argument("<path>", "File system path to folder containing the project").option("-o, --output-dir <path>", "Write json report to <path>/coana-report.json").option("-d, --debug", "Enable debug logging", false).option("-s, --silent", "Silence all debug/warning output", false).option("-p, --print-report", "Print the report to the console", false).option("--offline-database <path>", "Path to a coana-offline-db.json file for running the CLI without internet connectivity", void 0).option("-t, --timeout <timeout>", "Set API <timeout> in milliseconds to Coana backend.", "300000").option("-a, --analysis-timeout <timeout>", "Set <timeout> in seconds for each reachability analysis run").option("--memory-limit <memoryInMB>", "Set memory limit for analysis to <memoryInMB> megabytes of memory.", "8192").option("-c, --concurrency <concurrency>", "Set the maximum number of concurrent reachability analysis runs. It's recommended to choose a concurrency level that ensures that each analysis run has at least the --memory-limit amount of memory available.", "1").option("--api-key <key>", "Set the Coana dashboard API key. By setting you also enable the dashboard integration.").addOption(new commander_1.Option("--write-report-to-file", "Write the report dashboard-compatible report to dashboard-report.json. This report may help the Coana team debug issues with the report insertion mechanism.").default(false).hideHelp()).option("--project-name <repoName>", "Set the name of the repository. Used for dashboard integration.").option("--repo-url <repoUrl>", "Set the URL of the repository. Used for dashboard integration.").option("--include-dirs <dirs...>", "globs for directories to include from the detection of subprojects (space-separated). Notice, projects that are not included may still be scanned if they are referenced from included projects.").option("--exclude-dirs <dirs...>", "globs for directories to exclude from the detection of subprojects (space-separated). Notice, excluded projects may still be scanned if they are referenced from non-excluded projects.").option("--disable-analysis-splitting", "Limits Coana to at most 1 reachability analysis run per workspace").option("--print-analysis-log-file", "Store log output from the JavaScript/TypeScript reachability analysis in the file js-analysis.log file in the root of each workspace", false).option("--entry-points <entryPoints...>", "List of files to analyze for root workspace. The reachability analysis automatically analyzes all files used by the entry points. If not provided, all JavaScript and TypeScript files are considered entry points. For non-root workspaces, all JavaScript and TypeScript files are analyzed as well.").option("--include-projects-with-no-reachability-support", "Also runs Coana on projects where we support traditional SCA, but does not yet support reachability analysis.", false).option("--ecosystems <ecosystems...>", "List of ecosystems to analyze. Currently NPM, PIP, MAVEN and GO are supported. Default is all supported ecosystems.", (ecosystems) => ecosystems.split(" ").map((e) => e.toUpperCase())).option("--changed-files <files...>", "List of files that have changed. If provided, Coana only analyzes workspaces and modules that contain changed files.").option("--disable-report-submission", "Disable the submission of the report to the Coana dashboard. Used by the pipeline blocking feature.", false).option("--provider-project <path>", "File system path to folder containing the provider project (Only supported for Maven, Gradle, and SBT)").option("--provider-workspaces <dirs...>", "List of workspaces that build the provided runtime environment (Only supported for Maven, Gradle, and SBT)", (paths) => paths.split(" ")).option("--lightweight-reachability", "Runs Coana in lightweight mode. This increases analysis speed but also raises the risk of Coana misclassifying the reachability of certain complex vulnerabilities. Recommended only for use with Coana Guardrails mode.", false).addOption(new commander_1.Option("--run-without-docker", "Run package managers and reachability analyzers without using docker").default(process.env.RUN_WITHOUT_DOCKER === "true").hideHelp()).version(version_1.version).configureHelp({ sortOptions: true }).action(async (path2, options) => {
190530
+ run.name("run").argument("<path>", "File system path to folder containing the project").option("-o, --output-dir <path>", "Write json report to <path>/coana-report.json").option("-d, --debug", "Enable debug logging", false).option("-s, --silent", "Silence all debug/warning output", false).option("-p, --print-report", "Print the report to the console", false).option("--offline-database <path>", "Path to a coana-offline-db.json file for running the CLI without internet connectivity", void 0).option("-t, --timeout <timeout>", "Set API <timeout> in milliseconds to Coana backend.", "300000").option("-a, --analysis-timeout <timeout>", "Set <timeout> in seconds for each reachability analysis run").option("--memory-limit <memoryInMB>", "Set memory limit for analysis to <memoryInMB> megabytes of memory.", "8192").option("-c, --concurrency <concurrency>", "Set the maximum number of concurrent reachability analysis runs. It's recommended to choose a concurrency level that ensures that each analysis run has at least the --memory-limit amount of memory available.", "1").option("--api-key <key>", "Set the Coana dashboard API key. By setting you also enable the dashboard integration.").addOption(new commander_1.Option("--write-report-to-file", "Write the report dashboard-compatible report to dashboard-report.json. This report may help the Coana team debug issues with the report insertion mechanism.").default(false).hideHelp()).option("--project-name <repoName>", "Set the name of the repository. Used for dashboard integration.").option("--repo-url <repoUrl>", "Set the URL of the repository. Used for dashboard integration.").option("--include-dirs <dirs...>", "globs for directories to include from the detection of subprojects (space-separated). Notice, projects that are not included may still be scanned if they are referenced from included projects.").option("--exclude-dirs <dirs...>", "globs for directories to exclude from the detection of subprojects (space-separated). Notice, excluded projects may still be scanned if they are referenced from non-excluded projects.").option("--disable-analysis-splitting", "Limits Coana to at most 1 reachability analysis run per workspace").option("--print-analysis-log-file", "Store log output from the JavaScript/TypeScript reachability analysis in the file js-analysis.log file in the root of each workspace", false).option("--entry-points <entryPoints...>", "List of files to analyze for root workspace. The reachability analysis automatically analyzes all files used by the entry points. If not provided, all JavaScript and TypeScript files are considered entry points. For non-root workspaces, all JavaScript and TypeScript files are analyzed as well.").option("--include-projects-with-no-reachability-support", "Also runs Coana on projects where we support traditional SCA, but does not yet support reachability analysis.", false).option("--ecosystems <ecosystems...>", "List of ecosystems to analyze. Currently NPM, PIP, MAVEN and GO are supported. Default is all supported ecosystems.", (ecosystems) => ecosystems.split(" ").map((e) => e.toUpperCase())).option("--changed-files <files...>", "List of files that have changed. If provided, Coana only analyzes workspaces and modules that contain changed files.").option("--disable-report-submission", "Disable the submission of the report to the Coana dashboard. Used by the pipeline blocking feature.", false).option("--provider-project <path>", "File system path to folder containing the provider project (Only supported for Maven, Gradle, and SBT)").option("--provider-workspaces <dirs...>", "List of workspaces that build the provided runtime environment (Only supported for Maven, Gradle, and SBT)", (paths) => paths.split(" ")).option("--lightweight-reachability", "Runs Coana in lightweight mode. This increases analysis speed but also raises the risk of Coana misclassifying the reachability of certain complex vulnerabilities. Recommended only for use with Coana Guardrails mode.", false).addOption(new commander_1.Option("--run-without-docker", "Run package managers and reachability analyzers without using docker").default(process.env.RUN_WITHOUT_DOCKER === "true").hideHelp()).addOption(new commander_1.Option("--run-env <env>", "Specifies the environment in which the CLI is run. So far only MANAGED_SCAN and UNKNOWN are supported.").default("UNKNOWN").choices(["UNKNOWN", "MANAGED_SCAN"]).hideHelp()).version(version_1.version).configureHelp({ sortOptions: true }).action(async (path2, options) => {
190481
190531
  process.env.DOCKER_IMAGE_TAG ??= version_1.version;
190482
190532
  await new cli_core_1.CliCore(path2, options).main();
190483
190533
  });