@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.
- package/CHANGELOG.md +14 -0
- package/client.d.mts +59 -9
- package/client.d.mts.map +1 -1
- package/client.d.ts +59 -9
- package/client.d.ts.map +1 -1
- package/client.js +63 -5
- package/client.js.map +1 -1
- package/client.mjs +64 -6
- package/client.mjs.map +1 -1
- package/internal/qs/formats.d.mts +7 -0
- package/internal/qs/formats.d.mts.map +1 -0
- package/internal/qs/formats.d.ts +7 -0
- package/internal/qs/formats.d.ts.map +1 -0
- package/internal/qs/formats.js +13 -0
- package/internal/qs/formats.js.map +1 -0
- package/internal/qs/formats.mjs +9 -0
- package/internal/qs/formats.mjs.map +1 -0
- package/internal/qs/index.d.mts +10 -0
- package/internal/qs/index.d.mts.map +1 -0
- package/internal/qs/index.d.ts +10 -0
- package/internal/qs/index.d.ts.map +1 -0
- package/internal/qs/index.js +14 -0
- package/internal/qs/index.js.map +1 -0
- package/internal/qs/index.mjs +10 -0
- package/internal/qs/index.mjs.map +1 -0
- package/internal/qs/stringify.d.mts +3 -0
- package/internal/qs/stringify.d.mts.map +1 -0
- package/internal/qs/stringify.d.ts +3 -0
- package/internal/qs/stringify.d.ts.map +1 -0
- package/internal/qs/stringify.js +277 -0
- package/internal/qs/stringify.js.map +1 -0
- package/internal/qs/stringify.mjs +274 -0
- package/internal/qs/stringify.mjs.map +1 -0
- package/internal/qs/types.d.mts +57 -0
- package/internal/qs/types.d.mts.map +1 -0
- package/internal/qs/types.d.ts +57 -0
- package/internal/qs/types.d.ts.map +1 -0
- package/internal/qs/types.js +3 -0
- package/internal/qs/types.js.map +1 -0
- package/internal/qs/types.mjs +2 -0
- package/internal/qs/types.mjs.map +1 -0
- package/internal/qs/utils.d.mts +15 -0
- package/internal/qs/utils.d.mts.map +1 -0
- package/internal/qs/utils.d.ts +15 -0
- package/internal/qs/utils.d.ts.map +1 -0
- package/internal/qs/utils.js +230 -0
- package/internal/qs/utils.js.map +1 -0
- package/internal/qs/utils.mjs +217 -0
- package/internal/qs/utils.mjs.map +1 -0
- package/internal/tslib.js +17 -17
- package/internal/utils/query.d.mts +0 -3
- package/internal/utils/query.d.mts.map +1 -1
- package/internal/utils/query.d.ts +0 -3
- package/internal/utils/query.d.ts.map +1 -1
- package/internal/utils/query.js +3 -16
- package/internal/utils/query.js.map +1 -1
- package/internal/utils/query.mjs +2 -16
- package/internal/utils/query.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/attachments.d.mts +1 -1
- package/resources/attachments.d.ts +1 -1
- package/resources/attachments.js +1 -1
- package/resources/attachments.mjs +1 -1
- package/resources/available-number.d.mts +58 -0
- package/resources/available-number.d.mts.map +1 -0
- package/resources/available-number.d.ts +58 -0
- package/resources/available-number.d.ts.map +1 -0
- package/resources/available-number.js +36 -0
- package/resources/available-number.js.map +1 -0
- package/resources/available-number.mjs +32 -0
- package/resources/available-number.mjs.map +1 -0
- package/resources/chats/chats.d.mts +59 -11
- package/resources/chats/chats.d.mts.map +1 -1
- package/resources/chats/chats.d.ts +59 -11
- package/resources/chats/chats.d.ts.map +1 -1
- package/resources/chats/chats.js.map +1 -1
- package/resources/chats/chats.mjs.map +1 -1
- package/resources/chats/location.d.mts +9 -8
- package/resources/chats/location.d.mts.map +1 -1
- package/resources/chats/location.d.ts +9 -8
- package/resources/chats/location.d.ts.map +1 -1
- package/resources/chats/location.js +9 -8
- package/resources/chats/location.js.map +1 -1
- package/resources/chats/location.mjs +9 -8
- package/resources/chats/location.mjs.map +1 -1
- package/resources/chats/messages.d.mts +84 -6
- package/resources/chats/messages.d.mts.map +1 -1
- package/resources/chats/messages.d.ts +84 -6
- package/resources/chats/messages.d.ts.map +1 -1
- package/resources/chats/messages.js +40 -0
- package/resources/chats/messages.js.map +1 -1
- package/resources/chats/messages.mjs +40 -0
- package/resources/chats/messages.mjs.map +1 -1
- package/resources/contact-card.d.mts +1 -2
- package/resources/contact-card.d.mts.map +1 -1
- package/resources/contact-card.d.ts +1 -2
- package/resources/contact-card.d.ts.map +1 -1
- package/resources/index.d.mts +3 -2
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +3 -2
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +3 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +2 -1
- package/resources/index.mjs.map +1 -1
- package/resources/messages.d.mts +400 -7
- package/resources/messages.d.mts.map +1 -1
- package/resources/messages.d.ts +400 -7
- package/resources/messages.d.ts.map +1 -1
- package/resources/messages.js +148 -0
- package/resources/messages.js.map +1 -1
- package/resources/messages.mjs +148 -0
- package/resources/messages.mjs.map +1 -1
- package/resources/phone-numbers.d.mts +68 -23
- package/resources/phone-numbers.d.mts.map +1 -1
- package/resources/phone-numbers.d.ts +68 -23
- package/resources/phone-numbers.d.ts.map +1 -1
- package/resources/phone-numbers.js +23 -0
- package/resources/phone-numbers.js.map +1 -1
- package/resources/phone-numbers.mjs +23 -0
- package/resources/phone-numbers.mjs.map +1 -1
- package/resources/webhooks.d.mts +14 -14
- package/resources/webhooks.d.ts +14 -14
- package/src/client.ts +94 -8
- package/src/internal/qs/LICENSE.md +13 -0
- package/src/internal/qs/README.md +3 -0
- package/src/internal/qs/formats.ts +10 -0
- package/src/internal/qs/index.ts +13 -0
- package/src/internal/qs/stringify.ts +385 -0
- package/src/internal/qs/types.ts +71 -0
- package/src/internal/qs/utils.ts +265 -0
- package/src/internal/utils/query.ts +2 -18
- package/src/resources/attachments.ts +1 -1
- package/src/resources/available-number.ts +72 -0
- package/src/resources/chats/chats.ts +64 -12
- package/src/resources/chats/location.ts +9 -8
- package/src/resources/chats/messages.ts +87 -6
- package/src/resources/contact-card.ts +1 -2
- package/src/resources/index.ts +15 -1
- package/src/resources/messages.ts +453 -6
- package/src/resources/phone-numbers.ts +85 -23
- package/src/resources/webhooks.ts +14 -14
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- 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 `
|
|
208
|
-
* renders as an empty bubble.
|
|
209
|
-
*
|
|
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 `
|
|
264
|
-
* renders as an empty bubble.
|
|
265
|
-
*
|
|
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
|
-
*
|
|
151
|
-
* is provided.
|
|
150
|
+
* Profile image URL for the contact card.
|
|
152
151
|
*/
|
|
153
152
|
image_url?: string;
|
|
154
153
|
|
package/src/resources/index.ts
CHANGED
|
@@ -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 {
|
|
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 {
|