feat(bpm): add recoverable connections and passive arrival monitoring

This commit is contained in:
abaishu0730 committed 2026-10-20 16:19:32 +08:00
1 parent 2d6349134f
commit 8ca493d439
37 files changed
+676 -69

No files matched your search

+2 -2
View File
@@ -1,8 +1,8 @@
// This router is called only after dashboard authentication and same-origin validation.
function workspaceApi({workspace,store,user,route,method,body,reply,bpmSessions}){
function workspaceApi({workspace,store,user,route,method,body,reply,bpmSessions,bpmMonitor}){
if(!workspace)return false;
const members=()=>store.users();
if(route==='/api/workspace' && method==='GET'){const snapshot=workspace.snapshot(members());snapshot.capabilities.remoteLogin=Boolean(bpmSessions);reply(200,snapshot);return true;}
if(route==='/api/workspace' && method==='GET'){const snapshot=workspace.snapshot(members());snapshot.capabilities.remoteLogin=Boolean(bpmSessions);snapshot.connections=snapshot.connections.map(c=>({...c,health:bpmSessions?.health?.snapshot(c.id)||{},monitoring:bpmMonitor?.snapshot(c.id)||{status:c.status==='disabled'?'paused':'waiting'}}));reply(200,snapshot);return true;}
if(method!=='POST')return false;
if(route==='/api/calendar'){reply(200,workspace.saveCalendar(body,user));return true;}
if(route==='/api/exceptions'){reply(201,workspace.createException(body,user,members()));return true;}