@borealise/api 2.0.0-alpha.7 → 2.0.0-alpha.9
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 +76 -1
- package/dist/index.d.ts +76 -1
- package/dist/index.js +8 -3
- package/dist/index.mjs +8 -3
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -139,6 +139,21 @@ interface UserResponse {
|
|
|
139
139
|
user: User;
|
|
140
140
|
};
|
|
141
141
|
}
|
|
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
|
+
}
|
|
142
157
|
interface UserResource {
|
|
143
158
|
getById(id: number): Promise<ApiResponse<UserResponse>>;
|
|
144
159
|
getByUsername(username: string): Promise<ApiResponse<UserResponse>>;
|
|
@@ -152,6 +167,7 @@ interface UserResource {
|
|
|
152
167
|
success: boolean;
|
|
153
168
|
data: null;
|
|
154
169
|
}>>;
|
|
170
|
+
getMyViolations(): Promise<ApiResponse<MyViolationsResponse>>;
|
|
155
171
|
}
|
|
156
172
|
declare const createUserResource: (api: Api) => UserResource;
|
|
157
173
|
|
|
@@ -440,6 +456,32 @@ interface RoomAuditLogResponse {
|
|
|
440
456
|
hasMore: boolean;
|
|
441
457
|
};
|
|
442
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
|
+
}
|
|
443
485
|
interface RoomResource {
|
|
444
486
|
list(): Promise<ApiResponse<RoomsResponse>>;
|
|
445
487
|
featured(): Promise<ApiResponse<FeaturedRoomsResponse>>;
|
|
@@ -527,6 +569,7 @@ interface RoomResource {
|
|
|
527
569
|
grabTrack(slug: string, playlistId?: number): Promise<ApiResponse<GrabResponse>>;
|
|
528
570
|
getHistory(slug: string, page?: number, limit?: number): Promise<ApiResponse<RoomHistoryResponse>>;
|
|
529
571
|
getAuditLog(slug: string, limit?: number, before?: string): Promise<ApiResponse<RoomAuditLogResponse>>;
|
|
572
|
+
activity(limit?: number): Promise<ApiResponse<DashboardActivityResponse>>;
|
|
530
573
|
}
|
|
531
574
|
declare const createRoomResource: (api: Api) => RoomResource;
|
|
532
575
|
|
|
@@ -824,6 +867,7 @@ interface AdminUserEntry {
|
|
|
824
867
|
avatarId: string;
|
|
825
868
|
globalRole: GlobalRole;
|
|
826
869
|
disabled: boolean;
|
|
870
|
+
permanentBan: boolean;
|
|
827
871
|
emailVerified: boolean;
|
|
828
872
|
xp: number;
|
|
829
873
|
createdAt: string;
|
|
@@ -857,6 +901,31 @@ interface AdminListUsersParams {
|
|
|
857
901
|
sortBy?: 'id' | 'username' | 'createdAt';
|
|
858
902
|
sortDir?: 'asc' | 'desc';
|
|
859
903
|
}
|
|
904
|
+
interface AccountViolation {
|
|
905
|
+
id: number;
|
|
906
|
+
adminId: number;
|
|
907
|
+
adminUsername: string;
|
|
908
|
+
reason: string;
|
|
909
|
+
revoked: boolean;
|
|
910
|
+
revokedAt: string | null;
|
|
911
|
+
revokerId: number | null;
|
|
912
|
+
createdAt: string;
|
|
913
|
+
}
|
|
914
|
+
interface UserViolationsResponse {
|
|
915
|
+
success: boolean;
|
|
916
|
+
data: {
|
|
917
|
+
violations: AccountViolation[];
|
|
918
|
+
permanentBan: boolean;
|
|
919
|
+
};
|
|
920
|
+
}
|
|
921
|
+
interface AddViolationResponse {
|
|
922
|
+
success: boolean;
|
|
923
|
+
data: {
|
|
924
|
+
violation: AccountViolation;
|
|
925
|
+
permanentlyBanned: boolean;
|
|
926
|
+
activeViolations: number;
|
|
927
|
+
};
|
|
928
|
+
}
|
|
860
929
|
interface AdminResource {
|
|
861
930
|
listUsers(params?: AdminListUsersParams): Promise<ApiResponse<AdminUsersResponse>>;
|
|
862
931
|
enableUser(id: number): Promise<ApiResponse<{
|
|
@@ -884,6 +953,12 @@ interface AdminResource {
|
|
|
884
953
|
};
|
|
885
954
|
}>>;
|
|
886
955
|
getStats(): Promise<ApiResponse<AdminStatsResponse>>;
|
|
956
|
+
addViolation(userId: number, reason: string): Promise<ApiResponse<AddViolationResponse>>;
|
|
957
|
+
revokeViolation(violationId: number): Promise<ApiResponse<{
|
|
958
|
+
success: boolean;
|
|
959
|
+
data: null;
|
|
960
|
+
}>>;
|
|
961
|
+
getUserViolations(userId: number): Promise<ApiResponse<UserViolationsResponse>>;
|
|
887
962
|
}
|
|
888
963
|
declare const createAdminResource: (api: Api) => AdminResource;
|
|
889
964
|
|
|
@@ -902,4 +977,4 @@ interface ApiClient {
|
|
|
902
977
|
}
|
|
903
978
|
declare const createApiClient: (config: ApiConfig) => ApiClient;
|
|
904
979
|
|
|
905
|
-
export { type AddMediaData, 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 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 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 VoteResponse, type WaitlistResponse, type WaitlistUser, type YouTubeSearchResponse, type YouTubeVideoResponse, createAdminResource, createApi, createApiClient, createAuthResource, createChatResource, createFriendResource, createPlaylistResource, createRoomResource, createShopResource, createSourceResource, createSubscriptionResource, createUserResource };
|
|
980
|
+
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 };
|
package/dist/index.d.ts
CHANGED
|
@@ -139,6 +139,21 @@ interface UserResponse {
|
|
|
139
139
|
user: User;
|
|
140
140
|
};
|
|
141
141
|
}
|
|
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
|
+
}
|
|
142
157
|
interface UserResource {
|
|
143
158
|
getById(id: number): Promise<ApiResponse<UserResponse>>;
|
|
144
159
|
getByUsername(username: string): Promise<ApiResponse<UserResponse>>;
|
|
@@ -152,6 +167,7 @@ interface UserResource {
|
|
|
152
167
|
success: boolean;
|
|
153
168
|
data: null;
|
|
154
169
|
}>>;
|
|
170
|
+
getMyViolations(): Promise<ApiResponse<MyViolationsResponse>>;
|
|
155
171
|
}
|
|
156
172
|
declare const createUserResource: (api: Api) => UserResource;
|
|
157
173
|
|
|
@@ -440,6 +456,32 @@ interface RoomAuditLogResponse {
|
|
|
440
456
|
hasMore: boolean;
|
|
441
457
|
};
|
|
442
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
|
+
}
|
|
443
485
|
interface RoomResource {
|
|
444
486
|
list(): Promise<ApiResponse<RoomsResponse>>;
|
|
445
487
|
featured(): Promise<ApiResponse<FeaturedRoomsResponse>>;
|
|
@@ -527,6 +569,7 @@ interface RoomResource {
|
|
|
527
569
|
grabTrack(slug: string, playlistId?: number): Promise<ApiResponse<GrabResponse>>;
|
|
528
570
|
getHistory(slug: string, page?: number, limit?: number): Promise<ApiResponse<RoomHistoryResponse>>;
|
|
529
571
|
getAuditLog(slug: string, limit?: number, before?: string): Promise<ApiResponse<RoomAuditLogResponse>>;
|
|
572
|
+
activity(limit?: number): Promise<ApiResponse<DashboardActivityResponse>>;
|
|
530
573
|
}
|
|
531
574
|
declare const createRoomResource: (api: Api) => RoomResource;
|
|
532
575
|
|
|
@@ -824,6 +867,7 @@ interface AdminUserEntry {
|
|
|
824
867
|
avatarId: string;
|
|
825
868
|
globalRole: GlobalRole;
|
|
826
869
|
disabled: boolean;
|
|
870
|
+
permanentBan: boolean;
|
|
827
871
|
emailVerified: boolean;
|
|
828
872
|
xp: number;
|
|
829
873
|
createdAt: string;
|
|
@@ -857,6 +901,31 @@ interface AdminListUsersParams {
|
|
|
857
901
|
sortBy?: 'id' | 'username' | 'createdAt';
|
|
858
902
|
sortDir?: 'asc' | 'desc';
|
|
859
903
|
}
|
|
904
|
+
interface AccountViolation {
|
|
905
|
+
id: number;
|
|
906
|
+
adminId: number;
|
|
907
|
+
adminUsername: string;
|
|
908
|
+
reason: string;
|
|
909
|
+
revoked: boolean;
|
|
910
|
+
revokedAt: string | null;
|
|
911
|
+
revokerId: number | null;
|
|
912
|
+
createdAt: string;
|
|
913
|
+
}
|
|
914
|
+
interface UserViolationsResponse {
|
|
915
|
+
success: boolean;
|
|
916
|
+
data: {
|
|
917
|
+
violations: AccountViolation[];
|
|
918
|
+
permanentBan: boolean;
|
|
919
|
+
};
|
|
920
|
+
}
|
|
921
|
+
interface AddViolationResponse {
|
|
922
|
+
success: boolean;
|
|
923
|
+
data: {
|
|
924
|
+
violation: AccountViolation;
|
|
925
|
+
permanentlyBanned: boolean;
|
|
926
|
+
activeViolations: number;
|
|
927
|
+
};
|
|
928
|
+
}
|
|
860
929
|
interface AdminResource {
|
|
861
930
|
listUsers(params?: AdminListUsersParams): Promise<ApiResponse<AdminUsersResponse>>;
|
|
862
931
|
enableUser(id: number): Promise<ApiResponse<{
|
|
@@ -884,6 +953,12 @@ interface AdminResource {
|
|
|
884
953
|
};
|
|
885
954
|
}>>;
|
|
886
955
|
getStats(): Promise<ApiResponse<AdminStatsResponse>>;
|
|
956
|
+
addViolation(userId: number, reason: string): Promise<ApiResponse<AddViolationResponse>>;
|
|
957
|
+
revokeViolation(violationId: number): Promise<ApiResponse<{
|
|
958
|
+
success: boolean;
|
|
959
|
+
data: null;
|
|
960
|
+
}>>;
|
|
961
|
+
getUserViolations(userId: number): Promise<ApiResponse<UserViolationsResponse>>;
|
|
887
962
|
}
|
|
888
963
|
declare const createAdminResource: (api: Api) => AdminResource;
|
|
889
964
|
|
|
@@ -902,4 +977,4 @@ interface ApiClient {
|
|
|
902
977
|
}
|
|
903
978
|
declare const createApiClient: (config: ApiConfig) => ApiClient;
|
|
904
979
|
|
|
905
|
-
export { type AddMediaData, 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 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 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 VoteResponse, type WaitlistResponse, type WaitlistUser, type YouTubeSearchResponse, type YouTubeVideoResponse, createAdminResource, createApi, createApiClient, createAuthResource, createChatResource, createFriendResource, createPlaylistResource, createRoomResource, createShopResource, createSourceResource, createSubscriptionResource, createUserResource };
|
|
980
|
+
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 };
|
package/dist/index.js
CHANGED
|
@@ -239,7 +239,8 @@ var createUserResource = (api) => ({
|
|
|
239
239
|
updateProfile: (data) => api.patch(`${endpoint2}/me`, data),
|
|
240
240
|
deleteAccount: () => api.delete(`${endpoint2}/me`),
|
|
241
241
|
updateRole: (id, role) => api.patch(`/api/admin/users/${id}/role`, { role }),
|
|
242
|
-
disable: (id) => api.post(`/api/admin/users/${id}/disable`)
|
|
242
|
+
disable: (id) => api.post(`/api/admin/users/${id}/disable`),
|
|
243
|
+
getMyViolations: () => api.get(`${endpoint2}/me/violations`)
|
|
243
244
|
});
|
|
244
245
|
|
|
245
246
|
// src/resources/room.ts
|
|
@@ -283,7 +284,8 @@ var createRoomResource = (api) => ({
|
|
|
283
284
|
vote: (slug, type) => api.post(`${endpoint3}/${slug}/booth/vote`, { type }),
|
|
284
285
|
grabTrack: (slug, playlistId) => api.post(`${endpoint3}/${slug}/booth/grab`, playlistId ? { playlistId } : {}),
|
|
285
286
|
getHistory: (slug, page = 1, limit = 20) => api.get(`${endpoint3}/${slug}/history`, { params: { page, limit } }),
|
|
286
|
-
getAuditLog: (slug, limit = 50, before) => api.get(`${endpoint3}/${slug}/audit`, { params: before ? { limit, before } : { limit } })
|
|
287
|
+
getAuditLog: (slug, limit = 50, before) => api.get(`${endpoint3}/${slug}/audit`, { params: before ? { limit, before } : { limit } }),
|
|
288
|
+
activity: (limit = 12) => api.get(`${endpoint3}/activity`, { params: { limit } })
|
|
287
289
|
});
|
|
288
290
|
|
|
289
291
|
// src/resources/chat.ts
|
|
@@ -398,7 +400,10 @@ var createAdminResource = (api) => ({
|
|
|
398
400
|
updateRole: (id, role) => api.patch(`${endpoint10}/users/${id}/role`, { role }),
|
|
399
401
|
broadcast: (message) => api.post(`${endpoint10}/broadcast`, { message }),
|
|
400
402
|
setMaintenance: (active, message, endsAt) => api.post(`${endpoint10}/maintenance`, { active, message, endsAt }),
|
|
401
|
-
getStats: () => api.get(`${endpoint10}/stats`)
|
|
403
|
+
getStats: () => api.get(`${endpoint10}/stats`),
|
|
404
|
+
addViolation: (userId, reason) => api.post(`${endpoint10}/users/${userId}/violations`, { reason }),
|
|
405
|
+
revokeViolation: (violationId) => api.delete(`${endpoint10}/violations/${violationId}`),
|
|
406
|
+
getUserViolations: (userId) => api.get(`${endpoint10}/users/${userId}/violations`)
|
|
402
407
|
});
|
|
403
408
|
|
|
404
409
|
// src/resources/index.ts
|
package/dist/index.mjs
CHANGED
|
@@ -189,7 +189,8 @@ var createUserResource = (api) => ({
|
|
|
189
189
|
updateProfile: (data) => api.patch(`${endpoint2}/me`, data),
|
|
190
190
|
deleteAccount: () => api.delete(`${endpoint2}/me`),
|
|
191
191
|
updateRole: (id, role) => api.patch(`/api/admin/users/${id}/role`, { role }),
|
|
192
|
-
disable: (id) => api.post(`/api/admin/users/${id}/disable`)
|
|
192
|
+
disable: (id) => api.post(`/api/admin/users/${id}/disable`),
|
|
193
|
+
getMyViolations: () => api.get(`${endpoint2}/me/violations`)
|
|
193
194
|
});
|
|
194
195
|
|
|
195
196
|
// src/resources/room.ts
|
|
@@ -233,7 +234,8 @@ var createRoomResource = (api) => ({
|
|
|
233
234
|
vote: (slug, type) => api.post(`${endpoint3}/${slug}/booth/vote`, { type }),
|
|
234
235
|
grabTrack: (slug, playlistId) => api.post(`${endpoint3}/${slug}/booth/grab`, playlistId ? { playlistId } : {}),
|
|
235
236
|
getHistory: (slug, page = 1, limit = 20) => api.get(`${endpoint3}/${slug}/history`, { params: { page, limit } }),
|
|
236
|
-
getAuditLog: (slug, limit = 50, before) => api.get(`${endpoint3}/${slug}/audit`, { params: before ? { limit, before } : { limit } })
|
|
237
|
+
getAuditLog: (slug, limit = 50, before) => api.get(`${endpoint3}/${slug}/audit`, { params: before ? { limit, before } : { limit } }),
|
|
238
|
+
activity: (limit = 12) => api.get(`${endpoint3}/activity`, { params: { limit } })
|
|
237
239
|
});
|
|
238
240
|
|
|
239
241
|
// src/resources/chat.ts
|
|
@@ -348,7 +350,10 @@ var createAdminResource = (api) => ({
|
|
|
348
350
|
updateRole: (id, role) => api.patch(`${endpoint10}/users/${id}/role`, { role }),
|
|
349
351
|
broadcast: (message) => api.post(`${endpoint10}/broadcast`, { message }),
|
|
350
352
|
setMaintenance: (active, message, endsAt) => api.post(`${endpoint10}/maintenance`, { active, message, endsAt }),
|
|
351
|
-
getStats: () => api.get(`${endpoint10}/stats`)
|
|
353
|
+
getStats: () => api.get(`${endpoint10}/stats`),
|
|
354
|
+
addViolation: (userId, reason) => api.post(`${endpoint10}/users/${userId}/violations`, { reason }),
|
|
355
|
+
revokeViolation: (violationId) => api.delete(`${endpoint10}/violations/${violationId}`),
|
|
356
|
+
getUserViolations: (userId) => api.get(`${endpoint10}/users/${userId}/violations`)
|
|
352
357
|
});
|
|
353
358
|
|
|
354
359
|
// src/resources/index.ts
|