feat(mcp): подготовить сервер и доступ к приёмке
This commit is contained in:
commit
bf3d50e1ff
3835 files changed
+537122
No files matched your search
@@ -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,
|
||||
}]))
|
||||
}
|
||||
Reference in new issue
Block a user