import type { components, paths } from '../generated/openapi.js'; import type { RequestOptions } from '../types.js'; import { BaseResource } from './base.js'; /** Full message shape returned by send/get/list/cancel (contract §2.2 fat shape). */ export type Message = components['schemas']['MessageV1']; export type SendMessageBody = NonNullable['content']['application/json']; export type ListMessagesQuery = NonNullable; export type SendReactionBody = components['schemas']['SendReactionRequest']; export type Reaction = components['schemas']['Reaction']; export type ReactionRemoval = components['schemas']['ReactionRemoval']; /** * The tapback kind as it appears on a reaction the API *reports* — the 6 * classic tapbacks plus `custom` (WHA-2102), an arbitrary counterparty emoji. * Strictly wider than `Reaction['type']` / `SendReactionBody['type']`, which * cover only what a customer may *send*. Sourced from the generated * `MessageReactionV1` so a regeneration cannot silently drop `custom`. */ export type ReactionType = components['schemas']['MessageReactionV1']['reaction_type']; export declare class MessagesResource extends BaseResource { /** `POST /v1/messages` — send a new outbound message (queued, returns `MessageV1`). */ send(body: SendMessageBody, opts?: RequestOptions): Promise; /** `GET /v1/messages/{id}` — fetch the full fat-shape message by ID. */ get(id: string, opts?: RequestOptions): Promise; /** * `GET /v1/messages` — cursor-paginated list as an AsyncIterable. The * iterator threads the next_cursor across pages so the consumer can * `for await (const m of client.messages.list({...}))` and get every * matching message. Items use the fat `Message` shape — same fields as * `send()` / `get()` (contract §2.2). */ list(filters?: Omit, opts?: RequestOptions): AsyncIterable; /** * `POST /v1/messages/{id}/reactions` — add an Apple-native tapback * (love / like / dislike / laugh / emphasize / question). Replace-on-add * semantics: posting a different `type` against the same parent updates * the existing reaction in place. Reactions require iMessage; SMS / RCS * parents are rejected with 422. */ addReaction(messageId: string, body: SendReactionBody, opts?: RequestOptions): Promise; /** * `DELETE /v1/messages/{id}/reactions` — remove the active tapback on a * message. Idempotent: returns 200 with `removed: false` when there * was nothing to remove (no 404), so partners can fire-and-forget. The * response carries the `type` that was removed when applicable — handy * for UI feedback ("removed your 'love'"). */ removeReaction(messageId: string, opts?: RequestOptions): Promise; /** * `DELETE /v1/messages/{id}` — cancel a queued or scheduled message before * it dispatches. Once `status: sent` the cancel is a 409. */ cancel(id: string, opts?: RequestOptions): Promise; } //# sourceMappingURL=messages.d.ts.map