UNPKG

@davidbolaji/termii-node

Version:

Node.js SDK for Termii API – send SMS, voice, OTP, and manage messaging with ease.

32 lines 1.12 kB
import { TermiiEvent } from "../../types/eventService.type"; /** * Utility type that forces TypeScript to expand an interface * so IntelliSense shows its full shape instead of just the alias. */ type Expand<T> = { [K in keyof T]: T[K]; } & {}; /** * Service for verifying and handling Termii webhook events */ export declare class EventService { constructor(); /** * Verify that an incoming webhook event really came from Termii * * @param rawPayload - The raw request body (as a string) * @param signature - The "X-Termii-Signature" header from the request * @param secretKey - The Termii secretkey * @returns true if the signature is valid, false otherwise */ verifySignature(rawPayload: string, signature: string, secretKey: string): boolean; /** * Parse the incoming webhook event into a strongly typed object * * @param payload - Parsed JSON body of the webhook * @returns Expanded TermiiEvent with event details */ parseEvent(payload: unknown): Expand<TermiiEvent>; } export {}; //# sourceMappingURL=EventService.d.ts.map