@twilio/conversations 3.0.0-rc.9 → 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/README.md +38 -28
- package/builds/browser.js +1659 -264
- package/builds/browser.js.map +1 -1
- package/builds/lib.d.ts +650 -25
- package/builds/lib.js +1650 -264
- package/builds/lib.js.map +1 -1
- package/builds/twilio-conversations.js +4300 -1842
- package/builds/twilio-conversations.min.js +1 -1
- package/dist/aggregated-delivery-receipt.js +10 -1
- package/dist/aggregated-delivery-receipt.js.map +1 -1
- package/dist/channel-metadata-client.js +192 -0
- package/dist/channel-metadata-client.js.map +1 -0
- package/dist/client.js +70 -10
- package/dist/client.js.map +1 -1
- package/dist/command-executor.js +48 -6
- package/dist/command-executor.js.map +1 -1
- package/dist/configuration.js +14 -3
- package/dist/configuration.js.map +1 -1
- package/dist/content-client.js +184 -0
- package/dist/content-client.js.map +1 -0
- package/dist/content-template.js +310 -0
- package/dist/content-template.js.map +1 -0
- package/dist/conversation.js +59 -16
- package/dist/conversation.js.map +1 -1
- package/dist/data/conversations.js +25 -3
- package/dist/data/conversations.js.map +1 -1
- package/dist/data/messages.js +23 -6
- package/dist/data/messages.js.map +1 -1
- package/dist/data/participants.js +17 -8
- package/dist/data/participants.js.map +1 -1
- package/dist/data/users.js +9 -0
- package/dist/data/users.js.map +1 -1
- package/dist/detailed-delivery-receipt.js +9 -0
- package/dist/detailed-delivery-receipt.js.map +1 -1
- package/dist/index.js +14 -0
- package/dist/index.js.map +1 -1
- package/dist/interfaces/notification-types.js +9 -0
- package/dist/interfaces/notification-types.js.map +1 -1
- package/dist/interfaces/{attributes.js → rules.js} +26 -7
- package/dist/interfaces/rules.js.map +1 -0
- package/dist/logger.js +9 -0
- package/dist/logger.js.map +1 -1
- package/dist/media.js +9 -0
- package/dist/media.js.map +1 -1
- package/dist/message-builder.js +77 -6
- package/dist/message-builder.js.map +1 -1
- package/dist/message.js +156 -12
- package/dist/message.js.map +1 -1
- package/dist/node_modules/quick-lru/index.js +265 -0
- package/dist/node_modules/quick-lru/index.js.map +1 -0
- package/dist/node_modules/tslib/tslib.es6.js +9 -0
- package/dist/node_modules/tslib/tslib.es6.js.map +1 -1
- package/dist/packages/conversations/package.json.js +10 -1
- package/dist/packages/conversations/package.json.js.map +1 -1
- package/dist/participant.js +11 -2
- package/dist/participant.js.map +1 -1
- package/dist/push-notification.js +9 -0
- package/dist/push-notification.js.map +1 -1
- package/dist/rest-paginator.js +9 -0
- package/dist/rest-paginator.js.map +1 -1
- package/dist/services/network.js +9 -0
- package/dist/services/network.js.map +1 -1
- package/dist/services/typing-indicator.js +9 -0
- package/dist/services/typing-indicator.js.map +1 -1
- package/dist/unsent-message.js +9 -0
- package/dist/unsent-message.js.map +1 -1
- package/dist/user.js +20 -3
- package/dist/user.js.map +1 -1
- package/dist/util/deferred.js +9 -0
- package/dist/util/deferred.js.map +1 -1
- package/dist/util/index.js +9 -0
- package/dist/util/index.js.map +1 -1
- package/docs/assets/js/search.js +1 -1
- package/docs/classes/AggregatedDeliveryReceipt.html +1 -1
- package/docs/classes/ChannelMetadata.html +3050 -0
- package/docs/classes/Client.html +64 -25
- package/docs/classes/ContentTemplate.html +3116 -0
- package/docs/classes/ContentTemplateVariable.html +3116 -0
- package/docs/classes/Conversation.html +14 -9
- package/docs/classes/Message.html +76 -5
- package/docs/classes/MessageBuilder.html +41 -0
- package/docs/classes/Participant.html +2 -2
- package/docs/index.html +849 -25
- package/docs/interfaces/ClientOptions.html +16 -0
- package/docs/modules.html +848 -24
- package/package.json +18 -14
- package/CHANGELOG.md +0 -509
- package/dist/interfaces/attributes.js.map +0 -1
package/builds/lib.d.ts
CHANGED
@@ -1,6 +1,7 @@
|
|
1
|
+
/// <reference types="node" />
|
1
2
|
import { SyncClient, SyncDocument, SyncList } from "twilio-sync";
|
2
3
|
import { LogLevelDesc } from "loglevel";
|
3
|
-
import { Transport, TwilsockClient, InitRegistration,
|
4
|
+
import { Transport, TwilsockClient, InitRegistration, TransportResult } from "twilsock";
|
4
5
|
import { ConnectionState as TwilsockConnectionState } from "twilsock";
|
5
6
|
import { ReplayEventEmitter } from "@twilio/replay-event-emitter";
|
6
7
|
import { ChannelType, Notifications } from "@twilio/notifications";
|
@@ -109,6 +110,7 @@ declare class Configuration {
|
|
109
110
|
readonly userIdentity: string;
|
110
111
|
readonly userInfo: string;
|
111
112
|
readonly myConversations: string;
|
113
|
+
readonly channelMetadataCacheCapacity: number;
|
112
114
|
constructor(options: ClientOptions, configurationResponse: ConfigurationResponse, logger: Logger);
|
113
115
|
}
|
114
116
|
interface CommandExecutorServices {
|
@@ -121,8 +123,8 @@ declare class CommandExecutor {
|
|
121
123
|
constructor(_serviceUrl: string, _services: CommandExecutorServices, _productId?: string);
|
122
124
|
private _preProcessUrl;
|
123
125
|
private _makeRequest;
|
124
|
-
fetchResource<
|
125
|
-
mutateResource<
|
126
|
+
fetchResource<Request = void, Response = void>(url: string, requestBody?: Request): Promise<Response>;
|
127
|
+
mutateResource<Request = void, Response = void>(method: "post" | "delete", url: string, requestBody?: Request): Promise<Response>;
|
126
128
|
}
|
127
129
|
/**
|
128
130
|
* Represents a JSON value.
|
@@ -343,9 +345,10 @@ interface ParticipantLinks {
|
|
343
345
|
*/
|
344
346
|
type ParticipantUpdateReason = "attributes" | "dateCreated" | "dateUpdated" | "roleSid" | "lastReadMessageIndex" | "lastReadTimestamp" | "bindings";
|
345
347
|
/**
|
346
|
-
*
|
348
|
+
* Participant type. The string variant can be used to denote new types of
|
349
|
+
* participant that aren't supported by this version of the SDK.
|
347
350
|
*/
|
348
|
-
type ParticipantType = "chat" | "sms" | "whatsapp" | "email";
|
351
|
+
type ParticipantType = "chat" | "sms" | "whatsapp" | "email" | string;
|
349
352
|
interface ParticipantUpdatedEventArgs {
|
350
353
|
participant: Participant;
|
351
354
|
updateReasons: ParticipantUpdateReason[];
|
@@ -490,6 +493,26 @@ declare class Participant extends ReplayEventEmitter<ParticipantEvents> {
|
|
490
493
|
*/
|
491
494
|
updateAttributes(attributes: JSONValue): Promise<Participant>;
|
492
495
|
}
|
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
|
+
}
|
493
516
|
interface ParticipantBindingOptions {
|
494
517
|
email?: ParticipantEmailBinding;
|
495
518
|
}
|
@@ -567,7 +590,7 @@ interface AggregatedDeliveryDescriptor {
|
|
567
590
|
* Contains aggregated information about delivery statuses of a message across all participants
|
568
591
|
* of a conversation.
|
569
592
|
*
|
570
|
-
* At any moment during the message delivery to a participant, the message can have zero or more of following
|
593
|
+
* At any moment during the message delivery to a participant, the message can have zero or more of the following
|
571
594
|
* delivery statuses:
|
572
595
|
* * Message is considered as **sent** to a participant if the nearest upstream carrier accepted the message.
|
573
596
|
* * Message is considered as **delivered** to a participant if Twilio has received confirmation of message
|
@@ -693,6 +716,499 @@ declare class DetailedDeliveryReceipt {
|
|
693
716
|
*/
|
694
717
|
constructor(descriptor: DetailedDeliveryReceiptDescriptor);
|
695
718
|
}
|
719
|
+
type ContentDataActionResponse = Readonly<{
|
720
|
+
type: string;
|
721
|
+
title: string;
|
722
|
+
id?: string;
|
723
|
+
url?: string;
|
724
|
+
phone?: string;
|
725
|
+
index?: number;
|
726
|
+
}>;
|
727
|
+
type ContentDataTextResponse = Readonly<{
|
728
|
+
body: string;
|
729
|
+
}>;
|
730
|
+
type ContentDataMediaResponse = Readonly<{
|
731
|
+
body?: string;
|
732
|
+
media: string[];
|
733
|
+
}>;
|
734
|
+
type ContentDataLocationResponse = Readonly<{
|
735
|
+
longitude: number;
|
736
|
+
latitude: number;
|
737
|
+
label?: string;
|
738
|
+
}>;
|
739
|
+
type ContentDataQuickReplyResponse = Readonly<{
|
740
|
+
body: string;
|
741
|
+
actions: Readonly<{
|
742
|
+
title: string;
|
743
|
+
id?: string;
|
744
|
+
}>[];
|
745
|
+
}>;
|
746
|
+
type ContentDataCallToActionResponse = Readonly<{
|
747
|
+
body: string;
|
748
|
+
actions: ContentDataActionResponse[];
|
749
|
+
}>;
|
750
|
+
type ContentDataListPickerResponse = Readonly<{
|
751
|
+
body: string;
|
752
|
+
button: string;
|
753
|
+
items: Readonly<{
|
754
|
+
id: string;
|
755
|
+
item: string;
|
756
|
+
description?: string;
|
757
|
+
}>[];
|
758
|
+
}>;
|
759
|
+
type ContentDataCardResponse = Readonly<{
|
760
|
+
title: string;
|
761
|
+
subtitle?: string;
|
762
|
+
media?: string[];
|
763
|
+
actions?: ContentDataActionResponse[];
|
764
|
+
}>;
|
765
|
+
type ContentDataResponse = Readonly<{
|
766
|
+
"twilio/text"?: ContentDataTextResponse;
|
767
|
+
"twilio/media"?: ContentDataMediaResponse;
|
768
|
+
"twilio/location"?: ContentDataLocationResponse;
|
769
|
+
"twilio/quick-reply"?: ContentDataQuickReplyResponse;
|
770
|
+
"twilio/call-to-action"?: ContentDataCallToActionResponse;
|
771
|
+
"twilio/list-picker"?: ContentDataListPickerResponse;
|
772
|
+
"twilio/card"?: ContentDataCardResponse;
|
773
|
+
}>;
|
774
|
+
type ContentTemplateResponse = Readonly<{
|
775
|
+
sid: string;
|
776
|
+
account_sid: string;
|
777
|
+
friendly_name: string;
|
778
|
+
variables: string;
|
779
|
+
variants: ContentDataResponse;
|
780
|
+
date_created: string;
|
781
|
+
date_updated: string;
|
782
|
+
}>;
|
783
|
+
/**
|
784
|
+
* Shows a button that sends back a predefined text. Used in
|
785
|
+
* {@link ContentDataQuickReply}.
|
786
|
+
*/
|
787
|
+
type ContentDataReply = {
|
788
|
+
/**
|
789
|
+
* Display value of the action. This is the message that will be sent back
|
790
|
+
* when the user taps on the button.
|
791
|
+
*/
|
792
|
+
readonly title: string;
|
793
|
+
/**
|
794
|
+
* Postback payload. This field is not visible to the end user.
|
795
|
+
*/
|
796
|
+
readonly id?: string;
|
797
|
+
};
|
798
|
+
/**
|
799
|
+
* Shows a button that redirects recipient to a predefined URL.
|
800
|
+
*/
|
801
|
+
type ContentDataActionUrl = {
|
802
|
+
/**
|
803
|
+
* The type discriminant.
|
804
|
+
*/
|
805
|
+
readonly type: "url";
|
806
|
+
/**
|
807
|
+
* Display value for the action.
|
808
|
+
*/
|
809
|
+
readonly title: string;
|
810
|
+
/**
|
811
|
+
* URL to direct to when the recipient taps the button.
|
812
|
+
*/
|
813
|
+
readonly url: string;
|
814
|
+
/**
|
815
|
+
* Full data as a stringified JSON. This could be used for future content
|
816
|
+
* types and fields which are not yet supported by the newest version of
|
817
|
+
* the Conversations SDK, or for using newer types in the older versions of
|
818
|
+
* the SDK.
|
819
|
+
*/
|
820
|
+
readonly rawData: string;
|
821
|
+
};
|
822
|
+
/**
|
823
|
+
* Shows a button that calls a phone number.
|
824
|
+
*/
|
825
|
+
type ContentDataActionPhone = {
|
826
|
+
/**
|
827
|
+
* The type discriminant.
|
828
|
+
*/
|
829
|
+
readonly type: "phone";
|
830
|
+
/**
|
831
|
+
* Display value for the action.
|
832
|
+
*/
|
833
|
+
readonly title: string;
|
834
|
+
/**
|
835
|
+
* Phone number to call when the recipient taps the button.
|
836
|
+
*/
|
837
|
+
readonly phone: string;
|
838
|
+
/**
|
839
|
+
* Full data as a stringified JSON. This could be used for future content
|
840
|
+
* types and fields which are not yet supported by the newest version of
|
841
|
+
* the Conversations SDK, or for using newer types in the older versions of
|
842
|
+
* the SDK.
|
843
|
+
*/
|
844
|
+
readonly rawData: string;
|
845
|
+
};
|
846
|
+
/**
|
847
|
+
* Shows a button that sends back a predefined text.
|
848
|
+
*/
|
849
|
+
type ContentDataActionReply = {
|
850
|
+
/**
|
851
|
+
* The type discriminant.
|
852
|
+
*/
|
853
|
+
readonly type: "reply";
|
854
|
+
/**
|
855
|
+
* Display value for the action. This is the message that will be sent back
|
856
|
+
* when the user taps on the button.
|
857
|
+
*/
|
858
|
+
readonly title: string;
|
859
|
+
/**
|
860
|
+
* Postback payload. This field is not visible to the end user.
|
861
|
+
*/
|
862
|
+
readonly id?: string;
|
863
|
+
/**
|
864
|
+
* Index for the action.
|
865
|
+
*/
|
866
|
+
readonly index: number;
|
867
|
+
/**
|
868
|
+
* Full data as a stringified JSON. This could be used for future content
|
869
|
+
* types and fields which are not yet supported by the newest version of
|
870
|
+
* the Conversations SDK, or for using newer types in the older versions of
|
871
|
+
* the SDK.
|
872
|
+
*/
|
873
|
+
readonly rawData: string;
|
874
|
+
};
|
875
|
+
/**
|
876
|
+
* Used for unknown action types which aren't present in the current version of
|
877
|
+
* the Conversations SDK.
|
878
|
+
*/
|
879
|
+
type ContentDataActionOther = {
|
880
|
+
/**
|
881
|
+
* The type discriminant.
|
882
|
+
*/
|
883
|
+
readonly type: "other";
|
884
|
+
/**
|
885
|
+
* Full data as a stringified JSON. This could be used for future content
|
886
|
+
* types and fields which are not yet supported by the newest version of
|
887
|
+
* the Conversations SDK, or for using newer types in the older versions of
|
888
|
+
* the SDK.
|
889
|
+
*/
|
890
|
+
readonly rawData: string;
|
891
|
+
};
|
892
|
+
/**
|
893
|
+
* A union of possible actions used in {@link ContentDataCallToAction} and
|
894
|
+
* {@link ContentDataCard}.
|
895
|
+
*/
|
896
|
+
type ContentDataAction = ContentDataActionUrl | ContentDataActionPhone | ContentDataActionReply | ContentDataActionOther;
|
897
|
+
/**
|
898
|
+
* Represents an item in the {@link ContentDataListPicker}.
|
899
|
+
*/
|
900
|
+
type ContentDataListItem = {
|
901
|
+
/**
|
902
|
+
* Unique item identifier. Not visible to the recipient.
|
903
|
+
*/
|
904
|
+
readonly id: string;
|
905
|
+
/**
|
906
|
+
* Display value of the item.
|
907
|
+
*/
|
908
|
+
readonly item: string;
|
909
|
+
/**
|
910
|
+
* Description of the item.
|
911
|
+
*/
|
912
|
+
readonly description?: string;
|
913
|
+
};
|
914
|
+
/**
|
915
|
+
* Contains only the plain text-based content. Represents the twilio/text
|
916
|
+
* content type.
|
917
|
+
*/
|
918
|
+
type ContentDataText = {
|
919
|
+
/**
|
920
|
+
* The type discriminant.
|
921
|
+
*/
|
922
|
+
readonly type: "text";
|
923
|
+
/**
|
924
|
+
* The text of the message you want to send.
|
925
|
+
*/
|
926
|
+
readonly body: string;
|
927
|
+
/**
|
928
|
+
* Full data as a stringified JSON. This could be used for future content
|
929
|
+
* types and fields which are not yet supported by the newest version of
|
930
|
+
* the Conversations SDK, or for using newer types in the older versions of
|
931
|
+
* the SDK.
|
932
|
+
*/
|
933
|
+
readonly rawData: string;
|
934
|
+
};
|
935
|
+
/**
|
936
|
+
* Used to send file attachments, or to send long texts via MMS in the US and
|
937
|
+
* Canada. Represents the twilio/media content type.
|
938
|
+
*/
|
939
|
+
type ContentDataMedia = {
|
940
|
+
/**
|
941
|
+
* The type discriminant.
|
942
|
+
*/
|
943
|
+
readonly type: "media";
|
944
|
+
/**
|
945
|
+
* The text of the message you want to send.
|
946
|
+
*/
|
947
|
+
readonly body?: string;
|
948
|
+
/**
|
949
|
+
* URLs of the media you want to send.
|
950
|
+
*/
|
951
|
+
readonly media: string[];
|
952
|
+
/**
|
953
|
+
* Full data as a stringified JSON. This could be used for future content
|
954
|
+
* types and fields which are not yet supported by the newest version of
|
955
|
+
* the Conversations SDK, or for using newer types in the older versions of
|
956
|
+
* the SDK.
|
957
|
+
*/
|
958
|
+
readonly rawData: string;
|
959
|
+
};
|
960
|
+
/**
|
961
|
+
* Contains a location pin and an optional label, which can be used to enhance
|
962
|
+
* delivery notifications or connect recipients to physical experiences you
|
963
|
+
* offer. Represents the twilio/location content type.
|
964
|
+
*/
|
965
|
+
type ContentDataLocation = {
|
966
|
+
/**
|
967
|
+
* The type discriminant.
|
968
|
+
*/
|
969
|
+
readonly type: "location";
|
970
|
+
/**
|
971
|
+
* The longitude value of the location pin you want to send.
|
972
|
+
*/
|
973
|
+
readonly longitude: number;
|
974
|
+
/**
|
975
|
+
* The latitude value of the location pin you want to send.
|
976
|
+
*/
|
977
|
+
readonly latitude: number;
|
978
|
+
/**
|
979
|
+
* The label to be displayed to the end user alongside the location pin.
|
980
|
+
*/
|
981
|
+
readonly label?: string;
|
982
|
+
/**
|
983
|
+
* Full data as a stringified JSON. This could be used for future content
|
984
|
+
* types and fields which are not yet supported by the newest version of
|
985
|
+
* the Conversations SDK, or for using newer types in the older versions of
|
986
|
+
* the SDK.
|
987
|
+
*/
|
988
|
+
readonly rawData: string;
|
989
|
+
};
|
990
|
+
/**
|
991
|
+
* Let recipients tap, rather than type, to respond to the message. Represents
|
992
|
+
* the twilio/quick-reply content type.
|
993
|
+
*/
|
994
|
+
type ContentDataQuickReply = {
|
995
|
+
/**
|
996
|
+
* The type discriminant.
|
997
|
+
*/
|
998
|
+
readonly type: "quickReply";
|
999
|
+
/**
|
1000
|
+
* The text of the message you want to send. This is included as a regular
|
1001
|
+
* text message.
|
1002
|
+
*/
|
1003
|
+
readonly body: string;
|
1004
|
+
/**
|
1005
|
+
* Up to 3 buttons can be created for quick reply. See
|
1006
|
+
* {@link ContentDataReply}.
|
1007
|
+
*/
|
1008
|
+
readonly replies: ContentDataReply[];
|
1009
|
+
/**
|
1010
|
+
* Full data as a stringified JSON. This could be used for future content
|
1011
|
+
* types and fields which are not yet supported by the newest version of
|
1012
|
+
* the Conversations SDK, or for using newer types in the older versions of
|
1013
|
+
* the SDK.
|
1014
|
+
*/
|
1015
|
+
readonly rawData: string;
|
1016
|
+
};
|
1017
|
+
/**
|
1018
|
+
* Buttons that let recipients tap to trigger actions such as launching a
|
1019
|
+
* website or making a phone call. Represents the twilio/call-to-action content
|
1020
|
+
* type.
|
1021
|
+
*/
|
1022
|
+
type ContentDataCallToAction = {
|
1023
|
+
/**
|
1024
|
+
* The type discriminant.
|
1025
|
+
*/
|
1026
|
+
readonly type: "callToAction";
|
1027
|
+
/**
|
1028
|
+
* The text of the message you want to send. This is included as a regular
|
1029
|
+
* text message.
|
1030
|
+
*/
|
1031
|
+
readonly body: string;
|
1032
|
+
/**
|
1033
|
+
* Buttons that recipients can tap on to act on the message.
|
1034
|
+
*/
|
1035
|
+
readonly actions: ContentDataAction[];
|
1036
|
+
/**
|
1037
|
+
* Full data as a stringified JSON. This could be used for future content
|
1038
|
+
* types and fields which are not yet supported by the newest version of
|
1039
|
+
* the Conversations SDK, or for using newer types in the older versions of
|
1040
|
+
* the SDK.
|
1041
|
+
*/
|
1042
|
+
readonly rawData: string;
|
1043
|
+
};
|
1044
|
+
/**
|
1045
|
+
* Shows a menu of up to 10 options, which offers a simple way for users to make
|
1046
|
+
* a selection. Represents the twilio/list-picker content type.
|
1047
|
+
*/
|
1048
|
+
type ContentDataListPicker = {
|
1049
|
+
/**
|
1050
|
+
* The type discriminant.
|
1051
|
+
*/
|
1052
|
+
readonly type: "listPicker";
|
1053
|
+
/**
|
1054
|
+
* The text of the message you want to send. This is rendered as the body of
|
1055
|
+
* the message.
|
1056
|
+
*/
|
1057
|
+
readonly body: string;
|
1058
|
+
/**
|
1059
|
+
* Display value of the primary button.
|
1060
|
+
*/
|
1061
|
+
readonly button: string;
|
1062
|
+
/**
|
1063
|
+
* List item objects displayed in the list. See {@link ContentDataListItem}.
|
1064
|
+
*/
|
1065
|
+
readonly items: ContentDataListItem[];
|
1066
|
+
/**
|
1067
|
+
* Full data as a stringified JSON. This could be used for future content
|
1068
|
+
* types and fields which are not yet supported by the newest version of
|
1069
|
+
* the Conversations SDK, or for using newer types in the older versions of
|
1070
|
+
* the SDK.
|
1071
|
+
*/
|
1072
|
+
readonly rawData: string;
|
1073
|
+
};
|
1074
|
+
/**
|
1075
|
+
* Shows a menu of up to 10 options, which offers a simple way for users to make
|
1076
|
+
* a selection. Represents the twilio/card content type.
|
1077
|
+
*/
|
1078
|
+
type ContentDataCard = {
|
1079
|
+
/**
|
1080
|
+
* The type discriminant.
|
1081
|
+
*/
|
1082
|
+
readonly type: "card";
|
1083
|
+
/**
|
1084
|
+
* Title of the card.
|
1085
|
+
*/
|
1086
|
+
readonly title: string;
|
1087
|
+
/**
|
1088
|
+
* Subtitle of the card.
|
1089
|
+
*/
|
1090
|
+
readonly subtitle?: string;
|
1091
|
+
/**
|
1092
|
+
* URLs of the media to send with the message.
|
1093
|
+
*/
|
1094
|
+
readonly media: string[];
|
1095
|
+
/**
|
1096
|
+
* Buttons that the recipients can tap on to act on the message.
|
1097
|
+
*/
|
1098
|
+
readonly actions: ContentDataAction[];
|
1099
|
+
/**
|
1100
|
+
* Full data as a stringified JSON. This could be used for future content
|
1101
|
+
* types and fields which are not yet supported by the newest version of
|
1102
|
+
* the Conversations SDK, or for using newer types in the older versions of
|
1103
|
+
* the SDK.
|
1104
|
+
*/
|
1105
|
+
readonly rawData: string;
|
1106
|
+
};
|
1107
|
+
/**
|
1108
|
+
* Used for unknown content types which aren't present in the current version of
|
1109
|
+
* the Conversations SDK.
|
1110
|
+
*/
|
1111
|
+
type ContentDataOther = {
|
1112
|
+
/**
|
1113
|
+
* The type discriminant.
|
1114
|
+
*/
|
1115
|
+
readonly type: "other";
|
1116
|
+
/**
|
1117
|
+
* Full data as a stringified JSON. This could be used for future content
|
1118
|
+
* types and fields which are not yet supported by the newest version of
|
1119
|
+
* the Conversations SDK, or for using newer types in the older versions of
|
1120
|
+
* the SDK.
|
1121
|
+
*/
|
1122
|
+
readonly rawData: string;
|
1123
|
+
};
|
1124
|
+
/**
|
1125
|
+
* A union of possible data types in rich content templates.
|
1126
|
+
*/
|
1127
|
+
type ContentData = ContentDataText | ContentDataMedia | ContentDataLocation | ContentDataQuickReply | ContentDataCallToAction | ContentDataListPicker | ContentDataCard | ContentDataOther;
|
1128
|
+
/**
|
1129
|
+
* Represents a variable for a content template. See
|
1130
|
+
* {@link ContentTemplate.variables}.
|
1131
|
+
*/
|
1132
|
+
declare class ContentTemplateVariable {
|
1133
|
+
readonly name: string;
|
1134
|
+
readonly value: string;
|
1135
|
+
constructor(/**
|
1136
|
+
* Name of the variable.
|
1137
|
+
*/
|
1138
|
+
name: string, /**
|
1139
|
+
* Key of the variable
|
1140
|
+
*/
|
1141
|
+
value: string);
|
1142
|
+
/**
|
1143
|
+
* Copies the variable with a new value.
|
1144
|
+
*
|
1145
|
+
* @param value The new value for the variable.
|
1146
|
+
*/
|
1147
|
+
copyWithValue(value: string): ContentTemplateVariable;
|
1148
|
+
}
|
1149
|
+
/**
|
1150
|
+
* A rich content template.
|
1151
|
+
*
|
1152
|
+
* Use {@Link Client.getContentTemplates} to request all the templates available
|
1153
|
+
* for the current account.
|
1154
|
+
*/
|
1155
|
+
declare class ContentTemplate {
|
1156
|
+
/**
|
1157
|
+
* The server-assigned unique identifier for the template.
|
1158
|
+
*/
|
1159
|
+
readonly sid: string;
|
1160
|
+
/**
|
1161
|
+
* Friendly name used to describe the content. Not visible to the recipient.
|
1162
|
+
*/
|
1163
|
+
readonly friendlyName: string;
|
1164
|
+
/**
|
1165
|
+
* Variables used by this template.
|
1166
|
+
*/
|
1167
|
+
readonly variables: ContentTemplateVariable[];
|
1168
|
+
/**
|
1169
|
+
* Variants of the content. See {@link ContentData}.
|
1170
|
+
*/
|
1171
|
+
readonly variants: Map<string, ContentData>;
|
1172
|
+
/**
|
1173
|
+
* Date of creation.
|
1174
|
+
*/
|
1175
|
+
readonly dateCreated: Date;
|
1176
|
+
/**
|
1177
|
+
* Date of the last update.
|
1178
|
+
*/
|
1179
|
+
readonly dateUpdated: Date;
|
1180
|
+
/**
|
1181
|
+
* @internal
|
1182
|
+
*/
|
1183
|
+
constructor(contentTemplateResponse: ContentTemplateResponse);
|
1184
|
+
}
|
1185
|
+
type ChannelMetadataClientServices = {
|
1186
|
+
commandExecutor: CommandExecutor;
|
1187
|
+
};
|
1188
|
+
/**
|
1189
|
+
* Represents channel metadata.
|
1190
|
+
*/
|
1191
|
+
declare class ChannelMetadata {
|
1192
|
+
/**
|
1193
|
+
* Communication channel type.
|
1194
|
+
*/
|
1195
|
+
readonly type: string;
|
1196
|
+
/**
|
1197
|
+
* The actual metadata.
|
1198
|
+
*/
|
1199
|
+
readonly data: unknown;
|
1200
|
+
/**
|
1201
|
+
* @internal
|
1202
|
+
*/
|
1203
|
+
constructor(type: string, data: unknown);
|
1204
|
+
}
|
1205
|
+
declare class ChannelMetadataClient {
|
1206
|
+
private readonly _services;
|
1207
|
+
private readonly _configuration;
|
1208
|
+
private readonly _cache;
|
1209
|
+
constructor(services: ChannelMetadataClientServices, configuration: Configuration);
|
1210
|
+
getChannelMetadata(conversationSid: string, messageSid: string): Promise<ChannelMetadata | null>;
|
1211
|
+
}
|
696
1212
|
type MessageEvents = {
|
697
1213
|
updated: (data: {
|
698
1214
|
message: Message;
|
@@ -703,6 +1219,7 @@ interface MessageServices {
|
|
703
1219
|
mcsClient: McsClient;
|
704
1220
|
network: Network;
|
705
1221
|
commandExecutor: CommandExecutor;
|
1222
|
+
channelMetadataClient: ChannelMetadataClient;
|
706
1223
|
}
|
707
1224
|
interface MessageLinks {
|
708
1225
|
self: string;
|
@@ -727,6 +1244,7 @@ interface MessageData {
|
|
727
1244
|
type?: MessageType;
|
728
1245
|
author: string | null;
|
729
1246
|
subject: string | null;
|
1247
|
+
contentSid: string | null;
|
730
1248
|
lastUpdatedBy?: string | null;
|
731
1249
|
attributes?: JSONValue;
|
732
1250
|
dateUpdated: string;
|
@@ -735,6 +1253,7 @@ interface MessageData {
|
|
735
1253
|
media?: Media;
|
736
1254
|
memberSid?: string;
|
737
1255
|
delivery?: AggregatedDeliveryDescriptor;
|
1256
|
+
channelMetadata?: boolean;
|
738
1257
|
}
|
739
1258
|
/**
|
740
1259
|
* A message in a conversation.
|
@@ -773,6 +1292,10 @@ declare class Message extends ReplayEventEmitter<MessageEvents> {
|
|
773
1292
|
* Message subject. Used only in email conversations.
|
774
1293
|
*/
|
775
1294
|
get subject(): string | null;
|
1295
|
+
/**
|
1296
|
+
* Unique identifier of {@link ContentTemplate} for this message.
|
1297
|
+
*/
|
1298
|
+
get contentSid(): string | null;
|
776
1299
|
/**
|
777
1300
|
* Body of the message.
|
778
1301
|
*/
|
@@ -782,14 +1305,15 @@ declare class Message extends ReplayEventEmitter<MessageEvents> {
|
|
782
1305
|
*/
|
783
1306
|
get dateUpdated(): Date | null;
|
784
1307
|
/**
|
785
|
-
* Index of
|
786
|
-
*
|
1308
|
+
* Index of this message in the conversation's list of messages.
|
1309
|
+
*
|
1310
|
+
* By design, the message indices may have arbitrary gaps between them,
|
787
1311
|
* that does not necessarily mean they were deleted or otherwise modified - just that
|
788
1312
|
* messages may have some non-contiguous indices even if they are being sent immediately one after another.
|
789
1313
|
*
|
790
1314
|
* Trying to use indices for some calculations is going to be unreliable.
|
791
1315
|
*
|
792
|
-
* To calculate the number of unread messages it is better to use the
|
1316
|
+
* To calculate the number of unread messages, it is better to use the Read Horizon API.
|
793
1317
|
* See {@link Conversation.getUnreadMessagesCount} for details.
|
794
1318
|
*/
|
795
1319
|
get index(): number;
|
@@ -826,6 +1350,14 @@ declare class Message extends ReplayEventEmitter<MessageEvents> {
|
|
826
1350
|
* Aggregated information about the message delivery statuses across all participants of a conversation..
|
827
1351
|
*/
|
828
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;
|
829
1361
|
/**
|
830
1362
|
* Return a (possibly empty) array of media matching a specific set of categories.
|
831
1363
|
* Allowed category is so far only 'media'.
|
@@ -868,6 +1400,12 @@ declare class Message extends ReplayEventEmitter<MessageEvents> {
|
|
868
1400
|
* @param attributes New attributes.
|
869
1401
|
*/
|
870
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[]>;
|
871
1409
|
/**
|
872
1410
|
* Get content URLs for all media attachments in the given set using a single operation.
|
873
1411
|
* @param contentSet Set of media attachments to query content URLs.
|
@@ -883,6 +1421,16 @@ declare class Message extends ReplayEventEmitter<MessageEvents> {
|
|
883
1421
|
*/
|
884
1422
|
getTemporaryContentUrlsForAttachedMedia(): CancellablePromise<Map<string, string>>;
|
885
1423
|
private _getDetailedDeliveryReceiptsPaginator;
|
1424
|
+
/**
|
1425
|
+
* Get the {@link ContentData} for this message. Resolves to `null` when
|
1426
|
+
* {@link Message.contentSid} is null.
|
1427
|
+
*/
|
1428
|
+
getContentData(): CancellablePromise<ContentData | null>;
|
1429
|
+
/**
|
1430
|
+
* Get the {@link ChannelMetadata} for this message. Resolves to `null` if
|
1431
|
+
* the message doesn't have any channel metadata.
|
1432
|
+
*/
|
1433
|
+
getChannelMetadata(): Promise<ChannelMetadata | null>;
|
886
1434
|
}
|
887
1435
|
/**
|
888
1436
|
* Pagination helper interface.
|
@@ -1045,6 +1593,7 @@ interface MessagesServices {
|
|
1045
1593
|
network: Network;
|
1046
1594
|
syncClient: SyncClient;
|
1047
1595
|
commandExecutor: CommandExecutor;
|
1596
|
+
channelMetadataClient: ChannelMetadataClient;
|
1048
1597
|
}
|
1049
1598
|
/**
|
1050
1599
|
* Represents the collection of messages in a conversation
|
@@ -1058,9 +1607,10 @@ declare class Messages extends ReplayEventEmitter<MessagesEvents> {
|
|
1058
1607
|
constructor(conversation: Conversation, configuration: Configuration, services: MessagesServices);
|
1059
1608
|
/**
|
1060
1609
|
* Subscribe to the Messages Event Stream
|
1061
|
-
* @param
|
1610
|
+
* @param arg - Name of the Sync object, or the SyncList itself, that
|
1611
|
+
* represents the Messages resource.
|
1062
1612
|
*/
|
1063
|
-
subscribe(
|
1613
|
+
subscribe(arg: string | SyncList): Promise<SyncList>;
|
1064
1614
|
unsubscribe(): Promise<void>;
|
1065
1615
|
/**
|
1066
1616
|
* Send a message to the conversation. The message could include text and multiple media attachments.
|
@@ -1115,6 +1665,8 @@ declare class UnsentMessage {
|
|
1115
1665
|
FormData | SendMediaOptions
|
1116
1666
|
][];
|
1117
1667
|
emailOptions: SendEmailOptions;
|
1668
|
+
contentSid?: string;
|
1669
|
+
contentVariables?: ContentTemplateVariable[];
|
1118
1670
|
/**
|
1119
1671
|
* @internal
|
1120
1672
|
*/
|
@@ -1176,6 +1728,21 @@ declare class MessageBuilder {
|
|
1176
1728
|
* @param history History payload in the selected format.
|
1177
1729
|
*/
|
1178
1730
|
setEmailHistory(contentType: string, history: FormData | SendMediaOptions): MessageBuilder;
|
1731
|
+
/**
|
1732
|
+
* Adds {@link ContentTemplate} SID for the message alongside optional
|
1733
|
+
* variables. When no variables provided, the default values will be used.
|
1734
|
+
*
|
1735
|
+
* Adding the content SID converts the message to a rich message. In this
|
1736
|
+
* case, other fields are ignored and the message is sent using the content
|
1737
|
+
* from the the {@link ContentTemplate}.
|
1738
|
+
*
|
1739
|
+
* Use {@link Client.getContentTemplates} to request all available
|
1740
|
+
* {@link ContentTemplate}s.
|
1741
|
+
*
|
1742
|
+
* @param contentSid SID of the {@link ContentTemplate}
|
1743
|
+
* @param variables Custom variables to resolve the template.
|
1744
|
+
*/
|
1745
|
+
setContentTemplate(contentSid: string, contentVariables?: ContentTemplateVariable[]): MessageBuilder;
|
1179
1746
|
/**
|
1180
1747
|
* Adds media to the message.
|
1181
1748
|
* @param payload Media to add.
|
@@ -1189,7 +1756,6 @@ declare class MessageBuilder {
|
|
1189
1756
|
* Prepares a message and sends it to the conversation.
|
1190
1757
|
*/
|
1191
1758
|
buildAndSend(): CancellablePromise<number | null>;
|
1192
|
-
private getPayloadContentType;
|
1193
1759
|
}
|
1194
1760
|
/**
|
1195
1761
|
* Conversation events.
|
@@ -1322,6 +1888,7 @@ interface ConversationServices {
|
|
1322
1888
|
mcsClient: McsClient;
|
1323
1889
|
syncClient: SyncClient;
|
1324
1890
|
commandExecutor: CommandExecutor;
|
1891
|
+
channelMetadataClient: ChannelMetadataClient;
|
1325
1892
|
}
|
1326
1893
|
/**
|
1327
1894
|
* Conversation descriptor.
|
@@ -1489,10 +2056,18 @@ declare class Conversation extends ReplayEventEmitter<ConversationEvents> {
|
|
1489
2056
|
* Messages entity.
|
1490
2057
|
*/
|
1491
2058
|
private readonly _messagesEntity;
|
2059
|
+
/**
|
2060
|
+
* Sync list containing messages.
|
2061
|
+
*/
|
2062
|
+
private _messagesList?;
|
1492
2063
|
/**
|
1493
2064
|
* Participants entity.
|
1494
2065
|
*/
|
1495
2066
|
private readonly _participantsEntity;
|
2067
|
+
/**
|
2068
|
+
* Sync map containing participants.
|
2069
|
+
*/
|
2070
|
+
private _participantsMap?;
|
1496
2071
|
/**
|
1497
2072
|
* Source of the most recent update.
|
1498
2073
|
*/
|
@@ -1584,7 +2159,7 @@ declare class Conversation extends ReplayEventEmitter<ConversationEvents> {
|
|
1584
2159
|
* @param attributes Attributes to be attached to the participant.
|
1585
2160
|
* @returns The added participant.
|
1586
2161
|
*/
|
1587
|
-
add(identity: string, attributes?: JSONValue): Promise<
|
2162
|
+
add(identity: string, attributes?: JSONValue): Promise<ParticipantResponse>;
|
1588
2163
|
/**
|
1589
2164
|
* Add a non-chat participant to the conversation.
|
1590
2165
|
* @param proxyAddress Proxy (Twilio) address of the participant.
|
@@ -1594,7 +2169,7 @@ declare class Conversation extends ReplayEventEmitter<ConversationEvents> {
|
|
1594
2169
|
* CC/To level.
|
1595
2170
|
* @returns The added participant.
|
1596
2171
|
*/
|
1597
|
-
addNonChatParticipant(proxyAddress: string, address: string, attributes?: JSONValue, bindingOptions?: ParticipantBindingOptions): Promise<
|
2172
|
+
addNonChatParticipant(proxyAddress: string, address: string, attributes?: JSONValue, bindingOptions?: ParticipantBindingOptions): Promise<ParticipantResponse>;
|
1598
2173
|
/**
|
1599
2174
|
* Advance the conversation's last read message index to the current read
|
1600
2175
|
* horizon. Rejects if the user is not a participant of the conversation. Last
|
@@ -1663,7 +2238,7 @@ declare class Conversation extends ReplayEventEmitter<ConversationEvents> {
|
|
1663
2238
|
*/
|
1664
2239
|
getMessagesCount(): Promise<number>;
|
1665
2240
|
/**
|
1666
|
-
* Get unread messages
|
2241
|
+
* Get count of unread messages for the user if they are a participant of this
|
1667
2242
|
* conversation. Rejects if the user is not a participant of the conversation.
|
1668
2243
|
*
|
1669
2244
|
* Use this method to obtain the number of unread messages together with
|
@@ -1671,12 +2246,19 @@ declare class Conversation extends ReplayEventEmitter<ConversationEvents> {
|
|
1671
2246
|
* message indices which may have gaps. See {@link Message.index} for details.
|
1672
2247
|
*
|
1673
2248
|
* This method is semi-realtime. This means that this data will be eventually
|
1674
|
-
* correct, but will also be possibly incorrect for a few seconds. The
|
2249
|
+
* correct, but it will also be possibly incorrect for a few seconds. The
|
1675
2250
|
* Conversations system does not provide real time events for counter values
|
1676
2251
|
* changes.
|
1677
2252
|
*
|
1678
2253
|
* This is useful for any UI badges, but it is not recommended to build any
|
1679
2254
|
* core application logic based on these counters being accurate in real time.
|
2255
|
+
*
|
2256
|
+
* If the read horizon is not set, this function will return null. This could mean
|
2257
|
+
* that all messages in the conversation are unread, or that the read horizon system
|
2258
|
+
* is not being used. How to interpret this `null` value is up to the customer application.
|
2259
|
+
*
|
2260
|
+
* @return Number of unread messages based on the current read horizon set for
|
2261
|
+
* the user or `null` if the read horizon is not set.
|
1680
2262
|
*/
|
1681
2263
|
getUnreadMessagesCount(): Promise<number | null>;
|
1682
2264
|
/**
|
@@ -1705,7 +2287,7 @@ declare class Conversation extends ReplayEventEmitter<ConversationEvents> {
|
|
1705
2287
|
sendMessage(message: null | string | FormData | SendMediaOptions, messageAttributes?: JSONValue, emailOptions?: SendEmailOptions): Promise<number>;
|
1706
2288
|
/**
|
1707
2289
|
* New interface to prepare for sending a message.
|
1708
|
-
* Use this instead of {@link
|
2290
|
+
* Use this instead of {@link Conversation.sendMessage}.
|
1709
2291
|
* @return A MessageBuilder to help set all message sending options.
|
1710
2292
|
*/
|
1711
2293
|
prepareMessage(): MessageBuilder;
|
@@ -1717,7 +2299,7 @@ declare class Conversation extends ReplayEventEmitter<ConversationEvents> {
|
|
1717
2299
|
setAllMessagesRead(): Promise<number>;
|
1718
2300
|
/**
|
1719
2301
|
* Set all messages in the conversation unread.
|
1720
|
-
* @
|
2302
|
+
* @returns New count of unread messages after this update.
|
1721
2303
|
*/
|
1722
2304
|
setAllMessagesUnread(): Promise<number>;
|
1723
2305
|
/**
|
@@ -1746,7 +2328,7 @@ declare class Conversation extends ReplayEventEmitter<ConversationEvents> {
|
|
1746
2328
|
* Set the last read message index to the current read horizon.
|
1747
2329
|
* @param index Message index to set as last read. If null is provided, then
|
1748
2330
|
* the behavior is identical to {@link Conversation.setAllMessagesUnread}.
|
1749
|
-
* @returns
|
2331
|
+
* @returns New count of unread messages after this update.
|
1750
2332
|
*/
|
1751
2333
|
updateLastReadMessageIndex(index: number | null): Promise<number>;
|
1752
2334
|
/**
|
@@ -1762,6 +2344,16 @@ declare class Conversation extends ReplayEventEmitter<ConversationEvents> {
|
|
1762
2344
|
* @internal
|
1763
2345
|
*/
|
1764
2346
|
_subscribe(): Promise<SyncDocument>;
|
2347
|
+
/**
|
2348
|
+
* Fetch participants and messages of the conversation. This method needs to
|
2349
|
+
* be called during conversation initialization to catch broken conversations
|
2350
|
+
* (broken conversations are conversations that have essential Sync entities
|
2351
|
+
* missing, i.e. the conversation document, the messages list or the
|
2352
|
+
* participant map). In case of this conversation being broken, the method
|
2353
|
+
* will throw an exception that will be caught and handled gracefully.
|
2354
|
+
* @internal
|
2355
|
+
*/
|
2356
|
+
_fetchStreams(): Promise<void>;
|
1765
2357
|
/**
|
1766
2358
|
* Load the attributes of this conversation and instantiate its participants
|
1767
2359
|
* and messages. This or _subscribe will need to be called before any events
|
@@ -1910,8 +2502,9 @@ type ClientEvents = {
|
|
1910
2502
|
user: User;
|
1911
2503
|
updateReasons: UserUpdateReason[];
|
1912
2504
|
}) => void;
|
1913
|
-
stateChanged: (
|
1914
|
-
|
2505
|
+
stateChanged: (state: State) => void;
|
2506
|
+
initialized: () => void;
|
2507
|
+
initFailed: ({ error }: {
|
1915
2508
|
error?: ConnectionError;
|
1916
2509
|
}) => void;
|
1917
2510
|
connectionStateChanged: (state: TwilsockConnectionState) => void;
|
@@ -1952,6 +2545,10 @@ interface ClientOptions {
|
|
1952
2545
|
* The level of logging to enable.
|
1953
2546
|
*/
|
1954
2547
|
logLevel?: LogLevel;
|
2548
|
+
/**
|
2549
|
+
* The cache capacity for channel metadata.
|
2550
|
+
*/
|
2551
|
+
channelMetadataCacheCapacity?: number;
|
1955
2552
|
region?: string;
|
1956
2553
|
productId?: string;
|
1957
2554
|
twilsockClient?: TwilsockClient;
|
@@ -1975,6 +2572,10 @@ interface ClientOptions {
|
|
1975
2572
|
typingUri?: string;
|
1976
2573
|
apiUri?: string;
|
1977
2574
|
}
|
2575
|
+
type ConnectionError = {
|
2576
|
+
terminal: boolean;
|
2577
|
+
message: string;
|
2578
|
+
};
|
1978
2579
|
/**
|
1979
2580
|
* Options for {@link Client.createConversation}.
|
1980
2581
|
*/
|
@@ -2167,16 +2768,29 @@ declare class Client extends ReplayEventEmitter<ClientEvents> {
|
|
2167
2768
|
*/
|
2168
2769
|
static readonly userUpdated = "userUpdated";
|
2169
2770
|
/**
|
2771
|
+
* @deprecated Use initialized or initFailed events instead
|
2170
2772
|
* Fired when the state of the client has been changed.
|
2171
2773
|
*
|
2172
2774
|
* Parameters:
|
2775
|
+
* 1. {@link State} `state` - the new client state
|
2776
|
+
* @event
|
2777
|
+
*/
|
2778
|
+
static readonly stateChanged = "stateChanged";
|
2779
|
+
/**
|
2780
|
+
* Fired when the client has completed initialization successfully.
|
2781
|
+
* @event
|
2782
|
+
*/
|
2783
|
+
static readonly initialized = "initialized";
|
2784
|
+
/**
|
2785
|
+
* Fired when the client initialization failed.
|
2786
|
+
*
|
2787
|
+
* Parameters:
|
2173
2788
|
* 1. object `data` - info object provided with the event. It has the
|
2174
|
-
* following
|
2175
|
-
* * {@link State} `state` - the new client state
|
2789
|
+
* following property:
|
2176
2790
|
* * Error? `error` - the initialization error if present
|
2177
2791
|
* @event
|
2178
2792
|
*/
|
2179
|
-
static readonly
|
2793
|
+
static readonly initFailed = "initFailed";
|
2180
2794
|
/**
|
2181
2795
|
* Fired when the connection state of the client has been changed.
|
2182
2796
|
*
|
@@ -2285,6 +2899,12 @@ declare class Client extends ReplayEventEmitter<ClientEvents> {
|
|
2285
2899
|
* initialization was completed.
|
2286
2900
|
*/
|
2287
2901
|
get reachabilityEnabled(): boolean;
|
2902
|
+
/**
|
2903
|
+
* @deprecated
|
2904
|
+
* Current token.
|
2905
|
+
* @internal
|
2906
|
+
*/
|
2907
|
+
get token(): string;
|
2288
2908
|
/**
|
2289
2909
|
* @deprecated Call constructor directly.
|
2290
2910
|
*
|
@@ -2417,6 +3037,11 @@ declare class Client extends ReplayEventEmitter<ClientEvents> {
|
|
2417
3037
|
* @param contentSet Set of media attachments to query content URLs.
|
2418
3038
|
*/
|
2419
3039
|
getTemporaryContentUrlsForMedia(contentSet: Media[]): CancellablePromise<Map<string, string>>;
|
3040
|
+
/**
|
3041
|
+
* Returns rich content templates belonging to the account. Rich content
|
3042
|
+
* templates can be created via the Twilio console or the REST API.
|
3043
|
+
*/
|
3044
|
+
getContentTemplates(): Promise<Readonly<ContentTemplate[]>>;
|
2420
3045
|
/**
|
2421
3046
|
* Initialize the client.
|
2422
3047
|
*/
|
@@ -2440,4 +3065,4 @@ declare class NotificationTypes {
|
|
2440
3065
|
static readonly REMOVED_FROM_CONVERSATION = "twilio.conversations.removed_from_conversation";
|
2441
3066
|
static readonly CONSUMPTION_UPDATE = "twilio.channel.consumption_update";
|
2442
3067
|
}
|
2443
|
-
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 };
|
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 };
|