UNPKG

twilly

Version:

Node.js Twilio API abstraction layer for Express applications

45 lines (44 loc) 1.26 kB
import { Request as ExpressRequest } from 'express'; import { SmsCookie } from "../SmsCookie"; declare type Numberlike = string | number; export interface RequestHeader { [index: string]: string; 'Content-Type'?: string; 'Set-Cookie'?: string; } export declare const XmlContentTypeHeader: RequestHeader; export interface TwilioWebhookRequestBody { ApiVersion?: string; AccountSid?: string; Body?: string; From?: string; FromCity?: string; FromCountry?: string; FromState?: string; FromZip?: Numberlike; MessageSid?: string; MessagingServiceSid?: string; NumMedia?: Numberlike; NumSegments?: Numberlike; SmsMessageSid?: string; SmsSid?: string; SmsStatus?: string; To?: string; ToCountry?: string; ToState?: string; ToCity?: string; ToZip?: Numberlike; } export interface TwilioWebhookRequest extends ExpressRequest { cookies: { [index: string]: SmsCookie; }; body: TwilioWebhookRequestBody; } export interface MockTwilioWebhookRequestOpts { body?: string; cookieKey?: string; from?: string; } export declare function getMockTwilioWebhookRequest({ body, cookieKey, from, }?: MockTwilioWebhookRequestOpts): TwilioWebhookRequest; export {};