@twilio/conversations 3.0.0-canary.9 → 3.0.0-rc.6
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 +485 -0
- package/builds/browser.js +38 -23
- package/builds/browser.js.map +1 -1
- package/builds/lib.d.ts +1 -3
- package/builds/lib.js +38 -23
- package/builds/lib.js.map +1 -1
- package/builds/twilio-conversations.js +272 -61
- package/builds/twilio-conversations.min.js +1 -1
- package/dist/client.js +13 -5
- package/dist/client.js.map +1 -1
- package/dist/conversation.js +0 -4
- package/dist/conversation.js.map +1 -1
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -1
- package/dist/message.js +7 -3
- package/dist/message.js.map +1 -1
- package/dist/packages/conversations/package.json.js +1 -1
- package/docs/assets/css/main.css +2660 -0
- package/docs/assets/images/icons.png +0 -0
- package/docs/assets/images/icons@2x.png +0 -0
- package/docs/assets/images/widgets.png +0 -0
- package/docs/assets/images/widgets@2x.png +0 -0
- package/docs/assets/js/main.js +248 -0
- package/docs/assets/js/search.js +1 -0
- package/docs/classes/AggregatedDeliveryReceipt.html +3184 -0
- package/docs/classes/CancellablePromise.html +3213 -0
- package/docs/classes/Client.html +4239 -0
- package/docs/classes/Conversation.html +4354 -0
- package/docs/classes/DetailedDeliveryReceipt.html +3163 -0
- package/docs/classes/Media.html +3167 -0
- package/docs/classes/Message.html +3732 -0
- package/docs/classes/MessageBuilder.html +3277 -0
- package/docs/classes/Participant.html +3444 -0
- package/docs/classes/PushNotification.html +3130 -0
- package/docs/classes/RestPaginator.html +3160 -0
- package/docs/classes/UnsentMessage.html +3042 -0
- package/docs/classes/User.html +3349 -0
- package/docs/index.html +3509 -0
- package/docs/interfaces/ClientOptions.html +3034 -0
- package/docs/interfaces/ConversationBindings.html +3001 -0
- package/docs/interfaces/ConversationEmailBinding.html +3001 -0
- package/docs/interfaces/ConversationLimits.html +3098 -0
- package/docs/interfaces/ConversationState.html +3050 -0
- package/docs/interfaces/ConversationUpdatedEventArgs.html +3001 -0
- package/docs/interfaces/CreateConversationOptions.html +3066 -0
- package/docs/interfaces/LastMessage.html +3050 -0
- package/docs/interfaces/Paginator.html +3141 -0
- package/docs/interfaces/ParticipantBindings.html +3001 -0
- package/docs/interfaces/ParticipantEmailBinding.html +3001 -0
- package/docs/interfaces/PushNotificationData.html +3114 -0
- package/docs/interfaces/SendEmailOptions.html +3034 -0
- package/docs/interfaces/SendMediaOptions.html +3068 -0
- package/docs/modules.html +3510 -0
- package/package.json +11 -12
@@ -784,19 +784,19 @@ this.Twilio.Conversations = (function (exports) {
|
|
784
784
|
var anObject$i = anObject$k;
|
785
785
|
|
786
786
|
// all object keys, includes non-enumerable and symbols
|
787
|
-
var ownKeys$
|
787
|
+
var ownKeys$8 = getBuiltIn$7('Reflect', 'ownKeys') || function ownKeys(it) {
|
788
788
|
var keys = getOwnPropertyNamesModule$2.f(anObject$i(it));
|
789
789
|
var getOwnPropertySymbols = getOwnPropertySymbolsModule$2.f;
|
790
790
|
return getOwnPropertySymbols ? keys.concat(getOwnPropertySymbols(it)) : keys;
|
791
791
|
};
|
792
792
|
|
793
793
|
var has$a = has$g;
|
794
|
-
var ownKeys$
|
794
|
+
var ownKeys$7 = ownKeys$8;
|
795
795
|
var getOwnPropertyDescriptorModule$3 = objectGetOwnPropertyDescriptor;
|
796
796
|
var definePropertyModule$6 = objectDefineProperty;
|
797
797
|
|
798
798
|
var copyConstructorProperties$2 = function (target, source) {
|
799
|
-
var keys = ownKeys$
|
799
|
+
var keys = ownKeys$7(source);
|
800
800
|
var defineProperty = definePropertyModule$6.f;
|
801
801
|
var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule$3.f;
|
802
802
|
for (var i = 0; i < keys.length; i++) {
|
@@ -1681,7 +1681,7 @@ this.Twilio.Conversations = (function (exports) {
|
|
1681
1681
|
|
1682
1682
|
var $$r = _export;
|
1683
1683
|
var DESCRIPTORS$b = descriptors;
|
1684
|
-
var ownKeys$
|
1684
|
+
var ownKeys$6 = ownKeys$8;
|
1685
1685
|
var toIndexedObject$5 = toIndexedObject$c;
|
1686
1686
|
var getOwnPropertyDescriptorModule$1 = objectGetOwnPropertyDescriptor;
|
1687
1687
|
var createProperty$4 = createProperty$5;
|
@@ -1692,7 +1692,7 @@ this.Twilio.Conversations = (function (exports) {
|
|
1692
1692
|
getOwnPropertyDescriptors: function getOwnPropertyDescriptors(object) {
|
1693
1693
|
var O = toIndexedObject$5(object);
|
1694
1694
|
var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule$1.f;
|
1695
|
-
var keys = ownKeys$
|
1695
|
+
var keys = ownKeys$6(O);
|
1696
1696
|
var result = {};
|
1697
1697
|
var index = 0;
|
1698
1698
|
var key, descriptor;
|
@@ -4445,9 +4445,9 @@ this.Twilio.Conversations = (function (exports) {
|
|
4445
4445
|
parse: parse
|
4446
4446
|
};
|
4447
4447
|
|
4448
|
-
function ownKeys$
|
4448
|
+
function ownKeys$5(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; }
|
4449
4449
|
|
4450
|
-
function _objectSpread$
|
4450
|
+
function _objectSpread$5(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$5(Object(source), !0).forEach(function (key) { _defineProperty$3(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$5(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
4451
4451
|
var TYPING_TIMEOUT = 5;
|
4452
4452
|
var HTTP_CACHE_LIFETIME = "PT5S";
|
4453
4453
|
var CONSUMPTION_HORIZON_SENDING_INTERVAL = "PT5S";
|
@@ -4488,7 +4488,7 @@ this.Twilio.Conversations = (function (exports) {
|
|
4488
4488
|
emailBodiesAllowedContentTypes: configurationResponse.options.email_bodies_allowed_mime_types
|
4489
4489
|
};
|
4490
4490
|
this.typingIndicatorTimeoutOverride = constructorOptions.typingIndicatorTimeoutOverride;
|
4491
|
-
this.backoffConfiguration = _objectSpread$
|
4491
|
+
this.backoffConfiguration = _objectSpread$5({
|
4492
4492
|
min: MINIMUM_RETRY_DELAY$1,
|
4493
4493
|
max: MAXIMUM_RETRY_DELAY$1,
|
4494
4494
|
maxAttemptsCount: MAXIMUM_ATTEMPTS_COUNT
|
@@ -15780,7 +15780,7 @@ this.Twilio.Conversations = (function (exports) {
|
|
15780
15780
|
}();
|
15781
15781
|
|
15782
15782
|
var logInstance = new Logger("");
|
15783
|
-
var version = "0.13.0-rc.
|
15783
|
+
var version = "0.13.0-rc.2";
|
15784
15784
|
/**
|
15785
15785
|
* Settings container for the Twilsock client library
|
15786
15786
|
*/
|
@@ -29699,7 +29699,7 @@ this.Twilio.Conversations = (function (exports) {
|
|
29699
29699
|
|
29700
29700
|
__decorate([declarativeTypeValidator.validateTypes(declarativeTypeValidator.nonEmptyString), __metadata("design:type", Function), __metadata("design:paramtypes", [String]), __metadata("design:returntype", void 0)], InstantQuery.prototype, "updateIndexName", null);
|
29701
29701
|
|
29702
|
-
var version$1 = "3.2.0
|
29702
|
+
var version$1 = "3.2.0";
|
29703
29703
|
|
29704
29704
|
function _createSuper$9(Derived) {
|
29705
29705
|
var hasNativeReflectConstruct = _isNativeReflectConstruct$a();
|
@@ -29733,7 +29733,7 @@ this.Twilio.Conversations = (function (exports) {
|
|
29733
29733
|
}
|
29734
29734
|
}
|
29735
29735
|
|
29736
|
-
function ownKeys$
|
29736
|
+
function ownKeys$4(object, enumerableOnly) {
|
29737
29737
|
var keys = Object.keys(object);
|
29738
29738
|
|
29739
29739
|
if (Object.getOwnPropertySymbols) {
|
@@ -29746,12 +29746,12 @@ this.Twilio.Conversations = (function (exports) {
|
|
29746
29746
|
return keys;
|
29747
29747
|
}
|
29748
29748
|
|
29749
|
-
function _objectSpread$
|
29749
|
+
function _objectSpread$4(target) {
|
29750
29750
|
for (var i = 1; i < arguments.length; i++) {
|
29751
29751
|
var source = null != arguments[i] ? arguments[i] : {};
|
29752
|
-
i % 2 ? ownKeys$
|
29752
|
+
i % 2 ? ownKeys$4(Object(source), !0).forEach(function (key) {
|
29753
29753
|
_defineProperty__default["default"](target, key, source[key]);
|
29754
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$
|
29754
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$4(Object(source)).forEach(function (key) {
|
29755
29755
|
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
29756
29756
|
});
|
29757
29757
|
}
|
@@ -29774,7 +29774,7 @@ this.Twilio.Conversations = (function (exports) {
|
|
29774
29774
|
};
|
29775
29775
|
} else {
|
29776
29776
|
var mode = arg.mode || (arg.id ? 'open_or_create' : 'create_new');
|
29777
|
-
return _objectSpread$
|
29777
|
+
return _objectSpread$4(_objectSpread$4({}, arg), {}, {
|
29778
29778
|
mode: mode
|
29779
29779
|
});
|
29780
29780
|
}
|
@@ -32859,8 +32859,8 @@ this.Twilio.Conversations = (function (exports) {
|
|
32859
32859
|
Object.defineProperty(exports, '__esModule', {
|
32860
32860
|
value: true
|
32861
32861
|
});
|
32862
|
-
var _asyncToGenerator = asyncToGenerator.exports;
|
32863
32862
|
var _defineProperty = defineProperty$5.exports;
|
32863
|
+
var _asyncToGenerator = asyncToGenerator.exports;
|
32864
32864
|
var _regeneratorRuntime = require$$2;
|
32865
32865
|
var log$2 = loglevel.exports;
|
32866
32866
|
var operationRetrier = browser$4;
|
@@ -32894,13 +32894,196 @@ this.Twilio.Conversations = (function (exports) {
|
|
32894
32894
|
return Object.freeze(n);
|
32895
32895
|
}
|
32896
32896
|
|
32897
|
-
var _asyncToGenerator__default = /*#__PURE__*/_interopDefaultLegacy(_asyncToGenerator);
|
32898
|
-
|
32899
32897
|
var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
|
32900
32898
|
|
32899
|
+
var _asyncToGenerator__default = /*#__PURE__*/_interopDefaultLegacy(_asyncToGenerator);
|
32900
|
+
|
32901
32901
|
var _regeneratorRuntime__default = /*#__PURE__*/_interopDefaultLegacy(_regeneratorRuntime);
|
32902
32902
|
|
32903
32903
|
var log__namespace = /*#__PURE__*/_interopNamespace(log$2);
|
32904
|
+
|
32905
|
+
var rngBrowser = {
|
32906
|
+
exports: {}
|
32907
|
+
}; // browser this is a little complicated due to unknown quality of Math.random()
|
32908
|
+
// and inconsistent support for the `crypto` API. We do the best we can via
|
32909
|
+
// feature-detection
|
32910
|
+
// getRandomValues needs to be invoked in a context where "this" is a Crypto
|
32911
|
+
// implementation. Also, find the complete implementation of crypto on IE11.
|
32912
|
+
|
32913
|
+
var getRandomValues = typeof crypto != 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto) || typeof msCrypto != 'undefined' && typeof window.msCrypto.getRandomValues == 'function' && msCrypto.getRandomValues.bind(msCrypto);
|
32914
|
+
|
32915
|
+
if (getRandomValues) {
|
32916
|
+
// WHATWG crypto RNG - http://wiki.whatwg.org/wiki/Crypto
|
32917
|
+
var rnds8 = new Uint8Array(16); // eslint-disable-line no-undef
|
32918
|
+
|
32919
|
+
rngBrowser.exports = function whatwgRNG() {
|
32920
|
+
getRandomValues(rnds8);
|
32921
|
+
return rnds8;
|
32922
|
+
};
|
32923
|
+
} else {
|
32924
|
+
// Math.random()-based (RNG)
|
32925
|
+
//
|
32926
|
+
// If all else fails, use Math.random(). It's fast, but is of unspecified
|
32927
|
+
// quality.
|
32928
|
+
var rnds = new Array(16);
|
32929
|
+
|
32930
|
+
rngBrowser.exports = function mathRNG() {
|
32931
|
+
for (var i = 0, r; i < 16; i++) {
|
32932
|
+
if ((i & 0x03) === 0) r = Math.random() * 0x100000000;
|
32933
|
+
rnds[i] = r >>> ((i & 0x03) << 3) & 0xff;
|
32934
|
+
}
|
32935
|
+
|
32936
|
+
return rnds;
|
32937
|
+
};
|
32938
|
+
}
|
32939
|
+
/**
|
32940
|
+
* Convert array of 16 byte values to UUID string format of the form:
|
32941
|
+
* XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
|
32942
|
+
*/
|
32943
|
+
|
32944
|
+
|
32945
|
+
var byteToHex = [];
|
32946
|
+
|
32947
|
+
for (var i = 0; i < 256; ++i) {
|
32948
|
+
byteToHex[i] = (i + 0x100).toString(16).substr(1);
|
32949
|
+
}
|
32950
|
+
|
32951
|
+
function bytesToUuid$2(buf, offset) {
|
32952
|
+
var i = offset || 0;
|
32953
|
+
var bth = byteToHex; // join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4
|
32954
|
+
|
32955
|
+
return [bth[buf[i++]], bth[buf[i++]], bth[buf[i++]], bth[buf[i++]], '-', bth[buf[i++]], bth[buf[i++]], '-', bth[buf[i++]], bth[buf[i++]], '-', bth[buf[i++]], bth[buf[i++]], '-', bth[buf[i++]], bth[buf[i++]], bth[buf[i++]], bth[buf[i++]], bth[buf[i++]], bth[buf[i++]]].join('');
|
32956
|
+
}
|
32957
|
+
|
32958
|
+
var bytesToUuid_1 = bytesToUuid$2;
|
32959
|
+
var rng$1 = rngBrowser.exports;
|
32960
|
+
var bytesToUuid$1 = bytesToUuid_1; // **`v1()` - Generate time-based UUID**
|
32961
|
+
//
|
32962
|
+
// Inspired by https://github.com/LiosK/UUID.js
|
32963
|
+
// and http://docs.python.org/library/uuid.html
|
32964
|
+
|
32965
|
+
var _nodeId;
|
32966
|
+
|
32967
|
+
var _clockseq; // Previous uuid creation time
|
32968
|
+
|
32969
|
+
|
32970
|
+
var _lastMSecs = 0;
|
32971
|
+
var _lastNSecs = 0; // See https://github.com/uuidjs/uuid for API details
|
32972
|
+
|
32973
|
+
function v1$1(options, buf, offset) {
|
32974
|
+
var i = buf && offset || 0;
|
32975
|
+
var b = buf || [];
|
32976
|
+
options = options || {};
|
32977
|
+
var node = options.node || _nodeId;
|
32978
|
+
var clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq; // node and clockseq need to be initialized to random values if they're not
|
32979
|
+
// specified. We do this lazily to minimize issues related to insufficient
|
32980
|
+
// system entropy. See #189
|
32981
|
+
|
32982
|
+
if (node == null || clockseq == null) {
|
32983
|
+
var seedBytes = rng$1();
|
32984
|
+
|
32985
|
+
if (node == null) {
|
32986
|
+
// Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1)
|
32987
|
+
node = _nodeId = [seedBytes[0] | 0x01, seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]];
|
32988
|
+
}
|
32989
|
+
|
32990
|
+
if (clockseq == null) {
|
32991
|
+
// Per 4.2.2, randomize (14 bit) clockseq
|
32992
|
+
clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff;
|
32993
|
+
}
|
32994
|
+
} // UUID timestamps are 100 nano-second units since the Gregorian epoch,
|
32995
|
+
// (1582-10-15 00:00). JSNumbers aren't precise enough for this, so
|
32996
|
+
// time is handled internally as 'msecs' (integer milliseconds) and 'nsecs'
|
32997
|
+
// (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00.
|
32998
|
+
|
32999
|
+
|
33000
|
+
var msecs = options.msecs !== undefined ? options.msecs : new Date().getTime(); // Per 4.2.1.2, use count of uuid's generated during the current clock
|
33001
|
+
// cycle to simulate higher resolution clock
|
33002
|
+
|
33003
|
+
var nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1; // Time since last uuid creation (in msecs)
|
33004
|
+
|
33005
|
+
var dt = msecs - _lastMSecs + (nsecs - _lastNSecs) / 10000; // Per 4.2.1.2, Bump clockseq on clock regression
|
33006
|
+
|
33007
|
+
if (dt < 0 && options.clockseq === undefined) {
|
33008
|
+
clockseq = clockseq + 1 & 0x3fff;
|
33009
|
+
} // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new
|
33010
|
+
// time interval
|
33011
|
+
|
33012
|
+
|
33013
|
+
if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) {
|
33014
|
+
nsecs = 0;
|
33015
|
+
} // Per 4.2.1.2 Throw error if too many uuids are requested
|
33016
|
+
|
33017
|
+
|
33018
|
+
if (nsecs >= 10000) {
|
33019
|
+
throw new Error('uuid.v1(): Can\'t create more than 10M uuids/sec');
|
33020
|
+
}
|
33021
|
+
|
33022
|
+
_lastMSecs = msecs;
|
33023
|
+
_lastNSecs = nsecs;
|
33024
|
+
_clockseq = clockseq; // Per 4.1.4 - Convert from unix epoch to Gregorian epoch
|
33025
|
+
|
33026
|
+
msecs += 12219292800000; // `time_low`
|
33027
|
+
|
33028
|
+
var tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000;
|
33029
|
+
b[i++] = tl >>> 24 & 0xff;
|
33030
|
+
b[i++] = tl >>> 16 & 0xff;
|
33031
|
+
b[i++] = tl >>> 8 & 0xff;
|
33032
|
+
b[i++] = tl & 0xff; // `time_mid`
|
33033
|
+
|
33034
|
+
var tmh = msecs / 0x100000000 * 10000 & 0xfffffff;
|
33035
|
+
b[i++] = tmh >>> 8 & 0xff;
|
33036
|
+
b[i++] = tmh & 0xff; // `time_high_and_version`
|
33037
|
+
|
33038
|
+
b[i++] = tmh >>> 24 & 0xf | 0x10; // include version
|
33039
|
+
|
33040
|
+
b[i++] = tmh >>> 16 & 0xff; // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant)
|
33041
|
+
|
33042
|
+
b[i++] = clockseq >>> 8 | 0x80; // `clock_seq_low`
|
33043
|
+
|
33044
|
+
b[i++] = clockseq & 0xff; // `node`
|
33045
|
+
|
33046
|
+
for (var n = 0; n < 6; ++n) {
|
33047
|
+
b[i + n] = node[n];
|
33048
|
+
}
|
33049
|
+
|
33050
|
+
return buf ? buf : bytesToUuid$1(b);
|
33051
|
+
}
|
33052
|
+
|
33053
|
+
var v1_1 = v1$1;
|
33054
|
+
var rng = rngBrowser.exports;
|
33055
|
+
var bytesToUuid = bytesToUuid_1;
|
33056
|
+
|
33057
|
+
function v4$1(options, buf, offset) {
|
33058
|
+
var i = buf && offset || 0;
|
33059
|
+
|
33060
|
+
if (typeof options == 'string') {
|
33061
|
+
buf = options === 'binary' ? new Array(16) : null;
|
33062
|
+
options = null;
|
33063
|
+
}
|
33064
|
+
|
33065
|
+
options = options || {};
|
33066
|
+
var rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
|
33067
|
+
|
33068
|
+
rnds[6] = rnds[6] & 0x0f | 0x40;
|
33069
|
+
rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided
|
33070
|
+
|
33071
|
+
if (buf) {
|
33072
|
+
for (var ii = 0; ii < 16; ++ii) {
|
33073
|
+
buf[i + ii] = rnds[ii];
|
33074
|
+
}
|
33075
|
+
}
|
33076
|
+
|
33077
|
+
return buf || bytesToUuid(rnds);
|
33078
|
+
}
|
33079
|
+
|
33080
|
+
var v4_1 = v4$1;
|
33081
|
+
var v1 = v1_1;
|
33082
|
+
var v4 = v4_1;
|
33083
|
+
var uuid = v4;
|
33084
|
+
uuid.v1 = v1;
|
33085
|
+
uuid.v4 = v4;
|
33086
|
+
var uuid_1 = uuid;
|
32904
33087
|
/**
|
32905
33088
|
* Cancellable promise. Extends the functionality of the native Promise to include the cancel method.
|
32906
33089
|
*
|
@@ -32925,7 +33108,6 @@ this.Twilio.Conversations = (function (exports) {
|
|
32925
33108
|
* ```
|
32926
33109
|
*/
|
32927
33110
|
|
32928
|
-
|
32929
33111
|
var CancellablePromise = /*#__PURE__*/function (_Promise) {
|
32930
33112
|
_inherits$4(CancellablePromise, _Promise);
|
32931
33113
|
|
@@ -32943,15 +33125,21 @@ this.Twilio.Conversations = (function (exports) {
|
|
32943
33125
|
|
32944
33126
|
_classCallCheck$4(this, CancellablePromise);
|
32945
33127
|
|
32946
|
-
var
|
33128
|
+
var outerId = uuid_1.v4();
|
32947
33129
|
var outerRejectPromise;
|
32948
33130
|
_this6 = _super.call(this, function (resolve, reject) {
|
32949
33131
|
outerRejectPromise = reject;
|
32950
|
-
return executor(
|
32951
|
-
|
33132
|
+
return executor(function (value) {
|
33133
|
+
CancellablePromise.cancellationMap.delete(outerId);
|
33134
|
+
resolve(value);
|
33135
|
+
}, function (reason) {
|
33136
|
+
CancellablePromise.cancellationMap.delete(outerId);
|
33137
|
+
reject(reason);
|
33138
|
+
}, function (cancellationFunction) {
|
33139
|
+
CancellablePromise.cancellationMap.set(outerId, cancellationFunction);
|
32952
33140
|
});
|
32953
33141
|
});
|
32954
|
-
_this6.
|
33142
|
+
_this6.id = outerId;
|
32955
33143
|
_this6.rejectPromise = outerRejectPromise;
|
32956
33144
|
return _this6;
|
32957
33145
|
}
|
@@ -32963,18 +33151,24 @@ this.Twilio.Conversations = (function (exports) {
|
|
32963
33151
|
_createClass$4(CancellablePromise, [{
|
32964
33152
|
key: "cancel",
|
32965
33153
|
value: function cancel() {
|
32966
|
-
|
32967
|
-
|
32968
|
-
}
|
33154
|
+
var onCancel = CancellablePromise.cancellationMap.get(this.id);
|
33155
|
+
onCancel === null || onCancel === void 0 ? void 0 : onCancel();
|
32969
33156
|
|
32970
33157
|
if (this.rejectPromise) {
|
33158
|
+
this.catch(function () {
|
33159
|
+
return void 0;
|
33160
|
+
});
|
32971
33161
|
this.rejectPromise(new Error("Promise was cancelled"));
|
32972
33162
|
}
|
33163
|
+
|
33164
|
+
return this;
|
32973
33165
|
}
|
32974
33166
|
}]);
|
32975
33167
|
|
32976
33168
|
return CancellablePromise;
|
32977
33169
|
}( /*#__PURE__*/_wrapNativeSuper(Promise));
|
33170
|
+
|
33171
|
+
_defineProperty__default["default"](CancellablePromise, "cancellationMap", new Map());
|
32978
33172
|
/******************************************************************************
|
32979
33173
|
Copyright (c) Microsoft Corporation.
|
32980
33174
|
|
@@ -33513,35 +33707,40 @@ this.Twilio.Conversations = (function (exports) {
|
|
33513
33707
|
switch (_context2.prev = _context2.next) {
|
33514
33708
|
case 0:
|
33515
33709
|
retrier = new operationRetrier.Retrier(_this.backoffConfig());
|
33516
|
-
onCancel(function () {
|
33517
|
-
request.cancel();
|
33518
|
-
retrier.removeAllListeners();
|
33519
|
-
retrier.cancel();
|
33520
|
-
});
|
33521
33710
|
codesToRetryOn = [502, 503, 504];
|
33522
33711
|
|
33523
33712
|
if (retryWhenThrottled) {
|
33524
33713
|
codesToRetryOn.push(429);
|
33525
33714
|
}
|
33526
33715
|
|
33716
|
+
onCancel(function () {
|
33717
|
+
retrier.cancel();
|
33718
|
+
retrier.removeAllListeners();
|
33719
|
+
});
|
33527
33720
|
retrier.on("attempt", /*#__PURE__*/_asyncToGenerator__default["default"]( /*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee() {
|
33528
|
-
var result;
|
33721
|
+
var requestPromise, result;
|
33529
33722
|
return _regeneratorRuntime__default["default"].wrap(function _callee$(_context) {
|
33530
33723
|
while (1) {
|
33531
33724
|
switch (_context.prev = _context.next) {
|
33532
33725
|
case 0:
|
33533
33726
|
_context.prev = 0;
|
33534
|
-
|
33535
|
-
|
33727
|
+
requestPromise = request();
|
33728
|
+
onCancel(function () {
|
33729
|
+
requestPromise.cancel();
|
33730
|
+
retrier.cancel();
|
33731
|
+
retrier.removeAllListeners();
|
33732
|
+
});
|
33733
|
+
_context.next = 5;
|
33734
|
+
return requestPromise;
|
33536
33735
|
|
33537
|
-
case
|
33736
|
+
case 5:
|
33538
33737
|
result = _context.sent;
|
33539
33738
|
retrier.succeeded(result);
|
33540
|
-
_context.next =
|
33739
|
+
_context.next = 12;
|
33541
33740
|
break;
|
33542
33741
|
|
33543
|
-
case
|
33544
|
-
_context.prev =
|
33742
|
+
case 9:
|
33743
|
+
_context.prev = 9;
|
33545
33744
|
_context.t0 = _context["catch"](0);
|
33546
33745
|
|
33547
33746
|
if (codesToRetryOn.indexOf(_context.t0.status) > -1) {
|
@@ -33556,12 +33755,12 @@ this.Twilio.Conversations = (function (exports) {
|
|
33556
33755
|
reject(_context.t0);
|
33557
33756
|
}
|
33558
33757
|
|
33559
|
-
case
|
33758
|
+
case 12:
|
33560
33759
|
case "end":
|
33561
33760
|
return _context.stop();
|
33562
33761
|
}
|
33563
33762
|
}
|
33564
|
-
}, _callee, null, [[0,
|
33763
|
+
}, _callee, null, [[0, 9]]);
|
33565
33764
|
})));
|
33566
33765
|
retrier.on("succeeded", function (result) {
|
33567
33766
|
resolve(result);
|
@@ -33724,7 +33923,7 @@ this.Twilio.Conversations = (function (exports) {
|
|
33724
33923
|
return Network;
|
33725
33924
|
}();
|
33726
33925
|
|
33727
|
-
var version = "0.6.0-rc.
|
33926
|
+
var version = "0.6.0-rc.4";
|
33728
33927
|
|
33729
33928
|
var _class;
|
33730
33929
|
|
@@ -35550,6 +35749,10 @@ this.Twilio.Conversations = (function (exports) {
|
|
35550
35749
|
this.dateUpdated = descriptor.date_updated;
|
35551
35750
|
});
|
35552
35751
|
|
35752
|
+
function ownKeys$3(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; }
|
35753
|
+
|
35754
|
+
function _objectSpread$3(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$3(Object(source), !0).forEach(function (key) { _defineProperty$3(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$3(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
35755
|
+
|
35553
35756
|
function _createSuper$5(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$5(); return function _createSuperInternal() { var Super = _getPrototypeOf$4(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf$4(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn$4(this, result); }; }
|
35554
35757
|
|
35555
35758
|
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; } }
|
@@ -35593,10 +35796,12 @@ this.Twilio.Conversations = (function (exports) {
|
|
35593
35796
|
lastUpdatedBy: (_data$lastUpdatedBy = data.lastUpdatedBy) !== null && _data$lastUpdatedBy !== void 0 ? _data$lastUpdatedBy : null,
|
35594
35797
|
attributes: parseAttributes(data.attributes, "Got malformed attributes for the message ".concat(data.sid), log$3),
|
35595
35798
|
type: (_data$type = data.type) !== null && _data$type !== void 0 ? _data$type : "text",
|
35596
|
-
media: data.type
|
35597
|
-
medias: data.type
|
35799
|
+
media: data.type === "media" && data.media ? new Media(data.media, _this.services) : null,
|
35800
|
+
medias: data.type === "media" && data.medias ? data.medias.map(function (m) {
|
35598
35801
|
return new Media(m, _this.services);
|
35599
|
-
}) :
|
35802
|
+
}) : data.type === "media" && data.media && !data.medias ? [new Media(_objectSpread$3(_objectSpread$3({}, data.media), {}, {
|
35803
|
+
category: "media"
|
35804
|
+
}), _this.services)] : null,
|
35600
35805
|
participantSid: (_data$memberSid = data.memberSid) !== null && _data$memberSid !== void 0 ? _data$memberSid : null,
|
35601
35806
|
aggregatedDeliveryReceipt: data.delivery ? new AggregatedDeliveryReceipt(data.delivery) : null
|
35602
35807
|
};
|
@@ -37998,9 +38203,6 @@ this.Twilio.Conversations = (function (exports) {
|
|
37998
38203
|
* @param participant Identity, SID or the participant object to remove.
|
37999
38204
|
*/
|
38000
38205
|
|
38001
|
-
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
38002
|
-
// @ts-ignore TODO: fix validateTypesAsync typing
|
38003
|
-
|
38004
38206
|
}, {
|
38005
38207
|
key: "removeParticipant",
|
38006
38208
|
value: function () {
|
@@ -38862,10 +39064,7 @@ this.Twilio.Conversations = (function (exports) {
|
|
38862
39064
|
|
38863
39065
|
__decorate$1([validateTypesAsync_1([nonEmptyString_1, Participant]), __metadata$1("design:type", Function), __metadata$1("design:paramtypes", [Object]), __metadata$1("design:returntype", Promise)], Conversation.prototype, "removeParticipant", null);
|
38864
39066
|
|
38865
|
-
__decorate$1([validateTypesAsync_1(["string",
|
38866
|
-
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
38867
|
-
// @ts-ignore TODO: fix validateTypesAsync typing
|
38868
|
-
FormData, literal_1(null), objectSchema_1("media options", {
|
39067
|
+
__decorate$1([validateTypesAsync_1(["string", FormData, literal_1(null), objectSchema_1("media options", {
|
38869
39068
|
contentType: nonEmptyString_1,
|
38870
39069
|
media: custom_1(function (value) {
|
38871
39070
|
var isValid = typeof value === "string" && value.length > 0 || value instanceof Uint8Array || value instanceof ArrayBuffer;
|
@@ -40184,7 +40383,7 @@ this.Twilio.Conversations = (function (exports) {
|
|
40184
40383
|
this.data = data.data || {};
|
40185
40384
|
});
|
40186
40385
|
|
40187
|
-
var version = "3.0.0-rc.
|
40386
|
+
var version = "3.0.0-rc.6";
|
40188
40387
|
|
40189
40388
|
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; }
|
40190
40389
|
|
@@ -40775,10 +40974,15 @@ this.Twilio.Conversations = (function (exports) {
|
|
40775
40974
|
|
40776
40975
|
_this._services.twilsockClient.onceWithReplay("connectionError", emitFailed);
|
40777
40976
|
|
40778
|
-
_this._services.twilsockClient.onceWithReplay("disconnected",
|
40977
|
+
_this._services.twilsockClient.onceWithReplay("disconnected", function () {
|
40978
|
+
return emitFailed({
|
40979
|
+
terminal: true,
|
40980
|
+
message: "Twilsock has disconnected."
|
40981
|
+
});
|
40982
|
+
});
|
40779
40983
|
|
40780
40984
|
_this._services.twilsockClient.onceWithReplay("connected", /*#__PURE__*/_asyncToGenerator$1( /*#__PURE__*/_regeneratorRuntime$1.mark(function _callee() {
|
40781
|
-
var startupEvent;
|
40985
|
+
var startupEvent, connectionError;
|
40782
40986
|
return _regeneratorRuntime$1.wrap(function _callee$(_context) {
|
40783
40987
|
while (1) {
|
40784
40988
|
switch (_context.prev = _context.next) {
|
@@ -40800,22 +41004,26 @@ this.Twilio.Conversations = (function (exports) {
|
|
40800
41004
|
case 8:
|
40801
41005
|
_this._services.twilsockClient.addPartialTelemetryEvent(new browser$3.TelemetryEventDescription("", "", new Date()), startupEvent, browser$3.TelemetryPoint.End);
|
40802
41006
|
|
40803
|
-
_context.next =
|
41007
|
+
_context.next = 16;
|
40804
41008
|
break;
|
40805
41009
|
|
40806
41010
|
case 11:
|
40807
41011
|
_context.prev = 11;
|
40808
41012
|
_context.t0 = _context["catch"](3);
|
40809
|
-
|
40810
41013
|
// Fail ChatClient if initialization is incomplete
|
40811
|
-
|
41014
|
+
connectionError = {
|
41015
|
+
terminal: true,
|
41016
|
+
message: _context.t0.message
|
41017
|
+
};
|
41018
|
+
|
41019
|
+
_this._rejectEnsureReady(connectionError);
|
40812
41020
|
|
40813
41021
|
_this.emit("stateChanged", {
|
40814
41022
|
state: "failed",
|
40815
|
-
error:
|
41023
|
+
error: connectionError
|
40816
41024
|
});
|
40817
41025
|
|
40818
|
-
case
|
41026
|
+
case 16:
|
40819
41027
|
case "end":
|
40820
41028
|
return _context.stop();
|
40821
41029
|
}
|
@@ -41720,8 +41928,10 @@ this.Twilio.Conversations = (function (exports) {
|
|
41720
41928
|
if (typeof apsPayload.alert === "string") {
|
41721
41929
|
body = apsPayload.alert || null;
|
41722
41930
|
} else {
|
41723
|
-
|
41724
|
-
|
41931
|
+
var _apsPayload$alert, _apsPayload$alert2;
|
41932
|
+
|
41933
|
+
body = ((_apsPayload$alert = apsPayload.alert) === null || _apsPayload$alert === void 0 ? void 0 : _apsPayload$alert.body) || null;
|
41934
|
+
title = ((_apsPayload$alert2 = apsPayload.alert) === null || _apsPayload$alert2 === void 0 ? void 0 : _apsPayload$alert2.title) || null;
|
41725
41935
|
}
|
41726
41936
|
|
41727
41937
|
return new PushNotification({
|
@@ -41861,6 +42071,7 @@ this.Twilio.Conversations = (function (exports) {
|
|
41861
42071
|
exports.Client = Client_1 = __decorate$1([validateConstructorTypes_1(nonEmptyString_1, [pureObject_1, "undefined"]), __metadata$1("design:paramtypes", [String, Object])], exports.Client);
|
41862
42072
|
|
41863
42073
|
exports.AggregatedDeliveryReceipt = AggregatedDeliveryReceipt;
|
42074
|
+
exports.CancellablePromise = browser.CancellablePromise;
|
41864
42075
|
exports.Conversation = Conversation;
|
41865
42076
|
exports.DetailedDeliveryReceipt = DetailedDeliveryReceipt;
|
41866
42077
|
exports.Media = Media;
|