@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,8 +1,8 @@
1
1
  import { APIResource } from "../../core/resource.mjs";
2
- import * as MessagesAPI from "../messages.mjs";
3
- import { MessagesListMessagesPagination } from "../messages.mjs";
4
2
  import * as Shared from "../shared.mjs";
5
3
  import * as ChatsAPI from "./chats.mjs";
4
+ import * as ResourcesMessagesAPI from "../messages/messages.mjs";
5
+ import { MessagesListMessagesPagination } from "../messages/messages.mjs";
6
6
  import { APIPromise } from "../../core/api-promise.mjs";
7
7
  import { type ListMessagesPaginationParams, PagePromise } from "../../core/pagination.mjs";
8
8
  import { RequestOptions } from "../../internal/request-options.mjs";
@@ -80,7 +80,7 @@ export declare class Messages extends APIResource {
80
80
  * }
81
81
  * ```
82
82
  */
83
- list(chatID: string, query?: MessageListParams | null | undefined, options?: RequestOptions): PagePromise<MessagesListMessagesPagination, MessagesAPI.Message>;
83
+ list(chatID: string, query?: MessageListParams | null | undefined, options?: RequestOptions): PagePromise<MessagesListMessagesPagination, ResourcesMessagesAPI.Message>;
84
84
  /**
85
85
  * Send a message to an existing chat. Use this endpoint when you already have a
86
86
  * chat ID and want to send additional messages to it.
@@ -175,7 +175,7 @@ export interface SentMessage {
175
175
  /**
176
176
  * iMessage effect applied to a message (screen or bubble effect)
177
177
  */
178
- effect?: MessagesAPI.MessageEffect | null;
178
+ effect?: ResourcesMessagesAPI.MessageEffect | null;
179
179
  /**
180
180
  * The sender of this message as a full handle object
181
181
  */
@@ -187,7 +187,7 @@ export interface SentMessage {
187
187
  /**
188
188
  * Indicates this message is a threaded reply to another message
189
189
  */
190
- reply_to?: MessagesAPI.ReplyTo | null;
190
+ reply_to?: ResourcesMessagesAPI.ReplyTo | null;
191
191
  /**
192
192
  * Messaging service type
193
193
  */
@@ -340,6 +340,13 @@ export interface MessageSendParams {
340
340
  * cannot coexist with text), so copy and a card are two sends, not one.
341
341
  */
342
342
  message: ChatsAPI.MessageContent;
343
+ /**
344
+ * Send even though the recipient asked you to stop (`403`, error code `2024`).
345
+ * Applies to this request only: the opt-out stays in place, so the next send
346
+ * without this flag is rejected again. Every override is recorded against your API
347
+ * key.
348
+ */
349
+ override_optout?: boolean;
343
350
  }
344
351
  export declare namespace Messages {
345
352
  export { type SentMessage as SentMessage, type MessageSendResponse as MessageSendResponse, type MessageListParams as MessageListParams, type MessageSendParams as MessageSendParams, };
@@ -1 +1 @@
1
- {"version":3,"file":"messages.d.mts","sourceRoot":"","sources":["../../src/resources/chats/messages.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,gCAA4B;AAClD,OAAO,KAAK,WAAW,wBAAoB;AAC3C,OAAO,EAAE,8BAA8B,EAAE,wBAAoB;AAC7D,OAAO,KAAK,MAAM,sBAAkB;AACpC,OAAO,KAAK,QAAQ,oBAAgB;AACpC,OAAO,EAAE,UAAU,EAAE,mCAA+B;AACpD,OAAO,EAEL,KAAK,4BAA4B,EACjC,WAAW,EACZ,kCAA8B;A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CAAC;CACtB;AAED,MAAM,WAAW,iBAAkB,SAAQ,4BAA4B;CAAG;AAE1E,MAAM,WAAW,iBAAiB;IAChC;;;;;;;;;OASG;IACH,OAAO,EAAE,QAAQ,CAAC,cAAc,CAAC;IAEjC;;;;;OAKG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED,MAAM,CAAC,OAAO,WAAW,QAAQ,CAAC;IAChC,OAAO,EACL,KAAK,WAAW,IAAI,WAAW,EAC/B,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,iBAAiB,IAAI,iBAAiB,EAC3C,KAAK,iBAAiB,IAAI,iBAAiB,GAC5C,CAAC;CACH;AAED,OAAO,EAAE,KAAK,8BAA8B,EAAE,CAAC"}
@@ -1,8 +1,8 @@
1
1
  import { APIResource } from "../../core/resource.js";
2
- import * as MessagesAPI from "../messages.js";
3
- import { MessagesListMessagesPagination } from "../messages.js";
4
2
  import * as Shared from "../shared.js";
5
3
  import * as ChatsAPI from "./chats.js";
4
+ import * as ResourcesMessagesAPI from "../messages/messages.js";
5
+ import { MessagesListMessagesPagination } from "../messages/messages.js";
6
6
  import { APIPromise } from "../../core/api-promise.js";
7
7
  import { type ListMessagesPaginationParams, PagePromise } from "../../core/pagination.js";
8
8
  import { RequestOptions } from "../../internal/request-options.js";
@@ -80,7 +80,7 @@ export declare class Messages extends APIResource {
80
80
  * }
81
81
  * ```
82
82
  */
83
- list(chatID: string, query?: MessageListParams | null | undefined, options?: RequestOptions): PagePromise<MessagesListMessagesPagination, MessagesAPI.Message>;
83
+ list(chatID: string, query?: MessageListParams | null | undefined, options?: RequestOptions): PagePromise<MessagesListMessagesPagination, ResourcesMessagesAPI.Message>;
84
84
  /**
85
85
  * Send a message to an existing chat. Use this endpoint when you already have a
86
86
  * chat ID and want to send additional messages to it.
@@ -175,7 +175,7 @@ export interface SentMessage {
175
175
  /**
176
176
  * iMessage effect applied to a message (screen or bubble effect)
177
177
  */
178
- effect?: MessagesAPI.MessageEffect | null;
178
+ effect?: ResourcesMessagesAPI.MessageEffect | null;
179
179
  /**
180
180
  * The sender of this message as a full handle object
181
181
  */
@@ -187,7 +187,7 @@ export interface SentMessage {
187
187
  /**
188
188
  * Indicates this message is a threaded reply to another message
189
189
  */
190
- reply_to?: MessagesAPI.ReplyTo | null;
190
+ reply_to?: ResourcesMessagesAPI.ReplyTo | null;
191
191
  /**
192
192
  * Messaging service type
193
193
  */
@@ -340,6 +340,13 @@ export interface MessageSendParams {
340
340
  * cannot coexist with text), so copy and a card are two sends, not one.
341
341
  */
342
342
  message: ChatsAPI.MessageContent;
343
+ /**
344
+ * Send even though the recipient asked you to stop (`403`, error code `2024`).
345
+ * Applies to this request only: the opt-out stays in place, so the next send
346
+ * without this flag is rejected again. Every override is recorded against your API
347
+ * key.
348
+ */
349
+ override_optout?: boolean;
343
350
  }
344
351
  export declare namespace Messages {
345
352
  export { type SentMessage as SentMessage, type MessageSendResponse as MessageSendResponse, type MessageListParams as MessageListParams, type MessageSendParams as MessageSendParams, };
@@ -1 +1 @@
1
- {"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../src/resources/chats/messages.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,+BAA4B;AAClD,OAAO,KAAK,WAAW,uBAAoB;AAC3C,OAAO,EAAE,8BAA8B,EAAE,uBAAoB;AAC7D,OAAO,KAAK,MAAM,qBAAkB;AACpC,OAAO,KAAK,QAAQ,mBAAgB;AACpC,OAAO,EAAE,UAAU,EAAE,kCAA+B;AACpD,OAAO,EAEL,KAAK,4BAA4B,EACjC,WAAW,EACZ,iCAA8B;AAC/B,OAAO,EAAE,cAAc,EAAE,0CAAuC;AAGhE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2DG;AACH,qBAAa,QAAS,SAAQ,WAAW;IACvC;;;;;;;;;;;;OAYG;IACH,IAAI,CACF,MAAM,EAAE,MAAM,EACd,KAAK,GAAE,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O,WAAW,QAAQ,CAAC;IAChC,OAAO,EACL,KAAK,WAAW,IAAI,WAAW,EAC/B,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,iBAAiB,IAAI,iBAAiB,EAC3C,KAAK,iBAAiB,IAAI,iBAAiB,GAC5C,CAAC;CACH;AAED,OAAO,EAAE,KAAK,8BAA8B,EAAE,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"messages.js","sourceRoot":"","sources":["../../src/resources/chats/messages.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,qDAAkD;AAMlD,yDAI+B;AAE/B,uDAAiD;AAEjD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2DG;AACH,MAAa,QAAS,SAAQ,sBAAW;IACvC;;;;;;;;;;;;OAYG;IACH,IAAI,CACF,MAAc,EACd,QAA8C,EAAE,EAChD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAC5B,IAAA,WAAI,EAAA,aAAa,MAAM,WAAW,EAClC,CAAA,mCAA2C,CAAA,EAC3C,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CACtB,CAAC;IACJ,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAuDG;IACH,IAAI,CAAC,MAAc,EAAE,IAAuB,EAAE,OAAwB;QACpE,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAA,WAAI,EAAA,aAAa,MAAM,WAAW,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACrF,CAAC;CACF;AArFD,4BAqFC"}
1
+ {"version":3,"file":"messages.js","sourceRoot":"","sources":["../../src/resources/chats/messages.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,qDAAkD;AAMlD,yDAI+B;AAE/B,uDAAiD;AAEjD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAuDG;IACH,IAAI,CAAC,MAAc,EAAE,IAAuB,EAAE,OAAwB;QACpE,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAA,aAAa,MAAM,WAAW,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACrF,CAAC;CACF"}
1
+ {"version":3,"file":"messages.mjs","sourceRoot":"","sources":["../../src/resources/chats/messages.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,gCAA4B;AAMlD,OAAO,EACL,sBAAsB,GAGvB,kCAA8B;AAE/B,OAAO,EAAE,IAAI,EAAE,sCAAkC;AAEjD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2DG;AACH,MAAM,OAAO,QAAS,SAAQ,WAAW;IACvC;;;;;;;;;;;;OAYG;IACH,IAAI,CACF,MAAc,EACd,QAA8C,EAAE,EAChD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAC5B,IAAI,CAAA,aAAa,MAAM,WAAW,EAClC,CAAA,sBAAoD,CAAA,EACpD,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CACtB,CAAC;IACJ,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAuDG;IACH,IAAI,CAAC,MAAc,EAAE,IAAuB,EAAE,OAAwB;QACpE,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAA,aAAa,MAAM,WAAW,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACrF,CAAC;CACF"}
@@ -0,0 +1,171 @@
1
+ import { APIResource } from "../../core/resource.mjs";
2
+ import * as Shared from "../shared.mjs";
3
+ import { APIPromise } from "../../core/api-promise.mjs";
4
+ import { RequestOptions } from "../../internal/request-options.mjs";
5
+ /**
6
+ * Messages are individual communications within a chat thread.
7
+ *
8
+ * Messages can include text, media attachments, rich link previews, special effects
9
+ * (like confetti or fireworks), and reactions. All messages are associated with a
10
+ * specific chat and sent from a phone number you own.
11
+ *
12
+ * Messages support delivery status tracking, read receipts, and editing capabilities.
13
+ *
14
+ * ## Rich Link Previews
15
+ *
16
+ * Send a URL as a `link` part to deliver it with a rich preview card showing the
17
+ * page's title, description, and image (when available). A `link` part must be the
18
+ * **only** part in the message — it cannot be combined with text or media parts.
19
+ * To send a URL without a preview card, include it in a `text` part instead.
20
+ *
21
+ * **Limitations:**
22
+ * - A `link` part cannot be combined with other parts in the same message.
23
+ * - Maximum URL length: 2,048 characters.
24
+ *
25
+ * ## Ephemeral Messages (Privacy Tier)
26
+ *
27
+ * 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.
28
+ *
29
+ * You can request it at two scopes:
30
+ *
31
+ * | Scope | Effect |
32
+ * |---|---|
33
+ * | **Partner-wide** | Every outbound and inbound message on every phone number under your account is retained for 24 hours, then deleted. |
34
+ * | **Per phone number** | Only the specified phone numbers have their messages auto-deleted. The rest follow the standard message-retention policy. |
35
+ *
36
+ * **Behavioral differences vs the standard default:**
37
+ *
38
+ * | Aspect | Standard | Ephemeral |
39
+ * |---|---|---|
40
+ * | Retention | Retained per the standard message-retention policy | **Hard backstop: 24 hours** from when the message is created |
41
+ * | 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` |
42
+ * | Content on expiry | N/A | Text, formatting, and attachment references are scrubbed; the message is gone, not blanked out |
43
+ * | Cross-partner isolation | Enforced | Enforced |
44
+ *
45
+ * **How the 24-hour window works:**
46
+ *
47
+ * - The window is fixed at **24 hours from message creation** (`created_at`) and cannot be configured per message.
48
+ * - It mirrors the ephemeral *attachments* 1-day backstop, so a message and any media it carries expire together.
49
+ * - Expiry is delivery-independent — the clock starts when the message is created, not when it is delivered or read.
50
+ *
51
+ * **What you observe:**
52
+ *
53
+ * - **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.
54
+ * - **No deletion webhook is sent.** There is no `message.deleted` event — a message simply stops being retrievable once its window passes.
55
+ * - **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.
56
+ *
57
+ * **When to choose ephemeral:**
58
+ *
59
+ * - You have a compliance requirement that the platform must not retain message content beyond a short window.
60
+ * - The conversation is high-sensitivity (PHI, financial, identity verification) and you do not want it sitting in storage long-term.
61
+ * - 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.
62
+ *
63
+ * **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.
64
+ */
65
+ export declare class Polls extends APIResource {
66
+ /**
67
+ * Create an iMessage poll in an existing chat and send it. Polls are
68
+ * iMessage-only.
69
+ *
70
+ * The chat must already exist — **a poll cannot be the first message of a new
71
+ * chat** (use `POST /v3/chats` for that). Options are **add-only and immutable**:
72
+ * you can add options later via `POST /v3/messages/{messageId}/poll/options`, but
73
+ * never edit or remove them.
74
+ *
75
+ * @example
76
+ * ```ts
77
+ * const pollEnvelope = await client.chats.polls.create(
78
+ * '550e8400-e29b-41d4-a716-446655440000',
79
+ * {
80
+ * poll: {
81
+ * options: [{ text: 'Tacos' }, { text: 'Sushi' }],
82
+ * idempotency_key: 'poll-abc123',
83
+ * },
84
+ * },
85
+ * );
86
+ * ```
87
+ */
88
+ create(chatID: string, body: PollCreateParams, options?: RequestOptions): APIPromise<PollEnvelope>;
89
+ }
90
+ /**
91
+ * Poll content — options and the aggregate voter count.
92
+ */
93
+ export interface Poll {
94
+ options: Array<Poll.Option>;
95
+ /**
96
+ * Distinct participants across the whole poll (a voter picking two options counts
97
+ * once).
98
+ */
99
+ total_voters: number;
100
+ }
101
+ export declare namespace Poll {
102
+ interface Option {
103
+ can_be_edited: boolean;
104
+ /**
105
+ * The participant who added this option (poll creator for the initial options;
106
+ * whoever added later ones).
107
+ */
108
+ creator_handle: Shared.ChatHandle;
109
+ option_id: string;
110
+ text: string;
111
+ /**
112
+ * Participants who voted for this option (vote_count = voters.length).
113
+ */
114
+ voters: Array<Option.Voter>;
115
+ }
116
+ namespace Option {
117
+ interface Voter {
118
+ handle: string;
119
+ voted_at: string;
120
+ }
121
+ }
122
+ }
123
+ /**
124
+ * Message-level envelope returned by every poll endpoint.
125
+ */
126
+ export interface PollEnvelope {
127
+ chat_id: string;
128
+ created_at: string;
129
+ /**
130
+ * The poll-definition message's ID — reference this poll by it.
131
+ */
132
+ message_id: string;
133
+ /**
134
+ * Poll content — options and the aggregate voter count.
135
+ */
136
+ poll: Poll;
137
+ /**
138
+ * Tapbacks/stickers on the whole poll (message part 0).
139
+ */
140
+ reactions: Array<Shared.Reaction>;
141
+ updated_at: string;
142
+ }
143
+ export interface PollCreateParams {
144
+ /**
145
+ * Poll content to create. A poll needs at least two options. Options are add-only
146
+ * and immutable — there is no title/question (send that as a normal text message).
147
+ */
148
+ poll: PollCreateParams.Poll;
149
+ }
150
+ export declare namespace PollCreateParams {
151
+ /**
152
+ * Poll content to create. A poll needs at least two options. Options are add-only
153
+ * and immutable — there is no title/question (send that as a normal text message).
154
+ */
155
+ interface Poll {
156
+ options: Array<Poll.Option>;
157
+ /**
158
+ * Optional key to deduplicate the poll creation.
159
+ */
160
+ idempotency_key?: string;
161
+ }
162
+ namespace Poll {
163
+ interface Option {
164
+ text: string;
165
+ }
166
+ }
167
+ }
168
+ export declare namespace Polls {
169
+ export { type Poll as Poll, type PollEnvelope as PollEnvelope, type PollCreateParams as PollCreateParams };
170
+ }
171
+ //# sourceMappingURL=polls.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"polls.d.mts","sourceRoot":"","sources":["../../src/resources/chats/polls.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,gCAA4B;AAClD,OAAO,KAAK,MAAM,sBAAkB;AACpC,OAAO,EAAE,UAAU,EAAE,mCAA+B;AACpD,OAAO,EAAE,cAAc,EAAE,2CAAuC;AAGhE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2DG;AACH,qBAAa,KAAM,SAAQ,WAAW;IACpC;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,gBAAgB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,YAAY,CAAC;CAGnG;AAED;;GAEG;AACH,MAAM,WAAW,IAAI;IACnB,OAAO,EAAE,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAE5B;;;OAGG;IACH,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,yBAAiB,IAAI,CAAC;IACpB,UAAiB,MAAM;QACrB,aAAa,EAAE,OAAO,CAAC;QAEvB;;;WAGG;QACH,cAAc,EAAE,MAAM,CAAC,UAAU,CAAC;QAElC,SAAS,EAAE,MAAM,CAAC;QAElB,IAAI,EAAE,MAAM,CAAC;QAEb;;WAEG;QACH,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;KAC7B;IAED,UAAiB,MAAM,CAAC;QACtB,UAAiB,KAAK;YACpB,MAAM,EAAE,MAAM,CAAC;YAEf,QAAQ,EAAE,MAAM,CAAC;SAClB;KACF;CACF;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,MAAM,CAAC;IAEhB,UAAU,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,IAAI,EAAE,IAAI,CAAC;IAEX;;OAEG;IACH,SAAS,EAAE,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;IAElC,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,gBAAgB;IAC/B;;;OAGG;IACH,IAAI,EAAE,gBAAgB,CAAC,IAAI,CAAC;CAC7B;AAED,yBAAiB,gBAAgB,CAAC;IAChC;;;OAGG;IACH,UAAiB,IAAI;QACnB,OAAO,EAAE,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAE5B;;WAEG;QACH,eAAe,CAAC,EAAE,MAAM,CAAC;KAC1B;IAED,UAAiB,IAAI,CAAC;QACpB,UAAiB,MAAM;YACrB,IAAI,EAAE,MAAM,CAAC;SACd;KACF;CACF;AAED,MAAM,CAAC,OAAO,WAAW,KAAK,CAAC;IAC7B,OAAO,EAAE,KAAK,IAAI,IAAI,IAAI,EAAE,KAAK,YAAY,IAAI,YAAY,EAAE,KAAK,gBAAgB,IAAI,gBAAgB,EAAE,CAAC;CAC5G"}
@@ -0,0 +1,171 @@
1
+ import { APIResource } from "../../core/resource.js";
2
+ import * as Shared from "../shared.js";
3
+ import { APIPromise } from "../../core/api-promise.js";
4
+ import { RequestOptions } from "../../internal/request-options.js";
5
+ /**
6
+ * Messages are individual communications within a chat thread.
7
+ *
8
+ * Messages can include text, media attachments, rich link previews, special effects
9
+ * (like confetti or fireworks), and reactions. All messages are associated with a
10
+ * specific chat and sent from a phone number you own.
11
+ *
12
+ * Messages support delivery status tracking, read receipts, and editing capabilities.
13
+ *
14
+ * ## Rich Link Previews
15
+ *
16
+ * Send a URL as a `link` part to deliver it with a rich preview card showing the
17
+ * page's title, description, and image (when available). A `link` part must be the
18
+ * **only** part in the message — it cannot be combined with text or media parts.
19
+ * To send a URL without a preview card, include it in a `text` part instead.
20
+ *
21
+ * **Limitations:**
22
+ * - A `link` part cannot be combined with other parts in the same message.
23
+ * - Maximum URL length: 2,048 characters.
24
+ *
25
+ * ## Ephemeral Messages (Privacy Tier)
26
+ *
27
+ * 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.
28
+ *
29
+ * You can request it at two scopes:
30
+ *
31
+ * | Scope | Effect |
32
+ * |---|---|
33
+ * | **Partner-wide** | Every outbound and inbound message on every phone number under your account is retained for 24 hours, then deleted. |
34
+ * | **Per phone number** | Only the specified phone numbers have their messages auto-deleted. The rest follow the standard message-retention policy. |
35
+ *
36
+ * **Behavioral differences vs the standard default:**
37
+ *
38
+ * | Aspect | Standard | Ephemeral |
39
+ * |---|---|---|
40
+ * | Retention | Retained per the standard message-retention policy | **Hard backstop: 24 hours** from when the message is created |
41
+ * | 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` |
42
+ * | Content on expiry | N/A | Text, formatting, and attachment references are scrubbed; the message is gone, not blanked out |
43
+ * | Cross-partner isolation | Enforced | Enforced |
44
+ *
45
+ * **How the 24-hour window works:**
46
+ *
47
+ * - The window is fixed at **24 hours from message creation** (`created_at`) and cannot be configured per message.
48
+ * - It mirrors the ephemeral *attachments* 1-day backstop, so a message and any media it carries expire together.
49
+ * - Expiry is delivery-independent — the clock starts when the message is created, not when it is delivered or read.
50
+ *
51
+ * **What you observe:**
52
+ *
53
+ * - **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.
54
+ * - **No deletion webhook is sent.** There is no `message.deleted` event — a message simply stops being retrievable once its window passes.
55
+ * - **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.
56
+ *
57
+ * **When to choose ephemeral:**
58
+ *
59
+ * - You have a compliance requirement that the platform must not retain message content beyond a short window.
60
+ * - The conversation is high-sensitivity (PHI, financial, identity verification) and you do not want it sitting in storage long-term.
61
+ * - 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.
62
+ *
63
+ * **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.
64
+ */
65
+ export declare class Polls extends APIResource {
66
+ /**
67
+ * Create an iMessage poll in an existing chat and send it. Polls are
68
+ * iMessage-only.
69
+ *
70
+ * The chat must already exist — **a poll cannot be the first message of a new
71
+ * chat** (use `POST /v3/chats` for that). Options are **add-only and immutable**:
72
+ * you can add options later via `POST /v3/messages/{messageId}/poll/options`, but
73
+ * never edit or remove them.
74
+ *
75
+ * @example
76
+ * ```ts
77
+ * const pollEnvelope = await client.chats.polls.create(
78
+ * '550e8400-e29b-41d4-a716-446655440000',
79
+ * {
80
+ * poll: {
81
+ * options: [{ text: 'Tacos' }, { text: 'Sushi' }],
82
+ * idempotency_key: 'poll-abc123',
83
+ * },
84
+ * },
85
+ * );
86
+ * ```
87
+ */
88
+ create(chatID: string, body: PollCreateParams, options?: RequestOptions): APIPromise<PollEnvelope>;
89
+ }
90
+ /**
91
+ * Poll content — options and the aggregate voter count.
92
+ */
93
+ export interface Poll {
94
+ options: Array<Poll.Option>;
95
+ /**
96
+ * Distinct participants across the whole poll (a voter picking two options counts
97
+ * once).
98
+ */
99
+ total_voters: number;
100
+ }
101
+ export declare namespace Poll {
102
+ interface Option {
103
+ can_be_edited: boolean;
104
+ /**
105
+ * The participant who added this option (poll creator for the initial options;
106
+ * whoever added later ones).
107
+ */
108
+ creator_handle: Shared.ChatHandle;
109
+ option_id: string;
110
+ text: string;
111
+ /**
112
+ * Participants who voted for this option (vote_count = voters.length).
113
+ */
114
+ voters: Array<Option.Voter>;
115
+ }
116
+ namespace Option {
117
+ interface Voter {
118
+ handle: string;
119
+ voted_at: string;
120
+ }
121
+ }
122
+ }
123
+ /**
124
+ * Message-level envelope returned by every poll endpoint.
125
+ */
126
+ export interface PollEnvelope {
127
+ chat_id: string;
128
+ created_at: string;
129
+ /**
130
+ * The poll-definition message's ID — reference this poll by it.
131
+ */
132
+ message_id: string;
133
+ /**
134
+ * Poll content — options and the aggregate voter count.
135
+ */
136
+ poll: Poll;
137
+ /**
138
+ * Tapbacks/stickers on the whole poll (message part 0).
139
+ */
140
+ reactions: Array<Shared.Reaction>;
141
+ updated_at: string;
142
+ }
143
+ export interface PollCreateParams {
144
+ /**
145
+ * Poll content to create. A poll needs at least two options. Options are add-only
146
+ * and immutable — there is no title/question (send that as a normal text message).
147
+ */
148
+ poll: PollCreateParams.Poll;
149
+ }
150
+ export declare namespace PollCreateParams {
151
+ /**
152
+ * Poll content to create. A poll needs at least two options. Options are add-only
153
+ * and immutable — there is no title/question (send that as a normal text message).
154
+ */
155
+ interface Poll {
156
+ options: Array<Poll.Option>;
157
+ /**
158
+ * Optional key to deduplicate the poll creation.
159
+ */
160
+ idempotency_key?: string;
161
+ }
162
+ namespace Poll {
163
+ interface Option {
164
+ text: string;
165
+ }
166
+ }
167
+ }
168
+ export declare namespace Polls {
169
+ export { type Poll as Poll, type PollEnvelope as PollEnvelope, type PollCreateParams as PollCreateParams };
170
+ }
171
+ //# sourceMappingURL=polls.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"polls.d.ts","sourceRoot":"","sources":["../../src/resources/chats/polls.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,+BAA4B;AAClD,OAAO,KAAK,MAAM,qBAAkB;AACpC,OAAO,EAAE,UAAU,EAAE,kCAA+B;AACpD,OAAO,EAAE,cAAc,EAAE,0CAAuC;AAGhE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2DG;AACH,qBAAa,KAAM,SAAQ,WAAW;IACpC;;;;;;;;;;;;;;;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C;KAC1B;IAED,UAAiB,IAAI,CAAC;QACpB,UAAiB,MAAM;YACrB,IAAI,EAAE,MAAM,CAAC;SACd;KACF;CACF;AAED,MAAM,CAAC,OAAO,WAAW,KAAK,CAAC;IAC7B,OAAO,EAAE,KAAK,IAAI,IAAI,IAAI,EAAE,KAAK,YAAY,IAAI,YAAY,EAAE,KAAK,gBAAgB,IAAI,gBAAgB,EAAE,CAAC;CAC5G"}
@@ -0,0 +1,95 @@
1
+ "use strict";
2
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.Polls = void 0;
5
+ const resource_1 = require("../../core/resource.js");
6
+ const path_1 = require("../../internal/utils/path.js");
7
+ /**
8
+ * Messages are individual communications within a chat thread.
9
+ *
10
+ * Messages can include text, media attachments, rich link previews, special effects
11
+ * (like confetti or fireworks), and reactions. All messages are associated with a
12
+ * specific chat and sent from a phone number you own.
13
+ *
14
+ * Messages support delivery status tracking, read receipts, and editing capabilities.
15
+ *
16
+ * ## Rich Link Previews
17
+ *
18
+ * Send a URL as a `link` part to deliver it with a rich preview card showing the
19
+ * page's title, description, and image (when available). A `link` part must be the
20
+ * **only** part in the message — it cannot be combined with text or media parts.
21
+ * To send a URL without a preview card, include it in a `text` part instead.
22
+ *
23
+ * **Limitations:**
24
+ * - A `link` part cannot be combined with other parts in the same message.
25
+ * - Maximum URL length: 2,048 characters.
26
+ *
27
+ * ## Ephemeral Messages (Privacy Tier)
28
+ *
29
+ * 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.
30
+ *
31
+ * You can request it at two scopes:
32
+ *
33
+ * | Scope | Effect |
34
+ * |---|---|
35
+ * | **Partner-wide** | Every outbound and inbound message on every phone number under your account is retained for 24 hours, then deleted. |
36
+ * | **Per phone number** | Only the specified phone numbers have their messages auto-deleted. The rest follow the standard message-retention policy. |
37
+ *
38
+ * **Behavioral differences vs the standard default:**
39
+ *
40
+ * | Aspect | Standard | Ephemeral |
41
+ * |---|---|---|
42
+ * | Retention | Retained per the standard message-retention policy | **Hard backstop: 24 hours** from when the message is created |
43
+ * | 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` |
44
+ * | Content on expiry | N/A | Text, formatting, and attachment references are scrubbed; the message is gone, not blanked out |
45
+ * | Cross-partner isolation | Enforced | Enforced |
46
+ *
47
+ * **How the 24-hour window works:**
48
+ *
49
+ * - The window is fixed at **24 hours from message creation** (`created_at`) and cannot be configured per message.
50
+ * - It mirrors the ephemeral *attachments* 1-day backstop, so a message and any media it carries expire together.
51
+ * - Expiry is delivery-independent — the clock starts when the message is created, not when it is delivered or read.
52
+ *
53
+ * **What you observe:**
54
+ *
55
+ * - **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.
56
+ * - **No deletion webhook is sent.** There is no `message.deleted` event — a message simply stops being retrievable once its window passes.
57
+ * - **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.
58
+ *
59
+ * **When to choose ephemeral:**
60
+ *
61
+ * - You have a compliance requirement that the platform must not retain message content beyond a short window.
62
+ * - The conversation is high-sensitivity (PHI, financial, identity verification) and you do not want it sitting in storage long-term.
63
+ * - 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.
64
+ *
65
+ * **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.
66
+ */
67
+ class Polls extends resource_1.APIResource {
68
+ /**
69
+ * Create an iMessage poll in an existing chat and send it. Polls are
70
+ * iMessage-only.
71
+ *
72
+ * The chat must already exist — **a poll cannot be the first message of a new
73
+ * chat** (use `POST /v3/chats` for that). Options are **add-only and immutable**:
74
+ * you can add options later via `POST /v3/messages/{messageId}/poll/options`, but
75
+ * never edit or remove them.
76
+ *
77
+ * @example
78
+ * ```ts
79
+ * const pollEnvelope = await client.chats.polls.create(
80
+ * '550e8400-e29b-41d4-a716-446655440000',
81
+ * {
82
+ * poll: {
83
+ * options: [{ text: 'Tacos' }, { text: 'Sushi' }],
84
+ * idempotency_key: 'poll-abc123',
85
+ * },
86
+ * },
87
+ * );
88
+ * ```
89
+ */
90
+ create(chatID, body, options) {
91
+ return this._client.post((0, path_1.path) `/v3/chats/${chatID}/polls`, { body, ...options });
92
+ }
93
+ }
94
+ exports.Polls = Polls;
95
+ //# sourceMappingURL=polls.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"polls.js","sourceRoot":"","sources":["../../src/resources/chats/polls.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,qDAAkD;AAIlD,uDAAiD;AAEjD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2DG;AACH,MAAa,KAAM,SAAQ,sBAAW;IACpC;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,MAAM,CAAC,MAAc,EAAE,IAAsB,EAAE,OAAwB;QACrE,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAA,WAAI,EAAA,aAAa,MAAM,QAAQ,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAClF,CAAC;CACF;AA1BD,sBA0BC"}