kicksdk-js 0.2.0 → 0.3.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/README.md +79 -3
- package/index.d.ts +13 -2
- package/index.js +51 -6
- package/package.json +1 -1
- package/pkg/kicksdk.d.ts +541 -11
- package/pkg/kicksdk.js +1488 -229
- package/pkg/kicksdk_bg.wasm +0 -0
- package/pkg/kicksdk_bg.wasm.d.ts +49 -1
package/pkg/kicksdk.js
CHANGED
|
@@ -343,6 +343,131 @@ export class WebhookPublicKey {
|
|
|
343
343
|
}
|
|
344
344
|
if (Symbol.dispose) WebhookPublicKey.prototype[Symbol.dispose] = WebhookPublicKey.prototype.free;
|
|
345
345
|
|
|
346
|
+
/**
|
|
347
|
+
* Starts an ad break of 7 to 90 `seconds`; `id` is a UUID you make up
|
|
348
|
+
* (`crypto.randomUUID()`).
|
|
349
|
+
* @param {string} token
|
|
350
|
+
* @param {string} id
|
|
351
|
+
* @param {number} seconds
|
|
352
|
+
* @param {Endpoints | null} [endpoints]
|
|
353
|
+
* @returns {HttpRequest}
|
|
354
|
+
*/
|
|
355
|
+
export function adsAdBreakRequest(token, id, seconds, endpoints) {
|
|
356
|
+
try {
|
|
357
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
358
|
+
const ptr0 = passStringToWasm0(token, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
359
|
+
const len0 = WASM_VECTOR_LEN;
|
|
360
|
+
const ptr1 = passStringToWasm0(id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
361
|
+
const len1 = WASM_VECTOR_LEN;
|
|
362
|
+
wasm.adsAdBreakRequest(retptr, ptr0, len0, ptr1, len1, addHeapObject(seconds), isLikeNone(endpoints) ? 0 : addHeapObject(endpoints));
|
|
363
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
364
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
365
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
366
|
+
if (r2) {
|
|
367
|
+
throw takeObject(r1);
|
|
368
|
+
}
|
|
369
|
+
return takeObject(r0);
|
|
370
|
+
} finally {
|
|
371
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
/**
|
|
376
|
+
* Enrolls the channel in ads; `parseDone` reads the answer.
|
|
377
|
+
* @param {string} token
|
|
378
|
+
* @param {Endpoints | null} [endpoints]
|
|
379
|
+
* @returns {HttpRequest}
|
|
380
|
+
*/
|
|
381
|
+
export function adsEnrollRequest(token, endpoints) {
|
|
382
|
+
try {
|
|
383
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
384
|
+
const ptr0 = passStringToWasm0(token, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
385
|
+
const len0 = WASM_VECTOR_LEN;
|
|
386
|
+
wasm.adsEnrollRequest(retptr, ptr0, len0, isLikeNone(endpoints) ? 0 : addHeapObject(endpoints));
|
|
387
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
388
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
389
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
390
|
+
if (r2) {
|
|
391
|
+
throw takeObject(r1);
|
|
392
|
+
}
|
|
393
|
+
return takeObject(r0);
|
|
394
|
+
} finally {
|
|
395
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
/**
|
|
400
|
+
* Reads an `adsAdBreakRequest` answer.
|
|
401
|
+
* @param {number} status
|
|
402
|
+
* @param {string} body
|
|
403
|
+
* @returns {AdBreak}
|
|
404
|
+
*/
|
|
405
|
+
export function adsParseAdBreak(status, body) {
|
|
406
|
+
try {
|
|
407
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
408
|
+
const ptr0 = passStringToWasm0(body, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
409
|
+
const len0 = WASM_VECTOR_LEN;
|
|
410
|
+
wasm.adsParseAdBreak(retptr, addHeapObject(status), ptr0, len0);
|
|
411
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
412
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
413
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
414
|
+
if (r2) {
|
|
415
|
+
throw takeObject(r1);
|
|
416
|
+
}
|
|
417
|
+
return takeObject(r0);
|
|
418
|
+
} finally {
|
|
419
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
/**
|
|
424
|
+
* Reads an `adsStatusRequest` answer.
|
|
425
|
+
* @param {number} status
|
|
426
|
+
* @param {string} body
|
|
427
|
+
* @returns {AdStatus}
|
|
428
|
+
*/
|
|
429
|
+
export function adsParseStatus(status, body) {
|
|
430
|
+
try {
|
|
431
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
432
|
+
const ptr0 = passStringToWasm0(body, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
433
|
+
const len0 = WASM_VECTOR_LEN;
|
|
434
|
+
wasm.adsParseStatus(retptr, addHeapObject(status), ptr0, len0);
|
|
435
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
436
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
437
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
438
|
+
if (r2) {
|
|
439
|
+
throw takeObject(r1);
|
|
440
|
+
}
|
|
441
|
+
return takeObject(r0);
|
|
442
|
+
} finally {
|
|
443
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
/**
|
|
448
|
+
* The channel's ads: enrolled or not, limits, recent ad breaks.
|
|
449
|
+
* @param {string} token
|
|
450
|
+
* @param {Endpoints | null} [endpoints]
|
|
451
|
+
* @returns {HttpRequest}
|
|
452
|
+
*/
|
|
453
|
+
export function adsStatusRequest(token, endpoints) {
|
|
454
|
+
try {
|
|
455
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
456
|
+
const ptr0 = passStringToWasm0(token, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
457
|
+
const len0 = WASM_VECTOR_LEN;
|
|
458
|
+
wasm.adsStatusRequest(retptr, ptr0, len0, isLikeNone(endpoints) ? 0 : addHeapObject(endpoints));
|
|
459
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
460
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
461
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
462
|
+
if (r2) {
|
|
463
|
+
throw takeObject(r1);
|
|
464
|
+
}
|
|
465
|
+
return takeObject(r0);
|
|
466
|
+
} finally {
|
|
467
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
468
|
+
}
|
|
469
|
+
}
|
|
470
|
+
|
|
346
471
|
/**
|
|
347
472
|
* An app token request (client credentials).
|
|
348
473
|
* @param {string} client_id
|
|
@@ -400,6 +525,39 @@ export function banRequest(session, channel_slug, username, endpoints) {
|
|
|
400
525
|
}
|
|
401
526
|
}
|
|
402
527
|
|
|
528
|
+
/**
|
|
529
|
+
* One page of categories (`/public/v2/categories`): by `names` and `tags`
|
|
530
|
+
* (no commas in them), or by `ids`; none of them, all. `limit` is 1 to 1000
|
|
531
|
+
* (Kick's default 25); `cursor` is the previous page's `next_cursor`.
|
|
532
|
+
* @param {string} token
|
|
533
|
+
* @param {readonly string[] | null} [names]
|
|
534
|
+
* @param {readonly string[] | null} [tags]
|
|
535
|
+
* @param {readonly number[] | null} [ids]
|
|
536
|
+
* @param {number | null} [limit]
|
|
537
|
+
* @param {string | null} [cursor]
|
|
538
|
+
* @param {Endpoints | null} [endpoints]
|
|
539
|
+
* @returns {HttpRequest}
|
|
540
|
+
*/
|
|
541
|
+
export function categoriesRequest(token, names, tags, ids, limit, cursor, endpoints) {
|
|
542
|
+
try {
|
|
543
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
544
|
+
const ptr0 = passStringToWasm0(token, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
545
|
+
const len0 = WASM_VECTOR_LEN;
|
|
546
|
+
var ptr1 = isLikeNone(cursor) ? 0 : passStringToWasm0(cursor, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
547
|
+
var len1 = WASM_VECTOR_LEN;
|
|
548
|
+
wasm.categoriesRequest(retptr, ptr0, len0, isLikeNone(names) ? 0 : addHeapObject(names), isLikeNone(tags) ? 0 : addHeapObject(tags), isLikeNone(ids) ? 0 : addHeapObject(ids), isLikeNone(limit) ? 0 : addHeapObject(limit), ptr1, len1, isLikeNone(endpoints) ? 0 : addHeapObject(endpoints));
|
|
549
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
550
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
551
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
552
|
+
if (r2) {
|
|
553
|
+
throw takeObject(r1);
|
|
554
|
+
}
|
|
555
|
+
return takeObject(r0);
|
|
556
|
+
} finally {
|
|
557
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
558
|
+
}
|
|
559
|
+
}
|
|
560
|
+
|
|
403
561
|
/**
|
|
404
562
|
* A channel by slug (`kick.com/api/v2`): chatroom id, followers, live state.
|
|
405
563
|
* @param {string} slug
|
|
@@ -503,6 +661,37 @@ export function channelsBySlugsRequest(token, slugs, endpoints) {
|
|
|
503
661
|
}
|
|
504
662
|
}
|
|
505
663
|
|
|
664
|
+
/**
|
|
665
|
+
* Sets what is given of the token's channel's category, custom tags (`[]`
|
|
666
|
+
* clears them, up to 10) and stream title. Scope `channel:write`;
|
|
667
|
+
* `parseDone` reads the answer.
|
|
668
|
+
* @param {string} token
|
|
669
|
+
* @param {number | null} [category_id]
|
|
670
|
+
* @param {readonly string[] | null} [custom_tags]
|
|
671
|
+
* @param {string | null} [stream_title]
|
|
672
|
+
* @param {Endpoints | null} [endpoints]
|
|
673
|
+
* @returns {HttpRequest}
|
|
674
|
+
*/
|
|
675
|
+
export function channelsUpdateRequest(token, category_id, custom_tags, stream_title, endpoints) {
|
|
676
|
+
try {
|
|
677
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
678
|
+
const ptr0 = passStringToWasm0(token, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
679
|
+
const len0 = WASM_VECTOR_LEN;
|
|
680
|
+
var ptr1 = isLikeNone(stream_title) ? 0 : passStringToWasm0(stream_title, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
681
|
+
var len1 = WASM_VECTOR_LEN;
|
|
682
|
+
wasm.channelsUpdateRequest(retptr, ptr0, len0, isLikeNone(category_id) ? 0 : addHeapObject(category_id), isLikeNone(custom_tags) ? 0 : addHeapObject(custom_tags), ptr1, len1, isLikeNone(endpoints) ? 0 : addHeapObject(endpoints));
|
|
683
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
684
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
685
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
686
|
+
if (r2) {
|
|
687
|
+
throw takeObject(r1);
|
|
688
|
+
}
|
|
689
|
+
return takeObject(r0);
|
|
690
|
+
} finally {
|
|
691
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
692
|
+
}
|
|
693
|
+
}
|
|
694
|
+
|
|
506
695
|
/**
|
|
507
696
|
* The feeds for one chat, the chat feed first.
|
|
508
697
|
* @param {number} chatroom_id
|
|
@@ -554,17 +743,21 @@ export function chatConnectionRequest(channel_id, client_id, endpoints) {
|
|
|
554
743
|
}
|
|
555
744
|
|
|
556
745
|
/**
|
|
557
|
-
*
|
|
558
|
-
*
|
|
746
|
+
* Deletes a message by id. Scope `moderation:chat_message:manage`;
|
|
747
|
+
* `parseDone` reads the answer.
|
|
748
|
+
* @param {string} token
|
|
749
|
+
* @param {string} message_id
|
|
559
750
|
* @param {Endpoints | null} [endpoints]
|
|
560
|
-
* @returns {
|
|
751
|
+
* @returns {HttpRequest}
|
|
561
752
|
*/
|
|
562
|
-
export function
|
|
753
|
+
export function chatDeleteRequest(token, message_id, endpoints) {
|
|
563
754
|
try {
|
|
564
755
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
565
|
-
const ptr0 = passStringToWasm0(
|
|
756
|
+
const ptr0 = passStringToWasm0(token, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
566
757
|
const len0 = WASM_VECTOR_LEN;
|
|
567
|
-
|
|
758
|
+
const ptr1 = passStringToWasm0(message_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
759
|
+
const len1 = WASM_VECTOR_LEN;
|
|
760
|
+
wasm.chatDeleteRequest(retptr, ptr0, len0, ptr1, len1, isLikeNone(endpoints) ? 0 : addHeapObject(endpoints));
|
|
568
761
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
569
762
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
570
763
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
@@ -578,21 +771,17 @@ export function connectionRequest(client_id, endpoints) {
|
|
|
578
771
|
}
|
|
579
772
|
|
|
580
773
|
/**
|
|
581
|
-
*
|
|
582
|
-
* @param {
|
|
583
|
-
* @param {
|
|
584
|
-
* @
|
|
585
|
-
* @param {Endpoints | null} [endpoints]
|
|
586
|
-
* @returns {any}
|
|
774
|
+
* Reads a `chatSendRequest` answer.
|
|
775
|
+
* @param {number} status
|
|
776
|
+
* @param {string} body
|
|
777
|
+
* @returns {Sent}
|
|
587
778
|
*/
|
|
588
|
-
export function
|
|
779
|
+
export function chatParseSend(status, body) {
|
|
589
780
|
try {
|
|
590
781
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
591
|
-
const ptr0 = passStringToWasm0(
|
|
782
|
+
const ptr0 = passStringToWasm0(body, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
592
783
|
const len0 = WASM_VECTOR_LEN;
|
|
593
|
-
|
|
594
|
-
const len1 = WASM_VECTOR_LEN;
|
|
595
|
-
wasm.deleteMessageRequest(retptr, ptr0, len0, addHeapObject(chatroom_id), ptr1, len1, isLikeNone(endpoints) ? 0 : addHeapObject(endpoints));
|
|
784
|
+
wasm.chatParseSend(retptr, addHeapObject(status), ptr0, len0);
|
|
596
785
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
597
786
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
598
787
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
@@ -606,47 +795,50 @@ export function deleteMessageRequest(session, chatroom_id, message_id, endpoints
|
|
|
606
795
|
}
|
|
607
796
|
|
|
608
797
|
/**
|
|
609
|
-
*
|
|
610
|
-
*
|
|
611
|
-
*
|
|
798
|
+
* Sends `content` as the token's user into a channel (`{user:
|
|
799
|
+
* broadcasterUserId}`) or as the app's bot (`'bot'`), as a reply if
|
|
800
|
+
* `replyToMessageId` is given. Scope `chat:write`.
|
|
801
|
+
* @param {string} token
|
|
802
|
+
* @param {ChatSender} sender
|
|
803
|
+
* @param {string} content
|
|
804
|
+
* @param {string | null} [reply_to_message_id]
|
|
805
|
+
* @param {Endpoints | null} [endpoints]
|
|
806
|
+
* @returns {HttpRequest}
|
|
612
807
|
*/
|
|
613
|
-
export function
|
|
614
|
-
let deferred3_0;
|
|
615
|
-
let deferred3_1;
|
|
808
|
+
export function chatSendRequest(token, sender, content, reply_to_message_id, endpoints) {
|
|
616
809
|
try {
|
|
617
810
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
618
|
-
const ptr0 = passStringToWasm0(
|
|
811
|
+
const ptr0 = passStringToWasm0(token, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
619
812
|
const len0 = WASM_VECTOR_LEN;
|
|
620
|
-
|
|
813
|
+
const ptr1 = passStringToWasm0(content, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
814
|
+
const len1 = WASM_VECTOR_LEN;
|
|
815
|
+
var ptr2 = isLikeNone(reply_to_message_id) ? 0 : passStringToWasm0(reply_to_message_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
816
|
+
var len2 = WASM_VECTOR_LEN;
|
|
817
|
+
wasm.chatSendRequest(retptr, ptr0, len0, addHeapObject(sender), ptr1, len1, ptr2, len2, isLikeNone(endpoints) ? 0 : addHeapObject(endpoints));
|
|
621
818
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
622
819
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
623
820
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
var len2 = r1;
|
|
627
|
-
if (r3) {
|
|
628
|
-
ptr2 = 0; len2 = 0;
|
|
629
|
-
throw takeObject(r2);
|
|
821
|
+
if (r2) {
|
|
822
|
+
throw takeObject(r1);
|
|
630
823
|
}
|
|
631
|
-
|
|
632
|
-
deferred3_1 = len2;
|
|
633
|
-
return getStringFromWasm0(ptr2, len2);
|
|
824
|
+
return takeObject(r0);
|
|
634
825
|
} finally {
|
|
635
826
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
636
|
-
wasm.__wbindgen_export4(deferred3_0, deferred3_1, 1);
|
|
637
827
|
}
|
|
638
828
|
}
|
|
639
829
|
|
|
640
830
|
/**
|
|
641
|
-
*
|
|
642
|
-
* @param {
|
|
831
|
+
* Where Kick's realtime is served in general.
|
|
832
|
+
* @param {string} client_id
|
|
643
833
|
* @param {Endpoints | null} [endpoints]
|
|
644
834
|
* @returns {any}
|
|
645
835
|
*/
|
|
646
|
-
export function
|
|
836
|
+
export function connectionRequest(client_id, endpoints) {
|
|
647
837
|
try {
|
|
648
838
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
649
|
-
|
|
839
|
+
const ptr0 = passStringToWasm0(client_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
840
|
+
const len0 = WASM_VECTOR_LEN;
|
|
841
|
+
wasm.connectionRequest(retptr, ptr0, len0, isLikeNone(endpoints) ? 0 : addHeapObject(endpoints));
|
|
650
842
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
651
843
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
652
844
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
@@ -660,18 +852,21 @@ export function historyRequest(channel_id, endpoints) {
|
|
|
660
852
|
}
|
|
661
853
|
|
|
662
854
|
/**
|
|
663
|
-
*
|
|
664
|
-
* @param {string}
|
|
665
|
-
* @param {
|
|
855
|
+
* Deletes a message.
|
|
856
|
+
* @param {string} session
|
|
857
|
+
* @param {number} chatroom_id
|
|
858
|
+
* @param {string} message_id
|
|
666
859
|
* @param {Endpoints | null} [endpoints]
|
|
667
860
|
* @returns {any}
|
|
668
861
|
*/
|
|
669
|
-
export function
|
|
862
|
+
export function deleteMessageRequest(session, chatroom_id, message_id, endpoints) {
|
|
670
863
|
try {
|
|
671
864
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
672
|
-
const ptr0 = passStringToWasm0(
|
|
865
|
+
const ptr0 = passStringToWasm0(session, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
673
866
|
const len0 = WASM_VECTOR_LEN;
|
|
674
|
-
|
|
867
|
+
const ptr1 = passStringToWasm0(message_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
868
|
+
const len1 = WASM_VECTOR_LEN;
|
|
869
|
+
wasm.deleteMessageRequest(retptr, ptr0, len0, addHeapObject(chatroom_id), ptr1, len1, isLikeNone(endpoints) ? 0 : addHeapObject(endpoints));
|
|
675
870
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
676
871
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
677
872
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
@@ -685,20 +880,19 @@ export function livestreamsRequests(token, user_ids, endpoints) {
|
|
|
685
880
|
}
|
|
686
881
|
|
|
687
882
|
/**
|
|
688
|
-
*
|
|
689
|
-
*
|
|
690
|
-
* @param {string}
|
|
883
|
+
* Drops reward claims, with an **app** token. `filter`: what is left out
|
|
884
|
+
* is not filtered.
|
|
885
|
+
* @param {string} token
|
|
886
|
+
* @param {ClaimFilter | null} [filter]
|
|
691
887
|
* @param {Endpoints | null} [endpoints]
|
|
692
|
-
* @returns {
|
|
888
|
+
* @returns {HttpRequest}
|
|
693
889
|
*/
|
|
694
|
-
export function
|
|
890
|
+
export function dropsClaimsRequest(token, filter, endpoints) {
|
|
695
891
|
try {
|
|
696
892
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
697
|
-
const ptr0 = passStringToWasm0(
|
|
893
|
+
const ptr0 = passStringToWasm0(token, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
698
894
|
const len0 = WASM_VECTOR_LEN;
|
|
699
|
-
|
|
700
|
-
const len1 = WASM_VECTOR_LEN;
|
|
701
|
-
wasm.meRequest(retptr, ptr0, len0, ptr1, len1, isLikeNone(endpoints) ? 0 : addHeapObject(endpoints));
|
|
895
|
+
wasm.dropsClaimsRequest(retptr, ptr0, len0, isLikeNone(filter) ? 0 : addHeapObject(filter), isLikeNone(endpoints) ? 0 : addHeapObject(endpoints));
|
|
702
896
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
703
897
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
704
898
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
@@ -712,38 +906,42 @@ export function meRequest(session, channel_slug, endpoints) {
|
|
|
712
906
|
}
|
|
713
907
|
|
|
714
908
|
/**
|
|
715
|
-
*
|
|
909
|
+
* Reads a `dropsClaimsRequest` answer.
|
|
716
910
|
* @param {number} status
|
|
717
911
|
* @param {string} body
|
|
912
|
+
* @returns {Claims}
|
|
718
913
|
*/
|
|
719
|
-
export function
|
|
914
|
+
export function dropsParseClaims(status, body) {
|
|
720
915
|
try {
|
|
721
916
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
722
917
|
const ptr0 = passStringToWasm0(body, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
723
918
|
const len0 = WASM_VECTOR_LEN;
|
|
724
|
-
wasm.
|
|
919
|
+
wasm.dropsParseClaims(retptr, addHeapObject(status), ptr0, len0);
|
|
725
920
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
726
921
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
727
|
-
|
|
728
|
-
|
|
922
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
923
|
+
if (r2) {
|
|
924
|
+
throw takeObject(r1);
|
|
729
925
|
}
|
|
926
|
+
return takeObject(r0);
|
|
730
927
|
} finally {
|
|
731
928
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
732
929
|
}
|
|
733
930
|
}
|
|
734
931
|
|
|
735
932
|
/**
|
|
736
|
-
*
|
|
737
|
-
* @param {
|
|
738
|
-
* @param {
|
|
739
|
-
* @
|
|
933
|
+
* Sets 1 to 100 claims' `external_status`; `parseDone` reads the answer.
|
|
934
|
+
* @param {string} token
|
|
935
|
+
* @param {readonly ClaimUpdate[]} updates
|
|
936
|
+
* @param {Endpoints | null} [endpoints]
|
|
937
|
+
* @returns {HttpRequest}
|
|
740
938
|
*/
|
|
741
|
-
export function
|
|
939
|
+
export function dropsUpdateClaimsRequest(token, updates, endpoints) {
|
|
742
940
|
try {
|
|
743
941
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
744
|
-
const ptr0 = passStringToWasm0(
|
|
942
|
+
const ptr0 = passStringToWasm0(token, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
745
943
|
const len0 = WASM_VECTOR_LEN;
|
|
746
|
-
wasm.
|
|
944
|
+
wasm.dropsUpdateClaimsRequest(retptr, ptr0, len0, addHeapObject(updates), isLikeNone(endpoints) ? 0 : addHeapObject(endpoints));
|
|
747
945
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
748
946
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
749
947
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
@@ -757,17 +955,1054 @@ export function parseAppToken(status, body) {
|
|
|
757
955
|
}
|
|
758
956
|
|
|
759
957
|
/**
|
|
760
|
-
*
|
|
761
|
-
* @param {
|
|
762
|
-
* @
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
958
|
+
* An emote's image URL.
|
|
959
|
+
* @param {string} id
|
|
960
|
+
* @returns {string}
|
|
961
|
+
*/
|
|
962
|
+
export function emoteUrl(id) {
|
|
963
|
+
let deferred3_0;
|
|
964
|
+
let deferred3_1;
|
|
965
|
+
try {
|
|
966
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
967
|
+
const ptr0 = passStringToWasm0(id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
968
|
+
const len0 = WASM_VECTOR_LEN;
|
|
969
|
+
wasm.emoteUrl(retptr, ptr0, len0);
|
|
970
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
971
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
972
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
973
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
974
|
+
var ptr2 = r0;
|
|
975
|
+
var len2 = r1;
|
|
976
|
+
if (r3) {
|
|
977
|
+
ptr2 = 0; len2 = 0;
|
|
978
|
+
throw takeObject(r2);
|
|
979
|
+
}
|
|
980
|
+
deferred3_0 = ptr2;
|
|
981
|
+
deferred3_1 = len2;
|
|
982
|
+
return getStringFromWasm0(ptr2, len2);
|
|
983
|
+
} finally {
|
|
984
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
985
|
+
wasm.__wbindgen_export4(deferred3_0, deferred3_1, 1);
|
|
986
|
+
}
|
|
987
|
+
}
|
|
988
|
+
|
|
989
|
+
/**
|
|
990
|
+
* Recent chat and the pin, by channel id.
|
|
991
|
+
* @param {number} channel_id
|
|
992
|
+
* @param {Endpoints | null} [endpoints]
|
|
993
|
+
* @returns {any}
|
|
994
|
+
*/
|
|
995
|
+
export function historyRequest(channel_id, endpoints) {
|
|
996
|
+
try {
|
|
997
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
998
|
+
wasm.historyRequest(retptr, addHeapObject(channel_id), isLikeNone(endpoints) ? 0 : addHeapObject(endpoints));
|
|
999
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1000
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1001
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1002
|
+
if (r2) {
|
|
1003
|
+
throw takeObject(r1);
|
|
1004
|
+
}
|
|
1005
|
+
return takeObject(r0);
|
|
1006
|
+
} finally {
|
|
1007
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1008
|
+
}
|
|
1009
|
+
}
|
|
1010
|
+
|
|
1011
|
+
/**
|
|
1012
|
+
* The top `top` Kicks gifters (1 to 100; Kick's default 10) of the token's
|
|
1013
|
+
* own channel. A user token with `kicks:read`.
|
|
1014
|
+
* @param {string} token
|
|
1015
|
+
* @param {number | null} [top]
|
|
1016
|
+
* @param {Endpoints | null} [endpoints]
|
|
1017
|
+
* @returns {HttpRequest}
|
|
1018
|
+
*/
|
|
1019
|
+
export function kicksLeaderboardRequest(token, top, endpoints) {
|
|
1020
|
+
try {
|
|
1021
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1022
|
+
const ptr0 = passStringToWasm0(token, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1023
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1024
|
+
wasm.kicksLeaderboardRequest(retptr, ptr0, len0, isLikeNone(top) ? 0 : addHeapObject(top), isLikeNone(endpoints) ? 0 : addHeapObject(endpoints));
|
|
1025
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1026
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1027
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1028
|
+
if (r2) {
|
|
1029
|
+
throw takeObject(r1);
|
|
1030
|
+
}
|
|
1031
|
+
return takeObject(r0);
|
|
1032
|
+
} finally {
|
|
1033
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1034
|
+
}
|
|
1035
|
+
}
|
|
1036
|
+
|
|
1037
|
+
/**
|
|
1038
|
+
* How many streams are live on Kick.
|
|
1039
|
+
* @param {string} token
|
|
1040
|
+
* @param {Endpoints | null} [endpoints]
|
|
1041
|
+
* @returns {HttpRequest}
|
|
1042
|
+
*/
|
|
1043
|
+
export function livestreamStatsRequest(token, endpoints) {
|
|
1044
|
+
try {
|
|
1045
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1046
|
+
const ptr0 = passStringToWasm0(token, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1047
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1048
|
+
wasm.livestreamStatsRequest(retptr, ptr0, len0, isLikeNone(endpoints) ? 0 : addHeapObject(endpoints));
|
|
1049
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1050
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1051
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1052
|
+
if (r2) {
|
|
1053
|
+
throw takeObject(r1);
|
|
1054
|
+
}
|
|
1055
|
+
return takeObject(r0);
|
|
1056
|
+
} finally {
|
|
1057
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1058
|
+
}
|
|
1059
|
+
}
|
|
1060
|
+
|
|
1061
|
+
/**
|
|
1062
|
+
* One page of the streams live now (`/public/v2/livestreams`), in up to 25
|
|
1063
|
+
* categories and 25 languages (none: all). `limit` is 1 to 1000 (Kick's
|
|
1064
|
+
* default 100); `cursor` is the previous page's `next_cursor`. Kick has no
|
|
1065
|
+
* sort: streams come oldest first.
|
|
1066
|
+
* @param {string} token
|
|
1067
|
+
* @param {readonly number[] | null} [category_ids]
|
|
1068
|
+
* @param {readonly string[] | null} [language_codes]
|
|
1069
|
+
* @param {number | null} [limit]
|
|
1070
|
+
* @param {string | null} [cursor]
|
|
1071
|
+
* @param {Endpoints | null} [endpoints]
|
|
1072
|
+
* @returns {any}
|
|
1073
|
+
*/
|
|
1074
|
+
export function livestreamsPageRequest(token, category_ids, language_codes, limit, cursor, endpoints) {
|
|
1075
|
+
try {
|
|
1076
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1077
|
+
const ptr0 = passStringToWasm0(token, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1078
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1079
|
+
var ptr1 = isLikeNone(cursor) ? 0 : passStringToWasm0(cursor, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1080
|
+
var len1 = WASM_VECTOR_LEN;
|
|
1081
|
+
wasm.livestreamsPageRequest(retptr, ptr0, len0, isLikeNone(category_ids) ? 0 : addHeapObject(category_ids), isLikeNone(language_codes) ? 0 : addHeapObject(language_codes), isLikeNone(limit) ? 0 : addHeapObject(limit), ptr1, len1, isLikeNone(endpoints) ? 0 : addHeapObject(endpoints));
|
|
1082
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1083
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1084
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1085
|
+
if (r2) {
|
|
1086
|
+
throw takeObject(r1);
|
|
1087
|
+
}
|
|
1088
|
+
return takeObject(r0);
|
|
1089
|
+
} finally {
|
|
1090
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1091
|
+
}
|
|
1092
|
+
}
|
|
1093
|
+
|
|
1094
|
+
/**
|
|
1095
|
+
* `/public/v1/users/livestreams` for any number of user ids: one request
|
|
1096
|
+
* per 100.
|
|
1097
|
+
* @param {string} token
|
|
1098
|
+
* @param {readonly number[]} user_ids
|
|
1099
|
+
* @param {Endpoints | null} [endpoints]
|
|
1100
|
+
* @returns {any}
|
|
1101
|
+
*/
|
|
1102
|
+
export function livestreamsRequests(token, user_ids, endpoints) {
|
|
1103
|
+
try {
|
|
1104
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1105
|
+
const ptr0 = passStringToWasm0(token, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1106
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1107
|
+
wasm.livestreamsRequests(retptr, ptr0, len0, addHeapObject(user_ids), isLikeNone(endpoints) ? 0 : addHeapObject(endpoints));
|
|
1108
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1109
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1110
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1111
|
+
if (r2) {
|
|
1112
|
+
throw takeObject(r1);
|
|
1113
|
+
}
|
|
1114
|
+
return takeObject(r0);
|
|
1115
|
+
} finally {
|
|
1116
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1117
|
+
}
|
|
1118
|
+
}
|
|
1119
|
+
|
|
1120
|
+
/**
|
|
1121
|
+
* The signed-in viewer's standing on a channel.
|
|
1122
|
+
* @param {string} session
|
|
1123
|
+
* @param {string} channel_slug
|
|
1124
|
+
* @param {Endpoints | null} [endpoints]
|
|
1125
|
+
* @returns {any}
|
|
1126
|
+
*/
|
|
1127
|
+
export function meRequest(session, channel_slug, endpoints) {
|
|
1128
|
+
try {
|
|
1129
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1130
|
+
const ptr0 = passStringToWasm0(session, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1131
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1132
|
+
const ptr1 = passStringToWasm0(channel_slug, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1133
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1134
|
+
wasm.meRequest(retptr, ptr0, len0, ptr1, len1, isLikeNone(endpoints) ? 0 : addHeapObject(endpoints));
|
|
1135
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1136
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1137
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1138
|
+
if (r2) {
|
|
1139
|
+
throw takeObject(r1);
|
|
1140
|
+
}
|
|
1141
|
+
return takeObject(r0);
|
|
1142
|
+
} finally {
|
|
1143
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1144
|
+
}
|
|
1145
|
+
}
|
|
1146
|
+
|
|
1147
|
+
/**
|
|
1148
|
+
* Bans a user for good. Scope `moderation:ban`; `parseDone` reads the answer.
|
|
1149
|
+
* @param {string} token
|
|
1150
|
+
* @param {number} broadcaster_user_id
|
|
1151
|
+
* @param {number} user_id
|
|
1152
|
+
* @param {string | null} [reason]
|
|
1153
|
+
* @param {Endpoints | null} [endpoints]
|
|
1154
|
+
* @returns {HttpRequest}
|
|
1155
|
+
*/
|
|
1156
|
+
export function moderationBanRequest(token, broadcaster_user_id, user_id, reason, endpoints) {
|
|
1157
|
+
try {
|
|
1158
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1159
|
+
const ptr0 = passStringToWasm0(token, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1160
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1161
|
+
var ptr1 = isLikeNone(reason) ? 0 : passStringToWasm0(reason, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1162
|
+
var len1 = WASM_VECTOR_LEN;
|
|
1163
|
+
wasm.moderationBanRequest(retptr, ptr0, len0, addHeapObject(broadcaster_user_id), addHeapObject(user_id), ptr1, len1, isLikeNone(endpoints) ? 0 : addHeapObject(endpoints));
|
|
1164
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1165
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1166
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1167
|
+
if (r2) {
|
|
1168
|
+
throw takeObject(r1);
|
|
1169
|
+
}
|
|
1170
|
+
return takeObject(r0);
|
|
1171
|
+
} finally {
|
|
1172
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1173
|
+
}
|
|
1174
|
+
}
|
|
1175
|
+
|
|
1176
|
+
/**
|
|
1177
|
+
* Times a user out for 1 to 10080 minutes. Scope `moderation:ban`.
|
|
1178
|
+
* @param {string} token
|
|
1179
|
+
* @param {number} broadcaster_user_id
|
|
1180
|
+
* @param {number} user_id
|
|
1181
|
+
* @param {number} minutes
|
|
1182
|
+
* @param {string | null} [reason]
|
|
1183
|
+
* @param {Endpoints | null} [endpoints]
|
|
1184
|
+
* @returns {HttpRequest}
|
|
1185
|
+
*/
|
|
1186
|
+
export function moderationTimeoutRequest(token, broadcaster_user_id, user_id, minutes, reason, endpoints) {
|
|
1187
|
+
try {
|
|
1188
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1189
|
+
const ptr0 = passStringToWasm0(token, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1190
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1191
|
+
var ptr1 = isLikeNone(reason) ? 0 : passStringToWasm0(reason, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1192
|
+
var len1 = WASM_VECTOR_LEN;
|
|
1193
|
+
wasm.moderationTimeoutRequest(retptr, ptr0, len0, addHeapObject(broadcaster_user_id), addHeapObject(user_id), addHeapObject(minutes), ptr1, len1, isLikeNone(endpoints) ? 0 : addHeapObject(endpoints));
|
|
1194
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1195
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1196
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1197
|
+
if (r2) {
|
|
1198
|
+
throw takeObject(r1);
|
|
1199
|
+
}
|
|
1200
|
+
return takeObject(r0);
|
|
1201
|
+
} finally {
|
|
1202
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1203
|
+
}
|
|
1204
|
+
}
|
|
1205
|
+
|
|
1206
|
+
/**
|
|
1207
|
+
* Lifts a ban or a timeout. Scope `moderation:ban`.
|
|
1208
|
+
* @param {string} token
|
|
1209
|
+
* @param {number} broadcaster_user_id
|
|
1210
|
+
* @param {number} user_id
|
|
1211
|
+
* @param {Endpoints | null} [endpoints]
|
|
1212
|
+
* @returns {HttpRequest}
|
|
1213
|
+
*/
|
|
1214
|
+
export function moderationUnbanRequest(token, broadcaster_user_id, user_id, endpoints) {
|
|
1215
|
+
try {
|
|
1216
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1217
|
+
const ptr0 = passStringToWasm0(token, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1218
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1219
|
+
wasm.moderationUnbanRequest(retptr, ptr0, len0, addHeapObject(broadcaster_user_id), addHeapObject(user_id), isLikeNone(endpoints) ? 0 : addHeapObject(endpoints));
|
|
1220
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1221
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1222
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1223
|
+
if (r2) {
|
|
1224
|
+
throw takeObject(r1);
|
|
1225
|
+
}
|
|
1226
|
+
return takeObject(r0);
|
|
1227
|
+
} finally {
|
|
1228
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1229
|
+
}
|
|
1230
|
+
}
|
|
1231
|
+
|
|
1232
|
+
/**
|
|
1233
|
+
* Where to send the user's browser to approve the app. `state` (from
|
|
1234
|
+
* `newState()`) must come back unchanged on the redirect; `verifier` is the
|
|
1235
|
+
* `Pkce`'s.
|
|
1236
|
+
* @param {string} client_id
|
|
1237
|
+
* @param {string} redirect_uri
|
|
1238
|
+
* @param {readonly Scope[]} scopes
|
|
1239
|
+
* @param {string} state
|
|
1240
|
+
* @param {string} verifier
|
|
1241
|
+
* @param {Endpoints | null} [endpoints]
|
|
1242
|
+
* @returns {string}
|
|
1243
|
+
*/
|
|
1244
|
+
export function oauthAuthorizeUrl(client_id, redirect_uri, scopes, state, verifier, endpoints) {
|
|
1245
|
+
let deferred6_0;
|
|
1246
|
+
let deferred6_1;
|
|
1247
|
+
try {
|
|
1248
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1249
|
+
const ptr0 = passStringToWasm0(client_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1250
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1251
|
+
const ptr1 = passStringToWasm0(redirect_uri, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1252
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1253
|
+
const ptr2 = passStringToWasm0(state, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1254
|
+
const len2 = WASM_VECTOR_LEN;
|
|
1255
|
+
const ptr3 = passStringToWasm0(verifier, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1256
|
+
const len3 = WASM_VECTOR_LEN;
|
|
1257
|
+
wasm.oauthAuthorizeUrl(retptr, ptr0, len0, ptr1, len1, addHeapObject(scopes), ptr2, len2, ptr3, len3, isLikeNone(endpoints) ? 0 : addHeapObject(endpoints));
|
|
1258
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1259
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1260
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1261
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
1262
|
+
var ptr5 = r0;
|
|
1263
|
+
var len5 = r1;
|
|
1264
|
+
if (r3) {
|
|
1265
|
+
ptr5 = 0; len5 = 0;
|
|
1266
|
+
throw takeObject(r2);
|
|
1267
|
+
}
|
|
1268
|
+
deferred6_0 = ptr5;
|
|
1269
|
+
deferred6_1 = len5;
|
|
1270
|
+
return getStringFromWasm0(ptr5, len5);
|
|
1271
|
+
} finally {
|
|
1272
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1273
|
+
wasm.__wbindgen_export4(deferred6_0, deferred6_1, 1);
|
|
1274
|
+
}
|
|
1275
|
+
}
|
|
1276
|
+
|
|
1277
|
+
/**
|
|
1278
|
+
* A user token for the `code` on the redirect, with the PKCE verifier.
|
|
1279
|
+
* @param {string} client_id
|
|
1280
|
+
* @param {string} client_secret
|
|
1281
|
+
* @param {string} redirect_uri
|
|
1282
|
+
* @param {string} code
|
|
1283
|
+
* @param {string} code_verifier
|
|
1284
|
+
* @param {Endpoints | null} [endpoints]
|
|
1285
|
+
* @returns {HttpRequest}
|
|
1286
|
+
*/
|
|
1287
|
+
export function oauthCodeRequest(client_id, client_secret, redirect_uri, code, code_verifier, endpoints) {
|
|
1288
|
+
try {
|
|
1289
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1290
|
+
const ptr0 = passStringToWasm0(client_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1291
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1292
|
+
const ptr1 = passStringToWasm0(client_secret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1293
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1294
|
+
const ptr2 = passStringToWasm0(redirect_uri, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1295
|
+
const len2 = WASM_VECTOR_LEN;
|
|
1296
|
+
const ptr3 = passStringToWasm0(code, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1297
|
+
const len3 = WASM_VECTOR_LEN;
|
|
1298
|
+
const ptr4 = passStringToWasm0(code_verifier, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1299
|
+
const len4 = WASM_VECTOR_LEN;
|
|
1300
|
+
wasm.oauthCodeRequest(retptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4, isLikeNone(endpoints) ? 0 : addHeapObject(endpoints));
|
|
1301
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1302
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1303
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1304
|
+
if (r2) {
|
|
1305
|
+
throw takeObject(r1);
|
|
1306
|
+
}
|
|
1307
|
+
return takeObject(r0);
|
|
1308
|
+
} finally {
|
|
1309
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1310
|
+
}
|
|
1311
|
+
}
|
|
1312
|
+
|
|
1313
|
+
/**
|
|
1314
|
+
* Asks Kick about the token it is sent with (a user or an app token).
|
|
1315
|
+
* @param {string} token
|
|
1316
|
+
* @param {Endpoints | null} [endpoints]
|
|
1317
|
+
* @returns {HttpRequest}
|
|
1318
|
+
*/
|
|
1319
|
+
export function oauthIntrospectRequest(token, endpoints) {
|
|
1320
|
+
try {
|
|
1321
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1322
|
+
const ptr0 = passStringToWasm0(token, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1323
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1324
|
+
wasm.oauthIntrospectRequest(retptr, ptr0, len0, isLikeNone(endpoints) ? 0 : addHeapObject(endpoints));
|
|
1325
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1326
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1327
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1328
|
+
if (r2) {
|
|
1329
|
+
throw takeObject(r1);
|
|
1330
|
+
}
|
|
1331
|
+
return takeObject(r0);
|
|
1332
|
+
} finally {
|
|
1333
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1334
|
+
}
|
|
1335
|
+
}
|
|
1336
|
+
|
|
1337
|
+
/**
|
|
1338
|
+
* Reads an `oauthIntrospectRequest` answer.
|
|
1339
|
+
* @param {number} status
|
|
1340
|
+
* @param {string} body
|
|
1341
|
+
* @returns {Introspection}
|
|
1342
|
+
*/
|
|
1343
|
+
export function oauthParseIntrospect(status, body) {
|
|
1344
|
+
try {
|
|
1345
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1346
|
+
const ptr0 = passStringToWasm0(body, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1347
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1348
|
+
wasm.oauthParseIntrospect(retptr, addHeapObject(status), ptr0, len0);
|
|
1349
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1350
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1351
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1352
|
+
if (r2) {
|
|
1353
|
+
throw takeObject(r1);
|
|
1354
|
+
}
|
|
1355
|
+
return takeObject(r0);
|
|
1356
|
+
} finally {
|
|
1357
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1358
|
+
}
|
|
1359
|
+
}
|
|
1360
|
+
|
|
1361
|
+
/**
|
|
1362
|
+
* Whether a revoke worked; throws with `status` if not.
|
|
1363
|
+
* @param {number} status
|
|
1364
|
+
* @param {string} body
|
|
1365
|
+
*/
|
|
1366
|
+
export function oauthParseRevoke(status, body) {
|
|
1367
|
+
try {
|
|
1368
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1369
|
+
const ptr0 = passStringToWasm0(body, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1370
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1371
|
+
wasm.oauthParseRevoke(retptr, addHeapObject(status), ptr0, len0);
|
|
1372
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1373
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1374
|
+
if (r1) {
|
|
1375
|
+
throw takeObject(r0);
|
|
1376
|
+
}
|
|
1377
|
+
} finally {
|
|
1378
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1379
|
+
}
|
|
1380
|
+
}
|
|
1381
|
+
|
|
1382
|
+
/**
|
|
1383
|
+
* Reads an `oauthCodeRequest` or `oauthRefreshRequest` answer.
|
|
1384
|
+
* @param {number} status
|
|
1385
|
+
* @param {string} body
|
|
1386
|
+
* @returns {UserToken}
|
|
1387
|
+
*/
|
|
1388
|
+
export function oauthParseUserToken(status, body) {
|
|
1389
|
+
try {
|
|
1390
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1391
|
+
const ptr0 = passStringToWasm0(body, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1392
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1393
|
+
wasm.oauthParseUserToken(retptr, addHeapObject(status), ptr0, len0);
|
|
1394
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1395
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1396
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1397
|
+
if (r2) {
|
|
1398
|
+
throw takeObject(r1);
|
|
1399
|
+
}
|
|
1400
|
+
return takeObject(r0);
|
|
1401
|
+
} finally {
|
|
1402
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1403
|
+
}
|
|
1404
|
+
}
|
|
1405
|
+
|
|
1406
|
+
/**
|
|
1407
|
+
* A PKCE pair from 32 to 96 bytes drawn from a CSPRNG (`newPkce()` draws
|
|
1408
|
+
* them). The verifier is a secret: keep it, never log it.
|
|
1409
|
+
* @param {Uint8Array} random
|
|
1410
|
+
* @returns {Pkce}
|
|
1411
|
+
*/
|
|
1412
|
+
export function oauthPkce(random) {
|
|
1413
|
+
try {
|
|
1414
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1415
|
+
wasm.oauthPkce(retptr, addHeapObject(random));
|
|
1416
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1417
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1418
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1419
|
+
if (r2) {
|
|
1420
|
+
throw takeObject(r1);
|
|
1421
|
+
}
|
|
1422
|
+
return takeObject(r0);
|
|
1423
|
+
} finally {
|
|
1424
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1425
|
+
}
|
|
1426
|
+
}
|
|
1427
|
+
|
|
1428
|
+
/**
|
|
1429
|
+
* The PKCE pair for a verifier kept from before (43 to 128 characters of
|
|
1430
|
+
* `A-Z a-z 0-9 - . _ ~`).
|
|
1431
|
+
* @param {string} verifier
|
|
1432
|
+
* @returns {Pkce}
|
|
1433
|
+
*/
|
|
1434
|
+
export function oauthPkceFromVerifier(verifier) {
|
|
1435
|
+
try {
|
|
1436
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1437
|
+
const ptr0 = passStringToWasm0(verifier, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1438
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1439
|
+
wasm.oauthPkceFromVerifier(retptr, ptr0, len0);
|
|
1440
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1441
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1442
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1443
|
+
if (r2) {
|
|
1444
|
+
throw takeObject(r1);
|
|
1445
|
+
}
|
|
1446
|
+
return takeObject(r0);
|
|
1447
|
+
} finally {
|
|
1448
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1449
|
+
}
|
|
1450
|
+
}
|
|
1451
|
+
|
|
1452
|
+
/**
|
|
1453
|
+
* A new user token (and refresh token) for a refresh token.
|
|
1454
|
+
* @param {string} client_id
|
|
1455
|
+
* @param {string} client_secret
|
|
1456
|
+
* @param {string} refresh_token
|
|
1457
|
+
* @param {Endpoints | null} [endpoints]
|
|
1458
|
+
* @returns {HttpRequest}
|
|
1459
|
+
*/
|
|
1460
|
+
export function oauthRefreshRequest(client_id, client_secret, refresh_token, endpoints) {
|
|
1461
|
+
try {
|
|
1462
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1463
|
+
const ptr0 = passStringToWasm0(client_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1464
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1465
|
+
const ptr1 = passStringToWasm0(client_secret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1466
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1467
|
+
const ptr2 = passStringToWasm0(refresh_token, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1468
|
+
const len2 = WASM_VECTOR_LEN;
|
|
1469
|
+
wasm.oauthRefreshRequest(retptr, ptr0, len0, ptr1, len1, ptr2, len2, isLikeNone(endpoints) ? 0 : addHeapObject(endpoints));
|
|
1470
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1471
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1472
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1473
|
+
if (r2) {
|
|
1474
|
+
throw takeObject(r1);
|
|
1475
|
+
}
|
|
1476
|
+
return takeObject(r0);
|
|
1477
|
+
} finally {
|
|
1478
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1479
|
+
}
|
|
1480
|
+
}
|
|
1481
|
+
|
|
1482
|
+
/**
|
|
1483
|
+
* Revokes a token. It goes in the URL: keep the URL out of logs.
|
|
1484
|
+
* @param {string} token
|
|
1485
|
+
* @param {TokenTypeHint | null} [token_type_hint]
|
|
1486
|
+
* @param {Endpoints | null} [endpoints]
|
|
1487
|
+
* @returns {HttpRequest}
|
|
1488
|
+
*/
|
|
1489
|
+
export function oauthRevokeRequest(token, token_type_hint, endpoints) {
|
|
1490
|
+
try {
|
|
1491
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1492
|
+
const ptr0 = passStringToWasm0(token, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1493
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1494
|
+
wasm.oauthRevokeRequest(retptr, ptr0, len0, isLikeNone(token_type_hint) ? 0 : addHeapObject(token_type_hint), isLikeNone(endpoints) ? 0 : addHeapObject(endpoints));
|
|
1495
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1496
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1497
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1498
|
+
if (r2) {
|
|
1499
|
+
throw takeObject(r1);
|
|
1500
|
+
}
|
|
1501
|
+
return takeObject(r0);
|
|
1502
|
+
} finally {
|
|
1503
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1504
|
+
}
|
|
1505
|
+
}
|
|
1506
|
+
|
|
1507
|
+
/**
|
|
1508
|
+
* Every scope Kick documents.
|
|
1509
|
+
* @returns {Scope[]}
|
|
1510
|
+
*/
|
|
1511
|
+
export function oauthScopes() {
|
|
1512
|
+
try {
|
|
1513
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1514
|
+
wasm.oauthScopes(retptr);
|
|
1515
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1516
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1517
|
+
var v1 = getArrayJsValueFromWasm0(r0, r1);
|
|
1518
|
+
wasm.__wbindgen_export4(r0, r1 * 4, 4);
|
|
1519
|
+
return v1;
|
|
1520
|
+
} finally {
|
|
1521
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1522
|
+
}
|
|
1523
|
+
}
|
|
1524
|
+
|
|
1525
|
+
/**
|
|
1526
|
+
* Whether an acting call worked; throws with `status` if not.
|
|
1527
|
+
* @param {number} status
|
|
1528
|
+
* @param {string} body
|
|
1529
|
+
*/
|
|
1530
|
+
export function parseAction(status, body) {
|
|
1531
|
+
try {
|
|
1532
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1533
|
+
const ptr0 = passStringToWasm0(body, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1534
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1535
|
+
wasm.parseAction(retptr, addHeapObject(status), ptr0, len0);
|
|
1536
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1537
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1538
|
+
if (r1) {
|
|
1539
|
+
throw takeObject(r0);
|
|
1540
|
+
}
|
|
1541
|
+
} finally {
|
|
1542
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1543
|
+
}
|
|
1544
|
+
}
|
|
1545
|
+
|
|
1546
|
+
/**
|
|
1547
|
+
* Reads an app token answer.
|
|
1548
|
+
* @param {number} status
|
|
1549
|
+
* @param {string} body
|
|
1550
|
+
* @returns {any}
|
|
1551
|
+
*/
|
|
1552
|
+
export function parseAppToken(status, body) {
|
|
1553
|
+
try {
|
|
1554
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1555
|
+
const ptr0 = passStringToWasm0(body, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1556
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1557
|
+
wasm.parseAppToken(retptr, addHeapObject(status), ptr0, len0);
|
|
1558
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1559
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1560
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1561
|
+
if (r2) {
|
|
1562
|
+
throw takeObject(r1);
|
|
1563
|
+
}
|
|
1564
|
+
return takeObject(r0);
|
|
1565
|
+
} finally {
|
|
1566
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1567
|
+
}
|
|
1568
|
+
}
|
|
1569
|
+
|
|
1570
|
+
/**
|
|
1571
|
+
* Reads a `categoriesRequest` answer: `{data, next_cursor}`.
|
|
1572
|
+
* @param {number} status
|
|
1573
|
+
* @param {string} body
|
|
1574
|
+
* @returns {Page<Category>}
|
|
1575
|
+
*/
|
|
1576
|
+
export function parseCategories(status, body) {
|
|
1577
|
+
try {
|
|
1578
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1579
|
+
const ptr0 = passStringToWasm0(body, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1580
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1581
|
+
wasm.parseCategories(retptr, addHeapObject(status), ptr0, len0);
|
|
1582
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1583
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1584
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1585
|
+
if (r2) {
|
|
1586
|
+
throw takeObject(r1);
|
|
1587
|
+
}
|
|
1588
|
+
return takeObject(r0);
|
|
1589
|
+
} finally {
|
|
1590
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1591
|
+
}
|
|
1592
|
+
}
|
|
1593
|
+
|
|
1594
|
+
/**
|
|
1595
|
+
* Reads a website channel answer.
|
|
1596
|
+
* @param {number} status
|
|
1597
|
+
* @param {string} body
|
|
1598
|
+
* @returns {any}
|
|
1599
|
+
*/
|
|
1600
|
+
export function parseChannel(status, body) {
|
|
1601
|
+
try {
|
|
1602
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1603
|
+
const ptr0 = passStringToWasm0(body, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1604
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1605
|
+
wasm.parseChannel(retptr, addHeapObject(status), ptr0, len0);
|
|
1606
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1607
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1608
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1609
|
+
if (r2) {
|
|
1610
|
+
throw takeObject(r1);
|
|
1611
|
+
}
|
|
1612
|
+
return takeObject(r0);
|
|
1613
|
+
} finally {
|
|
1614
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1615
|
+
}
|
|
1616
|
+
}
|
|
1617
|
+
|
|
1618
|
+
/**
|
|
1619
|
+
* Reads a channel user answer.
|
|
1620
|
+
* @param {number} status
|
|
1621
|
+
* @param {string} body
|
|
1622
|
+
* @returns {any}
|
|
1623
|
+
*/
|
|
1624
|
+
export function parseChannelUser(status, body) {
|
|
1625
|
+
try {
|
|
1626
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1627
|
+
const ptr0 = passStringToWasm0(body, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1628
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1629
|
+
wasm.parseChannelUser(retptr, addHeapObject(status), ptr0, len0);
|
|
1630
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1631
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1632
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1633
|
+
if (r2) {
|
|
1634
|
+
throw takeObject(r1);
|
|
1635
|
+
}
|
|
1636
|
+
return takeObject(r0);
|
|
1637
|
+
} finally {
|
|
1638
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1639
|
+
}
|
|
1640
|
+
}
|
|
1641
|
+
|
|
1642
|
+
/**
|
|
1643
|
+
* Reads a `/channels` answer.
|
|
1644
|
+
* @param {number} status
|
|
1645
|
+
* @param {string} body
|
|
1646
|
+
* @returns {any}
|
|
1647
|
+
*/
|
|
1648
|
+
export function parseChannels(status, body) {
|
|
1649
|
+
try {
|
|
1650
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1651
|
+
const ptr0 = passStringToWasm0(body, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1652
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1653
|
+
wasm.parseChannels(retptr, addHeapObject(status), ptr0, len0);
|
|
1654
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1655
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1656
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1657
|
+
if (r2) {
|
|
1658
|
+
throw takeObject(r1);
|
|
1659
|
+
}
|
|
1660
|
+
return takeObject(r0);
|
|
1661
|
+
} finally {
|
|
1662
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1663
|
+
}
|
|
1664
|
+
}
|
|
1665
|
+
|
|
1666
|
+
/**
|
|
1667
|
+
* Reads either connection answer: `[{provider, url}…]`.
|
|
1668
|
+
* @param {number} status
|
|
1669
|
+
* @param {string} body
|
|
1670
|
+
* @returns {any}
|
|
1671
|
+
*/
|
|
1672
|
+
export function parseConnection(status, body) {
|
|
1673
|
+
try {
|
|
1674
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1675
|
+
const ptr0 = passStringToWasm0(body, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1676
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1677
|
+
wasm.parseConnection(retptr, addHeapObject(status), ptr0, len0);
|
|
1678
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1679
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1680
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1681
|
+
if (r2) {
|
|
1682
|
+
throw takeObject(r1);
|
|
1683
|
+
}
|
|
1684
|
+
return takeObject(r0);
|
|
1685
|
+
} finally {
|
|
1686
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1687
|
+
}
|
|
1688
|
+
}
|
|
1689
|
+
|
|
1690
|
+
/**
|
|
1691
|
+
* A message's text and emotes.
|
|
1692
|
+
* @param {string} text
|
|
1693
|
+
* @param {boolean} combine
|
|
1694
|
+
* @returns {any}
|
|
1695
|
+
*/
|
|
1696
|
+
export function parseContent(text, combine) {
|
|
1697
|
+
try {
|
|
1698
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1699
|
+
const ptr0 = passStringToWasm0(text, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1700
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1701
|
+
wasm.parseContent(retptr, ptr0, len0, addHeapObject(combine));
|
|
1702
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1703
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1704
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1705
|
+
if (r2) {
|
|
1706
|
+
throw takeObject(r1);
|
|
1707
|
+
}
|
|
1708
|
+
return takeObject(r0);
|
|
1709
|
+
} finally {
|
|
1710
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1711
|
+
}
|
|
1712
|
+
}
|
|
1713
|
+
|
|
1714
|
+
/**
|
|
1715
|
+
* Whether a user-token call whose answer carries nothing worked (any 2xx);
|
|
1716
|
+
* throws with `status` if not.
|
|
1717
|
+
* @param {number} status
|
|
1718
|
+
* @param {string} body
|
|
1719
|
+
*/
|
|
1720
|
+
export function parseDone(status, body) {
|
|
1721
|
+
try {
|
|
1722
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1723
|
+
const ptr0 = passStringToWasm0(body, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1724
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1725
|
+
wasm.parseDone(retptr, addHeapObject(status), ptr0, len0);
|
|
1726
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1727
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1728
|
+
if (r1) {
|
|
1729
|
+
throw takeObject(r0);
|
|
1730
|
+
}
|
|
1731
|
+
} finally {
|
|
1732
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1733
|
+
}
|
|
1734
|
+
}
|
|
1735
|
+
|
|
1736
|
+
/**
|
|
1737
|
+
* A feed event, typed: `{type: "chat_message", …}`. `data` as Kick sent it.
|
|
1738
|
+
* @param {string} name
|
|
1739
|
+
* @param {any} data
|
|
1740
|
+
* @returns {any}
|
|
1741
|
+
*/
|
|
1742
|
+
export function parseEvent(name, data) {
|
|
1743
|
+
try {
|
|
1744
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1745
|
+
const ptr0 = passStringToWasm0(name, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1746
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1747
|
+
wasm.parseEvent(retptr, ptr0, len0, addHeapObject(data));
|
|
1748
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1749
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1750
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1751
|
+
if (r2) {
|
|
1752
|
+
throw takeObject(r1);
|
|
1753
|
+
}
|
|
1754
|
+
return takeObject(r0);
|
|
1755
|
+
} finally {
|
|
1756
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1757
|
+
}
|
|
1758
|
+
}
|
|
1759
|
+
|
|
1760
|
+
/**
|
|
1761
|
+
* Reads a history answer: `{messages, pinned}`.
|
|
1762
|
+
* @param {number} status
|
|
1763
|
+
* @param {string} body
|
|
1764
|
+
* @returns {any}
|
|
1765
|
+
*/
|
|
1766
|
+
export function parseHistory(status, body) {
|
|
1767
|
+
try {
|
|
1768
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1769
|
+
const ptr0 = passStringToWasm0(body, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1770
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1771
|
+
wasm.parseHistory(retptr, addHeapObject(status), ptr0, len0);
|
|
1772
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1773
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1774
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1775
|
+
if (r2) {
|
|
1776
|
+
throw takeObject(r1);
|
|
1777
|
+
}
|
|
1778
|
+
return takeObject(r0);
|
|
1779
|
+
} finally {
|
|
1780
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1781
|
+
}
|
|
1782
|
+
}
|
|
1783
|
+
|
|
1784
|
+
/**
|
|
1785
|
+
* Reads a `kicksLeaderboardRequest` answer.
|
|
1786
|
+
* @param {number} status
|
|
1787
|
+
* @param {string} body
|
|
1788
|
+
* @returns {KicksLeaderboard}
|
|
1789
|
+
*/
|
|
1790
|
+
export function parseKicksLeaderboard(status, body) {
|
|
1791
|
+
try {
|
|
1792
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1793
|
+
const ptr0 = passStringToWasm0(body, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1794
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1795
|
+
wasm.parseKicksLeaderboard(retptr, addHeapObject(status), ptr0, len0);
|
|
1796
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1797
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1798
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1799
|
+
if (r2) {
|
|
1800
|
+
throw takeObject(r1);
|
|
1801
|
+
}
|
|
1802
|
+
return takeObject(r0);
|
|
1803
|
+
} finally {
|
|
1804
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1805
|
+
}
|
|
1806
|
+
}
|
|
1807
|
+
|
|
1808
|
+
/**
|
|
1809
|
+
* Reads a `livestreamStatsRequest` answer.
|
|
1810
|
+
* @param {number} status
|
|
1811
|
+
* @param {string} body
|
|
1812
|
+
* @returns {LivestreamStats}
|
|
1813
|
+
*/
|
|
1814
|
+
export function parseLivestreamStats(status, body) {
|
|
1815
|
+
try {
|
|
1816
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1817
|
+
const ptr0 = passStringToWasm0(body, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1818
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1819
|
+
wasm.parseLivestreamStats(retptr, addHeapObject(status), ptr0, len0);
|
|
1820
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1821
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1822
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1823
|
+
if (r2) {
|
|
1824
|
+
throw takeObject(r1);
|
|
1825
|
+
}
|
|
1826
|
+
return takeObject(r0);
|
|
1827
|
+
} finally {
|
|
1828
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1829
|
+
}
|
|
1830
|
+
}
|
|
1831
|
+
|
|
1832
|
+
/**
|
|
1833
|
+
* Reads a `livestreamsRequests` answer (or a page's streams alone).
|
|
1834
|
+
* @param {number} status
|
|
1835
|
+
* @param {string} body
|
|
1836
|
+
* @returns {any}
|
|
1837
|
+
*/
|
|
1838
|
+
export function parseLivestreams(status, body) {
|
|
1839
|
+
try {
|
|
1840
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1841
|
+
const ptr0 = passStringToWasm0(body, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1842
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1843
|
+
wasm.parseLivestreams(retptr, addHeapObject(status), ptr0, len0);
|
|
1844
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1845
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1846
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1847
|
+
if (r2) {
|
|
1848
|
+
throw takeObject(r1);
|
|
1849
|
+
}
|
|
1850
|
+
return takeObject(r0);
|
|
1851
|
+
} finally {
|
|
1852
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1853
|
+
}
|
|
1854
|
+
}
|
|
1855
|
+
|
|
1856
|
+
/**
|
|
1857
|
+
* Reads a `livestreamsPageRequest` answer: `{data, next_cursor}`.
|
|
1858
|
+
* @param {number} status
|
|
1859
|
+
* @param {string} body
|
|
1860
|
+
* @returns {any}
|
|
1861
|
+
*/
|
|
1862
|
+
export function parseLivestreamsPage(status, body) {
|
|
1863
|
+
try {
|
|
1864
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1865
|
+
const ptr0 = passStringToWasm0(body, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1866
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1867
|
+
wasm.parseLivestreamsPage(retptr, addHeapObject(status), ptr0, len0);
|
|
1868
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1869
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1870
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1871
|
+
if (r2) {
|
|
1872
|
+
throw takeObject(r1);
|
|
1873
|
+
}
|
|
1874
|
+
return takeObject(r0);
|
|
1875
|
+
} finally {
|
|
1876
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1877
|
+
}
|
|
1878
|
+
}
|
|
1879
|
+
|
|
1880
|
+
/**
|
|
1881
|
+
* Reads a `me` answer.
|
|
1882
|
+
* @param {number} status
|
|
1883
|
+
* @param {string} body
|
|
1884
|
+
* @returns {any}
|
|
1885
|
+
*/
|
|
1886
|
+
export function parseMe(status, body) {
|
|
1887
|
+
try {
|
|
1888
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1889
|
+
const ptr0 = passStringToWasm0(body, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1890
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1891
|
+
wasm.parseMe(retptr, addHeapObject(status), ptr0, len0);
|
|
1892
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1893
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1894
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1895
|
+
if (r2) {
|
|
1896
|
+
throw takeObject(r1);
|
|
1897
|
+
}
|
|
1898
|
+
return takeObject(r0);
|
|
1899
|
+
} finally {
|
|
1900
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1901
|
+
}
|
|
1902
|
+
}
|
|
1903
|
+
|
|
1904
|
+
/**
|
|
1905
|
+
* The PEM from a public key answer.
|
|
1906
|
+
* @param {number} status
|
|
1907
|
+
* @param {string} body
|
|
1908
|
+
* @returns {string}
|
|
1909
|
+
*/
|
|
1910
|
+
export function parsePublicKey(status, body) {
|
|
1911
|
+
let deferred3_0;
|
|
1912
|
+
let deferred3_1;
|
|
1913
|
+
try {
|
|
1914
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1915
|
+
const ptr0 = passStringToWasm0(body, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1916
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1917
|
+
wasm.parsePublicKey(retptr, addHeapObject(status), ptr0, len0);
|
|
1918
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1919
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1920
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1921
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
1922
|
+
var ptr2 = r0;
|
|
1923
|
+
var len2 = r1;
|
|
1924
|
+
if (r3) {
|
|
1925
|
+
ptr2 = 0; len2 = 0;
|
|
1926
|
+
throw takeObject(r2);
|
|
1927
|
+
}
|
|
1928
|
+
deferred3_0 = ptr2;
|
|
1929
|
+
deferred3_1 = len2;
|
|
1930
|
+
return getStringFromWasm0(ptr2, len2);
|
|
1931
|
+
} finally {
|
|
1932
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1933
|
+
wasm.__wbindgen_export4(deferred3_0, deferred3_1, 1);
|
|
1934
|
+
}
|
|
1935
|
+
}
|
|
1936
|
+
|
|
1937
|
+
/**
|
|
1938
|
+
* Reads a subscriptions answer.
|
|
1939
|
+
* @param {number} status
|
|
1940
|
+
* @param {string} body
|
|
1941
|
+
* @returns {any}
|
|
1942
|
+
*/
|
|
1943
|
+
export function parseSubscriptions(status, body) {
|
|
1944
|
+
try {
|
|
1945
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1946
|
+
const ptr0 = passStringToWasm0(body, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1947
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1948
|
+
wasm.parseSubscriptions(retptr, addHeapObject(status), ptr0, len0);
|
|
1949
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1950
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1951
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1952
|
+
if (r2) {
|
|
1953
|
+
throw takeObject(r1);
|
|
1954
|
+
}
|
|
1955
|
+
return takeObject(r0);
|
|
1956
|
+
} finally {
|
|
1957
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1958
|
+
}
|
|
1959
|
+
}
|
|
1960
|
+
|
|
1961
|
+
/**
|
|
1962
|
+
* The token from a token answer.
|
|
1963
|
+
* @param {number} status
|
|
1964
|
+
* @param {string} body
|
|
1965
|
+
* @returns {string}
|
|
1966
|
+
*/
|
|
1967
|
+
export function parseToken(status, body) {
|
|
1968
|
+
let deferred3_0;
|
|
1969
|
+
let deferred3_1;
|
|
1970
|
+
try {
|
|
1971
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1972
|
+
const ptr0 = passStringToWasm0(body, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1973
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1974
|
+
wasm.parseToken(retptr, addHeapObject(status), ptr0, len0);
|
|
1975
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1976
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1977
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1978
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
1979
|
+
var ptr2 = r0;
|
|
1980
|
+
var len2 = r1;
|
|
1981
|
+
if (r3) {
|
|
1982
|
+
ptr2 = 0; len2 = 0;
|
|
1983
|
+
throw takeObject(r2);
|
|
1984
|
+
}
|
|
1985
|
+
deferred3_0 = ptr2;
|
|
1986
|
+
deferred3_1 = len2;
|
|
1987
|
+
return getStringFromWasm0(ptr2, len2);
|
|
1988
|
+
} finally {
|
|
1989
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1990
|
+
wasm.__wbindgen_export4(deferred3_0, deferred3_1, 1);
|
|
1991
|
+
}
|
|
1992
|
+
}
|
|
1993
|
+
|
|
1994
|
+
/**
|
|
1995
|
+
* Reads a `usersRequest` answer.
|
|
1996
|
+
* @param {number} status
|
|
1997
|
+
* @param {string} body
|
|
1998
|
+
* @returns {User[]}
|
|
1999
|
+
*/
|
|
2000
|
+
export function parseUsers(status, body) {
|
|
766
2001
|
try {
|
|
767
2002
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
768
2003
|
const ptr0 = passStringToWasm0(body, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
769
2004
|
const len0 = WASM_VECTOR_LEN;
|
|
770
|
-
wasm.
|
|
2005
|
+
wasm.parseUsers(retptr, addHeapObject(status), ptr0, len0);
|
|
771
2006
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
772
2007
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
773
2008
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
@@ -781,17 +2016,18 @@ export function parseChannel(status, body) {
|
|
|
781
2016
|
}
|
|
782
2017
|
|
|
783
2018
|
/**
|
|
784
|
-
* Reads a
|
|
785
|
-
*
|
|
786
|
-
* @param {string}
|
|
2019
|
+
* Reads a delivery's body by its type header, without checking anything.
|
|
2020
|
+
* Throws when the body is not that type's shape. `body` is text or bytes.
|
|
2021
|
+
* @param {string} event_type
|
|
2022
|
+
* @param {string | Uint8Array | ArrayBuffer} body
|
|
787
2023
|
* @returns {any}
|
|
788
2024
|
*/
|
|
789
|
-
export function
|
|
2025
|
+
export function parseWebhook(event_type, body) {
|
|
790
2026
|
try {
|
|
791
2027
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
792
|
-
const ptr0 = passStringToWasm0(
|
|
2028
|
+
const ptr0 = passStringToWasm0(event_type, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
793
2029
|
const len0 = WASM_VECTOR_LEN;
|
|
794
|
-
wasm.
|
|
2030
|
+
wasm.parseWebhook(retptr, ptr0, len0, addHeapObject(body));
|
|
795
2031
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
796
2032
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
797
2033
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
@@ -805,17 +2041,22 @@ export function parseChannelUser(status, body) {
|
|
|
805
2041
|
}
|
|
806
2042
|
|
|
807
2043
|
/**
|
|
808
|
-
*
|
|
809
|
-
* @param {
|
|
810
|
-
* @param {string}
|
|
2044
|
+
* Pins a message (the feed's data for it, whole) for 1 to 10080 minutes.
|
|
2045
|
+
* @param {string} session
|
|
2046
|
+
* @param {string} channel_slug
|
|
2047
|
+
* @param {any} message
|
|
2048
|
+
* @param {number} minutes
|
|
2049
|
+
* @param {Endpoints | null} [endpoints]
|
|
811
2050
|
* @returns {any}
|
|
812
2051
|
*/
|
|
813
|
-
export function
|
|
2052
|
+
export function pinRequest(session, channel_slug, message, minutes, endpoints) {
|
|
814
2053
|
try {
|
|
815
2054
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
816
|
-
const ptr0 = passStringToWasm0(
|
|
2055
|
+
const ptr0 = passStringToWasm0(session, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
817
2056
|
const len0 = WASM_VECTOR_LEN;
|
|
818
|
-
|
|
2057
|
+
const ptr1 = passStringToWasm0(channel_slug, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
2058
|
+
const len1 = WASM_VECTOR_LEN;
|
|
2059
|
+
wasm.pinRequest(retptr, ptr0, len0, ptr1, len1, addHeapObject(message), addHeapObject(minutes), isLikeNone(endpoints) ? 0 : addHeapObject(endpoints));
|
|
819
2060
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
820
2061
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
821
2062
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
@@ -829,17 +2070,14 @@ export function parseChannels(status, body) {
|
|
|
829
2070
|
}
|
|
830
2071
|
|
|
831
2072
|
/**
|
|
832
|
-
*
|
|
833
|
-
* @param {
|
|
834
|
-
* @param {string} body
|
|
2073
|
+
* The webhook signing key request.
|
|
2074
|
+
* @param {Endpoints | null} [endpoints]
|
|
835
2075
|
* @returns {any}
|
|
836
2076
|
*/
|
|
837
|
-
export function
|
|
2077
|
+
export function publicKeyRequest(endpoints) {
|
|
838
2078
|
try {
|
|
839
2079
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
840
|
-
|
|
841
|
-
const len0 = WASM_VECTOR_LEN;
|
|
842
|
-
wasm.parseConnection(retptr, addHeapObject(status), ptr0, len0);
|
|
2080
|
+
wasm.publicKeyRequest(retptr, isLikeNone(endpoints) ? 0 : addHeapObject(endpoints));
|
|
843
2081
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
844
2082
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
845
2083
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
@@ -853,17 +2091,44 @@ export function parseConnection(status, body) {
|
|
|
853
2091
|
}
|
|
854
2092
|
|
|
855
2093
|
/**
|
|
856
|
-
*
|
|
857
|
-
*
|
|
858
|
-
*
|
|
859
|
-
*
|
|
2094
|
+
* The least to wait, ms, before reconnecting after the socket closed with
|
|
2095
|
+
* this code: 300000 (5 minutes) for Kick's terminal codes (3500-3999 and
|
|
2096
|
+
* 4500-4999: a bad token, a ban, a refused request), then reconnect with a
|
|
2097
|
+
* new client id; 0, the ordinary backoff, for the rest (1006, a network
|
|
2098
|
+
* drop, among them).
|
|
2099
|
+
* @param {number} code
|
|
2100
|
+
* @returns {number}
|
|
860
2101
|
*/
|
|
861
|
-
export function
|
|
2102
|
+
export function retryAfterMs(code) {
|
|
862
2103
|
try {
|
|
863
2104
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
864
|
-
|
|
2105
|
+
wasm.retryAfterMs(retptr, addHeapObject(code));
|
|
2106
|
+
var r0 = getDataViewMemory0().getFloat64(retptr + 8 * 0, true);
|
|
2107
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
2108
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
2109
|
+
if (r3) {
|
|
2110
|
+
throw takeObject(r2);
|
|
2111
|
+
}
|
|
2112
|
+
return r0;
|
|
2113
|
+
} finally {
|
|
2114
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
2115
|
+
}
|
|
2116
|
+
}
|
|
2117
|
+
|
|
2118
|
+
/**
|
|
2119
|
+
* Accepts 1 to 25 pending redemptions; `rewardsParseFailures` reads the
|
|
2120
|
+
* answer.
|
|
2121
|
+
* @param {string} token
|
|
2122
|
+
* @param {readonly string[]} ids
|
|
2123
|
+
* @param {Endpoints | null} [endpoints]
|
|
2124
|
+
* @returns {HttpRequest}
|
|
2125
|
+
*/
|
|
2126
|
+
export function rewardsAcceptRequest(token, ids, endpoints) {
|
|
2127
|
+
try {
|
|
2128
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
2129
|
+
const ptr0 = passStringToWasm0(token, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
865
2130
|
const len0 = WASM_VECTOR_LEN;
|
|
866
|
-
wasm.
|
|
2131
|
+
wasm.rewardsAcceptRequest(retptr, ptr0, len0, addHeapObject(ids), isLikeNone(endpoints) ? 0 : addHeapObject(endpoints));
|
|
867
2132
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
868
2133
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
869
2134
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
@@ -877,17 +2142,18 @@ export function parseContent(text, combine) {
|
|
|
877
2142
|
}
|
|
878
2143
|
|
|
879
2144
|
/**
|
|
880
|
-
*
|
|
881
|
-
* @param {string}
|
|
882
|
-
* @param {
|
|
883
|
-
* @
|
|
2145
|
+
* Creates a reward: `fields` needs `title` and `cost`.
|
|
2146
|
+
* @param {string} token
|
|
2147
|
+
* @param {RewardFields} fields
|
|
2148
|
+
* @param {Endpoints | null} [endpoints]
|
|
2149
|
+
* @returns {HttpRequest}
|
|
884
2150
|
*/
|
|
885
|
-
export function
|
|
2151
|
+
export function rewardsCreateRequest(token, fields, endpoints) {
|
|
886
2152
|
try {
|
|
887
2153
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
888
|
-
const ptr0 = passStringToWasm0(
|
|
2154
|
+
const ptr0 = passStringToWasm0(token, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
889
2155
|
const len0 = WASM_VECTOR_LEN;
|
|
890
|
-
wasm.
|
|
2156
|
+
wasm.rewardsCreateRequest(retptr, ptr0, len0, addHeapObject(fields), isLikeNone(endpoints) ? 0 : addHeapObject(endpoints));
|
|
891
2157
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
892
2158
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
893
2159
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
@@ -901,17 +2167,20 @@ export function parseEvent(name, data) {
|
|
|
901
2167
|
}
|
|
902
2168
|
|
|
903
2169
|
/**
|
|
904
|
-
*
|
|
905
|
-
* @param {
|
|
906
|
-
* @param {string}
|
|
907
|
-
* @
|
|
2170
|
+
* Deletes reward `id`; `parseDone` reads the answer.
|
|
2171
|
+
* @param {string} token
|
|
2172
|
+
* @param {string} id
|
|
2173
|
+
* @param {Endpoints | null} [endpoints]
|
|
2174
|
+
* @returns {HttpRequest}
|
|
908
2175
|
*/
|
|
909
|
-
export function
|
|
2176
|
+
export function rewardsDeleteRequest(token, id, endpoints) {
|
|
910
2177
|
try {
|
|
911
2178
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
912
|
-
const ptr0 = passStringToWasm0(
|
|
2179
|
+
const ptr0 = passStringToWasm0(token, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
913
2180
|
const len0 = WASM_VECTOR_LEN;
|
|
914
|
-
|
|
2181
|
+
const ptr1 = passStringToWasm0(id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
2182
|
+
const len1 = WASM_VECTOR_LEN;
|
|
2183
|
+
wasm.rewardsDeleteRequest(retptr, ptr0, len0, ptr1, len1, isLikeNone(endpoints) ? 0 : addHeapObject(endpoints));
|
|
915
2184
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
916
2185
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
917
2186
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
@@ -925,17 +2194,17 @@ export function parseHistory(status, body) {
|
|
|
925
2194
|
}
|
|
926
2195
|
|
|
927
2196
|
/**
|
|
928
|
-
*
|
|
929
|
-
* @param {
|
|
930
|
-
* @param {
|
|
931
|
-
* @returns {
|
|
2197
|
+
* Every channel-points reward of the token's channel.
|
|
2198
|
+
* @param {string} token
|
|
2199
|
+
* @param {Endpoints | null} [endpoints]
|
|
2200
|
+
* @returns {HttpRequest}
|
|
932
2201
|
*/
|
|
933
|
-
export function
|
|
2202
|
+
export function rewardsListRequest(token, endpoints) {
|
|
934
2203
|
try {
|
|
935
2204
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
936
|
-
const ptr0 = passStringToWasm0(
|
|
2205
|
+
const ptr0 = passStringToWasm0(token, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
937
2206
|
const len0 = WASM_VECTOR_LEN;
|
|
938
|
-
wasm.
|
|
2207
|
+
wasm.rewardsListRequest(retptr, ptr0, len0, isLikeNone(endpoints) ? 0 : addHeapObject(endpoints));
|
|
939
2208
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
940
2209
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
941
2210
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
@@ -949,17 +2218,17 @@ export function parseLivestreams(status, body) {
|
|
|
949
2218
|
}
|
|
950
2219
|
|
|
951
2220
|
/**
|
|
952
|
-
*
|
|
2221
|
+
* The redemptions an accept or reject failed for; empty is all done.
|
|
953
2222
|
* @param {number} status
|
|
954
2223
|
* @param {string} body
|
|
955
|
-
* @returns {
|
|
2224
|
+
* @returns {FailedRedemption[]}
|
|
956
2225
|
*/
|
|
957
|
-
export function
|
|
2226
|
+
export function rewardsParseFailures(status, body) {
|
|
958
2227
|
try {
|
|
959
2228
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
960
2229
|
const ptr0 = passStringToWasm0(body, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
961
2230
|
const len0 = WASM_VECTOR_LEN;
|
|
962
|
-
wasm.
|
|
2231
|
+
wasm.rewardsParseFailures(retptr, addHeapObject(status), ptr0, len0);
|
|
963
2232
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
964
2233
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
965
2234
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
@@ -973,50 +2242,42 @@ export function parseMe(status, body) {
|
|
|
973
2242
|
}
|
|
974
2243
|
|
|
975
2244
|
/**
|
|
976
|
-
*
|
|
2245
|
+
* Reads a `rewardsRedemptionsRequest` or `rewardsRedemptionsByIdsRequest`
|
|
2246
|
+
* answer.
|
|
977
2247
|
* @param {number} status
|
|
978
2248
|
* @param {string} body
|
|
979
|
-
* @returns {
|
|
2249
|
+
* @returns {RedemptionPage}
|
|
980
2250
|
*/
|
|
981
|
-
export function
|
|
982
|
-
let deferred3_0;
|
|
983
|
-
let deferred3_1;
|
|
2251
|
+
export function rewardsParseRedemptions(status, body) {
|
|
984
2252
|
try {
|
|
985
2253
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
986
2254
|
const ptr0 = passStringToWasm0(body, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
987
2255
|
const len0 = WASM_VECTOR_LEN;
|
|
988
|
-
wasm.
|
|
2256
|
+
wasm.rewardsParseRedemptions(retptr, addHeapObject(status), ptr0, len0);
|
|
989
2257
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
990
2258
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
991
2259
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
var len2 = r1;
|
|
995
|
-
if (r3) {
|
|
996
|
-
ptr2 = 0; len2 = 0;
|
|
997
|
-
throw takeObject(r2);
|
|
2260
|
+
if (r2) {
|
|
2261
|
+
throw takeObject(r1);
|
|
998
2262
|
}
|
|
999
|
-
|
|
1000
|
-
deferred3_1 = len2;
|
|
1001
|
-
return getStringFromWasm0(ptr2, len2);
|
|
2263
|
+
return takeObject(r0);
|
|
1002
2264
|
} finally {
|
|
1003
2265
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1004
|
-
wasm.__wbindgen_export4(deferred3_0, deferred3_1, 1);
|
|
1005
2266
|
}
|
|
1006
2267
|
}
|
|
1007
2268
|
|
|
1008
2269
|
/**
|
|
1009
|
-
* Reads a
|
|
2270
|
+
* Reads a `rewardsCreateRequest` or `rewardsUpdateRequest` answer.
|
|
1010
2271
|
* @param {number} status
|
|
1011
2272
|
* @param {string} body
|
|
1012
|
-
* @returns {
|
|
2273
|
+
* @returns {Reward}
|
|
1013
2274
|
*/
|
|
1014
|
-
export function
|
|
2275
|
+
export function rewardsParseReward(status, body) {
|
|
1015
2276
|
try {
|
|
1016
2277
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1017
2278
|
const ptr0 = passStringToWasm0(body, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1018
2279
|
const len0 = WASM_VECTOR_LEN;
|
|
1019
|
-
wasm.
|
|
2280
|
+
wasm.rewardsParseReward(retptr, addHeapObject(status), ptr0, len0);
|
|
1020
2281
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1021
2282
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1022
2283
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
@@ -1030,51 +2291,45 @@ export function parseSubscriptions(status, body) {
|
|
|
1030
2291
|
}
|
|
1031
2292
|
|
|
1032
2293
|
/**
|
|
1033
|
-
*
|
|
2294
|
+
* Reads a `rewardsListRequest` answer.
|
|
1034
2295
|
* @param {number} status
|
|
1035
2296
|
* @param {string} body
|
|
1036
|
-
* @returns {
|
|
2297
|
+
* @returns {Reward[]}
|
|
1037
2298
|
*/
|
|
1038
|
-
export function
|
|
1039
|
-
let deferred3_0;
|
|
1040
|
-
let deferred3_1;
|
|
2299
|
+
export function rewardsParseRewards(status, body) {
|
|
1041
2300
|
try {
|
|
1042
2301
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1043
2302
|
const ptr0 = passStringToWasm0(body, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1044
2303
|
const len0 = WASM_VECTOR_LEN;
|
|
1045
|
-
wasm.
|
|
2304
|
+
wasm.rewardsParseRewards(retptr, addHeapObject(status), ptr0, len0);
|
|
1046
2305
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1047
2306
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1048
2307
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
var len2 = r1;
|
|
1052
|
-
if (r3) {
|
|
1053
|
-
ptr2 = 0; len2 = 0;
|
|
1054
|
-
throw takeObject(r2);
|
|
2308
|
+
if (r2) {
|
|
2309
|
+
throw takeObject(r1);
|
|
1055
2310
|
}
|
|
1056
|
-
|
|
1057
|
-
deferred3_1 = len2;
|
|
1058
|
-
return getStringFromWasm0(ptr2, len2);
|
|
2311
|
+
return takeObject(r0);
|
|
1059
2312
|
} finally {
|
|
1060
2313
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1061
|
-
wasm.__wbindgen_export4(deferred3_0, deferred3_1, 1);
|
|
1062
2314
|
}
|
|
1063
2315
|
}
|
|
1064
2316
|
|
|
1065
2317
|
/**
|
|
1066
|
-
*
|
|
1067
|
-
*
|
|
1068
|
-
* @param {string}
|
|
1069
|
-
* @param {string |
|
|
1070
|
-
* @
|
|
2318
|
+
* Redemptions by id, whatever their status.
|
|
2319
|
+
* @param {string} token
|
|
2320
|
+
* @param {readonly string[]} ids
|
|
2321
|
+
* @param {string | null} [cursor]
|
|
2322
|
+
* @param {Endpoints | null} [endpoints]
|
|
2323
|
+
* @returns {HttpRequest}
|
|
1071
2324
|
*/
|
|
1072
|
-
export function
|
|
2325
|
+
export function rewardsRedemptionsByIdsRequest(token, ids, cursor, endpoints) {
|
|
1073
2326
|
try {
|
|
1074
2327
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1075
|
-
const ptr0 = passStringToWasm0(
|
|
2328
|
+
const ptr0 = passStringToWasm0(token, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1076
2329
|
const len0 = WASM_VECTOR_LEN;
|
|
1077
|
-
|
|
2330
|
+
var ptr1 = isLikeNone(cursor) ? 0 : passStringToWasm0(cursor, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
2331
|
+
var len1 = WASM_VECTOR_LEN;
|
|
2332
|
+
wasm.rewardsRedemptionsByIdsRequest(retptr, ptr0, len0, addHeapObject(ids), ptr1, len1, isLikeNone(endpoints) ? 0 : addHeapObject(endpoints));
|
|
1078
2333
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1079
2334
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1080
2335
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
@@ -1088,22 +2343,25 @@ export function parseWebhook(event_type, body) {
|
|
|
1088
2343
|
}
|
|
1089
2344
|
|
|
1090
2345
|
/**
|
|
1091
|
-
*
|
|
1092
|
-
*
|
|
1093
|
-
* @param {string}
|
|
1094
|
-
* @param {
|
|
1095
|
-
* @param {
|
|
2346
|
+
* Redemptions, grouped by reward: of one reward or all, with one `status`
|
|
2347
|
+
* (Kick's default `'pending'`), from `cursor`.
|
|
2348
|
+
* @param {string} token
|
|
2349
|
+
* @param {string | null} [reward_id]
|
|
2350
|
+
* @param {RedemptionStatus | null} [status]
|
|
2351
|
+
* @param {string | null} [cursor]
|
|
1096
2352
|
* @param {Endpoints | null} [endpoints]
|
|
1097
|
-
* @returns {
|
|
2353
|
+
* @returns {HttpRequest}
|
|
1098
2354
|
*/
|
|
1099
|
-
export function
|
|
2355
|
+
export function rewardsRedemptionsRequest(token, reward_id, status, cursor, endpoints) {
|
|
1100
2356
|
try {
|
|
1101
2357
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1102
|
-
const ptr0 = passStringToWasm0(
|
|
2358
|
+
const ptr0 = passStringToWasm0(token, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1103
2359
|
const len0 = WASM_VECTOR_LEN;
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
2360
|
+
var ptr1 = isLikeNone(reward_id) ? 0 : passStringToWasm0(reward_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
2361
|
+
var len1 = WASM_VECTOR_LEN;
|
|
2362
|
+
var ptr2 = isLikeNone(cursor) ? 0 : passStringToWasm0(cursor, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
2363
|
+
var len2 = WASM_VECTOR_LEN;
|
|
2364
|
+
wasm.rewardsRedemptionsRequest(retptr, ptr0, len0, ptr1, len1, isLikeNone(status) ? 0 : addHeapObject(status), ptr2, len2, isLikeNone(endpoints) ? 0 : addHeapObject(endpoints));
|
|
1107
2365
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1108
2366
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1109
2367
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
@@ -1117,14 +2375,19 @@ export function pinRequest(session, channel_slug, message, minutes, endpoints) {
|
|
|
1117
2375
|
}
|
|
1118
2376
|
|
|
1119
2377
|
/**
|
|
1120
|
-
*
|
|
2378
|
+
* Rejects 1 to 25 pending redemptions; `rewardsParseFailures` reads the
|
|
2379
|
+
* answer.
|
|
2380
|
+
* @param {string} token
|
|
2381
|
+
* @param {readonly string[]} ids
|
|
1121
2382
|
* @param {Endpoints | null} [endpoints]
|
|
1122
|
-
* @returns {
|
|
2383
|
+
* @returns {HttpRequest}
|
|
1123
2384
|
*/
|
|
1124
|
-
export function
|
|
2385
|
+
export function rewardsRejectRequest(token, ids, endpoints) {
|
|
1125
2386
|
try {
|
|
1126
2387
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1127
|
-
|
|
2388
|
+
const ptr0 = passStringToWasm0(token, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
2389
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2390
|
+
wasm.rewardsRejectRequest(retptr, ptr0, len0, addHeapObject(ids), isLikeNone(endpoints) ? 0 : addHeapObject(endpoints));
|
|
1128
2391
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1129
2392
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1130
2393
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
@@ -1138,25 +2401,28 @@ export function publicKeyRequest(endpoints) {
|
|
|
1138
2401
|
}
|
|
1139
2402
|
|
|
1140
2403
|
/**
|
|
1141
|
-
*
|
|
1142
|
-
*
|
|
1143
|
-
*
|
|
1144
|
-
*
|
|
1145
|
-
*
|
|
1146
|
-
* @
|
|
1147
|
-
* @returns {number}
|
|
2404
|
+
* Changes what `fields` sets of reward `id`.
|
|
2405
|
+
* @param {string} token
|
|
2406
|
+
* @param {string} id
|
|
2407
|
+
* @param {RewardFields} fields
|
|
2408
|
+
* @param {Endpoints | null} [endpoints]
|
|
2409
|
+
* @returns {HttpRequest}
|
|
1148
2410
|
*/
|
|
1149
|
-
export function
|
|
2411
|
+
export function rewardsUpdateRequest(token, id, fields, endpoints) {
|
|
1150
2412
|
try {
|
|
1151
2413
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1152
|
-
wasm.
|
|
1153
|
-
|
|
2414
|
+
const ptr0 = passStringToWasm0(token, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
2415
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2416
|
+
const ptr1 = passStringToWasm0(id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
2417
|
+
const len1 = WASM_VECTOR_LEN;
|
|
2418
|
+
wasm.rewardsUpdateRequest(retptr, ptr0, len0, ptr1, len1, addHeapObject(fields), isLikeNone(endpoints) ? 0 : addHeapObject(endpoints));
|
|
2419
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
2420
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1154
2421
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
throw takeObject(r2);
|
|
2422
|
+
if (r2) {
|
|
2423
|
+
throw takeObject(r1);
|
|
1158
2424
|
}
|
|
1159
|
-
return r0;
|
|
2425
|
+
return takeObject(r0);
|
|
1160
2426
|
} finally {
|
|
1161
2427
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1162
2428
|
}
|
|
@@ -1301,38 +2567,6 @@ export function tokenRequest(client_id, endpoints) {
|
|
|
1301
2567
|
}
|
|
1302
2568
|
}
|
|
1303
2569
|
|
|
1304
|
-
/**
|
|
1305
|
-
* The top live streams, overall or in a category or language: 1 to 100
|
|
1306
|
-
* (100 by default). `sort` is `"viewer_count"` (the default) or
|
|
1307
|
-
* `"started_at"`.
|
|
1308
|
-
* @param {string} token
|
|
1309
|
-
* @param {number | null} [category_id]
|
|
1310
|
-
* @param {string | null} [language]
|
|
1311
|
-
* @param {'viewer_count' | 'started_at' | null} [sort]
|
|
1312
|
-
* @param {number | null} [limit]
|
|
1313
|
-
* @param {Endpoints | null} [endpoints]
|
|
1314
|
-
* @returns {any}
|
|
1315
|
-
*/
|
|
1316
|
-
export function topLivestreamsRequest(token, category_id, language, sort, limit, endpoints) {
|
|
1317
|
-
try {
|
|
1318
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1319
|
-
const ptr0 = passStringToWasm0(token, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1320
|
-
const len0 = WASM_VECTOR_LEN;
|
|
1321
|
-
var ptr1 = isLikeNone(language) ? 0 : passStringToWasm0(language, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1322
|
-
var len1 = WASM_VECTOR_LEN;
|
|
1323
|
-
wasm.topLivestreamsRequest(retptr, ptr0, len0, isLikeNone(category_id) ? 0 : addHeapObject(category_id), ptr1, len1, isLikeNone(sort) ? 0 : addHeapObject(sort), isLikeNone(limit) ? 0 : addHeapObject(limit), isLikeNone(endpoints) ? 0 : addHeapObject(endpoints));
|
|
1324
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1325
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1326
|
-
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1327
|
-
if (r2) {
|
|
1328
|
-
throw takeObject(r1);
|
|
1329
|
-
}
|
|
1330
|
-
return takeObject(r0);
|
|
1331
|
-
} finally {
|
|
1332
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1333
|
-
}
|
|
1334
|
-
}
|
|
1335
|
-
|
|
1336
2570
|
/**
|
|
1337
2571
|
* Lifts a ban or timeout.
|
|
1338
2572
|
* @param {string} session
|
|
@@ -1417,6 +2651,31 @@ export function unsubscribeRequests(token, ids, endpoints) {
|
|
|
1417
2651
|
}
|
|
1418
2652
|
}
|
|
1419
2653
|
|
|
2654
|
+
/**
|
|
2655
|
+
* Users by id, up to 50; none, with a user token: the token's own user.
|
|
2656
|
+
* @param {string} token
|
|
2657
|
+
* @param {readonly number[] | null} [user_ids]
|
|
2658
|
+
* @param {Endpoints | null} [endpoints]
|
|
2659
|
+
* @returns {HttpRequest}
|
|
2660
|
+
*/
|
|
2661
|
+
export function usersRequest(token, user_ids, endpoints) {
|
|
2662
|
+
try {
|
|
2663
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
2664
|
+
const ptr0 = passStringToWasm0(token, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
2665
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2666
|
+
wasm.usersRequest(retptr, ptr0, len0, isLikeNone(user_ids) ? 0 : addHeapObject(user_ids), isLikeNone(endpoints) ? 0 : addHeapObject(endpoints));
|
|
2667
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
2668
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
2669
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
2670
|
+
if (r2) {
|
|
2671
|
+
throw takeObject(r1);
|
|
2672
|
+
}
|
|
2673
|
+
return takeObject(r0);
|
|
2674
|
+
} finally {
|
|
2675
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
2676
|
+
}
|
|
2677
|
+
}
|
|
2678
|
+
|
|
1420
2679
|
/**
|
|
1421
2680
|
* Checks a delivery and returns `{headers, event}`, or throws. `headers` as
|
|
1422
2681
|
* `[[name, value]…]`, a fetch `Headers` or an object; `body` the raw body,
|