UNPKG

@zendesk/zcli

Version:

Zendesk CLI is a single command line tool for all your zendesk needs

30 lines (29 loc) 1.02 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const core_1 = require("@oclif/core"); const chalk = require("chalk"); const zcli_core_1 = require("@zendesk/zcli-core"); class Logout extends core_1.Command { async run() { const secureStore = new zcli_core_1.SecureStore(); const keytar = await secureStore.loadKeytar(); if (!keytar) { console.log(chalk.yellow('Secure credentials store not found.')); return; } const auth = new zcli_core_1.Auth({ secureStore }); const success = await auth.logout(); if (success) { console.log(chalk.green('Successfully logged out.')); } } } exports.default = Logout; Logout.description = 'removes an authentication token for an active profile'; Logout.flags = { help: core_1.Flags.help({ char: 'h' }), subdomain: core_1.Flags.string({ char: 's', default: '', description: 'Zendesk Subdomain' }) }; Logout.examples = [ '$ zcli logout' ];