ti2 1.0.52 → 1.0.53

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.
Files changed (2) hide show
  1. package/index.js +3 -3
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -177,7 +177,8 @@ module.exports = async ({
177
177
  10,
178
178
  );
179
179
  ti2Events.emit('request.end', {
180
- ...req.customBody,
180
+ ...body,
181
+ cacheKey: req.cacheKey,
181
182
  responseTimeInMs,
182
183
  responseStatusCode: res.statusCode,
183
184
  });
@@ -195,14 +196,13 @@ module.exports = async ({
195
196
  const body = req.customBody;
196
197
  if (cachingOperations.indexOf(body.operationId) > -1) {
197
198
  const cacheKey = hash(R.omit(['requestId', 'date'], body));
198
-
199
+ req.cacheKey = cacheKey;
199
200
  const foundCache = await cache.get({
200
201
  pluginName: body.params.appKey,
201
202
  key: cacheKey,
202
203
  });
203
204
  if (foundCache) {
204
205
  // console.log('foundCache', cacheKey);
205
- req.customBody.usedCache = cacheKey;
206
206
  res.json(foundCache);
207
207
  }
208
208
  const realSend = res.json;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ti2",
3
- "version": "1.0.52",
3
+ "version": "1.0.53",
4
4
  "description": "Tourist Industry Exchange (TI2)",
5
5
  "main": "index.js",
6
6
  "scripts": {