backend-plus 2.0.0-rc.7 → 2.0.0-rc.9

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.
@@ -690,16 +690,16 @@ myOwn.tableGrid = function tableGrid(tableName, mainElement, opts){
690
690
  if (myOwn.config.config['grid-row-retain-moved-or-deleted'] && !force) {
691
691
  var depotsToRetain = grid.depots.filter(depot => depot.tick == tick);
692
692
  for (depot of depotsToRetain) {
693
- depot.row['$refreshed'] = false
693
+ depot['$refreshed'] = false
694
694
  if (depot.tr && depot.tr.getAttribute('not-here')) depot.tr.removeAttribute('not-here')
695
695
  }
696
696
  }
697
697
  while (depot = depotsToDelete.pop()) {
698
698
  depot.manager.displayAsDeleted(depot, force ? 'change-ff' : 'unknown');
699
699
  if (myOwn.config.config['grid-row-retain-moved-or-deleted']) {
700
- if(!depot.row['$refreshed']){
700
+ if(!depot['$refreshed']){
701
701
  grid.retrieveRowAndRefresh(depot,{retrieveIgnoringWhere:true})
702
- depot.row['$refreshed'] = true
702
+ depot['$refreshed'] = true
703
703
  }
704
704
  }
705
705
  }
@@ -1622,7 +1622,7 @@ myOwn.dialogDownload = function dialogDownload(grid){
1622
1622
  }else{
1623
1623
  separator='|';
1624
1624
  var trans={
1625
- '|':'\\|',
1625
+ '|':'\\x7C',
1626
1626
  '\\':'\\\\',
1627
1627
  '\r':'\\r',
1628
1628
  '\n':'\\n',
@@ -54,6 +54,7 @@ var bestGlobals = require('best-globals');
54
54
  var coalesce = bestGlobals.coalesce;
55
55
  var changing = bestGlobals.changing;
56
56
  var datetime = bestGlobals.datetime;
57
+ var splitRawRowIntoRow = bestGlobals.splitRawRowIntoRow;
57
58
  const escapeRegExp = bestGlobals.escapeRegExp;
58
59
  var isLowerIdent = bestGlobals.isLowerIdent;
59
60
 
@@ -2937,7 +2938,7 @@ AppBackend.prototype.dumpDbSchemaPartial = async function dumpDbSchemaPartial(pa
2937
2938
  }else{
2938
2939
  var lines=content.split(/\r?\n/)
2939
2940
  .filter(line => !(/^[-| ]*$/.test(line)) )
2940
- .map(line => line.split(/(?<!(?:^|[^\\])(?:\\\\)*\\)\|/).map(item => item.trimRight().replace(/\\(.)/g,(_,l)=>(l=='t'?'\t':l=='r'?'\r':l=='n'?'\n':l=='s'?' ':l))) )
2941
+ .map(line => splitRawRowIntoRow(line))
2941
2942
  .filter(line => line.length>1 || line.length==1 && line[0].trim() );
2942
2943
  if(lines.length>1){
2943
2944
  if(lines[0][0].startsWith('\ufeff')){
@@ -3013,21 +3014,17 @@ AppBackend.prototype.dumpDbSchemaPartial = async function dumpDbSchemaPartial(pa
3013
3014
  for (var prefix of ['../', '../../']) {
3014
3015
  try {
3015
3016
  var dirName = Path.join(stackNode.path,prefix+'install').replace(regexpDistReplacer,'$1$2')
3016
- console.log('********** buscando en', dirName, 'de', stackNode.path)
3017
3017
  var list = await fs.readdir(dirName);
3018
3018
  } catch (err) {
3019
3019
  if (err.code != 'ENOENT') throw err;
3020
- console.log(err);
3021
3020
  var list = [];
3022
3021
  }
3023
- console.log(list)
3024
3022
  for(var fileName of list){
3025
3023
  if (fileName.endsWith('-fun.sql')) {
3026
3024
  common.push(await fs.readFile(Path.join(dirName,fileName), 'utf-8'));
3027
3025
  }
3028
3026
  }
3029
3027
  }
3030
- console.log(common)
3031
3028
  return common.join('\n');
3032
3029
  }))).join('\n');
3033
3030
 
@@ -3169,6 +3166,8 @@ AppBackend.prototype.exportacionesGenerico = async function exportacionesGeneric
3169
3166
  if (typeof result[0].title !== "string" || typeof result[0].rows !== "object" && !(result[0].rows instanceof Array) ) {
3170
3167
  throw new Error ("exportacionesGenerico debe recibir {title:string, rows:Record<string, any>[]}")
3171
3168
  }
3169
+ csvFileName = result[0].csvFileName ?? csvFileName;
3170
+ fileName = result[0].fileName ?? fileName;
3172
3171
  await bestGlobals.sleep(100);
3173
3172
  context.informProgress({message:`buscando archivos recién generados`})
3174
3173
  /** @type {{url:string, label:string}[]} */
@@ -1,7 +1,7 @@
1
1
  // @ts-check
2
2
  "use strict";
3
3
 
4
- var {datetime, changing, coalesce} = require('best-globals');
4
+ var {datetime, changing, coalesce, splitRawRowIntoRow} = require('best-globals');
5
5
  var XLSX = require('xlsx');
6
6
  var fs = require('fs/promises')
7
7
  var fsSync = require('fs');
@@ -805,7 +805,8 @@ ProcedureTables = [
805
805
  var rowsForUpsert=lines.slice(1).map(function(line){
806
806
  var othersArray = [];
807
807
  if(separator=='|'){
808
- var row = line.split(/(?<!(?:^|[^\\])(?:\\\\)*\\)\|/).map(item => item.trimRight().replace(/\\(.)/g,(_,l)=>(l=='t'?'\t':l=='r'?'\r':l=='n'?'\n':l=='s'?' ':l)));
808
+ var row = splitRawRowIntoRow(line);
809
+
809
810
  }else{
810
811
  var row=line.split(separator);
811
812
  }
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.7",
4
+ "version": "2.0.0-rc.9",
5
5
  "author": "Codenautas <codenautas@googlegroups.com>",
6
6
  "license": "MIT",
7
7
  "repository": "codenautas/backend-plus",
@@ -32,7 +32,7 @@
32
32
  "@upgraded/locate-path": "^6.0.0-alfa.1",
33
33
  "ajax-best-promise": "^0.4.0",
34
34
  "backend-skins": "^0.1.15",
35
- "best-globals": "^1.1.2",
35
+ "best-globals": "^1.1.3",
36
36
  "big.js": "^6.2.1",
37
37
  "body-parser": "^1.20.2",
38
38
  "cast-error": "^0.1.1",
@@ -41,7 +41,7 @@
41
41
  "cookie-parser": "^1.4.6",
42
42
  "dialog-promise": "^0.9.15",
43
43
  "discrepances": "^0.2.8",
44
- "express": "^4.18.2",
44
+ "express": "^4.18.3",
45
45
  "express-session": "^1.18.0",
46
46
  "express-useragent": "^1.0.15",
47
47
  "fs-extra": "^11.2.0",
@@ -55,7 +55,7 @@
55
55
  "mini-tools": "^1.12.1",
56
56
  "moment": "^2.30.1",
57
57
  "multiparty": "^4.2.3",
58
- "nodemailer": "^6.9.9",
58
+ "nodemailer": "^6.9.12",
59
59
  "numeral": "^2.0.6",
60
60
  "pg-promise-strict": "^1.3.3",
61
61
  "pikaday": "^1.8.2",
@@ -68,7 +68,7 @@
68
68
  "session-file-store": "^1.5.0",
69
69
  "sql-tools": "^0.1.2",
70
70
  "stack-trace": "^0.0.10",
71
- "stylus": "0.62.0",
71
+ "stylus": "0.63.0",
72
72
  "type-store": "^0.4.0",
73
73
  "typed-controls": "^0.12.0",
74
74
  "xlsx": "https://cdn.sheetjs.com/xlsx-0.19.3/xlsx-0.19.3.tgz"
@@ -82,7 +82,7 @@
82
82
  "@types/js-yaml": "^4.0.9",
83
83
  "@types/mocha": "^10.0.6",
84
84
  "@types/multiparty": "~0.0.36",
85
- "@types/node": "^20.11.19",
85
+ "@types/node": "^20.11.28",
86
86
  "@types/nodemailer": "^6.4.14",
87
87
  "@types/numeral": "~2.0.5",
88
88
  "@types/session-file-store": "^1.2.5",
@@ -90,20 +90,20 @@
90
90
  "@types/websql": "~0.0.30",
91
91
  "esprima": "^4.0.1",
92
92
  "expect.js": "~0.3.1",
93
- "karma": "6.4.2",
93
+ "karma": "6.4.3",
94
94
  "karma-chrome-launcher": "^3.2.0",
95
95
  "karma-expect": "^1.1.3",
96
- "karma-firefox-launcher": "^2.1.2",
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
100
  "mocha": "^10.3.0",
101
101
  "nyc": "^15.1.0",
102
- "puppeteer": "^22.1.0",
102
+ "puppeteer": "^22.5.0",
103
103
  "sinon": "^17.0.1",
104
104
  "supertest": "^6.3.4",
105
105
  "types.d.ts": "~0.6.21",
106
- "typescript": "^5.3.3",
106
+ "typescript": "^5.4.2",
107
107
  "why-is-node-running": "^2.2.2"
108
108
  },
109
109
  "engines": {