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/index.js CHANGED
@@ -390,12 +390,15 @@ var ChannelState = /*#__PURE__*/function () {
390
390
 
391
391
  if (isFromShadowBannedUser) {
392
392
  continue;
393
- }
393
+ } // If message is already formatted we can skip the tasks below
394
+ // This will be true for messages that are already present at the state -> this happens when we perform merging of message sets
395
+ // This will be also true for message previews used by some SDKs
396
+
394
397
 
395
- var isMerging = messagesToAdd[i].created_at instanceof Date;
398
+ var isMessageFormatted = messagesToAdd[i].created_at instanceof Date;
396
399
  var message = void 0;
397
400
 
398
- if (isMerging) {
401
+ if (isMessageFormatted) {
399
402
  message = messagesToAdd[i];
400
403
  } else {
401
404
  var _this$_channel;
@@ -445,7 +448,7 @@ var ChannelState = /*#__PURE__*/function () {
445
448
  */
446
449
 
447
450
 
448
- if (parentID && !initializing && !isMerging) {
451
+ if (parentID && !initializing) {
449
452
  var thread = this.threads[parentID] || [];
450
453
 
451
454
  var threadMessages = this._addToMessageList(thread, message, timestampChanged, 'created_at', addIfDoesNotExist);
@@ -5172,7 +5175,7 @@ function TokenManager(secret) {
5172
5175
  _defineProperty__default['default'](this, "loadToken", function () {
5173
5176
  // eslint-disable-next-line no-async-promise-executor
5174
5177
  _this.loadTokenPromise = new Promise( /*#__PURE__*/function () {
5175
- var _ref2 = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee2(resolve) {
5178
+ var _ref2 = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee2(resolve, reject) {
5176
5179
  return _regeneratorRuntime__default['default'].wrap(function _callee2$(_context2) {
5177
5180
  while (1) {
5178
5181
  switch (_context2.prev = _context2.next) {
@@ -5186,26 +5189,36 @@ function TokenManager(secret) {
5186
5189
 
5187
5190
  case 2:
5188
5191
  if (!(_this.tokenProvider && typeof _this.tokenProvider !== 'string')) {
5189
- _context2.next = 7;
5192
+ _context2.next = 13;
5190
5193
  break;
5191
5194
  }
5192
5195
 
5193
- _context2.next = 5;
5196
+ _context2.prev = 3;
5197
+ _context2.next = 6;
5194
5198
  return _this.tokenProvider();
5195
5199
 
5196
- case 5:
5200
+ case 6:
5197
5201
  _this.token = _context2.sent;
5202
+ _context2.next = 12;
5203
+ break;
5204
+
5205
+ case 9:
5206
+ _context2.prev = 9;
5207
+ _context2.t0 = _context2["catch"](3);
5208
+ return _context2.abrupt("return", reject(new Error("Call to tokenProvider failed with message: ".concat(_context2.t0))));
5209
+
5210
+ case 12:
5198
5211
  resolve(_this.token);
5199
5212
 
5200
- case 7:
5213
+ case 13:
5201
5214
  case "end":
5202
5215
  return _context2.stop();
5203
5216
  }
5204
5217
  }
5205
- }, _callee2);
5218
+ }, _callee2, null, [[3, 9]]);
5206
5219
  }));
5207
5220
 
5208
- return function (_x3) {
5221
+ return function (_x3, _x4) {
5209
5222
  return _ref2.apply(this, arguments);
5210
5223
  };
5211
5224
  }());
@@ -6715,10 +6728,10 @@ var StreamChat = /*#__PURE__*/function () {
6715
6728
  key: "updateAppSettings",
6716
6729
  value:
6717
6730
  /**
6718
- * updateAppSettings - updates application settings
6719
- *
6720
- * @param {AppSettings} options App settings.
6721
- * IE: {
6731
+ * updateAppSettings - updates application settings
6732
+ *
6733
+ * @param {AppSettings} options App settings.
6734
+ * IE: {
6722
6735
  "apn_config": {
6723
6736
  "auth_type": "token",
6724
6737
  "auth_key": fs.readFileSync(
@@ -6738,7 +6751,7 @@ var StreamChat = /*#__PURE__*/function () {
6738
6751
  },
6739
6752
  "webhook_url": "https://acme.com/my/awesome/webhook/"
6740
6753
  }
6741
- */
6754
+ */
6742
6755
  function () {
6743
6756
  var _updateAppSettings = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee7(options) {
6744
6757
  var _options$apn_config;
@@ -6929,17 +6942,19 @@ var StreamChat = /*#__PURE__*/function () {
6929
6942
  return getAppSettings;
6930
6943
  }()
6931
6944
  /**
6932
- * testPushSettings - Tests the push settings for a user with a random chat message and the configured push templates
6933
- *
6934
- * @param {string} userID User ID. If user has no devices, it will error
6935
- * @param {TestPushDataInput} [data] Overrides for push templates/message used
6936
- * IE: {
6937
- messageID: 'id-of-message',//will error if message does not exist
6938
- apnTemplate: '{}', //if app doesn't have apn configured it will error
6939
- firebaseTemplate: '{}', //if app doesn't have firebase configured it will error
6940
- firebaseDataTemplate: '{}', //if app doesn't have firebase configured it will error
6941
- skipDevices: true, // skip config/device checks and sending to real devices
6942
- }
6945
+ * testPushSettings - Tests the push settings for a user with a random chat message and the configured push templates
6946
+ *
6947
+ * @param {string} userID User ID. If user has no devices, it will error
6948
+ * @param {TestPushDataInput} [data] Overrides for push templates/message used
6949
+ * IE: {
6950
+ messageID: 'id-of-message', // will error if message does not exist
6951
+ apnTemplate: '{}', // if app doesn't have apn configured it will error
6952
+ firebaseTemplate: '{}', // if app doesn't have firebase configured it will error
6953
+ firebaseDataTemplate: '{}', // if app doesn't have firebase configured it will error
6954
+ skipDevices: true, // skip config/device checks and sending to real devices
6955
+ pushProviderName: 'staging' // one of your configured push providers
6956
+ pushProviderType: 'apn' // one of supported provider types
6957
+ }
6943
6958
  */
6944
6959
 
6945
6960
  }, {
@@ -6954,7 +6969,7 @@ var StreamChat = /*#__PURE__*/function () {
6954
6969
  case 0:
6955
6970
  data = _args12.length > 1 && _args12[1] !== undefined ? _args12[1] : {};
6956
6971
  _context12.next = 3;
6957
- return this.post(this.baseURL + '/check_push', _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({
6972
+ return this.post(this.baseURL + '/check_push', _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({
6958
6973
  user_id: userID
6959
6974
  }, data.messageID ? {
6960
6975
  message_id: data.messageID
@@ -6966,6 +6981,10 @@ var StreamChat = /*#__PURE__*/function () {
6966
6981
  firebase_data_template: data.firebaseDataTemplate
6967
6982
  } : {}), data.skipDevices ? {
6968
6983
  skip_devices: true
6984
+ } : {}), data.pushProviderName ? {
6985
+ push_provider_name: data.pushProviderName
6986
+ } : {}), data.pushProviderType ? {
6987
+ push_provider_type: data.pushProviderType
6969
6988
  } : {}));
6970
6989
 
6971
6990
  case 3:
@@ -6989,11 +7008,11 @@ var StreamChat = /*#__PURE__*/function () {
6989
7008
  * testSQSSettings - Tests that the given or configured SQS configuration is valid
6990
7009
  *
6991
7010
  * @param {TestSQSDataInput} [data] Overrides SQS settings for testing if needed
6992
- * IE: {
6993
- sqs_key: 'auth_key',
6994
- sqs_secret: 'auth_secret',
6995
- sqs_url: 'url_to_queue',
6996
- }
7011
+ * IE: {
7012
+ sqs_key: 'auth_key',
7013
+ sqs_secret: 'auth_secret',
7014
+ sqs_url: 'url_to_queue',
7015
+ }
6997
7016
  */
6998
7017
 
6999
7018
  }, {
@@ -7931,23 +7950,26 @@ var StreamChat = /*#__PURE__*/function () {
7931
7950
  * @param {string} id the device id
7932
7951
  * @param {PushProvider} push_provider the push provider
7933
7952
  * @param {string} [userID] the user id (defaults to current user)
7953
+ * @param {string} [push_provider_name] user provided push provider name for multi bundle support
7934
7954
  *
7935
7955
  */
7936
7956
 
7937
7957
  }, {
7938
7958
  key: "addDevice",
7939
7959
  value: function () {
7940
- var _addDevice = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee21(id, push_provider, userID) {
7960
+ var _addDevice = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee21(id, push_provider, userID, push_provider_name) {
7941
7961
  return _regeneratorRuntime__default['default'].wrap(function _callee21$(_context21) {
7942
7962
  while (1) {
7943
7963
  switch (_context21.prev = _context21.next) {
7944
7964
  case 0:
7945
7965
  _context21.next = 2;
7946
- return this.post(this.baseURL + '/devices', _objectSpread({
7966
+ return this.post(this.baseURL + '/devices', _objectSpread(_objectSpread({
7947
7967
  id: id,
7948
7968
  push_provider: push_provider
7949
7969
  }, userID != null ? {
7950
7970
  user_id: userID
7971
+ } : {}), push_provider_name != null ? {
7972
+ push_provider_name: push_provider_name
7951
7973
  } : {}));
7952
7974
 
7953
7975
  case 2:
@@ -7961,7 +7983,7 @@ var StreamChat = /*#__PURE__*/function () {
7961
7983
  }, _callee21, this);
7962
7984
  }));
7963
7985
 
7964
- function addDevice(_x20, _x21, _x22) {
7986
+ function addDevice(_x20, _x21, _x22, _x23) {
7965
7987
  return _addDevice.apply(this, arguments);
7966
7988
  }
7967
7989
 
@@ -7999,7 +8021,7 @@ var StreamChat = /*#__PURE__*/function () {
7999
8021
  }, _callee22, this);
8000
8022
  }));
8001
8023
 
8002
- function getDevices(_x23) {
8024
+ function getDevices(_x24) {
8003
8025
  return _getDevices.apply(this, arguments);
8004
8026
  }
8005
8027
 
@@ -8039,7 +8061,7 @@ var StreamChat = /*#__PURE__*/function () {
8039
8061
  }, _callee23, this);
8040
8062
  }));
8041
8063
 
8042
- function removeDevice(_x24, _x25) {
8064
+ function removeDevice(_x25, _x26) {
8043
8065
  return _removeDevice.apply(this, arguments);
8044
8066
  }
8045
8067
 
@@ -8080,7 +8102,7 @@ var StreamChat = /*#__PURE__*/function () {
8080
8102
  }, _callee24, this);
8081
8103
  }));
8082
8104
 
8083
- function getRateLimits(_x26) {
8105
+ function getRateLimits(_x27) {
8084
8106
  return _getRateLimits.apply(this, arguments);
8085
8107
  }
8086
8108
 
@@ -8181,7 +8203,7 @@ var StreamChat = /*#__PURE__*/function () {
8181
8203
  }, _callee25, this);
8182
8204
  }));
8183
8205
 
8184
- function partialUpdateUser(_x27) {
8206
+ function partialUpdateUser(_x28) {
8185
8207
  return _partialUpdateUser.apply(this, arguments);
8186
8208
  }
8187
8209
 
@@ -8267,7 +8289,7 @@ var StreamChat = /*#__PURE__*/function () {
8267
8289
  }, _callee26, this, [[2, 13, 16, 19]]);
8268
8290
  }));
8269
8291
 
8270
- function upsertUsers(_x28) {
8292
+ function upsertUsers(_x29) {
8271
8293
  return _upsertUsers.apply(this, arguments);
8272
8294
  }
8273
8295
 
@@ -8380,7 +8402,7 @@ var StreamChat = /*#__PURE__*/function () {
8380
8402
  }, _callee27, this, [[1, 11, 14, 17]]);
8381
8403
  }));
8382
8404
 
8383
- function partialUpdateUsers(_x29) {
8405
+ function partialUpdateUsers(_x30) {
8384
8406
  return _partialUpdateUsers.apply(this, arguments);
8385
8407
  }
8386
8408
 
@@ -8408,7 +8430,7 @@ var StreamChat = /*#__PURE__*/function () {
8408
8430
  }, _callee28, this);
8409
8431
  }));
8410
8432
 
8411
- function deleteUser(_x30, _x31) {
8433
+ function deleteUser(_x31, _x32) {
8412
8434
  return _deleteUser.apply(this, arguments);
8413
8435
  }
8414
8436
 
@@ -8436,7 +8458,7 @@ var StreamChat = /*#__PURE__*/function () {
8436
8458
  }, _callee29, this);
8437
8459
  }));
8438
8460
 
8439
- function reactivateUser(_x32, _x33) {
8461
+ function reactivateUser(_x33, _x34) {
8440
8462
  return _reactivateUser.apply(this, arguments);
8441
8463
  }
8442
8464
 
@@ -8464,7 +8486,7 @@ var StreamChat = /*#__PURE__*/function () {
8464
8486
  }, _callee30, this);
8465
8487
  }));
8466
8488
 
8467
- function deactivateUser(_x34, _x35) {
8489
+ function deactivateUser(_x35, _x36) {
8468
8490
  return _deactivateUser.apply(this, arguments);
8469
8491
  }
8470
8492
 
@@ -8492,7 +8514,7 @@ var StreamChat = /*#__PURE__*/function () {
8492
8514
  }, _callee31, this);
8493
8515
  }));
8494
8516
 
8495
- function exportUser(_x36, _x37) {
8517
+ function exportUser(_x37, _x38) {
8496
8518
  return _exportUser.apply(this, arguments);
8497
8519
  }
8498
8520
 
@@ -8529,7 +8551,7 @@ var StreamChat = /*#__PURE__*/function () {
8529
8551
  }, _callee32, this);
8530
8552
  }));
8531
8553
 
8532
- function banUser(_x38, _x39) {
8554
+ function banUser(_x39, _x40) {
8533
8555
  return _banUser.apply(this, arguments);
8534
8556
  }
8535
8557
 
@@ -8566,7 +8588,7 @@ var StreamChat = /*#__PURE__*/function () {
8566
8588
  }, _callee33, this);
8567
8589
  }));
8568
8590
 
8569
- function unbanUser(_x40, _x41) {
8591
+ function unbanUser(_x41, _x42) {
8570
8592
  return _unbanUser.apply(this, arguments);
8571
8593
  }
8572
8594
 
@@ -8603,7 +8625,7 @@ var StreamChat = /*#__PURE__*/function () {
8603
8625
  }, _callee34, this);
8604
8626
  }));
8605
8627
 
8606
- function shadowBan(_x42, _x43) {
8628
+ function shadowBan(_x43, _x44) {
8607
8629
  return _shadowBan.apply(this, arguments);
8608
8630
  }
8609
8631
 
@@ -8640,7 +8662,7 @@ var StreamChat = /*#__PURE__*/function () {
8640
8662
  }, _callee35, this);
8641
8663
  }));
8642
8664
 
8643
- function removeShadowBan(_x44, _x45) {
8665
+ function removeShadowBan(_x45, _x46) {
8644
8666
  return _removeShadowBan.apply(this, arguments);
8645
8667
  }
8646
8668
 
@@ -8683,7 +8705,7 @@ var StreamChat = /*#__PURE__*/function () {
8683
8705
  }, _callee36, this);
8684
8706
  }));
8685
8707
 
8686
- function muteUser(_x46, _x47) {
8708
+ function muteUser(_x47, _x48) {
8687
8709
  return _muteUser.apply(this, arguments);
8688
8710
  }
8689
8711
 
@@ -8722,7 +8744,7 @@ var StreamChat = /*#__PURE__*/function () {
8722
8744
  }, _callee37, this);
8723
8745
  }));
8724
8746
 
8725
- function unmuteUser(_x48, _x49) {
8747
+ function unmuteUser(_x49, _x50) {
8726
8748
  return _unmuteUser.apply(this, arguments);
8727
8749
  }
8728
8750
 
@@ -8781,7 +8803,7 @@ var StreamChat = /*#__PURE__*/function () {
8781
8803
  }, _callee38, this);
8782
8804
  }));
8783
8805
 
8784
- function flagMessage(_x50) {
8806
+ function flagMessage(_x51) {
8785
8807
  return _flagMessage.apply(this, arguments);
8786
8808
  }
8787
8809
 
@@ -8821,7 +8843,7 @@ var StreamChat = /*#__PURE__*/function () {
8821
8843
  }, _callee39, this);
8822
8844
  }));
8823
8845
 
8824
- function flagUser(_x51) {
8846
+ function flagUser(_x52) {
8825
8847
  return _flagUser.apply(this, arguments);
8826
8848
  }
8827
8849
 
@@ -8861,7 +8883,7 @@ var StreamChat = /*#__PURE__*/function () {
8861
8883
  }, _callee40, this);
8862
8884
  }));
8863
8885
 
8864
- function unflagMessage(_x52) {
8886
+ function unflagMessage(_x53) {
8865
8887
  return _unflagMessage.apply(this, arguments);
8866
8888
  }
8867
8889
 
@@ -8901,7 +8923,7 @@ var StreamChat = /*#__PURE__*/function () {
8901
8923
  }, _callee41, this);
8902
8924
  }));
8903
8925
 
8904
- function unflagUser(_x53) {
8926
+ function unflagUser(_x54) {
8905
8927
  return _unflagUser.apply(this, arguments);
8906
8928
  }
8907
8929
 
@@ -9047,7 +9069,7 @@ var StreamChat = /*#__PURE__*/function () {
9047
9069
  }, _callee44, this);
9048
9070
  }));
9049
9071
 
9050
- function _reviewFlagReport(_x54, _x55) {
9072
+ function _reviewFlagReport(_x55, _x56) {
9051
9073
  return _reviewFlagReport2.apply(this, arguments);
9052
9074
  }
9053
9075
 
@@ -9093,7 +9115,7 @@ var StreamChat = /*#__PURE__*/function () {
9093
9115
  }, _callee45, this);
9094
9116
  }));
9095
9117
 
9096
- function _unblockMessage(_x56) {
9118
+ function _unblockMessage(_x57) {
9097
9119
  return _unblockMessage2.apply(this, arguments);
9098
9120
  }
9099
9121
 
@@ -9232,7 +9254,7 @@ var StreamChat = /*#__PURE__*/function () {
9232
9254
  }, _callee47, this);
9233
9255
  }));
9234
9256
 
9235
- function translateMessage(_x57, _x58) {
9257
+ function translateMessage(_x58, _x59) {
9236
9258
  return _translateMessage.apply(this, arguments);
9237
9259
  }
9238
9260
 
@@ -9394,7 +9416,7 @@ var StreamChat = /*#__PURE__*/function () {
9394
9416
  }, _callee48, this);
9395
9417
  }));
9396
9418
 
9397
- function updateMessage(_x59, _x60, _x61) {
9419
+ function updateMessage(_x60, _x61, _x62) {
9398
9420
  return _updateMessage.apply(this, arguments);
9399
9421
  }
9400
9422
 
@@ -9455,7 +9477,7 @@ var StreamChat = /*#__PURE__*/function () {
9455
9477
  }, _callee49, this);
9456
9478
  }));
9457
9479
 
9458
- function partialUpdateMessage(_x62, _x63, _x64, _x65) {
9480
+ function partialUpdateMessage(_x63, _x64, _x65, _x66) {
9459
9481
  return _partialUpdateMessage.apply(this, arguments);
9460
9482
  }
9461
9483
 
@@ -9492,7 +9514,7 @@ var StreamChat = /*#__PURE__*/function () {
9492
9514
  }, _callee50, this);
9493
9515
  }));
9494
9516
 
9495
- function deleteMessage(_x66, _x67) {
9517
+ function deleteMessage(_x67, _x68) {
9496
9518
  return _deleteMessage.apply(this, arguments);
9497
9519
  }
9498
9520
 
@@ -9520,7 +9542,7 @@ var StreamChat = /*#__PURE__*/function () {
9520
9542
  }, _callee51, this);
9521
9543
  }));
9522
9544
 
9523
- function getMessage(_x68) {
9545
+ function getMessage(_x69) {
9524
9546
  return _getMessage.apply(this, arguments);
9525
9547
  }
9526
9548
 
@@ -9529,7 +9551,7 @@ var StreamChat = /*#__PURE__*/function () {
9529
9551
  }, {
9530
9552
  key: "getUserAgent",
9531
9553
  value: function getUserAgent() {
9532
- return this.userAgent || "stream-chat-javascript-client-".concat(this.node ? 'node' : 'browser', "-", "6.3.0");
9554
+ return this.userAgent || "stream-chat-javascript-client-".concat(this.node ? 'node' : 'browser', "-", "6.4.0");
9533
9555
  }
9534
9556
  }, {
9535
9557
  key: "setUserAgent",
@@ -9745,7 +9767,7 @@ var StreamChat = /*#__PURE__*/function () {
9745
9767
  }, _callee52, this);
9746
9768
  }));
9747
9769
 
9748
- function sendUserCustomEvent(_x69, _x70) {
9770
+ function sendUserCustomEvent(_x70, _x71) {
9749
9771
  return _sendUserCustomEvent.apply(this, arguments);
9750
9772
  }
9751
9773
 
@@ -9838,7 +9860,7 @@ var StreamChat = /*#__PURE__*/function () {
9838
9860
  }, _callee53, this);
9839
9861
  }));
9840
9862
 
9841
- function createSegment(_x71) {
9863
+ function createSegment(_x72) {
9842
9864
  return _createSegment.apply(this, arguments);
9843
9865
  }
9844
9866
 
@@ -9878,7 +9900,7 @@ var StreamChat = /*#__PURE__*/function () {
9878
9900
  }, _callee54, this);
9879
9901
  }));
9880
9902
 
9881
- function getSegment(_x72) {
9903
+ function getSegment(_x73) {
9882
9904
  return _getSegment.apply(this, arguments);
9883
9905
  }
9884
9906
 
@@ -9917,7 +9939,7 @@ var StreamChat = /*#__PURE__*/function () {
9917
9939
  }, _callee55, this);
9918
9940
  }));
9919
9941
 
9920
- function listSegments(_x73) {
9942
+ function listSegments(_x74) {
9921
9943
  return _listSegments.apply(this, arguments);
9922
9944
  }
9923
9945
 
@@ -9960,7 +9982,7 @@ var StreamChat = /*#__PURE__*/function () {
9960
9982
  }, _callee56, this);
9961
9983
  }));
9962
9984
 
9963
- function updateSegment(_x74, _x75) {
9985
+ function updateSegment(_x75, _x76) {
9964
9986
  return _updateSegment.apply(this, arguments);
9965
9987
  }
9966
9988
 
@@ -9992,7 +10014,7 @@ var StreamChat = /*#__PURE__*/function () {
9992
10014
  }, _callee57, this);
9993
10015
  }));
9994
10016
 
9995
- function deleteSegment(_x76) {
10017
+ function deleteSegment(_x77) {
9996
10018
  return _deleteSegment.apply(this, arguments);
9997
10019
  }
9998
10020
 
@@ -10034,7 +10056,7 @@ var StreamChat = /*#__PURE__*/function () {
10034
10056
  }, _callee58, this);
10035
10057
  }));
10036
10058
 
10037
- function createCampaign(_x77) {
10059
+ function createCampaign(_x78) {
10038
10060
  return _createCampaign.apply(this, arguments);
10039
10061
  }
10040
10062
 
@@ -10074,7 +10096,7 @@ var StreamChat = /*#__PURE__*/function () {
10074
10096
  }, _callee59, this);
10075
10097
  }));
10076
10098
 
10077
- function getCampaign(_x78) {
10099
+ function getCampaign(_x79) {
10078
10100
  return _getCampaign.apply(this, arguments);
10079
10101
  }
10080
10102
 
@@ -10113,7 +10135,7 @@ var StreamChat = /*#__PURE__*/function () {
10113
10135
  }, _callee60, this);
10114
10136
  }));
10115
10137
 
10116
- function listCampaigns(_x79) {
10138
+ function listCampaigns(_x80) {
10117
10139
  return _listCampaigns.apply(this, arguments);
10118
10140
  }
10119
10141
 
@@ -10156,7 +10178,7 @@ var StreamChat = /*#__PURE__*/function () {
10156
10178
  }, _callee61, this);
10157
10179
  }));
10158
10180
 
10159
- function updateCampaign(_x80, _x81) {
10181
+ function updateCampaign(_x81, _x82) {
10160
10182
  return _updateCampaign.apply(this, arguments);
10161
10183
  }
10162
10184
 
@@ -10188,7 +10210,7 @@ var StreamChat = /*#__PURE__*/function () {
10188
10210
  }, _callee62, this);
10189
10211
  }));
10190
10212
 
10191
- function deleteCampaign(_x82) {
10213
+ function deleteCampaign(_x83) {
10192
10214
  return _deleteCampaign.apply(this, arguments);
10193
10215
  }
10194
10216
 
@@ -10232,7 +10254,7 @@ var StreamChat = /*#__PURE__*/function () {
10232
10254
  }, _callee63, this);
10233
10255
  }));
10234
10256
 
10235
- function scheduleCampaign(_x83, _x84) {
10257
+ function scheduleCampaign(_x84, _x85) {
10236
10258
  return _scheduleCampaign.apply(this, arguments);
10237
10259
  }
10238
10260
 
@@ -10272,7 +10294,7 @@ var StreamChat = /*#__PURE__*/function () {
10272
10294
  }, _callee64, this);
10273
10295
  }));
10274
10296
 
10275
- function stopCampaign(_x85) {
10297
+ function stopCampaign(_x86) {
10276
10298
  return _stopCampaign.apply(this, arguments);
10277
10299
  }
10278
10300
 
@@ -10312,7 +10334,7 @@ var StreamChat = /*#__PURE__*/function () {
10312
10334
  }, _callee65, this);
10313
10335
  }));
10314
10336
 
10315
- function resumeCampaign(_x86) {
10337
+ function resumeCampaign(_x87) {
10316
10338
  return _resumeCampaign.apply(this, arguments);
10317
10339
  }
10318
10340
 
@@ -10355,7 +10377,7 @@ var StreamChat = /*#__PURE__*/function () {
10355
10377
  }, _callee66, this);
10356
10378
  }));
10357
10379
 
10358
- function testCampaign(_x87, _x88) {
10380
+ function testCampaign(_x88, _x89) {
10359
10381
  return _testCampaign.apply(this, arguments);
10360
10382
  }
10361
10383
 
@@ -10388,7 +10410,7 @@ var StreamChat = /*#__PURE__*/function () {
10388
10410
  }, _callee67, this);
10389
10411
  }));
10390
10412
 
10391
- function enrichURL(_x89) {
10413
+ function enrichURL(_x90) {
10392
10414
  return _enrichURL.apply(this, arguments);
10393
10415
  }
10394
10416
 
@@ -10420,7 +10442,7 @@ var StreamChat = /*#__PURE__*/function () {
10420
10442
  }, _callee68, this);
10421
10443
  }));
10422
10444
 
10423
- function getTask(_x90) {
10445
+ function getTask(_x91) {
10424
10446
  return _getTask.apply(this, arguments);
10425
10447
  }
10426
10448
 
@@ -10462,7 +10484,7 @@ var StreamChat = /*#__PURE__*/function () {
10462
10484
  }, _callee69, this);
10463
10485
  }));
10464
10486
 
10465
- function deleteChannels(_x91) {
10487
+ function deleteChannels(_x92) {
10466
10488
  return _deleteChannels.apply(this, arguments);
10467
10489
  }
10468
10490
 
@@ -10525,7 +10547,7 @@ var StreamChat = /*#__PURE__*/function () {
10525
10547
  }, _callee70, this);
10526
10548
  }));
10527
10549
 
10528
- function deleteUsers(_x92, _x93) {
10550
+ function deleteUsers(_x93, _x94) {
10529
10551
  return _deleteUsers.apply(this, arguments);
10530
10552
  }
10531
10553
 
@@ -10540,7 +10562,6 @@ var StreamChat = /*#__PURE__*/function () {
10540
10562
  *
10541
10563
  * @private
10542
10564
  * @param {string} filename filename of uploaded data
10543
- *
10544
10565
  * @return {APIResponse & CreateImportResponse} An ImportTask
10545
10566
  */
10546
10567
 
@@ -10568,7 +10589,7 @@ var StreamChat = /*#__PURE__*/function () {
10568
10589
  }, _callee71, this);
10569
10590
  }));
10570
10591
 
10571
- function _createImportURL(_x94) {
10592
+ function _createImportURL(_x95) {
10572
10593
  return _createImportURL2.apply(this, arguments);
10573
10594
  }
10574
10595
 
@@ -10583,7 +10604,7 @@ var StreamChat = /*#__PURE__*/function () {
10583
10604
  *
10584
10605
  * @private
10585
10606
  * @param {string} path path of uploaded data
10586
- *
10607
+ * @param {CreateImportOptions} options import options
10587
10608
  * @return {APIResponse & CreateImportResponse} An ImportTask
10588
10609
  */
10589
10610
 
@@ -10591,19 +10612,24 @@ var StreamChat = /*#__PURE__*/function () {
10591
10612
  key: "_createImport",
10592
10613
  value: function () {
10593
10614
  var _createImport2 = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee72(path) {
10615
+ var options,
10616
+ _args72 = arguments;
10594
10617
  return _regeneratorRuntime__default['default'].wrap(function _callee72$(_context72) {
10595
10618
  while (1) {
10596
10619
  switch (_context72.prev = _context72.next) {
10597
10620
  case 0:
10598
- _context72.next = 2;
10599
- return this.post(this.baseURL + "/imports", {
10621
+ options = _args72.length > 1 && _args72[1] !== undefined ? _args72[1] : {
10622
+ mode: 'upsert'
10623
+ };
10624
+ _context72.next = 3;
10625
+ return this.post(this.baseURL + "/imports", _objectSpread({
10600
10626
  path: path
10601
- });
10627
+ }, options));
10602
10628
 
10603
- case 2:
10629
+ case 3:
10604
10630
  return _context72.abrupt("return", _context72.sent);
10605
10631
 
10606
- case 3:
10632
+ case 4:
10607
10633
  case "end":
10608
10634
  return _context72.stop();
10609
10635
  }
@@ -10611,7 +10637,7 @@ var StreamChat = /*#__PURE__*/function () {
10611
10637
  }, _callee72, this);
10612
10638
  }));
10613
10639
 
10614
- function _createImport(_x95) {
10640
+ function _createImport(_x96) {
10615
10641
  return _createImport2.apply(this, arguments);
10616
10642
  }
10617
10643
 
@@ -10652,7 +10678,7 @@ var StreamChat = /*#__PURE__*/function () {
10652
10678
  }, _callee73, this);
10653
10679
  }));
10654
10680
 
10655
- function _getImport(_x96) {
10681
+ function _getImport(_x97) {
10656
10682
  return _getImport2.apply(this, arguments);
10657
10683
  }
10658
10684
 
@@ -10693,7 +10719,7 @@ var StreamChat = /*#__PURE__*/function () {
10693
10719
  }, _callee74, this);
10694
10720
  }));
10695
10721
 
10696
- function _listImports(_x97) {
10722
+ function _listImports(_x98) {
10697
10723
  return _listImports2.apply(this, arguments);
10698
10724
  }
10699
10725
 
@@ -10733,7 +10759,7 @@ var StreamChat = /*#__PURE__*/function () {
10733
10759
  }, _callee75, this);
10734
10760
  }));
10735
10761
 
10736
- function upsertPushProvider(_x98) {
10762
+ function upsertPushProvider(_x99) {
10737
10763
  return _upsertPushProvider.apply(this, arguments);
10738
10764
  }
10739
10765
 
@@ -10773,7 +10799,7 @@ var StreamChat = /*#__PURE__*/function () {
10773
10799
  }, _callee76, this);
10774
10800
  }));
10775
10801
 
10776
- function deletePushProvider(_x99) {
10802
+ function deletePushProvider(_x100) {
10777
10803
  return _deletePushProvider.apply(this, arguments);
10778
10804
  }
10779
10805