prisma-zod-generator
Version:
Prisma 2+ generator to emit Zod schemas from your Prisma schema
60 lines ⢠2.71 kB
JavaScript
;
/**
* 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