jxp 2.10.1 → 2.11.0
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/libs/jxp.js +10 -0
- package/package.json +17 -17
package/libs/jxp.js
CHANGED
|
@@ -81,6 +81,13 @@ const outputCSV = (req, res) => {
|
|
|
81
81
|
const actionGet = async (req, res, next) => {
|
|
82
82
|
const opname = `get ${req.modelname} ${ops++}`;
|
|
83
83
|
console.time(opname);
|
|
84
|
+
try {
|
|
85
|
+
if (res.user) {
|
|
86
|
+
req.Model.__user = res.user;
|
|
87
|
+
}
|
|
88
|
+
} catch(err) {
|
|
89
|
+
console.error(err);
|
|
90
|
+
}
|
|
84
91
|
const parseSearch = function(search) {
|
|
85
92
|
let result = {};
|
|
86
93
|
for (let i in search) {
|
|
@@ -189,6 +196,9 @@ const actionGetOne = async (req, res) => {
|
|
|
189
196
|
const opname = `getOne ${req.modelname}/${req.params.item_id} ${ops++}`;
|
|
190
197
|
console.time(opname);
|
|
191
198
|
try {
|
|
199
|
+
if (res.user) {
|
|
200
|
+
req.Model.__user = res.user;
|
|
201
|
+
}
|
|
192
202
|
const data = await getOne(req.Model, req.params.item_id, req.query);
|
|
193
203
|
res.send({ data });
|
|
194
204
|
if (debug) console.timeEnd(opname);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jxp",
|
|
3
3
|
"description:": "An opinionated RESTful API library based on Mongoose and Restify. Make an API by just writing Mongoose models.",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.11.0",
|
|
5
5
|
"private": false,
|
|
6
6
|
"main": "libs/jxp.js",
|
|
7
7
|
"scripts": {
|
|
@@ -27,38 +27,38 @@
|
|
|
27
27
|
"url": "https://github.com/j-norwood-young/jexpress-2/issues"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"axios": "^
|
|
30
|
+
"axios": "^1.2.0",
|
|
31
31
|
"bcryptjs": "^2.4.3",
|
|
32
|
-
"commander": "^
|
|
33
|
-
"config": "^3.3.
|
|
34
|
-
"dotenv": "^
|
|
35
|
-
"glob": "
|
|
32
|
+
"commander": "^9.4.1",
|
|
33
|
+
"config": "^3.3.8",
|
|
34
|
+
"dotenv": "^16.0.3",
|
|
35
|
+
"glob": "8.0.3",
|
|
36
36
|
"js-yaml": "4.1.0",
|
|
37
|
-
"json2csv": "^5.0.
|
|
37
|
+
"json2csv": "^5.0.7",
|
|
38
38
|
"jsonwebtoken": "^8.5.1",
|
|
39
|
-
"jstransformer-markdown-it": "^
|
|
40
|
-
"jxp-helper": "^1.
|
|
39
|
+
"jstransformer-markdown-it": "^3.0.0",
|
|
40
|
+
"jxp-helper": "^1.4.0",
|
|
41
41
|
"mkdirp": "^1.0.4",
|
|
42
|
-
"mongoose": "6.
|
|
42
|
+
"mongoose": "6.7.3",
|
|
43
43
|
"mongoose-friendly": "^0.1.4",
|
|
44
44
|
"morgan": "^1.10.0",
|
|
45
|
-
"nodemailer": "^6.
|
|
45
|
+
"nodemailer": "^6.8.0",
|
|
46
46
|
"nodemailer-smtp-transport": "^2.7.4",
|
|
47
47
|
"path": "^0.12.7",
|
|
48
48
|
"pug": "^3.0.2",
|
|
49
49
|
"querystring": "^0.2.1",
|
|
50
50
|
"rand-token": "^1.0.1",
|
|
51
51
|
"readline-sync": "^1.4.10",
|
|
52
|
-
"restify": "^
|
|
52
|
+
"restify": "^9.0.0",
|
|
53
53
|
"restify-cors-middleware": "^1.1.1",
|
|
54
|
-
"traverse": "^0.6.
|
|
55
|
-
"underscore": "^1.13.
|
|
56
|
-
"ws": "^8.
|
|
54
|
+
"traverse": "^0.6.7",
|
|
55
|
+
"underscore": "^1.13.6",
|
|
56
|
+
"ws": "^8.11.0"
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
|
-
"chai": "^4.3.
|
|
59
|
+
"chai": "^4.3.7",
|
|
60
60
|
"chai-http": "^4.3.0",
|
|
61
|
-
"mocha": "^
|
|
61
|
+
"mocha": "^10.1.0",
|
|
62
62
|
"should": "^13.2.3"
|
|
63
63
|
}
|
|
64
64
|
}
|