donbot-cli 1.0.6 → 1.0.7
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/cli/access.js +5 -2
- package/donbot.js +4 -4
- package/package.json +1 -1
package/cli/access.js
CHANGED
|
@@ -69,7 +69,7 @@ const registry = async (mail, first_name, last_name, password, options) => {
|
|
|
69
69
|
|
|
70
70
|
};
|
|
71
71
|
|
|
72
|
-
const createKey = async (user, description, expiration, options) => {
|
|
72
|
+
const createKey = async (user, app, description, expiration, options) => {
|
|
73
73
|
|
|
74
74
|
console.log(`
|
|
75
75
|
_____ _______ __ _ ______ _______ _______
|
|
@@ -85,7 +85,7 @@ const createKey = async (user, description, expiration, options) => {
|
|
|
85
85
|
|
|
86
86
|
console.log("Crear llave...");
|
|
87
87
|
|
|
88
|
-
if (!user || !description || !expiration) {
|
|
88
|
+
if (!user || !app || !description || !expiration) {
|
|
89
89
|
console.error('❌ Verifique que los siguientes valores estén definidos: mail, first_name, last_name, password.');
|
|
90
90
|
process.exit(1);
|
|
91
91
|
}
|
|
@@ -105,6 +105,7 @@ const createKey = async (user, description, expiration, options) => {
|
|
|
105
105
|
|
|
106
106
|
const payload = {
|
|
107
107
|
user: user,
|
|
108
|
+
app: app,
|
|
108
109
|
creationDate: today,
|
|
109
110
|
expiresIn: expiration
|
|
110
111
|
};
|
|
@@ -125,6 +126,7 @@ const createKey = async (user, description, expiration, options) => {
|
|
|
125
126
|
|
|
126
127
|
let keydata = {
|
|
127
128
|
user: user,
|
|
129
|
+
app: app,
|
|
128
130
|
description: description,
|
|
129
131
|
key: access_token,
|
|
130
132
|
creationDate: today,
|
|
@@ -141,6 +143,7 @@ const createKey = async (user, description, expiration, options) => {
|
|
|
141
143
|
|
|
142
144
|
let keyreso = {
|
|
143
145
|
user: keydata.user,
|
|
146
|
+
app: app,
|
|
144
147
|
description: keydata.description,
|
|
145
148
|
key: keydata.key
|
|
146
149
|
};
|
package/donbot.js
CHANGED
|
@@ -11,7 +11,7 @@ const flows = require('./cli/flows');
|
|
|
11
11
|
|
|
12
12
|
//Version
|
|
13
13
|
program
|
|
14
|
-
.version("DonBot 1.0.
|
|
14
|
+
.version("DonBot 1.0.7")
|
|
15
15
|
.description( `
|
|
16
16
|
_____ _______ __ _ ______ _______ _______
|
|
17
17
|
| | | || | | || _ | | || |
|
|
@@ -35,12 +35,12 @@ program.
|
|
|
35
35
|
|
|
36
36
|
//Create app Token
|
|
37
37
|
program.
|
|
38
|
-
command("access <user> <description> <expiration>").
|
|
38
|
+
command("access <user> <app> <description> <expiration>").
|
|
39
39
|
alias("ac").
|
|
40
40
|
description("Crea un App Key, para una key sin expiracion enviar el valor noexpire en lugar del numero de dias u horas (2 days, 10h, 7d)").
|
|
41
41
|
option("--showdbc", "Muestra la url de la conexion usada en la base.").
|
|
42
|
-
action((user, description, expiration, options) => {
|
|
43
|
-
access.createKey(user, description, expiration, options);
|
|
42
|
+
action((user, app, description, expiration, options) => {
|
|
43
|
+
access.createKey(user, app, description, expiration, options);
|
|
44
44
|
});
|
|
45
45
|
|
|
46
46
|
|