@aikidosec/firewall
Version:
Zen by Aikido is an embedded Web Application Firewall that autonomously protects Node.js apps against common and critical attacks
38 lines (37 loc) • 1.01 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.Hooks = void 0;
const BuiltinModule_1 = require("./BuiltinModule");
const Global_1 = require("./Global");
const Package_1 = require("./Package");
class Hooks {
constructor() {
this.packages = [];
this.builtinModules = [];
this.globals = [];
}
addPackage(packageName) {
const pkg = new Package_1.Package(packageName);
this.packages.push(pkg);
return pkg;
}
addGlobal(name, interceptors) {
const global = new Global_1.Global(name, interceptors);
this.globals.push(global);
}
addBuiltinModule(name) {
const module = new BuiltinModule_1.BuiltinModule(name);
this.builtinModules.push(module);
return module;
}
getPackages() {
return this.packages;
}
getBuiltInModules() {
return this.builtinModules;
}
getGlobals() {
return this.globals;
}
}
exports.Hooks = Hooks;