//#region src/plans.d.ts /** * Plan configuration for Hexclave pricing tiers. * * This file defines the limits for each plan and the item IDs used to track them. * Import these constants in seed.ts and backend code for limit enforcement. */ declare const UNLIMITED = 1000000000; /** * Item IDs used across the codebase for tracking plan limits. */ declare const ITEM_IDS: { readonly seats: "dashboard_admins"; readonly authUsers: "auth_users"; readonly emailsPerMonth: "emails_per_month"; readonly analyticsTimeoutSeconds: "analytics_timeout_seconds"; readonly analyticsEvents: "analytics_events"; readonly sessionReplays: "session_replays"; readonly onboardingCall: "onboarding_call"; }; type ItemId = typeof ITEM_IDS[keyof typeof ITEM_IDS]; /** * The offerings/limits included in a plan. */ type PlanProductOfferings = { seats: number; authUsers: number; emailsPerMonth: number; analyticsTimeoutSeconds: number; analyticsEvents: number; sessionReplays: number; }; /** * Plan limits by plan ID. */ declare const PLAN_LIMITS: { free: PlanProductOfferings; team: PlanProductOfferings; growth: PlanProductOfferings; }; type PlanId = keyof typeof PLAN_LIMITS; /** * Base plan IDs ordered from highest to lowest tier. Use this (instead of * string literals) whenever code needs to pick a customer's "current" plan * from their product list, so the choice stays in sync with `PLAN_LIMITS`. */ declare const BASE_PLAN_IDS_BY_TIER: readonly ["growth", "team", "free"]; /** * Minimal shape of a product entry as it comes out of `team.useProducts()` / * `customer.useProducts()` on both the SDK and dashboard sides. Structural so * we don't pull SDK types into `stack-shared`. */ type PlanResolutionProduct = { id: string | null; type?: string; }; /** * Picks the customer's highest-tier active base plan (growth → team → free), * falling back to `"free"` if none of the known plans appear as a * subscription. Single source of truth for plan gating in the dashboard — * do not reintroduce ad-hoc `p.id === "team" || p.id === "growth"` checks. */ declare function resolvePlanId(products: ReadonlyArray): PlanId; /** * Convenience predicate for "is this customer on a paid plan?". Anything * above free counts, so new paid tiers added to `PLAN_LIMITS` are picked up * automatically. */ declare function isPaidPlan(products: ReadonlyArray): boolean; //#endregion export { BASE_PLAN_IDS_BY_TIER, ITEM_IDS, ItemId, PLAN_LIMITS, PlanId, PlanProductOfferings, UNLIMITED, isPaidPlan, resolvePlanId }; //# sourceMappingURL=plans.d.ts.map