@loopstack/loopstack-studio 0.22.0 → 0.23.0
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/app/EnvironmentEmbedRoot.js +20 -18
- package/dist/components/feedback/ErrorBoundary.js +43 -0
- package/dist/components/{LoadingCentered.js → feedback/LoadingCentered.js} +1 -1
- package/dist/components/feedback/index.js +5 -0
- package/dist/components/index.js +6 -3
- package/dist/components/layout/MainLayout.js +32 -16
- package/dist/components/layout/StudioSidebar.js +165 -0
- package/dist/components/ui-widgets/widgets/SandboxRun.js +1 -0
- package/dist/features/code-explorer/CodeExplorer.js +6 -0
- package/dist/features/code-explorer/components/CodeExplorerTree.js +5 -0
- package/dist/features/code-explorer/components/CodeExplorerTreeNode.js +6 -0
- package/dist/features/code-explorer/components/FileContentViewer.js +1 -0
- package/dist/features/code-explorer/components/FileTabsBar.js +1 -1
- package/dist/features/code-explorer/index.js +4 -0
- package/dist/features/debug/components/ConfigFlowViewer.js +1 -1
- package/dist/features/debug/components/PipelineFlowViewer.js +1 -1
- package/dist/features/debug/index.js +3 -0
- package/dist/features/documents/DocumentRenderer.js +53 -0
- package/dist/features/{workbench → documents}/components/DocumentItem.js +1 -1
- package/dist/features/{workbench → documents}/components/DocumentMetadataPills.js +2 -2
- package/dist/features/{workbench/components → documents}/document-details/DocumentDetails.js +3 -3
- package/dist/features/{workbench/components → documents}/document-details/PromptDetails.js +3 -3
- package/dist/features/documents/index.js +4 -0
- package/dist/features/{workbench/components/document-renderer → documents/renderers}/AiMessage.js +5 -5
- package/dist/features/{workbench/components/document-renderer → documents/renderers}/DocumentDebugRenderer.js +1 -1
- package/dist/features/{workbench/components/document-renderer → documents/renderers}/DocumentFormRenderer.js +3 -3
- package/dist/features/{workbench/components/document-renderer → documents/renderers}/DocumentMessageRenderer.js +1 -1
- package/dist/features/{workbench/components/document-renderer → documents/renderers}/ErrorMessageRenderer.js +1 -1
- package/dist/features/{workbench/components/document-renderer → documents/renderers}/LinkMessageRenderer.js +1 -1
- package/dist/features/{workbench/components/document-renderer → documents/renderers}/MarkdownMessageRenderer.js +2 -2
- package/dist/features/{workbench/components/document-renderer → documents/renderers}/PlainMessageRenderer.js +1 -1
- package/dist/features/health/index.js +1 -0
- package/dist/features/workbench/NavigationItems.js +29 -29
- package/dist/features/workbench/Workbench.js +57 -69
- package/dist/features/workbench/WorkflowItem.js +63 -55
- package/dist/features/workbench/WorkflowList.js +52 -81
- package/dist/features/workbench/components/NewRunDialog.js +2 -1
- package/dist/features/workbench/components/WorkbenchFlowPanel.js +5 -4
- package/dist/features/workbench/components/WorkflowHistoryItem.js +11 -11
- package/dist/features/workbench/components/buttons/WorkflowButtons.js +49 -50
- package/dist/features/workbench/hooks/useWorkflowData.js +49 -0
- package/dist/features/workbench/hooks/useWorkflowListState.js +50 -0
- package/dist/features/workbench/index.js +8 -0
- package/dist/features/workbench/providers/WorkbenchLayoutProvider.js +2 -3
- package/dist/features/workspaces/components/CreateWorkspace.js +1 -1
- package/dist/features/workspaces/components/ExecutionTimeline.js +1 -1
- package/dist/features/workspaces/components/PipelineForm.js +1 -1
- package/dist/features/workspaces/index.js +3 -0
- package/dist/hooks/index.js +3 -2
- package/dist/hooks/query-keys.js +138 -0
- package/dist/hooks/useAuth.js +43 -42
- package/dist/hooks/useConfig.js +31 -35
- package/dist/hooks/useDashboard.js +9 -13
- package/dist/hooks/useDebounce.js +8 -17
- package/dist/hooks/useDocuments.js +4 -9
- package/dist/hooks/useFiles.js +31 -39
- package/dist/hooks/useNamespaces.js +2 -8
- package/dist/hooks/usePipelines.js +132 -155
- package/dist/hooks/useProcessor.js +11 -14
- package/dist/hooks/useWorkflows.js +40 -62
- package/dist/hooks/useWorkspaces.js +105 -110
- package/dist/index.d.ts +99 -3
- package/dist/index.js +14 -7
- package/dist/pages/DashboardPage.js +1 -1
- package/dist/pages/DebugWorkflowDetailsPage.js +2 -2
- package/dist/pages/EmbedWorkbenchPage.js +4 -3
- package/dist/pages/PipelineDebugPage.js +6 -5
- package/dist/pages/PreviewWorkbenchPage.js +121 -118
- package/dist/pages/RunsListPage.js +52 -24
- package/dist/pages/StudioLandingPage.js +1 -0
- package/dist/pages/WorkbenchPage.js +3 -2
- package/dist/pages/WorkspacePage.js +1 -1
- package/dist/providers/InvalidationEventsProvider.js +9 -11
- package/dist/providers/StudioProvider.js +2 -2
- package/dist/routing/LocalRouter.js +12 -8
- package/package.json +1 -1
- package/dist/features/workbench/components/DocumentRenderer.js +0 -54
- /package/dist/components/{content → feedback}/ErrorAlert.js +0 -0
- /package/dist/components/{snackbars → feedback}/ErrorSnackbar.js +0 -0
- /package/dist/components/{snackbars → feedback}/Snackbar.js +0 -0
- /package/dist/features/{workbench → documents}/components/DocumentList.js +0 -0
- /package/dist/features/{workbench/components/document-renderer → documents/renderers}/AiMessageContent.js +0 -0
package/dist/hooks/useAuth.js
CHANGED
|
@@ -1,57 +1,58 @@
|
|
|
1
|
+
import { getHealthCacheKey, getMeCacheKey } from "./query-keys.js";
|
|
1
2
|
import { useApiClient } from "./useApi.js";
|
|
2
3
|
import { c } from "react/compiler-runtime";
|
|
3
4
|
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
|
|
4
|
-
function useMe(
|
|
5
|
-
let i = c(8),
|
|
6
|
-
i[0] ===
|
|
7
|
-
let u;
|
|
8
|
-
i[2] === s ? u = i[3] : (u = () => s.auth.me(), i[2] = s, i[3] = u);
|
|
5
|
+
function useMe(e) {
|
|
6
|
+
let i = c(8), o = e === void 0 ? !0 : e, { envKey: s, api: l } = useApiClient(), u;
|
|
7
|
+
i[0] === s ? u = i[1] : (u = getMeCacheKey(s), i[0] = s, i[1] = u);
|
|
9
8
|
let d;
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
i[2] === l ? d = i[3] : (d = () => l.auth.me(), i[2] = l, i[3] = d);
|
|
10
|
+
let f;
|
|
11
|
+
return i[4] !== o || i[5] !== u || i[6] !== d ? (f = {
|
|
12
|
+
queryKey: u,
|
|
13
|
+
queryFn: d,
|
|
13
14
|
retry: !1,
|
|
14
15
|
staleTime: 3e5,
|
|
15
|
-
enabled:
|
|
16
|
-
}, i[4] =
|
|
16
|
+
enabled: o
|
|
17
|
+
}, i[4] = o, i[5] = u, i[6] = d, i[7] = f) : f = i[7], useQuery(f);
|
|
17
18
|
}
|
|
18
|
-
function useGetHealthInfo(
|
|
19
|
-
let i = c(8),
|
|
20
|
-
i[0] ===
|
|
21
|
-
let u;
|
|
22
|
-
i[2] === s ? u = i[3] : (u = () => s.auth.getInfo(), i[2] = s, i[3] = u);
|
|
19
|
+
function useGetHealthInfo(r) {
|
|
20
|
+
let i = c(8), o = r === void 0 ? !0 : r, { envKey: s, api: l } = useApiClient(), u;
|
|
21
|
+
i[0] === s ? u = i[1] : (u = getHealthCacheKey(s), i[0] = s, i[1] = u);
|
|
23
22
|
let d;
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
23
|
+
i[2] === l ? d = i[3] : (d = () => l.auth.getInfo(), i[2] = l, i[3] = d);
|
|
24
|
+
let f;
|
|
25
|
+
return i[4] !== o || i[5] !== u || i[6] !== d ? (f = {
|
|
26
|
+
queryKey: u,
|
|
27
|
+
queryFn: d,
|
|
27
28
|
staleTime: 3e5,
|
|
28
|
-
enabled:
|
|
29
|
-
}, i[4] =
|
|
29
|
+
enabled: o
|
|
30
|
+
}, i[4] = o, i[5] = u, i[6] = d, i[7] = f) : f = i[7], useQuery(f);
|
|
30
31
|
}
|
|
31
32
|
function useWorkerAuth() {
|
|
32
|
-
let
|
|
33
|
-
|
|
34
|
-
let
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
},
|
|
38
|
-
let
|
|
39
|
-
return
|
|
40
|
-
mutationFn:
|
|
41
|
-
onSuccess:
|
|
42
|
-
},
|
|
33
|
+
let a = c(8), { envKey: s, api: l } = useApiClient(), u = useQueryClient(), d;
|
|
34
|
+
a[0] === l ? d = a[1] : (d = (e) => l.auth.hubLogin(e), a[0] = l, a[1] = d);
|
|
35
|
+
let f;
|
|
36
|
+
a[2] !== s || a[3] !== u ? (f = () => {
|
|
37
|
+
u.invalidateQueries({ queryKey: getMeCacheKey(s) }), u.invalidateQueries({ queryKey: getHealthCacheKey(s) });
|
|
38
|
+
}, a[2] = s, a[3] = u, a[4] = f) : f = a[4];
|
|
39
|
+
let p;
|
|
40
|
+
return a[5] !== d || a[6] !== f ? (p = {
|
|
41
|
+
mutationFn: d,
|
|
42
|
+
onSuccess: f
|
|
43
|
+
}, a[5] = d, a[6] = f, a[7] = p) : p = a[7], useMutation(p);
|
|
43
44
|
}
|
|
44
45
|
function useWorkerAuthTokenRefresh() {
|
|
45
|
-
let
|
|
46
|
-
|
|
47
|
-
let
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
},
|
|
51
|
-
let
|
|
52
|
-
return
|
|
53
|
-
mutationFn:
|
|
54
|
-
onSuccess:
|
|
55
|
-
},
|
|
46
|
+
let a = c(8), { envKey: s, api: l } = useApiClient(), u = useQueryClient(), d;
|
|
47
|
+
a[0] === l ? d = a[1] : (d = () => l.auth.refresh(), a[0] = l, a[1] = d);
|
|
48
|
+
let f;
|
|
49
|
+
a[2] !== s || a[3] !== u ? (f = () => {
|
|
50
|
+
u.invalidateQueries({ queryKey: getMeCacheKey(s) }), u.invalidateQueries({ queryKey: getHealthCacheKey(s) });
|
|
51
|
+
}, a[2] = s, a[3] = u, a[4] = f) : f = a[4];
|
|
52
|
+
let p;
|
|
53
|
+
return a[5] !== d || a[6] !== f ? (p = {
|
|
54
|
+
mutationFn: d,
|
|
55
|
+
onSuccess: f
|
|
56
|
+
}, a[5] = d, a[6] = f, a[7] = p) : p = a[7], useMutation(p);
|
|
56
57
|
}
|
|
57
58
|
export { useGetHealthInfo, useMe, useWorkerAuth, useWorkerAuthTokenRefresh };
|
package/dist/hooks/useConfig.js
CHANGED
|
@@ -1,44 +1,40 @@
|
|
|
1
|
+
import { getAvailableEnvironmentsCacheKey, getPipelineTypesCacheKey, getWorkspaceTypesCacheKey } from "./query-keys.js";
|
|
1
2
|
import { useApiClient } from "./useApi.js";
|
|
2
3
|
import { c } from "react/compiler-runtime";
|
|
3
4
|
import { useQuery } from "@tanstack/react-query";
|
|
4
5
|
function useWorkspaceConfig() {
|
|
5
|
-
let
|
|
6
|
-
|
|
7
|
-
let s;
|
|
8
|
-
r[2] === a ? s = r[3] : (s = () => a.config.getWorkspaceTypes(), r[2] = a, r[3] = s);
|
|
6
|
+
let e = c(7), { envKey: i, api: o } = useApiClient(), s;
|
|
7
|
+
e[0] === i ? s = e[1] : (s = getWorkspaceTypesCacheKey(i), e[0] = i, e[1] = s);
|
|
9
8
|
let l;
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
enabled: !0
|
|
14
|
-
}, r[4] = o, r[5] = s, r[6] = l) : l = r[6], useQuery(l);
|
|
15
|
-
}
|
|
16
|
-
function usePipelineConfig(r) {
|
|
17
|
-
let i = c(10), { envKey: a, api: o } = useApiClient(), s;
|
|
18
|
-
i[0] !== a || i[1] !== r ? (s = [
|
|
19
|
-
"pipeline-types",
|
|
20
|
-
r,
|
|
21
|
-
a
|
|
22
|
-
], i[0] = a, i[1] = r, i[2] = s) : s = i[2];
|
|
23
|
-
let l;
|
|
24
|
-
i[3] !== o || i[4] !== r ? (l = () => o.config.getPipelineTypesByWorkspace({ workspaceBlockName: r }), i[3] = o, i[4] = r, i[5] = l) : l = i[5];
|
|
25
|
-
let u = !!r, d;
|
|
26
|
-
return i[6] !== s || i[7] !== l || i[8] !== u ? (d = {
|
|
9
|
+
e[2] === o ? l = e[3] : (l = () => o.config.getWorkspaceTypes(), e[2] = o, e[3] = l);
|
|
10
|
+
let u;
|
|
11
|
+
return e[4] !== s || e[5] !== l ? (u = {
|
|
27
12
|
queryKey: s,
|
|
28
|
-
queryFn: l
|
|
29
|
-
|
|
30
|
-
}, i[6] = s, i[7] = l, i[8] = u, i[9] = d) : d = i[9], useQuery(d);
|
|
13
|
+
queryFn: l
|
|
14
|
+
}, e[4] = s, e[5] = l, e[6] = u) : u = e[6], useQuery(u);
|
|
31
15
|
}
|
|
32
|
-
function
|
|
33
|
-
let
|
|
34
|
-
|
|
35
|
-
let
|
|
36
|
-
|
|
37
|
-
let
|
|
38
|
-
return
|
|
39
|
-
queryKey:
|
|
40
|
-
queryFn:
|
|
41
|
-
enabled:
|
|
42
|
-
},
|
|
16
|
+
function usePipelineConfig(e) {
|
|
17
|
+
let a = c(10), { envKey: o, api: s } = useApiClient(), l;
|
|
18
|
+
a[0] !== o || a[1] !== e ? (l = getPipelineTypesCacheKey(o, e), a[0] = o, a[1] = e, a[2] = l) : l = a[2];
|
|
19
|
+
let u;
|
|
20
|
+
a[3] !== s || a[4] !== e ? (u = () => s.config.getPipelineTypesByWorkspace({ workspaceBlockName: e }), a[3] = s, a[4] = e, a[5] = u) : u = a[5];
|
|
21
|
+
let d = !!e, f;
|
|
22
|
+
return a[6] !== l || a[7] !== u || a[8] !== d ? (f = {
|
|
23
|
+
queryKey: l,
|
|
24
|
+
queryFn: u,
|
|
25
|
+
enabled: d
|
|
26
|
+
}, a[6] = l, a[7] = u, a[8] = d, a[9] = f) : f = a[9], useQuery(f);
|
|
27
|
+
}
|
|
28
|
+
function useAvailableEnvironments(i) {
|
|
29
|
+
let a = c(8), { envKey: o, api: s } = useApiClient(), l;
|
|
30
|
+
a[0] === o ? l = a[1] : (l = getAvailableEnvironmentsCacheKey(o), a[0] = o, a[1] = l);
|
|
31
|
+
let u;
|
|
32
|
+
a[2] === s ? u = a[3] : (u = () => s.config.getAvailableEnvironments(), a[2] = s, a[3] = u);
|
|
33
|
+
let d = i?.enabled ?? !0, f;
|
|
34
|
+
return a[4] !== l || a[5] !== u || a[6] !== d ? (f = {
|
|
35
|
+
queryKey: l,
|
|
36
|
+
queryFn: u,
|
|
37
|
+
enabled: d
|
|
38
|
+
}, a[4] = l, a[5] = u, a[6] = d, a[7] = f) : f = a[7], useQuery(f);
|
|
43
39
|
}
|
|
44
40
|
export { useAvailableEnvironments, usePipelineConfig, useWorkspaceConfig };
|
|
@@ -1,20 +1,16 @@
|
|
|
1
|
+
import { getDashboardStatsCacheKey } from "./query-keys.js";
|
|
1
2
|
import { useApiClient } from "./useApi.js";
|
|
2
3
|
import { c } from "react/compiler-runtime";
|
|
3
4
|
import { useQuery } from "@tanstack/react-query";
|
|
4
5
|
function useDashboardStats() {
|
|
5
|
-
let
|
|
6
|
-
|
|
7
|
-
"dashboard",
|
|
8
|
-
"stats",
|
|
9
|
-
i
|
|
10
|
-
], r[0] = i, r[1] = o);
|
|
11
|
-
let s;
|
|
12
|
-
r[2] === a ? s = r[3] : (s = () => a.dashboard.getStats(), r[2] = a, r[3] = s);
|
|
6
|
+
let i = c(7), { envKey: a, api: o } = useApiClient(), s;
|
|
7
|
+
i[0] === a ? s = i[1] : (s = getDashboardStatsCacheKey(a), i[0] = a, i[1] = s);
|
|
13
8
|
let l;
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
9
|
+
i[2] === o ? l = i[3] : (l = () => o.dashboard.getStats(), i[2] = o, i[3] = l);
|
|
10
|
+
let u;
|
|
11
|
+
return i[4] !== s || i[5] !== l ? (u = {
|
|
12
|
+
queryKey: s,
|
|
13
|
+
queryFn: l
|
|
14
|
+
}, i[4] = s, i[5] = l, i[6] = u) : u = i[6], useQuery(u);
|
|
19
15
|
}
|
|
20
16
|
export { useDashboardStats };
|
|
@@ -4,24 +4,15 @@ function useDebounce(r, i) {
|
|
|
4
4
|
let a = c(4), o = i === void 0 ? 500 : i, [s, l] = useState(r), u, d;
|
|
5
5
|
return a[0] !== o || a[1] !== r ? (u = () => {
|
|
6
6
|
if (typeof r == "string") {
|
|
7
|
-
let e = r;
|
|
8
|
-
if (
|
|
9
|
-
let e = setTimeout(() => {
|
|
10
|
-
l(r);
|
|
11
|
-
}, o);
|
|
12
|
-
return () => {
|
|
13
|
-
clearTimeout(e);
|
|
14
|
-
};
|
|
15
|
-
}
|
|
16
|
-
return;
|
|
17
|
-
} else {
|
|
18
|
-
let e = setTimeout(() => {
|
|
19
|
-
l(r);
|
|
20
|
-
}, o);
|
|
21
|
-
return () => {
|
|
22
|
-
clearTimeout(e);
|
|
23
|
-
};
|
|
7
|
+
let e = r.length;
|
|
8
|
+
if (e > 0 && e < 3) return;
|
|
24
9
|
}
|
|
10
|
+
let e = setTimeout(() => {
|
|
11
|
+
l(r);
|
|
12
|
+
}, o);
|
|
13
|
+
return () => {
|
|
14
|
+
clearTimeout(e);
|
|
15
|
+
};
|
|
25
16
|
}, d = [r, o], a[0] = o, a[1] = r, a[2] = u, a[3] = d) : (u = a[2], d = a[3]), useEffect(u, d), s;
|
|
26
17
|
}
|
|
27
18
|
export { useDebounce };
|
|
@@ -1,13 +1,7 @@
|
|
|
1
|
+
import { getDocumentsCacheKey } from "./query-keys.js";
|
|
1
2
|
import { useApiClient } from "./useApi.js";
|
|
2
3
|
import { c } from "react/compiler-runtime";
|
|
3
4
|
import { useQuery } from "@tanstack/react-query";
|
|
4
|
-
function getDocumentsCacheKey(e, i) {
|
|
5
|
-
return [
|
|
6
|
-
"documents",
|
|
7
|
-
e,
|
|
8
|
-
i
|
|
9
|
-
];
|
|
10
|
-
}
|
|
11
5
|
function useFilterDocuments(a) {
|
|
12
6
|
let o = c(15), { envKey: s, api: l } = useApiClient(), u;
|
|
13
7
|
o[0] === a ? u = o[1] : (u = JSON.stringify({
|
|
@@ -27,15 +21,16 @@ function useFilterDocuments(a) {
|
|
|
27
21
|
let p = f, m;
|
|
28
22
|
o[5] !== s || o[6] !== a ? (m = getDocumentsCacheKey(s, a), o[5] = s, o[6] = a, o[7] = m) : m = o[7];
|
|
29
23
|
let h;
|
|
30
|
-
o[8] !== l || o[9] !== p ? (h = () => l.documents.getAll(p)
|
|
24
|
+
o[8] !== l || o[9] !== p ? (h = () => l.documents.getAll(p), o[8] = l, o[9] = p, o[10] = h) : h = o[10];
|
|
31
25
|
let g = !!a, _;
|
|
32
26
|
return o[11] !== m || o[12] !== h || o[13] !== g ? (_ = {
|
|
33
27
|
queryKey: m,
|
|
34
28
|
queryFn: h,
|
|
29
|
+
select: _temp,
|
|
35
30
|
enabled: g
|
|
36
31
|
}, o[11] = m, o[12] = h, o[13] = g, o[14] = _) : _ = o[14], useQuery(_);
|
|
37
32
|
}
|
|
38
33
|
function _temp(e) {
|
|
39
34
|
return e.data;
|
|
40
35
|
}
|
|
41
|
-
export {
|
|
36
|
+
export { useFilterDocuments };
|
package/dist/hooks/useFiles.js
CHANGED
|
@@ -1,53 +1,45 @@
|
|
|
1
|
+
import { getFileContentCacheKey, getFileTreeCacheKey } from "./query-keys.js";
|
|
1
2
|
import { useApiClient } from "./useApi.js";
|
|
2
3
|
import { c } from "react/compiler-runtime";
|
|
3
4
|
import { useQuery } from "@tanstack/react-query";
|
|
4
|
-
function useFileTree(
|
|
5
|
-
let
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
return o[6] !== d || o[7] !== f || o[8] !== p ? (m = {
|
|
18
|
-
queryKey: d,
|
|
19
|
-
queryFn: f,
|
|
20
|
-
enabled: p,
|
|
5
|
+
function useFileTree(e, a) {
|
|
6
|
+
let s = c(10), l = a === void 0 ? !0 : a, { envKey: u, api: d } = useApiClient(), f;
|
|
7
|
+
s[0] !== u || s[1] !== e ? (f = getFileTreeCacheKey(u, e), s[0] = u, s[1] = e, s[2] = f) : f = s[2];
|
|
8
|
+
let p;
|
|
9
|
+
s[3] !== d || s[4] !== e ? (p = () => {
|
|
10
|
+
if (!e) throw Error("Pipeline ID is required");
|
|
11
|
+
return d.pipelines.getFileTree({ pipelineId: e });
|
|
12
|
+
}, s[3] = d, s[4] = e, s[5] = p) : p = s[5];
|
|
13
|
+
let m = !!e && l, h;
|
|
14
|
+
return s[6] !== f || s[7] !== p || s[8] !== m ? (h = {
|
|
15
|
+
queryKey: f,
|
|
16
|
+
queryFn: p,
|
|
17
|
+
enabled: m,
|
|
21
18
|
staleTime: 3e5,
|
|
22
19
|
refetchOnMount: !1,
|
|
23
20
|
refetchOnWindowFocus: !1,
|
|
24
21
|
placeholderData: _temp
|
|
25
|
-
},
|
|
22
|
+
}, s[6] = f, s[7] = p, s[8] = m, s[9] = h) : h = s[9], useQuery(h);
|
|
26
23
|
}
|
|
27
24
|
function _temp(e) {
|
|
28
25
|
return e;
|
|
29
26
|
}
|
|
30
|
-
function useFileContent(
|
|
31
|
-
let
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
i
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
o[4] !== u || o[5] !== i || o[6] !== r ? (f = () => {
|
|
40
|
-
if (!r || !i) throw Error("Pipeline ID and file path are required");
|
|
41
|
-
return u.pipelines.getFileContent({
|
|
42
|
-
pipelineId: r,
|
|
43
|
-
filePath: i
|
|
27
|
+
function useFileContent(i, a, o) {
|
|
28
|
+
let s = c(12), l = o === void 0 ? !0 : o, { envKey: u, api: d } = useApiClient(), f;
|
|
29
|
+
s[0] !== u || s[1] !== a || s[2] !== i ? (f = getFileContentCacheKey(u, i, a), s[0] = u, s[1] = a, s[2] = i, s[3] = f) : f = s[3];
|
|
30
|
+
let p;
|
|
31
|
+
s[4] !== d || s[5] !== a || s[6] !== i ? (p = () => {
|
|
32
|
+
if (!i || !a) throw Error("Pipeline ID and file path are required");
|
|
33
|
+
return d.pipelines.getFileContent({
|
|
34
|
+
pipelineId: i,
|
|
35
|
+
filePath: a
|
|
44
36
|
});
|
|
45
|
-
},
|
|
46
|
-
let
|
|
47
|
-
return
|
|
48
|
-
queryKey:
|
|
49
|
-
queryFn:
|
|
50
|
-
enabled:
|
|
51
|
-
},
|
|
37
|
+
}, s[4] = d, s[5] = a, s[6] = i, s[7] = p) : p = s[7];
|
|
38
|
+
let m = !!i && !!a && l, h;
|
|
39
|
+
return s[8] !== f || s[9] !== p || s[10] !== m ? (h = {
|
|
40
|
+
queryKey: f,
|
|
41
|
+
queryFn: p,
|
|
42
|
+
enabled: m
|
|
43
|
+
}, s[8] = f, s[9] = p, s[10] = m, s[11] = h) : h = s[11], useQuery(h);
|
|
52
44
|
}
|
|
53
45
|
export { useFileContent, useFileTree };
|
|
@@ -1,13 +1,7 @@
|
|
|
1
|
+
import { getNamespacesByPipelineCacheKey } from "./query-keys.js";
|
|
1
2
|
import { useApiClient } from "./useApi.js";
|
|
2
3
|
import { c } from "react/compiler-runtime";
|
|
3
4
|
import { useQuery } from "@tanstack/react-query";
|
|
4
|
-
function getNamespacesByPipelineCacheKey(e, i) {
|
|
5
|
-
return [
|
|
6
|
-
"namespaces",
|
|
7
|
-
e,
|
|
8
|
-
i
|
|
9
|
-
];
|
|
10
|
-
}
|
|
11
5
|
function useFilterNamespaces(a) {
|
|
12
6
|
let o = c(14), { envKey: s, api: l } = useApiClient(), u;
|
|
13
7
|
o[0] === a ? u = o[1] : (u = JSON.stringify({ pipelineId: a }), o[0] = a, o[1] = u);
|
|
@@ -28,4 +22,4 @@ function useFilterNamespaces(a) {
|
|
|
28
22
|
function _temp(e) {
|
|
29
23
|
return e.data;
|
|
30
24
|
}
|
|
31
|
-
export {
|
|
25
|
+
export { useFilterNamespaces };
|