@cccsaurora/clue-ui 1.1.4 → 1.1.6
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-myEAs2UC.js → ActionForm-CW8ZBIh8.js} +4 -4
- package/{AnnotationDetails-D9AJM0An.js → AnnotationDetails-BuzcQyAM.js} +2 -2
- package/{AnnotationPreview-Lb5be8ZG.js → AnnotationPreview-BUNr3hF2.js} +2 -2
- package/{ClueEnrichContext-DsFsXixD.js → ClueEnrichContext-CCZCMklu.js} +155 -157
- package/_MapCache-BiTi0iqu.js +180 -0
- package/{_Uint8Array-DlJCtTvG.js → _Uint8Array-_reI1Oam.js} +17 -18
- package/{_baseAssignValue-CUmzp727.js → _baseAssignValue-CNMLQZco.js} +1 -1
- package/{_baseClone-BlMmRXeX.js → _baseClone-Bp6f2Ljb.js} +54 -55
- package/{_baseExtremum-P_0akmCi.js → _baseExtremum-C9G1qBqT.js} +3 -3
- package/{_baseFlatten-CN7vDNEQ.js → _baseFlatten-eJWQqONl.js} +4 -4
- package/{_baseGet-Dgf6_xCm.js → _baseGet-DSZygzyq.js} +3 -4
- package/_baseIsEqual-Cz32k778.js +147 -0
- package/{_baseIteratee-CP1bocOX.js → _baseIteratee-CKlS0yRG.js} +12 -12
- package/_baseUniq-CGlHphLr.js +79 -0
- package/{_createAggregator-B4Cav8ZM.js → _createAggregator-BaD8jK99.js} +4 -4
- package/{_getPrototype-CHAFQYL_.js → _getPrototype-Dm06JiGv.js} +1 -1
- package/{_getTag-BV_UoLYG.js → _getTag-Cfxlub3L.js} +9 -9
- package/_setToArray-C7yMOeww.js +29 -0
- package/{cloneDeep-BPVpFBzJ.js → cloneDeep-Bky1GFdq.js} +1 -1
- package/components/AnnotationDetailPopover.js +1 -1
- package/components/AnnotationDetails.js +3 -3
- package/components/AnnotationEntry.js +1 -1
- package/components/AnnotationPreview.js +2 -2
- package/components/EnrichedCard.js +1 -1
- package/components/EnrichedChip.js +1 -1
- package/components/EnrichedTypography.js +1 -1
- package/components/actions/ActionForm.js +3 -3
- package/components/actions/ResultModal.js +2 -2
- package/components/actions/form/schemaAdapter.js +2 -2
- package/components/display/graph/elements/NodeCard.js +5 -5
- package/components/display/graph/index.js +2 -2
- package/components/display/graph/visualizations/cloud/index.js +2 -2
- package/components/display/graph/visualizations/tree/index.js +3 -3
- package/components/display/json/index.js +2 -2
- package/components/enrichment/EnrichPopover.js +1 -1
- package/components/fetchers/Fetcher.js +1 -1
- package/components/group/Entry.js +1 -1
- package/components/group/GroupControl.js +1 -1
- package/{countBy-DOutsa_w.js → countBy-isCNN_rn.js} +2 -2
- package/{get-Bow1vKwx.js → get-CH7kz5Ix.js} +1 -1
- package/{groupBy-BheQYl6f.js → groupBy-IWYxSFLq.js} +2 -2
- package/hooks/ClueActionContext.js +2 -2
- package/hooks/ClueEnrichContext.js +3 -3
- package/hooks/ClueEnrichContextType.d.ts +5 -0
- package/hooks/ClueFetcherContext.js +1 -1
- package/hooks/CluePopupContext.js +2 -2
- package/hooks/ClueProvider.js +3 -3
- package/hooks/selectors.js +2 -2
- package/hooks/useActionResult.js +1 -1
- package/hooks/useAnnotations.js +6 -6
- package/hooks/useClue.js +1 -1
- package/hooks/useClueActions.js +1 -1
- package/hooks/useClueTypeConfig.d.ts +1 -0
- package/hooks/useClueTypeConfig.js +2 -2
- package/hooks/useComparator.js +1 -1
- package/icons/Action.js +3 -3
- package/icons/Assessment.js +4 -4
- package/icons/Context.js +2 -2
- package/icons/Opinion.js +4 -4
- package/{index-C15OYgRY.js → index-DtRkeZWt.js} +1 -1
- package/main.js +4 -4
- package/package.json +1 -1
- package/{sortBy-ITdmD17L.js → sortBy-CyX-4NSN.js} +7 -7
- package/{sumBy-DxJUU2E8.js → sumBy-Bn_6t8o-.js} +1 -1
- package/text/Frequency.js +1 -1
- package/{useClueTypeConfig-DyeBcXQX.js → useClueTypeConfig-D1DlRG7e.js} +516 -511
- package/utils/chain.js +11 -11
- package/utils/utils.js +3 -3
- package/{utils-BnmI_6N8.js → utils-C8TeL4oX.js} +25 -26
- package/_Map-DXNg_Z-q.js +0 -54
- package/_MapCache-Cu25RRDU.js +0 -129
- package/_baseIsEqual-Cpjtfb3Q.js +0 -173
- package/_baseUniq-tMFmk80M.js +0 -61
- package/isEmpty-g47Qir2A.js +0 -21
|
@@ -3,13 +3,13 @@ import { materialRenderers as Je, materialCells as Oe } from "@jsonforms/materia
|
|
|
3
3
|
import { JsonForms as Pe } from "@jsonforms/react";
|
|
4
4
|
import { Modal as ne, Paper as ae, Stack as n, Typography as b, Divider as Z, LinearProgress as ze, Button as P, IconButton as He, Box as O, CircularProgress as Ve, Collapse as qe } from "@mui/material";
|
|
5
5
|
import ue from "./components/display/icons/Iconified.js";
|
|
6
|
-
import { J as Y } from "./index-
|
|
6
|
+
import { J as Y } from "./index-DtRkeZWt.js";
|
|
7
7
|
import { ClueComponentContext as W } from "./hooks/ClueComponentContext.js";
|
|
8
8
|
import { A as Be } from "./index-BXxfAxFt.js";
|
|
9
|
-
import { a as K } from "./useClueTypeConfig-
|
|
10
|
-
import { d as he } from "./_baseGet-
|
|
9
|
+
import { a as K } from "./useClueTypeConfig-D1DlRG7e.js";
|
|
10
|
+
import { d as he } from "./_baseGet-DSZygzyq.js";
|
|
11
11
|
import { b as Ne } from "./_baseSlice-M5RKzt1A.js";
|
|
12
|
-
import { i as Te } from "./utils-
|
|
12
|
+
import { i as Te } from "./utils-C8TeL4oX.js";
|
|
13
13
|
import { useState as w, useRef as Le, useMemo as S, useEffect as Q, memo as xe, useCallback as E } from "react";
|
|
14
14
|
import { u as A, c as Ue, a as Ge } from "./index-E7g8cRyW.js";
|
|
15
15
|
import z from "./components/ErrorBoundary.js";
|
|
@@ -9,8 +9,8 @@ import K from "./hooks/useAnnotations.js";
|
|
|
9
9
|
import L from "./hooks/useErrors.js";
|
|
10
10
|
import { ICON_MAP as T } from "./icons/iconMap.js";
|
|
11
11
|
import { safeDispatchEvent as U } from "./utils/window.js";
|
|
12
|
-
import { g as V } from "./groupBy-
|
|
13
|
-
import { u as W } from "./
|
|
12
|
+
import { g as V } from "./groupBy-IWYxSFLq.js";
|
|
13
|
+
import { u as W } from "./useClueTypeConfig-D1DlRG7e.js";
|
|
14
14
|
import { memo as G, useState as J, useMemo as k, useCallback as P, useEffect as Q } from "react";
|
|
15
15
|
import { u as X } from "./index-E7g8cRyW.js";
|
|
16
16
|
import Y from "./components/actions/ExecutePopover.js";
|
|
@@ -3,12 +3,12 @@ import { I as H } from "./iconify-BBckr5AQ.js";
|
|
|
3
3
|
import { useTheme as k, Popper as V, Fade as j, Paper as O, Stack as w, Typography as y, Divider as W } from "@mui/material";
|
|
4
4
|
import F from "./components/AnnotationDetailPopover.js";
|
|
5
5
|
import L from "./hooks/useAnnotations.js";
|
|
6
|
-
import { t as M } from "./utils-
|
|
6
|
+
import { t as M } from "./utils-C8TeL4oX.js";
|
|
7
7
|
import { useState as v, useRef as Y, useCallback as x, useEffect as Z, useMemo as _ } from "react";
|
|
8
8
|
import { c as B, u as G } from "./index-E7g8cRyW.js";
|
|
9
9
|
import { SHOW_EVENT_ID as g, HIDE_EVENT_ID as D } from "./data/event.js";
|
|
10
10
|
import { safeDispatchEvent as A, safeAddEventListener as S } from "./utils/window.js";
|
|
11
|
-
import { i as J } from "./AnnotationDetails-
|
|
11
|
+
import { i as J } from "./AnnotationDetails-BuzcQyAM.js";
|
|
12
12
|
const b = B(null), rt = ({ children: c }) => {
|
|
13
13
|
const [l, e] = v(null), [p, i] = v(null), [r, d] = v(null), [u, m] = v(null), [f, t] = v({}), a = Y(null), P = x((s, o, z, N) => {
|
|
14
14
|
A(
|
|
@@ -1,66 +1,63 @@
|
|
|
1
1
|
import { jsx as xt } from "react/jsx-runtime";
|
|
2
2
|
import { a as Dt } from "./iconify-BBckr5AQ.js";
|
|
3
|
-
import {
|
|
3
|
+
import { b as Et, a as It, p as at, u as ut } from "./useClueTypeConfig-D1DlRG7e.js";
|
|
4
4
|
import { clueDebugLogger as _ } from "./utils/loggerUtil.js";
|
|
5
5
|
import { b as Ct } from "./_baseSlice-M5RKzt1A.js";
|
|
6
|
-
import { t as
|
|
7
|
-
import { d as
|
|
8
|
-
import { g as
|
|
9
|
-
import { b as
|
|
10
|
-
import { b as
|
|
11
|
-
import { useContext as
|
|
12
|
-
import { c as
|
|
13
|
-
import { ClueDatabaseContext as
|
|
14
|
-
import
|
|
15
|
-
function
|
|
16
|
-
var n =
|
|
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-IWYxSFLq.js";
|
|
9
|
+
import { b as Ot } from "./_baseIteratee-CKlS0yRG.js";
|
|
10
|
+
import { b as jt } from "./_baseUniq-CGlHphLr.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-E7g8cRyW.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
17
|
return n === n ? p ? n - p : n : 0;
|
|
18
18
|
}
|
|
19
|
-
var
|
|
20
|
-
function
|
|
21
|
-
n === void 0 ? n = 1 : n =
|
|
22
|
-
var l =
|
|
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
23
|
if (!l || n < 1)
|
|
24
24
|
return [];
|
|
25
|
-
for (var
|
|
26
|
-
O[v++] = Ct(
|
|
25
|
+
for (var y = 0, v = 0, O = Array(Rt(l / n)); y < l; )
|
|
26
|
+
O[v++] = Ct(s, y, y += n);
|
|
27
27
|
return O;
|
|
28
28
|
}
|
|
29
|
-
function
|
|
30
|
-
return
|
|
31
|
-
}
|
|
32
|
-
function Ut(e, n) {
|
|
33
|
-
return e && e.length ? ft(e, Ot(n)) : [];
|
|
29
|
+
function Wt(s, n) {
|
|
30
|
+
return s && s.length ? jt(s, Ot(n)) : [];
|
|
34
31
|
}
|
|
35
32
|
let J;
|
|
36
|
-
const
|
|
37
|
-
function
|
|
33
|
+
const Ft = new Uint8Array(16);
|
|
34
|
+
function Ht() {
|
|
38
35
|
if (!J && (J = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto), !J))
|
|
39
36
|
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
40
|
-
return J(
|
|
37
|
+
return J(Ft);
|
|
41
38
|
}
|
|
42
39
|
const d = [];
|
|
43
|
-
for (let
|
|
44
|
-
d.push((
|
|
45
|
-
function
|
|
46
|
-
return 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]];
|
|
47
44
|
}
|
|
48
|
-
const
|
|
49
|
-
randomUUID:
|
|
45
|
+
const Qt = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), ft = {
|
|
46
|
+
randomUUID: Qt
|
|
50
47
|
};
|
|
51
|
-
function
|
|
52
|
-
if (
|
|
53
|
-
return
|
|
54
|
-
|
|
55
|
-
const l =
|
|
56
|
-
return l[6] = l[6] & 15 | 64, l[8] = l[8] & 63 | 128,
|
|
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);
|
|
57
54
|
}
|
|
58
|
-
const
|
|
59
|
-
children:
|
|
55
|
+
const St = qt(null), ne = ({
|
|
56
|
+
children: s,
|
|
60
57
|
classification: n,
|
|
61
58
|
baseURL: p,
|
|
62
59
|
getToken: l,
|
|
63
|
-
onNetworkCall:
|
|
60
|
+
onNetworkCall: y,
|
|
64
61
|
pickSources: v,
|
|
65
62
|
chunkSize: O = 15,
|
|
66
63
|
maxRequestCount: Q = 4,
|
|
@@ -72,25 +69,25 @@ const Qt = Mt(null), se = ({
|
|
|
72
69
|
customIconify: R,
|
|
73
70
|
debugLogging: x = !0
|
|
74
71
|
}) => {
|
|
75
|
-
var
|
|
76
|
-
const I =
|
|
72
|
+
var nt, it, rt, ot, ct;
|
|
73
|
+
const I = At(), e = Pt(bt), [Y, pt] = H(null), w = G(
|
|
77
74
|
() => {
|
|
78
75
|
var t, i;
|
|
79
76
|
return Y ?? n ?? ((i = (t = I.config) == null ? void 0 : t.c12nDef) == null ? void 0 : i.RESTRICTED);
|
|
80
77
|
},
|
|
81
|
-
[n, (
|
|
82
|
-
), Z =
|
|
78
|
+
[n, (it = (nt = I.config) == null ? void 0 : nt.c12nDef) == null ? void 0 : it.RESTRICTED, Y]
|
|
79
|
+
), Z = $(
|
|
83
80
|
(t) => {
|
|
84
81
|
var i;
|
|
85
82
|
return pt(t((i = I.config) == null ? void 0 : i.c12nDef));
|
|
86
83
|
},
|
|
87
|
-
[(
|
|
88
|
-
), [C, mt] = H(dt), j =
|
|
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(
|
|
89
86
|
B && C,
|
|
90
87
|
p,
|
|
91
88
|
x,
|
|
92
89
|
l,
|
|
93
|
-
|
|
90
|
+
y
|
|
94
91
|
);
|
|
95
92
|
b(() => {
|
|
96
93
|
if (X || !B || !C)
|
|
@@ -98,63 +95,63 @@ const Qt = Mt(null), se = ({
|
|
|
98
95
|
const t = {}, i = l == null ? void 0 : l();
|
|
99
96
|
i && (t.Authorization = `Bearer ${i}`);
|
|
100
97
|
let u = { baseURL: p, headers: t };
|
|
101
|
-
|
|
102
|
-
}, [p,
|
|
103
|
-
const [
|
|
98
|
+
y && (u = y(u)), It.configs.get(u).then(I.setConfig);
|
|
99
|
+
}, [p, y, X, C]);
|
|
100
|
+
const [N, T] = H(R);
|
|
104
101
|
b(() => {
|
|
105
|
-
R &&
|
|
102
|
+
R && T(R);
|
|
106
103
|
}, [R]), b(() => {
|
|
107
104
|
if (K)
|
|
108
105
|
return;
|
|
109
|
-
let t =
|
|
106
|
+
let t = N ?? void 0 ?? (p == null ? void 0 : p.replace(/^[^.]+/, "icons"));
|
|
110
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("", {
|
|
111
108
|
resources: [t]
|
|
112
109
|
}));
|
|
113
|
-
}, [p,
|
|
114
|
-
const U =
|
|
110
|
+
}, [p, N, x, K]);
|
|
111
|
+
const U = $(
|
|
115
112
|
async (t) => {
|
|
116
113
|
const i = [];
|
|
117
114
|
for (const c of t) {
|
|
118
|
-
const { latency:
|
|
115
|
+
const { latency: o, source: f, type: r, value: h, items: a, error: m } = c;
|
|
119
116
|
m && i.push({
|
|
120
|
-
id:
|
|
117
|
+
id: g(),
|
|
121
118
|
source: f,
|
|
122
|
-
type:
|
|
123
|
-
value:
|
|
119
|
+
type: r,
|
|
120
|
+
value: h,
|
|
124
121
|
annotations: [],
|
|
125
122
|
classification: w,
|
|
126
|
-
latency:
|
|
123
|
+
latency: o,
|
|
127
124
|
count: 0,
|
|
128
125
|
error: m
|
|
129
126
|
});
|
|
130
127
|
for (const E of a) {
|
|
131
128
|
const { classification: M, count: q, link: F, annotations: wt } = E;
|
|
132
|
-
await
|
|
129
|
+
await e.selectors.find({ selector: { type: r, value: h, source: f, classification: M } }).incrementalRemove();
|
|
133
130
|
const S = {
|
|
134
|
-
id:
|
|
131
|
+
id: g(),
|
|
135
132
|
source: f,
|
|
136
|
-
type:
|
|
137
|
-
value:
|
|
133
|
+
type: r,
|
|
134
|
+
value: h,
|
|
138
135
|
annotations: wt,
|
|
139
136
|
classification: M,
|
|
140
|
-
latency:
|
|
137
|
+
latency: o,
|
|
141
138
|
count: q,
|
|
142
139
|
link: F,
|
|
143
140
|
error: m
|
|
144
141
|
};
|
|
145
|
-
i.some((vt) => vt.id === S.id) && (S.id =
|
|
142
|
+
i.some((vt) => vt.id === S.id) && (S.id = g()), i.push(S);
|
|
146
143
|
}
|
|
147
144
|
}
|
|
148
|
-
const u = await
|
|
145
|
+
const u = await e.selectors.bulkInsert(i);
|
|
149
146
|
u.error.length > 0 && (console.warn("Errors on upsert:"), u.error.forEach((c) => console.warn(c.documentId, c.validationErrors ?? c.status)));
|
|
150
147
|
},
|
|
151
|
-
[
|
|
152
|
-
),
|
|
148
|
+
[e, w]
|
|
149
|
+
), L = $(
|
|
153
150
|
async (t, i, u = {}) => {
|
|
154
151
|
var E, M;
|
|
155
152
|
if (!t || !i)
|
|
156
153
|
return console.error(`Type (${t}) or value (${i}) is empty, returning empty response`), {};
|
|
157
|
-
const c = (v == null ? void 0 : v(D, P, [{ type: t, value: i, classification: u.classification }])) ?? D,
|
|
154
|
+
const c = (v == null ? void 0 : v(D, P, [{ type: t, value: i, classification: u.classification }])) ?? D, o = {
|
|
158
155
|
timeout: A,
|
|
159
156
|
force: !1,
|
|
160
157
|
includeRaw: !1,
|
|
@@ -162,25 +159,25 @@ const Qt = Mt(null), se = ({
|
|
|
162
159
|
classification: w,
|
|
163
160
|
sources: c,
|
|
164
161
|
...u
|
|
165
|
-
}, f = {},
|
|
166
|
-
|
|
167
|
-
let
|
|
168
|
-
|
|
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));
|
|
169
166
|
const a = {
|
|
170
167
|
type: t,
|
|
171
168
|
value: i,
|
|
172
|
-
classification:
|
|
169
|
+
classification: o.classification
|
|
173
170
|
};
|
|
174
|
-
let m = await ((E =
|
|
175
|
-
m ? await m.incrementalPatch({ status: "in-progress" }) : m = await ((M =
|
|
176
|
-
id:
|
|
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(),
|
|
177
174
|
type: a.type,
|
|
178
175
|
value: a.value,
|
|
179
176
|
classification: a.classification ?? w,
|
|
180
177
|
status: "in-progress"
|
|
181
178
|
}));
|
|
182
179
|
try {
|
|
183
|
-
const q = await
|
|
180
|
+
const q = await at([a], o.sources, o, h), F = Object.values(Object.values(q)[0])[0];
|
|
184
181
|
return await U(Object.values(F)), F;
|
|
185
182
|
} catch (q) {
|
|
186
183
|
return console.error(q), {};
|
|
@@ -192,15 +189,15 @@ const Qt = Mt(null), se = ({
|
|
|
192
189
|
U,
|
|
193
190
|
P,
|
|
194
191
|
p,
|
|
195
|
-
|
|
192
|
+
e,
|
|
196
193
|
w,
|
|
197
194
|
A,
|
|
198
195
|
l,
|
|
199
|
-
|
|
196
|
+
y,
|
|
200
197
|
v,
|
|
201
198
|
D
|
|
202
199
|
]
|
|
203
|
-
), W =
|
|
200
|
+
), W = $(
|
|
204
201
|
async (t, i) => {
|
|
205
202
|
const u = (v == null ? void 0 : v(D, P, t)) ?? D, c = {
|
|
206
203
|
timeout: A,
|
|
@@ -209,33 +206,33 @@ const Qt = Mt(null), se = ({
|
|
|
209
206
|
classification: w,
|
|
210
207
|
sources: u,
|
|
211
208
|
...i
|
|
212
|
-
},
|
|
213
|
-
f && (
|
|
214
|
-
let
|
|
215
|
-
|
|
216
|
-
const
|
|
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 = [];
|
|
217
214
|
for (const a of t) {
|
|
218
215
|
const m = { type: a.type, value: a.value, classification: c.classification };
|
|
219
|
-
let E = await
|
|
216
|
+
let E = await e.status.findOne({
|
|
220
217
|
selector: m
|
|
221
218
|
}).incrementalPatch({
|
|
222
219
|
status: "in-progress"
|
|
223
220
|
});
|
|
224
|
-
E || (E = await
|
|
225
|
-
id:
|
|
221
|
+
E || (E = await e.status.insert({
|
|
222
|
+
id: g(),
|
|
226
223
|
...m,
|
|
227
224
|
status: "in-progress",
|
|
228
225
|
sources: c.sources
|
|
229
|
-
})),
|
|
226
|
+
})), h.push(E.toMutableJSON());
|
|
230
227
|
}
|
|
231
228
|
try {
|
|
232
|
-
const a = await
|
|
229
|
+
const a = await at(t, c.sources, c, r), m = Object.values(a).flatMap(Object.values).flatMap(Object.values);
|
|
233
230
|
return await U(m), a;
|
|
234
231
|
} catch (a) {
|
|
235
232
|
return console.error(a), {};
|
|
236
233
|
} finally {
|
|
237
|
-
|
|
238
|
-
|
|
234
|
+
e.status.bulkUpsert(
|
|
235
|
+
Wt(h, (a) => a.id).map((a) => (a.status = "complete", a))
|
|
239
236
|
);
|
|
240
237
|
}
|
|
241
238
|
},
|
|
@@ -247,41 +244,41 @@ const Qt = Mt(null), se = ({
|
|
|
247
244
|
w,
|
|
248
245
|
l,
|
|
249
246
|
p,
|
|
250
|
-
|
|
251
|
-
|
|
247
|
+
y,
|
|
248
|
+
e,
|
|
252
249
|
U
|
|
253
250
|
]
|
|
254
|
-
),
|
|
255
|
-
if (!(
|
|
251
|
+
), k = $(async () => {
|
|
252
|
+
if (!(e != null && e.selectors) || e.selectors.closed)
|
|
256
253
|
return;
|
|
257
|
-
const t = await
|
|
258
|
-
for (const [c,
|
|
259
|
-
const f =
|
|
260
|
-
Object.values(f).forEach((
|
|
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) => {
|
|
261
258
|
u.push({
|
|
262
|
-
id:
|
|
263
|
-
type:
|
|
264
|
-
value:
|
|
259
|
+
id: g(),
|
|
260
|
+
type: r[0].type,
|
|
261
|
+
value: r[0].value,
|
|
265
262
|
classification: c,
|
|
266
|
-
sources: ut(
|
|
263
|
+
sources: ut(r.map((h) => h.source)).sort(),
|
|
267
264
|
status: "pending"
|
|
268
265
|
});
|
|
269
266
|
});
|
|
270
267
|
}
|
|
271
|
-
await
|
|
272
|
-
}, [
|
|
273
|
-
() =>
|
|
268
|
+
await e.status.bulkInsert(u), await e.selectors.bulkRemove(t);
|
|
269
|
+
}, [e]), tt = G(
|
|
270
|
+
() => gt(
|
|
274
271
|
async () => {
|
|
275
|
-
if (
|
|
276
|
-
if (
|
|
272
|
+
if (e != null && e.status) {
|
|
273
|
+
if (e.status.closed) {
|
|
277
274
|
console.warn("Status database is closed, will not enrich");
|
|
278
275
|
return;
|
|
279
276
|
}
|
|
280
277
|
} else return;
|
|
281
|
-
const t = await
|
|
278
|
+
const t = await e.status.find({ selector: { status: "pending" } }).update({ $set: { status: "in-progress" } });
|
|
282
279
|
if (t.length < 1)
|
|
283
280
|
return;
|
|
284
|
-
const i =
|
|
281
|
+
const i = Ut(t, O);
|
|
285
282
|
_(
|
|
286
283
|
`Enriching ${t.length} selectors in ${i.length} chunks of ${O}.`,
|
|
287
284
|
x
|
|
@@ -293,11 +290,11 @@ const Qt = Mt(null), se = ({
|
|
|
293
290
|
if (j.current <= Q)
|
|
294
291
|
j.current += 1;
|
|
295
292
|
else {
|
|
296
|
-
let
|
|
293
|
+
let o = Date.now();
|
|
297
294
|
await new Promise((f) => {
|
|
298
295
|
c = setInterval(() => {
|
|
299
296
|
_(
|
|
300
|
-
`Waiting on ${j.current} existing requests to complete (total delay: ${Date.now() -
|
|
297
|
+
`Waiting on ${j.current} existing requests to complete (total delay: ${Date.now() - o}ms)`,
|
|
301
298
|
x
|
|
302
299
|
), j.current < Q && f();
|
|
303
300
|
}, 400);
|
|
@@ -306,13 +303,13 @@ const Qt = Mt(null), se = ({
|
|
|
306
303
|
});
|
|
307
304
|
}
|
|
308
305
|
try {
|
|
309
|
-
const
|
|
310
|
-
f.length > 0 && (
|
|
311
|
-
u.map((
|
|
312
|
-
|
|
313
|
-
), await
|
|
314
|
-
} catch (
|
|
315
|
-
console.error(
|
|
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);
|
|
316
313
|
} finally {
|
|
317
314
|
j.current -= 1, c && clearInterval(c);
|
|
318
315
|
}
|
|
@@ -322,21 +319,21 @@ const Qt = Mt(null), se = ({
|
|
|
322
319
|
200,
|
|
323
320
|
{ maxWait: 500, leading: !1 }
|
|
324
321
|
),
|
|
325
|
-
[W, O,
|
|
322
|
+
[W, O, e, x, Q]
|
|
326
323
|
);
|
|
327
324
|
b(() => {
|
|
328
|
-
}, [
|
|
329
|
-
if (!B || !C || !(
|
|
325
|
+
}, [e, x]), b(() => {
|
|
326
|
+
if (!B || !C || !(e != null && e.status))
|
|
330
327
|
return;
|
|
331
|
-
if (
|
|
328
|
+
if (e != null && e.status.closed) {
|
|
332
329
|
console.warn("Status collection is closed");
|
|
333
330
|
return;
|
|
334
331
|
}
|
|
335
|
-
const t =
|
|
332
|
+
const t = e.status.find({
|
|
336
333
|
selector: {
|
|
337
334
|
status: "pending"
|
|
338
335
|
}
|
|
339
|
-
}).$.subscribe(() =>
|
|
336
|
+
}).$.subscribe(() => tt());
|
|
340
337
|
return () => {
|
|
341
338
|
try {
|
|
342
339
|
t == null || t.unsubscribe();
|
|
@@ -344,77 +341,78 @@ const Qt = Mt(null), se = ({
|
|
|
344
341
|
console.warn(i);
|
|
345
342
|
}
|
|
346
343
|
};
|
|
347
|
-
}, [B, C,
|
|
348
|
-
const
|
|
344
|
+
}, [B, C, e, x, tt, (ot = e == null ? void 0 : e.status) == null ? void 0 : ot.closed]);
|
|
345
|
+
const et = $(
|
|
349
346
|
async (t, i, u) => {
|
|
350
347
|
if (!t)
|
|
351
348
|
throw new Error("Type cannot be null");
|
|
352
349
|
if (!i)
|
|
353
350
|
throw new Error("Value cannot be null");
|
|
354
351
|
const c = { type: t, value: i, classification: u ?? w };
|
|
355
|
-
let
|
|
352
|
+
let o = await e.status.findOne({
|
|
356
353
|
selector: c
|
|
357
354
|
}).exec();
|
|
358
|
-
return
|
|
359
|
-
id:
|
|
355
|
+
return o || (o = await e.status.queueInsert({
|
|
356
|
+
id: g(),
|
|
360
357
|
...c,
|
|
361
358
|
status: "pending"
|
|
362
|
-
})),
|
|
359
|
+
})), o;
|
|
363
360
|
},
|
|
364
|
-
[w,
|
|
365
|
-
),
|
|
361
|
+
[w, e]
|
|
362
|
+
), st = $(
|
|
366
363
|
(t) => {
|
|
367
|
-
var f,
|
|
364
|
+
var f, r;
|
|
368
365
|
if (!t)
|
|
369
366
|
return null;
|
|
370
|
-
const i = Object.entries(V), u = (f = i.find(([
|
|
367
|
+
const i = Object.entries(V), u = (f = i.find(([h, a]) => a.exec(t))) == null ? void 0 : f[0];
|
|
371
368
|
if (u)
|
|
372
369
|
return u;
|
|
373
|
-
const c = t.toLowerCase(),
|
|
374
|
-
return
|
|
370
|
+
const c = t.toLowerCase(), o = (r = i.find(([h, a]) => a.exec(c))) == null ? void 0 : r[0];
|
|
371
|
+
return o || null;
|
|
375
372
|
},
|
|
376
373
|
[V]
|
|
377
|
-
),
|
|
374
|
+
), ht = G(
|
|
378
375
|
() => {
|
|
379
376
|
var t;
|
|
380
377
|
return {
|
|
381
378
|
bulkEnrich: W,
|
|
382
|
-
enrich:
|
|
383
|
-
enrichFailedEnrichments:
|
|
379
|
+
enrich: L,
|
|
380
|
+
enrichFailedEnrichments: k,
|
|
384
381
|
sources: D,
|
|
385
|
-
setSources:
|
|
382
|
+
setSources: yt,
|
|
386
383
|
typesDetection: V,
|
|
384
|
+
supportedTypes: z,
|
|
387
385
|
availableSources: P,
|
|
388
|
-
guessType:
|
|
389
|
-
queueEnrich:
|
|
390
|
-
setCustomIconify:
|
|
386
|
+
guessType: st,
|
|
387
|
+
queueEnrich: et,
|
|
388
|
+
setCustomIconify: T,
|
|
391
389
|
setDefaultClassification: Z,
|
|
392
390
|
setReady: mt,
|
|
393
391
|
defaultClassification: w,
|
|
394
|
-
ready: C && !!
|
|
392
|
+
ready: C && !!e && !!((t = I.config) != null && t.c12nDef)
|
|
395
393
|
};
|
|
396
394
|
},
|
|
397
395
|
[
|
|
398
396
|
W,
|
|
399
|
-
T,
|
|
400
397
|
L,
|
|
398
|
+
k,
|
|
401
399
|
D,
|
|
402
400
|
V,
|
|
401
|
+
z,
|
|
403
402
|
P,
|
|
403
|
+
st,
|
|
404
404
|
et,
|
|
405
|
-
tt,
|
|
406
405
|
Z,
|
|
407
406
|
w,
|
|
408
407
|
C,
|
|
409
|
-
|
|
410
|
-
(
|
|
408
|
+
e,
|
|
409
|
+
(ct = I.config) == null ? void 0 : ct.c12nDef
|
|
411
410
|
]
|
|
412
411
|
);
|
|
413
|
-
return /* @__PURE__ */ xt(
|
|
412
|
+
return /* @__PURE__ */ xt(St.Provider, { value: ht, children: s });
|
|
414
413
|
};
|
|
415
414
|
export {
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
ut as u
|
|
415
|
+
St as C,
|
|
416
|
+
ne as a,
|
|
417
|
+
Wt as u
|
|
420
418
|
};
|