@borealise/api 2.0.0-alpha.16 → 2.0.0-alpha.18
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 +45 -0
- package/dist/index.d.ts +45 -0
- package/dist/index.js +11 -1
- package/dist/index.mjs +11 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -625,6 +625,7 @@ interface ChatMessage {
|
|
|
625
625
|
user_id?: number;
|
|
626
626
|
username?: string;
|
|
627
627
|
display_name?: string | null;
|
|
628
|
+
avatar_id?: string | null;
|
|
628
629
|
role?: RoomRole;
|
|
629
630
|
global_role?: string | null;
|
|
630
631
|
subscription_type?: string | null;
|
|
@@ -853,6 +854,42 @@ interface PortalResponse {
|
|
|
853
854
|
url: string;
|
|
854
855
|
};
|
|
855
856
|
}
|
|
857
|
+
interface CreateGiftCheckoutResponse {
|
|
858
|
+
success: boolean;
|
|
859
|
+
data: {
|
|
860
|
+
checkoutUrl: string;
|
|
861
|
+
sessionId: string;
|
|
862
|
+
};
|
|
863
|
+
}
|
|
864
|
+
interface GiftHistoryEntry {
|
|
865
|
+
giftItemId: number;
|
|
866
|
+
purchaseId: number;
|
|
867
|
+
status: string;
|
|
868
|
+
startsAt: string;
|
|
869
|
+
endsAt: string;
|
|
870
|
+
createdAt: string;
|
|
871
|
+
isAnonymous: boolean;
|
|
872
|
+
recipientUsername: string | null;
|
|
873
|
+
purchaserUsername: string | null;
|
|
874
|
+
}
|
|
875
|
+
interface GiftsHistoryResponse {
|
|
876
|
+
success: boolean;
|
|
877
|
+
data: {
|
|
878
|
+
purchased: GiftHistoryEntry[];
|
|
879
|
+
received: GiftHistoryEntry[];
|
|
880
|
+
failedPurchases: Array<{
|
|
881
|
+
purchaseId: number;
|
|
882
|
+
recipientUsername: string;
|
|
883
|
+
quantity: number;
|
|
884
|
+
createdAt: string;
|
|
885
|
+
}>;
|
|
886
|
+
supporterBadge: {
|
|
887
|
+
tier: 'none' | 'bronze' | 'silver' | 'gold';
|
|
888
|
+
giftedCount: number;
|
|
889
|
+
nextTierAt: number | null;
|
|
890
|
+
};
|
|
891
|
+
};
|
|
892
|
+
}
|
|
856
893
|
interface SubscriptionResource {
|
|
857
894
|
getStatus(): Promise<ApiResponse<{
|
|
858
895
|
success: boolean;
|
|
@@ -863,6 +900,14 @@ interface SubscriptionResource {
|
|
|
863
900
|
success: boolean;
|
|
864
901
|
}>>;
|
|
865
902
|
createPortal(): Promise<ApiResponse<PortalResponse>>;
|
|
903
|
+
createGiftCheckout(recipientUsername: string, quantity: 1 | 5 | 10 | 20, isAnonymous?: boolean): Promise<ApiResponse<CreateGiftCheckoutResponse>>;
|
|
904
|
+
getGiftsHistory(): Promise<ApiResponse<GiftsHistoryResponse>>;
|
|
905
|
+
retryGiftAssignment(purchaseId: number, recipientUsername?: string): Promise<ApiResponse<{
|
|
906
|
+
success: boolean;
|
|
907
|
+
data: {
|
|
908
|
+
ok: true;
|
|
909
|
+
};
|
|
910
|
+
}>>;
|
|
866
911
|
}
|
|
867
912
|
declare const createSubscriptionResource: (api: Api) => SubscriptionResource;
|
|
868
913
|
|
package/dist/index.d.ts
CHANGED
|
@@ -625,6 +625,7 @@ interface ChatMessage {
|
|
|
625
625
|
user_id?: number;
|
|
626
626
|
username?: string;
|
|
627
627
|
display_name?: string | null;
|
|
628
|
+
avatar_id?: string | null;
|
|
628
629
|
role?: RoomRole;
|
|
629
630
|
global_role?: string | null;
|
|
630
631
|
subscription_type?: string | null;
|
|
@@ -853,6 +854,42 @@ interface PortalResponse {
|
|
|
853
854
|
url: string;
|
|
854
855
|
};
|
|
855
856
|
}
|
|
857
|
+
interface CreateGiftCheckoutResponse {
|
|
858
|
+
success: boolean;
|
|
859
|
+
data: {
|
|
860
|
+
checkoutUrl: string;
|
|
861
|
+
sessionId: string;
|
|
862
|
+
};
|
|
863
|
+
}
|
|
864
|
+
interface GiftHistoryEntry {
|
|
865
|
+
giftItemId: number;
|
|
866
|
+
purchaseId: number;
|
|
867
|
+
status: string;
|
|
868
|
+
startsAt: string;
|
|
869
|
+
endsAt: string;
|
|
870
|
+
createdAt: string;
|
|
871
|
+
isAnonymous: boolean;
|
|
872
|
+
recipientUsername: string | null;
|
|
873
|
+
purchaserUsername: string | null;
|
|
874
|
+
}
|
|
875
|
+
interface GiftsHistoryResponse {
|
|
876
|
+
success: boolean;
|
|
877
|
+
data: {
|
|
878
|
+
purchased: GiftHistoryEntry[];
|
|
879
|
+
received: GiftHistoryEntry[];
|
|
880
|
+
failedPurchases: Array<{
|
|
881
|
+
purchaseId: number;
|
|
882
|
+
recipientUsername: string;
|
|
883
|
+
quantity: number;
|
|
884
|
+
createdAt: string;
|
|
885
|
+
}>;
|
|
886
|
+
supporterBadge: {
|
|
887
|
+
tier: 'none' | 'bronze' | 'silver' | 'gold';
|
|
888
|
+
giftedCount: number;
|
|
889
|
+
nextTierAt: number | null;
|
|
890
|
+
};
|
|
891
|
+
};
|
|
892
|
+
}
|
|
856
893
|
interface SubscriptionResource {
|
|
857
894
|
getStatus(): Promise<ApiResponse<{
|
|
858
895
|
success: boolean;
|
|
@@ -863,6 +900,14 @@ interface SubscriptionResource {
|
|
|
863
900
|
success: boolean;
|
|
864
901
|
}>>;
|
|
865
902
|
createPortal(): Promise<ApiResponse<PortalResponse>>;
|
|
903
|
+
createGiftCheckout(recipientUsername: string, quantity: 1 | 5 | 10 | 20, isAnonymous?: boolean): Promise<ApiResponse<CreateGiftCheckoutResponse>>;
|
|
904
|
+
getGiftsHistory(): Promise<ApiResponse<GiftsHistoryResponse>>;
|
|
905
|
+
retryGiftAssignment(purchaseId: number, recipientUsername?: string): Promise<ApiResponse<{
|
|
906
|
+
success: boolean;
|
|
907
|
+
data: {
|
|
908
|
+
ok: true;
|
|
909
|
+
};
|
|
910
|
+
}>>;
|
|
866
911
|
}
|
|
867
912
|
declare const createSubscriptionResource: (api: Api) => SubscriptionResource;
|
|
868
913
|
|
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
|