trm-client
Version:
TRM (Transport Request Manager) Client
42 lines (41 loc) • 1.93 kB
JavaScript
;
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.CommandContext = void 0;
const trm_commons_1 = require("trm-commons");
const trm_core_1 = require("trm-core");
var CommandContext;
(function (CommandContext) {
var _systemPackages = undefined;
CommandContext.registry = undefined;
CommandContext.hasRegistryAuthData = false;
CommandContext.trmDependencies = [];
CommandContext.missingTrmDependencies = [];
function getRegistry() {
if (!CommandContext.registry) {
throw new Error('Registry not initialized.');
}
else {
return CommandContext.registry;
}
}
CommandContext.getRegistry = getRegistry;
function getSystemPackages() {
return __awaiter(this, void 0, void 0, function* () {
if (!this._systemPackages) {
trm_commons_1.Logger.loading(`Reading system packages...`);
this._systemPackages = yield trm_core_1.SystemConnector.getInstalledPackages(true, true, true);
}
return this._systemPackages;
});
}
CommandContext.getSystemPackages = getSystemPackages;
})(CommandContext || (exports.CommandContext = CommandContext = {}));