stream-chat 8.17.0 → 8.18.1
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.es.js +902 -395
- package/dist/browser.es.js.map +1 -1
- package/dist/browser.full-bundle.min.js +1 -1
- package/dist/browser.full-bundle.min.js.map +1 -1
- package/dist/browser.js +903 -394
- package/dist/browser.js.map +1 -1
- package/dist/index.es.js +902 -395
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +903 -394
- package/dist/index.js.map +1 -1
- package/dist/types/campaign.d.ts +35 -0
- package/dist/types/campaign.d.ts.map +1 -0
- package/dist/types/client.d.ts +46 -50
- package/dist/types/client.d.ts.map +1 -1
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/segment.d.ts +35 -0
- package/dist/types/segment.d.ts.map +1 -0
- package/dist/types/thread.d.ts +5 -0
- package/dist/types/thread.d.ts.map +1 -1
- package/dist/types/types.d.ts +52 -30
- package/dist/types/types.d.ts.map +1 -1
- package/dist/types/utils.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/campaign.ts +97 -0
- package/src/client.ts +119 -92
- package/src/index.ts +2 -0
- package/src/segment.ts +89 -0
- package/src/thread.ts +18 -6
- package/src/types.ts +53 -34
- package/src/utils.ts +1 -0
package/dist/index.js
CHANGED
|
@@ -188,6 +188,7 @@ function isOwnUserBaseProperty(property) {
|
|
|
188
188
|
total_unread_count: true,
|
|
189
189
|
unread_channels: true,
|
|
190
190
|
unread_count: true,
|
|
191
|
+
unread_threads: true,
|
|
191
192
|
invisible: true,
|
|
192
193
|
roles: true
|
|
193
194
|
};
|
|
@@ -6118,6 +6119,544 @@ var WSConnectionFallback = /*#__PURE__*/function () {
|
|
|
6118
6119
|
return WSConnectionFallback;
|
|
6119
6120
|
}();
|
|
6120
6121
|
|
|
6122
|
+
var Campaign = /*#__PURE__*/function () {
|
|
6123
|
+
function Campaign(client, id, data) {
|
|
6124
|
+
_classCallCheck__default['default'](this, Campaign);
|
|
6125
|
+
|
|
6126
|
+
_defineProperty__default['default'](this, "id", void 0);
|
|
6127
|
+
|
|
6128
|
+
_defineProperty__default['default'](this, "data", void 0);
|
|
6129
|
+
|
|
6130
|
+
_defineProperty__default['default'](this, "client", void 0);
|
|
6131
|
+
|
|
6132
|
+
this.client = client;
|
|
6133
|
+
this.id = id;
|
|
6134
|
+
this.data = data;
|
|
6135
|
+
}
|
|
6136
|
+
|
|
6137
|
+
_createClass__default['default'](Campaign, [{
|
|
6138
|
+
key: "create",
|
|
6139
|
+
value: function () {
|
|
6140
|
+
var _create = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee() {
|
|
6141
|
+
var _this$data, _this$data2, _this$data3, _this$data4, _this$data5, _this$data6, _this$data7, _this$data8;
|
|
6142
|
+
|
|
6143
|
+
var body, result;
|
|
6144
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee$(_context) {
|
|
6145
|
+
while (1) {
|
|
6146
|
+
switch (_context.prev = _context.next) {
|
|
6147
|
+
case 0:
|
|
6148
|
+
body = {
|
|
6149
|
+
id: this.id,
|
|
6150
|
+
message_template: (_this$data = this.data) === null || _this$data === void 0 ? void 0 : _this$data.message_template,
|
|
6151
|
+
segment_ids: (_this$data2 = this.data) === null || _this$data2 === void 0 ? void 0 : _this$data2.segment_ids,
|
|
6152
|
+
sender_id: (_this$data3 = this.data) === null || _this$data3 === void 0 ? void 0 : _this$data3.sender_id,
|
|
6153
|
+
channel_template: (_this$data4 = this.data) === null || _this$data4 === void 0 ? void 0 : _this$data4.channel_template,
|
|
6154
|
+
create_channels: (_this$data5 = this.data) === null || _this$data5 === void 0 ? void 0 : _this$data5.create_channels,
|
|
6155
|
+
description: (_this$data6 = this.data) === null || _this$data6 === void 0 ? void 0 : _this$data6.description,
|
|
6156
|
+
name: (_this$data7 = this.data) === null || _this$data7 === void 0 ? void 0 : _this$data7.name,
|
|
6157
|
+
user_ids: (_this$data8 = this.data) === null || _this$data8 === void 0 ? void 0 : _this$data8.user_ids
|
|
6158
|
+
};
|
|
6159
|
+
_context.next = 3;
|
|
6160
|
+
return this.client.createCampaign(body);
|
|
6161
|
+
|
|
6162
|
+
case 3:
|
|
6163
|
+
result = _context.sent;
|
|
6164
|
+
this.id = result.campaign.id;
|
|
6165
|
+
this.data = result.campaign;
|
|
6166
|
+
return _context.abrupt("return", result);
|
|
6167
|
+
|
|
6168
|
+
case 7:
|
|
6169
|
+
case "end":
|
|
6170
|
+
return _context.stop();
|
|
6171
|
+
}
|
|
6172
|
+
}
|
|
6173
|
+
}, _callee, this);
|
|
6174
|
+
}));
|
|
6175
|
+
|
|
6176
|
+
function create() {
|
|
6177
|
+
return _create.apply(this, arguments);
|
|
6178
|
+
}
|
|
6179
|
+
|
|
6180
|
+
return create;
|
|
6181
|
+
}()
|
|
6182
|
+
}, {
|
|
6183
|
+
key: "verifyCampaignId",
|
|
6184
|
+
value: function verifyCampaignId() {
|
|
6185
|
+
if (!this.id) {
|
|
6186
|
+
throw new Error('Campaign id is missing. Either create the campaign using campaign.create() or set the id during instantiation - const campaign = client.campaign(id)');
|
|
6187
|
+
}
|
|
6188
|
+
}
|
|
6189
|
+
}, {
|
|
6190
|
+
key: "start",
|
|
6191
|
+
value: function () {
|
|
6192
|
+
var _start = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee2(scheduledFor) {
|
|
6193
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee2$(_context2) {
|
|
6194
|
+
while (1) {
|
|
6195
|
+
switch (_context2.prev = _context2.next) {
|
|
6196
|
+
case 0:
|
|
6197
|
+
this.verifyCampaignId();
|
|
6198
|
+
_context2.next = 3;
|
|
6199
|
+
return this.client.startCampaign(this.id, scheduledFor);
|
|
6200
|
+
|
|
6201
|
+
case 3:
|
|
6202
|
+
return _context2.abrupt("return", _context2.sent);
|
|
6203
|
+
|
|
6204
|
+
case 4:
|
|
6205
|
+
case "end":
|
|
6206
|
+
return _context2.stop();
|
|
6207
|
+
}
|
|
6208
|
+
}
|
|
6209
|
+
}, _callee2, this);
|
|
6210
|
+
}));
|
|
6211
|
+
|
|
6212
|
+
function start(_x) {
|
|
6213
|
+
return _start.apply(this, arguments);
|
|
6214
|
+
}
|
|
6215
|
+
|
|
6216
|
+
return start;
|
|
6217
|
+
}()
|
|
6218
|
+
}, {
|
|
6219
|
+
key: "update",
|
|
6220
|
+
value: function () {
|
|
6221
|
+
var _update = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee3(data) {
|
|
6222
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee3$(_context3) {
|
|
6223
|
+
while (1) {
|
|
6224
|
+
switch (_context3.prev = _context3.next) {
|
|
6225
|
+
case 0:
|
|
6226
|
+
this.verifyCampaignId();
|
|
6227
|
+
return _context3.abrupt("return", this.client.updateCampaign(this.id, data));
|
|
6228
|
+
|
|
6229
|
+
case 2:
|
|
6230
|
+
case "end":
|
|
6231
|
+
return _context3.stop();
|
|
6232
|
+
}
|
|
6233
|
+
}
|
|
6234
|
+
}, _callee3, this);
|
|
6235
|
+
}));
|
|
6236
|
+
|
|
6237
|
+
function update(_x2) {
|
|
6238
|
+
return _update.apply(this, arguments);
|
|
6239
|
+
}
|
|
6240
|
+
|
|
6241
|
+
return update;
|
|
6242
|
+
}()
|
|
6243
|
+
}, {
|
|
6244
|
+
key: "delete",
|
|
6245
|
+
value: function () {
|
|
6246
|
+
var _delete2 = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee4() {
|
|
6247
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee4$(_context4) {
|
|
6248
|
+
while (1) {
|
|
6249
|
+
switch (_context4.prev = _context4.next) {
|
|
6250
|
+
case 0:
|
|
6251
|
+
this.verifyCampaignId();
|
|
6252
|
+
_context4.next = 3;
|
|
6253
|
+
return this.client.delete(this.client.baseURL + "/campaigns/".concat(this.id));
|
|
6254
|
+
|
|
6255
|
+
case 3:
|
|
6256
|
+
return _context4.abrupt("return", _context4.sent);
|
|
6257
|
+
|
|
6258
|
+
case 4:
|
|
6259
|
+
case "end":
|
|
6260
|
+
return _context4.stop();
|
|
6261
|
+
}
|
|
6262
|
+
}
|
|
6263
|
+
}, _callee4, this);
|
|
6264
|
+
}));
|
|
6265
|
+
|
|
6266
|
+
function _delete() {
|
|
6267
|
+
return _delete2.apply(this, arguments);
|
|
6268
|
+
}
|
|
6269
|
+
|
|
6270
|
+
return _delete;
|
|
6271
|
+
}()
|
|
6272
|
+
}, {
|
|
6273
|
+
key: "schedule",
|
|
6274
|
+
value: function () {
|
|
6275
|
+
var _schedule = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee5(params) {
|
|
6276
|
+
var scheduledFor, _yield$this$client$pa, campaign;
|
|
6277
|
+
|
|
6278
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee5$(_context5) {
|
|
6279
|
+
while (1) {
|
|
6280
|
+
switch (_context5.prev = _context5.next) {
|
|
6281
|
+
case 0:
|
|
6282
|
+
this.verifyCampaignId();
|
|
6283
|
+
scheduledFor = params.scheduledFor;
|
|
6284
|
+
_context5.next = 4;
|
|
6285
|
+
return this.client.patch(this.client.baseURL + "/campaigns/".concat(this.id, "/schedule"), {
|
|
6286
|
+
scheduled_for: scheduledFor
|
|
6287
|
+
});
|
|
6288
|
+
|
|
6289
|
+
case 4:
|
|
6290
|
+
_yield$this$client$pa = _context5.sent;
|
|
6291
|
+
campaign = _yield$this$client$pa.campaign;
|
|
6292
|
+
return _context5.abrupt("return", campaign);
|
|
6293
|
+
|
|
6294
|
+
case 7:
|
|
6295
|
+
case "end":
|
|
6296
|
+
return _context5.stop();
|
|
6297
|
+
}
|
|
6298
|
+
}
|
|
6299
|
+
}, _callee5, this);
|
|
6300
|
+
}));
|
|
6301
|
+
|
|
6302
|
+
function schedule(_x3) {
|
|
6303
|
+
return _schedule.apply(this, arguments);
|
|
6304
|
+
}
|
|
6305
|
+
|
|
6306
|
+
return schedule;
|
|
6307
|
+
}()
|
|
6308
|
+
}, {
|
|
6309
|
+
key: "stop",
|
|
6310
|
+
value: function () {
|
|
6311
|
+
var _stop = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee6() {
|
|
6312
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee6$(_context6) {
|
|
6313
|
+
while (1) {
|
|
6314
|
+
switch (_context6.prev = _context6.next) {
|
|
6315
|
+
case 0:
|
|
6316
|
+
this.verifyCampaignId();
|
|
6317
|
+
return _context6.abrupt("return", this.client.patch(this.client.baseURL + "/campaigns/".concat(this.id, "/stop")));
|
|
6318
|
+
|
|
6319
|
+
case 2:
|
|
6320
|
+
case "end":
|
|
6321
|
+
return _context6.stop();
|
|
6322
|
+
}
|
|
6323
|
+
}
|
|
6324
|
+
}, _callee6, this);
|
|
6325
|
+
}));
|
|
6326
|
+
|
|
6327
|
+
function stop() {
|
|
6328
|
+
return _stop.apply(this, arguments);
|
|
6329
|
+
}
|
|
6330
|
+
|
|
6331
|
+
return stop;
|
|
6332
|
+
}()
|
|
6333
|
+
}, {
|
|
6334
|
+
key: "pause",
|
|
6335
|
+
value: function () {
|
|
6336
|
+
var _pause = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee7() {
|
|
6337
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee7$(_context7) {
|
|
6338
|
+
while (1) {
|
|
6339
|
+
switch (_context7.prev = _context7.next) {
|
|
6340
|
+
case 0:
|
|
6341
|
+
this.verifyCampaignId();
|
|
6342
|
+
return _context7.abrupt("return", this.client.patch(this.client.baseURL + "/campaigns/".concat(this.id, "/pause")));
|
|
6343
|
+
|
|
6344
|
+
case 2:
|
|
6345
|
+
case "end":
|
|
6346
|
+
return _context7.stop();
|
|
6347
|
+
}
|
|
6348
|
+
}
|
|
6349
|
+
}, _callee7, this);
|
|
6350
|
+
}));
|
|
6351
|
+
|
|
6352
|
+
function pause() {
|
|
6353
|
+
return _pause.apply(this, arguments);
|
|
6354
|
+
}
|
|
6355
|
+
|
|
6356
|
+
return pause;
|
|
6357
|
+
}()
|
|
6358
|
+
}, {
|
|
6359
|
+
key: "resume",
|
|
6360
|
+
value: function () {
|
|
6361
|
+
var _resume = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee8() {
|
|
6362
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee8$(_context8) {
|
|
6363
|
+
while (1) {
|
|
6364
|
+
switch (_context8.prev = _context8.next) {
|
|
6365
|
+
case 0:
|
|
6366
|
+
this.verifyCampaignId();
|
|
6367
|
+
return _context8.abrupt("return", this.client.patch(this.client.baseURL + "/campaigns/".concat(this.id, "/resume")));
|
|
6368
|
+
|
|
6369
|
+
case 2:
|
|
6370
|
+
case "end":
|
|
6371
|
+
return _context8.stop();
|
|
6372
|
+
}
|
|
6373
|
+
}
|
|
6374
|
+
}, _callee8, this);
|
|
6375
|
+
}));
|
|
6376
|
+
|
|
6377
|
+
function resume() {
|
|
6378
|
+
return _resume.apply(this, arguments);
|
|
6379
|
+
}
|
|
6380
|
+
|
|
6381
|
+
return resume;
|
|
6382
|
+
}()
|
|
6383
|
+
}, {
|
|
6384
|
+
key: "get",
|
|
6385
|
+
value: function () {
|
|
6386
|
+
var _get = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee9() {
|
|
6387
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee9$(_context9) {
|
|
6388
|
+
while (1) {
|
|
6389
|
+
switch (_context9.prev = _context9.next) {
|
|
6390
|
+
case 0:
|
|
6391
|
+
this.verifyCampaignId();
|
|
6392
|
+
return _context9.abrupt("return", this.client.getCampaign(this.id));
|
|
6393
|
+
|
|
6394
|
+
case 2:
|
|
6395
|
+
case "end":
|
|
6396
|
+
return _context9.stop();
|
|
6397
|
+
}
|
|
6398
|
+
}
|
|
6399
|
+
}, _callee9, this);
|
|
6400
|
+
}));
|
|
6401
|
+
|
|
6402
|
+
function get() {
|
|
6403
|
+
return _get.apply(this, arguments);
|
|
6404
|
+
}
|
|
6405
|
+
|
|
6406
|
+
return get;
|
|
6407
|
+
}()
|
|
6408
|
+
}]);
|
|
6409
|
+
|
|
6410
|
+
return Campaign;
|
|
6411
|
+
}();
|
|
6412
|
+
|
|
6413
|
+
var Segment = /*#__PURE__*/function () {
|
|
6414
|
+
function Segment(client, type, id, data) {
|
|
6415
|
+
_classCallCheck__default['default'](this, Segment);
|
|
6416
|
+
|
|
6417
|
+
_defineProperty__default['default'](this, "type", void 0);
|
|
6418
|
+
|
|
6419
|
+
_defineProperty__default['default'](this, "id", void 0);
|
|
6420
|
+
|
|
6421
|
+
_defineProperty__default['default'](this, "client", void 0);
|
|
6422
|
+
|
|
6423
|
+
_defineProperty__default['default'](this, "data", void 0);
|
|
6424
|
+
|
|
6425
|
+
this.client = client;
|
|
6426
|
+
this.type = type;
|
|
6427
|
+
this.id = id;
|
|
6428
|
+
this.data = data;
|
|
6429
|
+
}
|
|
6430
|
+
|
|
6431
|
+
_createClass__default['default'](Segment, [{
|
|
6432
|
+
key: "create",
|
|
6433
|
+
value: function () {
|
|
6434
|
+
var _create = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee() {
|
|
6435
|
+
var _this$data, _this$data2, _this$data3, _this$data4;
|
|
6436
|
+
|
|
6437
|
+
var body;
|
|
6438
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee$(_context) {
|
|
6439
|
+
while (1) {
|
|
6440
|
+
switch (_context.prev = _context.next) {
|
|
6441
|
+
case 0:
|
|
6442
|
+
body = {
|
|
6443
|
+
id: this.id,
|
|
6444
|
+
type: this.type,
|
|
6445
|
+
name: (_this$data = this.data) === null || _this$data === void 0 ? void 0 : _this$data.name,
|
|
6446
|
+
filter: (_this$data2 = this.data) === null || _this$data2 === void 0 ? void 0 : _this$data2.filter,
|
|
6447
|
+
description: (_this$data3 = this.data) === null || _this$data3 === void 0 ? void 0 : _this$data3.description,
|
|
6448
|
+
all_users: (_this$data4 = this.data) === null || _this$data4 === void 0 ? void 0 : _this$data4.all_users
|
|
6449
|
+
};
|
|
6450
|
+
return _context.abrupt("return", this.client.post(this.client.baseURL + "/segments", body));
|
|
6451
|
+
|
|
6452
|
+
case 2:
|
|
6453
|
+
case "end":
|
|
6454
|
+
return _context.stop();
|
|
6455
|
+
}
|
|
6456
|
+
}
|
|
6457
|
+
}, _callee, this);
|
|
6458
|
+
}));
|
|
6459
|
+
|
|
6460
|
+
function create() {
|
|
6461
|
+
return _create.apply(this, arguments);
|
|
6462
|
+
}
|
|
6463
|
+
|
|
6464
|
+
return create;
|
|
6465
|
+
}()
|
|
6466
|
+
}, {
|
|
6467
|
+
key: "verifySegmentId",
|
|
6468
|
+
value: function verifySegmentId() {
|
|
6469
|
+
if (!this.id) {
|
|
6470
|
+
throw new Error('Segment id is missing. Either create the segment using segment.create() or set the id during instantiation - const segment = client.segment(id)');
|
|
6471
|
+
}
|
|
6472
|
+
}
|
|
6473
|
+
}, {
|
|
6474
|
+
key: "get",
|
|
6475
|
+
value: function () {
|
|
6476
|
+
var _get = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee2() {
|
|
6477
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee2$(_context2) {
|
|
6478
|
+
while (1) {
|
|
6479
|
+
switch (_context2.prev = _context2.next) {
|
|
6480
|
+
case 0:
|
|
6481
|
+
this.verifySegmentId();
|
|
6482
|
+
return _context2.abrupt("return", this.client.getSegment(this.id));
|
|
6483
|
+
|
|
6484
|
+
case 2:
|
|
6485
|
+
case "end":
|
|
6486
|
+
return _context2.stop();
|
|
6487
|
+
}
|
|
6488
|
+
}
|
|
6489
|
+
}, _callee2, this);
|
|
6490
|
+
}));
|
|
6491
|
+
|
|
6492
|
+
function get() {
|
|
6493
|
+
return _get.apply(this, arguments);
|
|
6494
|
+
}
|
|
6495
|
+
|
|
6496
|
+
return get;
|
|
6497
|
+
}()
|
|
6498
|
+
}, {
|
|
6499
|
+
key: "update",
|
|
6500
|
+
value: function () {
|
|
6501
|
+
var _update = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee3(data) {
|
|
6502
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee3$(_context3) {
|
|
6503
|
+
while (1) {
|
|
6504
|
+
switch (_context3.prev = _context3.next) {
|
|
6505
|
+
case 0:
|
|
6506
|
+
this.verifySegmentId();
|
|
6507
|
+
return _context3.abrupt("return", this.client.updateSegment(this.id, data));
|
|
6508
|
+
|
|
6509
|
+
case 2:
|
|
6510
|
+
case "end":
|
|
6511
|
+
return _context3.stop();
|
|
6512
|
+
}
|
|
6513
|
+
}
|
|
6514
|
+
}, _callee3, this);
|
|
6515
|
+
}));
|
|
6516
|
+
|
|
6517
|
+
function update(_x) {
|
|
6518
|
+
return _update.apply(this, arguments);
|
|
6519
|
+
}
|
|
6520
|
+
|
|
6521
|
+
return update;
|
|
6522
|
+
}()
|
|
6523
|
+
}, {
|
|
6524
|
+
key: "addTargets",
|
|
6525
|
+
value: function () {
|
|
6526
|
+
var _addTargets = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee4(targets) {
|
|
6527
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee4$(_context4) {
|
|
6528
|
+
while (1) {
|
|
6529
|
+
switch (_context4.prev = _context4.next) {
|
|
6530
|
+
case 0:
|
|
6531
|
+
this.verifySegmentId();
|
|
6532
|
+
return _context4.abrupt("return", this.client.addSegmentTargets(this.id, targets));
|
|
6533
|
+
|
|
6534
|
+
case 2:
|
|
6535
|
+
case "end":
|
|
6536
|
+
return _context4.stop();
|
|
6537
|
+
}
|
|
6538
|
+
}
|
|
6539
|
+
}, _callee4, this);
|
|
6540
|
+
}));
|
|
6541
|
+
|
|
6542
|
+
function addTargets(_x2) {
|
|
6543
|
+
return _addTargets.apply(this, arguments);
|
|
6544
|
+
}
|
|
6545
|
+
|
|
6546
|
+
return addTargets;
|
|
6547
|
+
}()
|
|
6548
|
+
}, {
|
|
6549
|
+
key: "removeTargets",
|
|
6550
|
+
value: function () {
|
|
6551
|
+
var _removeTargets = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee5(targets) {
|
|
6552
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee5$(_context5) {
|
|
6553
|
+
while (1) {
|
|
6554
|
+
switch (_context5.prev = _context5.next) {
|
|
6555
|
+
case 0:
|
|
6556
|
+
this.verifySegmentId();
|
|
6557
|
+
return _context5.abrupt("return", this.client.removeSegmentTargets(this.id, targets));
|
|
6558
|
+
|
|
6559
|
+
case 2:
|
|
6560
|
+
case "end":
|
|
6561
|
+
return _context5.stop();
|
|
6562
|
+
}
|
|
6563
|
+
}
|
|
6564
|
+
}, _callee5, this);
|
|
6565
|
+
}));
|
|
6566
|
+
|
|
6567
|
+
function removeTargets(_x3) {
|
|
6568
|
+
return _removeTargets.apply(this, arguments);
|
|
6569
|
+
}
|
|
6570
|
+
|
|
6571
|
+
return removeTargets;
|
|
6572
|
+
}()
|
|
6573
|
+
}, {
|
|
6574
|
+
key: "delete",
|
|
6575
|
+
value: function () {
|
|
6576
|
+
var _delete2 = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee6() {
|
|
6577
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee6$(_context6) {
|
|
6578
|
+
while (1) {
|
|
6579
|
+
switch (_context6.prev = _context6.next) {
|
|
6580
|
+
case 0:
|
|
6581
|
+
this.verifySegmentId();
|
|
6582
|
+
return _context6.abrupt("return", this.client.deleteSegment(this.id));
|
|
6583
|
+
|
|
6584
|
+
case 2:
|
|
6585
|
+
case "end":
|
|
6586
|
+
return _context6.stop();
|
|
6587
|
+
}
|
|
6588
|
+
}
|
|
6589
|
+
}, _callee6, this);
|
|
6590
|
+
}));
|
|
6591
|
+
|
|
6592
|
+
function _delete() {
|
|
6593
|
+
return _delete2.apply(this, arguments);
|
|
6594
|
+
}
|
|
6595
|
+
|
|
6596
|
+
return _delete;
|
|
6597
|
+
}()
|
|
6598
|
+
}, {
|
|
6599
|
+
key: "targetExists",
|
|
6600
|
+
value: function () {
|
|
6601
|
+
var _targetExists = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee7(targetId) {
|
|
6602
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee7$(_context7) {
|
|
6603
|
+
while (1) {
|
|
6604
|
+
switch (_context7.prev = _context7.next) {
|
|
6605
|
+
case 0:
|
|
6606
|
+
this.verifySegmentId();
|
|
6607
|
+
return _context7.abrupt("return", this.client.segmentTargetExists(this.id, targetId));
|
|
6608
|
+
|
|
6609
|
+
case 2:
|
|
6610
|
+
case "end":
|
|
6611
|
+
return _context7.stop();
|
|
6612
|
+
}
|
|
6613
|
+
}
|
|
6614
|
+
}, _callee7, this);
|
|
6615
|
+
}));
|
|
6616
|
+
|
|
6617
|
+
function targetExists(_x4) {
|
|
6618
|
+
return _targetExists.apply(this, arguments);
|
|
6619
|
+
}
|
|
6620
|
+
|
|
6621
|
+
return targetExists;
|
|
6622
|
+
}()
|
|
6623
|
+
}, {
|
|
6624
|
+
key: "queryTargets",
|
|
6625
|
+
value: function () {
|
|
6626
|
+
var _queryTargets = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee8() {
|
|
6627
|
+
var filter,
|
|
6628
|
+
sort,
|
|
6629
|
+
options,
|
|
6630
|
+
_args8 = arguments;
|
|
6631
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee8$(_context8) {
|
|
6632
|
+
while (1) {
|
|
6633
|
+
switch (_context8.prev = _context8.next) {
|
|
6634
|
+
case 0:
|
|
6635
|
+
filter = _args8.length > 0 && _args8[0] !== undefined ? _args8[0] : {};
|
|
6636
|
+
sort = _args8.length > 1 && _args8[1] !== undefined ? _args8[1] : [];
|
|
6637
|
+
options = _args8.length > 2 && _args8[2] !== undefined ? _args8[2] : {};
|
|
6638
|
+
this.verifySegmentId();
|
|
6639
|
+
return _context8.abrupt("return", this.client.querySegmentTargets(this.id, filter, sort, options));
|
|
6640
|
+
|
|
6641
|
+
case 5:
|
|
6642
|
+
case "end":
|
|
6643
|
+
return _context8.stop();
|
|
6644
|
+
}
|
|
6645
|
+
}
|
|
6646
|
+
}, _callee8, this);
|
|
6647
|
+
}));
|
|
6648
|
+
|
|
6649
|
+
function queryTargets() {
|
|
6650
|
+
return _queryTargets.apply(this, arguments);
|
|
6651
|
+
}
|
|
6652
|
+
|
|
6653
|
+
return queryTargets;
|
|
6654
|
+
}()
|
|
6655
|
+
}]);
|
|
6656
|
+
|
|
6657
|
+
return Segment;
|
|
6658
|
+
}();
|
|
6659
|
+
|
|
6121
6660
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf__default['default'](Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf__default['default'](this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn__default['default'](this, result); }; }
|
|
6122
6661
|
|
|
6123
6662
|
function _isNativeReflectConstruct() { 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; } }
|
|
@@ -6244,20 +6783,22 @@ var Thread = /*#__PURE__*/function () {
|
|
|
6244
6783
|
this._channel = client.channel(t.channel.type, t.channel.id);
|
|
6245
6784
|
this._client = client;
|
|
6246
6785
|
|
|
6247
|
-
|
|
6248
|
-
|
|
6786
|
+
if (t.read) {
|
|
6787
|
+
var _iterator = _createForOfIteratorHelper$1(t.read),
|
|
6788
|
+
_step;
|
|
6249
6789
|
|
|
6250
|
-
|
|
6251
|
-
|
|
6252
|
-
|
|
6253
|
-
|
|
6254
|
-
|
|
6255
|
-
|
|
6790
|
+
try {
|
|
6791
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
6792
|
+
var r = _step.value;
|
|
6793
|
+
this.read[r.user.id] = _objectSpread$1(_objectSpread$1({}, r), {}, {
|
|
6794
|
+
last_read: new Date(r.last_read)
|
|
6795
|
+
});
|
|
6796
|
+
}
|
|
6797
|
+
} catch (err) {
|
|
6798
|
+
_iterator.e(err);
|
|
6799
|
+
} finally {
|
|
6800
|
+
_iterator.f();
|
|
6256
6801
|
}
|
|
6257
|
-
} catch (err) {
|
|
6258
|
-
_iterator.e(err);
|
|
6259
|
-
} finally {
|
|
6260
|
-
_iterator.f();
|
|
6261
6802
|
}
|
|
6262
6803
|
}
|
|
6263
6804
|
|
|
@@ -6266,10 +6807,20 @@ var Thread = /*#__PURE__*/function () {
|
|
|
6266
6807
|
value: function getClient() {
|
|
6267
6808
|
return this._client;
|
|
6268
6809
|
}
|
|
6810
|
+
/**
|
|
6811
|
+
* addReply - Adds or updates a latestReplies to the thread
|
|
6812
|
+
*
|
|
6813
|
+
* @param {MessageResponse<StreamChatGenerics>} message reply message to be added.
|
|
6814
|
+
*/
|
|
6815
|
+
|
|
6269
6816
|
}, {
|
|
6270
6817
|
key: "addReply",
|
|
6271
6818
|
value: function addReply(message) {
|
|
6272
|
-
|
|
6819
|
+
if (message.parent_id !== this.message.id) {
|
|
6820
|
+
throw new Error('Message does not belong to this thread');
|
|
6821
|
+
}
|
|
6822
|
+
|
|
6823
|
+
this.latestReplies = addToMessageList(this.latestReplies, formatMessage(message), true);
|
|
6273
6824
|
}
|
|
6274
6825
|
}, {
|
|
6275
6826
|
key: "updateReply",
|
|
@@ -6295,6 +6846,7 @@ var Thread = /*#__PURE__*/function () {
|
|
|
6295
6846
|
|
|
6296
6847
|
if (message.parent_id && message.parent_id === this.message.id) {
|
|
6297
6848
|
this.updateReply(message);
|
|
6849
|
+
return;
|
|
6298
6850
|
}
|
|
6299
6851
|
|
|
6300
6852
|
if (!message.parent_id && message.id === this.message.id) {
|
|
@@ -10635,7 +11187,7 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
10635
11187
|
}, {
|
|
10636
11188
|
key: "getUserAgent",
|
|
10637
11189
|
value: function getUserAgent() {
|
|
10638
|
-
return this.userAgent || "stream-chat-javascript-client-".concat(this.node ? 'node' : 'browser', "-", "8.
|
|
11190
|
+
return this.userAgent || "stream-chat-javascript-client-".concat(this.node ? 'node' : 'browser', "-", "8.18.1");
|
|
10639
11191
|
}
|
|
10640
11192
|
}, {
|
|
10641
11193
|
key: "setUserAgent",
|
|
@@ -10932,6 +11484,31 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
10932
11484
|
value: function getExportChannelStatus(id) {
|
|
10933
11485
|
return this.get("".concat(this.baseURL, "/export_channels/").concat(id));
|
|
10934
11486
|
}
|
|
11487
|
+
}, {
|
|
11488
|
+
key: "campaign",
|
|
11489
|
+
value: function campaign(idOrData, data) {
|
|
11490
|
+
if (typeof idOrData === 'string') {
|
|
11491
|
+
return new Campaign(this, idOrData, data);
|
|
11492
|
+
}
|
|
11493
|
+
|
|
11494
|
+
return new Campaign(this, null, idOrData);
|
|
11495
|
+
}
|
|
11496
|
+
}, {
|
|
11497
|
+
key: "segment",
|
|
11498
|
+
value: function segment(type, idOrData, data) {
|
|
11499
|
+
if (typeof idOrData === 'string') {
|
|
11500
|
+
return new Segment(this, type, idOrData, data);
|
|
11501
|
+
}
|
|
11502
|
+
|
|
11503
|
+
return new Segment(this, type, null, idOrData);
|
|
11504
|
+
}
|
|
11505
|
+
}, {
|
|
11506
|
+
key: "validateServerSideAuth",
|
|
11507
|
+
value: function validateServerSideAuth() {
|
|
11508
|
+
if (!this.secret) {
|
|
11509
|
+
throw new Error('Campaigns is a server-side only feature. Please initialize the client with a secret to use this feature.');
|
|
11510
|
+
}
|
|
11511
|
+
}
|
|
10935
11512
|
/**
|
|
10936
11513
|
* createSegment - Creates a segment
|
|
10937
11514
|
*
|
|
@@ -10941,34 +11518,28 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
10941
11518
|
* @param {string} name Segment name (valid UUID)
|
|
10942
11519
|
* @param {SegmentData} params Segment data
|
|
10943
11520
|
*
|
|
10944
|
-
* @return {
|
|
11521
|
+
* @return {{segment: SegmentResponse} & APIResponse} The created Segment
|
|
10945
11522
|
*/
|
|
10946
11523
|
|
|
10947
11524
|
}, {
|
|
10948
11525
|
key: "createSegment",
|
|
10949
11526
|
value: function () {
|
|
10950
11527
|
var _createSegment = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee63(type, id, name, data) {
|
|
10951
|
-
var body
|
|
10952
|
-
|
|
11528
|
+
var body;
|
|
10953
11529
|
return _regeneratorRuntime__default['default'].wrap(function _callee63$(_context63) {
|
|
10954
11530
|
while (1) {
|
|
10955
11531
|
switch (_context63.prev = _context63.next) {
|
|
10956
11532
|
case 0:
|
|
11533
|
+
this.validateServerSideAuth();
|
|
10957
11534
|
body = {
|
|
10958
11535
|
id: id,
|
|
10959
11536
|
type: type,
|
|
10960
11537
|
name: name,
|
|
10961
11538
|
data: data
|
|
10962
11539
|
};
|
|
10963
|
-
_context63.
|
|
10964
|
-
return this.post(this.baseURL + "/segments", body);
|
|
11540
|
+
return _context63.abrupt("return", this.post(this.baseURL + "/segments", body));
|
|
10965
11541
|
|
|
10966
11542
|
case 3:
|
|
10967
|
-
_yield$this$post = _context63.sent;
|
|
10968
|
-
segment = _yield$this$post.segment;
|
|
10969
|
-
return _context63.abrupt("return", segment);
|
|
10970
|
-
|
|
10971
|
-
case 6:
|
|
10972
11543
|
case "end":
|
|
10973
11544
|
return _context63.stop();
|
|
10974
11545
|
}
|
|
@@ -11000,13 +11571,10 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
11000
11571
|
while (1) {
|
|
11001
11572
|
switch (_context64.prev = _context64.next) {
|
|
11002
11573
|
case 0:
|
|
11003
|
-
|
|
11004
|
-
return this.createSegment('user', id, name, data);
|
|
11574
|
+
this.validateServerSideAuth();
|
|
11575
|
+
return _context64.abrupt("return", this.createSegment('user', id, name, data));
|
|
11005
11576
|
|
|
11006
11577
|
case 2:
|
|
11007
|
-
return _context64.abrupt("return", _context64.sent);
|
|
11008
|
-
|
|
11009
|
-
case 3:
|
|
11010
11578
|
case "end":
|
|
11011
11579
|
return _context64.stop();
|
|
11012
11580
|
}
|
|
@@ -11038,13 +11606,10 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
11038
11606
|
while (1) {
|
|
11039
11607
|
switch (_context65.prev = _context65.next) {
|
|
11040
11608
|
case 0:
|
|
11041
|
-
|
|
11042
|
-
return this.createSegment('channel', id, name, data);
|
|
11609
|
+
this.validateServerSideAuth();
|
|
11610
|
+
return _context65.abrupt("return", this.createSegment('channel', id, name, data));
|
|
11043
11611
|
|
|
11044
11612
|
case 2:
|
|
11045
|
-
return _context65.abrupt("return", _context65.sent);
|
|
11046
|
-
|
|
11047
|
-
case 3:
|
|
11048
11613
|
case "end":
|
|
11049
11614
|
return _context65.stop();
|
|
11050
11615
|
}
|
|
@@ -11058,34 +11623,18 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
11058
11623
|
|
|
11059
11624
|
return createChannelSegment;
|
|
11060
11625
|
}()
|
|
11061
|
-
/**
|
|
11062
|
-
* updateSegment - Update a segment
|
|
11063
|
-
*
|
|
11064
|
-
* @param {string} id Segment ID
|
|
11065
|
-
* @param {Partial<UpdateSegmentData>} data Data to update
|
|
11066
|
-
*
|
|
11067
|
-
* @return {Segment} Updated Segment
|
|
11068
|
-
*/
|
|
11069
|
-
|
|
11070
11626
|
}, {
|
|
11071
|
-
key: "
|
|
11627
|
+
key: "getSegment",
|
|
11072
11628
|
value: function () {
|
|
11073
|
-
var
|
|
11074
|
-
var _yield$this$put, segment;
|
|
11075
|
-
|
|
11629
|
+
var _getSegment = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee66(id) {
|
|
11076
11630
|
return _regeneratorRuntime__default['default'].wrap(function _callee66$(_context66) {
|
|
11077
11631
|
while (1) {
|
|
11078
11632
|
switch (_context66.prev = _context66.next) {
|
|
11079
11633
|
case 0:
|
|
11080
|
-
|
|
11081
|
-
return this.
|
|
11634
|
+
this.validateServerSideAuth();
|
|
11635
|
+
return _context66.abrupt("return", this.get(this.baseURL + "/segments/".concat(id)));
|
|
11082
11636
|
|
|
11083
11637
|
case 2:
|
|
11084
|
-
_yield$this$put = _context66.sent;
|
|
11085
|
-
segment = _yield$this$put.segment;
|
|
11086
|
-
return _context66.abrupt("return", segment);
|
|
11087
|
-
|
|
11088
|
-
case 5:
|
|
11089
11638
|
case "end":
|
|
11090
11639
|
return _context66.stop();
|
|
11091
11640
|
}
|
|
@@ -11093,40 +11642,33 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
11093
11642
|
}, _callee66, this);
|
|
11094
11643
|
}));
|
|
11095
11644
|
|
|
11096
|
-
function
|
|
11097
|
-
return
|
|
11645
|
+
function getSegment(_x94) {
|
|
11646
|
+
return _getSegment.apply(this, arguments);
|
|
11098
11647
|
}
|
|
11099
11648
|
|
|
11100
|
-
return
|
|
11649
|
+
return getSegment;
|
|
11101
11650
|
}()
|
|
11102
11651
|
/**
|
|
11103
|
-
*
|
|
11652
|
+
* updateSegment - Update a segment
|
|
11104
11653
|
*
|
|
11105
11654
|
* @param {string} id Segment ID
|
|
11106
|
-
* @param {
|
|
11655
|
+
* @param {Partial<UpdateSegmentData>} data Data to update
|
|
11107
11656
|
*
|
|
11108
|
-
* @return {
|
|
11657
|
+
* @return {Segment} Updated Segment
|
|
11109
11658
|
*/
|
|
11110
11659
|
|
|
11111
11660
|
}, {
|
|
11112
|
-
key: "
|
|
11661
|
+
key: "updateSegment",
|
|
11113
11662
|
value: function () {
|
|
11114
|
-
var
|
|
11115
|
-
var body;
|
|
11663
|
+
var _updateSegment = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee67(id, data) {
|
|
11116
11664
|
return _regeneratorRuntime__default['default'].wrap(function _callee67$(_context67) {
|
|
11117
11665
|
while (1) {
|
|
11118
11666
|
switch (_context67.prev = _context67.next) {
|
|
11119
11667
|
case 0:
|
|
11120
|
-
|
|
11121
|
-
|
|
11122
|
-
};
|
|
11123
|
-
_context67.next = 3;
|
|
11124
|
-
return this.post(this.baseURL + "/segments/".concat(id, "/addtargets"), body);
|
|
11668
|
+
this.validateServerSideAuth();
|
|
11669
|
+
return _context67.abrupt("return", this.put(this.baseURL + "/segments/".concat(id), data));
|
|
11125
11670
|
|
|
11126
|
-
case
|
|
11127
|
-
return _context67.abrupt("return", _context67.sent);
|
|
11128
|
-
|
|
11129
|
-
case 4:
|
|
11671
|
+
case 2:
|
|
11130
11672
|
case "end":
|
|
11131
11673
|
return _context67.stop();
|
|
11132
11674
|
}
|
|
@@ -11134,14 +11676,14 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
11134
11676
|
}, _callee67, this);
|
|
11135
11677
|
}));
|
|
11136
11678
|
|
|
11137
|
-
function
|
|
11138
|
-
return
|
|
11679
|
+
function updateSegment(_x95, _x96) {
|
|
11680
|
+
return _updateSegment.apply(this, arguments);
|
|
11139
11681
|
}
|
|
11140
11682
|
|
|
11141
|
-
return
|
|
11683
|
+
return updateSegment;
|
|
11142
11684
|
}()
|
|
11143
11685
|
/**
|
|
11144
|
-
*
|
|
11686
|
+
* addSegmentTargets - Add targets to a segment
|
|
11145
11687
|
*
|
|
11146
11688
|
* @param {string} id Segment ID
|
|
11147
11689
|
* @param {string[]} targets Targets to add to the segment
|
|
@@ -11150,24 +11692,21 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
11150
11692
|
*/
|
|
11151
11693
|
|
|
11152
11694
|
}, {
|
|
11153
|
-
key: "
|
|
11695
|
+
key: "addSegmentTargets",
|
|
11154
11696
|
value: function () {
|
|
11155
|
-
var
|
|
11697
|
+
var _addSegmentTargets = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee68(id, targets) {
|
|
11156
11698
|
var body;
|
|
11157
11699
|
return _regeneratorRuntime__default['default'].wrap(function _callee68$(_context68) {
|
|
11158
11700
|
while (1) {
|
|
11159
11701
|
switch (_context68.prev = _context68.next) {
|
|
11160
11702
|
case 0:
|
|
11703
|
+
this.validateServerSideAuth();
|
|
11161
11704
|
body = {
|
|
11162
|
-
|
|
11705
|
+
target_ids: targets
|
|
11163
11706
|
};
|
|
11164
|
-
_context68.
|
|
11165
|
-
return this.post(this.baseURL + "/segments/".concat(id, "/deletetargets"), body);
|
|
11707
|
+
return _context68.abrupt("return", this.post(this.baseURL + "/segments/".concat(id, "/addtargets"), body));
|
|
11166
11708
|
|
|
11167
11709
|
case 3:
|
|
11168
|
-
return _context68.abrupt("return", _context68.sent);
|
|
11169
|
-
|
|
11170
|
-
case 4:
|
|
11171
11710
|
case "end":
|
|
11172
11711
|
return _context68.stop();
|
|
11173
11712
|
}
|
|
@@ -11175,43 +11714,34 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
11175
11714
|
}, _callee68, this);
|
|
11176
11715
|
}));
|
|
11177
11716
|
|
|
11178
|
-
function
|
|
11179
|
-
return
|
|
11717
|
+
function addSegmentTargets(_x97, _x98) {
|
|
11718
|
+
return _addSegmentTargets.apply(this, arguments);
|
|
11180
11719
|
}
|
|
11181
11720
|
|
|
11182
|
-
return
|
|
11721
|
+
return addSegmentTargets;
|
|
11183
11722
|
}()
|
|
11184
|
-
/**
|
|
11185
|
-
* querySegments - Query Segments
|
|
11186
|
-
*
|
|
11187
|
-
* @param {filter} filter MongoDB style filter conditions
|
|
11188
|
-
* @param {QuerySegmentsOptions} options Options for sorting/paginating the results
|
|
11189
|
-
*
|
|
11190
|
-
* @return {Segment[]} Segments
|
|
11191
|
-
*/
|
|
11192
|
-
|
|
11193
11723
|
}, {
|
|
11194
|
-
key: "
|
|
11724
|
+
key: "querySegmentTargets",
|
|
11195
11725
|
value: function () {
|
|
11196
|
-
var
|
|
11197
|
-
var
|
|
11726
|
+
var _querySegmentTargets = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee69(id) {
|
|
11727
|
+
var filter,
|
|
11728
|
+
sort,
|
|
11729
|
+
options,
|
|
11198
11730
|
_args69 = arguments;
|
|
11199
11731
|
return _regeneratorRuntime__default['default'].wrap(function _callee69$(_context69) {
|
|
11200
11732
|
while (1) {
|
|
11201
11733
|
switch (_context69.prev = _context69.next) {
|
|
11202
11734
|
case 0:
|
|
11203
|
-
|
|
11204
|
-
|
|
11205
|
-
|
|
11206
|
-
|
|
11207
|
-
|
|
11208
|
-
},
|
|
11209
|
-
|
|
11210
|
-
|
|
11211
|
-
case 3:
|
|
11212
|
-
return _context69.abrupt("return", _context69.sent);
|
|
11735
|
+
filter = _args69.length > 1 && _args69[1] !== undefined ? _args69[1] : {};
|
|
11736
|
+
sort = _args69.length > 2 && _args69[2] !== undefined ? _args69[2] : [];
|
|
11737
|
+
options = _args69.length > 3 && _args69[3] !== undefined ? _args69[3] : {};
|
|
11738
|
+
this.validateServerSideAuth();
|
|
11739
|
+
return _context69.abrupt("return", this.post(this.baseURL + "/segments/".concat(id, "/targets/query"), _objectSpread({
|
|
11740
|
+
filter: filter || {},
|
|
11741
|
+
sort: sort || []
|
|
11742
|
+
}, options)));
|
|
11213
11743
|
|
|
11214
|
-
case
|
|
11744
|
+
case 5:
|
|
11215
11745
|
case "end":
|
|
11216
11746
|
return _context69.stop();
|
|
11217
11747
|
}
|
|
@@ -11219,33 +11749,35 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
11219
11749
|
}, _callee69, this);
|
|
11220
11750
|
}));
|
|
11221
11751
|
|
|
11222
|
-
function
|
|
11223
|
-
return
|
|
11752
|
+
function querySegmentTargets(_x99) {
|
|
11753
|
+
return _querySegmentTargets.apply(this, arguments);
|
|
11224
11754
|
}
|
|
11225
11755
|
|
|
11226
|
-
return
|
|
11756
|
+
return querySegmentTargets;
|
|
11227
11757
|
}()
|
|
11228
11758
|
/**
|
|
11229
|
-
*
|
|
11759
|
+
* removeSegmentTargets - Remove targets from a segment
|
|
11230
11760
|
*
|
|
11231
11761
|
* @param {string} id Segment ID
|
|
11762
|
+
* @param {string[]} targets Targets to add to the segment
|
|
11232
11763
|
*
|
|
11233
|
-
* @return {
|
|
11764
|
+
* @return {APIResponse} API response
|
|
11234
11765
|
*/
|
|
11235
11766
|
|
|
11236
11767
|
}, {
|
|
11237
|
-
key: "
|
|
11768
|
+
key: "removeSegmentTargets",
|
|
11238
11769
|
value: function () {
|
|
11239
|
-
var
|
|
11770
|
+
var _removeSegmentTargets = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee70(id, targets) {
|
|
11771
|
+
var body;
|
|
11240
11772
|
return _regeneratorRuntime__default['default'].wrap(function _callee70$(_context70) {
|
|
11241
11773
|
while (1) {
|
|
11242
11774
|
switch (_context70.prev = _context70.next) {
|
|
11243
11775
|
case 0:
|
|
11244
|
-
|
|
11245
|
-
|
|
11246
|
-
|
|
11247
|
-
|
|
11248
|
-
return _context70.abrupt("return",
|
|
11776
|
+
this.validateServerSideAuth();
|
|
11777
|
+
body = {
|
|
11778
|
+
target_ids: targets
|
|
11779
|
+
};
|
|
11780
|
+
return _context70.abrupt("return", this.post(this.baseURL + "/segments/".concat(id, "/deletetargets"), body));
|
|
11249
11781
|
|
|
11250
11782
|
case 3:
|
|
11251
11783
|
case "end":
|
|
@@ -11255,34 +11787,37 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
11255
11787
|
}, _callee70, this);
|
|
11256
11788
|
}));
|
|
11257
11789
|
|
|
11258
|
-
function
|
|
11259
|
-
return
|
|
11790
|
+
function removeSegmentTargets(_x100, _x101) {
|
|
11791
|
+
return _removeSegmentTargets.apply(this, arguments);
|
|
11260
11792
|
}
|
|
11261
11793
|
|
|
11262
|
-
return
|
|
11794
|
+
return removeSegmentTargets;
|
|
11263
11795
|
}()
|
|
11264
11796
|
/**
|
|
11265
|
-
*
|
|
11797
|
+
* querySegments - Query Segments
|
|
11266
11798
|
*
|
|
11267
|
-
* @param {
|
|
11268
|
-
* @param {
|
|
11799
|
+
* @param {filter} filter MongoDB style filter conditions
|
|
11800
|
+
* @param {QuerySegmentsOptions} options Options for sorting/paginating the results
|
|
11269
11801
|
*
|
|
11270
|
-
* @return {
|
|
11802
|
+
* @return {Segment[]} Segments
|
|
11271
11803
|
*/
|
|
11272
11804
|
|
|
11273
11805
|
}, {
|
|
11274
|
-
key: "
|
|
11806
|
+
key: "querySegments",
|
|
11275
11807
|
value: function () {
|
|
11276
|
-
var
|
|
11808
|
+
var _querySegments = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee71(filter, sort) {
|
|
11809
|
+
var options,
|
|
11810
|
+
_args71 = arguments;
|
|
11277
11811
|
return _regeneratorRuntime__default['default'].wrap(function _callee71$(_context71) {
|
|
11278
11812
|
while (1) {
|
|
11279
11813
|
switch (_context71.prev = _context71.next) {
|
|
11280
11814
|
case 0:
|
|
11281
|
-
|
|
11282
|
-
|
|
11283
|
-
|
|
11284
|
-
|
|
11285
|
-
|
|
11815
|
+
options = _args71.length > 2 && _args71[2] !== undefined ? _args71[2] : {};
|
|
11816
|
+
this.validateServerSideAuth();
|
|
11817
|
+
return _context71.abrupt("return", this.post(this.baseURL + "/segments/query", _objectSpread({
|
|
11818
|
+
filter: filter,
|
|
11819
|
+
sort: sort
|
|
11820
|
+
}, options)));
|
|
11286
11821
|
|
|
11287
11822
|
case 3:
|
|
11288
11823
|
case "end":
|
|
@@ -11292,41 +11827,32 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
11292
11827
|
}, _callee71, this);
|
|
11293
11828
|
}));
|
|
11294
11829
|
|
|
11295
|
-
function
|
|
11296
|
-
return
|
|
11830
|
+
function querySegments(_x102, _x103) {
|
|
11831
|
+
return _querySegments.apply(this, arguments);
|
|
11297
11832
|
}
|
|
11298
11833
|
|
|
11299
|
-
return
|
|
11834
|
+
return querySegments;
|
|
11300
11835
|
}()
|
|
11301
11836
|
/**
|
|
11302
|
-
*
|
|
11837
|
+
* deleteSegment - Delete a Campaign Segment
|
|
11303
11838
|
*
|
|
11304
|
-
* @param {
|
|
11839
|
+
* @param {string} id Segment ID
|
|
11305
11840
|
*
|
|
11306
|
-
* @return {
|
|
11841
|
+
* @return {Promise<APIResponse>} The Server Response
|
|
11307
11842
|
*/
|
|
11308
11843
|
|
|
11309
11844
|
}, {
|
|
11310
|
-
key: "
|
|
11845
|
+
key: "deleteSegment",
|
|
11311
11846
|
value: function () {
|
|
11312
|
-
var
|
|
11313
|
-
var _yield$this$post2, campaign;
|
|
11314
|
-
|
|
11847
|
+
var _deleteSegment = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee72(id) {
|
|
11315
11848
|
return _regeneratorRuntime__default['default'].wrap(function _callee72$(_context72) {
|
|
11316
11849
|
while (1) {
|
|
11317
11850
|
switch (_context72.prev = _context72.next) {
|
|
11318
11851
|
case 0:
|
|
11319
|
-
|
|
11320
|
-
return this.
|
|
11321
|
-
campaign: params
|
|
11322
|
-
});
|
|
11852
|
+
this.validateServerSideAuth();
|
|
11853
|
+
return _context72.abrupt("return", this.delete(this.baseURL + "/segments/".concat(id)));
|
|
11323
11854
|
|
|
11324
11855
|
case 2:
|
|
11325
|
-
_yield$this$post2 = _context72.sent;
|
|
11326
|
-
campaign = _yield$this$post2.campaign;
|
|
11327
|
-
return _context72.abrupt("return", campaign);
|
|
11328
|
-
|
|
11329
|
-
case 5:
|
|
11330
11856
|
case "end":
|
|
11331
11857
|
return _context72.stop();
|
|
11332
11858
|
}
|
|
@@ -11334,41 +11860,33 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
11334
11860
|
}, _callee72, this);
|
|
11335
11861
|
}));
|
|
11336
11862
|
|
|
11337
|
-
function
|
|
11338
|
-
return
|
|
11863
|
+
function deleteSegment(_x104) {
|
|
11864
|
+
return _deleteSegment.apply(this, arguments);
|
|
11339
11865
|
}
|
|
11340
11866
|
|
|
11341
|
-
return
|
|
11867
|
+
return deleteSegment;
|
|
11342
11868
|
}()
|
|
11343
11869
|
/**
|
|
11344
|
-
*
|
|
11870
|
+
* segmentTargetExists - Check if a target exists in a segment
|
|
11345
11871
|
*
|
|
11872
|
+
* @param {string} segmentId Segment ID
|
|
11873
|
+
* @param {string} targetId Target ID
|
|
11346
11874
|
*
|
|
11347
|
-
* @return {
|
|
11875
|
+
* @return {Promise<APIResponse>} The Server Response
|
|
11348
11876
|
*/
|
|
11349
11877
|
|
|
11350
11878
|
}, {
|
|
11351
|
-
key: "
|
|
11879
|
+
key: "segmentTargetExists",
|
|
11352
11880
|
value: function () {
|
|
11353
|
-
var
|
|
11354
|
-
var options,
|
|
11355
|
-
_args73 = arguments;
|
|
11881
|
+
var _segmentTargetExists = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee73(segmentId, targetId) {
|
|
11356
11882
|
return _regeneratorRuntime__default['default'].wrap(function _callee73$(_context73) {
|
|
11357
11883
|
while (1) {
|
|
11358
11884
|
switch (_context73.prev = _context73.next) {
|
|
11359
11885
|
case 0:
|
|
11360
|
-
|
|
11361
|
-
_context73.
|
|
11362
|
-
return this.get(this.baseURL + "/campaigns", {
|
|
11363
|
-
payload: _objectSpread({
|
|
11364
|
-
filter_conditions: filters
|
|
11365
|
-
}, options)
|
|
11366
|
-
});
|
|
11367
|
-
|
|
11368
|
-
case 3:
|
|
11369
|
-
return _context73.abrupt("return", _context73.sent);
|
|
11886
|
+
this.validateServerSideAuth();
|
|
11887
|
+
return _context73.abrupt("return", this.get(this.baseURL + "/segments/".concat(segmentId, "/target/").concat(targetId)));
|
|
11370
11888
|
|
|
11371
|
-
case
|
|
11889
|
+
case 2:
|
|
11372
11890
|
case "end":
|
|
11373
11891
|
return _context73.stop();
|
|
11374
11892
|
}
|
|
@@ -11376,42 +11894,32 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
11376
11894
|
}, _callee73, this);
|
|
11377
11895
|
}));
|
|
11378
11896
|
|
|
11379
|
-
function
|
|
11380
|
-
return
|
|
11897
|
+
function segmentTargetExists(_x105, _x106) {
|
|
11898
|
+
return _segmentTargetExists.apply(this, arguments);
|
|
11381
11899
|
}
|
|
11382
11900
|
|
|
11383
|
-
return
|
|
11901
|
+
return segmentTargetExists;
|
|
11384
11902
|
}()
|
|
11385
11903
|
/**
|
|
11386
|
-
*
|
|
11904
|
+
* createCampaign - Creates a Campaign
|
|
11387
11905
|
*
|
|
11388
|
-
* @param {
|
|
11389
|
-
* @param {Partial<CampaignData>} params Campaign data
|
|
11906
|
+
* @param {CampaignData} params Campaign data
|
|
11390
11907
|
*
|
|
11391
|
-
* @return {Campaign}
|
|
11908
|
+
* @return {Campaign} The Created Campaign
|
|
11392
11909
|
*/
|
|
11393
11910
|
|
|
11394
11911
|
}, {
|
|
11395
|
-
key: "
|
|
11912
|
+
key: "createCampaign",
|
|
11396
11913
|
value: function () {
|
|
11397
|
-
var
|
|
11398
|
-
var _yield$this$put2, campaign;
|
|
11399
|
-
|
|
11914
|
+
var _createCampaign = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee74(params) {
|
|
11400
11915
|
return _regeneratorRuntime__default['default'].wrap(function _callee74$(_context74) {
|
|
11401
11916
|
while (1) {
|
|
11402
11917
|
switch (_context74.prev = _context74.next) {
|
|
11403
11918
|
case 0:
|
|
11404
|
-
|
|
11405
|
-
return this.
|
|
11406
|
-
campaign: params
|
|
11407
|
-
});
|
|
11919
|
+
this.validateServerSideAuth();
|
|
11920
|
+
return _context74.abrupt("return", this.post(this.baseURL + "/campaigns", _objectSpread({}, params)));
|
|
11408
11921
|
|
|
11409
11922
|
case 2:
|
|
11410
|
-
_yield$this$put2 = _context74.sent;
|
|
11411
|
-
campaign = _yield$this$put2.campaign;
|
|
11412
|
-
return _context74.abrupt("return", campaign);
|
|
11413
|
-
|
|
11414
|
-
case 5:
|
|
11415
11923
|
case "end":
|
|
11416
11924
|
return _context74.stop();
|
|
11417
11925
|
}
|
|
@@ -11419,32 +11927,22 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
11419
11927
|
}, _callee74, this);
|
|
11420
11928
|
}));
|
|
11421
11929
|
|
|
11422
|
-
function
|
|
11423
|
-
return
|
|
11930
|
+
function createCampaign(_x107) {
|
|
11931
|
+
return _createCampaign.apply(this, arguments);
|
|
11424
11932
|
}
|
|
11425
11933
|
|
|
11426
|
-
return
|
|
11934
|
+
return createCampaign;
|
|
11427
11935
|
}()
|
|
11428
|
-
/**
|
|
11429
|
-
* deleteCampaign - Delete a Campaign
|
|
11430
|
-
*
|
|
11431
|
-
* @param {string} id Campaign ID
|
|
11432
|
-
*
|
|
11433
|
-
* @return {Promise<APIResponse>} The Server Response
|
|
11434
|
-
*/
|
|
11435
|
-
|
|
11436
11936
|
}, {
|
|
11437
|
-
key: "
|
|
11937
|
+
key: "getCampaign",
|
|
11438
11938
|
value: function () {
|
|
11439
|
-
var
|
|
11440
|
-
var params,
|
|
11441
|
-
_args75 = arguments;
|
|
11939
|
+
var _getCampaign = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee75(id) {
|
|
11442
11940
|
return _regeneratorRuntime__default['default'].wrap(function _callee75$(_context75) {
|
|
11443
11941
|
while (1) {
|
|
11444
11942
|
switch (_context75.prev = _context75.next) {
|
|
11445
11943
|
case 0:
|
|
11446
|
-
|
|
11447
|
-
return _context75.abrupt("return", this.
|
|
11944
|
+
this.validateServerSideAuth();
|
|
11945
|
+
return _context75.abrupt("return", this.get(this.baseURL + "/campaigns/".concat(id)));
|
|
11448
11946
|
|
|
11449
11947
|
case 2:
|
|
11450
11948
|
case "end":
|
|
@@ -11454,43 +11952,26 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
11454
11952
|
}, _callee75, this);
|
|
11455
11953
|
}));
|
|
11456
11954
|
|
|
11457
|
-
function
|
|
11458
|
-
return
|
|
11955
|
+
function getCampaign(_x108) {
|
|
11956
|
+
return _getCampaign.apply(this, arguments);
|
|
11459
11957
|
}
|
|
11460
11958
|
|
|
11461
|
-
return
|
|
11959
|
+
return getCampaign;
|
|
11462
11960
|
}()
|
|
11463
|
-
/**
|
|
11464
|
-
* scheduleCampaign - Schedule a Campaign
|
|
11465
|
-
*
|
|
11466
|
-
* @param {string} id Campaign ID
|
|
11467
|
-
* @param {{scheduledFor: number}} params Schedule params
|
|
11468
|
-
*
|
|
11469
|
-
* @return {Campaign} Scheduled Campaign
|
|
11470
|
-
*/
|
|
11471
|
-
|
|
11472
11961
|
}, {
|
|
11473
|
-
key: "
|
|
11962
|
+
key: "startCampaign",
|
|
11474
11963
|
value: function () {
|
|
11475
|
-
var
|
|
11476
|
-
var scheduledFor, _yield$this$patch, campaign;
|
|
11477
|
-
|
|
11964
|
+
var _startCampaign = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee76(id, scheduledFor) {
|
|
11478
11965
|
return _regeneratorRuntime__default['default'].wrap(function _callee76$(_context76) {
|
|
11479
11966
|
while (1) {
|
|
11480
11967
|
switch (_context76.prev = _context76.next) {
|
|
11481
11968
|
case 0:
|
|
11482
|
-
|
|
11483
|
-
_context76.
|
|
11484
|
-
return this.patch(this.baseURL + "/campaigns/".concat(id, "/schedule"), {
|
|
11969
|
+
this.validateServerSideAuth();
|
|
11970
|
+
return _context76.abrupt("return", this.post(this.baseURL + "/campaigns/".concat(id, "/start"), {
|
|
11485
11971
|
scheduled_for: scheduledFor
|
|
11486
|
-
});
|
|
11487
|
-
|
|
11488
|
-
case 3:
|
|
11489
|
-
_yield$this$patch = _context76.sent;
|
|
11490
|
-
campaign = _yield$this$patch.campaign;
|
|
11491
|
-
return _context76.abrupt("return", campaign);
|
|
11972
|
+
}));
|
|
11492
11973
|
|
|
11493
|
-
case
|
|
11974
|
+
case 2:
|
|
11494
11975
|
case "end":
|
|
11495
11976
|
return _context76.stop();
|
|
11496
11977
|
}
|
|
@@ -11498,39 +11979,38 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
11498
11979
|
}, _callee76, this);
|
|
11499
11980
|
}));
|
|
11500
11981
|
|
|
11501
|
-
function
|
|
11502
|
-
return
|
|
11982
|
+
function startCampaign(_x109, _x110) {
|
|
11983
|
+
return _startCampaign.apply(this, arguments);
|
|
11503
11984
|
}
|
|
11504
11985
|
|
|
11505
|
-
return
|
|
11986
|
+
return startCampaign;
|
|
11506
11987
|
}()
|
|
11507
11988
|
/**
|
|
11508
|
-
*
|
|
11989
|
+
* queryCampaigns - Query Campaigns
|
|
11509
11990
|
*
|
|
11510
|
-
* @param {string} id Campaign ID
|
|
11511
11991
|
*
|
|
11512
|
-
* @return {Campaign}
|
|
11992
|
+
* @return {Campaign[]} Campaigns
|
|
11513
11993
|
*/
|
|
11514
11994
|
|
|
11515
11995
|
}, {
|
|
11516
|
-
key: "
|
|
11996
|
+
key: "queryCampaigns",
|
|
11517
11997
|
value: function () {
|
|
11518
|
-
var
|
|
11519
|
-
var _yield$this$patch2, campaign;
|
|
11520
|
-
|
|
11998
|
+
var _queryCampaigns = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee77(filter, sort, options) {
|
|
11521
11999
|
return _regeneratorRuntime__default['default'].wrap(function _callee77$(_context77) {
|
|
11522
12000
|
while (1) {
|
|
11523
12001
|
switch (_context77.prev = _context77.next) {
|
|
11524
12002
|
case 0:
|
|
11525
|
-
|
|
11526
|
-
|
|
12003
|
+
this.validateServerSideAuth();
|
|
12004
|
+
_context77.next = 3;
|
|
12005
|
+
return this.post(this.baseURL + "/campaigns/query", _objectSpread({
|
|
12006
|
+
filter: filter,
|
|
12007
|
+
sort: sort
|
|
12008
|
+
}, options || {}));
|
|
11527
12009
|
|
|
11528
|
-
case
|
|
11529
|
-
|
|
11530
|
-
campaign = _yield$this$patch2.campaign;
|
|
11531
|
-
return _context77.abrupt("return", campaign);
|
|
12010
|
+
case 3:
|
|
12011
|
+
return _context77.abrupt("return", _context77.sent);
|
|
11532
12012
|
|
|
11533
|
-
case
|
|
12013
|
+
case 4:
|
|
11534
12014
|
case "end":
|
|
11535
12015
|
return _context77.stop();
|
|
11536
12016
|
}
|
|
@@ -11538,39 +12018,33 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
11538
12018
|
}, _callee77, this);
|
|
11539
12019
|
}));
|
|
11540
12020
|
|
|
11541
|
-
function
|
|
11542
|
-
return
|
|
12021
|
+
function queryCampaigns(_x111, _x112, _x113) {
|
|
12022
|
+
return _queryCampaigns.apply(this, arguments);
|
|
11543
12023
|
}
|
|
11544
12024
|
|
|
11545
|
-
return
|
|
12025
|
+
return queryCampaigns;
|
|
11546
12026
|
}()
|
|
11547
12027
|
/**
|
|
11548
|
-
*
|
|
12028
|
+
* updateCampaign - Update a Campaign
|
|
11549
12029
|
*
|
|
11550
12030
|
* @param {string} id Campaign ID
|
|
12031
|
+
* @param {Partial<CampaignData>} params Campaign data
|
|
11551
12032
|
*
|
|
11552
|
-
* @return {Campaign}
|
|
12033
|
+
* @return {Campaign} Updated Campaign
|
|
11553
12034
|
*/
|
|
11554
12035
|
|
|
11555
12036
|
}, {
|
|
11556
|
-
key: "
|
|
12037
|
+
key: "updateCampaign",
|
|
11557
12038
|
value: function () {
|
|
11558
|
-
var
|
|
11559
|
-
var _yield$this$patch3, campaign;
|
|
11560
|
-
|
|
12039
|
+
var _updateCampaign = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee78(id, params) {
|
|
11561
12040
|
return _regeneratorRuntime__default['default'].wrap(function _callee78$(_context78) {
|
|
11562
12041
|
while (1) {
|
|
11563
12042
|
switch (_context78.prev = _context78.next) {
|
|
11564
12043
|
case 0:
|
|
11565
|
-
|
|
11566
|
-
return this.
|
|
12044
|
+
this.validateServerSideAuth();
|
|
12045
|
+
return _context78.abrupt("return", this.put(this.baseURL + "/campaigns/".concat(id), params));
|
|
11567
12046
|
|
|
11568
12047
|
case 2:
|
|
11569
|
-
_yield$this$patch3 = _context78.sent;
|
|
11570
|
-
campaign = _yield$this$patch3.campaign;
|
|
11571
|
-
return _context78.abrupt("return", campaign);
|
|
11572
|
-
|
|
11573
|
-
case 5:
|
|
11574
12048
|
case "end":
|
|
11575
12049
|
return _context78.stop();
|
|
11576
12050
|
}
|
|
@@ -11578,40 +12052,32 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
11578
12052
|
}, _callee78, this);
|
|
11579
12053
|
}));
|
|
11580
12054
|
|
|
11581
|
-
function
|
|
11582
|
-
return
|
|
12055
|
+
function updateCampaign(_x114, _x115) {
|
|
12056
|
+
return _updateCampaign.apply(this, arguments);
|
|
11583
12057
|
}
|
|
11584
12058
|
|
|
11585
|
-
return
|
|
12059
|
+
return updateCampaign;
|
|
11586
12060
|
}()
|
|
11587
12061
|
/**
|
|
11588
|
-
*
|
|
12062
|
+
* deleteCampaign - Delete a Campaign
|
|
11589
12063
|
*
|
|
11590
12064
|
* @param {string} id Campaign ID
|
|
11591
|
-
* @param {{users: string[]}} params Test params
|
|
11592
12065
|
*
|
|
11593
|
-
* @return {
|
|
12066
|
+
* @return {Promise<APIResponse>} The Server Response
|
|
11594
12067
|
*/
|
|
11595
12068
|
|
|
11596
12069
|
}, {
|
|
11597
|
-
key: "
|
|
12070
|
+
key: "deleteCampaign",
|
|
11598
12071
|
value: function () {
|
|
11599
|
-
var
|
|
11600
|
-
var users;
|
|
12072
|
+
var _deleteCampaign = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee79(id) {
|
|
11601
12073
|
return _regeneratorRuntime__default['default'].wrap(function _callee79$(_context79) {
|
|
11602
12074
|
while (1) {
|
|
11603
12075
|
switch (_context79.prev = _context79.next) {
|
|
11604
12076
|
case 0:
|
|
11605
|
-
|
|
11606
|
-
_context79.
|
|
11607
|
-
return this.post(this.baseURL + "/campaigns/".concat(id, "/test"), {
|
|
11608
|
-
users: users
|
|
11609
|
-
});
|
|
12077
|
+
this.validateServerSideAuth();
|
|
12078
|
+
return _context79.abrupt("return", this.delete(this.baseURL + "/campaigns/".concat(id)));
|
|
11610
12079
|
|
|
11611
|
-
case
|
|
11612
|
-
return _context79.abrupt("return", _context79.sent);
|
|
11613
|
-
|
|
11614
|
-
case 4:
|
|
12080
|
+
case 2:
|
|
11615
12081
|
case "end":
|
|
11616
12082
|
return _context79.stop();
|
|
11617
12083
|
}
|
|
@@ -11619,11 +12085,52 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
11619
12085
|
}, _callee79, this);
|
|
11620
12086
|
}));
|
|
11621
12087
|
|
|
11622
|
-
function
|
|
11623
|
-
return
|
|
12088
|
+
function deleteCampaign(_x116) {
|
|
12089
|
+
return _deleteCampaign.apply(this, arguments);
|
|
12090
|
+
}
|
|
12091
|
+
|
|
12092
|
+
return deleteCampaign;
|
|
12093
|
+
}()
|
|
12094
|
+
/**
|
|
12095
|
+
* stopCampaign - Stop a Campaign
|
|
12096
|
+
*
|
|
12097
|
+
* @param {string} id Campaign ID
|
|
12098
|
+
*
|
|
12099
|
+
* @return {Campaign} Stopped Campaign
|
|
12100
|
+
*/
|
|
12101
|
+
|
|
12102
|
+
}, {
|
|
12103
|
+
key: "stopCampaign",
|
|
12104
|
+
value: function () {
|
|
12105
|
+
var _stopCampaign = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee80(id) {
|
|
12106
|
+
var _yield$this$patch, campaign;
|
|
12107
|
+
|
|
12108
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee80$(_context80) {
|
|
12109
|
+
while (1) {
|
|
12110
|
+
switch (_context80.prev = _context80.next) {
|
|
12111
|
+
case 0:
|
|
12112
|
+
this.validateServerSideAuth();
|
|
12113
|
+
_context80.next = 3;
|
|
12114
|
+
return this.patch(this.baseURL + "/campaigns/".concat(id, "/stop"));
|
|
12115
|
+
|
|
12116
|
+
case 3:
|
|
12117
|
+
_yield$this$patch = _context80.sent;
|
|
12118
|
+
campaign = _yield$this$patch.campaign;
|
|
12119
|
+
return _context80.abrupt("return", campaign);
|
|
12120
|
+
|
|
12121
|
+
case 6:
|
|
12122
|
+
case "end":
|
|
12123
|
+
return _context80.stop();
|
|
12124
|
+
}
|
|
12125
|
+
}
|
|
12126
|
+
}, _callee80, this);
|
|
12127
|
+
}));
|
|
12128
|
+
|
|
12129
|
+
function stopCampaign(_x117) {
|
|
12130
|
+
return _stopCampaign.apply(this, arguments);
|
|
11624
12131
|
}
|
|
11625
12132
|
|
|
11626
|
-
return
|
|
12133
|
+
return stopCampaign;
|
|
11627
12134
|
}()
|
|
11628
12135
|
/**
|
|
11629
12136
|
* enrichURL - Get OpenGraph data of the given link
|
|
@@ -11635,24 +12142,24 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
11635
12142
|
}, {
|
|
11636
12143
|
key: "enrichURL",
|
|
11637
12144
|
value: function () {
|
|
11638
|
-
var _enrichURL = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
11639
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
12145
|
+
var _enrichURL = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee81(url) {
|
|
12146
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee81$(_context81) {
|
|
11640
12147
|
while (1) {
|
|
11641
|
-
switch (
|
|
12148
|
+
switch (_context81.prev = _context81.next) {
|
|
11642
12149
|
case 0:
|
|
11643
|
-
return
|
|
12150
|
+
return _context81.abrupt("return", this.get(this.baseURL + "/og", {
|
|
11644
12151
|
url: url
|
|
11645
12152
|
}));
|
|
11646
12153
|
|
|
11647
12154
|
case 1:
|
|
11648
12155
|
case "end":
|
|
11649
|
-
return
|
|
12156
|
+
return _context81.stop();
|
|
11650
12157
|
}
|
|
11651
12158
|
}
|
|
11652
|
-
},
|
|
12159
|
+
}, _callee81, this);
|
|
11653
12160
|
}));
|
|
11654
12161
|
|
|
11655
|
-
function enrichURL(
|
|
12162
|
+
function enrichURL(_x118) {
|
|
11656
12163
|
return _enrichURL.apply(this, arguments);
|
|
11657
12164
|
}
|
|
11658
12165
|
|
|
@@ -11669,22 +12176,22 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
11669
12176
|
}, {
|
|
11670
12177
|
key: "getTask",
|
|
11671
12178
|
value: function () {
|
|
11672
|
-
var _getTask = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
11673
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
12179
|
+
var _getTask = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee82(id) {
|
|
12180
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee82$(_context82) {
|
|
11674
12181
|
while (1) {
|
|
11675
|
-
switch (
|
|
12182
|
+
switch (_context82.prev = _context82.next) {
|
|
11676
12183
|
case 0:
|
|
11677
|
-
return
|
|
12184
|
+
return _context82.abrupt("return", this.get("".concat(this.baseURL, "/tasks/").concat(id)));
|
|
11678
12185
|
|
|
11679
12186
|
case 1:
|
|
11680
12187
|
case "end":
|
|
11681
|
-
return
|
|
12188
|
+
return _context82.stop();
|
|
11682
12189
|
}
|
|
11683
12190
|
}
|
|
11684
|
-
},
|
|
12191
|
+
}, _callee82, this);
|
|
11685
12192
|
}));
|
|
11686
12193
|
|
|
11687
|
-
function getTask(
|
|
12194
|
+
function getTask(_x119) {
|
|
11688
12195
|
return _getTask.apply(this, arguments);
|
|
11689
12196
|
}
|
|
11690
12197
|
|
|
@@ -11702,31 +12209,31 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
11702
12209
|
}, {
|
|
11703
12210
|
key: "deleteChannels",
|
|
11704
12211
|
value: function () {
|
|
11705
|
-
var _deleteChannels = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
12212
|
+
var _deleteChannels = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee83(cids) {
|
|
11706
12213
|
var options,
|
|
11707
|
-
|
|
11708
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
12214
|
+
_args83 = arguments;
|
|
12215
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee83$(_context83) {
|
|
11709
12216
|
while (1) {
|
|
11710
|
-
switch (
|
|
12217
|
+
switch (_context83.prev = _context83.next) {
|
|
11711
12218
|
case 0:
|
|
11712
|
-
options =
|
|
11713
|
-
|
|
12219
|
+
options = _args83.length > 1 && _args83[1] !== undefined ? _args83[1] : {};
|
|
12220
|
+
_context83.next = 3;
|
|
11714
12221
|
return this.post(this.baseURL + "/channels/delete", _objectSpread({
|
|
11715
12222
|
cids: cids
|
|
11716
12223
|
}, options));
|
|
11717
12224
|
|
|
11718
12225
|
case 3:
|
|
11719
|
-
return
|
|
12226
|
+
return _context83.abrupt("return", _context83.sent);
|
|
11720
12227
|
|
|
11721
12228
|
case 4:
|
|
11722
12229
|
case "end":
|
|
11723
|
-
return
|
|
12230
|
+
return _context83.stop();
|
|
11724
12231
|
}
|
|
11725
12232
|
}
|
|
11726
|
-
},
|
|
12233
|
+
}, _callee83, this);
|
|
11727
12234
|
}));
|
|
11728
12235
|
|
|
11729
|
-
function deleteChannels(
|
|
12236
|
+
function deleteChannels(_x120) {
|
|
11730
12237
|
return _deleteChannels.apply(this, arguments);
|
|
11731
12238
|
}
|
|
11732
12239
|
|
|
@@ -11744,17 +12251,17 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
11744
12251
|
}, {
|
|
11745
12252
|
key: "deleteUsers",
|
|
11746
12253
|
value: function () {
|
|
11747
|
-
var _deleteUsers = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
12254
|
+
var _deleteUsers = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee84(user_ids) {
|
|
11748
12255
|
var options,
|
|
11749
|
-
|
|
11750
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
12256
|
+
_args84 = arguments;
|
|
12257
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee84$(_context84) {
|
|
11751
12258
|
while (1) {
|
|
11752
|
-
switch (
|
|
12259
|
+
switch (_context84.prev = _context84.next) {
|
|
11753
12260
|
case 0:
|
|
11754
|
-
options =
|
|
12261
|
+
options = _args84.length > 1 && _args84[1] !== undefined ? _args84[1] : {};
|
|
11755
12262
|
|
|
11756
12263
|
if (!(typeof options.user !== 'undefined' && !['soft', 'hard', 'pruning'].includes(options.user))) {
|
|
11757
|
-
|
|
12264
|
+
_context84.next = 3;
|
|
11758
12265
|
break;
|
|
11759
12266
|
}
|
|
11760
12267
|
|
|
@@ -11762,7 +12269,7 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
11762
12269
|
|
|
11763
12270
|
case 3:
|
|
11764
12271
|
if (!(typeof options.conversations !== 'undefined' && !['soft', 'hard'].includes(options.conversations))) {
|
|
11765
|
-
|
|
12272
|
+
_context84.next = 5;
|
|
11766
12273
|
break;
|
|
11767
12274
|
}
|
|
11768
12275
|
|
|
@@ -11770,30 +12277,30 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
11770
12277
|
|
|
11771
12278
|
case 5:
|
|
11772
12279
|
if (!(typeof options.messages !== 'undefined' && !['soft', 'hard', 'pruning'].includes(options.messages))) {
|
|
11773
|
-
|
|
12280
|
+
_context84.next = 7;
|
|
11774
12281
|
break;
|
|
11775
12282
|
}
|
|
11776
12283
|
|
|
11777
12284
|
throw new Error('Invalid delete user options. messages must be one of [soft hard pruning]');
|
|
11778
12285
|
|
|
11779
12286
|
case 7:
|
|
11780
|
-
|
|
12287
|
+
_context84.next = 9;
|
|
11781
12288
|
return this.post(this.baseURL + "/users/delete", _objectSpread({
|
|
11782
12289
|
user_ids: user_ids
|
|
11783
12290
|
}, options));
|
|
11784
12291
|
|
|
11785
12292
|
case 9:
|
|
11786
|
-
return
|
|
12293
|
+
return _context84.abrupt("return", _context84.sent);
|
|
11787
12294
|
|
|
11788
12295
|
case 10:
|
|
11789
12296
|
case "end":
|
|
11790
|
-
return
|
|
12297
|
+
return _context84.stop();
|
|
11791
12298
|
}
|
|
11792
12299
|
}
|
|
11793
|
-
},
|
|
12300
|
+
}, _callee84, this);
|
|
11794
12301
|
}));
|
|
11795
12302
|
|
|
11796
|
-
function deleteUsers(
|
|
12303
|
+
function deleteUsers(_x121) {
|
|
11797
12304
|
return _deleteUsers.apply(this, arguments);
|
|
11798
12305
|
}
|
|
11799
12306
|
|
|
@@ -11814,28 +12321,28 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
11814
12321
|
}, {
|
|
11815
12322
|
key: "_createImportURL",
|
|
11816
12323
|
value: function () {
|
|
11817
|
-
var _createImportURL2 = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
11818
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
12324
|
+
var _createImportURL2 = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee85(filename) {
|
|
12325
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee85$(_context85) {
|
|
11819
12326
|
while (1) {
|
|
11820
|
-
switch (
|
|
12327
|
+
switch (_context85.prev = _context85.next) {
|
|
11821
12328
|
case 0:
|
|
11822
|
-
|
|
12329
|
+
_context85.next = 2;
|
|
11823
12330
|
return this.post(this.baseURL + "/import_urls", {
|
|
11824
12331
|
filename: filename
|
|
11825
12332
|
});
|
|
11826
12333
|
|
|
11827
12334
|
case 2:
|
|
11828
|
-
return
|
|
12335
|
+
return _context85.abrupt("return", _context85.sent);
|
|
11829
12336
|
|
|
11830
12337
|
case 3:
|
|
11831
12338
|
case "end":
|
|
11832
|
-
return
|
|
12339
|
+
return _context85.stop();
|
|
11833
12340
|
}
|
|
11834
12341
|
}
|
|
11835
|
-
},
|
|
12342
|
+
}, _callee85, this);
|
|
11836
12343
|
}));
|
|
11837
12344
|
|
|
11838
|
-
function _createImportURL(
|
|
12345
|
+
function _createImportURL(_x122) {
|
|
11839
12346
|
return _createImportURL2.apply(this, arguments);
|
|
11840
12347
|
}
|
|
11841
12348
|
|
|
@@ -11857,33 +12364,33 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
11857
12364
|
}, {
|
|
11858
12365
|
key: "_createImport",
|
|
11859
12366
|
value: function () {
|
|
11860
|
-
var _createImport2 = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
12367
|
+
var _createImport2 = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee86(path) {
|
|
11861
12368
|
var options,
|
|
11862
|
-
|
|
11863
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
12369
|
+
_args86 = arguments;
|
|
12370
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee86$(_context86) {
|
|
11864
12371
|
while (1) {
|
|
11865
|
-
switch (
|
|
12372
|
+
switch (_context86.prev = _context86.next) {
|
|
11866
12373
|
case 0:
|
|
11867
|
-
options =
|
|
12374
|
+
options = _args86.length > 1 && _args86[1] !== undefined ? _args86[1] : {
|
|
11868
12375
|
mode: 'upsert'
|
|
11869
12376
|
};
|
|
11870
|
-
|
|
12377
|
+
_context86.next = 3;
|
|
11871
12378
|
return this.post(this.baseURL + "/imports", _objectSpread({
|
|
11872
12379
|
path: path
|
|
11873
12380
|
}, options));
|
|
11874
12381
|
|
|
11875
12382
|
case 3:
|
|
11876
|
-
return
|
|
12383
|
+
return _context86.abrupt("return", _context86.sent);
|
|
11877
12384
|
|
|
11878
12385
|
case 4:
|
|
11879
12386
|
case "end":
|
|
11880
|
-
return
|
|
12387
|
+
return _context86.stop();
|
|
11881
12388
|
}
|
|
11882
12389
|
}
|
|
11883
|
-
},
|
|
12390
|
+
}, _callee86, this);
|
|
11884
12391
|
}));
|
|
11885
12392
|
|
|
11886
|
-
function _createImport(
|
|
12393
|
+
function _createImport(_x123) {
|
|
11887
12394
|
return _createImport2.apply(this, arguments);
|
|
11888
12395
|
}
|
|
11889
12396
|
|
|
@@ -11905,26 +12412,26 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
11905
12412
|
}, {
|
|
11906
12413
|
key: "_getImport",
|
|
11907
12414
|
value: function () {
|
|
11908
|
-
var _getImport2 = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
11909
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
12415
|
+
var _getImport2 = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee87(id) {
|
|
12416
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee87$(_context87) {
|
|
11910
12417
|
while (1) {
|
|
11911
|
-
switch (
|
|
12418
|
+
switch (_context87.prev = _context87.next) {
|
|
11912
12419
|
case 0:
|
|
11913
|
-
|
|
12420
|
+
_context87.next = 2;
|
|
11914
12421
|
return this.get(this.baseURL + "/imports/".concat(id));
|
|
11915
12422
|
|
|
11916
12423
|
case 2:
|
|
11917
|
-
return
|
|
12424
|
+
return _context87.abrupt("return", _context87.sent);
|
|
11918
12425
|
|
|
11919
12426
|
case 3:
|
|
11920
12427
|
case "end":
|
|
11921
|
-
return
|
|
12428
|
+
return _context87.stop();
|
|
11922
12429
|
}
|
|
11923
12430
|
}
|
|
11924
|
-
},
|
|
12431
|
+
}, _callee87, this);
|
|
11925
12432
|
}));
|
|
11926
12433
|
|
|
11927
|
-
function _getImport(
|
|
12434
|
+
function _getImport(_x124) {
|
|
11928
12435
|
return _getImport2.apply(this, arguments);
|
|
11929
12436
|
}
|
|
11930
12437
|
|
|
@@ -11946,26 +12453,26 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
11946
12453
|
}, {
|
|
11947
12454
|
key: "_listImports",
|
|
11948
12455
|
value: function () {
|
|
11949
|
-
var _listImports2 = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
11950
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
12456
|
+
var _listImports2 = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee88(options) {
|
|
12457
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee88$(_context88) {
|
|
11951
12458
|
while (1) {
|
|
11952
|
-
switch (
|
|
12459
|
+
switch (_context88.prev = _context88.next) {
|
|
11953
12460
|
case 0:
|
|
11954
|
-
|
|
12461
|
+
_context88.next = 2;
|
|
11955
12462
|
return this.get(this.baseURL + "/imports", options);
|
|
11956
12463
|
|
|
11957
12464
|
case 2:
|
|
11958
|
-
return
|
|
12465
|
+
return _context88.abrupt("return", _context88.sent);
|
|
11959
12466
|
|
|
11960
12467
|
case 3:
|
|
11961
12468
|
case "end":
|
|
11962
|
-
return
|
|
12469
|
+
return _context88.stop();
|
|
11963
12470
|
}
|
|
11964
12471
|
}
|
|
11965
|
-
},
|
|
12472
|
+
}, _callee88, this);
|
|
11966
12473
|
}));
|
|
11967
12474
|
|
|
11968
|
-
function _listImports(
|
|
12475
|
+
function _listImports(_x125) {
|
|
11969
12476
|
return _listImports2.apply(this, arguments);
|
|
11970
12477
|
}
|
|
11971
12478
|
|
|
@@ -11984,28 +12491,28 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
11984
12491
|
}, {
|
|
11985
12492
|
key: "upsertPushProvider",
|
|
11986
12493
|
value: function () {
|
|
11987
|
-
var _upsertPushProvider = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
11988
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
12494
|
+
var _upsertPushProvider = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee89(pushProvider) {
|
|
12495
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee89$(_context89) {
|
|
11989
12496
|
while (1) {
|
|
11990
|
-
switch (
|
|
12497
|
+
switch (_context89.prev = _context89.next) {
|
|
11991
12498
|
case 0:
|
|
11992
|
-
|
|
12499
|
+
_context89.next = 2;
|
|
11993
12500
|
return this.post(this.baseURL + "/push_providers", {
|
|
11994
12501
|
push_provider: pushProvider
|
|
11995
12502
|
});
|
|
11996
12503
|
|
|
11997
12504
|
case 2:
|
|
11998
|
-
return
|
|
12505
|
+
return _context89.abrupt("return", _context89.sent);
|
|
11999
12506
|
|
|
12000
12507
|
case 3:
|
|
12001
12508
|
case "end":
|
|
12002
|
-
return
|
|
12509
|
+
return _context89.stop();
|
|
12003
12510
|
}
|
|
12004
12511
|
}
|
|
12005
|
-
},
|
|
12512
|
+
}, _callee89, this);
|
|
12006
12513
|
}));
|
|
12007
12514
|
|
|
12008
|
-
function upsertPushProvider(
|
|
12515
|
+
function upsertPushProvider(_x126) {
|
|
12009
12516
|
return _upsertPushProvider.apply(this, arguments);
|
|
12010
12517
|
}
|
|
12011
12518
|
|
|
@@ -12024,28 +12531,28 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
12024
12531
|
}, {
|
|
12025
12532
|
key: "deletePushProvider",
|
|
12026
12533
|
value: function () {
|
|
12027
|
-
var _deletePushProvider = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
12534
|
+
var _deletePushProvider = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee90(_ref10) {
|
|
12028
12535
|
var type, name;
|
|
12029
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
12536
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee90$(_context90) {
|
|
12030
12537
|
while (1) {
|
|
12031
|
-
switch (
|
|
12538
|
+
switch (_context90.prev = _context90.next) {
|
|
12032
12539
|
case 0:
|
|
12033
12540
|
type = _ref10.type, name = _ref10.name;
|
|
12034
|
-
|
|
12541
|
+
_context90.next = 3;
|
|
12035
12542
|
return this.delete(this.baseURL + "/push_providers/".concat(type, "/").concat(name));
|
|
12036
12543
|
|
|
12037
12544
|
case 3:
|
|
12038
|
-
return
|
|
12545
|
+
return _context90.abrupt("return", _context90.sent);
|
|
12039
12546
|
|
|
12040
12547
|
case 4:
|
|
12041
12548
|
case "end":
|
|
12042
|
-
return
|
|
12549
|
+
return _context90.stop();
|
|
12043
12550
|
}
|
|
12044
12551
|
}
|
|
12045
|
-
},
|
|
12552
|
+
}, _callee90, this);
|
|
12046
12553
|
}));
|
|
12047
12554
|
|
|
12048
|
-
function deletePushProvider(
|
|
12555
|
+
function deletePushProvider(_x127) {
|
|
12049
12556
|
return _deletePushProvider.apply(this, arguments);
|
|
12050
12557
|
}
|
|
12051
12558
|
|
|
@@ -12062,23 +12569,23 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
12062
12569
|
}, {
|
|
12063
12570
|
key: "listPushProviders",
|
|
12064
12571
|
value: function () {
|
|
12065
|
-
var _listPushProviders = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
12066
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
12572
|
+
var _listPushProviders = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee91() {
|
|
12573
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee91$(_context91) {
|
|
12067
12574
|
while (1) {
|
|
12068
|
-
switch (
|
|
12575
|
+
switch (_context91.prev = _context91.next) {
|
|
12069
12576
|
case 0:
|
|
12070
|
-
|
|
12577
|
+
_context91.next = 2;
|
|
12071
12578
|
return this.get(this.baseURL + "/push_providers");
|
|
12072
12579
|
|
|
12073
12580
|
case 2:
|
|
12074
|
-
return
|
|
12581
|
+
return _context91.abrupt("return", _context91.sent);
|
|
12075
12582
|
|
|
12076
12583
|
case 3:
|
|
12077
12584
|
case "end":
|
|
12078
|
-
return
|
|
12585
|
+
return _context91.stop();
|
|
12079
12586
|
}
|
|
12080
12587
|
}
|
|
12081
|
-
},
|
|
12588
|
+
}, _callee91, this);
|
|
12082
12589
|
}));
|
|
12083
12590
|
|
|
12084
12591
|
function listPushProviders() {
|
|
@@ -12106,26 +12613,26 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
12106
12613
|
}, {
|
|
12107
12614
|
key: "commitMessage",
|
|
12108
12615
|
value: function () {
|
|
12109
|
-
var _commitMessage = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function
|
|
12110
|
-
return _regeneratorRuntime__default['default'].wrap(function
|
|
12616
|
+
var _commitMessage = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee92(id) {
|
|
12617
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee92$(_context92) {
|
|
12111
12618
|
while (1) {
|
|
12112
|
-
switch (
|
|
12619
|
+
switch (_context92.prev = _context92.next) {
|
|
12113
12620
|
case 0:
|
|
12114
|
-
|
|
12621
|
+
_context92.next = 2;
|
|
12115
12622
|
return this.post(this.baseURL + "/messages/".concat(id, "/commit"));
|
|
12116
12623
|
|
|
12117
12624
|
case 2:
|
|
12118
|
-
return
|
|
12625
|
+
return _context92.abrupt("return", _context92.sent);
|
|
12119
12626
|
|
|
12120
12627
|
case 3:
|
|
12121
12628
|
case "end":
|
|
12122
|
-
return
|
|
12629
|
+
return _context92.stop();
|
|
12123
12630
|
}
|
|
12124
12631
|
}
|
|
12125
|
-
},
|
|
12632
|
+
}, _callee92, this);
|
|
12126
12633
|
}));
|
|
12127
12634
|
|
|
12128
|
-
function commitMessage(
|
|
12635
|
+
function commitMessage(_x128) {
|
|
12129
12636
|
return _commitMessage.apply(this, arguments);
|
|
12130
12637
|
}
|
|
12131
12638
|
|
|
@@ -12283,6 +12790,7 @@ exports.AnyResource = AnyResource;
|
|
|
12283
12790
|
exports.AnyRole = AnyRole;
|
|
12284
12791
|
exports.BuiltinPermissions = BuiltinPermissions;
|
|
12285
12792
|
exports.BuiltinRoles = BuiltinRoles;
|
|
12793
|
+
exports.Campaign = Campaign;
|
|
12286
12794
|
exports.Channel = Channel;
|
|
12287
12795
|
exports.ChannelState = ChannelState;
|
|
12288
12796
|
exports.CheckSignature = CheckSignature;
|
|
@@ -12298,6 +12806,7 @@ exports.JWTUserToken = JWTUserToken;
|
|
|
12298
12806
|
exports.MaxPriority = MaxPriority;
|
|
12299
12807
|
exports.MinPriority = MinPriority;
|
|
12300
12808
|
exports.Permission = Permission;
|
|
12809
|
+
exports.Segment = Segment;
|
|
12301
12810
|
exports.StableWSConnection = StableWSConnection;
|
|
12302
12811
|
exports.StreamChat = StreamChat;
|
|
12303
12812
|
exports.Thread = Thread;
|