@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,22 +1,25 @@
1
1
  import { APIResource } from "../../core/resource.js";
2
- import * as MessagesAPI from "../messages.js";
3
2
  import * as Shared from "../shared.js";
4
3
  import * as LocationAPI from "./location.js";
5
4
  import { GetChatLocationResponse, Location, LocationRequestResponse } from "./location.js";
6
- import * as ChatsMessagesAPI from "./messages.js";
5
+ import * as MessagesAPI from "./messages.js";
7
6
  import { MessageListParams, MessageSendParams, MessageSendResponse, Messages, SentMessage } from "./messages.js";
8
7
  import * as ParticipantsAPI from "./participants.js";
9
8
  import { ParticipantAddParams, ParticipantAddResponse, ParticipantRemoveParams, ParticipantRemoveResponse, Participants } from "./participants.js";
9
+ import * as PollsAPI from "./polls.js";
10
+ import { Poll, PollCreateParams, PollEnvelope, Polls } from "./polls.js";
10
11
  import * as TypingAPI from "./typing.js";
11
12
  import { Typing } from "./typing.js";
13
+ import * as ResourcesMessagesAPI from "../messages/messages.js";
12
14
  import { APIPromise } from "../../core/api-promise.js";
13
15
  import { ListChatsPagination, type ListChatsPaginationParams, PagePromise } from "../../core/pagination.js";
14
16
  import { RequestOptions } from "../../internal/request-options.js";
15
17
  export declare class Chats extends APIResource {
16
18
  participants: ParticipantsAPI.Participants;
17
19
  typing: TypingAPI.Typing;
18
- messages: ChatsMessagesAPI.Messages;
20
+ messages: MessagesAPI.Messages;
19
21
  location: LocationAPI.Location;
22
+ polls: PollsAPI.Polls;
20
23
  /**
21
24
  * Create a new chat with specified participants and send an initial message. The
22
25
  * initial message is required when creating a chat.
@@ -107,40 +110,6 @@ export declare class Chats extends APIResource {
107
110
  * ```
108
111
  */
109
112
  create(body: ChatCreateParams, options?: RequestOptions): APIPromise<ChatCreateResponse>;
110
- /**
111
- * Retrieves a paginated list of chats for the authenticated partner.
112
- *
113
- * **Filtering:**
114
- *
115
- * - If `from` is provided, returns chats for that specific phone number
116
- * - If `from` is omitted, returns chats across all phone numbers owned by the
117
- * partner
118
- * - If `to` is provided, only returns chats where the specified handle is a
119
- * participant
120
- *
121
- * **Pagination:**
122
- *
123
- * - Use `limit` to control page size (default: 20, max: 100)
124
- * - The response includes `next_cursor` for fetching the next page
125
- * - When `next_cursor` is `null`, there are no more results to fetch
126
- * - Pass the `next_cursor` value as the `cursor` parameter for the next request
127
- *
128
- * **Example pagination flow:**
129
- *
130
- * 1. First request: `GET /v3/chats?from=%2B12223334444&limit=20`
131
- * 2. Response includes `next_cursor: "20"` (more results exist)
132
- * 3. Next request: `GET /v3/chats?from=%2B12223334444&limit=20&cursor=20`
133
- * 4. Response includes `next_cursor: null` (no more results)
134
- *
135
- * @example
136
- * ```ts
137
- * // Automatically fetches more pages as needed.
138
- * for await (const chat of client.chats.listChats()) {
139
- * // ...
140
- * }
141
- * ```
142
- */
143
- listChats(query?: ChatListChatsParams | null | undefined, options?: RequestOptions): PagePromise<ChatsListChatsPagination, Chat>;
144
113
  /**
145
114
  * Retrieve a chat by its unique identifier.
146
115
  *
@@ -168,17 +137,6 @@ export declare class Chats extends APIResource {
168
137
  * ```
169
138
  */
170
139
  update(chatID: string, body: ChatUpdateParams, options?: RequestOptions): APIPromise<ChatUpdateResponse>;
171
- /**
172
- * Mark all messages in a chat as read.
173
- *
174
- * @example
175
- * ```ts
176
- * await client.chats.markAsRead(
177
- * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
178
- * );
179
- * ```
180
- */
181
- markAsRead(chatID: string, options?: RequestOptions): APIPromise<void>;
182
140
  /**
183
141
  * Removes your phone number from a group chat. Once you leave, you will no longer
184
142
  * receive messages from the group and all interaction endpoints (send message,
@@ -203,20 +161,50 @@ export declare class Chats extends APIResource {
203
161
  */
204
162
  leaveChat(chatID: string, options?: RequestOptions): APIPromise<ChatLeaveChatResponse>;
205
163
  /**
206
- * Share your contact information (Name and Photo Sharing) with a chat.
164
+ * Retrieves a paginated list of chats for the authenticated partner.
207
165
  *
208
- * **Note:** A contact card must be configured before sharing. You can set up your
209
- * contact card via the [Contact Card API](#tag/Contact-Card) or on the
210
- * [Linq dashboard](https://dashboard.linqapp.com/contact-cards).
166
+ * **Filtering:**
167
+ *
168
+ * - If `from` is provided, returns chats for that specific phone number
169
+ * - If `from` is omitted, returns chats across all phone numbers owned by the
170
+ * partner
171
+ * - If `to` is provided, only returns chats where the specified handle is a
172
+ * participant
173
+ *
174
+ * **Pagination:**
175
+ *
176
+ * - Use `limit` to control page size (default: 20, max: 100)
177
+ * - The response includes `next_cursor` for fetching the next page
178
+ * - When `next_cursor` is `null`, there are no more results to fetch
179
+ * - Pass the `next_cursor` value as the `cursor` parameter for the next request
180
+ *
181
+ * **Example pagination flow:**
182
+ *
183
+ * 1. First request: `GET /v3/chats?from=%2B12223334444&limit=20`
184
+ * 2. Response includes `next_cursor: "20"` (more results exist)
185
+ * 3. Next request: `GET /v3/chats?from=%2B12223334444&limit=20&cursor=20`
186
+ * 4. Response includes `next_cursor: null` (no more results)
211
187
  *
212
188
  * @example
213
189
  * ```ts
214
- * await client.chats.shareContactCard(
190
+ * // Automatically fetches more pages as needed.
191
+ * for await (const chat of client.chats.listChats()) {
192
+ * // ...
193
+ * }
194
+ * ```
195
+ */
196
+ listChats(query?: ChatListChatsParams | null | undefined, options?: RequestOptions): PagePromise<ChatsListChatsPagination, Chat>;
197
+ /**
198
+ * Mark all messages in a chat as read.
199
+ *
200
+ * @example
201
+ * ```ts
202
+ * await client.chats.markAsRead(
215
203
  * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
216
204
  * );
217
205
  * ```
218
206
  */
219
- shareContactCard(chatID: string, options?: RequestOptions): APIPromise<void>;
207
+ markAsRead(chatID: string, options?: RequestOptions): APIPromise<void>;
220
208
  /**
221
209
  * Send an audio file as an **iMessage voice memo bubble** to all participants in a
222
210
  * chat. Voice memos appear with iMessage's native inline playback UI, unlike
@@ -242,6 +230,21 @@ export declare class Chats extends APIResource {
242
230
  * ```
243
231
  */
244
232
  sendVoicememo(chatID: string, body: ChatSendVoicememoParams, options?: RequestOptions): APIPromise<ChatSendVoicememoResponse>;
233
+ /**
234
+ * Share your contact information (Name and Photo Sharing) with a chat.
235
+ *
236
+ * **Note:** A contact card must be configured before sharing. You can set up your
237
+ * contact card via the [Contact Card API](#tag/Contact-Card) or on the
238
+ * [Linq dashboard](https://dashboard.linqapp.com/contact-cards).
239
+ *
240
+ * @example
241
+ * ```ts
242
+ * await client.chats.shareContactCard(
243
+ * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
244
+ * );
245
+ * ```
246
+ */
247
+ shareContactCard(chatID: string, options?: RequestOptions): APIPromise<void>;
245
248
  }
246
249
  export type ChatsListChatsPagination = ListChatsPagination<Chat>;
247
250
  export interface Chat {
@@ -322,6 +325,21 @@ export declare namespace Chat {
322
325
  * Current health bucket for the chat. See the
323
326
  * [Chat Health guide](/guides/chats/chat-health) for what each value means and how
324
327
  * to react. `doc_url` deep-links to the relevant section.
328
+ *
329
+ * `OPTED_OUT` is terminal — the recipient sent `STOP`, `UNSUBSCRIBE`, `OPTOUT`,
330
+ * `CANCEL`, `END`, or `QUIT`. The keyword must be the whole trimmed message, never
331
+ * part of a longer one: `STOP` counts, `please stop` does not. Most keywords must
332
+ * match exactly, including case. `OPT OUT` is the exception — it matches in any
333
+ * casing, with or without the space or a hyphen, so `opt out`, `Opt-Out` and
334
+ * `optout` all count. It clears if they later send `START`, `OPTIN`, or `UNSTOP`,
335
+ * or if they keep replying on the chat — sustained two-way conversation is treated
336
+ * as a sign the stop keyword was a false positive.
337
+ *
338
+ * Linq enforces this: while a recipient is opted out, every send to them is
339
+ * rejected with `403` (error code `2024`) before the message is queued, across
340
+ * every chat and every line on your account. Nothing is delivered, including a
341
+ * final courtesy message — to send one, set `override_optout: true` on that single
342
+ * request.
325
343
  */
326
344
  status: 'HEALTHY' | 'AT_RISK' | 'CRITICAL' | 'OPTED_OUT';
327
345
  /**
@@ -400,13 +418,24 @@ export interface MediaPart {
400
418
  * cannot coexist with text), so copy and a card are two sends, not one.
401
419
  */
402
420
  export interface MessageContent {
421
+ /**
422
+ * Invokes an action on an experience — a third party that renders inside Linq's
423
+ * iMessage app. Linq resolves the recipient's connection, mints any session the
424
+ * action needs, composes the card and sends it; none of that is visible to you.
425
+ *
426
+ * Call `GET /v3/experiences/{experience}` for the actions you may invoke and the
427
+ * fields each accepts.
428
+ */
429
+ action?: MessageContent.Action;
403
430
  /**
404
431
  * iMessage effect to apply to this message (screen or bubble effect)
405
432
  */
406
- effect?: MessagesAPI.MessageEffect;
433
+ effect?: ResourcesMessagesAPI.MessageEffect;
407
434
  /**
408
435
  * Optional idempotency key for this message. Use this to prevent duplicate sends
409
- * of the same message.
436
+ * of the same message. Reusing a key whose message was deleted — or was an
437
+ * ephemeral message that has since expired — returns 404; the message is never
438
+ * resent.
410
439
  */
411
440
  idempotency_key?: string;
412
441
  /**
@@ -456,9 +485,37 @@ export interface MessageContent {
456
485
  /**
457
486
  * Reply to another message to create a threaded conversation
458
487
  */
459
- reply_to?: MessagesAPI.ReplyTo;
488
+ reply_to?: ResourcesMessagesAPI.ReplyTo;
460
489
  }
461
490
  export declare namespace MessageContent {
491
+ /**
492
+ * Invokes an action on an experience — a third party that renders inside Linq's
493
+ * iMessage app. Linq resolves the recipient's connection, mints any session the
494
+ * action needs, composes the card and sends it; none of that is visible to you.
495
+ *
496
+ * Call `GET /v3/experiences/{experience}` for the actions you may invoke and the
497
+ * fields each accepts.
498
+ */
499
+ interface Action {
500
+ /**
501
+ * Which of its actions, e.g. `attach_card`.
502
+ */
503
+ action: string;
504
+ /**
505
+ * The experience to invoke, e.g. `agentcard`.
506
+ */
507
+ experience: string;
508
+ /**
509
+ * Values for the fields this action exposes. Keys are exactly the field names
510
+ * listed for the action — no mapping, no nesting.
511
+ *
512
+ * Display copy only, except a `url`-type field — that value sets the destination,
513
+ * and must be an absolute `https` URL.
514
+ */
515
+ params?: {
516
+ [key: string]: unknown;
517
+ };
518
+ }
462
519
  /**
463
520
  * An iMessage app card, backed by a Messages app extension. iMessage only — an
464
521
  * `imessage_app` part must be the **only** part in the message and is never
@@ -600,6 +657,24 @@ export interface TextPart {
600
657
  * `text_decorations` to apply inline formatting and animations (iMessage only).
601
658
  */
602
659
  value: string;
660
+ /**
661
+ * @mention a chat participant (iMessage group chats only). Set to their handle —
662
+ * E.164 phone number or Apple ID email. `value` is the display text; use the bare
663
+ * name (`"Juan"`, not `"@Juan"`). The mentioned participant is notified even if
664
+ * the chat is muted. Falls back to plain text over SMS/RCS.
665
+ *
666
+ * By default the entire `value` renders as the mention; use `mention_range` to
667
+ * highlight only part of it.
668
+ */
669
+ mention?: string;
670
+ /**
671
+ * Optional character range `[start, end)` in `value` that renders as the `mention`
672
+ * highlight (e.g. just the name in `"Hey Kevin, can you look at this?"`). Requires
673
+ * `mention`. Without it, the entire `value` is highlighted. `start` is inclusive,
674
+ * `end` is exclusive. _Characters are measured as UTF-16 code units. Most
675
+ * characters count as 1; some emoji count as 2._
676
+ */
677
+ mention_range?: Array<number>;
603
678
  /**
604
679
  * Optional array of text decorations applied to character ranges in the `value`
605
680
  * field (iMessage only).
@@ -664,7 +739,7 @@ export declare namespace ChatCreateResponse {
664
739
  /**
665
740
  * A message that was sent (used in CreateChat and SendMessage responses)
666
741
  */
667
- message: ChatsMessagesAPI.SentMessage;
742
+ message: MessagesAPI.SentMessage;
668
743
  /**
669
744
  * Messaging service type
670
745
  */
@@ -693,6 +768,21 @@ export declare namespace ChatCreateResponse {
693
768
  * Current health bucket for the chat. See the
694
769
  * [Chat Health guide](/guides/chats/chat-health) for what each value means and how
695
770
  * to react. `doc_url` deep-links to the relevant section.
771
+ *
772
+ * `OPTED_OUT` is terminal — the recipient sent `STOP`, `UNSUBSCRIBE`, `OPTOUT`,
773
+ * `CANCEL`, `END`, or `QUIT`. The keyword must be the whole trimmed message, never
774
+ * part of a longer one: `STOP` counts, `please stop` does not. Most keywords must
775
+ * match exactly, including case. `OPT OUT` is the exception — it matches in any
776
+ * casing, with or without the space or a hyphen, so `opt out`, `Opt-Out` and
777
+ * `optout` all count. It clears if they later send `START`, `OPTIN`, or `UNSTOP`,
778
+ * or if they keep replying on the chat — sustained two-way conversation is treated
779
+ * as a sign the stop keyword was a false positive.
780
+ *
781
+ * Linq enforces this: while a recipient is opted out, every send to them is
782
+ * rejected with `403` (error code `2024`) before the message is queued, across
783
+ * every chat and every line on your account. Nothing is delivered, including a
784
+ * final courtesy message — to send one, set `override_optout: true` on that single
785
+ * request.
696
786
  */
697
787
  status: 'HEALTHY' | 'AT_RISK' | 'CRITICAL' | 'OPTED_OUT';
698
788
  /**
@@ -819,6 +909,23 @@ export interface ChatCreateParams {
819
909
  * For individual chats, provide one recipient. For group chats, provide multiple.
820
910
  */
821
911
  to: Array<string>;
912
+ /**
913
+ * Send even though the recipient asked you to stop (`403`, error code `2024`).
914
+ * Applies to this request only: the opt-out stays in place, so the next send
915
+ * without this flag is rejected again. Every override is recorded against your API
916
+ * key.
917
+ */
918
+ override_optout?: boolean;
919
+ }
920
+ export interface ChatUpdateParams {
921
+ /**
922
+ * New display name for the chat (group chats only)
923
+ */
924
+ display_name?: string;
925
+ /**
926
+ * URL of an image to set as the group chat icon (group chats only)
927
+ */
928
+ group_chat_icon?: string;
822
929
  }
823
930
  export interface ChatListChatsParams extends ListChatsPaginationParams {
824
931
  /**
@@ -836,16 +943,6 @@ export interface ChatListChatsParams extends ListChatsPaginationParams {
836
943
  */
837
944
  to?: string;
838
945
  }
839
- export interface ChatUpdateParams {
840
- /**
841
- * New display name for the chat (group chats only)
842
- */
843
- display_name?: string;
844
- /**
845
- * URL of an image to set as the group chat icon (group chats only)
846
- */
847
- group_chat_icon?: string;
848
- }
849
946
  export interface ChatSendVoicememoParams {
850
947
  /**
851
948
  * Reference to a voice memo file pre-uploaded via `POST /v3/attachments`. The file
@@ -854,6 +951,13 @@ export interface ChatSendVoicememoParams {
854
951
  * Either `voice_memo_url` or `attachment_id` must be provided, but not both.
855
952
  */
856
953
  attachment_id?: string;
954
+ /**
955
+ * Send even though the recipient asked you to stop (`403`, error code `2024`).
956
+ * Applies to this request only: the opt-out stays in place, so the next send
957
+ * without this flag is rejected again. Every override is recorded against your API
958
+ * key.
959
+ */
960
+ override_optout?: boolean;
857
961
  /**
858
962
  * URL of the voice memo audio file. Must be a publicly accessible HTTPS URL.
859
963
  *
@@ -862,10 +966,11 @@ export interface ChatSendVoicememoParams {
862
966
  voice_memo_url?: string;
863
967
  }
864
968
  export declare namespace Chats {
865
- export { type Chat as Chat, type LinkPart as LinkPart, type MediaPart as MediaPart, type MessageContent as MessageContent, type TextPart as TextPart, type ChatCreateResponse as ChatCreateResponse, type ChatUpdateResponse as ChatUpdateResponse, type ChatLeaveChatResponse as ChatLeaveChatResponse, type ChatSendVoicememoResponse as ChatSendVoicememoResponse, type ChatsListChatsPagination as ChatsListChatsPagination, type ChatCreateParams as ChatCreateParams, type ChatListChatsParams as ChatListChatsParams, type ChatUpdateParams as ChatUpdateParams, type ChatSendVoicememoParams as ChatSendVoicememoParams, };
969
+ export { type Chat as Chat, type LinkPart as LinkPart, type MediaPart as MediaPart, type MessageContent as MessageContent, type TextPart as TextPart, type ChatCreateResponse as ChatCreateResponse, type ChatUpdateResponse as ChatUpdateResponse, type ChatLeaveChatResponse as ChatLeaveChatResponse, type ChatSendVoicememoResponse as ChatSendVoicememoResponse, type ChatsListChatsPagination as ChatsListChatsPagination, type ChatCreateParams as ChatCreateParams, type ChatUpdateParams as ChatUpdateParams, type ChatListChatsParams as ChatListChatsParams, type ChatSendVoicememoParams as ChatSendVoicememoParams, };
866
970
  export { Participants as Participants, type ParticipantAddResponse as ParticipantAddResponse, type ParticipantRemoveResponse as ParticipantRemoveResponse, type ParticipantAddParams as ParticipantAddParams, type ParticipantRemoveParams as ParticipantRemoveParams, };
867
971
  export { Typing as Typing };
868
- export { Messages as Messages, type SentMessage as SentMessage, type MessageSendResponse as MessageSendResponse, type MessageSendParams as MessageSendParams, type MessageListParams as MessageListParams, };
972
+ export { Messages as Messages, type SentMessage as SentMessage, type MessageSendResponse as MessageSendResponse, type MessageListParams as MessageListParams, type MessageSendParams as MessageSendParams, };
869
973
  export { Location as Location, type GetChatLocationResponse as GetChatLocationResponse, type LocationRequestResponse as LocationRequestResponse, };
974
+ export { Polls as Polls, type Poll as Poll, type PollEnvelope as PollEnvelope, type PollCreateParams as PollCreateParams, };
870
975
  }
871
976
  //# sourceMappingURL=chats.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"chats.d.ts","sourceRoot":"","sources":["../../src/resources/chats/chats.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,+BAA4B;AAClD,OAAO,KAAK,WAAW,uBAAoB;AAC3C,OAAO,KAAK,MAAM,qBAAkB;AACpC,OAAO,KAAK,WAAW,sBAAmB;AAC1C,OAAO,EAAE,uBAAuB,EAAE,QAAQ,EAAE,uBAAuB,EAAE,sBAAmB;AACxF,OAAO,KAAK,gBAAgB,s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AI,IAAI,EACjB,KAAK,YAAY,IAAI,YAAY,EACjC,KAAK,gBAAgB,IAAI,gBAAgB,GAC1C,CAAC;CACH"}
@@ -6,10 +6,12 @@ const tslib_1 = require("../../internal/tslib.js");
6
6
  const resource_1 = require("../../core/resource.js");
7
7
  const LocationAPI = tslib_1.__importStar(require("./location.js"));
8
8
  const location_1 = require("./location.js");
9
- const ChatsMessagesAPI = tslib_1.__importStar(require("./messages.js"));
9
+ const MessagesAPI = tslib_1.__importStar(require("./messages.js"));
10
10
  const messages_1 = require("./messages.js");
11
11
  const ParticipantsAPI = tslib_1.__importStar(require("./participants.js"));
12
12
  const participants_1 = require("./participants.js");
13
+ const PollsAPI = tslib_1.__importStar(require("./polls.js"));
14
+ const polls_1 = require("./polls.js");
13
15
  const TypingAPI = tslib_1.__importStar(require("./typing.js"));
14
16
  const typing_1 = require("./typing.js");
15
17
  const pagination_1 = require("../../core/pagination.js");
@@ -20,8 +22,9 @@ class Chats extends resource_1.APIResource {
20
22
  super(...arguments);
21
23
  this.participants = new ParticipantsAPI.Participants(this._client);
22
24
  this.typing = new TypingAPI.Typing(this._client);
23
- this.messages = new ChatsMessagesAPI.Messages(this._client);
25
+ this.messages = new MessagesAPI.Messages(this._client);
24
26
  this.location = new LocationAPI.Location(this._client);
27
+ this.polls = new PollsAPI.Polls(this._client);
25
28
  }
26
29
  /**
27
30
  * Create a new chat with specified participants and send an initial message. The
@@ -115,42 +118,6 @@ class Chats extends resource_1.APIResource {
115
118
  create(body, options) {
116
119
  return this._client.post('/v3/chats', { body, ...options });
117
120
  }
118
- /**
119
- * Retrieves a paginated list of chats for the authenticated partner.
120
- *
121
- * **Filtering:**
122
- *
123
- * - If `from` is provided, returns chats for that specific phone number
124
- * - If `from` is omitted, returns chats across all phone numbers owned by the
125
- * partner
126
- * - If `to` is provided, only returns chats where the specified handle is a
127
- * participant
128
- *
129
- * **Pagination:**
130
- *
131
- * - Use `limit` to control page size (default: 20, max: 100)
132
- * - The response includes `next_cursor` for fetching the next page
133
- * - When `next_cursor` is `null`, there are no more results to fetch
134
- * - Pass the `next_cursor` value as the `cursor` parameter for the next request
135
- *
136
- * **Example pagination flow:**
137
- *
138
- * 1. First request: `GET /v3/chats?from=%2B12223334444&limit=20`
139
- * 2. Response includes `next_cursor: "20"` (more results exist)
140
- * 3. Next request: `GET /v3/chats?from=%2B12223334444&limit=20&cursor=20`
141
- * 4. Response includes `next_cursor: null` (no more results)
142
- *
143
- * @example
144
- * ```ts
145
- * // Automatically fetches more pages as needed.
146
- * for await (const chat of client.chats.listChats()) {
147
- * // ...
148
- * }
149
- * ```
150
- */
151
- listChats(query = {}, options) {
152
- return this._client.getAPIList('/v3/chats', (pagination_1.ListChatsPagination), { query, ...options });
153
- }
154
121
  /**
155
122
  * Retrieve a chat by its unique identifier.
156
123
  *
@@ -182,22 +149,6 @@ class Chats extends resource_1.APIResource {
182
149
  update(chatID, body, options) {
183
150
  return this._client.put((0, path_1.path) `/v3/chats/${chatID}`, { body, ...options });
184
151
  }
185
- /**
186
- * Mark all messages in a chat as read.
187
- *
188
- * @example
189
- * ```ts
190
- * await client.chats.markAsRead(
191
- * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
192
- * );
193
- * ```
194
- */
195
- markAsRead(chatID, options) {
196
- return this._client.post((0, path_1.path) `/v3/chats/${chatID}/read`, {
197
- ...options,
198
- headers: (0, headers_1.buildHeaders)([{ Accept: '*/*' }, options?.headers]),
199
- });
200
- }
201
152
  /**
202
153
  * Removes your phone number from a group chat. Once you leave, you will no longer
203
154
  * receive messages from the group and all interaction endpoints (send message,
@@ -224,21 +175,53 @@ class Chats extends resource_1.APIResource {
224
175
  return this._client.post((0, path_1.path) `/v3/chats/${chatID}/leave`, options);
225
176
  }
226
177
  /**
227
- * Share your contact information (Name and Photo Sharing) with a chat.
178
+ * Retrieves a paginated list of chats for the authenticated partner.
228
179
  *
229
- * **Note:** A contact card must be configured before sharing. You can set up your
230
- * contact card via the [Contact Card API](#tag/Contact-Card) or on the
231
- * [Linq dashboard](https://dashboard.linqapp.com/contact-cards).
180
+ * **Filtering:**
181
+ *
182
+ * - If `from` is provided, returns chats for that specific phone number
183
+ * - If `from` is omitted, returns chats across all phone numbers owned by the
184
+ * partner
185
+ * - If `to` is provided, only returns chats where the specified handle is a
186
+ * participant
187
+ *
188
+ * **Pagination:**
189
+ *
190
+ * - Use `limit` to control page size (default: 20, max: 100)
191
+ * - The response includes `next_cursor` for fetching the next page
192
+ * - When `next_cursor` is `null`, there are no more results to fetch
193
+ * - Pass the `next_cursor` value as the `cursor` parameter for the next request
194
+ *
195
+ * **Example pagination flow:**
196
+ *
197
+ * 1. First request: `GET /v3/chats?from=%2B12223334444&limit=20`
198
+ * 2. Response includes `next_cursor: "20"` (more results exist)
199
+ * 3. Next request: `GET /v3/chats?from=%2B12223334444&limit=20&cursor=20`
200
+ * 4. Response includes `next_cursor: null` (no more results)
232
201
  *
233
202
  * @example
234
203
  * ```ts
235
- * await client.chats.shareContactCard(
204
+ * // Automatically fetches more pages as needed.
205
+ * for await (const chat of client.chats.listChats()) {
206
+ * // ...
207
+ * }
208
+ * ```
209
+ */
210
+ listChats(query = {}, options) {
211
+ return this._client.getAPIList('/v3/chats', (pagination_1.ListChatsPagination), { query, ...options });
212
+ }
213
+ /**
214
+ * Mark all messages in a chat as read.
215
+ *
216
+ * @example
217
+ * ```ts
218
+ * await client.chats.markAsRead(
236
219
  * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
237
220
  * );
238
221
  * ```
239
222
  */
240
- shareContactCard(chatID, options) {
241
- return this._client.post((0, path_1.path) `/v3/chats/${chatID}/share_contact_card`, {
223
+ markAsRead(chatID, options) {
224
+ return this._client.post((0, path_1.path) `/v3/chats/${chatID}/read`, {
242
225
  ...options,
243
226
  headers: (0, headers_1.buildHeaders)([{ Accept: '*/*' }, options?.headers]),
244
227
  });
@@ -270,10 +253,31 @@ class Chats extends resource_1.APIResource {
270
253
  sendVoicememo(chatID, body, options) {
271
254
  return this._client.post((0, path_1.path) `/v3/chats/${chatID}/voicememo`, { body, ...options });
272
255
  }
256
+ /**
257
+ * Share your contact information (Name and Photo Sharing) with a chat.
258
+ *
259
+ * **Note:** A contact card must be configured before sharing. You can set up your
260
+ * contact card via the [Contact Card API](#tag/Contact-Card) or on the
261
+ * [Linq dashboard](https://dashboard.linqapp.com/contact-cards).
262
+ *
263
+ * @example
264
+ * ```ts
265
+ * await client.chats.shareContactCard(
266
+ * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
267
+ * );
268
+ * ```
269
+ */
270
+ shareContactCard(chatID, options) {
271
+ return this._client.post((0, path_1.path) `/v3/chats/${chatID}/share_contact_card`, {
272
+ ...options,
273
+ headers: (0, headers_1.buildHeaders)([{ Accept: '*/*' }, options?.headers]),
274
+ });
275
+ }
273
276
  }
274
277
  exports.Chats = Chats;
275
278
  Chats.Participants = participants_1.Participants;
276
279
  Chats.Typing = typing_1.Typing;
277
280
  Chats.Messages = messages_1.Messages;
278
281
  Chats.Location = location_1.Location;
282
+ Chats.Polls = polls_1.Polls;
279
283
  //# sourceMappingURL=chats.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"chats.js","sourceRoot":"","sources":["../../src/resources/chats/chats.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;AAEtF,qDAAkD;AAGlD,mEAA0C;AAC1C,4CAAwF;AACxF,wEAA+C;AAC/C,4CAA8G;AAC9G,2EAAkD;AAClD,oDAMwB;AACxB,+DAAsC;AACtC,wCAAkC;AAElC,yDAAyG;AACzG,uDAAsD;AAEtD,uDAAiD;AAEjD,MAAa,KAAM,SAAQ,sBAAW;IAAtC;;QACE,iBAAY,GAAiC,IAAI,eAAe,CAAC,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC5F,WAAM,GAAqB,IAAI,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC9D,aAAQ,GAA8B,IAAI,gBAAgB,CAAC,QAA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