@hyperdx/cli 0.3.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +1486 -1300
- package/package.json +2 -2
package/dist/cli.js
CHANGED
|
@@ -49671,6 +49671,530 @@ var require_commander = __commonJS({
|
|
|
49671
49671
|
}
|
|
49672
49672
|
});
|
|
49673
49673
|
|
|
49674
|
+
// ../common-utils/dist/chunk-PPIKEHOH.js
|
|
49675
|
+
var require_chunk_PPIKEHOH = __commonJS({
|
|
49676
|
+
"../common-utils/dist/chunk-PPIKEHOH.js"(exports) {
|
|
49677
|
+
"use strict";
|
|
49678
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
49679
|
+
function _nullishCoalesce(lhs, rhsFn) {
|
|
49680
|
+
if (lhs != null) {
|
|
49681
|
+
return lhs;
|
|
49682
|
+
} else {
|
|
49683
|
+
return rhsFn();
|
|
49684
|
+
}
|
|
49685
|
+
}
|
|
49686
|
+
var _class;
|
|
49687
|
+
var t2 = (_class = class e2 {
|
|
49688
|
+
constructor() {
|
|
49689
|
+
_class.prototype.__init.call(this);
|
|
49690
|
+
_class.prototype.__init2.call(this);
|
|
49691
|
+
_class.prototype.__init3.call(this);
|
|
49692
|
+
_class.prototype.__init4.call(this);
|
|
49693
|
+
_class.prototype.__init5.call(this);
|
|
49694
|
+
_class.prototype.__init6.call(this);
|
|
49695
|
+
_class.prototype.__init7.call(this);
|
|
49696
|
+
_class.prototype.__init8.call(this);
|
|
49697
|
+
_class.prototype.__init9.call(this);
|
|
49698
|
+
_class.prototype.__init10.call(this);
|
|
49699
|
+
}
|
|
49700
|
+
__init() {
|
|
49701
|
+
this.drainDepth = 4;
|
|
49702
|
+
}
|
|
49703
|
+
__init2() {
|
|
49704
|
+
this.drainSimTh = 0.4;
|
|
49705
|
+
}
|
|
49706
|
+
__init3() {
|
|
49707
|
+
this.drainMaxChildren = 100;
|
|
49708
|
+
}
|
|
49709
|
+
__init4() {
|
|
49710
|
+
this.drainMaxClusters = null;
|
|
49711
|
+
}
|
|
49712
|
+
__init5() {
|
|
49713
|
+
this.drainExtraDelimiters = [];
|
|
49714
|
+
}
|
|
49715
|
+
__init6() {
|
|
49716
|
+
this.maskPrefix = "<";
|
|
49717
|
+
}
|
|
49718
|
+
__init7() {
|
|
49719
|
+
this.maskSuffix = ">";
|
|
49720
|
+
}
|
|
49721
|
+
__init8() {
|
|
49722
|
+
this.maskingInstructions = [];
|
|
49723
|
+
}
|
|
49724
|
+
__init9() {
|
|
49725
|
+
this.parametrizeNumericTokens = true;
|
|
49726
|
+
}
|
|
49727
|
+
__init10() {
|
|
49728
|
+
this.parameterExtractionCacheCapacity = 3e3;
|
|
49729
|
+
}
|
|
49730
|
+
static fromJSON(r) {
|
|
49731
|
+
let i2 = new e2();
|
|
49732
|
+
return typeof r.drain_depth == "number" && (i2.drainDepth = r.drain_depth), typeof r.drain_sim_th == "number" && (i2.drainSimTh = r.drain_sim_th), typeof r.drain_max_children == "number" && (i2.drainMaxChildren = r.drain_max_children), (typeof r.drain_max_clusters == "number" || r.drain_max_clusters === null) && (i2.drainMaxClusters = r.drain_max_clusters), Array.isArray(r.drain_extra_delimiters) && (i2.drainExtraDelimiters = r.drain_extra_delimiters.filter((a3) => typeof a3 == "string")), typeof r.mask_prefix == "string" && (i2.maskPrefix = r.mask_prefix), typeof r.mask_suffix == "string" && (i2.maskSuffix = r.mask_suffix), typeof r.parametrize_numeric_tokens == "boolean" && (i2.parametrizeNumericTokens = r.parametrize_numeric_tokens), typeof r.parameter_extraction_cache_capacity == "number" && (i2.parameterExtractionCacheCapacity = r.parameter_extraction_cache_capacity), Array.isArray(r.masking_instructions) && (i2.maskingInstructions = r.masking_instructions.filter((a3) => typeof a3 == "object" && a3 !== null).map((a3) => ({ pattern: _nullishCoalesce(a3.regex_pattern, () => a3.pattern), maskWith: _nullishCoalesce(a3.mask_with, () => a3.maskWith) }))), i2;
|
|
49733
|
+
}
|
|
49734
|
+
}, _class);
|
|
49735
|
+
exports.a = t2;
|
|
49736
|
+
}
|
|
49737
|
+
});
|
|
49738
|
+
|
|
49739
|
+
// ../common-utils/dist/chunk-4S7NGOPO.js
|
|
49740
|
+
var require_chunk_4S7NGOPO = __commonJS({
|
|
49741
|
+
"../common-utils/dist/chunk-4S7NGOPO.js"(exports) {
|
|
49742
|
+
"use strict";
|
|
49743
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
49744
|
+
var t2 = class {
|
|
49745
|
+
constructor(e2, s3) {
|
|
49746
|
+
this.logTemplateTokens = [...e2], this.clusterId = s3, this.size = 1;
|
|
49747
|
+
}
|
|
49748
|
+
getTemplate() {
|
|
49749
|
+
return this.logTemplateTokens.join(" ");
|
|
49750
|
+
}
|
|
49751
|
+
toString() {
|
|
49752
|
+
return `ID=${String(this.clusterId).padEnd(5)} : size=${String(this.size).padEnd(10)}: ${this.getTemplate()}`;
|
|
49753
|
+
}
|
|
49754
|
+
};
|
|
49755
|
+
exports.a = t2;
|
|
49756
|
+
}
|
|
49757
|
+
});
|
|
49758
|
+
|
|
49759
|
+
// ../common-utils/dist/chunk-G5BIG2AN.js
|
|
49760
|
+
var require_chunk_G5BIG2AN = __commonJS({
|
|
49761
|
+
"../common-utils/dist/chunk-G5BIG2AN.js"(exports) {
|
|
49762
|
+
"use strict";
|
|
49763
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
49764
|
+
function _optionalChain(ops) {
|
|
49765
|
+
let lastAccessLHS = void 0;
|
|
49766
|
+
let value = ops[0];
|
|
49767
|
+
let i2 = 1;
|
|
49768
|
+
while (i2 < ops.length) {
|
|
49769
|
+
const op = ops[i2];
|
|
49770
|
+
const fn = ops[i2 + 1];
|
|
49771
|
+
i2 += 2;
|
|
49772
|
+
if ((op === "optionalAccess" || op === "optionalCall") && value == null) {
|
|
49773
|
+
return void 0;
|
|
49774
|
+
}
|
|
49775
|
+
if (op === "access" || op === "optionalAccess") {
|
|
49776
|
+
lastAccessLHS = value;
|
|
49777
|
+
value = fn(value);
|
|
49778
|
+
} else if (op === "call" || op === "optionalCall") {
|
|
49779
|
+
value = fn((...args) => value.call(lastAccessLHS, ...args));
|
|
49780
|
+
lastAccessLHS = void 0;
|
|
49781
|
+
}
|
|
49782
|
+
}
|
|
49783
|
+
return value;
|
|
49784
|
+
}
|
|
49785
|
+
var _class;
|
|
49786
|
+
var s3 = (_class = class {
|
|
49787
|
+
__init() {
|
|
49788
|
+
this.map = /* @__PURE__ */ new Map();
|
|
49789
|
+
}
|
|
49790
|
+
__init2() {
|
|
49791
|
+
this.entries = [];
|
|
49792
|
+
}
|
|
49793
|
+
__init3() {
|
|
49794
|
+
this.freeSlots = [];
|
|
49795
|
+
}
|
|
49796
|
+
__init4() {
|
|
49797
|
+
this.head = null;
|
|
49798
|
+
}
|
|
49799
|
+
__init5() {
|
|
49800
|
+
this.tail = null;
|
|
49801
|
+
}
|
|
49802
|
+
constructor(t2) {
|
|
49803
|
+
;
|
|
49804
|
+
_class.prototype.__init.call(this);
|
|
49805
|
+
_class.prototype.__init2.call(this);
|
|
49806
|
+
_class.prototype.__init3.call(this);
|
|
49807
|
+
_class.prototype.__init4.call(this);
|
|
49808
|
+
_class.prototype.__init5.call(this);
|
|
49809
|
+
this.capacity = t2;
|
|
49810
|
+
}
|
|
49811
|
+
get size() {
|
|
49812
|
+
return this.map.size;
|
|
49813
|
+
}
|
|
49814
|
+
has(t2) {
|
|
49815
|
+
return this.map.has(t2);
|
|
49816
|
+
}
|
|
49817
|
+
peek(t2) {
|
|
49818
|
+
let e2 = this.map.get(t2);
|
|
49819
|
+
if (e2 !== void 0) return _optionalChain([this, "access", (_2) => _2.entries, "access", (_2) => _2[e2], "optionalAccess", (_3) => _3.value]);
|
|
49820
|
+
}
|
|
49821
|
+
get(t2) {
|
|
49822
|
+
let e2 = this.map.get(t2);
|
|
49823
|
+
if (e2 !== void 0) return this.moveToHead(e2), _optionalChain([this, "access", (_4) => _4.entries, "access", (_5) => _5[e2], "optionalAccess", (_6) => _6.value]);
|
|
49824
|
+
}
|
|
49825
|
+
put(t2, e2) {
|
|
49826
|
+
let n7 = this.map.get(t2);
|
|
49827
|
+
if (n7 !== void 0) {
|
|
49828
|
+
let u2 = this.entries[n7];
|
|
49829
|
+
u2.value = e2, this.moveToHead(n7);
|
|
49830
|
+
return;
|
|
49831
|
+
}
|
|
49832
|
+
let i2;
|
|
49833
|
+
this.map.size >= this.capacity && (i2 = this.evictTail());
|
|
49834
|
+
let r = this.allocSlot({ key: t2, value: e2, prev: null, next: this.head });
|
|
49835
|
+
return this.head !== null && (this.entries[this.head].prev = r), this.head = r, this.tail === null && (this.tail = r), this.map.set(t2, r), i2;
|
|
49836
|
+
}
|
|
49837
|
+
remove(t2) {
|
|
49838
|
+
let e2 = this.map.get(t2);
|
|
49839
|
+
if (e2 === void 0) return;
|
|
49840
|
+
this.map.delete(t2), this.unlink(e2);
|
|
49841
|
+
let n7 = this.entries[e2];
|
|
49842
|
+
return this.entries[e2] = null, this.freeSlots.push(e2), n7.value;
|
|
49843
|
+
}
|
|
49844
|
+
values() {
|
|
49845
|
+
let t2 = [];
|
|
49846
|
+
for (let e2 of this.entries) e2 !== null && t2.push(e2.value);
|
|
49847
|
+
return t2;
|
|
49848
|
+
}
|
|
49849
|
+
allocSlot(t2) {
|
|
49850
|
+
if (this.freeSlots.length > 0) {
|
|
49851
|
+
let e2 = this.freeSlots.pop();
|
|
49852
|
+
return this.entries[e2] = t2, e2;
|
|
49853
|
+
}
|
|
49854
|
+
return this.entries.push(t2), this.entries.length - 1;
|
|
49855
|
+
}
|
|
49856
|
+
unlink(t2) {
|
|
49857
|
+
let e2 = this.entries[t2];
|
|
49858
|
+
e2.prev !== null ? this.entries[e2.prev].next = e2.next : this.head = e2.next, e2.next !== null ? this.entries[e2.next].prev = e2.prev : this.tail = e2.prev;
|
|
49859
|
+
}
|
|
49860
|
+
moveToHead(t2) {
|
|
49861
|
+
if (this.head === t2) return;
|
|
49862
|
+
this.unlink(t2);
|
|
49863
|
+
let e2 = this.entries[t2];
|
|
49864
|
+
e2.prev = null, e2.next = this.head, this.head !== null && (this.entries[this.head].prev = t2), this.head = t2, this.tail === null && (this.tail = t2);
|
|
49865
|
+
}
|
|
49866
|
+
evictTail() {
|
|
49867
|
+
if (this.tail === null) return;
|
|
49868
|
+
let t2 = this.tail, e2 = this.entries[t2], n7 = e2.key, i2 = e2.value;
|
|
49869
|
+
return this.map.delete(n7), this.unlink(t2), this.entries[t2] = null, this.freeSlots.push(t2), [n7, i2];
|
|
49870
|
+
}
|
|
49871
|
+
}, _class);
|
|
49872
|
+
exports.a = s3;
|
|
49873
|
+
}
|
|
49874
|
+
});
|
|
49875
|
+
|
|
49876
|
+
// ../common-utils/dist/chunk-WVA66XTC.js
|
|
49877
|
+
var require_chunk_WVA66XTC = __commonJS({
|
|
49878
|
+
"../common-utils/dist/chunk-WVA66XTC.js"(exports) {
|
|
49879
|
+
"use strict";
|
|
49880
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
49881
|
+
var s3 = class {
|
|
49882
|
+
constructor() {
|
|
49883
|
+
this.keyToChildNode = /* @__PURE__ */ new Map(), this.clusterIds = [];
|
|
49884
|
+
}
|
|
49885
|
+
};
|
|
49886
|
+
exports.a = s3;
|
|
49887
|
+
}
|
|
49888
|
+
});
|
|
49889
|
+
|
|
49890
|
+
// ../common-utils/dist/chunk-5CFDOSQL.js
|
|
49891
|
+
var require_chunk_5CFDOSQL = __commonJS({
|
|
49892
|
+
"../common-utils/dist/chunk-5CFDOSQL.js"(exports) {
|
|
49893
|
+
"use strict";
|
|
49894
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
49895
|
+
function _nullishCoalesce(lhs, rhsFn) {
|
|
49896
|
+
if (lhs != null) {
|
|
49897
|
+
return lhs;
|
|
49898
|
+
} else {
|
|
49899
|
+
return rhsFn();
|
|
49900
|
+
}
|
|
49901
|
+
}
|
|
49902
|
+
var _chunk4S7NGOPOjs = require_chunk_4S7NGOPO();
|
|
49903
|
+
var _chunkG5BIG2ANjs = require_chunk_G5BIG2AN();
|
|
49904
|
+
var _chunkWVA66XTCjs = require_chunk_WVA66XTC();
|
|
49905
|
+
var g = class f {
|
|
49906
|
+
constructor(t2 = 4, r = 0.4, s3 = 100, i2 = null, e2 = [], o = "<*>", n7 = true) {
|
|
49907
|
+
if (t2 < 3) throw new Error("depth argument must be at least 3");
|
|
49908
|
+
this.logClusterDepth = t2, this.maxNodeDepth = t2 - 2, this.simTh = r, this.maxChildren = s3, this.rootNode = new _chunkWVA66XTCjs.a(), this.extraDelimiters = e2, this.maxClusters = i2, this.paramStr = o, this.parametrizeNumericTokens = n7, this.clustersCounter = 0, i2 !== null ? (this.unlimitedStore = null, this.limitedStore = new (0, _chunkG5BIG2ANjs.a)(i2)) : (this.unlimitedStore = /* @__PURE__ */ new Map(), this.limitedStore = null);
|
|
49909
|
+
}
|
|
49910
|
+
get clusterCount() {
|
|
49911
|
+
return this.unlimitedStore ? this.unlimitedStore.size : this.limitedStore.size;
|
|
49912
|
+
}
|
|
49913
|
+
getTotalClusterSize() {
|
|
49914
|
+
let t2 = 0;
|
|
49915
|
+
if (this.unlimitedStore) for (let r of this.unlimitedStore.values()) t2 += r.size;
|
|
49916
|
+
else for (let r of this.limitedStore.values()) t2 += r.size;
|
|
49917
|
+
return t2;
|
|
49918
|
+
}
|
|
49919
|
+
clusterPeek(t2) {
|
|
49920
|
+
return this.unlimitedStore ? this.unlimitedStore.get(t2) : this.limitedStore.peek(t2);
|
|
49921
|
+
}
|
|
49922
|
+
clusterGet(t2) {
|
|
49923
|
+
return this.unlimitedStore ? this.unlimitedStore.get(t2) : this.limitedStore.get(t2);
|
|
49924
|
+
}
|
|
49925
|
+
clusterContains(t2) {
|
|
49926
|
+
return this.unlimitedStore ? this.unlimitedStore.has(t2) : this.limitedStore.has(t2);
|
|
49927
|
+
}
|
|
49928
|
+
clusterInsert(t2, r) {
|
|
49929
|
+
this.unlimitedStore ? this.unlimitedStore.set(t2, r) : this.limitedStore.put(t2, r);
|
|
49930
|
+
}
|
|
49931
|
+
static hasNumbers(t2) {
|
|
49932
|
+
for (let r = 0; r < t2.length; r++) {
|
|
49933
|
+
let s3 = t2.charCodeAt(r);
|
|
49934
|
+
if (s3 >= 48 && s3 <= 57) return true;
|
|
49935
|
+
}
|
|
49936
|
+
return false;
|
|
49937
|
+
}
|
|
49938
|
+
getContentAsTokens(t2) {
|
|
49939
|
+
let r = t2.trim();
|
|
49940
|
+
for (let s3 of this.extraDelimiters) r = r.split(s3).join(" ");
|
|
49941
|
+
return r.length === 0 ? [] : r.split(/\s+/);
|
|
49942
|
+
}
|
|
49943
|
+
getSeqDistance(t2, r, s3) {
|
|
49944
|
+
if (t2.length !== r.length) throw new Error("seq1 and seq2 must have equal length");
|
|
49945
|
+
if (t2.length === 0) return [1, 0];
|
|
49946
|
+
let i2 = 0, e2 = 0;
|
|
49947
|
+
for (let o = 0; o < t2.length; o++) {
|
|
49948
|
+
if (t2[o] === this.paramStr) {
|
|
49949
|
+
e2++;
|
|
49950
|
+
continue;
|
|
49951
|
+
}
|
|
49952
|
+
t2[o] === r[o] && i2++;
|
|
49953
|
+
}
|
|
49954
|
+
return s3 && (i2 += e2), [i2 / t2.length, e2];
|
|
49955
|
+
}
|
|
49956
|
+
createTemplate(t2, r) {
|
|
49957
|
+
if (t2.length !== r.length) throw new Error("seq1 and seq2 must have equal length");
|
|
49958
|
+
return t2.map((s3, i2) => s3 === r[i2] ? r[i2] : this.paramStr);
|
|
49959
|
+
}
|
|
49960
|
+
fastMatch(t2, r, s3, i2) {
|
|
49961
|
+
let e2 = -1, o = -1, n7 = null;
|
|
49962
|
+
for (let l of t2) {
|
|
49963
|
+
let u2 = this.clusterPeek(l);
|
|
49964
|
+
if (!u2) continue;
|
|
49965
|
+
let [a3, d3] = this.getSeqDistance(u2.logTemplateTokens, r, i2);
|
|
49966
|
+
(a3 > e2 || a3 === e2 && d3 > o) && (e2 = a3, o = d3, n7 = l);
|
|
49967
|
+
}
|
|
49968
|
+
return e2 >= s3 ? n7 : null;
|
|
49969
|
+
}
|
|
49970
|
+
treeSearch(t2, r, s3) {
|
|
49971
|
+
let i2 = t2.length, e2 = String(i2), o = this.rootNode.keyToChildNode.get(e2);
|
|
49972
|
+
if (!o) return null;
|
|
49973
|
+
if (i2 === 0) {
|
|
49974
|
+
let u2 = o.clusterIds[0];
|
|
49975
|
+
return u2 !== void 0 ? u2 : null;
|
|
49976
|
+
}
|
|
49977
|
+
let n7 = o, l = 1;
|
|
49978
|
+
for (let u2 of t2) {
|
|
49979
|
+
if (l >= this.maxNodeDepth || l >= i2) break;
|
|
49980
|
+
let a3 = n7.keyToChildNode.get(u2);
|
|
49981
|
+
if (a3) n7 = a3;
|
|
49982
|
+
else {
|
|
49983
|
+
let d3 = n7.keyToChildNode.get(this.paramStr);
|
|
49984
|
+
if (d3) n7 = d3;
|
|
49985
|
+
else return null;
|
|
49986
|
+
}
|
|
49987
|
+
l++;
|
|
49988
|
+
}
|
|
49989
|
+
return this.fastMatch(n7.clusterIds, t2, r, s3);
|
|
49990
|
+
}
|
|
49991
|
+
addSeqToPrefixTree(t2, r) {
|
|
49992
|
+
let s3 = r.length, i2 = String(s3);
|
|
49993
|
+
this.rootNode.keyToChildNode.has(i2) || this.rootNode.keyToChildNode.set(i2, new _chunkWVA66XTCjs.a());
|
|
49994
|
+
let e2 = this.rootNode.keyToChildNode.get(i2);
|
|
49995
|
+
if (s3 === 0) {
|
|
49996
|
+
e2.clusterIds = [t2];
|
|
49997
|
+
return;
|
|
49998
|
+
}
|
|
49999
|
+
let o = 1;
|
|
50000
|
+
for (let n7 of r) {
|
|
50001
|
+
if (o >= this.maxNodeDepth || o >= s3) {
|
|
50002
|
+
let l = e2.clusterIds.filter((u2) => this.clusterContains(u2));
|
|
50003
|
+
l.push(t2), e2.clusterIds = l;
|
|
50004
|
+
break;
|
|
50005
|
+
}
|
|
50006
|
+
e2.keyToChildNode.has(n7) ? e2 = e2.keyToChildNode.get(n7) : this.parametrizeNumericTokens && f.hasNumbers(n7) ? (e2.keyToChildNode.has(this.paramStr) || e2.keyToChildNode.set(this.paramStr, new _chunkWVA66XTCjs.a()), e2 = e2.keyToChildNode.get(this.paramStr)) : e2.keyToChildNode.has(this.paramStr) ? e2.keyToChildNode.size < this.maxChildren ? (e2.keyToChildNode.set(n7, new _chunkWVA66XTCjs.a()), e2 = e2.keyToChildNode.get(n7)) : e2 = e2.keyToChildNode.get(this.paramStr) : e2.keyToChildNode.size + 1 < this.maxChildren ? (e2.keyToChildNode.set(n7, new _chunkWVA66XTCjs.a()), e2 = e2.keyToChildNode.get(n7)) : e2.keyToChildNode.size + 1 === this.maxChildren ? (e2.keyToChildNode.set(this.paramStr, new _chunkWVA66XTCjs.a()), e2 = e2.keyToChildNode.get(this.paramStr)) : e2 = e2.keyToChildNode.get(this.paramStr), o++;
|
|
50007
|
+
}
|
|
50008
|
+
}
|
|
50009
|
+
addLogMessage(t2) {
|
|
50010
|
+
let r = this.getContentAsTokens(t2), s3 = this.treeSearch(r, this.simTh, false);
|
|
50011
|
+
if (s3 === null) {
|
|
50012
|
+
this.clustersCounter++;
|
|
50013
|
+
let n7 = this.clustersCounter, l = new (0, _chunk4S7NGOPOjs.a)(r, n7);
|
|
50014
|
+
return this.clusterInsert(n7, l), this.addSeqToPrefixTree(n7, r), [l, "cluster_created"];
|
|
50015
|
+
}
|
|
50016
|
+
let i2 = this.clusterPeek(s3), e2 = this.createTemplate(r, i2.logTemplateTokens), o = e2.length === i2.logTemplateTokens.length && e2.every((n7, l) => n7 === i2.logTemplateTokens[l]) ? "none" : "cluster_template_changed";
|
|
50017
|
+
return i2.logTemplateTokens = e2, i2.size += 1, this.clusterGet(s3), [i2, o];
|
|
50018
|
+
}
|
|
50019
|
+
getClustersIdsForSeqLen(t2) {
|
|
50020
|
+
let r = (o, n7) => {
|
|
50021
|
+
n7.push(...o.clusterIds);
|
|
50022
|
+
for (let l of o.keyToChildNode.values()) r(l, n7);
|
|
50023
|
+
}, s3 = String(t2), i2 = this.rootNode.keyToChildNode.get(s3);
|
|
50024
|
+
if (!i2) return [];
|
|
50025
|
+
let e2 = [];
|
|
50026
|
+
return r(i2, e2), e2;
|
|
50027
|
+
}
|
|
50028
|
+
match(t2, r = "never") {
|
|
50029
|
+
if (!["always", "never", "fallback"].includes(r)) throw new Error(`Invalid full_search_strategy: ${r}`);
|
|
50030
|
+
let s3 = this.getContentAsTokens(t2), i2 = 1, e2 = () => {
|
|
50031
|
+
let n7 = this.getClustersIdsForSeqLen(s3.length), l = this.fastMatch(n7, s3, i2, true);
|
|
50032
|
+
return l === null ? null : _nullishCoalesce(this.clusterPeek(l), () => null);
|
|
50033
|
+
};
|
|
50034
|
+
if (r === "always") return e2();
|
|
50035
|
+
let o = this.treeSearch(s3, i2, true);
|
|
50036
|
+
return o !== null ? _nullishCoalesce(this.clusterPeek(o), () => null) : r === "never" ? null : e2();
|
|
50037
|
+
}
|
|
50038
|
+
};
|
|
50039
|
+
exports.a = g;
|
|
50040
|
+
}
|
|
50041
|
+
});
|
|
50042
|
+
|
|
50043
|
+
// ../common-utils/dist/chunk-DBDYKVVO.js
|
|
50044
|
+
var require_chunk_DBDYKVVO = __commonJS({
|
|
50045
|
+
"../common-utils/dist/chunk-DBDYKVVO.js"(exports) {
|
|
50046
|
+
"use strict";
|
|
50047
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
50048
|
+
function _nullishCoalesce(lhs, rhsFn) {
|
|
50049
|
+
if (lhs != null) {
|
|
50050
|
+
return lhs;
|
|
50051
|
+
} else {
|
|
50052
|
+
return rhsFn();
|
|
50053
|
+
}
|
|
50054
|
+
}
|
|
50055
|
+
var e2 = class {
|
|
50056
|
+
constructor(s3, t2) {
|
|
50057
|
+
this._pattern = s3, this.regex = new RegExp(s3, "g"), this.maskWith = t2;
|
|
50058
|
+
}
|
|
50059
|
+
get pattern() {
|
|
50060
|
+
return this._pattern;
|
|
50061
|
+
}
|
|
50062
|
+
mask(s3, t2, i2) {
|
|
50063
|
+
let r = t2 + this.maskWith + i2;
|
|
50064
|
+
return this.regex.lastIndex = 0, s3.replace(this.regex, r);
|
|
50065
|
+
}
|
|
50066
|
+
};
|
|
50067
|
+
var a3 = exports.b = class {
|
|
50068
|
+
constructor(s3, t2, i2) {
|
|
50069
|
+
this.maskPrefix = t2, this.maskSuffix = i2, this._maskingInstructions = s3, this.maskNameToInstructions = /* @__PURE__ */ new Map();
|
|
50070
|
+
for (let r of s3) {
|
|
50071
|
+
let n7 = _nullishCoalesce(this.maskNameToInstructions.get(r.maskWith), () => []);
|
|
50072
|
+
n7.push(r), this.maskNameToInstructions.set(r.maskWith, n7);
|
|
50073
|
+
}
|
|
50074
|
+
}
|
|
50075
|
+
mask(s3) {
|
|
50076
|
+
let t2 = s3;
|
|
50077
|
+
for (let i2 of this._maskingInstructions) t2 = i2.mask(t2, this.maskPrefix, this.maskSuffix);
|
|
50078
|
+
return t2;
|
|
50079
|
+
}
|
|
50080
|
+
get maskNames() {
|
|
50081
|
+
return Array.from(this.maskNameToInstructions.keys());
|
|
50082
|
+
}
|
|
50083
|
+
instructionsByMaskName(s3) {
|
|
50084
|
+
return _nullishCoalesce(this.maskNameToInstructions.get(s3), () => []);
|
|
50085
|
+
}
|
|
50086
|
+
};
|
|
50087
|
+
exports.a = e2;
|
|
50088
|
+
exports.b = a3;
|
|
50089
|
+
}
|
|
50090
|
+
});
|
|
50091
|
+
|
|
50092
|
+
// ../common-utils/dist/chunk-UK6JS3QY.js
|
|
50093
|
+
var require_chunk_UK6JS3QY = __commonJS({
|
|
50094
|
+
"../common-utils/dist/chunk-UK6JS3QY.js"(exports) {
|
|
50095
|
+
"use strict";
|
|
50096
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
50097
|
+
function _nullishCoalesce(lhs, rhsFn) {
|
|
50098
|
+
if (lhs != null) {
|
|
50099
|
+
return lhs;
|
|
50100
|
+
} else {
|
|
50101
|
+
return rhsFn();
|
|
50102
|
+
}
|
|
50103
|
+
}
|
|
50104
|
+
var _chunkPPIKEHOHjs = require_chunk_PPIKEHOH();
|
|
50105
|
+
var _chunk5CFDOSQLjs = require_chunk_5CFDOSQL();
|
|
50106
|
+
var _chunkG5BIG2ANjs = require_chunk_G5BIG2AN();
|
|
50107
|
+
var _chunkDBDYKVVOjs = require_chunk_DBDYKVVO();
|
|
50108
|
+
var w2 = class {
|
|
50109
|
+
constructor(t2) {
|
|
50110
|
+
let e2 = _nullishCoalesce(t2, () => new _chunkPPIKEHOHjs.a()), r = e2.maskPrefix + "*" + e2.maskSuffix, a3 = e2.maskingInstructions.map((n7) => new (0, _chunkDBDYKVVOjs.a)(n7.pattern, n7.maskWith));
|
|
50111
|
+
this.masker = new (0, _chunkDBDYKVVOjs.b)(a3, e2.maskPrefix, e2.maskSuffix), this.drain = new (0, _chunk5CFDOSQLjs.a)(e2.drainDepth, e2.drainSimTh, e2.drainMaxChildren, e2.drainMaxClusters, e2.drainExtraDelimiters, r, e2.parametrizeNumericTokens), this.extractionCache = new (0, _chunkG5BIG2ANjs.a)(e2.parameterExtractionCacheCapacity), this.extraDelimiters = e2.drainExtraDelimiters;
|
|
50112
|
+
}
|
|
50113
|
+
addLogMessage(t2) {
|
|
50114
|
+
let e2 = this.masker.mask(t2), [r, a3] = this.drain.addLogMessage(e2);
|
|
50115
|
+
return { changeType: a3, clusterId: r.clusterId, clusterSize: r.size, templateMined: r.getTemplate(), clusterCount: this.drain.clusterCount };
|
|
50116
|
+
}
|
|
50117
|
+
match(t2, e2 = "never") {
|
|
50118
|
+
let r = this.masker.mask(t2);
|
|
50119
|
+
return this.drain.match(r, e2);
|
|
50120
|
+
}
|
|
50121
|
+
extractParameters(t2, e2, r = true) {
|
|
50122
|
+
let a3 = e2;
|
|
50123
|
+
for (let i2 of this.extraDelimiters) a3 = a3.split(i2).join(" ");
|
|
50124
|
+
let { regex: n7, paramMap: g } = this.getTemplateParameterExtractionRegex(t2, r), m3 = a3.match(new RegExp(n7));
|
|
50125
|
+
if (!m3 || !m3.groups) return null;
|
|
50126
|
+
let p = [];
|
|
50127
|
+
for (let [i2, s3] of g) {
|
|
50128
|
+
let o = m3.groups[i2];
|
|
50129
|
+
o !== void 0 && p.push({ value: o, maskName: s3 });
|
|
50130
|
+
}
|
|
50131
|
+
return p.sort((i2, s3) => {
|
|
50132
|
+
let o = a3.indexOf(i2.value), c3 = a3.indexOf(s3.value);
|
|
50133
|
+
return o - c3;
|
|
50134
|
+
}), p;
|
|
50135
|
+
}
|
|
50136
|
+
getTemplateParameterExtractionRegex(t2, e2) {
|
|
50137
|
+
let r = E2(`${t2}|${e2}`), a3 = this.extractionCache.peek(r);
|
|
50138
|
+
if (a3) return a3;
|
|
50139
|
+
let n7 = /* @__PURE__ */ new Map(), g = 0, m3 = new Set(this.masker.maskNames);
|
|
50140
|
+
m3.add("*");
|
|
50141
|
+
let p = l(this.masker.maskPrefix), i2 = l(this.masker.maskSuffix), s3 = l(t2);
|
|
50142
|
+
for (let c3 of m3) {
|
|
50143
|
+
let h3 = p + l(c3) + i2;
|
|
50144
|
+
for (; ; ) {
|
|
50145
|
+
let d3 = [];
|
|
50146
|
+
if (e2 && c3 !== "*") {
|
|
50147
|
+
let S3 = this.masker.instructionsByMaskName(c3);
|
|
50148
|
+
for (let v2 of S3) d3.push(v2.pattern);
|
|
50149
|
+
}
|
|
50150
|
+
(!e2 || c3 === "*") && d3.push(".+?");
|
|
50151
|
+
let f = `p_${g}`;
|
|
50152
|
+
g++, n7.set(f, c3);
|
|
50153
|
+
let L3 = d3.join("|"), N2 = `(?<${f}>${L3})`;
|
|
50154
|
+
if (s3.includes(h3)) s3 = s3.replace(h3, N2);
|
|
50155
|
+
else break;
|
|
50156
|
+
}
|
|
50157
|
+
}
|
|
50158
|
+
s3 = s3.replace(/\\ /g, "\\s+"), s3 = `^${s3}$`;
|
|
50159
|
+
let o = { regex: s3, paramMap: n7 };
|
|
50160
|
+
return this.extractionCache.put(r, o), o;
|
|
50161
|
+
}
|
|
50162
|
+
};
|
|
50163
|
+
function l(u2) {
|
|
50164
|
+
return u2.replace(/[.*+?^${}()|[\]\\-]/g, "\\$&");
|
|
50165
|
+
}
|
|
50166
|
+
function E2(u2) {
|
|
50167
|
+
let t2 = 5381;
|
|
50168
|
+
for (let e2 = 0; e2 < u2.length; e2++) t2 = (t2 * 33 ^ u2.charCodeAt(e2)) >>> 0;
|
|
50169
|
+
return t2;
|
|
50170
|
+
}
|
|
50171
|
+
exports.a = w2;
|
|
50172
|
+
}
|
|
50173
|
+
});
|
|
50174
|
+
|
|
50175
|
+
// ../common-utils/dist/drain/index.js
|
|
50176
|
+
var require_drain = __commonJS({
|
|
50177
|
+
"../common-utils/dist/drain/index.js"(exports) {
|
|
50178
|
+
"use strict";
|
|
50179
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
50180
|
+
var _chunkUK6JS3QYjs = require_chunk_UK6JS3QY();
|
|
50181
|
+
var _chunkPPIKEHOHjs = require_chunk_PPIKEHOH();
|
|
50182
|
+
var _chunk5CFDOSQLjs = require_chunk_5CFDOSQL();
|
|
50183
|
+
var _chunk4S7NGOPOjs = require_chunk_4S7NGOPO();
|
|
50184
|
+
var _chunkG5BIG2ANjs = require_chunk_G5BIG2AN();
|
|
50185
|
+
var _chunkDBDYKVVOjs = require_chunk_DBDYKVVO();
|
|
50186
|
+
var _chunkWVA66XTCjs = require_chunk_WVA66XTC();
|
|
50187
|
+
exports.Drain = _chunk5CFDOSQLjs.a;
|
|
50188
|
+
exports.LogCluster = _chunk4S7NGOPOjs.a;
|
|
50189
|
+
exports.LogMasker = _chunkDBDYKVVOjs.b;
|
|
50190
|
+
exports.LruCache = _chunkG5BIG2ANjs.a;
|
|
50191
|
+
exports.MaskingInstruction = _chunkDBDYKVVOjs.a;
|
|
50192
|
+
exports.Node = _chunkWVA66XTCjs.a;
|
|
50193
|
+
exports.TemplateMiner = _chunkUK6JS3QYjs.a;
|
|
50194
|
+
exports.TemplateMinerConfig = _chunkPPIKEHOHjs.a;
|
|
50195
|
+
}
|
|
50196
|
+
});
|
|
50197
|
+
|
|
49674
50198
|
// ../../node_modules/zod/v3/helpers/util.cjs
|
|
49675
50199
|
var require_util = __commonJS({
|
|
49676
50200
|
"../../node_modules/zod/v3/helpers/util.cjs"(exports) {
|
|
@@ -53843,9 +54367,9 @@ var require_zod = __commonJS({
|
|
|
53843
54367
|
}
|
|
53844
54368
|
});
|
|
53845
54369
|
|
|
53846
|
-
// ../common-utils/dist/chunk-
|
|
53847
|
-
var
|
|
53848
|
-
"../common-utils/dist/chunk-
|
|
54370
|
+
// ../common-utils/dist/chunk-VXPFG6S4.js
|
|
54371
|
+
var require_chunk_VXPFG6S4 = __commonJS({
|
|
54372
|
+
"../common-utils/dist/chunk-VXPFG6S4.js"(exports) {
|
|
53849
54373
|
"use strict";
|
|
53850
54374
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
53851
54375
|
function _nullishCoalesce(lhs, rhsFn) {
|
|
@@ -53877,247 +54401,261 @@ var require_chunk_BI2C7Y5A = __commonJS({
|
|
|
53877
54401
|
return value;
|
|
53878
54402
|
}
|
|
53879
54403
|
var _zod = require_zod();
|
|
53880
|
-
var
|
|
53881
|
-
var
|
|
53882
|
-
var
|
|
53883
|
-
var
|
|
53884
|
-
var
|
|
54404
|
+
var c3 = ((s3) => (s3.Gauge = "gauge", s3.Histogram = "histogram", s3.Sum = "sum", s3.Summary = "summary", s3.ExponentialHistogram = "exponential histogram", s3))(c3 || {});
|
|
54405
|
+
var Ue2 = exports.b = _zod.z.nativeEnum(c3);
|
|
54406
|
+
var w2 = exports.c = ((a3) => (a3.Line = "line", a3.StackedBar = "stacked_bar", a3.Table = "table", a3.Pie = "pie", a3.Number = "number", a3.Search = "search", a3.Heatmap = "heatmap", a3.Markdown = "markdown", a3))(w2 || {});
|
|
54407
|
+
var f = exports.d = _zod.z.object(Object.values(c3).reduce((o, i2) => ({ ...o, [i2]: _zod.z.string().optional() }), {})).refine((o) => Object.values(o).some((i2) => i2 && i2.length > 0), { message: "At least one metric table must be specified" });
|
|
54408
|
+
var d3 = exports.e = _zod.z.string().regex(/^\d+ (second|minute|hour|day)$/);
|
|
53885
54409
|
var g = exports.f = _zod.z.string();
|
|
53886
|
-
var
|
|
53887
|
-
var
|
|
53888
|
-
var
|
|
53889
|
-
var
|
|
53890
|
-
var
|
|
53891
|
-
var
|
|
53892
|
-
var j2 = exports.m = _zod.z.array(
|
|
53893
|
-
var
|
|
53894
|
-
var re2 = exports.o = _zod.z.array(
|
|
53895
|
-
var
|
|
53896
|
-
var
|
|
53897
|
-
var
|
|
53898
|
-
var
|
|
53899
|
-
var
|
|
53900
|
-
var
|
|
53901
|
-
var
|
|
53902
|
-
var
|
|
53903
|
-
var
|
|
53904
|
-
var
|
|
53905
|
-
var
|
|
53906
|
-
var
|
|
53907
|
-
var
|
|
53908
|
-
var
|
|
53909
|
-
var
|
|
53910
|
-
var
|
|
53911
|
-
var
|
|
54410
|
+
var r = exports.g = _zod.z.enum(["sql", "lucene"]).optional();
|
|
54411
|
+
var C2 = exports.h = _zod.z.enum(["avg", "count", "count_distinct", "last_value", "max", "min", "quantile", "sum", "any", "none"]);
|
|
54412
|
+
var ie2 = exports.i = _zod.z.enum([...C2.options, "histogram"]);
|
|
54413
|
+
var ne2 = exports.j = _zod.z.string().regex(/^(\w+)If(State|Merge)$/);
|
|
54414
|
+
var D3 = exports.k = _zod.z.object({ aggFn: _zod.z.union([_zod.z.literal("quantile"), _zod.z.literal("quantileMerge"), _zod.z.literal("histogram"), _zod.z.literal("histogramMerge")]), level: _zod.z.number(), aggCondition: g, aggConditionLanguage: r, valueExpression: _zod.z.string(), valueExpressionLanguage: _zod.z.undefined().optional(), isDelta: _zod.z.boolean().optional() }).or(_zod.z.object({ aggFn: _zod.z.union([C2, ne2]), aggCondition: g, aggConditionLanguage: r, valueExpression: _zod.z.string(), valueExpressionLanguage: _zod.z.undefined().optional(), isDelta: _zod.z.boolean().optional() })).or(_zod.z.object({ aggFn: _zod.z.string().optional(), aggCondition: _zod.z.string().optional(), aggConditionLanguage: r, valueExpression: _zod.z.string(), valueExpressionLanguage: _zod.z.undefined().optional(), metricType: _zod.z.nativeEnum(c3).optional(), isDelta: _zod.z.boolean().optional() })).or(_zod.z.object({ aggFn: _zod.z.string().optional(), aggCondition: _zod.z.string().optional(), aggConditionLanguage: r.optional(), valueExpression: _zod.z.string(), valueExpressionLanguage: r, isDelta: _zod.z.boolean().optional() }));
|
|
54415
|
+
var A2 = exports.l = _zod.z.intersection(D3, _zod.z.object({ alias: _zod.z.string().optional(), metricType: _zod.z.nativeEnum(c3).optional(), metricName: _zod.z.string().optional(), metricNameSql: _zod.z.string().optional() }));
|
|
54416
|
+
var j2 = exports.m = _zod.z.array(A2).or(_zod.z.string());
|
|
54417
|
+
var ae2 = exports.n = _zod.z.intersection(D3, _zod.z.object({ ordering: _zod.z.enum(["ASC", "DESC"]) }));
|
|
54418
|
+
var re2 = exports.o = _zod.z.array(ae2).or(_zod.z.string());
|
|
54419
|
+
var E2 = exports.p = _zod.z.object({ limit: _zod.z.number().optional(), offset: _zod.z.number().optional() });
|
|
54420
|
+
var se2 = exports.q = _zod.z.object({ sql: _zod.z.string(), params: _zod.z.record(_zod.z.string(), _zod.z.any()) });
|
|
54421
|
+
var h3 = exports.r = _zod.z.object({ select: j2, from: _zod.z.object({ databaseName: _zod.z.string(), tableName: _zod.z.string() }), where: g, whereLanguage: r, groupBy: j2.optional(), having: g.optional(), havingLanguage: r.optional(), orderBy: re2.optional(), limit: E2.optional() });
|
|
54422
|
+
var M4 = exports.s = ((l) => (l.Slack = "slack", l.Generic = "generic", l.IncidentIO = "incidentio", l))(M4 || {});
|
|
54423
|
+
var T3 = exports.t = _zod.z.object({ _id: _zod.z.string(), createdAt: _zod.z.string(), name: _zod.z.string(), service: _zod.z.nativeEnum(M4), updatedAt: _zod.z.string(), url: _zod.z.string().optional(), description: _zod.z.string().optional(), queryParams: _zod.z.record(_zod.z.string(), _zod.z.string()).optional(), headers: _zod.z.record(_zod.z.string(), _zod.z.string()).optional(), body: _zod.z.string().optional() });
|
|
54424
|
+
var R3 = exports.u = ((a3) => (a3.ABOVE = "above", a3.BELOW = "below", a3.ABOVE_EXCLUSIVE = "above_exclusive", a3.BELOW_OR_EQUAL = "below_or_equal", a3.EQUAL = "equal", a3.NOT_EQUAL = "not_equal", a3.BETWEEN = "between", a3.NOT_BETWEEN = "not_between", a3))(R3 || {});
|
|
54425
|
+
var pe2 = exports.v = (o) => o === "between" || o === "not_between";
|
|
54426
|
+
var S3 = exports.w = ((n7) => (n7.ALERT = "ALERT", n7.DISABLED = "DISABLED", n7.INSUFFICIENT_DATA = "INSUFFICIENT_DATA", n7.OK = "OK", n7))(S3 || {});
|
|
54427
|
+
var q3 = exports.x = ((n7) => (n7.QUERY_ERROR = "QUERY_ERROR", n7.WEBHOOK_ERROR = "WEBHOOK_ERROR", n7.INVALID_ALERT = "INVALID_ALERT", n7.UNKNOWN = "UNKNOWN", n7))(q3 || {});
|
|
54428
|
+
var le2 = exports.y = _zod.z.object({ timestamp: _zod.z.union([_zod.z.string(), _zod.z.date()]), type: _zod.z.nativeEnum(q3), message: _zod.z.string() });
|
|
54429
|
+
var B3 = exports.z = ((p) => (p.SAVED_SEARCH = "saved_search", p.TILE = "tile", p))(B3 || {});
|
|
54430
|
+
var O3 = exports.A = _zod.z.union([_zod.z.literal("1m"), _zod.z.literal("5m"), _zod.z.literal("15m"), _zod.z.literal("30m"), _zod.z.literal("1h"), _zod.z.literal("6h"), _zod.z.literal("12h"), _zod.z.literal("1d")]);
|
|
54431
|
+
var ce2 = exports.B = { "1m": 1, "5m": 5, "15m": 15, "30m": 30, "1h": 60, "6h": 360, "12h": 720, "1d": 1440 };
|
|
54432
|
+
var ge2 = exports.C = _zod.z.literal("webhook");
|
|
54433
|
+
var me2 = exports.D = _zod.z.object({ type: ge2, webhookId: _zod.z.string().nonempty("Webhook ID can't be empty") });
|
|
54434
|
+
var ue2 = exports.E = _zod.z.object({ source: _zod.z.literal("saved_search"), groupBy: _zod.z.string().optional(), savedSearchId: _zod.z.string().min(1) });
|
|
54435
|
+
var de2 = exports.F = _zod.z.object({ source: _zod.z.literal("tile"), tileId: _zod.z.string().min(1), dashboardId: _zod.z.string().min(1) });
|
|
53912
54436
|
var W2 = exports.G = (o, i2) => {
|
|
53913
|
-
let
|
|
53914
|
-
o.scheduleStartAt != null &&
|
|
54437
|
+
let p = _nullishCoalesce(o.scheduleOffsetMinutes, () => 0), l = ce2[o.interval];
|
|
54438
|
+
o.scheduleStartAt != null && p > 0 && i2.addIssue({ code: _zod.z.ZodIssueCode.custom, message: "scheduleOffsetMinutes must be 0 when scheduleStartAt is provided", path: ["scheduleOffsetMinutes"] }), p >= l && i2.addIssue({ code: _zod.z.ZodIssueCode.custom, message: `scheduleOffsetMinutes must be less than ${l} minute${l === 1 ? "" : "s"}`, path: ["scheduleOffsetMinutes"] });
|
|
53915
54439
|
};
|
|
53916
54440
|
var F2 = exports.H = (o, i2) => {
|
|
53917
|
-
|
|
54441
|
+
pe2(o.thresholdType) && (o.thresholdMax == null ? i2.addIssue({ code: _zod.z.ZodIssueCode.custom, message: "thresholdMax is required for between/not_between threshold types", path: ["thresholdMax"] }) : o.thresholdMax < o.threshold && i2.addIssue({ code: _zod.z.ZodIssueCode.custom, message: "thresholdMax must be greater than or equal to threshold", path: ["thresholdMax"] }));
|
|
53918
54442
|
};
|
|
53919
|
-
var
|
|
53920
|
-
var
|
|
53921
|
-
var
|
|
53922
|
-
var
|
|
53923
|
-
var
|
|
53924
|
-
var
|
|
53925
|
-
var
|
|
53926
|
-
var v2 = exports.L =
|
|
53927
|
-
var
|
|
53928
|
-
var
|
|
53929
|
-
var
|
|
53930
|
-
var
|
|
53931
|
-
var
|
|
53932
|
-
var
|
|
53933
|
-
var
|
|
53934
|
-
var
|
|
53935
|
-
var
|
|
53936
|
-
var
|
|
53937
|
-
var
|
|
53938
|
-
var
|
|
53939
|
-
var
|
|
53940
|
-
var
|
|
53941
|
-
var
|
|
53942
|
-
var
|
|
53943
|
-
var
|
|
53944
|
-
var
|
|
53945
|
-
var
|
|
53946
|
-
var H4 =
|
|
53947
|
-
var
|
|
53948
|
-
var
|
|
53949
|
-
var
|
|
53950
|
-
var
|
|
53951
|
-
var
|
|
53952
|
-
var
|
|
53953
|
-
var
|
|
53954
|
-
var
|
|
53955
|
-
var
|
|
53956
|
-
var
|
|
53957
|
-
var
|
|
53958
|
-
var
|
|
53959
|
-
|
|
54443
|
+
var he2 = 1e3 * 60 * 60 * 24 * 365;
|
|
54444
|
+
var Se2 = 1e3 * 60 * 60 * 24 * 365 * 10;
|
|
54445
|
+
var be2 = 1439;
|
|
54446
|
+
var ye2 = exports.I = _zod.z.union([_zod.z.string().datetime(), _zod.z.null()]).optional().refine((o) => o == null || new Date(o).getTime() <= Date.now() + he2, { message: "scheduleStartAt must be within 1 year from now" }).refine((o) => o == null || new Date(o).getTime() >= Date.now() - Se2, { message: "scheduleStartAt must be within 10 years in the past" });
|
|
54447
|
+
var I3 = exports.J = _zod.z.object({ id: _zod.z.string().optional(), interval: O3, scheduleOffsetMinutes: _zod.z.number().int().min(0).max(be2).optional(), scheduleStartAt: ye2, threshold: _zod.z.number(), thresholdType: _zod.z.nativeEnum(R3), thresholdMax: _zod.z.number().optional(), channel: me2, state: _zod.z.nativeEnum(S3).optional(), name: _zod.z.string().min(1).max(512).nullish(), message: _zod.z.string().min(1).max(4096).nullish(), silenced: _zod.z.object({ by: _zod.z.string(), at: _zod.z.string(), until: _zod.z.string() }).optional() });
|
|
54448
|
+
var V2 = exports.K = I3;
|
|
54449
|
+
var xe2 = I3.superRefine(W2).superRefine(F2);
|
|
54450
|
+
var v2 = exports.L = I3.extend({ threshold: _zod.z.number() });
|
|
54451
|
+
var fe2 = v2.superRefine(W2).superRefine(F2);
|
|
54452
|
+
var P2 = exports.M = _zod.z.union([_zod.z.intersection(xe2, ue2), _zod.z.intersection(fe2, de2)]);
|
|
54453
|
+
var Ce2 = exports.N = _zod.z.object({ counts: _zod.z.number(), createdAt: _zod.z.string(), lastValues: _zod.z.array(_zod.z.object({ startTime: _zod.z.string(), count: _zod.z.number() })), state: _zod.z.nativeEnum(S3) });
|
|
54454
|
+
var Ae2 = exports.O = _zod.z.object({ type: _zod.z.literal("sql_ast"), operator: _zod.z.enum(["=", "<", ">", "!=", "<=", ">="]), left: _zod.z.string(), right: _zod.z.string() });
|
|
54455
|
+
var b2 = exports.P = _zod.z.union([_zod.z.object({ type: _zod.z.enum(["lucene", "sql"]), condition: _zod.z.string() }), Ae2]);
|
|
54456
|
+
var Ee2 = exports.Q = _zod.z.object({ id: _zod.z.string(), name: _zod.z.string(), select: _zod.z.string(), where: _zod.z.string(), whereLanguage: r, source: _zod.z.string(), tags: _zod.z.array(_zod.z.string()), orderBy: _zod.z.string().optional(), filters: _zod.z.array(b2).optional(), alerts: _zod.z.array(P2).optional() });
|
|
54457
|
+
var x3 = _zod.z.object({ email: _zod.z.string(), name: _zod.z.string().optional() }).optional();
|
|
54458
|
+
var et2 = exports.R = Ee2.omit({ alerts: true }).extend({ alerts: _zod.z.array(P2.and(_zod.z.object({ createdBy: x3 }))).optional(), createdAt: _zod.z.string().optional(), updatedAt: _zod.z.string().optional(), createdBy: x3, updatedBy: x3 });
|
|
54459
|
+
var Te2 = exports.S = _zod.z.record(_zod.z.string().max(1024), _zod.z.array(_zod.z.union([_zod.z.string().max(1024), _zod.z.boolean()])).max(50)).refine((o) => Object.keys(o).length <= 100, { message: "Too many filter keys (max 100)" });
|
|
54460
|
+
var tt2 = exports.T = _zod.z.object({ id: _zod.z.string(), source: _zod.z.string(), fields: _zod.z.array(_zod.z.string().max(1024)).max(100), filters: Te2 });
|
|
54461
|
+
var K3 = exports.U = ((t2) => (t2.BytesIEC = "bytes_iec", t2.BytesSI = "bytes_si", t2.BitsIEC = "bits_iec", t2.BitsSI = "bits_si", t2.Kibibytes = "kibibytes", t2.Kilobytes = "kilobytes", t2.Mebibytes = "mebibytes", t2.Megabytes = "megabytes", t2.Gibibytes = "gibibytes", t2.Gigabytes = "gigabytes", t2.Tebibytes = "tebibytes", t2.Terabytes = "terabytes", t2.Pebibytes = "pebibytes", t2.Petabytes = "petabytes", t2.PacketsSec = "packets_sec", t2.BytesSecIEC = "bytes_sec_iec", t2.BytesSecSI = "bytes_sec_si", t2.BitsSecIEC = "bits_sec_iec", t2.BitsSecSI = "bits_sec_si", t2.KibibytesSec = "kibibytes_sec", t2.KibibitsSec = "kibibits_sec", t2.KilobytesSec = "kilobytes_sec", t2.KilobitsSec = "kilobits_sec", t2.MebibytesSec = "mebibytes_sec", t2.MebibitsSec = "mebibits_sec", t2.MegabytesSec = "megabytes_sec", t2.MegabitsSec = "megabits_sec", t2.GibibytesSec = "gibibytes_sec", t2.GibibitsSec = "gibibits_sec", t2.GigabytesSec = "gigabytes_sec", t2.GigabitsSec = "gigabits_sec", t2.TebibytesSec = "tebibytes_sec", t2.TebibitsSec = "tebibits_sec", t2.TerabytesSec = "terabytes_sec", t2.TerabitsSec = "terabits_sec", t2.PebibytesSec = "pebibytes_sec", t2.PebibitsSec = "pebibits_sec", t2.PetabytesSec = "petabytes_sec", t2.PetabitsSec = "petabits_sec", t2.Cps = "cps", t2.Ops = "ops", t2.Rps = "rps", t2.ReadsSec = "reads_sec", t2.Wps = "wps", t2.Iops = "iops", t2.Cpm = "cpm", t2.Opm = "opm", t2.RpmReads = "rpm_reads", t2.Wpm = "wpm", t2))(K3 || {});
|
|
54462
|
+
var Re2 = exports.V = _zod.z.object({ output: _zod.z.enum(["currency", "percent", "byte", "time", "duration", "number", "data_rate", "throughput"]), numericUnit: _zod.z.nativeEnum(K3).optional(), mantissa: _zod.z.number().int().optional(), thousandSeparated: _zod.z.boolean().optional(), average: _zod.z.boolean().optional(), decimalBytes: _zod.z.boolean().optional(), factor: _zod.z.number().optional(), currencySymbol: _zod.z.string().optional(), unit: _zod.z.string().optional() });
|
|
54463
|
+
var Ie2 = _zod.z.discriminatedUnion("mode", [_zod.z.object({ mode: _zod.z.literal("template"), template: _zod.z.string().min(1) })]);
|
|
54464
|
+
var ve2 = _zod.z.object({ type: _zod.z.literal("search"), target: Ie2, whereTemplate: _zod.z.string().optional(), whereLanguage: r });
|
|
54465
|
+
var _e2 = exports.W = _zod.z.discriminatedUnion("type", [ve2]);
|
|
54466
|
+
var Q3 = _zod.z.object({ displayType: _zod.z.nativeEnum(w2).optional(), numberFormat: Re2.optional(), granularity: _zod.z.union([d3, _zod.z.literal("auto")]).optional(), compareToPreviousPeriod: _zod.z.boolean().optional(), fillNulls: _zod.z.union([_zod.z.number(), _zod.z.literal(false)]).optional(), alignDateRangeToGranularity: _zod.z.boolean().optional(), onClick: _e2.optional() });
|
|
54467
|
+
var _2 = exports.X = Q3.extend({ timestampValueExpression: _zod.z.string(), implicitColumnExpression: _zod.z.string().optional(), sampleWeightExpression: _zod.z.string().optional(), markdown: _zod.z.string().optional(), filtersLogicalOperator: _zod.z.enum(["AND", "OR"]).optional(), filters: _zod.z.array(b2).optional(), connection: _zod.z.string(), selectGroupBy: _zod.z.boolean().optional(), metricTables: f.optional(), seriesReturnType: _zod.z.enum(["ratio", "column"]).optional(), eventTableSelect: _zod.z.string().optional(), source: _zod.z.string().optional(), groupByColumnsOnLeft: _zod.z.boolean().optional() });
|
|
54468
|
+
var ze2 = exports.Y = _zod.z.intersection(_2.partial({ timestampValueExpression: true }), h3);
|
|
54469
|
+
var Le2 = _zod.z.intersection(_zod.z.intersection(_2, h3), _zod.z.object({ with: _zod.z.array(_zod.z.object({ name: _zod.z.string(), sql: se2.optional(), chartConfig: ze2.optional(), isSubquery: _zod.z.boolean().optional() })) }).partial());
|
|
54470
|
+
var H4 = Q3.extend({ configType: _zod.z.literal("sql"), sqlTemplate: _zod.z.string(), connection: _zod.z.string(), source: _zod.z.string().optional() });
|
|
54471
|
+
var ke3 = H4.extend({ filters: _zod.z.array(b2).optional(), from: _zod.z.object({ databaseName: _zod.z.string(), tableName: _zod.z.string() }).optional(), implicitColumnExpression: _zod.z.string().optional(), metricTables: f.optional() });
|
|
54472
|
+
var ot2 = exports.Z = _zod.z.union([Le2, ke3]);
|
|
54473
|
+
var G3 = _zod.z.object({ name: _zod.z.string().optional(), source: _zod.z.string() }).extend(_2.omit({ connection: true, timestampValueExpression: true, source: true }).shape).extend(h3.omit({ from: true }).shape);
|
|
54474
|
+
var je2 = G3.extend({ alert: _zod.z.union([V2.optional(), v2.optional()]) });
|
|
54475
|
+
var $ = H4.extend({ name: _zod.z.string().optional() });
|
|
54476
|
+
var we2 = $.extend({ alert: _zod.z.union([V2.optional(), v2.optional()]) });
|
|
54477
|
+
var De2 = exports._ = _zod.z.union([je2, we2]);
|
|
54478
|
+
var Z = exports.$ = _zod.z.object({ id: _zod.z.string(), x: _zod.z.number(), y: _zod.z.number(), w: _zod.z.number(), h: _zod.z.number(), config: De2, containerId: _zod.z.string().optional(), tabId: _zod.z.string().optional() });
|
|
54479
|
+
var Me2 = exports.aa = Z.extend({ config: _zod.z.union([G3, $]) });
|
|
54480
|
+
var qe2 = exports.ba = _zod.z.object({ id: _zod.z.string().min(1), title: _zod.z.string().min(1) });
|
|
54481
|
+
var Be2 = exports.ca = _zod.z.object({ id: _zod.z.string().min(1), title: _zod.z.string().min(1), collapsed: _zod.z.boolean(), collapsible: _zod.z.boolean().optional(), bordered: _zod.z.boolean().optional(), tabs: _zod.z.array(qe2).optional() });
|
|
54482
|
+
var Oe2 = exports.da = _zod.z.enum(["QUERY_EXPRESSION"]);
|
|
54483
|
+
var z2 = exports.ea = _zod.z.object({ id: _zod.z.string(), type: Oe2, name: _zod.z.string().min(1), expression: _zod.z.string().min(1), source: _zod.z.string().min(1), sourceMetricType: _zod.z.nativeEnum(c3).optional(), where: _zod.z.string().optional(), whereLanguage: r });
|
|
54484
|
+
var X3 = exports.fa = ((i2) => (i2.Services = "services", i2))(X3 || {});
|
|
54485
|
+
var it2 = exports.ga = z2.extend({ presetDashboard: _zod.z.nativeEnum(X3) });
|
|
54486
|
+
function We2(o, i2, p) {
|
|
54487
|
+
let l = _nullishCoalesce(_optionalChain([p, "optionalAccess", (_22) => _22.messageSuffix]), () => ""), n7 = /* @__PURE__ */ new Set();
|
|
54488
|
+
for (let s3 = 0; s3 < o.length; s3++) {
|
|
54489
|
+
let m3 = o[s3].id;
|
|
54490
|
+
m3 && (n7.has(m3) && i2.addIssue({ code: _zod.z.ZodIssueCode.custom, message: `Duplicate tile ID: ${m3}${l}`, path: [s3, "id"] }), n7.add(m3));
|
|
54491
|
+
}
|
|
54492
|
+
}
|
|
54493
|
+
var Fe2 = _zod.z.object({ id: _zod.z.string(), name: _zod.z.string().min(1), tiles: _zod.z.array(Z), tags: _zod.z.array(_zod.z.string()), filters: _zod.z.array(z2).optional(), savedQuery: _zod.z.string().nullable().optional(), savedQueryLanguage: r.nullable().optional(), savedFilterValues: _zod.z.array(b2).optional(), containers: _zod.z.array(Be2).refine((o) => {
|
|
54494
|
+
let i2 = o.map((p) => p.id);
|
|
53960
54495
|
return new Set(i2).size === i2.length;
|
|
53961
54496
|
}, { message: "Container IDs must be unique" }).optional() });
|
|
53962
|
-
var
|
|
53963
|
-
var
|
|
53964
|
-
var
|
|
53965
|
-
var
|
|
53966
|
-
var
|
|
53967
|
-
var
|
|
53968
|
-
var
|
|
53969
|
-
var
|
|
53970
|
-
var
|
|
53971
|
-
var
|
|
53972
|
-
var
|
|
53973
|
-
var
|
|
53974
|
-
var
|
|
53975
|
-
var
|
|
53976
|
-
var
|
|
53977
|
-
var
|
|
53978
|
-
var
|
|
53979
|
-
var
|
|
53980
|
-
function
|
|
54497
|
+
var Ve2 = exports.ja = Fe2.omit({ id: true });
|
|
54498
|
+
var nt2 = exports.ka = Ve2.omit({ tags: true }).extend({ version: _zod.z.string().min(1), description: _zod.z.string().optional(), tags: _zod.z.array(_zod.z.string()).optional(), tiles: _zod.z.array(Me2).superRefine(We2), filters: _zod.z.array(z2).optional() });
|
|
54499
|
+
var at2 = exports.la = _zod.z.object({ id: _zod.z.string(), name: _zod.z.string(), host: _zod.z.string(), username: _zod.z.string(), password: _zod.z.string().optional(), hyperdxSettingPrefix: _zod.z.string().regex(/^[a-z0-9_]+$/i).optional().nullable() });
|
|
54500
|
+
var L3 = exports.ma = _zod.z.object({ fieldMetadataDisabled: _zod.z.boolean().optional(), searchRowLimit: _zod.z.number().optional(), queryTimeout: _zod.z.number().optional(), metadataMaxRowsToRead: _zod.z.number().optional(), parallelizeWhenPossible: _zod.z.boolean().optional(), filterKeysFetchLimit: _zod.z.number().optional() });
|
|
54501
|
+
var Pe2 = exports.na = _zod.z.object({ id: _zod.z.string(), name: _zod.z.string(), allowedAuthMethods: _zod.z.array(_zod.z.literal("password")).optional(), apiKey: _zod.z.string(), hookId: _zod.z.string(), collectorAuthenticationEnforced: _zod.z.boolean() }).merge(L3);
|
|
54502
|
+
var N2 = exports.oa = ((n7) => (n7.Log = "log", n7.Trace = "trace", n7.Session = "session", n7.Metric = "metric", n7))(N2 || {});
|
|
54503
|
+
var Ke2 = _zod.z.array(_zod.z.object({ setting: _zod.z.string().min(1), value: _zod.z.string().min(1) })).max(10);
|
|
54504
|
+
var Qe2 = _zod.z.string().min(1, "Timestamp Column is required");
|
|
54505
|
+
var y3 = exports.pa = _zod.z.object({ id: _zod.z.string(), name: _zod.z.string().min(1, "Name is required"), kind: _zod.z.nativeEnum(N2), connection: _zod.z.string().min(1, "Server Connection is required"), from: _zod.z.object({ databaseName: _zod.z.string().min(1, "Database is required"), tableName: _zod.z.string().min(1, "Table is required") }), querySettings: Ke2.optional(), timestampValueExpression: Qe2 });
|
|
54506
|
+
var u2 = _zod.z.array(_zod.z.object({ sqlExpression: _zod.z.string().min(1, "Attribute SQL Expression is required"), luceneExpression: _zod.z.string().optional(), alias: _zod.z.string().optional() }));
|
|
54507
|
+
var He2 = _zod.z.object({ sourceColumn: _zod.z.string().optional(), aggFn: ie2, mvColumn: _zod.z.string().min(1, "Materialized View Column is required") }).refine(({ sourceColumn: o, aggFn: i2 }) => i2 === "count" || !!_optionalChain([o, "optionalAccess", (_3) => _3.length]), { message: "Materialized View Source Column is required" });
|
|
54508
|
+
var Y3 = exports.qa = _zod.z.object({ databaseName: _zod.z.string().min(1, "Materialized View Database is required"), tableName: _zod.z.string().min(1, "Materialized View Table is required"), dimensionColumns: _zod.z.string(), minGranularity: d3, minDate: _zod.z.string().datetime().nullish(), timestampColumn: _zod.z.string().min(1, "Materialized View Timestamp column is required"), aggregatedColumns: _zod.z.array(He2).min(1, "At least one aggregated column is required") });
|
|
54509
|
+
var J = exports.ra = y3.extend({ kind: _zod.z.literal("log"), defaultTableSelectExpression: _zod.z.string().min(1, "Default Select Expression is required"), serviceNameExpression: _zod.z.string().optional(), severityTextExpression: _zod.z.string().optional(), bodyExpression: _zod.z.string().optional(), eventAttributesExpression: _zod.z.string().optional(), resourceAttributesExpression: _zod.z.string().optional(), displayedTimestampValueExpression: _zod.z.string().optional(), metricSourceId: _zod.z.string().optional(), traceSourceId: _zod.z.string().optional(), traceIdExpression: _zod.z.string().optional(), spanIdExpression: _zod.z.string().optional(), implicitColumnExpression: _zod.z.string().optional(), uniqueRowIdExpression: _zod.z.string().optional(), tableFilterExpression: _zod.z.string().optional(), highlightedTraceAttributeExpressions: u2.optional(), highlightedRowAttributeExpressions: u2.optional(), materializedViews: _zod.z.array(Y3).optional(), orderByExpression: _zod.z.string().optional() });
|
|
54510
|
+
var U2 = exports.sa = y3.extend({ kind: _zod.z.literal("trace"), defaultTableSelectExpression: _zod.z.string().min(1, "Default Select Expression is required"), durationExpression: _zod.z.string().min(1, "Duration Expression is required"), durationPrecision: _zod.z.number().min(0).max(9).default(3), traceIdExpression: _zod.z.string().min(1, "Trace ID Expression is required"), spanIdExpression: _zod.z.string().min(1, "Span ID Expression is required"), parentSpanIdExpression: _zod.z.string().min(1, "Parent span ID expression is required"), spanNameExpression: _zod.z.string().min(1, "Span Name Expression is required"), spanKindExpression: _zod.z.string().min(1, "Span Kind Expression is required"), sampleRateExpression: _zod.z.string().optional(), logSourceId: _zod.z.string().optional().nullable(), sessionSourceId: _zod.z.string().optional(), metricSourceId: _zod.z.string().optional(), statusCodeExpression: _zod.z.string().optional(), statusMessageExpression: _zod.z.string().optional(), serviceNameExpression: _zod.z.string().optional(), resourceAttributesExpression: _zod.z.string().optional(), eventAttributesExpression: _zod.z.string().optional(), spanEventsValueExpression: _zod.z.string().optional(), implicitColumnExpression: _zod.z.string().optional(), displayedTimestampValueExpression: _zod.z.string().optional(), highlightedTraceAttributeExpressions: u2.optional(), highlightedRowAttributeExpressions: u2.optional(), materializedViews: _zod.z.array(Y3).optional(), orderByExpression: _zod.z.string().optional() });
|
|
54511
|
+
var ee2 = exports.ta = y3.extend({ kind: _zod.z.literal("session"), traceSourceId: _zod.z.string({ message: "Correlated Trace Source is required" }).min(1, "Correlated Trace Source is required"), resourceAttributesExpression: _zod.z.string().optional() });
|
|
54512
|
+
var te2 = exports.ua = y3.extend({ kind: _zod.z.literal("metric"), from: _zod.z.object({ databaseName: _zod.z.string().min(1, "Database is required"), tableName: _zod.z.string() }), metricTables: f, resourceAttributesExpression: _zod.z.string().min(1, "Resource Attributes is required"), serviceNameExpression: _zod.z.string().optional(), logSourceId: _zod.z.string().optional() });
|
|
54513
|
+
var rt2 = exports.va = _zod.z.discriminatedUnion("kind", [J, U2, ee2, te2]);
|
|
54514
|
+
var st2 = exports.wa = _zod.z.discriminatedUnion("kind", [J.omit({ id: true }), U2.omit({ id: true }), ee2.omit({ id: true }), te2.omit({ id: true })]);
|
|
54515
|
+
function pt2(o) {
|
|
53981
54516
|
return o.kind === "log";
|
|
53982
54517
|
}
|
|
53983
|
-
function
|
|
54518
|
+
function lt2(o) {
|
|
53984
54519
|
return o.kind === "trace";
|
|
53985
54520
|
}
|
|
53986
|
-
function
|
|
54521
|
+
function ct2(o) {
|
|
53987
54522
|
return o.kind === "session";
|
|
53988
54523
|
}
|
|
53989
|
-
function
|
|
54524
|
+
function gt2(o) {
|
|
53990
54525
|
return o.kind === "metric";
|
|
53991
54526
|
}
|
|
53992
|
-
function
|
|
54527
|
+
function Ge2(o) {
|
|
53993
54528
|
return o.kind === "trace" && o.sampleRateExpression ? o.sampleRateExpression : void 0;
|
|
53994
54529
|
}
|
|
53995
|
-
function
|
|
53996
|
-
let i2 =
|
|
54530
|
+
function mt2(o) {
|
|
54531
|
+
let i2 = Ge2(o);
|
|
53997
54532
|
return i2 ? { sampleWeightExpression: i2 } : void 0;
|
|
53998
54533
|
}
|
|
53999
|
-
var
|
|
54000
|
-
var
|
|
54001
|
-
var
|
|
54002
|
-
var
|
|
54003
|
-
var
|
|
54004
|
-
var
|
|
54005
|
-
var
|
|
54006
|
-
var
|
|
54007
|
-
var
|
|
54008
|
-
var
|
|
54009
|
-
var
|
|
54010
|
-
var
|
|
54011
|
-
var
|
|
54012
|
-
var
|
|
54013
|
-
var
|
|
54014
|
-
var
|
|
54015
|
-
var
|
|
54016
|
-
var
|
|
54017
|
-
var
|
|
54018
|
-
var
|
|
54019
|
-
var
|
|
54020
|
-
var
|
|
54021
|
-
var
|
|
54022
|
-
exports.a =
|
|
54023
|
-
exports.b =
|
|
54024
|
-
exports.c =
|
|
54025
|
-
exports.d =
|
|
54026
|
-
exports.e =
|
|
54534
|
+
var ut2 = _zod.z.object({ displayType: _zod.z.enum(["line", "table"]), markdown: _zod.z.string().optional(), select: _zod.z.array(_zod.z.object({ aggregationFunction: C2.describe("SQL-like function to aggregate the property by"), property: _zod.z.string().describe("Property or column to be aggregated (ex. Duration)"), condition: _zod.z.string().optional().describe("SQL filter condition to filter on ex. `SeverityText = 'error'`") })).describe("Array of data series or columns to chart for the user"), groupBy: _zod.z.string().optional().describe("Group by column or properties for the chart"), timeRange: _zod.z.string().default("Past 1h").describe('Time range of data to query for like "Past 1h", "Past 24h"') });
|
|
54535
|
+
var k3 = _zod.z.object({ from: h3.shape.from, source: _zod.z.string(), connection: _zod.z.string(), where: g.optional(), whereLanguage: r, timestampValueExpression: _zod.z.string(), dateRange: _zod.z.tuple([_zod.z.string(), _zod.z.string()]), name: _zod.z.string().optional(), markdown: _zod.z.string().optional() });
|
|
54536
|
+
var $e2 = _zod.z.object({ displayType: _zod.z.literal("search"), select: _zod.z.string(), groupBy: _zod.z.string().optional(), limit: _zod.z.object({ limit: _zod.z.number().int().positive() }).optional() }).merge(k3.required({ where: true }));
|
|
54537
|
+
var Ze2 = _zod.z.object({ displayType: _zod.z.literal("table"), select: _zod.z.array(A2).min(1), groupBy: _zod.z.string().optional(), granularity: _zod.z.union([d3, _zod.z.literal("auto")]).optional(), limit: E2.optional() }).merge(k3);
|
|
54538
|
+
var Xe2 = _zod.z.object({ displayType: _zod.z.literal("line"), select: _zod.z.array(A2).min(1), groupBy: _zod.z.string().optional(), granularity: _zod.z.union([d3, _zod.z.literal("auto")]).optional(), limit: E2.optional() }).merge(k3);
|
|
54539
|
+
var dt2 = exports.Ea = _zod.z.discriminatedUnion("displayType", [$e2, Ze2, Xe2]);
|
|
54540
|
+
var oe2 = exports.Fa = _zod.z.object({ _id: _zod.z.string(), interval: O3, scheduleOffsetMinutes: _zod.z.number().optional(), scheduleStartAt: _zod.z.union([_zod.z.string(), _zod.z.date()]).nullish(), threshold: _zod.z.number(), thresholdMax: _zod.z.number().optional(), thresholdType: _zod.z.nativeEnum(R3), channel: _zod.z.object({ type: _zod.z.string().optional().nullable() }), state: _zod.z.nativeEnum(S3).optional(), source: _zod.z.nativeEnum(B3).optional(), dashboardId: _zod.z.string().optional(), savedSearchId: _zod.z.string().optional(), tileId: _zod.z.string().optional(), name: _zod.z.string().nullish(), message: _zod.z.string().nullish(), createdAt: _zod.z.string(), updatedAt: _zod.z.string(), history: _zod.z.array(Ce2), dashboard: _zod.z.object({ _id: _zod.z.string(), name: _zod.z.string(), updatedAt: _zod.z.string(), tags: _zod.z.array(_zod.z.string()), tiles: _zod.z.array(_zod.z.object({ id: _zod.z.string(), config: _zod.z.object({ name: _zod.z.string().optional() }) })) }).optional(), savedSearch: _zod.z.object({ _id: _zod.z.string(), createdAt: _zod.z.string(), name: _zod.z.string(), updatedAt: _zod.z.string(), tags: _zod.z.array(_zod.z.string()) }).optional(), createdBy: _zod.z.object({ email: _zod.z.string(), name: _zod.z.string().optional() }).optional(), silenced: _zod.z.object({ by: _zod.z.string(), at: _zod.z.string(), until: _zod.z.string() }).optional(), executionErrors: _zod.z.array(le2).optional() });
|
|
54541
|
+
var ht2 = exports.Ga = _zod.z.object({ data: _zod.z.array(oe2) });
|
|
54542
|
+
var St2 = exports.Ha = _zod.z.object({ data: oe2 });
|
|
54543
|
+
var bt2 = exports.Ia = _zod.z.object({ data: _zod.z.array(T3) });
|
|
54544
|
+
var yt2 = exports.Ja = _zod.z.object({ data: T3 });
|
|
54545
|
+
var xt2 = exports.Ka = _zod.z.object({ data: T3 });
|
|
54546
|
+
var ft2 = exports.La = _zod.z.object({ message: _zod.z.string() });
|
|
54547
|
+
var Ct2 = exports.Ma = _zod.z.object({ _id: _zod.z.string(), allowedAuthMethods: _zod.z.array(_zod.z.literal("password")).optional(), apiKey: _zod.z.string(), name: _zod.z.string(), createdAt: _zod.z.string() });
|
|
54548
|
+
var Ne2 = exports.Na = _zod.z.object({ _id: _zod.z.string(), email: _zod.z.string(), name: _zod.z.string().optional(), hasPasswordAuth: _zod.z.boolean(), isCurrentUser: _zod.z.boolean(), groupName: _zod.z.string().optional() });
|
|
54549
|
+
var At2 = exports.Oa = _zod.z.object({ data: _zod.z.array(Ne2) });
|
|
54550
|
+
var Ye2 = exports.Pa = _zod.z.object({ _id: _zod.z.string(), createdAt: _zod.z.string(), email: _zod.z.string(), name: _zod.z.string().optional(), url: _zod.z.string() });
|
|
54551
|
+
var Et2 = exports.Qa = _zod.z.object({ data: _zod.z.array(Ye2) });
|
|
54552
|
+
var Tt2 = exports.Ra = _zod.z.object({ data: _zod.z.array(_zod.z.string()) });
|
|
54553
|
+
var Rt2 = exports.Sa = L3.partial();
|
|
54554
|
+
var It2 = exports.Ta = _zod.z.object({ newApiKey: _zod.z.string() });
|
|
54555
|
+
var vt2 = exports.Ua = _zod.z.object({ isTeamExisting: _zod.z.boolean() });
|
|
54556
|
+
var _t2 = exports.Va = _zod.z.object({ accessKey: _zod.z.string(), createdAt: _zod.z.string(), email: _zod.z.string(), id: _zod.z.string(), name: _zod.z.string(), team: Pe2.pick({ id: true, name: true, allowedAuthMethods: true, apiKey: true }).merge(L3), usageStatsEnabled: _zod.z.boolean(), aiAssistantEnabled: _zod.z.boolean() });
|
|
54557
|
+
exports.a = c3;
|
|
54558
|
+
exports.b = Ue2;
|
|
54559
|
+
exports.c = w2;
|
|
54560
|
+
exports.d = f;
|
|
54561
|
+
exports.e = d3;
|
|
54027
54562
|
exports.f = g;
|
|
54028
|
-
exports.g =
|
|
54029
|
-
exports.h =
|
|
54030
|
-
exports.i =
|
|
54031
|
-
exports.j =
|
|
54032
|
-
exports.k =
|
|
54033
|
-
exports.l =
|
|
54563
|
+
exports.g = r;
|
|
54564
|
+
exports.h = C2;
|
|
54565
|
+
exports.i = ie2;
|
|
54566
|
+
exports.j = ne2;
|
|
54567
|
+
exports.k = D3;
|
|
54568
|
+
exports.l = A2;
|
|
54034
54569
|
exports.m = j2;
|
|
54035
|
-
exports.n =
|
|
54570
|
+
exports.n = ae2;
|
|
54036
54571
|
exports.o = re2;
|
|
54037
|
-
exports.p =
|
|
54038
|
-
exports.q =
|
|
54039
|
-
exports.r =
|
|
54040
|
-
exports.s =
|
|
54041
|
-
exports.t =
|
|
54042
|
-
exports.u =
|
|
54043
|
-
exports.v =
|
|
54044
|
-
exports.w =
|
|
54045
|
-
exports.x =
|
|
54046
|
-
exports.y =
|
|
54047
|
-
exports.z =
|
|
54048
|
-
exports.A =
|
|
54049
|
-
exports.B =
|
|
54050
|
-
exports.C =
|
|
54051
|
-
exports.D =
|
|
54052
|
-
exports.E =
|
|
54053
|
-
exports.F =
|
|
54572
|
+
exports.p = E2;
|
|
54573
|
+
exports.q = se2;
|
|
54574
|
+
exports.r = h3;
|
|
54575
|
+
exports.s = M4;
|
|
54576
|
+
exports.t = T3;
|
|
54577
|
+
exports.u = R3;
|
|
54578
|
+
exports.v = pe2;
|
|
54579
|
+
exports.w = S3;
|
|
54580
|
+
exports.x = q3;
|
|
54581
|
+
exports.y = le2;
|
|
54582
|
+
exports.z = B3;
|
|
54583
|
+
exports.A = O3;
|
|
54584
|
+
exports.B = ce2;
|
|
54585
|
+
exports.C = ge2;
|
|
54586
|
+
exports.D = me2;
|
|
54587
|
+
exports.E = ue2;
|
|
54588
|
+
exports.F = de2;
|
|
54054
54589
|
exports.G = W2;
|
|
54055
54590
|
exports.H = F2;
|
|
54056
|
-
exports.I =
|
|
54057
|
-
exports.J =
|
|
54058
|
-
exports.K =
|
|
54591
|
+
exports.I = ye2;
|
|
54592
|
+
exports.J = I3;
|
|
54593
|
+
exports.K = V2;
|
|
54059
54594
|
exports.L = v2;
|
|
54060
|
-
exports.M =
|
|
54061
|
-
exports.N =
|
|
54062
|
-
exports.O =
|
|
54063
|
-
exports.P =
|
|
54064
|
-
exports.Q =
|
|
54065
|
-
exports.R =
|
|
54066
|
-
exports.S =
|
|
54067
|
-
exports.T =
|
|
54068
|
-
exports.U =
|
|
54069
|
-
exports.V =
|
|
54070
|
-
exports.W =
|
|
54071
|
-
exports.X =
|
|
54072
|
-
exports.Y =
|
|
54073
|
-
exports.Z =
|
|
54074
|
-
exports._ =
|
|
54075
|
-
exports.$ =
|
|
54076
|
-
exports.aa =
|
|
54077
|
-
exports.ba =
|
|
54078
|
-
exports.ca =
|
|
54079
|
-
exports.da =
|
|
54080
|
-
exports.ea =
|
|
54081
|
-
exports.fa =
|
|
54082
|
-
exports.ga =
|
|
54083
|
-
exports.ha =
|
|
54084
|
-
exports.ia =
|
|
54085
|
-
exports.ja =
|
|
54086
|
-
exports.ka =
|
|
54087
|
-
exports.la =
|
|
54088
|
-
exports.ma =
|
|
54089
|
-
exports.na =
|
|
54090
|
-
exports.oa =
|
|
54091
|
-
exports.pa =
|
|
54092
|
-
exports.qa =
|
|
54093
|
-
exports.ra =
|
|
54094
|
-
exports.sa =
|
|
54095
|
-
exports.ta =
|
|
54096
|
-
exports.ua =
|
|
54097
|
-
exports.va =
|
|
54098
|
-
exports.wa =
|
|
54099
|
-
exports.xa =
|
|
54100
|
-
exports.ya =
|
|
54101
|
-
exports.za =
|
|
54102
|
-
exports.Aa =
|
|
54103
|
-
exports.Ba =
|
|
54104
|
-
exports.Ca =
|
|
54105
|
-
exports.Da =
|
|
54106
|
-
exports.Ea =
|
|
54107
|
-
exports.Fa =
|
|
54108
|
-
exports.Ga =
|
|
54109
|
-
exports.Ha =
|
|
54110
|
-
exports.Ia =
|
|
54111
|
-
exports.Ja =
|
|
54112
|
-
exports.Ka =
|
|
54113
|
-
exports.La =
|
|
54114
|
-
exports.Ma =
|
|
54115
|
-
exports.Na =
|
|
54116
|
-
exports.Oa =
|
|
54117
|
-
exports.Pa =
|
|
54118
|
-
exports.Qa =
|
|
54119
|
-
exports.Ra =
|
|
54120
|
-
exports.Sa =
|
|
54595
|
+
exports.M = P2;
|
|
54596
|
+
exports.N = Ce2;
|
|
54597
|
+
exports.O = Ae2;
|
|
54598
|
+
exports.P = b2;
|
|
54599
|
+
exports.Q = Ee2;
|
|
54600
|
+
exports.R = et2;
|
|
54601
|
+
exports.S = Te2;
|
|
54602
|
+
exports.T = tt2;
|
|
54603
|
+
exports.U = K3;
|
|
54604
|
+
exports.V = Re2;
|
|
54605
|
+
exports.W = _e2;
|
|
54606
|
+
exports.X = _2;
|
|
54607
|
+
exports.Y = ze2;
|
|
54608
|
+
exports.Z = ot2;
|
|
54609
|
+
exports._ = De2;
|
|
54610
|
+
exports.$ = Z;
|
|
54611
|
+
exports.aa = Me2;
|
|
54612
|
+
exports.ba = qe2;
|
|
54613
|
+
exports.ca = Be2;
|
|
54614
|
+
exports.da = Oe2;
|
|
54615
|
+
exports.ea = z2;
|
|
54616
|
+
exports.fa = X3;
|
|
54617
|
+
exports.ga = it2;
|
|
54618
|
+
exports.ha = We2;
|
|
54619
|
+
exports.ia = Fe2;
|
|
54620
|
+
exports.ja = Ve2;
|
|
54621
|
+
exports.ka = nt2;
|
|
54622
|
+
exports.la = at2;
|
|
54623
|
+
exports.ma = L3;
|
|
54624
|
+
exports.na = Pe2;
|
|
54625
|
+
exports.oa = N2;
|
|
54626
|
+
exports.pa = y3;
|
|
54627
|
+
exports.qa = Y3;
|
|
54628
|
+
exports.ra = J;
|
|
54629
|
+
exports.sa = U2;
|
|
54630
|
+
exports.ta = ee2;
|
|
54631
|
+
exports.ua = te2;
|
|
54632
|
+
exports.va = rt2;
|
|
54633
|
+
exports.wa = st2;
|
|
54634
|
+
exports.xa = pt2;
|
|
54635
|
+
exports.ya = lt2;
|
|
54636
|
+
exports.za = ct2;
|
|
54637
|
+
exports.Aa = gt2;
|
|
54638
|
+
exports.Ba = Ge2;
|
|
54639
|
+
exports.Ca = mt2;
|
|
54640
|
+
exports.Da = ut2;
|
|
54641
|
+
exports.Ea = dt2;
|
|
54642
|
+
exports.Fa = oe2;
|
|
54643
|
+
exports.Ga = ht2;
|
|
54644
|
+
exports.Ha = St2;
|
|
54645
|
+
exports.Ia = bt2;
|
|
54646
|
+
exports.Ja = yt2;
|
|
54647
|
+
exports.Ka = xt2;
|
|
54648
|
+
exports.La = ft2;
|
|
54649
|
+
exports.Ma = Ct2;
|
|
54650
|
+
exports.Na = Ne2;
|
|
54651
|
+
exports.Oa = At2;
|
|
54652
|
+
exports.Pa = Ye2;
|
|
54653
|
+
exports.Qa = Et2;
|
|
54654
|
+
exports.Ra = Tt2;
|
|
54655
|
+
exports.Sa = Rt2;
|
|
54656
|
+
exports.Ta = It2;
|
|
54657
|
+
exports.Ua = vt2;
|
|
54658
|
+
exports.Va = _t2;
|
|
54121
54659
|
}
|
|
54122
54660
|
});
|
|
54123
54661
|
|
|
@@ -54126,106 +54664,109 @@ var require_types2 = __commonJS({
|
|
|
54126
54664
|
"../common-utils/dist/types.js"(exports) {
|
|
54127
54665
|
"use strict";
|
|
54128
54666
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
54129
|
-
var
|
|
54130
|
-
exports.ALERT_INTERVAL_TO_MINUTES =
|
|
54131
|
-
exports.AggregateFunctionSchema =
|
|
54132
|
-
exports.AggregateFunctionWithCombinatorsSchema =
|
|
54133
|
-
exports.AlertApiResponseSchema =
|
|
54134
|
-
exports.AlertBaseObjectSchema =
|
|
54135
|
-
exports.AlertBaseSchema =
|
|
54136
|
-
exports.AlertErrorSchema =
|
|
54137
|
-
exports.AlertErrorType =
|
|
54138
|
-
exports.AlertHistorySchema =
|
|
54139
|
-
exports.AlertIntervalSchema =
|
|
54140
|
-
exports.AlertSchema =
|
|
54141
|
-
exports.AlertSource =
|
|
54142
|
-
exports.AlertState =
|
|
54143
|
-
exports.AlertThresholdType =
|
|
54144
|
-
exports.AlertsApiResponseSchema =
|
|
54145
|
-
exports.AlertsPageItemSchema =
|
|
54146
|
-
exports.AssistantLineTableConfigSchema =
|
|
54147
|
-
exports.AssistantResponseConfig =
|
|
54148
|
-
exports.BaseSourceSchema =
|
|
54149
|
-
exports.ChSqlSchema =
|
|
54150
|
-
exports.ChartAlertBaseSchema =
|
|
54151
|
-
exports.ChartConfigSchema =
|
|
54152
|
-
exports.ConnectionSchema =
|
|
54153
|
-
exports.CteChartConfigSchema =
|
|
54154
|
-
exports.DashboardContainerSchema =
|
|
54155
|
-
exports.
|
|
54156
|
-
exports.
|
|
54157
|
-
exports.
|
|
54158
|
-
exports.
|
|
54159
|
-
exports.
|
|
54160
|
-
exports.
|
|
54161
|
-
exports.
|
|
54162
|
-
exports.
|
|
54163
|
-
exports.
|
|
54164
|
-
exports.
|
|
54165
|
-
exports.
|
|
54166
|
-
exports.
|
|
54167
|
-
exports.
|
|
54168
|
-
exports.
|
|
54169
|
-
exports.
|
|
54170
|
-
exports.
|
|
54171
|
-
exports.
|
|
54172
|
-
exports.
|
|
54173
|
-
exports.
|
|
54174
|
-
exports.
|
|
54175
|
-
exports.
|
|
54176
|
-
exports.
|
|
54177
|
-
exports.
|
|
54178
|
-
exports.
|
|
54179
|
-
exports.
|
|
54180
|
-
exports.
|
|
54181
|
-
exports.
|
|
54182
|
-
exports.
|
|
54183
|
-
exports.
|
|
54184
|
-
exports.
|
|
54185
|
-
exports.
|
|
54186
|
-
exports.
|
|
54187
|
-
exports.
|
|
54188
|
-
exports.
|
|
54189
|
-
exports.
|
|
54190
|
-
exports.
|
|
54191
|
-
exports.
|
|
54192
|
-
exports.
|
|
54193
|
-
exports.
|
|
54194
|
-
exports.
|
|
54195
|
-
exports.
|
|
54196
|
-
exports.
|
|
54197
|
-
exports.
|
|
54198
|
-
exports.
|
|
54199
|
-
exports.
|
|
54200
|
-
exports.
|
|
54201
|
-
exports.
|
|
54202
|
-
exports.
|
|
54203
|
-
exports.
|
|
54204
|
-
exports.
|
|
54205
|
-
exports.
|
|
54206
|
-
exports.
|
|
54207
|
-
exports.
|
|
54208
|
-
exports.
|
|
54209
|
-
exports.
|
|
54210
|
-
exports.
|
|
54211
|
-
exports.
|
|
54212
|
-
exports.
|
|
54213
|
-
exports.
|
|
54214
|
-
exports.
|
|
54215
|
-
exports.
|
|
54216
|
-
exports.
|
|
54217
|
-
exports.
|
|
54218
|
-
exports.
|
|
54219
|
-
exports.
|
|
54220
|
-
exports.
|
|
54221
|
-
exports.
|
|
54222
|
-
exports.
|
|
54223
|
-
exports.
|
|
54224
|
-
exports.
|
|
54225
|
-
exports.
|
|
54226
|
-
exports.
|
|
54227
|
-
exports.
|
|
54228
|
-
exports.
|
|
54667
|
+
var _chunkVXPFG6S4js = require_chunk_VXPFG6S4();
|
|
54668
|
+
exports.ALERT_INTERVAL_TO_MINUTES = _chunkVXPFG6S4js.B;
|
|
54669
|
+
exports.AggregateFunctionSchema = _chunkVXPFG6S4js.h;
|
|
54670
|
+
exports.AggregateFunctionWithCombinatorsSchema = _chunkVXPFG6S4js.j;
|
|
54671
|
+
exports.AlertApiResponseSchema = _chunkVXPFG6S4js.Ha;
|
|
54672
|
+
exports.AlertBaseObjectSchema = _chunkVXPFG6S4js.J;
|
|
54673
|
+
exports.AlertBaseSchema = _chunkVXPFG6S4js.K;
|
|
54674
|
+
exports.AlertErrorSchema = _chunkVXPFG6S4js.y;
|
|
54675
|
+
exports.AlertErrorType = _chunkVXPFG6S4js.x;
|
|
54676
|
+
exports.AlertHistorySchema = _chunkVXPFG6S4js.N;
|
|
54677
|
+
exports.AlertIntervalSchema = _chunkVXPFG6S4js.A;
|
|
54678
|
+
exports.AlertSchema = _chunkVXPFG6S4js.M;
|
|
54679
|
+
exports.AlertSource = _chunkVXPFG6S4js.z;
|
|
54680
|
+
exports.AlertState = _chunkVXPFG6S4js.w;
|
|
54681
|
+
exports.AlertThresholdType = _chunkVXPFG6S4js.u;
|
|
54682
|
+
exports.AlertsApiResponseSchema = _chunkVXPFG6S4js.Ga;
|
|
54683
|
+
exports.AlertsPageItemSchema = _chunkVXPFG6S4js.Fa;
|
|
54684
|
+
exports.AssistantLineTableConfigSchema = _chunkVXPFG6S4js.Da;
|
|
54685
|
+
exports.AssistantResponseConfig = _chunkVXPFG6S4js.Ea;
|
|
54686
|
+
exports.BaseSourceSchema = _chunkVXPFG6S4js.pa;
|
|
54687
|
+
exports.ChSqlSchema = _chunkVXPFG6S4js.q;
|
|
54688
|
+
exports.ChartAlertBaseSchema = _chunkVXPFG6S4js.L;
|
|
54689
|
+
exports.ChartConfigSchema = _chunkVXPFG6S4js.Z;
|
|
54690
|
+
exports.ConnectionSchema = _chunkVXPFG6S4js.la;
|
|
54691
|
+
exports.CteChartConfigSchema = _chunkVXPFG6S4js.Y;
|
|
54692
|
+
exports.DashboardContainerSchema = _chunkVXPFG6S4js.ca;
|
|
54693
|
+
exports.DashboardContainerTabSchema = _chunkVXPFG6S4js.ba;
|
|
54694
|
+
exports.DashboardFilterSchema = _chunkVXPFG6S4js.ea;
|
|
54695
|
+
exports.DashboardFilterType = _chunkVXPFG6S4js.da;
|
|
54696
|
+
exports.DashboardSchema = _chunkVXPFG6S4js.ia;
|
|
54697
|
+
exports.DashboardTemplateSchema = _chunkVXPFG6S4js.ka;
|
|
54698
|
+
exports.DashboardWithoutIdSchema = _chunkVXPFG6S4js.ja;
|
|
54699
|
+
exports.DerivedColumnSchema = _chunkVXPFG6S4js.l;
|
|
54700
|
+
exports.DisplayType = _chunkVXPFG6S4js.c;
|
|
54701
|
+
exports.FilterSchema = _chunkVXPFG6S4js.P;
|
|
54702
|
+
exports.InstallationApiResponseSchema = _chunkVXPFG6S4js.Ua;
|
|
54703
|
+
exports.InternalAggregateFunctionSchema = _chunkVXPFG6S4js.i;
|
|
54704
|
+
exports.LimitSchema = _chunkVXPFG6S4js.p;
|
|
54705
|
+
exports.LogSourceSchema = _chunkVXPFG6S4js.ra;
|
|
54706
|
+
exports.MaterializedViewConfigurationSchema = _chunkVXPFG6S4js.qa;
|
|
54707
|
+
exports.MeApiResponseSchema = _chunkVXPFG6S4js.Va;
|
|
54708
|
+
exports.MetricSourceSchema = _chunkVXPFG6S4js.ua;
|
|
54709
|
+
exports.MetricTableSchema = _chunkVXPFG6S4js.d;
|
|
54710
|
+
exports.MetricsDataType = _chunkVXPFG6S4js.a;
|
|
54711
|
+
exports.MetricsDataTypeSchema = _chunkVXPFG6S4js.b;
|
|
54712
|
+
exports.NumberFormatSchema = _chunkVXPFG6S4js.V;
|
|
54713
|
+
exports.NumericUnit = _chunkVXPFG6S4js.U;
|
|
54714
|
+
exports.OnClickSchema = _chunkVXPFG6S4js.W;
|
|
54715
|
+
exports.PinnedFilterSchema = _chunkVXPFG6S4js.T;
|
|
54716
|
+
exports.PinnedFiltersValueSchema = _chunkVXPFG6S4js.S;
|
|
54717
|
+
exports.PresetDashboard = _chunkVXPFG6S4js.fa;
|
|
54718
|
+
exports.PresetDashboardFilterSchema = _chunkVXPFG6S4js.ga;
|
|
54719
|
+
exports.RootValueExpressionSchema = _chunkVXPFG6S4js.k;
|
|
54720
|
+
exports.RotateApiKeyApiResponseSchema = _chunkVXPFG6S4js.Ta;
|
|
54721
|
+
exports.SQLIntervalSchema = _chunkVXPFG6S4js.e;
|
|
54722
|
+
exports.SavedChartConfigSchema = _chunkVXPFG6S4js._;
|
|
54723
|
+
exports.SavedSearchListApiResponseSchema = _chunkVXPFG6S4js.R;
|
|
54724
|
+
exports.SavedSearchSchema = _chunkVXPFG6S4js.Q;
|
|
54725
|
+
exports.SearchConditionLanguageSchema = _chunkVXPFG6S4js.g;
|
|
54726
|
+
exports.SearchConditionSchema = _chunkVXPFG6S4js.f;
|
|
54727
|
+
exports.SelectListSchema = _chunkVXPFG6S4js.m;
|
|
54728
|
+
exports.SelectSQLStatementSchema = _chunkVXPFG6S4js.r;
|
|
54729
|
+
exports.SessionSourceSchema = _chunkVXPFG6S4js.ta;
|
|
54730
|
+
exports.SortSpecificationListSchema = _chunkVXPFG6S4js.o;
|
|
54731
|
+
exports.SortSpecificationSchema = _chunkVXPFG6S4js.n;
|
|
54732
|
+
exports.SourceKind = _chunkVXPFG6S4js.oa;
|
|
54733
|
+
exports.SourceSchema = _chunkVXPFG6S4js.va;
|
|
54734
|
+
exports.SourceSchemaNoId = _chunkVXPFG6S4js.wa;
|
|
54735
|
+
exports.SqlAstFilterSchema = _chunkVXPFG6S4js.O;
|
|
54736
|
+
exports.TeamApiResponseSchema = _chunkVXPFG6S4js.Ma;
|
|
54737
|
+
exports.TeamClickHouseSettingsSchema = _chunkVXPFG6S4js.ma;
|
|
54738
|
+
exports.TeamInvitationSchema = _chunkVXPFG6S4js.Pa;
|
|
54739
|
+
exports.TeamInvitationsApiResponseSchema = _chunkVXPFG6S4js.Qa;
|
|
54740
|
+
exports.TeamMemberSchema = _chunkVXPFG6S4js.Na;
|
|
54741
|
+
exports.TeamMembersApiResponseSchema = _chunkVXPFG6S4js.Oa;
|
|
54742
|
+
exports.TeamSchema = _chunkVXPFG6S4js.na;
|
|
54743
|
+
exports.TeamTagsApiResponseSchema = _chunkVXPFG6S4js.Ra;
|
|
54744
|
+
exports.TileSchema = _chunkVXPFG6S4js.$;
|
|
54745
|
+
exports.TileTemplateSchema = _chunkVXPFG6S4js.aa;
|
|
54746
|
+
exports.TraceSourceSchema = _chunkVXPFG6S4js.sa;
|
|
54747
|
+
exports.UpdateClickHouseSettingsApiResponseSchema = _chunkVXPFG6S4js.Sa;
|
|
54748
|
+
exports.WebhookCreateApiResponseSchema = _chunkVXPFG6S4js.Ja;
|
|
54749
|
+
exports.WebhookSchema = _chunkVXPFG6S4js.t;
|
|
54750
|
+
exports.WebhookService = _chunkVXPFG6S4js.s;
|
|
54751
|
+
exports.WebhookTestApiResponseSchema = _chunkVXPFG6S4js.La;
|
|
54752
|
+
exports.WebhookUpdateApiResponseSchema = _chunkVXPFG6S4js.Ka;
|
|
54753
|
+
exports.WebhooksApiResponseSchema = _chunkVXPFG6S4js.Ia;
|
|
54754
|
+
exports._ChartConfigSchema = _chunkVXPFG6S4js.X;
|
|
54755
|
+
exports.addDuplicateTileIdIssues = _chunkVXPFG6S4js.ha;
|
|
54756
|
+
exports.getSampleWeightExpression = _chunkVXPFG6S4js.Ba;
|
|
54757
|
+
exports.isLogSource = _chunkVXPFG6S4js.xa;
|
|
54758
|
+
exports.isMetricSource = _chunkVXPFG6S4js.Aa;
|
|
54759
|
+
exports.isRangeThresholdType = _chunkVXPFG6S4js.v;
|
|
54760
|
+
exports.isSessionSource = _chunkVXPFG6S4js.za;
|
|
54761
|
+
exports.isTraceSource = _chunkVXPFG6S4js.ya;
|
|
54762
|
+
exports.pickSampleWeightExpressionProps = _chunkVXPFG6S4js.Ca;
|
|
54763
|
+
exports.scheduleStartAtSchema = _chunkVXPFG6S4js.I;
|
|
54764
|
+
exports.validateAlertScheduleOffsetMinutes = _chunkVXPFG6S4js.G;
|
|
54765
|
+
exports.validateAlertThresholdMax = _chunkVXPFG6S4js.H;
|
|
54766
|
+
exports.zAlertChannel = _chunkVXPFG6S4js.D;
|
|
54767
|
+
exports.zAlertChannelType = _chunkVXPFG6S4js.C;
|
|
54768
|
+
exports.zSavedSearchAlert = _chunkVXPFG6S4js.E;
|
|
54769
|
+
exports.zTileAlert = _chunkVXPFG6S4js.F;
|
|
54229
54770
|
}
|
|
54230
54771
|
});
|
|
54231
54772
|
|
|
@@ -74167,9 +74708,9 @@ var require_object_hash = __commonJS({
|
|
|
74167
74708
|
}
|
|
74168
74709
|
});
|
|
74169
74710
|
|
|
74170
|
-
// ../common-utils/dist/chunk-
|
|
74171
|
-
var
|
|
74172
|
-
"../common-utils/dist/chunk-
|
|
74711
|
+
// ../common-utils/dist/chunk-OEZUGL5F.js
|
|
74712
|
+
var require_chunk_OEZUGL5F = __commonJS({
|
|
74713
|
+
"../common-utils/dist/chunk-OEZUGL5F.js"(exports) {
|
|
74173
74714
|
"use strict";
|
|
74174
74715
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
74175
74716
|
function _interopRequireDefault(obj) {
|
|
@@ -74204,7 +74745,7 @@ var require_chunk_T2T2ZTO4 = __commonJS({
|
|
|
74204
74745
|
return value;
|
|
74205
74746
|
}
|
|
74206
74747
|
var _chunkXSPFZE62js = require_chunk_XSPFZE62();
|
|
74207
|
-
var
|
|
74748
|
+
var _chunkVXPFG6S4js = require_chunk_VXPFG6S4();
|
|
74208
74749
|
var _datefns = (init_esm(), __toCommonJS(esm_exports));
|
|
74209
74750
|
var _datefnstz = require_date_fns_tz();
|
|
74210
74751
|
var _objecthash = require_object_hash();
|
|
@@ -74251,7 +74792,7 @@ var require_chunk_T2T2ZTO4 = __commonJS({
|
|
|
74251
74792
|
let [t2] = e2;
|
|
74252
74793
|
return `toStartOfInterval(toDateTime64(${t2}, 3), INTERVAL ${J()} millisecond)`;
|
|
74253
74794
|
} }, { name: "interval_s", minArgs: 0, maxArgs: 0, replace: () => Q3() }];
|
|
74254
|
-
var De2 = exports.T = [...H4.map(({ name: e2, minArgs: t2, maxArgs: n7 }) => ({ name: e2, minArgs: t2, maxArgs: n7 })), { name: "filters", minArgs: 0, maxArgs: 0 }, { name: "sourceTable", minArgs: 0, maxArgs: 1 }, ...Object.values(
|
|
74795
|
+
var De2 = exports.T = [...H4.map(({ name: e2, minArgs: t2, maxArgs: n7 }) => ({ name: e2, minArgs: t2, maxArgs: n7 })), { name: "filters", minArgs: 0, maxArgs: 0 }, { name: "sourceTable", minArgs: 0, maxArgs: 1 }, ...Object.values(_chunkVXPFG6S4js.a).map((e2) => ({ name: `sourceTable(${e2})`, minArgs: 0, maxArgs: 0 }))];
|
|
74255
74796
|
function X3(e2) {
|
|
74256
74797
|
if (!e2.startsWith("(")) return { args: [], length: 0 };
|
|
74257
74798
|
let t2 = 0, n7 = -1;
|
|
@@ -74284,8 +74825,8 @@ var require_chunk_T2T2ZTO4 = __commonJS({
|
|
|
74284
74825
|
if (l.length === 0 && !n7.tableName) throw new Error("Macro '$__sourceTable' requires a source with a table to be selected when no arguments are provided");
|
|
74285
74826
|
if (l.length === 0) return `\`${n7.databaseName}\`.\`${n7.tableName}\``;
|
|
74286
74827
|
if (!s3) throw new Error("Macro '$__sourceTable(metricType)' with a metric type argument requires a metrics source to be selected");
|
|
74287
|
-
let o =
|
|
74288
|
-
if (!o.success) throw new Error(`Macro '$__sourceTable(metricType)' invalid argument '${l[0]}'. Expected a valid metrics data type (${Object.values(
|
|
74828
|
+
let o = _chunkVXPFG6S4js.b.safeParse(l[0]);
|
|
74829
|
+
if (!o.success) throw new Error(`Macro '$__sourceTable(metricType)' invalid argument '${l[0]}'. Expected a valid metrics data type (${Object.values(_chunkVXPFG6S4js.a).join(", ")}).`);
|
|
74289
74830
|
let c3 = o.data, m3 = s3[c3];
|
|
74290
74831
|
if (!m3) throw new Error(`Macro '$__sourceTable(metricType)': No table configured for metric type '${c3}'.`);
|
|
74291
74832
|
return `\`${n7.databaseName}\`.\`${m3}\``;
|
|
@@ -74424,10 +74965,10 @@ var require_chunk_T2T2ZTO4 = __commonJS({
|
|
|
74424
74965
|
};
|
|
74425
74966
|
function Ye2(e2, t2, n7 = []) {
|
|
74426
74967
|
let s3 = { version: "0.1.0", name: e2.name, tags: e2.tags.length > 0 ? e2.tags : void 0, tiles: [] }, r = (i2, l, o) => {
|
|
74427
|
-
let c3 =
|
|
74968
|
+
let c3 = _chunkVXPFG6S4js.aa.strip().parse(structuredClone(i2)), m3 = c3.config;
|
|
74428
74969
|
return _chunkXSPFZE62js.d.call(void 0, m3) ? m3.source = _nullishCoalesce(l.find((f) => f.id === m3.source), () => ({ name: "" })).name : _chunkXSPFZE62js.c.call(void 0, m3) && (m3.connection = _nullishCoalesce(o.find((f) => f.id === m3.connection), () => ({ name: "" })).name, m3.source && (m3.source = _nullishCoalesce(_optionalChain([l, "access", (_2) => _2.find, "call", (_3) => _3((f) => f.id === m3.source), "optionalAccess", (_4) => _4.name]), () => ""))), c3;
|
|
74429
74970
|
}, a3 = (i2, l) => {
|
|
74430
|
-
let o =
|
|
74971
|
+
let o = _chunkVXPFG6S4js.ea.strip().parse(structuredClone(i2));
|
|
74431
74972
|
return o.source = _nullishCoalesce(_optionalChain([l, "access", (_5) => _5.find, "call", (_6) => _6((c3) => c3.id === i2.source), "optionalAccess", (_7) => _7.name]), () => ""), o;
|
|
74432
74973
|
};
|
|
74433
74974
|
for (let i2 of e2.tiles) s3.tiles.push(r(i2, t2, n7));
|
|
@@ -74681,9 +75222,9 @@ GROUP BY ServiceName, ts`;
|
|
|
74681
75222
|
}
|
|
74682
75223
|
});
|
|
74683
75224
|
|
|
74684
|
-
// ../common-utils/dist/chunk-
|
|
74685
|
-
var
|
|
74686
|
-
"../common-utils/dist/chunk-
|
|
75225
|
+
// ../common-utils/dist/chunk-DICCJULV.js
|
|
75226
|
+
var require_chunk_DICCJULV = __commonJS({
|
|
75227
|
+
"../common-utils/dist/chunk-DICCJULV.js"(exports) {
|
|
74687
75228
|
"use strict";
|
|
74688
75229
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
74689
75230
|
function _nullishCoalesce(lhs, rhsFn) {
|
|
@@ -74735,8 +75276,8 @@ var require_chunk_KPH4R7YV = __commonJS({
|
|
|
74735
75276
|
}
|
|
74736
75277
|
return value;
|
|
74737
75278
|
}
|
|
74738
|
-
var
|
|
74739
|
-
var
|
|
75279
|
+
var _chunkOEZUGL5Fjs = require_chunk_OEZUGL5F();
|
|
75280
|
+
var _chunkVXPFG6S4js = require_chunk_VXPFG6S4();
|
|
74740
75281
|
var _datefns = (init_esm(), __toCommonJS(esm_exports));
|
|
74741
75282
|
async function D3(e2, t2, n7) {
|
|
74742
75283
|
try {
|
|
@@ -74757,7 +75298,7 @@ var require_chunk_KPH4R7YV = __commonJS({
|
|
|
74757
75298
|
return n7 === "count" ? "sum" : await D3(e2, t2, r) ? n7 : `${n7}Merge`;
|
|
74758
75299
|
}
|
|
74759
75300
|
function P2(e2) {
|
|
74760
|
-
return !!e2 &&
|
|
75301
|
+
return !!e2 && _chunkVXPFG6S4js.i.safeParse(e2).success;
|
|
74761
75302
|
}
|
|
74762
75303
|
function G3(e2) {
|
|
74763
75304
|
return e2.aggFn === "quantile" && "level" in e2 && typeof e2.level == "number";
|
|
@@ -74769,11 +75310,11 @@ var require_chunk_KPH4R7YV = __commonJS({
|
|
|
74769
75310
|
if (!t2.granularity && !t2.dateRange) return true;
|
|
74770
75311
|
let n7 = t2.granularity || "auto";
|
|
74771
75312
|
if (n7 === "auto" && !t2.dateRange) return false;
|
|
74772
|
-
let r = n7 === "auto" && t2.dateRange ?
|
|
75313
|
+
let r = n7 === "auto" && t2.dateRange ? _chunkOEZUGL5Fjs.r.call(void 0, t2.dateRange) : n7, s3 = _chunkOEZUGL5Fjs.s.call(void 0, r), u2 = _chunkOEZUGL5Fjs.s.call(void 0, e2.minGranularity);
|
|
74773
75314
|
return s3 >= u2 && s3 % u2 === 0;
|
|
74774
75315
|
}
|
|
74775
75316
|
function k3(e2, t2) {
|
|
74776
|
-
let [n7, r] = e2, s3 =
|
|
75317
|
+
let [n7, r] = e2, s3 = _chunkOEZUGL5Fjs.s.call(void 0, t2), u2 = _datefns.differenceInSeconds.call(void 0, r, n7);
|
|
74777
75318
|
return Math.floor(u2 / s3);
|
|
74778
75319
|
}
|
|
74779
75320
|
function v2(e2, t2) {
|
|
@@ -74811,7 +75352,7 @@ var require_chunk_KPH4R7YV = __commonJS({
|
|
|
74811
75352
|
if (!W2(t2, e2)) return { errors: [e2.granularity ? `Granularity must be a multiple of the view's granularity (${t2.minGranularity}).` : "The selected date range is too short for the granularity of this materialized view."] };
|
|
74812
75353
|
let r = { databaseName: t2.databaseName, tableName: t2.tableName, connectionId: e2.connection }, s3 = await Promise.allSettled(e2.select.map((i2) => $(t2, i2, r, n7))), u2 = [], o = [];
|
|
74813
75354
|
for (let i2 of s3) i2.status === "rejected" ? o.push(i2.reason.message) : u2.push(i2.value);
|
|
74814
|
-
return o.length > 0 ? { errors: o } : { optimizedConfig: { ...structuredClone(e2), select: u2, timestampValueExpression: t2.timestampColumn, from: { databaseName: t2.databaseName, tableName: t2.tableName }, ..."dateRange" in e2 && e2.dateRange ? { dateRangeEndInclusive: false, dateRange:
|
|
75355
|
+
return o.length > 0 ? { errors: o } : { optimizedConfig: { ...structuredClone(e2), select: u2, timestampValueExpression: t2.timestampColumn, from: { databaseName: t2.databaseName, tableName: t2.tableName }, ..."dateRange" in e2 && e2.dateRange ? { dateRangeEndInclusive: false, dateRange: _chunkOEZUGL5Fjs.G.call(void 0, e2.dateRange, t2.minGranularity) } : {} } };
|
|
74815
75356
|
}
|
|
74816
75357
|
async function K3(e2, t2, n7, r, s3, u2) {
|
|
74817
75358
|
let o = [], c3;
|
|
@@ -74858,11 +75399,11 @@ var require_chunk_KPH4R7YV = __commonJS({
|
|
|
74858
75399
|
return `${e2.databaseName}.${e2.tableName}`;
|
|
74859
75400
|
}
|
|
74860
75401
|
async function ie2({ chartConfig: e2, keys: t2, source: n7, clickhouseClient: r, metadata: s3, signal: u2 }) {
|
|
74861
|
-
let o = (
|
|
75402
|
+
let o = (_chunkVXPFG6S4js.ya.call(void 0, n7) || _chunkVXPFG6S4js.xa.call(void 0, n7)) && _optionalChain([n7, "optionalAccess", (_9) => _9.materializedViews]) || [], c3 = new Map(o.map((l) => [x3(l), l])), i2 = /* @__PURE__ */ new Map();
|
|
74862
75403
|
for (let [l, m3] of c3.entries()) {
|
|
74863
75404
|
let g = e2.dateRange ? k3(e2.dateRange, m3.minGranularity) : 1 / 0;
|
|
74864
75405
|
if (v2(m3, e2) && g >= 3) {
|
|
74865
|
-
let f =
|
|
75406
|
+
let f = _chunkOEZUGL5Fjs.k.call(void 0, m3.dimensionColumns), y3 = t2.filter((h3) => f.includes(h3));
|
|
74866
75407
|
y3.length > 0 && i2.set(l, y3);
|
|
74867
75408
|
}
|
|
74868
75409
|
}
|
|
@@ -126931,9 +127472,9 @@ var require_lucene = __commonJS({
|
|
|
126931
127472
|
}
|
|
126932
127473
|
});
|
|
126933
127474
|
|
|
126934
|
-
// ../common-utils/dist/chunk-
|
|
126935
|
-
var
|
|
126936
|
-
"../common-utils/dist/chunk-
|
|
127475
|
+
// ../common-utils/dist/chunk-U65WVHY2.js
|
|
127476
|
+
var require_chunk_U65WVHY2 = __commonJS({
|
|
127477
|
+
"../common-utils/dist/chunk-U65WVHY2.js"(exports) {
|
|
126937
127478
|
"use strict";
|
|
126938
127479
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
126939
127480
|
function _interopRequireWildcard(obj) {
|
|
@@ -126986,10 +127527,10 @@ var require_chunk_6DNB7EDM = __commonJS({
|
|
|
126986
127527
|
var _class;
|
|
126987
127528
|
var _class2;
|
|
126988
127529
|
var _class3;
|
|
126989
|
-
var
|
|
126990
|
-
var
|
|
127530
|
+
var _chunkDICCJULVjs = require_chunk_DICCJULV();
|
|
127531
|
+
var _chunkOEZUGL5Fjs = require_chunk_OEZUGL5F();
|
|
126991
127532
|
var _chunkXSPFZE62js = require_chunk_XSPFZE62();
|
|
126992
|
-
var
|
|
127533
|
+
var _chunkVXPFG6S4js = require_chunk_VXPFG6S4();
|
|
126993
127534
|
var _nodesqlparser = require_node_sql_parser();
|
|
126994
127535
|
var he2 = _interopRequireWildcard(_nodesqlparser);
|
|
126995
127536
|
var Ue2 = _interopRequireWildcard(_nodesqlparser);
|
|
@@ -127111,7 +127652,7 @@ var require_chunk_6DNB7EDM = __commonJS({
|
|
|
127111
127652
|
return `${t2} ${s3 ? "is not" : "is"} between ${n7} and ${r}`;
|
|
127112
127653
|
}
|
|
127113
127654
|
};
|
|
127114
|
-
var oe2 = exports.
|
|
127655
|
+
var oe2 = exports.O = (_class = class {
|
|
127115
127656
|
constructor() {
|
|
127116
127657
|
_class.prototype.__init.call(this);
|
|
127117
127658
|
}
|
|
@@ -127246,7 +127787,7 @@ var require_chunk_6DNB7EDM = __commonJS({
|
|
|
127246
127787
|
if (s3 || i2) return _sqlstring2.default.format(`(lower(?) ${r ? "NOT " : ""}LIKE lower(?))`, [_sqlstring2.default.raw(a3), `${s3 ? "%" : ""}${n7}${i2 ? "%" : ""}`]);
|
|
127247
127788
|
if (f) {
|
|
127248
127789
|
let A2 = await this.enableTextIndexPromise ? await this.findTextIndex(a3) : void 0;
|
|
127249
|
-
if (A2 && _optionalChain([
|
|
127790
|
+
if (A2 && _optionalChain([_chunkOEZUGL5Fjs.L.call(void 0, A2), "optionalAccess", (_9) => _9.type]) === "splitByNonAlpha") {
|
|
127250
127791
|
let T3 = this.tokenizeTerm(n7), F2 = this.termHasSeparators(n7), W2 = _lodash.chunk.call(void 0, T3, Ze2), L3 = W2.map((Ye2) => _sqlstring2.default.format("hasAllTokens(?, ?)", [_sqlstring2.default.raw(a3), Ye2.join(" ")]));
|
|
127251
127792
|
return F2 || W2.length > 1 ? `(${r ? "NOT (" : ""}${[...L3, _sqlstring2.default.format("(lower(?) LIKE lower(?))", [_sqlstring2.default.raw(a3), `%${n7}%`])].join(" AND ")}${r ? ")" : ""})` : `(${r ? "NOT " : ""}${L3.join(" AND ")})`;
|
|
127252
127793
|
}
|
|
@@ -127327,7 +127868,7 @@ var require_chunk_6DNB7EDM = __commonJS({
|
|
|
127327
127868
|
if (t2 === N2 && !r) throw new Error("Can not search bare text without an implicit column set.");
|
|
127328
127869
|
let s3 = t2 === N2 ? r : t2;
|
|
127329
127870
|
if (t2 === N2 && r === this.implicitColumnExpression) {
|
|
127330
|
-
let a3 =
|
|
127871
|
+
let a3 = _chunkOEZUGL5Fjs.k.call(void 0, s3);
|
|
127331
127872
|
return { column: a3.length > 1 ? `concatWithSeparator(';',${a3.join(",")})` : s3, columnJSON: void 0, propertyType: "string", found: true };
|
|
127332
127873
|
}
|
|
127333
127874
|
let i2 = await this.buildColumnExpressionFromField(s3), { type: o, isArray: l } = qe2(i2.columnType);
|
|
@@ -127401,7 +127942,7 @@ var require_chunk_6DNB7EDM = __commonJS({
|
|
|
127401
127942
|
return this.searchQ && this.and(t2), this.conditions.join(" AND ");
|
|
127402
127943
|
}
|
|
127403
127944
|
};
|
|
127404
|
-
async function
|
|
127945
|
+
async function Qt2({ query: e2, metadata: t2, tableConnection: n7 }) {
|
|
127405
127946
|
try {
|
|
127406
127947
|
let { tableName: r, databaseName: s3, connectionId: i2 } = n7, o = ke3(e2);
|
|
127407
127948
|
if (o) {
|
|
@@ -127436,7 +127977,7 @@ var require_chunk_6DNB7EDM = __commonJS({
|
|
|
127436
127977
|
throw new Error(`Unexpected chart config type: ${JSON.stringify(e2)}`);
|
|
127437
127978
|
};
|
|
127438
127979
|
var ct2 = { "=": "!=", ">": "<=", "<": ">=", "!=": "=", "<=": ">", ">=": "<" };
|
|
127439
|
-
function
|
|
127980
|
+
function $r(e2) {
|
|
127440
127981
|
return { ...e2, operator: ct2[e2.operator] };
|
|
127441
127982
|
}
|
|
127442
127983
|
function H4(e2) {
|
|
@@ -127447,7 +127988,7 @@ var require_chunk_6DNB7EDM = __commonJS({
|
|
|
127447
127988
|
}
|
|
127448
127989
|
var He2 = ({ materializedFields: e2, rawSQL: t2 }) => {
|
|
127449
127990
|
try {
|
|
127450
|
-
let [n7] =
|
|
127991
|
+
let [n7] = _chunkOEZUGL5Fjs.I.call(void 0, t2), r = new Ue2.Parser(), s3 = r.astify(n7, { database: "Postgresql" }), i2 = (o) => {
|
|
127451
127992
|
if (o == null) return;
|
|
127452
127993
|
let l;
|
|
127453
127994
|
switch (o.type) {
|
|
@@ -127529,6 +128070,9 @@ var require_chunk_6DNB7EDM = __commonJS({
|
|
|
127529
128070
|
)`;
|
|
127530
128071
|
throw new Error("Column is required for all non-count aggregation functions");
|
|
127531
128072
|
};
|
|
128073
|
+
function mt2(e2, t2) {
|
|
128074
|
+
return t2.seriesReturnType === "ratio" && e2.length === 2;
|
|
128075
|
+
}
|
|
127532
128076
|
async function X3(e2, t2, n7) {
|
|
127533
128077
|
if (typeof e2 == "string") return c3`${{ UNSAFE_RAW_SQL: e2 }}`;
|
|
127534
128078
|
let r;
|
|
@@ -127536,7 +128080,7 @@ var require_chunk_6DNB7EDM = __commonJS({
|
|
|
127536
128080
|
r = G3(t2.with) || !t2.from.databaseName ? void 0 : await n7.getMaterializedColumnsLookupTable({ connectionId: t2.connection, databaseName: t2.from.databaseName, tableName: t2.from.tableName });
|
|
127537
128081
|
} catch (e3) {
|
|
127538
128082
|
}
|
|
127539
|
-
let s3 =
|
|
128083
|
+
let s3 = mt2(e2, t2), i2 = await Promise.all(e2.map(async (o) => {
|
|
127540
128084
|
let l = await M4({ condition: _nullishCoalesce(o.aggCondition, () => ""), from: t2.from, language: _nullishCoalesce(o.aggConditionLanguage, () => "lucene"), implicitColumnExpression: t2.implicitColumnExpression, metadata: n7, connectionId: t2.connection, with: t2.with }), a3;
|
|
127541
128085
|
o.aggFn == null ? a3 = o.valueExpressionLanguage === "lucene" ? await M4({ condition: o.valueExpression, from: t2.from, language: "lucene", implicitColumnExpression: t2.implicitColumnExpression, metadata: n7, connectionId: t2.connection, with: t2.with }) : c3`${{ UNSAFE_RAW_SQL: o.valueExpression }}` : o.aggFn.startsWith("quantile") || o.aggFn.startsWith("histogram") ? a3 = Le2({ fn: o.aggFn, expr: o.valueExpression, level: o.level, where: l.sql, sampleWeightExpression: t2.sampleWeightExpression }) : a3 = Le2({ fn: o.aggFn, expr: o.valueExpression, where: l.sql, sampleWeightExpression: t2.sampleWeightExpression });
|
|
127542
128086
|
let u2 = `SELECT ${a3.sql} FROM \`t\``;
|
|
@@ -127544,32 +128088,32 @@ var require_chunk_6DNB7EDM = __commonJS({
|
|
|
127544
128088
|
}));
|
|
127545
128089
|
return s3 ? [c3`divide(${i2[0]}, ${i2[1]})`] : i2;
|
|
127546
128090
|
}
|
|
127547
|
-
function
|
|
128091
|
+
function pt2(e2) {
|
|
127548
128092
|
return typeof e2 == "string" ? c3`${{ UNSAFE_RAW_SQL: e2 }}` : e2.map((t2) => c3`${{ UNSAFE_RAW_SQL: t2.valueExpression }} ${t2.ordering === "DESC" ? "DESC" : "ASC"}`);
|
|
127549
128093
|
}
|
|
127550
128094
|
function D3({ interval: e2, timestampValueExpression: t2, dateRange: n7, alias: r = ut2 }) {
|
|
127551
|
-
let s3 = { UNSAFE_RAW_SQL:
|
|
128095
|
+
let s3 = { UNSAFE_RAW_SQL: _chunkOEZUGL5Fjs.l.call(void 0, t2) }, i2 = { UNSAFE_RAW_SQL: e2 === "auto" && Array.isArray(n7) ? _chunkOEZUGL5Fjs.r.call(void 0, n7) : e2 };
|
|
127552
128096
|
return c3`toStartOfInterval(toDateTime(${s3}), INTERVAL ${i2}) AS \`${{ UNSAFE_RAW_SQL: r }}\``;
|
|
127553
128097
|
}
|
|
127554
|
-
async function
|
|
128098
|
+
async function gt2({ connectionId: e2, databaseName: t2, dateRange: n7, dateRangeEndInclusive: r, dateRangeStartInclusive: s3, includedDataInterval: i2, metadata: o, tableName: l, timestampValueExpression: a3, with: u2 }) {
|
|
127555
128099
|
let m3 = n7[0].getTime(), p = n7[1].getTime(), g = a3;
|
|
127556
128100
|
try {
|
|
127557
128101
|
if (t2 && l && e2) {
|
|
127558
128102
|
let S3 = await o.getTableMetadata({ databaseName: t2, tableName: l, connectionId: e2 });
|
|
127559
|
-
g =
|
|
128103
|
+
g = _chunkOEZUGL5Fjs.F.call(void 0, a3, _optionalChain([S3, "optionalAccess", (_61) => _61.primary_key]));
|
|
127560
128104
|
}
|
|
127561
128105
|
} catch (S3) {
|
|
127562
128106
|
console.warn("Failed to optimize timestampValueExpression", S3);
|
|
127563
128107
|
}
|
|
127564
|
-
let h3 =
|
|
127565
|
-
let f = S3.trim(), _2 =
|
|
128108
|
+
let h3 = _chunkOEZUGL5Fjs.k.call(void 0, g), y3 = await Promise.all(h3.map(async (S3) => {
|
|
128109
|
+
let f = S3.trim(), _2 = _chunkOEZUGL5Fjs.E.call(void 0, f), A2 = /^toDate\s*\(/.test(f), C2 = G3(u2) || _2 || A2 ? null : await o.getColumn({ databaseName: t2, tableName: l, column: f, connectionId: e2 }), b2 = { UNSAFE_RAW_SQL: f };
|
|
127566
128110
|
C2 == null && G3(u2) && !_2 && !A2 && console.warn(`Column ${f} not found in ${t2}.${l} while inferring type for time filter`);
|
|
127567
128111
|
let I3 = i2 ? c3`toStartOfInterval(fromUnixTimestamp64Milli(${{ Int64: m3 }}), INTERVAL ${i2}) - INTERVAL ${i2}` : _2 ? c3`${_2.function}(fromUnixTimestamp64Milli(${{ Int64: m3 }})${_2.formattedRemainingArgs})` : c3`fromUnixTimestamp64Milli(${{ Int64: m3 }})`, T3 = i2 ? c3`toStartOfInterval(fromUnixTimestamp64Milli(${{ Int64: p }}), INTERVAL ${i2}) + INTERVAL ${i2}` : _2 ? c3`${_2.function}(fromUnixTimestamp64Milli(${{ Int64: p }})${_2.formattedRemainingArgs})` : c3`fromUnixTimestamp64Milli(${{ Int64: p }})`, F2 = _optionalChain([C2, "optionalAccess", (_62) => _62.type]) === "Date" || A2, W2 = s3 || _2 || F2 ? ">=" : ">", L3 = r || _2 || F2 ? "<=" : "<";
|
|
127568
128112
|
return F2 ? c3`(${b2} ${W2} toDate(${I3}) AND ${b2} ${L3} toDate(${T3}))` : c3`(${b2} ${W2} ${I3} AND ${b2} ${L3} ${T3})`;
|
|
127569
128113
|
}));
|
|
127570
128114
|
return E2("AND", ...y3);
|
|
127571
128115
|
}
|
|
127572
|
-
async function
|
|
128116
|
+
async function dt2(e2, t2) {
|
|
127573
128117
|
let n7 = Z(e2), r = me2(e2);
|
|
127574
128118
|
return E2(",", await X3(e2.select, e2, t2), r && e2.selectGroupBy !== false ? await X3(e2.groupBy, e2, t2) : [], n7 ? D3({ interval: e2.granularity, timestampValueExpression: e2.timestampValueExpression, dateRange: e2.dateRange }) : []);
|
|
127575
128119
|
}
|
|
@@ -127604,51 +128148,51 @@ var require_chunk_6DNB7EDM = __commonJS({
|
|
|
127604
128148
|
if (i2.type === "lucene" || i2.type === "sql") return k3(await M4({ condition: i2.condition, from: e2.from, language: i2.type, implicitColumnExpression: e2.implicitColumnExpression, metadata: t2, connectionId: e2.connection, with: e2.with }), "(", ")");
|
|
127605
128149
|
throw new Error(`Unknown filter type: ${i2.type}`);
|
|
127606
128150
|
}));
|
|
127607
|
-
return E2(" AND ", e2.dateRange != null && e2.timestampValueExpression != null ? await
|
|
128151
|
+
return E2(" AND ", e2.dateRange != null && e2.timestampValueExpression != null ? await gt2({ timestampValueExpression: e2.timestampValueExpression, dateRange: e2.dateRange, dateRangeStartInclusive: _nullishCoalesce(e2.dateRangeStartInclusive, () => true), dateRangeEndInclusive: _nullishCoalesce(e2.dateRangeEndInclusive, () => true), metadata: t2, connectionId: e2.connection, databaseName: e2.from.databaseName, tableName: e2.from.tableName, with: e2.with, includedDataInterval: e2.includedDataInterval }) : [], n7, k3(E2(" OR ", r), "(", ")"), k3(E2(e2.filtersLogicalOperator === "OR" ? " OR " : " AND ", ...s3), "(", ")"));
|
|
127608
128152
|
}
|
|
127609
|
-
async function
|
|
128153
|
+
async function ht2(e2, t2) {
|
|
127610
128154
|
return E2(",", me2(e2) ? await X3(e2.groupBy, e2, t2) : [], Z(e2) ? D3({ interval: e2.granularity, timestampValueExpression: e2.timestampValueExpression, dateRange: e2.dateRange }) : []);
|
|
127611
128155
|
}
|
|
127612
|
-
async function
|
|
128156
|
+
async function yt2(e2, t2) {
|
|
127613
128157
|
if (H4(e2.having)) return await M4({ condition: e2.having, from: e2.from, language: _nullishCoalesce(e2.havingLanguage, () => "sql"), implicitColumnExpression: e2.implicitColumnExpression, metadata: t2, connectionId: e2.connection, with: e2.with });
|
|
127614
128158
|
}
|
|
127615
|
-
function
|
|
128159
|
+
function ft2(e2) {
|
|
127616
128160
|
let t2 = Z(e2);
|
|
127617
|
-
if (!(e2.orderBy == null && !t2)) return E2(",", t2 ? D3({ interval: e2.granularity, timestampValueExpression: e2.timestampValueExpression, dateRange: e2.dateRange }) : [], e2.orderBy != null ?
|
|
128161
|
+
if (!(e2.orderBy == null && !t2)) return E2(",", t2 ? D3({ interval: e2.granularity, timestampValueExpression: e2.timestampValueExpression, dateRange: e2.dateRange }) : [], e2.orderBy != null ? pt2(e2.orderBy) : []);
|
|
127618
128162
|
}
|
|
127619
|
-
function
|
|
128163
|
+
function St2(e2) {
|
|
127620
128164
|
if (e2.limit == null || e2.limit.limit == null) return;
|
|
127621
128165
|
let t2 = e2.limit.offset != null ? c3` OFFSET ${{ Int32: e2.limit.offset }}` : [];
|
|
127622
128166
|
return c3`${{ Int32: e2.limit.limit }}${t2}`;
|
|
127623
128167
|
}
|
|
127624
|
-
function
|
|
127625
|
-
let n7 =
|
|
128168
|
+
function _t2(e2, t2) {
|
|
128169
|
+
let n7 = _chunkOEZUGL5Fjs.K.call(void 0, t2);
|
|
127626
128170
|
return E2(", ", [c3`${_nullishCoalesce(e2.settings, () => "")}`, c3`${_nullishCoalesce(n7, () => "")}`]);
|
|
127627
128171
|
}
|
|
127628
|
-
async function
|
|
128172
|
+
async function Et2(e2, t2, n7) {
|
|
127629
128173
|
let { with: r } = e2;
|
|
127630
128174
|
if (r) return E2(",", await Promise.all(r.map(async (s3) => {
|
|
127631
128175
|
let { sql: i2, chartConfig: o } = s3;
|
|
127632
128176
|
if (i2 && o) throw new Error("cannot specify both 'sql' and 'chartConfig' in with clause");
|
|
127633
128177
|
if (!(i2 || o)) throw new Error("must specify either 'sql' or 'chartConfig' in with clause");
|
|
127634
|
-
if (i2 && !
|
|
127635
|
-
if (o && !
|
|
128178
|
+
if (i2 && !_chunkVXPFG6S4js.q.safeParse(i2).success) throw new Error("non-conforming sql object in CTE");
|
|
128179
|
+
if (o && !_chunkVXPFG6S4js.Z.safeParse(o).success) throw new Error(`non-conforming chartConfig object in CTE: ${_chunkVXPFG6S4js.Z.safeParse(o).error}`);
|
|
127636
128180
|
let l = i2 || await w2(o, t2, n7);
|
|
127637
128181
|
return s3.isSubquery === false ? c3`(${l}) AS ${{ Identifier: s3.name }}` : c3`${s3.name} AS (${l})`;
|
|
127638
128182
|
})));
|
|
127639
128183
|
}
|
|
127640
|
-
function
|
|
127641
|
-
let n7 = e2.granularity === "auto" && Array.isArray(e2.dateRange) ?
|
|
128184
|
+
function xt2(e2, t2) {
|
|
128185
|
+
let n7 = e2.granularity === "auto" && Array.isArray(e2.dateRange) ? _chunkOEZUGL5Fjs.r.call(void 0, e2.dateRange) : e2.granularity, r = _chunkOEZUGL5Fjs.s.call(void 0, _nullishCoalesce(n7, () => "")), s3 = `(argMax(${t2}, ${e2.timestampValueExpression}) - argMin(${t2}, ${e2.timestampValueExpression}))`, i2 = `date_diff('second', min(toDateTime(${e2.timestampValueExpression})), max(toDateTime(${e2.timestampValueExpression})))`;
|
|
127642
128186
|
return `IF(${i2} > 0, ${s3} * ${r} / ${i2}, 0)`;
|
|
127643
128187
|
}
|
|
127644
|
-
async function
|
|
128188
|
+
async function $t(e2, t2) {
|
|
127645
128189
|
let n7 = e2.metricTables;
|
|
127646
128190
|
if (!n7) return e2;
|
|
127647
128191
|
let { select: r, from: s3, filters: i2, where: o, ...l } = e2;
|
|
127648
128192
|
if (!r || !Array.isArray(r)) throw new Error("multi select or string select on metrics not supported");
|
|
127649
128193
|
let { metricType: a3, metricName: u2, metricNameSql: m3, ...p } = r[0];
|
|
127650
128194
|
if (a3 === "gauge" && u2 && "gauge" in n7 && n7.gauge) {
|
|
127651
|
-
let g = "__hdx_time_bucket2", h3 = D3({ interval: e2.granularity || "auto", timestampValueExpression: e2.timestampValueExpression || lt2, dateRange: e2.dateRange, alias: g }), y3 = await Y3({ ...e2, from: { ...s3, tableName: n7.gauge }, filters: [..._nullishCoalesce(i2, () => []), { type: "sql", condition: ce2(u2, m3) }] }, t2), S3 = p.isDelta ?
|
|
128195
|
+
let g = "__hdx_time_bucket2", h3 = D3({ interval: e2.granularity || "auto", timestampValueExpression: e2.timestampValueExpression || lt2, dateRange: e2.dateRange, alias: g }), y3 = await Y3({ ...e2, from: { ...s3, tableName: n7.gauge }, filters: [..._nullishCoalesce(i2, () => []), { type: "sql", condition: ce2(u2, m3) }] }, t2), S3 = p.isDelta ? xt2(e2, "Value") : "last_value(Value)";
|
|
127652
128196
|
return { ...l, with: [{ name: "Source", sql: c3`
|
|
127653
128197
|
SELECT
|
|
127654
128198
|
*,
|
|
@@ -127678,7 +128222,7 @@ var require_chunk_6DNB7EDM = __commonJS({
|
|
|
127678
128222
|
ORDER BY AttributesHash, ${g}
|
|
127679
128223
|
` }], select: [{ ...p, valueExpression: "LastValue", aggCondition: "" }], from: { databaseName: "", tableName: "Bucketed" }, where: "", timestampValueExpression: g, settings: c3`short_circuit_function_evaluation = 'force_enable'` };
|
|
127680
128224
|
} else if (a3 === "sum" && u2 && "sum" in n7 && n7.sum) {
|
|
127681
|
-
let g = "__hdx_time_bucket2", h3 = "`__hdx_value_high`", y3 = "`__hdx_value_high_prev`", S3 = D3({ interval: e2.granularity || "auto", timestampValueExpression: e2.timestampValueExpression || "TimeUnix", dateRange: e2.dateRange, alias: g }), f = await Y3({ ...e2, from: { ...s3, tableName: n7.sum }, filters: [..._nullishCoalesce(i2, () => []), { type: "sql", condition: ce2(u2, m3) }], includedDataInterval: e2.granularity === "auto" && Array.isArray(e2.dateRange) ?
|
|
128225
|
+
let g = "__hdx_time_bucket2", h3 = "`__hdx_value_high`", y3 = "`__hdx_value_high_prev`", S3 = D3({ interval: e2.granularity || "auto", timestampValueExpression: e2.timestampValueExpression || "TimeUnix", dateRange: e2.dateRange, alias: g }), f = await Y3({ ...e2, from: { ...s3, tableName: n7.sum }, filters: [..._nullishCoalesce(i2, () => []), { type: "sql", condition: ce2(u2, m3) }], includedDataInterval: e2.granularity === "auto" && Array.isArray(e2.dateRange) ? _chunkOEZUGL5Fjs.r.call(void 0, e2.dateRange) : e2.granularity }, t2);
|
|
127682
128226
|
return { ...l, with: [{ name: "Source", sql: c3`
|
|
127683
128227
|
SELECT
|
|
127684
128228
|
*,
|
|
@@ -127721,12 +128265,12 @@ var require_chunk_6DNB7EDM = __commonJS({
|
|
|
127721
128265
|
ORDER BY AttributesHash, \`${g}\`
|
|
127722
128266
|
` }], select: [p.aggFn ? { alias: "Value", ...p, valueExpression: "Rate", aggCondition: "" } : { alias: "Value", ...p, valueExpression: "last_value(Sum)", aggCondition: "" }], from: { databaseName: "", tableName: "Bucketed" }, where: "", timestampValueExpression: `\`${g}\`` };
|
|
127723
128267
|
} else if (a3 === "histogram" && u2 && "histogram" in n7 && n7.histogram) {
|
|
127724
|
-
let { alias: g } = p, h3 = g || "Value", y3 = { ...e2, from: { ...s3, tableName: n7.histogram }, filters: [..._nullishCoalesce(i2, () => []), { type: "sql", condition: ce2(u2, m3) }], includedDataInterval: e2.granularity === "auto" && Array.isArray(e2.dateRange) ?
|
|
128268
|
+
let { alias: g } = p, h3 = g || "Value", y3 = { ...e2, from: { ...s3, tableName: n7.histogram }, filters: [..._nullishCoalesce(i2, () => []), { type: "sql", condition: ce2(u2, m3) }], includedDataInterval: e2.granularity === "auto" && Array.isArray(e2.dateRange) ? _chunkOEZUGL5Fjs.r.call(void 0, e2.dateRange) : e2.granularity }, S3 = Z(y3) ? D3({ interval: y3.granularity, timestampValueExpression: y3.timestampValueExpression, dateRange: y3.dateRange }) : c3``, f = await Y3(y3, t2), _2;
|
|
127725
128269
|
return me2(e2) && (_2 = E2(",", await X3(e2.groupBy, e2, t2))), { ...l, with: ve2({ select: p, timeBucketSelect: S3.sql ? c3`${S3}` : "TimeUnix AS `__hdx_time_bucket`", groupBy: _2, from: K3({ from: { ...s3, tableName: n7.histogram } }), where: f, valueAlias: h3 }), select: `\`__hdx_time_bucket\`${_2 ? ", group" : ""}, "${h3}"`, from: { databaseName: "", tableName: "metrics" }, where: "", groupBy: void 0, granularity: void 0, timestampValueExpression: "`__hdx_time_bucket`", settings: c3`short_circuit_function_evaluation = 'force_enable'` };
|
|
127726
128270
|
}
|
|
127727
128271
|
throw new Error(`no query support for metric type=${a3}`);
|
|
127728
128272
|
}
|
|
127729
|
-
async function
|
|
128273
|
+
async function At2(e2, t2) {
|
|
127730
128274
|
if (!_optionalChain([e2, "access", (_63) => _63.filters, "optionalAccess", (_64) => _64.length]) || !e2.source || !e2.from) return;
|
|
127731
128275
|
let n7 = (await Promise.all(e2.filters.map(async (r) => {
|
|
127732
128276
|
let s3 = e2.from && e2.from.tableName && e2.source;
|
|
@@ -127739,18 +128283,18 @@ var require_chunk_6DNB7EDM = __commonJS({
|
|
|
127739
128283
|
}))).filter((r) => r !== void 0);
|
|
127740
128284
|
return n7.length > 0 ? `(${n7.join(" AND ")})` : void 0;
|
|
127741
128285
|
}
|
|
127742
|
-
async function
|
|
127743
|
-
let n7 = _nullishCoalesce(e2.displayType, () => "table"), r = await
|
|
128286
|
+
async function Ct2(e2, t2) {
|
|
128287
|
+
let n7 = _nullishCoalesce(e2.displayType, () => "table"), r = await At2(e2, t2), s3 = _chunkOEZUGL5Fjs.U.call(void 0, e2, r), i2 = _chunkOEZUGL5Fjs.c[n7];
|
|
127744
128288
|
return { sql: s3, params: Object.fromEntries(i2.map((o) => [o.name, o.get(e2)])) };
|
|
127745
128289
|
}
|
|
127746
128290
|
async function w2(e2, t2, n7) {
|
|
127747
|
-
if (_chunkXSPFZE62js.a.call(void 0, e2)) return
|
|
127748
|
-
let r = pe2(e2) ? await
|
|
128291
|
+
if (_chunkXSPFZE62js.a.call(void 0, e2)) return Ct2(e2, t2);
|
|
128292
|
+
let r = pe2(e2) ? await $t(e2, t2) : e2, s3 = await Et2(r, t2, n7), i2 = await dt2(r, t2), o = K3(r), l = await Y3(r, t2), a3 = await ht2(r, t2), u2 = await yt2(r, t2), m3 = ft2(r), p = St2(r), g = _t2(r, n7);
|
|
127749
128293
|
return E2(" ", [c3`${_optionalChain([s3, "optionalAccess", (_65) => _65.sql]) ? c3`WITH ${s3}` : ""}`, c3`SELECT ${i2}`, c3`FROM ${o}`, c3`${l.sql ? c3`WHERE ${l}` : ""}`, c3`${_optionalChain([a3, "optionalAccess", (_66) => _66.sql]) ? c3`GROUP BY ${a3}` : ""}`, c3`${_optionalChain([u2, "optionalAccess", (_67) => _67.sql]) ? c3`HAVING ${u2}` : ""}`, c3`${_optionalChain([m3, "optionalAccess", (_68) => _68.sql]) ? c3`ORDER BY ${m3}` : ""}`, c3`${_optionalChain([p, "optionalAccess", (_69) => _69.sql]) ? c3`LIMIT ${p}` : ""}`, c3`${g.sql ? c3`SETTINGS ${g}` : []}`]);
|
|
127750
128294
|
}
|
|
127751
128295
|
var Q3 = 3e6;
|
|
127752
128296
|
var Je2 = 1e3;
|
|
127753
|
-
var ge2 = exports.
|
|
128297
|
+
var ge2 = exports.o = (_class2 = class {
|
|
127754
128298
|
constructor() {
|
|
127755
128299
|
_class2.prototype.__init2.call(this);
|
|
127756
128300
|
_class2.prototype.__init3.call(this);
|
|
@@ -127781,7 +128325,7 @@ var require_chunk_6DNB7EDM = __commonJS({
|
|
|
127781
128325
|
return this.cache.set(t2, n7);
|
|
127782
128326
|
}
|
|
127783
128327
|
}, _class2);
|
|
127784
|
-
var P2 = exports.
|
|
128328
|
+
var P2 = exports.p = class {
|
|
127785
128329
|
constructor(t2, n7, r) {
|
|
127786
128330
|
this.clickhouseClient = t2, this.cache = n7, r && this.cache.set("clickhouse-settings", r);
|
|
127787
128331
|
}
|
|
@@ -127907,7 +128451,7 @@ var require_chunk_6DNB7EDM = __commonJS({
|
|
|
127907
128451
|
async getTableMetadata({ databaseName: t2, tableName: n7, connectionId: r }) {
|
|
127908
128452
|
let s3 = await this.queryTableMetadata({ cache: this.cache, database: t2, table: n7, connectionId: r });
|
|
127909
128453
|
if (_optionalChain([s3, "optionalAccess", (_74) => _74.engine]) === "Distributed") try {
|
|
127910
|
-
let { cluster: i2, database: o, table: l } = _nullishCoalesce(
|
|
128454
|
+
let { cluster: i2, database: o, table: l } = _nullishCoalesce(_chunkOEZUGL5Fjs.N.call(void 0, s3), () => ({}));
|
|
127911
128455
|
if (!o || !l || !i2) throw new Error(`Could not parse underlying local table from Distributed table metadata: ${s3.create_table_query}`);
|
|
127912
128456
|
let a3 = await this.queryTableMetadata({ cache: this.cache, database: o, table: l, cluster: i2, connectionId: r });
|
|
127913
128457
|
if (!a3) throw new Error(`Could not find underlying local table metadata for Distributed table: ${o}.${l}`);
|
|
@@ -127952,7 +128496,7 @@ var require_chunk_6DNB7EDM = __commonJS({
|
|
|
127952
128496
|
return this.cache.getOrFetch(`${r}.${t2}.${n7}.skipIndices`, async () => {
|
|
127953
128497
|
let s3 = await this.queryTableMetadata({ cache: this.cache, database: t2, table: n7, connectionId: r }), i2 = t2, o = n7, l;
|
|
127954
128498
|
if (_optionalChain([s3, "optionalAccess", (_79) => _79.engine]) === "Distributed") {
|
|
127955
|
-
let a3 =
|
|
128499
|
+
let a3 = _chunkOEZUGL5Fjs.N.call(void 0, s3);
|
|
127956
128500
|
a3 ? (i2 = a3.database, o = a3.table, l = a3.cluster) : console.error(`Could not parse local table from Distributed table metadata: ${s3.create_table_query}`);
|
|
127957
128501
|
}
|
|
127958
128502
|
try {
|
|
@@ -127999,14 +128543,14 @@ var require_chunk_6DNB7EDM = __commonJS({
|
|
|
127999
128543
|
}
|
|
128000
128544
|
async getValuesDistribution({ chartConfig: t2, key: n7, samples: r = 1e5, limit: s3 = 100, source: i2 }) {
|
|
128001
128545
|
let o = _lodash.pick.call(void 0, t2, ["connection", "from", "dateRange", "filters", "where", "with"]);
|
|
128002
|
-
return this.cache.getOrFetch(`${
|
|
128546
|
+
return this.cache.getOrFetch(`${_chunkOEZUGL5Fjs.S.call(void 0, o)}.${n7}.valuesDistribution`, async () => {
|
|
128003
128547
|
let l = { ...t2, with: [...t2.with || [], { name: "tableStats", chartConfig: { ..._lodash.omit.call(void 0, t2, ["with", "groupBy", "orderBy", "limit"]), select: `count() as total, greatest(CAST(total / ${r} AS UInt32), 1) as sample_factor` } }], filters: [...t2.filters || [], { type: "sql", condition: `cityHash64(${t2.timestampValueExpression}, rand()) % (SELECT sample_factor FROM tableStats) = 0` }], select: `${n7} AS __hdx_value, count() as __hdx_count, __hdx_count / (sum(__hdx_count) OVER ()) * 100 AS __hdx_percentage`, orderBy: "__hdx_percentage DESC", groupBy: "__hdx_value", limit: { limit: s3 } }, a3 = await w2(l, this, _optionalChain([i2, "optionalAccess", (_80) => _80.querySettings])), u2 = await this.clickhouseClient.query({ query: a3.sql, query_params: a3.params, connectionId: t2.connection, clickhouse_settings: { ...this.getClickHouseSettings(), max_rows_to_group_by: `${s3 * 10}`, group_by_overflow_mode: "any", max_rows_to_read: "0" } }).then((m3) => m3.json());
|
|
128004
128548
|
return new Map(u2.data.map(({ __hdx_value: m3, __hdx_percentage: p }) => [m3, Number(p)]));
|
|
128005
128549
|
});
|
|
128006
128550
|
}
|
|
128007
128551
|
async getKeyValues({ chartConfig: t2, keys: n7, limit: r = 20, disableRowLimit: s3 = false, signal: i2, source: o }) {
|
|
128008
128552
|
let l = { ..._lodash.pick.call(void 0, t2, ["connection", "from", "dateRange", "where", "with", "filters"]), keys: n7, disableRowLimit: s3 };
|
|
128009
|
-
return this.cache.getOrFetch(`${
|
|
128553
|
+
return this.cache.getOrFetch(`${_chunkOEZUGL5Fjs.S.call(void 0, l)}.getKeyValues`, async () => {
|
|
128010
128554
|
if (n7.length === 0) return [];
|
|
128011
128555
|
let a3 = s3 ? { ...t2, select: n7.map((p, g) => `groupUniqArray(${r})(${p}) AS param${g}`).join(", ") } : await (async () => {
|
|
128012
128556
|
let p = n7.map((g, h3) => `${g} as param${h3}`).join(", ") || "*";
|
|
@@ -128017,66 +128561,66 @@ var require_chunk_6DNB7EDM = __commonJS({
|
|
|
128017
128561
|
}
|
|
128018
128562
|
async getKeyValuesWithMVs({ chartConfig: t2, keys: n7, source: r, limit: s3 = 20, disableRowLimit: i2, signal: o }) {
|
|
128019
128563
|
let l = { ..._lodash.pick.call(void 0, t2, ["connection", "from", "dateRange", "where", "with", "filters"]), keys: n7, disableRowLimit: i2 };
|
|
128020
|
-
return this.cache.getOrFetch(`${
|
|
128564
|
+
return this.cache.getOrFetch(`${_chunkOEZUGL5Fjs.S.call(void 0, l)}.getKeyValuesWithMVs`, async () => {
|
|
128021
128565
|
if (n7.length === 0) return [];
|
|
128022
|
-
let a3 = { chartConfig: t2, keys: n7 }, m3 = r && (r.kind === "log" || r.kind === "trace") ? await
|
|
128566
|
+
let a3 = { chartConfig: t2, keys: n7 }, m3 = r && (r.kind === "log" || r.kind === "trace") ? await _chunkDICCJULVjs.e.call(void 0, { chartConfig: t2, keys: n7, source: r, clickhouseClient: this.clickhouseClient, metadata: this, signal: o }) : [a3];
|
|
128023
128567
|
return (await Promise.all(m3.map(async ({ chartConfig: g, keys: h3 }) => this.getKeyValues({ chartConfig: g, keys: h3, limit: s3, disableRowLimit: i2, signal: o, source: r })))).flat();
|
|
128024
128568
|
});
|
|
128025
128569
|
}
|
|
128026
128570
|
};
|
|
128027
|
-
function
|
|
128571
|
+
function Dr(e2) {
|
|
128028
128572
|
return { databaseName: _nullishCoalesce(_optionalChain([e2, "optionalAccess", (_86) => _86.from, "optionalAccess", (_87) => _87.databaseName]), () => ""), tableName: _nullishCoalesce(_optionalChain([e2, "optionalAccess", (_88) => _88.from, "optionalAccess", (_89) => _89.tableName]), () => ""), connectionId: _nullishCoalesce(_optionalChain([e2, "optionalAccess", (_90) => _90.connection]), () => "") };
|
|
128029
128573
|
}
|
|
128030
|
-
function
|
|
128574
|
+
function Mr(e2) {
|
|
128031
128575
|
return { databaseName: _nullishCoalesce(_optionalChain([e2, "optionalAccess", (_91) => _91.from, "optionalAccess", (_92) => _92.databaseName]), () => ""), tableName: _nullishCoalesce(_optionalChain([e2, "optionalAccess", (_93) => _93.from, "optionalAccess", (_94) => _94.tableName]), () => ""), connectionId: _nullishCoalesce(_optionalChain([e2, "optionalAccess", (_95) => _95.connection]), () => "") };
|
|
128032
128576
|
}
|
|
128033
|
-
var
|
|
128034
|
-
var ze2 = exports.
|
|
128577
|
+
var Tt2 = new ge2();
|
|
128578
|
+
var ze2 = exports.s = (e2) => new P2(e2, Tt2);
|
|
128035
128579
|
var ue2 = ((u2) => (u2.Array = "array", u2.Date = "date", u2.Map = "map", u2.Number = "number", u2.String = "string", u2.Tuple = "tuple", u2.Bool = "bool", u2.JSON = "json", u2.Dynamic = "dynamic", u2))(ue2 || {});
|
|
128036
|
-
var
|
|
128580
|
+
var Hr = exports.u = (e2) => {
|
|
128037
128581
|
let t2 = {};
|
|
128038
128582
|
return e2.headers.forEach((n7, r) => {
|
|
128039
128583
|
t2[r] = n7;
|
|
128040
128584
|
}), t2;
|
|
128041
128585
|
};
|
|
128042
|
-
var x3 = exports.
|
|
128043
|
-
var
|
|
128044
|
-
var B3 = exports.
|
|
128586
|
+
var x3 = exports.v = (e2) => e2.startsWith("Date") ? "date" : e2.startsWith("Tuple") ? "tuple" : e2.startsWith("Map") ? "map" : e2.startsWith("Array") ? "array" : e2.startsWith("Int") || e2.startsWith("UInt") || e2.startsWith("Float") || e2.startsWith("Nullable(Int") || e2.startsWith("Nullable(UInt") || e2.startsWith("Nullable(Float") ? "number" : e2.startsWith("String") || e2.startsWith("Nullable(String)") || e2.startsWith("FixedString") || e2.startsWith("Enum") || e2.startsWith("UUID") || e2.startsWith("IPv4") || e2.startsWith("IPv6") ? "string" : e2 === "Bool" ? "bool" : e2.startsWith("JSON") ? "json" : e2.startsWith("Dynamic") ? "dynamic" : e2.startsWith("LowCardinality") ? x3(e2.slice(15, -1)) : e2.startsWith("Nullable(") ? x3(e2.slice(9, -1)) : null;
|
|
128587
|
+
var Qr = exports.w = (e2) => e2 === "map" || e2 === "array" || e2 === "json" || e2 === "tuple" || e2 === "dynamic";
|
|
128588
|
+
var B3 = exports.x = (e2) => {
|
|
128045
128589
|
if (e2.trim().startsWith("Array(") && e2.trim().endsWith(")")) {
|
|
128046
128590
|
let t2 = e2.trim().slice(6, -1);
|
|
128047
128591
|
return x3(t2);
|
|
128048
128592
|
}
|
|
128049
128593
|
return null;
|
|
128050
128594
|
};
|
|
128051
|
-
var qe2 = exports.
|
|
128595
|
+
var qe2 = exports.y = (e2) => {
|
|
128052
128596
|
let t2 = x3(e2), n7 = t2 === "array";
|
|
128053
128597
|
if (t2 === "map" || t2 === "tuple") throw new Error("Map or Tuple types cannot be searched with Lucene.");
|
|
128054
128598
|
return t2 === "date" ? t2 = "number" : t2 === "array" && B3(e2) && (t2 = B3(e2)), { type: t2, isArray: n7 };
|
|
128055
128599
|
};
|
|
128056
|
-
var
|
|
128057
|
-
var $ = (e2) => `HYPERDX_PARAM_${
|
|
128058
|
-
var c3 = exports.
|
|
128600
|
+
var wt2 = (e2) => Math.abs(_chunkOEZUGL5Fjs.q.call(void 0, `${e2}`));
|
|
128601
|
+
var $ = (e2) => `HYPERDX_PARAM_${wt2(e2)}`;
|
|
128602
|
+
var c3 = exports.z = (e2, ...t2) => ({ sql: e2.map((r, s3) => {
|
|
128059
128603
|
let i2 = t2[s3];
|
|
128060
128604
|
return r + (i2 == null ? "" : typeof i2 == "string" ? i2 : "UNSAFE_RAW_SQL" in i2 ? i2.UNSAFE_RAW_SQL : Array.isArray(i2) ? i2.map((o) => o.sql).join("") : "sql" in i2 ? i2.sql : "Identifier" in i2 ? `{${$(i2.Identifier)}:Identifier}` : "String" in i2 ? `{${$(i2.String)}:String}` : "Float32" in i2 ? `{${$(i2.Float32)}:Float32}` : "Float64" in i2 ? `{${$(i2.Float64)}:Float64}` : "Int32" in i2 ? `{${$(i2.Int32)}:Int32}` : "Int64" in i2 ? `{${$(i2.Int64)}:Int64}` : "");
|
|
128061
128605
|
}).join(""), params: t2.reduce((r, s3) => ({ ...r, ...s3 == null || typeof s3 == "string" || "UNSAFE_RAW_SQL" in s3 ? {} : Array.isArray(s3) ? s3.reduce((i2, o) => (Object.assign(i2, o.params), i2), {}) : "params" in s3 ? s3.params : "Identifier" in s3 ? { [$(s3.Identifier)]: s3.Identifier } : "String" in s3 ? { [$(s3.String)]: s3.String } : "Float32" in s3 ? { [$(s3.Float32)]: s3.Float32 } : "Float64" in s3 ? { [$(s3.Float64)]: s3.Float64 } : "Int32" in s3 ? { [$(s3.Int32)]: s3.Int32 } : "Int64" in s3 ? { [$(s3.Int64)]: s3.Int64 } : {} }), {}) });
|
|
128062
|
-
var E2 = exports.
|
|
128606
|
+
var E2 = exports.A = (e2, ...t2) => t2.reduce((n7, r) => {
|
|
128063
128607
|
if (Array.isArray(r)) {
|
|
128064
128608
|
if (r.length === 0) return n7;
|
|
128065
128609
|
n7.sql += (n7.sql.length > 0 ? e2 : "") + r.map((s3) => s3.sql).filter(Boolean).join(e2), n7.params = r.reduce((s3, i2) => (Object.assign(s3, i2.params), s3), n7.params);
|
|
128066
128610
|
} else r.sql.length > 0 && (n7.sql += `${n7.sql.length > 0 ? e2 : ""}${r.sql}`, Object.assign(n7.params, r.params));
|
|
128067
128611
|
return n7;
|
|
128068
128612
|
}, { sql: "", params: {} });
|
|
128069
|
-
var
|
|
128070
|
-
var k3 = exports.
|
|
128071
|
-
var re2 = exports.
|
|
128613
|
+
var Rt2 = (e2) => Array.isArray(e2) ? e2.every((t2) => t2.sql.length === 0) : e2.sql.length === 0;
|
|
128614
|
+
var k3 = exports.B = (e2, t2, n7) => Rt2(e2) ? [] : c3`${t2}${e2}${n7}`;
|
|
128615
|
+
var re2 = exports.C = class extends Error {
|
|
128072
128616
|
constructor(n7, r) {
|
|
128073
128617
|
super(n7);
|
|
128074
128618
|
this.query = r;
|
|
128075
128619
|
this.name = "ClickHouseQueryError";
|
|
128076
128620
|
}
|
|
128077
128621
|
};
|
|
128078
|
-
var
|
|
128079
|
-
let t2 = new he2.Parser(), n7 =
|
|
128622
|
+
var Jr = exports.D = (e2) => {
|
|
128623
|
+
let t2 = new he2.Parser(), n7 = _chunkOEZUGL5Fjs.k.call(void 0, e2);
|
|
128080
128624
|
return _optionalChain([n7, "optionalAccess", (_96) => _96.length]) ? n7.flatMap((r) => {
|
|
128081
128625
|
try {
|
|
128082
128626
|
let s3 = /\b[a-zA-Z0-9_]+\[([0-9]+|'[^']*')\]/g, i2 = r.match(s3) || [], l = r.replace(s3, "''").replace(/\.:[a-zA-Z0-9]+/g, ""), a3 = /\b[a-zA-Z0-9_]+\.[a-zA-Z0-9_.]+/g, u2 = l.match(a3) || [], m3 = l.replace(a3, "''"), p = t2.columnList(`select ${m3}`).map((g) => g.split("::")[2]);
|
|
@@ -128087,17 +128631,17 @@ var require_chunk_6DNB7EDM = __commonJS({
|
|
|
128087
128631
|
}) : [];
|
|
128088
128632
|
};
|
|
128089
128633
|
var Ve2 = (e2) => typeof e2 == "string" ? e2.trim() === "" ? NaN : Number(e2) : e2;
|
|
128090
|
-
var
|
|
128634
|
+
var It2 = exports.E = (e2, t2) => {
|
|
128091
128635
|
let n7 = Ve2(e2), r = Ve2(t2);
|
|
128092
128636
|
return isNaN(n7) || isNaN(r) || r === 0 ? NaN : n7 / r;
|
|
128093
128637
|
};
|
|
128094
|
-
var
|
|
128638
|
+
var Ot2 = exports.F = (e2) => {
|
|
128095
128639
|
let t2 = e2.meta, n7 = e2.data, r = Ke2(_nullishCoalesce(t2, () => [])), s3 = _optionalChain([t2, "optionalAccess", (_97) => _97.filter, "call", (_98) => _98((u2) => u2.name !== _optionalChain([r, "optionalAccess", (_99) => _99.name]))]), i2 = _optionalChain([s3, "optionalAccess", (_100) => _100[0]]), o = _optionalChain([s3, "optionalAccess", (_101) => _101[1]]);
|
|
128096
128640
|
if (!i2 || !o) throw new Error(`Unable to compute ratio - meta information: ${JSON.stringify(t2)}.`);
|
|
128097
128641
|
let l = `${i2.name}/${o.name}`;
|
|
128098
|
-
return { ...e2, data: n7.map((u2) => ({ [l]:
|
|
128642
|
+
return { ...e2, data: n7.map((u2) => ({ [l]: It2(u2[i2.name], u2[o.name]), ...r ? { [r.name]: u2[r.name] } : {} })), meta: [{ name: l, type: "Float64" }, ...r ? [{ name: r.name, type: r.type }] : []] };
|
|
128099
128643
|
};
|
|
128100
|
-
var je2 = exports.
|
|
128644
|
+
var je2 = exports.G = (_class3 = class {
|
|
128101
128645
|
__init4() {
|
|
128102
128646
|
this.requestTimeout = 36e5;
|
|
128103
128647
|
}
|
|
@@ -128167,7 +128711,7 @@ var require_chunk_6DNB7EDM = __commonJS({
|
|
|
128167
128711
|
let _2 = f.name;
|
|
128168
128712
|
a3.has(_2) || a3.set(_2, f);
|
|
128169
128713
|
}
|
|
128170
|
-
let h3 = Ke2(_nullishCoalesce(g.meta, () => [])), S3 = _optionalChain([
|
|
128714
|
+
let h3 = Ke2(_nullishCoalesce(g.meta, () => [])), S3 = _optionalChain([qt2, "call", (_109) => _109(_nullishCoalesce(g.meta, () => [])), "optionalAccess", (_110) => _110[0], "optionalAccess", (_111) => _111.name]);
|
|
128171
128715
|
for (let f of g.data) {
|
|
128172
128716
|
let _2 = S3 ? Object.fromEntries(Object.entries(f).filter(([C2]) => C2 !== S3)) : { ...f }, A2 = h3 != null ? f[h3.name] : o ? _objecthash2.default.call(void 0, _2) : "__FIXED_TIMESTAMP__";
|
|
128173
128717
|
if (u2.has(A2)) {
|
|
@@ -128177,7 +128721,7 @@ var require_chunk_6DNB7EDM = __commonJS({
|
|
|
128177
128721
|
}
|
|
128178
128722
|
}
|
|
128179
128723
|
let m3 = t2.seriesReturnType === "ratio" && l.length === 2, p = { meta: Array.from(a3.values()), data: Array.from(u2.values()) };
|
|
128180
|
-
return m3 ?
|
|
128724
|
+
return m3 ? Ot2(p) : p;
|
|
128181
128725
|
}
|
|
128182
128726
|
throw new Error("No result sets");
|
|
128183
128727
|
}
|
|
@@ -128190,15 +128734,15 @@ var require_chunk_6DNB7EDM = __commonJS({
|
|
|
128190
128734
|
}
|
|
128191
128735
|
}
|
|
128192
128736
|
}, _class3);
|
|
128193
|
-
var R3 = exports.
|
|
128737
|
+
var R3 = exports.H = ({ database: e2, table: t2 }) => c3`${{ Identifier: e2 }}.${{ Identifier: t2 }}`;
|
|
128194
128738
|
function de2({ sql: e2, params: t2 }) {
|
|
128195
128739
|
return Object.entries(t2).reduce((n7, [r, s3]) => n7.replace(new RegExp(`{${r}:\\w+}`, "g"), s3), e2);
|
|
128196
128740
|
}
|
|
128197
|
-
function
|
|
128741
|
+
function zr(e2) {
|
|
128198
128742
|
let t2 = {};
|
|
128199
128743
|
if (e2 == null) return t2;
|
|
128200
128744
|
try {
|
|
128201
|
-
let n7 = de2(e2), [r] =
|
|
128745
|
+
let n7 = de2(e2), [r] = _chunkOEZUGL5Fjs.I.call(void 0, n7), { sqlWithReplacements: s3, replacements: i2 } = _chunkOEZUGL5Fjs.o.call(void 0, r), l = new he2.Parser().astify(s3, { database: "Postgresql", parseOptions: { includeLocations: true } });
|
|
128202
128746
|
l.columns != null && l.columns.forEach((a3) => {
|
|
128203
128747
|
a3.as != null && (a3.type === "expr" && a3.expr.type === "column_ref" ? t2[a3.as] = a3.expr.array_index && _optionalChain([a3, "access", (_117) => _117.expr, "access", (_118) => _118.array_index, "access", (_119) => _119[0], "optionalAccess", (_120) => _120.brackets]) ? `${a3.expr.column.expr.value}['${a3.expr.array_index[0].index.value}']` : a3.expr.column.expr.value : a3.expr.loc != null ? t2[a3.as] = s3.slice(a3.expr.loc.start.offset, a3.expr.loc.end.offset) : console.error("Unknown alias column type", a3));
|
|
128204
128748
|
});
|
|
@@ -128218,18 +128762,18 @@ var require_chunk_6DNB7EDM = __commonJS({
|
|
|
128218
128762
|
function Ke2(e2) {
|
|
128219
128763
|
return _optionalChain([te2, "call", (_121) => _121(e2, ["date"]), "optionalAccess", (_122) => _122[0]]);
|
|
128220
128764
|
}
|
|
128221
|
-
function
|
|
128765
|
+
function qt2(e2) {
|
|
128222
128766
|
return te2(e2, ["number"]);
|
|
128223
128767
|
}
|
|
128224
128768
|
var ve2 = ({ select: e2, ...t2 }) => {
|
|
128225
128769
|
if (e2.aggFn === "quantile") {
|
|
128226
128770
|
if (!("level" in e2) || e2.level === null) throw new Error("quantile must have a level");
|
|
128227
|
-
return
|
|
128771
|
+
return Dt2({ ...t2, level: e2.level });
|
|
128228
128772
|
}
|
|
128229
|
-
if (e2.aggFn === "count") return
|
|
128773
|
+
if (e2.aggFn === "count") return kt2(t2);
|
|
128230
128774
|
throw new Error(`${e2.aggFn} is not supported for histograms currently`);
|
|
128231
128775
|
};
|
|
128232
|
-
var
|
|
128776
|
+
var kt2 = ({ timeBucketSelect: e2, groupBy: t2, from: n7, where: r, valueAlias: s3 }) => [{ name: "source", sql: c3`
|
|
128233
128777
|
SELECT
|
|
128234
128778
|
TimeUnix,
|
|
128235
128779
|
AggregationTemporality,
|
|
@@ -128257,7 +128801,7 @@ var require_chunk_6DNB7EDM = __commonJS({
|
|
|
128257
128801
|
FROM source
|
|
128258
128802
|
GROUP BY ${t2 ? "group, " : ""}\`__hdx_time_bucket\`
|
|
128259
128803
|
` }];
|
|
128260
|
-
var
|
|
128804
|
+
var Dt2 = ({ timeBucketSelect: e2, groupBy: t2, from: n7, where: r, valueAlias: s3, level: i2 }) => [{ name: "source", sql: c3`
|
|
128261
128805
|
SELECT
|
|
128262
128806
|
MetricName,
|
|
128263
128807
|
ExplicitBounds,
|
|
@@ -128345,43 +128889,44 @@ var require_chunk_6DNB7EDM = __commonJS({
|
|
|
128345
128889
|
exports.e = pe2;
|
|
128346
128890
|
exports.f = Be2;
|
|
128347
128891
|
exports.g = Pe2;
|
|
128348
|
-
exports.h =
|
|
128892
|
+
exports.h = $r;
|
|
128349
128893
|
exports.i = H4;
|
|
128350
|
-
exports.j =
|
|
128351
|
-
exports.k =
|
|
128352
|
-
exports.l =
|
|
128353
|
-
exports.m =
|
|
128354
|
-
exports.n =
|
|
128355
|
-
exports.o =
|
|
128356
|
-
exports.p =
|
|
128894
|
+
exports.j = mt2;
|
|
128895
|
+
exports.k = gt2;
|
|
128896
|
+
exports.l = Ct2;
|
|
128897
|
+
exports.m = w2;
|
|
128898
|
+
exports.n = Q3;
|
|
128899
|
+
exports.o = ge2;
|
|
128900
|
+
exports.p = P2;
|
|
128357
128901
|
exports.q = Dr;
|
|
128358
|
-
exports.r =
|
|
128359
|
-
exports.s =
|
|
128360
|
-
exports.t =
|
|
128361
|
-
exports.u =
|
|
128362
|
-
exports.v =
|
|
128363
|
-
exports.w =
|
|
128364
|
-
exports.x =
|
|
128365
|
-
exports.y =
|
|
128366
|
-
exports.z =
|
|
128367
|
-
exports.A =
|
|
128368
|
-
exports.B =
|
|
128369
|
-
exports.C =
|
|
128370
|
-
exports.D =
|
|
128902
|
+
exports.r = Mr;
|
|
128903
|
+
exports.s = ze2;
|
|
128904
|
+
exports.t = ue2;
|
|
128905
|
+
exports.u = Hr;
|
|
128906
|
+
exports.v = x3;
|
|
128907
|
+
exports.w = Qr;
|
|
128908
|
+
exports.x = B3;
|
|
128909
|
+
exports.y = qe2;
|
|
128910
|
+
exports.z = c3;
|
|
128911
|
+
exports.A = E2;
|
|
128912
|
+
exports.B = k3;
|
|
128913
|
+
exports.C = re2;
|
|
128914
|
+
exports.D = Jr;
|
|
128371
128915
|
exports.E = It2;
|
|
128372
|
-
exports.F =
|
|
128373
|
-
exports.G =
|
|
128374
|
-
exports.H =
|
|
128375
|
-
exports.I =
|
|
128376
|
-
exports.J =
|
|
128377
|
-
exports.K =
|
|
128378
|
-
exports.L =
|
|
128379
|
-
exports.M =
|
|
128380
|
-
exports.N =
|
|
128381
|
-
exports.O =
|
|
128382
|
-
exports.P =
|
|
128383
|
-
exports.Q =
|
|
128384
|
-
exports.R =
|
|
128916
|
+
exports.F = Ot2;
|
|
128917
|
+
exports.G = je2;
|
|
128918
|
+
exports.H = R3;
|
|
128919
|
+
exports.I = de2;
|
|
128920
|
+
exports.J = zr;
|
|
128921
|
+
exports.K = te2;
|
|
128922
|
+
exports.L = Ke2;
|
|
128923
|
+
exports.M = qt2;
|
|
128924
|
+
exports.N = ke3;
|
|
128925
|
+
exports.O = oe2;
|
|
128926
|
+
exports.P = V2;
|
|
128927
|
+
exports.Q = st2;
|
|
128928
|
+
exports.R = j2;
|
|
128929
|
+
exports.S = Qt2;
|
|
128385
128930
|
}
|
|
128386
128931
|
});
|
|
128387
128932
|
|
|
@@ -128390,31 +128935,31 @@ var require_clickhouse = __commonJS({
|
|
|
128390
128935
|
"../common-utils/dist/clickhouse/index.js"(exports) {
|
|
128391
128936
|
"use strict";
|
|
128392
128937
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
128393
|
-
var
|
|
128394
|
-
|
|
128395
|
-
|
|
128938
|
+
var _chunkU65WVHY2js = require_chunk_U65WVHY2();
|
|
128939
|
+
require_chunk_DICCJULV();
|
|
128940
|
+
require_chunk_OEZUGL5F();
|
|
128396
128941
|
require_chunk_XSPFZE62();
|
|
128397
|
-
|
|
128398
|
-
exports.BaseClickhouseClient =
|
|
128399
|
-
exports.ClickHouseQueryError =
|
|
128400
|
-
exports.JSDataType =
|
|
128401
|
-
exports.chSql =
|
|
128402
|
-
exports.chSqlToAliasMap =
|
|
128403
|
-
exports.computeRatio =
|
|
128404
|
-
exports.computeResultSetRatio =
|
|
128405
|
-
exports.concatChSql =
|
|
128406
|
-
exports.convertCHDataTypeToJSType =
|
|
128407
|
-
exports.convertCHTypeToLuceneSearchType =
|
|
128408
|
-
exports.extractColumnReferencesFromKey =
|
|
128409
|
-
exports.extractInnerCHArrayJSType =
|
|
128410
|
-
exports.filterColumnMetaByType =
|
|
128411
|
-
exports.getResponseHeaders =
|
|
128412
|
-
exports.inferNumericColumn =
|
|
128413
|
-
exports.inferTimestampColumn =
|
|
128414
|
-
exports.isJSDataTypeJSONStringifiable =
|
|
128415
|
-
exports.parameterizedQueryToSql =
|
|
128416
|
-
exports.tableExpr =
|
|
128417
|
-
exports.wrapChSqlIfNotEmpty =
|
|
128942
|
+
require_chunk_VXPFG6S4();
|
|
128943
|
+
exports.BaseClickhouseClient = _chunkU65WVHY2js.G;
|
|
128944
|
+
exports.ClickHouseQueryError = _chunkU65WVHY2js.C;
|
|
128945
|
+
exports.JSDataType = _chunkU65WVHY2js.t;
|
|
128946
|
+
exports.chSql = _chunkU65WVHY2js.z;
|
|
128947
|
+
exports.chSqlToAliasMap = _chunkU65WVHY2js.J;
|
|
128948
|
+
exports.computeRatio = _chunkU65WVHY2js.E;
|
|
128949
|
+
exports.computeResultSetRatio = _chunkU65WVHY2js.F;
|
|
128950
|
+
exports.concatChSql = _chunkU65WVHY2js.A;
|
|
128951
|
+
exports.convertCHDataTypeToJSType = _chunkU65WVHY2js.v;
|
|
128952
|
+
exports.convertCHTypeToLuceneSearchType = _chunkU65WVHY2js.y;
|
|
128953
|
+
exports.extractColumnReferencesFromKey = _chunkU65WVHY2js.D;
|
|
128954
|
+
exports.extractInnerCHArrayJSType = _chunkU65WVHY2js.x;
|
|
128955
|
+
exports.filterColumnMetaByType = _chunkU65WVHY2js.K;
|
|
128956
|
+
exports.getResponseHeaders = _chunkU65WVHY2js.u;
|
|
128957
|
+
exports.inferNumericColumn = _chunkU65WVHY2js.M;
|
|
128958
|
+
exports.inferTimestampColumn = _chunkU65WVHY2js.L;
|
|
128959
|
+
exports.isJSDataTypeJSONStringifiable = _chunkU65WVHY2js.w;
|
|
128960
|
+
exports.parameterizedQueryToSql = _chunkU65WVHY2js.I;
|
|
128961
|
+
exports.tableExpr = _chunkU65WVHY2js.H;
|
|
128962
|
+
exports.wrapChSqlIfNotEmpty = _chunkU65WVHY2js.B;
|
|
128418
128963
|
}
|
|
128419
128964
|
});
|
|
128420
128965
|
|
|
@@ -128423,17 +128968,17 @@ var require_metadata = __commonJS({
|
|
|
128423
128968
|
"../common-utils/dist/core/metadata.js"(exports) {
|
|
128424
128969
|
"use strict";
|
|
128425
128970
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
128426
|
-
var
|
|
128427
|
-
|
|
128428
|
-
|
|
128971
|
+
var _chunkU65WVHY2js = require_chunk_U65WVHY2();
|
|
128972
|
+
require_chunk_DICCJULV();
|
|
128973
|
+
require_chunk_OEZUGL5F();
|
|
128429
128974
|
require_chunk_XSPFZE62();
|
|
128430
|
-
|
|
128431
|
-
exports.DEFAULT_METADATA_MAX_ROWS_TO_READ =
|
|
128432
|
-
exports.Metadata =
|
|
128433
|
-
exports.MetadataCache =
|
|
128434
|
-
exports.getMetadata =
|
|
128435
|
-
exports.tcFromChartConfig =
|
|
128436
|
-
exports.tcFromSource =
|
|
128975
|
+
require_chunk_VXPFG6S4();
|
|
128976
|
+
exports.DEFAULT_METADATA_MAX_ROWS_TO_READ = _chunkU65WVHY2js.n;
|
|
128977
|
+
exports.Metadata = _chunkU65WVHY2js.p;
|
|
128978
|
+
exports.MetadataCache = _chunkU65WVHY2js.o;
|
|
128979
|
+
exports.getMetadata = _chunkU65WVHY2js.s;
|
|
128980
|
+
exports.tcFromChartConfig = _chunkU65WVHY2js.q;
|
|
128981
|
+
exports.tcFromSource = _chunkU65WVHY2js.r;
|
|
128437
128982
|
}
|
|
128438
128983
|
});
|
|
128439
128984
|
|
|
@@ -128741,48 +129286,48 @@ var require_utils3 = __commonJS({
|
|
|
128741
129286
|
"../common-utils/dist/core/utils.js"(exports) {
|
|
128742
129287
|
"use strict";
|
|
128743
129288
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
128744
|
-
var
|
|
129289
|
+
var _chunkOEZUGL5Fjs = require_chunk_OEZUGL5F();
|
|
128745
129290
|
require_chunk_XSPFZE62();
|
|
128746
|
-
|
|
128747
|
-
exports.DEFAULT_AUTO_GRANULARITY_MAX_BUCKETS =
|
|
128748
|
-
exports.Granularity =
|
|
128749
|
-
exports._useTry =
|
|
128750
|
-
exports.aliasMapToWithClauses =
|
|
128751
|
-
exports.convertDateRangeToGranularityString =
|
|
128752
|
-
exports.convertGranularityToSeconds =
|
|
128753
|
-
exports.convertToDashboardDocument =
|
|
128754
|
-
exports.convertToDashboardTemplate =
|
|
128755
|
-
exports.displayTypeSupportsBuilderAlerts =
|
|
128756
|
-
exports.displayTypeSupportsRawSqlAlerts =
|
|
128757
|
-
exports.extractSettingsClauseFromEnd =
|
|
128758
|
-
exports.findJsonExpressions =
|
|
128759
|
-
exports.formatDate =
|
|
128760
|
-
exports.getAlignedDateRange =
|
|
128761
|
-
exports.getDistributedTableArgs =
|
|
128762
|
-
exports.getFirstOrderingItem =
|
|
128763
|
-
exports.getFirstTimestampValueExpression =
|
|
128764
|
-
exports.hashCode =
|
|
128765
|
-
exports.isBrowser =
|
|
128766
|
-
exports.isDateRangeEqual =
|
|
128767
|
-
exports.isFirstOrderByAscending =
|
|
128768
|
-
exports.isJsonExpression =
|
|
128769
|
-
exports.isNode =
|
|
128770
|
-
exports.isTimeSeriesDisplayType =
|
|
128771
|
-
exports.isTimestampExpressionInFirstOrderBy =
|
|
128772
|
-
exports.joinQuerySettings =
|
|
128773
|
-
exports.objectHash =
|
|
128774
|
-
exports.optimizeTimestampValueExpression =
|
|
128775
|
-
exports.parseJSON =
|
|
128776
|
-
exports.parseToNumber =
|
|
128777
|
-
exports.parseToStartOfFunction =
|
|
128778
|
-
exports.parseTokenizerFromTextIndex =
|
|
128779
|
-
exports.removeTrailingDirection =
|
|
128780
|
-
exports.replaceJsonExpressions =
|
|
128781
|
-
exports.splitAndTrimCSV =
|
|
128782
|
-
exports.splitAndTrimWithBracket =
|
|
128783
|
-
exports.timeBucketByGranularity =
|
|
128784
|
-
exports.toStartOfInterval =
|
|
128785
|
-
exports.validateRawSqlForAlert =
|
|
129291
|
+
require_chunk_VXPFG6S4();
|
|
129292
|
+
exports.DEFAULT_AUTO_GRANULARITY_MAX_BUCKETS = _chunkOEZUGL5Fjs.g;
|
|
129293
|
+
exports.Granularity = _chunkOEZUGL5Fjs.p;
|
|
129294
|
+
exports._useTry = _chunkOEZUGL5Fjs.v;
|
|
129295
|
+
exports.aliasMapToWithClauses = _chunkOEZUGL5Fjs.M;
|
|
129296
|
+
exports.convertDateRangeToGranularityString = _chunkOEZUGL5Fjs.r;
|
|
129297
|
+
exports.convertGranularityToSeconds = _chunkOEZUGL5Fjs.s;
|
|
129298
|
+
exports.convertToDashboardDocument = _chunkOEZUGL5Fjs.z;
|
|
129299
|
+
exports.convertToDashboardTemplate = _chunkOEZUGL5Fjs.y;
|
|
129300
|
+
exports.displayTypeSupportsBuilderAlerts = _chunkOEZUGL5Fjs.P;
|
|
129301
|
+
exports.displayTypeSupportsRawSqlAlerts = _chunkOEZUGL5Fjs.O;
|
|
129302
|
+
exports.extractSettingsClauseFromEnd = _chunkOEZUGL5Fjs.I;
|
|
129303
|
+
exports.findJsonExpressions = _chunkOEZUGL5Fjs.n;
|
|
129304
|
+
exports.formatDate = _chunkOEZUGL5Fjs.x;
|
|
129305
|
+
exports.getAlignedDateRange = _chunkOEZUGL5Fjs.G;
|
|
129306
|
+
exports.getDistributedTableArgs = _chunkOEZUGL5Fjs.N;
|
|
129307
|
+
exports.getFirstOrderingItem = _chunkOEZUGL5Fjs.A;
|
|
129308
|
+
exports.getFirstTimestampValueExpression = _chunkOEZUGL5Fjs.l;
|
|
129309
|
+
exports.hashCode = _chunkOEZUGL5Fjs.q;
|
|
129310
|
+
exports.isBrowser = _chunkOEZUGL5Fjs.h;
|
|
129311
|
+
exports.isDateRangeEqual = _chunkOEZUGL5Fjs.H;
|
|
129312
|
+
exports.isFirstOrderByAscending = _chunkOEZUGL5Fjs.D;
|
|
129313
|
+
exports.isJsonExpression = _chunkOEZUGL5Fjs.m;
|
|
129314
|
+
exports.isNode = _chunkOEZUGL5Fjs.i;
|
|
129315
|
+
exports.isTimeSeriesDisplayType = _chunkOEZUGL5Fjs.R;
|
|
129316
|
+
exports.isTimestampExpressionInFirstOrderBy = _chunkOEZUGL5Fjs.C;
|
|
129317
|
+
exports.joinQuerySettings = _chunkOEZUGL5Fjs.K;
|
|
129318
|
+
exports.objectHash = _chunkOEZUGL5Fjs.S;
|
|
129319
|
+
exports.optimizeTimestampValueExpression = _chunkOEZUGL5Fjs.F;
|
|
129320
|
+
exports.parseJSON = _chunkOEZUGL5Fjs.w;
|
|
129321
|
+
exports.parseToNumber = _chunkOEZUGL5Fjs.J;
|
|
129322
|
+
exports.parseToStartOfFunction = _chunkOEZUGL5Fjs.E;
|
|
129323
|
+
exports.parseTokenizerFromTextIndex = _chunkOEZUGL5Fjs.L;
|
|
129324
|
+
exports.removeTrailingDirection = _chunkOEZUGL5Fjs.B;
|
|
129325
|
+
exports.replaceJsonExpressions = _chunkOEZUGL5Fjs.o;
|
|
129326
|
+
exports.splitAndTrimCSV = _chunkOEZUGL5Fjs.j;
|
|
129327
|
+
exports.splitAndTrimWithBracket = _chunkOEZUGL5Fjs.k;
|
|
129328
|
+
exports.timeBucketByGranularity = _chunkOEZUGL5Fjs.u;
|
|
129329
|
+
exports.toStartOfInterval = _chunkOEZUGL5Fjs.t;
|
|
129330
|
+
exports.validateRawSqlForAlert = _chunkOEZUGL5Fjs.Q;
|
|
128786
129331
|
}
|
|
128787
129332
|
});
|
|
128788
129333
|
|
|
@@ -128791,22 +129336,23 @@ var require_renderChartConfig = __commonJS({
|
|
|
128791
129336
|
"../common-utils/dist/core/renderChartConfig.js"(exports) {
|
|
128792
129337
|
"use strict";
|
|
128793
129338
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
128794
|
-
var
|
|
128795
|
-
|
|
128796
|
-
|
|
129339
|
+
var _chunkU65WVHY2js = require_chunk_U65WVHY2();
|
|
129340
|
+
require_chunk_DICCJULV();
|
|
129341
|
+
require_chunk_OEZUGL5F();
|
|
128797
129342
|
require_chunk_XSPFZE62();
|
|
128798
|
-
|
|
128799
|
-
exports.FIXED_TIME_BUCKET_EXPR_ALIAS =
|
|
128800
|
-
exports.inverseSqlAstFilter =
|
|
128801
|
-
exports.isMetricChartConfig =
|
|
128802
|
-
exports.isNonEmptyWhereExpr =
|
|
128803
|
-
exports.
|
|
128804
|
-
exports.
|
|
128805
|
-
exports.
|
|
128806
|
-
exports.
|
|
128807
|
-
exports.
|
|
128808
|
-
exports.
|
|
128809
|
-
exports.
|
|
129343
|
+
require_chunk_VXPFG6S4();
|
|
129344
|
+
exports.FIXED_TIME_BUCKET_EXPR_ALIAS = _chunkU65WVHY2js.b;
|
|
129345
|
+
exports.inverseSqlAstFilter = _chunkU65WVHY2js.h;
|
|
129346
|
+
exports.isMetricChartConfig = _chunkU65WVHY2js.e;
|
|
129347
|
+
exports.isNonEmptyWhereExpr = _chunkU65WVHY2js.i;
|
|
129348
|
+
exports.isRatioChartConfig = _chunkU65WVHY2js.j;
|
|
129349
|
+
exports.isUsingGranularity = _chunkU65WVHY2js.d;
|
|
129350
|
+
exports.isUsingGroupBy = _chunkU65WVHY2js.c;
|
|
129351
|
+
exports.renderChartConfig = _chunkU65WVHY2js.m;
|
|
129352
|
+
exports.renderRawSqlChartConfig = _chunkU65WVHY2js.l;
|
|
129353
|
+
exports.setChartSelectsAlias = _chunkU65WVHY2js.f;
|
|
129354
|
+
exports.splitChartConfigs = _chunkU65WVHY2js.g;
|
|
129355
|
+
exports.timeFilterExpr = _chunkU65WVHY2js.k;
|
|
128810
129356
|
}
|
|
128811
129357
|
});
|
|
128812
129358
|
|
|
@@ -129382,744 +129928,220 @@ var require_core = __commonJS({
|
|
|
129382
129928
|
* @return {Function} The shortcut function.
|
|
129383
129929
|
*
|
|
129384
129930
|
* @static
|
|
129385
|
-
*
|
|
129386
|
-
* @example
|
|
129387
|
-
*
|
|
129388
|
-
* var SHA256 = CryptoJS.lib.Hasher._createHelper(CryptoJS.algo.SHA256);
|
|
129389
|
-
*/
|
|
129390
|
-
_createHelper: function(hasher) {
|
|
129391
|
-
return function(message, cfg) {
|
|
129392
|
-
return new hasher.init(cfg).finalize(message);
|
|
129393
|
-
};
|
|
129394
|
-
},
|
|
129395
|
-
/**
|
|
129396
|
-
* Creates a shortcut function to the HMAC's object interface.
|
|
129397
|
-
*
|
|
129398
|
-
* @param {Hasher} hasher The hasher to use in this HMAC helper.
|
|
129399
|
-
*
|
|
129400
|
-
* @return {Function} The shortcut function.
|
|
129401
|
-
*
|
|
129402
|
-
* @static
|
|
129403
|
-
*
|
|
129404
|
-
* @example
|
|
129405
|
-
*
|
|
129406
|
-
* var HmacSHA256 = CryptoJS.lib.Hasher._createHmacHelper(CryptoJS.algo.SHA256);
|
|
129407
|
-
*/
|
|
129408
|
-
_createHmacHelper: function(hasher) {
|
|
129409
|
-
return function(message, key) {
|
|
129410
|
-
return new C_algo.HMAC.init(hasher, key).finalize(message);
|
|
129411
|
-
};
|
|
129412
|
-
}
|
|
129413
|
-
});
|
|
129414
|
-
var C_algo = C2.algo = {};
|
|
129415
|
-
return C2;
|
|
129416
|
-
}(Math);
|
|
129417
|
-
return CryptoJS;
|
|
129418
|
-
});
|
|
129419
|
-
}
|
|
129420
|
-
});
|
|
129421
|
-
|
|
129422
|
-
// ../../node_modules/crypto-js/md5.js
|
|
129423
|
-
var require_md5 = __commonJS({
|
|
129424
|
-
"../../node_modules/crypto-js/md5.js"(exports, module) {
|
|
129425
|
-
"use strict";
|
|
129426
|
-
(function(root, factory) {
|
|
129427
|
-
if (typeof exports === "object") {
|
|
129428
|
-
module.exports = exports = factory(require_core());
|
|
129429
|
-
} else if (typeof define === "function" && define.amd) {
|
|
129430
|
-
define(["./core"], factory);
|
|
129431
|
-
} else {
|
|
129432
|
-
factory(root.CryptoJS);
|
|
129433
|
-
}
|
|
129434
|
-
})(exports, function(CryptoJS) {
|
|
129435
|
-
(function(Math2) {
|
|
129436
|
-
var C2 = CryptoJS;
|
|
129437
|
-
var C_lib = C2.lib;
|
|
129438
|
-
var WordArray = C_lib.WordArray;
|
|
129439
|
-
var Hasher = C_lib.Hasher;
|
|
129440
|
-
var C_algo = C2.algo;
|
|
129441
|
-
var T3 = [];
|
|
129442
|
-
(function() {
|
|
129443
|
-
for (var i2 = 0; i2 < 64; i2++) {
|
|
129444
|
-
T3[i2] = Math2.abs(Math2.sin(i2 + 1)) * 4294967296 | 0;
|
|
129445
|
-
}
|
|
129446
|
-
})();
|
|
129447
|
-
var MD52 = C_algo.MD5 = Hasher.extend({
|
|
129448
|
-
_doReset: function() {
|
|
129449
|
-
this._hash = new WordArray.init([
|
|
129450
|
-
1732584193,
|
|
129451
|
-
4023233417,
|
|
129452
|
-
2562383102,
|
|
129453
|
-
271733878
|
|
129454
|
-
]);
|
|
129455
|
-
},
|
|
129456
|
-
_doProcessBlock: function(M4, offset) {
|
|
129457
|
-
for (var i2 = 0; i2 < 16; i2++) {
|
|
129458
|
-
var offset_i = offset + i2;
|
|
129459
|
-
var M_offset_i = M4[offset_i];
|
|
129460
|
-
M4[offset_i] = (M_offset_i << 8 | M_offset_i >>> 24) & 16711935 | (M_offset_i << 24 | M_offset_i >>> 8) & 4278255360;
|
|
129461
|
-
}
|
|
129462
|
-
var H4 = this._hash.words;
|
|
129463
|
-
var M_offset_0 = M4[offset + 0];
|
|
129464
|
-
var M_offset_1 = M4[offset + 1];
|
|
129465
|
-
var M_offset_2 = M4[offset + 2];
|
|
129466
|
-
var M_offset_3 = M4[offset + 3];
|
|
129467
|
-
var M_offset_4 = M4[offset + 4];
|
|
129468
|
-
var M_offset_5 = M4[offset + 5];
|
|
129469
|
-
var M_offset_6 = M4[offset + 6];
|
|
129470
|
-
var M_offset_7 = M4[offset + 7];
|
|
129471
|
-
var M_offset_8 = M4[offset + 8];
|
|
129472
|
-
var M_offset_9 = M4[offset + 9];
|
|
129473
|
-
var M_offset_10 = M4[offset + 10];
|
|
129474
|
-
var M_offset_11 = M4[offset + 11];
|
|
129475
|
-
var M_offset_12 = M4[offset + 12];
|
|
129476
|
-
var M_offset_13 = M4[offset + 13];
|
|
129477
|
-
var M_offset_14 = M4[offset + 14];
|
|
129478
|
-
var M_offset_15 = M4[offset + 15];
|
|
129479
|
-
var a3 = H4[0];
|
|
129480
|
-
var b2 = H4[1];
|
|
129481
|
-
var c3 = H4[2];
|
|
129482
|
-
var d3 = H4[3];
|
|
129483
|
-
a3 = FF(a3, b2, c3, d3, M_offset_0, 7, T3[0]);
|
|
129484
|
-
d3 = FF(d3, a3, b2, c3, M_offset_1, 12, T3[1]);
|
|
129485
|
-
c3 = FF(c3, d3, a3, b2, M_offset_2, 17, T3[2]);
|
|
129486
|
-
b2 = FF(b2, c3, d3, a3, M_offset_3, 22, T3[3]);
|
|
129487
|
-
a3 = FF(a3, b2, c3, d3, M_offset_4, 7, T3[4]);
|
|
129488
|
-
d3 = FF(d3, a3, b2, c3, M_offset_5, 12, T3[5]);
|
|
129489
|
-
c3 = FF(c3, d3, a3, b2, M_offset_6, 17, T3[6]);
|
|
129490
|
-
b2 = FF(b2, c3, d3, a3, M_offset_7, 22, T3[7]);
|
|
129491
|
-
a3 = FF(a3, b2, c3, d3, M_offset_8, 7, T3[8]);
|
|
129492
|
-
d3 = FF(d3, a3, b2, c3, M_offset_9, 12, T3[9]);
|
|
129493
|
-
c3 = FF(c3, d3, a3, b2, M_offset_10, 17, T3[10]);
|
|
129494
|
-
b2 = FF(b2, c3, d3, a3, M_offset_11, 22, T3[11]);
|
|
129495
|
-
a3 = FF(a3, b2, c3, d3, M_offset_12, 7, T3[12]);
|
|
129496
|
-
d3 = FF(d3, a3, b2, c3, M_offset_13, 12, T3[13]);
|
|
129497
|
-
c3 = FF(c3, d3, a3, b2, M_offset_14, 17, T3[14]);
|
|
129498
|
-
b2 = FF(b2, c3, d3, a3, M_offset_15, 22, T3[15]);
|
|
129499
|
-
a3 = GG(a3, b2, c3, d3, M_offset_1, 5, T3[16]);
|
|
129500
|
-
d3 = GG(d3, a3, b2, c3, M_offset_6, 9, T3[17]);
|
|
129501
|
-
c3 = GG(c3, d3, a3, b2, M_offset_11, 14, T3[18]);
|
|
129502
|
-
b2 = GG(b2, c3, d3, a3, M_offset_0, 20, T3[19]);
|
|
129503
|
-
a3 = GG(a3, b2, c3, d3, M_offset_5, 5, T3[20]);
|
|
129504
|
-
d3 = GG(d3, a3, b2, c3, M_offset_10, 9, T3[21]);
|
|
129505
|
-
c3 = GG(c3, d3, a3, b2, M_offset_15, 14, T3[22]);
|
|
129506
|
-
b2 = GG(b2, c3, d3, a3, M_offset_4, 20, T3[23]);
|
|
129507
|
-
a3 = GG(a3, b2, c3, d3, M_offset_9, 5, T3[24]);
|
|
129508
|
-
d3 = GG(d3, a3, b2, c3, M_offset_14, 9, T3[25]);
|
|
129509
|
-
c3 = GG(c3, d3, a3, b2, M_offset_3, 14, T3[26]);
|
|
129510
|
-
b2 = GG(b2, c3, d3, a3, M_offset_8, 20, T3[27]);
|
|
129511
|
-
a3 = GG(a3, b2, c3, d3, M_offset_13, 5, T3[28]);
|
|
129512
|
-
d3 = GG(d3, a3, b2, c3, M_offset_2, 9, T3[29]);
|
|
129513
|
-
c3 = GG(c3, d3, a3, b2, M_offset_7, 14, T3[30]);
|
|
129514
|
-
b2 = GG(b2, c3, d3, a3, M_offset_12, 20, T3[31]);
|
|
129515
|
-
a3 = HH(a3, b2, c3, d3, M_offset_5, 4, T3[32]);
|
|
129516
|
-
d3 = HH(d3, a3, b2, c3, M_offset_8, 11, T3[33]);
|
|
129517
|
-
c3 = HH(c3, d3, a3, b2, M_offset_11, 16, T3[34]);
|
|
129518
|
-
b2 = HH(b2, c3, d3, a3, M_offset_14, 23, T3[35]);
|
|
129519
|
-
a3 = HH(a3, b2, c3, d3, M_offset_1, 4, T3[36]);
|
|
129520
|
-
d3 = HH(d3, a3, b2, c3, M_offset_4, 11, T3[37]);
|
|
129521
|
-
c3 = HH(c3, d3, a3, b2, M_offset_7, 16, T3[38]);
|
|
129522
|
-
b2 = HH(b2, c3, d3, a3, M_offset_10, 23, T3[39]);
|
|
129523
|
-
a3 = HH(a3, b2, c3, d3, M_offset_13, 4, T3[40]);
|
|
129524
|
-
d3 = HH(d3, a3, b2, c3, M_offset_0, 11, T3[41]);
|
|
129525
|
-
c3 = HH(c3, d3, a3, b2, M_offset_3, 16, T3[42]);
|
|
129526
|
-
b2 = HH(b2, c3, d3, a3, M_offset_6, 23, T3[43]);
|
|
129527
|
-
a3 = HH(a3, b2, c3, d3, M_offset_9, 4, T3[44]);
|
|
129528
|
-
d3 = HH(d3, a3, b2, c3, M_offset_12, 11, T3[45]);
|
|
129529
|
-
c3 = HH(c3, d3, a3, b2, M_offset_15, 16, T3[46]);
|
|
129530
|
-
b2 = HH(b2, c3, d3, a3, M_offset_2, 23, T3[47]);
|
|
129531
|
-
a3 = II(a3, b2, c3, d3, M_offset_0, 6, T3[48]);
|
|
129532
|
-
d3 = II(d3, a3, b2, c3, M_offset_7, 10, T3[49]);
|
|
129533
|
-
c3 = II(c3, d3, a3, b2, M_offset_14, 15, T3[50]);
|
|
129534
|
-
b2 = II(b2, c3, d3, a3, M_offset_5, 21, T3[51]);
|
|
129535
|
-
a3 = II(a3, b2, c3, d3, M_offset_12, 6, T3[52]);
|
|
129536
|
-
d3 = II(d3, a3, b2, c3, M_offset_3, 10, T3[53]);
|
|
129537
|
-
c3 = II(c3, d3, a3, b2, M_offset_10, 15, T3[54]);
|
|
129538
|
-
b2 = II(b2, c3, d3, a3, M_offset_1, 21, T3[55]);
|
|
129539
|
-
a3 = II(a3, b2, c3, d3, M_offset_8, 6, T3[56]);
|
|
129540
|
-
d3 = II(d3, a3, b2, c3, M_offset_15, 10, T3[57]);
|
|
129541
|
-
c3 = II(c3, d3, a3, b2, M_offset_6, 15, T3[58]);
|
|
129542
|
-
b2 = II(b2, c3, d3, a3, M_offset_13, 21, T3[59]);
|
|
129543
|
-
a3 = II(a3, b2, c3, d3, M_offset_4, 6, T3[60]);
|
|
129544
|
-
d3 = II(d3, a3, b2, c3, M_offset_11, 10, T3[61]);
|
|
129545
|
-
c3 = II(c3, d3, a3, b2, M_offset_2, 15, T3[62]);
|
|
129546
|
-
b2 = II(b2, c3, d3, a3, M_offset_9, 21, T3[63]);
|
|
129547
|
-
H4[0] = H4[0] + a3 | 0;
|
|
129548
|
-
H4[1] = H4[1] + b2 | 0;
|
|
129549
|
-
H4[2] = H4[2] + c3 | 0;
|
|
129550
|
-
H4[3] = H4[3] + d3 | 0;
|
|
129551
|
-
},
|
|
129552
|
-
_doFinalize: function() {
|
|
129553
|
-
var data = this._data;
|
|
129554
|
-
var dataWords = data.words;
|
|
129555
|
-
var nBitsTotal = this._nDataBytes * 8;
|
|
129556
|
-
var nBitsLeft = data.sigBytes * 8;
|
|
129557
|
-
dataWords[nBitsLeft >>> 5] |= 128 << 24 - nBitsLeft % 32;
|
|
129558
|
-
var nBitsTotalH = Math2.floor(nBitsTotal / 4294967296);
|
|
129559
|
-
var nBitsTotalL = nBitsTotal;
|
|
129560
|
-
dataWords[(nBitsLeft + 64 >>> 9 << 4) + 15] = (nBitsTotalH << 8 | nBitsTotalH >>> 24) & 16711935 | (nBitsTotalH << 24 | nBitsTotalH >>> 8) & 4278255360;
|
|
129561
|
-
dataWords[(nBitsLeft + 64 >>> 9 << 4) + 14] = (nBitsTotalL << 8 | nBitsTotalL >>> 24) & 16711935 | (nBitsTotalL << 24 | nBitsTotalL >>> 8) & 4278255360;
|
|
129562
|
-
data.sigBytes = (dataWords.length + 1) * 4;
|
|
129563
|
-
this._process();
|
|
129564
|
-
var hash = this._hash;
|
|
129565
|
-
var H4 = hash.words;
|
|
129566
|
-
for (var i2 = 0; i2 < 4; i2++) {
|
|
129567
|
-
var H_i = H4[i2];
|
|
129568
|
-
H4[i2] = (H_i << 8 | H_i >>> 24) & 16711935 | (H_i << 24 | H_i >>> 8) & 4278255360;
|
|
129569
|
-
}
|
|
129570
|
-
return hash;
|
|
129571
|
-
},
|
|
129572
|
-
clone: function() {
|
|
129573
|
-
var clone = Hasher.clone.call(this);
|
|
129574
|
-
clone._hash = this._hash.clone();
|
|
129575
|
-
return clone;
|
|
129576
|
-
}
|
|
129577
|
-
});
|
|
129578
|
-
function FF(a3, b2, c3, d3, x3, s3, t2) {
|
|
129579
|
-
var n7 = a3 + (b2 & c3 | ~b2 & d3) + x3 + t2;
|
|
129580
|
-
return (n7 << s3 | n7 >>> 32 - s3) + b2;
|
|
129581
|
-
}
|
|
129582
|
-
function GG(a3, b2, c3, d3, x3, s3, t2) {
|
|
129583
|
-
var n7 = a3 + (b2 & d3 | c3 & ~d3) + x3 + t2;
|
|
129584
|
-
return (n7 << s3 | n7 >>> 32 - s3) + b2;
|
|
129585
|
-
}
|
|
129586
|
-
function HH(a3, b2, c3, d3, x3, s3, t2) {
|
|
129587
|
-
var n7 = a3 + (b2 ^ c3 ^ d3) + x3 + t2;
|
|
129588
|
-
return (n7 << s3 | n7 >>> 32 - s3) + b2;
|
|
129589
|
-
}
|
|
129590
|
-
function II(a3, b2, c3, d3, x3, s3, t2) {
|
|
129591
|
-
var n7 = a3 + (c3 ^ (b2 | ~d3)) + x3 + t2;
|
|
129592
|
-
return (n7 << s3 | n7 >>> 32 - s3) + b2;
|
|
129593
|
-
}
|
|
129594
|
-
C2.MD5 = Hasher._createHelper(MD52);
|
|
129595
|
-
C2.HmacMD5 = Hasher._createHmacHelper(MD52);
|
|
129596
|
-
})(Math);
|
|
129597
|
-
return CryptoJS.MD5;
|
|
129598
|
-
});
|
|
129599
|
-
}
|
|
129600
|
-
});
|
|
129601
|
-
|
|
129602
|
-
// ../common-utils/dist/chunk-4S7NGOPO.js
|
|
129603
|
-
var require_chunk_4S7NGOPO = __commonJS({
|
|
129604
|
-
"../common-utils/dist/chunk-4S7NGOPO.js"(exports) {
|
|
129605
|
-
"use strict";
|
|
129606
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
129607
|
-
var t2 = class {
|
|
129608
|
-
constructor(e2, s3) {
|
|
129609
|
-
this.logTemplateTokens = [...e2], this.clusterId = s3, this.size = 1;
|
|
129610
|
-
}
|
|
129611
|
-
getTemplate() {
|
|
129612
|
-
return this.logTemplateTokens.join(" ");
|
|
129613
|
-
}
|
|
129614
|
-
toString() {
|
|
129615
|
-
return `ID=${String(this.clusterId).padEnd(5)} : size=${String(this.size).padEnd(10)}: ${this.getTemplate()}`;
|
|
129616
|
-
}
|
|
129617
|
-
};
|
|
129618
|
-
exports.a = t2;
|
|
129619
|
-
}
|
|
129620
|
-
});
|
|
129621
|
-
|
|
129622
|
-
// ../common-utils/dist/chunk-G5BIG2AN.js
|
|
129623
|
-
var require_chunk_G5BIG2AN = __commonJS({
|
|
129624
|
-
"../common-utils/dist/chunk-G5BIG2AN.js"(exports) {
|
|
129625
|
-
"use strict";
|
|
129626
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
129627
|
-
function _optionalChain(ops) {
|
|
129628
|
-
let lastAccessLHS = void 0;
|
|
129629
|
-
let value = ops[0];
|
|
129630
|
-
let i2 = 1;
|
|
129631
|
-
while (i2 < ops.length) {
|
|
129632
|
-
const op = ops[i2];
|
|
129633
|
-
const fn = ops[i2 + 1];
|
|
129634
|
-
i2 += 2;
|
|
129635
|
-
if ((op === "optionalAccess" || op === "optionalCall") && value == null) {
|
|
129636
|
-
return void 0;
|
|
129637
|
-
}
|
|
129638
|
-
if (op === "access" || op === "optionalAccess") {
|
|
129639
|
-
lastAccessLHS = value;
|
|
129640
|
-
value = fn(value);
|
|
129641
|
-
} else if (op === "call" || op === "optionalCall") {
|
|
129642
|
-
value = fn((...args) => value.call(lastAccessLHS, ...args));
|
|
129643
|
-
lastAccessLHS = void 0;
|
|
129644
|
-
}
|
|
129645
|
-
}
|
|
129646
|
-
return value;
|
|
129647
|
-
}
|
|
129648
|
-
var _class;
|
|
129649
|
-
var s3 = (_class = class {
|
|
129650
|
-
__init() {
|
|
129651
|
-
this.map = /* @__PURE__ */ new Map();
|
|
129652
|
-
}
|
|
129653
|
-
__init2() {
|
|
129654
|
-
this.entries = [];
|
|
129655
|
-
}
|
|
129656
|
-
__init3() {
|
|
129657
|
-
this.freeSlots = [];
|
|
129658
|
-
}
|
|
129659
|
-
__init4() {
|
|
129660
|
-
this.head = null;
|
|
129661
|
-
}
|
|
129662
|
-
__init5() {
|
|
129663
|
-
this.tail = null;
|
|
129664
|
-
}
|
|
129665
|
-
constructor(t2) {
|
|
129666
|
-
;
|
|
129667
|
-
_class.prototype.__init.call(this);
|
|
129668
|
-
_class.prototype.__init2.call(this);
|
|
129669
|
-
_class.prototype.__init3.call(this);
|
|
129670
|
-
_class.prototype.__init4.call(this);
|
|
129671
|
-
_class.prototype.__init5.call(this);
|
|
129672
|
-
this.capacity = t2;
|
|
129673
|
-
}
|
|
129674
|
-
get size() {
|
|
129675
|
-
return this.map.size;
|
|
129676
|
-
}
|
|
129677
|
-
has(t2) {
|
|
129678
|
-
return this.map.has(t2);
|
|
129679
|
-
}
|
|
129680
|
-
peek(t2) {
|
|
129681
|
-
let e2 = this.map.get(t2);
|
|
129682
|
-
if (e2 !== void 0) return _optionalChain([this, "access", (_2) => _2.entries, "access", (_2) => _2[e2], "optionalAccess", (_3) => _3.value]);
|
|
129683
|
-
}
|
|
129684
|
-
get(t2) {
|
|
129685
|
-
let e2 = this.map.get(t2);
|
|
129686
|
-
if (e2 !== void 0) return this.moveToHead(e2), _optionalChain([this, "access", (_4) => _4.entries, "access", (_5) => _5[e2], "optionalAccess", (_6) => _6.value]);
|
|
129687
|
-
}
|
|
129688
|
-
put(t2, e2) {
|
|
129689
|
-
let n7 = this.map.get(t2);
|
|
129690
|
-
if (n7 !== void 0) {
|
|
129691
|
-
let u2 = this.entries[n7];
|
|
129692
|
-
u2.value = e2, this.moveToHead(n7);
|
|
129693
|
-
return;
|
|
129694
|
-
}
|
|
129695
|
-
let i2;
|
|
129696
|
-
this.map.size >= this.capacity && (i2 = this.evictTail());
|
|
129697
|
-
let r = this.allocSlot({ key: t2, value: e2, prev: null, next: this.head });
|
|
129698
|
-
return this.head !== null && (this.entries[this.head].prev = r), this.head = r, this.tail === null && (this.tail = r), this.map.set(t2, r), i2;
|
|
129699
|
-
}
|
|
129700
|
-
remove(t2) {
|
|
129701
|
-
let e2 = this.map.get(t2);
|
|
129702
|
-
if (e2 === void 0) return;
|
|
129703
|
-
this.map.delete(t2), this.unlink(e2);
|
|
129704
|
-
let n7 = this.entries[e2];
|
|
129705
|
-
return this.entries[e2] = null, this.freeSlots.push(e2), n7.value;
|
|
129706
|
-
}
|
|
129707
|
-
values() {
|
|
129708
|
-
let t2 = [];
|
|
129709
|
-
for (let e2 of this.entries) e2 !== null && t2.push(e2.value);
|
|
129710
|
-
return t2;
|
|
129711
|
-
}
|
|
129712
|
-
allocSlot(t2) {
|
|
129713
|
-
if (this.freeSlots.length > 0) {
|
|
129714
|
-
let e2 = this.freeSlots.pop();
|
|
129715
|
-
return this.entries[e2] = t2, e2;
|
|
129716
|
-
}
|
|
129717
|
-
return this.entries.push(t2), this.entries.length - 1;
|
|
129718
|
-
}
|
|
129719
|
-
unlink(t2) {
|
|
129720
|
-
let e2 = this.entries[t2];
|
|
129721
|
-
e2.prev !== null ? this.entries[e2.prev].next = e2.next : this.head = e2.next, e2.next !== null ? this.entries[e2.next].prev = e2.prev : this.tail = e2.prev;
|
|
129722
|
-
}
|
|
129723
|
-
moveToHead(t2) {
|
|
129724
|
-
if (this.head === t2) return;
|
|
129725
|
-
this.unlink(t2);
|
|
129726
|
-
let e2 = this.entries[t2];
|
|
129727
|
-
e2.prev = null, e2.next = this.head, this.head !== null && (this.entries[this.head].prev = t2), this.head = t2, this.tail === null && (this.tail = t2);
|
|
129728
|
-
}
|
|
129729
|
-
evictTail() {
|
|
129730
|
-
if (this.tail === null) return;
|
|
129731
|
-
let t2 = this.tail, e2 = this.entries[t2], n7 = e2.key, i2 = e2.value;
|
|
129732
|
-
return this.map.delete(n7), this.unlink(t2), this.entries[t2] = null, this.freeSlots.push(t2), [n7, i2];
|
|
129733
|
-
}
|
|
129734
|
-
}, _class);
|
|
129735
|
-
exports.a = s3;
|
|
129736
|
-
}
|
|
129737
|
-
});
|
|
129738
|
-
|
|
129739
|
-
// ../common-utils/dist/chunk-WVA66XTC.js
|
|
129740
|
-
var require_chunk_WVA66XTC = __commonJS({
|
|
129741
|
-
"../common-utils/dist/chunk-WVA66XTC.js"(exports) {
|
|
129742
|
-
"use strict";
|
|
129743
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
129744
|
-
var s3 = class {
|
|
129745
|
-
constructor() {
|
|
129746
|
-
this.keyToChildNode = /* @__PURE__ */ new Map(), this.clusterIds = [];
|
|
129747
|
-
}
|
|
129748
|
-
};
|
|
129749
|
-
exports.a = s3;
|
|
129750
|
-
}
|
|
129751
|
-
});
|
|
129752
|
-
|
|
129753
|
-
// ../common-utils/dist/chunk-5CFDOSQL.js
|
|
129754
|
-
var require_chunk_5CFDOSQL = __commonJS({
|
|
129755
|
-
"../common-utils/dist/chunk-5CFDOSQL.js"(exports) {
|
|
129756
|
-
"use strict";
|
|
129757
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
129758
|
-
function _nullishCoalesce(lhs, rhsFn) {
|
|
129759
|
-
if (lhs != null) {
|
|
129760
|
-
return lhs;
|
|
129761
|
-
} else {
|
|
129762
|
-
return rhsFn();
|
|
129763
|
-
}
|
|
129764
|
-
}
|
|
129765
|
-
var _chunk4S7NGOPOjs = require_chunk_4S7NGOPO();
|
|
129766
|
-
var _chunkG5BIG2ANjs = require_chunk_G5BIG2AN();
|
|
129767
|
-
var _chunkWVA66XTCjs = require_chunk_WVA66XTC();
|
|
129768
|
-
var g = class f {
|
|
129769
|
-
constructor(t2 = 4, r = 0.4, s3 = 100, i2 = null, e2 = [], o = "<*>", n7 = true) {
|
|
129770
|
-
if (t2 < 3) throw new Error("depth argument must be at least 3");
|
|
129771
|
-
this.logClusterDepth = t2, this.maxNodeDepth = t2 - 2, this.simTh = r, this.maxChildren = s3, this.rootNode = new _chunkWVA66XTCjs.a(), this.extraDelimiters = e2, this.maxClusters = i2, this.paramStr = o, this.parametrizeNumericTokens = n7, this.clustersCounter = 0, i2 !== null ? (this.unlimitedStore = null, this.limitedStore = new (0, _chunkG5BIG2ANjs.a)(i2)) : (this.unlimitedStore = /* @__PURE__ */ new Map(), this.limitedStore = null);
|
|
129772
|
-
}
|
|
129773
|
-
get clusterCount() {
|
|
129774
|
-
return this.unlimitedStore ? this.unlimitedStore.size : this.limitedStore.size;
|
|
129775
|
-
}
|
|
129776
|
-
getTotalClusterSize() {
|
|
129777
|
-
let t2 = 0;
|
|
129778
|
-
if (this.unlimitedStore) for (let r of this.unlimitedStore.values()) t2 += r.size;
|
|
129779
|
-
else for (let r of this.limitedStore.values()) t2 += r.size;
|
|
129780
|
-
return t2;
|
|
129781
|
-
}
|
|
129782
|
-
clusterPeek(t2) {
|
|
129783
|
-
return this.unlimitedStore ? this.unlimitedStore.get(t2) : this.limitedStore.peek(t2);
|
|
129784
|
-
}
|
|
129785
|
-
clusterGet(t2) {
|
|
129786
|
-
return this.unlimitedStore ? this.unlimitedStore.get(t2) : this.limitedStore.get(t2);
|
|
129787
|
-
}
|
|
129788
|
-
clusterContains(t2) {
|
|
129789
|
-
return this.unlimitedStore ? this.unlimitedStore.has(t2) : this.limitedStore.has(t2);
|
|
129790
|
-
}
|
|
129791
|
-
clusterInsert(t2, r) {
|
|
129792
|
-
this.unlimitedStore ? this.unlimitedStore.set(t2, r) : this.limitedStore.put(t2, r);
|
|
129793
|
-
}
|
|
129794
|
-
static hasNumbers(t2) {
|
|
129795
|
-
for (let r = 0; r < t2.length; r++) {
|
|
129796
|
-
let s3 = t2.charCodeAt(r);
|
|
129797
|
-
if (s3 >= 48 && s3 <= 57) return true;
|
|
129798
|
-
}
|
|
129799
|
-
return false;
|
|
129800
|
-
}
|
|
129801
|
-
getContentAsTokens(t2) {
|
|
129802
|
-
let r = t2.trim();
|
|
129803
|
-
for (let s3 of this.extraDelimiters) r = r.split(s3).join(" ");
|
|
129804
|
-
return r.length === 0 ? [] : r.split(/\s+/);
|
|
129805
|
-
}
|
|
129806
|
-
getSeqDistance(t2, r, s3) {
|
|
129807
|
-
if (t2.length !== r.length) throw new Error("seq1 and seq2 must have equal length");
|
|
129808
|
-
if (t2.length === 0) return [1, 0];
|
|
129809
|
-
let i2 = 0, e2 = 0;
|
|
129810
|
-
for (let o = 0; o < t2.length; o++) {
|
|
129811
|
-
if (t2[o] === this.paramStr) {
|
|
129812
|
-
e2++;
|
|
129813
|
-
continue;
|
|
129814
|
-
}
|
|
129815
|
-
t2[o] === r[o] && i2++;
|
|
129816
|
-
}
|
|
129817
|
-
return s3 && (i2 += e2), [i2 / t2.length, e2];
|
|
129818
|
-
}
|
|
129819
|
-
createTemplate(t2, r) {
|
|
129820
|
-
if (t2.length !== r.length) throw new Error("seq1 and seq2 must have equal length");
|
|
129821
|
-
return t2.map((s3, i2) => s3 === r[i2] ? r[i2] : this.paramStr);
|
|
129822
|
-
}
|
|
129823
|
-
fastMatch(t2, r, s3, i2) {
|
|
129824
|
-
let e2 = -1, o = -1, n7 = null;
|
|
129825
|
-
for (let l of t2) {
|
|
129826
|
-
let u2 = this.clusterPeek(l);
|
|
129827
|
-
if (!u2) continue;
|
|
129828
|
-
let [a3, d3] = this.getSeqDistance(u2.logTemplateTokens, r, i2);
|
|
129829
|
-
(a3 > e2 || a3 === e2 && d3 > o) && (e2 = a3, o = d3, n7 = l);
|
|
129830
|
-
}
|
|
129831
|
-
return e2 >= s3 ? n7 : null;
|
|
129832
|
-
}
|
|
129833
|
-
treeSearch(t2, r, s3) {
|
|
129834
|
-
let i2 = t2.length, e2 = String(i2), o = this.rootNode.keyToChildNode.get(e2);
|
|
129835
|
-
if (!o) return null;
|
|
129836
|
-
if (i2 === 0) {
|
|
129837
|
-
let u2 = o.clusterIds[0];
|
|
129838
|
-
return u2 !== void 0 ? u2 : null;
|
|
129839
|
-
}
|
|
129840
|
-
let n7 = o, l = 1;
|
|
129841
|
-
for (let u2 of t2) {
|
|
129842
|
-
if (l >= this.maxNodeDepth || l >= i2) break;
|
|
129843
|
-
let a3 = n7.keyToChildNode.get(u2);
|
|
129844
|
-
if (a3) n7 = a3;
|
|
129845
|
-
else {
|
|
129846
|
-
let d3 = n7.keyToChildNode.get(this.paramStr);
|
|
129847
|
-
if (d3) n7 = d3;
|
|
129848
|
-
else return null;
|
|
129849
|
-
}
|
|
129850
|
-
l++;
|
|
129851
|
-
}
|
|
129852
|
-
return this.fastMatch(n7.clusterIds, t2, r, s3);
|
|
129853
|
-
}
|
|
129854
|
-
addSeqToPrefixTree(t2, r) {
|
|
129855
|
-
let s3 = r.length, i2 = String(s3);
|
|
129856
|
-
this.rootNode.keyToChildNode.has(i2) || this.rootNode.keyToChildNode.set(i2, new _chunkWVA66XTCjs.a());
|
|
129857
|
-
let e2 = this.rootNode.keyToChildNode.get(i2);
|
|
129858
|
-
if (s3 === 0) {
|
|
129859
|
-
e2.clusterIds = [t2];
|
|
129860
|
-
return;
|
|
129861
|
-
}
|
|
129862
|
-
let o = 1;
|
|
129863
|
-
for (let n7 of r) {
|
|
129864
|
-
if (o >= this.maxNodeDepth || o >= s3) {
|
|
129865
|
-
let l = e2.clusterIds.filter((u2) => this.clusterContains(u2));
|
|
129866
|
-
l.push(t2), e2.clusterIds = l;
|
|
129867
|
-
break;
|
|
129931
|
+
*
|
|
129932
|
+
* @example
|
|
129933
|
+
*
|
|
129934
|
+
* var SHA256 = CryptoJS.lib.Hasher._createHelper(CryptoJS.algo.SHA256);
|
|
129935
|
+
*/
|
|
129936
|
+
_createHelper: function(hasher) {
|
|
129937
|
+
return function(message, cfg) {
|
|
129938
|
+
return new hasher.init(cfg).finalize(message);
|
|
129939
|
+
};
|
|
129940
|
+
},
|
|
129941
|
+
/**
|
|
129942
|
+
* Creates a shortcut function to the HMAC's object interface.
|
|
129943
|
+
*
|
|
129944
|
+
* @param {Hasher} hasher The hasher to use in this HMAC helper.
|
|
129945
|
+
*
|
|
129946
|
+
* @return {Function} The shortcut function.
|
|
129947
|
+
*
|
|
129948
|
+
* @static
|
|
129949
|
+
*
|
|
129950
|
+
* @example
|
|
129951
|
+
*
|
|
129952
|
+
* var HmacSHA256 = CryptoJS.lib.Hasher._createHmacHelper(CryptoJS.algo.SHA256);
|
|
129953
|
+
*/
|
|
129954
|
+
_createHmacHelper: function(hasher) {
|
|
129955
|
+
return function(message, key) {
|
|
129956
|
+
return new C_algo.HMAC.init(hasher, key).finalize(message);
|
|
129957
|
+
};
|
|
129868
129958
|
}
|
|
129869
|
-
|
|
129870
|
-
}
|
|
129871
|
-
|
|
129872
|
-
|
|
129873
|
-
|
|
129874
|
-
|
|
129875
|
-
this.clustersCounter++;
|
|
129876
|
-
let n7 = this.clustersCounter, l = new (0, _chunk4S7NGOPOjs.a)(r, n7);
|
|
129877
|
-
return this.clusterInsert(n7, l), this.addSeqToPrefixTree(n7, r), [l, "cluster_created"];
|
|
129878
|
-
}
|
|
129879
|
-
let i2 = this.clusterPeek(s3), e2 = this.createTemplate(r, i2.logTemplateTokens), o = e2.length === i2.logTemplateTokens.length && e2.every((n7, l) => n7 === i2.logTemplateTokens[l]) ? "none" : "cluster_template_changed";
|
|
129880
|
-
return i2.logTemplateTokens = e2, i2.size += 1, this.clusterGet(s3), [i2, o];
|
|
129881
|
-
}
|
|
129882
|
-
getClustersIdsForSeqLen(t2) {
|
|
129883
|
-
let r = (o, n7) => {
|
|
129884
|
-
n7.push(...o.clusterIds);
|
|
129885
|
-
for (let l of o.keyToChildNode.values()) r(l, n7);
|
|
129886
|
-
}, s3 = String(t2), i2 = this.rootNode.keyToChildNode.get(s3);
|
|
129887
|
-
if (!i2) return [];
|
|
129888
|
-
let e2 = [];
|
|
129889
|
-
return r(i2, e2), e2;
|
|
129890
|
-
}
|
|
129891
|
-
match(t2, r = "never") {
|
|
129892
|
-
if (!["always", "never", "fallback"].includes(r)) throw new Error(`Invalid full_search_strategy: ${r}`);
|
|
129893
|
-
let s3 = this.getContentAsTokens(t2), i2 = 1, e2 = () => {
|
|
129894
|
-
let n7 = this.getClustersIdsForSeqLen(s3.length), l = this.fastMatch(n7, s3, i2, true);
|
|
129895
|
-
return l === null ? null : _nullishCoalesce(this.clusterPeek(l), () => null);
|
|
129896
|
-
};
|
|
129897
|
-
if (r === "always") return e2();
|
|
129898
|
-
let o = this.treeSearch(s3, i2, true);
|
|
129899
|
-
return o !== null ? _nullishCoalesce(this.clusterPeek(o), () => null) : r === "never" ? null : e2();
|
|
129900
|
-
}
|
|
129901
|
-
};
|
|
129902
|
-
exports.a = g;
|
|
129903
|
-
}
|
|
129904
|
-
});
|
|
129905
|
-
|
|
129906
|
-
// ../common-utils/dist/chunk-DBDYKVVO.js
|
|
129907
|
-
var require_chunk_DBDYKVVO = __commonJS({
|
|
129908
|
-
"../common-utils/dist/chunk-DBDYKVVO.js"(exports) {
|
|
129909
|
-
"use strict";
|
|
129910
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
129911
|
-
function _nullishCoalesce(lhs, rhsFn) {
|
|
129912
|
-
if (lhs != null) {
|
|
129913
|
-
return lhs;
|
|
129914
|
-
} else {
|
|
129915
|
-
return rhsFn();
|
|
129916
|
-
}
|
|
129917
|
-
}
|
|
129918
|
-
var e2 = class {
|
|
129919
|
-
constructor(s3, t2) {
|
|
129920
|
-
this._pattern = s3, this.regex = new RegExp(s3, "g"), this.maskWith = t2;
|
|
129921
|
-
}
|
|
129922
|
-
get pattern() {
|
|
129923
|
-
return this._pattern;
|
|
129924
|
-
}
|
|
129925
|
-
mask(s3, t2, i2) {
|
|
129926
|
-
let r = t2 + this.maskWith + i2;
|
|
129927
|
-
return this.regex.lastIndex = 0, s3.replace(this.regex, r);
|
|
129928
|
-
}
|
|
129929
|
-
};
|
|
129930
|
-
var a3 = exports.b = class {
|
|
129931
|
-
constructor(s3, t2, i2) {
|
|
129932
|
-
this.maskPrefix = t2, this.maskSuffix = i2, this._maskingInstructions = s3, this.maskNameToInstructions = /* @__PURE__ */ new Map();
|
|
129933
|
-
for (let r of s3) {
|
|
129934
|
-
let n7 = _nullishCoalesce(this.maskNameToInstructions.get(r.maskWith), () => []);
|
|
129935
|
-
n7.push(r), this.maskNameToInstructions.set(r.maskWith, n7);
|
|
129936
|
-
}
|
|
129937
|
-
}
|
|
129938
|
-
mask(s3) {
|
|
129939
|
-
let t2 = s3;
|
|
129940
|
-
for (let i2 of this._maskingInstructions) t2 = i2.mask(t2, this.maskPrefix, this.maskSuffix);
|
|
129941
|
-
return t2;
|
|
129942
|
-
}
|
|
129943
|
-
get maskNames() {
|
|
129944
|
-
return Array.from(this.maskNameToInstructions.keys());
|
|
129945
|
-
}
|
|
129946
|
-
instructionsByMaskName(s3) {
|
|
129947
|
-
return _nullishCoalesce(this.maskNameToInstructions.get(s3), () => []);
|
|
129948
|
-
}
|
|
129949
|
-
};
|
|
129950
|
-
exports.a = e2;
|
|
129951
|
-
exports.b = a3;
|
|
129952
|
-
}
|
|
129953
|
-
});
|
|
129954
|
-
|
|
129955
|
-
// ../common-utils/dist/chunk-PPIKEHOH.js
|
|
129956
|
-
var require_chunk_PPIKEHOH = __commonJS({
|
|
129957
|
-
"../common-utils/dist/chunk-PPIKEHOH.js"(exports) {
|
|
129958
|
-
"use strict";
|
|
129959
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
129960
|
-
function _nullishCoalesce(lhs, rhsFn) {
|
|
129961
|
-
if (lhs != null) {
|
|
129962
|
-
return lhs;
|
|
129963
|
-
} else {
|
|
129964
|
-
return rhsFn();
|
|
129965
|
-
}
|
|
129966
|
-
}
|
|
129967
|
-
var _class;
|
|
129968
|
-
var t2 = (_class = class e2 {
|
|
129969
|
-
constructor() {
|
|
129970
|
-
_class.prototype.__init.call(this);
|
|
129971
|
-
_class.prototype.__init2.call(this);
|
|
129972
|
-
_class.prototype.__init3.call(this);
|
|
129973
|
-
_class.prototype.__init4.call(this);
|
|
129974
|
-
_class.prototype.__init5.call(this);
|
|
129975
|
-
_class.prototype.__init6.call(this);
|
|
129976
|
-
_class.prototype.__init7.call(this);
|
|
129977
|
-
_class.prototype.__init8.call(this);
|
|
129978
|
-
_class.prototype.__init9.call(this);
|
|
129979
|
-
_class.prototype.__init10.call(this);
|
|
129980
|
-
}
|
|
129981
|
-
__init() {
|
|
129982
|
-
this.drainDepth = 4;
|
|
129983
|
-
}
|
|
129984
|
-
__init2() {
|
|
129985
|
-
this.drainSimTh = 0.4;
|
|
129986
|
-
}
|
|
129987
|
-
__init3() {
|
|
129988
|
-
this.drainMaxChildren = 100;
|
|
129989
|
-
}
|
|
129990
|
-
__init4() {
|
|
129991
|
-
this.drainMaxClusters = null;
|
|
129992
|
-
}
|
|
129993
|
-
__init5() {
|
|
129994
|
-
this.drainExtraDelimiters = [];
|
|
129995
|
-
}
|
|
129996
|
-
__init6() {
|
|
129997
|
-
this.maskPrefix = "<";
|
|
129998
|
-
}
|
|
129999
|
-
__init7() {
|
|
130000
|
-
this.maskSuffix = ">";
|
|
130001
|
-
}
|
|
130002
|
-
__init8() {
|
|
130003
|
-
this.maskingInstructions = [];
|
|
130004
|
-
}
|
|
130005
|
-
__init9() {
|
|
130006
|
-
this.parametrizeNumericTokens = true;
|
|
130007
|
-
}
|
|
130008
|
-
__init10() {
|
|
130009
|
-
this.parameterExtractionCacheCapacity = 3e3;
|
|
130010
|
-
}
|
|
130011
|
-
static fromJSON(r) {
|
|
130012
|
-
let i2 = new e2();
|
|
130013
|
-
return typeof r.drain_depth == "number" && (i2.drainDepth = r.drain_depth), typeof r.drain_sim_th == "number" && (i2.drainSimTh = r.drain_sim_th), typeof r.drain_max_children == "number" && (i2.drainMaxChildren = r.drain_max_children), (typeof r.drain_max_clusters == "number" || r.drain_max_clusters === null) && (i2.drainMaxClusters = r.drain_max_clusters), Array.isArray(r.drain_extra_delimiters) && (i2.drainExtraDelimiters = r.drain_extra_delimiters.filter((a3) => typeof a3 == "string")), typeof r.mask_prefix == "string" && (i2.maskPrefix = r.mask_prefix), typeof r.mask_suffix == "string" && (i2.maskSuffix = r.mask_suffix), typeof r.parametrize_numeric_tokens == "boolean" && (i2.parametrizeNumericTokens = r.parametrize_numeric_tokens), typeof r.parameter_extraction_cache_capacity == "number" && (i2.parameterExtractionCacheCapacity = r.parameter_extraction_cache_capacity), Array.isArray(r.masking_instructions) && (i2.maskingInstructions = r.masking_instructions.filter((a3) => typeof a3 == "object" && a3 !== null).map((a3) => ({ pattern: _nullishCoalesce(a3.regex_pattern, () => a3.pattern), maskWith: _nullishCoalesce(a3.mask_with, () => a3.maskWith) }))), i2;
|
|
130014
|
-
}
|
|
130015
|
-
}, _class);
|
|
130016
|
-
exports.a = t2;
|
|
129959
|
+
});
|
|
129960
|
+
var C_algo = C2.algo = {};
|
|
129961
|
+
return C2;
|
|
129962
|
+
}(Math);
|
|
129963
|
+
return CryptoJS;
|
|
129964
|
+
});
|
|
130017
129965
|
}
|
|
130018
129966
|
});
|
|
130019
129967
|
|
|
130020
|
-
//
|
|
130021
|
-
var
|
|
130022
|
-
"
|
|
129968
|
+
// ../../node_modules/crypto-js/md5.js
|
|
129969
|
+
var require_md5 = __commonJS({
|
|
129970
|
+
"../../node_modules/crypto-js/md5.js"(exports, module) {
|
|
130023
129971
|
"use strict";
|
|
130024
|
-
|
|
130025
|
-
|
|
130026
|
-
|
|
130027
|
-
|
|
129972
|
+
(function(root, factory) {
|
|
129973
|
+
if (typeof exports === "object") {
|
|
129974
|
+
module.exports = exports = factory(require_core());
|
|
129975
|
+
} else if (typeof define === "function" && define.amd) {
|
|
129976
|
+
define(["./core"], factory);
|
|
130028
129977
|
} else {
|
|
130029
|
-
|
|
130030
|
-
}
|
|
130031
|
-
}
|
|
130032
|
-
var _chunk5CFDOSQLjs = require_chunk_5CFDOSQL();
|
|
130033
|
-
var _chunkG5BIG2ANjs = require_chunk_G5BIG2AN();
|
|
130034
|
-
var _chunkDBDYKVVOjs = require_chunk_DBDYKVVO();
|
|
130035
|
-
var _chunkPPIKEHOHjs = require_chunk_PPIKEHOH();
|
|
130036
|
-
var w2 = class {
|
|
130037
|
-
constructor(t2) {
|
|
130038
|
-
let e2 = _nullishCoalesce(t2, () => new _chunkPPIKEHOHjs.a()), r = e2.maskPrefix + "*" + e2.maskSuffix, a3 = e2.maskingInstructions.map((n7) => new (0, _chunkDBDYKVVOjs.a)(n7.pattern, n7.maskWith));
|
|
130039
|
-
this.masker = new (0, _chunkDBDYKVVOjs.b)(a3, e2.maskPrefix, e2.maskSuffix), this.drain = new (0, _chunk5CFDOSQLjs.a)(e2.drainDepth, e2.drainSimTh, e2.drainMaxChildren, e2.drainMaxClusters, e2.drainExtraDelimiters, r, e2.parametrizeNumericTokens), this.extractionCache = new (0, _chunkG5BIG2ANjs.a)(e2.parameterExtractionCacheCapacity), this.extraDelimiters = e2.drainExtraDelimiters;
|
|
130040
|
-
}
|
|
130041
|
-
addLogMessage(t2) {
|
|
130042
|
-
let e2 = this.masker.mask(t2), [r, a3] = this.drain.addLogMessage(e2);
|
|
130043
|
-
return { changeType: a3, clusterId: r.clusterId, clusterSize: r.size, templateMined: r.getTemplate(), clusterCount: this.drain.clusterCount };
|
|
130044
|
-
}
|
|
130045
|
-
match(t2, e2 = "never") {
|
|
130046
|
-
let r = this.masker.mask(t2);
|
|
130047
|
-
return this.drain.match(r, e2);
|
|
130048
|
-
}
|
|
130049
|
-
extractParameters(t2, e2, r = true) {
|
|
130050
|
-
let a3 = e2;
|
|
130051
|
-
for (let i2 of this.extraDelimiters) a3 = a3.split(i2).join(" ");
|
|
130052
|
-
let { regex: n7, paramMap: g } = this.getTemplateParameterExtractionRegex(t2, r), m3 = a3.match(new RegExp(n7));
|
|
130053
|
-
if (!m3 || !m3.groups) return null;
|
|
130054
|
-
let p = [];
|
|
130055
|
-
for (let [i2, s3] of g) {
|
|
130056
|
-
let o = m3.groups[i2];
|
|
130057
|
-
o !== void 0 && p.push({ value: o, maskName: s3 });
|
|
130058
|
-
}
|
|
130059
|
-
return p.sort((i2, s3) => {
|
|
130060
|
-
let o = a3.indexOf(i2.value), c3 = a3.indexOf(s3.value);
|
|
130061
|
-
return o - c3;
|
|
130062
|
-
}), p;
|
|
129978
|
+
factory(root.CryptoJS);
|
|
130063
129979
|
}
|
|
130064
|
-
|
|
130065
|
-
|
|
130066
|
-
|
|
130067
|
-
|
|
130068
|
-
|
|
130069
|
-
|
|
130070
|
-
|
|
130071
|
-
|
|
130072
|
-
|
|
130073
|
-
|
|
130074
|
-
|
|
130075
|
-
|
|
130076
|
-
|
|
129980
|
+
})(exports, function(CryptoJS) {
|
|
129981
|
+
(function(Math2) {
|
|
129982
|
+
var C2 = CryptoJS;
|
|
129983
|
+
var C_lib = C2.lib;
|
|
129984
|
+
var WordArray = C_lib.WordArray;
|
|
129985
|
+
var Hasher = C_lib.Hasher;
|
|
129986
|
+
var C_algo = C2.algo;
|
|
129987
|
+
var T3 = [];
|
|
129988
|
+
(function() {
|
|
129989
|
+
for (var i2 = 0; i2 < 64; i2++) {
|
|
129990
|
+
T3[i2] = Math2.abs(Math2.sin(i2 + 1)) * 4294967296 | 0;
|
|
129991
|
+
}
|
|
129992
|
+
})();
|
|
129993
|
+
var MD52 = C_algo.MD5 = Hasher.extend({
|
|
129994
|
+
_doReset: function() {
|
|
129995
|
+
this._hash = new WordArray.init([
|
|
129996
|
+
1732584193,
|
|
129997
|
+
4023233417,
|
|
129998
|
+
2562383102,
|
|
129999
|
+
271733878
|
|
130000
|
+
]);
|
|
130001
|
+
},
|
|
130002
|
+
_doProcessBlock: function(M4, offset) {
|
|
130003
|
+
for (var i2 = 0; i2 < 16; i2++) {
|
|
130004
|
+
var offset_i = offset + i2;
|
|
130005
|
+
var M_offset_i = M4[offset_i];
|
|
130006
|
+
M4[offset_i] = (M_offset_i << 8 | M_offset_i >>> 24) & 16711935 | (M_offset_i << 24 | M_offset_i >>> 8) & 4278255360;
|
|
130077
130007
|
}
|
|
130078
|
-
|
|
130079
|
-
|
|
130080
|
-
|
|
130081
|
-
|
|
130082
|
-
|
|
130083
|
-
|
|
130008
|
+
var H4 = this._hash.words;
|
|
130009
|
+
var M_offset_0 = M4[offset + 0];
|
|
130010
|
+
var M_offset_1 = M4[offset + 1];
|
|
130011
|
+
var M_offset_2 = M4[offset + 2];
|
|
130012
|
+
var M_offset_3 = M4[offset + 3];
|
|
130013
|
+
var M_offset_4 = M4[offset + 4];
|
|
130014
|
+
var M_offset_5 = M4[offset + 5];
|
|
130015
|
+
var M_offset_6 = M4[offset + 6];
|
|
130016
|
+
var M_offset_7 = M4[offset + 7];
|
|
130017
|
+
var M_offset_8 = M4[offset + 8];
|
|
130018
|
+
var M_offset_9 = M4[offset + 9];
|
|
130019
|
+
var M_offset_10 = M4[offset + 10];
|
|
130020
|
+
var M_offset_11 = M4[offset + 11];
|
|
130021
|
+
var M_offset_12 = M4[offset + 12];
|
|
130022
|
+
var M_offset_13 = M4[offset + 13];
|
|
130023
|
+
var M_offset_14 = M4[offset + 14];
|
|
130024
|
+
var M_offset_15 = M4[offset + 15];
|
|
130025
|
+
var a3 = H4[0];
|
|
130026
|
+
var b2 = H4[1];
|
|
130027
|
+
var c3 = H4[2];
|
|
130028
|
+
var d3 = H4[3];
|
|
130029
|
+
a3 = FF(a3, b2, c3, d3, M_offset_0, 7, T3[0]);
|
|
130030
|
+
d3 = FF(d3, a3, b2, c3, M_offset_1, 12, T3[1]);
|
|
130031
|
+
c3 = FF(c3, d3, a3, b2, M_offset_2, 17, T3[2]);
|
|
130032
|
+
b2 = FF(b2, c3, d3, a3, M_offset_3, 22, T3[3]);
|
|
130033
|
+
a3 = FF(a3, b2, c3, d3, M_offset_4, 7, T3[4]);
|
|
130034
|
+
d3 = FF(d3, a3, b2, c3, M_offset_5, 12, T3[5]);
|
|
130035
|
+
c3 = FF(c3, d3, a3, b2, M_offset_6, 17, T3[6]);
|
|
130036
|
+
b2 = FF(b2, c3, d3, a3, M_offset_7, 22, T3[7]);
|
|
130037
|
+
a3 = FF(a3, b2, c3, d3, M_offset_8, 7, T3[8]);
|
|
130038
|
+
d3 = FF(d3, a3, b2, c3, M_offset_9, 12, T3[9]);
|
|
130039
|
+
c3 = FF(c3, d3, a3, b2, M_offset_10, 17, T3[10]);
|
|
130040
|
+
b2 = FF(b2, c3, d3, a3, M_offset_11, 22, T3[11]);
|
|
130041
|
+
a3 = FF(a3, b2, c3, d3, M_offset_12, 7, T3[12]);
|
|
130042
|
+
d3 = FF(d3, a3, b2, c3, M_offset_13, 12, T3[13]);
|
|
130043
|
+
c3 = FF(c3, d3, a3, b2, M_offset_14, 17, T3[14]);
|
|
130044
|
+
b2 = FF(b2, c3, d3, a3, M_offset_15, 22, T3[15]);
|
|
130045
|
+
a3 = GG(a3, b2, c3, d3, M_offset_1, 5, T3[16]);
|
|
130046
|
+
d3 = GG(d3, a3, b2, c3, M_offset_6, 9, T3[17]);
|
|
130047
|
+
c3 = GG(c3, d3, a3, b2, M_offset_11, 14, T3[18]);
|
|
130048
|
+
b2 = GG(b2, c3, d3, a3, M_offset_0, 20, T3[19]);
|
|
130049
|
+
a3 = GG(a3, b2, c3, d3, M_offset_5, 5, T3[20]);
|
|
130050
|
+
d3 = GG(d3, a3, b2, c3, M_offset_10, 9, T3[21]);
|
|
130051
|
+
c3 = GG(c3, d3, a3, b2, M_offset_15, 14, T3[22]);
|
|
130052
|
+
b2 = GG(b2, c3, d3, a3, M_offset_4, 20, T3[23]);
|
|
130053
|
+
a3 = GG(a3, b2, c3, d3, M_offset_9, 5, T3[24]);
|
|
130054
|
+
d3 = GG(d3, a3, b2, c3, M_offset_14, 9, T3[25]);
|
|
130055
|
+
c3 = GG(c3, d3, a3, b2, M_offset_3, 14, T3[26]);
|
|
130056
|
+
b2 = GG(b2, c3, d3, a3, M_offset_8, 20, T3[27]);
|
|
130057
|
+
a3 = GG(a3, b2, c3, d3, M_offset_13, 5, T3[28]);
|
|
130058
|
+
d3 = GG(d3, a3, b2, c3, M_offset_2, 9, T3[29]);
|
|
130059
|
+
c3 = GG(c3, d3, a3, b2, M_offset_7, 14, T3[30]);
|
|
130060
|
+
b2 = GG(b2, c3, d3, a3, M_offset_12, 20, T3[31]);
|
|
130061
|
+
a3 = HH(a3, b2, c3, d3, M_offset_5, 4, T3[32]);
|
|
130062
|
+
d3 = HH(d3, a3, b2, c3, M_offset_8, 11, T3[33]);
|
|
130063
|
+
c3 = HH(c3, d3, a3, b2, M_offset_11, 16, T3[34]);
|
|
130064
|
+
b2 = HH(b2, c3, d3, a3, M_offset_14, 23, T3[35]);
|
|
130065
|
+
a3 = HH(a3, b2, c3, d3, M_offset_1, 4, T3[36]);
|
|
130066
|
+
d3 = HH(d3, a3, b2, c3, M_offset_4, 11, T3[37]);
|
|
130067
|
+
c3 = HH(c3, d3, a3, b2, M_offset_7, 16, T3[38]);
|
|
130068
|
+
b2 = HH(b2, c3, d3, a3, M_offset_10, 23, T3[39]);
|
|
130069
|
+
a3 = HH(a3, b2, c3, d3, M_offset_13, 4, T3[40]);
|
|
130070
|
+
d3 = HH(d3, a3, b2, c3, M_offset_0, 11, T3[41]);
|
|
130071
|
+
c3 = HH(c3, d3, a3, b2, M_offset_3, 16, T3[42]);
|
|
130072
|
+
b2 = HH(b2, c3, d3, a3, M_offset_6, 23, T3[43]);
|
|
130073
|
+
a3 = HH(a3, b2, c3, d3, M_offset_9, 4, T3[44]);
|
|
130074
|
+
d3 = HH(d3, a3, b2, c3, M_offset_12, 11, T3[45]);
|
|
130075
|
+
c3 = HH(c3, d3, a3, b2, M_offset_15, 16, T3[46]);
|
|
130076
|
+
b2 = HH(b2, c3, d3, a3, M_offset_2, 23, T3[47]);
|
|
130077
|
+
a3 = II(a3, b2, c3, d3, M_offset_0, 6, T3[48]);
|
|
130078
|
+
d3 = II(d3, a3, b2, c3, M_offset_7, 10, T3[49]);
|
|
130079
|
+
c3 = II(c3, d3, a3, b2, M_offset_14, 15, T3[50]);
|
|
130080
|
+
b2 = II(b2, c3, d3, a3, M_offset_5, 21, T3[51]);
|
|
130081
|
+
a3 = II(a3, b2, c3, d3, M_offset_12, 6, T3[52]);
|
|
130082
|
+
d3 = II(d3, a3, b2, c3, M_offset_3, 10, T3[53]);
|
|
130083
|
+
c3 = II(c3, d3, a3, b2, M_offset_10, 15, T3[54]);
|
|
130084
|
+
b2 = II(b2, c3, d3, a3, M_offset_1, 21, T3[55]);
|
|
130085
|
+
a3 = II(a3, b2, c3, d3, M_offset_8, 6, T3[56]);
|
|
130086
|
+
d3 = II(d3, a3, b2, c3, M_offset_15, 10, T3[57]);
|
|
130087
|
+
c3 = II(c3, d3, a3, b2, M_offset_6, 15, T3[58]);
|
|
130088
|
+
b2 = II(b2, c3, d3, a3, M_offset_13, 21, T3[59]);
|
|
130089
|
+
a3 = II(a3, b2, c3, d3, M_offset_4, 6, T3[60]);
|
|
130090
|
+
d3 = II(d3, a3, b2, c3, M_offset_11, 10, T3[61]);
|
|
130091
|
+
c3 = II(c3, d3, a3, b2, M_offset_2, 15, T3[62]);
|
|
130092
|
+
b2 = II(b2, c3, d3, a3, M_offset_9, 21, T3[63]);
|
|
130093
|
+
H4[0] = H4[0] + a3 | 0;
|
|
130094
|
+
H4[1] = H4[1] + b2 | 0;
|
|
130095
|
+
H4[2] = H4[2] + c3 | 0;
|
|
130096
|
+
H4[3] = H4[3] + d3 | 0;
|
|
130097
|
+
},
|
|
130098
|
+
_doFinalize: function() {
|
|
130099
|
+
var data = this._data;
|
|
130100
|
+
var dataWords = data.words;
|
|
130101
|
+
var nBitsTotal = this._nDataBytes * 8;
|
|
130102
|
+
var nBitsLeft = data.sigBytes * 8;
|
|
130103
|
+
dataWords[nBitsLeft >>> 5] |= 128 << 24 - nBitsLeft % 32;
|
|
130104
|
+
var nBitsTotalH = Math2.floor(nBitsTotal / 4294967296);
|
|
130105
|
+
var nBitsTotalL = nBitsTotal;
|
|
130106
|
+
dataWords[(nBitsLeft + 64 >>> 9 << 4) + 15] = (nBitsTotalH << 8 | nBitsTotalH >>> 24) & 16711935 | (nBitsTotalH << 24 | nBitsTotalH >>> 8) & 4278255360;
|
|
130107
|
+
dataWords[(nBitsLeft + 64 >>> 9 << 4) + 14] = (nBitsTotalL << 8 | nBitsTotalL >>> 24) & 16711935 | (nBitsTotalL << 24 | nBitsTotalL >>> 8) & 4278255360;
|
|
130108
|
+
data.sigBytes = (dataWords.length + 1) * 4;
|
|
130109
|
+
this._process();
|
|
130110
|
+
var hash = this._hash;
|
|
130111
|
+
var H4 = hash.words;
|
|
130112
|
+
for (var i2 = 0; i2 < 4; i2++) {
|
|
130113
|
+
var H_i = H4[i2];
|
|
130114
|
+
H4[i2] = (H_i << 8 | H_i >>> 24) & 16711935 | (H_i << 24 | H_i >>> 8) & 4278255360;
|
|
130115
|
+
}
|
|
130116
|
+
return hash;
|
|
130117
|
+
},
|
|
130118
|
+
clone: function() {
|
|
130119
|
+
var clone = Hasher.clone.call(this);
|
|
130120
|
+
clone._hash = this._hash.clone();
|
|
130121
|
+
return clone;
|
|
130084
130122
|
}
|
|
130123
|
+
});
|
|
130124
|
+
function FF(a3, b2, c3, d3, x3, s3, t2) {
|
|
130125
|
+
var n7 = a3 + (b2 & c3 | ~b2 & d3) + x3 + t2;
|
|
130126
|
+
return (n7 << s3 | n7 >>> 32 - s3) + b2;
|
|
130085
130127
|
}
|
|
130086
|
-
|
|
130087
|
-
|
|
130088
|
-
|
|
130089
|
-
|
|
130090
|
-
|
|
130091
|
-
|
|
130092
|
-
|
|
130093
|
-
|
|
130094
|
-
|
|
130095
|
-
|
|
130096
|
-
|
|
130097
|
-
|
|
130098
|
-
|
|
130099
|
-
|
|
130100
|
-
|
|
130101
|
-
|
|
130102
|
-
|
|
130103
|
-
// ../common-utils/dist/drain/index.js
|
|
130104
|
-
var require_drain = __commonJS({
|
|
130105
|
-
"../common-utils/dist/drain/index.js"(exports) {
|
|
130106
|
-
"use strict";
|
|
130107
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
130108
|
-
var _chunkT3C32CKCjs = require_chunk_T3C32CKC();
|
|
130109
|
-
var _chunk5CFDOSQLjs = require_chunk_5CFDOSQL();
|
|
130110
|
-
var _chunk4S7NGOPOjs = require_chunk_4S7NGOPO();
|
|
130111
|
-
var _chunkG5BIG2ANjs = require_chunk_G5BIG2AN();
|
|
130112
|
-
var _chunkDBDYKVVOjs = require_chunk_DBDYKVVO();
|
|
130113
|
-
var _chunkWVA66XTCjs = require_chunk_WVA66XTC();
|
|
130114
|
-
var _chunkPPIKEHOHjs = require_chunk_PPIKEHOH();
|
|
130115
|
-
exports.Drain = _chunk5CFDOSQLjs.a;
|
|
130116
|
-
exports.LogCluster = _chunk4S7NGOPOjs.a;
|
|
130117
|
-
exports.LogMasker = _chunkDBDYKVVOjs.b;
|
|
130118
|
-
exports.LruCache = _chunkG5BIG2ANjs.a;
|
|
130119
|
-
exports.MaskingInstruction = _chunkDBDYKVVOjs.a;
|
|
130120
|
-
exports.Node = _chunkWVA66XTCjs.a;
|
|
130121
|
-
exports.TemplateMiner = _chunkT3C32CKCjs.a;
|
|
130122
|
-
exports.TemplateMinerConfig = _chunkPPIKEHOHjs.a;
|
|
130128
|
+
function GG(a3, b2, c3, d3, x3, s3, t2) {
|
|
130129
|
+
var n7 = a3 + (b2 & d3 | c3 & ~d3) + x3 + t2;
|
|
130130
|
+
return (n7 << s3 | n7 >>> 32 - s3) + b2;
|
|
130131
|
+
}
|
|
130132
|
+
function HH(a3, b2, c3, d3, x3, s3, t2) {
|
|
130133
|
+
var n7 = a3 + (b2 ^ c3 ^ d3) + x3 + t2;
|
|
130134
|
+
return (n7 << s3 | n7 >>> 32 - s3) + b2;
|
|
130135
|
+
}
|
|
130136
|
+
function II(a3, b2, c3, d3, x3, s3, t2) {
|
|
130137
|
+
var n7 = a3 + (c3 ^ (b2 | ~d3)) + x3 + t2;
|
|
130138
|
+
return (n7 << s3 | n7 >>> 32 - s3) + b2;
|
|
130139
|
+
}
|
|
130140
|
+
C2.MD5 = Hasher._createHelper(MD52);
|
|
130141
|
+
C2.HmacMD5 = Hasher._createHmacHelper(MD52);
|
|
130142
|
+
})(Math);
|
|
130143
|
+
return CryptoJS.MD5;
|
|
130144
|
+
});
|
|
130123
130145
|
}
|
|
130124
130146
|
});
|
|
130125
130147
|
|
|
@@ -138637,6 +138659,9 @@ var {
|
|
|
138637
138659
|
Help
|
|
138638
138660
|
} = import_index.default;
|
|
138639
138661
|
|
|
138662
|
+
// src/cli.tsx
|
|
138663
|
+
var import_drain2 = __toESM(require_drain(), 1);
|
|
138664
|
+
|
|
138640
138665
|
// src/App.tsx
|
|
138641
138666
|
var import_react44 = __toESM(require_react(), 1);
|
|
138642
138667
|
var import_types3 = __toESM(require_types2(), 1);
|
|
@@ -146802,6 +146827,54 @@ Examples:
|
|
|
146802
146827
|
process.stdout.write("\n");
|
|
146803
146828
|
}
|
|
146804
146829
|
});
|
|
146830
|
+
program2.command("connections").description("List ClickHouse connections (id, name, host)").option("-a, --app-url <url>", "HyperDX app URL").option("--json", "Output as JSON (for programmatic consumption)").addHelpText(
|
|
146831
|
+
"after",
|
|
146832
|
+
`
|
|
146833
|
+
About:
|
|
146834
|
+
Lists ClickHouse connections configured for the authenticated team.
|
|
146835
|
+
Each connection is a named set of credentials that one or more
|
|
146836
|
+
sources point at (via the 'connection' field on a source).
|
|
146837
|
+
|
|
146838
|
+
Use 'hdx sources --json' to see which connection each source uses.
|
|
146839
|
+
|
|
146840
|
+
JSON output schema (--json):
|
|
146841
|
+
Array of objects, each with:
|
|
146842
|
+
id - Connection ID (matches source.connection)
|
|
146843
|
+
name - Human-readable connection name
|
|
146844
|
+
host - ClickHouse host URL
|
|
146845
|
+
|
|
146846
|
+
Examples:
|
|
146847
|
+
$ hdx connections
|
|
146848
|
+
$ hdx connections --json
|
|
146849
|
+
$ hdx connections --json | jq '.[] | select(.name=="Default")'
|
|
146850
|
+
`
|
|
146851
|
+
).action(async (opts) => {
|
|
146852
|
+
const client = await ensureSession(opts.appUrl);
|
|
146853
|
+
const connections = await client.getConnections();
|
|
146854
|
+
if (connections.length === 0) {
|
|
146855
|
+
if (opts.json) {
|
|
146856
|
+
process.stdout.write("[]\n");
|
|
146857
|
+
} else {
|
|
146858
|
+
process.stdout.write("No connections found.\n");
|
|
146859
|
+
}
|
|
146860
|
+
return;
|
|
146861
|
+
}
|
|
146862
|
+
if (opts.json) {
|
|
146863
|
+
const output = connections.map((c3) => ({
|
|
146864
|
+
id: c3.id,
|
|
146865
|
+
name: c3.name,
|
|
146866
|
+
host: c3.host
|
|
146867
|
+
}));
|
|
146868
|
+
process.stdout.write(JSON.stringify(output, null, 2) + "\n");
|
|
146869
|
+
return;
|
|
146870
|
+
}
|
|
146871
|
+
for (const c3 of connections) {
|
|
146872
|
+
process.stdout.write(
|
|
146873
|
+
`${source_default.bold.cyan(c3.name)} ${source_default.dim(c3.host)} ${source_default.dim(`[${c3.id}]`)}
|
|
146874
|
+
`
|
|
146875
|
+
);
|
|
146876
|
+
}
|
|
146877
|
+
});
|
|
146805
146878
|
program2.command("dashboards").description("List dashboards with tile summaries").option("-a, --app-url <url>", "HyperDX app URL").option("--json", "Output as JSON (for programmatic consumption)").addHelpText(
|
|
146806
146879
|
"after",
|
|
146807
146880
|
`
|
|
@@ -146901,50 +146974,145 @@ Examples:
|
|
|
146901
146974
|
process.stdout.write("\n");
|
|
146902
146975
|
}
|
|
146903
146976
|
});
|
|
146904
|
-
program2.command("query").description(
|
|
146977
|
+
program2.command("query").description(
|
|
146978
|
+
"Run raw SQL against a ClickHouse connection (add --patterns to cluster result into Drain log patterns)"
|
|
146979
|
+
).requiredOption(
|
|
146980
|
+
"--connection-id <id>",
|
|
146981
|
+
"Connection ID (from 'hdx connections --json')"
|
|
146982
|
+
).requiredOption("--sql <query>", "SQL query to execute").option("-a, --app-url <url>", "HyperDX app URL").option("--format <format>", "ClickHouse output format", "JSONEachRow").option(
|
|
146983
|
+
"--patterns",
|
|
146984
|
+
"Mine Drain log patterns from the query result instead of emitting rows"
|
|
146985
|
+
).option(
|
|
146986
|
+
"--body-column <name>",
|
|
146987
|
+
"Column whose string value is clustered when --patterns is set (default: whole row JSON)"
|
|
146988
|
+
).addHelpText(
|
|
146905
146989
|
"after",
|
|
146906
146990
|
`
|
|
146907
146991
|
About:
|
|
146908
146992
|
Execute a raw ClickHouse SQL query through the HyperDX proxy, using
|
|
146909
|
-
|
|
146910
|
-
|
|
146993
|
+
a configured ClickHouse connection. Designed for ad-hoc exploration,
|
|
146994
|
+
debugging, and agent-driven queries.
|
|
146911
146995
|
|
|
146912
|
-
The --
|
|
146913
|
-
|
|
146996
|
+
The --connection-id flag takes a connection ID. Use 'hdx connections
|
|
146997
|
+
--json' to discover available connection IDs. Use 'hdx sources --json'
|
|
146998
|
+
to see which connection each source uses (the 'connection' field).
|
|
146914
146999
|
|
|
146915
147000
|
The query is sent as-is to ClickHouse \u2014 you are responsible for
|
|
146916
|
-
writing valid SQL.
|
|
146917
|
-
|
|
146918
|
-
|
|
146919
|
-
|
|
146920
|
-
|
|
147001
|
+
writing valid SQL. Output is written to stdout. Use --format to
|
|
147002
|
+
control the ClickHouse response format (JSONEachRow, JSON,
|
|
147003
|
+
TabSeparated, CSV, etc.). The default is JSONEachRow (one JSON
|
|
147004
|
+
object per line) \u2014 streamable and easy to consume from agents and
|
|
147005
|
+
shell pipelines (e.g. \`jq -c\`).
|
|
147006
|
+
|
|
147007
|
+
Pattern mining (--patterns):
|
|
147008
|
+
Cluster the result's text into log patterns using the Drain
|
|
147009
|
+
algorithm, then emit one JSON object per pattern (sorted by count
|
|
147010
|
+
desc). Useful for summarizing a large result set into a small
|
|
147011
|
+
number of templated lines.
|
|
147012
|
+
|
|
147013
|
+
Drain runs in-process over whatever rows the SQL returns, so the
|
|
147014
|
+
result quality depends on the rows you give it:
|
|
147015
|
+
|
|
147016
|
+
--body-column <name>
|
|
147017
|
+
When set, only that column's string value is clustered. Useful
|
|
147018
|
+
when you SELECT * but only want to mine over (e.g.) Body or
|
|
147019
|
+
SpanName. If <name> isn't in the result, the command exits 1
|
|
147020
|
+
and lists available columns on stderr.
|
|
147021
|
+
|
|
147022
|
+
When omitted, the whole row is JSON-serialized and clustered as
|
|
147023
|
+
a single string. This works for any SELECT shape without column
|
|
147024
|
+
guessing, but produces noisier templates than clustering a
|
|
147025
|
+
single text column.
|
|
147026
|
+
|
|
147027
|
+
Sampling tip:
|
|
147028
|
+
For very large tables, prefer sampling over a tight LIMIT to
|
|
147029
|
+
avoid biasing toward a single time slice. Append \`ORDER BY rand()\`
|
|
147030
|
+
to your SQL, e.g.:
|
|
147031
|
+
|
|
147032
|
+
--sql "SELECT Body FROM default.otel_logs
|
|
147033
|
+
WHERE Timestamp > now() - INTERVAL 1 HOUR
|
|
147034
|
+
ORDER BY rand() LIMIT 10000"
|
|
147035
|
+
|
|
147036
|
+
Be aware: \`ORDER BY rand()\` forces ClickHouse to scan and sort
|
|
147037
|
+
all rows matched by the WHERE clause before applying LIMIT, which
|
|
147038
|
+
can be expensive on large tables. Always pair it with a selective
|
|
147039
|
+
WHERE (time range, service, severity, etc.) to bound the scan.
|
|
147040
|
+
|
|
147041
|
+
Output forces JSON internally regardless of --format. Each line is:
|
|
147042
|
+
{"pattern":"<template>","count":<n>,"sample":"<first sample>"}
|
|
147043
|
+
|
|
147044
|
+
Exit codes:
|
|
147045
|
+
0 Success. Stdout contains the result (empty stdout means zero rows).
|
|
147046
|
+
1 Failure. Stderr contains the error.
|
|
146921
147047
|
|
|
146922
147048
|
Examples:
|
|
146923
|
-
$ hdx
|
|
146924
|
-
$ hdx query --
|
|
146925
|
-
$ hdx query --
|
|
147049
|
+
$ CONN=$(hdx connections --json | jq -r '.[0].id')
|
|
147050
|
+
$ hdx query --connection-id "$CONN" --sql "SELECT count() FROM default.otel_logs"
|
|
147051
|
+
$ hdx query --connection-id "$CONN" --sql "SELECT * FROM default.otel_traces LIMIT 5"
|
|
147052
|
+
$ hdx query --connection-id "$CONN" --patterns \\
|
|
147053
|
+
--sql "SELECT Body FROM default.otel_logs LIMIT 10000" --body-column Body
|
|
146926
147054
|
`
|
|
146927
147055
|
).action(async (opts) => {
|
|
146928
147056
|
const client = await ensureSession(opts.appUrl);
|
|
146929
|
-
const sources = await client.getSources();
|
|
146930
|
-
const source = sources.find(
|
|
146931
|
-
(s3) => s3.name.toLowerCase() === opts.source.toLowerCase() || s3.id === opts.source || s3._id === opts.source
|
|
146932
|
-
);
|
|
146933
|
-
if (!source) {
|
|
146934
|
-
_origError(source_default.red(`Source "${opts.source}" not found.
|
|
146935
|
-
`));
|
|
146936
|
-
_origError("Available sources:");
|
|
146937
|
-
for (const s3 of sources) {
|
|
146938
|
-
_origError(` - ${s3.name} (${s3.kind}) [${s3.id}]`);
|
|
146939
|
-
}
|
|
146940
|
-
process.exit(1);
|
|
146941
|
-
}
|
|
146942
147057
|
const chClient = client.createClickHouseClient();
|
|
146943
147058
|
try {
|
|
147059
|
+
if (opts.patterns) {
|
|
147060
|
+
if (opts.format && opts.format !== "JSON" && opts.format !== "JSONEachRow") {
|
|
147061
|
+
_origError(
|
|
147062
|
+
source_default.dim("--patterns: ignoring --format, using JSON internally\n")
|
|
147063
|
+
);
|
|
147064
|
+
}
|
|
147065
|
+
const resultSet2 = await chClient.query({
|
|
147066
|
+
query: opts.sql,
|
|
147067
|
+
format: "JSON",
|
|
147068
|
+
connectionId: opts.connectionId
|
|
147069
|
+
});
|
|
147070
|
+
const json = await resultSet2.json();
|
|
147071
|
+
const rows = json.data ?? [];
|
|
147072
|
+
if (rows.length === 0) {
|
|
147073
|
+
return;
|
|
147074
|
+
}
|
|
147075
|
+
if (opts.bodyColumn) {
|
|
147076
|
+
const cols = Object.keys(rows[0]);
|
|
147077
|
+
if (!cols.includes(opts.bodyColumn)) {
|
|
147078
|
+
_origError(
|
|
147079
|
+
source_default.red(
|
|
147080
|
+
`--body-column '${opts.bodyColumn}' not found in result. Available columns: ${cols.join(", ")}
|
|
147081
|
+
`
|
|
147082
|
+
)
|
|
147083
|
+
);
|
|
147084
|
+
process.exit(1);
|
|
147085
|
+
}
|
|
147086
|
+
}
|
|
147087
|
+
const flatten4 = (s3) => s3.replace(/\n/g, " ").replace(/\s{2,}/g, " ").trim();
|
|
147088
|
+
const miner = new import_drain2.TemplateMiner(new import_drain2.TemplateMinerConfig());
|
|
147089
|
+
const groups = /* @__PURE__ */ new Map();
|
|
147090
|
+
for (const row of rows) {
|
|
147091
|
+
const raw = opts.bodyColumn ? row[opts.bodyColumn] : JSON.stringify(row);
|
|
147092
|
+
const text2 = raw != null ? flatten4(String(raw)) : "";
|
|
147093
|
+
const { clusterId } = miner.addLogMessage(text2);
|
|
147094
|
+
const existing = groups.get(clusterId);
|
|
147095
|
+
if (existing) {
|
|
147096
|
+
existing.count += 1;
|
|
147097
|
+
} else {
|
|
147098
|
+
groups.set(clusterId, { count: 1, sample: text2 });
|
|
147099
|
+
}
|
|
147100
|
+
}
|
|
147101
|
+
const out = [];
|
|
147102
|
+
for (const [, g] of groups) {
|
|
147103
|
+
const tpl = miner.match(g.sample, "fallback")?.getTemplate() ?? g.sample;
|
|
147104
|
+
out.push({ pattern: tpl, count: g.count, sample: g.sample });
|
|
147105
|
+
}
|
|
147106
|
+
out.sort((a3, b2) => b2.count - a3.count);
|
|
147107
|
+
for (const p of out) {
|
|
147108
|
+
process.stdout.write(JSON.stringify(p) + "\n");
|
|
147109
|
+
}
|
|
147110
|
+
return;
|
|
147111
|
+
}
|
|
146944
147112
|
const resultSet = await chClient.query({
|
|
146945
147113
|
query: opts.sql,
|
|
146946
147114
|
format: opts.format,
|
|
146947
|
-
connectionId:
|
|
147115
|
+
connectionId: opts.connectionId
|
|
146948
147116
|
});
|
|
146949
147117
|
const text = await resultSet.text();
|
|
146950
147118
|
process.stdout.write(text);
|
|
@@ -146953,6 +147121,24 @@ Examples:
|
|
|
146953
147121
|
}
|
|
146954
147122
|
} catch (err) {
|
|
146955
147123
|
const msg = err instanceof Error ? err.message : String(err);
|
|
147124
|
+
try {
|
|
147125
|
+
const connections = await client.getConnections();
|
|
147126
|
+
const known = connections.some(
|
|
147127
|
+
(c3) => c3.id === opts.connectionId || c3._id === opts.connectionId
|
|
147128
|
+
);
|
|
147129
|
+
if (!known) {
|
|
147130
|
+
_origError(
|
|
147131
|
+
source_default.red(`Connection "${opts.connectionId}" not found.
|
|
147132
|
+
`)
|
|
147133
|
+
);
|
|
147134
|
+
_origError("Available connections:");
|
|
147135
|
+
for (const c3 of connections) {
|
|
147136
|
+
_origError(` - ${c3.name} [${c3.id}]`);
|
|
147137
|
+
}
|
|
147138
|
+
process.exit(1);
|
|
147139
|
+
}
|
|
147140
|
+
} catch {
|
|
147141
|
+
}
|
|
146956
147142
|
_origError(source_default.red(`Query failed: ${msg}
|
|
146957
147143
|
`));
|
|
146958
147144
|
process.exit(1);
|