@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/browser.js +636 -74
- package/builds/browser.js.map +1 -1
- package/builds/lib.d.ts +29 -0
- package/builds/lib.js +636 -74
- package/builds/lib.js.map +1 -1
- package/builds/twilio-conversations.js +735 -107
- 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/dist/user.js +8 -0
- package/dist/user.js.map +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 +8 -7
@@ -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
|
@@ -9732,6 +9734,10 @@ this.Twilio.Conversations = (function (exports) {
|
|
9732
9734
|
log$9.debug(_this3.state.entityName + " (" + _this3.state.identity + ") itemUpdated: " + args.item.key);
|
9733
9735
|
return _this3._update(args.item.key, args.item.data);
|
9734
9736
|
});
|
9737
|
+
map.on("itemAdded", function (args) {
|
9738
|
+
log$9.debug(_this3.state.entityName + " (" + _this3.state.identity + ") itemAdded: " + args.item.key);
|
9739
|
+
return _this3._update(args.item.key, args.item.data);
|
9740
|
+
});
|
9735
9741
|
return Promise.all([map.get("friendlyName").then(function (item) {
|
9736
9742
|
return _this3._update(item.key, item.data);
|
9737
9743
|
}), map.get("attributes").then(function (item) {
|
@@ -11170,8 +11176,8 @@ this.Twilio.Conversations = (function (exports) {
|
|
11170
11176
|
return AsyncRetrier;
|
11171
11177
|
}(EventEmitter$1);
|
11172
11178
|
|
11173
|
-
function _createSuper$
|
11174
|
-
var hasNativeReflectConstruct = _isNativeReflectConstruct$
|
11179
|
+
function _createSuper$a(Derived) {
|
11180
|
+
var hasNativeReflectConstruct = _isNativeReflectConstruct$b();
|
11175
11181
|
|
11176
11182
|
return function _createSuperInternal() {
|
11177
11183
|
var Super = _getPrototypeOf__default$1["default"](Derived),
|
@@ -11189,7 +11195,7 @@ this.Twilio.Conversations = (function (exports) {
|
|
11189
11195
|
};
|
11190
11196
|
}
|
11191
11197
|
|
11192
|
-
function _isNativeReflectConstruct$
|
11198
|
+
function _isNativeReflectConstruct$b() {
|
11193
11199
|
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
11194
11200
|
if (Reflect.construct.sham) return false;
|
11195
11201
|
if (typeof Proxy === "function") return true;
|
@@ -11209,7 +11215,7 @@ this.Twilio.Conversations = (function (exports) {
|
|
11209
11215
|
var Backoff = /*#__PURE__*/function (_EventEmitter) {
|
11210
11216
|
_inherits__default$1["default"](Backoff, _EventEmitter);
|
11211
11217
|
|
11212
|
-
var _super = _createSuper$
|
11218
|
+
var _super = _createSuper$a(Backoff);
|
11213
11219
|
|
11214
11220
|
function Backoff(options) {
|
11215
11221
|
var _this;
|
@@ -21822,7 +21828,7 @@ this.Twilio.Conversations = (function (exports) {
|
|
21822
21828
|
var _typeof = _typeof$2.exports;
|
21823
21829
|
var declarativeTypeValidator = browser$7;
|
21824
21830
|
var twilsock = browser$4;
|
21825
|
-
var _wrapNativeSuper = wrapNativeSuper.exports;
|
21831
|
+
var _wrapNativeSuper$1 = wrapNativeSuper.exports;
|
21826
21832
|
var loglevelLog = loglevel.exports;
|
21827
21833
|
var _slicedToArray = slicedToArray.exports;
|
21828
21834
|
var operationRetrier = browser$5;
|
@@ -21878,7 +21884,7 @@ this.Twilio.Conversations = (function (exports) {
|
|
21878
21884
|
|
21879
21885
|
var _typeof__default = /*#__PURE__*/_interopDefaultLegacy$2(_typeof);
|
21880
21886
|
|
21881
|
-
var _wrapNativeSuper__default = /*#__PURE__*/_interopDefaultLegacy$2(_wrapNativeSuper);
|
21887
|
+
var _wrapNativeSuper__default = /*#__PURE__*/_interopDefaultLegacy$2(_wrapNativeSuper$1);
|
21882
21888
|
|
21883
21889
|
var loglevelLog__namespace = /*#__PURE__*/_interopNamespace$1(loglevelLog);
|
21884
21890
|
|
@@ -22650,11 +22656,11 @@ this.Twilio.Conversations = (function (exports) {
|
|
22650
22656
|
return Configuration;
|
22651
22657
|
}();
|
22652
22658
|
|
22653
|
-
function _createForOfIteratorHelper$3(o, allowArrayLike) {
|
22659
|
+
function _createForOfIteratorHelper$3$1(o, allowArrayLike) {
|
22654
22660
|
var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
|
22655
22661
|
|
22656
22662
|
if (!it) {
|
22657
|
-
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") {
|
22658
22664
|
if (it) o = it;
|
22659
22665
|
var i = 0;
|
22660
22666
|
|
@@ -22707,16 +22713,16 @@ this.Twilio.Conversations = (function (exports) {
|
|
22707
22713
|
};
|
22708
22714
|
}
|
22709
22715
|
|
22710
|
-
function _unsupportedIterableToArray$3(o, minLen) {
|
22716
|
+
function _unsupportedIterableToArray$3$1(o, minLen) {
|
22711
22717
|
if (!o) return;
|
22712
|
-
if (typeof o === "string") return _arrayLikeToArray$3(o, minLen);
|
22718
|
+
if (typeof o === "string") return _arrayLikeToArray$3$1(o, minLen);
|
22713
22719
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
22714
22720
|
if (n === "Object" && o.constructor) n = o.constructor.name;
|
22715
22721
|
if (n === "Map" || n === "Set") return Array.from(o);
|
22716
|
-
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);
|
22717
22723
|
}
|
22718
22724
|
|
22719
|
-
function _arrayLikeToArray$3(arr, len) {
|
22725
|
+
function _arrayLikeToArray$3$1(arr, len) {
|
22720
22726
|
if (len == null || len > arr.length) len = arr.length;
|
22721
22727
|
|
22722
22728
|
for (var i = 0, arr2 = new Array(len); i < len; i++) {
|
@@ -22891,7 +22897,7 @@ this.Twilio.Conversations = (function (exports) {
|
|
22891
22897
|
function subtract(these, those, action, limit) {
|
22892
22898
|
var result = [];
|
22893
22899
|
|
22894
|
-
var _iterator = _createForOfIteratorHelper$3(these),
|
22900
|
+
var _iterator = _createForOfIteratorHelper$3$1(these),
|
22895
22901
|
_step;
|
22896
22902
|
|
22897
22903
|
try {
|
@@ -22972,7 +22978,7 @@ this.Twilio.Conversations = (function (exports) {
|
|
22972
22978
|
// Keeping in mind that events may begin flowing _before_ we receive the response
|
22973
22979
|
requests = this.processLocalActions(action, requests);
|
22974
22980
|
correlationId = new Date().getTime();
|
22975
|
-
_iterator2 = _createForOfIteratorHelper$3(requests);
|
22981
|
+
_iterator2 = _createForOfIteratorHelper$3$1(requests);
|
22976
22982
|
|
22977
22983
|
try {
|
22978
22984
|
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
@@ -23039,7 +23045,7 @@ this.Twilio.Conversations = (function (exports) {
|
|
23039
23045
|
case 21:
|
23040
23046
|
_context.prev = 21;
|
23041
23047
|
_context.t0 = _context["catch"](10);
|
23042
|
-
_iterator3 = _createForOfIteratorHelper$3(requests);
|
23048
|
+
_iterator3 = _createForOfIteratorHelper$3$1(requests);
|
23043
23049
|
|
23044
23050
|
try {
|
23045
23051
|
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
@@ -23242,7 +23248,7 @@ this.Twilio.Conversations = (function (exports) {
|
|
23242
23248
|
this.latestPokeResponseArrivalTimestampByCorrelationId.set(correlationId, new Date().getTime());
|
23243
23249
|
}
|
23244
23250
|
|
23245
|
-
var _iterator4 = _createForOfIteratorHelper$3(events),
|
23251
|
+
var _iterator4 = _createForOfIteratorHelper$3$1(events),
|
23246
23252
|
_step4;
|
23247
23253
|
|
23248
23254
|
try {
|
@@ -23439,7 +23445,7 @@ this.Twilio.Conversations = (function (exports) {
|
|
23439
23445
|
|
23440
23446
|
var failedSubscriptions = [];
|
23441
23447
|
|
23442
|
-
var _iterator5 = _createForOfIteratorHelper$3(this.persisted.values()),
|
23448
|
+
var _iterator5 = _createForOfIteratorHelper$3$1(this.persisted.values()),
|
23443
23449
|
_step5;
|
23444
23450
|
|
23445
23451
|
try {
|
@@ -30640,8 +30646,8 @@ this.Twilio.Conversations = (function (exports) {
|
|
30640
30646
|
|
30641
30647
|
var version$1 = "3.1.0";
|
30642
30648
|
|
30643
|
-
function _createSuper$
|
30644
|
-
var hasNativeReflectConstruct = _isNativeReflectConstruct$
|
30649
|
+
function _createSuper$9(Derived) {
|
30650
|
+
var hasNativeReflectConstruct = _isNativeReflectConstruct$a();
|
30645
30651
|
|
30646
30652
|
return function _createSuperInternal() {
|
30647
30653
|
var Super = _getPrototypeOf__default['default'](Derived),
|
@@ -30659,7 +30665,7 @@ this.Twilio.Conversations = (function (exports) {
|
|
30659
30665
|
};
|
30660
30666
|
}
|
30661
30667
|
|
30662
|
-
function _isNativeReflectConstruct$
|
30668
|
+
function _isNativeReflectConstruct$a() {
|
30663
30669
|
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
30664
30670
|
if (Reflect.construct.sham) return false;
|
30665
30671
|
if (typeof Proxy === "function") return true;
|
@@ -30752,7 +30758,7 @@ this.Twilio.Conversations = (function (exports) {
|
|
30752
30758
|
var Client = /*#__PURE__*/function (_EventEmitter) {
|
30753
30759
|
_inherits__default['default'](Client, _EventEmitter);
|
30754
30760
|
|
30755
|
-
var _super = _createSuper$
|
30761
|
+
var _super = _createSuper$9(Client);
|
30756
30762
|
/**
|
30757
30763
|
* @param fpaToken Twilio access token.
|
30758
30764
|
* @param options Options to customize the client.
|
@@ -34861,7 +34867,7 @@ this.Twilio.Conversations = (function (exports) {
|
|
34861
34867
|
return Network;
|
34862
34868
|
}();
|
34863
34869
|
|
34864
|
-
var version = "0.6.
|
34870
|
+
var version = "0.6.5-rc.0";
|
34865
34871
|
|
34866
34872
|
var _class;
|
34867
34873
|
|
@@ -35252,9 +35258,9 @@ this.Twilio.Conversations = (function (exports) {
|
|
35252
35258
|
|
35253
35259
|
setSpecies(ARRAY_BUFFER);
|
35254
35260
|
|
35255
|
-
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); }; }
|
35256
35262
|
|
35257
|
-
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; } }
|
35258
35264
|
var log$6 = Logger.scope("Participant");
|
35259
35265
|
/**
|
35260
35266
|
* A participant represents a remote client in a conversation.
|
@@ -35263,7 +35269,7 @@ this.Twilio.Conversations = (function (exports) {
|
|
35263
35269
|
var Participant = /*#__PURE__*/function (_ReplayEventEmitter) {
|
35264
35270
|
_inherits$4(Participant, _ReplayEventEmitter);
|
35265
35271
|
|
35266
|
-
var _super = _createSuper$
|
35272
|
+
var _super = _createSuper$8(Participant);
|
35267
35273
|
|
35268
35274
|
/**
|
35269
35275
|
* @internal
|
@@ -35635,9 +35641,9 @@ this.Twilio.Conversations = (function (exports) {
|
|
35635
35641
|
|
35636
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);
|
35637
35643
|
|
35638
|
-
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); }; }
|
35639
35645
|
|
35640
|
-
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; } }
|
35641
35647
|
var log$5 = Logger.scope("Participants");
|
35642
35648
|
/**
|
35643
35649
|
* @classdesc Represents the collection of participants for the conversation
|
@@ -35649,7 +35655,7 @@ this.Twilio.Conversations = (function (exports) {
|
|
35649
35655
|
var Participants = /*#__PURE__*/function (_ReplayEventEmitter) {
|
35650
35656
|
_inherits$4(Participants, _ReplayEventEmitter);
|
35651
35657
|
|
35652
|
-
var _super = _createSuper$
|
35658
|
+
var _super = _createSuper$7(Participants);
|
35653
35659
|
|
35654
35660
|
function Participants(conversation, participants, links, configuration, services) {
|
35655
35661
|
var _this;
|
@@ -36976,9 +36982,9 @@ this.Twilio.Conversations = (function (exports) {
|
|
36976
36982
|
|
36977
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; }
|
36978
36984
|
|
36979
|
-
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); }; }
|
36980
36986
|
|
36981
|
-
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; } }
|
36982
36988
|
var log$3 = Logger.scope("Message");
|
36983
36989
|
|
36984
36990
|
var XHR = // eslint-disable-next-line @typescript-eslint/no-var-requires
|
@@ -36991,7 +36997,7 @@ this.Twilio.Conversations = (function (exports) {
|
|
36991
36997
|
var Message = /*#__PURE__*/function (_ReplayEventEmitter) {
|
36992
36998
|
_inherits$4(Message, _ReplayEventEmitter);
|
36993
36999
|
|
36994
|
-
var _super = _createSuper$
|
37000
|
+
var _super = _createSuper$6(Message);
|
36995
37001
|
|
36996
37002
|
/**
|
36997
37003
|
* Conversation that the message is in.
|
@@ -37001,7 +37007,7 @@ this.Twilio.Conversations = (function (exports) {
|
|
37001
37007
|
* @internal
|
37002
37008
|
*/
|
37003
37009
|
function Message(index, data, conversation, links, configuration, services) {
|
37004
|
-
var _data$text, _data$lastUpdatedBy, _data$type, _data$memberSid;
|
37010
|
+
var _data$text, _data$lastUpdatedBy, _data$type, _data$memberSid, _data$channelMetadata;
|
37005
37011
|
|
37006
37012
|
var _this;
|
37007
37013
|
|
@@ -37031,7 +37037,8 @@ this.Twilio.Conversations = (function (exports) {
|
|
37031
37037
|
category: "media"
|
37032
37038
|
}), _this.services)] : null,
|
37033
37039
|
participantSid: (_data$memberSid = data.memberSid) !== null && _data$memberSid !== void 0 ? _data$memberSid : null,
|
37034
|
-
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
|
37035
37042
|
};
|
37036
37043
|
return _this;
|
37037
37044
|
}
|
@@ -37883,6 +37890,47 @@ this.Twilio.Conversations = (function (exports) {
|
|
37883
37890
|
};
|
37884
37891
|
}());
|
37885
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
|
+
}()
|
37886
37934
|
}]);
|
37887
37935
|
|
37888
37936
|
return Message;
|
@@ -37910,15 +37958,15 @@ this.Twilio.Conversations = (function (exports) {
|
|
37910
37958
|
|
37911
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; }
|
37912
37960
|
|
37913
|
-
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; } } }; }
|
37914
37962
|
|
37915
|
-
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); }
|
37916
37964
|
|
37917
|
-
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; }
|
37918
37966
|
|
37919
|
-
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); }; }
|
37920
37968
|
|
37921
|
-
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; } }
|
37922
37970
|
var log$2 = Logger.scope("Messages");
|
37923
37971
|
/**
|
37924
37972
|
* Represents the collection of messages in a conversation
|
@@ -37927,7 +37975,7 @@ this.Twilio.Conversations = (function (exports) {
|
|
37927
37975
|
var Messages = /*#__PURE__*/function (_ReplayEventEmitter) {
|
37928
37976
|
_inherits$4(Messages, _ReplayEventEmitter);
|
37929
37977
|
|
37930
|
-
var _super = _createSuper$
|
37978
|
+
var _super = _createSuper$5(Messages);
|
37931
37979
|
|
37932
37980
|
function Messages(conversation, configuration, services) {
|
37933
37981
|
var _this;
|
@@ -38122,7 +38170,7 @@ this.Twilio.Conversations = (function (exports) {
|
|
38122
38170
|
return request.cancel();
|
38123
38171
|
});
|
38124
38172
|
});
|
38125
|
-
_iterator = _createForOfIteratorHelper$
|
38173
|
+
_iterator = _createForOfIteratorHelper$3(message.mediaContent);
|
38126
38174
|
_context3.prev = 4;
|
38127
38175
|
|
38128
38176
|
_iterator.s();
|
@@ -38775,15 +38823,15 @@ this.Twilio.Conversations = (function (exports) {
|
|
38775
38823
|
|
38776
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);
|
38777
38825
|
|
38778
|
-
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; } } }; }
|
38779
38827
|
|
38780
|
-
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); }
|
38781
38829
|
|
38782
|
-
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; }
|
38783
38831
|
|
38784
|
-
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); }; }
|
38785
38833
|
|
38786
|
-
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; } }
|
38787
38835
|
/**
|
38788
38836
|
* Map of the fields that will be processed with update messages.
|
38789
38837
|
*/
|
@@ -38811,7 +38859,7 @@ this.Twilio.Conversations = (function (exports) {
|
|
38811
38859
|
var Conversation = /*#__PURE__*/function (_ReplayEventEmitter) {
|
38812
38860
|
_inherits$4(Conversation, _ReplayEventEmitter);
|
38813
38861
|
|
38814
|
-
var _super = _createSuper$
|
38862
|
+
var _super = _createSuper$4(Conversation);
|
38815
38863
|
|
38816
38864
|
/**
|
38817
38865
|
* Fired when a participant has joined the conversation.
|
@@ -40471,7 +40519,7 @@ this.Twilio.Conversations = (function (exports) {
|
|
40471
40519
|
}, {
|
40472
40520
|
key: "_onMessageAdded",
|
40473
40521
|
value: function _onMessageAdded(message) {
|
40474
|
-
var _iterator = _createForOfIteratorHelper$
|
40522
|
+
var _iterator = _createForOfIteratorHelper$2(this._participants.values()),
|
40475
40523
|
_step;
|
40476
40524
|
|
40477
40525
|
try {
|
@@ -40679,19 +40727,19 @@ this.Twilio.Conversations = (function (exports) {
|
|
40679
40727
|
return Deferred;
|
40680
40728
|
}();
|
40681
40729
|
|
40682
|
-
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; } } }; }
|
40683
40731
|
|
40684
|
-
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); }
|
40685
40733
|
|
40686
|
-
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; }
|
40687
40735
|
|
40688
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; }
|
40689
40737
|
|
40690
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; }
|
40691
40739
|
|
40692
|
-
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); }; }
|
40693
40741
|
|
40694
|
-
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; } }
|
40695
40743
|
var log$1 = Logger.scope("Conversations");
|
40696
40744
|
/**
|
40697
40745
|
* Represents conversations collection
|
@@ -40701,7 +40749,7 @@ this.Twilio.Conversations = (function (exports) {
|
|
40701
40749
|
var Conversations = /*#__PURE__*/function (_ReplayEventEmitter) {
|
40702
40750
|
_inherits$4(Conversations, _ReplayEventEmitter);
|
40703
40751
|
|
40704
|
-
var _super = _createSuper$
|
40752
|
+
var _super = _createSuper$3(Conversations);
|
40705
40753
|
|
40706
40754
|
function Conversations(configuration, services) {
|
40707
40755
|
var _this;
|
@@ -40863,7 +40911,7 @@ this.Twilio.Conversations = (function (exports) {
|
|
40863
40911
|
case 9:
|
40864
40912
|
myConversations = _context2.sent;
|
40865
40913
|
upserts = [];
|
40866
|
-
_iterator = _createForOfIteratorHelper(myConversations);
|
40914
|
+
_iterator = _createForOfIteratorHelper$1(myConversations);
|
40867
40915
|
|
40868
40916
|
try {
|
40869
40917
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
@@ -41509,9 +41557,9 @@ this.Twilio.Conversations = (function (exports) {
|
|
41509
41557
|
// https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
|
41510
41558
|
addToUnscopables(FIND);
|
41511
41559
|
|
41512
|
-
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); }; }
|
41513
41561
|
|
41514
|
-
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; } }
|
41515
41563
|
/**
|
41516
41564
|
* Container for known users
|
41517
41565
|
*/
|
@@ -41519,7 +41567,7 @@ this.Twilio.Conversations = (function (exports) {
|
|
41519
41567
|
var Users = /*#__PURE__*/function (_ReplayEventEmitter) {
|
41520
41568
|
_inherits$4(Users, _ReplayEventEmitter);
|
41521
41569
|
|
41522
|
-
var _super = _createSuper$
|
41570
|
+
var _super = _createSuper$2(Users);
|
41523
41571
|
|
41524
41572
|
function Users(myself, configuration, services) {
|
41525
41573
|
var _this;
|
@@ -41966,12 +42014,84 @@ this.Twilio.Conversations = (function (exports) {
|
|
41966
42014
|
this.data = data.data || {};
|
41967
42015
|
});
|
41968
42016
|
|
41969
|
-
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
|
+
}
|
41970
42086
|
|
41971
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; }
|
41972
42088
|
|
41973
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; }
|
41974
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
|
+
|
41975
42095
|
var trimSlashes = function trimSlashes(url) {
|
41976
42096
|
return url.replace(/(^\/+|\/+$)/g, "");
|
41977
42097
|
};
|
@@ -41980,6 +42100,20 @@ this.Twilio.Conversations = (function (exports) {
|
|
41980
42100
|
return response.status.code === 202;
|
41981
42101
|
};
|
41982
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
|
+
|
41983
42117
|
var CommandExecutor = /*#__PURE__*/function () {
|
41984
42118
|
function CommandExecutor(_serviceUrl, _services, _productId) {
|
41985
42119
|
_classCallCheck$4(this, CommandExecutor);
|
@@ -42077,40 +42211,91 @@ this.Twilio.Conversations = (function (exports) {
|
|
42077
42211
|
}, {
|
42078
42212
|
key: "fetchResource",
|
42079
42213
|
value: function () {
|
42080
|
-
var _fetchResource = _asyncToGenerator$1( /*#__PURE__*/_regeneratorRuntime$1.mark(function
|
42214
|
+
var _fetchResource = _asyncToGenerator$1( /*#__PURE__*/_regeneratorRuntime$1.mark(function _callee3(url, requestBody) {
|
42081
42215
|
var _this = this;
|
42082
42216
|
|
42083
|
-
var maxAttemptsCount,
|
42084
|
-
return _regeneratorRuntime$1.wrap(function
|
42217
|
+
var maxAttemptsCount, retrier, resolution;
|
42218
|
+
return _regeneratorRuntime$1.wrap(function _callee3$(_context3) {
|
42085
42219
|
while (1) {
|
42086
|
-
switch (
|
42220
|
+
switch (_context3.prev = _context3.next) {
|
42087
42221
|
case 0:
|
42088
42222
|
maxAttemptsCount = 6;
|
42089
|
-
|
42090
|
-
_context2.next = 4;
|
42091
|
-
return new AsyncRetrier_1({
|
42223
|
+
retrier = new AsyncRetrier_1({
|
42092
42224
|
min: 50,
|
42093
42225
|
max: 1600,
|
42094
42226
|
maxAttemptsCount: maxAttemptsCount
|
42095
|
-
}).run(function () {
|
42096
|
-
return _this._makeRequest("get", url, requestBody);
|
42097
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
|
+
}
|
42098
42256
|
|
42099
|
-
|
42100
|
-
|
42101
|
-
|
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;
|
42102
42276
|
|
42103
42277
|
case 8:
|
42104
|
-
|
42105
|
-
|
42278
|
+
_context3.prev = 8;
|
42279
|
+
_context3.t0 = _context3["catch"](2);
|
42106
42280
|
throw new Error("Fetch resource from \"".concat(url, "\" failed."));
|
42107
42281
|
|
42108
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:
|
42109
42294
|
case "end":
|
42110
|
-
return
|
42295
|
+
return _context3.stop();
|
42111
42296
|
}
|
42112
42297
|
}
|
42113
|
-
},
|
42298
|
+
}, _callee3, null, [[2, 8]]);
|
42114
42299
|
}));
|
42115
42300
|
|
42116
42301
|
function fetchResource(_x5, _x6) {
|
@@ -42122,40 +42307,40 @@ this.Twilio.Conversations = (function (exports) {
|
|
42122
42307
|
}, {
|
42123
42308
|
key: "mutateResource",
|
42124
42309
|
value: function () {
|
42125
|
-
var _mutateResource = _asyncToGenerator$1( /*#__PURE__*/_regeneratorRuntime$1.mark(function
|
42310
|
+
var _mutateResource = _asyncToGenerator$1( /*#__PURE__*/_regeneratorRuntime$1.mark(function _callee4(method, url, requestBody) {
|
42126
42311
|
var result;
|
42127
|
-
return _regeneratorRuntime$1.wrap(function
|
42312
|
+
return _regeneratorRuntime$1.wrap(function _callee4$(_context4) {
|
42128
42313
|
while (1) {
|
42129
|
-
switch (
|
42314
|
+
switch (_context4.prev = _context4.next) {
|
42130
42315
|
case 0:
|
42131
|
-
|
42316
|
+
_context4.next = 2;
|
42132
42317
|
return this._makeRequest(method, url, requestBody, {
|
42133
42318
|
"X-Twilio-Mutation-Id": uuid_1.v4()
|
42134
42319
|
});
|
42135
42320
|
|
42136
42321
|
case 2:
|
42137
|
-
result =
|
42322
|
+
result = _context4.sent;
|
42138
42323
|
|
42139
42324
|
if (!isMutationConflictResponse(result)) {
|
42140
|
-
|
42325
|
+
_context4.next = 7;
|
42141
42326
|
break;
|
42142
42327
|
}
|
42143
42328
|
|
42144
|
-
|
42329
|
+
_context4.next = 6;
|
42145
42330
|
return this.fetchResource(result.body.resource_url);
|
42146
42331
|
|
42147
42332
|
case 6:
|
42148
|
-
return
|
42333
|
+
return _context4.abrupt("return", _context4.sent);
|
42149
42334
|
|
42150
42335
|
case 7:
|
42151
|
-
return
|
42336
|
+
return _context4.abrupt("return", result.body);
|
42152
42337
|
|
42153
42338
|
case 8:
|
42154
42339
|
case "end":
|
42155
|
-
return
|
42340
|
+
return _context4.stop();
|
42156
42341
|
}
|
42157
42342
|
}
|
42158
|
-
},
|
42343
|
+
}, _callee4, this);
|
42159
42344
|
}));
|
42160
42345
|
|
42161
42346
|
function mutateResource(_x7, _x8, _x9) {
|
@@ -42316,6 +42501,448 @@ this.Twilio.Conversations = (function (exports) {
|
|
42316
42501
|
return ContentClient;
|
42317
42502
|
}();
|
42318
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
|
+
|
42319
42946
|
var _class;
|
42320
42947
|
|
42321
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; }
|
@@ -43536,6 +44163,7 @@ this.Twilio.Conversations = (function (exports) {
|
|
43536
44163
|
case 2:
|
43537
44164
|
configurationResponse = _context17.sent;
|
43538
44165
|
this._configuration = new Configuration$1(this._options, configurationResponse, Client_1._logger);
|
44166
|
+
this._services.channelMetadataClient = new ChannelMetadataClient(this._services, this._configuration);
|
43539
44167
|
|
43540
44168
|
this._myself._resolveInitialization(this._configuration, this._configuration.userIdentity, this._configuration.userInfo, true);
|
43541
44169
|
|
@@ -43614,10 +44242,10 @@ this.Twilio.Conversations = (function (exports) {
|
|
43614
44242
|
}).catch(function (error) {
|
43615
44243
|
throw error;
|
43616
44244
|
});
|
43617
|
-
_context17.next =
|
44245
|
+
_context17.next = 29;
|
43618
44246
|
return this._services.users.myself._ensureFetched();
|
43619
44247
|
|
43620
|
-
case
|
44248
|
+
case 29:
|
43621
44249
|
Client_1._supportedPushChannels.forEach(function (channelType) {
|
43622
44250
|
return _this3._subscribeToPushNotifications(channelType);
|
43623
44251
|
});
|
@@ -43633,7 +44261,7 @@ this.Twilio.Conversations = (function (exports) {
|
|
43633
44261
|
this.emit("stateChanged", "initialized");
|
43634
44262
|
this.emit("initialized");
|
43635
44263
|
|
43636
|
-
case
|
44264
|
+
case 35:
|
43637
44265
|
case "end":
|
43638
44266
|
return _context17.stop();
|
43639
44267
|
}
|