@zowe/imperative
Version:
framework for building configurable CLIs
78 lines • 3.12 kB
JavaScript
/*
* This program and the accompanying materials are made available under the terms of the
* Eclipse Public License v2.0 which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-v20.html
*
* SPDX-License-Identifier: EPL-2.0
*
* Copyright Contributors to the Zowe Project.
*
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.probTests = exports.ItemId = void 0;
/**
* This enum represents the runtime environment items of interest.
* These are more than just environment variables.
* We will report on these items (and report on any detected problems)
* in the order that the items are listed below.
*/
var ItemId;
(function (ItemId) {
ItemId[ItemId["ZOWE_VER"] = 0] = "ZOWE_VER";
ItemId[ItemId["NODEJS_VER"] = 1] = "NODEJS_VER";
ItemId[ItemId["PLATFORM"] = 2] = "PLATFORM";
ItemId[ItemId["ARCHITECTURE"] = 3] = "ARCHITECTURE";
ItemId[ItemId["OS_PATH"] = 4] = "OS_PATH";
ItemId[ItemId["ZOWE_CLI_HOME"] = 5] = "ZOWE_CLI_HOME";
ItemId[ItemId["ZOWE_APP_LOG_LEVEL"] = 6] = "ZOWE_APP_LOG_LEVEL";
ItemId[ItemId["ZOWE_IMPERATIVE_LOG_LEVEL"] = 7] = "ZOWE_IMPERATIVE_LOG_LEVEL";
ItemId[ItemId["OTHER_ZOWE_VARS"] = 8] = "OTHER_ZOWE_VARS";
ItemId[ItemId["NPM_VER"] = 9] = "NPM_VER";
ItemId[ItemId["ZOWE_CONFIG_INFO"] = 10] = "ZOWE_CONFIG_INFO";
ItemId[ItemId["ZOWE_PLUGINS"] = 11] = "ZOWE_PLUGINS";
})(ItemId || (exports.ItemId = ItemId = {}));
// used in probTests below.
const logLevelExpr = "'{val}'.toUpperCase() != 'ALL' && " +
"'{val}'.toUpperCase() != 'TRACE' && " +
"'{val}'.toUpperCase() != 'DEBUG' && " +
"'{val}'.toUpperCase() != 'INFO' && " +
"'{val}'.toUpperCase() != 'WARN' && " +
"'{val}'.toUpperCase() != 'ERROR' && " +
"'{val}'.toUpperCase() != 'FATAL' && " +
"'{val}'.toUpperCase() != 'MARK' && " +
"'{val}'.toUpperCase() != 'OFF' && " +
"'{val}' != 'undefined'";
function formatLogLevelMsg(logTypeName) {
return `The ${logTypeName} must be set to one of: \n` +
" ALL, TRACE, DEBUG, INFO, WARN, ERROR, FATAL, MARK, OFF";
}
/**
* The tests to check for problems that we run for environmental items.
* One ItemId can have multiple entries in the array, to check for
* different problems. When the probExpr is true, we have a problem,
* and we print the probMsg.
*/
exports.probTests = [
{
itemId: ItemId.NODEJS_VER,
probExpr: "semver.satisfies('{val}', '<18.x || 19.x || 21.x || >=23.x')",
probMsg: "Only Node.js versions 18, 20, and 22 are supported."
},
{
itemId: ItemId.NPM_VER,
probExpr: "semver.satisfies('{val}', '8.11.0 || 8.12.0')",
probMsg: "NPM versions 8.11.0 and 8.12.0 cause SCS errors in some situations."
},
{
itemId: ItemId.ZOWE_APP_LOG_LEVEL,
probExpr: logLevelExpr,
probMsg: formatLogLevelMsg("ZOWE_APP_LOG_LEVEL")
},
{
itemId: ItemId.ZOWE_IMPERATIVE_LOG_LEVEL,
probExpr: logLevelExpr,
probMsg: formatLogLevelMsg("ZOWE_IMPERATIVE_LOG_LEVEL")
}
];
//# sourceMappingURL=EnvItems.js.map
;