@linqapp/sdk 0.28.0 → 0.28.2

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 (147) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/client.d.mts +59 -9
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +59 -9
  5. package/client.d.ts.map +1 -1
  6. package/client.js +63 -5
  7. package/client.js.map +1 -1
  8. package/client.mjs +64 -6
  9. package/client.mjs.map +1 -1
  10. package/internal/qs/formats.d.mts +7 -0
  11. package/internal/qs/formats.d.mts.map +1 -0
  12. package/internal/qs/formats.d.ts +7 -0
  13. package/internal/qs/formats.d.ts.map +1 -0
  14. package/internal/qs/formats.js +13 -0
  15. package/internal/qs/formats.js.map +1 -0
  16. package/internal/qs/formats.mjs +9 -0
  17. package/internal/qs/formats.mjs.map +1 -0
  18. package/internal/qs/index.d.mts +10 -0
  19. package/internal/qs/index.d.mts.map +1 -0
  20. package/internal/qs/index.d.ts +10 -0
  21. package/internal/qs/index.d.ts.map +1 -0
  22. package/internal/qs/index.js +14 -0
  23. package/internal/qs/index.js.map +1 -0
  24. package/internal/qs/index.mjs +10 -0
  25. package/internal/qs/index.mjs.map +1 -0
  26. package/internal/qs/stringify.d.mts +3 -0
  27. package/internal/qs/stringify.d.mts.map +1 -0
  28. package/internal/qs/stringify.d.ts +3 -0
  29. package/internal/qs/stringify.d.ts.map +1 -0
  30. package/internal/qs/stringify.js +277 -0
  31. package/internal/qs/stringify.js.map +1 -0
  32. package/internal/qs/stringify.mjs +274 -0
  33. package/internal/qs/stringify.mjs.map +1 -0
  34. package/internal/qs/types.d.mts +57 -0
  35. package/internal/qs/types.d.mts.map +1 -0
  36. package/internal/qs/types.d.ts +57 -0
  37. package/internal/qs/types.d.ts.map +1 -0
  38. package/internal/qs/types.js +3 -0
  39. package/internal/qs/types.js.map +1 -0
  40. package/internal/qs/types.mjs +2 -0
  41. package/internal/qs/types.mjs.map +1 -0
  42. package/internal/qs/utils.d.mts +15 -0
  43. package/internal/qs/utils.d.mts.map +1 -0
  44. package/internal/qs/utils.d.ts +15 -0
  45. package/internal/qs/utils.d.ts.map +1 -0
  46. package/internal/qs/utils.js +230 -0
  47. package/internal/qs/utils.js.map +1 -0
  48. package/internal/qs/utils.mjs +217 -0
  49. package/internal/qs/utils.mjs.map +1 -0
  50. package/internal/tslib.js +17 -17
  51. package/internal/utils/query.d.mts +0 -3
  52. package/internal/utils/query.d.mts.map +1 -1
  53. package/internal/utils/query.d.ts +0 -3
  54. package/internal/utils/query.d.ts.map +1 -1
  55. package/internal/utils/query.js +3 -16
  56. package/internal/utils/query.js.map +1 -1
  57. package/internal/utils/query.mjs +2 -16
  58. package/internal/utils/query.mjs.map +1 -1
  59. package/package.json +1 -1
  60. package/resources/attachments.d.mts +1 -1
  61. package/resources/attachments.d.ts +1 -1
  62. package/resources/attachments.js +1 -1
  63. package/resources/attachments.mjs +1 -1
  64. package/resources/available-number.d.mts +58 -0
  65. package/resources/available-number.d.mts.map +1 -0
  66. package/resources/available-number.d.ts +58 -0
  67. package/resources/available-number.d.ts.map +1 -0
  68. package/resources/available-number.js +36 -0
  69. package/resources/available-number.js.map +1 -0
  70. package/resources/available-number.mjs +32 -0
  71. package/resources/available-number.mjs.map +1 -0
  72. package/resources/chats/chats.d.mts +59 -11
  73. package/resources/chats/chats.d.mts.map +1 -1
  74. package/resources/chats/chats.d.ts +59 -11
  75. package/resources/chats/chats.d.ts.map +1 -1
  76. package/resources/chats/chats.js.map +1 -1
  77. package/resources/chats/chats.mjs.map +1 -1
  78. package/resources/chats/location.d.mts +9 -8
  79. package/resources/chats/location.d.mts.map +1 -1
  80. package/resources/chats/location.d.ts +9 -8
  81. package/resources/chats/location.d.ts.map +1 -1
  82. package/resources/chats/location.js +9 -8
  83. package/resources/chats/location.js.map +1 -1
  84. package/resources/chats/location.mjs +9 -8
  85. package/resources/chats/location.mjs.map +1 -1
  86. package/resources/chats/messages.d.mts +84 -6
  87. package/resources/chats/messages.d.mts.map +1 -1
  88. package/resources/chats/messages.d.ts +84 -6
  89. package/resources/chats/messages.d.ts.map +1 -1
  90. package/resources/chats/messages.js +40 -0
  91. package/resources/chats/messages.js.map +1 -1
  92. package/resources/chats/messages.mjs +40 -0
  93. package/resources/chats/messages.mjs.map +1 -1
  94. package/resources/contact-card.d.mts +1 -2
  95. package/resources/contact-card.d.mts.map +1 -1
  96. package/resources/contact-card.d.ts +1 -2
  97. package/resources/contact-card.d.ts.map +1 -1
  98. package/resources/index.d.mts +3 -2
  99. package/resources/index.d.mts.map +1 -1
  100. package/resources/index.d.ts +3 -2
  101. package/resources/index.d.ts.map +1 -1
  102. package/resources/index.js +3 -1
  103. package/resources/index.js.map +1 -1
  104. package/resources/index.mjs +2 -1
  105. package/resources/index.mjs.map +1 -1
  106. package/resources/messages.d.mts +400 -7
  107. package/resources/messages.d.mts.map +1 -1
  108. package/resources/messages.d.ts +400 -7
  109. package/resources/messages.d.ts.map +1 -1
  110. package/resources/messages.js +148 -0
  111. package/resources/messages.js.map +1 -1
  112. package/resources/messages.mjs +148 -0
  113. package/resources/messages.mjs.map +1 -1
  114. package/resources/phone-numbers.d.mts +68 -23
  115. package/resources/phone-numbers.d.mts.map +1 -1
  116. package/resources/phone-numbers.d.ts +68 -23
  117. package/resources/phone-numbers.d.ts.map +1 -1
  118. package/resources/phone-numbers.js +23 -0
  119. package/resources/phone-numbers.js.map +1 -1
  120. package/resources/phone-numbers.mjs +23 -0
  121. package/resources/phone-numbers.mjs.map +1 -1
  122. package/resources/webhooks.d.mts +14 -14
  123. package/resources/webhooks.d.ts +14 -14
  124. package/src/client.ts +94 -8
  125. package/src/internal/qs/LICENSE.md +13 -0
  126. package/src/internal/qs/README.md +3 -0
  127. package/src/internal/qs/formats.ts +10 -0
  128. package/src/internal/qs/index.ts +13 -0
  129. package/src/internal/qs/stringify.ts +385 -0
  130. package/src/internal/qs/types.ts +71 -0
  131. package/src/internal/qs/utils.ts +265 -0
  132. package/src/internal/utils/query.ts +2 -18
  133. package/src/resources/attachments.ts +1 -1
  134. package/src/resources/available-number.ts +72 -0
  135. package/src/resources/chats/chats.ts +64 -12
  136. package/src/resources/chats/location.ts +9 -8
  137. package/src/resources/chats/messages.ts +87 -6
  138. package/src/resources/contact-card.ts +1 -2
  139. package/src/resources/index.ts +15 -1
  140. package/src/resources/messages.ts +453 -6
  141. package/src/resources/phone-numbers.ts +85 -23
  142. package/src/resources/webhooks.ts +14 -14
  143. package/src/version.ts +1 -1
  144. package/version.d.mts +1 -1
  145. package/version.d.ts +1 -1
  146. package/version.js +1 -1
  147. package/version.mjs +1 -1
@@ -33,6 +33,46 @@ import { path } from '../../internal/utils/path';
33
33
  * **Limitations:**
34
34
  * - A `link` part cannot be combined with other parts in the same message.
35
35
  * - Maximum URL length: 2,048 characters.
36
+ *
37
+ * ## Ephemeral Messages (Privacy Tier)
38
+ *
39
+ * 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.
40
+ *
41
+ * You can request it at two scopes:
42
+ *
43
+ * | Scope | Effect |
44
+ * |---|---|
45
+ * | **Partner-wide** | Every outbound and inbound message on every phone number under your account is retained for 24 hours, then deleted. |
46
+ * | **Per phone number** | Only the specified phone numbers have their messages auto-deleted. The rest follow the standard message-retention policy. |
47
+ *
48
+ * **Behavioral differences vs the standard default:**
49
+ *
50
+ * | Aspect | Standard | Ephemeral |
51
+ * |---|---|---|
52
+ * | Retention | Retained per the standard message-retention policy | **Hard backstop: 24 hours** from when the message is created |
53
+ * | 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` |
54
+ * | Content on expiry | N/A | Text, formatting, and attachment references are scrubbed; the message is gone, not blanked out |
55
+ * | Cross-partner isolation | Enforced | Enforced |
56
+ *
57
+ * **How the 24-hour window works:**
58
+ *
59
+ * - The window is fixed at **24 hours from message creation** (`created_at`) and cannot be configured per message.
60
+ * - It mirrors the ephemeral *attachments* 1-day backstop, so a message and any media it carries expire together.
61
+ * - Expiry is delivery-independent — the clock starts when the message is created, not when it is delivered or read.
62
+ *
63
+ * **What you observe:**
64
+ *
65
+ * - **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.
66
+ * - **No deletion webhook is sent.** There is no `message.deleted` event — a message simply stops being retrievable once its window passes.
67
+ * - **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.
68
+ *
69
+ * **When to choose ephemeral:**
70
+ *
71
+ * - You have a compliance requirement that the platform must not retain message content beyond a short window.
72
+ * - The conversation is high-sensitivity (PHI, financial, identity verification) and you do not want it sitting in storage long-term.
73
+ * - 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.
74
+ *
75
+ * **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.
36
76
  */
37
77
  export class Messages extends APIResource {
38
78
  /**
@@ -204,9 +244,19 @@ export namespace SentMessage {
204
244
 
205
245
  /**
206
246
  * Visible layout of the card. At least one of `caption`, `subcaption`,
207
- * `trailing_caption`, or `trailing_subcaption` must be set, otherwise the card
208
- * renders as an empty bubble. Any image on the card is drawn by the recipient's
209
- * installed app extension; it cannot be supplied here.
247
+ * `trailing_caption`, `trailing_subcaption`, or `image_url` must be set, otherwise
248
+ * the card renders as an empty bubble.
249
+ *
250
+ * `image_url` displays a preview image at the top of the card. The image renders
251
+ * on the recipient's card whether or not they have your app installed. The small
252
+ * icon beside the caption is the app's own icon and is not settable here.
253
+ *
254
+ * `* Note - requires a trusted chat w/ inbound activity`
255
+ *
256
+ * `image_title` and `image_subtitle` render as text overlaid on the image (title
257
+ * bold, subtitle beneath it). They only appear when `image_url` is set — without
258
+ * an image there is nothing to overlay — so setting either without `image_url` is
259
+ * rejected.
210
260
  */
211
261
  layout: IMessageAppPartResponse.Layout;
212
262
 
@@ -260,9 +310,19 @@ export namespace SentMessage {
260
310
 
261
311
  /**
262
312
  * Visible layout of the card. At least one of `caption`, `subcaption`,
263
- * `trailing_caption`, or `trailing_subcaption` must be set, otherwise the card
264
- * renders as an empty bubble. Any image on the card is drawn by the recipient's
265
- * installed app extension; it cannot be supplied here.
313
+ * `trailing_caption`, `trailing_subcaption`, or `image_url` must be set, otherwise
314
+ * the card renders as an empty bubble.
315
+ *
316
+ * `image_url` displays a preview image at the top of the card. The image renders
317
+ * on the recipient's card whether or not they have your app installed. The small
318
+ * icon beside the caption is the app's own icon and is not settable here.
319
+ *
320
+ * `* Note - requires a trusted chat w/ inbound activity`
321
+ *
322
+ * `image_title` and `image_subtitle` render as text overlaid on the image (title
323
+ * bold, subtitle beneath it). They only appear when `image_url` is set — without
324
+ * an image there is nothing to overlay — so setting either without `image_url` is
325
+ * rejected.
266
326
  */
267
327
  export interface Layout {
268
328
  /**
@@ -270,6 +330,27 @@ export namespace SentMessage {
270
330
  */
271
331
  caption?: string;
272
332
 
333
+ /**
334
+ * Text shown below `image_title`, overlaid on the card image. Requires
335
+ * `image_url`.
336
+ */
337
+ image_subtitle?: string;
338
+
339
+ /**
340
+ * Bold text overlaid on the card image. Requires `image_url` (rejected without
341
+ * it).
342
+ */
343
+ image_title?: string;
344
+
345
+ /**
346
+ * URL of an image (JPEG, PNG, HEIF, or WebP) to display as the card's preview
347
+ * image; an unreachable or non-image URL returns a validation error. Renders for
348
+ * all recipients regardless of whether they have the app. Note - requires a
349
+ * trusted chat w/ inbound activity. In responses, this is the re-hosted
350
+ * `cdn.linqapp.com` copy of the image you supplied, not your original URL.
351
+ */
352
+ image_url?: string;
353
+
273
354
  /**
274
355
  * Secondary label, below `caption` on the left.
275
356
  */
@@ -147,8 +147,7 @@ export interface ContactCardCreateParams {
147
147
  phone_number: string;
148
148
 
149
149
  /**
150
- * URL of the profile image to rehost on the CDN. Only re-uploaded when a new value
151
- * is provided.
150
+ * Profile image URL for the contact card.
152
151
  */
153
152
  image_url?: string;
154
153
 
@@ -8,6 +8,11 @@ export {
8
8
  type AttachmentRetrieveResponse,
9
9
  type AttachmentCreateParams,
10
10
  } from './attachments';
11
+ export {
12
+ AvailableNumber,
13
+ type AvailableNumberRetrieveResponse,
14
+ type AvailableNumberRetrieveParams,
15
+ } from './available-number';
11
16
  export {
12
17
  Capability,
13
18
  type HandleCheck,
@@ -45,13 +50,22 @@ export {
45
50
  type Message,
46
51
  type MessageEffect,
47
52
  type ReplyTo,
53
+ type MessageCreateResponse,
48
54
  type MessageAddReactionResponse,
55
+ type MessageUpdateAppCardResponse,
56
+ type MessageCreateParams,
49
57
  type MessageListMessagesThreadParams,
50
58
  type MessageAddReactionParams,
51
59
  type MessageUpdateParams,
60
+ type MessageUpdateAppCardParams,
52
61
  type MessagesListMessagesPagination,
53
62
  } from './messages';
54
- export { PhoneNumbers, type PhoneNumberListResponse } from './phone-numbers';
63
+ export {
64
+ PhoneNumbers,
65
+ type PhoneNumberUpdateResponse,
66
+ type PhoneNumberListResponse,
67
+ type PhoneNumberUpdateParams,
68
+ } from './phone-numbers';
55
69
  export { Phonenumbers, type PhonenumberListResponse } from './phonenumbers';
56
70
  export { WebhookEvents, type WebhookEventType, type WebhookEventListResponse } from './webhook-events';
57
71
  export {