raqeb-cli 1.3.2 → 1.3.4
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/bin/raqeb.js +1 -1
- package/lib/interactive.js +44 -25
- package/package.json +1 -1
package/bin/raqeb.js
CHANGED
|
@@ -360,7 +360,7 @@ Installation:
|
|
|
360
360
|
program
|
|
361
361
|
.name('raqeb')
|
|
362
362
|
.description('Raqeb CLI - Database PAM and Secrets Management')
|
|
363
|
-
.version('1.3.
|
|
363
|
+
.version('1.3.4')
|
|
364
364
|
.option('-i, --interactive', 'Launch interactive mode')
|
|
365
365
|
.hook('preAction', async (thisCommand, actionCommand) => {
|
|
366
366
|
// Handle -i flag
|
package/lib/interactive.js
CHANGED
|
@@ -32,7 +32,12 @@ class InteractiveShell {
|
|
|
32
32
|
const response = await this.client.get('/auth/me');
|
|
33
33
|
this.userInfo = response.data;
|
|
34
34
|
} catch (error) {
|
|
35
|
-
this.userInfo =
|
|
35
|
+
this.userInfo = {
|
|
36
|
+
email: 'Not logged in',
|
|
37
|
+
tenant_name: 'Unknown',
|
|
38
|
+
tenant_id: 'Unknown',
|
|
39
|
+
role: 'user'
|
|
40
|
+
};
|
|
36
41
|
}
|
|
37
42
|
}
|
|
38
43
|
|
|
@@ -84,29 +89,29 @@ class InteractiveShell {
|
|
|
84
89
|
showWelcome() {
|
|
85
90
|
console.clear();
|
|
86
91
|
|
|
87
|
-
// Raqeb ASCII Logo with
|
|
88
|
-
const blue = chalk.hex('#
|
|
89
|
-
const green = chalk.hex('#
|
|
90
|
-
const cyan = chalk.hex('#
|
|
92
|
+
// Raqeb ASCII Logo - User's custom design with colors
|
|
93
|
+
const blue = chalk.hex('#0066cc');
|
|
94
|
+
const green = chalk.hex('#00cc99');
|
|
95
|
+
const cyan = chalk.hex('#00ccaa');
|
|
91
96
|
|
|
92
97
|
console.log('');
|
|
93
|
-
console.log(blue('
|
|
94
|
-
console.log(blue('
|
|
95
|
-
console.log(blue('
|
|
96
|
-
console.log(blue('
|
|
97
|
-
console.log(blue('
|
|
98
|
-
console.log(blue('
|
|
99
|
-
console.log(blue('
|
|
100
|
-
console.log(blue('
|
|
101
|
-
console.log(blue('
|
|
102
|
-
console.log(blue('
|
|
103
|
-
console.log(blue('
|
|
104
|
-
console.log(blue('
|
|
105
|
-
console.log(blue('
|
|
106
|
-
console.log(blue('
|
|
107
|
-
console.log(blue('
|
|
108
|
-
console.log(blue('
|
|
109
|
-
console.log(blue('
|
|
98
|
+
console.log(' ' + blue('●'));
|
|
99
|
+
console.log(' ' + blue('╱ ╲'));
|
|
100
|
+
console.log(' ' + blue('╱ ╲'));
|
|
101
|
+
console.log(' ' + blue('╭──○') + ' ' + blue('○──╮'));
|
|
102
|
+
console.log(' ' + blue('╱') + ' ' + green('╱') + cyan(' ● ') + green('╲') + ' ' + blue('╲'));
|
|
103
|
+
console.log(' ' + blue('╱') + ' ' + green('╱') + cyan(' ╱ ╲ ') + green('╲') + ' ' + blue('╲'));
|
|
104
|
+
console.log(' ' + blue('╱') + ' ' + green('╱') + cyan(' ╱ ╲ ') + green('╲') + ' ' + blue('╲'));
|
|
105
|
+
console.log(' ' + blue('│') + ' ' + green('│') + cyan(' │ │ ') + green('│') + ' ' + blue('│'));
|
|
106
|
+
console.log(' ' + blue('│') + ' ' + chalk.bold.white('RAQEB') + ' ' + cyan('│ ● │') + ' ' + blue('│'));
|
|
107
|
+
console.log(' ' + blue('│') + ' ' + green('│') + cyan(' │ │ ') + green('│') + ' ' + blue('│'));
|
|
108
|
+
console.log(' ' + blue('╲') + ' ' + green('╲') + cyan(' ╲ ╱ ') + green('╱') + ' ' + blue('╱'));
|
|
109
|
+
console.log(' ' + blue('╲') + ' ' + green('╲') + cyan(' ╲ ╱ ') + green('╱') + ' ' + blue('╱'));
|
|
110
|
+
console.log(' ' + blue('╲') + ' ' + green('╲') + cyan(' ● ') + green('╱') + ' ' + blue('╱'));
|
|
111
|
+
console.log(' ' + blue('╰──○') + ' ' + blue('○──╯'));
|
|
112
|
+
console.log(' ' + blue('╲ ╱'));
|
|
113
|
+
console.log(' ' + blue('╲ ╱'));
|
|
114
|
+
console.log(' ' + blue('●'));
|
|
110
115
|
console.log('');
|
|
111
116
|
|
|
112
117
|
// Header box with user info
|
|
@@ -115,7 +120,7 @@ class InteractiveShell {
|
|
|
115
120
|
const userRole = this.userInfo?.role || 'user';
|
|
116
121
|
|
|
117
122
|
console.log(blue('╔════════════════════════════════════════════════════════════════════════════╗'));
|
|
118
|
-
console.log(blue('║') + chalk.bold.white(' 🌐 Raqeb CLI - Interactive Mode v1.3.
|
|
123
|
+
console.log(blue('║') + chalk.bold.white(' 🌐 Raqeb CLI - Interactive Mode v1.3.4 ') + blue('║'));
|
|
119
124
|
console.log(blue('╠════════════════════════════════════════════════════════════════════════════╣'));
|
|
120
125
|
console.log(blue('║ ') + chalk.gray('User: ') + green(userEmail.padEnd(64)) + blue(' ║'));
|
|
121
126
|
console.log(blue('║ ') + chalk.gray('Tenant: ') + green(tenantName.padEnd(64)) + blue(' ║'));
|
|
@@ -172,8 +177,22 @@ class InteractiveShell {
|
|
|
172
177
|
pageSize: 10
|
|
173
178
|
}]);
|
|
174
179
|
|
|
175
|
-
|
|
176
|
-
|
|
180
|
+
// Show the submenu for the selected command
|
|
181
|
+
if (answer.command === '/db') {
|
|
182
|
+
await this.handleDatabase('/db');
|
|
183
|
+
} else if (answer.command === '/secrets') {
|
|
184
|
+
await this.handleSecrets('/secrets');
|
|
185
|
+
} else if (answer.command === '/keys') {
|
|
186
|
+
await this.handleKeys('/keys');
|
|
187
|
+
} else if (answer.command === '/audit') {
|
|
188
|
+
await this.handleAudit('/audit');
|
|
189
|
+
} else if (answer.command === '/help') {
|
|
190
|
+
this.showHelp();
|
|
191
|
+
} else if (answer.command === '/clear') {
|
|
192
|
+
console.clear();
|
|
193
|
+
this.showWelcome();
|
|
194
|
+
} else if (answer.command === '/exit') {
|
|
195
|
+
this.rl.close();
|
|
177
196
|
}
|
|
178
197
|
}
|
|
179
198
|
|