@linqapp/sdk 0.32.1 → 0.33.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (203) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/README.md +82 -112
  3. package/client.d.mts +42 -6
  4. package/client.d.mts.map +1 -1
  5. package/client.d.ts +42 -6
  6. package/client.d.ts.map +1 -1
  7. package/client.js +39 -3
  8. package/client.js.map +1 -1
  9. package/client.mjs +39 -3
  10. package/client.mjs.map +1 -1
  11. package/core/error.d.mts +13 -0
  12. package/core/error.d.mts.map +1 -1
  13. package/core/error.d.ts +13 -0
  14. package/core/error.d.ts.map +1 -1
  15. package/core/error.js +5 -1
  16. package/core/error.js.map +1 -1
  17. package/core/error.mjs +5 -1
  18. package/core/error.mjs.map +1 -1
  19. package/package.json +1 -1
  20. package/resources/available-number.d.mts +13 -1
  21. package/resources/available-number.d.mts.map +1 -1
  22. package/resources/available-number.d.ts +13 -1
  23. package/resources/available-number.d.ts.map +1 -1
  24. package/resources/available-number.js +2 -1
  25. package/resources/available-number.js.map +1 -1
  26. package/resources/available-number.mjs +2 -1
  27. package/resources/available-number.mjs.map +1 -1
  28. package/resources/chats/chats.d.mts +175 -70
  29. package/resources/chats/chats.d.mts.map +1 -1
  30. package/resources/chats/chats.d.ts +175 -70
  31. package/resources/chats/chats.d.ts.map +1 -1
  32. package/resources/chats/chats.js +65 -61
  33. package/resources/chats/chats.js.map +1 -1
  34. package/resources/chats/chats.mjs +65 -61
  35. package/resources/chats/chats.mjs.map +1 -1
  36. package/resources/chats/index.d.mts +3 -2
  37. package/resources/chats/index.d.mts.map +1 -1
  38. package/resources/chats/index.d.ts +3 -2
  39. package/resources/chats/index.d.ts.map +1 -1
  40. package/resources/chats/index.js +3 -1
  41. package/resources/chats/index.js.map +1 -1
  42. package/resources/chats/index.mjs +1 -0
  43. package/resources/chats/index.mjs.map +1 -1
  44. package/resources/chats/location.d.mts +25 -25
  45. package/resources/chats/location.d.mts.map +1 -1
  46. package/resources/chats/location.d.ts +25 -25
  47. package/resources/chats/location.d.ts.map +1 -1
  48. package/resources/chats/location.js +27 -27
  49. package/resources/chats/location.js.map +1 -1
  50. package/resources/chats/location.mjs +27 -27
  51. package/resources/chats/location.mjs.map +1 -1
  52. package/resources/chats/messages.d.mts +28 -21
  53. package/resources/chats/messages.d.mts.map +1 -1
  54. package/resources/chats/messages.d.ts +28 -21
  55. package/resources/chats/messages.d.ts.map +1 -1
  56. package/resources/chats/messages.js +16 -16
  57. package/resources/chats/messages.js.map +1 -1
  58. package/resources/chats/messages.mjs +16 -16
  59. package/resources/chats/messages.mjs.map +1 -1
  60. package/resources/chats/polls.d.mts +171 -0
  61. package/resources/chats/polls.d.mts.map +1 -0
  62. package/resources/chats/polls.d.ts +171 -0
  63. package/resources/chats/polls.d.ts.map +1 -0
  64. package/resources/chats/polls.js +95 -0
  65. package/resources/chats/polls.js.map +1 -0
  66. package/resources/chats/polls.mjs +91 -0
  67. package/resources/chats/polls.mjs.map +1 -0
  68. package/resources/contact-card.d.mts +29 -28
  69. package/resources/contact-card.d.mts.map +1 -1
  70. package/resources/contact-card.d.ts +29 -28
  71. package/resources/contact-card.d.ts.map +1 -1
  72. package/resources/contact-card.js +23 -22
  73. package/resources/contact-card.js.map +1 -1
  74. package/resources/contact-card.mjs +23 -22
  75. package/resources/contact-card.mjs.map +1 -1
  76. package/resources/experiences.d.mts +91 -0
  77. package/resources/experiences.d.mts.map +1 -0
  78. package/resources/experiences.d.ts +91 -0
  79. package/resources/experiences.d.ts.map +1 -0
  80. package/resources/experiences.js +29 -0
  81. package/resources/experiences.js.map +1 -0
  82. package/resources/experiences.mjs +25 -0
  83. package/resources/experiences.mjs.map +1 -0
  84. package/resources/index.d.mts +7 -3
  85. package/resources/index.d.mts.map +1 -1
  86. package/resources/index.d.ts +7 -3
  87. package/resources/index.d.ts.map +1 -1
  88. package/resources/index.js +10 -2
  89. package/resources/index.js.map +1 -1
  90. package/resources/index.mjs +5 -1
  91. package/resources/index.mjs.map +1 -1
  92. package/resources/messages/index.d.mts +3 -0
  93. package/resources/messages/index.d.mts.map +1 -0
  94. package/resources/messages/index.d.ts +3 -0
  95. package/resources/messages/index.d.ts.map +1 -0
  96. package/resources/messages/index.js +9 -0
  97. package/resources/messages/index.js.map +1 -0
  98. package/resources/messages/index.mjs +4 -0
  99. package/resources/messages/index.mjs.map +1 -0
  100. package/resources/messages/messages.d.mts +795 -0
  101. package/resources/messages/messages.d.mts.map +1 -0
  102. package/resources/messages/messages.d.ts +795 -0
  103. package/resources/messages/messages.d.ts.map +1 -0
  104. package/resources/messages/messages.js +298 -0
  105. package/resources/messages/messages.js.map +1 -0
  106. package/resources/messages/messages.mjs +293 -0
  107. package/resources/messages/messages.mjs.map +1 -0
  108. package/resources/messages/poll.d.mts +131 -0
  109. package/resources/messages/poll.d.mts.map +1 -0
  110. package/resources/messages/poll.d.ts +131 -0
  111. package/resources/messages/poll.d.ts.map +1 -0
  112. package/resources/messages/poll.js +119 -0
  113. package/resources/messages/poll.js.map +1 -0
  114. package/resources/messages/poll.mjs +115 -0
  115. package/resources/messages/poll.mjs.map +1 -0
  116. package/resources/messages.d.mts +1 -747
  117. package/resources/messages.d.mts.map +1 -1
  118. package/resources/messages.d.ts +1 -747
  119. package/resources/messages.d.ts.map +1 -1
  120. package/resources/messages.js +2 -275
  121. package/resources/messages.js.map +1 -1
  122. package/resources/messages.mjs +1 -273
  123. package/resources/messages.mjs.map +1 -1
  124. package/resources/payment-handles.d.mts +87 -0
  125. package/resources/payment-handles.d.mts.map +1 -0
  126. package/resources/payment-handles.d.ts +87 -0
  127. package/resources/payment-handles.d.ts.map +1 -0
  128. package/resources/payment-handles.js +76 -0
  129. package/resources/payment-handles.js.map +1 -0
  130. package/resources/payment-handles.mjs +72 -0
  131. package/resources/payment-handles.mjs.map +1 -0
  132. package/resources/payment-providers.d.mts +58 -0
  133. package/resources/payment-providers.d.mts.map +1 -0
  134. package/resources/payment-providers.d.ts +58 -0
  135. package/resources/payment-providers.d.ts.map +1 -0
  136. package/resources/payment-providers.js +45 -0
  137. package/resources/payment-providers.js.map +1 -0
  138. package/resources/payment-providers.mjs +41 -0
  139. package/resources/payment-providers.mjs.map +1 -0
  140. package/resources/payment-requests.d.mts +2 -2
  141. package/resources/payment-requests.d.ts +2 -2
  142. package/resources/payment-requests.js +2 -2
  143. package/resources/payment-requests.mjs +2 -2
  144. package/resources/payments.d.mts +116 -0
  145. package/resources/payments.d.mts.map +1 -0
  146. package/resources/payments.d.ts +116 -0
  147. package/resources/payments.d.ts.map +1 -0
  148. package/resources/payments.js +70 -0
  149. package/resources/payments.js.map +1 -0
  150. package/resources/payments.mjs +66 -0
  151. package/resources/payments.mjs.map +1 -0
  152. package/resources/phone-numbers.d.mts +11 -11
  153. package/resources/phone-numbers.d.mts.map +1 -1
  154. package/resources/phone-numbers.d.ts +11 -11
  155. package/resources/phone-numbers.d.ts.map +1 -1
  156. package/resources/phone-numbers.js +13 -13
  157. package/resources/phone-numbers.js.map +1 -1
  158. package/resources/phone-numbers.mjs +13 -13
  159. package/resources/phone-numbers.mjs.map +1 -1
  160. package/resources/webhook-events.d.mts +1 -1
  161. package/resources/webhook-events.d.mts.map +1 -1
  162. package/resources/webhook-events.d.ts +1 -1
  163. package/resources/webhook-events.d.ts.map +1 -1
  164. package/resources/webhook-subscriptions.d.mts +11 -11
  165. package/resources/webhook-subscriptions.d.mts.map +1 -1
  166. package/resources/webhook-subscriptions.d.ts +11 -11
  167. package/resources/webhook-subscriptions.d.ts.map +1 -1
  168. package/resources/webhook-subscriptions.js +13 -13
  169. package/resources/webhook-subscriptions.js.map +1 -1
  170. package/resources/webhook-subscriptions.mjs +13 -13
  171. package/resources/webhook-subscriptions.mjs.map +1 -1
  172. package/resources/webhooks.d.mts +72 -1
  173. package/resources/webhooks.d.mts.map +1 -1
  174. package/resources/webhooks.d.ts +72 -1
  175. package/resources/webhooks.d.ts.map +1 -1
  176. package/src/client.ts +91 -20
  177. package/src/core/error.ts +20 -1
  178. package/src/resources/available-number.ts +14 -1
  179. package/src/resources/chats/chats.ts +203 -85
  180. package/src/resources/chats/index.ts +3 -2
  181. package/src/resources/chats/location.ts +28 -28
  182. package/src/resources/chats/messages.ts +40 -32
  183. package/src/resources/chats/polls.ts +196 -0
  184. package/src/resources/contact-card.ts +36 -35
  185. package/src/resources/experiences.ts +118 -0
  186. package/src/resources/index.ts +23 -5
  187. package/src/resources/messages/index.ts +18 -0
  188. package/src/resources/messages/messages.ts +958 -0
  189. package/src/resources/messages/poll.ts +151 -0
  190. package/src/resources/messages.ts +1 -894
  191. package/src/resources/payment-handles.ts +114 -0
  192. package/src/resources/payment-providers.ts +81 -0
  193. package/src/resources/payment-requests.ts +2 -2
  194. package/src/resources/payments.ts +163 -0
  195. package/src/resources/phone-numbers.ts +14 -14
  196. package/src/resources/webhook-events.ts +9 -0
  197. package/src/resources/webhook-subscriptions.ts +14 -14
  198. package/src/resources/webhooks.ts +82 -0
  199. package/src/version.ts +1 -1
  200. package/version.d.mts +1 -1
  201. package/version.d.ts +1 -1
  202. package/version.js +1 -1
  203. package/version.mjs +1 -1
@@ -1,748 +1,2 @@
1
- import { APIResource } from "../core/resource.js";
2
- import * as Shared from "./shared.js";
3
- import * as ChatsAPI from "./chats/chats.js";
4
- import * as ChatsMessagesAPI from "./chats/messages.js";
5
- import { APIPromise } from "../core/api-promise.js";
6
- import { ListMessagesPagination, type ListMessagesPaginationParams, PagePromise } from "../core/pagination.js";
7
- import { RequestOptions } from "../internal/request-options.js";
8
- /**
9
- * Messages are individual communications within a chat thread.
10
- *
11
- * Messages can include text, media attachments, rich link previews, special effects
12
- * (like confetti or fireworks), and reactions. All messages are associated with a
13
- * specific chat and sent from a phone number you own.
14
- *
15
- * Messages support delivery status tracking, read receipts, and editing capabilities.
16
- *
17
- * ## Rich Link Previews
18
- *
19
- * Send a URL as a `link` part to deliver it with a rich preview card showing the
20
- * page's title, description, and image (when available). A `link` part must be the
21
- * **only** part in the message — it cannot be combined with text or media parts.
22
- * To send a URL without a preview card, include it in a `text` part instead.
23
- *
24
- * **Limitations:**
25
- * - A `link` part cannot be combined with other parts in the same message.
26
- * - Maximum URL length: 2,048 characters.
27
- *
28
- * ## Ephemeral Messages (Privacy Tier)
29
- *
30
- * For regulated or sensitive conversations, opt in to the **ephemeral messages** tier by contacting your Linq support contact. When enabled, every message on the covered phone numbers is automatically given a fixed **24-hour retention window** — after that window the platform permanently deletes the message from Linq storage. There is no per-message flag; ephemerality is applied automatically based on your configuration.
31
- *
32
- * You can request it at two scopes:
33
- *
34
- * | Scope | Effect |
35
- * |---|---|
36
- * | **Partner-wide** | Every outbound and inbound message on every phone number under your account is retained for 24 hours, then deleted. |
37
- * | **Per phone number** | Only the specified phone numbers have their messages auto-deleted. The rest follow the standard message-retention policy. |
38
- *
39
- * **Behavioral differences vs the standard default:**
40
- *
41
- * | Aspect | Standard | Ephemeral |
42
- * |---|---|---|
43
- * | Retention | Retained per the standard message-retention policy | **Hard backstop: 24 hours** from when the message is created |
44
- * | After expiry | Message stays retrievable | Message is permanently deleted — `GET /v3/messages/{messageId}` returns `404` and it no longer appears in `GET /v3/chats/{chatId}/messages` |
45
- * | Content on expiry | N/A | Text, formatting, and attachment references are scrubbed; the message is gone, not blanked out |
46
- * | Cross-partner isolation | Enforced | Enforced |
47
- *
48
- * **How the 24-hour window works:**
49
- *
50
- * - The window is fixed at **24 hours from message creation** (`created_at`) and cannot be configured per message.
51
- * - It mirrors the ephemeral *attachments* 1-day backstop, so a message and any media it carries expire together.
52
- * - Expiry is delivery-independent — the clock starts when the message is created, not when it is delivered or read.
53
- *
54
- * **What you observe:**
55
- *
56
- * - **No expiry timestamp is exposed.** API responses and webhook payloads do not include the deletion time. If you need it, compute `created_at + 24h` yourself.
57
- * - **No deletion webhook is sent.** There is no `message.deleted` event — a message simply stops being retrievable once its window passes.
58
- * - **Delivery is unaffected.** Ephemeral messages send, deliver, and fire the usual `message.sent` / `message.received` and status webhooks exactly like standard messages. Only retention changes.
59
- *
60
- * **When to choose ephemeral:**
61
- *
62
- * - You have a compliance requirement that the platform must not retain message content beyond a short window.
63
- * - The conversation is high-sensitivity (PHI, financial, identity verification) and you do not want it sitting in storage long-term.
64
- * - Your application is the system of record — you capture what you need from the delivery webhook in real time and do not rely on reading message history back from Linq later.
65
- *
66
- * **Important:** ephemeral applies in *both directions* — messages you send **and** messages received by the phone numbers in that scope. Because Linq can no longer return the message after 24 hours, persist anything you need to keep from the webhook payload at the time it is delivered.
67
- */
68
- export declare class Messages extends APIResource {
69
- /**
70
- * Send a message to one or more recipients **without supplying a `from` number**.
71
- * Linq resolves both the sending line and the target chat for you, then returns
72
- * exactly which line was used, which chat the message landed in, whether a new
73
- * chat was created, and every resulting message id.
74
- *
75
- * This fuses "create chat" and "send message" behind a single message-centric
76
- * resource. Provide only the recipients (`to`) and the `message`; the platform
77
- * decides the rest.
78
- *
79
- * ## How the from-number and chat are chosen
80
- *
81
- * - **Reuse** — if a chat with exactly these recipients already exists on a line
82
- * that can still send, the message is sent into that chat on its existing line
83
- * (`from_selection.reason = reused_active_chat`). The most-recently-active such
84
- * chat wins; chats stranded on flagged lines (e.g. by an earlier failover) are
85
- * skipped.
86
- * - **New** — if no such chat exists, a new chat is created on the best available
87
- * line (`from_selection.reason = new_best_number`).
88
- * - **Failover** — if matching chats exist but none is on a line that can send, a
89
- * **new** chat is created on a fresh best line and the flagged chat is abandoned
90
- * (`from_selection.reason = failover_flagged`, `previous_chat_id` set). If you
91
- * supply `continuation_message`, that text is sent as the single message INSTEAD
92
- * of `message` (useful as a fresh-number-appropriate opener). Exactly one
93
- * message is sent either way.
94
- *
95
- * Recipients (`to`) are an order-independent set: a single handle is a direct
96
- * chat, multiple handles a group chat.
97
- *
98
- * ## Differences from POST /v3/chats
99
- *
100
- * - The first message **may contain a link** (including for a newly created chat).
101
- * Note: sending a link as the very first message on a freshly selected line can
102
- * elevate that line's flagging risk — it is allowed, not recommended.
103
- * - Voice memos are **not** supported here. To send an iMessage voice-memo bubble,
104
- * use `POST /v3/chats/{chatId}/voicememo` with a known chat id.
105
- *
106
- * ## Service preference, effects, decorations
107
- *
108
- * Set `message.preferred_service` (`iMessage` | `RCS` | `SMS`), `message.effect`,
109
- * and per-part `text_decorations` exactly as on the other send endpoints.
110
- *
111
- * Always responds `202 Accepted` — chat creation is incidental to the send.
112
- *
113
- * @example
114
- * ```ts
115
- * const message = await client.messages.create({
116
- * message: {
117
- * parts: [
118
- * {
119
- * type: 'text',
120
- * value:
121
- * 'Hi! Thanks for reaching out — how can we help?',
122
- * },
123
- * ],
124
- * },
125
- * to: ['+14155559876'],
126
- * });
127
- * ```
128
- */
129
- create(params: MessageCreateParams, options?: RequestOptions): APIPromise<MessageCreateResponse>;
130
- /**
131
- * Retrieve all messages in a conversation thread. Given any message ID in the
132
- * thread, returns the originator message and all replies in chronological order.
133
- *
134
- * If the message is not part of a thread, returns just that single message.
135
- *
136
- * Supports pagination and configurable ordering.
137
- *
138
- * @example
139
- * ```ts
140
- * // Automatically fetches more pages as needed.
141
- * for await (const message of client.messages.listMessagesThread(
142
- * '69a37c7d-af4f-4b5e-af42-e28e98ce873a',
143
- * )) {
144
- * // ...
145
- * }
146
- * ```
147
- */
148
- listMessagesThread(messageID: string, query?: MessageListMessagesThreadParams | null | undefined, options?: RequestOptions): PagePromise<MessagesListMessagesPagination, Message>;
149
- /**
150
- * Retrieve a specific message by its ID. This endpoint returns the full message
151
- * details including text, attachments, reactions, and metadata.
152
- *
153
- * @example
154
- * ```ts
155
- * const message = await client.messages.retrieve(
156
- * '69a37c7d-af4f-4b5e-af42-e28e98ce873a',
157
- * );
158
- * ```
159
- */
160
- retrieve(messageID: string, options?: RequestOptions): APIPromise<Message>;
161
- /**
162
- * Deletes a message from the Linq API only. This does NOT unsend or remove the
163
- * message from the actual chat — recipients will still see the message.
164
- *
165
- * @example
166
- * ```ts
167
- * await client.messages.delete(
168
- * '69a37c7d-af4f-4b5e-af42-e28e98ce873a',
169
- * );
170
- * ```
171
- */
172
- delete(messageID: string, options?: RequestOptions): APIPromise<void>;
173
- /**
174
- * Add or remove emoji reactions to messages. Reactions let users express their
175
- * response to a message without sending a new message.
176
- *
177
- * **Supported Reactions:**
178
- *
179
- * - love ❤️
180
- * - like 👍
181
- * - dislike 👎
182
- * - laugh 😂
183
- * - emphasize ‼️
184
- * - question ❓
185
- * - custom - any emoji (use `custom_emoji` field to specify)
186
- *
187
- * @example
188
- * ```ts
189
- * const response = await client.messages.addReaction(
190
- * '69a37c7d-af4f-4b5e-af42-e28e98ce873a',
191
- * { operation: 'add', type: 'love' },
192
- * );
193
- * ```
194
- */
195
- addReaction(messageID: string, body: MessageAddReactionParams, options?: RequestOptions): APIPromise<MessageAddReactionResponse>;
196
- /**
197
- * Edit the text content of a specific part of a previously sent message.
198
- *
199
- * **Note:** A message can be edited up to 5 times, and only within 15 minutes of
200
- * when it was originally sent.
201
- *
202
- * @example
203
- * ```ts
204
- * const message = await client.messages.update(
205
- * '69a37c7d-af4f-4b5e-af42-e28e98ce873a',
206
- * { text: 'This is the edited message content' },
207
- * );
208
- * ```
209
- */
210
- update(messageID: string, body: MessageUpdateParams, options?: RequestOptions): APIPromise<Message>;
211
- /**
212
- * Replaces a previously delivered `imessage_app` card on the recipient's screen
213
- * with new content, instead of posting a new bubble (like a game move redrawing
214
- * the board).
215
- *
216
- * The update is delivered as a **new message** with its own id and delivery
217
- * lifecycle (`message.sent` / `message.delivered` / `message.failed` webhooks fire
218
- * for the new id). To update the card again, reference the message id returned by
219
- * this call.
220
- *
221
- * Constraints:
222
- *
223
- * - The referenced message must be an `imessage_app` card sent by you (`400`
224
- * otherwise — inbound cards cannot be updated).
225
- * - The referenced card must already be delivered (`409` otherwise — retry after
226
- * the `message.delivered` webhook for it).
227
- * - The app identity (`team_id`, `bundle_id`, name) is inherited from the original
228
- * card and cannot change; only `url`, `fallback_text`, and `layout` are
229
- * replaced.
230
- * - iMessage-only, like all app cards.
231
- * - Concurrent updates against the same card are not serialized server-side; the
232
- * last one delivered wins on the recipient's screen. Serialize updates by always
233
- * referencing the message id returned by the previous call.
234
- *
235
- * @example
236
- * ```ts
237
- * const response = await client.messages.updateAppCard(
238
- * '69a37c7d-af4f-4b5e-af42-e28e98ce873a',
239
- * {
240
- * layout: { caption: 'Score: 2 – 1' },
241
- * fallback_text: 'Score update',
242
- * url: 'https://app.example.com/card?game=7f3a&move=2',
243
- * },
244
- * );
245
- * ```
246
- */
247
- updateAppCard(messageID: string, body: MessageUpdateAppCardParams, options?: RequestOptions): APIPromise<MessageUpdateAppCardResponse>;
248
- }
249
- export type MessagesListMessagesPagination = ListMessagesPagination<Message>;
250
- export interface Message {
251
- /**
252
- * Unique identifier for the message
253
- */
254
- id: string;
255
- /**
256
- * ID of the chat this message belongs to
257
- */
258
- chat_id: string;
259
- /**
260
- * When the message was created
261
- */
262
- created_at: string;
263
- /**
264
- * Current delivery status of a message
265
- */
266
- delivery_status: 'pending' | 'queued' | 'sent' | 'delivered' | 'received' | 'read' | 'failed';
267
- /**
268
- * @deprecated DEPRECATED: Use `delivery_status` instead (true when
269
- * `delivery_status` is `delivered` or `read`). Whether the message has been
270
- * delivered.
271
- */
272
- is_delivered: boolean;
273
- /**
274
- * Whether this message was sent by the authenticated user
275
- */
276
- is_from_me: boolean;
277
- /**
278
- * @deprecated DEPRECATED: Use `delivery_status == "read"` instead. Whether the
279
- * message has been read.
280
- */
281
- is_read: boolean;
282
- /**
283
- * When the message was last updated
284
- */
285
- updated_at: string;
286
- /**
287
- * When the message was delivered
288
- */
289
- delivered_at?: string | null;
290
- /**
291
- * iMessage effect applied to a message (screen or bubble effect)
292
- */
293
- effect?: MessageEffect | null;
294
- /**
295
- * @deprecated DEPRECATED: Use from_handle instead. Phone number of the message
296
- * sender.
297
- */
298
- from?: string | null;
299
- /**
300
- * The sender of this message as a full handle object
301
- */
302
- from_handle?: Shared.ChatHandle | null;
303
- /**
304
- * Message parts in order (text, media, and link)
305
- */
306
- parts?: Array<Shared.TextPartResponse | Shared.MediaPartResponse | Shared.LinkPartResponse | Message.IMessageAppPartResponse> | null;
307
- /**
308
- * Messaging service type
309
- */
310
- preferred_service?: Shared.ServiceType | null;
311
- /**
312
- * When the message was read
313
- */
314
- read_at?: string | null;
315
- /**
316
- * Indicates this message is a threaded reply to another message
317
- */
318
- reply_to?: ReplyTo | null;
319
- /**
320
- * When the message was sent
321
- */
322
- sent_at?: string | null;
323
- /**
324
- * Messaging service type
325
- */
326
- service?: Shared.ServiceType | null;
327
- }
328
- export declare namespace Message {
329
- /**
330
- * An iMessage app card part.
331
- */
332
- interface IMessageAppPartResponse {
333
- /**
334
- * Identifies the iMessage app (Messages app extension) that backs the card.
335
- */
336
- app: IMessageAppPartResponse.App;
337
- /**
338
- * Visible layout of the card. At least one of `caption`, `subcaption`,
339
- * `trailing_caption`, `trailing_subcaption`, or `image_url` must be set, otherwise
340
- * the card renders as an empty bubble.
341
- *
342
- * `image_url` displays a preview image at the top of the card. The image renders
343
- * on the recipient's card whether or not they have your app installed. The small
344
- * icon beside the caption is the app's own icon and is not settable here.
345
- *
346
- * `* Note - requires a trusted chat w/ inbound activity`
347
- *
348
- * `image_title` and `image_subtitle` render as text overlaid on the image (title
349
- * bold, subtitle beneath it). They only appear when `image_url` is set — without
350
- * an image there is nothing to overlay — so setting either without `image_url` is
351
- * rejected.
352
- */
353
- layout: IMessageAppPartResponse.Layout;
354
- /**
355
- * Reactions on this message part
356
- */
357
- reactions: Array<Shared.Reaction> | null;
358
- /**
359
- * Indicates this is an iMessage app card part.
360
- */
361
- type: 'imessage_app';
362
- /**
363
- * The URL delivered to the iMessage app on tap.
364
- */
365
- url: string;
366
- /**
367
- * Fallback text for surfaces that cannot render the card.
368
- */
369
- fallback_text?: string | null;
370
- }
371
- namespace IMessageAppPartResponse {
372
- /**
373
- * Identifies the iMessage app (Messages app extension) that backs the card.
374
- */
375
- interface App {
376
- /**
377
- * Bundle identifier of the Messages app extension. Must not contain `:`.
378
- */
379
- bundle_id: string;
380
- /**
381
- * Display name of the app, shown by Messages' fallback UI.
382
- */
383
- name: string;
384
- /**
385
- * The app's 10-character uppercase alphanumeric team identifier.
386
- */
387
- team_id: string;
388
- /**
389
- * The owning app's App Store id (optional). When set, recipients without the
390
- * iMessage app installed see a "Get the app" affordance.
391
- */
392
- app_store_id?: number;
393
- }
394
- /**
395
- * Visible layout of the card. At least one of `caption`, `subcaption`,
396
- * `trailing_caption`, `trailing_subcaption`, or `image_url` must be set, otherwise
397
- * the card renders as an empty bubble.
398
- *
399
- * `image_url` displays a preview image at the top of the card. The image renders
400
- * on the recipient's card whether or not they have your app installed. The small
401
- * icon beside the caption is the app's own icon and is not settable here.
402
- *
403
- * `* Note - requires a trusted chat w/ inbound activity`
404
- *
405
- * `image_title` and `image_subtitle` render as text overlaid on the image (title
406
- * bold, subtitle beneath it). They only appear when `image_url` is set — without
407
- * an image there is nothing to overlay — so setting either without `image_url` is
408
- * rejected.
409
- */
410
- interface Layout {
411
- /**
412
- * Primary label, top-left and bold.
413
- */
414
- caption?: string;
415
- /**
416
- * Text shown below `image_title`, overlaid on the card image. Requires
417
- * `image_url`.
418
- */
419
- image_subtitle?: string;
420
- /**
421
- * Bold text overlaid on the card image. Requires `image_url` (rejected without
422
- * it).
423
- */
424
- image_title?: string;
425
- /**
426
- * URL of an image (JPEG, PNG, HEIF, or WebP) to display as the card's preview
427
- * image; an unreachable or non-image URL returns a validation error. Renders for
428
- * all recipients regardless of whether they have the app. Note - requires a
429
- * trusted chat w/ inbound activity. In responses, this is the re-hosted
430
- * `cdn.linqapp.com` copy of the image you supplied, not your original URL.
431
- */
432
- image_url?: string;
433
- /**
434
- * Secondary label, below `caption` on the left.
435
- */
436
- subcaption?: string;
437
- /**
438
- * Label shown top-right.
439
- */
440
- trailing_caption?: string;
441
- /**
442
- * Label shown below `trailing_caption`, on the right.
443
- */
444
- trailing_subcaption?: string;
445
- }
446
- }
447
- }
448
- /**
449
- * iMessage effect applied to a message (screen or bubble effect)
450
- */
451
- export interface MessageEffect {
452
- /**
453
- * Name of the effect. Common values:
454
- *
455
- * - Screen effects: confetti, fireworks, lasers, sparkles, celebration, hearts,
456
- * love, balloons, happy_birthday, echo, spotlight
457
- * - Bubble effects: slam, loud, gentle, invisible
458
- */
459
- name?: string;
460
- /**
461
- * Type of effect
462
- */
463
- type?: 'screen' | 'bubble';
464
- }
465
- /**
466
- * Indicates this message is a threaded reply to another message
467
- */
468
- export interface ReplyTo {
469
- /**
470
- * The ID of the message to reply to
471
- */
472
- message_id: string;
473
- /**
474
- * The specific message part to reply to (0-based index). Defaults to 0 (first
475
- * part) if not provided. Use this when replying to a specific part of a multipart
476
- * message.
477
- */
478
- part_index?: number;
479
- }
480
- /**
481
- * Result of an auto-from send. Self-describing: which line was used, which chat
482
- * the message landed in, whether a new chat was created, and the resulting message
483
- * id(s).
484
- */
485
- export interface MessageCreateResponse {
486
- /**
487
- * The resolved chat (reused or newly created) the message landed in.
488
- */
489
- chat_id: string;
490
- /**
491
- * True when a new chat was created (new or failover), false on reuse.
492
- */
493
- created_new_chat: boolean;
494
- /**
495
- * The line (E.164) the message was actually sent from.
496
- */
497
- from: string;
498
- /**
499
- * Why this line/chat was chosen.
500
- */
501
- from_selection: MessageCreateResponse.FromSelection;
502
- /**
503
- * Participants of the resolved chat.
504
- */
505
- handles: Array<Shared.ChatHandle>;
506
- /**
507
- * Whether the resolved chat is a group chat.
508
- */
509
- is_group: boolean;
510
- /**
511
- * A message that was sent (used in CreateChat and SendMessage responses)
512
- */
513
- message: ChatsMessagesAPI.SentMessage;
514
- /**
515
- * Messaging service type
516
- */
517
- service: Shared.ServiceType;
518
- /**
519
- * Set ONLY on `failover_flagged`: the abandoned flagged chat that was NOT sent
520
- * into. Null otherwise.
521
- */
522
- previous_chat_id?: string | null;
523
- }
524
- export declare namespace MessageCreateResponse {
525
- /**
526
- * Why this line/chat was chosen.
527
- */
528
- interface FromSelection {
529
- /**
530
- * - `reused_active_chat` — reused an existing chat on its healthy line
531
- * - `new_best_number` — created a new chat on the best available line
532
- * - `failover_flagged` — no existing chat for these recipients was on a line that
533
- * could send; created a new chat on a fresh line
534
- */
535
- reason: 'reused_active_chat' | 'new_best_number' | 'failover_flagged';
536
- /**
537
- * True only when an existing chat was reused.
538
- */
539
- reused_existing_chat: boolean;
540
- }
541
- }
542
- export interface MessageAddReactionResponse {
543
- message?: string;
544
- status?: string;
545
- trace_id?: string;
546
- }
547
- /**
548
- * Response for sending a message to a chat
549
- */
550
- export interface MessageUpdateAppCardResponse {
551
- /**
552
- * Unique identifier of the chat this message was sent to
553
- */
554
- chat_id: string;
555
- /**
556
- * A message that was sent (used in CreateChat and SendMessage responses)
557
- */
558
- message: ChatsMessagesAPI.SentMessage;
559
- }
560
- export interface MessageCreateParams {
561
- /**
562
- * Body param: Message content container. Groups all message-related fields
563
- * together, separating the "what" (message content) from the "where" (routing
564
- * fields like from/to).
565
- *
566
- * A message carries EITHER `parts` — text and attachments, which compose into one
567
- * bubble — or a single `action`, which invokes an experience inside Linq's
568
- * iMessage app. Never both: an app card is the whole message (Apple's `MSMessage`
569
- * cannot coexist with text), so copy and a card are two sends, not one.
570
- */
571
- message: ChatsAPI.MessageContent;
572
- /**
573
- * Body param: Recipient handles (E.164 phone numbers or email addresses). One
574
- * handle is a direct chat; multiple handles a group chat. Order-independent — the
575
- * set identifies the chat.
576
- */
577
- to: Array<string>;
578
- /**
579
- * Body param: Text-only fallback that **replaces** `message` ONLY on the failover
580
- * branch — when a chat with these recipients already existed but its line was
581
- * flagged, so a new chat is created on a fresh line. On that branch this text is
582
- * sent as the single message instead of `message` (the recipient is on a new
583
- * number, so you typically want a fresh-number-appropriate opener rather than the
584
- * original content). Ignored otherwise (a healthy reuse, or genuine first
585
- * contact). Carries no parts, media, or effects — exactly one message is ever
586
- * sent.
587
- */
588
- continuation_message?: MessageCreateParams.ContinuationMessage;
589
- /**
590
- * Header param: Optional idempotency key for the send. Reuse the same key to
591
- * safely retry without sending twice. May also be supplied as
592
- * `message.idempotency_key`.
593
- */
594
- 'Idempotency-Key'?: string;
595
- }
596
- export declare namespace MessageCreateParams {
597
- /**
598
- * Text-only fallback that **replaces** `message` ONLY on the failover branch —
599
- * when a chat with these recipients already existed but its line was flagged, so a
600
- * new chat is created on a fresh line. On that branch this text is sent as the
601
- * single message instead of `message` (the recipient is on a new number, so you
602
- * typically want a fresh-number-appropriate opener rather than the original
603
- * content). Ignored otherwise (a healthy reuse, or genuine first contact). Carries
604
- * no parts, media, or effects — exactly one message is ever sent.
605
- */
606
- interface ContinuationMessage {
607
- /**
608
- * The replacement message text, sent as the single message on failover.
609
- */
610
- text: string;
611
- }
612
- }
613
- export interface MessageListMessagesThreadParams extends ListMessagesPaginationParams {
614
- /**
615
- * Sort order for messages (asc = oldest first, desc = newest first)
616
- */
617
- order?: 'asc' | 'desc';
618
- }
619
- export interface MessageAddReactionParams {
620
- /**
621
- * Whether to add or remove the reaction
622
- */
623
- operation: 'add' | 'remove';
624
- /**
625
- * Type of reaction. Standard iMessage tapbacks are love, like, dislike, laugh,
626
- * emphasize, question. Custom emoji reactions have type "custom" with the actual
627
- * emoji in the custom_emoji field. Sticker reactions have type "sticker" with
628
- * sticker attachment details in the sticker field.
629
- */
630
- type: Shared.ReactionType;
631
- /**
632
- * Custom emoji string. Required when type is "custom".
633
- */
634
- custom_emoji?: string;
635
- /**
636
- * Optional index of the message part to react to. If not provided, reacts to the
637
- * entire message (part 0).
638
- */
639
- part_index?: number;
640
- }
641
- export interface MessageUpdateParams {
642
- /**
643
- * New text content for the message part
644
- */
645
- text: string;
646
- /**
647
- * Index of the message part to edit. Defaults to 0.
648
- */
649
- part_index?: number;
650
- }
651
- export interface MessageUpdateAppCardParams {
652
- /**
653
- * Visible layout of the card. At least one of `caption`, `subcaption`,
654
- * `trailing_caption`, `trailing_subcaption`, or `image_url` must be set, otherwise
655
- * the card renders as an empty bubble.
656
- *
657
- * `image_url` displays a preview image at the top of the card. The image renders
658
- * on the recipient's card whether or not they have your app installed. The small
659
- * icon beside the caption is the app's own icon and is not settable here.
660
- *
661
- * `* Note - requires a trusted chat w/ inbound activity`
662
- *
663
- * `image_title` and `image_subtitle` render as text overlaid on the image (title
664
- * bold, subtitle beneath it). They only appear when `image_url` is set — without
665
- * an image there is nothing to overlay — so setting either without `image_url` is
666
- * rejected.
667
- */
668
- layout: MessageUpdateAppCardParams.Layout;
669
- /**
670
- * Text shown on surfaces that cannot render the card (notifications, lock screen).
671
- * Defaults to the caption when omitted.
672
- */
673
- fallback_text?: string;
674
- /**
675
- * Whether the updated card renders as your app's interactive balloon for
676
- * recipients who have your iMessage app installed. `true` (default) lets your
677
- * installed extension draw its live view; `false` always shows the static `layout`
678
- * card. Recipients without your app always see the static card regardless of this
679
- * flag.
680
- *
681
- * Defaults to `true` when omitted — it is **not** inherited from the original
682
- * card. To keep a card static across updates, re-send `interactive: false` on each
683
- * update.
684
- */
685
- interactive?: boolean;
686
- /**
687
- * URL the recipient's app opens when they tap the updated card.
688
- */
689
- url?: string;
690
- }
691
- export declare namespace MessageUpdateAppCardParams {
692
- /**
693
- * Visible layout of the card. At least one of `caption`, `subcaption`,
694
- * `trailing_caption`, `trailing_subcaption`, or `image_url` must be set, otherwise
695
- * the card renders as an empty bubble.
696
- *
697
- * `image_url` displays a preview image at the top of the card. The image renders
698
- * on the recipient's card whether or not they have your app installed. The small
699
- * icon beside the caption is the app's own icon and is not settable here.
700
- *
701
- * `* Note - requires a trusted chat w/ inbound activity`
702
- *
703
- * `image_title` and `image_subtitle` render as text overlaid on the image (title
704
- * bold, subtitle beneath it). They only appear when `image_url` is set — without
705
- * an image there is nothing to overlay — so setting either without `image_url` is
706
- * rejected.
707
- */
708
- interface Layout {
709
- /**
710
- * Primary label, top-left and bold.
711
- */
712
- caption?: string;
713
- /**
714
- * Text shown below `image_title`, overlaid on the card image. Requires
715
- * `image_url`.
716
- */
717
- image_subtitle?: string;
718
- /**
719
- * Bold text overlaid on the card image. Requires `image_url` (rejected without
720
- * it).
721
- */
722
- image_title?: string;
723
- /**
724
- * URL of an image (JPEG, PNG, HEIF, or WebP) to display as the card's preview
725
- * image; an unreachable or non-image URL returns a validation error. Renders for
726
- * all recipients regardless of whether they have the app. Note - requires a
727
- * trusted chat w/ inbound activity. In responses, this is the re-hosted
728
- * `cdn.linqapp.com` copy of the image you supplied, not your original URL.
729
- */
730
- image_url?: string;
731
- /**
732
- * Secondary label, below `caption` on the left.
733
- */
734
- subcaption?: string;
735
- /**
736
- * Label shown top-right.
737
- */
738
- trailing_caption?: string;
739
- /**
740
- * Label shown below `trailing_caption`, on the right.
741
- */
742
- trailing_subcaption?: string;
743
- }
744
- }
745
- export declare namespace Messages {
746
- export { type Message as Message, type MessageEffect as MessageEffect, type ReplyTo as ReplyTo, type MessageCreateResponse as MessageCreateResponse, type MessageAddReactionResponse as MessageAddReactionResponse, type MessageUpdateAppCardResponse as MessageUpdateAppCardResponse, type MessagesListMessagesPagination as MessagesListMessagesPagination, type MessageCreateParams as MessageCreateParams, type MessageListMessagesThreadParams as MessageListMessagesThreadParams, type MessageAddReactionParams as MessageAddReactionParams, type MessageUpdateParams as MessageUpdateParams, type MessageUpdateAppCardParams as MessageUpdateAppCardParams, };
747
- }
1
+ export * from "./messages/index.js";
748
2
  //# sourceMappingURL=messages.d.ts.map