n8n
Version:
n8n Workflow Automation Tool
31 lines • 1.38 kB
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.ClearLicenseCommand = void 0;
const typedi_1 = require("typedi");
const constants_1 = require("../../constants");
const BaseCommand_1 = require("../BaseCommand");
const settings_repository_1 = require("../../databases/repositories/settings.repository");
const License_1 = require("../../License");
class ClearLicenseCommand extends BaseCommand_1.BaseCommand {
async run() {
this.logger.info('Clearing license from database.');
const license = typedi_1.Container.get(License_1.License);
await license.init();
await license.shutdown();
await typedi_1.Container.get(settings_repository_1.SettingsRepository).delete({
key: constants_1.SETTINGS_LICENSE_CERT_KEY,
});
this.logger.info('Done. Restart n8n to take effect.');
}
async catch(error) {
this.logger.error('Error updating database. See log messages for details.');
this.logger.error('\nGOT ERROR');
this.logger.info('====================================');
this.logger.error(error.message);
this.logger.error(error.stack);
}
}
exports.ClearLicenseCommand = ClearLicenseCommand;
ClearLicenseCommand.description = 'Clear license';
ClearLicenseCommand.examples = ['$ n8n clear:license'];
//# sourceMappingURL=clear.js.map
;