backend-plus 1.16.8 → 1.16.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.
- package/for-client/new-pass-enter.jade +1 -1
- package/for-client/new-password.jade +1 -1
- package/lib/backend-plus.d.ts +2 -1
- package/lib/backend-plus.js +31 -20
- package/package.json +12 -12
|
@@ -34,7 +34,7 @@ html(lang=lang)
|
|
|
34
34
|
td.formlabel.buttonmargin
|
|
35
35
|
td(colspan=4)
|
|
36
36
|
input.submit(id="login", type="submit", value=msgs.newPassword.button)
|
|
37
|
-
each errorLine in (flash.error||[])
|
|
37
|
+
each errorLine in (flash && flash.error||[])
|
|
38
38
|
tr(style={color:'red'})
|
|
39
39
|
td.error-message(colspan=5)=errorLine
|
|
40
40
|
if forget
|
package/lib/backend-plus.d.ts
CHANGED
|
@@ -77,7 +77,7 @@ export interface ContextForDump extends Context {
|
|
|
77
77
|
|
|
78
78
|
export type InformProgressFunction=(opts:Error|{data:any}|{start:any}|{message:string}|{message?:string, lengthComputable:boolean, loaded:number, total:number, force?:boolean})=>void
|
|
79
79
|
|
|
80
|
-
export
|
|
80
|
+
export interface ProcedureContext extends Context{
|
|
81
81
|
client:Client
|
|
82
82
|
doing:string
|
|
83
83
|
informProgress:InformProgressFunction
|
|
@@ -371,6 +371,7 @@ export class AppBackend{
|
|
|
371
371
|
procedureDefCompleter(procedureDef:ProcedureDef):ProcedureDef
|
|
372
372
|
tableDefAdapt(tableDef:TableDefinition, context:Context):TableDefinition
|
|
373
373
|
pushApp(dirname:string):void
|
|
374
|
+
dumpDbTableFields(tableDefinition:TableDefinition):string[]
|
|
374
375
|
dumpDbSchemaPartial(partialTableStructures:TableDefinitions, opts?:DumpOptions):Promise<{mainSql:string; enancePart:string}>
|
|
375
376
|
getContextForDump(): ContextForDump
|
|
376
377
|
getClientSetupForSendToFrontEnd(req:Request):ClientSetup
|
package/lib/backend-plus.js
CHANGED
|
@@ -896,7 +896,6 @@ AppBackend.prototype.start = function start(opts){
|
|
|
896
896
|
}
|
|
897
897
|
if(be.config.server["base-url"] && be.config.server["base-url"]!='/'){
|
|
898
898
|
mainApp.get('/favicon.ico', function(req,res,next){
|
|
899
|
-
console.log('quieren el favicon')
|
|
900
899
|
MiniTools.serveFile(__dirname+'/../for-client/img/warning128.png')(req,res,next)
|
|
901
900
|
})
|
|
902
901
|
}
|
|
@@ -2466,6 +2465,31 @@ AppBackend.prototype.dumpFkConstraint = function dumpFkConstraint(fk, tableDef,
|
|
|
2466
2465
|
return {consName, clause, sourceFieldList};
|
|
2467
2466
|
}
|
|
2468
2467
|
|
|
2468
|
+
AppBackend.prototype.dumpDbTableFields = function dumpDbTableFields(tableDef, opts = {}, complements = null){
|
|
2469
|
+
var db = this.db;
|
|
2470
|
+
var fields=[];
|
|
2471
|
+
tableDef.fields.forEach(function(fieldDef){
|
|
2472
|
+
if(!fieldDef.clientSide && fieldDef.inTable!==false && !fieldDef.inJoin && !(tableDef.sql.fields[fieldDef.name]||{}).expr || fieldDef.inTable){
|
|
2473
|
+
var fieldType=typeDb[fieldDef.typeName]||'"'+fieldDef.typeName+'"';
|
|
2474
|
+
if(fieldDef.sizeByte==4){
|
|
2475
|
+
fieldType = 'integer';
|
|
2476
|
+
}
|
|
2477
|
+
fields.push(
|
|
2478
|
+
' '+db.quoteIdent(fieldDef.name)+
|
|
2479
|
+
' '+(fieldDef.dataLength?(fieldType=='text'?'varchar':fieldType)+'('+fieldDef.dataLength+')':fieldType)+
|
|
2480
|
+
(fieldDef.defaultValue!=null?' default '+db.quoteLiteral(fieldDef.defaultValue):'')+
|
|
2481
|
+
(fieldDef.defaultDbValue!=null?' default '+fieldDef.defaultDbValue:'')+
|
|
2482
|
+
(fieldDef.sequence && !fieldDef.sequence.name?' generated always as identity':'')+
|
|
2483
|
+
(fieldDef.generatedAs!=null?` generated always as (${fieldDef.generatedAs}) stored`:'')
|
|
2484
|
+
);
|
|
2485
|
+
if(complements){
|
|
2486
|
+
complements(fieldDef)
|
|
2487
|
+
}
|
|
2488
|
+
}
|
|
2489
|
+
});
|
|
2490
|
+
return fields
|
|
2491
|
+
}
|
|
2492
|
+
|
|
2469
2493
|
AppBackend.prototype.dumpDbSchemaPartial = async function dumpDbSchemaPartial(partialTableStructures, opts = {}){
|
|
2470
2494
|
var complete = opts.complete;
|
|
2471
2495
|
var be = this;
|
|
@@ -2533,21 +2557,8 @@ AppBackend.prototype.dumpDbSchemaPartial = async function dumpDbSchemaPartial(pa
|
|
|
2533
2557
|
throw new Error('table '+tableDef.sql.tableName+' has viewBody. It must has isTable=false');
|
|
2534
2558
|
}
|
|
2535
2559
|
lines.push('create table '+cualQuoteTableName+' (');
|
|
2536
|
-
var fields=
|
|
2537
|
-
|
|
2538
|
-
if(!fieldDef.clientSide && fieldDef.inTable!==false && !fieldDef.inJoin && !(tableDef.sql.fields[fieldDef.name]||{}).expr || fieldDef.inTable){
|
|
2539
|
-
var fieldType=typeDb[fieldDef.typeName]||'"'+fieldDef.typeName+'"';
|
|
2540
|
-
if(fieldDef.sizeByte==4){
|
|
2541
|
-
fieldType = 'integer';
|
|
2542
|
-
}
|
|
2543
|
-
fields.push(
|
|
2544
|
-
' '+db.quoteIdent(fieldDef.name)+
|
|
2545
|
-
' '+(fieldDef.dataLength?(fieldType=='text'?'varchar':fieldType)+'('+fieldDef.dataLength+')':fieldType)+
|
|
2546
|
-
(fieldDef.defaultValue!=null?' default '+db.quoteLiteral(fieldDef.defaultValue):'')+
|
|
2547
|
-
(fieldDef.defaultDbValue!=null?' default '+fieldDef.defaultDbValue:'')+
|
|
2548
|
-
(fieldDef.sequence && !fieldDef.sequence.name?' generated always as identity':'')+
|
|
2549
|
-
(fieldDef.generatedAs!=null?` generated always as (${fieldDef.generatedAs}) stored`:'')
|
|
2550
|
-
);
|
|
2560
|
+
var fields = be.dumpDbTableFields(tableDef, opts,
|
|
2561
|
+
function complements(fieldDef){
|
|
2551
2562
|
if(fieldDef.sequence && !fieldDef.sequence.name){
|
|
2552
2563
|
tablesWithStrictSequence[tableName]={}
|
|
2553
2564
|
}
|
|
@@ -2572,11 +2583,11 @@ AppBackend.prototype.dumpDbSchemaPartial = async function dumpDbSchemaPartial(pa
|
|
|
2572
2583
|
' alter column '+db.quoteIdent(fieldDef.name)+' set not null;'
|
|
2573
2584
|
);
|
|
2574
2585
|
}
|
|
2586
|
+
if(fieldDef.sequence && fieldDef.sequence.name){
|
|
2587
|
+
fieldsForSequences.push(fieldDef);
|
|
2588
|
+
}
|
|
2575
2589
|
}
|
|
2576
|
-
|
|
2577
|
-
fieldsForSequences.push(fieldDef);
|
|
2578
|
-
}
|
|
2579
|
-
});
|
|
2590
|
+
);
|
|
2580
2591
|
lines.push(fields.join(', \n'));
|
|
2581
2592
|
if(tableDef.primaryKey){
|
|
2582
2593
|
lines.push(', primary key ('+tableDef.primaryKey.map(function(name){ return db.quoteIdent(name); }).join(', ')+')');
|
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.16.
|
|
4
|
+
"version": "1.16.9",
|
|
5
5
|
"author": "Codenautas <codenautas@googlegroups.com>",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"repository": "codenautas/backend-plus",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"ajax-best-promise": "^0.3.7",
|
|
33
33
|
"backend-skins": "^0.1.15",
|
|
34
34
|
"best-globals": "^1.0.3",
|
|
35
|
-
"big.js": "^6.
|
|
35
|
+
"big.js": "^6.2.0",
|
|
36
36
|
"body-parser": "^1.20.0",
|
|
37
37
|
"cast-error": "^0.1.0",
|
|
38
38
|
"castellano": "^0.1.3",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"dialog-promise": "^0.9.15",
|
|
42
42
|
"discrepances": "^0.2.6",
|
|
43
43
|
"express": "^4.18.1",
|
|
44
|
-
"express-session": "^1.17.
|
|
44
|
+
"express-session": "^1.17.3",
|
|
45
45
|
"express-useragent": "^1.0.15",
|
|
46
46
|
"fs-extra": "^10.1.0",
|
|
47
47
|
"js-to-html": "^1.3.2",
|
|
@@ -52,9 +52,9 @@
|
|
|
52
52
|
"login-plus": "^1.6.2",
|
|
53
53
|
"memorystore": "^1.6.7",
|
|
54
54
|
"mini-tools": "^1.11.2",
|
|
55
|
-
"moment": "^2.29.
|
|
55
|
+
"moment": "^2.29.4",
|
|
56
56
|
"multiparty": "^4.2.3",
|
|
57
|
-
"nodemailer": "^6.7.
|
|
57
|
+
"nodemailer": "^6.7.7",
|
|
58
58
|
"numeral": "^2.0.6",
|
|
59
59
|
"pg-promise-strict": "^1.2.6",
|
|
60
60
|
"pikaday": "^1.8.2",
|
|
@@ -67,14 +67,14 @@
|
|
|
67
67
|
"session-file-store": "^1.5.0",
|
|
68
68
|
"sql-tools": "^0.1.2",
|
|
69
69
|
"stack-trace": "^0.0.10",
|
|
70
|
-
"stylus": "0.
|
|
70
|
+
"stylus": "0.58.1",
|
|
71
71
|
"type-store": "^0.2.41",
|
|
72
72
|
"typed-controls": "^0.10.0",
|
|
73
73
|
"xlsx": "^0.18.5",
|
|
74
74
|
"xlsx-style": "^0.8.13"
|
|
75
75
|
},
|
|
76
76
|
"devDependencies": {
|
|
77
|
-
"@types/big.js": "^6.1.
|
|
77
|
+
"@types/big.js": "^6.1.5",
|
|
78
78
|
"@types/expect.js": "~0.3.29",
|
|
79
79
|
"@types/express": "^4.17.13",
|
|
80
80
|
"@types/express-useragent": "^1.0.2",
|
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
"@types/js-yaml": "^4.0.5",
|
|
83
83
|
"@types/mocha": "^9.1.1",
|
|
84
84
|
"@types/multiparty": "~0.0.33",
|
|
85
|
-
"@types/node": "^
|
|
85
|
+
"@types/node": "^18.0.3",
|
|
86
86
|
"@types/nodemailer": "^6.4.4",
|
|
87
87
|
"@types/numeral": "~2.0.2",
|
|
88
88
|
"@types/session-file-store": "^1.2.2",
|
|
@@ -90,7 +90,7 @@
|
|
|
90
90
|
"@types/websql": "~0.0.27",
|
|
91
91
|
"esprima": "^4.0.1",
|
|
92
92
|
"expect.js": "~0.3.1",
|
|
93
|
-
"karma": "6.
|
|
93
|
+
"karma": "6.4.0",
|
|
94
94
|
"karma-chrome-launcher": "^3.1.1",
|
|
95
95
|
"karma-expect": "^1.1.3",
|
|
96
96
|
"karma-firefox-launcher": "^2.1.2",
|
|
@@ -99,11 +99,11 @@
|
|
|
99
99
|
"kill-9": "~0.4.3",
|
|
100
100
|
"mocha": "^10.0.0",
|
|
101
101
|
"nyc": "^15.1.0",
|
|
102
|
-
"puppeteer": "^
|
|
102
|
+
"puppeteer": "^15.3.2",
|
|
103
103
|
"sinon": "^14.0.0",
|
|
104
|
-
"supertest": "^6.2.
|
|
104
|
+
"supertest": "^6.2.4",
|
|
105
105
|
"types.d.ts": "~0.6.7",
|
|
106
|
-
"typescript": "^4.
|
|
106
|
+
"typescript": "^4.7.4",
|
|
107
107
|
"why-is-node-running": "^2.2.2"
|
|
108
108
|
},
|
|
109
109
|
"engines": {
|