@linqapp/sdk 0.32.1 → 0.33.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +26 -0
- package/README.md +82 -112
- package/client.d.mts +42 -6
- package/client.d.mts.map +1 -1
- package/client.d.ts +42 -6
- package/client.d.ts.map +1 -1
- package/client.js +39 -3
- package/client.js.map +1 -1
- package/client.mjs +39 -3
- package/client.mjs.map +1 -1
- package/core/error.d.mts +13 -0
- package/core/error.d.mts.map +1 -1
- package/core/error.d.ts +13 -0
- package/core/error.d.ts.map +1 -1
- package/core/error.js +5 -1
- package/core/error.js.map +1 -1
- package/core/error.mjs +5 -1
- package/core/error.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/available-number.d.mts +13 -1
- package/resources/available-number.d.mts.map +1 -1
- package/resources/available-number.d.ts +13 -1
- package/resources/available-number.d.ts.map +1 -1
- package/resources/available-number.js +2 -1
- package/resources/available-number.js.map +1 -1
- package/resources/available-number.mjs +2 -1
- package/resources/available-number.mjs.map +1 -1
- package/resources/chats/chats.d.mts +175 -70
- package/resources/chats/chats.d.mts.map +1 -1
- package/resources/chats/chats.d.ts +175 -70
- package/resources/chats/chats.d.ts.map +1 -1
- package/resources/chats/chats.js +65 -61
- package/resources/chats/chats.js.map +1 -1
- package/resources/chats/chats.mjs +65 -61
- package/resources/chats/chats.mjs.map +1 -1
- package/resources/chats/index.d.mts +3 -2
- package/resources/chats/index.d.mts.map +1 -1
- package/resources/chats/index.d.ts +3 -2
- package/resources/chats/index.d.ts.map +1 -1
- package/resources/chats/index.js +3 -1
- package/resources/chats/index.js.map +1 -1
- package/resources/chats/index.mjs +1 -0
- package/resources/chats/index.mjs.map +1 -1
- package/resources/chats/location.d.mts +25 -25
- package/resources/chats/location.d.mts.map +1 -1
- package/resources/chats/location.d.ts +25 -25
- package/resources/chats/location.d.ts.map +1 -1
- package/resources/chats/location.js +27 -27
- package/resources/chats/location.js.map +1 -1
- package/resources/chats/location.mjs +27 -27
- package/resources/chats/location.mjs.map +1 -1
- package/resources/chats/messages.d.mts +28 -21
- package/resources/chats/messages.d.mts.map +1 -1
- package/resources/chats/messages.d.ts +28 -21
- package/resources/chats/messages.d.ts.map +1 -1
- package/resources/chats/messages.js +16 -16
- package/resources/chats/messages.js.map +1 -1
- package/resources/chats/messages.mjs +16 -16
- package/resources/chats/messages.mjs.map +1 -1
- package/resources/chats/polls.d.mts +171 -0
- package/resources/chats/polls.d.mts.map +1 -0
- package/resources/chats/polls.d.ts +171 -0
- package/resources/chats/polls.d.ts.map +1 -0
- package/resources/chats/polls.js +95 -0
- package/resources/chats/polls.js.map +1 -0
- package/resources/chats/polls.mjs +91 -0
- package/resources/chats/polls.mjs.map +1 -0
- package/resources/contact-card.d.mts +29 -28
- package/resources/contact-card.d.mts.map +1 -1
- package/resources/contact-card.d.ts +29 -28
- package/resources/contact-card.d.ts.map +1 -1
- package/resources/contact-card.js +23 -22
- package/resources/contact-card.js.map +1 -1
- package/resources/contact-card.mjs +23 -22
- package/resources/contact-card.mjs.map +1 -1
- package/resources/experiences.d.mts +91 -0
- package/resources/experiences.d.mts.map +1 -0
- package/resources/experiences.d.ts +91 -0
- package/resources/experiences.d.ts.map +1 -0
- package/resources/experiences.js +29 -0
- package/resources/experiences.js.map +1 -0
- package/resources/experiences.mjs +25 -0
- package/resources/experiences.mjs.map +1 -0
- package/resources/index.d.mts +7 -3
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +7 -3
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +10 -2
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +5 -1
- package/resources/index.mjs.map +1 -1
- package/resources/messages/index.d.mts +3 -0
- package/resources/messages/index.d.mts.map +1 -0
- package/resources/messages/index.d.ts +3 -0
- package/resources/messages/index.d.ts.map +1 -0
- package/resources/messages/index.js +9 -0
- package/resources/messages/index.js.map +1 -0
- package/resources/messages/index.mjs +4 -0
- package/resources/messages/index.mjs.map +1 -0
- package/resources/messages/messages.d.mts +795 -0
- package/resources/messages/messages.d.mts.map +1 -0
- package/resources/messages/messages.d.ts +795 -0
- package/resources/messages/messages.d.ts.map +1 -0
- package/resources/messages/messages.js +298 -0
- package/resources/messages/messages.js.map +1 -0
- package/resources/messages/messages.mjs +293 -0
- package/resources/messages/messages.mjs.map +1 -0
- package/resources/messages/poll.d.mts +131 -0
- package/resources/messages/poll.d.mts.map +1 -0
- package/resources/messages/poll.d.ts +131 -0
- package/resources/messages/poll.d.ts.map +1 -0
- package/resources/messages/poll.js +119 -0
- package/resources/messages/poll.js.map +1 -0
- package/resources/messages/poll.mjs +115 -0
- package/resources/messages/poll.mjs.map +1 -0
- package/resources/messages.d.mts +1 -747
- package/resources/messages.d.mts.map +1 -1
- package/resources/messages.d.ts +1 -747
- package/resources/messages.d.ts.map +1 -1
- package/resources/messages.js +2 -275
- package/resources/messages.js.map +1 -1
- package/resources/messages.mjs +1 -273
- package/resources/messages.mjs.map +1 -1
- package/resources/payment-handles.d.mts +87 -0
- package/resources/payment-handles.d.mts.map +1 -0
- package/resources/payment-handles.d.ts +87 -0
- package/resources/payment-handles.d.ts.map +1 -0
- package/resources/payment-handles.js +76 -0
- package/resources/payment-handles.js.map +1 -0
- package/resources/payment-handles.mjs +72 -0
- package/resources/payment-handles.mjs.map +1 -0
- package/resources/payment-providers.d.mts +58 -0
- package/resources/payment-providers.d.mts.map +1 -0
- package/resources/payment-providers.d.ts +58 -0
- package/resources/payment-providers.d.ts.map +1 -0
- package/resources/payment-providers.js +45 -0
- package/resources/payment-providers.js.map +1 -0
- package/resources/payment-providers.mjs +41 -0
- package/resources/payment-providers.mjs.map +1 -0
- package/resources/payment-requests.d.mts +2 -2
- package/resources/payment-requests.d.ts +2 -2
- package/resources/payment-requests.js +2 -2
- package/resources/payment-requests.mjs +2 -2
- package/resources/payments.d.mts +116 -0
- package/resources/payments.d.mts.map +1 -0
- package/resources/payments.d.ts +116 -0
- package/resources/payments.d.ts.map +1 -0
- package/resources/payments.js +70 -0
- package/resources/payments.js.map +1 -0
- package/resources/payments.mjs +66 -0
- package/resources/payments.mjs.map +1 -0
- package/resources/phone-numbers.d.mts +11 -11
- package/resources/phone-numbers.d.mts.map +1 -1
- package/resources/phone-numbers.d.ts +11 -11
- package/resources/phone-numbers.d.ts.map +1 -1
- package/resources/phone-numbers.js +13 -13
- package/resources/phone-numbers.js.map +1 -1
- package/resources/phone-numbers.mjs +13 -13
- package/resources/phone-numbers.mjs.map +1 -1
- package/resources/webhook-events.d.mts +1 -1
- package/resources/webhook-events.d.mts.map +1 -1
- package/resources/webhook-events.d.ts +1 -1
- package/resources/webhook-events.d.ts.map +1 -1
- package/resources/webhook-subscriptions.d.mts +11 -11
- package/resources/webhook-subscriptions.d.mts.map +1 -1
- package/resources/webhook-subscriptions.d.ts +11 -11
- package/resources/webhook-subscriptions.d.ts.map +1 -1
- package/resources/webhook-subscriptions.js +13 -13
- package/resources/webhook-subscriptions.js.map +1 -1
- package/resources/webhook-subscriptions.mjs +13 -13
- package/resources/webhook-subscriptions.mjs.map +1 -1
- package/resources/webhooks.d.mts +72 -1
- package/resources/webhooks.d.mts.map +1 -1
- package/resources/webhooks.d.ts +72 -1
- package/resources/webhooks.d.ts.map +1 -1
- package/src/client.ts +91 -20
- package/src/core/error.ts +20 -1
- package/src/resources/available-number.ts +14 -1
- package/src/resources/chats/chats.ts +203 -85
- package/src/resources/chats/index.ts +3 -2
- package/src/resources/chats/location.ts +28 -28
- package/src/resources/chats/messages.ts +40 -32
- package/src/resources/chats/polls.ts +196 -0
- package/src/resources/contact-card.ts +36 -35
- package/src/resources/experiences.ts +118 -0
- package/src/resources/index.ts +23 -5
- package/src/resources/messages/index.ts +18 -0
- package/src/resources/messages/messages.ts +958 -0
- package/src/resources/messages/poll.ts +151 -0
- package/src/resources/messages.ts +1 -894
- package/src/resources/payment-handles.ts +114 -0
- package/src/resources/payment-providers.ts +81 -0
- package/src/resources/payment-requests.ts +2 -2
- package/src/resources/payments.ts +163 -0
- package/src/resources/phone-numbers.ts +14 -14
- package/src/resources/webhook-events.ts +9 -0
- package/src/resources/webhook-subscriptions.ts +14 -14
- package/src/resources/webhooks.ts +82 -0
- 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
|
@@ -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";
|
|
@@ -67,6 +67,20 @@ import { RequestOptions } from "../../internal/request-options.mjs";
|
|
|
67
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
68
|
*/
|
|
69
69
|
export declare class Messages extends APIResource {
|
|
70
|
+
/**
|
|
71
|
+
* Retrieve messages from a specific chat with pagination support.
|
|
72
|
+
*
|
|
73
|
+
* @example
|
|
74
|
+
* ```ts
|
|
75
|
+
* // Automatically fetches more pages as needed.
|
|
76
|
+
* for await (const message of client.chats.messages.list(
|
|
77
|
+
* '550e8400-e29b-41d4-a716-446655440000',
|
|
78
|
+
* )) {
|
|
79
|
+
* // ...
|
|
80
|
+
* }
|
|
81
|
+
* ```
|
|
82
|
+
*/
|
|
83
|
+
list(chatID: string, query?: MessageListParams | null | undefined, options?: RequestOptions): PagePromise<MessagesListMessagesPagination, ResourcesMessagesAPI.Message>;
|
|
70
84
|
/**
|
|
71
85
|
* Send a message to an existing chat. Use this endpoint when you already have a
|
|
72
86
|
* chat ID and want to send additional messages to it.
|
|
@@ -124,20 +138,6 @@ export declare class Messages extends APIResource {
|
|
|
124
138
|
* ```
|
|
125
139
|
*/
|
|
126
140
|
send(chatID: string, body: MessageSendParams, options?: RequestOptions): APIPromise<MessageSendResponse>;
|
|
127
|
-
/**
|
|
128
|
-
* Retrieve messages from a specific chat with pagination support.
|
|
129
|
-
*
|
|
130
|
-
* @example
|
|
131
|
-
* ```ts
|
|
132
|
-
* // Automatically fetches more pages as needed.
|
|
133
|
-
* for await (const message of client.chats.messages.list(
|
|
134
|
-
* '550e8400-e29b-41d4-a716-446655440000',
|
|
135
|
-
* )) {
|
|
136
|
-
* // ...
|
|
137
|
-
* }
|
|
138
|
-
* ```
|
|
139
|
-
*/
|
|
140
|
-
list(chatID: string, query?: MessageListParams | null | undefined, options?: RequestOptions): PagePromise<MessagesListMessagesPagination, MessagesAPI.Message>;
|
|
141
141
|
}
|
|
142
142
|
/**
|
|
143
143
|
* A message that was sent (used in CreateChat and SendMessage responses)
|
|
@@ -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?:
|
|
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?:
|
|
190
|
+
reply_to?: ResourcesMessagesAPI.ReplyTo | null;
|
|
191
191
|
/**
|
|
192
192
|
* Messaging service type
|
|
193
193
|
*/
|
|
@@ -326,6 +326,8 @@ export interface MessageSendResponse {
|
|
|
326
326
|
*/
|
|
327
327
|
message: SentMessage;
|
|
328
328
|
}
|
|
329
|
+
export interface MessageListParams extends ListMessagesPaginationParams {
|
|
330
|
+
}
|
|
329
331
|
export interface MessageSendParams {
|
|
330
332
|
/**
|
|
331
333
|
* Message content container. Groups all message-related fields together,
|
|
@@ -338,11 +340,16 @@ export interface MessageSendParams {
|
|
|
338
340
|
* cannot coexist with text), so copy and a card are two sends, not one.
|
|
339
341
|
*/
|
|
340
342
|
message: ChatsAPI.MessageContent;
|
|
341
|
-
|
|
342
|
-
|
|
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
|
-
export { type SentMessage as SentMessage, type MessageSendResponse as MessageSendResponse, type
|
|
352
|
+
export { type SentMessage as SentMessage, type MessageSendResponse as MessageSendResponse, type MessageListParams as MessageListParams, type MessageSendParams as MessageSendParams, };
|
|
346
353
|
}
|
|
347
354
|
export { type MessagesListMessagesPagination };
|
|
348
355
|
//# sourceMappingURL=messages.d.mts.map
|
|
@@ -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,
|
|
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,MAAM,sBAAkB;AACpC,OAAO,KAAK,QAAQ,oBAAgB;AACpC,OAAO,KAAK,oBAAoB,iCAA6B;AAC7D,OAAO,EAAE,8BAA8B,EAAE,iCAA6B;A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;;;;;;eAMG;YACH,SAAS,CAAC,EAAE,MAAM,CAAC;YAEnB;;eAEG;YACH,UAAU,CAAC,EAAE,MAAM,CAAC;YAEpB;;eAEG;YACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;YAE1B;;eAEG;YACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;SAC9B;KACF;CACF;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,OAAO,EAAE,WAAW,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";
|
|
@@ -67,6 +67,20 @@ import { RequestOptions } from "../../internal/request-options.js";
|
|
|
67
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
68
|
*/
|
|
69
69
|
export declare class Messages extends APIResource {
|
|
70
|
+
/**
|
|
71
|
+
* Retrieve messages from a specific chat with pagination support.
|
|
72
|
+
*
|
|
73
|
+
* @example
|
|
74
|
+
* ```ts
|
|
75
|
+
* // Automatically fetches more pages as needed.
|
|
76
|
+
* for await (const message of client.chats.messages.list(
|
|
77
|
+
* '550e8400-e29b-41d4-a716-446655440000',
|
|
78
|
+
* )) {
|
|
79
|
+
* // ...
|
|
80
|
+
* }
|
|
81
|
+
* ```
|
|
82
|
+
*/
|
|
83
|
+
list(chatID: string, query?: MessageListParams | null | undefined, options?: RequestOptions): PagePromise<MessagesListMessagesPagination, ResourcesMessagesAPI.Message>;
|
|
70
84
|
/**
|
|
71
85
|
* Send a message to an existing chat. Use this endpoint when you already have a
|
|
72
86
|
* chat ID and want to send additional messages to it.
|
|
@@ -124,20 +138,6 @@ export declare class Messages extends APIResource {
|
|
|
124
138
|
* ```
|
|
125
139
|
*/
|
|
126
140
|
send(chatID: string, body: MessageSendParams, options?: RequestOptions): APIPromise<MessageSendResponse>;
|
|
127
|
-
/**
|
|
128
|
-
* Retrieve messages from a specific chat with pagination support.
|
|
129
|
-
*
|
|
130
|
-
* @example
|
|
131
|
-
* ```ts
|
|
132
|
-
* // Automatically fetches more pages as needed.
|
|
133
|
-
* for await (const message of client.chats.messages.list(
|
|
134
|
-
* '550e8400-e29b-41d4-a716-446655440000',
|
|
135
|
-
* )) {
|
|
136
|
-
* // ...
|
|
137
|
-
* }
|
|
138
|
-
* ```
|
|
139
|
-
*/
|
|
140
|
-
list(chatID: string, query?: MessageListParams | null | undefined, options?: RequestOptions): PagePromise<MessagesListMessagesPagination, MessagesAPI.Message>;
|
|
141
141
|
}
|
|
142
142
|
/**
|
|
143
143
|
* A message that was sent (used in CreateChat and SendMessage responses)
|
|
@@ -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?:
|
|
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?:
|
|
190
|
+
reply_to?: ResourcesMessagesAPI.ReplyTo | null;
|
|
191
191
|
/**
|
|
192
192
|
* Messaging service type
|
|
193
193
|
*/
|
|
@@ -326,6 +326,8 @@ export interface MessageSendResponse {
|
|
|
326
326
|
*/
|
|
327
327
|
message: SentMessage;
|
|
328
328
|
}
|
|
329
|
+
export interface MessageListParams extends ListMessagesPaginationParams {
|
|
330
|
+
}
|
|
329
331
|
export interface MessageSendParams {
|
|
330
332
|
/**
|
|
331
333
|
* Message content container. Groups all message-related fields together,
|
|
@@ -338,11 +340,16 @@ export interface MessageSendParams {
|
|
|
338
340
|
* cannot coexist with text), so copy and a card are two sends, not one.
|
|
339
341
|
*/
|
|
340
342
|
message: ChatsAPI.MessageContent;
|
|
341
|
-
|
|
342
|
-
|
|
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
|
-
export { type SentMessage as SentMessage, type MessageSendResponse as MessageSendResponse, type
|
|
352
|
+
export { type SentMessage as SentMessage, type MessageSendResponse as MessageSendResponse, type MessageListParams as MessageListParams, type MessageSendParams as MessageSendParams, };
|
|
346
353
|
}
|
|
347
354
|
export { type MessagesListMessagesPagination };
|
|
348
355
|
//# sourceMappingURL=messages.d.ts.map
|
|
@@ -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,
|
|
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,MAAM,qBAAkB;AACpC,OAAO,KAAK,QAAQ,mBAAgB;AACpC,OAAO,KAAK,oBAAoB,gCAA6B;AAC7D,OAAO,EAAE,8BAA8B,EAAE,gCAA6B;AACtE,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,iBAAiB,GAAG,IAAI,GAAG,SAAc,EAChD,OAAO,CAAC,EAAE,cAAc,GACvB,WAAW,CAAC,8BAA8B,EAAE,oBAAoB,CAAC,OAAO,CAAC;IAQ5E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAuDG;IACH,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,iBAAiB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,mBAAmB,CAAC;CAGzG;AAED;;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/C,KAAK,iBAAiB,IAAI,iBAAiB,EAC3C,KAAK,iBAAiB,IAAI,iBAAiB,GAC5C,CAAC;CACH;AAED,OAAO,EAAE,KAAK,8BAA8B,EAAE,CAAC"}
|
|
@@ -66,6 +66,22 @@ const path_1 = require("../../internal/utils/path.js");
|
|
|
66
66
|
* **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.
|
|
67
67
|
*/
|
|
68
68
|
class Messages extends resource_1.APIResource {
|
|
69
|
+
/**
|
|
70
|
+
* Retrieve messages from a specific chat with pagination support.
|
|
71
|
+
*
|
|
72
|
+
* @example
|
|
73
|
+
* ```ts
|
|
74
|
+
* // Automatically fetches more pages as needed.
|
|
75
|
+
* for await (const message of client.chats.messages.list(
|
|
76
|
+
* '550e8400-e29b-41d4-a716-446655440000',
|
|
77
|
+
* )) {
|
|
78
|
+
* // ...
|
|
79
|
+
* }
|
|
80
|
+
* ```
|
|
81
|
+
*/
|
|
82
|
+
list(chatID, query = {}, options) {
|
|
83
|
+
return this._client.getAPIList((0, path_1.path) `/v3/chats/${chatID}/messages`, (pagination_1.ListMessagesPagination), { query, ...options });
|
|
84
|
+
}
|
|
69
85
|
/**
|
|
70
86
|
* Send a message to an existing chat. Use this endpoint when you already have a
|
|
71
87
|
* chat ID and want to send additional messages to it.
|
|
@@ -125,22 +141,6 @@ class Messages extends resource_1.APIResource {
|
|
|
125
141
|
send(chatID, body, options) {
|
|
126
142
|
return this._client.post((0, path_1.path) `/v3/chats/${chatID}/messages`, { body, ...options });
|
|
127
143
|
}
|
|
128
|
-
/**
|
|
129
|
-
* Retrieve messages from a specific chat with pagination support.
|
|
130
|
-
*
|
|
131
|
-
* @example
|
|
132
|
-
* ```ts
|
|
133
|
-
* // Automatically fetches more pages as needed.
|
|
134
|
-
* for await (const message of client.chats.messages.list(
|
|
135
|
-
* '550e8400-e29b-41d4-a716-446655440000',
|
|
136
|
-
* )) {
|
|
137
|
-
* // ...
|
|
138
|
-
* }
|
|
139
|
-
* ```
|
|
140
|
-
*/
|
|
141
|
-
list(chatID, query = {}, options) {
|
|
142
|
-
return this._client.getAPIList((0, path_1.path) `/v3/chats/${chatID}/messages`, (pagination_1.ListMessagesPagination), { query, ...options });
|
|
143
|
-
}
|
|
144
144
|
}
|
|
145
145
|
exports.Messages = Messages;
|
|
146
146
|
//# sourceMappingURL=messages.js.map
|
|
@@ -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
|
|
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,mCAAoD,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,IAAA,WAAI,EAAA,aAAa,MAAM,WAAW,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACrF,CAAC;CACF;AArFD,4BAqFC"}
|
|
@@ -63,6 +63,22 @@ import { path } from "../../internal/utils/path.mjs";
|
|
|
63
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
64
|
*/
|
|
65
65
|
export class Messages extends APIResource {
|
|
66
|
+
/**
|
|
67
|
+
* Retrieve messages from a specific chat with pagination support.
|
|
68
|
+
*
|
|
69
|
+
* @example
|
|
70
|
+
* ```ts
|
|
71
|
+
* // Automatically fetches more pages as needed.
|
|
72
|
+
* for await (const message of client.chats.messages.list(
|
|
73
|
+
* '550e8400-e29b-41d4-a716-446655440000',
|
|
74
|
+
* )) {
|
|
75
|
+
* // ...
|
|
76
|
+
* }
|
|
77
|
+
* ```
|
|
78
|
+
*/
|
|
79
|
+
list(chatID, query = {}, options) {
|
|
80
|
+
return this._client.getAPIList(path `/v3/chats/${chatID}/messages`, (ListMessagesPagination), { query, ...options });
|
|
81
|
+
}
|
|
66
82
|
/**
|
|
67
83
|
* Send a message to an existing chat. Use this endpoint when you already have a
|
|
68
84
|
* chat ID and want to send additional messages to it.
|
|
@@ -122,21 +138,5 @@ export class Messages extends APIResource {
|
|
|
122
138
|
send(chatID, body, options) {
|
|
123
139
|
return this._client.post(path `/v3/chats/${chatID}/messages`, { body, ...options });
|
|
124
140
|
}
|
|
125
|
-
/**
|
|
126
|
-
* Retrieve messages from a specific chat with pagination support.
|
|
127
|
-
*
|
|
128
|
-
* @example
|
|
129
|
-
* ```ts
|
|
130
|
-
* // Automatically fetches more pages as needed.
|
|
131
|
-
* for await (const message of client.chats.messages.list(
|
|
132
|
-
* '550e8400-e29b-41d4-a716-446655440000',
|
|
133
|
-
* )) {
|
|
134
|
-
* // ...
|
|
135
|
-
* }
|
|
136
|
-
* ```
|
|
137
|
-
*/
|
|
138
|
-
list(chatID, query = {}, options) {
|
|
139
|
-
return this._client.getAPIList(path `/v3/chats/${chatID}/messages`, (ListMessagesPagination), { query, ...options });
|
|
140
|
-
}
|
|
141
141
|
}
|
|
142
142
|
//# sourceMappingURL=messages.mjs.map
|
|
@@ -1 +1 @@
|
|
|
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
|
|
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,S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