@datarecce/ui 0.1.23 → 0.1.24
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/dist/{RecceCheckContext-_xzNlnbJ.js → RecceCheckContext-Cb41gigE.js} +4 -3
- package/dist/RecceCheckContext-Cb41gigE.js.map +1 -0
- package/dist/{RecceCheckContext-DIQjrvH8.mjs → RecceCheckContext-CzsuuXxT.mjs} +4 -3
- package/dist/RecceCheckContext-CzsuuXxT.mjs.map +1 -0
- package/dist/api.d.mts +2 -2
- package/dist/api.d.ts +2 -2
- package/dist/api.js +3 -2
- package/dist/api.mjs +3 -3
- package/dist/{components-CfY72Lq2.mjs → components-BHxcVq0D.mjs} +244 -208
- package/dist/components-BHxcVq0D.mjs.map +1 -0
- package/dist/{components-DXbVq9Cw.js → components-Bmc5X473.js} +244 -210
- package/dist/components-Bmc5X473.js.map +1 -0
- package/dist/components.d.mts +1 -1
- package/dist/components.d.ts +1 -1
- package/dist/components.js +4 -4
- package/dist/components.mjs +4 -4
- package/dist/{hooks-C8pyX9m_.mjs → hooks-B0XGswIh.mjs} +3 -3
- package/dist/{hooks-C8pyX9m_.mjs.map → hooks-B0XGswIh.mjs.map} +1 -1
- package/dist/{hooks-C4jkoryM.js → hooks-C99PZcmB.js} +3 -3
- package/dist/{hooks-C4jkoryM.js.map → hooks-C99PZcmB.js.map} +1 -1
- package/dist/hooks.d.mts +2 -2
- package/dist/hooks.d.ts +2 -2
- package/dist/hooks.js +4 -3
- package/dist/hooks.mjs +4 -4
- package/dist/{index-DIHuswfP.d.mts → index-04n48ic2.d.mts} +46 -40
- package/dist/index-04n48ic2.d.mts.map +1 -0
- package/dist/{index-CVPmrztP.d.ts → index-CgyLTrll.d.ts} +115 -109
- package/dist/index-CgyLTrll.d.ts.map +1 -0
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +7 -5
- package/dist/index.mjs +6 -6
- package/dist/{state-AeoqV9ja.js → state-Ct-DP81O.js} +90 -79
- package/dist/state-Ct-DP81O.js.map +1 -0
- package/dist/{state-BbgVwFV2.mjs → state-CwepO01b.mjs} +85 -80
- package/dist/state-CwepO01b.mjs.map +1 -0
- package/dist/types.d.mts +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/{version-MxW9vrDY.js → version-BgsW-hXj.js} +22 -12
- package/dist/version-BgsW-hXj.js.map +1 -0
- package/dist/{version-C2NU3xyx.mjs → version-Bz2CiMHD.mjs} +18 -14
- package/dist/version-Bz2CiMHD.mjs.map +1 -0
- package/package.json +2 -1
- package/dist/RecceCheckContext-DIQjrvH8.mjs.map +0 -1
- package/dist/RecceCheckContext-_xzNlnbJ.js.map +0 -1
- package/dist/components-CfY72Lq2.mjs.map +0 -1
- package/dist/components-DXbVq9Cw.js.map +0 -1
- package/dist/index-CVPmrztP.d.ts.map +0 -1
- package/dist/index-DIHuswfP.d.mts.map +0 -1
- package/dist/state-AeoqV9ja.js.map +0 -1
- package/dist/state-BbgVwFV2.mjs.map +0 -1
- package/dist/version-C2NU3xyx.mjs.map +0 -1
- package/dist/version-MxW9vrDY.js.map +0 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client"
|
|
2
|
-
import { $t as
|
|
2
|
+
import { $t as trackLineageViewRender, At as createLineageDiffCheck, B as IconExport, Bn as darkTheme, Bt as submitRunFromCheck, Cn as selectUpstream, En as getCll, Et as ScreenshotDataGrid, Ft as cancelRun, G as deltaPercentageString, Gt as LINEAGE_SELECTION_ACTION, H as IconInfo, Hn as token, Ht as EXPLORE_ACTION, I as useRecceActionContext, J as mergeKeys, Jt as trackEnvironmentConfig, Kt as trackColumnLevelLineage, L as useAppLocation, Ln as toaster, Lt as listRuns, M as useLineageViewContext, Mn as axiosClient, Mt as submitQueryBase, N as useLineageViewContextSafe, Nt as submitQueryDiff, Qt as trackLineageSelection, Sn as selectDownstream, St as useApiConfig, Tn as union, Tt as EmptyRowsRenderer, U as IconSave, Vn as lightTheme, Vt as waitRun, W as IconSync, Wt as EXPLORE_SOURCE, Y as mergeKeysWithStatus, Yt as trackExploreAction, Zt as trackHistoryAction, _ as findByRunType, _n as isValueDiffRun, a as saveAs$1, an as trackSingleEnvironment, at as supportsHistogramDiff, bn as isLineageGraphNode, c as createCheckByRun, cn as isHistogramDiffRun, ct as useLineageGraphContext, d as getCheck, dn as isQueryDiffRun, en as trackMultiNodesAction, f as listChecks, fn as isQueryRun, ft as useIdleTimeout, g as useChecks, gn as isValueDiffDetailRun, gt as formatDuration, h as updateCheck, hn as isTopKDiffRun, i as rename, in as trackShareState, j as LineageViewContext, jt as submitQuery, k as createDataGridFromData, ln as isProfileDiffRun, lt as useRunsAggregated, mn as isRowCountRun, nn as trackPreviewChange, on as trackStateAction, ot as useModelColumns_default, p as markAsPresetCheck, pn as isRowCountDiffRun, q as useClipBoardToast, qt as trackCopyToClipboard, r as isStateSyncing, rn as trackPreviewChangeFeedback, s as syncState, t as exportState, tn as trackNavigation, u as deleteCheck, un as isQueryBaseRun, ut as useRecceServerFlag, v as runTypeHasRef, vn as COLUMN_HEIGHT, vt as useRecceInstanceContext, wn as toReactFlow, wt as cacheKeys, xn as layout, yn as isLineageGraphColumnNode, yt as useRecceInstanceInfo, z as IconEdit, zn as colors, zt as submitRun } from "./state-CwepO01b.mjs";
|
|
3
3
|
import { t as RECCE_SUPPORT_CALENDAR_URL } from "./urls-D7PrPolY.mjs";
|
|
4
|
-
import { a as
|
|
5
|
-
import { i as useValueDiffAlertDialog_default, l as defaultSqlQuery, n as useRecceCheckContext, o as useRecceShareStateContext, r as useCheckToast, u as useRecceQueryContext } from "./RecceCheckContext-
|
|
4
|
+
import { a as connectToCloud, c as select, i as fetchUser, l as createSchemaDiffCheck, n as useVersionNumber, o as localStorageKeys, r as fetchGitHubAvatar, s as sessionStorageKeys } from "./version-Bz2CiMHD.mjs";
|
|
5
|
+
import { i as useValueDiffAlertDialog_default, l as defaultSqlQuery, n as useRecceCheckContext, o as useRecceShareStateContext, r as useCheckToast, u as useRecceQueryContext } from "./RecceCheckContext-CzsuuXxT.mjs";
|
|
6
6
|
import { t as DisableTooltipMessages } from "./tooltipMessage-CrXjOmVM.mjs";
|
|
7
7
|
import CssBaseline from "@mui/material/CssBaseline";
|
|
8
8
|
import { ThemeProvider, alpha, useTheme } from "@mui/material/styles";
|
|
@@ -19,7 +19,7 @@ import { ErrorBoundary, FallbackRender } from "@sentry/react";
|
|
|
19
19
|
import ReactSplit, { SplitProps } from "react-split";
|
|
20
20
|
import { Background, BackgroundVariant, BaseEdge, ControlButton, Controls, EdgeProps, Handle, MiniMap, Node, NodeProps, Panel, Position, ReactFlow, ReactFlowProvider, getBezierPath, getNodesBounds, useEdgesState, useNodesState, useReactFlow, useStore } from "@xyflow/react";
|
|
21
21
|
import Divider from "@mui/material/Divider";
|
|
22
|
-
import { AxiosError, AxiosResponse } from "axios";
|
|
22
|
+
import { AxiosError, AxiosInstance, AxiosResponse } from "axios";
|
|
23
23
|
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
|
|
24
24
|
import "@xyflow/react/dist/style.css";
|
|
25
25
|
import { FiArrowRight, FiCopy, FiFrown, FiInfo, FiPackage } from "react-icons/fi";
|
|
@@ -97,8 +97,6 @@ import Card from "@mui/material/Card";
|
|
|
97
97
|
import CardContent from "@mui/material/CardContent";
|
|
98
98
|
import CardHeader from "@mui/material/CardHeader";
|
|
99
99
|
import Badge from "@mui/material/Badge";
|
|
100
|
-
import DisplayModeToggle from "app/(mainComponents)/DisplayModeToggle";
|
|
101
|
-
import RecceVersionBadge from "app/(mainComponents)/RecceVersionBadge";
|
|
102
100
|
|
|
103
101
|
//#region recce-source/js/src/components/ui/mui-provider.tsx
|
|
104
102
|
/**
|
|
@@ -483,13 +481,14 @@ function useImageDownloadModal() {
|
|
|
483
481
|
//#endregion
|
|
484
482
|
//#region recce-source/js/src/lib/hooks/useRun.tsx
|
|
485
483
|
const useRun = (runId) => {
|
|
484
|
+
const { apiClient } = useApiConfig();
|
|
486
485
|
const [isRunning, setIsRunning] = useState(false);
|
|
487
486
|
const [aborting, setAborting] = useState(false);
|
|
488
487
|
const [, refetchRunsAggregated] = useRunsAggregated();
|
|
489
488
|
const { error, data: run } = useQuery({
|
|
490
489
|
queryKey: cacheKeys.run(runId ?? ""),
|
|
491
490
|
queryFn: async () => {
|
|
492
|
-
return await waitRun(runId ?? "", isRunning ? 2 : 0);
|
|
491
|
+
return await waitRun(runId ?? "", isRunning ? 2 : 0, apiClient);
|
|
493
492
|
},
|
|
494
493
|
enabled: !!runId,
|
|
495
494
|
refetchInterval: isRunning ? 50 : false,
|
|
@@ -513,8 +512,8 @@ const useRun = (runId) => {
|
|
|
513
512
|
const onCancel = useCallback(async () => {
|
|
514
513
|
setAborting(true);
|
|
515
514
|
if (!runId) return;
|
|
516
|
-
await cancelRun(runId);
|
|
517
|
-
}, [runId]);
|
|
515
|
+
await cancelRun(runId, apiClient);
|
|
516
|
+
}, [runId, apiClient]);
|
|
518
517
|
let RunResultView;
|
|
519
518
|
if (run && runTypeHasRef(run.type)) RunResultView = findByRunType(run.type).RunResultView;
|
|
520
519
|
return {
|
|
@@ -4252,6 +4251,7 @@ const QueryForm = ({ defaultPrimaryKeys, onPrimaryKeysChange, ...props }) => {
|
|
|
4252
4251
|
//#region recce-source/js/src/components/AuthModal/AuthModal.tsx
|
|
4253
4252
|
function AuthModal({ handleParentClose, parentOpen = false, ignoreCookie = false, variant = "auth" }) {
|
|
4254
4253
|
const { authed } = useRecceInstanceContext();
|
|
4254
|
+
const { apiClient } = useApiConfig();
|
|
4255
4255
|
const [open, setOpen] = useState(parentOpen || !authed);
|
|
4256
4256
|
const authStateCookieValue = Cookies.get("authState") ?? "pending";
|
|
4257
4257
|
const [authState, setAuthState] = useState(ignoreCookie ? "pending" : authStateCookieValue);
|
|
@@ -4334,7 +4334,7 @@ function AuthModal({ handleParentClose, parentOpen = false, ignoreCookie = false
|
|
|
4334
4334
|
},
|
|
4335
4335
|
onClick: async () => {
|
|
4336
4336
|
setAuthState("authenticating");
|
|
4337
|
-
const { connection_url } = await connectToCloud();
|
|
4337
|
+
const { connection_url } = await connectToCloud(apiClient);
|
|
4338
4338
|
window.open(connection_url, "_blank");
|
|
4339
4339
|
},
|
|
4340
4340
|
children: [
|
|
@@ -5020,6 +5020,7 @@ function AddToCheckButton({ runId, viewOptions }) {
|
|
|
5020
5020
|
const { error, run } = useRun(runId);
|
|
5021
5021
|
const queryClient = useQueryClient();
|
|
5022
5022
|
const [, setLocation] = useAppLocation();
|
|
5023
|
+
const { apiClient } = useApiConfig();
|
|
5023
5024
|
const checkId = run?.check_id;
|
|
5024
5025
|
const handleGoToCheck = useCallback(() => {
|
|
5025
5026
|
if (!checkId) return;
|
|
@@ -5027,14 +5028,15 @@ function AddToCheckButton({ runId, viewOptions }) {
|
|
|
5027
5028
|
}, [checkId, setLocation]);
|
|
5028
5029
|
const handleAddToChecklist = useCallback(async () => {
|
|
5029
5030
|
if (!runId) return;
|
|
5030
|
-
const check = await createCheckByRun(runId, viewOptions);
|
|
5031
|
+
const check = await createCheckByRun(runId, viewOptions, apiClient);
|
|
5031
5032
|
await queryClient.invalidateQueries({ queryKey: cacheKeys.checks() });
|
|
5032
5033
|
setLocation(`/checks/?id=${check.check_id}`);
|
|
5033
5034
|
}, [
|
|
5034
5035
|
runId,
|
|
5035
5036
|
setLocation,
|
|
5036
5037
|
queryClient,
|
|
5037
|
-
viewOptions
|
|
5038
|
+
viewOptions,
|
|
5039
|
+
apiClient
|
|
5038
5040
|
]);
|
|
5039
5041
|
if (featureToggles.disableUpdateChecklist) return /* @__PURE__ */ jsx(Fragment$1, {});
|
|
5040
5042
|
if (run?.check_id) return /* @__PURE__ */ jsx(Button, {
|
|
@@ -5192,15 +5194,16 @@ function SandboxView({ isOpen, onClose, current }) {
|
|
|
5192
5194
|
const { showRunId, clearRunResult } = useRecceActionContext();
|
|
5193
5195
|
const { primaryKeys, setPrimaryKeys } = useRecceQueryContext();
|
|
5194
5196
|
const { data: flags, isLoading } = useRecceServerFlag();
|
|
5197
|
+
const { apiClient } = useApiConfig();
|
|
5195
5198
|
const queryFn = async () => {
|
|
5196
5199
|
const sqlTemplate = modifiedCode;
|
|
5197
5200
|
const { run_id } = await submitQueryDiff({
|
|
5198
5201
|
current_model: current?.name ?? "",
|
|
5199
5202
|
primary_keys: primaryKeys,
|
|
5200
5203
|
sql_template: sqlTemplate
|
|
5201
|
-
}, { nowait: true });
|
|
5204
|
+
}, { nowait: true }, apiClient);
|
|
5202
5205
|
showRunId(run_id);
|
|
5203
|
-
return await waitRun(run_id);
|
|
5206
|
+
return await waitRun(run_id, void 0, apiClient);
|
|
5204
5207
|
};
|
|
5205
5208
|
const { mutate: runQuery, isPending } = useMutation({
|
|
5206
5209
|
mutationFn: queryFn,
|
|
@@ -5678,12 +5681,17 @@ function ExploreChangeMenuButton({ node, baseColumns, currentColumns, disableRea
|
|
|
5678
5681
|
const { envInfo, isActionAvailable } = useLineageGraphContext();
|
|
5679
5682
|
const { featureToggles } = useRecceInstanceContext();
|
|
5680
5683
|
const { primaryKey } = useModelColumns_default(node.data.name);
|
|
5684
|
+
const { apiClient } = useApiConfig();
|
|
5681
5685
|
const metadataOnly = featureToggles.mode === "metadata only";
|
|
5682
5686
|
const isAddedOrRemoved = node.data.changeStatus === "added" || node.data.changeStatus === "removed";
|
|
5683
5687
|
const addSchemaCheck = useCallback(async () => {
|
|
5684
5688
|
const nodeId = node.id;
|
|
5685
|
-
setLocation(`/checks/?id=${(await createSchemaDiffCheck({ node_id: nodeId })).check_id}`);
|
|
5686
|
-
}, [
|
|
5689
|
+
setLocation(`/checks/?id=${(await createSchemaDiffCheck({ node_id: nodeId }, apiClient)).check_id}`);
|
|
5690
|
+
}, [
|
|
5691
|
+
node,
|
|
5692
|
+
setLocation,
|
|
5693
|
+
apiClient
|
|
5694
|
+
]);
|
|
5687
5695
|
const formattedColumns = formatSelectColumns(baseColumns, currentColumns);
|
|
5688
5696
|
let query = `select * from {{ ref("${node.data.name}") }}`;
|
|
5689
5697
|
if (formattedColumns.length) query = `select \n ${formattedColumns.join("\n ")}\nfrom {{ ref("${node.data.name}") }}`;
|
|
@@ -6150,6 +6158,7 @@ const initValue = {
|
|
|
6150
6158
|
actions: {}
|
|
6151
6159
|
};
|
|
6152
6160
|
const useMultiNodesAction = (nodes, { onActionStarted, onActionNodeUpdated, onActionCompleted }) => {
|
|
6161
|
+
const { apiClient } = useApiConfig();
|
|
6153
6162
|
const actionState = useRef({ ...initValue }).current;
|
|
6154
6163
|
const { showRunId } = useRecceActionContext();
|
|
6155
6164
|
const submitRunForNodes = async (type, skip, getParams) => {
|
|
@@ -6179,12 +6188,12 @@ const useMultiNodesAction = (nodes, { onActionStarted, onActionNodeUpdated, onAc
|
|
|
6179
6188
|
}
|
|
6180
6189
|
const params = getParams(candidates);
|
|
6181
6190
|
try {
|
|
6182
|
-
const { run_id } = await submitRun(type, params, { nowait: true });
|
|
6191
|
+
const { run_id } = await submitRun(type, params, { nowait: true }, apiClient);
|
|
6183
6192
|
showRunId(run_id);
|
|
6184
6193
|
actionState.currentRun = { run_id };
|
|
6185
6194
|
actionState.total = 1;
|
|
6186
6195
|
for (;;) {
|
|
6187
|
-
const run = await waitRun(run_id, 2);
|
|
6196
|
+
const run = await waitRun(run_id, 2, apiClient);
|
|
6188
6197
|
actionState.currentRun = run;
|
|
6189
6198
|
const status = run.error ? "failure" : run.result ? "success" : "running";
|
|
6190
6199
|
for (const node of candidates) {
|
|
@@ -6233,7 +6242,7 @@ const useMultiNodesAction = (nodes, { onActionStarted, onActionNodeUpdated, onAc
|
|
|
6233
6242
|
};
|
|
6234
6243
|
onActionNodeUpdated(node);
|
|
6235
6244
|
} else try {
|
|
6236
|
-
const { run_id } = await submitRun(type, params, { nowait: true });
|
|
6245
|
+
const { run_id } = await submitRun(type, params, { nowait: true }, apiClient);
|
|
6237
6246
|
actionState.currentRun = { run_id };
|
|
6238
6247
|
actions[node.id] = {
|
|
6239
6248
|
mode,
|
|
@@ -6241,7 +6250,7 @@ const useMultiNodesAction = (nodes, { onActionStarted, onActionNodeUpdated, onAc
|
|
|
6241
6250
|
};
|
|
6242
6251
|
onActionNodeUpdated(node);
|
|
6243
6252
|
for (;;) {
|
|
6244
|
-
const run = await waitRun(run_id, 2);
|
|
6253
|
+
const run = await waitRun(run_id, 2, apiClient);
|
|
6245
6254
|
actionState.currentRun = run;
|
|
6246
6255
|
const status = run.error ? "failure" : run.result ? "success" : "running";
|
|
6247
6256
|
actions[node.id] = {
|
|
@@ -6327,17 +6336,17 @@ const useMultiNodesAction = (nodes, { onActionStarted, onActionNodeUpdated, onAc
|
|
|
6327
6336
|
});
|
|
6328
6337
|
};
|
|
6329
6338
|
const addLineageDiffCheck = async () => {
|
|
6330
|
-
return await createLineageDiffCheck({ node_ids: nodes.map((node) => node.id) });
|
|
6339
|
+
return await createLineageDiffCheck({ node_ids: nodes.map((node) => node.id) }, apiClient);
|
|
6331
6340
|
};
|
|
6332
6341
|
const addSchemaDiffCheck = async () => {
|
|
6333
6342
|
let check;
|
|
6334
|
-
if (nodes.length === 1) check = await createSchemaDiffCheck({ node_id: nodes[0].id });
|
|
6335
|
-
else check = await createSchemaDiffCheck({ node_id: nodes.map((node) => node.id) });
|
|
6343
|
+
if (nodes.length === 1) check = await createSchemaDiffCheck({ node_id: nodes[0].id }, apiClient);
|
|
6344
|
+
else check = await createSchemaDiffCheck({ node_id: nodes.map((node) => node.id) }, apiClient);
|
|
6336
6345
|
return check;
|
|
6337
6346
|
};
|
|
6338
6347
|
const cancel = async () => {
|
|
6339
6348
|
actionState.status = "canceling";
|
|
6340
|
-
if (actionState.currentRun?.run_id) await cancelRun(actionState.currentRun.run_id);
|
|
6349
|
+
if (actionState.currentRun?.run_id) await cancelRun(actionState.currentRun.run_id, apiClient);
|
|
6341
6350
|
};
|
|
6342
6351
|
const reset = () => {
|
|
6343
6352
|
Object.assign(actionState, initValue);
|
|
@@ -6400,6 +6409,7 @@ const useNavToCheck = () => {
|
|
|
6400
6409
|
};
|
|
6401
6410
|
function PrivateLineageView({ interactive = false, ...props }, ref) {
|
|
6402
6411
|
const { isDark } = useThemeColors();
|
|
6412
|
+
const { apiClient } = useApiConfig();
|
|
6403
6413
|
const reactFlow = useReactFlow();
|
|
6404
6414
|
const refResize = useRef(null);
|
|
6405
6415
|
const { successToast, failToast } = useClipBoardToast();
|
|
@@ -6447,7 +6457,7 @@ function PrivateLineageView({ interactive = false, ...props }, ref) {
|
|
|
6447
6457
|
}, []);
|
|
6448
6458
|
const cllHistory = useRef([]).current;
|
|
6449
6459
|
const [cll, setCll] = useState(void 0);
|
|
6450
|
-
const actionGetCll = useMutation({ mutationFn: getCll });
|
|
6460
|
+
const actionGetCll = useMutation({ mutationFn: (input) => getCll(input, apiClient) });
|
|
6451
6461
|
const [nodeColumnSetMap, setNodeColumSetMap] = useState({});
|
|
6452
6462
|
const findNodeByName = useCallback((name) => {
|
|
6453
6463
|
return nodes.filter(isLineageGraphNode).find((n) => n.data.name === name);
|
|
@@ -6550,7 +6560,7 @@ function PrivateLineageView({ interactive = false, ...props }, ref) {
|
|
|
6550
6560
|
exclude: newViewOptions.exclude,
|
|
6551
6561
|
packages: newViewOptions.packages,
|
|
6552
6562
|
view_mode: newViewOptions.view_mode
|
|
6553
|
-
})).nodes;
|
|
6563
|
+
}, apiClient)).nodes;
|
|
6554
6564
|
} catch (_$1) {
|
|
6555
6565
|
newViewOptions.view_mode = "all";
|
|
6556
6566
|
filteredNodeIds$1 = (await select({
|
|
@@ -6558,7 +6568,7 @@ function PrivateLineageView({ interactive = false, ...props }, ref) {
|
|
|
6558
6568
|
exclude: newViewOptions.exclude,
|
|
6559
6569
|
packages: newViewOptions.packages,
|
|
6560
6570
|
view_mode: newViewOptions.view_mode
|
|
6561
|
-
})).nodes;
|
|
6571
|
+
}, apiClient)).nodes;
|
|
6562
6572
|
}
|
|
6563
6573
|
setViewOptions(newViewOptions);
|
|
6564
6574
|
}
|
|
@@ -6679,7 +6689,7 @@ function PrivateLineageView({ interactive = false, ...props }, ref) {
|
|
|
6679
6689
|
exclude: newViewOptions.exclude,
|
|
6680
6690
|
packages: newViewOptions.packages,
|
|
6681
6691
|
view_mode: newViewOptions.view_mode
|
|
6682
|
-
});
|
|
6692
|
+
}, apiClient);
|
|
6683
6693
|
newViewOptions = {
|
|
6684
6694
|
...newViewOptions,
|
|
6685
6695
|
column_level_lineage: void 0
|
|
@@ -6961,7 +6971,7 @@ function PrivateLineageView({ interactive = false, ...props }, ref) {
|
|
|
6961
6971
|
selected: "multi"
|
|
6962
6972
|
});
|
|
6963
6973
|
} else if (!focusedNode) {
|
|
6964
|
-
check = await createLineageDiffCheck(viewOptions);
|
|
6974
|
+
check = await createLineageDiffCheck(viewOptions, apiClient);
|
|
6965
6975
|
trackMultiNodesAction({
|
|
6966
6976
|
type: "lineage_diff",
|
|
6967
6977
|
selected: "none"
|
|
@@ -6981,7 +6991,7 @@ function PrivateLineageView({ interactive = false, ...props }, ref) {
|
|
|
6981
6991
|
});
|
|
6982
6992
|
}
|
|
6983
6993
|
} else if (focusedNode) {
|
|
6984
|
-
check = await createSchemaDiffCheck({ node_id: focusedNode.id });
|
|
6994
|
+
check = await createSchemaDiffCheck({ node_id: focusedNode.id }, apiClient);
|
|
6985
6995
|
trackMultiNodesAction({
|
|
6986
6996
|
type: "schema_diff",
|
|
6987
6997
|
selected: "single"
|
|
@@ -6992,7 +7002,7 @@ function PrivateLineageView({ interactive = false, ...props }, ref) {
|
|
|
6992
7002
|
exclude: viewOptions.exclude,
|
|
6993
7003
|
packages: viewOptions.packages,
|
|
6994
7004
|
view_mode: viewOptions.view_mode
|
|
6995
|
-
});
|
|
7005
|
+
}, apiClient);
|
|
6996
7006
|
trackMultiNodesAction({
|
|
6997
7007
|
type: "schema_diff",
|
|
6998
7008
|
selected: "none"
|
|
@@ -7328,6 +7338,7 @@ const QueryPage = () => {
|
|
|
7328
7338
|
if (envInfo?.adapterType === "sqlmesh" && _sqlQuery === defaultSqlQuery) sqlQuery = `select * from db.mymodel`;
|
|
7329
7339
|
if (featureToggles.mode === "read only") sqlQuery = `--- Would like to do query here? Book a demo with us at ${RECCE_SUPPORT_CALENDAR_URL}\n${sqlQuery}`;
|
|
7330
7340
|
const { showRunId } = useRecceActionContext();
|
|
7341
|
+
const { apiClient } = useApiConfig();
|
|
7331
7342
|
const queryFn = async (type) => {
|
|
7332
7343
|
function queryFactory(type$1) {
|
|
7333
7344
|
switch (type$1) {
|
|
@@ -7345,9 +7356,9 @@ const QueryPage = () => {
|
|
|
7345
7356
|
params.primary_keys = primaryKeys;
|
|
7346
7357
|
if (isCustomQueries) params.base_sql_template = baseSqlQuery;
|
|
7347
7358
|
}
|
|
7348
|
-
const { run_id } = await runFn(params, options);
|
|
7359
|
+
const { run_id } = await runFn(params, options, apiClient);
|
|
7349
7360
|
showRunId(run_id);
|
|
7350
|
-
return await waitRun(run_id);
|
|
7361
|
+
return await waitRun(run_id, void 0, apiClient);
|
|
7351
7362
|
};
|
|
7352
7363
|
const { mutate: runQuery, isPending } = useMutation({ mutationFn: queryFn });
|
|
7353
7364
|
const currentSchema = useMemo(() => {
|
|
@@ -7502,9 +7513,10 @@ const ChecklistItem = ({ check, selected, onSelect, onMarkAsApproved }) => {
|
|
|
7502
7513
|
const isDark = useTheme().palette.mode === "dark";
|
|
7503
7514
|
const { featureToggles } = useRecceInstanceContext();
|
|
7504
7515
|
const queryClient = useQueryClient();
|
|
7516
|
+
const { apiClient } = useApiConfig();
|
|
7505
7517
|
const checkId = check.check_id;
|
|
7506
7518
|
const { mutate } = useMutation({
|
|
7507
|
-
mutationFn: (check$1) => updateCheck(checkId, check$1),
|
|
7519
|
+
mutationFn: (check$1) => updateCheck(checkId, check$1, apiClient),
|
|
7508
7520
|
onSuccess: async () => {
|
|
7509
7521
|
await queryClient.invalidateQueries({ queryKey: cacheKeys.check(checkId) });
|
|
7510
7522
|
await queryClient.invalidateQueries({ queryKey: cacheKeys.checks() });
|
|
@@ -7576,8 +7588,9 @@ const CheckList = ({ checks, selectedItem, onCheckSelected, onChecksReordered })
|
|
|
7576
7588
|
const [open, setOpen] = useState(false);
|
|
7577
7589
|
const [pendingApprovalCheckId, setPendingApprovalCheckId] = useState(null);
|
|
7578
7590
|
const queryClient = useQueryClient();
|
|
7591
|
+
const { apiClient } = useApiConfig();
|
|
7579
7592
|
const { mutate: markCheckedByID } = useMutation({
|
|
7580
|
-
mutationFn: (checkId) => updateCheck(checkId, { is_checked: true }),
|
|
7593
|
+
mutationFn: (checkId) => updateCheck(checkId, { is_checked: true }, apiClient),
|
|
7581
7594
|
onSuccess: async (_$1, checkId) => {
|
|
7582
7595
|
await queryClient.invalidateQueries({ queryKey: cacheKeys.check(checkId) });
|
|
7583
7596
|
await queryClient.invalidateQueries({ queryKey: cacheKeys.checks() });
|
|
@@ -7725,20 +7738,22 @@ const CheckList = ({ checks, selectedItem, onCheckSelected, onChecksReordered })
|
|
|
7725
7738
|
* List all events for a check in chronological order.
|
|
7726
7739
|
*
|
|
7727
7740
|
* @param checkId - The check ID
|
|
7741
|
+
* @param client - Optional axios instance for API configuration
|
|
7728
7742
|
* @returns Promise resolving to array of CheckEvent objects
|
|
7729
7743
|
*/
|
|
7730
|
-
async function listCheckEvents(checkId) {
|
|
7731
|
-
return (await
|
|
7744
|
+
async function listCheckEvents(checkId, client = axiosClient) {
|
|
7745
|
+
return (await client.get(`/api/checks/${checkId}/events`)).data;
|
|
7732
7746
|
}
|
|
7733
7747
|
/**
|
|
7734
7748
|
* Create a new comment on a check.
|
|
7735
7749
|
*
|
|
7736
7750
|
* @param checkId - The check ID
|
|
7737
7751
|
* @param content - The comment content (plain text for now, markdown later)
|
|
7752
|
+
* @param client - Optional axios instance for API configuration
|
|
7738
7753
|
* @returns Promise resolving to the created CheckEvent
|
|
7739
7754
|
*/
|
|
7740
|
-
async function createComment(checkId, content) {
|
|
7741
|
-
return (await
|
|
7755
|
+
async function createComment(checkId, content, client = axiosClient) {
|
|
7756
|
+
return (await client.post(`/api/checks/${checkId}/events`, { content })).data;
|
|
7742
7757
|
}
|
|
7743
7758
|
/**
|
|
7744
7759
|
* Update an existing comment.
|
|
@@ -7747,10 +7762,11 @@ async function createComment(checkId, content) {
|
|
|
7747
7762
|
* @param checkId - The check ID
|
|
7748
7763
|
* @param eventId - The event ID of the comment to update
|
|
7749
7764
|
* @param content - The new comment content
|
|
7765
|
+
* @param client - Optional axios instance for API configuration
|
|
7750
7766
|
* @returns Promise resolving to the updated CheckEvent
|
|
7751
7767
|
*/
|
|
7752
|
-
async function updateComment(checkId, eventId, content) {
|
|
7753
|
-
return (await
|
|
7768
|
+
async function updateComment(checkId, eventId, content, client = axiosClient) {
|
|
7769
|
+
return (await client.patch(`/api/checks/${checkId}/events/${eventId}`, { content })).data;
|
|
7754
7770
|
}
|
|
7755
7771
|
/**
|
|
7756
7772
|
* Delete a comment (soft delete).
|
|
@@ -7758,10 +7774,11 @@ async function updateComment(checkId, eventId, content) {
|
|
|
7758
7774
|
*
|
|
7759
7775
|
* @param checkId - The check ID
|
|
7760
7776
|
* @param eventId - The event ID of the comment to delete
|
|
7777
|
+
* @param client - Optional axios instance for API configuration
|
|
7761
7778
|
* @returns Promise resolving when deletion is complete
|
|
7762
7779
|
*/
|
|
7763
|
-
async function deleteComment(checkId, eventId) {
|
|
7764
|
-
await
|
|
7780
|
+
async function deleteComment(checkId, eventId, client = axiosClient) {
|
|
7781
|
+
await client.delete(`/api/checks/${checkId}/events/${eventId}`);
|
|
7765
7782
|
}
|
|
7766
7783
|
/**
|
|
7767
7784
|
* Get the appropriate icon name for an event type.
|
|
@@ -7791,27 +7808,28 @@ const POLLING_INTERVAL = 1e4;
|
|
|
7791
7808
|
function useCheckEvents(checkId, options = {}) {
|
|
7792
7809
|
const { enabled = true } = options;
|
|
7793
7810
|
const queryClient = useQueryClient();
|
|
7811
|
+
const { apiClient } = useApiConfig();
|
|
7794
7812
|
const { data: events, isLoading, error, refetch } = useQuery({
|
|
7795
7813
|
queryKey: cacheKeys.checkEvents(checkId),
|
|
7796
|
-
queryFn: () => listCheckEvents(checkId),
|
|
7814
|
+
queryFn: () => listCheckEvents(checkId, apiClient),
|
|
7797
7815
|
enabled,
|
|
7798
7816
|
refetchInterval: POLLING_INTERVAL,
|
|
7799
7817
|
refetchIntervalInBackground: false
|
|
7800
7818
|
});
|
|
7801
7819
|
const createCommentMutation = useMutation({
|
|
7802
|
-
mutationFn: (content) => createComment(checkId, content),
|
|
7820
|
+
mutationFn: (content) => createComment(checkId, content, apiClient),
|
|
7803
7821
|
onSuccess: async () => {
|
|
7804
7822
|
await queryClient.invalidateQueries({ queryKey: cacheKeys.checkEvents(checkId) });
|
|
7805
7823
|
}
|
|
7806
7824
|
});
|
|
7807
7825
|
const updateCommentMutation = useMutation({
|
|
7808
|
-
mutationFn: ({ eventId, content }) => updateComment(checkId, eventId, content),
|
|
7826
|
+
mutationFn: ({ eventId, content }) => updateComment(checkId, eventId, content, apiClient),
|
|
7809
7827
|
onSuccess: async () => {
|
|
7810
7828
|
await queryClient.invalidateQueries({ queryKey: cacheKeys.checkEvents(checkId) });
|
|
7811
7829
|
}
|
|
7812
7830
|
});
|
|
7813
7831
|
const deleteCommentMutation = useMutation({
|
|
7814
|
-
mutationFn: (eventId) => deleteComment(checkId, eventId),
|
|
7832
|
+
mutationFn: (eventId) => deleteComment(checkId, eventId, apiClient),
|
|
7815
7833
|
onSuccess: async () => {
|
|
7816
7834
|
await queryClient.invalidateQueries({ queryKey: cacheKeys.checkEvents(checkId) });
|
|
7817
7835
|
}
|
|
@@ -8668,10 +8686,11 @@ function TimelineEvent({ event, currentUserId, onEdit, onDelete }) {
|
|
|
8668
8686
|
*/
|
|
8669
8687
|
function CheckTimeline({ checkId }) {
|
|
8670
8688
|
const isDark = useTheme().palette.mode === "dark";
|
|
8689
|
+
const { apiClient } = useApiConfig();
|
|
8671
8690
|
const { events, isLoading, error, createComment: createComment$1, isCreatingComment, updateComment: updateComment$1, deleteComment: deleteComment$1 } = useCheckEvents(checkId);
|
|
8672
8691
|
const { data: currentUser } = useQuery({
|
|
8673
8692
|
queryKey: cacheKeys.user(),
|
|
8674
|
-
queryFn: fetchUser,
|
|
8693
|
+
queryFn: () => fetchUser(apiClient),
|
|
8675
8694
|
retry: false
|
|
8676
8695
|
});
|
|
8677
8696
|
const handleCreateComment = (content) => {
|
|
@@ -9056,6 +9075,7 @@ const NodelistItem = ({ node, selected, onSelect, schemaChanged, isDark }) => {
|
|
|
9056
9075
|
};
|
|
9057
9076
|
function PrivateSchemaDiffView({ check }, ref) {
|
|
9058
9077
|
const isDark = useTheme().palette.mode === "dark";
|
|
9078
|
+
const { apiClient } = useApiConfig();
|
|
9059
9079
|
const { lineageGraph } = useLineageGraphContext();
|
|
9060
9080
|
const params = check.params;
|
|
9061
9081
|
const { isLoading, error, data } = useQuery({
|
|
@@ -9065,7 +9085,7 @@ function PrivateSchemaDiffView({ check }, ref) {
|
|
|
9065
9085
|
exclude: params.exclude,
|
|
9066
9086
|
packages: params.packages,
|
|
9067
9087
|
view_mode: params.view_mode
|
|
9068
|
-
}),
|
|
9088
|
+
}, apiClient),
|
|
9069
9089
|
refetchOnMount: true,
|
|
9070
9090
|
enabled: !params.node_id
|
|
9071
9091
|
});
|
|
@@ -9177,6 +9197,7 @@ const SchemaDiffView = forwardRef(PrivateSchemaDiffView);
|
|
|
9177
9197
|
function CheckDetail({ checkId, refreshCheckList }) {
|
|
9178
9198
|
const theme = useTheme();
|
|
9179
9199
|
const isDark = theme.palette.mode === "dark";
|
|
9200
|
+
const { apiClient } = useApiConfig();
|
|
9180
9201
|
const { featureToggles, sessionId } = useRecceInstanceContext();
|
|
9181
9202
|
const { setLatestSelectedCheckId } = useRecceCheckContext();
|
|
9182
9203
|
const { cloudMode } = useLineageGraphContext();
|
|
@@ -9192,7 +9213,7 @@ function CheckDetail({ checkId, refreshCheckList }) {
|
|
|
9192
9213
|
const menuOpen = Boolean(menuAnchorEl);
|
|
9193
9214
|
const { isLoading, error, data: check } = useQuery({
|
|
9194
9215
|
queryKey: cacheKeys.check(checkId),
|
|
9195
|
-
queryFn: async () => getCheck(checkId),
|
|
9216
|
+
queryFn: async () => getCheck(checkId, apiClient),
|
|
9196
9217
|
refetchOnMount: true
|
|
9197
9218
|
});
|
|
9198
9219
|
const trackedRunId = submittedRunId ?? check?.last_run?.run_id;
|
|
@@ -9204,14 +9225,14 @@ function CheckDetail({ checkId, refreshCheckList }) {
|
|
|
9204
9225
|
const isPresetCheck = check?.is_preset ?? false;
|
|
9205
9226
|
const lineageViewRef = useRef(null);
|
|
9206
9227
|
const { mutate } = useMutation({
|
|
9207
|
-
mutationFn: (check$1) => updateCheck(checkId, check$1),
|
|
9228
|
+
mutationFn: (check$1) => updateCheck(checkId, check$1, apiClient),
|
|
9208
9229
|
onSuccess: async () => {
|
|
9209
9230
|
await queryClient.invalidateQueries({ queryKey: cacheKeys.check(checkId) });
|
|
9210
9231
|
await queryClient.invalidateQueries({ queryKey: cacheKeys.checks() });
|
|
9211
9232
|
}
|
|
9212
9233
|
});
|
|
9213
9234
|
const { mutate: handleDelete } = useMutation({
|
|
9214
|
-
mutationFn: () => deleteCheck(checkId),
|
|
9235
|
+
mutationFn: () => deleteCheck(checkId, apiClient),
|
|
9215
9236
|
onSuccess: async () => {
|
|
9216
9237
|
setLatestSelectedCheckId("");
|
|
9217
9238
|
await queryClient.invalidateQueries({ queryKey: cacheKeys.checks() });
|
|
@@ -9221,7 +9242,7 @@ function CheckDetail({ checkId, refreshCheckList }) {
|
|
|
9221
9242
|
const { mutate: handleMarkAsPresetCheck, isPending: isMarkingAsPreset } = useMutation({
|
|
9222
9243
|
mutationFn: async () => {
|
|
9223
9244
|
if (!check) throw new Error("Check not found");
|
|
9224
|
-
return await markAsPresetCheck(checkId);
|
|
9245
|
+
return await markAsPresetCheck(checkId, apiClient);
|
|
9225
9246
|
},
|
|
9226
9247
|
onSuccess: async () => {
|
|
9227
9248
|
successToast("Check marked as preset successfully");
|
|
@@ -9233,20 +9254,21 @@ function CheckDetail({ checkId, refreshCheckList }) {
|
|
|
9233
9254
|
});
|
|
9234
9255
|
const handleRerun = useCallback(async () => {
|
|
9235
9256
|
if (!check?.type) return;
|
|
9236
|
-
setSubmittedRunId((await submitRunFromCheck(checkId, { nowait: true })).run_id);
|
|
9257
|
+
setSubmittedRunId((await submitRunFromCheck(checkId, { nowait: true }, apiClient)).run_id);
|
|
9237
9258
|
await queryClient.invalidateQueries({ queryKey: cacheKeys.check(checkId) });
|
|
9238
9259
|
if (refreshCheckList) refreshCheckList();
|
|
9239
9260
|
}, [
|
|
9240
9261
|
check,
|
|
9241
9262
|
checkId,
|
|
9242
9263
|
queryClient,
|
|
9243
|
-
refreshCheckList
|
|
9264
|
+
refreshCheckList,
|
|
9265
|
+
apiClient
|
|
9244
9266
|
]);
|
|
9245
9267
|
const handleCancel = useCallback(async () => {
|
|
9246
9268
|
setAborting(true);
|
|
9247
9269
|
if (!trackedRunId) return;
|
|
9248
|
-
return await cancelRun(trackedRunId);
|
|
9249
|
-
}, [trackedRunId]);
|
|
9270
|
+
return await cancelRun(trackedRunId, apiClient);
|
|
9271
|
+
}, [trackedRunId, apiClient]);
|
|
9250
9272
|
const handleCopy = async () => {
|
|
9251
9273
|
if (!check) return;
|
|
9252
9274
|
const markdown = buildMarkdown(check);
|
|
@@ -9751,8 +9773,9 @@ function buildBody(check) {
|
|
|
9751
9773
|
const CheckEmptyState = () => {
|
|
9752
9774
|
const queryClient = useQueryClient();
|
|
9753
9775
|
const [, setLocation] = useAppLocation();
|
|
9776
|
+
const { apiClient } = useApiConfig();
|
|
9754
9777
|
const { mutate: createSchemaCheck, isPending } = useMutation({
|
|
9755
|
-
mutationFn: () => createSchemaDiffCheck({ select: "state:modified" }),
|
|
9778
|
+
mutationFn: () => createSchemaDiffCheck({ select: "state:modified" }, apiClient),
|
|
9756
9779
|
onSuccess: async (check) => {
|
|
9757
9780
|
await queryClient.invalidateQueries({ queryKey: cacheKeys.checks() });
|
|
9758
9781
|
setLocation(`/checks/?id=${check.check_id}`);
|
|
@@ -9835,9 +9858,10 @@ const CheckEmptyState = () => {
|
|
|
9835
9858
|
//#endregion
|
|
9836
9859
|
//#region recce-source/js/src/components/run/RunPage.tsx
|
|
9837
9860
|
const RunPage = ({ runId }) => {
|
|
9861
|
+
const { apiClient } = useApiConfig();
|
|
9838
9862
|
const { error, data: run } = useQuery({
|
|
9839
9863
|
queryKey: cacheKeys.run(runId),
|
|
9840
|
-
queryFn: async () => waitRun(runId)
|
|
9864
|
+
queryFn: async () => waitRun(runId, void 0, apiClient)
|
|
9841
9865
|
});
|
|
9842
9866
|
let RunResultView;
|
|
9843
9867
|
if (run && runTypeHasRef(run.type)) RunResultView = findByRunType(run.type).RunResultView;
|
|
@@ -9852,10 +9876,11 @@ const RunPage = ({ runId }) => {
|
|
|
9852
9876
|
//#region recce-source/js/src/components/run/RunList.tsx
|
|
9853
9877
|
const RunListItem = ({ run, isSelected, onSelectRun, onAddToChecklist, onGoToCheck }) => {
|
|
9854
9878
|
const { featureToggles } = useRecceInstanceContext();
|
|
9879
|
+
const { apiClient } = useApiConfig();
|
|
9855
9880
|
const { data: fetchedRun } = useQuery({
|
|
9856
9881
|
queryKey: cacheKeys.run(run.run_id),
|
|
9857
9882
|
queryFn: async () => {
|
|
9858
|
-
return await waitRun(run.run_id);
|
|
9883
|
+
return await waitRun(run.run_id, void 0, apiClient);
|
|
9859
9884
|
},
|
|
9860
9885
|
enabled: run.status === "running",
|
|
9861
9886
|
retry: false
|
|
@@ -9959,10 +9984,11 @@ const DateSegmentItem = ({ runAt }) => {
|
|
|
9959
9984
|
};
|
|
9960
9985
|
const RunList = () => {
|
|
9961
9986
|
const { closeHistory } = useRecceActionContext();
|
|
9987
|
+
const { apiClient } = useApiConfig();
|
|
9962
9988
|
const { data: runs, isLoading } = useQuery({
|
|
9963
9989
|
queryKey: cacheKeys.runs(),
|
|
9964
9990
|
queryFn: async () => {
|
|
9965
|
-
return await listRuns();
|
|
9991
|
+
return await listRuns(apiClient);
|
|
9966
9992
|
},
|
|
9967
9993
|
retry: false
|
|
9968
9994
|
});
|
|
@@ -10026,6 +10052,7 @@ const RunList = () => {
|
|
|
10026
10052
|
function DateDividedRunHistoryItem({ run, previousDate }) {
|
|
10027
10053
|
const [, setLocation] = useAppLocation();
|
|
10028
10054
|
const queryClient = useQueryClient();
|
|
10055
|
+
const { apiClient } = useApiConfig();
|
|
10029
10056
|
const { showRunId, runId } = useRecceActionContext();
|
|
10030
10057
|
const currentDate = new Date(run.run_at).toDateString();
|
|
10031
10058
|
const shouldRenderDateSegment = previousDate != null && previousDate !== currentDate;
|
|
@@ -10034,10 +10061,14 @@ function DateDividedRunHistoryItem({ run, previousDate }) {
|
|
|
10034
10061
|
showRunId(runId$1, false);
|
|
10035
10062
|
};
|
|
10036
10063
|
const handleAddToChecklist = useCallback(async (clickedRunId) => {
|
|
10037
|
-
const check = await createCheckByRun(clickedRunId);
|
|
10064
|
+
const check = await createCheckByRun(clickedRunId, void 0, apiClient);
|
|
10038
10065
|
await queryClient.invalidateQueries({ queryKey: cacheKeys.checks() });
|
|
10039
10066
|
setLocation(`/checks/?id=${check.check_id}`);
|
|
10040
|
-
}, [
|
|
10067
|
+
}, [
|
|
10068
|
+
setLocation,
|
|
10069
|
+
queryClient,
|
|
10070
|
+
apiClient
|
|
10071
|
+
]);
|
|
10041
10072
|
const handleGoToCheck = useCallback((checkId) => {
|
|
10042
10073
|
trackHistoryAction({ name: "go_to_check" });
|
|
10043
10074
|
setLocation(`/checks/?id=${checkId}`);
|
|
@@ -10405,9 +10436,10 @@ function SummaryView() {
|
|
|
10405
10436
|
//#endregion
|
|
10406
10437
|
//#region recce-source/js/src/components/app/AvatarDropdown.tsx
|
|
10407
10438
|
function AvatarDropdown() {
|
|
10439
|
+
const { apiClient } = useApiConfig();
|
|
10408
10440
|
const { data: user, isLoading, error } = useQuery({
|
|
10409
10441
|
queryKey: cacheKeys.user(),
|
|
10410
|
-
queryFn: fetchUser,
|
|
10442
|
+
queryFn: () => fetchUser(apiClient),
|
|
10411
10443
|
retry: false
|
|
10412
10444
|
});
|
|
10413
10445
|
const { data: avatarUrl } = useQuery({
|
|
@@ -10556,6 +10588,142 @@ function IdleTimeoutBadge() {
|
|
|
10556
10588
|
});
|
|
10557
10589
|
}
|
|
10558
10590
|
|
|
10591
|
+
//#endregion
|
|
10592
|
+
//#region recce-source/js/app/(mainComponents)/DisplayModeToggle.tsx
|
|
10593
|
+
/**
|
|
10594
|
+
* Display Mode Toggle - switches between light and dark themes
|
|
10595
|
+
*
|
|
10596
|
+
* Uses next-themes to persist the user's preference.
|
|
10597
|
+
* Default is light theme, with future support for system preference.
|
|
10598
|
+
*/
|
|
10599
|
+
function DisplayModeToggle() {
|
|
10600
|
+
const { setTheme, resolvedTheme } = useTheme$1();
|
|
10601
|
+
const [mounted, setMounted] = useState(false);
|
|
10602
|
+
useEffect(() => {
|
|
10603
|
+
setMounted(true);
|
|
10604
|
+
}, []);
|
|
10605
|
+
const toggleTheme = () => {
|
|
10606
|
+
setTheme(resolvedTheme === "dark" ? "light" : "dark");
|
|
10607
|
+
};
|
|
10608
|
+
if (!mounted) return /* @__PURE__ */ jsx(IconButton, {
|
|
10609
|
+
size: "small",
|
|
10610
|
+
sx: {
|
|
10611
|
+
color: "rgba(255, 255, 255, 0.8)",
|
|
10612
|
+
"&:hover": { bgcolor: "rgba(255, 255, 255, 0.1)" }
|
|
10613
|
+
},
|
|
10614
|
+
disabled: true,
|
|
10615
|
+
children: /* @__PURE__ */ jsx(PiSun, { style: {
|
|
10616
|
+
width: 18,
|
|
10617
|
+
height: 18
|
|
10618
|
+
} })
|
|
10619
|
+
});
|
|
10620
|
+
const isDark = resolvedTheme === "dark";
|
|
10621
|
+
return /* @__PURE__ */ jsx(MuiTooltip, {
|
|
10622
|
+
title: isDark ? "Switch to light mode" : "Switch to dark mode",
|
|
10623
|
+
children: /* @__PURE__ */ jsx(IconButton, {
|
|
10624
|
+
size: "small",
|
|
10625
|
+
onClick: toggleTheme,
|
|
10626
|
+
sx: {
|
|
10627
|
+
color: "rgba(255, 255, 255, 0.8)",
|
|
10628
|
+
"&:hover": { bgcolor: "rgba(255, 255, 255, 0.1)" }
|
|
10629
|
+
},
|
|
10630
|
+
"aria-label": isDark ? "Switch to light mode" : "Switch to dark mode",
|
|
10631
|
+
children: isDark ? /* @__PURE__ */ jsx(PiSun, { style: {
|
|
10632
|
+
width: 18,
|
|
10633
|
+
height: 18
|
|
10634
|
+
} }) : /* @__PURE__ */ jsx(PiMoon, { style: {
|
|
10635
|
+
width: 18,
|
|
10636
|
+
height: 18
|
|
10637
|
+
} })
|
|
10638
|
+
})
|
|
10639
|
+
});
|
|
10640
|
+
}
|
|
10641
|
+
|
|
10642
|
+
//#endregion
|
|
10643
|
+
//#region recce-source/js/app/(mainComponents)/RecceVersionBadge.tsx
|
|
10644
|
+
function RecceVersionBadge() {
|
|
10645
|
+
const { version, latestVersion } = useVersionNumber();
|
|
10646
|
+
const versionFormatRegex = useMemo(() => /* @__PURE__ */ new RegExp("^\\d+\\.\\d+\\.\\d+$"), []);
|
|
10647
|
+
useEffect(() => {
|
|
10648
|
+
if (versionFormatRegex.test(version) && version !== latestVersion) {
|
|
10649
|
+
const storageKey = "recce-update-toast-shown";
|
|
10650
|
+
if (sessionStorage.getItem(storageKey)) return;
|
|
10651
|
+
setTimeout(() => {
|
|
10652
|
+
toaster.create({
|
|
10653
|
+
id: "recce-update-available",
|
|
10654
|
+
title: "Update available",
|
|
10655
|
+
description: /* @__PURE__ */ jsxs("span", { children: [
|
|
10656
|
+
"A new version of Recce (v",
|
|
10657
|
+
latestVersion,
|
|
10658
|
+
") is available.",
|
|
10659
|
+
/* @__PURE__ */ jsx("br", {}),
|
|
10660
|
+
"Please run",
|
|
10661
|
+
" ",
|
|
10662
|
+
/* @__PURE__ */ jsx(Box, {
|
|
10663
|
+
component: "code",
|
|
10664
|
+
sx: {
|
|
10665
|
+
bgcolor: "grey.200",
|
|
10666
|
+
px: .5,
|
|
10667
|
+
py: .25,
|
|
10668
|
+
borderRadius: .5,
|
|
10669
|
+
fontFamily: "monospace",
|
|
10670
|
+
fontSize: "0.875em"
|
|
10671
|
+
},
|
|
10672
|
+
children: "pip install --upgrade recce"
|
|
10673
|
+
}),
|
|
10674
|
+
" ",
|
|
10675
|
+
"to update Recce.",
|
|
10676
|
+
/* @__PURE__ */ jsx("br", {}),
|
|
10677
|
+
/* @__PURE__ */ jsx(Link, {
|
|
10678
|
+
sx: {
|
|
10679
|
+
color: "primary.main",
|
|
10680
|
+
fontWeight: "bold",
|
|
10681
|
+
"&:hover": { textDecoration: "underline" }
|
|
10682
|
+
},
|
|
10683
|
+
href: `https://github.com/DataRecce/recce/releases/tag/v${latestVersion}`,
|
|
10684
|
+
target: "_blank",
|
|
10685
|
+
children: "Click here to view the detail of latest release"
|
|
10686
|
+
})
|
|
10687
|
+
] }),
|
|
10688
|
+
duration: 60 * 1e3,
|
|
10689
|
+
closable: true
|
|
10690
|
+
});
|
|
10691
|
+
sessionStorage.setItem(storageKey, "true");
|
|
10692
|
+
}, 0);
|
|
10693
|
+
}
|
|
10694
|
+
}, [
|
|
10695
|
+
version,
|
|
10696
|
+
latestVersion,
|
|
10697
|
+
versionFormatRegex
|
|
10698
|
+
]);
|
|
10699
|
+
if (!versionFormatRegex.test(version)) return /* @__PURE__ */ jsx(Typography, {
|
|
10700
|
+
component: "span",
|
|
10701
|
+
sx: {
|
|
10702
|
+
fontSize: "sm",
|
|
10703
|
+
color: "rgba(255,255,255,0.8)",
|
|
10704
|
+
textTransform: "uppercase",
|
|
10705
|
+
borderWidth: 1,
|
|
10706
|
+
px: 1,
|
|
10707
|
+
borderRadius: .75
|
|
10708
|
+
},
|
|
10709
|
+
children: version
|
|
10710
|
+
});
|
|
10711
|
+
return /* @__PURE__ */ jsx(Link, {
|
|
10712
|
+
href: `https://github.com/DataRecce/recce/releases/tag/v${version}`,
|
|
10713
|
+
sx: {
|
|
10714
|
+
"&:hover": { textDecoration: "none" },
|
|
10715
|
+
fontSize: "sm",
|
|
10716
|
+
color: "rgba(255,255,255,0.8)",
|
|
10717
|
+
textTransform: "uppercase",
|
|
10718
|
+
borderWidth: 1,
|
|
10719
|
+
px: 1,
|
|
10720
|
+
borderRadius: .75
|
|
10721
|
+
},
|
|
10722
|
+
target: "_blank",
|
|
10723
|
+
children: version
|
|
10724
|
+
});
|
|
10725
|
+
}
|
|
10726
|
+
|
|
10559
10727
|
//#endregion
|
|
10560
10728
|
//#region recce-source/js/app/(mainComponents)/TopBar.tsx
|
|
10561
10729
|
function LinkIcon({ icon: IconComponent, href, sx, ...props }) {
|
|
@@ -10808,6 +10976,7 @@ const useClosePrompt = (prompt) => {
|
|
|
10808
10976
|
const Filename = () => {
|
|
10809
10977
|
const { featureToggles } = useRecceInstanceContext();
|
|
10810
10978
|
const { fileName, cloudMode, isDemoSite, envInfo } = useLineageGraphContext();
|
|
10979
|
+
const { apiClient } = useApiConfig();
|
|
10811
10980
|
const [modalOpen, setModalOpen] = useState(false);
|
|
10812
10981
|
const [overwriteOpen, setOverwriteOpen] = useState(false);
|
|
10813
10982
|
const isStateless = !fileName && !cloudMode && !isDemoSite;
|
|
@@ -10834,11 +11003,11 @@ const Filename = () => {
|
|
|
10834
11003
|
if (method === "save") await saveAs$1({
|
|
10835
11004
|
filename: newFileName,
|
|
10836
11005
|
overwrite: overwrite ?? bypassOverwrite
|
|
10837
|
-
});
|
|
11006
|
+
}, apiClient);
|
|
10838
11007
|
else await rename({
|
|
10839
11008
|
filename: newFileName,
|
|
10840
11009
|
overwrite: overwrite ?? bypassOverwrite
|
|
10841
|
-
});
|
|
11010
|
+
}, apiClient);
|
|
10842
11011
|
toastSuccess(method === "save" ? "Save file successfully" : "Rename file successfully");
|
|
10843
11012
|
await queryClient.invalidateQueries({ queryKey: cacheKeys.lineage() });
|
|
10844
11013
|
if (bypass) localStorage.setItem(localStorageKeys.bypassSaveOverwrite, "true");
|
|
@@ -11062,9 +11231,10 @@ const Filename = () => {
|
|
|
11062
11231
|
//#region recce-source/js/src/components/app/StateExporter.tsx
|
|
11063
11232
|
function StateExporter() {
|
|
11064
11233
|
const { featureToggles } = useRecceInstanceContext();
|
|
11234
|
+
const { apiClient } = useApiConfig();
|
|
11065
11235
|
const handleExport = async () => {
|
|
11066
11236
|
try {
|
|
11067
|
-
const jsonData = await exportState();
|
|
11237
|
+
const jsonData = await exportState(apiClient);
|
|
11068
11238
|
const jsonString = JSON.stringify(jsonData, null, 2);
|
|
11069
11239
|
saveAs(new Blob([jsonString], { type: "application/json" }), `recce-state-${format(/* @__PURE__ */ new Date(), "yyyy-MM-dd-HH-mm-ss")}.json`);
|
|
11070
11240
|
} catch (error) {
|
|
@@ -11231,6 +11401,7 @@ function StateSpinner() {
|
|
|
11231
11401
|
function StateSynchronizer() {
|
|
11232
11402
|
const [isSyncing, setSyncing] = useState(false);
|
|
11233
11403
|
const queryClient = useQueryClient();
|
|
11404
|
+
const { apiClient } = useApiConfig();
|
|
11234
11405
|
const [location, setLocation] = useAppLocation();
|
|
11235
11406
|
const [open, setOpen] = useState(false);
|
|
11236
11407
|
const [syncOption, setSyncOption] = useState("");
|
|
@@ -11239,12 +11410,12 @@ function StateSynchronizer() {
|
|
|
11239
11410
|
const handleSync = useCallback(async (input) => {
|
|
11240
11411
|
setOpen(false);
|
|
11241
11412
|
setSyncing(true);
|
|
11242
|
-
if ((await syncState(input)).status === "conflict") {
|
|
11413
|
+
if ((await syncState(input, apiClient)).status === "conflict") {
|
|
11243
11414
|
setOpen(true);
|
|
11244
11415
|
setSyncing(false);
|
|
11245
11416
|
return;
|
|
11246
11417
|
}
|
|
11247
|
-
while (await isStateSyncing()) await new Promise((resolve) => setTimeout(resolve, 1e3));
|
|
11418
|
+
while (await isStateSyncing(apiClient)) await new Promise((resolve) => setTimeout(resolve, 1e3));
|
|
11248
11419
|
toaster.create({
|
|
11249
11420
|
description: "Sync Completed",
|
|
11250
11421
|
type: "success",
|
|
@@ -11260,7 +11431,8 @@ function StateSynchronizer() {
|
|
|
11260
11431
|
}, [
|
|
11261
11432
|
queryClient,
|
|
11262
11433
|
location,
|
|
11263
|
-
setLocation
|
|
11434
|
+
setLocation,
|
|
11435
|
+
apiClient
|
|
11264
11436
|
]);
|
|
11265
11437
|
if (isSyncing) return /* @__PURE__ */ jsx(StateSpinner, {});
|
|
11266
11438
|
return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(MuiTooltip, {
|
|
@@ -11546,141 +11718,5 @@ function NavBar() {
|
|
|
11546
11718
|
}
|
|
11547
11719
|
|
|
11548
11720
|
//#endregion
|
|
11549
|
-
|
|
11550
|
-
|
|
11551
|
-
* Display Mode Toggle - switches between light and dark themes
|
|
11552
|
-
*
|
|
11553
|
-
* Uses next-themes to persist the user's preference.
|
|
11554
|
-
* Default is light theme, with future support for system preference.
|
|
11555
|
-
*/
|
|
11556
|
-
function DisplayModeToggle$1() {
|
|
11557
|
-
const { setTheme, resolvedTheme } = useTheme$1();
|
|
11558
|
-
const [mounted, setMounted] = useState(false);
|
|
11559
|
-
useEffect(() => {
|
|
11560
|
-
setMounted(true);
|
|
11561
|
-
}, []);
|
|
11562
|
-
const toggleTheme = () => {
|
|
11563
|
-
setTheme(resolvedTheme === "dark" ? "light" : "dark");
|
|
11564
|
-
};
|
|
11565
|
-
if (!mounted) return /* @__PURE__ */ jsx(IconButton, {
|
|
11566
|
-
size: "small",
|
|
11567
|
-
sx: {
|
|
11568
|
-
color: "rgba(255, 255, 255, 0.8)",
|
|
11569
|
-
"&:hover": { bgcolor: "rgba(255, 255, 255, 0.1)" }
|
|
11570
|
-
},
|
|
11571
|
-
disabled: true,
|
|
11572
|
-
children: /* @__PURE__ */ jsx(PiSun, { style: {
|
|
11573
|
-
width: 18,
|
|
11574
|
-
height: 18
|
|
11575
|
-
} })
|
|
11576
|
-
});
|
|
11577
|
-
const isDark = resolvedTheme === "dark";
|
|
11578
|
-
return /* @__PURE__ */ jsx(MuiTooltip, {
|
|
11579
|
-
title: isDark ? "Switch to light mode" : "Switch to dark mode",
|
|
11580
|
-
children: /* @__PURE__ */ jsx(IconButton, {
|
|
11581
|
-
size: "small",
|
|
11582
|
-
onClick: toggleTheme,
|
|
11583
|
-
sx: {
|
|
11584
|
-
color: "rgba(255, 255, 255, 0.8)",
|
|
11585
|
-
"&:hover": { bgcolor: "rgba(255, 255, 255, 0.1)" }
|
|
11586
|
-
},
|
|
11587
|
-
"aria-label": isDark ? "Switch to light mode" : "Switch to dark mode",
|
|
11588
|
-
children: isDark ? /* @__PURE__ */ jsx(PiSun, { style: {
|
|
11589
|
-
width: 18,
|
|
11590
|
-
height: 18
|
|
11591
|
-
} }) : /* @__PURE__ */ jsx(PiMoon, { style: {
|
|
11592
|
-
width: 18,
|
|
11593
|
-
height: 18
|
|
11594
|
-
} })
|
|
11595
|
-
})
|
|
11596
|
-
});
|
|
11597
|
-
}
|
|
11598
|
-
|
|
11599
|
-
//#endregion
|
|
11600
|
-
//#region recce-source/js/app/(mainComponents)/RecceVersionBadge.tsx
|
|
11601
|
-
function RecceVersionBadge$1() {
|
|
11602
|
-
const { version, latestVersion } = useVersionNumber();
|
|
11603
|
-
const versionFormatRegex = useMemo(() => /* @__PURE__ */ new RegExp("^\\d+\\.\\d+\\.\\d+$"), []);
|
|
11604
|
-
useEffect(() => {
|
|
11605
|
-
if (versionFormatRegex.test(version) && version !== latestVersion) {
|
|
11606
|
-
const storageKey = "recce-update-toast-shown";
|
|
11607
|
-
if (sessionStorage.getItem(storageKey)) return;
|
|
11608
|
-
setTimeout(() => {
|
|
11609
|
-
toaster.create({
|
|
11610
|
-
id: "recce-update-available",
|
|
11611
|
-
title: "Update available",
|
|
11612
|
-
description: /* @__PURE__ */ jsxs("span", { children: [
|
|
11613
|
-
"A new version of Recce (v",
|
|
11614
|
-
latestVersion,
|
|
11615
|
-
") is available.",
|
|
11616
|
-
/* @__PURE__ */ jsx("br", {}),
|
|
11617
|
-
"Please run",
|
|
11618
|
-
" ",
|
|
11619
|
-
/* @__PURE__ */ jsx(Box, {
|
|
11620
|
-
component: "code",
|
|
11621
|
-
sx: {
|
|
11622
|
-
bgcolor: "grey.200",
|
|
11623
|
-
px: .5,
|
|
11624
|
-
py: .25,
|
|
11625
|
-
borderRadius: .5,
|
|
11626
|
-
fontFamily: "monospace",
|
|
11627
|
-
fontSize: "0.875em"
|
|
11628
|
-
},
|
|
11629
|
-
children: "pip install --upgrade recce"
|
|
11630
|
-
}),
|
|
11631
|
-
" ",
|
|
11632
|
-
"to update Recce.",
|
|
11633
|
-
/* @__PURE__ */ jsx("br", {}),
|
|
11634
|
-
/* @__PURE__ */ jsx(Link, {
|
|
11635
|
-
sx: {
|
|
11636
|
-
color: "primary.main",
|
|
11637
|
-
fontWeight: "bold",
|
|
11638
|
-
"&:hover": { textDecoration: "underline" }
|
|
11639
|
-
},
|
|
11640
|
-
href: `https://github.com/DataRecce/recce/releases/tag/v${latestVersion}`,
|
|
11641
|
-
target: "_blank",
|
|
11642
|
-
children: "Click here to view the detail of latest release"
|
|
11643
|
-
})
|
|
11644
|
-
] }),
|
|
11645
|
-
duration: 60 * 1e3,
|
|
11646
|
-
closable: true
|
|
11647
|
-
});
|
|
11648
|
-
sessionStorage.setItem(storageKey, "true");
|
|
11649
|
-
}, 0);
|
|
11650
|
-
}
|
|
11651
|
-
}, [
|
|
11652
|
-
version,
|
|
11653
|
-
latestVersion,
|
|
11654
|
-
versionFormatRegex
|
|
11655
|
-
]);
|
|
11656
|
-
if (!versionFormatRegex.test(version)) return /* @__PURE__ */ jsx(Typography, {
|
|
11657
|
-
component: "span",
|
|
11658
|
-
sx: {
|
|
11659
|
-
fontSize: "sm",
|
|
11660
|
-
color: "rgba(255,255,255,0.8)",
|
|
11661
|
-
textTransform: "uppercase",
|
|
11662
|
-
borderWidth: 1,
|
|
11663
|
-
px: 1,
|
|
11664
|
-
borderRadius: .75
|
|
11665
|
-
},
|
|
11666
|
-
children: version
|
|
11667
|
-
});
|
|
11668
|
-
return /* @__PURE__ */ jsx(Link, {
|
|
11669
|
-
href: `https://github.com/DataRecce/recce/releases/tag/v${version}`,
|
|
11670
|
-
sx: {
|
|
11671
|
-
"&:hover": { textDecoration: "none" },
|
|
11672
|
-
fontSize: "sm",
|
|
11673
|
-
color: "rgba(255,255,255,0.8)",
|
|
11674
|
-
textTransform: "uppercase",
|
|
11675
|
-
borderWidth: 1,
|
|
11676
|
-
px: 1,
|
|
11677
|
-
borderRadius: .75
|
|
11678
|
-
},
|
|
11679
|
-
target: "_blank",
|
|
11680
|
-
children: version
|
|
11681
|
-
});
|
|
11682
|
-
}
|
|
11683
|
-
|
|
11684
|
-
//#endregion
|
|
11685
|
-
export { NodeSqlView as A, GraphEdge as B, NodeView as C, SqlEditor_default as D, RunStatusAndDate as E, HistoryToggle as F, MuiProvider as G, HSplit as H, GraphNode as I, mui_provider_default as K, ModelRowCount as L, CodeEditor_default as M, SchemaView as N, QueryForm as O, LineageViewTopBar as P, ResourceTypeTag as R, SetupConnectionBanner as S, RunView as T, VSplit as U, GraphColumnNode as V, ErrorBoundary$1 as W, CheckList as _, IdleTimeoutBadge as a, LineagePage as b, ChangeSummary as c, CheckEmptyState as d, CheckDetail as f, CheckBreadcrumb as g, CheckDescription as h, TopBar as i, DiffEditor_default as j, EnvInfo as k, RunList as l, LineageDiffView as m, DisplayModeToggle$1 as n, SummaryView as o, SchemaDiffView as p, NavBar as r, SchemaSummary as s, RecceVersionBadge$1 as t, RunPage as u, QueryPage as v, RunResultPane as w, LineageView as x, SetupConnectionGuide as y, RowCountDiffTag as z };
|
|
11686
|
-
//# sourceMappingURL=components-CfY72Lq2.mjs.map
|
|
11721
|
+
export { NodeSqlView as A, GraphEdge as B, NodeView as C, SqlEditor_default as D, RunStatusAndDate as E, HistoryToggle as F, MuiProvider as G, HSplit as H, GraphNode as I, mui_provider_default as K, ModelRowCount as L, CodeEditor_default as M, SchemaView as N, QueryForm as O, LineageViewTopBar as P, ResourceTypeTag as R, SetupConnectionBanner as S, RunView as T, VSplit as U, GraphColumnNode as V, ErrorBoundary$1 as W, CheckList as _, IdleTimeoutBadge as a, LineagePage as b, ChangeSummary as c, CheckEmptyState as d, CheckDetail as f, CheckBreadcrumb as g, CheckDescription as h, DisplayModeToggle as i, DiffEditor_default as j, EnvInfo as k, RunList as l, LineageDiffView as m, TopBar as n, SummaryView as o, SchemaDiffView as p, RecceVersionBadge as r, SchemaSummary as s, NavBar as t, RunPage as u, QueryPage as v, RunResultPane as w, LineageView as x, SetupConnectionGuide as y, RowCountDiffTag as z };
|
|
11722
|
+
//# sourceMappingURL=components-BHxcVq0D.mjs.map
|