superjolt
Version:
AI-powered deployment platform with MCP support - Deploy JavaScript apps using natural language with Claude Desktop
110 lines • 5.68 kB
JavaScript
"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.DomainStatusCommand = void 0;
const nest_commander_1 = require("nest-commander");
const api_service_1 = require("../services/api.service");
const auth_service_1 = require("../services/auth.service");
const logger_service_1 = require("../services/logger.service");
const common_1 = require("@nestjs/common");
const authenticated_command_1 = require("./authenticated.command");
const chalk_1 = __importDefault(require("chalk"));
let DomainStatusCommand = class DomainStatusCommand extends authenticated_command_1.AuthenticatedCommand {
apiService;
authService;
logger;
constructor(apiService, authService, logger) {
super();
this.apiService = apiService;
this.authService = authService;
this.logger = logger;
}
async execute(passedParams) {
try {
const domain = passedParams[0];
if (!domain) {
this.logger.error('Error: Domain is required');
this.logger.log('Usage: superjolt domain:status <domain>');
this.logger.log('Example: superjolt domain:status app.example.com');
process.exit(1);
}
this.logger.log(chalk_1.default.dim(`Checking status for domain ${domain}...`));
const status = await this.apiService.getCustomDomainStatus(domain);
this.logger.log('');
this.logger.log(chalk_1.default.cyan('Domain Status:'));
this.logger.log(`Domain: ${chalk_1.default.bold(status.domain)}`);
this.logger.log(`Status: ${this.formatStatus(status.status)}`);
this.logger.log(`SSL Status: ${this.formatStatus(status.sslStatus)}`);
this.logger.log(`Validation Method: ${status.validationMethod}`);
if (status.isPrimary) {
this.logger.log(`Primary: ${chalk_1.default.green('Yes')}`);
}
if (status.validationTarget && status.status === 'pending_validation') {
this.logger.log('');
this.logger.log(chalk_1.default.yellow('⚠️ Domain validation required:'));
this.logger.log(`Validation URL: ${chalk_1.default.cyan(status.validationTarget)}`);
this.logger.log('');
this.logger.log(chalk_1.default.dim('The domain will be automatically validated once DNS propagates.'));
this.logger.log(chalk_1.default.dim('This usually takes a few minutes.'));
}
if (status.status === 'active' && status.sslStatus === 'active') {
this.logger.log('');
this.logger.log(chalk_1.default.green('✅ Domain is active and SSL certificate is ready!'));
this.logger.log(chalk_1.default.dim(`Your service is accessible at: ${chalk_1.default.cyan(`https://${status.domain}`)}`));
}
else if (status.status === 'active' &&
status.sslStatus === 'pending_validation') {
this.logger.log('');
this.logger.log(chalk_1.default.yellow('⚠️ Domain is active but SSL certificate is still being provisioned.'));
this.logger.log(chalk_1.default.dim('This usually completes within a few minutes.'));
}
else if (status.status === 'failed') {
this.logger.log('');
this.logger.log(chalk_1.default.red('❌ Domain validation failed.'));
this.logger.log(chalk_1.default.dim('Please check your DNS settings and try again.'));
}
}
catch (error) {
this.logger.error(`\n${error.message}`);
process.exit(1);
}
}
formatStatus(status) {
switch (status) {
case 'active':
return chalk_1.default.green('● Active');
case 'pending_validation':
return chalk_1.default.yellow('● Pending Validation');
case 'failed':
return chalk_1.default.red('● Failed');
case 'expired':
return chalk_1.default.red('● Expired');
default:
return chalk_1.default.gray(`● ${status}`);
}
}
};
exports.DomainStatusCommand = DomainStatusCommand;
exports.DomainStatusCommand = DomainStatusCommand = __decorate([
(0, common_1.Injectable)(),
(0, nest_commander_1.Command)({
name: 'domain:status',
arguments: '<domain>',
description: 'Check the status of a custom domain',
}),
__metadata("design:paramtypes", [api_service_1.ApiService,
auth_service_1.AuthService,
logger_service_1.LoggerService])
], DomainStatusCommand);
//# sourceMappingURL=domain-status.command.js.map