backend-plus 2.0.0-beta.1 → 2.0.0-beta.4
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/my-tables.js +1 -1
- package/lib/backend-plus.d.ts +1 -0
- package/lib/backend-plus.js +14 -8
- package/lib/procedures-table.js +3 -0
- package/lib/tables/table-bitacora.js +2 -1
- package/lib/tables/table-locks.js +1 -0
- package/lib/tables/table-summary.js +1 -0
- package/lib/tables/table-tokens.js +1 -0
- package/package.json +6 -6
package/for-client/my-tables.js
CHANGED
|
@@ -652,7 +652,7 @@ myOwn.tableGrid = function tableGrid(tableName, mainElement, opts){
|
|
|
652
652
|
if (myOwn.config.config['grid-row-retain-moved-or-deleted']) {
|
|
653
653
|
var depotsToRetain = grid.depots.filter(depot => depot.tick == tick);
|
|
654
654
|
for (depot of depotsToRetain) {
|
|
655
|
-
if (depot.tr.getAttribute('not-here')) depot.tr.removeAttribute('not-here')
|
|
655
|
+
if (depot.tr && depot.tr.getAttribute('not-here')) depot.tr.removeAttribute('not-here')
|
|
656
656
|
}
|
|
657
657
|
}
|
|
658
658
|
while (depot = depotsToDelete.pop()) {
|
package/lib/backend-plus.d.ts
CHANGED
package/lib/backend-plus.js
CHANGED
|
@@ -616,6 +616,7 @@ AppBackend.prototype.start = function start(opts){
|
|
|
616
616
|
console.log('*','express server');
|
|
617
617
|
be.server.close(/** @param {Error} err */function(err){
|
|
618
618
|
if(err){
|
|
619
|
+
console.log('*', err)
|
|
619
620
|
reject(err);
|
|
620
621
|
}else{
|
|
621
622
|
resolve();
|
|
@@ -989,21 +990,20 @@ AppBackend.prototype.start = function start(opts){
|
|
|
989
990
|
done(null,false,{message:be.messages.unlogged.login.userOrPassFail});
|
|
990
991
|
}
|
|
991
992
|
}).then(async function(userInfo){
|
|
993
|
+
if (!userInfo) return;
|
|
992
994
|
if (!be.config.login.skipBitacora) {
|
|
993
995
|
var context = be.getContext(req);
|
|
994
|
-
var sessionInfo = client.query(be.generateInsertSQL(be.config.server.bitacoraSchema, be.config.server.bitacoraTableName,{
|
|
996
|
+
var sessionInfo = await client.query(be.generateInsertSQL(be.config.server.bitacoraSchema, be.config.server.bitacoraTableName,{
|
|
995
997
|
procedure_name: '@login',
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
}
|
|
998
|
+
username,
|
|
999
|
+
machine_id: context.machineId,
|
|
1000
|
+
navigator: context.navigator,
|
|
1001
|
+
init_date: bestGlobals.datetime.now(),
|
|
1002
|
+
parameters: {}
|
|
1002
1003
|
})).fetchUniqueValue();
|
|
1003
1004
|
userInfo.bitacoraId = sessionInfo.value;
|
|
1004
1005
|
}
|
|
1005
1006
|
done(null, userInfo);
|
|
1006
|
-
return userInfo;
|
|
1007
1007
|
}).then(function(){
|
|
1008
1008
|
client.done();
|
|
1009
1009
|
}).catch(function(err){
|
|
@@ -1233,6 +1233,7 @@ AppBackend.prototype.checkDatabaseStructure = async function checkDatabaseStruct
|
|
|
1233
1233
|
alter table his.bitacora alter column id type bigint;
|
|
1234
1234
|
grant usage on schema his to ${be.config.db.user};
|
|
1235
1235
|
grant select, insert, update on his.bitacora to ${be.config.db.user};
|
|
1236
|
+
alter table his.bitacora alter column parameters_definition drop not null;
|
|
1236
1237
|
`;
|
|
1237
1238
|
throw new Error(message);
|
|
1238
1239
|
}
|
|
@@ -2596,8 +2597,13 @@ AppBackend.prototype.dumpDbSchemaPartial = async function dumpDbSchemaPartial(pa
|
|
|
2596
2597
|
var schema=db.quoteIdent(be.config.db.schema);
|
|
2597
2598
|
linesCreate.push("set role to "+owner+";");
|
|
2598
2599
|
linesCreate.push("drop schema if exists "+schema+' cascade;');
|
|
2600
|
+
if (be.config.install.dump["drop-his"]) {
|
|
2601
|
+
linesCreate.push("drop schema if exists his cascade;");
|
|
2602
|
+
}
|
|
2599
2603
|
linesCreate.push("create schema "+schema+';');
|
|
2600
2604
|
linesCreate.push("grant usage on schema "+schema+' to '+user+';');
|
|
2605
|
+
linesCreate.push("create schema if not exists his;");
|
|
2606
|
+
linesCreate.push("grant usage on schema his to "+user+';');
|
|
2601
2607
|
if(be.config.install.dump["admin-can-create-tables"]){
|
|
2602
2608
|
linesCreate.push("grant create on schema "+schema+' to '+user+';');
|
|
2603
2609
|
}
|
package/lib/procedures-table.js
CHANGED
|
@@ -189,6 +189,9 @@ ProcedureTables = [
|
|
|
189
189
|
var updateTarget = {}
|
|
190
190
|
for(var name in parameters.newRow){
|
|
191
191
|
var defField=mainDefTable.field[name];
|
|
192
|
+
if (!defField) {
|
|
193
|
+
throw new Error("field "+name+" does not exist in "+mainDefTable.name);
|
|
194
|
+
}
|
|
192
195
|
if(!defField.allow[action] && (!opts || !opts.forImport) && (
|
|
193
196
|
!defField.isPk ||
|
|
194
197
|
parameters.primaryKeyValues[defField.isPk-1]!=parameters.newRow[name]
|
|
@@ -2,15 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
module.exports = function(context){
|
|
4
4
|
const BITACORA_TABLENAME = context.be.config.server.bitacoraTableName;
|
|
5
|
+
const BITACORA_SCHEMA = context.be.config.server.bitacoraSchema;
|
|
5
6
|
return context.be.tableDefAdapt({
|
|
6
7
|
name:'bitacora',
|
|
7
8
|
title:'Bitacora',
|
|
8
9
|
tableName: BITACORA_TABLENAME,
|
|
10
|
+
schema: BITACORA_SCHEMA,
|
|
9
11
|
editable:context.forDump,
|
|
10
12
|
fields:[
|
|
11
13
|
{name:'id' , typeName:'bigint' , nullable:false, sequence:{name: 'secuencia_bitacora', firstValue: 1}},
|
|
12
14
|
{name:'procedure_name' , typeName:'text' , nullable:false },
|
|
13
|
-
{name:'parameters_definition' , typeName:'text' , nullable:false },
|
|
14
15
|
{name:'parameters' , typeName:'text' , nullable:false },
|
|
15
16
|
{name:'username' , typeName:'text' , nullable:false },
|
|
16
17
|
{name:'machine_id' , typeName:'text' , nullable:false },
|
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-beta.
|
|
4
|
+
"version": "2.0.0-beta.4",
|
|
5
5
|
"author": "Codenautas <codenautas@googlegroups.com>",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"repository": "codenautas/backend-plus",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"mini-tools": "^1.12.1",
|
|
55
55
|
"moment": "^2.29.4",
|
|
56
56
|
"multiparty": "^4.2.3",
|
|
57
|
-
"nodemailer": "^6.9.
|
|
57
|
+
"nodemailer": "^6.9.4",
|
|
58
58
|
"numeral": "^2.0.6",
|
|
59
59
|
"pg-promise-strict": "^1.3.3",
|
|
60
60
|
"pikaday": "^1.8.2",
|
|
@@ -81,8 +81,8 @@
|
|
|
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": "^20.
|
|
85
|
-
"@types/nodemailer": "^6.4.
|
|
84
|
+
"@types/node": "^20.4.5",
|
|
85
|
+
"@types/nodemailer": "^6.4.9",
|
|
86
86
|
"@types/numeral": "~2.0.2",
|
|
87
87
|
"@types/session-file-store": "^1.2.2",
|
|
88
88
|
"@types/stack-trace": "~0.0.30",
|
|
@@ -98,10 +98,10 @@
|
|
|
98
98
|
"kill-9": "~0.4.3",
|
|
99
99
|
"mocha": "^10.2.0",
|
|
100
100
|
"nyc": "^15.1.0",
|
|
101
|
-
"puppeteer": "^20.
|
|
101
|
+
"puppeteer": "^20.9.0",
|
|
102
102
|
"sinon": "^15.2.0",
|
|
103
103
|
"supertest": "^6.3.3",
|
|
104
|
-
"types.d.ts": "~0.6.
|
|
104
|
+
"types.d.ts": "~0.6.16",
|
|
105
105
|
"typescript": "^5.1.6",
|
|
106
106
|
"why-is-node-running": "^2.2.2"
|
|
107
107
|
},
|