genbox 1.0.137 → 1.0.139
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commands/logout.js +26 -0
- package/dist/config-store.js +5 -0
- package/dist/index.js +3 -0
- package/package.json +1 -1
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.logoutCommand = void 0;
|
|
7
|
+
const commander_1 = require("commander");
|
|
8
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
9
|
+
const config_store_1 = require("../config-store");
|
|
10
|
+
exports.logoutCommand = new commander_1.Command('logout')
|
|
11
|
+
.description('Log out from Genbox')
|
|
12
|
+
.action(async () => {
|
|
13
|
+
const config = config_store_1.ConfigStore.load();
|
|
14
|
+
if (!config.auth?.token) {
|
|
15
|
+
console.log(chalk_1.default.yellow('Not logged in.'));
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
const email = config.auth.user?.email;
|
|
19
|
+
config_store_1.ConfigStore.clear();
|
|
20
|
+
if (email) {
|
|
21
|
+
console.log(chalk_1.default.green(`✓ Logged out from ${email}`));
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
console.log(chalk_1.default.green('✓ Logged out successfully'));
|
|
25
|
+
}
|
|
26
|
+
});
|
package/dist/config-store.js
CHANGED
package/dist/index.js
CHANGED
|
@@ -46,6 +46,7 @@ const destroy_1 = require("./commands/destroy");
|
|
|
46
46
|
const connect_1 = require("./commands/connect");
|
|
47
47
|
const balance_1 = require("./commands/balance");
|
|
48
48
|
const login_1 = require("./commands/login");
|
|
49
|
+
const logout_1 = require("./commands/logout");
|
|
49
50
|
const urls_1 = require("./commands/urls");
|
|
50
51
|
const push_1 = require("./commands/push");
|
|
51
52
|
const status_1 = require("./commands/status");
|
|
@@ -161,6 +162,7 @@ const commandCategories = {
|
|
|
161
162
|
],
|
|
162
163
|
'ACCOUNT': [
|
|
163
164
|
{ name: 'login', aliases: [], description: 'Authenticate with Genbox' },
|
|
165
|
+
{ name: 'logout', aliases: [], description: 'Log out from Genbox' },
|
|
164
166
|
{ name: 'balance', aliases: [], description: 'Show credit balance' },
|
|
165
167
|
],
|
|
166
168
|
'HELP': [
|
|
@@ -251,6 +253,7 @@ program
|
|
|
251
253
|
.addCommand(connect_1.connectCommand)
|
|
252
254
|
.addCommand(balance_1.balanceCommand)
|
|
253
255
|
.addCommand(login_1.loginCommand)
|
|
256
|
+
.addCommand(logout_1.logoutCommand)
|
|
254
257
|
.addCommand(urls_1.urlsCommand)
|
|
255
258
|
.addCommand(push_1.pushCommand)
|
|
256
259
|
.addCommand(status_1.statusCommand)
|