@borealise/api 2.1.0-alpha.3 → 2.1.0-alpha.5

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
@@ -71,6 +71,8 @@ interface AuthUser {
71
71
  subscriptionMonths?: number;
72
72
  subscriptionExpiresAt?: string | null;
73
73
  emailVerified?: boolean;
74
+ twoFactorEnabled?: boolean;
75
+ twoFactorMethod?: 'totp' | 'email' | null;
74
76
  createdAt?: string;
75
77
  }
76
78
  interface LoginCredentials {
@@ -87,6 +89,42 @@ interface RegisterData {
87
89
  interface AuthResponse {
88
90
  success: boolean;
89
91
  message?: string;
92
+ data: {
93
+ user?: AuthUser;
94
+ accessToken?: string;
95
+ refreshToken?: string;
96
+ expiresAt?: string;
97
+ requiresSecondFactor?: boolean;
98
+ secondFactorMethod?: 'totp' | 'email';
99
+ challengeToken?: string;
100
+ challengeExpiresAt?: string;
101
+ };
102
+ }
103
+ interface TwoFactorStatusResponse {
104
+ success: boolean;
105
+ data: {
106
+ enabled: boolean;
107
+ method: 'totp' | 'email' | null;
108
+ };
109
+ }
110
+ interface TwoFactorSetupResponse {
111
+ success: boolean;
112
+ data: {
113
+ method: 'totp' | 'email';
114
+ challengeToken: string;
115
+ challengeExpiresAt: string;
116
+ secret?: string;
117
+ otpauthUrl?: string;
118
+ };
119
+ }
120
+ interface TwoFactorSetupVerifyResponse {
121
+ success: boolean;
122
+ data: {
123
+ backupCodes: string[];
124
+ };
125
+ }
126
+ interface TwoFactorVerifyResponse {
127
+ success: boolean;
90
128
  data: {
91
129
  user: AuthUser;
92
130
  accessToken: string;
@@ -123,6 +161,13 @@ interface AuthResource {
123
161
  resetPassword(token: string, password: string): Promise<ApiResponse<{
124
162
  success: boolean;
125
163
  }>>;
164
+ getTwoFactorStatus(): Promise<ApiResponse<TwoFactorStatusResponse>>;
165
+ startTwoFactorSetup(method: 'totp' | 'email'): Promise<ApiResponse<TwoFactorSetupResponse>>;
166
+ verifyTwoFactorSetup(challengeToken: string, code: string): Promise<ApiResponse<TwoFactorSetupVerifyResponse>>;
167
+ verifySecondFactor(challengeToken: string, code: string, trustDevice?: boolean): Promise<ApiResponse<TwoFactorVerifyResponse>>;
168
+ disableTwoFactor(): Promise<ApiResponse<{
169
+ success: boolean;
170
+ }>>;
126
171
  }
127
172
  declare const createAuthResource: (api: Api) => AuthResource;
128
173
 
@@ -431,7 +476,7 @@ interface BoothResponse {
431
476
  interface VoteResponse {
432
477
  success: boolean;
433
478
  data: {
434
- vote: 'woot' | 'meh';
479
+ vote: 'woot' | 'meh' | null;
435
480
  votes: {
436
481
  woots: number;
437
482
  mehs: number;
@@ -446,6 +491,28 @@ interface GrabResponse {
446
491
  message: string;
447
492
  };
448
493
  }
494
+ interface RoomCustomEmoji {
495
+ id: string;
496
+ name: string;
497
+ image_url: string;
498
+ animated: boolean;
499
+ created_by: number;
500
+ created_at: number;
501
+ }
502
+ interface RoomCustomSticker {
503
+ id: string;
504
+ name: string;
505
+ image_url: string;
506
+ created_by: number;
507
+ created_at: number;
508
+ }
509
+ interface RoomAssetsResponse {
510
+ success: boolean;
511
+ data: {
512
+ emojis: RoomCustomEmoji[];
513
+ stickers: RoomCustomSticker[];
514
+ };
515
+ }
449
516
  interface PlayHistoryItem {
450
517
  id: number;
451
518
  userId: number;
@@ -613,6 +680,38 @@ interface RoomResource {
613
680
  }>>;
614
681
  vote(slug: string, type: 'woot' | 'meh'): Promise<ApiResponse<VoteResponse>>;
615
682
  grabTrack(slug: string, playlistId?: number): Promise<ApiResponse<GrabResponse>>;
683
+ getAssets(slug: string): Promise<ApiResponse<RoomAssetsResponse>>;
684
+ createEmoji(slug: string, data: {
685
+ name?: string;
686
+ file: File | Blob;
687
+ animated?: boolean;
688
+ }): Promise<ApiResponse<{
689
+ success: boolean;
690
+ data: {
691
+ emojis: RoomCustomEmoji[];
692
+ };
693
+ }>>;
694
+ deleteEmoji(slug: string, emojiId: string): Promise<ApiResponse<{
695
+ success: boolean;
696
+ data: {
697
+ emojis: RoomCustomEmoji[];
698
+ };
699
+ }>>;
700
+ createSticker(slug: string, data: {
701
+ name?: string;
702
+ file: File | Blob;
703
+ }): Promise<ApiResponse<{
704
+ success: boolean;
705
+ data: {
706
+ stickers: RoomCustomSticker[];
707
+ };
708
+ }>>;
709
+ deleteSticker(slug: string, stickerId: string): Promise<ApiResponse<{
710
+ success: boolean;
711
+ data: {
712
+ stickers: RoomCustomSticker[];
713
+ };
714
+ }>>;
616
715
  getHistory(slug: string, page?: number, limit?: number): Promise<ApiResponse<RoomHistoryResponse>>;
617
716
  getAuditLog(slug: string, limit?: number, before?: string): Promise<ApiResponse<RoomAuditLogResponse>>;
618
717
  activity(limit?: number): Promise<ApiResponse<DashboardActivityResponse>>;
@@ -638,9 +737,20 @@ interface ChatMessage {
638
737
  deleted?: boolean;
639
738
  deleted_at?: number | null;
640
739
  deleted_by?: number | null;
740
+ reply_to?: ChatReplyTarget | null;
741
+ }
742
+ interface ChatReplyTarget {
743
+ id: string;
744
+ user_id?: number;
745
+ username?: string;
746
+ display_name?: string | null;
747
+ content: string;
748
+ type?: 'user' | 'system';
749
+ deleted?: boolean;
641
750
  }
642
751
  interface SendMessageData {
643
752
  content: string;
753
+ replyToId?: string;
644
754
  }
645
755
  interface ChatMessagesResponse {
646
756
  success: boolean;
@@ -654,6 +764,20 @@ interface ChatMessageResponse {
654
764
  message: ChatMessage;
655
765
  };
656
766
  }
767
+ interface GifSearchItem {
768
+ id: string;
769
+ title: string;
770
+ url: string;
771
+ preview_url: string | null;
772
+ width: number | null;
773
+ height: number | null;
774
+ }
775
+ interface GifSearchResponse {
776
+ success: boolean;
777
+ data: {
778
+ gifs: GifSearchItem[];
779
+ };
780
+ }
657
781
  interface ChatResource {
658
782
  sendMessage(slug: string, data: SendMessageData): Promise<ApiResponse<ChatMessageResponse>>;
659
783
  getMessages(slug: string, before?: string, limit?: number): Promise<ApiResponse<ChatMessagesResponse>>;
@@ -662,6 +786,7 @@ interface ChatResource {
662
786
  success: boolean;
663
787
  data: null;
664
788
  }>>;
789
+ searchGifs(query: string, limit?: number): Promise<ApiResponse<GifSearchResponse>>;
665
790
  }
666
791
  declare const createChatResource: (api: Api) => ChatResource;
667
792
 
@@ -1074,4 +1199,4 @@ interface ApiClient {
1074
1199
  }
1075
1200
  declare const createApiClient: (config: ApiConfig) => ApiClient;
1076
1201
 
1077
- export { type AccountViolation, type AddMediaData, type AddViolationResponse, type AdminListUsersParams, type AdminResource, type AdminStatsResponse, type AdminStatsRoom, type AdminUserEntry, type AdminUsersResponse, type Api, type ApiClient, type ApiConfig, ApiError, type ApiQueryParams, type ApiRequestConfig, 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 DashboardActivityItem, type DashboardActivityResponse, type DashboardActivityType, 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 PublicProfileFriend, type PublicUser, 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 };
1202
+ export { type AccountViolation, type AddMediaData, type AddViolationResponse, type AdminListUsersParams, type AdminResource, type AdminStatsResponse, type AdminStatsRoom, type AdminUserEntry, type AdminUsersResponse, type Api, type ApiClient, type ApiConfig, ApiError, type ApiQueryParams, type ApiRequestConfig, 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 DashboardActivityItem, type DashboardActivityResponse, type DashboardActivityType, type EquipAvatarData, type FeaturedRoomsResponse, type FriendActionResponse, type FriendEntry, type FriendList, type FriendListResponse, type FriendResource, type FriendStatusResponse, type FriendshipStatus, type GifSearchItem, type GifSearchResponse, 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 PublicProfileFriend, type PublicUser, type Room, type RoomAssetsResponse, type RoomAuditLog, type RoomBan, type RoomBansResponse, type RoomCustomEmoji, type RoomCustomSticker, 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
@@ -71,6 +71,8 @@ interface AuthUser {
71
71
  subscriptionMonths?: number;
72
72
  subscriptionExpiresAt?: string | null;
73
73
  emailVerified?: boolean;
74
+ twoFactorEnabled?: boolean;
75
+ twoFactorMethod?: 'totp' | 'email' | null;
74
76
  createdAt?: string;
75
77
  }
76
78
  interface LoginCredentials {
@@ -87,6 +89,42 @@ interface RegisterData {
87
89
  interface AuthResponse {
88
90
  success: boolean;
89
91
  message?: string;
92
+ data: {
93
+ user?: AuthUser;
94
+ accessToken?: string;
95
+ refreshToken?: string;
96
+ expiresAt?: string;
97
+ requiresSecondFactor?: boolean;
98
+ secondFactorMethod?: 'totp' | 'email';
99
+ challengeToken?: string;
100
+ challengeExpiresAt?: string;
101
+ };
102
+ }
103
+ interface TwoFactorStatusResponse {
104
+ success: boolean;
105
+ data: {
106
+ enabled: boolean;
107
+ method: 'totp' | 'email' | null;
108
+ };
109
+ }
110
+ interface TwoFactorSetupResponse {
111
+ success: boolean;
112
+ data: {
113
+ method: 'totp' | 'email';
114
+ challengeToken: string;
115
+ challengeExpiresAt: string;
116
+ secret?: string;
117
+ otpauthUrl?: string;
118
+ };
119
+ }
120
+ interface TwoFactorSetupVerifyResponse {
121
+ success: boolean;
122
+ data: {
123
+ backupCodes: string[];
124
+ };
125
+ }
126
+ interface TwoFactorVerifyResponse {
127
+ success: boolean;
90
128
  data: {
91
129
  user: AuthUser;
92
130
  accessToken: string;
@@ -123,6 +161,13 @@ interface AuthResource {
123
161
  resetPassword(token: string, password: string): Promise<ApiResponse<{
124
162
  success: boolean;
125
163
  }>>;
164
+ getTwoFactorStatus(): Promise<ApiResponse<TwoFactorStatusResponse>>;
165
+ startTwoFactorSetup(method: 'totp' | 'email'): Promise<ApiResponse<TwoFactorSetupResponse>>;
166
+ verifyTwoFactorSetup(challengeToken: string, code: string): Promise<ApiResponse<TwoFactorSetupVerifyResponse>>;
167
+ verifySecondFactor(challengeToken: string, code: string, trustDevice?: boolean): Promise<ApiResponse<TwoFactorVerifyResponse>>;
168
+ disableTwoFactor(): Promise<ApiResponse<{
169
+ success: boolean;
170
+ }>>;
126
171
  }
127
172
  declare const createAuthResource: (api: Api) => AuthResource;
128
173
 
@@ -431,7 +476,7 @@ interface BoothResponse {
431
476
  interface VoteResponse {
432
477
  success: boolean;
433
478
  data: {
434
- vote: 'woot' | 'meh';
479
+ vote: 'woot' | 'meh' | null;
435
480
  votes: {
436
481
  woots: number;
437
482
  mehs: number;
@@ -446,6 +491,28 @@ interface GrabResponse {
446
491
  message: string;
447
492
  };
448
493
  }
494
+ interface RoomCustomEmoji {
495
+ id: string;
496
+ name: string;
497
+ image_url: string;
498
+ animated: boolean;
499
+ created_by: number;
500
+ created_at: number;
501
+ }
502
+ interface RoomCustomSticker {
503
+ id: string;
504
+ name: string;
505
+ image_url: string;
506
+ created_by: number;
507
+ created_at: number;
508
+ }
509
+ interface RoomAssetsResponse {
510
+ success: boolean;
511
+ data: {
512
+ emojis: RoomCustomEmoji[];
513
+ stickers: RoomCustomSticker[];
514
+ };
515
+ }
449
516
  interface PlayHistoryItem {
450
517
  id: number;
451
518
  userId: number;
@@ -613,6 +680,38 @@ interface RoomResource {
613
680
  }>>;
614
681
  vote(slug: string, type: 'woot' | 'meh'): Promise<ApiResponse<VoteResponse>>;
615
682
  grabTrack(slug: string, playlistId?: number): Promise<ApiResponse<GrabResponse>>;
683
+ getAssets(slug: string): Promise<ApiResponse<RoomAssetsResponse>>;
684
+ createEmoji(slug: string, data: {
685
+ name?: string;
686
+ file: File | Blob;
687
+ animated?: boolean;
688
+ }): Promise<ApiResponse<{
689
+ success: boolean;
690
+ data: {
691
+ emojis: RoomCustomEmoji[];
692
+ };
693
+ }>>;
694
+ deleteEmoji(slug: string, emojiId: string): Promise<ApiResponse<{
695
+ success: boolean;
696
+ data: {
697
+ emojis: RoomCustomEmoji[];
698
+ };
699
+ }>>;
700
+ createSticker(slug: string, data: {
701
+ name?: string;
702
+ file: File | Blob;
703
+ }): Promise<ApiResponse<{
704
+ success: boolean;
705
+ data: {
706
+ stickers: RoomCustomSticker[];
707
+ };
708
+ }>>;
709
+ deleteSticker(slug: string, stickerId: string): Promise<ApiResponse<{
710
+ success: boolean;
711
+ data: {
712
+ stickers: RoomCustomSticker[];
713
+ };
714
+ }>>;
616
715
  getHistory(slug: string, page?: number, limit?: number): Promise<ApiResponse<RoomHistoryResponse>>;
617
716
  getAuditLog(slug: string, limit?: number, before?: string): Promise<ApiResponse<RoomAuditLogResponse>>;
618
717
  activity(limit?: number): Promise<ApiResponse<DashboardActivityResponse>>;
@@ -638,9 +737,20 @@ interface ChatMessage {
638
737
  deleted?: boolean;
639
738
  deleted_at?: number | null;
640
739
  deleted_by?: number | null;
740
+ reply_to?: ChatReplyTarget | null;
741
+ }
742
+ interface ChatReplyTarget {
743
+ id: string;
744
+ user_id?: number;
745
+ username?: string;
746
+ display_name?: string | null;
747
+ content: string;
748
+ type?: 'user' | 'system';
749
+ deleted?: boolean;
641
750
  }
642
751
  interface SendMessageData {
643
752
  content: string;
753
+ replyToId?: string;
644
754
  }
645
755
  interface ChatMessagesResponse {
646
756
  success: boolean;
@@ -654,6 +764,20 @@ interface ChatMessageResponse {
654
764
  message: ChatMessage;
655
765
  };
656
766
  }
767
+ interface GifSearchItem {
768
+ id: string;
769
+ title: string;
770
+ url: string;
771
+ preview_url: string | null;
772
+ width: number | null;
773
+ height: number | null;
774
+ }
775
+ interface GifSearchResponse {
776
+ success: boolean;
777
+ data: {
778
+ gifs: GifSearchItem[];
779
+ };
780
+ }
657
781
  interface ChatResource {
658
782
  sendMessage(slug: string, data: SendMessageData): Promise<ApiResponse<ChatMessageResponse>>;
659
783
  getMessages(slug: string, before?: string, limit?: number): Promise<ApiResponse<ChatMessagesResponse>>;
@@ -662,6 +786,7 @@ interface ChatResource {
662
786
  success: boolean;
663
787
  data: null;
664
788
  }>>;
789
+ searchGifs(query: string, limit?: number): Promise<ApiResponse<GifSearchResponse>>;
665
790
  }
666
791
  declare const createChatResource: (api: Api) => ChatResource;
667
792
 
@@ -1074,4 +1199,4 @@ interface ApiClient {
1074
1199
  }
1075
1200
  declare const createApiClient: (config: ApiConfig) => ApiClient;
1076
1201
 
1077
- export { type AccountViolation, type AddMediaData, type AddViolationResponse, type AdminListUsersParams, type AdminResource, type AdminStatsResponse, type AdminStatsRoom, type AdminUserEntry, type AdminUsersResponse, type Api, type ApiClient, type ApiConfig, ApiError, type ApiQueryParams, type ApiRequestConfig, 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 DashboardActivityItem, type DashboardActivityResponse, type DashboardActivityType, 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 PublicProfileFriend, type PublicUser, 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 };
1202
+ export { type AccountViolation, type AddMediaData, type AddViolationResponse, type AdminListUsersParams, type AdminResource, type AdminStatsResponse, type AdminStatsRoom, type AdminUserEntry, type AdminUsersResponse, type Api, type ApiClient, type ApiConfig, ApiError, type ApiQueryParams, type ApiRequestConfig, 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 DashboardActivityItem, type DashboardActivityResponse, type DashboardActivityType, type EquipAvatarData, type FeaturedRoomsResponse, type FriendActionResponse, type FriendEntry, type FriendList, type FriendListResponse, type FriendResource, type FriendStatusResponse, type FriendshipStatus, type GifSearchItem, type GifSearchResponse, 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 PublicProfileFriend, type PublicUser, type Room, type RoomAssetsResponse, type RoomAuditLog, type RoomBan, type RoomBansResponse, type RoomCustomEmoji, type RoomCustomSticker, 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
@@ -215,7 +215,13 @@ var createApi = (config) => {
215
215
  try {
216
216
  const options = buildOptions(defaultHeaders, requestConfig);
217
217
  if (data !== void 0) {
218
- options.json = data;
218
+ if (data instanceof FormData) {
219
+ const headers = options.headers;
220
+ delete headers["Content-Type"];
221
+ options.body = data;
222
+ } else {
223
+ options.json = data;
224
+ }
219
225
  }
220
226
  const response = await client(resolveUrl(config.baseURL, url), {
221
227
  ...options,
@@ -263,7 +269,12 @@ var createAuthResource = (api) => ({
263
269
  logout: () => api.post(`${endpoint}/logout`),
264
270
  me: () => api.get(`${endpoint}/me`),
265
271
  forgotPassword: (email) => api.post(`${endpoint}/forgot-password`, { email }),
266
- resetPassword: (token, password) => api.post(`${endpoint}/reset-password`, { token, password })
272
+ resetPassword: (token, password) => api.post(`${endpoint}/reset-password`, { token, password }),
273
+ getTwoFactorStatus: () => api.get(`${endpoint}/2fa/status`),
274
+ startTwoFactorSetup: (method) => api.post(`${endpoint}/2fa/setup`, { method }),
275
+ verifyTwoFactorSetup: (challengeToken, code) => api.post(`${endpoint}/2fa/setup/verify`, { challengeToken, code }),
276
+ verifySecondFactor: (challengeToken, code, trustDevice = false) => api.post(`${endpoint}/2fa/verify`, { challengeToken, code, trustDevice }),
277
+ disableTwoFactor: () => api.post(`${endpoint}/2fa/disable`)
267
278
  });
268
279
 
269
280
  // src/resources/user.ts
@@ -319,6 +330,26 @@ var createRoomResource = (api) => ({
319
330
  ),
320
331
  vote: (slug, type) => api.post(`${endpoint3}/${slug}/booth/vote`, { type }),
321
332
  grabTrack: (slug, playlistId) => api.post(`${endpoint3}/${slug}/booth/grab`, playlistId ? { playlistId } : {}),
333
+ getAssets: (slug) => api.get(`${endpoint3}/${slug}/assets`),
334
+ createEmoji: (slug, data) => {
335
+ const FormDataCtor = globalThis.FormData;
336
+ if (!FormDataCtor) throw new Error("FormData is not available in this runtime");
337
+ const form = new FormDataCtor();
338
+ if (data.name) form.set("name", data.name);
339
+ form.set("file", data.file);
340
+ if (typeof data.animated === "boolean") form.set("animated", `${data.animated}`);
341
+ return api.post(`${endpoint3}/${slug}/assets/emojis`, form);
342
+ },
343
+ deleteEmoji: (slug, emojiId) => api.delete(`${endpoint3}/${slug}/assets/emojis/${emojiId}`),
344
+ createSticker: (slug, data) => {
345
+ const FormDataCtor = globalThis.FormData;
346
+ if (!FormDataCtor) throw new Error("FormData is not available in this runtime");
347
+ const form = new FormDataCtor();
348
+ if (data.name) form.set("name", data.name);
349
+ form.set("file", data.file);
350
+ return api.post(`${endpoint3}/${slug}/assets/stickers`, form);
351
+ },
352
+ deleteSticker: (slug, stickerId) => api.delete(`${endpoint3}/${slug}/assets/stickers/${stickerId}`),
322
353
  getHistory: (slug, page = 1, limit = 20) => api.get(`${endpoint3}/${slug}/history`, { params: { page, limit } }),
323
354
  getAuditLog: (slug, limit = 50, before) => api.get(`${endpoint3}/${slug}/audit`, { params: before ? { limit, before } : { limit } }),
324
355
  activity: (limit = 12) => api.get(`${endpoint3}/activity`, { params: { limit } })
@@ -336,7 +367,8 @@ var createChatResource = (api) => ({
336
367
  return api.get(`${endpoint4}/${slug}/chat`, { params });
337
368
  },
338
369
  editMessage: (slug, messageId, data) => api.patch(`${endpoint4}/${slug}/chat/${messageId}`, data),
339
- deleteMessage: (slug, messageId) => api.delete(`${endpoint4}/${slug}/chat/${messageId}`)
370
+ deleteMessage: (slug, messageId) => api.delete(`${endpoint4}/${slug}/chat/${messageId}`),
371
+ searchGifs: (query, limit = 20) => api.post("/chat/gif/search", { query, limit })
340
372
  });
341
373
 
342
374
  // src/resources/playlist.ts
package/dist/index.mjs CHANGED
@@ -166,7 +166,13 @@ var createApi = (config) => {
166
166
  try {
167
167
  const options = buildOptions(defaultHeaders, requestConfig);
168
168
  if (data !== void 0) {
169
- options.json = data;
169
+ if (data instanceof FormData) {
170
+ const headers = options.headers;
171
+ delete headers["Content-Type"];
172
+ options.body = data;
173
+ } else {
174
+ options.json = data;
175
+ }
170
176
  }
171
177
  const response = await client(resolveUrl(config.baseURL, url), {
172
178
  ...options,
@@ -214,7 +220,12 @@ var createAuthResource = (api) => ({
214
220
  logout: () => api.post(`${endpoint}/logout`),
215
221
  me: () => api.get(`${endpoint}/me`),
216
222
  forgotPassword: (email) => api.post(`${endpoint}/forgot-password`, { email }),
217
- resetPassword: (token, password) => api.post(`${endpoint}/reset-password`, { token, password })
223
+ resetPassword: (token, password) => api.post(`${endpoint}/reset-password`, { token, password }),
224
+ getTwoFactorStatus: () => api.get(`${endpoint}/2fa/status`),
225
+ startTwoFactorSetup: (method) => api.post(`${endpoint}/2fa/setup`, { method }),
226
+ verifyTwoFactorSetup: (challengeToken, code) => api.post(`${endpoint}/2fa/setup/verify`, { challengeToken, code }),
227
+ verifySecondFactor: (challengeToken, code, trustDevice = false) => api.post(`${endpoint}/2fa/verify`, { challengeToken, code, trustDevice }),
228
+ disableTwoFactor: () => api.post(`${endpoint}/2fa/disable`)
218
229
  });
219
230
 
220
231
  // src/resources/user.ts
@@ -270,6 +281,26 @@ var createRoomResource = (api) => ({
270
281
  ),
271
282
  vote: (slug, type) => api.post(`${endpoint3}/${slug}/booth/vote`, { type }),
272
283
  grabTrack: (slug, playlistId) => api.post(`${endpoint3}/${slug}/booth/grab`, playlistId ? { playlistId } : {}),
284
+ getAssets: (slug) => api.get(`${endpoint3}/${slug}/assets`),
285
+ createEmoji: (slug, data) => {
286
+ const FormDataCtor = globalThis.FormData;
287
+ if (!FormDataCtor) throw new Error("FormData is not available in this runtime");
288
+ const form = new FormDataCtor();
289
+ if (data.name) form.set("name", data.name);
290
+ form.set("file", data.file);
291
+ if (typeof data.animated === "boolean") form.set("animated", `${data.animated}`);
292
+ return api.post(`${endpoint3}/${slug}/assets/emojis`, form);
293
+ },
294
+ deleteEmoji: (slug, emojiId) => api.delete(`${endpoint3}/${slug}/assets/emojis/${emojiId}`),
295
+ createSticker: (slug, data) => {
296
+ const FormDataCtor = globalThis.FormData;
297
+ if (!FormDataCtor) throw new Error("FormData is not available in this runtime");
298
+ const form = new FormDataCtor();
299
+ if (data.name) form.set("name", data.name);
300
+ form.set("file", data.file);
301
+ return api.post(`${endpoint3}/${slug}/assets/stickers`, form);
302
+ },
303
+ deleteSticker: (slug, stickerId) => api.delete(`${endpoint3}/${slug}/assets/stickers/${stickerId}`),
273
304
  getHistory: (slug, page = 1, limit = 20) => api.get(`${endpoint3}/${slug}/history`, { params: { page, limit } }),
274
305
  getAuditLog: (slug, limit = 50, before) => api.get(`${endpoint3}/${slug}/audit`, { params: before ? { limit, before } : { limit } }),
275
306
  activity: (limit = 12) => api.get(`${endpoint3}/activity`, { params: { limit } })
@@ -287,7 +318,8 @@ var createChatResource = (api) => ({
287
318
  return api.get(`${endpoint4}/${slug}/chat`, { params });
288
319
  },
289
320
  editMessage: (slug, messageId, data) => api.patch(`${endpoint4}/${slug}/chat/${messageId}`, data),
290
- deleteMessage: (slug, messageId) => api.delete(`${endpoint4}/${slug}/chat/${messageId}`)
321
+ deleteMessage: (slug, messageId) => api.delete(`${endpoint4}/${slug}/chat/${messageId}`),
322
+ searchGifs: (query, limit = 20) => api.post("/chat/gif/search", { query, limit })
291
323
  });
292
324
 
293
325
  // src/resources/playlist.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@borealise/api",
3
- "version": "2.1.0-alpha.3",
3
+ "version": "2.1.0-alpha.5",
4
4
  "description": "Official API client for Borealise",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",