import { SentlyError } from "../core/errors.js"; import type { SmsOptions, SmsSendResult, SmsTransport } from "../core/sms-types.js"; import type { VerifyResult } from "../core/types.js"; /** Twilio Messages API configuration. */ export interface TwilioSmsConfig { /** * Twilio Account SID — always used in the Messages API URL path. * Store in environment variables — never hardcode. */ accountSid: string; /** * Basic-auth password: API Key Secret when {@link apiKey} is set, otherwise Auth Token. * Store in environment variables — never hardcode. */ authToken: string; /** * Optional Twilio API Key SID used as Basic-auth username (recommended in production). * When omitted, {@link accountSid} is used as the Basic-auth username. */ apiKey?: string; /** * Default From phone number, alphanumeric sender ID, short code, or channel address * (E.164 recommended, e.g. `+15557654321`). Either this / `options.from` or * {@link messagingServiceSid} is required. */ from?: string; /** * Messaging Service SID (`MG…`). When set and `From` is omitted, Twilio selects * the optimal sender from the service's Sender Pool. */ messagingServiceSid?: string; /** * Optional status callback URL (`StatusCallback`). Twilio POSTs delivery updates here. */ statusCallback?: string; } /** Error thrown when the Twilio SMS API returns a non-success response. */ export declare class TwilioSmsError extends SentlyError { readonly statusCode: number; readonly apiError: unknown; /** Creates a Twilio SMS API error with status code and response payload. */ constructor(message: string, statusCode: number, apiError: unknown); } /** * Twilio SMS transport via the Messages REST API (form-urlencoded). */ export declare class TwilioSmsTransport implements SmsTransport { readonly provider = "twilio-sms"; private readonly accountSid; private readonly authToken; private readonly apiKey?; private readonly from?; private readonly messagingServiceSid?; private readonly statusCallback?; /** Creates a Twilio SMS transport. */ constructor(config: TwilioSmsConfig); /** Sends an SMS via Twilio Messages API. */ send(options: SmsOptions): Promise; /** * Validates credentials via Twilio Account fetch * (`GET /2010-04-01/Accounts/{AccountSid}.json`). */ verify(): Promise; private authHeaders; private readJson; }