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.

16 lines (15 loc) 704 B
/** * Attack events (detected_attack and detected_attack_wave) are sent as fire-and-forget promises. * * However, in serverless environments like Lambda and Cloud Functions, * if the handler returns quickly, the execution environment freezes before these API calls complete, causing events to be lost. * * This class tracks these pending promises so they can be awaited before the function returns. * * Heartbeat and started events are already handled in the Lambda/Cloud Function integration and don't need tracking. */ export declare class PendingEvents { private pendingPromises; onAPICall(apiPromise: Promise<unknown>): void; waitUntilSent(timeoutInMS: number): Promise<void>; }