@borealise/api 1.0.7 → 1.0.9
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 +8 -4
- package/dist/index.d.ts +8 -4
- package/dist/index.js +10 -3
- package/dist/index.mjs +10 -3
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -628,10 +628,11 @@ interface SubscriptionStatus {
|
|
|
628
628
|
cancelAtPeriodEnd: boolean;
|
|
629
629
|
currentPeriodEnd: string | null;
|
|
630
630
|
}
|
|
631
|
-
interface
|
|
631
|
+
interface CreateIntentResponse {
|
|
632
632
|
success: boolean;
|
|
633
633
|
data: {
|
|
634
|
-
|
|
634
|
+
subscriptionId: string;
|
|
635
|
+
clientSecret: string;
|
|
635
636
|
};
|
|
636
637
|
}
|
|
637
638
|
interface PortalResponse {
|
|
@@ -646,9 +647,12 @@ declare class SubscriptionResource extends ApiResource {
|
|
|
646
647
|
success: boolean;
|
|
647
648
|
data: SubscriptionStatus;
|
|
648
649
|
}>>;
|
|
649
|
-
|
|
650
|
+
createIntent(plan: SubscriptionPlan): Promise<ApiResponse<CreateIntentResponse>>;
|
|
651
|
+
cancelIntent(subscriptionId: string): Promise<ApiResponse<{
|
|
652
|
+
success: boolean;
|
|
653
|
+
}>>;
|
|
650
654
|
createPortal(): Promise<ApiResponse<PortalResponse>>;
|
|
651
655
|
}
|
|
652
656
|
declare const subscriptionResource: SubscriptionResource;
|
|
653
657
|
|
|
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
|
|
658
|
+
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 CreateIntentResponse, 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
|
@@ -628,10 +628,11 @@ interface SubscriptionStatus {
|
|
|
628
628
|
cancelAtPeriodEnd: boolean;
|
|
629
629
|
currentPeriodEnd: string | null;
|
|
630
630
|
}
|
|
631
|
-
interface
|
|
631
|
+
interface CreateIntentResponse {
|
|
632
632
|
success: boolean;
|
|
633
633
|
data: {
|
|
634
|
-
|
|
634
|
+
subscriptionId: string;
|
|
635
|
+
clientSecret: string;
|
|
635
636
|
};
|
|
636
637
|
}
|
|
637
638
|
interface PortalResponse {
|
|
@@ -646,9 +647,12 @@ declare class SubscriptionResource extends ApiResource {
|
|
|
646
647
|
success: boolean;
|
|
647
648
|
data: SubscriptionStatus;
|
|
648
649
|
}>>;
|
|
649
|
-
|
|
650
|
+
createIntent(plan: SubscriptionPlan): Promise<ApiResponse<CreateIntentResponse>>;
|
|
651
|
+
cancelIntent(subscriptionId: string): Promise<ApiResponse<{
|
|
652
|
+
success: boolean;
|
|
653
|
+
}>>;
|
|
650
654
|
createPortal(): Promise<ApiResponse<PortalResponse>>;
|
|
651
655
|
}
|
|
652
656
|
declare const subscriptionResource: SubscriptionResource;
|
|
653
657
|
|
|
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
|
|
658
|
+
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 CreateIntentResponse, 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
|
@@ -638,9 +638,16 @@ var SubscriptionResource = class extends ApiResource {
|
|
|
638
638
|
async getStatus() {
|
|
639
639
|
return this.api.get(`${this.endpoint}/status`);
|
|
640
640
|
}
|
|
641
|
-
// POST /api/subscriptions/
|
|
642
|
-
|
|
643
|
-
|
|
641
|
+
// POST /api/subscriptions/create-intent
|
|
642
|
+
// Creates an incomplete subscription and returns a PaymentIntent client_secret
|
|
643
|
+
// for use with the Stripe Payment Element
|
|
644
|
+
async createIntent(plan) {
|
|
645
|
+
return this.api.post(`${this.endpoint}/create-intent`, { plan });
|
|
646
|
+
}
|
|
647
|
+
// POST /api/subscriptions/cancel-intent
|
|
648
|
+
// Cancels an incomplete subscription when the user goes back from the payment step
|
|
649
|
+
async cancelIntent(subscriptionId) {
|
|
650
|
+
return this.api.post(`${this.endpoint}/cancel-intent`, { subscriptionId });
|
|
644
651
|
}
|
|
645
652
|
// POST /api/subscriptions/portal
|
|
646
653
|
async createPortal() {
|
package/dist/index.mjs
CHANGED
|
@@ -583,9 +583,16 @@ var SubscriptionResource = class extends ApiResource {
|
|
|
583
583
|
async getStatus() {
|
|
584
584
|
return this.api.get(`${this.endpoint}/status`);
|
|
585
585
|
}
|
|
586
|
-
// POST /api/subscriptions/
|
|
587
|
-
|
|
588
|
-
|
|
586
|
+
// POST /api/subscriptions/create-intent
|
|
587
|
+
// Creates an incomplete subscription and returns a PaymentIntent client_secret
|
|
588
|
+
// for use with the Stripe Payment Element
|
|
589
|
+
async createIntent(plan) {
|
|
590
|
+
return this.api.post(`${this.endpoint}/create-intent`, { plan });
|
|
591
|
+
}
|
|
592
|
+
// POST /api/subscriptions/cancel-intent
|
|
593
|
+
// Cancels an incomplete subscription when the user goes back from the payment step
|
|
594
|
+
async cancelIntent(subscriptionId) {
|
|
595
|
+
return this.api.post(`${this.endpoint}/cancel-intent`, { subscriptionId });
|
|
589
596
|
}
|
|
590
597
|
// POST /api/subscriptions/portal
|
|
591
598
|
async createPortal() {
|