@golemio/rush-hour-aggregation 1.0.3-dev.558327183 → 1.0.3
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/README.md +3 -3
- package/db/migrations/postgresql/.config.json +1 -1
- package/db/migrations/postgresql/{20220405102916-prahaZasekanaAggregation.js → 20220405102916-prahaDopravniAggregation.js} +2 -2
- package/db/migrations/postgresql/sqls/{20220405102916-prahaZasekanaAggregation-down.sql → 20220405102916-prahaDopravniAggregation-down.sql} +0 -0
- package/db/migrations/postgresql/sqls/{20220405102916-prahaZasekanaAggregation-up.sql → 20220405102916-prahaDopravniAggregation-up.sql} +0 -0
- package/dist/integration-engine/dataAccess/AbstractEventsRepository.js +2 -2
- package/dist/integration-engine/dataAccess/FcdEventsRepository.js +3 -3
- package/dist/integration-engine/dataAccess/NdicEventRepository.js +3 -3
- package/dist/integration-engine/dataAccess/TskEventsRepository.js +3 -3
- package/dist/integration-engine/dataAccess/WazeJamsRepository.js +3 -3
- package/dist/integration-engine/dataAccess/WazeReconstructionsRepository.js +3 -3
- package/dist/schema-definitions/sequelize-models/{PrahaZasekanaInfo.d.ts → PrahaDopravniInfo.d.ts} +1 -1
- package/dist/schema-definitions/sequelize-models/{PrahaZasekanaInfo.js → PrahaDopravniInfo.js} +5 -5
- package/dist/schema-definitions/sequelize-models/{PrahaZasekanaInfo.js.map → PrahaDopravniInfo.js.map} +1 -1
- package/package.json +61 -61
- package/templates/sqlQueries/FcdEvents.sql +1 -1
package/README.md
CHANGED
|
@@ -43,10 +43,10 @@ yarn add --exact @golemio/rush-hour-aggregation@dev
|
|
|
43
43
|
|
|
44
44
|
## Description
|
|
45
45
|
|
|
46
|
-
This module aggregates traffic data for Praha
|
|
46
|
+
This module aggregates traffic data for Praha dopravní project. It takes different traffic dataset avaiable in a golemio dataplatform and creates time series data for traffic jams, incidents or reconstructions.
|
|
47
47
|
|
|
48
|
-
[Rabin Praha
|
|
49
|
-
[Backend repo Praha
|
|
48
|
+
[Rabin Praha dopravní](https://praha-dopravni-backend.rabin.golemio.cz/app)
|
|
49
|
+
[Backend repo Praha dopravní](https://gitlab.com/operator-ict/golemio/code/praha-dopravni)
|
|
50
50
|
|
|
51
51
|
## Datasources
|
|
52
52
|
|
|
@@ -19,7 +19,7 @@ exports.setup = function(options, seedLink) {
|
|
|
19
19
|
};
|
|
20
20
|
|
|
21
21
|
exports.up = function(db) {
|
|
22
|
-
var filePath = path.join(__dirname, 'sqls', '20220405102916-
|
|
22
|
+
var filePath = path.join(__dirname, 'sqls', '20220405102916-prahaDopravniAggregation-up.sql');
|
|
23
23
|
return new Promise( function( resolve, reject ) {
|
|
24
24
|
fs.readFile(filePath, {encoding: 'utf-8'}, function(err,data){
|
|
25
25
|
if (err) return reject(err);
|
|
@@ -34,7 +34,7 @@ exports.up = function(db) {
|
|
|
34
34
|
};
|
|
35
35
|
|
|
36
36
|
exports.down = function(db) {
|
|
37
|
-
var filePath = path.join(__dirname, 'sqls', '20220405102916-
|
|
37
|
+
var filePath = path.join(__dirname, 'sqls', '20220405102916-prahaDopravniAggregation-down.sql');
|
|
38
38
|
return new Promise( function( resolve, reject ) {
|
|
39
39
|
fs.readFile(filePath, {encoding: 'utf-8'}, function(err,data){
|
|
40
40
|
if (err) return reject(err);
|
|
File without changes
|
|
File without changes
|
|
@@ -12,7 +12,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
12
12
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
13
|
};
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
const
|
|
15
|
+
const PrahaDopravniInfo_1 = __importDefault(require("../../schema-definitions/sequelize-models/PrahaDopravniInfo"));
|
|
16
16
|
const integration_engine_1 = require("@golemio/core/dist/integration-engine");
|
|
17
17
|
const helpers_1 = require("@golemio/core/dist/integration-engine/helpers");
|
|
18
18
|
class EventsRepository extends integration_engine_1.PostgresModel {
|
|
@@ -26,7 +26,7 @@ class EventsRepository extends integration_engine_1.PostgresModel {
|
|
|
26
26
|
});
|
|
27
27
|
this.refreshMaterializedView = (viewName) => __awaiter(this, void 0, void 0, function* () {
|
|
28
28
|
helpers_1.log.debug(`Refreshing materialized view: ${viewName}`);
|
|
29
|
-
const sql = "REFRESH MATERIALIZED VIEW CONCURRENTLY ".concat(
|
|
29
|
+
const sql = "REFRESH MATERIALIZED VIEW CONCURRENTLY ".concat(PrahaDopravniInfo_1.default.SCHEMA, ".", viewName);
|
|
30
30
|
yield this.query(sql);
|
|
31
31
|
});
|
|
32
32
|
}
|
|
@@ -14,15 +14,15 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
const AggregationTaskType_1 = require("../../schema-definitions/helpers/AggregationTaskType");
|
|
16
16
|
const FcdEvents_1 = __importDefault(require("../../schema-definitions/sequelize-models/FcdEvents"));
|
|
17
|
-
const
|
|
17
|
+
const PrahaDopravniInfo_1 = __importDefault(require("../../schema-definitions/sequelize-models/PrahaDopravniInfo"));
|
|
18
18
|
const golemio_validator_1 = require("@golemio/core/dist/shared/golemio-validator");
|
|
19
19
|
const AbstractEventsRepository_1 = __importDefault(require("./AbstractEventsRepository"));
|
|
20
20
|
class FcdEventsRepository extends AbstractEventsRepository_1.default {
|
|
21
21
|
constructor() {
|
|
22
22
|
super("FcdEventsRepository", {
|
|
23
23
|
outputSequelizeAttributes: FcdEvents_1.default.attributeModel,
|
|
24
|
-
pgTableName:
|
|
25
|
-
pgSchema:
|
|
24
|
+
pgTableName: PrahaDopravniInfo_1.default.TABLE_NAMES[AggregationTaskType_1.AggregationTaskType.FCD],
|
|
25
|
+
pgSchema: PrahaDopravniInfo_1.default.SCHEMA,
|
|
26
26
|
savingType: "insertOnly",
|
|
27
27
|
}, new golemio_validator_1.JSONSchemaValidator("FcdEventsRepository", FcdEvents_1.default.arrayJsonSchema, true));
|
|
28
28
|
this.materializedViewNameLatest = "fcd_events_snapshots_latest";
|
|
@@ -14,15 +14,15 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
const AggregationTaskType_1 = require("../../schema-definitions/helpers/AggregationTaskType");
|
|
16
16
|
const NdicEvent_1 = __importDefault(require("../../schema-definitions/sequelize-models/NdicEvent"));
|
|
17
|
-
const
|
|
17
|
+
const PrahaDopravniInfo_1 = __importDefault(require("../../schema-definitions/sequelize-models/PrahaDopravniInfo"));
|
|
18
18
|
const golemio_validator_1 = require("@golemio/core/dist/shared/golemio-validator");
|
|
19
19
|
const AbstractEventsRepository_1 = __importDefault(require("./AbstractEventsRepository"));
|
|
20
20
|
class NdicEventsRepository extends AbstractEventsRepository_1.default {
|
|
21
21
|
constructor() {
|
|
22
22
|
super("NdicEventsRepository", {
|
|
23
23
|
outputSequelizeAttributes: NdicEvent_1.default.attributeModel,
|
|
24
|
-
pgTableName:
|
|
25
|
-
pgSchema:
|
|
24
|
+
pgTableName: PrahaDopravniInfo_1.default.TABLE_NAMES[AggregationTaskType_1.AggregationTaskType.NDIC],
|
|
25
|
+
pgSchema: PrahaDopravniInfo_1.default.SCHEMA,
|
|
26
26
|
savingType: "insertOnly",
|
|
27
27
|
}, new golemio_validator_1.JSONSchemaValidator("NdicEventsRepository", NdicEvent_1.default.arrayJsonSchema, true));
|
|
28
28
|
this.materializedViewNameLatest = "ndic_events_full_snapshots_latest";
|
|
@@ -13,7 +13,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
13
13
|
};
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
const AggregationTaskType_1 = require("../../schema-definitions/helpers/AggregationTaskType");
|
|
16
|
-
const
|
|
16
|
+
const PrahaDopravniInfo_1 = __importDefault(require("../../schema-definitions/sequelize-models/PrahaDopravniInfo"));
|
|
17
17
|
const TskEvent_1 = __importDefault(require("../../schema-definitions/sequelize-models/TskEvent"));
|
|
18
18
|
const golemio_validator_1 = require("@golemio/core/dist/shared/golemio-validator");
|
|
19
19
|
const AbstractEventsRepository_1 = __importDefault(require("./AbstractEventsRepository"));
|
|
@@ -21,8 +21,8 @@ class TskEventsRepository extends AbstractEventsRepository_1.default {
|
|
|
21
21
|
constructor() {
|
|
22
22
|
super("TskEventsRepository", {
|
|
23
23
|
outputSequelizeAttributes: TskEvent_1.default.attributeModel,
|
|
24
|
-
pgTableName:
|
|
25
|
-
pgSchema:
|
|
24
|
+
pgTableName: PrahaDopravniInfo_1.default.TABLE_NAMES[AggregationTaskType_1.AggregationTaskType.SDDR],
|
|
25
|
+
pgSchema: PrahaDopravniInfo_1.default.SCHEMA,
|
|
26
26
|
savingType: "insertOnly",
|
|
27
27
|
}, new golemio_validator_1.JSONSchemaValidator("TskEventsRepository", TskEvent_1.default.arrayJsonSchema, true));
|
|
28
28
|
this.materializedViewNameLatest = "tsk_std_last_30min_snapshots_latest";
|
|
@@ -13,7 +13,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
13
13
|
};
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
const AggregationTaskType_1 = require("../../schema-definitions/helpers/AggregationTaskType");
|
|
16
|
-
const
|
|
16
|
+
const PrahaDopravniInfo_1 = __importDefault(require("../../schema-definitions/sequelize-models/PrahaDopravniInfo"));
|
|
17
17
|
const WazeJams_1 = __importDefault(require("../../schema-definitions/sequelize-models/WazeJams"));
|
|
18
18
|
const golemio_validator_1 = require("@golemio/core/dist/shared/golemio-validator");
|
|
19
19
|
const AbstractEventsRepository_1 = __importDefault(require("./AbstractEventsRepository"));
|
|
@@ -21,8 +21,8 @@ class WazeJamsRepository extends AbstractEventsRepository_1.default {
|
|
|
21
21
|
constructor() {
|
|
22
22
|
super("WazeJams", {
|
|
23
23
|
outputSequelizeAttributes: WazeJams_1.default.attributeModel,
|
|
24
|
-
pgTableName:
|
|
25
|
-
pgSchema:
|
|
24
|
+
pgTableName: PrahaDopravniInfo_1.default.TABLE_NAMES[AggregationTaskType_1.AggregationTaskType.WAZEJ],
|
|
25
|
+
pgSchema: PrahaDopravniInfo_1.default.SCHEMA,
|
|
26
26
|
savingType: "insertOnly",
|
|
27
27
|
}, new golemio_validator_1.JSONSchemaValidator("WazeJams", WazeJams_1.default.arrayJsonSchema, true));
|
|
28
28
|
this.materializedViewNameLatest = "waze_jams_snapshots_latest";
|
|
@@ -13,7 +13,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
13
13
|
};
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
const AggregationTaskType_1 = require("../../schema-definitions/helpers/AggregationTaskType");
|
|
16
|
-
const
|
|
16
|
+
const PrahaDopravniInfo_1 = __importDefault(require("../../schema-definitions/sequelize-models/PrahaDopravniInfo"));
|
|
17
17
|
const WazeReconstructions_1 = __importDefault(require("../../schema-definitions/sequelize-models/WazeReconstructions"));
|
|
18
18
|
const golemio_validator_1 = require("@golemio/core/dist/shared/golemio-validator");
|
|
19
19
|
const AbstractEventsRepository_1 = __importDefault(require("./AbstractEventsRepository"));
|
|
@@ -21,8 +21,8 @@ class WazeReconstructionsRepository extends AbstractEventsRepository_1.default {
|
|
|
21
21
|
constructor() {
|
|
22
22
|
super("WazeReconstructions", {
|
|
23
23
|
outputSequelizeAttributes: WazeReconstructions_1.default.attributeModel,
|
|
24
|
-
pgTableName:
|
|
25
|
-
pgSchema:
|
|
24
|
+
pgTableName: PrahaDopravniInfo_1.default.TABLE_NAMES[AggregationTaskType_1.AggregationTaskType.WAZER],
|
|
25
|
+
pgSchema: PrahaDopravniInfo_1.default.SCHEMA,
|
|
26
26
|
savingType: "insertOnly",
|
|
27
27
|
}, new golemio_validator_1.JSONSchemaValidator("WazeReconstructions", WazeReconstructions_1.default.arrayJsonSchema, true));
|
|
28
28
|
this.materializedViewNameLatest = "waze_reconstructions_snapshots_latest";
|
package/dist/schema-definitions/sequelize-models/{PrahaZasekanaInfo.js → PrahaDopravniInfo.js}
RENAMED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const AggregationTaskType_1 = require("../helpers/AggregationTaskType");
|
|
4
|
-
class
|
|
4
|
+
class PrahaDopravniInfo {
|
|
5
5
|
}
|
|
6
|
-
exports.default =
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
exports.default = PrahaDopravniInfo;
|
|
7
|
+
PrahaDopravniInfo.SCHEMA = "praha_dopravni";
|
|
8
|
+
PrahaDopravniInfo.TABLE_NAMES = {
|
|
9
9
|
[AggregationTaskType_1.AggregationTaskType.WAZEJ]: "waze_jams",
|
|
10
10
|
[AggregationTaskType_1.AggregationTaskType.WAZER]: "waze_reconstructions",
|
|
11
11
|
[AggregationTaskType_1.AggregationTaskType.NDIC]: "ndic_events_full",
|
|
12
12
|
[AggregationTaskType_1.AggregationTaskType.SDDR]: "tsk_std_last_30min",
|
|
13
13
|
[AggregationTaskType_1.AggregationTaskType.FCD]: "fcd_events",
|
|
14
14
|
};
|
|
15
|
-
//# sourceMappingURL=
|
|
15
|
+
//# sourceMappingURL=PrahaDopravniInfo.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"
|
|
1
|
+
{"version":3,"file":"PrahaDopravniInfo.js","sourceRoot":"","sources":["../../../src/schema-definitions/sequelize-models/PrahaDopravniInfo.ts"],"names":[],"mappings":";;AAAA,wEAAuE;AAEvE,MAAqB,iBAAiB;;AAAtC,oCASC;AARiB,wBAAM,GAAG,gBAAgB,CAAC;AAC1B,6BAAW,GAAG;IACxB,CAAC,yCAAmB,CAAC,KAAK,CAAC,EAAE,WAAW;IACxC,CAAC,yCAAmB,CAAC,KAAK,CAAC,EAAE,sBAAsB;IACnD,CAAC,yCAAmB,CAAC,IAAI,CAAC,EAAE,kBAAkB;IAC9C,CAAC,yCAAmB,CAAC,IAAI,CAAC,EAAE,oBAAoB;IAChD,CAAC,yCAAmB,CAAC,GAAG,CAAC,EAAE,YAAY;CAC1C,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,63 +1,63 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
2
|
+
"name": "@golemio/rush-hour-aggregation",
|
|
3
|
+
"version": "1.0.3",
|
|
4
|
+
"description": "Rush hour data agregation for Praha dopravní project",
|
|
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
|
+
"test": "cross-env NODE_ENV=test TS_NODE_COMPILER='ttypescript' mocha --exit --check-leaks --timeout 120000 -r ts-node/register -r dotenv/config 'test/**/*.test.ts'",
|
|
12
|
+
"test-debug": "run-s 'test --inspect-brk=9230'",
|
|
13
|
+
"code-coverage": "nyc run-s 'test -r source-map-support/register'",
|
|
14
|
+
"generate-docs": "typedoc --out docs/typedoc src",
|
|
15
|
+
"lint": "eslint \"{src,test}/**/*.ts\""
|
|
16
|
+
},
|
|
17
|
+
"keywords": [
|
|
18
|
+
"golemio"
|
|
19
|
+
],
|
|
20
|
+
"author": "Operator ICT, a.s.",
|
|
21
|
+
"license": "MIT",
|
|
22
|
+
"repository": {
|
|
23
|
+
"type": "git",
|
|
24
|
+
"url": "https://gitlab.com/operator-ict/golemio/code/modules/rush-hour-aggregation"
|
|
25
|
+
},
|
|
26
|
+
"devDependencies": {
|
|
27
|
+
"@commitlint/cli": "^11.0.0",
|
|
28
|
+
"@commitlint/config-conventional": "^11.0.0",
|
|
29
|
+
"@golemio/cli": "1.3.0",
|
|
30
|
+
"@golemio/core": "1.2.14",
|
|
31
|
+
"@golemio/eslint-config": "^1.1.0",
|
|
32
|
+
"@ovos-media/ts-transform-paths": "^1.7.18-1",
|
|
33
|
+
"@types/amqplib": "^0.5.17",
|
|
34
|
+
"@types/chai": "4.2.3",
|
|
35
|
+
"@types/chai-as-promised": "7.1.2",
|
|
36
|
+
"@types/geojson": "^7946.0.8",
|
|
37
|
+
"@types/mocha": "^9.1.0",
|
|
38
|
+
"@types/node": "^16.11.35",
|
|
39
|
+
"@types/sinon": "^9.0.10",
|
|
40
|
+
"chai": "4.2.0",
|
|
41
|
+
"chai-as-promised": "7.1.1",
|
|
42
|
+
"cross-env": "^7.0.3",
|
|
43
|
+
"dotenv": "^16.0.0",
|
|
44
|
+
"eslint": "^8.1.1",
|
|
45
|
+
"husky": "^7.0.4",
|
|
46
|
+
"mocha": "^9.1.2",
|
|
47
|
+
"npm-run-all": "^4.1.5",
|
|
48
|
+
"nyc": "^15.1.0",
|
|
49
|
+
"prettier": "^2.5.1",
|
|
50
|
+
"pretty-quick": "^3.1.3",
|
|
51
|
+
"rimraf": "^3.0.2",
|
|
52
|
+
"sinon": "^9.2.3",
|
|
53
|
+
"source-map-support": "0.5.19",
|
|
54
|
+
"ts-node": "^10.7.0",
|
|
55
|
+
"ttypescript": "^1.5.13",
|
|
56
|
+
"typedoc": "^0.22.15",
|
|
57
|
+
"typescript": "4.6.4"
|
|
58
|
+
},
|
|
59
|
+
"peerDependencies": {
|
|
60
|
+
"@golemio/core": "^1.0.0"
|
|
61
|
+
},
|
|
62
|
+
"dependencies": {}
|
|
63
63
|
}
|
|
@@ -13,7 +13,7 @@ select
|
|
|
13
13
|
) as properties
|
|
14
14
|
from
|
|
15
15
|
fcd.fcd_traff_params_part a
|
|
16
|
-
join
|
|
16
|
+
join praha_dopravni.fcd_geos_90 g on
|
|
17
17
|
a.source_identification::text = g.source_identification::text
|
|
18
18
|
where
|
|
19
19
|
a.measurement_or_calculation_time between $from and $to
|