@cccsaurora/clue-ui 1.1.0-dev.66 → 1.1.0-dev.89
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-BR-JC3rN.js → ActionForm-ByeOzpc4.js} +124 -39
- package/{AnnotationDetails-Bi8OW9M9.js → AnnotationDetails-DknbKDyl.js} +1 -1
- package/{AnnotationPreview-DOIhJg4V.js → AnnotationPreview-CQwKs8se.js} +1 -1
- package/{ClueEnrichContext-UZ1ghGU_.js → ClueEnrichContext-6NJfXpUB.js} +1 -1
- package/components/AnnotationDetailPopover.js +1 -1
- package/components/AnnotationDetails.js +2 -2
- package/components/AnnotationPreview.js +1 -1
- package/components/EnrichedCard.js +1 -1
- package/components/EnrichedChip.js +1 -1
- package/components/EnrichedTypography.js +1 -1
- package/components/actions/ActionForm.js +1 -1
- package/components/actions/ResultModal.js +12 -39
- package/components/enrichment/EnrichPopover.js +1 -1
- package/components/group/GroupControl.js +1 -1
- package/hooks/ClueActionContext.d.ts +10 -0
- package/hooks/ClueActionContext.js +2 -3
- package/hooks/ClueEnrichContext.js +2 -2
- 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.d.ts +14 -0
- package/hooks/useActionResult.js +5 -0
- package/hooks/useAnnotations.js +1 -1
- package/hooks/useClue.js +1 -1
- package/hooks/useClueActions.js +1 -1
- package/hooks/useClueTypeConfig.js +1 -1
- package/icons/Action.js +2 -2
- package/icons/Assessment.js +1 -1
- package/icons/Context.js +1 -1
- package/icons/Opinion.js +1 -1
- package/main.js +4 -4
- package/package.json +1 -1
- package/types/action.d.ts +3 -1
- package/{useClueTypeConfig-Ck1Sz41X.js → useClueTypeConfig-XvGvIw2S.js} +19 -3
|
@@ -1,20 +1,22 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { materialRenderers, materialCells } from "@jsonforms/material-renderers";
|
|
3
3
|
import { JsonForms } from "@jsonforms/react";
|
|
4
|
-
import {
|
|
4
|
+
import { Modal, Paper, Stack, Typography, Divider, LinearProgress, Button, IconButton, Box, CircularProgress, Collapse } from "@mui/material";
|
|
5
5
|
import Iconified from "./components/display/icons/Iconified.js";
|
|
6
6
|
import { J as JSONViewer } from "./index-Bi21Wb23.js";
|
|
7
7
|
import { ClueComponentContext } from "./hooks/ClueComponentContext.js";
|
|
8
8
|
import { A as Ajv } from "./index-CC12Ux-9.js";
|
|
9
|
-
import { a as api } from "./useClueTypeConfig-
|
|
9
|
+
import { a as api } from "./useClueTypeConfig-XvGvIw2S.js";
|
|
10
10
|
import { d as toString } from "./_baseGet-BSK_nnoz.js";
|
|
11
11
|
import { b as baseSlice } from "./_baseSlice-GAv_YFTT.js";
|
|
12
12
|
import { i as isEqual } from "./utils-7OtvGnmf.js";
|
|
13
|
-
import { useState,
|
|
14
|
-
import {
|
|
13
|
+
import { useState, useRef, useMemo, useEffect, memo, useCallback } from "react";
|
|
14
|
+
import { u as useContextSelector, c as createContext, a as useContext } from "./index-BDVjGvMI.js";
|
|
15
15
|
import ErrorBoundary from "./components/ErrorBoundary.js";
|
|
16
16
|
import { adaptSchema } from "./components/actions/form/schemaAdapter.js";
|
|
17
|
-
import
|
|
17
|
+
import { I as Icon } from "./iconify-CXMreGTg.js";
|
|
18
|
+
import Markdown from "./components/display/markdown/index.js";
|
|
19
|
+
import ClassificationChip from "./components/ClassificationChip.js";
|
|
18
20
|
import { SNACKBAR_EVENT_ID } from "./data/event.js";
|
|
19
21
|
import { dayjs } from "./utils/time.js";
|
|
20
22
|
import { safeDispatchEvent } from "./utils/window.js";
|
|
@@ -57,6 +59,81 @@ var upperFirst = createCaseFirst("toUpperCase");
|
|
|
57
59
|
function capitalize(string) {
|
|
58
60
|
return upperFirst(toString(string).toLowerCase());
|
|
59
61
|
}
|
|
62
|
+
const useActionResult = (resultWithData, interval = 2e3) => {
|
|
63
|
+
const [result, setResult] = useState(resultWithData);
|
|
64
|
+
const timeoutRef = useRef(null);
|
|
65
|
+
const { getActionStatus } = useClueActions();
|
|
66
|
+
const taskId = useMemo(() => resultWithData == null ? void 0 : resultWithData.task_id, [resultWithData == null ? void 0 : resultWithData.task_id]);
|
|
67
|
+
const actionId = useMemo(() => resultWithData == null ? void 0 : resultWithData.actionId, [resultWithData == null ? void 0 : resultWithData.actionId]);
|
|
68
|
+
useEffect(() => {
|
|
69
|
+
if ((resultWithData == null ? void 0 : resultWithData.outcome) !== "pending" || !taskId) return;
|
|
70
|
+
let cancelled = false;
|
|
71
|
+
const poll = async () => {
|
|
72
|
+
const res = await getActionStatus(actionId, taskId);
|
|
73
|
+
if (!res) {
|
|
74
|
+
setResult({ outcome: "failure", done: true });
|
|
75
|
+
} else if (res.outcome === "success" || res.outcome === "failure") {
|
|
76
|
+
setResult({ ...res, done: true });
|
|
77
|
+
} else {
|
|
78
|
+
if (cancelled) return;
|
|
79
|
+
setResult({ ...res });
|
|
80
|
+
timeoutRef.current = setTimeout(poll, interval);
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
poll();
|
|
84
|
+
return () => {
|
|
85
|
+
cancelled = true;
|
|
86
|
+
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
87
|
+
};
|
|
88
|
+
}, [actionId, getActionStatus, interval, resultWithData == null ? void 0 : resultWithData.outcome, taskId]);
|
|
89
|
+
useEffect(() => {
|
|
90
|
+
setResult(resultWithData);
|
|
91
|
+
}, [resultWithData]);
|
|
92
|
+
return useMemo(
|
|
93
|
+
() => resultWithData || result ? { ...resultWithData, ...result } : void 0,
|
|
94
|
+
[resultWithData, result]
|
|
95
|
+
);
|
|
96
|
+
};
|
|
97
|
+
const ResultModal = ({ result: _result, onClose, show = false }) => {
|
|
98
|
+
var _a, _b;
|
|
99
|
+
const { t } = useContextSelector(ClueComponentContext, (ctx) => ctx.i18next);
|
|
100
|
+
const result = useActionResult(_result);
|
|
101
|
+
if (!result) {
|
|
102
|
+
return null;
|
|
103
|
+
}
|
|
104
|
+
return /* @__PURE__ */ jsx(Modal, { open: show, sx: { display: "flex", alignItems: "center", justifyContent: "center" }, onClose, children: /* @__PURE__ */ jsx(Paper, { sx: { maxHeight: "80%", maxWidth: "80%", height: "100%", p: 2, minWidth: "750px" }, children: /* @__PURE__ */ jsx(ErrorBoundary, { children: /* @__PURE__ */ jsxs(Stack, { spacing: 1, height: "100%", children: [
|
|
105
|
+
/* @__PURE__ */ jsxs(Stack, { direction: "row", spacing: 1, alignItems: "center", children: [
|
|
106
|
+
result.action.action_icon && /* @__PURE__ */ jsx(Icon, { height: "1.5rem", icon: result.action.action_icon }),
|
|
107
|
+
/* @__PURE__ */ jsx(Typography, { variant: "h5", children: result.action.name }),
|
|
108
|
+
result.action.supported_types && /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "text.secondary", children: result.action.supported_types.map((type) => type.toUpperCase()).join(", ") }),
|
|
109
|
+
/* @__PURE__ */ jsx("div", { style: { flex: 1 } }),
|
|
110
|
+
/* @__PURE__ */ jsx(ClassificationChip, { size: "small", classification: result.action.classification })
|
|
111
|
+
] }),
|
|
112
|
+
/* @__PURE__ */ jsx(Typography, { variant: "body1", children: result.action.summary }),
|
|
113
|
+
/* @__PURE__ */ jsx(Divider, { flexItem: true }),
|
|
114
|
+
result.done ? /* @__PURE__ */ jsx(ErrorBoundary, { children: result.format === "markdown" ? /* @__PURE__ */ jsx(Markdown, { md: result.output }) : result.format === "json" ? /* @__PURE__ */ jsx(JSONViewer, { data: result.output, collapse: true, forceCompact: true }) : /* @__PURE__ */ jsxs(Stack, { sx: { overflowY: "auto" }, children: [
|
|
115
|
+
/* @__PURE__ */ jsx(Markdown, { md: "`" + result.format + "` is not recognized as a format in this application." }),
|
|
116
|
+
/* @__PURE__ */ jsx(JSONViewer, { data: result, collapse: true, forceCompact: true })
|
|
117
|
+
] }) }) : /* @__PURE__ */ jsxs(Stack, { flex: 1, sx: { pt: 2, alignItems: "center" }, spacing: 1, children: [
|
|
118
|
+
result.summary && /* @__PURE__ */ jsx(Typography, { variant: "caption", children: result.summary }),
|
|
119
|
+
/* @__PURE__ */ jsx(
|
|
120
|
+
LinearProgress,
|
|
121
|
+
{
|
|
122
|
+
variant: ((_a = result.output) == null ? void 0 : _a.progress) ? "determinate" : "indeterminate",
|
|
123
|
+
value: ((_b = result.output) == null ? void 0 : _b.progress) * 100,
|
|
124
|
+
sx: { maxWidth: 500, width: "100%", borderRadius: (theme) => theme.shape.borderRadius }
|
|
125
|
+
}
|
|
126
|
+
)
|
|
127
|
+
] }),
|
|
128
|
+
/* @__PURE__ */ jsx("div", { style: { flex: 1 } }),
|
|
129
|
+
/* @__PURE__ */ jsxs(Stack, { direction: "row", spacing: 1, children: [
|
|
130
|
+
/* @__PURE__ */ jsx("div", { style: { flex: 1 } }),
|
|
131
|
+
result.link && /* @__PURE__ */ jsx(Button, { variant: "outlined", component: "a", target: "_blank", href: result.link, children: t("details.open") }),
|
|
132
|
+
/* @__PURE__ */ jsx(Button, { variant: "outlined", color: "error", onClick: onClose, children: t("close") })
|
|
133
|
+
] })
|
|
134
|
+
] }) }) }) });
|
|
135
|
+
};
|
|
136
|
+
const ResultModal$1 = memo(ResultModal);
|
|
60
137
|
const AJV = new Ajv({ removeAdditional: true, coerceTypes: true, strict: false });
|
|
61
138
|
const ClueActionContext = createContext(null);
|
|
62
139
|
const ClueActionProvider = ({
|
|
@@ -75,25 +152,25 @@ const ClueActionProvider = ({
|
|
|
75
152
|
const [lastResult, setLastResult] = useState(null);
|
|
76
153
|
const [loading, setLoading] = useState(false);
|
|
77
154
|
const [availableActions, setAvailableActions] = useState({});
|
|
78
|
-
const
|
|
79
|
-
if (!ready) {
|
|
80
|
-
return;
|
|
81
|
-
}
|
|
155
|
+
const requestConfig = useMemo(() => {
|
|
82
156
|
const headers = {};
|
|
83
157
|
const token = getToken == null ? void 0 : getToken();
|
|
84
158
|
if (token) {
|
|
85
159
|
headers.Authorization = `Bearer ${token}`;
|
|
86
160
|
}
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
161
|
+
const baseConfig = { baseURL, headers };
|
|
162
|
+
return onNetworkCall ? onNetworkCall(baseConfig) : { baseURL, headers };
|
|
163
|
+
}, [baseURL, getToken, onNetworkCall]);
|
|
164
|
+
const refreshActions = useCallback(async () => {
|
|
165
|
+
if (!ready) {
|
|
166
|
+
return;
|
|
90
167
|
}
|
|
91
168
|
const _actions = await api.actions.get(requestConfig);
|
|
92
169
|
if (_actions) {
|
|
93
170
|
setAvailableActions(_actions);
|
|
94
171
|
}
|
|
95
172
|
return _actions;
|
|
96
|
-
}, [
|
|
173
|
+
}, [ready, requestConfig]);
|
|
97
174
|
useEffect(() => {
|
|
98
175
|
refreshActions();
|
|
99
176
|
}, [baseURL, ready]);
|
|
@@ -103,7 +180,7 @@ const ClueActionProvider = ({
|
|
|
103
180
|
);
|
|
104
181
|
const executeAction = useCallback(
|
|
105
182
|
async (actionId, selectors, params, options) => {
|
|
106
|
-
const { forceMenu, onComplete, skipMenu, timeout, includeContext, extraContext } = {
|
|
183
|
+
const { forceMenu, onComplete, skipMenu, skipResultModal, timeout, includeContext, extraContext } = {
|
|
107
184
|
forceMenu: false,
|
|
108
185
|
skipMenu: false,
|
|
109
186
|
onComplete: null,
|
|
@@ -112,11 +189,6 @@ const ClueActionProvider = ({
|
|
|
112
189
|
extraContext: null,
|
|
113
190
|
...options
|
|
114
191
|
};
|
|
115
|
-
const headers = {};
|
|
116
|
-
const token = getToken == null ? void 0 : getToken();
|
|
117
|
-
if (token) {
|
|
118
|
-
headers.Authorization = `Bearer ${token}`;
|
|
119
|
-
}
|
|
120
192
|
if (!Object.keys(availableActions).includes(actionId)) {
|
|
121
193
|
throw new Error("Invalid action id");
|
|
122
194
|
}
|
|
@@ -169,10 +241,6 @@ const ClueActionProvider = ({
|
|
|
169
241
|
return;
|
|
170
242
|
}
|
|
171
243
|
try {
|
|
172
|
-
let requestConfig = { baseURL, headers };
|
|
173
|
-
if (onNetworkCall) {
|
|
174
|
-
requestConfig = onNetworkCall(requestConfig);
|
|
175
|
-
}
|
|
176
244
|
const actionResult = await api.actions.post(
|
|
177
245
|
actionId,
|
|
178
246
|
stringifiedSelectors,
|
|
@@ -204,7 +272,7 @@ const ClueActionProvider = ({
|
|
|
204
272
|
actionResult.link && /* @__PURE__ */ jsx(IconButton, { component: "a", href: actionResult.link, size: "small", target: "_blank", children: /* @__PURE__ */ jsx(Iconified, { icon: "ic:baseline-open-in-new", fontSize: "small" }) })
|
|
205
273
|
] }),
|
|
206
274
|
timeout: actionResult.link ? null : 5e3,
|
|
207
|
-
level: actionResult.outcome === "success" ? "success" : "error",
|
|
275
|
+
level: actionResult.outcome === "success" ? "success" : actionResult.outcome === "pending" ? "info" : "error",
|
|
208
276
|
options: {
|
|
209
277
|
style: {
|
|
210
278
|
minWidth: 0
|
|
@@ -221,9 +289,15 @@ const ClueActionProvider = ({
|
|
|
221
289
|
if (actionResult.outcome === "success") {
|
|
222
290
|
setRunningActionData(null);
|
|
223
291
|
}
|
|
292
|
+
if (actionResult.outcome === "pending") {
|
|
293
|
+
setLastResult({ ...actionResult, actionId, action: actionToRun });
|
|
294
|
+
if (!skipResultModal) {
|
|
295
|
+
setShowResultModal(true);
|
|
296
|
+
}
|
|
297
|
+
}
|
|
224
298
|
if (actionResult.format) {
|
|
225
299
|
setLastResult({ ...actionResult, actionId, action: actionToRun });
|
|
226
|
-
if (actionResult.format !== "pivot") {
|
|
300
|
+
if (actionResult.format !== "pivot" && !skipResultModal) {
|
|
227
301
|
setShowResultModal(true);
|
|
228
302
|
} else {
|
|
229
303
|
window.open(actionResult.output, "_blank", "noreferrer");
|
|
@@ -242,17 +316,25 @@ const ClueActionProvider = ({
|
|
|
242
316
|
setLoading(false);
|
|
243
317
|
}
|
|
244
318
|
},
|
|
245
|
-
[
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
319
|
+
[availableActions, defaultIncludeContext, getHashKey, i18n == null ? void 0 : i18n.language, requestConfig, runningActionData == null ? void 0 : runningActionData.id, t]
|
|
320
|
+
);
|
|
321
|
+
const getActionStatus = useCallback(
|
|
322
|
+
async (actionId, taskId) => {
|
|
323
|
+
try {
|
|
324
|
+
const res = await api.actions.status.get(actionId, taskId, {}, requestConfig);
|
|
325
|
+
return res;
|
|
326
|
+
} catch (e) {
|
|
327
|
+
safeDispatchEvent(
|
|
328
|
+
new CustomEvent(SNACKBAR_EVENT_ID, {
|
|
329
|
+
detail: {
|
|
330
|
+
message: e.toString(),
|
|
331
|
+
level: "error"
|
|
332
|
+
}
|
|
333
|
+
})
|
|
334
|
+
);
|
|
335
|
+
}
|
|
336
|
+
},
|
|
337
|
+
[requestConfig]
|
|
256
338
|
);
|
|
257
339
|
const cancelAction = useCallback(() => {
|
|
258
340
|
setRunningActionData(null);
|
|
@@ -267,18 +349,19 @@ const ClueActionProvider = ({
|
|
|
267
349
|
availableActions,
|
|
268
350
|
executeAction,
|
|
269
351
|
cancelAction,
|
|
352
|
+
getActionStatus,
|
|
270
353
|
getActionResults,
|
|
271
354
|
loading,
|
|
272
355
|
refreshActions
|
|
273
356
|
}),
|
|
274
|
-
[availableActions, cancelAction, executeAction, getActionResults, loading, refreshActions]
|
|
357
|
+
[availableActions, cancelAction, executeAction, getActionResults, getActionStatus, loading, refreshActions]
|
|
275
358
|
);
|
|
276
359
|
return /* @__PURE__ */ jsxs(ClueActionContext.Provider, { value: context, children: [
|
|
277
360
|
children,
|
|
278
361
|
/* @__PURE__ */ jsxs(ErrorBoundary, { children: [
|
|
279
362
|
runningActionData && /* @__PURE__ */ jsx(ActionForm$1, { runningActionData }),
|
|
280
363
|
/* @__PURE__ */ jsx(
|
|
281
|
-
ResultModal,
|
|
364
|
+
ResultModal$1,
|
|
282
365
|
{
|
|
283
366
|
show: showResultModal && !!lastResult,
|
|
284
367
|
result: lastResult,
|
|
@@ -464,7 +547,9 @@ const ActionForm$1 = memo(ActionForm);
|
|
|
464
547
|
export {
|
|
465
548
|
ActionForm$1 as A,
|
|
466
549
|
ClueActionProvider as C,
|
|
550
|
+
ResultModal$1 as R,
|
|
467
551
|
ClueActionContext as a,
|
|
552
|
+
useActionResult as b,
|
|
468
553
|
capitalize as c,
|
|
469
554
|
useClueActions as u
|
|
470
555
|
};
|
|
@@ -10,7 +10,7 @@ import useErrors from "./hooks/useErrors.js";
|
|
|
10
10
|
import { ICON_MAP } from "./icons/iconMap.js";
|
|
11
11
|
import { safeDispatchEvent } from "./utils/window.js";
|
|
12
12
|
import { g as groupBy } from "./groupBy-DC2oOuBN.js";
|
|
13
|
-
import { u as uniq } from "./ClueEnrichContext-
|
|
13
|
+
import { u as uniq } from "./ClueEnrichContext-6NJfXpUB.js";
|
|
14
14
|
import { memo, useState, useMemo, useCallback, useEffect } from "react";
|
|
15
15
|
import { u as useContextSelector } from "./index-BDVjGvMI.js";
|
|
16
16
|
import ExecutePopover from "./components/actions/ExecutePopover.js";
|
|
@@ -8,7 +8,7 @@ import { useState, useRef, useCallback, useEffect, useMemo } from "react";
|
|
|
8
8
|
import { c as createContext, u as useContextSelector } from "./index-BDVjGvMI.js";
|
|
9
9
|
import { SHOW_EVENT_ID, HIDE_EVENT_ID } from "./data/event.js";
|
|
10
10
|
import { safeDispatchEvent, safeAddEventListener } from "./utils/window.js";
|
|
11
|
-
import { i as isNull } from "./AnnotationDetails-
|
|
11
|
+
import { i as isNull } from "./AnnotationDetails-DknbKDyl.js";
|
|
12
12
|
const CluePopupContext = createContext(null);
|
|
13
13
|
const CluePopupProvider = ({ children }) => {
|
|
14
14
|
const [popupType, setPopupType] = useState(null);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { a as addAPIProvider } from "./iconify-CXMreGTg.js";
|
|
3
|
-
import { u as useClueTypeConfig, a as api, p as post } from "./useClueTypeConfig-
|
|
3
|
+
import { u as useClueTypeConfig, a as api, p as post } from "./useClueTypeConfig-XvGvIw2S.js";
|
|
4
4
|
import { clueDebugLogger } from "./utils/loggerUtil.js";
|
|
5
5
|
import { b as baseSlice } from "./_baseSlice-GAv_YFTT.js";
|
|
6
6
|
import { t as toFinite } from "./toFinite-Bc55msYj.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { Popover } from "@mui/material";
|
|
3
3
|
import React__default, { useRef, useState, useEffect } from "react";
|
|
4
|
-
import { A as AnnotationDetails } from "../AnnotationDetails-
|
|
4
|
+
import { A as AnnotationDetails } from "../AnnotationDetails-DknbKDyl.js";
|
|
5
5
|
const AnnotationDetailPopover = React__default.memo(({ anchorEl, enrichRequest, open, onClose, ...otherProps }) => {
|
|
6
6
|
var _a, _b, _c;
|
|
7
7
|
const actionRef = useRef();
|
|
@@ -10,8 +10,8 @@ import "../hooks/useErrors.js";
|
|
|
10
10
|
import "../icons/iconMap.js";
|
|
11
11
|
import "../utils/window.js";
|
|
12
12
|
import "../groupBy-DC2oOuBN.js";
|
|
13
|
-
import { A } from "../AnnotationDetails-
|
|
14
|
-
import "../ClueEnrichContext-
|
|
13
|
+
import { A } from "../AnnotationDetails-DknbKDyl.js";
|
|
14
|
+
import "../ClueEnrichContext-6NJfXpUB.js";
|
|
15
15
|
import "react";
|
|
16
16
|
import "../index-BDVjGvMI.js";
|
|
17
17
|
import "./actions/ExecutePopover.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "react/jsx-runtime";
|
|
2
2
|
import "../iconify-CXMreGTg.js";
|
|
3
3
|
import "@mui/material";
|
|
4
|
-
import { A } from "../AnnotationPreview-
|
|
4
|
+
import { A } from "../AnnotationPreview-CQwKs8se.js";
|
|
5
5
|
import "../hooks/useAnnotations.js";
|
|
6
6
|
import "../utils-7OtvGnmf.js";
|
|
7
7
|
import "react";
|
|
@@ -10,7 +10,7 @@ import ContextIcon from "../icons/Context.js";
|
|
|
10
10
|
import OpinionIcon from "../icons/Opinion.js";
|
|
11
11
|
import { ICON_MAP } from "../icons/iconMap.js";
|
|
12
12
|
import FrequencyText from "../text/Frequency.js";
|
|
13
|
-
import { u as uniq } from "../ClueEnrichContext-
|
|
13
|
+
import { u as uniq } from "../ClueEnrichContext-6NJfXpUB.js";
|
|
14
14
|
import { memo, useState, useMemo, useCallback } from "react";
|
|
15
15
|
import { u as useContextSelector } from "../index-BDVjGvMI.js";
|
|
16
16
|
import AnnotationEntry from "./AnnotationEntry.js";
|
|
@@ -3,7 +3,7 @@ import { Chip, Tooltip, Box, Stack, CircularProgress } from "@mui/material";
|
|
|
3
3
|
import Iconified from "./display/icons/Iconified.js";
|
|
4
4
|
import { ClueComponentContext } from "../hooks/ClueComponentContext.js";
|
|
5
5
|
import { ClueGroupContext } from "../hooks/ClueGroupContext.js";
|
|
6
|
-
import { C as CluePopupContext } from "../AnnotationPreview-
|
|
6
|
+
import { C as CluePopupContext } from "../AnnotationPreview-CQwKs8se.js";
|
|
7
7
|
import { useClueEnrichSelector } from "../hooks/selectors.js";
|
|
8
8
|
import useAnnotations from "../hooks/useAnnotations.js";
|
|
9
9
|
import ActionIcon from "../icons/Action.js";
|
|
@@ -3,7 +3,7 @@ import { useTheme, Stack, CircularProgress, Tooltip, IconButton } from "@mui/mat
|
|
|
3
3
|
import Iconified from "./display/icons/Iconified.js";
|
|
4
4
|
import { ClueComponentContext } from "../hooks/ClueComponentContext.js";
|
|
5
5
|
import { ClueGroupContext } from "../hooks/ClueGroupContext.js";
|
|
6
|
-
import { C as CluePopupContext } from "../AnnotationPreview-
|
|
6
|
+
import { C as CluePopupContext } from "../AnnotationPreview-CQwKs8se.js";
|
|
7
7
|
import { useClueEnrichSelector } from "../hooks/selectors.js";
|
|
8
8
|
import useAnnotations from "../hooks/useAnnotations.js";
|
|
9
9
|
import ActionIcon from "../icons/Action.js";
|
|
@@ -5,7 +5,7 @@ import "@mui/material";
|
|
|
5
5
|
import "../display/icons/Iconified.js";
|
|
6
6
|
import "../../index-Bi21Wb23.js";
|
|
7
7
|
import "../../hooks/ClueComponentContext.js";
|
|
8
|
-
import { A } from "../../ActionForm-
|
|
8
|
+
import { A } from "../../ActionForm-ByeOzpc4.js";
|
|
9
9
|
import "../../utils-7OtvGnmf.js";
|
|
10
10
|
import "react";
|
|
11
11
|
import "../../index-BDVjGvMI.js";
|
|
@@ -1,41 +1,14 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
|
|
12
|
-
const { t } = useContextSelector(ClueComponentContext, (ctx) => ctx.i18next);
|
|
13
|
-
if (!result) {
|
|
14
|
-
return null;
|
|
15
|
-
}
|
|
16
|
-
return /* @__PURE__ */ jsx(Modal, { open: show, sx: { display: "flex", alignItems: "center", justifyContent: "center" }, onClose, children: /* @__PURE__ */ jsx(Paper, { sx: { maxHeight: "80%", maxWidth: "80%", height: "100%", p: 2, minWidth: "750px" }, children: /* @__PURE__ */ jsx(ErrorBoundary, { children: /* @__PURE__ */ jsxs(Stack, { spacing: 1, height: "100%", children: [
|
|
17
|
-
/* @__PURE__ */ jsxs(Stack, { direction: "row", spacing: 1, alignItems: "center", children: [
|
|
18
|
-
result.action.action_icon && /* @__PURE__ */ jsx(Icon, { height: "1.5rem", icon: result.action.action_icon }),
|
|
19
|
-
/* @__PURE__ */ jsx(Typography, { variant: "h5", children: result.action.name }),
|
|
20
|
-
result.action.supported_types && /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "text.secondary", children: result.action.supported_types.map((type) => type.toUpperCase()).join(", ") }),
|
|
21
|
-
/* @__PURE__ */ jsx("div", { style: { flex: 1 } }),
|
|
22
|
-
/* @__PURE__ */ jsx(ClassificationChip, { size: "small", classification: result.action.classification })
|
|
23
|
-
] }),
|
|
24
|
-
/* @__PURE__ */ jsx(Typography, { variant: "body1", children: result.action.summary }),
|
|
25
|
-
/* @__PURE__ */ jsx(Divider, { flexItem: true }),
|
|
26
|
-
/* @__PURE__ */ jsxs(ErrorBoundary, { children: [
|
|
27
|
-
result.format === "markdown" && /* @__PURE__ */ jsx(Markdown, { md: result.output }),
|
|
28
|
-
result.format === "json" && /* @__PURE__ */ jsx(JSONViewer, { data: result.output, collapse: true, forceCompact: true })
|
|
29
|
-
] }),
|
|
30
|
-
/* @__PURE__ */ jsx("div", { style: { flex: 1 } }),
|
|
31
|
-
/* @__PURE__ */ jsxs(Stack, { direction: "row", spacing: 1, children: [
|
|
32
|
-
/* @__PURE__ */ jsx("div", { style: { flex: 1 } }),
|
|
33
|
-
result.link && /* @__PURE__ */ jsx(Button, { variant: "outlined", component: "a", target: "_blank", href: result.link, children: t("details.open") }),
|
|
34
|
-
/* @__PURE__ */ jsx(Button, { variant: "outlined", color: "error", onClick: onClose, children: t("close") })
|
|
35
|
-
] })
|
|
36
|
-
] }) }) }) });
|
|
37
|
-
};
|
|
38
|
-
const ResultModal$1 = memo(ResultModal);
|
|
1
|
+
import "react/jsx-runtime";
|
|
2
|
+
import "../../iconify-CXMreGTg.js";
|
|
3
|
+
import "@mui/material";
|
|
4
|
+
import "../../index-Bi21Wb23.js";
|
|
5
|
+
import "../display/markdown/index.js";
|
|
6
|
+
import "../../hooks/ClueComponentContext.js";
|
|
7
|
+
import { R } from "../../ActionForm-ByeOzpc4.js";
|
|
8
|
+
import "react";
|
|
9
|
+
import "../../index-BDVjGvMI.js";
|
|
10
|
+
import "../ClassificationChip.js";
|
|
11
|
+
import "../ErrorBoundary.js";
|
|
39
12
|
export {
|
|
40
|
-
|
|
13
|
+
R as default
|
|
41
14
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs, Fragment, jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useTheme, Tooltip, IconButton, CircularProgress, Button, Popover, Paper, Stack, Box, Typography, Divider } from "@mui/material";
|
|
3
3
|
import { useClueComponentSelector, useClueEnrichSelector } from "../../hooks/selectors.js";
|
|
4
|
-
import { c as capitalize } from "../../ActionForm-
|
|
4
|
+
import { c as capitalize } from "../../ActionForm-ByeOzpc4.js";
|
|
5
5
|
import { useState, useRef, useCallback, useEffect } from "react";
|
|
6
6
|
import Iconified from "../display/icons/Iconified.js";
|
|
7
7
|
const EnrichPopover = ({ show = false, size = "small", selector }) => {
|
|
@@ -6,7 +6,7 @@ import { SNACKBAR_EVENT_ID } from "../../data/event.js";
|
|
|
6
6
|
import { ClueGroupContext } from "../../hooks/ClueGroupContext.js";
|
|
7
7
|
import { useClueComponentSelector, useClueEnrichSelector } from "../../hooks/selectors.js";
|
|
8
8
|
import { safeDispatchEvent } from "../../utils/window.js";
|
|
9
|
-
import { c as capitalize } from "../../ActionForm-
|
|
9
|
+
import { c as capitalize } from "../../ActionForm-ByeOzpc4.js";
|
|
10
10
|
import { useState, useMemo, useCallback } from "react";
|
|
11
11
|
import { u as useContextSelector } from "../../index-BDVjGvMI.js";
|
|
12
12
|
import ExecutePopover from "../actions/ExecutePopover.js";
|
|
@@ -33,6 +33,10 @@ export interface ClueActionContextType {
|
|
|
33
33
|
* Should the function raise an exception instead of showing the menu if the form is not completed?
|
|
34
34
|
*/
|
|
35
35
|
skipMenu?: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Should the result modal be shown?
|
|
38
|
+
*/
|
|
39
|
+
skipResultModal?: boolean;
|
|
36
40
|
/**
|
|
37
41
|
* Callback for post-execution.
|
|
38
42
|
* @param result
|
|
@@ -68,6 +72,12 @@ export interface ClueActionContextType {
|
|
|
68
72
|
* @returns the list of results for a given selector
|
|
69
73
|
*/
|
|
70
74
|
getActionResults: (type: string, value: string, classification?: string) => WithActionData<ActionResult>[];
|
|
75
|
+
/**
|
|
76
|
+
* Get the status of an ongoing action
|
|
77
|
+
* @param actionId The ID of the action to get the status of
|
|
78
|
+
* @param taskId The task id to get the status of
|
|
79
|
+
*/
|
|
80
|
+
getActionStatus: (actionId: string, taskId: string) => Promise<WithActionData<ActionResult>>;
|
|
71
81
|
/**
|
|
72
82
|
* Is there currently an action executing?
|
|
73
83
|
*/
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import "react/jsx-runtime";
|
|
2
2
|
import "@mui/material";
|
|
3
3
|
import "../index-CC12Ux-9.js";
|
|
4
|
-
import "../useClueTypeConfig-
|
|
5
|
-
import { a, C } from "../ActionForm-
|
|
6
|
-
import "../components/actions/ResultModal.js";
|
|
4
|
+
import "../useClueTypeConfig-XvGvIw2S.js";
|
|
5
|
+
import { a, C } from "../ActionForm-ByeOzpc4.js";
|
|
7
6
|
import "../components/display/icons/Iconified.js";
|
|
8
7
|
import "../components/ErrorBoundary.js";
|
|
9
8
|
import "../data/event.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import "react/jsx-runtime";
|
|
2
2
|
import "../iconify-CXMreGTg.js";
|
|
3
|
-
import "../useClueTypeConfig-
|
|
3
|
+
import "../useClueTypeConfig-XvGvIw2S.js";
|
|
4
4
|
import "../utils/loggerUtil.js";
|
|
5
|
-
import { C, a } from "../ClueEnrichContext-
|
|
5
|
+
import { C, a } from "../ClueEnrichContext-6NJfXpUB.js";
|
|
6
6
|
import "../debounce-bV0h5FC5.js";
|
|
7
7
|
import "../groupBy-DC2oOuBN.js";
|
|
8
8
|
import "react";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { a as api } from "../useClueTypeConfig-
|
|
2
|
+
import { a as api } from "../useClueTypeConfig-XvGvIw2S.js";
|
|
3
3
|
import { useState, useRef, useCallback, useEffect, useMemo } from "react";
|
|
4
4
|
import { c as createContext } from "../index-BDVjGvMI.js";
|
|
5
5
|
import useClue from "./useClue.js";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import "react/jsx-runtime";
|
|
2
2
|
import "../components/AnnotationDetailPopover.js";
|
|
3
|
-
import { C, a } from "../AnnotationPreview-
|
|
3
|
+
import { C, a } from "../AnnotationPreview-CQwKs8se.js";
|
|
4
4
|
import "../data/event.js";
|
|
5
5
|
import "../utils/window.js";
|
|
6
|
-
import "../AnnotationDetails-
|
|
6
|
+
import "../AnnotationDetails-DknbKDyl.js";
|
|
7
7
|
import "react";
|
|
8
8
|
import "../index-BDVjGvMI.js";
|
|
9
9
|
export {
|
package/hooks/ClueProvider.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { C as ClueActionProvider } from "../ActionForm-
|
|
2
|
+
import { C as ClueActionProvider } from "../ActionForm-ByeOzpc4.js";
|
|
3
3
|
import { ClueComponentProvider } from "./ClueComponentContext.js";
|
|
4
4
|
import { ClueConfigProvider } from "./ClueConfigProvider.js";
|
|
5
5
|
import { ClueDatabaseProvider } from "./ClueDatabaseContext.js";
|
|
6
|
-
import { a as ClueEnrichProvider } from "../ClueEnrichContext-
|
|
6
|
+
import { a as ClueEnrichProvider } from "../ClueEnrichContext-6NJfXpUB.js";
|
|
7
7
|
import { ClueFetcherProvider } from "./ClueFetcherContext.js";
|
|
8
|
-
import { a as CluePopupProvider } from "../AnnotationPreview-
|
|
8
|
+
import { a as CluePopupProvider } from "../AnnotationPreview-CQwKs8se.js";
|
|
9
9
|
const ClueProvider = ({ children, ...props }) => {
|
|
10
10
|
return /* @__PURE__ */ jsx(ClueComponentProvider, { ...props, children: /* @__PURE__ */ jsx(ClueConfigProvider, { config: props.config, children: /* @__PURE__ */ jsx(ClueDatabaseProvider, { ...props, children: /* @__PURE__ */ jsx(ClueEnrichProvider, { ...props, children: /* @__PURE__ */ jsx(ClueFetcherProvider, { ...props, children: /* @__PURE__ */ jsx(ClueActionProvider, { ...props, children: /* @__PURE__ */ jsx(CluePopupProvider, { children }) }) }) }) }) }) });
|
|
11
11
|
};
|
package/hooks/selectors.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { a as ClueActionContext } from "../ActionForm-
|
|
1
|
+
import { a as ClueActionContext } from "../ActionForm-ByeOzpc4.js";
|
|
2
2
|
import { ClueComponentContext } from "./ClueComponentContext.js";
|
|
3
|
-
import { C as ClueEnrichContext } from "../ClueEnrichContext-
|
|
3
|
+
import { C as ClueEnrichContext } from "../ClueEnrichContext-6NJfXpUB.js";
|
|
4
4
|
import { ClueFetcherContext } from "./ClueFetcherContext.js";
|
|
5
5
|
import { u as useContextSelector } from "../index-BDVjGvMI.js";
|
|
6
6
|
const useClueFetcherSelector = (selector) => {
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ActionResult } from "../types/action";
|
|
2
|
+
import { WithActionData } from "../types/WithActionData";
|
|
3
|
+
|
|
4
|
+
export declare const useActionResult: (resultWithData: WithActionData<ActionResult>, interval?: number) => {
|
|
5
|
+
outcome: "success" | "failure" | "pending";
|
|
6
|
+
summary?: string;
|
|
7
|
+
output?: any;
|
|
8
|
+
format?: string;
|
|
9
|
+
link?: string;
|
|
10
|
+
done?: boolean;
|
|
11
|
+
task_id?: string;
|
|
12
|
+
actionId: string;
|
|
13
|
+
action: import("../types/action").ActionDefinition;
|
|
14
|
+
};
|
package/hooks/useAnnotations.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { b as uniqBy } from "../ClueEnrichContext-
|
|
1
|
+
import { b as uniqBy } from "../ClueEnrichContext-6NJfXpUB.js";
|
|
2
2
|
import { useContext, useMemo, useState, useEffect } from "react";
|
|
3
3
|
import { ClueDatabaseContext } from "./ClueDatabaseContext.js";
|
|
4
4
|
import { useClueEnrichSelector } from "./selectors.js";
|
package/hooks/useClue.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { a as useContext } from "../index-BDVjGvMI.js";
|
|
2
|
-
import { C as ClueEnrichContext } from "../ClueEnrichContext-
|
|
2
|
+
import { C as ClueEnrichContext } from "../ClueEnrichContext-6NJfXpUB.js";
|
|
3
3
|
const useClue = () => {
|
|
4
4
|
return useContext(ClueEnrichContext);
|
|
5
5
|
};
|
package/hooks/useClueActions.js
CHANGED
package/icons/Action.js
CHANGED
|
@@ -2,8 +2,8 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { I as Icon } from "../iconify-CXMreGTg.js";
|
|
3
3
|
import { useTheme, Stack, Divider, Typography } from "@mui/material";
|
|
4
4
|
import CountBadge from "../components/CountBadge.js";
|
|
5
|
-
import { C as CluePopupContext } from "../AnnotationPreview-
|
|
6
|
-
import { u as useClueActions } from "../ActionForm-
|
|
5
|
+
import { C as CluePopupContext } from "../AnnotationPreview-CQwKs8se.js";
|
|
6
|
+
import { u as useClueActions } from "../ActionForm-ByeOzpc4.js";
|
|
7
7
|
import { g as groupBy } from "../groupBy-DC2oOuBN.js";
|
|
8
8
|
import { memo, useRef, useMemo, useEffect } from "react";
|
|
9
9
|
import { u as useContextSelector } from "../index-BDVjGvMI.js";
|
package/icons/Assessment.js
CHANGED
|
@@ -2,7 +2,7 @@ import { jsxs, jsx, Fragment } from "react/jsx-runtime";
|
|
|
2
2
|
import { I as Icon } from "../iconify-CXMreGTg.js";
|
|
3
3
|
import { useTheme, Stack, Chip, Divider, Grid, Tooltip } from "@mui/material";
|
|
4
4
|
import CountBadge from "../components/CountBadge.js";
|
|
5
|
-
import { C as CluePopupContext } from "../AnnotationPreview-
|
|
5
|
+
import { C as CluePopupContext } from "../AnnotationPreview-CQwKs8se.js";
|
|
6
6
|
import { g as groupBy } from "../groupBy-DC2oOuBN.js";
|
|
7
7
|
import { l as last } from "../last-CUCl67Im.js";
|
|
8
8
|
import { m as maxBy, s as sortBy } from "../sortBy-B-UKp4GT.js";
|
package/icons/Context.js
CHANGED
|
@@ -4,7 +4,7 @@ import { Stack, Divider } from "@mui/material";
|
|
|
4
4
|
import AnnotationEntry from "../components/AnnotationEntry.js";
|
|
5
5
|
import CountBadge from "../components/CountBadge.js";
|
|
6
6
|
import Iconified from "../components/display/icons/Iconified.js";
|
|
7
|
-
import { C as CluePopupContext } from "../AnnotationPreview-
|
|
7
|
+
import { C as CluePopupContext } from "../AnnotationPreview-CQwKs8se.js";
|
|
8
8
|
import { g as groupBy } from "../groupBy-DC2oOuBN.js";
|
|
9
9
|
import { memo, useRef, useMemo, useEffect } from "react";
|
|
10
10
|
import { u as useContextSelector } from "../index-BDVjGvMI.js";
|
package/icons/Opinion.js
CHANGED
|
@@ -2,7 +2,7 @@ import { jsxs, jsx, Fragment } from "react/jsx-runtime";
|
|
|
2
2
|
import { I as Icon } from "../iconify-CXMreGTg.js";
|
|
3
3
|
import { useTheme, Stack, Chip, Divider, Grid } from "@mui/material";
|
|
4
4
|
import CountBadge from "../components/CountBadge.js";
|
|
5
|
-
import { C as CluePopupContext } from "../AnnotationPreview-
|
|
5
|
+
import { C as CluePopupContext } from "../AnnotationPreview-CQwKs8se.js";
|
|
6
6
|
import chain from "../utils/chain.js";
|
|
7
7
|
import { g as groupBy } from "../groupBy-DC2oOuBN.js";
|
|
8
8
|
import { s as sortBy } from "../sortBy-B-UKp4GT.js";
|
package/main.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { A, u } from "./ActionForm-
|
|
1
|
+
import { A, u } from "./ActionForm-ByeOzpc4.js";
|
|
2
2
|
import { default as default2 } from "./components/AnnotationDetailPopover.js";
|
|
3
|
-
import { A as A2 } from "./AnnotationDetails-
|
|
3
|
+
import { A as A2 } from "./AnnotationDetails-DknbKDyl.js";
|
|
4
4
|
import { default as default3 } from "./components/AnnotationEntry.js";
|
|
5
|
-
import { A as A3, C } from "./AnnotationPreview-
|
|
5
|
+
import { A as A3, C } from "./AnnotationPreview-CQwKs8se.js";
|
|
6
6
|
import { default as default4 } from "./components/CountBadge.js";
|
|
7
7
|
import { default as default5 } from "./components/EnrichedCard.js";
|
|
8
8
|
import { default as default6 } from "./components/EnrichedChip.js";
|
|
@@ -18,7 +18,7 @@ import { b } from "./index-CC12Ux-9.js";
|
|
|
18
18
|
import { ClueComponentContext } from "./hooks/ClueComponentContext.js";
|
|
19
19
|
import { ClueConfigContext } from "./hooks/ClueConfigProvider.js";
|
|
20
20
|
import { ClueDatabaseContext } from "./hooks/ClueDatabaseContext.js";
|
|
21
|
-
import { C as C2 } from "./ClueEnrichContext-
|
|
21
|
+
import { C as C2 } from "./ClueEnrichContext-6NJfXpUB.js";
|
|
22
22
|
import { ClueProvider } from "./hooks/ClueProvider.js";
|
|
23
23
|
import { useClueActionsSelector, useClueEnrichSelector, useClueFetcherSelector } from "./hooks/selectors.js";
|
|
24
24
|
import { default as default14 } from "./hooks/useClue.js";
|
package/package.json
CHANGED
package/types/action.d.ts
CHANGED
|
@@ -22,11 +22,13 @@ export interface ActionDefinition {
|
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
export interface ActionResult<T = any> {
|
|
25
|
-
outcome: 'success' | 'failure';
|
|
25
|
+
outcome: 'success' | 'failure' | 'pending';
|
|
26
26
|
summary?: string;
|
|
27
27
|
output?: T;
|
|
28
28
|
format?: string;
|
|
29
29
|
link?: string;
|
|
30
|
+
done?: boolean;
|
|
31
|
+
task_id?: string;
|
|
30
32
|
}
|
|
31
33
|
|
|
32
34
|
export type ActionDefinitionsResponse = { [type: string]: ActionDefinition };
|
|
@@ -8,6 +8,21 @@ import { getAxiosCache, setAxiosCache } from "./utils/sessionStorage.js";
|
|
|
8
8
|
import { clueDebugLogger } from "./utils/loggerUtil.js";
|
|
9
9
|
import { i as isEmpty } from "./isEmpty-BQkZubqU.js";
|
|
10
10
|
import { useState, useEffect } from "react";
|
|
11
|
+
const get$8 = (actionId, taskId, options = { timeout: null }, config) => {
|
|
12
|
+
const searchParams = [];
|
|
13
|
+
if (!isNil(options.timeout)) {
|
|
14
|
+
searchParams.push(`max_timeout=${options.timeout}`);
|
|
15
|
+
}
|
|
16
|
+
return hget(
|
|
17
|
+
joinUri(uri$c(), `${actionId.replace(".", "/")}/status/${taskId}`),
|
|
18
|
+
searchParams.length > 0 ? new URLSearchParams(searchParams.join("&")) : null,
|
|
19
|
+
config
|
|
20
|
+
);
|
|
21
|
+
};
|
|
22
|
+
const status = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
23
|
+
__proto__: null,
|
|
24
|
+
get: get$8
|
|
25
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
11
26
|
const uri$c = () => {
|
|
12
27
|
return joinUri(uri(), "actions");
|
|
13
28
|
};
|
|
@@ -44,6 +59,7 @@ const actions = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePrope
|
|
|
44
59
|
__proto__: null,
|
|
45
60
|
get: get$7,
|
|
46
61
|
post: post$3,
|
|
62
|
+
status,
|
|
47
63
|
uri: uri$c
|
|
48
64
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
49
65
|
const uri$b = (searchParams) => {
|
|
@@ -1085,8 +1101,8 @@ const defaults = {
|
|
|
1085
1101
|
FormData: platform.classes.FormData,
|
|
1086
1102
|
Blob: platform.classes.Blob
|
|
1087
1103
|
},
|
|
1088
|
-
validateStatus: function validateStatus(
|
|
1089
|
-
return
|
|
1104
|
+
validateStatus: function validateStatus(status2) {
|
|
1105
|
+
return status2 >= 200 && status2 < 300;
|
|
1090
1106
|
},
|
|
1091
1107
|
headers: {
|
|
1092
1108
|
common: {
|
|
@@ -2922,7 +2938,7 @@ class AxiosClient {
|
|
|
2922
2938
|
constructor() {
|
|
2923
2939
|
__publicField(this, "client");
|
|
2924
2940
|
this.client = axios.create({
|
|
2925
|
-
validateStatus: (
|
|
2941
|
+
validateStatus: (status2) => status2 >= 200 && status2 < 300 || status2 === 304
|
|
2926
2942
|
});
|
|
2927
2943
|
new AxiosCache(this.client);
|
|
2928
2944
|
axiosRetry(this.client, {
|