@wavezfm/api 0.7.26 → 0.7.28
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/CHANGELOG.md +9 -3
- package/README.md +25 -2
- package/dist/index.d.ts +5 -5
- package/dist/index.js.map +1 -1
- package/dist/resources/billing.d.ts +8 -6
- package/dist/resources/billing.js.map +1 -1
- package/dist/types.d.ts +17 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,22 +2,28 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
### Short prepaid Subscriber plans
|
|
6
|
+
|
|
7
|
+
- Added exported `SubscriptionCycle` values `weekly` (seven days) and `fortnightly` (fifteen days) to subscription checkout, Mercado Pago prepaid payment and checkout status contracts. Both are single payments without automatic renewal; Stripe supports enabled prices in all eight billing currencies, while Mercado Pago remains the BRL default.
|
|
8
|
+
- Confirm the current returned short-plan price with `expectedAmountMinor`, using whole JPY/KRW and hundredths for other currencies. The SDK forwards the buyer's confirmed amount without deriving a monthly fraction, changing providers or retrying payment.
|
|
9
|
+
- Subscription gifts and the legacy Mercado Pago recurring helper retain monthly/annual cycles through the exported `RecurringSubscriptionCycle` type.
|
|
10
|
+
|
|
5
11
|
### Subscription prices, currency and localization
|
|
6
12
|
|
|
7
13
|
- Subscription checkout, subscription gifts and room gifts now require `expectedAmountMinor`, the current price shown to the buyer. Use whole yen/won for JPY/KRW and hundredths for the other supported currencies. Room gifts confirm the requested count times the displayed monthly unit price; fewer eligible recipients can reduce the final charge.
|
|
8
14
|
- Mercado Pago payment submission requires `expectedAmountMinor` for `subscription_prepaid` and `gift_subscription_prepaid`, using the displayed Mercado Pago checkout configuration's BRL amount multiplied by 100. The field remains optional for other payment kinds.
|
|
9
15
|
- New Mercado Pago Subscriber purchases remain prepaid, including card payments, without automatic renewal. The retained legacy `createMercadoPagoSubscription()` helper requires a confirmed BRL amount but does not make new recurring checkout available; Mercado Pago upgrade management applies only to existing managed recurring subscriptions.
|
|
10
16
|
- The updated server rejects missing confirmations with `BILLING_PRICE_CONFIRMATION_REQUIRED` and price changes with `BILLING_PRICE_CHANGED` before starting payment. Older clients must reload current prices and obtain buyer confirmation; the SDK never accepts a replacement price or retries payment automatically.
|
|
11
|
-
- Stripe annual upgrades retain the existing subscription's actual currency and
|
|
17
|
+
- Stripe annual upgrades retain the existing subscription's actual currency and charge the annual plan upfront. Remaining paid access is kept as time, then another 12 calendar months are added; the next annual renewal moves to the combined end. There is no monetary proration credit for the retained time. Current cycle synchronization resolves provider state rather than accepting an outdated webhook snapshot.
|
|
12
18
|
- New Stripe subscription product names use the supplied locale across all eleven website languages, including Czech. Existing paid invoices keep their historical names. Fixed local annual defaults were updated; explicit configured prices retain priority, and existing recurring subscriptions are not repriced retroactively.
|
|
13
19
|
|
|
14
20
|
### Annual subscription upgrade confirmation
|
|
15
21
|
|
|
16
|
-
- Added `billing.previewSubscriptionUpgrade()` with typed amounts, ISO currency,
|
|
22
|
+
- Added `billing.previewSubscriptionUpgrade()` with typed amounts, ISO currency, expiry, charge timing and retained-time dates: `remainingAccessSeconds`, `annualStartsAt`, `accessUntil`, `renewalAt` and `remainingTimeTreatment`. `billing.upgradeSubscription()` requires the returned `quoteId` after the buyer confirms the displayed charge and dates. Older quote-free calls and old monetary-credit quotes are rejected by the server before charging; no automatic retry or confirmation is performed by the SDK.
|
|
17
23
|
|
|
18
24
|
### October 10 contract synchronization
|
|
19
25
|
|
|
20
|
-
- Added typed `billingCheckoutPolicy`, eight supported fiat currencies and donation currency maps, checkout payment modes, returned payment mode/amount/currency, and `subscriptionPaymentMode` plus announcement options to subscription checkout.
|
|
26
|
+
- Added typed `billingCheckoutPolicy`, eight supported fiat currencies and donation currency maps, checkout payment modes, returned payment mode/amount/currency, and `subscriptionPaymentMode` plus announcement options to subscription checkout. Monthly/annual prepaid Stripe Pix remains BRL-only and does not renew automatically.
|
|
21
27
|
- Added admin-session `adminMedia` listing, multipart upload and folder/asset management helpers and types. Moving or renaming an image changes its direct URL; folder rename/delete requires an empty folder.
|
|
22
28
|
- Added session-authenticated bot appearance/access and deletion helpers, bot list `canEdit`/`canDelete`, and the `delete_protected_messages` permission to types and creation validation.
|
|
23
29
|
- Typed effective private-command sender role, assigned room badge and platform role without changing raw event delivery. Documented platform staff hierarchy, protected bot targets, inline private replies and target-aware ephemeral visibility with local dismissal.
|
package/README.md
CHANGED
|
@@ -109,8 +109,10 @@ name only; changing it does not change the bot avatar. The chat avatar uses
|
|
|
109
109
|
`chatImageUrl`, then `photoUrl`, then the default robot. `photoUrl` also supplies
|
|
110
110
|
the profile photo.
|
|
111
111
|
Image artwork retains its own colors. Send the full appearance when preserving
|
|
112
|
-
other fields: the server replaces
|
|
113
|
-
`null`. `
|
|
112
|
+
other fields: the server replaces the appearance object and omitted image/color
|
|
113
|
+
fields reset to `null`. `iconBackground` defaults to `true`; set it to `false`
|
|
114
|
+
to remove the chat icon's tinted background and border without changing its artwork
|
|
115
|
+
or the bot avatar. `setBotAppearanceAccess(roomId, enabled)` is platform-admin-only.
|
|
114
116
|
|
|
115
117
|
```ts
|
|
116
118
|
await client.roomBot.sendMessage('room-id', {
|
|
@@ -435,6 +437,27 @@ not an available new recurring checkout flow. Annual-upgrade management for
|
|
|
435
437
|
Mercado Pago applies only to existing managed recurring subscriptions, not new
|
|
436
438
|
prepaid purchases.
|
|
437
439
|
|
|
440
|
+
### Annual upgrade with remaining paid time
|
|
441
|
+
|
|
442
|
+
Call `billing.previewSubscriptionUpgrade({ locale })` and display the returned
|
|
443
|
+
quote before confirming with `billing.upgradeSubscription({ quoteId, locale })`.
|
|
444
|
+
Stripe keeps the existing subscription currency and charges the annual price
|
|
445
|
+
upfront. Remaining paid access is preserved as time, without a monetary
|
|
446
|
+
proration credit, and another 12 calendar months are added after it.
|
|
447
|
+
|
|
448
|
+
The quote exposes `remainingAccessSeconds`, `annualStartsAt`, `accessUntil`,
|
|
449
|
+
`renewalAt` and `remainingTimeTreatment`. For Stripe the dates are ISO values,
|
|
450
|
+
`remainingTimeTreatment` is `preserved_time` (including when no time remains),
|
|
451
|
+
and the next annual renewal occurs at `renewalAt`, after the retained time plus
|
|
452
|
+
the purchased year. Display the exact `amountDueMinor` and currency; invoice
|
|
453
|
+
adjustments may affect the amount due. For existing Mercado Pago recurring
|
|
454
|
+
subscriptions, the existing deferred-change flow remains: the amount due now
|
|
455
|
+
is zero, the new time fields are null/zero and the treatment is `none`.
|
|
456
|
+
|
|
457
|
+
Old monetary-credit quotes are not valid for this policy. Obtain a fresh quote
|
|
458
|
+
and explicit buyer confirmation; never automatically retry a payment. Earlier
|
|
459
|
+
paid upgrades are not changed retroactively.
|
|
460
|
+
|
|
438
461
|
## Admin CDN images
|
|
439
462
|
|
|
440
463
|
`client.adminMedia` uses an administrator **user session** and CSRF protection;
|
package/dist/index.d.ts
CHANGED
|
@@ -20,7 +20,7 @@ export { createAdminMediaResource } from "./resources/adminMedia.js";
|
|
|
20
20
|
export { parseRoomQueueSnapshot } from "./utils/roomQueue.js";
|
|
21
21
|
export { formatMentionText } from "./utils/chat.js";
|
|
22
22
|
export { createRoomBotRealtimeClient } from "./realtime/roomBot.js";
|
|
23
|
-
export type { BotPrivateCommand, AdminMediaAsset, AdminMediaFolder, AdminMediaListing, BillingCurrency, BillingCheckoutPolicy, SubscriptionPaymentMode, SubscriptionUpgradeQuote, SubscriptionUpgradePreviewResponse, CheckoutSessionStatus, RoomBotAppearance, RoomBotAppearanceAccess, CountryFlagSettings, TeamDirectory, StageHoverSettings, UserProfileOptions, ApiClientConfig, ApiLike, ApiQuery, ApiQueryValue, ApiRequestOptions, ApiSuccessResponse, AuthMode, AuthUser, BadgeAssignment, ChatImageUploadResponse, ChatLinkReview, ChatMediaPreviewResponse, ChatMessage, CheckoutSessionResponse, GifFavorite, Giveaway, GiveawayEntry, GiveawayJoinEligibility, GiveawayListResponse, GiveawayMutationResponse, GiveawayPrizeDeliveryStatus, GiveawayPrizeType, GiveawayScope, GiveawayStatus, InventoryResponse, InventoryCatalogEntry, InventoryCatalogItem, PurchaseHistoryCategory, PurchaseHistoryCurrency, PurchaseHistoryItem, PurchaseHistoryOptions, PurchaseHistoryResponse, LastFmAccountProfile, LastFmLinkStatus, LastFmWriteResponse, MediaSearchResponse, YouTubeRegionAvailability, RoomOwnershipTransferChallenge, RoomOwnershipTransferResult, MediaSearchResult, MiscShopUserState, MiscStoreCurrency, MiscStoreItemKind, MiscStoreRenderMode, NotificationCenterClearResponse, NotificationCenterStatus, PlaylistExternalImportResult, PlaylistExternalImportSource, PlaylistJsonExport, PlaylistJsonImportResult, PlaylistJsonTrack, PlaylistSummary, PlaylistTrack, PlaylistTrackAvailabilityInput, PlaylistTrackAvailabilityResult, PlaylistTrackSearchResult, PrivateConversation, PrivateMessage, PrivateMessageCustomEmoji, PrivateMessageReply, PrivateMessageSendInput, PrivateMessageSendResponse, PrivateMessageUser, RoomBotPermission, RoomExternalMediaMetadataResponse, RoomExternalMediaProvider, RoomExternalMediaSubtitleTrack, RoomExternalMediaValidationResponse, RoomActiveUser, RoomCustomEmoji, RoomLinkFiltersUpdateInput, RoomGuestPresenceResponse, RoomGuestViewer, RoomGlobalLimits, RoomGlobalLimitsUpdateInput, RoomPlaybackHistoryEntry, RoomPermission, RoomPermissionOverrideMap, RoomQueueEntry, RoomQueuePlayback, RoomQueueSnapshot, RoomQueueStatusResponse, RoomQueueUser, RoomQueueViewerStatus, RoomRoleName, RoomSettingsUpdateInput, RoomStateSnapshot, RoomBotEditMessageInput, RoomBotChatEmbed, RoomBotMessageReplyInput, RoomBotEventsResponse, RoomPresenceEventFilterType, RoomBotQueueAddResponse, RoomBotRealtimeClient, RoomBotRealtimeSendMessageInput, RoomBotRealtimeOptions, RoomActionActor, RoomBotUserKickedPayload, RoomBotUserBannedPayload, RoomBotUserUnbannedPayload, RoomBotQueueRemovalReason, RoomBotQueueRemovedPayload, RoomBotQueueLeftPayload, RoomBotTrackSkippedPayload, RoomBotQueueReorderedPayload, RoomBotMessageDeletedPayload, RoomBotChatClearedPayload, RoomBotUserUpdatedPayload, RoomBotRoomSettingsUpdatedPayload, RoomBotRealtimeEventPayloads, RoomBotRealtimeEventName, RoomBotSendMessageInput, RoomBotSendMessageResponse, RoomBotState, RoomBotToken, RoomBotSettings, RoomBotSettingsUpdateInput, RoomPresenceEvent, RoomPresenceEventType, RoomSummary, RoomSystemAlert, RoomEvent, RoomEventApprovalStatus, RoomEventListResponse, RoomEventMutationResponse, RoomEventScope, RoomEventStatus, RoomEventSubmissionInput, WavezApiLocale, WavezApiMessageKey, WavezApiMessages, WavezApiMessageValues, StoreCatalogResponse, StoreCatalogItem, StoreCatalogSection, MiscStoreItem, AdminSystemHealth, AdminSystemStatus, SystemDonationGoal, SystemAlert, SystemAlertAppearance, SystemAlertCustomEmoji, SystemAlertInput, SystemAlertResponse, SystemHealth, SystemPublicStats, SystemProgressionXp, SystemStatus, TwoFactorStatus, UserSettings, UserSystemAlert, UserProfile, UserBlockState, WalletBalance, WebSocketLike, WsPacket, } from "./types.js";
|
|
23
|
+
export type { BotPrivateCommand, AdminMediaAsset, AdminMediaFolder, AdminMediaListing, BillingCurrency, BillingCheckoutPolicy, SubscriptionPaymentMode, SubscriptionCycle, RecurringSubscriptionCycle, SubscriptionUpgradeQuote, SubscriptionUpgradePreviewResponse, CheckoutSessionStatus, RoomBotAppearance, RoomBotAppearanceAccess, CountryFlagSettings, TeamDirectory, StageHoverSettings, UserProfileOptions, ApiClientConfig, ApiLike, ApiQuery, ApiQueryValue, ApiRequestOptions, ApiSuccessResponse, AuthMode, AuthUser, BadgeAssignment, ChatImageUploadResponse, ChatLinkReview, ChatMediaPreviewResponse, ChatMessage, CheckoutSessionResponse, GifFavorite, Giveaway, GiveawayEntry, GiveawayJoinEligibility, GiveawayListResponse, GiveawayMutationResponse, GiveawayPrizeDeliveryStatus, GiveawayPrizeType, GiveawayScope, GiveawayStatus, InventoryResponse, InventoryCatalogEntry, InventoryCatalogItem, PurchaseHistoryCategory, PurchaseHistoryCurrency, PurchaseHistoryItem, PurchaseHistoryOptions, PurchaseHistoryResponse, LastFmAccountProfile, LastFmLinkStatus, LastFmWriteResponse, MediaSearchResponse, YouTubeRegionAvailability, RoomOwnershipTransferChallenge, RoomOwnershipTransferResult, MediaSearchResult, MiscShopUserState, MiscStoreCurrency, MiscStoreItemKind, MiscStoreRenderMode, NotificationCenterClearResponse, NotificationCenterStatus, PlaylistExternalImportResult, PlaylistExternalImportSource, PlaylistJsonExport, PlaylistJsonImportResult, PlaylistJsonTrack, PlaylistSummary, PlaylistTrack, PlaylistTrackAvailabilityInput, PlaylistTrackAvailabilityResult, PlaylistTrackSearchResult, PrivateConversation, PrivateMessage, PrivateMessageCustomEmoji, PrivateMessageReply, PrivateMessageSendInput, PrivateMessageSendResponse, PrivateMessageUser, RoomBotPermission, RoomExternalMediaMetadataResponse, RoomExternalMediaProvider, RoomExternalMediaSubtitleTrack, RoomExternalMediaValidationResponse, RoomActiveUser, RoomCustomEmoji, RoomLinkFiltersUpdateInput, RoomGuestPresenceResponse, RoomGuestViewer, RoomGlobalLimits, RoomGlobalLimitsUpdateInput, RoomPlaybackHistoryEntry, RoomPermission, RoomPermissionOverrideMap, RoomQueueEntry, RoomQueuePlayback, RoomQueueSnapshot, RoomQueueStatusResponse, RoomQueueUser, RoomQueueViewerStatus, RoomRoleName, RoomSettingsUpdateInput, RoomStateSnapshot, RoomBotEditMessageInput, RoomBotChatEmbed, RoomBotMessageReplyInput, RoomBotEventsResponse, RoomPresenceEventFilterType, RoomBotQueueAddResponse, RoomBotRealtimeClient, RoomBotRealtimeSendMessageInput, RoomBotRealtimeOptions, RoomActionActor, RoomBotUserKickedPayload, RoomBotUserBannedPayload, RoomBotUserUnbannedPayload, RoomBotQueueRemovalReason, RoomBotQueueRemovedPayload, RoomBotQueueLeftPayload, RoomBotTrackSkippedPayload, RoomBotQueueReorderedPayload, RoomBotMessageDeletedPayload, RoomBotChatClearedPayload, RoomBotUserUpdatedPayload, RoomBotRoomSettingsUpdatedPayload, RoomBotRealtimeEventPayloads, RoomBotRealtimeEventName, RoomBotSendMessageInput, RoomBotSendMessageResponse, RoomBotState, RoomBotToken, RoomBotSettings, RoomBotSettingsUpdateInput, RoomPresenceEvent, RoomPresenceEventType, RoomSummary, RoomSystemAlert, RoomEvent, RoomEventApprovalStatus, RoomEventListResponse, RoomEventMutationResponse, RoomEventScope, RoomEventStatus, RoomEventSubmissionInput, WavezApiLocale, WavezApiMessageKey, WavezApiMessages, WavezApiMessageValues, StoreCatalogResponse, StoreCatalogItem, StoreCatalogSection, MiscStoreItem, AdminSystemHealth, AdminSystemStatus, SystemDonationGoal, SystemAlert, SystemAlertAppearance, SystemAlertCustomEmoji, SystemAlertInput, SystemAlertResponse, SystemHealth, SystemPublicStats, SystemProgressionXp, SystemStatus, TwoFactorStatus, UserSettings, UserSystemAlert, UserProfile, UserBlockState, WalletBalance, WebSocketLike, WsPacket, } from "./types.js";
|
|
24
24
|
import type { ApiClientConfig } from "./types.js";
|
|
25
25
|
export declare function createApiClient(config: ApiClientConfig): {
|
|
26
26
|
api: import("./core/api.js").WavezApi;
|
|
@@ -492,7 +492,7 @@ export declare function createApiClient(config: ApiClientConfig): {
|
|
|
492
492
|
subscriptionPaymentMode?: import("./types.js").SubscriptionPaymentMode | null;
|
|
493
493
|
announceInRoom?: boolean;
|
|
494
494
|
announceRoomSlug?: string | null;
|
|
495
|
-
cycle?:
|
|
495
|
+
cycle?: import("./types.js").SubscriptionCycle | null;
|
|
496
496
|
currency?: string | null;
|
|
497
497
|
locale?: string | null;
|
|
498
498
|
returnPath?: string | null;
|
|
@@ -549,7 +549,7 @@ export declare function createApiClient(config: ApiClientConfig): {
|
|
|
549
549
|
expectedAmountMinor: number;
|
|
550
550
|
recipientUsername?: string | null;
|
|
551
551
|
recipientUserId?: string | null;
|
|
552
|
-
cycle?:
|
|
552
|
+
cycle?: import("./types.js").RecurringSubscriptionCycle | null;
|
|
553
553
|
currency?: string | null;
|
|
554
554
|
locale?: string | null;
|
|
555
555
|
returnPath?: string | null;
|
|
@@ -576,7 +576,7 @@ export declare function createApiClient(config: ApiClientConfig): {
|
|
|
576
576
|
createMercadoPagoPayment(input: {
|
|
577
577
|
kind: string;
|
|
578
578
|
expectedAmountMinor?: number;
|
|
579
|
-
cycle?:
|
|
579
|
+
cycle?: import("./types.js").SubscriptionCycle | null;
|
|
580
580
|
quantity?: number;
|
|
581
581
|
amountCents?: number;
|
|
582
582
|
itemId?: string | null;
|
|
@@ -597,7 +597,7 @@ export declare function createApiClient(config: ApiClientConfig): {
|
|
|
597
597
|
getMercadoPagoPaymentStatus(paymentId: string): Promise<import("./types.js").ApiSuccessResponse<Record<string, unknown>>>;
|
|
598
598
|
createMercadoPagoSubscription(input: {
|
|
599
599
|
expectedAmountMinor: number;
|
|
600
|
-
cycle?:
|
|
600
|
+
cycle?: import("./types.js").RecurringSubscriptionCycle | null;
|
|
601
601
|
locale?: string | null;
|
|
602
602
|
returnPath?: string | null;
|
|
603
603
|
formData?: Record<string, unknown> | null;
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEpD,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,EAAE,kBAAkB,EAAE,MA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BAAoB,CAAC,GAAG,CAAC;QACjC,MAAM,EAAE,oBAAoB,CAAC,GAAG,CAAC;QACjC,OAAO,EAAE,qBAAqB,CAAC,GAAG,CAAC;KACtC,CAAC;AACN,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ApiLike, CheckoutSessionResponse, CheckoutSessionStatus, SubscriptionPaymentMode, SubscriptionUpgradePreviewResponse } from "../types.js";
|
|
1
|
+
import type { ApiLike, CheckoutSessionResponse, CheckoutSessionStatus, RecurringSubscriptionCycle, SubscriptionCycle, SubscriptionPaymentMode, SubscriptionUpgradePreviewResponse } from "../types.js";
|
|
2
2
|
export declare function createBillingResource(api: ApiLike): {
|
|
3
3
|
getCheckoutSessionStatus(sessionId: string): Promise<import("../types.js").ApiSuccessResponse<CheckoutSessionStatus>>;
|
|
4
4
|
cancelSubscription(): Promise<import("../types.js").ApiSuccessResponse<Record<string, unknown>>>;
|
|
@@ -15,11 +15,11 @@ export declare function createBillingResource(api: ApiLike): {
|
|
|
15
15
|
createSubscriptionCheckout(input: {
|
|
16
16
|
/** Confirmed catalog amount in Stripe minor units: whole JPY/KRW; hundredths otherwise. */
|
|
17
17
|
expectedAmountMinor: number;
|
|
18
|
-
/**
|
|
18
|
+
/** Weekly and fortnightly are prepaid in all supported Stripe currencies; monthly/annual Stripe prepaid remains BRL Pix. */
|
|
19
19
|
subscriptionPaymentMode?: SubscriptionPaymentMode | null;
|
|
20
20
|
announceInRoom?: boolean;
|
|
21
21
|
announceRoomSlug?: string | null;
|
|
22
|
-
cycle?:
|
|
22
|
+
cycle?: SubscriptionCycle | null;
|
|
23
23
|
currency?: string | null;
|
|
24
24
|
locale?: string | null;
|
|
25
25
|
returnPath?: string | null;
|
|
@@ -76,7 +76,7 @@ export declare function createBillingResource(api: ApiLike): {
|
|
|
76
76
|
expectedAmountMinor: number;
|
|
77
77
|
recipientUsername?: string | null;
|
|
78
78
|
recipientUserId?: string | null;
|
|
79
|
-
cycle?:
|
|
79
|
+
cycle?: RecurringSubscriptionCycle | null;
|
|
80
80
|
currency?: string | null;
|
|
81
81
|
locale?: string | null;
|
|
82
82
|
returnPath?: string | null;
|
|
@@ -105,7 +105,8 @@ export declare function createBillingResource(api: ApiLike): {
|
|
|
105
105
|
kind: string;
|
|
106
106
|
/** Required for subscription_prepaid and gift_subscription_prepaid; BRL cents. */
|
|
107
107
|
expectedAmountMinor?: number;
|
|
108
|
-
|
|
108
|
+
/** Subscription purchases accept short prepaid cycles; gifts remain monthly or annual. */
|
|
109
|
+
cycle?: SubscriptionCycle | null;
|
|
109
110
|
quantity?: number;
|
|
110
111
|
amountCents?: number;
|
|
111
112
|
itemId?: string | null;
|
|
@@ -126,7 +127,8 @@ export declare function createBillingResource(api: ApiLike): {
|
|
|
126
127
|
getMercadoPagoPaymentStatus(paymentId: string): Promise<import("../types.js").ApiSuccessResponse<Record<string, unknown>>>;
|
|
127
128
|
createMercadoPagoSubscription(input: {
|
|
128
129
|
expectedAmountMinor: number;
|
|
129
|
-
|
|
130
|
+
/** Legacy recurring-management flow; short terms use createMercadoPagoPayment(). */
|
|
131
|
+
cycle?: RecurringSubscriptionCycle | null;
|
|
130
132
|
locale?: string | null;
|
|
131
133
|
returnPath?: string | null;
|
|
132
134
|
formData?: Record<string, unknown> | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"billing.js","sourceRoot":"","sources":["../../src/resources/billing.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,qBAAqB,CAAC,GAAY;IAC9C,OAAO;QACH,wBAAwB,CAAC,SAAiB;YACtC,OAAO,GAAG,CAAC,GAAG,CAAwB,kCAAkC,EAAE;gBACtE,KAAK,EAAE,EAAE,SAAS,EAAE;aACvB,CAAC,CAAC;QACP,CAAC;QAED,kBAAkB;YACd,OAAO,GAAG,CAAC,IAAI,CACX,8BAA8B,EAC9B,EAAE,CACL,CAAC;QACN,CAAC;QAED,kBAAkB;YACd,OAAO,GAAG,CAAC,IAAI,CACX,8BA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,CACR,CAAC;QACN,CAAC;QAED,wBAAwB,CAAC,
|
|
1
|
+
{"version":3,"file":"billing.js","sourceRoot":"","sources":["../../src/resources/billing.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,qBAAqB,CAAC,GAAY;IAC9C,OAAO;QACH,wBAAwB,CAAC,SAAiB;YACtC,OAAO,GAAG,CAAC,GAAG,CAAwB,kCAAkC,EAAE;gBACtE,KAAK,EAAE,EAAE,SAAS,EAAE;aACvB,CAAC,CAAC;QACP,CAAC;QAED,kBAAkB;YACd,OAAO,GAAG,CAAC,IAAI,CACX,8BAA8B,EAC9B,EAAE,CACL,CAAC;QACN,CAAC;QAED,kBAAkB;YACd,OAAO,GAAG,CAAC,IAAI,CACX,8BAA8B,EAC9B,EAAE,CACL,CAAC;QACN,CAAC;QAED,0BAA0B,CAAC,KAAkC;YACzD,OAAO,GAAG,CAAC,IAAI,CACX,uCAAuC,EACvC,KAAK,IAAI,EAAE,CACd,CAAC;QACN,CAAC;QAED,+EAA+E;QAC/E,mBAAmB,CAAC,KAAkD;YAClE,OAAO,GAAG,CAAC,IAAI,CACX,+BAA+B,EAC/B,KAAK,CACR,CAAC;QACN,CAAC;QAED,8BAA8B;YAC1B,OAAO,GAAG,CAAC,GAAG,CACV,uCAAuC,CAC1C,CAAC;QACN,CAAC;QAED,0BAA0B,CAAC,KAa1B;YACG,OAAO,GAAG,CAAC,IAAI,CACX,gCAAgC,EAChC,KAAK,CACR,CAAC;QACN,CAAC;QAED,qBAAqB,CAAC,KAOrB;YACG,OAAO,GAAG,CAAC,IAAI,CACX,4BAA4B,EAC5B,KAAK,IAAI,EAAE,CACd,CAAC;QACN,CAAC;QAED,sBAAsB,CAAC,KAStB;YACG,OAAO,GAAG,CAAC,IAAI,CACX,8BAA8B,EAC9B,KAAK,CACR,CAAC;QACN,CAAC;QAED,0BAA0B,CACtB,MAAc,EACd,KAOC;YAED,OAAO,GAAG,CAAC,IAAI,CACX,2BAA2B,kBAAkB,CAAC,MAAM,CAAC,WAAW,EAChE,KAAK,IAAI,EAAE,CACd,CAAC;QACN,CAAC;QAED,4BAA4B,CAAC,KAO5B;YACG,OAAO,GAAG,CAAC,IAAI,CACX,mCAAmC,EACnC,KAAK,IAAI,EAAE,CACd,CAAC;QACN,CAAC;QAED,yBAAyB,CAAC,KAWzB;YACG,OAAO,GAAG,CAAC,IAAI,CACX,iCAAiC,EACjC,KAAK,CACR,CAAC;QACN,CAAC;QAED,8BAA8B,CAAC,KAc9B;YACG,OAAO,GAAG,CAAC,IAAI,CACX,qCAAqC,EACrC,KAAK,CACR,CAAC;QACN,CAAC;QAED,kCAAkC,CAAC,KAalC;YACG,OAAO,GAAG,CAAC,IAAI,CACX,0CAA0C,EAC1C,KAAK,CACR,CAAC;QACN,CAAC;QAED,wBAAwB,CAAC,KAsBxB;YACG,OAAO,GAAG,CAAC,IAAI,CACX,8BAA8B,EAC9B,KAAK,CACR,CAAC;QACN,CAAC;QAED,2BAA2B,CAAC,SAAiB;YACzC,OAAO,GAAG,CAAC,GAAG,CACV,gCAAgC,kBAAkB,CAAC,SAAS,CAAC,SAAS,CACzE,CAAC;QACN,CAAC;QAED,6BAA6B,CAAC,KAO7B;YACG,OAAO,GAAG,CAAC,IAAI,CACX,mCAAmC,EACnC,KAAK,IAAI,EAAE,CACd,CAAC;QACN,CAAC;QAED,gBAAgB;YACZ,OAAO,GAAG,CAAC,GAAG,CAAY,wBAAwB,CAAC,CAAC;QACxD,CAAC;QAED,YAAY,CAAC,MAAc;YACvB,OAAO,GAAG,CAAC,IAAI,CACX,kBAAkB,kBAAkB,CAAC,MAAM,CAAC,OAAO,EACnD,EAAE,CACL,CAAC;QACN,CAAC;KACJ,CAAC;AACN,CAAC"}
|
package/dist/types.d.ts
CHANGED
|
@@ -789,6 +789,10 @@ export interface StoreCatalogResponse {
|
|
|
789
789
|
/** Supported fiat currencies. JPY and KRW have zero-decimal Stripe checkout amounts. */
|
|
790
790
|
export type BillingCurrency = "usd" | "brl" | "eur" | "czk" | "jpy" | "pln" | "krw" | "nok";
|
|
791
791
|
export type SubscriptionPaymentMode = "recurring" | "prepaid";
|
|
792
|
+
/** Short cycles are prepaid: exactly seven or fifteen days, without automatic renewal. */
|
|
793
|
+
export type SubscriptionCycle = "monthly" | "annual" | "weekly" | "fortnightly";
|
|
794
|
+
/** Recurring subscriptions and subscription gifts retain monthly or annual cycles. */
|
|
795
|
+
export type RecurringSubscriptionCycle = "monthly" | "annual";
|
|
792
796
|
export interface BillingCheckoutPolicy {
|
|
793
797
|
stripeBrlEnabled: boolean;
|
|
794
798
|
/** Applies to new Stripe BRL checkouts, not existing recurring renewals. */
|
|
@@ -883,6 +887,8 @@ export interface RoomBotAppearance {
|
|
|
883
887
|
icon: string | null;
|
|
884
888
|
/** HTTPS chat-avatar image; falls back to photoUrl, then the default robot. */
|
|
885
889
|
chatImageUrl: string | null;
|
|
890
|
+
/** Whether the name badge has a tinted background and border. Defaults to true. */
|
|
891
|
+
iconBackground?: boolean;
|
|
886
892
|
}
|
|
887
893
|
export interface RoomBotAppearanceAccess {
|
|
888
894
|
enabled: boolean;
|
|
@@ -1175,6 +1181,16 @@ export interface SubscriptionUpgradeQuote {
|
|
|
1175
1181
|
expiresAt: string;
|
|
1176
1182
|
chargeTiming: "immediate" | "next_billing_date";
|
|
1177
1183
|
scheduledChangeAt: string | null;
|
|
1184
|
+
/** Paid access retained by this upgrade, in whole seconds. */
|
|
1185
|
+
remainingAccessSeconds: number;
|
|
1186
|
+
/** Start of the additional annual coverage; ISO date for Stripe, null for Mercado Pago. */
|
|
1187
|
+
annualStartsAt: string | null;
|
|
1188
|
+
/** End of paid coverage after adding 12 calendar months; ISO date for Stripe. */
|
|
1189
|
+
accessUntil: string | null;
|
|
1190
|
+
/** Stripe's next annual renewal, after the retained time plus the purchased year. */
|
|
1191
|
+
renewalAt: string | null;
|
|
1192
|
+
/** Retained time is access, not a monetary proration credit. */
|
|
1193
|
+
remainingTimeTreatment: "preserved_time" | "none";
|
|
1178
1194
|
}
|
|
1179
1195
|
export interface SubscriptionUpgradePreviewResponse {
|
|
1180
1196
|
success: true;
|
|
@@ -1185,7 +1201,7 @@ export interface CheckoutSessionStatus {
|
|
|
1185
1201
|
status: string | null;
|
|
1186
1202
|
paymentStatus: string | null;
|
|
1187
1203
|
kind: string | null;
|
|
1188
|
-
cycle:
|
|
1204
|
+
cycle: SubscriptionCycle | null;
|
|
1189
1205
|
subscriptionPaymentMode?: SubscriptionPaymentMode | null;
|
|
1190
1206
|
/** Recorded amount in hundredths of the major currency unit. */
|
|
1191
1207
|
amount?: number | null;
|