@borealise/api 1.0.6 → 1.0.7
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 +32 -1
- package/dist/index.d.ts +32 -1
- package/dist/index.js +25 -0
- package/dist/index.mjs +23 -0
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -620,4 +620,35 @@ declare class ShopResource extends ApiResource {
|
|
|
620
620
|
}
|
|
621
621
|
declare const shopResource: ShopResource;
|
|
622
622
|
|
|
623
|
-
|
|
623
|
+
type SubscriptionPlan = 'monthly' | 'yearly';
|
|
624
|
+
interface SubscriptionStatus {
|
|
625
|
+
plan: 'none' | 'monthly' | 'yearly';
|
|
626
|
+
active: boolean;
|
|
627
|
+
expiresAt: string | null;
|
|
628
|
+
cancelAtPeriodEnd: boolean;
|
|
629
|
+
currentPeriodEnd: string | null;
|
|
630
|
+
}
|
|
631
|
+
interface CheckoutResponse {
|
|
632
|
+
success: boolean;
|
|
633
|
+
data: {
|
|
634
|
+
url: string;
|
|
635
|
+
};
|
|
636
|
+
}
|
|
637
|
+
interface PortalResponse {
|
|
638
|
+
success: boolean;
|
|
639
|
+
data: {
|
|
640
|
+
url: string;
|
|
641
|
+
};
|
|
642
|
+
}
|
|
643
|
+
declare class SubscriptionResource extends ApiResource {
|
|
644
|
+
protected readonly endpoint = "/subscriptions";
|
|
645
|
+
getStatus(): Promise<ApiResponse<{
|
|
646
|
+
success: boolean;
|
|
647
|
+
data: SubscriptionStatus;
|
|
648
|
+
}>>;
|
|
649
|
+
createCheckout(plan: SubscriptionPlan): Promise<ApiResponse<CheckoutResponse>>;
|
|
650
|
+
createPortal(): Promise<ApiResponse<PortalResponse>>;
|
|
651
|
+
}
|
|
652
|
+
declare const subscriptionResource: SubscriptionResource;
|
|
653
|
+
|
|
654
|
+
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 CheckoutResponse, 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 PortalResponse, 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 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 };
|
package/dist/index.d.ts
CHANGED
|
@@ -620,4 +620,35 @@ declare class ShopResource extends ApiResource {
|
|
|
620
620
|
}
|
|
621
621
|
declare const shopResource: ShopResource;
|
|
622
622
|
|
|
623
|
-
|
|
623
|
+
type SubscriptionPlan = 'monthly' | 'yearly';
|
|
624
|
+
interface SubscriptionStatus {
|
|
625
|
+
plan: 'none' | 'monthly' | 'yearly';
|
|
626
|
+
active: boolean;
|
|
627
|
+
expiresAt: string | null;
|
|
628
|
+
cancelAtPeriodEnd: boolean;
|
|
629
|
+
currentPeriodEnd: string | null;
|
|
630
|
+
}
|
|
631
|
+
interface CheckoutResponse {
|
|
632
|
+
success: boolean;
|
|
633
|
+
data: {
|
|
634
|
+
url: string;
|
|
635
|
+
};
|
|
636
|
+
}
|
|
637
|
+
interface PortalResponse {
|
|
638
|
+
success: boolean;
|
|
639
|
+
data: {
|
|
640
|
+
url: string;
|
|
641
|
+
};
|
|
642
|
+
}
|
|
643
|
+
declare class SubscriptionResource extends ApiResource {
|
|
644
|
+
protected readonly endpoint = "/subscriptions";
|
|
645
|
+
getStatus(): Promise<ApiResponse<{
|
|
646
|
+
success: boolean;
|
|
647
|
+
data: SubscriptionStatus;
|
|
648
|
+
}>>;
|
|
649
|
+
createCheckout(plan: SubscriptionPlan): Promise<ApiResponse<CheckoutResponse>>;
|
|
650
|
+
createPortal(): Promise<ApiResponse<PortalResponse>>;
|
|
651
|
+
}
|
|
652
|
+
declare const subscriptionResource: SubscriptionResource;
|
|
653
|
+
|
|
654
|
+
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 CheckoutResponse, 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 PortalResponse, 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 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 };
|
package/dist/index.js
CHANGED
|
@@ -40,6 +40,7 @@ __export(index_exports, {
|
|
|
40
40
|
RoomResource: () => RoomResource,
|
|
41
41
|
ShopResource: () => ShopResource,
|
|
42
42
|
SourceResource: () => SourceResource,
|
|
43
|
+
SubscriptionResource: () => SubscriptionResource,
|
|
43
44
|
UserResource: () => UserResource,
|
|
44
45
|
authResource: () => authResource,
|
|
45
46
|
chatResource: () => chatResource,
|
|
@@ -47,6 +48,7 @@ __export(index_exports, {
|
|
|
47
48
|
roomResource: () => roomResource,
|
|
48
49
|
shopResource: () => shopResource,
|
|
49
50
|
sourceResource: () => sourceResource,
|
|
51
|
+
subscriptionResource: () => subscriptionResource,
|
|
50
52
|
userResource: () => userResource
|
|
51
53
|
});
|
|
52
54
|
module.exports = __toCommonJS(index_exports);
|
|
@@ -625,6 +627,27 @@ var ShopResource = class extends ApiResource {
|
|
|
625
627
|
}
|
|
626
628
|
};
|
|
627
629
|
var shopResource = new ShopResource();
|
|
630
|
+
|
|
631
|
+
// src/resources/SubscriptionResource.ts
|
|
632
|
+
var SubscriptionResource = class extends ApiResource {
|
|
633
|
+
constructor() {
|
|
634
|
+
super(...arguments);
|
|
635
|
+
this.endpoint = "/subscriptions";
|
|
636
|
+
}
|
|
637
|
+
// GET /api/subscriptions/status
|
|
638
|
+
async getStatus() {
|
|
639
|
+
return this.api.get(`${this.endpoint}/status`);
|
|
640
|
+
}
|
|
641
|
+
// POST /api/subscriptions/checkout
|
|
642
|
+
async createCheckout(plan) {
|
|
643
|
+
return this.api.post(`${this.endpoint}/checkout`, { plan });
|
|
644
|
+
}
|
|
645
|
+
// POST /api/subscriptions/portal
|
|
646
|
+
async createPortal() {
|
|
647
|
+
return this.api.post(`${this.endpoint}/portal`);
|
|
648
|
+
}
|
|
649
|
+
};
|
|
650
|
+
var subscriptionResource = new SubscriptionResource();
|
|
628
651
|
// Annotate the CommonJS export names for ESM import in node:
|
|
629
652
|
0 && (module.exports = {
|
|
630
653
|
Api,
|
|
@@ -637,6 +660,7 @@ var shopResource = new ShopResource();
|
|
|
637
660
|
RoomResource,
|
|
638
661
|
ShopResource,
|
|
639
662
|
SourceResource,
|
|
663
|
+
SubscriptionResource,
|
|
640
664
|
UserResource,
|
|
641
665
|
authResource,
|
|
642
666
|
chatResource,
|
|
@@ -644,5 +668,6 @@ var shopResource = new ShopResource();
|
|
|
644
668
|
roomResource,
|
|
645
669
|
shopResource,
|
|
646
670
|
sourceResource,
|
|
671
|
+
subscriptionResource,
|
|
647
672
|
userResource
|
|
648
673
|
});
|
package/dist/index.mjs
CHANGED
|
@@ -572,6 +572,27 @@ var ShopResource = class extends ApiResource {
|
|
|
572
572
|
}
|
|
573
573
|
};
|
|
574
574
|
var shopResource = new ShopResource();
|
|
575
|
+
|
|
576
|
+
// src/resources/SubscriptionResource.ts
|
|
577
|
+
var SubscriptionResource = class extends ApiResource {
|
|
578
|
+
constructor() {
|
|
579
|
+
super(...arguments);
|
|
580
|
+
this.endpoint = "/subscriptions";
|
|
581
|
+
}
|
|
582
|
+
// GET /api/subscriptions/status
|
|
583
|
+
async getStatus() {
|
|
584
|
+
return this.api.get(`${this.endpoint}/status`);
|
|
585
|
+
}
|
|
586
|
+
// POST /api/subscriptions/checkout
|
|
587
|
+
async createCheckout(plan) {
|
|
588
|
+
return this.api.post(`${this.endpoint}/checkout`, { plan });
|
|
589
|
+
}
|
|
590
|
+
// POST /api/subscriptions/portal
|
|
591
|
+
async createPortal() {
|
|
592
|
+
return this.api.post(`${this.endpoint}/portal`);
|
|
593
|
+
}
|
|
594
|
+
};
|
|
595
|
+
var subscriptionResource = new SubscriptionResource();
|
|
575
596
|
export {
|
|
576
597
|
Api,
|
|
577
598
|
ApiError,
|
|
@@ -583,6 +604,7 @@ export {
|
|
|
583
604
|
RoomResource,
|
|
584
605
|
ShopResource,
|
|
585
606
|
SourceResource,
|
|
607
|
+
SubscriptionResource,
|
|
586
608
|
UserResource,
|
|
587
609
|
authResource,
|
|
588
610
|
chatResource,
|
|
@@ -590,5 +612,6 @@ export {
|
|
|
590
612
|
roomResource,
|
|
591
613
|
shopResource,
|
|
592
614
|
sourceResource,
|
|
615
|
+
subscriptionResource,
|
|
593
616
|
userResource
|
|
594
617
|
};
|