@golemio/fcd 1.1.2 → 1.1.3-dev.869081405
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/db/example/.config.json +1 -1
- package/dist/input-gateway/AbstractFcdController.d.ts +7 -0
- package/dist/input-gateway/{FloatingCarDataController.js → AbstractFcdController.js} +9 -10
- package/dist/input-gateway/AbstractFcdController.js.map +1 -0
- package/dist/input-gateway/FcdPragueController.d.ts +5 -0
- package/dist/input-gateway/FcdPragueController.js +14 -0
- package/dist/input-gateway/FcdPragueController.js.map +1 -0
- package/dist/input-gateway/FcdRegionsController.d.ts +5 -0
- package/dist/input-gateway/FcdRegionsController.js +14 -0
- package/dist/input-gateway/FcdRegionsController.js.map +1 -0
- package/dist/input-gateway/FloatingCarDataRouter.js +20 -8
- package/dist/input-gateway/FloatingCarDataRouter.js.map +1 -1
- package/dist/integration-engine/transformations/FloatingCarDataInterface.d.ts +1 -1
- package/dist/output-gateway/FCDRouter.d.ts +2 -1
- package/dist/output-gateway/FCDRouter.js +5 -4
- package/dist/output-gateway/FCDRouter.js.map +1 -1
- package/dist/output-gateway/models/FloatingCarDataModel.d.ts +2 -10
- package/dist/output-gateway/models/FloatingCarDataModel.js +1 -11
- package/dist/output-gateway/models/FloatingCarDataModel.js.map +1 -1
- package/dist/output-gateway/models/index.d.ts +0 -1
- package/dist/output-gateway/models/index.js +0 -1
- package/dist/output-gateway/models/index.js.map +1 -1
- package/dist/output-gateway/transformations/OutputFloatingCarDataTransformation.d.ts +3 -3
- package/dist/output-gateway/transformations/OutputFloatingCarDataTransformation.js +5 -7
- package/dist/output-gateway/transformations/OutputFloatingCarDataTransformation.js.map +1 -1
- package/dist/output-gateway/transformations/getLocationPointsFromTsString.d.ts +2 -4
- package/dist/output-gateway/transformations/getLocationPointsFromTsString.js +2 -2
- package/dist/output-gateway/transformations/getLocationPointsFromTsString.js.map +1 -1
- package/dist/schema-definitions/index.js +0 -7
- package/dist/schema-definitions/index.js.map +1 -1
- package/package.json +4 -2
- package/db/example/rsd_tmc_osm_mapping.sql +0 -13
- package/dist/input-gateway/FloatingCarDataController.d.ts +0 -5
- package/dist/input-gateway/FloatingCarDataController.js.map +0 -1
- package/dist/output-gateway/models/RsdTmcOsmMappingModel.d.ts +0 -16
- package/dist/output-gateway/models/RsdTmcOsmMappingModel.js +0 -66
- package/dist/output-gateway/models/RsdTmcOsmMappingModel.js.map +0 -1
- package/dist/schema-definitions/schemas/rsd_tmc_osm_mapping_output_schema.d.ts +0 -18
- package/dist/schema-definitions/schemas/rsd_tmc_osm_mapping_output_schema.js +0 -26
- package/dist/schema-definitions/schemas/rsd_tmc_osm_mapping_output_schema.js.map +0 -1
package/db/example/.config.json
CHANGED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { BaseController } from "@golemio/core/dist/input-gateway/controllers/BaseController";
|
|
2
|
+
import { IValidator } from "@golemio/core/dist/shared/golemio-validator";
|
|
3
|
+
export declare abstract class AbstractFcdController extends BaseController {
|
|
4
|
+
protected abstract saveQueueKey: string;
|
|
5
|
+
constructor(validator: IValidator);
|
|
6
|
+
processData: (data: any) => Promise<void>;
|
|
7
|
+
}
|
|
@@ -9,18 +9,17 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.
|
|
13
|
-
const input_gateway_1 = require("@golemio/core/dist/input-gateway");
|
|
14
|
-
const golemio_validator_1 = require("@golemio/core/dist/shared/golemio-validator");
|
|
15
|
-
const golemio_errors_1 = require("@golemio/core/dist/shared/golemio-errors");
|
|
12
|
+
exports.AbstractFcdController = void 0;
|
|
16
13
|
const _sch_1 = require("../schema-definitions");
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
14
|
+
const BaseController_1 = require("@golemio/core/dist/input-gateway/controllers/BaseController");
|
|
15
|
+
const golemio_errors_1 = require("@golemio/core/dist/shared/golemio-errors");
|
|
16
|
+
class AbstractFcdController extends BaseController_1.BaseController {
|
|
17
|
+
constructor(validator) {
|
|
18
|
+
super(_sch_1.FCD.name, validator);
|
|
20
19
|
this.processData = (data) => __awaiter(this, void 0, void 0, function* () {
|
|
21
20
|
try {
|
|
22
21
|
yield this.validator.Validate(data);
|
|
23
|
-
yield this.sendMessageToExchange("input." + this.queuePrefix + ".
|
|
22
|
+
yield this.sendMessageToExchange("input." + this.queuePrefix + "." + this.saveQueueKey, JSON.stringify(data.d2LogicalModel), {
|
|
24
23
|
persistent: true,
|
|
25
24
|
});
|
|
26
25
|
}
|
|
@@ -35,5 +34,5 @@ class FloatingCarDataController extends input_gateway_1.BaseController {
|
|
|
35
34
|
});
|
|
36
35
|
}
|
|
37
36
|
}
|
|
38
|
-
exports.
|
|
39
|
-
//# sourceMappingURL=
|
|
37
|
+
exports.AbstractFcdController = AbstractFcdController;
|
|
38
|
+
//# sourceMappingURL=AbstractFcdController.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AbstractFcdController.js","sourceRoot":"","sources":["../../src/input-gateway/AbstractFcdController.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,gDAA2B;AAC3B,gGAA6F;AAC7F,6EAAuE;AAGvE,MAAsB,qBAAsB,SAAQ,+BAAc;IAG9D,YAAY,SAAqB;QAC7B,KAAK,CAAC,UAAG,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;QAGxB,gBAAW,GAAG,CAAO,IAAS,EAAiB,EAAE;YACpD,IAAI;gBACA,MAAM,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;gBAEpC,MAAM,IAAI,CAAC,qBAAqB,CAC5B,QAAQ,GAAG,IAAI,CAAC,WAAW,GAAG,GAAG,GAAG,IAAI,CAAC,YAAY,EACrD,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,cAAc,CAAC,EACnC;oBACI,UAAU,EAAE,IAAI;iBACnB,CACJ,CAAC;aACL;YAAC,OAAO,GAAG,EAAE;gBACV,IAAI,GAAG,YAAY,4BAAW,EAAE;oBAC5B,MAAM,GAAG,CAAC;iBACb;qBAAM;oBACH,MAAM,IAAI,4BAAW,CAAC,oCAAoC,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;iBAC1F;aACJ;QACL,CAAC,CAAA,CAAC;IApBF,CAAC;CAqBJ;AA1BD,sDA0BC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FcdPragueController = void 0;
|
|
4
|
+
const _sch_1 = require("../schema-definitions");
|
|
5
|
+
const golemio_validator_1 = require("@golemio/core/dist/shared/golemio-validator");
|
|
6
|
+
const AbstractFcdController_1 = require("./AbstractFcdController");
|
|
7
|
+
class FcdPragueController extends AbstractFcdController_1.AbstractFcdController {
|
|
8
|
+
constructor() {
|
|
9
|
+
super(new golemio_validator_1.JSONSchemaValidator("FcdPragueInputValidation", _sch_1.FCD.fcd_info.datasourceSchema));
|
|
10
|
+
this.saveQueueKey = "saveFloatingCarData";
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
exports.FcdPragueController = FcdPragueController;
|
|
14
|
+
//# sourceMappingURL=FcdPragueController.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FcdPragueController.js","sourceRoot":"","sources":["../../src/input-gateway/FcdPragueController.ts"],"names":[],"mappings":";;;AAAA,gDAA2B;AAC3B,mFAAkF;AAClF,mEAAgE;AAEhE,MAAa,mBAAoB,SAAQ,6CAAqB;IAG1D;QACI,KAAK,CAAC,IAAI,uCAAmB,CAAC,0BAA0B,EAAE,UAAG,CAAC,QAAQ,CAAC,gBAAgB,CAAC,CAAC,CAAC;QAHpF,iBAAY,GAAG,qBAAqB,CAAC;IAI/C,CAAC;CACJ;AAND,kDAMC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FcdRegionsController = void 0;
|
|
4
|
+
const _sch_1 = require("../schema-definitions");
|
|
5
|
+
const golemio_validator_1 = require("@golemio/core/dist/shared/golemio-validator");
|
|
6
|
+
const AbstractFcdController_1 = require("./AbstractFcdController");
|
|
7
|
+
class FcdRegionsController extends AbstractFcdController_1.AbstractFcdController {
|
|
8
|
+
constructor() {
|
|
9
|
+
super(new golemio_validator_1.JSONSchemaValidator("FcdRegionsInputValidation", _sch_1.FCD.fcd_info.datasourceSchema));
|
|
10
|
+
this.saveQueueKey = "saveRegionsData";
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
exports.FcdRegionsController = FcdRegionsController;
|
|
14
|
+
//# sourceMappingURL=FcdRegionsController.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FcdRegionsController.js","sourceRoot":"","sources":["../../src/input-gateway/FcdRegionsController.ts"],"names":[],"mappings":";;;AAAA,gDAA2B;AAC3B,mFAAkF;AAClF,mEAAgE;AAEhE,MAAa,oBAAqB,SAAQ,6CAAqB;IAG3D;QACI,KAAK,CAAC,IAAI,uCAAmB,CAAC,2BAA2B,EAAE,UAAG,CAAC,QAAQ,CAAC,gBAAgB,CAAC,CAAC,CAAC;QAHrF,iBAAY,GAAG,iBAAiB,CAAC;IAI3C,CAAC;CACJ;AAND,oDAMC"}
|
|
@@ -10,31 +10,43 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.floatingCarDataRouter = void 0;
|
|
13
|
-
const
|
|
14
|
-
const
|
|
13
|
+
const FcdPragueController_1 = require("./FcdPragueController");
|
|
14
|
+
const LoggerEmitter_1 = require("@golemio/core/dist/helpers/logger/LoggerEmitter");
|
|
15
|
+
const CheckContentTypeMiddleware_1 = require("@golemio/core/dist/input-gateway/helpers/CheckContentTypeMiddleware");
|
|
16
|
+
const ioc_1 = require("@golemio/core/dist/input-gateway/ioc");
|
|
15
17
|
const express_1 = require("@golemio/core/dist/shared/express");
|
|
18
|
+
const FcdRegionsController_1 = require("./FcdRegionsController");
|
|
16
19
|
class FloatingCarDataRouter {
|
|
17
20
|
constructor() {
|
|
21
|
+
this.router = (0, express_1.Router)();
|
|
22
|
+
this.fcdPragueController = new FcdPragueController_1.FcdPragueController();
|
|
23
|
+
this.fcdRegionsController = new FcdRegionsController_1.FcdRegionsController();
|
|
18
24
|
this.initRoutes = () => {
|
|
19
|
-
this.router.post("/fcd-info", (0,
|
|
25
|
+
this.router.post("/fcd-info", (0, CheckContentTypeMiddleware_1.checkContentTypeMiddleware)(["text/xml", "application/xml"]), this.fcdPrague);
|
|
26
|
+
this.router.post("/fcd-info-regions", (0, CheckContentTypeMiddleware_1.checkContentTypeMiddleware)(["text/xml", "application/xml"]), this.fcdRegions);
|
|
20
27
|
};
|
|
21
|
-
this.
|
|
28
|
+
this.fcdPrague = (req, res, next) => __awaiter(this, void 0, void 0, function* () {
|
|
29
|
+
yield this.floatingCarData(this.fcdPragueController, req, res, next);
|
|
30
|
+
});
|
|
31
|
+
this.fcdRegions = (req, res, next) => __awaiter(this, void 0, void 0, function* () {
|
|
32
|
+
yield this.floatingCarData(this.fcdRegionsController, req, res, next);
|
|
33
|
+
});
|
|
34
|
+
this.floatingCarData = (controller, req, res, next) => __awaiter(this, void 0, void 0, function* () {
|
|
22
35
|
try {
|
|
23
|
-
yield
|
|
36
|
+
yield controller.processData(req.body);
|
|
24
37
|
const numberOfRecords = (JSON.stringify(req.body.d2LogicalModel.payloadPublication.elaboratedData || {}).match(/basicData/g) || []).length;
|
|
25
38
|
const metrics = {
|
|
26
39
|
numberOfRecords,
|
|
27
40
|
req,
|
|
28
41
|
};
|
|
29
|
-
|
|
42
|
+
this.loggerEmitter.emit(LoggerEmitter_1.LoggerEventType.NumberOfRecords, metrics);
|
|
30
43
|
res.sendStatus(204);
|
|
31
44
|
}
|
|
32
45
|
catch (err) {
|
|
33
46
|
next(err);
|
|
34
47
|
}
|
|
35
48
|
});
|
|
36
|
-
this.
|
|
37
|
-
this.floatingCarDataController = new FloatingCarDataController_1.FloatingCarDataController();
|
|
49
|
+
this.loggerEmitter = ioc_1.InputGatewayContainer.resolve(ioc_1.ContainerToken.LoggerEmitter);
|
|
38
50
|
this.initRoutes();
|
|
39
51
|
}
|
|
40
52
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FloatingCarDataRouter.js","sourceRoot":"","sources":["../../src/input-gateway/FloatingCarDataRouter.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"FloatingCarDataRouter.js","sourceRoot":"","sources":["../../src/input-gateway/FloatingCarDataRouter.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,+DAA8D;AAC9D,mFAAiG;AAEjG,oHAAiH;AACjH,8DAA6F;AAC7F,+DAA4F;AAE5F,iEAA8D;AAE9D,MAAM,qBAAqB;IAOvB;QANO,WAAM,GAAW,IAAA,gBAAM,GAAE,CAAC;QAGzB,wBAAmB,GAAG,IAAI,yCAAmB,EAAE,CAAC;QAChD,yBAAoB,GAAG,IAAI,2CAAoB,EAAE,CAAC;QAOlD,eAAU,GAAG,GAAS,EAAE;YAC5B,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,WAAW,EAAE,IAAA,uDAA0B,EAAC,CAAC,UAAU,EAAE,iBAAiB,CAAC,CAAC,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;YAC3G,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,mBAAmB,EAAE,IAAA,uDAA0B,EAAC,CAAC,UAAU,EAAE,iBAAiB,CAAC,CAAC,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;QACxH,CAAC,CAAC;QAEM,cAAS,GAAG,CAA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AAExD,sDAAqB"}
|
|
@@ -2,10 +2,11 @@
|
|
|
2
2
|
import { NextFunction, Request, Response, Router } from "@golemio/core/dist/shared/express";
|
|
3
3
|
import { BaseRouter } from "@golemio/core/dist/output-gateway/routes/BaseRouter";
|
|
4
4
|
import { FloatingCarDataModel } from "./models";
|
|
5
|
+
import { OutputFloatingCarDataTransformation } from "./transformations/OutputFloatingCarDataTransformation";
|
|
5
6
|
export declare class FCDRouter extends BaseRouter {
|
|
6
7
|
protected floatingCarDataModel: FloatingCarDataModel;
|
|
7
8
|
private outputFloatingCarDataTransformation;
|
|
8
|
-
constructor();
|
|
9
|
+
constructor(floatingCarDataModel: FloatingCarDataModel, outputFloatingCarDataTransformation: OutputFloatingCarDataTransformation);
|
|
9
10
|
GetFloatingCarData: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
10
11
|
}
|
|
11
12
|
declare const fcdRouter: Router;
|
|
@@ -17,9 +17,12 @@ const BaseRouter_1 = require("@golemio/core/dist/output-gateway/routes/BaseRoute
|
|
|
17
17
|
const Validation_1 = require("@golemio/core/dist/output-gateway/Validation");
|
|
18
18
|
const models_1 = require("./models");
|
|
19
19
|
const OutputFloatingCarDataTransformation_1 = require("./transformations/OutputFloatingCarDataTransformation");
|
|
20
|
+
const repositories_1 = require("@golemio/traffic-common/dist/output-gateway/repositories");
|
|
20
21
|
class FCDRouter extends BaseRouter_1.BaseRouter {
|
|
21
|
-
constructor() {
|
|
22
|
+
constructor(floatingCarDataModel, outputFloatingCarDataTransformation) {
|
|
22
23
|
super();
|
|
24
|
+
this.floatingCarDataModel = floatingCarDataModel;
|
|
25
|
+
this.outputFloatingCarDataTransformation = outputFloatingCarDataTransformation;
|
|
23
26
|
this.GetFloatingCarData = (req, res, next) => __awaiter(this, void 0, void 0, function* () {
|
|
24
27
|
try {
|
|
25
28
|
const isRequestedPathOsm = req.query.osmPath == "true";
|
|
@@ -38,12 +41,10 @@ class FCDRouter extends BaseRouter_1.BaseRouter {
|
|
|
38
41
|
next(err);
|
|
39
42
|
}
|
|
40
43
|
});
|
|
41
|
-
this.floatingCarDataModel = new models_1.FloatingCarDataModel();
|
|
42
|
-
this.outputFloatingCarDataTransformation = new OutputFloatingCarDataTransformation_1.OutputFloatingCarDataTransformation();
|
|
43
44
|
this.router.get("/info", [(0, express_validator_1.query)("osmPath").optional().isString(), (0, express_validator_1.query)("locationId").optional().isString()], Validation_1.pagination, Validation_1.checkErrors, (0, Validation_1.paginationLimitMiddleware)("FCDRouter"), (0, redis_1.useCacheMiddleware)(), this.GetFloatingCarData);
|
|
44
45
|
}
|
|
45
46
|
}
|
|
46
47
|
exports.FCDRouter = FCDRouter;
|
|
47
|
-
const fcdRouter = new FCDRouter().router;
|
|
48
|
+
const fcdRouter = new FCDRouter(new models_1.FloatingCarDataModel(), new OutputFloatingCarDataTransformation_1.OutputFloatingCarDataTransformation(new repositories_1.RsdTmcOsmMappingRepository())).router;
|
|
48
49
|
exports.fcdRouter = fcdRouter;
|
|
49
50
|
//# sourceMappingURL=FCDRouter.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FCDRouter.js","sourceRoot":"","sources":["../../src/output-gateway/FCDRouter.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,mFAAoE;AACpE,6EAAuE;AACvE,mEAA6E;AAC7E,oFAAiF;AACjF,6EAAkH;AAClH,qCAAgD;AAChD,+GAA8G;
|
|
1
|
+
{"version":3,"file":"FCDRouter.js","sourceRoot":"","sources":["../../src/output-gateway/FCDRouter.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,mFAAoE;AACpE,6EAAuE;AACvE,mEAA6E;AAC7E,oFAAiF;AACjF,6EAAkH;AAClH,qCAAgD;AAChD,+GAA8G;AAC9G,2FAAsG;AAEtG,MAAa,SAAU,SAAQ,uBAAU;IACrC,YACc,oBAA0C,EAC5C,mCAAwE;QAEhF,KAAK,EAAE,CAAC;QAHE,yBAAoB,GAApB,oBAAoB,CAAsB;QAC5C,wCAA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AE,CAAC,EACnF,uBAAU,EACV,wBAAW,EACX,IAAA,sCAAyB,EAAC,WAAW,CAAC,EACtC,IAAA,0BAAkB,GAAE,EACpB,IAAI,CAAC,kBAAkB,CAC1B,CAAC;IACN,CAAC;CAoBJ;AApCD,8BAoCC;AAED,MAAM,SAAS,GAAW,IAAI,SAAS,CACnC,IAAI,6BAAoB,EAAE,EAC1B,IAAI,yEAAmC,CAAC,IAAI,yCAA0B,EAAE,CAAC,CAC5E,CAAC,MAAM,CAAC;AAEA,8BAAS"}
|
|
@@ -1,19 +1,11 @@
|
|
|
1
1
|
import { SequelizeModel } from "@golemio/core/dist/output-gateway/models";
|
|
2
|
+
import { IFloatingCarDataModel } from "../../integration-engine/transformations/FloatingCarDataInterface";
|
|
2
3
|
export declare class FloatingCarDataModel extends SequelizeModel {
|
|
3
4
|
constructor();
|
|
4
|
-
/**
|
|
5
|
-
* @param {object} [options] Options object with params
|
|
6
|
-
* @param {number} [options.locationId] Predefined Location Id
|
|
7
|
-
* @param {number} [options.limit] Limit
|
|
8
|
-
* @param {number} [options.offset] Offset
|
|
9
|
-
* @param {string} [options.from] ISO date<br>
|
|
10
|
-
* @param {string} [options.to] ISO date<br>
|
|
11
|
-
* @returns Array of the retrieved records
|
|
12
|
-
*/
|
|
13
5
|
GetAll: (options?: {
|
|
14
6
|
locationId?: string;
|
|
15
7
|
limit?: number;
|
|
16
8
|
offset?: number;
|
|
17
|
-
}) => Promise<
|
|
9
|
+
}) => Promise<IFloatingCarDataModel[]>;
|
|
18
10
|
GetOne: () => Promise<object | null>;
|
|
19
11
|
}
|
|
@@ -22,15 +22,6 @@ class FloatingCarDataModel extends models_1.SequelizeModel {
|
|
|
22
22
|
super(index_1.FCD.fcd_info.name, index_1.FCD.fcd_info.pgTableName, index_1.FCD.fcd_info.outputSequelizeAttributes, {
|
|
23
23
|
schema: index_1.FCD.pgSchema,
|
|
24
24
|
});
|
|
25
|
-
/**
|
|
26
|
-
* @param {object} [options] Options object with params
|
|
27
|
-
* @param {number} [options.locationId] Predefined Location Id
|
|
28
|
-
* @param {number} [options.limit] Limit
|
|
29
|
-
* @param {number} [options.offset] Offset
|
|
30
|
-
* @param {string} [options.from] ISO date<br>
|
|
31
|
-
* @param {string} [options.to] ISO date<br>
|
|
32
|
-
* @returns Array of the retrieved records
|
|
33
|
-
*/
|
|
34
25
|
this.GetAll = (options = {}) => __awaiter(this, void 0, void 0, function* () {
|
|
35
26
|
const { locationId, limit, offset } = options;
|
|
36
27
|
try {
|
|
@@ -48,13 +39,12 @@ class FloatingCarDataModel extends models_1.SequelizeModel {
|
|
|
48
39
|
[Op.eq]: sequelize_1.default.literal(`(select max(measurement_or_calculation_time) from ${index_1.FCD.pgSchema}.${index_1.FCD.fcd_info.pgTableName})`),
|
|
49
40
|
},
|
|
50
41
|
});
|
|
51
|
-
|
|
42
|
+
return yield this.sequelizeModel.findAll({
|
|
52
43
|
limit,
|
|
53
44
|
offset,
|
|
54
45
|
raw: true,
|
|
55
46
|
where,
|
|
56
47
|
});
|
|
57
|
-
return floatingCarDataFromDB;
|
|
58
48
|
}
|
|
59
49
|
catch (err) {
|
|
60
50
|
throw new golemio_errors_1.CustomError(`GetAll method error: ${err.message}`, true, "FloatingCarDataModel", 500, err);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FloatingCarDataModel.js","sourceRoot":"","sources":["../../../src/output-gateway/models/FloatingCarDataModel.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,oFAA4D;AAC5D,6EAAuE;AACvE,qEAA0E;AAC1E,0DAAiC;
|
|
1
|
+
{"version":3,"file":"FloatingCarDataModel.js","sourceRoot":"","sources":["../../../src/output-gateway/models/FloatingCarDataModel.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,oFAA4D;AAC5D,6EAAuE;AACvE,qEAA0E;AAC1E,0DAAiC;AAGjC,MAAa,oBAAqB,SAAQ,uBAAc;IACpD;QACI,KAAK,CAAC,WAAG,CAAC,QAAQ,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,sBAAsB,CAAC,CAAC;QAC3E,CAAC,CAAA,CAAC;IA3CF,CAAC;CA4CJ;AAjDD,oDAiDC"}
|
|
@@ -15,5 +15,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./FloatingCarDataModel"), exports);
|
|
18
|
-
__exportStar(require("./RsdTmcOsmMappingModel"), exports);
|
|
19
18
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/output-gateway/models/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yDAAuC
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/output-gateway/models/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yDAAuC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { IFloatingCarDataModel, IOutputApiFloatingCarData } from "../../integration-engine/transformations/FloatingCarDataInterface";
|
|
2
|
-
import {
|
|
2
|
+
import { RsdTmcOsmMappingRepository } from "@golemio/traffic-common/dist/output-gateway/repositories";
|
|
3
3
|
export declare class OutputFloatingCarDataTransformation {
|
|
4
4
|
name: string;
|
|
5
|
-
protected
|
|
6
|
-
constructor();
|
|
5
|
+
protected rsdTmcOsmMappingRepository: RsdTmcOsmMappingRepository;
|
|
6
|
+
constructor(rsdTmcOsmMappingRepository: RsdTmcOsmMappingRepository);
|
|
7
7
|
transform: (data: IFloatingCarDataModel[], isRequestedPathOsm: Boolean) => Promise<IOutputApiFloatingCarData>;
|
|
8
8
|
}
|
|
@@ -15,10 +15,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
15
15
|
exports.OutputFloatingCarDataTransformation = void 0;
|
|
16
16
|
const _sch_1 = require("../../schema-definitions");
|
|
17
17
|
const moment_timezone_1 = __importDefault(require("@golemio/core/dist/shared/moment-timezone"));
|
|
18
|
-
const models_1 = require("../models");
|
|
19
18
|
const getLocationPointsFromTsString_1 = require("./getLocationPointsFromTsString");
|
|
20
19
|
class OutputFloatingCarDataTransformation {
|
|
21
|
-
constructor() {
|
|
20
|
+
constructor(rsdTmcOsmMappingRepository) {
|
|
22
21
|
this.transform = (data, isRequestedPathOsm) => __awaiter(this, void 0, void 0, function* () {
|
|
23
22
|
const elaboratedData = [];
|
|
24
23
|
let latestPublicationTime = data[0].measurement_or_calculation_time;
|
|
@@ -48,14 +47,15 @@ class OutputFloatingCarDataTransformation {
|
|
|
48
47
|
itemResultObject.toPoint = item.to_point.toString();
|
|
49
48
|
}
|
|
50
49
|
if (isRequestedPathOsm) {
|
|
51
|
-
|
|
50
|
+
const osmPath = yield this.rsdTmcOsmMappingRepository.GetOne((0, getLocationPointsFromTsString_1.getLocationPointsFromTsString)(item.predefined_location));
|
|
51
|
+
itemResultObject.osmPath = osmPath !== null && osmPath !== void 0 ? osmPath : null;
|
|
52
52
|
}
|
|
53
53
|
elaboratedData.push(itemResultObject);
|
|
54
54
|
if (item.measurement_or_calculation_time > latestPublicationTime) {
|
|
55
55
|
latestPublicationTime = item.measurement_or_calculation_time;
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
|
-
|
|
58
|
+
return {
|
|
59
59
|
modelBaseVersion: "3",
|
|
60
60
|
payloadPublicationLight: {
|
|
61
61
|
lang: "cz",
|
|
@@ -67,11 +67,9 @@ class OutputFloatingCarDataTransformation {
|
|
|
67
67
|
elaboratedData,
|
|
68
68
|
},
|
|
69
69
|
};
|
|
70
|
-
return result;
|
|
71
70
|
});
|
|
72
71
|
this.name = _sch_1.FCD.fcd_info.name;
|
|
73
|
-
this.
|
|
74
|
-
this.rsdTmcOsmMappingModel.sequelizeModel.removeAttribute("id");
|
|
72
|
+
this.rsdTmcOsmMappingRepository = rsdTmcOsmMappingRepository;
|
|
75
73
|
}
|
|
76
74
|
}
|
|
77
75
|
exports.OutputFloatingCarDataTransformation = OutputFloatingCarDataTransformation;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OutputFloatingCarDataTransformation.js","sourceRoot":"","sources":["../../../src/output-gateway/transformations/OutputFloatingCarDataTransformation.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,mDAA2B;AAM3B,gGAA+D;AAC/D,
|
|
1
|
+
{"version":3,"file":"OutputFloatingCarDataTransformation.js","sourceRoot":"","sources":["../../../src/output-gateway/transformations/OutputFloatingCarDataTransformation.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,mDAA2B;AAM3B,gGAA+D;AAC/D,mFAAkG;AAGlG,MAAa,mCAAmC;IAI5C,YAAY,0BAAsD;QAK3D,cAAS,GAAG,CAAO,IAA6B,EAAE,kBAA2B,EAAsC,EAAE;YACxH,MAAM,cAAc,GAA8C,EAAE,CAAC;YACrE,IAAI,qBAAqB,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,+BAA+B,CAAC;YAEpE,KAAK,MAAM,IAAI,IAAI,IAAI,EAAE;gBACrB,MAAM,gBAAgB,GAA4C;oBAC9D,4BAA4B,EAAE,IAAA,yBAAM,EAAC,IAAI,CAAC,+BAA+B,CAAC,CAAC,EAAE,CAAC,eAAe,CAAC,CAAC,MAAM,EAAE;oBACvG,oBAAoB,EAAE,IAAI,CAAC,qBAAqB;oBAChD,6BAA6B,EAAE,IAAI,CAAC,YAAY,CAAC,QAAQ,EAAE;oBAC3D,uBAAuB,EAAE,IAAI,CAAC,YAAY,CAAC,QAAQ,EAAE;oBACrD,oBAAoB,EAAE,IAAI,CAAC,mBAAmB;oBAC9C,YAAY,EAAE,IAAI,CAAC,aAAa;oBAChC,mBAAmB,EAAE,IAAI,CAAC,qBAAqB,CAAC,QAAQ,EAAE;oBAC1D,UAAU,EAAE,IAAI,CAAC,WAAW,CAAC,QAAQ,EAAE;oBACvC,kBAAkB,EAAE,IAAI,CAAC,qBAAqB,CAAC,QAAQ,EAAE;oBACzD,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BACD,cAAc;iBACjB;aACJ,CAAC;QACN,CAAC,CAAA,CAAC;QAhEE,IAAI,CAAC,IAAI,GAAG,UAAG,CAAC,QAAQ,CAAC,IAAI,CAAC;QAC9B,IAAI,CAAC,0BAA0B,GAAG,0BAA0B,CAAC;IACjE,CAAC;CA+DJ;AAtED,kFAsEC"}
|
|
@@ -1,4 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
ltEnd: string;
|
|
4
|
-
};
|
|
1
|
+
import { LocationConfigOptions } from "@golemio/traffic-common/dist/output-gateway";
|
|
2
|
+
export declare function getLocationPointsFromTsString(location: string): LocationConfigOptions;
|
|
@@ -7,8 +7,8 @@ function getLocationPointsFromTsString(location) {
|
|
|
7
7
|
const pointsArr = location.match(regex);
|
|
8
8
|
if ((pointsArr === null || pointsArr === void 0 ? void 0 : pointsArr.length) == 2 && pointsArr[0] && pointsArr[1]) {
|
|
9
9
|
return {
|
|
10
|
-
ltStart: pointsArr[1],
|
|
11
|
-
ltEnd: pointsArr[0],
|
|
10
|
+
ltStart: Number(pointsArr[1]),
|
|
11
|
+
ltEnd: Number(pointsArr[0]),
|
|
12
12
|
};
|
|
13
13
|
}
|
|
14
14
|
else {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getLocationPointsFromTsString.js","sourceRoot":"","sources":["../../../src/output-gateway/transformations/getLocationPointsFromTsString.ts"],"names":[],"mappings":";;;AAAA,6EAAuE;
|
|
1
|
+
{"version":3,"file":"getLocationPointsFromTsString.js","sourceRoot":"","sources":["../../../src/output-gateway/transformations/getLocationPointsFromTsString.ts"],"names":[],"mappings":";;;AAAA,6EAAuE;AAGvE,SAAgB,6BAA6B,CAAC,QAAgB;IAC1D,MAAM,KAAK,GAAG,2CAA2C,CAAC;IAC1D,MAAM,SAAS,GAAG,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IACxC,IAAI,CAAA,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,MAAM,KAAI,CAAC,IAAI,SAAS,CAAC,CAAC,CAAC,IAAI,SAAS,CAAC,CAAC,CAAC,EAAE;QACxD,OAAO;YACH,OAAO,EAAE,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;YAC7B,KAAK,EAAE,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;SAC9B,CAAC;KACL;SAAM;QACH,MAAM,IAAI,4BAAW,CAAC,gEAAgE,EAAE,IAAI,EAAE,WAAW,EAAE,GAAG,CAAC,CAAC;KACnH;AACL,CAAC;AAXD,sEAWC"}
|
|
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.FCD = void 0;
|
|
4
4
|
const fcd_datasource_schema_1 = require("./schemas/fcd_datasource_schema");
|
|
5
5
|
const fcd_output_schema_1 = require("./schemas/fcd_output_schema");
|
|
6
|
-
const rsd_tmc_osm_mapping_output_schema_1 = require("./schemas/rsd_tmc_osm_mapping_output_schema");
|
|
7
6
|
const forExport = {
|
|
8
7
|
name: "FCD",
|
|
9
8
|
pgSchema: "fcd",
|
|
@@ -14,12 +13,6 @@ const forExport = {
|
|
|
14
13
|
outputSequelizeAttributes: fcd_output_schema_1.outputFloatingCarDataSDMA,
|
|
15
14
|
pgTableName: "fcd_traff_params_part",
|
|
16
15
|
},
|
|
17
|
-
rsd_tmc_osm_mapping: {
|
|
18
|
-
name: "LtOsmMapping",
|
|
19
|
-
outputSchema: rsd_tmc_osm_mapping_output_schema_1.outputRsdTmcOsmMappingSchema,
|
|
20
|
-
outputSequelizeAttributes: rsd_tmc_osm_mapping_output_schema_1.outputRsdTmcOsmMappingSDMA,
|
|
21
|
-
pgTableName: "rsd_tmc_osm_mapping",
|
|
22
|
-
},
|
|
23
16
|
};
|
|
24
17
|
exports.FCD = forExport;
|
|
25
18
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/schema-definitions/index.ts"],"names":[],"mappings":";;;AAAA,2EAAqF;AACrF,mEAAwG;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/schema-definitions/index.ts"],"names":[],"mappings":";;;AAAA,2EAAqF;AACrF,mEAAwG;AAExG,MAAM,SAAS,GAAQ;IACnB,IAAI,EAAE,KAAK;IACX,QAAQ,EAAE,KAAK;IACf,QAAQ,EAAE;QACN,IAAI,EAAE,iBAAiB;QACvB,gBAAgB,EAAE,uDAA+B;QACjD,YAAY,EAAE,+CAA2B;QACzC,yBAAyB,EAAE,6CAAyB;QACpD,WAAW,EAAE,uBAAuB;KACvC;CACJ,CAAC;AAEoB,wBAAG"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@golemio/fcd",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.3-dev.869081405",
|
|
4
4
|
"description": "Golemio Floating Car Data Module",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -37,6 +37,7 @@
|
|
|
37
37
|
"@commitlint/config-conventional": "^11.0.0",
|
|
38
38
|
"@golemio/cli": "1.4.2",
|
|
39
39
|
"@golemio/core": "1.6.8",
|
|
40
|
+
"@golemio/traffic-common": "0.1.0-dev.864393677",
|
|
40
41
|
"@golemio/db-common": "1.1.1",
|
|
41
42
|
"@golemio/eslint-config": "1.1.0",
|
|
42
43
|
"@ovos-media/ts-transform-paths": "^1.7.18-1",
|
|
@@ -70,6 +71,7 @@
|
|
|
70
71
|
"typescript": "4.7.2"
|
|
71
72
|
},
|
|
72
73
|
"peerDependencies": {
|
|
73
|
-
"@golemio/core": ">=1.5.0"
|
|
74
|
+
"@golemio/core": ">=1.5.0",
|
|
75
|
+
"@golemio/traffic-common": "0.1.0-dev.864393677"
|
|
74
76
|
}
|
|
75
77
|
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
DROP TABLE IF EXISTS public.rsd_tmc_osm_mapping;
|
|
2
|
-
|
|
3
|
-
CREATE TABLE public.rsd_tmc_osm_mapping (
|
|
4
|
-
lt_start int8 NULL,
|
|
5
|
-
lt_end int8 NULL,
|
|
6
|
-
osm_path text NULL
|
|
7
|
-
);
|
|
8
|
-
|
|
9
|
-
INSERT INTO public.rsd_tmc_osm_mapping ("lt_start", "lt_end", "osm_path") VALUES
|
|
10
|
-
(10123, 10125, '[1017997529, 977504768, 1994461410, 5216395185, 977504817, 340196025, 1837022967, 5919113281, 7881860424, 977504742, 7881860432, 977504743, 7881860435, 1826208722, 1837041100]');
|
|
11
|
-
|
|
12
|
-
INSERT INTO public.rsd_tmc_osm_mapping ("lt_start", "lt_end", "osm_path") VALUES
|
|
13
|
-
(19629, 10127, '[29381030, 29403193, 338604070, 29381028, 338604072, 29403192, 2681371748, 1138616634, 2681371747, 308815174, 1138624651, 29403191]');
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FloatingCarDataController.js","sourceRoot":"","sources":["../../src/input-gateway/FloatingCarDataController.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oEAAkE;AAClE,mFAAkF;AAClF,6EAAuE;AACvE,gDAA2B;AAE3B,MAAa,yBAA0B,SAAQ,8BAAc;IACzD;QACI,KAAK,CAAC,UAAG,CAAC,IAAI,EAAE,IAAI,uCAAmB,CAAC,UAAG,CAAC,QAAQ,CAAC,IAAI,EAAE,UAAG,CAAC,QAAQ,CAAC,gBAAgB,CAAC,CAAC,CAAC;QAGxF,gBAAW,GAAG,CAAO,IAAS,EAAiB,EAAE;YACpD,IAAI;gBACA,MAAM,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;gBAEpC,MAAM,IAAI,CAAC,qBAAqB,CAC5B,QAAQ,GAAG,IAAI,CAAC,WAAW,GAAG,sBAAsB,EACpD,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,cAAc,CAAC,EACnC;oBACI,UAAU,EAAE,IAAI;iBACnB,CACJ,CAAC;aACL;YAAC,OAAO,GAAG,EAAE;gBACV,IAAI,GAAG,YAAY,4BAAW,EAAE;oBAC5B,MAAM,GAAG,CAAC;iBACb;qBAAM;oBACH,MAAM,IAAI,4BAAW,CAAC,oCAAoC,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;iBAC1F;aACJ;QACL,CAAC,CAAA,CAAC;IApBF,CAAC;CAqBJ;AAxBD,8DAwBC"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { SequelizeModel } from "@golemio/core/dist/output-gateway/models";
|
|
2
|
-
export interface LocationConfigOptions {
|
|
3
|
-
ltStart: string;
|
|
4
|
-
ltEnd: string;
|
|
5
|
-
}
|
|
6
|
-
export declare class RsdTmcOsmMappingModel extends SequelizeModel {
|
|
7
|
-
constructor();
|
|
8
|
-
/**
|
|
9
|
-
* @param {object} [options] Options object with params
|
|
10
|
-
* @param {string} [options.ltStart] Options object with params
|
|
11
|
-
* @param {string} [options.ltEnd] Options object with params
|
|
12
|
-
* @returns Array of the retrieved records
|
|
13
|
-
*/
|
|
14
|
-
GetOne: (options: LocationConfigOptions) => Promise<any>;
|
|
15
|
-
GetAll: () => Promise<object | null>;
|
|
16
|
-
}
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
-
};
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.RsdTmcOsmMappingModel = void 0;
|
|
16
|
-
const sequelize_1 = __importDefault(require("@golemio/core/dist/shared/sequelize"));
|
|
17
|
-
const golemio_errors_1 = require("@golemio/core/dist/shared/golemio-errors");
|
|
18
|
-
const models_1 = require("@golemio/core/dist/output-gateway/models");
|
|
19
|
-
const _sch_1 = require("../../schema-definitions");
|
|
20
|
-
class RsdTmcOsmMappingModel extends models_1.SequelizeModel {
|
|
21
|
-
constructor() {
|
|
22
|
-
super(_sch_1.FCD.rsd_tmc_osm_mapping.name + "Model", _sch_1.FCD.rsd_tmc_osm_mapping.pgTableName, _sch_1.FCD.rsd_tmc_osm_mapping.outputSequelizeAttributes, {
|
|
23
|
-
schema: "public",
|
|
24
|
-
});
|
|
25
|
-
/**
|
|
26
|
-
* @param {object} [options] Options object with params
|
|
27
|
-
* @param {string} [options.ltStart] Options object with params
|
|
28
|
-
* @param {string} [options.ltEnd] Options object with params
|
|
29
|
-
* @returns Array of the retrieved records
|
|
30
|
-
*/
|
|
31
|
-
this.GetOne = (options) => __awaiter(this, void 0, void 0, function* () {
|
|
32
|
-
if (!options.ltStart || !options.ltEnd)
|
|
33
|
-
return null;
|
|
34
|
-
try {
|
|
35
|
-
const Op = sequelize_1.default.Op;
|
|
36
|
-
const where = {
|
|
37
|
-
[Op.and]: [{}],
|
|
38
|
-
};
|
|
39
|
-
where[Op.and].push({
|
|
40
|
-
lt_start: Number(options.ltStart),
|
|
41
|
-
});
|
|
42
|
-
where[Op.and].push({
|
|
43
|
-
lt_end: Number(options.ltEnd),
|
|
44
|
-
});
|
|
45
|
-
const rsdTmcOsmMappingFromDB = yield this.sequelizeModel.findOne({
|
|
46
|
-
raw: true,
|
|
47
|
-
where,
|
|
48
|
-
});
|
|
49
|
-
try {
|
|
50
|
-
return JSON.parse(rsdTmcOsmMappingFromDB === null || rsdTmcOsmMappingFromDB === void 0 ? void 0 : rsdTmcOsmMappingFromDB.osm_path);
|
|
51
|
-
}
|
|
52
|
-
catch (e) {
|
|
53
|
-
return null;
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
catch (err) {
|
|
57
|
-
throw new golemio_errors_1.CustomError(`GetOne method error: ${err.message}`, true, "RsdTmcOsmMappingModel", 500, err);
|
|
58
|
-
}
|
|
59
|
-
});
|
|
60
|
-
this.GetAll = () => __awaiter(this, void 0, void 0, function* () {
|
|
61
|
-
throw new golemio_errors_1.CustomError("Not implemented", true, "RsdTmcOsmMappingModel");
|
|
62
|
-
});
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
exports.RsdTmcOsmMappingModel = RsdTmcOsmMappingModel;
|
|
66
|
-
//# sourceMappingURL=RsdTmcOsmMappingModel.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"RsdTmcOsmMappingModel.js","sourceRoot":"","sources":["../../../src/output-gateway/models/RsdTmcOsmMappingModel.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,oFAA4D;AAC5D,6EAAuE;AACvE,qEAA0E;AAC1E,mDAA2B;AAO3B,MAAa,qBAAsB,SAAQ,uBAAc;IACrD;QACI,KAAK,CACD,UAAG,CAAC,mBAAmB,CAAC,IAAI,GAAG,OAAO,EACtC,UAAG,CAAC,mBAAmB,CAAC,WAAW,EACnC,UAAG,CAAC,mBAAmB,CAAC,yBAAyB,EACjD;YACI,MAAM,EAAE,QAAQ;SACnB,CACJ,CAAC;QAGN;;;;;WAKG;QAEI,WAAM,GAAG,CAAO,OAA8B,EAAgB,EAAE;YACnE,IAAI,CAAC,OAAO,CAAC,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK;gBAAE,OAAO,IAAI,CAAC;YAEpD,IAAI;gBACA,MAAM,EAAE,GAAG,mBAAS,CAAC,EAAE,CAAC;gBACxB,MAAM,KAAK,GAAG;oBACV,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC;iBACjB,CAAC;gBAEF,KAAK,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC;oBACf,QAAQ,EAAE,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC;iBACpC,CAAC,CAAC;gBAEH,KAAK,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC;oBACf,MAAM,EAAE,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC;iBAChC,CAAC,CAAC;gBAEH,MAAM,sBAAsB,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC;oBAC7D,GAAG,EAAE,IAAI;oBACT,KAAK;iBACR,CAAC,CAAC;gBAEH,IAAI;oBACA,OAAO,IAAI,CAAC,KAAK,CAAC,sBAAsB,aAAtB,sBAAsB,uBAAtB,sBAAsB,CAAE,QAAQ,CAAC,CAAC;iBACvD;gBAAC,OAAO,CAAC,EAAE;oBACR,OAAO,IAAI,CAAC;iBACf;aACJ;YAAC,OAAO,GAAG,EAAE;gBACV,MAAM,IAAI,4BAAW,CAAC,wBAAwB,GAAG,CAAC,OAAO,EAAE,EAAE,IAAI,EAAE,uBAAuB,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;aACzG;QACL,CAAC,CAAA,CAAC;QAEK,WAAM,GAAG,GAAiC,EAAE;YAC/C,MAAM,IAAI,4BAAW,CAAC,iBAAiB,EAAE,IAAI,EAAE,uBAAuB,CAAC,CAAC;QAC5E,CAAC,CAAA,CAAC;IA3CF,CAAC;CA4CJ;AAtDD,sDAsDC"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import Sequelize from "@golemio/core/dist/shared/sequelize";
|
|
2
|
-
export declare const outputRsdTmcOsmMappingSDMA: Sequelize.ModelAttributes<any>;
|
|
3
|
-
export declare const outputRsdTmcOsmMappingSchema: {
|
|
4
|
-
type: string;
|
|
5
|
-
required: string[];
|
|
6
|
-
additionalProperties: boolean;
|
|
7
|
-
properties: {
|
|
8
|
-
lt_start: {
|
|
9
|
-
type: string;
|
|
10
|
-
};
|
|
11
|
-
lt_end: {
|
|
12
|
-
type: string;
|
|
13
|
-
};
|
|
14
|
-
osm_path: {
|
|
15
|
-
type: string;
|
|
16
|
-
};
|
|
17
|
-
};
|
|
18
|
-
};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.outputRsdTmcOsmMappingSchema = exports.outputRsdTmcOsmMappingSDMA = void 0;
|
|
7
|
-
const sequelize_1 = __importDefault(require("@golemio/core/dist/shared/sequelize"));
|
|
8
|
-
// outputSequelizeAttributes
|
|
9
|
-
exports.outputRsdTmcOsmMappingSDMA = {
|
|
10
|
-
lt_start: { type: sequelize_1.default.INTEGER },
|
|
11
|
-
lt_end: { type: sequelize_1.default.INTEGER },
|
|
12
|
-
osm_path: {
|
|
13
|
-
type: sequelize_1.default.STRING,
|
|
14
|
-
},
|
|
15
|
-
};
|
|
16
|
-
exports.outputRsdTmcOsmMappingSchema = {
|
|
17
|
-
type: "object",
|
|
18
|
-
required: ["lt_start", "lt_end", "osm_path"],
|
|
19
|
-
additionalProperties: false,
|
|
20
|
-
properties: {
|
|
21
|
-
lt_start: { type: "number" },
|
|
22
|
-
lt_end: { type: "number" },
|
|
23
|
-
osm_path: { type: "string" },
|
|
24
|
-
},
|
|
25
|
-
};
|
|
26
|
-
//# sourceMappingURL=rsd_tmc_osm_mapping_output_schema.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"rsd_tmc_osm_mapping_output_schema.js","sourceRoot":"","sources":["../../../src/schema-definitions/schemas/rsd_tmc_osm_mapping_output_schema.ts"],"names":[],"mappings":";;;;;;AAAA,oFAA4D;AAE5D,4BAA4B;AACf,QAAA,0BAA0B,GAAmC;IACtE,QAAQ,EAAE,EAAE,IAAI,EAAE,mBAAS,CAAC,OAAO,EAAE;IACrC,MAAM,EAAE,EAAE,IAAI,EAAE,mBAAS,CAAC,OAAO,EAAE;IACnC,QAAQ,EAAE;QACN,IAAI,EAAE,mBAAS,CAAC,MAAM;KACzB;CACJ,CAAC;AAEW,QAAA,4BAA4B,GAAG;IACxC,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE,CAAC,UAAU,EAAE,QAAQ,EAAE,UAAU,CAAC;IAC5C,oBAAoB,EAAE,KAAK;IAC3B,UAAU,EAAE;QACR,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;QAC5B,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;QAC1B,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;KAC/B;CACJ,CAAC"}
|