stream-chat 8.42.0 → 8.43.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser.es.js +531 -161
- 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 +531 -161
- package/dist/browser.js.map +1 -1
- package/dist/index.es.js +531 -161
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +531 -161
- package/dist/index.js.map +1 -1
- package/dist/types/channel.d.ts +62 -2
- package/dist/types/channel.d.ts.map +1 -1
- package/dist/types/moderation.d.ts +30 -1
- package/dist/types/moderation.d.ts.map +1 -1
- package/dist/types/types.d.ts +27 -4
- package/dist/types/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/channel.ts +91 -2
- package/src/moderation.ts +64 -0
- package/src/types.ts +34 -4
package/dist/index.es.js
CHANGED
|
@@ -3203,6 +3203,258 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3203
3203
|
|
|
3204
3204
|
return unmute;
|
|
3205
3205
|
}()
|
|
3206
|
+
/**
|
|
3207
|
+
* archive - archives the current channel
|
|
3208
|
+
* @param {{ user_id?: string }} opts user_id if called server side
|
|
3209
|
+
* @return {Promise<ChannelMemberResponse<StreamChatGenerics>>} The server response
|
|
3210
|
+
*
|
|
3211
|
+
* example:
|
|
3212
|
+
* await channel.archives();
|
|
3213
|
+
*
|
|
3214
|
+
* example server side:
|
|
3215
|
+
* await channel.archive({user_id: userId});
|
|
3216
|
+
*
|
|
3217
|
+
*/
|
|
3218
|
+
|
|
3219
|
+
}, {
|
|
3220
|
+
key: "archive",
|
|
3221
|
+
value: function () {
|
|
3222
|
+
var _archive = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee25() {
|
|
3223
|
+
var opts,
|
|
3224
|
+
cli,
|
|
3225
|
+
uid,
|
|
3226
|
+
resp,
|
|
3227
|
+
_args25 = arguments;
|
|
3228
|
+
return _regeneratorRuntime.wrap(function _callee25$(_context25) {
|
|
3229
|
+
while (1) {
|
|
3230
|
+
switch (_context25.prev = _context25.next) {
|
|
3231
|
+
case 0:
|
|
3232
|
+
opts = _args25.length > 0 && _args25[0] !== undefined ? _args25[0] : {};
|
|
3233
|
+
cli = this.getClient();
|
|
3234
|
+
uid = opts.user_id || cli.userID;
|
|
3235
|
+
|
|
3236
|
+
if (uid) {
|
|
3237
|
+
_context25.next = 5;
|
|
3238
|
+
break;
|
|
3239
|
+
}
|
|
3240
|
+
|
|
3241
|
+
throw Error('A user_id is required for archiving a channel');
|
|
3242
|
+
|
|
3243
|
+
case 5:
|
|
3244
|
+
_context25.next = 7;
|
|
3245
|
+
return this.partialUpdateMember(uid, {
|
|
3246
|
+
set: {
|
|
3247
|
+
archived: true
|
|
3248
|
+
}
|
|
3249
|
+
});
|
|
3250
|
+
|
|
3251
|
+
case 7:
|
|
3252
|
+
resp = _context25.sent;
|
|
3253
|
+
return _context25.abrupt("return", resp.channel_member);
|
|
3254
|
+
|
|
3255
|
+
case 9:
|
|
3256
|
+
case "end":
|
|
3257
|
+
return _context25.stop();
|
|
3258
|
+
}
|
|
3259
|
+
}
|
|
3260
|
+
}, _callee25, this);
|
|
3261
|
+
}));
|
|
3262
|
+
|
|
3263
|
+
function archive() {
|
|
3264
|
+
return _archive.apply(this, arguments);
|
|
3265
|
+
}
|
|
3266
|
+
|
|
3267
|
+
return archive;
|
|
3268
|
+
}()
|
|
3269
|
+
/**
|
|
3270
|
+
* unarchive - unarchives the current channel
|
|
3271
|
+
* @param {{ user_id?: string }} opts user_id if called server side
|
|
3272
|
+
* @return {Promise<ChannelMemberResponse<StreamChatGenerics>>} The server response
|
|
3273
|
+
*
|
|
3274
|
+
* example:
|
|
3275
|
+
* await channel.unarchive();
|
|
3276
|
+
*
|
|
3277
|
+
* example server side:
|
|
3278
|
+
* await channel.unarchive({user_id: userId});
|
|
3279
|
+
*
|
|
3280
|
+
*/
|
|
3281
|
+
|
|
3282
|
+
}, {
|
|
3283
|
+
key: "unarchive",
|
|
3284
|
+
value: function () {
|
|
3285
|
+
var _unarchive = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee26() {
|
|
3286
|
+
var opts,
|
|
3287
|
+
cli,
|
|
3288
|
+
uid,
|
|
3289
|
+
resp,
|
|
3290
|
+
_args26 = arguments;
|
|
3291
|
+
return _regeneratorRuntime.wrap(function _callee26$(_context26) {
|
|
3292
|
+
while (1) {
|
|
3293
|
+
switch (_context26.prev = _context26.next) {
|
|
3294
|
+
case 0:
|
|
3295
|
+
opts = _args26.length > 0 && _args26[0] !== undefined ? _args26[0] : {};
|
|
3296
|
+
cli = this.getClient();
|
|
3297
|
+
uid = opts.user_id || cli.userID;
|
|
3298
|
+
|
|
3299
|
+
if (uid) {
|
|
3300
|
+
_context26.next = 5;
|
|
3301
|
+
break;
|
|
3302
|
+
}
|
|
3303
|
+
|
|
3304
|
+
throw Error('A user_id is required for unarchiving a channel');
|
|
3305
|
+
|
|
3306
|
+
case 5:
|
|
3307
|
+
_context26.next = 7;
|
|
3308
|
+
return this.partialUpdateMember(uid, {
|
|
3309
|
+
set: {
|
|
3310
|
+
archived: false
|
|
3311
|
+
}
|
|
3312
|
+
});
|
|
3313
|
+
|
|
3314
|
+
case 7:
|
|
3315
|
+
resp = _context26.sent;
|
|
3316
|
+
return _context26.abrupt("return", resp.channel_member);
|
|
3317
|
+
|
|
3318
|
+
case 9:
|
|
3319
|
+
case "end":
|
|
3320
|
+
return _context26.stop();
|
|
3321
|
+
}
|
|
3322
|
+
}
|
|
3323
|
+
}, _callee26, this);
|
|
3324
|
+
}));
|
|
3325
|
+
|
|
3326
|
+
function unarchive() {
|
|
3327
|
+
return _unarchive.apply(this, arguments);
|
|
3328
|
+
}
|
|
3329
|
+
|
|
3330
|
+
return unarchive;
|
|
3331
|
+
}()
|
|
3332
|
+
/**
|
|
3333
|
+
* pin - pins the current channel
|
|
3334
|
+
* @param {{ user_id?: string }} opts user_id if called server side
|
|
3335
|
+
* @return {Promise<ChannelMemberResponse<StreamChatGenerics>>} The server response
|
|
3336
|
+
*
|
|
3337
|
+
* example:
|
|
3338
|
+
* await channel.pin();
|
|
3339
|
+
*
|
|
3340
|
+
* example server side:
|
|
3341
|
+
* await channel.pin({user_id: userId});
|
|
3342
|
+
*
|
|
3343
|
+
*/
|
|
3344
|
+
|
|
3345
|
+
}, {
|
|
3346
|
+
key: "pin",
|
|
3347
|
+
value: function () {
|
|
3348
|
+
var _pin = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee27() {
|
|
3349
|
+
var opts,
|
|
3350
|
+
cli,
|
|
3351
|
+
uid,
|
|
3352
|
+
resp,
|
|
3353
|
+
_args27 = arguments;
|
|
3354
|
+
return _regeneratorRuntime.wrap(function _callee27$(_context27) {
|
|
3355
|
+
while (1) {
|
|
3356
|
+
switch (_context27.prev = _context27.next) {
|
|
3357
|
+
case 0:
|
|
3358
|
+
opts = _args27.length > 0 && _args27[0] !== undefined ? _args27[0] : {};
|
|
3359
|
+
cli = this.getClient();
|
|
3360
|
+
uid = opts.user_id || cli.userID;
|
|
3361
|
+
|
|
3362
|
+
if (uid) {
|
|
3363
|
+
_context27.next = 5;
|
|
3364
|
+
break;
|
|
3365
|
+
}
|
|
3366
|
+
|
|
3367
|
+
throw Error('A user_id is required for pinning a channel');
|
|
3368
|
+
|
|
3369
|
+
case 5:
|
|
3370
|
+
_context27.next = 7;
|
|
3371
|
+
return this.partialUpdateMember(uid, {
|
|
3372
|
+
set: {
|
|
3373
|
+
pinned: true
|
|
3374
|
+
}
|
|
3375
|
+
});
|
|
3376
|
+
|
|
3377
|
+
case 7:
|
|
3378
|
+
resp = _context27.sent;
|
|
3379
|
+
return _context27.abrupt("return", resp.channel_member);
|
|
3380
|
+
|
|
3381
|
+
case 9:
|
|
3382
|
+
case "end":
|
|
3383
|
+
return _context27.stop();
|
|
3384
|
+
}
|
|
3385
|
+
}
|
|
3386
|
+
}, _callee27, this);
|
|
3387
|
+
}));
|
|
3388
|
+
|
|
3389
|
+
function pin() {
|
|
3390
|
+
return _pin.apply(this, arguments);
|
|
3391
|
+
}
|
|
3392
|
+
|
|
3393
|
+
return pin;
|
|
3394
|
+
}()
|
|
3395
|
+
/**
|
|
3396
|
+
* unpin - unpins the current channel
|
|
3397
|
+
* @param {{ user_id?: string }} opts user_id if called server side
|
|
3398
|
+
* @return {Promise<ChannelMemberResponse<StreamChatGenerics>>} The server response
|
|
3399
|
+
*
|
|
3400
|
+
* example:
|
|
3401
|
+
* await channel.unpin();
|
|
3402
|
+
*
|
|
3403
|
+
* example server side:
|
|
3404
|
+
* await channel.unpin({user_id: userId});
|
|
3405
|
+
*
|
|
3406
|
+
*/
|
|
3407
|
+
|
|
3408
|
+
}, {
|
|
3409
|
+
key: "unpin",
|
|
3410
|
+
value: function () {
|
|
3411
|
+
var _unpin = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee28() {
|
|
3412
|
+
var opts,
|
|
3413
|
+
cli,
|
|
3414
|
+
uid,
|
|
3415
|
+
resp,
|
|
3416
|
+
_args28 = arguments;
|
|
3417
|
+
return _regeneratorRuntime.wrap(function _callee28$(_context28) {
|
|
3418
|
+
while (1) {
|
|
3419
|
+
switch (_context28.prev = _context28.next) {
|
|
3420
|
+
case 0:
|
|
3421
|
+
opts = _args28.length > 0 && _args28[0] !== undefined ? _args28[0] : {};
|
|
3422
|
+
cli = this.getClient();
|
|
3423
|
+
uid = opts.user_id || cli.userID;
|
|
3424
|
+
|
|
3425
|
+
if (uid) {
|
|
3426
|
+
_context28.next = 5;
|
|
3427
|
+
break;
|
|
3428
|
+
}
|
|
3429
|
+
|
|
3430
|
+
throw Error('A user_id is required for unpinning a channel');
|
|
3431
|
+
|
|
3432
|
+
case 5:
|
|
3433
|
+
_context28.next = 7;
|
|
3434
|
+
return this.partialUpdateMember(uid, {
|
|
3435
|
+
set: {
|
|
3436
|
+
pinned: false
|
|
3437
|
+
}
|
|
3438
|
+
});
|
|
3439
|
+
|
|
3440
|
+
case 7:
|
|
3441
|
+
resp = _context28.sent;
|
|
3442
|
+
return _context28.abrupt("return", resp.channel_member);
|
|
3443
|
+
|
|
3444
|
+
case 9:
|
|
3445
|
+
case "end":
|
|
3446
|
+
return _context28.stop();
|
|
3447
|
+
}
|
|
3448
|
+
}
|
|
3449
|
+
}, _callee28, this);
|
|
3450
|
+
}));
|
|
3451
|
+
|
|
3452
|
+
function unpin() {
|
|
3453
|
+
return _unpin.apply(this, arguments);
|
|
3454
|
+
}
|
|
3455
|
+
|
|
3456
|
+
return unpin;
|
|
3457
|
+
}()
|
|
3206
3458
|
/**
|
|
3207
3459
|
* muteStatus - returns the mute status for the current channel
|
|
3208
3460
|
* @return {{ muted: boolean; createdAt: Date | null; expiresAt: Date | null }} { muted: true | false, createdAt: Date | null, expiresAt: Date | null}
|
|
@@ -3241,18 +3493,18 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3241
3493
|
}, {
|
|
3242
3494
|
key: "keystroke",
|
|
3243
3495
|
value: function () {
|
|
3244
|
-
var _keystroke = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
3496
|
+
var _keystroke = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee29(parent_id, options) {
|
|
3245
3497
|
var now, diff;
|
|
3246
|
-
return _regeneratorRuntime.wrap(function
|
|
3498
|
+
return _regeneratorRuntime.wrap(function _callee29$(_context29) {
|
|
3247
3499
|
while (1) {
|
|
3248
|
-
switch (
|
|
3500
|
+
switch (_context29.prev = _context29.next) {
|
|
3249
3501
|
case 0:
|
|
3250
3502
|
if (this._isTypingIndicatorsEnabled()) {
|
|
3251
|
-
|
|
3503
|
+
_context29.next = 2;
|
|
3252
3504
|
break;
|
|
3253
3505
|
}
|
|
3254
3506
|
|
|
3255
|
-
return
|
|
3507
|
+
return _context29.abrupt("return");
|
|
3256
3508
|
|
|
3257
3509
|
case 2:
|
|
3258
3510
|
now = new Date();
|
|
@@ -3261,12 +3513,12 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3261
3513
|
this.isTyping = true; // send a typing.start every 2 seconds
|
|
3262
3514
|
|
|
3263
3515
|
if (!(diff === null || diff > 2000)) {
|
|
3264
|
-
|
|
3516
|
+
_context29.next = 10;
|
|
3265
3517
|
break;
|
|
3266
3518
|
}
|
|
3267
3519
|
|
|
3268
3520
|
this.lastTypingEvent = new Date();
|
|
3269
|
-
|
|
3521
|
+
_context29.next = 10;
|
|
3270
3522
|
return this.sendEvent(_objectSpread$a({
|
|
3271
3523
|
type: 'typing.start',
|
|
3272
3524
|
parent_id: parent_id
|
|
@@ -3274,10 +3526,10 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3274
3526
|
|
|
3275
3527
|
case 10:
|
|
3276
3528
|
case "end":
|
|
3277
|
-
return
|
|
3529
|
+
return _context29.stop();
|
|
3278
3530
|
}
|
|
3279
3531
|
}
|
|
3280
|
-
},
|
|
3532
|
+
}, _callee29, this);
|
|
3281
3533
|
}));
|
|
3282
3534
|
|
|
3283
3535
|
function keystroke(_x27, _x28) {
|
|
@@ -3295,22 +3547,22 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3295
3547
|
}, {
|
|
3296
3548
|
key: "stopTyping",
|
|
3297
3549
|
value: function () {
|
|
3298
|
-
var _stopTyping = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
3299
|
-
return _regeneratorRuntime.wrap(function
|
|
3550
|
+
var _stopTyping = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee30(parent_id, options) {
|
|
3551
|
+
return _regeneratorRuntime.wrap(function _callee30$(_context30) {
|
|
3300
3552
|
while (1) {
|
|
3301
|
-
switch (
|
|
3553
|
+
switch (_context30.prev = _context30.next) {
|
|
3302
3554
|
case 0:
|
|
3303
3555
|
if (this._isTypingIndicatorsEnabled()) {
|
|
3304
|
-
|
|
3556
|
+
_context30.next = 2;
|
|
3305
3557
|
break;
|
|
3306
3558
|
}
|
|
3307
3559
|
|
|
3308
|
-
return
|
|
3560
|
+
return _context30.abrupt("return");
|
|
3309
3561
|
|
|
3310
3562
|
case 2:
|
|
3311
3563
|
this.lastTypingEvent = null;
|
|
3312
3564
|
this.isTyping = false;
|
|
3313
|
-
|
|
3565
|
+
_context30.next = 6;
|
|
3314
3566
|
return this.sendEvent(_objectSpread$a({
|
|
3315
3567
|
type: 'typing.stop',
|
|
3316
3568
|
parent_id: parent_id
|
|
@@ -3318,10 +3570,10 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3318
3570
|
|
|
3319
3571
|
case 6:
|
|
3320
3572
|
case "end":
|
|
3321
|
-
return
|
|
3573
|
+
return _context30.stop();
|
|
3322
3574
|
}
|
|
3323
3575
|
}
|
|
3324
|
-
},
|
|
3576
|
+
}, _callee30, this);
|
|
3325
3577
|
}));
|
|
3326
3578
|
|
|
3327
3579
|
function stopTyping(_x29, _x30) {
|
|
@@ -3376,39 +3628,39 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3376
3628
|
}, {
|
|
3377
3629
|
key: "markRead",
|
|
3378
3630
|
value: function () {
|
|
3379
|
-
var _markRead = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
3631
|
+
var _markRead = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee31() {
|
|
3380
3632
|
var _this$getConfig2;
|
|
3381
3633
|
|
|
3382
3634
|
var data,
|
|
3383
|
-
|
|
3384
|
-
return _regeneratorRuntime.wrap(function
|
|
3635
|
+
_args31 = arguments;
|
|
3636
|
+
return _regeneratorRuntime.wrap(function _callee31$(_context31) {
|
|
3385
3637
|
while (1) {
|
|
3386
|
-
switch (
|
|
3638
|
+
switch (_context31.prev = _context31.next) {
|
|
3387
3639
|
case 0:
|
|
3388
|
-
data =
|
|
3640
|
+
data = _args31.length > 0 && _args31[0] !== undefined ? _args31[0] : {};
|
|
3389
3641
|
|
|
3390
3642
|
this._checkInitialized();
|
|
3391
3643
|
|
|
3392
3644
|
if (!(!((_this$getConfig2 = this.getConfig()) !== null && _this$getConfig2 !== void 0 && _this$getConfig2.read_events) && !this.getClient()._isUsingServerAuth())) {
|
|
3393
|
-
|
|
3645
|
+
_context31.next = 4;
|
|
3394
3646
|
break;
|
|
3395
3647
|
}
|
|
3396
3648
|
|
|
3397
|
-
return
|
|
3649
|
+
return _context31.abrupt("return", Promise.resolve(null));
|
|
3398
3650
|
|
|
3399
3651
|
case 4:
|
|
3400
|
-
|
|
3652
|
+
_context31.next = 6;
|
|
3401
3653
|
return this.getClient().post(this._channelURL() + '/read', _objectSpread$a({}, data));
|
|
3402
3654
|
|
|
3403
3655
|
case 6:
|
|
3404
|
-
return
|
|
3656
|
+
return _context31.abrupt("return", _context31.sent);
|
|
3405
3657
|
|
|
3406
3658
|
case 7:
|
|
3407
3659
|
case "end":
|
|
3408
|
-
return
|
|
3660
|
+
return _context31.stop();
|
|
3409
3661
|
}
|
|
3410
3662
|
}
|
|
3411
|
-
},
|
|
3663
|
+
}, _callee31, this);
|
|
3412
3664
|
}));
|
|
3413
3665
|
|
|
3414
3666
|
function markRead() {
|
|
@@ -3427,35 +3679,35 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3427
3679
|
}, {
|
|
3428
3680
|
key: "markUnread",
|
|
3429
3681
|
value: function () {
|
|
3430
|
-
var _markUnread = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
3682
|
+
var _markUnread = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee32(data) {
|
|
3431
3683
|
var _this$getConfig3;
|
|
3432
3684
|
|
|
3433
|
-
return _regeneratorRuntime.wrap(function
|
|
3685
|
+
return _regeneratorRuntime.wrap(function _callee32$(_context32) {
|
|
3434
3686
|
while (1) {
|
|
3435
|
-
switch (
|
|
3687
|
+
switch (_context32.prev = _context32.next) {
|
|
3436
3688
|
case 0:
|
|
3437
3689
|
this._checkInitialized();
|
|
3438
3690
|
|
|
3439
3691
|
if (!(!((_this$getConfig3 = this.getConfig()) !== null && _this$getConfig3 !== void 0 && _this$getConfig3.read_events) && !this.getClient()._isUsingServerAuth())) {
|
|
3440
|
-
|
|
3692
|
+
_context32.next = 3;
|
|
3441
3693
|
break;
|
|
3442
3694
|
}
|
|
3443
3695
|
|
|
3444
|
-
return
|
|
3696
|
+
return _context32.abrupt("return", Promise.resolve(null));
|
|
3445
3697
|
|
|
3446
3698
|
case 3:
|
|
3447
|
-
|
|
3699
|
+
_context32.next = 5;
|
|
3448
3700
|
return this.getClient().post(this._channelURL() + '/unread', _objectSpread$a({}, data));
|
|
3449
3701
|
|
|
3450
3702
|
case 5:
|
|
3451
|
-
return
|
|
3703
|
+
return _context32.abrupt("return", _context32.sent);
|
|
3452
3704
|
|
|
3453
3705
|
case 6:
|
|
3454
3706
|
case "end":
|
|
3455
|
-
return
|
|
3707
|
+
return _context32.stop();
|
|
3456
3708
|
}
|
|
3457
3709
|
}
|
|
3458
|
-
},
|
|
3710
|
+
}, _callee32, this);
|
|
3459
3711
|
}));
|
|
3460
3712
|
|
|
3461
3713
|
function markUnread(_x31) {
|
|
@@ -3493,11 +3745,11 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3493
3745
|
}, {
|
|
3494
3746
|
key: "watch",
|
|
3495
3747
|
value: function () {
|
|
3496
|
-
var _watch = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
3748
|
+
var _watch = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee33(options) {
|
|
3497
3749
|
var defaultOptions, combined, state;
|
|
3498
|
-
return _regeneratorRuntime.wrap(function
|
|
3750
|
+
return _regeneratorRuntime.wrap(function _callee33$(_context33) {
|
|
3499
3751
|
while (1) {
|
|
3500
|
-
switch (
|
|
3752
|
+
switch (_context33.prev = _context33.next) {
|
|
3501
3753
|
case 0:
|
|
3502
3754
|
defaultOptions = {
|
|
3503
3755
|
state: true,
|
|
@@ -3505,7 +3757,7 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3505
3757
|
presence: false
|
|
3506
3758
|
}; // Make sure we wait for the connect promise if there is a pending one
|
|
3507
3759
|
|
|
3508
|
-
|
|
3760
|
+
_context33.next = 3;
|
|
3509
3761
|
return this.getClient().wsPromise;
|
|
3510
3762
|
|
|
3511
3763
|
case 3:
|
|
@@ -3514,11 +3766,11 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3514
3766
|
}
|
|
3515
3767
|
|
|
3516
3768
|
combined = _objectSpread$a(_objectSpread$a({}, defaultOptions), options);
|
|
3517
|
-
|
|
3769
|
+
_context33.next = 7;
|
|
3518
3770
|
return this.query(combined, 'latest');
|
|
3519
3771
|
|
|
3520
3772
|
case 7:
|
|
3521
|
-
state =
|
|
3773
|
+
state = _context33.sent;
|
|
3522
3774
|
this.initialized = true;
|
|
3523
3775
|
this.data = state.channel;
|
|
3524
3776
|
|
|
@@ -3527,14 +3779,14 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3527
3779
|
channel: this
|
|
3528
3780
|
});
|
|
3529
3781
|
|
|
3530
|
-
return
|
|
3782
|
+
return _context33.abrupt("return", state);
|
|
3531
3783
|
|
|
3532
3784
|
case 12:
|
|
3533
3785
|
case "end":
|
|
3534
|
-
return
|
|
3786
|
+
return _context33.stop();
|
|
3535
3787
|
}
|
|
3536
3788
|
}
|
|
3537
|
-
},
|
|
3789
|
+
}, _callee33, this);
|
|
3538
3790
|
}));
|
|
3539
3791
|
|
|
3540
3792
|
function watch(_x32) {
|
|
@@ -3552,31 +3804,31 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3552
3804
|
}, {
|
|
3553
3805
|
key: "stopWatching",
|
|
3554
3806
|
value: function () {
|
|
3555
|
-
var _stopWatching = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
3807
|
+
var _stopWatching = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee34() {
|
|
3556
3808
|
var response;
|
|
3557
|
-
return _regeneratorRuntime.wrap(function
|
|
3809
|
+
return _regeneratorRuntime.wrap(function _callee34$(_context34) {
|
|
3558
3810
|
while (1) {
|
|
3559
|
-
switch (
|
|
3811
|
+
switch (_context34.prev = _context34.next) {
|
|
3560
3812
|
case 0:
|
|
3561
|
-
|
|
3813
|
+
_context34.next = 2;
|
|
3562
3814
|
return this.getClient().post(this._channelURL() + '/stop-watching', {});
|
|
3563
3815
|
|
|
3564
3816
|
case 2:
|
|
3565
|
-
response =
|
|
3817
|
+
response = _context34.sent;
|
|
3566
3818
|
|
|
3567
3819
|
this._client.logger('info', "channel:watch() - stopped watching channel ".concat(this.cid), {
|
|
3568
3820
|
tags: ['channel'],
|
|
3569
3821
|
channel: this
|
|
3570
3822
|
});
|
|
3571
3823
|
|
|
3572
|
-
return
|
|
3824
|
+
return _context34.abrupt("return", response);
|
|
3573
3825
|
|
|
3574
3826
|
case 5:
|
|
3575
3827
|
case "end":
|
|
3576
|
-
return
|
|
3828
|
+
return _context34.stop();
|
|
3577
3829
|
}
|
|
3578
3830
|
}
|
|
3579
|
-
},
|
|
3831
|
+
}, _callee34, this);
|
|
3580
3832
|
}));
|
|
3581
3833
|
|
|
3582
3834
|
function stopWatching() {
|
|
@@ -3599,34 +3851,34 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3599
3851
|
}, {
|
|
3600
3852
|
key: "getReplies",
|
|
3601
3853
|
value: function () {
|
|
3602
|
-
var _getReplies = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
3854
|
+
var _getReplies = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee35(parent_id, options, sort) {
|
|
3603
3855
|
var normalizedSort, data;
|
|
3604
|
-
return _regeneratorRuntime.wrap(function
|
|
3856
|
+
return _regeneratorRuntime.wrap(function _callee35$(_context35) {
|
|
3605
3857
|
while (1) {
|
|
3606
|
-
switch (
|
|
3858
|
+
switch (_context35.prev = _context35.next) {
|
|
3607
3859
|
case 0:
|
|
3608
3860
|
normalizedSort = sort ? normalizeQuerySort(sort) : undefined;
|
|
3609
|
-
|
|
3861
|
+
_context35.next = 3;
|
|
3610
3862
|
return this.getClient().get(this.getClient().baseURL + "/messages/".concat(encodeURIComponent(parent_id), "/replies"), _objectSpread$a({
|
|
3611
3863
|
sort: normalizedSort
|
|
3612
3864
|
}, options));
|
|
3613
3865
|
|
|
3614
3866
|
case 3:
|
|
3615
|
-
data =
|
|
3867
|
+
data = _context35.sent;
|
|
3616
3868
|
|
|
3617
3869
|
// add any messages to our thread state
|
|
3618
3870
|
if (data.messages) {
|
|
3619
3871
|
this.state.addMessagesSorted(data.messages);
|
|
3620
3872
|
}
|
|
3621
3873
|
|
|
3622
|
-
return
|
|
3874
|
+
return _context35.abrupt("return", data);
|
|
3623
3875
|
|
|
3624
3876
|
case 6:
|
|
3625
3877
|
case "end":
|
|
3626
|
-
return
|
|
3878
|
+
return _context35.stop();
|
|
3627
3879
|
}
|
|
3628
3880
|
}
|
|
3629
|
-
},
|
|
3881
|
+
}, _callee35, this);
|
|
3630
3882
|
}));
|
|
3631
3883
|
|
|
3632
3884
|
function getReplies(_x33, _x34, _x35) {
|
|
@@ -3647,15 +3899,15 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3647
3899
|
}, {
|
|
3648
3900
|
key: "getPinnedMessages",
|
|
3649
3901
|
value: function () {
|
|
3650
|
-
var _getPinnedMessages = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
3902
|
+
var _getPinnedMessages = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee36(options) {
|
|
3651
3903
|
var sort,
|
|
3652
|
-
|
|
3653
|
-
return _regeneratorRuntime.wrap(function
|
|
3904
|
+
_args36 = arguments;
|
|
3905
|
+
return _regeneratorRuntime.wrap(function _callee36$(_context36) {
|
|
3654
3906
|
while (1) {
|
|
3655
|
-
switch (
|
|
3907
|
+
switch (_context36.prev = _context36.next) {
|
|
3656
3908
|
case 0:
|
|
3657
|
-
sort =
|
|
3658
|
-
|
|
3909
|
+
sort = _args36.length > 1 && _args36[1] !== undefined ? _args36[1] : [];
|
|
3910
|
+
_context36.next = 3;
|
|
3659
3911
|
return this.getClient().get(this._channelURL() + '/pinned_messages', {
|
|
3660
3912
|
payload: _objectSpread$a(_objectSpread$a({}, options), {}, {
|
|
3661
3913
|
sort: normalizeQuerySort(sort)
|
|
@@ -3663,14 +3915,14 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3663
3915
|
});
|
|
3664
3916
|
|
|
3665
3917
|
case 3:
|
|
3666
|
-
return
|
|
3918
|
+
return _context36.abrupt("return", _context36.sent);
|
|
3667
3919
|
|
|
3668
3920
|
case 4:
|
|
3669
3921
|
case "end":
|
|
3670
|
-
return
|
|
3922
|
+
return _context36.stop();
|
|
3671
3923
|
}
|
|
3672
3924
|
}
|
|
3673
|
-
},
|
|
3925
|
+
}, _callee36, this);
|
|
3674
3926
|
}));
|
|
3675
3927
|
|
|
3676
3928
|
function getPinnedMessages(_x36) {
|
|
@@ -3809,7 +4061,7 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3809
4061
|
* @return {Promise<QueryChannelAPIResponse<StreamChatGenerics>>} Returns a query response
|
|
3810
4062
|
*/
|
|
3811
4063
|
function () {
|
|
3812
|
-
var _query = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
4064
|
+
var _query = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee37(options) {
|
|
3813
4065
|
var _options$messages$lim, _options$messages, _this$data6, _this$data7;
|
|
3814
4066
|
|
|
3815
4067
|
var messageSetToAddToIfDoesNotExist,
|
|
@@ -3820,14 +4072,14 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3820
4072
|
_this$_initializeStat,
|
|
3821
4073
|
messageSet,
|
|
3822
4074
|
areCapabilitiesChanged,
|
|
3823
|
-
|
|
4075
|
+
_args37 = arguments;
|
|
3824
4076
|
|
|
3825
|
-
return _regeneratorRuntime.wrap(function
|
|
4077
|
+
return _regeneratorRuntime.wrap(function _callee37$(_context37) {
|
|
3826
4078
|
while (1) {
|
|
3827
|
-
switch (
|
|
4079
|
+
switch (_context37.prev = _context37.next) {
|
|
3828
4080
|
case 0:
|
|
3829
|
-
messageSetToAddToIfDoesNotExist =
|
|
3830
|
-
|
|
4081
|
+
messageSetToAddToIfDoesNotExist = _args37.length > 1 && _args37[1] !== undefined ? _args37[1] : 'current';
|
|
4082
|
+
_context37.next = 3;
|
|
3831
4083
|
return this.getClient().wsPromise;
|
|
3832
4084
|
|
|
3833
4085
|
case 3:
|
|
@@ -3837,14 +4089,14 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3837
4089
|
queryURL += "/".concat(encodeURIComponent(this.id));
|
|
3838
4090
|
}
|
|
3839
4091
|
|
|
3840
|
-
|
|
4092
|
+
_context37.next = 7;
|
|
3841
4093
|
return this.getClient().post(queryURL + '/query', _objectSpread$a({
|
|
3842
4094
|
data: this._data,
|
|
3843
4095
|
state: true
|
|
3844
4096
|
}, options));
|
|
3845
4097
|
|
|
3846
4098
|
case 7:
|
|
3847
|
-
state =
|
|
4099
|
+
state = _context37.sent;
|
|
3848
4100
|
|
|
3849
4101
|
// update the channel id if it was missing
|
|
3850
4102
|
if (!this.id) {
|
|
@@ -3900,14 +4152,14 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3900
4152
|
isLatestMessageSet: messageSet.isLatest
|
|
3901
4153
|
}
|
|
3902
4154
|
});
|
|
3903
|
-
return
|
|
4155
|
+
return _context37.abrupt("return", state);
|
|
3904
4156
|
|
|
3905
4157
|
case 19:
|
|
3906
4158
|
case "end":
|
|
3907
|
-
return
|
|
4159
|
+
return _context37.stop();
|
|
3908
4160
|
}
|
|
3909
4161
|
}
|
|
3910
|
-
},
|
|
4162
|
+
}, _callee37, this);
|
|
3911
4163
|
}));
|
|
3912
4164
|
|
|
3913
4165
|
function query(_x37) {
|
|
@@ -3927,28 +4179,28 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3927
4179
|
}, {
|
|
3928
4180
|
key: "banUser",
|
|
3929
4181
|
value: function () {
|
|
3930
|
-
var _banUser = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
3931
|
-
return _regeneratorRuntime.wrap(function
|
|
4182
|
+
var _banUser = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee38(targetUserID, options) {
|
|
4183
|
+
return _regeneratorRuntime.wrap(function _callee38$(_context38) {
|
|
3932
4184
|
while (1) {
|
|
3933
|
-
switch (
|
|
4185
|
+
switch (_context38.prev = _context38.next) {
|
|
3934
4186
|
case 0:
|
|
3935
4187
|
this._checkInitialized();
|
|
3936
4188
|
|
|
3937
|
-
|
|
4189
|
+
_context38.next = 3;
|
|
3938
4190
|
return this.getClient().banUser(targetUserID, _objectSpread$a(_objectSpread$a({}, options), {}, {
|
|
3939
4191
|
type: this.type,
|
|
3940
4192
|
id: this.id
|
|
3941
4193
|
}));
|
|
3942
4194
|
|
|
3943
4195
|
case 3:
|
|
3944
|
-
return
|
|
4196
|
+
return _context38.abrupt("return", _context38.sent);
|
|
3945
4197
|
|
|
3946
4198
|
case 4:
|
|
3947
4199
|
case "end":
|
|
3948
|
-
return
|
|
4200
|
+
return _context38.stop();
|
|
3949
4201
|
}
|
|
3950
4202
|
}
|
|
3951
|
-
},
|
|
4203
|
+
}, _callee38, this);
|
|
3952
4204
|
}));
|
|
3953
4205
|
|
|
3954
4206
|
function banUser(_x38, _x39) {
|
|
@@ -3969,34 +4221,34 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3969
4221
|
}, {
|
|
3970
4222
|
key: "hide",
|
|
3971
4223
|
value: function () {
|
|
3972
|
-
var _hide = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
4224
|
+
var _hide = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee39() {
|
|
3973
4225
|
var userId,
|
|
3974
4226
|
clearHistory,
|
|
3975
|
-
|
|
3976
|
-
return _regeneratorRuntime.wrap(function
|
|
4227
|
+
_args39 = arguments;
|
|
4228
|
+
return _regeneratorRuntime.wrap(function _callee39$(_context39) {
|
|
3977
4229
|
while (1) {
|
|
3978
|
-
switch (
|
|
4230
|
+
switch (_context39.prev = _context39.next) {
|
|
3979
4231
|
case 0:
|
|
3980
|
-
userId =
|
|
3981
|
-
clearHistory =
|
|
4232
|
+
userId = _args39.length > 0 && _args39[0] !== undefined ? _args39[0] : null;
|
|
4233
|
+
clearHistory = _args39.length > 1 && _args39[1] !== undefined ? _args39[1] : false;
|
|
3982
4234
|
|
|
3983
4235
|
this._checkInitialized();
|
|
3984
4236
|
|
|
3985
|
-
|
|
4237
|
+
_context39.next = 5;
|
|
3986
4238
|
return this.getClient().post("".concat(this._channelURL(), "/hide"), {
|
|
3987
4239
|
user_id: userId,
|
|
3988
4240
|
clear_history: clearHistory
|
|
3989
4241
|
});
|
|
3990
4242
|
|
|
3991
4243
|
case 5:
|
|
3992
|
-
return
|
|
4244
|
+
return _context39.abrupt("return", _context39.sent);
|
|
3993
4245
|
|
|
3994
4246
|
case 6:
|
|
3995
4247
|
case "end":
|
|
3996
|
-
return
|
|
4248
|
+
return _context39.stop();
|
|
3997
4249
|
}
|
|
3998
4250
|
}
|
|
3999
|
-
},
|
|
4251
|
+
}, _callee39, this);
|
|
4000
4252
|
}));
|
|
4001
4253
|
|
|
4002
4254
|
function hide() {
|
|
@@ -4015,31 +4267,31 @@ var Channel = /*#__PURE__*/function () {
|
|
|
4015
4267
|
}, {
|
|
4016
4268
|
key: "show",
|
|
4017
4269
|
value: function () {
|
|
4018
|
-
var _show = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
4270
|
+
var _show = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee40() {
|
|
4019
4271
|
var userId,
|
|
4020
|
-
|
|
4021
|
-
return _regeneratorRuntime.wrap(function
|
|
4272
|
+
_args40 = arguments;
|
|
4273
|
+
return _regeneratorRuntime.wrap(function _callee40$(_context40) {
|
|
4022
4274
|
while (1) {
|
|
4023
|
-
switch (
|
|
4275
|
+
switch (_context40.prev = _context40.next) {
|
|
4024
4276
|
case 0:
|
|
4025
|
-
userId =
|
|
4277
|
+
userId = _args40.length > 0 && _args40[0] !== undefined ? _args40[0] : null;
|
|
4026
4278
|
|
|
4027
4279
|
this._checkInitialized();
|
|
4028
4280
|
|
|
4029
|
-
|
|
4281
|
+
_context40.next = 4;
|
|
4030
4282
|
return this.getClient().post("".concat(this._channelURL(), "/show"), {
|
|
4031
4283
|
user_id: userId
|
|
4032
4284
|
});
|
|
4033
4285
|
|
|
4034
4286
|
case 4:
|
|
4035
|
-
return
|
|
4287
|
+
return _context40.abrupt("return", _context40.sent);
|
|
4036
4288
|
|
|
4037
4289
|
case 5:
|
|
4038
4290
|
case "end":
|
|
4039
|
-
return
|
|
4291
|
+
return _context40.stop();
|
|
4040
4292
|
}
|
|
4041
4293
|
}
|
|
4042
|
-
},
|
|
4294
|
+
}, _callee40, this);
|
|
4043
4295
|
}));
|
|
4044
4296
|
|
|
4045
4297
|
function show() {
|
|
@@ -4058,28 +4310,28 @@ var Channel = /*#__PURE__*/function () {
|
|
|
4058
4310
|
}, {
|
|
4059
4311
|
key: "unbanUser",
|
|
4060
4312
|
value: function () {
|
|
4061
|
-
var _unbanUser = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
4062
|
-
return _regeneratorRuntime.wrap(function
|
|
4313
|
+
var _unbanUser = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee41(targetUserID) {
|
|
4314
|
+
return _regeneratorRuntime.wrap(function _callee41$(_context41) {
|
|
4063
4315
|
while (1) {
|
|
4064
|
-
switch (
|
|
4316
|
+
switch (_context41.prev = _context41.next) {
|
|
4065
4317
|
case 0:
|
|
4066
4318
|
this._checkInitialized();
|
|
4067
4319
|
|
|
4068
|
-
|
|
4320
|
+
_context41.next = 3;
|
|
4069
4321
|
return this.getClient().unbanUser(targetUserID, {
|
|
4070
4322
|
type: this.type,
|
|
4071
4323
|
id: this.id
|
|
4072
4324
|
});
|
|
4073
4325
|
|
|
4074
4326
|
case 3:
|
|
4075
|
-
return
|
|
4327
|
+
return _context41.abrupt("return", _context41.sent);
|
|
4076
4328
|
|
|
4077
4329
|
case 4:
|
|
4078
4330
|
case "end":
|
|
4079
|
-
return
|
|
4331
|
+
return _context41.stop();
|
|
4080
4332
|
}
|
|
4081
4333
|
}
|
|
4082
|
-
},
|
|
4334
|
+
}, _callee41, this);
|
|
4083
4335
|
}));
|
|
4084
4336
|
|
|
4085
4337
|
function unbanUser(_x40) {
|
|
@@ -4099,28 +4351,28 @@ var Channel = /*#__PURE__*/function () {
|
|
|
4099
4351
|
}, {
|
|
4100
4352
|
key: "shadowBan",
|
|
4101
4353
|
value: function () {
|
|
4102
|
-
var _shadowBan = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
4103
|
-
return _regeneratorRuntime.wrap(function
|
|
4354
|
+
var _shadowBan = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee42(targetUserID, options) {
|
|
4355
|
+
return _regeneratorRuntime.wrap(function _callee42$(_context42) {
|
|
4104
4356
|
while (1) {
|
|
4105
|
-
switch (
|
|
4357
|
+
switch (_context42.prev = _context42.next) {
|
|
4106
4358
|
case 0:
|
|
4107
4359
|
this._checkInitialized();
|
|
4108
4360
|
|
|
4109
|
-
|
|
4361
|
+
_context42.next = 3;
|
|
4110
4362
|
return this.getClient().shadowBan(targetUserID, _objectSpread$a(_objectSpread$a({}, options), {}, {
|
|
4111
4363
|
type: this.type,
|
|
4112
4364
|
id: this.id
|
|
4113
4365
|
}));
|
|
4114
4366
|
|
|
4115
4367
|
case 3:
|
|
4116
|
-
return
|
|
4368
|
+
return _context42.abrupt("return", _context42.sent);
|
|
4117
4369
|
|
|
4118
4370
|
case 4:
|
|
4119
4371
|
case "end":
|
|
4120
|
-
return
|
|
4372
|
+
return _context42.stop();
|
|
4121
4373
|
}
|
|
4122
4374
|
}
|
|
4123
|
-
},
|
|
4375
|
+
}, _callee42, this);
|
|
4124
4376
|
}));
|
|
4125
4377
|
|
|
4126
4378
|
function shadowBan(_x41, _x42) {
|
|
@@ -4139,28 +4391,28 @@ var Channel = /*#__PURE__*/function () {
|
|
|
4139
4391
|
}, {
|
|
4140
4392
|
key: "removeShadowBan",
|
|
4141
4393
|
value: function () {
|
|
4142
|
-
var _removeShadowBan = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
4143
|
-
return _regeneratorRuntime.wrap(function
|
|
4394
|
+
var _removeShadowBan = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee43(targetUserID) {
|
|
4395
|
+
return _regeneratorRuntime.wrap(function _callee43$(_context43) {
|
|
4144
4396
|
while (1) {
|
|
4145
|
-
switch (
|
|
4397
|
+
switch (_context43.prev = _context43.next) {
|
|
4146
4398
|
case 0:
|
|
4147
4399
|
this._checkInitialized();
|
|
4148
4400
|
|
|
4149
|
-
|
|
4401
|
+
_context43.next = 3;
|
|
4150
4402
|
return this.getClient().removeShadowBan(targetUserID, {
|
|
4151
4403
|
type: this.type,
|
|
4152
4404
|
id: this.id
|
|
4153
4405
|
});
|
|
4154
4406
|
|
|
4155
4407
|
case 3:
|
|
4156
|
-
return
|
|
4408
|
+
return _context43.abrupt("return", _context43.sent);
|
|
4157
4409
|
|
|
4158
4410
|
case 4:
|
|
4159
4411
|
case "end":
|
|
4160
|
-
return
|
|
4412
|
+
return _context43.stop();
|
|
4161
4413
|
}
|
|
4162
4414
|
}
|
|
4163
|
-
},
|
|
4415
|
+
}, _callee43, this);
|
|
4164
4416
|
}));
|
|
4165
4417
|
|
|
4166
4418
|
function removeShadowBan(_x43) {
|
|
@@ -4179,23 +4431,23 @@ var Channel = /*#__PURE__*/function () {
|
|
|
4179
4431
|
}, {
|
|
4180
4432
|
key: "createCall",
|
|
4181
4433
|
value: function () {
|
|
4182
|
-
var _createCall = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
4183
|
-
return _regeneratorRuntime.wrap(function
|
|
4434
|
+
var _createCall = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee44(options) {
|
|
4435
|
+
return _regeneratorRuntime.wrap(function _callee44$(_context44) {
|
|
4184
4436
|
while (1) {
|
|
4185
|
-
switch (
|
|
4437
|
+
switch (_context44.prev = _context44.next) {
|
|
4186
4438
|
case 0:
|
|
4187
|
-
|
|
4439
|
+
_context44.next = 2;
|
|
4188
4440
|
return this.getClient().post(this._channelURL() + '/call', options);
|
|
4189
4441
|
|
|
4190
4442
|
case 2:
|
|
4191
|
-
return
|
|
4443
|
+
return _context44.abrupt("return", _context44.sent);
|
|
4192
4444
|
|
|
4193
4445
|
case 3:
|
|
4194
4446
|
case "end":
|
|
4195
|
-
return
|
|
4447
|
+
return _context44.stop();
|
|
4196
4448
|
}
|
|
4197
4449
|
}
|
|
4198
|
-
},
|
|
4450
|
+
}, _callee44, this);
|
|
4199
4451
|
}));
|
|
4200
4452
|
|
|
4201
4453
|
function createCall(_x44) {
|
|
@@ -4214,23 +4466,23 @@ var Channel = /*#__PURE__*/function () {
|
|
|
4214
4466
|
}, {
|
|
4215
4467
|
key: "vote",
|
|
4216
4468
|
value: function () {
|
|
4217
|
-
var _vote2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
4218
|
-
return _regeneratorRuntime.wrap(function
|
|
4469
|
+
var _vote2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee45(messageId, pollId, _vote) {
|
|
4470
|
+
return _regeneratorRuntime.wrap(function _callee45$(_context45) {
|
|
4219
4471
|
while (1) {
|
|
4220
|
-
switch (
|
|
4472
|
+
switch (_context45.prev = _context45.next) {
|
|
4221
4473
|
case 0:
|
|
4222
|
-
|
|
4474
|
+
_context45.next = 2;
|
|
4223
4475
|
return this.getClient().castPollVote(messageId, pollId, _vote);
|
|
4224
4476
|
|
|
4225
4477
|
case 2:
|
|
4226
|
-
return
|
|
4478
|
+
return _context45.abrupt("return", _context45.sent);
|
|
4227
4479
|
|
|
4228
4480
|
case 3:
|
|
4229
4481
|
case "end":
|
|
4230
|
-
return
|
|
4482
|
+
return _context45.stop();
|
|
4231
4483
|
}
|
|
4232
4484
|
}
|
|
4233
|
-
},
|
|
4485
|
+
}, _callee45, this);
|
|
4234
4486
|
}));
|
|
4235
4487
|
|
|
4236
4488
|
function vote(_x45, _x46, _x47) {
|
|
@@ -4242,23 +4494,23 @@ var Channel = /*#__PURE__*/function () {
|
|
|
4242
4494
|
}, {
|
|
4243
4495
|
key: "removeVote",
|
|
4244
4496
|
value: function () {
|
|
4245
|
-
var _removeVote = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
4246
|
-
return _regeneratorRuntime.wrap(function
|
|
4497
|
+
var _removeVote = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee46(messageId, pollId, voteId) {
|
|
4498
|
+
return _regeneratorRuntime.wrap(function _callee46$(_context46) {
|
|
4247
4499
|
while (1) {
|
|
4248
|
-
switch (
|
|
4500
|
+
switch (_context46.prev = _context46.next) {
|
|
4249
4501
|
case 0:
|
|
4250
|
-
|
|
4502
|
+
_context46.next = 2;
|
|
4251
4503
|
return this.getClient().removePollVote(messageId, pollId, voteId);
|
|
4252
4504
|
|
|
4253
4505
|
case 2:
|
|
4254
|
-
return
|
|
4506
|
+
return _context46.abrupt("return", _context46.sent);
|
|
4255
4507
|
|
|
4256
4508
|
case 3:
|
|
4257
4509
|
case "end":
|
|
4258
|
-
return
|
|
4510
|
+
return _context46.stop();
|
|
4259
4511
|
}
|
|
4260
4512
|
}
|
|
4261
|
-
},
|
|
4513
|
+
}, _callee46, this);
|
|
4262
4514
|
}));
|
|
4263
4515
|
|
|
4264
4516
|
function removeVote(_x48, _x49, _x50) {
|
|
@@ -8224,39 +8476,157 @@ var Moderation = /*#__PURE__*/function () {
|
|
|
8224
8476
|
return getConfig;
|
|
8225
8477
|
}()
|
|
8226
8478
|
}, {
|
|
8227
|
-
key: "
|
|
8479
|
+
key: "deleteConfig",
|
|
8228
8480
|
value: function () {
|
|
8229
|
-
var
|
|
8230
|
-
var options,
|
|
8231
|
-
_args10 = arguments;
|
|
8481
|
+
var _deleteConfig = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee10(key) {
|
|
8232
8482
|
return _regeneratorRuntime.wrap(function _callee10$(_context10) {
|
|
8233
8483
|
while (1) {
|
|
8234
8484
|
switch (_context10.prev = _context10.next) {
|
|
8235
8485
|
case 0:
|
|
8236
|
-
|
|
8237
|
-
|
|
8486
|
+
_context10.next = 2;
|
|
8487
|
+
return this.client.delete(this.client.baseURL + '/api/v2/moderation/config/' + key);
|
|
8488
|
+
|
|
8489
|
+
case 2:
|
|
8490
|
+
return _context10.abrupt("return", _context10.sent);
|
|
8491
|
+
|
|
8492
|
+
case 3:
|
|
8493
|
+
case "end":
|
|
8494
|
+
return _context10.stop();
|
|
8495
|
+
}
|
|
8496
|
+
}
|
|
8497
|
+
}, _callee10, this);
|
|
8498
|
+
}));
|
|
8499
|
+
|
|
8500
|
+
function deleteConfig(_x14) {
|
|
8501
|
+
return _deleteConfig.apply(this, arguments);
|
|
8502
|
+
}
|
|
8503
|
+
|
|
8504
|
+
return deleteConfig;
|
|
8505
|
+
}()
|
|
8506
|
+
/**
|
|
8507
|
+
* Query moderation configs
|
|
8508
|
+
* @param {Object} filterConditions Filter conditions for querying moderation configs
|
|
8509
|
+
* @param {Object} sort Sort conditions for querying moderation configs
|
|
8510
|
+
* @param {Object} options Additional options for querying moderation configs
|
|
8511
|
+
*/
|
|
8512
|
+
|
|
8513
|
+
}, {
|
|
8514
|
+
key: "queryConfigs",
|
|
8515
|
+
value: function () {
|
|
8516
|
+
var _queryConfigs = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee11(filterConditions, sort) {
|
|
8517
|
+
var options,
|
|
8518
|
+
_args11 = arguments;
|
|
8519
|
+
return _regeneratorRuntime.wrap(function _callee11$(_context11) {
|
|
8520
|
+
while (1) {
|
|
8521
|
+
switch (_context11.prev = _context11.next) {
|
|
8522
|
+
case 0:
|
|
8523
|
+
options = _args11.length > 2 && _args11[2] !== undefined ? _args11[2] : {};
|
|
8524
|
+
_context11.next = 3;
|
|
8525
|
+
return this.client.post(this.client.baseURL + '/api/v2/moderation/configs', _objectSpread$3({
|
|
8526
|
+
filter: filterConditions,
|
|
8527
|
+
sort: sort
|
|
8528
|
+
}, options));
|
|
8529
|
+
|
|
8530
|
+
case 3:
|
|
8531
|
+
return _context11.abrupt("return", _context11.sent);
|
|
8532
|
+
|
|
8533
|
+
case 4:
|
|
8534
|
+
case "end":
|
|
8535
|
+
return _context11.stop();
|
|
8536
|
+
}
|
|
8537
|
+
}
|
|
8538
|
+
}, _callee11, this);
|
|
8539
|
+
}));
|
|
8540
|
+
|
|
8541
|
+
function queryConfigs(_x15, _x16) {
|
|
8542
|
+
return _queryConfigs.apply(this, arguments);
|
|
8543
|
+
}
|
|
8544
|
+
|
|
8545
|
+
return queryConfigs;
|
|
8546
|
+
}()
|
|
8547
|
+
}, {
|
|
8548
|
+
key: "submitAction",
|
|
8549
|
+
value: function () {
|
|
8550
|
+
var _submitAction = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee12(actionType, itemID) {
|
|
8551
|
+
var options,
|
|
8552
|
+
_args12 = arguments;
|
|
8553
|
+
return _regeneratorRuntime.wrap(function _callee12$(_context12) {
|
|
8554
|
+
while (1) {
|
|
8555
|
+
switch (_context12.prev = _context12.next) {
|
|
8556
|
+
case 0:
|
|
8557
|
+
options = _args12.length > 2 && _args12[2] !== undefined ? _args12[2] : {};
|
|
8558
|
+
_context12.next = 3;
|
|
8238
8559
|
return this.client.post(this.client.baseURL + '/api/v2/moderation/submit_action', _objectSpread$3({
|
|
8239
8560
|
action_type: actionType,
|
|
8240
8561
|
item_id: itemID
|
|
8241
8562
|
}, options));
|
|
8242
8563
|
|
|
8243
8564
|
case 3:
|
|
8244
|
-
return
|
|
8565
|
+
return _context12.abrupt("return", _context12.sent);
|
|
8245
8566
|
|
|
8246
8567
|
case 4:
|
|
8247
8568
|
case "end":
|
|
8248
|
-
return
|
|
8569
|
+
return _context12.stop();
|
|
8249
8570
|
}
|
|
8250
8571
|
}
|
|
8251
|
-
},
|
|
8572
|
+
}, _callee12, this);
|
|
8252
8573
|
}));
|
|
8253
8574
|
|
|
8254
|
-
function submitAction(
|
|
8575
|
+
function submitAction(_x17, _x18) {
|
|
8255
8576
|
return _submitAction.apply(this, arguments);
|
|
8256
8577
|
}
|
|
8257
8578
|
|
|
8258
8579
|
return submitAction;
|
|
8259
8580
|
}()
|
|
8581
|
+
/**
|
|
8582
|
+
*
|
|
8583
|
+
* @param {string} entityType string Type of entity to be checked E.g., stream:user, stream:chat:v1:message, or any custom string
|
|
8584
|
+
* @param {string} entityID string ID of the entity to be checked. This is mainly for tracking purposes
|
|
8585
|
+
* @param {string} entityCreatorID string ID of the entity creator
|
|
8586
|
+
* @param {object} moderationPayload object Content to be checked for moderation. E.g., { texts: ['text1', 'text2'], images: ['image1', 'image2']}
|
|
8587
|
+
* @param {Array} moderationPayload.texts array Array of texts to be checked for moderation
|
|
8588
|
+
* @param {Array} moderationPayload.images array Array of images to be checked for moderation
|
|
8589
|
+
* @param {Array} moderationPayload.videos array Array of videos to be checked for moderation
|
|
8590
|
+
* @param configKey
|
|
8591
|
+
* @param options
|
|
8592
|
+
* @returns
|
|
8593
|
+
*/
|
|
8594
|
+
|
|
8595
|
+
}, {
|
|
8596
|
+
key: "check",
|
|
8597
|
+
value: function () {
|
|
8598
|
+
var _check = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee13(entityType, entityID, entityCreatorID, moderationPayload, configKey, options) {
|
|
8599
|
+
return _regeneratorRuntime.wrap(function _callee13$(_context13) {
|
|
8600
|
+
while (1) {
|
|
8601
|
+
switch (_context13.prev = _context13.next) {
|
|
8602
|
+
case 0:
|
|
8603
|
+
_context13.next = 2;
|
|
8604
|
+
return this.client.post(this.client.baseURL + "/api/v2/moderation/check", {
|
|
8605
|
+
entity_type: entityType,
|
|
8606
|
+
entity_id: entityID,
|
|
8607
|
+
entity_creator_id: entityCreatorID,
|
|
8608
|
+
moderation_payload: moderationPayload,
|
|
8609
|
+
config_key: configKey,
|
|
8610
|
+
options: options
|
|
8611
|
+
});
|
|
8612
|
+
|
|
8613
|
+
case 2:
|
|
8614
|
+
return _context13.abrupt("return", _context13.sent);
|
|
8615
|
+
|
|
8616
|
+
case 3:
|
|
8617
|
+
case "end":
|
|
8618
|
+
return _context13.stop();
|
|
8619
|
+
}
|
|
8620
|
+
}
|
|
8621
|
+
}, _callee13, this);
|
|
8622
|
+
}));
|
|
8623
|
+
|
|
8624
|
+
function check(_x19, _x20, _x21, _x22, _x23, _x24) {
|
|
8625
|
+
return _check.apply(this, arguments);
|
|
8626
|
+
}
|
|
8627
|
+
|
|
8628
|
+
return check;
|
|
8629
|
+
}()
|
|
8260
8630
|
}]);
|
|
8261
8631
|
|
|
8262
8632
|
return Moderation;
|
|
@@ -14217,7 +14587,7 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
14217
14587
|
}, {
|
|
14218
14588
|
key: "getUserAgent",
|
|
14219
14589
|
value: function getUserAgent() {
|
|
14220
|
-
return this.userAgent || "stream-chat-javascript-client-".concat(this.node ? 'node' : 'browser', "-", "8.
|
|
14590
|
+
return this.userAgent || "stream-chat-javascript-client-".concat(this.node ? 'node' : 'browser', "-", "8.43.0");
|
|
14221
14591
|
}
|
|
14222
14592
|
}, {
|
|
14223
14593
|
key: "setUserAgent",
|