@borealise/api 1.1.11 → 2.0.0-alpha.10
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 +286 -205
- package/dist/index.d.mts +215 -78
- package/dist/index.d.ts +215 -78
- package/dist/index.js +214 -545
- package/dist/index.mjs +202 -526
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -23,14 +23,10 @@ declare class ApiError extends Error {
|
|
|
23
23
|
constructor(message: string, status?: number, code?: string, response?: BackendErrorResponse);
|
|
24
24
|
}
|
|
25
25
|
declare class Api {
|
|
26
|
-
private static instance;
|
|
27
26
|
private readonly axios;
|
|
28
27
|
private readonly logger;
|
|
29
28
|
private readonly config;
|
|
30
|
-
|
|
31
|
-
static getInstance(config?: ApiConfig): Api;
|
|
32
|
-
/** Reset the singleton (useful for testing or re-initializing with a new config) */
|
|
33
|
-
static reset(): void;
|
|
29
|
+
constructor(config: ApiConfig);
|
|
34
30
|
private setupInterceptors;
|
|
35
31
|
private parseError;
|
|
36
32
|
setAuthToken(token: string | null): void;
|
|
@@ -44,11 +40,12 @@ declare class Api {
|
|
|
44
40
|
private wrapResponse;
|
|
45
41
|
get axiosInstance(): AxiosInstance;
|
|
46
42
|
}
|
|
43
|
+
declare const createApi: (config: ApiConfig) => Api;
|
|
47
44
|
|
|
48
45
|
declare class Logger {
|
|
49
46
|
private readonly name;
|
|
50
47
|
private enabled;
|
|
51
|
-
|
|
48
|
+
constructor(name: string, enabled?: boolean);
|
|
52
49
|
static create(name: string): Logger;
|
|
53
50
|
enable(): void;
|
|
54
51
|
disable(): void;
|
|
@@ -59,39 +56,6 @@ declare class Logger {
|
|
|
59
56
|
error(message: string, ...args: unknown[]): void;
|
|
60
57
|
}
|
|
61
58
|
|
|
62
|
-
interface PaginatedResponse<T> {
|
|
63
|
-
data: T[];
|
|
64
|
-
meta: {
|
|
65
|
-
total: number;
|
|
66
|
-
page: number;
|
|
67
|
-
perPage: number;
|
|
68
|
-
lastPage: number;
|
|
69
|
-
};
|
|
70
|
-
}
|
|
71
|
-
interface ResourceOptions {
|
|
72
|
-
params?: Record<string, unknown>;
|
|
73
|
-
headers?: Record<string, string>;
|
|
74
|
-
}
|
|
75
|
-
declare abstract class ApiResource<T = unknown> {
|
|
76
|
-
private _logger;
|
|
77
|
-
protected abstract readonly endpoint: string;
|
|
78
|
-
protected get api(): Api;
|
|
79
|
-
protected get logger(): Logger;
|
|
80
|
-
protected buildUrl(path?: string | number): string;
|
|
81
|
-
protected buildConfig(options?: ResourceOptions): AxiosRequestConfig;
|
|
82
|
-
index(options?: ResourceOptions): Promise<ApiResponse<T[]>>;
|
|
83
|
-
paginate(page?: number, perPage?: number, options?: ResourceOptions): Promise<ApiResponse<PaginatedResponse<T>>>;
|
|
84
|
-
show(id: string | number, options?: ResourceOptions): Promise<ApiResponse<T>>;
|
|
85
|
-
store(data: Partial<T>, options?: ResourceOptions): Promise<ApiResponse<T>>;
|
|
86
|
-
update(id: string | number, data: Partial<T>, options?: ResourceOptions): Promise<ApiResponse<T>>;
|
|
87
|
-
patch(id: string | number, data: Partial<T>, options?: ResourceOptions): Promise<ApiResponse<T>>;
|
|
88
|
-
destroy(id: string | number, options?: ResourceOptions): Promise<ApiResponse<void>>;
|
|
89
|
-
protected get<R = T>(path: string, options?: ResourceOptions): Promise<ApiResponse<R>>;
|
|
90
|
-
protected post<R = T>(path: string, data?: unknown, options?: ResourceOptions): Promise<ApiResponse<R>>;
|
|
91
|
-
protected put<R = T>(path: string, data?: unknown, options?: ResourceOptions): Promise<ApiResponse<R>>;
|
|
92
|
-
protected delete<R = void>(path: string, options?: ResourceOptions): Promise<ApiResponse<R>>;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
59
|
interface AuthUser {
|
|
96
60
|
id: number;
|
|
97
61
|
email?: string;
|
|
@@ -144,8 +108,7 @@ interface MeResponse {
|
|
|
144
108
|
user: AuthUser;
|
|
145
109
|
};
|
|
146
110
|
}
|
|
147
|
-
|
|
148
|
-
protected readonly endpoint = "/auth";
|
|
111
|
+
interface AuthResource {
|
|
149
112
|
login(credentials: LoginCredentials): Promise<ApiResponse<AuthResponse>>;
|
|
150
113
|
register(data: RegisterData): Promise<ApiResponse<AuthResponse>>;
|
|
151
114
|
refresh(refreshToken: string): Promise<ApiResponse<RefreshResponse>>;
|
|
@@ -154,8 +117,14 @@ declare class AuthResource extends ApiResource<AuthUser> {
|
|
|
154
117
|
message: string;
|
|
155
118
|
}>>;
|
|
156
119
|
me(): Promise<ApiResponse<MeResponse>>;
|
|
120
|
+
forgotPassword(email: string): Promise<ApiResponse<{
|
|
121
|
+
success: boolean;
|
|
122
|
+
}>>;
|
|
123
|
+
resetPassword(token: string, password: string): Promise<ApiResponse<{
|
|
124
|
+
success: boolean;
|
|
125
|
+
}>>;
|
|
157
126
|
}
|
|
158
|
-
declare const
|
|
127
|
+
declare const createAuthResource: (api: Api) => AuthResource;
|
|
159
128
|
|
|
160
129
|
interface User extends AuthUser {
|
|
161
130
|
}
|
|
@@ -170,9 +139,23 @@ interface UserResponse {
|
|
|
170
139
|
user: User;
|
|
171
140
|
};
|
|
172
141
|
}
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
142
|
+
interface MyViolation {
|
|
143
|
+
id: number;
|
|
144
|
+
adminUsername: string;
|
|
145
|
+
reason: string;
|
|
146
|
+
revoked: boolean;
|
|
147
|
+
revokedAt: string | null;
|
|
148
|
+
createdAt: string;
|
|
149
|
+
}
|
|
150
|
+
interface MyViolationsResponse {
|
|
151
|
+
success: boolean;
|
|
152
|
+
data: {
|
|
153
|
+
violations: MyViolation[];
|
|
154
|
+
permanentBan: boolean;
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
interface UserResource {
|
|
158
|
+
getById(id: number): Promise<ApiResponse<UserResponse>>;
|
|
176
159
|
getByUsername(username: string): Promise<ApiResponse<UserResponse>>;
|
|
177
160
|
updateProfile(data: UpdateProfileData): Promise<ApiResponse<UserResponse>>;
|
|
178
161
|
deleteAccount(): Promise<ApiResponse<{
|
|
@@ -184,8 +167,9 @@ declare class UserResource extends ApiResource<User> {
|
|
|
184
167
|
success: boolean;
|
|
185
168
|
data: null;
|
|
186
169
|
}>>;
|
|
170
|
+
getMyViolations(): Promise<ApiResponse<MyViolationsResponse>>;
|
|
187
171
|
}
|
|
188
|
-
declare const
|
|
172
|
+
declare const createUserResource: (api: Api) => UserResource;
|
|
189
173
|
|
|
190
174
|
type RoomRole = 'user' | 'resident_dj' | 'bouncer' | 'manager' | 'cohost' | 'host';
|
|
191
175
|
interface Room {
|
|
@@ -368,11 +352,8 @@ interface BoothState {
|
|
|
368
352
|
};
|
|
369
353
|
}
|
|
370
354
|
interface JoinMuteInfo {
|
|
371
|
-
/** ISO timestamp when the mute expires, or null if permanent */
|
|
372
355
|
expiresAt: string | null;
|
|
373
|
-
/** Seconds remaining until unmute, or null if permanent */
|
|
374
356
|
remainingSeconds: number | null;
|
|
375
|
-
/** Optional reason given by the moderator */
|
|
376
357
|
reason: string | null;
|
|
377
358
|
}
|
|
378
359
|
interface JoinRoomResponse {
|
|
@@ -388,7 +369,6 @@ interface JoinRoomResponse {
|
|
|
388
369
|
role: RoomRole;
|
|
389
370
|
users: RoomUserState[];
|
|
390
371
|
booth: BoothState;
|
|
391
|
-
/** Present when the joining user is currently muted in this room */
|
|
392
372
|
mute: JoinMuteInfo | null;
|
|
393
373
|
};
|
|
394
374
|
}
|
|
@@ -458,9 +438,53 @@ interface RoomHistoryResponse {
|
|
|
458
438
|
pagination: PaginationMeta;
|
|
459
439
|
};
|
|
460
440
|
}
|
|
461
|
-
|
|
462
|
-
|
|
441
|
+
type AuditAction = 'kick' | 'ban' | 'unban' | 'mute' | 'unmute' | 'role_change' | 'waitlist_move' | 'waitlist_remove' | 'track_skip';
|
|
442
|
+
interface RoomAuditLog {
|
|
443
|
+
id: number;
|
|
444
|
+
actorId: number;
|
|
445
|
+
actorUsername: string;
|
|
446
|
+
targetId: number | null;
|
|
447
|
+
targetUsername: string | null;
|
|
448
|
+
action: AuditAction;
|
|
449
|
+
metadata: string | null;
|
|
450
|
+
createdAt: string;
|
|
451
|
+
}
|
|
452
|
+
interface RoomAuditLogResponse {
|
|
453
|
+
success: boolean;
|
|
454
|
+
data: {
|
|
455
|
+
logs: RoomAuditLog[];
|
|
456
|
+
hasMore: boolean;
|
|
457
|
+
};
|
|
458
|
+
}
|
|
459
|
+
type DashboardActivityType = 'play' | 'woot' | 'grab';
|
|
460
|
+
interface DashboardActivityItem {
|
|
461
|
+
id: string;
|
|
462
|
+
type: DashboardActivityType;
|
|
463
|
+
room: {
|
|
464
|
+
id: number;
|
|
465
|
+
slug: string;
|
|
466
|
+
name: string;
|
|
467
|
+
};
|
|
468
|
+
media: {
|
|
469
|
+
id: number;
|
|
470
|
+
source: 'youtube' | 'soundcloud';
|
|
471
|
+
sourceId: string;
|
|
472
|
+
title: string;
|
|
473
|
+
artist: string | null;
|
|
474
|
+
thumbnail: string | null;
|
|
475
|
+
};
|
|
476
|
+
count: number | null;
|
|
477
|
+
createdAt: string;
|
|
478
|
+
}
|
|
479
|
+
interface DashboardActivityResponse {
|
|
480
|
+
success: boolean;
|
|
481
|
+
data: {
|
|
482
|
+
activities: DashboardActivityItem[];
|
|
483
|
+
};
|
|
484
|
+
}
|
|
485
|
+
interface RoomResource {
|
|
463
486
|
list(): Promise<ApiResponse<RoomsResponse>>;
|
|
487
|
+
mine(limit?: number): Promise<ApiResponse<RoomsResponse>>;
|
|
464
488
|
featured(): Promise<ApiResponse<FeaturedRoomsResponse>>;
|
|
465
489
|
getBySlug(slug: string): Promise<ApiResponse<RoomResponse>>;
|
|
466
490
|
create(data: CreateRoomData): Promise<ApiResponse<RoomResponse>>;
|
|
@@ -545,8 +569,10 @@ declare class RoomResource extends ApiResource<Room> {
|
|
|
545
569
|
vote(slug: string, type: 'woot' | 'meh'): Promise<ApiResponse<VoteResponse>>;
|
|
546
570
|
grabTrack(slug: string, playlistId?: number): Promise<ApiResponse<GrabResponse>>;
|
|
547
571
|
getHistory(slug: string, page?: number, limit?: number): Promise<ApiResponse<RoomHistoryResponse>>;
|
|
572
|
+
getAuditLog(slug: string, limit?: number, before?: string): Promise<ApiResponse<RoomAuditLogResponse>>;
|
|
573
|
+
activity(limit?: number): Promise<ApiResponse<DashboardActivityResponse>>;
|
|
548
574
|
}
|
|
549
|
-
declare const
|
|
575
|
+
declare const createRoomResource: (api: Api) => RoomResource;
|
|
550
576
|
|
|
551
577
|
interface ChatMessage {
|
|
552
578
|
id: string;
|
|
@@ -578,8 +604,7 @@ interface ChatMessageResponse {
|
|
|
578
604
|
message: ChatMessage;
|
|
579
605
|
};
|
|
580
606
|
}
|
|
581
|
-
|
|
582
|
-
protected readonly endpoint = "/rooms";
|
|
607
|
+
interface ChatResource {
|
|
583
608
|
sendMessage(slug: string, data: SendMessageData): Promise<ApiResponse<ChatMessageResponse>>;
|
|
584
609
|
getMessages(slug: string, before?: string, limit?: number): Promise<ApiResponse<ChatMessagesResponse>>;
|
|
585
610
|
deleteMessage(slug: string, messageId: string): Promise<ApiResponse<{
|
|
@@ -587,13 +612,13 @@ declare class ChatResource extends ApiResource<ChatMessage> {
|
|
|
587
612
|
data: null;
|
|
588
613
|
}>>;
|
|
589
614
|
}
|
|
590
|
-
declare const
|
|
615
|
+
declare const createChatResource: (api: Api) => ChatResource;
|
|
591
616
|
|
|
592
|
-
type MediaSource = 'youtube' | 'soundcloud';
|
|
617
|
+
type MediaSource$1 = 'youtube' | 'soundcloud';
|
|
593
618
|
interface MediaItem {
|
|
594
619
|
id: number;
|
|
595
620
|
playlistId: number;
|
|
596
|
-
source: MediaSource;
|
|
621
|
+
source: MediaSource$1;
|
|
597
622
|
sourceId: string;
|
|
598
623
|
title: string;
|
|
599
624
|
artist: string | null;
|
|
@@ -632,7 +657,7 @@ interface MediaItemResponse {
|
|
|
632
657
|
};
|
|
633
658
|
}
|
|
634
659
|
interface AddMediaData {
|
|
635
|
-
source: MediaSource;
|
|
660
|
+
source: MediaSource$1;
|
|
636
661
|
sourceId: string;
|
|
637
662
|
}
|
|
638
663
|
interface ShuffleResponse {
|
|
@@ -643,7 +668,7 @@ interface ShuffleResponse {
|
|
|
643
668
|
};
|
|
644
669
|
}
|
|
645
670
|
interface ImportPlaylistData {
|
|
646
|
-
source?: MediaSource;
|
|
671
|
+
source?: MediaSource$1;
|
|
647
672
|
url: string;
|
|
648
673
|
}
|
|
649
674
|
interface ImportResult {
|
|
@@ -657,8 +682,7 @@ interface ImportPlaylistResponse {
|
|
|
657
682
|
success: boolean;
|
|
658
683
|
data: ImportResult;
|
|
659
684
|
}
|
|
660
|
-
|
|
661
|
-
protected readonly endpoint = "/playlists";
|
|
685
|
+
interface PlaylistResource {
|
|
662
686
|
getAll(): Promise<ApiResponse<PlaylistsResponse>>;
|
|
663
687
|
getById(playlistId: number): Promise<ApiResponse<PlaylistResponse>>;
|
|
664
688
|
create(name: string): Promise<ApiResponse<PlaylistResponse>>;
|
|
@@ -675,8 +699,9 @@ declare class PlaylistResource extends ApiResource<Playlist> {
|
|
|
675
699
|
moveItem(playlistId: number, itemId: number, position: number): Promise<ApiResponse<MediaItemResponse>>;
|
|
676
700
|
importPlaylist(playlistId: number, data: ImportPlaylistData): Promise<ApiResponse<ImportPlaylistResponse>>;
|
|
677
701
|
}
|
|
678
|
-
declare const
|
|
702
|
+
declare const createPlaylistResource: (api: Api) => PlaylistResource;
|
|
679
703
|
|
|
704
|
+
type MediaSource = 'youtube' | 'soundcloud';
|
|
680
705
|
interface MediaSearchResult {
|
|
681
706
|
source: MediaSource;
|
|
682
707
|
sourceId: string;
|
|
@@ -710,8 +735,7 @@ interface SoundCloudTrackResponse {
|
|
|
710
735
|
track: MediaSearchResult;
|
|
711
736
|
};
|
|
712
737
|
}
|
|
713
|
-
|
|
714
|
-
protected readonly endpoint = "/sources";
|
|
738
|
+
interface SourceResource {
|
|
715
739
|
searchYouTube(query: string, limit?: number): Promise<ApiResponse<YouTubeSearchResponse>>;
|
|
716
740
|
getYouTubeVideo(videoId: string): Promise<ApiResponse<YouTubeVideoResponse>>;
|
|
717
741
|
searchSoundCloud(query: string, limit?: number): Promise<ApiResponse<SoundCloudSearchResponse>>;
|
|
@@ -719,16 +743,14 @@ declare class SourceResource extends ApiResource<MediaSearchResult> {
|
|
|
719
743
|
resolveSoundCloudUrl(url: string): Promise<ApiResponse<SoundCloudTrackResponse>>;
|
|
720
744
|
searchAll(query: string, limit?: number): Promise<MediaSearchResult[]>;
|
|
721
745
|
}
|
|
722
|
-
declare const
|
|
746
|
+
declare const createSourceResource: (api: Api) => SourceResource;
|
|
723
747
|
|
|
724
748
|
type AvatarUnlockType = 'free' | 'level' | 'subscription';
|
|
725
749
|
interface AvatarCatalogItem {
|
|
726
750
|
id: string;
|
|
727
751
|
unlockType: AvatarUnlockType;
|
|
728
752
|
requiredLevel: number | null;
|
|
729
|
-
/** Whether the user has unlocked (or has free access to) this avatar */
|
|
730
753
|
unlocked: boolean;
|
|
731
|
-
/** Whether the user currently meets the requirement to unlock it */
|
|
732
754
|
eligible: boolean;
|
|
733
755
|
}
|
|
734
756
|
interface AvatarCatalogResponse {
|
|
@@ -742,8 +764,7 @@ interface AvatarCatalogResponse {
|
|
|
742
764
|
interface EquipAvatarData {
|
|
743
765
|
avatarId: string;
|
|
744
766
|
}
|
|
745
|
-
|
|
746
|
-
protected readonly endpoint = "/shop";
|
|
767
|
+
interface ShopResource {
|
|
747
768
|
getAvatarCatalog(): Promise<ApiResponse<AvatarCatalogResponse>>;
|
|
748
769
|
unlockAvatar(avatarId: string): Promise<ApiResponse<{
|
|
749
770
|
success: boolean;
|
|
@@ -759,7 +780,7 @@ declare class ShopResource extends ApiResource {
|
|
|
759
780
|
};
|
|
760
781
|
}>>;
|
|
761
782
|
}
|
|
762
|
-
declare const
|
|
783
|
+
declare const createShopResource: (api: Api) => ShopResource;
|
|
763
784
|
|
|
764
785
|
type SubscriptionPlan = 'monthly' | 'yearly';
|
|
765
786
|
interface SubscriptionStatus {
|
|
@@ -782,8 +803,7 @@ interface PortalResponse {
|
|
|
782
803
|
url: string;
|
|
783
804
|
};
|
|
784
805
|
}
|
|
785
|
-
|
|
786
|
-
protected readonly endpoint = "/subscriptions";
|
|
806
|
+
interface SubscriptionResource {
|
|
787
807
|
getStatus(): Promise<ApiResponse<{
|
|
788
808
|
success: boolean;
|
|
789
809
|
data: SubscriptionStatus;
|
|
@@ -794,7 +814,7 @@ declare class SubscriptionResource extends ApiResource {
|
|
|
794
814
|
}>>;
|
|
795
815
|
createPortal(): Promise<ApiResponse<PortalResponse>>;
|
|
796
816
|
}
|
|
797
|
-
declare const
|
|
817
|
+
declare const createSubscriptionResource: (api: Api) => SubscriptionResource;
|
|
798
818
|
|
|
799
819
|
type FriendshipStatus = 'none' | 'pending_sent' | 'pending_received' | 'accepted' | 'blocked_by_me' | 'blocked_by_them';
|
|
800
820
|
interface FriendEntry {
|
|
@@ -829,8 +849,7 @@ interface FriendActionResponse {
|
|
|
829
849
|
status: FriendshipStatus;
|
|
830
850
|
} | null;
|
|
831
851
|
}
|
|
832
|
-
|
|
833
|
-
protected readonly endpoint = "/friends";
|
|
852
|
+
interface FriendResource {
|
|
834
853
|
list(): Promise<ApiResponse<FriendListResponse>>;
|
|
835
854
|
getStatus(targetUserId: number): Promise<ApiResponse<FriendStatusResponse>>;
|
|
836
855
|
sendRequest(targetUserId: number): Promise<ApiResponse<FriendActionResponse>>;
|
|
@@ -839,6 +858,124 @@ declare class FriendResource extends ApiResource<FriendEntry> {
|
|
|
839
858
|
block(targetUserId: number): Promise<ApiResponse<FriendActionResponse>>;
|
|
840
859
|
unblock(targetUserId: number): Promise<ApiResponse<FriendActionResponse>>;
|
|
841
860
|
}
|
|
842
|
-
declare const
|
|
861
|
+
declare const createFriendResource: (api: Api) => FriendResource;
|
|
862
|
+
|
|
863
|
+
interface AdminUserEntry {
|
|
864
|
+
id: number;
|
|
865
|
+
username: string;
|
|
866
|
+
displayName: string | null;
|
|
867
|
+
email?: string;
|
|
868
|
+
avatarId: string;
|
|
869
|
+
globalRole: GlobalRole;
|
|
870
|
+
disabled: boolean;
|
|
871
|
+
permanentBan: boolean;
|
|
872
|
+
emailVerified: boolean;
|
|
873
|
+
xp: number;
|
|
874
|
+
createdAt: string;
|
|
875
|
+
}
|
|
876
|
+
interface AdminUsersResponse {
|
|
877
|
+
success: boolean;
|
|
878
|
+
data: {
|
|
879
|
+
users: AdminUserEntry[];
|
|
880
|
+
total: number;
|
|
881
|
+
};
|
|
882
|
+
}
|
|
883
|
+
interface AdminStatsRoom {
|
|
884
|
+
slug: string;
|
|
885
|
+
name: string;
|
|
886
|
+
population: number;
|
|
887
|
+
}
|
|
888
|
+
interface AdminStatsResponse {
|
|
889
|
+
success: boolean;
|
|
890
|
+
data: {
|
|
891
|
+
activeRooms: number;
|
|
892
|
+
totalOnlineUsers: number;
|
|
893
|
+
rooms: AdminStatsRoom[];
|
|
894
|
+
};
|
|
895
|
+
}
|
|
896
|
+
interface AdminListUsersParams {
|
|
897
|
+
search?: string;
|
|
898
|
+
role?: GlobalRole | '';
|
|
899
|
+
disabled?: boolean;
|
|
900
|
+
page?: number;
|
|
901
|
+
limit?: number;
|
|
902
|
+
sortBy?: 'id' | 'username' | 'createdAt';
|
|
903
|
+
sortDir?: 'asc' | 'desc';
|
|
904
|
+
}
|
|
905
|
+
interface AccountViolation {
|
|
906
|
+
id: number;
|
|
907
|
+
adminId: number;
|
|
908
|
+
adminUsername: string;
|
|
909
|
+
reason: string;
|
|
910
|
+
revoked: boolean;
|
|
911
|
+
revokedAt: string | null;
|
|
912
|
+
revokerId: number | null;
|
|
913
|
+
createdAt: string;
|
|
914
|
+
}
|
|
915
|
+
interface UserViolationsResponse {
|
|
916
|
+
success: boolean;
|
|
917
|
+
data: {
|
|
918
|
+
violations: AccountViolation[];
|
|
919
|
+
permanentBan: boolean;
|
|
920
|
+
};
|
|
921
|
+
}
|
|
922
|
+
interface AddViolationResponse {
|
|
923
|
+
success: boolean;
|
|
924
|
+
data: {
|
|
925
|
+
violation: AccountViolation;
|
|
926
|
+
permanentlyBanned: boolean;
|
|
927
|
+
activeViolations: number;
|
|
928
|
+
};
|
|
929
|
+
}
|
|
930
|
+
interface AdminResource {
|
|
931
|
+
listUsers(params?: AdminListUsersParams): Promise<ApiResponse<AdminUsersResponse>>;
|
|
932
|
+
enableUser(id: number): Promise<ApiResponse<{
|
|
933
|
+
success: boolean;
|
|
934
|
+
data: null;
|
|
935
|
+
}>>;
|
|
936
|
+
disableUser(id: number): Promise<ApiResponse<{
|
|
937
|
+
success: boolean;
|
|
938
|
+
data: null;
|
|
939
|
+
}>>;
|
|
940
|
+
updateRole(id: number, role: GlobalRole): Promise<ApiResponse<{
|
|
941
|
+
success: boolean;
|
|
942
|
+
data: null;
|
|
943
|
+
}>>;
|
|
944
|
+
broadcast(message: string): Promise<ApiResponse<{
|
|
945
|
+
success: boolean;
|
|
946
|
+
data: {
|
|
947
|
+
sent_to_rooms: number;
|
|
948
|
+
};
|
|
949
|
+
}>>;
|
|
950
|
+
setMaintenance(active: boolean, message?: string, endsAt?: number | null): Promise<ApiResponse<{
|
|
951
|
+
success: boolean;
|
|
952
|
+
data: {
|
|
953
|
+
active: boolean;
|
|
954
|
+
};
|
|
955
|
+
}>>;
|
|
956
|
+
getStats(): Promise<ApiResponse<AdminStatsResponse>>;
|
|
957
|
+
addViolation(userId: number, reason: string): Promise<ApiResponse<AddViolationResponse>>;
|
|
958
|
+
revokeViolation(violationId: number): Promise<ApiResponse<{
|
|
959
|
+
success: boolean;
|
|
960
|
+
data: null;
|
|
961
|
+
}>>;
|
|
962
|
+
getUserViolations(userId: number): Promise<ApiResponse<UserViolationsResponse>>;
|
|
963
|
+
}
|
|
964
|
+
declare const createAdminResource: (api: Api) => AdminResource;
|
|
965
|
+
|
|
966
|
+
interface ApiClient {
|
|
967
|
+
api: Api;
|
|
968
|
+
auth: AuthResource;
|
|
969
|
+
user: UserResource;
|
|
970
|
+
room: RoomResource;
|
|
971
|
+
chat: ChatResource;
|
|
972
|
+
playlist: PlaylistResource;
|
|
973
|
+
source: SourceResource;
|
|
974
|
+
shop: ShopResource;
|
|
975
|
+
subscription: SubscriptionResource;
|
|
976
|
+
friend: FriendResource;
|
|
977
|
+
admin: AdminResource;
|
|
978
|
+
}
|
|
979
|
+
declare const createApiClient: (config: ApiConfig) => ApiClient;
|
|
843
980
|
|
|
844
|
-
export { type AddMediaData, Api, type ApiConfig, ApiError,
|
|
981
|
+
export { type AccountViolation, type AddMediaData, type AddViolationResponse, type AdminListUsersParams, type AdminResource, type AdminStatsResponse, type AdminStatsRoom, type AdminUserEntry, type AdminUsersResponse, Api, type ApiClient, type ApiConfig, ApiError, type ApiResponse, type AuditAction, type AuthResource, type AuthUser, type AvatarCatalogItem, type AvatarCatalogResponse, type AvatarUnlockType, type BackendErrorResponse, type BanResponse, type BoothDJ, type BoothMedia, type BoothResponse, type BoothState, type ChatMessage, type ChatMessageResponse, type ChatMessagesResponse, type ChatResource, type CreateIntentResponse, type CreateRoomData, type DashboardActivityItem, type DashboardActivityResponse, type DashboardActivityType, type EquipAvatarData, type FeaturedRoomsResponse, type FriendActionResponse, type FriendEntry, type FriendList, type FriendListResponse, type FriendResource, type FriendStatusResponse, type FriendshipStatus, type GlobalRole, type GrabResponse, type ImportPlaylistData, type ImportPlaylistResponse, type ImportResult, type JoinMuteInfo, type JoinRoomResponse, Logger, type MediaItem, type MediaItemResponse, type MediaSearchResult, type MediaSource, type ModerateUserData, type MuteResponse, type MyViolation, type MyViolationsResponse, type PaginationMeta, type PlayHistoryItem, type Playlist, type PlaylistResource, type PlaylistResponse, type PlaylistsResponse, type PortalResponse, type Room, type RoomAuditLog, type RoomBan, type RoomBansResponse, type RoomHistoryResponse, type RoomMember, type RoomMute, type RoomMutesResponse, type RoomResource, type RoomResponse, type RoomRole, type RoomStaffResponse, type RoomUserState, type RoomsResponse, type SendMessageData, type ShopResource, type ShuffleResponse, type SoundCloudSearchResponse, type SoundCloudTrackResponse, type SourceResource, type SubscriptionPlan, type SubscriptionResource, type SubscriptionStatus, type UpdateProfileData, type UpdateRoomData, type User, type UserResource, type UserResponse, type UserViolationsResponse, type VoteResponse, type WaitlistResponse, type WaitlistUser, type YouTubeSearchResponse, type YouTubeVideoResponse, createAdminResource, createApi, createApiClient, createAuthResource, createChatResource, createFriendResource, createPlaylistResource, createRoomResource, createShopResource, createSourceResource, createSubscriptionResource, createUserResource };
|