@loopstack/loopstack-studio 0.33.0 → 0.35.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 +17 -25
- package/dist/components/layout/StudioSidebar.js +34 -34
- package/dist/components/messages/CompletionMessagePaper.js +25 -29
- package/dist/events/api-client-events.js +13 -1
- package/dist/events/index.js +1 -0
- package/dist/features/code-explorer/components/FileTabsBarBase.js +1 -1
- package/dist/features/code-explorer/index.js +0 -3
- package/dist/features/dashboard/AppLauncher.js +111 -64
- package/dist/features/debug/components/WorkflowFlowViewer.js +2 -1
- package/dist/features/debug/components/workflow-flow/WorkflowGraph.js +2 -1
- package/dist/features/documents/DocumentRenderer.js +42 -42
- package/dist/features/documents/components/DocumentList.js +1 -1
- package/dist/features/documents/document-details/DocumentDetails.js +0 -5
- package/dist/features/documents/renderers/DocumentFormRenderer.js +13 -12
- package/dist/features/documents/renderers/LinkMessageRenderer.js +2 -1
- package/dist/features/documents/renderers/useDocumentTransition.js +3 -2
- package/dist/features/feature-registry/FeatureRegistryProvider.js +17 -18
- package/dist/features/feature-registry/available-features.js +3 -2
- package/dist/features/feature-registry/index.js +1 -1
- package/dist/features/file-explorer/components/FileExplorerPanel.js +64 -43
- package/dist/features/file-explorer/components/FileTabsBar.js +1 -1
- package/dist/features/file-explorer/components/FileTree.js +1 -1
- package/dist/features/file-explorer/file-explorer-feature.js +15 -7
- package/dist/features/file-explorer/hooks/useFileExplorer.js +41 -34
- package/dist/features/file-explorer/index.js +1 -1
- package/dist/features/file-explorer/providers/FileExplorerProvider.js +91 -89
- package/dist/features/git/components/WorkbenchGitPanel.js +7 -10
- package/dist/features/git/hooks/useGit.js +55 -57
- package/dist/features/health/LocalHealthCheck.js +46 -47
- package/dist/features/oauth/OAuthPromptRenderer.js +6 -5
- package/dist/features/runs/Runs.js +3 -2
- package/dist/features/secrets/components/WorkbenchSecretsPanel.js +1 -1
- package/dist/features/secrets/renderers/SecretInputRenderer.js +3 -2
- package/dist/features/workbench/Workbench.js +16 -16
- package/dist/features/workbench/WorkflowItem.js +5 -8
- package/dist/features/workbench/components/NewRunDialog.js +173 -171
- package/dist/features/workbench/components/PreviewEmptyState.js +1 -1
- package/dist/features/workbench/components/WorkbenchIconSidebar.js +1 -1
- package/dist/features/workbench/components/WorkbenchRunsPanel.js +2 -1
- package/dist/features/workbench/components/WorkbenchSidebarShell.js +3 -3
- package/dist/features/workbench/components/WorkflowForms.js +1 -1
- package/dist/features/workbench/components/WorkflowHistoryItem.js +2 -1
- package/dist/features/workbench/components/buttons/WorkflowButtons.js +8 -14
- package/dist/features/workbench/hooks/useLlmStreamingDocuments.js +65 -132
- package/dist/features/workbench/hooks/useWorkflowData.js +8 -6
- package/dist/features/workbench/index.js +1 -1
- package/dist/features/workspaces/Workspaces.js +5 -3
- package/dist/features/workspaces/components/CreateWorkspace.js +7 -5
- package/dist/features/workspaces/components/ExecutionTimeline.js +69 -65
- package/dist/features/workspaces/components/WorkflowRunForm.js +6 -4
- package/dist/features/workspaces/components/WorkspaceHomePage.js +1 -1
- package/dist/hooks/index.js +5 -5
- package/dist/hooks/useAuth.js +14 -53
- package/dist/hooks/useConfig.js +13 -37
- package/dist/hooks/useDocuments.js +5 -30
- package/dist/hooks/useEnvironments.js +34 -24
- package/dist/hooks/useProcessor.js +2 -31
- package/dist/hooks/useSecrets.js +71 -53
- package/dist/hooks/useWorkflows.js +43 -172
- package/dist/hooks/useWorkspaces.js +24 -130
- package/dist/index.d.ts +137 -481
- package/dist/index.js +15 -17
- package/dist/loopstack-studio.css +1 -1
- package/dist/packages/client/dist/client.js +35 -0
- package/dist/packages/client/dist/http.js +47 -0
- package/dist/packages/client/dist/index.js +15 -0
- package/dist/packages/client/dist/queries/query-keys.js +94 -0
- package/dist/packages/client/dist/queries/query-options.js +97 -0
- package/dist/packages/client/dist/resources/auth.js +10 -0
- package/dist/packages/client/dist/resources/config.js +11 -0
- package/dist/packages/client/dist/resources/dashboard.js +4 -0
- package/dist/packages/client/dist/resources/documents.js +7 -0
- package/dist/packages/client/dist/resources/processor.js +7 -0
- package/dist/packages/client/dist/resources/workflows.js +13 -0
- package/dist/packages/client/dist/resources/workspaces.js +12 -0
- package/dist/packages/client/dist/stream/invalidations.js +20 -0
- package/dist/packages/client/dist/stream/llm-reducer.js +65 -0
- package/dist/packages/client/dist/stream/sse-parser.js +40 -0
- package/dist/packages/client/dist/stream/stream.js +147 -0
- package/dist/packages/contracts/dist/events/client-message-base.schema.js +6 -0
- package/dist/packages/contracts/dist/events/client-message.schema.js +24 -0
- package/dist/packages/contracts/dist/events/index.js +6 -0
- package/dist/packages/contracts/dist/events/llm-events.schema.js +44 -0
- package/dist/packages/contracts/dist/events/stream-events.schema.js +4 -0
- package/dist/packages/contracts/dist/events/workflow-events.schema.js +20 -0
- package/dist/packages/contracts/dist/events/workspace-events.schema.js +5 -0
- package/dist/packages/contracts/dist/types/types/ui-message.type.js +39 -0
- package/dist/packages/react/dist/hooks/mutations.js +175 -0
- package/dist/packages/react/dist/hooks/queries.js +139 -0
- package/dist/packages/react/dist/hooks/use-live-invalidation.js +39 -0
- package/dist/packages/react/dist/hooks/use-llm-stream.js +18 -0
- package/dist/packages/react/dist/index.js +5 -0
- package/dist/packages/react/dist/provider.js +15 -0
- package/dist/pages/DashboardPage.js +2 -1
- package/dist/pages/DebugWorkflowDetailsPage.js +2 -1
- package/dist/pages/DebugWorkflowsPage.js +2 -1
- package/dist/pages/EmbedWorkbenchPage.js +50 -43
- package/dist/pages/PreviewWorkbenchPage.js +60 -59
- package/dist/pages/StudioLandingPage.js +1 -1
- package/dist/pages/WorkbenchPage.js +53 -47
- package/dist/pages/WorkflowDebugPage.js +3 -2
- package/dist/pages/WorkspacePage.js +42 -27
- package/dist/pages/WorkspaceRunsPage.js +36 -27
- package/dist/providers/LoopstackClientProvider.js +31 -0
- package/dist/services/createApiClient.js +9 -3
- package/dist/services/index.js +0 -1
- package/dist/services/reporting-fetch.js +13 -0
- package/package.json +4 -3
- package/dist/api/auth.js +0 -10
- package/dist/api/client.js +0 -13
- package/dist/api/config.js +0 -11
- package/dist/api/dashboard.js +0 -4
- package/dist/api/documents.js +0 -7
- package/dist/api/environments.js +0 -8
- package/dist/api/index.js +0 -28
- package/dist/api/processor.js +0 -7
- package/dist/api/secrets.js +0 -16
- package/dist/api/workflows.js +0 -15
- package/dist/api/workspaces.js +0 -12
- package/dist/events/sse-client-events.js +0 -13
- package/dist/features/code-explorer/CodeExplorer.js +0 -6
- package/dist/features/code-explorer/components/CodeExplorerTree.js +0 -6
- package/dist/features/code-explorer/components/FileTabsBar.js +0 -4
- package/dist/features/code-explorer/providers/CodeExplorerProvider.js +0 -5
- package/dist/features/file-explorer/api/files.js +0 -7
- package/dist/features/git/api/git.js +0 -9
- package/dist/hooks/query-keys.js +0 -145
- package/dist/hooks/useApi.js +0 -15
- package/dist/hooks/useFiles.js +0 -3
- package/dist/node_modules/lodash/_Symbol.js +0 -7
- package/dist/node_modules/lodash/_baseGetTag.js +0 -13
- package/dist/node_modules/lodash/_baseTrim.js +0 -11
- package/dist/node_modules/lodash/_freeGlobal.js +0 -6
- package/dist/node_modules/lodash/_getRawTag.js +0 -17
- package/dist/node_modules/lodash/_objectToString.js +0 -10
- package/dist/node_modules/lodash/_root.js +0 -8
- package/dist/node_modules/lodash/_trimmedEndIndex.js +0 -11
- package/dist/node_modules/lodash/debounce.js +0 -53
- package/dist/node_modules/lodash/isObject.js +0 -10
- package/dist/node_modules/lodash/isObjectLike.js +0 -9
- package/dist/node_modules/lodash/isSymbol.js +0 -12
- package/dist/node_modules/lodash/now.js +0 -10
- package/dist/node_modules/lodash/toNumber.js +0 -22
- package/dist/providers/InvalidationEventsProvider.js +0 -41
- package/dist/providers/SseProvider.js +0 -37
- package/dist/services/eventEmitter.js +0 -12
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
import { useAppsConfig } from "../../../packages/react/dist/hooks/queries.js";
|
|
2
|
+
import { useStartWorkflow } from "../../../packages/react/dist/hooks/mutations.js";
|
|
3
|
+
import "../../../hooks/useConfig.js";
|
|
1
4
|
import { useStudio } from "../../../providers/StudioProvider.js";
|
|
2
|
-
import { useAppsConfig } from "../../../hooks/useConfig.js";
|
|
3
5
|
import ErrorSnackbar_default from "../../../components/feedback/ErrorSnackbar.js";
|
|
4
|
-
import
|
|
6
|
+
import "../../../hooks/useProcessor.js";
|
|
5
7
|
import ArgumentsView_default from "./workflow-form/ArgumentsView.js";
|
|
6
8
|
import SelectionView_default from "./workflow-form/SelectionView.js";
|
|
7
9
|
import { c } from "react/compiler-runtime";
|
|
@@ -84,11 +86,11 @@ var WorkflowRunForm_default = (a) => {
|
|
|
84
86
|
}), !1), o[24] = g.workflowName, o[25] = F);
|
|
85
87
|
let I = F, L;
|
|
86
88
|
o[26] !== u || o[27] !== O || o[28] !== f || o[29] !== l.id ? (L = (e, r) => {
|
|
87
|
-
O && f.mutate({
|
|
89
|
+
O && f.mutate({
|
|
88
90
|
workflowName: O.workflowName,
|
|
89
91
|
workspaceId: l.id,
|
|
90
92
|
args: r ?? {}
|
|
91
|
-
}
|
|
93
|
+
}, { onSuccess: (e) => void u.navigateToWorkflow(e.workflowId) });
|
|
92
94
|
}, o[26] = u, o[27] = O, o[28] = f, o[29] = l.id, o[30] = L) : L = o[30];
|
|
93
95
|
let R = L, z;
|
|
94
96
|
o[31] !== j || o[32] !== R || o[33] !== I ? (z = () => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import "../../../providers/StudioProvider.js";
|
|
2
1
|
import "../../../hooks/useWorkflows.js";
|
|
2
|
+
import "../../../providers/StudioProvider.js";
|
|
3
3
|
import "../../../components/ui/button.js";
|
|
4
4
|
import "../../../components/feedback/ErrorSnackbar.js";
|
|
5
5
|
import "../../../hooks/useProcessor.js";
|
package/dist/hooks/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { getAppTypesCacheKey, getAvailableEnvironmentsCacheKey, getChildWorkflowsCacheKey, getDashboardStatsCacheKey, getDocumentCacheKey, getDocumentsCacheKey, getFileContentCacheKey, getFileTreeCacheKey, getGitLogCacheKey, getGitRemoteCacheKey, getGitStatusCacheKey, getHealthCacheKey, getMeCacheKey, getSecretsCacheKey, getStudioAppsCacheKey, getToolConfigCacheKey, getToolConfigsCacheKey, getWorkflowCacheKey, getWorkflowConfigCacheKey, getWorkflowSourceCacheKey, getWorkflowStatusCacheKey, getWorkflowTypesCacheKey, getWorkflowsCacheKey, getWorkspaceCacheKey, getWorkspacesCacheKey } from "./query-keys.js";
|
|
2
|
-
import { useApiClient } from "./useApi.js";
|
|
3
1
|
import { useIsMobile } from "./use-mobile.js";
|
|
4
|
-
import { useAppsConfig, useAvailableEnvironments,
|
|
2
|
+
import { useAppsConfig, useAvailableEnvironments, useWorkflow, useWorkflowCheckpoints, useWorkflowSource, useWorkflowStatus, useWorkspace } from "../packages/react/dist/hooks/queries.js";
|
|
3
|
+
import { useBatchDeleteWorkspaces, useCreateWorkflow, useCreateWorkspace, useDeleteWorkflow, useDeleteWorkspace, useSetFavouriteWorkspace, useUpdateWorkflow, useUpdateWorkspace } from "../packages/react/dist/hooks/mutations.js";
|
|
4
|
+
import { useDocumentConfigs } from "./useConfig.js";
|
|
5
5
|
import { useReplaceEnvironments, useResetEnvironment, useWorkspaceEnvironments } from "./useEnvironments.js";
|
|
6
|
-
import { useBatchDeleteWorkflows, useChildWorkflows,
|
|
7
|
-
import {
|
|
6
|
+
import { useBatchDeleteWorkflows, useChildWorkflows, useFilterWorkflows, useWorkflowConfigByName } from "./useWorkflows.js";
|
|
7
|
+
import { useFilterWorkspaces } from "./useWorkspaces.js";
|
package/dist/hooks/useAuth.js
CHANGED
|
@@ -1,58 +1,19 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { useMe, useWorkerHealth } from "../packages/react/dist/hooks/queries.js";
|
|
2
|
+
import { useHubLogin, useRefreshSession } from "../packages/react/dist/hooks/mutations.js";
|
|
3
|
+
import "../packages/react/dist/index.js";
|
|
3
4
|
import { c } from "react/compiler-runtime";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
i[0] === s ? u = i[1] : (u = getMeCacheKey(s), i[0] = s, i[1] = u);
|
|
8
|
-
let d;
|
|
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,
|
|
14
|
-
retry: !1,
|
|
5
|
+
function useMe$1(r) {
|
|
6
|
+
let i = c(2), a = r === void 0 ? !0 : r, o;
|
|
7
|
+
return i[0] === a ? o = i[1] : (o = {
|
|
15
8
|
staleTime: 3e5,
|
|
16
|
-
enabled:
|
|
17
|
-
}, i[
|
|
9
|
+
enabled: a
|
|
10
|
+
}, i[0] = a, i[1] = o), useMe(o);
|
|
18
11
|
}
|
|
19
|
-
function useGetHealthInfo(
|
|
20
|
-
let i = c(
|
|
21
|
-
i[0] ===
|
|
22
|
-
let d;
|
|
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,
|
|
12
|
+
function useGetHealthInfo(e) {
|
|
13
|
+
let i = c(2), a = e === void 0 ? !0 : e, o;
|
|
14
|
+
return i[0] === a ? o = i[1] : (o = {
|
|
28
15
|
staleTime: 3e5,
|
|
29
|
-
enabled:
|
|
30
|
-
}, i[
|
|
16
|
+
enabled: a
|
|
17
|
+
}, i[0] = a, i[1] = o), useWorkerHealth(o);
|
|
31
18
|
}
|
|
32
|
-
|
|
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);
|
|
44
|
-
}
|
|
45
|
-
function useWorkerAuthTokenRefresh() {
|
|
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);
|
|
57
|
-
}
|
|
58
|
-
export { useGetHealthInfo, useMe, useWorkerAuth, useWorkerAuthTokenRefresh };
|
|
19
|
+
export { useGetHealthInfo, useMe$1 as useMe };
|
package/dist/hooks/useConfig.js
CHANGED
|
@@ -1,46 +1,22 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
1
|
+
import { useAppsConfig, useAvailableEnvironments } from "../packages/react/dist/hooks/queries.js";
|
|
2
|
+
import "../packages/react/dist/index.js";
|
|
3
3
|
import { c } from "react/compiler-runtime";
|
|
4
4
|
import { useMemo } from "react";
|
|
5
|
-
import { useQuery } from "@tanstack/react-query";
|
|
6
|
-
function useAppsConfig() {
|
|
7
|
-
let e = c(7), { envKey: a, api: o } = useApiClient(), s;
|
|
8
|
-
e[0] === a ? s = e[1] : (s = getStudioAppsCacheKey(a), e[0] = a, e[1] = s);
|
|
9
|
-
let l;
|
|
10
|
-
e[2] === o ? l = e[3] : (l = () => o.config.getApps(), e[2] = o, e[3] = l);
|
|
11
|
-
let u;
|
|
12
|
-
return e[4] !== s || e[5] !== l ? (u = {
|
|
13
|
-
queryKey: s,
|
|
14
|
-
queryFn: l
|
|
15
|
-
}, e[4] = s, e[5] = l, e[6] = u) : u = e[6], useQuery(u);
|
|
16
|
-
}
|
|
17
|
-
function useAvailableEnvironments(n) {
|
|
18
|
-
let a = c(8), { envKey: o, api: s } = useApiClient(), l;
|
|
19
|
-
a[0] === o ? l = a[1] : (l = getAvailableEnvironmentsCacheKey(o), a[0] = o, a[1] = l);
|
|
20
|
-
let u;
|
|
21
|
-
a[2] === s ? u = a[3] : (u = () => s.config.getAvailableEnvironments(), a[2] = s, a[3] = u);
|
|
22
|
-
let d = n?.enabled ?? !0, f;
|
|
23
|
-
return a[4] !== l || a[5] !== u || a[6] !== d ? (f = {
|
|
24
|
-
queryKey: l,
|
|
25
|
-
queryFn: u,
|
|
26
|
-
enabled: d
|
|
27
|
-
}, a[4] = l, a[5] = u, a[6] = d, a[7] = f) : f = a[7], useQuery(f);
|
|
28
|
-
}
|
|
29
5
|
function useDocumentConfigs() {
|
|
30
|
-
let
|
|
31
|
-
if (
|
|
6
|
+
let t = c(2), { data: r } = useAppsConfig(), i;
|
|
7
|
+
if (t[0] !== r) {
|
|
32
8
|
bb0: {
|
|
33
9
|
let e = /* @__PURE__ */ new Map();
|
|
34
|
-
if (!
|
|
35
|
-
|
|
10
|
+
if (!r?.length) {
|
|
11
|
+
i = e;
|
|
36
12
|
break bb0;
|
|
37
13
|
}
|
|
38
|
-
let
|
|
39
|
-
for (let n of
|
|
40
|
-
|
|
14
|
+
let t = r[0].documents ?? [];
|
|
15
|
+
for (let n of t) e.set(n.documentName, n);
|
|
16
|
+
i = e;
|
|
41
17
|
}
|
|
42
|
-
|
|
43
|
-
} else
|
|
44
|
-
return
|
|
18
|
+
t[0] = r, t[1] = i;
|
|
19
|
+
} else i = t[1];
|
|
20
|
+
return i;
|
|
45
21
|
}
|
|
46
|
-
export {
|
|
22
|
+
export { useDocumentConfigs };
|
|
@@ -1,34 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
1
|
+
import { useWorkflowDocuments } from "../packages/react/dist/hooks/queries.js";
|
|
2
|
+
import "../packages/react/dist/index.js";
|
|
3
3
|
import { c } from "react/compiler-runtime";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
o[0] === a ? u = o[1] : (u = JSON.stringify({
|
|
8
|
-
workflowId: a,
|
|
9
|
-
isInvalidated: !1
|
|
10
|
-
}), o[0] = a, o[1] = u);
|
|
11
|
-
let d;
|
|
12
|
-
o[2] === Symbol.for("react.memo_cache_sentinel") ? (d = JSON.stringify([{
|
|
13
|
-
field: "index",
|
|
14
|
-
order: "ASC"
|
|
15
|
-
}]), o[2] = d) : d = o[2];
|
|
16
|
-
let f;
|
|
17
|
-
o[3] === u ? f = o[4] : (f = {
|
|
18
|
-
filter: u,
|
|
19
|
-
sortBy: d
|
|
20
|
-
}, o[3] = u, o[4] = f);
|
|
21
|
-
let p = f, m;
|
|
22
|
-
o[5] !== s || o[6] !== a ? (m = getDocumentsCacheKey(s, a), o[5] = s, o[6] = a, o[7] = m) : m = o[7];
|
|
23
|
-
let h;
|
|
24
|
-
o[8] !== l || o[9] !== p ? (h = () => l.documents.getAll(p), o[8] = l, o[9] = p, o[10] = h) : h = o[10];
|
|
25
|
-
let g = !!a, _;
|
|
26
|
-
return o[11] !== m || o[12] !== h || o[13] !== g ? (_ = {
|
|
27
|
-
queryKey: m,
|
|
28
|
-
queryFn: h,
|
|
29
|
-
select: _temp,
|
|
30
|
-
enabled: g
|
|
31
|
-
}, o[11] = m, o[12] = h, o[13] = g, o[14] = _) : _ = o[14], useQuery(_);
|
|
4
|
+
function useFilterDocuments(r) {
|
|
5
|
+
let i = c(1), a;
|
|
6
|
+
return i[0] === Symbol.for("react.memo_cache_sentinel") ? (a = { select: _temp }, i[0] = a) : a = i[0], useWorkflowDocuments(r, a);
|
|
32
7
|
}
|
|
33
8
|
function _temp(e) {
|
|
34
9
|
return e.data;
|
|
@@ -1,33 +1,43 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { useLoopstackClient } from "../packages/react/dist/provider.js";
|
|
2
|
+
import "../packages/react/dist/index.js";
|
|
2
3
|
import { c } from "react/compiler-runtime";
|
|
3
4
|
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
5
|
+
var environmentsPath = (e) => `/api/v1/workspaces/${e}/environments`;
|
|
6
|
+
function useWorkspaceEnvironments(r) {
|
|
7
|
+
let a = c(10), o = useLoopstackClient(), s;
|
|
8
|
+
a[0] !== o.envKey || a[1] !== r ? (s = [
|
|
9
|
+
"workspace-environments",
|
|
10
|
+
o.envKey,
|
|
11
|
+
r
|
|
12
|
+
], a[0] = o.envKey, a[1] = r, a[2] = s) : s = a[2];
|
|
13
|
+
let l;
|
|
14
|
+
a[3] !== o.http || a[4] !== r ? (l = () => o.http.get(environmentsPath(r)), a[3] = o.http, a[4] = r, a[5] = l) : l = a[5];
|
|
15
|
+
let u = !!r, d;
|
|
16
|
+
return a[6] !== s || a[7] !== l || a[8] !== u ? (d = {
|
|
17
|
+
queryKey: s,
|
|
18
|
+
queryFn: l,
|
|
19
|
+
enabled: u
|
|
20
|
+
}, a[6] = s, a[7] = l, a[8] = u, a[9] = d) : d = a[9], useQuery(d);
|
|
15
21
|
}
|
|
16
22
|
function useReplaceEnvironments() {
|
|
17
|
-
let
|
|
18
|
-
|
|
19
|
-
let l;
|
|
20
|
-
r[2] === o ? l = r[3] : (l = (e, t) => {
|
|
21
|
-
o.invalidateQueries({ queryKey: ["workspace-environments", t.workspaceId] });
|
|
22
|
-
}, r[2] = o, r[3] = l);
|
|
23
|
+
let i = c(8), o = useLoopstackClient(), s = useQueryClient(), l;
|
|
24
|
+
i[0] === o ? l = i[1] : (l = (e) => o.http.put(environmentsPath(e.workspaceId), e.environments), i[0] = o, i[1] = l);
|
|
23
25
|
let u;
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
i[2] !== o || i[3] !== s ? (u = (e, n) => {
|
|
27
|
+
s.invalidateQueries({ queryKey: [
|
|
28
|
+
"workspace-environments",
|
|
29
|
+
o.envKey,
|
|
30
|
+
n.workspaceId
|
|
31
|
+
] });
|
|
32
|
+
}, i[2] = o, i[3] = s, i[4] = u) : u = i[4];
|
|
33
|
+
let d;
|
|
34
|
+
return i[5] !== l || i[6] !== u ? (d = {
|
|
35
|
+
mutationFn: l,
|
|
36
|
+
onSuccess: u
|
|
37
|
+
}, i[5] = l, i[6] = u, i[7] = d) : d = i[7], useMutation(d);
|
|
28
38
|
}
|
|
29
39
|
function useResetEnvironment() {
|
|
30
|
-
let
|
|
31
|
-
return
|
|
40
|
+
let i = c(2), a = useLoopstackClient(), o;
|
|
41
|
+
return i[0] === a ? o = i[1] : (o = { mutationFn: (e) => a.http.post(`${environmentsPath(e.workspaceId)}/${e.slotId}/reset`) }, i[0] = a, i[1] = o), useMutation(o);
|
|
32
42
|
}
|
|
33
43
|
export { useReplaceEnvironments, useResetEnvironment, useWorkspaceEnvironments };
|
|
@@ -1,31 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import { c } from "react/compiler-runtime";
|
|
4
|
-
import { useMutation, useQueryClient } from "@tanstack/react-query";
|
|
5
|
-
function useRunWorkflow() {
|
|
6
|
-
let a = c(8), { envKey: o, api: s } = useApiClient(), l = useQueryClient(), u;
|
|
7
|
-
a[0] === s ? u = a[1] : (u = (e) => s.processor.runWorkflow(e), a[0] = s, a[1] = u);
|
|
8
|
-
let d;
|
|
9
|
-
a[2] !== o || a[3] !== l ? (d = () => {
|
|
10
|
-
l.invalidateQueries({ queryKey: getWorkflowsCacheKey(o) });
|
|
11
|
-
}, a[2] = o, a[3] = l, a[4] = d) : d = a[4];
|
|
12
|
-
let f;
|
|
13
|
-
return a[5] !== u || a[6] !== d ? (f = {
|
|
14
|
-
mutationFn: u,
|
|
15
|
-
onSuccess: d
|
|
16
|
-
}, a[5] = u, a[6] = d, a[7] = f) : f = a[7], useMutation(f);
|
|
17
|
-
}
|
|
18
|
-
function useStartWorkflow() {
|
|
19
|
-
let a = c(8), { envKey: o, api: s } = useApiClient(), l = useQueryClient(), u;
|
|
20
|
-
a[0] === s ? u = a[1] : (u = (e) => s.processor.startWorkflow(e), a[0] = s, a[1] = u);
|
|
21
|
-
let d;
|
|
22
|
-
a[2] !== o || a[3] !== l ? (d = () => {
|
|
23
|
-
l.invalidateQueries({ queryKey: getWorkflowsCacheKey(o) });
|
|
24
|
-
}, a[2] = o, a[3] = l, a[4] = d) : d = a[4];
|
|
25
|
-
let f;
|
|
26
|
-
return a[5] !== u || a[6] !== d ? (f = {
|
|
27
|
-
mutationFn: u,
|
|
28
|
-
onSuccess: d
|
|
29
|
-
}, a[5] = u, a[6] = d, a[7] = f) : f = a[7], useMutation(f);
|
|
30
|
-
}
|
|
31
|
-
export { useRunWorkflow, useStartWorkflow };
|
|
1
|
+
import { useRunWorkflow, useStartWorkflow } from "../packages/react/dist/hooks/mutations.js";
|
|
2
|
+
import "../packages/react/dist/index.js";
|
package/dist/hooks/useSecrets.js
CHANGED
|
@@ -1,69 +1,87 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { useLoopstackClient } from "../packages/react/dist/provider.js";
|
|
2
|
+
import { queryKeys } from "../packages/client/dist/queries/query-keys.js";
|
|
3
|
+
import "../packages/client/dist/index.js";
|
|
4
|
+
import "../packages/react/dist/index.js";
|
|
3
5
|
import { c } from "react/compiler-runtime";
|
|
4
6
|
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
7
|
+
var secretsPath = (e) => `/api/v1/workspaces/${e}/secrets`;
|
|
8
|
+
function useWorkspaceSecrets(a) {
|
|
9
|
+
let s = c(10), u = useLoopstackClient(), d;
|
|
10
|
+
s[0] !== u.envKey || s[1] !== a ? (d = queryKeys.secrets(u.envKey, a), s[0] = u.envKey, s[1] = a, s[2] = d) : d = s[2];
|
|
11
|
+
let f;
|
|
12
|
+
s[3] !== u.http || s[4] !== a ? (f = () => u.http.get(secretsPath(a)), s[3] = u.http, s[4] = a, s[5] = f) : f = s[5];
|
|
13
|
+
let p = !!a, m;
|
|
14
|
+
return s[6] !== d || s[7] !== f || s[8] !== p ? (m = {
|
|
15
|
+
queryKey: d,
|
|
16
|
+
queryFn: f,
|
|
17
|
+
enabled: p
|
|
18
|
+
}, s[6] = d, s[7] = f, s[8] = p, s[9] = m) : m = s[9], useQuery(m);
|
|
19
|
+
}
|
|
20
|
+
function useApplySecret() {
|
|
21
|
+
let a = c(3), o = useLoopstackClient(), l = useQueryClient(), u;
|
|
22
|
+
return a[0] !== o.envKey || a[1] !== l ? (u = (e, i) => {
|
|
23
|
+
l.setQueryData(queryKeys.secrets(o.envKey, e), (e) => {
|
|
24
|
+
if (!e) return e;
|
|
25
|
+
let r = e.findIndex((e) => e.id === i.id);
|
|
26
|
+
if (r === -1) return [...e, i].sort(_temp);
|
|
27
|
+
let a = [...e];
|
|
28
|
+
return a[r] = i, a;
|
|
29
|
+
});
|
|
30
|
+
}, a[0] = o.envKey, a[1] = l, a[2] = u) : u = a[2], u;
|
|
31
|
+
}
|
|
32
|
+
function _temp(e, r) {
|
|
33
|
+
return e.key.localeCompare(r.key);
|
|
16
34
|
}
|
|
17
35
|
function useCreateSecret() {
|
|
18
|
-
let
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}, i[2] = o, i[3] = l, i[4] = d) : d = i[4];
|
|
36
|
+
let r = c(7), o = useLoopstackClient(), s = useApplySecret(), u;
|
|
37
|
+
r[0] === o ? u = r[1] : (u = (e) => o.http.post(secretsPath(e.workspaceId), {
|
|
38
|
+
key: e.key,
|
|
39
|
+
value: e.value
|
|
40
|
+
}), r[0] = o, r[1] = u);
|
|
24
41
|
let f;
|
|
25
|
-
|
|
42
|
+
r[2] === s ? f = r[3] : (f = (e, r) => s(r.workspaceId, e), r[2] = s, r[3] = f);
|
|
43
|
+
let p;
|
|
44
|
+
return r[4] !== u || r[5] !== f ? (p = {
|
|
26
45
|
mutationFn: u,
|
|
27
|
-
onSuccess:
|
|
28
|
-
},
|
|
46
|
+
onSuccess: f
|
|
47
|
+
}, r[4] = u, r[5] = f, r[6] = p) : p = r[6], useMutation(p);
|
|
29
48
|
}
|
|
30
|
-
function
|
|
31
|
-
let
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}, i[2] = o, i[3] = l, i[4] = d) : d = i[4];
|
|
49
|
+
function useUpsertSecret() {
|
|
50
|
+
let r = c(7), o = useLoopstackClient(), s = useApplySecret(), u;
|
|
51
|
+
r[0] === o ? u = r[1] : (u = (e) => o.http.put(`${secretsPath(e.workspaceId)}/upsert`, {
|
|
52
|
+
key: e.key,
|
|
53
|
+
value: e.value
|
|
54
|
+
}), r[0] = o, r[1] = u);
|
|
37
55
|
let f;
|
|
38
|
-
|
|
56
|
+
r[2] === s ? f = r[3] : (f = (e, r) => s(r.workspaceId, e), r[2] = s, r[3] = f);
|
|
57
|
+
let p;
|
|
58
|
+
return r[4] !== u || r[5] !== f ? (p = {
|
|
39
59
|
mutationFn: u,
|
|
40
|
-
onSuccess:
|
|
41
|
-
},
|
|
60
|
+
onSuccess: f
|
|
61
|
+
}, r[4] = u, r[5] = f, r[6] = p) : p = r[6], useMutation(p);
|
|
42
62
|
}
|
|
43
|
-
function
|
|
44
|
-
let
|
|
45
|
-
|
|
46
|
-
let d;
|
|
47
|
-
i[2] !== o || i[3] !== l ? (d = (t, n) => {
|
|
48
|
-
l.invalidateQueries({ queryKey: getSecretsCacheKey(o, n.workspaceId) });
|
|
49
|
-
}, i[2] = o, i[3] = l, i[4] = d) : d = i[4];
|
|
63
|
+
function useUpdateSecret() {
|
|
64
|
+
let r = c(7), o = useLoopstackClient(), s = useApplySecret(), u;
|
|
65
|
+
r[0] === o ? u = r[1] : (u = (e) => o.http.put(`${secretsPath(e.workspaceId)}/${e.id}`, { value: e.value }), r[0] = o, r[1] = u);
|
|
50
66
|
let f;
|
|
51
|
-
|
|
67
|
+
r[2] === s ? f = r[3] : (f = (e, r) => s(r.workspaceId, e), r[2] = s, r[3] = f);
|
|
68
|
+
let p;
|
|
69
|
+
return r[4] !== u || r[5] !== f ? (p = {
|
|
52
70
|
mutationFn: u,
|
|
53
|
-
onSuccess:
|
|
54
|
-
},
|
|
71
|
+
onSuccess: f
|
|
72
|
+
}, r[4] = u, r[5] = f, r[6] = p) : p = r[6], useMutation(p);
|
|
55
73
|
}
|
|
56
74
|
function useDeleteSecret() {
|
|
57
|
-
let
|
|
58
|
-
|
|
59
|
-
let
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
},
|
|
63
|
-
let
|
|
64
|
-
return
|
|
65
|
-
mutationFn:
|
|
66
|
-
onSuccess:
|
|
67
|
-
},
|
|
75
|
+
let o = c(8), u = useLoopstackClient(), d = useQueryClient(), f;
|
|
76
|
+
o[0] === u ? f = o[1] : (f = (e) => u.http.delete(`${secretsPath(e.workspaceId)}/${e.id}`), o[0] = u, o[1] = f);
|
|
77
|
+
let p;
|
|
78
|
+
o[2] !== u || o[3] !== d ? (p = (e, i) => {
|
|
79
|
+
d.setQueryData(queryKeys.secrets(u.envKey, i.workspaceId), (e) => e?.filter((e) => e.id !== i.id));
|
|
80
|
+
}, o[2] = u, o[3] = d, o[4] = p) : p = o[4];
|
|
81
|
+
let m;
|
|
82
|
+
return o[5] !== f || o[6] !== p ? (m = {
|
|
83
|
+
mutationFn: f,
|
|
84
|
+
onSuccess: p
|
|
85
|
+
}, o[5] = f, o[6] = p, o[7] = m) : m = o[7], useMutation(m);
|
|
68
86
|
}
|
|
69
87
|
export { useCreateSecret, useDeleteSecret, useUpdateSecret, useUpsertSecret, useWorkspaceSecrets };
|