@twilio/conversations 2.2.0-rc.13 → 2.2.0-rc.14

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/lib.d.ts CHANGED
@@ -588,7 +588,7 @@ interface AggregatedDeliveryDescriptor {
588
588
  * Contains aggregated information about delivery statuses of a message across all participants
589
589
  * of a conversation.
590
590
  *
591
- * At any moment during the message delivery to a participant, the message can have zero or more of following
591
+ * At any moment during the message delivery to a participant, the message can have zero or more of the following
592
592
  * delivery statuses:
593
593
  * * Message is considered as **sent** to a participant if the nearest upstream carrier accepted the message.
594
594
  * * Message is considered as **delivered** to a participant if Twilio has received confirmation of message
@@ -803,14 +803,15 @@ declare class Message extends ReplayEventEmitter<MessageEvents> {
803
803
  */
804
804
  get dateUpdated(): Date | null;
805
805
  /**
806
- * Index of the message in the conversation's messages list.
807
- * By design of the Conversations system, the message indices may have arbitrary gaps between them,
806
+ * Index of this message in the conversation's list of messages.
807
+ *
808
+ * By design, the message indices may have arbitrary gaps between them,
808
809
  * that does not necessarily mean they were deleted or otherwise modified - just that
809
810
  * messages may have some non-contiguous indices even if they are being sent immediately one after another.
810
811
  *
811
812
  * Trying to use indices for some calculations is going to be unreliable.
812
813
  *
813
- * To calculate the number of unread messages it is better to use the read horizon API.
814
+ * To calculate the number of unread messages, it is better to use the Read Horizon API.
814
815
  * See {@link Conversation.getUnreadMessagesCount} for details.
815
816
  */
816
817
  get index(): number;
@@ -1707,7 +1708,7 @@ declare class Conversation extends ReplayEventEmitter<ConversationEvents> {
1707
1708
  */
1708
1709
  getMessagesCount(): Promise<number>;
1709
1710
  /**
1710
- * Get unread messages count for the user if they are a participant of this
1711
+ * Get count of unread messages for the user if they are a participant of this
1711
1712
  * conversation. Rejects if the user is not a participant of the conversation.
1712
1713
  *
1713
1714
  * Use this method to obtain the number of unread messages together with
@@ -1715,12 +1716,19 @@ declare class Conversation extends ReplayEventEmitter<ConversationEvents> {
1715
1716
  * message indices which may have gaps. See {@link Message.index} for details.
1716
1717
  *
1717
1718
  * This method is semi-realtime. This means that this data will be eventually
1718
- * correct, but will also be possibly incorrect for a few seconds. The
1719
+ * correct, but it will also be possibly incorrect for a few seconds. The
1719
1720
  * Conversations system does not provide real time events for counter values
1720
1721
  * changes.
1721
1722
  *
1722
1723
  * This is useful for any UI badges, but it is not recommended to build any
1723
1724
  * core application logic based on these counters being accurate in real time.
1725
+ *
1726
+ * If the read horizon is not set, this function will return null. This could mean
1727
+ * that all messages in the conversation are unread, or that the read horizon system
1728
+ * is not being used. How to interpret this `null` value is up to the customer application.
1729
+ *
1730
+ * @return Number of unread messages based on the current read horizon set for
1731
+ * the user or `null` if the read horizon is not set.
1724
1732
  */
1725
1733
  getUnreadMessagesCount(): Promise<number | null>;
1726
1734
  /**
@@ -1761,7 +1769,7 @@ declare class Conversation extends ReplayEventEmitter<ConversationEvents> {
1761
1769
  setAllMessagesRead(): Promise<number>;
1762
1770
  /**
1763
1771
  * Set all messages in the conversation unread.
1764
- * @return Resulting unread messages count in the conversation.
1772
+ * @returns New count of unread messages after this update.
1765
1773
  */
1766
1774
  setAllMessagesUnread(): Promise<number>;
1767
1775
  /**
@@ -1790,7 +1798,7 @@ declare class Conversation extends ReplayEventEmitter<ConversationEvents> {
1790
1798
  * Set the last read message index to the current read horizon.
1791
1799
  * @param index Message index to set as last read. If null is provided, then
1792
1800
  * the behavior is identical to {@link Conversation.setAllMessagesUnread}.
1793
- * @returns Resulting unread messages count in the conversation.
1801
+ * @returns New count of unread messages after this update.
1794
1802
  */
1795
1803
  updateLastReadMessageIndex(index: number | null): Promise<number>;
1796
1804
  /**
package/builds/lib.js CHANGED
@@ -2304,7 +2304,7 @@ var Media = /*#__PURE__*/function () {
2304
2304
  * Contains aggregated information about delivery statuses of a message across all participants
2305
2305
  * of a conversation.
2306
2306
  *
2307
- * At any moment during the message delivery to a participant, the message can have zero or more of following
2307
+ * At any moment during the message delivery to a participant, the message can have zero or more of the following
2308
2308
  * delivery statuses:
2309
2309
  * * Message is considered as **sent** to a participant if the nearest upstream carrier accepted the message.
2310
2310
  * * Message is considered as **delivered** to a participant if Twilio has received confirmation of message
@@ -2661,14 +2661,15 @@ var Message = /*#__PURE__*/function (_ReplayEventEmitter) {
2661
2661
  return this.state.dateUpdated;
2662
2662
  }
2663
2663
  /**
2664
- * Index of the message in the conversation's messages list.
2665
- * By design of the Conversations system, the message indices may have arbitrary gaps between them,
2664
+ * Index of this message in the conversation's list of messages.
2665
+ *
2666
+ * By design, the message indices may have arbitrary gaps between them,
2666
2667
  * that does not necessarily mean they were deleted or otherwise modified - just that
2667
2668
  * messages may have some non-contiguous indices even if they are being sent immediately one after another.
2668
2669
  *
2669
2670
  * Trying to use indices for some calculations is going to be unreliable.
2670
2671
  *
2671
- * To calculate the number of unread messages it is better to use the read horizon API.
2672
+ * To calculate the number of unread messages, it is better to use the Read Horizon API.
2672
2673
  * See {@link Conversation.getUnreadMessagesCount} for details.
2673
2674
  */
2674
2675
 
@@ -2983,32 +2984,27 @@ var Message = /*#__PURE__*/function (_ReplayEventEmitter) {
2983
2984
 
2984
2985
  case 2:
2985
2986
  paginator = _context2.sent;
2986
- detailedDeliveryReceipts = [];
2987
+ detailedDeliveryReceipts = paginator.items;
2987
2988
 
2988
2989
  case 4:
2989
-
2990
- detailedDeliveryReceipts = [].concat(_toConsumableArray__default["default"](detailedDeliveryReceipts), _toConsumableArray__default["default"](paginator.items));
2991
-
2992
- if (paginator.hasNextPage) {
2993
- _context2.next = 8;
2990
+ if (!paginator.hasNextPage) {
2991
+ _context2.next = 11;
2994
2992
  break;
2995
2993
  }
2996
2994
 
2997
- return _context2.abrupt("break", 13);
2998
-
2999
- case 8:
3000
- _context2.next = 10;
2995
+ _context2.next = 7;
3001
2996
  return paginator.nextPage();
3002
2997
 
3003
- case 10:
2998
+ case 7:
3004
2999
  paginator = _context2.sent;
3000
+ detailedDeliveryReceipts = [].concat(_toConsumableArray__default["default"](detailedDeliveryReceipts), _toConsumableArray__default["default"](paginator.items));
3005
3001
  _context2.next = 4;
3006
3002
  break;
3007
3003
 
3008
- case 13:
3004
+ case 11:
3009
3005
  return _context2.abrupt("return", detailedDeliveryReceipts);
3010
3006
 
3011
- case 14:
3007
+ case 12:
3012
3008
  case "end":
3013
3009
  return _context2.stop();
3014
3010
  }
@@ -4929,7 +4925,7 @@ var Conversation = /*#__PURE__*/function (_ReplayEventEmitter) {
4929
4925
  return getMessagesCount;
4930
4926
  }()
4931
4927
  /**
4932
- * Get unread messages count for the user if they are a participant of this
4928
+ * Get count of unread messages for the user if they are a participant of this
4933
4929
  * conversation. Rejects if the user is not a participant of the conversation.
4934
4930
  *
4935
4931
  * Use this method to obtain the number of unread messages together with
@@ -4937,12 +4933,19 @@ var Conversation = /*#__PURE__*/function (_ReplayEventEmitter) {
4937
4933
  * message indices which may have gaps. See {@link Message.index} for details.
4938
4934
  *
4939
4935
  * This method is semi-realtime. This means that this data will be eventually
4940
- * correct, but will also be possibly incorrect for a few seconds. The
4936
+ * correct, but it will also be possibly incorrect for a few seconds. The
4941
4937
  * Conversations system does not provide real time events for counter values
4942
4938
  * changes.
4943
4939
  *
4944
4940
  * This is useful for any UI badges, but it is not recommended to build any
4945
4941
  * core application logic based on these counters being accurate in real time.
4942
+ *
4943
+ * If the read horizon is not set, this function will return null. This could mean
4944
+ * that all messages in the conversation are unread, or that the read horizon system
4945
+ * is not being used. How to interpret this `null` value is up to the customer application.
4946
+ *
4947
+ * @return Number of unread messages based on the current read horizon set for
4948
+ * the user or `null` if the read horizon is not set.
4946
4949
  */
4947
4950
 
4948
4951
  }, {
@@ -5215,7 +5218,7 @@ var Conversation = /*#__PURE__*/function (_ReplayEventEmitter) {
5215
5218
  }()
5216
5219
  /**
5217
5220
  * Set all messages in the conversation unread.
5218
- * @return Resulting unread messages count in the conversation.
5221
+ * @returns New count of unread messages after this update.
5219
5222
  */
5220
5223
 
5221
5224
  }, {
@@ -5373,7 +5376,7 @@ var Conversation = /*#__PURE__*/function (_ReplayEventEmitter) {
5373
5376
  * Set the last read message index to the current read horizon.
5374
5377
  * @param index Message index to set as last read. If null is provided, then
5375
5378
  * the behavior is identical to {@link Conversation.setAllMessagesUnread}.
5376
- * @returns Resulting unread messages count in the conversation.
5379
+ * @returns New count of unread messages after this update.
5377
5380
  */
5378
5381
 
5379
5382
  }, {
@@ -7326,7 +7329,7 @@ function PushNotification(data) {
7326
7329
  this.data = data.data || {};
7327
7330
  });
7328
7331
 
7329
- var version = "2.2.0-rc.13";
7332
+ var version = "2.2.0-rc.14";
7330
7333
 
7331
7334
  function ownKeys$1(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
7332
7335