@twilio/conversations 3.0.1-rc.1 → 3.0.1-rc.102
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/builds/browser.js +9276 -4305
- package/builds/browser.js.map +1 -1
- package/builds/lib.d.ts +133 -35
- package/builds/lib.js +9276 -4305
- package/builds/lib.js.map +1 -1
- package/builds/twilio-conversations.js +44416 -27540
- package/builds/twilio-conversations.min.js +1 -200
- package/dist/channel-metadata-client.js +1 -1
- package/dist/channel-metadata-client.js.map +1 -1
- package/dist/client.js +151 -43
- package/dist/client.js.map +1 -1
- package/dist/command-executor.js +31 -50
- package/dist/command-executor.js.map +1 -1
- package/dist/content-template.js +1 -1
- package/dist/content-template.js.map +1 -1
- package/dist/conversation.js +6 -46
- package/dist/conversation.js.map +1 -1
- package/dist/data/conversations.js +2 -18
- package/dist/data/conversations.js.map +1 -1
- package/dist/data/messages.js +13 -3
- package/dist/data/messages.js.map +1 -1
- package/dist/data/participants.js +2 -4
- package/dist/data/participants.js.map +1 -1
- package/dist/data/users.js +2 -2
- package/dist/data/users.js.map +1 -1
- package/dist/index.js +2 -6
- package/dist/index.js.map +1 -1
- package/dist/media.js.map +1 -1
- package/dist/message-builder.js.map +1 -1
- package/dist/message.js +51 -0
- package/dist/message.js.map +1 -1
- package/dist/node_modules/quick-lru/index.js.map +1 -1
- package/dist/node_modules/tslib/tslib.es6.js.map +1 -1
- package/dist/packages/conversations/package.json.js +1 -1
- package/dist/participant.js +34 -34
- package/dist/participant.js.map +1 -1
- package/dist/push-notification.js.map +1 -1
- package/dist/rest-paginator.js +11 -11
- package/dist/rest-paginator.js.map +1 -1
- package/dist/services/network.js +11 -101
- package/dist/services/network.js.map +1 -1
- package/dist/services/typing-indicator.js +5 -13
- package/dist/services/typing-indicator.js.map +1 -1
- package/dist/unsent-message.js.map +1 -1
- package/dist/user.js.map +1 -1
- package/dist/util/index.js.map +1 -1
- package/docs/assets/css/main.css +2660 -0
- package/docs/assets/images/icons.png +0 -0
- package/docs/assets/images/icons@2x.png +0 -0
- package/docs/assets/images/widgets.png +0 -0
- package/docs/assets/images/widgets@2x.png +0 -0
- package/docs/assets/js/main.js +248 -0
- package/docs/assets/js/search.js +1 -0
- package/docs/classes/AggregatedDeliveryReceipt.html +3182 -144
- package/docs/classes/CancellablePromise.html +3209 -224
- package/docs/classes/ChannelMetadata.html +3049 -66
- package/docs/classes/Client.html +4276 -701
- package/docs/classes/ContentTemplate.html +3115 -96
- package/docs/classes/ContentTemplateVariable.html +3114 -88
- package/docs/classes/Conversation.html +4357 -768
- package/docs/classes/DetailedDeliveryReceipt.html +3162 -116
- package/docs/classes/Media.html +3165 -119
- package/docs/classes/Message.html +3801 -417
- package/docs/classes/MessageBuilder.html +3315 -208
- package/docs/classes/Participant.html +3442 -258
- package/docs/classes/PushNotification.html +3129 -101
- package/docs/classes/RestPaginator.html +3158 -120
- package/docs/classes/UnsentMessage.html +3040 -63
- package/docs/classes/User.html +3347 -209
- package/docs/index.html +4326 -146
- package/docs/interfaces/ClientOptions.html +3049 -66
- package/docs/interfaces/ConversationBindings.html +3000 -109
- package/docs/interfaces/ConversationEmailBinding.html +3000 -109
- package/docs/interfaces/ConversationLimits.html +3097 -87
- package/docs/interfaces/ConversationState.html +3049 -66
- package/docs/interfaces/ConversationUpdatedEventArgs.html +3000 -109
- package/docs/interfaces/CreateConversationOptions.html +3065 -73
- package/docs/interfaces/LastMessage.html +3049 -66
- package/docs/interfaces/Paginator.html +3139 -110
- package/docs/interfaces/ParticipantBindings.html +3000 -109
- package/docs/interfaces/ParticipantEmailBinding.html +3000 -109
- package/docs/interfaces/PushNotificationData.html +3113 -94
- package/docs/interfaces/SendEmailOptions.html +3033 -59
- package/docs/interfaces/SendMediaOptions.html +3067 -75
- package/docs/modules.html +4333 -180
- package/package.json +13 -14
- package/docs/.nojekyll +0 -1
- package/docs/assets/highlight.css +0 -113
- package/docs/assets/main.js +0 -58
- package/docs/assets/search.js +0 -1
- package/docs/assets/style.css +0 -1279
- package/docs/classes/CancellationError.html +0 -112
- package/docs/interfaces/ParticipantBindingOptions.html +0 -110
- package/docs/types/ChannelType.html +0 -106
- package/docs/types/ConnectionState.html +0 -115
- package/docs/types/ContentData.html +0 -106
- package/docs/types/ContentDataAction.html +0 -107
- package/docs/types/ContentDataActionOther.html +0 -121
- package/docs/types/ContentDataActionPhone.html +0 -128
- package/docs/types/ContentDataActionReply.html +0 -133
- package/docs/types/ContentDataActionUrl.html +0 -128
- package/docs/types/ContentDataCallToAction.html +0 -131
- package/docs/types/ContentDataCard.html +0 -137
- package/docs/types/ContentDataListItem.html +0 -121
- package/docs/types/ContentDataListPicker.html +0 -134
- package/docs/types/ContentDataLocation.html +0 -134
- package/docs/types/ContentDataMedia.html +0 -129
- package/docs/types/ContentDataOther.html +0 -121
- package/docs/types/ContentDataQuickReply.html +0 -131
- package/docs/types/ContentDataReply.html +0 -119
- package/docs/types/ContentDataText.html +0 -125
- package/docs/types/ConversationStatus.html +0 -107
- package/docs/types/ConversationUpdateReason.html +0 -106
- package/docs/types/DeliveryAmount.html +0 -106
- package/docs/types/DeliveryStatus.html +0 -106
- package/docs/types/JSONArray.html +0 -106
- package/docs/types/JSONObject.html +0 -111
- package/docs/types/JSONValue.html +0 -106
- package/docs/types/LogLevel.html +0 -106
- package/docs/types/MediaCategory.html +0 -106
- package/docs/types/MessageType.html +0 -106
- package/docs/types/MessageUpdateReason.html +0 -106
- package/docs/types/NotificationLevel.html +0 -109
- package/docs/types/NotificationsChannelType.html +0 -110
- package/docs/types/ParticipantEmailLevel.html +0 -108
- package/docs/types/ParticipantType.html +0 -107
- package/docs/types/ParticipantUpdateReason.html +0 -106
- package/docs/types/PushNotificationType.html +0 -106
- package/docs/types/State.html +0 -110
- package/docs/types/UserUpdateReason.html +0 -106
package/builds/lib.d.ts
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
/// <reference types="node" />
|
2
2
|
import { SyncClient, SyncDocument, SyncList } from "twilio-sync";
|
3
3
|
import { LogLevelDesc } from "loglevel";
|
4
|
-
import { TwilsockClient } from "twilsock";
|
4
|
+
import { Transport, TwilsockClient, InitRegistration, TransportResult } from "twilsock";
|
5
|
+
import { ConnectionState as TwilsockConnectionState } from "twilsock";
|
5
6
|
import { ReplayEventEmitter } from "@twilio/replay-event-emitter";
|
6
|
-
import { JSONValue, CancellationError } from "@twilio/shared";
|
7
|
-
import { CancellablePromise as CancellablePromise$0 } from "@twilio/shared";
|
8
7
|
import { ChannelType, Notifications } from "@twilio/notifications";
|
9
8
|
import { Notifications as NotificationClient } from "@twilio/notifications";
|
10
9
|
import { CancellablePromise, McsClient, MediaCategory, McsMedia } from "@twilio/mcs-client";
|
10
|
+
import { MediaCategory as McsMediaCategory } from "@twilio/mcs-client";
|
11
11
|
interface ConfigurationResponse {
|
12
12
|
options: {
|
13
13
|
consumption_report_interval: string;
|
@@ -114,7 +114,7 @@ declare class Configuration {
|
|
114
114
|
constructor(options: ClientOptions, configurationResponse: ConfigurationResponse, logger: Logger);
|
115
115
|
}
|
116
116
|
interface CommandExecutorServices {
|
117
|
-
transport:
|
117
|
+
transport: Transport;
|
118
118
|
}
|
119
119
|
declare class CommandExecutor {
|
120
120
|
private _serviceUrl;
|
@@ -126,6 +126,20 @@ declare class CommandExecutor {
|
|
126
126
|
fetchResource<Request = void, Response = void>(url: string, requestBody?: Request): Promise<Response>;
|
127
127
|
mutateResource<Request = void, Response = void>(method: "post" | "delete", url: string, requestBody?: Request): Promise<Response>;
|
128
128
|
}
|
129
|
+
/**
|
130
|
+
* Represents a JSON value.
|
131
|
+
*/
|
132
|
+
type JSONValue = null | string | number | boolean | JSONObject | JSONArray;
|
133
|
+
/**
|
134
|
+
* Represents a JSON object.
|
135
|
+
*/
|
136
|
+
type JSONObject = {
|
137
|
+
[x: string]: JSONValue;
|
138
|
+
};
|
139
|
+
/**
|
140
|
+
* Represents a JSON array.
|
141
|
+
*/
|
142
|
+
type JSONArray = JSONValue[];
|
129
143
|
type UserEvents = {
|
130
144
|
updated: (data: {
|
131
145
|
user: User;
|
@@ -252,16 +266,12 @@ declare class Network {
|
|
252
266
|
private cacheLifetime;
|
253
267
|
private readonly cache;
|
254
268
|
private timer;
|
255
|
-
private pendingRequests;
|
256
|
-
private isShutdownInitiated;
|
257
269
|
constructor(configuration: any, services: any);
|
258
270
|
private isExpired;
|
259
271
|
private cleanupCache;
|
260
272
|
pokeTimer(): void;
|
261
|
-
private static responsePostProcess;
|
262
273
|
private executeWithRetry;
|
263
|
-
get(url: string): Promise<
|
264
|
-
disconnect(): Promise<void>;
|
274
|
+
get<T>(url: string): Promise<TransportResult<T>>;
|
265
275
|
}
|
266
276
|
type UsersEvents = {
|
267
277
|
userUpdated: (data: {
|
@@ -421,7 +431,7 @@ declare class Participant extends ReplayEventEmitter<ParticipantEvents> {
|
|
421
431
|
* using the type dynamically `participant.bindings[participant.type]`
|
422
432
|
* just be aware that the binding information has different structure for
|
423
433
|
* each participant type.
|
424
|
-
* See also {
|
434
|
+
* See also {ParticipantEmailBinding}, the only available currently binding descriptor.
|
425
435
|
*/
|
426
436
|
get bindings(): ParticipantBindings;
|
427
437
|
/**
|
@@ -483,15 +493,39 @@ declare class Participant extends ReplayEventEmitter<ParticipantEvents> {
|
|
483
493
|
*/
|
484
494
|
updateAttributes(attributes: JSONValue): Promise<Participant>;
|
485
495
|
}
|
486
|
-
|
487
|
-
|
488
|
-
|
496
|
+
interface ParticipantResponse {
|
497
|
+
account_sid: string;
|
498
|
+
chat_service_sid: string;
|
499
|
+
conversation_sid: string;
|
500
|
+
role_sid: string;
|
501
|
+
sid: string;
|
502
|
+
attributes: string;
|
503
|
+
date_created: string;
|
504
|
+
date_updated: string;
|
505
|
+
identity: string;
|
506
|
+
messaging_binding: {
|
507
|
+
type: "chat" | "sms" | "whatsapp" | "email";
|
508
|
+
address: string;
|
509
|
+
proxy_address: string;
|
510
|
+
} | null;
|
511
|
+
url: string;
|
512
|
+
links: {
|
513
|
+
conversation: string;
|
514
|
+
};
|
515
|
+
}
|
489
516
|
interface ParticipantBindingOptions {
|
490
517
|
email?: ParticipantEmailBinding;
|
491
518
|
}
|
519
|
+
/**
|
520
|
+
* Category of media. Possible values are as follows:
|
521
|
+
* * `'media'`
|
522
|
+
* * `'body'`
|
523
|
+
* * `'history'`
|
524
|
+
*/
|
525
|
+
type MediaCategory$0 = McsMediaCategory;
|
492
526
|
interface MediaState {
|
493
527
|
sid: string;
|
494
|
-
category: MediaCategory;
|
528
|
+
category: MediaCategory$0;
|
495
529
|
filename: string | null;
|
496
530
|
contentType: string;
|
497
531
|
size: number;
|
@@ -529,7 +563,7 @@ declare class Media {
|
|
529
563
|
/**
|
530
564
|
* Media category, can be one of the {@link MediaCategory} values.
|
531
565
|
*/
|
532
|
-
get category(): MediaCategory;
|
566
|
+
get category(): MediaCategory$0;
|
533
567
|
/**
|
534
568
|
* Returns the direct content URL for the media.
|
535
569
|
*
|
@@ -1115,7 +1149,7 @@ declare class ContentTemplateVariable {
|
|
1115
1149
|
/**
|
1116
1150
|
* A rich content template.
|
1117
1151
|
*
|
1118
|
-
* Use {@
|
1152
|
+
* Use {@Link Client.getContentTemplates} to request all the templates available
|
1119
1153
|
* for the current account.
|
1120
1154
|
*/
|
1121
1155
|
declare class ContentTemplate {
|
@@ -1215,8 +1249,8 @@ interface MessageData {
|
|
1215
1249
|
attributes?: JSONValue;
|
1216
1250
|
dateUpdated: string;
|
1217
1251
|
timestamp?: string;
|
1218
|
-
medias
|
1219
|
-
media
|
1252
|
+
medias?: Media[];
|
1253
|
+
media?: Media;
|
1220
1254
|
memberSid?: string;
|
1221
1255
|
delivery?: AggregatedDeliveryDescriptor;
|
1222
1256
|
channelMetadata?: boolean;
|
@@ -1299,6 +1333,11 @@ declare class Message extends ReplayEventEmitter<MessageEvents> {
|
|
1299
1333
|
* Type of the message.
|
1300
1334
|
*/
|
1301
1335
|
get type(): MessageType;
|
1336
|
+
/**
|
1337
|
+
* One of the attached media (if present).
|
1338
|
+
* @deprecated Use attachedMedia instead. Note that the latter is now an array.
|
1339
|
+
*/
|
1340
|
+
get media(): Media | null;
|
1302
1341
|
/**
|
1303
1342
|
* Return all media attachments, except email body/history attachments, without temporary urls.
|
1304
1343
|
*/
|
@@ -1311,6 +1350,14 @@ declare class Message extends ReplayEventEmitter<MessageEvents> {
|
|
1311
1350
|
* Aggregated information about the message delivery statuses across all participants of a conversation..
|
1312
1351
|
*/
|
1313
1352
|
get aggregatedDeliveryReceipt(): AggregatedDeliveryReceipt | null;
|
1353
|
+
/**
|
1354
|
+
* @deprecated
|
1355
|
+
* Return a (possibly empty) array of media matching a specific set of categories.
|
1356
|
+
* Allowed category is so far only 'media'.
|
1357
|
+
* @param categories Array of categories to match.
|
1358
|
+
* @returns Array of media descriptors matching given categories.
|
1359
|
+
*/
|
1360
|
+
getMediaByCategory(categories: Array<MediaCategory>): Array<Media> | null;
|
1314
1361
|
/**
|
1315
1362
|
* Return a (possibly empty) array of media matching a specific set of categories.
|
1316
1363
|
* Allowed category is so far only 'media'.
|
@@ -1353,6 +1400,12 @@ declare class Message extends ReplayEventEmitter<MessageEvents> {
|
|
1353
1400
|
* @param attributes New attributes.
|
1354
1401
|
*/
|
1355
1402
|
updateAttributes(attributes: JSONValue): Promise<Message>;
|
1403
|
+
/**
|
1404
|
+
* @deprecated
|
1405
|
+
* Get content URLs for all media attachments in the given set using a single operation.
|
1406
|
+
* @param contentSet Set of media attachments to query content URLs.
|
1407
|
+
*/
|
1408
|
+
attachTemporaryUrlsFor(contentSet: Media[] | null): Promise<Media[]>;
|
1356
1409
|
/**
|
1357
1410
|
* Get content URLs for all media attachments in the given set using a single operation.
|
1358
1411
|
* @param contentSet Set of media attachments to query content URLs.
|
@@ -1513,14 +1566,12 @@ interface MessageResponse {
|
|
1513
1566
|
participant_sid: string;
|
1514
1567
|
body: string;
|
1515
1568
|
subject: string;
|
1516
|
-
content_sid: string;
|
1517
1569
|
date_created: string;
|
1518
1570
|
date_updated: string;
|
1519
1571
|
url: string;
|
1520
1572
|
media: {
|
1521
1573
|
sid: string;
|
1522
1574
|
size: string;
|
1523
|
-
category: string;
|
1524
1575
|
content_type: string;
|
1525
1576
|
filename: string;
|
1526
1577
|
}[] | null;
|
@@ -1591,7 +1642,7 @@ declare class Messages extends ReplayEventEmitter<MessagesEvents> {
|
|
1591
1642
|
*/
|
1592
1643
|
getMessages(pageSize: number | undefined, anchor: number | "end" | undefined, direction?: "forward" | "backwards"): Promise<SyncPaginator<Message>>;
|
1593
1644
|
private _wrapPaginator;
|
1594
|
-
_upsertMessage
|
1645
|
+
private _upsertMessage;
|
1595
1646
|
/**
|
1596
1647
|
* Returns last messages from conversation
|
1597
1648
|
* @param {Number} [pageSize] Number of messages to return in single chunk. By default it's 30.
|
@@ -2108,7 +2159,7 @@ declare class Conversation extends ReplayEventEmitter<ConversationEvents> {
|
|
2108
2159
|
* @param attributes Attributes to be attached to the participant.
|
2109
2160
|
* @returns The added participant.
|
2110
2161
|
*/
|
2111
|
-
add(identity: string, attributes?: JSONValue): Promise<
|
2162
|
+
add(identity: string, attributes?: JSONValue): Promise<ParticipantResponse>;
|
2112
2163
|
/**
|
2113
2164
|
* Add a non-chat participant to the conversation.
|
2114
2165
|
* @param proxyAddress Proxy (Twilio) address of the participant.
|
@@ -2118,7 +2169,7 @@ declare class Conversation extends ReplayEventEmitter<ConversationEvents> {
|
|
2118
2169
|
* CC/To level.
|
2119
2170
|
* @returns The added participant.
|
2120
2171
|
*/
|
2121
|
-
addNonChatParticipant(proxyAddress: string, address: string, attributes?: JSONValue, bindingOptions?: ParticipantBindingOptions): Promise<
|
2172
|
+
addNonChatParticipant(proxyAddress: string, address: string, attributes?: JSONValue, bindingOptions?: ParticipantBindingOptions): Promise<ParticipantResponse>;
|
2122
2173
|
/**
|
2123
2174
|
* Advance the conversation's last read message index to the current read
|
2124
2175
|
* horizon. Rejects if the user is not a participant of the conversation. Last
|
@@ -2233,7 +2284,7 @@ declare class Conversation extends ReplayEventEmitter<ConversationEvents> {
|
|
2233
2284
|
* @param emailOptions Email options for the message.
|
2234
2285
|
* @return Index of the new message.
|
2235
2286
|
*/
|
2236
|
-
sendMessage(message: null | string | FormData | SendMediaOptions, messageAttributes?: JSONValue, emailOptions?: SendEmailOptions): Promise<
|
2287
|
+
sendMessage(message: null | string | FormData | SendMediaOptions, messageAttributes?: JSONValue, emailOptions?: SendEmailOptions): Promise<number>;
|
2237
2288
|
/**
|
2238
2289
|
* New interface to prepare for sending a message.
|
2239
2290
|
* Use this instead of {@link Conversation.sendMessage}.
|
@@ -2340,9 +2391,6 @@ declare class Conversation extends ReplayEventEmitter<ConversationEvents> {
|
|
2340
2391
|
private _setLastReadMessageIndex;
|
2341
2392
|
}
|
2342
2393
|
type ConversationsDataSource = "sync" | "rest";
|
2343
|
-
/**
|
2344
|
-
* Type of a push notification.
|
2345
|
-
*/
|
2346
2394
|
type PushNotificationType = "twilio.conversations.new_message" | "twilio.conversations.added_to_conversation" | "twilio.conversations.removed_from_conversation";
|
2347
2395
|
interface PushNotificationDescriptor {
|
2348
2396
|
title: string | null;
|
@@ -2454,11 +2502,12 @@ type ClientEvents = {
|
|
2454
2502
|
user: User;
|
2455
2503
|
updateReasons: UserUpdateReason[];
|
2456
2504
|
}) => void;
|
2505
|
+
stateChanged: (state: State) => void;
|
2457
2506
|
initialized: () => void;
|
2458
2507
|
initFailed: ({ error }: {
|
2459
2508
|
error?: ConnectionError;
|
2460
2509
|
}) => void;
|
2461
|
-
connectionStateChanged: (state:
|
2510
|
+
connectionStateChanged: (state: TwilsockConnectionState) => void;
|
2462
2511
|
connectionError: (data: ConnectionError) => void;
|
2463
2512
|
};
|
2464
2513
|
/**
|
@@ -2471,7 +2520,7 @@ type ClientEvents = {
|
|
2471
2520
|
* * `'denied'` - client connection is denied because of invalid JWT access
|
2472
2521
|
* token. User must refresh token in order to proceed
|
2473
2522
|
*/
|
2474
|
-
type ConnectionState =
|
2523
|
+
type ConnectionState = TwilsockConnectionState;
|
2475
2524
|
/**
|
2476
2525
|
* State of the client. Possible values are as follows:
|
2477
2526
|
* * `'failed'` - the client failed to initialize
|
@@ -2503,7 +2552,7 @@ interface ClientOptions {
|
|
2503
2552
|
region?: string;
|
2504
2553
|
productId?: string;
|
2505
2554
|
twilsockClient?: TwilsockClient;
|
2506
|
-
transport?:
|
2555
|
+
transport?: Transport;
|
2507
2556
|
notificationsClient?: NotificationClient;
|
2508
2557
|
syncClient?: SyncClient;
|
2509
2558
|
typingIndicatorTimeoutOverride?: number;
|
@@ -2518,6 +2567,7 @@ interface ClientOptions {
|
|
2518
2567
|
Notification?: Record<string, unknown>;
|
2519
2568
|
Twilsock?: Record<string, unknown>;
|
2520
2569
|
clientMetadata?: Record<string, unknown>;
|
2570
|
+
initRegistrations?: InitRegistration[];
|
2521
2571
|
disableDeepClone?: boolean;
|
2522
2572
|
typingUri?: string;
|
2523
2573
|
apiUri?: string;
|
@@ -2717,6 +2767,15 @@ declare class Client extends ReplayEventEmitter<ClientEvents> {
|
|
2717
2767
|
* @event
|
2718
2768
|
*/
|
2719
2769
|
static readonly userUpdated = "userUpdated";
|
2770
|
+
/**
|
2771
|
+
* @deprecated Use initialized or initFailed events instead
|
2772
|
+
* Fired when the state of the client has been changed.
|
2773
|
+
*
|
2774
|
+
* Parameters:
|
2775
|
+
* 1. {@link State} `state` - the new client state
|
2776
|
+
* @event
|
2777
|
+
*/
|
2778
|
+
static readonly stateChanged = "stateChanged";
|
2720
2779
|
/**
|
2721
2780
|
* Fired when the client has completed initialization successfully.
|
2722
2781
|
* @event
|
@@ -2776,7 +2835,7 @@ declare class Client extends ReplayEventEmitter<ClientEvents> {
|
|
2776
2835
|
/**
|
2777
2836
|
* Client connection state.
|
2778
2837
|
*/
|
2779
|
-
connectionState: ConnectionState
|
2838
|
+
connectionState: ConnectionState;
|
2780
2839
|
/**
|
2781
2840
|
* Promise that resolves on successful initialization.
|
2782
2841
|
*/
|
@@ -2840,6 +2899,32 @@ declare class Client extends ReplayEventEmitter<ClientEvents> {
|
|
2840
2899
|
* initialization was completed.
|
2841
2900
|
*/
|
2842
2901
|
get reachabilityEnabled(): boolean;
|
2902
|
+
/**
|
2903
|
+
* @deprecated
|
2904
|
+
* Current token.
|
2905
|
+
* @internal
|
2906
|
+
*/
|
2907
|
+
get token(): string;
|
2908
|
+
/**
|
2909
|
+
* @deprecated Call constructor directly.
|
2910
|
+
*
|
2911
|
+
* Factory method to create a Conversations client instance.
|
2912
|
+
*
|
2913
|
+
* The factory method will automatically trigger connection.
|
2914
|
+
* Do not use it if you need finer-grained control.
|
2915
|
+
*
|
2916
|
+
* Since this method returns an already-initialized client, some of the events
|
2917
|
+
* will be lost because they happen *before* the initialization. It is
|
2918
|
+
* recommended that `client.onWithReplay` is used as opposed to `client.on`
|
2919
|
+
* for subscribing to client events. The `client.onWithReplay` will re-emit
|
2920
|
+
* the most recent value for a given event if it emitted before the
|
2921
|
+
* subscription.
|
2922
|
+
*
|
2923
|
+
* @param token Access token.
|
2924
|
+
* @param options Options to customize the client.
|
2925
|
+
* @returns Returns a fully initialized client.
|
2926
|
+
*/
|
2927
|
+
static create(token: string, options?: ClientOptions | null): Promise<Client>;
|
2843
2928
|
/**
|
2844
2929
|
* Static method for push notification payload parsing. Returns parsed push as
|
2845
2930
|
* a {@link PushNotification} object.
|
@@ -2851,6 +2936,11 @@ declare class Client extends ReplayEventEmitter<ClientEvents> {
|
|
2851
2936
|
* @param data Data to parse
|
2852
2937
|
*/
|
2853
2938
|
private static _parsePushNotificationChatData;
|
2939
|
+
/**
|
2940
|
+
* Populate the client with init registrations.
|
2941
|
+
* @param reg The init registration to populate.
|
2942
|
+
*/
|
2943
|
+
static populateInitRegistrations(reg: InitRegistration): void;
|
2854
2944
|
/**
|
2855
2945
|
* Gracefully shut down the client.
|
2856
2946
|
*/
|
@@ -2893,6 +2983,12 @@ declare class Client extends ReplayEventEmitter<ClientEvents> {
|
|
2893
2983
|
* on the platform.
|
2894
2984
|
*/
|
2895
2985
|
setPushRegistrationId(channelType: NotificationsChannelType, registrationId: string): Promise<void>;
|
2986
|
+
/**
|
2987
|
+
* Unregister from push notifications.
|
2988
|
+
* @param channelType Channel type.
|
2989
|
+
* @deprecated Use removePushRegistrations() instead.
|
2990
|
+
*/
|
2991
|
+
unsetPushRegistrationId(channelType: NotificationsChannelType): Promise<void>;
|
2896
2992
|
/**
|
2897
2993
|
* Clear existing registrations directly using provided device token.
|
2898
2994
|
* This is useful to ensure stopped subscriptions without resubscribing.
|
@@ -2955,6 +3051,11 @@ declare class Client extends ReplayEventEmitter<ClientEvents> {
|
|
2955
3051
|
* @param channelType The channel type to subscribe to.
|
2956
3052
|
*/
|
2957
3053
|
private _subscribeToPushNotifications;
|
3054
|
+
/**
|
3055
|
+
* Unsubscribe from push notifications.
|
3056
|
+
* @param channelType The channel type to unsubscribe from.
|
3057
|
+
*/
|
3058
|
+
private _unsubscribeFromPushNotifications;
|
2958
3059
|
}
|
2959
3060
|
declare class NotificationTypes {
|
2960
3061
|
static readonly TYPING_INDICATOR = "twilio.ipmsg.typing_indicator";
|
@@ -2964,7 +3065,4 @@ declare class NotificationTypes {
|
|
2964
3065
|
static readonly REMOVED_FROM_CONVERSATION = "twilio.conversations.removed_from_conversation";
|
2965
3066
|
static readonly CONSUMPTION_UPDATE = "twilio.channel.consumption_update";
|
2966
3067
|
}
|
2967
|
-
export { Conversation, ConversationBindings, ConversationEmailBinding, ConversationUpdateReason, ConversationStatus, NotificationLevel, ConversationState, ConversationUpdatedEventArgs, SendMediaOptions, SendEmailOptions, LastMessage, Participant, ParticipantUpdateReason, ParticipantType, ParticipantUpdatedEventArgs, ParticipantBindings, ParticipantEmailBinding, ParticipantEmailLevel, Message, MessageUpdateReason, MessageType, MessageUpdatedEventArgs, Media, AggregatedDeliveryReceipt, DeliveryAmount, DetailedDeliveryReceipt, DeliveryStatus, RestPaginator, MessageBuilder, UnsentMessage, Paginator, ParticipantBindingOptions, User, UserUpdateReason, UserUpdatedEventArgs, PushNotification, PushNotificationType, PushNotificationDescriptor, PushNotificationData, NotificationTypes, Client, State, ConnectionState, NotificationsChannelType, ClientOptions, CreateConversationOptions, ConversationLimits,
|
2968
|
-
export { JSONValue, JSONObject, JSONArray } from "@twilio/shared";
|
2969
|
-
export { MediaCategory } from "@twilio/mcs-client";
|
2970
|
-
export { ChannelType } from "@twilio/notifications";
|
3068
|
+
export { Conversation, ConversationBindings, ConversationEmailBinding, ConversationUpdateReason, ConversationStatus, NotificationLevel, ConversationState, ConversationUpdatedEventArgs, SendMediaOptions, SendEmailOptions, LastMessage, Participant, ParticipantUpdateReason, ParticipantType, ParticipantUpdatedEventArgs, ParticipantBindings, ParticipantEmailBinding, ParticipantEmailLevel, Message, MessageUpdateReason, MessageType, MessageUpdatedEventArgs, Media, MediaCategory$0 as MediaCategory, AggregatedDeliveryReceipt, DeliveryAmount, DetailedDeliveryReceipt, DeliveryStatus, RestPaginator, MessageBuilder, UnsentMessage, Paginator, ParticipantBindingOptions, User, UserUpdateReason, UserUpdatedEventArgs, PushNotification, PushNotificationType, PushNotificationDescriptor, PushNotificationData, NotificationTypes, Client, State, ConnectionState, NotificationsChannelType, ClientOptions, CreateConversationOptions, ConversationLimits, JSONValue, JSONObject, JSONArray, CancellablePromise, ContentDataActionUrl, ContentDataActionPhone, ContentDataActionReply, ContentDataActionOther, ContentDataAction, ContentDataText, ContentDataMedia, ContentDataLocation, ContentDataReply, ContentDataQuickReply, ContentDataCallToAction, ContentDataListPicker, ContentDataListItem, ContentDataCard, ContentDataOther, ContentData, ContentTemplate, ContentTemplateVariable, ChannelMetadata };
|