@borealise/api 1.1.2 → 1.1.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 CHANGED
@@ -484,15 +484,16 @@ declare const roomResource: RoomResource;
484
484
  interface ChatMessage {
485
485
  id: string;
486
486
  room_id: number;
487
- user_id: number;
488
- username: string;
489
- display_name: string | null;
490
- role: RoomRole;
487
+ user_id?: number;
488
+ username?: string;
489
+ display_name?: string | null;
490
+ role?: RoomRole;
491
491
  global_role?: string | null;
492
492
  subscription_type?: string | null;
493
493
  subscription_months?: number;
494
494
  content: string;
495
495
  timestamp: number;
496
+ type?: 'user' | 'system';
496
497
  deleted?: boolean;
497
498
  }
498
499
  interface SendMessageData {
@@ -728,4 +729,49 @@ declare class SubscriptionResource extends ApiResource {
728
729
  }
729
730
  declare const subscriptionResource: SubscriptionResource;
730
731
 
731
- export { type AddMediaData, Api, type ApiConfig, ApiError, ApiResource, type ApiResponse, AuthResource, type AuthResponse, 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, ChatResource, type CreateIntentResponse, type CreateRoomData, type EquipAvatarData, type FeaturedRoomsResponse, type GlobalRole, type GrabResponse, type ImportPlaylistData, type ImportPlaylistResponse, type ImportResult, type JoinRoomResponse, Logger, type LoginCredentials, type MeResponse, type MediaItem, type MediaItemResponse, type MediaSearchResult, type MediaSource, type ModerateUserData, type MuteResponse, type PaginatedResponse, type Playlist, PlaylistResource, type PlaylistResponse, type PlaylistsResponse, type PortalResponse, type RefreshResponse, type RegisterData, type ResourceOptions, type Room, type RoomBan, type RoomBansResponse, type RoomMember, RoomResource, type RoomResponse, type RoomRole, type RoomStaffResponse, type RoomUserState, type RoomsResponse, type SendMessageData, ShopResource, type ShuffleResponse, type SoundCloudSearchResponse, type SoundCloudTrackResponse, SourceResource, type SubscriptionPlan, SubscriptionResource, type SubscriptionStatus, 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, subscriptionResource, userResource };
732
+ type FriendshipStatus = 'none' | 'pending_sent' | 'pending_received' | 'accepted' | 'blocked_by_me' | 'blocked_by_them';
733
+ interface FriendEntry {
734
+ id: number;
735
+ userId: number;
736
+ username: string;
737
+ displayName: string | null;
738
+ avatarId: string;
739
+ level: number;
740
+ status: 'pending' | 'accepted' | 'blocked';
741
+ isSender: boolean;
742
+ }
743
+ interface FriendList {
744
+ friends: FriendEntry[];
745
+ pendingReceived: FriendEntry[];
746
+ pendingSent: FriendEntry[];
747
+ }
748
+ interface FriendListResponse {
749
+ success: boolean;
750
+ data: FriendList;
751
+ }
752
+ interface FriendStatusResponse {
753
+ success: boolean;
754
+ data: {
755
+ status: FriendshipStatus;
756
+ friendshipId: number | null;
757
+ };
758
+ }
759
+ interface FriendActionResponse {
760
+ success: boolean;
761
+ data: {
762
+ status: FriendshipStatus;
763
+ } | null;
764
+ }
765
+ declare class FriendResource extends ApiResource<FriendEntry> {
766
+ protected readonly endpoint = "/api/friends";
767
+ list(): Promise<ApiResponse<FriendListResponse>>;
768
+ getStatus(targetUserId: number): Promise<ApiResponse<FriendStatusResponse>>;
769
+ sendRequest(targetUserId: number): Promise<ApiResponse<FriendActionResponse>>;
770
+ acceptRequest(friendshipId: number): Promise<ApiResponse<FriendActionResponse>>;
771
+ remove(friendshipId: number): Promise<ApiResponse<FriendActionResponse>>;
772
+ block(targetUserId: number): Promise<ApiResponse<FriendActionResponse>>;
773
+ unblock(targetUserId: number): Promise<ApiResponse<FriendActionResponse>>;
774
+ }
775
+ declare const friendResource: FriendResource;
776
+
777
+ export { type AddMediaData, Api, type ApiConfig, ApiError, ApiResource, type ApiResponse, AuthResource, type AuthResponse, 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, ChatResource, type CreateIntentResponse, type CreateRoomData, type EquipAvatarData, type FeaturedRoomsResponse, type FriendActionResponse, type FriendEntry, type FriendList, type FriendListResponse, FriendResource, type FriendStatusResponse, type FriendshipStatus, type GlobalRole, type GrabResponse, type ImportPlaylistData, type ImportPlaylistResponse, type ImportResult, type JoinRoomResponse, Logger, type LoginCredentials, type MeResponse, type MediaItem, type MediaItemResponse, type MediaSearchResult, type MediaSource, type ModerateUserData, type MuteResponse, type PaginatedResponse, type Playlist, PlaylistResource, type PlaylistResponse, type PlaylistsResponse, type PortalResponse, type RefreshResponse, type RegisterData, type ResourceOptions, type Room, type RoomBan, type RoomBansResponse, type RoomMember, RoomResource, type RoomResponse, type RoomRole, type RoomStaffResponse, type RoomUserState, type RoomsResponse, type SendMessageData, ShopResource, type ShuffleResponse, type SoundCloudSearchResponse, type SoundCloudTrackResponse, SourceResource, type SubscriptionPlan, SubscriptionResource, type SubscriptionStatus, type UpdateProfileData, type UpdateRoomData, type User, UserResource, type UserResponse, type VoteResponse, type WaitlistResponse, type WaitlistUser, type YouTubeSearchResponse, type YouTubeVideoResponse, authResource, chatResource, friendResource, playlistResource, roomResource, shopResource, sourceResource, subscriptionResource, userResource };
package/dist/index.d.ts CHANGED
@@ -484,15 +484,16 @@ declare const roomResource: RoomResource;
484
484
  interface ChatMessage {
485
485
  id: string;
486
486
  room_id: number;
487
- user_id: number;
488
- username: string;
489
- display_name: string | null;
490
- role: RoomRole;
487
+ user_id?: number;
488
+ username?: string;
489
+ display_name?: string | null;
490
+ role?: RoomRole;
491
491
  global_role?: string | null;
492
492
  subscription_type?: string | null;
493
493
  subscription_months?: number;
494
494
  content: string;
495
495
  timestamp: number;
496
+ type?: 'user' | 'system';
496
497
  deleted?: boolean;
497
498
  }
498
499
  interface SendMessageData {
@@ -728,4 +729,49 @@ declare class SubscriptionResource extends ApiResource {
728
729
  }
729
730
  declare const subscriptionResource: SubscriptionResource;
730
731
 
731
- export { type AddMediaData, Api, type ApiConfig, ApiError, ApiResource, type ApiResponse, AuthResource, type AuthResponse, 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, ChatResource, type CreateIntentResponse, type CreateRoomData, type EquipAvatarData, type FeaturedRoomsResponse, type GlobalRole, type GrabResponse, type ImportPlaylistData, type ImportPlaylistResponse, type ImportResult, type JoinRoomResponse, Logger, type LoginCredentials, type MeResponse, type MediaItem, type MediaItemResponse, type MediaSearchResult, type MediaSource, type ModerateUserData, type MuteResponse, type PaginatedResponse, type Playlist, PlaylistResource, type PlaylistResponse, type PlaylistsResponse, type PortalResponse, type RefreshResponse, type RegisterData, type ResourceOptions, type Room, type RoomBan, type RoomBansResponse, type RoomMember, RoomResource, type RoomResponse, type RoomRole, type RoomStaffResponse, type RoomUserState, type RoomsResponse, type SendMessageData, ShopResource, type ShuffleResponse, type SoundCloudSearchResponse, type SoundCloudTrackResponse, SourceResource, type SubscriptionPlan, SubscriptionResource, type SubscriptionStatus, 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, subscriptionResource, userResource };
732
+ type FriendshipStatus = 'none' | 'pending_sent' | 'pending_received' | 'accepted' | 'blocked_by_me' | 'blocked_by_them';
733
+ interface FriendEntry {
734
+ id: number;
735
+ userId: number;
736
+ username: string;
737
+ displayName: string | null;
738
+ avatarId: string;
739
+ level: number;
740
+ status: 'pending' | 'accepted' | 'blocked';
741
+ isSender: boolean;
742
+ }
743
+ interface FriendList {
744
+ friends: FriendEntry[];
745
+ pendingReceived: FriendEntry[];
746
+ pendingSent: FriendEntry[];
747
+ }
748
+ interface FriendListResponse {
749
+ success: boolean;
750
+ data: FriendList;
751
+ }
752
+ interface FriendStatusResponse {
753
+ success: boolean;
754
+ data: {
755
+ status: FriendshipStatus;
756
+ friendshipId: number | null;
757
+ };
758
+ }
759
+ interface FriendActionResponse {
760
+ success: boolean;
761
+ data: {
762
+ status: FriendshipStatus;
763
+ } | null;
764
+ }
765
+ declare class FriendResource extends ApiResource<FriendEntry> {
766
+ protected readonly endpoint = "/api/friends";
767
+ list(): Promise<ApiResponse<FriendListResponse>>;
768
+ getStatus(targetUserId: number): Promise<ApiResponse<FriendStatusResponse>>;
769
+ sendRequest(targetUserId: number): Promise<ApiResponse<FriendActionResponse>>;
770
+ acceptRequest(friendshipId: number): Promise<ApiResponse<FriendActionResponse>>;
771
+ remove(friendshipId: number): Promise<ApiResponse<FriendActionResponse>>;
772
+ block(targetUserId: number): Promise<ApiResponse<FriendActionResponse>>;
773
+ unblock(targetUserId: number): Promise<ApiResponse<FriendActionResponse>>;
774
+ }
775
+ declare const friendResource: FriendResource;
776
+
777
+ export { type AddMediaData, Api, type ApiConfig, ApiError, ApiResource, type ApiResponse, AuthResource, type AuthResponse, 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, ChatResource, type CreateIntentResponse, type CreateRoomData, type EquipAvatarData, type FeaturedRoomsResponse, type FriendActionResponse, type FriendEntry, type FriendList, type FriendListResponse, FriendResource, type FriendStatusResponse, type FriendshipStatus, type GlobalRole, type GrabResponse, type ImportPlaylistData, type ImportPlaylistResponse, type ImportResult, type JoinRoomResponse, Logger, type LoginCredentials, type MeResponse, type MediaItem, type MediaItemResponse, type MediaSearchResult, type MediaSource, type ModerateUserData, type MuteResponse, type PaginatedResponse, type Playlist, PlaylistResource, type PlaylistResponse, type PlaylistsResponse, type PortalResponse, type RefreshResponse, type RegisterData, type ResourceOptions, type Room, type RoomBan, type RoomBansResponse, type RoomMember, RoomResource, type RoomResponse, type RoomRole, type RoomStaffResponse, type RoomUserState, type RoomsResponse, type SendMessageData, ShopResource, type ShuffleResponse, type SoundCloudSearchResponse, type SoundCloudTrackResponse, SourceResource, type SubscriptionPlan, SubscriptionResource, type SubscriptionStatus, type UpdateProfileData, type UpdateRoomData, type User, UserResource, type UserResponse, type VoteResponse, type WaitlistResponse, type WaitlistUser, type YouTubeSearchResponse, type YouTubeVideoResponse, authResource, chatResource, friendResource, playlistResource, roomResource, shopResource, sourceResource, subscriptionResource, userResource };
package/dist/index.js CHANGED
@@ -35,6 +35,7 @@ __export(index_exports, {
35
35
  ApiResource: () => ApiResource,
36
36
  AuthResource: () => AuthResource,
37
37
  ChatResource: () => ChatResource,
38
+ FriendResource: () => FriendResource,
38
39
  Logger: () => Logger,
39
40
  PlaylistResource: () => PlaylistResource,
40
41
  RoomResource: () => RoomResource,
@@ -44,6 +45,7 @@ __export(index_exports, {
44
45
  UserResource: () => UserResource,
45
46
  authResource: () => authResource,
46
47
  chatResource: () => chatResource,
48
+ friendResource: () => friendResource,
47
49
  playlistResource: () => playlistResource,
48
50
  roomResource: () => roomResource,
49
51
  shopResource: () => shopResource,
@@ -698,6 +700,43 @@ var SubscriptionResource = class extends ApiResource {
698
700
  }
699
701
  };
700
702
  var subscriptionResource = new SubscriptionResource();
703
+
704
+ // src/resources/FriendResource.ts
705
+ var FriendResource = class extends ApiResource {
706
+ constructor() {
707
+ super(...arguments);
708
+ this.endpoint = "/api/friends";
709
+ }
710
+ // GET /api/friends
711
+ async list() {
712
+ return this.api.get(this.endpoint);
713
+ }
714
+ // GET /api/friends/status/:targetUserId
715
+ async getStatus(targetUserId) {
716
+ return this.api.get(`${this.endpoint}/status/${targetUserId}`);
717
+ }
718
+ // POST /api/friends/:targetUserId — send or auto-accept request
719
+ async sendRequest(targetUserId) {
720
+ return this.api.post(`${this.endpoint}/${targetUserId}`);
721
+ }
722
+ // PATCH /api/friends/:friendshipId/accept
723
+ async acceptRequest(friendshipId) {
724
+ return this.api.patch(`${this.endpoint}/${friendshipId}/accept`);
725
+ }
726
+ // DELETE /api/friends/:friendshipId — decline / cancel / unfriend
727
+ async remove(friendshipId) {
728
+ return this.api.delete(`${this.endpoint}/${friendshipId}`);
729
+ }
730
+ // POST /api/friends/:targetUserId/block
731
+ async block(targetUserId) {
732
+ return this.api.post(`${this.endpoint}/${targetUserId}/block`);
733
+ }
734
+ // DELETE /api/friends/:targetUserId/block
735
+ async unblock(targetUserId) {
736
+ return this.api.delete(`${this.endpoint}/${targetUserId}/block`);
737
+ }
738
+ };
739
+ var friendResource = new FriendResource();
701
740
  // Annotate the CommonJS export names for ESM import in node:
702
741
  0 && (module.exports = {
703
742
  Api,
@@ -705,6 +744,7 @@ var subscriptionResource = new SubscriptionResource();
705
744
  ApiResource,
706
745
  AuthResource,
707
746
  ChatResource,
747
+ FriendResource,
708
748
  Logger,
709
749
  PlaylistResource,
710
750
  RoomResource,
@@ -714,6 +754,7 @@ var subscriptionResource = new SubscriptionResource();
714
754
  UserResource,
715
755
  authResource,
716
756
  chatResource,
757
+ friendResource,
717
758
  playlistResource,
718
759
  roomResource,
719
760
  shopResource,
package/dist/index.mjs CHANGED
@@ -643,12 +643,50 @@ var SubscriptionResource = class extends ApiResource {
643
643
  }
644
644
  };
645
645
  var subscriptionResource = new SubscriptionResource();
646
+
647
+ // src/resources/FriendResource.ts
648
+ var FriendResource = class extends ApiResource {
649
+ constructor() {
650
+ super(...arguments);
651
+ this.endpoint = "/api/friends";
652
+ }
653
+ // GET /api/friends
654
+ async list() {
655
+ return this.api.get(this.endpoint);
656
+ }
657
+ // GET /api/friends/status/:targetUserId
658
+ async getStatus(targetUserId) {
659
+ return this.api.get(`${this.endpoint}/status/${targetUserId}`);
660
+ }
661
+ // POST /api/friends/:targetUserId — send or auto-accept request
662
+ async sendRequest(targetUserId) {
663
+ return this.api.post(`${this.endpoint}/${targetUserId}`);
664
+ }
665
+ // PATCH /api/friends/:friendshipId/accept
666
+ async acceptRequest(friendshipId) {
667
+ return this.api.patch(`${this.endpoint}/${friendshipId}/accept`);
668
+ }
669
+ // DELETE /api/friends/:friendshipId — decline / cancel / unfriend
670
+ async remove(friendshipId) {
671
+ return this.api.delete(`${this.endpoint}/${friendshipId}`);
672
+ }
673
+ // POST /api/friends/:targetUserId/block
674
+ async block(targetUserId) {
675
+ return this.api.post(`${this.endpoint}/${targetUserId}/block`);
676
+ }
677
+ // DELETE /api/friends/:targetUserId/block
678
+ async unblock(targetUserId) {
679
+ return this.api.delete(`${this.endpoint}/${targetUserId}/block`);
680
+ }
681
+ };
682
+ var friendResource = new FriendResource();
646
683
  export {
647
684
  Api,
648
685
  ApiError,
649
686
  ApiResource,
650
687
  AuthResource,
651
688
  ChatResource,
689
+ FriendResource,
652
690
  Logger,
653
691
  PlaylistResource,
654
692
  RoomResource,
@@ -658,6 +696,7 @@ export {
658
696
  UserResource,
659
697
  authResource,
660
698
  chatResource,
699
+ friendResource,
661
700
  playlistResource,
662
701
  roomResource,
663
702
  shopResource,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@borealise/api",
3
- "version": "1.1.2",
3
+ "version": "1.1.4",
4
4
  "description": "Official API client for Borealise",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",