rotur-sdk 1.0.4 → 1.0.6
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 +341 -147
- package/dist/index.d.ts +341 -147
- package/dist/index.js +47 -30
- package/dist/index.mjs +47 -30
- package/package.json +3 -2
package/dist/index.d.mts
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
declare class ApiError extends Error {
|
|
2
2
|
status: number;
|
|
3
|
-
data:
|
|
4
|
-
constructor(status: number, data:
|
|
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,
|
|
12
|
-
post<T>(path: string, body?:
|
|
13
|
-
patch<T>(path: string, body?:
|
|
14
|
-
del<T>(path: string, body?:
|
|
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
|
|
|
@@ -21,6 +21,9 @@ type Presence = "online" | "idle" | "dnd" | "invisible";
|
|
|
21
21
|
type StandingLevel = "good" | "warning" | "suspended" | "banned";
|
|
22
22
|
type JoinPolicy = "OPEN" | "REQUEST" | "INVITE";
|
|
23
23
|
type TokenPermission = "account:delete" | "account:profile" | "account:settings" | "account:view" | "credits:view" | "credits:manage" | "credits:transfer" | "credits:daily" | "friends:view" | "friends:manage" | "friends:request" | "friends:accept" | "friends:remove" | "posts:view" | "posts:create" | "posts:delete" | "posts:manage" | "posts:like" | "posts:reply" | "posts:repost" | "following:view" | "following:follow" | "following:unfollow" | "files:view" | "files:manage" | "files:delete" | "keys:view" | "keys:manage" | "groups:view" | "groups:manage" | "groups:join" | "groups:leave" | "notifications:view" | "notifications:send" | "gifts:view" | "gifts:create" | "gifts:claim" | "gifts:cancel" | "items:view" | "items:buy" | "items:sell" | "items:manage" | "validators:generate" | "blocked:view" | "blocked:manage" | "tokens:manage" | "cosmetics:view" | "cosmetics:buy" | "cosmetics:equip";
|
|
24
|
+
interface ErrorResponse {
|
|
25
|
+
error: string;
|
|
26
|
+
}
|
|
24
27
|
interface UserProfile {
|
|
25
28
|
username: Username;
|
|
26
29
|
pfp: string;
|
|
@@ -35,7 +38,7 @@ interface UserProfile {
|
|
|
35
38
|
subscription: string;
|
|
36
39
|
max_size: string;
|
|
37
40
|
badges: Badge[];
|
|
38
|
-
theme?: Record<string,
|
|
41
|
+
theme?: Record<string, unknown>;
|
|
39
42
|
private: boolean;
|
|
40
43
|
banned: boolean;
|
|
41
44
|
status?: RoomMember;
|
|
@@ -50,7 +53,7 @@ interface Badge {
|
|
|
50
53
|
icon: string;
|
|
51
54
|
description: string;
|
|
52
55
|
}
|
|
53
|
-
|
|
56
|
+
type Transaction = {
|
|
54
57
|
type: string;
|
|
55
58
|
user: Username;
|
|
56
59
|
amount: number;
|
|
@@ -60,9 +63,7 @@ interface Transaction {
|
|
|
60
63
|
petition_id?: string;
|
|
61
64
|
key_name?: string;
|
|
62
65
|
key_id?: string;
|
|
63
|
-
|
|
64
|
-
gift_code?: string;
|
|
65
|
-
}
|
|
66
|
+
};
|
|
66
67
|
interface NetPost {
|
|
67
68
|
id: string;
|
|
68
69
|
content: string;
|
|
@@ -99,13 +100,13 @@ interface KeySubscription {
|
|
|
99
100
|
active: boolean;
|
|
100
101
|
frequency: number;
|
|
101
102
|
period: string;
|
|
102
|
-
next_billing:
|
|
103
|
+
next_billing: number;
|
|
103
104
|
}
|
|
104
105
|
interface KeyUserData {
|
|
105
106
|
time: number;
|
|
106
107
|
price?: number;
|
|
107
|
-
next_billing?:
|
|
108
|
-
cancel_at?:
|
|
108
|
+
next_billing?: number;
|
|
109
|
+
cancel_at?: number;
|
|
109
110
|
}
|
|
110
111
|
interface KeyPublic {
|
|
111
112
|
key: string;
|
|
@@ -120,7 +121,7 @@ interface NetItem {
|
|
|
120
121
|
selling: boolean;
|
|
121
122
|
author: Username;
|
|
122
123
|
owner: Username;
|
|
123
|
-
private_data?:
|
|
124
|
+
private_data?: unknown;
|
|
124
125
|
created: number;
|
|
125
126
|
transfer_history: NetTransferHistory[];
|
|
126
127
|
total_income: number;
|
|
@@ -274,7 +275,7 @@ interface NotificationEntry {
|
|
|
274
275
|
type: string;
|
|
275
276
|
id: string;
|
|
276
277
|
timestamp: number;
|
|
277
|
-
[key: string]:
|
|
278
|
+
[key: string]: unknown;
|
|
278
279
|
}
|
|
279
280
|
interface NotifyEndpoint {
|
|
280
281
|
device_id: string;
|
|
@@ -442,11 +443,190 @@ interface AdminCosmeticUpdate {
|
|
|
442
443
|
featured?: boolean;
|
|
443
444
|
cosmetic_type?: string;
|
|
444
445
|
}
|
|
445
|
-
|
|
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 = {
|
|
446
626
|
cmd: "ready";
|
|
447
627
|
user_id: UserId;
|
|
448
628
|
username: Username;
|
|
449
|
-
user: Record<string,
|
|
629
|
+
user: Record<string, unknown>;
|
|
450
630
|
} | {
|
|
451
631
|
cmd: "join_ok";
|
|
452
632
|
room: string;
|
|
@@ -479,11 +659,11 @@ type WSMessage = {
|
|
|
479
659
|
user_id: UserId;
|
|
480
660
|
username: Username;
|
|
481
661
|
key: string;
|
|
482
|
-
value:
|
|
662
|
+
value: unknown;
|
|
483
663
|
} | {
|
|
484
664
|
cmd: "key_update";
|
|
485
665
|
key: string;
|
|
486
|
-
value:
|
|
666
|
+
value: unknown;
|
|
487
667
|
} | {
|
|
488
668
|
cmd: "error";
|
|
489
669
|
message: string;
|
|
@@ -495,8 +675,9 @@ type WSMessage = {
|
|
|
495
675
|
rooms: string[];
|
|
496
676
|
};
|
|
497
677
|
|
|
498
|
-
type
|
|
499
|
-
type
|
|
678
|
+
type WSMessage = Record<string, unknown>;
|
|
679
|
+
type Handler = (msg: WSMessage) => void;
|
|
680
|
+
type KeyChangeCallback = (key: string, value: unknown, oldValue: unknown) => void;
|
|
500
681
|
declare class RoturSocket extends EventTarget {
|
|
501
682
|
private url;
|
|
502
683
|
private ws;
|
|
@@ -515,15 +696,15 @@ declare class RoturSocket extends EventTarget {
|
|
|
515
696
|
get userId(): string | null;
|
|
516
697
|
get username(): string | null;
|
|
517
698
|
get joinedRooms(): string[];
|
|
518
|
-
getKey(key: string):
|
|
519
|
-
getAllKeys(): Record<string,
|
|
699
|
+
getKey(key: string): unknown;
|
|
700
|
+
getAllKeys(): Record<string, unknown>;
|
|
520
701
|
onKeyChange(callback: KeyChangeCallback): () => void;
|
|
521
702
|
offKeyChange(callback: KeyChangeCallback): void;
|
|
522
703
|
private notifyKeyChange;
|
|
523
704
|
connect(token: string): Promise<{
|
|
524
705
|
user_id: UserId;
|
|
525
706
|
username: Username;
|
|
526
|
-
user: Record<string,
|
|
707
|
+
user: Record<string, unknown>;
|
|
527
708
|
}>;
|
|
528
709
|
private startHeartbeat;
|
|
529
710
|
private scheduleReconnect;
|
|
@@ -532,7 +713,7 @@ declare class RoturSocket extends EventTarget {
|
|
|
532
713
|
private send;
|
|
533
714
|
on(cmd: string, handler: Handler): () => void;
|
|
534
715
|
off(cmd: string, handler: Handler): void;
|
|
535
|
-
once(cmd: string): Promise<
|
|
716
|
+
once(cmd: string): Promise<WSMessage>;
|
|
536
717
|
join(rooms: string | string[]): void;
|
|
537
718
|
leave(rooms: string | string[]): void;
|
|
538
719
|
listRooms(): Promise<string[]>;
|
|
@@ -595,17 +776,17 @@ declare class Rotur {
|
|
|
595
776
|
connectSocket(): Promise<{
|
|
596
777
|
user_id: string;
|
|
597
778
|
username: string;
|
|
598
|
-
user: Record<string,
|
|
779
|
+
user: Record<string, unknown>;
|
|
599
780
|
}>;
|
|
600
781
|
logout(): void;
|
|
601
782
|
}
|
|
602
783
|
declare abstract class Namespace {
|
|
603
784
|
protected r: Rotur;
|
|
604
785
|
constructor(r: Rotur);
|
|
605
|
-
protected $get<T>(path: string, params?: Record<string,
|
|
606
|
-
protected $post<T>(path: string, body?:
|
|
607
|
-
protected $patch<T>(path: string, body?:
|
|
608
|
-
protected $del<T>(path: string, body?:
|
|
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>;
|
|
609
790
|
}
|
|
610
791
|
declare class ProfilesNamespace extends Namespace {
|
|
611
792
|
get(username: Username, includePosts?: boolean): Promise<UserProfile>;
|
|
@@ -619,47 +800,54 @@ declare class ProfilesNamespace extends Namespace {
|
|
|
619
800
|
getBannerUrl(username: Username, cache?: string): string;
|
|
620
801
|
}
|
|
621
802
|
declare class MeNamespace extends Namespace {
|
|
622
|
-
get(): Promise<Record<string,
|
|
623
|
-
update(key: string, value:
|
|
624
|
-
deleteKey(key: string): Promise<
|
|
625
|
-
deleteAccount(): Promise<
|
|
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>;
|
|
626
807
|
refreshToken(): Promise<{
|
|
627
808
|
token: string;
|
|
628
|
-
}>;
|
|
629
|
-
getKey(key: string):
|
|
630
|
-
getAllKeys(): Record<string,
|
|
631
|
-
onKeyChange(callback: (key: string, value:
|
|
632
|
-
transfer(to: Username, amount: number, note?: string): Promise<
|
|
809
|
+
} | 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>;
|
|
633
814
|
claimDaily(): Promise<{
|
|
634
|
-
|
|
635
|
-
|
|
815
|
+
error: "Daily claim already made";
|
|
816
|
+
wait_time: number;
|
|
817
|
+
wait_hours: string;
|
|
818
|
+
} | {
|
|
819
|
+
response: "Daily claim successful";
|
|
820
|
+
} | ErrorResponse>;
|
|
636
821
|
claimTime(): Promise<{
|
|
637
822
|
wait_time: number;
|
|
638
|
-
}>;
|
|
823
|
+
} | ErrorResponse>;
|
|
639
824
|
badges(): Promise<{
|
|
640
825
|
badge_names: string[];
|
|
641
|
-
}>;
|
|
642
|
-
|
|
643
|
-
message: string;
|
|
644
|
-
}>;
|
|
645
|
-
abilities(): Promise<TokenAbilities>;
|
|
826
|
+
} | ErrorResponse>;
|
|
827
|
+
abilities(): Promise<TokenAbilities | ErrorResponse>;
|
|
646
828
|
blocked(): Promise<{
|
|
647
829
|
blocked: Username[];
|
|
648
|
-
}>;
|
|
649
|
-
block(username: Username): Promise<
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
830
|
+
} | ErrorResponse>;
|
|
831
|
+
block(username: Username): Promise<{
|
|
832
|
+
message: "User blocked";
|
|
833
|
+
} | ErrorResponse>;
|
|
834
|
+
unblock(username: Username): Promise<{
|
|
835
|
+
message: "User unblocked";
|
|
836
|
+
} | ErrorResponse>;
|
|
837
|
+
note(username: Username, content: string): Promise<{
|
|
838
|
+
success: true;
|
|
839
|
+
} | ErrorResponse>;
|
|
840
|
+
deleteNote(username: Username): Promise<{
|
|
841
|
+
success: true;
|
|
842
|
+
} | ErrorResponse>;
|
|
655
843
|
checkAuth(): Promise<CheckAuthResponse>;
|
|
656
844
|
requests(): Promise<{
|
|
657
845
|
requests: Username[];
|
|
658
|
-
}>;
|
|
846
|
+
} | ErrorResponse>;
|
|
659
847
|
outgoing(): Promise<{
|
|
660
848
|
outgoing: Username[];
|
|
661
|
-
}>;
|
|
662
|
-
transactions(): Promise<
|
|
849
|
+
} | ErrorResponse>;
|
|
850
|
+
transactions(): Promise<Transaction[]>;
|
|
663
851
|
subscription(): Promise<{
|
|
664
852
|
active: boolean;
|
|
665
853
|
tier: string;
|
|
@@ -672,13 +860,13 @@ declare class PostsNamespace extends Namespace {
|
|
|
672
860
|
profileOnly?: boolean;
|
|
673
861
|
os?: string;
|
|
674
862
|
}): Promise<NetPost>;
|
|
675
|
-
delete(id: string): Promise<
|
|
676
|
-
like(id: string): Promise<
|
|
677
|
-
unlike(id: string): Promise<
|
|
863
|
+
delete(id: string): Promise<PostDeleteResponse | ErrorResponse>;
|
|
864
|
+
like(id: string): Promise<PostRateResponse | ErrorResponse>;
|
|
865
|
+
unlike(id: string): Promise<PostRateResponse | ErrorResponse>;
|
|
678
866
|
reply(id: string, content: string): Promise<NetReply>;
|
|
679
867
|
repost(id: string): Promise<NetPost>;
|
|
680
|
-
pin(id: string): Promise<
|
|
681
|
-
unpin(id: string): Promise<
|
|
868
|
+
pin(id: string): Promise<PostPinResponse | ErrorResponse>;
|
|
869
|
+
unpin(id: string): Promise<PostPinResponse | ErrorResponse>;
|
|
682
870
|
feed(limit?: number, offset?: number): Promise<NetPost[]>;
|
|
683
871
|
followingFeed(limit?: number): Promise<NetPost[]>;
|
|
684
872
|
top(limit?: number, timePeriod?: number): Promise<NetPost[]>;
|
|
@@ -691,40 +879,54 @@ declare class FriendsNamespace extends Namespace {
|
|
|
691
879
|
}>;
|
|
692
880
|
request(username: Username): Promise<{
|
|
693
881
|
ok: boolean;
|
|
694
|
-
message
|
|
695
|
-
|
|
882
|
+
message: string;
|
|
883
|
+
} | {
|
|
884
|
+
ok: boolean;
|
|
885
|
+
error: string;
|
|
696
886
|
}>;
|
|
697
887
|
accept(username: Username): Promise<{
|
|
698
888
|
ok: boolean;
|
|
699
|
-
message
|
|
700
|
-
|
|
889
|
+
message: string;
|
|
890
|
+
} | {
|
|
891
|
+
ok: boolean;
|
|
892
|
+
error: string;
|
|
701
893
|
}>;
|
|
702
894
|
reject(username: Username): Promise<{
|
|
703
895
|
ok: boolean;
|
|
704
|
-
message
|
|
705
|
-
|
|
896
|
+
message: string;
|
|
897
|
+
} | {
|
|
898
|
+
ok: boolean;
|
|
899
|
+
error: string;
|
|
706
900
|
}>;
|
|
707
901
|
remove(username: Username): Promise<{
|
|
708
902
|
ok: boolean;
|
|
709
|
-
message
|
|
710
|
-
|
|
903
|
+
message: string;
|
|
904
|
+
} | {
|
|
905
|
+
ok: boolean;
|
|
906
|
+
error: string;
|
|
711
907
|
}>;
|
|
712
908
|
cancel(username: Username): Promise<{
|
|
713
909
|
ok: boolean;
|
|
714
|
-
message
|
|
715
|
-
|
|
910
|
+
message: string;
|
|
911
|
+
} | {
|
|
912
|
+
ok: boolean;
|
|
913
|
+
error: string;
|
|
716
914
|
}>;
|
|
717
915
|
}
|
|
718
916
|
declare class FollowingNamespace extends Namespace {
|
|
719
917
|
follow(username: Username): Promise<{
|
|
720
918
|
ok: boolean;
|
|
721
|
-
message
|
|
722
|
-
|
|
919
|
+
message: string;
|
|
920
|
+
} | {
|
|
921
|
+
ok: boolean;
|
|
922
|
+
error: string;
|
|
723
923
|
}>;
|
|
724
924
|
unfollow(username: Username): Promise<{
|
|
725
925
|
ok: boolean;
|
|
726
|
-
message
|
|
727
|
-
|
|
926
|
+
message: string;
|
|
927
|
+
} | {
|
|
928
|
+
ok: boolean;
|
|
929
|
+
error: string;
|
|
728
930
|
}>;
|
|
729
931
|
followers(username: Username): Promise<{
|
|
730
932
|
followers: Username[];
|
|
@@ -743,20 +945,18 @@ declare class KeysNamespace extends Namespace {
|
|
|
743
945
|
subscription?: boolean;
|
|
744
946
|
frequency?: number;
|
|
745
947
|
period?: string;
|
|
746
|
-
}): Promise<
|
|
948
|
+
}): Promise<KeyCreateResponse | ErrorResponse>;
|
|
747
949
|
mine(): Promise<NetKey[]>;
|
|
748
950
|
get(id: string): Promise<KeyPublic>;
|
|
749
|
-
check(username: Username, key: string): Promise<
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
buy(id: string): Promise<any>;
|
|
759
|
-
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>;
|
|
760
960
|
}
|
|
761
961
|
declare class ItemsNamespace extends Namespace {
|
|
762
962
|
create(item: {
|
|
@@ -764,29 +964,29 @@ declare class ItemsNamespace extends Namespace {
|
|
|
764
964
|
description?: string;
|
|
765
965
|
price?: number;
|
|
766
966
|
selling?: boolean;
|
|
767
|
-
data?:
|
|
967
|
+
data?: unknown;
|
|
768
968
|
}): Promise<NetItem>;
|
|
769
969
|
get(name: string): Promise<NetItem>;
|
|
770
970
|
list(username: Username): Promise<NetItem[]>;
|
|
771
971
|
selling(limit?: number): Promise<NetItem[]>;
|
|
772
|
-
buy(name: string): Promise<
|
|
773
|
-
transfer(name: string, username: Username): Promise<
|
|
774
|
-
sell(name: string): Promise<
|
|
775
|
-
stopSelling(name: string): Promise<
|
|
776
|
-
setPrice(name: string, price: number): Promise<
|
|
777
|
-
update(name: string, data: Record<string,
|
|
778
|
-
delete(name: string): Promise<
|
|
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>;
|
|
779
979
|
}
|
|
780
980
|
declare class GiftsNamespace extends Namespace {
|
|
781
981
|
create(amount: number, options?: {
|
|
782
982
|
note?: string;
|
|
783
983
|
expiresInHrs?: number;
|
|
784
|
-
}): Promise<
|
|
984
|
+
}): Promise<GiftCreateResponse | ErrorResponse>;
|
|
785
985
|
get(code: string): Promise<{
|
|
786
986
|
gift: GiftPublic;
|
|
787
987
|
}>;
|
|
788
|
-
claim(code: string): Promise<
|
|
789
|
-
cancel(id: string): Promise<
|
|
988
|
+
claim(code: string): Promise<GiftClaimResponse | ErrorResponse>;
|
|
989
|
+
cancel(id: string): Promise<GiftCancelResponse | ErrorResponse>;
|
|
790
990
|
mine(): Promise<{
|
|
791
991
|
gifts: GiftNet[];
|
|
792
992
|
count: number;
|
|
@@ -812,16 +1012,16 @@ declare class TokensNamespace extends Namespace {
|
|
|
812
1012
|
websites?: string[];
|
|
813
1013
|
}): Promise<SubTokenCreate>;
|
|
814
1014
|
get(id: string): Promise<SubTokenPublic>;
|
|
815
|
-
activity(id: string): Promise<
|
|
1015
|
+
activity(id: string): Promise<TokenActivityResponse | ErrorResponse>;
|
|
816
1016
|
update(id: string, options: {
|
|
817
1017
|
name?: string;
|
|
818
1018
|
permissions?: TokenPermission[];
|
|
819
1019
|
description?: string;
|
|
820
1020
|
websites?: string[];
|
|
821
|
-
}): Promise<SubTokenPublic>;
|
|
822
|
-
rename(id: string, name: string): Promise<
|
|
823
|
-
revoke(id: string): Promise<
|
|
824
|
-
delete(id: string): Promise<
|
|
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>;
|
|
825
1025
|
}
|
|
826
1026
|
declare class GroupsNamespace extends Namespace {
|
|
827
1027
|
mine(): Promise<GroupPublic[]>;
|
|
@@ -834,38 +1034,38 @@ declare class GroupsNamespace extends Namespace {
|
|
|
834
1034
|
joinPolicy?: JoinPolicy;
|
|
835
1035
|
}): Promise<GroupPublic>;
|
|
836
1036
|
get(grouptag: string): Promise<GroupPublic>;
|
|
837
|
-
update(grouptag: string, updates: Record<string,
|
|
838
|
-
delete(grouptag: string): Promise<
|
|
839
|
-
join(grouptag: string): Promise<GroupPublic>;
|
|
840
|
-
leave(grouptag: string): Promise<
|
|
841
|
-
represent(grouptag: string): Promise<
|
|
842
|
-
disrepresent(grouptag: string): Promise<
|
|
843
|
-
report(grouptag: string): Promise<
|
|
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>;
|
|
844
1044
|
announcements(grouptag: string): Promise<GroupAnnouncement[]>;
|
|
845
1045
|
createAnnouncement(grouptag: string, title: string, body: string, options?: {
|
|
846
1046
|
pingMembers?: boolean;
|
|
847
1047
|
}): Promise<GroupAnnouncement>;
|
|
848
|
-
deleteAnnouncement(grouptag: string, id: string): Promise<
|
|
849
|
-
muteAnnouncements(grouptag: string): Promise<
|
|
1048
|
+
deleteAnnouncement(grouptag: string, id: string): Promise<GroupMessageResponse | ErrorResponse>;
|
|
1049
|
+
muteAnnouncements(grouptag: string): Promise<GroupMessageResponse | ErrorResponse>;
|
|
850
1050
|
events(grouptag: string): Promise<GroupEvent[]>;
|
|
851
1051
|
createEvent(grouptag: string, event: Partial<GroupEvent>): Promise<GroupEvent>;
|
|
852
1052
|
tips(grouptag: string): Promise<GroupTip[]>;
|
|
853
|
-
sendTip(grouptag: string, amount: number): Promise<
|
|
1053
|
+
sendTip(grouptag: string, amount: number): Promise<GroupTip | ErrorResponse>;
|
|
854
1054
|
roles(grouptag: string): Promise<GroupRole[]>;
|
|
855
1055
|
createRole(grouptag: string, role: Partial<GroupRole>): Promise<GroupRole>;
|
|
856
1056
|
updateRole(grouptag: string, roleId: string, updates: Partial<GroupRole>): Promise<GroupRole>;
|
|
857
|
-
deleteRole(grouptag: string, roleId: string): Promise<
|
|
1057
|
+
deleteRole(grouptag: string, roleId: string): Promise<GroupMessageResponse | ErrorResponse>;
|
|
858
1058
|
userRoles(grouptag: string, userId: UserId): Promise<GroupRole[]>;
|
|
859
1059
|
userPermissions(grouptag: string, userId: UserId): Promise<string[]>;
|
|
860
1060
|
userBenefits(grouptag: string, userId: UserId): Promise<string[]>;
|
|
861
|
-
assignRole(grouptag: string, userId: UserId, roleId: string): Promise<
|
|
862
|
-
removeRole(grouptag: string, userId: UserId, roleId: string): Promise<
|
|
1061
|
+
assignRole(grouptag: string, userId: UserId, roleId: string): Promise<GroupMessageResponse | ErrorResponse>;
|
|
1062
|
+
removeRole(grouptag: string, userId: UserId, roleId: string): Promise<GroupMessageResponse | ErrorResponse>;
|
|
863
1063
|
}
|
|
864
1064
|
declare class SystemsNamespace extends Namespace {
|
|
865
1065
|
list(): Promise<Record<string, System>>;
|
|
866
1066
|
users(system: string): Promise<Username[]>;
|
|
867
|
-
update(system: string, key: string, value:
|
|
868
|
-
reload(): Promise<
|
|
1067
|
+
update(system: string, key: string, value: unknown): Promise<SystemUpdateResponse | ErrorResponse>;
|
|
1068
|
+
reload(): Promise<SystemUpdateResponse | ErrorResponse>;
|
|
869
1069
|
}
|
|
870
1070
|
declare class StatsNamespace extends Namespace {
|
|
871
1071
|
economy(): Promise<EconomyStats>;
|
|
@@ -910,37 +1110,34 @@ declare class CosmeticsNamespace extends Namespace {
|
|
|
910
1110
|
limit?: number;
|
|
911
1111
|
offset?: number;
|
|
912
1112
|
}): Promise<ShopResponse>;
|
|
913
|
-
get(id: string): Promise<CosmeticCatalogEntryPublic>;
|
|
914
|
-
mine(): Promise<MyCosmeticsResponse>;
|
|
915
|
-
purchase(id: string): Promise<CosmeticPurchaseResult>;
|
|
1113
|
+
get(id: string): Promise<CosmeticCatalogEntryPublic | ErrorResponse>;
|
|
1114
|
+
mine(): Promise<MyCosmeticsResponse | ErrorResponse>;
|
|
1115
|
+
purchase(id: string): Promise<CosmeticPurchaseResult | ErrorResponse>;
|
|
916
1116
|
equip(id: string): Promise<{
|
|
917
1117
|
message: string;
|
|
918
|
-
}>;
|
|
1118
|
+
} | ErrorResponse>;
|
|
919
1119
|
unequip(type: string): Promise<{
|
|
920
1120
|
message: string;
|
|
921
|
-
}>;
|
|
922
|
-
overlays(
|
|
1121
|
+
} | ErrorResponse>;
|
|
1122
|
+
overlays(name: string): Promise<unknown>;
|
|
923
1123
|
}
|
|
924
1124
|
declare class PushNamespace extends Namespace {
|
|
925
1125
|
vapidKeys(): Promise<{
|
|
926
1126
|
public_key: string;
|
|
927
1127
|
subject: string;
|
|
928
1128
|
}>;
|
|
929
|
-
register(endpoint: string, p256dh: string, auth: string, source: string, fingerprint: string): Promise<
|
|
930
|
-
check(source: string, fingerprint: string): Promise<
|
|
931
|
-
registered: boolean;
|
|
932
|
-
device_id?: string;
|
|
933
|
-
}>;
|
|
1129
|
+
register(endpoint: string, p256dh: string, auth: string, source: string, fingerprint: string): Promise<PushRegisterResponse | ErrorResponse>;
|
|
1130
|
+
check(source: string, fingerprint: string): Promise<PushCheckResponse>;
|
|
934
1131
|
endpoints(): Promise<{
|
|
935
1132
|
endpoints: NotifyEndpoint[];
|
|
936
1133
|
count: number;
|
|
937
1134
|
}>;
|
|
938
|
-
deleteDevice(deviceId: string): Promise<
|
|
1135
|
+
deleteDevice(deviceId: string): Promise<PushDeleteDeviceResponse | ErrorResponse>;
|
|
939
1136
|
allowedSenders(): Promise<Record<string, {
|
|
940
1137
|
senders: NotifyAllowedSender[];
|
|
941
1138
|
}>>;
|
|
942
|
-
allowSender(username: Username, source: string): Promise<
|
|
943
|
-
removeSender(username: Username, source: string): Promise<
|
|
1139
|
+
allowSender(username: Username, source: string): Promise<PushAllowSenderResponse | ErrorResponse>;
|
|
1140
|
+
removeSender(username: Username, source: string): Promise<PushAllowSenderResponse | ErrorResponse>;
|
|
944
1141
|
log(): Promise<{
|
|
945
1142
|
log: NotifyLogEntry[];
|
|
946
1143
|
count: number;
|
|
@@ -948,13 +1145,13 @@ declare class PushNamespace extends Namespace {
|
|
|
948
1145
|
send(username: Username, source: string, options?: {
|
|
949
1146
|
title?: string;
|
|
950
1147
|
body?: string;
|
|
951
|
-
data?: Record<string,
|
|
952
|
-
}): Promise<
|
|
1148
|
+
data?: Record<string, unknown>;
|
|
1149
|
+
}): Promise<PushSendResponse | ErrorResponse>;
|
|
953
1150
|
sendMany(users: string[], source: string, options?: {
|
|
954
1151
|
title?: string;
|
|
955
1152
|
body?: string;
|
|
956
|
-
data?: Record<string,
|
|
957
|
-
}): Promise<
|
|
1153
|
+
data?: Record<string, unknown>;
|
|
1154
|
+
}): Promise<PushSendManyResponse | ErrorResponse>;
|
|
958
1155
|
notifiableUsers(source: string): Promise<{
|
|
959
1156
|
source: string;
|
|
960
1157
|
users: Array<{
|
|
@@ -968,15 +1165,12 @@ declare class FilesNamespace extends Namespace {
|
|
|
968
1165
|
all(): Promise<FileEntry[]>;
|
|
969
1166
|
getByUUID(uuid: string): Promise<FileEntry>;
|
|
970
1167
|
getByPath(path: string): Promise<FileEntry>;
|
|
971
|
-
usage(): Promise<
|
|
972
|
-
|
|
973
|
-
max: number;
|
|
974
|
-
}>;
|
|
975
|
-
stats(uuids: string[]): Promise<any>;
|
|
1168
|
+
usage(): Promise<FileUsageResponse>;
|
|
1169
|
+
stats(uuids: string[]): Promise<Record<string, unknown>>;
|
|
976
1170
|
byUUIDs(uuids: string[]): Promise<FileEntry[]>;
|
|
977
|
-
pathIndex(): Promise<
|
|
978
|
-
upload(files: Record<string,
|
|
979
|
-
deleteAll(): Promise<
|
|
1171
|
+
pathIndex(): Promise<Record<string, unknown>>;
|
|
1172
|
+
upload(files: Record<string, unknown>): Promise<Record<string, unknown>>;
|
|
1173
|
+
deleteAll(): Promise<GroupMessageResponse | ErrorResponse>;
|
|
980
1174
|
}
|
|
981
1175
|
declare class StandingNamespace extends Namespace {
|
|
982
1176
|
get(username: Username): Promise<StandingInfo>;
|
|
@@ -1006,4 +1200,4 @@ declare class AuthError extends Error {
|
|
|
1006
1200
|
}
|
|
1007
1201
|
declare function performAuth(options?: AuthOptions): Promise<AuthResult>;
|
|
1008
1202
|
|
|
1009
|
-
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 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 };
|