backend-plus 1.16.6 → 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 +34 -20
- package/package.json +13 -13
- package/unlogged/auto-login.js +7 -1
|
@@ -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
|
}
|
|
@@ -967,6 +966,9 @@ AppBackend.prototype.start = function start(opts){
|
|
|
967
966
|
}else if(data.row.locked){
|
|
968
967
|
done(null,false,{message:be.messages.unlogged.login.lockedFail});
|
|
969
968
|
}else{
|
|
969
|
+
if(req.query["return-to"]){
|
|
970
|
+
req.session.loginReturnTo = req.query["return-to"];
|
|
971
|
+
}
|
|
970
972
|
done(null, data.row);
|
|
971
973
|
}
|
|
972
974
|
}else{
|
|
@@ -2463,6 +2465,31 @@ AppBackend.prototype.dumpFkConstraint = function dumpFkConstraint(fk, tableDef,
|
|
|
2463
2465
|
return {consName, clause, sourceFieldList};
|
|
2464
2466
|
}
|
|
2465
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
|
+
|
|
2466
2493
|
AppBackend.prototype.dumpDbSchemaPartial = async function dumpDbSchemaPartial(partialTableStructures, opts = {}){
|
|
2467
2494
|
var complete = opts.complete;
|
|
2468
2495
|
var be = this;
|
|
@@ -2530,21 +2557,8 @@ AppBackend.prototype.dumpDbSchemaPartial = async function dumpDbSchemaPartial(pa
|
|
|
2530
2557
|
throw new Error('table '+tableDef.sql.tableName+' has viewBody. It must has isTable=false');
|
|
2531
2558
|
}
|
|
2532
2559
|
lines.push('create table '+cualQuoteTableName+' (');
|
|
2533
|
-
var fields=
|
|
2534
|
-
|
|
2535
|
-
if(!fieldDef.clientSide && fieldDef.inTable!==false && !fieldDef.inJoin && !(tableDef.sql.fields[fieldDef.name]||{}).expr || fieldDef.inTable){
|
|
2536
|
-
var fieldType=typeDb[fieldDef.typeName]||'"'+fieldDef.typeName+'"';
|
|
2537
|
-
if(fieldDef.sizeByte==4){
|
|
2538
|
-
fieldType = 'integer';
|
|
2539
|
-
}
|
|
2540
|
-
fields.push(
|
|
2541
|
-
' '+db.quoteIdent(fieldDef.name)+
|
|
2542
|
-
' '+(fieldDef.dataLength?(fieldType=='text'?'varchar':fieldType)+'('+fieldDef.dataLength+')':fieldType)+
|
|
2543
|
-
(fieldDef.defaultValue!=null?' default '+db.quoteLiteral(fieldDef.defaultValue):'')+
|
|
2544
|
-
(fieldDef.defaultDbValue!=null?' default '+fieldDef.defaultDbValue:'')+
|
|
2545
|
-
(fieldDef.sequence && !fieldDef.sequence.name?' generated always as identity':'')+
|
|
2546
|
-
(fieldDef.generatedAs!=null?` generated always as (${fieldDef.generatedAs}) stored`:'')
|
|
2547
|
-
);
|
|
2560
|
+
var fields = be.dumpDbTableFields(tableDef, opts,
|
|
2561
|
+
function complements(fieldDef){
|
|
2548
2562
|
if(fieldDef.sequence && !fieldDef.sequence.name){
|
|
2549
2563
|
tablesWithStrictSequence[tableName]={}
|
|
2550
2564
|
}
|
|
@@ -2569,11 +2583,11 @@ AppBackend.prototype.dumpDbSchemaPartial = async function dumpDbSchemaPartial(pa
|
|
|
2569
2583
|
' alter column '+db.quoteIdent(fieldDef.name)+' set not null;'
|
|
2570
2584
|
);
|
|
2571
2585
|
}
|
|
2586
|
+
if(fieldDef.sequence && fieldDef.sequence.name){
|
|
2587
|
+
fieldsForSequences.push(fieldDef);
|
|
2588
|
+
}
|
|
2572
2589
|
}
|
|
2573
|
-
|
|
2574
|
-
fieldsForSequences.push(fieldDef);
|
|
2575
|
-
}
|
|
2576
|
-
});
|
|
2590
|
+
);
|
|
2577
2591
|
lines.push(fields.join(', \n'));
|
|
2578
2592
|
if(tableDef.primaryKey){
|
|
2579
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,10 +41,10 @@
|
|
|
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
|
-
"js-to-html": "^1.3.
|
|
47
|
+
"js-to-html": "^1.3.2",
|
|
48
48
|
"js-yaml": "^4.1.0",
|
|
49
49
|
"json4all": "^1.1.0",
|
|
50
50
|
"lazy-some": "^0.1.0",
|
|
@@ -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": {
|
package/unlogged/auto-login.js
CHANGED
|
@@ -4,6 +4,7 @@ function gotoEmptyFieldOrSubmit(event){
|
|
|
4
4
|
if(location.hash){
|
|
5
5
|
sessionStorage.setItem('backend-plus-hash-redirect',location.hash);
|
|
6
6
|
}
|
|
7
|
+
var loginForm = document.getElementById('loginForm');
|
|
7
8
|
if(document.getElementById('username').value==''){
|
|
8
9
|
document.getElementById('username').focus();
|
|
9
10
|
event.preventDefault();
|
|
@@ -15,6 +16,9 @@ function gotoEmptyFieldOrSubmit(event){
|
|
|
15
16
|
loginForm.submit();
|
|
16
17
|
},500);
|
|
17
18
|
}
|
|
19
|
+
if(location.search){
|
|
20
|
+
loginForm.action = loginForm.action + location.search;
|
|
21
|
+
}
|
|
18
22
|
}
|
|
19
23
|
|
|
20
24
|
window.addEventListener('load',function(){
|
|
@@ -42,6 +46,8 @@ window.addEventListener('load',function(){
|
|
|
42
46
|
setTimeout(function(){
|
|
43
47
|
location = gotoLoginElement.href;
|
|
44
48
|
},5000)
|
|
49
|
+
gotoLoginElement.focus()
|
|
50
|
+
}else{
|
|
51
|
+
controlar_compatibilidad();
|
|
45
52
|
}
|
|
46
|
-
controlar_compatibilidad();
|
|
47
53
|
})
|