@villedemontreal/correlation-id 5.3.4 → 5.3.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.
|
@@ -5,4 +5,4 @@ import * as express from 'express';
|
|
|
5
5
|
* @param filter a filter which is going to be called with the request to see if a
|
|
6
6
|
* colleration id scope must be managed or not.
|
|
7
7
|
*/
|
|
8
|
-
export declare let createCorrelationIdMiddleware: (filter?: (req: express.Request) => boolean) => (req: express.Request, res: express.Response, next: express.NextFunction) =>
|
|
8
|
+
export declare let createCorrelationIdMiddleware: (filter?: (req: express.Request) => boolean) => (req: express.Request, res: express.Response, next: express.NextFunction) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"correlationIdMiddleware.js","sourceRoot":"","sources":["../../../src/middleware/correlationIdMiddleware.ts"],"names":[],"mappings":";;;AACA,uEAA6D;AAC7D,mDAAgD;AAChD,2EAAwE;AAExE;;;;;GAKG;AACI,IAAI,6BAA6B,GAAG,CACzC,MAA0C,
|
|
1
|
+
{"version":3,"file":"correlationIdMiddleware.js","sourceRoot":"","sources":["../../../src/middleware/correlationIdMiddleware.ts"],"names":[],"mappings":";;;AACA,uEAA6D;AAC7D,mDAAgD;AAChD,2EAAwE;AAExE;;;;;GAKG;AACI,IAAI,6BAA6B,GAAG,CACzC,MAA0C,EAC2C,EAAE;IACvF,MAAM,uBAAuB,GAAG,CAC9B,GAAoB,EACpB,GAAqB,EACrB,IAA0B,EACpB,EAAE;QACR,IAAI,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE;YAC1B,IAAI,EAAE,CAAC;SACR;aAAM;YACL,6CAA6C;YAC7C,kDAAkD;YAClD,oDAAoD;YACpD,EAAE;YACF,kCAAkC;YAClC,6CAA6C;YAC7C,IAAI,aAAa,GAAG,GAAG,CAAC,GAAG,CAAC,kCAAqB,CAAC,gBAAgB,CAAC,CAAC;YACpE,IAAI,CAAC,aAAa,EAAE;gBAClB,aAAa,GAAG,2CAAoB,CAAC,WAAW,EAAE,CAAC;gBACnD,GAAG,CAAC,qBAAS,CAAC,qBAAqB,CAAC,MAAM,CAAC,GAAG,aAAa,CAAC;aAC7D;iBAAM;gBACL,GAAG,CAAC,qBAAS,CAAC,qBAAqB,CAAC,oBAAoB,CAAC,GAAG,aAAa,CAAC;aAC3E;YACD,IAAI,CAAC,GAAG,CAAC,WAAW,EAAE;gBACpB,GAAG,CAAC,GAAG,CAAC,kCAAqB,CAAC,gBAAgB,EAAE,aAAa,CAAC,CAAC;aAChE;YACD,2CAAoB,CAAC,MAAM,CAAC,IAAI,EAAE,aAAa,CAAC,CAAC;SAClD;IACH,CAAC,CAAC;IAEF,OAAO,uBAAuB,CAAC;AACjC,CAAC,CAAC;AAhCS,QAAA,6BAA6B,iCAgCtC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@villedemontreal/correlation-id",
|
|
3
|
-
"version": "5.3.
|
|
3
|
+
"version": "5.3.5",
|
|
4
4
|
"description": "Express middleware to set a correlation in Express. The correlation id will be consistent across async calls within the handling of a request.",
|
|
5
5
|
"main": "dist/src/index.js",
|
|
6
6
|
"typings": "dist/src",
|
|
@@ -30,29 +30,29 @@
|
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@types/app-root-path": "1.2.4",
|
|
32
32
|
"@types/cls-hooked": "4.3.3",
|
|
33
|
-
"@types/lodash": "4.14.
|
|
33
|
+
"@types/lodash": "4.14.188",
|
|
34
34
|
"@types/uuid": "8.3.4",
|
|
35
|
-
"@villedemontreal/logger": "6.5.
|
|
35
|
+
"@villedemontreal/logger": "6.5.8",
|
|
36
36
|
"app-root-path": "3.1.0",
|
|
37
37
|
"cls-hooked": "4.2.2",
|
|
38
38
|
"http-header-fields-typed": "1.3.0",
|
|
39
39
|
"lodash": "4.17.21",
|
|
40
|
-
"semver": "7.3.
|
|
41
|
-
"uuid": "
|
|
40
|
+
"semver": "7.3.8",
|
|
41
|
+
"uuid": "8.3.2"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@types/chai": "4.3.3",
|
|
45
45
|
"@types/express": "4.17.14",
|
|
46
46
|
"@types/fs-extra": "9.0.13",
|
|
47
|
-
"@types/mocha": "
|
|
48
|
-
"@types/semver": "7.3.
|
|
47
|
+
"@types/mocha": "9.1.1",
|
|
48
|
+
"@types/semver": "7.3.13",
|
|
49
49
|
"@types/supertest": "2.0.12",
|
|
50
50
|
"@villedemontreal/scripting": "2.1.6",
|
|
51
51
|
"@villedemontreal/lint-config": "1.7.7",
|
|
52
52
|
"chai": "4.3.6",
|
|
53
|
-
"express": "4.18.
|
|
53
|
+
"express": "4.18.2",
|
|
54
54
|
"fs-extra": "10.1.0",
|
|
55
|
-
"mocha": "
|
|
55
|
+
"mocha": "9.2.2",
|
|
56
56
|
"mocha-jenkins-reporter": "0.4.8",
|
|
57
57
|
"supertest": "6.2.4",
|
|
58
58
|
"tslint": "6.1.3",
|
|
@@ -11,12 +11,12 @@ import { correlationIdService } from '../services/correlationIdService';
|
|
|
11
11
|
*/
|
|
12
12
|
export let createCorrelationIdMiddleware = (
|
|
13
13
|
filter?: (req: express.Request) => boolean
|
|
14
|
-
): ((req: express.Request, res: express.Response, next: express.NextFunction) =>
|
|
14
|
+
): ((req: express.Request, res: express.Response, next: express.NextFunction) => void) => {
|
|
15
15
|
const correlationIdMiddleware = (
|
|
16
16
|
req: express.Request,
|
|
17
17
|
res: express.Response,
|
|
18
18
|
next: express.NextFunction
|
|
19
|
-
):
|
|
19
|
+
): void => {
|
|
20
20
|
if (filter && !filter(req)) {
|
|
21
21
|
next();
|
|
22
22
|
} else {
|
|
@@ -38,7 +38,6 @@ export let createCorrelationIdMiddleware = (
|
|
|
38
38
|
}
|
|
39
39
|
correlationIdService.withId(next, correlationId);
|
|
40
40
|
}
|
|
41
|
-
return null;
|
|
42
41
|
};
|
|
43
42
|
|
|
44
43
|
return correlationIdMiddleware;
|