@borealise/api 2.0.0-alpha.2 → 2.0.0-alpha.4
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 +25 -0
- package/dist/index.d.ts +25 -0
- package/dist/index.js +5 -2
- package/dist/index.mjs +5 -2
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -117,6 +117,12 @@ interface AuthResource {
|
|
|
117
117
|
message: string;
|
|
118
118
|
}>>;
|
|
119
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
|
+
}>>;
|
|
120
126
|
}
|
|
121
127
|
declare const createAuthResource: (api: Api) => AuthResource;
|
|
122
128
|
|
|
@@ -416,6 +422,24 @@ interface RoomHistoryResponse {
|
|
|
416
422
|
pagination: PaginationMeta;
|
|
417
423
|
};
|
|
418
424
|
}
|
|
425
|
+
type AuditAction = 'kick' | 'ban' | 'unban' | 'mute' | 'unmute' | 'role_change' | 'waitlist_move' | 'waitlist_remove' | 'track_skip';
|
|
426
|
+
interface RoomAuditLog {
|
|
427
|
+
id: number;
|
|
428
|
+
actorId: number;
|
|
429
|
+
actorUsername: string;
|
|
430
|
+
targetId: number | null;
|
|
431
|
+
targetUsername: string | null;
|
|
432
|
+
action: AuditAction;
|
|
433
|
+
metadata: string | null;
|
|
434
|
+
createdAt: string;
|
|
435
|
+
}
|
|
436
|
+
interface RoomAuditLogResponse {
|
|
437
|
+
success: boolean;
|
|
438
|
+
data: {
|
|
439
|
+
logs: RoomAuditLog[];
|
|
440
|
+
hasMore: boolean;
|
|
441
|
+
};
|
|
442
|
+
}
|
|
419
443
|
interface RoomResource {
|
|
420
444
|
list(): Promise<ApiResponse<RoomsResponse>>;
|
|
421
445
|
featured(): Promise<ApiResponse<FeaturedRoomsResponse>>;
|
|
@@ -502,6 +526,7 @@ interface RoomResource {
|
|
|
502
526
|
vote(slug: string, type: 'woot' | 'meh'): Promise<ApiResponse<VoteResponse>>;
|
|
503
527
|
grabTrack(slug: string, playlistId?: number): Promise<ApiResponse<GrabResponse>>;
|
|
504
528
|
getHistory(slug: string, page?: number, limit?: number): Promise<ApiResponse<RoomHistoryResponse>>;
|
|
529
|
+
getAuditLog(slug: string, limit?: number, before?: string): Promise<ApiResponse<RoomAuditLogResponse>>;
|
|
505
530
|
}
|
|
506
531
|
declare const createRoomResource: (api: Api) => RoomResource;
|
|
507
532
|
|
package/dist/index.d.ts
CHANGED
|
@@ -117,6 +117,12 @@ interface AuthResource {
|
|
|
117
117
|
message: string;
|
|
118
118
|
}>>;
|
|
119
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
|
+
}>>;
|
|
120
126
|
}
|
|
121
127
|
declare const createAuthResource: (api: Api) => AuthResource;
|
|
122
128
|
|
|
@@ -416,6 +422,24 @@ interface RoomHistoryResponse {
|
|
|
416
422
|
pagination: PaginationMeta;
|
|
417
423
|
};
|
|
418
424
|
}
|
|
425
|
+
type AuditAction = 'kick' | 'ban' | 'unban' | 'mute' | 'unmute' | 'role_change' | 'waitlist_move' | 'waitlist_remove' | 'track_skip';
|
|
426
|
+
interface RoomAuditLog {
|
|
427
|
+
id: number;
|
|
428
|
+
actorId: number;
|
|
429
|
+
actorUsername: string;
|
|
430
|
+
targetId: number | null;
|
|
431
|
+
targetUsername: string | null;
|
|
432
|
+
action: AuditAction;
|
|
433
|
+
metadata: string | null;
|
|
434
|
+
createdAt: string;
|
|
435
|
+
}
|
|
436
|
+
interface RoomAuditLogResponse {
|
|
437
|
+
success: boolean;
|
|
438
|
+
data: {
|
|
439
|
+
logs: RoomAuditLog[];
|
|
440
|
+
hasMore: boolean;
|
|
441
|
+
};
|
|
442
|
+
}
|
|
419
443
|
interface RoomResource {
|
|
420
444
|
list(): Promise<ApiResponse<RoomsResponse>>;
|
|
421
445
|
featured(): Promise<ApiResponse<FeaturedRoomsResponse>>;
|
|
@@ -502,6 +526,7 @@ interface RoomResource {
|
|
|
502
526
|
vote(slug: string, type: 'woot' | 'meh'): Promise<ApiResponse<VoteResponse>>;
|
|
503
527
|
grabTrack(slug: string, playlistId?: number): Promise<ApiResponse<GrabResponse>>;
|
|
504
528
|
getHistory(slug: string, page?: number, limit?: number): Promise<ApiResponse<RoomHistoryResponse>>;
|
|
529
|
+
getAuditLog(slug: string, limit?: number, before?: string): Promise<ApiResponse<RoomAuditLogResponse>>;
|
|
505
530
|
}
|
|
506
531
|
declare const createRoomResource: (api: Api) => RoomResource;
|
|
507
532
|
|
package/dist/index.js
CHANGED
|
@@ -225,7 +225,9 @@ var createAuthResource = (api) => ({
|
|
|
225
225
|
register: (data) => api.post(`${endpoint}/register`, data),
|
|
226
226
|
refresh: (refreshToken) => api.post(`${endpoint}/refresh`, { refreshToken }),
|
|
227
227
|
logout: () => api.post(`${endpoint}/logout`),
|
|
228
|
-
me: () => api.get(`${endpoint}/me`)
|
|
228
|
+
me: () => api.get(`${endpoint}/me`),
|
|
229
|
+
forgotPassword: (email) => api.post(`${endpoint}/forgot-password`, { email }),
|
|
230
|
+
resetPassword: (token, password) => api.post(`${endpoint}/reset-password`, { token, password })
|
|
229
231
|
});
|
|
230
232
|
|
|
231
233
|
// src/resources/user.ts
|
|
@@ -279,7 +281,8 @@ var createRoomResource = (api) => ({
|
|
|
279
281
|
),
|
|
280
282
|
vote: (slug, type) => api.post(`${endpoint3}/${slug}/booth/vote`, { type }),
|
|
281
283
|
grabTrack: (slug, playlistId) => api.post(`${endpoint3}/${slug}/booth/grab`, playlistId ? { playlistId } : {}),
|
|
282
|
-
getHistory: (slug, page = 1, limit = 20) => api.get(`${endpoint3}/${slug}/history`, { params: { page, limit } })
|
|
284
|
+
getHistory: (slug, page = 1, limit = 20) => api.get(`${endpoint3}/${slug}/history`, { params: { page, limit } }),
|
|
285
|
+
getAuditLog: (slug, limit = 50, before) => api.get(`${endpoint3}/${slug}/audit`, { params: before ? { limit, before } : { limit } })
|
|
283
286
|
});
|
|
284
287
|
|
|
285
288
|
// src/resources/chat.ts
|
package/dist/index.mjs
CHANGED
|
@@ -176,7 +176,9 @@ var createAuthResource = (api) => ({
|
|
|
176
176
|
register: (data) => api.post(`${endpoint}/register`, data),
|
|
177
177
|
refresh: (refreshToken) => api.post(`${endpoint}/refresh`, { refreshToken }),
|
|
178
178
|
logout: () => api.post(`${endpoint}/logout`),
|
|
179
|
-
me: () => api.get(`${endpoint}/me`)
|
|
179
|
+
me: () => api.get(`${endpoint}/me`),
|
|
180
|
+
forgotPassword: (email) => api.post(`${endpoint}/forgot-password`, { email }),
|
|
181
|
+
resetPassword: (token, password) => api.post(`${endpoint}/reset-password`, { token, password })
|
|
180
182
|
});
|
|
181
183
|
|
|
182
184
|
// src/resources/user.ts
|
|
@@ -230,7 +232,8 @@ var createRoomResource = (api) => ({
|
|
|
230
232
|
),
|
|
231
233
|
vote: (slug, type) => api.post(`${endpoint3}/${slug}/booth/vote`, { type }),
|
|
232
234
|
grabTrack: (slug, playlistId) => api.post(`${endpoint3}/${slug}/booth/grab`, playlistId ? { playlistId } : {}),
|
|
233
|
-
getHistory: (slug, page = 1, limit = 20) => api.get(`${endpoint3}/${slug}/history`, { params: { page, limit } })
|
|
235
|
+
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 } })
|
|
234
237
|
});
|
|
235
238
|
|
|
236
239
|
// src/resources/chat.ts
|