@cccsaurora/clue-ui 1.2.3-dev.266 → 1.2.3-patch.269
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-Ch0DGVGr.js +4462 -0
- package/AnnotationDetails-C8E_Xvaf.js +160 -0
- package/AnnotationPreview-CLCms-Fm.js +140 -0
- package/ClueEnrichContext-KqRuuWNS.js +418 -0
- package/FlexOne-BXWFOd1T.js +6 -0
- package/_MapCache-BiTi0iqu.js +180 -0
- package/_Uint8Array-BQNOM9Rr.js +101 -0
- package/_baseAssignValue-CNMLQZco.js +20 -0
- package/_baseClone-BnT-6pyM.js +207 -0
- package/_baseExtremum-Ca2EHgy2.js +16 -0
- package/_baseFlatten-Bfr_Molw.js +72 -0
- package/_baseGet-DSZygzyq.js +79 -0
- package/_baseIsEqual-VgvaAFZG.js +147 -0
- package/_baseIteratee-Dbfsw5z8.js +95 -0
- package/_baseSlice-M5RKzt1A.js +10 -0
- package/_baseSum-wEbgNeUs.js +10 -0
- package/_baseUniq-BJcj69PL.js +79 -0
- package/_commonjsHelpers-DaMA6jEr.js +8 -0
- package/_createAggregator-k3TuAnxT.js +53 -0
- package/_getPrototype-Cr1Mk7BC.js +5 -0
- package/_getTag-CK2Sffaq.js +90 -0
- package/_isIterateeCall-DkJP7Rbx.js +13 -0
- package/_setToArray-C7yMOeww.js +29 -0
- package/cloneDeep-CF8TtLHr.js +8 -0
- package/components/AnnotationBody.js +35 -49
- package/components/AnnotationDetailPopover.js +30 -36
- package/components/AnnotationDetails.js +7 -7
- package/components/AnnotationEntry.js +35 -35
- package/components/AnnotationPreview.js +5 -5
- package/components/ClassificationChip.js +23 -44
- 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 +10 -21
- 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 +69 -88
- 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 +119 -158
- package/components/fetchers/PreviewModal.js +17 -20
- 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 +33 -43
- package/countBy-CdYegFSu.js +8 -0
- package/data/event.js +4 -6
- package/database/index.js +2 -2
- package/debounce-DryYcbJ4.js +56 -0
- package/get-CH7kz5Ix.js +8 -0
- package/groupBy-br8xmD2R.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 +13 -19
- package/hooks/ClueEnrichContext.js +8 -8
- package/hooks/ClueFetcherContext.js +56 -83
- package/hooks/ClueGroupContext.js +14 -17
- package/hooks/CluePopupContext.js +5 -5
- package/hooks/ClueProvider.js +10 -12
- package/hooks/selectors.js +7 -7
- package/hooks/useActionResult.d.ts +1 -0
- package/hooks/useActionResult.js +2 -2
- package/hooks/useAnnotations.js +31 -47
- package/hooks/useClue.js +4 -6
- package/hooks/useClueActions.js +3 -3
- package/hooks/useClueConfig.js +4 -6
- package/hooks/useClueTypeConfig.js +3 -3
- package/hooks/useComparator.js +435 -722
- package/hooks/useErrors.js +18 -22
- package/hooks/useFetcherResult.d.ts +1 -0
- package/hooks/useFetcherResult.js +24 -33
- package/hooks/useMyHighlights.js +36 -66
- package/hooks/useMyLocalStorage.js +37 -66
- package/iconify-BBckr5AQ.js +1263 -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-BHAe_V9n.js +12768 -0
- package/index-BK-zfYhR.js +358 -0
- package/index-CA5CUNZO.js +975 -0
- package/index-Dj5C04IX.js +568 -0
- package/index-p5_wX7q1.js +11729 -0
- package/isNil-CjWwlQS3.js +6 -0
- package/isObject-B53jY8Qg.js +7 -0
- package/isObjectLike-BatpeCIi.js +29 -0
- package/isSymbol-C3_SC0Qp.js +8 -0
- package/last-7CdUxN0r.js +7 -0
- package/main.js +60 -60
- package/maxBy-Bc0dYHcO.js +8 -0
- package/package.json +1 -1
- package/sortBy-DY2JBf9n.js +75 -0
- package/sumBy-DuMASLPd.js +8 -0
- package/text/Frequency.js +23 -42
- package/toFinite-BMy6GObD.js +14 -0
- package/toNumber-YVhnnJv4.js +31 -0
- package/types/WithActionData.d.ts +2 -1
- package/useClueTypeConfig-Ct9Ygter.js +2292 -0
- package/utils/chain.js +65 -92
- package/utils/classificationParser.js +256 -519
- package/utils/constants.js +10 -35
- 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 +27 -41
- package/utils/time.js +423 -423
- package/utils/utils.js +9 -9
- package/utils/window.js +10 -21
- package/utils-DmwSUrum.js +129 -0
- package/ActionForm-uDp92tN2.js +0 -5941
- package/AnnotationDetails-DGYfOiWm.js +0 -175
- package/AnnotationPreview-bHObsb3P.js +0 -188
- package/ClueEnrichContext-CJEJxrgs.js +0 -541
- package/FlexOne-BSYAhhtG.js +0 -9
- package/_MapCache-WmuDdwuH.js +0 -222
- package/_Uint8Array-B7JqpgFX.js +0 -128
- package/_baseAssignValue-CGTuELqU.js +0 -25
- package/_baseClone-CkNrTyhm.js +0 -283
- package/_baseExtremum-kob8QXyt.js +0 -18
- package/_baseFlatten-jIR_sN_-.js +0 -92
- package/_baseGet-Bx3A4Qfp.js +0 -108
- package/_baseIsEqual-C5OTWzTk.js +0 -208
- package/_baseIteratee-avi7MX2o.js +0 -126
- package/_baseSlice-GAv_YFTT.js +0 -20
- package/_baseSum-D0WC1dN0.js +0 -13
- package/_baseUniq-BI9GIHMF.js +0 -115
- package/_commonjsHelpers-DWwsNxpa.js +0 -8
- package/_createAggregator-QD8MzKwe.js +0 -63
- package/_getPrototype-CU0j_POw.js +0 -5
- package/_getTag-Ckxxfr88.js +0 -126
- package/_isIterateeCall-Ds3sw2SF.js +0 -17
- package/_setToArray-CaPKQhcz.js +0 -33
- package/cloneDeep-DJrLSw8W.js +0 -8
- package/countBy-c6S3dvSW.js +0 -14
- package/debounce-bV0h5FC5.js +0 -92
- package/get-DSsNkRQs.js +0 -8
- package/groupBy-xqz-n0Vd.js +0 -14
- package/iconify-CXMreGTg.js +0 -1782
- package/identity-CPGTqrE4.js +0 -6
- package/index-AMfoEg_6.js +0 -696
- package/index-B6C2a_Lg.js +0 -1172
- package/index-C12gPw2W.js +0 -17698
- package/index-DCKkHTvx.js +0 -15750
- package/index-JcKyZeoY.js +0 -465
- package/isNil-CIubwp4T.js +0 -6
- package/isObject-FTY-5JQX.js +0 -7
- package/isObjectLike-OAgjjZye.js +0 -48
- package/isSymbol-Xd2FsJyp.js +0 -8
- package/last-CUCl67Im.js +0 -7
- package/maxBy-IKHzFrCS.js +0 -8
- package/sortBy-DfSj8IoJ.js +0 -96
- package/sumBy-D-hb_NY-.js +0 -8
- package/toFinite-Bc55msYj.js +0 -16
- package/toNumber-DPxy1FBy.js +0 -39
- package/useClueTypeConfig-Z1LFp01b.js +0 -3289
- package/utils-HmNPuoDB.js +0 -199
|
@@ -0,0 +1,418 @@
|
|
|
1
|
+
import { jsx as xt } from "react/jsx-runtime";
|
|
2
|
+
import { a as Dt } from "./iconify-BBckr5AQ.js";
|
|
3
|
+
import { b as Et, a as It, p as at, u as ut } from "./useClueTypeConfig-Ct9Ygter.js";
|
|
4
|
+
import { clueDebugLogger as _ } from "./utils/loggerUtil.js";
|
|
5
|
+
import { b as Ct } from "./_baseSlice-M5RKzt1A.js";
|
|
6
|
+
import { t as $t } from "./toFinite-BMy6GObD.js";
|
|
7
|
+
import { d as gt } from "./debounce-DryYcbJ4.js";
|
|
8
|
+
import { g as lt } from "./groupBy-br8xmD2R.js";
|
|
9
|
+
import { b as Ot } from "./_baseIteratee-Dbfsw5z8.js";
|
|
10
|
+
import { b as jt } from "./_baseUniq-BJcj69PL.js";
|
|
11
|
+
import { useContext as Pt, useState as H, useMemo as G, useCallback as $, useRef as Mt, useEffect as b } from "react";
|
|
12
|
+
import { c as qt } from "./index-Dj5C04IX.js";
|
|
13
|
+
import { ClueDatabaseContext as bt } from "./hooks/ClueDatabaseContext.js";
|
|
14
|
+
import At from "./hooks/useClueConfig.js";
|
|
15
|
+
function Bt(s) {
|
|
16
|
+
var n = $t(s), p = n % 1;
|
|
17
|
+
return n === n ? p ? n - p : n : 0;
|
|
18
|
+
}
|
|
19
|
+
var Rt = Math.ceil, Vt = Math.max;
|
|
20
|
+
function Ut(s, n, p) {
|
|
21
|
+
n === void 0 ? n = 1 : n = Vt(Bt(n), 0);
|
|
22
|
+
var l = s == null ? 0 : s.length;
|
|
23
|
+
if (!l || n < 1)
|
|
24
|
+
return [];
|
|
25
|
+
for (var y = 0, v = 0, O = Array(Rt(l / n)); y < l; )
|
|
26
|
+
O[v++] = Ct(s, y, y += n);
|
|
27
|
+
return O;
|
|
28
|
+
}
|
|
29
|
+
function Wt(s, n) {
|
|
30
|
+
return s && s.length ? jt(s, Ot(n)) : [];
|
|
31
|
+
}
|
|
32
|
+
let J;
|
|
33
|
+
const Ft = new Uint8Array(16);
|
|
34
|
+
function Ht() {
|
|
35
|
+
if (!J && (J = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto), !J))
|
|
36
|
+
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
37
|
+
return J(Ft);
|
|
38
|
+
}
|
|
39
|
+
const d = [];
|
|
40
|
+
for (let s = 0; s < 256; ++s)
|
|
41
|
+
d.push((s + 256).toString(16).slice(1));
|
|
42
|
+
function Jt(s, n = 0) {
|
|
43
|
+
return d[s[n + 0]] + d[s[n + 1]] + d[s[n + 2]] + d[s[n + 3]] + "-" + d[s[n + 4]] + d[s[n + 5]] + "-" + d[s[n + 6]] + d[s[n + 7]] + "-" + d[s[n + 8]] + d[s[n + 9]] + "-" + d[s[n + 10]] + d[s[n + 11]] + d[s[n + 12]] + d[s[n + 13]] + d[s[n + 14]] + d[s[n + 15]];
|
|
44
|
+
}
|
|
45
|
+
const Qt = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), ft = {
|
|
46
|
+
randomUUID: Qt
|
|
47
|
+
};
|
|
48
|
+
function g(s, n, p) {
|
|
49
|
+
if (ft.randomUUID && !s)
|
|
50
|
+
return ft.randomUUID();
|
|
51
|
+
s = s || {};
|
|
52
|
+
const l = s.random || (s.rng || Ht)();
|
|
53
|
+
return l[6] = l[6] & 15 | 64, l[8] = l[8] & 63 | 128, Jt(l);
|
|
54
|
+
}
|
|
55
|
+
const St = qt(null), ne = ({
|
|
56
|
+
children: s,
|
|
57
|
+
classification: n,
|
|
58
|
+
baseURL: p,
|
|
59
|
+
getToken: l,
|
|
60
|
+
onNetworkCall: y,
|
|
61
|
+
pickSources: v,
|
|
62
|
+
chunkSize: O = 15,
|
|
63
|
+
maxRequestCount: Q = 4,
|
|
64
|
+
defaultTimeout: A = 5,
|
|
65
|
+
enabled: B = !0,
|
|
66
|
+
ready: dt = !1,
|
|
67
|
+
publicIconify: K = !0,
|
|
68
|
+
skipConfigCall: X = !1,
|
|
69
|
+
customIconify: R,
|
|
70
|
+
debugLogging: x = !0
|
|
71
|
+
}) => {
|
|
72
|
+
var nt, it, rt, ot, ct;
|
|
73
|
+
const I = At(), e = Pt(bt), [Y, pt] = H(null), w = G(
|
|
74
|
+
() => {
|
|
75
|
+
var t, i;
|
|
76
|
+
return Y ?? n ?? ((i = (t = I.config) == null ? void 0 : t.c12nDef) == null ? void 0 : i.RESTRICTED);
|
|
77
|
+
},
|
|
78
|
+
[n, (it = (nt = I.config) == null ? void 0 : nt.c12nDef) == null ? void 0 : it.RESTRICTED, Y]
|
|
79
|
+
), Z = $(
|
|
80
|
+
(t) => {
|
|
81
|
+
var i;
|
|
82
|
+
return pt(t((i = I.config) == null ? void 0 : i.c12nDef));
|
|
83
|
+
},
|
|
84
|
+
[(rt = I.config) == null ? void 0 : rt.c12nDef]
|
|
85
|
+
), [C, mt] = H(dt), j = Mt(0), [D, yt] = H([]), { availableSources: P, typesDetection: V, supportedTypes: z } = Et(
|
|
86
|
+
B && C,
|
|
87
|
+
p,
|
|
88
|
+
x,
|
|
89
|
+
l,
|
|
90
|
+
y
|
|
91
|
+
);
|
|
92
|
+
b(() => {
|
|
93
|
+
if (X || !B || !C)
|
|
94
|
+
return;
|
|
95
|
+
const t = {}, i = l == null ? void 0 : l();
|
|
96
|
+
i && (t.Authorization = `Bearer ${i}`);
|
|
97
|
+
let u = { baseURL: p, headers: t };
|
|
98
|
+
y && (u = y(u)), It.configs.get(u).then(I.setConfig);
|
|
99
|
+
}, [p, y, X, C]);
|
|
100
|
+
const [N, T] = H(R);
|
|
101
|
+
b(() => {
|
|
102
|
+
R && T(R);
|
|
103
|
+
}, [R]), b(() => {
|
|
104
|
+
if (K)
|
|
105
|
+
return;
|
|
106
|
+
let t = N ?? void 0 ?? (p == null ? void 0 : p.replace(/^[^.]+/, "icons"));
|
|
107
|
+
!t && typeof window < "u" && window && !window.location.origin.includes("localhost") && (t = window.location.protocol + "//" + window.location.origin.replace(/^[^.]+/, "icons")), t && (_(`Using ${t} for iconify`, x), Dt("", {
|
|
108
|
+
resources: [t]
|
|
109
|
+
}));
|
|
110
|
+
}, [p, N, x, K]);
|
|
111
|
+
const U = $(
|
|
112
|
+
async (t) => {
|
|
113
|
+
const i = [];
|
|
114
|
+
for (const c of t) {
|
|
115
|
+
const { latency: o, source: f, type: r, value: h, items: a, error: m } = c;
|
|
116
|
+
m && i.push({
|
|
117
|
+
id: g(),
|
|
118
|
+
source: f,
|
|
119
|
+
type: r,
|
|
120
|
+
value: h,
|
|
121
|
+
annotations: [],
|
|
122
|
+
classification: w,
|
|
123
|
+
latency: o,
|
|
124
|
+
count: 0,
|
|
125
|
+
error: m
|
|
126
|
+
});
|
|
127
|
+
for (const E of a) {
|
|
128
|
+
const { classification: M, count: q, link: F, annotations: wt } = E;
|
|
129
|
+
await e.selectors.find({ selector: { type: r, value: h, source: f, classification: M } }).incrementalRemove();
|
|
130
|
+
const S = {
|
|
131
|
+
id: g(),
|
|
132
|
+
source: f,
|
|
133
|
+
type: r,
|
|
134
|
+
value: h,
|
|
135
|
+
annotations: wt,
|
|
136
|
+
classification: M,
|
|
137
|
+
latency: o,
|
|
138
|
+
count: q,
|
|
139
|
+
link: F,
|
|
140
|
+
error: m
|
|
141
|
+
};
|
|
142
|
+
i.some((vt) => vt.id === S.id) && (S.id = g()), i.push(S);
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
const u = await e.selectors.bulkInsert(i);
|
|
146
|
+
u.error.length > 0 && (console.warn("Errors on upsert:"), u.error.forEach((c) => console.warn(c.documentId, c.validationErrors ?? c.status)));
|
|
147
|
+
},
|
|
148
|
+
[e, w]
|
|
149
|
+
), L = $(
|
|
150
|
+
async (t, i, u = {}) => {
|
|
151
|
+
var E, M;
|
|
152
|
+
if (!t || !i)
|
|
153
|
+
return console.error(`Type (${t}) or value (${i}) is empty, returning empty response`), {};
|
|
154
|
+
const c = (v == null ? void 0 : v(D, P, [{ type: t, value: i, classification: u.classification }])) ?? D, o = {
|
|
155
|
+
timeout: A,
|
|
156
|
+
force: !1,
|
|
157
|
+
includeRaw: !1,
|
|
158
|
+
noCache: !1,
|
|
159
|
+
classification: w,
|
|
160
|
+
sources: c,
|
|
161
|
+
...u
|
|
162
|
+
}, f = {}, r = l == null ? void 0 : l();
|
|
163
|
+
r && (f.Authorization = `Bearer ${r}`);
|
|
164
|
+
let h = { baseURL: p, headers: f };
|
|
165
|
+
y && (h = y(h));
|
|
166
|
+
const a = {
|
|
167
|
+
type: t,
|
|
168
|
+
value: i,
|
|
169
|
+
classification: o.classification
|
|
170
|
+
};
|
|
171
|
+
let m = await ((E = e.status) == null ? void 0 : E.findOne({ selector: { ...a } }).exec());
|
|
172
|
+
m ? await m.incrementalPatch({ status: "in-progress" }) : m = await ((M = e.status) == null ? void 0 : M.insert({
|
|
173
|
+
id: g(),
|
|
174
|
+
type: a.type,
|
|
175
|
+
value: a.value,
|
|
176
|
+
classification: a.classification ?? w,
|
|
177
|
+
status: "in-progress"
|
|
178
|
+
}));
|
|
179
|
+
try {
|
|
180
|
+
const q = await at([a], o.sources, o, h), F = Object.values(Object.values(q)[0])[0];
|
|
181
|
+
return await U(Object.values(F)), F;
|
|
182
|
+
} catch (q) {
|
|
183
|
+
return console.error(q), {};
|
|
184
|
+
} finally {
|
|
185
|
+
await (m == null ? void 0 : m.incrementalPatch({ status: "complete" }));
|
|
186
|
+
}
|
|
187
|
+
},
|
|
188
|
+
[
|
|
189
|
+
U,
|
|
190
|
+
P,
|
|
191
|
+
p,
|
|
192
|
+
e,
|
|
193
|
+
w,
|
|
194
|
+
A,
|
|
195
|
+
l,
|
|
196
|
+
y,
|
|
197
|
+
v,
|
|
198
|
+
D
|
|
199
|
+
]
|
|
200
|
+
), W = $(
|
|
201
|
+
async (t, i) => {
|
|
202
|
+
const u = (v == null ? void 0 : v(D, P, t)) ?? D, c = {
|
|
203
|
+
timeout: A,
|
|
204
|
+
includeRaw: !1,
|
|
205
|
+
noCache: !1,
|
|
206
|
+
classification: w,
|
|
207
|
+
sources: u,
|
|
208
|
+
...i
|
|
209
|
+
}, o = {}, f = l == null ? void 0 : l();
|
|
210
|
+
f && (o.Authorization = `Bearer ${f}`);
|
|
211
|
+
let r = { baseURL: p, headers: o };
|
|
212
|
+
y && (r = y(r));
|
|
213
|
+
const h = [];
|
|
214
|
+
for (const a of t) {
|
|
215
|
+
const m = { type: a.type, value: a.value, classification: c.classification };
|
|
216
|
+
let E = await e.status.findOne({
|
|
217
|
+
selector: m
|
|
218
|
+
}).incrementalPatch({
|
|
219
|
+
status: "in-progress"
|
|
220
|
+
});
|
|
221
|
+
E || (E = await e.status.insert({
|
|
222
|
+
id: g(),
|
|
223
|
+
...m,
|
|
224
|
+
status: "in-progress",
|
|
225
|
+
sources: c.sources
|
|
226
|
+
})), h.push(E.toMutableJSON());
|
|
227
|
+
}
|
|
228
|
+
try {
|
|
229
|
+
const a = await at(t, c.sources, c, r), m = Object.values(a).flatMap(Object.values).flatMap(Object.values);
|
|
230
|
+
return await U(m), a;
|
|
231
|
+
} catch (a) {
|
|
232
|
+
return console.error(a), {};
|
|
233
|
+
} finally {
|
|
234
|
+
e.status.bulkUpsert(
|
|
235
|
+
Wt(h, (a) => a.id).map((a) => (a.status = "complete", a))
|
|
236
|
+
);
|
|
237
|
+
}
|
|
238
|
+
},
|
|
239
|
+
[
|
|
240
|
+
v,
|
|
241
|
+
D,
|
|
242
|
+
P,
|
|
243
|
+
A,
|
|
244
|
+
w,
|
|
245
|
+
l,
|
|
246
|
+
p,
|
|
247
|
+
y,
|
|
248
|
+
e,
|
|
249
|
+
U
|
|
250
|
+
]
|
|
251
|
+
), k = $(async () => {
|
|
252
|
+
if (!(e != null && e.selectors) || e.selectors.closed)
|
|
253
|
+
return;
|
|
254
|
+
const t = await e.selectors.find({ selector: { error: { $exists: !0 } } }).exec(), i = lt(t, "classification"), u = [];
|
|
255
|
+
for (const [c, o] of Object.entries(i)) {
|
|
256
|
+
const f = lt(o, (r) => `${r.type}:${r.value}`);
|
|
257
|
+
Object.values(f).forEach((r) => {
|
|
258
|
+
u.push({
|
|
259
|
+
id: g(),
|
|
260
|
+
type: r[0].type,
|
|
261
|
+
value: r[0].value,
|
|
262
|
+
classification: c,
|
|
263
|
+
sources: ut(r.map((h) => h.source)).sort(),
|
|
264
|
+
status: "pending"
|
|
265
|
+
});
|
|
266
|
+
});
|
|
267
|
+
}
|
|
268
|
+
await e.status.bulkInsert(u), await e.selectors.bulkRemove(t);
|
|
269
|
+
}, [e]), tt = G(
|
|
270
|
+
() => gt(
|
|
271
|
+
async () => {
|
|
272
|
+
if (e != null && e.status) {
|
|
273
|
+
if (e.status.closed) {
|
|
274
|
+
console.warn("Status database is closed, will not enrich");
|
|
275
|
+
return;
|
|
276
|
+
}
|
|
277
|
+
} else return;
|
|
278
|
+
const t = await e.status.find({ selector: { status: "pending" } }).update({ $set: { status: "in-progress" } });
|
|
279
|
+
if (t.length < 1)
|
|
280
|
+
return;
|
|
281
|
+
const i = Ut(t, O);
|
|
282
|
+
_(
|
|
283
|
+
`Enriching ${t.length} selectors in ${i.length} chunks of ${O}.`,
|
|
284
|
+
x
|
|
285
|
+
), await Promise.all(
|
|
286
|
+
// For performance reasons, we chunk the requests. This will allow us to take advantage of parellelization in the
|
|
287
|
+
// backend, both on the pod level and kubernetes level
|
|
288
|
+
i.map(async (u) => {
|
|
289
|
+
let c = null;
|
|
290
|
+
if (j.current <= Q)
|
|
291
|
+
j.current += 1;
|
|
292
|
+
else {
|
|
293
|
+
let o = Date.now();
|
|
294
|
+
await new Promise((f) => {
|
|
295
|
+
c = setInterval(() => {
|
|
296
|
+
_(
|
|
297
|
+
`Waiting on ${j.current} existing requests to complete (total delay: ${Date.now() - o}ms)`,
|
|
298
|
+
x
|
|
299
|
+
), j.current < Q && f();
|
|
300
|
+
}, 400);
|
|
301
|
+
}).finally(() => {
|
|
302
|
+
j.current += 1, clearInterval(c);
|
|
303
|
+
});
|
|
304
|
+
}
|
|
305
|
+
try {
|
|
306
|
+
const o = {}, f = ut(u.flatMap((r) => r.sources ?? []));
|
|
307
|
+
f.length > 0 && (o.sources = f), await W(
|
|
308
|
+
u.map((r) => r.toSelector()),
|
|
309
|
+
o
|
|
310
|
+
), await e.status.findByIds(u.map((r) => r.id)).update({ $set: { status: "complete" } });
|
|
311
|
+
} catch (o) {
|
|
312
|
+
console.error(o);
|
|
313
|
+
} finally {
|
|
314
|
+
j.current -= 1, c && clearInterval(c);
|
|
315
|
+
}
|
|
316
|
+
})
|
|
317
|
+
);
|
|
318
|
+
},
|
|
319
|
+
200,
|
|
320
|
+
{ maxWait: 500, leading: !1 }
|
|
321
|
+
),
|
|
322
|
+
[W, O, e, x, Q]
|
|
323
|
+
);
|
|
324
|
+
b(() => {
|
|
325
|
+
}, [e, x]), b(() => {
|
|
326
|
+
if (!B || !C || !(e != null && e.status))
|
|
327
|
+
return;
|
|
328
|
+
if (e != null && e.status.closed) {
|
|
329
|
+
console.warn("Status collection is closed");
|
|
330
|
+
return;
|
|
331
|
+
}
|
|
332
|
+
const t = e.status.find({
|
|
333
|
+
selector: {
|
|
334
|
+
status: "pending"
|
|
335
|
+
}
|
|
336
|
+
}).$.subscribe(() => tt());
|
|
337
|
+
return () => {
|
|
338
|
+
try {
|
|
339
|
+
t == null || t.unsubscribe();
|
|
340
|
+
} catch (i) {
|
|
341
|
+
console.warn(i);
|
|
342
|
+
}
|
|
343
|
+
};
|
|
344
|
+
}, [B, C, e, x, tt, (ot = e == null ? void 0 : e.status) == null ? void 0 : ot.closed]);
|
|
345
|
+
const et = $(
|
|
346
|
+
async (t, i, u) => {
|
|
347
|
+
if (!t)
|
|
348
|
+
throw new Error("Type cannot be null");
|
|
349
|
+
if (!i)
|
|
350
|
+
throw new Error("Value cannot be null");
|
|
351
|
+
const c = { type: t, value: i, classification: u ?? w };
|
|
352
|
+
let o = await e.status.findOne({
|
|
353
|
+
selector: c
|
|
354
|
+
}).exec();
|
|
355
|
+
return o || (o = await e.status.queueInsert({
|
|
356
|
+
id: g(),
|
|
357
|
+
...c,
|
|
358
|
+
status: "pending"
|
|
359
|
+
})), o;
|
|
360
|
+
},
|
|
361
|
+
[w, e]
|
|
362
|
+
), st = $(
|
|
363
|
+
(t) => {
|
|
364
|
+
var f, r;
|
|
365
|
+
if (!t)
|
|
366
|
+
return null;
|
|
367
|
+
const i = Object.entries(V), u = (f = i.find(([h, a]) => a.exec(t))) == null ? void 0 : f[0];
|
|
368
|
+
if (u)
|
|
369
|
+
return u;
|
|
370
|
+
const c = t.toLowerCase(), o = (r = i.find(([h, a]) => a.exec(c))) == null ? void 0 : r[0];
|
|
371
|
+
return o || null;
|
|
372
|
+
},
|
|
373
|
+
[V]
|
|
374
|
+
), ht = G(
|
|
375
|
+
() => {
|
|
376
|
+
var t;
|
|
377
|
+
return {
|
|
378
|
+
bulkEnrich: W,
|
|
379
|
+
enrich: L,
|
|
380
|
+
enrichFailedEnrichments: k,
|
|
381
|
+
sources: D,
|
|
382
|
+
setSources: yt,
|
|
383
|
+
typesDetection: V,
|
|
384
|
+
supportedTypes: z,
|
|
385
|
+
availableSources: P,
|
|
386
|
+
guessType: st,
|
|
387
|
+
queueEnrich: et,
|
|
388
|
+
setCustomIconify: T,
|
|
389
|
+
setDefaultClassification: Z,
|
|
390
|
+
setReady: mt,
|
|
391
|
+
defaultClassification: w,
|
|
392
|
+
ready: C && !!e && !!((t = I.config) != null && t.c12nDef)
|
|
393
|
+
};
|
|
394
|
+
},
|
|
395
|
+
[
|
|
396
|
+
W,
|
|
397
|
+
L,
|
|
398
|
+
k,
|
|
399
|
+
D,
|
|
400
|
+
V,
|
|
401
|
+
z,
|
|
402
|
+
P,
|
|
403
|
+
st,
|
|
404
|
+
et,
|
|
405
|
+
Z,
|
|
406
|
+
w,
|
|
407
|
+
C,
|
|
408
|
+
e,
|
|
409
|
+
(ct = I.config) == null ? void 0 : ct.c12nDef
|
|
410
|
+
]
|
|
411
|
+
);
|
|
412
|
+
return /* @__PURE__ */ xt(St.Provider, { value: ht, children: s });
|
|
413
|
+
};
|
|
414
|
+
export {
|
|
415
|
+
St as C,
|
|
416
|
+
ne as a,
|
|
417
|
+
Wt as u
|
|
418
|
+
};
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
import { b as d, r as _ } from "./isObjectLike-BatpeCIi.js";
|
|
2
|
+
import { i as l } from "./isObject-B53jY8Qg.js";
|
|
3
|
+
var ht = Array.isArray, 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 r = I(t, e);
|
|
45
|
+
return F(r) ? r : 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 A() {
|
|
52
|
+
this.__data__ = i ? i(null) : {}, this.size = 0;
|
|
53
|
+
}
|
|
54
|
+
function E(t) {
|
|
55
|
+
var e = this.has(t) && delete this.__data__[t];
|
|
56
|
+
return this.size -= e ? 1 : 0, e;
|
|
57
|
+
}
|
|
58
|
+
var N = "__lodash_hash_undefined__", M = Object.prototype, G = M.hasOwnProperty;
|
|
59
|
+
function R(t) {
|
|
60
|
+
var e = this.__data__;
|
|
61
|
+
if (i) {
|
|
62
|
+
var r = e[t];
|
|
63
|
+
return r === N ? void 0 : r;
|
|
64
|
+
}
|
|
65
|
+
return G.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 r = this.__data__;
|
|
75
|
+
return this.size += this.has(t) ? 0 : 1, r[t] = i && e === void 0 ? q : e, this;
|
|
76
|
+
}
|
|
77
|
+
function n(t) {
|
|
78
|
+
var e = -1, r = t == null ? 0 : t.length;
|
|
79
|
+
for (this.clear(); ++e < r; ) {
|
|
80
|
+
var a = t[e];
|
|
81
|
+
this.set(a[0], a[1]);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
n.prototype.clear = A;
|
|
85
|
+
n.prototype.delete = E;
|
|
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 r = t.length; r--; )
|
|
94
|
+
if (T(t[r][0], e))
|
|
95
|
+
return r;
|
|
96
|
+
return -1;
|
|
97
|
+
}
|
|
98
|
+
var B = Array.prototype, Q = B.splice;
|
|
99
|
+
function W(t) {
|
|
100
|
+
var e = this.__data__, r = h(e, t);
|
|
101
|
+
if (r < 0)
|
|
102
|
+
return !1;
|
|
103
|
+
var a = e.length - 1;
|
|
104
|
+
return r == a ? e.pop() : Q.call(e, r, 1), --this.size, !0;
|
|
105
|
+
}
|
|
106
|
+
function X(t) {
|
|
107
|
+
var e = this.__data__, r = h(e, t);
|
|
108
|
+
return r < 0 ? void 0 : e[r][1];
|
|
109
|
+
}
|
|
110
|
+
function Y(t) {
|
|
111
|
+
return h(this.__data__, t) > -1;
|
|
112
|
+
}
|
|
113
|
+
function Z(t, e) {
|
|
114
|
+
var r = this.__data__, a = h(r, t);
|
|
115
|
+
return a < 0 ? (++this.size, r.push([t, e])) : r[a][1] = e, this;
|
|
116
|
+
}
|
|
117
|
+
function o(t) {
|
|
118
|
+
var e = -1, r = t == null ? 0 : t.length;
|
|
119
|
+
for (this.clear(); ++e < r; ) {
|
|
120
|
+
var a = t[e];
|
|
121
|
+
this.set(a[0], a[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 r = t.__data__;
|
|
143
|
+
return et(e) ? r[typeof e == "string" ? "string" : "hash"] : r.map;
|
|
144
|
+
}
|
|
145
|
+
function rt(t) {
|
|
146
|
+
var e = c(this, t).delete(t);
|
|
147
|
+
return this.size -= e ? 1 : 0, e;
|
|
148
|
+
}
|
|
149
|
+
function at(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 r = c(this, t), a = r.size;
|
|
157
|
+
return r.set(t, e), this.size += r.size == a ? 0 : 1, this;
|
|
158
|
+
}
|
|
159
|
+
function s(t) {
|
|
160
|
+
var e = -1, r = t == null ? 0 : t.length;
|
|
161
|
+
for (this.clear(); ++e < r; ) {
|
|
162
|
+
var a = t[e];
|
|
163
|
+
this.set(a[0], a[1]);
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
s.prototype.clear = tt;
|
|
167
|
+
s.prototype.delete = rt;
|
|
168
|
+
s.prototype.get = at;
|
|
169
|
+
s.prototype.has = nt;
|
|
170
|
+
s.prototype.set = ot;
|
|
171
|
+
export {
|
|
172
|
+
o as L,
|
|
173
|
+
s as M,
|
|
174
|
+
k as a,
|
|
175
|
+
C as b,
|
|
176
|
+
T as e,
|
|
177
|
+
f as g,
|
|
178
|
+
ht as i,
|
|
179
|
+
w as t
|
|
180
|
+
};
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { i as p, L as _, a as l, M as d } from "./_MapCache-BiTi0iqu.js";
|
|
2
|
+
import { d as y, a as A, c as g, i as m, f as b } from "./_getTag-CK2Sffaq.js";
|
|
3
|
+
import { r as v } from "./isObjectLike-BatpeCIi.js";
|
|
4
|
+
var w = 9007199254740991, z = /^(?:0|[1-9]\d*)$/;
|
|
5
|
+
function S(t, e) {
|
|
6
|
+
var r = typeof t;
|
|
7
|
+
return e = e ?? w, !!e && (r == "number" || r != "symbol" && z.test(t)) && t > -1 && t % 1 == 0 && t < e;
|
|
8
|
+
}
|
|
9
|
+
function I(t, e) {
|
|
10
|
+
for (var r = -1, s = Array(t); ++r < t; )
|
|
11
|
+
s[r] = e(r);
|
|
12
|
+
return s;
|
|
13
|
+
}
|
|
14
|
+
var O = Object.prototype, x = O.hasOwnProperty;
|
|
15
|
+
function E(t, e) {
|
|
16
|
+
var r = p(t), s = !r && y(t), a = !r && !s && A(t), i = !r && !s && !a && g(t), o = r || s || a || i, u = o ? I(t.length, String) : [], c = u.length;
|
|
17
|
+
for (var n in t)
|
|
18
|
+
(e || x.call(t, n)) && !(o && // Safari 9 has enumerable `arguments.length` in strict mode.
|
|
19
|
+
(n == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
|
|
20
|
+
a && (n == "offset" || n == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
|
|
21
|
+
i && (n == "buffer" || n == "byteLength" || n == "byteOffset") || // Skip index properties.
|
|
22
|
+
S(n, c))) && u.push(n);
|
|
23
|
+
return u;
|
|
24
|
+
}
|
|
25
|
+
function L(t) {
|
|
26
|
+
return m(t) ? E(t) : b(t);
|
|
27
|
+
}
|
|
28
|
+
function P(t, e) {
|
|
29
|
+
for (var r = -1, s = e.length, a = t.length; ++r < s; )
|
|
30
|
+
t[a + r] = e[r];
|
|
31
|
+
return t;
|
|
32
|
+
}
|
|
33
|
+
function G() {
|
|
34
|
+
this.__data__ = new _(), this.size = 0;
|
|
35
|
+
}
|
|
36
|
+
function K(t) {
|
|
37
|
+
var e = this.__data__, r = e.delete(t);
|
|
38
|
+
return this.size = e.size, r;
|
|
39
|
+
}
|
|
40
|
+
function M(t) {
|
|
41
|
+
return this.__data__.get(t);
|
|
42
|
+
}
|
|
43
|
+
function R(t) {
|
|
44
|
+
return this.__data__.has(t);
|
|
45
|
+
}
|
|
46
|
+
var T = 200;
|
|
47
|
+
function U(t, e) {
|
|
48
|
+
var r = this.__data__;
|
|
49
|
+
if (r instanceof _) {
|
|
50
|
+
var s = r.__data__;
|
|
51
|
+
if (!l || s.length < T - 1)
|
|
52
|
+
return s.push([t, e]), this.size = ++r.size, this;
|
|
53
|
+
r = this.__data__ = new d(s);
|
|
54
|
+
}
|
|
55
|
+
return r.set(t, e), this.size = r.size, this;
|
|
56
|
+
}
|
|
57
|
+
function f(t) {
|
|
58
|
+
var e = this.__data__ = new _(t);
|
|
59
|
+
this.size = e.size;
|
|
60
|
+
}
|
|
61
|
+
f.prototype.clear = G;
|
|
62
|
+
f.prototype.delete = K;
|
|
63
|
+
f.prototype.get = M;
|
|
64
|
+
f.prototype.has = R;
|
|
65
|
+
f.prototype.set = U;
|
|
66
|
+
function C(t, e) {
|
|
67
|
+
for (var r = -1, s = t == null ? 0 : t.length, a = 0, i = []; ++r < s; ) {
|
|
68
|
+
var o = t[r];
|
|
69
|
+
e(o, r, t) && (i[a++] = o);
|
|
70
|
+
}
|
|
71
|
+
return i;
|
|
72
|
+
}
|
|
73
|
+
function k() {
|
|
74
|
+
return [];
|
|
75
|
+
}
|
|
76
|
+
var B = Object.prototype, F = B.propertyIsEnumerable, h = Object.getOwnPropertySymbols, $ = h ? function(t) {
|
|
77
|
+
return t == null ? [] : (t = Object(t), C(h(t), function(e) {
|
|
78
|
+
return F.call(t, e);
|
|
79
|
+
}));
|
|
80
|
+
} : k;
|
|
81
|
+
function D(t, e, r) {
|
|
82
|
+
var s = e(t);
|
|
83
|
+
return p(t) ? s : P(s, r(t));
|
|
84
|
+
}
|
|
85
|
+
function Y(t) {
|
|
86
|
+
return D(t, L, $);
|
|
87
|
+
}
|
|
88
|
+
var Z = v.Uint8Array;
|
|
89
|
+
export {
|
|
90
|
+
f as S,
|
|
91
|
+
Z as U,
|
|
92
|
+
P as a,
|
|
93
|
+
C as b,
|
|
94
|
+
E as c,
|
|
95
|
+
$ as d,
|
|
96
|
+
D as e,
|
|
97
|
+
Y as g,
|
|
98
|
+
S as i,
|
|
99
|
+
L as k,
|
|
100
|
+
k as s
|
|
101
|
+
};
|