@borealise/api 1.0.1 → 1.0.3
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 +25 -0
- package/dist/index.mjs +23 -0
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -97,8 +97,11 @@ interface AuthUser {
|
|
|
97
97
|
email?: string;
|
|
98
98
|
username: string;
|
|
99
99
|
displayName: string | null;
|
|
100
|
+
avatarId: string;
|
|
100
101
|
bio: string | null;
|
|
101
102
|
globalRole: string;
|
|
103
|
+
xp: number;
|
|
104
|
+
level: number;
|
|
102
105
|
flags?: number;
|
|
103
106
|
subscriptionType?: string;
|
|
104
107
|
subscriptionExpiresAt?: string | null;
|
|
@@ -206,6 +209,8 @@ interface RoomMember {
|
|
|
206
209
|
id: number;
|
|
207
210
|
username: string;
|
|
208
211
|
displayName: string | null;
|
|
212
|
+
avatarId: string;
|
|
213
|
+
level: number;
|
|
209
214
|
};
|
|
210
215
|
}
|
|
211
216
|
interface CreateRoomData {
|
|
@@ -254,6 +259,8 @@ interface RoomUserState {
|
|
|
254
259
|
userId: number;
|
|
255
260
|
username: string;
|
|
256
261
|
displayName: string | null;
|
|
262
|
+
avatarId: string;
|
|
263
|
+
level: number;
|
|
257
264
|
role: RoomRole;
|
|
258
265
|
joinedAt: number;
|
|
259
266
|
}
|
|
@@ -261,6 +268,7 @@ interface BoothDJ {
|
|
|
261
268
|
userId: number;
|
|
262
269
|
username: string;
|
|
263
270
|
displayName: string | null;
|
|
271
|
+
avatarId: string;
|
|
264
272
|
role: RoomRole;
|
|
265
273
|
}
|
|
266
274
|
interface BoothMedia {
|
|
@@ -566,4 +574,44 @@ declare class SourceResource extends ApiResource<MediaSearchResult> {
|
|
|
566
574
|
}
|
|
567
575
|
declare const sourceResource: SourceResource;
|
|
568
576
|
|
|
569
|
-
|
|
577
|
+
type AvatarUnlockType = 'free' | 'level' | 'subscription';
|
|
578
|
+
interface AvatarCatalogItem {
|
|
579
|
+
id: string;
|
|
580
|
+
unlockType: AvatarUnlockType;
|
|
581
|
+
requiredLevel: number | null;
|
|
582
|
+
/** Whether the user has unlocked (or has free access to) this avatar */
|
|
583
|
+
unlocked: boolean;
|
|
584
|
+
/** Whether the user currently meets the requirement to unlock it */
|
|
585
|
+
eligible: boolean;
|
|
586
|
+
}
|
|
587
|
+
interface AvatarCatalogResponse {
|
|
588
|
+
success: boolean;
|
|
589
|
+
data: {
|
|
590
|
+
avatars: AvatarCatalogItem[];
|
|
591
|
+
level: number;
|
|
592
|
+
xp: number;
|
|
593
|
+
};
|
|
594
|
+
}
|
|
595
|
+
interface EquipAvatarData {
|
|
596
|
+
avatarId: string;
|
|
597
|
+
}
|
|
598
|
+
declare class ShopResource extends ApiResource {
|
|
599
|
+
protected readonly endpoint = "/shop";
|
|
600
|
+
getAvatarCatalog(): Promise<ApiResponse<AvatarCatalogResponse>>;
|
|
601
|
+
unlockAvatar(avatarId: string): Promise<ApiResponse<{
|
|
602
|
+
success: boolean;
|
|
603
|
+
data: {
|
|
604
|
+
avatarId: string;
|
|
605
|
+
unlocked: boolean;
|
|
606
|
+
};
|
|
607
|
+
}>>;
|
|
608
|
+
equipAvatar(avatarId: string): Promise<ApiResponse<{
|
|
609
|
+
success: boolean;
|
|
610
|
+
data: {
|
|
611
|
+
avatarId: string;
|
|
612
|
+
};
|
|
613
|
+
}>>;
|
|
614
|
+
}
|
|
615
|
+
declare const shopResource: ShopResource;
|
|
616
|
+
|
|
617
|
+
export { type AddMediaData, Api, type ApiConfig, ApiError, ApiResource, type ApiResponse, AuthResource, type AuthResponse, type AuthUser, type AvatarCatalogItem, type AvatarCatalogResponse, type AvatarUnlockType, type BackendErrorResponse, type BoothDJ, type BoothMedia, type BoothResponse, type BoothState, type ChatMessage, type ChatMessageResponse, type ChatMessagesResponse, ChatResource, type CreateRoomData, type EquipAvatarData, type FeaturedRoomsResponse, type GrabResponse, type ImportPlaylistData, type ImportPlaylistResponse, type ImportResult, type JoinRoomResponse, Logger, type LoginCredentials, type MeResponse, type MediaItem, type MediaItemResponse, type MediaSearchResult, type MediaSource, type PaginatedResponse, type Playlist, PlaylistResource, type PlaylistResponse, type PlaylistsResponse, type RefreshResponse, type RegisterData, type ResourceOptions, type Room, type RoomMember, RoomResource, type RoomResponse, type RoomRole, type RoomStaffResponse, type RoomUserState, type RoomsResponse, type SendMessageData, ShopResource, type ShuffleResponse, type SoundCloudSearchResponse, type SoundCloudTrackResponse, SourceResource, type UpdateProfileData, type UpdateRoomData, type User, UserResource, type UserResponse, type VoteResponse, type WaitlistResponse, type WaitlistUser, type YouTubeSearchResponse, type YouTubeVideoResponse, authResource, chatResource, playlistResource, roomResource, shopResource, sourceResource, userResource };
|
package/dist/index.d.ts
CHANGED
|
@@ -97,8 +97,11 @@ interface AuthUser {
|
|
|
97
97
|
email?: string;
|
|
98
98
|
username: string;
|
|
99
99
|
displayName: string | null;
|
|
100
|
+
avatarId: string;
|
|
100
101
|
bio: string | null;
|
|
101
102
|
globalRole: string;
|
|
103
|
+
xp: number;
|
|
104
|
+
level: number;
|
|
102
105
|
flags?: number;
|
|
103
106
|
subscriptionType?: string;
|
|
104
107
|
subscriptionExpiresAt?: string | null;
|
|
@@ -206,6 +209,8 @@ interface RoomMember {
|
|
|
206
209
|
id: number;
|
|
207
210
|
username: string;
|
|
208
211
|
displayName: string | null;
|
|
212
|
+
avatarId: string;
|
|
213
|
+
level: number;
|
|
209
214
|
};
|
|
210
215
|
}
|
|
211
216
|
interface CreateRoomData {
|
|
@@ -254,6 +259,8 @@ interface RoomUserState {
|
|
|
254
259
|
userId: number;
|
|
255
260
|
username: string;
|
|
256
261
|
displayName: string | null;
|
|
262
|
+
avatarId: string;
|
|
263
|
+
level: number;
|
|
257
264
|
role: RoomRole;
|
|
258
265
|
joinedAt: number;
|
|
259
266
|
}
|
|
@@ -261,6 +268,7 @@ interface BoothDJ {
|
|
|
261
268
|
userId: number;
|
|
262
269
|
username: string;
|
|
263
270
|
displayName: string | null;
|
|
271
|
+
avatarId: string;
|
|
264
272
|
role: RoomRole;
|
|
265
273
|
}
|
|
266
274
|
interface BoothMedia {
|
|
@@ -566,4 +574,44 @@ declare class SourceResource extends ApiResource<MediaSearchResult> {
|
|
|
566
574
|
}
|
|
567
575
|
declare const sourceResource: SourceResource;
|
|
568
576
|
|
|
569
|
-
|
|
577
|
+
type AvatarUnlockType = 'free' | 'level' | 'subscription';
|
|
578
|
+
interface AvatarCatalogItem {
|
|
579
|
+
id: string;
|
|
580
|
+
unlockType: AvatarUnlockType;
|
|
581
|
+
requiredLevel: number | null;
|
|
582
|
+
/** Whether the user has unlocked (or has free access to) this avatar */
|
|
583
|
+
unlocked: boolean;
|
|
584
|
+
/** Whether the user currently meets the requirement to unlock it */
|
|
585
|
+
eligible: boolean;
|
|
586
|
+
}
|
|
587
|
+
interface AvatarCatalogResponse {
|
|
588
|
+
success: boolean;
|
|
589
|
+
data: {
|
|
590
|
+
avatars: AvatarCatalogItem[];
|
|
591
|
+
level: number;
|
|
592
|
+
xp: number;
|
|
593
|
+
};
|
|
594
|
+
}
|
|
595
|
+
interface EquipAvatarData {
|
|
596
|
+
avatarId: string;
|
|
597
|
+
}
|
|
598
|
+
declare class ShopResource extends ApiResource {
|
|
599
|
+
protected readonly endpoint = "/shop";
|
|
600
|
+
getAvatarCatalog(): Promise<ApiResponse<AvatarCatalogResponse>>;
|
|
601
|
+
unlockAvatar(avatarId: string): Promise<ApiResponse<{
|
|
602
|
+
success: boolean;
|
|
603
|
+
data: {
|
|
604
|
+
avatarId: string;
|
|
605
|
+
unlocked: boolean;
|
|
606
|
+
};
|
|
607
|
+
}>>;
|
|
608
|
+
equipAvatar(avatarId: string): Promise<ApiResponse<{
|
|
609
|
+
success: boolean;
|
|
610
|
+
data: {
|
|
611
|
+
avatarId: string;
|
|
612
|
+
};
|
|
613
|
+
}>>;
|
|
614
|
+
}
|
|
615
|
+
declare const shopResource: ShopResource;
|
|
616
|
+
|
|
617
|
+
export { type AddMediaData, Api, type ApiConfig, ApiError, ApiResource, type ApiResponse, AuthResource, type AuthResponse, type AuthUser, type AvatarCatalogItem, type AvatarCatalogResponse, type AvatarUnlockType, type BackendErrorResponse, type BoothDJ, type BoothMedia, type BoothResponse, type BoothState, type ChatMessage, type ChatMessageResponse, type ChatMessagesResponse, ChatResource, type CreateRoomData, type EquipAvatarData, type FeaturedRoomsResponse, type GrabResponse, type ImportPlaylistData, type ImportPlaylistResponse, type ImportResult, type JoinRoomResponse, Logger, type LoginCredentials, type MeResponse, type MediaItem, type MediaItemResponse, type MediaSearchResult, type MediaSource, type PaginatedResponse, type Playlist, PlaylistResource, type PlaylistResponse, type PlaylistsResponse, type RefreshResponse, type RegisterData, type ResourceOptions, type Room, type RoomMember, RoomResource, type RoomResponse, type RoomRole, type RoomStaffResponse, type RoomUserState, type RoomsResponse, type SendMessageData, ShopResource, type ShuffleResponse, type SoundCloudSearchResponse, type SoundCloudTrackResponse, SourceResource, type UpdateProfileData, type UpdateRoomData, type User, UserResource, type UserResponse, type VoteResponse, type WaitlistResponse, type WaitlistUser, type YouTubeSearchResponse, type YouTubeVideoResponse, authResource, chatResource, playlistResource, roomResource, shopResource, sourceResource, userResource };
|
package/dist/index.js
CHANGED
|
@@ -38,12 +38,14 @@ __export(index_exports, {
|
|
|
38
38
|
Logger: () => Logger,
|
|
39
39
|
PlaylistResource: () => PlaylistResource,
|
|
40
40
|
RoomResource: () => RoomResource,
|
|
41
|
+
ShopResource: () => ShopResource,
|
|
41
42
|
SourceResource: () => SourceResource,
|
|
42
43
|
UserResource: () => UserResource,
|
|
43
44
|
authResource: () => authResource,
|
|
44
45
|
chatResource: () => chatResource,
|
|
45
46
|
playlistResource: () => playlistResource,
|
|
46
47
|
roomResource: () => roomResource,
|
|
48
|
+
shopResource: () => shopResource,
|
|
47
49
|
sourceResource: () => sourceResource,
|
|
48
50
|
userResource: () => userResource
|
|
49
51
|
});
|
|
@@ -602,6 +604,27 @@ var SourceResource = class extends ApiResource {
|
|
|
602
604
|
}
|
|
603
605
|
};
|
|
604
606
|
var sourceResource = new SourceResource();
|
|
607
|
+
|
|
608
|
+
// src/resources/ShopResource.ts
|
|
609
|
+
var ShopResource = class extends ApiResource {
|
|
610
|
+
constructor() {
|
|
611
|
+
super(...arguments);
|
|
612
|
+
this.endpoint = "/shop";
|
|
613
|
+
}
|
|
614
|
+
// GET /api/shop/avatars
|
|
615
|
+
async getAvatarCatalog() {
|
|
616
|
+
return this.api.get(`${this.endpoint}/avatars`);
|
|
617
|
+
}
|
|
618
|
+
// POST /api/shop/avatars/:avatarId/unlock
|
|
619
|
+
async unlockAvatar(avatarId) {
|
|
620
|
+
return this.api.post(`${this.endpoint}/avatars/${avatarId}/unlock`);
|
|
621
|
+
}
|
|
622
|
+
// PATCH /api/shop/avatars/equip
|
|
623
|
+
async equipAvatar(avatarId) {
|
|
624
|
+
return this.api.patch(`${this.endpoint}/avatars/equip`, { avatarId });
|
|
625
|
+
}
|
|
626
|
+
};
|
|
627
|
+
var shopResource = new ShopResource();
|
|
605
628
|
// Annotate the CommonJS export names for ESM import in node:
|
|
606
629
|
0 && (module.exports = {
|
|
607
630
|
Api,
|
|
@@ -612,12 +635,14 @@ var sourceResource = new SourceResource();
|
|
|
612
635
|
Logger,
|
|
613
636
|
PlaylistResource,
|
|
614
637
|
RoomResource,
|
|
638
|
+
ShopResource,
|
|
615
639
|
SourceResource,
|
|
616
640
|
UserResource,
|
|
617
641
|
authResource,
|
|
618
642
|
chatResource,
|
|
619
643
|
playlistResource,
|
|
620
644
|
roomResource,
|
|
645
|
+
shopResource,
|
|
621
646
|
sourceResource,
|
|
622
647
|
userResource
|
|
623
648
|
});
|
package/dist/index.mjs
CHANGED
|
@@ -551,6 +551,27 @@ var SourceResource = class extends ApiResource {
|
|
|
551
551
|
}
|
|
552
552
|
};
|
|
553
553
|
var sourceResource = new SourceResource();
|
|
554
|
+
|
|
555
|
+
// src/resources/ShopResource.ts
|
|
556
|
+
var ShopResource = class extends ApiResource {
|
|
557
|
+
constructor() {
|
|
558
|
+
super(...arguments);
|
|
559
|
+
this.endpoint = "/shop";
|
|
560
|
+
}
|
|
561
|
+
// GET /api/shop/avatars
|
|
562
|
+
async getAvatarCatalog() {
|
|
563
|
+
return this.api.get(`${this.endpoint}/avatars`);
|
|
564
|
+
}
|
|
565
|
+
// POST /api/shop/avatars/:avatarId/unlock
|
|
566
|
+
async unlockAvatar(avatarId) {
|
|
567
|
+
return this.api.post(`${this.endpoint}/avatars/${avatarId}/unlock`);
|
|
568
|
+
}
|
|
569
|
+
// PATCH /api/shop/avatars/equip
|
|
570
|
+
async equipAvatar(avatarId) {
|
|
571
|
+
return this.api.patch(`${this.endpoint}/avatars/equip`, { avatarId });
|
|
572
|
+
}
|
|
573
|
+
};
|
|
574
|
+
var shopResource = new ShopResource();
|
|
554
575
|
export {
|
|
555
576
|
Api,
|
|
556
577
|
ApiError,
|
|
@@ -560,12 +581,14 @@ export {
|
|
|
560
581
|
Logger,
|
|
561
582
|
PlaylistResource,
|
|
562
583
|
RoomResource,
|
|
584
|
+
ShopResource,
|
|
563
585
|
SourceResource,
|
|
564
586
|
UserResource,
|
|
565
587
|
authResource,
|
|
566
588
|
chatResource,
|
|
567
589
|
playlistResource,
|
|
568
590
|
roomResource,
|
|
591
|
+
shopResource,
|
|
569
592
|
sourceResource,
|
|
570
593
|
userResource
|
|
571
594
|
};
|