@napp/dti-server 3.0.7 → 3.0.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/adapter.js +20 -15
- package/package.json +2 -2
package/adapter.js
CHANGED
|
@@ -101,23 +101,28 @@ var ServerAdapter = /** @class */ (function () {
|
|
|
101
101
|
return req.query;
|
|
102
102
|
};
|
|
103
103
|
ServerAdapter.prototype.callAction = function (it, req, res, next) {
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
.
|
|
110
|
-
|
|
111
|
-
if (rsu.
|
|
112
|
-
|
|
104
|
+
try {
|
|
105
|
+
if (it.actionFunc) {
|
|
106
|
+
var q = this.qParam(it, req);
|
|
107
|
+
var b = req.body;
|
|
108
|
+
it.check(q || {}, b || {});
|
|
109
|
+
return it.actionFunc({ q: q, b: b }, { req: req, res: res })
|
|
110
|
+
.then(function (rsu) {
|
|
111
|
+
if (rsu instanceof response_1.DtiResponse) {
|
|
112
|
+
if (rsu.handle) {
|
|
113
|
+
return rsu.handle(res);
|
|
114
|
+
}
|
|
115
|
+
return res.end();
|
|
113
116
|
}
|
|
114
|
-
return res.
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
}
|
|
118
|
-
|
|
117
|
+
return res.json(rsu);
|
|
118
|
+
})
|
|
119
|
+
.catch(function (err) { return next(err); });
|
|
120
|
+
}
|
|
121
|
+
throw new Error('not found action handle');
|
|
122
|
+
}
|
|
123
|
+
catch (error) {
|
|
124
|
+
return next(error);
|
|
119
125
|
}
|
|
120
|
-
return next(new Error('not found action handle'));
|
|
121
126
|
};
|
|
122
127
|
ServerAdapter.prototype.getBodyParser = function (it) {
|
|
123
128
|
if (this.bodyParser) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@napp/dti-server",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.8",
|
|
4
4
|
"description": "data transaction interface server library",
|
|
5
5
|
"types": "index.d.ts",
|
|
6
6
|
"main": "index.js",
|
|
@@ -12,6 +12,6 @@
|
|
|
12
12
|
"author": "Farcek <farcek@gmail.com>",
|
|
13
13
|
"license": "ISC",
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@napp/dti-core": "3.0.
|
|
15
|
+
"@napp/dti-core": "3.0.8"
|
|
16
16
|
}
|
|
17
17
|
}
|