@loopstack/loopstack-studio 0.21.3 → 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 (86) 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/sidebar.js +359 -359
  17. package/dist/components/ui-widgets/UiActions.js +22 -15
  18. package/dist/components/ui-widgets/UiWidget.js +31 -26
  19. package/dist/components/ui-widgets/widgets/AiPromptInput.js +27 -27
  20. package/dist/components/ui-widgets/widgets/ButtonFullWidth.js +12 -12
  21. package/dist/components/ui-widgets/widgets/SandboxRun.js +32 -0
  22. package/dist/components/ui-widgets/widgets/SubmitButton.js +11 -11
  23. package/dist/features/code-explorer/utils/fileIcons.js +4 -7
  24. package/dist/features/oauth/OAuthPromptRenderer.js +1 -1
  25. package/dist/features/runs/Runs.js +197 -0
  26. package/dist/features/workbench/NavigationItems.js +1 -1
  27. package/dist/features/workbench/Workbench.js +109 -75
  28. package/dist/features/workbench/WorkflowItem.js +8 -11
  29. package/dist/features/workbench/WorkflowList.js +29 -20
  30. package/dist/features/workbench/components/DocumentList.js +20 -20
  31. package/dist/features/workbench/components/NewRunDialog.js +328 -0
  32. package/dist/features/workbench/components/WorkbenchFloatingPanel.js +88 -0
  33. package/dist/features/workbench/components/WorkbenchFlowPanel.js +48 -0
  34. package/dist/features/workbench/components/WorkbenchIconSidebar.js +68 -0
  35. package/dist/features/workbench/components/WorkbenchPreviewPanel.js +128 -0
  36. package/dist/features/workbench/components/WorkflowForms.js +7 -6
  37. package/dist/features/workbench/components/WorkflowHistoryItem.js +68 -63
  38. package/dist/features/workbench/components/buttons/WorkflowButtons.js +79 -61
  39. package/dist/features/workbench/components/document-renderer/DocumentFormRenderer.js +6 -5
  40. package/dist/features/workbench/providers/WorkbenchLayoutProvider.js +77 -0
  41. package/dist/features/workspaces/Workspaces.js +2 -2
  42. package/dist/features/workspaces/components/CreateWorkspace.js +164 -81
  43. package/dist/features/workspaces/components/EnvironmentSlotSelector.js +63 -0
  44. package/dist/features/workspaces/components/ExecutionTimeline.js +69 -68
  45. package/dist/features/workspaces/components/PipelineForm.js +4 -4
  46. package/dist/hooks/index.js +2 -0
  47. package/dist/hooks/useApi.js +9 -33
  48. package/dist/hooks/useAuth.js +18 -38
  49. package/dist/hooks/useConfig.js +31 -33
  50. package/dist/hooks/useDashboard.js +1 -4
  51. package/dist/hooks/useDocuments.js +4 -8
  52. package/dist/hooks/useFiles.js +31 -41
  53. package/dist/hooks/useNamespaces.js +5 -8
  54. package/dist/hooks/usePipelines.js +98 -108
  55. package/dist/hooks/useProcessor.js +1 -4
  56. package/dist/hooks/useWorkflows.js +25 -41
  57. package/dist/hooks/useWorkspaces.js +45 -72
  58. package/dist/index.d.ts +266 -48
  59. package/dist/index.js +10 -2
  60. package/dist/packages/contracts/dist/enums/index.js +25 -0
  61. package/dist/packages/contracts/dist/enums/pipeline-state.js +10 -0
  62. package/dist/packages/contracts/dist/enums/registry.enum.js +20 -0
  63. package/dist/packages/contracts/dist/enums/sort-order.enum.js +10 -0
  64. package/dist/packages/contracts/dist/enums/user-type.enum.js +10 -0
  65. package/dist/packages/contracts/dist/enums/workflow-state.enum.js +10 -0
  66. package/dist/pages/DebugPage.js +12 -14
  67. package/dist/pages/DebugWorkflowDetailsPage.js +1 -1
  68. package/dist/pages/DebugWorkflowsPage.js +3 -4
  69. package/dist/pages/EmbedWorkbenchPage.js +4 -3
  70. package/dist/pages/PipelineDebugPage.js +2 -2
  71. package/dist/pages/PreviewWorkbenchPage.js +416 -0
  72. package/dist/pages/RunsListPage.js +36 -0
  73. package/dist/pages/RunsPage.js +49 -0
  74. package/dist/pages/StudioLandingPage.js +145 -0
  75. package/dist/pages/WorkbenchPage.js +75 -51
  76. package/dist/providers/InvalidationEventsProvider.js +7 -7
  77. package/dist/providers/QueryProvider.js +21 -0
  78. package/dist/routing/LocalRouter.js +9 -0
  79. package/dist/services/createApiClient.js +4 -10
  80. package/dist/services/index.js +1 -1
  81. package/package.json +2 -3
  82. package/dist/features/code-explorer/CodeExplorer.js +0 -69
  83. package/dist/features/code-explorer/components/CodeExplorerTree.js +0 -43
  84. package/dist/features/code-explorer/components/CodeExplorerTreeNode.js +0 -82
  85. package/dist/features/workbench/components/WorkbenchSidebar.js +0 -109
  86. package/dist/features/workbench/providers/WorkbenchContextProvider.js +0 -3
@@ -2,80 +2,60 @@ 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 usePipeline(n) {
5
- let i = c(10), { envKey: a, api: s } = useApiClient(), l;
6
- i[0] !== a || i[1] !== n ? (l = [
5
+ let i = c(10), { envKey: a, api: o } = useApiClient(), s;
6
+ i[0] !== a || i[1] !== n ? (s = [
7
7
  "pipeline",
8
8
  n,
9
9
  a
10
- ], i[0] = a, i[1] = n, i[2] = l) : l = i[2];
11
- let u;
12
- i[3] !== s || i[4] !== n ? (u = () => {
13
- if (!s) throw Error("API not available");
14
- return s.ApiV1PipelinesApi.pipelineControllerGetPipelineById({ id: n });
15
- }, i[3] = s, i[4] = n, i[5] = u) : u = i[5];
16
- let d = !!n, f;
17
- return i[6] !== l || i[7] !== u || i[8] !== d ? (f = {
18
- queryKey: l,
19
- queryFn: u,
20
- enabled: d,
21
- select: _temp
22
- }, i[6] = l, i[7] = u, i[8] = d, i[9] = f) : f = i[9], useQuery(f);
23
- }
24
- function _temp(e) {
25
- return e.data;
10
+ ], i[0] = a, i[1] = n, i[2] = s) : s = i[2];
11
+ let l;
12
+ i[3] !== o || i[4] !== n ? (l = () => o.pipelines.getById({ id: n }), i[3] = o, i[4] = n, i[5] = l) : l = i[5];
13
+ let u = !!n, d;
14
+ return i[6] !== s || i[7] !== l || i[8] !== u ? (d = {
15
+ queryKey: s,
16
+ queryFn: l,
17
+ enabled: u
18
+ }, i[6] = s, i[7] = l, i[8] = u, i[9] = d) : d = i[9], useQuery(d);
26
19
  }
27
- function useFilterPipelines(n, i, a, o, s, d) {
28
- let f = c(23), p = a === void 0 ? "id" : a, m = o === void 0 ? "DESC" : o, h = s === void 0 ? 0 : s, g = d === void 0 ? 10 : d, { envKey: _, api: v } = useApiClient(), y = Object.values(i).some(_temp2), b;
29
- f[0] !== i || f[1] !== y ? (b = y && { filter: JSON.stringify(i) }, f[0] = i, f[1] = y, f[2] = b) : b = f[2];
30
- let x;
31
- f[3] !== m || f[4] !== p ? (x = JSON.stringify([{
32
- field: p,
33
- order: m
34
- }]), f[3] = m, f[4] = p, f[5] = x) : x = f[5];
35
- let S;
36
- f[6] === n ? S = f[7] : (S = n && {
20
+ function useFilterPipelines(n, i, a, o, s, l) {
21
+ let u = c(23), d = a === void 0 ? "id" : a, f = o === void 0 ? "DESC" : o, p = s === void 0 ? 0 : s, m = l === void 0 ? 10 : l, { envKey: h, api: g } = useApiClient(), _ = Object.keys(i).length > 0, v;
22
+ u[0] !== i || u[1] !== _ ? (v = _ && { filter: JSON.stringify(i) }, u[0] = i, u[1] = _, u[2] = v) : v = u[2];
23
+ let y;
24
+ u[3] !== f || u[4] !== d ? (y = JSON.stringify([{
25
+ field: d,
26
+ order: f
27
+ }]), u[3] = f, u[4] = d, u[5] = y) : y = u[5];
28
+ let b;
29
+ u[6] === n ? b = u[7] : (b = n && {
37
30
  search: n,
38
31
  searchColumns: JSON.stringify(["title", "model"])
39
- }, f[6] = n, f[7] = S);
40
- let C;
41
- f[8] !== g || f[9] !== h || f[10] !== b || f[11] !== x || f[12] !== S ? (C = {
42
- ...b,
43
- sortBy: x,
44
- page: h,
45
- limit: g,
46
- ...S
47
- }, f[8] = g, f[9] = h, f[10] = b, f[11] = x, f[12] = S, f[13] = C) : C = f[13];
48
- let w = C, T;
49
- f[14] !== _ || f[15] !== w ? (T = [
32
+ }, u[6] = n, u[7] = b);
33
+ let x;
34
+ u[8] !== m || u[9] !== p || u[10] !== v || u[11] !== y || u[12] !== b ? (x = {
35
+ ...v,
36
+ sortBy: y,
37
+ page: p,
38
+ limit: m,
39
+ ...b
40
+ }, u[8] = m, u[9] = p, u[10] = v, u[11] = y, u[12] = b, u[13] = x) : x = u[13];
41
+ let S = x, C;
42
+ u[14] !== h || u[15] !== S ? (C = [
50
43
  "pipelines",
51
- w,
52
- _
53
- ], f[14] = _, f[15] = w, f[16] = T) : T = f[16];
54
- let E;
55
- f[17] !== v || f[18] !== w ? (E = () => {
56
- if (!v) throw Error("API not available");
57
- return v.ApiV1PipelinesApi.pipelineControllerGetPipelines(w);
58
- }, f[17] = v, f[18] = w, f[19] = E) : E = f[19];
59
- let D;
60
- return f[20] !== T || f[21] !== E ? (D = {
61
- queryKey: T,
62
- queryFn: E,
63
- select: _temp3,
44
+ S,
45
+ h
46
+ ], u[14] = h, u[15] = S, u[16] = C) : C = u[16];
47
+ let w;
48
+ u[17] !== g || u[18] !== S ? (w = () => g.pipelines.getAll(S), u[17] = g, u[18] = S, u[19] = w) : w = u[19];
49
+ let T;
50
+ return u[20] !== C || u[21] !== w ? (T = {
51
+ queryKey: C,
52
+ queryFn: w,
64
53
  enabled: !0
65
- }, f[20] = T, f[21] = E, f[22] = D) : D = f[22], useQuery(D);
66
- }
67
- function _temp3(e) {
68
- return e.data;
69
- }
70
- function _temp2(e) {
71
- return e != null;
54
+ }, u[20] = C, u[21] = w, u[22] = T) : T = u[22], useQuery(T);
72
55
  }
73
56
  function useCreatePipeline() {
74
57
  let r = c(8), { envKey: a, api: o } = useApiClient(), s = useQueryClient(), l;
75
- r[0] === o ? l = r[1] : (l = (e) => {
76
- if (!o) throw Error("API not available");
77
- return o.ApiV1PipelinesApi.pipelineControllerCreatePipeline(e);
78
- }, r[0] = o, r[1] = l);
58
+ r[0] === o ? l = r[1] : (l = (e) => o.pipelines.create(e), r[0] = o, r[1] = l);
79
59
  let u;
80
60
  r[2] !== a || r[3] !== s ? (u = () => {
81
61
  s.invalidateQueries({ queryKey: ["pipelines", a] });
@@ -86,6 +66,23 @@ function useCreatePipeline() {
86
66
  onSuccess: u
87
67
  }, r[5] = l, r[6] = u, r[7] = d) : d = r[7], useMutation(d);
88
68
  }
69
+ function useUpdatePipeline() {
70
+ let r = c(8), { envKey: a, api: o } = useApiClient(), s = useQueryClient(), l;
71
+ r[0] === o ? l = r[1] : (l = (e) => o.pipelines.update(e), r[0] = o, r[1] = l);
72
+ let u;
73
+ r[2] !== a || r[3] !== s ? (u = (e, t) => {
74
+ s.invalidateQueries({ queryKey: [
75
+ "pipeline",
76
+ t.id,
77
+ a
78
+ ] }), s.invalidateQueries({ queryKey: ["pipelines", a] });
79
+ }, r[2] = a, r[3] = s, r[4] = u) : u = r[4];
80
+ let d;
81
+ return r[5] !== l || r[6] !== u ? (d = {
82
+ mutationFn: l,
83
+ onSuccess: u
84
+ }, r[5] = l, r[6] = u, r[7] = d) : d = r[7], useMutation(d);
85
+ }
89
86
  function usePipelineConfig(n, i) {
90
87
  let a = c(12), { envKey: o, api: s } = useApiClient(), l;
91
88
  a[0] !== o || a[1] !== i || a[2] !== n ? (l = [
@@ -95,30 +92,37 @@ function usePipelineConfig(n, i) {
95
92
  o
96
93
  ], a[0] = o, a[1] = i, a[2] = n, a[3] = l) : l = a[3];
97
94
  let u;
98
- a[4] !== s || a[5] !== i || a[6] !== n ? (u = () => {
99
- if (!s) throw Error("API not available");
100
- return s.ApiV1ConfigApi.configControllerGetPipelineConfigByName({
101
- workspaceBlockName: n,
102
- pipelineName: i
103
- });
104
- }, a[4] = s, a[5] = i, a[6] = n, a[7] = u) : u = a[7];
95
+ a[4] !== s || a[5] !== i || a[6] !== n ? (u = () => s.config.getPipelineConfigByName({
96
+ workspaceBlockName: n,
97
+ pipelineName: i
98
+ }), a[4] = s, a[5] = i, a[6] = n, a[7] = u) : u = a[7];
105
99
  let d = !!n && !!i, f;
106
100
  return a[8] !== l || a[9] !== u || a[10] !== d ? (f = {
107
101
  queryKey: l,
108
102
  queryFn: u,
109
- enabled: d,
110
- select: _temp4
103
+ enabled: d
111
104
  }, a[8] = l, a[9] = u, a[10] = d, a[11] = f) : f = a[11], useQuery(f);
112
105
  }
113
- function _temp4(e) {
114
- return e.data;
106
+ function useDeletePipeline() {
107
+ let r = c(8), { envKey: a, api: o } = useApiClient(), s = useQueryClient(), l;
108
+ r[0] === o ? l = r[1] : (l = (e) => o.pipelines.delete({ id: e }), r[0] = o, r[1] = l);
109
+ let u;
110
+ r[2] !== a || r[3] !== s ? (u = (e, t) => {
111
+ s.removeQueries({ queryKey: [
112
+ "pipeline",
113
+ t,
114
+ a
115
+ ] }), s.invalidateQueries({ queryKey: ["pipelines", a] });
116
+ }, r[2] = a, r[3] = s, r[4] = u) : u = r[4];
117
+ let d;
118
+ return r[5] !== l || r[6] !== u ? (d = {
119
+ mutationFn: l,
120
+ onSuccess: u
121
+ }, r[5] = l, r[6] = u, r[7] = d) : d = r[7], useMutation(d);
115
122
  }
116
123
  function useBatchDeletePipeline() {
117
124
  let r = c(7), { api: a } = useApiClient(), o = useQueryClient(), s;
118
- r[0] === a ? s = r[1] : (s = (e) => {
119
- if (!a) throw Error("API not available");
120
- return a.ApiV1PipelinesApi.pipelineControllerBatchDeletePipelines({ pipelineControllerBatchDeletePipelinesRequest: { ids: e } });
121
- }, r[0] = a, r[1] = s);
125
+ r[0] === a ? s = r[1] : (s = (e) => a.pipelines.batchDelete({ ids: e }), r[0] = a, r[1] = s);
122
126
  let l;
123
127
  r[2] === o ? l = r[3] : (l = () => {
124
128
  o.invalidateQueries({
@@ -141,29 +145,22 @@ function useChildPipelines(n, i) {
141
145
  o
142
146
  ], a[0] = o, a[1] = n, a[2] = l) : l = a[2];
143
147
  let u;
144
- a[3] !== s || a[4] !== n ? (u = () => {
145
- if (!s) throw Error("API not available");
146
- return s.ApiV1PipelinesApi.pipelineControllerGetPipelines({
147
- filter: JSON.stringify({ parentId: n }),
148
- sortBy: JSON.stringify([{
149
- field: "createdAt",
150
- order: "ASC"
151
- }]),
152
- page: 0,
153
- limit: 100
154
- });
155
- }, a[3] = s, a[4] = n, a[5] = u) : u = a[5];
148
+ a[3] !== s || a[4] !== n ? (u = () => s.pipelines.getAll({
149
+ filter: JSON.stringify({ parentId: n }),
150
+ sortBy: JSON.stringify([{
151
+ field: "createdAt",
152
+ order: "ASC"
153
+ }]),
154
+ page: 0,
155
+ limit: 100
156
+ }), a[3] = s, a[4] = n, a[5] = u) : u = a[5];
156
157
  let d = i && !!n, f;
157
158
  return a[6] !== l || a[7] !== u || a[8] !== d ? (f = {
158
159
  queryKey: l,
159
160
  queryFn: u,
160
- enabled: d,
161
- select: _temp5
161
+ enabled: d
162
162
  }, a[6] = l, a[7] = u, a[8] = d, a[9] = f) : f = a[9], useQuery(f);
163
163
  }
164
- function _temp5(e) {
165
- return e.data;
166
- }
167
164
  function usePipelineSource(n, i) {
168
165
  let a = c(12), { envKey: o, api: s } = useApiClient(), l;
169
166
  a[0] !== o || a[1] !== i || a[2] !== n ? (l = [
@@ -173,22 +170,15 @@ function usePipelineSource(n, i) {
173
170
  o
174
171
  ], a[0] = o, a[1] = i, a[2] = n, a[3] = l) : l = a[3];
175
172
  let u;
176
- a[4] !== s || a[5] !== i || a[6] !== n ? (u = () => {
177
- if (!s) throw Error("API not available");
178
- return s.ApiV1ConfigApi.configControllerGetPipelineSourceByName({
179
- workspaceBlockName: n,
180
- pipelineName: i
181
- });
182
- }, a[4] = s, a[5] = i, a[6] = n, a[7] = u) : u = a[7];
173
+ a[4] !== s || a[5] !== i || a[6] !== n ? (u = () => s.config.getPipelineSourceByName({
174
+ workspaceBlockName: n,
175
+ pipelineName: i
176
+ }), a[4] = s, a[5] = i, a[6] = n, a[7] = u) : u = a[7];
183
177
  let d = !!n && !!i, f;
184
178
  return a[8] !== l || a[9] !== u || a[10] !== d ? (f = {
185
179
  queryKey: l,
186
180
  queryFn: u,
187
- enabled: d,
188
- select: _temp6
181
+ enabled: d
189
182
  }, a[8] = l, a[9] = u, a[10] = d, a[11] = f) : f = a[11], useQuery(f);
190
183
  }
191
- function _temp6(e) {
192
- return e.data;
193
- }
194
- export { useBatchDeletePipeline, useChildPipelines, useCreatePipeline, useFilterPipelines, usePipeline, usePipelineConfig, usePipelineSource };
184
+ export { useBatchDeletePipeline, useChildPipelines, useCreatePipeline, useDeletePipeline, useFilterPipelines, usePipeline, usePipelineConfig, usePipelineSource, useUpdatePipeline };
@@ -3,10 +3,7 @@ import { c } from "react/compiler-runtime";
3
3
  import { useMutation, useQueryClient } from "@tanstack/react-query";
4
4
  function useRunPipeline() {
5
5
  let a = c(7), { api: o } = useApiClient(), s = useQueryClient(), l;
6
- a[0] === o ? l = a[1] : (l = (e) => {
7
- if (!o) throw Error("API not available");
8
- return o.ApiV1ProcessorApi.processorControllerRunPipeline(e);
9
- }, a[0] = o, a[1] = l);
6
+ a[0] === o ? l = a[1] : (l = (e) => o.processor.runPipeline(e), a[0] = o, a[1] = l);
10
7
  let u;
11
8
  a[2] === s ? u = a[3] : (u = () => {
12
9
  console.log("success"), s.invalidateQueries({ queryKey: ["pipelines"] });
@@ -25,21 +25,14 @@ function getWorkflowsByPipelineCacheKey(e, t) {
25
25
  function useWorkflow(n) {
26
26
  let i = c(10), { envKey: a, api: s } = useApiClient(), l;
27
27
  i[0] !== a || i[1] !== n ? (l = getWorkflowCacheKey(a, n), i[0] = a, i[1] = n, i[2] = l) : l = i[2];
28
- let d;
29
- i[3] !== s || i[4] !== n ? (d = () => {
30
- if (!s) throw Error("API not available");
31
- return s.ApiV1WorkflowsApi.workflowControllerGetWorkflowById({ id: n });
32
- }, i[3] = s, i[4] = n, i[5] = d) : d = i[5];
33
- let f = !!n, p;
34
- return i[6] !== l || i[7] !== d || i[8] !== f ? (p = {
28
+ let u;
29
+ i[3] !== s || i[4] !== n ? (u = () => s.workflows.getById({ id: n }), i[3] = s, i[4] = n, i[5] = u) : u = i[5];
30
+ let d = !!n, f;
31
+ return i[6] !== l || i[7] !== u || i[8] !== d ? (f = {
35
32
  queryKey: l,
36
- queryFn: d,
37
- enabled: f,
38
- select: _temp
39
- }, i[6] = l, i[7] = d, i[8] = f, i[9] = p) : p = i[9], useQuery(p);
40
- }
41
- function _temp(e) {
42
- return e.data;
33
+ queryFn: u,
34
+ enabled: d
35
+ }, i[6] = l, i[7] = u, i[8] = d, i[9] = f) : f = i[9], useQuery(f);
43
36
  }
44
37
  function useFetchWorkflowsByPipeline(n) {
45
38
  let i = c(14), { envKey: a, api: o } = useApiClient(), l;
@@ -49,28 +42,25 @@ function useFetchWorkflowsByPipeline(n) {
49
42
  field: "index",
50
43
  order: "ASC"
51
44
  }]), i[2] = u) : u = i[2];
52
- let d;
53
- i[3] === l ? d = i[4] : (d = {
45
+ let f;
46
+ i[3] === l ? f = i[4] : (f = {
54
47
  filter: l,
55
48
  sortBy: u
56
- }, i[3] = l, i[4] = d);
57
- let p = d, m;
49
+ }, i[3] = l, i[4] = f);
50
+ let p = f, m;
58
51
  i[5] !== a || i[6] !== n ? (m = getWorkflowsByPipelineCacheKey(a, n), i[5] = a, i[6] = n, i[7] = m) : m = i[7];
59
52
  let h;
60
- i[8] !== o || i[9] !== p ? (h = () => {
61
- if (!o) throw Error("API not available");
62
- return o.ApiV1WorkflowsApi.workflowControllerGetWorkflows(p);
63
- }, i[8] = o, i[9] = p, i[10] = h) : h = i[10];
53
+ i[8] !== o || i[9] !== p ? (h = () => o.workflows.getAll(p), i[8] = o, i[9] = p, i[10] = h) : h = i[10];
64
54
  let g;
65
55
  return i[11] !== m || i[12] !== h ? (g = {
66
56
  queryKey: m,
67
57
  queryFn: h,
68
- select: _temp2,
58
+ select: _temp,
69
59
  enabled: !0
70
60
  }, i[11] = m, i[12] = h, i[13] = g) : g = i[13], useQuery(g);
71
61
  }
72
- function _temp2(e) {
73
- return e.data.data;
62
+ function _temp(e) {
63
+ return e.data;
74
64
  }
75
65
  function useFetchWorkflowsByNamespace(n) {
76
66
  let i = c(14), { envKey: o, api: s } = useApiClient(), l;
@@ -85,30 +75,24 @@ function useFetchWorkflowsByNamespace(n) {
85
75
  filter: l,
86
76
  sortBy: u
87
77
  }, i[3] = l, i[4] = d);
88
- let f = d, p;
89
- i[5] !== o || i[6] !== n ? (p = getWorkflowsCacheKey(o, n), i[5] = o, i[6] = n, i[7] = p) : p = i[7];
78
+ let f = d, m;
79
+ i[5] !== o || i[6] !== n ? (m = getWorkflowsCacheKey(o, n), i[5] = o, i[6] = n, i[7] = m) : m = i[7];
90
80
  let h;
91
- i[8] !== s || i[9] !== f ? (h = () => {
92
- if (!s) throw Error("API not available");
93
- return s.ApiV1WorkflowsApi.workflowControllerGetWorkflows(f);
94
- }, i[8] = s, i[9] = f, i[10] = h) : h = i[10];
81
+ i[8] !== s || i[9] !== f ? (h = () => s.workflows.getAll(f), i[8] = s, i[9] = f, i[10] = h) : h = i[10];
95
82
  let g;
96
- return i[11] !== p || i[12] !== h ? (g = {
97
- queryKey: p,
83
+ return i[11] !== m || i[12] !== h ? (g = {
84
+ queryKey: m,
98
85
  queryFn: h,
99
- select: _temp3,
86
+ select: _temp2,
100
87
  enabled: !0
101
- }, i[11] = p, i[12] = h, i[13] = g) : g = i[13], useQuery(g);
88
+ }, i[11] = m, i[12] = h, i[13] = g) : g = i[13], useQuery(g);
102
89
  }
103
- function _temp3(e) {
104
- return e.data.data;
90
+ function _temp2(e) {
91
+ return e.data;
105
92
  }
106
93
  function useDeleteWorkflow() {
107
94
  let r = c(8), { envKey: l, api: u } = useApiClient(), d = useQueryClient(), f;
108
- r[0] === u ? f = r[1] : (f = (e) => {
109
- if (!u) throw Error("API not available");
110
- return u.ApiV1WorkflowsApi.workflowControllerDeleteWorkflow({ id: e.id });
111
- }, r[0] = u, r[1] = f);
95
+ r[0] === u ? f = r[1] : (f = (e) => u.workflows.delete({ id: e.id }), r[0] = u, r[1] = f);
112
96
  let p;
113
97
  r[2] !== l || r[3] !== d ? (p = (e, t) => {
114
98
  d.removeQueries({ queryKey: getWorkflowCacheKey(l, t.id) }), d.invalidateQueries({ queryKey: getWorkflowsCacheKey(l, t.namespaceId) }), d.invalidateQueries({ queryKey: getWorkflowsByPipelineCacheKey(l, t.pipelineId) });
@@ -2,77 +2,60 @@ 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 useWorkspace(n) {
5
- let i = c(10), { envKey: a, api: s } = useApiClient(), l;
6
- i[0] !== a || i[1] !== n ? (l = [
5
+ let i = c(10), { envKey: a, api: o } = useApiClient(), s;
6
+ i[0] !== a || i[1] !== n ? (s = [
7
7
  "workspace",
8
8
  n,
9
9
  a
10
- ], i[0] = a, i[1] = n, i[2] = l) : l = i[2];
11
- let u;
12
- i[3] !== s || i[4] !== n ? (u = () => {
13
- if (!s) throw Error("API not available");
14
- return s.ApiV1WorkspacesApi.workspaceControllerGetWorkspaceById({ id: n });
15
- }, i[3] = s, i[4] = n, i[5] = u) : u = i[5];
16
- let d = !!n, f;
17
- return i[6] !== l || i[7] !== u || i[8] !== d ? (f = {
18
- queryKey: l,
19
- queryFn: u,
20
- enabled: d,
21
- select: _temp
22
- }, i[6] = l, i[7] = u, i[8] = d, i[9] = f) : f = i[9], useQuery(f);
23
- }
24
- function _temp(e) {
25
- return e.data;
10
+ ], i[0] = a, i[1] = n, i[2] = s) : s = i[2];
11
+ let l;
12
+ i[3] !== o || i[4] !== n ? (l = () => o.workspaces.getById({ id: n }), i[3] = o, i[4] = n, i[5] = l) : l = i[5];
13
+ let u = !!n, d;
14
+ return i[6] !== s || i[7] !== l || i[8] !== u ? (d = {
15
+ queryKey: s,
16
+ queryFn: l,
17
+ enabled: u
18
+ }, i[6] = s, i[7] = l, i[8] = u, i[9] = d) : d = i[9], useQuery(d);
26
19
  }
27
- function useFilterWorkspaces(n, i, a, o, s, u) {
28
- let d = c(23), f = a === void 0 ? "id" : a, p = o === void 0 ? "DESC" : o, m = s === void 0 ? 0 : s, h = u === void 0 ? 10 : u, { envKey: g, api: _ } = useApiClient(), v = Object.keys(i).length > 0, y;
29
- d[0] !== i || d[1] !== v ? (y = v && { filter: JSON.stringify(i) }, d[0] = i, d[1] = v, d[2] = y) : y = d[2];
20
+ function useFilterWorkspaces(n, i, a, o, s, l) {
21
+ let u = c(23), d = a === void 0 ? "id" : a, f = o === void 0 ? "DESC" : o, p = s === void 0 ? 0 : s, m = l === void 0 ? 10 : l, { envKey: h, api: g } = useApiClient(), _ = Object.keys(i).length > 0, v;
22
+ u[0] !== i || u[1] !== _ ? (v = _ && { filter: JSON.stringify(i) }, u[0] = i, u[1] = _, u[2] = v) : v = u[2];
23
+ let y;
24
+ u[3] !== f || u[4] !== d ? (y = JSON.stringify([{
25
+ field: d,
26
+ order: f
27
+ }]), u[3] = f, u[4] = d, u[5] = y) : y = u[5];
30
28
  let b;
31
- d[3] !== p || d[4] !== f ? (b = JSON.stringify([{
32
- field: f,
33
- order: p
34
- }]), d[3] = p, d[4] = f, d[5] = b) : b = d[5];
35
- let x;
36
- d[6] === n ? x = d[7] : (x = n && {
29
+ u[6] === n ? b = u[7] : (b = n && {
37
30
  search: n,
38
31
  searchColumns: JSON.stringify(["title"])
39
- }, d[6] = n, d[7] = x);
40
- let S;
41
- d[8] !== h || d[9] !== m || d[10] !== y || d[11] !== b || d[12] !== x ? (S = {
42
- ...y,
43
- sortBy: b,
44
- page: m,
45
- limit: h,
46
- ...x
47
- }, d[8] = h, d[9] = m, d[10] = y, d[11] = b, d[12] = x, d[13] = S) : S = d[13];
48
- let C = S, w;
49
- d[14] !== g || d[15] !== C ? (w = [
32
+ }, u[6] = n, u[7] = b);
33
+ let x;
34
+ u[8] !== m || u[9] !== p || u[10] !== v || u[11] !== y || u[12] !== b ? (x = {
35
+ ...v,
36
+ sortBy: y,
37
+ page: p,
38
+ limit: m,
39
+ ...b
40
+ }, u[8] = m, u[9] = p, u[10] = v, u[11] = y, u[12] = b, u[13] = x) : x = u[13];
41
+ let S = x, C;
42
+ u[14] !== h || u[15] !== S ? (C = [
50
43
  "workspaces",
51
- g,
52
- C
53
- ], d[14] = g, d[15] = C, d[16] = w) : w = d[16];
44
+ h,
45
+ S
46
+ ], u[14] = h, u[15] = S, u[16] = C) : C = u[16];
47
+ let w;
48
+ u[17] !== g || u[18] !== S ? (w = () => g.workspaces.getAll(S), u[17] = g, u[18] = S, u[19] = w) : w = u[19];
54
49
  let T;
55
- d[17] !== _ || d[18] !== C ? (T = () => {
56
- if (!_) throw Error("API not available");
57
- return _.ApiV1WorkspacesApi.workspaceControllerGetWorkspaces(C);
58
- }, d[17] = _, d[18] = C, d[19] = T) : T = d[19];
59
- let E;
60
- return d[20] !== w || d[21] !== T ? (E = {
61
- queryKey: w,
62
- queryFn: T,
63
- select: _temp2,
50
+ return u[20] !== C || u[21] !== w ? (T = {
51
+ queryKey: C,
52
+ queryFn: w,
64
53
  enabled: !0
65
- }, d[20] = w, d[21] = T, d[22] = E) : E = d[22], useQuery(E);
66
- }
67
- function _temp2(e) {
68
- return e.data;
54
+ }, u[20] = C, u[21] = w, u[22] = T) : T = u[22], useQuery(T);
69
55
  }
70
56
  function useCreateWorkspace() {
71
57
  let r = c(8), { envKey: a, api: o } = useApiClient(), s = useQueryClient(), l;
72
- r[0] === o ? l = r[1] : (l = (e) => {
73
- if (!o) throw Error("API not available");
74
- return o.ApiV1WorkspacesApi.workspaceControllerCreateWorkspace(e);
75
- }, r[0] = o, r[1] = l);
58
+ r[0] === o ? l = r[1] : (l = (e) => o.workspaces.create(e), r[0] = o, r[1] = l);
76
59
  let u;
77
60
  r[2] !== a || r[3] !== s ? (u = () => {
78
61
  s.invalidateQueries({ queryKey: ["workspaces", a] });
@@ -85,10 +68,7 @@ function useCreateWorkspace() {
85
68
  }
86
69
  function useUpdateWorkspace() {
87
70
  let r = c(8), { envKey: a, api: o } = useApiClient(), s = useQueryClient(), l;
88
- r[0] === o ? l = r[1] : (l = (e) => {
89
- if (!o) throw Error("API not available");
90
- return o.ApiV1WorkspacesApi.workspaceControllerUpdateWorkspace(e);
91
- }, r[0] = o, r[1] = l);
71
+ r[0] === o ? l = r[1] : (l = (e) => o.workspaces.update(e), r[0] = o, r[1] = l);
92
72
  let u;
93
73
  r[2] !== a || r[3] !== s ? (u = (e, t) => {
94
74
  s.invalidateQueries({ queryKey: [
@@ -105,10 +85,7 @@ function useUpdateWorkspace() {
105
85
  }
106
86
  function useDeleteWorkspace() {
107
87
  let r = c(8), { envKey: a, api: o } = useApiClient(), s = useQueryClient(), l;
108
- r[0] === o ? l = r[1] : (l = (e) => {
109
- if (!o) throw Error("API not available");
110
- return o.ApiV1WorkspacesApi.workspaceControllerDeleteWorkspace({ id: e });
111
- }, r[0] = o, r[1] = l);
88
+ r[0] === o ? l = r[1] : (l = (e) => o.workspaces.delete({ id: e }), r[0] = o, r[1] = l);
112
89
  let u;
113
90
  r[2] !== a || r[3] !== s ? (u = (e, t) => {
114
91
  s.removeQueries({ queryKey: [
@@ -127,8 +104,7 @@ function useSetFavouriteWorkspace() {
127
104
  let r = c(8), { envKey: a, api: o } = useApiClient(), s = useQueryClient(), l;
128
105
  r[0] === o ? l = r[1] : (l = (e) => {
129
106
  let { id: t, isFavourite: n } = e;
130
- if (!o) throw Error("API not available");
131
- return o.ApiV1WorkspacesApi.workspaceControllerSetFavourite({
107
+ return o.workspaces.setFavourite({
132
108
  id: t,
133
109
  workspaceFavouriteDto: { isFavourite: n }
134
110
  });
@@ -145,10 +121,7 @@ function useSetFavouriteWorkspace() {
145
121
  }
146
122
  function useBatchDeleteWorkspaces() {
147
123
  let r = c(8), { envKey: a, api: o } = useApiClient(), s = useQueryClient(), l;
148
- r[0] === o ? l = r[1] : (l = (e) => {
149
- if (!o) throw Error("API not available");
150
- return o.ApiV1WorkspacesApi.workspaceControllerBatchDeleteWorkspaces({ workspaceControllerBatchDeleteWorkspacesRequest: { ids: e } });
151
- }, r[0] = o, r[1] = l);
124
+ r[0] === o ? l = r[1] : (l = (e) => o.workspaces.batchDelete({ ids: e }), r[0] = o, r[1] = l);
152
125
  let u;
153
126
  r[2] !== a || r[3] !== s ? (u = () => {
154
127
  s.invalidateQueries({ queryKey: ["workspaces", a] });