@holistics/cli-core 2.2.1 → 2.2.2

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/dist/commands.js +33 -15
  2. package/package.json +1 -1
package/dist/commands.js CHANGED
@@ -27399,7 +27399,7 @@ var require_dist3 = __commonJS((exports2) => {
27399
27399
  exports2.default = deferred;
27400
27400
  });
27401
27401
  // package.json
27402
- var version = "2.2.1";
27402
+ var version = "2.2.2";
27403
27403
 
27404
27404
  // ../../node_modules/.pnpm/@commander-js+extra-typings@13.1.0_commander@13.1.0/node_modules/@commander-js/extra-typings/esm.mjs
27405
27405
  var import__ = __toESM(require_extra_typings(), 1);
@@ -106684,6 +106684,7 @@ var ModelGraph = class e9 {
106684
106684
  undirectedReachabilityCache;
106685
106685
  fanoutReachabilityCache;
106686
106686
  _hashCache;
106687
+ _hasWeights;
106687
106688
  allowAmbiguousPaths;
106688
106689
  shouldPrioritizeLengthForMixedPaths;
106689
106690
  constructor(e10, t, n, r3, i3) {
@@ -106787,28 +106788,43 @@ var ModelGraph = class e9 {
106787
106788
  }
106788
106789
  return null;
106789
106790
  }
106791
+ hasWeightedRelationships() {
106792
+ return this._hasWeights === undefined && (this._hasWeights = this.relationships.some((e10) => !!e10.weight)), this._hasWeights;
106793
+ }
106790
106794
  findFirstPathOfTier(e10, t, n, r3) {
106795
+ if (n === PathTier.DIM_TO_FACT && !this.canReach(e10, t, {
106796
+ allowFanout: false,
106797
+ respectFilterDirection: false
106798
+ }))
106799
+ return null;
106791
106800
  let i3 = this.forward.get(e10) || [], a = this.createNeighborQueueItems(i3, e10, [[e10], undefined], [], undefined, false);
106792
106801
  if (r3 && n !== PathTier.DIM_TO_FACT) {
106793
106802
  let t3 = this.backward.get(e10) || [];
106794
106803
  a = a.concat(this.createNeighborQueueItems(t3, e10, [[e10], undefined], [], undefined, true));
106795
106804
  }
106796
- let s3 = [], c3 = 100;
106797
- for (;a.length > 0 && s3.length < 100; ) {
106798
- let [e11, i4, c4, l] = a.shift(), [u] = i4;
106799
- if (import_lodash2.includes(u, e11))
106805
+ let s3 = [], c3 = 100, l = 50000, u = !this.hasWeightedRelationships(), f3 = Infinity, p3 = 0;
106806
+ for (;p3 < a.length && s3.length < 100; ) {
106807
+ if (p3 >= l) {
106808
+ console.warn(`[amql] path search \`${e10}\` -> \`${t}\` (tier ${n}) hit the ${l}-expansion cap; using best path found so far`);
106809
+ break;
106810
+ }
106811
+ let [i4, c4, m3, S3] = a[p3++], [w3] = c4;
106812
+ if (import_lodash2.includes(w3, i4) || (w3.push(i4), i4 !== t && !this.canReach(i4, t, {
106813
+ allowFanout: true,
106814
+ respectFilterDirection: false
106815
+ })))
106800
106816
  continue;
106801
- switch (u.push(e11), n) {
106817
+ switch (n) {
106802
106818
  case PathTier.DIM_TO_FACT:
106803
- if (l && l !== PathTier.DIM_TO_FACT)
106819
+ if (S3 && S3 !== PathTier.DIM_TO_FACT)
106804
106820
  continue;
106805
106821
  break;
106806
106822
  case PathTier.FACT_TO_DIM:
106807
- if (l === PathTier.DIM_TO_FACT || l === PathTier.MIXED || l === PathTier.MANY_TO_MANY)
106823
+ if (S3 === PathTier.DIM_TO_FACT || S3 === PathTier.MIXED || S3 === PathTier.MANY_TO_MANY)
106808
106824
  continue;
106809
106825
  break;
106810
106826
  case PathTier.MANY_TO_MANY:
106811
- if (l === PathTier.MIXED || l === PathTier.DIM_TO_FACT)
106827
+ if (S3 === PathTier.MIXED || S3 === PathTier.DIM_TO_FACT)
106812
106828
  continue;
106813
106829
  break;
106814
106830
  case PathTier.MIXED:
@@ -106816,14 +106832,16 @@ var ModelGraph = class e9 {
106816
106832
  default:
106817
106833
  return n;
106818
106834
  }
106819
- if (e11 === t) {
106820
- (l === n || !l && n === PathTier.DIM_TO_FACT) && s3.push([c4, i4[1]]);
106835
+ if (i4 === t) {
106836
+ (S3 === n || !S3 && n === PathTier.DIM_TO_FACT) && (s3.push([m3, c4[1]]), u && m3.length < f3 && (f3 = m3.length));
106821
106837
  continue;
106822
106838
  }
106823
- let f3 = import_lodash2.filter(this.forward.get(e11) || [], (e12) => e12 !== u[u.length - 2]);
106824
- a = a.concat(this.createNeighborQueueItems(f3, e11, i4, c4, l, false));
106825
- let p3 = this.backward.get(e11);
106826
- p3 && r3 && n !== PathTier.DIM_TO_FACT && (a = a.concat(this.createNeighborQueueItems(p3, e11, i4, c4, l, true)));
106839
+ if (u && m3.length >= f3)
106840
+ continue;
106841
+ let E = import_lodash2.filter(this.forward.get(i4) || [], (e11) => e11 !== w3[w3.length - 2]);
106842
+ a.push(...this.createNeighborQueueItems(E, i4, c4, m3, S3, false));
106843
+ let N = this.backward.get(i4);
106844
+ N && r3 && n !== PathTier.DIM_TO_FACT && a.push(...this.createNeighborQueueItems(N, i4, c4, m3, S3, true));
106827
106845
  }
106828
106846
  return s3.length === 0 ? null : selectBestPath(s3, n === PathTier.MIXED && !!this.shouldPrioritizeLengthForMixedPaths);
106829
106847
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@holistics/cli-core",
3
3
  "type": "module",
4
- "version": "2.2.1",
4
+ "version": "2.2.2",
5
5
  "bin": {
6
6
  "holistics": "./bin/holistics.js"
7
7
  },