@borealise/api 1.0.6 → 1.0.8

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
@@ -620,4 +620,36 @@ declare class ShopResource extends ApiResource {
620
620
  }
621
621
  declare const shopResource: ShopResource;
622
622
 
623
- 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 };
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 CreateIntentResponse {
632
+ success: boolean;
633
+ data: {
634
+ subscriptionId: string;
635
+ clientSecret: string;
636
+ };
637
+ }
638
+ interface PortalResponse {
639
+ success: boolean;
640
+ data: {
641
+ url: string;
642
+ };
643
+ }
644
+ declare class SubscriptionResource extends ApiResource {
645
+ protected readonly endpoint = "/subscriptions";
646
+ getStatus(): Promise<ApiResponse<{
647
+ success: boolean;
648
+ data: SubscriptionStatus;
649
+ }>>;
650
+ createIntent(plan: SubscriptionPlan): Promise<ApiResponse<CreateIntentResponse>>;
651
+ createPortal(): Promise<ApiResponse<PortalResponse>>;
652
+ }
653
+ declare const subscriptionResource: SubscriptionResource;
654
+
655
+ 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
@@ -620,4 +620,36 @@ declare class ShopResource extends ApiResource {
620
620
  }
621
621
  declare const shopResource: ShopResource;
622
622
 
623
- 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 };
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 CreateIntentResponse {
632
+ success: boolean;
633
+ data: {
634
+ subscriptionId: string;
635
+ clientSecret: string;
636
+ };
637
+ }
638
+ interface PortalResponse {
639
+ success: boolean;
640
+ data: {
641
+ url: string;
642
+ };
643
+ }
644
+ declare class SubscriptionResource extends ApiResource {
645
+ protected readonly endpoint = "/subscriptions";
646
+ getStatus(): Promise<ApiResponse<{
647
+ success: boolean;
648
+ data: SubscriptionStatus;
649
+ }>>;
650
+ createIntent(plan: SubscriptionPlan): Promise<ApiResponse<CreateIntentResponse>>;
651
+ createPortal(): Promise<ApiResponse<PortalResponse>>;
652
+ }
653
+ declare const subscriptionResource: SubscriptionResource;
654
+
655
+ 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
@@ -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,29 @@ 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/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/portal
648
+ async createPortal() {
649
+ return this.api.post(`${this.endpoint}/portal`);
650
+ }
651
+ };
652
+ var subscriptionResource = new SubscriptionResource();
628
653
  // Annotate the CommonJS export names for ESM import in node:
629
654
  0 && (module.exports = {
630
655
  Api,
@@ -637,6 +662,7 @@ var shopResource = new ShopResource();
637
662
  RoomResource,
638
663
  ShopResource,
639
664
  SourceResource,
665
+ SubscriptionResource,
640
666
  UserResource,
641
667
  authResource,
642
668
  chatResource,
@@ -644,5 +670,6 @@ var shopResource = new ShopResource();
644
670
  roomResource,
645
671
  shopResource,
646
672
  sourceResource,
673
+ subscriptionResource,
647
674
  userResource
648
675
  });
package/dist/index.mjs CHANGED
@@ -572,6 +572,29 @@ 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/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/portal
593
+ async createPortal() {
594
+ return this.api.post(`${this.endpoint}/portal`);
595
+ }
596
+ };
597
+ var subscriptionResource = new SubscriptionResource();
575
598
  export {
576
599
  Api,
577
600
  ApiError,
@@ -583,6 +606,7 @@ export {
583
606
  RoomResource,
584
607
  ShopResource,
585
608
  SourceResource,
609
+ SubscriptionResource,
586
610
  UserResource,
587
611
  authResource,
588
612
  chatResource,
@@ -590,5 +614,6 @@ export {
590
614
  roomResource,
591
615
  shopResource,
592
616
  sourceResource,
617
+ subscriptionResource,
593
618
  userResource
594
619
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@borealise/api",
3
- "version": "1.0.6",
3
+ "version": "1.0.8",
4
4
  "description": "Official API client for Borealise",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",