node-firewalla
Version:
Package to talk your firewalla box & API
26 lines (25 loc) • 1.02 kB
JavaScript
import { FWGroupApi } from "../api/index.js";
import { FWGetMessage, FWCmdMessage } from "../models/index.js";
import { FWGroupService } from "./FWGroupService.js";
export class AlarmService extends FWGroupService {
async getAll() {
let msg = new FWGetMessage("alarms");
return FWGroupApi.sendMessageToBox(this.fwGroup, msg);
}
async getById(alarmID) {
let msg = new FWGetMessage("alarm", { alarmID });
return FWGroupApi.sendMessageToBox(this.fwGroup, msg);
}
async getDetailsById(alarmID) {
let msg = new FWGetMessage("alarmDetail", { alarmID });
return FWGroupApi.sendMessageToBox(this.fwGroup, msg);
}
async ignoreAll() {
let msg = new FWCmdMessage("alarm:ignoreAll");
return FWGroupApi.sendMessageToBox(this.fwGroup, msg);
}
async ignoreById(alarmID) {
let msg = new FWCmdMessage("alarm:ignore", { alarmID });
return FWGroupApi.sendMessageToBox(this.fwGroup, msg);
}
}