/** * @module * Unifonic SMS REST transport (el.cloud). * * Aligned with Unifonic Send Message * (`POST https://el.cloud.unifonic.com/rest/SMS/messages`): * JSON body with `AppSid`, `SenderID`, `Recipient`, `Body`. * * Sently-first: wire into {@link createSmsSender}. * * @example * ```ts * import { createSmsSender } from "sently/sms"; * import { UnifonicTransport } from "sently/transports/unifonic"; * * const sms = createSmsSender({ * transport: new UnifonicTransport({ * appSid: process.env.UNIFONIC_APPSID!, * senderId: "MyBrand", * }), * }); * * await sms.send({ to: "+9665xxxxxxxx", body: "Hello" }); * ``` */ import { SentlyError } from "../core/errors.js"; import type { SmsOptions, SmsSendResult, SmsTransport } from "../core/sms-types.js"; import type { VerifyResult } from "../core/types.js"; /** Unifonic SMS API configuration. */ export interface UnifonicConfig { /** * Application SID (`AppSid`) from the Unifonic dashboard. * Store in environment variables — never hardcode. */ appSid: string; /** * Default SenderID (brand / approved sender). Required unless every send * passes `options.from` (mapped to `SenderID`). */ senderId?: string; /** * Optional delivery status callback URL forwarded as `statusCallback`. * Unifonic requires a public HTTPS URL (el.cloud OpenAPI). */ statusCallback?: string; /** * When true, request async execution (`async: true`). Default: false. */ async?: boolean; } /** Error thrown when the Unifonic SMS API returns a non-success response. */ export declare class UnifonicError extends SentlyError { readonly statusCode: number; readonly apiError: unknown; /** Creates a Unifonic SMS API error with status code and response payload. */ constructor(message: string, statusCode: number, apiError: unknown); } /** * Normalize a phone number for Unifonic: international digits without `+` or * leading `00`. */ export declare function normalizeUnifonicPhone(to: string): string; /** * Unifonic SMS transport via el.cloud REST (`AppSid` + JSON). */ export declare class UnifonicTransport implements SmsTransport { readonly provider = "unifonic"; private readonly appSid; private readonly senderId; private readonly statusCallback; private readonly async; /** Creates an Unifonic SMS transport. */ constructor(config: UnifonicConfig); /** * Sends an SMS via `POST https://el.cloud.unifonic.com/rest/SMS/messages` * (JSON: `AppSid`, `SenderID`, `Recipient`, `Body`; optional `CorrelationID`). */ send(options: SmsOptions): Promise; /** Lightweight credential check. */ verify(): Promise; }