@gnpdev/rpa-tools 1.0.20 → 1.1.1
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/package.json +1 -1
- package/src/credentials.js +2 -2
- package/src/index.d.ts +16 -1
package/package.json
CHANGED
package/src/credentials.js
CHANGED
|
@@ -17,11 +17,11 @@ class CredentialManager {
|
|
|
17
17
|
/**
|
|
18
18
|
* Obtiene las credenciales de una aplicación.
|
|
19
19
|
* @param {string} nombre - Nombre de la aplicación
|
|
20
|
-
* @returns {Promise<{usuario: string, password: string, idUsuario: string}|null>}
|
|
20
|
+
* @returns {Promise<{nombre: string, usuario: string, password: string, idUsuario: string, status: boolean}|null>}
|
|
21
21
|
*/
|
|
22
22
|
async getAppCredentials(nombre) {
|
|
23
23
|
const { rows } = await this.pool.query(
|
|
24
|
-
`SELECT usuario, password, "idUsuario"
|
|
24
|
+
`SELECT nombre, usuario, password, "idUsuario", status
|
|
25
25
|
FROM bots.tb_aplicaciones_bots
|
|
26
26
|
WHERE nombre = $1 AND bot_id = $2
|
|
27
27
|
LIMIT 1`,
|
package/src/index.d.ts
CHANGED
|
@@ -72,7 +72,15 @@ export interface RpaTools {
|
|
|
72
72
|
* Recupera credenciales de una aplicación desde la base de datos.
|
|
73
73
|
* @param nombre - Nombre de la aplicación (ej. 'Portal CRM')
|
|
74
74
|
*/
|
|
75
|
-
getCredentials: (nombre: string) => Promise<{ usuario: string; password: string; idUsuario: string } | null>;
|
|
75
|
+
getCredentials: (nombre: string) => Promise<{ nombre: string; usuario: string; password: string; idUsuario: string; status: boolean } | null>;
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Actualiza el estado y las observaciones de una aplicación.
|
|
79
|
+
* @param nombre - Nombre de la aplicación (ej. 'Portal CRM')
|
|
80
|
+
* @param status - Estado (true/false)
|
|
81
|
+
* @param observations - Observaciones/Errores
|
|
82
|
+
*/
|
|
83
|
+
updateAppStatus: (nombre: string, status: boolean, observations: string) => Promise<boolean>;
|
|
76
84
|
|
|
77
85
|
/**
|
|
78
86
|
* Consulta si el bot está activo en la base de datos (columna 'estado').
|
|
@@ -80,6 +88,13 @@ export interface RpaTools {
|
|
|
80
88
|
*/
|
|
81
89
|
isActive: () => Promise<boolean>;
|
|
82
90
|
|
|
91
|
+
/**
|
|
92
|
+
* Captura el estado de la página actual y lo sube a MinIO.
|
|
93
|
+
* @param page - Instancia de Page (Playwright o Puppeteer)
|
|
94
|
+
* @param nombre - Nombre del elemento/captura
|
|
95
|
+
*/
|
|
96
|
+
capturePage: (page: any, nombre: string) => Promise<string | null>;
|
|
97
|
+
|
|
83
98
|
/**
|
|
84
99
|
* Captura screenshot, trace y registra error en base de datos.
|
|
85
100
|
*/
|