/** * Compatibility API namespace — Twilio-compatible LAML API with AccountSid scoping. * * All updates use POST (Twilio-compatible, not REST-idiomatic PATCH/PUT). */ import type { HttpClient } from '../HttpClient.js'; import type { QueryParams } from '../types.js'; import { BaseResource } from '../base/BaseResource.js'; import { CrudResource } from '../base/CrudResource.js'; /** Compat account / subproject management (Twilio-compatible LAML). */ export declare class CompatAccounts extends BaseResource { constructor(http: HttpClient); /** * List accounts visible to the authenticated project. * * @param params - Optional filter / pagination query parameters. * @returns A LAML-shaped paginated account list. * @throws {RestError} On any non-2xx HTTP response. */ list(params?: QueryParams): Promise; /** * Create a new sub-account under the authenticated parent account. * * @param body - Account payload (`FriendlyName`, etc.) — LAML form keys. * @returns The newly-created account record. * @throws {RestError} On any non-2xx HTTP response. */ create(body: any): Promise; /** * Fetch an account by SID. * * @param sid - Account SID (e.g. `"AC..."`). * @returns The account record. * @throws {RestError} On any non-2xx HTTP response (including `404`). */ get(sid: string): Promise; /** * Update an account's attributes. LAML uses `POST` (not PATCH/PUT). * * @param sid - Account SID. * @param body - Partial update payload. Defaults to `{}`. * @returns The updated account record. * @throws {RestError} On any non-2xx HTTP response. */ update(sid: string, body?: any): Promise; } /** Compat call management with recording and stream sub-resources. */ export declare class CompatCalls extends CrudResource { constructor(http: HttpClient, basePath: string); /** * Update an in-progress or past call. LAML uses `POST` (not PATCH/PUT). * * @param sid - Call SID (e.g. `"CA..."`). * @param body - LAML-form update payload (`Status`, `Url`, etc.). Defaults to `{}`. * @returns The updated call record. * @throws {RestError} On any non-2xx HTTP response. */ update(sid: string, body?: any): Promise; /** * Start recording an active call. * * @param callSid - Call SID. * @param body - Recording parameters (channels, trim, status callback, etc.). * Defaults to `{}`. * @returns The newly-started recording record. * @throws {RestError} On any non-2xx HTTP response. */ startRecording(callSid: string, body?: any): Promise; /** * Update an active recording (e.g. `Status=paused` / `Status=stopped`). * * @param callSid - Call SID. * @param recordingSid - Recording SID returned by {@link startRecording}. * @param body - Update payload. Defaults to `{}`. * @returns The updated recording record. * @throws {RestError} On any non-2xx HTTP response. */ updateRecording(callSid: string, recordingSid: string, body?: any): Promise; /** * Start a media stream on an active call (WebSocket media forwarding). * * @param callSid - Call SID. * @param body - Stream parameters (URL, track, etc.). Defaults to `{}`. * @returns The newly-started stream record. * @throws {RestError} On any non-2xx HTTP response. */ startStream(callSid: string, body?: any): Promise; /** * Stop an active media stream on a call. * * @param callSid - Call SID. * @param streamSid - Stream SID returned by {@link startStream}. * @param body - Update payload. Defaults to `{}`. * @returns The stopped stream record. * @throws {RestError} On any non-2xx HTTP response. */ stopStream(callSid: string, streamSid: string, body?: any): Promise; } /** Compat message management with media sub-resources. */ export declare class CompatMessages extends CrudResource { constructor(http: HttpClient, basePath: string); /** * Update a message. LAML uses `POST` (not PATCH/PUT). * * @param sid - Message SID (e.g. `"SM..."` / `"MM..."`). * @param body - LAML-form update payload. Defaults to `{}`. * @returns The updated message record. * @throws {RestError} On any non-2xx HTTP response. */ update(sid: string, body?: any): Promise; /** * List media attachments for a message (MMS). * * @param messageSid - Message SID. * @param params - Optional filter / pagination query parameters. * @returns A paginated list of media records. * @throws {RestError} On any non-2xx HTTP response. */ listMedia(messageSid: string, params?: QueryParams): Promise; /** * Fetch a specific media attachment on a message. * * @param messageSid - Message SID. * @param mediaSid - Media SID. * @returns The media record (metadata + URL). * @throws {RestError} On any non-2xx HTTP response (including `404`). */ getMedia(messageSid: string, mediaSid: string): Promise; /** * Delete a media attachment from a message. * * @param messageSid - Message SID. * @param mediaSid - Media SID. * @returns The platform's delete response. * @throws {RestError} On any non-2xx HTTP response. */ deleteMedia(messageSid: string, mediaSid: string): Promise; } /** Compat fax management with media sub-resources. */ export declare class CompatFaxes extends CrudResource { constructor(http: HttpClient, basePath: string); /** * Update a fax. LAML uses `POST` (not PATCH/PUT). * * @param sid - Fax SID (e.g. `"FX..."`). * @param body - LAML-form update payload. Defaults to `{}`. * @returns The updated fax record. * @throws {RestError} On any non-2xx HTTP response. */ update(sid: string, body?: any): Promise; /** * List media attachments for a fax. * * @param faxSid - Fax SID. * @param params - Optional filter / pagination query parameters. * @returns A paginated list of media records. * @throws {RestError} On any non-2xx HTTP response. */ listMedia(faxSid: string, params?: QueryParams): Promise; /** * Fetch a specific media attachment on a fax. * * @param faxSid - Fax SID. * @param mediaSid - Media SID. * @returns The media record. * @throws {RestError} On any non-2xx HTTP response (including `404`). */ getMedia(faxSid: string, mediaSid: string): Promise; /** * Delete a media attachment from a fax. * * @param faxSid - Fax SID. * @param mediaSid - Media SID. * @returns The platform's delete response. * @throws {RestError} On any non-2xx HTTP response. */ deleteMedia(faxSid: string, mediaSid: string): Promise; } /** Compat conference management with participants, recordings, and streams. */ export declare class CompatConferences extends BaseResource { constructor(http: HttpClient, basePath: string); /** * List conferences in the account. * * @param params - Optional filter / pagination query parameters. * @returns A paginated list of conferences. * @throws {RestError} On any non-2xx HTTP response. */ list(params?: QueryParams): Promise; /** * Fetch a conference by SID. * * @param sid - Conference SID (e.g. `"CF..."`). * @returns The conference record. * @throws {RestError} On any non-2xx HTTP response (including `404`). */ get(sid: string): Promise; /** * Update a conference (e.g. `Status=completed` to terminate). * LAML uses `POST` (not PATCH/PUT). * * @param sid - Conference SID. * @param body - LAML-form update payload. Defaults to `{}`. * @returns The updated conference record. * @throws {RestError} On any non-2xx HTTP response. */ update(sid: string, body?: any): Promise; /** * List participants in a conference. * * @param conferenceSid - Conference SID. * @param params - Optional filter / pagination query parameters. * @returns A paginated list of participants. * @throws {RestError} On any non-2xx HTTP response. */ listParticipants(conferenceSid: string, params?: QueryParams): Promise; /** * Fetch a specific participant (by its call SID) in a conference. * * @param conferenceSid - Conference SID. * @param callSid - Participant's call SID. * @returns The participant record. * @throws {RestError} On any non-2xx HTTP response (including `404`). */ getParticipant(conferenceSid: string, callSid: string): Promise; /** * Update a participant (mute, hold, announce, etc.). LAML uses `POST`. * * @param conferenceSid - Conference SID. * @param callSid - Participant's call SID. * @param body - LAML-form update payload (e.g. `{ Muted: 'true' }`). * Defaults to `{}`. * @returns The updated participant record. * @throws {RestError} On any non-2xx HTTP response. */ updateParticipant(conferenceSid: string, callSid: string, body?: any): Promise; /** * Remove a participant from a conference (kick). * * @param conferenceSid - Conference SID. * @param callSid - Participant's call SID. * @returns The platform's delete response. * @throws {RestError} On any non-2xx HTTP response. */ removeParticipant(conferenceSid: string, callSid: string): Promise; /** * List recordings taken of a conference. * * @param conferenceSid - Conference SID. * @param params - Optional filter / pagination query parameters. * @returns A paginated list of recordings. * @throws {RestError} On any non-2xx HTTP response. */ listRecordings(conferenceSid: string, params?: QueryParams): Promise; /** * Fetch a specific conference recording. * * @param conferenceSid - Conference SID. * @param recordingSid - Recording SID. * @returns The recording record. * @throws {RestError} On any non-2xx HTTP response (including `404`). */ getRecording(conferenceSid: string, recordingSid: string): Promise; /** * Update an active conference recording (pause, resume, stop). LAML uses `POST`. * * @param conferenceSid - Conference SID. * @param recordingSid - Recording SID. * @param body - LAML-form update payload. Defaults to `{}`. * @returns The updated recording record. * @throws {RestError} On any non-2xx HTTP response. */ updateRecording(conferenceSid: string, recordingSid: string, body?: any): Promise; /** * Delete a conference recording. * * @param conferenceSid - Conference SID. * @param recordingSid - Recording SID. * @returns The platform's delete response. * @throws {RestError} On any non-2xx HTTP response. */ deleteRecording(conferenceSid: string, recordingSid: string): Promise; /** * Start a media stream on a conference. * * @param conferenceSid - Conference SID. * @param body - Stream parameters (URL, track, etc.). Defaults to `{}`. * @returns The newly-started stream record. * @throws {RestError} On any non-2xx HTTP response. */ startStream(conferenceSid: string, body?: any): Promise; /** * Stop an active conference media stream. * * @param conferenceSid - Conference SID. * @param streamSid - Stream SID returned by {@link startStream}. * @param body - Update payload. Defaults to `{}`. * @returns The stopped stream record. * @throws {RestError} On any non-2xx HTTP response. */ stopStream(conferenceSid: string, streamSid: string, body?: any): Promise; } /** Compat phone number management with searching, purchasing, and import. */ export declare class CompatPhoneNumbers extends BaseResource { private readonly _availableBase; constructor(http: HttpClient, basePath: string); /** * List owned incoming phone numbers in the account. * * @param params - Optional filter / pagination query parameters. * @returns A paginated list of owned numbers. * @throws {RestError} On any non-2xx HTTP response. */ list(params?: QueryParams): Promise; /** * Purchase a phone number (LAML `POST /IncomingPhoneNumbers`). * * @param body - Purchase payload, typically including `PhoneNumber` or * `AreaCode` plus webhook URLs. * @returns The newly-purchased phone-number record. * @throws {RestError} On any non-2xx HTTP response. */ purchase(body: any): Promise; /** * Fetch an owned phone number by SID. * * @param sid - Phone number SID (e.g. `"PN..."`). * @returns The phone-number record. * @throws {RestError} On any non-2xx HTTP response (including `404`). */ get(sid: string): Promise; /** * Update an owned phone number (webhook URLs, friendly name, etc.). * LAML uses `POST`. * * @param sid - Phone number SID. * @param body - LAML-form update payload. Defaults to `{}`. * @returns The updated phone-number record. * @throws {RestError} On any non-2xx HTTP response. */ update(sid: string, body?: any): Promise; /** * Release an owned phone number (delete). * * @param sid - Phone number SID. * @returns The platform's delete response. * @throws {RestError} On any non-2xx HTTP response. */ delete(sid: string): Promise; /** * Import an externally-hosted phone number into the account * (LAML `/ImportedPhoneNumbers`). * * @param body - Import payload (number, carrier details, etc.). * @returns The newly-imported number record. * @throws {RestError} On any non-2xx HTTP response. */ importNumber(body: any): Promise; /** * List countries in which numbers are available for purchase. * * @param params - Optional filter / pagination query parameters. * @returns A paginated list of country records with capabilities. * @throws {RestError} On any non-2xx HTTP response. */ listAvailableCountries(params?: QueryParams): Promise; /** * Search for available local phone numbers in a country. * * @param country - ISO-3166 country code (e.g. `"US"`, `"CA"`). * @param params - Search filters (`AreaCode`, `Contains`, `NearNumber`, etc.). * @returns A paginated list of available local numbers. * @throws {RestError} On any non-2xx HTTP response. */ searchLocal(country: string, params?: QueryParams): Promise; /** * Search for available toll-free phone numbers in a country. * * @param country - ISO-3166 country code. * @param params - Search filters (`Contains`, `NearNumber`, etc.). * @returns A paginated list of available toll-free numbers. * @throws {RestError} On any non-2xx HTTP response. */ searchTollFree(country: string, params?: QueryParams): Promise; } /** Compat application management (LAML-style `Applications`). */ export declare class CompatApplications extends CrudResource { constructor(http: HttpClient, basePath: string); /** * Update an application. LAML uses `POST` (not PATCH/PUT). * * @param sid - Application SID (e.g. `"AP..."`). * @param body - LAML-form update payload. Defaults to `{}`. * @returns The updated application record. * @throws {RestError} On any non-2xx HTTP response. */ update(sid: string, body?: any): Promise; } /** Compat cXML / LaML Bin management. */ export declare class CompatLamlBins extends CrudResource { constructor(http: HttpClient, basePath: string); /** * Update a LaML Bin's stored script. LAML uses `POST` (not PATCH/PUT). * * @param sid - LaML Bin SID (e.g. `"LA..."`). * @param body - Payload containing the new `VoiceMethod`, `Url`, etc. * Defaults to `{}`. * @returns The updated LaML Bin record. * @throws {RestError} On any non-2xx HTTP response. */ update(sid: string, body?: any): Promise; } /** Compat queue management with member operations. */ export declare class CompatQueues extends CrudResource { constructor(http: HttpClient, basePath: string); /** * Update a queue. LAML uses `POST` (not PATCH/PUT). * * @param sid - Queue SID (e.g. `"QU..."`). * @param body - LAML-form update payload. Defaults to `{}`. * @returns The updated queue record. * @throws {RestError} On any non-2xx HTTP response. */ update(sid: string, body?: any): Promise; /** * List members (calls) currently waiting in a queue. * * @param queueSid - Queue SID. * @param params - Optional filter / pagination query parameters. * @returns A paginated list of queue members. * @throws {RestError} On any non-2xx HTTP response. */ listMembers(queueSid: string, params?: QueryParams): Promise; /** * Fetch a specific member (by call SID) currently waiting in a queue. * * @param queueSid - Queue SID. * @param callSid - Call SID of the queued member. * @returns The queue-member record. * @throws {RestError} On any non-2xx HTTP response (including `404`). */ getMember(queueSid: string, callSid: string): Promise; /** * Dequeue a member — LAML's `POST` on a queued call redirects it to the * given `Url` (typically to connect the caller to a queue consumer). * * @param queueSid - Queue SID. * @param callSid - Call SID of the queued member. * @param body - LAML-form payload (commonly `{ Url, Method }`). * Defaults to `{}`. * @returns The updated queue-member record. * @throws {RestError} On any non-2xx HTTP response. */ dequeueMember(queueSid: string, callSid: string, body?: any): Promise; } /** Compat recording management (list / get / delete). */ export declare class CompatRecordings extends BaseResource { constructor(http: HttpClient, basePath: string); /** * List recordings in the account. * * @param params - Optional filter / pagination query parameters * (date range, call SID, conference SID, etc.). * @returns A paginated list of recordings. * @throws {RestError} On any non-2xx HTTP response. */ list(params?: QueryParams): Promise; /** * Fetch a recording by SID. * * @param sid - Recording SID (e.g. `"RE..."`). * @returns The recording record. * @throws {RestError} On any non-2xx HTTP response (including `404`). */ get(sid: string): Promise; /** * Delete a recording. * * @param sid - Recording SID. * @returns The platform's delete response. * @throws {RestError} On any non-2xx HTTP response. */ delete(sid: string): Promise; } /** Compat transcription management (list / get / delete). */ export declare class CompatTranscriptions extends BaseResource { constructor(http: HttpClient, basePath: string); /** * List transcriptions in the account. * * @param params - Optional filter / pagination query parameters. * @returns A paginated list of transcriptions. * @throws {RestError} On any non-2xx HTTP response. */ list(params?: QueryParams): Promise; /** * Fetch a transcription by SID. * * @param sid - Transcription SID (e.g. `"TR..."`). * @returns The transcription record. * @throws {RestError} On any non-2xx HTTP response (including `404`). */ get(sid: string): Promise; /** * Delete a transcription. * * @param sid - Transcription SID. * @returns The platform's delete response. * @throws {RestError} On any non-2xx HTTP response. */ delete(sid: string): Promise; } /** Compat API token management (non-LAML — uses `PATCH`). */ export declare class CompatTokens extends BaseResource { constructor(http: HttpClient, basePath: string); /** * Create a new Compat API token. * * @param body - Token payload (friendly name, scopes, etc.). * @returns The newly-created token record, including the secret value. * @throws {RestError} On any non-2xx HTTP response. */ create(body: any): Promise; /** * Update a Compat API token. * * @param tokenId - Unique identifier of the token. * @param body - Partial update payload. Defaults to `{}`. * @returns The updated token record. * @throws {RestError} On any non-2xx HTTP response. */ update(tokenId: string, body?: any): Promise; /** * Revoke and delete a Compat API token. * * @param tokenId - Unique identifier of the token. * @returns The platform's delete response. * @throws {RestError} On any non-2xx HTTP response. */ delete(tokenId: string): Promise; } /** * Twilio-compatible LAML API namespace with AccountSid scoping. * * Access via `client.compat.*`. This is the legacy LAML (cXML) surface for code * migrated from Twilio — all updates use POST bodies instead of REST-idiomatic * PATCH/PUT. Prefer the native SignalWire namespaces (`client.calling`, `client.fabric`, * etc.) for greenfield projects. * * @example Send an SMS via the LAML Messages API * ```ts * await client.compat.messages.create({ * From: '+15551112222', * To: '+15553334444', * Body: 'Hello from SignalWire!', * }); * ``` */ export declare class CompatNamespace { /** Main and sub-account CRUD. */ readonly accounts: CompatAccounts; /** Call CRUD plus recording / stream sub-resource management. */ readonly calls: CompatCalls; /** Message CRUD plus media sub-resource management. */ readonly messages: CompatMessages; /** Fax CRUD plus media sub-resource management. */ readonly faxes: CompatFaxes; /** Conference read / update with participants, recordings, and streams. */ readonly conferences: CompatConferences; /** Phone number CRUD plus search / purchase / import helpers. */ readonly phoneNumbers: CompatPhoneNumbers; /** LAML Application CRUD. */ readonly applications: CompatApplications; /** LaML Bin (hosted script) CRUD. */ readonly lamlBins: CompatLamlBins; /** Queue CRUD plus member list / fetch / dequeue. */ readonly queues: CompatQueues; /** Recording list / fetch / delete. */ readonly recordings: CompatRecordings; /** Transcription list / fetch / delete. */ readonly transcriptions: CompatTranscriptions; /** Compat API token create / update / delete. */ readonly tokens: CompatTokens; constructor(http: HttpClient, accountSid: string); }