prefect 3.6.13.dev2__py3-none-any.whl → 3.6.14.dev1__py3-none-any.whl
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.
- prefect/_build_info.py +3 -3
- prefect/_internal/compatibility/blocks.py +18 -0
- prefect/client/schemas/filters.py +24 -0
- prefect/flow_engine.py +192 -10
- prefect/flows.py +61 -2
- prefect/results.py +262 -21
- prefect/runner/runner.py +29 -82
- prefect/runner/storage.py +3 -2
- prefect/server/schemas/filters.py +45 -0
- prefect/server/ui-v2/assets/{artifact-card-C8JEQRHl.js → artifact-card-DkgEVahF.js} +2 -2
- prefect/server/ui-v2/assets/{artifact-card-C8JEQRHl.js.map → artifact-card-DkgEVahF.js.map} +1 -1
- prefect/server/ui-v2/assets/{artifact._id-67V8kTg9.js → artifact._id-C7yJhkKY.js} +2 -2
- prefect/server/ui-v2/assets/{artifact._id-67V8kTg9.js.map → artifact._id-C7yJhkKY.js.map} +1 -1
- prefect/server/ui-v2/assets/{automation-wizard-DuxZ47Nn.js → automation-wizard-BLI4sqs9.js} +2 -2
- prefect/server/ui-v2/assets/{automation-wizard-DuxZ47Nn.js.map → automation-wizard-BLI4sqs9.js.map} +1 -1
- prefect/server/ui-v2/assets/{automation._id-D8S8r4Ji.js → automation._id-OLes3du9.js} +2 -2
- prefect/server/ui-v2/assets/{automation._id-D8S8r4Ji.js.map → automation._id-OLes3du9.js.map} +1 -1
- prefect/server/ui-v2/assets/{automation_._id.edit-C1fOM0Hx.js → automation_._id.edit-QrSzkDDB.js} +2 -2
- prefect/server/ui-v2/assets/{automation_._id.edit-C1fOM0Hx.js.map → automation_._id.edit-QrSzkDDB.js.map} +1 -1
- prefect/server/ui-v2/assets/{automations-header-DrijTNGi.js → automations-header-BoJc9HK8.js} +2 -2
- prefect/server/ui-v2/assets/{automations-header-DrijTNGi.js.map → automations-header-BoJc9HK8.js.map} +1 -1
- prefect/server/ui-v2/assets/{base-job-template-form-section-BDkqOkpe.js → base-job-template-form-section-Br6s0jNS.js} +2 -2
- prefect/server/ui-v2/assets/{base-job-template-form-section-BDkqOkpe.js.map → base-job-template-form-section-Br6s0jNS.js.map} +1 -1
- prefect/server/ui-v2/assets/{block-type-details-CrFHWH5D.js → block-type-details-BSbBP-Nm.js} +2 -2
- prefect/server/ui-v2/assets/{block-type-details-CrFHWH5D.js.map → block-type-details-BSbBP-Nm.js.map} +1 -1
- prefect/server/ui-v2/assets/block-type-logo-DNFERTyH.js +2 -0
- prefect/server/ui-v2/assets/{block-type-logo-WQNm0PzP.js.map → block-type-logo-DNFERTyH.js.map} +1 -1
- prefect/server/ui-v2/assets/{block._id-C3gN1Ae8.js → block._id-DO6Hulrv.js} +2 -2
- prefect/server/ui-v2/assets/{block._id-C3gN1Ae8.js.map → block._id-DO6Hulrv.js.map} +1 -1
- prefect/server/ui-v2/assets/{block_._id.edit-DzPuSvat.js → block_._id.edit-BWF0TQvv.js} +2 -2
- prefect/server/ui-v2/assets/{block_._id.edit-DzPuSvat.js.map → block_._id.edit-BWF0TQvv.js.map} +1 -1
- prefect/server/ui-v2/assets/{catalog-T-7MqsyE.js → catalog-BlaqZP0r.js} +2 -2
- prefect/server/ui-v2/assets/{catalog-T-7MqsyE.js.map → catalog-BlaqZP0r.js.map} +1 -1
- prefect/server/ui-v2/assets/{catalog_._slug-DMOI61fc.js → catalog_._slug-BZWiMtjq.js} +2 -2
- prefect/server/ui-v2/assets/{catalog_._slug-DMOI61fc.js.map → catalog_._slug-BZWiMtjq.js.map} +1 -1
- prefect/server/ui-v2/assets/{catalog_._slug_.create-l9bGUPi-.js → catalog_._slug_.create-oHffbeMs.js} +2 -2
- prefect/server/ui-v2/assets/{catalog_._slug_.create-l9bGUPi-.js.map → catalog_._slug_.create-oHffbeMs.js.map} +1 -1
- prefect/server/ui-v2/assets/{collapsible-DM-Ze5-Y.js → collapsible-D45P93xU.js} +2 -2
- prefect/server/ui-v2/assets/{collapsible-DM-Ze5-Y.js.map → collapsible-D45P93xU.js.map} +1 -1
- prefect/server/ui-v2/assets/{concurrency-limit._id-BHEt9viF.js → concurrency-limit._id-B6oyPVya.js} +2 -2
- prefect/server/ui-v2/assets/{concurrency-limit._id-BHEt9viF.js.map → concurrency-limit._id-B6oyPVya.js.map} +1 -1
- prefect/server/ui-v2/assets/{create-BMxUOyN5.js → create-CcYMd6w6.js} +2 -2
- prefect/server/ui-v2/assets/{create-BMxUOyN5.js.map → create-CcYMd6w6.js.map} +1 -1
- prefect/server/ui-v2/assets/{create-Cq-EAHVk.js → create-DK1WvDhf.js} +2 -2
- prefect/server/ui-v2/assets/{create-Cq-EAHVk.js.map → create-DK1WvDhf.js.map} +1 -1
- prefect/server/ui-v2/assets/{data-table-Bw8TZx9D.js → data-table-B_iyrrTm.js} +2 -2
- prefect/server/ui-v2/assets/{data-table-Bw8TZx9D.js.map → data-table-B_iyrrTm.js.map} +1 -1
- prefect/server/ui-v2/assets/{delete-confirmation-dialog-CTdWZlGM.js → delete-confirmation-dialog-7GKqeKy1.js} +2 -2
- prefect/server/ui-v2/assets/{delete-confirmation-dialog-CTdWZlGM.js.map → delete-confirmation-dialog-7GKqeKy1.js.map} +1 -1
- prefect/server/ui-v2/assets/{deployment-action-header-BObYqmI_.js → deployment-action-header-DrvnfE9Y.js} +2 -2
- prefect/server/ui-v2/assets/{deployment-action-header-BObYqmI_.js.map → deployment-action-header-DrvnfE9Y.js.map} +1 -1
- prefect/server/ui-v2/assets/{deployment-form-CntyhRrK.js → deployment-form-DsAij22s.js} +3 -3
- prefect/server/ui-v2/assets/{deployment-form-CntyhRrK.js.map → deployment-form-DsAij22s.js.map} +1 -1
- prefect/server/ui-v2/assets/{deployment-links-DBUSCaxB.js → deployment-links-BwqfKWQX.js} +2 -2
- prefect/server/ui-v2/assets/{deployment-links-DBUSCaxB.js.map → deployment-links-BwqfKWQX.js.map} +1 -1
- prefect/server/ui-v2/assets/{deployment._id-BXanVFA8.js → deployment._id-E5e5s6bO.js} +2 -2
- prefect/server/ui-v2/assets/{deployment._id-BXanVFA8.js.map → deployment._id-E5e5s6bO.js.map} +1 -1
- prefect/server/ui-v2/assets/{deployment._id-Q5cvHMX9.js → deployment._id-U6KrtWw0.js} +2 -2
- prefect/server/ui-v2/assets/{deployment._id-Q5cvHMX9.js.map → deployment._id-U6KrtWw0.js.map} +1 -1
- prefect/server/ui-v2/assets/deployment_._id.duplicate-C_kNyCA9.js +2 -0
- prefect/server/ui-v2/assets/{deployment_._id.duplicate-DB-4hHHc.js.map → deployment_._id.duplicate-C_kNyCA9.js.map} +1 -1
- prefect/server/ui-v2/assets/deployment_._id.edit-BP8pfTOR.js +2 -0
- prefect/server/ui-v2/assets/{deployment_._id.edit-CWf1RIGy.js.map → deployment_._id.edit-BP8pfTOR.js.map} +1 -1
- prefect/server/ui-v2/assets/{deployment_._id.run-CoHGXFoM.js → deployment_._id.run-Di3-4Mtk.js} +2 -2
- prefect/server/ui-v2/assets/{deployment_._id.run-CoHGXFoM.js.map → deployment_._id.run-Di3-4Mtk.js.map} +1 -1
- prefect/server/ui-v2/assets/{dropdown-menu-CT-s-V7d.js → dropdown-menu-iS8iJMpx.js} +2 -2
- prefect/server/ui-v2/assets/{dropdown-menu-CT-s-V7d.js.map → dropdown-menu-iS8iJMpx.js.map} +1 -1
- prefect/server/ui-v2/assets/{event._eventDate._eventId-BITo_GYL.js → event._eventDate._eventId-CG15qDSZ.js} +2 -2
- prefect/server/ui-v2/assets/{event._eventDate._eventId-BITo_GYL.js.map → event._eventDate._eventId-CG15qDSZ.js.map} +1 -1
- prefect/server/ui-v2/assets/flow-run-graph-B1vF1w0Z.js +2 -0
- prefect/server/ui-v2/assets/flow-run-graph-B1vF1w0Z.js.map +1 -0
- prefect/server/ui-v2/assets/flow-run._id-BHY61H6u.js +4 -0
- prefect/server/ui-v2/assets/flow-run._id-BHY61H6u.js.map +1 -0
- prefect/server/ui-v2/assets/{flow-run._id-BtSgRDtA.js → flow-run._id-D_eAHZ5z.js} +2 -2
- prefect/server/ui-v2/assets/{flow-run._id-BtSgRDtA.js.map → flow-run._id-D_eAHZ5z.js.map} +1 -1
- prefect/server/ui-v2/assets/{flow-run._id-Bbm9OpDi.js → flow-run._id-wco0Q19f.js} +2 -2
- prefect/server/ui-v2/assets/{flow-run._id-Bbm9OpDi.js.map → flow-run._id-wco0Q19f.js.map} +1 -1
- prefect/server/ui-v2/assets/{flow-runs-pagination-LrU9Aio8.js → flow-runs-pagination-DzGHOht3.js} +2 -2
- prefect/server/ui-v2/assets/{flow-runs-pagination-LrU9Aio8.js.map → flow-runs-pagination-DzGHOht3.js.map} +1 -1
- prefect/server/ui-v2/assets/{flow._id-BJBRokk4.js → flow._id-Dn2so3rK.js} +2 -2
- prefect/server/ui-v2/assets/{flow._id-BJBRokk4.js.map → flow._id-Dn2so3rK.js.map} +1 -1
- prefect/server/ui-v2/assets/{form-CVSlEnl8.js → form-rC8pxeRl.js} +2 -2
- prefect/server/ui-v2/assets/{form-CVSlEnl8.js.map → form-rC8pxeRl.js.map} +1 -1
- prefect/server/ui-v2/assets/{header-4plZZheZ.js → header-C0zV3WDn.js} +2 -2
- prefect/server/ui-v2/assets/{header-4plZZheZ.js.map → header-C0zV3WDn.js.map} +1 -1
- prefect/server/ui-v2/assets/{header-D3uM8_xM.js → header-C6ko3O7G.js} +2 -2
- prefect/server/ui-v2/assets/{header-D3uM8_xM.js.map → header-C6ko3O7G.js.map} +1 -1
- prefect/server/ui-v2/assets/{header-9rXZ4r39.js → header-CuAwmJ64.js} +2 -2
- prefect/server/ui-v2/assets/{header-9rXZ4r39.js.map → header-CuAwmJ64.js.map} +1 -1
- prefect/server/ui-v2/assets/{index-6OsEYhIi.js → index-0g8aAM30.js} +2 -2
- prefect/server/ui-v2/assets/{index-6OsEYhIi.js.map → index-0g8aAM30.js.map} +1 -1
- prefect/server/ui-v2/assets/{index-BeoNC2tJ.js → index-BIqzfifB.js} +2 -2
- prefect/server/ui-v2/assets/{index-BeoNC2tJ.js.map → index-BIqzfifB.js.map} +1 -1
- prefect/server/ui-v2/assets/{index-ChIrfjIW.js → index-BKbBu9gL.js} +2 -2
- prefect/server/ui-v2/assets/{index-ChIrfjIW.js.map → index-BKbBu9gL.js.map} +1 -1
- prefect/server/ui-v2/assets/{index-h9-QgNjZ.js → index-BYQ1P2TC.js} +2 -2
- prefect/server/ui-v2/assets/{index-h9-QgNjZ.js.map → index-BYQ1P2TC.js.map} +1 -1
- prefect/server/ui-v2/assets/{index-DODEq1Pi.js → index-BdgomKuA.js} +2 -2
- prefect/server/ui-v2/assets/{index-DODEq1Pi.js.map → index-BdgomKuA.js.map} +1 -1
- prefect/server/ui-v2/assets/{index-DqCPbST9.js → index-Benf9xn3.js} +2 -2
- prefect/server/ui-v2/assets/{index-DqCPbST9.js.map → index-Benf9xn3.js.map} +1 -1
- prefect/server/ui-v2/assets/{index-B7xsJ-QH.js → index-BjsWjEUO.js} +2 -2
- prefect/server/ui-v2/assets/{index-B7xsJ-QH.js.map → index-BjsWjEUO.js.map} +1 -1
- prefect/server/ui-v2/assets/{index-DicK6p3K.js → index-C3D0Re7U.js} +2 -2
- prefect/server/ui-v2/assets/{index-DicK6p3K.js.map → index-C3D0Re7U.js.map} +1 -1
- prefect/server/ui-v2/assets/{index-BlpD74iH.js → index-CCs20W5W.js} +2 -2
- prefect/server/ui-v2/assets/{index-BlpD74iH.js.map → index-CCs20W5W.js.map} +1 -1
- prefect/server/ui-v2/assets/{index-udb79rgq.js → index-CEStyUb-.js} +2 -2
- prefect/server/ui-v2/assets/{index-udb79rgq.js.map → index-CEStyUb-.js.map} +1 -1
- prefect/server/ui-v2/assets/{index-tBdv6kBF.js → index-CYpFLd7y.js} +2 -2
- prefect/server/ui-v2/assets/{index-tBdv6kBF.js.map → index-CYpFLd7y.js.map} +1 -1
- prefect/server/ui-v2/assets/{index-CDyLkbVG.js → index-CcVSC2pV.js} +2 -2
- prefect/server/ui-v2/assets/{index-CDyLkbVG.js.map → index-CcVSC2pV.js.map} +1 -1
- prefect/server/ui-v2/assets/index-Cd7pM9pk.js +17 -0
- prefect/server/ui-v2/assets/index-Cd7pM9pk.js.map +1 -0
- prefect/server/ui-v2/assets/{index-DJyKqsFO.js → index-CotXErTe.js} +2 -2
- prefect/server/ui-v2/assets/{index-DJyKqsFO.js.map → index-CotXErTe.js.map} +1 -1
- prefect/server/ui-v2/assets/{index-DxPoKag8.js → index-D8fZaZa7.js} +2 -2
- prefect/server/ui-v2/assets/{index-DxPoKag8.js.map → index-D8fZaZa7.js.map} +1 -1
- prefect/server/ui-v2/assets/{index-D6GJ4go1.js → index-DB2qeheX.js} +2 -2
- prefect/server/ui-v2/assets/{index-D6GJ4go1.js.map → index-DB2qeheX.js.map} +1 -1
- prefect/server/ui-v2/assets/{index-CzCSgCK-.js → index-DvKYj8ko.js} +2 -2
- prefect/server/ui-v2/assets/{index-CzCSgCK-.js.map → index-DvKYj8ko.js.map} +1 -1
- prefect/server/ui-v2/assets/{index-BfJLUM7N.js → index-DwkedbVy.js} +2 -2
- prefect/server/ui-v2/assets/{index-BfJLUM7N.js.map → index-DwkedbVy.js.map} +1 -1
- prefect/server/ui-v2/assets/index-b9WBW430.css +1 -0
- prefect/server/ui-v2/assets/{index-CDwJvjUM.js → index-fhrsIceD.js} +2 -2
- prefect/server/ui-v2/assets/{index-CDwJvjUM.js.map → index-fhrsIceD.js.map} +1 -1
- prefect/server/ui-v2/assets/{index-D5v9S-lB.js → index-k2161reF.js} +2 -2
- prefect/server/ui-v2/assets/{index-D5v9S-lB.js.map → index-k2161reF.js.map} +1 -1
- prefect/server/ui-v2/assets/{index-Bj0OOguP.js → index-pE_31vXF.js} +2 -2
- prefect/server/ui-v2/assets/{index-Bj0OOguP.js.map → index-pE_31vXF.js.map} +1 -1
- prefect/server/ui-v2/assets/{json-input-Dt1icmrn.js → json-input-C9dkBSdc.js} +2 -2
- prefect/server/ui-v2/assets/{json-input-Dt1icmrn.js.map → json-input-C9dkBSdc.js.map} +1 -1
- prefect/server/ui-v2/assets/{key._key-Cyh5MBX_.js → key._key-BBVH44_R.js} +2 -2
- prefect/server/ui-v2/assets/{key._key-Cyh5MBX_.js.map → key._key-BBVH44_R.js.map} +1 -1
- prefect/server/ui-v2/assets/{lazy-markdown-BwIwKFRF.js → lazy-markdown-BoMKGRXo.js} +2 -2
- prefect/server/ui-v2/assets/{lazy-markdown-BwIwKFRF.js.map → lazy-markdown-BoMKGRXo.js.map} +1 -1
- prefect/server/ui-v2/assets/{login-DKXFVSwk.js → login-BmmIDesJ.js} +2 -2
- prefect/server/ui-v2/assets/{login-DKXFVSwk.js.map → login-BmmIDesJ.js.map} +1 -1
- prefect/server/ui-v2/assets/{markdown-input-Dp0mBlkV.js → markdown-input-C6P8cYT1.js} +2 -2
- prefect/server/ui-v2/assets/{markdown-input-Dp0mBlkV.js.map → markdown-input-C6P8cYT1.js.map} +1 -1
- prefect/server/ui-v2/assets/{python-example-snippet-BYwPjHI5.js → python-example-snippet-DPumgTpL.js} +3 -3
- prefect/server/ui-v2/assets/{python-example-snippet-BYwPjHI5.js.map → python-example-snippet-DPumgTpL.js.map} +1 -1
- prefect/server/ui-v2/assets/{python-input-y26XMqXw.js → python-input-DX4uV8MF.js} +2 -2
- prefect/server/ui-v2/assets/{python-input-y26XMqXw.js.map → python-input-DX4uV8MF.js.map} +1 -1
- prefect/server/ui-v2/assets/{radio-group-D0van45v.js → radio-group-DeNK-Ob0.js} +2 -2
- prefect/server/ui-v2/assets/{radio-group-D0van45v.js.map → radio-group-DeNK-Ob0.js.map} +1 -1
- prefect/server/ui-v2/assets/{route-error-state-CGGpuCGN.js → route-error-state-C9CbByMx.js} +2 -2
- prefect/server/ui-v2/assets/{route-error-state-CGGpuCGN.js.map → route-error-state-C9CbByMx.js.map} +1 -1
- prefect/server/ui-v2/assets/{schema-form-2tg5SXM4.js → schema-form-B45xnsnK.js} +2 -2
- prefect/server/ui-v2/assets/{schema-form-2tg5SXM4.js.map → schema-form-B45xnsnK.js.map} +1 -1
- prefect/server/ui-v2/assets/{schema-form-input-string-format-datetime-CZt6AJ4z.js → schema-form-input-string-format-datetime-BJj81bu-.js} +4 -4
- prefect/server/ui-v2/assets/{schema-form-input-string-format-datetime-CZt6AJ4z.js.map → schema-form-input-string-format-datetime-BJj81bu-.js.map} +1 -1
- prefect/server/ui-v2/assets/{settings-DDUadk_N.js → settings-CbkeWqQ9.js} +2 -2
- prefect/server/ui-v2/assets/{settings-DDUadk_N.js.map → settings-CbkeWqQ9.js.map} +1 -1
- prefect/server/ui-v2/assets/{sort-filter-D9p3cPx9.js → sort-filter-DM7SvBB0.js} +2 -2
- prefect/server/ui-v2/assets/{sort-filter-D9p3cPx9.js.map → sort-filter-DM7SvBB0.js.map} +1 -1
- prefect/server/ui-v2/assets/{table-vo9Do8sA.js → table-CEPo6xb_.js} +2 -2
- prefect/server/ui-v2/assets/{table-vo9Do8sA.js.map → table-CEPo6xb_.js.map} +1 -1
- prefect/server/ui-v2/assets/{tags-input-Ci2JQ-k3.js → tags-input-DJiZSVHp.js} +2 -2
- prefect/server/ui-v2/assets/{tags-input-Ci2JQ-k3.js.map → tags-input-DJiZSVHp.js.map} +1 -1
- prefect/server/ui-v2/assets/{task-run-concurrency-limits-reset-dialog-CJzPc2gw.js → task-run-concurrency-limits-reset-dialog-vJEkvqWp.js} +2 -2
- prefect/server/ui-v2/assets/{task-run-concurrency-limits-reset-dialog-CJzPc2gw.js.map → task-run-concurrency-limits-reset-dialog-vJEkvqWp.js.map} +1 -1
- prefect/server/ui-v2/assets/{task-run._id-D8QKG5UZ.js → task-run._id-BCnDnXrL.js} +2 -2
- prefect/server/ui-v2/assets/{task-run._id-D8QKG5UZ.js.map → task-run._id-BCnDnXrL.js.map} +1 -1
- prefect/server/ui-v2/assets/{task-run._id-CjevSs79.js → task-run._id-ByJw1K82.js} +2 -2
- prefect/server/ui-v2/assets/{task-run._id-CjevSs79.js.map → task-run._id-ByJw1K82.js.map} +1 -1
- prefect/server/ui-v2/assets/{task-runs-pagination-CifoSGct.js → task-runs-pagination-DbjB6XnY.js} +2 -2
- prefect/server/ui-v2/assets/{task-runs-pagination-CifoSGct.js.map → task-runs-pagination-DbjB6XnY.js.map} +1 -1
- prefect/server/ui-v2/assets/{textarea-BAtfAxtV.js → textarea-BX8KbLGx.js} +2 -2
- prefect/server/ui-v2/assets/{textarea-BAtfAxtV.js.map → textarea-BX8KbLGx.js.map} +1 -1
- prefect/server/ui-v2/assets/{timezone-select-QlQTZSsF.js → timezone-select-TBj2n6Ox.js} +2 -2
- prefect/server/ui-v2/assets/{timezone-select-QlQTZSsF.js.map → timezone-select-TBj2n6Ox.js.map} +1 -1
- prefect/server/ui-v2/assets/{toggle-group-BJN1vjEh.js → toggle-group-D7mfSUim.js} +2 -2
- prefect/server/ui-v2/assets/{toggle-group-BJN1vjEh.js.map → toggle-group-D7mfSUim.js.map} +1 -1
- prefect/server/ui-v2/assets/{use-delete-automation-confirmation-dialog-eOWJYPkD.js → use-delete-automation-confirmation-dialog-BpBSjz60.js} +2 -2
- prefect/server/ui-v2/assets/{use-delete-automation-confirmation-dialog-eOWJYPkD.js.map → use-delete-automation-confirmation-dialog-BpBSjz60.js.map} +1 -1
- prefect/server/ui-v2/assets/{use-delete-block-document-confirmation-dialog-BTwSeHRM.js → use-delete-block-document-confirmation-dialog-BjKsNw6b.js} +2 -2
- prefect/server/ui-v2/assets/{use-delete-block-document-confirmation-dialog-BTwSeHRM.js.map → use-delete-block-document-confirmation-dialog-BjKsNw6b.js.map} +1 -1
- prefect/server/ui-v2/assets/{use-flow-runs-selected-rows-BL_Gv9CC.js → use-flow-runs-selected-rows-B_BlBMic.js} +2 -2
- prefect/server/ui-v2/assets/{use-flow-runs-selected-rows-BL_Gv9CC.js.map → use-flow-runs-selected-rows-B_BlBMic.js.map} +1 -1
- prefect/server/ui-v2/assets/{use-get-artifacts-flow-task-runs-TSCoomjQ.js → use-get-artifacts-flow-task-runs-BfE433bC.js} +2 -2
- prefect/server/ui-v2/assets/{use-get-artifacts-flow-task-runs-TSCoomjQ.js.map → use-get-artifacts-flow-task-runs-BfE433bC.js.map} +1 -1
- prefect/server/ui-v2/assets/{use-quick-run-BMnCkwSv.js → use-quick-run-qrtcF-DD.js} +2 -2
- prefect/server/ui-v2/assets/{use-quick-run-BMnCkwSv.js.map → use-quick-run-qrtcF-DD.js.map} +1 -1
- prefect/server/ui-v2/assets/{use-stepper-C1wm66U2.js → use-stepper-CVy1_GBw.js} +2 -2
- prefect/server/ui-v2/assets/{use-stepper-C1wm66U2.js.map → use-stepper-CVy1_GBw.js.map} +1 -1
- prefect/server/ui-v2/assets/{utilities-DxRXxFOF.js → utilities-D5-00wjP.js} +2 -2
- prefect/server/ui-v2/assets/{utilities-DxRXxFOF.js.map → utilities-D5-00wjP.js.map} +1 -1
- prefect/server/ui-v2/assets/{vendor-graphs-Diy0Lo-N.js → vendor-graphs-R8z6S3Jg.js} +2 -2
- prefect/server/ui-v2/assets/{vendor-graphs-Diy0Lo-N.js.map → vendor-graphs-R8z6S3Jg.js.map} +1 -1
- prefect/server/ui-v2/assets/{work-pool-filter-PudrkZYj.js → work-pool-filter-D8MkTbSW.js} +2 -2
- prefect/server/ui-v2/assets/{work-pool-filter-PudrkZYj.js.map → work-pool-filter-D8MkTbSW.js.map} +1 -1
- prefect/server/ui-v2/assets/{work-pool-queue-toggle-BAOrV_0R.js → work-pool-queue-toggle-CbI7Gfu5.js} +2 -2
- prefect/server/ui-v2/assets/{work-pool-queue-toggle-BAOrV_0R.js.map → work-pool-queue-toggle-CbI7Gfu5.js.map} +1 -1
- prefect/server/ui-v2/assets/{work-pool._workPoolName-BOM3849e.js → work-pool._workPoolName-CCzzgVV2.js} +2 -2
- prefect/server/ui-v2/assets/{work-pool._workPoolName-BOM3849e.js.map → work-pool._workPoolName-CCzzgVV2.js.map} +1 -1
- prefect/server/ui-v2/assets/{work-pool_._workPoolName.edit-CIhcG6yr.js → work-pool_._workPoolName.edit-BAgiuU_j.js} +2 -2
- prefect/server/ui-v2/assets/{work-pool_._workPoolName.edit-CIhcG6yr.js.map → work-pool_._workPoolName.edit-BAgiuU_j.js.map} +1 -1
- prefect/server/ui-v2/assets/{work-pool_._workPoolName.queue._workQueueName-CjoM77tu.js → work-pool_._workPoolName.queue._workQueueName-BUawWJEy.js} +2 -2
- prefect/server/ui-v2/assets/{work-pool_._workPoolName.queue._workQueueName-CjoM77tu.js.map → work-pool_._workPoolName.queue._workQueueName-BUawWJEy.js.map} +1 -1
- prefect/server/ui-v2/assets/{work-queue-icon-text-CP4yX3uM.js → work-queue-icon-text-D_G_UCJX.js} +2 -2
- prefect/server/ui-v2/assets/{work-queue-icon-text-CP4yX3uM.js.map → work-queue-icon-text-D_G_UCJX.js.map} +1 -1
- prefect/server/ui-v2/index.html +2 -2
- prefect/settings/models/flows.py +14 -1
- prefect/settings/models/runner.py +16 -6
- prefect/task_engine.py +1 -3
- prefect/task_worker.py +1 -1
- prefect/tasks.py +2 -2
- prefect/testing/fixtures.py +23 -5
- {prefect-3.6.13.dev2.dist-info → prefect-3.6.14.dev1.dist-info}/METADATA +1 -1
- {prefect-3.6.13.dev2.dist-info → prefect-3.6.14.dev1.dist-info}/RECORD +216 -216
- prefect/server/ui-v2/assets/block-type-logo-WQNm0PzP.js +0 -2
- prefect/server/ui-v2/assets/deployment_._id.duplicate-DB-4hHHc.js +0 -2
- prefect/server/ui-v2/assets/deployment_._id.edit-CWf1RIGy.js +0 -2
- prefect/server/ui-v2/assets/flow-run-graph-DxIl6fzW.js +0 -2
- prefect/server/ui-v2/assets/flow-run-graph-DxIl6fzW.js.map +0 -1
- prefect/server/ui-v2/assets/flow-run._id-DJuMECRh.js +0 -4
- prefect/server/ui-v2/assets/flow-run._id-DJuMECRh.js.map +0 -1
- prefect/server/ui-v2/assets/index-BvSl3DKP.js +0 -17
- prefect/server/ui-v2/assets/index-BvSl3DKP.js.map +0 -1
- prefect/server/ui-v2/assets/index-NY089eTx.css +0 -1
- {prefect-3.6.13.dev2.dist-info → prefect-3.6.14.dev1.dist-info}/WHEEL +0 -0
- {prefect-3.6.13.dev2.dist-info → prefect-3.6.14.dev1.dist-info}/entry_points.txt +0 -0
- {prefect-3.6.13.dev2.dist-info → prefect-3.6.14.dev1.dist-info}/licenses/LICENSE +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{t as z,j as t,L as m,r as Y,p as oe,s as re,E as ae,u as ce}from"./vendor-tanstack-BK8oseNA.js";import{bp as ie,cO as le,M as G,d1 as ue,d4 as de,C as B,al as u,aq as K,I as j,_ as pe,bh as me,q as H,f as fe,$ as he,a0 as xe,a1 as ye,L as je,b5 as N,cg as we,d7 as v,X as ke,ch as Ae,N as _,d5 as _e,d8 as De,G as be,y as D,bA as ge,d9 as Se}from"./index-BvSl3DKP.js";import{F as Te,W as Ee,a as Ne}from"./work-queue-icon-text-CP4yX3uM.js";import{D as ve,a as Re,b as Ce,c as Le,d as k}from"./dropdown-menu-CT-s-V7d.js";import{u as Pe}from"./use-delete-confirmation-dialog-CvQEyyhU.js";const We=e=>{const{automationIds:s,blockDocumentIds:n,deploymentIds:o,workPoolIds:c,workQueueIds:a}=Qe(e.actions),{data:r,loading:i}=qe(Array.from(s)),l=z({queries:[ie({offset:0,sort:"BLOCK_TYPE_AND_NAME_ASC",include_secrets:!1,block_documents:{operator:"and_",id:{any_:Array.from(n)},is_anonymous:{}}},{enabled:n.size>0}),le({offset:0,sort:"CREATED_DESC",deployments:{id:{any_:Array.from(o)},operator:"and_"}},{enabled:o.size>0}),G({offset:0,work_pools:{id:{any_:Array.from(c)},operator:"and_"}},{enabled:c.size>0}),ue({offset:0,work_queues:{id:{any_:Array.from(a)},operator:"and_"}},{enabled:a.size>0})],combine:d=>{const[y,ee,te,se]=d;return{data:{blockDocuments:y.data,deployments:ee.data,workPools:te.data,workQueues:se.data},loading:d.some(ne=>ne.isLoading)}}});return{loading:i||l.loading,data:{automationsMap:r,blockDocumentsMap:A(l.data.blockDocuments),deploymentsMap:A(l.data.deployments),workPoolsMap:A(l.data.workPools),workQueuesMap:A(l.data.workQueues)}}},qe=e=>z({queries:Array.from(e).map(s=>de(s)),combine:s=>{const n=new Map;for(const o of s)o.data&&n.set(o.data.id,o.data);return{data:n,loading:s.some(o=>o.isLoading)}}}),Qe=e=>{const s=new Set,n=new Set,o=new Set,c=new Set,a=new Set;for(const r of e)switch(r.type){case"run-deployment":case"pause-deployment":case"resume-deployment":r.deployment_id&&o.add(r.deployment_id);break;case"pause-work-queue":case"resume-work-queue":r.work_queue_id&&a.add(r.work_queue_id);break;case"pause-automation":case"resume-automation":r.automation_id&&s.add(r.automation_id);break;case"pause-work-pool":case"resume-work-pool":r.work_pool_id&&c.add(r.work_pool_id);break;case"send-notification":case"call-webhook":r.block_document_id&&n.add(r.block_document_id);break}return{automationIds:s,blockDocumentIds:n,deploymentIds:o,workPoolIds:c,workQueueIds:a}};function A(e){const s=new Map;for(const n of e??[])s.set(n.id,n);return s}const Ie={"cancel-flow-run":"Cancel flow run","suspend-flow-run":"Suspend flow run","resume-flow-run":"Resume a flow run","change-flow-run-state":"Change state of a flow run","run-deployment":"Run deployment","pause-deployment":"Pause deployment","resume-deployment":"Resume deployment","pause-work-queue":"Pause work queue","resume-work-queue":"Resume work queue","pause-work-pool":"Pause work pool","resume-work-pool":"Resume work pool","pause-automation":"Pause automation","resume-automation":"Resume automation","call-webhook":"Call a custom webhook notification","send-notification":"Send a notification using","do-nothing":"Do nothing"},Me=({action:e,automationsMap:s,blockDocumentsMap:n,deploymentsMap:o,workPoolsMap:c,workQueuesMap:a})=>t.jsx(B,{className:"p-4",children:t.jsx(Oe,{action:e,automationsMap:s,blockDocumentsMap:n,deploymentsMap:o,workPoolsMap:c,workQueuesMap:a})}),Oe=({action:e,automationsMap:s,blockDocumentsMap:n,deploymentsMap:o,workPoolsMap:c,workQueuesMap:a})=>{const r=Ie[e.type];switch(e.type){case"cancel-flow-run":case"suspend-flow-run":case"resume-flow-run":case"call-webhook":case"do-nothing":return t.jsx($e,{label:r});case"run-deployment":if(e.deployment_id&&e.source==="selected"){const i=o.get(e.deployment_id);return i?t.jsx(P,{label:r,deployment:i,parameters:e.parameters,job_variables:e.job_variables}):t.jsx(u,{children:"Deployment not found"})}return t.jsx(f,{label:r});case"pause-deployment":case"resume-deployment":if(e.deployment_id&&e.source==="selected"){const i=o.get(e.deployment_id);return i?t.jsx(P,{label:r,deployment:i}):t.jsx(u,{children:"Deployment not found"})}return t.jsx(f,{label:r});case"pause-work-queue":case"resume-work-queue":if(e.work_queue_id&&e.source==="selected"){const i=a.get(e.work_queue_id);return i?t.jsx(Ye,{label:r,workQueue:i}):t.jsx(u,{children:"Work queue not found"})}return t.jsx(f,{label:r});case"pause-automation":case"resume-automation":if(e.automation_id&&e.source==="selected"){const i=s.get(e.automation_id);return i?t.jsx(Fe,{label:r,automation:i}):t.jsx(u,{children:"Automation not found"})}return t.jsx(f,{label:r});case"pause-work-pool":case"resume-work-pool":if(e.work_pool_id&&e.source==="selected"){const i=c.get(e.work_pool_id);return i?t.jsx(ze,{label:r,workPool:i}):t.jsx(u,{children:"Workpool not found"})}return t.jsx(f,{label:r});case"send-notification":{const i=n.get(e.block_document_id);return i?t.jsx(Ve,{label:r,blockDocument:i}):t.jsx(u,{children:"Block document not found"})}case"change-flow-run-state":return t.jsx(Ue,{label:r,type:e.state,name:e.name});default:return null}},x=({children:e})=>t.jsx("div",{className:"text-sm flex items-center gap-1",children:e}),w=({iconId:e,name:s})=>t.jsxs("div",{className:"text-xs flex items-center",children:[t.jsx(j,{id:e,className:"size-4 mr-1"}),s]}),$e=({label:e})=>t.jsxs(u,{variant:"bodySmall",children:[e," from the triggering event"]}),f=({label:e})=>t.jsxs(u,{variant:"bodySmall",children:[e," inferred from the triggering event"]}),Ue=({label:e,type:s,name:n})=>t.jsxs(x,{children:[t.jsx(f,{label:e})," to ",t.jsx(K,{type:s,name:n})]}),P=({label:e,deployment:s,parameters:n,job_variables:o})=>t.jsxs(x,{children:[t.jsxs("label",{htmlFor:`${e}-${s.id}`,children:[e,":"]}),t.jsx(m,{to:"/deployments/deployment/$id",params:{id:s.id},"aria-label":s.name,children:t.jsx(w,{iconId:"Rocket",name:s.name})}),n!==void 0&&t.jsx(W,{title:"Parameters",payload:n}),o!==void 0&&t.jsx(W,{title:"Job Variables",payload:o})]}),W=({title:e,payload:s})=>t.jsxs(pe,{children:[t.jsx(me,{asChild:!0,children:t.jsxs(H,{variant:"secondary",size:"sm",children:["Show ",fe(e)]})}),t.jsxs(he,{"aria-describedby":void 0,children:[t.jsx(xe,{children:t.jsx(ye,{children:e})}),t.jsx(je,{value:JSON.stringify(s),disabled:!0})]})]}),Fe=({label:e,automation:s})=>t.jsxs(x,{children:[t.jsxs("label",{htmlFor:`${e}-${s.id}`,children:[e,":"]}),t.jsx(m,{to:"/automations/automation/$id",params:{id:s.id},"aria-label":s.name,children:t.jsx(w,{iconId:"Bot",name:s.name})})]}),Ve=({label:e,blockDocument:s})=>{if(!s.name)return t.jsx(u,{children:"Block not found"});const n=s.block_type_name?`Send a ${s.block_type_name.toLowerCase()} using`:e;return t.jsxs(x,{children:[t.jsx("label",{htmlFor:`${e}-${s.id}`,children:n}),t.jsx(m,{to:"/blocks/block/$id",params:{id:s.id},"aria-label":s.name,children:t.jsx(w,{iconId:"Box",name:s.name})})]})},ze=({label:e,workPool:s})=>t.jsxs(x,{children:[t.jsxs("label",{htmlFor:`${e}-${s.id}`,children:[e,":"]}),t.jsx(m,{to:"/work-pools/work-pool/$workPoolName",params:{workPoolName:s.name},"aria-label":s.name,children:t.jsx(w,{iconId:"Cpu",name:s.name})})]}),Ye=({label:e,workQueue:s})=>t.jsxs(x,{children:[t.jsxs("label",{htmlFor:`${e}-${s.id}`,children:[e,":"]}),t.jsx(m,{to:"/work-pools/work-pool/$workPoolName/queue/$workQueueName",params:{workPoolName:s.name,workQueueName:s.name},"aria-label":s.name,children:t.jsx(w,{iconId:"Cpu",name:s.name})})]}),Ge=({trigger:e})=>{const s=e.triggers?.length??0,n=e.require;let o;return n==="all"?o="all":n==="any"?o="any":typeof n=="number"?o=`at least ${n}`:o="all",t.jsx("div",{className:"flex flex-wrap gap-1 items-center",children:t.jsxs(u,{variant:"bodySmall",children:["A compound trigger requiring ",o," of ",s," nested"," ",s===1?"trigger":"triggers"," to fire"]})})},q=()=>t.jsx(u,{variant:"bodySmall",children:"A custom trigger"}),Be=({deploymentId:e})=>t.jsx(Y.Suspense,{fallback:t.jsx(N,{className:"h-4 w-full"}),children:t.jsx(Ke,{deploymentId:e})}),Ke=({deploymentId:e})=>{const{data:s}=oe(we(e));return t.jsxs("div",{className:"flex items-center gap-1 text-xs",children:["Deployment",t.jsxs(m,{to:"/deployments/deployment/$id",params:{id:s.id},className:"flex items-center gap-1",children:[t.jsx(j,{id:"Rocket",className:"size-4"}),s.name]})]})},b=1,He=["prefect.deployment.ready","prefect.deployment.not-ready","prefect.deployment.disabled"],Je=["prefect.work-pool.ready","prefect.work-pool.not-ready","prefect.work-pool.paused","prefect.work-pool.not_ready"],Xe=["prefect.work-queue.ready","prefect.work-queue.not-ready","prefect.work-queue.paused"];function R(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function p(e){return R(e)&&e.type==="event"&&(e.posture==="Reactive"||e.posture==="Proactive")}function Ze(e){return R(e)&&e.type==="compound"&&Array.isArray(e.triggers)}function et(e){return R(e)&&e.type==="sequence"&&Array.isArray(e.triggers)}function J(e){return e==null?[]:Array.isArray(e)?e:[e]}function tt(e,s){if(p(e)){const n=e.match;if(n&&typeof n=="object"){const o=n[s];return o?J(o):[]}}return[]}function g(e,s){const n=tt(e,"prefect.resource.id");return n.length===0?!1:s(n)}function S(e,s){return p(e)?(e.for_each??[]).every(o=>o.startsWith(s)):!1}function T(e,s){return p(e)?s(e.after??[]):!1}function E(e,s){return p(e)?s(e.expect??[]):!1}function Q(e){return He.includes(e)}function I(e){return Je.includes(e)}function M(e){return Xe.includes(e)}function st(e){return p(e)&&g(e,s=>s.every(n=>n.startsWith("prefect.deployment")))&&S(e,"prefect.resource.id")&&T(e,s=>s.every(n=>Q(n)))&&E(e,s=>s.every(n=>Q(n)))&&e.threshold===b}function nt(e,s){const n=e.match_related;if(!n)return[];const o=Array.isArray(n)?n:[n],c=[];for(const a of o)if(a&&typeof a=="object"){const r=a[s];r&&c.push(...J(r))}return c}function ot(e){const s=e.match_related;return s?Array.isArray(s)?s.length===0:Object.keys(s).length===0:!0}function O(e,s){const n=nt(e,"prefect.resource.id");return n.length===0?!1:n.every(o=>o.startsWith(s))}function rt(e){return ot(e)||O(e,"prefect.flow")||O(e,"prefect.tag")}function at(e){return p(e)&&g(e,s=>s.every(n=>n.startsWith("prefect.flow-run")))&&S(e,"prefect.resource.id")&&T(e,s=>s.every(n=>n.startsWith("prefect.flow-run")))&&E(e,s=>s.every(n=>n.startsWith("prefect.flow-run")))&&rt(e)&&e.threshold===b}function ct(e){return p(e)&&g(e,s=>s.every(n=>n.startsWith("prefect.work-pool")))&&S(e,"prefect.resource.id")&&T(e,s=>s.every(n=>I(n)))&&E(e,s=>s.every(n=>I(n)))&&e.threshold===b}function it(e){return p(e)&&g(e,s=>s.every(n=>n.startsWith("prefect.work-queue")))&&S(e,"prefect.resource.id")&&T(e,s=>s.every(n=>M(n)))&&E(e,s=>s.every(n=>M(n)))&&e.threshold===b}const lt={"deployment-status":st,"flow-run-state":at,"work-pool-status":ct,"work-queue-status":it};function ut(e){for(const[s,n]of Object.entries(lt))if(n(e))return s;return"custom"}function C(e){switch(e){case"Reactive":return"enters";case"Proactive":return"stays in"}}function dt(e){switch(e){case"READY":return"Ready";case"NOT_READY":return"Not Ready";case"PAUSED":return"Paused";default:{const s=e;throw new Error(`getWorkQueueStatusLabel missing case for ${s}`)}}}function pt(e){switch(e){case"ready":return"ready";case"not_ready":return"not ready"}}const mt=({deploymentIds:e,posture:s,status:n,time:o})=>{const c=e.length===0,a=C(s),r=pt(n);return t.jsxs("div",{className:"flex flex-wrap gap-1 items-center",children:[t.jsx("span",{children:"When"}),c?t.jsx("span",{children:"any deployment"}):e.map((i,l)=>t.jsxs("span",{className:"flex items-center gap-1",children:[t.jsx(Be,{deploymentId:i}),l===e.length-2&&t.jsx("span",{children:"or"})]},i)),t.jsx("span",{children:a}),t.jsx("span",{children:r}),s==="Proactive"&&o!==void 0&&o>0&&t.jsxs("span",{children:["for ",v(o)]})]})};function ft(e){const s=e.toUpperCase();return["COMPLETED","FAILED","RUNNING","CANCELLED","CANCELLING","CRASHED","PAUSED","PENDING","SCHEDULED"].includes(s)?s:null}const ht=({flowIds:e,tags:s,posture:n,states:o,time:c})=>{const a=C(n);return t.jsxs("div",{className:"flex flex-wrap gap-1 items-center",children:[t.jsx("span",{children:"When any flow run"}),e.length>0&&t.jsxs(t.Fragment,{children:[t.jsx("span",{children:"of flow"}),e.map((r,i)=>t.jsxs("span",{className:"flex items-center gap-1",children:[t.jsx(Te,{flowId:r}),i===e.length-2&&t.jsx("span",{children:"or"})]},r))]}),s.length>0&&t.jsxs(t.Fragment,{children:[t.jsx("span",{children:"with the tag"}),t.jsx(ke,{tags:s})]}),t.jsx("span",{children:a}),o.length>0?o.map(r=>{const i=ft(r);return i?t.jsx(K,{type:i},r):null}):t.jsx("span",{children:"any state"}),n==="Proactive"&&c!==void 0&&c>0&&t.jsxs("span",{children:["for ",Ae(c)]})]})},xt=({trigger:e})=>{const s=e.triggers?.length??0;return t.jsx("div",{className:"flex flex-wrap gap-1 items-center",children:t.jsxs(u,{variant:"bodySmall",children:["A sequence trigger with ",s," nested"," ",s===1?"trigger":"triggers"," that must fire in order"]})})},yt=e=>{switch(e){case"READY":return"Ready";case"NOT_READY":return"Not Ready";case"PAUSED":return"Paused"}},jt=({workPoolName:e})=>t.jsxs(m,{to:"/work-pools/work-pool/$workPoolName",params:{workPoolName:e},className:"inline-flex items-center gap-1",children:[t.jsx(j,{id:"Cpu",className:"size-4"}),e]}),wt=e=>e.length===0?null:e.map((s,n)=>t.jsxs("span",{className:"inline-flex items-center gap-1",children:[t.jsx(jt,{workPoolName:s.name}),n===e.length-2&&" or ",n<e.length-2&&", "]},s.id)),kt=({workPoolIds:e,posture:s,status:n,time:o})=>{const{data:c=[]}=re(G({offset:0,work_pools:{id:{any_:e},operator:"and_"}},{enabled:e.length>0})),a=s==="Reactive"?"enters":"stays in",r=yt(n).toLowerCase(),i=e.length===0?"any work pool":`${_(e.length,"work pool")} `;return t.jsxs("div",{className:"flex flex-wrap gap-1 items-center",children:[t.jsx("span",{children:"When"}),t.jsx("span",{children:i}),e.length>0&&wt(c),t.jsx("span",{children:a}),t.jsx("span",{children:r}),s==="Proactive"&&o!==void 0&&t.jsxs("span",{children:["for ",v(o)]})]})},At=e=>t.jsx(Y.Suspense,{fallback:t.jsx(N,{className:"h-4 w-full"}),children:t.jsx(_t,{...e})}),_t=({workQueueIds:e,workPoolNames:s,posture:n,status:o,time:c})=>{const a=e.length===0,r=s.length===0,l=ae({queries:e.map(d=>_e(d))}).map(d=>d.data);return t.jsxs("div",{className:"flex flex-wrap gap-1 items-center text-sm",children:[t.jsx("span",{children:"When"}),a?t.jsx("span",{children:"any work queue"}):t.jsxs(t.Fragment,{children:[t.jsx("span",{children:_(l.length,"work queue")}),l.map((d,y)=>t.jsxs("span",{className:"flex items-center gap-1",children:[t.jsx(Ee,{workPoolName:d.work_pool_name??"",workQueueName:d.name,showLabel:!0,showStatus:!0}),y===l.length-2&&t.jsx("span",{children:"or"})]},d.id))]}),!r&&t.jsxs(t.Fragment,{children:[t.jsxs("span",{children:["from the ",_(s.length,"work pool")]}),s.map((d,y)=>t.jsxs("span",{className:"flex items-center gap-1",children:[t.jsx(Ne,{workPoolName:d}),y===s.length-2&&t.jsx("span",{children:"or"})]},d))]}),t.jsx("span",{children:C(n)}),t.jsx("span",{children:dt(o).toLowerCase()}),n==="Proactive"&&c!==void 0&&t.jsxs("span",{children:["for ",v(c)]})]})};function X(e){return e==null?[]:Array.isArray(e)?e:[e]}function L(e,s){const n=e.match;if(n&&typeof n=="object")return n[s]}function Z(e,s){const n=e.match_related;if(!n)return[];const o=Array.isArray(n)?n:[n],c=[];for(const a of o)if(a&&typeof a=="object"){const r=a[s];r&&c.push(...X(r))}return c}function h(e,s){if(s==null)return[];const n=X(s);return n.includes(`${e}.*`)?[]:n.filter(o=>o.startsWith(e)).map(o=>o.split(`${e}.`)[1]??"").filter(o=>o!==""&&o!=="*")}function $(e){return e.includes("prefect.flow-run.*")?[]:e.filter(s=>s.startsWith("prefect.flow-run.")).map(s=>s.split("prefect.flow-run.")[1]??"").filter(s=>s!=="")}function Dt(e){const s=Z(e,"prefect.resource.id"),n=h("prefect.flow",s),o=h("prefect.tag",s),c=e.posture,a=$(c==="Reactive"?e.expect??[]:e.after??[]);return{flowIds:n,tags:o,posture:c,states:a,time:e.within}}const U={"prefect.deployment.ready":"ready","prefect.deployment.not-ready":"not_ready","prefect.deployment.disabled":"not_ready"};function bt(e){const s=L(e,"prefect.resource.id"),n=h("prefect.deployment",s),o=e.posture,c=o==="Reactive"?e.expect:e.after;let a="ready";for(const r of c??[])if(r in U){a=U[r];break}return{deploymentIds:n,posture:o,status:a,time:e.within}}const F={"prefect.work-pool.ready":"READY","prefect.work-pool.not-ready":"NOT_READY","prefect.work-pool.not_ready":"NOT_READY","prefect.work-pool.paused":"PAUSED"};function gt(e){const s=L(e,"prefect.resource.id"),n=h("prefect.work-pool",s),o=e.posture,c=o==="Reactive"?e.expect:e.after;let a="READY";for(const r of c??[])if(r in F){a=F[r];break}return{workPoolIds:n,posture:o,status:a,time:e.within}}const V={"prefect.work-queue.ready":"READY","prefect.work-queue.not-ready":"NOT_READY","prefect.work-queue.paused":"PAUSED"};function St(e){const s=L(e,"prefect.resource.id"),n=h("prefect.work-queue",s),o=Z(e,"prefect.resource.id"),c=h("prefect.work-pool",o),a=e.posture,r=a==="Reactive"?e.expect:e.after;let i="READY";for(const l of r??[])if(l in V){i=V[l];break}return{workQueueIds:n,workPoolNames:c,posture:a,status:i,time:e.within}}const Tt=({trigger:e})=>{if(Ze(e))return t.jsx(Ge,{trigger:e});if(et(e))return t.jsx(xt,{trigger:e});if(!p(e))return t.jsx(q,{});switch(ut(e)){case"flow-run-state":return t.jsx(ht,{...Dt(e)});case"deployment-status":return t.jsx(mt,{...bt(e)});case"work-pool-status":return t.jsx(kt,{...gt(e)});case"work-queue-status":return t.jsx(At,{...St(e)});default:return t.jsx(q,{})}},Lt=({automation:e})=>t.jsxs("div",{className:"flex flex-col gap-1",children:[t.jsx(u,{className:"text-muted-foreground",variant:"bodySmall",children:"Description"}),t.jsx(u,{className:"text-muted-foreground",children:e.description||"None"})]}),Pt=({automation:e})=>{const{trigger:s}=e;return t.jsxs("div",{className:"flex flex-col gap-1",children:[t.jsx(u,{children:"Trigger"}),t.jsx(Tt,{trigger:s})]})},Wt=({automation:e})=>{const{data:s,loading:n}=We(e),{automationsMap:o,blockDocumentsMap:c,deploymentsMap:a,workPoolsMap:r,workQueuesMap:i}=s;return t.jsxs("div",{className:"flex flex-col gap-1",children:[t.jsx(u,{children:_(e.actions.length,"Action")}),t.jsx("ul",{className:"flex flex-col gap-2",children:n?Array.from({length:e.actions.length},(l,d)=>t.jsx(B,{className:"p-4",children:t.jsx(N,{className:"p-2 h-2 w-full"})},d)):e.actions.map(l=>t.jsx("li",{children:t.jsx(Me,{action:l,automationsMap:o,blockDocumentsMap:c,deploymentsMap:a,workPoolsMap:r,workQueuesMap:i})},l.type))})]})},qt=({automation:e})=>{const{updateAutomation:s}=De(),n=(o,c)=>{s({enabled:o,id:c},{onSuccess:()=>{D.success(`Automation ${o?"enabled":"disabled"}`)},onError:a=>{const r=a.message||"Unknown error while updating automation";console.error(r)}})};return t.jsx(be,{"aria-label":"toggle automation",checked:e.enabled,onCheckedChange:o=>n(o,e.id)})},Qt=({id:e,onDelete:s})=>{const n=o=>{navigator.clipboard.writeText(o),D.success("ID copied")};return t.jsxs(ve,{children:[t.jsx(Re,{asChild:!0,children:t.jsxs(H,{variant:"outline",className:"size-8 p-0",children:[t.jsx("span",{className:"sr-only",children:"Open menu"}),t.jsx(j,{id:"MoreVertical",className:"size-4"})]})}),t.jsxs(Ce,{align:"end",children:[t.jsx(Le,{children:"Actions"}),t.jsx(k,{onClick:()=>n(e),children:"Copy ID"}),t.jsx(k,{asChild:!0,children:t.jsx(m,{to:"/automations/automation/$id/edit",params:{id:e},children:"Edit"})}),t.jsx(k,{onClick:s,children:"Delete"}),t.jsx(k,{asChild:!0,children:t.jsxs("a",{href:ge["automations-guide"],className:"flex items-center",children:["Documentation ",t.jsx(j,{id:"ExternalLink",className:"ml-2 size-4"})]})})]})]})},It=()=>{const e=ce(),[s,n]=Pe(),{deleteAutomation:o}=Se();return[s,(a,{shouldNavigate:r=!1}={})=>n({title:"Delete Automation",description:`Are you sure you want to delete ${a.name}?`,onConfirm:()=>{o(a.id,{onSuccess:()=>{D.success("Automation deleted"),r&&e({to:"/automations"})},onError:i=>{const l=i.message||"Unknown error while deleting automation.";D.error(l),console.error(l)}})}})]};export{qt as A,Qt as a,Lt as b,Pt as c,Wt as d,It as u};
|
|
2
|
-
//# sourceMappingURL=use-delete-automation-confirmation-dialog-
|
|
1
|
+
import{t as z,j as t,L as m,r as Y,p as oe,s as re,E as ae,u as ce}from"./vendor-tanstack-BK8oseNA.js";import{bp as ie,cP as le,M as G,d2 as ue,d5 as de,C as B,al as u,aq as K,I as j,_ as pe,bh as me,q as H,f as fe,$ as he,a0 as xe,a1 as ye,L as je,b5 as N,cg as we,d8 as v,X as ke,ch as Ae,N as _,d6 as _e,d9 as De,G as be,y as D,bA as ge,da as Se}from"./index-Cd7pM9pk.js";import{F as Te,W as Ee,a as Ne}from"./work-queue-icon-text-D_G_UCJX.js";import{D as ve,a as Re,b as Ce,c as Le,d as k}from"./dropdown-menu-iS8iJMpx.js";import{u as Pe}from"./use-delete-confirmation-dialog-CvQEyyhU.js";const We=e=>{const{automationIds:s,blockDocumentIds:n,deploymentIds:o,workPoolIds:c,workQueueIds:a}=Qe(e.actions),{data:r,loading:i}=qe(Array.from(s)),l=z({queries:[ie({offset:0,sort:"BLOCK_TYPE_AND_NAME_ASC",include_secrets:!1,block_documents:{operator:"and_",id:{any_:Array.from(n)},is_anonymous:{}}},{enabled:n.size>0}),le({offset:0,sort:"CREATED_DESC",deployments:{id:{any_:Array.from(o)},operator:"and_"}},{enabled:o.size>0}),G({offset:0,work_pools:{id:{any_:Array.from(c)},operator:"and_"}},{enabled:c.size>0}),ue({offset:0,work_queues:{id:{any_:Array.from(a)},operator:"and_"}},{enabled:a.size>0})],combine:d=>{const[y,ee,te,se]=d;return{data:{blockDocuments:y.data,deployments:ee.data,workPools:te.data,workQueues:se.data},loading:d.some(ne=>ne.isLoading)}}});return{loading:i||l.loading,data:{automationsMap:r,blockDocumentsMap:A(l.data.blockDocuments),deploymentsMap:A(l.data.deployments),workPoolsMap:A(l.data.workPools),workQueuesMap:A(l.data.workQueues)}}},qe=e=>z({queries:Array.from(e).map(s=>de(s)),combine:s=>{const n=new Map;for(const o of s)o.data&&n.set(o.data.id,o.data);return{data:n,loading:s.some(o=>o.isLoading)}}}),Qe=e=>{const s=new Set,n=new Set,o=new Set,c=new Set,a=new Set;for(const r of e)switch(r.type){case"run-deployment":case"pause-deployment":case"resume-deployment":r.deployment_id&&o.add(r.deployment_id);break;case"pause-work-queue":case"resume-work-queue":r.work_queue_id&&a.add(r.work_queue_id);break;case"pause-automation":case"resume-automation":r.automation_id&&s.add(r.automation_id);break;case"pause-work-pool":case"resume-work-pool":r.work_pool_id&&c.add(r.work_pool_id);break;case"send-notification":case"call-webhook":r.block_document_id&&n.add(r.block_document_id);break}return{automationIds:s,blockDocumentIds:n,deploymentIds:o,workPoolIds:c,workQueueIds:a}};function A(e){const s=new Map;for(const n of e??[])s.set(n.id,n);return s}const Ie={"cancel-flow-run":"Cancel flow run","suspend-flow-run":"Suspend flow run","resume-flow-run":"Resume a flow run","change-flow-run-state":"Change state of a flow run","run-deployment":"Run deployment","pause-deployment":"Pause deployment","resume-deployment":"Resume deployment","pause-work-queue":"Pause work queue","resume-work-queue":"Resume work queue","pause-work-pool":"Pause work pool","resume-work-pool":"Resume work pool","pause-automation":"Pause automation","resume-automation":"Resume automation","call-webhook":"Call a custom webhook notification","send-notification":"Send a notification using","do-nothing":"Do nothing"},Me=({action:e,automationsMap:s,blockDocumentsMap:n,deploymentsMap:o,workPoolsMap:c,workQueuesMap:a})=>t.jsx(B,{className:"p-4",children:t.jsx($e,{action:e,automationsMap:s,blockDocumentsMap:n,deploymentsMap:o,workPoolsMap:c,workQueuesMap:a})}),$e=({action:e,automationsMap:s,blockDocumentsMap:n,deploymentsMap:o,workPoolsMap:c,workQueuesMap:a})=>{const r=Ie[e.type];switch(e.type){case"cancel-flow-run":case"suspend-flow-run":case"resume-flow-run":case"call-webhook":case"do-nothing":return t.jsx(Oe,{label:r});case"run-deployment":if(e.deployment_id&&e.source==="selected"){const i=o.get(e.deployment_id);return i?t.jsx(P,{label:r,deployment:i,parameters:e.parameters,job_variables:e.job_variables}):t.jsx(u,{children:"Deployment not found"})}return t.jsx(f,{label:r});case"pause-deployment":case"resume-deployment":if(e.deployment_id&&e.source==="selected"){const i=o.get(e.deployment_id);return i?t.jsx(P,{label:r,deployment:i}):t.jsx(u,{children:"Deployment not found"})}return t.jsx(f,{label:r});case"pause-work-queue":case"resume-work-queue":if(e.work_queue_id&&e.source==="selected"){const i=a.get(e.work_queue_id);return i?t.jsx(Ye,{label:r,workQueue:i}):t.jsx(u,{children:"Work queue not found"})}return t.jsx(f,{label:r});case"pause-automation":case"resume-automation":if(e.automation_id&&e.source==="selected"){const i=s.get(e.automation_id);return i?t.jsx(Fe,{label:r,automation:i}):t.jsx(u,{children:"Automation not found"})}return t.jsx(f,{label:r});case"pause-work-pool":case"resume-work-pool":if(e.work_pool_id&&e.source==="selected"){const i=c.get(e.work_pool_id);return i?t.jsx(ze,{label:r,workPool:i}):t.jsx(u,{children:"Workpool not found"})}return t.jsx(f,{label:r});case"send-notification":{const i=n.get(e.block_document_id);return i?t.jsx(Ve,{label:r,blockDocument:i}):t.jsx(u,{children:"Block document not found"})}case"change-flow-run-state":return t.jsx(Ue,{label:r,type:e.state,name:e.name});default:return null}},x=({children:e})=>t.jsx("div",{className:"text-sm flex items-center gap-1",children:e}),w=({iconId:e,name:s})=>t.jsxs("div",{className:"text-xs flex items-center",children:[t.jsx(j,{id:e,className:"size-4 mr-1"}),s]}),Oe=({label:e})=>t.jsxs(u,{variant:"bodySmall",children:[e," from the triggering event"]}),f=({label:e})=>t.jsxs(u,{variant:"bodySmall",children:[e," inferred from the triggering event"]}),Ue=({label:e,type:s,name:n})=>t.jsxs(x,{children:[t.jsx(f,{label:e})," to ",t.jsx(K,{type:s,name:n})]}),P=({label:e,deployment:s,parameters:n,job_variables:o})=>t.jsxs(x,{children:[t.jsxs("label",{htmlFor:`${e}-${s.id}`,children:[e,":"]}),t.jsx(m,{to:"/deployments/deployment/$id",params:{id:s.id},"aria-label":s.name,children:t.jsx(w,{iconId:"Rocket",name:s.name})}),n!==void 0&&t.jsx(W,{title:"Parameters",payload:n}),o!==void 0&&t.jsx(W,{title:"Job Variables",payload:o})]}),W=({title:e,payload:s})=>t.jsxs(pe,{children:[t.jsx(me,{asChild:!0,children:t.jsxs(H,{variant:"secondary",size:"sm",children:["Show ",fe(e)]})}),t.jsxs(he,{"aria-describedby":void 0,children:[t.jsx(xe,{children:t.jsx(ye,{children:e})}),t.jsx(je,{value:JSON.stringify(s),disabled:!0})]})]}),Fe=({label:e,automation:s})=>t.jsxs(x,{children:[t.jsxs("label",{htmlFor:`${e}-${s.id}`,children:[e,":"]}),t.jsx(m,{to:"/automations/automation/$id",params:{id:s.id},"aria-label":s.name,children:t.jsx(w,{iconId:"Bot",name:s.name})})]}),Ve=({label:e,blockDocument:s})=>{if(!s.name)return t.jsx(u,{children:"Block not found"});const n=s.block_type_name?`Send a ${s.block_type_name.toLowerCase()} using`:e;return t.jsxs(x,{children:[t.jsx("label",{htmlFor:`${e}-${s.id}`,children:n}),t.jsx(m,{to:"/blocks/block/$id",params:{id:s.id},"aria-label":s.name,children:t.jsx(w,{iconId:"Box",name:s.name})})]})},ze=({label:e,workPool:s})=>t.jsxs(x,{children:[t.jsxs("label",{htmlFor:`${e}-${s.id}`,children:[e,":"]}),t.jsx(m,{to:"/work-pools/work-pool/$workPoolName",params:{workPoolName:s.name},"aria-label":s.name,children:t.jsx(w,{iconId:"Cpu",name:s.name})})]}),Ye=({label:e,workQueue:s})=>t.jsxs(x,{children:[t.jsxs("label",{htmlFor:`${e}-${s.id}`,children:[e,":"]}),t.jsx(m,{to:"/work-pools/work-pool/$workPoolName/queue/$workQueueName",params:{workPoolName:s.name,workQueueName:s.name},"aria-label":s.name,children:t.jsx(w,{iconId:"Cpu",name:s.name})})]}),Ge=({trigger:e})=>{const s=e.triggers?.length??0,n=e.require;let o;return n==="all"?o="all":n==="any"?o="any":typeof n=="number"?o=`at least ${n}`:o="all",t.jsx("div",{className:"flex flex-wrap gap-1 items-center",children:t.jsxs(u,{variant:"bodySmall",children:["A compound trigger requiring ",o," of ",s," nested"," ",s===1?"trigger":"triggers"," to fire"]})})},q=()=>t.jsx(u,{variant:"bodySmall",children:"A custom trigger"}),Be=({deploymentId:e})=>t.jsx(Y.Suspense,{fallback:t.jsx(N,{className:"h-4 w-full"}),children:t.jsx(Ke,{deploymentId:e})}),Ke=({deploymentId:e})=>{const{data:s}=oe(we(e));return t.jsxs("div",{className:"flex items-center gap-1 text-xs",children:["Deployment",t.jsxs(m,{to:"/deployments/deployment/$id",params:{id:s.id},className:"flex items-center gap-1",children:[t.jsx(j,{id:"Rocket",className:"size-4"}),s.name]})]})},b=1,He=["prefect.deployment.ready","prefect.deployment.not-ready","prefect.deployment.disabled"],Je=["prefect.work-pool.ready","prefect.work-pool.not-ready","prefect.work-pool.paused","prefect.work-pool.not_ready"],Xe=["prefect.work-queue.ready","prefect.work-queue.not-ready","prefect.work-queue.paused"];function R(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function p(e){return R(e)&&e.type==="event"&&(e.posture==="Reactive"||e.posture==="Proactive")}function Ze(e){return R(e)&&e.type==="compound"&&Array.isArray(e.triggers)}function et(e){return R(e)&&e.type==="sequence"&&Array.isArray(e.triggers)}function J(e){return e==null?[]:Array.isArray(e)?e:[e]}function tt(e,s){if(p(e)){const n=e.match;if(n&&typeof n=="object"){const o=n[s];return o?J(o):[]}}return[]}function g(e,s){const n=tt(e,"prefect.resource.id");return n.length===0?!1:s(n)}function S(e,s){return p(e)?(e.for_each??[]).every(o=>o.startsWith(s)):!1}function T(e,s){return p(e)?s(e.after??[]):!1}function E(e,s){return p(e)?s(e.expect??[]):!1}function Q(e){return He.includes(e)}function I(e){return Je.includes(e)}function M(e){return Xe.includes(e)}function st(e){return p(e)&&g(e,s=>s.every(n=>n.startsWith("prefect.deployment")))&&S(e,"prefect.resource.id")&&T(e,s=>s.every(n=>Q(n)))&&E(e,s=>s.every(n=>Q(n)))&&e.threshold===b}function nt(e,s){const n=e.match_related;if(!n)return[];const o=Array.isArray(n)?n:[n],c=[];for(const a of o)if(a&&typeof a=="object"){const r=a[s];r&&c.push(...J(r))}return c}function ot(e){const s=e.match_related;return s?Array.isArray(s)?s.length===0:Object.keys(s).length===0:!0}function $(e,s){const n=nt(e,"prefect.resource.id");return n.length===0?!1:n.every(o=>o.startsWith(s))}function rt(e){return ot(e)||$(e,"prefect.flow")||$(e,"prefect.tag")}function at(e){return p(e)&&g(e,s=>s.every(n=>n.startsWith("prefect.flow-run")))&&S(e,"prefect.resource.id")&&T(e,s=>s.every(n=>n.startsWith("prefect.flow-run")))&&E(e,s=>s.every(n=>n.startsWith("prefect.flow-run")))&&rt(e)&&e.threshold===b}function ct(e){return p(e)&&g(e,s=>s.every(n=>n.startsWith("prefect.work-pool")))&&S(e,"prefect.resource.id")&&T(e,s=>s.every(n=>I(n)))&&E(e,s=>s.every(n=>I(n)))&&e.threshold===b}function it(e){return p(e)&&g(e,s=>s.every(n=>n.startsWith("prefect.work-queue")))&&S(e,"prefect.resource.id")&&T(e,s=>s.every(n=>M(n)))&&E(e,s=>s.every(n=>M(n)))&&e.threshold===b}const lt={"deployment-status":st,"flow-run-state":at,"work-pool-status":ct,"work-queue-status":it};function ut(e){for(const[s,n]of Object.entries(lt))if(n(e))return s;return"custom"}function C(e){switch(e){case"Reactive":return"enters";case"Proactive":return"stays in"}}function dt(e){switch(e){case"READY":return"Ready";case"NOT_READY":return"Not Ready";case"PAUSED":return"Paused";default:{const s=e;throw new Error(`getWorkQueueStatusLabel missing case for ${s}`)}}}function pt(e){switch(e){case"ready":return"ready";case"not_ready":return"not ready"}}const mt=({deploymentIds:e,posture:s,status:n,time:o})=>{const c=e.length===0,a=C(s),r=pt(n);return t.jsxs("div",{className:"flex flex-wrap gap-1 items-center",children:[t.jsx("span",{children:"When"}),c?t.jsx("span",{children:"any deployment"}):e.map((i,l)=>t.jsxs("span",{className:"flex items-center gap-1",children:[t.jsx(Be,{deploymentId:i}),l===e.length-2&&t.jsx("span",{children:"or"})]},i)),t.jsx("span",{children:a}),t.jsx("span",{children:r}),s==="Proactive"&&o!==void 0&&o>0&&t.jsxs("span",{children:["for ",v(o)]})]})};function ft(e){const s=e.toUpperCase();return["COMPLETED","FAILED","RUNNING","CANCELLED","CANCELLING","CRASHED","PAUSED","PENDING","SCHEDULED"].includes(s)?s:null}const ht=({flowIds:e,tags:s,posture:n,states:o,time:c})=>{const a=C(n);return t.jsxs("div",{className:"flex flex-wrap gap-1 items-center",children:[t.jsx("span",{children:"When any flow run"}),e.length>0&&t.jsxs(t.Fragment,{children:[t.jsx("span",{children:"of flow"}),e.map((r,i)=>t.jsxs("span",{className:"flex items-center gap-1",children:[t.jsx(Te,{flowId:r}),i===e.length-2&&t.jsx("span",{children:"or"})]},r))]}),s.length>0&&t.jsxs(t.Fragment,{children:[t.jsx("span",{children:"with the tag"}),t.jsx(ke,{tags:s})]}),t.jsx("span",{children:a}),o.length>0?o.map(r=>{const i=ft(r);return i?t.jsx(K,{type:i},r):null}):t.jsx("span",{children:"any state"}),n==="Proactive"&&c!==void 0&&c>0&&t.jsxs("span",{children:["for ",Ae(c)]})]})},xt=({trigger:e})=>{const s=e.triggers?.length??0;return t.jsx("div",{className:"flex flex-wrap gap-1 items-center",children:t.jsxs(u,{variant:"bodySmall",children:["A sequence trigger with ",s," nested"," ",s===1?"trigger":"triggers"," that must fire in order"]})})},yt=e=>{switch(e){case"READY":return"Ready";case"NOT_READY":return"Not Ready";case"PAUSED":return"Paused"}},jt=({workPoolName:e})=>t.jsxs(m,{to:"/work-pools/work-pool/$workPoolName",params:{workPoolName:e},className:"inline-flex items-center gap-1",children:[t.jsx(j,{id:"Cpu",className:"size-4"}),e]}),wt=e=>e.length===0?null:e.map((s,n)=>t.jsxs("span",{className:"inline-flex items-center gap-1",children:[t.jsx(jt,{workPoolName:s.name}),n===e.length-2&&" or ",n<e.length-2&&", "]},s.id)),kt=({workPoolIds:e,posture:s,status:n,time:o})=>{const{data:c=[]}=re(G({offset:0,work_pools:{id:{any_:e},operator:"and_"}},{enabled:e.length>0})),a=s==="Reactive"?"enters":"stays in",r=yt(n).toLowerCase(),i=e.length===0?"any work pool":`${_(e.length,"work pool")} `;return t.jsxs("div",{className:"flex flex-wrap gap-1 items-center",children:[t.jsx("span",{children:"When"}),t.jsx("span",{children:i}),e.length>0&&wt(c),t.jsx("span",{children:a}),t.jsx("span",{children:r}),s==="Proactive"&&o!==void 0&&t.jsxs("span",{children:["for ",v(o)]})]})},At=e=>t.jsx(Y.Suspense,{fallback:t.jsx(N,{className:"h-4 w-full"}),children:t.jsx(_t,{...e})}),_t=({workQueueIds:e,workPoolNames:s,posture:n,status:o,time:c})=>{const a=e.length===0,r=s.length===0,l=ae({queries:e.map(d=>_e(d))}).map(d=>d.data);return t.jsxs("div",{className:"flex flex-wrap gap-1 items-center text-sm",children:[t.jsx("span",{children:"When"}),a?t.jsx("span",{children:"any work queue"}):t.jsxs(t.Fragment,{children:[t.jsx("span",{children:_(l.length,"work queue")}),l.map((d,y)=>t.jsxs("span",{className:"flex items-center gap-1",children:[t.jsx(Ee,{workPoolName:d.work_pool_name??"",workQueueName:d.name,showLabel:!0,showStatus:!0}),y===l.length-2&&t.jsx("span",{children:"or"})]},d.id))]}),!r&&t.jsxs(t.Fragment,{children:[t.jsxs("span",{children:["from the ",_(s.length,"work pool")]}),s.map((d,y)=>t.jsxs("span",{className:"flex items-center gap-1",children:[t.jsx(Ne,{workPoolName:d}),y===s.length-2&&t.jsx("span",{children:"or"})]},d))]}),t.jsx("span",{children:C(n)}),t.jsx("span",{children:dt(o).toLowerCase()}),n==="Proactive"&&c!==void 0&&t.jsxs("span",{children:["for ",v(c)]})]})};function X(e){return e==null?[]:Array.isArray(e)?e:[e]}function L(e,s){const n=e.match;if(n&&typeof n=="object")return n[s]}function Z(e,s){const n=e.match_related;if(!n)return[];const o=Array.isArray(n)?n:[n],c=[];for(const a of o)if(a&&typeof a=="object"){const r=a[s];r&&c.push(...X(r))}return c}function h(e,s){if(s==null)return[];const n=X(s);return n.includes(`${e}.*`)?[]:n.filter(o=>o.startsWith(e)).map(o=>o.split(`${e}.`)[1]??"").filter(o=>o!==""&&o!=="*")}function O(e){return e.includes("prefect.flow-run.*")?[]:e.filter(s=>s.startsWith("prefect.flow-run.")).map(s=>s.split("prefect.flow-run.")[1]??"").filter(s=>s!=="")}function Dt(e){const s=Z(e,"prefect.resource.id"),n=h("prefect.flow",s),o=h("prefect.tag",s),c=e.posture,a=O(c==="Reactive"?e.expect??[]:e.after??[]);return{flowIds:n,tags:o,posture:c,states:a,time:e.within}}const U={"prefect.deployment.ready":"ready","prefect.deployment.not-ready":"not_ready","prefect.deployment.disabled":"not_ready"};function bt(e){const s=L(e,"prefect.resource.id"),n=h("prefect.deployment",s),o=e.posture,c=o==="Reactive"?e.expect:e.after;let a="ready";for(const r of c??[])if(r in U){a=U[r];break}return{deploymentIds:n,posture:o,status:a,time:e.within}}const F={"prefect.work-pool.ready":"READY","prefect.work-pool.not-ready":"NOT_READY","prefect.work-pool.not_ready":"NOT_READY","prefect.work-pool.paused":"PAUSED"};function gt(e){const s=L(e,"prefect.resource.id"),n=h("prefect.work-pool",s),o=e.posture,c=o==="Reactive"?e.expect:e.after;let a="READY";for(const r of c??[])if(r in F){a=F[r];break}return{workPoolIds:n,posture:o,status:a,time:e.within}}const V={"prefect.work-queue.ready":"READY","prefect.work-queue.not-ready":"NOT_READY","prefect.work-queue.paused":"PAUSED"};function St(e){const s=L(e,"prefect.resource.id"),n=h("prefect.work-queue",s),o=Z(e,"prefect.resource.id"),c=h("prefect.work-pool",o),a=e.posture,r=a==="Reactive"?e.expect:e.after;let i="READY";for(const l of r??[])if(l in V){i=V[l];break}return{workQueueIds:n,workPoolNames:c,posture:a,status:i,time:e.within}}const Tt=({trigger:e})=>{if(Ze(e))return t.jsx(Ge,{trigger:e});if(et(e))return t.jsx(xt,{trigger:e});if(!p(e))return t.jsx(q,{});switch(ut(e)){case"flow-run-state":return t.jsx(ht,{...Dt(e)});case"deployment-status":return t.jsx(mt,{...bt(e)});case"work-pool-status":return t.jsx(kt,{...gt(e)});case"work-queue-status":return t.jsx(At,{...St(e)});default:return t.jsx(q,{})}},Lt=({automation:e})=>t.jsxs("div",{className:"flex flex-col gap-1",children:[t.jsx(u,{className:"text-muted-foreground",variant:"bodySmall",children:"Description"}),t.jsx(u,{className:"text-muted-foreground",children:e.description||"None"})]}),Pt=({automation:e})=>{const{trigger:s}=e;return t.jsxs("div",{className:"flex flex-col gap-1",children:[t.jsx(u,{children:"Trigger"}),t.jsx(Tt,{trigger:s})]})},Wt=({automation:e})=>{const{data:s,loading:n}=We(e),{automationsMap:o,blockDocumentsMap:c,deploymentsMap:a,workPoolsMap:r,workQueuesMap:i}=s;return t.jsxs("div",{className:"flex flex-col gap-1",children:[t.jsx(u,{children:_(e.actions.length,"Action")}),t.jsx("ul",{className:"flex flex-col gap-2",children:n?Array.from({length:e.actions.length},(l,d)=>t.jsx(B,{className:"p-4",children:t.jsx(N,{className:"p-2 h-2 w-full"})},d)):e.actions.map(l=>t.jsx("li",{children:t.jsx(Me,{action:l,automationsMap:o,blockDocumentsMap:c,deploymentsMap:a,workPoolsMap:r,workQueuesMap:i})},l.type))})]})},qt=({automation:e})=>{const{updateAutomation:s}=De(),n=(o,c)=>{s({enabled:o,id:c},{onSuccess:()=>{D.success(`Automation ${o?"enabled":"disabled"}`)},onError:a=>{const r=a.message||"Unknown error while updating automation";console.error(r)}})};return t.jsx(be,{"aria-label":"toggle automation",checked:e.enabled,onCheckedChange:o=>n(o,e.id)})},Qt=({id:e,onDelete:s})=>{const n=o=>{navigator.clipboard.writeText(o),D.success("ID copied")};return t.jsxs(ve,{children:[t.jsx(Re,{asChild:!0,children:t.jsxs(H,{variant:"outline",className:"size-8 p-0",children:[t.jsx("span",{className:"sr-only",children:"Open menu"}),t.jsx(j,{id:"MoreVertical",className:"size-4"})]})}),t.jsxs(Ce,{align:"end",children:[t.jsx(Le,{children:"Actions"}),t.jsx(k,{onClick:()=>n(e),children:"Copy ID"}),t.jsx(k,{asChild:!0,children:t.jsx(m,{to:"/automations/automation/$id/edit",params:{id:e},children:"Edit"})}),t.jsx(k,{onClick:s,children:"Delete"}),t.jsx(k,{asChild:!0,children:t.jsxs("a",{href:ge["automations-guide"],className:"flex items-center",children:["Documentation ",t.jsx(j,{id:"ExternalLink",className:"ml-2 size-4"})]})})]})]})},It=()=>{const e=ce(),[s,n]=Pe(),{deleteAutomation:o}=Se();return[s,(a,{shouldNavigate:r=!1}={})=>n({title:"Delete Automation",description:`Are you sure you want to delete ${a.name}?`,onConfirm:()=>{o(a.id,{onSuccess:()=>{D.success("Automation deleted"),r&&e({to:"/automations"})},onError:i=>{const l=i.message||"Unknown error while deleting automation.";D.error(l),console.error(l)}})}})]};export{qt as A,Qt as a,Lt as b,Pt as c,Wt as d,It as u};
|
|
2
|
+
//# sourceMappingURL=use-delete-automation-confirmation-dialog-BpBSjz60.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-delete-automation-confirmation-dialog-eOWJYPkD.js","sources":["../../src/api/automations/use-get-automation-action-resources/use-get-automation-action-resources.ts","../../src/components/automations/action-details/action-details.tsx","../../src/components/automations/trigger-details/trigger-details-compound.tsx","../../src/components/automations/trigger-details/trigger-details-custom.tsx","../../src/components/deployments/deployment-link.tsx","../../src/components/automations/trigger-details/trigger-utils.ts","../../src/components/automations/trigger-details/trigger-details-deployment-status.tsx","../../src/components/automations/trigger-details/trigger-details-flow-run-state.tsx","../../src/components/automations/trigger-details/trigger-details-sequence.tsx","../../src/components/automations/trigger-details/trigger-details-work-pool-status.tsx","../../src/components/automations/trigger-details/trigger-details-work-queue-status.tsx","../../src/components/automations/trigger-details/trigger-details.tsx","../../src/components/automations/automation-details.tsx","../../src/components/automations/automation-enable-toggle/automation-enable-toggle.tsx","../../src/components/automations/automations-actions-menu/automations-actions-menu.tsx","../../src/components/automations/use-delete-automation-confirmation-dialog.ts"],"sourcesContent":["import { useQueries } from \"@tanstack/react-query\";\nimport { type Automation, buildGetAutomationQuery } from \"@/api/automations\";\nimport { buildListFilterBlockDocumentsQuery } from \"@/api/block-documents\";\nimport { buildFilterDeploymentsQuery } from \"@/api/deployments\";\nimport { buildFilterWorkPoolsQuery } from \"@/api/work-pools\";\nimport { buildFilterWorkQueuesQuery } from \"@/api/work-queues\";\n\n/**\n *\n * @param automation\n * @returns an object of maps to get information about an action's selected source (automations, deployments, work pools, and work queues)\n *\n * @example\n * ```ts\n * const { loading, data } = useGetAutomationActionResources(MY_AUTOMATION);\n *\n *\n * if (loading) {\n * return \"Loading...\"\n * }\n *\n * const { automationsMap, blockDocumentsMap, deploymentsMap, workPoolsMap, workQueuesMap } = data\n * return (\n * \t\t<ActionDetails\n *\t\t\tautomation={MY_AUTOMATION}\n *\t\t\tautomations={automationsMap}\n *\t\t\tblockDocumentsMap={blockDocumentsMap}\n *\t\t\tdeployments={deploymentsMap}\n *\t\t\tworkPools={workPoolsMap}\n *\t\t\tworkQueues={workQueuesMap}\n *\t\t/>)\n * ```\n */\nexport const useGetAutomationActionResources = (automation: Automation) => {\n\tconst {\n\t\tautomationIds,\n\t\tblockDocumentIds,\n\t\tdeploymentIds,\n\t\tworkPoolIds,\n\t\tworkQueueIds,\n\t} = getResourceSets(automation.actions);\n\n\t// nb: Automations /filter doesn't support `id`. Need to do it per GET call\n\tconst { data: automationsData, loading: automationsLoading } =\n\t\tuseListAutomationsQueries(Array.from(automationIds));\n\n\t// Need to do deployments filter API\n\tconst remainingQueries = useQueries({\n\t\tqueries: [\n\t\t\tbuildListFilterBlockDocumentsQuery(\n\t\t\t\t{\n\t\t\t\t\toffset: 0,\n\t\t\t\t\tsort: \"BLOCK_TYPE_AND_NAME_ASC\",\n\t\t\t\t\tinclude_secrets: false,\n\t\t\t\t\tblock_documents: {\n\t\t\t\t\t\toperator: \"and_\",\n\t\t\t\t\t\tid: { any_: Array.from(blockDocumentIds) },\n\t\t\t\t\t\tis_anonymous: {},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{ enabled: blockDocumentIds.size > 0 },\n\t\t\t),\n\t\t\tbuildFilterDeploymentsQuery(\n\t\t\t\t{\n\t\t\t\t\toffset: 0,\n\t\t\t\t\tsort: \"CREATED_DESC\",\n\t\t\t\t\tdeployments: {\n\t\t\t\t\t\tid: { any_: Array.from(deploymentIds) },\n\t\t\t\t\t\toperator: \"and_\",\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{ enabled: deploymentIds.size > 0 },\n\t\t\t),\n\t\t\tbuildFilterWorkPoolsQuery(\n\t\t\t\t{\n\t\t\t\t\toffset: 0,\n\t\t\t\t\twork_pools: {\n\t\t\t\t\t\tid: { any_: Array.from(workPoolIds) },\n\t\t\t\t\t\toperator: \"and_\",\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{ enabled: workPoolIds.size > 0 },\n\t\t\t),\n\t\t\tbuildFilterWorkQueuesQuery(\n\t\t\t\t{\n\t\t\t\t\toffset: 0,\n\t\t\t\t\twork_queues: {\n\t\t\t\t\t\tid: { any_: Array.from(workQueueIds) },\n\t\t\t\t\t\toperator: \"and_\",\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{ enabled: workQueueIds.size > 0 },\n\t\t\t),\n\t\t],\n\t\tcombine: (results) => {\n\t\t\tconst [blockDocuments, deployments, workPools, workQueues] = results;\n\t\t\treturn {\n\t\t\t\tdata: {\n\t\t\t\t\tblockDocuments: blockDocuments.data,\n\t\t\t\t\tdeployments: deployments.data,\n\t\t\t\t\tworkPools: workPools.data,\n\t\t\t\t\tworkQueues: workQueues.data,\n\t\t\t\t},\n\t\t\t\tloading: results.some((result) => result.isLoading),\n\t\t\t};\n\t\t},\n\t});\n\n\treturn {\n\t\tloading: automationsLoading || remainingQueries.loading,\n\t\tdata: {\n\t\t\tautomationsMap: automationsData,\n\t\t\tblockDocumentsMap: listToMap(remainingQueries.data.blockDocuments),\n\t\t\tdeploymentsMap: listToMap(remainingQueries.data.deployments),\n\t\t\tworkPoolsMap: listToMap(remainingQueries.data.workPools),\n\t\t\tworkQueuesMap: listToMap(remainingQueries.data.workQueues),\n\t\t},\n\t};\n};\n\nconst useListAutomationsQueries = (automationIds: Array<string>) =>\n\tuseQueries({\n\t\tqueries: Array.from(automationIds).map((automationId) =>\n\t\t\tbuildGetAutomationQuery(automationId),\n\t\t),\n\t\tcombine: (results) => {\n\t\t\tconst retMap = new Map<string, Automation>();\n\t\t\tfor (const result of results) {\n\t\t\t\tif (result.data) {\n\t\t\t\t\tretMap.set(result.data.id, result.data);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn {\n\t\t\t\tdata: retMap,\n\t\t\t\tloading: results.some((result) => result.isLoading),\n\t\t\t};\n\t\t},\n\t});\n\nexport const getResourceSets = (actions: Automation[\"actions\"]) => {\n\tconst automationIds = new Set<string>();\n\tconst blockDocumentIds = new Set<string>();\n\tconst deploymentIds = new Set<string>();\n\tconst workPoolIds = new Set<string>();\n\tconst workQueueIds = new Set<string>();\n\n\tfor (const action of actions) {\n\t\tswitch (action.type) {\n\t\t\tcase \"run-deployment\":\n\t\t\tcase \"pause-deployment\":\n\t\t\tcase \"resume-deployment\":\n\t\t\t\tif (action.deployment_id) {\n\t\t\t\t\tdeploymentIds.add(action.deployment_id);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase \"pause-work-queue\":\n\t\t\tcase \"resume-work-queue\":\n\t\t\t\tif (action.work_queue_id) {\n\t\t\t\t\tworkQueueIds.add(action.work_queue_id);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase \"pause-automation\":\n\t\t\tcase \"resume-automation\":\n\t\t\t\tif (action.automation_id) {\n\t\t\t\t\tautomationIds.add(action.automation_id);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase \"pause-work-pool\":\n\t\t\tcase \"resume-work-pool\":\n\t\t\t\tif (action.work_pool_id) {\n\t\t\t\t\tworkPoolIds.add(action.work_pool_id);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase \"send-notification\":\n\t\t\tcase \"call-webhook\":\n\t\t\t\tif (action.block_document_id) {\n\t\t\t\t\tblockDocumentIds.add(action.block_document_id);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t// TODO: add these back when the corresponding actions are implemented\n\t\t\t// case \"do-nothing\":\n\t\t\t// case \"cancel-flow-run\":\n\t\t\t// case \"change-flow-run-state\":\n\t\t\t// case \"suspend-flow-run\":\n\t\t\t// case \"resume-flow-run\":\n\t\t}\n\t}\n\n\treturn {\n\t\tautomationIds,\n\t\tblockDocumentIds,\n\t\tdeploymentIds,\n\t\tworkPoolIds,\n\t\tworkQueueIds,\n\t};\n};\n\nfunction listToMap<T extends { id: string }>(\n\tlist: T[] | undefined,\n): Map<T[\"id\"], T> {\n\tconst map = new Map<T[\"id\"], T>();\n\tfor (const item of list ?? []) {\n\t\tmap.set(item.id, item);\n\t}\n\treturn map;\n}\n","import { Link } from \"@tanstack/react-router\";\nimport type { Automation } from \"@/api/automations\";\nimport type { BlockDocument } from \"@/api/block-documents\";\nimport type { Deployment } from \"@/api/deployments\";\nimport type { components } from \"@/api/prefect\";\nimport type { WorkPool } from \"@/api/work-pools\";\nimport type { WorkQueue } from \"@/api/work-queues\";\nimport { Button } from \"@/components/ui/button\";\nimport { Card } from \"@/components/ui/card\";\nimport {\n\tDialog,\n\tDialogContent,\n\tDialogHeader,\n\tDialogTitle,\n\tDialogTrigger,\n} from \"@/components/ui/dialog\";\nimport { Icon, type IconId } from \"@/components/ui/icons\";\nimport { LazyJsonInput as JsonInput } from \"@/components/ui/json-input-lazy\";\nimport { StateBadge } from \"@/components/ui/state-badge\";\nimport { Typography } from \"@/components/ui/typography\";\nimport { capitalize } from \"@/utils\";\n\nconst ACTION_TYPE_TO_STRING = {\n\t\"cancel-flow-run\": \"Cancel flow run\",\n\t\"suspend-flow-run\": \"Suspend flow run\",\n\t\"resume-flow-run\": \"Resume a flow run\",\n\t\"change-flow-run-state\": \"Change state of a flow run\",\n\t\"run-deployment\": \"Run deployment\",\n\t\"pause-deployment\": \"Pause deployment\",\n\t\"resume-deployment\": \"Resume deployment\",\n\t\"pause-work-queue\": \"Pause work queue\",\n\t\"resume-work-queue\": \"Resume work queue\",\n\t\"pause-work-pool\": \"Pause work pool\",\n\t\"resume-work-pool\": \"Resume work pool\",\n\t\"pause-automation\": \"Pause automation\",\n\t\"resume-automation\": \"Resume automation\",\n\t\"call-webhook\": \"Call a custom webhook notification\",\n\t/** Default string if `block_type_name` is not found. */\n\t\"send-notification\": \"Send a notification using\",\n\t\"do-nothing\": \"Do nothing\",\n} as const;\ntype ActionLabel =\n\t(typeof ACTION_TYPE_TO_STRING)[keyof typeof ACTION_TYPE_TO_STRING];\n\ntype AutomationAction = Automation[\"actions\"][number];\n\ntype ActionDetailsProps = {\n\taction: AutomationAction;\n\tautomationsMap: Map<string, Automation>;\n\tblockDocumentsMap: Map<string, BlockDocument>;\n\tdeploymentsMap: Map<string, Deployment>;\n\tworkPoolsMap: Map<string, WorkPool>;\n\tworkQueuesMap: Map<string, WorkQueue>;\n};\nexport const ActionDetails = ({\n\taction,\n\tautomationsMap,\n\tblockDocumentsMap,\n\tdeploymentsMap,\n\tworkPoolsMap,\n\tworkQueuesMap,\n}: ActionDetailsProps) => (\n\t<Card className=\"p-4\">\n\t\t<ActionDetailsType\n\t\t\taction={action}\n\t\t\tautomationsMap={automationsMap}\n\t\t\tblockDocumentsMap={blockDocumentsMap}\n\t\t\tdeploymentsMap={deploymentsMap}\n\t\t\tworkPoolsMap={workPoolsMap}\n\t\t\tworkQueuesMap={workQueuesMap}\n\t\t/>\n\t</Card>\n);\n\nconst ActionDetailsType = ({\n\taction,\n\tautomationsMap,\n\tblockDocumentsMap,\n\tdeploymentsMap,\n\tworkPoolsMap,\n\tworkQueuesMap,\n}: ActionDetailsProps) => {\n\tconst label = ACTION_TYPE_TO_STRING[action.type];\n\tswitch (action.type) {\n\t\t// Non-inferrable Actions\n\t\tcase \"cancel-flow-run\":\n\t\tcase \"suspend-flow-run\":\n\t\tcase \"resume-flow-run\":\n\t\tcase \"call-webhook\": // Not used\n\t\tcase \"do-nothing\": // not used\n\t\t\treturn <NoninferredAction label={label} />;\n\t\t// Inferable actions\n\t\tcase \"run-deployment\":\n\t\t\tif (action.deployment_id && action.source === \"selected\") {\n\t\t\t\tconst deployment = deploymentsMap.get(action.deployment_id);\n\t\t\t\tif (!deployment) {\n\t\t\t\t\treturn <Typography>Deployment not found</Typography>;\n\t\t\t\t}\n\t\t\t\treturn (\n\t\t\t\t\t<DeploymentActionDetails\n\t\t\t\t\t\tlabel={label}\n\t\t\t\t\t\tdeployment={deployment}\n\t\t\t\t\t\tparameters={action.parameters}\n\t\t\t\t\t\tjob_variables={action.job_variables}\n\t\t\t\t\t/>\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn <InferredAction label={label} />;\n\t\tcase \"pause-deployment\":\n\t\tcase \"resume-deployment\":\n\t\t\tif (action.deployment_id && action.source === \"selected\") {\n\t\t\t\tconst deployment = deploymentsMap.get(action.deployment_id);\n\t\t\t\tif (!deployment) {\n\t\t\t\t\treturn <Typography>Deployment not found</Typography>;\n\t\t\t\t}\n\t\t\t\treturn (\n\t\t\t\t\t<DeploymentActionDetails label={label} deployment={deployment} />\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn <InferredAction label={label} />;\n\t\tcase \"pause-work-queue\":\n\t\tcase \"resume-work-queue\":\n\t\t\tif (action.work_queue_id && action.source === \"selected\") {\n\t\t\t\tconst workQueue = workQueuesMap.get(action.work_queue_id);\n\t\t\t\tif (!workQueue) {\n\t\t\t\t\treturn <Typography>Work queue not found</Typography>;\n\t\t\t\t}\n\t\t\t\treturn <WorkQueueActionDetails label={label} workQueue={workQueue} />;\n\t\t\t}\n\t\t\treturn <InferredAction label={label} />;\n\t\tcase \"pause-automation\":\n\t\tcase \"resume-automation\":\n\t\t\tif (action.automation_id && action.source === \"selected\") {\n\t\t\t\tconst automation = automationsMap.get(action.automation_id);\n\t\t\t\tif (!automation) {\n\t\t\t\t\treturn <Typography>Automation not found</Typography>;\n\t\t\t\t}\n\t\t\t\treturn (\n\t\t\t\t\t<AutomationActionDetails label={label} automation={automation} />\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn <InferredAction label={label} />;\n\t\tcase \"pause-work-pool\":\n\t\tcase \"resume-work-pool\":\n\t\t\tif (action.work_pool_id && action.source === \"selected\") {\n\t\t\t\tconst workPool = workPoolsMap.get(action.work_pool_id);\n\t\t\t\tif (!workPool) {\n\t\t\t\t\treturn <Typography>Workpool not found</Typography>;\n\t\t\t\t}\n\t\t\t\treturn <WorkPoolActionDetails label={label} workPool={workPool} />;\n\t\t\t}\n\t\t\treturn <InferredAction label={label} />;\n\t\t// Other actions\n\t\tcase \"send-notification\": {\n\t\t\tconst blockDocument = blockDocumentsMap.get(action.block_document_id);\n\t\t\tif (!blockDocument) {\n\t\t\t\treturn <Typography>Block document not found</Typography>;\n\t\t\t}\n\t\t\treturn (\n\t\t\t\t<BlockDocumentActionDetails\n\t\t\t\t\tlabel={label}\n\t\t\t\t\tblockDocument={blockDocument}\n\t\t\t\t/>\n\t\t\t);\n\t\t}\n\t\tcase \"change-flow-run-state\":\n\t\t\treturn (\n\t\t\t\t<ChangeFlowRunStateActionDetails\n\t\t\t\t\tlabel={label}\n\t\t\t\t\ttype={action.state}\n\t\t\t\t\tname={action.name}\n\t\t\t\t/>\n\t\t\t);\n\t\tdefault:\n\t\t\treturn null;\n\t}\n};\n\nconst ActionResource = ({ children }: { children: React.ReactNode }) => (\n\t<div className=\"text-sm flex items-center gap-1\">{children}</div>\n);\n\nconst ActionResourceName = ({\n\ticonId,\n\tname,\n}: {\n\tname: string;\n\ticonId: IconId;\n}) => (\n\t<div className=\"text-xs flex items-center\">\n\t\t<Icon id={iconId} className=\"size-4 mr-1\" />\n\t\t{name}\n\t</div>\n);\n\nconst NoninferredAction = ({ label }: { label: ActionLabel }) => (\n\t<Typography variant=\"bodySmall\">{label} from the triggering event</Typography>\n);\n\nconst InferredAction = ({ label }: { label: ActionLabel }) => (\n\t<Typography variant=\"bodySmall\">\n\t\t{label} inferred from the triggering event\n\t</Typography>\n);\n\ntype ChangeFlowRunStateActionDetailsProps = {\n\tlabel: ActionLabel;\n\ttype: components[\"schemas\"][\"StateType\"];\n\tname?: string | null;\n};\n\nexport const ChangeFlowRunStateActionDetails = ({\n\tlabel,\n\ttype,\n\tname,\n}: ChangeFlowRunStateActionDetailsProps) => {\n\treturn (\n\t\t<ActionResource>\n\t\t\t<InferredAction label={label} /> to <StateBadge type={type} name={name} />\n\t\t</ActionResource>\n\t);\n};\n\n// Selected resources\ntype DeploymentActionDetailsProps = {\n\tlabel: ActionLabel;\n\tdeployment: Deployment;\n\tparameters?: Record<string, unknown> | null;\n\tjob_variables?: Record<string, unknown> | null;\n};\nexport const DeploymentActionDetails = ({\n\tlabel,\n\tdeployment,\n\tparameters,\n\tjob_variables,\n}: DeploymentActionDetailsProps) => {\n\treturn (\n\t\t<ActionResource>\n\t\t\t<label htmlFor={`${label}-${deployment.id}`}>{label}:</label>\n\t\t\t<Link\n\t\t\t\tto=\"/deployments/deployment/$id\"\n\t\t\t\tparams={{ id: deployment.id }}\n\t\t\t\taria-label={deployment.name}\n\t\t\t>\n\t\t\t\t<ActionResourceName iconId=\"Rocket\" name={deployment.name} />\n\t\t\t</Link>\n\t\t\t{parameters !== undefined && (\n\t\t\t\t<RunDeploymentJsonDialog title=\"Parameters\" payload={parameters} />\n\t\t\t)}\n\t\t\t{job_variables !== undefined && (\n\t\t\t\t<RunDeploymentJsonDialog\n\t\t\t\t\ttitle=\"Job Variables\"\n\t\t\t\t\tpayload={job_variables}\n\t\t\t\t/>\n\t\t\t)}\n\t\t</ActionResource>\n\t);\n};\n\ntype RunDeploymentJsonDialogProps = {\n\ttitle: string;\n\tpayload: Record<string, unknown> | null | undefined;\n};\n\nconst RunDeploymentJsonDialog = ({\n\ttitle,\n\tpayload,\n}: RunDeploymentJsonDialogProps) => {\n\treturn (\n\t\t<Dialog>\n\t\t\t<DialogTrigger asChild>\n\t\t\t\t<Button variant=\"secondary\" size=\"sm\">\n\t\t\t\t\tShow {capitalize(title)}\n\t\t\t\t</Button>\n\t\t\t</DialogTrigger>\n\t\t\t<DialogContent aria-describedby={undefined}>\n\t\t\t\t<DialogHeader>\n\t\t\t\t\t<DialogTitle>{title}</DialogTitle>\n\t\t\t\t</DialogHeader>\n\t\t\t\t<JsonInput value={JSON.stringify(payload)} disabled />\n\t\t\t</DialogContent>\n\t\t</Dialog>\n\t);\n};\n\ntype AutomationActionDetailsProps = {\n\tlabel: ActionLabel;\n\tautomation: Automation;\n};\nexport const AutomationActionDetails = ({\n\tlabel,\n\tautomation,\n}: AutomationActionDetailsProps) => {\n\treturn (\n\t\t<ActionResource>\n\t\t\t<label htmlFor={`${label}-${automation.id}`}>{label}:</label>\n\t\t\t<Link\n\t\t\t\tto=\"/automations/automation/$id\"\n\t\t\t\tparams={{ id: automation.id }}\n\t\t\t\taria-label={automation.name}\n\t\t\t>\n\t\t\t\t<ActionResourceName iconId=\"Bot\" name={automation.name} />\n\t\t\t</Link>\n\t\t</ActionResource>\n\t);\n};\n\ntype BlockDocumentActionDetailsProps = {\n\tlabel: ActionLabel;\n\tblockDocument: BlockDocument;\n};\nexport const BlockDocumentActionDetails = ({\n\tlabel,\n\tblockDocument,\n}: BlockDocumentActionDetailsProps) => {\n\tif (!blockDocument.name) {\n\t\treturn <Typography>Block not found</Typography>;\n\t}\n\n\tconst _label = blockDocument.block_type_name\n\t\t? `Send a ${blockDocument.block_type_name.toLowerCase()} using`\n\t\t: label;\n\n\treturn (\n\t\t<ActionResource>\n\t\t\t<label htmlFor={`${label}-${blockDocument.id}`}>{_label}</label>\n\t\t\t<Link\n\t\t\t\tto=\"/blocks/block/$id\"\n\t\t\t\tparams={{ id: blockDocument.id }}\n\t\t\t\taria-label={blockDocument.name}\n\t\t\t>\n\t\t\t\t<ActionResourceName iconId=\"Box\" name={blockDocument.name} />\n\t\t\t</Link>\n\t\t</ActionResource>\n\t);\n};\n\ntype WorkPoolActionDetailsProps = {\n\tlabel: ActionLabel;\n\tworkPool: WorkPool;\n};\nexport const WorkPoolActionDetails = ({\n\tlabel,\n\tworkPool,\n}: WorkPoolActionDetailsProps) => {\n\treturn (\n\t\t<ActionResource>\n\t\t\t<label htmlFor={`${label}-${workPool.id}`}>{label}:</label>\n\t\t\t<Link\n\t\t\t\tto=\"/work-pools/work-pool/$workPoolName\"\n\t\t\t\tparams={{ workPoolName: workPool.name }}\n\t\t\t\taria-label={workPool.name}\n\t\t\t>\n\t\t\t\t<ActionResourceName iconId=\"Cpu\" name={workPool.name} />\n\t\t\t</Link>\n\t\t</ActionResource>\n\t);\n};\n\ntype WorkQueueActionDetailsProps = {\n\tlabel: ActionLabel;\n\tworkQueue: WorkQueue;\n};\nexport const WorkQueueActionDetails = ({\n\tlabel,\n\tworkQueue,\n}: WorkQueueActionDetailsProps) => {\n\treturn (\n\t\t<ActionResource>\n\t\t\t<label htmlFor={`${label}-${workQueue.id}`}>{label}:</label>\n\t\t\t<Link\n\t\t\t\tto=\"/work-pools/work-pool/$workPoolName/queue/$workQueueName\"\n\t\t\t\tparams={{\n\t\t\t\t\tworkPoolName: workQueue.name,\n\t\t\t\t\tworkQueueName: workQueue.name,\n\t\t\t\t}}\n\t\t\t\taria-label={workQueue.name}\n\t\t\t>\n\t\t\t\t<ActionResourceName iconId=\"Cpu\" name={workQueue.name} />\n\t\t\t</Link>\n\t\t</ActionResource>\n\t);\n};\n","import { Typography } from \"@/components/ui/typography\";\nimport type { CompoundTrigger } from \"./trigger-utils\";\n\ntype TriggerDetailsCompoundProps = {\n\ttrigger: CompoundTrigger;\n};\n\nexport const TriggerDetailsCompound = ({\n\ttrigger,\n}: TriggerDetailsCompoundProps) => {\n\tconst triggerCount = trigger.triggers?.length ?? 0;\n\tconst requireValue = trigger.require;\n\n\tlet requireLabel: string;\n\tif (requireValue === \"all\") {\n\t\trequireLabel = \"all\";\n\t} else if (requireValue === \"any\") {\n\t\trequireLabel = \"any\";\n\t} else if (typeof requireValue === \"number\") {\n\t\trequireLabel = `at least ${requireValue}`;\n\t} else {\n\t\trequireLabel = \"all\";\n\t}\n\n\treturn (\n\t\t<div className=\"flex flex-wrap gap-1 items-center\">\n\t\t\t<Typography variant=\"bodySmall\">\n\t\t\t\tA compound trigger requiring {requireLabel} of {triggerCount} nested{\" \"}\n\t\t\t\t{triggerCount === 1 ? \"trigger\" : \"triggers\"} to fire\n\t\t\t</Typography>\n\t\t</div>\n\t);\n};\n","import { Typography } from \"@/components/ui/typography\";\n\nexport const TriggerDetailsCustom = () => {\n\treturn <Typography variant=\"bodySmall\">A custom trigger</Typography>;\n};\n","import { useSuspenseQuery } from \"@tanstack/react-query\";\nimport { Link } from \"@tanstack/react-router\";\nimport { Suspense } from \"react\";\nimport { buildDeploymentDetailsQuery } from \"@/api/deployments\";\nimport { Icon } from \"@/components/ui/icons\";\nimport { Skeleton } from \"@/components/ui/skeleton\";\n\ntype DeploymentLinkProps = {\n\tdeploymentId: string;\n};\n\nexport const DeploymentLink = ({ deploymentId }: DeploymentLinkProps) => {\n\treturn (\n\t\t<Suspense fallback={<Skeleton className=\"h-4 w-full\" />}>\n\t\t\t<DeploymentLinkImplementation deploymentId={deploymentId} />\n\t\t</Suspense>\n\t);\n};\n\nconst DeploymentLinkImplementation = ({\n\tdeploymentId,\n}: DeploymentLinkProps) => {\n\tconst { data: deployment } = useSuspenseQuery(\n\t\tbuildDeploymentDetailsQuery(deploymentId),\n\t);\n\n\treturn (\n\t\t<div className=\"flex items-center gap-1 text-xs\">\n\t\t\tDeployment\n\t\t\t<Link\n\t\t\t\tto=\"/deployments/deployment/$id\"\n\t\t\t\tparams={{ id: deployment.id }}\n\t\t\t\tclassName=\"flex items-center gap-1\"\n\t\t\t>\n\t\t\t\t<Icon id=\"Rocket\" className=\"size-4\" />\n\t\t\t\t{deployment.name}\n\t\t\t</Link>\n\t\t</div>\n\t);\n};\n","import type { components } from \"@/api/prefect\";\n\n// Type aliases for OpenAPI schema types\nexport type EventTrigger = components[\"schemas\"][\"EventTrigger\"];\nexport type CompoundTrigger = components[\"schemas\"][\"CompoundTrigger-Input\"];\nexport type SequenceTrigger = components[\"schemas\"][\"SequenceTrigger-Input\"];\n\n// Union type for all automation triggers\nexport type AutomationTrigger =\n\t| EventTrigger\n\t| CompoundTrigger\n\t| SequenceTrigger;\n\n// Template constants - following Vue implementation (5 templates)\nexport const AUTOMATION_TRIGGER_TEMPLATES = [\n\t\"deployment-status\",\n\t\"flow-run-state\",\n\t\"work-pool-status\",\n\t\"work-queue-status\",\n\t\"custom\",\n] as const;\n\nexport type AutomationTriggerTemplate =\n\t(typeof AUTOMATION_TRIGGER_TEMPLATES)[number];\n\n// Event posture types\nexport type AutomationTriggerEventPosture = \"Reactive\" | \"Proactive\";\n\n// Default threshold for event triggers (from Vue implementation)\nexport const DEFAULT_EVENT_TRIGGER_THRESHOLD = 1;\n\n// Event constants for each template type\nexport const DEPLOYMENT_STATUS_EVENTS = [\n\t\"prefect.deployment.ready\",\n\t\"prefect.deployment.not-ready\",\n\t\"prefect.deployment.disabled\",\n] as const;\n\nexport const WORK_POOL_STATUS_EVENTS = [\n\t\"prefect.work-pool.ready\",\n\t\"prefect.work-pool.not-ready\",\n\t\"prefect.work-pool.paused\",\n\t\"prefect.work-pool.not_ready\",\n] as const;\n\nexport const WORK_QUEUE_STATUS_EVENTS = [\n\t\"prefect.work-queue.ready\",\n\t\"prefect.work-queue.not-ready\",\n\t\"prefect.work-queue.paused\",\n] as const;\n\n// Type guard helper - check if value is a record/object\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n\treturn typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n\n// Primary type guards for trigger types\nexport function isEventTrigger(trigger: unknown): trigger is EventTrigger {\n\treturn (\n\t\tisRecord(trigger) &&\n\t\ttrigger.type === \"event\" &&\n\t\t(trigger.posture === \"Reactive\" || trigger.posture === \"Proactive\")\n\t);\n}\n\nexport function isCompoundTrigger(\n\ttrigger: unknown,\n): trigger is CompoundTrigger {\n\treturn (\n\t\tisRecord(trigger) &&\n\t\ttrigger.type === \"compound\" &&\n\t\tArray.isArray(trigger.triggers)\n\t);\n}\n\nexport function isSequenceTrigger(\n\ttrigger: unknown,\n): trigger is SequenceTrigger {\n\treturn (\n\t\tisRecord(trigger) &&\n\t\ttrigger.type === \"sequence\" &&\n\t\tArray.isArray(trigger.triggers)\n\t);\n}\n\nexport function isAutomationTrigger(\n\ttrigger: unknown,\n): trigger is AutomationTrigger {\n\treturn (\n\t\tisEventTrigger(trigger) ||\n\t\tisCompoundTrigger(trigger) ||\n\t\tisSequenceTrigger(trigger)\n\t);\n}\n\n// Helper to convert value to array (handles undefined, single value, or array)\nfunction asArray<T>(value: T | T[] | undefined | null): T[] {\n\tif (value === undefined || value === null) {\n\t\treturn [];\n\t}\n\treturn Array.isArray(value) ? value : [value];\n}\n\n// Get match value from trigger (handles snake_case field names from OpenAPI)\nfunction getTriggerMatchValue(\n\ttrigger: AutomationTrigger,\n\tkey: string,\n): string[] {\n\tif (isEventTrigger(trigger)) {\n\t\tconst match = trigger.match;\n\t\tif (match && typeof match === \"object\") {\n\t\t\tconst value = (match as Record<string, unknown>)[key];\n\t\t\treturn value ? asArray(value as string | string[]) : [];\n\t\t}\n\t}\n\treturn [];\n}\n\n// Validation helper: check if match resource satisfies predicate\nexport function isMatchResource(\n\ttrigger: AutomationTrigger,\n\tpredicate: (resourceIds: string[]) => boolean,\n): boolean {\n\tconst prefectResourceIds = getTriggerMatchValue(\n\t\ttrigger,\n\t\t\"prefect.resource.id\",\n\t);\n\n\tif (prefectResourceIds.length === 0) {\n\t\treturn false;\n\t}\n\n\treturn predicate(prefectResourceIds);\n}\n\n// Validation helper: check if for_each contains the expected resource\nexport function isForEachResource(\n\ttrigger: AutomationTrigger,\n\tresource: string,\n): boolean {\n\tif (isEventTrigger(trigger)) {\n\t\tconst forEach = trigger.for_each ?? [];\n\t\treturn forEach.every((value) => value.startsWith(resource));\n\t}\n\treturn false;\n}\n\n// Validation helper: check if after events satisfy predicate\nexport function isAfterResource(\n\ttrigger: AutomationTrigger,\n\tpredicate: (events: string[]) => boolean,\n): boolean {\n\tif (isEventTrigger(trigger)) {\n\t\treturn predicate(trigger.after ?? []);\n\t}\n\treturn false;\n}\n\n// Validation helper: check if expect events satisfy predicate\nexport function isExpectResource(\n\ttrigger: AutomationTrigger,\n\tpredicate: (events: string[]) => boolean,\n): boolean {\n\tif (isEventTrigger(trigger)) {\n\t\treturn predicate(trigger.expect ?? []);\n\t}\n\treturn false;\n}\n\n// Event type checkers\nfunction isDeploymentStatusEvent(event: string): boolean {\n\treturn (DEPLOYMENT_STATUS_EVENTS as readonly string[]).includes(event);\n}\n\nfunction isWorkPoolStatusEvent(event: string): boolean {\n\treturn (WORK_POOL_STATUS_EVENTS as readonly string[]).includes(event);\n}\n\nfunction isWorkQueueStatusEvent(event: string): boolean {\n\treturn (WORK_QUEUE_STATUS_EVENTS as readonly string[]).includes(event);\n}\n\n// Template-specific type guards\n\n/**\n * Check if trigger is a deployment-status template\n * Validates:\n * - Is an event trigger\n * - match['prefect.resource.id'] starts with 'prefect.deployment'\n * - for_each contains 'prefect.resource.id'\n * - after events are deployment status events\n * - expect events are deployment status events\n * - threshold === 1\n */\nexport function isDeploymentStatusTrigger(trigger: unknown): boolean {\n\treturn (\n\t\tisEventTrigger(trigger) &&\n\t\tisMatchResource(trigger, (prefectResourceIds) =>\n\t\t\tprefectResourceIds.every((value) =>\n\t\t\t\tvalue.startsWith(\"prefect.deployment\"),\n\t\t\t),\n\t\t) &&\n\t\tisForEachResource(trigger, \"prefect.resource.id\") &&\n\t\tisAfterResource(trigger, (triggerAfters) =>\n\t\t\ttriggerAfters.every((after) => isDeploymentStatusEvent(after)),\n\t\t) &&\n\t\tisExpectResource(trigger, (triggerExpects) =>\n\t\t\ttriggerExpects.every((expect) => isDeploymentStatusEvent(expect)),\n\t\t) &&\n\t\ttrigger.threshold === DEFAULT_EVENT_TRIGGER_THRESHOLD\n\t);\n}\n\n// Helper functions for flow-run-state template validation\nfunction getTriggerMatchRelatedValue(\n\ttrigger: EventTrigger,\n\tkey: string,\n): string[] {\n\tconst matchRelated = trigger.match_related;\n\tif (!matchRelated) {\n\t\treturn [];\n\t}\n\n\t// match_related can be a single object or an array of objects\n\tconst matchRelatedArray = Array.isArray(matchRelated)\n\t\t? matchRelated\n\t\t: [matchRelated];\n\n\tconst values: string[] = [];\n\tfor (const match of matchRelatedArray) {\n\t\tif (match && typeof match === \"object\") {\n\t\t\tconst value = (match as Record<string, unknown>)[key];\n\t\t\tif (value) {\n\t\t\t\tvalues.push(...asArray(value as string | string[]));\n\t\t\t}\n\t\t}\n\t}\n\treturn values;\n}\n\nfunction isEmptyMatchRelated(trigger: EventTrigger): boolean {\n\tconst matchRelated = trigger.match_related;\n\tif (!matchRelated) {\n\t\treturn true;\n\t}\n\tif (Array.isArray(matchRelated)) {\n\t\treturn matchRelated.length === 0;\n\t}\n\treturn Object.keys(matchRelated).length === 0;\n}\n\nfunction isMatchRelatedResource(\n\ttrigger: EventTrigger,\n\tresource: string,\n): boolean {\n\tconst prefectResourceIds = getTriggerMatchRelatedValue(\n\t\ttrigger,\n\t\t\"prefect.resource.id\",\n\t);\n\n\tif (prefectResourceIds.length === 0) {\n\t\treturn false;\n\t}\n\n\treturn prefectResourceIds.every((value) => value.startsWith(resource));\n}\n\nfunction isFlowRunStateTriggerMatchRelated(trigger: EventTrigger): boolean {\n\treturn (\n\t\tisEmptyMatchRelated(trigger) ||\n\t\tisMatchRelatedResource(trigger, \"prefect.flow\") ||\n\t\tisMatchRelatedResource(trigger, \"prefect.tag\")\n\t);\n}\n\n/**\n * Check if trigger is a flow-run-state template\n * Validates:\n * - Is an event trigger\n * - match['prefect.resource.id'] starts with 'prefect.flow-run'\n * - for_each contains 'prefect.resource.id'\n * - after events start with 'prefect.flow-run'\n * - expect events start with 'prefect.flow-run'\n * - matchRelated is empty OR contains flow/tag patterns\n * - threshold === 1\n */\nexport function isFlowRunStateTrigger(trigger: unknown): boolean {\n\treturn (\n\t\tisEventTrigger(trigger) &&\n\t\tisMatchResource(trigger, (prefectResourceIds) =>\n\t\t\tprefectResourceIds.every((value) => value.startsWith(\"prefect.flow-run\")),\n\t\t) &&\n\t\tisForEachResource(trigger, \"prefect.resource.id\") &&\n\t\tisAfterResource(trigger, (triggerAfters) =>\n\t\t\ttriggerAfters.every((after) => after.startsWith(\"prefect.flow-run\")),\n\t\t) &&\n\t\tisExpectResource(trigger, (triggerExpects) =>\n\t\t\ttriggerExpects.every((expect) => expect.startsWith(\"prefect.flow-run\")),\n\t\t) &&\n\t\tisFlowRunStateTriggerMatchRelated(trigger) &&\n\t\ttrigger.threshold === DEFAULT_EVENT_TRIGGER_THRESHOLD\n\t);\n}\n\n/**\n * Check if trigger is a work-pool-status template\n * Validates:\n * - Is an event trigger\n * - match['prefect.resource.id'] starts with 'prefect.work-pool'\n * - for_each contains 'prefect.resource.id'\n * - after events are work pool status events\n * - expect events are work pool status events\n * - threshold === 1\n */\nexport function isWorkPoolStatusTrigger(trigger: unknown): boolean {\n\treturn (\n\t\tisEventTrigger(trigger) &&\n\t\tisMatchResource(trigger, (prefectResourceIds) =>\n\t\t\tprefectResourceIds.every((value) =>\n\t\t\t\tvalue.startsWith(\"prefect.work-pool\"),\n\t\t\t),\n\t\t) &&\n\t\tisForEachResource(trigger, \"prefect.resource.id\") &&\n\t\tisAfterResource(trigger, (triggerAfters) =>\n\t\t\ttriggerAfters.every((after) => isWorkPoolStatusEvent(after)),\n\t\t) &&\n\t\tisExpectResource(trigger, (triggerExpects) =>\n\t\t\ttriggerExpects.every((expect) => isWorkPoolStatusEvent(expect)),\n\t\t) &&\n\t\ttrigger.threshold === DEFAULT_EVENT_TRIGGER_THRESHOLD\n\t);\n}\n\n/**\n * Check if trigger is a work-queue-status template\n * Validates:\n * - Is an event trigger\n * - match['prefect.resource.id'] starts with 'prefect.work-queue'\n * - for_each contains 'prefect.resource.id'\n * - after events are work queue status events\n * - expect events are work queue status events\n * - threshold === 1\n */\nexport function isWorkQueueStatusTrigger(trigger: unknown): boolean {\n\treturn (\n\t\tisEventTrigger(trigger) &&\n\t\tisMatchResource(trigger, (prefectResourceIds) =>\n\t\t\tprefectResourceIds.every((value) =>\n\t\t\t\tvalue.startsWith(\"prefect.work-queue\"),\n\t\t\t),\n\t\t) &&\n\t\tisForEachResource(trigger, \"prefect.resource.id\") &&\n\t\tisAfterResource(trigger, (triggerAfters) =>\n\t\t\ttriggerAfters.every((after) => isWorkQueueStatusEvent(after)),\n\t\t) &&\n\t\tisExpectResource(trigger, (triggerExpects) =>\n\t\t\ttriggerExpects.every((expect) => isWorkQueueStatusEvent(expect)),\n\t\t) &&\n\t\ttrigger.threshold === DEFAULT_EVENT_TRIGGER_THRESHOLD\n\t);\n}\n\n// Template check registry (excluding 'custom' which is the default)\nconst automationTriggerTemplateChecks: Record<\n\tExclude<AutomationTriggerTemplate, \"custom\">,\n\t(trigger: unknown) => boolean\n> = {\n\t\"deployment-status\": isDeploymentStatusTrigger,\n\t\"flow-run-state\": isFlowRunStateTrigger,\n\t\"work-pool-status\": isWorkPoolStatusTrigger,\n\t\"work-queue-status\": isWorkQueueStatusTrigger,\n};\n\n/**\n * Detect the template type of an automation trigger\n * Returns 'custom' if no template matches\n */\nexport function getAutomationTriggerTemplate(\n\ttrigger: AutomationTrigger,\n): AutomationTriggerTemplate {\n\tfor (const [type, guard] of Object.entries(automationTriggerTemplateChecks)) {\n\t\tif (guard(trigger)) {\n\t\t\treturn type as AutomationTriggerTemplate;\n\t\t}\n\t}\n\n\treturn \"custom\";\n}\n\n// Template labels\nconst automationTriggerTemplateLabels: Record<\n\tAutomationTriggerTemplate,\n\tstring\n> = {\n\t\"deployment-status\": \"Deployment status\",\n\t\"flow-run-state\": \"Flow run state\",\n\t\"work-pool-status\": \"Work pool status\",\n\t\"work-queue-status\": \"Work queue status\",\n\tcustom: \"Custom\",\n};\n\n/**\n * Get human-readable label for a trigger template\n */\nexport function getAutomationTriggerTemplateLabel(\n\ttemplate: AutomationTriggerTemplate,\n): string {\n\treturn automationTriggerTemplateLabels[template];\n}\n\n/**\n * Get human-readable label for event posture\n * \"Reactive\" -> \"enters\"\n * \"Proactive\" -> \"stays in\"\n */\nexport function getAutomationTriggerEventPostureLabel(\n\tposture: AutomationTriggerEventPosture,\n): string {\n\tswitch (posture) {\n\t\tcase \"Reactive\":\n\t\t\treturn \"enters\";\n\t\tcase \"Proactive\":\n\t\t\treturn \"stays in\";\n\t}\n}\n\n/**\n * Check if a string is a valid automation trigger template\n */\nexport function isAutomationTriggerTemplate(\n\tvalue: string,\n): value is AutomationTriggerTemplate {\n\treturn (AUTOMATION_TRIGGER_TEMPLATES as readonly string[]).includes(value);\n}\n\n// Work queue status types and labels\nexport type WorkQueueStatusTriggerStatus = \"READY\" | \"NOT_READY\" | \"PAUSED\";\n\n/**\n * Get human-readable label for work queue status\n * \"READY\" -> \"Ready\"\n * \"NOT_READY\" -> \"Not Ready\"\n * \"PAUSED\" -> \"Paused\"\n */\nexport function getWorkQueueStatusLabel(\n\tstatus: WorkQueueStatusTriggerStatus,\n): string {\n\tswitch (status) {\n\t\tcase \"READY\":\n\t\t\treturn \"Ready\";\n\t\tcase \"NOT_READY\":\n\t\t\treturn \"Not Ready\";\n\t\tcase \"PAUSED\":\n\t\t\treturn \"Paused\";\n\t\tdefault: {\n\t\t\tconst exhaustive: never = status;\n\t\t\tthrow new Error(\n\t\t\t\t`getWorkQueueStatusLabel missing case for ${exhaustive as string}`,\n\t\t\t);\n\t\t}\n\t}\n}\n","import { DeploymentLink } from \"@/components/deployments/deployment-link\";\nimport { secondsToString } from \"@/utils/seconds\";\nimport {\n\ttype AutomationTriggerEventPosture,\n\tgetAutomationTriggerEventPostureLabel,\n} from \"./trigger-utils\";\n\ntype DeploymentStatus = \"ready\" | \"not_ready\";\n\ntype TriggerDetailsDeploymentStatusProps = {\n\tdeploymentIds: string[];\n\tposture: AutomationTriggerEventPosture;\n\tstatus: DeploymentStatus;\n\ttime?: number;\n};\n\nfunction getDeploymentStatusLabel(status: DeploymentStatus): string {\n\tswitch (status) {\n\t\tcase \"ready\":\n\t\t\treturn \"ready\";\n\t\tcase \"not_ready\":\n\t\t\treturn \"not ready\";\n\t}\n}\n\nexport const TriggerDetailsDeploymentStatus = ({\n\tdeploymentIds,\n\tposture,\n\tstatus,\n\ttime,\n}: TriggerDetailsDeploymentStatusProps) => {\n\tconst isAnyDeployment = deploymentIds.length === 0;\n\tconst postureLabel = getAutomationTriggerEventPostureLabel(posture);\n\tconst statusLabel = getDeploymentStatusLabel(status);\n\n\treturn (\n\t\t<div className=\"flex flex-wrap gap-1 items-center\">\n\t\t\t<span>When</span>\n\n\t\t\t{isAnyDeployment ? (\n\t\t\t\t<span>any deployment</span>\n\t\t\t) : (\n\t\t\t\tdeploymentIds.map((deploymentId, index) => (\n\t\t\t\t\t<span key={deploymentId} className=\"flex items-center gap-1\">\n\t\t\t\t\t\t<DeploymentLink deploymentId={deploymentId} />\n\t\t\t\t\t\t{index === deploymentIds.length - 2 && <span>or</span>}\n\t\t\t\t\t</span>\n\t\t\t\t))\n\t\t\t)}\n\n\t\t\t<span>{postureLabel}</span>\n\t\t\t<span>{statusLabel}</span>\n\n\t\t\t{posture === \"Proactive\" && time !== undefined && time > 0 && (\n\t\t\t\t<span>for {secondsToString(time)}</span>\n\t\t\t)}\n\t\t</div>\n\t);\n};\n","import type { components } from \"@/api/prefect\";\nimport { FlowLink } from \"@/components/flows/flow-link\";\nimport { StateBadge } from \"@/components/ui/state-badge\";\nimport { TagBadgeGroup } from \"@/components/ui/tag-badge-group\";\nimport { secondsToApproximateString } from \"@/utils\";\nimport {\n\ttype AutomationTriggerEventPosture,\n\tgetAutomationTriggerEventPostureLabel,\n} from \"./trigger-utils\";\n\ntype StateType = components[\"schemas\"][\"StateType\"];\n\ntype TriggerDetailsFlowRunStateProps = {\n\tflowIds: string[];\n\ttags: string[];\n\tposture: AutomationTriggerEventPosture;\n\tstates: string[];\n\ttime?: number;\n};\n\n/**\n * Maps a state name string to a StateType enum value.\n * Handles various state name formats (e.g., \"Completed\", \"COMPLETED\", \"completed\")\n * and maps them to the uppercase StateType values expected by StateBadge.\n */\nfunction mapStateNameToStateType(stateName: string): StateType | null {\n\tconst normalizedName = stateName.toUpperCase();\n\n\tconst validStateTypes: StateType[] = [\n\t\t\"COMPLETED\",\n\t\t\"FAILED\",\n\t\t\"RUNNING\",\n\t\t\"CANCELLED\",\n\t\t\"CANCELLING\",\n\t\t\"CRASHED\",\n\t\t\"PAUSED\",\n\t\t\"PENDING\",\n\t\t\"SCHEDULED\",\n\t];\n\n\tif (validStateTypes.includes(normalizedName as StateType)) {\n\t\treturn normalizedName as StateType;\n\t}\n\n\treturn null;\n}\n\nexport const TriggerDetailsFlowRunState = ({\n\tflowIds,\n\ttags,\n\tposture,\n\tstates,\n\ttime,\n}: TriggerDetailsFlowRunStateProps) => {\n\tconst postureLabel = getAutomationTriggerEventPostureLabel(posture);\n\n\treturn (\n\t\t<div className=\"flex flex-wrap gap-1 items-center\">\n\t\t\t<span>When any flow run</span>\n\n\t\t\t{flowIds.length > 0 && (\n\t\t\t\t<>\n\t\t\t\t\t<span>of flow</span>\n\t\t\t\t\t{flowIds.map((flowId, index) => (\n\t\t\t\t\t\t<span key={flowId} className=\"flex items-center gap-1\">\n\t\t\t\t\t\t\t<FlowLink flowId={flowId} />\n\t\t\t\t\t\t\t{index === flowIds.length - 2 && <span>or</span>}\n\t\t\t\t\t\t</span>\n\t\t\t\t\t))}\n\t\t\t\t</>\n\t\t\t)}\n\n\t\t\t{tags.length > 0 && (\n\t\t\t\t<>\n\t\t\t\t\t<span>with the tag</span>\n\t\t\t\t\t<TagBadgeGroup tags={tags} />\n\t\t\t\t</>\n\t\t\t)}\n\n\t\t\t<span>{postureLabel}</span>\n\n\t\t\t{states.length > 0 ? (\n\t\t\t\tstates.map((state) => {\n\t\t\t\t\tconst stateType = mapStateNameToStateType(state);\n\t\t\t\t\tif (stateType) {\n\t\t\t\t\t\treturn <StateBadge key={state} type={stateType} />;\n\t\t\t\t\t}\n\t\t\t\t\treturn null;\n\t\t\t\t})\n\t\t\t) : (\n\t\t\t\t<span>any state</span>\n\t\t\t)}\n\n\t\t\t{posture === \"Proactive\" && time !== undefined && time > 0 && (\n\t\t\t\t<span>for {secondsToApproximateString(time)}</span>\n\t\t\t)}\n\t\t</div>\n\t);\n};\n","import { Typography } from \"@/components/ui/typography\";\nimport type { SequenceTrigger } from \"./trigger-utils\";\n\ntype TriggerDetailsSequenceProps = {\n\ttrigger: SequenceTrigger;\n};\n\nexport const TriggerDetailsSequence = ({\n\ttrigger,\n}: TriggerDetailsSequenceProps) => {\n\tconst triggerCount = trigger.triggers?.length ?? 0;\n\n\treturn (\n\t\t<div className=\"flex flex-wrap gap-1 items-center\">\n\t\t\t<Typography variant=\"bodySmall\">\n\t\t\t\tA sequence trigger with {triggerCount} nested{\" \"}\n\t\t\t\t{triggerCount === 1 ? \"trigger\" : \"triggers\"} that must fire in order\n\t\t\t</Typography>\n\t\t</div>\n\t);\n};\n","import { useQuery } from \"@tanstack/react-query\";\nimport { Link } from \"@tanstack/react-router\";\nimport { buildFilterWorkPoolsQuery, type WorkPool } from \"@/api/work-pools\";\nimport { Icon } from \"@/components/ui/icons\";\nimport { pluralize } from \"@/utils\";\nimport { secondsToString } from \"@/utils/seconds\";\nimport type { AutomationTriggerEventPosture } from \"./trigger-utils\";\n\ntype WorkPoolStatusType = \"READY\" | \"NOT_READY\" | \"PAUSED\";\n\nexport type TriggerDetailsWorkPoolStatusProps = {\n\tworkPoolIds: string[];\n\tposture: AutomationTriggerEventPosture;\n\tstatus: WorkPoolStatusType;\n\ttime?: number;\n};\n\nconst getStatusLabel = (status: WorkPoolStatusType): string => {\n\tswitch (status) {\n\t\tcase \"READY\":\n\t\t\treturn \"Ready\";\n\t\tcase \"NOT_READY\":\n\t\t\treturn \"Not Ready\";\n\t\tcase \"PAUSED\":\n\t\t\treturn \"Paused\";\n\t}\n};\n\nconst WorkPoolLinkInline = ({ workPoolName }: { workPoolName: string }) => {\n\treturn (\n\t\t<Link\n\t\t\tto=\"/work-pools/work-pool/$workPoolName\"\n\t\t\tparams={{ workPoolName }}\n\t\t\tclassName=\"inline-flex items-center gap-1\"\n\t\t>\n\t\t\t<Icon id=\"Cpu\" className=\"size-4\" />\n\t\t\t{workPoolName}\n\t\t</Link>\n\t);\n};\n\nconst renderWorkPoolLinks = (workPools: WorkPool[]) => {\n\tif (workPools.length === 0) {\n\t\treturn null;\n\t}\n\n\treturn workPools.map((workPool, index) => (\n\t\t<span key={workPool.id} className=\"inline-flex items-center gap-1\">\n\t\t\t<WorkPoolLinkInline workPoolName={workPool.name} />\n\t\t\t{index === workPools.length - 2 && \" or \"}\n\t\t\t{index < workPools.length - 2 && \", \"}\n\t\t</span>\n\t));\n};\n\nexport const TriggerDetailsWorkPoolStatus = ({\n\tworkPoolIds,\n\tposture,\n\tstatus,\n\ttime,\n}: TriggerDetailsWorkPoolStatusProps) => {\n\tconst { data: workPools = [] } = useQuery(\n\t\tbuildFilterWorkPoolsQuery(\n\t\t\t{\n\t\t\t\toffset: 0,\n\t\t\t\twork_pools: { id: { any_: workPoolIds }, operator: \"and_\" },\n\t\t\t},\n\t\t\t{ enabled: workPoolIds.length > 0 },\n\t\t),\n\t);\n\n\tconst postureLabel = posture === \"Reactive\" ? \"enters\" : \"stays in\";\n\tconst statusLabel = getStatusLabel(status).toLowerCase();\n\n\tconst workPoolLabel =\n\t\tworkPoolIds.length === 0\n\t\t\t? \"any work pool\"\n\t\t\t: `${pluralize(workPoolIds.length, \"work pool\")} `;\n\n\treturn (\n\t\t<div className=\"flex flex-wrap gap-1 items-center\">\n\t\t\t<span>When</span>\n\t\t\t<span>{workPoolLabel}</span>\n\t\t\t{workPoolIds.length > 0 && renderWorkPoolLinks(workPools)}\n\t\t\t<span>{postureLabel}</span>\n\t\t\t<span>{statusLabel}</span>\n\t\t\t{posture === \"Proactive\" && time !== undefined && (\n\t\t\t\t<span>for {secondsToString(time)}</span>\n\t\t\t)}\n\t\t</div>\n\t);\n};\n","import { useSuspenseQueries } from \"@tanstack/react-query\";\nimport { Suspense } from \"react\";\nimport { buildGetWorkQueueQuery } from \"@/api/work-queues\";\nimport { Skeleton } from \"@/components/ui/skeleton\";\nimport { WorkPoolLink } from \"@/components/work-pools/work-pool-link\";\nimport { WorkQueueIconText } from \"@/components/work-pools/work-queue-icon-text\";\nimport { pluralize } from \"@/utils\";\nimport { secondsToString } from \"@/utils/seconds\";\nimport {\n\ttype AutomationTriggerEventPosture,\n\tgetAutomationTriggerEventPostureLabel,\n\tgetWorkQueueStatusLabel,\n\ttype WorkQueueStatusTriggerStatus,\n} from \"./trigger-utils\";\n\nexport type TriggerDetailsWorkQueueStatusProps = {\n\tworkQueueIds: string[];\n\tworkPoolNames: string[];\n\tposture: AutomationTriggerEventPosture;\n\tstatus: WorkQueueStatusTriggerStatus;\n\ttime?: number;\n};\n\nexport const TriggerDetailsWorkQueueStatus = (\n\tprops: TriggerDetailsWorkQueueStatusProps,\n) => {\n\treturn (\n\t\t<Suspense fallback={<Skeleton className=\"h-4 w-full\" />}>\n\t\t\t<TriggerDetailsWorkQueueStatusImplementation {...props} />\n\t\t</Suspense>\n\t);\n};\n\nconst TriggerDetailsWorkQueueStatusImplementation = ({\n\tworkQueueIds,\n\tworkPoolNames,\n\tposture,\n\tstatus,\n\ttime,\n}: TriggerDetailsWorkQueueStatusProps) => {\n\tconst anyWorkQueue = workQueueIds.length === 0;\n\tconst anyWorkPool = workPoolNames.length === 0;\n\n\tconst workQueueQueries = useSuspenseQueries({\n\t\tqueries: workQueueIds.map((id) => buildGetWorkQueueQuery(id)),\n\t});\n\n\tconst workQueues = workQueueQueries.map((query) => query.data);\n\n\treturn (\n\t\t<div className=\"flex flex-wrap gap-1 items-center text-sm\">\n\t\t\t<span>When</span>\n\n\t\t\t{anyWorkQueue ? (\n\t\t\t\t<span>any work queue</span>\n\t\t\t) : (\n\t\t\t\t<>\n\t\t\t\t\t<span>{pluralize(workQueues.length, \"work queue\")}</span>\n\t\t\t\t\t{workQueues.map((workQueue, index) => (\n\t\t\t\t\t\t<span key={workQueue.id} className=\"flex items-center gap-1\">\n\t\t\t\t\t\t\t<WorkQueueIconText\n\t\t\t\t\t\t\t\tworkPoolName={workQueue.work_pool_name ?? \"\"}\n\t\t\t\t\t\t\t\tworkQueueName={workQueue.name}\n\t\t\t\t\t\t\t\tshowLabel\n\t\t\t\t\t\t\t\tshowStatus\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t{index === workQueues.length - 2 && <span>or</span>}\n\t\t\t\t\t\t</span>\n\t\t\t\t\t))}\n\t\t\t\t</>\n\t\t\t)}\n\n\t\t\t{!anyWorkPool && (\n\t\t\t\t<>\n\t\t\t\t\t<span>from the {pluralize(workPoolNames.length, \"work pool\")}</span>\n\t\t\t\t\t{workPoolNames.map((workPoolName, index) => (\n\t\t\t\t\t\t<span key={workPoolName} className=\"flex items-center gap-1\">\n\t\t\t\t\t\t\t<WorkPoolLink workPoolName={workPoolName} />\n\t\t\t\t\t\t\t{index === workPoolNames.length - 2 && <span>or</span>}\n\t\t\t\t\t\t</span>\n\t\t\t\t\t))}\n\t\t\t\t</>\n\t\t\t)}\n\n\t\t\t<span>{getAutomationTriggerEventPostureLabel(posture)}</span>\n\t\t\t<span>{getWorkQueueStatusLabel(status).toLowerCase()}</span>\n\n\t\t\t{posture === \"Proactive\" && time !== undefined && (\n\t\t\t\t<span>for {secondsToString(time)}</span>\n\t\t\t)}\n\t\t</div>\n\t);\n};\n","import { TriggerDetailsCompound } from \"./trigger-details-compound\";\nimport { TriggerDetailsCustom } from \"./trigger-details-custom\";\nimport { TriggerDetailsDeploymentStatus } from \"./trigger-details-deployment-status\";\nimport { TriggerDetailsFlowRunState } from \"./trigger-details-flow-run-state\";\nimport { TriggerDetailsSequence } from \"./trigger-details-sequence\";\nimport { TriggerDetailsWorkPoolStatus } from \"./trigger-details-work-pool-status\";\nimport { TriggerDetailsWorkQueueStatus } from \"./trigger-details-work-queue-status\";\nimport {\n\ttype AutomationTrigger,\n\ttype AutomationTriggerEventPosture,\n\ttype EventTrigger,\n\tgetAutomationTriggerTemplate,\n\tisCompoundTrigger,\n\tisEventTrigger,\n\tisSequenceTrigger,\n\ttype WorkQueueStatusTriggerStatus,\n} from \"./trigger-utils\";\n\ntype TriggerDetailsProps = {\n\ttrigger: AutomationTrigger;\n};\n\ntype DeploymentStatus = \"ready\" | \"not_ready\";\ntype WorkPoolStatusType = \"READY\" | \"NOT_READY\" | \"PAUSED\";\n\nfunction asArray<T>(value: T | T[] | undefined | null): T[] {\n\tif (value === undefined || value === null) {\n\t\treturn [];\n\t}\n\treturn Array.isArray(value) ? value : [value];\n}\n\nfunction getMatchValue(\n\ttrigger: EventTrigger,\n\tkey: string,\n): string | string[] | undefined {\n\tconst match = trigger.match;\n\tif (match && typeof match === \"object\") {\n\t\treturn (match as Record<string, string | string[] | undefined>)[key];\n\t}\n\treturn undefined;\n}\n\nfunction getMatchRelatedValue(trigger: EventTrigger, key: string): string[] {\n\tconst matchRelated = trigger.match_related;\n\tif (!matchRelated) {\n\t\treturn [];\n\t}\n\n\tconst matchRelatedArray = Array.isArray(matchRelated)\n\t\t? matchRelated\n\t\t: [matchRelated];\n\n\tconst values: string[] = [];\n\tfor (const match of matchRelatedArray) {\n\t\tif (match && typeof match === \"object\") {\n\t\t\tconst value = (match as Record<string, unknown>)[key];\n\t\t\tif (value) {\n\t\t\t\tvalues.push(...asArray(value as string | string[]));\n\t\t\t}\n\t\t}\n\t}\n\treturn values;\n}\n\nfunction fromResourceId(resource: string, value: unknown): string[] {\n\tif (value === undefined || value === null) {\n\t\treturn [];\n\t}\n\n\tconst values = asArray(value as string | string[]);\n\n\tif (values.includes(`${resource}.*`)) {\n\t\treturn [];\n\t}\n\n\treturn values\n\t\t.filter((v) => v.startsWith(resource))\n\t\t.map((v) => {\n\t\t\tconst parts = v.split(`${resource}.`);\n\t\t\treturn parts[1] ?? \"\";\n\t\t})\n\t\t.filter((id) => id !== \"\" && id !== \"*\");\n}\n\nfunction fromStateNameEvents(events: string[]): string[] {\n\tif (events.includes(\"prefect.flow-run.*\")) {\n\t\treturn [];\n\t}\n\n\treturn events\n\t\t.filter((event) => event.startsWith(\"prefect.flow-run.\"))\n\t\t.map((event) => {\n\t\t\tconst parts = event.split(\"prefect.flow-run.\");\n\t\t\treturn parts[1] ?? \"\";\n\t\t})\n\t\t.filter((name) => name !== \"\");\n}\n\nfunction extractFlowRunStateProps(trigger: EventTrigger): {\n\tflowIds: string[];\n\ttags: string[];\n\tposture: AutomationTriggerEventPosture;\n\tstates: string[];\n\ttime?: number;\n} {\n\tconst matchRelatedResourceIds = getMatchRelatedValue(\n\t\ttrigger,\n\t\t\"prefect.resource.id\",\n\t);\n\n\tconst flowIds = fromResourceId(\"prefect.flow\", matchRelatedResourceIds);\n\tconst tags = fromResourceId(\"prefect.tag\", matchRelatedResourceIds);\n\n\tconst posture = trigger.posture;\n\tconst states =\n\t\tposture === \"Reactive\"\n\t\t\t? fromStateNameEvents(trigger.expect ?? [])\n\t\t\t: fromStateNameEvents(trigger.after ?? []);\n\n\treturn {\n\t\tflowIds,\n\t\ttags,\n\t\tposture,\n\t\tstates,\n\t\ttime: trigger.within,\n\t};\n}\n\nconst DEPLOYMENT_STATUS_EVENT_TO_STATUS: Record<string, DeploymentStatus> = {\n\t\"prefect.deployment.ready\": \"ready\",\n\t\"prefect.deployment.not-ready\": \"not_ready\",\n\t\"prefect.deployment.disabled\": \"not_ready\",\n};\n\nfunction extractDeploymentStatusProps(trigger: EventTrigger): {\n\tdeploymentIds: string[];\n\tposture: AutomationTriggerEventPosture;\n\tstatus: DeploymentStatus;\n\ttime?: number;\n} {\n\tconst resourceIdValue = getMatchValue(trigger, \"prefect.resource.id\");\n\tconst deploymentIds = fromResourceId(\"prefect.deployment\", resourceIdValue);\n\n\tconst posture = trigger.posture;\n\tconst statusEvents = posture === \"Reactive\" ? trigger.expect : trigger.after;\n\n\tlet status: DeploymentStatus = \"ready\";\n\tfor (const event of statusEvents ?? []) {\n\t\tif (event in DEPLOYMENT_STATUS_EVENT_TO_STATUS) {\n\t\t\tstatus = DEPLOYMENT_STATUS_EVENT_TO_STATUS[event];\n\t\t\tbreak;\n\t\t}\n\t}\n\n\treturn {\n\t\tdeploymentIds,\n\t\tposture,\n\t\tstatus,\n\t\ttime: trigger.within,\n\t};\n}\n\nconst WORK_POOL_STATUS_EVENT_TO_STATUS: Record<string, WorkPoolStatusType> = {\n\t\"prefect.work-pool.ready\": \"READY\",\n\t\"prefect.work-pool.not-ready\": \"NOT_READY\",\n\t\"prefect.work-pool.not_ready\": \"NOT_READY\",\n\t\"prefect.work-pool.paused\": \"PAUSED\",\n};\n\nfunction extractWorkPoolStatusProps(trigger: EventTrigger): {\n\tworkPoolIds: string[];\n\tposture: AutomationTriggerEventPosture;\n\tstatus: WorkPoolStatusType;\n\ttime?: number;\n} {\n\tconst resourceIdValue = getMatchValue(trigger, \"prefect.resource.id\");\n\tconst workPoolIds = fromResourceId(\"prefect.work-pool\", resourceIdValue);\n\n\tconst posture = trigger.posture;\n\tconst statusEvents = posture === \"Reactive\" ? trigger.expect : trigger.after;\n\n\tlet status: WorkPoolStatusType = \"READY\";\n\tfor (const event of statusEvents ?? []) {\n\t\tif (event in WORK_POOL_STATUS_EVENT_TO_STATUS) {\n\t\t\tstatus = WORK_POOL_STATUS_EVENT_TO_STATUS[event];\n\t\t\tbreak;\n\t\t}\n\t}\n\n\treturn {\n\t\tworkPoolIds,\n\t\tposture,\n\t\tstatus,\n\t\ttime: trigger.within,\n\t};\n}\n\nconst WORK_QUEUE_STATUS_EVENT_TO_STATUS: Record<\n\tstring,\n\tWorkQueueStatusTriggerStatus\n> = {\n\t\"prefect.work-queue.ready\": \"READY\",\n\t\"prefect.work-queue.not-ready\": \"NOT_READY\",\n\t\"prefect.work-queue.paused\": \"PAUSED\",\n};\n\nfunction extractWorkQueueStatusProps(trigger: EventTrigger): {\n\tworkQueueIds: string[];\n\tworkPoolNames: string[];\n\tposture: AutomationTriggerEventPosture;\n\tstatus: WorkQueueStatusTriggerStatus;\n\ttime?: number;\n} {\n\tconst resourceIdValue = getMatchValue(trigger, \"prefect.resource.id\");\n\tconst workQueueIds = fromResourceId(\"prefect.work-queue\", resourceIdValue);\n\n\tconst matchRelatedResourceIds = getMatchRelatedValue(\n\t\ttrigger,\n\t\t\"prefect.resource.id\",\n\t);\n\tconst workPoolNames = fromResourceId(\n\t\t\"prefect.work-pool\",\n\t\tmatchRelatedResourceIds,\n\t);\n\n\tconst posture = trigger.posture;\n\tconst statusEvents = posture === \"Reactive\" ? trigger.expect : trigger.after;\n\n\tlet status: WorkQueueStatusTriggerStatus = \"READY\";\n\tfor (const event of statusEvents ?? []) {\n\t\tif (event in WORK_QUEUE_STATUS_EVENT_TO_STATUS) {\n\t\t\tstatus = WORK_QUEUE_STATUS_EVENT_TO_STATUS[event];\n\t\t\tbreak;\n\t\t}\n\t}\n\n\treturn {\n\t\tworkQueueIds,\n\t\tworkPoolNames,\n\t\tposture,\n\t\tstatus,\n\t\ttime: trigger.within,\n\t};\n}\n\nexport const TriggerDetails = ({ trigger }: TriggerDetailsProps) => {\n\tif (isCompoundTrigger(trigger)) {\n\t\treturn <TriggerDetailsCompound trigger={trigger} />;\n\t}\n\n\tif (isSequenceTrigger(trigger)) {\n\t\treturn <TriggerDetailsSequence trigger={trigger} />;\n\t}\n\n\tif (!isEventTrigger(trigger)) {\n\t\treturn <TriggerDetailsCustom />;\n\t}\n\n\tconst template = getAutomationTriggerTemplate(trigger);\n\n\tswitch (template) {\n\t\tcase \"flow-run-state\":\n\t\t\treturn (\n\t\t\t\t<TriggerDetailsFlowRunState {...extractFlowRunStateProps(trigger)} />\n\t\t\t);\n\t\tcase \"deployment-status\":\n\t\t\treturn (\n\t\t\t\t<TriggerDetailsDeploymentStatus\n\t\t\t\t\t{...extractDeploymentStatusProps(trigger)}\n\t\t\t\t/>\n\t\t\t);\n\t\tcase \"work-pool-status\":\n\t\t\treturn (\n\t\t\t\t<TriggerDetailsWorkPoolStatus\n\t\t\t\t\t{...extractWorkPoolStatusProps(trigger)}\n\t\t\t\t/>\n\t\t\t);\n\t\tcase \"work-queue-status\":\n\t\t\treturn (\n\t\t\t\t<TriggerDetailsWorkQueueStatus\n\t\t\t\t\t{...extractWorkQueueStatusProps(trigger)}\n\t\t\t\t/>\n\t\t\t);\n\t\tdefault:\n\t\t\treturn <TriggerDetailsCustom />;\n\t}\n};\n","import type { Automation } from \"@/api/automations\";\nimport { useGetAutomationActionResources } from \"@/api/automations/use-get-automation-action-resources\";\nimport { ActionDetails } from \"@/components/automations/action-details\";\nimport { TriggerDetails } from \"@/components/automations/trigger-details\";\nimport { Card } from \"@/components/ui/card\";\nimport { Skeleton } from \"@/components/ui/skeleton\";\nimport { Typography } from \"@/components/ui/typography\";\nimport { pluralize } from \"@/utils\";\n\ntype AutomationDetailsProps = {\n\tautomation: Automation;\n};\n\nexport const AutomationDescription = ({\n\tautomation,\n}: AutomationDetailsProps) => {\n\treturn (\n\t\t<div className=\"flex flex-col gap-1\">\n\t\t\t<Typography className=\"text-muted-foreground\" variant=\"bodySmall\">\n\t\t\t\tDescription\n\t\t\t</Typography>\n\t\t\t<Typography className=\"text-muted-foreground\">\n\t\t\t\t{automation.description || \"None\"}\n\t\t\t</Typography>\n\t\t</div>\n\t);\n};\n\nexport const AutomationTrigger = ({ automation }: AutomationDetailsProps) => {\n\tconst { trigger } = automation;\n\treturn (\n\t\t<div className=\"flex flex-col gap-1\">\n\t\t\t<Typography>Trigger</Typography>\n\t\t\t<TriggerDetails trigger={trigger} />\n\t\t</div>\n\t);\n};\n\nexport const AutomationActions = ({ automation }: AutomationDetailsProps) => {\n\tconst { data: resources, loading } =\n\t\tuseGetAutomationActionResources(automation);\n\n\tconst {\n\t\tautomationsMap,\n\t\tblockDocumentsMap,\n\t\tdeploymentsMap,\n\t\tworkPoolsMap,\n\t\tworkQueuesMap,\n\t} = resources;\n\n\treturn (\n\t\t<div className=\"flex flex-col gap-1\">\n\t\t\t<Typography>{pluralize(automation.actions.length, \"Action\")}</Typography>\n\t\t\t<ul className=\"flex flex-col gap-2\">\n\t\t\t\t{loading\n\t\t\t\t\t? Array.from({ length: automation.actions.length }, (_, i) => (\n\t\t\t\t\t\t\t// biome-ignore lint/suspicious/noArrayIndexKey: ok for loading skeletons\n\t\t\t\t\t\t\t<Card className=\"p-4\" key={i}>\n\t\t\t\t\t\t\t\t<Skeleton className=\"p-2 h-2 w-full\" />\n\t\t\t\t\t\t\t</Card>\n\t\t\t\t\t\t))\n\t\t\t\t\t: automation.actions.map((action) => (\n\t\t\t\t\t\t\t<li key={action.type}>\n\t\t\t\t\t\t\t\t<ActionDetails\n\t\t\t\t\t\t\t\t\taction={action}\n\t\t\t\t\t\t\t\t\tautomationsMap={automationsMap}\n\t\t\t\t\t\t\t\t\tblockDocumentsMap={blockDocumentsMap}\n\t\t\t\t\t\t\t\t\tdeploymentsMap={deploymentsMap}\n\t\t\t\t\t\t\t\t\tworkPoolsMap={workPoolsMap}\n\t\t\t\t\t\t\t\t\tworkQueuesMap={workQueuesMap}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t))}\n\t\t\t</ul>\n\t\t</div>\n\t);\n};\n","import { toast } from \"sonner\";\nimport { type Automation, useUpdateAutomation } from \"@/api/automations\";\nimport { Switch } from \"@/components/ui/switch\";\n\ntype AutomationEnableToggleProps = {\n\tautomation: Automation;\n};\nexport const AutomationEnableToggle = ({\n\tautomation,\n}: AutomationEnableToggleProps) => {\n\tconst { updateAutomation } = useUpdateAutomation();\n\n\tconst handleCheckedChange = (checked: boolean, id: string) => {\n\t\tupdateAutomation(\n\t\t\t{\n\t\t\t\tenabled: checked,\n\t\t\t\tid,\n\t\t\t},\n\t\t\t{\n\t\t\t\tonSuccess: () => {\n\t\t\t\t\ttoast.success(`Automation ${checked ? \"enabled\" : \"disabled\"}`);\n\t\t\t\t},\n\t\t\t\tonError: (error) => {\n\t\t\t\t\tconst message =\n\t\t\t\t\t\terror.message || \"Unknown error while updating automation\";\n\t\t\t\t\tconsole.error(message);\n\t\t\t\t},\n\t\t\t},\n\t\t);\n\t};\n\n\treturn (\n\t\t<Switch\n\t\t\taria-label=\"toggle automation\"\n\t\t\tchecked={automation.enabled}\n\t\t\tonCheckedChange={(checked) => handleCheckedChange(checked, automation.id)}\n\t\t/>\n\t);\n};\n","import { Link } from \"@tanstack/react-router\";\nimport { toast } from \"sonner\";\nimport { Button } from \"@/components/ui/button\";\nimport { DOCS_LINKS } from \"@/components/ui/docs-link\";\nimport {\n\tDropdownMenu,\n\tDropdownMenuContent,\n\tDropdownMenuItem,\n\tDropdownMenuLabel,\n\tDropdownMenuTrigger,\n} from \"@/components/ui/dropdown-menu\";\nimport { Icon } from \"@/components/ui/icons\";\n\ntype Props = {\n\tid: string;\n\tonDelete: () => void;\n};\n\nexport const AutomationsActionsMenu = ({ id, onDelete }: Props) => {\n\tconst handleCopyId = (id: string) => {\n\t\tvoid navigator.clipboard.writeText(id);\n\t\ttoast.success(\"ID copied\");\n\t};\n\n\treturn (\n\t\t<DropdownMenu>\n\t\t\t<DropdownMenuTrigger asChild>\n\t\t\t\t<Button variant=\"outline\" className=\"size-8 p-0\">\n\t\t\t\t\t<span className=\"sr-only\">Open menu</span>\n\t\t\t\t\t<Icon id=\"MoreVertical\" className=\"size-4\" />\n\t\t\t\t</Button>\n\t\t\t</DropdownMenuTrigger>\n\t\t\t<DropdownMenuContent align=\"end\">\n\t\t\t\t<DropdownMenuLabel>Actions</DropdownMenuLabel>\n\t\t\t\t<DropdownMenuItem onClick={() => handleCopyId(id)}>\n\t\t\t\t\tCopy ID\n\t\t\t\t</DropdownMenuItem>\n\t\t\t\t<DropdownMenuItem asChild>\n\t\t\t\t\t<Link to=\"/automations/automation/$id/edit\" params={{ id }}>\n\t\t\t\t\t\tEdit\n\t\t\t\t\t</Link>\n\t\t\t\t</DropdownMenuItem>\n\t\t\t\t<DropdownMenuItem onClick={onDelete}>Delete</DropdownMenuItem>\n\t\t\t\t<DropdownMenuItem asChild>\n\t\t\t\t\t<a\n\t\t\t\t\t\thref={DOCS_LINKS[\"automations-guide\"]}\n\t\t\t\t\t\tclassName=\"flex items-center\"\n\t\t\t\t\t>\n\t\t\t\t\t\tDocumentation <Icon id=\"ExternalLink\" className=\"ml-2 size-4\" />\n\t\t\t\t\t</a>\n\t\t\t\t</DropdownMenuItem>\n\t\t\t</DropdownMenuContent>\n\t\t</DropdownMenu>\n\t);\n};\n","import { useNavigate } from \"@tanstack/react-router\";\nimport { toast } from \"sonner\";\nimport { type Automation, useDeleteAutomation } from \"@/api/automations\";\nimport { useDeleteConfirmationDialog } from \"@/components/ui/delete-confirmation-dialog\";\n\nexport const useDeleteAutomationConfirmationDialog = () => {\n\tconst navigate = useNavigate();\n\tconst [dialogState, confirmDelete] = useDeleteConfirmationDialog();\n\n\tconst { deleteAutomation } = useDeleteAutomation();\n\n\tconst handleConfirmDelete = (\n\t\tautomation: Automation,\n\t\t{\n\t\t\tshouldNavigate = false,\n\t\t}: {\n\t\t\t/** Should navigate back to /automations */\n\t\t\tshouldNavigate?: boolean;\n\t\t} = {},\n\t) =>\n\t\tconfirmDelete({\n\t\t\ttitle: \"Delete Automation\",\n\t\t\tdescription: `Are you sure you want to delete ${automation.name}?`,\n\t\t\tonConfirm: () => {\n\t\t\t\tdeleteAutomation(automation.id, {\n\t\t\t\t\tonSuccess: () => {\n\t\t\t\t\t\ttoast.success(\"Automation deleted\");\n\t\t\t\t\t\tif (shouldNavigate) {\n\t\t\t\t\t\t\tvoid navigate({ to: \"/automations\" });\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\tonError: (error) => {\n\t\t\t\t\t\tconst message =\n\t\t\t\t\t\t\terror.message || \"Unknown error while deleting automation.\";\n\t\t\t\t\t\ttoast.error(message);\n\t\t\t\t\t\tconsole.error(message);\n\t\t\t\t\t},\n\t\t\t\t});\n\t\t\t},\n\t\t});\n\n\treturn [dialogState, handleConfirmDelete] as const;\n};\n"],"names":["useGetAutomationActionResources","automation","automationIds","blockDocumentIds","deploymentIds","workPoolIds","workQueueIds","getResourceSets","automationsData","automationsLoading","useListAutomationsQueries","remainingQueries","useQueries","buildListFilterBlockDocumentsQuery","buildFilterDeploymentsQuery","buildFilterWorkPoolsQuery","buildFilterWorkQueuesQuery","results","blockDocuments","deployments","workPools","workQueues","result","listToMap","automationId","buildGetAutomationQuery","retMap","actions","action","list","map","item","ACTION_TYPE_TO_STRING","ActionDetails","automationsMap","blockDocumentsMap","deploymentsMap","workPoolsMap","workQueuesMap","jsx","Card","ActionDetailsType","label","NoninferredAction","deployment","DeploymentActionDetails","Typography","InferredAction","workQueue","WorkQueueActionDetails","AutomationActionDetails","workPool","WorkPoolActionDetails","blockDocument","BlockDocumentActionDetails","ChangeFlowRunStateActionDetails","ActionResource","children","ActionResourceName","iconId","name","jsxs","Icon","type","StateBadge","parameters","job_variables","Link","RunDeploymentJsonDialog","title","payload","Dialog","DialogTrigger","Button","capitalize","DialogContent","DialogHeader","DialogTitle","JsonInput","_label","TriggerDetailsCompound","trigger","triggerCount","requireValue","requireLabel","TriggerDetailsCustom","DeploymentLink","deploymentId","Suspense","Skeleton","DeploymentLinkImplementation","useSuspenseQuery","buildDeploymentDetailsQuery","DEFAULT_EVENT_TRIGGER_THRESHOLD","DEPLOYMENT_STATUS_EVENTS","WORK_POOL_STATUS_EVENTS","WORK_QUEUE_STATUS_EVENTS","isRecord","value","isEventTrigger","isCompoundTrigger","isSequenceTrigger","asArray","getTriggerMatchValue","key","match","isMatchResource","predicate","prefectResourceIds","isForEachResource","resource","isAfterResource","isExpectResource","isDeploymentStatusEvent","event","isWorkPoolStatusEvent","isWorkQueueStatusEvent","isDeploymentStatusTrigger","triggerAfters","after","triggerExpects","expect","getTriggerMatchRelatedValue","matchRelated","matchRelatedArray","values","isEmptyMatchRelated","isMatchRelatedResource","isFlowRunStateTriggerMatchRelated","isFlowRunStateTrigger","isWorkPoolStatusTrigger","isWorkQueueStatusTrigger","automationTriggerTemplateChecks","getAutomationTriggerTemplate","guard","getAutomationTriggerEventPostureLabel","posture","getWorkQueueStatusLabel","status","exhaustive","getDeploymentStatusLabel","TriggerDetailsDeploymentStatus","time","isAnyDeployment","postureLabel","statusLabel","index","secondsToString","mapStateNameToStateType","stateName","normalizedName","TriggerDetailsFlowRunState","flowIds","tags","states","Fragment","flowId","FlowLink","TagBadgeGroup","state","stateType","secondsToApproximateString","TriggerDetailsSequence","getStatusLabel","WorkPoolLinkInline","workPoolName","renderWorkPoolLinks","TriggerDetailsWorkPoolStatus","useQuery","workPoolLabel","pluralize","TriggerDetailsWorkQueueStatus","props","TriggerDetailsWorkQueueStatusImplementation","workPoolNames","anyWorkQueue","anyWorkPool","useSuspenseQueries","id","buildGetWorkQueueQuery","query","WorkQueueIconText","WorkPoolLink","getMatchValue","getMatchRelatedValue","fromResourceId","v","fromStateNameEvents","events","extractFlowRunStateProps","matchRelatedResourceIds","DEPLOYMENT_STATUS_EVENT_TO_STATUS","extractDeploymentStatusProps","resourceIdValue","statusEvents","WORK_POOL_STATUS_EVENT_TO_STATUS","extractWorkPoolStatusProps","WORK_QUEUE_STATUS_EVENT_TO_STATUS","extractWorkQueueStatusProps","TriggerDetails","AutomationDescription","AutomationTrigger","AutomationActions","resources","loading","_","i","AutomationEnableToggle","updateAutomation","useUpdateAutomation","handleCheckedChange","checked","toast","error","message","Switch","AutomationsActionsMenu","onDelete","handleCopyId","DropdownMenu","DropdownMenuTrigger","DropdownMenuContent","DropdownMenuLabel","DropdownMenuItem","DOCS_LINKS","useDeleteAutomationConfirmationDialog","navigate","useNavigate","dialogState","confirmDelete","useDeleteConfirmationDialog","deleteAutomation","useDeleteAutomation","shouldNavigate"],"mappings":"ilBAiCO,MAAMA,GAAmCC,GAA2B,CAC1E,KAAM,CACL,cAAAC,EACA,iBAAAC,EACA,cAAAC,EACA,YAAAC,EACA,aAAAC,CAAA,EACGC,GAAgBN,EAAW,OAAO,EAGhC,CAAE,KAAMO,EAAiB,QAASC,GACvCC,GAA0B,MAAM,KAAKR,CAAa,CAAC,EAG9CS,EAAmBC,EAAW,CACnC,QAAS,CACRC,GACC,CACC,OAAQ,EACR,KAAM,0BACN,gBAAiB,GACjB,gBAAiB,CAChB,SAAU,OACV,GAAI,CAAE,KAAM,MAAM,KAAKV,CAAgB,CAAA,EACvC,aAAc,CAAA,CAAC,CAChB,EAED,CAAE,QAASA,EAAiB,KAAO,CAAA,CAAE,EAEtCW,GACC,CACC,OAAQ,EACR,KAAM,eACN,YAAa,CACZ,GAAI,CAAE,KAAM,MAAM,KAAKV,CAAa,CAAA,EACpC,SAAU,MAAA,CACX,EAED,CAAE,QAASA,EAAc,KAAO,CAAA,CAAE,EAEnCW,EACC,CACC,OAAQ,EACR,WAAY,CACX,GAAI,CAAE,KAAM,MAAM,KAAKV,CAAW,CAAA,EAClC,SAAU,MAAA,CACX,EAED,CAA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AgC7B,MAAO,CAACJ,EA9BoB,CAC3BnO,EACA,CACC,eAAAwO,EAAiB,EAAA,EAId,CAAA,IAEJJ,EAAc,CACb,MAAO,oBACP,YAAa,mCAAmCpO,EAAW,IAAI,IAC/D,UAAW,IAAM,CAChBsO,EAAiBtO,EAAW,GAAI,CAC/B,UAAW,IAAM,CAChBmN,EAAM,QAAQ,oBAAoB,EAC9BqB,GACEP,EAAS,CAAE,GAAI,eAAgB,CAEtC,EACA,QAAUb,GAAU,CACnB,MAAMC,EACLD,EAAM,SAAW,2CAClBD,EAAM,MAAME,CAAO,EACnB,QAAQ,MAAMA,CAAO,CACtB,CAAA,CACA,CACF,CAAA,CACA,CAEsC,CACzC"}
|
|
1
|
+
{"version":3,"file":"use-delete-automation-confirmation-dialog-BpBSjz60.js","sources":["../../src/api/automations/use-get-automation-action-resources/use-get-automation-action-resources.ts","../../src/components/automations/action-details/action-details.tsx","../../src/components/automations/trigger-details/trigger-details-compound.tsx","../../src/components/automations/trigger-details/trigger-details-custom.tsx","../../src/components/deployments/deployment-link.tsx","../../src/components/automations/trigger-details/trigger-utils.ts","../../src/components/automations/trigger-details/trigger-details-deployment-status.tsx","../../src/components/automations/trigger-details/trigger-details-flow-run-state.tsx","../../src/components/automations/trigger-details/trigger-details-sequence.tsx","../../src/components/automations/trigger-details/trigger-details-work-pool-status.tsx","../../src/components/automations/trigger-details/trigger-details-work-queue-status.tsx","../../src/components/automations/trigger-details/trigger-details.tsx","../../src/components/automations/automation-details.tsx","../../src/components/automations/automation-enable-toggle/automation-enable-toggle.tsx","../../src/components/automations/automations-actions-menu/automations-actions-menu.tsx","../../src/components/automations/use-delete-automation-confirmation-dialog.ts"],"sourcesContent":["import { useQueries } from \"@tanstack/react-query\";\nimport { type Automation, buildGetAutomationQuery } from \"@/api/automations\";\nimport { buildListFilterBlockDocumentsQuery } from \"@/api/block-documents\";\nimport { buildFilterDeploymentsQuery } from \"@/api/deployments\";\nimport { buildFilterWorkPoolsQuery } from \"@/api/work-pools\";\nimport { buildFilterWorkQueuesQuery } from \"@/api/work-queues\";\n\n/**\n *\n * @param automation\n * @returns an object of maps to get information about an action's selected source (automations, deployments, work pools, and work queues)\n *\n * @example\n * ```ts\n * const { loading, data } = useGetAutomationActionResources(MY_AUTOMATION);\n *\n *\n * if (loading) {\n * return \"Loading...\"\n * }\n *\n * const { automationsMap, blockDocumentsMap, deploymentsMap, workPoolsMap, workQueuesMap } = data\n * return (\n * \t\t<ActionDetails\n *\t\t\tautomation={MY_AUTOMATION}\n *\t\t\tautomations={automationsMap}\n *\t\t\tblockDocumentsMap={blockDocumentsMap}\n *\t\t\tdeployments={deploymentsMap}\n *\t\t\tworkPools={workPoolsMap}\n *\t\t\tworkQueues={workQueuesMap}\n *\t\t/>)\n * ```\n */\nexport const useGetAutomationActionResources = (automation: Automation) => {\n\tconst {\n\t\tautomationIds,\n\t\tblockDocumentIds,\n\t\tdeploymentIds,\n\t\tworkPoolIds,\n\t\tworkQueueIds,\n\t} = getResourceSets(automation.actions);\n\n\t// nb: Automations /filter doesn't support `id`. Need to do it per GET call\n\tconst { data: automationsData, loading: automationsLoading } =\n\t\tuseListAutomationsQueries(Array.from(automationIds));\n\n\t// Need to do deployments filter API\n\tconst remainingQueries = useQueries({\n\t\tqueries: [\n\t\t\tbuildListFilterBlockDocumentsQuery(\n\t\t\t\t{\n\t\t\t\t\toffset: 0,\n\t\t\t\t\tsort: \"BLOCK_TYPE_AND_NAME_ASC\",\n\t\t\t\t\tinclude_secrets: false,\n\t\t\t\t\tblock_documents: {\n\t\t\t\t\t\toperator: \"and_\",\n\t\t\t\t\t\tid: { any_: Array.from(blockDocumentIds) },\n\t\t\t\t\t\tis_anonymous: {},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{ enabled: blockDocumentIds.size > 0 },\n\t\t\t),\n\t\t\tbuildFilterDeploymentsQuery(\n\t\t\t\t{\n\t\t\t\t\toffset: 0,\n\t\t\t\t\tsort: \"CREATED_DESC\",\n\t\t\t\t\tdeployments: {\n\t\t\t\t\t\tid: { any_: Array.from(deploymentIds) },\n\t\t\t\t\t\toperator: \"and_\",\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{ enabled: deploymentIds.size > 0 },\n\t\t\t),\n\t\t\tbuildFilterWorkPoolsQuery(\n\t\t\t\t{\n\t\t\t\t\toffset: 0,\n\t\t\t\t\twork_pools: {\n\t\t\t\t\t\tid: { any_: Array.from(workPoolIds) },\n\t\t\t\t\t\toperator: \"and_\",\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{ enabled: workPoolIds.size > 0 },\n\t\t\t),\n\t\t\tbuildFilterWorkQueuesQuery(\n\t\t\t\t{\n\t\t\t\t\toffset: 0,\n\t\t\t\t\twork_queues: {\n\t\t\t\t\t\tid: { any_: Array.from(workQueueIds) },\n\t\t\t\t\t\toperator: \"and_\",\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{ enabled: workQueueIds.size > 0 },\n\t\t\t),\n\t\t],\n\t\tcombine: (results) => {\n\t\t\tconst [blockDocuments, deployments, workPools, workQueues] = results;\n\t\t\treturn {\n\t\t\t\tdata: {\n\t\t\t\t\tblockDocuments: blockDocuments.data,\n\t\t\t\t\tdeployments: deployments.data,\n\t\t\t\t\tworkPools: workPools.data,\n\t\t\t\t\tworkQueues: workQueues.data,\n\t\t\t\t},\n\t\t\t\tloading: results.some((result) => result.isLoading),\n\t\t\t};\n\t\t},\n\t});\n\n\treturn {\n\t\tloading: automationsLoading || remainingQueries.loading,\n\t\tdata: {\n\t\t\tautomationsMap: automationsData,\n\t\t\tblockDocumentsMap: listToMap(remainingQueries.data.blockDocuments),\n\t\t\tdeploymentsMap: listToMap(remainingQueries.data.deployments),\n\t\t\tworkPoolsMap: listToMap(remainingQueries.data.workPools),\n\t\t\tworkQueuesMap: listToMap(remainingQueries.data.workQueues),\n\t\t},\n\t};\n};\n\nconst useListAutomationsQueries = (automationIds: Array<string>) =>\n\tuseQueries({\n\t\tqueries: Array.from(automationIds).map((automationId) =>\n\t\t\tbuildGetAutomationQuery(automationId),\n\t\t),\n\t\tcombine: (results) => {\n\t\t\tconst retMap = new Map<string, Automation>();\n\t\t\tfor (const result of results) {\n\t\t\t\tif (result.data) {\n\t\t\t\t\tretMap.set(result.data.id, result.data);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn {\n\t\t\t\tdata: retMap,\n\t\t\t\tloading: results.some((result) => result.isLoading),\n\t\t\t};\n\t\t},\n\t});\n\nexport const getResourceSets = (actions: Automation[\"actions\"]) => {\n\tconst automationIds = new Set<string>();\n\tconst blockDocumentIds = new Set<string>();\n\tconst deploymentIds = new Set<string>();\n\tconst workPoolIds = new Set<string>();\n\tconst workQueueIds = new Set<string>();\n\n\tfor (const action of actions) {\n\t\tswitch (action.type) {\n\t\t\tcase \"run-deployment\":\n\t\t\tcase \"pause-deployment\":\n\t\t\tcase \"resume-deployment\":\n\t\t\t\tif (action.deployment_id) {\n\t\t\t\t\tdeploymentIds.add(action.deployment_id);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase \"pause-work-queue\":\n\t\t\tcase \"resume-work-queue\":\n\t\t\t\tif (action.work_queue_id) {\n\t\t\t\t\tworkQueueIds.add(action.work_queue_id);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase \"pause-automation\":\n\t\t\tcase \"resume-automation\":\n\t\t\t\tif (action.automation_id) {\n\t\t\t\t\tautomationIds.add(action.automation_id);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase \"pause-work-pool\":\n\t\t\tcase \"resume-work-pool\":\n\t\t\t\tif (action.work_pool_id) {\n\t\t\t\t\tworkPoolIds.add(action.work_pool_id);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase \"send-notification\":\n\t\t\tcase \"call-webhook\":\n\t\t\t\tif (action.block_document_id) {\n\t\t\t\t\tblockDocumentIds.add(action.block_document_id);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t// TODO: add these back when the corresponding actions are implemented\n\t\t\t// case \"do-nothing\":\n\t\t\t// case \"cancel-flow-run\":\n\t\t\t// case \"change-flow-run-state\":\n\t\t\t// case \"suspend-flow-run\":\n\t\t\t// case \"resume-flow-run\":\n\t\t}\n\t}\n\n\treturn {\n\t\tautomationIds,\n\t\tblockDocumentIds,\n\t\tdeploymentIds,\n\t\tworkPoolIds,\n\t\tworkQueueIds,\n\t};\n};\n\nfunction listToMap<T extends { id: string }>(\n\tlist: T[] | undefined,\n): Map<T[\"id\"], T> {\n\tconst map = new Map<T[\"id\"], T>();\n\tfor (const item of list ?? []) {\n\t\tmap.set(item.id, item);\n\t}\n\treturn map;\n}\n","import { Link } from \"@tanstack/react-router\";\nimport type { Automation } from \"@/api/automations\";\nimport type { BlockDocument } from \"@/api/block-documents\";\nimport type { Deployment } from \"@/api/deployments\";\nimport type { components } from \"@/api/prefect\";\nimport type { WorkPool } from \"@/api/work-pools\";\nimport type { WorkQueue } from \"@/api/work-queues\";\nimport { Button } from \"@/components/ui/button\";\nimport { Card } from \"@/components/ui/card\";\nimport {\n\tDialog,\n\tDialogContent,\n\tDialogHeader,\n\tDialogTitle,\n\tDialogTrigger,\n} from \"@/components/ui/dialog\";\nimport { Icon, type IconId } from \"@/components/ui/icons\";\nimport { LazyJsonInput as JsonInput } from \"@/components/ui/json-input-lazy\";\nimport { StateBadge } from \"@/components/ui/state-badge\";\nimport { Typography } from \"@/components/ui/typography\";\nimport { capitalize } from \"@/utils\";\n\nconst ACTION_TYPE_TO_STRING = {\n\t\"cancel-flow-run\": \"Cancel flow run\",\n\t\"suspend-flow-run\": \"Suspend flow run\",\n\t\"resume-flow-run\": \"Resume a flow run\",\n\t\"change-flow-run-state\": \"Change state of a flow run\",\n\t\"run-deployment\": \"Run deployment\",\n\t\"pause-deployment\": \"Pause deployment\",\n\t\"resume-deployment\": \"Resume deployment\",\n\t\"pause-work-queue\": \"Pause work queue\",\n\t\"resume-work-queue\": \"Resume work queue\",\n\t\"pause-work-pool\": \"Pause work pool\",\n\t\"resume-work-pool\": \"Resume work pool\",\n\t\"pause-automation\": \"Pause automation\",\n\t\"resume-automation\": \"Resume automation\",\n\t\"call-webhook\": \"Call a custom webhook notification\",\n\t/** Default string if `block_type_name` is not found. */\n\t\"send-notification\": \"Send a notification using\",\n\t\"do-nothing\": \"Do nothing\",\n} as const;\ntype ActionLabel =\n\t(typeof ACTION_TYPE_TO_STRING)[keyof typeof ACTION_TYPE_TO_STRING];\n\ntype AutomationAction = Automation[\"actions\"][number];\n\ntype ActionDetailsProps = {\n\taction: AutomationAction;\n\tautomationsMap: Map<string, Automation>;\n\tblockDocumentsMap: Map<string, BlockDocument>;\n\tdeploymentsMap: Map<string, Deployment>;\n\tworkPoolsMap: Map<string, WorkPool>;\n\tworkQueuesMap: Map<string, WorkQueue>;\n};\nexport const ActionDetails = ({\n\taction,\n\tautomationsMap,\n\tblockDocumentsMap,\n\tdeploymentsMap,\n\tworkPoolsMap,\n\tworkQueuesMap,\n}: ActionDetailsProps) => (\n\t<Card className=\"p-4\">\n\t\t<ActionDetailsType\n\t\t\taction={action}\n\t\t\tautomationsMap={automationsMap}\n\t\t\tblockDocumentsMap={blockDocumentsMap}\n\t\t\tdeploymentsMap={deploymentsMap}\n\t\t\tworkPoolsMap={workPoolsMap}\n\t\t\tworkQueuesMap={workQueuesMap}\n\t\t/>\n\t</Card>\n);\n\nconst ActionDetailsType = ({\n\taction,\n\tautomationsMap,\n\tblockDocumentsMap,\n\tdeploymentsMap,\n\tworkPoolsMap,\n\tworkQueuesMap,\n}: ActionDetailsProps) => {\n\tconst label = ACTION_TYPE_TO_STRING[action.type];\n\tswitch (action.type) {\n\t\t// Non-inferrable Actions\n\t\tcase \"cancel-flow-run\":\n\t\tcase \"suspend-flow-run\":\n\t\tcase \"resume-flow-run\":\n\t\tcase \"call-webhook\": // Not used\n\t\tcase \"do-nothing\": // not used\n\t\t\treturn <NoninferredAction label={label} />;\n\t\t// Inferable actions\n\t\tcase \"run-deployment\":\n\t\t\tif (action.deployment_id && action.source === \"selected\") {\n\t\t\t\tconst deployment = deploymentsMap.get(action.deployment_id);\n\t\t\t\tif (!deployment) {\n\t\t\t\t\treturn <Typography>Deployment not found</Typography>;\n\t\t\t\t}\n\t\t\t\treturn (\n\t\t\t\t\t<DeploymentActionDetails\n\t\t\t\t\t\tlabel={label}\n\t\t\t\t\t\tdeployment={deployment}\n\t\t\t\t\t\tparameters={action.parameters}\n\t\t\t\t\t\tjob_variables={action.job_variables}\n\t\t\t\t\t/>\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn <InferredAction label={label} />;\n\t\tcase \"pause-deployment\":\n\t\tcase \"resume-deployment\":\n\t\t\tif (action.deployment_id && action.source === \"selected\") {\n\t\t\t\tconst deployment = deploymentsMap.get(action.deployment_id);\n\t\t\t\tif (!deployment) {\n\t\t\t\t\treturn <Typography>Deployment not found</Typography>;\n\t\t\t\t}\n\t\t\t\treturn (\n\t\t\t\t\t<DeploymentActionDetails label={label} deployment={deployment} />\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn <InferredAction label={label} />;\n\t\tcase \"pause-work-queue\":\n\t\tcase \"resume-work-queue\":\n\t\t\tif (action.work_queue_id && action.source === \"selected\") {\n\t\t\t\tconst workQueue = workQueuesMap.get(action.work_queue_id);\n\t\t\t\tif (!workQueue) {\n\t\t\t\t\treturn <Typography>Work queue not found</Typography>;\n\t\t\t\t}\n\t\t\t\treturn <WorkQueueActionDetails label={label} workQueue={workQueue} />;\n\t\t\t}\n\t\t\treturn <InferredAction label={label} />;\n\t\tcase \"pause-automation\":\n\t\tcase \"resume-automation\":\n\t\t\tif (action.automation_id && action.source === \"selected\") {\n\t\t\t\tconst automation = automationsMap.get(action.automation_id);\n\t\t\t\tif (!automation) {\n\t\t\t\t\treturn <Typography>Automation not found</Typography>;\n\t\t\t\t}\n\t\t\t\treturn (\n\t\t\t\t\t<AutomationActionDetails label={label} automation={automation} />\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn <InferredAction label={label} />;\n\t\tcase \"pause-work-pool\":\n\t\tcase \"resume-work-pool\":\n\t\t\tif (action.work_pool_id && action.source === \"selected\") {\n\t\t\t\tconst workPool = workPoolsMap.get(action.work_pool_id);\n\t\t\t\tif (!workPool) {\n\t\t\t\t\treturn <Typography>Workpool not found</Typography>;\n\t\t\t\t}\n\t\t\t\treturn <WorkPoolActionDetails label={label} workPool={workPool} />;\n\t\t\t}\n\t\t\treturn <InferredAction label={label} />;\n\t\t// Other actions\n\t\tcase \"send-notification\": {\n\t\t\tconst blockDocument = blockDocumentsMap.get(action.block_document_id);\n\t\t\tif (!blockDocument) {\n\t\t\t\treturn <Typography>Block document not found</Typography>;\n\t\t\t}\n\t\t\treturn (\n\t\t\t\t<BlockDocumentActionDetails\n\t\t\t\t\tlabel={label}\n\t\t\t\t\tblockDocument={blockDocument}\n\t\t\t\t/>\n\t\t\t);\n\t\t}\n\t\tcase \"change-flow-run-state\":\n\t\t\treturn (\n\t\t\t\t<ChangeFlowRunStateActionDetails\n\t\t\t\t\tlabel={label}\n\t\t\t\t\ttype={action.state}\n\t\t\t\t\tname={action.name}\n\t\t\t\t/>\n\t\t\t);\n\t\tdefault:\n\t\t\treturn null;\n\t}\n};\n\nconst ActionResource = ({ children }: { children: React.ReactNode }) => (\n\t<div className=\"text-sm flex items-center gap-1\">{children}</div>\n);\n\nconst ActionResourceName = ({\n\ticonId,\n\tname,\n}: {\n\tname: string;\n\ticonId: IconId;\n}) => (\n\t<div className=\"text-xs flex items-center\">\n\t\t<Icon id={iconId} className=\"size-4 mr-1\" />\n\t\t{name}\n\t</div>\n);\n\nconst NoninferredAction = ({ label }: { label: ActionLabel }) => (\n\t<Typography variant=\"bodySmall\">{label} from the triggering event</Typography>\n);\n\nconst InferredAction = ({ label }: { label: ActionLabel }) => (\n\t<Typography variant=\"bodySmall\">\n\t\t{label} inferred from the triggering event\n\t</Typography>\n);\n\ntype ChangeFlowRunStateActionDetailsProps = {\n\tlabel: ActionLabel;\n\ttype: components[\"schemas\"][\"StateType\"];\n\tname?: string | null;\n};\n\nexport const ChangeFlowRunStateActionDetails = ({\n\tlabel,\n\ttype,\n\tname,\n}: ChangeFlowRunStateActionDetailsProps) => {\n\treturn (\n\t\t<ActionResource>\n\t\t\t<InferredAction label={label} /> to <StateBadge type={type} name={name} />\n\t\t</ActionResource>\n\t);\n};\n\n// Selected resources\ntype DeploymentActionDetailsProps = {\n\tlabel: ActionLabel;\n\tdeployment: Deployment;\n\tparameters?: Record<string, unknown> | null;\n\tjob_variables?: Record<string, unknown> | null;\n};\nexport const DeploymentActionDetails = ({\n\tlabel,\n\tdeployment,\n\tparameters,\n\tjob_variables,\n}: DeploymentActionDetailsProps) => {\n\treturn (\n\t\t<ActionResource>\n\t\t\t<label htmlFor={`${label}-${deployment.id}`}>{label}:</label>\n\t\t\t<Link\n\t\t\t\tto=\"/deployments/deployment/$id\"\n\t\t\t\tparams={{ id: deployment.id }}\n\t\t\t\taria-label={deployment.name}\n\t\t\t>\n\t\t\t\t<ActionResourceName iconId=\"Rocket\" name={deployment.name} />\n\t\t\t</Link>\n\t\t\t{parameters !== undefined && (\n\t\t\t\t<RunDeploymentJsonDialog title=\"Parameters\" payload={parameters} />\n\t\t\t)}\n\t\t\t{job_variables !== undefined && (\n\t\t\t\t<RunDeploymentJsonDialog\n\t\t\t\t\ttitle=\"Job Variables\"\n\t\t\t\t\tpayload={job_variables}\n\t\t\t\t/>\n\t\t\t)}\n\t\t</ActionResource>\n\t);\n};\n\ntype RunDeploymentJsonDialogProps = {\n\ttitle: string;\n\tpayload: Record<string, unknown> | null | undefined;\n};\n\nconst RunDeploymentJsonDialog = ({\n\ttitle,\n\tpayload,\n}: RunDeploymentJsonDialogProps) => {\n\treturn (\n\t\t<Dialog>\n\t\t\t<DialogTrigger asChild>\n\t\t\t\t<Button variant=\"secondary\" size=\"sm\">\n\t\t\t\t\tShow {capitalize(title)}\n\t\t\t\t</Button>\n\t\t\t</DialogTrigger>\n\t\t\t<DialogContent aria-describedby={undefined}>\n\t\t\t\t<DialogHeader>\n\t\t\t\t\t<DialogTitle>{title}</DialogTitle>\n\t\t\t\t</DialogHeader>\n\t\t\t\t<JsonInput value={JSON.stringify(payload)} disabled />\n\t\t\t</DialogContent>\n\t\t</Dialog>\n\t);\n};\n\ntype AutomationActionDetailsProps = {\n\tlabel: ActionLabel;\n\tautomation: Automation;\n};\nexport const AutomationActionDetails = ({\n\tlabel,\n\tautomation,\n}: AutomationActionDetailsProps) => {\n\treturn (\n\t\t<ActionResource>\n\t\t\t<label htmlFor={`${label}-${automation.id}`}>{label}:</label>\n\t\t\t<Link\n\t\t\t\tto=\"/automations/automation/$id\"\n\t\t\t\tparams={{ id: automation.id }}\n\t\t\t\taria-label={automation.name}\n\t\t\t>\n\t\t\t\t<ActionResourceName iconId=\"Bot\" name={automation.name} />\n\t\t\t</Link>\n\t\t</ActionResource>\n\t);\n};\n\ntype BlockDocumentActionDetailsProps = {\n\tlabel: ActionLabel;\n\tblockDocument: BlockDocument;\n};\nexport const BlockDocumentActionDetails = ({\n\tlabel,\n\tblockDocument,\n}: BlockDocumentActionDetailsProps) => {\n\tif (!blockDocument.name) {\n\t\treturn <Typography>Block not found</Typography>;\n\t}\n\n\tconst _label = blockDocument.block_type_name\n\t\t? `Send a ${blockDocument.block_type_name.toLowerCase()} using`\n\t\t: label;\n\n\treturn (\n\t\t<ActionResource>\n\t\t\t<label htmlFor={`${label}-${blockDocument.id}`}>{_label}</label>\n\t\t\t<Link\n\t\t\t\tto=\"/blocks/block/$id\"\n\t\t\t\tparams={{ id: blockDocument.id }}\n\t\t\t\taria-label={blockDocument.name}\n\t\t\t>\n\t\t\t\t<ActionResourceName iconId=\"Box\" name={blockDocument.name} />\n\t\t\t</Link>\n\t\t</ActionResource>\n\t);\n};\n\ntype WorkPoolActionDetailsProps = {\n\tlabel: ActionLabel;\n\tworkPool: WorkPool;\n};\nexport const WorkPoolActionDetails = ({\n\tlabel,\n\tworkPool,\n}: WorkPoolActionDetailsProps) => {\n\treturn (\n\t\t<ActionResource>\n\t\t\t<label htmlFor={`${label}-${workPool.id}`}>{label}:</label>\n\t\t\t<Link\n\t\t\t\tto=\"/work-pools/work-pool/$workPoolName\"\n\t\t\t\tparams={{ workPoolName: workPool.name }}\n\t\t\t\taria-label={workPool.name}\n\t\t\t>\n\t\t\t\t<ActionResourceName iconId=\"Cpu\" name={workPool.name} />\n\t\t\t</Link>\n\t\t</ActionResource>\n\t);\n};\n\ntype WorkQueueActionDetailsProps = {\n\tlabel: ActionLabel;\n\tworkQueue: WorkQueue;\n};\nexport const WorkQueueActionDetails = ({\n\tlabel,\n\tworkQueue,\n}: WorkQueueActionDetailsProps) => {\n\treturn (\n\t\t<ActionResource>\n\t\t\t<label htmlFor={`${label}-${workQueue.id}`}>{label}:</label>\n\t\t\t<Link\n\t\t\t\tto=\"/work-pools/work-pool/$workPoolName/queue/$workQueueName\"\n\t\t\t\tparams={{\n\t\t\t\t\tworkPoolName: workQueue.name,\n\t\t\t\t\tworkQueueName: workQueue.name,\n\t\t\t\t}}\n\t\t\t\taria-label={workQueue.name}\n\t\t\t>\n\t\t\t\t<ActionResourceName iconId=\"Cpu\" name={workQueue.name} />\n\t\t\t</Link>\n\t\t</ActionResource>\n\t);\n};\n","import { Typography } from \"@/components/ui/typography\";\nimport type { CompoundTrigger } from \"./trigger-utils\";\n\ntype TriggerDetailsCompoundProps = {\n\ttrigger: CompoundTrigger;\n};\n\nexport const TriggerDetailsCompound = ({\n\ttrigger,\n}: TriggerDetailsCompoundProps) => {\n\tconst triggerCount = trigger.triggers?.length ?? 0;\n\tconst requireValue = trigger.require;\n\n\tlet requireLabel: string;\n\tif (requireValue === \"all\") {\n\t\trequireLabel = \"all\";\n\t} else if (requireValue === \"any\") {\n\t\trequireLabel = \"any\";\n\t} else if (typeof requireValue === \"number\") {\n\t\trequireLabel = `at least ${requireValue}`;\n\t} else {\n\t\trequireLabel = \"all\";\n\t}\n\n\treturn (\n\t\t<div className=\"flex flex-wrap gap-1 items-center\">\n\t\t\t<Typography variant=\"bodySmall\">\n\t\t\t\tA compound trigger requiring {requireLabel} of {triggerCount} nested{\" \"}\n\t\t\t\t{triggerCount === 1 ? \"trigger\" : \"triggers\"} to fire\n\t\t\t</Typography>\n\t\t</div>\n\t);\n};\n","import { Typography } from \"@/components/ui/typography\";\n\nexport const TriggerDetailsCustom = () => {\n\treturn <Typography variant=\"bodySmall\">A custom trigger</Typography>;\n};\n","import { useSuspenseQuery } from \"@tanstack/react-query\";\nimport { Link } from \"@tanstack/react-router\";\nimport { Suspense } from \"react\";\nimport { buildDeploymentDetailsQuery } from \"@/api/deployments\";\nimport { Icon } from \"@/components/ui/icons\";\nimport { Skeleton } from \"@/components/ui/skeleton\";\n\ntype DeploymentLinkProps = {\n\tdeploymentId: string;\n};\n\nexport const DeploymentLink = ({ deploymentId }: DeploymentLinkProps) => {\n\treturn (\n\t\t<Suspense fallback={<Skeleton className=\"h-4 w-full\" />}>\n\t\t\t<DeploymentLinkImplementation deploymentId={deploymentId} />\n\t\t</Suspense>\n\t);\n};\n\nconst DeploymentLinkImplementation = ({\n\tdeploymentId,\n}: DeploymentLinkProps) => {\n\tconst { data: deployment } = useSuspenseQuery(\n\t\tbuildDeploymentDetailsQuery(deploymentId),\n\t);\n\n\treturn (\n\t\t<div className=\"flex items-center gap-1 text-xs\">\n\t\t\tDeployment\n\t\t\t<Link\n\t\t\t\tto=\"/deployments/deployment/$id\"\n\t\t\t\tparams={{ id: deployment.id }}\n\t\t\t\tclassName=\"flex items-center gap-1\"\n\t\t\t>\n\t\t\t\t<Icon id=\"Rocket\" className=\"size-4\" />\n\t\t\t\t{deployment.name}\n\t\t\t</Link>\n\t\t</div>\n\t);\n};\n","import type { components } from \"@/api/prefect\";\n\n// Type aliases for OpenAPI schema types\nexport type EventTrigger = components[\"schemas\"][\"EventTrigger\"];\nexport type CompoundTrigger = components[\"schemas\"][\"CompoundTrigger-Input\"];\nexport type SequenceTrigger = components[\"schemas\"][\"SequenceTrigger-Input\"];\n\n// Union type for all automation triggers\nexport type AutomationTrigger =\n\t| EventTrigger\n\t| CompoundTrigger\n\t| SequenceTrigger;\n\n// Template constants - following Vue implementation (5 templates)\nexport const AUTOMATION_TRIGGER_TEMPLATES = [\n\t\"deployment-status\",\n\t\"flow-run-state\",\n\t\"work-pool-status\",\n\t\"work-queue-status\",\n\t\"custom\",\n] as const;\n\nexport type AutomationTriggerTemplate =\n\t(typeof AUTOMATION_TRIGGER_TEMPLATES)[number];\n\n// Event posture types\nexport type AutomationTriggerEventPosture = \"Reactive\" | \"Proactive\";\n\n// Default threshold for event triggers (from Vue implementation)\nexport const DEFAULT_EVENT_TRIGGER_THRESHOLD = 1;\n\n// Event constants for each template type\nexport const DEPLOYMENT_STATUS_EVENTS = [\n\t\"prefect.deployment.ready\",\n\t\"prefect.deployment.not-ready\",\n\t\"prefect.deployment.disabled\",\n] as const;\n\nexport const WORK_POOL_STATUS_EVENTS = [\n\t\"prefect.work-pool.ready\",\n\t\"prefect.work-pool.not-ready\",\n\t\"prefect.work-pool.paused\",\n\t\"prefect.work-pool.not_ready\",\n] as const;\n\nexport const WORK_QUEUE_STATUS_EVENTS = [\n\t\"prefect.work-queue.ready\",\n\t\"prefect.work-queue.not-ready\",\n\t\"prefect.work-queue.paused\",\n] as const;\n\n// Type guard helper - check if value is a record/object\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n\treturn typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n\n// Primary type guards for trigger types\nexport function isEventTrigger(trigger: unknown): trigger is EventTrigger {\n\treturn (\n\t\tisRecord(trigger) &&\n\t\ttrigger.type === \"event\" &&\n\t\t(trigger.posture === \"Reactive\" || trigger.posture === \"Proactive\")\n\t);\n}\n\nexport function isCompoundTrigger(\n\ttrigger: unknown,\n): trigger is CompoundTrigger {\n\treturn (\n\t\tisRecord(trigger) &&\n\t\ttrigger.type === \"compound\" &&\n\t\tArray.isArray(trigger.triggers)\n\t);\n}\n\nexport function isSequenceTrigger(\n\ttrigger: unknown,\n): trigger is SequenceTrigger {\n\treturn (\n\t\tisRecord(trigger) &&\n\t\ttrigger.type === \"sequence\" &&\n\t\tArray.isArray(trigger.triggers)\n\t);\n}\n\nexport function isAutomationTrigger(\n\ttrigger: unknown,\n): trigger is AutomationTrigger {\n\treturn (\n\t\tisEventTrigger(trigger) ||\n\t\tisCompoundTrigger(trigger) ||\n\t\tisSequenceTrigger(trigger)\n\t);\n}\n\n// Helper to convert value to array (handles undefined, single value, or array)\nfunction asArray<T>(value: T | T[] | undefined | null): T[] {\n\tif (value === undefined || value === null) {\n\t\treturn [];\n\t}\n\treturn Array.isArray(value) ? value : [value];\n}\n\n// Get match value from trigger (handles snake_case field names from OpenAPI)\nfunction getTriggerMatchValue(\n\ttrigger: AutomationTrigger,\n\tkey: string,\n): string[] {\n\tif (isEventTrigger(trigger)) {\n\t\tconst match = trigger.match;\n\t\tif (match && typeof match === \"object\") {\n\t\t\tconst value = (match as Record<string, unknown>)[key];\n\t\t\treturn value ? asArray(value as string | string[]) : [];\n\t\t}\n\t}\n\treturn [];\n}\n\n// Validation helper: check if match resource satisfies predicate\nexport function isMatchResource(\n\ttrigger: AutomationTrigger,\n\tpredicate: (resourceIds: string[]) => boolean,\n): boolean {\n\tconst prefectResourceIds = getTriggerMatchValue(\n\t\ttrigger,\n\t\t\"prefect.resource.id\",\n\t);\n\n\tif (prefectResourceIds.length === 0) {\n\t\treturn false;\n\t}\n\n\treturn predicate(prefectResourceIds);\n}\n\n// Validation helper: check if for_each contains the expected resource\nexport function isForEachResource(\n\ttrigger: AutomationTrigger,\n\tresource: string,\n): boolean {\n\tif (isEventTrigger(trigger)) {\n\t\tconst forEach = trigger.for_each ?? [];\n\t\treturn forEach.every((value) => value.startsWith(resource));\n\t}\n\treturn false;\n}\n\n// Validation helper: check if after events satisfy predicate\nexport function isAfterResource(\n\ttrigger: AutomationTrigger,\n\tpredicate: (events: string[]) => boolean,\n): boolean {\n\tif (isEventTrigger(trigger)) {\n\t\treturn predicate(trigger.after ?? []);\n\t}\n\treturn false;\n}\n\n// Validation helper: check if expect events satisfy predicate\nexport function isExpectResource(\n\ttrigger: AutomationTrigger,\n\tpredicate: (events: string[]) => boolean,\n): boolean {\n\tif (isEventTrigger(trigger)) {\n\t\treturn predicate(trigger.expect ?? []);\n\t}\n\treturn false;\n}\n\n// Event type checkers\nfunction isDeploymentStatusEvent(event: string): boolean {\n\treturn (DEPLOYMENT_STATUS_EVENTS as readonly string[]).includes(event);\n}\n\nfunction isWorkPoolStatusEvent(event: string): boolean {\n\treturn (WORK_POOL_STATUS_EVENTS as readonly string[]).includes(event);\n}\n\nfunction isWorkQueueStatusEvent(event: string): boolean {\n\treturn (WORK_QUEUE_STATUS_EVENTS as readonly string[]).includes(event);\n}\n\n// Template-specific type guards\n\n/**\n * Check if trigger is a deployment-status template\n * Validates:\n * - Is an event trigger\n * - match['prefect.resource.id'] starts with 'prefect.deployment'\n * - for_each contains 'prefect.resource.id'\n * - after events are deployment status events\n * - expect events are deployment status events\n * - threshold === 1\n */\nexport function isDeploymentStatusTrigger(trigger: unknown): boolean {\n\treturn (\n\t\tisEventTrigger(trigger) &&\n\t\tisMatchResource(trigger, (prefectResourceIds) =>\n\t\t\tprefectResourceIds.every((value) =>\n\t\t\t\tvalue.startsWith(\"prefect.deployment\"),\n\t\t\t),\n\t\t) &&\n\t\tisForEachResource(trigger, \"prefect.resource.id\") &&\n\t\tisAfterResource(trigger, (triggerAfters) =>\n\t\t\ttriggerAfters.every((after) => isDeploymentStatusEvent(after)),\n\t\t) &&\n\t\tisExpectResource(trigger, (triggerExpects) =>\n\t\t\ttriggerExpects.every((expect) => isDeploymentStatusEvent(expect)),\n\t\t) &&\n\t\ttrigger.threshold === DEFAULT_EVENT_TRIGGER_THRESHOLD\n\t);\n}\n\n// Helper functions for flow-run-state template validation\nfunction getTriggerMatchRelatedValue(\n\ttrigger: EventTrigger,\n\tkey: string,\n): string[] {\n\tconst matchRelated = trigger.match_related;\n\tif (!matchRelated) {\n\t\treturn [];\n\t}\n\n\t// match_related can be a single object or an array of objects\n\tconst matchRelatedArray = Array.isArray(matchRelated)\n\t\t? matchRelated\n\t\t: [matchRelated];\n\n\tconst values: string[] = [];\n\tfor (const match of matchRelatedArray) {\n\t\tif (match && typeof match === \"object\") {\n\t\t\tconst value = (match as Record<string, unknown>)[key];\n\t\t\tif (value) {\n\t\t\t\tvalues.push(...asArray(value as string | string[]));\n\t\t\t}\n\t\t}\n\t}\n\treturn values;\n}\n\nfunction isEmptyMatchRelated(trigger: EventTrigger): boolean {\n\tconst matchRelated = trigger.match_related;\n\tif (!matchRelated) {\n\t\treturn true;\n\t}\n\tif (Array.isArray(matchRelated)) {\n\t\treturn matchRelated.length === 0;\n\t}\n\treturn Object.keys(matchRelated).length === 0;\n}\n\nfunction isMatchRelatedResource(\n\ttrigger: EventTrigger,\n\tresource: string,\n): boolean {\n\tconst prefectResourceIds = getTriggerMatchRelatedValue(\n\t\ttrigger,\n\t\t\"prefect.resource.id\",\n\t);\n\n\tif (prefectResourceIds.length === 0) {\n\t\treturn false;\n\t}\n\n\treturn prefectResourceIds.every((value) => value.startsWith(resource));\n}\n\nfunction isFlowRunStateTriggerMatchRelated(trigger: EventTrigger): boolean {\n\treturn (\n\t\tisEmptyMatchRelated(trigger) ||\n\t\tisMatchRelatedResource(trigger, \"prefect.flow\") ||\n\t\tisMatchRelatedResource(trigger, \"prefect.tag\")\n\t);\n}\n\n/**\n * Check if trigger is a flow-run-state template\n * Validates:\n * - Is an event trigger\n * - match['prefect.resource.id'] starts with 'prefect.flow-run'\n * - for_each contains 'prefect.resource.id'\n * - after events start with 'prefect.flow-run'\n * - expect events start with 'prefect.flow-run'\n * - matchRelated is empty OR contains flow/tag patterns\n * - threshold === 1\n */\nexport function isFlowRunStateTrigger(trigger: unknown): boolean {\n\treturn (\n\t\tisEventTrigger(trigger) &&\n\t\tisMatchResource(trigger, (prefectResourceIds) =>\n\t\t\tprefectResourceIds.every((value) => value.startsWith(\"prefect.flow-run\")),\n\t\t) &&\n\t\tisForEachResource(trigger, \"prefect.resource.id\") &&\n\t\tisAfterResource(trigger, (triggerAfters) =>\n\t\t\ttriggerAfters.every((after) => after.startsWith(\"prefect.flow-run\")),\n\t\t) &&\n\t\tisExpectResource(trigger, (triggerExpects) =>\n\t\t\ttriggerExpects.every((expect) => expect.startsWith(\"prefect.flow-run\")),\n\t\t) &&\n\t\tisFlowRunStateTriggerMatchRelated(trigger) &&\n\t\ttrigger.threshold === DEFAULT_EVENT_TRIGGER_THRESHOLD\n\t);\n}\n\n/**\n * Check if trigger is a work-pool-status template\n * Validates:\n * - Is an event trigger\n * - match['prefect.resource.id'] starts with 'prefect.work-pool'\n * - for_each contains 'prefect.resource.id'\n * - after events are work pool status events\n * - expect events are work pool status events\n * - threshold === 1\n */\nexport function isWorkPoolStatusTrigger(trigger: unknown): boolean {\n\treturn (\n\t\tisEventTrigger(trigger) &&\n\t\tisMatchResource(trigger, (prefectResourceIds) =>\n\t\t\tprefectResourceIds.every((value) =>\n\t\t\t\tvalue.startsWith(\"prefect.work-pool\"),\n\t\t\t),\n\t\t) &&\n\t\tisForEachResource(trigger, \"prefect.resource.id\") &&\n\t\tisAfterResource(trigger, (triggerAfters) =>\n\t\t\ttriggerAfters.every((after) => isWorkPoolStatusEvent(after)),\n\t\t) &&\n\t\tisExpectResource(trigger, (triggerExpects) =>\n\t\t\ttriggerExpects.every((expect) => isWorkPoolStatusEvent(expect)),\n\t\t) &&\n\t\ttrigger.threshold === DEFAULT_EVENT_TRIGGER_THRESHOLD\n\t);\n}\n\n/**\n * Check if trigger is a work-queue-status template\n * Validates:\n * - Is an event trigger\n * - match['prefect.resource.id'] starts with 'prefect.work-queue'\n * - for_each contains 'prefect.resource.id'\n * - after events are work queue status events\n * - expect events are work queue status events\n * - threshold === 1\n */\nexport function isWorkQueueStatusTrigger(trigger: unknown): boolean {\n\treturn (\n\t\tisEventTrigger(trigger) &&\n\t\tisMatchResource(trigger, (prefectResourceIds) =>\n\t\t\tprefectResourceIds.every((value) =>\n\t\t\t\tvalue.startsWith(\"prefect.work-queue\"),\n\t\t\t),\n\t\t) &&\n\t\tisForEachResource(trigger, \"prefect.resource.id\") &&\n\t\tisAfterResource(trigger, (triggerAfters) =>\n\t\t\ttriggerAfters.every((after) => isWorkQueueStatusEvent(after)),\n\t\t) &&\n\t\tisExpectResource(trigger, (triggerExpects) =>\n\t\t\ttriggerExpects.every((expect) => isWorkQueueStatusEvent(expect)),\n\t\t) &&\n\t\ttrigger.threshold === DEFAULT_EVENT_TRIGGER_THRESHOLD\n\t);\n}\n\n// Template check registry (excluding 'custom' which is the default)\nconst automationTriggerTemplateChecks: Record<\n\tExclude<AutomationTriggerTemplate, \"custom\">,\n\t(trigger: unknown) => boolean\n> = {\n\t\"deployment-status\": isDeploymentStatusTrigger,\n\t\"flow-run-state\": isFlowRunStateTrigger,\n\t\"work-pool-status\": isWorkPoolStatusTrigger,\n\t\"work-queue-status\": isWorkQueueStatusTrigger,\n};\n\n/**\n * Detect the template type of an automation trigger\n * Returns 'custom' if no template matches\n */\nexport function getAutomationTriggerTemplate(\n\ttrigger: AutomationTrigger,\n): AutomationTriggerTemplate {\n\tfor (const [type, guard] of Object.entries(automationTriggerTemplateChecks)) {\n\t\tif (guard(trigger)) {\n\t\t\treturn type as AutomationTriggerTemplate;\n\t\t}\n\t}\n\n\treturn \"custom\";\n}\n\n// Template labels\nconst automationTriggerTemplateLabels: Record<\n\tAutomationTriggerTemplate,\n\tstring\n> = {\n\t\"deployment-status\": \"Deployment status\",\n\t\"flow-run-state\": \"Flow run state\",\n\t\"work-pool-status\": \"Work pool status\",\n\t\"work-queue-status\": \"Work queue status\",\n\tcustom: \"Custom\",\n};\n\n/**\n * Get human-readable label for a trigger template\n */\nexport function getAutomationTriggerTemplateLabel(\n\ttemplate: AutomationTriggerTemplate,\n): string {\n\treturn automationTriggerTemplateLabels[template];\n}\n\n/**\n * Get human-readable label for event posture\n * \"Reactive\" -> \"enters\"\n * \"Proactive\" -> \"stays in\"\n */\nexport function getAutomationTriggerEventPostureLabel(\n\tposture: AutomationTriggerEventPosture,\n): string {\n\tswitch (posture) {\n\t\tcase \"Reactive\":\n\t\t\treturn \"enters\";\n\t\tcase \"Proactive\":\n\t\t\treturn \"stays in\";\n\t}\n}\n\n/**\n * Check if a string is a valid automation trigger template\n */\nexport function isAutomationTriggerTemplate(\n\tvalue: string,\n): value is AutomationTriggerTemplate {\n\treturn (AUTOMATION_TRIGGER_TEMPLATES as readonly string[]).includes(value);\n}\n\n// Work queue status types and labels\nexport type WorkQueueStatusTriggerStatus = \"READY\" | \"NOT_READY\" | \"PAUSED\";\n\n/**\n * Get human-readable label for work queue status\n * \"READY\" -> \"Ready\"\n * \"NOT_READY\" -> \"Not Ready\"\n * \"PAUSED\" -> \"Paused\"\n */\nexport function getWorkQueueStatusLabel(\n\tstatus: WorkQueueStatusTriggerStatus,\n): string {\n\tswitch (status) {\n\t\tcase \"READY\":\n\t\t\treturn \"Ready\";\n\t\tcase \"NOT_READY\":\n\t\t\treturn \"Not Ready\";\n\t\tcase \"PAUSED\":\n\t\t\treturn \"Paused\";\n\t\tdefault: {\n\t\t\tconst exhaustive: never = status;\n\t\t\tthrow new Error(\n\t\t\t\t`getWorkQueueStatusLabel missing case for ${exhaustive as string}`,\n\t\t\t);\n\t\t}\n\t}\n}\n","import { DeploymentLink } from \"@/components/deployments/deployment-link\";\nimport { secondsToString } from \"@/utils/seconds\";\nimport {\n\ttype AutomationTriggerEventPosture,\n\tgetAutomationTriggerEventPostureLabel,\n} from \"./trigger-utils\";\n\ntype DeploymentStatus = \"ready\" | \"not_ready\";\n\ntype TriggerDetailsDeploymentStatusProps = {\n\tdeploymentIds: string[];\n\tposture: AutomationTriggerEventPosture;\n\tstatus: DeploymentStatus;\n\ttime?: number;\n};\n\nfunction getDeploymentStatusLabel(status: DeploymentStatus): string {\n\tswitch (status) {\n\t\tcase \"ready\":\n\t\t\treturn \"ready\";\n\t\tcase \"not_ready\":\n\t\t\treturn \"not ready\";\n\t}\n}\n\nexport const TriggerDetailsDeploymentStatus = ({\n\tdeploymentIds,\n\tposture,\n\tstatus,\n\ttime,\n}: TriggerDetailsDeploymentStatusProps) => {\n\tconst isAnyDeployment = deploymentIds.length === 0;\n\tconst postureLabel = getAutomationTriggerEventPostureLabel(posture);\n\tconst statusLabel = getDeploymentStatusLabel(status);\n\n\treturn (\n\t\t<div className=\"flex flex-wrap gap-1 items-center\">\n\t\t\t<span>When</span>\n\n\t\t\t{isAnyDeployment ? (\n\t\t\t\t<span>any deployment</span>\n\t\t\t) : (\n\t\t\t\tdeploymentIds.map((deploymentId, index) => (\n\t\t\t\t\t<span key={deploymentId} className=\"flex items-center gap-1\">\n\t\t\t\t\t\t<DeploymentLink deploymentId={deploymentId} />\n\t\t\t\t\t\t{index === deploymentIds.length - 2 && <span>or</span>}\n\t\t\t\t\t</span>\n\t\t\t\t))\n\t\t\t)}\n\n\t\t\t<span>{postureLabel}</span>\n\t\t\t<span>{statusLabel}</span>\n\n\t\t\t{posture === \"Proactive\" && time !== undefined && time > 0 && (\n\t\t\t\t<span>for {secondsToString(time)}</span>\n\t\t\t)}\n\t\t</div>\n\t);\n};\n","import type { components } from \"@/api/prefect\";\nimport { FlowLink } from \"@/components/flows/flow-link\";\nimport { StateBadge } from \"@/components/ui/state-badge\";\nimport { TagBadgeGroup } from \"@/components/ui/tag-badge-group\";\nimport { secondsToApproximateString } from \"@/utils\";\nimport {\n\ttype AutomationTriggerEventPosture,\n\tgetAutomationTriggerEventPostureLabel,\n} from \"./trigger-utils\";\n\ntype StateType = components[\"schemas\"][\"StateType\"];\n\ntype TriggerDetailsFlowRunStateProps = {\n\tflowIds: string[];\n\ttags: string[];\n\tposture: AutomationTriggerEventPosture;\n\tstates: string[];\n\ttime?: number;\n};\n\n/**\n * Maps a state name string to a StateType enum value.\n * Handles various state name formats (e.g., \"Completed\", \"COMPLETED\", \"completed\")\n * and maps them to the uppercase StateType values expected by StateBadge.\n */\nfunction mapStateNameToStateType(stateName: string): StateType | null {\n\tconst normalizedName = stateName.toUpperCase();\n\n\tconst validStateTypes: StateType[] = [\n\t\t\"COMPLETED\",\n\t\t\"FAILED\",\n\t\t\"RUNNING\",\n\t\t\"CANCELLED\",\n\t\t\"CANCELLING\",\n\t\t\"CRASHED\",\n\t\t\"PAUSED\",\n\t\t\"PENDING\",\n\t\t\"SCHEDULED\",\n\t];\n\n\tif (validStateTypes.includes(normalizedName as StateType)) {\n\t\treturn normalizedName as StateType;\n\t}\n\n\treturn null;\n}\n\nexport const TriggerDetailsFlowRunState = ({\n\tflowIds,\n\ttags,\n\tposture,\n\tstates,\n\ttime,\n}: TriggerDetailsFlowRunStateProps) => {\n\tconst postureLabel = getAutomationTriggerEventPostureLabel(posture);\n\n\treturn (\n\t\t<div className=\"flex flex-wrap gap-1 items-center\">\n\t\t\t<span>When any flow run</span>\n\n\t\t\t{flowIds.length > 0 && (\n\t\t\t\t<>\n\t\t\t\t\t<span>of flow</span>\n\t\t\t\t\t{flowIds.map((flowId, index) => (\n\t\t\t\t\t\t<span key={flowId} className=\"flex items-center gap-1\">\n\t\t\t\t\t\t\t<FlowLink flowId={flowId} />\n\t\t\t\t\t\t\t{index === flowIds.length - 2 && <span>or</span>}\n\t\t\t\t\t\t</span>\n\t\t\t\t\t))}\n\t\t\t\t</>\n\t\t\t)}\n\n\t\t\t{tags.length > 0 && (\n\t\t\t\t<>\n\t\t\t\t\t<span>with the tag</span>\n\t\t\t\t\t<TagBadgeGroup tags={tags} />\n\t\t\t\t</>\n\t\t\t)}\n\n\t\t\t<span>{postureLabel}</span>\n\n\t\t\t{states.length > 0 ? (\n\t\t\t\tstates.map((state) => {\n\t\t\t\t\tconst stateType = mapStateNameToStateType(state);\n\t\t\t\t\tif (stateType) {\n\t\t\t\t\t\treturn <StateBadge key={state} type={stateType} />;\n\t\t\t\t\t}\n\t\t\t\t\treturn null;\n\t\t\t\t})\n\t\t\t) : (\n\t\t\t\t<span>any state</span>\n\t\t\t)}\n\n\t\t\t{posture === \"Proactive\" && time !== undefined && time > 0 && (\n\t\t\t\t<span>for {secondsToApproximateString(time)}</span>\n\t\t\t)}\n\t\t</div>\n\t);\n};\n","import { Typography } from \"@/components/ui/typography\";\nimport type { SequenceTrigger } from \"./trigger-utils\";\n\ntype TriggerDetailsSequenceProps = {\n\ttrigger: SequenceTrigger;\n};\n\nexport const TriggerDetailsSequence = ({\n\ttrigger,\n}: TriggerDetailsSequenceProps) => {\n\tconst triggerCount = trigger.triggers?.length ?? 0;\n\n\treturn (\n\t\t<div className=\"flex flex-wrap gap-1 items-center\">\n\t\t\t<Typography variant=\"bodySmall\">\n\t\t\t\tA sequence trigger with {triggerCount} nested{\" \"}\n\t\t\t\t{triggerCount === 1 ? \"trigger\" : \"triggers\"} that must fire in order\n\t\t\t</Typography>\n\t\t</div>\n\t);\n};\n","import { useQuery } from \"@tanstack/react-query\";\nimport { Link } from \"@tanstack/react-router\";\nimport { buildFilterWorkPoolsQuery, type WorkPool } from \"@/api/work-pools\";\nimport { Icon } from \"@/components/ui/icons\";\nimport { pluralize } from \"@/utils\";\nimport { secondsToString } from \"@/utils/seconds\";\nimport type { AutomationTriggerEventPosture } from \"./trigger-utils\";\n\ntype WorkPoolStatusType = \"READY\" | \"NOT_READY\" | \"PAUSED\";\n\nexport type TriggerDetailsWorkPoolStatusProps = {\n\tworkPoolIds: string[];\n\tposture: AutomationTriggerEventPosture;\n\tstatus: WorkPoolStatusType;\n\ttime?: number;\n};\n\nconst getStatusLabel = (status: WorkPoolStatusType): string => {\n\tswitch (status) {\n\t\tcase \"READY\":\n\t\t\treturn \"Ready\";\n\t\tcase \"NOT_READY\":\n\t\t\treturn \"Not Ready\";\n\t\tcase \"PAUSED\":\n\t\t\treturn \"Paused\";\n\t}\n};\n\nconst WorkPoolLinkInline = ({ workPoolName }: { workPoolName: string }) => {\n\treturn (\n\t\t<Link\n\t\t\tto=\"/work-pools/work-pool/$workPoolName\"\n\t\t\tparams={{ workPoolName }}\n\t\t\tclassName=\"inline-flex items-center gap-1\"\n\t\t>\n\t\t\t<Icon id=\"Cpu\" className=\"size-4\" />\n\t\t\t{workPoolName}\n\t\t</Link>\n\t);\n};\n\nconst renderWorkPoolLinks = (workPools: WorkPool[]) => {\n\tif (workPools.length === 0) {\n\t\treturn null;\n\t}\n\n\treturn workPools.map((workPool, index) => (\n\t\t<span key={workPool.id} className=\"inline-flex items-center gap-1\">\n\t\t\t<WorkPoolLinkInline workPoolName={workPool.name} />\n\t\t\t{index === workPools.length - 2 && \" or \"}\n\t\t\t{index < workPools.length - 2 && \", \"}\n\t\t</span>\n\t));\n};\n\nexport const TriggerDetailsWorkPoolStatus = ({\n\tworkPoolIds,\n\tposture,\n\tstatus,\n\ttime,\n}: TriggerDetailsWorkPoolStatusProps) => {\n\tconst { data: workPools = [] } = useQuery(\n\t\tbuildFilterWorkPoolsQuery(\n\t\t\t{\n\t\t\t\toffset: 0,\n\t\t\t\twork_pools: { id: { any_: workPoolIds }, operator: \"and_\" },\n\t\t\t},\n\t\t\t{ enabled: workPoolIds.length > 0 },\n\t\t),\n\t);\n\n\tconst postureLabel = posture === \"Reactive\" ? \"enters\" : \"stays in\";\n\tconst statusLabel = getStatusLabel(status).toLowerCase();\n\n\tconst workPoolLabel =\n\t\tworkPoolIds.length === 0\n\t\t\t? \"any work pool\"\n\t\t\t: `${pluralize(workPoolIds.length, \"work pool\")} `;\n\n\treturn (\n\t\t<div className=\"flex flex-wrap gap-1 items-center\">\n\t\t\t<span>When</span>\n\t\t\t<span>{workPoolLabel}</span>\n\t\t\t{workPoolIds.length > 0 && renderWorkPoolLinks(workPools)}\n\t\t\t<span>{postureLabel}</span>\n\t\t\t<span>{statusLabel}</span>\n\t\t\t{posture === \"Proactive\" && time !== undefined && (\n\t\t\t\t<span>for {secondsToString(time)}</span>\n\t\t\t)}\n\t\t</div>\n\t);\n};\n","import { useSuspenseQueries } from \"@tanstack/react-query\";\nimport { Suspense } from \"react\";\nimport { buildGetWorkQueueQuery } from \"@/api/work-queues\";\nimport { Skeleton } from \"@/components/ui/skeleton\";\nimport { WorkPoolLink } from \"@/components/work-pools/work-pool-link\";\nimport { WorkQueueIconText } from \"@/components/work-pools/work-queue-icon-text\";\nimport { pluralize } from \"@/utils\";\nimport { secondsToString } from \"@/utils/seconds\";\nimport {\n\ttype AutomationTriggerEventPosture,\n\tgetAutomationTriggerEventPostureLabel,\n\tgetWorkQueueStatusLabel,\n\ttype WorkQueueStatusTriggerStatus,\n} from \"./trigger-utils\";\n\nexport type TriggerDetailsWorkQueueStatusProps = {\n\tworkQueueIds: string[];\n\tworkPoolNames: string[];\n\tposture: AutomationTriggerEventPosture;\n\tstatus: WorkQueueStatusTriggerStatus;\n\ttime?: number;\n};\n\nexport const TriggerDetailsWorkQueueStatus = (\n\tprops: TriggerDetailsWorkQueueStatusProps,\n) => {\n\treturn (\n\t\t<Suspense fallback={<Skeleton className=\"h-4 w-full\" />}>\n\t\t\t<TriggerDetailsWorkQueueStatusImplementation {...props} />\n\t\t</Suspense>\n\t);\n};\n\nconst TriggerDetailsWorkQueueStatusImplementation = ({\n\tworkQueueIds,\n\tworkPoolNames,\n\tposture,\n\tstatus,\n\ttime,\n}: TriggerDetailsWorkQueueStatusProps) => {\n\tconst anyWorkQueue = workQueueIds.length === 0;\n\tconst anyWorkPool = workPoolNames.length === 0;\n\n\tconst workQueueQueries = useSuspenseQueries({\n\t\tqueries: workQueueIds.map((id) => buildGetWorkQueueQuery(id)),\n\t});\n\n\tconst workQueues = workQueueQueries.map((query) => query.data);\n\n\treturn (\n\t\t<div className=\"flex flex-wrap gap-1 items-center text-sm\">\n\t\t\t<span>When</span>\n\n\t\t\t{anyWorkQueue ? (\n\t\t\t\t<span>any work queue</span>\n\t\t\t) : (\n\t\t\t\t<>\n\t\t\t\t\t<span>{pluralize(workQueues.length, \"work queue\")}</span>\n\t\t\t\t\t{workQueues.map((workQueue, index) => (\n\t\t\t\t\t\t<span key={workQueue.id} className=\"flex items-center gap-1\">\n\t\t\t\t\t\t\t<WorkQueueIconText\n\t\t\t\t\t\t\t\tworkPoolName={workQueue.work_pool_name ?? \"\"}\n\t\t\t\t\t\t\t\tworkQueueName={workQueue.name}\n\t\t\t\t\t\t\t\tshowLabel\n\t\t\t\t\t\t\t\tshowStatus\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t{index === workQueues.length - 2 && <span>or</span>}\n\t\t\t\t\t\t</span>\n\t\t\t\t\t))}\n\t\t\t\t</>\n\t\t\t)}\n\n\t\t\t{!anyWorkPool && (\n\t\t\t\t<>\n\t\t\t\t\t<span>from the {pluralize(workPoolNames.length, \"work pool\")}</span>\n\t\t\t\t\t{workPoolNames.map((workPoolName, index) => (\n\t\t\t\t\t\t<span key={workPoolName} className=\"flex items-center gap-1\">\n\t\t\t\t\t\t\t<WorkPoolLink workPoolName={workPoolName} />\n\t\t\t\t\t\t\t{index === workPoolNames.length - 2 && <span>or</span>}\n\t\t\t\t\t\t</span>\n\t\t\t\t\t))}\n\t\t\t\t</>\n\t\t\t)}\n\n\t\t\t<span>{getAutomationTriggerEventPostureLabel(posture)}</span>\n\t\t\t<span>{getWorkQueueStatusLabel(status).toLowerCase()}</span>\n\n\t\t\t{posture === \"Proactive\" && time !== undefined && (\n\t\t\t\t<span>for {secondsToString(time)}</span>\n\t\t\t)}\n\t\t</div>\n\t);\n};\n","import { TriggerDetailsCompound } from \"./trigger-details-compound\";\nimport { TriggerDetailsCustom } from \"./trigger-details-custom\";\nimport { TriggerDetailsDeploymentStatus } from \"./trigger-details-deployment-status\";\nimport { TriggerDetailsFlowRunState } from \"./trigger-details-flow-run-state\";\nimport { TriggerDetailsSequence } from \"./trigger-details-sequence\";\nimport { TriggerDetailsWorkPoolStatus } from \"./trigger-details-work-pool-status\";\nimport { TriggerDetailsWorkQueueStatus } from \"./trigger-details-work-queue-status\";\nimport {\n\ttype AutomationTrigger,\n\ttype AutomationTriggerEventPosture,\n\ttype EventTrigger,\n\tgetAutomationTriggerTemplate,\n\tisCompoundTrigger,\n\tisEventTrigger,\n\tisSequenceTrigger,\n\ttype WorkQueueStatusTriggerStatus,\n} from \"./trigger-utils\";\n\ntype TriggerDetailsProps = {\n\ttrigger: AutomationTrigger;\n};\n\ntype DeploymentStatus = \"ready\" | \"not_ready\";\ntype WorkPoolStatusType = \"READY\" | \"NOT_READY\" | \"PAUSED\";\n\nfunction asArray<T>(value: T | T[] | undefined | null): T[] {\n\tif (value === undefined || value === null) {\n\t\treturn [];\n\t}\n\treturn Array.isArray(value) ? value : [value];\n}\n\nfunction getMatchValue(\n\ttrigger: EventTrigger,\n\tkey: string,\n): string | string[] | undefined {\n\tconst match = trigger.match;\n\tif (match && typeof match === \"object\") {\n\t\treturn (match as Record<string, string | string[] | undefined>)[key];\n\t}\n\treturn undefined;\n}\n\nfunction getMatchRelatedValue(trigger: EventTrigger, key: string): string[] {\n\tconst matchRelated = trigger.match_related;\n\tif (!matchRelated) {\n\t\treturn [];\n\t}\n\n\tconst matchRelatedArray = Array.isArray(matchRelated)\n\t\t? matchRelated\n\t\t: [matchRelated];\n\n\tconst values: string[] = [];\n\tfor (const match of matchRelatedArray) {\n\t\tif (match && typeof match === \"object\") {\n\t\t\tconst value = (match as Record<string, unknown>)[key];\n\t\t\tif (value) {\n\t\t\t\tvalues.push(...asArray(value as string | string[]));\n\t\t\t}\n\t\t}\n\t}\n\treturn values;\n}\n\nfunction fromResourceId(resource: string, value: unknown): string[] {\n\tif (value === undefined || value === null) {\n\t\treturn [];\n\t}\n\n\tconst values = asArray(value as string | string[]);\n\n\tif (values.includes(`${resource}.*`)) {\n\t\treturn [];\n\t}\n\n\treturn values\n\t\t.filter((v) => v.startsWith(resource))\n\t\t.map((v) => {\n\t\t\tconst parts = v.split(`${resource}.`);\n\t\t\treturn parts[1] ?? \"\";\n\t\t})\n\t\t.filter((id) => id !== \"\" && id !== \"*\");\n}\n\nfunction fromStateNameEvents(events: string[]): string[] {\n\tif (events.includes(\"prefect.flow-run.*\")) {\n\t\treturn [];\n\t}\n\n\treturn events\n\t\t.filter((event) => event.startsWith(\"prefect.flow-run.\"))\n\t\t.map((event) => {\n\t\t\tconst parts = event.split(\"prefect.flow-run.\");\n\t\t\treturn parts[1] ?? \"\";\n\t\t})\n\t\t.filter((name) => name !== \"\");\n}\n\nfunction extractFlowRunStateProps(trigger: EventTrigger): {\n\tflowIds: string[];\n\ttags: string[];\n\tposture: AutomationTriggerEventPosture;\n\tstates: string[];\n\ttime?: number;\n} {\n\tconst matchRelatedResourceIds = getMatchRelatedValue(\n\t\ttrigger,\n\t\t\"prefect.resource.id\",\n\t);\n\n\tconst flowIds = fromResourceId(\"prefect.flow\", matchRelatedResourceIds);\n\tconst tags = fromResourceId(\"prefect.tag\", matchRelatedResourceIds);\n\n\tconst posture = trigger.posture;\n\tconst states =\n\t\tposture === \"Reactive\"\n\t\t\t? fromStateNameEvents(trigger.expect ?? [])\n\t\t\t: fromStateNameEvents(trigger.after ?? []);\n\n\treturn {\n\t\tflowIds,\n\t\ttags,\n\t\tposture,\n\t\tstates,\n\t\ttime: trigger.within,\n\t};\n}\n\nconst DEPLOYMENT_STATUS_EVENT_TO_STATUS: Record<string, DeploymentStatus> = {\n\t\"prefect.deployment.ready\": \"ready\",\n\t\"prefect.deployment.not-ready\": \"not_ready\",\n\t\"prefect.deployment.disabled\": \"not_ready\",\n};\n\nfunction extractDeploymentStatusProps(trigger: EventTrigger): {\n\tdeploymentIds: string[];\n\tposture: AutomationTriggerEventPosture;\n\tstatus: DeploymentStatus;\n\ttime?: number;\n} {\n\tconst resourceIdValue = getMatchValue(trigger, \"prefect.resource.id\");\n\tconst deploymentIds = fromResourceId(\"prefect.deployment\", resourceIdValue);\n\n\tconst posture = trigger.posture;\n\tconst statusEvents = posture === \"Reactive\" ? trigger.expect : trigger.after;\n\n\tlet status: DeploymentStatus = \"ready\";\n\tfor (const event of statusEvents ?? []) {\n\t\tif (event in DEPLOYMENT_STATUS_EVENT_TO_STATUS) {\n\t\t\tstatus = DEPLOYMENT_STATUS_EVENT_TO_STATUS[event];\n\t\t\tbreak;\n\t\t}\n\t}\n\n\treturn {\n\t\tdeploymentIds,\n\t\tposture,\n\t\tstatus,\n\t\ttime: trigger.within,\n\t};\n}\n\nconst WORK_POOL_STATUS_EVENT_TO_STATUS: Record<string, WorkPoolStatusType> = {\n\t\"prefect.work-pool.ready\": \"READY\",\n\t\"prefect.work-pool.not-ready\": \"NOT_READY\",\n\t\"prefect.work-pool.not_ready\": \"NOT_READY\",\n\t\"prefect.work-pool.paused\": \"PAUSED\",\n};\n\nfunction extractWorkPoolStatusProps(trigger: EventTrigger): {\n\tworkPoolIds: string[];\n\tposture: AutomationTriggerEventPosture;\n\tstatus: WorkPoolStatusType;\n\ttime?: number;\n} {\n\tconst resourceIdValue = getMatchValue(trigger, \"prefect.resource.id\");\n\tconst workPoolIds = fromResourceId(\"prefect.work-pool\", resourceIdValue);\n\n\tconst posture = trigger.posture;\n\tconst statusEvents = posture === \"Reactive\" ? trigger.expect : trigger.after;\n\n\tlet status: WorkPoolStatusType = \"READY\";\n\tfor (const event of statusEvents ?? []) {\n\t\tif (event in WORK_POOL_STATUS_EVENT_TO_STATUS) {\n\t\t\tstatus = WORK_POOL_STATUS_EVENT_TO_STATUS[event];\n\t\t\tbreak;\n\t\t}\n\t}\n\n\treturn {\n\t\tworkPoolIds,\n\t\tposture,\n\t\tstatus,\n\t\ttime: trigger.within,\n\t};\n}\n\nconst WORK_QUEUE_STATUS_EVENT_TO_STATUS: Record<\n\tstring,\n\tWorkQueueStatusTriggerStatus\n> = {\n\t\"prefect.work-queue.ready\": \"READY\",\n\t\"prefect.work-queue.not-ready\": \"NOT_READY\",\n\t\"prefect.work-queue.paused\": \"PAUSED\",\n};\n\nfunction extractWorkQueueStatusProps(trigger: EventTrigger): {\n\tworkQueueIds: string[];\n\tworkPoolNames: string[];\n\tposture: AutomationTriggerEventPosture;\n\tstatus: WorkQueueStatusTriggerStatus;\n\ttime?: number;\n} {\n\tconst resourceIdValue = getMatchValue(trigger, \"prefect.resource.id\");\n\tconst workQueueIds = fromResourceId(\"prefect.work-queue\", resourceIdValue);\n\n\tconst matchRelatedResourceIds = getMatchRelatedValue(\n\t\ttrigger,\n\t\t\"prefect.resource.id\",\n\t);\n\tconst workPoolNames = fromResourceId(\n\t\t\"prefect.work-pool\",\n\t\tmatchRelatedResourceIds,\n\t);\n\n\tconst posture = trigger.posture;\n\tconst statusEvents = posture === \"Reactive\" ? trigger.expect : trigger.after;\n\n\tlet status: WorkQueueStatusTriggerStatus = \"READY\";\n\tfor (const event of statusEvents ?? []) {\n\t\tif (event in WORK_QUEUE_STATUS_EVENT_TO_STATUS) {\n\t\t\tstatus = WORK_QUEUE_STATUS_EVENT_TO_STATUS[event];\n\t\t\tbreak;\n\t\t}\n\t}\n\n\treturn {\n\t\tworkQueueIds,\n\t\tworkPoolNames,\n\t\tposture,\n\t\tstatus,\n\t\ttime: trigger.within,\n\t};\n}\n\nexport const TriggerDetails = ({ trigger }: TriggerDetailsProps) => {\n\tif (isCompoundTrigger(trigger)) {\n\t\treturn <TriggerDetailsCompound trigger={trigger} />;\n\t}\n\n\tif (isSequenceTrigger(trigger)) {\n\t\treturn <TriggerDetailsSequence trigger={trigger} />;\n\t}\n\n\tif (!isEventTrigger(trigger)) {\n\t\treturn <TriggerDetailsCustom />;\n\t}\n\n\tconst template = getAutomationTriggerTemplate(trigger);\n\n\tswitch (template) {\n\t\tcase \"flow-run-state\":\n\t\t\treturn (\n\t\t\t\t<TriggerDetailsFlowRunState {...extractFlowRunStateProps(trigger)} />\n\t\t\t);\n\t\tcase \"deployment-status\":\n\t\t\treturn (\n\t\t\t\t<TriggerDetailsDeploymentStatus\n\t\t\t\t\t{...extractDeploymentStatusProps(trigger)}\n\t\t\t\t/>\n\t\t\t);\n\t\tcase \"work-pool-status\":\n\t\t\treturn (\n\t\t\t\t<TriggerDetailsWorkPoolStatus\n\t\t\t\t\t{...extractWorkPoolStatusProps(trigger)}\n\t\t\t\t/>\n\t\t\t);\n\t\tcase \"work-queue-status\":\n\t\t\treturn (\n\t\t\t\t<TriggerDetailsWorkQueueStatus\n\t\t\t\t\t{...extractWorkQueueStatusProps(trigger)}\n\t\t\t\t/>\n\t\t\t);\n\t\tdefault:\n\t\t\treturn <TriggerDetailsCustom />;\n\t}\n};\n","import type { Automation } from \"@/api/automations\";\nimport { useGetAutomationActionResources } from \"@/api/automations/use-get-automation-action-resources\";\nimport { ActionDetails } from \"@/components/automations/action-details\";\nimport { TriggerDetails } from \"@/components/automations/trigger-details\";\nimport { Card } from \"@/components/ui/card\";\nimport { Skeleton } from \"@/components/ui/skeleton\";\nimport { Typography } from \"@/components/ui/typography\";\nimport { pluralize } from \"@/utils\";\n\ntype AutomationDetailsProps = {\n\tautomation: Automation;\n};\n\nexport const AutomationDescription = ({\n\tautomation,\n}: AutomationDetailsProps) => {\n\treturn (\n\t\t<div className=\"flex flex-col gap-1\">\n\t\t\t<Typography className=\"text-muted-foreground\" variant=\"bodySmall\">\n\t\t\t\tDescription\n\t\t\t</Typography>\n\t\t\t<Typography className=\"text-muted-foreground\">\n\t\t\t\t{automation.description || \"None\"}\n\t\t\t</Typography>\n\t\t</div>\n\t);\n};\n\nexport const AutomationTrigger = ({ automation }: AutomationDetailsProps) => {\n\tconst { trigger } = automation;\n\treturn (\n\t\t<div className=\"flex flex-col gap-1\">\n\t\t\t<Typography>Trigger</Typography>\n\t\t\t<TriggerDetails trigger={trigger} />\n\t\t</div>\n\t);\n};\n\nexport const AutomationActions = ({ automation }: AutomationDetailsProps) => {\n\tconst { data: resources, loading } =\n\t\tuseGetAutomationActionResources(automation);\n\n\tconst {\n\t\tautomationsMap,\n\t\tblockDocumentsMap,\n\t\tdeploymentsMap,\n\t\tworkPoolsMap,\n\t\tworkQueuesMap,\n\t} = resources;\n\n\treturn (\n\t\t<div className=\"flex flex-col gap-1\">\n\t\t\t<Typography>{pluralize(automation.actions.length, \"Action\")}</Typography>\n\t\t\t<ul className=\"flex flex-col gap-2\">\n\t\t\t\t{loading\n\t\t\t\t\t? Array.from({ length: automation.actions.length }, (_, i) => (\n\t\t\t\t\t\t\t// biome-ignore lint/suspicious/noArrayIndexKey: ok for loading skeletons\n\t\t\t\t\t\t\t<Card className=\"p-4\" key={i}>\n\t\t\t\t\t\t\t\t<Skeleton className=\"p-2 h-2 w-full\" />\n\t\t\t\t\t\t\t</Card>\n\t\t\t\t\t\t))\n\t\t\t\t\t: automation.actions.map((action) => (\n\t\t\t\t\t\t\t<li key={action.type}>\n\t\t\t\t\t\t\t\t<ActionDetails\n\t\t\t\t\t\t\t\t\taction={action}\n\t\t\t\t\t\t\t\t\tautomationsMap={automationsMap}\n\t\t\t\t\t\t\t\t\tblockDocumentsMap={blockDocumentsMap}\n\t\t\t\t\t\t\t\t\tdeploymentsMap={deploymentsMap}\n\t\t\t\t\t\t\t\t\tworkPoolsMap={workPoolsMap}\n\t\t\t\t\t\t\t\t\tworkQueuesMap={workQueuesMap}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t))}\n\t\t\t</ul>\n\t\t</div>\n\t);\n};\n","import { toast } from \"sonner\";\nimport { type Automation, useUpdateAutomation } from \"@/api/automations\";\nimport { Switch } from \"@/components/ui/switch\";\n\ntype AutomationEnableToggleProps = {\n\tautomation: Automation;\n};\nexport const AutomationEnableToggle = ({\n\tautomation,\n}: AutomationEnableToggleProps) => {\n\tconst { updateAutomation } = useUpdateAutomation();\n\n\tconst handleCheckedChange = (checked: boolean, id: string) => {\n\t\tupdateAutomation(\n\t\t\t{\n\t\t\t\tenabled: checked,\n\t\t\t\tid,\n\t\t\t},\n\t\t\t{\n\t\t\t\tonSuccess: () => {\n\t\t\t\t\ttoast.success(`Automation ${checked ? \"enabled\" : \"disabled\"}`);\n\t\t\t\t},\n\t\t\t\tonError: (error) => {\n\t\t\t\t\tconst message =\n\t\t\t\t\t\terror.message || \"Unknown error while updating automation\";\n\t\t\t\t\tconsole.error(message);\n\t\t\t\t},\n\t\t\t},\n\t\t);\n\t};\n\n\treturn (\n\t\t<Switch\n\t\t\taria-label=\"toggle automation\"\n\t\t\tchecked={automation.enabled}\n\t\t\tonCheckedChange={(checked) => handleCheckedChange(checked, automation.id)}\n\t\t/>\n\t);\n};\n","import { Link } from \"@tanstack/react-router\";\nimport { toast } from \"sonner\";\nimport { Button } from \"@/components/ui/button\";\nimport { DOCS_LINKS } from \"@/components/ui/docs-link\";\nimport {\n\tDropdownMenu,\n\tDropdownMenuContent,\n\tDropdownMenuItem,\n\tDropdownMenuLabel,\n\tDropdownMenuTrigger,\n} from \"@/components/ui/dropdown-menu\";\nimport { Icon } from \"@/components/ui/icons\";\n\ntype Props = {\n\tid: string;\n\tonDelete: () => void;\n};\n\nexport const AutomationsActionsMenu = ({ id, onDelete }: Props) => {\n\tconst handleCopyId = (id: string) => {\n\t\tvoid navigator.clipboard.writeText(id);\n\t\ttoast.success(\"ID copied\");\n\t};\n\n\treturn (\n\t\t<DropdownMenu>\n\t\t\t<DropdownMenuTrigger asChild>\n\t\t\t\t<Button variant=\"outline\" className=\"size-8 p-0\">\n\t\t\t\t\t<span className=\"sr-only\">Open menu</span>\n\t\t\t\t\t<Icon id=\"MoreVertical\" className=\"size-4\" />\n\t\t\t\t</Button>\n\t\t\t</DropdownMenuTrigger>\n\t\t\t<DropdownMenuContent align=\"end\">\n\t\t\t\t<DropdownMenuLabel>Actions</DropdownMenuLabel>\n\t\t\t\t<DropdownMenuItem onClick={() => handleCopyId(id)}>\n\t\t\t\t\tCopy ID\n\t\t\t\t</DropdownMenuItem>\n\t\t\t\t<DropdownMenuItem asChild>\n\t\t\t\t\t<Link to=\"/automations/automation/$id/edit\" params={{ id }}>\n\t\t\t\t\t\tEdit\n\t\t\t\t\t</Link>\n\t\t\t\t</DropdownMenuItem>\n\t\t\t\t<DropdownMenuItem onClick={onDelete}>Delete</DropdownMenuItem>\n\t\t\t\t<DropdownMenuItem asChild>\n\t\t\t\t\t<a\n\t\t\t\t\t\thref={DOCS_LINKS[\"automations-guide\"]}\n\t\t\t\t\t\tclassName=\"flex items-center\"\n\t\t\t\t\t>\n\t\t\t\t\t\tDocumentation <Icon id=\"ExternalLink\" className=\"ml-2 size-4\" />\n\t\t\t\t\t</a>\n\t\t\t\t</DropdownMenuItem>\n\t\t\t</DropdownMenuContent>\n\t\t</DropdownMenu>\n\t);\n};\n","import { useNavigate } from \"@tanstack/react-router\";\nimport { toast } from \"sonner\";\nimport { type Automation, useDeleteAutomation } from \"@/api/automations\";\nimport { useDeleteConfirmationDialog } from \"@/components/ui/delete-confirmation-dialog\";\n\nexport const useDeleteAutomationConfirmationDialog = () => {\n\tconst navigate = useNavigate();\n\tconst [dialogState, confirmDelete] = useDeleteConfirmationDialog();\n\n\tconst { deleteAutomation } = useDeleteAutomation();\n\n\tconst handleConfirmDelete = (\n\t\tautomation: Automation,\n\t\t{\n\t\t\tshouldNavigate = false,\n\t\t}: {\n\t\t\t/** Should navigate back to /automations */\n\t\t\tshouldNavigate?: boolean;\n\t\t} = {},\n\t) =>\n\t\tconfirmDelete({\n\t\t\ttitle: \"Delete Automation\",\n\t\t\tdescription: `Are you sure you want to delete ${automation.name}?`,\n\t\t\tonConfirm: () => {\n\t\t\t\tdeleteAutomation(automation.id, {\n\t\t\t\t\tonSuccess: () => {\n\t\t\t\t\t\ttoast.success(\"Automation deleted\");\n\t\t\t\t\t\tif (shouldNavigate) {\n\t\t\t\t\t\t\tvoid navigate({ to: \"/automations\" });\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\tonError: (error) => {\n\t\t\t\t\t\tconst message =\n\t\t\t\t\t\t\terror.message || \"Unknown error while deleting automation.\";\n\t\t\t\t\t\ttoast.error(message);\n\t\t\t\t\t\tconsole.error(message);\n\t\t\t\t\t},\n\t\t\t\t});\n\t\t\t},\n\t\t});\n\n\treturn [dialogState, handleConfirmDelete] as const;\n};\n"],"names":["useGetAutomationActionResources","automation","automationIds","blockDocumentIds","deploymentIds","workPoolIds","workQueueIds","getResourceSets","automationsData","automationsLoading","useListAutomationsQueries","remainingQueries","useQueries","buildListFilterBlockDocumentsQuery","buildFilterDeploymentsQuery","buildFilterWorkPoolsQuery","buildFilterWorkQueuesQuery","results","blockDocuments","deployments","workPools","workQueues","result","listToMap","automationId","buildGetAutomationQuery","retMap","actions","action","list","map","item","ACTION_TYPE_TO_STRING","ActionDetails","automationsMap","blockDocumentsMap","deploymentsMap","workPoolsMap","workQueuesMap","jsx","Card","ActionDetailsType","label","NoninferredAction","deployment","DeploymentActionDetails","Typography","InferredAction","workQueue","WorkQueueActionDetails","AutomationActionDetails","workPool","WorkPoolActionDetails","blockDocument","BlockDocumentActionDetails","ChangeFlowRunStateActionDetails","ActionResource","children","ActionResourceName","iconId","name","jsxs","Icon","type","StateBadge","parameters","job_variables","Link","RunDeploymentJsonDialog","title","payload","Dialog","DialogTrigger","Button","capitalize","DialogContent","DialogHeader","DialogTitle","JsonInput","_label","TriggerDetailsCompound","trigger","triggerCount","requireValue","requireLabel","TriggerDetailsCustom","DeploymentLink","deploymentId","Suspense","Skeleton","DeploymentLinkImplementation","useSuspenseQuery","buildDeploymentDetailsQuery","DEFAULT_EVENT_TRIGGER_THRESHOLD","DEPLOYMENT_STATUS_EVENTS","WORK_POOL_STATUS_EVENTS","WORK_QUEUE_STATUS_EVENTS","isRecord","value","isEventTrigger","isCompoundTrigger","isSequenceTrigger","asArray","getTriggerMatchValue","key","match","isMatchResource","predicate","prefectResourceIds","isForEachResource","resource","isAfterResource","isExpectResource","isDeploymentStatusEvent","event","isWorkPoolStatusEvent","isWorkQueueStatusEvent","isDeploymentStatusTrigger","triggerAfters","after","triggerExpects","expect","getTriggerMatchRelatedValue","matchRelated","matchRelatedArray","values","isEmptyMatchRelated","isMatchRelatedResource","isFlowRunStateTriggerMatchRelated","isFlowRunStateTrigger","isWorkPoolStatusTrigger","isWorkQueueStatusTrigger","automationTriggerTemplateChecks","getAutomationTriggerTemplate","guard","getAutomationTriggerEventPostureLabel","posture","getWorkQueueStatusLabel","status","exhaustive","getDeploymentStatusLabel","TriggerDetailsDeploymentStatus","time","isAnyDeployment","postureLabel","statusLabel","index","secondsToString","mapStateNameToStateType","stateName","normalizedName","TriggerDetailsFlowRunState","flowIds","tags","states","Fragment","flowId","FlowLink","TagBadgeGroup","state","stateType","secondsToApproximateString","TriggerDetailsSequence","getStatusLabel","WorkPoolLinkInline","workPoolName","renderWorkPoolLinks","TriggerDetailsWorkPoolStatus","useQuery","workPoolLabel","pluralize","TriggerDetailsWorkQueueStatus","props","TriggerDetailsWorkQueueStatusImplementation","workPoolNames","anyWorkQueue","anyWorkPool","useSuspenseQueries","id","buildGetWorkQueueQuery","query","WorkQueueIconText","WorkPoolLink","getMatchValue","getMatchRelatedValue","fromResourceId","v","fromStateNameEvents","events","extractFlowRunStateProps","matchRelatedResourceIds","DEPLOYMENT_STATUS_EVENT_TO_STATUS","extractDeploymentStatusProps","resourceIdValue","statusEvents","WORK_POOL_STATUS_EVENT_TO_STATUS","extractWorkPoolStatusProps","WORK_QUEUE_STATUS_EVENT_TO_STATUS","extractWorkQueueStatusProps","TriggerDetails","AutomationDescription","AutomationTrigger","AutomationActions","resources","loading","_","i","AutomationEnableToggle","updateAutomation","useUpdateAutomation","handleCheckedChange","checked","toast","error","message","Switch","AutomationsActionsMenu","onDelete","handleCopyId","DropdownMenu","DropdownMenuTrigger","DropdownMenuContent","DropdownMenuLabel","DropdownMenuItem","DOCS_LINKS","useDeleteAutomationConfirmationDialog","navigate","useNavigate","dialogState","confirmDelete","useDeleteConfirmationDialog","deleteAutomation","useDeleteAutomation","shouldNavigate"],"mappings":"ilBAiCO,MAAMA,GAAmCC,GAA2B,CAC1E,KAAM,CACL,cAAAC,EACA,iBAAAC,EACA,cAAAC,EACA,YAAAC,EACA,aAAAC,CAAA,EACGC,GAAgBN,EAAW,OAAO,EAGhC,CAAE,KAAMO,EAAiB,QAASC,GACvCC,GAA0B,MAAM,KAAKR,CA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