@twilio/conversations 2.3.0-rc.0 → 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 +53 -30
- package/builds/browser.js.map +1 -1
- package/builds/lib.js +44 -30
- package/builds/lib.js.map +1 -1
- package/builds/twilio-conversations.js +54 -31
- 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 +9 -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 +9 -0
- package/dist/content-client.js.map +1 -1
- package/dist/content-template.js +9 -0
- package/dist/content-template.js.map +1 -1
- 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 +9 -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 +9 -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 +9 -0
- package/dist/message-builder.js.map +1 -1
- package/dist/message.js +34 -10
- 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/package.json +9 -8
package/builds/lib.js
CHANGED
@@ -2795,10 +2795,14 @@ function _createSuper$5(Derived) { var hasNativeReflectConstruct = _isNativeRefl
|
|
2795
2795
|
|
2796
2796
|
function _isNativeReflectConstruct$5() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
2797
2797
|
var log$3 = Logger.scope("Message");
|
2798
|
+
|
2799
|
+
var XHR = // eslint-disable-next-line @typescript-eslint/no-var-requires
|
2800
|
+
global["XMLHttpRequest"] || require("xmlhttprequest").XMLHttpRequest;
|
2798
2801
|
/**
|
2799
2802
|
* A message in a conversation.
|
2800
2803
|
*/
|
2801
2804
|
|
2805
|
+
|
2802
2806
|
var Message = /*#__PURE__*/function (_ReplayEventEmitter) {
|
2803
2807
|
_inherits__default["default"](Message, _ReplayEventEmitter);
|
2804
2808
|
|
@@ -3565,7 +3569,7 @@ var Message = /*#__PURE__*/function (_ReplayEventEmitter) {
|
|
3565
3569
|
|
3566
3570
|
return new mcsClient.CancellablePromise( /*#__PURE__*/function () {
|
3567
3571
|
var _ref2 = _asyncToGenerator__default["default"]( /*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee9(resolve, reject, onCancel) {
|
3568
|
-
var bodies, twilioPrefix, filteredMedias, contentMedia, urlPromise, url,
|
3572
|
+
var bodies, twilioPrefix, filteredMedias, contentMedia, urlPromise, url, jsonStringPromise, json, jsonString, dataType;
|
3569
3573
|
return _regeneratorRuntime__default["default"].wrap(function _callee9$(_context9) {
|
3570
3574
|
while (1) {
|
3571
3575
|
switch (_context9.prev = _context9.next) {
|
@@ -3634,49 +3638,59 @@ var Message = /*#__PURE__*/function (_ReplayEventEmitter) {
|
|
3634
3638
|
return _context9.abrupt("return");
|
3635
3639
|
|
3636
3640
|
case 28:
|
3637
|
-
|
3638
|
-
|
3639
|
-
|
3640
|
-
|
3641
|
-
|
3642
|
-
|
3641
|
+
jsonStringPromise = new Promise(function (resolve, reject) {
|
3642
|
+
var _url;
|
3643
|
+
|
3644
|
+
var isCancelled = false;
|
3645
|
+
var xhr = new XHR();
|
3646
|
+
xhr.open("GET", (_url = url) !== null && _url !== void 0 ? _url : "", true);
|
3647
|
+
xhr.responseType = "text";
|
3648
|
+
|
3649
|
+
xhr.onreadystatechange = function () {
|
3650
|
+
if (xhr.readyState !== 4 || isCancelled) {
|
3651
|
+
return;
|
3652
|
+
}
|
3653
|
+
|
3654
|
+
resolve(xhr.responseText);
|
3655
|
+
};
|
3656
|
+
|
3657
|
+
xhr.onerror = function () {
|
3658
|
+
reject(xhr.statusText);
|
3659
|
+
};
|
3660
|
+
|
3661
|
+
onCancel(function () {
|
3662
|
+
isCancelled = true;
|
3663
|
+
xhr.abort();
|
3664
|
+
reject(new Error("XHR has been aborted"));
|
3665
|
+
});
|
3666
|
+
xhr.send();
|
3643
3667
|
});
|
3644
|
-
_context9.prev =
|
3645
|
-
_context9.next =
|
3646
|
-
return
|
3668
|
+
_context9.prev = 29;
|
3669
|
+
_context9.next = 32;
|
3670
|
+
return jsonStringPromise;
|
3647
3671
|
|
3648
|
-
case
|
3649
|
-
|
3650
|
-
|
3651
|
-
return response.blob();
|
3652
|
-
|
3653
|
-
case 37:
|
3654
|
-
blob = _context9.sent;
|
3672
|
+
case 32:
|
3673
|
+
jsonString = _context9.sent;
|
3674
|
+
json = JSON.parse(jsonString);
|
3655
3675
|
_context9.next = 40;
|
3656
|
-
return blob.text();
|
3657
|
-
|
3658
|
-
case 40:
|
3659
|
-
text = _context9.sent;
|
3660
|
-
json = JSON.parse(text);
|
3661
|
-
_context9.next = 48;
|
3662
3676
|
break;
|
3663
3677
|
|
3664
|
-
case
|
3665
|
-
_context9.prev =
|
3666
|
-
_context9.t1 = _context9["catch"](
|
3678
|
+
case 36:
|
3679
|
+
_context9.prev = 36;
|
3680
|
+
_context9.t1 = _context9["catch"](29);
|
3667
3681
|
reject(_context9.t1);
|
3668
3682
|
return _context9.abrupt("return");
|
3669
3683
|
|
3670
|
-
case
|
3684
|
+
case 40:
|
3671
3685
|
dataType = contentMedia.contentType.replace(twilioPrefix, "").replace(".", "/");
|
3672
3686
|
resolve(parseVariant(dataType, json.data));
|
3673
3687
|
|
3674
|
-
case
|
3688
|
+
case 42:
|
3675
3689
|
case "end":
|
3676
3690
|
return _context9.stop();
|
3677
3691
|
}
|
3678
3692
|
}
|
3679
|
-
}, _callee9, null, [[15, 21], [
|
3693
|
+
}, _callee9, null, [[15, 21], [29, 36]]);
|
3680
3694
|
}));
|
3681
3695
|
|
3682
3696
|
return function (_x8, _x9, _x10) {
|
@@ -7741,7 +7755,7 @@ function PushNotification(data) {
|
|
7741
7755
|
this.data = data.data || {};
|
7742
7756
|
});
|
7743
7757
|
|
7744
|
-
var version = "2.3.0-rc.
|
7758
|
+
var version = "2.3.0-rc.1";
|
7745
7759
|
|
7746
7760
|
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; }
|
7747
7761
|
|