Skip to content

Commit 643c65b

Browse files
Sync public snapshot from freebuff-private
Source: CodebuffAI/freebuff-private@b3cb3a68e9e692aec366fe9accafc33e9b473948
1 parent 42a74a2 commit 643c65b

2 files changed

Lines changed: 56 additions & 2 deletions

File tree

‎bun.lock‎

Lines changed: 0 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎common/src/types/freebuff-session.ts‎

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1169,6 +1169,17 @@ export type FreebuffSessionAdmissionResponse = (
11691169
) & {
11701170
/** Current country verification; does not grant full access. Sent on GET. */
11711171
countryVerified?: boolean
1172+
/** Whether a country verification could change this account's access
1173+
* right now. False for a limited-access region (verifying one grants
1174+
* nothing) and for an account whose region is set; clients hide the
1175+
* "verify country" prompt then. Absent from an older server: show it. */
1176+
verificationCanChangeAccess?: boolean
1177+
/** Why `verificationCanChangeAccess` is what it is. */
1178+
verificationReason?: FreebuffCountryVerificationReason
1179+
/** Present only when verifying cannot help (`limited_region` /
1180+
* `region_locked`) and a paid plan above the account's own exists: the
1181+
* "unlock more with a plan" offer, numbers from the server's catalog. */
1182+
countryUpsell?: FreebuffPlanUpsell
11721183
/** Unexpired Desktop purchases, including occupied hours. Picker metadata;
11731184
* admission still checks ownership, liveness, and capacity atomically. */
11741185
desktopPurchases?: FreebuffDesktopPurchaseInfo[]
@@ -1178,6 +1189,51 @@ export type FreebuffSessionAdmissionResponse = (
11781189
desktopSessionCounts?: FreebuffDesktopSessionCounts
11791190
}
11801191

1192+
/**
1193+
* Why a country verification can or cannot change an account's access
1194+
* (docs/freebuff-access-floor.md § Declare first):
1195+
* - `limited_region`: the account is in (or declared) a limited-access
1196+
* country; verifying it grants nothing.
1197+
* - `region_locked`: the account's region is set to limited access, and no
1198+
* self-serve verification changes it (only a region review).
1199+
* - `eligible`: verifying from a direct connection in a full-access country
1200+
* can change it.
1201+
*/
1202+
export type FreebuffCountryVerificationReason =
1203+
| 'limited_region'
1204+
| 'region_locked'
1205+
| 'eligible'
1206+
1207+
/**
1208+
* A paid-plan offer for a limited-access account, built on the server from
1209+
* the plan catalog (`freebuffLimitedAccessUpsell`) so every surface renders
1210+
* the same figures. Daily Freebucks are at LIMITED access, which is what the
1211+
* account would actually get.
1212+
*/
1213+
export type FreebuffPlanUpsell = {
1214+
/** The plan the headline names: the best plan for an account without one,
1215+
* the next plan up for a subscriber. */
1216+
planId: string
1217+
planName: string
1218+
/** Daily Freebucks on `planId` at limited access. */
1219+
dailyFreebucks: number
1220+
/** Daily Freebucks the account gets now (its plan, or the free pool). */
1221+
currentDailyFreebucks: number
1222+
/** Every plan above the account's own, cheapest first. */
1223+
plans: Array<{
1224+
planId: string
1225+
planName: string
1226+
dailyFreebucks: number
1227+
priceUsd: number
1228+
}>
1229+
/** e.g. "Unlock up to 350 Freebucks a day with Freebuff Pro". */
1230+
headline: string
1231+
/** The positioning line under the headline. */
1232+
tagline: string
1233+
/** The plans page, tagged `source=country_limited` for attribution. */
1234+
plansUrl: string
1235+
}
1236+
11811237
export type FreebuffSessionServerResponse =
11821238
| FreebuffSessionAdmissionResponse
11831239
| {

0 commit comments

Comments
 (0)