UNPKG

@aikidosec/firewall

Version:

Zen by Aikido is an embedded Application Firewall that autonomously protects Node.js apps against common and critical attacks, provides rate limiting, detects malicious traffic (including bots), and more.

26 lines (25 loc) 1.31 kB
import type { PackageFileInstrumentationInstruction, PackageFunctionInstrumentationInstruction } from "./instrumentation/types"; import { RequireInterceptor } from "./RequireInterceptor"; export declare class VersionedPackage { private readonly range; private requireInterceptors; private requireFileInterceptors; private fileInstrumentationInstructions; constructor(range: string); getRange(): string; onRequire(interceptor: RequireInterceptor): this; onFileRequire(relativePath: string, interceptor: RequireInterceptor): this; /** * Register instrumentation instructions for one or multiple functions in one file. * The path is relative to the package root. */ addFileInstrumentation(instruction: PackageFileInstrumentationInstruction): this; /** * Register instrumentation instructions for one or multiple functions in multiple similar files. * The paths are relative to the package root. */ addMultiFileInstrumentation(paths: string[] | string, functions: PackageFunctionInstrumentationInstruction[]): this; getRequireInterceptors(): RequireInterceptor[]; getRequireFileInterceptor(relativePath: string): RequireInterceptor | undefined; getFileInstrumentationInstructions(): PackageFileInstrumentationInstruction[]; }