export function publishActionReply(redisCnx, options) { const { action, reqid, sender, reply, replyChannel, senderId = 'gps', } = options reply.action = action reply.sender = senderId if(reqid) reply.reqid = reqid const chan = replyChannel.replace(/\[UID\]/g, sender) redisCnx.redisPublish(chan, reply) } export function parseAt(payload, fallbackFn) { if(!payload?.at) return(fallbackFn()) const t = Date.parse(payload.at) if(Number.isNaN(t)) return(null) return(t / 1000) }