@steedos/service-api 2.5.13 → 2.5.14-beta.2
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/index.js +5 -1
- package/package.json +6 -6
package/index.js
CHANGED
|
@@ -18,6 +18,7 @@ const { LRUMap } = require('lru_map');
|
|
|
18
18
|
const validator = require('validator');
|
|
19
19
|
const enablePlayground = validator.toBoolean(process.env.STEEDOS_GRAPHQL_ENABLE_CONSOLE || 'true', true);
|
|
20
20
|
const openBrowser = require('react-dev-utils/openBrowser');
|
|
21
|
+
const requestIp = require('request-ip');
|
|
21
22
|
const mixinOptions = {
|
|
22
23
|
|
|
23
24
|
// Global GraphQL typeDefs
|
|
@@ -170,10 +171,13 @@ module.exports = {
|
|
|
170
171
|
* @param {ServerResponse} res
|
|
171
172
|
* @param {Object} data
|
|
172
173
|
*
|
|
174
|
+
*
|
|
175
|
+
*/
|
|
173
176
|
onBeforeCall(ctx, route, req, res) {
|
|
174
177
|
// Set request headers to context meta
|
|
175
178
|
ctx.meta.userAgent = req.headers["user-agent"];
|
|
176
|
-
|
|
179
|
+
ctx.meta.clientIp = requestIp.getClientIp(req);
|
|
180
|
+
},
|
|
177
181
|
|
|
178
182
|
/**
|
|
179
183
|
* After call hook. You can modify the data.
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@steedos/service-api",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.14-beta.2",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"dependencies": {
|
|
7
|
-
"@steedos/auth": "2.5.
|
|
8
|
-
"@steedos/router": "2.5.
|
|
9
|
-
"@steedos/service-object-graphql": "2.5.
|
|
10
|
-
"@steedos/service-ui": "2.5.
|
|
7
|
+
"@steedos/auth": "2.5.14-beta.2",
|
|
8
|
+
"@steedos/router": "2.5.14-beta.2",
|
|
9
|
+
"@steedos/service-object-graphql": "2.5.14-beta.2",
|
|
10
|
+
"@steedos/service-ui": "2.5.14-beta.2",
|
|
11
11
|
"graphql": "^15.8.0",
|
|
12
12
|
"graphql-iso-date": "^3.6.1",
|
|
13
13
|
"graphql-type-json": "^0.3.2",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"publishConfig": {
|
|
23
23
|
"access": "public"
|
|
24
24
|
},
|
|
25
|
-
"gitHead": "
|
|
25
|
+
"gitHead": "2b1d2e94b7864718115349cebea39226c281d6c5",
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"@types/graphql-iso-date": "^3.4.0",
|
|
28
28
|
"@types/react-dev-utils": "^9.0.11"
|