@acmekit/dashboard 2.13.36 → 2.13.37

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 (49) hide show
  1. package/dist/{api-key-management-create-U37VC624.mjs → api-key-management-create-4AG76FJV.mjs} +3 -3
  2. package/dist/{api-key-management-detail-ZYKL4ATI.mjs → api-key-management-detail-T2TB4KST.mjs} +10 -10
  3. package/dist/{api-key-management-edit-TSZGMIBL.mjs → api-key-management-edit-R44OHS7B.mjs} +3 -3
  4. package/dist/{api-key-management-list-HCJFJWWB.mjs → api-key-management-list-QK4Q7Y5I.mjs} +3 -3
  5. package/dist/app.css +0 -31
  6. package/dist/app.js +1386 -3726
  7. package/dist/app.mjs +38 -240
  8. package/dist/{chunk-VEI6HW6L.mjs → chunk-2U3RK3JG.mjs} +5 -3
  9. package/dist/{chunk-FKTMBR44.mjs → chunk-DN3MIYQH.mjs} +1 -1
  10. package/dist/{chunk-7F3CWXUH.mjs → chunk-DQCEH3X2.mjs} +1 -1
  11. package/dist/{chunk-YKIWIMJX.mjs → chunk-DTY37DDZ.mjs} +0 -1
  12. package/dist/{chunk-PFZQYK7R.mjs → chunk-EFRMWHRX.mjs} +1 -1
  13. package/dist/{chunk-5IEHCYJO.mjs → chunk-GBFVWROS.mjs} +1 -1
  14. package/dist/chunk-LKWTBYYC.mjs +35 -0
  15. package/dist/chunk-RPAL6FHW.mjs +73 -0
  16. package/dist/{chunk-WLRJXEKL.mjs → chunk-ST2YB7JN.mjs} +1 -1
  17. package/dist/{chunk-XIP35KXF.mjs → chunk-ULSPL3DR.mjs} +1 -1
  18. package/dist/{chunk-SYACY6AL.mjs → chunk-XIM7X4FB.mjs} +1 -1
  19. package/dist/{chunk-HHPPTD3B.mjs → chunk-YRWSG3YM.mjs} +1 -1
  20. package/dist/en.json +3 -132
  21. package/dist/{invite-3JSNOA2B.mjs → invite-XGPZZBUP.mjs} +3 -3
  22. package/dist/{login-BEJ5EFGE.mjs → login-GNP3QIPI.mjs} +9 -9
  23. package/dist/{profile-detail-QVTJC4JC.mjs → profile-detail-YX27F7N6.mjs} +3 -3
  24. package/dist/{profile-edit-MIO62TWH.mjs → profile-edit-2VRDU75O.mjs} +3 -3
  25. package/dist/{reset-password-BN4KAJQL.mjs → reset-password-TWRNZO6Z.mjs} +2 -2
  26. package/dist/{settings-GH5IWXHE.mjs → settings-3XWLL5LG.mjs} +3 -3
  27. package/dist/{translation-list-JA22BUKN.mjs → translation-list-CCEQJNED.mjs} +10 -10
  28. package/dist/{translations-edit-STTMANVT.mjs → translations-edit-E57GVUFV.mjs} +11 -11
  29. package/dist/{user-detail-WCXBFRGS.mjs → user-detail-KUSRRVNX.mjs} +3 -3
  30. package/dist/{user-edit-XDVMJOS4.mjs → user-edit-HTN3ZGCL.mjs} +3 -3
  31. package/dist/{user-invite-73ZDSDFC.mjs → user-invite-E3FAAU3V.mjs} +3 -3
  32. package/dist/{user-list-MPJXE3CA.mjs → user-list-KNJ5S3IM.mjs} +5 -5
  33. package/dist/{user-metadata-ADNTL3LT.mjs → user-metadata-5GQK75DT.mjs} +10 -10
  34. package/dist/workflow-execution-detail-5O5VCXL3.mjs +870 -0
  35. package/dist/workflow-execution-list-DETG4MRT.mjs +347 -0
  36. package/package.json +9 -9
  37. package/dist/chunk-A7ULKHDE.mjs +0 -126
  38. package/dist/chunk-GBPAZAJK.mjs +0 -34
  39. package/dist/chunk-LP6CPB7N.mjs +0 -213
  40. package/dist/workflow-analytics-4WCI4ODQ.mjs +0 -152
  41. package/dist/workflow-definition-detail-GI6CFBMG.mjs +0 -94
  42. package/dist/workflow-definition-list-GF3XAEPS.mjs +0 -142
  43. package/dist/workflow-execution-complete-step-WSRLO572.mjs +0 -245
  44. package/dist/workflow-execution-detail-3RH6EQSS.mjs +0 -1411
  45. package/dist/workflow-execution-list-AQEGAME4.mjs +0 -596
  46. package/dist/workflow-execution-rerun-WCYLYL3Q.mjs +0 -138
  47. package/dist/workflow-execution-run-MWN5KWNY.mjs +0 -135
  48. package/dist/workflow-scheduled-list-ZPXR7CZM.mjs +0 -174
  49. /package/dist/{chunk-RISX76YT.mjs → chunk-22YYMH6M.mjs} +0 -0
@@ -0,0 +1,347 @@
1
+ import {
2
+ DateCell
3
+ } from "./chunk-QZOY6YYT.mjs";
4
+ import {
5
+ getTransactionState,
6
+ getTransactionStateColor
7
+ } from "./chunk-RPAL6FHW.mjs";
8
+ import {
9
+ _DataTable,
10
+ useDataTable
11
+ } from "./chunk-YLPAZ2DP.mjs";
12
+ import {
13
+ useQueryParams
14
+ } from "./chunk-C76H5USB.mjs";
15
+ import "./chunk-DFFLVEZ5.mjs";
16
+ import "./chunk-535OVBXR.mjs";
17
+ import {
18
+ SingleColumnPage
19
+ } from "./chunk-22YYMH6M.mjs";
20
+ import {
21
+ useExtension
22
+ } from "./chunk-C5P5PL3E.mjs";
23
+ import {
24
+ useWorkflowExecutions
25
+ } from "./chunk-LKWTBYYC.mjs";
26
+ import "./chunk-ITNQKZQQ.mjs";
27
+ import "./chunk-S4DMV3ZT.mjs";
28
+ import "./chunk-774WSTCC.mjs";
29
+ import "./chunk-DTY37DDZ.mjs";
30
+ import "./chunk-QZ7TP4HQ.mjs";
31
+
32
+ // src/routes/workflow-executions/workflow-execution-list/components/workflow-execution-list-table/workflow-execution-list-table.tsx
33
+ import { Container, Heading, Text as Text2 } from "@acmekit/ui";
34
+ import { keepPreviousData } from "@tanstack/react-query";
35
+ import { useTranslation as useTranslation3 } from "react-i18next";
36
+
37
+ // src/routes/workflow-executions/workflow-execution-list/components/workflow-execution-list-table/use-workflow-execution-table-columns.tsx
38
+ import { Badge, Copy, Text, clx as clx2 } from "@acmekit/ui";
39
+ import { createColumnHelper } from "@tanstack/react-table";
40
+ import { useMemo } from "react";
41
+ import { useTranslation } from "react-i18next";
42
+
43
+ // src/components/data-table/components/data-table-status-cell/data-table-status-cell.tsx
44
+ import { clx } from "@acmekit/ui";
45
+ import { jsx, jsxs } from "react/jsx-runtime";
46
+ var DataTableStatusCell = ({
47
+ color,
48
+ children
49
+ }) => {
50
+ return /* @__PURE__ */ jsxs("div", { className: "txt-compact-small text-ui-fg-subtle flex h-full w-full items-center gap-x-2 overflow-hidden", children: [
51
+ /* @__PURE__ */ jsx(
52
+ "div",
53
+ {
54
+ role: "presentation",
55
+ className: "flex h-5 w-2 items-center justify-center",
56
+ children: /* @__PURE__ */ jsx(
57
+ "div",
58
+ {
59
+ className: clx(
60
+ "h-2 w-2 rounded-sm shadow-[0px_0px_0px_1px_rgba(0,0,0,0.12)_inset]",
61
+ {
62
+ "bg-ui-tag-neutral-icon": color === "grey",
63
+ "bg-ui-tag-green-icon": color === "green",
64
+ "bg-ui-tag-red-icon": color === "red",
65
+ "bg-ui-tag-blue-icon": color === "blue",
66
+ "bg-ui-tag-orange-icon": color === "orange",
67
+ "bg-ui-tag-purple-icon": color === "purple"
68
+ }
69
+ )
70
+ }
71
+ )
72
+ }
73
+ ),
74
+ /* @__PURE__ */ jsx("span", { className: "truncate", children })
75
+ ] });
76
+ };
77
+
78
+ // src/routes/workflow-executions/workflow-execution-list/components/workflow-execution-list-table/use-workflow-execution-table-columns.tsx
79
+ import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
80
+ var columnHelper = createColumnHelper();
81
+ var useWorkflowExecutionTableColumns = () => {
82
+ const { t } = useTranslation();
83
+ return useMemo(
84
+ () => [
85
+ columnHelper.accessor("workflow_id", {
86
+ header: t("workflowExecutions.workflowIdLabel"),
87
+ cell: ({ getValue }) => {
88
+ const workflowId = getValue();
89
+ return /* @__PURE__ */ jsxs2("div", { className: "flex items-center gap-x-1", children: [
90
+ /* @__PURE__ */ jsx2(Badge, { size: "2xsmall", className: "truncate", children: workflowId }),
91
+ /* @__PURE__ */ jsx2(Copy, { content: workflowId, className: "text-ui-fg-muted" })
92
+ ] });
93
+ }
94
+ }),
95
+ columnHelper.accessor("state", {
96
+ header: t("fields.state"),
97
+ cell: ({ getValue }) => {
98
+ const state = getValue();
99
+ const color = getTransactionStateColor(state);
100
+ const translatedState = getTransactionState(t, state);
101
+ return /* @__PURE__ */ jsx2(DataTableStatusCell, { color, children: /* @__PURE__ */ jsx2("span", { className: "capitalize", children: translatedState }) });
102
+ }
103
+ }),
104
+ columnHelper.accessor("execution", {
105
+ header: t("workflowExecutions.progressLabel"),
106
+ cell: ({ getValue }) => {
107
+ const steps = getValue()?.steps;
108
+ if (!steps) {
109
+ return /* @__PURE__ */ jsx2("span", { className: "text-ui-fg-subtle whitespace-nowrap", children: t("workflowExecutions.stepsCompletedLabel", {
110
+ completed: 0,
111
+ count: 0
112
+ }) });
113
+ }
114
+ const actionableSteps = Object.values(steps).filter(
115
+ (step) => step.id !== ROOT_PREFIX
116
+ );
117
+ const completedSteps = actionableSteps.filter(
118
+ (step) => step.invoke.state === "done" /* DONE */
119
+ );
120
+ return /* @__PURE__ */ jsxs2("div", { className: "flex items-center gap-x-2", children: [
121
+ /* @__PURE__ */ jsx2("div", { className: "flex items-center gap-x-[3px]", children: actionableSteps.map((step) => /* @__PURE__ */ jsx2(
122
+ "div",
123
+ {
124
+ className: clx2(
125
+ "bg-ui-bg-switch-off shadow-details-switch-background h-3 w-1.5 rounded-full",
126
+ {
127
+ "bg-ui-fg-muted": step.invoke.state === "done" /* DONE */
128
+ }
129
+ ),
130
+ "data-completed": step.invoke.state === "done" /* DONE */
131
+ },
132
+ step.id
133
+ )) }),
134
+ /* @__PURE__ */ jsx2("span", { className: "text-ui-fg-subtle whitespace-nowrap", children: t("workflowExecutions.stepsCompletedLabel", {
135
+ completed: completedSteps.length,
136
+ count: actionableSteps.length
137
+ }) })
138
+ ] });
139
+ }
140
+ }),
141
+ columnHelper.display({
142
+ id: "duration",
143
+ header: t("fields.duration"),
144
+ cell: ({ row }) => {
145
+ const createdAt = row.original.created_at;
146
+ const updatedAt = row.original.updated_at;
147
+ const state = row.original.state;
148
+ if (!createdAt) {
149
+ return /* @__PURE__ */ jsx2(Text, { size: "small", leading: "compact", className: "text-ui-fg-subtle", children: "-" });
150
+ }
151
+ const start = new Date(createdAt);
152
+ const end = updatedAt && ["done", "failed", "reverted"].includes(state) ? new Date(updatedAt) : /* @__PURE__ */ new Date();
153
+ if (isNaN(start.getTime()) || isNaN(end.getTime())) {
154
+ return /* @__PURE__ */ jsx2(Text, { size: "small", leading: "compact", className: "text-ui-fg-subtle", children: "-" });
155
+ }
156
+ const ms = end.getTime() - start.getTime();
157
+ if (ms < 0) {
158
+ return /* @__PURE__ */ jsx2(Text, { size: "small", leading: "compact", className: "text-ui-fg-subtle", children: "-" });
159
+ }
160
+ const seconds = Math.floor(ms / 1e3);
161
+ const minutes = Math.floor(seconds / 60);
162
+ const hours = Math.floor(minutes / 60);
163
+ let label;
164
+ if (hours > 0) {
165
+ label = `${hours}h ${minutes % 60}m`;
166
+ } else if (minutes > 0) {
167
+ label = `${minutes}m ${seconds % 60}s`;
168
+ } else if (seconds > 0) {
169
+ label = `${seconds}s`;
170
+ } else if (ms > 0) {
171
+ label = "<1s";
172
+ } else {
173
+ label = "0s";
174
+ }
175
+ return /* @__PURE__ */ jsx2(Text, { size: "small", leading: "compact", className: "text-ui-fg-subtle", children: label });
176
+ }
177
+ }),
178
+ columnHelper.accessor("created_at", {
179
+ header: t("fields.createdAt"),
180
+ cell: ({ getValue }) => {
181
+ const date = getValue();
182
+ return /* @__PURE__ */ jsx2(DateCell, { date });
183
+ }
184
+ }),
185
+ columnHelper.accessor("updated_at", {
186
+ header: t("fields.updatedAt"),
187
+ cell: ({ getValue }) => {
188
+ const date = getValue();
189
+ return /* @__PURE__ */ jsx2(DateCell, { date });
190
+ }
191
+ })
192
+ ],
193
+ [t]
194
+ );
195
+ };
196
+ var ROOT_PREFIX = "_root";
197
+
198
+ // src/routes/workflow-executions/workflow-execution-list/components/workflow-execution-list-table/use-workflow-execution-table-filters.tsx
199
+ import { useTranslation as useTranslation2 } from "react-i18next";
200
+ var useWorkflowExecutionTableFilters = () => {
201
+ const { t } = useTranslation2();
202
+ const stateFilter = {
203
+ key: "state",
204
+ label: t("fields.status"),
205
+ type: "select",
206
+ multiple: true,
207
+ options: [
208
+ {
209
+ label: t("workflowExecutions.state.done"),
210
+ value: "done"
211
+ },
212
+ {
213
+ label: t("workflowExecutions.state.failed"),
214
+ value: "failed"
215
+ },
216
+ {
217
+ label: t("workflowExecutions.state.reverted"),
218
+ value: "reverted"
219
+ },
220
+ {
221
+ label: t("workflowExecutions.state.invoking"),
222
+ value: "invoking"
223
+ },
224
+ {
225
+ label: t("workflowExecutions.transaction.state.waitingToCompensate"),
226
+ value: "waiting_to_compensate"
227
+ },
228
+ {
229
+ label: t("workflowExecutions.state.compensating"),
230
+ value: "compensating"
231
+ },
232
+ {
233
+ label: t("workflowExecutions.state.notStarted"),
234
+ value: "not_started"
235
+ }
236
+ ]
237
+ };
238
+ const dateFilters = [
239
+ { key: "created_at", label: t("fields.createdAt"), type: "date" },
240
+ { key: "updated_at", label: t("fields.updatedAt"), type: "date" }
241
+ ];
242
+ return [stateFilter, ...dateFilters];
243
+ };
244
+
245
+ // src/routes/workflow-executions/workflow-execution-list/components/workflow-execution-list-table/use-workflow-execution-table-query.tsx
246
+ var useWorkflowExecutionTableQuery = ({
247
+ pageSize = 20,
248
+ prefix
249
+ }) => {
250
+ const raw = useQueryParams(
251
+ ["q", "offset", "order", "state", "created_at", "updated_at"],
252
+ prefix
253
+ );
254
+ const { offset, order, state, created_at, updated_at, ...rest } = raw;
255
+ const searchParams = {
256
+ limit: pageSize,
257
+ offset: offset ? parseInt(offset) : 0,
258
+ order: order ?? "-created_at",
259
+ state: state ? state.split(",") : void 0,
260
+ created_at: created_at ? JSON.parse(created_at) : void 0,
261
+ updated_at: updated_at ? JSON.parse(updated_at) : void 0,
262
+ ...rest
263
+ };
264
+ return {
265
+ searchParams,
266
+ raw
267
+ };
268
+ };
269
+
270
+ // src/routes/workflow-executions/workflow-execution-list/components/workflow-execution-list-table/workflow-execution-list-table.tsx
271
+ import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
272
+ var PAGE_SIZE = 20;
273
+ var WorkflowExecutionListTable = () => {
274
+ const { t } = useTranslation3();
275
+ const { searchParams, raw } = useWorkflowExecutionTableQuery({
276
+ pageSize: PAGE_SIZE
277
+ });
278
+ const { workflow_executions, count, isLoading, isError, error } = useWorkflowExecutions(
279
+ {
280
+ ...searchParams
281
+ },
282
+ {
283
+ placeholderData: keepPreviousData
284
+ }
285
+ );
286
+ const columns = useWorkflowExecutionTableColumns();
287
+ const filters = useWorkflowExecutionTableFilters();
288
+ const { table } = useDataTable({
289
+ data: workflow_executions || [],
290
+ columns,
291
+ count,
292
+ pageSize: PAGE_SIZE,
293
+ enablePagination: true,
294
+ getRowId: (row) => row.id
295
+ });
296
+ if (isError) {
297
+ throw error;
298
+ }
299
+ return /* @__PURE__ */ jsxs3(Container, { className: "divide-y p-0", children: [
300
+ /* @__PURE__ */ jsx3("div", { className: "flex items-center justify-between px-6 py-4", children: /* @__PURE__ */ jsxs3("div", { children: [
301
+ /* @__PURE__ */ jsx3(Heading, { children: t("workflowExecutions.domain") }),
302
+ /* @__PURE__ */ jsx3(Text2, { className: "text-ui-fg-subtle", size: "small", children: t(`workflowExecutions.subtitle`) })
303
+ ] }) }),
304
+ /* @__PURE__ */ jsx3(
305
+ _DataTable,
306
+ {
307
+ table,
308
+ columns,
309
+ filters,
310
+ count,
311
+ isLoading,
312
+ orderBy: [
313
+ { key: "created_at", label: t("fields.createdAt") },
314
+ { key: "updated_at", label: t("fields.updatedAt") }
315
+ ],
316
+ pageSize: PAGE_SIZE,
317
+ navigateTo: (row) => `${row.id}`,
318
+ search: true,
319
+ pagination: true,
320
+ queryObject: raw,
321
+ noRecords: {
322
+ message: t("workflowExecutions.list.noRecordsMessage")
323
+ }
324
+ }
325
+ )
326
+ ] });
327
+ };
328
+
329
+ // src/routes/workflow-executions/workflow-execution-list/workflow-execution-list.tsx
330
+ import { jsx as jsx4 } from "react/jsx-runtime";
331
+ var WorkflowExcecutionList = () => {
332
+ const { getWidgets } = useExtension();
333
+ return /* @__PURE__ */ jsx4(
334
+ SingleColumnPage,
335
+ {
336
+ widgets: {
337
+ after: getWidgets("workflow.list.after"),
338
+ before: getWidgets("workflow.list.before")
339
+ },
340
+ hasOutlet: false,
341
+ children: /* @__PURE__ */ jsx4(WorkflowExecutionListTable, {})
342
+ }
343
+ );
344
+ };
345
+ export {
346
+ WorkflowExcecutionList as Component
347
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@acmekit/dashboard",
3
- "version": "2.13.36",
3
+ "version": "2.13.37",
4
4
  "scripts": {
5
5
  "generate:static": "node ./scripts/generate-currencies.js && prettier --write ./src/lib/currencies.ts",
6
6
  "dev": "../../../node_modules/.bin/vite",
@@ -39,10 +39,10 @@
39
39
  "dist"
40
40
  ],
41
41
  "dependencies": {
42
- "@acmekit/admin-shared": "2.13.36",
43
- "@acmekit/icons": "2.13.36",
44
- "@acmekit/js-sdk": "2.13.36",
45
- "@acmekit/ui": "4.1.32",
42
+ "@acmekit/admin-shared": "2.13.37",
43
+ "@acmekit/icons": "2.13.37",
44
+ "@acmekit/js-sdk": "2.13.37",
45
+ "@acmekit/ui": "4.1.33",
46
46
  "@ariakit/react": "^0.4.15",
47
47
  "@babel/runtime": "^7.26.10",
48
48
  "@dnd-kit/core": "^6.1.0",
@@ -80,10 +80,10 @@
80
80
  "zod": "3.25.76"
81
81
  },
82
82
  "devDependencies": {
83
- "@acmekit/admin-shared": "2.13.36",
84
- "@acmekit/admin-vite-plugin": "2.13.36",
85
- "@acmekit/types": "2.13.36",
86
- "@acmekit/ui-preset": "2.13.36"
83
+ "@acmekit/admin-shared": "2.13.37",
84
+ "@acmekit/admin-vite-plugin": "2.13.37",
85
+ "@acmekit/types": "2.13.37",
86
+ "@acmekit/ui-preset": "2.13.37"
87
87
  },
88
88
  "packageManager": "yarn@3.2.1"
89
89
  }
@@ -1,126 +0,0 @@
1
- import {
2
- queryClient
3
- } from "./chunk-FXYH54JP.mjs";
4
- import {
5
- queryKeysFactory
6
- } from "./chunk-774WSTCC.mjs";
7
- import {
8
- sdk
9
- } from "./chunk-YKIWIMJX.mjs";
10
-
11
- // src/hooks/api/workflow-executions.tsx
12
- import {
13
- useMutation,
14
- useQuery
15
- } from "@tanstack/react-query";
16
- var WORKFLOW_EXECUTIONS_QUERY_KEY = "workflow_executions";
17
- var workflowExecutionsQueryKeys = queryKeysFactory(
18
- WORKFLOW_EXECUTIONS_QUERY_KEY
19
- );
20
- var useWorkflowExecutions = (query, options) => {
21
- const { data, ...rest } = useQuery({
22
- queryFn: () => sdk.admin.workflowExecution.list(query),
23
- queryKey: workflowExecutionsQueryKeys.list(query),
24
- ...options
25
- });
26
- return { ...data, ...rest };
27
- };
28
- var useWorkflowExecution = (id, options) => {
29
- const { data, ...rest } = useQuery({
30
- queryFn: () => sdk.admin.workflowExecution.retrieve(id),
31
- queryKey: workflowExecutionsQueryKeys.detail(id),
32
- ...options
33
- });
34
- return { ...data, ...rest };
35
- };
36
- var useRunWorkflow = (workflowId, options) => {
37
- return useMutation({
38
- mutationFn: (payload) => sdk.admin.workflowExecution.run(workflowId, payload),
39
- onSuccess: (data, variables, context) => {
40
- queryClient.invalidateQueries({
41
- queryKey: workflowExecutionsQueryKeys.lists()
42
- });
43
- options?.onSuccess?.(data, variables, context);
44
- },
45
- ...options
46
- });
47
- };
48
- var useCancelWorkflowExecution = (workflowId, transactionId, options) => {
49
- return useMutation({
50
- mutationFn: (payload) => sdk.admin.workflowExecution.cancel(
51
- workflowId,
52
- transactionId,
53
- payload || {}
54
- ),
55
- onSuccess: (data, variables, context) => {
56
- queryClient.invalidateQueries({
57
- queryKey: workflowExecutionsQueryKeys.lists()
58
- });
59
- queryClient.invalidateQueries({
60
- queryKey: workflowExecutionsQueryKeys.details()
61
- });
62
- options?.onSuccess?.(data, variables, context);
63
- },
64
- ...options
65
- });
66
- };
67
- var useRetryStep = (workflowId, transactionId, options) => {
68
- return useMutation({
69
- mutationFn: (payload) => sdk.admin.workflowExecution.retryStep(
70
- workflowId,
71
- transactionId,
72
- payload
73
- ),
74
- onSuccess: (data, variables, context) => {
75
- queryClient.invalidateQueries({
76
- queryKey: workflowExecutionsQueryKeys.lists()
77
- });
78
- queryClient.invalidateQueries({
79
- queryKey: workflowExecutionsQueryKeys.details()
80
- });
81
- options?.onSuccess?.(data, variables, context);
82
- },
83
- ...options
84
- });
85
- };
86
- var useSetStepSuccess = (workflowId, options) => {
87
- return useMutation({
88
- mutationFn: (payload) => sdk.admin.workflowExecution.setStepSuccess(workflowId, payload),
89
- onSuccess: (data, variables, context) => {
90
- queryClient.invalidateQueries({
91
- queryKey: workflowExecutionsQueryKeys.lists()
92
- });
93
- queryClient.invalidateQueries({
94
- queryKey: workflowExecutionsQueryKeys.details()
95
- });
96
- options?.onSuccess?.(data, variables, context);
97
- },
98
- ...options
99
- });
100
- };
101
- var useSetStepFailure = (workflowId, options) => {
102
- return useMutation({
103
- mutationFn: (payload) => sdk.admin.workflowExecution.setStepFailure(workflowId, payload),
104
- onSuccess: (data, variables, context) => {
105
- queryClient.invalidateQueries({
106
- queryKey: workflowExecutionsQueryKeys.lists()
107
- });
108
- queryClient.invalidateQueries({
109
- queryKey: workflowExecutionsQueryKeys.details()
110
- });
111
- options?.onSuccess?.(data, variables, context);
112
- },
113
- ...options
114
- });
115
- };
116
-
117
- export {
118
- workflowExecutionsQueryKeys,
119
- useWorkflowExecutions,
120
- useWorkflowExecution,
121
- useRunWorkflow,
122
- useCancelWorkflowExecution,
123
- useRetryStep,
124
- useSetStepSuccess,
125
- useSetStepFailure
126
- };
@@ -1,34 +0,0 @@
1
- import {
2
- queryKeysFactory
3
- } from "./chunk-774WSTCC.mjs";
4
- import {
5
- sdk
6
- } from "./chunk-YKIWIMJX.mjs";
7
-
8
- // src/hooks/api/workflow-definitions.tsx
9
- import { useQuery } from "@tanstack/react-query";
10
- var WORKFLOW_DEFINITIONS_QUERY_KEY = "workflow_definitions";
11
- var workflowDefinitionsQueryKeys = queryKeysFactory(
12
- WORKFLOW_DEFINITIONS_QUERY_KEY
13
- );
14
- var useWorkflowDefinitions = (query, options) => {
15
- const { data, ...rest } = useQuery({
16
- queryFn: () => sdk.admin.workflowDefinition.list(query),
17
- queryKey: workflowDefinitionsQueryKeys.list(query),
18
- ...options
19
- });
20
- return { ...data, ...rest };
21
- };
22
- var useWorkflowDefinition = (id, options) => {
23
- const { data, ...rest } = useQuery({
24
- queryFn: () => sdk.admin.workflowDefinition.retrieve(id),
25
- queryKey: workflowDefinitionsQueryKeys.detail(id),
26
- ...options
27
- });
28
- return { ...data, ...rest };
29
- };
30
-
31
- export {
32
- useWorkflowDefinitions,
33
- useWorkflowDefinition
34
- };