backend-plus 2.0.0-rc.9 → 2.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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "backend-plus",
3
3
  "description": "Backend for the anti Pareto rule",
4
- "version": "2.0.0-rc.9",
4
+ "version": "2.0.2",
5
5
  "author": "Codenautas <codenautas@googlegroups.com>",
6
6
  "license": "MIT",
7
7
  "repository": "codenautas/backend-plus",
@@ -30,81 +30,81 @@
30
30
  ],
31
31
  "dependencies": {
32
32
  "@upgraded/locate-path": "^6.0.0-alfa.1",
33
- "ajax-best-promise": "^0.4.0",
33
+ "ajax-best-promise": "^0.4.2",
34
34
  "backend-skins": "^0.1.15",
35
- "best-globals": "^1.1.3",
36
- "big.js": "^6.2.1",
37
- "body-parser": "^1.20.2",
35
+ "best-globals": "^1.1.6",
36
+ "big.js": "^6.2.2",
37
+ "body-parser": "^1.20.3",
38
38
  "cast-error": "^0.1.1",
39
- "castellano": "^0.1.3",
40
- "connect-pg-simple": "^9.0.1",
41
- "cookie-parser": "^1.4.6",
42
- "dialog-promise": "^0.9.15",
39
+ "castellano": "^0.1.4",
40
+ "connect-pg-simple": "^10.0.0",
41
+ "cookie-parser": "^1.4.7",
42
+ "dialog-promise": "^0.10.0",
43
43
  "discrepances": "^0.2.8",
44
- "express": "^4.18.3",
45
- "express-session": "^1.18.0",
44
+ "express": "^4.21.1",
45
+ "express-session": "^1.18.1",
46
46
  "express-useragent": "^1.0.15",
47
47
  "fs-extra": "^11.2.0",
48
48
  "js-to-html": "^1.3.2",
49
49
  "js-yaml": "^4.1.0",
50
- "json4all": "^1.3.0-beta.1",
50
+ "json4all": "^1.4.0",
51
51
  "lazy-some": "^0.1.0",
52
- "like-ar": "^0.3.9",
53
- "login-plus": "^1.7.1",
52
+ "like-ar": "^0.5.1",
53
+ "login-plus": "^1.7.2",
54
54
  "memorystore": "^1.6.7",
55
- "mini-tools": "^1.12.1",
55
+ "mini-tools": "^1.12.2",
56
56
  "moment": "^2.30.1",
57
57
  "multiparty": "^4.2.3",
58
- "nodemailer": "^6.9.12",
58
+ "nodemailer": "^6.9.15",
59
59
  "numeral": "^2.0.6",
60
- "pg-promise-strict": "^1.3.3",
60
+ "pg-promise-strict": "^1.4.1",
61
61
  "pikaday": "^1.8.2",
62
- "pug": "^3.0.2",
62
+ "pug": "^3.0.3",
63
63
  "read-yaml-promise": "^1.0.2",
64
64
  "regexplicit": "^0.1.3",
65
65
  "require-bro": "^0.3.1",
66
- "self-explain": "^0.10.22",
67
- "serve-content": "^0.3.19",
66
+ "self-explain": "^0.11.0",
67
+ "serve-content": "^0.3.20",
68
68
  "session-file-store": "^1.5.0",
69
69
  "sql-tools": "^0.1.2",
70
70
  "stack-trace": "^0.0.10",
71
71
  "stylus": "0.63.0",
72
- "type-store": "^0.4.0",
73
- "typed-controls": "^0.12.0",
74
- "xlsx": "https://cdn.sheetjs.com/xlsx-0.19.3/xlsx-0.19.3.tgz"
72
+ "type-store": "^0.4.4",
73
+ "typed-controls": "^0.12.2",
74
+ "xlsx": "https://cdn.sheetjs.com/xlsx-0.20.2/xlsx-0.20.2.tgz"
75
75
  },
76
76
  "devDependencies": {
77
77
  "@types/big.js": "^6.2.2",
78
78
  "@types/expect.js": "~0.3.32",
79
- "@types/express": "^4.17.21",
79
+ "@types/express": "^5.0.0",
80
80
  "@types/express-useragent": "^1.0.5",
81
81
  "@types/fs-extra": "^11.0.4",
82
82
  "@types/js-yaml": "^4.0.9",
83
- "@types/mocha": "^10.0.6",
84
- "@types/multiparty": "~0.0.36",
85
- "@types/node": "^20.11.28",
86
- "@types/nodemailer": "^6.4.14",
83
+ "@types/mocha": "^10.0.9",
84
+ "@types/multiparty": "~4.2.1",
85
+ "@types/node": "^22.7.5",
86
+ "@types/nodemailer": "^6.4.16",
87
87
  "@types/numeral": "~2.0.5",
88
88
  "@types/session-file-store": "^1.2.5",
89
89
  "@types/stack-trace": "~0.0.33",
90
90
  "@types/websql": "~0.0.30",
91
91
  "esprima": "^4.0.1",
92
92
  "expect.js": "~0.3.1",
93
- "karma": "6.4.3",
93
+ "karma": "6.4.4",
94
94
  "karma-chrome-launcher": "^3.2.0",
95
95
  "karma-expect": "^1.1.3",
96
96
  "karma-firefox-launcher": "^2.1.3",
97
97
  "karma-ie-launcher": "^1.0.0",
98
98
  "karma-mocha": "^2.0.1",
99
99
  "kill-9": "~0.4.3",
100
- "mocha": "^10.3.0",
101
- "nyc": "^15.1.0",
102
- "puppeteer": "^22.5.0",
103
- "sinon": "^17.0.1",
104
- "supertest": "^6.3.4",
100
+ "mocha": "^10.7.3",
101
+ "nyc": "^17.1.0",
102
+ "puppeteer": "^23.5.2",
103
+ "sinon": "^19.0.2",
104
+ "supertest": "^7.0.0",
105
105
  "types.d.ts": "~0.6.21",
106
- "typescript": "^5.4.2",
107
- "why-is-node-running": "^2.2.2"
106
+ "typescript": "^5.6.3",
107
+ "why-is-node-running": "^3.2.0"
108
108
  },
109
109
  "engines": {
110
110
  "node": ">= 18"
@@ -193,14 +193,17 @@ myAjax.ajaxPromise = function ajaxPromise(procedureDef,data,opts){
193
193
  }
194
194
  var result=[];
195
195
  var progress=procedureDef.progress!==false;
196
+ /** @type {Record<string,{ divBar, progressBar, progresIndicator, divBarLabel }>} */
197
+ var progressStruct = {}
196
198
  var divProgress;
197
- var divBarProgress;
198
- var progressBar;
199
- var progressIndicator;
200
- var divBarProgressLabel;
199
+ // var divBarProgress = {};
200
+ // var progressBar;
201
+ // var progressIndicator;
202
+ // var divBarProgressLabel = {};
201
203
  var onClose=function(){}
202
204
  var defaultInformProgress = function defaultInformProgress(progressInfo){
203
205
  if(progressInfo.message || progressInfo.end || progressInfo.start || progressInfo.loaded){
206
+ // progressInfo.idGroup
204
207
  if(!divProgress){
205
208
  var idAutoClose='id-auto-close-'+Math.random();
206
209
  var checkAutoClose=html.input({type:'checkbox', id:idAutoClose, checked:myAjax.ajaxPromise.autoClose}).create();
@@ -235,8 +238,12 @@ myAjax.ajaxPromise = function ajaxPromise(procedureDef,data,opts){
235
238
  }
236
239
  }
237
240
  }
238
- if(progressInfo.ephemeral && divBarProgressLabel){
239
- divBarProgressLabel.textContent=progressInfo.message;
241
+ if (progressStruct[progressInfo.idGroup] == null) {
242
+ progressStruct[progressInfo.idGroup] = {}
243
+ }
244
+ var ps = progressStruct[progressInfo.idGroup];
245
+ if(progressInfo.ephemeral && ps.divBarLabel){
246
+ ps.divBarLabel.textContent = progressInfo.message;
240
247
  }else if(progressInfo.message || progressInfo.end){
241
248
  var now=bestGlobals.datetime.now();
242
249
  var elapsed = now.sub(tickTime);
@@ -265,23 +272,23 @@ myAjax.ajaxPromise = function ajaxPromise(procedureDef,data,opts){
265
272
  );
266
273
  }
267
274
  }
268
- if(progressInfo.loaded){
269
- if(!divBarProgress){
270
- divBarProgressLabel = html.div().create();
271
- progressIndicator=html.div({class:'indicator'},' ').create();
272
- progressBar=html.div({class:'progress-bar', style:'width:400px; height:8px;'},[progressIndicator]).create();
273
- divBarProgress = html.div([
274
- divBarProgressLabel,
275
- progressBar
275
+ if(progressInfo.loaded != null){
276
+ if(!ps.divBar){
277
+ ps.divBarLabel = html.div().create();
278
+ ps.progressIndicator=html.div({class:'indicator'},' ').create();
279
+ ps.progressBar=html.div({class:'progress-bar', style:'width:400px; height:8px;'},[ps.progressIndicator]).create();
280
+ ps.divBar = html.div([
281
+ ps.divBarLabel,
282
+ ps.progressBar
276
283
  ]).create();
277
- divProgress.parentNode.insertBefore(divBarProgress, divProgress);
284
+ divProgress.parentNode.insertBefore(ps.divBar, divProgress);
278
285
  }
279
286
  if(progressInfo.lengthComputable){
280
- progressIndicator.style.width=progressInfo.loaded*100/progressInfo.total+'%';
281
- progressIndicator.title=Math.round(progressInfo.loaded*100/progressInfo.total)+'%';
287
+ ps.progressIndicator.style.width=progressInfo.loaded*100/progressInfo.total+'%';
288
+ ps.progressIndicator.title=Math.round(progressInfo.loaded*100/progressInfo.total)+'%';
282
289
  }else{
283
- progressIndicator.style.backgroundColor='#D4D';
284
- progressIndicator.title='N/D %';
290
+ ps.progressIndicator.style.backgroundColor='#D4D';
291
+ ps.progressIndicator.title='N/D %';
285
292
  }
286
293
  }
287
294
  }
@@ -304,7 +311,6 @@ myAjax.ajaxPromise = function ajaxPromise(procedureDef,data,opts){
304
311
  }
305
312
  var controlLoggedIn = function controlLoggedIn(result, informNotLoggedIn){
306
313
  if(informNotLoggedIn || result && result[0]=="<" && result.match(/login/m)){
307
- console.log('xxxxxxxxxxx',procedureDef.action)
308
314
  my.informDetectedStatus('notLogged');
309
315
  throw bestGlobals.changing(new Error(my.messages.notLogged),{displayed:true, isNotLoggedError:true});
310
316
  }
@@ -495,13 +501,27 @@ function agregar_json_default_ubicaciones(div, o, a){
495
501
  var table = div2.laTabla;
496
502
  var row = table.insertRow(-1);
497
503
  var cellName = row.insertCell(-1);
498
- cellName.className='attr-name';
499
- cellName.textContent = a;
504
+ agregar_class_textInDiv(cellName, 'attr-name', a)
500
505
  var cell = row.insertCell(-1);
501
506
  cell.colSpan=99;
502
507
  return {title:cellName, data:cell, skip:o[a] == null}
503
508
  }
504
509
 
510
+ /**
511
+ *
512
+ * @param {HTMLTableDataElement} td
513
+ * @param {string|number} text
514
+ * @param {string} className
515
+ */
516
+ function agregar_class_textInDiv(td, className, text){
517
+ var div = document.createElement('div');
518
+ td.className = className;
519
+ div.className = 'json-container';
520
+ div.textContent = text;
521
+ td.innerHTML = '';
522
+ td.appendChild(div);
523
+ }
524
+
505
525
  /**
506
526
  *
507
527
  * @param {HTMLElement} div
@@ -524,9 +544,7 @@ function agregar_json(div, o, ubicaciones=agregar_json_default_ubicaciones){
524
544
  if(o[a]!=null){
525
545
  var row = table.insertRow(-1);
526
546
  var cellName = row.insertCell(-1);
527
- cellName.className='row-num';
528
- // @ts-ignore numero y texto
529
- cellName.textContent = isNaN(a)?a:Number(a)+1;
547
+ agregar_class_textInDiv(cellName, 'row-num', isNaN(a)?a:Number(a)+1);
530
548
  agregar_json(row, o[a], function(div, _o, a){
531
549
  // @ts-ignore sé que es Row
532
550
  /** @type {HTMLTableRowElement} */
@@ -554,11 +572,9 @@ function agregar_json(div, o, ubicaciones=agregar_json_default_ubicaciones){
554
572
  if(!cells.skip){
555
573
  if(cells.title){
556
574
  if(o instanceof Array && !isNaN(a)){
557
- cells.title.className='row-num';
558
- cells.title.textContent = Number(a) + 1;
575
+ agregar_class_textInDiv(cells.title, 'row-num', Number(a) + 1);
559
576
  }else{
560
- cells.title.className='attr-name';
561
- cells.title.textContent = a;
577
+ agregar_class_textInDiv(cells.title, 'attr-name', a);
562
578
  }
563
579
  }
564
580
  agregar_json(cells.data, o[a]);
@@ -566,13 +582,16 @@ function agregar_json(div, o, ubicaciones=agregar_json_default_ubicaciones){
566
582
  }
567
583
  }
568
584
  }else{
569
- div.className='plain-content';
585
+ var textContent;
570
586
  if(typeof o == "boolean"){
571
- div.textContent = o?'Sí':'No'
587
+ textContent = o ? 'Sí' : 'No'
572
588
  }else if(o && o instanceof Date && o.isRealDate){
573
- div.textContent = o.toDmy();
589
+ textContent = o.toDmy();
574
590
  }else{
575
- div.textContent = o.toLocaleString();
591
+ textContent = o.toLocaleString();
592
+ }
593
+ if (textContent) {
594
+ agregar_class_textInDiv(div, 'plain-content', textContent)
576
595
  }
577
596
  }
578
597
  }