minervajs-helmet 1.0.1 → 1.0.3

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/README.md CHANGED
@@ -1,2 +1,30 @@
1
1
  # MinervaJS.Helmet
2
2
  Modulo para la gestion de las conección a la base de datos, permite conectarse a varios tipos utilizando sobrecarga de metodos, tolera MySQL y Oracle Client
3
+
4
+ Ejemplo: Partiendo de un proyecto en blanco recien creado
5
+ > npm i minervajs-helmet
6
+
7
+ Archivo: index.js
8
+
9
+ var db = require('minervajs-helmet');
10
+
11
+ var l_sql = " SELECT P.id, " +
12
+ " P.titulo, " +
13
+ " P.subtitulo, " +
14
+ " DATE_FORMAT(P.publicado, '%M %d, %Y') as publicado, " +
15
+ " P.autor, " +
16
+ " P.introduccion, " +
17
+ " P.tags, " +
18
+ " P.url_imagen " +
19
+ " FROM publicacion P " +
20
+ " ORDER BY P.publicado DESC " +
21
+ " LIMIT 10 ";
22
+
23
+ db.executeSQL(l_sql, function(a_data, err)
24
+ {
25
+ if (err)
26
+ {console.log(err);}
27
+ else
28
+ {console.log(a_data);}
29
+ });
30
+
package/js/db.js CHANGED
@@ -12,7 +12,7 @@ var settings = require('../settings');
12
12
  * @function
13
13
  * @name executeSQL
14
14
  * @param {string} sql - Sentencia SQL a ejecutar
15
- * @param {callback} callback - objeto, para retornar la promesa
15
+ * @param {Promise<callback>} callback - objeto, para retornar la promesa
16
16
  * @returns {result} result/err - Devuelve un objeto con el set de datos o un objeto err con la respuesta del error
17
17
  * @description Ejecuta una sentencia SQL y devuelve un objeto en un set de datos
18
18
  */
@@ -46,7 +46,7 @@ exports.executeSQL = function (sql, callback)
46
46
  * @function
47
47
  * @name executeSQLarray
48
48
  * @param {string} sql - Sentencia SQL a ejecutar
49
- * @param {callback} callback - objeto, para retornar la promesa
49
+ * @param {Promise<callback>} callback - objeto, para retornar la promesa
50
50
  * @returns {result} result/err - Devuelve un objeto con el set de datos o un objeto err con la respuesta del error
51
51
  * @description Ejecuta una sentencia SQL, basado en una serie de argumentos y devuelve un objeto en un set de datos
52
52
  */
package/js/db_mysql.js CHANGED
@@ -1,4 +1,10 @@
1
- var mysql = require('mysql');
1
+ /**
2
+ * @module
3
+ * @name db_mysql
4
+ * @description Modulo gestor de la coneccion a la base de datos, MySQL, utiliza el cliente mysql2
5
+ *
6
+ */
7
+ var mysql = require('mysql2');
2
8
  var settings = require('../js/settings');
3
9
 
4
10
  exports.executeSQL = function (sql, callback)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "minervajs-helmet",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "main": "src/index.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"
@@ -16,16 +16,15 @@
16
16
  "license": "ISC",
17
17
  "description": "Modulo para la gestion de coneccion a la base de datos, de diferentes tipos mediante el uso de sobre Carga y Herencia de clases",
18
18
  "dependencies": {
19
- "mysql": "^2.18.1",
19
+ "mysql2": "^3.14.0",
20
20
  "oracledb": "^6.6.0"
21
21
  },
22
- "devDependencies": {},
23
22
  "repository": {
24
- "type": "git",
25
- "url": "https://github.com/Alexander-Escobar/MinervaJS.Helmet.git"
23
+ "type": "git",
24
+ "url": "https://github.com/Alexander-Escobar/MinervaJS.Helmet.git"
26
25
  },
27
26
  "bug": {
28
- "url": "https://github.com/Alexander-Escobar/MinervaJS.Helmet.git/issues"
27
+ "url": "https://github.com/Alexander-Escobar/MinervaJS.Helmet.git/issues"
29
28
  },
30
29
  "homepage": "https://github.com/Alexander-Escobar/MinervaJS.Helmet.git#readme"
31
30
  }
package/settings.js CHANGED
@@ -1,226 +1,20 @@
1
- /*
2
- Configuracion y Parametrizacion general de la Aplicacion & Sitio Web
3
-
4
- Listado:
5
- dbConfig Configuracion de la Base de Datos
6
- servConfig Configuracion del Servidor
7
- httpConfig Configuracion de las Peticiones URL del Protocolo HTTP
8
- Google Configuracion para Google Ads
9
- Image Configuracion General para las imagenes
10
- pagConfig Configuracion de la Paginacion de los Mantenimientos
11
- */
12
-
1
+ /**
2
+ * @module
3
+ * @name db
4
+ * @description Modulo gestor de la coneccion a la base de datos
5
+ * dbConfig Configuracion de la Base de Datos
6
+ */
13
7
  exports.httpMsgFormat = 'HTML';
14
8
  exports.Title = "DB Smarts Docs";
15
- exports.Rights_Reserved = "2023 &copy; A&C Consultoría Informática";
9
+ exports.Rights_Reserved = "2023-2025 &copy; A&C Consultoría Informática";
16
10
 
17
11
  exports.dbConfig =
18
12
  {
19
13
  // mysql
20
- // host: "localhost",
21
- // user: "Owlet",
22
- // password: "Password01",
14
+ // host: "localhost o IP",
15
+ user: "User",
16
+ password: "Password01",
23
17
  // database: "DBSisConta"
24
- user : "STG",
25
- password : "STG_qa2019$",
26
- connectString : "(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=bades01-scan.banco-azul.com)(PORT=3105))(CONNECT_DATA=(SERVICE_NAME=ODSQA)))"
27
- };
28
-
29
- exports.servConfig =
30
- {
31
- hostname: "", // http://localhost:9000
32
- webPort: 9000, // 80
33
- debug: true
34
- };
35
-
36
- exports.httpConfig =
37
- {
38
- cache_control: 'max-age=18000',
39
- headers: [
40
- // {type: "meta|link|script",
41
- // ** Para Type: "meta"
42
- // name: "", content: "",
43
- // http-equiv: "", charset: "",
44
-
45
- // ** Para Type: "link"
46
- // rel: "", type="text/css", href: "",
47
-
48
- // ** Para Type: "script"
49
- // src: "", type="text/javascript",
50
- //
51
- // dataPair: "",
52
- // },
53
-
54
- // <!-- meta standard -->
55
- // [0] charset="UTF-8" [standard] configuracion global de caracteres
56
- // [1] name="viewport" [standard] configuracion de bootstrap
57
- // [2] name="description" [standard] informacion
58
- // [3] name="keywords" [standard] informacion
59
- // [4] name="author" [standard] informacion
60
- // [5] name="generator" [standard] informacion
61
- // [6] http-equiv="refresh [config] Permite Recarga la pagina cada N segundos
62
-
63
- {type: "meta", dataPair: [["charset", "UTF-8"]]},
64
- {type: "meta", dataPair: [["name", "viewport"],["content", "width=device-width, initial-scale=1, shrink-to-fit=no"]]},
65
- {type: "meta", dataPair: [["name", "description"],["content","Asociación Alzheimer El Salvador"]]},
66
- {type: "meta", dataPair: [["name", "keywords"],["content","Alzheimer, salud, cuidados"]]},
67
- {type: "meta", dataPair: [["name", "author"],["content","A&C Consultoría Informática | Vuxmi.com"]]},
68
- {type: "meta", dataPair: [["name", "generator"],["content","Minerva JS V1.0.0"]]},
69
- {type: "meta", dataPair: [["http-equiv", "refresh"],["content","30"]]},
70
-
71
- // <!-- CSS -->
72
- // [7] font-awesome.css [local] V 4.7 editado
73
- // [8] animate.css [nube] V 3.6.2 https://raw.githubusercontent.com/daneden/animate.css/master/animate.css
74
- // [9] bootstrap.min.css [nube] V 4.1.2
75
- // [10] style.css [local] Hoja de Estilos, Blog
76
- // [11] singlearticle.css [local] Hoja de Estilos, Blog-Articulo
77
- // [12] flexdatalist [local] v 2.2.4 , sys
78
- // [13] dataTables [nube] V 1.10.19 , sys
79
- // [14] dataTables, buttons [nube] V 1.5.4, sys
80
- // [15] dataTables, select [nube] V 1.2.7, sys
81
- // [16] Validetta / Validaciones [local] V 1.0.1
82
-
83
- {type: "link", dataPair: [["type", "text/css"],["rel","stylesheet"],["href","/css/font-awesome.css"]]},
84
- {type: "link", dataPair: [["type", "text/css"],["rel","stylesheet"],["href","/css/animate.css"]]},
85
- {type: "link", dataPair: [["type", "text/css"],["rel","stylesheet"],["href","https://stackpath.bootstrapcdn.com/bootswatch/4.1.2/materia/bootstrap.min.css"]]},
86
- {type: "link", dataPair: [["type", "text/css"],["rel","stylesheet"],["href","/css/style.css"]]},
87
- {type: "link", dataPair: [["type", "text/css"],["rel","stylesheet"],["href","/css/singlearticle.css"]]},
88
- {type: "link", dataPair: [["type", "text/css"],["rel","stylesheet"],["href","/css/jquery.flexdatalist.min.css"]]},
89
- {type: "link", dataPair: [["type", "text/css"],["rel","stylesheet"],["href","https://cdn.datatables.net/1.10.19/css/jquery.dataTables.min.css"]]},
90
- {type: "link", dataPair: [["type", "text/css"],["rel","stylesheet"],["href","https://cdn.datatables.net/buttons/1.5.4/css/buttons.dataTables.min.css"]]},
91
- {type: "link", dataPair: [["type", "text/css"],["rel","stylesheet"],["href","https://cdn.datatables.net/select/1.2.7/css/select.dataTables.min.css"]]},
92
- {type: "link", dataPair: [["type", "text/css"],["rel","stylesheet"],["href","/css/validetta.min.css"]]},
93
- {type: "link", dataPair: [["type", "text/css"],["rel","stylesheet"],["href","/css/reservado.css"]]}, // RESERVADO
94
- {type: "link", dataPair: [["type", "text/css"],["rel","stylesheet"],["href","/css/reservado.css"]]}, // RESERVADO
95
- {type: "link", dataPair: [["type", "text/css"],["rel","stylesheet"],["href","/css/reservado.css"]]}, // RESERVADO
96
- {type: "link", dataPair: [["type", "text/css"],["rel","stylesheet"],["href","/css/reservado.css"]]}, // RESERVADO
97
- {type: "link", dataPair: [["type", "text/css"],["rel","stylesheet"],["href","/css/reservado.css"]]}, // RESERVADO
98
- {type: "link", dataPair: [["type", "text/css"],["rel","stylesheet"],["href","/css/reservado.css"]]}, // RESERVADO
99
- {type: "link", dataPair: [["type", "text/css"],["rel","stylesheet"],["href","/css/reservado.css"]]}, // RESERVADO
100
- {type: "link", dataPair: [["type", "text/css"],["rel","stylesheet"],["href","/css/reservado.css"]]}, // RESERVADO
101
- {type: "link", dataPair: [["type", "text/css"],["rel","stylesheet"],["href","/css/reservado.css"]]}, // RESERVADO
102
- {type: "link", dataPair: [["type", "text/css"],["rel","stylesheet"],["href","/css/reservado.css"]]}, // RESERVADO
103
- {type: "link", dataPair: [["type", "text/css"],["rel","stylesheet"],["href","/css/reservado.css"]]}, // RESERVADO
104
- {type: "link", dataPair: [["type", "text/css"],["rel","stylesheet"],["href","/css/reservado.css"]]}, // RESERVADO
105
- {type: "link", dataPair: [["type", "text/css"],["rel","stylesheet"],["href","/css/reservado.css"]]}, // RESERVADO
106
-
107
- // <!-- JavaScript -->
108
- // [30] jquery-3.3.1.min.js [nube] V 3.3.1
109
- // [31] popper.js [nube] V 1.14.3
110
- // [32] bootstrap.min.js [nube] V 4.1.2
111
- // [33] sweetalert.min.js Alertas [nube] V https://unpkg.com/sweetalert/dist/sweetalert.min.js
112
- // [34] sidebar [local] Barra de Menu Lateral "SideBar Menu"
113
- // [35] holder.js [local] v 2.9.0+f2dkw Manejo de Imagenes
114
- // [36] flexdatalist [local] v 2.2.4
115
- // [37] dataTables [nube] V 1.10.19
116
- // [38] dataTables / Button [nube] V 1.5.4
117
- // [39] dataTables / Select [nube] V 1.2.7
118
- // [40] dataTables / Export Flash [nube] V 1.5.4
119
- // [41] dataTables / Export jszip [nube] V 3.1.3
120
- // [42] dataTables / Export pdfmake [nube] V 0.1.36
121
- // [43] dataTables / Export vfs_fonts [nube] V 0.1.36
122
- // [44] dataTables / Export buttons html5 [nube] V 1.5.2
123
- // [45] dataTables / Export buttons print [nube] V 1.5.2
124
- // [46] js Ctrl Values [local] personaliza
125
- // [47] js Get Values [local] personaliza
126
- // [48] Validetta / Validaciones [local] V 1.0.1
127
- // [49] Validetta / validettaLang-es-ES [local] V 1.0.1 custom
128
- // [50] [local] V
129
-
130
- {type: "script", dataPair: [["type", "text/javascript"],["src","https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"]]},
131
- {type: "script", dataPair: [["type", "text/javascript"],["src","https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js"]]},
132
- {type: "script", dataPair: [["type", "text/javascript"],["src","https://stackpath.bootstrapcdn.com/bootstrap/4.1.2/js/bootstrap.min.js"]]},
133
- {type: "script", dataPair: [["type", "text/javascript"],["src","/js/sweetalert.min.js"]]},
134
- {type: "script", dataPair: [["type", "text/javascript"],["src",""]]},
135
- {type: "script", dataPair: [["type", "text/javascript"],["src","/js/holder.min.js"]]},
136
- {type: "script", dataPair: [["type", "text/javascript"],["src","/js/jquery.flexdatalist.min.js"]]},
137
- {type: "script", dataPair: [["type", "text/javascript"],["src","https://cdn.datatables.net/1.10.19/js/jquery.dataTables.min.js"],["language", "JavaScript"]]},
138
- {type: "script", dataPair: [["type", "text/javascript"],["src","https://cdn.datatables.net/buttons/1.5.4/js/dataTables.buttons.min.js"]]},
139
- {type: "script", dataPair: [["type", "text/javascript"],["src","https://cdn.datatables.net/select/1.2.7/js/dataTables.select.min.js"]]},
140
- {type: "script", dataPair: [["type", "text/javascript"],["src","https://cdn.datatables.net/buttons/1.5.2/js/buttons.flash.min.js"]]},
141
- {type: "script", dataPair: [["type", "text/javascript"],["src","https://cdnjs.cloudflare.com/ajax/libs/jszip/3.1.3/jszip.min.js"]]},
142
- {type: "script", dataPair: [["type", "text/javascript"],["src","https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.36/pdfmake.min.js"]]},
143
- {type: "script", dataPair: [["type", "text/javascript"],["src","https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.36/vfs_fonts.js"]]},
144
- {type: "script", dataPair: [["type", "text/javascript"],["src","https://cdn.datatables.net/buttons/1.5.2/js/buttons.html5.min.js"]]},
145
- {type: "script", dataPair: [["type", "text/javascript"],["src","https://cdn.datatables.net/buttons/1.5.2/js/buttons.print.min.js"]]},
146
- {type: "script", dataPair: [["type", "text/javascript"],["src","/js/js_ctrlvalues.js"]]},
147
- {type: "script", dataPair: [["type", "text/javascript"],["src","/js/js_getvalues.js"]]},
148
- {type: "script", dataPair: [["type", "text/javascript"],["src","/js/validetta.min.js"]]},
149
- {type: "script", dataPair: [["type", "text/javascript"],["src","/js/validettaLang-es-ES.js"]]}
150
- ]
18
+ connectString : "(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=namehostoip)(PORT=port))(CONNECT_DATA=(SERVICE_NAME=servicename)))"
151
19
  };
152
20
 
153
-
154
- exports.Google =
155
- {
156
- key_GoogleMaps: "AIzaSyCCL_UtPnWKOxSn2e5r3r3VMpV-o9sknJw"
157
- };
158
-
159
- exports.Image =
160
- {
161
- pathbase: "",//"https://storage.googleapis.com/alzelsalvador/",
162
- //width: 100,
163
- //height: 100,
164
- thumbnail: "logo-disponible.png"
165
- };
166
-
167
- exports.pagConfig =
168
- {
169
- pagingSelect: "single",
170
- // Modos de seleccion de filas
171
- // single, seleccion simple de una fila
172
- // true, simple o multiples filas (NO configurado)
173
- // Existen otros modos pero no estan configurados (Celda, columna, summary)
174
-
175
- pagingType: "full_numbers",
176
- //numbers - Page number buttons only
177
- //simple - 'Previous' and 'Next' buttons only
178
- //simple_numbers - 'Previous' and 'Next' buttons, plus page numbers
179
- //full - 'First', 'Previous', 'Next' and 'Last' buttons
180
- //full_numbers - 'First', 'Previous', 'Next' and 'Last' buttons, plus page numbers
181
- //first_last_numbers - 'First' and 'Last' buttons, plus page numbers
182
-
183
- pagingLength: "[[10, 25, 50, 100, -1], [10, 25, 50, 100, 'Todos *']]",
184
- // matrices en la que la primera matriz se usa para definir las opciones de valor y la segunda matriz las opciones mostradas
185
- // (útil para cadenas de idioma como 'Todos, si se omite la segunda matriz, la primera sera utilizada para ambos casos.
186
-
187
- buttons_default: "'csv', 'excel', 'pdf', 'print'",
188
- // Botones por defecto
189
- // 'copy', 'csv', 'excel', 'pdf', 'print'
190
-
191
- pagingDOM: "<'row'<'col-sm-12 col-md-4 toolbar'><'col-sm-12 col-md-8'f>>" +
192
- "<'row'<'col-sm-12'tr>>" +
193
- "<'row'<'col-sm-12 col-md-9'l><'col-sm-12 col-md-3'B>>" +
194
- "<'row'<'col-sm-12 col-md-6'i><'col-sm-12 col-md-6'p>>"
195
- // Para definir la distribucion en el DOM
196
- // Valores validos "Blfrtip"
197
- //l - Length changing
198
- //f - Filtering input
199
- //t - The Table!
200
- //i - Information
201
- //p - Pagination
202
- //r - pRocessing
203
- //B - Button
204
- };
205
-
206
- exports.servMail =
207
- {
208
- fromEmail: '"Sitio Web Sistema Contable" <xan.kendrix@gmail.com>',
209
- transport: {
210
- host: 'smtp.gmail.com',
211
- port: 465,
212
- secure: true,
213
- auth:
214
- {
215
- user: 'xan.kendrix@gmail.com',
216
- pass: 'B@tman01'
217
- }
218
- },
219
-
220
- emailFormat:
221
- [
222
- ['<T2>Password de Usuario Nuevo</T2><p>Nombre: {0} </p><p>Correo: {1} </p><p>Password: {2} </p>'],
223
- ['<T2>Password Reseteado</T2><p>El administrador ha realizado la operacion de Reset al password<p>Correo: {1} </p><p>Password: {2} </p>']
224
- ]
225
-
226
- };