@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
|
-
const require_state = require('./state-
|
|
2
|
+
const require_state = require('./state-Ct-DP81O.js');
|
|
3
3
|
const require_urls = require('./urls-SazAekCZ.js');
|
|
4
|
-
const require_version = require('./version-
|
|
5
|
-
const require_RecceCheckContext = require('./RecceCheckContext-
|
|
4
|
+
const require_version = require('./version-BgsW-hXj.js');
|
|
5
|
+
const require_RecceCheckContext = require('./RecceCheckContext-Cb41gigE.js');
|
|
6
6
|
const require_tooltipMessage = require('./tooltipMessage-Dbi1kkfi.js');
|
|
7
7
|
let _mui_material_CssBaseline = require("@mui/material/CssBaseline");
|
|
8
8
|
_mui_material_CssBaseline = require_state.__toESM(_mui_material_CssBaseline);
|
|
@@ -153,10 +153,6 @@ let _mui_material_CardHeader = require("@mui/material/CardHeader");
|
|
|
153
153
|
_mui_material_CardHeader = require_state.__toESM(_mui_material_CardHeader);
|
|
154
154
|
let _mui_material_Badge = require("@mui/material/Badge");
|
|
155
155
|
_mui_material_Badge = require_state.__toESM(_mui_material_Badge);
|
|
156
|
-
let app__mainComponents__DisplayModeToggle = require("app/(mainComponents)/DisplayModeToggle");
|
|
157
|
-
app__mainComponents__DisplayModeToggle = require_state.__toESM(app__mainComponents__DisplayModeToggle);
|
|
158
|
-
let app__mainComponents__RecceVersionBadge = require("app/(mainComponents)/RecceVersionBadge");
|
|
159
|
-
app__mainComponents__RecceVersionBadge = require_state.__toESM(app__mainComponents__RecceVersionBadge);
|
|
160
156
|
|
|
161
157
|
//#region recce-source/js/src/components/ui/mui-provider.tsx
|
|
162
158
|
/**
|
|
@@ -2551,13 +2547,14 @@ function useImageDownloadModal() {
|
|
|
2551
2547
|
//#endregion
|
|
2552
2548
|
//#region recce-source/js/src/lib/hooks/useRun.tsx
|
|
2553
2549
|
const useRun = (runId) => {
|
|
2550
|
+
const { apiClient } = require_state.useApiConfig();
|
|
2554
2551
|
const [isRunning, setIsRunning] = (0, react.useState)(false);
|
|
2555
2552
|
const [aborting, setAborting] = (0, react.useState)(false);
|
|
2556
2553
|
const [, refetchRunsAggregated] = require_state.useRunsAggregated();
|
|
2557
2554
|
const { error, data: run } = (0, _tanstack_react_query.useQuery)({
|
|
2558
2555
|
queryKey: require_state.cacheKeys.run(runId ?? ""),
|
|
2559
2556
|
queryFn: async () => {
|
|
2560
|
-
return await require_state.waitRun(runId ?? "", isRunning ? 2 : 0);
|
|
2557
|
+
return await require_state.waitRun(runId ?? "", isRunning ? 2 : 0, apiClient);
|
|
2561
2558
|
},
|
|
2562
2559
|
enabled: !!runId,
|
|
2563
2560
|
refetchInterval: isRunning ? 50 : false,
|
|
@@ -2581,8 +2578,8 @@ const useRun = (runId) => {
|
|
|
2581
2578
|
const onCancel = (0, react.useCallback)(async () => {
|
|
2582
2579
|
setAborting(true);
|
|
2583
2580
|
if (!runId) return;
|
|
2584
|
-
await require_state.cancelRun(runId);
|
|
2585
|
-
}, [runId]);
|
|
2581
|
+
await require_state.cancelRun(runId, apiClient);
|
|
2582
|
+
}, [runId, apiClient]);
|
|
2586
2583
|
let RunResultView;
|
|
2587
2584
|
if (run && require_state.runTypeHasRef(run.type)) RunResultView = require_state.findByRunType(run.type).RunResultView;
|
|
2588
2585
|
return {
|
|
@@ -6320,6 +6317,7 @@ const QueryForm = ({ defaultPrimaryKeys, onPrimaryKeysChange, ...props }) => {
|
|
|
6320
6317
|
//#region recce-source/js/src/components/AuthModal/AuthModal.tsx
|
|
6321
6318
|
function AuthModal({ handleParentClose, parentOpen = false, ignoreCookie = false, variant = "auth" }) {
|
|
6322
6319
|
const { authed } = require_state.useRecceInstanceContext();
|
|
6320
|
+
const { apiClient } = require_state.useApiConfig();
|
|
6323
6321
|
const [open, setOpen] = (0, react.useState)(parentOpen || !authed);
|
|
6324
6322
|
const authStateCookieValue = js_cookie.default.get("authState") ?? "pending";
|
|
6325
6323
|
const [authState, setAuthState] = (0, react.useState)(ignoreCookie ? "pending" : authStateCookieValue);
|
|
@@ -6402,7 +6400,7 @@ function AuthModal({ handleParentClose, parentOpen = false, ignoreCookie = false
|
|
|
6402
6400
|
},
|
|
6403
6401
|
onClick: async () => {
|
|
6404
6402
|
setAuthState("authenticating");
|
|
6405
|
-
const { connection_url } = await require_version.connectToCloud();
|
|
6403
|
+
const { connection_url } = await require_version.connectToCloud(apiClient);
|
|
6406
6404
|
window.open(connection_url, "_blank");
|
|
6407
6405
|
},
|
|
6408
6406
|
children: [
|
|
@@ -7088,6 +7086,7 @@ function AddToCheckButton({ runId, viewOptions }) {
|
|
|
7088
7086
|
const { error, run } = useRun(runId);
|
|
7089
7087
|
const queryClient = (0, _tanstack_react_query.useQueryClient)();
|
|
7090
7088
|
const [, setLocation] = require_state.useAppLocation();
|
|
7089
|
+
const { apiClient } = require_state.useApiConfig();
|
|
7091
7090
|
const checkId = run?.check_id;
|
|
7092
7091
|
const handleGoToCheck = (0, react.useCallback)(() => {
|
|
7093
7092
|
if (!checkId) return;
|
|
@@ -7095,14 +7094,15 @@ function AddToCheckButton({ runId, viewOptions }) {
|
|
|
7095
7094
|
}, [checkId, setLocation]);
|
|
7096
7095
|
const handleAddToChecklist = (0, react.useCallback)(async () => {
|
|
7097
7096
|
if (!runId) return;
|
|
7098
|
-
const check = await require_state.createCheckByRun(runId, viewOptions);
|
|
7097
|
+
const check = await require_state.createCheckByRun(runId, viewOptions, apiClient);
|
|
7099
7098
|
await queryClient.invalidateQueries({ queryKey: require_state.cacheKeys.checks() });
|
|
7100
7099
|
setLocation(`/checks/?id=${check.check_id}`);
|
|
7101
7100
|
}, [
|
|
7102
7101
|
runId,
|
|
7103
7102
|
setLocation,
|
|
7104
7103
|
queryClient,
|
|
7105
|
-
viewOptions
|
|
7104
|
+
viewOptions,
|
|
7105
|
+
apiClient
|
|
7106
7106
|
]);
|
|
7107
7107
|
if (featureToggles.disableUpdateChecklist) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_jsx_runtime.Fragment, {});
|
|
7108
7108
|
if (run?.check_id) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mui_material_Button.default, {
|
|
@@ -7260,15 +7260,16 @@ function SandboxView({ isOpen, onClose, current }) {
|
|
|
7260
7260
|
const { showRunId, clearRunResult } = require_state.useRecceActionContext();
|
|
7261
7261
|
const { primaryKeys, setPrimaryKeys } = require_RecceCheckContext.useRecceQueryContext();
|
|
7262
7262
|
const { data: flags, isLoading } = require_state.useRecceServerFlag();
|
|
7263
|
+
const { apiClient } = require_state.useApiConfig();
|
|
7263
7264
|
const queryFn = async () => {
|
|
7264
7265
|
const sqlTemplate = modifiedCode;
|
|
7265
7266
|
const { run_id } = await require_state.submitQueryDiff({
|
|
7266
7267
|
current_model: current?.name ?? "",
|
|
7267
7268
|
primary_keys: primaryKeys,
|
|
7268
7269
|
sql_template: sqlTemplate
|
|
7269
|
-
}, { nowait: true });
|
|
7270
|
+
}, { nowait: true }, apiClient);
|
|
7270
7271
|
showRunId(run_id);
|
|
7271
|
-
return await require_state.waitRun(run_id);
|
|
7272
|
+
return await require_state.waitRun(run_id, void 0, apiClient);
|
|
7272
7273
|
};
|
|
7273
7274
|
const { mutate: runQuery, isPending } = (0, _tanstack_react_query.useMutation)({
|
|
7274
7275
|
mutationFn: queryFn,
|
|
@@ -7746,12 +7747,17 @@ function ExploreChangeMenuButton({ node, baseColumns, currentColumns, disableRea
|
|
|
7746
7747
|
const { envInfo, isActionAvailable } = require_state.useLineageGraphContext();
|
|
7747
7748
|
const { featureToggles } = require_state.useRecceInstanceContext();
|
|
7748
7749
|
const { primaryKey } = require_state.useModelColumns_default(node.data.name);
|
|
7750
|
+
const { apiClient } = require_state.useApiConfig();
|
|
7749
7751
|
const metadataOnly = featureToggles.mode === "metadata only";
|
|
7750
7752
|
const isAddedOrRemoved = node.data.changeStatus === "added" || node.data.changeStatus === "removed";
|
|
7751
7753
|
const addSchemaCheck = (0, react.useCallback)(async () => {
|
|
7752
7754
|
const nodeId = node.id;
|
|
7753
|
-
setLocation(`/checks/?id=${(await require_version.createSchemaDiffCheck({ node_id: nodeId })).check_id}`);
|
|
7754
|
-
}, [
|
|
7755
|
+
setLocation(`/checks/?id=${(await require_version.createSchemaDiffCheck({ node_id: nodeId }, apiClient)).check_id}`);
|
|
7756
|
+
}, [
|
|
7757
|
+
node,
|
|
7758
|
+
setLocation,
|
|
7759
|
+
apiClient
|
|
7760
|
+
]);
|
|
7755
7761
|
const formattedColumns = formatSelectColumns(baseColumns, currentColumns);
|
|
7756
7762
|
let query = `select * from {{ ref("${node.data.name}") }}`;
|
|
7757
7763
|
if (formattedColumns.length) query = `select \n ${formattedColumns.join("\n ")}\nfrom {{ ref("${node.data.name}") }}`;
|
|
@@ -8218,6 +8224,7 @@ const initValue = {
|
|
|
8218
8224
|
actions: {}
|
|
8219
8225
|
};
|
|
8220
8226
|
const useMultiNodesAction = (nodes, { onActionStarted, onActionNodeUpdated, onActionCompleted }) => {
|
|
8227
|
+
const { apiClient } = require_state.useApiConfig();
|
|
8221
8228
|
const actionState = (0, react.useRef)({ ...initValue }).current;
|
|
8222
8229
|
const { showRunId } = require_state.useRecceActionContext();
|
|
8223
8230
|
const submitRunForNodes = async (type, skip, getParams) => {
|
|
@@ -8247,12 +8254,12 @@ const useMultiNodesAction = (nodes, { onActionStarted, onActionNodeUpdated, onAc
|
|
|
8247
8254
|
}
|
|
8248
8255
|
const params = getParams(candidates);
|
|
8249
8256
|
try {
|
|
8250
|
-
const { run_id } = await require_state.submitRun(type, params, { nowait: true });
|
|
8257
|
+
const { run_id } = await require_state.submitRun(type, params, { nowait: true }, apiClient);
|
|
8251
8258
|
showRunId(run_id);
|
|
8252
8259
|
actionState.currentRun = { run_id };
|
|
8253
8260
|
actionState.total = 1;
|
|
8254
8261
|
for (;;) {
|
|
8255
|
-
const run = await require_state.waitRun(run_id, 2);
|
|
8262
|
+
const run = await require_state.waitRun(run_id, 2, apiClient);
|
|
8256
8263
|
actionState.currentRun = run;
|
|
8257
8264
|
const status = run.error ? "failure" : run.result ? "success" : "running";
|
|
8258
8265
|
for (const node of candidates) {
|
|
@@ -8301,7 +8308,7 @@ const useMultiNodesAction = (nodes, { onActionStarted, onActionNodeUpdated, onAc
|
|
|
8301
8308
|
};
|
|
8302
8309
|
onActionNodeUpdated(node);
|
|
8303
8310
|
} else try {
|
|
8304
|
-
const { run_id } = await require_state.submitRun(type, params, { nowait: true });
|
|
8311
|
+
const { run_id } = await require_state.submitRun(type, params, { nowait: true }, apiClient);
|
|
8305
8312
|
actionState.currentRun = { run_id };
|
|
8306
8313
|
actions[node.id] = {
|
|
8307
8314
|
mode,
|
|
@@ -8309,7 +8316,7 @@ const useMultiNodesAction = (nodes, { onActionStarted, onActionNodeUpdated, onAc
|
|
|
8309
8316
|
};
|
|
8310
8317
|
onActionNodeUpdated(node);
|
|
8311
8318
|
for (;;) {
|
|
8312
|
-
const run = await require_state.waitRun(run_id, 2);
|
|
8319
|
+
const run = await require_state.waitRun(run_id, 2, apiClient);
|
|
8313
8320
|
actionState.currentRun = run;
|
|
8314
8321
|
const status = run.error ? "failure" : run.result ? "success" : "running";
|
|
8315
8322
|
actions[node.id] = {
|
|
@@ -8395,17 +8402,17 @@ const useMultiNodesAction = (nodes, { onActionStarted, onActionNodeUpdated, onAc
|
|
|
8395
8402
|
});
|
|
8396
8403
|
};
|
|
8397
8404
|
const addLineageDiffCheck = async () => {
|
|
8398
|
-
return await require_state.createLineageDiffCheck({ node_ids: nodes.map((node) => node.id) });
|
|
8405
|
+
return await require_state.createLineageDiffCheck({ node_ids: nodes.map((node) => node.id) }, apiClient);
|
|
8399
8406
|
};
|
|
8400
8407
|
const addSchemaDiffCheck = async () => {
|
|
8401
8408
|
let check;
|
|
8402
|
-
if (nodes.length === 1) check = await require_version.createSchemaDiffCheck({ node_id: nodes[0].id });
|
|
8403
|
-
else check = await require_version.createSchemaDiffCheck({ node_id: nodes.map((node) => node.id) });
|
|
8409
|
+
if (nodes.length === 1) check = await require_version.createSchemaDiffCheck({ node_id: nodes[0].id }, apiClient);
|
|
8410
|
+
else check = await require_version.createSchemaDiffCheck({ node_id: nodes.map((node) => node.id) }, apiClient);
|
|
8404
8411
|
return check;
|
|
8405
8412
|
};
|
|
8406
8413
|
const cancel = async () => {
|
|
8407
8414
|
actionState.status = "canceling";
|
|
8408
|
-
if (actionState.currentRun?.run_id) await require_state.cancelRun(actionState.currentRun.run_id);
|
|
8415
|
+
if (actionState.currentRun?.run_id) await require_state.cancelRun(actionState.currentRun.run_id, apiClient);
|
|
8409
8416
|
};
|
|
8410
8417
|
const reset = () => {
|
|
8411
8418
|
Object.assign(actionState, initValue);
|
|
@@ -8468,6 +8475,7 @@ const useNavToCheck = () => {
|
|
|
8468
8475
|
};
|
|
8469
8476
|
function PrivateLineageView({ interactive = false, ...props }, ref) {
|
|
8470
8477
|
const { isDark } = useThemeColors();
|
|
8478
|
+
const { apiClient } = require_state.useApiConfig();
|
|
8471
8479
|
const reactFlow = (0, _xyflow_react.useReactFlow)();
|
|
8472
8480
|
const refResize = (0, react.useRef)(null);
|
|
8473
8481
|
const { successToast, failToast } = require_state.useClipBoardToast();
|
|
@@ -8515,7 +8523,7 @@ function PrivateLineageView({ interactive = false, ...props }, ref) {
|
|
|
8515
8523
|
}, []);
|
|
8516
8524
|
const cllHistory = (0, react.useRef)([]).current;
|
|
8517
8525
|
const [cll, setCll] = (0, react.useState)(void 0);
|
|
8518
|
-
const actionGetCll = (0, _tanstack_react_query.useMutation)({ mutationFn: require_state.getCll });
|
|
8526
|
+
const actionGetCll = (0, _tanstack_react_query.useMutation)({ mutationFn: (input) => require_state.getCll(input, apiClient) });
|
|
8519
8527
|
const [nodeColumnSetMap, setNodeColumSetMap] = (0, react.useState)({});
|
|
8520
8528
|
const findNodeByName = (0, react.useCallback)((name) => {
|
|
8521
8529
|
return nodes.filter(require_state.isLineageGraphNode).find((n) => n.data.name === name);
|
|
@@ -8618,7 +8626,7 @@ function PrivateLineageView({ interactive = false, ...props }, ref) {
|
|
|
8618
8626
|
exclude: newViewOptions.exclude,
|
|
8619
8627
|
packages: newViewOptions.packages,
|
|
8620
8628
|
view_mode: newViewOptions.view_mode
|
|
8621
|
-
})).nodes;
|
|
8629
|
+
}, apiClient)).nodes;
|
|
8622
8630
|
} catch (_$1) {
|
|
8623
8631
|
newViewOptions.view_mode = "all";
|
|
8624
8632
|
filteredNodeIds$1 = (await require_version.select({
|
|
@@ -8626,7 +8634,7 @@ function PrivateLineageView({ interactive = false, ...props }, ref) {
|
|
|
8626
8634
|
exclude: newViewOptions.exclude,
|
|
8627
8635
|
packages: newViewOptions.packages,
|
|
8628
8636
|
view_mode: newViewOptions.view_mode
|
|
8629
|
-
})).nodes;
|
|
8637
|
+
}, apiClient)).nodes;
|
|
8630
8638
|
}
|
|
8631
8639
|
setViewOptions(newViewOptions);
|
|
8632
8640
|
}
|
|
@@ -8747,7 +8755,7 @@ function PrivateLineageView({ interactive = false, ...props }, ref) {
|
|
|
8747
8755
|
exclude: newViewOptions.exclude,
|
|
8748
8756
|
packages: newViewOptions.packages,
|
|
8749
8757
|
view_mode: newViewOptions.view_mode
|
|
8750
|
-
});
|
|
8758
|
+
}, apiClient);
|
|
8751
8759
|
newViewOptions = {
|
|
8752
8760
|
...newViewOptions,
|
|
8753
8761
|
column_level_lineage: void 0
|
|
@@ -9029,7 +9037,7 @@ function PrivateLineageView({ interactive = false, ...props }, ref) {
|
|
|
9029
9037
|
selected: "multi"
|
|
9030
9038
|
});
|
|
9031
9039
|
} else if (!focusedNode) {
|
|
9032
|
-
check = await require_state.createLineageDiffCheck(viewOptions);
|
|
9040
|
+
check = await require_state.createLineageDiffCheck(viewOptions, apiClient);
|
|
9033
9041
|
require_state.trackMultiNodesAction({
|
|
9034
9042
|
type: "lineage_diff",
|
|
9035
9043
|
selected: "none"
|
|
@@ -9049,7 +9057,7 @@ function PrivateLineageView({ interactive = false, ...props }, ref) {
|
|
|
9049
9057
|
});
|
|
9050
9058
|
}
|
|
9051
9059
|
} else if (focusedNode) {
|
|
9052
|
-
check = await require_version.createSchemaDiffCheck({ node_id: focusedNode.id });
|
|
9060
|
+
check = await require_version.createSchemaDiffCheck({ node_id: focusedNode.id }, apiClient);
|
|
9053
9061
|
require_state.trackMultiNodesAction({
|
|
9054
9062
|
type: "schema_diff",
|
|
9055
9063
|
selected: "single"
|
|
@@ -9060,7 +9068,7 @@ function PrivateLineageView({ interactive = false, ...props }, ref) {
|
|
|
9060
9068
|
exclude: viewOptions.exclude,
|
|
9061
9069
|
packages: viewOptions.packages,
|
|
9062
9070
|
view_mode: viewOptions.view_mode
|
|
9063
|
-
});
|
|
9071
|
+
}, apiClient);
|
|
9064
9072
|
require_state.trackMultiNodesAction({
|
|
9065
9073
|
type: "schema_diff",
|
|
9066
9074
|
selected: "none"
|
|
@@ -9396,6 +9404,7 @@ const QueryPage = () => {
|
|
|
9396
9404
|
if (envInfo?.adapterType === "sqlmesh" && _sqlQuery === require_RecceCheckContext.defaultSqlQuery) sqlQuery = `select * from db.mymodel`;
|
|
9397
9405
|
if (featureToggles.mode === "read only") sqlQuery = `--- Would like to do query here? Book a demo with us at ${require_urls.RECCE_SUPPORT_CALENDAR_URL}\n${sqlQuery}`;
|
|
9398
9406
|
const { showRunId } = require_state.useRecceActionContext();
|
|
9407
|
+
const { apiClient } = require_state.useApiConfig();
|
|
9399
9408
|
const queryFn = async (type) => {
|
|
9400
9409
|
function queryFactory(type$1) {
|
|
9401
9410
|
switch (type$1) {
|
|
@@ -9413,9 +9422,9 @@ const QueryPage = () => {
|
|
|
9413
9422
|
params.primary_keys = primaryKeys;
|
|
9414
9423
|
if (isCustomQueries) params.base_sql_template = baseSqlQuery;
|
|
9415
9424
|
}
|
|
9416
|
-
const { run_id } = await runFn(params, options);
|
|
9425
|
+
const { run_id } = await runFn(params, options, apiClient);
|
|
9417
9426
|
showRunId(run_id);
|
|
9418
|
-
return await require_state.waitRun(run_id);
|
|
9427
|
+
return await require_state.waitRun(run_id, void 0, apiClient);
|
|
9419
9428
|
};
|
|
9420
9429
|
const { mutate: runQuery, isPending } = (0, _tanstack_react_query.useMutation)({ mutationFn: queryFn });
|
|
9421
9430
|
const currentSchema = (0, react.useMemo)(() => {
|
|
@@ -9570,9 +9579,10 @@ const ChecklistItem = ({ check, selected, onSelect, onMarkAsApproved }) => {
|
|
|
9570
9579
|
const isDark = (0, _mui_material_styles.useTheme)().palette.mode === "dark";
|
|
9571
9580
|
const { featureToggles } = require_state.useRecceInstanceContext();
|
|
9572
9581
|
const queryClient = (0, _tanstack_react_query.useQueryClient)();
|
|
9582
|
+
const { apiClient } = require_state.useApiConfig();
|
|
9573
9583
|
const checkId = check.check_id;
|
|
9574
9584
|
const { mutate } = (0, _tanstack_react_query.useMutation)({
|
|
9575
|
-
mutationFn: (check$1) => require_state.updateCheck(checkId, check$1),
|
|
9585
|
+
mutationFn: (check$1) => require_state.updateCheck(checkId, check$1, apiClient),
|
|
9576
9586
|
onSuccess: async () => {
|
|
9577
9587
|
await queryClient.invalidateQueries({ queryKey: require_state.cacheKeys.check(checkId) });
|
|
9578
9588
|
await queryClient.invalidateQueries({ queryKey: require_state.cacheKeys.checks() });
|
|
@@ -9644,8 +9654,9 @@ const CheckList = ({ checks, selectedItem, onCheckSelected, onChecksReordered })
|
|
|
9644
9654
|
const [open, setOpen] = (0, react.useState)(false);
|
|
9645
9655
|
const [pendingApprovalCheckId, setPendingApprovalCheckId] = (0, react.useState)(null);
|
|
9646
9656
|
const queryClient = (0, _tanstack_react_query.useQueryClient)();
|
|
9657
|
+
const { apiClient } = require_state.useApiConfig();
|
|
9647
9658
|
const { mutate: markCheckedByID } = (0, _tanstack_react_query.useMutation)({
|
|
9648
|
-
mutationFn: (checkId) => require_state.updateCheck(checkId, { is_checked: true }),
|
|
9659
|
+
mutationFn: (checkId) => require_state.updateCheck(checkId, { is_checked: true }, apiClient),
|
|
9649
9660
|
onSuccess: async (_$1, checkId) => {
|
|
9650
9661
|
await queryClient.invalidateQueries({ queryKey: require_state.cacheKeys.check(checkId) });
|
|
9651
9662
|
await queryClient.invalidateQueries({ queryKey: require_state.cacheKeys.checks() });
|
|
@@ -9802,20 +9813,22 @@ const CheckList = ({ checks, selectedItem, onCheckSelected, onChecksReordered })
|
|
|
9802
9813
|
* List all events for a check in chronological order.
|
|
9803
9814
|
*
|
|
9804
9815
|
* @param checkId - The check ID
|
|
9816
|
+
* @param client - Optional axios instance for API configuration
|
|
9805
9817
|
* @returns Promise resolving to array of CheckEvent objects
|
|
9806
9818
|
*/
|
|
9807
|
-
async function listCheckEvents(checkId) {
|
|
9808
|
-
return (await
|
|
9819
|
+
async function listCheckEvents(checkId, client = require_state.axiosClient) {
|
|
9820
|
+
return (await client.get(`/api/checks/${checkId}/events`)).data;
|
|
9809
9821
|
}
|
|
9810
9822
|
/**
|
|
9811
9823
|
* Create a new comment on a check.
|
|
9812
9824
|
*
|
|
9813
9825
|
* @param checkId - The check ID
|
|
9814
9826
|
* @param content - The comment content (plain text for now, markdown later)
|
|
9827
|
+
* @param client - Optional axios instance for API configuration
|
|
9815
9828
|
* @returns Promise resolving to the created CheckEvent
|
|
9816
9829
|
*/
|
|
9817
|
-
async function createComment(checkId, content) {
|
|
9818
|
-
return (await
|
|
9830
|
+
async function createComment(checkId, content, client = require_state.axiosClient) {
|
|
9831
|
+
return (await client.post(`/api/checks/${checkId}/events`, { content })).data;
|
|
9819
9832
|
}
|
|
9820
9833
|
/**
|
|
9821
9834
|
* Update an existing comment.
|
|
@@ -9824,10 +9837,11 @@ async function createComment(checkId, content) {
|
|
|
9824
9837
|
* @param checkId - The check ID
|
|
9825
9838
|
* @param eventId - The event ID of the comment to update
|
|
9826
9839
|
* @param content - The new comment content
|
|
9840
|
+
* @param client - Optional axios instance for API configuration
|
|
9827
9841
|
* @returns Promise resolving to the updated CheckEvent
|
|
9828
9842
|
*/
|
|
9829
|
-
async function updateComment(checkId, eventId, content) {
|
|
9830
|
-
return (await
|
|
9843
|
+
async function updateComment(checkId, eventId, content, client = require_state.axiosClient) {
|
|
9844
|
+
return (await client.patch(`/api/checks/${checkId}/events/${eventId}`, { content })).data;
|
|
9831
9845
|
}
|
|
9832
9846
|
/**
|
|
9833
9847
|
* Delete a comment (soft delete).
|
|
@@ -9835,10 +9849,11 @@ async function updateComment(checkId, eventId, content) {
|
|
|
9835
9849
|
*
|
|
9836
9850
|
* @param checkId - The check ID
|
|
9837
9851
|
* @param eventId - The event ID of the comment to delete
|
|
9852
|
+
* @param client - Optional axios instance for API configuration
|
|
9838
9853
|
* @returns Promise resolving when deletion is complete
|
|
9839
9854
|
*/
|
|
9840
|
-
async function deleteComment(checkId, eventId) {
|
|
9841
|
-
await
|
|
9855
|
+
async function deleteComment(checkId, eventId, client = require_state.axiosClient) {
|
|
9856
|
+
await client.delete(`/api/checks/${checkId}/events/${eventId}`);
|
|
9842
9857
|
}
|
|
9843
9858
|
/**
|
|
9844
9859
|
* Get the appropriate icon name for an event type.
|
|
@@ -9868,27 +9883,28 @@ const POLLING_INTERVAL = 1e4;
|
|
|
9868
9883
|
function useCheckEvents(checkId, options = {}) {
|
|
9869
9884
|
const { enabled = true } = options;
|
|
9870
9885
|
const queryClient = (0, _tanstack_react_query.useQueryClient)();
|
|
9886
|
+
const { apiClient } = require_state.useApiConfig();
|
|
9871
9887
|
const { data: events, isLoading, error, refetch } = (0, _tanstack_react_query.useQuery)({
|
|
9872
9888
|
queryKey: require_state.cacheKeys.checkEvents(checkId),
|
|
9873
|
-
queryFn: () => listCheckEvents(checkId),
|
|
9889
|
+
queryFn: () => listCheckEvents(checkId, apiClient),
|
|
9874
9890
|
enabled,
|
|
9875
9891
|
refetchInterval: POLLING_INTERVAL,
|
|
9876
9892
|
refetchIntervalInBackground: false
|
|
9877
9893
|
});
|
|
9878
9894
|
const createCommentMutation = (0, _tanstack_react_query.useMutation)({
|
|
9879
|
-
mutationFn: (content) => createComment(checkId, content),
|
|
9895
|
+
mutationFn: (content) => createComment(checkId, content, apiClient),
|
|
9880
9896
|
onSuccess: async () => {
|
|
9881
9897
|
await queryClient.invalidateQueries({ queryKey: require_state.cacheKeys.checkEvents(checkId) });
|
|
9882
9898
|
}
|
|
9883
9899
|
});
|
|
9884
9900
|
const updateCommentMutation = (0, _tanstack_react_query.useMutation)({
|
|
9885
|
-
mutationFn: ({ eventId, content }) => updateComment(checkId, eventId, content),
|
|
9901
|
+
mutationFn: ({ eventId, content }) => updateComment(checkId, eventId, content, apiClient),
|
|
9886
9902
|
onSuccess: async () => {
|
|
9887
9903
|
await queryClient.invalidateQueries({ queryKey: require_state.cacheKeys.checkEvents(checkId) });
|
|
9888
9904
|
}
|
|
9889
9905
|
});
|
|
9890
9906
|
const deleteCommentMutation = (0, _tanstack_react_query.useMutation)({
|
|
9891
|
-
mutationFn: (eventId) => deleteComment(checkId, eventId),
|
|
9907
|
+
mutationFn: (eventId) => deleteComment(checkId, eventId, apiClient),
|
|
9892
9908
|
onSuccess: async () => {
|
|
9893
9909
|
await queryClient.invalidateQueries({ queryKey: require_state.cacheKeys.checkEvents(checkId) });
|
|
9894
9910
|
}
|
|
@@ -10745,10 +10761,11 @@ function TimelineEvent({ event, currentUserId, onEdit, onDelete }) {
|
|
|
10745
10761
|
*/
|
|
10746
10762
|
function CheckTimeline({ checkId }) {
|
|
10747
10763
|
const isDark = (0, _mui_material_styles.useTheme)().palette.mode === "dark";
|
|
10764
|
+
const { apiClient } = require_state.useApiConfig();
|
|
10748
10765
|
const { events, isLoading, error, createComment: createComment$1, isCreatingComment, updateComment: updateComment$1, deleteComment: deleteComment$1 } = useCheckEvents(checkId);
|
|
10749
10766
|
const { data: currentUser } = (0, _tanstack_react_query.useQuery)({
|
|
10750
10767
|
queryKey: require_state.cacheKeys.user(),
|
|
10751
|
-
queryFn: require_version.fetchUser,
|
|
10768
|
+
queryFn: () => require_version.fetchUser(apiClient),
|
|
10752
10769
|
retry: false
|
|
10753
10770
|
});
|
|
10754
10771
|
const handleCreateComment = (content) => {
|
|
@@ -11133,6 +11150,7 @@ const NodelistItem = ({ node, selected, onSelect, schemaChanged, isDark }) => {
|
|
|
11133
11150
|
};
|
|
11134
11151
|
function PrivateSchemaDiffView({ check }, ref) {
|
|
11135
11152
|
const isDark = (0, _mui_material_styles.useTheme)().palette.mode === "dark";
|
|
11153
|
+
const { apiClient } = require_state.useApiConfig();
|
|
11136
11154
|
const { lineageGraph } = require_state.useLineageGraphContext();
|
|
11137
11155
|
const params = check.params;
|
|
11138
11156
|
const { isLoading, error, data } = (0, _tanstack_react_query.useQuery)({
|
|
@@ -11142,7 +11160,7 @@ function PrivateSchemaDiffView({ check }, ref) {
|
|
|
11142
11160
|
exclude: params.exclude,
|
|
11143
11161
|
packages: params.packages,
|
|
11144
11162
|
view_mode: params.view_mode
|
|
11145
|
-
}),
|
|
11163
|
+
}, apiClient),
|
|
11146
11164
|
refetchOnMount: true,
|
|
11147
11165
|
enabled: !params.node_id
|
|
11148
11166
|
});
|
|
@@ -11254,6 +11272,7 @@ const SchemaDiffView = (0, react.forwardRef)(PrivateSchemaDiffView);
|
|
|
11254
11272
|
function CheckDetail({ checkId, refreshCheckList }) {
|
|
11255
11273
|
const theme = (0, _mui_material_styles.useTheme)();
|
|
11256
11274
|
const isDark = theme.palette.mode === "dark";
|
|
11275
|
+
const { apiClient } = require_state.useApiConfig();
|
|
11257
11276
|
const { featureToggles, sessionId } = require_state.useRecceInstanceContext();
|
|
11258
11277
|
const { setLatestSelectedCheckId } = require_RecceCheckContext.useRecceCheckContext();
|
|
11259
11278
|
const { cloudMode } = require_state.useLineageGraphContext();
|
|
@@ -11269,7 +11288,7 @@ function CheckDetail({ checkId, refreshCheckList }) {
|
|
|
11269
11288
|
const menuOpen = Boolean(menuAnchorEl);
|
|
11270
11289
|
const { isLoading, error, data: check } = (0, _tanstack_react_query.useQuery)({
|
|
11271
11290
|
queryKey: require_state.cacheKeys.check(checkId),
|
|
11272
|
-
queryFn: async () => require_state.getCheck(checkId),
|
|
11291
|
+
queryFn: async () => require_state.getCheck(checkId, apiClient),
|
|
11273
11292
|
refetchOnMount: true
|
|
11274
11293
|
});
|
|
11275
11294
|
const trackedRunId = submittedRunId ?? check?.last_run?.run_id;
|
|
@@ -11281,14 +11300,14 @@ function CheckDetail({ checkId, refreshCheckList }) {
|
|
|
11281
11300
|
const isPresetCheck = check?.is_preset ?? false;
|
|
11282
11301
|
const lineageViewRef = (0, react.useRef)(null);
|
|
11283
11302
|
const { mutate } = (0, _tanstack_react_query.useMutation)({
|
|
11284
|
-
mutationFn: (check$1) => require_state.updateCheck(checkId, check$1),
|
|
11303
|
+
mutationFn: (check$1) => require_state.updateCheck(checkId, check$1, apiClient),
|
|
11285
11304
|
onSuccess: async () => {
|
|
11286
11305
|
await queryClient.invalidateQueries({ queryKey: require_state.cacheKeys.check(checkId) });
|
|
11287
11306
|
await queryClient.invalidateQueries({ queryKey: require_state.cacheKeys.checks() });
|
|
11288
11307
|
}
|
|
11289
11308
|
});
|
|
11290
11309
|
const { mutate: handleDelete } = (0, _tanstack_react_query.useMutation)({
|
|
11291
|
-
mutationFn: () => require_state.deleteCheck(checkId),
|
|
11310
|
+
mutationFn: () => require_state.deleteCheck(checkId, apiClient),
|
|
11292
11311
|
onSuccess: async () => {
|
|
11293
11312
|
setLatestSelectedCheckId("");
|
|
11294
11313
|
await queryClient.invalidateQueries({ queryKey: require_state.cacheKeys.checks() });
|
|
@@ -11298,7 +11317,7 @@ function CheckDetail({ checkId, refreshCheckList }) {
|
|
|
11298
11317
|
const { mutate: handleMarkAsPresetCheck, isPending: isMarkingAsPreset } = (0, _tanstack_react_query.useMutation)({
|
|
11299
11318
|
mutationFn: async () => {
|
|
11300
11319
|
if (!check) throw new Error("Check not found");
|
|
11301
|
-
return await require_state.markAsPresetCheck(checkId);
|
|
11320
|
+
return await require_state.markAsPresetCheck(checkId, apiClient);
|
|
11302
11321
|
},
|
|
11303
11322
|
onSuccess: async () => {
|
|
11304
11323
|
successToast("Check marked as preset successfully");
|
|
@@ -11310,20 +11329,21 @@ function CheckDetail({ checkId, refreshCheckList }) {
|
|
|
11310
11329
|
});
|
|
11311
11330
|
const handleRerun = (0, react.useCallback)(async () => {
|
|
11312
11331
|
if (!check?.type) return;
|
|
11313
|
-
setSubmittedRunId((await require_state.submitRunFromCheck(checkId, { nowait: true })).run_id);
|
|
11332
|
+
setSubmittedRunId((await require_state.submitRunFromCheck(checkId, { nowait: true }, apiClient)).run_id);
|
|
11314
11333
|
await queryClient.invalidateQueries({ queryKey: require_state.cacheKeys.check(checkId) });
|
|
11315
11334
|
if (refreshCheckList) refreshCheckList();
|
|
11316
11335
|
}, [
|
|
11317
11336
|
check,
|
|
11318
11337
|
checkId,
|
|
11319
11338
|
queryClient,
|
|
11320
|
-
refreshCheckList
|
|
11339
|
+
refreshCheckList,
|
|
11340
|
+
apiClient
|
|
11321
11341
|
]);
|
|
11322
11342
|
const handleCancel = (0, react.useCallback)(async () => {
|
|
11323
11343
|
setAborting(true);
|
|
11324
11344
|
if (!trackedRunId) return;
|
|
11325
|
-
return await require_state.cancelRun(trackedRunId);
|
|
11326
|
-
}, [trackedRunId]);
|
|
11345
|
+
return await require_state.cancelRun(trackedRunId, apiClient);
|
|
11346
|
+
}, [trackedRunId, apiClient]);
|
|
11327
11347
|
const handleCopy = async () => {
|
|
11328
11348
|
if (!check) return;
|
|
11329
11349
|
const markdown = buildMarkdown(check);
|
|
@@ -11828,8 +11848,9 @@ function buildBody(check) {
|
|
|
11828
11848
|
const CheckEmptyState = () => {
|
|
11829
11849
|
const queryClient = (0, _tanstack_react_query.useQueryClient)();
|
|
11830
11850
|
const [, setLocation] = require_state.useAppLocation();
|
|
11851
|
+
const { apiClient } = require_state.useApiConfig();
|
|
11831
11852
|
const { mutate: createSchemaCheck, isPending } = (0, _tanstack_react_query.useMutation)({
|
|
11832
|
-
mutationFn: () => require_version.createSchemaDiffCheck({ select: "state:modified" }),
|
|
11853
|
+
mutationFn: () => require_version.createSchemaDiffCheck({ select: "state:modified" }, apiClient),
|
|
11833
11854
|
onSuccess: async (check) => {
|
|
11834
11855
|
await queryClient.invalidateQueries({ queryKey: require_state.cacheKeys.checks() });
|
|
11835
11856
|
setLocation(`/checks/?id=${check.check_id}`);
|
|
@@ -11912,9 +11933,10 @@ const CheckEmptyState = () => {
|
|
|
11912
11933
|
//#endregion
|
|
11913
11934
|
//#region recce-source/js/src/components/run/RunPage.tsx
|
|
11914
11935
|
const RunPage = ({ runId }) => {
|
|
11936
|
+
const { apiClient } = require_state.useApiConfig();
|
|
11915
11937
|
const { error, data: run } = (0, _tanstack_react_query.useQuery)({
|
|
11916
11938
|
queryKey: require_state.cacheKeys.run(runId),
|
|
11917
|
-
queryFn: async () => require_state.waitRun(runId)
|
|
11939
|
+
queryFn: async () => require_state.waitRun(runId, void 0, apiClient)
|
|
11918
11940
|
});
|
|
11919
11941
|
let RunResultView;
|
|
11920
11942
|
if (run && require_state.runTypeHasRef(run.type)) RunResultView = require_state.findByRunType(run.type).RunResultView;
|
|
@@ -11929,10 +11951,11 @@ const RunPage = ({ runId }) => {
|
|
|
11929
11951
|
//#region recce-source/js/src/components/run/RunList.tsx
|
|
11930
11952
|
const RunListItem = ({ run, isSelected, onSelectRun, onAddToChecklist, onGoToCheck }) => {
|
|
11931
11953
|
const { featureToggles } = require_state.useRecceInstanceContext();
|
|
11954
|
+
const { apiClient } = require_state.useApiConfig();
|
|
11932
11955
|
const { data: fetchedRun } = (0, _tanstack_react_query.useQuery)({
|
|
11933
11956
|
queryKey: require_state.cacheKeys.run(run.run_id),
|
|
11934
11957
|
queryFn: async () => {
|
|
11935
|
-
return await require_state.waitRun(run.run_id);
|
|
11958
|
+
return await require_state.waitRun(run.run_id, void 0, apiClient);
|
|
11936
11959
|
},
|
|
11937
11960
|
enabled: run.status === "running",
|
|
11938
11961
|
retry: false
|
|
@@ -12036,10 +12059,11 @@ const DateSegmentItem = ({ runAt }) => {
|
|
|
12036
12059
|
};
|
|
12037
12060
|
const RunList = () => {
|
|
12038
12061
|
const { closeHistory } = require_state.useRecceActionContext();
|
|
12062
|
+
const { apiClient } = require_state.useApiConfig();
|
|
12039
12063
|
const { data: runs, isLoading } = (0, _tanstack_react_query.useQuery)({
|
|
12040
12064
|
queryKey: require_state.cacheKeys.runs(),
|
|
12041
12065
|
queryFn: async () => {
|
|
12042
|
-
return await require_state.listRuns();
|
|
12066
|
+
return await require_state.listRuns(apiClient);
|
|
12043
12067
|
},
|
|
12044
12068
|
retry: false
|
|
12045
12069
|
});
|
|
@@ -12103,6 +12127,7 @@ const RunList = () => {
|
|
|
12103
12127
|
function DateDividedRunHistoryItem({ run, previousDate }) {
|
|
12104
12128
|
const [, setLocation] = require_state.useAppLocation();
|
|
12105
12129
|
const queryClient = (0, _tanstack_react_query.useQueryClient)();
|
|
12130
|
+
const { apiClient } = require_state.useApiConfig();
|
|
12106
12131
|
const { showRunId, runId } = require_state.useRecceActionContext();
|
|
12107
12132
|
const currentDate = new Date(run.run_at).toDateString();
|
|
12108
12133
|
const shouldRenderDateSegment = previousDate != null && previousDate !== currentDate;
|
|
@@ -12111,10 +12136,14 @@ function DateDividedRunHistoryItem({ run, previousDate }) {
|
|
|
12111
12136
|
showRunId(runId$1, false);
|
|
12112
12137
|
};
|
|
12113
12138
|
const handleAddToChecklist = (0, react.useCallback)(async (clickedRunId) => {
|
|
12114
|
-
const check = await require_state.createCheckByRun(clickedRunId);
|
|
12139
|
+
const check = await require_state.createCheckByRun(clickedRunId, void 0, apiClient);
|
|
12115
12140
|
await queryClient.invalidateQueries({ queryKey: require_state.cacheKeys.checks() });
|
|
12116
12141
|
setLocation(`/checks/?id=${check.check_id}`);
|
|
12117
|
-
}, [
|
|
12142
|
+
}, [
|
|
12143
|
+
setLocation,
|
|
12144
|
+
queryClient,
|
|
12145
|
+
apiClient
|
|
12146
|
+
]);
|
|
12118
12147
|
const handleGoToCheck = (0, react.useCallback)((checkId) => {
|
|
12119
12148
|
require_state.trackHistoryAction({ name: "go_to_check" });
|
|
12120
12149
|
setLocation(`/checks/?id=${checkId}`);
|
|
@@ -12482,9 +12511,10 @@ function SummaryView() {
|
|
|
12482
12511
|
//#endregion
|
|
12483
12512
|
//#region recce-source/js/src/components/app/AvatarDropdown.tsx
|
|
12484
12513
|
function AvatarDropdown() {
|
|
12514
|
+
const { apiClient } = require_state.useApiConfig();
|
|
12485
12515
|
const { data: user, isLoading, error } = (0, _tanstack_react_query.useQuery)({
|
|
12486
12516
|
queryKey: require_state.cacheKeys.user(),
|
|
12487
|
-
queryFn: require_version.fetchUser,
|
|
12517
|
+
queryFn: () => require_version.fetchUser(apiClient),
|
|
12488
12518
|
retry: false
|
|
12489
12519
|
});
|
|
12490
12520
|
const { data: avatarUrl } = (0, _tanstack_react_query.useQuery)({
|
|
@@ -12633,6 +12663,142 @@ function IdleTimeoutBadge() {
|
|
|
12633
12663
|
});
|
|
12634
12664
|
}
|
|
12635
12665
|
|
|
12666
|
+
//#endregion
|
|
12667
|
+
//#region recce-source/js/app/(mainComponents)/DisplayModeToggle.tsx
|
|
12668
|
+
/**
|
|
12669
|
+
* Display Mode Toggle - switches between light and dark themes
|
|
12670
|
+
*
|
|
12671
|
+
* Uses next-themes to persist the user's preference.
|
|
12672
|
+
* Default is light theme, with future support for system preference.
|
|
12673
|
+
*/
|
|
12674
|
+
function DisplayModeToggle() {
|
|
12675
|
+
const { setTheme, resolvedTheme } = (0, next_themes.useTheme)();
|
|
12676
|
+
const [mounted, setMounted] = (0, react.useState)(false);
|
|
12677
|
+
(0, react.useEffect)(() => {
|
|
12678
|
+
setMounted(true);
|
|
12679
|
+
}, []);
|
|
12680
|
+
const toggleTheme = () => {
|
|
12681
|
+
setTheme(resolvedTheme === "dark" ? "light" : "dark");
|
|
12682
|
+
};
|
|
12683
|
+
if (!mounted) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mui_material_IconButton.default, {
|
|
12684
|
+
size: "small",
|
|
12685
|
+
sx: {
|
|
12686
|
+
color: "rgba(255, 255, 255, 0.8)",
|
|
12687
|
+
"&:hover": { bgcolor: "rgba(255, 255, 255, 0.1)" }
|
|
12688
|
+
},
|
|
12689
|
+
disabled: true,
|
|
12690
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_icons_pi.PiSun, { style: {
|
|
12691
|
+
width: 18,
|
|
12692
|
+
height: 18
|
|
12693
|
+
} })
|
|
12694
|
+
});
|
|
12695
|
+
const isDark = resolvedTheme === "dark";
|
|
12696
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mui_material_Tooltip.default, {
|
|
12697
|
+
title: isDark ? "Switch to light mode" : "Switch to dark mode",
|
|
12698
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mui_material_IconButton.default, {
|
|
12699
|
+
size: "small",
|
|
12700
|
+
onClick: toggleTheme,
|
|
12701
|
+
sx: {
|
|
12702
|
+
color: "rgba(255, 255, 255, 0.8)",
|
|
12703
|
+
"&:hover": { bgcolor: "rgba(255, 255, 255, 0.1)" }
|
|
12704
|
+
},
|
|
12705
|
+
"aria-label": isDark ? "Switch to light mode" : "Switch to dark mode",
|
|
12706
|
+
children: isDark ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_icons_pi.PiSun, { style: {
|
|
12707
|
+
width: 18,
|
|
12708
|
+
height: 18
|
|
12709
|
+
} }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_icons_pi.PiMoon, { style: {
|
|
12710
|
+
width: 18,
|
|
12711
|
+
height: 18
|
|
12712
|
+
} })
|
|
12713
|
+
})
|
|
12714
|
+
});
|
|
12715
|
+
}
|
|
12716
|
+
|
|
12717
|
+
//#endregion
|
|
12718
|
+
//#region recce-source/js/app/(mainComponents)/RecceVersionBadge.tsx
|
|
12719
|
+
function RecceVersionBadge() {
|
|
12720
|
+
const { version, latestVersion } = require_version.useVersionNumber();
|
|
12721
|
+
const versionFormatRegex = (0, react.useMemo)(() => /* @__PURE__ */ new RegExp("^\\d+\\.\\d+\\.\\d+$"), []);
|
|
12722
|
+
(0, react.useEffect)(() => {
|
|
12723
|
+
if (versionFormatRegex.test(version) && version !== latestVersion) {
|
|
12724
|
+
const storageKey = "recce-update-toast-shown";
|
|
12725
|
+
if (sessionStorage.getItem(storageKey)) return;
|
|
12726
|
+
setTimeout(() => {
|
|
12727
|
+
require_state.toaster.create({
|
|
12728
|
+
id: "recce-update-available",
|
|
12729
|
+
title: "Update available",
|
|
12730
|
+
description: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", { children: [
|
|
12731
|
+
"A new version of Recce (v",
|
|
12732
|
+
latestVersion,
|
|
12733
|
+
") is available.",
|
|
12734
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("br", {}),
|
|
12735
|
+
"Please run",
|
|
12736
|
+
" ",
|
|
12737
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mui_material_Box.default, {
|
|
12738
|
+
component: "code",
|
|
12739
|
+
sx: {
|
|
12740
|
+
bgcolor: "grey.200",
|
|
12741
|
+
px: .5,
|
|
12742
|
+
py: .25,
|
|
12743
|
+
borderRadius: .5,
|
|
12744
|
+
fontFamily: "monospace",
|
|
12745
|
+
fontSize: "0.875em"
|
|
12746
|
+
},
|
|
12747
|
+
children: "pip install --upgrade recce"
|
|
12748
|
+
}),
|
|
12749
|
+
" ",
|
|
12750
|
+
"to update Recce.",
|
|
12751
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("br", {}),
|
|
12752
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mui_material_Link.default, {
|
|
12753
|
+
sx: {
|
|
12754
|
+
color: "primary.main",
|
|
12755
|
+
fontWeight: "bold",
|
|
12756
|
+
"&:hover": { textDecoration: "underline" }
|
|
12757
|
+
},
|
|
12758
|
+
href: `https://github.com/DataRecce/recce/releases/tag/v${latestVersion}`,
|
|
12759
|
+
target: "_blank",
|
|
12760
|
+
children: "Click here to view the detail of latest release"
|
|
12761
|
+
})
|
|
12762
|
+
] }),
|
|
12763
|
+
duration: 60 * 1e3,
|
|
12764
|
+
closable: true
|
|
12765
|
+
});
|
|
12766
|
+
sessionStorage.setItem(storageKey, "true");
|
|
12767
|
+
}, 0);
|
|
12768
|
+
}
|
|
12769
|
+
}, [
|
|
12770
|
+
version,
|
|
12771
|
+
latestVersion,
|
|
12772
|
+
versionFormatRegex
|
|
12773
|
+
]);
|
|
12774
|
+
if (!versionFormatRegex.test(version)) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mui_material_Typography.default, {
|
|
12775
|
+
component: "span",
|
|
12776
|
+
sx: {
|
|
12777
|
+
fontSize: "sm",
|
|
12778
|
+
color: "rgba(255,255,255,0.8)",
|
|
12779
|
+
textTransform: "uppercase",
|
|
12780
|
+
borderWidth: 1,
|
|
12781
|
+
px: 1,
|
|
12782
|
+
borderRadius: .75
|
|
12783
|
+
},
|
|
12784
|
+
children: version
|
|
12785
|
+
});
|
|
12786
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mui_material_Link.default, {
|
|
12787
|
+
href: `https://github.com/DataRecce/recce/releases/tag/v${version}`,
|
|
12788
|
+
sx: {
|
|
12789
|
+
"&:hover": { textDecoration: "none" },
|
|
12790
|
+
fontSize: "sm",
|
|
12791
|
+
color: "rgba(255,255,255,0.8)",
|
|
12792
|
+
textTransform: "uppercase",
|
|
12793
|
+
borderWidth: 1,
|
|
12794
|
+
px: 1,
|
|
12795
|
+
borderRadius: .75
|
|
12796
|
+
},
|
|
12797
|
+
target: "_blank",
|
|
12798
|
+
children: version
|
|
12799
|
+
});
|
|
12800
|
+
}
|
|
12801
|
+
|
|
12636
12802
|
//#endregion
|
|
12637
12803
|
//#region recce-source/js/app/(mainComponents)/TopBar.tsx
|
|
12638
12804
|
function LinkIcon({ icon: IconComponent, href, sx, ...props }) {
|
|
@@ -12699,8 +12865,8 @@ function TopBar() {
|
|
|
12699
12865
|
})]
|
|
12700
12866
|
})
|
|
12701
12867
|
}),
|
|
12702
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
12703
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
12868
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(DisplayModeToggle, {}),
|
|
12869
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(RecceVersionBadge, {}),
|
|
12704
12870
|
(featureToggles.mode ?? reviewMode) && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mui_material_Badge.default, {
|
|
12705
12871
|
sx: {
|
|
12706
12872
|
fontSize: "0.875rem",
|
|
@@ -12885,6 +13051,7 @@ const useClosePrompt = (prompt) => {
|
|
|
12885
13051
|
const Filename = () => {
|
|
12886
13052
|
const { featureToggles } = require_state.useRecceInstanceContext();
|
|
12887
13053
|
const { fileName, cloudMode, isDemoSite, envInfo } = require_state.useLineageGraphContext();
|
|
13054
|
+
const { apiClient } = require_state.useApiConfig();
|
|
12888
13055
|
const [modalOpen, setModalOpen] = (0, react.useState)(false);
|
|
12889
13056
|
const [overwriteOpen, setOverwriteOpen] = (0, react.useState)(false);
|
|
12890
13057
|
const isStateless = !fileName && !cloudMode && !isDemoSite;
|
|
@@ -12911,11 +13078,11 @@ const Filename = () => {
|
|
|
12911
13078
|
if (method === "save") await require_state.saveAs({
|
|
12912
13079
|
filename: newFileName,
|
|
12913
13080
|
overwrite: overwrite ?? bypassOverwrite
|
|
12914
|
-
});
|
|
13081
|
+
}, apiClient);
|
|
12915
13082
|
else await require_state.rename({
|
|
12916
13083
|
filename: newFileName,
|
|
12917
13084
|
overwrite: overwrite ?? bypassOverwrite
|
|
12918
|
-
});
|
|
13085
|
+
}, apiClient);
|
|
12919
13086
|
toastSuccess(method === "save" ? "Save file successfully" : "Rename file successfully");
|
|
12920
13087
|
await queryClient.invalidateQueries({ queryKey: require_state.cacheKeys.lineage() });
|
|
12921
13088
|
if (bypass) localStorage.setItem(require_version.localStorageKeys.bypassSaveOverwrite, "true");
|
|
@@ -13139,9 +13306,10 @@ const Filename = () => {
|
|
|
13139
13306
|
//#region recce-source/js/src/components/app/StateExporter.tsx
|
|
13140
13307
|
function StateExporter() {
|
|
13141
13308
|
const { featureToggles } = require_state.useRecceInstanceContext();
|
|
13309
|
+
const { apiClient } = require_state.useApiConfig();
|
|
13142
13310
|
const handleExport = async () => {
|
|
13143
13311
|
try {
|
|
13144
|
-
const jsonData = await require_state.exportState();
|
|
13312
|
+
const jsonData = await require_state.exportState(apiClient);
|
|
13145
13313
|
const jsonString = JSON.stringify(jsonData, null, 2);
|
|
13146
13314
|
(0, file_saver.default)(new Blob([jsonString], { type: "application/json" }), `recce-state-${(0, date_fns.format)(/* @__PURE__ */ new Date(), "yyyy-MM-dd-HH-mm-ss")}.json`);
|
|
13147
13315
|
} catch (error) {
|
|
@@ -13308,6 +13476,7 @@ function StateSpinner() {
|
|
|
13308
13476
|
function StateSynchronizer() {
|
|
13309
13477
|
const [isSyncing, setSyncing] = (0, react.useState)(false);
|
|
13310
13478
|
const queryClient = (0, _tanstack_react_query.useQueryClient)();
|
|
13479
|
+
const { apiClient } = require_state.useApiConfig();
|
|
13311
13480
|
const [location, setLocation] = require_state.useAppLocation();
|
|
13312
13481
|
const [open, setOpen] = (0, react.useState)(false);
|
|
13313
13482
|
const [syncOption, setSyncOption] = (0, react.useState)("");
|
|
@@ -13316,12 +13485,12 @@ function StateSynchronizer() {
|
|
|
13316
13485
|
const handleSync = (0, react.useCallback)(async (input) => {
|
|
13317
13486
|
setOpen(false);
|
|
13318
13487
|
setSyncing(true);
|
|
13319
|
-
if ((await require_state.syncState(input)).status === "conflict") {
|
|
13488
|
+
if ((await require_state.syncState(input, apiClient)).status === "conflict") {
|
|
13320
13489
|
setOpen(true);
|
|
13321
13490
|
setSyncing(false);
|
|
13322
13491
|
return;
|
|
13323
13492
|
}
|
|
13324
|
-
while (await require_state.isStateSyncing()) await new Promise((resolve) => setTimeout(resolve, 1e3));
|
|
13493
|
+
while (await require_state.isStateSyncing(apiClient)) await new Promise((resolve) => setTimeout(resolve, 1e3));
|
|
13325
13494
|
require_state.toaster.create({
|
|
13326
13495
|
description: "Sync Completed",
|
|
13327
13496
|
type: "success",
|
|
@@ -13337,7 +13506,8 @@ function StateSynchronizer() {
|
|
|
13337
13506
|
}, [
|
|
13338
13507
|
queryClient,
|
|
13339
13508
|
location,
|
|
13340
|
-
setLocation
|
|
13509
|
+
setLocation,
|
|
13510
|
+
apiClient
|
|
13341
13511
|
]);
|
|
13342
13512
|
if (isSyncing) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StateSpinner, {});
|
|
13343
13513
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mui_material_Tooltip.default, {
|
|
@@ -13622,142 +13792,6 @@ function NavBar() {
|
|
|
13622
13792
|
});
|
|
13623
13793
|
}
|
|
13624
13794
|
|
|
13625
|
-
//#endregion
|
|
13626
|
-
//#region recce-source/js/app/(mainComponents)/DisplayModeToggle.tsx
|
|
13627
|
-
/**
|
|
13628
|
-
* Display Mode Toggle - switches between light and dark themes
|
|
13629
|
-
*
|
|
13630
|
-
* Uses next-themes to persist the user's preference.
|
|
13631
|
-
* Default is light theme, with future support for system preference.
|
|
13632
|
-
*/
|
|
13633
|
-
function DisplayModeToggle() {
|
|
13634
|
-
const { setTheme, resolvedTheme } = (0, next_themes.useTheme)();
|
|
13635
|
-
const [mounted, setMounted] = (0, react.useState)(false);
|
|
13636
|
-
(0, react.useEffect)(() => {
|
|
13637
|
-
setMounted(true);
|
|
13638
|
-
}, []);
|
|
13639
|
-
const toggleTheme = () => {
|
|
13640
|
-
setTheme(resolvedTheme === "dark" ? "light" : "dark");
|
|
13641
|
-
};
|
|
13642
|
-
if (!mounted) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mui_material_IconButton.default, {
|
|
13643
|
-
size: "small",
|
|
13644
|
-
sx: {
|
|
13645
|
-
color: "rgba(255, 255, 255, 0.8)",
|
|
13646
|
-
"&:hover": { bgcolor: "rgba(255, 255, 255, 0.1)" }
|
|
13647
|
-
},
|
|
13648
|
-
disabled: true,
|
|
13649
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_icons_pi.PiSun, { style: {
|
|
13650
|
-
width: 18,
|
|
13651
|
-
height: 18
|
|
13652
|
-
} })
|
|
13653
|
-
});
|
|
13654
|
-
const isDark = resolvedTheme === "dark";
|
|
13655
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mui_material_Tooltip.default, {
|
|
13656
|
-
title: isDark ? "Switch to light mode" : "Switch to dark mode",
|
|
13657
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mui_material_IconButton.default, {
|
|
13658
|
-
size: "small",
|
|
13659
|
-
onClick: toggleTheme,
|
|
13660
|
-
sx: {
|
|
13661
|
-
color: "rgba(255, 255, 255, 0.8)",
|
|
13662
|
-
"&:hover": { bgcolor: "rgba(255, 255, 255, 0.1)" }
|
|
13663
|
-
},
|
|
13664
|
-
"aria-label": isDark ? "Switch to light mode" : "Switch to dark mode",
|
|
13665
|
-
children: isDark ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_icons_pi.PiSun, { style: {
|
|
13666
|
-
width: 18,
|
|
13667
|
-
height: 18
|
|
13668
|
-
} }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_icons_pi.PiMoon, { style: {
|
|
13669
|
-
width: 18,
|
|
13670
|
-
height: 18
|
|
13671
|
-
} })
|
|
13672
|
-
})
|
|
13673
|
-
});
|
|
13674
|
-
}
|
|
13675
|
-
|
|
13676
|
-
//#endregion
|
|
13677
|
-
//#region recce-source/js/app/(mainComponents)/RecceVersionBadge.tsx
|
|
13678
|
-
function RecceVersionBadge() {
|
|
13679
|
-
const { version, latestVersion } = require_version.useVersionNumber();
|
|
13680
|
-
const versionFormatRegex = (0, react.useMemo)(() => /* @__PURE__ */ new RegExp("^\\d+\\.\\d+\\.\\d+$"), []);
|
|
13681
|
-
(0, react.useEffect)(() => {
|
|
13682
|
-
if (versionFormatRegex.test(version) && version !== latestVersion) {
|
|
13683
|
-
const storageKey = "recce-update-toast-shown";
|
|
13684
|
-
if (sessionStorage.getItem(storageKey)) return;
|
|
13685
|
-
setTimeout(() => {
|
|
13686
|
-
require_state.toaster.create({
|
|
13687
|
-
id: "recce-update-available",
|
|
13688
|
-
title: "Update available",
|
|
13689
|
-
description: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", { children: [
|
|
13690
|
-
"A new version of Recce (v",
|
|
13691
|
-
latestVersion,
|
|
13692
|
-
") is available.",
|
|
13693
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("br", {}),
|
|
13694
|
-
"Please run",
|
|
13695
|
-
" ",
|
|
13696
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mui_material_Box.default, {
|
|
13697
|
-
component: "code",
|
|
13698
|
-
sx: {
|
|
13699
|
-
bgcolor: "grey.200",
|
|
13700
|
-
px: .5,
|
|
13701
|
-
py: .25,
|
|
13702
|
-
borderRadius: .5,
|
|
13703
|
-
fontFamily: "monospace",
|
|
13704
|
-
fontSize: "0.875em"
|
|
13705
|
-
},
|
|
13706
|
-
children: "pip install --upgrade recce"
|
|
13707
|
-
}),
|
|
13708
|
-
" ",
|
|
13709
|
-
"to update Recce.",
|
|
13710
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("br", {}),
|
|
13711
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mui_material_Link.default, {
|
|
13712
|
-
sx: {
|
|
13713
|
-
color: "primary.main",
|
|
13714
|
-
fontWeight: "bold",
|
|
13715
|
-
"&:hover": { textDecoration: "underline" }
|
|
13716
|
-
},
|
|
13717
|
-
href: `https://github.com/DataRecce/recce/releases/tag/v${latestVersion}`,
|
|
13718
|
-
target: "_blank",
|
|
13719
|
-
children: "Click here to view the detail of latest release"
|
|
13720
|
-
})
|
|
13721
|
-
] }),
|
|
13722
|
-
duration: 60 * 1e3,
|
|
13723
|
-
closable: true
|
|
13724
|
-
});
|
|
13725
|
-
sessionStorage.setItem(storageKey, "true");
|
|
13726
|
-
}, 0);
|
|
13727
|
-
}
|
|
13728
|
-
}, [
|
|
13729
|
-
version,
|
|
13730
|
-
latestVersion,
|
|
13731
|
-
versionFormatRegex
|
|
13732
|
-
]);
|
|
13733
|
-
if (!versionFormatRegex.test(version)) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mui_material_Typography.default, {
|
|
13734
|
-
component: "span",
|
|
13735
|
-
sx: {
|
|
13736
|
-
fontSize: "sm",
|
|
13737
|
-
color: "rgba(255,255,255,0.8)",
|
|
13738
|
-
textTransform: "uppercase",
|
|
13739
|
-
borderWidth: 1,
|
|
13740
|
-
px: 1,
|
|
13741
|
-
borderRadius: .75
|
|
13742
|
-
},
|
|
13743
|
-
children: version
|
|
13744
|
-
});
|
|
13745
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_mui_material_Link.default, {
|
|
13746
|
-
href: `https://github.com/DataRecce/recce/releases/tag/v${version}`,
|
|
13747
|
-
sx: {
|
|
13748
|
-
"&:hover": { textDecoration: "none" },
|
|
13749
|
-
fontSize: "sm",
|
|
13750
|
-
color: "rgba(255,255,255,0.8)",
|
|
13751
|
-
textTransform: "uppercase",
|
|
13752
|
-
borderWidth: 1,
|
|
13753
|
-
px: 1,
|
|
13754
|
-
borderRadius: .75
|
|
13755
|
-
},
|
|
13756
|
-
target: "_blank",
|
|
13757
|
-
children: version
|
|
13758
|
-
});
|
|
13759
|
-
}
|
|
13760
|
-
|
|
13761
13795
|
//#endregion
|
|
13762
13796
|
Object.defineProperty(exports, 'ChangeSummary', {
|
|
13763
13797
|
enumerable: true,
|
|
@@ -14035,4 +14069,4 @@ Object.defineProperty(exports, 'mui_provider_default', {
|
|
|
14035
14069
|
return mui_provider_default;
|
|
14036
14070
|
}
|
|
14037
14071
|
});
|
|
14038
|
-
//# sourceMappingURL=components-
|
|
14072
|
+
//# sourceMappingURL=components-Bmc5X473.js.map
|