@borealise/api 2.0.0-alpha.7 → 2.0.0-alpha.8
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 +49 -1
- package/dist/index.d.ts +49 -1
- package/dist/index.js +6 -2
- package/dist/index.mjs +6 -2
- 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
|
|
|
@@ -824,6 +840,7 @@ interface AdminUserEntry {
|
|
|
824
840
|
avatarId: string;
|
|
825
841
|
globalRole: GlobalRole;
|
|
826
842
|
disabled: boolean;
|
|
843
|
+
permanentBan: boolean;
|
|
827
844
|
emailVerified: boolean;
|
|
828
845
|
xp: number;
|
|
829
846
|
createdAt: string;
|
|
@@ -857,6 +874,31 @@ interface AdminListUsersParams {
|
|
|
857
874
|
sortBy?: 'id' | 'username' | 'createdAt';
|
|
858
875
|
sortDir?: 'asc' | 'desc';
|
|
859
876
|
}
|
|
877
|
+
interface AccountViolation {
|
|
878
|
+
id: number;
|
|
879
|
+
adminId: number;
|
|
880
|
+
adminUsername: string;
|
|
881
|
+
reason: string;
|
|
882
|
+
revoked: boolean;
|
|
883
|
+
revokedAt: string | null;
|
|
884
|
+
revokerId: number | null;
|
|
885
|
+
createdAt: string;
|
|
886
|
+
}
|
|
887
|
+
interface UserViolationsResponse {
|
|
888
|
+
success: boolean;
|
|
889
|
+
data: {
|
|
890
|
+
violations: AccountViolation[];
|
|
891
|
+
permanentBan: boolean;
|
|
892
|
+
};
|
|
893
|
+
}
|
|
894
|
+
interface AddViolationResponse {
|
|
895
|
+
success: boolean;
|
|
896
|
+
data: {
|
|
897
|
+
violation: AccountViolation;
|
|
898
|
+
permanentlyBanned: boolean;
|
|
899
|
+
activeViolations: number;
|
|
900
|
+
};
|
|
901
|
+
}
|
|
860
902
|
interface AdminResource {
|
|
861
903
|
listUsers(params?: AdminListUsersParams): Promise<ApiResponse<AdminUsersResponse>>;
|
|
862
904
|
enableUser(id: number): Promise<ApiResponse<{
|
|
@@ -884,6 +926,12 @@ interface AdminResource {
|
|
|
884
926
|
};
|
|
885
927
|
}>>;
|
|
886
928
|
getStats(): Promise<ApiResponse<AdminStatsResponse>>;
|
|
929
|
+
addViolation(userId: number, reason: string): Promise<ApiResponse<AddViolationResponse>>;
|
|
930
|
+
revokeViolation(violationId: number): Promise<ApiResponse<{
|
|
931
|
+
success: boolean;
|
|
932
|
+
data: null;
|
|
933
|
+
}>>;
|
|
934
|
+
getUserViolations(userId: number): Promise<ApiResponse<UserViolationsResponse>>;
|
|
887
935
|
}
|
|
888
936
|
declare const createAdminResource: (api: Api) => AdminResource;
|
|
889
937
|
|
|
@@ -902,4 +950,4 @@ interface ApiClient {
|
|
|
902
950
|
}
|
|
903
951
|
declare const createApiClient: (config: ApiConfig) => ApiClient;
|
|
904
952
|
|
|
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 };
|
|
953
|
+
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 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
|
|
|
@@ -824,6 +840,7 @@ interface AdminUserEntry {
|
|
|
824
840
|
avatarId: string;
|
|
825
841
|
globalRole: GlobalRole;
|
|
826
842
|
disabled: boolean;
|
|
843
|
+
permanentBan: boolean;
|
|
827
844
|
emailVerified: boolean;
|
|
828
845
|
xp: number;
|
|
829
846
|
createdAt: string;
|
|
@@ -857,6 +874,31 @@ interface AdminListUsersParams {
|
|
|
857
874
|
sortBy?: 'id' | 'username' | 'createdAt';
|
|
858
875
|
sortDir?: 'asc' | 'desc';
|
|
859
876
|
}
|
|
877
|
+
interface AccountViolation {
|
|
878
|
+
id: number;
|
|
879
|
+
adminId: number;
|
|
880
|
+
adminUsername: string;
|
|
881
|
+
reason: string;
|
|
882
|
+
revoked: boolean;
|
|
883
|
+
revokedAt: string | null;
|
|
884
|
+
revokerId: number | null;
|
|
885
|
+
createdAt: string;
|
|
886
|
+
}
|
|
887
|
+
interface UserViolationsResponse {
|
|
888
|
+
success: boolean;
|
|
889
|
+
data: {
|
|
890
|
+
violations: AccountViolation[];
|
|
891
|
+
permanentBan: boolean;
|
|
892
|
+
};
|
|
893
|
+
}
|
|
894
|
+
interface AddViolationResponse {
|
|
895
|
+
success: boolean;
|
|
896
|
+
data: {
|
|
897
|
+
violation: AccountViolation;
|
|
898
|
+
permanentlyBanned: boolean;
|
|
899
|
+
activeViolations: number;
|
|
900
|
+
};
|
|
901
|
+
}
|
|
860
902
|
interface AdminResource {
|
|
861
903
|
listUsers(params?: AdminListUsersParams): Promise<ApiResponse<AdminUsersResponse>>;
|
|
862
904
|
enableUser(id: number): Promise<ApiResponse<{
|
|
@@ -884,6 +926,12 @@ interface AdminResource {
|
|
|
884
926
|
};
|
|
885
927
|
}>>;
|
|
886
928
|
getStats(): Promise<ApiResponse<AdminStatsResponse>>;
|
|
929
|
+
addViolation(userId: number, reason: string): Promise<ApiResponse<AddViolationResponse>>;
|
|
930
|
+
revokeViolation(violationId: number): Promise<ApiResponse<{
|
|
931
|
+
success: boolean;
|
|
932
|
+
data: null;
|
|
933
|
+
}>>;
|
|
934
|
+
getUserViolations(userId: number): Promise<ApiResponse<UserViolationsResponse>>;
|
|
887
935
|
}
|
|
888
936
|
declare const createAdminResource: (api: Api) => AdminResource;
|
|
889
937
|
|
|
@@ -902,4 +950,4 @@ interface ApiClient {
|
|
|
902
950
|
}
|
|
903
951
|
declare const createApiClient: (config: ApiConfig) => ApiClient;
|
|
904
952
|
|
|
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 };
|
|
953
|
+
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 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
|
|
@@ -398,7 +399,10 @@ var createAdminResource = (api) => ({
|
|
|
398
399
|
updateRole: (id, role) => api.patch(`${endpoint10}/users/${id}/role`, { role }),
|
|
399
400
|
broadcast: (message) => api.post(`${endpoint10}/broadcast`, { message }),
|
|
400
401
|
setMaintenance: (active, message, endsAt) => api.post(`${endpoint10}/maintenance`, { active, message, endsAt }),
|
|
401
|
-
getStats: () => api.get(`${endpoint10}/stats`)
|
|
402
|
+
getStats: () => api.get(`${endpoint10}/stats`),
|
|
403
|
+
addViolation: (userId, reason) => api.post(`${endpoint10}/users/${userId}/violations`, { reason }),
|
|
404
|
+
revokeViolation: (violationId) => api.delete(`${endpoint10}/violations/${violationId}`),
|
|
405
|
+
getUserViolations: (userId) => api.get(`${endpoint10}/users/${userId}/violations`)
|
|
402
406
|
});
|
|
403
407
|
|
|
404
408
|
// 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
|
|
@@ -348,7 +349,10 @@ var createAdminResource = (api) => ({
|
|
|
348
349
|
updateRole: (id, role) => api.patch(`${endpoint10}/users/${id}/role`, { role }),
|
|
349
350
|
broadcast: (message) => api.post(`${endpoint10}/broadcast`, { message }),
|
|
350
351
|
setMaintenance: (active, message, endsAt) => api.post(`${endpoint10}/maintenance`, { active, message, endsAt }),
|
|
351
|
-
getStats: () => api.get(`${endpoint10}/stats`)
|
|
352
|
+
getStats: () => api.get(`${endpoint10}/stats`),
|
|
353
|
+
addViolation: (userId, reason) => api.post(`${endpoint10}/users/${userId}/violations`, { reason }),
|
|
354
|
+
revokeViolation: (violationId) => api.delete(`${endpoint10}/violations/${violationId}`),
|
|
355
|
+
getUserViolations: (userId) => api.get(`${endpoint10}/users/${userId}/violations`)
|
|
352
356
|
});
|
|
353
357
|
|
|
354
358
|
// src/resources/index.ts
|