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