@twilio/conversations 2.3.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/lib.js CHANGED
@@ -216,6 +216,7 @@ var deprecationDecorator = require('@twilio/deprecation-decorator');
216
216
  require('core-js/modules/es.object.entries.js');
217
217
  require('core-js/modules/es.array.find.js');
218
218
  require('core-js/modules/es.array.splice.js');
219
+ var _wrapNativeSuper = require('@babel/runtime/helpers/wrapNativeSuper');
219
220
  var uuid = require('uuid');
220
221
  require('core-js/modules/es.object.freeze.js');
221
222
 
@@ -253,6 +254,7 @@ var loglevelLog__namespace = /*#__PURE__*/_interopNamespace(loglevelLog);
253
254
  var _toConsumableArray__default = /*#__PURE__*/_interopDefaultLegacy(_toConsumableArray);
254
255
  var isEqual__default = /*#__PURE__*/_interopDefaultLegacy(isEqual);
255
256
  var _slicedToArray__default = /*#__PURE__*/_interopDefaultLegacy(_slicedToArray);
257
+ var _wrapNativeSuper__default = /*#__PURE__*/_interopDefaultLegacy(_wrapNativeSuper);
256
258
 
257
259
  function __decorate(decorators, target, key, desc) {
258
260
  var c = arguments.length,
@@ -405,7 +407,7 @@ var MAXIMUM_ATTEMPTS_COUNT = 3;
405
407
  var RETRY_WHEN_THROTTLED = true;
406
408
 
407
409
  var Configuration = /*#__PURE__*/_createClass__default["default"](function Configuration() {
408
- var _ref, _constructorOptions$u, _ref2, _constructorOptions$h, _ref3, _constructorOptions$c;
410
+ var _ref, _constructorOptions$u, _ref2, _constructorOptions$h, _ref3, _constructorOptions$c, _options$channelMetad;
409
411
 
410
412
  var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
411
413
  var configurationResponse = arguments.length > 1 ? arguments[1] : undefined;
@@ -463,6 +465,8 @@ var Configuration = /*#__PURE__*/_createClass__default["default"](function Confi
463
465
  logger.error("Failed to parse consumption report interval ".concat(consumptionReportInterval, ", using default value ").concat(CONSUMPTION_HORIZON_SENDING_INTERVAL));
464
466
  this.consumptionReportInterval = iso8601Duration.toSeconds(iso8601Duration.parse(CONSUMPTION_HORIZON_SENDING_INTERVAL));
465
467
  }
468
+
469
+ this.channelMetadataCacheCapacity = (_options$channelMetad = options.channelMetadataCacheCapacity) !== null && _options$channelMetad !== void 0 ? _options$channelMetad : 100;
466
470
  });
467
471
 
468
472
  /**
@@ -567,9 +571,9 @@ var sendMediaOptions = declarativeTypeValidator.objectSchema("send media options
567
571
  media: [declarativeTypeValidator.literal("null"), "string"].concat(_toConsumableArray__default["default"](typeof Buffer === "function" ? [Buffer] : []), _toConsumableArray__default["default"](typeof Blob === "function" ? [Blob] : []))
568
572
  });
569
573
 
570
- function _createSuper$8(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$8(); return function _createSuperInternal() { var Super = _getPrototypeOf__default["default"](Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf__default["default"](this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn__default["default"](this, result); }; }
574
+ function _createSuper$9(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$9(); return function _createSuperInternal() { var Super = _getPrototypeOf__default["default"](Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf__default["default"](this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn__default["default"](this, result); }; }
571
575
 
572
- 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; } }
576
+ 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; } }
573
577
  var log$6 = Logger.scope("User");
574
578
  /**
575
579
  * Extended user information.
@@ -581,7 +585,7 @@ var log$6 = Logger.scope("User");
581
585
  var User = /*#__PURE__*/function (_ReplayEventEmitter) {
582
586
  _inherits__default["default"](User, _ReplayEventEmitter);
583
587
 
584
- var _super = _createSuper$8(User);
588
+ var _super = _createSuper$9(User);
585
589
 
586
590
  /**
587
591
  * @internal
@@ -847,6 +851,10 @@ var User = /*#__PURE__*/function (_ReplayEventEmitter) {
847
851
  log$6.debug(_this3.state.entityName + " (" + _this3.state.identity + ") itemUpdated: " + args.item.key);
848
852
  return _this3._update(args.item.key, args.item.data);
849
853
  });
854
+ map.on("itemAdded", function (args) {
855
+ log$6.debug(_this3.state.entityName + " (" + _this3.state.identity + ") itemAdded: " + args.item.key);
856
+ return _this3._update(args.item.key, args.item.data);
857
+ });
850
858
  return Promise.all([map.get("friendlyName").then(function (item) {
851
859
  return _this3._update(item.key, item.data);
852
860
  }), map.get("attributes").then(function (item) {
@@ -1076,11 +1084,11 @@ __decorate([declarativeTypeValidator.validateTypesAsync(json), __metadata("desig
1076
1084
 
1077
1085
  __decorate([declarativeTypeValidator.validateTypesAsync(["string"]), __metadata("design:type", Function), __metadata("design:paramtypes", [String]), __metadata("design:returntype", Promise)], User.prototype, "updateFriendlyName", null);
1078
1086
 
1079
- 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; } } }; }
1087
+ function _createForOfIteratorHelper$4(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray$4(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; } } }; }
1080
1088
 
1081
- 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); }
1089
+ function _unsupportedIterableToArray$4(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray$4(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$4(o, minLen); }
1082
1090
 
1083
- 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; }
1091
+ function _arrayLikeToArray$4(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; }
1084
1092
 
1085
1093
  var Network = /*#__PURE__*/function () {
1086
1094
  function Network(configuration, services) {
@@ -1101,7 +1109,7 @@ var Network = /*#__PURE__*/function () {
1101
1109
  }, {
1102
1110
  key: "cleanupCache",
1103
1111
  value: function cleanupCache() {
1104
- var _iterator = _createForOfIteratorHelper$3(this.cache),
1112
+ var _iterator = _createForOfIteratorHelper$4(this.cache),
1105
1113
  _step;
1106
1114
 
1107
1115
  try {
@@ -1245,9 +1253,9 @@ _defineProperty__default["default"](NotificationTypes, "REMOVED_FROM_CONVERSATIO
1245
1253
 
1246
1254
  _defineProperty__default["default"](NotificationTypes, "CONSUMPTION_UPDATE", "twilio.channel.consumption_update");
1247
1255
 
1248
- function _createSuper$7(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$7(); return function _createSuperInternal() { var Super = _getPrototypeOf__default["default"](Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf__default["default"](this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn__default["default"](this, result); }; }
1256
+ function _createSuper$8(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$8(); return function _createSuperInternal() { var Super = _getPrototypeOf__default["default"](Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf__default["default"](this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn__default["default"](this, result); }; }
1249
1257
 
1250
- 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; } }
1258
+ 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; } }
1251
1259
  var log$5 = Logger.scope("Participant");
1252
1260
  /**
1253
1261
  * A participant represents a remote client in a conversation.
@@ -1256,7 +1264,7 @@ var log$5 = Logger.scope("Participant");
1256
1264
  var Participant = /*#__PURE__*/function (_ReplayEventEmitter) {
1257
1265
  _inherits__default["default"](Participant, _ReplayEventEmitter);
1258
1266
 
1259
- var _super = _createSuper$7(Participant);
1267
+ var _super = _createSuper$8(Participant);
1260
1268
 
1261
1269
  /**
1262
1270
  * @internal
@@ -1628,9 +1636,9 @@ _defineProperty__default["default"](Participant, "updated", "updated");
1628
1636
 
1629
1637
  __decorate([declarativeTypeValidator.validateTypesAsync(json), __metadata("design:type", Function), __metadata("design:paramtypes", [Object]), __metadata("design:returntype", Promise)], Participant.prototype, "updateAttributes", null);
1630
1638
 
1631
- function _createSuper$6(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$6(); return function _createSuperInternal() { var Super = _getPrototypeOf__default["default"](Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf__default["default"](this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn__default["default"](this, result); }; }
1639
+ function _createSuper$7(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$7(); return function _createSuperInternal() { var Super = _getPrototypeOf__default["default"](Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf__default["default"](this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn__default["default"](this, result); }; }
1632
1640
 
1633
- 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; } }
1641
+ 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; } }
1634
1642
  var log$4 = Logger.scope("Participants");
1635
1643
  /**
1636
1644
  * @classdesc Represents the collection of participants for the conversation
@@ -1642,7 +1650,7 @@ var log$4 = Logger.scope("Participants");
1642
1650
  var Participants = /*#__PURE__*/function (_ReplayEventEmitter) {
1643
1651
  _inherits__default["default"](Participants, _ReplayEventEmitter);
1644
1652
 
1645
- var _super = _createSuper$6(Participants);
1653
+ var _super = _createSuper$7(Participants);
1646
1654
 
1647
1655
  function Participants(conversation, participants, links, configuration, services) {
1648
1656
  var _this;
@@ -2796,9 +2804,9 @@ function ownKeys$4(object, enumerableOnly) { var keys = Object.keys(object); if
2796
2804
 
2797
2805
  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__default["default"](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; }
2798
2806
 
2799
- function _createSuper$5(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$5(); return function _createSuperInternal() { var Super = _getPrototypeOf__default["default"](Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf__default["default"](this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn__default["default"](this, result); }; }
2807
+ function _createSuper$6(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$6(); return function _createSuperInternal() { var Super = _getPrototypeOf__default["default"](Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf__default["default"](this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn__default["default"](this, result); }; }
2800
2808
 
2801
- 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; } }
2809
+ 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; } }
2802
2810
  var log$3 = Logger.scope("Message");
2803
2811
 
2804
2812
  var XHR = // eslint-disable-next-line @typescript-eslint/no-var-requires
@@ -2811,7 +2819,7 @@ global["XMLHttpRequest"] || require("xmlhttprequest").XMLHttpRequest;
2811
2819
  var Message = /*#__PURE__*/function (_ReplayEventEmitter) {
2812
2820
  _inherits__default["default"](Message, _ReplayEventEmitter);
2813
2821
 
2814
- var _super = _createSuper$5(Message);
2822
+ var _super = _createSuper$6(Message);
2815
2823
 
2816
2824
  /**
2817
2825
  * Conversation that the message is in.
@@ -2821,7 +2829,7 @@ var Message = /*#__PURE__*/function (_ReplayEventEmitter) {
2821
2829
  * @internal
2822
2830
  */
2823
2831
  function Message(index, data, conversation, links, configuration, services) {
2824
- var _data$text, _data$lastUpdatedBy, _data$type, _data$memberSid;
2832
+ var _data$text, _data$lastUpdatedBy, _data$type, _data$memberSid, _data$channelMetadata;
2825
2833
 
2826
2834
  var _this;
2827
2835
 
@@ -2851,7 +2859,8 @@ var Message = /*#__PURE__*/function (_ReplayEventEmitter) {
2851
2859
  category: "media"
2852
2860
  }), _this.services)] : null,
2853
2861
  participantSid: (_data$memberSid = data.memberSid) !== null && _data$memberSid !== void 0 ? _data$memberSid : null,
2854
- aggregatedDeliveryReceipt: data.delivery ? new AggregatedDeliveryReceipt(data.delivery) : null
2862
+ aggregatedDeliveryReceipt: data.delivery ? new AggregatedDeliveryReceipt(data.delivery) : null,
2863
+ hasChannelMetadata: (_data$channelMetadata = data.channelMetadata) !== null && _data$channelMetadata !== void 0 ? _data$channelMetadata : false
2855
2864
  };
2856
2865
  return _this;
2857
2866
  }
@@ -3703,6 +3712,47 @@ var Message = /*#__PURE__*/function (_ReplayEventEmitter) {
3703
3712
  };
3704
3713
  }());
3705
3714
  }
3715
+ /**
3716
+ * Get the {@link ChannelMetadata} for this message. Resolves to `null` if
3717
+ * the message doesn't have any channel metadata.
3718
+ */
3719
+
3720
+ }, {
3721
+ key: "getChannelMetadata",
3722
+ value: function () {
3723
+ var _getChannelMetadata = _asyncToGenerator__default["default"]( /*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee10() {
3724
+ return _regeneratorRuntime__default["default"].wrap(function _callee10$(_context10) {
3725
+ while (1) {
3726
+ switch (_context10.prev = _context10.next) {
3727
+ case 0:
3728
+ if (this.state.hasChannelMetadata) {
3729
+ _context10.next = 2;
3730
+ break;
3731
+ }
3732
+
3733
+ return _context10.abrupt("return", null);
3734
+
3735
+ case 2:
3736
+ _context10.next = 4;
3737
+ return this.services.channelMetadataClient.getChannelMetadata(this.conversation.sid, this.sid);
3738
+
3739
+ case 4:
3740
+ return _context10.abrupt("return", _context10.sent);
3741
+
3742
+ case 5:
3743
+ case "end":
3744
+ return _context10.stop();
3745
+ }
3746
+ }
3747
+ }, _callee10, this);
3748
+ }));
3749
+
3750
+ function getChannelMetadata() {
3751
+ return _getChannelMetadata.apply(this, arguments);
3752
+ }
3753
+
3754
+ return getChannelMetadata;
3755
+ }()
3706
3756
  }]);
3707
3757
 
3708
3758
  return Message;
@@ -3730,15 +3780,15 @@ function ownKeys$3(object, enumerableOnly) { var keys = Object.keys(object); if
3730
3780
 
3731
3781
  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__default["default"](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; }
3732
3782
 
3733
- 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; } } }; }
3783
+ 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; } } }; }
3734
3784
 
3735
- 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); }
3785
+ 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); }
3736
3786
 
3737
- 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; }
3787
+ 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; }
3738
3788
 
3739
- function _createSuper$4(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$4(); return function _createSuperInternal() { var Super = _getPrototypeOf__default["default"](Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf__default["default"](this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn__default["default"](this, result); }; }
3789
+ function _createSuper$5(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$5(); return function _createSuperInternal() { var Super = _getPrototypeOf__default["default"](Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf__default["default"](this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn__default["default"](this, result); }; }
3740
3790
 
3741
- 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; } }
3791
+ 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; } }
3742
3792
  var log$2 = Logger.scope("Messages");
3743
3793
  /**
3744
3794
  * Represents the collection of messages in a conversation
@@ -3747,7 +3797,7 @@ var log$2 = Logger.scope("Messages");
3747
3797
  var Messages = /*#__PURE__*/function (_ReplayEventEmitter) {
3748
3798
  _inherits__default["default"](Messages, _ReplayEventEmitter);
3749
3799
 
3750
- var _super = _createSuper$4(Messages);
3800
+ var _super = _createSuper$5(Messages);
3751
3801
 
3752
3802
  function Messages(conversation, configuration, services) {
3753
3803
  var _this;
@@ -3942,7 +3992,7 @@ var Messages = /*#__PURE__*/function (_ReplayEventEmitter) {
3942
3992
  return request.cancel();
3943
3993
  });
3944
3994
  });
3945
- _iterator = _createForOfIteratorHelper$2(message.mediaContent);
3995
+ _iterator = _createForOfIteratorHelper$3(message.mediaContent);
3946
3996
  _context3.prev = 4;
3947
3997
 
3948
3998
  _iterator.s();
@@ -4595,15 +4645,15 @@ __decorate([declarativeTypeValidator.validateTypes("string", [declarativeTypeVal
4595
4645
 
4596
4646
  __decorate([declarativeTypeValidator.validateTypes([FormData, sendMediaOptions]), __metadata("design:type", Function), __metadata("design:paramtypes", [Object]), __metadata("design:returntype", MessageBuilder)], MessageBuilder.prototype, "addMedia", null);
4597
4647
 
4598
- 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; } } }; }
4648
+ 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; } } }; }
4599
4649
 
4600
- 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); }
4650
+ 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); }
4601
4651
 
4602
- 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; }
4652
+ 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; }
4603
4653
 
4604
- function _createSuper$3(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$3(); return function _createSuperInternal() { var Super = _getPrototypeOf__default["default"](Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf__default["default"](this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn__default["default"](this, result); }; }
4654
+ function _createSuper$4(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$4(); return function _createSuperInternal() { var Super = _getPrototypeOf__default["default"](Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf__default["default"](this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn__default["default"](this, result); }; }
4605
4655
 
4606
- 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; } }
4656
+ 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; } }
4607
4657
  /**
4608
4658
  * Map of the fields that will be processed with update messages.
4609
4659
  */
@@ -4631,7 +4681,7 @@ var fieldMappings = {
4631
4681
  var Conversation = /*#__PURE__*/function (_ReplayEventEmitter) {
4632
4682
  _inherits__default["default"](Conversation, _ReplayEventEmitter);
4633
4683
 
4634
- var _super = _createSuper$3(Conversation);
4684
+ var _super = _createSuper$4(Conversation);
4635
4685
 
4636
4686
  /**
4637
4687
  * Fired when a participant has joined the conversation.
@@ -6291,7 +6341,7 @@ var Conversation = /*#__PURE__*/function (_ReplayEventEmitter) {
6291
6341
  }, {
6292
6342
  key: "_onMessageAdded",
6293
6343
  value: function _onMessageAdded(message) {
6294
- var _iterator = _createForOfIteratorHelper$1(this._participants.values()),
6344
+ var _iterator = _createForOfIteratorHelper$2(this._participants.values()),
6295
6345
  _step;
6296
6346
 
6297
6347
  try {
@@ -6499,19 +6549,19 @@ var Deferred = /*#__PURE__*/function () {
6499
6549
  return Deferred;
6500
6550
  }();
6501
6551
 
6502
- 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; } } }; }
6552
+ 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; } } }; }
6503
6553
 
6504
- 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); }
6554
+ 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); }
6505
6555
 
6506
- 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; }
6556
+ 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; }
6507
6557
 
6508
6558
  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; }
6509
6559
 
6510
6560
  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__default["default"](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; }
6511
6561
 
6512
- function _createSuper$2(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$2(); return function _createSuperInternal() { var Super = _getPrototypeOf__default["default"](Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf__default["default"](this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn__default["default"](this, result); }; }
6562
+ function _createSuper$3(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$3(); return function _createSuperInternal() { var Super = _getPrototypeOf__default["default"](Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf__default["default"](this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn__default["default"](this, result); }; }
6513
6563
 
6514
- function _isNativeReflectConstruct$2() { 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; } }
6564
+ 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; } }
6515
6565
  var log$1 = Logger.scope("Conversations");
6516
6566
  /**
6517
6567
  * Represents conversations collection
@@ -6521,7 +6571,7 @@ var log$1 = Logger.scope("Conversations");
6521
6571
  var Conversations = /*#__PURE__*/function (_ReplayEventEmitter) {
6522
6572
  _inherits__default["default"](Conversations, _ReplayEventEmitter);
6523
6573
 
6524
- var _super = _createSuper$2(Conversations);
6574
+ var _super = _createSuper$3(Conversations);
6525
6575
 
6526
6576
  function Conversations(configuration, services) {
6527
6577
  var _this;
@@ -6683,7 +6733,7 @@ var Conversations = /*#__PURE__*/function (_ReplayEventEmitter) {
6683
6733
  case 9:
6684
6734
  myConversations = _context2.sent;
6685
6735
  upserts = [];
6686
- _iterator = _createForOfIteratorHelper(myConversations);
6736
+ _iterator = _createForOfIteratorHelper$1(myConversations);
6687
6737
 
6688
6738
  try {
6689
6739
  for (_iterator.s(); !(_step = _iterator.n()).done;) {
@@ -7308,9 +7358,9 @@ var Conversations = /*#__PURE__*/function (_ReplayEventEmitter) {
7308
7358
  return Conversations;
7309
7359
  }(replayEventEmitter.ReplayEventEmitter);
7310
7360
 
7311
- function _createSuper$1(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$1(); return function _createSuperInternal() { var Super = _getPrototypeOf__default["default"](Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf__default["default"](this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn__default["default"](this, result); }; }
7361
+ function _createSuper$2(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$2(); return function _createSuperInternal() { var Super = _getPrototypeOf__default["default"](Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf__default["default"](this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn__default["default"](this, result); }; }
7312
7362
 
7313
- 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; } }
7363
+ function _isNativeReflectConstruct$2() { 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; } }
7314
7364
  /**
7315
7365
  * Container for known users
7316
7366
  */
@@ -7318,7 +7368,7 @@ function _isNativeReflectConstruct$1() { if (typeof Reflect === "undefined" || !
7318
7368
  var Users = /*#__PURE__*/function (_ReplayEventEmitter) {
7319
7369
  _inherits__default["default"](Users, _ReplayEventEmitter);
7320
7370
 
7321
- var _super = _createSuper$1(Users);
7371
+ var _super = _createSuper$2(Users);
7322
7372
 
7323
7373
  function Users(myself, configuration, services) {
7324
7374
  var _this;
@@ -7765,12 +7815,16 @@ function PushNotification(data) {
7765
7815
  this.data = data.data || {};
7766
7816
  });
7767
7817
 
7768
- var version = "2.3.0";
7818
+ var version = "2.4.0-rc.0";
7769
7819
 
7770
7820
  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; }
7771
7821
 
7772
7822
  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__default["default"](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; }
7773
7823
 
7824
+ function _createSuper$1(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$1(); return function _createSuperInternal() { var Super = _getPrototypeOf__default["default"](Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf__default["default"](this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn__default["default"](this, result); }; }
7825
+
7826
+ 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; } }
7827
+
7774
7828
  var trimSlashes = function trimSlashes(url) {
7775
7829
  return url.replace(/(^\/+|\/+$)/g, "");
7776
7830
  };
@@ -7779,6 +7833,20 @@ var isMutationConflictResponse = function isMutationConflictResponse(response) {
7779
7833
  return response.status.code === 202;
7780
7834
  };
7781
7835
 
7836
+ var ChannelMetadataNotFoundError = /*#__PURE__*/function (_Error) {
7837
+ _inherits__default["default"](ChannelMetadataNotFoundError, _Error);
7838
+
7839
+ var _super = _createSuper$1(ChannelMetadataNotFoundError);
7840
+
7841
+ function ChannelMetadataNotFoundError(message) {
7842
+ _classCallCheck__default["default"](this, ChannelMetadataNotFoundError);
7843
+
7844
+ return _super.call(this, message);
7845
+ }
7846
+
7847
+ return _createClass__default["default"](ChannelMetadataNotFoundError);
7848
+ }( /*#__PURE__*/_wrapNativeSuper__default["default"](Error));
7849
+
7782
7850
  var CommandExecutor = /*#__PURE__*/function () {
7783
7851
  function CommandExecutor(_serviceUrl, _services, _productId) {
7784
7852
  _classCallCheck__default["default"](this, CommandExecutor);
@@ -7876,40 +7944,91 @@ var CommandExecutor = /*#__PURE__*/function () {
7876
7944
  }, {
7877
7945
  key: "fetchResource",
7878
7946
  value: function () {
7879
- var _fetchResource = _asyncToGenerator__default["default"]( /*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee2(url, requestBody) {
7947
+ var _fetchResource = _asyncToGenerator__default["default"]( /*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee3(url, requestBody) {
7880
7948
  var _this = this;
7881
7949
 
7882
- var maxAttemptsCount, result;
7883
- return _regeneratorRuntime__default["default"].wrap(function _callee2$(_context2) {
7950
+ var maxAttemptsCount, retrier, resolution;
7951
+ return _regeneratorRuntime__default["default"].wrap(function _callee3$(_context3) {
7884
7952
  while (1) {
7885
- switch (_context2.prev = _context2.next) {
7953
+ switch (_context3.prev = _context3.next) {
7886
7954
  case 0:
7887
7955
  maxAttemptsCount = 6;
7888
- _context2.prev = 1;
7889
- _context2.next = 4;
7890
- return new operationRetrier.AsyncRetrier({
7956
+ retrier = new operationRetrier.AsyncRetrier({
7891
7957
  min: 50,
7892
7958
  max: 1600,
7893
7959
  maxAttemptsCount: maxAttemptsCount
7894
- }).run(function () {
7895
- return _this._makeRequest("get", url, requestBody);
7896
7960
  });
7961
+ _context3.prev = 2;
7962
+ _context3.next = 5;
7963
+ return retrier.run( /*#__PURE__*/_asyncToGenerator__default["default"]( /*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee2() {
7964
+ var response, _e$body, _e$body2;
7965
+
7966
+ return _regeneratorRuntime__default["default"].wrap(function _callee2$(_context2) {
7967
+ while (1) {
7968
+ switch (_context2.prev = _context2.next) {
7969
+ case 0:
7970
+ _context2.prev = 0;
7971
+ _context2.next = 3;
7972
+ return _this._makeRequest("get", url, requestBody);
7973
+
7974
+ case 3:
7975
+ response = _context2.sent;
7976
+ return _context2.abrupt("return", {
7977
+ type: "success",
7978
+ data: response.body
7979
+ });
7980
+
7981
+ case 7:
7982
+ _context2.prev = 7;
7983
+ _context2.t0 = _context2["catch"](0);
7984
+
7985
+ 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)) {
7986
+ _context2.next = 11;
7987
+ break;
7988
+ }
7989
+
7990
+ return _context2.abrupt("return", {
7991
+ type: "noMetadata"
7992
+ });
7993
+
7994
+ case 11:
7995
+ throw _context2.t0;
7996
+
7997
+ case 12:
7998
+ case "end":
7999
+ return _context2.stop();
8000
+ }
8001
+ }
8002
+ }, _callee2, null, [[0, 7]]);
8003
+ })));
7897
8004
 
7898
- case 4:
7899
- result = _context2.sent;
7900
- return _context2.abrupt("return", result.body);
8005
+ case 5:
8006
+ resolution = _context3.sent;
8007
+ _context3.next = 11;
8008
+ break;
7901
8009
 
7902
8010
  case 8:
7903
- _context2.prev = 8;
7904
- _context2.t0 = _context2["catch"](1);
8011
+ _context3.prev = 8;
8012
+ _context3.t0 = _context3["catch"](2);
7905
8013
  throw new Error("Fetch resource from \"".concat(url, "\" failed."));
7906
8014
 
7907
8015
  case 11:
8016
+ if (!(resolution.type === "noMetadata")) {
8017
+ _context3.next = 13;
8018
+ break;
8019
+ }
8020
+
8021
+ throw new ChannelMetadataNotFoundError("No metadata found.");
8022
+
8023
+ case 13:
8024
+ return _context3.abrupt("return", resolution.data);
8025
+
8026
+ case 14:
7908
8027
  case "end":
7909
- return _context2.stop();
8028
+ return _context3.stop();
7910
8029
  }
7911
8030
  }
7912
- }, _callee2, null, [[1, 8]]);
8031
+ }, _callee3, null, [[2, 8]]);
7913
8032
  }));
7914
8033
 
7915
8034
  function fetchResource(_x5, _x6) {
@@ -7921,40 +8040,40 @@ var CommandExecutor = /*#__PURE__*/function () {
7921
8040
  }, {
7922
8041
  key: "mutateResource",
7923
8042
  value: function () {
7924
- var _mutateResource = _asyncToGenerator__default["default"]( /*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee3(method, url, requestBody) {
8043
+ var _mutateResource = _asyncToGenerator__default["default"]( /*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee4(method, url, requestBody) {
7925
8044
  var result;
7926
- return _regeneratorRuntime__default["default"].wrap(function _callee3$(_context3) {
8045
+ return _regeneratorRuntime__default["default"].wrap(function _callee4$(_context4) {
7927
8046
  while (1) {
7928
- switch (_context3.prev = _context3.next) {
8047
+ switch (_context4.prev = _context4.next) {
7929
8048
  case 0:
7930
- _context3.next = 2;
8049
+ _context4.next = 2;
7931
8050
  return this._makeRequest(method, url, requestBody, {
7932
8051
  "X-Twilio-Mutation-Id": uuid.v4()
7933
8052
  });
7934
8053
 
7935
8054
  case 2:
7936
- result = _context3.sent;
8055
+ result = _context4.sent;
7937
8056
 
7938
8057
  if (!isMutationConflictResponse(result)) {
7939
- _context3.next = 7;
8058
+ _context4.next = 7;
7940
8059
  break;
7941
8060
  }
7942
8061
 
7943
- _context3.next = 6;
8062
+ _context4.next = 6;
7944
8063
  return this.fetchResource(result.body.resource_url);
7945
8064
 
7946
8065
  case 6:
7947
- return _context3.abrupt("return", _context3.sent);
8066
+ return _context4.abrupt("return", _context4.sent);
7948
8067
 
7949
8068
  case 7:
7950
- return _context3.abrupt("return", result.body);
8069
+ return _context4.abrupt("return", result.body);
7951
8070
 
7952
8071
  case 8:
7953
8072
  case "end":
7954
- return _context3.stop();
8073
+ return _context4.stop();
7955
8074
  }
7956
8075
  }
7957
- }, _callee3, this);
8076
+ }, _callee4, this);
7958
8077
  }));
7959
8078
 
7960
8079
  function mutateResource(_x7, _x8, _x9) {
@@ -8097,6 +8216,448 @@ var ContentClient = /*#__PURE__*/function () {
8097
8216
  return ContentClient;
8098
8217
  }();
8099
8218
 
8219
+ 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; } } }; }
8220
+
8221
+ 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); }
8222
+
8223
+ 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; }
8224
+
8225
+ var QuickLRU = /*#__PURE__*/function (_Symbol$iterator) {
8226
+ function QuickLRU() {
8227
+ var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
8228
+
8229
+ _classCallCheck__default["default"](this, QuickLRU);
8230
+
8231
+ if (!(options.maxSize && options.maxSize > 0)) {
8232
+ throw new TypeError('`maxSize` must be a number greater than 0');
8233
+ }
8234
+
8235
+ this.maxSize = options.maxSize;
8236
+ this.onEviction = options.onEviction;
8237
+ this.cache = new Map();
8238
+ this.oldCache = new Map();
8239
+ this._size = 0;
8240
+ }
8241
+
8242
+ _createClass__default["default"](QuickLRU, [{
8243
+ key: "_set",
8244
+ value: function _set(key, value) {
8245
+ this.cache.set(key, value);
8246
+ this._size++;
8247
+
8248
+ if (this._size >= this.maxSize) {
8249
+ this._size = 0;
8250
+
8251
+ if (typeof this.onEviction === 'function') {
8252
+ var _iterator = _createForOfIteratorHelper(this.oldCache.entries()),
8253
+ _step;
8254
+
8255
+ try {
8256
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
8257
+ var _step$value = _slicedToArray__default["default"](_step.value, 2),
8258
+ _key = _step$value[0],
8259
+ _value = _step$value[1];
8260
+
8261
+ this.onEviction(_key, _value);
8262
+ }
8263
+ } catch (err) {
8264
+ _iterator.e(err);
8265
+ } finally {
8266
+ _iterator.f();
8267
+ }
8268
+ }
8269
+
8270
+ this.oldCache = this.cache;
8271
+ this.cache = new Map();
8272
+ }
8273
+ }
8274
+ }, {
8275
+ key: "get",
8276
+ value: function get(key) {
8277
+ if (this.cache.has(key)) {
8278
+ return this.cache.get(key);
8279
+ }
8280
+
8281
+ if (this.oldCache.has(key)) {
8282
+ var value = this.oldCache.get(key);
8283
+ this.oldCache.delete(key);
8284
+
8285
+ this._set(key, value);
8286
+
8287
+ return value;
8288
+ }
8289
+ }
8290
+ }, {
8291
+ key: "set",
8292
+ value: function set(key, value) {
8293
+ if (this.cache.has(key)) {
8294
+ this.cache.set(key, value);
8295
+ } else {
8296
+ this._set(key, value);
8297
+ }
8298
+
8299
+ return this;
8300
+ }
8301
+ }, {
8302
+ key: "has",
8303
+ value: function has(key) {
8304
+ return this.cache.has(key) || this.oldCache.has(key);
8305
+ }
8306
+ }, {
8307
+ key: "peek",
8308
+ value: function peek(key) {
8309
+ if (this.cache.has(key)) {
8310
+ return this.cache.get(key);
8311
+ }
8312
+
8313
+ if (this.oldCache.has(key)) {
8314
+ return this.oldCache.get(key);
8315
+ }
8316
+ }
8317
+ }, {
8318
+ key: "delete",
8319
+ value: function _delete(key) {
8320
+ var deleted = this.cache.delete(key);
8321
+
8322
+ if (deleted) {
8323
+ this._size--;
8324
+ }
8325
+
8326
+ return this.oldCache.delete(key) || deleted;
8327
+ }
8328
+ }, {
8329
+ key: "clear",
8330
+ value: function clear() {
8331
+ this.cache.clear();
8332
+ this.oldCache.clear();
8333
+ this._size = 0;
8334
+ }
8335
+ }, {
8336
+ key: "keys",
8337
+ value: /*#__PURE__*/_regeneratorRuntime__default["default"].mark(function keys() {
8338
+ var _iterator2, _step2, _step2$value, key;
8339
+
8340
+ return _regeneratorRuntime__default["default"].wrap(function keys$(_context) {
8341
+ while (1) {
8342
+ switch (_context.prev = _context.next) {
8343
+ case 0:
8344
+ _iterator2 = _createForOfIteratorHelper(this);
8345
+ _context.prev = 1;
8346
+
8347
+ _iterator2.s();
8348
+
8349
+ case 3:
8350
+ if ((_step2 = _iterator2.n()).done) {
8351
+ _context.next = 9;
8352
+ break;
8353
+ }
8354
+
8355
+ _step2$value = _slicedToArray__default["default"](_step2.value, 1), key = _step2$value[0];
8356
+ _context.next = 7;
8357
+ return key;
8358
+
8359
+ case 7:
8360
+ _context.next = 3;
8361
+ break;
8362
+
8363
+ case 9:
8364
+ _context.next = 14;
8365
+ break;
8366
+
8367
+ case 11:
8368
+ _context.prev = 11;
8369
+ _context.t0 = _context["catch"](1);
8370
+
8371
+ _iterator2.e(_context.t0);
8372
+
8373
+ case 14:
8374
+ _context.prev = 14;
8375
+
8376
+ _iterator2.f();
8377
+
8378
+ return _context.finish(14);
8379
+
8380
+ case 17:
8381
+ case "end":
8382
+ return _context.stop();
8383
+ }
8384
+ }
8385
+ }, keys, this, [[1, 11, 14, 17]]);
8386
+ })
8387
+ }, {
8388
+ key: "values",
8389
+ value: /*#__PURE__*/_regeneratorRuntime__default["default"].mark(function values() {
8390
+ var _iterator3, _step3, _step3$value, value;
8391
+
8392
+ return _regeneratorRuntime__default["default"].wrap(function values$(_context2) {
8393
+ while (1) {
8394
+ switch (_context2.prev = _context2.next) {
8395
+ case 0:
8396
+ _iterator3 = _createForOfIteratorHelper(this);
8397
+ _context2.prev = 1;
8398
+
8399
+ _iterator3.s();
8400
+
8401
+ case 3:
8402
+ if ((_step3 = _iterator3.n()).done) {
8403
+ _context2.next = 9;
8404
+ break;
8405
+ }
8406
+
8407
+ _step3$value = _slicedToArray__default["default"](_step3.value, 2), value = _step3$value[1];
8408
+ _context2.next = 7;
8409
+ return value;
8410
+
8411
+ case 7:
8412
+ _context2.next = 3;
8413
+ break;
8414
+
8415
+ case 9:
8416
+ _context2.next = 14;
8417
+ break;
8418
+
8419
+ case 11:
8420
+ _context2.prev = 11;
8421
+ _context2.t0 = _context2["catch"](1);
8422
+
8423
+ _iterator3.e(_context2.t0);
8424
+
8425
+ case 14:
8426
+ _context2.prev = 14;
8427
+
8428
+ _iterator3.f();
8429
+
8430
+ return _context2.finish(14);
8431
+
8432
+ case 17:
8433
+ case "end":
8434
+ return _context2.stop();
8435
+ }
8436
+ }
8437
+ }, values, this, [[1, 11, 14, 17]]);
8438
+ })
8439
+ }, {
8440
+ key: _Symbol$iterator,
8441
+ value: /*#__PURE__*/_regeneratorRuntime__default["default"].mark(function value() {
8442
+ var _iterator4, _step4, item, _iterator5, _step5, _item, _item2, key;
8443
+
8444
+ return _regeneratorRuntime__default["default"].wrap(function value$(_context3) {
8445
+ while (1) {
8446
+ switch (_context3.prev = _context3.next) {
8447
+ case 0:
8448
+ _iterator4 = _createForOfIteratorHelper(this.cache);
8449
+ _context3.prev = 1;
8450
+
8451
+ _iterator4.s();
8452
+
8453
+ case 3:
8454
+ if ((_step4 = _iterator4.n()).done) {
8455
+ _context3.next = 9;
8456
+ break;
8457
+ }
8458
+
8459
+ item = _step4.value;
8460
+ _context3.next = 7;
8461
+ return item;
8462
+
8463
+ case 7:
8464
+ _context3.next = 3;
8465
+ break;
8466
+
8467
+ case 9:
8468
+ _context3.next = 14;
8469
+ break;
8470
+
8471
+ case 11:
8472
+ _context3.prev = 11;
8473
+ _context3.t0 = _context3["catch"](1);
8474
+
8475
+ _iterator4.e(_context3.t0);
8476
+
8477
+ case 14:
8478
+ _context3.prev = 14;
8479
+
8480
+ _iterator4.f();
8481
+
8482
+ return _context3.finish(14);
8483
+
8484
+ case 17:
8485
+ _iterator5 = _createForOfIteratorHelper(this.oldCache);
8486
+ _context3.prev = 18;
8487
+
8488
+ _iterator5.s();
8489
+
8490
+ case 20:
8491
+ if ((_step5 = _iterator5.n()).done) {
8492
+ _context3.next = 28;
8493
+ break;
8494
+ }
8495
+
8496
+ _item = _step5.value;
8497
+ _item2 = _slicedToArray__default["default"](_item, 1), key = _item2[0];
8498
+
8499
+ if (this.cache.has(key)) {
8500
+ _context3.next = 26;
8501
+ break;
8502
+ }
8503
+
8504
+ _context3.next = 26;
8505
+ return _item;
8506
+
8507
+ case 26:
8508
+ _context3.next = 20;
8509
+ break;
8510
+
8511
+ case 28:
8512
+ _context3.next = 33;
8513
+ break;
8514
+
8515
+ case 30:
8516
+ _context3.prev = 30;
8517
+ _context3.t1 = _context3["catch"](18);
8518
+
8519
+ _iterator5.e(_context3.t1);
8520
+
8521
+ case 33:
8522
+ _context3.prev = 33;
8523
+
8524
+ _iterator5.f();
8525
+
8526
+ return _context3.finish(33);
8527
+
8528
+ case 36:
8529
+ case "end":
8530
+ return _context3.stop();
8531
+ }
8532
+ }
8533
+ }, value, this, [[1, 11, 14, 17], [18, 30, 33, 36]]);
8534
+ })
8535
+ }, {
8536
+ key: "size",
8537
+ get: function get() {
8538
+ var oldCacheSize = 0;
8539
+
8540
+ var _iterator6 = _createForOfIteratorHelper(this.oldCache.keys()),
8541
+ _step6;
8542
+
8543
+ try {
8544
+ for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
8545
+ var key = _step6.value;
8546
+
8547
+ if (!this.cache.has(key)) {
8548
+ oldCacheSize++;
8549
+ }
8550
+ }
8551
+ } catch (err) {
8552
+ _iterator6.e(err);
8553
+ } finally {
8554
+ _iterator6.f();
8555
+ }
8556
+
8557
+ return Math.min(this._size + oldCacheSize, this.maxSize);
8558
+ }
8559
+ }]);
8560
+
8561
+ return QuickLRU;
8562
+ }(Symbol.iterator);
8563
+
8564
+ var quickLru = QuickLRU;
8565
+
8566
+ var ChannelMetadata = /*#__PURE__*/_createClass__default["default"](function ChannelMetadata(type, data) {
8567
+ _classCallCheck__default["default"](this, ChannelMetadata);
8568
+
8569
+ this.type = type;
8570
+ this.data = data;
8571
+ Object.freeze(data);
8572
+ });
8573
+
8574
+ var ChannelMetadataClient = /*#__PURE__*/function () {
8575
+ function ChannelMetadataClient(services, configuration) {
8576
+ _classCallCheck__default["default"](this, ChannelMetadataClient);
8577
+
8578
+ this._services = services;
8579
+ this._configuration = configuration;
8580
+ this._cache = new quickLru({
8581
+ maxSize: configuration.channelMetadataCacheCapacity
8582
+ });
8583
+ }
8584
+
8585
+ _createClass__default["default"](ChannelMetadataClient, [{
8586
+ key: "getChannelMetadata",
8587
+ value: function () {
8588
+ var _getChannelMetadata = _asyncToGenerator__default["default"]( /*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee(conversationSid, messageSid) {
8589
+ var key, cachedItem, url, metadataResponse, metadata;
8590
+ return _regeneratorRuntime__default["default"].wrap(function _callee$(_context) {
8591
+ while (1) {
8592
+ switch (_context.prev = _context.next) {
8593
+ case 0:
8594
+ key = "".concat(conversationSid, ",").concat(messageSid);
8595
+ cachedItem = this._cache.get(key);
8596
+
8597
+ if (!cachedItem) {
8598
+ _context.next = 4;
8599
+ break;
8600
+ }
8601
+
8602
+ return _context.abrupt("return", cachedItem.item);
8603
+
8604
+ case 4:
8605
+ url = "".concat(this._configuration.links.conversations, "/").concat(conversationSid, "/Messages/").concat(messageSid, "/ChannelMetadata");
8606
+ _context.prev = 5;
8607
+ _context.next = 8;
8608
+ return this._services.commandExecutor.fetchResource(url);
8609
+
8610
+ case 8:
8611
+ metadataResponse = _context.sent;
8612
+ _context.next = 17;
8613
+ break;
8614
+
8615
+ case 11:
8616
+ _context.prev = 11;
8617
+ _context.t0 = _context["catch"](5);
8618
+
8619
+ if (!(_context.t0 instanceof ChannelMetadataNotFoundError)) {
8620
+ _context.next = 16;
8621
+ break;
8622
+ }
8623
+
8624
+ this._cache.set(key, {
8625
+ item: null
8626
+ });
8627
+
8628
+ return _context.abrupt("return", null);
8629
+
8630
+ case 16:
8631
+ throw new Error(_context.t0);
8632
+
8633
+ case 17:
8634
+ metadata = new ChannelMetadata(metadataResponse.type, metadataResponse.data);
8635
+
8636
+ this._cache.set(key, {
8637
+ item: metadata
8638
+ });
8639
+
8640
+ return _context.abrupt("return", metadata);
8641
+
8642
+ case 20:
8643
+ case "end":
8644
+ return _context.stop();
8645
+ }
8646
+ }
8647
+ }, _callee, this, [[5, 11]]);
8648
+ }));
8649
+
8650
+ function getChannelMetadata(_x, _x2) {
8651
+ return _getChannelMetadata.apply(this, arguments);
8652
+ }
8653
+
8654
+ return getChannelMetadata;
8655
+ }()
8656
+ }]);
8657
+
8658
+ return ChannelMetadataClient;
8659
+ }();
8660
+
8100
8661
  var _class;
8101
8662
 
8102
8663
  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; }
@@ -9317,6 +9878,7 @@ exports.Client = Client_1 = (_class = /*#__PURE__*/function (_ReplayEventEmitter
9317
9878
  case 2:
9318
9879
  configurationResponse = _context17.sent;
9319
9880
  this._configuration = new Configuration(this._options, configurationResponse, Client_1._logger);
9881
+ this._services.channelMetadataClient = new ChannelMetadataClient(this._services, this._configuration);
9320
9882
 
9321
9883
  this._myself._resolveInitialization(this._configuration, this._configuration.userIdentity, this._configuration.userInfo, true);
9322
9884
 
@@ -9395,10 +9957,10 @@ exports.Client = Client_1 = (_class = /*#__PURE__*/function (_ReplayEventEmitter
9395
9957
  }).catch(function (error) {
9396
9958
  throw error;
9397
9959
  });
9398
- _context17.next = 28;
9960
+ _context17.next = 29;
9399
9961
  return this._services.users.myself._ensureFetched();
9400
9962
 
9401
- case 28:
9963
+ case 29:
9402
9964
  Client_1._supportedPushChannels.forEach(function (channelType) {
9403
9965
  return _this3._subscribeToPushNotifications(channelType);
9404
9966
  });
@@ -9414,7 +9976,7 @@ exports.Client = Client_1 = (_class = /*#__PURE__*/function (_ReplayEventEmitter
9414
9976
  this.emit("stateChanged", "initialized");
9415
9977
  this.emit("initialized");
9416
9978
 
9417
- case 34:
9979
+ case 35:
9418
9980
  case "end":
9419
9981
  return _context17.stop();
9420
9982
  }