@linqapp/sdk 0.33.0 → 0.34.0

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 (114) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/client.d.mts +1 -1
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +1 -1
  5. package/client.d.ts.map +1 -1
  6. package/client.js +1 -1
  7. package/client.js.map +1 -1
  8. package/client.mjs +1 -1
  9. package/client.mjs.map +1 -1
  10. package/core/error.d.mts +13 -0
  11. package/core/error.d.mts.map +1 -1
  12. package/core/error.d.ts +13 -0
  13. package/core/error.d.ts.map +1 -1
  14. package/core/error.js +5 -1
  15. package/core/error.js.map +1 -1
  16. package/core/error.mjs +5 -1
  17. package/core/error.mjs.map +1 -1
  18. package/package.json +1 -1
  19. package/resources/chats/chats.d.mts +68 -24
  20. package/resources/chats/chats.d.mts.map +1 -1
  21. package/resources/chats/chats.d.ts +68 -24
  22. package/resources/chats/chats.d.ts.map +1 -1
  23. package/resources/chats/chats.js +6 -2
  24. package/resources/chats/chats.js.map +1 -1
  25. package/resources/chats/chats.mjs +6 -2
  26. package/resources/chats/chats.mjs.map +1 -1
  27. package/resources/chats/index.d.mts +1 -0
  28. package/resources/chats/index.d.mts.map +1 -1
  29. package/resources/chats/index.d.ts +1 -0
  30. package/resources/chats/index.d.ts.map +1 -1
  31. package/resources/chats/index.js +3 -1
  32. package/resources/chats/index.js.map +1 -1
  33. package/resources/chats/index.mjs +1 -0
  34. package/resources/chats/index.mjs.map +1 -1
  35. package/resources/chats/messages.d.mts +12 -5
  36. package/resources/chats/messages.d.mts.map +1 -1
  37. package/resources/chats/messages.d.ts +12 -5
  38. package/resources/chats/messages.d.ts.map +1 -1
  39. package/resources/chats/messages.js.map +1 -1
  40. package/resources/chats/messages.mjs.map +1 -1
  41. package/resources/chats/polls.d.mts +171 -0
  42. package/resources/chats/polls.d.mts.map +1 -0
  43. package/resources/chats/polls.d.ts +171 -0
  44. package/resources/chats/polls.d.ts.map +1 -0
  45. package/resources/chats/polls.js +95 -0
  46. package/resources/chats/polls.js.map +1 -0
  47. package/resources/chats/polls.mjs +91 -0
  48. package/resources/chats/polls.mjs.map +1 -0
  49. package/resources/index.d.mts +1 -1
  50. package/resources/index.d.mts.map +1 -1
  51. package/resources/index.d.ts +1 -1
  52. package/resources/index.d.ts.map +1 -1
  53. package/resources/index.js +1 -1
  54. package/resources/index.js.map +1 -1
  55. package/resources/index.mjs +1 -1
  56. package/resources/index.mjs.map +1 -1
  57. package/resources/messages/index.d.mts +3 -0
  58. package/resources/messages/index.d.mts.map +1 -0
  59. package/resources/messages/index.d.ts +3 -0
  60. package/resources/messages/index.d.ts.map +1 -0
  61. package/resources/messages/index.js +9 -0
  62. package/resources/messages/index.js.map +1 -0
  63. package/resources/messages/index.mjs +4 -0
  64. package/resources/messages/index.mjs.map +1 -0
  65. package/resources/messages/messages.d.mts +795 -0
  66. package/resources/messages/messages.d.mts.map +1 -0
  67. package/resources/messages/messages.d.ts +795 -0
  68. package/resources/messages/messages.d.ts.map +1 -0
  69. package/resources/messages/messages.js +298 -0
  70. package/resources/messages/messages.js.map +1 -0
  71. package/resources/messages/messages.mjs +293 -0
  72. package/resources/messages/messages.mjs.map +1 -0
  73. package/resources/messages/poll.d.mts +131 -0
  74. package/resources/messages/poll.d.mts.map +1 -0
  75. package/resources/messages/poll.d.ts +131 -0
  76. package/resources/messages/poll.d.ts.map +1 -0
  77. package/resources/messages/poll.js +119 -0
  78. package/resources/messages/poll.js.map +1 -0
  79. package/resources/messages/poll.mjs +115 -0
  80. package/resources/messages/poll.mjs.map +1 -0
  81. package/resources/messages.d.mts +1 -783
  82. package/resources/messages.d.mts.map +1 -1
  83. package/resources/messages.d.ts +1 -783
  84. package/resources/messages.d.ts.map +1 -1
  85. package/resources/messages.js +2 -286
  86. package/resources/messages.js.map +1 -1
  87. package/resources/messages.mjs +1 -284
  88. package/resources/messages.mjs.map +1 -1
  89. package/resources/webhook-events.d.mts +1 -1
  90. package/resources/webhook-events.d.mts.map +1 -1
  91. package/resources/webhook-events.d.ts +1 -1
  92. package/resources/webhook-events.d.ts.map +1 -1
  93. package/resources/webhooks.d.mts +40 -28
  94. package/resources/webhooks.d.mts.map +1 -1
  95. package/resources/webhooks.d.ts +40 -28
  96. package/resources/webhooks.d.ts.map +1 -1
  97. package/src/client.ts +15 -15
  98. package/src/core/error.ts +20 -1
  99. package/src/resources/chats/chats.ts +79 -24
  100. package/src/resources/chats/index.ts +1 -0
  101. package/src/resources/chats/messages.ts +14 -6
  102. package/src/resources/chats/polls.ts +196 -0
  103. package/src/resources/index.ts +1 -1
  104. package/src/resources/messages/index.ts +18 -0
  105. package/src/resources/messages/messages.ts +958 -0
  106. package/src/resources/messages/poll.ts +151 -0
  107. package/src/resources/messages.ts +1 -932
  108. package/src/resources/webhook-events.ts +9 -0
  109. package/src/resources/webhooks.ts +48 -27
  110. package/src/version.ts +1 -1
  111. package/version.d.mts +1 -1
  112. package/version.d.ts +1 -1
  113. package/version.js +1 -1
  114. package/version.mjs +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../src/resources/messages.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,4BAAyB;AAC/C,OAAO,KAAK,MAAM,oBAAiB;AACnC,OAAO,KAAK,QAAQ,yBAAsB;AAC1C,OAAO,KAAK,gBAAgB,4BAAyB;AACrD,OAAO,EAAE,UAAU,EAAE,+BAA4B;AACjD,OAAO,EAAE,sBAAsB,EAAE,KAAK,4BAA4B,EAAE,WAAW,EAAE,8BAA2B;AAE5G,OAAO,EAAE,cAAc,EAAE,uCAAoC;AAG7D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2DG;AACH,qBAAa,QAAS,SAAQ,WAAW;IACvC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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C,EAAE,MAAM,CAAC;QAExB;;;WAGG;QACH,WAAW,CAAC,EAAE,MAAM,CAAC;QAErB;;;;;;WAMG;QACH,SAAS,CAAC,EAAE,MAAM,CAAC;QAEnB;;WAEG;QACH,UAAU,CAAC,EAAE,MAAM,CAAC;QAEpB;;WAEG;QACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;QAE1B;;WAEG;QACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;KAC9B;CACF;AAED,MAAM,CAAC,OAAO,WAAW,QAAQ,CAAC;IAChC,OAAO,EACL,KAAK,OAAO,IAAI,OAAO,EACvB,KAAK,aAAa,IAAI,aAAa,EACnC,KAAK,OAAO,IAAI,OAAO,EACvB,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,0BAA0B,IAAI,0BAA0B,EAC7D,KAAK,4BAA4B,IAAI,4BAA4B,EACjE,KAAK,8BAA8B,IAAI,8BAA8B,EACrE,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,wBAAwB,IAAI,wBAAwB,EACzD,KAAK,+BAA+B,IAAI,+BAA+B,EACvE,KAAK,0BAA0B,IAAI,0BAA0B,GAC9D,CAAC;CACH"}
1
+ {"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../src/resources/messages.ts"],"names":[],"mappings":"AAEA,oCAAiC"}
@@ -1,290 +1,6 @@
1
1
  "use strict";
2
2
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.Messages = void 0;
5
- const resource_1 = require("../core/resource.js");
6
- const pagination_1 = require("../core/pagination.js");
7
- const headers_1 = require("../internal/headers.js");
8
- const path_1 = require("../internal/utils/path.js");
9
- /**
10
- * Messages are individual communications within a chat thread.
11
- *
12
- * Messages can include text, media attachments, rich link previews, special effects
13
- * (like confetti or fireworks), and reactions. All messages are associated with a
14
- * specific chat and sent from a phone number you own.
15
- *
16
- * Messages support delivery status tracking, read receipts, and editing capabilities.
17
- *
18
- * ## Rich Link Previews
19
- *
20
- * Send a URL as a `link` part to deliver it with a rich preview card showing the
21
- * page's title, description, and image (when available). A `link` part must be the
22
- * **only** part in the message — it cannot be combined with text or media parts.
23
- * To send a URL without a preview card, include it in a `text` part instead.
24
- *
25
- * **Limitations:**
26
- * - A `link` part cannot be combined with other parts in the same message.
27
- * - Maximum URL length: 2,048 characters.
28
- *
29
- * ## Ephemeral Messages (Privacy Tier)
30
- *
31
- * 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.
32
- *
33
- * You can request it at two scopes:
34
- *
35
- * | Scope | Effect |
36
- * |---|---|
37
- * | **Partner-wide** | Every outbound and inbound message on every phone number under your account is retained for 24 hours, then deleted. |
38
- * | **Per phone number** | Only the specified phone numbers have their messages auto-deleted. The rest follow the standard message-retention policy. |
39
- *
40
- * **Behavioral differences vs the standard default:**
41
- *
42
- * | Aspect | Standard | Ephemeral |
43
- * |---|---|---|
44
- * | Retention | Retained per the standard message-retention policy | **Hard backstop: 24 hours** from when the message is created |
45
- * | 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` |
46
- * | Content on expiry | N/A | Text, formatting, and attachment references are scrubbed; the message is gone, not blanked out |
47
- * | Cross-partner isolation | Enforced | Enforced |
48
- *
49
- * **How the 24-hour window works:**
50
- *
51
- * - The window is fixed at **24 hours from message creation** (`created_at`) and cannot be configured per message.
52
- * - It mirrors the ephemeral *attachments* 1-day backstop, so a message and any media it carries expire together.
53
- * - Expiry is delivery-independent — the clock starts when the message is created, not when it is delivered or read.
54
- *
55
- * **What you observe:**
56
- *
57
- * - **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.
58
- * - **No deletion webhook is sent.** There is no `message.deleted` event — a message simply stops being retrievable once its window passes.
59
- * - **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.
60
- *
61
- * **When to choose ephemeral:**
62
- *
63
- * - You have a compliance requirement that the platform must not retain message content beyond a short window.
64
- * - The conversation is high-sensitivity (PHI, financial, identity verification) and you do not want it sitting in storage long-term.
65
- * - 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.
66
- *
67
- * **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.
68
- */
69
- class Messages extends resource_1.APIResource {
70
- /**
71
- * Send a message to one or more recipients **without supplying a `from` number**.
72
- * Linq resolves both the sending line and the target chat for you, then returns
73
- * exactly which line was used, which chat the message landed in, whether a new
74
- * chat was created, and every resulting message id.
75
- *
76
- * This fuses "create chat" and "send message" behind a single message-centric
77
- * resource. Provide only the recipients (`to`) and the `message`; the platform
78
- * decides the rest.
79
- *
80
- * ## How the from-number and chat are chosen
81
- *
82
- * - **Reuse** — if a chat with exactly these recipients already exists on a line
83
- * that can still send, the message is sent into that chat on its existing line
84
- * (`from_selection.reason = reused_active_chat`). The most-recently-active such
85
- * chat wins; chats stranded on flagged lines (e.g. by an earlier failover) are
86
- * skipped.
87
- * - **New** — if no such chat exists, a new chat is created on the best available
88
- * line (`from_selection.reason = new_best_number`).
89
- * - **Failover** — if matching chats exist but none is on a line that can send, a
90
- * **new** chat is created on a fresh best line and the flagged chat is abandoned
91
- * (`from_selection.reason = failover_flagged`, `previous_chat_id` set). If you
92
- * supply `continuation_message`, that text is sent as the single message INSTEAD
93
- * of `message` (useful as a fresh-number-appropriate opener). Exactly one
94
- * message is sent either way.
95
- *
96
- * Recipients (`to`) are an order-independent set: a single handle is a direct
97
- * chat, multiple handles a group chat.
98
- *
99
- * ## Excluding lines
100
- *
101
- * `exclude_from` keeps specific lines out of **this** send's line pick. It only
102
- * affects picking a line for a new chat — an existing chat is always reused on its
103
- * own line, preferring a chat on a non-excluded line when the recipients have more
104
- * than one. An exclusion never abandons a live chat or moves it to a new number,
105
- * so if the only chat these recipients have is on an excluded line, that chat is
106
- * still used. `from` tells you the line that was actually used.
107
- *
108
- * ## Differences from POST /v3/chats
109
- *
110
- * - The first message **may contain a link** (including for a newly created chat).
111
- * Note: sending a link as the very first message on a freshly selected line can
112
- * elevate that line's flagging risk — it is allowed, not recommended.
113
- * - Voice memos are **not** supported here. To send an iMessage voice-memo bubble,
114
- * use `POST /v3/chats/{chatId}/voicememo` with a known chat id.
115
- *
116
- * ## Service preference, effects, decorations
117
- *
118
- * Set `message.preferred_service` (`iMessage` | `RCS` | `SMS`), `message.effect`,
119
- * and per-part `text_decorations` exactly as on the other send endpoints.
120
- *
121
- * Always responds `202 Accepted` — chat creation is incidental to the send.
122
- *
123
- * @example
124
- * ```ts
125
- * const message = await client.messages.create({
126
- * message: {
127
- * parts: [
128
- * {
129
- * type: 'text',
130
- * value:
131
- * 'Hi! Thanks for reaching out — how can we help?',
132
- * },
133
- * ],
134
- * },
135
- * to: ['+14155559876'],
136
- * });
137
- * ```
138
- */
139
- create(params, options) {
140
- const { 'Idempotency-Key': idempotencyKey, ...body } = params;
141
- return this._client.post('/v3/messages', {
142
- body,
143
- ...options,
144
- headers: (0, headers_1.buildHeaders)([
145
- { ...(idempotencyKey != null ? { 'Idempotency-Key': idempotencyKey } : undefined) },
146
- options?.headers,
147
- ]),
148
- });
149
- }
150
- /**
151
- * Retrieve a specific message by its ID. This endpoint returns the full message
152
- * details including text, attachments, reactions, and metadata.
153
- *
154
- * @example
155
- * ```ts
156
- * const message = await client.messages.retrieve(
157
- * '69a37c7d-af4f-4b5e-af42-e28e98ce873a',
158
- * );
159
- * ```
160
- */
161
- retrieve(messageID, options) {
162
- return this._client.get((0, path_1.path) `/v3/messages/${messageID}`, options);
163
- }
164
- /**
165
- * Edit the text content of a specific part of a previously sent message.
166
- *
167
- * **Note:** A message can be edited up to 5 times, and only within 15 minutes of
168
- * when it was originally sent.
169
- *
170
- * @example
171
- * ```ts
172
- * const message = await client.messages.update(
173
- * '69a37c7d-af4f-4b5e-af42-e28e98ce873a',
174
- * { text: 'This is the edited message content' },
175
- * );
176
- * ```
177
- */
178
- update(messageID, body, options) {
179
- return this._client.patch((0, path_1.path) `/v3/messages/${messageID}`, { body, ...options });
180
- }
181
- /**
182
- * Deletes a message from the Linq API only. This does NOT unsend or remove the
183
- * message from the actual chat — recipients will still see the message. Re-sending
184
- * with a deleted message's idempotency key returns 404 — a deleted message is
185
- * never resent.
186
- *
187
- * @example
188
- * ```ts
189
- * await client.messages.delete(
190
- * '69a37c7d-af4f-4b5e-af42-e28e98ce873a',
191
- * );
192
- * ```
193
- */
194
- delete(messageID, options) {
195
- return this._client.delete((0, path_1.path) `/v3/messages/${messageID}`, {
196
- ...options,
197
- headers: (0, headers_1.buildHeaders)([{ Accept: '*/*' }, options?.headers]),
198
- });
199
- }
200
- /**
201
- * Add or remove emoji reactions to messages. Reactions let users express their
202
- * response to a message without sending a new message.
203
- *
204
- * **Supported Reactions:**
205
- *
206
- * - love ❤️
207
- * - like 👍
208
- * - dislike 👎
209
- * - laugh 😂
210
- * - emphasize ‼️
211
- * - question ❓
212
- * - custom - any emoji (use `custom_emoji` field to specify)
213
- *
214
- * @example
215
- * ```ts
216
- * const response = await client.messages.addReaction(
217
- * '69a37c7d-af4f-4b5e-af42-e28e98ce873a',
218
- * { operation: 'add', type: 'love' },
219
- * );
220
- * ```
221
- */
222
- addReaction(messageID, body, options) {
223
- return this._client.post((0, path_1.path) `/v3/messages/${messageID}/reactions`, { body, ...options });
224
- }
225
- /**
226
- * Retrieve all messages in a conversation thread. Given any message ID in the
227
- * thread, returns the originator message and all replies in chronological order.
228
- *
229
- * If the message is not part of a thread, returns just that single message.
230
- *
231
- * Supports pagination and configurable ordering.
232
- *
233
- * @example
234
- * ```ts
235
- * // Automatically fetches more pages as needed.
236
- * for await (const message of client.messages.listMessagesThread(
237
- * '69a37c7d-af4f-4b5e-af42-e28e98ce873a',
238
- * )) {
239
- * // ...
240
- * }
241
- * ```
242
- */
243
- listMessagesThread(messageID, query = {}, options) {
244
- return this._client.getAPIList((0, path_1.path) `/v3/messages/${messageID}/thread`, (pagination_1.ListMessagesPagination), {
245
- query,
246
- ...options,
247
- });
248
- }
249
- /**
250
- * Replaces a previously delivered `imessage_app` card on the recipient's screen
251
- * with new content, instead of posting a new bubble (like a game move redrawing
252
- * the board).
253
- *
254
- * The update is delivered as a **new message** with its own id and delivery
255
- * lifecycle (`message.sent` / `message.delivered` / `message.failed` webhooks fire
256
- * for the new id). To update the card again, reference the message id returned by
257
- * this call.
258
- *
259
- * Constraints:
260
- *
261
- * - The referenced message must be an `imessage_app` card sent by you (`400`
262
- * otherwise — inbound cards cannot be updated).
263
- * - The referenced card must already be delivered (`409` otherwise — retry after
264
- * the `message.delivered` webhook for it).
265
- * - The app identity (`team_id`, `bundle_id`, name) is inherited from the original
266
- * card and cannot change; only `url`, `fallback_text`, and `layout` are
267
- * replaced.
268
- * - iMessage-only, like all app cards.
269
- * - Concurrent updates against the same card are not serialized server-side; the
270
- * last one delivered wins on the recipient's screen. Serialize updates by always
271
- * referencing the message id returned by the previous call.
272
- *
273
- * @example
274
- * ```ts
275
- * const response = await client.messages.updateAppCard(
276
- * '69a37c7d-af4f-4b5e-af42-e28e98ce873a',
277
- * {
278
- * layout: { caption: 'Score: 2 – 1' },
279
- * fallback_text: 'Score update',
280
- * url: 'https://app.example.com/card?game=7f3a&move=2',
281
- * },
282
- * );
283
- * ```
284
- */
285
- updateAppCard(messageID, body, options) {
286
- return this._client.post((0, path_1.path) `/v3/messages/${messageID}/update`, { body, ...options });
287
- }
288
- }
289
- exports.Messages = Messages;
4
+ const tslib_1 = require("../internal/tslib.js");
5
+ tslib_1.__exportStar(require("./messages/index.js"), exports);
290
6
  //# sourceMappingURL=messages.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"messages.js","sourceRoot":"","sources":["../src/resources/messages.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAK/C,sDAA4G;AAC5G,oDAAmD;AAEnD,oDAA8C;AAE9C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2DG;AACH,MAAa,QAAS,SAAQ,sBAAW;IACvC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAoEG;IACH,MAAM,CAAC,MAA2B,EAAE,OAAwB;QAC1D,MAAM,EAAE,iBAAiB,EAAE,cAAc,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM,CAAC;QAC9D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,cAAc,EAAE;YACvC,IAAI;YACJ,GAAG,OAAO;YACV,OAAO,EAAE,IAAA,sBAAY,EAAC;gBACpB,EAAE,GAAG,CAAC,cAAc,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,iBAAiB,EAAE,cAAc,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,EAAE;gBACnF,OAAO,EAAE,OAAO;aACjB,CAAC;SACH,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;OAUG;IACH,QAAQ,CAAC,SAAiB,EAAE,OAAwB;QAClD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,gBAAgB,SAAS,EAAE,EAAE,OAAO,CAAC,CAAC;IACpE,CAAC;IAED;;;;;;;;;;;;;OAaG;IACH,MAAM,CAAC,SAAiB,EAAE,IAAyB,EAAE,OAAwB;QAC3E,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,IAAA,WAAI,EAAA,gBAAgB,SAAS,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CA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1,3 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
- import { APIResource } from "../core/resource.mjs";
3
- import { ListMessagesPagination } from "../core/pagination.mjs";
4
- import { buildHeaders } from "../internal/headers.mjs";
5
- import { path } from "../internal/utils/path.mjs";
6
- /**
7
- * Messages are individual communications within a chat thread.
8
- *
9
- * Messages can include text, media attachments, rich link previews, special effects
10
- * (like confetti or fireworks), and reactions. All messages are associated with a
11
- * specific chat and sent from a phone number you own.
12
- *
13
- * Messages support delivery status tracking, read receipts, and editing capabilities.
14
- *
15
- * ## Rich Link Previews
16
- *
17
- * Send a URL as a `link` part to deliver it with a rich preview card showing the
18
- * page's title, description, and image (when available). A `link` part must be the
19
- * **only** part in the message — it cannot be combined with text or media parts.
20
- * To send a URL without a preview card, include it in a `text` part instead.
21
- *
22
- * **Limitations:**
23
- * - A `link` part cannot be combined with other parts in the same message.
24
- * - Maximum URL length: 2,048 characters.
25
- *
26
- * ## Ephemeral Messages (Privacy Tier)
27
- *
28
- * 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.
29
- *
30
- * You can request it at two scopes:
31
- *
32
- * | Scope | Effect |
33
- * |---|---|
34
- * | **Partner-wide** | Every outbound and inbound message on every phone number under your account is retained for 24 hours, then deleted. |
35
- * | **Per phone number** | Only the specified phone numbers have their messages auto-deleted. The rest follow the standard message-retention policy. |
36
- *
37
- * **Behavioral differences vs the standard default:**
38
- *
39
- * | Aspect | Standard | Ephemeral |
40
- * |---|---|---|
41
- * | Retention | Retained per the standard message-retention policy | **Hard backstop: 24 hours** from when the message is created |
42
- * | 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` |
43
- * | Content on expiry | N/A | Text, formatting, and attachment references are scrubbed; the message is gone, not blanked out |
44
- * | Cross-partner isolation | Enforced | Enforced |
45
- *
46
- * **How the 24-hour window works:**
47
- *
48
- * - The window is fixed at **24 hours from message creation** (`created_at`) and cannot be configured per message.
49
- * - It mirrors the ephemeral *attachments* 1-day backstop, so a message and any media it carries expire together.
50
- * - Expiry is delivery-independent — the clock starts when the message is created, not when it is delivered or read.
51
- *
52
- * **What you observe:**
53
- *
54
- * - **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.
55
- * - **No deletion webhook is sent.** There is no `message.deleted` event — a message simply stops being retrievable once its window passes.
56
- * - **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.
57
- *
58
- * **When to choose ephemeral:**
59
- *
60
- * - You have a compliance requirement that the platform must not retain message content beyond a short window.
61
- * - The conversation is high-sensitivity (PHI, financial, identity verification) and you do not want it sitting in storage long-term.
62
- * - 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.
63
- *
64
- * **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.
65
- */
66
- export class Messages extends APIResource {
67
- /**
68
- * Send a message to one or more recipients **without supplying a `from` number**.
69
- * Linq resolves both the sending line and the target chat for you, then returns
70
- * exactly which line was used, which chat the message landed in, whether a new
71
- * chat was created, and every resulting message id.
72
- *
73
- * This fuses "create chat" and "send message" behind a single message-centric
74
- * resource. Provide only the recipients (`to`) and the `message`; the platform
75
- * decides the rest.
76
- *
77
- * ## How the from-number and chat are chosen
78
- *
79
- * - **Reuse** — if a chat with exactly these recipients already exists on a line
80
- * that can still send, the message is sent into that chat on its existing line
81
- * (`from_selection.reason = reused_active_chat`). The most-recently-active such
82
- * chat wins; chats stranded on flagged lines (e.g. by an earlier failover) are
83
- * skipped.
84
- * - **New** — if no such chat exists, a new chat is created on the best available
85
- * line (`from_selection.reason = new_best_number`).
86
- * - **Failover** — if matching chats exist but none is on a line that can send, a
87
- * **new** chat is created on a fresh best line and the flagged chat is abandoned
88
- * (`from_selection.reason = failover_flagged`, `previous_chat_id` set). If you
89
- * supply `continuation_message`, that text is sent as the single message INSTEAD
90
- * of `message` (useful as a fresh-number-appropriate opener). Exactly one
91
- * message is sent either way.
92
- *
93
- * Recipients (`to`) are an order-independent set: a single handle is a direct
94
- * chat, multiple handles a group chat.
95
- *
96
- * ## Excluding lines
97
- *
98
- * `exclude_from` keeps specific lines out of **this** send's line pick. It only
99
- * affects picking a line for a new chat — an existing chat is always reused on its
100
- * own line, preferring a chat on a non-excluded line when the recipients have more
101
- * than one. An exclusion never abandons a live chat or moves it to a new number,
102
- * so if the only chat these recipients have is on an excluded line, that chat is
103
- * still used. `from` tells you the line that was actually used.
104
- *
105
- * ## Differences from POST /v3/chats
106
- *
107
- * - The first message **may contain a link** (including for a newly created chat).
108
- * Note: sending a link as the very first message on a freshly selected line can
109
- * elevate that line's flagging risk — it is allowed, not recommended.
110
- * - Voice memos are **not** supported here. To send an iMessage voice-memo bubble,
111
- * use `POST /v3/chats/{chatId}/voicememo` with a known chat id.
112
- *
113
- * ## Service preference, effects, decorations
114
- *
115
- * Set `message.preferred_service` (`iMessage` | `RCS` | `SMS`), `message.effect`,
116
- * and per-part `text_decorations` exactly as on the other send endpoints.
117
- *
118
- * Always responds `202 Accepted` — chat creation is incidental to the send.
119
- *
120
- * @example
121
- * ```ts
122
- * const message = await client.messages.create({
123
- * message: {
124
- * parts: [
125
- * {
126
- * type: 'text',
127
- * value:
128
- * 'Hi! Thanks for reaching out — how can we help?',
129
- * },
130
- * ],
131
- * },
132
- * to: ['+14155559876'],
133
- * });
134
- * ```
135
- */
136
- create(params, options) {
137
- const { 'Idempotency-Key': idempotencyKey, ...body } = params;
138
- return this._client.post('/v3/messages', {
139
- body,
140
- ...options,
141
- headers: buildHeaders([
142
- { ...(idempotencyKey != null ? { 'Idempotency-Key': idempotencyKey } : undefined) },
143
- options?.headers,
144
- ]),
145
- });
146
- }
147
- /**
148
- * Retrieve a specific message by its ID. This endpoint returns the full message
149
- * details including text, attachments, reactions, and metadata.
150
- *
151
- * @example
152
- * ```ts
153
- * const message = await client.messages.retrieve(
154
- * '69a37c7d-af4f-4b5e-af42-e28e98ce873a',
155
- * );
156
- * ```
157
- */
158
- retrieve(messageID, options) {
159
- return this._client.get(path `/v3/messages/${messageID}`, options);
160
- }
161
- /**
162
- * Edit the text content of a specific part of a previously sent message.
163
- *
164
- * **Note:** A message can be edited up to 5 times, and only within 15 minutes of
165
- * when it was originally sent.
166
- *
167
- * @example
168
- * ```ts
169
- * const message = await client.messages.update(
170
- * '69a37c7d-af4f-4b5e-af42-e28e98ce873a',
171
- * { text: 'This is the edited message content' },
172
- * );
173
- * ```
174
- */
175
- update(messageID, body, options) {
176
- return this._client.patch(path `/v3/messages/${messageID}`, { body, ...options });
177
- }
178
- /**
179
- * Deletes a message from the Linq API only. This does NOT unsend or remove the
180
- * message from the actual chat — recipients will still see the message. Re-sending
181
- * with a deleted message's idempotency key returns 404 — a deleted message is
182
- * never resent.
183
- *
184
- * @example
185
- * ```ts
186
- * await client.messages.delete(
187
- * '69a37c7d-af4f-4b5e-af42-e28e98ce873a',
188
- * );
189
- * ```
190
- */
191
- delete(messageID, options) {
192
- return this._client.delete(path `/v3/messages/${messageID}`, {
193
- ...options,
194
- headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
195
- });
196
- }
197
- /**
198
- * Add or remove emoji reactions to messages. Reactions let users express their
199
- * response to a message without sending a new message.
200
- *
201
- * **Supported Reactions:**
202
- *
203
- * - love ❤️
204
- * - like 👍
205
- * - dislike 👎
206
- * - laugh 😂
207
- * - emphasize ‼️
208
- * - question ❓
209
- * - custom - any emoji (use `custom_emoji` field to specify)
210
- *
211
- * @example
212
- * ```ts
213
- * const response = await client.messages.addReaction(
214
- * '69a37c7d-af4f-4b5e-af42-e28e98ce873a',
215
- * { operation: 'add', type: 'love' },
216
- * );
217
- * ```
218
- */
219
- addReaction(messageID, body, options) {
220
- return this._client.post(path `/v3/messages/${messageID}/reactions`, { body, ...options });
221
- }
222
- /**
223
- * Retrieve all messages in a conversation thread. Given any message ID in the
224
- * thread, returns the originator message and all replies in chronological order.
225
- *
226
- * If the message is not part of a thread, returns just that single message.
227
- *
228
- * Supports pagination and configurable ordering.
229
- *
230
- * @example
231
- * ```ts
232
- * // Automatically fetches more pages as needed.
233
- * for await (const message of client.messages.listMessagesThread(
234
- * '69a37c7d-af4f-4b5e-af42-e28e98ce873a',
235
- * )) {
236
- * // ...
237
- * }
238
- * ```
239
- */
240
- listMessagesThread(messageID, query = {}, options) {
241
- return this._client.getAPIList(path `/v3/messages/${messageID}/thread`, (ListMessagesPagination), {
242
- query,
243
- ...options,
244
- });
245
- }
246
- /**
247
- * Replaces a previously delivered `imessage_app` card on the recipient's screen
248
- * with new content, instead of posting a new bubble (like a game move redrawing
249
- * the board).
250
- *
251
- * The update is delivered as a **new message** with its own id and delivery
252
- * lifecycle (`message.sent` / `message.delivered` / `message.failed` webhooks fire
253
- * for the new id). To update the card again, reference the message id returned by
254
- * this call.
255
- *
256
- * Constraints:
257
- *
258
- * - The referenced message must be an `imessage_app` card sent by you (`400`
259
- * otherwise — inbound cards cannot be updated).
260
- * - The referenced card must already be delivered (`409` otherwise — retry after
261
- * the `message.delivered` webhook for it).
262
- * - The app identity (`team_id`, `bundle_id`, name) is inherited from the original
263
- * card and cannot change; only `url`, `fallback_text`, and `layout` are
264
- * replaced.
265
- * - iMessage-only, like all app cards.
266
- * - Concurrent updates against the same card are not serialized server-side; the
267
- * last one delivered wins on the recipient's screen. Serialize updates by always
268
- * referencing the message id returned by the previous call.
269
- *
270
- * @example
271
- * ```ts
272
- * const response = await client.messages.updateAppCard(
273
- * '69a37c7d-af4f-4b5e-af42-e28e98ce873a',
274
- * {
275
- * layout: { caption: 'Score: 2 – 1' },
276
- * fallback_text: 'Score update',
277
- * url: 'https://app.example.com/card?game=7f3a&move=2',
278
- * },
279
- * );
280
- * ```
281
- */
282
- updateAppCard(messageID, body, options) {
283
- return this._client.post(path `/v3/messages/${messageID}/update`, { body, ...options });
284
- }
285
- }
2
+ export * from "./messages/index.mjs";
286
3
  //# sourceMappingURL=messages.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"messages.mjs","sourceRoot":"","sources":["../src/resources/messages.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,6BAAyB;AAK/C,OAAO,EAAE,sBAAsB,EAAkD,+BAA2B;AAC5G,OAAO,EAAE,YAAY,EAAE,gCAA4B;AAEnD,OAAO,EAAE,IAAI,EAAE,mCAA+B;AAE9C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2DG;AACH,MAAM,OAAO,QAAS,SAAQ,WAAW;IACvC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAoEG;IACH,MAAM,CAAC,MAA2B,EAAE,OAAwB;QAC1D,MAAM,EAAE,iBAAiB,EAAE,cAAc,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM,CAAC;QAC9D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,cAAc,EAAE;YACvC,IAAI;YACJ,GAAG,OAAO;YACV,OAAO,EAAE,YAAY,CAAC;gBACpB,EAAE,GAAG,CAAC,cAAc,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,iBAAiB,EAAE,cAAc,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,EAAE;gBACnF,OAAO,EAAE,OAAO;aACjB,CAAC;SACH,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;OAUG;IACH,QAAQ,CAAC,SAAiB,EAAE,OAAwB;QAClD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,gBAA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gBAAgB,SAAS,SAAS,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACzF,CAAC;CACF"}
1
+ {"version":3,"file":"messages.mjs","sourceRoot":"","sources":["../src/resources/messages.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,qCAAiC"}
@@ -144,7 +144,7 @@ export declare class WebhookEvents extends APIResource {
144
144
  * `webhook_version: "2026-02-03"`. Subscribing to this event on a v2025
145
145
  * subscription will not produce any deliveries.
146
146
  */
147
- export type WebhookEventType = 'message.sent' | 'message.received' | 'message.read' | 'message.delivered' | 'message.failed' | 'message.edited' | 'reaction.added' | 'reaction.removed' | 'participant.added' | 'participant.removed' | 'chat.created' | 'chat.group_name_updated' | 'chat.group_icon_updated' | 'chat.group_name_update_failed' | 'chat.group_icon_update_failed' | 'chat.background_updated' | 'chat.typing_indicator.started' | 'chat.typing_indicator.stopped' | 'phone_number.status_updated' | 'call.initiated' | 'call.ringing' | 'call.answered' | 'call.ended' | 'call.failed' | 'call.declined' | 'call.no_answer' | 'location.sharing.started' | 'location.sharing.stopped' | 'payment.succeeded' | 'payment.canceled' | 'payment.expired' | 'payment.declined' | 'payment.authorized' | 'connection.created' | 'connection.revoked';
147
+ export type WebhookEventType = 'message.sent' | 'message.received' | 'message.read' | 'message.delivered' | 'message.failed' | 'message.edited' | 'reaction.added' | 'reaction.removed' | 'poll.received' | 'poll.failed' | 'poll.sent' | 'poll.delivered' | 'poll.read' | 'poll.updated' | 'poll.vote.added' | 'poll.vote.removed' | 'poll.reaction.added' | 'participant.added' | 'participant.removed' | 'chat.created' | 'chat.group_name_updated' | 'chat.group_icon_updated' | 'chat.group_name_update_failed' | 'chat.group_icon_update_failed' | 'chat.background_updated' | 'chat.typing_indicator.started' | 'chat.typing_indicator.stopped' | 'phone_number.status_updated' | 'call.initiated' | 'call.ringing' | 'call.answered' | 'call.ended' | 'call.failed' | 'call.declined' | 'call.no_answer' | 'location.sharing.started' | 'location.sharing.stopped' | 'payment.succeeded' | 'payment.canceled' | 'payment.expired' | 'payment.declined' | 'payment.authorized' | 'connection.created' | 'connection.revoked';
148
148
  export interface WebhookEventListResponse {
149
149
  /**
150
150
  * URL to the webhook events documentation
@@ -1 +1 @@
1
- {"version":3,"file":"webhook-events.d.mts","sourceRoot":"","sources":["../src/resources/webhook-events.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,6BAAyB;AAC/C,OAAO,EAAE,UAAU,EAAE,gCAA4B;AACjD,OAAO,EAAE,cAAc,EAAE,wCAAoC;AAE7D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+HG;AACH,qBAAa,aAAc,SAAQ,WAAW;IAC5C;;;;OAIG;IACH,IAAI,CAAC,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,wBAAwB,CAAC;CAGrE;AAED;;;;;;GAMG;AACH,MAAM,MAAM,gBAAgB,GACxB,cAAc,GACd,kBAAkB,GAClB,cAAc,GACd,mBAAmB,GACnB,gBAAgB,GAChB,gBAAgB,GAChB,gBAAgB,GAChB,kBAAkB,GAClB,mBAAmB,GACnB,qBAAqB,GACrB,cAAc,GACd,yBAAyB,GACzB,yBAAyB,GACzB,+BAA+B,GAC/B,+BAA+B,GAC/B,yBAAyB,GACzB,+BAA+B,GAC/B,+BAA+B,GAC/B,6BAA6B,GAC7B,gBAAgB,GAChB,cAAc,GACd,eAAe,GACf,YAAY,GACZ,aAAa,GACb,eAAe,GACf,gBAAgB,GAChB,0BAA0B,GAC1B,0BAA0B,GAC1B,mBAAmB,GACnB,kBAAkB,GAClB,iBAAiB,GACjB,kBAAkB,GAClB,oBAAoB,GACpB,oBAAoB,GACpB,oBAAoB,CAAC;AAEzB,MAAM,WAAW,wBAAwB;IACvC;;OAEG;IACH,OAAO,EAAE,iDAAiD,CAAC;IAE3D;;OAEG;IACH,MAAM,EAAE,KAAK,CAAC,gBAAgB,CAAC,CAAC;CACjC;AAED,MAAM,CAAC,OAAO,WAAW,aAAa,CAAC;IACrC,OAAO,EACL,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,wBAAwB,IAAI,wBAAwB,GAC1D,CAAC;CACH"}
1
+ {"version":3,"file":"webhook-events.d.mts","sourceRoot":"","sources":["../src/resources/webhook-events.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,6BAAyB;AAC/C,OAAO,EAAE,UAAU,EAAE,gCAA4B;AACjD,OAAO,EAAE,cAAc,EAAE,wCAAoC;AAE7D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+HG;AACH,qBAAa,aAAc,SAAQ,WAAW;IAC5C;;;;OAIG;IACH,IAAI,CAAC,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,wBAAwB,CAAC;CAGrE;AAED;;;;;;GAMG;AACH,MAAM,MAAM,gBAAgB,GACxB,cAAc,GACd,kBAAkB,GAClB,cAAc,GACd,mBAAmB,GACnB,gBAAgB,GAChB,gBAAgB,GAChB,gBAAgB,GAChB,kBAAkB,GAClB,eAAe,GACf,aAAa,GACb,WAAW,GACX,gBAAgB,GAChB,WAAW,GACX,cAAc,GACd,iBAAiB,GACjB,mBAAmB,GACnB,qBAAqB,GACrB,mBAAmB,GACnB,qBAAqB,GACrB,cAAc,GACd,yBAAyB,GACzB,yBAAyB,GACzB,+BAA+B,GAC/B,+BAA+B,GAC/B,yBAAyB,GACzB,+BAA+B,GAC/B,+BAA+B,GAC/B,6BAA6B,GAC7B,gBAAgB,GAChB,cAAc,GACd,eAAe,GACf,YAAY,GACZ,aAAa,GACb,eAAe,GACf,gBAAgB,GAChB,0BAA0B,GAC1B,0BAA0B,GAC1B,mBAAmB,GACnB,kBAAkB,GAClB,iBAAiB,GACjB,kBAAkB,GAClB,oBAAoB,GACpB,oBAAoB,GACpB,oBAAoB,CAAC;AAEzB,MAAM,WAAW,wBAAwB;IACvC;;OAEG;IACH,OAAO,EAAE,iDAAiD,CAAC;IAE3D;;OAEG;IACH,MAAM,EAAE,KAAK,CAAC,gBAAgB,CAAC,CAAC;CACjC;AAED,MAAM,CAAC,OAAO,WAAW,aAAa,CAAC;IACrC,OAAO,EACL,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,wBAAwB,IAAI,wBAAwB,GAC1D,CAAC;CACH"}
@@ -144,7 +144,7 @@ export declare class WebhookEvents extends APIResource {
144
144
  * `webhook_version: "2026-02-03"`. Subscribing to this event on a v2025
145
145
  * subscription will not produce any deliveries.
146
146
  */
147
- export type WebhookEventType = 'message.sent' | 'message.received' | 'message.read' | 'message.delivered' | 'message.failed' | 'message.edited' | 'reaction.added' | 'reaction.removed' | 'participant.added' | 'participant.removed' | 'chat.created' | 'chat.group_name_updated' | 'chat.group_icon_updated' | 'chat.group_name_update_failed' | 'chat.group_icon_update_failed' | 'chat.background_updated' | 'chat.typing_indicator.started' | 'chat.typing_indicator.stopped' | 'phone_number.status_updated' | 'call.initiated' | 'call.ringing' | 'call.answered' | 'call.ended' | 'call.failed' | 'call.declined' | 'call.no_answer' | 'location.sharing.started' | 'location.sharing.stopped' | 'payment.succeeded' | 'payment.canceled' | 'payment.expired' | 'payment.declined' | 'payment.authorized' | 'connection.created' | 'connection.revoked';
147
+ export type WebhookEventType = 'message.sent' | 'message.received' | 'message.read' | 'message.delivered' | 'message.failed' | 'message.edited' | 'reaction.added' | 'reaction.removed' | 'poll.received' | 'poll.failed' | 'poll.sent' | 'poll.delivered' | 'poll.read' | 'poll.updated' | 'poll.vote.added' | 'poll.vote.removed' | 'poll.reaction.added' | 'participant.added' | 'participant.removed' | 'chat.created' | 'chat.group_name_updated' | 'chat.group_icon_updated' | 'chat.group_name_update_failed' | 'chat.group_icon_update_failed' | 'chat.background_updated' | 'chat.typing_indicator.started' | 'chat.typing_indicator.stopped' | 'phone_number.status_updated' | 'call.initiated' | 'call.ringing' | 'call.answered' | 'call.ended' | 'call.failed' | 'call.declined' | 'call.no_answer' | 'location.sharing.started' | 'location.sharing.stopped' | 'payment.succeeded' | 'payment.canceled' | 'payment.expired' | 'payment.declined' | 'payment.authorized' | 'connection.created' | 'connection.revoked';
148
148
  export interface WebhookEventListResponse {
149
149
  /**
150
150
  * URL to the webhook events documentation
@@ -1 +1 @@
1
- {"version":3,"file":"webhook-events.d.ts","sourceRoot":"","sources":["../src/resources/webhook-events.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,4BAAyB;AAC/C,OAAO,EAAE,UAAU,EAAE,+BAA4B;AACjD,OAAO,EAAE,cAAc,EAAE,uCAAoC;AAE7D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+HG;AACH,qBAAa,aAAc,SAAQ,WAAW;IAC5C;;;;OAIG;IACH,IAAI,CAAC,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,wBAAwB,CAAC;CAGrE;AAED;;;;;;GAMG;AACH,MAAM,MAAM,gBAAgB,GACxB,cAAc,GACd,kBAAkB,GAClB,cAAc,GACd,mBAAmB,GACnB,gBAAgB,GAChB,gBAAgB,GAChB,gBAAgB,GAChB,kBAAkB,GAClB,mBAAmB,GACnB,qBAAqB,GACrB,cAAc,GACd,yBAAyB,GACzB,yBAAyB,GACzB,+BAA+B,GAC/B,+BAA+B,GAC/B,yBAAyB,GACzB,+BAA+B,GAC/B,+BAA+B,GAC/B,6BAA6B,GAC7B,gBAAgB,GAChB,cAAc,GACd,eAAe,GACf,YAAY,GACZ,aAAa,GACb,eAAe,GACf,gBAAgB,GAChB,0BAA0B,GAC1B,0BAA0B,GAC1B,mBAAmB,GACnB,kBAAkB,GAClB,iBAAiB,GACjB,kBAAkB,GAClB,oBAAoB,GACpB,oBAAoB,GACpB,oBAAoB,CAAC;AAEzB,MAAM,WAAW,wBAAwB;IACvC;;OAEG;IACH,OAAO,EAAE,iDAAiD,CAAC;IAE3D;;OAEG;IACH,MAAM,EAAE,KAAK,CAAC,gBAAgB,CAAC,CAAC;CACjC;AAED,MAAM,CAAC,OAAO,WAAW,aAAa,CAAC;IACrC,OAAO,EACL,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,wBAAwB,IAAI,wBAAwB,GAC1D,CAAC;CACH"}
1
+ {"version":3,"file":"webhook-events.d.ts","sourceRoot":"","sources":["../src/resources/webhook-events.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,4BAAyB;AAC/C,OAAO,EAAE,UAAU,EAAE,+BAA4B;AACjD,OAAO,EAAE,cAAc,EAAE,uCAAoC;AAE7D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+HG;AACH,qBAAa,aAAc,SAAQ,WAAW;IAC5C;;;;OAIG;IACH,IAAI,CAAC,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,wBAAwB,CAAC;CAGrE;AAED;;;;;;GAMG;AACH,MAAM,MAAM,gBAAgB,GACxB,cAAc,GACd,kBAAkB,GAClB,cAAc,GACd,mBAAmB,GACnB,gBAAgB,GAChB,gBAAgB,GAChB,gBAAgB,GAChB,kBAAkB,GAClB,eAAe,GACf,aAAa,GACb,WAAW,GACX,gBAAgB,GAChB,WAAW,GACX,cAAc,GACd,iBAAiB,GACjB,mBAAmB,GACnB,qBAAqB,GACrB,mBAAmB,GACnB,qBAAqB,GACrB,cAAc,GAC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