@twilio/conversations 2.2.2 → 2.3.0-rc.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/builds/browser.js +629 -25
- package/builds/browser.js.map +1 -1
- package/builds/lib.d.ts +501 -3
- package/builds/lib.js +620 -25
- package/builds/lib.js.map +1 -1
- package/builds/twilio-conversations.js +887 -267
- package/builds/twilio-conversations.min.js +1 -1
- package/dist/aggregated-delivery-receipt.js +9 -0
- package/dist/aggregated-delivery-receipt.js.map +1 -1
- package/dist/client.js +19 -0
- package/dist/client.js.map +1 -1
- package/dist/command-executor.js +9 -0
- package/dist/command-executor.js.map +1 -1
- package/dist/configuration.js +9 -0
- 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 +9 -0
- package/dist/conversation.js.map +1 -1
- package/dist/data/conversations.js +9 -0
- package/dist/data/conversations.js.map +1 -1
- package/dist/data/messages.js +13 -0
- package/dist/data/messages.js.map +1 -1
- package/dist/data/participants.js +9 -0
- 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 +12 -0
- package/dist/index.js.map +1 -1
- package/dist/interfaces/attributes.js +9 -0
- package/dist/interfaces/attributes.js.map +1 -1
- package/dist/interfaces/notification-types.js +9 -0
- package/dist/interfaces/notification-types.js.map +1 -1
- 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 +28 -0
- package/dist/message-builder.js.map +1 -1
- package/dist/message.js +94 -0
- package/dist/message.js.map +1 -1
- 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 +9 -0
- 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 +9 -0
- 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/Client.html +24 -0
- package/docs/classes/ContentTemplate.html +3116 -0
- package/docs/classes/ContentTemplateVariable.html +3116 -0
- package/docs/classes/Message.html +47 -0
- package/docs/classes/MessageBuilder.html +41 -0
- package/docs/index.html +813 -0
- package/docs/modules.html +813 -0
- package/package.json +9 -8
package/builds/lib.d.ts
CHANGED
@@ -122,8 +122,8 @@ declare class CommandExecutor {
|
|
122
122
|
constructor(_serviceUrl: string, _services: CommandExecutorServices, _productId?: string);
|
123
123
|
private _preProcessUrl;
|
124
124
|
private _makeRequest;
|
125
|
-
fetchResource<
|
126
|
-
mutateResource<
|
125
|
+
fetchResource<Request = void, Response = void>(url: string, requestBody?: Request): Promise<Response>;
|
126
|
+
mutateResource<Request = void, Response = void>(method: "post" | "delete", url: string, requestBody?: Request): Promise<Response>;
|
127
127
|
}
|
128
128
|
/**
|
129
129
|
* Represents a JSON value.
|
@@ -714,6 +714,472 @@ declare class DetailedDeliveryReceipt {
|
|
714
714
|
*/
|
715
715
|
constructor(descriptor: DetailedDeliveryReceiptDescriptor);
|
716
716
|
}
|
717
|
+
type ContentDataActionResponse = Readonly<{
|
718
|
+
type: string;
|
719
|
+
title: string;
|
720
|
+
id?: string;
|
721
|
+
url?: string;
|
722
|
+
phone?: string;
|
723
|
+
index?: number;
|
724
|
+
}>;
|
725
|
+
type ContentDataTextResponse = Readonly<{
|
726
|
+
body: string;
|
727
|
+
}>;
|
728
|
+
type ContentDataMediaResponse = Readonly<{
|
729
|
+
body?: string;
|
730
|
+
media: string[];
|
731
|
+
}>;
|
732
|
+
type ContentDataLocationResponse = Readonly<{
|
733
|
+
longitude: number;
|
734
|
+
latitude: number;
|
735
|
+
label?: string;
|
736
|
+
}>;
|
737
|
+
type ContentDataQuickReplyResponse = Readonly<{
|
738
|
+
body: string;
|
739
|
+
actions: Readonly<{
|
740
|
+
title: string;
|
741
|
+
id?: string;
|
742
|
+
}>[];
|
743
|
+
}>;
|
744
|
+
type ContentDataCallToActionResponse = Readonly<{
|
745
|
+
body: string;
|
746
|
+
actions: ContentDataActionResponse[];
|
747
|
+
}>;
|
748
|
+
type ContentDataListPickerResponse = Readonly<{
|
749
|
+
body: string;
|
750
|
+
button: string;
|
751
|
+
items: Readonly<{
|
752
|
+
id: string;
|
753
|
+
item: string;
|
754
|
+
description?: string;
|
755
|
+
}>[];
|
756
|
+
}>;
|
757
|
+
type ContentDataCardResponse = Readonly<{
|
758
|
+
title: string;
|
759
|
+
subtitle?: string;
|
760
|
+
media?: string[];
|
761
|
+
actions?: ContentDataActionResponse[];
|
762
|
+
}>;
|
763
|
+
type ContentDataResponse = Readonly<{
|
764
|
+
"twilio/text"?: ContentDataTextResponse;
|
765
|
+
"twilio/media"?: ContentDataMediaResponse;
|
766
|
+
"twilio/location"?: ContentDataLocationResponse;
|
767
|
+
"twilio/quick-reply"?: ContentDataQuickReplyResponse;
|
768
|
+
"twilio/call-to-action"?: ContentDataCallToActionResponse;
|
769
|
+
"twilio/list-picker"?: ContentDataListPickerResponse;
|
770
|
+
"twilio/card"?: ContentDataCardResponse;
|
771
|
+
}>;
|
772
|
+
type ContentTemplateResponse = Readonly<{
|
773
|
+
sid: string;
|
774
|
+
account_sid: string;
|
775
|
+
friendly_name: string;
|
776
|
+
variables: string;
|
777
|
+
variants: ContentDataResponse;
|
778
|
+
date_created: string;
|
779
|
+
date_updated: string;
|
780
|
+
}>;
|
781
|
+
/**
|
782
|
+
* Shows a button that sends back a predefined text. Used in
|
783
|
+
* {@link ContentDataQuickReply}.
|
784
|
+
*/
|
785
|
+
type ContentDataReply = {
|
786
|
+
/**
|
787
|
+
* Display value of the action. This is the message that will be sent back
|
788
|
+
* when the user taps on the button.
|
789
|
+
*/
|
790
|
+
readonly title: string;
|
791
|
+
/**
|
792
|
+
* Postback payload. This field is not visible to the end user.
|
793
|
+
*/
|
794
|
+
readonly id?: string;
|
795
|
+
};
|
796
|
+
/**
|
797
|
+
* Shows a button that redirects recipient to a predefined URL.
|
798
|
+
*/
|
799
|
+
type ContentDataActionUrl = {
|
800
|
+
/**
|
801
|
+
* The type discriminant.
|
802
|
+
*/
|
803
|
+
readonly type: "url";
|
804
|
+
/**
|
805
|
+
* Display value for the action.
|
806
|
+
*/
|
807
|
+
readonly title: string;
|
808
|
+
/**
|
809
|
+
* URL to direct to when the recipient taps the button.
|
810
|
+
*/
|
811
|
+
readonly url: string;
|
812
|
+
/**
|
813
|
+
* Full data as a stringified JSON. This could be used for future content
|
814
|
+
* types and fields which are not yet supported by the newest version of
|
815
|
+
* the Conversations SDK, or for using newer types in the older versions of
|
816
|
+
* the SDK.
|
817
|
+
*/
|
818
|
+
readonly rawData: string;
|
819
|
+
};
|
820
|
+
/**
|
821
|
+
* Shows a button that calls a phone number.
|
822
|
+
*/
|
823
|
+
type ContentDataActionPhone = {
|
824
|
+
/**
|
825
|
+
* The type discriminant.
|
826
|
+
*/
|
827
|
+
readonly type: "phone";
|
828
|
+
/**
|
829
|
+
* Display value for the action.
|
830
|
+
*/
|
831
|
+
readonly title: string;
|
832
|
+
/**
|
833
|
+
* Phone number to call when the recipient taps the button.
|
834
|
+
*/
|
835
|
+
readonly phone: string;
|
836
|
+
/**
|
837
|
+
* Full data as a stringified JSON. This could be used for future content
|
838
|
+
* types and fields which are not yet supported by the newest version of
|
839
|
+
* the Conversations SDK, or for using newer types in the older versions of
|
840
|
+
* the SDK.
|
841
|
+
*/
|
842
|
+
readonly rawData: string;
|
843
|
+
};
|
844
|
+
/**
|
845
|
+
* Shows a button that sends back a predefined text.
|
846
|
+
*/
|
847
|
+
type ContentDataActionReply = {
|
848
|
+
/**
|
849
|
+
* The type discriminant.
|
850
|
+
*/
|
851
|
+
readonly type: "reply";
|
852
|
+
/**
|
853
|
+
* Display value for the action. This is the message that will be sent back
|
854
|
+
* when the user taps on the button.
|
855
|
+
*/
|
856
|
+
readonly title: string;
|
857
|
+
/**
|
858
|
+
* Postback payload. This field is not visible to the end user.
|
859
|
+
*/
|
860
|
+
readonly id?: string;
|
861
|
+
/**
|
862
|
+
* Index for the action.
|
863
|
+
*/
|
864
|
+
readonly index: number;
|
865
|
+
/**
|
866
|
+
* Full data as a stringified JSON. This could be used for future content
|
867
|
+
* types and fields which are not yet supported by the newest version of
|
868
|
+
* the Conversations SDK, or for using newer types in the older versions of
|
869
|
+
* the SDK.
|
870
|
+
*/
|
871
|
+
readonly rawData: string;
|
872
|
+
};
|
873
|
+
/**
|
874
|
+
* Used for unknown action types which aren't present in the current version of
|
875
|
+
* the Conversations SDK.
|
876
|
+
*/
|
877
|
+
type ContentDataActionOther = {
|
878
|
+
/**
|
879
|
+
* The type discriminant.
|
880
|
+
*/
|
881
|
+
readonly type: "other";
|
882
|
+
/**
|
883
|
+
* Full data as a stringified JSON. This could be used for future content
|
884
|
+
* types and fields which are not yet supported by the newest version of
|
885
|
+
* the Conversations SDK, or for using newer types in the older versions of
|
886
|
+
* the SDK.
|
887
|
+
*/
|
888
|
+
readonly rawData: string;
|
889
|
+
};
|
890
|
+
/**
|
891
|
+
* A union of possible actions used in {@link ContentDataCallToAction} and
|
892
|
+
* {@link ContentDataCard}.
|
893
|
+
*/
|
894
|
+
type ContentDataAction = ContentDataActionUrl | ContentDataActionPhone | ContentDataActionReply | ContentDataActionOther;
|
895
|
+
/**
|
896
|
+
* Represents an item in the {@link ContentDataListPicker}.
|
897
|
+
*/
|
898
|
+
type ContentDataListItem = {
|
899
|
+
/**
|
900
|
+
* Unique item identifier. Not visible to the recipient.
|
901
|
+
*/
|
902
|
+
readonly id: string;
|
903
|
+
/**
|
904
|
+
* Display value of the item.
|
905
|
+
*/
|
906
|
+
readonly item: string;
|
907
|
+
/**
|
908
|
+
* Description of the item.
|
909
|
+
*/
|
910
|
+
readonly description?: string;
|
911
|
+
};
|
912
|
+
/**
|
913
|
+
* Contains only the plain text-based content. Represents the twilio/text
|
914
|
+
* content type.
|
915
|
+
*/
|
916
|
+
type ContentDataText = {
|
917
|
+
/**
|
918
|
+
* The type discriminant.
|
919
|
+
*/
|
920
|
+
readonly type: "text";
|
921
|
+
/**
|
922
|
+
* The text of the message you want to send.
|
923
|
+
*/
|
924
|
+
readonly body: string;
|
925
|
+
/**
|
926
|
+
* Full data as a stringified JSON. This could be used for future content
|
927
|
+
* types and fields which are not yet supported by the newest version of
|
928
|
+
* the Conversations SDK, or for using newer types in the older versions of
|
929
|
+
* the SDK.
|
930
|
+
*/
|
931
|
+
readonly rawData: string;
|
932
|
+
};
|
933
|
+
/**
|
934
|
+
* Used to send file attachments, or to send long texts via MMS in the US and
|
935
|
+
* Canada. Represents the twilio/media content type.
|
936
|
+
*/
|
937
|
+
type ContentDataMedia = {
|
938
|
+
/**
|
939
|
+
* The type discriminant.
|
940
|
+
*/
|
941
|
+
readonly type: "media";
|
942
|
+
/**
|
943
|
+
* The text of the message you want to send.
|
944
|
+
*/
|
945
|
+
readonly body?: string;
|
946
|
+
/**
|
947
|
+
* URLs of the media you want to send.
|
948
|
+
*/
|
949
|
+
readonly media: string[];
|
950
|
+
/**
|
951
|
+
* Full data as a stringified JSON. This could be used for future content
|
952
|
+
* types and fields which are not yet supported by the newest version of
|
953
|
+
* the Conversations SDK, or for using newer types in the older versions of
|
954
|
+
* the SDK.
|
955
|
+
*/
|
956
|
+
readonly rawData: string;
|
957
|
+
};
|
958
|
+
/**
|
959
|
+
* Contains a location pin and an optional label, which can be used to enhance
|
960
|
+
* delivery notifications or connect recipients to physical experiences you
|
961
|
+
* offer. Represents the twilio/location content type.
|
962
|
+
*/
|
963
|
+
type ContentDataLocation = {
|
964
|
+
/**
|
965
|
+
* The type discriminant.
|
966
|
+
*/
|
967
|
+
readonly type: "location";
|
968
|
+
/**
|
969
|
+
* The longitude value of the location pin you want to send.
|
970
|
+
*/
|
971
|
+
readonly longitude: number;
|
972
|
+
/**
|
973
|
+
* The latitude value of the location pin you want to send.
|
974
|
+
*/
|
975
|
+
readonly latitude: number;
|
976
|
+
/**
|
977
|
+
* The label to be displayed to the end user alongside the location pin.
|
978
|
+
*/
|
979
|
+
readonly label?: string;
|
980
|
+
/**
|
981
|
+
* Full data as a stringified JSON. This could be used for future content
|
982
|
+
* types and fields which are not yet supported by the newest version of
|
983
|
+
* the Conversations SDK, or for using newer types in the older versions of
|
984
|
+
* the SDK.
|
985
|
+
*/
|
986
|
+
readonly rawData: string;
|
987
|
+
};
|
988
|
+
/**
|
989
|
+
* Let recipients tap, rather than type, to respond to the message. Represents
|
990
|
+
* the twilio/quick-reply content type.
|
991
|
+
*/
|
992
|
+
type ContentDataQuickReply = {
|
993
|
+
/**
|
994
|
+
* The type discriminant.
|
995
|
+
*/
|
996
|
+
readonly type: "quickReply";
|
997
|
+
/**
|
998
|
+
* The text of the message you want to send. This is included as a regular
|
999
|
+
* text message.
|
1000
|
+
*/
|
1001
|
+
readonly body: string;
|
1002
|
+
/**
|
1003
|
+
* Up to 3 buttons can be created for quick reply. See
|
1004
|
+
* {@link ContentDataReply}.
|
1005
|
+
*/
|
1006
|
+
readonly replies: ContentDataReply[];
|
1007
|
+
/**
|
1008
|
+
* Full data as a stringified JSON. This could be used for future content
|
1009
|
+
* types and fields which are not yet supported by the newest version of
|
1010
|
+
* the Conversations SDK, or for using newer types in the older versions of
|
1011
|
+
* the SDK.
|
1012
|
+
*/
|
1013
|
+
readonly rawData: string;
|
1014
|
+
};
|
1015
|
+
/**
|
1016
|
+
* Buttons that let recipients tap to trigger actions such as launching a
|
1017
|
+
* website or making a phone call. Represents the twilio/call-to-action content
|
1018
|
+
* type.
|
1019
|
+
*/
|
1020
|
+
type ContentDataCallToAction = {
|
1021
|
+
/**
|
1022
|
+
* The type discriminant.
|
1023
|
+
*/
|
1024
|
+
readonly type: "callToAction";
|
1025
|
+
/**
|
1026
|
+
* The text of the message you want to send. This is included as a regular
|
1027
|
+
* text message.
|
1028
|
+
*/
|
1029
|
+
readonly body: string;
|
1030
|
+
/**
|
1031
|
+
* Buttons that recipients can tap on to act on the message.
|
1032
|
+
*/
|
1033
|
+
readonly actions: ContentDataAction[];
|
1034
|
+
/**
|
1035
|
+
* Full data as a stringified JSON. This could be used for future content
|
1036
|
+
* types and fields which are not yet supported by the newest version of
|
1037
|
+
* the Conversations SDK, or for using newer types in the older versions of
|
1038
|
+
* the SDK.
|
1039
|
+
*/
|
1040
|
+
readonly rawData: string;
|
1041
|
+
};
|
1042
|
+
/**
|
1043
|
+
* Shows a menu of up to 10 options, which offers a simple way for users to make
|
1044
|
+
* a selection. Represents the twilio/list-picker content type.
|
1045
|
+
*/
|
1046
|
+
type ContentDataListPicker = {
|
1047
|
+
/**
|
1048
|
+
* The type discriminant.
|
1049
|
+
*/
|
1050
|
+
readonly type: "listPicker";
|
1051
|
+
/**
|
1052
|
+
* The text of the message you want to send. This is rendered as the body of
|
1053
|
+
* the message.
|
1054
|
+
*/
|
1055
|
+
readonly body: string;
|
1056
|
+
/**
|
1057
|
+
* Display value of the primary button.
|
1058
|
+
*/
|
1059
|
+
readonly button: string;
|
1060
|
+
/**
|
1061
|
+
* List item objects displayed in the list. See {@link ContentDataListItem}.
|
1062
|
+
*/
|
1063
|
+
readonly items: ContentDataListItem[];
|
1064
|
+
/**
|
1065
|
+
* Full data as a stringified JSON. This could be used for future content
|
1066
|
+
* types and fields which are not yet supported by the newest version of
|
1067
|
+
* the Conversations SDK, or for using newer types in the older versions of
|
1068
|
+
* the SDK.
|
1069
|
+
*/
|
1070
|
+
readonly rawData: string;
|
1071
|
+
};
|
1072
|
+
/**
|
1073
|
+
* Shows a menu of up to 10 options, which offers a simple way for users to make
|
1074
|
+
* a selection. Represents the twilio/card content type.
|
1075
|
+
*/
|
1076
|
+
type ContentDataCard = {
|
1077
|
+
/**
|
1078
|
+
* The type discriminant.
|
1079
|
+
*/
|
1080
|
+
readonly type: "card";
|
1081
|
+
/**
|
1082
|
+
* Title of the card.
|
1083
|
+
*/
|
1084
|
+
readonly title: string;
|
1085
|
+
/**
|
1086
|
+
* Subtitle of the card.
|
1087
|
+
*/
|
1088
|
+
readonly subtitle?: string;
|
1089
|
+
/**
|
1090
|
+
* URLs of the media to send with the message.
|
1091
|
+
*/
|
1092
|
+
readonly media: string[];
|
1093
|
+
/**
|
1094
|
+
* Buttons that the recipients can tap on to act on the message.
|
1095
|
+
*/
|
1096
|
+
readonly actions: ContentDataAction[];
|
1097
|
+
/**
|
1098
|
+
* Full data as a stringified JSON. This could be used for future content
|
1099
|
+
* types and fields which are not yet supported by the newest version of
|
1100
|
+
* the Conversations SDK, or for using newer types in the older versions of
|
1101
|
+
* the SDK.
|
1102
|
+
*/
|
1103
|
+
readonly rawData: string;
|
1104
|
+
};
|
1105
|
+
/**
|
1106
|
+
* Used for unknown content types which aren't present in the current version of
|
1107
|
+
* the Conversations SDK.
|
1108
|
+
*/
|
1109
|
+
type ContentDataOther = {
|
1110
|
+
/**
|
1111
|
+
* The type discriminant.
|
1112
|
+
*/
|
1113
|
+
readonly type: "other";
|
1114
|
+
/**
|
1115
|
+
* Full data as a stringified JSON. This could be used for future content
|
1116
|
+
* types and fields which are not yet supported by the newest version of
|
1117
|
+
* the Conversations SDK, or for using newer types in the older versions of
|
1118
|
+
* the SDK.
|
1119
|
+
*/
|
1120
|
+
readonly rawData: string;
|
1121
|
+
};
|
1122
|
+
/**
|
1123
|
+
* A union of possible data types in rich content templates.
|
1124
|
+
*/
|
1125
|
+
type ContentData = ContentDataText | ContentDataMedia | ContentDataLocation | ContentDataQuickReply | ContentDataCallToAction | ContentDataListPicker | ContentDataCard | ContentDataOther;
|
1126
|
+
/**
|
1127
|
+
* Represents a variable for a content template. See
|
1128
|
+
* {@link ContentTemplate.variables}.
|
1129
|
+
*/
|
1130
|
+
declare class ContentTemplateVariable {
|
1131
|
+
readonly name: string;
|
1132
|
+
readonly value: string;
|
1133
|
+
constructor(/**
|
1134
|
+
* Name of the variable.
|
1135
|
+
*/
|
1136
|
+
name: string, /**
|
1137
|
+
* Key of the variable
|
1138
|
+
*/
|
1139
|
+
value: string);
|
1140
|
+
/**
|
1141
|
+
* Copies the variable with a new value.
|
1142
|
+
*
|
1143
|
+
* @param value The new value for the variable.
|
1144
|
+
*/
|
1145
|
+
copyWithValue(value: string): ContentTemplateVariable;
|
1146
|
+
}
|
1147
|
+
/**
|
1148
|
+
* A rich content template.
|
1149
|
+
*
|
1150
|
+
* Use {@Link Client.getContentTemplates} to request all the templates available
|
1151
|
+
* for the current account.
|
1152
|
+
*/
|
1153
|
+
declare class ContentTemplate {
|
1154
|
+
/**
|
1155
|
+
* The server-assigned unique identifier for the template.
|
1156
|
+
*/
|
1157
|
+
readonly sid: string;
|
1158
|
+
/**
|
1159
|
+
* Friendly name used to describe the content. Not visible to the recipient.
|
1160
|
+
*/
|
1161
|
+
readonly friendlyName: string;
|
1162
|
+
/**
|
1163
|
+
* Variables used by this template.
|
1164
|
+
*/
|
1165
|
+
readonly variables: ContentTemplateVariable[];
|
1166
|
+
/**
|
1167
|
+
* Variants of the content. See @{link ContentData}.
|
1168
|
+
*/
|
1169
|
+
readonly variants: Map<string, ContentData>;
|
1170
|
+
/**
|
1171
|
+
* Date of creation.
|
1172
|
+
*/
|
1173
|
+
readonly dateCreated: Date;
|
1174
|
+
/**
|
1175
|
+
* Date of the last update.
|
1176
|
+
*/
|
1177
|
+
readonly dateUpdated: Date;
|
1178
|
+
/**
|
1179
|
+
* @internal
|
1180
|
+
*/
|
1181
|
+
constructor(contentTemplateResponse: ContentTemplateResponse);
|
1182
|
+
}
|
717
1183
|
type MessageEvents = {
|
718
1184
|
updated: (data: {
|
719
1185
|
message: Message;
|
@@ -748,6 +1214,7 @@ interface MessageData {
|
|
748
1214
|
type?: MessageType;
|
749
1215
|
author: string | null;
|
750
1216
|
subject: string | null;
|
1217
|
+
contentSid: string | null;
|
751
1218
|
lastUpdatedBy?: string | null;
|
752
1219
|
attributes?: JSONValue;
|
753
1220
|
dateUpdated: string;
|
@@ -794,6 +1261,10 @@ declare class Message extends ReplayEventEmitter<MessageEvents> {
|
|
794
1261
|
* Message subject. Used only in email conversations.
|
795
1262
|
*/
|
796
1263
|
get subject(): string | null;
|
1264
|
+
/**
|
1265
|
+
* Unique identifier of {@link ContentTemplate} for this message.
|
1266
|
+
*/
|
1267
|
+
get contentSid(): string | null;
|
797
1268
|
/**
|
798
1269
|
* Body of the message.
|
799
1270
|
*/
|
@@ -919,6 +1390,11 @@ declare class Message extends ReplayEventEmitter<MessageEvents> {
|
|
919
1390
|
*/
|
920
1391
|
getTemporaryContentUrlsForAttachedMedia(): CancellablePromise<Map<string, string>>;
|
921
1392
|
private _getDetailedDeliveryReceiptsPaginator;
|
1393
|
+
/**
|
1394
|
+
* Get the {@link ContentData} for this message. Resolves to `null` when
|
1395
|
+
* {@link Message.contentSid} is null.
|
1396
|
+
*/
|
1397
|
+
getContentData(): CancellablePromise<ContentData | null>;
|
922
1398
|
}
|
923
1399
|
/**
|
924
1400
|
* Pagination helper interface.
|
@@ -1152,6 +1628,8 @@ declare class UnsentMessage {
|
|
1152
1628
|
FormData | SendMediaOptions
|
1153
1629
|
][];
|
1154
1630
|
emailOptions: SendEmailOptions;
|
1631
|
+
contentSid?: string;
|
1632
|
+
contentVariables?: ContentTemplateVariable[];
|
1155
1633
|
/**
|
1156
1634
|
* @internal
|
1157
1635
|
*/
|
@@ -1213,6 +1691,21 @@ declare class MessageBuilder {
|
|
1213
1691
|
* @param history History payload in the selected format.
|
1214
1692
|
*/
|
1215
1693
|
setEmailHistory(contentType: string, history: FormData | SendMediaOptions): MessageBuilder;
|
1694
|
+
/**
|
1695
|
+
* Adds {@link ContentTemplate} SID for the message alongside optional
|
1696
|
+
* variables. When no variables provided, the default values will be used.
|
1697
|
+
*
|
1698
|
+
* Adding the content SID converts the message to a rich message. In this
|
1699
|
+
* case, other fields are ignored and the message is sent using the content
|
1700
|
+
* from the the {@link ContentTemplate}.
|
1701
|
+
*
|
1702
|
+
* Use {@link Client.getContentTemplates} to request all available
|
1703
|
+
* {@link ContentTemplate}s.
|
1704
|
+
*
|
1705
|
+
* @param contentSid SID of the {@link ContentTemplate}
|
1706
|
+
* @param variables Custom variables to resolve the template.
|
1707
|
+
*/
|
1708
|
+
setContentTemplate(contentSid: string, contentVariables?: ContentTemplateVariable[]): MessageBuilder;
|
1216
1709
|
/**
|
1217
1710
|
* Adds media to the message.
|
1218
1711
|
* @param payload Media to add.
|
@@ -2503,6 +2996,11 @@ declare class Client extends ReplayEventEmitter<ClientEvents> {
|
|
2503
2996
|
* @param contentSet Set of media attachments to query content URLs.
|
2504
2997
|
*/
|
2505
2998
|
getTemporaryContentUrlsForMedia(contentSet: Media[]): CancellablePromise<Map<string, string>>;
|
2999
|
+
/**
|
3000
|
+
* Returns rich content templates belonging to the account. Rich content
|
3001
|
+
* templates can be created via the Twilio console or the REST API.
|
3002
|
+
*/
|
3003
|
+
getContentTemplates(): Promise<Readonly<ContentTemplate[]>>;
|
2506
3004
|
/**
|
2507
3005
|
* Initialize the client.
|
2508
3006
|
*/
|
@@ -2526,4 +3024,4 @@ declare class NotificationTypes {
|
|
2526
3024
|
static readonly REMOVED_FROM_CONVERSATION = "twilio.conversations.removed_from_conversation";
|
2527
3025
|
static readonly CONSUMPTION_UPDATE = "twilio.channel.consumption_update";
|
2528
3026
|
}
|
2529
|
-
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 };
|
3027
|
+
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 };
|