import type { PlanPeriod, PlanType } from '../../utils/plan'; /** One of the six agents, as the catalog describes it. */ export interface ICatalogAgent { key: string; name: string; blurb: string; /** Limit rows this agent unlocks when bought on its own (Starter). */ limits: string[]; /** The subset of `limits` a bundled plan's card lists for this agent. */ card_limits: string[]; } /** Filled dots (out of 10) on a plan card: every agent row, and the Audit and Plan row. */ export interface ICatalogIntensity { agents: number; audit: number; } /** * One recurring price. `amount` is what Stripe charges per billing period in * USD, so a yearly price carries the whole year and `monthly_equivalent` is * the per-month figure to show. */ export interface ICatalogPrice { lookup_key: string; price_id: string | null; amount: number; monthly_equivalent: number; /** Charged per unit (agent) rather than once. */ per_unit?: boolean; } /** A price for a fixed number of units: the Starter "all six agents" deal. */ export interface ICatalogBundle extends ICatalogPrice { units: number; period: PlanPeriod; credits: number; } /** How a per-unit plan is sold. */ export interface ICatalogUnit { name: string; min: number; max: number; /** Monthly credits granted per unit. */ credits: number; } /** One plan in the catalog. `FREE` is a code here even though the API has no such plan value. */ export interface ICatalogPlan { code: PlanType; name: string; blurb: string; /** Headline of the "a month on this plan" panel. */ summary: string; order: number; /** Monthly credits (per unit on a per-unit plan, see `unit`). */ credits: number; popular?: boolean; contact_sales?: boolean; trial_days: number; unit?: ICatalogUnit; prices: Partial>; bundle?: ICatalogBundle; highlights: string[]; /** What a limit row tops out at; `null` is unlimited, `true` is included, a missing key is not on the plan. */ limits: Record; intensity: ICatalogIntensity; } /** The signup launch offer: a fixed monthly price per plan for the first `months` cycles. */ export interface ICatalogLaunchDiscount { months: number; monthly: Partial>; /** The list price (USD a month) the offer reverts to, per plan: the original one, not the catalog's. */ list_monthly: Partial>; } /** What `GET /v2/plans` answers. */ export interface IPlansCatalog { plans: ICatalogPlan[]; agents: ICatalogAgent[]; /** Limit row keys in the order to list them. */ limit_rows: string[]; /** Rows that name a fixed number rather than a ceiling. */ fixed_limit_rows: string[]; /** The platform rows of the compare table, in order; not tied to an agent. */ platform_rows: string[]; /** Human label per limit row key. */ limit_labels: Record; launch_discount: ICatalogLaunchDiscount; }