rotur-sdk 1.0.5 → 1.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -1,17 +1,17 @@
1
1
  declare class ApiError extends Error {
2
2
  status: number;
3
- data: any;
4
- constructor(status: number, data: any);
3
+ data: unknown;
4
+ constructor(status: number, data: unknown);
5
5
  }
6
6
  declare class Http {
7
7
  private baseUrl;
8
8
  private getToken;
9
9
  constructor(getToken: () => string | null);
10
10
  private buildUrl;
11
- get<T>(path: string, params?: Record<string, any>, auth?: boolean): Promise<T>;
12
- post<T>(path: string, body?: any, auth?: boolean): Promise<T>;
13
- patch<T>(path: string, body?: any): Promise<T>;
14
- del<T>(path: string, body?: any): Promise<T>;
11
+ get<T>(path: string, params?: Record<string, unknown>, auth?: boolean): Promise<T>;
12
+ post<T>(path: string, body?: unknown, auth?: boolean): Promise<T>;
13
+ patch<T>(path: string, body?: unknown): Promise<T>;
14
+ del<T>(path: string, body?: unknown): Promise<T>;
15
15
  private handle;
16
16
  }
17
17
 
@@ -38,7 +38,7 @@ interface UserProfile {
38
38
  subscription: string;
39
39
  max_size: string;
40
40
  badges: Badge[];
41
- theme?: Record<string, any>;
41
+ theme?: Record<string, unknown>;
42
42
  private: boolean;
43
43
  banned: boolean;
44
44
  status?: RoomMember;
@@ -100,13 +100,13 @@ interface KeySubscription {
100
100
  active: boolean;
101
101
  frequency: number;
102
102
  period: string;
103
- next_billing: any;
103
+ next_billing: number;
104
104
  }
105
105
  interface KeyUserData {
106
106
  time: number;
107
107
  price?: number;
108
- next_billing?: any;
109
- cancel_at?: any;
108
+ next_billing?: number;
109
+ cancel_at?: number;
110
110
  }
111
111
  interface KeyPublic {
112
112
  key: string;
@@ -121,7 +121,7 @@ interface NetItem {
121
121
  selling: boolean;
122
122
  author: Username;
123
123
  owner: Username;
124
- private_data?: any;
124
+ private_data?: unknown;
125
125
  created: number;
126
126
  transfer_history: NetTransferHistory[];
127
127
  total_income: number;
@@ -275,7 +275,7 @@ interface NotificationEntry {
275
275
  type: string;
276
276
  id: string;
277
277
  timestamp: number;
278
- [key: string]: any;
278
+ [key: string]: unknown;
279
279
  }
280
280
  interface NotifyEndpoint {
281
281
  device_id: string;
@@ -443,11 +443,190 @@ interface AdminCosmeticUpdate {
443
443
  featured?: boolean;
444
444
  cosmetic_type?: string;
445
445
  }
446
- type WSMessage = {
446
+ interface KeyCreateResponse {
447
+ status: string;
448
+ key: string;
449
+ type: string;
450
+ price: number;
451
+ subscription?: KeySubscription;
452
+ }
453
+ interface KeyStatusResponse {
454
+ status: string;
455
+ }
456
+ interface KeyCheckResponse {
457
+ owned: boolean;
458
+ username: Username;
459
+ key: string;
460
+ }
461
+ interface KeyBuyResponse {
462
+ message: string;
463
+ }
464
+ interface KeyCancelSubscriptionResponse {
465
+ status: string;
466
+ cancel_at?: number;
467
+ }
468
+ interface PostDeleteResponse {
469
+ message: string;
470
+ }
471
+ interface PostRateResponse {
472
+ message: string;
473
+ likes: string[];
474
+ }
475
+ interface PostPinResponse {
476
+ message: string;
477
+ }
478
+ interface GiftCreateResponse {
479
+ message: string;
480
+ id: string;
481
+ code: string;
482
+ amount: number;
483
+ tax: number;
484
+ total_paid: number;
485
+ expires_at: number;
486
+ claim_url: string;
487
+ }
488
+ interface GiftClaimResponse {
489
+ message: string;
490
+ amount: number;
491
+ new_balance: number;
492
+ }
493
+ interface GiftCancelResponse {
494
+ message: string;
495
+ refunded: number;
496
+ new_balance: number;
497
+ }
498
+ interface TokenActivityResponse {
499
+ id: string;
500
+ name: string;
501
+ status: "active" | "revoked" | "expired";
502
+ permissions: TokenPermission[];
503
+ created_at: number;
504
+ last_used_at?: number;
505
+ expires_at?: number;
506
+ revoked_at?: number;
507
+ origin?: string;
508
+ description?: string;
509
+ websites?: string[];
510
+ }
511
+ interface TokenRevokeResponse {
512
+ message: string;
513
+ id: string;
514
+ }
515
+ interface TokenDeleteResponse {
516
+ message: string;
517
+ id: string;
518
+ }
519
+ interface TokenRenameResponse {
520
+ message: string;
521
+ id: string;
522
+ name: string;
523
+ }
524
+ interface ItemTransferResponse {
525
+ message: string;
526
+ }
527
+ interface ItemBuyResponse {
528
+ message: string;
529
+ }
530
+ interface ItemSellResponse {
531
+ message: string;
532
+ }
533
+ interface ItemStopSellingResponse {
534
+ message: string;
535
+ }
536
+ interface ItemSetPriceResponse {
537
+ message: string;
538
+ }
539
+ interface ItemDeleteResponse {
540
+ message: string;
541
+ }
542
+ interface FriendActionResponse {
543
+ message: string;
544
+ }
545
+ interface FollowResponse {
546
+ message: string;
547
+ }
548
+ interface GroupMessageResponse {
549
+ message: string;
550
+ }
551
+ interface GroupRepresentResponse {
552
+ message: string;
553
+ }
554
+ interface SystemUpdateResponse {
555
+ message: string;
556
+ }
557
+ interface PushRegisterResponse {
558
+ message: string;
559
+ device_id: string;
560
+ source: string;
561
+ updated: boolean;
562
+ }
563
+ interface PushCheckResponse {
564
+ registered: boolean;
565
+ device_id?: string;
566
+ endpoint?: string;
567
+ source?: string;
568
+ created_at?: number;
569
+ }
570
+ interface PushDeleteDeviceResponse {
571
+ message: string;
572
+ device_id: string;
573
+ }
574
+ interface PushAllowSenderResponse {
575
+ message: string;
576
+ username: Username;
577
+ source: string;
578
+ }
579
+ interface PushSendResponse {
580
+ success: boolean;
581
+ message: string;
582
+ title?: string;
583
+ body?: string;
584
+ data?: Record<string, unknown>;
585
+ }
586
+ interface PushSendManyResponse {
587
+ success: boolean;
588
+ results: Array<{
589
+ username: Username;
590
+ code: number;
591
+ result: PushSendResponse | ErrorResponse;
592
+ }>;
593
+ }
594
+ interface FileUsageResponse {
595
+ used: number;
596
+ max: number;
597
+ }
598
+ interface MeUpdateResponse<T = unknown> {
599
+ message: string;
600
+ username: string;
601
+ key: string;
602
+ value: T;
603
+ }
604
+ interface MeDeleteKeyResponse {
605
+ message: string;
606
+ username: string;
607
+ key: string;
608
+ }
609
+ interface MeTransferResponse {
610
+ message: string;
611
+ from: Username;
612
+ to: Username;
613
+ amount: number;
614
+ debited: number;
615
+ }
616
+ interface MeDeleteAccountResponse {
617
+ message: string;
618
+ }
619
+ interface CheckAuthResponseFull {
620
+ auth: boolean;
621
+ username: string;
622
+ token_type?: "main" | "sub";
623
+ permissions?: TokenPermission[];
624
+ }
625
+ type WSMessage$1 = {
447
626
  cmd: "ready";
448
627
  user_id: UserId;
449
628
  username: Username;
450
- user: Record<string, any>;
629
+ user: Record<string, unknown>;
451
630
  } | {
452
631
  cmd: "join_ok";
453
632
  room: string;
@@ -480,11 +659,11 @@ type WSMessage = {
480
659
  user_id: UserId;
481
660
  username: Username;
482
661
  key: string;
483
- value: any;
662
+ value: unknown;
484
663
  } | {
485
664
  cmd: "key_update";
486
665
  key: string;
487
- value: any;
666
+ value: unknown;
488
667
  } | {
489
668
  cmd: "error";
490
669
  message: string;
@@ -496,8 +675,9 @@ type WSMessage = {
496
675
  rooms: string[];
497
676
  };
498
677
 
499
- type Handler = (msg: any) => void;
500
- type KeyChangeCallback = (key: string, value: any, oldValue: any) => void;
678
+ type WSMessage = Record<string, unknown>;
679
+ type Handler = (msg: WSMessage) => void;
680
+ type KeyChangeCallback = (key: string, value: unknown, oldValue: unknown) => void;
501
681
  declare class RoturSocket extends EventTarget {
502
682
  private url;
503
683
  private ws;
@@ -516,15 +696,15 @@ declare class RoturSocket extends EventTarget {
516
696
  get userId(): string | null;
517
697
  get username(): string | null;
518
698
  get joinedRooms(): string[];
519
- getKey(key: string): any;
520
- getAllKeys(): Record<string, any>;
699
+ getKey(key: string): unknown;
700
+ getAllKeys(): Record<string, unknown>;
521
701
  onKeyChange(callback: KeyChangeCallback): () => void;
522
702
  offKeyChange(callback: KeyChangeCallback): void;
523
703
  private notifyKeyChange;
524
704
  connect(token: string): Promise<{
525
705
  user_id: UserId;
526
706
  username: Username;
527
- user: Record<string, any>;
707
+ user: Record<string, unknown>;
528
708
  }>;
529
709
  private startHeartbeat;
530
710
  private scheduleReconnect;
@@ -533,7 +713,7 @@ declare class RoturSocket extends EventTarget {
533
713
  private send;
534
714
  on(cmd: string, handler: Handler): () => void;
535
715
  off(cmd: string, handler: Handler): void;
536
- once(cmd: string): Promise<any>;
716
+ once(cmd: string): Promise<WSMessage>;
537
717
  join(rooms: string | string[]): void;
538
718
  leave(rooms: string | string[]): void;
539
719
  listRooms(): Promise<string[]>;
@@ -596,17 +776,17 @@ declare class Rotur {
596
776
  connectSocket(): Promise<{
597
777
  user_id: string;
598
778
  username: string;
599
- user: Record<string, any>;
779
+ user: Record<string, unknown>;
600
780
  }>;
601
781
  logout(): void;
602
782
  }
603
783
  declare abstract class Namespace {
604
784
  protected r: Rotur;
605
785
  constructor(r: Rotur);
606
- protected $get<T>(path: string, params?: Record<string, any>, auth?: boolean): Promise<T>;
607
- protected $post<T>(path: string, body?: any, auth?: boolean): Promise<T>;
608
- protected $patch<T>(path: string, body?: any): Promise<T>;
609
- protected $del<T>(path: string, body?: any): Promise<T>;
786
+ protected $get<T>(path: string, params?: Record<string, unknown>, auth?: boolean): Promise<T>;
787
+ protected $post<T>(path: string, body?: unknown, auth?: boolean): Promise<T>;
788
+ protected $patch<T>(path: string, body?: unknown): Promise<T>;
789
+ protected $del<T>(path: string, body?: unknown): Promise<T>;
610
790
  }
611
791
  declare class ProfilesNamespace extends Namespace {
612
792
  get(username: Username, includePosts?: boolean): Promise<UserProfile>;
@@ -620,32 +800,17 @@ declare class ProfilesNamespace extends Namespace {
620
800
  getBannerUrl(username: Username, cache?: string): string;
621
801
  }
622
802
  declare class MeNamespace extends Namespace {
623
- get(): Promise<Record<string, any> | ErrorResponse>;
624
- update<T>(key: string, value: T): Promise<{
625
- message: string;
626
- username: string;
627
- key: string;
628
- value: T;
629
- } | ErrorResponse>;
630
- deleteKey(key: string): Promise<{
631
- message: string;
632
- username: string;
633
- key: string;
634
- } | ErrorResponse>;
635
- deleteAccount(): Promise<any>;
803
+ get(): Promise<Record<string, unknown> | ErrorResponse>;
804
+ update<T>(key: string, value: T): Promise<MeUpdateResponse<T> | ErrorResponse>;
805
+ deleteKey(key: string): Promise<MeDeleteKeyResponse | ErrorResponse>;
806
+ deleteAccount(): Promise<MeDeleteAccountResponse | ErrorResponse>;
636
807
  refreshToken(): Promise<{
637
808
  token: string;
638
809
  } | ErrorResponse>;
639
- getKey(key: string): any;
640
- getAllKeys(): Record<string, any>;
641
- onKeyChange(callback: (key: string, value: any, oldValue: any) => void): () => void;
642
- transfer(to: Username, amount: number, note?: string): Promise<{
643
- message: string;
644
- from: string;
645
- to: string;
646
- amount: number;
647
- debited: number;
648
- } | ErrorResponse>;
810
+ getKey(key: string): unknown;
811
+ getAllKeys(): Record<string, unknown>;
812
+ onKeyChange(callback: (key: string, value: unknown, oldValue: unknown) => void): () => void;
813
+ transfer(to: Username, amount: number, note?: string): Promise<MeTransferResponse | ErrorResponse>;
649
814
  claimDaily(): Promise<{
650
815
  error: "Daily claim already made";
651
816
  wait_time: number;
@@ -695,13 +860,13 @@ declare class PostsNamespace extends Namespace {
695
860
  profileOnly?: boolean;
696
861
  os?: string;
697
862
  }): Promise<NetPost>;
698
- delete(id: string): Promise<any>;
699
- like(id: string): Promise<any>;
700
- unlike(id: string): Promise<any>;
863
+ delete(id: string): Promise<PostDeleteResponse | ErrorResponse>;
864
+ like(id: string): Promise<PostRateResponse | ErrorResponse>;
865
+ unlike(id: string): Promise<PostRateResponse | ErrorResponse>;
701
866
  reply(id: string, content: string): Promise<NetReply>;
702
867
  repost(id: string): Promise<NetPost>;
703
- pin(id: string): Promise<any>;
704
- unpin(id: string): Promise<any>;
868
+ pin(id: string): Promise<PostPinResponse | ErrorResponse>;
869
+ unpin(id: string): Promise<PostPinResponse | ErrorResponse>;
705
870
  feed(limit?: number, offset?: number): Promise<NetPost[]>;
706
871
  followingFeed(limit?: number): Promise<NetPost[]>;
707
872
  top(limit?: number, timePeriod?: number): Promise<NetPost[]>;
@@ -714,40 +879,54 @@ declare class FriendsNamespace extends Namespace {
714
879
  }>;
715
880
  request(username: Username): Promise<{
716
881
  ok: boolean;
717
- message?: string;
718
- error?: string;
882
+ message: string;
883
+ } | {
884
+ ok: boolean;
885
+ error: string;
719
886
  }>;
720
887
  accept(username: Username): Promise<{
721
888
  ok: boolean;
722
- message?: string;
723
- error?: string;
889
+ message: string;
890
+ } | {
891
+ ok: boolean;
892
+ error: string;
724
893
  }>;
725
894
  reject(username: Username): Promise<{
726
895
  ok: boolean;
727
- message?: string;
728
- error?: string;
896
+ message: string;
897
+ } | {
898
+ ok: boolean;
899
+ error: string;
729
900
  }>;
730
901
  remove(username: Username): Promise<{
731
902
  ok: boolean;
732
- message?: string;
733
- error?: string;
903
+ message: string;
904
+ } | {
905
+ ok: boolean;
906
+ error: string;
734
907
  }>;
735
908
  cancel(username: Username): Promise<{
736
909
  ok: boolean;
737
- message?: string;
738
- error?: string;
910
+ message: string;
911
+ } | {
912
+ ok: boolean;
913
+ error: string;
739
914
  }>;
740
915
  }
741
916
  declare class FollowingNamespace extends Namespace {
742
917
  follow(username: Username): Promise<{
743
918
  ok: boolean;
744
- message?: string;
745
- error?: string;
919
+ message: string;
920
+ } | {
921
+ ok: boolean;
922
+ error: string;
746
923
  }>;
747
924
  unfollow(username: Username): Promise<{
748
925
  ok: boolean;
749
- message?: string;
750
- error?: string;
926
+ message: string;
927
+ } | {
928
+ ok: boolean;
929
+ error: string;
751
930
  }>;
752
931
  followers(username: Username): Promise<{
753
932
  followers: Username[];
@@ -766,20 +945,18 @@ declare class KeysNamespace extends Namespace {
766
945
  subscription?: boolean;
767
946
  frequency?: number;
768
947
  period?: string;
769
- }): Promise<any>;
948
+ }): Promise<KeyCreateResponse | ErrorResponse>;
770
949
  mine(): Promise<NetKey[]>;
771
950
  get(id: string): Promise<KeyPublic>;
772
- check(username: Username, key: string): Promise<{
773
- owned: boolean;
774
- }>;
775
- rename(id: string, name: string): Promise<any>;
776
- update(id: string, key: string, data: string): Promise<any>;
777
- revoke(id: string, user: Username): Promise<any>;
778
- delete(id: string): Promise<any>;
779
- addUser(id: string, user: Username): Promise<any>;
780
- removeUser(id: string, user: Username): Promise<any>;
781
- buy(id: string): Promise<any>;
782
- cancel(id: string): Promise<any>;
951
+ check(username: Username, key: string): Promise<KeyCheckResponse>;
952
+ rename(id: string, name: string): Promise<KeyStatusResponse | ErrorResponse>;
953
+ update(id: string, key: string, data: string): Promise<KeyStatusResponse | ErrorResponse>;
954
+ revoke(id: string, user: Username): Promise<KeyStatusResponse | ErrorResponse>;
955
+ delete(id: string): Promise<KeyStatusResponse | ErrorResponse>;
956
+ addUser(id: string, user: Username): Promise<KeyStatusResponse | ErrorResponse>;
957
+ removeUser(id: string, user: Username): Promise<KeyStatusResponse | ErrorResponse>;
958
+ buy(id: string): Promise<KeyBuyResponse | ErrorResponse>;
959
+ cancel(id: string): Promise<KeyCancelSubscriptionResponse | ErrorResponse>;
783
960
  }
784
961
  declare class ItemsNamespace extends Namespace {
785
962
  create(item: {
@@ -787,29 +964,29 @@ declare class ItemsNamespace extends Namespace {
787
964
  description?: string;
788
965
  price?: number;
789
966
  selling?: boolean;
790
- data?: any;
967
+ data?: unknown;
791
968
  }): Promise<NetItem>;
792
969
  get(name: string): Promise<NetItem>;
793
970
  list(username: Username): Promise<NetItem[]>;
794
971
  selling(limit?: number): Promise<NetItem[]>;
795
- buy(name: string): Promise<any>;
796
- transfer(name: string, username: Username): Promise<any>;
797
- sell(name: string): Promise<any>;
798
- stopSelling(name: string): Promise<any>;
799
- setPrice(name: string, price: number): Promise<any>;
800
- update(name: string, data: Record<string, any>): Promise<NetItem>;
801
- delete(name: string): Promise<any>;
972
+ buy(name: string): Promise<ItemBuyResponse | ErrorResponse>;
973
+ transfer(name: string, username: Username): Promise<ItemTransferResponse | ErrorResponse>;
974
+ sell(name: string): Promise<ItemSellResponse | ErrorResponse>;
975
+ stopSelling(name: string): Promise<ItemStopSellingResponse | ErrorResponse>;
976
+ setPrice(name: string, price: number): Promise<ItemSetPriceResponse | ErrorResponse>;
977
+ update(name: string, data: Record<string, unknown>): Promise<NetItem>;
978
+ delete(name: string): Promise<ItemDeleteResponse | ErrorResponse>;
802
979
  }
803
980
  declare class GiftsNamespace extends Namespace {
804
981
  create(amount: number, options?: {
805
982
  note?: string;
806
983
  expiresInHrs?: number;
807
- }): Promise<any>;
984
+ }): Promise<GiftCreateResponse | ErrorResponse>;
808
985
  get(code: string): Promise<{
809
986
  gift: GiftPublic;
810
987
  }>;
811
- claim(code: string): Promise<any>;
812
- cancel(id: string): Promise<any>;
988
+ claim(code: string): Promise<GiftClaimResponse | ErrorResponse>;
989
+ cancel(id: string): Promise<GiftCancelResponse | ErrorResponse>;
813
990
  mine(): Promise<{
814
991
  gifts: GiftNet[];
815
992
  count: number;
@@ -835,16 +1012,16 @@ declare class TokensNamespace extends Namespace {
835
1012
  websites?: string[];
836
1013
  }): Promise<SubTokenCreate>;
837
1014
  get(id: string): Promise<SubTokenPublic>;
838
- activity(id: string): Promise<any>;
1015
+ activity(id: string): Promise<TokenActivityResponse | ErrorResponse>;
839
1016
  update(id: string, options: {
840
1017
  name?: string;
841
1018
  permissions?: TokenPermission[];
842
1019
  description?: string;
843
1020
  websites?: string[];
844
- }): Promise<SubTokenPublic>;
845
- rename(id: string, name: string): Promise<any>;
846
- revoke(id: string): Promise<any>;
847
- delete(id: string): Promise<any>;
1021
+ }): Promise<SubTokenPublic | ErrorResponse>;
1022
+ rename(id: string, name: string): Promise<TokenRenameResponse | ErrorResponse>;
1023
+ revoke(id: string): Promise<TokenRevokeResponse | ErrorResponse>;
1024
+ delete(id: string): Promise<TokenDeleteResponse | ErrorResponse>;
848
1025
  }
849
1026
  declare class GroupsNamespace extends Namespace {
850
1027
  mine(): Promise<GroupPublic[]>;
@@ -857,38 +1034,38 @@ declare class GroupsNamespace extends Namespace {
857
1034
  joinPolicy?: JoinPolicy;
858
1035
  }): Promise<GroupPublic>;
859
1036
  get(grouptag: string): Promise<GroupPublic>;
860
- update(grouptag: string, updates: Record<string, any>): Promise<GroupPublic>;
861
- delete(grouptag: string): Promise<any>;
862
- join(grouptag: string): Promise<GroupPublic>;
863
- leave(grouptag: string): Promise<any>;
864
- represent(grouptag: string): Promise<any>;
865
- disrepresent(grouptag: string): Promise<any>;
866
- report(grouptag: string): Promise<any>;
1037
+ update(grouptag: string, updates: Record<string, unknown>): Promise<GroupPublic | ErrorResponse>;
1038
+ delete(grouptag: string): Promise<GroupMessageResponse | ErrorResponse>;
1039
+ join(grouptag: string): Promise<GroupPublic | ErrorResponse>;
1040
+ leave(grouptag: string): Promise<GroupPublic | ErrorResponse>;
1041
+ represent(grouptag: string): Promise<GroupRepresentResponse | ErrorResponse>;
1042
+ disrepresent(grouptag: string): Promise<GroupRepresentResponse | ErrorResponse>;
1043
+ report(grouptag: string): Promise<GroupMessageResponse | ErrorResponse>;
867
1044
  announcements(grouptag: string): Promise<GroupAnnouncement[]>;
868
1045
  createAnnouncement(grouptag: string, title: string, body: string, options?: {
869
1046
  pingMembers?: boolean;
870
1047
  }): Promise<GroupAnnouncement>;
871
- deleteAnnouncement(grouptag: string, id: string): Promise<any>;
872
- muteAnnouncements(grouptag: string): Promise<any>;
1048
+ deleteAnnouncement(grouptag: string, id: string): Promise<GroupMessageResponse | ErrorResponse>;
1049
+ muteAnnouncements(grouptag: string): Promise<GroupMessageResponse | ErrorResponse>;
873
1050
  events(grouptag: string): Promise<GroupEvent[]>;
874
1051
  createEvent(grouptag: string, event: Partial<GroupEvent>): Promise<GroupEvent>;
875
1052
  tips(grouptag: string): Promise<GroupTip[]>;
876
- sendTip(grouptag: string, amount: number): Promise<any>;
1053
+ sendTip(grouptag: string, amount: number): Promise<GroupTip | ErrorResponse>;
877
1054
  roles(grouptag: string): Promise<GroupRole[]>;
878
1055
  createRole(grouptag: string, role: Partial<GroupRole>): Promise<GroupRole>;
879
1056
  updateRole(grouptag: string, roleId: string, updates: Partial<GroupRole>): Promise<GroupRole>;
880
- deleteRole(grouptag: string, roleId: string): Promise<any>;
1057
+ deleteRole(grouptag: string, roleId: string): Promise<GroupMessageResponse | ErrorResponse>;
881
1058
  userRoles(grouptag: string, userId: UserId): Promise<GroupRole[]>;
882
1059
  userPermissions(grouptag: string, userId: UserId): Promise<string[]>;
883
1060
  userBenefits(grouptag: string, userId: UserId): Promise<string[]>;
884
- assignRole(grouptag: string, userId: UserId, roleId: string): Promise<any>;
885
- removeRole(grouptag: string, userId: UserId, roleId: string): Promise<any>;
1061
+ assignRole(grouptag: string, userId: UserId, roleId: string): Promise<GroupMessageResponse | ErrorResponse>;
1062
+ removeRole(grouptag: string, userId: UserId, roleId: string): Promise<GroupMessageResponse | ErrorResponse>;
886
1063
  }
887
1064
  declare class SystemsNamespace extends Namespace {
888
1065
  list(): Promise<Record<string, System>>;
889
1066
  users(system: string): Promise<Username[]>;
890
- update(system: string, key: string, value: any): Promise<any>;
891
- reload(): Promise<any>;
1067
+ update(system: string, key: string, value: unknown): Promise<SystemUpdateResponse | ErrorResponse>;
1068
+ reload(): Promise<SystemUpdateResponse | ErrorResponse>;
892
1069
  }
893
1070
  declare class StatsNamespace extends Namespace {
894
1071
  economy(): Promise<EconomyStats>;
@@ -942,28 +1119,25 @@ declare class CosmeticsNamespace extends Namespace {
942
1119
  unequip(type: string): Promise<{
943
1120
  message: string;
944
1121
  } | ErrorResponse>;
945
- overlays(name: string): Promise<Response>;
1122
+ overlays(name: string): Promise<unknown>;
946
1123
  }
947
1124
  declare class PushNamespace extends Namespace {
948
1125
  vapidKeys(): Promise<{
949
1126
  public_key: string;
950
1127
  subject: string;
951
1128
  }>;
952
- register(endpoint: string, p256dh: string, auth: string, source: string, fingerprint: string): Promise<any>;
953
- check(source: string, fingerprint: string): Promise<{
954
- registered: boolean;
955
- device_id?: string;
956
- }>;
1129
+ register(endpoint: string, p256dh: string, auth: string, source: string, fingerprint: string): Promise<PushRegisterResponse | ErrorResponse>;
1130
+ check(source: string, fingerprint: string): Promise<PushCheckResponse>;
957
1131
  endpoints(): Promise<{
958
1132
  endpoints: NotifyEndpoint[];
959
1133
  count: number;
960
1134
  }>;
961
- deleteDevice(deviceId: string): Promise<any>;
1135
+ deleteDevice(deviceId: string): Promise<PushDeleteDeviceResponse | ErrorResponse>;
962
1136
  allowedSenders(): Promise<Record<string, {
963
1137
  senders: NotifyAllowedSender[];
964
1138
  }>>;
965
- allowSender(username: Username, source: string): Promise<any>;
966
- removeSender(username: Username, source: string): Promise<any>;
1139
+ allowSender(username: Username, source: string): Promise<PushAllowSenderResponse | ErrorResponse>;
1140
+ removeSender(username: Username, source: string): Promise<PushAllowSenderResponse | ErrorResponse>;
967
1141
  log(): Promise<{
968
1142
  log: NotifyLogEntry[];
969
1143
  count: number;
@@ -971,13 +1145,13 @@ declare class PushNamespace extends Namespace {
971
1145
  send(username: Username, source: string, options?: {
972
1146
  title?: string;
973
1147
  body?: string;
974
- data?: Record<string, any>;
975
- }): Promise<any>;
1148
+ data?: Record<string, unknown>;
1149
+ }): Promise<PushSendResponse | ErrorResponse>;
976
1150
  sendMany(users: string[], source: string, options?: {
977
1151
  title?: string;
978
1152
  body?: string;
979
- data?: Record<string, any>;
980
- }): Promise<any>;
1153
+ data?: Record<string, unknown>;
1154
+ }): Promise<PushSendManyResponse | ErrorResponse>;
981
1155
  notifiableUsers(source: string): Promise<{
982
1156
  source: string;
983
1157
  users: Array<{
@@ -991,15 +1165,12 @@ declare class FilesNamespace extends Namespace {
991
1165
  all(): Promise<FileEntry[]>;
992
1166
  getByUUID(uuid: string): Promise<FileEntry>;
993
1167
  getByPath(path: string): Promise<FileEntry>;
994
- usage(): Promise<{
995
- used: number;
996
- max: number;
997
- }>;
998
- stats(uuids: string[]): Promise<any>;
1168
+ usage(): Promise<FileUsageResponse>;
1169
+ stats(uuids: string[]): Promise<Record<string, unknown>>;
999
1170
  byUUIDs(uuids: string[]): Promise<FileEntry[]>;
1000
- pathIndex(): Promise<any>;
1001
- upload(files: Record<string, any>): Promise<any>;
1002
- deleteAll(): Promise<any>;
1171
+ pathIndex(): Promise<Record<string, unknown>>;
1172
+ upload(files: Record<string, unknown>): Promise<Record<string, unknown>>;
1173
+ deleteAll(): Promise<GroupMessageResponse | ErrorResponse>;
1003
1174
  }
1004
1175
  declare class StandingNamespace extends Namespace {
1005
1176
  get(username: Username): Promise<StandingInfo>;
@@ -1029,4 +1200,4 @@ declare class AuthError extends Error {
1029
1200
  }
1030
1201
  declare function performAuth(options?: AuthOptions): Promise<AuthResult>;
1031
1202
 
1032
- export { type Activity, type ActivityApplication, type ActivityMedia, type AdminCosmeticCreate, type AdminCosmeticUpdate, ApiError, AuthError, type AuthOptions, type AuthResult, type Badge, type CheckAuthResponse, type CheckBannedResponse, type CosmeticCatalogEntryPublic, type CosmeticItem, type CosmeticPurchaseResult, type EconomyStats, type ErrorResponse, type EscrowReleaseResult, type EscrowTransferResult, type ExistsResponse, type FileEntry, type GiftNet, type GiftPublic, type GroupAnnouncement, type GroupEvent, type GroupPublic, type GroupRole, type GroupTip, type JoinPolicy, type KeyPublic, type KeySubscription, type KeyUserData, type LimitsResponse, type MyCosmeticsResponse, type NetItem, type NetKey, type NetPost, type NetReply, type NetTransferHistory, type NotificationEntry, type NotifyAllowedSender, type NotifyEndpoint, type NotifyLogEntry, type PermissionGroup, type Presence, type RoomMember, Rotur, RoturSocket, type ShopResponse, type StandingHistoryEntry, type StandingInfo, type StandingLevel, type SubTokenCreate, type SubTokenPublic, type System, type TokenAbilities, type TokenPermission, type Transaction, type UserId, type UserProfile, type UserStats, type UserStatusResponse, type Username, type ValidatorGenerateResult, type ValidatorResult, type WSMessage, performAuth };
1203
+ export { type Activity, type ActivityApplication, type ActivityMedia, type AdminCosmeticCreate, type AdminCosmeticUpdate, ApiError, AuthError, type AuthOptions, type AuthResult, type Badge, type CheckAuthResponse, type CheckAuthResponseFull, type CheckBannedResponse, type CosmeticCatalogEntryPublic, type CosmeticItem, type CosmeticPurchaseResult, type EconomyStats, type ErrorResponse, type EscrowReleaseResult, type EscrowTransferResult, type ExistsResponse, type FileEntry, type FileUsageResponse, type FollowResponse, type FriendActionResponse, type GiftCancelResponse, type GiftClaimResponse, type GiftCreateResponse, type GiftNet, type GiftPublic, type GroupAnnouncement, type GroupEvent, type GroupMessageResponse, type GroupPublic, type GroupRepresentResponse, type GroupRole, type GroupTip, type ItemBuyResponse, type ItemDeleteResponse, type ItemSellResponse, type ItemSetPriceResponse, type ItemStopSellingResponse, type ItemTransferResponse, type JoinPolicy, type KeyBuyResponse, type KeyCancelSubscriptionResponse, type KeyCheckResponse, type KeyCreateResponse, type KeyPublic, type KeyStatusResponse, type KeySubscription, type KeyUserData, type LimitsResponse, type MeDeleteAccountResponse, type MeDeleteKeyResponse, type MeTransferResponse, type MeUpdateResponse, type MyCosmeticsResponse, type NetItem, type NetKey, type NetPost, type NetReply, type NetTransferHistory, type NotificationEntry, type NotifyAllowedSender, type NotifyEndpoint, type NotifyLogEntry, type PermissionGroup, type PostDeleteResponse, type PostPinResponse, type PostRateResponse, type Presence, type PushAllowSenderResponse, type PushCheckResponse, type PushDeleteDeviceResponse, type PushRegisterResponse, type PushSendManyResponse, type PushSendResponse, type RoomMember, Rotur, RoturSocket, type ShopResponse, type StandingHistoryEntry, type StandingInfo, type StandingLevel, type SubTokenCreate, type SubTokenPublic, type System, type SystemUpdateResponse, type TokenAbilities, type TokenActivityResponse, type TokenDeleteResponse, type TokenPermission, type TokenRenameResponse, type TokenRevokeResponse, type Transaction, type UserId, type UserProfile, type UserStats, type UserStatusResponse, type Username, type ValidatorGenerateResult, type ValidatorResult, type WSMessage$1 as WSMessage, performAuth };