@jaypie/express 1.0.3 → 1.0.5

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/dist/module.cjs CHANGED
@@ -191,7 +191,11 @@ const expressHandler = (
191
191
  // * This is the first line of code that runs when a request is received
192
192
 
193
193
  // Update the public logger with the request ID
194
- core.log.tag({ invoke: getCurrentInvokeUuid() });
194
+ const invokeUuid = getCurrentInvokeUuid();
195
+ if (invokeUuid) {
196
+ core.log.tag({ invoke: invokeUuid });
197
+ core.log.tag({ shortInvoke: invokeUuid.slice(0, 8) });
198
+ }
195
199
 
196
200
  // Very low-level, internal sub-trace details
197
201
  const libLogger = core.log.lib({
@@ -222,6 +226,7 @@ const expressHandler = (
222
226
  status: res.status,
223
227
  statusSent: false,
224
228
  };
229
+ // eslint-disable-next-line no-shadow
225
230
  res.end = (...params) => {
226
231
  originalRes.attemptedCall = originalRes.end;
227
232
  originalRes.attemptedParams = params;
@@ -229,6 +234,7 @@ const expressHandler = (
229
234
  "[jaypie] Illegal call to res.end(); prefer Jaypie response conventions",
230
235
  );
231
236
  };
237
+ // eslint-disable-next-line no-shadow
232
238
  res.json = (...params) => {
233
239
  originalRes.attemptedCall = originalRes.json;
234
240
  originalRes.attemptedParams = params;
@@ -236,6 +242,7 @@ const expressHandler = (
236
242
  "[jaypie] Illegal call to res.json(); prefer Jaypie response conventions",
237
243
  );
238
244
  };
245
+ // eslint-disable-next-line no-shadow
239
246
  res.send = (...params) => {
240
247
  originalRes.attemptedCall = originalRes.send;
241
248
  originalRes.attemptedParams = params;
@@ -243,6 +250,7 @@ const expressHandler = (
243
250
  "[jaypie] Illegal call to res.send(); prefer Jaypie response conventions",
244
251
  );
245
252
  };
253
+ // eslint-disable-next-line no-shadow
246
254
  res.status = (...params) => {
247
255
  originalRes.statusSent = params;
248
256
  return originalRes.status(...params);
@@ -189,7 +189,11 @@ const expressHandler = (
189
189
  // * This is the first line of code that runs when a request is received
190
190
 
191
191
  // Update the public logger with the request ID
192
- log.tag({ invoke: getCurrentInvokeUuid() });
192
+ const invokeUuid = getCurrentInvokeUuid();
193
+ if (invokeUuid) {
194
+ log.tag({ invoke: invokeUuid });
195
+ log.tag({ shortInvoke: invokeUuid.slice(0, 8) });
196
+ }
193
197
 
194
198
  // Very low-level, internal sub-trace details
195
199
  const libLogger = log.lib({
@@ -220,6 +224,7 @@ const expressHandler = (
220
224
  status: res.status,
221
225
  statusSent: false,
222
226
  };
227
+ // eslint-disable-next-line no-shadow
223
228
  res.end = (...params) => {
224
229
  originalRes.attemptedCall = originalRes.end;
225
230
  originalRes.attemptedParams = params;
@@ -227,6 +232,7 @@ const expressHandler = (
227
232
  "[jaypie] Illegal call to res.end(); prefer Jaypie response conventions",
228
233
  );
229
234
  };
235
+ // eslint-disable-next-line no-shadow
230
236
  res.json = (...params) => {
231
237
  originalRes.attemptedCall = originalRes.json;
232
238
  originalRes.attemptedParams = params;
@@ -234,6 +240,7 @@ const expressHandler = (
234
240
  "[jaypie] Illegal call to res.json(); prefer Jaypie response conventions",
235
241
  );
236
242
  };
243
+ // eslint-disable-next-line no-shadow
237
244
  res.send = (...params) => {
238
245
  originalRes.attemptedCall = originalRes.send;
239
246
  originalRes.attemptedParams = params;
@@ -241,6 +248,7 @@ const expressHandler = (
241
248
  "[jaypie] Illegal call to res.send(); prefer Jaypie response conventions",
242
249
  );
243
250
  };
251
+ // eslint-disable-next-line no-shadow
244
252
  res.status = (...params) => {
245
253
  originalRes.statusSent = params;
246
254
  return originalRes.status(...params);
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@jaypie/express",
3
- "version": "1.0.3",
3
+ "version": "1.0.5",
4
4
  "author": "Finlayson Studio",
5
5
  "type": "module",
6
6
  "exports": {
7
7
  ".": {
8
8
  "default": {
9
- "require": "./dist/module.cjs.js",
9
+ "require": "./dist/module.cjs",
10
10
  "default": "./src/index.js"
11
11
  }
12
12
  }
@@ -42,18 +42,15 @@
42
42
  },
43
43
  "dependencies": {
44
44
  "@codegenie/serverless-express": "^4.14.1",
45
- "@jaypie/core": "^1.0.34",
45
+ "@jaypie/core": "^1.0.37",
46
46
  "@jaypie/testkit": "^1.0.19",
47
+ "eslint-config-jaypie": "^1.0.7",
47
48
  "mock-express-response": "^0.3.0"
48
49
  },
49
50
  "devDependencies": {
50
- "@rollup/plugin-commonjs": "^25.0.7",
51
+ "@rollup/plugin-commonjs": "^26.0.1",
51
52
  "@rollup/plugin-node-resolve": "^15.2.3",
52
53
  "eslint": "^8.57.0",
53
- "eslint-config-prettier": "^9.1.0",
54
- "eslint-plugin-import": "^2.29.1",
55
- "eslint-plugin-prettier": "^5.1.3",
56
- "eslint-plugin-vitest": "^0.5.4",
57
54
  "express": "^4.19.2",
58
55
  "hygen": "^6.2.11",
59
56
  "jest-extended": "^4.0.2",
@@ -42,7 +42,11 @@ const expressHandler = (
42
42
  // * This is the first line of code that runs when a request is received
43
43
 
44
44
  // Update the public logger with the request ID
45
- publicLogger.tag({ invoke: getCurrentInvokeUuid() });
45
+ const invokeUuid = getCurrentInvokeUuid();
46
+ if (invokeUuid) {
47
+ publicLogger.tag({ invoke: invokeUuid });
48
+ publicLogger.tag({ shortInvoke: invokeUuid.slice(0, 8) });
49
+ }
46
50
 
47
51
  // Very low-level, internal sub-trace details
48
52
  const libLogger = publicLogger.lib({
@@ -73,6 +77,7 @@ const expressHandler = (
73
77
  status: res.status,
74
78
  statusSent: false,
75
79
  };
80
+ // eslint-disable-next-line no-shadow
76
81
  res.end = (...params) => {
77
82
  originalRes.attemptedCall = originalRes.end;
78
83
  originalRes.attemptedParams = params;
@@ -80,6 +85,7 @@ const expressHandler = (
80
85
  "[jaypie] Illegal call to res.end(); prefer Jaypie response conventions",
81
86
  );
82
87
  };
88
+ // eslint-disable-next-line no-shadow
83
89
  res.json = (...params) => {
84
90
  originalRes.attemptedCall = originalRes.json;
85
91
  originalRes.attemptedParams = params;
@@ -87,6 +93,7 @@ const expressHandler = (
87
93
  "[jaypie] Illegal call to res.json(); prefer Jaypie response conventions",
88
94
  );
89
95
  };
96
+ // eslint-disable-next-line no-shadow
90
97
  res.send = (...params) => {
91
98
  originalRes.attemptedCall = originalRes.send;
92
99
  originalRes.attemptedParams = params;
@@ -94,6 +101,7 @@ const expressHandler = (
94
101
  "[jaypie] Illegal call to res.send(); prefer Jaypie response conventions",
95
102
  );
96
103
  };
104
+ // eslint-disable-next-line no-shadow
97
105
  res.status = (...params) => {
98
106
  originalRes.statusSent = params;
99
107
  return originalRes.status(...params);