feat(mcp): подготовить сервер и доступ к приёмке

This commit is contained in:
Denozordec committed 2026-11-03 03:12:03 +07:00
commit bf3d50e1ff
3835 files changed
+537122

No files matched your search

+10
View File
@@ -0,0 +1,10 @@
import type {CertificatesState,CertificateServerState} from "@mmapp/contracts/certificates"
export type CertificateSnapshot = { latest: CertificateServerState; confirmed: CertificateServerState | null }
export type CertificateSnapshots = Record<string, CertificateSnapshot>
/** Replace the enabled-device inventory; retain each failed device's last confirmed snapshot. */
export function mergeCertificateSnapshots(previous:CertificateSnapshots,result:CertificatesState):CertificateSnapshots {
return Object.fromEntries(result.servers.map(node=>[node.serverId,{
latest:node,
confirmed:node.error===null?node:previous[node.serverId]?.confirmed??null,
}]))
}