@golemio/ndic 1.2.8-dev.1288389109 → 1.2.8
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/output-gateway/TrafficRouter.d.ts +4 -2
- package/dist/output-gateway/TrafficRouter.js +8 -6
- package/dist/output-gateway/TrafficRouter.js.map +1 -1
- package/dist/output-gateway/ioc/Di.d.ts +3 -0
- package/dist/output-gateway/ioc/Di.js +8 -0
- package/dist/output-gateway/ioc/Di.js.map +1 -0
- package/dist/schema-definitions/index.js +1 -1
- package/dist/schema-definitions/index.js.map +1 -1
- package/docs/openapi-output.yaml +10 -4
- package/package.json +2 -2
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
/// <reference types="express" />
|
|
2
|
-
import {
|
|
2
|
+
import { OutputTrafficRestrictionsTransformation } from "./transformations/OutputTrafficRestrictionsTransformation";
|
|
3
|
+
import { CacheHeaderMiddleware } from "@golemio/core/dist/output-gateway/CacheHeaderMiddleware";
|
|
3
4
|
import { BaseRouter } from "@golemio/core/dist/output-gateway/routes/BaseRouter";
|
|
5
|
+
import { NextFunction, Request, Response, Router } from "@golemio/core/dist/shared/express";
|
|
4
6
|
import { TrafficRestrictionsModel } from "./models";
|
|
5
|
-
import { OutputTrafficRestrictionsTransformation } from "./transformations/OutputTrafficRestrictionsTransformation";
|
|
6
7
|
export declare class TrafficRouter extends BaseRouter {
|
|
7
8
|
protected trafficRestrictionsModel: TrafficRestrictionsModel;
|
|
8
9
|
private outputTrafficRestrictionsTransformation;
|
|
10
|
+
protected cacheHeaderMiddleware: CacheHeaderMiddleware;
|
|
9
11
|
constructor(trafficRestrictionsModel: TrafficRestrictionsModel, outputTrafficRestrictionsTransformation: OutputTrafficRestrictionsTransformation);
|
|
10
12
|
GetTrafficRestrictions: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
11
13
|
}
|
|
@@ -10,14 +10,15 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.trafficRouter = exports.TrafficRouter = void 0;
|
|
13
|
+
const Di_1 = require("./ioc/Di");
|
|
14
|
+
const OutputTrafficRestrictionsTransformation_1 = require("./transformations/OutputTrafficRestrictionsTransformation");
|
|
15
|
+
const Validation_1 = require("@golemio/core/dist/output-gateway/Validation");
|
|
16
|
+
const ioc_1 = require("@golemio/core/dist/output-gateway/ioc");
|
|
17
|
+
const BaseRouter_1 = require("@golemio/core/dist/output-gateway/routes/BaseRouter");
|
|
13
18
|
const express_validator_1 = require("@golemio/core/dist/shared/express-validator");
|
|
14
19
|
const golemio_errors_1 = require("@golemio/core/dist/shared/golemio-errors");
|
|
15
|
-
const redis_1 = require("@golemio/core/dist/output-gateway/redis");
|
|
16
|
-
const BaseRouter_1 = require("@golemio/core/dist/output-gateway/routes/BaseRouter");
|
|
17
|
-
const Validation_1 = require("@golemio/core/dist/output-gateway/Validation");
|
|
18
|
-
const models_1 = require("./models");
|
|
19
|
-
const OutputTrafficRestrictionsTransformation_1 = require("./transformations/OutputTrafficRestrictionsTransformation");
|
|
20
20
|
const output_gateway_1 = require("@golemio/traffic-common/dist/output-gateway");
|
|
21
|
+
const models_1 = require("./models");
|
|
21
22
|
class TrafficRouter extends BaseRouter_1.BaseRouter {
|
|
22
23
|
constructor(trafficRestrictionsModel, outputTrafficRestrictionsTransformation) {
|
|
23
24
|
super();
|
|
@@ -41,10 +42,11 @@ class TrafficRouter extends BaseRouter_1.BaseRouter {
|
|
|
41
42
|
next(err);
|
|
42
43
|
}
|
|
43
44
|
});
|
|
45
|
+
this.cacheHeaderMiddleware = Di_1.NdicContainer.resolve(ioc_1.ContainerToken.CacheHeaderMiddleware);
|
|
44
46
|
this.router.get("/restrictions", [
|
|
45
47
|
(0, express_validator_1.query)("moment").optional().isISO8601().not().isArray(),
|
|
46
48
|
(0, express_validator_1.query)("situationRecordType").optional().not().isEmpty({ ignore_whitespace: true }).not().isArray(),
|
|
47
|
-
], Validation_1.pagination, Validation_1.checkErrors, (0, Validation_1.paginationLimitMiddleware)("TrafficRouter"), (
|
|
49
|
+
], Validation_1.pagination, Validation_1.checkErrors, (0, Validation_1.paginationLimitMiddleware)("TrafficRouter"), this.cacheHeaderMiddleware.getMiddleware(3 * 60, 60), this.GetTrafficRestrictions);
|
|
48
50
|
}
|
|
49
51
|
}
|
|
50
52
|
exports.TrafficRouter = TrafficRouter;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TrafficRouter.js","sourceRoot":"","sources":["../../src/output-gateway/TrafficRouter.ts"],"names":[],"mappings":";;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"TrafficRouter.js","sourceRoot":"","sources":["../../src/output-gateway/TrafficRouter.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,iCAA2C;AAC3C,uHAAsH;AAEtH,6EAAkH;AAClH,+DAAuE;AACvE,oFAAiF;AAEjF,mFAAoE;AACpE,6EAAwE;AACxE,gFAAyF;AACzF,qCAAoD;AAEpD,MAAa,aAAc,SAAQ,uBAAU;IAGzC,YACc,wBAAkD,EACpD,uCAAgF;QAExF,KAAK,EAAE,CAAC;QAHE,6BAAwB,GAAxB,wBAAwB,CAA0B;QACpD,4CAAuC,GAAvC,uCAAuC,CAAyC;QAoBrF,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,CAA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Aa,GAAW,IAAI,aAAa,CAC3C,IAAI,iCAAwB,EAAE,EAC9B,IAAI,iFAAuC,CAAC,IAAI,2CAA0B,EAAE,CAAC,CAChF,CAAC,MAAM,CAAC;AAEA,sCAAa"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NdicContainer = void 0;
|
|
4
|
+
const Di_1 = require("@golemio/core/dist/output-gateway/ioc/Di");
|
|
5
|
+
//#region Initialization
|
|
6
|
+
const ndicContainer = Di_1.OutputGatewayContainer.createChildContainer();
|
|
7
|
+
exports.NdicContainer = ndicContainer;
|
|
8
|
+
//# sourceMappingURL=Di.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Di.js","sourceRoot":"","sources":["../../../src/output-gateway/ioc/Di.ts"],"names":[],"mappings":";;;AAAA,iEAAkF;AAGlF,wBAAwB;AACxB,MAAM,aAAa,GAAwB,2BAAsB,CAAC,oBAAoB,EAAE,CAAC;AAG/D,sCAAa"}
|
|
@@ -3,9 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.Ndic = void 0;
|
|
4
4
|
const traffic_info_datasource_schema_1 = require("./schemas/traffic_info_datasource_schema");
|
|
5
5
|
const traffic_restrictions_datasource_schema_1 = require("./schemas/traffic_restrictions_datasource_schema");
|
|
6
|
+
const rsd_tmc_points_output_schema_1 = require("./schemas/rsd_tmc_points_output_schema");
|
|
6
7
|
const traffic_info_output_schema_1 = require("./schemas/traffic_info_output_schema");
|
|
7
8
|
const traffic_restrictions_output_schema_1 = require("./schemas/traffic_restrictions_output_schema");
|
|
8
|
-
const rsd_tmc_points_output_schema_1 = require("./schemas/rsd_tmc_points_output_schema");
|
|
9
9
|
const forExport = {
|
|
10
10
|
name: "Ndic",
|
|
11
11
|
pgSchema: "ndic",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/schema-definitions/index.ts"],"names":[],"mappings":";;;AAAA,6FAA0F;AAC1F,6GAA0G;AAE1G,qFAAyG;AACzG,qGAAiI;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/schema-definitions/index.ts"],"names":[],"mappings":";;;AAAA,6FAA0F;AAC1F,6GAA0G;AAE1G,yFAA6G;AAC7G,qFAAyG;AACzG,qGAAiI;AAEjI,MAAM,SAAS,GAAQ;IACnB,IAAI,EAAE,MAAM;IACZ,QAAQ,EAAE,MAAM;IAChB,YAAY,EAAE;QACV,IAAI,EAAE,iBAAiB;QACvB,gBAAgB,EAAE,4DAA2B;QAC7C,YAAY,EAAE,oDAAuB;QACrC,yBAAyB,EAAE,kDAAqB;QAChD,WAAW,EAAE,mBAAmB;KACnC;IACD,oBAAoB,EAAE;QAClB,IAAI,EAAE,yBAAyB;QAC/B,gBAAgB,EAAE,4EAAmC;QACrD,YAAY,EAAE,oEAA+B;QAC7C,yBAAyB,EAAE,kEAA6B;QACxD,WAAW,EAAE,2BAA2B;KAC3C;IACD,cAAc,EAAE;QACZ,IAAI,EAAE,cAAc;QACpB,YAAY,EAAE,uDAAwB;QACtC,yBAAyB,EAAE,qDAAsB;QACjD,WAAW,EAAE,gBAAgB;KAChC;CACJ,CAAC;AAEoB,yBAAI"}
|
package/docs/openapi-output.yaml
CHANGED
|
@@ -65,6 +65,12 @@ paths:
|
|
|
65
65
|
responses:
|
|
66
66
|
"200":
|
|
67
67
|
description: successful operation
|
|
68
|
+
headers:
|
|
69
|
+
Cache-Control:
|
|
70
|
+
description: Cache control directive for caching proxies
|
|
71
|
+
schema:
|
|
72
|
+
type: string
|
|
73
|
+
example: public, s-maxage=180, stale-while-revalidate=60
|
|
68
74
|
content:
|
|
69
75
|
application/json:
|
|
70
76
|
schema:
|
|
@@ -191,10 +197,10 @@ components:
|
|
|
191
197
|
nullable: true
|
|
192
198
|
forVehiclesWithCharacteristicsOf:
|
|
193
199
|
oneOf:
|
|
194
|
-
-
|
|
195
|
-
-
|
|
196
|
-
|
|
197
|
-
|
|
200
|
+
- type: object
|
|
201
|
+
- items:
|
|
202
|
+
type: object
|
|
203
|
+
type: array
|
|
198
204
|
alertCLinear:
|
|
199
205
|
type: object
|
|
200
206
|
properties:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@golemio/ndic",
|
|
3
|
-
"version": "1.2.8
|
|
3
|
+
"version": "1.2.8",
|
|
4
4
|
"description": "Golemio NDIC Module",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"@commitlint/cli": "^11.0.0",
|
|
37
37
|
"@commitlint/config-conventional": "^11.0.0",
|
|
38
38
|
"@golemio/cli": "1.5.0",
|
|
39
|
-
"@golemio/core": "1.10.
|
|
39
|
+
"@golemio/core": "1.10.3",
|
|
40
40
|
"@golemio/db-common": "1.1.4",
|
|
41
41
|
"@golemio/eslint-config": "1.1.2",
|
|
42
42
|
"@golemio/traffic-common": "1.0.7",
|