@twilio/conversations 2.3.1-rc.0 → 2.4.0-rc.0
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 +632 -74
- package/builds/browser.js.map +1 -1
- package/builds/lib.d.ts +29 -0
- package/builds/lib.js +632 -74
- package/builds/lib.js.map +1 -1
- package/builds/twilio-conversations.js +730 -106
- package/builds/twilio-conversations.min.js +1 -1
- package/dist/channel-metadata-client.js +186 -0
- package/dist/channel-metadata-client.js.map +1 -0
- package/dist/client.js +2 -0
- package/dist/client.js.map +1 -1
- package/dist/command-executor.js +39 -6
- package/dist/command-executor.js.map +1 -1
- package/dist/configuration.js +5 -3
- package/dist/configuration.js.map +1 -1
- package/dist/conversation.js.map +1 -1
- package/dist/data/conversations.js.map +1 -1
- package/dist/data/messages.js.map +1 -1
- package/dist/message.js +12 -1
- package/dist/message.js.map +1 -1
- package/dist/node_modules/quick-lru/index.js +265 -0
- package/dist/node_modules/quick-lru/index.js.map +1 -0
- package/dist/packages/conversations/package.json.js +1 -1
- package/docs/assets/js/search.js +1 -1
- package/docs/classes/Message.html +24 -0
- package/docs/interfaces/ClientOptions.html +16 -0
- package/package.json +2 -1
@@ -4489,7 +4489,7 @@ this.Twilio.Conversations = (function (exports) {
|
|
4489
4489
|
var RETRY_WHEN_THROTTLED = true;
|
4490
4490
|
|
4491
4491
|
var Configuration$1 = /*#__PURE__*/_createClass$4(function Configuration() {
|
4492
|
-
var _ref, _constructorOptions$u, _ref2, _constructorOptions$h, _ref3, _constructorOptions$c;
|
4492
|
+
var _ref, _constructorOptions$u, _ref2, _constructorOptions$h, _ref3, _constructorOptions$c, _options$channelMetad;
|
4493
4493
|
|
4494
4494
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
4495
4495
|
var configurationResponse = arguments.length > 1 ? arguments[1] : undefined;
|
@@ -4547,6 +4547,8 @@ this.Twilio.Conversations = (function (exports) {
|
|
4547
4547
|
logger.error("Failed to parse consumption report interval ".concat(consumptionReportInterval, ", using default value ").concat(CONSUMPTION_HORIZON_SENDING_INTERVAL));
|
4548
4548
|
this.consumptionReportInterval = toSeconds_1(parse_1(CONSUMPTION_HORIZON_SENDING_INTERVAL));
|
4549
4549
|
}
|
4550
|
+
|
4551
|
+
this.channelMetadataCacheCapacity = (_options$channelMetad = options.channelMetadataCacheCapacity) !== null && _options$channelMetad !== void 0 ? _options$channelMetad : 100;
|
4550
4552
|
});
|
4551
4553
|
|
4552
4554
|
var wellKnownSymbol$a = wellKnownSymbol$s;
|
@@ -6073,11 +6075,11 @@ this.Twilio.Conversations = (function (exports) {
|
|
6073
6075
|
});
|
6074
6076
|
};
|
6075
6077
|
|
6076
|
-
function _createForOfIteratorHelper$3$
|
6078
|
+
function _createForOfIteratorHelper$3$2(o, allowArrayLike) {
|
6077
6079
|
var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
|
6078
6080
|
|
6079
6081
|
if (!it) {
|
6080
|
-
if (Array.isArray(o) || (it = _unsupportedIterableToArray$3$
|
6082
|
+
if (Array.isArray(o) || (it = _unsupportedIterableToArray$3$2(o)) || allowArrayLike && o && typeof o.length === "number") {
|
6081
6083
|
if (it) o = it;
|
6082
6084
|
var i = 0;
|
6083
6085
|
|
@@ -6130,16 +6132,16 @@ this.Twilio.Conversations = (function (exports) {
|
|
6130
6132
|
};
|
6131
6133
|
}
|
6132
6134
|
|
6133
|
-
function _unsupportedIterableToArray$3$
|
6135
|
+
function _unsupportedIterableToArray$3$2(o, minLen) {
|
6134
6136
|
if (!o) return;
|
6135
|
-
if (typeof o === "string") return _arrayLikeToArray$3$
|
6137
|
+
if (typeof o === "string") return _arrayLikeToArray$3$2(o, minLen);
|
6136
6138
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
6137
6139
|
if (n === "Object" && o.constructor) n = o.constructor.name;
|
6138
6140
|
if (n === "Map" || n === "Set") return Array.from(o);
|
6139
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$3$
|
6141
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$3$2(o, minLen);
|
6140
6142
|
}
|
6141
6143
|
|
6142
|
-
function _arrayLikeToArray$3$
|
6144
|
+
function _arrayLikeToArray$3$2(arr, len) {
|
6143
6145
|
if (len == null || len > arr.length) len = arr.length;
|
6144
6146
|
|
6145
6147
|
for (var i = 0, arr2 = new Array(len); i < len; i++) {
|
@@ -6158,7 +6160,7 @@ this.Twilio.Conversations = (function (exports) {
|
|
6158
6160
|
var isValid = false;
|
6159
6161
|
var expectedTypes = [];
|
6160
6162
|
|
6161
|
-
var _iterator = _createForOfIteratorHelper$3$
|
6163
|
+
var _iterator = _createForOfIteratorHelper$3$2(checks),
|
6162
6164
|
_step;
|
6163
6165
|
|
6164
6166
|
try {
|
@@ -6177,8 +6179,8 @@ this.Twilio.Conversations = (function (exports) {
|
|
6177
6179
|
});
|
6178
6180
|
};
|
6179
6181
|
|
6180
|
-
function _createSuper$
|
6181
|
-
var hasNativeReflectConstruct = _isNativeReflectConstruct$
|
6182
|
+
function _createSuper$d(Derived) {
|
6183
|
+
var hasNativeReflectConstruct = _isNativeReflectConstruct$e();
|
6182
6184
|
|
6183
6185
|
return function _createSuperInternal() {
|
6184
6186
|
var Super = _getPrototypeOf__default$3["default"](Derived),
|
@@ -6196,7 +6198,7 @@ this.Twilio.Conversations = (function (exports) {
|
|
6196
6198
|
};
|
6197
6199
|
}
|
6198
6200
|
|
6199
|
-
function _isNativeReflectConstruct$
|
6201
|
+
function _isNativeReflectConstruct$e() {
|
6200
6202
|
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
6201
6203
|
if (Reflect.construct.sham) return false;
|
6202
6204
|
if (typeof Proxy === "function") return true;
|
@@ -6359,7 +6361,7 @@ this.Twilio.Conversations = (function (exports) {
|
|
6359
6361
|
return /*#__PURE__*/function (_ctor) {
|
6360
6362
|
_inherits__default$3["default"](_class, _ctor);
|
6361
6363
|
|
6362
|
-
var _super = _createSuper$
|
6364
|
+
var _super = _createSuper$d(_class);
|
6363
6365
|
|
6364
6366
|
function _class() {
|
6365
6367
|
_classCallCheck__default$3["default"](this, _class);
|
@@ -7411,8 +7413,8 @@ this.Twilio.Conversations = (function (exports) {
|
|
7411
7413
|
return ret;
|
7412
7414
|
}
|
7413
7415
|
|
7414
|
-
function _createSuper$
|
7415
|
-
var hasNativeReflectConstruct = _isNativeReflectConstruct$
|
7416
|
+
function _createSuper$c(Derived) {
|
7417
|
+
var hasNativeReflectConstruct = _isNativeReflectConstruct$d();
|
7416
7418
|
|
7417
7419
|
return function _createSuperInternal() {
|
7418
7420
|
var Super = _getPrototypeOf__default$2["default"](Derived),
|
@@ -7430,7 +7432,7 @@ this.Twilio.Conversations = (function (exports) {
|
|
7430
7432
|
};
|
7431
7433
|
}
|
7432
7434
|
|
7433
|
-
function _isNativeReflectConstruct$
|
7435
|
+
function _isNativeReflectConstruct$d() {
|
7434
7436
|
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
7435
7437
|
if (Reflect.construct.sham) return false;
|
7436
7438
|
if (typeof Proxy === "function") return true;
|
@@ -7446,7 +7448,7 @@ this.Twilio.Conversations = (function (exports) {
|
|
7446
7448
|
var ReplayEventEmitter = /*#__PURE__*/function (_EventEmitter) {
|
7447
7449
|
_inherits__default$2["default"](ReplayEventEmitter, _EventEmitter);
|
7448
7450
|
|
7449
|
-
var _super = _createSuper$
|
7451
|
+
var _super = _createSuper$c(ReplayEventEmitter);
|
7450
7452
|
|
7451
7453
|
function ReplayEventEmitter() {
|
7452
7454
|
var _this;
|
@@ -9452,9 +9454,9 @@ this.Twilio.Conversations = (function (exports) {
|
|
9452
9454
|
|
9453
9455
|
var isEqual = lodash_isequal.exports;
|
9454
9456
|
|
9455
|
-
function _createSuper$
|
9457
|
+
function _createSuper$b(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$c(); 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); }; }
|
9456
9458
|
|
9457
|
-
function _isNativeReflectConstruct$
|
9459
|
+
function _isNativeReflectConstruct$c() { 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; } }
|
9458
9460
|
var log$9 = Logger.scope("User");
|
9459
9461
|
/**
|
9460
9462
|
* Extended user information.
|
@@ -9466,7 +9468,7 @@ this.Twilio.Conversations = (function (exports) {
|
|
9466
9468
|
var User = /*#__PURE__*/function (_ReplayEventEmitter) {
|
9467
9469
|
_inherits$4(User, _ReplayEventEmitter);
|
9468
9470
|
|
9469
|
-
var _super = _createSuper$
|
9471
|
+
var _super = _createSuper$b(User);
|
9470
9472
|
|
9471
9473
|
/**
|
9472
9474
|
* @internal
|
@@ -11174,8 +11176,8 @@ this.Twilio.Conversations = (function (exports) {
|
|
11174
11176
|
return AsyncRetrier;
|
11175
11177
|
}(EventEmitter$1);
|
11176
11178
|
|
11177
|
-
function _createSuper$
|
11178
|
-
var hasNativeReflectConstruct = _isNativeReflectConstruct$
|
11179
|
+
function _createSuper$a(Derived) {
|
11180
|
+
var hasNativeReflectConstruct = _isNativeReflectConstruct$b();
|
11179
11181
|
|
11180
11182
|
return function _createSuperInternal() {
|
11181
11183
|
var Super = _getPrototypeOf__default$1["default"](Derived),
|
@@ -11193,7 +11195,7 @@ this.Twilio.Conversations = (function (exports) {
|
|
11193
11195
|
};
|
11194
11196
|
}
|
11195
11197
|
|
11196
|
-
function _isNativeReflectConstruct$
|
11198
|
+
function _isNativeReflectConstruct$b() {
|
11197
11199
|
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
11198
11200
|
if (Reflect.construct.sham) return false;
|
11199
11201
|
if (typeof Proxy === "function") return true;
|
@@ -11213,7 +11215,7 @@ this.Twilio.Conversations = (function (exports) {
|
|
11213
11215
|
var Backoff = /*#__PURE__*/function (_EventEmitter) {
|
11214
11216
|
_inherits__default$1["default"](Backoff, _EventEmitter);
|
11215
11217
|
|
11216
|
-
var _super = _createSuper$
|
11218
|
+
var _super = _createSuper$a(Backoff);
|
11217
11219
|
|
11218
11220
|
function Backoff(options) {
|
11219
11221
|
var _this;
|
@@ -21826,7 +21828,7 @@ this.Twilio.Conversations = (function (exports) {
|
|
21826
21828
|
var _typeof = _typeof$2.exports;
|
21827
21829
|
var declarativeTypeValidator = browser$7;
|
21828
21830
|
var twilsock = browser$4;
|
21829
|
-
var _wrapNativeSuper = wrapNativeSuper.exports;
|
21831
|
+
var _wrapNativeSuper$1 = wrapNativeSuper.exports;
|
21830
21832
|
var loglevelLog = loglevel.exports;
|
21831
21833
|
var _slicedToArray = slicedToArray.exports;
|
21832
21834
|
var operationRetrier = browser$5;
|
@@ -21882,7 +21884,7 @@ this.Twilio.Conversations = (function (exports) {
|
|
21882
21884
|
|
21883
21885
|
var _typeof__default = /*#__PURE__*/_interopDefaultLegacy$2(_typeof);
|
21884
21886
|
|
21885
|
-
var _wrapNativeSuper__default = /*#__PURE__*/_interopDefaultLegacy$2(_wrapNativeSuper);
|
21887
|
+
var _wrapNativeSuper__default = /*#__PURE__*/_interopDefaultLegacy$2(_wrapNativeSuper$1);
|
21886
21888
|
|
21887
21889
|
var loglevelLog__namespace = /*#__PURE__*/_interopNamespace$1(loglevelLog);
|
21888
21890
|
|
@@ -22654,11 +22656,11 @@ this.Twilio.Conversations = (function (exports) {
|
|
22654
22656
|
return Configuration;
|
22655
22657
|
}();
|
22656
22658
|
|
22657
|
-
function _createForOfIteratorHelper$3(o, allowArrayLike) {
|
22659
|
+
function _createForOfIteratorHelper$3$1(o, allowArrayLike) {
|
22658
22660
|
var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
|
22659
22661
|
|
22660
22662
|
if (!it) {
|
22661
|
-
if (Array.isArray(o) || (it = _unsupportedIterableToArray$3(o)) || allowArrayLike && o && typeof o.length === "number") {
|
22663
|
+
if (Array.isArray(o) || (it = _unsupportedIterableToArray$3$1(o)) || allowArrayLike && o && typeof o.length === "number") {
|
22662
22664
|
if (it) o = it;
|
22663
22665
|
var i = 0;
|
22664
22666
|
|
@@ -22711,16 +22713,16 @@ this.Twilio.Conversations = (function (exports) {
|
|
22711
22713
|
};
|
22712
22714
|
}
|
22713
22715
|
|
22714
|
-
function _unsupportedIterableToArray$3(o, minLen) {
|
22716
|
+
function _unsupportedIterableToArray$3$1(o, minLen) {
|
22715
22717
|
if (!o) return;
|
22716
|
-
if (typeof o === "string") return _arrayLikeToArray$3(o, minLen);
|
22718
|
+
if (typeof o === "string") return _arrayLikeToArray$3$1(o, minLen);
|
22717
22719
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
22718
22720
|
if (n === "Object" && o.constructor) n = o.constructor.name;
|
22719
22721
|
if (n === "Map" || n === "Set") return Array.from(o);
|
22720
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$3(o, minLen);
|
22722
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$3$1(o, minLen);
|
22721
22723
|
}
|
22722
22724
|
|
22723
|
-
function _arrayLikeToArray$3(arr, len) {
|
22725
|
+
function _arrayLikeToArray$3$1(arr, len) {
|
22724
22726
|
if (len == null || len > arr.length) len = arr.length;
|
22725
22727
|
|
22726
22728
|
for (var i = 0, arr2 = new Array(len); i < len; i++) {
|
@@ -22895,7 +22897,7 @@ this.Twilio.Conversations = (function (exports) {
|
|
22895
22897
|
function subtract(these, those, action, limit) {
|
22896
22898
|
var result = [];
|
22897
22899
|
|
22898
|
-
var _iterator = _createForOfIteratorHelper$3(these),
|
22900
|
+
var _iterator = _createForOfIteratorHelper$3$1(these),
|
22899
22901
|
_step;
|
22900
22902
|
|
22901
22903
|
try {
|
@@ -22976,7 +22978,7 @@ this.Twilio.Conversations = (function (exports) {
|
|
22976
22978
|
// Keeping in mind that events may begin flowing _before_ we receive the response
|
22977
22979
|
requests = this.processLocalActions(action, requests);
|
22978
22980
|
correlationId = new Date().getTime();
|
22979
|
-
_iterator2 = _createForOfIteratorHelper$3(requests);
|
22981
|
+
_iterator2 = _createForOfIteratorHelper$3$1(requests);
|
22980
22982
|
|
22981
22983
|
try {
|
22982
22984
|
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
@@ -23043,7 +23045,7 @@ this.Twilio.Conversations = (function (exports) {
|
|
23043
23045
|
case 21:
|
23044
23046
|
_context.prev = 21;
|
23045
23047
|
_context.t0 = _context["catch"](10);
|
23046
|
-
_iterator3 = _createForOfIteratorHelper$3(requests);
|
23048
|
+
_iterator3 = _createForOfIteratorHelper$3$1(requests);
|
23047
23049
|
|
23048
23050
|
try {
|
23049
23051
|
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
@@ -23246,7 +23248,7 @@ this.Twilio.Conversations = (function (exports) {
|
|
23246
23248
|
this.latestPokeResponseArrivalTimestampByCorrelationId.set(correlationId, new Date().getTime());
|
23247
23249
|
}
|
23248
23250
|
|
23249
|
-
var _iterator4 = _createForOfIteratorHelper$3(events),
|
23251
|
+
var _iterator4 = _createForOfIteratorHelper$3$1(events),
|
23250
23252
|
_step4;
|
23251
23253
|
|
23252
23254
|
try {
|
@@ -23443,7 +23445,7 @@ this.Twilio.Conversations = (function (exports) {
|
|
23443
23445
|
|
23444
23446
|
var failedSubscriptions = [];
|
23445
23447
|
|
23446
|
-
var _iterator5 = _createForOfIteratorHelper$3(this.persisted.values()),
|
23448
|
+
var _iterator5 = _createForOfIteratorHelper$3$1(this.persisted.values()),
|
23447
23449
|
_step5;
|
23448
23450
|
|
23449
23451
|
try {
|
@@ -30644,8 +30646,8 @@ this.Twilio.Conversations = (function (exports) {
|
|
30644
30646
|
|
30645
30647
|
var version$1 = "3.1.0";
|
30646
30648
|
|
30647
|
-
function _createSuper$
|
30648
|
-
var hasNativeReflectConstruct = _isNativeReflectConstruct$
|
30649
|
+
function _createSuper$9(Derived) {
|
30650
|
+
var hasNativeReflectConstruct = _isNativeReflectConstruct$a();
|
30649
30651
|
|
30650
30652
|
return function _createSuperInternal() {
|
30651
30653
|
var Super = _getPrototypeOf__default['default'](Derived),
|
@@ -30663,7 +30665,7 @@ this.Twilio.Conversations = (function (exports) {
|
|
30663
30665
|
};
|
30664
30666
|
}
|
30665
30667
|
|
30666
|
-
function _isNativeReflectConstruct$
|
30668
|
+
function _isNativeReflectConstruct$a() {
|
30667
30669
|
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
30668
30670
|
if (Reflect.construct.sham) return false;
|
30669
30671
|
if (typeof Proxy === "function") return true;
|
@@ -30756,7 +30758,7 @@ this.Twilio.Conversations = (function (exports) {
|
|
30756
30758
|
var Client = /*#__PURE__*/function (_EventEmitter) {
|
30757
30759
|
_inherits__default['default'](Client, _EventEmitter);
|
30758
30760
|
|
30759
|
-
var _super = _createSuper$
|
30761
|
+
var _super = _createSuper$9(Client);
|
30760
30762
|
/**
|
30761
30763
|
* @param fpaToken Twilio access token.
|
30762
30764
|
* @param options Options to customize the client.
|
@@ -35256,9 +35258,9 @@ this.Twilio.Conversations = (function (exports) {
|
|
35256
35258
|
|
35257
35259
|
setSpecies(ARRAY_BUFFER);
|
35258
35260
|
|
35259
|
-
function _createSuper$
|
35261
|
+
function _createSuper$8(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$9(); 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); }; }
|
35260
35262
|
|
35261
|
-
function _isNativeReflectConstruct$
|
35263
|
+
function _isNativeReflectConstruct$9() { 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; } }
|
35262
35264
|
var log$6 = Logger.scope("Participant");
|
35263
35265
|
/**
|
35264
35266
|
* A participant represents a remote client in a conversation.
|
@@ -35267,7 +35269,7 @@ this.Twilio.Conversations = (function (exports) {
|
|
35267
35269
|
var Participant = /*#__PURE__*/function (_ReplayEventEmitter) {
|
35268
35270
|
_inherits$4(Participant, _ReplayEventEmitter);
|
35269
35271
|
|
35270
|
-
var _super = _createSuper$
|
35272
|
+
var _super = _createSuper$8(Participant);
|
35271
35273
|
|
35272
35274
|
/**
|
35273
35275
|
* @internal
|
@@ -35639,9 +35641,9 @@ this.Twilio.Conversations = (function (exports) {
|
|
35639
35641
|
|
35640
35642
|
__decorate$1([validateTypesAsync_1(json), __metadata$1("design:type", Function), __metadata$1("design:paramtypes", [Object]), __metadata$1("design:returntype", Promise)], Participant.prototype, "updateAttributes", null);
|
35641
35643
|
|
35642
|
-
function _createSuper$
|
35644
|
+
function _createSuper$7(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$8(); 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); }; }
|
35643
35645
|
|
35644
|
-
function _isNativeReflectConstruct$
|
35646
|
+
function _isNativeReflectConstruct$8() { 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; } }
|
35645
35647
|
var log$5 = Logger.scope("Participants");
|
35646
35648
|
/**
|
35647
35649
|
* @classdesc Represents the collection of participants for the conversation
|
@@ -35653,7 +35655,7 @@ this.Twilio.Conversations = (function (exports) {
|
|
35653
35655
|
var Participants = /*#__PURE__*/function (_ReplayEventEmitter) {
|
35654
35656
|
_inherits$4(Participants, _ReplayEventEmitter);
|
35655
35657
|
|
35656
|
-
var _super = _createSuper$
|
35658
|
+
var _super = _createSuper$7(Participants);
|
35657
35659
|
|
35658
35660
|
function Participants(conversation, participants, links, configuration, services) {
|
35659
35661
|
var _this;
|
@@ -36980,9 +36982,9 @@ this.Twilio.Conversations = (function (exports) {
|
|
36980
36982
|
|
36981
36983
|
function _objectSpread$4(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$4(Object(source), !0).forEach(function (key) { _defineProperty$3(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$4(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
36982
36984
|
|
36983
|
-
function _createSuper$
|
36985
|
+
function _createSuper$6(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$7(); 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); }; }
|
36984
36986
|
|
36985
|
-
function _isNativeReflectConstruct$
|
36987
|
+
function _isNativeReflectConstruct$7() { 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; } }
|
36986
36988
|
var log$3 = Logger.scope("Message");
|
36987
36989
|
|
36988
36990
|
var XHR = // eslint-disable-next-line @typescript-eslint/no-var-requires
|
@@ -36995,7 +36997,7 @@ this.Twilio.Conversations = (function (exports) {
|
|
36995
36997
|
var Message = /*#__PURE__*/function (_ReplayEventEmitter) {
|
36996
36998
|
_inherits$4(Message, _ReplayEventEmitter);
|
36997
36999
|
|
36998
|
-
var _super = _createSuper$
|
37000
|
+
var _super = _createSuper$6(Message);
|
36999
37001
|
|
37000
37002
|
/**
|
37001
37003
|
* Conversation that the message is in.
|
@@ -37005,7 +37007,7 @@ this.Twilio.Conversations = (function (exports) {
|
|
37005
37007
|
* @internal
|
37006
37008
|
*/
|
37007
37009
|
function Message(index, data, conversation, links, configuration, services) {
|
37008
|
-
var _data$text, _data$lastUpdatedBy, _data$type, _data$memberSid;
|
37010
|
+
var _data$text, _data$lastUpdatedBy, _data$type, _data$memberSid, _data$channelMetadata;
|
37009
37011
|
|
37010
37012
|
var _this;
|
37011
37013
|
|
@@ -37035,7 +37037,8 @@ this.Twilio.Conversations = (function (exports) {
|
|
37035
37037
|
category: "media"
|
37036
37038
|
}), _this.services)] : null,
|
37037
37039
|
participantSid: (_data$memberSid = data.memberSid) !== null && _data$memberSid !== void 0 ? _data$memberSid : null,
|
37038
|
-
aggregatedDeliveryReceipt: data.delivery ? new AggregatedDeliveryReceipt(data.delivery) : null
|
37040
|
+
aggregatedDeliveryReceipt: data.delivery ? new AggregatedDeliveryReceipt(data.delivery) : null,
|
37041
|
+
hasChannelMetadata: (_data$channelMetadata = data.channelMetadata) !== null && _data$channelMetadata !== void 0 ? _data$channelMetadata : false
|
37039
37042
|
};
|
37040
37043
|
return _this;
|
37041
37044
|
}
|
@@ -37887,6 +37890,47 @@ this.Twilio.Conversations = (function (exports) {
|
|
37887
37890
|
};
|
37888
37891
|
}());
|
37889
37892
|
}
|
37893
|
+
/**
|
37894
|
+
* Get the {@link ChannelMetadata} for this message. Resolves to `null` if
|
37895
|
+
* the message doesn't have any channel metadata.
|
37896
|
+
*/
|
37897
|
+
|
37898
|
+
}, {
|
37899
|
+
key: "getChannelMetadata",
|
37900
|
+
value: function () {
|
37901
|
+
var _getChannelMetadata = _asyncToGenerator$1( /*#__PURE__*/_regeneratorRuntime$1.mark(function _callee10() {
|
37902
|
+
return _regeneratorRuntime$1.wrap(function _callee10$(_context10) {
|
37903
|
+
while (1) {
|
37904
|
+
switch (_context10.prev = _context10.next) {
|
37905
|
+
case 0:
|
37906
|
+
if (this.state.hasChannelMetadata) {
|
37907
|
+
_context10.next = 2;
|
37908
|
+
break;
|
37909
|
+
}
|
37910
|
+
|
37911
|
+
return _context10.abrupt("return", null);
|
37912
|
+
|
37913
|
+
case 2:
|
37914
|
+
_context10.next = 4;
|
37915
|
+
return this.services.channelMetadataClient.getChannelMetadata(this.conversation.sid, this.sid);
|
37916
|
+
|
37917
|
+
case 4:
|
37918
|
+
return _context10.abrupt("return", _context10.sent);
|
37919
|
+
|
37920
|
+
case 5:
|
37921
|
+
case "end":
|
37922
|
+
return _context10.stop();
|
37923
|
+
}
|
37924
|
+
}
|
37925
|
+
}, _callee10, this);
|
37926
|
+
}));
|
37927
|
+
|
37928
|
+
function getChannelMetadata() {
|
37929
|
+
return _getChannelMetadata.apply(this, arguments);
|
37930
|
+
}
|
37931
|
+
|
37932
|
+
return getChannelMetadata;
|
37933
|
+
}()
|
37890
37934
|
}]);
|
37891
37935
|
|
37892
37936
|
return Message;
|
@@ -37914,15 +37958,15 @@ this.Twilio.Conversations = (function (exports) {
|
|
37914
37958
|
|
37915
37959
|
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; }
|
37916
37960
|
|
37917
|
-
function _createForOfIteratorHelper$
|
37961
|
+
function _createForOfIteratorHelper$3(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray$3(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
37918
37962
|
|
37919
|
-
function _unsupportedIterableToArray$
|
37963
|
+
function _unsupportedIterableToArray$3(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray$3(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$3(o, minLen); }
|
37920
37964
|
|
37921
|
-
function _arrayLikeToArray$
|
37965
|
+
function _arrayLikeToArray$3(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
37922
37966
|
|
37923
|
-
function _createSuper$
|
37967
|
+
function _createSuper$5(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$6(); 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); }; }
|
37924
37968
|
|
37925
|
-
function _isNativeReflectConstruct$
|
37969
|
+
function _isNativeReflectConstruct$6() { 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; } }
|
37926
37970
|
var log$2 = Logger.scope("Messages");
|
37927
37971
|
/**
|
37928
37972
|
* Represents the collection of messages in a conversation
|
@@ -37931,7 +37975,7 @@ this.Twilio.Conversations = (function (exports) {
|
|
37931
37975
|
var Messages = /*#__PURE__*/function (_ReplayEventEmitter) {
|
37932
37976
|
_inherits$4(Messages, _ReplayEventEmitter);
|
37933
37977
|
|
37934
|
-
var _super = _createSuper$
|
37978
|
+
var _super = _createSuper$5(Messages);
|
37935
37979
|
|
37936
37980
|
function Messages(conversation, configuration, services) {
|
37937
37981
|
var _this;
|
@@ -38126,7 +38170,7 @@ this.Twilio.Conversations = (function (exports) {
|
|
38126
38170
|
return request.cancel();
|
38127
38171
|
});
|
38128
38172
|
});
|
38129
|
-
_iterator = _createForOfIteratorHelper$
|
38173
|
+
_iterator = _createForOfIteratorHelper$3(message.mediaContent);
|
38130
38174
|
_context3.prev = 4;
|
38131
38175
|
|
38132
38176
|
_iterator.s();
|
@@ -38779,15 +38823,15 @@ this.Twilio.Conversations = (function (exports) {
|
|
38779
38823
|
|
38780
38824
|
__decorate$1([validateTypes_1([FormData, sendMediaOptions]), __metadata$1("design:type", Function), __metadata$1("design:paramtypes", [Object]), __metadata$1("design:returntype", MessageBuilder)], MessageBuilder.prototype, "addMedia", null);
|
38781
38825
|
|
38782
|
-
function _createForOfIteratorHelper$
|
38826
|
+
function _createForOfIteratorHelper$2(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray$2(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
38783
38827
|
|
38784
|
-
function _unsupportedIterableToArray$
|
38828
|
+
function _unsupportedIterableToArray$2(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray$2(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$2(o, minLen); }
|
38785
38829
|
|
38786
|
-
function _arrayLikeToArray$
|
38830
|
+
function _arrayLikeToArray$2(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
38787
38831
|
|
38788
|
-
function _createSuper$
|
38832
|
+
function _createSuper$4(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); }; }
|
38789
38833
|
|
38790
|
-
function _isNativeReflectConstruct$
|
38834
|
+
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; } }
|
38791
38835
|
/**
|
38792
38836
|
* Map of the fields that will be processed with update messages.
|
38793
38837
|
*/
|
@@ -38815,7 +38859,7 @@ this.Twilio.Conversations = (function (exports) {
|
|
38815
38859
|
var Conversation = /*#__PURE__*/function (_ReplayEventEmitter) {
|
38816
38860
|
_inherits$4(Conversation, _ReplayEventEmitter);
|
38817
38861
|
|
38818
|
-
var _super = _createSuper$
|
38862
|
+
var _super = _createSuper$4(Conversation);
|
38819
38863
|
|
38820
38864
|
/**
|
38821
38865
|
* Fired when a participant has joined the conversation.
|
@@ -40475,7 +40519,7 @@ this.Twilio.Conversations = (function (exports) {
|
|
40475
40519
|
}, {
|
40476
40520
|
key: "_onMessageAdded",
|
40477
40521
|
value: function _onMessageAdded(message) {
|
40478
|
-
var _iterator = _createForOfIteratorHelper$
|
40522
|
+
var _iterator = _createForOfIteratorHelper$2(this._participants.values()),
|
40479
40523
|
_step;
|
40480
40524
|
|
40481
40525
|
try {
|
@@ -40683,19 +40727,19 @@ this.Twilio.Conversations = (function (exports) {
|
|
40683
40727
|
return Deferred;
|
40684
40728
|
}();
|
40685
40729
|
|
40686
|
-
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
40730
|
+
function _createForOfIteratorHelper$1(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray$1(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
40687
40731
|
|
40688
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
40732
|
+
function _unsupportedIterableToArray$1(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray$1(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$1(o, minLen); }
|
40689
40733
|
|
40690
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
40734
|
+
function _arrayLikeToArray$1(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
40691
40735
|
|
40692
40736
|
function ownKeys$2(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; }
|
40693
40737
|
|
40694
40738
|
function _objectSpread$2(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$2(Object(source), !0).forEach(function (key) { _defineProperty$3(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$2(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
40695
40739
|
|
40696
|
-
function _createSuper$
|
40740
|
+
function _createSuper$3(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$4(); 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); }; }
|
40697
40741
|
|
40698
|
-
function _isNativeReflectConstruct$
|
40742
|
+
function _isNativeReflectConstruct$4() { 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; } }
|
40699
40743
|
var log$1 = Logger.scope("Conversations");
|
40700
40744
|
/**
|
40701
40745
|
* Represents conversations collection
|
@@ -40705,7 +40749,7 @@ this.Twilio.Conversations = (function (exports) {
|
|
40705
40749
|
var Conversations = /*#__PURE__*/function (_ReplayEventEmitter) {
|
40706
40750
|
_inherits$4(Conversations, _ReplayEventEmitter);
|
40707
40751
|
|
40708
|
-
var _super = _createSuper$
|
40752
|
+
var _super = _createSuper$3(Conversations);
|
40709
40753
|
|
40710
40754
|
function Conversations(configuration, services) {
|
40711
40755
|
var _this;
|
@@ -40867,7 +40911,7 @@ this.Twilio.Conversations = (function (exports) {
|
|
40867
40911
|
case 9:
|
40868
40912
|
myConversations = _context2.sent;
|
40869
40913
|
upserts = [];
|
40870
|
-
_iterator = _createForOfIteratorHelper(myConversations);
|
40914
|
+
_iterator = _createForOfIteratorHelper$1(myConversations);
|
40871
40915
|
|
40872
40916
|
try {
|
40873
40917
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
@@ -41513,9 +41557,9 @@ this.Twilio.Conversations = (function (exports) {
|
|
41513
41557
|
// https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
|
41514
41558
|
addToUnscopables(FIND);
|
41515
41559
|
|
41516
|
-
function _createSuper$
|
41560
|
+
function _createSuper$2(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$3(); 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); }; }
|
41517
41561
|
|
41518
|
-
function _isNativeReflectConstruct$
|
41562
|
+
function _isNativeReflectConstruct$3() { 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; } }
|
41519
41563
|
/**
|
41520
41564
|
* Container for known users
|
41521
41565
|
*/
|
@@ -41523,7 +41567,7 @@ this.Twilio.Conversations = (function (exports) {
|
|
41523
41567
|
var Users = /*#__PURE__*/function (_ReplayEventEmitter) {
|
41524
41568
|
_inherits$4(Users, _ReplayEventEmitter);
|
41525
41569
|
|
41526
|
-
var _super = _createSuper$
|
41570
|
+
var _super = _createSuper$2(Users);
|
41527
41571
|
|
41528
41572
|
function Users(myself, configuration, services) {
|
41529
41573
|
var _this;
|
@@ -41970,12 +42014,84 @@ this.Twilio.Conversations = (function (exports) {
|
|
41970
42014
|
this.data = data.data || {};
|
41971
42015
|
});
|
41972
42016
|
|
41973
|
-
var version = "2.
|
42017
|
+
var version = "2.4.0-rc.0";
|
42018
|
+
|
42019
|
+
function _isNativeFunction(fn) {
|
42020
|
+
return Function.toString.call(fn).indexOf("[native code]") !== -1;
|
42021
|
+
}
|
42022
|
+
|
42023
|
+
function _isNativeReflectConstruct$2() {
|
42024
|
+
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
42025
|
+
if (Reflect.construct.sham) return false;
|
42026
|
+
if (typeof Proxy === "function") return true;
|
42027
|
+
|
42028
|
+
try {
|
42029
|
+
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
42030
|
+
return true;
|
42031
|
+
} catch (e) {
|
42032
|
+
return false;
|
42033
|
+
}
|
42034
|
+
}
|
42035
|
+
|
42036
|
+
function _construct(Parent, args, Class) {
|
42037
|
+
if (_isNativeReflectConstruct$2()) {
|
42038
|
+
_construct = Reflect.construct;
|
42039
|
+
} else {
|
42040
|
+
_construct = function _construct(Parent, args, Class) {
|
42041
|
+
var a = [null];
|
42042
|
+
a.push.apply(a, args);
|
42043
|
+
var Constructor = Function.bind.apply(Parent, a);
|
42044
|
+
var instance = new Constructor();
|
42045
|
+
if (Class) _setPrototypeOf(instance, Class.prototype);
|
42046
|
+
return instance;
|
42047
|
+
};
|
42048
|
+
}
|
42049
|
+
|
42050
|
+
return _construct.apply(null, arguments);
|
42051
|
+
}
|
42052
|
+
|
42053
|
+
function _wrapNativeSuper(Class) {
|
42054
|
+
var _cache = typeof Map === "function" ? new Map() : undefined;
|
42055
|
+
|
42056
|
+
_wrapNativeSuper = function _wrapNativeSuper(Class) {
|
42057
|
+
if (Class === null || !_isNativeFunction(Class)) return Class;
|
42058
|
+
|
42059
|
+
if (typeof Class !== "function") {
|
42060
|
+
throw new TypeError("Super expression must either be null or a function");
|
42061
|
+
}
|
42062
|
+
|
42063
|
+
if (typeof _cache !== "undefined") {
|
42064
|
+
if (_cache.has(Class)) return _cache.get(Class);
|
42065
|
+
|
42066
|
+
_cache.set(Class, Wrapper);
|
42067
|
+
}
|
42068
|
+
|
42069
|
+
function Wrapper() {
|
42070
|
+
return _construct(Class, arguments, _getPrototypeOf$4(this).constructor);
|
42071
|
+
}
|
42072
|
+
|
42073
|
+
Wrapper.prototype = Object.create(Class.prototype, {
|
42074
|
+
constructor: {
|
42075
|
+
value: Wrapper,
|
42076
|
+
enumerable: false,
|
42077
|
+
writable: true,
|
42078
|
+
configurable: true
|
42079
|
+
}
|
42080
|
+
});
|
42081
|
+
return _setPrototypeOf(Wrapper, Class);
|
42082
|
+
};
|
42083
|
+
|
42084
|
+
return _wrapNativeSuper(Class);
|
42085
|
+
}
|
41974
42086
|
|
41975
42087
|
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; }
|
41976
42088
|
|
41977
42089
|
function _objectSpread$1(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$1(Object(source), !0).forEach(function (key) { _defineProperty$3(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$1(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
41978
42090
|
|
42091
|
+
function _createSuper$1(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$1(); 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); }; }
|
42092
|
+
|
42093
|
+
function _isNativeReflectConstruct$1() { 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; } }
|
42094
|
+
|
41979
42095
|
var trimSlashes = function trimSlashes(url) {
|
41980
42096
|
return url.replace(/(^\/+|\/+$)/g, "");
|
41981
42097
|
};
|
@@ -41984,6 +42100,20 @@ this.Twilio.Conversations = (function (exports) {
|
|
41984
42100
|
return response.status.code === 202;
|
41985
42101
|
};
|
41986
42102
|
|
42103
|
+
var ChannelMetadataNotFoundError = /*#__PURE__*/function (_Error) {
|
42104
|
+
_inherits$4(ChannelMetadataNotFoundError, _Error);
|
42105
|
+
|
42106
|
+
var _super = _createSuper$1(ChannelMetadataNotFoundError);
|
42107
|
+
|
42108
|
+
function ChannelMetadataNotFoundError(message) {
|
42109
|
+
_classCallCheck$4(this, ChannelMetadataNotFoundError);
|
42110
|
+
|
42111
|
+
return _super.call(this, message);
|
42112
|
+
}
|
42113
|
+
|
42114
|
+
return _createClass$4(ChannelMetadataNotFoundError);
|
42115
|
+
}( /*#__PURE__*/_wrapNativeSuper(Error));
|
42116
|
+
|
41987
42117
|
var CommandExecutor = /*#__PURE__*/function () {
|
41988
42118
|
function CommandExecutor(_serviceUrl, _services, _productId) {
|
41989
42119
|
_classCallCheck$4(this, CommandExecutor);
|
@@ -42081,40 +42211,91 @@ this.Twilio.Conversations = (function (exports) {
|
|
42081
42211
|
}, {
|
42082
42212
|
key: "fetchResource",
|
42083
42213
|
value: function () {
|
42084
|
-
var _fetchResource = _asyncToGenerator$1( /*#__PURE__*/_regeneratorRuntime$1.mark(function
|
42214
|
+
var _fetchResource = _asyncToGenerator$1( /*#__PURE__*/_regeneratorRuntime$1.mark(function _callee3(url, requestBody) {
|
42085
42215
|
var _this = this;
|
42086
42216
|
|
42087
|
-
var maxAttemptsCount,
|
42088
|
-
return _regeneratorRuntime$1.wrap(function
|
42217
|
+
var maxAttemptsCount, retrier, resolution;
|
42218
|
+
return _regeneratorRuntime$1.wrap(function _callee3$(_context3) {
|
42089
42219
|
while (1) {
|
42090
|
-
switch (
|
42220
|
+
switch (_context3.prev = _context3.next) {
|
42091
42221
|
case 0:
|
42092
42222
|
maxAttemptsCount = 6;
|
42093
|
-
|
42094
|
-
_context2.next = 4;
|
42095
|
-
return new AsyncRetrier_1({
|
42223
|
+
retrier = new AsyncRetrier_1({
|
42096
42224
|
min: 50,
|
42097
42225
|
max: 1600,
|
42098
42226
|
maxAttemptsCount: maxAttemptsCount
|
42099
|
-
}).run(function () {
|
42100
|
-
return _this._makeRequest("get", url, requestBody);
|
42101
42227
|
});
|
42228
|
+
_context3.prev = 2;
|
42229
|
+
_context3.next = 5;
|
42230
|
+
return retrier.run( /*#__PURE__*/_asyncToGenerator$1( /*#__PURE__*/_regeneratorRuntime$1.mark(function _callee2() {
|
42231
|
+
var response, _e$body, _e$body2;
|
42232
|
+
|
42233
|
+
return _regeneratorRuntime$1.wrap(function _callee2$(_context2) {
|
42234
|
+
while (1) {
|
42235
|
+
switch (_context2.prev = _context2.next) {
|
42236
|
+
case 0:
|
42237
|
+
_context2.prev = 0;
|
42238
|
+
_context2.next = 3;
|
42239
|
+
return _this._makeRequest("get", url, requestBody);
|
42240
|
+
|
42241
|
+
case 3:
|
42242
|
+
response = _context2.sent;
|
42243
|
+
return _context2.abrupt("return", {
|
42244
|
+
type: "success",
|
42245
|
+
data: response.body
|
42246
|
+
});
|
42247
|
+
|
42248
|
+
case 7:
|
42249
|
+
_context2.prev = 7;
|
42250
|
+
_context2.t0 = _context2["catch"](0);
|
42251
|
+
|
42252
|
+
if (!((_context2.t0 === null || _context2.t0 === void 0 ? void 0 : (_e$body = _context2.t0.body) === null || _e$body === void 0 ? void 0 : _e$body.status) === 404 && (_context2.t0 === null || _context2.t0 === void 0 ? void 0 : (_e$body2 = _context2.t0.body) === null || _e$body2 === void 0 ? void 0 : _e$body2.code) === 50530)) {
|
42253
|
+
_context2.next = 11;
|
42254
|
+
break;
|
42255
|
+
}
|
42102
42256
|
|
42103
|
-
|
42104
|
-
|
42105
|
-
|
42257
|
+
return _context2.abrupt("return", {
|
42258
|
+
type: "noMetadata"
|
42259
|
+
});
|
42260
|
+
|
42261
|
+
case 11:
|
42262
|
+
throw _context2.t0;
|
42263
|
+
|
42264
|
+
case 12:
|
42265
|
+
case "end":
|
42266
|
+
return _context2.stop();
|
42267
|
+
}
|
42268
|
+
}
|
42269
|
+
}, _callee2, null, [[0, 7]]);
|
42270
|
+
})));
|
42271
|
+
|
42272
|
+
case 5:
|
42273
|
+
resolution = _context3.sent;
|
42274
|
+
_context3.next = 11;
|
42275
|
+
break;
|
42106
42276
|
|
42107
42277
|
case 8:
|
42108
|
-
|
42109
|
-
|
42278
|
+
_context3.prev = 8;
|
42279
|
+
_context3.t0 = _context3["catch"](2);
|
42110
42280
|
throw new Error("Fetch resource from \"".concat(url, "\" failed."));
|
42111
42281
|
|
42112
42282
|
case 11:
|
42283
|
+
if (!(resolution.type === "noMetadata")) {
|
42284
|
+
_context3.next = 13;
|
42285
|
+
break;
|
42286
|
+
}
|
42287
|
+
|
42288
|
+
throw new ChannelMetadataNotFoundError("No metadata found.");
|
42289
|
+
|
42290
|
+
case 13:
|
42291
|
+
return _context3.abrupt("return", resolution.data);
|
42292
|
+
|
42293
|
+
case 14:
|
42113
42294
|
case "end":
|
42114
|
-
return
|
42295
|
+
return _context3.stop();
|
42115
42296
|
}
|
42116
42297
|
}
|
42117
|
-
},
|
42298
|
+
}, _callee3, null, [[2, 8]]);
|
42118
42299
|
}));
|
42119
42300
|
|
42120
42301
|
function fetchResource(_x5, _x6) {
|
@@ -42126,40 +42307,40 @@ this.Twilio.Conversations = (function (exports) {
|
|
42126
42307
|
}, {
|
42127
42308
|
key: "mutateResource",
|
42128
42309
|
value: function () {
|
42129
|
-
var _mutateResource = _asyncToGenerator$1( /*#__PURE__*/_regeneratorRuntime$1.mark(function
|
42310
|
+
var _mutateResource = _asyncToGenerator$1( /*#__PURE__*/_regeneratorRuntime$1.mark(function _callee4(method, url, requestBody) {
|
42130
42311
|
var result;
|
42131
|
-
return _regeneratorRuntime$1.wrap(function
|
42312
|
+
return _regeneratorRuntime$1.wrap(function _callee4$(_context4) {
|
42132
42313
|
while (1) {
|
42133
|
-
switch (
|
42314
|
+
switch (_context4.prev = _context4.next) {
|
42134
42315
|
case 0:
|
42135
|
-
|
42316
|
+
_context4.next = 2;
|
42136
42317
|
return this._makeRequest(method, url, requestBody, {
|
42137
42318
|
"X-Twilio-Mutation-Id": uuid_1.v4()
|
42138
42319
|
});
|
42139
42320
|
|
42140
42321
|
case 2:
|
42141
|
-
result =
|
42322
|
+
result = _context4.sent;
|
42142
42323
|
|
42143
42324
|
if (!isMutationConflictResponse(result)) {
|
42144
|
-
|
42325
|
+
_context4.next = 7;
|
42145
42326
|
break;
|
42146
42327
|
}
|
42147
42328
|
|
42148
|
-
|
42329
|
+
_context4.next = 6;
|
42149
42330
|
return this.fetchResource(result.body.resource_url);
|
42150
42331
|
|
42151
42332
|
case 6:
|
42152
|
-
return
|
42333
|
+
return _context4.abrupt("return", _context4.sent);
|
42153
42334
|
|
42154
42335
|
case 7:
|
42155
|
-
return
|
42336
|
+
return _context4.abrupt("return", result.body);
|
42156
42337
|
|
42157
42338
|
case 8:
|
42158
42339
|
case "end":
|
42159
|
-
return
|
42340
|
+
return _context4.stop();
|
42160
42341
|
}
|
42161
42342
|
}
|
42162
|
-
},
|
42343
|
+
}, _callee4, this);
|
42163
42344
|
}));
|
42164
42345
|
|
42165
42346
|
function mutateResource(_x7, _x8, _x9) {
|
@@ -42320,6 +42501,448 @@ this.Twilio.Conversations = (function (exports) {
|
|
42320
42501
|
return ContentClient;
|
42321
42502
|
}();
|
42322
42503
|
|
42504
|
+
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
42505
|
+
|
42506
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
42507
|
+
|
42508
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
42509
|
+
|
42510
|
+
var QuickLRU = /*#__PURE__*/function (_Symbol$iterator) {
|
42511
|
+
function QuickLRU() {
|
42512
|
+
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
42513
|
+
|
42514
|
+
_classCallCheck$4(this, QuickLRU);
|
42515
|
+
|
42516
|
+
if (!(options.maxSize && options.maxSize > 0)) {
|
42517
|
+
throw new TypeError('`maxSize` must be a number greater than 0');
|
42518
|
+
}
|
42519
|
+
|
42520
|
+
this.maxSize = options.maxSize;
|
42521
|
+
this.onEviction = options.onEviction;
|
42522
|
+
this.cache = new Map();
|
42523
|
+
this.oldCache = new Map();
|
42524
|
+
this._size = 0;
|
42525
|
+
}
|
42526
|
+
|
42527
|
+
_createClass$4(QuickLRU, [{
|
42528
|
+
key: "_set",
|
42529
|
+
value: function _set(key, value) {
|
42530
|
+
this.cache.set(key, value);
|
42531
|
+
this._size++;
|
42532
|
+
|
42533
|
+
if (this._size >= this.maxSize) {
|
42534
|
+
this._size = 0;
|
42535
|
+
|
42536
|
+
if (typeof this.onEviction === 'function') {
|
42537
|
+
var _iterator = _createForOfIteratorHelper(this.oldCache.entries()),
|
42538
|
+
_step;
|
42539
|
+
|
42540
|
+
try {
|
42541
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
42542
|
+
var _step$value = _slicedToArray$1(_step.value, 2),
|
42543
|
+
_key = _step$value[0],
|
42544
|
+
_value = _step$value[1];
|
42545
|
+
|
42546
|
+
this.onEviction(_key, _value);
|
42547
|
+
}
|
42548
|
+
} catch (err) {
|
42549
|
+
_iterator.e(err);
|
42550
|
+
} finally {
|
42551
|
+
_iterator.f();
|
42552
|
+
}
|
42553
|
+
}
|
42554
|
+
|
42555
|
+
this.oldCache = this.cache;
|
42556
|
+
this.cache = new Map();
|
42557
|
+
}
|
42558
|
+
}
|
42559
|
+
}, {
|
42560
|
+
key: "get",
|
42561
|
+
value: function get(key) {
|
42562
|
+
if (this.cache.has(key)) {
|
42563
|
+
return this.cache.get(key);
|
42564
|
+
}
|
42565
|
+
|
42566
|
+
if (this.oldCache.has(key)) {
|
42567
|
+
var value = this.oldCache.get(key);
|
42568
|
+
this.oldCache.delete(key);
|
42569
|
+
|
42570
|
+
this._set(key, value);
|
42571
|
+
|
42572
|
+
return value;
|
42573
|
+
}
|
42574
|
+
}
|
42575
|
+
}, {
|
42576
|
+
key: "set",
|
42577
|
+
value: function set(key, value) {
|
42578
|
+
if (this.cache.has(key)) {
|
42579
|
+
this.cache.set(key, value);
|
42580
|
+
} else {
|
42581
|
+
this._set(key, value);
|
42582
|
+
}
|
42583
|
+
|
42584
|
+
return this;
|
42585
|
+
}
|
42586
|
+
}, {
|
42587
|
+
key: "has",
|
42588
|
+
value: function has(key) {
|
42589
|
+
return this.cache.has(key) || this.oldCache.has(key);
|
42590
|
+
}
|
42591
|
+
}, {
|
42592
|
+
key: "peek",
|
42593
|
+
value: function peek(key) {
|
42594
|
+
if (this.cache.has(key)) {
|
42595
|
+
return this.cache.get(key);
|
42596
|
+
}
|
42597
|
+
|
42598
|
+
if (this.oldCache.has(key)) {
|
42599
|
+
return this.oldCache.get(key);
|
42600
|
+
}
|
42601
|
+
}
|
42602
|
+
}, {
|
42603
|
+
key: "delete",
|
42604
|
+
value: function _delete(key) {
|
42605
|
+
var deleted = this.cache.delete(key);
|
42606
|
+
|
42607
|
+
if (deleted) {
|
42608
|
+
this._size--;
|
42609
|
+
}
|
42610
|
+
|
42611
|
+
return this.oldCache.delete(key) || deleted;
|
42612
|
+
}
|
42613
|
+
}, {
|
42614
|
+
key: "clear",
|
42615
|
+
value: function clear() {
|
42616
|
+
this.cache.clear();
|
42617
|
+
this.oldCache.clear();
|
42618
|
+
this._size = 0;
|
42619
|
+
}
|
42620
|
+
}, {
|
42621
|
+
key: "keys",
|
42622
|
+
value: /*#__PURE__*/_regeneratorRuntime$1.mark(function keys() {
|
42623
|
+
var _iterator2, _step2, _step2$value, key;
|
42624
|
+
|
42625
|
+
return _regeneratorRuntime$1.wrap(function keys$(_context) {
|
42626
|
+
while (1) {
|
42627
|
+
switch (_context.prev = _context.next) {
|
42628
|
+
case 0:
|
42629
|
+
_iterator2 = _createForOfIteratorHelper(this);
|
42630
|
+
_context.prev = 1;
|
42631
|
+
|
42632
|
+
_iterator2.s();
|
42633
|
+
|
42634
|
+
case 3:
|
42635
|
+
if ((_step2 = _iterator2.n()).done) {
|
42636
|
+
_context.next = 9;
|
42637
|
+
break;
|
42638
|
+
}
|
42639
|
+
|
42640
|
+
_step2$value = _slicedToArray$1(_step2.value, 1), key = _step2$value[0];
|
42641
|
+
_context.next = 7;
|
42642
|
+
return key;
|
42643
|
+
|
42644
|
+
case 7:
|
42645
|
+
_context.next = 3;
|
42646
|
+
break;
|
42647
|
+
|
42648
|
+
case 9:
|
42649
|
+
_context.next = 14;
|
42650
|
+
break;
|
42651
|
+
|
42652
|
+
case 11:
|
42653
|
+
_context.prev = 11;
|
42654
|
+
_context.t0 = _context["catch"](1);
|
42655
|
+
|
42656
|
+
_iterator2.e(_context.t0);
|
42657
|
+
|
42658
|
+
case 14:
|
42659
|
+
_context.prev = 14;
|
42660
|
+
|
42661
|
+
_iterator2.f();
|
42662
|
+
|
42663
|
+
return _context.finish(14);
|
42664
|
+
|
42665
|
+
case 17:
|
42666
|
+
case "end":
|
42667
|
+
return _context.stop();
|
42668
|
+
}
|
42669
|
+
}
|
42670
|
+
}, keys, this, [[1, 11, 14, 17]]);
|
42671
|
+
})
|
42672
|
+
}, {
|
42673
|
+
key: "values",
|
42674
|
+
value: /*#__PURE__*/_regeneratorRuntime$1.mark(function values() {
|
42675
|
+
var _iterator3, _step3, _step3$value, value;
|
42676
|
+
|
42677
|
+
return _regeneratorRuntime$1.wrap(function values$(_context2) {
|
42678
|
+
while (1) {
|
42679
|
+
switch (_context2.prev = _context2.next) {
|
42680
|
+
case 0:
|
42681
|
+
_iterator3 = _createForOfIteratorHelper(this);
|
42682
|
+
_context2.prev = 1;
|
42683
|
+
|
42684
|
+
_iterator3.s();
|
42685
|
+
|
42686
|
+
case 3:
|
42687
|
+
if ((_step3 = _iterator3.n()).done) {
|
42688
|
+
_context2.next = 9;
|
42689
|
+
break;
|
42690
|
+
}
|
42691
|
+
|
42692
|
+
_step3$value = _slicedToArray$1(_step3.value, 2), value = _step3$value[1];
|
42693
|
+
_context2.next = 7;
|
42694
|
+
return value;
|
42695
|
+
|
42696
|
+
case 7:
|
42697
|
+
_context2.next = 3;
|
42698
|
+
break;
|
42699
|
+
|
42700
|
+
case 9:
|
42701
|
+
_context2.next = 14;
|
42702
|
+
break;
|
42703
|
+
|
42704
|
+
case 11:
|
42705
|
+
_context2.prev = 11;
|
42706
|
+
_context2.t0 = _context2["catch"](1);
|
42707
|
+
|
42708
|
+
_iterator3.e(_context2.t0);
|
42709
|
+
|
42710
|
+
case 14:
|
42711
|
+
_context2.prev = 14;
|
42712
|
+
|
42713
|
+
_iterator3.f();
|
42714
|
+
|
42715
|
+
return _context2.finish(14);
|
42716
|
+
|
42717
|
+
case 17:
|
42718
|
+
case "end":
|
42719
|
+
return _context2.stop();
|
42720
|
+
}
|
42721
|
+
}
|
42722
|
+
}, values, this, [[1, 11, 14, 17]]);
|
42723
|
+
})
|
42724
|
+
}, {
|
42725
|
+
key: _Symbol$iterator,
|
42726
|
+
value: /*#__PURE__*/_regeneratorRuntime$1.mark(function value() {
|
42727
|
+
var _iterator4, _step4, item, _iterator5, _step5, _item, _item2, key;
|
42728
|
+
|
42729
|
+
return _regeneratorRuntime$1.wrap(function value$(_context3) {
|
42730
|
+
while (1) {
|
42731
|
+
switch (_context3.prev = _context3.next) {
|
42732
|
+
case 0:
|
42733
|
+
_iterator4 = _createForOfIteratorHelper(this.cache);
|
42734
|
+
_context3.prev = 1;
|
42735
|
+
|
42736
|
+
_iterator4.s();
|
42737
|
+
|
42738
|
+
case 3:
|
42739
|
+
if ((_step4 = _iterator4.n()).done) {
|
42740
|
+
_context3.next = 9;
|
42741
|
+
break;
|
42742
|
+
}
|
42743
|
+
|
42744
|
+
item = _step4.value;
|
42745
|
+
_context3.next = 7;
|
42746
|
+
return item;
|
42747
|
+
|
42748
|
+
case 7:
|
42749
|
+
_context3.next = 3;
|
42750
|
+
break;
|
42751
|
+
|
42752
|
+
case 9:
|
42753
|
+
_context3.next = 14;
|
42754
|
+
break;
|
42755
|
+
|
42756
|
+
case 11:
|
42757
|
+
_context3.prev = 11;
|
42758
|
+
_context3.t0 = _context3["catch"](1);
|
42759
|
+
|
42760
|
+
_iterator4.e(_context3.t0);
|
42761
|
+
|
42762
|
+
case 14:
|
42763
|
+
_context3.prev = 14;
|
42764
|
+
|
42765
|
+
_iterator4.f();
|
42766
|
+
|
42767
|
+
return _context3.finish(14);
|
42768
|
+
|
42769
|
+
case 17:
|
42770
|
+
_iterator5 = _createForOfIteratorHelper(this.oldCache);
|
42771
|
+
_context3.prev = 18;
|
42772
|
+
|
42773
|
+
_iterator5.s();
|
42774
|
+
|
42775
|
+
case 20:
|
42776
|
+
if ((_step5 = _iterator5.n()).done) {
|
42777
|
+
_context3.next = 28;
|
42778
|
+
break;
|
42779
|
+
}
|
42780
|
+
|
42781
|
+
_item = _step5.value;
|
42782
|
+
_item2 = _slicedToArray$1(_item, 1), key = _item2[0];
|
42783
|
+
|
42784
|
+
if (this.cache.has(key)) {
|
42785
|
+
_context3.next = 26;
|
42786
|
+
break;
|
42787
|
+
}
|
42788
|
+
|
42789
|
+
_context3.next = 26;
|
42790
|
+
return _item;
|
42791
|
+
|
42792
|
+
case 26:
|
42793
|
+
_context3.next = 20;
|
42794
|
+
break;
|
42795
|
+
|
42796
|
+
case 28:
|
42797
|
+
_context3.next = 33;
|
42798
|
+
break;
|
42799
|
+
|
42800
|
+
case 30:
|
42801
|
+
_context3.prev = 30;
|
42802
|
+
_context3.t1 = _context3["catch"](18);
|
42803
|
+
|
42804
|
+
_iterator5.e(_context3.t1);
|
42805
|
+
|
42806
|
+
case 33:
|
42807
|
+
_context3.prev = 33;
|
42808
|
+
|
42809
|
+
_iterator5.f();
|
42810
|
+
|
42811
|
+
return _context3.finish(33);
|
42812
|
+
|
42813
|
+
case 36:
|
42814
|
+
case "end":
|
42815
|
+
return _context3.stop();
|
42816
|
+
}
|
42817
|
+
}
|
42818
|
+
}, value, this, [[1, 11, 14, 17], [18, 30, 33, 36]]);
|
42819
|
+
})
|
42820
|
+
}, {
|
42821
|
+
key: "size",
|
42822
|
+
get: function get() {
|
42823
|
+
var oldCacheSize = 0;
|
42824
|
+
|
42825
|
+
var _iterator6 = _createForOfIteratorHelper(this.oldCache.keys()),
|
42826
|
+
_step6;
|
42827
|
+
|
42828
|
+
try {
|
42829
|
+
for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
|
42830
|
+
var key = _step6.value;
|
42831
|
+
|
42832
|
+
if (!this.cache.has(key)) {
|
42833
|
+
oldCacheSize++;
|
42834
|
+
}
|
42835
|
+
}
|
42836
|
+
} catch (err) {
|
42837
|
+
_iterator6.e(err);
|
42838
|
+
} finally {
|
42839
|
+
_iterator6.f();
|
42840
|
+
}
|
42841
|
+
|
42842
|
+
return Math.min(this._size + oldCacheSize, this.maxSize);
|
42843
|
+
}
|
42844
|
+
}]);
|
42845
|
+
|
42846
|
+
return QuickLRU;
|
42847
|
+
}(Symbol.iterator);
|
42848
|
+
|
42849
|
+
var quickLru = QuickLRU;
|
42850
|
+
|
42851
|
+
var ChannelMetadata = /*#__PURE__*/_createClass$4(function ChannelMetadata(type, data) {
|
42852
|
+
_classCallCheck$4(this, ChannelMetadata);
|
42853
|
+
|
42854
|
+
this.type = type;
|
42855
|
+
this.data = data;
|
42856
|
+
Object.freeze(data);
|
42857
|
+
});
|
42858
|
+
|
42859
|
+
var ChannelMetadataClient = /*#__PURE__*/function () {
|
42860
|
+
function ChannelMetadataClient(services, configuration) {
|
42861
|
+
_classCallCheck$4(this, ChannelMetadataClient);
|
42862
|
+
|
42863
|
+
this._services = services;
|
42864
|
+
this._configuration = configuration;
|
42865
|
+
this._cache = new quickLru({
|
42866
|
+
maxSize: configuration.channelMetadataCacheCapacity
|
42867
|
+
});
|
42868
|
+
}
|
42869
|
+
|
42870
|
+
_createClass$4(ChannelMetadataClient, [{
|
42871
|
+
key: "getChannelMetadata",
|
42872
|
+
value: function () {
|
42873
|
+
var _getChannelMetadata = _asyncToGenerator$1( /*#__PURE__*/_regeneratorRuntime$1.mark(function _callee(conversationSid, messageSid) {
|
42874
|
+
var key, cachedItem, url, metadataResponse, metadata;
|
42875
|
+
return _regeneratorRuntime$1.wrap(function _callee$(_context) {
|
42876
|
+
while (1) {
|
42877
|
+
switch (_context.prev = _context.next) {
|
42878
|
+
case 0:
|
42879
|
+
key = "".concat(conversationSid, ",").concat(messageSid);
|
42880
|
+
cachedItem = this._cache.get(key);
|
42881
|
+
|
42882
|
+
if (!cachedItem) {
|
42883
|
+
_context.next = 4;
|
42884
|
+
break;
|
42885
|
+
}
|
42886
|
+
|
42887
|
+
return _context.abrupt("return", cachedItem.item);
|
42888
|
+
|
42889
|
+
case 4:
|
42890
|
+
url = "".concat(this._configuration.links.conversations, "/").concat(conversationSid, "/Messages/").concat(messageSid, "/ChannelMetadata");
|
42891
|
+
_context.prev = 5;
|
42892
|
+
_context.next = 8;
|
42893
|
+
return this._services.commandExecutor.fetchResource(url);
|
42894
|
+
|
42895
|
+
case 8:
|
42896
|
+
metadataResponse = _context.sent;
|
42897
|
+
_context.next = 17;
|
42898
|
+
break;
|
42899
|
+
|
42900
|
+
case 11:
|
42901
|
+
_context.prev = 11;
|
42902
|
+
_context.t0 = _context["catch"](5);
|
42903
|
+
|
42904
|
+
if (!(_context.t0 instanceof ChannelMetadataNotFoundError)) {
|
42905
|
+
_context.next = 16;
|
42906
|
+
break;
|
42907
|
+
}
|
42908
|
+
|
42909
|
+
this._cache.set(key, {
|
42910
|
+
item: null
|
42911
|
+
});
|
42912
|
+
|
42913
|
+
return _context.abrupt("return", null);
|
42914
|
+
|
42915
|
+
case 16:
|
42916
|
+
throw new Error(_context.t0);
|
42917
|
+
|
42918
|
+
case 17:
|
42919
|
+
metadata = new ChannelMetadata(metadataResponse.type, metadataResponse.data);
|
42920
|
+
|
42921
|
+
this._cache.set(key, {
|
42922
|
+
item: metadata
|
42923
|
+
});
|
42924
|
+
|
42925
|
+
return _context.abrupt("return", metadata);
|
42926
|
+
|
42927
|
+
case 20:
|
42928
|
+
case "end":
|
42929
|
+
return _context.stop();
|
42930
|
+
}
|
42931
|
+
}
|
42932
|
+
}, _callee, this, [[5, 11]]);
|
42933
|
+
}));
|
42934
|
+
|
42935
|
+
function getChannelMetadata(_x, _x2) {
|
42936
|
+
return _getChannelMetadata.apply(this, arguments);
|
42937
|
+
}
|
42938
|
+
|
42939
|
+
return getChannelMetadata;
|
42940
|
+
}()
|
42941
|
+
}]);
|
42942
|
+
|
42943
|
+
return ChannelMetadataClient;
|
42944
|
+
}();
|
42945
|
+
|
42323
42946
|
var _class;
|
42324
42947
|
|
42325
42948
|
function ownKeys(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; }
|
@@ -43540,6 +44163,7 @@ this.Twilio.Conversations = (function (exports) {
|
|
43540
44163
|
case 2:
|
43541
44164
|
configurationResponse = _context17.sent;
|
43542
44165
|
this._configuration = new Configuration$1(this._options, configurationResponse, Client_1._logger);
|
44166
|
+
this._services.channelMetadataClient = new ChannelMetadataClient(this._services, this._configuration);
|
43543
44167
|
|
43544
44168
|
this._myself._resolveInitialization(this._configuration, this._configuration.userIdentity, this._configuration.userInfo, true);
|
43545
44169
|
|
@@ -43618,10 +44242,10 @@ this.Twilio.Conversations = (function (exports) {
|
|
43618
44242
|
}).catch(function (error) {
|
43619
44243
|
throw error;
|
43620
44244
|
});
|
43621
|
-
_context17.next =
|
44245
|
+
_context17.next = 29;
|
43622
44246
|
return this._services.users.myself._ensureFetched();
|
43623
44247
|
|
43624
|
-
case
|
44248
|
+
case 29:
|
43625
44249
|
Client_1._supportedPushChannels.forEach(function (channelType) {
|
43626
44250
|
return _this3._subscribeToPushNotifications(channelType);
|
43627
44251
|
});
|
@@ -43637,7 +44261,7 @@ this.Twilio.Conversations = (function (exports) {
|
|
43637
44261
|
this.emit("stateChanged", "initialized");
|
43638
44262
|
this.emit("initialized");
|
43639
44263
|
|
43640
|
-
case
|
44264
|
+
case 35:
|
43641
44265
|
case "end":
|
43642
44266
|
return _context17.stop();
|
43643
44267
|
}
|