@golemio/traffic-common 0.1.0-dev.851739354
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/LICENSE +11 -0
- package/README.md +46 -0
- package/db/example/.config.json +3 -0
- package/db/example/00_reset.sql +1 -0
- package/db/migrations/postgresql/.config.json +3 -0
- package/db/migrations/postgresql/20230420143011-rsd_tmc_osm_mapping.js +53 -0
- package/db/migrations/postgresql/package.json +3 -0
- package/db/migrations/postgresql/sqls/20230420143011-rsd_tmc_osm_mapping-down.sql +1 -0
- package/db/migrations/postgresql/sqls/20230420143011-rsd_tmc_osm_mapping-up.sql +6 -0
- package/db/migrations/postgresql/sqls/package.json +3 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +30 -0
- package/dist/index.js.map +1 -0
- package/dist/integration-engine/datasources/RsdTmcOsmMappingDataSourceFactory.d.ts +4 -0
- package/dist/integration-engine/datasources/RsdTmcOsmMappingDataSourceFactory.js +36 -0
- package/dist/integration-engine/datasources/RsdTmcOsmMappingDataSourceFactory.js.map +1 -0
- package/dist/integration-engine/index.d.ts +1 -0
- package/dist/integration-engine/index.js +7 -0
- package/dist/integration-engine/index.js.map +1 -0
- package/dist/integration-engine/ioc/Di.d.ts +3 -0
- package/dist/integration-engine/ioc/Di.js +28 -0
- package/dist/integration-engine/ioc/Di.js.map +1 -0
- package/dist/integration-engine/ioc/ModuleContainerToken.d.ts +5 -0
- package/dist/integration-engine/ioc/ModuleContainerToken.js +9 -0
- package/dist/integration-engine/ioc/ModuleContainerToken.js.map +1 -0
- package/dist/integration-engine/repositories/RsdTmcOsmMappingRepository.d.ts +8 -0
- package/dist/integration-engine/repositories/RsdTmcOsmMappingRepository.js +73 -0
- package/dist/integration-engine/repositories/RsdTmcOsmMappingRepository.js.map +1 -0
- package/dist/integration-engine/workers/RsdTmcOsmMappingWorker.d.ts +5 -0
- package/dist/integration-engine/workers/RsdTmcOsmMappingWorker.js +16 -0
- package/dist/integration-engine/workers/RsdTmcOsmMappingWorker.js.map +1 -0
- package/dist/integration-engine/workers/index.d.ts +2 -0
- package/dist/integration-engine/workers/index.js +6 -0
- package/dist/integration-engine/workers/index.js.map +1 -0
- package/dist/integration-engine/workers/tasks/RefreshRsdTmcOsmMappingDataTask.d.ts +12 -0
- package/dist/integration-engine/workers/tasks/RefreshRsdTmcOsmMappingDataTask.js +48 -0
- package/dist/integration-engine/workers/tasks/RefreshRsdTmcOsmMappingDataTask.js.map +1 -0
- package/dist/schema-definitions/datasources/RsdTmcOsmMapping.d.ts +6 -0
- package/dist/schema-definitions/datasources/RsdTmcOsmMapping.js +9 -0
- package/dist/schema-definitions/datasources/RsdTmcOsmMapping.js.map +1 -0
- package/dist/schema-definitions/index.d.ts +2 -0
- package/dist/schema-definitions/index.js +19 -0
- package/dist/schema-definitions/index.js.map +1 -0
- package/dist/schema-definitions/models/RsdTmcOsmMappingModel.d.ts +10 -0
- package/dist/schema-definitions/models/RsdTmcOsmMappingModel.js +32 -0
- package/dist/schema-definitions/models/RsdTmcOsmMappingModel.js.map +1 -0
- package/docs/implementation_documentation.md +54 -0
- package/package.json +67 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2019 Operátor ICT, a.s.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
6
|
+
|
|
7
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
8
|
+
|
|
9
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
10
|
+
|
|
11
|
+
Source: http://opensource.org/licenses/MIT
|
package/README.md
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
<p>
|
|
3
|
+
<a href="https://operatorict.cz">
|
|
4
|
+
<img src="https://gitlab.com/operator-ict/golemio/code/modules/core/-/raw/development/.assets/oict_logo.png" alt="oict" width="100px" height="100px" />
|
|
5
|
+
</a>
|
|
6
|
+
<a href="https://golemio.cz">
|
|
7
|
+
<img src="https://gitlab.com/operator-ict/golemio/code/modules/core/-/raw/development/.assets/golemio_logo.png" alt="golemio" width="100px" height="100px" />
|
|
8
|
+
</a>
|
|
9
|
+
</p>
|
|
10
|
+
|
|
11
|
+
<h1>@golemio/traffic-common</h1>
|
|
12
|
+
|
|
13
|
+
<p>
|
|
14
|
+
<a href="https://gitlab.com/operator-ict/golemio/code/modules/traffic-common/commits/master">
|
|
15
|
+
<img src="https://gitlab.com/operator-ict/golemio/code/modules/traffic-common/badges/master/pipeline.svg" alt="pipeline">
|
|
16
|
+
</a>
|
|
17
|
+
<a href="https://gitlab.com/operator-ict/golemio/code/modules/traffic-common/commits/master">
|
|
18
|
+
<img src="https://gitlab.com/operator-ict/golemio/code/modules/traffic-common/badges/master/coverage.svg" alt="coverage">
|
|
19
|
+
</a>
|
|
20
|
+
<a href="./LICENSE">
|
|
21
|
+
<img src="https://img.shields.io/npm/l/@golemio/traffic-common" alt="license">
|
|
22
|
+
</a>
|
|
23
|
+
</p>
|
|
24
|
+
|
|
25
|
+
<p>
|
|
26
|
+
<a href="#installation">Installation</a> · <a href="./docs">Documentation</a> · <a href="https://operator-ict.gitlab.io/golemio/code/modules/traffic-common">TypeDoc</a>
|
|
27
|
+
</p>
|
|
28
|
+
</div>
|
|
29
|
+
|
|
30
|
+
This module is intended for use with Golemio services. Refer [here](https://gitlab.com/operator-ict/golemio/code/modules/core/-/blob/development/README.md) for further information on usage, local development and more.
|
|
31
|
+
|
|
32
|
+
## Installation
|
|
33
|
+
|
|
34
|
+
The APIs may be unstable. Therefore, we recommend to install this module as an exact version.
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
# Latest version
|
|
38
|
+
npm install --save-exact @golemio/traffic-common@latest
|
|
39
|
+
|
|
40
|
+
# Development version
|
|
41
|
+
npm install --save-exact @golemio/traffic-common@dev
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Description
|
|
45
|
+
|
|
46
|
+
This module handles supporting traffic data used in other modules (FCD and NDIC).
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/* Nothing to do */
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var dbm;
|
|
4
|
+
var type;
|
|
5
|
+
var seed;
|
|
6
|
+
var fs = require('fs');
|
|
7
|
+
var path = require('path');
|
|
8
|
+
var Promise;
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* We receive the dbmigrate dependency from dbmigrate initially.
|
|
12
|
+
* This enables us to not have to rely on NODE_PATH.
|
|
13
|
+
*/
|
|
14
|
+
exports.setup = function(options, seedLink) {
|
|
15
|
+
dbm = options.dbmigrate;
|
|
16
|
+
type = dbm.dataType;
|
|
17
|
+
seed = seedLink;
|
|
18
|
+
Promise = options.Promise;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
exports.up = function(db) {
|
|
22
|
+
var filePath = path.join(__dirname, 'sqls', '20230420143011-rsd_tmc_osm_mapping-up.sql');
|
|
23
|
+
return new Promise( function( resolve, reject ) {
|
|
24
|
+
fs.readFile(filePath, {encoding: 'utf-8'}, function(err,data){
|
|
25
|
+
if (err) return reject(err);
|
|
26
|
+
console.log('received data: ' + data);
|
|
27
|
+
|
|
28
|
+
resolve(data);
|
|
29
|
+
});
|
|
30
|
+
})
|
|
31
|
+
.then(function(data) {
|
|
32
|
+
return db.runSql(data);
|
|
33
|
+
});
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
exports.down = function(db) {
|
|
37
|
+
var filePath = path.join(__dirname, 'sqls', '20230420143011-rsd_tmc_osm_mapping-down.sql');
|
|
38
|
+
return new Promise( function( resolve, reject ) {
|
|
39
|
+
fs.readFile(filePath, {encoding: 'utf-8'}, function(err,data){
|
|
40
|
+
if (err) return reject(err);
|
|
41
|
+
console.log('received data: ' + data);
|
|
42
|
+
|
|
43
|
+
resolve(data);
|
|
44
|
+
});
|
|
45
|
+
})
|
|
46
|
+
.then(function(data) {
|
|
47
|
+
return db.runSql(data);
|
|
48
|
+
});
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
exports._meta = {
|
|
52
|
+
"version": 1
|
|
53
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
drop TABLE traffic.rsd_tmc_osm_mapping cascade;
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.SchemaDefinitions = exports.IntegrationEngine = void 0;
|
|
27
|
+
// Library exports
|
|
28
|
+
exports.IntegrationEngine = __importStar(require("./integration-engine/index"));
|
|
29
|
+
exports.SchemaDefinitions = __importStar(require("./schema-definitions/index"));
|
|
30
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kBAAkB;AAClB,gFAA+C;AAC/C,gFAAgD"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.RsdTmcOsmMappingDataSourceFactory = void 0;
|
|
10
|
+
const integration_engine_1 = require("@golemio/core/dist/integration-engine");
|
|
11
|
+
const _sch_1 = require("../../schema-definitions");
|
|
12
|
+
const tsyringe_1 = require("@golemio/core/dist/shared/tsyringe");
|
|
13
|
+
const HTTPProtocolStrategyStreamed_1 = require("@golemio/core/dist/integration-engine/datasources/protocol-strategy/HTTPProtocolStrategyStreamed");
|
|
14
|
+
let RsdTmcOsmMappingDataSourceFactory = class RsdTmcOsmMappingDataSourceFactory {
|
|
15
|
+
getDataSource(dataUrl) {
|
|
16
|
+
return new integration_engine_1.DataSourceStreamed(_sch_1.RsdTmcOsmMappingTable.name + "DataSource", new HTTPProtocolStrategyStreamed_1.HTTPProtocolStrategyStreamed({
|
|
17
|
+
headers: {},
|
|
18
|
+
method: "GET",
|
|
19
|
+
url: dataUrl,
|
|
20
|
+
}), new integration_engine_1.CSVDataTypeStrategy({
|
|
21
|
+
fastcsvParams: {
|
|
22
|
+
headers: true,
|
|
23
|
+
},
|
|
24
|
+
subscribe: (row) => ({
|
|
25
|
+
lt_start: Number(row.lt_start),
|
|
26
|
+
lt_end: Number(row.lt_end),
|
|
27
|
+
osm_path: row.osm_path,
|
|
28
|
+
}),
|
|
29
|
+
}));
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
RsdTmcOsmMappingDataSourceFactory = __decorate([
|
|
33
|
+
(0, tsyringe_1.injectable)()
|
|
34
|
+
], RsdTmcOsmMappingDataSourceFactory);
|
|
35
|
+
exports.RsdTmcOsmMappingDataSourceFactory = RsdTmcOsmMappingDataSourceFactory;
|
|
36
|
+
//# sourceMappingURL=RsdTmcOsmMappingDataSourceFactory.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RsdTmcOsmMappingDataSourceFactory.js","sourceRoot":"","sources":["../../../src/integration-engine/datasources/RsdTmcOsmMappingDataSourceFactory.ts"],"names":[],"mappings":";;;;;;;;;AAAA,8EAAgG;AAChG,mDAA6C;AAC7C,iEAAgE;AAChE,mJAAgJ;AAGhJ,IAAa,iCAAiC,GAA9C,MAAa,iCAAiC;IACnC,aAAa,CAAC,OAAe;QAChC,OAAO,IAAI,uCAAkB,CACzB,4BAAqB,CAAC,IAAI,GAAG,YAAY,EACzC,IAAI,2DAA4B,CAAC;YAC7B,OAAO,EAAE,EAAE;YACX,MAAM,EAAE,KAAK;YACb,GAAG,EAAE,OAAO;SACf,CAAC,EACF,IAAI,wCAAmB,CAAC;YACpB,aAAa,EAAE;gBACX,OAAO,EAAE,IAAI;aAChB;YACD,SAAS,EAAE,CAAC,GAAQ,EAAE,EAAE,CAAC,CAAC;gBACtB,QAAQ,EAAE,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC;gBAC9B,MAAM,EAAE,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC;gBAC1B,QAAQ,EAAE,GAAG,CAAC,QAAQ;aACzB,CAAC;SACL,CAAC,CACL,CAAC;IACN,CAAC;CACJ,CAAA;AArBY,iCAAiC;IAD7C,IAAA,qBAAU,GAAE;GACA,iCAAiC,CAqB7C;AArBY,8EAAiC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { workers } from "./workers";
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.workers = void 0;
|
|
4
|
+
/* ie/index.ts */
|
|
5
|
+
var workers_1 = require("./workers");
|
|
6
|
+
Object.defineProperty(exports, "workers", { enumerable: true, get: function () { return workers_1.workers; } });
|
|
7
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/integration-engine/index.ts"],"names":[],"mappings":";;;AAAA,iBAAiB;AACjB,qCAAoC;AAA3B,kGAAA,OAAO,OAAA"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TrafficCommonContainer = void 0;
|
|
4
|
+
const Di_1 = require("@golemio/core/dist/integration-engine/ioc/Di");
|
|
5
|
+
const tsyringe_1 = require("@golemio/core/dist/shared/tsyringe");
|
|
6
|
+
const ModuleContainerToken_1 = require("./ModuleContainerToken");
|
|
7
|
+
const RsdTmcOsmMappingRepository_1 = require("../repositories/RsdTmcOsmMappingRepository");
|
|
8
|
+
const RsdTmcOsmMappingDataSourceFactory_1 = require("../datasources/RsdTmcOsmMappingDataSourceFactory");
|
|
9
|
+
const ioc_1 = require("@golemio/core/dist/integration-engine/ioc");
|
|
10
|
+
//#region Initialization
|
|
11
|
+
const TrafficCommonContainer = Di_1.IntegrationEngineContainer.createChildContainer();
|
|
12
|
+
exports.TrafficCommonContainer = TrafficCommonContainer;
|
|
13
|
+
//#endregion
|
|
14
|
+
//#region Datasources
|
|
15
|
+
TrafficCommonContainer.register(ModuleContainerToken_1.ModuleContainerToken.RsdTmcOsmMappingDataSource, {
|
|
16
|
+
useFactory: (0, tsyringe_1.instanceCachingFactory)(() => {
|
|
17
|
+
const config = Di_1.IntegrationEngineContainer.resolve(ioc_1.ContainerToken.Config);
|
|
18
|
+
return new RsdTmcOsmMappingDataSourceFactory_1.RsdTmcOsmMappingDataSourceFactory().getDataSource(config.datasources.TrafficCommon.RsdTmcOsmMapping.url);
|
|
19
|
+
}),
|
|
20
|
+
});
|
|
21
|
+
//#endregion
|
|
22
|
+
//#region Transformations
|
|
23
|
+
//#endregion
|
|
24
|
+
//#region Helpers
|
|
25
|
+
//#endregion
|
|
26
|
+
//#region Repositories
|
|
27
|
+
TrafficCommonContainer.registerSingleton(ModuleContainerToken_1.ModuleContainerToken.RsdTmcOsmMappingRepository, RsdTmcOsmMappingRepository_1.RsdTmcOsmMappingRepository);
|
|
28
|
+
//# sourceMappingURL=Di.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Di.js","sourceRoot":"","sources":["../../../src/integration-engine/ioc/Di.ts"],"names":[],"mappings":";;;AAAA,qEAA0F;AAC1F,iEAAiG;AACjG,iEAA8D;AAE9D,2FAAyF;AACzF,wGAAsG;AACtG,mEAA2E;AAE3E,wBAAwB;AACxB,MAAM,sBAAsB,GAAwB,+BAA0B,CAAC,oBAAoB,EAAE,CAAC;AA+B7F,wDAAsB;AA9B/B,YAAY;AAEZ,qBAAqB;AACrB,sBAAsB,CAAC,QAAQ,CAAa,2CAAoB,CAAC,0BAA0B,EAAE;IACzF,UAAU,EAAE,IAAA,iCAAsB,EAAa,GAAG,EAAE;QAChD,MAAM,MAAM,GAAmB,+BAA0B,CAAC,OAAO,CAAC,oBAAc,CAAC,MAAM,CAAC,CAAC;QACzF,OAAO,IAAI,qEAAiC,EAAE,CAAC,aAAa,CAAC,MAAM,CAAC,WAAW,CAAC,aAAa,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC;IACxH,CAAC,CAAC;CACL,CAAC,CAAC;AACH,YAAY;AAEZ,yBAAyB;AAEzB,YAAY;AAEZ,iBAAiB;AAEjB,YAAY;AAEZ,sBAAsB;AACtB,sBAAsB,CAAC,iBAAiB,CACpC,2CAAoB,CAAC,0BAA0B,EAC/C,uDAA0B,CAC7B,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ModuleContainerToken = void 0;
|
|
4
|
+
const ModuleContainerToken = {
|
|
5
|
+
RsdTmcOsmMappingDataSource: Symbol(),
|
|
6
|
+
RsdTmcOsmMappingRepository: Symbol(),
|
|
7
|
+
};
|
|
8
|
+
exports.ModuleContainerToken = ModuleContainerToken;
|
|
9
|
+
//# sourceMappingURL=ModuleContainerToken.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ModuleContainerToken.js","sourceRoot":"","sources":["../../../src/integration-engine/ioc/ModuleContainerToken.ts"],"names":[],"mappings":";;;AAAA,MAAM,oBAAoB,GAAG;IACzB,0BAA0B,EAAE,MAAM,EAAE;IACpC,0BAA0B,EAAE,MAAM,EAAE;CACvC,CAAC;AAEO,oDAAoB"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { IModel, PostgresModel } from "@golemio/core/dist/integration-engine/models";
|
|
2
|
+
import IPostgresConnector from "@golemio/core/dist/integration-engine/connectors/interfaces/IPostgresConnector";
|
|
3
|
+
import { IRsdTmcOsmMapping } from "../../schema-definitions";
|
|
4
|
+
export declare class RsdTmcOsmMappingRepository extends PostgresModel implements IModel {
|
|
5
|
+
private connector;
|
|
6
|
+
constructor(connector: IPostgresConnector);
|
|
7
|
+
updateData(data: IRsdTmcOsmMapping[]): Promise<void>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
+
};
|
|
14
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
15
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
16
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
17
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
18
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
19
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
20
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
|
+
exports.RsdTmcOsmMappingRepository = void 0;
|
|
25
|
+
const models_1 = require("@golemio/core/dist/integration-engine/models");
|
|
26
|
+
const tsyringe_1 = require("@golemio/core/dist/shared/tsyringe");
|
|
27
|
+
const RsdTmcOsmMappingModel_1 = require("../../schema-definitions/models/RsdTmcOsmMappingModel");
|
|
28
|
+
const golemio_validator_1 = require("@golemio/core/dist/shared/golemio-validator");
|
|
29
|
+
const ioc_1 = require("@golemio/core/dist/integration-engine/ioc");
|
|
30
|
+
const _sch_1 = require("../../schema-definitions");
|
|
31
|
+
let RsdTmcOsmMappingRepository = class RsdTmcOsmMappingRepository extends models_1.PostgresModel {
|
|
32
|
+
constructor(connector) {
|
|
33
|
+
super("RsdTmcOsmMappingRepository", {
|
|
34
|
+
outputSequelizeAttributes: RsdTmcOsmMappingModel_1.RsdTmcOsmMappingModel.attributeModel,
|
|
35
|
+
pgTableName: _sch_1.RsdTmcOsmMappingTable.pgTableName,
|
|
36
|
+
pgSchema: _sch_1.RsdTmcOsmMappingTable.pgSchema,
|
|
37
|
+
savingType: "insertOnly",
|
|
38
|
+
attributesToRemove: ["id"],
|
|
39
|
+
sequelizeAdditionalSettings: {
|
|
40
|
+
timestamps: false,
|
|
41
|
+
},
|
|
42
|
+
}, new golemio_validator_1.JSONSchemaValidator("RsdTmcOsmMappingValidator", RsdTmcOsmMappingModel_1.RsdTmcOsmMappingModel.jsonSchema));
|
|
43
|
+
this.connector = connector;
|
|
44
|
+
}
|
|
45
|
+
updateData(data) {
|
|
46
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
47
|
+
const connection = this.connector.getConnection();
|
|
48
|
+
const t = yield connection.transaction();
|
|
49
|
+
try {
|
|
50
|
+
yield this.validate(data);
|
|
51
|
+
yield this.sequelizeModel.destroy({
|
|
52
|
+
where: {},
|
|
53
|
+
transaction: t,
|
|
54
|
+
});
|
|
55
|
+
yield this.sequelizeModel.bulkCreate(data, {
|
|
56
|
+
transaction: t,
|
|
57
|
+
});
|
|
58
|
+
yield t.commit();
|
|
59
|
+
}
|
|
60
|
+
catch (err) {
|
|
61
|
+
yield t.rollback();
|
|
62
|
+
throw err;
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
RsdTmcOsmMappingRepository = __decorate([
|
|
68
|
+
(0, tsyringe_1.injectable)(),
|
|
69
|
+
__param(0, (0, tsyringe_1.inject)(ioc_1.ContainerToken.PostgresConnector)),
|
|
70
|
+
__metadata("design:paramtypes", [Object])
|
|
71
|
+
], RsdTmcOsmMappingRepository);
|
|
72
|
+
exports.RsdTmcOsmMappingRepository = RsdTmcOsmMappingRepository;
|
|
73
|
+
//# sourceMappingURL=RsdTmcOsmMappingRepository.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RsdTmcOsmMappingRepository.js","sourceRoot":"","sources":["../../../src/integration-engine/repositories/RsdTmcOsmMappingRepository.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,yEAAqF;AACrF,iEAAwE;AACxE,iGAA0E;AAC1E,mFAAkF;AAClF,mEAA2E;AAE3E,mDAAgE;AAGhE,IAAa,0BAA0B,GAAvC,MAAa,0BAA2B,SAAQ,sBAAa;IACzD,YAEY,SAA6B;QAErC,KAAK,CACD,4BAA4B,EAC5B;YACI,yBAAyB,EAAE,6CAAqB,CAAC,cAAc;YAC/D,WAAW,EAAE,4BAAqB,CAAC,WAAW;YAC9C,QAAQ,EAAE,4BAAqB,CAAC,QAAQ;YACxC,UAAU,EAAE,YAAY;YACxB,kBAAkB,EAAE,CAAC,IAAI,CAAC;YAC1B,2BAA2B,EAAE;gBACzB,UAAU,EAAE,KAAK;aACpB;SACJ,EACD,IAAI,uCAAmB,CAAC,2BAA2B,EAAE,6CAAqB,CAAC,UAAU,CAAC,CACzF,CAAC;QAfM,cAAS,GAAT,SAAS,CAAoB;IAgBzC,CAAC;IAEY,UAAU,CAAC,IAAyB;;YAC7C,MAAM,UAAU,GAAG,IAAI,CAAC,SAAS,CAAC,aAAa,EAAE,CAAC;YAClD,MAAM,CAAC,GAAG,MAAM,UAAU,CAAC,WAAW,EAAE,CAAC;YACzC,IAAI;gBACA,MAAM,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;gBAE1B,MAAM,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC;oBAC9B,KAAK,EAAE,EAAE;oBACT,WAAW,EAAE,CAAC;iBACjB,CAAC,CAAC;gBAEH,MAAM,IAAI,CAAC,cAAc,CAAC,UAAU,CAAwB,IAAI,EAAE;oBAC9D,WAAW,EAAE,CAAC;iBACjB,CAAC,CAAC;gBAEH,MAAM,CAAC,CAAC,MAAM,EAAE,CAAC;aACpB;YAAC,OAAO,GAAG,EAAE;gBACV,MAAM,CAAC,CAAC,QAAQ,EAAE,CAAC;gBACnB,MAAM,GAAG,CAAC;aACb;QACL,CAAC;KAAA;CACJ,CAAA;AA1CY,0BAA0B;IADtC,IAAA,qBAAU,GAAE;IAGJ,WAAA,IAAA,iBAAM,EAAC,oBAAc,CAAC,iBAAiB,CAAC,CAAA;;GAFpC,0BAA0B,CA0CtC;AA1CY,gEAA0B"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RsdTmcOsmMappingWorker = void 0;
|
|
4
|
+
const integration_engine_1 = require("@golemio/core/dist/integration-engine");
|
|
5
|
+
const RefreshRsdTmcOsmMappingDataTask_1 = require("./tasks/RefreshRsdTmcOsmMappingDataTask");
|
|
6
|
+
const ModuleContainerToken_1 = require("../ioc/ModuleContainerToken");
|
|
7
|
+
const Di_1 = require("../ioc/Di");
|
|
8
|
+
class RsdTmcOsmMappingWorker extends integration_engine_1.AbstractWorker {
|
|
9
|
+
constructor() {
|
|
10
|
+
super();
|
|
11
|
+
this.name = "RsdTmcOsmMapping";
|
|
12
|
+
this.registerTask(new RefreshRsdTmcOsmMappingDataTask_1.RefreshRsdTmcOsmMappingDataTask(this.getQueuePrefix(), Di_1.TrafficCommonContainer.resolve(ModuleContainerToken_1.ModuleContainerToken.RsdTmcOsmMappingDataSource), Di_1.TrafficCommonContainer.resolve(ModuleContainerToken_1.ModuleContainerToken.RsdTmcOsmMappingRepository)));
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
exports.RsdTmcOsmMappingWorker = RsdTmcOsmMappingWorker;
|
|
16
|
+
//# sourceMappingURL=RsdTmcOsmMappingWorker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RsdTmcOsmMappingWorker.js","sourceRoot":"","sources":["../../../src/integration-engine/workers/RsdTmcOsmMappingWorker.ts"],"names":[],"mappings":";;;AAAA,8EAAuE;AACvE,6FAA0F;AAC1F,sEAAoE;AACpE,kCAAoD;AAEpD,MAAa,sBAAuB,SAAQ,mCAAc;IAGtD;QACI,KAAK,EAAE,CAAC;QAHF,SAAI,GAAG,kBAAkB,CAAC;QAIhC,IAAI,CAAC,YAAY,CACb,IAAI,iEAA+B,CAC/B,IAAI,CAAC,cAAc,EAAE,EACrB,2BAAsB,CAAC,OAAO,CAAC,2CAAoB,CAAC,0BAA0B,CAAC,EAC/E,2BAAsB,CAAC,OAAO,CAAC,2CAAoB,CAAC,0BAA0B,CAAC,CAClF,CACJ,CAAC;IACN,CAAC;CACJ;AAbD,wDAaC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.workers = void 0;
|
|
4
|
+
const RsdTmcOsmMappingWorker_1 = require("./RsdTmcOsmMappingWorker");
|
|
5
|
+
exports.workers = [RsdTmcOsmMappingWorker_1.RsdTmcOsmMappingWorker];
|
|
6
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/integration-engine/workers/index.ts"],"names":[],"mappings":";;;AAAA,qEAA4E;AAE/D,QAAA,OAAO,GAAG,CAAC,+CAAsB,CAAC,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { AbstractEmptyTask, DataSourceStreamed } from "@golemio/core/dist/integration-engine";
|
|
2
|
+
import { RsdTmcOsmMappingRepository } from "../../repositories/RsdTmcOsmMappingRepository";
|
|
3
|
+
export declare class RefreshRsdTmcOsmMappingDataTask extends AbstractEmptyTask {
|
|
4
|
+
private dataSource;
|
|
5
|
+
private repository;
|
|
6
|
+
readonly queueName = "RsdTmsOsmMappingRefresh";
|
|
7
|
+
readonly queueTtl: number;
|
|
8
|
+
constructor(queuePrefix: string, dataSource: DataSourceStreamed, repository: RsdTmcOsmMappingRepository);
|
|
9
|
+
protected execute(): Promise<void>;
|
|
10
|
+
private onDataFunction;
|
|
11
|
+
private processDataStream;
|
|
12
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.RefreshRsdTmcOsmMappingDataTask = void 0;
|
|
13
|
+
const integration_engine_1 = require("@golemio/core/dist/integration-engine");
|
|
14
|
+
const golemio_errors_1 = require("@golemio/core/dist/shared/golemio-errors");
|
|
15
|
+
class RefreshRsdTmcOsmMappingDataTask extends integration_engine_1.AbstractEmptyTask {
|
|
16
|
+
constructor(queuePrefix, dataSource, repository) {
|
|
17
|
+
super(queuePrefix);
|
|
18
|
+
this.dataSource = dataSource;
|
|
19
|
+
this.repository = repository;
|
|
20
|
+
this.queueName = "RsdTmsOsmMappingRefresh";
|
|
21
|
+
this.queueTtl = 59 * 60 * 1000; // 59 minutes
|
|
22
|
+
this.onDataFunction = (data) => __awaiter(this, void 0, void 0, function* () {
|
|
23
|
+
return this.repository.updateData(data);
|
|
24
|
+
});
|
|
25
|
+
this.processDataStream = (dataSourceStream, onDataFunction) => __awaiter(this, void 0, void 0, function* () {
|
|
26
|
+
let dataStream;
|
|
27
|
+
try {
|
|
28
|
+
dataStream = yield dataSourceStream;
|
|
29
|
+
}
|
|
30
|
+
catch (err) {
|
|
31
|
+
throw new golemio_errors_1.CustomError("Error while getting data.", true, this.constructor.name, 5050, err);
|
|
32
|
+
}
|
|
33
|
+
try {
|
|
34
|
+
yield dataStream.setDataProcessor(onDataFunction).proceed();
|
|
35
|
+
}
|
|
36
|
+
catch (err) {
|
|
37
|
+
throw new golemio_errors_1.CustomError("Error while processing data.", true, this.constructor.name, 5051, err);
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
execute() {
|
|
42
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
43
|
+
yield this.processDataStream(this.dataSource.getAll(true), this.onDataFunction);
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
exports.RefreshRsdTmcOsmMappingDataTask = RefreshRsdTmcOsmMappingDataTask;
|
|
48
|
+
//# sourceMappingURL=RefreshRsdTmcOsmMappingDataTask.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RefreshRsdTmcOsmMappingDataTask.js","sourceRoot":"","sources":["../../../../src/integration-engine/workers/tasks/RefreshRsdTmcOsmMappingDataTask.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,8EAAgH;AAEhH,6EAAuE;AAGvE,MAAa,+BAAgC,SAAQ,sCAAiB;IAIlE,YAAY,WAAmB,EAAU,UAA8B,EAAU,UAAsC;QACnH,KAAK,CAAC,WAAW,CAAC,CAAC;QADkB,eAAU,GAAV,UAAU,CAAoB;QAAU,eAAU,GAAV,UAAU,CAA4B;QAHvG,cAAS,GAAG,yBAAyB,CAAC;QACtC,aAAQ,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC,aAAa;QAUhD,mBAAc,GAAG,CAAO,IAAyB,EAAiB,EAAE;YACxE,OAAO,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;QAC5C,CAAC,CAAA,CAAC;QAEM,sBAAiB,GAAG,CACxB,gBAA2C,EAC3C,cAA4C,EAC/B,EAAE;YACf,IAAI,UAA4B,CAAC;YAEjC,IAAI;gBACA,UAAU,GAAG,MAAM,gBAAgB,CAAC;aACvC;YAAC,OAAO,GAAG,EAAE;gBACV,MAAM,IAAI,4BAAW,CAAC,2BAA2B,EAAE,IAAI,EAAE,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,CAAC,CAAC;aAC9F;YAED,IAAI;gBACA,MAAM,UAAU,CAAC,gBAAgB,CAAC,cAAc,CAAC,CAAC,OAAO,EAAE,CAAC;aAC/D;YAAC,OAAO,GAAG,EAAE;gBACV,MAAM,IAAI,4BAAW,CAAC,8BAA8B,EAAE,IAAI,EAAE,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,CAAC,CAAC;aACjG;QACL,CAAC,CAAA,CAAC;IA3BF,CAAC;IAEe,OAAO;;YACnB,MAAM,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;QACpF,CAAC;KAAA;CAwBJ;AAlCD,0EAkCC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RsdTmcOsmMappingTable = void 0;
|
|
4
|
+
exports.RsdTmcOsmMappingTable = {
|
|
5
|
+
name: "RsdTmcOsmMapping",
|
|
6
|
+
pgSchema: "traffic",
|
|
7
|
+
pgTableName: "rsd_tmc_osm_mapping",
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=RsdTmcOsmMapping.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RsdTmcOsmMapping.js","sourceRoot":"","sources":["../../../src/schema-definitions/datasources/RsdTmcOsmMapping.ts"],"names":[],"mappings":";;;AAAa,QAAA,qBAAqB,GAAQ;IACtC,IAAI,EAAE,kBAAkB;IACxB,QAAQ,EAAE,SAAS;IACnB,WAAW,EAAE,qBAAqB;CACrC,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./datasources/RsdTmcOsmMapping"), exports);
|
|
18
|
+
__exportStar(require("./models/RsdTmcOsmMappingModel"), exports);
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/schema-definitions/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,iEAA+C;AAC/C,iEAA+C"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { IRsdTmcOsmMapping } from "./..";
|
|
2
|
+
import { Model, ModelAttributes } from "@golemio/core/dist/shared/sequelize";
|
|
3
|
+
import { JSONSchemaType } from "@golemio/core/dist/shared/ajv";
|
|
4
|
+
export declare class RsdTmcOsmMappingModel extends Model<IRsdTmcOsmMapping> implements IRsdTmcOsmMapping {
|
|
5
|
+
lt_start: number;
|
|
6
|
+
lt_end: number;
|
|
7
|
+
osm_path: string;
|
|
8
|
+
static attributeModel: ModelAttributes<RsdTmcOsmMappingModel>;
|
|
9
|
+
static jsonSchema: JSONSchemaType<IRsdTmcOsmMapping[]>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RsdTmcOsmMappingModel = void 0;
|
|
4
|
+
const sequelize_1 = require("@golemio/core/dist/shared/sequelize");
|
|
5
|
+
class RsdTmcOsmMappingModel extends sequelize_1.Model {
|
|
6
|
+
}
|
|
7
|
+
exports.RsdTmcOsmMappingModel = RsdTmcOsmMappingModel;
|
|
8
|
+
RsdTmcOsmMappingModel.attributeModel = {
|
|
9
|
+
lt_start: {
|
|
10
|
+
type: sequelize_1.DataTypes.INTEGER,
|
|
11
|
+
},
|
|
12
|
+
lt_end: {
|
|
13
|
+
type: sequelize_1.DataTypes.INTEGER,
|
|
14
|
+
},
|
|
15
|
+
osm_path: {
|
|
16
|
+
type: sequelize_1.DataTypes.STRING,
|
|
17
|
+
},
|
|
18
|
+
};
|
|
19
|
+
RsdTmcOsmMappingModel.jsonSchema = {
|
|
20
|
+
type: "array",
|
|
21
|
+
items: {
|
|
22
|
+
type: "object",
|
|
23
|
+
required: ["lt_start", "lt_end", "osm_path"],
|
|
24
|
+
additionalProperties: false,
|
|
25
|
+
properties: {
|
|
26
|
+
lt_start: { type: "number" },
|
|
27
|
+
lt_end: { type: "number" },
|
|
28
|
+
osm_path: { type: "string" },
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
};
|
|
32
|
+
//# sourceMappingURL=RsdTmcOsmMappingModel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RsdTmcOsmMappingModel.js","sourceRoot":"","sources":["../../../src/schema-definitions/models/RsdTmcOsmMappingModel.ts"],"names":[],"mappings":";;;AACA,mEAAwF;AAGxF,MAAa,qBAAsB,SAAQ,iBAAwB;;AAAnE,sDA8BC;AAzBiB,oCAAc,GAA2C;IACnE,QAAQ,EAAE;QACN,IAAI,EAAE,qBAAS,CAAC,OAAO;KAC1B;IACD,MAAM,EAAE;QACJ,IAAI,EAAE,qBAAS,CAAC,OAAO;KAC1B;IACD,QAAQ,EAAE;QACN,IAAI,EAAE,qBAAS,CAAC,MAAM;KACzB;CACJ,CAAC;AAEY,gCAAU,GAAwC;IAC5D,IAAI,EAAE,OAAO;IACb,KAAK,EAAE;QACH,IAAI,EAAE,QAAQ;QACd,QAAQ,EAAE,CAAC,UAAU,EAAE,QAAQ,EAAE,UAAU,CAAC;QAC5C,oBAAoB,EAAE,KAAK;QAC3B,UAAU,EAAE;YACR,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;YAC5B,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;YAC1B,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;SAC/B;KACJ;CACJ,CAAC"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# Implementační dokumentace modulu *traffic-common*
|
|
2
|
+
|
|
3
|
+
## Záměr
|
|
4
|
+
|
|
5
|
+
Modul spravuje dopravní data využívaná ostatními moduly (konkrétně NDIC a FCD)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
## Vstupní data
|
|
9
|
+
|
|
10
|
+
**RsdTmcOsmMapping**:
|
|
11
|
+
|
|
12
|
+
- vstup je CSV soubor z OSM-TMC, poskytuje OICT
|
|
13
|
+
|
|
14
|
+
### Data aktivně stahujeme
|
|
15
|
+
|
|
16
|
+
#### *open data IPR*
|
|
17
|
+
|
|
18
|
+
- zdroj dat
|
|
19
|
+
- CSV soubor, URL je v configu datasources
|
|
20
|
+
- formát dat
|
|
21
|
+
- protokol: http
|
|
22
|
+
- datový typ: csv
|
|
23
|
+
- [struktura](../src/schema-definitions/datasources/RsdTmcOsmMapping.ts)
|
|
24
|
+
- příklad [vstupních dat](../test/integration-engine/data/rsd_tmc_osm_test.csv)
|
|
25
|
+
- frekvence stahování
|
|
26
|
+
- cron definice:
|
|
27
|
+
- cron.dataplatform.RsdTmcOsmMapping.RsdTmsOsmMappingRefresh
|
|
28
|
+
- rabin `30 4 * * SUN`
|
|
29
|
+
- prod `30 4 * * SUN`
|
|
30
|
+
- název rabbitmq fronty
|
|
31
|
+
- dataplatform.RsdTmcOsmMapping.RsdTmsOsmMappingRefresh
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
### *RsdTmcOsmMappingWorker*
|
|
35
|
+
|
|
36
|
+
#### *task: RefreshRsdTmcOsmMappingDataTask*
|
|
37
|
+
|
|
38
|
+
- vstupní rabbitmq fronta
|
|
39
|
+
- název: dataplatform.rsdtmcosmmapping.RsdTmsOsmMappingRefresh
|
|
40
|
+
- bez parametrů
|
|
41
|
+
- datové zdroje
|
|
42
|
+
- RsdTmcOsmMapping CSV
|
|
43
|
+
- data modely
|
|
44
|
+
- RsdTmcOsmMappingModel -> (schéma traffic) `rsd_tmc_osm_mapping`
|
|
45
|
+
|
|
46
|
+
## Uložení dat
|
|
47
|
+
|
|
48
|
+
- typ databáze
|
|
49
|
+
- PSQL
|
|
50
|
+
- tabulka
|
|
51
|
+
- `traffic.rsd_tmc_osm_mapping`
|
|
52
|
+
- retence dat
|
|
53
|
+
- task aktualizuje data při každém běhu
|
|
54
|
+
|
package/package.json
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@golemio/traffic-common",
|
|
3
|
+
"version": "0.1.0-dev.851739354",
|
|
4
|
+
"description": "Golemio Common Traffic Module",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"build": "rimraf ./dist && ttsc -p ./tsconfig.build.json",
|
|
9
|
+
"build-minimal": "run-s 'build -- --sourceMap false --declaration false'",
|
|
10
|
+
"build-watch": "run-s 'build -- --watch --preserveWatchOutput'",
|
|
11
|
+
"pretest": "golemio import-db-data --postgres",
|
|
12
|
+
"test": "cross-env NODE_ENV=test TS_NODE_COMPILER='ttypescript' mocha --exit --check-leaks --timeout 120000 -r ts-node/register -r dotenv/config --file 'test/setup.ts' 'test/**/*.test.ts'",
|
|
13
|
+
"test-debug": "run-s 'test -- --inspect-brk=9230'",
|
|
14
|
+
"code-coverage": "nyc run-s 'test -- -r source-map-support/register'",
|
|
15
|
+
"migrate-db": "golemio migrate-db up --postgres",
|
|
16
|
+
"generate-docs": "typedoc --out docs/typedoc src",
|
|
17
|
+
"lint": "eslint --cache \"{src,test}/**/*.ts\""
|
|
18
|
+
},
|
|
19
|
+
"keywords": [
|
|
20
|
+
"golemio"
|
|
21
|
+
],
|
|
22
|
+
"author": "Operator ICT, a.s.",
|
|
23
|
+
"license": "MIT",
|
|
24
|
+
"repository": {
|
|
25
|
+
"type": "git",
|
|
26
|
+
"url": "https://gitlab.com/operator-ict/golemio/code/modules/traffic-common"
|
|
27
|
+
},
|
|
28
|
+
"engines": {
|
|
29
|
+
"node": ">=18.0.0",
|
|
30
|
+
"npm": ">=8.0.0",
|
|
31
|
+
"yarn": "Use npm!"
|
|
32
|
+
},
|
|
33
|
+
"devDependencies": {
|
|
34
|
+
"@golemio/cli": "1.4.2",
|
|
35
|
+
"@golemio/core": "1.6.4",
|
|
36
|
+
"@golemio/db-common": "1.1.0-dev.848192245",
|
|
37
|
+
"@golemio/eslint-config": "1.1.0",
|
|
38
|
+
"@ovos-media/ts-transform-paths": "^1.7.18-1",
|
|
39
|
+
"@types/chai": "4.2.3",
|
|
40
|
+
"@types/chai-as-promised": "7.1.2",
|
|
41
|
+
"@types/mocha": "^9.1.0",
|
|
42
|
+
"@types/node": "^18.13.0",
|
|
43
|
+
"@types/sinon": "^9.0.10",
|
|
44
|
+
"@types/supertest": "^2.0.12",
|
|
45
|
+
"chai": "4.2.0",
|
|
46
|
+
"chai-as-promised": "7.1.1",
|
|
47
|
+
"cross-env": "^7.0.3",
|
|
48
|
+
"dotenv": "^8.2.0",
|
|
49
|
+
"eslint": "^8.1.1",
|
|
50
|
+
"mocha": "^9.1.2",
|
|
51
|
+
"npm-run-all": "^4.1.5",
|
|
52
|
+
"nyc": "^15.1.0",
|
|
53
|
+
"prettier": "^2.5.1",
|
|
54
|
+
"pretty-quick": "^3.1.0",
|
|
55
|
+
"rimraf": "^3.0.2",
|
|
56
|
+
"sinon": "^9.2.3",
|
|
57
|
+
"source-map-support": "0.5.19",
|
|
58
|
+
"ts-node": "^10.7.0",
|
|
59
|
+
"ttypescript": "^1.5.13",
|
|
60
|
+
"typedoc": "^0.23.21",
|
|
61
|
+
"typescript": "4.7.2"
|
|
62
|
+
},
|
|
63
|
+
"peerDependencies": {
|
|
64
|
+
"@golemio/core": ">=1.6.5"
|
|
65
|
+
},
|
|
66
|
+
"overrides": {}
|
|
67
|
+
}
|