@cccsaurora/clue-ui 1.5.0-dev.485 → 1.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ActionForm-By62TWQn.js +4403 -0
- package/AnnotationDetails-CVbJmRIa.js +160 -0
- package/AnnotationPreview-RL4F2VHf.js +140 -0
- package/ClueEnrichContext-CAgbYy4-.js +442 -0
- package/FlexOne-BXWFOd1T.js +6 -0
- package/_MapCache-DRK-s2eK.js +179 -0
- package/_Set-DrS_bbSV.js +6 -0
- package/_Uint8Array-D9R2N9Lp.js +98 -0
- package/_arrayIncludes-Dcl_29E6.js +25 -0
- package/_arrayPush-DBJIuK2V.js +8 -0
- package/_baseAssignValue-Bx1cxHj5.js +12 -0
- package/_baseClone-DRhywkxm.js +211 -0
- package/_baseExtremum-DodEaEyF.js +16 -0
- package/_baseFlatten-CD9NgrYE.js +72 -0
- package/_baseGet-bVwDaGrA.js +80 -0
- package/_baseGetTag-CxDaTem-.js +25 -0
- package/_baseIsEqual-C-FKsm1J.js +150 -0
- package/_baseIteratee-D0FhC5bC.js +95 -0
- package/_baseRest-D_eW2E0d.js +8 -0
- package/_baseSlice-M5RKzt1A.js +10 -0
- package/_baseSum-wEbgNeUs.js +10 -0
- package/_baseUniq-D3N8igOm.js +41 -0
- package/_cacheHas-Wgl-hw34.js +22 -0
- package/_commonjsHelpers-C6fGbg64.js +6 -0
- package/_createAggregator-BVj8IAuF.js +53 -0
- package/_defineProperty-BZU4WKA3.js +11 -0
- package/_getPrototype-BGBCg-aX.js +5 -0
- package/_getTag-B7R9qBo7.js +73 -0
- package/_isIterateeCall-Dm0VTAYy.js +13 -0
- package/_setToArray-Ck4YZu0Z.js +9 -0
- package/cloneDeep-fV59zwUf.js +8 -0
- package/components/AnnotationBody.js +35 -49
- package/components/AnnotationDetailPopover.js +30 -39
- package/components/AnnotationDetails.js +7 -7
- package/components/AnnotationEntry.js +35 -35
- package/components/AnnotationPreview.js +5 -5
- package/components/ClassificationChip.js +24 -46
- package/components/CountBadge.js +26 -31
- package/components/EnrichedCard.js +97 -110
- package/components/EnrichedChip.js +105 -130
- package/components/EnrichedTypography.js +107 -133
- package/components/ErrorBoundary.js +24 -28
- package/components/RetryFailedEnrichments.js +9 -10
- package/components/SourcePicker.js +49 -57
- package/components/actions/ActionForm.js +4 -4
- package/components/actions/ExecutePopover.js +59 -75
- package/components/actions/ResultModal.js +4 -4
- package/components/actions/form/schemaAdapter.js +23 -39
- package/components/actions/formats/FileResult.js +59 -86
- package/components/actions/formats/index.js +25 -29
- package/components/display/graph/ExpandMoreButton.js +10 -10
- package/components/display/graph/elements/NodeCard.js +86 -106
- package/components/display/graph/elements/NodeTag.js +13 -15
- package/components/display/graph/index.js +202 -261
- package/components/display/graph/visualizations/Leaf.js +70 -89
- package/components/display/graph/visualizations/cloud/index.js +82 -98
- package/components/display/graph/visualizations/icons/BaseIcon.js +21 -26
- package/components/display/graph/visualizations/icons/BugIcon.js +12 -12
- package/components/display/graph/visualizations/icons/HostIcon.js +12 -12
- package/components/display/graph/visualizations/icons/NetworkIcon.js +12 -12
- package/components/display/graph/visualizations/icons/ProcessIcon.js +12 -12
- package/components/display/graph/visualizations/icons/TargetIcon.js +12 -13
- package/components/display/graph/visualizations/icons/index.js +13 -14
- package/components/display/graph/visualizations/panels/NodePanel.js +8 -10
- package/components/display/graph/visualizations/tree/BundleLine.js +82 -108
- package/components/display/graph/visualizations/tree/Triangle.js +13 -13
- package/components/display/graph/visualizations/tree/index.js +306 -408
- package/components/display/icons/Iconified.js +12 -27
- package/components/display/json/index.js +4 -4
- package/components/display/markdown/index.js +6599 -9786
- package/components/enrichment/EnrichPopover.js +46 -54
- package/components/fetchers/Fetcher.js +123 -166
- package/components/fetchers/FetcherResultView.js +27 -31
- package/components/fetchers/PreviewModal.js +16 -17
- package/components/fetchers/StatusChip.js +17 -21
- package/components/group/Entry.js +11 -13
- package/components/group/Group.js +10 -13
- package/components/group/GroupControl.js +65 -76
- package/components/stats/QueryStatus.js +32 -45
- package/countBy-B3rNuG4T.js +8 -0
- package/d3-DXDWjYtg.js +15158 -0
- package/data/event.js +4 -6
- package/database/errors.js +11 -14
- package/database/globals.js +2 -2
- package/database/index.js +3 -3
- package/database/replication.js +4 -4
- package/get-Bil3mzRD.js +8 -0
- package/groupBy-CrJC7sGa.js +8 -0
- package/hooks/ClueActionContext.js +6 -6
- package/hooks/ClueComponentContext.js +23 -29
- package/hooks/ClueConfigProvider.js +12 -14
- package/hooks/ClueDatabaseContext.d.ts +1 -1
- package/hooks/ClueDatabaseContext.js +26 -36
- package/hooks/ClueEnrichContext.js +11 -11
- package/hooks/ClueFetcherContext.js +56 -83
- package/hooks/ClueGroupContext.js +14 -17
- package/hooks/CluePopupContext.js +5 -5
- package/hooks/ClueProvider.js +11 -13
- package/hooks/ClueUIPluginContext.js +36 -50
- package/hooks/selectors.js +7 -7
- package/hooks/useActionResult.js +3 -3
- package/hooks/useAnnotations.js +32 -48
- package/hooks/useClue.js +4 -6
- package/hooks/useClueActions.js +3 -3
- package/hooks/useClueConfig.js +4 -6
- package/hooks/useClueTypeConfig.js +24 -45
- package/hooks/useClueUIPlugins.js +7 -8
- package/hooks/useComparator.js +435 -722
- package/hooks/useErrors.js +18 -22
- package/hooks/useFetcherResult.js +24 -33
- package/hooks/useMyHighlights.js +36 -66
- package/hooks/useMyLocalStorage.js +37 -66
- package/iconify-Ptb5dTKy.js +1270 -0
- package/icons/Action.js +49 -66
- package/icons/Assessment.js +69 -85
- package/icons/Context.js +63 -77
- package/icons/Opinion.js +60 -76
- package/icons/iconMap.js +2 -2
- package/identity-ByMq8VxU.js +6 -0
- package/index-BM9Sve5T.js +571 -0
- package/index-CVt7zlTT.js +6815 -0
- package/index-Cj4d5cGz.js +357 -0
- package/index-D3JK50MV.js +977 -0
- package/index-D9sCYTQI.js +3403 -0
- package/index.css +2 -11
- package/isArguments-BWcXOE6a.js +24 -0
- package/isArray-WzO_os3q.js +4 -0
- package/isEmpty-DKxrY-_M.js +22 -0
- package/isNil-CjWwlQS3.js +6 -0
- package/isObject-B53jY8Qg.js +7 -0
- package/isObjectLike-CYbdrIBr.js +6 -0
- package/isSymbol-DE1Kcy2M.js +9 -0
- package/last-7CdUxN0r.js +7 -0
- package/main.js +64 -64
- package/maxBy-BOWDkL_D.js +8 -0
- package/package.json +33 -43
- package/plugins/ClueUIPlugin.js +96 -163
- package/plugins/file/index.js +15 -15
- package/plugins/graph/index.js +26 -29
- package/plugins/image/index.js +24 -28
- package/plugins/json/index.js +21 -21
- package/plugins/markdown/index.js +18 -18
- package/plugins/registry.js +6 -6
- package/plugins/store.js +4 -4
- package/plugins/test/index.js +17 -17
- package/plugins/utils.js +12 -13
- package/replication-BHjGIZQL.js +8555 -0
- package/sessionStorage-DFMae61b.js +90 -0
- package/sortBy-BHe812lF.js +74 -0
- package/store-D4aFUWxi.js +1169 -0
- package/sumBy-B7f_bP_k.js +8 -0
- package/text/Frequency.js +23 -42
- package/toFinite-CBrE65MP.js +14 -0
- package/toNumber-CxmWey0f.js +31 -0
- package/uniq-B4UZ671_.js +7 -0
- package/utils/chain.js +65 -92
- package/utils/classificationParser.js +256 -519
- package/utils/constants.js +11 -37
- package/utils/graph.js +45 -72
- package/utils/hashUtil.js +7 -7
- package/utils/line.js +81 -131
- package/utils/loggerUtil.js +3 -5
- package/utils/sessionStorage.js +7 -7
- package/utils/time.js +427 -447
- package/utils/typeDetection.js +7 -10
- package/utils/utils.js +10 -10
- package/utils/window.js +10 -21
- package/utils-SpTOhPYl.js +147 -0
- package/ActionForm-BMIAp7pf.js +0 -6099
- package/AnnotationDetails-Dmk8kpl3.js +0 -176
- package/AnnotationPreview-CIya3ByE.js +0 -188
- package/ClueEnrichContext-BqzlMW0c.js +0 -575
- package/FlexOne-BSYAhhtG.js +0 -9
- package/_MapCache-kuEY_iOH.js +0 -220
- package/_Set-BrSMTlHn.js +0 -6
- package/_Uint8Array-OPpgYQj7.js +0 -123
- package/_arrayIncludes-BNqL-9ZP.js +0 -31
- package/_arrayPush-CBkQqaE_.js +0 -10
- package/_baseAssignValue-CNUVPOBW.js +0 -16
- package/_baseClone-9FaRd1R2.js +0 -287
- package/_baseExtremum-wOGT4Dgw.js +0 -18
- package/_baseFlatten-Co6QHDlG.js +0 -92
- package/_baseGet-Cmp6FztG.js +0 -109
- package/_baseGetTag-Hj-0NTYF.js +0 -44
- package/_baseIsEqual-1CpU47TZ.js +0 -211
- package/_baseIteratee-BN7Vbe5g.js +0 -126
- package/_baseRest-BZ_hQ9PC.js +0 -8
- package/_baseSlice-GAv_YFTT.js +0 -20
- package/_baseSum-D0WC1dN0.js +0 -13
- package/_baseUniq-BnvS3JHL.js +0 -63
- package/_cacheHas-_aF2y2Xv.js +0 -25
- package/_commonjsHelpers-CUmg6egw.js +0 -6
- package/_createAggregator-BUZrP_is.js +0 -63
- package/_defineProperty-DolZLKmv.js +0 -12
- package/_getPrototype-Bb4gm-5m.js +0 -5
- package/_getTag-CML_cXiN.js +0 -105
- package/_isIterateeCall-B1IFEqVv.js +0 -17
- package/_setToArray-CqyqC8ib.js +0 -10
- package/cloneDeep-l3UkXG5M.js +0 -8
- package/countBy-Bqcp3VCs.js +0 -14
- package/get-CdMThM8x.js +0 -8
- package/groupBy-BVV07EGQ.js +0 -14
- package/iconify-CYJTToEF.js +0 -1789
- package/identity-CPGTqrE4.js +0 -6
- package/index-CVUD9o3t.js +0 -15768
- package/index-CdqmWKik.js +0 -9711
- package/index-CgvdVEs-.js +0 -1172
- package/index-DUEubgWN.js +0 -464
- package/index-Dd7KdsT8.js +0 -4416
- package/index-_gpzM2Px.js +0 -702
- package/isArguments-CuYlEuhP.js +0 -27
- package/isArray-RJPfgWqI.js +0 -4
- package/isEmpty-BE656RUK.js +0 -30
- package/isNil-CIubwp4T.js +0 -6
- package/isObject-FTY-5JQX.js +0 -7
- package/isObjectLike-CeENW9FN.js +0 -6
- package/isSymbol-D_H4HPZQ.js +0 -9
- package/last-CUCl67Im.js +0 -7
- package/maxBy-BjjQmX5t.js +0 -8
- package/replication-Ck5s0Yg-.js +0 -11852
- package/sessionStorage-B68y-wnE.js +0 -140
- package/sortBy-B8JVsLQY.js +0 -95
- package/store-C0DRfMxZ.js +0 -2165
- package/sumBy-D-HCzM2i.js +0 -8
- package/toFinite-meZTg4Su.js +0 -16
- package/toNumber-B5JaA1vX.js +0 -39
- package/uniq-CahZPAwp.js +0 -7
- package/utils-CEySTPtg.js +0 -224
|
@@ -0,0 +1,442 @@
|
|
|
1
|
+
import { jsx as It } from "react/jsx-runtime";
|
|
2
|
+
import { a as $t } from "./iconify-Ptb5dTKy.js";
|
|
3
|
+
import { a as Ct, p as ft } from "./index-D9sCYTQI.js";
|
|
4
|
+
import { REPLICATORS as b } from "./database/globals.js";
|
|
5
|
+
import { clueDebugLogger as G } from "./utils/loggerUtil.js";
|
|
6
|
+
import { detectType as Ot } from "./utils/typeDetection.js";
|
|
7
|
+
import { c as H } from "./utils-SpTOhPYl.js";
|
|
8
|
+
import { b as gt } from "./_baseSlice-M5RKzt1A.js";
|
|
9
|
+
import { t as jt } from "./toFinite-CBrE65MP.js";
|
|
10
|
+
import { d as Pt } from "./sessionStorage-DFMae61b.js";
|
|
11
|
+
import { g as mt } from "./groupBy-CrJC7sGa.js";
|
|
12
|
+
import { u as pt } from "./uniq-B4UZ671_.js";
|
|
13
|
+
import { b as Mt } from "./_baseIteratee-D0FhC5bC.js";
|
|
14
|
+
import { b as qt } from "./_baseUniq-D3N8igOm.js";
|
|
15
|
+
import { useContext as At, useState as R, useMemo as K, useCallback as j, useRef as Bt, useEffect as P } from "react";
|
|
16
|
+
import { c as Rt } from "./index-BM9Sve5T.js";
|
|
17
|
+
import { ClueDatabaseContext as St } from "./hooks/ClueDatabaseContext.js";
|
|
18
|
+
import Wt from "./hooks/useClueConfig.js";
|
|
19
|
+
import Ft from "./hooks/useClueTypeConfig.js";
|
|
20
|
+
import { i as Vt } from "./isEmpty-DKxrY-_M.js";
|
|
21
|
+
function bt(e) {
|
|
22
|
+
var i = jt(e), f = i % 1;
|
|
23
|
+
return i === i ? f ? i - f : i : 0;
|
|
24
|
+
}
|
|
25
|
+
var Ht = Math.ceil, Jt = Math.max;
|
|
26
|
+
function Qt(e, i, f) {
|
|
27
|
+
i === void 0 ? i = 1 : i = Jt(bt(i), 0);
|
|
28
|
+
var o = e == null ? 0 : e.length;
|
|
29
|
+
if (!o || i < 1)
|
|
30
|
+
return [];
|
|
31
|
+
for (var m = 0, D = 0, M = Array(Ht(o / i)); m < o; )
|
|
32
|
+
M[D++] = gt(e, m, m += i);
|
|
33
|
+
return M;
|
|
34
|
+
}
|
|
35
|
+
function Gt(e, i) {
|
|
36
|
+
return e && e.length ? qt(e, Mt(i)) : [];
|
|
37
|
+
}
|
|
38
|
+
const d = [];
|
|
39
|
+
for (let e = 0; e < 256; ++e)
|
|
40
|
+
d.push((e + 256).toString(16).slice(1));
|
|
41
|
+
function Kt(e, i = 0) {
|
|
42
|
+
return (d[e[i + 0]] + d[e[i + 1]] + d[e[i + 2]] + d[e[i + 3]] + "-" + d[e[i + 4]] + d[e[i + 5]] + "-" + d[e[i + 6]] + d[e[i + 7]] + "-" + d[e[i + 8]] + d[e[i + 9]] + "-" + d[e[i + 10]] + d[e[i + 11]] + d[e[i + 12]] + d[e[i + 13]] + d[e[i + 14]] + d[e[i + 15]]).toLowerCase();
|
|
43
|
+
}
|
|
44
|
+
const Xt = new Uint8Array(16);
|
|
45
|
+
function Yt() {
|
|
46
|
+
return crypto.getRandomValues(Xt);
|
|
47
|
+
}
|
|
48
|
+
function X(e, i, f) {
|
|
49
|
+
return crypto.randomUUID ? crypto.randomUUID() : Zt(e);
|
|
50
|
+
}
|
|
51
|
+
function Zt(e, i, f) {
|
|
52
|
+
var m;
|
|
53
|
+
e = e || {};
|
|
54
|
+
const o = e.random ?? ((m = e.rng) == null ? void 0 : m.call(e)) ?? Yt();
|
|
55
|
+
if (o.length < 16)
|
|
56
|
+
throw new Error("Random bytes length must be >= 16");
|
|
57
|
+
return o[6] = o[6] & 15 | 64, o[8] = o[8] & 63 | 128, Kt(o);
|
|
58
|
+
}
|
|
59
|
+
const _t = Rt(null), ds = ({
|
|
60
|
+
children: e,
|
|
61
|
+
classification: i,
|
|
62
|
+
baseURL: f,
|
|
63
|
+
getToken: o,
|
|
64
|
+
onNetworkCall: m,
|
|
65
|
+
pickSources: D,
|
|
66
|
+
chunkSize: M = 15,
|
|
67
|
+
maxRequestCount: J = 4,
|
|
68
|
+
defaultTimeout: S = 5,
|
|
69
|
+
enabled: I = !0,
|
|
70
|
+
ready: dt = !1,
|
|
71
|
+
publicIconify: Y = !0,
|
|
72
|
+
skipConfigCall: Z = !1,
|
|
73
|
+
customIconify: W,
|
|
74
|
+
debugLogging: C = !0
|
|
75
|
+
}) => {
|
|
76
|
+
var ct, ot, at, ut, lt;
|
|
77
|
+
const g = Wt(), t = At(St), [_, yt] = R(null), v = K(
|
|
78
|
+
() => {
|
|
79
|
+
var s, n;
|
|
80
|
+
return _ ?? i ?? ((n = (s = g.config) == null ? void 0 : s.c12nDef) == null ? void 0 : n.RESTRICTED);
|
|
81
|
+
},
|
|
82
|
+
[i, (ot = (ct = g.config) == null ? void 0 : ct.c12nDef) == null ? void 0 : ot.RESTRICTED, _]
|
|
83
|
+
), U = j(
|
|
84
|
+
(s) => {
|
|
85
|
+
var n;
|
|
86
|
+
return yt(s((n = g.config) == null ? void 0 : n.c12nDef));
|
|
87
|
+
},
|
|
88
|
+
[(at = g.config) == null ? void 0 : at.c12nDef]
|
|
89
|
+
), [x, ht] = R(dt), q = Bt(0), [O, wt] = R([]), { availableSources: A, typesDetection: z, typeDetectors: N, supportedTypes: T } = Ft(
|
|
90
|
+
I && x,
|
|
91
|
+
f,
|
|
92
|
+
C,
|
|
93
|
+
o,
|
|
94
|
+
m
|
|
95
|
+
);
|
|
96
|
+
P(() => {
|
|
97
|
+
if (Z || !I || !x)
|
|
98
|
+
return;
|
|
99
|
+
const s = {}, n = o == null ? void 0 : o();
|
|
100
|
+
n && (s.Authorization = `Bearer ${n}`);
|
|
101
|
+
let a = { baseURL: f, headers: s };
|
|
102
|
+
m && (a = m(a)), Ct.configs.get(a).then(g.setConfig);
|
|
103
|
+
}, [f, m, Z, I, x]);
|
|
104
|
+
const [L, k] = R(() => {
|
|
105
|
+
var s;
|
|
106
|
+
return !!((s = t == null ? void 0 : t.selectors) != null && s.synced);
|
|
107
|
+
});
|
|
108
|
+
P(() => {
|
|
109
|
+
var s;
|
|
110
|
+
k(!!((s = t == null ? void 0 : t.selectors) != null && s.synced));
|
|
111
|
+
}, [t]), P(() => {
|
|
112
|
+
if (I && x) {
|
|
113
|
+
const s = Object.values(b).map((n) => (n.reSync(), n.start(), n.active$.subscribe((a) => {
|
|
114
|
+
var r;
|
|
115
|
+
a || k(!!((r = t == null ? void 0 : t.selectors) != null && r.synced));
|
|
116
|
+
})));
|
|
117
|
+
return () => {
|
|
118
|
+
s.forEach((n) => n.unsubscribe()), Object.values(b).forEach((n) => {
|
|
119
|
+
n.pause();
|
|
120
|
+
});
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
return () => {
|
|
124
|
+
Object.values(b).forEach((s) => {
|
|
125
|
+
s.pause();
|
|
126
|
+
});
|
|
127
|
+
};
|
|
128
|
+
}, [t, I, x]);
|
|
129
|
+
const [tt, st] = R(W);
|
|
130
|
+
P(() => {
|
|
131
|
+
W && st(W);
|
|
132
|
+
}, [W]), P(() => {
|
|
133
|
+
if (Y)
|
|
134
|
+
return;
|
|
135
|
+
let s = tt ?? void 0 ?? (f == null ? void 0 : f.replace(/^[^.]+/, "icons"));
|
|
136
|
+
!s && typeof window < "u" && window && !window.location.origin.includes("localhost") && (s = window.location.protocol + "//" + window.location.origin.replace(/^[^.]+/, "icons")), s && (G(`Using ${s} for iconify`, C), $t("", {
|
|
137
|
+
resources: [s]
|
|
138
|
+
}));
|
|
139
|
+
}, [f, tt, C, Y]);
|
|
140
|
+
const F = j(
|
|
141
|
+
async (s) => {
|
|
142
|
+
const n = [];
|
|
143
|
+
for (const r of s) {
|
|
144
|
+
const { latency: u, source: l, type: c, value: E, items: y, error: h } = r;
|
|
145
|
+
await t.selectors.find({ selector: { type: c, value: E, source: l } }).incrementalRemove(), h && n.push({
|
|
146
|
+
id: X(),
|
|
147
|
+
source: l,
|
|
148
|
+
type: c,
|
|
149
|
+
value: E,
|
|
150
|
+
annotations: [],
|
|
151
|
+
classification: v,
|
|
152
|
+
latency: u,
|
|
153
|
+
count: 0,
|
|
154
|
+
error: h
|
|
155
|
+
});
|
|
156
|
+
for (const p of y) {
|
|
157
|
+
const { classification: w, count: $, link: Et, annotations: xt } = p, Q = {
|
|
158
|
+
id: X(),
|
|
159
|
+
source: l,
|
|
160
|
+
type: c,
|
|
161
|
+
value: E,
|
|
162
|
+
annotations: xt,
|
|
163
|
+
classification: w,
|
|
164
|
+
latency: u,
|
|
165
|
+
count: $,
|
|
166
|
+
link: Et,
|
|
167
|
+
error: h
|
|
168
|
+
};
|
|
169
|
+
n.some((Dt) => Dt.id === Q.id) && (Q.id = X()), n.push(Q);
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
const a = await t.selectors.bulkInsert(n);
|
|
173
|
+
a.error.length > 0 && (console.warn("Errors on upsert:"), a.error.forEach((r) => console.warn(r.documentId, r.validationErrors ?? r.status)));
|
|
174
|
+
},
|
|
175
|
+
[t, v]
|
|
176
|
+
), et = j(
|
|
177
|
+
async (s, n, a = {}) => {
|
|
178
|
+
var p;
|
|
179
|
+
if (!s || !n)
|
|
180
|
+
return console.error(`Type (${s}) or value (${n}) is empty, returning empty response`), {};
|
|
181
|
+
const r = (D == null ? void 0 : D(O, A, [{ type: s, value: n, classification: a.classification }])) ?? O, u = {
|
|
182
|
+
timeout: S,
|
|
183
|
+
force: !1,
|
|
184
|
+
includeRaw: !1,
|
|
185
|
+
noCache: !1,
|
|
186
|
+
classification: v,
|
|
187
|
+
sources: r,
|
|
188
|
+
...a
|
|
189
|
+
}, l = {}, c = o == null ? void 0 : o();
|
|
190
|
+
c && (l.Authorization = `Bearer ${c}`);
|
|
191
|
+
let E = { baseURL: f, headers: l };
|
|
192
|
+
m && (E = m(E));
|
|
193
|
+
const y = {
|
|
194
|
+
type: s,
|
|
195
|
+
value: n,
|
|
196
|
+
classification: u.classification
|
|
197
|
+
};
|
|
198
|
+
let h = await t.status.findOne({ selector: { ...y } }).exec();
|
|
199
|
+
h ? await h.incrementalPatch({ status: "in-progress" }) : h = await ((p = t.status) == null ? void 0 : p.insert({
|
|
200
|
+
id: await H(y.type, y.value, y.classification ?? v),
|
|
201
|
+
type: y.type,
|
|
202
|
+
value: y.value,
|
|
203
|
+
classification: y.classification ?? v,
|
|
204
|
+
status: "in-progress"
|
|
205
|
+
}));
|
|
206
|
+
try {
|
|
207
|
+
const w = await ft([y], u.sources, u, E), $ = Object.values(Object.values(w)[0])[0];
|
|
208
|
+
return await F(Object.values($)), $;
|
|
209
|
+
} catch (w) {
|
|
210
|
+
return console.error(w), {};
|
|
211
|
+
} finally {
|
|
212
|
+
await (h == null ? void 0 : h.incrementalPatch({ status: "complete" }));
|
|
213
|
+
}
|
|
214
|
+
},
|
|
215
|
+
[
|
|
216
|
+
F,
|
|
217
|
+
A,
|
|
218
|
+
f,
|
|
219
|
+
t,
|
|
220
|
+
v,
|
|
221
|
+
S,
|
|
222
|
+
o,
|
|
223
|
+
m,
|
|
224
|
+
D,
|
|
225
|
+
O
|
|
226
|
+
]
|
|
227
|
+
), V = j(
|
|
228
|
+
async (s, n) => {
|
|
229
|
+
var y, h;
|
|
230
|
+
const a = (D == null ? void 0 : D(O, A, s)) ?? O, r = {
|
|
231
|
+
timeout: S,
|
|
232
|
+
includeRaw: !1,
|
|
233
|
+
noCache: !1,
|
|
234
|
+
classification: v,
|
|
235
|
+
sources: a,
|
|
236
|
+
...n
|
|
237
|
+
}, u = {}, l = o == null ? void 0 : o();
|
|
238
|
+
l && (u.Authorization = `Bearer ${l}`);
|
|
239
|
+
let c = { baseURL: f, headers: u };
|
|
240
|
+
m && (c = m(c));
|
|
241
|
+
const E = [];
|
|
242
|
+
for (const p of s) {
|
|
243
|
+
const w = { type: p.type, value: p.value, classification: r.classification };
|
|
244
|
+
let $ = await ((y = t.status) == null ? void 0 : y.findOne({
|
|
245
|
+
selector: w
|
|
246
|
+
}).incrementalPatch({
|
|
247
|
+
status: "in-progress"
|
|
248
|
+
}));
|
|
249
|
+
$ || ($ = await ((h = t.status) == null ? void 0 : h.insert({
|
|
250
|
+
id: await H(w.type, w.value, w.classification),
|
|
251
|
+
...w,
|
|
252
|
+
status: "in-progress",
|
|
253
|
+
sources: r.sources
|
|
254
|
+
}))), $ && E.push($.toMutableJSON());
|
|
255
|
+
}
|
|
256
|
+
try {
|
|
257
|
+
const p = await ft(s, r.sources, r, c), w = Object.values(p).flatMap(Object.values).flatMap(Object.values);
|
|
258
|
+
return await F(w), p;
|
|
259
|
+
} catch (p) {
|
|
260
|
+
return console.error(p), {};
|
|
261
|
+
} finally {
|
|
262
|
+
t.status.bulkUpsert(
|
|
263
|
+
Gt(E, (p) => p.id).map((p) => (p.status = "complete", p))
|
|
264
|
+
);
|
|
265
|
+
}
|
|
266
|
+
},
|
|
267
|
+
[
|
|
268
|
+
D,
|
|
269
|
+
O,
|
|
270
|
+
A,
|
|
271
|
+
S,
|
|
272
|
+
v,
|
|
273
|
+
o,
|
|
274
|
+
f,
|
|
275
|
+
m,
|
|
276
|
+
t,
|
|
277
|
+
F
|
|
278
|
+
]
|
|
279
|
+
), B = K(
|
|
280
|
+
() => Pt(
|
|
281
|
+
async () => {
|
|
282
|
+
if (t != null && t.status) {
|
|
283
|
+
if (t.status.closed) {
|
|
284
|
+
console.warn("Status database is closed, will not enrich");
|
|
285
|
+
return;
|
|
286
|
+
}
|
|
287
|
+
} else return;
|
|
288
|
+
const s = await t.status.find({ selector: { status: "pending" } }).update({ $set: { status: "in-progress" } });
|
|
289
|
+
if (s.length < 1)
|
|
290
|
+
return;
|
|
291
|
+
const n = Qt(s, M);
|
|
292
|
+
G(
|
|
293
|
+
`Enriching ${s.length} selectors in ${n.length} chunks of ${M}.`,
|
|
294
|
+
C
|
|
295
|
+
), await Promise.all(
|
|
296
|
+
// For performance reasons, we chunk the requests. This will allow us to take advantage of parellelization in the
|
|
297
|
+
// backend, both on the pod level and kubernetes level
|
|
298
|
+
n.map(async (a) => {
|
|
299
|
+
let r = null;
|
|
300
|
+
if (q.current <= J)
|
|
301
|
+
q.current += 1;
|
|
302
|
+
else {
|
|
303
|
+
let u = Date.now();
|
|
304
|
+
await new Promise((l) => {
|
|
305
|
+
r = setInterval(() => {
|
|
306
|
+
G(
|
|
307
|
+
`Waiting on ${q.current} existing requests to complete (total delay: ${Date.now() - u}ms)`,
|
|
308
|
+
C
|
|
309
|
+
), q.current < J && l();
|
|
310
|
+
}, 400);
|
|
311
|
+
}).finally(() => {
|
|
312
|
+
q.current += 1, clearInterval(r);
|
|
313
|
+
});
|
|
314
|
+
}
|
|
315
|
+
try {
|
|
316
|
+
const u = {}, l = pt(a.flatMap((c) => c.sources ?? []));
|
|
317
|
+
l.length > 0 && (u.sources = l), await V(
|
|
318
|
+
a.map((c) => c.toSelector()),
|
|
319
|
+
u
|
|
320
|
+
), await t.status.findByIds(a.map((c) => c.id)).update({ $set: { status: "complete" } });
|
|
321
|
+
} catch (u) {
|
|
322
|
+
console.error(u);
|
|
323
|
+
} finally {
|
|
324
|
+
q.current -= 1, r && clearInterval(r);
|
|
325
|
+
}
|
|
326
|
+
})
|
|
327
|
+
);
|
|
328
|
+
},
|
|
329
|
+
200,
|
|
330
|
+
{ maxWait: 500, leading: !1 }
|
|
331
|
+
),
|
|
332
|
+
[V, M, t, C, J]
|
|
333
|
+
);
|
|
334
|
+
P(() => {
|
|
335
|
+
}, [t, C]), P(() => {
|
|
336
|
+
if (!I || !x || !(t != null && t.status))
|
|
337
|
+
return;
|
|
338
|
+
if (t != null && t.status.closed) {
|
|
339
|
+
console.warn("Status collection is closed");
|
|
340
|
+
return;
|
|
341
|
+
}
|
|
342
|
+
const s = t.status.find({
|
|
343
|
+
selector: {
|
|
344
|
+
status: "pending"
|
|
345
|
+
}
|
|
346
|
+
}).$.subscribe(() => B());
|
|
347
|
+
return () => {
|
|
348
|
+
try {
|
|
349
|
+
s == null || s.unsubscribe(), B.cancel();
|
|
350
|
+
} catch (n) {
|
|
351
|
+
console.warn(n);
|
|
352
|
+
}
|
|
353
|
+
};
|
|
354
|
+
}, [I, x, t, C, B, (ut = t == null ? void 0 : t.status) == null ? void 0 : ut.closed]);
|
|
355
|
+
const nt = j(
|
|
356
|
+
async (s, n, a) => {
|
|
357
|
+
var l, c;
|
|
358
|
+
if (!s)
|
|
359
|
+
throw new Error("Type cannot be null");
|
|
360
|
+
if (!n)
|
|
361
|
+
throw new Error("Value cannot be null");
|
|
362
|
+
if (!t.status || t.status.closed) {
|
|
363
|
+
console.warn("status collection is closed");
|
|
364
|
+
return;
|
|
365
|
+
}
|
|
366
|
+
const r = { type: s, value: n, classification: a ?? v };
|
|
367
|
+
let u = await ((l = t.status) == null ? void 0 : l.findOne({
|
|
368
|
+
selector: r
|
|
369
|
+
}).exec());
|
|
370
|
+
return u || (u = await ((c = t.status) == null ? void 0 : c.queueInsert({
|
|
371
|
+
id: await H(r.type, r.value, r.classification),
|
|
372
|
+
...r,
|
|
373
|
+
status: "pending"
|
|
374
|
+
}))), u;
|
|
375
|
+
},
|
|
376
|
+
[v, t]
|
|
377
|
+
), it = j(async () => {
|
|
378
|
+
if (!(t != null && t.selectors) || t.selectors.closed)
|
|
379
|
+
return;
|
|
380
|
+
const s = await t.selectors.find({ selector: { error: { $exists: !0 } } }).exec(), n = mt(s, "classification"), a = [];
|
|
381
|
+
for (const [r, u] of Object.entries(n)) {
|
|
382
|
+
const l = mt(u, (c) => `${c.type}:${c.value}`);
|
|
383
|
+
for (const c of Object.values(l))
|
|
384
|
+
a.push({
|
|
385
|
+
id: await H(c[0].type, c[0].value, r),
|
|
386
|
+
type: c[0].type,
|
|
387
|
+
value: c[0].value,
|
|
388
|
+
classification: r,
|
|
389
|
+
sources: pt(c.map((E) => E.source)).sort(),
|
|
390
|
+
status: "pending"
|
|
391
|
+
});
|
|
392
|
+
}
|
|
393
|
+
a.length > 0 && (await t.status.bulkInsert(a), I && x && B()), await t.selectors.bulkRemove(s);
|
|
394
|
+
}, [t, I, B, x]), rt = j(
|
|
395
|
+
(s) => Ot(s, N),
|
|
396
|
+
[N]
|
|
397
|
+
), vt = K(
|
|
398
|
+
() => {
|
|
399
|
+
var s;
|
|
400
|
+
return {
|
|
401
|
+
bulkEnrich: V,
|
|
402
|
+
enrich: et,
|
|
403
|
+
enrichFailedEnrichments: it,
|
|
404
|
+
sources: O,
|
|
405
|
+
setSources: wt,
|
|
406
|
+
typesDetection: z,
|
|
407
|
+
supportedTypes: T,
|
|
408
|
+
availableSources: A,
|
|
409
|
+
guessType: rt,
|
|
410
|
+
queueEnrich: nt,
|
|
411
|
+
setCustomIconify: st,
|
|
412
|
+
setDefaultClassification: U,
|
|
413
|
+
setReady: ht,
|
|
414
|
+
defaultClassification: v,
|
|
415
|
+
ready: x && !!t && !!((s = g.config) != null && s.c12nDef) && (Vt(b) || L)
|
|
416
|
+
};
|
|
417
|
+
},
|
|
418
|
+
[
|
|
419
|
+
V,
|
|
420
|
+
et,
|
|
421
|
+
it,
|
|
422
|
+
O,
|
|
423
|
+
z,
|
|
424
|
+
T,
|
|
425
|
+
A,
|
|
426
|
+
rt,
|
|
427
|
+
nt,
|
|
428
|
+
U,
|
|
429
|
+
v,
|
|
430
|
+
x,
|
|
431
|
+
t,
|
|
432
|
+
(lt = g.config) == null ? void 0 : lt.c12nDef,
|
|
433
|
+
L
|
|
434
|
+
]
|
|
435
|
+
);
|
|
436
|
+
return /* @__PURE__ */ It(_t.Provider, { value: vt, children: e });
|
|
437
|
+
};
|
|
438
|
+
export {
|
|
439
|
+
_t as C,
|
|
440
|
+
ds as a,
|
|
441
|
+
Gt as u
|
|
442
|
+
};
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
import { b as d, r as _ } from "./_baseGetTag-CxDaTem-.js";
|
|
2
|
+
import { i as l } from "./isObject-B53jY8Qg.js";
|
|
3
|
+
var v = "[object AsyncFunction]", g = "[object Function]", y = "[object GeneratorFunction]", b = "[object Proxy]";
|
|
4
|
+
function C(t) {
|
|
5
|
+
if (!l(t))
|
|
6
|
+
return !1;
|
|
7
|
+
var e = d(t);
|
|
8
|
+
return e == g || e == y || e == v || e == b;
|
|
9
|
+
}
|
|
10
|
+
var u = _["__core-js_shared__"], p = (function() {
|
|
11
|
+
var t = /[^.]+$/.exec(u && u.keys && u.keys.IE_PROTO || "");
|
|
12
|
+
return t ? "Symbol(src)_1." + t : "";
|
|
13
|
+
})();
|
|
14
|
+
function m(t) {
|
|
15
|
+
return !!p && p in t;
|
|
16
|
+
}
|
|
17
|
+
var O = Function.prototype, P = O.toString;
|
|
18
|
+
function w(t) {
|
|
19
|
+
if (t != null) {
|
|
20
|
+
try {
|
|
21
|
+
return P.call(t);
|
|
22
|
+
} catch {
|
|
23
|
+
}
|
|
24
|
+
try {
|
|
25
|
+
return t + "";
|
|
26
|
+
} catch {
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
return "";
|
|
30
|
+
}
|
|
31
|
+
var x = /[\\^$.*+?()[\]{}|]/g, j = /^\[object .+?Constructor\]$/, $ = Function.prototype, z = Object.prototype, S = $.toString, D = z.hasOwnProperty, H = RegExp(
|
|
32
|
+
"^" + S.call(D).replace(x, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
|
|
33
|
+
);
|
|
34
|
+
function F(t) {
|
|
35
|
+
if (!l(t) || m(t))
|
|
36
|
+
return !1;
|
|
37
|
+
var e = C(t) ? H : j;
|
|
38
|
+
return e.test(w(t));
|
|
39
|
+
}
|
|
40
|
+
function I(t, e) {
|
|
41
|
+
return t == null ? void 0 : t[e];
|
|
42
|
+
}
|
|
43
|
+
function f(t, e) {
|
|
44
|
+
var a = I(t, e);
|
|
45
|
+
return F(a) ? a : void 0;
|
|
46
|
+
}
|
|
47
|
+
function T(t, e) {
|
|
48
|
+
return t === e || t !== t && e !== e;
|
|
49
|
+
}
|
|
50
|
+
var i = f(Object, "create");
|
|
51
|
+
function E() {
|
|
52
|
+
this.__data__ = i ? i(null) : {}, this.size = 0;
|
|
53
|
+
}
|
|
54
|
+
function N(t) {
|
|
55
|
+
var e = this.has(t) && delete this.__data__[t];
|
|
56
|
+
return this.size -= e ? 1 : 0, e;
|
|
57
|
+
}
|
|
58
|
+
var M = "__lodash_hash_undefined__", G = Object.prototype, A = G.hasOwnProperty;
|
|
59
|
+
function R(t) {
|
|
60
|
+
var e = this.__data__;
|
|
61
|
+
if (i) {
|
|
62
|
+
var a = e[t];
|
|
63
|
+
return a === M ? void 0 : a;
|
|
64
|
+
}
|
|
65
|
+
return A.call(e, t) ? e[t] : void 0;
|
|
66
|
+
}
|
|
67
|
+
var K = Object.prototype, L = K.hasOwnProperty;
|
|
68
|
+
function U(t) {
|
|
69
|
+
var e = this.__data__;
|
|
70
|
+
return i ? e[t] !== void 0 : L.call(e, t);
|
|
71
|
+
}
|
|
72
|
+
var q = "__lodash_hash_undefined__";
|
|
73
|
+
function J(t, e) {
|
|
74
|
+
var a = this.__data__;
|
|
75
|
+
return this.size += this.has(t) ? 0 : 1, a[t] = i && e === void 0 ? q : e, this;
|
|
76
|
+
}
|
|
77
|
+
function n(t) {
|
|
78
|
+
var e = -1, a = t == null ? 0 : t.length;
|
|
79
|
+
for (this.clear(); ++e < a; ) {
|
|
80
|
+
var r = t[e];
|
|
81
|
+
this.set(r[0], r[1]);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
n.prototype.clear = E;
|
|
85
|
+
n.prototype.delete = N;
|
|
86
|
+
n.prototype.get = R;
|
|
87
|
+
n.prototype.has = U;
|
|
88
|
+
n.prototype.set = J;
|
|
89
|
+
function V() {
|
|
90
|
+
this.__data__ = [], this.size = 0;
|
|
91
|
+
}
|
|
92
|
+
function h(t, e) {
|
|
93
|
+
for (var a = t.length; a--; )
|
|
94
|
+
if (T(t[a][0], e))
|
|
95
|
+
return a;
|
|
96
|
+
return -1;
|
|
97
|
+
}
|
|
98
|
+
var B = Array.prototype, Q = B.splice;
|
|
99
|
+
function W(t) {
|
|
100
|
+
var e = this.__data__, a = h(e, t);
|
|
101
|
+
if (a < 0)
|
|
102
|
+
return !1;
|
|
103
|
+
var r = e.length - 1;
|
|
104
|
+
return a == r ? e.pop() : Q.call(e, a, 1), --this.size, !0;
|
|
105
|
+
}
|
|
106
|
+
function X(t) {
|
|
107
|
+
var e = this.__data__, a = h(e, t);
|
|
108
|
+
return a < 0 ? void 0 : e[a][1];
|
|
109
|
+
}
|
|
110
|
+
function Y(t) {
|
|
111
|
+
return h(this.__data__, t) > -1;
|
|
112
|
+
}
|
|
113
|
+
function Z(t, e) {
|
|
114
|
+
var a = this.__data__, r = h(a, t);
|
|
115
|
+
return r < 0 ? (++this.size, a.push([t, e])) : a[r][1] = e, this;
|
|
116
|
+
}
|
|
117
|
+
function o(t) {
|
|
118
|
+
var e = -1, a = t == null ? 0 : t.length;
|
|
119
|
+
for (this.clear(); ++e < a; ) {
|
|
120
|
+
var r = t[e];
|
|
121
|
+
this.set(r[0], r[1]);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
o.prototype.clear = V;
|
|
125
|
+
o.prototype.delete = W;
|
|
126
|
+
o.prototype.get = X;
|
|
127
|
+
o.prototype.has = Y;
|
|
128
|
+
o.prototype.set = Z;
|
|
129
|
+
var k = f(_, "Map");
|
|
130
|
+
function tt() {
|
|
131
|
+
this.size = 0, this.__data__ = {
|
|
132
|
+
hash: new n(),
|
|
133
|
+
map: new (k || o)(),
|
|
134
|
+
string: new n()
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
function et(t) {
|
|
138
|
+
var e = typeof t;
|
|
139
|
+
return e == "string" || e == "number" || e == "symbol" || e == "boolean" ? t !== "__proto__" : t === null;
|
|
140
|
+
}
|
|
141
|
+
function c(t, e) {
|
|
142
|
+
var a = t.__data__;
|
|
143
|
+
return et(e) ? a[typeof e == "string" ? "string" : "hash"] : a.map;
|
|
144
|
+
}
|
|
145
|
+
function at(t) {
|
|
146
|
+
var e = c(this, t).delete(t);
|
|
147
|
+
return this.size -= e ? 1 : 0, e;
|
|
148
|
+
}
|
|
149
|
+
function rt(t) {
|
|
150
|
+
return c(this, t).get(t);
|
|
151
|
+
}
|
|
152
|
+
function nt(t) {
|
|
153
|
+
return c(this, t).has(t);
|
|
154
|
+
}
|
|
155
|
+
function ot(t, e) {
|
|
156
|
+
var a = c(this, t), r = a.size;
|
|
157
|
+
return a.set(t, e), this.size += a.size == r ? 0 : 1, this;
|
|
158
|
+
}
|
|
159
|
+
function s(t) {
|
|
160
|
+
var e = -1, a = t == null ? 0 : t.length;
|
|
161
|
+
for (this.clear(); ++e < a; ) {
|
|
162
|
+
var r = t[e];
|
|
163
|
+
this.set(r[0], r[1]);
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
s.prototype.clear = tt;
|
|
167
|
+
s.prototype.delete = at;
|
|
168
|
+
s.prototype.get = rt;
|
|
169
|
+
s.prototype.has = nt;
|
|
170
|
+
s.prototype.set = ot;
|
|
171
|
+
export {
|
|
172
|
+
o as L,
|
|
173
|
+
k as M,
|
|
174
|
+
s as a,
|
|
175
|
+
T as e,
|
|
176
|
+
f as g,
|
|
177
|
+
C as i,
|
|
178
|
+
w as t
|
|
179
|
+
};
|