@borealise/api 2.0.0-alpha.6 → 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 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
@@ -379,6 +380,7 @@ var createFriendResource = (api) => ({
379
380
  });
380
381
 
381
382
  // src/resources/admin.ts
383
+ var endpoint10 = "/admin";
382
384
  var createAdminResource = (api) => ({
383
385
  listUsers: (params = {}) => {
384
386
  const query = new URLSearchParams();
@@ -390,14 +392,17 @@ var createAdminResource = (api) => ({
390
392
  if (params.sortBy) query.set("sortBy", params.sortBy);
391
393
  if (params.sortDir) query.set("sortDir", params.sortDir);
392
394
  const qs = query.toString();
393
- return api.get(`/api/admin/users${qs ? `?${qs}` : ""}`);
395
+ return api.get(`${endpoint10}/users${qs ? `?${qs}` : ""}`);
394
396
  },
395
- enableUser: (id) => api.post(`/api/admin/users/${id}/enable`),
396
- disableUser: (id) => api.post(`/api/admin/users/${id}/disable`),
397
- updateRole: (id, role) => api.patch(`/api/admin/users/${id}/role`, { role }),
398
- broadcast: (message) => api.post("/api/admin/broadcast", { message }),
399
- setMaintenance: (active, message, endsAt) => api.post("/api/admin/maintenance", { active, message, endsAt }),
400
- getStats: () => api.get("/api/admin/stats")
397
+ enableUser: (id) => api.post(`${endpoint10}/users/${id}/enable`),
398
+ disableUser: (id) => api.post(`${endpoint10}/users/${id}/disable`),
399
+ updateRole: (id, role) => api.patch(`${endpoint10}/users/${id}/role`, { role }),
400
+ broadcast: (message) => api.post(`${endpoint10}/broadcast`, { message }),
401
+ setMaintenance: (active, message, endsAt) => api.post(`${endpoint10}/maintenance`, { active, message, endsAt }),
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`)
401
406
  });
402
407
 
403
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
@@ -329,6 +330,7 @@ var createFriendResource = (api) => ({
329
330
  });
330
331
 
331
332
  // src/resources/admin.ts
333
+ var endpoint10 = "/admin";
332
334
  var createAdminResource = (api) => ({
333
335
  listUsers: (params = {}) => {
334
336
  const query = new URLSearchParams();
@@ -340,14 +342,17 @@ var createAdminResource = (api) => ({
340
342
  if (params.sortBy) query.set("sortBy", params.sortBy);
341
343
  if (params.sortDir) query.set("sortDir", params.sortDir);
342
344
  const qs = query.toString();
343
- return api.get(`/api/admin/users${qs ? `?${qs}` : ""}`);
345
+ return api.get(`${endpoint10}/users${qs ? `?${qs}` : ""}`);
344
346
  },
345
- enableUser: (id) => api.post(`/api/admin/users/${id}/enable`),
346
- disableUser: (id) => api.post(`/api/admin/users/${id}/disable`),
347
- updateRole: (id, role) => api.patch(`/api/admin/users/${id}/role`, { role }),
348
- broadcast: (message) => api.post("/api/admin/broadcast", { message }),
349
- setMaintenance: (active, message, endsAt) => api.post("/api/admin/maintenance", { active, message, endsAt }),
350
- getStats: () => api.get("/api/admin/stats")
347
+ enableUser: (id) => api.post(`${endpoint10}/users/${id}/enable`),
348
+ disableUser: (id) => api.post(`${endpoint10}/users/${id}/disable`),
349
+ updateRole: (id, role) => api.patch(`${endpoint10}/users/${id}/role`, { role }),
350
+ broadcast: (message) => api.post(`${endpoint10}/broadcast`, { message }),
351
+ setMaintenance: (active, message, endsAt) => api.post(`${endpoint10}/maintenance`, { active, message, endsAt }),
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`)
351
356
  });
352
357
 
353
358
  // src/resources/index.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@borealise/api",
3
- "version": "2.0.0-alpha.6",
3
+ "version": "2.0.0-alpha.8",
4
4
  "description": "Official API client for Borealise",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",