backend-plus 2.5.2-betha.10 → 2.5.2-betha.12
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/lib/backend-plus.d.ts +4 -16
- package/lib/backend-plus.js +7 -1
- package/lib/table-def-adapt.js +3 -0
- package/package.json +2 -1
package/lib/backend-plus.d.ts
CHANGED
|
@@ -189,7 +189,7 @@ export type FieldDefinition = EditableDbDefinition & {
|
|
|
189
189
|
defaultValue?:any
|
|
190
190
|
defaultDbValue?:PgKnownDbValues|string
|
|
191
191
|
clientSide?:string /* keyof: myOwn.clientSides */
|
|
192
|
-
isName?:boolean
|
|
192
|
+
isName?:boolean|'known' /* is a name but it is a well known name (because the user uses it to thier code or because the code is enugh expresive)
|
|
193
193
|
isPk?:number /* internal: pos in the primaryKey array */
|
|
194
194
|
serverSide?:boolean /* default:!clientSide if the value is retrived from the database */
|
|
195
195
|
inTable?:boolean /* default:!clientSide && !sql.fields[...].expr. Is a real fisical field in the table */
|
|
@@ -222,21 +222,8 @@ export type FieldDefinition = EditableDbDefinition & {
|
|
|
222
222
|
alwaysShow?:boolean /* show when appears in fixed fields */
|
|
223
223
|
suggestingKeys?:string[]
|
|
224
224
|
postInput?:PostInputOptions
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
sequence?: undefined
|
|
228
|
-
nullable?: boolean
|
|
229
|
-
editable?: boolean
|
|
230
|
-
} | {
|
|
231
|
-
sequence: SequenceDefinition
|
|
232
|
-
nullable: true
|
|
233
|
-
editable: false
|
|
234
|
-
} | {
|
|
235
|
-
sequence: SequenceMadMaxDefinition
|
|
236
|
-
nullable: true
|
|
237
|
-
editable: boolean
|
|
238
|
-
}
|
|
239
|
-
);
|
|
225
|
+
sequence?: SequenceDefinition|SequenceMadMaxDefinition
|
|
226
|
+
}
|
|
240
227
|
export type EditableDbDefinition = {
|
|
241
228
|
editable?:boolean
|
|
242
229
|
allow?:{
|
|
@@ -429,6 +416,7 @@ export interface AppConfigLogin
|
|
|
429
416
|
{
|
|
430
417
|
schema: string // schema of the user table
|
|
431
418
|
table: string // user table
|
|
419
|
+
from: string // complete expression to get table or join where get the user
|
|
432
420
|
userFieldname: string // fieldname in user table that stores the user name
|
|
433
421
|
passFieldname: string // fieldname in user table that stores the password hash
|
|
434
422
|
rolFieldname: string // fieldname in user table that stores the rol
|
package/lib/backend-plus.js
CHANGED
|
@@ -2423,10 +2423,16 @@ AppBackend.prototype.addLoggedServices = function addLoggedServices(){
|
|
|
2423
2423
|
throw err;
|
|
2424
2424
|
}
|
|
2425
2425
|
});
|
|
2426
|
-
be.app.get('/--version',function(req,res,next){
|
|
2426
|
+
be.app.get('/--version',async function(req,res,next){
|
|
2427
|
+
var simpleGit = require('simple-git');
|
|
2428
|
+
var git = simpleGit(process.cwd());
|
|
2427
2429
|
var info=[
|
|
2428
2430
|
html.h1(be.messages.server.versions),
|
|
2429
2431
|
html.h3([packagejson.name,' ',packagejson.version]),
|
|
2432
|
+
html.ul([
|
|
2433
|
+
html.li([(await git.revparse(['HEAD'])).trim()]),
|
|
2434
|
+
...((git.tags().all || []).map(tag => html.li([tag]))),
|
|
2435
|
+
])
|
|
2430
2436
|
];
|
|
2431
2437
|
Promise.resolve().then(function(){
|
|
2432
2438
|
if(be.isAdmin(req)){
|
package/lib/table-def-adapt.js
CHANGED
|
@@ -137,6 +137,9 @@ function tableDefAdapt(tableDef, context){
|
|
|
137
137
|
resultTableDef.field[fieldDef.name]=fieldDef;
|
|
138
138
|
if(fieldDef.isName){
|
|
139
139
|
resultTableDef.nameFields.push(fieldDef.name);
|
|
140
|
+
if (fieldDef.isName == 'known' && resultTableDef.hiddenColumns && !resultTableDef.hiddenColumns.includes(fieldDef.name)) {
|
|
141
|
+
resultTableDef.hiddenColumns.push(fieldDef.name);
|
|
142
|
+
}
|
|
140
143
|
}
|
|
141
144
|
return fieldDef;
|
|
142
145
|
});
|
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.5.2-betha.
|
|
4
|
+
"version": "2.5.2-betha.12",
|
|
5
5
|
"author": "Codenautas <codenautas@googlegroups.com>",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"repository": "codenautas/backend-plus",
|
|
@@ -68,6 +68,7 @@
|
|
|
68
68
|
"self-explain": "^0.11.0",
|
|
69
69
|
"serve-content": "^0.4.0",
|
|
70
70
|
"session-file-store": "^1.5.0",
|
|
71
|
+
"simple-git": "^3.18.0",
|
|
71
72
|
"sql-tools": "^0.1.2",
|
|
72
73
|
"stack-trace": "^0.0.10",
|
|
73
74
|
"stylus": "0.64.0",
|