cybersentinel-cli 1.0.0 → 1.0.2
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/index.js +40 -11
- package/package.json +1 -1
package/bin/index.js
CHANGED
|
@@ -44,16 +44,35 @@ function decryptResponse(data) {
|
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
|
|
47
|
-
const VIPER_BANNER = `
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
$
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
$
|
|
56
|
-
|
|
47
|
+
const VIPER_BANNER = chalk.green(`
|
|
48
|
+
.o@*hu
|
|
49
|
+
.. ......... .u*" ^Rc
|
|
50
|
+
oP""*Lo*#"""""""""""7d" .d*N. $
|
|
51
|
+
@ u@"" .u*" o*" #L ?b
|
|
52
|
+
@ " " .d" .d@@e$ ?b.
|
|
53
|
+
8 @*@me@# '"Nu
|
|
54
|
+
@ '#b
|
|
55
|
+
.P $r
|
|
56
|
+
.@" $L $
|
|
57
|
+
.@" 8"R dP
|
|
58
|
+
.d#" .dP d" .d#
|
|
59
|
+
xP .e .ud#" dE.o@"(
|
|
60
|
+
$ s*" .u@*"" '""\\dP"
|
|
61
|
+
?L .. ..o@"" .$ uP
|
|
62
|
+
#c:$"*u. .u@*""$ uR .@"
|
|
63
|
+
?L$. '"""***Nc x@"" @" d" JP
|
|
64
|
+
^#$. #L .$ 8" d" d"
|
|
65
|
+
' "b.'$. @" $" 8"
|
|
66
|
+
'"*@$L $" $ @
|
|
67
|
+
@L $" d" 8\\
|
|
68
|
+
$$u.u$" dF dF
|
|
69
|
+
$ """ o dP xR
|
|
70
|
+
$ dFNu...@" $
|
|
71
|
+
"N.. ?B ^""" :R
|
|
72
|
+
""""* RL d>
|
|
73
|
+
"$u. .$
|
|
74
|
+
^"*bo@" tony
|
|
75
|
+
`) + "\n" + chalk.green.bold(' CYBERSENTINEL - Audit Platform CLI\n');
|
|
57
76
|
|
|
58
77
|
const SNAKE_SPINNER = {
|
|
59
78
|
interval: 100,
|
|
@@ -237,7 +256,17 @@ program
|
|
|
237
256
|
} catch (error) {
|
|
238
257
|
spinner.fail(chalk.red('Registration failed!'));
|
|
239
258
|
if (error.response) {
|
|
240
|
-
|
|
259
|
+
let msg = '';
|
|
260
|
+
if (typeof error.response.data === 'string') {
|
|
261
|
+
if (error.response.data.includes('The plain HTTP request was sent to HTTPS port')) {
|
|
262
|
+
msg = 'Plain HTTP request was sent to an HTTPS port. Please use "https://" instead of "http://".';
|
|
263
|
+
} else {
|
|
264
|
+
msg = error.response.data.substring(0, 150);
|
|
265
|
+
}
|
|
266
|
+
} else {
|
|
267
|
+
msg = error.response.data.message || error.response.data.error || JSON.stringify(error.response.data);
|
|
268
|
+
}
|
|
269
|
+
console.error(chalk.red(`Error: ${error.response.status} - ${msg}`));
|
|
241
270
|
} else {
|
|
242
271
|
console.error(chalk.red(`Error: ${error.message}`));
|
|
243
272
|
}
|