prisma-zod-generator
Version:
Prisma 2+ generator to emit Zod schemas from your Prisma schema
44 lines (43 loc) • 1.28 kB
TypeScript
/**
* PZG Pro License Validation
*
* Simple offline-capable license validation with local caching
* Only checks license when Pro features are actually used
*/
type PlanSlug = 'starter' | 'professional' | 'business' | 'enterprise';
export declare function describePlan(plan: PlanSlug): string;
export interface LicenseInfo {
key: string;
plan: PlanSlug;
validUntil: string;
maxSeats: number;
cached: boolean;
status?: 'active' | 'suspended' | 'expired';
valid_until?: Date;
customerId?: string;
}
/**
* Main license validation function
* Returns license info if valid, null if invalid, throws if required but missing
*/
export declare function validateLicense(required?: boolean): Promise<LicenseInfo | null>;
/**
* Check if a specific plan feature is available
*/
export declare function hasFeature(license: LicenseInfo | null, feature: string): boolean;
/**
* Require a specific feature, throw if not available
*/
export declare function requireFeature(feature: string, context?: {
userId?: string;
sessionId?: string;
}): Promise<LicenseInfo>;
/**
* Get license status for CLI commands
*/
export declare function getLicenseStatus(): Promise<{
valid: boolean;
plan?: PlanSlug;
cached?: boolean;
}>;
export {};