@cccsaurora/clue-ui 1.4.3-dev.457 → 1.4.3
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-h08d0iw-.js +4403 -0
- package/AnnotationDetails-DU_7TqAH.js +160 -0
- package/AnnotationPreview-DjIO0yXp.js +140 -0
- package/ClueEnrichContext-BU7wzqVH.js +452 -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 +91 -111
- 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 +81 -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 +13 -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 +81 -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 +5770 -8678
- 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/data/event.js +4 -6
- 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.js +24 -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 -49
- 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-BH-gBhtO.js +2282 -0
- package/index-BM9Sve5T.js +571 -0
- package/index-Cj4d5cGz.js +357 -0
- package/index-D3Dwn-8x.js +6464 -0
- package/index-Dh2PP9h8.js +11747 -0
- package/index-DoFpWPHo.js +975 -0
- 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 +62 -62
- package/maxBy-BOWDkL_D.js +8 -0
- package/package.json +1 -1
- 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-WkKbPdwG.js +8453 -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/utils.js +10 -10
- package/utils/window.js +10 -21
- package/utils-SpTOhPYl.js +147 -0
- package/ActionForm-CvFkw9hc.js +0 -6099
- package/AnnotationDetails-B31ACXCI.js +0 -176
- package/AnnotationPreview-EVqrlmNm.js +0 -188
- package/ClueEnrichContext-C7sNEECP.js +0 -594
- 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-DJxl6dC-.js +0 -1789
- package/identity-CPGTqrE4.js +0 -6
- package/index-CDrC9oSE.js +0 -1172
- package/index-CVUD9o3t.js +0 -15768
- package/index-DUEubgWN.js +0 -464
- package/index-DpJxD74E.js +0 -3272
- package/index-IKI1G5v-.js +0 -9314
- 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-kdsH0l7f.js +0 -11779
- package/sessionStorage-B68y-wnE.js +0 -140
- package/sortBy-B8JVsLQY.js +0 -95
- package/store-DHP48fQB.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,452 @@
|
|
|
1
|
+
import { jsx as Ct } from "react/jsx-runtime";
|
|
2
|
+
import { a as Ot } from "./iconify-Ptb5dTKy.js";
|
|
3
|
+
import { a as $t, p as ft } from "./index-BH-gBhtO.js";
|
|
4
|
+
import { REPLICATORS as F } from "./database/globals.js";
|
|
5
|
+
import { clueDebugLogger as G } from "./utils/loggerUtil.js";
|
|
6
|
+
import { c as H } from "./utils-SpTOhPYl.js";
|
|
7
|
+
import { b as gt } from "./_baseSlice-M5RKzt1A.js";
|
|
8
|
+
import { t as jt } from "./toFinite-CBrE65MP.js";
|
|
9
|
+
import { d as Pt } from "./sessionStorage-DFMae61b.js";
|
|
10
|
+
import { g as pt } from "./groupBy-CrJC7sGa.js";
|
|
11
|
+
import { u as dt } from "./uniq-B4UZ671_.js";
|
|
12
|
+
import { b as Mt } from "./_baseIteratee-D0FhC5bC.js";
|
|
13
|
+
import { b as Rt } from "./_baseUniq-D3N8igOm.js";
|
|
14
|
+
import { useContext as qt, useState as S, useMemo as K, useCallback as j, useRef as At, useEffect as P } from "react";
|
|
15
|
+
import { c as St } from "./index-BM9Sve5T.js";
|
|
16
|
+
import { ClueDatabaseContext as Bt } from "./hooks/ClueDatabaseContext.js";
|
|
17
|
+
import Vt from "./hooks/useClueConfig.js";
|
|
18
|
+
import bt from "./hooks/useClueTypeConfig.js";
|
|
19
|
+
import { i as Ut } from "./isEmpty-DKxrY-_M.js";
|
|
20
|
+
function Wt(n) {
|
|
21
|
+
var r = jt(n), m = r % 1;
|
|
22
|
+
return r === r ? m ? r - m : r : 0;
|
|
23
|
+
}
|
|
24
|
+
var Ft = Math.ceil, Ht = Math.max;
|
|
25
|
+
function Jt(n, r, m) {
|
|
26
|
+
r === void 0 ? r = 1 : r = Ht(Wt(r), 0);
|
|
27
|
+
var u = n == null ? 0 : n.length;
|
|
28
|
+
if (!u || r < 1)
|
|
29
|
+
return [];
|
|
30
|
+
for (var y = 0, D = 0, M = Array(Ft(u / r)); y < u; )
|
|
31
|
+
M[D++] = gt(n, y, y += r);
|
|
32
|
+
return M;
|
|
33
|
+
}
|
|
34
|
+
function Qt(n, r) {
|
|
35
|
+
return n && n.length ? Rt(n, Mt(r)) : [];
|
|
36
|
+
}
|
|
37
|
+
let J;
|
|
38
|
+
const _t = new Uint8Array(16);
|
|
39
|
+
function Gt() {
|
|
40
|
+
if (!J && (J = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto), !J))
|
|
41
|
+
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
42
|
+
return J(_t);
|
|
43
|
+
}
|
|
44
|
+
const d = [];
|
|
45
|
+
for (let n = 0; n < 256; ++n)
|
|
46
|
+
d.push((n + 256).toString(16).slice(1));
|
|
47
|
+
function Kt(n, r = 0) {
|
|
48
|
+
return d[n[r + 0]] + d[n[r + 1]] + d[n[r + 2]] + d[n[r + 3]] + "-" + d[n[r + 4]] + d[n[r + 5]] + "-" + d[n[r + 6]] + d[n[r + 7]] + "-" + d[n[r + 8]] + d[n[r + 9]] + "-" + d[n[r + 10]] + d[n[r + 11]] + d[n[r + 12]] + d[n[r + 13]] + d[n[r + 14]] + d[n[r + 15]];
|
|
49
|
+
}
|
|
50
|
+
const Xt = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), mt = {
|
|
51
|
+
randomUUID: Xt
|
|
52
|
+
};
|
|
53
|
+
function X(n, r, m) {
|
|
54
|
+
if (mt.randomUUID && !n)
|
|
55
|
+
return mt.randomUUID();
|
|
56
|
+
n = n || {};
|
|
57
|
+
const u = n.random || (n.rng || Gt)();
|
|
58
|
+
return u[6] = u[6] & 15 | 64, u[8] = u[8] & 63 | 128, Kt(u);
|
|
59
|
+
}
|
|
60
|
+
const Yt = St(null), de = ({
|
|
61
|
+
children: n,
|
|
62
|
+
classification: r,
|
|
63
|
+
baseURL: m,
|
|
64
|
+
getToken: u,
|
|
65
|
+
onNetworkCall: y,
|
|
66
|
+
pickSources: D,
|
|
67
|
+
chunkSize: M = 15,
|
|
68
|
+
maxRequestCount: Q = 4,
|
|
69
|
+
defaultTimeout: B = 5,
|
|
70
|
+
enabled: $ = !0,
|
|
71
|
+
ready: yt = !1,
|
|
72
|
+
publicIconify: Y = !0,
|
|
73
|
+
skipConfigCall: Z = !1,
|
|
74
|
+
customIconify: V,
|
|
75
|
+
debugLogging: C = !0
|
|
76
|
+
}) => {
|
|
77
|
+
var ot, ct, at, ut, lt;
|
|
78
|
+
const g = Vt(), t = qt(Bt), [z, ht] = S(null), E = K(
|
|
79
|
+
() => {
|
|
80
|
+
var e, s;
|
|
81
|
+
return z ?? r ?? ((s = (e = g.config) == null ? void 0 : e.c12nDef) == null ? void 0 : s.RESTRICTED);
|
|
82
|
+
},
|
|
83
|
+
[r, (ct = (ot = g.config) == null ? void 0 : ot.c12nDef) == null ? void 0 : ct.RESTRICTED, z]
|
|
84
|
+
), N = j(
|
|
85
|
+
(e) => {
|
|
86
|
+
var s;
|
|
87
|
+
return ht(e((s = g.config) == null ? void 0 : s.c12nDef));
|
|
88
|
+
},
|
|
89
|
+
[(at = g.config) == null ? void 0 : at.c12nDef]
|
|
90
|
+
), [x, wt] = S(yt), R = At(0), [O, vt] = S([]), { availableSources: q, typesDetection: b, supportedTypes: T } = bt(
|
|
91
|
+
$ && x,
|
|
92
|
+
m,
|
|
93
|
+
C,
|
|
94
|
+
u,
|
|
95
|
+
y
|
|
96
|
+
);
|
|
97
|
+
P(() => {
|
|
98
|
+
if (Z || !$ || !x)
|
|
99
|
+
return;
|
|
100
|
+
const e = {}, s = u == null ? void 0 : u();
|
|
101
|
+
s && (e.Authorization = `Bearer ${s}`);
|
|
102
|
+
let c = { baseURL: m, headers: e };
|
|
103
|
+
y && (c = y(c)), $t.configs.get(c).then(g.setConfig);
|
|
104
|
+
}, [m, y, Z, $, x]);
|
|
105
|
+
const [L, k] = S(() => {
|
|
106
|
+
var e;
|
|
107
|
+
return !!((e = t == null ? void 0 : t.selectors) != null && e.synced);
|
|
108
|
+
});
|
|
109
|
+
P(() => {
|
|
110
|
+
var e;
|
|
111
|
+
k(!!((e = t == null ? void 0 : t.selectors) != null && e.synced));
|
|
112
|
+
}, [t]), P(() => {
|
|
113
|
+
if (x) {
|
|
114
|
+
const e = Object.values(F).map((s) => (s.reSync(), s.start(), s.active$.subscribe((c) => {
|
|
115
|
+
var i;
|
|
116
|
+
c || k(!!((i = t == null ? void 0 : t.selectors) != null && i.synced));
|
|
117
|
+
})));
|
|
118
|
+
return () => {
|
|
119
|
+
e.forEach((s) => s.unsubscribe()), Object.values(F).forEach((s) => {
|
|
120
|
+
s.pause();
|
|
121
|
+
});
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
return () => {
|
|
125
|
+
Object.values(F).forEach((e) => {
|
|
126
|
+
e.pause();
|
|
127
|
+
});
|
|
128
|
+
};
|
|
129
|
+
}, [t, x]);
|
|
130
|
+
const [tt, et] = S(V);
|
|
131
|
+
P(() => {
|
|
132
|
+
V && et(V);
|
|
133
|
+
}, [V]), P(() => {
|
|
134
|
+
if (Y)
|
|
135
|
+
return;
|
|
136
|
+
let e = tt ?? void 0 ?? (m == null ? void 0 : m.replace(/^[^.]+/, "icons"));
|
|
137
|
+
!e && typeof window < "u" && window && !window.location.origin.includes("localhost") && (e = window.location.protocol + "//" + window.location.origin.replace(/^[^.]+/, "icons")), e && (G(`Using ${e} for iconify`, C), Ot("", {
|
|
138
|
+
resources: [e]
|
|
139
|
+
}));
|
|
140
|
+
}, [m, tt, C, Y]);
|
|
141
|
+
const U = j(
|
|
142
|
+
async (e) => {
|
|
143
|
+
const s = [];
|
|
144
|
+
for (const i of e) {
|
|
145
|
+
const { latency: a, source: l, type: o, value: h, items: f, error: w } = i;
|
|
146
|
+
await t.selectors.find({ selector: { type: o, value: h, source: l } }).incrementalRemove(), w && s.push({
|
|
147
|
+
id: X(),
|
|
148
|
+
source: l,
|
|
149
|
+
type: o,
|
|
150
|
+
value: h,
|
|
151
|
+
annotations: [],
|
|
152
|
+
classification: E,
|
|
153
|
+
latency: a,
|
|
154
|
+
count: 0,
|
|
155
|
+
error: w
|
|
156
|
+
});
|
|
157
|
+
for (const p of f) {
|
|
158
|
+
const { classification: v, count: I, link: xt, annotations: Dt } = p, _ = {
|
|
159
|
+
id: X(),
|
|
160
|
+
source: l,
|
|
161
|
+
type: o,
|
|
162
|
+
value: h,
|
|
163
|
+
annotations: Dt,
|
|
164
|
+
classification: v,
|
|
165
|
+
latency: a,
|
|
166
|
+
count: I,
|
|
167
|
+
link: xt,
|
|
168
|
+
error: w
|
|
169
|
+
};
|
|
170
|
+
s.some((It) => It.id === _.id) && (_.id = X()), s.push(_);
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
const c = await t.selectors.bulkInsert(s);
|
|
174
|
+
c.error.length > 0 && (console.warn("Errors on upsert:"), c.error.forEach((i) => console.warn(i.documentId, i.validationErrors ?? i.status)));
|
|
175
|
+
},
|
|
176
|
+
[t, E]
|
|
177
|
+
), st = j(
|
|
178
|
+
async (e, s, c = {}) => {
|
|
179
|
+
var p;
|
|
180
|
+
if (!e || !s)
|
|
181
|
+
return console.error(`Type (${e}) or value (${s}) is empty, returning empty response`), {};
|
|
182
|
+
const i = (D == null ? void 0 : D(O, q, [{ type: e, value: s, classification: c.classification }])) ?? O, a = {
|
|
183
|
+
timeout: B,
|
|
184
|
+
force: !1,
|
|
185
|
+
includeRaw: !1,
|
|
186
|
+
noCache: !1,
|
|
187
|
+
classification: E,
|
|
188
|
+
sources: i,
|
|
189
|
+
...c
|
|
190
|
+
}, l = {}, o = u == null ? void 0 : u();
|
|
191
|
+
o && (l.Authorization = `Bearer ${o}`);
|
|
192
|
+
let h = { baseURL: m, headers: l };
|
|
193
|
+
y && (h = y(h));
|
|
194
|
+
const f = {
|
|
195
|
+
type: e,
|
|
196
|
+
value: s,
|
|
197
|
+
classification: a.classification
|
|
198
|
+
};
|
|
199
|
+
let w = await t.status.findOne({ selector: { ...f } }).exec();
|
|
200
|
+
w ? await w.incrementalPatch({ status: "in-progress" }) : w = await ((p = t.status) == null ? void 0 : p.insert({
|
|
201
|
+
id: await H(f.type, f.value, f.classification ?? E),
|
|
202
|
+
type: f.type,
|
|
203
|
+
value: f.value,
|
|
204
|
+
classification: f.classification ?? E,
|
|
205
|
+
status: "in-progress"
|
|
206
|
+
}));
|
|
207
|
+
try {
|
|
208
|
+
const v = await ft([f], a.sources, a, h), I = Object.values(Object.values(v)[0])[0];
|
|
209
|
+
return await U(Object.values(I)), I;
|
|
210
|
+
} catch (v) {
|
|
211
|
+
return console.error(v), {};
|
|
212
|
+
} finally {
|
|
213
|
+
await (w == null ? void 0 : w.incrementalPatch({ status: "complete" }));
|
|
214
|
+
}
|
|
215
|
+
},
|
|
216
|
+
[
|
|
217
|
+
U,
|
|
218
|
+
q,
|
|
219
|
+
m,
|
|
220
|
+
t,
|
|
221
|
+
E,
|
|
222
|
+
B,
|
|
223
|
+
u,
|
|
224
|
+
y,
|
|
225
|
+
D,
|
|
226
|
+
O
|
|
227
|
+
]
|
|
228
|
+
), W = j(
|
|
229
|
+
async (e, s) => {
|
|
230
|
+
var f, w;
|
|
231
|
+
const c = (D == null ? void 0 : D(O, q, e)) ?? O, i = {
|
|
232
|
+
timeout: B,
|
|
233
|
+
includeRaw: !1,
|
|
234
|
+
noCache: !1,
|
|
235
|
+
classification: E,
|
|
236
|
+
sources: c,
|
|
237
|
+
...s
|
|
238
|
+
}, a = {}, l = u == null ? void 0 : u();
|
|
239
|
+
l && (a.Authorization = `Bearer ${l}`);
|
|
240
|
+
let o = { baseURL: m, headers: a };
|
|
241
|
+
y && (o = y(o));
|
|
242
|
+
const h = [];
|
|
243
|
+
for (const p of e) {
|
|
244
|
+
const v = { type: p.type, value: p.value, classification: i.classification };
|
|
245
|
+
let I = await ((f = t.status) == null ? void 0 : f.findOne({
|
|
246
|
+
selector: v
|
|
247
|
+
}).incrementalPatch({
|
|
248
|
+
status: "in-progress"
|
|
249
|
+
}));
|
|
250
|
+
I || (I = await ((w = t.status) == null ? void 0 : w.insert({
|
|
251
|
+
id: await H(v.type, v.value, v.classification),
|
|
252
|
+
...v,
|
|
253
|
+
status: "in-progress",
|
|
254
|
+
sources: i.sources
|
|
255
|
+
}))), I && h.push(I.toMutableJSON());
|
|
256
|
+
}
|
|
257
|
+
try {
|
|
258
|
+
const p = await ft(e, i.sources, i, o), v = Object.values(p).flatMap(Object.values).flatMap(Object.values);
|
|
259
|
+
return await U(v), p;
|
|
260
|
+
} catch (p) {
|
|
261
|
+
return console.error(p), {};
|
|
262
|
+
} finally {
|
|
263
|
+
t.status.bulkUpsert(
|
|
264
|
+
Qt(h, (p) => p.id).map((p) => (p.status = "complete", p))
|
|
265
|
+
);
|
|
266
|
+
}
|
|
267
|
+
},
|
|
268
|
+
[
|
|
269
|
+
D,
|
|
270
|
+
O,
|
|
271
|
+
q,
|
|
272
|
+
B,
|
|
273
|
+
E,
|
|
274
|
+
u,
|
|
275
|
+
m,
|
|
276
|
+
y,
|
|
277
|
+
t,
|
|
278
|
+
U
|
|
279
|
+
]
|
|
280
|
+
), A = K(
|
|
281
|
+
() => Pt(
|
|
282
|
+
async () => {
|
|
283
|
+
if (t != null && t.status) {
|
|
284
|
+
if (t.status.closed) {
|
|
285
|
+
console.warn("Status database is closed, will not enrich");
|
|
286
|
+
return;
|
|
287
|
+
}
|
|
288
|
+
} else return;
|
|
289
|
+
const e = await t.status.find({ selector: { status: "pending" } }).update({ $set: { status: "in-progress" } });
|
|
290
|
+
if (e.length < 1)
|
|
291
|
+
return;
|
|
292
|
+
const s = Jt(e, M);
|
|
293
|
+
G(
|
|
294
|
+
`Enriching ${e.length} selectors in ${s.length} chunks of ${M}.`,
|
|
295
|
+
C
|
|
296
|
+
), await Promise.all(
|
|
297
|
+
// For performance reasons, we chunk the requests. This will allow us to take advantage of parellelization in the
|
|
298
|
+
// backend, both on the pod level and kubernetes level
|
|
299
|
+
s.map(async (c) => {
|
|
300
|
+
let i = null;
|
|
301
|
+
if (R.current <= Q)
|
|
302
|
+
R.current += 1;
|
|
303
|
+
else {
|
|
304
|
+
let a = Date.now();
|
|
305
|
+
await new Promise((l) => {
|
|
306
|
+
i = setInterval(() => {
|
|
307
|
+
G(
|
|
308
|
+
`Waiting on ${R.current} existing requests to complete (total delay: ${Date.now() - a}ms)`,
|
|
309
|
+
C
|
|
310
|
+
), R.current < Q && l();
|
|
311
|
+
}, 400);
|
|
312
|
+
}).finally(() => {
|
|
313
|
+
R.current += 1, clearInterval(i);
|
|
314
|
+
});
|
|
315
|
+
}
|
|
316
|
+
try {
|
|
317
|
+
const a = {}, l = dt(c.flatMap((o) => o.sources ?? []));
|
|
318
|
+
l.length > 0 && (a.sources = l), await W(
|
|
319
|
+
c.map((o) => o.toSelector()),
|
|
320
|
+
a
|
|
321
|
+
), await t.status.findByIds(c.map((o) => o.id)).update({ $set: { status: "complete" } });
|
|
322
|
+
} catch (a) {
|
|
323
|
+
console.error(a);
|
|
324
|
+
} finally {
|
|
325
|
+
R.current -= 1, i && clearInterval(i);
|
|
326
|
+
}
|
|
327
|
+
})
|
|
328
|
+
);
|
|
329
|
+
},
|
|
330
|
+
200,
|
|
331
|
+
{ maxWait: 500, leading: !1 }
|
|
332
|
+
),
|
|
333
|
+
[W, M, t, C, Q]
|
|
334
|
+
);
|
|
335
|
+
P(() => {
|
|
336
|
+
}, [t, C]), P(() => {
|
|
337
|
+
if (!$ || !x || !(t != null && t.status))
|
|
338
|
+
return;
|
|
339
|
+
if (t != null && t.status.closed) {
|
|
340
|
+
console.warn("Status collection is closed");
|
|
341
|
+
return;
|
|
342
|
+
}
|
|
343
|
+
const e = t.status.find({
|
|
344
|
+
selector: {
|
|
345
|
+
status: "pending"
|
|
346
|
+
}
|
|
347
|
+
}).$.subscribe(() => A());
|
|
348
|
+
return () => {
|
|
349
|
+
try {
|
|
350
|
+
e == null || e.unsubscribe(), A.cancel();
|
|
351
|
+
} catch (s) {
|
|
352
|
+
console.warn(s);
|
|
353
|
+
}
|
|
354
|
+
};
|
|
355
|
+
}, [$, x, t, C, A, (ut = t == null ? void 0 : t.status) == null ? void 0 : ut.closed]);
|
|
356
|
+
const nt = j(
|
|
357
|
+
async (e, s, c) => {
|
|
358
|
+
var l, o;
|
|
359
|
+
if (!e)
|
|
360
|
+
throw new Error("Type cannot be null");
|
|
361
|
+
if (!s)
|
|
362
|
+
throw new Error("Value cannot be null");
|
|
363
|
+
if (!t.status || t.status.closed) {
|
|
364
|
+
console.warn("status collection is closed");
|
|
365
|
+
return;
|
|
366
|
+
}
|
|
367
|
+
const i = { type: e, value: s, classification: c ?? E };
|
|
368
|
+
let a = await ((l = t.status) == null ? void 0 : l.findOne({
|
|
369
|
+
selector: i
|
|
370
|
+
}).exec());
|
|
371
|
+
return a || (a = await ((o = t.status) == null ? void 0 : o.queueInsert({
|
|
372
|
+
id: await H(i.type, i.value, i.classification),
|
|
373
|
+
...i,
|
|
374
|
+
status: "pending"
|
|
375
|
+
}))), a;
|
|
376
|
+
},
|
|
377
|
+
[E, t]
|
|
378
|
+
), rt = j(async () => {
|
|
379
|
+
if (!(t != null && t.selectors) || t.selectors.closed)
|
|
380
|
+
return;
|
|
381
|
+
const e = await t.selectors.find({ selector: { error: { $exists: !0 } } }).exec(), s = pt(e, "classification"), c = [];
|
|
382
|
+
for (const [i, a] of Object.entries(s)) {
|
|
383
|
+
const l = pt(a, (o) => `${o.type}:${o.value}`);
|
|
384
|
+
for (const o of Object.values(l))
|
|
385
|
+
c.push({
|
|
386
|
+
id: await H(o[0].type, o[0].value, i),
|
|
387
|
+
type: o[0].type,
|
|
388
|
+
value: o[0].value,
|
|
389
|
+
classification: i,
|
|
390
|
+
sources: dt(o.map((h) => h.source)).sort(),
|
|
391
|
+
status: "pending"
|
|
392
|
+
});
|
|
393
|
+
}
|
|
394
|
+
c.length > 0 && (await t.status.bulkInsert(c), $ && x && A()), await t.selectors.bulkRemove(e);
|
|
395
|
+
}, [t, $, A, x]), it = j(
|
|
396
|
+
(e) => {
|
|
397
|
+
var l, o;
|
|
398
|
+
if (!e)
|
|
399
|
+
return null;
|
|
400
|
+
const s = Object.entries(b), c = (l = s.find(([h, f]) => f.exec(e))) == null ? void 0 : l[0];
|
|
401
|
+
if (c)
|
|
402
|
+
return c;
|
|
403
|
+
const i = e.toLowerCase(), a = (o = s.find(([h, f]) => f.exec(i))) == null ? void 0 : o[0];
|
|
404
|
+
return a || null;
|
|
405
|
+
},
|
|
406
|
+
[b]
|
|
407
|
+
), Et = K(
|
|
408
|
+
() => {
|
|
409
|
+
var e;
|
|
410
|
+
return {
|
|
411
|
+
bulkEnrich: W,
|
|
412
|
+
enrich: st,
|
|
413
|
+
enrichFailedEnrichments: rt,
|
|
414
|
+
sources: O,
|
|
415
|
+
setSources: vt,
|
|
416
|
+
typesDetection: b,
|
|
417
|
+
supportedTypes: T,
|
|
418
|
+
availableSources: q,
|
|
419
|
+
guessType: it,
|
|
420
|
+
queueEnrich: nt,
|
|
421
|
+
setCustomIconify: et,
|
|
422
|
+
setDefaultClassification: N,
|
|
423
|
+
setReady: wt,
|
|
424
|
+
defaultClassification: E,
|
|
425
|
+
ready: x && !!t && !!((e = g.config) != null && e.c12nDef) && (Ut(F) || L)
|
|
426
|
+
};
|
|
427
|
+
},
|
|
428
|
+
[
|
|
429
|
+
W,
|
|
430
|
+
st,
|
|
431
|
+
rt,
|
|
432
|
+
O,
|
|
433
|
+
b,
|
|
434
|
+
T,
|
|
435
|
+
q,
|
|
436
|
+
it,
|
|
437
|
+
nt,
|
|
438
|
+
N,
|
|
439
|
+
E,
|
|
440
|
+
x,
|
|
441
|
+
t,
|
|
442
|
+
(lt = g.config) == null ? void 0 : lt.c12nDef,
|
|
443
|
+
L
|
|
444
|
+
]
|
|
445
|
+
);
|
|
446
|
+
return /* @__PURE__ */ Ct(Yt.Provider, { value: Et, children: n });
|
|
447
|
+
};
|
|
448
|
+
export {
|
|
449
|
+
Yt as C,
|
|
450
|
+
de as a,
|
|
451
|
+
Qt as u
|
|
452
|
+
};
|
|
@@ -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
|
+
};
|