@loopstack/loopstack-studio 0.21.2 → 0.22.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.
Files changed (89) hide show
  1. package/dist/api/auth.js +10 -0
  2. package/dist/api/client.js +13 -0
  3. package/dist/api/config.js +10 -0
  4. package/dist/api/dashboard.js +4 -0
  5. package/dist/api/documents.js +7 -0
  6. package/dist/api/index.js +24 -0
  7. package/dist/api/namespaces.js +7 -0
  8. package/dist/api/pipelines.js +13 -0
  9. package/dist/api/processor.js +4 -0
  10. package/dist/api/workflows.js +8 -0
  11. package/dist/api/workspaces.js +12 -0
  12. package/dist/app/EnvironmentEmbedRoot.js +33 -0
  13. package/dist/components/data-table/DataTableFilters.js +74 -63
  14. package/dist/components/layout/MainLayout.js +7 -4
  15. package/dist/components/page/PageBreadcrumbs.js +1 -1
  16. package/dist/components/ui/input.js +1 -1
  17. package/dist/components/ui/select.js +1 -1
  18. package/dist/components/ui/sidebar.js +359 -359
  19. package/dist/components/ui/textarea.js +1 -1
  20. package/dist/components/ui-widgets/UiActions.js +22 -15
  21. package/dist/components/ui-widgets/UiWidget.js +31 -26
  22. package/dist/components/ui-widgets/widgets/AiPromptInput.js +27 -27
  23. package/dist/components/ui-widgets/widgets/ButtonFullWidth.js +12 -12
  24. package/dist/components/ui-widgets/widgets/SandboxRun.js +32 -0
  25. package/dist/components/ui-widgets/widgets/SubmitButton.js +11 -11
  26. package/dist/features/code-explorer/utils/fileIcons.js +4 -7
  27. package/dist/features/oauth/OAuthPromptRenderer.js +1 -1
  28. package/dist/features/runs/Runs.js +197 -0
  29. package/dist/features/workbench/NavigationItems.js +1 -1
  30. package/dist/features/workbench/Workbench.js +109 -75
  31. package/dist/features/workbench/WorkflowItem.js +8 -11
  32. package/dist/features/workbench/WorkflowList.js +29 -20
  33. package/dist/features/workbench/components/DocumentList.js +20 -20
  34. package/dist/features/workbench/components/NewRunDialog.js +328 -0
  35. package/dist/features/workbench/components/WorkbenchFloatingPanel.js +88 -0
  36. package/dist/features/workbench/components/WorkbenchFlowPanel.js +48 -0
  37. package/dist/features/workbench/components/WorkbenchIconSidebar.js +68 -0
  38. package/dist/features/workbench/components/WorkbenchPreviewPanel.js +128 -0
  39. package/dist/features/workbench/components/WorkflowForms.js +7 -6
  40. package/dist/features/workbench/components/WorkflowHistoryItem.js +68 -63
  41. package/dist/features/workbench/components/buttons/WorkflowButtons.js +79 -61
  42. package/dist/features/workbench/components/document-renderer/DocumentFormRenderer.js +6 -5
  43. package/dist/features/workbench/providers/WorkbenchLayoutProvider.js +77 -0
  44. package/dist/features/workspaces/Workspaces.js +2 -2
  45. package/dist/features/workspaces/components/CreateWorkspace.js +164 -81
  46. package/dist/features/workspaces/components/EnvironmentSlotSelector.js +63 -0
  47. package/dist/features/workspaces/components/ExecutionTimeline.js +69 -68
  48. package/dist/features/workspaces/components/PipelineForm.js +4 -4
  49. package/dist/hooks/index.js +2 -0
  50. package/dist/hooks/useApi.js +9 -33
  51. package/dist/hooks/useAuth.js +18 -38
  52. package/dist/hooks/useConfig.js +31 -33
  53. package/dist/hooks/useDashboard.js +1 -4
  54. package/dist/hooks/useDocuments.js +4 -8
  55. package/dist/hooks/useFiles.js +31 -41
  56. package/dist/hooks/useNamespaces.js +5 -8
  57. package/dist/hooks/usePipelines.js +98 -108
  58. package/dist/hooks/useProcessor.js +1 -4
  59. package/dist/hooks/useWorkflows.js +25 -41
  60. package/dist/hooks/useWorkspaces.js +45 -72
  61. package/dist/index.d.ts +266 -48
  62. package/dist/index.js +10 -2
  63. package/dist/packages/contracts/dist/enums/index.js +25 -0
  64. package/dist/packages/contracts/dist/enums/pipeline-state.js +10 -0
  65. package/dist/packages/contracts/dist/enums/registry.enum.js +20 -0
  66. package/dist/packages/contracts/dist/enums/sort-order.enum.js +10 -0
  67. package/dist/packages/contracts/dist/enums/user-type.enum.js +10 -0
  68. package/dist/packages/contracts/dist/enums/workflow-state.enum.js +10 -0
  69. package/dist/pages/DebugPage.js +12 -14
  70. package/dist/pages/DebugWorkflowDetailsPage.js +1 -1
  71. package/dist/pages/DebugWorkflowsPage.js +3 -4
  72. package/dist/pages/EmbedWorkbenchPage.js +4 -3
  73. package/dist/pages/PipelineDebugPage.js +2 -2
  74. package/dist/pages/PreviewWorkbenchPage.js +416 -0
  75. package/dist/pages/RunsListPage.js +36 -0
  76. package/dist/pages/RunsPage.js +49 -0
  77. package/dist/pages/StudioLandingPage.js +145 -0
  78. package/dist/pages/WorkbenchPage.js +75 -51
  79. package/dist/providers/InvalidationEventsProvider.js +7 -7
  80. package/dist/providers/QueryProvider.js +21 -0
  81. package/dist/routing/LocalRouter.js +9 -0
  82. package/dist/services/createApiClient.js +4 -10
  83. package/dist/services/index.js +1 -1
  84. package/package.json +2 -3
  85. package/dist/features/code-explorer/CodeExplorer.js +0 -69
  86. package/dist/features/code-explorer/components/CodeExplorerTree.js +0 -43
  87. package/dist/features/code-explorer/components/CodeExplorerTreeNode.js +0 -82
  88. package/dist/features/workbench/components/WorkbenchSidebar.js +0 -109
  89. package/dist/features/workbench/providers/WorkbenchContextProvider.js +0 -3
@@ -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/snackbars/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.data.id,
63
+ pipelineId: e.id,
64
64
  runPipelinePayloadDto: {},
65
65
  force: !0
66
- }, { onSuccess: () => P(e.data.id) });
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;
@@ -1,3 +1,5 @@
1
1
  import { useApiClient } from "./useApi.js";
2
2
  import { useIsMobile } from "./use-mobile.js";
3
+ import { useAvailableEnvironments, useWorkspaceConfig } from "./useConfig.js";
4
+ import { useBatchDeletePipeline, useChildPipelines, useCreatePipeline, useDeletePipeline, useFilterPipelines, usePipeline, usePipelineConfig, usePipelineSource, useUpdatePipeline } from "./usePipelines.js";
3
5
  import { useBatchDeleteWorkspaces, useCreateWorkspace, useDeleteWorkspace, useFilterWorkspaces, useSetFavouriteWorkspace, useUpdateWorkspace, useWorkspace } from "./useWorkspaces.js";
@@ -1,39 +1,15 @@
1
- import { ApiClientEvents } from "../events/api-client-events.js";
2
- import { eventBus } from "../services/eventEmitter.js";
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 _ = c(24), { environment: v } = useStudio(), y = v.url, b, x, S, C, w, T, E, D, O;
11
- if (_[0] !== v.id || _[1] !== y) {
12
- let h = new Configuration({ baseOptions: {
13
- withCredentials: !0,
14
- headers: { "Content-Type": "application/json" }
15
- } }), g = axios.create();
16
- g.interceptors.response.use(_temp, (h) => (h.response?.status && [401, 403].includes(h.response.status) && eventBus.emit(ApiClientEvents.UNAUTHORIZED, v.id), h.code === "ERR_NETWORK" && (console.error("Connection refused - server may be down"), eventBus.emit(ApiClientEvents.ERR_NETWORK, v.id)), Promise.reject(h))), b = new ApiV1AuthApi(h, y, g), x = new ApiV1DashboardApi(h, y, g), S = new ApiV1ConfigApi(h, y, g), C = new ApiV1DocumentsApi(h, y, g), w = new ApiV1NamespacesApi(h, y, g), T = new ApiV1PipelinesApi(h, y, g), E = new ApiV1ProcessorApi(h, y, g), D = new ApiV1WorkflowsApi(h, y, g), O = new ApiV1WorkspacesApi(h, y, g), _[0] = v.id, _[1] = y, _[2] = b, _[3] = x, _[4] = S, _[5] = C, _[6] = w, _[7] = T, _[8] = E, _[9] = D, _[10] = O;
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 };
@@ -2,52 +2,35 @@ import { useApiClient } from "./useApi.js";
2
2
  import { c } from "react/compiler-runtime";
3
3
  import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
4
4
  function useMe(n) {
5
- let i = c(8), a = n === void 0 ? !0 : n, { envKey: s, api: l } = useApiClient(), u;
6
- i[0] === s ? u = i[1] : (u = ["me", s], i[0] = s, i[1] = u);
5
+ let i = c(8), a = n === void 0 ? !0 : n, { envKey: o, api: s } = useApiClient(), l;
6
+ i[0] === o ? l = i[1] : (l = ["me", o], i[0] = o, i[1] = l);
7
+ let u;
8
+ i[2] === s ? u = i[3] : (u = () => s.auth.me(), i[2] = s, i[3] = u);
7
9
  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);
12
- let f;
13
- return i[4] !== a || i[5] !== u || i[6] !== d ? (f = {
14
- queryKey: u,
15
- queryFn: d,
16
- select: _temp,
10
+ return i[4] !== a || i[5] !== l || i[6] !== u ? (d = {
11
+ queryKey: l,
12
+ queryFn: u,
17
13
  retry: !1,
18
14
  staleTime: 3e5,
19
15
  enabled: a
20
- }, i[4] = a, i[5] = u, i[6] = d, i[7] = f) : f = i[7], useQuery(f);
21
- }
22
- function _temp(e) {
23
- return e.data;
16
+ }, i[4] = a, i[5] = l, i[6] = u, i[7] = d) : d = i[7], useQuery(d);
24
17
  }
25
18
  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
+ let i = c(8), a = n === void 0 ? !0 : n, { envKey: o, api: s } = useApiClient(), l;
20
+ i[0] === o ? l = i[1] : (l = ["health", o], i[0] = o, i[1] = l);
21
+ let u;
22
+ i[2] === s ? u = i[3] : (u = () => s.auth.getInfo(), i[2] = s, i[3] = u);
28
23
  let d;
29
- i[2] === s ? d = i[3] : (d = () => {
30
- if (!s) throw Error("API not available");
31
- return s.ApiV1AuthApi.authControllerGetInfo();
32
- }, i[2] = s, i[3] = d);
33
- let f;
34
- return i[4] !== a || i[5] !== u || i[6] !== d ? (f = {
35
- queryKey: u,
36
- queryFn: d,
37
- select: _temp2,
24
+ return i[4] !== a || i[5] !== l || i[6] !== u ? (d = {
25
+ queryKey: l,
26
+ queryFn: u,
38
27
  staleTime: 3e5,
39
28
  enabled: a
40
- }, i[4] = a, i[5] = u, i[6] = d, i[7] = f) : f = i[7], useQuery(f);
41
- }
42
- function _temp2(e) {
43
- return e.data;
29
+ }, i[4] = a, i[5] = l, i[6] = u, i[7] = d) : d = i[7], useQuery(d);
44
30
  }
45
31
  function useWorkerAuth() {
46
32
  let r = c(7), { api: a } = useApiClient(), o = useQueryClient(), s;
47
- r[0] === a ? s = r[1] : (s = (e) => {
48
- if (!a) throw Error("API not available");
49
- return a.ApiV1AuthApi.authControllerHubLogin(e);
50
- }, r[0] = a, r[1] = s);
33
+ r[0] === a ? s = r[1] : (s = (e) => a.auth.hubLogin(e), r[0] = a, r[1] = s);
51
34
  let l;
52
35
  r[2] === o ? l = r[3] : (l = () => {
53
36
  o.invalidateQueries();
@@ -60,10 +43,7 @@ function useWorkerAuth() {
60
43
  }
61
44
  function useWorkerAuthTokenRefresh() {
62
45
  let r = c(7), { api: a } = useApiClient(), o = useQueryClient(), s;
63
- r[0] === a ? s = r[1] : (s = () => {
64
- if (!a) throw Error("API not available");
65
- return a.ApiV1AuthApi.authControllerRefresh();
66
- }, r[0] = a, r[1] = s);
46
+ r[0] === a ? s = r[1] : (s = () => a.auth.refresh(), r[0] = a, r[1] = s);
67
47
  let l;
68
48
  r[2] === o ? l = r[3] : (l = () => {
69
49
  o.invalidateQueries();
@@ -2,45 +2,43 @@ import { useApiClient } from "./useApi.js";
2
2
  import { c } from "react/compiler-runtime";
3
3
  import { useQuery } from "@tanstack/react-query";
4
4
  function useWorkspaceConfig() {
5
- let r = c(7), { envKey: a, api: o } = useApiClient(), s;
6
- r[0] === a ? s = r[1] : (s = ["workspace-types", a], r[0] = a, r[1] = s);
5
+ let r = c(7), { envKey: i, api: a } = useApiClient(), o;
6
+ r[0] === i ? o = r[1] : (o = ["workspace-types", i], r[0] = i, r[1] = o);
7
+ let s;
8
+ r[2] === a ? s = r[3] : (s = () => a.config.getWorkspaceTypes(), r[2] = a, r[3] = s);
7
9
  let l;
8
- r[2] === o ? l = r[3] : (l = () => {
9
- if (!o) throw Error("API not available");
10
- return o.ApiV1ConfigApi.configControllerGetWorkspaceTypes();
11
- }, r[2] = o, r[3] = l);
12
- let u;
13
- return r[4] !== s || r[5] !== l ? (u = {
14
- queryKey: s,
15
- queryFn: l,
16
- select: _temp,
10
+ return r[4] !== o || r[5] !== s ? (l = {
11
+ queryKey: o,
12
+ queryFn: s,
17
13
  enabled: !0
18
- }, r[4] = s, r[5] = l, r[6] = u) : u = r[6], useQuery(u);
19
- }
20
- function _temp(e) {
21
- return e.data;
14
+ }, r[4] = o, r[5] = s, r[6] = l) : l = r[6], useQuery(l);
22
15
  }
23
16
  function usePipelineConfig(r) {
24
- let i = c(10), { envKey: a, api: s } = useApiClient(), l;
25
- i[0] !== a || i[1] !== r ? (l = [
17
+ let i = c(10), { envKey: a, api: o } = useApiClient(), s;
18
+ i[0] !== a || i[1] !== r ? (s = [
26
19
  "pipeline-types",
27
20
  r,
28
21
  a
29
- ], i[0] = a, i[1] = r, i[2] = l) : l = i[2];
30
- let u;
31
- i[3] !== s || i[4] !== r ? (u = () => {
32
- if (!s) throw Error("API not available");
33
- return s.ApiV1ConfigApi.configControllerGetPipelineTypesByWorkspace({ workspaceBlockName: r });
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 = {
37
- queryKey: l,
38
- queryFn: u,
39
- enabled: d,
40
- select: _temp2
41
- }, i[6] = l, i[7] = u, i[8] = d, i[9] = f) : f = i[9], useQuery(f);
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 = {
27
+ queryKey: s,
28
+ queryFn: l,
29
+ enabled: u
30
+ }, i[6] = s, i[7] = l, i[8] = u, i[9] = d) : d = i[9], useQuery(d);
42
31
  }
43
- function _temp2(e) {
44
- return e.data;
32
+ function useAvailableEnvironments(r) {
33
+ let i = c(8), { envKey: a, api: o } = useApiClient(), s;
34
+ i[0] === a ? s = i[1] : (s = ["available-environments", a], i[0] = a, i[1] = s);
35
+ let l;
36
+ i[2] === o ? l = i[3] : (l = () => o.config.getAvailableEnvironments(), i[2] = o, i[3] = l);
37
+ let u = r?.enabled ?? !0, d;
38
+ return i[4] !== s || i[5] !== l || i[6] !== u ? (d = {
39
+ queryKey: s,
40
+ queryFn: l,
41
+ enabled: u
42
+ }, i[4] = s, i[5] = l, i[6] = u, i[7] = d) : d = i[7], useQuery(d);
45
43
  }
46
- export { usePipelineConfig, useWorkspaceConfig };
44
+ export { useAvailableEnvironments, usePipelineConfig, useWorkspaceConfig };
@@ -9,10 +9,7 @@ function useDashboardStats() {
9
9
  i
10
10
  ], r[0] = i, r[1] = o);
11
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);
12
+ r[2] === a ? s = r[3] : (s = () => a.dashboard.getStats(), r[2] = a, r[3] = s);
16
13
  let l;
17
14
  return r[4] !== o || r[5] !== s ? (l = {
18
15
  queryKey: o,
@@ -27,19 +27,15 @@ function useFilterDocuments(a) {
27
27
  let p = f, m;
28
28
  o[5] !== s || o[6] !== a ? (m = getDocumentsCacheKey(s, a), o[5] = s, o[6] = a, o[7] = m) : m = o[7];
29
29
  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];
30
+ o[8] !== l || o[9] !== p ? (h = () => l.documents.getAll(p).then(_temp), o[8] = l, o[9] = p, o[10] = h) : h = o[10];
34
31
  let g = !!a, _;
35
32
  return o[11] !== m || o[12] !== h || o[13] !== g ? (_ = {
36
33
  queryKey: m,
37
34
  queryFn: h,
38
- enabled: g,
39
- select: _temp2
35
+ enabled: g
40
36
  }, o[11] = m, o[12] = h, o[13] = g, o[14] = _) : _ = o[14], useQuery(_);
41
37
  }
42
- function _temp2(e) {
43
- return e.data.data;
38
+ function _temp(e) {
39
+ return e.data;
44
40
  }
45
41
  export { getDocumentsCacheKey, useFilterDocuments };
@@ -1,63 +1,53 @@
1
1
  import { useApiClient } from "./useApi.js";
2
2
  import { c } from "react/compiler-runtime";
3
3
  import { useQuery } from "@tanstack/react-query";
4
- function useFileTree(r, o) {
5
- let s = c(10), l = o === void 0 ? !0 : o, { envKey: u, api: d } = useApiClient(), f;
6
- s[0] !== u || s[1] !== r ? (f = [
4
+ function useFileTree(r, a) {
5
+ let o = c(10), s = a === void 0 ? !0 : a, { envKey: l, api: u } = useApiClient(), d;
6
+ o[0] !== l || o[1] !== r ? (d = [
7
7
  "fileTree",
8
8
  r,
9
- u
10
- ], s[0] = u, s[1] = r, s[2] = f) : f = s[2];
11
- let p;
12
- s[3] !== d || s[4] !== r ? (p = () => {
13
- if (!d) throw Error("API not available");
9
+ l
10
+ ], o[0] = l, o[1] = r, o[2] = d) : d = o[2];
11
+ let f;
12
+ o[3] !== u || o[4] !== r ? (f = () => {
14
13
  if (!r) throw Error("Pipeline ID is required");
15
- return d.ApiV1PipelinesApi.fileControllerGetFileTree({ pipelineId: r });
16
- }, s[3] = d, s[4] = r, s[5] = p) : p = s[5];
17
- let m = !!r && l, h;
18
- return s[6] !== f || s[7] !== p || s[8] !== m ? (h = {
19
- queryKey: f,
20
- queryFn: p,
21
- enabled: m,
22
- select: _temp,
14
+ return u.pipelines.getFileTree({ pipelineId: r });
15
+ }, o[3] = u, o[4] = r, o[5] = f) : f = o[5];
16
+ let p = !!r && s, m;
17
+ return o[6] !== d || o[7] !== f || o[8] !== p ? (m = {
18
+ queryKey: d,
19
+ queryFn: f,
20
+ enabled: p,
23
21
  staleTime: 3e5,
24
22
  refetchOnMount: !1,
25
23
  refetchOnWindowFocus: !1,
26
- placeholderData: _temp2
27
- }, s[6] = f, s[7] = p, s[8] = m, s[9] = h) : h = s[9], useQuery(h);
28
- }
29
- function _temp2(e) {
30
- return e;
24
+ placeholderData: _temp
25
+ }, o[6] = d, o[7] = f, o[8] = p, o[9] = m) : m = o[9], useQuery(m);
31
26
  }
32
27
  function _temp(e) {
33
- return e.data;
28
+ return e;
34
29
  }
35
30
  function useFileContent(r, i, a) {
36
- let o = c(12), l = a === void 0 ? !0 : a, { envKey: u, api: d } = useApiClient(), f;
37
- o[0] !== u || o[1] !== i || o[2] !== r ? (f = [
31
+ let o = c(12), s = a === void 0 ? !0 : a, { envKey: l, api: u } = useApiClient(), d;
32
+ o[0] !== l || o[1] !== i || o[2] !== r ? (d = [
38
33
  "fileContent",
39
34
  r,
40
35
  i,
41
- u
42
- ], o[0] = u, o[1] = i, o[2] = r, o[3] = f) : f = o[3];
43
- let p;
44
- o[4] !== d || o[5] !== i || o[6] !== r ? (p = () => {
45
- if (!d) throw Error("API not available");
36
+ l
37
+ ], o[0] = l, o[1] = i, o[2] = r, o[3] = d) : d = o[3];
38
+ let f;
39
+ o[4] !== u || o[5] !== i || o[6] !== r ? (f = () => {
46
40
  if (!r || !i) throw Error("Pipeline ID and file path are required");
47
- return d.ApiV1PipelinesApi.fileControllerGetFileContent({
41
+ return u.pipelines.getFileContent({
48
42
  pipelineId: r,
49
43
  filePath: i
50
44
  });
51
- }, o[4] = d, o[5] = i, o[6] = r, o[7] = p) : p = o[7];
52
- let m = !!r && !!i && l, h;
53
- return o[8] !== f || o[9] !== p || o[10] !== m ? (h = {
54
- queryKey: f,
55
- queryFn: p,
56
- enabled: m,
57
- select: _temp3
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;
45
+ }, o[4] = u, o[5] = i, o[6] = r, o[7] = f) : f = o[7];
46
+ let p = !!r && !!i && s, m;
47
+ return o[8] !== d || o[9] !== f || o[10] !== p ? (m = {
48
+ queryKey: d,
49
+ queryFn: f,
50
+ enabled: p
51
+ }, o[8] = d, o[9] = f, o[10] = p, o[11] = m) : m = o[11], useQuery(m);
62
52
  }
63
53
  export { useFileContent, useFileTree };
@@ -16,19 +16,16 @@ function useFilterNamespaces(a) {
16
16
  let f = d, p;
17
17
  o[4] !== s || o[5] !== a ? (p = getNamespacesByPipelineCacheKey(s, a), o[4] = s, o[5] = a, o[6] = p) : p = o[6];
18
18
  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];
19
+ o[7] !== l || o[8] !== f ? (m = () => l.namespaces.getAll(f), o[7] = l, o[8] = f, o[9] = m) : m = o[9];
23
20
  let h = !!a, g;
24
21
  return o[10] !== p || o[11] !== m || o[12] !== h ? (g = {
25
22
  queryKey: p,
26
23
  queryFn: m,
27
- enabled: h,
28
- select: _temp2
24
+ select: _temp,
25
+ enabled: h
29
26
  }, o[10] = p, o[11] = m, o[12] = h, o[13] = g) : g = o[13], useQuery(g);
30
27
  }
31
- function _temp2(e) {
32
- return e.data.data;
28
+ function _temp(e) {
29
+ return e.data;
33
30
  }
34
31
  export { getNamespacesByPipelineCacheKey, useFilterNamespaces };