@hotmeshio/long-tail 0.10.6 → 0.10.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/api/escalations/bulk.d.ts +16 -4
- package/build/api/escalations/bulk.js +42 -7
- package/build/api/escalations/resolve.js +57 -15
- package/build/routes/escalations/bulk.js +1 -0
- package/build/sdk/index.d.ts +5 -1
- package/build/services/escalation/bulk.d.ts +14 -0
- package/build/services/escalation/bulk.js +17 -0
- package/build/services/escalation/crud.d.ts +13 -2
- package/build/services/escalation/crud.js +9 -4
- package/build/services/orchestrator/condition.d.ts +20 -0
- package/build/services/orchestrator/condition.js +30 -6
- package/build/types/escalation.d.ts +8 -0
- package/build/types/index.d.ts +1 -1
- package/dashboard/dist/assets/{AdminDashboard-B5B8cf1A.js → AdminDashboard-D0HdEkT9.js} +2 -2
- package/dashboard/dist/assets/{AdminDashboard-B5B8cf1A.js.map → AdminDashboard-D0HdEkT9.js.map} +1 -1
- package/dashboard/dist/assets/{AgentConfigPage-BxuHbkDF.js → AgentConfigPage-CtURUMOV.js} +2 -2
- package/dashboard/dist/assets/{AgentConfigPage-BxuHbkDF.js.map → AgentConfigPage-CtURUMOV.js.map} +1 -1
- package/dashboard/dist/assets/{AgentDetailPage-Bv89ria_.js → AgentDetailPage-C5AnjpD9.js} +2 -2
- package/dashboard/dist/assets/{AgentDetailPage-Bv89ria_.js.map → AgentDetailPage-C5AnjpD9.js.map} +1 -1
- package/dashboard/dist/assets/{AgentsPage-BPgki44D.js → AgentsPage-DBequneI.js} +2 -2
- package/dashboard/dist/assets/{AgentsPage-BPgki44D.js.map → AgentsPage-DBequneI.js.map} +1 -1
- package/dashboard/dist/assets/{AvailableEscalationsPage-Dq_FyUcB.js → AvailableEscalationsPage-Bk7fFV2e.js} +2 -2
- package/dashboard/dist/assets/{AvailableEscalationsPage-Dq_FyUcB.js.map → AvailableEscalationsPage-Bk7fFV2e.js.map} +1 -1
- package/dashboard/dist/assets/{BotPicker-D-WegFKH.js → BotPicker-BMXokkH7.js} +2 -2
- package/dashboard/dist/assets/{BotPicker-D-WegFKH.js.map → BotPicker-BMXokkH7.js.map} +1 -1
- package/dashboard/dist/assets/{CapabilitiesPage-C8Zxzh1x.js → CapabilitiesPage-w-D6xraE.js} +2 -2
- package/dashboard/dist/assets/{CapabilitiesPage-C8Zxzh1x.js.map → CapabilitiesPage-w-D6xraE.js.map} +1 -1
- package/dashboard/dist/assets/{CollapsibleSection-Ca2iifr4.js → CollapsibleSection-IPL1H1bQ.js} +2 -2
- package/dashboard/dist/assets/{CollapsibleSection-Ca2iifr4.js.map → CollapsibleSection-IPL1H1bQ.js.map} +1 -1
- package/dashboard/dist/assets/{CountdownTimer-CQSukTT4.js → CountdownTimer-D-CpxYDO.js} +2 -2
- package/dashboard/dist/assets/{CountdownTimer-CQSukTT4.js.map → CountdownTimer-D-CpxYDO.js.map} +1 -1
- package/dashboard/dist/assets/{CredentialsPage-BFf0p9CE.js → CredentialsPage-DR48hDES.js} +2 -2
- package/dashboard/dist/assets/{CredentialsPage-BFf0p9CE.js.map → CredentialsPage-DR48hDES.js.map} +1 -1
- package/dashboard/dist/assets/{CronLabel-CvjUA6jF.js → CronLabel-KQEj0cDS.js} +2 -2
- package/dashboard/dist/assets/{CronLabel-CvjUA6jF.js.map → CronLabel-KQEj0cDS.js.map} +1 -1
- package/dashboard/dist/assets/CustomDurationPicker-_KceggR9.js +2 -0
- package/dashboard/dist/assets/CustomDurationPicker-_KceggR9.js.map +1 -0
- package/dashboard/dist/assets/{ElapsedCell-C0pd3pO8.js → ElapsedCell-Cflz7Pb5.js} +2 -2
- package/dashboard/dist/assets/{ElapsedCell-C0pd3pO8.js.map → ElapsedCell-Cflz7Pb5.js.map} +1 -1
- package/dashboard/dist/assets/{EscalationListSchemaPage-BRrrftTq.js → EscalationListSchemaPage-BTBZ8OBY.js} +2 -2
- package/dashboard/dist/assets/{EscalationListSchemaPage-BRrrftTq.js.map → EscalationListSchemaPage-BTBZ8OBY.js.map} +1 -1
- package/dashboard/dist/assets/{EscalationSchemaPage-ChawQh5H.js → EscalationSchemaPage-Cd9fR2EA.js} +2 -2
- package/dashboard/dist/assets/{EscalationSchemaPage-ChawQh5H.js.map → EscalationSchemaPage-Cd9fR2EA.js.map} +1 -1
- package/dashboard/dist/assets/{EscalationsOverview-D3dFDffZ.js → EscalationsOverview-BzNFcA0i.js} +2 -2
- package/dashboard/dist/assets/{EscalationsOverview-D3dFDffZ.js.map → EscalationsOverview-BzNFcA0i.js.map} +1 -1
- package/dashboard/dist/assets/{EventTable-C6vkJJcQ.js → EventTable-S2BJqOt2.js} +2 -2
- package/dashboard/dist/assets/{EventTable-C6vkJJcQ.js.map → EventTable-S2BJqOt2.js.map} +1 -1
- package/dashboard/dist/assets/{FilterBar-OqpCEYW2.js → FilterBar-CeXwNVn6.js} +2 -2
- package/dashboard/dist/assets/{FilterBar-OqpCEYW2.js.map → FilterBar-CeXwNVn6.js.map} +1 -1
- package/dashboard/dist/assets/{GraphInvokePage-CJOyaU4g.js → GraphInvokePage-CBjXjOLX.js} +2 -2
- package/dashboard/dist/assets/{GraphInvokePage-CJOyaU4g.js.map → GraphInvokePage-CBjXjOLX.js.map} +1 -1
- package/dashboard/dist/assets/{HomePage-DxJz7AQ7.js → HomePage-NMLaXTvf.js} +2 -2
- package/dashboard/dist/assets/{HomePage-DxJz7AQ7.js.map → HomePage-NMLaXTvf.js.map} +1 -1
- package/dashboard/dist/assets/{ListToolbar-B6ZoJ4Rd.js → ListToolbar-Dx6DuFdR.js} +2 -2
- package/dashboard/dist/assets/{ListToolbar-B6ZoJ4Rd.js.map → ListToolbar-Dx6DuFdR.js.map} +1 -1
- package/dashboard/dist/assets/{McpOverview-YPY-lX3M.js → McpOverview-Cj8_UyWJ.js} +2 -2
- package/dashboard/dist/assets/{McpOverview-YPY-lX3M.js.map → McpOverview-Cj8_UyWJ.js.map} +1 -1
- package/dashboard/dist/assets/{McpQueryDetailPage-Ct3Mb1R2.js → McpQueryDetailPage-Bqh8GChr.js} +2 -2
- package/dashboard/dist/assets/{McpQueryDetailPage-Ct3Mb1R2.js.map → McpQueryDetailPage-Bqh8GChr.js.map} +1 -1
- package/dashboard/dist/assets/{McpQueryPage-C5-AQvnp.js → McpQueryPage-CqFkBwBR.js} +2 -2
- package/dashboard/dist/assets/{McpQueryPage-C5-AQvnp.js.map → McpQueryPage-CqFkBwBR.js.map} +1 -1
- package/dashboard/dist/assets/{McpRunDetailPage-Bl12usuN.js → McpRunDetailPage-BqhRwkGk.js} +2 -2
- package/dashboard/dist/assets/{McpRunDetailPage-Bl12usuN.js.map → McpRunDetailPage-BqhRwkGk.js.map} +1 -1
- package/dashboard/dist/assets/{McpRunsPage-PRAQPR-H.js → McpRunsPage-CNXYU4iX.js} +2 -2
- package/dashboard/dist/assets/{McpRunsPage-PRAQPR-H.js.map → McpRunsPage-CNXYU4iX.js.map} +1 -1
- package/dashboard/dist/assets/OperationsPage-C7UB_d-X.js +2 -0
- package/dashboard/dist/assets/OperationsPage-C7UB_d-X.js.map +1 -0
- package/dashboard/dist/assets/OperatorDashboard-DwbPAPaf.js +2 -0
- package/dashboard/dist/assets/OperatorDashboard-DwbPAPaf.js.map +1 -0
- package/dashboard/dist/assets/{ProcessDetailPage-DyB979ge.js → ProcessDetailPage-ChGWcwSp.js} +2 -2
- package/dashboard/dist/assets/{ProcessDetailPage-DyB979ge.js.map → ProcessDetailPage-ChGWcwSp.js.map} +1 -1
- package/dashboard/dist/assets/{ProcessesListPage-BPi9CNxQ.js → ProcessesListPage-DatKHVkd.js} +2 -2
- package/dashboard/dist/assets/{ProcessesListPage-BPi9CNxQ.js.map → ProcessesListPage-DatKHVkd.js.map} +1 -1
- package/dashboard/dist/assets/{RoleDetailPage-D6K3tdNO.js → RoleDetailPage-GJ_coHsM.js} +2 -2
- package/dashboard/dist/assets/{RoleDetailPage-D6K3tdNO.js.map → RoleDetailPage-GJ_coHsM.js.map} +1 -1
- package/dashboard/dist/assets/{RolesPage-C_i2RLwv.js → RolesPage-CPKw336d.js} +2 -2
- package/dashboard/dist/assets/{RolesPage-C_i2RLwv.js.map → RolesPage-CPKw336d.js.map} +1 -1
- package/dashboard/dist/assets/{RunAsSelector-CWBQWKM0.js → RunAsSelector-VbBn0o7s.js} +2 -2
- package/dashboard/dist/assets/{RunAsSelector-CWBQWKM0.js.map → RunAsSelector-VbBn0o7s.js.map} +1 -1
- package/dashboard/dist/assets/{StickyPagination-4cY0OXWj.js → StickyPagination-BI8tDf2V.js} +2 -2
- package/dashboard/dist/assets/{StickyPagination-4cY0OXWj.js.map → StickyPagination-BI8tDf2V.js.map} +1 -1
- package/dashboard/dist/assets/{StreamMessageDetail-DxA7AzOR.js → StreamMessageDetail-BObbEz7P.js} +2 -2
- package/dashboard/dist/assets/{StreamMessageDetail-DxA7AzOR.js.map → StreamMessageDetail-BObbEz7P.js.map} +1 -1
- package/dashboard/dist/assets/{SwimlaneTimeline-BlinxMjc.js → SwimlaneTimeline-BHjAtOGC.js} +2 -2
- package/dashboard/dist/assets/{SwimlaneTimeline-BlinxMjc.js.map → SwimlaneTimeline-BHjAtOGC.js.map} +1 -1
- package/dashboard/dist/assets/{TaskDetailPage-Cbr6Bzx3.js → TaskDetailPage-B-E1dqUw.js} +2 -2
- package/dashboard/dist/assets/{TaskDetailPage-Cbr6Bzx3.js.map → TaskDetailPage-B-E1dqUw.js.map} +1 -1
- package/dashboard/dist/assets/{TasksListPage-DNjZbo42.js → TasksListPage-urJ4XiUi.js} +2 -2
- package/dashboard/dist/assets/{TasksListPage-DNjZbo42.js.map → TasksListPage-urJ4XiUi.js.map} +1 -1
- package/dashboard/dist/assets/{TimeAgo-BEOuisPG.js → TimeAgo-D6Dg0SQs.js} +2 -2
- package/dashboard/dist/assets/{TimeAgo-BEOuisPG.js.map → TimeAgo-D6Dg0SQs.js.map} +1 -1
- package/dashboard/dist/assets/{TimestampCell--CLqQOJa.js → TimestampCell-DG__Gr-e.js} +2 -2
- package/dashboard/dist/assets/{TimestampCell--CLqQOJa.js.map → TimestampCell-DG__Gr-e.js.map} +1 -1
- package/dashboard/dist/assets/{ToolTestPanel-x7po38Fn.js → ToolTestPanel-D-hGLf95.js} +2 -2
- package/dashboard/dist/assets/{ToolTestPanel-x7po38Fn.js.map → ToolTestPanel-D-hGLf95.js.map} +1 -1
- package/dashboard/dist/assets/{TopicDetailPage-Bay2lUOW.js → TopicDetailPage-B10i4xV2.js} +2 -2
- package/dashboard/dist/assets/{TopicDetailPage-Bay2lUOW.js.map → TopicDetailPage-B10i4xV2.js.map} +1 -1
- package/dashboard/dist/assets/{TopicsPage-Ckh6ln0h.js → TopicsPage-C5THflVQ.js} +2 -2
- package/dashboard/dist/assets/{TopicsPage-Ckh6ln0h.js.map → TopicsPage-C5THflVQ.js.map} +1 -1
- package/dashboard/dist/assets/{UserName-Doe8DDXc.js → UserName-CZTpouta.js} +2 -2
- package/dashboard/dist/assets/{UserName-Doe8DDXc.js.map → UserName-CZTpouta.js.map} +1 -1
- package/dashboard/dist/assets/{WorkflowExecutionPage-DPymyMAM.js → WorkflowExecutionPage-mbnj6saI.js} +2 -2
- package/dashboard/dist/assets/{WorkflowExecutionPage-DPymyMAM.js.map → WorkflowExecutionPage-mbnj6saI.js.map} +1 -1
- package/dashboard/dist/assets/{WorkflowsDashboard-CrwdULL7.js → WorkflowsDashboard-DC_9GrpY.js} +2 -2
- package/dashboard/dist/assets/{WorkflowsDashboard-CrwdULL7.js.map → WorkflowsDashboard-DC_9GrpY.js.map} +1 -1
- package/dashboard/dist/assets/{WorkflowsOverview-YoPFHjOb.js → WorkflowsOverview-ClSH1UwG.js} +2 -2
- package/dashboard/dist/assets/{WorkflowsOverview-YoPFHjOb.js.map → WorkflowsOverview-ClSH1UwG.js.map} +1 -1
- package/dashboard/dist/assets/{YamlWorkflowDetailPage-B4H8WvSt.js → YamlWorkflowDetailPage-BkgoB7oD.js} +2 -2
- package/dashboard/dist/assets/{YamlWorkflowDetailPage-B4H8WvSt.js.map → YamlWorkflowDetailPage-BkgoB7oD.js.map} +1 -1
- package/dashboard/dist/assets/{YamlWorkflowsPage-gburzX11.js → YamlWorkflowsPage-Db_REA2f.js} +2 -2
- package/dashboard/dist/assets/{YamlWorkflowsPage-gburzX11.js.map → YamlWorkflowsPage-Db_REA2f.js.map} +1 -1
- package/dashboard/dist/assets/{agents-BwrYw_S8.js → agents-Dvb8j9AB.js} +2 -2
- package/dashboard/dist/assets/{agents-BwrYw_S8.js.map → agents-Dvb8j9AB.js.map} +1 -1
- package/dashboard/dist/assets/{bots-C0vU7IG9.js → bots-D9jYHjBM.js} +2 -2
- package/dashboard/dist/assets/{bots-C0vU7IG9.js.map → bots-D9jYHjBM.js.map} +1 -1
- package/dashboard/dist/assets/{capabilities-DOE8jqWc.js → capabilities-BAto9JcQ.js} +2 -2
- package/dashboard/dist/assets/{capabilities-DOE8jqWc.js.map → capabilities-BAto9JcQ.js.map} +1 -1
- package/dashboard/dist/assets/{controlplane-TtPp8V9E.js → controlplane-2Aic2Tfm.js} +2 -2
- package/dashboard/dist/assets/{controlplane-TtPp8V9E.js.map → controlplane-2Aic2Tfm.js.map} +1 -1
- package/dashboard/dist/assets/{escalation-columns-Cyp-K89u.js → escalation-columns-DPKPJtw3.js} +2 -2
- package/dashboard/dist/assets/{escalation-columns-Cyp-K89u.js.map → escalation-columns-DPKPJtw3.js.map} +1 -1
- package/dashboard/dist/assets/{index-BTsTdaRt.js → index-4zRmxPwA.js} +2 -2
- package/dashboard/dist/assets/{index-BTsTdaRt.js.map → index-4zRmxPwA.js.map} +1 -1
- package/dashboard/dist/assets/{index-DFJm742Y.js → index-B5JgykZD.js} +2 -2
- package/dashboard/dist/assets/{index-DFJm742Y.js.map → index-B5JgykZD.js.map} +1 -1
- package/dashboard/dist/assets/{index-CkwNuQzx.js → index-BW7-Q9Qf.js} +2 -2
- package/dashboard/dist/assets/{index-CkwNuQzx.js.map → index-BW7-Q9Qf.js.map} +1 -1
- package/dashboard/dist/assets/{index-stu9QXmW.js → index-BZbDwh_Y.js} +2 -2
- package/dashboard/dist/assets/{index-stu9QXmW.js.map → index-BZbDwh_Y.js.map} +1 -1
- package/dashboard/dist/assets/{index-Dh6F3Wbx.js → index-BzQIzZfd.js} +2 -2
- package/dashboard/dist/assets/{index-Dh6F3Wbx.js.map → index-BzQIzZfd.js.map} +1 -1
- package/dashboard/dist/assets/{index-b7P6Hjd3.js → index-C-T1Wq0Z.js} +2 -2
- package/dashboard/dist/assets/{index-b7P6Hjd3.js.map → index-C-T1Wq0Z.js.map} +1 -1
- package/dashboard/dist/assets/{index-BmsZnbW1.js → index-CKxFjMtw.js} +4 -4
- package/dashboard/dist/assets/{index-BmsZnbW1.js.map → index-CKxFjMtw.js.map} +1 -1
- package/dashboard/dist/assets/{index-zuK6pSyZ.js → index-CeM012DJ.js} +2 -2
- package/dashboard/dist/assets/{index-zuK6pSyZ.js.map → index-CeM012DJ.js.map} +1 -1
- package/dashboard/dist/assets/{index-CVZOAQVo.js → index-KkikDsJ2.js} +2 -2
- package/dashboard/dist/assets/{index-CVZOAQVo.js.map → index-KkikDsJ2.js.map} +1 -1
- package/dashboard/dist/assets/index-Pmvw74oY.css +1 -0
- package/dashboard/dist/assets/{index-j-X71wT4.js → index-_Q1Wf2A8.js} +2 -2
- package/dashboard/dist/assets/{index-j-X71wT4.js.map → index-_Q1Wf2A8.js.map} +1 -1
- package/dashboard/dist/assets/index-jkVeGCkD.js +5 -0
- package/dashboard/dist/assets/index-jkVeGCkD.js.map +1 -0
- package/dashboard/dist/assets/{index-CR1_qhQf.js → index-oHU-ramT.js} +2 -2
- package/dashboard/dist/assets/{index-CR1_qhQf.js.map → index-oHU-ramT.js.map} +1 -1
- package/dashboard/dist/assets/{index-Bl-09ECD.js → index-peRHL38z.js} +2 -2
- package/dashboard/dist/assets/{index-Bl-09ECD.js.map → index-peRHL38z.js.map} +1 -1
- package/dashboard/dist/assets/{knowledge-DD9NIG9d.js → knowledge-DO8idX0e.js} +2 -2
- package/dashboard/dist/assets/{knowledge-DD9NIG9d.js.map → knowledge-DO8idX0e.js.map} +1 -1
- package/dashboard/dist/assets/{mcp-C4upVuuP.js → mcp-BGpQlkFp.js} +2 -2
- package/dashboard/dist/assets/{mcp-C4upVuuP.js.map → mcp-BGpQlkFp.js.map} +1 -1
- package/dashboard/dist/assets/{mcp-query-JEk3cZyH.js → mcp-query-DT0SCB9l.js} +2 -2
- package/dashboard/dist/assets/{mcp-query-JEk3cZyH.js.map → mcp-query-DT0SCB9l.js.map} +1 -1
- package/dashboard/dist/assets/{pipelines-BkBpa2Y7.js → pipelines-CYk7cN6-.js} +2 -2
- package/dashboard/dist/assets/{pipelines-BkBpa2Y7.js.map → pipelines-CYk7cN6-.js.map} +1 -1
- package/dashboard/dist/assets/{tasks-B7QVagGw.js → tasks-B4Y5xbF0.js} +2 -2
- package/dashboard/dist/assets/{tasks-B7QVagGw.js.map → tasks-B4Y5xbF0.js.map} +1 -1
- package/dashboard/dist/assets/{topics-C55xydgR.js → topics-CVnqDw3B.js} +2 -2
- package/dashboard/dist/assets/{topics-C55xydgR.js.map → topics-CVnqDw3B.js.map} +1 -1
- package/dashboard/dist/assets/{useEventHooks-CKpFrpjc.js → useEventHooks-D8bVEx-w.js} +2 -2
- package/dashboard/dist/assets/{useEventHooks-CKpFrpjc.js.map → useEventHooks-D8bVEx-w.js.map} +1 -1
- package/dashboard/dist/assets/{useNamespace-BJbjZubz.js → useNamespace-B1t3hsGf.js} +2 -2
- package/dashboard/dist/assets/{useNamespace-BJbjZubz.js.map → useNamespace-B1t3hsGf.js.map} +1 -1
- package/dashboard/dist/assets/{useYamlActivityEvents-C80oooy6.js → useYamlActivityEvents-B8Ru07xQ.js} +2 -2
- package/dashboard/dist/assets/{useYamlActivityEvents-C80oooy6.js.map → useYamlActivityEvents-B8Ru07xQ.js.map} +1 -1
- package/dashboard/dist/assets/{users-BdvakxB1.js → users-C8H4jjTq.js} +2 -2
- package/dashboard/dist/assets/{users-BdvakxB1.js.map → users-C8H4jjTq.js.map} +1 -1
- package/dashboard/dist/assets/{workflows-DYTqfgom.js → workflows-BAdI5k--.js} +2 -2
- package/dashboard/dist/assets/{workflows-DYTqfgom.js.map → workflows-BAdI5k--.js.map} +1 -1
- package/dashboard/dist/assets/{yaml-workflows-D3o7rHzN.js → yaml-workflows-Bf2aQS-M.js} +2 -2
- package/dashboard/dist/assets/{yaml-workflows-D3o7rHzN.js.map → yaml-workflows-Bf2aQS-M.js.map} +1 -1
- package/dashboard/dist/index.html +2 -2
- package/docs/api/http/escalations.md +12 -3
- package/docs/hitl/escalation.md +21 -0
- package/docs/hitl/x-lt-embed.md +92 -3
- package/docs/hitl/x-lt-list-schema.md +15 -0
- package/package.json +2 -2
- package/dashboard/dist/assets/CustomDurationPicker-znQCEiPe.js +0 -2
- package/dashboard/dist/assets/CustomDurationPicker-znQCEiPe.js.map +0 -1
- package/dashboard/dist/assets/OperationsPage-DLGNcE-b.js +0 -2
- package/dashboard/dist/assets/OperationsPage-DLGNcE-b.js.map +0 -1
- package/dashboard/dist/assets/OperatorDashboard-353PWYOD.js +0 -2
- package/dashboard/dist/assets/OperatorDashboard-353PWYOD.js.map +0 -1
- package/dashboard/dist/assets/index-Cm42dgjx.css +0 -1
- package/dashboard/dist/assets/index-Wu6GCvUq.js +0 -5
- package/dashboard/dist/assets/index-Wu6GCvUq.js.map +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{u as o,b as t,c as n}from"./vendor-query-B2UbickB.js";import{d as u}from"./index-
|
|
2
|
-
//# sourceMappingURL=users-
|
|
1
|
+
import{u as o,b as t,c as n}from"./vendor-query-B2UbickB.js";import{d as u}from"./index-CKxFjMtw.js";function d(e={}){const s=new URLSearchParams;return e.role&&s.set("role",e.role),e.roleType&&s.set("roleType",e.roleType),e.status&&s.set("status",e.status),e.search&&s.set("search",e.search),e.limit&&s.set("limit",String(e.limit)),e.offset!==void 0&&s.set("offset",String(e.offset)),o({queryKey:["users",e],queryFn:()=>u(`/users?${s}`)})}function l(e){return o({queryKey:["users",e],queryFn:()=>u(`/users/${e}`),enabled:!!e})}function q(){const e=t();return n({mutationFn:s=>u("/users",{method:"POST",body:JSON.stringify(s)}),onSuccess:()=>{e.invalidateQueries({queryKey:["users"]})}})}function f(){const e=t();return n({mutationFn:({id:s,...r})=>u(`/users/${s}`,{method:"PUT",body:JSON.stringify(r)}),onSuccess:()=>{e.invalidateQueries({queryKey:["users"]})}})}function S(){const e=t();return n({mutationFn:s=>u(`/users/${s}`,{method:"DELETE"}),onSuccess:()=>{e.invalidateQueries({queryKey:["users"]})}})}function U(){const e=t();return n({mutationFn:({userId:s,role:r,type:i,read_scope:a,write_scope:y})=>u(`/users/${s}/roles`,{method:"POST",body:JSON.stringify({role:r,type:i,read_scope:a,write_scope:y})}),onSuccess:()=>{e.invalidateQueries({queryKey:["users"]})}})}function h(){const e=t();return n({mutationFn:({userId:s,role:r})=>u(`/users/${s}/roles/${encodeURIComponent(r)}`,{method:"DELETE"}),onSuccess:()=>{e.invalidateQueries({queryKey:["users"]})}})}export{l as a,q as b,f as c,U as d,h as e,S as f,d as u};
|
|
2
|
+
//# sourceMappingURL=users-C8H4jjTq.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"users-
|
|
1
|
+
{"version":3,"file":"users-C8H4jjTq.js","sources":["../../src/api/users.ts"],"sourcesContent":["import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query';\nimport { apiFetch } from './client';\nimport type { LTUserRecord, LTRoleType, LTReadScope, LTWriteScope } from './types';\n\ninterface UserListResponse {\n users: LTUserRecord[];\n total: number;\n}\n\ninterface UserFilters {\n role?: string;\n roleType?: string;\n status?: string;\n search?: string;\n limit?: number;\n offset?: number;\n}\n\nexport function useUsers(filters: UserFilters = {}) {\n const params = new URLSearchParams();\n if (filters.role) params.set('role', filters.role);\n if (filters.roleType) params.set('roleType', filters.roleType);\n if (filters.status) params.set('status', filters.status);\n if (filters.search) params.set('search', filters.search);\n if (filters.limit) params.set('limit', String(filters.limit));\n if (filters.offset !== undefined) params.set('offset', String(filters.offset));\n\n return useQuery<UserListResponse>({\n queryKey: ['users', filters],\n queryFn: () => apiFetch(`/users?${params}`),\n });\n}\n\nexport function useUser(id: string) {\n return useQuery<LTUserRecord>({\n queryKey: ['users', id],\n queryFn: () => apiFetch(`/users/${id}`),\n enabled: !!id,\n });\n}\n\nexport function useCreateUser() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: (data: {\n external_id: string;\n email?: string;\n display_name?: string;\n password?: string;\n roles?: { role: string; type: LTRoleType }[];\n }) =>\n apiFetch('/users', {\n method: 'POST',\n body: JSON.stringify(data),\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['users'] });\n },\n });\n}\n\nexport function useUpdateUser() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: ({\n id,\n ...data\n }: {\n id: string;\n email?: string;\n display_name?: string;\n status?: string;\n }) =>\n apiFetch(`/users/${id}`, {\n method: 'PUT',\n body: JSON.stringify(data),\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['users'] });\n },\n });\n}\n\nexport function useDeleteUser() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: (id: string) =>\n apiFetch(`/users/${id}`, { method: 'DELETE' }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['users'] });\n },\n });\n}\n\nexport function useAddUserRole() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: ({\n userId,\n role,\n type,\n read_scope,\n write_scope,\n }: {\n userId: string;\n role: string;\n type: LTRoleType;\n read_scope?: LTReadScope;\n write_scope?: LTWriteScope;\n }) =>\n apiFetch(`/users/${userId}/roles`, {\n method: 'POST',\n body: JSON.stringify({ role, type, read_scope, write_scope }),\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['users'] });\n },\n });\n}\n\nexport function useRemoveUserRole() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: ({ userId, role }: { userId: string; role: string }) =>\n apiFetch(`/users/${userId}/roles/${encodeURIComponent(role)}`, {\n method: 'DELETE',\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['users'] });\n },\n });\n}\n"],"names":["useUsers","filters","params","useQuery","apiFetch","useUser","id","useCreateUser","queryClient","useQueryClient","useMutation","data","useUpdateUser","useDeleteUser","useAddUserRole","userId","role","type","read_scope","write_scope","useRemoveUserRole"],"mappings":"qGAkBO,SAASA,EAASC,EAAuB,GAAI,CAClD,MAAMC,EAAS,IAAI,gBACnB,OAAID,EAAQ,MAAMC,EAAO,IAAI,OAAQD,EAAQ,IAAI,EAC7CA,EAAQ,UAAUC,EAAO,IAAI,WAAYD,EAAQ,QAAQ,EACzDA,EAAQ,QAAQC,EAAO,IAAI,SAAUD,EAAQ,MAAM,EACnDA,EAAQ,QAAQC,EAAO,IAAI,SAAUD,EAAQ,MAAM,EACnDA,EAAQ,OAAOC,EAAO,IAAI,QAAS,OAAOD,EAAQ,KAAK,CAAC,EACxDA,EAAQ,SAAW,QAAWC,EAAO,IAAI,SAAU,OAAOD,EAAQ,MAAM,CAAC,EAEtEE,EAA2B,CAChC,SAAU,CAAC,QAASF,CAAO,EAC3B,QAAS,IAAMG,EAAS,UAAUF,CAAM,EAAE,CAAA,CAC3C,CACH,CAEO,SAASG,EAAQC,EAAY,CAClC,OAAOH,EAAuB,CAC5B,SAAU,CAAC,QAASG,CAAE,EACtB,QAAS,IAAMF,EAAS,UAAUE,CAAE,EAAE,EACtC,QAAS,CAAC,CAACA,CAAA,CACZ,CACH,CAEO,SAASC,GAAgB,CAC9B,MAAMC,EAAcC,EAAA,EACpB,OAAOC,EAAY,CACjB,WAAaC,GAOXP,EAAS,SAAU,CACjB,OAAQ,OACR,KAAM,KAAK,UAAUO,CAAI,CAAA,CAC1B,EACH,UAAW,IAAM,CACfH,EAAY,kBAAkB,CAAE,SAAU,CAAC,OAAO,EAAG,CACvD,CAAA,CACD,CACH,CAEO,SAASI,GAAgB,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vendor-query-B2UbickB.js";import{d as s}from"./index-
|
|
2
|
-
//# sourceMappingURL=workflows-
|
|
1
|
+
import{u as n,b as t,c as u}from"./vendor-query-B2UbickB.js";import{d as s}from"./index-CKxFjMtw.js";function f(){return n({queryKey:["activeWorkers"],queryFn:async()=>(await s("/workflows/workers")).workers})}function w(){return n({queryKey:["discoveredWorkflows"],queryFn:async()=>(await s("/workflows/discovered")).workflows})}function l(){return n({queryKey:["workflowConfigs"],queryFn:async()=>(await s("/workflows/config")).workflows})}function d(){return n({queryKey:["cronStatus"],queryFn:async()=>(await s("/workflows/cron/status")).schedules})}function k(e){return n({queryKey:["workflowExecution",e],queryFn:()=>s(`/workflow-states/${e}/execution`),enabled:!!e})}function m(e,o){const r=new URLSearchParams;return e.limit&&r.set("limit",String(e.limit)),e.offset!==void 0&&r.set("offset",String(e.offset)),e.entity&&r.set("entity",e.entity),e.search&&r.set("search",e.search),e.status&&r.set("status",e.status),e.sort_by&&r.set("sort_by",e.sort_by),e.order&&r.set("order",e.order),e.registered&&r.set("registered",e.registered),e.namespace&&r.set("namespace",e.namespace),n({queryKey:["jobs",e],queryFn:()=>s(`/workflow-states/jobs?${r}`),enabled:(o==null?void 0:o.enabled)??!0})}function q(){const e=t();return u({mutationFn:o=>s(`/workflows/${o}/terminate`,{method:"POST"}),onSuccess:(o,r)=>{e.invalidateQueries({queryKey:["workflowExecution",r],refetchType:"all"}),e.invalidateQueries({queryKey:["jobs"],refetchType:"all"})}})}function g(){const e=t();return u({mutationFn:({workflow_type:o,...r})=>s(`/workflows/${encodeURIComponent(o)}/config`,{method:"PUT",body:JSON.stringify(r)}),onSuccess:()=>{e.invalidateQueries({queryKey:["workflowConfigs"],refetchType:"all"})}})}function h(){const e=t();return u({mutationFn:o=>s(`/workflows/${encodeURIComponent(o)}/config`,{method:"DELETE"}),onSuccess:()=>{e.invalidateQueries({queryKey:["workflowConfigs"],refetchType:"all"})}})}function b(){const e=t();return u({mutationFn:({workflowType:o,data:r,metadata:i,execute_as:a})=>s(`/workflows/${o}/invoke`,{method:"POST",body:JSON.stringify({data:r,metadata:i,...a?{execute_as:a}:{}})}),onSuccess:()=>{e.invalidateQueries({queryKey:["tasks"],refetchType:"all"}),e.invalidateQueries({queryKey:["jobs"],refetchType:"all"})}})}export{k as a,m as b,b as c,w as d,d as e,q as f,f as g,h,g as i,l as u};
|
|
2
|
+
//# sourceMappingURL=workflows-BAdI5k--.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflows-
|
|
1
|
+
{"version":3,"file":"workflows-BAdI5k--.js","sources":["../../src/api/workflows.ts"],"sourcesContent":["import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query';\nimport { apiFetch } from './client';\nimport type { ActiveWorker, CronScheduleEntry, DiscoveredWorkflow, LTJob, LTWorkflowConfig, WorkflowExecution } from './types';\n\nexport function useActiveWorkers() {\n return useQuery<ActiveWorker[]>({\n queryKey: ['activeWorkers'],\n queryFn: async () => {\n const res = await apiFetch<{ workers: ActiveWorker[] }>('/workflows/workers');\n return res.workers;\n },\n });\n}\n\nexport function useDiscoveredWorkflows() {\n return useQuery<DiscoveredWorkflow[]>({\n queryKey: ['discoveredWorkflows'],\n queryFn: async () => {\n const res = await apiFetch<{ workflows: DiscoveredWorkflow[] }>('/workflows/discovered');\n return res.workflows;\n },\n });\n}\n\nexport function useWorkflowConfigs() {\n return useQuery<LTWorkflowConfig[]>({\n queryKey: ['workflowConfigs'],\n queryFn: async () => {\n const res = await apiFetch<{ workflows: LTWorkflowConfig[] }>('/workflows/config');\n return res.workflows;\n },\n });\n}\n\nexport function useCronStatus() {\n return useQuery<CronScheduleEntry[]>({\n queryKey: ['cronStatus'],\n queryFn: async () => {\n const res = await apiFetch<{ schedules: CronScheduleEntry[] }>('/workflows/cron/status');\n return res.schedules;\n },\n });\n}\n\nexport function useWorkflowExecution(workflowId: string) {\n return useQuery<WorkflowExecution>({\n queryKey: ['workflowExecution', workflowId],\n queryFn: () =>\n apiFetch(`/workflow-states/${workflowId}/execution`),\n enabled: !!workflowId,\n });\n}\n\nexport function useWorkflowState(workflowId: string) {\n return useQuery<{ workflow_id: string; state: Record<string, unknown> }>({\n queryKey: ['workflowState', workflowId],\n queryFn: () => apiFetch(`/workflow-states/${workflowId}/state`),\n enabled: !!workflowId,\n });\n}\n\nexport function useJobs(filters: {\n limit?: number;\n offset?: number;\n entity?: string;\n search?: string;\n status?: string;\n sort_by?: string;\n order?: string;\n registered?: string;\n namespace?: string;\n}, options?: { enabled?: boolean }) {\n const params = new URLSearchParams();\n if (filters.limit) params.set('limit', String(filters.limit));\n if (filters.offset !== undefined) params.set('offset', String(filters.offset));\n if (filters.entity) params.set('entity', filters.entity);\n if (filters.search) params.set('search', filters.search);\n if (filters.status) params.set('status', filters.status);\n if (filters.sort_by) params.set('sort_by', filters.sort_by);\n if (filters.order) params.set('order', filters.order);\n if (filters.registered) params.set('registered', filters.registered);\n if (filters.namespace) params.set('namespace', filters.namespace);\n\n return useQuery<{ jobs: LTJob[]; total: number }>({\n queryKey: ['jobs', filters],\n queryFn: () => apiFetch(`/workflow-states/jobs?${params}`),\n enabled: options?.enabled ?? true,\n });\n}\n\nexport function useTerminateWorkflow() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: (workflowId: string) =>\n apiFetch(`/workflows/${workflowId}/terminate`, { method: 'POST' }),\n onSuccess: (_data, workflowId) => {\n queryClient.invalidateQueries({ queryKey: ['workflowExecution', workflowId], refetchType: 'all' });\n queryClient.invalidateQueries({ queryKey: ['jobs'], refetchType: 'all' });\n },\n });\n}\n\nexport function useUpsertWorkflowConfig() {\n const queryClient = useQueryClient();\n return useMutation<\n LTWorkflowConfig,\n Error,\n {\n workflow_type: string;\n description?: string | null;\n\n invocable?: boolean;\n certified?: boolean;\n task_queue?: string | null;\n default_role?: string;\n roles?: string[];\n invocation_roles?: string[];\n consumes?: string[];\n envelope_schema?: Record<string, unknown> | null;\n resolver_schema?: Record<string, unknown> | null;\n cron_schedule?: string | null;\n execute_as?: string | null;\n }\n >({\n mutationFn: ({ workflow_type, ...body }) =>\n apiFetch(`/workflows/${encodeURIComponent(workflow_type)}/config`, {\n method: 'PUT',\n body: JSON.stringify(body),\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['workflowConfigs'], refetchType: 'all' });\n },\n });\n}\n\nexport function useDeleteWorkflowConfig() {\n const queryClient = useQueryClient();\n return useMutation<{ deleted: boolean; workflow_type: string }, Error, string>({\n mutationFn: (workflowType) =>\n apiFetch(`/workflows/${encodeURIComponent(workflowType)}/config`, {\n method: 'DELETE',\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['workflowConfigs'], refetchType: 'all' });\n },\n });\n}\n\nexport function useSetCronSchedule() {\n const queryClient = useQueryClient();\n return useMutation<\n LTWorkflowConfig,\n Error,\n { config: LTWorkflowConfig; cron_schedule: string | null; envelope_schema?: Record<string, unknown> | null }\n >({\n mutationFn: ({ config, cron_schedule, envelope_schema }) =>\n apiFetch(`/workflows/${encodeURIComponent(config.workflow_type)}/config`, {\n method: 'PUT',\n body: JSON.stringify({\n ...config,\n cron_schedule,\n ...(envelope_schema !== undefined ? { envelope_schema } : {}),\n }),\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['workflowConfigs'], refetchType: 'all' });\n queryClient.invalidateQueries({ queryKey: ['cronStatus'], refetchType: 'all' });\n },\n });\n}\n\nexport function useInvokeWorkflow() {\n const queryClient = useQueryClient();\n return useMutation<\n { workflowId: string; message: string },\n Error,\n { workflowType: string; data: Record<string, unknown>; metadata?: Record<string, unknown>; execute_as?: string }\n >({\n mutationFn: ({ workflowType, data, metadata, execute_as }) =>\n apiFetch(`/workflows/${workflowType}/invoke`, {\n method: 'POST',\n body: JSON.stringify({ data, metadata, ...(execute_as ? { execute_as } : {}) }),\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['tasks'], refetchType: 'all' });\n queryClient.invalidateQueries({ queryKey: ['jobs'], refetchType: 'all' });\n },\n });\n}\n"],"names":["useActiveWorkers","useQuery","apiFetch","useDiscoveredWorkflows","useWorkflowConfigs","useCronStatus","useWorkflowExecution","workflowId","useJobs","filters","options","params","useTerminateWorkflow","queryClient","useQueryClient","useMutation","_data","useUpsertWorkflowConfig","workflow_type","body","useDeleteWorkflowConfig","workflowType","useInvokeWorkflow","data","metadata","execute_as"],"mappings":"qGAIO,SAASA,GAAmB,CACjC,OAAOC,EAAyB,CAC9B,SAAU,CAAC,eAAe,EAC1B,QAAS,UACK,MAAMC,EAAsC,oBAAoB,GACjE,OACb,CACD,CACH,CAEO,SAASC,GAAyB,CACvC,OAAOF,EAA+B,CACpC,SAAU,CAAC,qBAAqB,EAChC,QAAS,UACK,MAAMC,EAA8C,uBAAuB,GAC5E,SACb,CACD,CACH,CAEO,SAASE,GAAqB,CACnC,OAAOH,EAA6B,CAClC,SAAU,CAAC,iBAAiB,EAC5B,QAAS,UACK,MAAMC,EAA4C,mBAAmB,GACtE,SACb,CACD,CACH,CAEO,SAASG,GAAgB,CAC9B,OAAOJ,EAA8B,CACnC,SAAU,CAAC,YAAY,EACvB,QAAS,UACK,MAAMC,EAA6C,wBAAwB,GAC5E,SACb,CACD,CACH,CAEO,SAASI,EAAqBC,EAAoB,CACvD,OAAON,EAA4B,CACjC,SAAU,CAAC,oBAAqBM,CAAU,EAC1C,QAAS,IACPL,EAAS,oBAAoBK,CAAU,YAAY,EACrD,QAAS,CAAC,CAACA,CAAA,CACZ,CACH,CAUO,SAASC,EAAQC,EAUrBC,EAAiC,CAClC,MAAMC,EAAS,IAAI,gBACnB,OAAIF,EAAQ,OAAOE,EAAO,IAAI,QAAS,OAAOF,EAAQ,KAAK,CAAC,EACxDA,EAAQ,SAAW,QAAWE,EAAO,IAAI,SAAU,OAAOF,EAAQ,MAAM,CAAC,EACzEA,EAAQ,QAAQE,EAAO,IAAI,SAAUF,EAAQ,MAAM,EACnDA,EAAQ,QAAQE,EAAO,IAAI,SAAUF,EAAQ,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,UAAW,IAAM,CACfR,EAAY,kBAAkB,CAAE,SAAU,CAAC,iBAAiB,EAAG,YAAa,MAAO,CACrF,CAAA,CACD,CACH,CAyBO,SAASS,GAAoB,CAClC,MAAMT,EAAcC,EAAA,EACpB,OAAOC,EAIL,CACA,WAAY,CAAC,CAAE,aAAAM,EAAc,KAAAE,EAAM,SAAAC,EAAU,WAAAC,KAC3CvB,EAAS,cAAcmB,CAAY,UAAW,CAC5C,OAAQ,OACR,KAAM,KAAK,UAAU,CAAE,KAAAE,EAAM,SAAAC,EAAU,GAAIC,EAAa,CAAE,WAAAA,CAAA,EAAe,GAAK,CAAA,CAC/E,EACH,UAAW,IAAM,CACfZ,EAAY,kBAAkB,CAAE,SAAU,CAAC,OAAO,EAAG,YAAa,MAAO,EACzEA,EAAY,kBAAkB,CAAE,SAAU,CAAC,MAAM,EAAG,YAAa,MAAO,CAC1E,CAAA,CACD,CACH"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{u as l,b as a,c as s}from"./vendor-query-B2UbickB.js";import{d as r}from"./index-
|
|
2
|
-
//# sourceMappingURL=yaml-workflows-
|
|
1
|
+
import{u as l,b as a,c as s}from"./vendor-query-B2UbickB.js";import{d as r}from"./index-CKxFjMtw.js";function f(e={}){const o=new URLSearchParams;return e.status&&o.set("status",e.status),e.graph_topic&&o.set("graph_topic",e.graph_topic),e.app_id&&o.set("app_id",e.app_id),e.search&&o.set("search",e.search),e.set_id&&o.set("set_id",e.set_id),e.limit&&o.set("limit",String(e.limit)),e.offset!==void 0&&o.set("offset",String(e.offset)),l({queryKey:["yamlWorkflows",e],queryFn:()=>r(`/yaml-workflows?${o}`)})}function m(){return l({queryKey:["yamlWorkflowAppIds"],queryFn:()=>r("/yaml-workflows/app-ids")})}function c(e){return l({queryKey:["yamlWorkflows",e],queryFn:()=>r(`/yaml-workflows/${e}`),enabled:!!e})}function w(){const e=a();return s({mutationFn:o=>r("/yaml-workflows",{method:"POST",body:JSON.stringify(o)}),onSuccess:()=>{e.invalidateQueries({queryKey:["yamlWorkflows"],refetchType:"all"})}})}function k(){const e=a();return s({mutationFn:o=>r(`/yaml-workflows/${o}/deploy`,{method:"POST"}),onSuccess:()=>{e.invalidateQueries({queryKey:["yamlWorkflows"],refetchType:"all"})}})}function p(){const e=a();return s({mutationFn:o=>r(`/yaml-workflows/${o}/activate`,{method:"POST"}),onSuccess:()=>{e.invalidateQueries({queryKey:["yamlWorkflows"],refetchType:"all"})}})}function d(){const e=a();return s({mutationFn:({id:o,data:t,sync:n,execute_as:u})=>r(`/yaml-workflows/${o}/invoke`,{method:"POST",body:JSON.stringify({data:t,sync:n,...u?{execute_as:u}:{}})}),onSuccess:()=>{e.invalidateQueries({queryKey:["yamlWorkflows"],refetchType:"all"})}})}function h(){const e=a();return s({mutationFn:({id:o,task_queue:t,compilation_feedback:n})=>r(`/yaml-workflows/${o}/regenerate`,{method:"POST",body:JSON.stringify({task_queue:t,compilation_feedback:n})}),onSuccess:()=>{e.invalidateQueries({queryKey:["yamlWorkflows"],refetchType:"all"})}})}function q(){const e=a();return s({mutationFn:o=>r(`/yaml-workflows/${o}/archive`,{method:"POST"}),onSuccess:()=>{e.invalidateQueries({queryKey:["yamlWorkflows"],refetchType:"all"})}})}function W(){const e=a();return s({mutationFn:o=>r(`/yaml-workflows/${o}/restore`,{method:"POST"}),onSuccess:()=>{e.invalidateQueries({queryKey:["yamlWorkflows"],refetchType:"all"}),e.invalidateQueries({queryKey:["yamlWorkflow"],refetchType:"all"})}})}function S(){const e=a();return s({mutationFn:({id:o,...t})=>r(`/yaml-workflows/${o}`,{method:"PUT",body:JSON.stringify(t)}),onSuccess:()=>{e.invalidateQueries({queryKey:["yamlWorkflows"],refetchType:"all"})}})}function v(){const e=a();return s({mutationFn:o=>r(`/yaml-workflows/${o}`,{method:"DELETE"}),onSuccess:()=>{e.invalidateQueries({queryKey:["yamlWorkflows"],refetchType:"all"})}})}function T(e){return l({queryKey:["yamlWorkflows",e,"versions"],queryFn:()=>r(`/yaml-workflows/${e}/versions`),enabled:!!e})}function F(e,o){return l({queryKey:["yamlWorkflows",e,"versions",o],queryFn:()=>r(`/yaml-workflows/${e}/versions/${o}`),enabled:!!e&&o!==null})}export{m as a,S as b,c,T as d,k as e,p as f,q as g,W as h,v as i,h as j,F as k,d as l,w as m,f as u};
|
|
2
|
+
//# sourceMappingURL=yaml-workflows-Bf2aQS-M.js.map
|
package/dashboard/dist/assets/{yaml-workflows-D3o7rHzN.js.map → yaml-workflows-Bf2aQS-M.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"yaml-workflows-D3o7rHzN.js","sources":["../../src/api/yaml-workflows.ts"],"sourcesContent":["import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query';\nimport { apiFetch } from './client';\nimport type { LTYamlWorkflowRecord, LTYamlWorkflowStatus, LTYamlWorkflowVersion } from './types';\n\ninterface YamlWorkflowListResponse {\n workflows: LTYamlWorkflowRecord[];\n total: number;\n}\n\ninterface YamlWorkflowFilters {\n status?: LTYamlWorkflowStatus;\n graph_topic?: string;\n app_id?: string;\n search?: string;\n set_id?: string;\n limit?: number;\n offset?: number;\n}\n\nexport function useYamlWorkflows(filters: YamlWorkflowFilters = {}) {\n const params = new URLSearchParams();\n if (filters.status) params.set('status', filters.status);\n if (filters.graph_topic) params.set('graph_topic', filters.graph_topic);\n if (filters.app_id) params.set('app_id', filters.app_id);\n if (filters.search) params.set('search', filters.search);\n if (filters.set_id) params.set('set_id', filters.set_id);\n if (filters.limit) params.set('limit', String(filters.limit));\n if (filters.offset !== undefined) params.set('offset', String(filters.offset));\n\n return useQuery<YamlWorkflowListResponse>({\n queryKey: ['yamlWorkflows', filters],\n queryFn: () => apiFetch(`/yaml-workflows?${params}`),\n });\n}\n\nexport function useYamlWorkflowAppIds() {\n return useQuery<{ app_ids: string[] }>({\n queryKey: ['yamlWorkflowAppIds'],\n queryFn: () => apiFetch('/yaml-workflows/app-ids'),\n });\n}\n\nexport function useYamlWorkflowByTopic(graphTopic: string | undefined, appId?: string) {\n return useQuery<YamlWorkflowListResponse>({\n queryKey: ['yamlWorkflows', 'byTopic', graphTopic, appId],\n queryFn: () => {\n const params = new URLSearchParams({ graph_topic: graphTopic!, limit: '1' });\n if (appId) params.set('app_id', appId);\n return apiFetch(`/yaml-workflows?${params}`);\n },\n enabled: !!graphTopic,\n });\n}\n\nexport function useYamlWorkflow(id: string) {\n return useQuery<LTYamlWorkflowRecord>({\n queryKey: ['yamlWorkflows', id],\n queryFn: () => apiFetch(`/yaml-workflows/${id}`),\n enabled: !!id,\n });\n}\n\nexport function useCreateYamlWorkflow() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: (input: {\n workflow_id: string;\n task_queue: string;\n workflow_name: string;\n name: string;\n description?: string;\n app_id?: string;\n subscribes?: string;\n tags?: string[];\n compilation_feedback?: string;\n }) =>\n apiFetch<LTYamlWorkflowRecord>('/yaml-workflows', {\n method: 'POST',\n body: JSON.stringify(input),\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['yamlWorkflows'], refetchType: 'all' });\n },\n });\n}\n\nexport function useDeployYamlWorkflow() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: (id: string) =>\n apiFetch<LTYamlWorkflowRecord>(`/yaml-workflows/${id}/deploy`, {\n method: 'POST',\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['yamlWorkflows'], refetchType: 'all' });\n },\n });\n}\n\nexport function useActivateYamlWorkflow() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: (id: string) =>\n apiFetch<LTYamlWorkflowRecord>(`/yaml-workflows/${id}/activate`, {\n method: 'POST',\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['yamlWorkflows'], refetchType: 'all' });\n },\n });\n}\n\nexport function useInvokeYamlWorkflow() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: ({ id, data, sync, execute_as }: { id: string; data: Record<string, unknown>; sync?: boolean; execute_as?: string }) =>\n apiFetch<{ result?: unknown; job_id?: string }>(`/yaml-workflows/${id}/invoke`, {\n method: 'POST',\n body: JSON.stringify({ data, sync, ...(execute_as ? { execute_as } : {}) }),\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['yamlWorkflows'], refetchType: 'all' });\n },\n });\n}\n\nexport function useRegenerateYamlWorkflow() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: ({ id, task_queue, compilation_feedback }: { id: string; task_queue?: string; compilation_feedback?: string }) =>\n apiFetch<LTYamlWorkflowRecord>(`/yaml-workflows/${id}/regenerate`, {\n method: 'POST',\n body: JSON.stringify({ task_queue, compilation_feedback }),\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['yamlWorkflows'], refetchType: 'all' });\n },\n });\n}\n\nexport function useArchiveYamlWorkflow() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: (id: string) =>\n apiFetch<LTYamlWorkflowRecord>(`/yaml-workflows/${id}/archive`, {\n method: 'POST',\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['yamlWorkflows'], refetchType: 'all' });\n },\n });\n}\n\nexport function useRestoreYamlWorkflow() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: (id: string) =>\n apiFetch<LTYamlWorkflowRecord>(`/yaml-workflows/${id}/restore`, {\n method: 'POST',\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['yamlWorkflows'], refetchType: 'all' });\n queryClient.invalidateQueries({ queryKey: ['yamlWorkflow'], refetchType: 'all' });\n },\n });\n}\n\nexport function useUpdateYamlWorkflow() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: ({ id, ...updates }: { id: string; yaml_content?: string; name?: string; description?: string; input_schema?: Record<string, unknown>; output_schema?: Record<string, unknown>; tags?: string[]; app_id?: string; graph_topic?: string }) =>\n apiFetch<LTYamlWorkflowRecord>(`/yaml-workflows/${id}`, {\n method: 'PUT',\n body: JSON.stringify(updates),\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['yamlWorkflows'], refetchType: 'all' });\n },\n });\n}\n\nexport function useDeleteYamlWorkflow() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: (id: string) =>\n apiFetch<{ deleted: boolean }>(`/yaml-workflows/${id}`, {\n method: 'DELETE',\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['yamlWorkflows'], refetchType: 'all' });\n },\n });\n}\n\n// ── Cron scheduling ─────────────────────────────────────────────\n\nexport function useSetYamlCron() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: ({ id, cron_schedule, cron_envelope, execute_as }: {\n id: string;\n cron_schedule: string;\n cron_envelope?: Record<string, unknown> | null;\n execute_as?: string | null;\n }) =>\n apiFetch<LTYamlWorkflowRecord>(`/yaml-workflows/${id}/cron`, {\n method: 'PUT',\n body: JSON.stringify({ cron_schedule, cron_envelope, execute_as }),\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['yamlWorkflows'], refetchType: 'all' });\n },\n });\n}\n\nexport function useClearYamlCron() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: (id: string) =>\n apiFetch<LTYamlWorkflowRecord>(`/yaml-workflows/${id}/cron`, {\n method: 'DELETE',\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['yamlWorkflows'], refetchType: 'all' });\n },\n });\n}\n\n// ── Version history ─────────────────────────────────────────────\n\nexport function useYamlWorkflowVersions(id: string) {\n return useQuery<{ versions: LTYamlWorkflowVersion[]; total: number }>({\n queryKey: ['yamlWorkflows', id, 'versions'],\n queryFn: () => apiFetch(`/yaml-workflows/${id}/versions`),\n enabled: !!id,\n });\n}\n\nexport function useYamlWorkflowVersion(id: string, version: number | null) {\n return useQuery<LTYamlWorkflowVersion>({\n queryKey: ['yamlWorkflows', id, 'versions', version],\n queryFn: () => apiFetch(`/yaml-workflows/${id}/versions/${version}`),\n enabled: !!id && version !== null,\n });\n}\n"],"names":["useYamlWorkflows","filters","params","useQuery","apiFetch","useYamlWorkflowAppIds","useYamlWorkflow","id","useCreateYamlWorkflow","queryClient","useQueryClient","useMutation","input","useDeployYamlWorkflow","useActivateYamlWorkflow","useInvokeYamlWorkflow","data","sync","execute_as","useRegenerateYamlWorkflow","task_queue","compilation_feedback","useArchiveYamlWorkflow","useRestoreYamlWorkflow","useUpdateYamlWorkflow","updates","useDeleteYamlWorkflow","useYamlWorkflowVersions","useYamlWorkflowVersion","version"],"mappings":"qGAmBO,SAASA,EAAiBC,EAA+B,GAAI,CAClE,MAAMC,EAAS,IAAI,gBACnB,OAAID,EAAQ,QAAQC,EAAO,IAAI,SAAUD,EAAQ,MAAM,EACnDA,EAAQ,aAAaC,EAAO,IAAI,cAAeD,EAAQ,WAAW,EAClEA,EAAQ,QAAQC,EAAO,IAAI,SAAUD,EAAQ,MAAM,EACnDA,EAAQ,QAAQC,EAAO,IAAI,SAAUD,EAAQ,MAAM,EACnDA,EAAQ,QAAQC,EAAO,IAAI,SAAUD,EAAQ,MAAM,EACnDA,EAAQ,OAAOC,EAAO,IAAI,QAAS,OAAOD,EAAQ,KAAK,CAAC,EACxDA,EAAQ,SAAW,QAAWC,EAAO,IAAI,SAAU,OAAOD,EAAQ,MAAM,CAAC,EAEtEE,EAAmC,CACxC,SAAU,CAAC,gBAAiBF,CAAO,EACnC,QAAS,IAAMG,EAAS,mBAAmBF,CAAM,EAAE,CAAA,CACpD,CACH,CAEO,SAASG,GAAwB,CACtC,OAAOF,EAAgC,CACrC,SAAU,CAAC,oBAAoB,EAC/B,QAAS,IAAMC,EAAS,yBAAyB,CAAA,CAClD,CACH,CAcO,SAASE,EAAgBC,EAAY,CAC1C,OAAOJ,EAA+B,CACpC,SAAU,CAAC,gBAAiBI,CAAE,EAC9B,QAAS,IAAMH,EAAS,mBAAmBG,CAAE,EAAE,EAC/C,QAAS,CAAC,CAACA,CAAA,CACZ,CACH,CAEO,SAASC,GAAwB,CACtC,MAA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ACH,UAAW,IAAM,CACfE,EAAY,kBAAkB,CAAE,SAAU,CAAC,eAAe,EAAG,YAAa,MAAO,CACnF,CAAA,CACD,CACH,CAsCO,SAASkB,EAAwBpB,EAAY,CAClD,OAAOJ,EAA+D,CACpE,SAAU,CAAC,gBAAiBI,EAAI,UAAU,EAC1C,QAAS,IAAMH,EAAS,mBAAmBG,CAAE,WAAW,EACxD,QAAS,CAAC,CAACA,CAAA,CACZ,CACH,CAEO,SAASqB,EAAuBrB,EAAYsB,EAAwB,CACzE,OAAO1B,EAAgC,CACrC,SAAU,CAAC,gBAAiBI,EAAI,WAAYsB,CAAO,EACnD,QAAS,IAAMzB,EAAS,mBAAmBG,CAAE,aAAasB,CAAO,EAAE,EACnE,QAAS,CAAC,CAACtB,GAAMsB,IAAY,IAAA,CAC9B,CACH"}
|
|
1
|
+
{"version":3,"file":"yaml-workflows-Bf2aQS-M.js","sources":["../../src/api/yaml-workflows.ts"],"sourcesContent":["import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query';\nimport { apiFetch } from './client';\nimport type { LTYamlWorkflowRecord, LTYamlWorkflowStatus, LTYamlWorkflowVersion } from './types';\n\ninterface YamlWorkflowListResponse {\n workflows: LTYamlWorkflowRecord[];\n total: number;\n}\n\ninterface YamlWorkflowFilters {\n status?: LTYamlWorkflowStatus;\n graph_topic?: string;\n app_id?: string;\n search?: string;\n set_id?: string;\n limit?: number;\n offset?: number;\n}\n\nexport function useYamlWorkflows(filters: YamlWorkflowFilters = {}) {\n const params = new URLSearchParams();\n if (filters.status) params.set('status', filters.status);\n if (filters.graph_topic) params.set('graph_topic', filters.graph_topic);\n if (filters.app_id) params.set('app_id', filters.app_id);\n if (filters.search) params.set('search', filters.search);\n if (filters.set_id) params.set('set_id', filters.set_id);\n if (filters.limit) params.set('limit', String(filters.limit));\n if (filters.offset !== undefined) params.set('offset', String(filters.offset));\n\n return useQuery<YamlWorkflowListResponse>({\n queryKey: ['yamlWorkflows', filters],\n queryFn: () => apiFetch(`/yaml-workflows?${params}`),\n });\n}\n\nexport function useYamlWorkflowAppIds() {\n return useQuery<{ app_ids: string[] }>({\n queryKey: ['yamlWorkflowAppIds'],\n queryFn: () => apiFetch('/yaml-workflows/app-ids'),\n });\n}\n\nexport function useYamlWorkflowByTopic(graphTopic: string | undefined, appId?: string) {\n return useQuery<YamlWorkflowListResponse>({\n queryKey: ['yamlWorkflows', 'byTopic', graphTopic, appId],\n queryFn: () => {\n const params = new URLSearchParams({ graph_topic: graphTopic!, limit: '1' });\n if (appId) params.set('app_id', appId);\n return apiFetch(`/yaml-workflows?${params}`);\n },\n enabled: !!graphTopic,\n });\n}\n\nexport function useYamlWorkflow(id: string) {\n return useQuery<LTYamlWorkflowRecord>({\n queryKey: ['yamlWorkflows', id],\n queryFn: () => apiFetch(`/yaml-workflows/${id}`),\n enabled: !!id,\n });\n}\n\nexport function useCreateYamlWorkflow() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: (input: {\n workflow_id: string;\n task_queue: string;\n workflow_name: string;\n name: string;\n description?: string;\n app_id?: string;\n subscribes?: string;\n tags?: string[];\n compilation_feedback?: string;\n }) =>\n apiFetch<LTYamlWorkflowRecord>('/yaml-workflows', {\n method: 'POST',\n body: JSON.stringify(input),\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['yamlWorkflows'], refetchType: 'all' });\n },\n });\n}\n\nexport function useDeployYamlWorkflow() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: (id: string) =>\n apiFetch<LTYamlWorkflowRecord>(`/yaml-workflows/${id}/deploy`, {\n method: 'POST',\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['yamlWorkflows'], refetchType: 'all' });\n },\n });\n}\n\nexport function useActivateYamlWorkflow() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: (id: string) =>\n apiFetch<LTYamlWorkflowRecord>(`/yaml-workflows/${id}/activate`, {\n method: 'POST',\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['yamlWorkflows'], refetchType: 'all' });\n },\n });\n}\n\nexport function useInvokeYamlWorkflow() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: ({ id, data, sync, execute_as }: { id: string; data: Record<string, unknown>; sync?: boolean; execute_as?: string }) =>\n apiFetch<{ result?: unknown; job_id?: string }>(`/yaml-workflows/${id}/invoke`, {\n method: 'POST',\n body: JSON.stringify({ data, sync, ...(execute_as ? { execute_as } : {}) }),\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['yamlWorkflows'], refetchType: 'all' });\n },\n });\n}\n\nexport function useRegenerateYamlWorkflow() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: ({ id, task_queue, compilation_feedback }: { id: string; task_queue?: string; compilation_feedback?: string }) =>\n apiFetch<LTYamlWorkflowRecord>(`/yaml-workflows/${id}/regenerate`, {\n method: 'POST',\n body: JSON.stringify({ task_queue, compilation_feedback }),\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['yamlWorkflows'], refetchType: 'all' });\n },\n });\n}\n\nexport function useArchiveYamlWorkflow() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: (id: string) =>\n apiFetch<LTYamlWorkflowRecord>(`/yaml-workflows/${id}/archive`, {\n method: 'POST',\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['yamlWorkflows'], refetchType: 'all' });\n },\n });\n}\n\nexport function useRestoreYamlWorkflow() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: (id: string) =>\n apiFetch<LTYamlWorkflowRecord>(`/yaml-workflows/${id}/restore`, {\n method: 'POST',\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['yamlWorkflows'], refetchType: 'all' });\n queryClient.invalidateQueries({ queryKey: ['yamlWorkflow'], refetchType: 'all' });\n },\n });\n}\n\nexport function useUpdateYamlWorkflow() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: ({ id, ...updates }: { id: string; yaml_content?: string; name?: string; description?: string; input_schema?: Record<string, unknown>; output_schema?: Record<string, unknown>; tags?: string[]; app_id?: string; graph_topic?: string }) =>\n apiFetch<LTYamlWorkflowRecord>(`/yaml-workflows/${id}`, {\n method: 'PUT',\n body: JSON.stringify(updates),\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['yamlWorkflows'], refetchType: 'all' });\n },\n });\n}\n\nexport function useDeleteYamlWorkflow() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: (id: string) =>\n apiFetch<{ deleted: boolean }>(`/yaml-workflows/${id}`, {\n method: 'DELETE',\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['yamlWorkflows'], refetchType: 'all' });\n },\n });\n}\n\n// ── Cron scheduling ─────────────────────────────────────────────\n\nexport function useSetYamlCron() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: ({ id, cron_schedule, cron_envelope, execute_as }: {\n id: string;\n cron_schedule: string;\n cron_envelope?: Record<string, unknown> | null;\n execute_as?: string | null;\n }) =>\n apiFetch<LTYamlWorkflowRecord>(`/yaml-workflows/${id}/cron`, {\n method: 'PUT',\n body: JSON.stringify({ cron_schedule, cron_envelope, execute_as }),\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['yamlWorkflows'], refetchType: 'all' });\n },\n });\n}\n\nexport function useClearYamlCron() {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: (id: string) =>\n apiFetch<LTYamlWorkflowRecord>(`/yaml-workflows/${id}/cron`, {\n method: 'DELETE',\n }),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['yamlWorkflows'], refetchType: 'all' });\n },\n });\n}\n\n// ── Version history ─────────────────────────────────────────────\n\nexport function useYamlWorkflowVersions(id: string) {\n return useQuery<{ versions: LTYamlWorkflowVersion[]; total: number }>({\n queryKey: ['yamlWorkflows', id, 'versions'],\n queryFn: () => apiFetch(`/yaml-workflows/${id}/versions`),\n enabled: !!id,\n });\n}\n\nexport function useYamlWorkflowVersion(id: string, version: number | null) {\n return useQuery<LTYamlWorkflowVersion>({\n queryKey: ['yamlWorkflows', id, 'versions', version],\n queryFn: () => apiFetch(`/yaml-workflows/${id}/versions/${version}`),\n enabled: !!id && version !== null,\n });\n}\n"],"names":["useYamlWorkflows","filters","params","useQuery","apiFetch","useYamlWorkflowAppIds","useYamlWorkflow","id","useCreateYamlWorkflow","queryClient","useQueryClient","useMutation","input","useDeployYamlWorkflow","useActivateYamlWorkflow","useInvokeYamlWorkflow","data","sync","execute_as","useRegenerateYamlWorkflow","task_queue","compilation_feedback","useArchiveYamlWorkflow","useRestoreYamlWorkflow","useUpdateYamlWorkflow","updates","useDeleteYamlWorkflow","useYamlWorkflowVersions","useYamlWorkflowVersion","version"],"mappings":"qGAmBO,SAASA,EAAiBC,EAA+B,GAAI,CAClE,MAAMC,EAAS,IAAI,gBACnB,OAAID,EAAQ,QAAQC,EAAO,IAAI,SAAUD,EAAQ,MAAM,EACnDA,EAAQ,aAAaC,EAAO,IAAI,cAAeD,EAAQ,WAAW,EAClEA,EAAQ,QAAQC,EAAO,IAAI,SAAUD,EAAQ,MAAM,EACnDA,EAAQ,QAAQC,EAAO,IAAI,SAAUD,EAAQ,MAAM,EACnDA,EAAQ,QAAQC,EAAO,IAAI,SAAUD,EAAQ,MAAM,EACnDA,EAAQ,OAAOC,EAAO,IAAI,QAAS,OAAOD,EAAQ,KAAK,CAAC,EACxDA,EAAQ,SAAW,QAAWC,EAAO,IAAI,SAAU,OAAOD,EAAQ,MAAM,CAAC,EAEtEE,EAAmC,CACxC,SAAU,CAAC,gBAAiBF,CAAO,EACnC,QAAS,IAAMG,EAAS,mBAAmBF,CAAM,EAAE,CAAA,CACpD,CACH,CAEO,SAASG,GAAwB,CACtC,OAAOF,EAAgC,CACrC,SAAU,CAAC,oBAAoB,EAC/B,QAAS,IAAMC,EAAS,yBAAyB,CAAA,CAClD,CACH,CAcO,SAASE,EAAgBC,EAAY,CAC1C,OAAOJ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nF,CAAA,CACD,CACH,CAEO,SAASiB,GAAwB,CACtC,MAAMjB,EAAcC,EAAA,EACpB,OAAOC,EAAY,CACjB,WAAaJ,GACXH,EAA+B,mBAAmBG,CAAE,GAAI,CACtD,OAAQ,QAAA,CACT,EACH,UAAW,IAAM,CACfE,EAAY,kBAAkB,CAAE,SAAU,CAAC,eAAe,EAAG,YAAa,MAAO,CACnF,CAAA,CACD,CACH,CAsCO,SAASkB,EAAwBpB,EAAY,CAClD,OAAOJ,EAA+D,CACpE,SAAU,CAAC,gBAAiBI,EAAI,UAAU,EAC1C,QAAS,IAAMH,EAAS,mBAAmBG,CAAE,WAAW,EACxD,QAAS,CAAC,CAACA,CAAA,CACZ,CACH,CAEO,SAASqB,EAAuBrB,EAAYsB,EAAwB,CACzE,OAAO1B,EAAgC,CACrC,SAAU,CAAC,gBAAiBI,EAAI,WAAYsB,CAAO,EACnD,QAAS,IAAMzB,EAAS,mBAAmBG,CAAE,aAAasB,CAAO,EAAE,EACnE,QAAS,CAAC,CAACtB,GAAMsB,IAAY,IAAA,CAC9B,CACH"}
|
|
@@ -8,11 +8,11 @@
|
|
|
8
8
|
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
|
9
9
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
|
10
10
|
<link href="https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap" rel="stylesheet" />
|
|
11
|
-
<script type="module" crossorigin src="./assets/index-
|
|
11
|
+
<script type="module" crossorigin src="./assets/index-CKxFjMtw.js"></script>
|
|
12
12
|
<link rel="modulepreload" crossorigin href="./assets/vendor-query-B2UbickB.js">
|
|
13
13
|
<link rel="modulepreload" crossorigin href="./assets/vendor-react-BpdAFEQc.js">
|
|
14
14
|
<link rel="modulepreload" crossorigin href="./assets/vendor-icons-BE_WrH2z.js">
|
|
15
|
-
<link rel="stylesheet" crossorigin href="./assets/index-
|
|
15
|
+
<link rel="stylesheet" crossorigin href="./assets/index-Pmvw74oY.css">
|
|
16
16
|
</head>
|
|
17
17
|
<body>
|
|
18
18
|
<div id="root"></div>
|
|
@@ -619,22 +619,31 @@ Claim multiple escalations for the authenticated user. Requires admin or superad
|
|
|
619
619
|
POST /api/escalations/bulk-assign
|
|
620
620
|
```
|
|
621
621
|
|
|
622
|
-
Assign multiple escalations to a specific user. Superadmins can assign anyone. Admins can only assign to users who hold the escalation's role.
|
|
622
|
+
Assign multiple escalations to a specific user, by id-set or by query (exactly one). Superadmins can assign anyone. Admins can only assign to users who hold the escalation's role.
|
|
623
|
+
|
|
624
|
+
The query form is one atomic statement: selection and claim happen in the same UPDATE, so a row that re-parks between a search and an ids-assign is still captured. Use it whenever the population is describable by role + facets.
|
|
623
625
|
|
|
624
626
|
**Request body:**
|
|
625
627
|
|
|
626
628
|
| Field | Type | Default | Description |
|
|
627
629
|
|-------|------|---------|-------------|
|
|
628
|
-
| `ids` | `string[]` | | Escalation UUIDs to assign |
|
|
630
|
+
| `ids` | `string[]` | | Escalation UUIDs to assign (ids form) |
|
|
631
|
+
| `query` | `object` | | `{ role, facets? }` selector (query form); `role` is required, `facets` filter by metadata containment |
|
|
629
632
|
| `targetUserId` | `string` | | User ID to assign the escalations to |
|
|
630
633
|
| `durationMinutes` | `integer` | 30 | How long each assignment lasts |
|
|
631
634
|
|
|
632
|
-
**Example request:**
|
|
635
|
+
**Example request (ids form):**
|
|
633
636
|
|
|
634
637
|
```json
|
|
635
638
|
{ "ids": ["esc-a1b2c3d4-..."], "targetUserId": "user-x1y2z3", "durationMinutes": 60 }
|
|
636
639
|
```
|
|
637
640
|
|
|
641
|
+
**Example request (query form):**
|
|
642
|
+
|
|
643
|
+
```json
|
|
644
|
+
{ "query": { "role": "order-items", "facets": { "orderId": "ORD-1042" } }, "targetUserId": "user-x1y2z3", "durationMinutes": 60 }
|
|
645
|
+
```
|
|
646
|
+
|
|
638
647
|
**Response 200:** Result object with assignment outcomes.
|
|
639
648
|
|
|
640
649
|
**Response 400:**
|
package/docs/hitl/escalation.md
CHANGED
|
@@ -53,6 +53,27 @@ export async function approvalWorkflow(envelope: LTEnvelope) {
|
|
|
53
53
|
- `false` — SLA timeout (omit `timeout` for an open-ended wait)
|
|
54
54
|
- `null` — cancellation (workflow terminated or explicit cancel)
|
|
55
55
|
|
|
56
|
+
### Resolution provenance — `$resolution`
|
|
57
|
+
|
|
58
|
+
Interactive and webhook resolves deliver the resolver's identity alongside the payload under the reserved `$resolution` key. Declare it in the generic to consume it — the standard pattern for assigning follow-on work to whoever resolved:
|
|
59
|
+
|
|
60
|
+
```typescript
|
|
61
|
+
import type { EscalationResolution } from '@hotmeshio/long-tail';
|
|
62
|
+
|
|
63
|
+
const decision = await conditionLT<{
|
|
64
|
+
approved: boolean;
|
|
65
|
+
$resolution?: EscalationResolution;
|
|
66
|
+
}>(signalId, { role: 'order-reviewer', metadata: { orderId } });
|
|
67
|
+
|
|
68
|
+
if (decision && decision.$resolution) {
|
|
69
|
+
const { escalationId, resolvedBy, resolvedByEmail } = decision.$resolution;
|
|
70
|
+
// e.g. claim the follow-on rows for the same person, atomically:
|
|
71
|
+
// POST /api/escalations/bulk-assign { query: {...}, targetUserId: resolvedBy }
|
|
72
|
+
}
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
`$resolution` carries `escalationId`, `resolvedBy` (user id), and `resolvedByEmail` when known. It rides the signal only — the stored `resolver_payload` audit column receives the form payload untouched. The same resolve also merges `resolved_by` into the row's GIN-indexed `metadata`, so "who resolved it" is `@>`-queryable without a follow-up read. The `$`-prefixed key namespace is reserved for control data; consumer form fields never collide with it.
|
|
76
|
+
|
|
56
77
|
### Row completeness guarantee
|
|
57
78
|
|
|
58
79
|
Every field of the config — including all `metadata` facets — commits inside the Leg1 checkpoint. A claim-by-metadata router or a version-pinned facet reads a complete row from its first visible moment; there is no window where a row is visible but its metadata is still en route.
|
package/docs/hitl/x-lt-embed.md
CHANGED
|
@@ -143,13 +143,32 @@ A structured query object. String values inside `facets` support `{{domain.path}
|
|
|
143
143
|
| Field | Type | Description |
|
|
144
144
|
|-------|------|-------------|
|
|
145
145
|
| `role` | `string` | Role queue to query |
|
|
146
|
-
| `status` | `string` | `"pending"
|
|
146
|
+
| `status` | `string` | `"pending"` (default), `"resolved"`, `"cancelled"`, `"expired"` |
|
|
147
147
|
| `facets` | `Record<string, string>` | Metadata containment filter; string values support `{{domain.path}}` tokens |
|
|
148
|
-
| `
|
|
148
|
+
| `assigned` | `"me"` \| `"any"` | Ownership scope — see below |
|
|
149
149
|
| `limit` | `number` | Max rows to show (default: 5) |
|
|
150
|
+
| `available` | `boolean` | Legacy availability flag; superseded by `assigned` |
|
|
150
151
|
|
|
151
152
|
The widget is disabled (shows no list and makes no API call) when neither `role` nor any facet value is set — both are required to avoid broad unbounded queries.
|
|
152
153
|
|
|
154
|
+
### Ownership scope (`assigned`)
|
|
155
|
+
|
|
156
|
+
Ownership is one more dimension of the same faceted query language — "claimed" is the implied status the API manages (pending, held, claim window live), not a separate list:
|
|
157
|
+
|
|
158
|
+
- `"me"` — rows claimed by the **viewing user**. The batch case: an earlier step assigned a set of order items to whoever claimed the batch; the follow-up form shows that person their own items with working inline actions.
|
|
159
|
+
- `"any"` — all matching rows regardless of claim state.
|
|
160
|
+
- omitted — available rows only (unclaimed, or claim window lapsed).
|
|
161
|
+
|
|
162
|
+
The scope resolves through ONE shared mapping consumed by the escalation-list widget, its `x-lt-actions`, and `x-lt-submit-guard` — a guard and an embed declaring the same query always agree on count and rows. Inline actions on claimed-to-me rows fire the standard resolve endpoint as the claim holder; RBAC and `enforce_schema` apply unchanged.
|
|
163
|
+
|
|
164
|
+
```json
|
|
165
|
+
"x-lt-query": {
|
|
166
|
+
"role": "order-items",
|
|
167
|
+
"facets": { "orderId": "{{metadata.orderId}}" },
|
|
168
|
+
"assigned": "me"
|
|
169
|
+
}
|
|
170
|
+
```
|
|
171
|
+
|
|
153
172
|
### `x-lt-columns` (optional)
|
|
154
173
|
|
|
155
174
|
An array of `{ label, value, format? }` — the same shape as `x-lt-columns` in list schemas. The `value` strings use `{{domain.path}}` tokens resolved against each **displayed** escalation's own context (its row, metadata, envelope, payload, resolver).
|
|
@@ -160,6 +179,34 @@ When `x-lt-columns` is absent, three default columns are used: Description, Role
|
|
|
160
179
|
|
|
161
180
|
Each row links to the escalation's detail page.
|
|
162
181
|
|
|
182
|
+
### `x-lt-actions` (optional)
|
|
183
|
+
|
|
184
|
+
Inline row actions: each row gains a button that fires a canned resolve against that escalation through the standard resolve endpoint. RBAC and `enforce_schema` validation apply server-side exactly as a full-form resolve — the button is a shortcut, not a bypass.
|
|
185
|
+
|
|
186
|
+
```json
|
|
187
|
+
"x-lt-actions": [
|
|
188
|
+
{
|
|
189
|
+
"label": "Picked ✓",
|
|
190
|
+
"resolverPayload": {
|
|
191
|
+
"approved": true,
|
|
192
|
+
"checks": { "picked": true, "scanned": true },
|
|
193
|
+
"orderId": "{{metadata.orderId}}"
|
|
194
|
+
},
|
|
195
|
+
"confirm": "Mark {{metadata.sku}} picked for {{metadata.orderId}}?"
|
|
196
|
+
}
|
|
197
|
+
]
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
| Field | Type | Description |
|
|
201
|
+
|-------|------|-------------|
|
|
202
|
+
| `label` | `string` | Button text |
|
|
203
|
+
| `resolverPayload` | `object` | The canned payload. String leaves interpolate `{{domain.path}}` tokens against the row's own context; booleans and numbers pass through typed |
|
|
204
|
+
| `confirm` | `string` | Optional confirm prompt shown before firing; tokens interpolate per row |
|
|
205
|
+
|
|
206
|
+
On success the row updates in place through the standard query invalidation — no navigation. A rejected resolve (validation failure, lost claim) shows the server's message inline in the row; the detail link stays available, so the full form remains the path for rejects and anything the canned payload can't express.
|
|
207
|
+
|
|
208
|
+
Declare one action for the happy path and leave the exception path to the form. A batch of N sibling items collapses from N navigations to N clicks on one page.
|
|
209
|
+
|
|
163
210
|
### Empty and loading states
|
|
164
211
|
|
|
165
212
|
- **Loading** — three skeleton rows are displayed.
|
|
@@ -167,6 +214,40 @@ Each row links to the escalation's detail page.
|
|
|
167
214
|
|
|
168
215
|
---
|
|
169
216
|
|
|
217
|
+
## Submit guard (`x-lt-submit-guard`)
|
|
218
|
+
|
|
219
|
+
A top-level form_schema token (a peer of `x-lt-help`) that keeps the resolve button honest while related work is still open. The submit stays disabled while the declared query returns rows; the message renders beside it with the live count. When the last row resolves, the socket-driven invalidation refires the query and the button lights up — no polling, no submit-and-get-rejected round trip.
|
|
220
|
+
|
|
221
|
+
```json
|
|
222
|
+
{
|
|
223
|
+
"x-lt-submit-guard": {
|
|
224
|
+
"query": {
|
|
225
|
+
"role": "order-items",
|
|
226
|
+
"facets": { "orderId": "{{metadata.orderId}}" },
|
|
227
|
+
"assigned": "me"
|
|
228
|
+
},
|
|
229
|
+
"mustBeEmpty": true,
|
|
230
|
+
"message": "{{count}} item(s) still pending — pick them before closing the order."
|
|
231
|
+
},
|
|
232
|
+
"type": "object",
|
|
233
|
+
"properties": { ... }
|
|
234
|
+
}
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
| Field | Type | Description |
|
|
238
|
+
|-------|------|-------------|
|
|
239
|
+
| `query` | `object` | Same shape as `x-lt-query` — including the `assigned` ownership scope; facet string values interpolate against the host escalation's context |
|
|
240
|
+
| `mustBeEmpty` | `boolean` | The gate condition (default `true`) |
|
|
241
|
+
| `message` | `string` | Shown beside the disabled submit; `{{count}}` carries the live row count, `{{domain.path}}` tokens also interpolate |
|
|
242
|
+
|
|
243
|
+
The guard and an escalation-list embed declaring the same query resolve through one shared mapping — the count and the visible rows always agree, whatever the scope.
|
|
244
|
+
|
|
245
|
+
Pair it with an `escalation-list` embed on the same query so the operator sees exactly which rows are holding the gate.
|
|
246
|
+
|
|
247
|
+
The guard is a UI layer: it makes the form honest, it does not enforce. A resolve arriving through the raw API bypasses it by design — the consuming workflow's own verification (reject and re-park with the remainder) is the durable backstop. Triage is never gated: when the guarded work itself is the problem, "Send to Triage" stays available.
|
|
248
|
+
|
|
249
|
+
---
|
|
250
|
+
|
|
170
251
|
## Composing with other tokens
|
|
171
252
|
|
|
172
253
|
All three embed widgets compose with the standard x-lt-* vocabulary:
|
|
@@ -210,4 +291,12 @@ The link widget generates a client-side URL; the queue it points to applies its
|
|
|
210
291
|
|
|
211
292
|
## Example workflow
|
|
212
293
|
|
|
213
|
-
The `examples/workflows/related-escalations/` workflow demonstrates all three widgets in a realistic two-stage review scenario. See `forms.ts` in that directory for the complete form
|
|
294
|
+
The `examples/workflows/related-escalations/` workflow demonstrates all three widgets in a realistic two-stage review scenario, followed by a claimed walk. See `forms.ts` and `forms-walk.ts` in that directory for the complete form schemas.
|
|
295
|
+
|
|
296
|
+
The claimed walk (stage 3, after the manager approves) is the ownership-scope reference:
|
|
297
|
+
|
|
298
|
+
1. Three plate rows park in `rel-plate`, each faceted with the walk's `originId`.
|
|
299
|
+
2. A walk-claim row parks in `rel-walker`. Resolving it IS the "start walk" button — the resolver's identity arrives on the workflow via `$resolution`, and one atomic query-form bulk assign claims every plate for that person.
|
|
300
|
+
3. The closeout row parks in `rel-closer`. Its form declares the walk query ONCE — `{ role: "rel-plate", facets: { originId: "{{metadata.originId}}" }, assigned: "me" }` — consumed by the embedded list, its `Bagged ✓` inline actions, and the submit guard. The walker bags each plate in place; the count beside the locked submit falls with each click; the last plate unlocks the submit.
|
|
301
|
+
|
|
302
|
+
The whole journey is two form submits and N inline clicks, with zero navigation.
|
|
@@ -19,11 +19,26 @@ Every string is a markdown/text template run through the same `{{domain.path}}`
|
|
|
19
19
|
| `x-lt-columns` | schema | Column definitions for `facet-table` layout: `[{ label, value, format? }]` |
|
|
20
20
|
| `x-lt-group-by` | schema | `facet-board`: the `"domain.path"` whose value identifies each entity |
|
|
21
21
|
| `x-lt-card` | schema | `facet-board`: the per-entity card — `{ title, state?, fields?: [{ label, value, format? }] }` |
|
|
22
|
+
| `x-lt-row-action` | schema | The per-row action button: `{ action?, label?, durationMinutes? }` — see below |
|
|
22
23
|
|
|
23
24
|
`format: "age"` on a `facet-table` column or `facet-board` field renders a timestamp as a compact age (`12m`, `3h`, `2d`) with the absolute time as its tooltip, repainted each minute — aging interim states are scannable at a glance.
|
|
24
25
|
|
|
25
26
|
The **active** item is the first non-terminal escalation. The **history** column is lazy-loaded — a "Load full history" link fetches resolved items on demand (`status` defaults to `"resolved"`, `limit` to 25). Unknown or absent `x-lt-layout` is a safe no-op that falls back to the table.
|
|
26
27
|
|
|
28
|
+
### Row action (`x-lt-row-action`)
|
|
29
|
+
|
|
30
|
+
Every layout carries a persistent action button — the active card's CTA, a trailing button on each `facet-table` row, a footer button on each `facet-board` card. The template sets what it does:
|
|
31
|
+
|
|
32
|
+
```jsonc
|
|
33
|
+
"x-lt-row-action": {
|
|
34
|
+
"action": "claim", // "claim" | "view" — default "claim"
|
|
35
|
+
"label": "Service", // button text; defaults "Claim" / "View"
|
|
36
|
+
"durationMinutes": 60 // claim hold time; default 30
|
|
37
|
+
}
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
`claim` is one click: the row is claimed for the template's duration and the detail page opens already claimed — the fast path for working a queue. The button appears only on claimable rows (pending, no live claim window), and a rejected claim (someone else won the race) surfaces its message inline. `view` opens the detail page — for read-only templates where claiming from the list is wrong. Row and card clicks continue to navigate; the button is the deliberate gesture.
|
|
41
|
+
|
|
27
42
|
---
|
|
28
43
|
|
|
29
44
|
## Layouts
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hotmeshio/long-tail",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.8",
|
|
4
4
|
"description": "Long Tail Workflows — Durable AI workflows with human-in-the-loop escalation. Powered by PostgreSQL.",
|
|
5
5
|
"main": "./build/index.js",
|
|
6
6
|
"types": "./build/index.d.ts",
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
"@anthropic-ai/sdk": "^0.92.0",
|
|
73
73
|
"@aws-sdk/client-s3": "^3.1017.0",
|
|
74
74
|
"@aws-sdk/s3-request-presigner": "^3.1045.0",
|
|
75
|
-
"@hotmeshio/hotmesh": "^0.26.
|
|
75
|
+
"@hotmeshio/hotmesh": "^0.26.3",
|
|
76
76
|
"@modelcontextprotocol/sdk": "^1.27.1",
|
|
77
77
|
"@opentelemetry/exporter-trace-otlp-proto": "^0.215.0",
|
|
78
78
|
"@opentelemetry/resources": "^2.5.1",
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{j as t,a as j}from"./vendor-query-B2UbickB.js";import{M as Y}from"./Modal-CA2Iv02H.js";import{Q as _,m as M,K as W,b as q,P as z,u as J}from"./index-BmsZnbW1.js";import{a as C}from"./StatusBadge-BbqghFMi.js";import{S as D}from"./StickyPagination-4cY0OXWj.js";import{i as O}from"./CountdownTimer-CQSukTT4.js";import{ab as Q,ac as Z,ar as B}from"./vendor-icons-BE_WrH2z.js";import{D as X,f as P}from"./constants-BHkpVaqx.js";function wt({open:e,onClose:s,onConfirm:a,selectedCount:r,isPending:n,error:l}){const i=r&&r>1?`Cancel ${r} escalations`:"Cancel escalation";return t.jsx(Y,{open:e,onClose:s,title:i,children:t.jsxs("div",{className:"space-y-4",children:[t.jsx("p",{className:"text-sm text-text-secondary",children:r&&r>1?`This will permanently cancel ${r} escalations. Any waiting workflows will be unblocked and receive a cancellation signal.`:"This will permanently cancel this escalation. Any waiting workflow will be unblocked and receive a cancellation signal."}),t.jsx("p",{className:"text-xs text-text-tertiary",children:"This action cannot be undone."}),l&&t.jsx("p",{className:"text-xs text-status-error",children:l.message}),t.jsxs("div",{className:"flex justify-end gap-3 pt-2",children:[t.jsx("button",{onClick:s,disabled:n,className:"btn-secondary text-xs",children:"Keep"}),t.jsx("button",{onClick:a,disabled:n,className:"bg-status-error text-text-inverse px-3 py-1.5 rounded-md text-xs hover:opacity-90 transition-opacity disabled:opacity-50",children:n?"Cancelling...":"Yes, Cancel"})]})]})})}const G=new Set(["__proto__","constructor","prototype"]);function F(e){const s=[];for(const a of e.split(".")){const r=a.match(/^([^[\]]*)((?:\[\d+\])*)$/);if(!r)throw new Error(`invalid x-lt-bind path segment: "${a}"`);const[,n,l]=r;if(n){if(G.has(n))throw new Error(`x-lt-bind path may not target "${n}"`);s.push({key:n})}for(const i of l.match(/\d+/g)??[])s.push({index:Number(i)})}if(s.length===0)throw new Error(`empty x-lt-bind path: "${e}"`);return s}function R(e,s,a){const r=F(s);let n=e;for(let i=0;i<r.length-1;i++){const o=r[i],x=r[i+1],u="key"in o?o.key:o.index,c="index"in x;(n[u]==null||typeof n[u]!="object")&&(n[u]=c?[]:{}),n=n[u]}const l=r[r.length-1];n["key"in l?l.key:l.index]=a}function E(e,s){let a=e;for(const r of F(s)){if(a==null||typeof a!="object")return;a=a["key"in r?r.key:r.index]}return a}function U(e,s){const a=s==null?void 0:s["x-lt-bind"];return typeof a=="string"&&a.length>0?a:e}function kt(e,s){const a=s==null?void 0:s.properties;if(!a)return{...e};const r={};for(const[n,l]of Object.entries(a))n in e&&R(r,U(n,l),e[n]);return r}function Tt(e,s){const a=s==null?void 0:s.properties;if(!a)return e?{...e}:{};const r={};for(const[n,l]of Object.entries(a)){const i=E(e,U(n,l));i!==void 0&&(r[n]=i)}return r}const tt=["escalation","metadata","envelope","payload","resolver"],et=/\{\{\s*([^{}]+?)\s*\}\}/g,T="—";function L(e){if(e==null)return T;if(typeof e=="string")return e;if(typeof e=="number"||typeof e=="boolean")return String(e);try{return JSON.stringify(e)}catch{return T}}function p(e,s){return e.replace(et,(a,r)=>{const n=r.indexOf("."),l=n===-1?r:r.slice(0,n);if(!tt.includes(l))return T;const i=s[l];if(n===-1)return L(i);try{return L(E(i,r.slice(n+1)))}catch{return T}})}function st(e){const s=e==null?void 0:e["x-lt-help"];if(typeof s=="string"&&s.trim().length>0)return s;const a=e==null?void 0:e["x-lt-context"];return typeof a=="string"&&a.trim().length>0?a:null}function _t(e,s){const a=st(e);return a?p(a,s):null}function Et({isTerminal:e,status:s,claimed:a,claimedByMe:r}){return e?s==="cancelled"?"This escalation was cancelled. The record is shown for reference.":"This escalation has been resolved. The submitted form is shown for reference.":r?"You have claimed this escalation. Fill out the form and submit to resolve it.":a?"Another user has claimed this escalation. It unlocks if their claim expires or is released.":"Claim this escalation to enable the form."}const I=[{text:"text-rose-400",bg:"bg-rose-400/[0.08]"},{text:"text-pink-400",bg:"bg-pink-400/[0.08]"},{text:"text-fuchsia-400",bg:"bg-fuchsia-400/[0.08]"},{text:"text-purple-400",bg:"bg-purple-400/[0.08]"},{text:"text-violet-400",bg:"bg-violet-400/[0.08]"},{text:"text-indigo-400",bg:"bg-indigo-400/[0.08]"},{text:"text-blue-400",bg:"bg-blue-400/[0.08]"},{text:"text-sky-400",bg:"bg-sky-400/[0.08]"},{text:"text-cyan-400",bg:"bg-cyan-400/[0.08]"},{text:"text-teal-400",bg:"bg-teal-400/[0.08]"},{text:"text-emerald-400",bg:"bg-emerald-400/[0.08]"},{text:"text-green-400",bg:"bg-green-400/[0.08]"},{text:"text-lime-400",bg:"bg-lime-400/[0.08]"},{text:"text-yellow-400",bg:"bg-yellow-400/[0.08]"},{text:"text-amber-400",bg:"bg-amber-400/[0.08]"},{text:"text-orange-400",bg:"bg-orange-400/[0.08]"},{text:"text-red-400",bg:"bg-red-400/[0.08]"},{text:"text-stone-400",bg:"bg-stone-400/[0.08]"},{text:"text-rose-300",bg:"bg-rose-300/[0.08]"},{text:"text-violet-300",bg:"bg-violet-300/[0.08]"},{text:"text-sky-300",bg:"bg-sky-300/[0.08]"},{text:"text-teal-300",bg:"bg-teal-300/[0.08]"},{text:"text-amber-300",bg:"bg-amber-300/[0.08]"},{text:"text-pink-300",bg:"bg-pink-300/[0.08]"}];function at(e){let s=0;for(let a=0;a<e.length;a++)s=(s<<5)-s+e.charCodeAt(a)|0;return Math.abs(s)}function rt(e){return I[at(e)%I.length]}function nt(e){const[,s]=j.useState(0);j.useEffect(()=>{if(!e)return;const a=window.setInterval(()=>s(r=>r+1),6e4);return()=>window.clearInterval(a)},[e])}function it(e){var s;return[...e["x-lt-columns"]??[],...((s=e["x-lt-card"])==null?void 0:s.fields)??[]].some(a=>a.format==="age")}function N(e){const s=a=>{if(!a)return null;try{const r=JSON.parse(a);return r&&typeof r=="object"?r:null}catch{return null}};return{escalation:e,metadata:e.metadata??null,envelope:s(e.envelope),payload:s(e.escalation_payload),resolver:s(e.resolver_payload)}}const lt=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}/,K="—";function S({raw:e,format:s}){if(!e||e===K)return t.jsx("span",{className:"text-text-quaternary",children:K});if(s==="age"){const a=new Date(e);if(!Number.isNaN(a.getTime()))return t.jsx("span",{title:a.toLocaleString(),className:"tabular-nums whitespace-nowrap",children:z(e)})}return lt.test(e)?t.jsx(q,{date:e,format:"datetime",className:"text-text-primary"}):t.jsx(t.Fragment,{children:e})}function ct({esc:e,card:s,onOpen:a}){const r=N(e),n=s.title?p(s.title,r):e.type,l=e.status==="pending"&&!O(e);return t.jsxs("div",{children:[t.jsxs("div",{className:"flex items-start justify-between gap-6",children:[t.jsxs("button",{onClick:a,className:"text-left group min-w-0",children:[t.jsx("h3",{className:"heading-2 group-hover:text-accent transition-colors leading-tight",children:n}),s.subtitle&&t.jsx("p",{className:"text-xs text-text-tertiary mt-1.5",children:p(s.subtitle,r)})]}),l&&t.jsxs("button",{onClick:a,className:"inline-flex items-center gap-1.5 px-4 py-2 rounded-md bg-accent text-text-inverse text-xs font-medium hover:bg-accent-hover transition-colors shrink-0",children:["Claim",t.jsx(B,{className:"w-3.5 h-3.5"})]})]}),s.fields&&s.fields.length>0&&t.jsx("dl",{className:"flex flex-wrap gap-x-10 gap-y-4 mt-6",children:s.fields.map((i,o)=>t.jsxs("div",{children:[t.jsx("dt",{className:"text-2xs font-semibold uppercase tracking-widest text-text-tertiary",children:i.label}),t.jsx("dd",{className:"text-xs text-text-primary mt-1",children:t.jsx(S,{raw:p(i.value,r)})})]},o))}),s.body&&t.jsx("div",{className:"mt-7 pt-6 border-t border-surface-border/50",children:t.jsx(_,{content:p(s.body,r)})})]})}function ot({role:e,def:s,onRowClick:a}){var u,c;const[r,n]=j.useState(!1),l=W({role:e,status:s.status??"resolved",sort_by:"resolved_at",order:"desc",limit:s.limit??25,enabled:r}),i=((u=l.data)==null?void 0:u.escalations)??[],o=((c=l.data)==null?void 0:c.total)??0,x=s.row??{};return r?l.isLoading?t.jsx("p",{className:"text-xs text-text-tertiary italic",children:"Loading history…"}):i.length===0?t.jsx("p",{className:"text-xs text-text-tertiary italic",children:"No past revisions."}):t.jsxs("div",{children:[t.jsx("div",{className:"divide-y divide-surface-border/40",children:i.map(d=>{const b=N(d);return t.jsxs("button",{onClick:()=>a==null?void 0:a(d),className:"w-full text-left py-2.5 group flex items-center gap-3",children:[t.jsx("span",{className:`w-1.5 h-1.5 shrink-0 rounded-full dot-ring ${C[d.status]??"bg-status-pending"}`,title:d.status}),t.jsxs("span",{className:"min-w-0 flex-1",children:[t.jsx("span",{className:"block text-xs text-text-primary group-hover:text-accent transition-colors truncate",children:x.title?p(x.title,b):d.type}),x.subtitle&&t.jsx("span",{className:"block text-2xs text-text-tertiary truncate",children:p(x.subtitle,b)})]}),x.meta?t.jsx("span",{className:"text-2xs text-text-tertiary shrink-0",children:p(x.meta,b)}):d.resolved_at&&t.jsx(q,{date:d.resolved_at,format:"relative",className:"text-2xs text-text-tertiary shrink-0 whitespace-nowrap"})]},d.id)})}),o>i.length&&t.jsxs("p",{className:"text-2xs text-text-quaternary mt-3",children:["Showing ",i.length," of ",o,"."]})]}):t.jsx("button",{onClick:()=>n(!0),className:"text-xs text-accent hover:underline","data-testid":"load-history",children:"Load full history →"})}function xt({schema:e,rows:s,onRowClick:a}){const r=e["x-lt-columns"]??[];return s.length===0?t.jsx("p",{className:"text-xs text-text-tertiary italic",children:"No pending items."}):t.jsx("div",{className:"overflow-x-auto",children:t.jsxs("table",{className:"w-full text-xs",children:[t.jsx("thead",{children:t.jsxs("tr",{className:"border-b border-surface-border/60",children:[t.jsx("th",{className:"w-4 pb-2 pr-3","aria-label":"Status"}),r.map((n,l)=>t.jsx("th",{className:"text-left pb-2 pr-8 text-2xs font-semibold uppercase tracking-widest text-text-tertiary whitespace-nowrap",children:n.label},l))]})}),t.jsx("tbody",{className:"divide-y divide-surface-border/30",children:s.map(n=>{const l=N(n);return t.jsxs("tr",{onClick:()=>a==null?void 0:a(n),className:a?"group cursor-pointer hover:bg-surface-hover":"group","data-testid":"facet-table-row",children:[t.jsx("td",{className:"py-2.5 pr-3",children:t.jsx("span",{className:`w-1.5 h-1.5 inline-block rounded-full dot-ring ${C[n.status]??"bg-status-pending"}`,title:n.status})}),r.map((i,o)=>t.jsx("td",{className:"py-2.5 pr-8 text-text-secondary group-hover:text-text-primary transition-colors",children:t.jsx(S,{raw:p(i.value,l),format:i.format})},o))]},n.id)})})]})})}function H({children:e}){return t.jsx("p",{className:"text-2xs font-semibold uppercase tracking-widest text-text-tertiary mb-3",children:e})}function dt(e,s){var l;const a=s.indexOf("."),r=s.startsWith("metadata.")?s.slice(9):null,n=new Map;for(const i of e){const o=N(i);let x;try{x=a===-1?o[s]:E(o[s.slice(0,a)],s.slice(a+1))}catch{x=void 0}if(x==null||x==="")continue;const u=String(x),c=r?((l=i.metadata)==null?void 0:l[r])??x:x,d=n.get(u);d?(d.count+=1,new Date(i.created_at)>new Date(d.latest.created_at)&&(d.latest=i)):n.set(u,{key:u,rawValue:c,latest:i,count:1})}return[...n.values()].sort((i,o)=>i.key.localeCompare(o.key))}const ut=/^\{\{\s*metadata\.([a-zA-Z0-9_]+)\s*\}\}$/;function mt({schema:e,rows:s,role:a,onOpenDetail:r,onOpenGroup:n,onAddFacet:l}){const i=e["x-lt-group-by"],o=e["x-lt-card"]??{};if(!i)return t.jsx("p",{className:"text-xs text-text-tertiary italic",children:"facet-board needs an x-lt-group-by path."});const x=i.startsWith("metadata.")?i.slice(9):null,u=dt(s,i);return u.length===0?t.jsx("p",{className:"text-xs text-text-tertiary italic",children:"No entities in scope."}):t.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(15rem,1fr))] gap-4","data-testid":"facet-board",children:u.map(c=>{const d=N(c.latest),b=o.title?p(o.title,d):c.key,w=o.state?p(o.state,d):c.latest.subtype||c.latest.status,h=rt(w),y=m=>{if(m.shiftKey&&x&&l){l(x,c.rawValue);return}r==null||r(c.latest)};return t.jsxs("div",{role:"button",tabIndex:0,onClick:y,onKeyDown:m=>{(m.key==="Enter"||m.key===" ")&&(m.preventDefault(),y(m))},title:x?"Open the latest item · ⇧ click to filter the board":"Open the latest item",className:"group/card border-l-2 border-accent/30 bg-surface-sunken/40 rounded-[0.125em] px-4 py-3.5 cursor-pointer transition-colors hover:bg-surface-sunken/70 focus:outline-none focus-visible:ring-1 focus-visible:ring-accent/40","data-testid":"facet-board-card",children:[t.jsxs("div",{className:"flex items-center justify-between gap-2 mb-2.5",children:[t.jsx("span",{className:"text-2xs font-semibold uppercase tracking-wider text-text-secondary truncate",children:b}),t.jsx("span",{className:"shrink-0 px-1.5 py-0.5 rounded text-2xs font-mono font-medium",style:{color:h.text,backgroundColor:h.bg},title:w,children:w})]}),o.fields&&o.fields.length>0&&t.jsx("dl",{className:"space-y-1",children:o.fields.map((m,v)=>{var A,$;const f=(A=m.value.match(ut))==null?void 0:A[1],g=f?($=c.latest.metadata)==null?void 0:$[f]:void 0,V=f!=null&&g!==void 0&&g!==null&&g!=="";return t.jsxs("div",{className:"group/frow flex items-baseline justify-between gap-3",children:[t.jsx("dt",{className:"text-2xs uppercase tracking-wider text-text-quaternary shrink-0",children:m.label}),t.jsxs("dd",{className:"min-w-0 flex items-baseline gap-1 text-2xs text-text-primary",children:[t.jsx("span",{className:"truncate",children:t.jsx(S,{raw:p(m.value,d),format:m.format})}),t.jsx("span",{className:"shrink-0 w-9 self-center flex items-center justify-end gap-px",children:V&&(n||l)&&t.jsxs("span",{className:"flex items-center gap-px opacity-0 group-hover/frow:opacity-100 transition-opacity",children:[t.jsx("button",{onClick:k=>{k.stopPropagation(),k.shiftKey&&l?l(f,g):n==null||n(M(f,g,a))},className:"p-0.5 rounded text-text-quaternary hover:text-accent transition-colors",title:`Filter ${a}: ${f} = ${String(g)} · ⇧ click adds to current filters`,"data-testid":"facet-field-filter",children:t.jsx(Q,{className:"w-3 h-3"})}),t.jsx("button",{onClick:k=>{k.stopPropagation(),n==null||n(M(f,g))},className:"p-0.5 rounded text-text-quaternary hover:text-accent transition-colors",title:`Search all: ${f} = ${String(g)}`,"data-testid":"facet-field-search",children:t.jsx(Z,{className:"w-3 h-3"})})]})})]})]},v)})})]},c.key)})})}function St({role:e,listSchema:s,activeEscalations:a,onRowClick:r,onOpenGroup:n,onAddFacet:l,total:i,page:o,totalPages:x,pageSize:u,onPageChange:c,onPageSizeChange:d}){const b=s["x-lt-layout"],w=s["x-lt-active"]??{},h=a[0],y=s["x-lt-help"];nt(it(s));const m=h?t.jsx(ct,{esc:h,card:w,onOpen:()=>r==null?void 0:r(h)}):t.jsx("p",{className:"text-xs text-text-tertiary italic",children:"No active item right now."}),v=y&&h?t.jsx("div",{className:"mb-8",children:t.jsx(_,{content:p(y,N(h))})}):y?t.jsx("div",{className:"mb-8",children:t.jsx(_,{content:y})}):null;if(b==="facet-table"){const f=i??a.length;return t.jsxs("div",{children:[v,f>0&&t.jsxs("p",{className:"text-2xs text-text-tertiary mb-3 tabular-nums",children:[f.toLocaleString()," result",f!==1?"s":""]}),t.jsx(xt,{schema:s,rows:a,onRowClick:r}),o!==void 0&&x!==void 0&&c&&t.jsx(D,{page:o,totalPages:x,onPageChange:c,total:f,pageSize:u??25,onPageSizeChange:d})]})}return b==="facet-board"?t.jsxs("div",{children:[v,t.jsx(mt,{schema:s,rows:a,role:e,onOpenDetail:r,onOpenGroup:n,onAddFacet:l}),o!==void 0&&x!==void 0&&c&&x>1&&t.jsx(D,{page:o,totalPages:x,onPageChange:c,total:i??a.length,pageSize:u??25,onPageSizeChange:d})]}):b==="active-history"?t.jsxs("div",{children:[v,t.jsxs("div",{className:"grid grid-cols-1 @split:grid-cols-[1.6fr_1fr] gap-12 items-start",children:[t.jsxs("div",{children:[t.jsx(H,{children:"Active"}),m]}),t.jsxs("div",{children:[t.jsx(H,{children:"History"}),t.jsx(ot,{role:e,def:s["x-lt-history"]??{},onRowClick:r})]})]})]}):t.jsxs("div",{children:[v,m]})}function At(){const{data:e}=J();return j.useMemo(()=>{var a;return(((a=e==null?void 0:e.escalation)==null?void 0:a.claimDurations)??X).map(r=>({value:String(r),label:P(r)}))},[e])}const ft=[{value:1,label:"minutes"},{value:60,label:"hours"}];function $t({onChange:e,compact:s,autoFocus:a,"data-testid":r="custom-duration-input"}){const[n,l]=j.useState(""),[i,o]=j.useState(1);j.useEffect(()=>{const c=parseInt(n);e(c>0?c*i:0)},[n,i,e]);const x=s?"text-xs":"text-sm",u=s?"w-16":"w-20";return t.jsxs("div",{className:"flex items-center gap-2","data-testid":r,children:[t.jsx("input",{type:"number",min:1,max:i===60?24:1440,value:n,onChange:c=>l(c.target.value),placeholder:i===60?"hrs":"min",className:`input ${x} ${u} text-center`,autoFocus:a,"data-testid":`${r}-quantity`}),t.jsx("select",{value:i,onChange:c=>o(parseInt(c.target.value)),className:`select ${x} py-1`,"data-testid":`${r}-unit`,children:ft.map(c=>t.jsx("option",{value:c.value,children:c.label},c.value))})]})}export{$t as C,St as E,tt as H,wt as a,_t as b,Tt as c,Et as d,E as g,p as i,kt as m,N as r,At as u};
|
|
2
|
-
//# sourceMappingURL=CustomDurationPicker-znQCEiPe.js.map
|