/** * RevForge per-customer license issuance. * * The Stripe webhook handler (apps/server/src/routes/webhooks.ts) issues licenses * for SaaS subscribers. This module is the analogous issuer for self-hosted * RevForge customers — paid direct (source-license / sales) and stamped via * forge/stamp.sh. * * Pure function: takes options + Ed25519 keys, returns a signed JWT plus * descriptive metadata. The CLI wrapper (scripts/setup/issue-revforge-license.ts) * handles argv parsing and reading keys from the environment. */ import { type LicensePayload } from './license.js'; export declare const SLUG_PATTERN: RegExp; export declare const VALID_REVFORGE_TIERS: readonly ["pro", "max", "enterprise"]; export type RevForgeTier = (typeof VALID_REVFORGE_TIERS)[number]; export interface IssueRevForgeLicenseOptions { /** Customer slug; becomes the JWT customerId. Must match SLUG_PATTERN. */ slug: string; /** Paid tier the license unlocks. */ tier: RevForgeTier; /** JWT expiry in days. Omit for the 365-day default. Mutually exclusive with `perpetual`. */ expiresInDays?: number; /** One-time purchase: omit `exp` claim entirely. Mutually exclusive with `expiresInDays`. */ perpetual?: boolean; /** Override per-tier site cap. */ maxSites?: number; /** Override per-tier user cap. */ maxUsers?: number; /** Allowed deployment hostnames. */ domains?: string[]; } export interface IssueRevForgeLicenseResult { /** Signed EdDSA JWT — the license key the customer installs. */ licenseKey: string; /** Customer identifier embedded in the JWT (the slug). */ customerId: string; /** Tier embedded in the JWT. */ tier: RevForgeTier; /** Whether this is a perpetual license (no exp claim). */ perpetual: boolean; /** ISO-8601 timestamp of issuance. */ issuedAt: string; /** ISO-8601 expiry, or null for perpetual licenses. */ expiresAt: string | null; /** The payload that was signed (without iat/exp/jti; those live inside the JWT). */ payload: Omit; } /** * Issue a signed RevForge license JWT for a paying customer. * * @throws Error on invalid slug, invalid tier, mutually-exclusive flag combos, * non-positive numeric overrides, or a private/public pair that is not a * matching Ed25519 keypair. The error message names the offending field (or, for * the keypair case, carries the `REVFORGE_LICENSE_KEYPAIR_MISMATCH` prefix) so * callers can surface it directly to the operator. */ export declare function issueRevForgeLicense(opts: IssueRevForgeLicenseOptions, keys: { privateKey: string; publicKey: string; }): Promise; //# sourceMappingURL=revforge-license.d.ts.map