backend-plus 1.18.0 → 1.18.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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "backend-plus",
3
3
  "description": "Backend for typed controls",
4
- "version": "1.18.0",
4
+ "version": "1.18.2",
5
5
  "author": "Codenautas <codenautas@googlegroups.com>",
6
6
  "license": "MIT",
7
7
  "repository": "codenautas/backend-plus",
@@ -51,7 +51,7 @@
51
51
  "like-ar": "^0.3.9",
52
52
  "login-plus": "^1.7.0",
53
53
  "memorystore": "^1.6.7",
54
- "mini-tools": "^1.11.2",
54
+ "mini-tools": "^1.12.0",
55
55
  "moment": "^2.29.4",
56
56
  "multiparty": "^4.2.3",
57
57
  "nodemailer": "^6.9.1",
@@ -63,7 +63,7 @@
63
63
  "regexplicit": "^0.1.3",
64
64
  "require-bro": "^0.3.0",
65
65
  "self-explain": "^0.10.22",
66
- "serve-content": "^0.3.17",
66
+ "serve-content": "^0.3.18",
67
67
  "session-file-store": "^1.5.0",
68
68
  "sql-tools": "^0.1.2",
69
69
  "stack-trace": "^0.0.10",
@@ -81,7 +81,7 @@
81
81
  "@types/js-yaml": "^4.0.5",
82
82
  "@types/mocha": "^10.0.1",
83
83
  "@types/multiparty": "~0.0.33",
84
- "@types/node": "^18.15.11",
84
+ "@types/node": "^18.16.3",
85
85
  "@types/nodemailer": "^6.4.7",
86
86
  "@types/numeral": "~2.0.2",
87
87
  "@types/session-file-store": "^1.2.2",
@@ -89,8 +89,8 @@
89
89
  "@types/websql": "~0.0.27",
90
90
  "esprima": "^4.0.1",
91
91
  "expect.js": "~0.3.1",
92
- "karma": "6.4.1",
93
- "karma-chrome-launcher": "^3.1.1",
92
+ "karma": "6.4.2",
93
+ "karma-chrome-launcher": "^3.2.0",
94
94
  "karma-expect": "^1.1.3",
95
95
  "karma-firefox-launcher": "^2.1.2",
96
96
  "karma-ie-launcher": "^1.0.0",
@@ -98,8 +98,8 @@
98
98
  "kill-9": "~0.4.3",
99
99
  "mocha": "^10.2.0",
100
100
  "nyc": "^15.1.0",
101
- "puppeteer": "^19.8.5",
102
- "sinon": "^15.0.3",
101
+ "puppeteer": "^19.11.1",
102
+ "sinon": "^15.0.4",
103
103
  "supertest": "^6.3.3",
104
104
  "types.d.ts": "~0.6.13",
105
105
  "typescript": "^5.0.4",
@@ -48,6 +48,10 @@ var controles_de_compatibilidad={
48
48
  ,controlar:function(parametros){
49
49
  return !!window.addEventListener;
50
50
  }},
51
+ 'soporte para WebSocket':{gravedad:'antiguo'
52
+ ,controlar:function(parametros){
53
+ return !!window.WebSocket;
54
+ }},
51
55
  'conectividad via fetch':{gravedad:'incompatible'
52
56
  ,controlar:function(params){
53
57
  return 'fetch' in window
@@ -60,10 +64,10 @@ var controles_de_compatibilidad={
60
64
  }}
61
65
  };
62
66
 
63
- function controlar_compatibilidad(ya){
67
+ function controlar_compatibilidad(ya, id, idBoton){
64
68
  "use strict";
65
- var boton=document.getElementById('login');
66
- var id = 'resultado_incompatibilidad'
69
+ var boton=document.getElementById(idBoton || 'login');
70
+ id = id || 'resultado_incompatibilidad';
67
71
  var div=document.getElementById(id);
68
72
  if(!div){
69
73
  div = document.createElement('div');
@@ -72,7 +76,7 @@ function controlar_compatibilidad(ya){
72
76
  div.textContent='controlando la compatibilidad del navegador';
73
77
  }
74
78
  if(!ya){
75
- boton.disabled=true;
79
+ if (boton) boton.disabled=true;
76
80
  setTimeout(function(){
77
81
  controlar_compatibilidad(true)
78
82
  },100)
@@ -100,17 +104,56 @@ function controlar_compatibilidad(ya){
100
104
  }
101
105
  };
102
106
  if(!hubo_errores_tipo['incompatible']){
103
- boton.disabled=false;
107
+ if (boton) boton.disabled=false;
108
+ }
109
+ var attrsep = ": ";
110
+ var attr = function(base, prop, expected){
111
+ try {
112
+ if (!(base in window)) {
113
+ return attrsep + "sin "+base;
114
+ } else if (!(prop in (window[base]))) {
115
+ return attrsep + "sin "+base+"."+prop;
116
+ } else {
117
+ var mostrar = window[base][prop];
118
+ if (expected !== undefined) {
119
+ if (mostrar == expected) return "";
120
+ }
121
+ try {
122
+ mostrar = JSON.stringify(mostrar)
123
+ } catch (_) {
124
+ mostrar = mostrar + ""
125
+ }
126
+ return attrsep + (base == "navigator" ? "" : base + ".") + prop + "=" + mostrar
127
+ }
128
+ } catch (err) {
129
+ return attrsep + "sin capacidad de detectar " + base + "." + prop;
130
+ } finally {
131
+ attrsep = ", ";
132
+ }
133
+ }
134
+ var bloque = function(elementoContenedor, text){
135
+ var elemento = document.createElement('div');
136
+ elementoContenedor.appendChild(elemento);
137
+ elemento.textContent = text;
104
138
  }
105
139
  if(hubo_errores){
106
140
  console.log('aca')
107
- var alertDiv = document.createElement(hubo_errores_tipo[def_control.gravedad]?'h3':'div');
108
- alertDiv.textContent="El sistema no fue probado en este modelo de navegador. Si experimenta problemas durante el uso cuando avise del problema incluya el nombre y versión del navegador. Se recomienda usar una versión actualizada del navegador Google Chrome";
109
- if(hubo_errores_tipo[def_control.gravedad]){
141
+ var alertDiv = document.createElement(hubo_errores_tipo['incompatible']?'h3':'div');
142
+ bloque(alertDiv, "El sistema no fue probado en este modelo de navegador. Si experimenta problemas durante el uso cuando avise del problema incluya el nombre y versión del navegador. Se recomienda usar una versión actualizada del navegador Google Chrome o MS Edge");
143
+ bloque(alertDiv, "Caracteristicas detectadas en el navegador"+
144
+ attr('navigator','appName')+
145
+ attr('navigator','appVersion')+
146
+ attr('navigator','vendor')+
147
+ attr('navigator','vendorSub')+
148
+ attr('navigator','cookieEnabled', true)+
149
+ attr('navigator','onLine', true)+
150
+ "."
151
+ );
152
+ if(hubo_errores_tipo['incompatible']){
110
153
  var check = document.createElement('input');
111
154
  check.type='checkbox';
112
155
  check.onchange=function(){
113
- boton.disabled=!check.checked
156
+ if (boton) boton.disabled=!check.checked
114
157
  }
115
158
  alertDiv.appendChild(check);
116
159
  }