stream-chat 8.40.2 → 8.40.4
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 +406 -344
- 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 +406 -344
- package/dist/browser.js.map +1 -1
- package/dist/index.es.js +406 -344
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +406 -344
- package/dist/index.js.map +1 -1
- package/dist/types/channel.d.ts +11 -1
- package/dist/types/channel.d.ts.map +1 -1
- package/dist/types/thread.d.ts.map +1 -1
- package/dist/types/types.d.ts +4 -0
- 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/channel.ts +30 -6
- package/src/thread.ts +9 -1
- package/src/types.ts +5 -0
- package/src/utils.ts +5 -1
package/dist/browser.es.js
CHANGED
|
@@ -421,8 +421,10 @@ function addToMessageList(messages, newMessage) {
|
|
|
421
421
|
} // for empty list just concat and return unless it's an update or deletion
|
|
422
422
|
|
|
423
423
|
|
|
424
|
-
if (
|
|
424
|
+
if (newMessages.length === 0 && addMessageToList) {
|
|
425
425
|
return newMessages.concat(newMessage);
|
|
426
|
+
} else if (newMessages.length === 0) {
|
|
427
|
+
return newMessages;
|
|
426
428
|
} // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
427
429
|
|
|
428
430
|
|
|
@@ -432,6 +434,8 @@ function addToMessageList(messages, newMessage) {
|
|
|
432
434
|
|
|
433
435
|
if (messageIsNewest && addMessageToList) {
|
|
434
436
|
return newMessages.concat(newMessage);
|
|
437
|
+
} else if (newMessages.length === 0) {
|
|
438
|
+
return newMessages;
|
|
435
439
|
} // find the closest index to push the new message
|
|
436
440
|
|
|
437
441
|
|
|
@@ -2250,6 +2254,51 @@ var Channel = /*#__PURE__*/function () {
|
|
|
2250
2254
|
|
|
2251
2255
|
return queryMembers;
|
|
2252
2256
|
}()
|
|
2257
|
+
/**
|
|
2258
|
+
* partialUpdateMember - Partial update a member
|
|
2259
|
+
*
|
|
2260
|
+
* @param {string} user_id member user id
|
|
2261
|
+
* @param {PartialUpdateMember<StreamChatGenerics>} updates
|
|
2262
|
+
*
|
|
2263
|
+
* @return {Promise<ChannelMemberResponse<StreamChatGenerics>>} Updated member
|
|
2264
|
+
*/
|
|
2265
|
+
|
|
2266
|
+
}, {
|
|
2267
|
+
key: "partialUpdateMember",
|
|
2268
|
+
value: function () {
|
|
2269
|
+
var _partialUpdateMember = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6(user_id, updates) {
|
|
2270
|
+
return _regeneratorRuntime.wrap(function _callee6$(_context6) {
|
|
2271
|
+
while (1) {
|
|
2272
|
+
switch (_context6.prev = _context6.next) {
|
|
2273
|
+
case 0:
|
|
2274
|
+
if (user_id) {
|
|
2275
|
+
_context6.next = 2;
|
|
2276
|
+
break;
|
|
2277
|
+
}
|
|
2278
|
+
|
|
2279
|
+
throw Error('Please specify the user id');
|
|
2280
|
+
|
|
2281
|
+
case 2:
|
|
2282
|
+
_context6.next = 4;
|
|
2283
|
+
return this.getClient().patch(this._channelURL() + "/member/".concat(encodeURIComponent(user_id)), updates);
|
|
2284
|
+
|
|
2285
|
+
case 4:
|
|
2286
|
+
return _context6.abrupt("return", _context6.sent);
|
|
2287
|
+
|
|
2288
|
+
case 5:
|
|
2289
|
+
case "end":
|
|
2290
|
+
return _context6.stop();
|
|
2291
|
+
}
|
|
2292
|
+
}
|
|
2293
|
+
}, _callee6, this);
|
|
2294
|
+
}));
|
|
2295
|
+
|
|
2296
|
+
function partialUpdateMember(_x7, _x8) {
|
|
2297
|
+
return _partialUpdateMember.apply(this, arguments);
|
|
2298
|
+
}
|
|
2299
|
+
|
|
2300
|
+
return partialUpdateMember;
|
|
2301
|
+
}()
|
|
2253
2302
|
/**
|
|
2254
2303
|
* sendReaction - Send a reaction about a message
|
|
2255
2304
|
*
|
|
@@ -2263,13 +2312,13 @@ var Channel = /*#__PURE__*/function () {
|
|
|
2263
2312
|
}, {
|
|
2264
2313
|
key: "sendReaction",
|
|
2265
2314
|
value: function () {
|
|
2266
|
-
var _sendReaction = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
2267
|
-
return _regeneratorRuntime.wrap(function
|
|
2315
|
+
var _sendReaction = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee7(messageID, reaction, options) {
|
|
2316
|
+
return _regeneratorRuntime.wrap(function _callee7$(_context7) {
|
|
2268
2317
|
while (1) {
|
|
2269
|
-
switch (
|
|
2318
|
+
switch (_context7.prev = _context7.next) {
|
|
2270
2319
|
case 0:
|
|
2271
2320
|
if (messageID) {
|
|
2272
|
-
|
|
2321
|
+
_context7.next = 2;
|
|
2273
2322
|
break;
|
|
2274
2323
|
}
|
|
2275
2324
|
|
|
@@ -2277,30 +2326,30 @@ var Channel = /*#__PURE__*/function () {
|
|
|
2277
2326
|
|
|
2278
2327
|
case 2:
|
|
2279
2328
|
if (!(!reaction || Object.keys(reaction).length === 0)) {
|
|
2280
|
-
|
|
2329
|
+
_context7.next = 4;
|
|
2281
2330
|
break;
|
|
2282
2331
|
}
|
|
2283
2332
|
|
|
2284
2333
|
throw Error("Reaction object is missing");
|
|
2285
2334
|
|
|
2286
2335
|
case 4:
|
|
2287
|
-
|
|
2336
|
+
_context7.next = 6;
|
|
2288
2337
|
return this.getClient().post(this.getClient().baseURL + "/messages/".concat(encodeURIComponent(messageID), "/reaction"), _objectSpread$9({
|
|
2289
2338
|
reaction: reaction
|
|
2290
2339
|
}, options));
|
|
2291
2340
|
|
|
2292
2341
|
case 6:
|
|
2293
|
-
return
|
|
2342
|
+
return _context7.abrupt("return", _context7.sent);
|
|
2294
2343
|
|
|
2295
2344
|
case 7:
|
|
2296
2345
|
case "end":
|
|
2297
|
-
return
|
|
2346
|
+
return _context7.stop();
|
|
2298
2347
|
}
|
|
2299
2348
|
}
|
|
2300
|
-
},
|
|
2349
|
+
}, _callee7, this);
|
|
2301
2350
|
}));
|
|
2302
2351
|
|
|
2303
|
-
function sendReaction(
|
|
2352
|
+
function sendReaction(_x9, _x10, _x11) {
|
|
2304
2353
|
return _sendReaction.apply(this, arguments);
|
|
2305
2354
|
}
|
|
2306
2355
|
|
|
@@ -2347,39 +2396,39 @@ var Channel = /*#__PURE__*/function () {
|
|
|
2347
2396
|
}, {
|
|
2348
2397
|
key: "update",
|
|
2349
2398
|
value: function () {
|
|
2350
|
-
var _update2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
2399
|
+
var _update2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee8() {
|
|
2351
2400
|
var channelData,
|
|
2352
2401
|
updateMessage,
|
|
2353
2402
|
options,
|
|
2354
2403
|
reserved,
|
|
2355
|
-
|
|
2356
|
-
return _regeneratorRuntime.wrap(function
|
|
2404
|
+
_args8 = arguments;
|
|
2405
|
+
return _regeneratorRuntime.wrap(function _callee8$(_context8) {
|
|
2357
2406
|
while (1) {
|
|
2358
|
-
switch (
|
|
2407
|
+
switch (_context8.prev = _context8.next) {
|
|
2359
2408
|
case 0:
|
|
2360
|
-
channelData =
|
|
2361
|
-
updateMessage =
|
|
2362
|
-
options =
|
|
2409
|
+
channelData = _args8.length > 0 && _args8[0] !== undefined ? _args8[0] : {};
|
|
2410
|
+
updateMessage = _args8.length > 1 ? _args8[1] : undefined;
|
|
2411
|
+
options = _args8.length > 2 ? _args8[2] : undefined;
|
|
2363
2412
|
// Strip out reserved names that will result in API errors.
|
|
2364
2413
|
reserved = ['config', 'cid', 'created_by', 'id', 'member_count', 'type', 'created_at', 'updated_at', 'last_message_at', 'own_capabilities'];
|
|
2365
2414
|
reserved.forEach(function (key) {
|
|
2366
2415
|
delete channelData[key];
|
|
2367
2416
|
});
|
|
2368
|
-
|
|
2417
|
+
_context8.next = 7;
|
|
2369
2418
|
return this._update(_objectSpread$9({
|
|
2370
2419
|
message: updateMessage,
|
|
2371
2420
|
data: channelData
|
|
2372
2421
|
}, options));
|
|
2373
2422
|
|
|
2374
2423
|
case 7:
|
|
2375
|
-
return
|
|
2424
|
+
return _context8.abrupt("return", _context8.sent);
|
|
2376
2425
|
|
|
2377
2426
|
case 8:
|
|
2378
2427
|
case "end":
|
|
2379
|
-
return
|
|
2428
|
+
return _context8.stop();
|
|
2380
2429
|
}
|
|
2381
2430
|
}
|
|
2382
|
-
},
|
|
2431
|
+
}, _callee8, this);
|
|
2383
2432
|
}));
|
|
2384
2433
|
|
|
2385
2434
|
function update() {
|
|
@@ -2399,19 +2448,19 @@ var Channel = /*#__PURE__*/function () {
|
|
|
2399
2448
|
}, {
|
|
2400
2449
|
key: "updatePartial",
|
|
2401
2450
|
value: function () {
|
|
2402
|
-
var _updatePartial = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
2451
|
+
var _updatePartial = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee9(update) {
|
|
2403
2452
|
var _this$data2, _this$data3;
|
|
2404
2453
|
|
|
2405
2454
|
var data, areCapabilitiesChanged;
|
|
2406
|
-
return _regeneratorRuntime.wrap(function
|
|
2455
|
+
return _regeneratorRuntime.wrap(function _callee9$(_context9) {
|
|
2407
2456
|
while (1) {
|
|
2408
|
-
switch (
|
|
2457
|
+
switch (_context9.prev = _context9.next) {
|
|
2409
2458
|
case 0:
|
|
2410
|
-
|
|
2459
|
+
_context9.next = 2;
|
|
2411
2460
|
return this.getClient().patch(this._channelURL(), update);
|
|
2412
2461
|
|
|
2413
2462
|
case 2:
|
|
2414
|
-
data =
|
|
2463
|
+
data = _context9.sent;
|
|
2415
2464
|
areCapabilitiesChanged = _toConsumableArray(data.channel.own_capabilities || []).sort().join() !== _toConsumableArray(Array.isArray((_this$data2 = this.data) === null || _this$data2 === void 0 ? void 0 : _this$data2.own_capabilities) ? (_this$data3 = this.data) === null || _this$data3 === void 0 ? void 0 : _this$data3.own_capabilities : []).sort().join();
|
|
2416
2465
|
this.data = data.channel; // If the capabiltities are changed, we trigger the `capabilities.changed` event.
|
|
2417
2466
|
|
|
@@ -2423,17 +2472,17 @@ var Channel = /*#__PURE__*/function () {
|
|
|
2423
2472
|
});
|
|
2424
2473
|
}
|
|
2425
2474
|
|
|
2426
|
-
return
|
|
2475
|
+
return _context9.abrupt("return", data);
|
|
2427
2476
|
|
|
2428
2477
|
case 7:
|
|
2429
2478
|
case "end":
|
|
2430
|
-
return
|
|
2479
|
+
return _context9.stop();
|
|
2431
2480
|
}
|
|
2432
2481
|
}
|
|
2433
|
-
},
|
|
2482
|
+
}, _callee9, this);
|
|
2434
2483
|
}));
|
|
2435
2484
|
|
|
2436
|
-
function updatePartial(
|
|
2485
|
+
function updatePartial(_x12) {
|
|
2437
2486
|
return _updatePartial.apply(this, arguments);
|
|
2438
2487
|
}
|
|
2439
2488
|
|
|
@@ -2449,31 +2498,31 @@ var Channel = /*#__PURE__*/function () {
|
|
|
2449
2498
|
}, {
|
|
2450
2499
|
key: "enableSlowMode",
|
|
2451
2500
|
value: function () {
|
|
2452
|
-
var _enableSlowMode = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
2501
|
+
var _enableSlowMode = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee10(coolDownInterval) {
|
|
2453
2502
|
var data;
|
|
2454
|
-
return _regeneratorRuntime.wrap(function
|
|
2503
|
+
return _regeneratorRuntime.wrap(function _callee10$(_context10) {
|
|
2455
2504
|
while (1) {
|
|
2456
|
-
switch (
|
|
2505
|
+
switch (_context10.prev = _context10.next) {
|
|
2457
2506
|
case 0:
|
|
2458
|
-
|
|
2507
|
+
_context10.next = 2;
|
|
2459
2508
|
return this.getClient().post(this._channelURL(), {
|
|
2460
2509
|
cooldown: coolDownInterval
|
|
2461
2510
|
});
|
|
2462
2511
|
|
|
2463
2512
|
case 2:
|
|
2464
|
-
data =
|
|
2513
|
+
data = _context10.sent;
|
|
2465
2514
|
this.data = data.channel;
|
|
2466
|
-
return
|
|
2515
|
+
return _context10.abrupt("return", data);
|
|
2467
2516
|
|
|
2468
2517
|
case 5:
|
|
2469
2518
|
case "end":
|
|
2470
|
-
return
|
|
2519
|
+
return _context10.stop();
|
|
2471
2520
|
}
|
|
2472
2521
|
}
|
|
2473
|
-
},
|
|
2522
|
+
}, _callee10, this);
|
|
2474
2523
|
}));
|
|
2475
2524
|
|
|
2476
|
-
function enableSlowMode(
|
|
2525
|
+
function enableSlowMode(_x13) {
|
|
2477
2526
|
return _enableSlowMode.apply(this, arguments);
|
|
2478
2527
|
}
|
|
2479
2528
|
|
|
@@ -2488,28 +2537,28 @@ var Channel = /*#__PURE__*/function () {
|
|
|
2488
2537
|
}, {
|
|
2489
2538
|
key: "disableSlowMode",
|
|
2490
2539
|
value: function () {
|
|
2491
|
-
var _disableSlowMode = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
2540
|
+
var _disableSlowMode = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee11() {
|
|
2492
2541
|
var data;
|
|
2493
|
-
return _regeneratorRuntime.wrap(function
|
|
2542
|
+
return _regeneratorRuntime.wrap(function _callee11$(_context11) {
|
|
2494
2543
|
while (1) {
|
|
2495
|
-
switch (
|
|
2544
|
+
switch (_context11.prev = _context11.next) {
|
|
2496
2545
|
case 0:
|
|
2497
|
-
|
|
2546
|
+
_context11.next = 2;
|
|
2498
2547
|
return this.getClient().post(this._channelURL(), {
|
|
2499
2548
|
cooldown: 0
|
|
2500
2549
|
});
|
|
2501
2550
|
|
|
2502
2551
|
case 2:
|
|
2503
|
-
data =
|
|
2552
|
+
data = _context11.sent;
|
|
2504
2553
|
this.data = data.channel;
|
|
2505
|
-
return
|
|
2554
|
+
return _context11.abrupt("return", data);
|
|
2506
2555
|
|
|
2507
2556
|
case 5:
|
|
2508
2557
|
case "end":
|
|
2509
|
-
return
|
|
2558
|
+
return _context11.stop();
|
|
2510
2559
|
}
|
|
2511
2560
|
}
|
|
2512
|
-
},
|
|
2561
|
+
}, _callee11, this);
|
|
2513
2562
|
}));
|
|
2514
2563
|
|
|
2515
2564
|
function disableSlowMode() {
|
|
@@ -2529,26 +2578,26 @@ var Channel = /*#__PURE__*/function () {
|
|
|
2529
2578
|
}, {
|
|
2530
2579
|
key: "delete",
|
|
2531
2580
|
value: function () {
|
|
2532
|
-
var _delete2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
2581
|
+
var _delete2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee12() {
|
|
2533
2582
|
var options,
|
|
2534
|
-
|
|
2535
|
-
return _regeneratorRuntime.wrap(function
|
|
2583
|
+
_args12 = arguments;
|
|
2584
|
+
return _regeneratorRuntime.wrap(function _callee12$(_context12) {
|
|
2536
2585
|
while (1) {
|
|
2537
|
-
switch (
|
|
2586
|
+
switch (_context12.prev = _context12.next) {
|
|
2538
2587
|
case 0:
|
|
2539
|
-
options =
|
|
2540
|
-
|
|
2588
|
+
options = _args12.length > 0 && _args12[0] !== undefined ? _args12[0] : {};
|
|
2589
|
+
_context12.next = 3;
|
|
2541
2590
|
return this.getClient().delete(this._channelURL(), _objectSpread$9({}, options));
|
|
2542
2591
|
|
|
2543
2592
|
case 3:
|
|
2544
|
-
return
|
|
2593
|
+
return _context12.abrupt("return", _context12.sent);
|
|
2545
2594
|
|
|
2546
2595
|
case 4:
|
|
2547
2596
|
case "end":
|
|
2548
|
-
return
|
|
2597
|
+
return _context12.stop();
|
|
2549
2598
|
}
|
|
2550
2599
|
}
|
|
2551
|
-
},
|
|
2600
|
+
}, _callee12, this);
|
|
2552
2601
|
}));
|
|
2553
2602
|
|
|
2554
2603
|
function _delete() {
|
|
@@ -2566,26 +2615,26 @@ var Channel = /*#__PURE__*/function () {
|
|
|
2566
2615
|
}, {
|
|
2567
2616
|
key: "truncate",
|
|
2568
2617
|
value: function () {
|
|
2569
|
-
var _truncate = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
2618
|
+
var _truncate = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee13() {
|
|
2570
2619
|
var options,
|
|
2571
|
-
|
|
2572
|
-
return _regeneratorRuntime.wrap(function
|
|
2620
|
+
_args13 = arguments;
|
|
2621
|
+
return _regeneratorRuntime.wrap(function _callee13$(_context13) {
|
|
2573
2622
|
while (1) {
|
|
2574
|
-
switch (
|
|
2623
|
+
switch (_context13.prev = _context13.next) {
|
|
2575
2624
|
case 0:
|
|
2576
|
-
options =
|
|
2577
|
-
|
|
2625
|
+
options = _args13.length > 0 && _args13[0] !== undefined ? _args13[0] : {};
|
|
2626
|
+
_context13.next = 3;
|
|
2578
2627
|
return this.getClient().post(this._channelURL() + '/truncate', options);
|
|
2579
2628
|
|
|
2580
2629
|
case 3:
|
|
2581
|
-
return
|
|
2630
|
+
return _context13.abrupt("return", _context13.sent);
|
|
2582
2631
|
|
|
2583
2632
|
case 4:
|
|
2584
2633
|
case "end":
|
|
2585
|
-
return
|
|
2634
|
+
return _context13.stop();
|
|
2586
2635
|
}
|
|
2587
2636
|
}
|
|
2588
|
-
},
|
|
2637
|
+
}, _callee13, this);
|
|
2589
2638
|
}));
|
|
2590
2639
|
|
|
2591
2640
|
function truncate() {
|
|
@@ -2605,28 +2654,28 @@ var Channel = /*#__PURE__*/function () {
|
|
|
2605
2654
|
}, {
|
|
2606
2655
|
key: "acceptInvite",
|
|
2607
2656
|
value: function () {
|
|
2608
|
-
var _acceptInvite = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
2657
|
+
var _acceptInvite = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee14() {
|
|
2609
2658
|
var options,
|
|
2610
|
-
|
|
2611
|
-
return _regeneratorRuntime.wrap(function
|
|
2659
|
+
_args14 = arguments;
|
|
2660
|
+
return _regeneratorRuntime.wrap(function _callee14$(_context14) {
|
|
2612
2661
|
while (1) {
|
|
2613
|
-
switch (
|
|
2662
|
+
switch (_context14.prev = _context14.next) {
|
|
2614
2663
|
case 0:
|
|
2615
|
-
options =
|
|
2616
|
-
|
|
2664
|
+
options = _args14.length > 0 && _args14[0] !== undefined ? _args14[0] : {};
|
|
2665
|
+
_context14.next = 3;
|
|
2617
2666
|
return this._update(_objectSpread$9({
|
|
2618
2667
|
accept_invite: true
|
|
2619
2668
|
}, options));
|
|
2620
2669
|
|
|
2621
2670
|
case 3:
|
|
2622
|
-
return
|
|
2671
|
+
return _context14.abrupt("return", _context14.sent);
|
|
2623
2672
|
|
|
2624
2673
|
case 4:
|
|
2625
2674
|
case "end":
|
|
2626
|
-
return
|
|
2675
|
+
return _context14.stop();
|
|
2627
2676
|
}
|
|
2628
2677
|
}
|
|
2629
|
-
},
|
|
2678
|
+
}, _callee14, this);
|
|
2630
2679
|
}));
|
|
2631
2680
|
|
|
2632
2681
|
function acceptInvite() {
|
|
@@ -2646,28 +2695,28 @@ var Channel = /*#__PURE__*/function () {
|
|
|
2646
2695
|
}, {
|
|
2647
2696
|
key: "rejectInvite",
|
|
2648
2697
|
value: function () {
|
|
2649
|
-
var _rejectInvite = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
2698
|
+
var _rejectInvite = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee15() {
|
|
2650
2699
|
var options,
|
|
2651
|
-
|
|
2652
|
-
return _regeneratorRuntime.wrap(function
|
|
2700
|
+
_args15 = arguments;
|
|
2701
|
+
return _regeneratorRuntime.wrap(function _callee15$(_context15) {
|
|
2653
2702
|
while (1) {
|
|
2654
|
-
switch (
|
|
2703
|
+
switch (_context15.prev = _context15.next) {
|
|
2655
2704
|
case 0:
|
|
2656
|
-
options =
|
|
2657
|
-
|
|
2705
|
+
options = _args15.length > 0 && _args15[0] !== undefined ? _args15[0] : {};
|
|
2706
|
+
_context15.next = 3;
|
|
2658
2707
|
return this._update(_objectSpread$9({
|
|
2659
2708
|
reject_invite: true
|
|
2660
2709
|
}, options));
|
|
2661
2710
|
|
|
2662
2711
|
case 3:
|
|
2663
|
-
return
|
|
2712
|
+
return _context15.abrupt("return", _context15.sent);
|
|
2664
2713
|
|
|
2665
2714
|
case 4:
|
|
2666
2715
|
case "end":
|
|
2667
|
-
return
|
|
2716
|
+
return _context15.stop();
|
|
2668
2717
|
}
|
|
2669
2718
|
}
|
|
2670
|
-
},
|
|
2719
|
+
}, _callee15, this);
|
|
2671
2720
|
}));
|
|
2672
2721
|
|
|
2673
2722
|
function rejectInvite() {
|
|
@@ -2688,32 +2737,32 @@ var Channel = /*#__PURE__*/function () {
|
|
|
2688
2737
|
}, {
|
|
2689
2738
|
key: "addMembers",
|
|
2690
2739
|
value: function () {
|
|
2691
|
-
var _addMembers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
2740
|
+
var _addMembers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee16(members, message) {
|
|
2692
2741
|
var options,
|
|
2693
|
-
|
|
2694
|
-
return _regeneratorRuntime.wrap(function
|
|
2742
|
+
_args16 = arguments;
|
|
2743
|
+
return _regeneratorRuntime.wrap(function _callee16$(_context16) {
|
|
2695
2744
|
while (1) {
|
|
2696
|
-
switch (
|
|
2745
|
+
switch (_context16.prev = _context16.next) {
|
|
2697
2746
|
case 0:
|
|
2698
|
-
options =
|
|
2699
|
-
|
|
2747
|
+
options = _args16.length > 2 && _args16[2] !== undefined ? _args16[2] : {};
|
|
2748
|
+
_context16.next = 3;
|
|
2700
2749
|
return this._update(_objectSpread$9({
|
|
2701
2750
|
add_members: members,
|
|
2702
2751
|
message: message
|
|
2703
2752
|
}, options));
|
|
2704
2753
|
|
|
2705
2754
|
case 3:
|
|
2706
|
-
return
|
|
2755
|
+
return _context16.abrupt("return", _context16.sent);
|
|
2707
2756
|
|
|
2708
2757
|
case 4:
|
|
2709
2758
|
case "end":
|
|
2710
|
-
return
|
|
2759
|
+
return _context16.stop();
|
|
2711
2760
|
}
|
|
2712
2761
|
}
|
|
2713
|
-
},
|
|
2762
|
+
}, _callee16, this);
|
|
2714
2763
|
}));
|
|
2715
2764
|
|
|
2716
|
-
function addMembers(
|
|
2765
|
+
function addMembers(_x14, _x15) {
|
|
2717
2766
|
return _addMembers.apply(this, arguments);
|
|
2718
2767
|
}
|
|
2719
2768
|
|
|
@@ -2731,32 +2780,32 @@ var Channel = /*#__PURE__*/function () {
|
|
|
2731
2780
|
}, {
|
|
2732
2781
|
key: "addModerators",
|
|
2733
2782
|
value: function () {
|
|
2734
|
-
var _addModerators = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
2783
|
+
var _addModerators = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee17(members, message) {
|
|
2735
2784
|
var options,
|
|
2736
|
-
|
|
2737
|
-
return _regeneratorRuntime.wrap(function
|
|
2785
|
+
_args17 = arguments;
|
|
2786
|
+
return _regeneratorRuntime.wrap(function _callee17$(_context17) {
|
|
2738
2787
|
while (1) {
|
|
2739
|
-
switch (
|
|
2788
|
+
switch (_context17.prev = _context17.next) {
|
|
2740
2789
|
case 0:
|
|
2741
|
-
options =
|
|
2742
|
-
|
|
2790
|
+
options = _args17.length > 2 && _args17[2] !== undefined ? _args17[2] : {};
|
|
2791
|
+
_context17.next = 3;
|
|
2743
2792
|
return this._update(_objectSpread$9({
|
|
2744
2793
|
add_moderators: members,
|
|
2745
2794
|
message: message
|
|
2746
2795
|
}, options));
|
|
2747
2796
|
|
|
2748
2797
|
case 3:
|
|
2749
|
-
return
|
|
2798
|
+
return _context17.abrupt("return", _context17.sent);
|
|
2750
2799
|
|
|
2751
2800
|
case 4:
|
|
2752
2801
|
case "end":
|
|
2753
|
-
return
|
|
2802
|
+
return _context17.stop();
|
|
2754
2803
|
}
|
|
2755
2804
|
}
|
|
2756
|
-
},
|
|
2805
|
+
}, _callee17, this);
|
|
2757
2806
|
}));
|
|
2758
2807
|
|
|
2759
|
-
function addModerators(
|
|
2808
|
+
function addModerators(_x16, _x17) {
|
|
2760
2809
|
return _addModerators.apply(this, arguments);
|
|
2761
2810
|
}
|
|
2762
2811
|
|
|
@@ -2774,32 +2823,32 @@ var Channel = /*#__PURE__*/function () {
|
|
|
2774
2823
|
}, {
|
|
2775
2824
|
key: "assignRoles",
|
|
2776
2825
|
value: function () {
|
|
2777
|
-
var _assignRoles = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
2826
|
+
var _assignRoles = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee18(roles, message) {
|
|
2778
2827
|
var options,
|
|
2779
|
-
|
|
2780
|
-
return _regeneratorRuntime.wrap(function
|
|
2828
|
+
_args18 = arguments;
|
|
2829
|
+
return _regeneratorRuntime.wrap(function _callee18$(_context18) {
|
|
2781
2830
|
while (1) {
|
|
2782
|
-
switch (
|
|
2831
|
+
switch (_context18.prev = _context18.next) {
|
|
2783
2832
|
case 0:
|
|
2784
|
-
options =
|
|
2785
|
-
|
|
2833
|
+
options = _args18.length > 2 && _args18[2] !== undefined ? _args18[2] : {};
|
|
2834
|
+
_context18.next = 3;
|
|
2786
2835
|
return this._update(_objectSpread$9({
|
|
2787
2836
|
assign_roles: roles,
|
|
2788
2837
|
message: message
|
|
2789
2838
|
}, options));
|
|
2790
2839
|
|
|
2791
2840
|
case 3:
|
|
2792
|
-
return
|
|
2841
|
+
return _context18.abrupt("return", _context18.sent);
|
|
2793
2842
|
|
|
2794
2843
|
case 4:
|
|
2795
2844
|
case "end":
|
|
2796
|
-
return
|
|
2845
|
+
return _context18.stop();
|
|
2797
2846
|
}
|
|
2798
2847
|
}
|
|
2799
|
-
},
|
|
2848
|
+
}, _callee18, this);
|
|
2800
2849
|
}));
|
|
2801
2850
|
|
|
2802
|
-
function assignRoles(
|
|
2851
|
+
function assignRoles(_x18, _x19) {
|
|
2803
2852
|
return _assignRoles.apply(this, arguments);
|
|
2804
2853
|
}
|
|
2805
2854
|
|
|
@@ -2817,32 +2866,32 @@ var Channel = /*#__PURE__*/function () {
|
|
|
2817
2866
|
}, {
|
|
2818
2867
|
key: "inviteMembers",
|
|
2819
2868
|
value: function () {
|
|
2820
|
-
var _inviteMembers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
2869
|
+
var _inviteMembers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee19(members, message) {
|
|
2821
2870
|
var options,
|
|
2822
|
-
|
|
2823
|
-
return _regeneratorRuntime.wrap(function
|
|
2871
|
+
_args19 = arguments;
|
|
2872
|
+
return _regeneratorRuntime.wrap(function _callee19$(_context19) {
|
|
2824
2873
|
while (1) {
|
|
2825
|
-
switch (
|
|
2874
|
+
switch (_context19.prev = _context19.next) {
|
|
2826
2875
|
case 0:
|
|
2827
|
-
options =
|
|
2828
|
-
|
|
2876
|
+
options = _args19.length > 2 && _args19[2] !== undefined ? _args19[2] : {};
|
|
2877
|
+
_context19.next = 3;
|
|
2829
2878
|
return this._update(_objectSpread$9({
|
|
2830
2879
|
invites: members,
|
|
2831
2880
|
message: message
|
|
2832
2881
|
}, options));
|
|
2833
2882
|
|
|
2834
2883
|
case 3:
|
|
2835
|
-
return
|
|
2884
|
+
return _context19.abrupt("return", _context19.sent);
|
|
2836
2885
|
|
|
2837
2886
|
case 4:
|
|
2838
2887
|
case "end":
|
|
2839
|
-
return
|
|
2888
|
+
return _context19.stop();
|
|
2840
2889
|
}
|
|
2841
2890
|
}
|
|
2842
|
-
},
|
|
2891
|
+
}, _callee19, this);
|
|
2843
2892
|
}));
|
|
2844
2893
|
|
|
2845
|
-
function inviteMembers(
|
|
2894
|
+
function inviteMembers(_x20, _x21) {
|
|
2846
2895
|
return _inviteMembers.apply(this, arguments);
|
|
2847
2896
|
}
|
|
2848
2897
|
|
|
@@ -2860,32 +2909,32 @@ var Channel = /*#__PURE__*/function () {
|
|
|
2860
2909
|
}, {
|
|
2861
2910
|
key: "removeMembers",
|
|
2862
2911
|
value: function () {
|
|
2863
|
-
var _removeMembers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
2912
|
+
var _removeMembers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee20(members, message) {
|
|
2864
2913
|
var options,
|
|
2865
|
-
|
|
2866
|
-
return _regeneratorRuntime.wrap(function
|
|
2914
|
+
_args20 = arguments;
|
|
2915
|
+
return _regeneratorRuntime.wrap(function _callee20$(_context20) {
|
|
2867
2916
|
while (1) {
|
|
2868
|
-
switch (
|
|
2917
|
+
switch (_context20.prev = _context20.next) {
|
|
2869
2918
|
case 0:
|
|
2870
|
-
options =
|
|
2871
|
-
|
|
2919
|
+
options = _args20.length > 2 && _args20[2] !== undefined ? _args20[2] : {};
|
|
2920
|
+
_context20.next = 3;
|
|
2872
2921
|
return this._update(_objectSpread$9({
|
|
2873
2922
|
remove_members: members,
|
|
2874
2923
|
message: message
|
|
2875
2924
|
}, options));
|
|
2876
2925
|
|
|
2877
2926
|
case 3:
|
|
2878
|
-
return
|
|
2927
|
+
return _context20.abrupt("return", _context20.sent);
|
|
2879
2928
|
|
|
2880
2929
|
case 4:
|
|
2881
2930
|
case "end":
|
|
2882
|
-
return
|
|
2931
|
+
return _context20.stop();
|
|
2883
2932
|
}
|
|
2884
2933
|
}
|
|
2885
|
-
},
|
|
2934
|
+
}, _callee20, this);
|
|
2886
2935
|
}));
|
|
2887
2936
|
|
|
2888
|
-
function removeMembers(
|
|
2937
|
+
function removeMembers(_x22, _x23) {
|
|
2889
2938
|
return _removeMembers.apply(this, arguments);
|
|
2890
2939
|
}
|
|
2891
2940
|
|
|
@@ -2903,32 +2952,32 @@ var Channel = /*#__PURE__*/function () {
|
|
|
2903
2952
|
}, {
|
|
2904
2953
|
key: "demoteModerators",
|
|
2905
2954
|
value: function () {
|
|
2906
|
-
var _demoteModerators = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
2955
|
+
var _demoteModerators = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee21(members, message) {
|
|
2907
2956
|
var options,
|
|
2908
|
-
|
|
2909
|
-
return _regeneratorRuntime.wrap(function
|
|
2957
|
+
_args21 = arguments;
|
|
2958
|
+
return _regeneratorRuntime.wrap(function _callee21$(_context21) {
|
|
2910
2959
|
while (1) {
|
|
2911
|
-
switch (
|
|
2960
|
+
switch (_context21.prev = _context21.next) {
|
|
2912
2961
|
case 0:
|
|
2913
|
-
options =
|
|
2914
|
-
|
|
2962
|
+
options = _args21.length > 2 && _args21[2] !== undefined ? _args21[2] : {};
|
|
2963
|
+
_context21.next = 3;
|
|
2915
2964
|
return this._update(_objectSpread$9({
|
|
2916
2965
|
demote_moderators: members,
|
|
2917
2966
|
message: message
|
|
2918
2967
|
}, options));
|
|
2919
2968
|
|
|
2920
2969
|
case 3:
|
|
2921
|
-
return
|
|
2970
|
+
return _context21.abrupt("return", _context21.sent);
|
|
2922
2971
|
|
|
2923
2972
|
case 4:
|
|
2924
2973
|
case "end":
|
|
2925
|
-
return
|
|
2974
|
+
return _context21.stop();
|
|
2926
2975
|
}
|
|
2927
2976
|
}
|
|
2928
|
-
},
|
|
2977
|
+
}, _callee21, this);
|
|
2929
2978
|
}));
|
|
2930
2979
|
|
|
2931
|
-
function demoteModerators(
|
|
2980
|
+
function demoteModerators(_x24, _x25) {
|
|
2932
2981
|
return _demoteModerators.apply(this, arguments);
|
|
2933
2982
|
}
|
|
2934
2983
|
|
|
@@ -2944,29 +2993,29 @@ var Channel = /*#__PURE__*/function () {
|
|
|
2944
2993
|
}, {
|
|
2945
2994
|
key: "_update",
|
|
2946
2995
|
value: function () {
|
|
2947
|
-
var _update3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
2996
|
+
var _update3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee22(payload) {
|
|
2948
2997
|
var data;
|
|
2949
|
-
return _regeneratorRuntime.wrap(function
|
|
2998
|
+
return _regeneratorRuntime.wrap(function _callee22$(_context22) {
|
|
2950
2999
|
while (1) {
|
|
2951
|
-
switch (
|
|
3000
|
+
switch (_context22.prev = _context22.next) {
|
|
2952
3001
|
case 0:
|
|
2953
|
-
|
|
3002
|
+
_context22.next = 2;
|
|
2954
3003
|
return this.getClient().post(this._channelURL(), payload);
|
|
2955
3004
|
|
|
2956
3005
|
case 2:
|
|
2957
|
-
data =
|
|
3006
|
+
data = _context22.sent;
|
|
2958
3007
|
this.data = data.channel;
|
|
2959
|
-
return
|
|
3008
|
+
return _context22.abrupt("return", data);
|
|
2960
3009
|
|
|
2961
3010
|
case 5:
|
|
2962
3011
|
case "end":
|
|
2963
|
-
return
|
|
3012
|
+
return _context22.stop();
|
|
2964
3013
|
}
|
|
2965
3014
|
}
|
|
2966
|
-
},
|
|
3015
|
+
}, _callee22, this);
|
|
2967
3016
|
}));
|
|
2968
3017
|
|
|
2969
|
-
function _update(
|
|
3018
|
+
function _update(_x26) {
|
|
2970
3019
|
return _update3.apply(this, arguments);
|
|
2971
3020
|
}
|
|
2972
3021
|
|
|
@@ -2988,28 +3037,28 @@ var Channel = /*#__PURE__*/function () {
|
|
|
2988
3037
|
}, {
|
|
2989
3038
|
key: "mute",
|
|
2990
3039
|
value: function () {
|
|
2991
|
-
var _mute = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
3040
|
+
var _mute = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee23() {
|
|
2992
3041
|
var opts,
|
|
2993
|
-
|
|
2994
|
-
return _regeneratorRuntime.wrap(function
|
|
3042
|
+
_args23 = arguments;
|
|
3043
|
+
return _regeneratorRuntime.wrap(function _callee23$(_context23) {
|
|
2995
3044
|
while (1) {
|
|
2996
|
-
switch (
|
|
3045
|
+
switch (_context23.prev = _context23.next) {
|
|
2997
3046
|
case 0:
|
|
2998
|
-
opts =
|
|
2999
|
-
|
|
3047
|
+
opts = _args23.length > 0 && _args23[0] !== undefined ? _args23[0] : {};
|
|
3048
|
+
_context23.next = 3;
|
|
3000
3049
|
return this.getClient().post(this.getClient().baseURL + '/moderation/mute/channel', _objectSpread$9({
|
|
3001
3050
|
channel_cid: this.cid
|
|
3002
3051
|
}, opts));
|
|
3003
3052
|
|
|
3004
3053
|
case 3:
|
|
3005
|
-
return
|
|
3054
|
+
return _context23.abrupt("return", _context23.sent);
|
|
3006
3055
|
|
|
3007
3056
|
case 4:
|
|
3008
3057
|
case "end":
|
|
3009
|
-
return
|
|
3058
|
+
return _context23.stop();
|
|
3010
3059
|
}
|
|
3011
3060
|
}
|
|
3012
|
-
},
|
|
3061
|
+
}, _callee23, this);
|
|
3013
3062
|
}));
|
|
3014
3063
|
|
|
3015
3064
|
function mute() {
|
|
@@ -3030,28 +3079,28 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3030
3079
|
}, {
|
|
3031
3080
|
key: "unmute",
|
|
3032
3081
|
value: function () {
|
|
3033
|
-
var _unmute = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
3082
|
+
var _unmute = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee24() {
|
|
3034
3083
|
var opts,
|
|
3035
|
-
|
|
3036
|
-
return _regeneratorRuntime.wrap(function
|
|
3084
|
+
_args24 = arguments;
|
|
3085
|
+
return _regeneratorRuntime.wrap(function _callee24$(_context24) {
|
|
3037
3086
|
while (1) {
|
|
3038
|
-
switch (
|
|
3087
|
+
switch (_context24.prev = _context24.next) {
|
|
3039
3088
|
case 0:
|
|
3040
|
-
opts =
|
|
3041
|
-
|
|
3089
|
+
opts = _args24.length > 0 && _args24[0] !== undefined ? _args24[0] : {};
|
|
3090
|
+
_context24.next = 3;
|
|
3042
3091
|
return this.getClient().post(this.getClient().baseURL + '/moderation/unmute/channel', _objectSpread$9({
|
|
3043
3092
|
channel_cid: this.cid
|
|
3044
3093
|
}, opts));
|
|
3045
3094
|
|
|
3046
3095
|
case 3:
|
|
3047
|
-
return
|
|
3096
|
+
return _context24.abrupt("return", _context24.sent);
|
|
3048
3097
|
|
|
3049
3098
|
case 4:
|
|
3050
3099
|
case "end":
|
|
3051
|
-
return
|
|
3100
|
+
return _context24.stop();
|
|
3052
3101
|
}
|
|
3053
3102
|
}
|
|
3054
|
-
},
|
|
3103
|
+
}, _callee24, this);
|
|
3055
3104
|
}));
|
|
3056
3105
|
|
|
3057
3106
|
function unmute() {
|
|
@@ -3098,18 +3147,18 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3098
3147
|
}, {
|
|
3099
3148
|
key: "keystroke",
|
|
3100
3149
|
value: function () {
|
|
3101
|
-
var _keystroke = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
3150
|
+
var _keystroke = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee25(parent_id, options) {
|
|
3102
3151
|
var now, diff;
|
|
3103
|
-
return _regeneratorRuntime.wrap(function
|
|
3152
|
+
return _regeneratorRuntime.wrap(function _callee25$(_context25) {
|
|
3104
3153
|
while (1) {
|
|
3105
|
-
switch (
|
|
3154
|
+
switch (_context25.prev = _context25.next) {
|
|
3106
3155
|
case 0:
|
|
3107
3156
|
if (this._isTypingIndicatorsEnabled()) {
|
|
3108
|
-
|
|
3157
|
+
_context25.next = 2;
|
|
3109
3158
|
break;
|
|
3110
3159
|
}
|
|
3111
3160
|
|
|
3112
|
-
return
|
|
3161
|
+
return _context25.abrupt("return");
|
|
3113
3162
|
|
|
3114
3163
|
case 2:
|
|
3115
3164
|
now = new Date();
|
|
@@ -3118,12 +3167,12 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3118
3167
|
this.isTyping = true; // send a typing.start every 2 seconds
|
|
3119
3168
|
|
|
3120
3169
|
if (!(diff === null || diff > 2000)) {
|
|
3121
|
-
|
|
3170
|
+
_context25.next = 10;
|
|
3122
3171
|
break;
|
|
3123
3172
|
}
|
|
3124
3173
|
|
|
3125
3174
|
this.lastTypingEvent = new Date();
|
|
3126
|
-
|
|
3175
|
+
_context25.next = 10;
|
|
3127
3176
|
return this.sendEvent(_objectSpread$9({
|
|
3128
3177
|
type: 'typing.start',
|
|
3129
3178
|
parent_id: parent_id
|
|
@@ -3131,13 +3180,13 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3131
3180
|
|
|
3132
3181
|
case 10:
|
|
3133
3182
|
case "end":
|
|
3134
|
-
return
|
|
3183
|
+
return _context25.stop();
|
|
3135
3184
|
}
|
|
3136
3185
|
}
|
|
3137
|
-
},
|
|
3186
|
+
}, _callee25, this);
|
|
3138
3187
|
}));
|
|
3139
3188
|
|
|
3140
|
-
function keystroke(
|
|
3189
|
+
function keystroke(_x27, _x28) {
|
|
3141
3190
|
return _keystroke.apply(this, arguments);
|
|
3142
3191
|
}
|
|
3143
3192
|
|
|
@@ -3152,22 +3201,22 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3152
3201
|
}, {
|
|
3153
3202
|
key: "stopTyping",
|
|
3154
3203
|
value: function () {
|
|
3155
|
-
var _stopTyping = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
3156
|
-
return _regeneratorRuntime.wrap(function
|
|
3204
|
+
var _stopTyping = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee26(parent_id, options) {
|
|
3205
|
+
return _regeneratorRuntime.wrap(function _callee26$(_context26) {
|
|
3157
3206
|
while (1) {
|
|
3158
|
-
switch (
|
|
3207
|
+
switch (_context26.prev = _context26.next) {
|
|
3159
3208
|
case 0:
|
|
3160
3209
|
if (this._isTypingIndicatorsEnabled()) {
|
|
3161
|
-
|
|
3210
|
+
_context26.next = 2;
|
|
3162
3211
|
break;
|
|
3163
3212
|
}
|
|
3164
3213
|
|
|
3165
|
-
return
|
|
3214
|
+
return _context26.abrupt("return");
|
|
3166
3215
|
|
|
3167
3216
|
case 2:
|
|
3168
3217
|
this.lastTypingEvent = null;
|
|
3169
3218
|
this.isTyping = false;
|
|
3170
|
-
|
|
3219
|
+
_context26.next = 6;
|
|
3171
3220
|
return this.sendEvent(_objectSpread$9({
|
|
3172
3221
|
type: 'typing.stop',
|
|
3173
3222
|
parent_id: parent_id
|
|
@@ -3175,13 +3224,13 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3175
3224
|
|
|
3176
3225
|
case 6:
|
|
3177
3226
|
case "end":
|
|
3178
|
-
return
|
|
3227
|
+
return _context26.stop();
|
|
3179
3228
|
}
|
|
3180
3229
|
}
|
|
3181
|
-
},
|
|
3230
|
+
}, _callee26, this);
|
|
3182
3231
|
}));
|
|
3183
3232
|
|
|
3184
|
-
function stopTyping(
|
|
3233
|
+
function stopTyping(_x29, _x30) {
|
|
3185
3234
|
return _stopTyping.apply(this, arguments);
|
|
3186
3235
|
}
|
|
3187
3236
|
|
|
@@ -3233,39 +3282,39 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3233
3282
|
}, {
|
|
3234
3283
|
key: "markRead",
|
|
3235
3284
|
value: function () {
|
|
3236
|
-
var _markRead = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
3285
|
+
var _markRead = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee27() {
|
|
3237
3286
|
var _this$getConfig2;
|
|
3238
3287
|
|
|
3239
3288
|
var data,
|
|
3240
|
-
|
|
3241
|
-
return _regeneratorRuntime.wrap(function
|
|
3289
|
+
_args27 = arguments;
|
|
3290
|
+
return _regeneratorRuntime.wrap(function _callee27$(_context27) {
|
|
3242
3291
|
while (1) {
|
|
3243
|
-
switch (
|
|
3292
|
+
switch (_context27.prev = _context27.next) {
|
|
3244
3293
|
case 0:
|
|
3245
|
-
data =
|
|
3294
|
+
data = _args27.length > 0 && _args27[0] !== undefined ? _args27[0] : {};
|
|
3246
3295
|
|
|
3247
3296
|
this._checkInitialized();
|
|
3248
3297
|
|
|
3249
3298
|
if (!(!((_this$getConfig2 = this.getConfig()) !== null && _this$getConfig2 !== void 0 && _this$getConfig2.read_events) && !this.getClient()._isUsingServerAuth())) {
|
|
3250
|
-
|
|
3299
|
+
_context27.next = 4;
|
|
3251
3300
|
break;
|
|
3252
3301
|
}
|
|
3253
3302
|
|
|
3254
|
-
return
|
|
3303
|
+
return _context27.abrupt("return", Promise.resolve(null));
|
|
3255
3304
|
|
|
3256
3305
|
case 4:
|
|
3257
|
-
|
|
3306
|
+
_context27.next = 6;
|
|
3258
3307
|
return this.getClient().post(this._channelURL() + '/read', _objectSpread$9({}, data));
|
|
3259
3308
|
|
|
3260
3309
|
case 6:
|
|
3261
|
-
return
|
|
3310
|
+
return _context27.abrupt("return", _context27.sent);
|
|
3262
3311
|
|
|
3263
3312
|
case 7:
|
|
3264
3313
|
case "end":
|
|
3265
|
-
return
|
|
3314
|
+
return _context27.stop();
|
|
3266
3315
|
}
|
|
3267
3316
|
}
|
|
3268
|
-
},
|
|
3317
|
+
}, _callee27, this);
|
|
3269
3318
|
}));
|
|
3270
3319
|
|
|
3271
3320
|
function markRead() {
|
|
@@ -3284,38 +3333,38 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3284
3333
|
}, {
|
|
3285
3334
|
key: "markUnread",
|
|
3286
3335
|
value: function () {
|
|
3287
|
-
var _markUnread = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
3336
|
+
var _markUnread = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee28(data) {
|
|
3288
3337
|
var _this$getConfig3;
|
|
3289
3338
|
|
|
3290
|
-
return _regeneratorRuntime.wrap(function
|
|
3339
|
+
return _regeneratorRuntime.wrap(function _callee28$(_context28) {
|
|
3291
3340
|
while (1) {
|
|
3292
|
-
switch (
|
|
3341
|
+
switch (_context28.prev = _context28.next) {
|
|
3293
3342
|
case 0:
|
|
3294
3343
|
this._checkInitialized();
|
|
3295
3344
|
|
|
3296
3345
|
if (!(!((_this$getConfig3 = this.getConfig()) !== null && _this$getConfig3 !== void 0 && _this$getConfig3.read_events) && !this.getClient()._isUsingServerAuth())) {
|
|
3297
|
-
|
|
3346
|
+
_context28.next = 3;
|
|
3298
3347
|
break;
|
|
3299
3348
|
}
|
|
3300
3349
|
|
|
3301
|
-
return
|
|
3350
|
+
return _context28.abrupt("return", Promise.resolve(null));
|
|
3302
3351
|
|
|
3303
3352
|
case 3:
|
|
3304
|
-
|
|
3353
|
+
_context28.next = 5;
|
|
3305
3354
|
return this.getClient().post(this._channelURL() + '/unread', _objectSpread$9({}, data));
|
|
3306
3355
|
|
|
3307
3356
|
case 5:
|
|
3308
|
-
return
|
|
3357
|
+
return _context28.abrupt("return", _context28.sent);
|
|
3309
3358
|
|
|
3310
3359
|
case 6:
|
|
3311
3360
|
case "end":
|
|
3312
|
-
return
|
|
3361
|
+
return _context28.stop();
|
|
3313
3362
|
}
|
|
3314
3363
|
}
|
|
3315
|
-
},
|
|
3364
|
+
}, _callee28, this);
|
|
3316
3365
|
}));
|
|
3317
3366
|
|
|
3318
|
-
function markUnread(
|
|
3367
|
+
function markUnread(_x31) {
|
|
3319
3368
|
return _markUnread.apply(this, arguments);
|
|
3320
3369
|
}
|
|
3321
3370
|
|
|
@@ -3350,11 +3399,11 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3350
3399
|
}, {
|
|
3351
3400
|
key: "watch",
|
|
3352
3401
|
value: function () {
|
|
3353
|
-
var _watch = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
3402
|
+
var _watch = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee29(options) {
|
|
3354
3403
|
var defaultOptions, combined, state;
|
|
3355
|
-
return _regeneratorRuntime.wrap(function
|
|
3404
|
+
return _regeneratorRuntime.wrap(function _callee29$(_context29) {
|
|
3356
3405
|
while (1) {
|
|
3357
|
-
switch (
|
|
3406
|
+
switch (_context29.prev = _context29.next) {
|
|
3358
3407
|
case 0:
|
|
3359
3408
|
defaultOptions = {
|
|
3360
3409
|
state: true,
|
|
@@ -3362,7 +3411,7 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3362
3411
|
presence: false
|
|
3363
3412
|
}; // Make sure we wait for the connect promise if there is a pending one
|
|
3364
3413
|
|
|
3365
|
-
|
|
3414
|
+
_context29.next = 3;
|
|
3366
3415
|
return this.getClient().wsPromise;
|
|
3367
3416
|
|
|
3368
3417
|
case 3:
|
|
@@ -3371,11 +3420,11 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3371
3420
|
}
|
|
3372
3421
|
|
|
3373
3422
|
combined = _objectSpread$9(_objectSpread$9({}, defaultOptions), options);
|
|
3374
|
-
|
|
3423
|
+
_context29.next = 7;
|
|
3375
3424
|
return this.query(combined, 'latest');
|
|
3376
3425
|
|
|
3377
3426
|
case 7:
|
|
3378
|
-
state =
|
|
3427
|
+
state = _context29.sent;
|
|
3379
3428
|
this.initialized = true;
|
|
3380
3429
|
this.data = state.channel;
|
|
3381
3430
|
|
|
@@ -3384,17 +3433,17 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3384
3433
|
channel: this
|
|
3385
3434
|
});
|
|
3386
3435
|
|
|
3387
|
-
return
|
|
3436
|
+
return _context29.abrupt("return", state);
|
|
3388
3437
|
|
|
3389
3438
|
case 12:
|
|
3390
3439
|
case "end":
|
|
3391
|
-
return
|
|
3440
|
+
return _context29.stop();
|
|
3392
3441
|
}
|
|
3393
3442
|
}
|
|
3394
|
-
},
|
|
3443
|
+
}, _callee29, this);
|
|
3395
3444
|
}));
|
|
3396
3445
|
|
|
3397
|
-
function watch(
|
|
3446
|
+
function watch(_x32) {
|
|
3398
3447
|
return _watch.apply(this, arguments);
|
|
3399
3448
|
}
|
|
3400
3449
|
|
|
@@ -3409,31 +3458,31 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3409
3458
|
}, {
|
|
3410
3459
|
key: "stopWatching",
|
|
3411
3460
|
value: function () {
|
|
3412
|
-
var _stopWatching = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
3461
|
+
var _stopWatching = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee30() {
|
|
3413
3462
|
var response;
|
|
3414
|
-
return _regeneratorRuntime.wrap(function
|
|
3463
|
+
return _regeneratorRuntime.wrap(function _callee30$(_context30) {
|
|
3415
3464
|
while (1) {
|
|
3416
|
-
switch (
|
|
3465
|
+
switch (_context30.prev = _context30.next) {
|
|
3417
3466
|
case 0:
|
|
3418
|
-
|
|
3467
|
+
_context30.next = 2;
|
|
3419
3468
|
return this.getClient().post(this._channelURL() + '/stop-watching', {});
|
|
3420
3469
|
|
|
3421
3470
|
case 2:
|
|
3422
|
-
response =
|
|
3471
|
+
response = _context30.sent;
|
|
3423
3472
|
|
|
3424
3473
|
this._client.logger('info', "channel:watch() - stopped watching channel ".concat(this.cid), {
|
|
3425
3474
|
tags: ['channel'],
|
|
3426
3475
|
channel: this
|
|
3427
3476
|
});
|
|
3428
3477
|
|
|
3429
|
-
return
|
|
3478
|
+
return _context30.abrupt("return", response);
|
|
3430
3479
|
|
|
3431
3480
|
case 5:
|
|
3432
3481
|
case "end":
|
|
3433
|
-
return
|
|
3482
|
+
return _context30.stop();
|
|
3434
3483
|
}
|
|
3435
3484
|
}
|
|
3436
|
-
},
|
|
3485
|
+
}, _callee30, this);
|
|
3437
3486
|
}));
|
|
3438
3487
|
|
|
3439
3488
|
function stopWatching() {
|
|
@@ -3456,37 +3505,37 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3456
3505
|
}, {
|
|
3457
3506
|
key: "getReplies",
|
|
3458
3507
|
value: function () {
|
|
3459
|
-
var _getReplies = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
3508
|
+
var _getReplies = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee31(parent_id, options, sort) {
|
|
3460
3509
|
var normalizedSort, data;
|
|
3461
|
-
return _regeneratorRuntime.wrap(function
|
|
3510
|
+
return _regeneratorRuntime.wrap(function _callee31$(_context31) {
|
|
3462
3511
|
while (1) {
|
|
3463
|
-
switch (
|
|
3512
|
+
switch (_context31.prev = _context31.next) {
|
|
3464
3513
|
case 0:
|
|
3465
3514
|
normalizedSort = sort ? normalizeQuerySort(sort) : undefined;
|
|
3466
|
-
|
|
3515
|
+
_context31.next = 3;
|
|
3467
3516
|
return this.getClient().get(this.getClient().baseURL + "/messages/".concat(encodeURIComponent(parent_id), "/replies"), _objectSpread$9({
|
|
3468
3517
|
sort: normalizedSort
|
|
3469
3518
|
}, options));
|
|
3470
3519
|
|
|
3471
3520
|
case 3:
|
|
3472
|
-
data =
|
|
3521
|
+
data = _context31.sent;
|
|
3473
3522
|
|
|
3474
3523
|
// add any messages to our thread state
|
|
3475
3524
|
if (data.messages) {
|
|
3476
3525
|
this.state.addMessagesSorted(data.messages);
|
|
3477
3526
|
}
|
|
3478
3527
|
|
|
3479
|
-
return
|
|
3528
|
+
return _context31.abrupt("return", data);
|
|
3480
3529
|
|
|
3481
3530
|
case 6:
|
|
3482
3531
|
case "end":
|
|
3483
|
-
return
|
|
3532
|
+
return _context31.stop();
|
|
3484
3533
|
}
|
|
3485
3534
|
}
|
|
3486
|
-
},
|
|
3535
|
+
}, _callee31, this);
|
|
3487
3536
|
}));
|
|
3488
3537
|
|
|
3489
|
-
function getReplies(
|
|
3538
|
+
function getReplies(_x33, _x34, _x35) {
|
|
3490
3539
|
return _getReplies.apply(this, arguments);
|
|
3491
3540
|
}
|
|
3492
3541
|
|
|
@@ -3504,15 +3553,15 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3504
3553
|
}, {
|
|
3505
3554
|
key: "getPinnedMessages",
|
|
3506
3555
|
value: function () {
|
|
3507
|
-
var _getPinnedMessages = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
3556
|
+
var _getPinnedMessages = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee32(options) {
|
|
3508
3557
|
var sort,
|
|
3509
|
-
|
|
3510
|
-
return _regeneratorRuntime.wrap(function
|
|
3558
|
+
_args32 = arguments;
|
|
3559
|
+
return _regeneratorRuntime.wrap(function _callee32$(_context32) {
|
|
3511
3560
|
while (1) {
|
|
3512
|
-
switch (
|
|
3561
|
+
switch (_context32.prev = _context32.next) {
|
|
3513
3562
|
case 0:
|
|
3514
|
-
sort =
|
|
3515
|
-
|
|
3563
|
+
sort = _args32.length > 1 && _args32[1] !== undefined ? _args32[1] : [];
|
|
3564
|
+
_context32.next = 3;
|
|
3516
3565
|
return this.getClient().get(this._channelURL() + '/pinned_messages', {
|
|
3517
3566
|
payload: _objectSpread$9(_objectSpread$9({}, options), {}, {
|
|
3518
3567
|
sort: normalizeQuerySort(sort)
|
|
@@ -3520,17 +3569,17 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3520
3569
|
});
|
|
3521
3570
|
|
|
3522
3571
|
case 3:
|
|
3523
|
-
return
|
|
3572
|
+
return _context32.abrupt("return", _context32.sent);
|
|
3524
3573
|
|
|
3525
3574
|
case 4:
|
|
3526
3575
|
case "end":
|
|
3527
|
-
return
|
|
3576
|
+
return _context32.stop();
|
|
3528
3577
|
}
|
|
3529
3578
|
}
|
|
3530
|
-
},
|
|
3579
|
+
}, _callee32, this);
|
|
3531
3580
|
}));
|
|
3532
3581
|
|
|
3533
|
-
function getPinnedMessages(
|
|
3582
|
+
function getPinnedMessages(_x36) {
|
|
3534
3583
|
return _getPinnedMessages.apply(this, arguments);
|
|
3535
3584
|
}
|
|
3536
3585
|
|
|
@@ -3666,7 +3715,7 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3666
3715
|
* @return {Promise<QueryChannelAPIResponse<StreamChatGenerics>>} Returns a query response
|
|
3667
3716
|
*/
|
|
3668
3717
|
function () {
|
|
3669
|
-
var _query = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
3718
|
+
var _query = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee33(options) {
|
|
3670
3719
|
var _options$messages$lim, _options$messages, _this$data6, _this$data7;
|
|
3671
3720
|
|
|
3672
3721
|
var messageSetToAddToIfDoesNotExist,
|
|
@@ -3677,14 +3726,14 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3677
3726
|
_this$_initializeStat,
|
|
3678
3727
|
messageSet,
|
|
3679
3728
|
areCapabilitiesChanged,
|
|
3680
|
-
|
|
3729
|
+
_args33 = arguments;
|
|
3681
3730
|
|
|
3682
|
-
return _regeneratorRuntime.wrap(function
|
|
3731
|
+
return _regeneratorRuntime.wrap(function _callee33$(_context33) {
|
|
3683
3732
|
while (1) {
|
|
3684
|
-
switch (
|
|
3733
|
+
switch (_context33.prev = _context33.next) {
|
|
3685
3734
|
case 0:
|
|
3686
|
-
messageSetToAddToIfDoesNotExist =
|
|
3687
|
-
|
|
3735
|
+
messageSetToAddToIfDoesNotExist = _args33.length > 1 && _args33[1] !== undefined ? _args33[1] : 'current';
|
|
3736
|
+
_context33.next = 3;
|
|
3688
3737
|
return this.getClient().wsPromise;
|
|
3689
3738
|
|
|
3690
3739
|
case 3:
|
|
@@ -3694,14 +3743,14 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3694
3743
|
queryURL += "/".concat(encodeURIComponent(this.id));
|
|
3695
3744
|
}
|
|
3696
3745
|
|
|
3697
|
-
|
|
3746
|
+
_context33.next = 7;
|
|
3698
3747
|
return this.getClient().post(queryURL + '/query', _objectSpread$9({
|
|
3699
3748
|
data: this._data,
|
|
3700
3749
|
state: true
|
|
3701
3750
|
}, options));
|
|
3702
3751
|
|
|
3703
3752
|
case 7:
|
|
3704
|
-
state =
|
|
3753
|
+
state = _context33.sent;
|
|
3705
3754
|
|
|
3706
3755
|
// update the channel id if it was missing
|
|
3707
3756
|
if (!this.id) {
|
|
@@ -3756,17 +3805,17 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3756
3805
|
isLatestMessageSet: messageSet.isLatest
|
|
3757
3806
|
}
|
|
3758
3807
|
});
|
|
3759
|
-
return
|
|
3808
|
+
return _context33.abrupt("return", state);
|
|
3760
3809
|
|
|
3761
3810
|
case 18:
|
|
3762
3811
|
case "end":
|
|
3763
|
-
return
|
|
3812
|
+
return _context33.stop();
|
|
3764
3813
|
}
|
|
3765
3814
|
}
|
|
3766
|
-
},
|
|
3815
|
+
}, _callee33, this);
|
|
3767
3816
|
}));
|
|
3768
3817
|
|
|
3769
|
-
function query(
|
|
3818
|
+
function query(_x37) {
|
|
3770
3819
|
return _query.apply(this, arguments);
|
|
3771
3820
|
}
|
|
3772
3821
|
|
|
@@ -3783,31 +3832,31 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3783
3832
|
}, {
|
|
3784
3833
|
key: "banUser",
|
|
3785
3834
|
value: function () {
|
|
3786
|
-
var _banUser = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
3787
|
-
return _regeneratorRuntime.wrap(function
|
|
3835
|
+
var _banUser = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee34(targetUserID, options) {
|
|
3836
|
+
return _regeneratorRuntime.wrap(function _callee34$(_context34) {
|
|
3788
3837
|
while (1) {
|
|
3789
|
-
switch (
|
|
3838
|
+
switch (_context34.prev = _context34.next) {
|
|
3790
3839
|
case 0:
|
|
3791
3840
|
this._checkInitialized();
|
|
3792
3841
|
|
|
3793
|
-
|
|
3842
|
+
_context34.next = 3;
|
|
3794
3843
|
return this.getClient().banUser(targetUserID, _objectSpread$9(_objectSpread$9({}, options), {}, {
|
|
3795
3844
|
type: this.type,
|
|
3796
3845
|
id: this.id
|
|
3797
3846
|
}));
|
|
3798
3847
|
|
|
3799
3848
|
case 3:
|
|
3800
|
-
return
|
|
3849
|
+
return _context34.abrupt("return", _context34.sent);
|
|
3801
3850
|
|
|
3802
3851
|
case 4:
|
|
3803
3852
|
case "end":
|
|
3804
|
-
return
|
|
3853
|
+
return _context34.stop();
|
|
3805
3854
|
}
|
|
3806
3855
|
}
|
|
3807
|
-
},
|
|
3856
|
+
}, _callee34, this);
|
|
3808
3857
|
}));
|
|
3809
3858
|
|
|
3810
|
-
function banUser(
|
|
3859
|
+
function banUser(_x38, _x39) {
|
|
3811
3860
|
return _banUser.apply(this, arguments);
|
|
3812
3861
|
}
|
|
3813
3862
|
|
|
@@ -3825,34 +3874,34 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3825
3874
|
}, {
|
|
3826
3875
|
key: "hide",
|
|
3827
3876
|
value: function () {
|
|
3828
|
-
var _hide = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
3877
|
+
var _hide = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee35() {
|
|
3829
3878
|
var userId,
|
|
3830
3879
|
clearHistory,
|
|
3831
|
-
|
|
3832
|
-
return _regeneratorRuntime.wrap(function
|
|
3880
|
+
_args35 = arguments;
|
|
3881
|
+
return _regeneratorRuntime.wrap(function _callee35$(_context35) {
|
|
3833
3882
|
while (1) {
|
|
3834
|
-
switch (
|
|
3883
|
+
switch (_context35.prev = _context35.next) {
|
|
3835
3884
|
case 0:
|
|
3836
|
-
userId =
|
|
3837
|
-
clearHistory =
|
|
3885
|
+
userId = _args35.length > 0 && _args35[0] !== undefined ? _args35[0] : null;
|
|
3886
|
+
clearHistory = _args35.length > 1 && _args35[1] !== undefined ? _args35[1] : false;
|
|
3838
3887
|
|
|
3839
3888
|
this._checkInitialized();
|
|
3840
3889
|
|
|
3841
|
-
|
|
3890
|
+
_context35.next = 5;
|
|
3842
3891
|
return this.getClient().post("".concat(this._channelURL(), "/hide"), {
|
|
3843
3892
|
user_id: userId,
|
|
3844
3893
|
clear_history: clearHistory
|
|
3845
3894
|
});
|
|
3846
3895
|
|
|
3847
3896
|
case 5:
|
|
3848
|
-
return
|
|
3897
|
+
return _context35.abrupt("return", _context35.sent);
|
|
3849
3898
|
|
|
3850
3899
|
case 6:
|
|
3851
3900
|
case "end":
|
|
3852
|
-
return
|
|
3901
|
+
return _context35.stop();
|
|
3853
3902
|
}
|
|
3854
3903
|
}
|
|
3855
|
-
},
|
|
3904
|
+
}, _callee35, this);
|
|
3856
3905
|
}));
|
|
3857
3906
|
|
|
3858
3907
|
function hide() {
|
|
@@ -3871,31 +3920,31 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3871
3920
|
}, {
|
|
3872
3921
|
key: "show",
|
|
3873
3922
|
value: function () {
|
|
3874
|
-
var _show = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
3923
|
+
var _show = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee36() {
|
|
3875
3924
|
var userId,
|
|
3876
|
-
|
|
3877
|
-
return _regeneratorRuntime.wrap(function
|
|
3925
|
+
_args36 = arguments;
|
|
3926
|
+
return _regeneratorRuntime.wrap(function _callee36$(_context36) {
|
|
3878
3927
|
while (1) {
|
|
3879
|
-
switch (
|
|
3928
|
+
switch (_context36.prev = _context36.next) {
|
|
3880
3929
|
case 0:
|
|
3881
|
-
userId =
|
|
3930
|
+
userId = _args36.length > 0 && _args36[0] !== undefined ? _args36[0] : null;
|
|
3882
3931
|
|
|
3883
3932
|
this._checkInitialized();
|
|
3884
3933
|
|
|
3885
|
-
|
|
3934
|
+
_context36.next = 4;
|
|
3886
3935
|
return this.getClient().post("".concat(this._channelURL(), "/show"), {
|
|
3887
3936
|
user_id: userId
|
|
3888
3937
|
});
|
|
3889
3938
|
|
|
3890
3939
|
case 4:
|
|
3891
|
-
return
|
|
3940
|
+
return _context36.abrupt("return", _context36.sent);
|
|
3892
3941
|
|
|
3893
3942
|
case 5:
|
|
3894
3943
|
case "end":
|
|
3895
|
-
return
|
|
3944
|
+
return _context36.stop();
|
|
3896
3945
|
}
|
|
3897
3946
|
}
|
|
3898
|
-
},
|
|
3947
|
+
}, _callee36, this);
|
|
3899
3948
|
}));
|
|
3900
3949
|
|
|
3901
3950
|
function show() {
|
|
@@ -3914,31 +3963,31 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3914
3963
|
}, {
|
|
3915
3964
|
key: "unbanUser",
|
|
3916
3965
|
value: function () {
|
|
3917
|
-
var _unbanUser = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
3918
|
-
return _regeneratorRuntime.wrap(function
|
|
3966
|
+
var _unbanUser = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee37(targetUserID) {
|
|
3967
|
+
return _regeneratorRuntime.wrap(function _callee37$(_context37) {
|
|
3919
3968
|
while (1) {
|
|
3920
|
-
switch (
|
|
3969
|
+
switch (_context37.prev = _context37.next) {
|
|
3921
3970
|
case 0:
|
|
3922
3971
|
this._checkInitialized();
|
|
3923
3972
|
|
|
3924
|
-
|
|
3973
|
+
_context37.next = 3;
|
|
3925
3974
|
return this.getClient().unbanUser(targetUserID, {
|
|
3926
3975
|
type: this.type,
|
|
3927
3976
|
id: this.id
|
|
3928
3977
|
});
|
|
3929
3978
|
|
|
3930
3979
|
case 3:
|
|
3931
|
-
return
|
|
3980
|
+
return _context37.abrupt("return", _context37.sent);
|
|
3932
3981
|
|
|
3933
3982
|
case 4:
|
|
3934
3983
|
case "end":
|
|
3935
|
-
return
|
|
3984
|
+
return _context37.stop();
|
|
3936
3985
|
}
|
|
3937
3986
|
}
|
|
3938
|
-
},
|
|
3987
|
+
}, _callee37, this);
|
|
3939
3988
|
}));
|
|
3940
3989
|
|
|
3941
|
-
function unbanUser(
|
|
3990
|
+
function unbanUser(_x40) {
|
|
3942
3991
|
return _unbanUser.apply(this, arguments);
|
|
3943
3992
|
}
|
|
3944
3993
|
|
|
@@ -3955,31 +4004,31 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3955
4004
|
}, {
|
|
3956
4005
|
key: "shadowBan",
|
|
3957
4006
|
value: function () {
|
|
3958
|
-
var _shadowBan = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
3959
|
-
return _regeneratorRuntime.wrap(function
|
|
4007
|
+
var _shadowBan = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee38(targetUserID, options) {
|
|
4008
|
+
return _regeneratorRuntime.wrap(function _callee38$(_context38) {
|
|
3960
4009
|
while (1) {
|
|
3961
|
-
switch (
|
|
4010
|
+
switch (_context38.prev = _context38.next) {
|
|
3962
4011
|
case 0:
|
|
3963
4012
|
this._checkInitialized();
|
|
3964
4013
|
|
|
3965
|
-
|
|
4014
|
+
_context38.next = 3;
|
|
3966
4015
|
return this.getClient().shadowBan(targetUserID, _objectSpread$9(_objectSpread$9({}, options), {}, {
|
|
3967
4016
|
type: this.type,
|
|
3968
4017
|
id: this.id
|
|
3969
4018
|
}));
|
|
3970
4019
|
|
|
3971
4020
|
case 3:
|
|
3972
|
-
return
|
|
4021
|
+
return _context38.abrupt("return", _context38.sent);
|
|
3973
4022
|
|
|
3974
4023
|
case 4:
|
|
3975
4024
|
case "end":
|
|
3976
|
-
return
|
|
4025
|
+
return _context38.stop();
|
|
3977
4026
|
}
|
|
3978
4027
|
}
|
|
3979
|
-
},
|
|
4028
|
+
}, _callee38, this);
|
|
3980
4029
|
}));
|
|
3981
4030
|
|
|
3982
|
-
function shadowBan(
|
|
4031
|
+
function shadowBan(_x41, _x42) {
|
|
3983
4032
|
return _shadowBan.apply(this, arguments);
|
|
3984
4033
|
}
|
|
3985
4034
|
|
|
@@ -3995,31 +4044,31 @@ var Channel = /*#__PURE__*/function () {
|
|
|
3995
4044
|
}, {
|
|
3996
4045
|
key: "removeShadowBan",
|
|
3997
4046
|
value: function () {
|
|
3998
|
-
var _removeShadowBan = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
3999
|
-
return _regeneratorRuntime.wrap(function
|
|
4047
|
+
var _removeShadowBan = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee39(targetUserID) {
|
|
4048
|
+
return _regeneratorRuntime.wrap(function _callee39$(_context39) {
|
|
4000
4049
|
while (1) {
|
|
4001
|
-
switch (
|
|
4050
|
+
switch (_context39.prev = _context39.next) {
|
|
4002
4051
|
case 0:
|
|
4003
4052
|
this._checkInitialized();
|
|
4004
4053
|
|
|
4005
|
-
|
|
4054
|
+
_context39.next = 3;
|
|
4006
4055
|
return this.getClient().removeShadowBan(targetUserID, {
|
|
4007
4056
|
type: this.type,
|
|
4008
4057
|
id: this.id
|
|
4009
4058
|
});
|
|
4010
4059
|
|
|
4011
4060
|
case 3:
|
|
4012
|
-
return
|
|
4061
|
+
return _context39.abrupt("return", _context39.sent);
|
|
4013
4062
|
|
|
4014
4063
|
case 4:
|
|
4015
4064
|
case "end":
|
|
4016
|
-
return
|
|
4065
|
+
return _context39.stop();
|
|
4017
4066
|
}
|
|
4018
4067
|
}
|
|
4019
|
-
},
|
|
4068
|
+
}, _callee39, this);
|
|
4020
4069
|
}));
|
|
4021
4070
|
|
|
4022
|
-
function removeShadowBan(
|
|
4071
|
+
function removeShadowBan(_x43) {
|
|
4023
4072
|
return _removeShadowBan.apply(this, arguments);
|
|
4024
4073
|
}
|
|
4025
4074
|
|
|
@@ -4035,26 +4084,26 @@ var Channel = /*#__PURE__*/function () {
|
|
|
4035
4084
|
}, {
|
|
4036
4085
|
key: "createCall",
|
|
4037
4086
|
value: function () {
|
|
4038
|
-
var _createCall = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
4039
|
-
return _regeneratorRuntime.wrap(function
|
|
4087
|
+
var _createCall = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee40(options) {
|
|
4088
|
+
return _regeneratorRuntime.wrap(function _callee40$(_context40) {
|
|
4040
4089
|
while (1) {
|
|
4041
|
-
switch (
|
|
4090
|
+
switch (_context40.prev = _context40.next) {
|
|
4042
4091
|
case 0:
|
|
4043
|
-
|
|
4092
|
+
_context40.next = 2;
|
|
4044
4093
|
return this.getClient().post(this._channelURL() + '/call', options);
|
|
4045
4094
|
|
|
4046
4095
|
case 2:
|
|
4047
|
-
return
|
|
4096
|
+
return _context40.abrupt("return", _context40.sent);
|
|
4048
4097
|
|
|
4049
4098
|
case 3:
|
|
4050
4099
|
case "end":
|
|
4051
|
-
return
|
|
4100
|
+
return _context40.stop();
|
|
4052
4101
|
}
|
|
4053
4102
|
}
|
|
4054
|
-
},
|
|
4103
|
+
}, _callee40, this);
|
|
4055
4104
|
}));
|
|
4056
4105
|
|
|
4057
|
-
function createCall(
|
|
4106
|
+
function createCall(_x44) {
|
|
4058
4107
|
return _createCall.apply(this, arguments);
|
|
4059
4108
|
}
|
|
4060
4109
|
|
|
@@ -4070,26 +4119,26 @@ var Channel = /*#__PURE__*/function () {
|
|
|
4070
4119
|
}, {
|
|
4071
4120
|
key: "vote",
|
|
4072
4121
|
value: function () {
|
|
4073
|
-
var _vote2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
4074
|
-
return _regeneratorRuntime.wrap(function
|
|
4122
|
+
var _vote2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee41(messageId, pollId, _vote) {
|
|
4123
|
+
return _regeneratorRuntime.wrap(function _callee41$(_context41) {
|
|
4075
4124
|
while (1) {
|
|
4076
|
-
switch (
|
|
4125
|
+
switch (_context41.prev = _context41.next) {
|
|
4077
4126
|
case 0:
|
|
4078
|
-
|
|
4127
|
+
_context41.next = 2;
|
|
4079
4128
|
return this.getClient().castPollVote(messageId, pollId, _vote);
|
|
4080
4129
|
|
|
4081
4130
|
case 2:
|
|
4082
|
-
return
|
|
4131
|
+
return _context41.abrupt("return", _context41.sent);
|
|
4083
4132
|
|
|
4084
4133
|
case 3:
|
|
4085
4134
|
case "end":
|
|
4086
|
-
return
|
|
4135
|
+
return _context41.stop();
|
|
4087
4136
|
}
|
|
4088
4137
|
}
|
|
4089
|
-
},
|
|
4138
|
+
}, _callee41, this);
|
|
4090
4139
|
}));
|
|
4091
4140
|
|
|
4092
|
-
function vote(
|
|
4141
|
+
function vote(_x45, _x46, _x47) {
|
|
4093
4142
|
return _vote2.apply(this, arguments);
|
|
4094
4143
|
}
|
|
4095
4144
|
|
|
@@ -4098,26 +4147,26 @@ var Channel = /*#__PURE__*/function () {
|
|
|
4098
4147
|
}, {
|
|
4099
4148
|
key: "removeVote",
|
|
4100
4149
|
value: function () {
|
|
4101
|
-
var _removeVote = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
4102
|
-
return _regeneratorRuntime.wrap(function
|
|
4150
|
+
var _removeVote = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee42(messageId, pollId, voteId) {
|
|
4151
|
+
return _regeneratorRuntime.wrap(function _callee42$(_context42) {
|
|
4103
4152
|
while (1) {
|
|
4104
|
-
switch (
|
|
4153
|
+
switch (_context42.prev = _context42.next) {
|
|
4105
4154
|
case 0:
|
|
4106
|
-
|
|
4155
|
+
_context42.next = 2;
|
|
4107
4156
|
return this.getClient().removePollVote(messageId, pollId, voteId);
|
|
4108
4157
|
|
|
4109
4158
|
case 2:
|
|
4110
|
-
return
|
|
4159
|
+
return _context42.abrupt("return", _context42.sent);
|
|
4111
4160
|
|
|
4112
4161
|
case 3:
|
|
4113
4162
|
case "end":
|
|
4114
|
-
return
|
|
4163
|
+
return _context42.stop();
|
|
4115
4164
|
}
|
|
4116
4165
|
}
|
|
4117
|
-
},
|
|
4166
|
+
}, _callee42, this);
|
|
4118
4167
|
}));
|
|
4119
4168
|
|
|
4120
|
-
function removeVote(
|
|
4169
|
+
function removeVote(_x48, _x49, _x50) {
|
|
4121
4170
|
return _removeVote.apply(this, arguments);
|
|
4122
4171
|
}
|
|
4123
4172
|
|
|
@@ -4658,13 +4707,7 @@ var Channel = /*#__PURE__*/function () {
|
|
|
4658
4707
|
}
|
|
4659
4708
|
|
|
4660
4709
|
if (state.members) {
|
|
4661
|
-
this.state.members
|
|
4662
|
-
if (member.user) {
|
|
4663
|
-
acc[member.user.id] = member;
|
|
4664
|
-
}
|
|
4665
|
-
|
|
4666
|
-
return acc;
|
|
4667
|
-
}, {});
|
|
4710
|
+
this._hydrateMembers(state.members);
|
|
4668
4711
|
}
|
|
4669
4712
|
|
|
4670
4713
|
return {
|
|
@@ -4684,6 +4727,17 @@ var Channel = /*#__PURE__*/function () {
|
|
|
4684
4727
|
event.message.own_reactions = message.own_reactions;
|
|
4685
4728
|
}
|
|
4686
4729
|
}
|
|
4730
|
+
}, {
|
|
4731
|
+
key: "_hydrateMembers",
|
|
4732
|
+
value: function _hydrateMembers(members) {
|
|
4733
|
+
this.state.members = members.reduce(function (acc, member) {
|
|
4734
|
+
if (member.user) {
|
|
4735
|
+
acc[member.user.id] = member;
|
|
4736
|
+
}
|
|
4737
|
+
|
|
4738
|
+
return acc;
|
|
4739
|
+
}, {});
|
|
4740
|
+
}
|
|
4687
4741
|
}, {
|
|
4688
4742
|
key: "_disconnect",
|
|
4689
4743
|
value: function _disconnect() {
|
|
@@ -7835,9 +7889,17 @@ var Thread = /*#__PURE__*/function () {
|
|
|
7835
7889
|
};
|
|
7836
7890
|
}());
|
|
7837
7891
|
|
|
7892
|
+
var _channel = client.channel(threadData.channel.type, threadData.channel.id, {
|
|
7893
|
+
name: threadData.channel.name
|
|
7894
|
+
});
|
|
7895
|
+
|
|
7896
|
+
if (threadData.channel.members) {
|
|
7897
|
+
_channel._hydrateMembers(threadData.channel.members);
|
|
7898
|
+
}
|
|
7899
|
+
|
|
7838
7900
|
this.state = new StateStore({
|
|
7839
7901
|
active: false,
|
|
7840
|
-
channel:
|
|
7902
|
+
channel: _channel,
|
|
7841
7903
|
createdAt: new Date(threadData.created_at),
|
|
7842
7904
|
deletedAt: threadData.deleted_at ? new Date(threadData.deleted_at) : null,
|
|
7843
7905
|
isLoading: false,
|
|
@@ -13269,7 +13331,7 @@ var StreamChat = /*#__PURE__*/function () {
|
|
|
13269
13331
|
}, {
|
|
13270
13332
|
key: "getUserAgent",
|
|
13271
13333
|
value: function getUserAgent() {
|
|
13272
|
-
return this.userAgent || "stream-chat-javascript-client-".concat(this.node ? 'node' : 'browser', "-", "8.40.
|
|
13334
|
+
return this.userAgent || "stream-chat-javascript-client-".concat(this.node ? 'node' : 'browser', "-", "8.40.4");
|
|
13273
13335
|
}
|
|
13274
13336
|
}, {
|
|
13275
13337
|
key: "setUserAgent",
|