@ejfdelgado/ejflab-back 1.30.6 → 1.30.8
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 +4 -3
- package/srv/common/General.mjs +17 -5
package/package.json
CHANGED
@@ -1,14 +1,15 @@
|
|
1
1
|
{
|
2
2
|
"name": "@ejfdelgado/ejflab-back",
|
3
|
-
"version": "1.30.
|
3
|
+
"version": "1.30.8",
|
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": {
|
@@ -18,7 +19,7 @@
|
|
18
19
|
"license": "ISC",
|
19
20
|
"private": false,
|
20
21
|
"dependencies": {
|
21
|
-
"@ejfdelgado/ejflab-common": "1.16.
|
22
|
+
"@ejfdelgado/ejflab-common": "1.16.1",
|
22
23
|
"@google-cloud/compute": "^4.7.0",
|
23
24
|
"@google-cloud/firestore": "^7.9.0",
|
24
25
|
"@google-cloud/storage": "^7.11.3",
|
package/srv/common/General.mjs
CHANGED
@@ -79,11 +79,23 @@ export class General {
|
|
79
79
|
}
|
80
80
|
|
81
81
|
static getPaginationArguments(req, orderColumnDef = null) {
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
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
|
}
|