backend-plus 2.1.9 → 2.2.1

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.
@@ -293,7 +293,7 @@ myOwn.TableConnector = function(context, opts){
293
293
  connector.pick = connector.opts.pick;
294
294
  connector.hideBecauseRelated = {};
295
295
  connector.fixedFields.forEach(function(pair){
296
- if(!pair.range && pair.value != myOwn.skipInFixedFields){
296
+ if(!pair.range && !pair.until && pair.value != myOwn.skipInFixedFields){
297
297
  connector.fixedField[pair.fieldName] = pair.value;
298
298
  if (!pair.show) {
299
299
  connector.hideBecauseRelated[pair.fieldName] = true;
@@ -332,6 +332,7 @@ export type TableDefinition = EditableDbDefinition & {
332
332
  selfRefresh?:boolean
333
333
  filterColumns?:{column:string, operator:string, value:any}[]
334
334
  gridAlias?:string /* front-end css my-table = gridAlias */
335
+ lookupFields?:string[] /* fields that should be used in lookup dialogs; if not specified, fields with isName:true are used */
335
336
  }
336
337
  export interface DetailTable { table?: string, fields: FieldsForConnectDetailTable, abr: string, label?: string, refreshParent?:boolean, refreshFromParent?:boolean, wScreen?:string, condition?:string }
337
338
  export type TableDefinitionFunction = (context: ContextForDump, opts?:any) => TableDefinition;
@@ -432,6 +433,7 @@ export interface AppConfigLogin
432
433
  forget: { // forget password configurations:
433
434
  urlPath: string // url sent by mail. default: `/new-pass`
434
435
  urlPathOk: string // confirmation page
436
+ urlComplete: string // the complete URL. To use when the proxy strips the req.hostname or shorts the path or ...
435
437
  mailFields: string[] // fields for the forget pass mail
436
438
 
437
439
  }
@@ -217,11 +217,9 @@ AppBackend.prototype.i18n.messages.en={
217
217
  email: "Email",
218
218
  invalidMail: "invalid email",
219
219
  mailSubject: "Password Reset Request",
220
- mailHtml: `You told us you forgot your password. If you really did, click here to choose a new one:
221
-
222
- <a href=""></a>
223
-
224
- If you didn’t mean to reset your password, then you can just ignore this email; your password will not change.`,
220
+ mailHtml: `<p>You told us you forgot your password. If you really did, click here to choose a new one:</p>
221
+ <p><a href=""></a></p>
222
+ <p>If you didn’t mean to reset your password, then you can just ignore this email; your password will not change.</p>`,
225
223
  mayBeMailSent: "Mail sent if found.",
226
224
  return: "I know my password. Go to login.",
227
225
  title: "Forgot password form",
@@ -305,11 +303,9 @@ AppBackend.prototype.i18n.messages.es={
305
303
  email: "e-mail",
306
304
  invalidMail: "la dirección de mail es incorrecta",
307
305
  mailSubject: "Pedido de cambio de contraseña",
308
- mailHtml: `Recibimos un pedido de cambio de contraseña. Si el pedido es correcto utilice el siguiente enlace:
309
-
310
- <a href=""></a>
311
-
312
- Si el pedido no lo hizo usted desestime el mail. Su contraseña seguirá siendo la misma.`,
306
+ mailHtml: `<p>Recibimos un pedido de cambio de contraseña. Si el pedido es correcto utilice el siguiente enlace:</p>
307
+ <p><a href=""></a></p>
308
+ <p>Si el pedido no lo hizo usted desestime el mail. Su contraseña seguirá siendo la misma.</p>`,
313
309
  mayBeMailSent: "Se procede a buscar el usuario correspondiente al email. Si se encuentra se envia al mismo un correo que permite cambiar la contraseña. Si envió más de un formulario solo el último es válido.",
314
310
  return: "Recuerdo mi contraseña. Ir a la pantalla de ingreso.",
315
311
  title: "Formulario de recuperación de contraseña",
@@ -1848,10 +1844,10 @@ AppBackend.prototype.addUnloggedServices = function addUnloggedServices(mainApp,
1848
1844
  `, [req.body.email.toLowerCase()]).fetchAll();
1849
1845
  if(rows?.length>0){
1850
1846
  await client.query(
1851
- "insert into tokens(token, tokentype, date, username, useragent, due) values ($1, 'new-pass', $2, $3, $4, $5) returning token",
1847
+ "insert into his.tokens(token, tokentype, date, username, useragent, due) values ($1, 'new-pass', $2, $3, $4, $5) returning token",
1852
1848
  [token, now, rows[0].username, req.useragent, now.add({days:1})]
1853
1849
  ).fetchUniqueRow();
1854
- var chpath = req.protocol+'://' +Path.posix.join(req.hostname+baseUrl,'new-pass')+
1850
+ var chpath = (be.config.login.forget?.urlDomainAndRoot ?? req.protocol+'://' +Path.posix.join(req.hostname+baseUrl,'new-pass')) +
1855
1851
  '?token='+token+'&nueva=clave';
1856
1852
  // console.log('chpass', chpath)
1857
1853
  await be.sendMail({
@@ -1880,7 +1876,7 @@ AppBackend.prototype.addUnloggedServices = function addUnloggedServices(mainApp,
1880
1876
  var promise = be.inDbClient(req, async (client)=>{
1881
1877
  var now = bestGlobals.datetime.now();
1882
1878
  var {row} = await client.query(`select *
1883
- from tokens
1879
+ from his.tokens
1884
1880
  where tokentype = 'new-pass' and token = $1
1885
1881
  and due > $2
1886
1882
  limit 1;
@@ -1909,7 +1905,7 @@ AppBackend.prototype.addUnloggedServices = function addUnloggedServices(mainApp,
1909
1905
  var promise = be.inDbClient(req, async (client)=>{
1910
1906
  var now = bestGlobals.datetime.now();
1911
1907
  var {row} = await client.query(`select *
1912
- from tokens
1908
+ from his.tokens
1913
1909
  where tokentype = 'new-pass' and token = $1
1914
1910
  and $2 < due
1915
1911
  limit 1;
@@ -1932,7 +1928,7 @@ AppBackend.prototype.addUnloggedServices = function addUnloggedServices(mainApp,
1932
1928
  })
1933
1929
  })
1934
1930
  res.redirect(Path.posix.join(baseUrl, be.config.login.noLoggedUrlPath || '/login'));
1935
- await client.query(`update tokens set due = null
1931
+ await client.query(`update his.tokens set due = null
1936
1932
  where tokentype = 'new-pass' and token = $1;
1937
1933
  `, [req.body.token]).execute();
1938
1934
  })
@@ -613,7 +613,7 @@ ProcedureTables = [
613
613
  var be=context.be;
614
614
  return Promise.resolve().then(function(){
615
615
  return client.query(
616
- "insert into tokens(token, date, username, useragent) values (md5($1), $2, $3, $4) returning token",
616
+ "insert into his.tokens(token, date, username, useragent) values (md5($1), $2, $3, $4) returning token",
617
617
  [token, now, parameters.username, parameters.useragent]
618
618
  ).fetchUniqueRow();
619
619
  }).then(function(result){
@@ -22,7 +22,7 @@ module.exports = function(context){
22
22
  ],
23
23
  sql:{
24
24
  isTable: true,
25
- from: `(select * from tokens order by date desc)`,
25
+ from: `(select * from his.tokens order by date desc)`,
26
26
  skipEnance:true,
27
27
  },
28
28
  }, context);
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.1.9",
4
+ "version": "2.2.1",
5
5
  "author": "Codenautas <codenautas@googlegroups.com>",
6
6
  "license": "MIT",
7
7
  "repository": "codenautas/backend-plus",
@@ -76,13 +76,13 @@
76
76
  "devDependencies": {
77
77
  "@types/big.js": "^6.2.2",
78
78
  "@types/expect.js": "~0.3.32",
79
- "@types/express": "^5.0.0",
79
+ "@types/express": "^5.0.1",
80
80
  "@types/express-useragent": "^1.0.5",
81
81
  "@types/fs-extra": "^11.0.4",
82
82
  "@types/js-yaml": "^4.0.9",
83
83
  "@types/mocha": "^10.0.10",
84
84
  "@types/multiparty": "~4.2.1",
85
- "@types/node": "^22.13.4",
85
+ "@types/node": "^22.13.13",
86
86
  "@types/nodemailer": "^6.4.17",
87
87
  "@types/numeral": "~2.0.5",
88
88
  "@types/session-file-store": "^1.2.5",
@@ -99,11 +99,11 @@
99
99
  "kill-9": "~0.4.3",
100
100
  "mocha": "^11.1.0",
101
101
  "nyc": "^17.1.0",
102
- "puppeteer": "^24.2.1",
103
- "sinon": "^19.0.2",
104
- "supertest": "^7.0.0",
102
+ "puppeteer": "^24.4.0",
103
+ "sinon": "^19.0.4",
104
+ "supertest": "^7.1.0",
105
105
  "types.d.ts": "~0.6.22",
106
- "typescript": "^5.7.3",
106
+ "typescript": "^5.8.2",
107
107
  "why-is-node-running": "^3.2.2"
108
108
  },
109
109
  "engines": {