@ejfdelgado/ejflab-back 1.30.7 → 1.30.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/package.json CHANGED
@@ -1,14 +1,15 @@
1
1
  {
2
2
  "name": "@ejfdelgado/ejflab-back",
3
- "version": "1.30.7",
3
+ "version": "1.30.9",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/ejfdelgado/ejflab-back.git"
7
7
  },
8
8
  "description": "",
9
9
  "scripts": {
10
+ "bip": "ffplay /sound/finish.mp3 -nodisp -nostats -hide_banner -autoexit",
10
11
  "mylogin": "npm login",
11
- "mypublish": "npm install && npm publish --access=public",
12
+ "mypublish": "npm install && npm publish --access=public && npm run bip",
12
13
  "clean": "rm -rf node_modules && npm cache clean --force && rm package-lock.json && npm install"
13
14
  },
14
15
  "engines": {
@@ -15,8 +15,10 @@ export class MainHandler {
15
15
  static async handle(req, res, next) {
16
16
  const originalUrl = req.getUrl();
17
17
  const theUrl = url.parse(originalUrl);
18
- if (theUrl.pathname == "/socket.io/") {
19
- return next();
18
+ //console.log(`theUrl.pathname = ${theUrl.pathname}`);
19
+ if (theUrl.pathname == "/socket.io/" || theUrl.pathname.startsWith("/srv/")) {
20
+ //next(); // it can't call no one after then...
21
+ return;
20
22
  }
21
23
  const rutas = MainHandler.decodeUrl(theUrl);
22
24
  const encoding = req.query.encoding;
@@ -79,11 +79,23 @@ export class General {
79
79
  }
80
80
 
81
81
  static getPaginationArguments(req, orderColumnDef = null) {
82
- const limit = parseInt(General.readParam(req, "limit", General.PAGE_SIZE_DEFAULT));
83
- const orderColumn = General.readParam(req, "orderColumn", orderColumnDef);
84
- const direction = General.readParam(req, "direction", General.PAGE_DIRECTION).toLowerCase();
85
- const page = parseInt(General.readParam(req, "page", null));
86
- const offsetProvided = parseInt(General.readParam(req, "offset", null));
82
+ let predefined = {
83
+ orderColumn: null,
84
+ limit: General.PAGE_SIZE_DEFAULT,
85
+ offset: null,
86
+ page: null,
87
+ direction: General.PAGE_DIRECTION
88
+ }
89
+ if (typeof orderColumnDef == "object") {
90
+ predefined = Object.assign(predefined, orderColumnDef);
91
+ } else if (typeof orderColumnDef == "string") {
92
+ predefined.orderColumn = orderColumnDef;
93
+ }
94
+ const limit = parseInt(General.readParam(req, "limit", predefined.limit));
95
+ const orderColumn = General.readParam(req, "orderColumn", predefined.orderColumn);
96
+ const direction = General.readParam(req, "direction", predefined.direction).toLowerCase();
97
+ const page = parseInt(General.readParam(req, "page", predefined.page));
98
+ const offsetProvided = parseInt(General.readParam(req, "offset", predefined.offset));
87
99
  if (!(typeof limit == "number")) {
88
100
  throw new MalaPeticionException("limit is expected to be a number");
89
101
  }