import { BaseConnector } from '../../base/base.connector'; import type { ISmsOptions, ISmsProvider, ISendMessageSuccessResponse, WithPassthrough, SmsSendResult, ISmsConnector } from '../../types'; import { ChannelTypeEnum } from '../../types'; import type { PlivoConfig } from './plivo.config'; import type { PlivoNarrowedInput } from './plivo.types'; export declare class PlivoSmsConnector extends BaseConnector implements ISmsProvider, ISmsConnector { private config; readonly id = "plivo"; readonly channelType: ChannelTypeEnum.SMS; constructor(config: PlivoConfig, fetchImpl?: typeof fetch); /** * Thinwrap-native send. Implements `ISmsConnector`. * Builds a JSON request body in snake_case wire shape (Plivo is one of the * few SMS providers that accepts JSON instead of form-encoded), * authenticates with HTTP Basic (`authId:authToken`), and POSTs to * `https://api.plivo.com/v1/Account//Message/` — the trailing slash * is required by Plivo. * * the connector writes wire keys (`src`, `dst`, `text`, `dlt_*`, * `powerpack_uuid`, `template_id`) explicitly in the `connectorBody` literal * — no shared casing transform is invoked since the connector-built fields * are already snake_case. * * `message_uuid` is documented as `string[]`; Thinwrap reports * `providerMessageId = raw.message_uuid?.[0] ?? null` Dev * Notes — consumers needing all segment UUIDs read `result.raw.message_uuid`. */ send(input: PlivoNarrowedInput): Promise; /** * Map Plivo error responses to canonical `ConnectorError` with the 6-value * `ProviderCode` union. Parses `Retry-After`: * parsed seconds embedded in `providerMessage` text; raw header * value on `cause.retryAfter`. No structured `retryAfterSeconds` field per * Retry is consumer policy (no retryAfterSeconds field). * * Plivo's error body shape is `{ api_id, error }` — both preserved in * `cause.raw`. `api_id` is an opaque request UUID, not an error code, so it * never sets `providerCode`. */ private mapVendorError; sendMessage(options: ISmsOptions, bridgeProviderData?: WithPassthrough>): Promise; }