@borealise/api 2.0.0-alpha.16 → 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 +44 -0
- package/dist/index.d.ts +44 -0
- package/dist/index.js +11 -1
- package/dist/index.mjs +11 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -853,6 +853,42 @@ interface PortalResponse {
|
|
|
853
853
|
url: string;
|
|
854
854
|
};
|
|
855
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
|
+
}
|
|
856
892
|
interface SubscriptionResource {
|
|
857
893
|
getStatus(): Promise<ApiResponse<{
|
|
858
894
|
success: boolean;
|
|
@@ -863,6 +899,14 @@ interface SubscriptionResource {
|
|
|
863
899
|
success: boolean;
|
|
864
900
|
}>>;
|
|
865
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
|
+
}>>;
|
|
866
910
|
}
|
|
867
911
|
declare const createSubscriptionResource: (api: Api) => SubscriptionResource;
|
|
868
912
|
|
package/dist/index.d.ts
CHANGED
|
@@ -853,6 +853,42 @@ interface PortalResponse {
|
|
|
853
853
|
url: string;
|
|
854
854
|
};
|
|
855
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
|
+
}
|
|
856
892
|
interface SubscriptionResource {
|
|
857
893
|
getStatus(): Promise<ApiResponse<{
|
|
858
894
|
success: boolean;
|
|
@@ -863,6 +899,14 @@ interface SubscriptionResource {
|
|
|
863
899
|
success: boolean;
|
|
864
900
|
}>>;
|
|
865
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
|
+
}>>;
|
|
866
910
|
}
|
|
867
911
|
declare const createSubscriptionResource: (api: Api) => SubscriptionResource;
|
|
868
912
|
|
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
|