@twilio/conversations 2.1.0-rc.5 → 2.1.0-rc.9

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.
Files changed (44) hide show
  1. package/CHANGELOG.md +34 -0
  2. package/builds/browser.js +9 -7
  3. package/builds/browser.js.map +1 -1
  4. package/builds/lib.d.ts +36 -6
  5. package/builds/lib.js +9 -7
  6. package/builds/lib.js.map +1 -1
  7. package/builds/twilio-conversations.js +81 -64
  8. package/builds/twilio-conversations.min.js +2 -2
  9. package/dist/configuration.js.map +1 -1
  10. package/dist/conversation.js +3 -0
  11. package/dist/conversation.js.map +1 -1
  12. package/dist/message-builder.js.map +1 -1
  13. package/dist/message.js +4 -5
  14. package/dist/message.js.map +1 -1
  15. package/dist/packages/conversations/package.json.js +1 -1
  16. package/docs/assets/js/search.js +1 -1
  17. package/docs/classes/AggregatedDeliveryReceipt.html +0 -117
  18. package/docs/classes/Client.html +0 -117
  19. package/docs/classes/Conversation.html +35 -129
  20. package/docs/classes/DetailedDeliveryReceipt.html +0 -117
  21. package/docs/classes/Media.html +0 -117
  22. package/docs/classes/Message.html +4 -121
  23. package/docs/classes/MessageBuilder.html +2 -119
  24. package/docs/classes/Participant.html +4 -121
  25. package/docs/classes/PushNotification.html +0 -117
  26. package/docs/classes/RestPaginator.html +0 -117
  27. package/docs/classes/UnsentMessage.html +0 -117
  28. package/docs/classes/User.html +4 -121
  29. package/docs/index.html +60 -0
  30. package/docs/interfaces/ClientOptions.html +0 -117
  31. package/docs/interfaces/ConversationBindings.html +0 -117
  32. package/docs/interfaces/ConversationEmailBinding.html +0 -117
  33. package/docs/interfaces/ConversationLimits.html +3098 -0
  34. package/docs/interfaces/ConversationState.html +0 -117
  35. package/docs/interfaces/CreateConversationOptions.html +1 -118
  36. package/docs/interfaces/LastMessage.html +0 -117
  37. package/docs/interfaces/Paginator.html +0 -117
  38. package/docs/interfaces/ParticipantBindings.html +0 -117
  39. package/docs/interfaces/ParticipantEmailBinding.html +0 -117
  40. package/docs/interfaces/PushNotificationData.html +0 -117
  41. package/docs/interfaces/SendEmailOptions.html +0 -117
  42. package/docs/interfaces/SendMediaOptions.html +0 -117
  43. package/docs/modules.html +60 -0
  44. package/package.json +2 -2
package/builds/lib.d.ts CHANGED
@@ -55,11 +55,29 @@ declare class Logger {
55
55
  static warn(...args: any[]): void;
56
56
  static error(...args: any[]): void;
57
57
  }
58
- interface Limits {
58
+ /**
59
+ * Represents conversation limits.
60
+ */
61
+ interface ConversationLimits {
62
+ /**
63
+ * Maximum amount of attachments.
64
+ */
59
65
  mediaAttachmentsCountLimit: number;
66
+ /**
67
+ * Maximum attachment size in MB.
68
+ */
60
69
  mediaAttachmentSizeLimitInMb: number;
70
+ /**
71
+ * Maximum total attachment size in MB.
72
+ */
61
73
  mediaAttachmentsTotalSizeLimitInMb: number;
74
+ /**
75
+ * Allowed mime types for E-Mail histories.
76
+ */
62
77
  emailHistoriesAllowedMimeTypes: string[];
78
+ /**
79
+ * Allowed mime types for E-Mail bodies.
80
+ */
63
81
  emailBodiesAllowedMimeTypes: string[];
64
82
  }
65
83
  interface BackoffConfiguration {
@@ -78,7 +96,7 @@ declare class Configuration {
78
96
  mediaSetService: string;
79
97
  messagesReceipts: string;
80
98
  };
81
- readonly limits: Limits;
99
+ readonly limits: ConversationLimits;
82
100
  readonly productId?: string;
83
101
  readonly typingIndicatorTimeoutOverride?: number;
84
102
  readonly typingIndicatorTimeoutDefault: number;
@@ -106,10 +124,19 @@ declare class CommandExecutor {
106
124
  fetchResource<REQ = void, RESP = void>(url: string, requestBody?: REQ): Promise<RESP>;
107
125
  mutateResource<REQ = void, RESP = void>(method: "post" | "delete", url: string, requestBody?: REQ): Promise<RESP>;
108
126
  }
127
+ /**
128
+ * Represents a JSON value.
129
+ */
109
130
  type JSONValue = null | string | number | boolean | JSONObject | JSONArray;
131
+ /**
132
+ * Represents a JSON object.
133
+ */
110
134
  type JSONObject = {
111
135
  [x: string]: JSONValue;
112
136
  };
137
+ /**
138
+ * Represents a JSON array.
139
+ */
113
140
  type JSONArray = JSONValue[];
114
141
  type UserEvents = {
115
142
  updated: (data: {
@@ -824,7 +851,7 @@ declare class Message extends ReplayEventEmitter<MessageEvents> {
824
851
  /**
825
852
  * The server-assigned unique identifier of the authoring participant.
826
853
  */
827
- get participantSid(): string;
854
+ get participantSid(): string | null;
828
855
  /**
829
856
  * Aggregated information about the message delivery statuses across all participants of a conversation..
830
857
  */
@@ -1140,7 +1167,7 @@ declare class MessageBuilder {
1140
1167
  /**
1141
1168
  * @internal
1142
1169
  */
1143
- constructor(limits: Limits, messagesEntity: Messages);
1170
+ constructor(limits: ConversationLimits, messagesEntity: Messages);
1144
1171
  /**
1145
1172
  * Sets the message body.
1146
1173
  * @param text Contents of the body.
@@ -1468,7 +1495,10 @@ declare class Conversation extends ReplayEventEmitter<ConversationEvents> {
1468
1495
  */
1469
1496
  get notificationLevel(): NotificationLevel;
1470
1497
  get bindings(): ConversationBindings;
1471
- get limits(): Limits;
1498
+ /**
1499
+ * Current conversation limits.
1500
+ */
1501
+ get limits(): ConversationLimits;
1472
1502
  /**
1473
1503
  * State of the conversation.
1474
1504
  */
@@ -2204,4 +2234,4 @@ declare class NotificationTypes {
2204
2234
  static readonly REMOVED_FROM_CONVERSATION = "twilio.conversations.removed_from_conversation";
2205
2235
  static readonly CONSUMPTION_UPDATE = "twilio.channel.consumption_update";
2206
2236
  }
2207
- 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 };
2237
+ 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 };
package/builds/lib.js CHANGED
@@ -2646,9 +2646,7 @@ var Message = /*#__PURE__*/function (_ReplayEventEmitter) {
2646
2646
  }, {
2647
2647
  key: "participantSid",
2648
2648
  get: function get() {
2649
- var _this$state$participa;
2650
-
2651
- return (_this$state$participa = this.state.participantSid) !== null && _this$state$participa !== void 0 ? _this$state$participa : "";
2649
+ return this.state.participantSid;
2652
2650
  }
2653
2651
  /**
2654
2652
  * Aggregated information about the message delivery statuses across all participants of a conversation..
@@ -2794,7 +2792,7 @@ var Message = /*#__PURE__*/function (_ReplayEventEmitter) {
2794
2792
  }
2795
2793
 
2796
2794
  _context.next = 4;
2797
- return this.conversation.getParticipantBySid(this.participantSid).catch(function () {
2795
+ return this.conversation.getParticipantBySid(this.state.participantSid).catch(function () {
2798
2796
  log$5.debug("Participant with sid \"".concat(_this2.participantSid, "\" not found for message ").concat(_this2.sid));
2799
2797
  return null;
2800
2798
  });
@@ -3120,9 +3118,9 @@ var Message = /*#__PURE__*/function (_ReplayEventEmitter) {
3120
3118
 
3121
3119
  _defineProperty__default['default'](Message, "updated", "updated");
3122
3120
 
3123
- __decorate([declarativeTypeValidator.validateTypes(declarativeTypeValidator.nonEmptyString), __metadata("design:type", Function), __metadata("design:paramtypes", [Object]), __metadata("design:returntype", Media)], Message.prototype, "getEmailBody", null);
3121
+ __decorate([declarativeTypeValidator.validateTypes([declarativeTypeValidator.nonEmptyString, "undefined"]), __metadata("design:type", Function), __metadata("design:paramtypes", [Object]), __metadata("design:returntype", Media)], Message.prototype, "getEmailBody", null);
3124
3122
 
3125
- __decorate([declarativeTypeValidator.validateTypes(declarativeTypeValidator.nonEmptyString), __metadata("design:type", Function), __metadata("design:paramtypes", [Object]), __metadata("design:returntype", Media)], Message.prototype, "getEmailHistory", null);
3123
+ __decorate([declarativeTypeValidator.validateTypes([declarativeTypeValidator.nonEmptyString, "undefined"]), __metadata("design:type", Function), __metadata("design:paramtypes", [Object]), __metadata("design:returntype", Media)], Message.prototype, "getEmailHistory", null);
3126
3124
 
3127
3125
  __decorate([declarativeTypeValidator.validateTypesAsync("string"), __metadata("design:type", Function), __metadata("design:paramtypes", [String]), __metadata("design:returntype", Promise)], Message.prototype, "updateBody", null);
3128
3126
 
@@ -4172,6 +4170,10 @@ var Conversation = /*#__PURE__*/function (_ReplayEventEmitter) {
4172
4170
  get: function get() {
4173
4171
  return this.channelState.bindings;
4174
4172
  }
4173
+ /**
4174
+ * Current conversation limits.
4175
+ */
4176
+
4175
4177
  }, {
4176
4178
  key: "limits",
4177
4179
  get: function get() {
@@ -6858,7 +6860,7 @@ function PushNotification(data) {
6858
6860
  this.data = data.data || {};
6859
6861
  };
6860
6862
 
6861
- var version = "2.1.0-rc.5";
6863
+ var version = "2.1.0-rc.9";
6862
6864
 
6863
6865
  function ownKeys$1(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
6864
6866