node-firewalla
Version:
Package to talk your firewalla box & API
45 lines (44 loc) • 2.15 kB
JavaScript
;
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.FeatureService = exports.FWFeature = void 0;
const index_js_1 = require("../api/index.js");
const index_js_2 = require("../models/index.js");
const FWGroupService_js_1 = require("./FWGroupService.js");
var FWFeature;
(function (FWFeature) {
FWFeature["ADBLOCK"] = "adblock";
FWFeature["UNBOUND"] = "unbound";
FWFeature["SAFE_SEARCH"] = "safe_search";
FWFeature["FAMILY_PROTECT"] = "family_protect";
FWFeature["DATA_PLAN"] = "data_plan";
})(FWFeature = exports.FWFeature || (exports.FWFeature = {}));
class FeatureService extends FWGroupService_js_1.FWGroupService {
/**
* @param {string} featureName - Which feature to enable
*/
enableFeature(featureName) {
return __awaiter(this, void 0, void 0, function* () {
let msg = new index_js_2.FWCmdMessage("enableFeature", { featureName });
return index_js_1.FWGroupApi.sendMessageToBox(this.fwGroup, msg);
});
}
/**
* @param {string} featureName - Which feature to disable
*/
disableFeature(featureName) {
return __awaiter(this, void 0, void 0, function* () {
let msg = new index_js_2.FWCmdMessage("disableFeature", { featureName });
return index_js_1.FWGroupApi.sendMessageToBox(this.fwGroup, msg);
});
}
}
exports.FeatureService = FeatureService;