@golemio/pid 2.2.5 → 2.2.6-dev.553203229
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.
|
@@ -11,7 +11,7 @@ export declare class VehiclePositionsUtils {
|
|
|
11
11
|
/**
|
|
12
12
|
* Determine whether to create new position and its tracking status (trains only for now)
|
|
13
13
|
*
|
|
14
|
-
* @
|
|
14
|
+
* @param {TripStopsSchedule | undefined} tripStopSchedule - Cached trip stops for given block id (see Redis)
|
|
15
15
|
* @param {IUpdateDelayRunTripsData | IUpdateDelayTripsIdsData} trip - New trip
|
|
16
16
|
* @param {IPositionTransformationResult} position - Current position
|
|
17
17
|
*/
|
|
@@ -3,7 +3,6 @@ var _a;
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
exports.VehiclePositionsUtils = void 0;
|
|
5
5
|
const golemio_errors_1 = require("@golemio/core/dist/shared/golemio-errors");
|
|
6
|
-
const luxon_1 = require("@golemio/core/dist/shared/luxon");
|
|
7
6
|
const config_1 = require("@golemio/core/dist/integration-engine/config");
|
|
8
7
|
const Logger_1 = require("@golemio/core/dist/integration-engine/helpers/Logger");
|
|
9
8
|
const const_1 = require("../../const");
|
|
@@ -15,7 +14,7 @@ _a = VehiclePositionsUtils;
|
|
|
15
14
|
/**
|
|
16
15
|
* Determine whether to create new position and its tracking status (trains only for now)
|
|
17
16
|
*
|
|
18
|
-
* @
|
|
17
|
+
* @param {TripStopsSchedule | undefined} tripStopSchedule - Cached trip stops for given block id (see Redis)
|
|
19
18
|
* @param {IUpdateDelayRunTripsData | IUpdateDelayTripsIdsData} trip - New trip
|
|
20
19
|
* @param {IPositionTransformationResult} position - Current position
|
|
21
20
|
*/
|
|
@@ -83,10 +82,12 @@ VehiclePositionsUtils.getNextExpireTimestamp = () => {
|
|
|
83
82
|
Logger_1.log.error(`[VehiclePositionsUtils] Unable to parse '${config_1.config.vehiclePositions.redisExpireTime}'. Redis keys won't expire.`);
|
|
84
83
|
return;
|
|
85
84
|
}
|
|
86
|
-
const localDateTime =
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
85
|
+
const localDateTime = new Date();
|
|
86
|
+
localDateTime.setMinutes(localDateTime.getMinutes() + 2);
|
|
87
|
+
const expireDateTime = new Date();
|
|
88
|
+
expireDateTime.setHours(timeObject.hour, timeObject.minute, 0, 0);
|
|
89
|
+
if (expireDateTime.valueOf() < localDateTime.valueOf()) {
|
|
90
|
+
expireDateTime.setDate(expireDateTime.getDate() + 1);
|
|
90
91
|
}
|
|
91
92
|
return expireDateTime.valueOf();
|
|
92
93
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VehiclePositionsUtils.js","sourceRoot":"","sources":["../../../src/integration-engine/vehicle-positions/VehiclePositionsUtils.ts"],"names":[],"mappings":";;;;AACA,6EAAuE;AACvE,
|
|
1
|
+
{"version":3,"file":"VehiclePositionsUtils.js","sourceRoot":"","sources":["../../../src/integration-engine/vehicle-positions/VehiclePositionsUtils.ts"],"names":[],"mappings":";;;;AACA,6EAAuE;AACvE,yEAAsE;AACtE,iFAA2E;AAC3E,uCAAiD;AACjD,qCAAiG;AASjG,MAAa,qBAAqB;;AAAlC,sDAoGC;;AAnGG;;;;;;GAMG;AACW,kDAA4B,GAAG,CACzC,gBAA+C,EAC/C,IAAyD,EACzD,QAAuC,EACnB,EAAE;IACtB,IAAI,cAAc,GAAG,QAAQ,CAAC,QAAS,CAAC;IACxC,IAAI,CAAC,IAAI,CAAC,aAAa,IAAI,CAAC,IAAI,CAAC,YAAY,IAAI,IAAI,CAAC,eAAe,IAAI,0BAAiB,CAAC,KAAK,EAAE;QAC9F,OAAO,cAAc,CAAC;KACzB;IAED,cAAc,GAAG,EAAI,CAAC,uBAAuB,CAAC,IAAI,CAAC,YAAY,EAAE,gBAAgB,EAAE,QAAQ,CAAC,CAAC;IAC7F,OAAO,cAAc,CAAC;AAC1B,CAAE,CAAA;AAEF;;;;;;G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AAC,OAAO,EAAE,CAAC;AACpC,CAAE,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,83 +1,83 @@
|
|
|
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
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
2
|
+
"name": "@golemio/pid",
|
|
3
|
+
"version": "2.2.6-dev.553203229",
|
|
4
|
+
"description": "Golemio PID 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' TZ='UTC' mocha --exit --check-leaks --timeout 120000 -r ts-node/register -r dotenv/config '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
|
+
"generate-docs": "typedoc --out docs/typedoc src",
|
|
16
|
+
"lint": "eslint --cache \"{src,test}/**/*.ts\""
|
|
17
|
+
},
|
|
18
|
+
"keywords": [
|
|
19
|
+
"golemio"
|
|
20
|
+
],
|
|
21
|
+
"author": "Operator ICT, a.s.",
|
|
22
|
+
"license": "MIT",
|
|
23
|
+
"repository": {
|
|
24
|
+
"type": "git",
|
|
25
|
+
"url": "https://gitlab.com/operator-ict/golemio/code/modules/pid"
|
|
26
|
+
},
|
|
27
|
+
"devDependencies": {
|
|
28
|
+
"@commitlint/cli": "^11.0.0",
|
|
29
|
+
"@commitlint/config-conventional": "^11.0.0",
|
|
30
|
+
"@golemio/cli": "1.2.2",
|
|
31
|
+
"@golemio/core": "1.2.11",
|
|
32
|
+
"@golemio/db-common": "1.0.1",
|
|
33
|
+
"@golemio/eslint-config": "^1.1.0",
|
|
34
|
+
"@ovos-media/ts-transform-paths": "^1.7.18-1",
|
|
35
|
+
"@types/amqplib": "^0.5.17",
|
|
36
|
+
"@types/chai": "4.2.3",
|
|
37
|
+
"@types/chai-as-promised": "7.1.2",
|
|
38
|
+
"@types/jsdom": "^16.2.11",
|
|
39
|
+
"@types/lodash": "^4.14.168",
|
|
40
|
+
"@types/mocha": "^9.1.1",
|
|
41
|
+
"@types/node": "^16.11.35",
|
|
42
|
+
"@types/pg-copy-streams": "^1.2.1",
|
|
43
|
+
"@types/sinon": "^9.0.10",
|
|
44
|
+
"@types/supertest": "^2.0.10",
|
|
45
|
+
"body-parser": "^1.19.0",
|
|
46
|
+
"body-parser-xml": "^2.0.0",
|
|
47
|
+
"chai": "4.2.0",
|
|
48
|
+
"chai-as-promised": "7.1.1",
|
|
49
|
+
"cross-env": "^7.0.3",
|
|
50
|
+
"dotenv": "^8.2.0",
|
|
51
|
+
"eslint": "^8.1.1",
|
|
52
|
+
"husky": "^4.3.7",
|
|
53
|
+
"mocha": "^10.0.0",
|
|
54
|
+
"npm-run-all": "^4.1.5",
|
|
55
|
+
"nyc": "^15.1.0",
|
|
56
|
+
"prettier": "^2.5.1",
|
|
57
|
+
"pretty-quick": "^3.1.0",
|
|
58
|
+
"rimraf": "^3.0.2",
|
|
59
|
+
"sinon": "^9.2.3",
|
|
60
|
+
"source-map-support": "0.5.19",
|
|
61
|
+
"supertest": "^6.0.1",
|
|
62
|
+
"ts-node": "^10.7.0",
|
|
63
|
+
"ttypescript": "^1.5.13",
|
|
64
|
+
"typedoc": "^0.22.15",
|
|
65
|
+
"typescript": "4.6.4"
|
|
66
|
+
},
|
|
67
|
+
"peerDependencies": {
|
|
68
|
+
"@golemio/core": "^1.2.11"
|
|
69
|
+
},
|
|
70
|
+
"dependencies": {
|
|
71
|
+
"@turf/turf": "^6.5.0",
|
|
72
|
+
"JSONStream": "^1.3.5",
|
|
73
|
+
"cheap-ruler": "^2.5.1",
|
|
74
|
+
"csv-parser": "^3.0.0",
|
|
75
|
+
"csv-stringify": "^5.6.2",
|
|
76
|
+
"fastq": "^1.13.0",
|
|
77
|
+
"gtfs-realtime-bindings": "^0.0.6",
|
|
78
|
+
"jsdom": "^16.6.0",
|
|
79
|
+
"lodash": "^4.17.21",
|
|
80
|
+
"pg-copy-streams": "^5.1.1"
|
|
81
|
+
},
|
|
82
|
+
"resolutions": {}
|
|
83
83
|
}
|