@golemio/ndic 1.0.6-dev.418535267 → 1.0.6-dev.425924702
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.
|
@@ -14,23 +14,26 @@ const express_1 = require("@golemio/core/dist/shared/express");
|
|
|
14
14
|
const helpers_1 = require("@golemio/core/dist/input-gateway/helpers");
|
|
15
15
|
const TrafficInfoController_1 = require("./TrafficInfoController");
|
|
16
16
|
const TrafficRestrictionsController_1 = require("./TrafficRestrictionsController");
|
|
17
|
+
const monitoring_1 = require("@golemio/core/dist/monitoring");
|
|
17
18
|
class NdicRouter {
|
|
18
19
|
constructor() {
|
|
19
|
-
this.router = express_1.Router();
|
|
20
|
+
this.router = (0, express_1.Router)();
|
|
20
21
|
this.trafficInfoController = new TrafficInfoController_1.TrafficInfoController();
|
|
21
22
|
this.trafficRestrictionsController = new TrafficRestrictionsController_1.TrafficRestrictionsController();
|
|
22
23
|
this.initRoutes = () => {
|
|
23
|
-
this.router.post("/traffic-info", helpers_1.checkContentTypeMiddleware(["text/xml", "application/xml"]), this.trafficInfo);
|
|
24
|
-
this.router.post("/traffic-restrictions", helpers_1.checkContentTypeMiddleware(["text/xml", "application/xml"]), this.trafficRestriction);
|
|
24
|
+
this.router.post("/traffic-info", (0, helpers_1.checkContentTypeMiddleware)(["text/xml", "application/xml"]), this.trafficInfo);
|
|
25
|
+
this.router.post("/traffic-restrictions", (0, helpers_1.checkContentTypeMiddleware)(["text/xml", "application/xml"]), this.trafficRestriction);
|
|
25
26
|
};
|
|
26
27
|
this.trafficInfo = (req, res, next) => __awaiter(this, void 0, void 0, function* () {
|
|
27
28
|
try {
|
|
28
29
|
yield this.trafficInfoController.processData(req.body);
|
|
30
|
+
const numberOfRecords = (JSON.stringify(req.body.d2LogicalModel.payloadPublication.situation || {}).match(/situationRecord/g) || []).length;
|
|
29
31
|
const metrics = {
|
|
30
|
-
numberOfRecords
|
|
32
|
+
numberOfRecords,
|
|
31
33
|
req,
|
|
32
34
|
};
|
|
33
35
|
helpers_1.loggerEvents.emit(helpers_1.LoggerEventType.NumberOfRecords, metrics);
|
|
36
|
+
monitoring_1.metricsService.recordNumberOfRecords(req, numberOfRecords);
|
|
34
37
|
res.sendStatus(204);
|
|
35
38
|
}
|
|
36
39
|
catch (err) {
|
|
@@ -40,11 +43,13 @@ class NdicRouter {
|
|
|
40
43
|
this.trafficRestriction = (req, res, next) => __awaiter(this, void 0, void 0, function* () {
|
|
41
44
|
try {
|
|
42
45
|
yield this.trafficRestrictionsController.processData(req.body);
|
|
46
|
+
const numberOfRecords = (JSON.stringify(req.body.d2LogicalModel.payloadPublication.situation || {}).match(/situationRecord/g) || []).length;
|
|
43
47
|
const metrics = {
|
|
44
|
-
numberOfRecords
|
|
48
|
+
numberOfRecords,
|
|
45
49
|
req,
|
|
46
50
|
};
|
|
47
51
|
helpers_1.loggerEvents.emit(helpers_1.LoggerEventType.NumberOfRecords, metrics);
|
|
52
|
+
monitoring_1.metricsService.recordNumberOfRecords(req, numberOfRecords);
|
|
48
53
|
res.sendStatus(204);
|
|
49
54
|
}
|
|
50
55
|
catch (err) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NdicRouter.js","sourceRoot":"","sources":["../../src/input-gateway/NdicRouter.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,+DAA4F;AAC5F,sEAKkD;AAClD,mEAAkE;AAClE,mFAAkF;
|
|
1
|
+
{"version":3,"file":"NdicRouter.js","sourceRoot":"","sources":["../../src/input-gateway/NdicRouter.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,+DAA4F;AAC5F,sEAKkD;AAClD,mEAAkE;AAClE,mFAAkF;AAClF,8DAA+D;AAE/D,MAAM,UAAU;IAKZ;QAJO,WAAM,GAAW,IAAA,gBAAM,GAAE,CAAC;QACzB,0BAAqB,GAAG,IAAI,6CAAqB,EAAE,CAAC;QACpD,kCAA6B,GAAG,IAAI,6DAA6B,EAAE,CAAC;QAMp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D,MAAM,eAAe,GAAG,CACpB,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,cAAc,CAAC,kBAAkB,CAAC,SAAS,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,kBAAkB,CAAC,IAAI,EAAE,CAC7G,CAAC,MAAM,CAAC;gBAET,MAAM,OAAO,GAA8B;oBACvC,eAAe;oBACf,GAAG;iBACN,CAAC;gBACF,sBAAY,CAAC,IAAI,CAAC,yBAAe,CAAC,eAAe,EAAE,OAAO,CAAC,CAAC;gBAE5D,2BAAc,CAAC,qBAAqB,CAAC,GAAG,EAAE,eAAe,CAAC,CAAC;gBAE3D,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;aACvB;YAAC,OAAO,GAAG,EAAE;gBACV,IAAI,CAAC,GAAG,CAAC,CAAC;aACb;QACL,CAAC,CAAA,CAAC;QAtDE,IAAI,CAAC,UAAU,EAAE,CAAC;IACtB,CAAC;CAsDJ;AAED,MAAM,UAAU,GAAG,IAAI,UAAU,EAAE,CAAC,MAAM,CAAC;AAElC,gCAAU"}
|
|
@@ -40,7 +40,7 @@ class TrafficRouter extends BaseRouter_1.BaseRouter {
|
|
|
40
40
|
});
|
|
41
41
|
this.trafficRestrictionsModel = new models_1.TrafficRestrictionsModel();
|
|
42
42
|
this.outputTrafficRestrictionsTransformation = new OutputTrafficRestrictionsTransformation_1.OutputTrafficRestrictionsTransformation();
|
|
43
|
-
this.router.get("/restrictions", [express_validator_1.query("moment").optional().isISO8601(), express_validator_1.query("situationRecordType").optional().isString()], Validation_1.pagination, Validation_1.checkErrors, Validation_1.paginationLimitMiddleware("TrafficRouter"), redis_1.useCacheMiddleware(), this.GetTrafficRestrictions);
|
|
43
|
+
this.router.get("/restrictions", [(0, express_validator_1.query)("moment").optional().isISO8601(), (0, express_validator_1.query)("situationRecordType").optional().isString()], Validation_1.pagination, Validation_1.checkErrors, (0, Validation_1.paginationLimitMiddleware)("TrafficRouter"), (0, redis_1.useCacheMiddleware)(), this.GetTrafficRestrictions);
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
46
|
exports.TrafficRouter = TrafficRouter;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TrafficRouter.js","sourceRoot":"","sources":["../../src/output-gateway/TrafficRouter.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,mFAAoE;AACpE,6EAAuE;AACvE,mEAA6E;AAC7E,oFAAiF;AACjF,6EAAkH;AAClH,qCAAoD;AACpD,uHAAsH;AAEtH,MAAa,aAAc,SAAQ,uBAAU;IAIzC;QACI,KAAK,EAAE,CAAC;QAeL,2BAAsB,GAAG,CAAO,GAAY,EAAE,GAAa,EAAE,IAAkB,EAAE,EAAE;YACtF,IAAI;gBACA,MAAM,UAAU,GAAG,MAAM,IAAI,CAAC,wBAAwB,CAAC,MAAM,CAAC;oBAC1D,KAAK,EAAE,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS;oBACrD,MAAM,EAAE,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS;oBACxD,MAAM,EAAE,GAAG,CAAC,KAAK,CAAC,MAAgB;oBAClC,mBAAmB,EAAE,GAAG,CAAC,KAAK,CAAC,mBAA6B;iBAC/D,CAAC,CAAC;gBACH,IAAI,CAAC,CAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,MAAM,CAAA,EAAE;oBACrB,MAAM,IAAI,4BAAW,CAAC,eAAe,EAAE,IAAI,EAAE,eAAe,EAAE,GAAG,CAAC,CAAC;iBACtE;gBACD,MAAM,eAAe,GAAG,MAAM,IAAI,CAAC,uCAAuC,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;gBACjG,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CA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I,EAAE,eAAe,EAAE,GAAG,CAAC,CAAC;iBACtE;gBACD,MAAM,eAAe,GAAG,MAAM,IAAI,CAAC,uCAAuC,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;gBACjG,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;aACzC;YAAC,OAAO,GAAG,EAAE;gBACV,IAAI,CAAC,GAAG,CAAC,CAAC;aACb;QACL,CAAC,CAAA,CAAC;QA9BE,IAAI,CAAC,wBAAwB,GAAG,IAAI,iCAAwB,EAAE,CAAC;QAC/D,IAAI,CAAC,uCAAuC,GAAG,IAAI,iFAAuC,EAAE,CAAC;QAE7F,IAAI,CAAC,MAAM,CAAC,GAAG,CACX,eAAe,EACf,CAAC,IAAA,yBAAK,EAAC,QAAQ,CAAC,CAAC,QAAQ,EAAE,CAAC,SAAS,EAAE,EAAE,IAAA,yBAAK,EAAC,qBAAqB,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE,CAAC,EAC5F,uBAAU,EACV,wBAAW,EACX,IAAA,sCAAyB,EAAC,eAAe,CAAC,EAC1C,IAAA,0BAAkB,GAAE,EACpB,IAAI,CAAC,sBAAsB,CAC9B,CAAC;IACN,CAAC;CAmBJ;AArCD,sCAqCC;AAED,MAAM,aAAa,GAAW,IAAI,aAAa,EAAE,CAAC,MAAM,CAAC;AAEhD,sCAAa"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@golemio/ndic",
|
|
3
|
-
"version": "1.0.6-dev.
|
|
3
|
+
"version": "1.0.6-dev.425924702",
|
|
4
4
|
"description": "Golemio NDIC Module",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"@commitlint/cli": "^11.0.0",
|
|
30
30
|
"@commitlint/config-conventional": "^11.0.0",
|
|
31
|
-
"@golemio/core": "1.1.
|
|
31
|
+
"@golemio/core": "1.1.9-dev.425846246",
|
|
32
32
|
"@golemio/eslint-config": "^1.0.2",
|
|
33
33
|
"@golemio/schema-definitions": "2.0.19",
|
|
34
34
|
"@types/body-parser-xml": "^1.1.0",
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"ts-node": "^9.1.1",
|
|
60
60
|
"ttypescript": "^1.5.12",
|
|
61
61
|
"typedoc": "^0.21.4",
|
|
62
|
-
"typescript": "
|
|
62
|
+
"typescript": "4.4.4"
|
|
63
63
|
},
|
|
64
64
|
"peerDependencies": {
|
|
65
65
|
"@golemio/core": "^1.0.5"
|
|
@@ -72,6 +72,7 @@
|
|
|
72
72
|
"resolutions": {
|
|
73
73
|
"xmldom": "github:xmldom/xmldom#0.7.0",
|
|
74
74
|
"mpath": "^0.8.4",
|
|
75
|
-
"apicache": "1.6.3"
|
|
75
|
+
"apicache": "1.6.3",
|
|
76
|
+
"axios": "^0.21.2"
|
|
76
77
|
}
|
|
77
78
|
}
|
package/CHANGELOG.md
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
# Changelog
|
|
2
|
-
|
|
3
|
-
All notable changes to this project will be documented in this file.
|
|
4
|
-
|
|
5
|
-
## [1.0.5] - 2021-11-29
|
|
6
|
-
|
|
7
|
-
### Fixed
|
|
8
|
-
|
|
9
|
-
- FGeneralPublicComment parsing error ([ndic#4](https://gitlab.com/operator-ict/golemio/code/modules/ndic/-/issues/4))
|
|
10
|
-
|
|
11
|
-
- In output API do not show records that do not contain ALERTS data in the OUTPUT API ([d0092-jsdi-ndic#13](https://gitlab.com/operator-ict/golemio/projekty/rsd/d0092-jsdi-ndic/-/issues/13#note_741387901))
|