@acmekit/dashboard 2.13.35 → 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.
- package/dist/{api-key-management-create-U37VC624.mjs → api-key-management-create-4AG76FJV.mjs} +3 -3
- package/dist/{api-key-management-detail-ZYKL4ATI.mjs → api-key-management-detail-T2TB4KST.mjs} +10 -10
- package/dist/{api-key-management-edit-TSZGMIBL.mjs → api-key-management-edit-R44OHS7B.mjs} +3 -3
- package/dist/{api-key-management-list-HCJFJWWB.mjs → api-key-management-list-QK4Q7Y5I.mjs} +3 -3
- package/dist/app.css +0 -31
- package/dist/app.js +1386 -3726
- package/dist/app.mjs +38 -240
- package/dist/{chunk-VEI6HW6L.mjs → chunk-2U3RK3JG.mjs} +5 -3
- package/dist/{chunk-FKTMBR44.mjs → chunk-DN3MIYQH.mjs} +1 -1
- package/dist/{chunk-7F3CWXUH.mjs → chunk-DQCEH3X2.mjs} +1 -1
- package/dist/{chunk-YKIWIMJX.mjs → chunk-DTY37DDZ.mjs} +0 -1
- package/dist/{chunk-PFZQYK7R.mjs → chunk-EFRMWHRX.mjs} +1 -1
- package/dist/{chunk-5IEHCYJO.mjs → chunk-GBFVWROS.mjs} +1 -1
- package/dist/chunk-LKWTBYYC.mjs +35 -0
- package/dist/chunk-RPAL6FHW.mjs +73 -0
- package/dist/{chunk-WLRJXEKL.mjs → chunk-ST2YB7JN.mjs} +1 -1
- package/dist/{chunk-XIP35KXF.mjs → chunk-ULSPL3DR.mjs} +1 -1
- package/dist/{chunk-SYACY6AL.mjs → chunk-XIM7X4FB.mjs} +1 -1
- package/dist/{chunk-HHPPTD3B.mjs → chunk-YRWSG3YM.mjs} +1 -1
- package/dist/en.json +3 -132
- package/dist/{invite-3JSNOA2B.mjs → invite-XGPZZBUP.mjs} +3 -3
- package/dist/{login-BEJ5EFGE.mjs → login-GNP3QIPI.mjs} +9 -9
- package/dist/{profile-detail-QVTJC4JC.mjs → profile-detail-YX27F7N6.mjs} +3 -3
- package/dist/{profile-edit-MIO62TWH.mjs → profile-edit-2VRDU75O.mjs} +3 -3
- package/dist/{reset-password-BN4KAJQL.mjs → reset-password-TWRNZO6Z.mjs} +2 -2
- package/dist/{settings-GH5IWXHE.mjs → settings-3XWLL5LG.mjs} +3 -3
- package/dist/{translation-list-JA22BUKN.mjs → translation-list-CCEQJNED.mjs} +10 -10
- package/dist/{translations-edit-STTMANVT.mjs → translations-edit-E57GVUFV.mjs} +11 -11
- package/dist/{user-detail-WCXBFRGS.mjs → user-detail-KUSRRVNX.mjs} +3 -3
- package/dist/{user-edit-XDVMJOS4.mjs → user-edit-HTN3ZGCL.mjs} +3 -3
- package/dist/{user-invite-73ZDSDFC.mjs → user-invite-E3FAAU3V.mjs} +3 -3
- package/dist/{user-list-MPJXE3CA.mjs → user-list-KNJ5S3IM.mjs} +5 -5
- package/dist/{user-metadata-ADNTL3LT.mjs → user-metadata-5GQK75DT.mjs} +10 -10
- package/dist/workflow-execution-detail-5O5VCXL3.mjs +870 -0
- package/dist/workflow-execution-list-DETG4MRT.mjs +347 -0
- package/package.json +9 -9
- package/src/components/layout/main-layout/main-layout.tsx +1 -28
- package/src/dashboard-app/routes/get-route.map.tsx +0 -71
- package/src/hooks/api/workflow-executions.tsx +1 -145
- package/src/i18n/translations/$schema.json +4 -534
- package/src/i18n/translations/en.json +3 -132
- package/src/routes/workflow-executions/constants.ts +0 -16
- package/src/routes/workflow-executions/utils.ts +14 -170
- package/src/routes/workflow-executions/workflow-execution-detail/breadcrumb.tsx +1 -7
- package/src/routes/workflow-executions/workflow-execution-detail/components/workflow-execution-history-section/workflow-execution-history-section.tsx +6 -157
- package/src/routes/workflow-executions/workflow-execution-detail/components/workflow-execution-payload-section/workflow-execution-payload-section.tsx +6 -122
- package/src/routes/workflow-executions/workflow-execution-detail/components/workflow-execution-timeline-section/workflow-execution-timeline-section.tsx +1 -7
- package/src/routes/workflow-executions/workflow-execution-detail/workflow-detail.tsx +1 -46
- package/src/routes/workflow-executions/workflow-execution-list/components/workflow-execution-list-table/use-workflow-execution-table-columns.tsx +0 -7
- package/src/routes/workflow-executions/workflow-execution-list/components/workflow-execution-list-table/use-workflow-execution-table-filters.tsx +1 -7
- package/src/routes/workflow-executions/workflow-execution-list/components/workflow-execution-list-table/use-workflow-execution-table-query.tsx +2 -4
- package/src/routes/workflow-executions/workflow-execution-list/components/workflow-execution-list-table/workflow-execution-list-table.tsx +1 -17
- package/src/routes/workflow-executions/workflow-execution-list/workflow-execution-list.tsx +1 -1
- package/dist/chunk-A7ULKHDE.mjs +0 -126
- package/dist/chunk-GBPAZAJK.mjs +0 -34
- package/dist/chunk-LP6CPB7N.mjs +0 -213
- package/dist/workflow-analytics-4WCI4ODQ.mjs +0 -152
- package/dist/workflow-definition-detail-GI6CFBMG.mjs +0 -94
- package/dist/workflow-definition-list-GF3XAEPS.mjs +0 -142
- package/dist/workflow-execution-complete-step-WSRLO572.mjs +0 -245
- package/dist/workflow-execution-detail-3RH6EQSS.mjs +0 -1411
- package/dist/workflow-execution-list-AQEGAME4.mjs +0 -596
- package/dist/workflow-execution-rerun-WCYLYL3Q.mjs +0 -138
- package/dist/workflow-execution-run-MWN5KWNY.mjs +0 -135
- package/dist/workflow-scheduled-list-ZPXR7CZM.mjs +0 -174
- package/src/hooks/api/workflow-definitions.tsx +0 -79
- package/src/hooks/api/workflow-metrics.tsx +0 -48
- package/src/hooks/use-workflow-sse.tsx +0 -78
- package/src/routes/workflow-analytics/workflow-analytics.tsx +0 -167
- package/src/routes/workflow-definitions/workflow-definition-detail/workflow-definition-detail.tsx +0 -98
- package/src/routes/workflow-definitions/workflow-definition-list/components/workflow-definition-list-table/use-workflow-definition-table-columns.tsx +0 -78
- package/src/routes/workflow-definitions/workflow-definition-list/components/workflow-definition-list-table/workflow-definition-list-table.tsx +0 -65
- package/src/routes/workflow-definitions/workflow-definition-list/workflow-definition-list.tsx +0 -15
- package/src/routes/workflow-executions/workflow-execution-complete-step/workflow-execution-complete-step.tsx +0 -270
- package/src/routes/workflow-executions/workflow-execution-detail/components/workflow-execution-action-bar/index.ts +0 -1
- package/src/routes/workflow-executions/workflow-execution-detail/components/workflow-execution-action-bar/workflow-execution-action-bar.tsx +0 -212
- package/src/routes/workflow-executions/workflow-execution-detail/components/workflow-execution-error-card/index.ts +0 -1
- package/src/routes/workflow-executions/workflow-execution-detail/components/workflow-execution-error-card/workflow-execution-error-card.tsx +0 -59
- package/src/routes/workflow-executions/workflow-execution-detail/components/workflow-execution-waiting-banner/index.ts +0 -1
- package/src/routes/workflow-executions/workflow-execution-detail/components/workflow-execution-waiting-banner/workflow-execution-waiting-banner.tsx +0 -63
- package/src/routes/workflow-executions/workflow-execution-list/components/workflow-execution-list-table/workflow-execution-auto-refresh.tsx +0 -73
- package/src/routes/workflow-executions/workflow-execution-list/components/workflow-execution-list-table/workflow-execution-row-actions.tsx +0 -116
- package/src/routes/workflow-executions/workflow-execution-list/components/workflow-execution-list-table/workflow-execution-saved-views.tsx +0 -84
- package/src/routes/workflow-executions/workflow-execution-rerun/workflow-execution-rerun.tsx +0 -159
- package/src/routes/workflow-executions/workflow-execution-run/workflow-execution-run.tsx +0 -139
- package/src/routes/workflow-scheduled/workflow-scheduled-list.tsx +0 -269
- /package/dist/{chunk-RISX76YT.mjs → chunk-22YYMH6M.mjs} +0 -0
|
@@ -2975,10 +2975,7 @@
|
|
|
2975
2975
|
"stepsCompletedLabel_one": "{{completed}} of {{count}} step",
|
|
2976
2976
|
"stepsCompletedLabel_other": "{{completed}} of {{count}} steps",
|
|
2977
2977
|
"list": {
|
|
2978
|
-
"noRecordsMessage": "No workflows have been executed, yet."
|
|
2979
|
-
"noFilterResults": "No executions match your current filters.",
|
|
2980
|
-
"clearFilters": "Clear filters",
|
|
2981
|
-
"viewAll": "View all executions"
|
|
2978
|
+
"noRecordsMessage": "No workflows have been executed, yet."
|
|
2982
2979
|
},
|
|
2983
2980
|
"history": {
|
|
2984
2981
|
"sectionTitle": "History",
|
|
@@ -2991,11 +2988,7 @@
|
|
|
2991
2988
|
"outputLabel": "Output",
|
|
2992
2989
|
"compensateInputLabel": "Compensate input",
|
|
2993
2990
|
"revertedLabel": "Reverted",
|
|
2994
|
-
"errorLabel": "Error"
|
|
2995
|
-
"idempotencyKeyLabel": "Idempotency key",
|
|
2996
|
-
"showCompensation": "Show compensation",
|
|
2997
|
-
"showInvoke": "Show invoke",
|
|
2998
|
-
"retryFromStep": "Retry from this step"
|
|
2991
|
+
"errorLabel": "Error"
|
|
2999
2992
|
},
|
|
3000
2993
|
"state": {
|
|
3001
2994
|
"done": "Done",
|
|
@@ -3003,8 +2996,7 @@
|
|
|
3003
2996
|
"reverted": "Reverted",
|
|
3004
2997
|
"invoking": "Invoking",
|
|
3005
2998
|
"compensating": "Compensating",
|
|
3006
|
-
"notStarted": "Not started"
|
|
3007
|
-
"waitingResponse": "Waiting for response"
|
|
2999
|
+
"notStarted": "Not started"
|
|
3008
3000
|
},
|
|
3009
3001
|
"transaction": {
|
|
3010
3002
|
"state": {
|
|
@@ -3018,127 +3010,6 @@
|
|
|
3018
3010
|
"dormant": "Dormant",
|
|
3019
3011
|
"timeout": "Timeout"
|
|
3020
3012
|
}
|
|
3021
|
-
},
|
|
3022
|
-
"actions": {
|
|
3023
|
-
"retry": "Retry",
|
|
3024
|
-
"retryWithSameInput": "Retry with same input",
|
|
3025
|
-
"retryWithNewInput": "Retry with new input...",
|
|
3026
|
-
"cancel": "Cancel execution",
|
|
3027
|
-
"cancelConfirmTitle": "Cancel workflow execution?",
|
|
3028
|
-
"cancelConfirmDescription": "This will stop {{workflow_id}} and run compensation for all completed steps.",
|
|
3029
|
-
"cancelReasonLabel": "Reason (optional)",
|
|
3030
|
-
"cancelSuccess": "Workflow execution cancelled successfully",
|
|
3031
|
-
"retrySuccess": "Workflow re-run started successfully",
|
|
3032
|
-
"retryStepSuccess": "Step retry initiated successfully",
|
|
3033
|
-
"runWorkflow": "Run workflow",
|
|
3034
|
-
"exportJson": "Export as JSON",
|
|
3035
|
-
"exportCsv": "Export as CSV",
|
|
3036
|
-
"completeStep": "Complete step",
|
|
3037
|
-
"markAsSuccessful": "Mark as successful",
|
|
3038
|
-
"markAsFailed": "Mark as failed",
|
|
3039
|
-
"viewDetails": "View details"
|
|
3040
|
-
},
|
|
3041
|
-
"rerun": {
|
|
3042
|
-
"title": "Re-run workflow",
|
|
3043
|
-
"inputLabel": "Input (JSON)",
|
|
3044
|
-
"transactionIdLabel": "Transaction ID (optional)",
|
|
3045
|
-
"submit": "Run workflow",
|
|
3046
|
-
"autoGenerated": "auto-generated",
|
|
3047
|
-
"success": "Workflow re-run started successfully"
|
|
3048
|
-
},
|
|
3049
|
-
"error": {
|
|
3050
|
-
"failureAtStep": "Failure at step: {{step}}",
|
|
3051
|
-
"jumpToStep": "Jump to step",
|
|
3052
|
-
"attemptInfo": "Attempt {{attempt}} of {{maxAttempts}}",
|
|
3053
|
-
"failedAt": "Failed at {{time}}"
|
|
3054
|
-
},
|
|
3055
|
-
"filters": {
|
|
3056
|
-
"savedViews": "Saved views",
|
|
3057
|
-
"saveCurrentFilter": "Save current filter",
|
|
3058
|
-
"savedViewName": "View name",
|
|
3059
|
-
"autoRefresh": "Auto-refresh",
|
|
3060
|
-
"refreshNow": "Refresh now",
|
|
3061
|
-
"everyNSeconds": "Every {{n}}s",
|
|
3062
|
-
"off": "Off",
|
|
3063
|
-
"hasErrors": "Has errors",
|
|
3064
|
-
"all": "All",
|
|
3065
|
-
"allExecutions": "All executions",
|
|
3066
|
-
"running": "Running",
|
|
3067
|
-
"failedToday": "Failed today"
|
|
3068
|
-
},
|
|
3069
|
-
"definitions": {
|
|
3070
|
-
"domain": "Definitions",
|
|
3071
|
-
"subtitle": "Browse all registered workflow definitions.",
|
|
3072
|
-
"name": "Name",
|
|
3073
|
-
"steps": "Steps",
|
|
3074
|
-
"stepCount": "Steps",
|
|
3075
|
-
"handlers": "Handlers",
|
|
3076
|
-
"lastRun": "Last run",
|
|
3077
|
-
"nextRun": "Next run",
|
|
3078
|
-
"scheduled": "Scheduled",
|
|
3079
|
-
"runThisWorkflow": "Run this workflow",
|
|
3080
|
-
"noRecordsMessage": "No workflow definitions found."
|
|
3081
|
-
},
|
|
3082
|
-
"scheduled": {
|
|
3083
|
-
"domain": "Scheduled",
|
|
3084
|
-
"subtitle": "View and manage scheduled workflow executions.",
|
|
3085
|
-
"schedule": "Schedule",
|
|
3086
|
-
"nextRun": "Next run",
|
|
3087
|
-
"lastRun": "Last run",
|
|
3088
|
-
"pause": "Pause",
|
|
3089
|
-
"resume": "Resume",
|
|
3090
|
-
"runNow": "Run now",
|
|
3091
|
-
"noRecordsMessage": "No scheduled workflows found."
|
|
3092
|
-
},
|
|
3093
|
-
"analytics": {
|
|
3094
|
-
"domain": "Analytics",
|
|
3095
|
-
"subtitle": "Workflow execution metrics and trends.",
|
|
3096
|
-
"executions24h": "Executions (24h)",
|
|
3097
|
-
"successRate": "Success rate",
|
|
3098
|
-
"avgDuration": "Avg duration",
|
|
3099
|
-
"runningNow": "Running now",
|
|
3100
|
-
"executionsOverTime": "Executions over time",
|
|
3101
|
-
"perWorkflowBreakdown": "Per-workflow breakdown",
|
|
3102
|
-
"slowestSteps": "Slowest steps",
|
|
3103
|
-
"noDataMessage": "No metrics data available yet."
|
|
3104
|
-
},
|
|
3105
|
-
"asyncStep": {
|
|
3106
|
-
"waitingBanner": "Waiting for external response",
|
|
3107
|
-
"waitingDescription": "Step {{step}} is awaiting a webhook callback.",
|
|
3108
|
-
"idempotencyKey": "Idempotency key",
|
|
3109
|
-
"completeTitle": "Complete step: {{step}}",
|
|
3110
|
-
"responsePayload": "Response payload (JSON)",
|
|
3111
|
-
"expiresIn": "Expires in {{time}}",
|
|
3112
|
-
"stepLabel": "Step",
|
|
3113
|
-
"outcomeLabel": "Outcome",
|
|
3114
|
-
"success": "Success",
|
|
3115
|
-
"failure": "Failure",
|
|
3116
|
-
"markSuccess": "Mark as success",
|
|
3117
|
-
"markFailure": "Mark as failure",
|
|
3118
|
-
"completedSuccess": "Step completed successfully"
|
|
3119
|
-
},
|
|
3120
|
-
"tabs": {
|
|
3121
|
-
"executions": "Executions",
|
|
3122
|
-
"definitions": "Definitions",
|
|
3123
|
-
"scheduled": "Scheduled",
|
|
3124
|
-
"analytics": "Analytics"
|
|
3125
|
-
},
|
|
3126
|
-
"payload": {
|
|
3127
|
-
"inputPayload": "Input payload",
|
|
3128
|
-
"fullCheckpoint": "Full checkpoint",
|
|
3129
|
-
"stepOutputs": "Step outputs",
|
|
3130
|
-
"errors": "Errors",
|
|
3131
|
-
"copyAll": "Copy all",
|
|
3132
|
-
"downloadJson": "Download as JSON"
|
|
3133
|
-
},
|
|
3134
|
-
"codeSnippet": {
|
|
3135
|
-
"curl": "cURL",
|
|
3136
|
-
"sdk": "SDK",
|
|
3137
|
-
"replicateCall": "Replicate this call"
|
|
3138
|
-
},
|
|
3139
|
-
"compare": {
|
|
3140
|
-
"title": "Compare executions",
|
|
3141
|
-
"selectExecution": "Select execution to compare"
|
|
3142
3013
|
}
|
|
3143
3014
|
},
|
|
3144
3015
|
"shippingOptionTypes": {
|
|
@@ -36,19 +36,3 @@ export const TRANSACTION_IN_PROGRESS_STATES: HttpTypes.TransactionState[] = [
|
|
|
36
36
|
TransactionState.WAITING_TO_COMPENSATE,
|
|
37
37
|
TransactionState.COMPENSATING,
|
|
38
38
|
]
|
|
39
|
-
|
|
40
|
-
export const TRANSACTION_TERMINAL_STATES: HttpTypes.TransactionState[] = [
|
|
41
|
-
TransactionState.DONE,
|
|
42
|
-
TransactionState.FAILED,
|
|
43
|
-
TransactionState.REVERTED,
|
|
44
|
-
]
|
|
45
|
-
|
|
46
|
-
export const TRANSACTION_ACTIVE_STATES: HttpTypes.TransactionState[] = [
|
|
47
|
-
TransactionState.INVOKING,
|
|
48
|
-
TransactionState.COMPENSATING,
|
|
49
|
-
TransactionState.WAITING_TO_COMPENSATE,
|
|
50
|
-
]
|
|
51
|
-
|
|
52
|
-
export const STEP_WAITING_STATES: HttpTypes.TransactionStepState[] = [
|
|
53
|
-
TransactionStepState.INVOKING, // waiting_response comes through as invoking state in the step
|
|
54
|
-
]
|
|
@@ -4,12 +4,10 @@ import {
|
|
|
4
4
|
STEP_ERROR_STATES,
|
|
5
5
|
STEP_INACTIVE_STATES,
|
|
6
6
|
STEP_IN_PROGRESS_STATES,
|
|
7
|
+
TRANSACTION_ERROR_STATES,
|
|
8
|
+
TRANSACTION_IN_PROGRESS_STATES,
|
|
7
9
|
} from "./constants"
|
|
8
|
-
import {
|
|
9
|
-
TransactionState,
|
|
10
|
-
TransactionStepState,
|
|
11
|
-
TransactionStepStatus,
|
|
12
|
-
} from "./types"
|
|
10
|
+
import { TransactionState, TransactionStepState } from "./types"
|
|
13
11
|
|
|
14
12
|
export const adminExecutionKey = {
|
|
15
13
|
detail: (id: string) => ["workflow_executions", "detail", id],
|
|
@@ -22,23 +20,18 @@ export const adminExecutionKey = {
|
|
|
22
20
|
|
|
23
21
|
export const getTransactionStateColor = (
|
|
24
22
|
state: TransactionState
|
|
25
|
-
): "green" | "orange" | "red"
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
case TransactionState.REVERTED:
|
|
31
|
-
return "red"
|
|
32
|
-
case TransactionState.INVOKING:
|
|
33
|
-
return "blue"
|
|
34
|
-
case TransactionState.COMPENSATING:
|
|
35
|
-
case TransactionState.WAITING_TO_COMPENSATE:
|
|
36
|
-
return "orange"
|
|
37
|
-
case TransactionState.NOT_STARTED:
|
|
38
|
-
return "grey"
|
|
39
|
-
default:
|
|
40
|
-
return "grey"
|
|
23
|
+
): "green" | "orange" | "red" => {
|
|
24
|
+
let statusColor: "green" | "red" | "orange" = "green"
|
|
25
|
+
|
|
26
|
+
if (TRANSACTION_ERROR_STATES.includes(state)) {
|
|
27
|
+
statusColor = "red"
|
|
41
28
|
}
|
|
29
|
+
|
|
30
|
+
if (TRANSACTION_IN_PROGRESS_STATES.includes(state)) {
|
|
31
|
+
statusColor = "orange"
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
return statusColor
|
|
42
35
|
}
|
|
43
36
|
|
|
44
37
|
export const getTransactionState = (
|
|
@@ -108,152 +101,3 @@ export const getStepState = (
|
|
|
108
101
|
return t("workflowExecutions.step.state.timeout")
|
|
109
102
|
}
|
|
110
103
|
}
|
|
111
|
-
|
|
112
|
-
export const isTerminalState = (state: TransactionState): boolean => {
|
|
113
|
-
return [
|
|
114
|
-
TransactionState.DONE,
|
|
115
|
-
TransactionState.FAILED,
|
|
116
|
-
TransactionState.REVERTED,
|
|
117
|
-
].includes(state)
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
export const getFailedSteps = (
|
|
121
|
-
execution: HttpTypes.AdminWorkflowExecution
|
|
122
|
-
): Array<{ stepId: string; error?: any }> => {
|
|
123
|
-
const steps = execution?.execution?.steps || {}
|
|
124
|
-
const errors = execution?.context?.errors || []
|
|
125
|
-
const failed: Array<{ stepId: string; error?: any }> = []
|
|
126
|
-
|
|
127
|
-
for (const [stepId, step] of Object.entries(steps)) {
|
|
128
|
-
if (stepId === "_root") continue
|
|
129
|
-
const invokeStatus = (step as any)?.invoke?.status
|
|
130
|
-
if (invokeStatus === TransactionStepStatus.PERMANENT_FAILURE) {
|
|
131
|
-
const stepError = errors.find((e: any) => e.action === stepId)
|
|
132
|
-
failed.push({ stepId, error: stepError })
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
return failed
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
export const getWaitingSteps = (
|
|
140
|
-
execution: HttpTypes.AdminWorkflowExecution
|
|
141
|
-
): Array<{ stepId: string }> => {
|
|
142
|
-
const steps = execution?.execution?.steps || {}
|
|
143
|
-
const waiting: Array<{ stepId: string }> = []
|
|
144
|
-
|
|
145
|
-
for (const [stepId, step] of Object.entries(steps)) {
|
|
146
|
-
if (stepId === "_root") continue
|
|
147
|
-
const invokeStatus = (step as any)?.invoke?.status
|
|
148
|
-
if (invokeStatus === TransactionStepStatus.WAITING) {
|
|
149
|
-
waiting.push({ stepId })
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
return waiting
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
export const formatStepDuration = (
|
|
157
|
-
startedAt?: number,
|
|
158
|
-
endedAt?: number
|
|
159
|
-
): string => {
|
|
160
|
-
if (!startedAt || !endedAt) return ""
|
|
161
|
-
|
|
162
|
-
const ms = endedAt - startedAt
|
|
163
|
-
if (ms < 1000) return `${ms}ms`
|
|
164
|
-
if (ms < 60_000) return `${(ms / 1000).toFixed(1)}s`
|
|
165
|
-
const minutes = Math.floor(ms / 60_000)
|
|
166
|
-
const seconds = Math.round((ms % 60_000) / 1000)
|
|
167
|
-
return `${minutes}m ${seconds}s`
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
export const computeIdempotencyKey = (
|
|
171
|
-
workflowId: string,
|
|
172
|
-
transactionId: string,
|
|
173
|
-
stepId: string,
|
|
174
|
-
action: "invoke" | "compensate" = "invoke"
|
|
175
|
-
): string => {
|
|
176
|
-
return `${workflowId}:${transactionId}:${stepId}:${action}`
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
export const mergeStepEvent = (
|
|
180
|
-
current: HttpTypes.AdminWorkflowExecutionResponse | undefined,
|
|
181
|
-
event: {
|
|
182
|
-
event_type: string
|
|
183
|
-
workflow_id: string
|
|
184
|
-
transaction_id: string
|
|
185
|
-
step?: Record<string, unknown>
|
|
186
|
-
response?: Record<string, unknown>
|
|
187
|
-
result?: Record<string, unknown>
|
|
188
|
-
errors?: Array<Record<string, unknown>>
|
|
189
|
-
}
|
|
190
|
-
): HttpTypes.AdminWorkflowExecutionResponse | undefined => {
|
|
191
|
-
if (!current) return current
|
|
192
|
-
|
|
193
|
-
const updated = JSON.parse(
|
|
194
|
-
JSON.stringify(current)
|
|
195
|
-
) as HttpTypes.AdminWorkflowExecutionResponse
|
|
196
|
-
|
|
197
|
-
const execution = updated.workflow_execution
|
|
198
|
-
if (!execution?.execution?.steps) return updated
|
|
199
|
-
|
|
200
|
-
const stepId = (event.step as any)?.id
|
|
201
|
-
if (!stepId) return updated
|
|
202
|
-
|
|
203
|
-
const step = execution.execution.steps[stepId] as any
|
|
204
|
-
if (!step) return updated
|
|
205
|
-
|
|
206
|
-
const eventType = event.event_type
|
|
207
|
-
switch (eventType) {
|
|
208
|
-
case "onStepBegin":
|
|
209
|
-
if (step.invoke) step.invoke.state = TransactionStepState.INVOKING
|
|
210
|
-
break
|
|
211
|
-
case "onStepSuccess":
|
|
212
|
-
if (step.invoke) {
|
|
213
|
-
step.invoke.state = TransactionStepState.DONE
|
|
214
|
-
step.invoke.status = TransactionStepStatus.OK
|
|
215
|
-
}
|
|
216
|
-
break
|
|
217
|
-
case "onStepFailure":
|
|
218
|
-
if (step.invoke) {
|
|
219
|
-
step.invoke.state = TransactionStepState.FAILED
|
|
220
|
-
step.invoke.status = TransactionStepStatus.PERMANENT_FAILURE
|
|
221
|
-
}
|
|
222
|
-
break
|
|
223
|
-
case "onStepAwaiting":
|
|
224
|
-
if (step.invoke) {
|
|
225
|
-
step.invoke.status = TransactionStepStatus.WAITING
|
|
226
|
-
}
|
|
227
|
-
break
|
|
228
|
-
case "onCompensateBegin":
|
|
229
|
-
if (step.compensate) {
|
|
230
|
-
step.compensate.state = TransactionStepState.COMPENSATING
|
|
231
|
-
}
|
|
232
|
-
break
|
|
233
|
-
case "onCompensateStepSuccess":
|
|
234
|
-
if (step.compensate) {
|
|
235
|
-
step.compensate.state = TransactionStepState.REVERTED
|
|
236
|
-
}
|
|
237
|
-
break
|
|
238
|
-
case "onCompensateStepFailure":
|
|
239
|
-
if (step.compensate) {
|
|
240
|
-
step.compensate.state = TransactionStepState.FAILED
|
|
241
|
-
}
|
|
242
|
-
break
|
|
243
|
-
case "onStepSkipped":
|
|
244
|
-
if (step.invoke) {
|
|
245
|
-
step.invoke.state = TransactionStepState.SKIPPED
|
|
246
|
-
}
|
|
247
|
-
break
|
|
248
|
-
case "onFinish":
|
|
249
|
-
execution.state = TransactionState.DONE
|
|
250
|
-
break
|
|
251
|
-
case "onTimeout":
|
|
252
|
-
if (step.invoke) {
|
|
253
|
-
step.invoke.state = TransactionStepState.TIMEOUT
|
|
254
|
-
}
|
|
255
|
-
break
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
return updated
|
|
259
|
-
}
|
|
@@ -22,11 +22,5 @@ export const WorkflowExecutionDetailBreadcrumb = (
|
|
|
22
22
|
|
|
23
23
|
const cleanId = workflow_execution.id.replace("wf_exec_", "")
|
|
24
24
|
|
|
25
|
-
return
|
|
26
|
-
<span>
|
|
27
|
-
{workflow_execution.workflow_id}
|
|
28
|
-
<span className="text-ui-fg-muted"> / </span>
|
|
29
|
-
{cleanId}
|
|
30
|
-
</span>
|
|
31
|
-
)
|
|
25
|
+
return <span>{cleanId}</span>
|
|
32
26
|
}
|
|
@@ -1,15 +1,12 @@
|
|
|
1
1
|
import { Spinner, TriangleDownMini } from "@acmekit/icons"
|
|
2
2
|
import { HttpTypes } from "@acmekit/types"
|
|
3
3
|
import {
|
|
4
|
-
Button,
|
|
5
4
|
clx,
|
|
6
5
|
CodeBlock,
|
|
7
6
|
Container,
|
|
8
|
-
Copy,
|
|
9
7
|
Heading,
|
|
10
8
|
IconButton,
|
|
11
9
|
Text,
|
|
12
|
-
toast,
|
|
13
10
|
} from "@acmekit/ui"
|
|
14
11
|
import { format } from "date-fns"
|
|
15
12
|
import { Collapsible as RadixCollapsible } from "radix-ui"
|
|
@@ -23,12 +20,7 @@ import {
|
|
|
23
20
|
STEP_OK_STATES,
|
|
24
21
|
STEP_SKIPPED_STATES,
|
|
25
22
|
} from "../../../constants"
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
computeIdempotencyKey,
|
|
29
|
-
formatStepDuration,
|
|
30
|
-
} from "../../../utils"
|
|
31
|
-
import { useRetryStep } from "../../../../../hooks/api/workflow-executions"
|
|
23
|
+
import { TransactionStepState, TransactionStepStatus } from "../../../types"
|
|
32
24
|
|
|
33
25
|
type WorkflowExecutionHistorySectionProps = {
|
|
34
26
|
execution: HttpTypes.AdminWorkflowExecution
|
|
@@ -42,14 +34,6 @@ export const WorkflowExecutionHistorySection = ({
|
|
|
42
34
|
const map = Object.values(execution.execution?.steps || {})
|
|
43
35
|
const steps = map.filter((step) => step.id !== "_root")
|
|
44
36
|
|
|
45
|
-
const hasCompensation = [
|
|
46
|
-
TransactionState.COMPENSATING,
|
|
47
|
-
TransactionState.REVERTED,
|
|
48
|
-
TransactionState.WAITING_TO_COMPENSATE,
|
|
49
|
-
].includes(execution.state as TransactionState)
|
|
50
|
-
|
|
51
|
-
const [showCompensation, setShowCompensation] = useState(false)
|
|
52
|
-
|
|
53
37
|
// check if any of the steps have a .invoke.state of "permanent_failure" and if that is the case then return its id
|
|
54
38
|
const unreachableStepId = steps.find(
|
|
55
39
|
(step) => step.invoke.status === TransactionStepStatus.PERMANENT_FAILURE
|
|
@@ -71,17 +55,6 @@ export const WorkflowExecutionHistorySection = ({
|
|
|
71
55
|
<Heading level="h2">
|
|
72
56
|
{t("workflowExecutions.history.sectionTitle")}
|
|
73
57
|
</Heading>
|
|
74
|
-
{hasCompensation && (
|
|
75
|
-
<Button
|
|
76
|
-
size="small"
|
|
77
|
-
variant="secondary"
|
|
78
|
-
onClick={() => setShowCompensation((v) => !v)}
|
|
79
|
-
>
|
|
80
|
-
{showCompensation
|
|
81
|
-
? t("workflowExecutions.history.showInvoke")
|
|
82
|
-
: t("workflowExecutions.history.showCompensation")}
|
|
83
|
-
</Button>
|
|
84
|
-
)}
|
|
85
58
|
</div>
|
|
86
59
|
<div className="flex flex-col gap-y-0.5 px-6 py-4">
|
|
87
60
|
{steps.map((step, index) => {
|
|
@@ -104,8 +77,6 @@ export const WorkflowExecutionHistorySection = ({
|
|
|
104
77
|
stepError={error}
|
|
105
78
|
isLast={index === steps.length - 1}
|
|
106
79
|
isUnreachable={unreachableSteps.includes(step.id)}
|
|
107
|
-
execution={execution}
|
|
108
|
-
showCompensation={showCompensation}
|
|
109
80
|
/>
|
|
110
81
|
)
|
|
111
82
|
})}
|
|
@@ -120,16 +91,12 @@ const Event = ({
|
|
|
120
91
|
stepError,
|
|
121
92
|
isLast,
|
|
122
93
|
isUnreachable,
|
|
123
|
-
execution,
|
|
124
|
-
showCompensation,
|
|
125
94
|
}: {
|
|
126
95
|
step: HttpTypes.AdminWorkflowExecutionStep
|
|
127
96
|
stepInvokeContext: HttpTypes.StepInvokeResult | undefined
|
|
128
97
|
stepError?: HttpTypes.StepError | undefined
|
|
129
98
|
isLast: boolean
|
|
130
99
|
isUnreachable?: boolean
|
|
131
|
-
execution: HttpTypes.AdminWorkflowExecution
|
|
132
|
-
showCompensation?: boolean
|
|
133
100
|
}) => {
|
|
134
101
|
const [open, setOpen] = useState(false)
|
|
135
102
|
|
|
@@ -147,37 +114,6 @@ const Event = ({
|
|
|
147
114
|
}, [hash, stepId])
|
|
148
115
|
|
|
149
116
|
const identifier = step.id.split(".").pop()
|
|
150
|
-
const isPermanentFailure =
|
|
151
|
-
step.invoke.status === TransactionStepStatus.PERMANENT_FAILURE
|
|
152
|
-
const isWaiting = step.invoke.status === TransactionStepStatus.WAITING
|
|
153
|
-
|
|
154
|
-
const idempotencyKey = computeIdempotencyKey(
|
|
155
|
-
execution.workflow_id,
|
|
156
|
-
execution.transaction_id,
|
|
157
|
-
stepId,
|
|
158
|
-
"invoke"
|
|
159
|
-
)
|
|
160
|
-
|
|
161
|
-
const duration = formatStepDuration(
|
|
162
|
-
step.startedAt ?? undefined,
|
|
163
|
-
(step as any).endedAt ?? undefined
|
|
164
|
-
)
|
|
165
|
-
|
|
166
|
-
const { mutateAsync: retryStep, isPending: isRetrying } = useRetryStep(
|
|
167
|
-
execution.workflow_id,
|
|
168
|
-
execution.transaction_id
|
|
169
|
-
)
|
|
170
|
-
|
|
171
|
-
const handleRetryStep = async () => {
|
|
172
|
-
await retryStep(
|
|
173
|
-
{ step_id: stepId },
|
|
174
|
-
{
|
|
175
|
-
onSuccess: () => {
|
|
176
|
-
toast.success(t("workflowExecutions.actions.retryStepSuccess"))
|
|
177
|
-
},
|
|
178
|
-
}
|
|
179
|
-
)
|
|
180
|
-
}
|
|
181
117
|
|
|
182
118
|
return (
|
|
183
119
|
<div
|
|
@@ -195,10 +131,9 @@ const Event = ({
|
|
|
195
131
|
"bg-ui-tag-green-icon": STEP_OK_STATES.includes(
|
|
196
132
|
step.invoke.state
|
|
197
133
|
),
|
|
198
|
-
"bg-ui-tag-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
STEP_IN_PROGRESS_STATES.includes(step.invoke.state),
|
|
134
|
+
"bg-ui-tag-orange-icon": STEP_IN_PROGRESS_STATES.includes(
|
|
135
|
+
step.invoke.state
|
|
136
|
+
),
|
|
202
137
|
"bg-ui-tag-red-icon": STEP_ERROR_STATES.includes(
|
|
203
138
|
step.invoke.state
|
|
204
139
|
),
|
|
@@ -219,29 +154,15 @@ const Event = ({
|
|
|
219
154
|
/>
|
|
220
155
|
</div>
|
|
221
156
|
</div>
|
|
222
|
-
<RadixCollapsible.Root
|
|
223
|
-
open={open}
|
|
224
|
-
onOpenChange={(isOpen) => {
|
|
225
|
-
setOpen(isOpen)
|
|
226
|
-
if (isOpen) {
|
|
227
|
-
window.history.replaceState(null, "", `#${stepId}`)
|
|
228
|
-
}
|
|
229
|
-
}}
|
|
230
|
-
>
|
|
157
|
+
<RadixCollapsible.Root open={open} onOpenChange={setOpen}>
|
|
231
158
|
<RadixCollapsible.Trigger asChild>
|
|
232
159
|
<div className="group flex cursor-pointer items-start justify-between outline-none">
|
|
233
160
|
<Text size="small" leading="compact" weight="plus">
|
|
234
161
|
{identifier}
|
|
235
162
|
</Text>
|
|
236
163
|
<div className="flex items-center gap-x-2">
|
|
237
|
-
{duration && (
|
|
238
|
-
<Text size="small" leading="compact" className="text-ui-fg-muted">
|
|
239
|
-
{duration}
|
|
240
|
-
</Text>
|
|
241
|
-
)}
|
|
242
164
|
<StepState
|
|
243
165
|
state={step.invoke.state}
|
|
244
|
-
status={step.invoke.status}
|
|
245
166
|
startedAt={step.startedAt}
|
|
246
167
|
isUnreachable={isUnreachable}
|
|
247
168
|
/>
|
|
@@ -253,35 +174,6 @@ const Event = ({
|
|
|
253
174
|
</RadixCollapsible.Trigger>
|
|
254
175
|
<RadixCollapsible.Content ref={ref}>
|
|
255
176
|
<div className="flex flex-col gap-y-2 pb-4 pt-2">
|
|
256
|
-
{/* Idempotency key */}
|
|
257
|
-
<div className="flex items-center justify-between">
|
|
258
|
-
<Text size="xsmall" className="text-ui-fg-muted">
|
|
259
|
-
{t("workflowExecutions.history.idempotencyKeyLabel")}
|
|
260
|
-
</Text>
|
|
261
|
-
<Copy content={idempotencyKey} asChild>
|
|
262
|
-
<Text
|
|
263
|
-
size="xsmall"
|
|
264
|
-
className="text-ui-fg-subtle cursor-pointer font-mono"
|
|
265
|
-
>
|
|
266
|
-
{idempotencyKey}
|
|
267
|
-
</Text>
|
|
268
|
-
</Copy>
|
|
269
|
-
</div>
|
|
270
|
-
|
|
271
|
-
{/* Retry from this step — only for permanent failures */}
|
|
272
|
-
{isPermanentFailure && (
|
|
273
|
-
<div className="flex justify-end">
|
|
274
|
-
<Button
|
|
275
|
-
size="small"
|
|
276
|
-
variant="secondary"
|
|
277
|
-
isLoading={isRetrying}
|
|
278
|
-
onClick={handleRetryStep}
|
|
279
|
-
>
|
|
280
|
-
{t("workflowExecutions.history.retryFromStep")}
|
|
281
|
-
</Button>
|
|
282
|
-
</div>
|
|
283
|
-
)}
|
|
284
|
-
|
|
285
177
|
<div className="text-ui-fg-subtle flex flex-col gap-y-2">
|
|
286
178
|
<Text size="small" leading="compact">
|
|
287
179
|
{t("workflowExecutions.history.definitionLabel")}
|
|
@@ -323,37 +215,7 @@ const Event = ({
|
|
|
323
215
|
</CodeBlock>
|
|
324
216
|
</div>
|
|
325
217
|
)}
|
|
326
|
-
{
|
|
327
|
-
<div className="border-ui-tag-orange-border bg-ui-tag-orange-bg rounded-md border p-3">
|
|
328
|
-
<Text size="xsmall" weight="plus" className="text-ui-tag-orange-text mb-2">
|
|
329
|
-
↩ {t("workflowExecutions.history.revertedLabel")} — {step.compensate.state}
|
|
330
|
-
</Text>
|
|
331
|
-
{!!stepInvokeContext?.output?.compensateInput && (
|
|
332
|
-
<div className="flex flex-col gap-y-1">
|
|
333
|
-
<Text size="xsmall" className="text-ui-fg-subtle">
|
|
334
|
-
{t("workflowExecutions.history.compensateInputLabel")}
|
|
335
|
-
</Text>
|
|
336
|
-
<CodeBlock
|
|
337
|
-
snippets={[
|
|
338
|
-
{
|
|
339
|
-
code: JSON.stringify(
|
|
340
|
-
stepInvokeContext?.output?.compensateInput ?? {},
|
|
341
|
-
null,
|
|
342
|
-
2
|
|
343
|
-
),
|
|
344
|
-
label: t("workflowExecutions.history.compensateInputLabel"),
|
|
345
|
-
language: "json",
|
|
346
|
-
hideLineNumbers: true,
|
|
347
|
-
},
|
|
348
|
-
]}
|
|
349
|
-
>
|
|
350
|
-
<CodeBlock.Body />
|
|
351
|
-
</CodeBlock>
|
|
352
|
-
</div>
|
|
353
|
-
)}
|
|
354
|
-
</div>
|
|
355
|
-
)}
|
|
356
|
-
{!showCompensation && !!stepInvokeContext?.output?.compensateInput &&
|
|
218
|
+
{!!stepInvokeContext?.output?.compensateInput &&
|
|
357
219
|
step.compensate.state === TransactionStepState.REVERTED && (
|
|
358
220
|
<div className="text-ui-fg-subtle flex flex-col gap-y-2">
|
|
359
221
|
<Text size="small" leading="compact">
|
|
@@ -415,12 +277,10 @@ const Event = ({
|
|
|
415
277
|
|
|
416
278
|
const StepState = ({
|
|
417
279
|
state,
|
|
418
|
-
status,
|
|
419
280
|
startedAt,
|
|
420
281
|
isUnreachable,
|
|
421
282
|
}: {
|
|
422
283
|
state: HttpTypes.TransactionStepState
|
|
423
|
-
status?: HttpTypes.TransactionStepStatus
|
|
424
284
|
startedAt?: number | null
|
|
425
285
|
isUnreachable?: boolean
|
|
426
286
|
}) => {
|
|
@@ -428,7 +288,6 @@ const StepState = ({
|
|
|
428
288
|
|
|
429
289
|
const isFailed = state === TransactionStepState.FAILED
|
|
430
290
|
const isRunning = state === TransactionStepState.INVOKING
|
|
431
|
-
const isWaitingResponse = status === TransactionStepStatus.WAITING
|
|
432
291
|
const isSkipped = state === TransactionStepState.SKIPPED
|
|
433
292
|
const isSkippedFailure = state === TransactionStepState.SKIPPED_FAILURE
|
|
434
293
|
|
|
@@ -436,16 +295,6 @@ const StepState = ({
|
|
|
436
295
|
return null
|
|
437
296
|
}
|
|
438
297
|
|
|
439
|
-
if (isWaitingResponse) {
|
|
440
|
-
return (
|
|
441
|
-
<div className="flex items-center gap-x-1">
|
|
442
|
-
<Text size="small" leading="compact" className="text-ui-tag-purple-text">
|
|
443
|
-
{t("workflowExecutions.history.awaitingState")}
|
|
444
|
-
</Text>
|
|
445
|
-
</div>
|
|
446
|
-
)
|
|
447
|
-
}
|
|
448
|
-
|
|
449
298
|
if (isRunning) {
|
|
450
299
|
return (
|
|
451
300
|
<div className="flex items-center gap-x-1">
|