stream-chat 6.3.0 → 6.4.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/dist/browser.js CHANGED
@@ -386,12 +386,15 @@ var ChannelState = /*#__PURE__*/function () {
386
386
 
387
387
  if (isFromShadowBannedUser) {
388
388
  continue;
389
- }
389
+ } // If message is already formatted we can skip the tasks below
390
+ // This will be true for messages that are already present at the state -> this happens when we perform merging of message sets
391
+ // This will be also true for message previews used by some SDKs
392
+
390
393
 
391
- var isMerging = messagesToAdd[i].created_at instanceof Date;
394
+ var isMessageFormatted = messagesToAdd[i].created_at instanceof Date;
392
395
  var message = void 0;
393
396
 
394
- if (isMerging) {
397
+ if (isMessageFormatted) {
395
398
  message = messagesToAdd[i];
396
399
  } else {
397
400
  var _this$_channel;
@@ -441,7 +444,7 @@ var ChannelState = /*#__PURE__*/function () {
441
444
  */
442
445
 
443
446
 
444
- if (parentID && !initializing && !isMerging) {
447
+ if (parentID && !initializing) {
445
448
  var thread = this.threads[parentID] || [];
446
449
 
447
450
  var threadMessages = this._addToMessageList(thread, message, timestampChanged, 'created_at', addIfDoesNotExist);
@@ -5166,7 +5169,7 @@ function TokenManager(secret) {
5166
5169
  _defineProperty__default['default'](this, "loadToken", function () {
5167
5170
  // eslint-disable-next-line no-async-promise-executor
5168
5171
  _this.loadTokenPromise = new Promise( /*#__PURE__*/function () {
5169
- var _ref2 = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee2(resolve) {
5172
+ var _ref2 = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee2(resolve, reject) {
5170
5173
  return _regeneratorRuntime__default['default'].wrap(function _callee2$(_context2) {
5171
5174
  while (1) {
5172
5175
  switch (_context2.prev = _context2.next) {
@@ -5180,26 +5183,36 @@ function TokenManager(secret) {
5180
5183
 
5181
5184
  case 2:
5182
5185
  if (!(_this.tokenProvider && typeof _this.tokenProvider !== 'string')) {
5183
- _context2.next = 7;
5186
+ _context2.next = 13;
5184
5187
  break;
5185
5188
  }
5186
5189
 
5187
- _context2.next = 5;
5190
+ _context2.prev = 3;
5191
+ _context2.next = 6;
5188
5192
  return _this.tokenProvider();
5189
5193
 
5190
- case 5:
5194
+ case 6:
5191
5195
  _this.token = _context2.sent;
5196
+ _context2.next = 12;
5197
+ break;
5198
+
5199
+ case 9:
5200
+ _context2.prev = 9;
5201
+ _context2.t0 = _context2["catch"](3);
5202
+ return _context2.abrupt("return", reject(new Error("Call to tokenProvider failed with message: ".concat(_context2.t0))));
5203
+
5204
+ case 12:
5192
5205
  resolve(_this.token);
5193
5206
 
5194
- case 7:
5207
+ case 13:
5195
5208
  case "end":
5196
5209
  return _context2.stop();
5197
5210
  }
5198
5211
  }
5199
- }, _callee2);
5212
+ }, _callee2, null, [[3, 9]]);
5200
5213
  }));
5201
5214
 
5202
- return function (_x3) {
5215
+ return function (_x3, _x4) {
5203
5216
  return _ref2.apply(this, arguments);
5204
5217
  };
5205
5218
  }());
@@ -6709,10 +6722,10 @@ var StreamChat = /*#__PURE__*/function () {
6709
6722
  key: "updateAppSettings",
6710
6723
  value:
6711
6724
  /**
6712
- * updateAppSettings - updates application settings
6713
- *
6714
- * @param {AppSettings} options App settings.
6715
- * IE: {
6725
+ * updateAppSettings - updates application settings
6726
+ *
6727
+ * @param {AppSettings} options App settings.
6728
+ * IE: {
6716
6729
  "apn_config": {
6717
6730
  "auth_type": "token",
6718
6731
  "auth_key": fs.readFileSync(
@@ -6732,7 +6745,7 @@ var StreamChat = /*#__PURE__*/function () {
6732
6745
  },
6733
6746
  "webhook_url": "https://acme.com/my/awesome/webhook/"
6734
6747
  }
6735
- */
6748
+ */
6736
6749
  function () {
6737
6750
  var _updateAppSettings = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee7(options) {
6738
6751
  var _options$apn_config;
@@ -6923,17 +6936,19 @@ var StreamChat = /*#__PURE__*/function () {
6923
6936
  return getAppSettings;
6924
6937
  }()
6925
6938
  /**
6926
- * testPushSettings - Tests the push settings for a user with a random chat message and the configured push templates
6927
- *
6928
- * @param {string} userID User ID. If user has no devices, it will error
6929
- * @param {TestPushDataInput} [data] Overrides for push templates/message used
6930
- * IE: {
6931
- messageID: 'id-of-message',//will error if message does not exist
6932
- apnTemplate: '{}', //if app doesn't have apn configured it will error
6933
- firebaseTemplate: '{}', //if app doesn't have firebase configured it will error
6934
- firebaseDataTemplate: '{}', //if app doesn't have firebase configured it will error
6935
- skipDevices: true, // skip config/device checks and sending to real devices
6936
- }
6939
+ * testPushSettings - Tests the push settings for a user with a random chat message and the configured push templates
6940
+ *
6941
+ * @param {string} userID User ID. If user has no devices, it will error
6942
+ * @param {TestPushDataInput} [data] Overrides for push templates/message used
6943
+ * IE: {
6944
+ messageID: 'id-of-message', // will error if message does not exist
6945
+ apnTemplate: '{}', // if app doesn't have apn configured it will error
6946
+ firebaseTemplate: '{}', // if app doesn't have firebase configured it will error
6947
+ firebaseDataTemplate: '{}', // if app doesn't have firebase configured it will error
6948
+ skipDevices: true, // skip config/device checks and sending to real devices
6949
+ pushProviderName: 'staging' // one of your configured push providers
6950
+ pushProviderType: 'apn' // one of supported provider types
6951
+ }
6937
6952
  */
6938
6953
 
6939
6954
  }, {
@@ -6948,7 +6963,7 @@ var StreamChat = /*#__PURE__*/function () {
6948
6963
  case 0:
6949
6964
  data = _args12.length > 1 && _args12[1] !== undefined ? _args12[1] : {};
6950
6965
  _context12.next = 3;
6951
- return this.post(this.baseURL + '/check_push', _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({
6966
+ return this.post(this.baseURL + '/check_push', _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({
6952
6967
  user_id: userID
6953
6968
  }, data.messageID ? {
6954
6969
  message_id: data.messageID
@@ -6960,6 +6975,10 @@ var StreamChat = /*#__PURE__*/function () {
6960
6975
  firebase_data_template: data.firebaseDataTemplate
6961
6976
  } : {}), data.skipDevices ? {
6962
6977
  skip_devices: true
6978
+ } : {}), data.pushProviderName ? {
6979
+ push_provider_name: data.pushProviderName
6980
+ } : {}), data.pushProviderType ? {
6981
+ push_provider_type: data.pushProviderType
6963
6982
  } : {}));
6964
6983
 
6965
6984
  case 3:
@@ -6983,11 +7002,11 @@ var StreamChat = /*#__PURE__*/function () {
6983
7002
  * testSQSSettings - Tests that the given or configured SQS configuration is valid
6984
7003
  *
6985
7004
  * @param {TestSQSDataInput} [data] Overrides SQS settings for testing if needed
6986
- * IE: {
6987
- sqs_key: 'auth_key',
6988
- sqs_secret: 'auth_secret',
6989
- sqs_url: 'url_to_queue',
6990
- }
7005
+ * IE: {
7006
+ sqs_key: 'auth_key',
7007
+ sqs_secret: 'auth_secret',
7008
+ sqs_url: 'url_to_queue',
7009
+ }
6991
7010
  */
6992
7011
 
6993
7012
  }, {
@@ -7925,23 +7944,26 @@ var StreamChat = /*#__PURE__*/function () {
7925
7944
  * @param {string} id the device id
7926
7945
  * @param {PushProvider} push_provider the push provider
7927
7946
  * @param {string} [userID] the user id (defaults to current user)
7947
+ * @param {string} [push_provider_name] user provided push provider name for multi bundle support
7928
7948
  *
7929
7949
  */
7930
7950
 
7931
7951
  }, {
7932
7952
  key: "addDevice",
7933
7953
  value: function () {
7934
- var _addDevice = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee21(id, push_provider, userID) {
7954
+ var _addDevice = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee21(id, push_provider, userID, push_provider_name) {
7935
7955
  return _regeneratorRuntime__default['default'].wrap(function _callee21$(_context21) {
7936
7956
  while (1) {
7937
7957
  switch (_context21.prev = _context21.next) {
7938
7958
  case 0:
7939
7959
  _context21.next = 2;
7940
- return this.post(this.baseURL + '/devices', _objectSpread({
7960
+ return this.post(this.baseURL + '/devices', _objectSpread(_objectSpread({
7941
7961
  id: id,
7942
7962
  push_provider: push_provider
7943
7963
  }, userID != null ? {
7944
7964
  user_id: userID
7965
+ } : {}), push_provider_name != null ? {
7966
+ push_provider_name: push_provider_name
7945
7967
  } : {}));
7946
7968
 
7947
7969
  case 2:
@@ -7955,7 +7977,7 @@ var StreamChat = /*#__PURE__*/function () {
7955
7977
  }, _callee21, this);
7956
7978
  }));
7957
7979
 
7958
- function addDevice(_x20, _x21, _x22) {
7980
+ function addDevice(_x20, _x21, _x22, _x23) {
7959
7981
  return _addDevice.apply(this, arguments);
7960
7982
  }
7961
7983
 
@@ -7993,7 +8015,7 @@ var StreamChat = /*#__PURE__*/function () {
7993
8015
  }, _callee22, this);
7994
8016
  }));
7995
8017
 
7996
- function getDevices(_x23) {
8018
+ function getDevices(_x24) {
7997
8019
  return _getDevices.apply(this, arguments);
7998
8020
  }
7999
8021
 
@@ -8033,7 +8055,7 @@ var StreamChat = /*#__PURE__*/function () {
8033
8055
  }, _callee23, this);
8034
8056
  }));
8035
8057
 
8036
- function removeDevice(_x24, _x25) {
8058
+ function removeDevice(_x25, _x26) {
8037
8059
  return _removeDevice.apply(this, arguments);
8038
8060
  }
8039
8061
 
@@ -8074,7 +8096,7 @@ var StreamChat = /*#__PURE__*/function () {
8074
8096
  }, _callee24, this);
8075
8097
  }));
8076
8098
 
8077
- function getRateLimits(_x26) {
8099
+ function getRateLimits(_x27) {
8078
8100
  return _getRateLimits.apply(this, arguments);
8079
8101
  }
8080
8102
 
@@ -8175,7 +8197,7 @@ var StreamChat = /*#__PURE__*/function () {
8175
8197
  }, _callee25, this);
8176
8198
  }));
8177
8199
 
8178
- function partialUpdateUser(_x27) {
8200
+ function partialUpdateUser(_x28) {
8179
8201
  return _partialUpdateUser.apply(this, arguments);
8180
8202
  }
8181
8203
 
@@ -8261,7 +8283,7 @@ var StreamChat = /*#__PURE__*/function () {
8261
8283
  }, _callee26, this, [[2, 13, 16, 19]]);
8262
8284
  }));
8263
8285
 
8264
- function upsertUsers(_x28) {
8286
+ function upsertUsers(_x29) {
8265
8287
  return _upsertUsers.apply(this, arguments);
8266
8288
  }
8267
8289
 
@@ -8374,7 +8396,7 @@ var StreamChat = /*#__PURE__*/function () {
8374
8396
  }, _callee27, this, [[1, 11, 14, 17]]);
8375
8397
  }));
8376
8398
 
8377
- function partialUpdateUsers(_x29) {
8399
+ function partialUpdateUsers(_x30) {
8378
8400
  return _partialUpdateUsers.apply(this, arguments);
8379
8401
  }
8380
8402
 
@@ -8402,7 +8424,7 @@ var StreamChat = /*#__PURE__*/function () {
8402
8424
  }, _callee28, this);
8403
8425
  }));
8404
8426
 
8405
- function deleteUser(_x30, _x31) {
8427
+ function deleteUser(_x31, _x32) {
8406
8428
  return _deleteUser.apply(this, arguments);
8407
8429
  }
8408
8430
 
@@ -8430,7 +8452,7 @@ var StreamChat = /*#__PURE__*/function () {
8430
8452
  }, _callee29, this);
8431
8453
  }));
8432
8454
 
8433
- function reactivateUser(_x32, _x33) {
8455
+ function reactivateUser(_x33, _x34) {
8434
8456
  return _reactivateUser.apply(this, arguments);
8435
8457
  }
8436
8458
 
@@ -8458,7 +8480,7 @@ var StreamChat = /*#__PURE__*/function () {
8458
8480
  }, _callee30, this);
8459
8481
  }));
8460
8482
 
8461
- function deactivateUser(_x34, _x35) {
8483
+ function deactivateUser(_x35, _x36) {
8462
8484
  return _deactivateUser.apply(this, arguments);
8463
8485
  }
8464
8486
 
@@ -8486,7 +8508,7 @@ var StreamChat = /*#__PURE__*/function () {
8486
8508
  }, _callee31, this);
8487
8509
  }));
8488
8510
 
8489
- function exportUser(_x36, _x37) {
8511
+ function exportUser(_x37, _x38) {
8490
8512
  return _exportUser.apply(this, arguments);
8491
8513
  }
8492
8514
 
@@ -8523,7 +8545,7 @@ var StreamChat = /*#__PURE__*/function () {
8523
8545
  }, _callee32, this);
8524
8546
  }));
8525
8547
 
8526
- function banUser(_x38, _x39) {
8548
+ function banUser(_x39, _x40) {
8527
8549
  return _banUser.apply(this, arguments);
8528
8550
  }
8529
8551
 
@@ -8560,7 +8582,7 @@ var StreamChat = /*#__PURE__*/function () {
8560
8582
  }, _callee33, this);
8561
8583
  }));
8562
8584
 
8563
- function unbanUser(_x40, _x41) {
8585
+ function unbanUser(_x41, _x42) {
8564
8586
  return _unbanUser.apply(this, arguments);
8565
8587
  }
8566
8588
 
@@ -8597,7 +8619,7 @@ var StreamChat = /*#__PURE__*/function () {
8597
8619
  }, _callee34, this);
8598
8620
  }));
8599
8621
 
8600
- function shadowBan(_x42, _x43) {
8622
+ function shadowBan(_x43, _x44) {
8601
8623
  return _shadowBan.apply(this, arguments);
8602
8624
  }
8603
8625
 
@@ -8634,7 +8656,7 @@ var StreamChat = /*#__PURE__*/function () {
8634
8656
  }, _callee35, this);
8635
8657
  }));
8636
8658
 
8637
- function removeShadowBan(_x44, _x45) {
8659
+ function removeShadowBan(_x45, _x46) {
8638
8660
  return _removeShadowBan.apply(this, arguments);
8639
8661
  }
8640
8662
 
@@ -8677,7 +8699,7 @@ var StreamChat = /*#__PURE__*/function () {
8677
8699
  }, _callee36, this);
8678
8700
  }));
8679
8701
 
8680
- function muteUser(_x46, _x47) {
8702
+ function muteUser(_x47, _x48) {
8681
8703
  return _muteUser.apply(this, arguments);
8682
8704
  }
8683
8705
 
@@ -8716,7 +8738,7 @@ var StreamChat = /*#__PURE__*/function () {
8716
8738
  }, _callee37, this);
8717
8739
  }));
8718
8740
 
8719
- function unmuteUser(_x48, _x49) {
8741
+ function unmuteUser(_x49, _x50) {
8720
8742
  return _unmuteUser.apply(this, arguments);
8721
8743
  }
8722
8744
 
@@ -8775,7 +8797,7 @@ var StreamChat = /*#__PURE__*/function () {
8775
8797
  }, _callee38, this);
8776
8798
  }));
8777
8799
 
8778
- function flagMessage(_x50) {
8800
+ function flagMessage(_x51) {
8779
8801
  return _flagMessage.apply(this, arguments);
8780
8802
  }
8781
8803
 
@@ -8815,7 +8837,7 @@ var StreamChat = /*#__PURE__*/function () {
8815
8837
  }, _callee39, this);
8816
8838
  }));
8817
8839
 
8818
- function flagUser(_x51) {
8840
+ function flagUser(_x52) {
8819
8841
  return _flagUser.apply(this, arguments);
8820
8842
  }
8821
8843
 
@@ -8855,7 +8877,7 @@ var StreamChat = /*#__PURE__*/function () {
8855
8877
  }, _callee40, this);
8856
8878
  }));
8857
8879
 
8858
- function unflagMessage(_x52) {
8880
+ function unflagMessage(_x53) {
8859
8881
  return _unflagMessage.apply(this, arguments);
8860
8882
  }
8861
8883
 
@@ -8895,7 +8917,7 @@ var StreamChat = /*#__PURE__*/function () {
8895
8917
  }, _callee41, this);
8896
8918
  }));
8897
8919
 
8898
- function unflagUser(_x53) {
8920
+ function unflagUser(_x54) {
8899
8921
  return _unflagUser.apply(this, arguments);
8900
8922
  }
8901
8923
 
@@ -9041,7 +9063,7 @@ var StreamChat = /*#__PURE__*/function () {
9041
9063
  }, _callee44, this);
9042
9064
  }));
9043
9065
 
9044
- function _reviewFlagReport(_x54, _x55) {
9066
+ function _reviewFlagReport(_x55, _x56) {
9045
9067
  return _reviewFlagReport2.apply(this, arguments);
9046
9068
  }
9047
9069
 
@@ -9087,7 +9109,7 @@ var StreamChat = /*#__PURE__*/function () {
9087
9109
  }, _callee45, this);
9088
9110
  }));
9089
9111
 
9090
- function _unblockMessage(_x56) {
9112
+ function _unblockMessage(_x57) {
9091
9113
  return _unblockMessage2.apply(this, arguments);
9092
9114
  }
9093
9115
 
@@ -9226,7 +9248,7 @@ var StreamChat = /*#__PURE__*/function () {
9226
9248
  }, _callee47, this);
9227
9249
  }));
9228
9250
 
9229
- function translateMessage(_x57, _x58) {
9251
+ function translateMessage(_x58, _x59) {
9230
9252
  return _translateMessage.apply(this, arguments);
9231
9253
  }
9232
9254
 
@@ -9388,7 +9410,7 @@ var StreamChat = /*#__PURE__*/function () {
9388
9410
  }, _callee48, this);
9389
9411
  }));
9390
9412
 
9391
- function updateMessage(_x59, _x60, _x61) {
9413
+ function updateMessage(_x60, _x61, _x62) {
9392
9414
  return _updateMessage.apply(this, arguments);
9393
9415
  }
9394
9416
 
@@ -9449,7 +9471,7 @@ var StreamChat = /*#__PURE__*/function () {
9449
9471
  }, _callee49, this);
9450
9472
  }));
9451
9473
 
9452
- function partialUpdateMessage(_x62, _x63, _x64, _x65) {
9474
+ function partialUpdateMessage(_x63, _x64, _x65, _x66) {
9453
9475
  return _partialUpdateMessage.apply(this, arguments);
9454
9476
  }
9455
9477
 
@@ -9486,7 +9508,7 @@ var StreamChat = /*#__PURE__*/function () {
9486
9508
  }, _callee50, this);
9487
9509
  }));
9488
9510
 
9489
- function deleteMessage(_x66, _x67) {
9511
+ function deleteMessage(_x67, _x68) {
9490
9512
  return _deleteMessage.apply(this, arguments);
9491
9513
  }
9492
9514
 
@@ -9514,7 +9536,7 @@ var StreamChat = /*#__PURE__*/function () {
9514
9536
  }, _callee51, this);
9515
9537
  }));
9516
9538
 
9517
- function getMessage(_x68) {
9539
+ function getMessage(_x69) {
9518
9540
  return _getMessage.apply(this, arguments);
9519
9541
  }
9520
9542
 
@@ -9523,7 +9545,7 @@ var StreamChat = /*#__PURE__*/function () {
9523
9545
  }, {
9524
9546
  key: "getUserAgent",
9525
9547
  value: function getUserAgent() {
9526
- return this.userAgent || "stream-chat-javascript-client-".concat(this.node ? 'node' : 'browser', "-", "6.3.0");
9548
+ return this.userAgent || "stream-chat-javascript-client-".concat(this.node ? 'node' : 'browser', "-", "6.4.0");
9527
9549
  }
9528
9550
  }, {
9529
9551
  key: "setUserAgent",
@@ -9739,7 +9761,7 @@ var StreamChat = /*#__PURE__*/function () {
9739
9761
  }, _callee52, this);
9740
9762
  }));
9741
9763
 
9742
- function sendUserCustomEvent(_x69, _x70) {
9764
+ function sendUserCustomEvent(_x70, _x71) {
9743
9765
  return _sendUserCustomEvent.apply(this, arguments);
9744
9766
  }
9745
9767
 
@@ -9832,7 +9854,7 @@ var StreamChat = /*#__PURE__*/function () {
9832
9854
  }, _callee53, this);
9833
9855
  }));
9834
9856
 
9835
- function createSegment(_x71) {
9857
+ function createSegment(_x72) {
9836
9858
  return _createSegment.apply(this, arguments);
9837
9859
  }
9838
9860
 
@@ -9872,7 +9894,7 @@ var StreamChat = /*#__PURE__*/function () {
9872
9894
  }, _callee54, this);
9873
9895
  }));
9874
9896
 
9875
- function getSegment(_x72) {
9897
+ function getSegment(_x73) {
9876
9898
  return _getSegment.apply(this, arguments);
9877
9899
  }
9878
9900
 
@@ -9911,7 +9933,7 @@ var StreamChat = /*#__PURE__*/function () {
9911
9933
  }, _callee55, this);
9912
9934
  }));
9913
9935
 
9914
- function listSegments(_x73) {
9936
+ function listSegments(_x74) {
9915
9937
  return _listSegments.apply(this, arguments);
9916
9938
  }
9917
9939
 
@@ -9954,7 +9976,7 @@ var StreamChat = /*#__PURE__*/function () {
9954
9976
  }, _callee56, this);
9955
9977
  }));
9956
9978
 
9957
- function updateSegment(_x74, _x75) {
9979
+ function updateSegment(_x75, _x76) {
9958
9980
  return _updateSegment.apply(this, arguments);
9959
9981
  }
9960
9982
 
@@ -9986,7 +10008,7 @@ var StreamChat = /*#__PURE__*/function () {
9986
10008
  }, _callee57, this);
9987
10009
  }));
9988
10010
 
9989
- function deleteSegment(_x76) {
10011
+ function deleteSegment(_x77) {
9990
10012
  return _deleteSegment.apply(this, arguments);
9991
10013
  }
9992
10014
 
@@ -10028,7 +10050,7 @@ var StreamChat = /*#__PURE__*/function () {
10028
10050
  }, _callee58, this);
10029
10051
  }));
10030
10052
 
10031
- function createCampaign(_x77) {
10053
+ function createCampaign(_x78) {
10032
10054
  return _createCampaign.apply(this, arguments);
10033
10055
  }
10034
10056
 
@@ -10068,7 +10090,7 @@ var StreamChat = /*#__PURE__*/function () {
10068
10090
  }, _callee59, this);
10069
10091
  }));
10070
10092
 
10071
- function getCampaign(_x78) {
10093
+ function getCampaign(_x79) {
10072
10094
  return _getCampaign.apply(this, arguments);
10073
10095
  }
10074
10096
 
@@ -10107,7 +10129,7 @@ var StreamChat = /*#__PURE__*/function () {
10107
10129
  }, _callee60, this);
10108
10130
  }));
10109
10131
 
10110
- function listCampaigns(_x79) {
10132
+ function listCampaigns(_x80) {
10111
10133
  return _listCampaigns.apply(this, arguments);
10112
10134
  }
10113
10135
 
@@ -10150,7 +10172,7 @@ var StreamChat = /*#__PURE__*/function () {
10150
10172
  }, _callee61, this);
10151
10173
  }));
10152
10174
 
10153
- function updateCampaign(_x80, _x81) {
10175
+ function updateCampaign(_x81, _x82) {
10154
10176
  return _updateCampaign.apply(this, arguments);
10155
10177
  }
10156
10178
 
@@ -10182,7 +10204,7 @@ var StreamChat = /*#__PURE__*/function () {
10182
10204
  }, _callee62, this);
10183
10205
  }));
10184
10206
 
10185
- function deleteCampaign(_x82) {
10207
+ function deleteCampaign(_x83) {
10186
10208
  return _deleteCampaign.apply(this, arguments);
10187
10209
  }
10188
10210
 
@@ -10226,7 +10248,7 @@ var StreamChat = /*#__PURE__*/function () {
10226
10248
  }, _callee63, this);
10227
10249
  }));
10228
10250
 
10229
- function scheduleCampaign(_x83, _x84) {
10251
+ function scheduleCampaign(_x84, _x85) {
10230
10252
  return _scheduleCampaign.apply(this, arguments);
10231
10253
  }
10232
10254
 
@@ -10266,7 +10288,7 @@ var StreamChat = /*#__PURE__*/function () {
10266
10288
  }, _callee64, this);
10267
10289
  }));
10268
10290
 
10269
- function stopCampaign(_x85) {
10291
+ function stopCampaign(_x86) {
10270
10292
  return _stopCampaign.apply(this, arguments);
10271
10293
  }
10272
10294
 
@@ -10306,7 +10328,7 @@ var StreamChat = /*#__PURE__*/function () {
10306
10328
  }, _callee65, this);
10307
10329
  }));
10308
10330
 
10309
- function resumeCampaign(_x86) {
10331
+ function resumeCampaign(_x87) {
10310
10332
  return _resumeCampaign.apply(this, arguments);
10311
10333
  }
10312
10334
 
@@ -10349,7 +10371,7 @@ var StreamChat = /*#__PURE__*/function () {
10349
10371
  }, _callee66, this);
10350
10372
  }));
10351
10373
 
10352
- function testCampaign(_x87, _x88) {
10374
+ function testCampaign(_x88, _x89) {
10353
10375
  return _testCampaign.apply(this, arguments);
10354
10376
  }
10355
10377
 
@@ -10382,7 +10404,7 @@ var StreamChat = /*#__PURE__*/function () {
10382
10404
  }, _callee67, this);
10383
10405
  }));
10384
10406
 
10385
- function enrichURL(_x89) {
10407
+ function enrichURL(_x90) {
10386
10408
  return _enrichURL.apply(this, arguments);
10387
10409
  }
10388
10410
 
@@ -10414,7 +10436,7 @@ var StreamChat = /*#__PURE__*/function () {
10414
10436
  }, _callee68, this);
10415
10437
  }));
10416
10438
 
10417
- function getTask(_x90) {
10439
+ function getTask(_x91) {
10418
10440
  return _getTask.apply(this, arguments);
10419
10441
  }
10420
10442
 
@@ -10456,7 +10478,7 @@ var StreamChat = /*#__PURE__*/function () {
10456
10478
  }, _callee69, this);
10457
10479
  }));
10458
10480
 
10459
- function deleteChannels(_x91) {
10481
+ function deleteChannels(_x92) {
10460
10482
  return _deleteChannels.apply(this, arguments);
10461
10483
  }
10462
10484
 
@@ -10519,7 +10541,7 @@ var StreamChat = /*#__PURE__*/function () {
10519
10541
  }, _callee70, this);
10520
10542
  }));
10521
10543
 
10522
- function deleteUsers(_x92, _x93) {
10544
+ function deleteUsers(_x93, _x94) {
10523
10545
  return _deleteUsers.apply(this, arguments);
10524
10546
  }
10525
10547
 
@@ -10534,7 +10556,6 @@ var StreamChat = /*#__PURE__*/function () {
10534
10556
  *
10535
10557
  * @private
10536
10558
  * @param {string} filename filename of uploaded data
10537
- *
10538
10559
  * @return {APIResponse & CreateImportResponse} An ImportTask
10539
10560
  */
10540
10561
 
@@ -10562,7 +10583,7 @@ var StreamChat = /*#__PURE__*/function () {
10562
10583
  }, _callee71, this);
10563
10584
  }));
10564
10585
 
10565
- function _createImportURL(_x94) {
10586
+ function _createImportURL(_x95) {
10566
10587
  return _createImportURL2.apply(this, arguments);
10567
10588
  }
10568
10589
 
@@ -10577,7 +10598,7 @@ var StreamChat = /*#__PURE__*/function () {
10577
10598
  *
10578
10599
  * @private
10579
10600
  * @param {string} path path of uploaded data
10580
- *
10601
+ * @param {CreateImportOptions} options import options
10581
10602
  * @return {APIResponse & CreateImportResponse} An ImportTask
10582
10603
  */
10583
10604
 
@@ -10585,19 +10606,24 @@ var StreamChat = /*#__PURE__*/function () {
10585
10606
  key: "_createImport",
10586
10607
  value: function () {
10587
10608
  var _createImport2 = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee72(path) {
10609
+ var options,
10610
+ _args72 = arguments;
10588
10611
  return _regeneratorRuntime__default['default'].wrap(function _callee72$(_context72) {
10589
10612
  while (1) {
10590
10613
  switch (_context72.prev = _context72.next) {
10591
10614
  case 0:
10592
- _context72.next = 2;
10593
- return this.post(this.baseURL + "/imports", {
10615
+ options = _args72.length > 1 && _args72[1] !== undefined ? _args72[1] : {
10616
+ mode: 'upsert'
10617
+ };
10618
+ _context72.next = 3;
10619
+ return this.post(this.baseURL + "/imports", _objectSpread({
10594
10620
  path: path
10595
- });
10621
+ }, options));
10596
10622
 
10597
- case 2:
10623
+ case 3:
10598
10624
  return _context72.abrupt("return", _context72.sent);
10599
10625
 
10600
- case 3:
10626
+ case 4:
10601
10627
  case "end":
10602
10628
  return _context72.stop();
10603
10629
  }
@@ -10605,7 +10631,7 @@ var StreamChat = /*#__PURE__*/function () {
10605
10631
  }, _callee72, this);
10606
10632
  }));
10607
10633
 
10608
- function _createImport(_x95) {
10634
+ function _createImport(_x96) {
10609
10635
  return _createImport2.apply(this, arguments);
10610
10636
  }
10611
10637
 
@@ -10646,7 +10672,7 @@ var StreamChat = /*#__PURE__*/function () {
10646
10672
  }, _callee73, this);
10647
10673
  }));
10648
10674
 
10649
- function _getImport(_x96) {
10675
+ function _getImport(_x97) {
10650
10676
  return _getImport2.apply(this, arguments);
10651
10677
  }
10652
10678
 
@@ -10687,7 +10713,7 @@ var StreamChat = /*#__PURE__*/function () {
10687
10713
  }, _callee74, this);
10688
10714
  }));
10689
10715
 
10690
- function _listImports(_x97) {
10716
+ function _listImports(_x98) {
10691
10717
  return _listImports2.apply(this, arguments);
10692
10718
  }
10693
10719
 
@@ -10727,7 +10753,7 @@ var StreamChat = /*#__PURE__*/function () {
10727
10753
  }, _callee75, this);
10728
10754
  }));
10729
10755
 
10730
- function upsertPushProvider(_x98) {
10756
+ function upsertPushProvider(_x99) {
10731
10757
  return _upsertPushProvider.apply(this, arguments);
10732
10758
  }
10733
10759
 
@@ -10767,7 +10793,7 @@ var StreamChat = /*#__PURE__*/function () {
10767
10793
  }, _callee76, this);
10768
10794
  }));
10769
10795
 
10770
- function deletePushProvider(_x99) {
10796
+ function deletePushProvider(_x100) {
10771
10797
  return _deletePushProvider.apply(this, arguments);
10772
10798
  }
10773
10799