@loopstack/loopstack-studio 0.21.3 → 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/api/auth.js +10 -0
- package/dist/api/client.js +13 -0
- package/dist/api/config.js +10 -0
- package/dist/api/dashboard.js +4 -0
- package/dist/api/documents.js +7 -0
- package/dist/api/index.js +24 -0
- package/dist/api/namespaces.js +7 -0
- package/dist/api/pipelines.js +13 -0
- package/dist/api/processor.js +4 -0
- package/dist/api/workflows.js +8 -0
- package/dist/api/workspaces.js +12 -0
- package/dist/app/EnvironmentEmbedRoot.js +35 -0
- package/dist/components/data-table/DataTableFilters.js +74 -63
- 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 +36 -17
- package/dist/components/layout/StudioSidebar.js +165 -0
- package/dist/components/page/PageBreadcrumbs.js +1 -1
- package/dist/components/ui/sidebar.js +359 -359
- package/dist/components/ui-widgets/UiActions.js +22 -15
- package/dist/components/ui-widgets/UiWidget.js +31 -26
- package/dist/components/ui-widgets/widgets/AiPromptInput.js +27 -27
- package/dist/components/ui-widgets/widgets/ButtonFullWidth.js +12 -12
- package/dist/components/ui-widgets/widgets/SandboxRun.js +33 -0
- package/dist/components/ui-widgets/widgets/SubmitButton.js +11 -11
- package/dist/features/code-explorer/CodeExplorer.js +4 -67
- package/dist/features/code-explorer/components/CodeExplorerTree.js +3 -41
- package/dist/features/code-explorer/components/CodeExplorerTreeNode.js +4 -80
- 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/code-explorer/utils/fileIcons.js +4 -7
- 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/documents/components/DocumentList.js +40 -0
- 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 +9 -8
- 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/oauth/OAuthPromptRenderer.js +1 -1
- package/dist/features/runs/Runs.js +197 -0
- package/dist/features/workbench/NavigationItems.js +29 -29
- package/dist/features/workbench/Workbench.js +100 -78
- package/dist/features/workbench/WorkflowItem.js +63 -58
- package/dist/features/workbench/WorkflowList.js +62 -82
- package/dist/features/workbench/components/NewRunDialog.js +329 -0
- package/dist/features/workbench/components/WorkbenchFloatingPanel.js +88 -0
- package/dist/features/workbench/components/WorkbenchFlowPanel.js +49 -0
- package/dist/features/workbench/components/WorkbenchIconSidebar.js +68 -0
- package/dist/features/workbench/components/WorkbenchPreviewPanel.js +128 -0
- package/dist/features/workbench/components/WorkflowForms.js +7 -6
- package/dist/features/workbench/components/WorkflowHistoryItem.js +74 -69
- package/dist/features/workbench/components/buttons/WorkflowButtons.js +78 -61
- 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 +76 -0
- package/dist/features/workspaces/Workspaces.js +2 -2
- package/dist/features/workspaces/components/CreateWorkspace.js +165 -82
- package/dist/features/workspaces/components/EnvironmentSlotSelector.js +63 -0
- package/dist/features/workspaces/components/ExecutionTimeline.js +70 -69
- package/dist/features/workspaces/components/PipelineForm.js +4 -4
- package/dist/features/workspaces/index.js +3 -0
- package/dist/hooks/index.js +3 -0
- package/dist/hooks/query-keys.js +138 -0
- package/dist/hooks/useApi.js +9 -33
- package/dist/hooks/useAuth.js +37 -56
- package/dist/hooks/useConfig.js +27 -33
- package/dist/hooks/useDashboard.js +9 -16
- package/dist/hooks/useDebounce.js +8 -17
- package/dist/hooks/useDocuments.js +7 -16
- package/dist/hooks/useFiles.js +24 -42
- package/dist/hooks/useNamespaces.js +7 -16
- package/dist/hooks/usePipelines.js +141 -174
- package/dist/hooks/useProcessor.js +11 -17
- package/dist/hooks/useWorkflows.js +51 -89
- package/dist/hooks/useWorkspaces.js +97 -129
- package/dist/index.d.ts +364 -50
- package/dist/index.js +21 -6
- package/dist/packages/contracts/dist/enums/index.js +25 -0
- package/dist/packages/contracts/dist/enums/pipeline-state.js +10 -0
- package/dist/packages/contracts/dist/enums/registry.enum.js +20 -0
- package/dist/packages/contracts/dist/enums/sort-order.enum.js +10 -0
- package/dist/packages/contracts/dist/enums/user-type.enum.js +10 -0
- package/dist/packages/contracts/dist/enums/workflow-state.enum.js +10 -0
- package/dist/pages/DashboardPage.js +1 -1
- package/dist/pages/DebugPage.js +12 -14
- package/dist/pages/DebugWorkflowDetailsPage.js +2 -2
- package/dist/pages/DebugWorkflowsPage.js +3 -4
- package/dist/pages/EmbedWorkbenchPage.js +7 -5
- package/dist/pages/PipelineDebugPage.js +7 -6
- package/dist/pages/PreviewWorkbenchPage.js +419 -0
- package/dist/pages/RunsListPage.js +64 -0
- package/dist/pages/RunsPage.js +49 -0
- package/dist/pages/StudioLandingPage.js +146 -0
- package/dist/pages/WorkbenchPage.js +78 -53
- package/dist/pages/WorkspacePage.js +1 -1
- package/dist/providers/InvalidationEventsProvider.js +15 -17
- package/dist/providers/QueryProvider.js +21 -0
- package/dist/providers/StudioProvider.js +2 -2
- package/dist/routing/LocalRouter.js +20 -7
- package/dist/services/createApiClient.js +4 -10
- package/dist/services/index.js +1 -1
- package/package.json +2 -3
- package/dist/features/workbench/components/DocumentList.js +0 -40
- package/dist/features/workbench/components/DocumentRenderer.js +0 -54
- package/dist/features/workbench/components/WorkbenchSidebar.js +0 -109
- package/dist/features/workbench/providers/WorkbenchContextProvider.js +0 -3
- /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/components/document-renderer → documents/renderers}/AiMessageContent.js +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useStudio } from "../../../providers/StudioProvider.js";
|
|
2
|
-
import ErrorSnackbar_default from "../../../components/snackbars/ErrorSnackbar.js";
|
|
3
2
|
import { usePipelineConfig } from "../../../hooks/useConfig.js";
|
|
4
3
|
import { useCreatePipeline } from "../../../hooks/usePipelines.js";
|
|
4
|
+
import ErrorSnackbar_default from "../../../components/feedback/ErrorSnackbar.js";
|
|
5
5
|
import ArgumentsView_default from "./pipeline-form/ArgumentsView.js";
|
|
6
6
|
import SelectionView_default from "./pipeline-form/SelectionView.js";
|
|
7
7
|
import { useRunPipeline } from "../../../hooks/useProcessor.js";
|
|
@@ -56,14 +56,14 @@ var PipelineForm_default = (l) => {
|
|
|
56
56
|
blockName: b.blockName,
|
|
57
57
|
title: b.name || null,
|
|
58
58
|
workspaceId: f.id,
|
|
59
|
-
transition: e,
|
|
59
|
+
transition: e ?? null,
|
|
60
60
|
args: o
|
|
61
61
|
} }, { onSuccess: (e) => {
|
|
62
62
|
h.mutate({
|
|
63
|
-
pipelineId: e.
|
|
63
|
+
pipelineId: e.id,
|
|
64
64
|
runPipelinePayloadDto: {},
|
|
65
65
|
force: !0
|
|
66
|
-
}, { onSuccess: () => P(e.
|
|
66
|
+
}, { onSuccess: () => P(e.id) });
|
|
67
67
|
} });
|
|
68
68
|
}, u[15] = m, u[16] = b.blockName, u[17] = b.name, u[18] = P, u[19] = h, u[20] = f.id, u[21] = F) : F = u[21];
|
|
69
69
|
let I = F, L;
|
package/dist/hooks/index.js
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { getAllWorkflowsCacheKey, getAvailableEnvironmentsCacheKey, getDashboardStatsCacheKey, getDocumentCacheKey, getDocumentsCacheKey, getFileContentCacheKey, getFileTreeCacheKey, getHealthCacheKey, getMeCacheKey, getNamespaceCacheKey, getNamespacesByPipelineCacheKey, getPipelineCacheKey, getPipelineConfigCacheKey, getPipelineSourceCacheKey, getPipelineTypesCacheKey, getPipelinesCacheKey, getPipelinesChildrenCacheKey, getWorkflowCacheKey, getWorkflowsByPipelineCacheKey, getWorkflowsCacheKey, getWorkspaceCacheKey, getWorkspaceTypesCacheKey, getWorkspacesCacheKey } from "./query-keys.js";
|
|
1
2
|
import { useApiClient } from "./useApi.js";
|
|
2
3
|
import { useIsMobile } from "./use-mobile.js";
|
|
4
|
+
import { useAvailableEnvironments, usePipelineConfig, useWorkspaceConfig } from "./useConfig.js";
|
|
5
|
+
import { useBatchDeletePipeline, useChildPipelines, useCreatePipeline, useDeletePipeline, useFilterPipelines, usePipeline, usePipelineConfigByName, usePipelineSource, useUpdatePipeline } from "./usePipelines.js";
|
|
3
6
|
import { useBatchDeleteWorkspaces, useCreateWorkspace, useDeleteWorkspace, useFilterWorkspaces, useSetFavouriteWorkspace, useUpdateWorkspace, useWorkspace } from "./useWorkspaces.js";
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
function getMeCacheKey(e) {
|
|
2
|
+
return ["me", e];
|
|
3
|
+
}
|
|
4
|
+
function getHealthCacheKey(e) {
|
|
5
|
+
return ["health", e];
|
|
6
|
+
}
|
|
7
|
+
function getWorkspaceTypesCacheKey(e) {
|
|
8
|
+
return ["workspace-types", e];
|
|
9
|
+
}
|
|
10
|
+
function getPipelineTypesCacheKey(e, x) {
|
|
11
|
+
return [
|
|
12
|
+
"pipeline-types",
|
|
13
|
+
e,
|
|
14
|
+
x
|
|
15
|
+
];
|
|
16
|
+
}
|
|
17
|
+
function getAvailableEnvironmentsCacheKey(e) {
|
|
18
|
+
return ["available-environments", e];
|
|
19
|
+
}
|
|
20
|
+
function getDashboardStatsCacheKey(e) {
|
|
21
|
+
return [
|
|
22
|
+
"dashboard",
|
|
23
|
+
"stats",
|
|
24
|
+
e
|
|
25
|
+
];
|
|
26
|
+
}
|
|
27
|
+
function getPipelineCacheKey(e, x) {
|
|
28
|
+
return [
|
|
29
|
+
"pipeline",
|
|
30
|
+
e,
|
|
31
|
+
x
|
|
32
|
+
];
|
|
33
|
+
}
|
|
34
|
+
function getPipelinesCacheKey(e) {
|
|
35
|
+
return ["pipelines", e];
|
|
36
|
+
}
|
|
37
|
+
function getPipelinesChildrenCacheKey(e, x) {
|
|
38
|
+
return [
|
|
39
|
+
"pipelines",
|
|
40
|
+
"children",
|
|
41
|
+
e,
|
|
42
|
+
x
|
|
43
|
+
];
|
|
44
|
+
}
|
|
45
|
+
function getPipelineConfigCacheKey(e, x, S) {
|
|
46
|
+
return [
|
|
47
|
+
"pipelineConfig",
|
|
48
|
+
e,
|
|
49
|
+
x,
|
|
50
|
+
S
|
|
51
|
+
];
|
|
52
|
+
}
|
|
53
|
+
function getPipelineSourceCacheKey(e, x, S) {
|
|
54
|
+
return [
|
|
55
|
+
"pipelineSource",
|
|
56
|
+
e,
|
|
57
|
+
x,
|
|
58
|
+
S
|
|
59
|
+
];
|
|
60
|
+
}
|
|
61
|
+
function getWorkspaceCacheKey(e, x) {
|
|
62
|
+
return [
|
|
63
|
+
"workspace",
|
|
64
|
+
e,
|
|
65
|
+
x
|
|
66
|
+
];
|
|
67
|
+
}
|
|
68
|
+
function getWorkspacesCacheKey(e) {
|
|
69
|
+
return ["workspaces", e];
|
|
70
|
+
}
|
|
71
|
+
function getWorkflowCacheKey(e, x) {
|
|
72
|
+
return [
|
|
73
|
+
"workflow",
|
|
74
|
+
e,
|
|
75
|
+
x
|
|
76
|
+
];
|
|
77
|
+
}
|
|
78
|
+
function getWorkflowsCacheKey(e, x) {
|
|
79
|
+
return [
|
|
80
|
+
"workflows",
|
|
81
|
+
e,
|
|
82
|
+
x
|
|
83
|
+
];
|
|
84
|
+
}
|
|
85
|
+
function getWorkflowsByPipelineCacheKey(e, x) {
|
|
86
|
+
return [
|
|
87
|
+
"workflows-by-pipeline",
|
|
88
|
+
e,
|
|
89
|
+
x
|
|
90
|
+
];
|
|
91
|
+
}
|
|
92
|
+
function getAllWorkflowsCacheKey(e) {
|
|
93
|
+
return ["all-workflows", e];
|
|
94
|
+
}
|
|
95
|
+
function getNamespaceCacheKey(e, x) {
|
|
96
|
+
return [
|
|
97
|
+
"namespace",
|
|
98
|
+
e,
|
|
99
|
+
x
|
|
100
|
+
];
|
|
101
|
+
}
|
|
102
|
+
function getNamespacesByPipelineCacheKey(e, x) {
|
|
103
|
+
return [
|
|
104
|
+
"namespaces",
|
|
105
|
+
e,
|
|
106
|
+
x
|
|
107
|
+
];
|
|
108
|
+
}
|
|
109
|
+
function getDocumentCacheKey(e, x) {
|
|
110
|
+
return [
|
|
111
|
+
"document",
|
|
112
|
+
e,
|
|
113
|
+
x
|
|
114
|
+
];
|
|
115
|
+
}
|
|
116
|
+
function getDocumentsCacheKey(e, x) {
|
|
117
|
+
return [
|
|
118
|
+
"documents",
|
|
119
|
+
e,
|
|
120
|
+
x
|
|
121
|
+
];
|
|
122
|
+
}
|
|
123
|
+
function getFileTreeCacheKey(e, x) {
|
|
124
|
+
return [
|
|
125
|
+
"fileTree",
|
|
126
|
+
e,
|
|
127
|
+
x
|
|
128
|
+
];
|
|
129
|
+
}
|
|
130
|
+
function getFileContentCacheKey(e, x, S) {
|
|
131
|
+
return [
|
|
132
|
+
"fileContent",
|
|
133
|
+
e,
|
|
134
|
+
x,
|
|
135
|
+
S
|
|
136
|
+
];
|
|
137
|
+
}
|
|
138
|
+
export { getAllWorkflowsCacheKey, getAvailableEnvironmentsCacheKey, getDashboardStatsCacheKey, getDocumentCacheKey, getDocumentsCacheKey, getFileContentCacheKey, getFileTreeCacheKey, getHealthCacheKey, getMeCacheKey, getNamespaceCacheKey, getNamespacesByPipelineCacheKey, getPipelineCacheKey, getPipelineConfigCacheKey, getPipelineSourceCacheKey, getPipelineTypesCacheKey, getPipelinesCacheKey, getPipelinesChildrenCacheKey, getWorkflowCacheKey, getWorkflowsByPipelineCacheKey, getWorkflowsCacheKey, getWorkspaceCacheKey, getWorkspaceTypesCacheKey, getWorkspacesCacheKey };
|
package/dist/hooks/useApi.js
CHANGED
|
@@ -1,39 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import "../services/index.js";
|
|
1
|
+
import { createAxiosClient } from "../api/client.js";
|
|
2
|
+
import { createApi } from "../api/index.js";
|
|
4
3
|
import { useStudio } from "../providers/StudioProvider.js";
|
|
5
4
|
import { c } from "react/compiler-runtime";
|
|
6
|
-
import axios from "axios";
|
|
7
5
|
import { useMemo } from "react";
|
|
8
|
-
import { ApiV1AuthApi, ApiV1ConfigApi, ApiV1DashboardApi, ApiV1DocumentsApi, ApiV1NamespacesApi, ApiV1PipelinesApi, ApiV1ProcessorApi, ApiV1WorkflowsApi, ApiV1WorkspacesApi, Configuration } from "@loopstack/api-client";
|
|
9
6
|
function useApiClient() {
|
|
10
|
-
let
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
} else b = _[2], x = _[3], S = _[4], C = _[5], w = _[6], T = _[7], E = _[8], D = _[9], O = _[10];
|
|
18
|
-
let k;
|
|
19
|
-
_[11] !== b || _[12] !== x || _[13] !== S || _[14] !== C || _[15] !== w || _[16] !== T || _[17] !== E || _[18] !== D || _[19] !== O ? (k = {
|
|
20
|
-
ApiV1AuthApi: b,
|
|
21
|
-
ApiV1DashboardApi: x,
|
|
22
|
-
ApiV1ConfigApi: S,
|
|
23
|
-
ApiV1DocumentsApi: C,
|
|
24
|
-
ApiV1NamespacesApi: w,
|
|
25
|
-
ApiV1PipelinesApi: T,
|
|
26
|
-
ApiV1ProcessorApi: E,
|
|
27
|
-
ApiV1WorkflowsApi: D,
|
|
28
|
-
ApiV1WorkspacesApi: O
|
|
29
|
-
}, _[11] = b, _[12] = x, _[13] = S, _[14] = C, _[15] = w, _[16] = T, _[17] = E, _[18] = D, _[19] = O, _[20] = k) : k = _[20];
|
|
30
|
-
let A = k, j;
|
|
31
|
-
return _[21] !== A || _[22] !== v.id ? (j = {
|
|
32
|
-
envKey: v.id,
|
|
33
|
-
api: A
|
|
34
|
-
}, _[21] = A, _[22] = v.id, _[23] = j) : j = _[23], j;
|
|
35
|
-
}
|
|
36
|
-
function _temp(n) {
|
|
37
|
-
return n;
|
|
7
|
+
let i = c(6), { environment: a } = useStudio(), o;
|
|
8
|
+
i[0] !== a.id || i[1] !== a.url ? (o = createApi(createAxiosClient(a.url, a.id)), i[0] = a.id, i[1] = a.url, i[2] = o) : o = i[2];
|
|
9
|
+
let s = o, l;
|
|
10
|
+
return i[3] !== s || i[4] !== a.id ? (l = {
|
|
11
|
+
envKey: a.id,
|
|
12
|
+
api: s
|
|
13
|
+
}, i[3] = s, i[4] = a.id, i[5] = l) : l = i[5], l;
|
|
38
14
|
}
|
|
39
15
|
export { useApiClient };
|
package/dist/hooks/useAuth.js
CHANGED
|
@@ -1,77 +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] === s ? u = i[1] : (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);
|
|
7
8
|
let d;
|
|
8
|
-
i[2] === l ? d = i[3] : (d = () =>
|
|
9
|
-
if (!l) throw Error("API not available");
|
|
10
|
-
return l.ApiV1AuthApi.authControllerMe();
|
|
11
|
-
}, i[2] = l, i[3] = d);
|
|
9
|
+
i[2] === l ? d = i[3] : (d = () => l.auth.me(), i[2] = l, i[3] = d);
|
|
12
10
|
let f;
|
|
13
|
-
return i[4] !==
|
|
11
|
+
return i[4] !== o || i[5] !== u || i[6] !== d ? (f = {
|
|
14
12
|
queryKey: u,
|
|
15
13
|
queryFn: d,
|
|
16
|
-
select: _temp,
|
|
17
14
|
retry: !1,
|
|
18
15
|
staleTime: 3e5,
|
|
19
|
-
enabled:
|
|
20
|
-
}, i[4] =
|
|
16
|
+
enabled: o
|
|
17
|
+
}, i[4] = o, i[5] = u, i[6] = d, i[7] = f) : f = i[7], useQuery(f);
|
|
21
18
|
}
|
|
22
|
-
function
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
function useGetHealthInfo(n) {
|
|
26
|
-
let i = c(8), a = n === void 0 ? !0 : n, { envKey: o, api: s } = useApiClient(), u;
|
|
27
|
-
i[0] === o ? u = i[1] : (u = ["health", o], i[0] = o, i[1] = 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);
|
|
28
22
|
let d;
|
|
29
|
-
i[2] ===
|
|
30
|
-
if (!s) throw Error("API not available");
|
|
31
|
-
return s.ApiV1AuthApi.authControllerGetInfo();
|
|
32
|
-
}, i[2] = s, i[3] = d);
|
|
23
|
+
i[2] === l ? d = i[3] : (d = () => l.auth.getInfo(), i[2] = l, i[3] = d);
|
|
33
24
|
let f;
|
|
34
|
-
return i[4] !==
|
|
25
|
+
return i[4] !== o || i[5] !== u || i[6] !== d ? (f = {
|
|
35
26
|
queryKey: u,
|
|
36
27
|
queryFn: d,
|
|
37
|
-
select: _temp2,
|
|
38
28
|
staleTime: 3e5,
|
|
39
|
-
enabled:
|
|
40
|
-
}, i[4] =
|
|
41
|
-
}
|
|
42
|
-
function _temp2(e) {
|
|
43
|
-
return e.data;
|
|
29
|
+
enabled: o
|
|
30
|
+
}, i[4] = o, i[5] = u, i[6] = d, i[7] = f) : f = i[7], useQuery(f);
|
|
44
31
|
}
|
|
45
32
|
function useWorkerAuth() {
|
|
46
|
-
let
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
mutationFn: s,
|
|
58
|
-
onSuccess: l
|
|
59
|
-
}, r[4] = s, r[5] = l, r[6] = u) : u = r[6], useMutation(u);
|
|
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);
|
|
60
44
|
}
|
|
61
45
|
function useWorkerAuthTokenRefresh() {
|
|
62
|
-
let
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
mutationFn: s,
|
|
74
|
-
onSuccess: l
|
|
75
|
-
}, r[4] = s, r[5] = l, r[6] = u) : u = r[6], useMutation(u);
|
|
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);
|
|
76
57
|
}
|
|
77
58
|
export { useGetHealthInfo, useMe, useWorkerAuth, useWorkerAuthTokenRefresh };
|
package/dist/hooks/useConfig.js
CHANGED
|
@@ -1,46 +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
|
-
|
|
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);
|
|
7
8
|
let l;
|
|
8
|
-
|
|
9
|
-
if (!o) throw Error("API not available");
|
|
10
|
-
return o.ApiV1ConfigApi.configControllerGetWorkspaceTypes();
|
|
11
|
-
}, r[2] = o, r[3] = l);
|
|
9
|
+
e[2] === o ? l = e[3] : (l = () => o.config.getWorkspaceTypes(), e[2] = o, e[3] = l);
|
|
12
10
|
let u;
|
|
13
|
-
return
|
|
11
|
+
return e[4] !== s || e[5] !== l ? (u = {
|
|
14
12
|
queryKey: s,
|
|
15
|
-
queryFn: l
|
|
16
|
-
|
|
17
|
-
enabled: !0
|
|
18
|
-
}, r[4] = s, r[5] = l, r[6] = u) : u = r[6], useQuery(u);
|
|
13
|
+
queryFn: l
|
|
14
|
+
}, e[4] = s, e[5] = l, e[6] = u) : u = e[6], useQuery(u);
|
|
19
15
|
}
|
|
20
|
-
function
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
function usePipelineConfig(r) {
|
|
24
|
-
let i = c(10), { envKey: a, api: s } = useApiClient(), l;
|
|
25
|
-
i[0] !== a || i[1] !== r ? (l = [
|
|
26
|
-
"pipeline-types",
|
|
27
|
-
r,
|
|
28
|
-
a
|
|
29
|
-
], i[0] = a, i[1] = r, i[2] = l) : l = i[2];
|
|
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];
|
|
30
19
|
let u;
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}, i[3] = s, i[4] = r, i[5] = u) : u = i[5];
|
|
35
|
-
let d = !!r, f;
|
|
36
|
-
return i[6] !== l || i[7] !== u || i[8] !== d ? (f = {
|
|
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 = {
|
|
37
23
|
queryKey: l,
|
|
38
24
|
queryFn: u,
|
|
39
|
-
enabled: d
|
|
40
|
-
|
|
41
|
-
}, i[6] = l, i[7] = u, i[8] = d, i[9] = f) : f = i[9], useQuery(f);
|
|
25
|
+
enabled: d
|
|
26
|
+
}, a[6] = l, a[7] = u, a[8] = d, a[9] = f) : f = a[9], useQuery(f);
|
|
42
27
|
}
|
|
43
|
-
function
|
|
44
|
-
|
|
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);
|
|
45
39
|
}
|
|
46
|
-
export { usePipelineConfig, useWorkspaceConfig };
|
|
40
|
+
export { useAvailableEnvironments, usePipelineConfig, useWorkspaceConfig };
|
|
@@ -1,23 +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 = async () => {
|
|
13
|
-
if (!a) throw Error("API not available");
|
|
14
|
-
return (await a.ApiV1DashboardApi.dashboardControllerGetDashboardStats()).data;
|
|
15
|
-
}, 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);
|
|
16
8
|
let l;
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
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);
|
|
22
15
|
}
|
|
23
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,19 +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 = () =>
|
|
31
|
-
if (!l) throw Error("API not available");
|
|
32
|
-
return l.ApiV1DocumentsApi.documentControllerGetDocuments(p);
|
|
33
|
-
}, o[8] = l, o[9] = p, o[10] = h) : h = o[10];
|
|
24
|
+
o[8] !== l || o[9] !== p ? (h = () => l.documents.getAll(p), o[8] = l, o[9] = p, o[10] = h) : h = o[10];
|
|
34
25
|
let g = !!a, _;
|
|
35
26
|
return o[11] !== m || o[12] !== h || o[13] !== g ? (_ = {
|
|
36
27
|
queryKey: m,
|
|
37
28
|
queryFn: h,
|
|
38
|
-
|
|
39
|
-
|
|
29
|
+
select: _temp,
|
|
30
|
+
enabled: g
|
|
40
31
|
}, o[11] = m, o[12] = h, o[13] = g, o[14] = _) : _ = o[14], useQuery(_);
|
|
41
32
|
}
|
|
42
|
-
function
|
|
43
|
-
return e.data
|
|
33
|
+
function _temp(e) {
|
|
34
|
+
return e.data;
|
|
44
35
|
}
|
|
45
|
-
export {
|
|
36
|
+
export { useFilterDocuments };
|
package/dist/hooks/useFiles.js
CHANGED
|
@@ -1,63 +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 s = c(10), l =
|
|
6
|
-
s[0] !== u || s[1] !==
|
|
7
|
-
"fileTree",
|
|
8
|
-
r,
|
|
9
|
-
u
|
|
10
|
-
], s[0] = u, s[1] = r, s[2] = f) : f = s[2];
|
|
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];
|
|
11
8
|
let p;
|
|
12
|
-
s[3] !== d || s[4] !==
|
|
13
|
-
if (!
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
let m = !!r && l, h;
|
|
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;
|
|
18
14
|
return s[6] !== f || s[7] !== p || s[8] !== m ? (h = {
|
|
19
15
|
queryKey: f,
|
|
20
16
|
queryFn: p,
|
|
21
17
|
enabled: m,
|
|
22
|
-
select: _temp,
|
|
23
18
|
staleTime: 3e5,
|
|
24
19
|
refetchOnMount: !1,
|
|
25
20
|
refetchOnWindowFocus: !1,
|
|
26
|
-
placeholderData:
|
|
21
|
+
placeholderData: _temp
|
|
27
22
|
}, s[6] = f, s[7] = p, s[8] = m, s[9] = h) : h = s[9], useQuery(h);
|
|
28
23
|
}
|
|
29
|
-
function _temp2(e) {
|
|
30
|
-
return e;
|
|
31
|
-
}
|
|
32
24
|
function _temp(e) {
|
|
33
|
-
return e
|
|
25
|
+
return e;
|
|
34
26
|
}
|
|
35
|
-
function useFileContent(
|
|
36
|
-
let
|
|
37
|
-
|
|
38
|
-
"fileContent",
|
|
39
|
-
r,
|
|
40
|
-
i,
|
|
41
|
-
u
|
|
42
|
-
], o[0] = u, o[1] = i, o[2] = r, o[3] = f) : f = o[3];
|
|
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];
|
|
43
30
|
let p;
|
|
44
|
-
|
|
45
|
-
if (!
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
filePath: i
|
|
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
|
|
50
36
|
});
|
|
51
|
-
},
|
|
52
|
-
let m = !!
|
|
53
|
-
return
|
|
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 = {
|
|
54
40
|
queryKey: f,
|
|
55
41
|
queryFn: p,
|
|
56
|
-
enabled: m
|
|
57
|
-
|
|
58
|
-
}, o[8] = f, o[9] = p, o[10] = m, o[11] = h) : h = o[11], useQuery(h);
|
|
59
|
-
}
|
|
60
|
-
function _temp3(e) {
|
|
61
|
-
return e.data;
|
|
42
|
+
enabled: m
|
|
43
|
+
}, s[8] = f, s[9] = p, s[10] = m, s[11] = h) : h = s[11], useQuery(h);
|
|
62
44
|
}
|
|
63
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);
|
|
@@ -16,19 +10,16 @@ function useFilterNamespaces(a) {
|
|
|
16
10
|
let f = d, p;
|
|
17
11
|
o[4] !== s || o[5] !== a ? (p = getNamespacesByPipelineCacheKey(s, a), o[4] = s, o[5] = a, o[6] = p) : p = o[6];
|
|
18
12
|
let m;
|
|
19
|
-
o[7] !== l || o[8] !== f ? (m = () =>
|
|
20
|
-
if (!l) throw Error("API not available");
|
|
21
|
-
return l.ApiV1NamespacesApi.namespaceControllerGetWorkflows(f);
|
|
22
|
-
}, o[7] = l, o[8] = f, o[9] = m) : m = o[9];
|
|
13
|
+
o[7] !== l || o[8] !== f ? (m = () => l.namespaces.getAll(f), o[7] = l, o[8] = f, o[9] = m) : m = o[9];
|
|
23
14
|
let h = !!a, g;
|
|
24
15
|
return o[10] !== p || o[11] !== m || o[12] !== h ? (g = {
|
|
25
16
|
queryKey: p,
|
|
26
17
|
queryFn: m,
|
|
27
|
-
|
|
28
|
-
|
|
18
|
+
select: _temp,
|
|
19
|
+
enabled: h
|
|
29
20
|
}, o[10] = p, o[11] = m, o[12] = h, o[13] = g) : g = o[13], useQuery(g);
|
|
30
21
|
}
|
|
31
|
-
function
|
|
32
|
-
return e.data
|
|
22
|
+
function _temp(e) {
|
|
23
|
+
return e.data;
|
|
33
24
|
}
|
|
34
|
-
export {
|
|
25
|
+
export { useFilterNamespaces };
|