@acmekit/dashboard 2.13.33 → 2.13.35
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{api-key-management-create-4AG76FJV.mjs → api-key-management-create-U37VC624.mjs} +3 -3
- package/dist/{api-key-management-detail-T2TB4KST.mjs → api-key-management-detail-ZYKL4ATI.mjs} +10 -10
- package/dist/{api-key-management-edit-R44OHS7B.mjs → api-key-management-edit-TSZGMIBL.mjs} +3 -3
- package/dist/{api-key-management-list-QK4Q7Y5I.mjs → api-key-management-list-HCJFJWWB.mjs} +3 -3
- package/dist/app.css +31 -0
- package/dist/app.js +3726 -1386
- package/dist/app.mjs +240 -38
- package/dist/{chunk-GBFVWROS.mjs → chunk-5IEHCYJO.mjs} +1 -1
- package/dist/{chunk-DQCEH3X2.mjs → chunk-7F3CWXUH.mjs} +1 -1
- package/dist/chunk-A7ULKHDE.mjs +126 -0
- package/dist/{chunk-DN3MIYQH.mjs → chunk-FKTMBR44.mjs} +1 -1
- package/dist/chunk-GBPAZAJK.mjs +34 -0
- package/dist/{chunk-YRWSG3YM.mjs → chunk-HHPPTD3B.mjs} +1 -1
- package/dist/chunk-LP6CPB7N.mjs +213 -0
- package/dist/{chunk-EFRMWHRX.mjs → chunk-PFZQYK7R.mjs} +1 -1
- package/dist/{chunk-XIM7X4FB.mjs → chunk-SYACY6AL.mjs} +1 -1
- package/dist/{chunk-2U3RK3JG.mjs → chunk-VEI6HW6L.mjs} +3 -5
- package/dist/{chunk-ST2YB7JN.mjs → chunk-WLRJXEKL.mjs} +1 -1
- package/dist/{chunk-ULSPL3DR.mjs → chunk-XIP35KXF.mjs} +1 -1
- package/dist/{chunk-DTY37DDZ.mjs → chunk-YKIWIMJX.mjs} +1 -0
- package/dist/en.json +132 -3
- package/dist/{invite-XGPZZBUP.mjs → invite-3JSNOA2B.mjs} +3 -3
- package/dist/{login-GNP3QIPI.mjs → login-BEJ5EFGE.mjs} +9 -9
- package/dist/{profile-detail-YX27F7N6.mjs → profile-detail-QVTJC4JC.mjs} +3 -3
- package/dist/{profile-edit-2VRDU75O.mjs → profile-edit-MIO62TWH.mjs} +3 -3
- package/dist/{reset-password-TWRNZO6Z.mjs → reset-password-BN4KAJQL.mjs} +2 -2
- package/dist/{settings-3XWLL5LG.mjs → settings-GH5IWXHE.mjs} +3 -3
- package/dist/{translation-list-CCEQJNED.mjs → translation-list-JA22BUKN.mjs} +10 -10
- package/dist/{translations-edit-E57GVUFV.mjs → translations-edit-STTMANVT.mjs} +11 -11
- package/dist/{user-detail-KUSRRVNX.mjs → user-detail-WCXBFRGS.mjs} +3 -3
- package/dist/{user-edit-HTN3ZGCL.mjs → user-edit-XDVMJOS4.mjs} +3 -3
- package/dist/{user-invite-E3FAAU3V.mjs → user-invite-73ZDSDFC.mjs} +3 -3
- package/dist/{user-list-KNJ5S3IM.mjs → user-list-MPJXE3CA.mjs} +5 -5
- package/dist/{user-metadata-5GQK75DT.mjs → user-metadata-ADNTL3LT.mjs} +10 -10
- package/dist/workflow-analytics-4WCI4ODQ.mjs +152 -0
- package/dist/workflow-definition-detail-GI6CFBMG.mjs +94 -0
- package/dist/workflow-definition-list-GF3XAEPS.mjs +142 -0
- package/dist/workflow-execution-complete-step-WSRLO572.mjs +245 -0
- package/dist/workflow-execution-detail-3RH6EQSS.mjs +1411 -0
- package/dist/workflow-execution-list-AQEGAME4.mjs +596 -0
- package/dist/workflow-execution-rerun-WCYLYL3Q.mjs +138 -0
- package/dist/workflow-execution-run-MWN5KWNY.mjs +135 -0
- package/dist/workflow-scheduled-list-ZPXR7CZM.mjs +174 -0
- package/package.json +9 -9
- package/src/components/layout/main-layout/main-layout.tsx +28 -1
- package/src/dashboard-app/routes/get-route.map.tsx +71 -0
- package/src/hooks/api/workflow-definitions.tsx +79 -0
- package/src/hooks/api/workflow-executions.tsx +145 -1
- package/src/hooks/api/workflow-metrics.tsx +48 -0
- package/src/hooks/use-workflow-sse.tsx +78 -0
- package/src/i18n/translations/$schema.json +534 -4
- package/src/i18n/translations/en.json +132 -3
- package/src/routes/workflow-analytics/workflow-analytics.tsx +167 -0
- package/src/routes/workflow-definitions/workflow-definition-detail/workflow-definition-detail.tsx +98 -0
- package/src/routes/workflow-definitions/workflow-definition-list/components/workflow-definition-list-table/use-workflow-definition-table-columns.tsx +78 -0
- package/src/routes/workflow-definitions/workflow-definition-list/components/workflow-definition-list-table/workflow-definition-list-table.tsx +65 -0
- package/src/routes/workflow-definitions/workflow-definition-list/workflow-definition-list.tsx +15 -0
- package/src/routes/workflow-executions/constants.ts +16 -0
- package/src/routes/workflow-executions/utils.ts +170 -14
- package/src/routes/workflow-executions/workflow-execution-complete-step/workflow-execution-complete-step.tsx +270 -0
- package/src/routes/workflow-executions/workflow-execution-detail/breadcrumb.tsx +7 -1
- package/src/routes/workflow-executions/workflow-execution-detail/components/workflow-execution-action-bar/index.ts +1 -0
- package/src/routes/workflow-executions/workflow-execution-detail/components/workflow-execution-action-bar/workflow-execution-action-bar.tsx +212 -0
- package/src/routes/workflow-executions/workflow-execution-detail/components/workflow-execution-error-card/index.ts +1 -0
- package/src/routes/workflow-executions/workflow-execution-detail/components/workflow-execution-error-card/workflow-execution-error-card.tsx +59 -0
- package/src/routes/workflow-executions/workflow-execution-detail/components/workflow-execution-history-section/workflow-execution-history-section.tsx +157 -6
- package/src/routes/workflow-executions/workflow-execution-detail/components/workflow-execution-payload-section/workflow-execution-payload-section.tsx +122 -6
- package/src/routes/workflow-executions/workflow-execution-detail/components/workflow-execution-timeline-section/workflow-execution-timeline-section.tsx +7 -1
- package/src/routes/workflow-executions/workflow-execution-detail/components/workflow-execution-waiting-banner/index.ts +1 -0
- package/src/routes/workflow-executions/workflow-execution-detail/components/workflow-execution-waiting-banner/workflow-execution-waiting-banner.tsx +63 -0
- package/src/routes/workflow-executions/workflow-execution-detail/workflow-detail.tsx +46 -1
- package/src/routes/workflow-executions/workflow-execution-list/components/workflow-execution-list-table/use-workflow-execution-table-columns.tsx +7 -0
- package/src/routes/workflow-executions/workflow-execution-list/components/workflow-execution-list-table/use-workflow-execution-table-filters.tsx +7 -1
- package/src/routes/workflow-executions/workflow-execution-list/components/workflow-execution-list-table/use-workflow-execution-table-query.tsx +4 -2
- package/src/routes/workflow-executions/workflow-execution-list/components/workflow-execution-list-table/workflow-execution-auto-refresh.tsx +73 -0
- package/src/routes/workflow-executions/workflow-execution-list/components/workflow-execution-list-table/workflow-execution-list-table.tsx +17 -1
- package/src/routes/workflow-executions/workflow-execution-list/components/workflow-execution-list-table/workflow-execution-row-actions.tsx +116 -0
- package/src/routes/workflow-executions/workflow-execution-list/components/workflow-execution-list-table/workflow-execution-saved-views.tsx +84 -0
- package/src/routes/workflow-executions/workflow-execution-list/workflow-execution-list.tsx +1 -1
- package/src/routes/workflow-executions/workflow-execution-rerun/workflow-execution-rerun.tsx +159 -0
- package/src/routes/workflow-executions/workflow-execution-run/workflow-execution-run.tsx +139 -0
- package/src/routes/workflow-scheduled/workflow-scheduled-list.tsx +269 -0
- package/dist/chunk-LKWTBYYC.mjs +0 -35
- package/dist/chunk-RPAL6FHW.mjs +0 -73
- package/dist/workflow-execution-detail-5O5VCXL3.mjs +0 -870
- package/dist/workflow-execution-list-DETG4MRT.mjs +0 -347
- /package/dist/{chunk-22YYMH6M.mjs → chunk-RISX76YT.mjs} +0 -0
|
@@ -1,5 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
QueryKey,
|
|
3
|
+
UseMutationOptions,
|
|
4
|
+
UseQueryOptions,
|
|
5
|
+
useMutation,
|
|
6
|
+
useQuery,
|
|
7
|
+
} from "@tanstack/react-query"
|
|
2
8
|
import { sdk } from "../../lib/client"
|
|
9
|
+
import { queryClient } from "../../lib/query-client"
|
|
3
10
|
import { queryKeysFactory } from "../../lib/query-key-factory"
|
|
4
11
|
import { HttpTypes } from "@acmekit/types"
|
|
5
12
|
import { FetchError } from "@acmekit/js-sdk"
|
|
@@ -50,3 +57,140 @@ export const useWorkflowExecution = (
|
|
|
50
57
|
|
|
51
58
|
return { ...data, ...rest }
|
|
52
59
|
}
|
|
60
|
+
|
|
61
|
+
export const useRunWorkflow = (
|
|
62
|
+
workflowId: string,
|
|
63
|
+
options?: UseMutationOptions<
|
|
64
|
+
Record<string, unknown>,
|
|
65
|
+
FetchError,
|
|
66
|
+
{ input?: Record<string, unknown>; transaction_id?: string }
|
|
67
|
+
>
|
|
68
|
+
) => {
|
|
69
|
+
return useMutation({
|
|
70
|
+
mutationFn: (payload) =>
|
|
71
|
+
sdk.admin.workflowExecution.run(workflowId, payload),
|
|
72
|
+
onSuccess: (data, variables, context) => {
|
|
73
|
+
queryClient.invalidateQueries({
|
|
74
|
+
queryKey: workflowExecutionsQueryKeys.lists(),
|
|
75
|
+
})
|
|
76
|
+
options?.onSuccess?.(data, variables, context)
|
|
77
|
+
},
|
|
78
|
+
...options,
|
|
79
|
+
})
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export const useCancelWorkflowExecution = (
|
|
83
|
+
workflowId: string,
|
|
84
|
+
transactionId: string,
|
|
85
|
+
options?: UseMutationOptions<
|
|
86
|
+
Record<string, unknown>,
|
|
87
|
+
FetchError,
|
|
88
|
+
{ reason?: string } | void
|
|
89
|
+
>
|
|
90
|
+
) => {
|
|
91
|
+
return useMutation({
|
|
92
|
+
mutationFn: (payload) =>
|
|
93
|
+
sdk.admin.workflowExecution.cancel(
|
|
94
|
+
workflowId,
|
|
95
|
+
transactionId,
|
|
96
|
+
(payload as { reason?: string }) || {}
|
|
97
|
+
),
|
|
98
|
+
onSuccess: (data, variables, context) => {
|
|
99
|
+
queryClient.invalidateQueries({
|
|
100
|
+
queryKey: workflowExecutionsQueryKeys.lists(),
|
|
101
|
+
})
|
|
102
|
+
queryClient.invalidateQueries({
|
|
103
|
+
queryKey: workflowExecutionsQueryKeys.details(),
|
|
104
|
+
})
|
|
105
|
+
options?.onSuccess?.(data, variables, context)
|
|
106
|
+
},
|
|
107
|
+
...options,
|
|
108
|
+
})
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
export const useRetryStep = (
|
|
112
|
+
workflowId: string,
|
|
113
|
+
transactionId: string,
|
|
114
|
+
options?: UseMutationOptions<
|
|
115
|
+
Record<string, unknown>,
|
|
116
|
+
FetchError,
|
|
117
|
+
{ step_id: string; action?: string }
|
|
118
|
+
>
|
|
119
|
+
) => {
|
|
120
|
+
return useMutation({
|
|
121
|
+
mutationFn: (payload) =>
|
|
122
|
+
sdk.admin.workflowExecution.retryStep(
|
|
123
|
+
workflowId,
|
|
124
|
+
transactionId,
|
|
125
|
+
payload
|
|
126
|
+
),
|
|
127
|
+
onSuccess: (data, variables, context) => {
|
|
128
|
+
queryClient.invalidateQueries({
|
|
129
|
+
queryKey: workflowExecutionsQueryKeys.lists(),
|
|
130
|
+
})
|
|
131
|
+
queryClient.invalidateQueries({
|
|
132
|
+
queryKey: workflowExecutionsQueryKeys.details(),
|
|
133
|
+
})
|
|
134
|
+
options?.onSuccess?.(data, variables, context)
|
|
135
|
+
},
|
|
136
|
+
...options,
|
|
137
|
+
})
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
export const useSetStepSuccess = (
|
|
141
|
+
workflowId: string,
|
|
142
|
+
options?: UseMutationOptions<
|
|
143
|
+
Record<string, unknown>,
|
|
144
|
+
FetchError,
|
|
145
|
+
{
|
|
146
|
+
transaction_id: string
|
|
147
|
+
step_id: string
|
|
148
|
+
response?: Record<string, unknown>
|
|
149
|
+
action?: string
|
|
150
|
+
}
|
|
151
|
+
>
|
|
152
|
+
) => {
|
|
153
|
+
return useMutation({
|
|
154
|
+
mutationFn: (payload) =>
|
|
155
|
+
sdk.admin.workflowExecution.setStepSuccess(workflowId, payload),
|
|
156
|
+
onSuccess: (data, variables, context) => {
|
|
157
|
+
queryClient.invalidateQueries({
|
|
158
|
+
queryKey: workflowExecutionsQueryKeys.lists(),
|
|
159
|
+
})
|
|
160
|
+
queryClient.invalidateQueries({
|
|
161
|
+
queryKey: workflowExecutionsQueryKeys.details(),
|
|
162
|
+
})
|
|
163
|
+
options?.onSuccess?.(data, variables, context)
|
|
164
|
+
},
|
|
165
|
+
...options,
|
|
166
|
+
})
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
export const useSetStepFailure = (
|
|
170
|
+
workflowId: string,
|
|
171
|
+
options?: UseMutationOptions<
|
|
172
|
+
Record<string, unknown>,
|
|
173
|
+
FetchError,
|
|
174
|
+
{
|
|
175
|
+
transaction_id: string
|
|
176
|
+
step_id: string
|
|
177
|
+
response?: Record<string, unknown>
|
|
178
|
+
action?: string
|
|
179
|
+
}
|
|
180
|
+
>
|
|
181
|
+
) => {
|
|
182
|
+
return useMutation({
|
|
183
|
+
mutationFn: (payload) =>
|
|
184
|
+
sdk.admin.workflowExecution.setStepFailure(workflowId, payload),
|
|
185
|
+
onSuccess: (data, variables, context) => {
|
|
186
|
+
queryClient.invalidateQueries({
|
|
187
|
+
queryKey: workflowExecutionsQueryKeys.lists(),
|
|
188
|
+
})
|
|
189
|
+
queryClient.invalidateQueries({
|
|
190
|
+
queryKey: workflowExecutionsQueryKeys.details(),
|
|
191
|
+
})
|
|
192
|
+
options?.onSuccess?.(data, variables, context)
|
|
193
|
+
},
|
|
194
|
+
...options,
|
|
195
|
+
})
|
|
196
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { QueryKey, UseQueryOptions, useQuery } from "@tanstack/react-query"
|
|
2
|
+
import { sdk } from "../../lib/client"
|
|
3
|
+
import { queryKeysFactory } from "../../lib/query-key-factory"
|
|
4
|
+
import { FetchError } from "@acmekit/js-sdk"
|
|
5
|
+
|
|
6
|
+
export type WorkflowMetricsResponse = {
|
|
7
|
+
total_24h: number
|
|
8
|
+
success_rate_24h: number
|
|
9
|
+
avg_duration_ms_24h: number
|
|
10
|
+
running_now: number
|
|
11
|
+
per_workflow: Array<{
|
|
12
|
+
workflow_id: string
|
|
13
|
+
runs: number
|
|
14
|
+
success_rate: number
|
|
15
|
+
avg_duration_ms: number
|
|
16
|
+
}>
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const WORKFLOW_METRICS_QUERY_KEY = "workflow_metrics" as const
|
|
20
|
+
export const workflowMetricsQueryKeys = queryKeysFactory(
|
|
21
|
+
WORKFLOW_METRICS_QUERY_KEY
|
|
22
|
+
)
|
|
23
|
+
|
|
24
|
+
export const useWorkflowMetrics = (
|
|
25
|
+
options?: Omit<
|
|
26
|
+
UseQueryOptions<
|
|
27
|
+
WorkflowMetricsResponse,
|
|
28
|
+
FetchError,
|
|
29
|
+
WorkflowMetricsResponse,
|
|
30
|
+
QueryKey
|
|
31
|
+
>,
|
|
32
|
+
"queryKey" | "queryFn"
|
|
33
|
+
>
|
|
34
|
+
) => {
|
|
35
|
+
const { data, ...rest } = useQuery({
|
|
36
|
+
queryFn: async () => {
|
|
37
|
+
const result = await sdk.client.fetch<WorkflowMetricsResponse>(
|
|
38
|
+
"/admin/workflows-executions/metrics"
|
|
39
|
+
)
|
|
40
|
+
return result as unknown as WorkflowMetricsResponse
|
|
41
|
+
},
|
|
42
|
+
queryKey: workflowMetricsQueryKeys.all,
|
|
43
|
+
refetchInterval: 30000,
|
|
44
|
+
...options,
|
|
45
|
+
})
|
|
46
|
+
|
|
47
|
+
return { ...data, ...rest }
|
|
48
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { useEffect, useRef, useState } from "react"
|
|
2
|
+
import { backendUrl } from "../lib/client"
|
|
3
|
+
|
|
4
|
+
export interface WorkflowSSEEvent {
|
|
5
|
+
event_type: string
|
|
6
|
+
workflow_id: string
|
|
7
|
+
transaction_id: string
|
|
8
|
+
step?: Record<string, unknown>
|
|
9
|
+
response?: Record<string, unknown>
|
|
10
|
+
result?: Record<string, unknown>
|
|
11
|
+
errors?: Array<Record<string, unknown>>
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
interface UseWorkflowSSEOptions {
|
|
15
|
+
enabled?: boolean
|
|
16
|
+
onEvent?: (event: WorkflowSSEEvent) => void
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export const useWorkflowSSE = (
|
|
20
|
+
workflowId: string | undefined,
|
|
21
|
+
options?: UseWorkflowSSEOptions
|
|
22
|
+
) => {
|
|
23
|
+
const { enabled = true, onEvent } = options || {}
|
|
24
|
+
const [isConnected, setIsConnected] = useState(false)
|
|
25
|
+
const eventSourceRef = useRef<EventSource | null>(null)
|
|
26
|
+
const onEventRef = useRef(onEvent)
|
|
27
|
+
onEventRef.current = onEvent
|
|
28
|
+
|
|
29
|
+
useEffect(() => {
|
|
30
|
+
if (!enabled || !workflowId) {
|
|
31
|
+
if (eventSourceRef.current) {
|
|
32
|
+
eventSourceRef.current.close()
|
|
33
|
+
eventSourceRef.current = null
|
|
34
|
+
setIsConnected(false)
|
|
35
|
+
}
|
|
36
|
+
return
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
const base = backendUrl === "/" ? "" : backendUrl
|
|
40
|
+
const url = `${base}/admin/workflows-executions/${workflowId}/subscribe`
|
|
41
|
+
|
|
42
|
+
const es = new EventSource(url, { withCredentials: true })
|
|
43
|
+
eventSourceRef.current = es
|
|
44
|
+
|
|
45
|
+
es.onopen = () => {
|
|
46
|
+
setIsConnected(true)
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
es.onmessage = (e) => {
|
|
50
|
+
try {
|
|
51
|
+
const data = JSON.parse(e.data) as WorkflowSSEEvent
|
|
52
|
+
onEventRef.current?.(data)
|
|
53
|
+
} catch {
|
|
54
|
+
// ignore parse errors
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
es.onerror = () => {
|
|
59
|
+
setIsConnected(false)
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
return () => {
|
|
63
|
+
es.close()
|
|
64
|
+
eventSourceRef.current = null
|
|
65
|
+
setIsConnected(false)
|
|
66
|
+
}
|
|
67
|
+
}, [enabled, workflowId])
|
|
68
|
+
|
|
69
|
+
const disconnect = () => {
|
|
70
|
+
if (eventSourceRef.current) {
|
|
71
|
+
eventSourceRef.current.close()
|
|
72
|
+
eventSourceRef.current = null
|
|
73
|
+
setIsConnected(false)
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
return { isConnected, disconnect }
|
|
78
|
+
}
|