@fluidgrids/fe-sdk 0.0.0-stage → 2026.1203.7

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 (323) hide show
  1. package/README.md +564 -2
  2. package/dist/ActivityOptionsFields-C2u-hY2U.js +142 -0
  3. package/dist/AiStudioPage-B_hNTj-_.js +1137 -0
  4. package/dist/ApprovalInboxPage-ClITra3n.js +1312 -0
  5. package/dist/ChoiceSelect-LkK-uS9J.js +65 -0
  6. package/dist/ConfirmActionDialog-DHWTDRbp.js +31 -0
  7. package/dist/ConnectionFormDialog-C0kDgcrZ.js +153 -0
  8. package/dist/CreateFluidgridsTagDocument-Dtp9KPLJ.js +1055 -0
  9. package/dist/DataSinkDashboardPage-b4ezeqa6.js +278 -0
  10. package/dist/DataTablesPage-C1d9YGHz.js +5575 -0
  11. package/dist/DateTimeField-B1qR4ruo.js +51 -0
  12. package/dist/Disclosure-BNKij7-v.js +45 -0
  13. package/dist/ElementLibraryPage-8jNO6YmE.js +2256 -0
  14. package/dist/ElementLibrarySequenceDocument-B-W8SPzn.js +3979 -0
  15. package/dist/EnsureThemeProvider-BvlNjAd0.js +24 -0
  16. package/dist/EntityTagBadge-1OlP6p0c.js +25 -0
  17. package/dist/EntityTagPicker-BBrU5cE0.js +137 -0
  18. package/dist/ExecuteStepDocument-B4j1mdRT.js +189 -0
  19. package/dist/ExecutionDetailDocument-D6QuM-kp.js +875 -0
  20. package/dist/ExecutionDetailPage-D4CBtFdo.js +12217 -0
  21. package/dist/ExecutionDetailPage-DvQ667OE.d.ts +10 -0
  22. package/dist/ExecutionStatusBadge-BsDVor9t.js +221 -0
  23. package/dist/ExecutionsListDocument-Dan7ZiqB.js +459 -0
  24. package/dist/ExecutionsListPage-B3XT8ITL.js +4307 -0
  25. package/dist/FailureTriagePanel-DOJMaJ0n.js +1285 -0
  26. package/dist/FileDownloadUrlDocument-CVOYKcL5.js +92 -0
  27. package/dist/FluidGridsDocsLink-bX0Hnhxr.js +66 -0
  28. package/dist/FluidGridsMark-CE2blT7K.js +74 -0
  29. package/dist/HeldLoadRegion-BtTxbvOW.js +34 -0
  30. package/dist/HistoryPage-BLoRpJ1R.d.ts +6 -0
  31. package/dist/HistoryPage-BSBISXoj.js +2835 -0
  32. package/dist/Icon-BtQ0HXLh.js +160 -0
  33. package/dist/InsightsPage-D7ybj8N9.js +11245 -0
  34. package/dist/IsolationSetting-vy911E8b.js +1153 -0
  35. package/dist/LibraryParts-DOeNgR8A.js +413 -0
  36. package/dist/ManagedAiPolicyAuthority-BxwJ3ptd.js +40 -0
  37. package/dist/ManagedAiPolicyAuthority-DM3t3wNr.d.ts +18 -0
  38. package/dist/ManagedAiPolicyAuthorityContext-CNkxIOZ1.js +10 -0
  39. package/dist/McpTriggerServers-BCPCAOWB.js +459 -0
  40. package/dist/MissingNodesInstallModal-rO_SEDrC.js +224 -0
  41. package/dist/NavigationV2Provider-DCDt35eG.js +17 -0
  42. package/dist/NodeSchemaIntrospectionDocument-C1vAIcHd.js +95 -0
  43. package/dist/NodesPage-DEbnz9iU.d.ts +6 -0
  44. package/dist/NodesPage-O7KeeKtd.js +653 -0
  45. package/dist/OfflineIcon-TwMKYWjA.js +207 -0
  46. package/dist/OpenTemplateAsCodeButton-BhWJWIF3.js +94 -0
  47. package/dist/PaidTemplateConfirm-_G3ag6S4.js +28 -0
  48. package/dist/PublishCustomNodeAction-CIySbK4c.js +134 -0
  49. package/dist/RecordTaskDialog-BkpCDvhR.js +2078 -0
  50. package/dist/RunActionsMenu-DodOgIQm.js +59 -0
  51. package/dist/RunnerStatusPill-C1v967iq.js +24 -0
  52. package/dist/RunnersPage-dB0RSdY_.js +1929 -0
  53. package/dist/SandboxRuntimeExhaustedNotice-BFOIF93C.js +120 -0
  54. package/dist/SchedulesPage-DPWr1yvf.js +1607 -0
  55. package/dist/SearchBox-BGtYjvfs.js +49 -0
  56. package/dist/SequenceEditor-CFiHeHkR.js +497 -0
  57. package/dist/SettingsPage-0CQBNPZV.js +8695 -0
  58. package/dist/StewardPages-DAJhepen.js +47 -0
  59. package/dist/StewardRunImportPanel-Kva2DO0u.js +2844 -0
  60. package/dist/StoreTemplateCardCompact-CHn5kP7A.js +2166 -0
  61. package/dist/TagFilterSelect-CyA8QrS7.js +42 -0
  62. package/dist/TaskQueuesPage-DdnDCyat.js +3571 -0
  63. package/dist/TechnicalDetails-B0Oi4aZw.js +19 -0
  64. package/dist/TemplateConfigurationModal-CdvCYJLM.js +332 -0
  65. package/dist/TemplateDetailPanel-CbiKciuB.js +222 -0
  66. package/dist/TemplatePreview-cx7-NOeG.js +868 -0
  67. package/dist/TemplatesPage-BG3H-6v6.d.ts +10 -0
  68. package/dist/TemplatesPage-BVQpGYIV.js +3251 -0
  69. package/dist/TerminateExecutionDocument-B_HKNVrN.js +581 -0
  70. package/dist/TranslationBridge-Bd4aJKMs.d.ts +11 -0
  71. package/dist/TranslationBridge-Da-TPgQm.js +68 -0
  72. package/dist/TriggerWorkflowDocument-D9Km2Vv2.js +460 -0
  73. package/dist/UiSequencePickerSequenceDocument-BSYnSDV7.js +607 -0
  74. package/dist/UiStepScreenshot-Qh4QMyUp.js +146 -0
  75. package/dist/UsageTimeSeriesDocument-DcInx9-z.js +177 -0
  76. package/dist/VariablesPage-ChfGuW22.js +2243 -0
  77. package/dist/VersionDiffDialog-Bd2AeUwf.js +1702 -0
  78. package/dist/VersionLifecycleBar-BBeWVtz-.js +143 -0
  79. package/dist/WebhookDeliveriesPage-D66bua0j.js +1563 -0
  80. package/dist/WorkflowBuilder-B6wQD1TK.js +539 -0
  81. package/dist/WorkflowBuilder-DR4ku8Tr.js +1611 -0
  82. package/dist/WorkflowDefinitionDocument-DZLbTPUZ.js +321 -0
  83. package/dist/WorkflowEmbed-BXfFGy0i.js +708 -0
  84. package/dist/WorkflowEmbed-Cbqe1s1z.d.ts +6 -0
  85. package/dist/WorkflowPinnedDataDocument-BODT5omd.js +782 -0
  86. package/dist/WorkflowProposalCard-BruukdeF.js +96 -0
  87. package/dist/WorkflowProposalDocument-BdUbsrd0.js +620 -0
  88. package/dist/WorkflowSearchRedirect-C7zJ2MKH.js +40 -0
  89. package/dist/WorkflowSettingsDrawer-MVU1BKfY.d.ts +18 -0
  90. package/dist/WorkflowSettingsDrawer-gazs97WR.js +196 -0
  91. package/dist/WorkflowShareDialog-e8jJtLjU.js +469 -0
  92. package/dist/WorkflowVersionsDocument-DRVOp8Uj.js +3213 -0
  93. package/dist/WorkflowsList--hR2_8gf.js +4593 -0
  94. package/dist/WorkflowsList-CcNDQge5.d.ts +6 -0
  95. package/dist/WorkflowsListPageDocument-CnzcQm_o.js +934 -0
  96. package/dist/addonCatalog-CbZS4deh.js +58 -0
  97. package/dist/addonCatalog-sjlonAmR.d.ts +15 -0
  98. package/dist/addons.d.ts +3 -0
  99. package/dist/addons.js +4 -0
  100. package/dist/agent-form-Bfvm32j1.js +83 -0
  101. package/dist/agent-tools.d.ts +3 -0
  102. package/dist/agent-tools.js +5 -0
  103. package/dist/agentTools-CyL7DLOF.js +320 -0
  104. package/dist/ai-usage-BrxDgvdR.js +240 -0
  105. package/dist/aiCreditsBridge-BuE92tKo.js +49 -0
  106. package/dist/api-BKq-nIOZ.js +2286 -0
  107. package/dist/api-Ol7I8NxE.js +8289 -0
  108. package/dist/apollo-type-policies.d.ts +11 -0
  109. package/dist/apollo-type-policies.js +64 -0
  110. package/dist/askAboutBridge-ByYsQams.js +106 -0
  111. package/dist/askQuestions-Cmx7VnMm.js +742 -0
  112. package/dist/assert-rules-lfYEMc99.js +318 -0
  113. package/dist/assistant.d.ts +94 -0
  114. package/dist/assistant.js +99 -0
  115. package/dist/attach-node-helpers-HDKQOtrD.js +32 -0
  116. package/dist/badge-CXfPhoMH.js +26 -0
  117. package/dist/basil.generated-BK-EHbwN.js +10 -0
  118. package/dist/browser-steps-DMpS5TyB.js +533 -0
  119. package/dist/builderTimings-pvGnK1m-.js +510 -0
  120. package/dist/button-DG7y_FVJ.js +48 -0
  121. package/dist/canvasNoteTools-BxuP_AYO.js +137 -0
  122. package/dist/card-Bomy_1UG.js +44 -0
  123. package/dist/catalogGrid-BOrfMgi-.js +41 -0
  124. package/dist/channel-CPyQ1NR1.js +212 -0
  125. package/dist/chips-CvNrYJZa.js +27 -0
  126. package/dist/client-holder-C0M5Cfwl.js +68 -0
  127. package/dist/cn-QqidFIgr.js +10 -0
  128. package/dist/code-editor-diagnostics-Zr0cIcx1.js +46 -0
  129. package/dist/code-editor-field-x_JrY8KR.js +113 -0
  130. package/dist/codec-client-DPuD6mw7.js +515 -0
  131. package/dist/conditionBuilder-DwfEF0Q-.js +1144 -0
  132. package/dist/config-DO68jw5k.js +322 -0
  133. package/dist/constants-DgbVc24O.d.ts +296 -0
  134. package/dist/constants-DlRnHBfQ.js +217 -0
  135. package/dist/convert-browser-action-pfecelF7.js +347 -0
  136. package/dist/convert-dialog-B_o22NiJ.js +382 -0
  137. package/dist/create-workflow-first-Azg3JUdX.js +120 -0
  138. package/dist/definition-canvas-Bsda-rDT.js +31 -0
  139. package/dist/dialog-BVd152GS.js +94 -0
  140. package/dist/durable-nodes-BXyYCLxT.js +91 -0
  141. package/dist/duration-CDb7-mT_.js +33 -0
  142. package/dist/edge-mapper-wEAdGVU2.js +4477 -0
  143. package/dist/element-library-DkSlg_VE.js +727 -0
  144. package/dist/entities-I_0kio3q.js +38 -0
  145. package/dist/error-advice-QLr5NCm7.js +65 -0
  146. package/dist/errors-ClKb5sEt.js +188 -0
  147. package/dist/executions.d.ts +3 -0
  148. package/dist/executions.js +5 -0
  149. package/dist/feature-flags-B2qetXKd.js +385 -0
  150. package/dist/field-label-DPZRmE_B.js +153 -0
  151. package/dist/firstWorkflow-C_h0KMB2.js +133 -0
  152. package/dist/flags.d.ts +3 -0
  153. package/dist/flags.js +4 -0
  154. package/dist/flow-builder-DIvLOhz0.js +28038 -0
  155. package/dist/flow-store-holder-CUN7Terz.js +52 -0
  156. package/dist/fluent.generated-CA_e6-4l.js +14 -0
  157. package/dist/fluidgridsEvents-bbEQbwU6.js +175 -0
  158. package/dist/fluidgridsTheme-DUhvOgoy.js +297 -0
  159. package/dist/global-client-BQPuFrFa.js +433 -0
  160. package/dist/global-operations-BG6YgxrM.js +136 -0
  161. package/dist/graphql-types-UTYtujY9.js +21358 -0
  162. package/dist/history.d.ts +3 -0
  163. package/dist/history.js +4 -0
  164. package/dist/index-AoJAa5vU.d.ts +164958 -0
  165. package/dist/index-DEMT3iAM.d.ts +120 -0
  166. package/dist/index-ROZzNGyY.d.ts +76 -0
  167. package/dist/index.d.ts +20 -0
  168. package/dist/index.js +8123 -0
  169. package/dist/ion.generated-mbajjcAg.js +10 -0
  170. package/dist/label-Lzb8ZXf_.js +29 -0
  171. package/dist/labels-rXd9gYQz.js +1236 -0
  172. package/dist/liveCanvas-D5ytXDp8.js +103 -0
  173. package/dist/logos.generated-X6_0kjVR.js +21 -0
  174. package/dist/logs-panel-Cw0DkG0l.js +468 -0
  175. package/dist/lucide.generated-B6NVd3GT.js +29 -0
  176. package/dist/marksStore-a9oIMMot.js +175 -0
  177. package/dist/mcp-trigger-D0nRdvq5.js +307 -0
  178. package/dist/mdi.generated-D1BV74d6.js +292 -0
  179. package/dist/menus-CU3hDGYl.js +160 -0
  180. package/dist/mynaui.generated-DMWr5cXz.js +66 -0
  181. package/dist/navigation-v2.d.ts +3 -0
  182. package/dist/navigation-v2.js +5 -0
  183. package/dist/node-detail-view-Cgm5H1P-.js +1372 -0
  184. package/dist/node-editor-tab-body-CZ0fVuVP.js +187 -0
  185. package/dist/node-operation-selection-CdV3KI_V.js +3534 -0
  186. package/dist/node-registry-refresh-s3okf83X.js +27 -0
  187. package/dist/node-role-TMbnkmeP.js +132 -0
  188. package/dist/node-type-icon-BZa8n4iG.js +33 -0
  189. package/dist/nodes.d.ts +3 -0
  190. package/dist/nodes.js +4 -0
  191. package/dist/notesKey-5EaREBGA.js +12 -0
  192. package/dist/observability.d.ts +3 -0
  193. package/dist/observability.js +5 -0
  194. package/dist/offset-pages-zghoClB3.js +55 -0
  195. package/dist/operations-BBmT9ToP.js +663 -0
  196. package/dist/operations-WxRJWeqO.js +3133 -0
  197. package/dist/output-files-Ba8bu5lv.js +196 -0
  198. package/dist/page-operation-DrWuhd6Y.js +129 -0
  199. package/dist/page-twins.d.ts +13 -0
  200. package/dist/page-twins.js +186 -0
  201. package/dist/pageControlSpecs-DZJ9K37m.js +134 -0
  202. package/dist/pageControlsBridge-0pX9s-3k.js +54 -0
  203. package/dist/pageControlsBridge-DAuT3w7L.d.ts +36 -0
  204. package/dist/panels-PfBBAToE.js +346 -0
  205. package/dist/parts-B7fBcw-B.js +346 -0
  206. package/dist/popover-Dms9Vz3j.js +3389 -0
  207. package/dist/preloadable-lazy-Pp47mqQ9.js +65 -0
  208. package/dist/proactive.d.ts +66 -0
  209. package/dist/proactive.js +237 -0
  210. package/dist/quick-config-panel-DFd77xho.js +451 -0
  211. package/dist/quota-DeA_CJ2e.js +175 -0
  212. package/dist/quota.d.ts +3 -0
  213. package/dist/quota.js +4 -0
  214. package/dist/read-only-context-Dt9N9SIG.js +18 -0
  215. package/dist/relative-time-Dxt8ZIIu.js +55 -0
  216. package/dist/results-CwK_yDxK.js +325 -0
  217. package/dist/rolldown-runtime-hDbaFkMy.js +18 -0
  218. package/dist/route-data.d.ts +12 -0
  219. package/dist/route-data.js +69 -0
  220. package/dist/route-match-C-0_EnAt.d.ts +5 -0
  221. package/dist/route-match-DMkUICYV.js +41 -0
  222. package/dist/route-preload-C4DlGoCd.js +120 -0
  223. package/dist/run-display-UjLAoYqQ.js +81 -0
  224. package/dist/run-history-arGiHzGU.js +285 -0
  225. package/dist/run-list-links-DJn4Mf1T.js +98 -0
  226. package/dist/run-mode-USmM0-Uo.js +82 -0
  227. package/dist/run-parity-CWXqEJqM.js +144 -0
  228. package/dist/runsQuota-B6SyTbne.js +100 -0
  229. package/dist/runsQuota-DsniKiSg.d.ts +20 -0
  230. package/dist/safe-expression-Cw7-SCsm.js +1251 -0
  231. package/dist/save-status-store-C7nEYpfb.js +631 -0
  232. package/dist/schedule-panel-B4GYXzXQ.js +13774 -0
  233. package/dist/schedule-rules-ggVKRkBH.js +358 -0
  234. package/dist/secrets-Re_wSiE3.js +153 -0
  235. package/dist/settings.d.ts +4 -0
  236. package/dist/settings.js +6 -0
  237. package/dist/shared-DAWGGMSM.js +177 -0
  238. package/dist/sidebar-node-editor-6eSSgCzc.js +178 -0
  239. package/dist/solar.generated-CGYuUQAC.js +10 -0
  240. package/dist/stableTabbedDialog-BBhrfXGe.js +20 -0
  241. package/dist/start-url-CT6Yz96K.js +24 -0
  242. package/dist/status-CessxGpm.js +55 -0
  243. package/dist/store-icon-OctYp5zP.js +155 -0
  244. package/dist/styles-WGmTnZ2n.js +26 -0
  245. package/dist/styles.css +139 -0
  246. package/dist/svg-spinners.generated-CIPT7IhM.js +10 -0
  247. package/dist/template-code-CzN6JWNV.js +191 -0
  248. package/dist/template-graph-DLF9dygU.js +20 -0
  249. package/dist/template-preview-DcIIKOOL.js +32 -0
  250. package/dist/template-price-CdUHZRMF.js +40 -0
  251. package/dist/templates.d.ts +3 -0
  252. package/dist/templates.js +5 -0
  253. package/dist/theme-provider-CntfC4_i.js +23 -0
  254. package/dist/transient-DgZfhDfN.js +57 -0
  255. package/dist/typed-calls-C5tO03wq.js +26 -0
  256. package/dist/ui-script-By74Guk3.js +1094 -0
  257. package/dist/ui-script-editor-CqPu2bCN.js +2447 -0
  258. package/dist/ui-step-fix-8uM2_Hft.js +67 -0
  259. package/dist/ui-step-fix-store-CcO1FdRx.js +19 -0
  260. package/dist/ui-step-run-context-o7bLE6KP.js +46 -0
  261. package/dist/ui-target-editor-D2JhB_lD.js +673 -0
  262. package/dist/uiMarkTools-CSznnO1i.js +1054 -0
  263. package/dist/upgradePrompt-BAFBKKW5.js +72 -0
  264. package/dist/use-bare-node-registry-O6mKJO_n.js +11498 -0
  265. package/dist/use-browser-available-hj8wc3Kb.js +241 -0
  266. package/dist/use-edge-mapper-schemas-Bonofxow.js +496 -0
  267. package/dist/use-extension-bridge-B9ZreOkQ.js +608 -0
  268. package/dist/use-mobile-BTqCUjzS.js +27 -0
  269. package/dist/use-sdk-query-C697xZVv.js +116 -0
  270. package/dist/use-workflow-code-editor-CFoRFrZ5.js +753 -0
  271. package/dist/useActionParam-B2tU2BlY.js +85 -0
  272. package/dist/useAgentTokenStream-Bko_J0d0.js +4217 -0
  273. package/dist/useBrowserClients-3v95-gSh.js +103 -0
  274. package/dist/useCodeWorkflowInsights-w0tz9Ap_.js +600 -0
  275. package/dist/useConnections-DsgEJs05.js +439 -0
  276. package/dist/useDebouncedValue-BFekcv6n.js +18 -0
  277. package/dist/useDurableParity-8fnMZmBc.js +1787 -0
  278. package/dist/useEntityTags-D0spL6Ut.js +460 -0
  279. package/dist/useExecutions-2u5nGJJk.js +681 -0
  280. package/dist/useFluidGridsAnalytics-VM8lAi2x.js +238 -0
  281. package/dist/useGlobalStoreClient-BTdhkA2I.js +24 -0
  282. package/dist/useHumanRequests-zlYDp3l1.js +221 -0
  283. package/dist/useNavigationV2-C2WeqN7d.js +29 -0
  284. package/dist/useNavigationV2-DANUmg12.d.ts +9 -0
  285. package/dist/useObservability-BRlQ0tOA.js +285 -0
  286. package/dist/useRequestedProposal-B7uPXfZB.js +51 -0
  287. package/dist/useRunHistory-CXCMUPyf.js +2759 -0
  288. package/dist/useRunLive-D0JvVZT2.js +1060 -0
  289. package/dist/useRunnerList-Dbi59i1K.js +446 -0
  290. package/dist/useRunners-URUc5quU.js +173 -0
  291. package/dist/useRunsPage-DG656UCK.js +2709 -0
  292. package/dist/useVariables-BIelxcWr.js +463 -0
  293. package/dist/useVersionHistoryData-CTjqVw7l.js +292 -0
  294. package/dist/useWorkflowCodeExport-pqxyLHD1.js +522 -0
  295. package/dist/useWorkflowListExport-hcZNvTaB.js +232 -0
  296. package/dist/useWorkflowOrganization-CpBbOrs7.js +1772 -0
  297. package/dist/useWorkflowProposal-BH0VdNMA.js +3280 -0
  298. package/dist/useWorkflows-Cvg-Z_IE.js +1606 -0
  299. package/dist/utils-fvBb5qOD.js +89 -0
  300. package/dist/webhook-deliveries-AvQujaZy.js +99 -0
  301. package/dist/workflow-builder-CJygVkVv.d.ts +2 -0
  302. package/dist/workflow-builder.d.ts +3 -0
  303. package/dist/workflow-builder.js +8 -0
  304. package/dist/workflow-code-transfer-Bsy0JKAZ.js +323 -0
  305. package/dist/workflow-embed.d.ts +3 -0
  306. package/dist/workflow-embed.js +4 -0
  307. package/dist/workflow-git-sync--K9ZsPDC.js +263 -0
  308. package/dist/workflow-host.d.ts +6 -0
  309. package/dist/workflow-host.js +11 -0
  310. package/dist/workflow-pages-D-7ByLTB.d.ts +68 -0
  311. package/dist/workflow-pages.d.ts +3 -0
  312. package/dist/workflow-pages.js +115 -0
  313. package/dist/workflow-preview-canvas-CO8yzdE3.js +848 -0
  314. package/dist/workflow-preview.d.ts +65 -0
  315. package/dist/workflow-preview.js +4 -0
  316. package/dist/workflow-route.d.ts +33 -0
  317. package/dist/workflow-route.js +4 -0
  318. package/dist/workflow-save-state-D0l-DkLf.js +767 -0
  319. package/dist/workflow-transfer-CQnQC-ke.js +104 -0
  320. package/dist/workflowRouteData-BkfVOc-O.js +169 -0
  321. package/dist/workflows-list.d.ts +10 -0
  322. package/dist/workflows-list.js +5 -0
  323. package/package.json +320 -4
@@ -0,0 +1,1563 @@
1
+ "use client";
2
+ import { t as __exportAll } from "./rolldown-runtime-hDbaFkMy.js";
3
+ import { t as Icon } from "./Icon-BtQ0HXLh.js";
4
+ import { r as useTr } from "./TranslationBridge-Da-TPgQm.js";
5
+ import { i as SdkPermissionButton, t as FLUIDGRIDS_PERMISSIONS } from "./constants-DlRnHBfQ.js";
6
+ import { a as formatReceivedAt, c as outcomeTone, d as prettyPayload, f as registrationLabel, i as formatDuration, l as parseValidationFilter, n as deliveryOutcome, o as headerEntries, p as validationPassedArg, r as formatBytes, s as httpStatusTone, t as VALIDATION_FILTERS, u as payloadBytes } from "./webhook-deliveries-AvQujaZy.js";
7
+ import { n as getFluidGridsClient } from "./client-holder-C0M5Cfwl.js";
8
+ import { s as throwIfResultError } from "./errors-ClKb5sEt.js";
9
+ import { useCallback, useEffect, useMemo, useRef, useState } from "react";
10
+ import { Link, useSearchParams } from "react-router";
11
+ import { jsx, jsxs } from "react/jsx-runtime";
12
+ import { toast } from "sonner";
13
+ import { cn } from "@burdenoff/fe-libs/utils";
14
+ import { Badge, Card, CardContent, CardHeader, CompactMarkOr, EmptyState, Label, Select, SelectContent, SelectItem, SelectTrigger, SelectValue, Sheet, SheetContent, SheetHeader, SheetTitle, Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "@burdenoff/fe-libs/ui";
15
+ import { Button as Button$1 } from "@burdenoff/fe-libs/button";
16
+
17
+ // src/generated/documents/wspace/RetryWebhookDeliveryDocument.ts
18
+ const RetryWebhookDeliveryDocument = {
19
+ "kind": "Document",
20
+ "definitions": [{
21
+ "kind": "OperationDefinition",
22
+ "operation": "mutation",
23
+ "name": {
24
+ "kind": "Name",
25
+ "value": "RetryWebhookDelivery"
26
+ },
27
+ "variableDefinitions": [{
28
+ "kind": "VariableDefinition",
29
+ "variable": {
30
+ "kind": "Variable",
31
+ "name": {
32
+ "kind": "Name",
33
+ "value": "deliveryId"
34
+ }
35
+ },
36
+ "type": {
37
+ "kind": "NonNullType",
38
+ "type": {
39
+ "kind": "NamedType",
40
+ "name": {
41
+ "kind": "Name",
42
+ "value": "ID"
43
+ }
44
+ }
45
+ },
46
+ "directives": []
47
+ }],
48
+ "directives": [],
49
+ "selectionSet": {
50
+ "kind": "SelectionSet",
51
+ "selections": [{
52
+ "kind": "Field",
53
+ "name": {
54
+ "kind": "Name",
55
+ "value": "retryWebhookDelivery"
56
+ },
57
+ "arguments": [{
58
+ "kind": "Argument",
59
+ "name": {
60
+ "kind": "Name",
61
+ "value": "deliveryId"
62
+ },
63
+ "value": {
64
+ "kind": "Variable",
65
+ "name": {
66
+ "kind": "Name",
67
+ "value": "deliveryId"
68
+ }
69
+ }
70
+ }],
71
+ "directives": [],
72
+ "selectionSet": {
73
+ "kind": "SelectionSet",
74
+ "selections": [
75
+ {
76
+ "kind": "Field",
77
+ "name": {
78
+ "kind": "Name",
79
+ "value": "success"
80
+ },
81
+ "arguments": [],
82
+ "directives": []
83
+ },
84
+ {
85
+ "kind": "Field",
86
+ "name": {
87
+ "kind": "Name",
88
+ "value": "message"
89
+ },
90
+ "arguments": [],
91
+ "directives": []
92
+ },
93
+ {
94
+ "kind": "Field",
95
+ "name": {
96
+ "kind": "Name",
97
+ "value": "delivery"
98
+ },
99
+ "arguments": [],
100
+ "directives": [],
101
+ "selectionSet": {
102
+ "kind": "SelectionSet",
103
+ "selections": [{
104
+ "kind": "FragmentSpread",
105
+ "name": {
106
+ "kind": "Name",
107
+ "value": "WebhookDeliveryFields"
108
+ },
109
+ "directives": []
110
+ }]
111
+ }
112
+ }
113
+ ]
114
+ }
115
+ }]
116
+ }
117
+ }, {
118
+ "kind": "FragmentDefinition",
119
+ "name": {
120
+ "kind": "Name",
121
+ "value": "WebhookDeliveryFields"
122
+ },
123
+ "variableDefinitions": [],
124
+ "typeCondition": {
125
+ "kind": "NamedType",
126
+ "name": {
127
+ "kind": "Name",
128
+ "value": "WebhookDeliveryLog"
129
+ }
130
+ },
131
+ "directives": [],
132
+ "selectionSet": {
133
+ "kind": "SelectionSet",
134
+ "selections": [
135
+ {
136
+ "kind": "Field",
137
+ "name": {
138
+ "kind": "Name",
139
+ "value": "id"
140
+ },
141
+ "arguments": [],
142
+ "directives": []
143
+ },
144
+ {
145
+ "kind": "Field",
146
+ "name": {
147
+ "kind": "Name",
148
+ "value": "eventRegistrationId"
149
+ },
150
+ "arguments": [],
151
+ "directives": []
152
+ },
153
+ {
154
+ "kind": "Field",
155
+ "name": {
156
+ "kind": "Name",
157
+ "value": "requestHeaders"
158
+ },
159
+ "arguments": [],
160
+ "directives": []
161
+ },
162
+ {
163
+ "kind": "Field",
164
+ "name": {
165
+ "kind": "Name",
166
+ "value": "requestBody"
167
+ },
168
+ "arguments": [],
169
+ "directives": []
170
+ },
171
+ {
172
+ "kind": "Field",
173
+ "name": {
174
+ "kind": "Name",
175
+ "value": "requestIp"
176
+ },
177
+ "arguments": [],
178
+ "directives": []
179
+ },
180
+ {
181
+ "kind": "Field",
182
+ "name": {
183
+ "kind": "Name",
184
+ "value": "validationPassed"
185
+ },
186
+ "arguments": [],
187
+ "directives": []
188
+ },
189
+ {
190
+ "kind": "Field",
191
+ "name": {
192
+ "kind": "Name",
193
+ "value": "validationError"
194
+ },
195
+ "arguments": [],
196
+ "directives": []
197
+ },
198
+ {
199
+ "kind": "Field",
200
+ "name": {
201
+ "kind": "Name",
202
+ "value": "workflowRunId"
203
+ },
204
+ "arguments": [],
205
+ "directives": []
206
+ },
207
+ {
208
+ "kind": "Field",
209
+ "name": {
210
+ "kind": "Name",
211
+ "value": "executionStarted"
212
+ },
213
+ "arguments": [],
214
+ "directives": []
215
+ },
216
+ {
217
+ "kind": "Field",
218
+ "name": {
219
+ "kind": "Name",
220
+ "value": "executionError"
221
+ },
222
+ "arguments": [],
223
+ "directives": []
224
+ },
225
+ {
226
+ "kind": "Field",
227
+ "name": {
228
+ "kind": "Name",
229
+ "value": "responseStatus"
230
+ },
231
+ "arguments": [],
232
+ "directives": []
233
+ },
234
+ {
235
+ "kind": "Field",
236
+ "name": {
237
+ "kind": "Name",
238
+ "value": "responseBody"
239
+ },
240
+ "arguments": [],
241
+ "directives": []
242
+ },
243
+ {
244
+ "kind": "Field",
245
+ "name": {
246
+ "kind": "Name",
247
+ "value": "attemptCount"
248
+ },
249
+ "arguments": [],
250
+ "directives": []
251
+ },
252
+ {
253
+ "kind": "Field",
254
+ "name": {
255
+ "kind": "Name",
256
+ "value": "nextRetryTime"
257
+ },
258
+ "arguments": [],
259
+ "directives": []
260
+ },
261
+ {
262
+ "kind": "Field",
263
+ "name": {
264
+ "kind": "Name",
265
+ "value": "retryable"
266
+ },
267
+ "arguments": [],
268
+ "directives": []
269
+ },
270
+ {
271
+ "kind": "Field",
272
+ "name": {
273
+ "kind": "Name",
274
+ "value": "retryBlockedReason"
275
+ },
276
+ "arguments": [],
277
+ "directives": []
278
+ },
279
+ {
280
+ "kind": "Field",
281
+ "name": {
282
+ "kind": "Name",
283
+ "value": "receivedAt"
284
+ },
285
+ "arguments": [],
286
+ "directives": []
287
+ },
288
+ {
289
+ "kind": "Field",
290
+ "name": {
291
+ "kind": "Name",
292
+ "value": "processedAt"
293
+ },
294
+ "arguments": [],
295
+ "directives": []
296
+ },
297
+ {
298
+ "kind": "Field",
299
+ "name": {
300
+ "kind": "Name",
301
+ "value": "duration"
302
+ },
303
+ "arguments": [],
304
+ "directives": []
305
+ }
306
+ ]
307
+ }
308
+ }]
309
+ };
310
+
311
+ // src/generated/documents/wspace/WebhookDeliveriesDocument.ts
312
+ const WebhookDeliveriesDocument = {
313
+ "kind": "Document",
314
+ "definitions": [{
315
+ "kind": "OperationDefinition",
316
+ "operation": "query",
317
+ "name": {
318
+ "kind": "Name",
319
+ "value": "WebhookDeliveries"
320
+ },
321
+ "variableDefinitions": [
322
+ {
323
+ "kind": "VariableDefinition",
324
+ "variable": {
325
+ "kind": "Variable",
326
+ "name": {
327
+ "kind": "Name",
328
+ "value": "eventRegistrationId"
329
+ }
330
+ },
331
+ "type": {
332
+ "kind": "NamedType",
333
+ "name": {
334
+ "kind": "Name",
335
+ "value": "String"
336
+ }
337
+ },
338
+ "directives": []
339
+ },
340
+ {
341
+ "kind": "VariableDefinition",
342
+ "variable": {
343
+ "kind": "Variable",
344
+ "name": {
345
+ "kind": "Name",
346
+ "value": "validationPassed"
347
+ }
348
+ },
349
+ "type": {
350
+ "kind": "NamedType",
351
+ "name": {
352
+ "kind": "Name",
353
+ "value": "Boolean"
354
+ }
355
+ },
356
+ "directives": []
357
+ },
358
+ {
359
+ "kind": "VariableDefinition",
360
+ "variable": {
361
+ "kind": "Variable",
362
+ "name": {
363
+ "kind": "Name",
364
+ "value": "limit"
365
+ }
366
+ },
367
+ "type": {
368
+ "kind": "NamedType",
369
+ "name": {
370
+ "kind": "Name",
371
+ "value": "Int"
372
+ }
373
+ },
374
+ "directives": []
375
+ },
376
+ {
377
+ "kind": "VariableDefinition",
378
+ "variable": {
379
+ "kind": "Variable",
380
+ "name": {
381
+ "kind": "Name",
382
+ "value": "offset"
383
+ }
384
+ },
385
+ "type": {
386
+ "kind": "NamedType",
387
+ "name": {
388
+ "kind": "Name",
389
+ "value": "Int"
390
+ }
391
+ },
392
+ "directives": []
393
+ }
394
+ ],
395
+ "directives": [],
396
+ "selectionSet": {
397
+ "kind": "SelectionSet",
398
+ "selections": [{
399
+ "kind": "Field",
400
+ "name": {
401
+ "kind": "Name",
402
+ "value": "allWebhookDeliveries"
403
+ },
404
+ "arguments": [
405
+ {
406
+ "kind": "Argument",
407
+ "name": {
408
+ "kind": "Name",
409
+ "value": "eventRegistrationId"
410
+ },
411
+ "value": {
412
+ "kind": "Variable",
413
+ "name": {
414
+ "kind": "Name",
415
+ "value": "eventRegistrationId"
416
+ }
417
+ }
418
+ },
419
+ {
420
+ "kind": "Argument",
421
+ "name": {
422
+ "kind": "Name",
423
+ "value": "validationPassed"
424
+ },
425
+ "value": {
426
+ "kind": "Variable",
427
+ "name": {
428
+ "kind": "Name",
429
+ "value": "validationPassed"
430
+ }
431
+ }
432
+ },
433
+ {
434
+ "kind": "Argument",
435
+ "name": {
436
+ "kind": "Name",
437
+ "value": "limit"
438
+ },
439
+ "value": {
440
+ "kind": "Variable",
441
+ "name": {
442
+ "kind": "Name",
443
+ "value": "limit"
444
+ }
445
+ }
446
+ },
447
+ {
448
+ "kind": "Argument",
449
+ "name": {
450
+ "kind": "Name",
451
+ "value": "offset"
452
+ },
453
+ "value": {
454
+ "kind": "Variable",
455
+ "name": {
456
+ "kind": "Name",
457
+ "value": "offset"
458
+ }
459
+ }
460
+ }
461
+ ],
462
+ "directives": [],
463
+ "selectionSet": {
464
+ "kind": "SelectionSet",
465
+ "selections": [{
466
+ "kind": "FragmentSpread",
467
+ "name": {
468
+ "kind": "Name",
469
+ "value": "WebhookDeliveryFields"
470
+ },
471
+ "directives": []
472
+ }]
473
+ }
474
+ }]
475
+ }
476
+ }, {
477
+ "kind": "FragmentDefinition",
478
+ "name": {
479
+ "kind": "Name",
480
+ "value": "WebhookDeliveryFields"
481
+ },
482
+ "variableDefinitions": [],
483
+ "typeCondition": {
484
+ "kind": "NamedType",
485
+ "name": {
486
+ "kind": "Name",
487
+ "value": "WebhookDeliveryLog"
488
+ }
489
+ },
490
+ "directives": [],
491
+ "selectionSet": {
492
+ "kind": "SelectionSet",
493
+ "selections": [
494
+ {
495
+ "kind": "Field",
496
+ "name": {
497
+ "kind": "Name",
498
+ "value": "id"
499
+ },
500
+ "arguments": [],
501
+ "directives": []
502
+ },
503
+ {
504
+ "kind": "Field",
505
+ "name": {
506
+ "kind": "Name",
507
+ "value": "eventRegistrationId"
508
+ },
509
+ "arguments": [],
510
+ "directives": []
511
+ },
512
+ {
513
+ "kind": "Field",
514
+ "name": {
515
+ "kind": "Name",
516
+ "value": "requestHeaders"
517
+ },
518
+ "arguments": [],
519
+ "directives": []
520
+ },
521
+ {
522
+ "kind": "Field",
523
+ "name": {
524
+ "kind": "Name",
525
+ "value": "requestBody"
526
+ },
527
+ "arguments": [],
528
+ "directives": []
529
+ },
530
+ {
531
+ "kind": "Field",
532
+ "name": {
533
+ "kind": "Name",
534
+ "value": "requestIp"
535
+ },
536
+ "arguments": [],
537
+ "directives": []
538
+ },
539
+ {
540
+ "kind": "Field",
541
+ "name": {
542
+ "kind": "Name",
543
+ "value": "validationPassed"
544
+ },
545
+ "arguments": [],
546
+ "directives": []
547
+ },
548
+ {
549
+ "kind": "Field",
550
+ "name": {
551
+ "kind": "Name",
552
+ "value": "validationError"
553
+ },
554
+ "arguments": [],
555
+ "directives": []
556
+ },
557
+ {
558
+ "kind": "Field",
559
+ "name": {
560
+ "kind": "Name",
561
+ "value": "workflowRunId"
562
+ },
563
+ "arguments": [],
564
+ "directives": []
565
+ },
566
+ {
567
+ "kind": "Field",
568
+ "name": {
569
+ "kind": "Name",
570
+ "value": "executionStarted"
571
+ },
572
+ "arguments": [],
573
+ "directives": []
574
+ },
575
+ {
576
+ "kind": "Field",
577
+ "name": {
578
+ "kind": "Name",
579
+ "value": "executionError"
580
+ },
581
+ "arguments": [],
582
+ "directives": []
583
+ },
584
+ {
585
+ "kind": "Field",
586
+ "name": {
587
+ "kind": "Name",
588
+ "value": "responseStatus"
589
+ },
590
+ "arguments": [],
591
+ "directives": []
592
+ },
593
+ {
594
+ "kind": "Field",
595
+ "name": {
596
+ "kind": "Name",
597
+ "value": "responseBody"
598
+ },
599
+ "arguments": [],
600
+ "directives": []
601
+ },
602
+ {
603
+ "kind": "Field",
604
+ "name": {
605
+ "kind": "Name",
606
+ "value": "attemptCount"
607
+ },
608
+ "arguments": [],
609
+ "directives": []
610
+ },
611
+ {
612
+ "kind": "Field",
613
+ "name": {
614
+ "kind": "Name",
615
+ "value": "nextRetryTime"
616
+ },
617
+ "arguments": [],
618
+ "directives": []
619
+ },
620
+ {
621
+ "kind": "Field",
622
+ "name": {
623
+ "kind": "Name",
624
+ "value": "retryable"
625
+ },
626
+ "arguments": [],
627
+ "directives": []
628
+ },
629
+ {
630
+ "kind": "Field",
631
+ "name": {
632
+ "kind": "Name",
633
+ "value": "retryBlockedReason"
634
+ },
635
+ "arguments": [],
636
+ "directives": []
637
+ },
638
+ {
639
+ "kind": "Field",
640
+ "name": {
641
+ "kind": "Name",
642
+ "value": "receivedAt"
643
+ },
644
+ "arguments": [],
645
+ "directives": []
646
+ },
647
+ {
648
+ "kind": "Field",
649
+ "name": {
650
+ "kind": "Name",
651
+ "value": "processedAt"
652
+ },
653
+ "arguments": [],
654
+ "directives": []
655
+ },
656
+ {
657
+ "kind": "Field",
658
+ "name": {
659
+ "kind": "Name",
660
+ "value": "duration"
661
+ },
662
+ "arguments": [],
663
+ "directives": []
664
+ }
665
+ ]
666
+ }
667
+ }]
668
+ };
669
+
670
+ // src/generated/documents/wspace/WebhookDeliveryRegistrationsDocument.ts
671
+ const WebhookDeliveryRegistrationsDocument = {
672
+ "kind": "Document",
673
+ "definitions": [{
674
+ "kind": "OperationDefinition",
675
+ "operation": "query",
676
+ "name": {
677
+ "kind": "Name",
678
+ "value": "WebhookDeliveryRegistrations"
679
+ },
680
+ "variableDefinitions": [],
681
+ "directives": [],
682
+ "selectionSet": {
683
+ "kind": "SelectionSet",
684
+ "selections": [{
685
+ "kind": "Field",
686
+ "name": {
687
+ "kind": "Name",
688
+ "value": "eventRegistrations"
689
+ },
690
+ "arguments": [],
691
+ "directives": [],
692
+ "selectionSet": {
693
+ "kind": "SelectionSet",
694
+ "selections": [
695
+ {
696
+ "kind": "Field",
697
+ "name": {
698
+ "kind": "Name",
699
+ "value": "id"
700
+ },
701
+ "arguments": [],
702
+ "directives": []
703
+ },
704
+ {
705
+ "kind": "Field",
706
+ "name": {
707
+ "kind": "Name",
708
+ "value": "name"
709
+ },
710
+ "arguments": [],
711
+ "directives": []
712
+ },
713
+ {
714
+ "kind": "Field",
715
+ "name": {
716
+ "kind": "Name",
717
+ "value": "eventSource"
718
+ },
719
+ "arguments": [],
720
+ "directives": []
721
+ },
722
+ {
723
+ "kind": "Field",
724
+ "name": {
725
+ "kind": "Name",
726
+ "value": "eventType"
727
+ },
728
+ "arguments": [],
729
+ "directives": []
730
+ },
731
+ {
732
+ "kind": "Field",
733
+ "name": {
734
+ "kind": "Name",
735
+ "value": "workflowKey"
736
+ },
737
+ "arguments": [],
738
+ "directives": []
739
+ },
740
+ {
741
+ "kind": "Field",
742
+ "name": {
743
+ "kind": "Name",
744
+ "value": "triggerNodeId"
745
+ },
746
+ "arguments": [],
747
+ "directives": []
748
+ },
749
+ {
750
+ "kind": "Field",
751
+ "name": {
752
+ "kind": "Name",
753
+ "value": "isActive"
754
+ },
755
+ "arguments": [],
756
+ "directives": []
757
+ },
758
+ {
759
+ "kind": "Field",
760
+ "name": {
761
+ "kind": "Name",
762
+ "value": "status"
763
+ },
764
+ "arguments": [],
765
+ "directives": []
766
+ },
767
+ {
768
+ "kind": "Field",
769
+ "name": {
770
+ "kind": "Name",
771
+ "value": "validationMethod"
772
+ },
773
+ "arguments": [],
774
+ "directives": []
775
+ },
776
+ {
777
+ "kind": "Field",
778
+ "name": {
779
+ "kind": "Name",
780
+ "value": "webhookUrl"
781
+ },
782
+ "arguments": [],
783
+ "directives": []
784
+ },
785
+ {
786
+ "kind": "Field",
787
+ "name": {
788
+ "kind": "Name",
789
+ "value": "totalTriggers"
790
+ },
791
+ "arguments": [],
792
+ "directives": []
793
+ },
794
+ {
795
+ "kind": "Field",
796
+ "name": {
797
+ "kind": "Name",
798
+ "value": "successfulTriggers"
799
+ },
800
+ "arguments": [],
801
+ "directives": []
802
+ },
803
+ {
804
+ "kind": "Field",
805
+ "name": {
806
+ "kind": "Name",
807
+ "value": "failedTriggers"
808
+ },
809
+ "arguments": [],
810
+ "directives": []
811
+ },
812
+ {
813
+ "kind": "Field",
814
+ "name": {
815
+ "kind": "Name",
816
+ "value": "lastTriggeredAt"
817
+ },
818
+ "arguments": [],
819
+ "directives": []
820
+ }
821
+ ]
822
+ }
823
+ }]
824
+ }
825
+ }]
826
+ };
827
+
828
+ // src/modules/webhook-deliveries/components/DeliveryParts.tsx
829
+ /**
830
+ * Webhook delivery logs (BOFF-4072): the presentational pieces of the
831
+ * deliveries page — the outcome badge, the deliveries table, the delivery
832
+ * detail drawer body and the selected trigger's summary.
833
+ */
834
+ function outcomeLabel(tr, outcome) {
835
+ switch (outcome) {
836
+ case "STARTED": return tr("fluidgrids.webhookDeliveries.outcome.started", "Run started");
837
+ case "VALIDATION_FAILED": return tr("fluidgrids.webhookDeliveries.outcome.validationFailed", "Validation failed");
838
+ case "FILTERED": return tr("fluidgrids.webhookDeliveries.outcome.filtered", "Filtered");
839
+ case "FAILED": return tr("fluidgrids.webhookDeliveries.outcome.failed", "Run not started");
840
+ default: return tr("fluidgrids.webhookDeliveries.outcome.pending", "Processing");
841
+ }
842
+ }
843
+ function DeliveryOutcomeBadge({ delivery }) {
844
+ const tr = useTr();
845
+ const outcome = deliveryOutcome(delivery);
846
+ return /* @__PURE__ */ jsx("span", {
847
+ className: cn("inline-flex items-center rounded-full border px-2 py-0.5 text-xs font-medium", outcomeTone(outcome)),
848
+ "data-testid": "webhook-delivery-outcome",
849
+ "data-outcome": outcome,
850
+ children: outcomeLabel(tr, outcome)
851
+ });
852
+ }
853
+ /** The Retry action, shown only where the service will replay the delivery. */
854
+ function RetryDeliveryButton({ delivery, retrying, onRetry, size = "sm" }) {
855
+ const tr = useTr();
856
+ if (!delivery.retryable) return null;
857
+ const busy = retrying === delivery.id;
858
+ return /* @__PURE__ */ jsx(SdkPermissionButton, {
859
+ permission: FLUIDGRIDS_PERMISSIONS.WEBHOOK_DELIVERY_EXECUTE,
860
+ deniedTooltip: tr("fluidgrids.webhookDeliveries.retryDeniedTooltip", "You don't have permission to retry webhook deliveries"),
861
+ deniedTooltipClassName: "z-[130]",
862
+ children: /* @__PURE__ */ jsxs(Button$1, {
863
+ variant: "outline",
864
+ size,
865
+ disabled: retrying !== null,
866
+ onClick: (event) => {
867
+ event.stopPropagation();
868
+ onRetry(delivery);
869
+ },
870
+ "data-testid": "webhook-delivery-retry",
871
+ children: [busy ? /* @__PURE__ */ jsx(CompactMarkOr, {
872
+ today: /* @__PURE__ */ jsx(Icon, {
873
+ icon: "lucide:loader-2",
874
+ className: cn("mr-1 h-4 w-4", busy && "animate-spin")
875
+ }),
876
+ className: "mr-1 size-4"
877
+ }) : /* @__PURE__ */ jsx(Icon, {
878
+ icon: "lucide:rotate-ccw",
879
+ className: cn("mr-1 h-4 w-4", busy && "animate-spin")
880
+ }), tr("fluidgrids.webhookDeliveries.retry", "Retry")]
881
+ })
882
+ });
883
+ }
884
+ function RunLink({ runId }) {
885
+ if (!runId) return /* @__PURE__ */ jsx("span", {
886
+ className: "text-text-secondary",
887
+ children: "—"
888
+ });
889
+ return /* @__PURE__ */ jsx(Link, {
890
+ to: `../runs/${encodeURIComponent(runId)}`,
891
+ className: "font-mono text-xs text-primary hover:underline",
892
+ onClick: (event) => event.stopPropagation(),
893
+ "data-testid": "webhook-delivery-run-link",
894
+ children: runId.slice(0, 8)
895
+ });
896
+ }
897
+ function DeliveriesTable({ deliveries, registrationsById, loading, selectedId, retrying, onSelect, onRetry, filtered = false }) {
898
+ const tr = useTr();
899
+ return /* @__PURE__ */ jsxs(Table, {
900
+ "data-testid": "webhook-deliveries-table",
901
+ children: [/* @__PURE__ */ jsx(TableHeader, { children: /* @__PURE__ */ jsxs(TableRow, { children: [
902
+ /* @__PURE__ */ jsx(TableHead, { children: tr("fluidgrids.webhookDeliveries.col.received", "Received") }),
903
+ /* @__PURE__ */ jsx(TableHead, { children: tr("fluidgrids.webhookDeliveries.col.trigger", "Trigger") }),
904
+ /* @__PURE__ */ jsx(TableHead, { children: tr("fluidgrids.webhookDeliveries.col.sourceIp", "Source IP") }),
905
+ /* @__PURE__ */ jsx(TableHead, { children: tr("fluidgrids.webhookDeliveries.col.result", "Result") }),
906
+ /* @__PURE__ */ jsx(TableHead, { children: tr("fluidgrids.webhookDeliveries.col.run", "Run") }),
907
+ /* @__PURE__ */ jsx(TableHead, { children: tr("fluidgrids.webhookDeliveries.col.status", "HTTP") }),
908
+ /* @__PURE__ */ jsx(TableHead, { children: tr("fluidgrids.webhookDeliveries.col.size", "Size") }),
909
+ /* @__PURE__ */ jsx(TableHead, { children: tr("fluidgrids.webhookDeliveries.col.duration", "Duration") }),
910
+ /* @__PURE__ */ jsx(TableHead, {
911
+ className: "text-right",
912
+ children: tr("fluidgrids.webhookDeliveries.col.actions", "Actions")
913
+ })
914
+ ] }) }), /* @__PURE__ */ jsxs(TableBody, { children: [deliveries.map((delivery) => /* @__PURE__ */ jsxs(TableRow, {
915
+ "data-testid": "webhook-delivery-row",
916
+ "data-delivery-id": delivery.id,
917
+ "data-state": selectedId === delivery.id ? "selected" : void 0,
918
+ className: "cursor-pointer",
919
+ tabIndex: 0,
920
+ onClick: () => onSelect(delivery),
921
+ onKeyDown: (event) => {
922
+ if (event.key === "Enter" || event.key === " ") {
923
+ event.preventDefault();
924
+ onSelect(delivery);
925
+ }
926
+ },
927
+ children: [
928
+ /* @__PURE__ */ jsx(TableCell, {
929
+ className: "whitespace-nowrap text-sm text-text-primary",
930
+ children: formatReceivedAt(delivery.receivedAt)
931
+ }),
932
+ /* @__PURE__ */ jsx(TableCell, {
933
+ className: "text-sm text-text-secondary",
934
+ children: registrationLabel(registrationsById.get(delivery.eventRegistrationId))
935
+ }),
936
+ /* @__PURE__ */ jsx(TableCell, {
937
+ className: "font-mono text-xs text-text-secondary",
938
+ children: delivery.requestIp || "—"
939
+ }),
940
+ /* @__PURE__ */ jsx(TableCell, { children: /* @__PURE__ */ jsx(DeliveryOutcomeBadge, { delivery }) }),
941
+ /* @__PURE__ */ jsx(TableCell, { children: /* @__PURE__ */ jsx(RunLink, { runId: delivery.workflowRunId }) }),
942
+ /* @__PURE__ */ jsx(TableCell, {
943
+ className: cn("font-mono text-xs", httpStatusTone(delivery.responseStatus)),
944
+ children: delivery.responseStatus ?? "—"
945
+ }),
946
+ /* @__PURE__ */ jsx(TableCell, {
947
+ className: "whitespace-nowrap text-xs text-text-secondary",
948
+ children: formatBytes(payloadBytes(delivery.requestBody))
949
+ }),
950
+ /* @__PURE__ */ jsx(TableCell, {
951
+ className: "whitespace-nowrap text-xs text-text-secondary",
952
+ children: formatDuration(delivery.duration)
953
+ }),
954
+ /* @__PURE__ */ jsx(TableCell, {
955
+ className: "text-right",
956
+ children: /* @__PURE__ */ jsx(RetryDeliveryButton, {
957
+ delivery,
958
+ retrying,
959
+ onRetry
960
+ })
961
+ })
962
+ ]
963
+ }, delivery.id)), !loading && deliveries.length === 0 && /* @__PURE__ */ jsx(TableRow, { children: /* @__PURE__ */ jsx(TableCell, {
964
+ colSpan: 9,
965
+ "data-testid": "webhook-deliveries-empty",
966
+ children: /* @__PURE__ */ jsx(EmptyState, {
967
+ kind: filtered ? "filtered" : "first-use",
968
+ illustration: "connections",
969
+ size: "table",
970
+ compact: true,
971
+ icon: null,
972
+ title: tr("fluidgrids.webhookDeliveries.empty", "No webhook deliveries match these filters yet. Deliveries appear here as soon as a webhook trigger receives a request.")
973
+ })
974
+ }) })] })]
975
+ });
976
+ }
977
+ function DetailSection({ title, children }) {
978
+ return /* @__PURE__ */ jsxs("section", {
979
+ className: "space-y-2",
980
+ children: [/* @__PURE__ */ jsx("h3", {
981
+ className: "text-xs font-semibold uppercase tracking-wide text-text-secondary",
982
+ children: title
983
+ }), children]
984
+ });
985
+ }
986
+ function PayloadBlock({ value, emptyLabel, testId }) {
987
+ const text = prettyPayload(value);
988
+ return text ? /* @__PURE__ */ jsx("pre", {
989
+ className: "max-h-80 overflow-auto whitespace-pre-wrap break-all rounded-md border border-border bg-muted p-3 font-mono text-xs text-text-primary",
990
+ "data-testid": testId,
991
+ children: text
992
+ }) : /* @__PURE__ */ jsx("p", {
993
+ className: "text-sm text-text-secondary",
994
+ "data-testid": testId,
995
+ children: emptyLabel
996
+ });
997
+ }
998
+ function MetaRow({ label, children }) {
999
+ return /* @__PURE__ */ jsxs("div", {
1000
+ className: "grid grid-cols-[9rem_1fr] gap-2 text-sm",
1001
+ children: [/* @__PURE__ */ jsx("dt", {
1002
+ className: "text-text-secondary",
1003
+ children: label
1004
+ }), /* @__PURE__ */ jsx("dd", {
1005
+ className: "min-w-0 break-words text-text-primary",
1006
+ children
1007
+ })]
1008
+ });
1009
+ }
1010
+ /** Everything recorded for one delivery: metadata, request and response. */
1011
+ function DeliveryDetail({ delivery, registration, retrying, onRetry }) {
1012
+ const tr = useTr();
1013
+ const headers = headerEntries(delivery.requestHeaders);
1014
+ const problem = delivery.validationError || delivery.executionError;
1015
+ return /* @__PURE__ */ jsxs("div", {
1016
+ className: "space-y-6",
1017
+ "data-testid": "webhook-delivery-detail",
1018
+ children: [
1019
+ /* @__PURE__ */ jsxs("div", {
1020
+ className: "flex flex-wrap items-center gap-2",
1021
+ children: [
1022
+ /* @__PURE__ */ jsx(DeliveryOutcomeBadge, { delivery }),
1023
+ delivery.responseStatus != null && /* @__PURE__ */ jsxs(Badge, {
1024
+ variant: "outline",
1025
+ className: "font-mono",
1026
+ children: ["HTTP ", delivery.responseStatus]
1027
+ }),
1028
+ /* @__PURE__ */ jsx("div", {
1029
+ className: "ml-auto",
1030
+ children: /* @__PURE__ */ jsx(RetryDeliveryButton, {
1031
+ delivery,
1032
+ retrying,
1033
+ onRetry,
1034
+ size: "default"
1035
+ })
1036
+ })
1037
+ ]
1038
+ }),
1039
+ problem && /* @__PURE__ */ jsx("div", {
1040
+ className: "rounded-md border border-status-error-border bg-status-error-bg-subtle p-3 text-sm text-status-error-text",
1041
+ "data-testid": "webhook-delivery-problem",
1042
+ children: problem
1043
+ }),
1044
+ !delivery.retryable && delivery.retryBlockedReason && /* @__PURE__ */ jsx("p", {
1045
+ className: "text-xs text-text-secondary",
1046
+ "data-testid": "webhook-delivery-retry-blocked",
1047
+ children: delivery.retryBlockedReason
1048
+ }),
1049
+ /* @__PURE__ */ jsx(DetailSection, {
1050
+ title: tr("fluidgrids.webhookDeliveries.detail.metadata", "Metadata"),
1051
+ children: /* @__PURE__ */ jsxs("dl", {
1052
+ className: "space-y-1.5",
1053
+ children: [
1054
+ /* @__PURE__ */ jsx(MetaRow, {
1055
+ label: tr("fluidgrids.webhookDeliveries.detail.deliveryId", "Delivery ID"),
1056
+ children: /* @__PURE__ */ jsx("span", {
1057
+ className: "font-mono text-xs",
1058
+ children: delivery.id
1059
+ })
1060
+ }),
1061
+ /* @__PURE__ */ jsxs(MetaRow, {
1062
+ label: tr("fluidgrids.webhookDeliveries.detail.trigger", "Trigger"),
1063
+ children: [registrationLabel(registration), registration?.workflowKey && /* @__PURE__ */ jsxs("span", {
1064
+ className: "ml-1 font-mono text-xs text-text-secondary",
1065
+ children: [
1066
+ "(",
1067
+ registration.workflowKey,
1068
+ ")"
1069
+ ]
1070
+ })]
1071
+ }),
1072
+ /* @__PURE__ */ jsx(MetaRow, {
1073
+ label: tr("fluidgrids.webhookDeliveries.detail.received", "Received"),
1074
+ children: formatReceivedAt(delivery.receivedAt)
1075
+ }),
1076
+ /* @__PURE__ */ jsx(MetaRow, {
1077
+ label: tr("fluidgrids.webhookDeliveries.detail.processed", "Processed"),
1078
+ children: formatReceivedAt(delivery.processedAt)
1079
+ }),
1080
+ /* @__PURE__ */ jsx(MetaRow, {
1081
+ label: tr("fluidgrids.webhookDeliveries.detail.duration", "Duration"),
1082
+ children: formatDuration(delivery.duration)
1083
+ }),
1084
+ /* @__PURE__ */ jsx(MetaRow, {
1085
+ label: tr("fluidgrids.webhookDeliveries.detail.sourceIp", "Source IP"),
1086
+ children: /* @__PURE__ */ jsx("span", {
1087
+ className: "font-mono text-xs",
1088
+ children: delivery.requestIp || "—"
1089
+ })
1090
+ }),
1091
+ /* @__PURE__ */ jsx(MetaRow, {
1092
+ label: tr("fluidgrids.webhookDeliveries.detail.size", "Body size"),
1093
+ children: formatBytes(payloadBytes(delivery.requestBody))
1094
+ }),
1095
+ /* @__PURE__ */ jsx(MetaRow, {
1096
+ label: tr("fluidgrids.webhookDeliveries.detail.run", "Run"),
1097
+ children: /* @__PURE__ */ jsx(RunLink, { runId: delivery.workflowRunId })
1098
+ }),
1099
+ /* @__PURE__ */ jsxs(MetaRow, {
1100
+ label: tr("fluidgrids.webhookDeliveries.detail.attempts", "Retries"),
1101
+ children: [delivery.attemptCount, delivery.nextRetryTime && /* @__PURE__ */ jsx("span", {
1102
+ className: "ml-1 text-xs text-text-secondary",
1103
+ children: tr("fluidgrids.webhookDeliveries.detail.nextRetry", "next at {{time}}", { time: formatReceivedAt(delivery.nextRetryTime) })
1104
+ })]
1105
+ })
1106
+ ]
1107
+ })
1108
+ }),
1109
+ /* @__PURE__ */ jsx(DetailSection, {
1110
+ title: tr("fluidgrids.webhookDeliveries.detail.requestHeaders", "Request headers"),
1111
+ children: headers.length > 0 ? /* @__PURE__ */ jsx("dl", {
1112
+ className: "space-y-1 rounded-md border border-border bg-muted p-3 font-mono text-xs",
1113
+ "data-testid": "webhook-delivery-headers",
1114
+ children: headers.map(([name, value]) => /* @__PURE__ */ jsxs("div", {
1115
+ className: "grid grid-cols-[12rem_1fr] gap-2",
1116
+ children: [/* @__PURE__ */ jsx("dt", {
1117
+ className: "truncate text-text-secondary",
1118
+ children: name
1119
+ }), /* @__PURE__ */ jsx("dd", {
1120
+ className: "break-all text-text-primary",
1121
+ children: value
1122
+ })]
1123
+ }, name))
1124
+ }) : /* @__PURE__ */ jsx("p", {
1125
+ className: "text-sm text-text-secondary",
1126
+ children: tr("fluidgrids.webhookDeliveries.detail.noHeaders", "No headers recorded")
1127
+ })
1128
+ }),
1129
+ /* @__PURE__ */ jsx(DetailSection, {
1130
+ title: tr("fluidgrids.webhookDeliveries.detail.requestBody", "Request body"),
1131
+ children: /* @__PURE__ */ jsx(PayloadBlock, {
1132
+ value: delivery.requestBody,
1133
+ emptyLabel: tr("fluidgrids.webhookDeliveries.detail.emptyBody", "Empty body"),
1134
+ testId: "webhook-delivery-request-body"
1135
+ })
1136
+ }),
1137
+ /* @__PURE__ */ jsx(DetailSection, {
1138
+ title: tr("fluidgrids.webhookDeliveries.detail.responseBody", "Response body"),
1139
+ children: /* @__PURE__ */ jsx(PayloadBlock, {
1140
+ value: delivery.responseBody,
1141
+ emptyLabel: tr("fluidgrids.webhookDeliveries.detail.noResponseBody", "No response body recorded"),
1142
+ testId: "webhook-delivery-response-body"
1143
+ })
1144
+ })
1145
+ ]
1146
+ });
1147
+ }
1148
+ /** The selected trigger: its URL (with copy), validation method and counts. */
1149
+ function TriggerSummary({ registration }) {
1150
+ const tr = useTr();
1151
+ const url = registration.webhookUrl;
1152
+ const copy = useCallback(async () => {
1153
+ if (!url) return;
1154
+ try {
1155
+ await navigator.clipboard.writeText(url);
1156
+ toast.success(tr("fluidgrids.webhookDeliveries.urlCopied", "Webhook URL copied"));
1157
+ } catch {
1158
+ toast.error(tr("fluidgrids.webhookDeliveries.copyFailed", "Could not copy — select the URL and copy it manually"));
1159
+ }
1160
+ }, [tr, url]);
1161
+ return /* @__PURE__ */ jsxs("div", {
1162
+ className: "space-y-3",
1163
+ "data-testid": "webhook-trigger-summary",
1164
+ children: [
1165
+ /* @__PURE__ */ jsxs("div", {
1166
+ className: "flex flex-wrap items-center gap-2",
1167
+ children: [
1168
+ /* @__PURE__ */ jsx("span", {
1169
+ className: "text-sm font-medium text-text-primary",
1170
+ children: registrationLabel(registration)
1171
+ }),
1172
+ /* @__PURE__ */ jsx(Badge, {
1173
+ variant: "outline",
1174
+ children: registration.validationMethod
1175
+ }),
1176
+ /* @__PURE__ */ jsx(Badge, {
1177
+ variant: registration.isActive ? "default" : "secondary",
1178
+ children: registration.isActive ? tr("fluidgrids.webhookDeliveries.active", "Active") : tr("fluidgrids.webhookDeliveries.inactive", "Inactive")
1179
+ }),
1180
+ /* @__PURE__ */ jsx("span", {
1181
+ className: "font-mono text-xs text-text-secondary",
1182
+ children: registration.workflowKey
1183
+ })
1184
+ ]
1185
+ }),
1186
+ url && /* @__PURE__ */ jsxs("div", {
1187
+ className: "flex items-stretch gap-2",
1188
+ children: [/* @__PURE__ */ jsx("input", {
1189
+ readOnly: true,
1190
+ value: url,
1191
+ onFocus: (event) => event.currentTarget.select(),
1192
+ className: "min-w-0 flex-1 rounded-md border border-border bg-muted px-3 py-2 font-mono text-xs text-text-primary outline-none focus:border-primary",
1193
+ "data-testid": "webhook-trigger-url",
1194
+ "aria-label": tr("fluidgrids.webhookDeliveries.webhookUrl", "Webhook URL")
1195
+ }), /* @__PURE__ */ jsxs(Button$1, {
1196
+ variant: "outline",
1197
+ size: "sm",
1198
+ onClick: () => void copy(),
1199
+ "data-testid": "webhook-trigger-url-copy",
1200
+ children: [/* @__PURE__ */ jsx(Icon, {
1201
+ icon: "lucide:copy",
1202
+ className: "mr-1 h-4 w-4"
1203
+ }), tr("fluidgrids.webhookDeliveries.copy", "Copy")]
1204
+ })]
1205
+ }),
1206
+ /* @__PURE__ */ jsx("p", {
1207
+ className: "text-xs text-text-secondary",
1208
+ "data-testid": "webhook-trigger-stats",
1209
+ children: tr("fluidgrids.webhookDeliveries.stats", "{{total}} received · {{ok}} started a run · {{failed}} failed", {
1210
+ total: registration.totalTriggers,
1211
+ ok: registration.successfulTriggers,
1212
+ failed: registration.failedTriggers
1213
+ })
1214
+ })
1215
+ ]
1216
+ });
1217
+ }
1218
+
1219
+ // src/modules/webhook-deliveries/hooks/useWebhookDeliveries.ts
1220
+ /**
1221
+ * Webhook delivery logs (BOFF-4072): the deliveries of the current workspace,
1222
+ * the webhook triggers they belong to, and the per-delivery retry.
1223
+ *
1224
+ * Uses the shared FluidGrids Apollo client directly (the runners/variables hook
1225
+ * pattern) with the generated operation documents.
1226
+ */
1227
+ function asError(error) {
1228
+ return error instanceof Error ? error : new Error(String(error));
1229
+ }
1230
+ /**
1231
+ * One page of deliveries, newest first. One extra row is requested to learn
1232
+ * whether a next page exists without a count query.
1233
+ */
1234
+ function useWebhookDeliveries(query) {
1235
+ const { eventRegistrationId, validation, page } = query;
1236
+ const [deliveries, setDeliveries] = useState([]);
1237
+ const [hasMore, setHasMore] = useState(false);
1238
+ const [loading, setLoading] = useState(true);
1239
+ const [error, setError] = useState(null);
1240
+ const requestId = useRef(0);
1241
+ const refetch = useCallback(async () => {
1242
+ const current = ++requestId.current;
1243
+ setLoading(true);
1244
+ try {
1245
+ const result = throwIfResultError(await getFluidGridsClient().query({
1246
+ query: WebhookDeliveriesDocument,
1247
+ variables: {
1248
+ eventRegistrationId: eventRegistrationId || void 0,
1249
+ validationPassed: validationPassedArg(validation),
1250
+ limit: 50 + 1,
1251
+ offset: page * 50
1252
+ },
1253
+ fetchPolicy: "network-only"
1254
+ }));
1255
+ if (current !== requestId.current) return;
1256
+ const rows = result.data?.allWebhookDeliveries ?? [];
1257
+ setDeliveries(rows.slice(0, 50));
1258
+ setHasMore(rows.length > 50);
1259
+ setError(null);
1260
+ } catch (err) {
1261
+ if (current === requestId.current) setError(asError(err));
1262
+ } finally {
1263
+ if (current === requestId.current) setLoading(false);
1264
+ }
1265
+ }, [
1266
+ eventRegistrationId,
1267
+ validation,
1268
+ page
1269
+ ]);
1270
+ useEffect(() => {
1271
+ const requests = requestId;
1272
+ refetch();
1273
+ return () => {
1274
+ requests.current++;
1275
+ };
1276
+ }, [refetch]);
1277
+ return {
1278
+ deliveries,
1279
+ hasMore,
1280
+ loading,
1281
+ error,
1282
+ refetch,
1283
+ replace: useCallback((delivery) => {
1284
+ setDeliveries((rows) => rows.map((row) => row.id === delivery.id ? delivery : row));
1285
+ }, [])
1286
+ };
1287
+ }
1288
+ /** The workspace's webhook triggers, for the trigger filter and row labels. */
1289
+ function useWebhookDeliveryRegistrations() {
1290
+ const [state, setState] = useState({
1291
+ registrations: [],
1292
+ loading: true,
1293
+ error: null
1294
+ });
1295
+ useEffect(() => {
1296
+ let active = true;
1297
+ (async () => {
1298
+ try {
1299
+ const result = throwIfResultError(await getFluidGridsClient().query({
1300
+ query: WebhookDeliveryRegistrationsDocument,
1301
+ fetchPolicy: "network-only"
1302
+ }));
1303
+ if (active) setState({
1304
+ registrations: result.data?.eventRegistrations ?? [],
1305
+ loading: false,
1306
+ error: null
1307
+ });
1308
+ } catch (err) {
1309
+ if (active) setState({
1310
+ registrations: [],
1311
+ loading: false,
1312
+ error: asError(err)
1313
+ });
1314
+ }
1315
+ })();
1316
+ return () => {
1317
+ active = false;
1318
+ };
1319
+ }, []);
1320
+ return state;
1321
+ }
1322
+ /** Retry one delivery; `retrying` holds the id of the delivery in flight. */
1323
+ function useRetryWebhookDelivery() {
1324
+ const [retrying, setRetrying] = useState(null);
1325
+ return {
1326
+ retry: useCallback(async (deliveryId) => {
1327
+ setRetrying(deliveryId);
1328
+ try {
1329
+ const reply = throwIfResultError(await getFluidGridsClient().mutate({
1330
+ mutation: RetryWebhookDeliveryDocument,
1331
+ variables: { deliveryId }
1332
+ })).data?.retryWebhookDelivery;
1333
+ if (!reply) throw new Error("No retry result returned");
1334
+ return {
1335
+ success: reply.success,
1336
+ message: reply.message ?? "",
1337
+ delivery: reply.delivery ?? null
1338
+ };
1339
+ } finally {
1340
+ setRetrying(null);
1341
+ }
1342
+ }, []),
1343
+ retrying
1344
+ };
1345
+ }
1346
+
1347
+ // src/modules/webhook-deliveries/pages/WebhookDeliveriesPage.tsx
1348
+ /**
1349
+ * Webhook Deliveries Page (BOFF-4072).
1350
+ *
1351
+ * Every request a webhook trigger received in this workspace, newest first:
1352
+ * when it arrived, from where, whether it passed validation, which run it
1353
+ * started, what the sender got back, its size and how long it took. Filter by
1354
+ * trigger and by validation result; open a delivery to see its headers and
1355
+ * payloads; retry a delivery that passed validation but could not start its
1356
+ * run. A delivery that failed validation, was filtered, or already started a
1357
+ * run is never replayed (the service refuses it and says why).
1358
+ *
1359
+ * The filters live in the URL (`?registration=<id>&validation=failed&page=1`)
1360
+ * so the builder's webhook trigger can link straight to its own deliveries.
1361
+ */
1362
+ var WebhookDeliveriesPage_exports = /* @__PURE__ */ __exportAll({ WebhookDeliveriesPage: () => WebhookDeliveriesPage });
1363
+ const ALL_TRIGGERS = "all";
1364
+ function parsePage(value) {
1365
+ const page = Number.parseInt(value ?? "", 10);
1366
+ return Number.isFinite(page) && page > 0 ? page : 0;
1367
+ }
1368
+ function WebhookDeliveriesPage() {
1369
+ const tr = useTr();
1370
+ const [params, setParams] = useSearchParams();
1371
+ const registrationId = params.get("registration") || null;
1372
+ const validation = parseValidationFilter(params.get("validation"));
1373
+ const page = parsePage(params.get("page"));
1374
+ const { registrations, error: registrationsError } = useWebhookDeliveryRegistrations();
1375
+ const registrationsById = useMemo(() => new Map(registrations.map((r) => [r.id, r])), [registrations]);
1376
+ const { deliveries, hasMore, loading, error, refetch, replace } = useWebhookDeliveries({
1377
+ eventRegistrationId: registrationId,
1378
+ validation,
1379
+ page
1380
+ });
1381
+ const { retry, retrying } = useRetryWebhookDelivery();
1382
+ const [selectedId, setSelectedId] = useState(null);
1383
+ const selected = deliveries.find((d) => d.id === selectedId) ?? null;
1384
+ const selectedRegistration = registrationId ? registrationsById.get(registrationId) : void 0;
1385
+ const updateParams = useCallback((changes) => {
1386
+ setParams((current) => {
1387
+ const next = new URLSearchParams(current);
1388
+ for (const [key, value] of Object.entries(changes)) if (value === null) next.delete(key);
1389
+ else next.set(key, value);
1390
+ return next;
1391
+ }, { replace: true });
1392
+ }, [setParams]);
1393
+ const validationLabel = (filter) => {
1394
+ if (filter === "passed") return tr("fluidgrids.webhookDeliveries.validation.passed", "Passed");
1395
+ if (filter === "failed") return tr("fluidgrids.webhookDeliveries.validation.failed", "Failed");
1396
+ return tr("fluidgrids.webhookDeliveries.validation.all", "All results");
1397
+ };
1398
+ const handleRetry = useCallback(async (delivery) => {
1399
+ try {
1400
+ const result = await retry(delivery.id);
1401
+ if (result.delivery) replace(result.delivery);
1402
+ if (result.success) toast.success(tr("fluidgrids.webhookDeliveries.retried", "Delivery retried"), { description: result.message });
1403
+ else toast.error(tr("fluidgrids.webhookDeliveries.retryRefused", "The delivery was not retried"), { description: result.message });
1404
+ } catch (err) {
1405
+ toast.error(err instanceof Error ? err.message : tr("fluidgrids.webhookDeliveries.retryFailed", "Could not retry the delivery"));
1406
+ }
1407
+ }, [
1408
+ replace,
1409
+ retry,
1410
+ tr
1411
+ ]);
1412
+ return /* @__PURE__ */ jsxs("div", {
1413
+ className: "space-y-6 p-6",
1414
+ "data-testid": "webhook-deliveries-page",
1415
+ children: [
1416
+ /* @__PURE__ */ jsxs("div", {
1417
+ className: "flex flex-wrap items-start justify-between gap-4",
1418
+ children: [/* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("h1", {
1419
+ className: "text-2xl font-semibold text-text-primary",
1420
+ children: tr("fluidgrids.webhookDeliveries.title", "Webhook deliveries")
1421
+ }), /* @__PURE__ */ jsx("p", {
1422
+ className: "mt-1 max-w-2xl text-sm text-text-secondary",
1423
+ children: tr("fluidgrids.webhookDeliveries.subtitle", "Every request your webhook triggers received: whether it passed validation, the run it started and what the sender got back. Open a delivery to inspect its payload, or retry one that could not start its run.")
1424
+ })] }), /* @__PURE__ */ jsxs(Button$1, {
1425
+ variant: "outline",
1426
+ onClick: () => void refetch(),
1427
+ disabled: loading,
1428
+ "data-testid": "webhook-deliveries-refresh",
1429
+ children: [/* @__PURE__ */ jsx(Icon, {
1430
+ icon: "lucide:refresh-cw",
1431
+ className: loading ? "mr-1 h-4 w-4 animate-spin" : "mr-1 h-4 w-4"
1432
+ }), tr("fluidgrids.webhookDeliveries.refresh", "Refresh")]
1433
+ })]
1434
+ }),
1435
+ /* @__PURE__ */ jsxs("div", {
1436
+ className: "flex flex-wrap items-end gap-4",
1437
+ children: [/* @__PURE__ */ jsxs("div", {
1438
+ className: "space-y-1.5",
1439
+ children: [/* @__PURE__ */ jsx(Label, {
1440
+ htmlFor: "webhook-deliveries-trigger",
1441
+ children: tr("fluidgrids.webhookDeliveries.filter.trigger", "Trigger")
1442
+ }), /* @__PURE__ */ jsxs(Select, {
1443
+ value: registrationId ?? ALL_TRIGGERS,
1444
+ onValueChange: (value) => updateParams({
1445
+ registration: value === ALL_TRIGGERS ? null : value,
1446
+ page: null
1447
+ }),
1448
+ children: [/* @__PURE__ */ jsx(SelectTrigger, {
1449
+ id: "webhook-deliveries-trigger",
1450
+ className: "w-72",
1451
+ "data-testid": "webhook-deliveries-trigger-filter",
1452
+ children: /* @__PURE__ */ jsx(SelectValue, {})
1453
+ }), /* @__PURE__ */ jsxs(SelectContent, { children: [
1454
+ /* @__PURE__ */ jsx(SelectItem, {
1455
+ value: ALL_TRIGGERS,
1456
+ children: tr("fluidgrids.webhookDeliveries.filter.allTriggers", "All webhook triggers")
1457
+ }),
1458
+ registrations.map((registration) => /* @__PURE__ */ jsxs(SelectItem, {
1459
+ value: registration.id,
1460
+ children: [registrationLabel(registration), registration.workflowKey ? ` · ${registration.workflowKey}` : ""]
1461
+ }, registration.id)),
1462
+ registrationId && !registrationsById.has(registrationId) && /* @__PURE__ */ jsx(SelectItem, {
1463
+ value: registrationId,
1464
+ children: tr("fluidgrids.webhookDeliveries.filter.unknownTrigger", "Selected trigger")
1465
+ })
1466
+ ] })]
1467
+ })]
1468
+ }), /* @__PURE__ */ jsxs("div", {
1469
+ className: "space-y-1.5",
1470
+ children: [/* @__PURE__ */ jsx(Label, {
1471
+ htmlFor: "webhook-deliveries-validation",
1472
+ children: tr("fluidgrids.webhookDeliveries.filter.validation", "Validation")
1473
+ }), /* @__PURE__ */ jsxs(Select, {
1474
+ value: validation,
1475
+ onValueChange: (value) => updateParams({
1476
+ validation: value === "all" ? null : value,
1477
+ page: null
1478
+ }),
1479
+ children: [/* @__PURE__ */ jsx(SelectTrigger, {
1480
+ id: "webhook-deliveries-validation",
1481
+ className: "w-44",
1482
+ "data-testid": "webhook-deliveries-validation-filter",
1483
+ children: /* @__PURE__ */ jsx(SelectValue, {})
1484
+ }), /* @__PURE__ */ jsx(SelectContent, { children: VALIDATION_FILTERS.map((filter) => /* @__PURE__ */ jsx(SelectItem, {
1485
+ value: filter,
1486
+ children: validationLabel(filter)
1487
+ }, filter)) })]
1488
+ })]
1489
+ })]
1490
+ }),
1491
+ selectedRegistration && /* @__PURE__ */ jsx(Card, { children: /* @__PURE__ */ jsx(CardContent, {
1492
+ className: "p-4",
1493
+ children: /* @__PURE__ */ jsx(TriggerSummary, { registration: selectedRegistration })
1494
+ }) }),
1495
+ (error || registrationsError) && /* @__PURE__ */ jsx("div", {
1496
+ className: "rounded-md border border-status-error-border bg-status-error-bg-subtle p-3 text-sm text-status-error-text",
1497
+ role: "alert",
1498
+ "data-testid": "webhook-deliveries-error",
1499
+ children: (error ?? registrationsError)?.message
1500
+ }),
1501
+ /* @__PURE__ */ jsx(Card, { children: /* @__PURE__ */ jsx(CardHeader, {
1502
+ className: "p-0",
1503
+ children: /* @__PURE__ */ jsx(DeliveriesTable, {
1504
+ deliveries,
1505
+ registrationsById,
1506
+ loading,
1507
+ selectedId,
1508
+ retrying,
1509
+ onSelect: (delivery) => setSelectedId(delivery.id),
1510
+ onRetry: (delivery) => void handleRetry(delivery),
1511
+ filtered: registrationId !== null || validation !== "all"
1512
+ })
1513
+ }) }),
1514
+ /* @__PURE__ */ jsxs("div", {
1515
+ className: "flex items-center justify-end gap-2",
1516
+ children: [
1517
+ /* @__PURE__ */ jsx("span", {
1518
+ className: "text-xs text-text-secondary",
1519
+ "data-testid": "webhook-deliveries-page-label",
1520
+ children: tr("fluidgrids.webhookDeliveries.page", "Page {{page}}", { page: page + 1 })
1521
+ }),
1522
+ /* @__PURE__ */ jsx(Button$1, {
1523
+ variant: "outline",
1524
+ size: "sm",
1525
+ disabled: page === 0 || loading,
1526
+ onClick: () => updateParams({ page: page - 1 > 0 ? String(page - 1) : null }),
1527
+ "data-testid": "webhook-deliveries-prev",
1528
+ children: tr("fluidgrids.webhookDeliveries.previous", "Previous")
1529
+ }),
1530
+ /* @__PURE__ */ jsx(Button$1, {
1531
+ variant: "outline",
1532
+ size: "sm",
1533
+ disabled: !hasMore || loading,
1534
+ onClick: () => updateParams({ page: String(page + 1) }),
1535
+ "data-testid": "webhook-deliveries-next",
1536
+ children: tr("fluidgrids.webhookDeliveries.next", "Next")
1537
+ })
1538
+ ]
1539
+ }),
1540
+ /* @__PURE__ */ jsx(Sheet, {
1541
+ open: selected !== null,
1542
+ onOpenChange: (open) => {
1543
+ if (!open) setSelectedId(null);
1544
+ },
1545
+ children: /* @__PURE__ */ jsxs(SheetContent, {
1546
+ side: "right",
1547
+ className: "w-full overflow-y-auto sm:max-w-2xl",
1548
+ children: [/* @__PURE__ */ jsx(SheetHeader, { children: /* @__PURE__ */ jsx(SheetTitle, { children: tr("fluidgrids.webhookDeliveries.detail.title", "Delivery details") }) }), selected && /* @__PURE__ */ jsx("div", {
1549
+ className: "mt-4",
1550
+ children: /* @__PURE__ */ jsx(DeliveryDetail, {
1551
+ delivery: selected,
1552
+ registration: registrationsById.get(selected.eventRegistrationId),
1553
+ retrying,
1554
+ onRetry: (delivery) => void handleRetry(delivery)
1555
+ })
1556
+ })]
1557
+ })
1558
+ })
1559
+ ]
1560
+ });
1561
+ }
1562
+
1563
+ export { useWebhookDeliveryRegistrations as a, RetryWebhookDeliveryDocument as c, useWebhookDeliveries as i, WebhookDeliveriesPage_exports as n, WebhookDeliveryRegistrationsDocument as o, useRetryWebhookDelivery as r, WebhookDeliveriesDocument as s, WebhookDeliveriesPage as t };