/** * License types for React Buoy * * Simplified: No device/machine management - we trust our customers. */ export interface LicenseValidationResult { valid: boolean; code: "VALID" | "NOT_FOUND" | "SUSPENDED" | "EXPIRED" | "OVERDUE" | "NO_MACHINE" | "NO_MACHINES" | "TOO_MANY_MACHINES" | "TOO_MANY_CORES" | "TOO_MANY_PROCESSES" | "FINGERPRINT_SCOPE_MISMATCH" | "HEARTBEAT_NOT_STARTED" | "HEARTBEAT_DEAD" | "PRODUCT_SCOPE_REQUIRED" | "PRODUCT_SCOPE_MISMATCH" | "POLICY_SCOPE_REQUIRED" | "POLICY_SCOPE_MISMATCH" | "MACHINE_SCOPE_REQUIRED" | "MACHINE_SCOPE_MISMATCH" | "ENTITLEMENTS_MISSING" | "ENTITLEMENTS_SCOPE_MISMATCH" | "BANNED"; detail: string; metadata?: Record; } export interface KeygenLicense { id: string; type: "licenses"; attributes: { name: string | null; key: string; expiry: string | null; status: "ACTIVE" | "INACTIVE" | "EXPIRED" | "SUSPENDED" | "BANNED"; uses: number; suspended: boolean; scheme: string | null; encrypted: boolean; floating: boolean; strict: boolean; maxMachines: number | null; maxProcesses: number | null; maxUsers: number | null; maxCores: number | null; maxUses: number | null; requireHeartbeat: boolean; requireCheckIn: boolean; lastValidated: string | null; lastCheckIn: string | null; nextCheckIn: string | null; metadata: Record; created: string; updated: string; }; relationships: { account: { data: { type: "accounts"; id: string; }; }; product: { data: { type: "products"; id: string; }; }; policy: { data: { type: "policies"; id: string; }; }; user?: { data: { type: "users"; id: string; } | null; }; machines?: { data?: Array<{ type: "machines"; id: string; }>; meta?: { count: number; cores?: number; memory?: number; disk?: number; }; links?: { related: string; }; }; entitlements?: { data: Array<{ type: "entitlements"; id: string; }>; }; }; } export interface KeygenValidationResponse { /** * License data - CAN BE NULL when license is invalid (e.g., NOT_FOUND) * Always check this before accessing .attributes */ data: KeygenLicense | null; meta: { ts: string; valid: boolean; detail: string; code: LicenseValidationResult["code"]; }; } export interface KeygenMachine { id: string; type: "machines"; attributes: { fingerprint: string; name: string | null; ip: string | null; hostname: string | null; platform: string | null; cores: number | null; created: string; updated: string; metadata: Record; }; } export interface KeygenMachineResponse { data: KeygenMachine; } export interface KeygenErrorResponse { errors: Array<{ title: string; detail: string; code: string; source?: { pointer?: string; parameter?: string; }; }>; } export interface CachedLicense { licenseKey: string; licenseId: string; valid: boolean; isPro: boolean; expiresAt: string | null; cachedAt: number; lastValidatedAt: number; /** Device fingerprint (generated UUID) */ fingerprint?: string; /** Device name */ deviceName?: string; } export interface LicenseState { isInitialized: boolean; isValidating: boolean; isPro: boolean; licenseKey: string | null; error: string | null; expiresAt: Date | null; } export type LicenseEventType = "initialized" | "validating" | "validated" | "error" | "deactivated"; export interface LicenseEvent { type: LicenseEventType; isPro: boolean; error?: string; } export type LicenseListener = (event: LicenseEvent) => void; //# sourceMappingURL=types.d.ts.map