@borealise/api 1.0.0 → 1.0.2

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
@@ -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
  }
@@ -566,4 +573,44 @@ declare class SourceResource extends ApiResource<MediaSearchResult> {
566
573
  }
567
574
  declare const sourceResource: SourceResource;
568
575
 
569
- export { type AddMediaData, Api, type ApiConfig, ApiError, ApiResource, type ApiResponse, AuthResource, type AuthResponse, type AuthUser, type BackendErrorResponse, type BoothDJ, type BoothMedia, type BoothResponse, type BoothState, type ChatMessage, type ChatMessageResponse, type ChatMessagesResponse, ChatResource, type CreateRoomData, 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, 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, sourceResource, userResource };
576
+ type AvatarUnlockType = 'free' | 'level' | 'subscription';
577
+ interface AvatarCatalogItem {
578
+ id: string;
579
+ unlockType: AvatarUnlockType;
580
+ requiredLevel: number | null;
581
+ /** Whether the user has unlocked (or has free access to) this avatar */
582
+ unlocked: boolean;
583
+ /** Whether the user currently meets the requirement to unlock it */
584
+ eligible: boolean;
585
+ }
586
+ interface AvatarCatalogResponse {
587
+ success: boolean;
588
+ data: {
589
+ avatars: AvatarCatalogItem[];
590
+ level: number;
591
+ xp: number;
592
+ };
593
+ }
594
+ interface EquipAvatarData {
595
+ avatarId: string;
596
+ }
597
+ declare class ShopResource extends ApiResource {
598
+ protected readonly endpoint = "/shop";
599
+ getAvatarCatalog(): Promise<ApiResponse<AvatarCatalogResponse>>;
600
+ unlockAvatar(avatarId: string): Promise<ApiResponse<{
601
+ success: boolean;
602
+ data: {
603
+ avatarId: string;
604
+ unlocked: boolean;
605
+ };
606
+ }>>;
607
+ equipAvatar(avatarId: string): Promise<ApiResponse<{
608
+ success: boolean;
609
+ data: {
610
+ avatarId: string;
611
+ };
612
+ }>>;
613
+ }
614
+ declare const shopResource: ShopResource;
615
+
616
+ 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
  }
@@ -566,4 +573,44 @@ declare class SourceResource extends ApiResource<MediaSearchResult> {
566
573
  }
567
574
  declare const sourceResource: SourceResource;
568
575
 
569
- export { type AddMediaData, Api, type ApiConfig, ApiError, ApiResource, type ApiResponse, AuthResource, type AuthResponse, type AuthUser, type BackendErrorResponse, type BoothDJ, type BoothMedia, type BoothResponse, type BoothState, type ChatMessage, type ChatMessageResponse, type ChatMessagesResponse, ChatResource, type CreateRoomData, 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, 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, sourceResource, userResource };
576
+ type AvatarUnlockType = 'free' | 'level' | 'subscription';
577
+ interface AvatarCatalogItem {
578
+ id: string;
579
+ unlockType: AvatarUnlockType;
580
+ requiredLevel: number | null;
581
+ /** Whether the user has unlocked (or has free access to) this avatar */
582
+ unlocked: boolean;
583
+ /** Whether the user currently meets the requirement to unlock it */
584
+ eligible: boolean;
585
+ }
586
+ interface AvatarCatalogResponse {
587
+ success: boolean;
588
+ data: {
589
+ avatars: AvatarCatalogItem[];
590
+ level: number;
591
+ xp: number;
592
+ };
593
+ }
594
+ interface EquipAvatarData {
595
+ avatarId: string;
596
+ }
597
+ declare class ShopResource extends ApiResource {
598
+ protected readonly endpoint = "/shop";
599
+ getAvatarCatalog(): Promise<ApiResponse<AvatarCatalogResponse>>;
600
+ unlockAvatar(avatarId: string): Promise<ApiResponse<{
601
+ success: boolean;
602
+ data: {
603
+ avatarId: string;
604
+ unlocked: boolean;
605
+ };
606
+ }>>;
607
+ equipAvatar(avatarId: string): Promise<ApiResponse<{
608
+ success: boolean;
609
+ data: {
610
+ avatarId: string;
611
+ };
612
+ }>>;
613
+ }
614
+ declare const shopResource: ShopResource;
615
+
616
+ 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
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@borealise/api",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "Official API client for Borealise",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -34,10 +34,10 @@
34
34
  "homepage": "https://borealise.com",
35
35
  "repository": {
36
36
  "type": "git",
37
- "url": "https://github.com/borealise/api-client"
37
+ "url": "https://github.com/Borealise-Platform/api"
38
38
  },
39
39
  "bugs": {
40
- "url": "https://github.com/borealise/api-client/issues"
40
+ "url": "https://github.com/Borealise-Platform/api/issues"
41
41
  },
42
42
  "peerDependencies": {
43
43
  "axios": "^1.0.0"