@borealise/api 2.0.0-alpha.15 → 2.0.0-alpha.17

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
@@ -142,6 +142,7 @@ interface PublicUser {
142
142
  level: number;
143
143
  subscriptionType?: string | null;
144
144
  subscriptionMonths?: number | null;
145
+ currentRoomSlug?: string | null;
145
146
  createdAt?: string;
146
147
  friendsCount: number;
147
148
  }
@@ -852,6 +853,42 @@ interface PortalResponse {
852
853
  url: string;
853
854
  };
854
855
  }
856
+ interface CreateGiftCheckoutResponse {
857
+ success: boolean;
858
+ data: {
859
+ checkoutUrl: string;
860
+ sessionId: string;
861
+ };
862
+ }
863
+ interface GiftHistoryEntry {
864
+ giftItemId: number;
865
+ purchaseId: number;
866
+ status: string;
867
+ startsAt: string;
868
+ endsAt: string;
869
+ createdAt: string;
870
+ isAnonymous: boolean;
871
+ recipientUsername: string | null;
872
+ purchaserUsername: string | null;
873
+ }
874
+ interface GiftsHistoryResponse {
875
+ success: boolean;
876
+ data: {
877
+ purchased: GiftHistoryEntry[];
878
+ received: GiftHistoryEntry[];
879
+ failedPurchases: Array<{
880
+ purchaseId: number;
881
+ recipientUsername: string;
882
+ quantity: number;
883
+ createdAt: string;
884
+ }>;
885
+ supporterBadge: {
886
+ tier: 'none' | 'bronze' | 'silver' | 'gold';
887
+ giftedCount: number;
888
+ nextTierAt: number | null;
889
+ };
890
+ };
891
+ }
855
892
  interface SubscriptionResource {
856
893
  getStatus(): Promise<ApiResponse<{
857
894
  success: boolean;
@@ -862,6 +899,14 @@ interface SubscriptionResource {
862
899
  success: boolean;
863
900
  }>>;
864
901
  createPortal(): Promise<ApiResponse<PortalResponse>>;
902
+ createGiftCheckout(recipientUsername: string, quantity: 1 | 5 | 10 | 20, isAnonymous?: boolean): Promise<ApiResponse<CreateGiftCheckoutResponse>>;
903
+ getGiftsHistory(): Promise<ApiResponse<GiftsHistoryResponse>>;
904
+ retryGiftAssignment(purchaseId: number, recipientUsername?: string): Promise<ApiResponse<{
905
+ success: boolean;
906
+ data: {
907
+ ok: true;
908
+ };
909
+ }>>;
865
910
  }
866
911
  declare const createSubscriptionResource: (api: Api) => SubscriptionResource;
867
912
 
@@ -873,6 +918,7 @@ interface FriendEntry {
873
918
  displayName: string | null;
874
919
  avatarId: string;
875
920
  level: number;
921
+ currentRoomSlug?: string | null;
876
922
  status: 'pending' | 'accepted' | 'blocked';
877
923
  isSender: boolean;
878
924
  }
package/dist/index.d.ts CHANGED
@@ -142,6 +142,7 @@ interface PublicUser {
142
142
  level: number;
143
143
  subscriptionType?: string | null;
144
144
  subscriptionMonths?: number | null;
145
+ currentRoomSlug?: string | null;
145
146
  createdAt?: string;
146
147
  friendsCount: number;
147
148
  }
@@ -852,6 +853,42 @@ interface PortalResponse {
852
853
  url: string;
853
854
  };
854
855
  }
856
+ interface CreateGiftCheckoutResponse {
857
+ success: boolean;
858
+ data: {
859
+ checkoutUrl: string;
860
+ sessionId: string;
861
+ };
862
+ }
863
+ interface GiftHistoryEntry {
864
+ giftItemId: number;
865
+ purchaseId: number;
866
+ status: string;
867
+ startsAt: string;
868
+ endsAt: string;
869
+ createdAt: string;
870
+ isAnonymous: boolean;
871
+ recipientUsername: string | null;
872
+ purchaserUsername: string | null;
873
+ }
874
+ interface GiftsHistoryResponse {
875
+ success: boolean;
876
+ data: {
877
+ purchased: GiftHistoryEntry[];
878
+ received: GiftHistoryEntry[];
879
+ failedPurchases: Array<{
880
+ purchaseId: number;
881
+ recipientUsername: string;
882
+ quantity: number;
883
+ createdAt: string;
884
+ }>;
885
+ supporterBadge: {
886
+ tier: 'none' | 'bronze' | 'silver' | 'gold';
887
+ giftedCount: number;
888
+ nextTierAt: number | null;
889
+ };
890
+ };
891
+ }
855
892
  interface SubscriptionResource {
856
893
  getStatus(): Promise<ApiResponse<{
857
894
  success: boolean;
@@ -862,6 +899,14 @@ interface SubscriptionResource {
862
899
  success: boolean;
863
900
  }>>;
864
901
  createPortal(): Promise<ApiResponse<PortalResponse>>;
902
+ createGiftCheckout(recipientUsername: string, quantity: 1 | 5 | 10 | 20, isAnonymous?: boolean): Promise<ApiResponse<CreateGiftCheckoutResponse>>;
903
+ getGiftsHistory(): Promise<ApiResponse<GiftsHistoryResponse>>;
904
+ retryGiftAssignment(purchaseId: number, recipientUsername?: string): Promise<ApiResponse<{
905
+ success: boolean;
906
+ data: {
907
+ ok: true;
908
+ };
909
+ }>>;
865
910
  }
866
911
  declare const createSubscriptionResource: (api: Api) => SubscriptionResource;
867
912
 
@@ -873,6 +918,7 @@ interface FriendEntry {
873
918
  displayName: string | null;
874
919
  avatarId: string;
875
920
  level: number;
921
+ currentRoomSlug?: string | null;
876
922
  status: 'pending' | 'accepted' | 'blocked';
877
923
  isSender: boolean;
878
924
  }
package/dist/index.js CHANGED
@@ -370,7 +370,17 @@ var createSubscriptionResource = (api) => ({
370
370
  getStatus: () => api.get(`${endpoint8}/status`),
371
371
  createIntent: (plan) => api.post(`${endpoint8}/create-intent`, { plan }),
372
372
  cancelIntent: (subscriptionId) => api.post(`${endpoint8}/cancel-intent`, { subscriptionId }),
373
- createPortal: () => api.post(`${endpoint8}/portal`)
373
+ createPortal: () => api.post(`${endpoint8}/portal`),
374
+ createGiftCheckout: (recipientUsername, quantity, isAnonymous = false) => api.post(`${endpoint8}/create-gift-checkout`, {
375
+ recipientUsername,
376
+ quantity,
377
+ isAnonymous
378
+ }),
379
+ getGiftsHistory: () => api.get(`${endpoint8}/gifts-history`),
380
+ retryGiftAssignment: (purchaseId, recipientUsername) => api.post(`${endpoint8}/retry-gift-assignment`, {
381
+ purchaseId,
382
+ recipientUsername
383
+ })
374
384
  });
375
385
 
376
386
  // src/resources/friend.ts
package/dist/index.mjs CHANGED
@@ -320,7 +320,17 @@ var createSubscriptionResource = (api) => ({
320
320
  getStatus: () => api.get(`${endpoint8}/status`),
321
321
  createIntent: (plan) => api.post(`${endpoint8}/create-intent`, { plan }),
322
322
  cancelIntent: (subscriptionId) => api.post(`${endpoint8}/cancel-intent`, { subscriptionId }),
323
- createPortal: () => api.post(`${endpoint8}/portal`)
323
+ createPortal: () => api.post(`${endpoint8}/portal`),
324
+ createGiftCheckout: (recipientUsername, quantity, isAnonymous = false) => api.post(`${endpoint8}/create-gift-checkout`, {
325
+ recipientUsername,
326
+ quantity,
327
+ isAnonymous
328
+ }),
329
+ getGiftsHistory: () => api.get(`${endpoint8}/gifts-history`),
330
+ retryGiftAssignment: (purchaseId, recipientUsername) => api.post(`${endpoint8}/retry-gift-assignment`, {
331
+ purchaseId,
332
+ recipientUsername
333
+ })
324
334
  });
325
335
 
326
336
  // src/resources/friend.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@borealise/api",
3
- "version": "2.0.0-alpha.15",
3
+ "version": "2.0.0-alpha.17",
4
4
  "description": "Official API client for Borealise",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",