@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/browser.js
CHANGED
@@ -128,6 +128,15 @@ This software includes platform.js under the following license.
|
|
128
128
|
*/
|
129
129
|
'use strict';
|
130
130
|
|
131
|
+
var global =
|
132
|
+
typeof global !== "undefined"
|
133
|
+
? global
|
134
|
+
: typeof self !== "undefined"
|
135
|
+
? self
|
136
|
+
: typeof window !== "undefined"
|
137
|
+
? window
|
138
|
+
: {};
|
139
|
+
|
131
140
|
Object.defineProperty(exports, '__esModule', { value: true });
|
132
141
|
|
133
142
|
require('core-js/modules/es.reflect.to-string-tag.js');
|
@@ -2795,10 +2804,14 @@ function _createSuper$5(Derived) { var hasNativeReflectConstruct = _isNativeRefl
|
|
2795
2804
|
|
2796
2805
|
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
2806
|
var log$3 = Logger.scope("Message");
|
2807
|
+
|
2808
|
+
var XHR = // eslint-disable-next-line @typescript-eslint/no-var-requires
|
2809
|
+
global["XMLHttpRequest"] || require("xmlhttprequest").XMLHttpRequest;
|
2798
2810
|
/**
|
2799
2811
|
* A message in a conversation.
|
2800
2812
|
*/
|
2801
2813
|
|
2814
|
+
|
2802
2815
|
var Message = /*#__PURE__*/function (_ReplayEventEmitter) {
|
2803
2816
|
_inherits__default["default"](Message, _ReplayEventEmitter);
|
2804
2817
|
|
@@ -3565,7 +3578,7 @@ var Message = /*#__PURE__*/function (_ReplayEventEmitter) {
|
|
3565
3578
|
|
3566
3579
|
return new mcsClient.CancellablePromise( /*#__PURE__*/function () {
|
3567
3580
|
var _ref2 = _asyncToGenerator__default["default"]( /*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee9(resolve, reject, onCancel) {
|
3568
|
-
var bodies, twilioPrefix, filteredMedias, contentMedia, urlPromise, url,
|
3581
|
+
var bodies, twilioPrefix, filteredMedias, contentMedia, urlPromise, url, jsonStringPromise, json, jsonString, dataType;
|
3569
3582
|
return _regeneratorRuntime__default["default"].wrap(function _callee9$(_context9) {
|
3570
3583
|
while (1) {
|
3571
3584
|
switch (_context9.prev = _context9.next) {
|
@@ -3634,49 +3647,59 @@ var Message = /*#__PURE__*/function (_ReplayEventEmitter) {
|
|
3634
3647
|
return _context9.abrupt("return");
|
3635
3648
|
|
3636
3649
|
case 28:
|
3637
|
-
|
3638
|
-
|
3639
|
-
|
3640
|
-
|
3641
|
-
|
3642
|
-
|
3650
|
+
jsonStringPromise = new Promise(function (resolve, reject) {
|
3651
|
+
var _url;
|
3652
|
+
|
3653
|
+
var isCancelled = false;
|
3654
|
+
var xhr = new XHR();
|
3655
|
+
xhr.open("GET", (_url = url) !== null && _url !== void 0 ? _url : "", true);
|
3656
|
+
xhr.responseType = "text";
|
3657
|
+
|
3658
|
+
xhr.onreadystatechange = function () {
|
3659
|
+
if (xhr.readyState !== 4 || isCancelled) {
|
3660
|
+
return;
|
3661
|
+
}
|
3662
|
+
|
3663
|
+
resolve(xhr.responseText);
|
3664
|
+
};
|
3665
|
+
|
3666
|
+
xhr.onerror = function () {
|
3667
|
+
reject(xhr.statusText);
|
3668
|
+
};
|
3669
|
+
|
3670
|
+
onCancel(function () {
|
3671
|
+
isCancelled = true;
|
3672
|
+
xhr.abort();
|
3673
|
+
reject(new Error("XHR has been aborted"));
|
3674
|
+
});
|
3675
|
+
xhr.send();
|
3643
3676
|
});
|
3644
|
-
_context9.prev =
|
3645
|
-
_context9.next =
|
3646
|
-
return
|
3677
|
+
_context9.prev = 29;
|
3678
|
+
_context9.next = 32;
|
3679
|
+
return jsonStringPromise;
|
3647
3680
|
|
3648
|
-
case
|
3649
|
-
|
3650
|
-
|
3651
|
-
return response.blob();
|
3652
|
-
|
3653
|
-
case 37:
|
3654
|
-
blob = _context9.sent;
|
3681
|
+
case 32:
|
3682
|
+
jsonString = _context9.sent;
|
3683
|
+
json = JSON.parse(jsonString);
|
3655
3684
|
_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
3685
|
break;
|
3663
3686
|
|
3664
|
-
case
|
3665
|
-
_context9.prev =
|
3666
|
-
_context9.t1 = _context9["catch"](
|
3687
|
+
case 36:
|
3688
|
+
_context9.prev = 36;
|
3689
|
+
_context9.t1 = _context9["catch"](29);
|
3667
3690
|
reject(_context9.t1);
|
3668
3691
|
return _context9.abrupt("return");
|
3669
3692
|
|
3670
|
-
case
|
3693
|
+
case 40:
|
3671
3694
|
dataType = contentMedia.contentType.replace(twilioPrefix, "").replace(".", "/");
|
3672
3695
|
resolve(parseVariant(dataType, json.data));
|
3673
3696
|
|
3674
|
-
case
|
3697
|
+
case 42:
|
3675
3698
|
case "end":
|
3676
3699
|
return _context9.stop();
|
3677
3700
|
}
|
3678
3701
|
}
|
3679
|
-
}, _callee9, null, [[15, 21], [
|
3702
|
+
}, _callee9, null, [[15, 21], [29, 36]]);
|
3680
3703
|
}));
|
3681
3704
|
|
3682
3705
|
return function (_x8, _x9, _x10) {
|
@@ -7741,7 +7764,7 @@ function PushNotification(data) {
|
|
7741
7764
|
this.data = data.data || {};
|
7742
7765
|
});
|
7743
7766
|
|
7744
|
-
var version = "2.3.0-rc.
|
7767
|
+
var version = "2.3.0-rc.1";
|
7745
7768
|
|
7746
7769
|
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
7770
|
|