import { BaseConnector } from '../../base/base.connector'; import type { ISmsOptions, ISmsProvider, ISendMessageSuccessResponse, WithPassthrough, SmsSendResult, ISmsConnector } from '../../types'; import { ChannelTypeEnum } from '../../types'; import type { TextmagicConfig } from './textmagic.config'; import type { TextmagicNarrowedInput } from './textmagic.types'; export declare class TextmagicSmsConnector extends BaseConnector implements ISmsProvider, ISmsConnector { private config; readonly id = "textmagic"; readonly channelType: ChannelTypeEnum.SMS; constructor(config: TextmagicConfig, fetchImpl?: typeof fetch); /** * Thinwrap-native send. Implements `ISmsConnector`. * * Two outliers compared with other wrapped SMS providers: * 1. **Two-header auth pair** — `X-TM-Username` + `X-TM-Key` are independent * headers, both required. Not Basic, not Bearer. * 2. **Form-urlencoded body** — `application/x-www-form-urlencoded` (most * modern SMS providers use JSON). All numeric narrowed-input fields are * stringified explicitly; booleans encode as `'1'` / `'0'` (Textmagic's * documented expectation), not `'true'` / `'false'`. * * Wire-key casing is camelCase, written explicitly (no * `transformKeys` invocation). The recipient field is `phones` on the wire * (Textmagic supports comma-separated multi-recipient on this field); * single-recipient v1.0 baseline maps `input.to` → `phones` verbatim. */ send(input: TextmagicNarrowedInput): Promise; /** * Map Textmagic 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). */ private mapVendorError; sendMessage(options: ISmsOptions, bridgeProviderData?: WithPassthrough>): Promise; }