UNPKG

@zowe/imperative

Version:
67 lines 2.63 kB
"use strict"; /* * 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.AuthLogoutCommandBuilder = void 0; const AuthCommandBuilder_1 = require("./AuthCommandBuilder"); const messages_1 = require("../../../../messages"); const constants_1 = require("../../../../constants"); const utilities_1 = require("../../../../utilities"); /** * Used to build auth logout command definitions. * Used automatically if you allow the "auth" command group to be generated */ class AuthLogoutCommandBuilder extends AuthCommandBuilder_1.AuthCommandBuilder { /** * Gets the "action" that this command builder is building. * @return {string}: The "logout" action string */ getAction() { return constants_1.Constants.LOGOUT_ACTION; } /** * Build the full command - includes action group and object command. * @return {ICommandDefinition}: The command definition. */ buildFull() { return this.buildAuthSegmentFromConfig(); } /** * Builds only the "auth" segment from the auth config. * @return {ICommandDefinition} */ buildAuthSegmentFromConfig() { var _a, _b, _c, _d; const authType = this.mConfig.serviceName; const authCommand = { name: authType, type: "command", summary: (_a = this.mConfig.logout) === null || _a === void 0 ? void 0 : _a.summary, description: (_b = this.mConfig.logout) === null || _b === void 0 ? void 0 : _b.description, handler: this.mConfig.handler, options: (_c = this.mConfig.logout) === null || _c === void 0 ? void 0 : _c.options, examples: (_d = this.mConfig.logout) === null || _d === void 0 ? void 0 : _d.examples, profile: { optional: [this.mProfileType] }, customize: {} }; if (authCommand.summary == null) { authCommand.summary = utilities_1.TextUtils.formatMessage(messages_1.authLogoutCommandDesc.message, { type: authType }); } if (authCommand.description == null) { authCommand.description = authCommand.summary; } return authCommand; } } exports.AuthLogoutCommandBuilder = AuthLogoutCommandBuilder; //# sourceMappingURL=AuthLogoutCommandBuilder.js.map