UNPKG

prisma-zod-generator

Version:

Prisma 2+ generator to emit Zod schemas from your Prisma schema

60 lines • 2.71 kB
#!/usr/bin/env node "use strict"; /** * PZG Pro License Status CLI * Usage: npx prisma-zod-generator license-check */ Object.defineProperty(exports, "__esModule", { value: true }); exports.runLicenseCheck = runLicenseCheck; const license_1 = require("../license"); async function runLicenseCheck(_args = []) { var _a, _b; console.log('šŸ” Checking PZG Pro license...\n'); const status = await (0, license_1.getLicenseStatus)(); if (!status.valid) { console.log('āŒ No valid license found'); console.log('\nTo get started with PZG Pro:'); console.log('1. Get your license: https://omar-dulaimi.github.io/prisma-zod-generator/pricing'); console.log('2. Set environment variable: export PZG_LICENSE_KEY=your_key_here'); console.log('3. Run this command again to verify'); process.exit(1); } console.log('āœ… Valid PZG Pro license found'); let licenseDetails = null; try { licenseDetails = await (0, license_1.validateLicense)(false); } catch { // ignore, fallback to status info } const plan = (_a = licenseDetails === null || licenseDetails === void 0 ? void 0 : licenseDetails.plan) !== null && _a !== void 0 ? _a : status.plan; if (plan) { console.log(`šŸ“‹ Plan: ${(0, license_1.describePlan)(plan)} (${plan})`); } if ((licenseDetails === null || licenseDetails === void 0 ? void 0 : licenseDetails.maxSeats) !== undefined) { console.log(`šŸ‘„ Max Seats: ${licenseDetails.maxSeats}`); } if (licenseDetails === null || licenseDetails === void 0 ? void 0 : licenseDetails.customerId) { console.log(`šŸ†” Customer ID: ${licenseDetails.customerId}`); } if (licenseDetails === null || licenseDetails === void 0 ? void 0 : licenseDetails.validUntil) { console.log(`šŸ“… Valid Until: ${licenseDetails.validUntil}`); } const cachedFlag = (_b = licenseDetails === null || licenseDetails === void 0 ? void 0 : licenseDetails.cached) !== null && _b !== void 0 ? _b : status.cached; if (cachedFlag) { console.log('šŸ’¾ Using cached license (verified within 30 days)'); } else { console.log('🌐 License verified with server'); } console.log('\nšŸš€ Ready to use PZG Pro features!'); console.log('šŸ“š Docs: https://omar-dulaimi.github.io/prisma-zod-generator/docs'); console.log('šŸ’¬ Support: https://github.com/omar-dulaimi/prisma-zod-generator/issues'); } if (require.main === module) { runLicenseCheck().catch((error) => { console.error('āŒ Error:', error instanceof Error ? error.message : error); process.exit(1); }); } //# sourceMappingURL=license-check.js.map