@twilio/conversations 2.2.0-rc.12 → 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/CHANGELOG.md +35 -0
- package/README.md +20 -16
- package/builds/browser.js +26 -26
- package/builds/browser.js.map +1 -1
- package/builds/lib.d.ts +17 -12
- package/builds/lib.js +26 -26
- package/builds/lib.js.map +1 -1
- package/builds/twilio-conversations.js +39 -31
- package/builds/twilio-conversations.min.js +1 -1
- package/dist/aggregated-delivery-receipt.js +1 -1
- package/dist/aggregated-delivery-receipt.js.map +1 -1
- package/dist/client.js +1 -4
- package/dist/client.js.map +1 -1
- package/dist/conversation.js +11 -4
- package/dist/conversation.js.map +1 -1
- package/dist/message.js +7 -9
- package/dist/message.js.map +1 -1
- package/dist/packages/conversations/package.json.js +1 -1
- package/docs/classes/AggregatedDeliveryReceipt.html +1 -1
- package/docs/classes/Client.html +0 -4
- package/docs/classes/Conversation.html +9 -4
- package/docs/classes/Message.html +5 -5
- package/docs/index.html +20 -16
- package/docs/modules.html +20 -16
- package/package.json +7 -7
@@ -34549,13 +34549,13 @@ this.Twilio.Conversations = (function (exports) {
|
|
34549
34549
|
return;
|
34550
34550
|
}
|
34551
34551
|
|
34552
|
-
var
|
34552
|
+
var responseHeaders = parseResponseHeaders(xhr.getAllResponseHeaders());
|
34553
34553
|
var body = extractBody(xhr);
|
34554
34554
|
|
34555
34555
|
if (200 <= xhr.status && xhr.status < 300) {
|
34556
34556
|
resolve({
|
34557
34557
|
status: xhr.status,
|
34558
|
-
headers:
|
34558
|
+
headers: responseHeaders,
|
34559
34559
|
body: body
|
34560
34560
|
});
|
34561
34561
|
} else {
|
@@ -34565,13 +34565,21 @@ this.Twilio.Conversations = (function (exports) {
|
|
34565
34565
|
var bodyRepresentation;
|
34566
34566
|
|
34567
34567
|
if (typeof body === "string") {
|
34568
|
-
|
34568
|
+
if (body && body.split("\n", 2).length === 1) bodyRepresentation = body;else {
|
34569
|
+
var _body$replace$split$f; // TODO: RTDSDK-3716: investigate why body is HTML string
|
34570
|
+
|
34571
|
+
|
34572
|
+
var errorInfo = (_body$replace$split$f = body.replace(/<.*?>/g, "").split(/\r\n/g).filter(function (str) {
|
34573
|
+
return str.length;
|
34574
|
+
})[0]) === null || _body$replace$split$f === void 0 ? void 0 : _body$replace$split$f.split(" ");
|
34575
|
+
bodyRepresentation = (errorInfo === null || errorInfo === void 0 ? void 0 : errorInfo.length) > 2 ? errorInfo === null || errorInfo === void 0 ? void 0 : errorInfo.slice(1).join(" ") : "";
|
34576
|
+
}
|
34569
34577
|
} else {
|
34570
34578
|
bodyRepresentation = JSON.stringify(body);
|
34571
34579
|
}
|
34572
34580
|
|
34573
34581
|
var message = "".concat(xhr.status, ": [").concat(status, "] ").concat(bodyRepresentation);
|
34574
|
-
reject(new TransportError(message, xhr.status, body, status,
|
34582
|
+
reject(new TransportError(message, xhr.status, body, status, responseHeaders));
|
34575
34583
|
}
|
34576
34584
|
};
|
34577
34585
|
|
@@ -34842,7 +34850,7 @@ this.Twilio.Conversations = (function (exports) {
|
|
34842
34850
|
return Network;
|
34843
34851
|
}();
|
34844
34852
|
|
34845
|
-
var version = "0.6.
|
34853
|
+
var version = "0.6.1-rc.1";
|
34846
34854
|
|
34847
34855
|
var _class;
|
34848
34856
|
|
@@ -36431,7 +36439,7 @@ this.Twilio.Conversations = (function (exports) {
|
|
36431
36439
|
* Contains aggregated information about delivery statuses of a message across all participants
|
36432
36440
|
* of a conversation.
|
36433
36441
|
*
|
36434
|
-
* At any moment during the message delivery to a participant, the message can have zero or more of following
|
36442
|
+
* At any moment during the message delivery to a participant, the message can have zero or more of the following
|
36435
36443
|
* delivery statuses:
|
36436
36444
|
* * Message is considered as **sent** to a participant if the nearest upstream carrier accepted the message.
|
36437
36445
|
* * Message is considered as **delivered** to a participant if Twilio has received confirmation of message
|
@@ -36844,14 +36852,15 @@ this.Twilio.Conversations = (function (exports) {
|
|
36844
36852
|
return this.state.dateUpdated;
|
36845
36853
|
}
|
36846
36854
|
/**
|
36847
|
-
* Index of
|
36848
|
-
*
|
36855
|
+
* Index of this message in the conversation's list of messages.
|
36856
|
+
*
|
36857
|
+
* By design, the message indices may have arbitrary gaps between them,
|
36849
36858
|
* that does not necessarily mean they were deleted or otherwise modified - just that
|
36850
36859
|
* messages may have some non-contiguous indices even if they are being sent immediately one after another.
|
36851
36860
|
*
|
36852
36861
|
* Trying to use indices for some calculations is going to be unreliable.
|
36853
36862
|
*
|
36854
|
-
* To calculate the number of unread messages it is better to use the
|
36863
|
+
* To calculate the number of unread messages, it is better to use the Read Horizon API.
|
36855
36864
|
* See {@link Conversation.getUnreadMessagesCount} for details.
|
36856
36865
|
*/
|
36857
36866
|
|
@@ -37166,32 +37175,27 @@ this.Twilio.Conversations = (function (exports) {
|
|
37166
37175
|
|
37167
37176
|
case 2:
|
37168
37177
|
paginator = _context2.sent;
|
37169
|
-
detailedDeliveryReceipts =
|
37178
|
+
detailedDeliveryReceipts = paginator.items;
|
37170
37179
|
|
37171
37180
|
case 4:
|
37172
|
-
|
37173
|
-
|
37174
|
-
|
37175
|
-
if (paginator.hasNextPage) {
|
37176
|
-
_context2.next = 8;
|
37181
|
+
if (!paginator.hasNextPage) {
|
37182
|
+
_context2.next = 11;
|
37177
37183
|
break;
|
37178
37184
|
}
|
37179
37185
|
|
37180
|
-
|
37181
|
-
|
37182
|
-
case 8:
|
37183
|
-
_context2.next = 10;
|
37186
|
+
_context2.next = 7;
|
37184
37187
|
return paginator.nextPage();
|
37185
37188
|
|
37186
|
-
case
|
37189
|
+
case 7:
|
37187
37190
|
paginator = _context2.sent;
|
37191
|
+
detailedDeliveryReceipts = [].concat(_toConsumableArray(detailedDeliveryReceipts), _toConsumableArray(paginator.items));
|
37188
37192
|
_context2.next = 4;
|
37189
37193
|
break;
|
37190
37194
|
|
37191
|
-
case
|
37195
|
+
case 11:
|
37192
37196
|
return _context2.abrupt("return", detailedDeliveryReceipts);
|
37193
37197
|
|
37194
|
-
case
|
37198
|
+
case 12:
|
37195
37199
|
case "end":
|
37196
37200
|
return _context2.stop();
|
37197
37201
|
}
|
@@ -39112,7 +39116,7 @@ this.Twilio.Conversations = (function (exports) {
|
|
39112
39116
|
return getMessagesCount;
|
39113
39117
|
}()
|
39114
39118
|
/**
|
39115
|
-
* Get unread messages
|
39119
|
+
* Get count of unread messages for the user if they are a participant of this
|
39116
39120
|
* conversation. Rejects if the user is not a participant of the conversation.
|
39117
39121
|
*
|
39118
39122
|
* Use this method to obtain the number of unread messages together with
|
@@ -39120,12 +39124,19 @@ this.Twilio.Conversations = (function (exports) {
|
|
39120
39124
|
* message indices which may have gaps. See {@link Message.index} for details.
|
39121
39125
|
*
|
39122
39126
|
* This method is semi-realtime. This means that this data will be eventually
|
39123
|
-
* correct, but will also be possibly incorrect for a few seconds. The
|
39127
|
+
* correct, but it will also be possibly incorrect for a few seconds. The
|
39124
39128
|
* Conversations system does not provide real time events for counter values
|
39125
39129
|
* changes.
|
39126
39130
|
*
|
39127
39131
|
* This is useful for any UI badges, but it is not recommended to build any
|
39128
39132
|
* core application logic based on these counters being accurate in real time.
|
39133
|
+
*
|
39134
|
+
* If the read horizon is not set, this function will return null. This could mean
|
39135
|
+
* that all messages in the conversation are unread, or that the read horizon system
|
39136
|
+
* is not being used. How to interpret this `null` value is up to the customer application.
|
39137
|
+
*
|
39138
|
+
* @return Number of unread messages based on the current read horizon set for
|
39139
|
+
* the user or `null` if the read horizon is not set.
|
39129
39140
|
*/
|
39130
39141
|
|
39131
39142
|
}, {
|
@@ -39398,7 +39409,7 @@ this.Twilio.Conversations = (function (exports) {
|
|
39398
39409
|
}()
|
39399
39410
|
/**
|
39400
39411
|
* Set all messages in the conversation unread.
|
39401
|
-
* @
|
39412
|
+
* @returns New count of unread messages after this update.
|
39402
39413
|
*/
|
39403
39414
|
|
39404
39415
|
}, {
|
@@ -39556,7 +39567,7 @@ this.Twilio.Conversations = (function (exports) {
|
|
39556
39567
|
* Set the last read message index to the current read horizon.
|
39557
39568
|
* @param index Message index to set as last read. If null is provided, then
|
39558
39569
|
* the behavior is identical to {@link Conversation.setAllMessagesUnread}.
|
39559
|
-
* @returns
|
39570
|
+
* @returns New count of unread messages after this update.
|
39560
39571
|
*/
|
39561
39572
|
|
39562
39573
|
}, {
|
@@ -41530,7 +41541,7 @@ this.Twilio.Conversations = (function (exports) {
|
|
41530
41541
|
this.data = data.data || {};
|
41531
41542
|
});
|
41532
41543
|
|
41533
|
-
var version = "2.2.0-rc.
|
41544
|
+
var version = "2.2.0-rc.14";
|
41534
41545
|
|
41535
41546
|
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; }
|
41536
41547
|
|
@@ -41942,9 +41953,6 @@ this.Twilio.Conversations = (function (exports) {
|
|
41942
41953
|
|
41943
41954
|
/**
|
41944
41955
|
* Fired when the client has completed initialization successfully.
|
41945
|
-
*
|
41946
|
-
* Parameters:
|
41947
|
-
* 1. object `data` - Optional info object provided with the event
|
41948
41956
|
* @event
|
41949
41957
|
*/
|
41950
41958
|
|
@@ -43010,7 +43018,7 @@ this.Twilio.Conversations = (function (exports) {
|
|
43010
43018
|
this._resolveEnsureReady();
|
43011
43019
|
|
43012
43020
|
this.emit("stateChanged", "initialized");
|
43013
|
-
this.emit("initialized"
|
43021
|
+
this.emit("initialized");
|
43014
43022
|
|
43015
43023
|
case 34:
|
43016
43024
|
case "end":
|