projex
Version:
A command line to manage the workflow
39 lines (38 loc) • 1.64 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const _api_1 = require("../../api/index");
const _modules_1 = require("../../modules/index");
const core_1 = require("@oclif/core");
const _shared_1 = require("../../shared/index");
class Login extends core_1.Command {
static description = `Command to log in to VTEX. This command uses the API key and API token to obtain the authentication token and save it in the VTEX config file, allowing the process to use the VTEX CLI.`;
static examples = [
`${_api_1.Colors.PINK(`${_shared_1.CLI_NAME} vtex login [YourAccount] [YourEmail] [YourWorkspace] [YourApiKey] [YourApiToken]`)}`,
];
static args = {
account: core_1.Args.string({
description: `Specify the account to set in the config file.`,
}),
email: core_1.Args.string({
description: `Specify the user email to set in the config file.`,
}),
workspace: core_1.Args.string({
description: `Specify the workspace to use in the process.`,
}),
apiKey: core_1.Args.string({
description: `Specify your API key to use in the process.`,
}),
apiToken: core_1.Args.string({
description: `Specify your API token to use in the process.`,
}),
};
static flags = {
..._shared_1.globalFlags,
};
async run() {
const { args } = await this.parse(Login);
const { account, email, workspace, apiKey, apiToken } = args;
await (0, _modules_1.login)(account, email, workspace, apiKey, apiToken);
}
}
exports.default = Login;