@golemio/pid 4.0.2-dev.1982507419 → 4.0.2-rc.1988899397
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 +1 -1
- package/dist/helpers/GtfsStopParser.d.ts +0 -2
- package/dist/helpers/GtfsStopParser.js +8 -11
- package/dist/helpers/GtfsStopParser.js.map +1 -1
- package/dist/input-gateway/jis/controllers/JISEventsController.js +2 -1
- package/dist/input-gateway/jis/controllers/JISEventsController.js.map +1 -1
- package/dist/input-gateway/jis/controllers/JISInfotextsController.js +2 -1
- package/dist/input-gateway/jis/controllers/JISInfotextsController.js.map +1 -1
- package/dist/input-gateway/vehicle-positions/VehiclePositionsController.js +1 -0
- package/dist/input-gateway/vehicle-positions/VehiclePositionsController.js.map +1 -1
- package/dist/integration-engine/jis/ioc/Di.js +0 -10
- package/dist/integration-engine/jis/ioc/Di.js.map +1 -1
- package/dist/integration-engine/jis/ioc/JISContainerToken.d.ts +0 -4
- package/dist/integration-engine/jis/ioc/JISContainerToken.js +0 -5
- package/dist/integration-engine/jis/ioc/JISContainerToken.js.map +1 -1
- package/dist/integration-engine/jis/repositories/JISInfotextsRepository.d.ts +1 -6
- package/dist/integration-engine/jis/repositories/JISInfotextsRepository.js +2 -50
- package/dist/integration-engine/jis/repositories/JISInfotextsRepository.js.map +1 -1
- package/dist/integration-engine/jis/workers/JISWorker.js +0 -1
- package/dist/integration-engine/jis/workers/JISWorker.js.map +1 -1
- package/dist/integration-engine/jis/workers/tasks/RefreshJISInfotextsTask.d.ts +2 -1
- package/dist/integration-engine/jis/workers/tasks/RefreshJISInfotextsTask.js +4 -5
- package/dist/integration-engine/jis/workers/tasks/RefreshJISInfotextsTask.js.map +1 -1
- package/dist/integration-engine/ropid-gtfs/RopidGTFSStopsModel.d.ts +1 -5
- package/dist/integration-engine/ropid-gtfs/RopidGTFSStopsModel.js +0 -24
- package/dist/integration-engine/ropid-gtfs/RopidGTFSStopsModel.js.map +1 -1
- package/dist/integration-engine/ropid-gtfs/data-access/cache/DelayComputationRedisRepository.js.map +1 -1
- package/dist/integration-engine/ropid-gtfs/index.d.ts +0 -1
- package/dist/integration-engine/ropid-gtfs/index.js +0 -1
- package/dist/integration-engine/ropid-gtfs/index.js.map +1 -1
- package/dist/integration-engine/ropid-gtfs/ioc/Di.js +0 -8
- package/dist/integration-engine/ropid-gtfs/ioc/Di.js.map +1 -1
- package/dist/integration-engine/ropid-gtfs/ioc/RopidGtfsContainerToken.d.ts +0 -3
- package/dist/integration-engine/ropid-gtfs/ioc/RopidGtfsContainerToken.js +0 -3
- package/dist/integration-engine/ropid-gtfs/ioc/RopidGtfsContainerToken.js.map +1 -1
- package/dist/integration-engine/ropid-gtfs/transformations/RopidDeparturesPresetsTransformation.js +1 -1
- package/dist/integration-engine/ropid-gtfs/transformations/RopidDeparturesPresetsTransformation.js.map +1 -1
- package/dist/integration-engine/ropid-gtfs/workers/timetables/TimetableWorker.js +0 -1
- package/dist/integration-engine/ropid-gtfs/workers/timetables/TimetableWorker.js.map +1 -1
- package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/CheckSavedRowsAndReplaceTablesTask.js +5 -8
- package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/CheckSavedRowsAndReplaceTablesTask.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/data-access/TripsRepository.js +0 -1
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/data-access/TripsRepository.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/data-access/interfaces/TripRepositoryInterfaces.d.ts +1 -2
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/tasks/PropagateTrainDelayTask.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/tasks/RefreshPublicStopTimeCacheTask.js +0 -1
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/tasks/RefreshPublicStopTimeCacheTask.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/transformations/PublicApiTripTransformation.js +0 -2
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/transformations/PublicApiTripTransformation.js.map +1 -1
- package/dist/output-gateway/index.js +0 -1
- package/dist/output-gateway/index.js.map +1 -1
- package/dist/output-gateway/jis/ioc/Di.js +2 -2
- package/dist/output-gateway/jis/ioc/Di.js.map +1 -1
- package/dist/output-gateway/jis/ioc/OgJisToken.d.ts +0 -2
- package/dist/output-gateway/jis/ioc/OgJisToken.js +0 -2
- package/dist/output-gateway/jis/ioc/OgJisToken.js.map +1 -1
- package/dist/output-gateway/pid/controllers/v3/V3TransferBoardsController.js.map +1 -1
- package/dist/output-gateway/pid/domain/InfotextInterfaces.d.ts +0 -5
- package/dist/output-gateway/pid/helpers/JISInfotextStopSuppressionFilter.d.ts +1 -4
- package/dist/output-gateway/pid/helpers/JISInfotextStopSuppressionFilter.js +1 -7
- package/dist/output-gateway/pid/helpers/JISInfotextStopSuppressionFilter.js.map +1 -1
- package/dist/output-gateway/pid/index.d.ts +0 -50
- package/dist/output-gateway/pid/index.js.map +1 -1
- package/dist/output-gateway/pid/ioc/Di.js +6 -62
- package/dist/output-gateway/pid/ioc/Di.js.map +1 -1
- package/dist/output-gateway/pid/ioc/OgPidToken.d.ts +0 -11
- package/dist/output-gateway/pid/ioc/OgPidToken.js +0 -11
- package/dist/output-gateway/pid/ioc/OgPidToken.js.map +1 -1
- package/dist/output-gateway/pid/routers/index.d.ts +0 -1
- package/dist/output-gateway/pid/routers/index.js +1 -3
- package/dist/output-gateway/pid/routers/index.js.map +1 -1
- package/dist/output-gateway/pid/service/facade/InfotextFacade.d.ts +2 -7
- package/dist/output-gateway/pid/service/facade/InfotextFacade.js +4 -29
- package/dist/output-gateway/pid/service/facade/InfotextFacade.js.map +1 -1
- package/dist/output-gateway/pid/service/facade/StopFacade.d.ts +3 -12
- package/dist/output-gateway/pid/service/facade/StopFacade.js +7 -43
- package/dist/output-gateway/pid/service/facade/StopFacade.js.map +1 -1
- package/dist/output-gateway/pid/service/facade/TransferFacade.d.ts +9 -11
- package/dist/output-gateway/pid/service/facade/TransferFacade.js +14 -117
- package/dist/output-gateway/pid/service/facade/TransferFacade.js.map +1 -1
- package/dist/output-gateway/pid/service/helpers/PlatformCodeResolver.d.ts +1 -7
- package/dist/output-gateway/pid/service/helpers/PlatformCodeResolver.js +0 -12
- package/dist/output-gateway/pid/service/helpers/PlatformCodeResolver.js.map +1 -1
- package/dist/output-gateway/public/data-access/redis/PublicGtfsDepartureRepository.d.ts +1 -1
- package/dist/output-gateway/public/data-access/redis/PublicGtfsDepartureRepository.js +4 -4
- package/dist/output-gateway/public/data-access/redis/PublicGtfsDepartureRepository.js.map +1 -1
- package/dist/output-gateway/public/ioc/Di.js +1 -1
- package/dist/output-gateway/public/ioc/Di.js.map +1 -1
- package/dist/output-gateway/{shared → public}/service/VPSubscriber.d.ts +2 -4
- package/dist/output-gateway/{shared → public}/service/VPSubscriber.js +1 -1
- package/dist/output-gateway/public/service/VPSubscriber.js.map +1 -0
- package/dist/output-gateway/shared/constants/route-version.d.ts +1 -2
- package/dist/output-gateway/shared/constants/route-version.js +0 -1
- package/dist/output-gateway/shared/constants/route-version.js.map +1 -1
- package/dist/schema-definitions/jis/redis/const.d.ts +0 -1
- package/dist/schema-definitions/jis/redis/const.js +1 -2
- package/dist/schema-definitions/jis/redis/const.js.map +1 -1
- package/dist/schema-definitions/ropid-departures-presets/index.d.ts +0 -1
- package/dist/schema-definitions/ropid-departures-presets/index.js +0 -3
- package/dist/schema-definitions/ropid-departures-presets/index.js.map +1 -1
- package/dist/schema-definitions/ropid-gtfs/interfaces/IStopDto.d.ts +0 -1
- package/dist/schema-definitions/ropid-gtfs/redis/const.d.ts +0 -1
- package/dist/schema-definitions/ropid-gtfs/redis/const.js +1 -2
- package/dist/schema-definitions/ropid-gtfs/redis/const.js.map +1 -1
- package/dist/schema-definitions/vehicle-positions/models/views/PublicStopTimeModel.d.ts +2 -3
- package/dist/schema-definitions/vehicle-positions/models/views/PublicStopTimeModel.js +0 -4
- package/dist/schema-definitions/vehicle-positions/models/views/PublicStopTimeModel.js.map +1 -1
- package/dist/schema-definitions/vehicle-positions/models/views/interfaces/IPublicStopTimeDto.d.ts +0 -1
- package/dist/schema-definitions/vehicle-positions/redis/interfaces/IPublicApiCacheDto.d.ts +0 -2
- package/dist/schema-definitions/vehicle-positions/redis/interfaces/IPublicStopTimeCacheDto.d.ts +0 -1
- package/dist/schema-definitions/vehicle-positions/redis/schemas/PublicApiCacheDtoSchema.js +0 -8
- package/dist/schema-definitions/vehicle-positions/redis/schemas/PublicApiCacheDtoSchema.js.map +1 -1
- package/dist/schema-definitions/vehicle-positions/redis/schemas/PublicStopTimeCacheDtoSchema.js +1 -4
- package/dist/schema-definitions/vehicle-positions/redis/schemas/PublicStopTimeCacheDtoSchema.js.map +1 -1
- package/docs/asyncapi.yaml +0 -45
- package/docs/cache/types/redis.md +2 -82
- package/docs/jis/index.md +5 -15
- package/docs/openapi-input.yaml +2 -13
- package/docs/openapi-output.yaml +4 -326
- package/package.json +2 -2
- package/db/example/redis/gtfsStopsCacheMock.json +0 -8
- package/db/example/redis/jisCacheMock.json +0 -31
- package/db/migrations/postgresql/20250716143052-add-stop-name-to-combined-stop-times.js +0 -53
- package/db/migrations/postgresql/sqls/20250716143052-add-stop-name-to-combined-stop-times-down.sql +0 -47
- package/db/migrations/postgresql/sqls/20250716143052-add-stop-name-to-combined-stop-times-up.sql +0 -47
- package/dist/helpers/jis/JISInfotextSeverityLevelPriority.d.ts +0 -6
- package/dist/helpers/jis/JISInfotextSeverityLevelPriority.js +0 -11
- package/dist/helpers/jis/JISInfotextSeverityLevelPriority.js.map +0 -1
- package/dist/integration-engine/jis/repositories/JISInfotextsRedisRepository.d.ts +0 -9
- package/dist/integration-engine/jis/repositories/JISInfotextsRedisRepository.js +0 -86
- package/dist/integration-engine/jis/repositories/JISInfotextsRedisRepository.js.map +0 -1
- package/dist/integration-engine/jis/transformations/JISInfotextCacheTranformation.d.ts +0 -7
- package/dist/integration-engine/jis/transformations/JISInfotextCacheTranformation.js +0 -37
- package/dist/integration-engine/jis/transformations/JISInfotextCacheTranformation.js.map +0 -1
- package/dist/integration-engine/jis/workers/tasks/RefreshJISInfotextsCacheTask.d.ts +0 -13
- package/dist/integration-engine/jis/workers/tasks/RefreshJISInfotextsCacheTask.js +0 -47
- package/dist/integration-engine/jis/workers/tasks/RefreshJISInfotextsCacheTask.js.map +0 -1
- package/dist/integration-engine/ropid-gtfs/RopidGTFSCisStopsModel.d.ts +0 -18
- package/dist/integration-engine/ropid-gtfs/RopidGTFSCisStopsModel.js +0 -44
- package/dist/integration-engine/ropid-gtfs/RopidGTFSCisStopsModel.js.map +0 -1
- package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/RefreshGtfsStopsCacheTask.d.ts +0 -12
- package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/RefreshGtfsStopsCacheTask.js +0 -44
- package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/RefreshGtfsStopsCacheTask.js.map +0 -1
- package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/data-access/cache/GtfsStopsRedisRepository.d.ts +0 -12
- package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/data-access/cache/GtfsStopsRedisRepository.js +0 -87
- package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/data-access/cache/GtfsStopsRedisRepository.js.map +0 -1
- package/dist/output-gateway/jis/data-access/cache/JISInfotextsRedisRepository.d.ts +0 -17
- package/dist/output-gateway/jis/data-access/cache/JISInfotextsRedisRepository.js +0 -113
- package/dist/output-gateway/jis/data-access/cache/JISInfotextsRedisRepository.js.map +0 -1
- package/dist/output-gateway/pid/controllers/v4/V4TransferBoardsController.d.ts +0 -17
- package/dist/output-gateway/pid/controllers/v4/V4TransferBoardsController.js +0 -154
- package/dist/output-gateway/pid/controllers/v4/V4TransferBoardsController.js.map +0 -1
- package/dist/output-gateway/pid/controllers/v4/interfaces/ITransferBoardsParams.d.ts +0 -14
- package/dist/output-gateway/pid/controllers/v4/interfaces/ITransferBoardsParams.js +0 -3
- package/dist/output-gateway/pid/controllers/v4/interfaces/ITransferBoardsParams.js.map +0 -1
- package/dist/output-gateway/pid/helpers/TransferBoardFilter.d.ts +0 -5
- package/dist/output-gateway/pid/helpers/TransferBoardFilter.js +0 -33
- package/dist/output-gateway/pid/helpers/TransferBoardFilter.js.map +0 -1
- package/dist/output-gateway/pid/helpers/TransferBoardSorter.d.ts +0 -6
- package/dist/output-gateway/pid/helpers/TransferBoardSorter.js +0 -61
- package/dist/output-gateway/pid/helpers/TransferBoardSorter.js.map +0 -1
- package/dist/output-gateway/pid/routers/v4/V4PIDRouter.d.ts +0 -16
- package/dist/output-gateway/pid/routers/v4/V4PIDRouter.js +0 -67
- package/dist/output-gateway/pid/routers/v4/V4PIDRouter.js.map +0 -1
- package/dist/output-gateway/pid/service/transformations/JISInfotextCacheTransferTransformation.d.ts +0 -13
- package/dist/output-gateway/pid/service/transformations/JISInfotextCacheTransferTransformation.js +0 -31
- package/dist/output-gateway/pid/service/transformations/JISInfotextCacheTransferTransformation.js.map +0 -1
- package/dist/output-gateway/pid/service/transformations/TransferDepartureCacheTransformation.d.ts +0 -27
- package/dist/output-gateway/pid/service/transformations/TransferDepartureCacheTransformation.js +0 -78
- package/dist/output-gateway/pid/service/transformations/TransferDepartureCacheTransformation.js.map +0 -1
- package/dist/output-gateway/ropid-gtfs/data-access/redis/GtfsStopsRedisRepository.d.ts +0 -13
- package/dist/output-gateway/ropid-gtfs/data-access/redis/GtfsStopsRedisRepository.js +0 -83
- package/dist/output-gateway/ropid-gtfs/data-access/redis/GtfsStopsRedisRepository.js.map +0 -1
- package/dist/output-gateway/shared/service/VPSubscriber.js.map +0 -1
- package/dist/schema-definitions/jis/redis/interfaces/IJISInfotextDto.d.ts +0 -17
- package/dist/schema-definitions/jis/redis/interfaces/IJISInfotextDto.js +0 -3
- package/dist/schema-definitions/jis/redis/interfaces/IJISInfotextDto.js.map +0 -1
- package/dist/schema-definitions/jis/redis/schemas/JISInfotextDtoSchema.d.ts +0 -3
- package/dist/schema-definitions/jis/redis/schemas/JISInfotextDtoSchema.js +0 -59
- package/dist/schema-definitions/jis/redis/schemas/JISInfotextDtoSchema.js.map +0 -1
- package/dist/schema-definitions/ropid-gtfs/interfaces/IStopCisDto.d.ts +0 -16
- package/dist/schema-definitions/ropid-gtfs/interfaces/IStopCisDto.js +0 -3
- package/dist/schema-definitions/ropid-gtfs/interfaces/IStopCisDto.js.map +0 -1
- package/dist/schema-definitions/ropid-gtfs/models/StopCisDto.d.ts +0 -58
- package/dist/schema-definitions/ropid-gtfs/models/StopCisDto.js +0 -69
- package/dist/schema-definitions/ropid-gtfs/models/StopCisDto.js.map +0 -1
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"infotexts": [
|
|
3
|
-
{
|
|
4
|
-
"75eb0ccc-2a35-4260-bdaf-c61565a9c888": {
|
|
5
|
-
"id": "75eb0ccc-2a35-4260-bdaf-c61565a9c888",
|
|
6
|
-
"severity_level": "SEVERE",
|
|
7
|
-
"display_type": "INLINE",
|
|
8
|
-
"active_period_start": "2000-03-28T09:11:00.000Z",
|
|
9
|
-
"active_period_end": null,
|
|
10
|
-
"description_text": {
|
|
11
|
-
"cs": "test",
|
|
12
|
-
"en": "test"
|
|
13
|
-
},
|
|
14
|
-
"created_timestamp": "2025-03-07T08:49:25.907Z",
|
|
15
|
-
"updated_timestamp": "2025-04-10T20:54:14.646Z",
|
|
16
|
-
"created_at": "2025-07-01T11:41:41.689Z",
|
|
17
|
-
"updated_at": "2025-07-01T11:41:41.689Z",
|
|
18
|
-
"stops": [
|
|
19
|
-
{
|
|
20
|
-
"stop_id": "U476Z2P"
|
|
21
|
-
}
|
|
22
|
-
]
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
],
|
|
26
|
-
"stops-infotexts": [
|
|
27
|
-
{
|
|
28
|
-
"U476Z2P": "75eb0ccc-2a35-4260-bdaf-c61565a9c888"
|
|
29
|
-
}
|
|
30
|
-
]
|
|
31
|
-
}
|
|
@@ -1,53 +0,0 @@
|
|
|
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', '20250716143052-add-stop-name-to-combined-stop-times-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', '20250716143052-add-stop-name-to-combined-stop-times-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
|
-
};
|
package/db/migrations/postgresql/sqls/20250716143052-add-stop-name-to-combined-stop-times-down.sql
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
drop view v_public_vehiclepositions_combined_stop_times;
|
|
2
|
-
|
|
3
|
-
create view v_public_vehiclepositions_combined_stop_times as
|
|
4
|
-
select
|
|
5
|
-
distinct on (rt_trip_id, stop_sequence) stop_times.rt_trip_id,
|
|
6
|
-
vt.gtfs_trip_id,
|
|
7
|
-
stop_times.stop_sequence,
|
|
8
|
-
stop_times.stop_arr_delay,
|
|
9
|
-
stop_times.stop_dep_delay,
|
|
10
|
-
vt.gtfs_route_type,
|
|
11
|
-
vt.gtfs_route_short_name,
|
|
12
|
-
vt.run_number,
|
|
13
|
-
vt.internal_run_number,
|
|
14
|
-
vt.provider_source_type,
|
|
15
|
-
vt.cis_trip_number,
|
|
16
|
-
vt.vehicle_registration_number,
|
|
17
|
-
stop_times.stop_id,
|
|
18
|
-
vcs.cis_stop_platform_code,
|
|
19
|
-
rs.platform_code
|
|
20
|
-
from
|
|
21
|
-
(
|
|
22
|
-
select
|
|
23
|
-
*
|
|
24
|
-
from
|
|
25
|
-
v_public_vehiclepositions_future_stop_times prediction
|
|
26
|
-
union
|
|
27
|
-
all
|
|
28
|
-
select
|
|
29
|
-
*
|
|
30
|
-
from
|
|
31
|
-
v_public_vehiclepositions_past_stop_times history
|
|
32
|
-
) as stop_times
|
|
33
|
-
join vehiclepositions_trips vt on vt.id = stop_times.rt_trip_id
|
|
34
|
-
join vehiclepositions_positions vp on vt.last_position_id = vp.id
|
|
35
|
-
and (
|
|
36
|
-
vp.valid_to is null
|
|
37
|
-
or vp.valid_to >= now()
|
|
38
|
-
)
|
|
39
|
-
and vp.state_position != 'after_track'
|
|
40
|
-
left join ropidgtfs_stops rs on rs.stop_id = stop_times.stop_id
|
|
41
|
-
left join ropidgtfs_cis_stops rcs on rcs.id = rs.computed_cis_stop_id
|
|
42
|
-
left join vehiclepositions_cis_stops vcs
|
|
43
|
-
on vcs.rt_trip_id = stop_times.rt_trip_id
|
|
44
|
-
and vcs.cis_stop_group_id = rcs.cis
|
|
45
|
-
order by
|
|
46
|
-
rt_trip_id,
|
|
47
|
-
stop_sequence;
|
package/db/migrations/postgresql/sqls/20250716143052-add-stop-name-to-combined-stop-times-up.sql
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
create
|
|
2
|
-
or replace view v_public_vehiclepositions_combined_stop_times as
|
|
3
|
-
select
|
|
4
|
-
distinct on (rt_trip_id, stop_sequence) stop_times.rt_trip_id,
|
|
5
|
-
vt.gtfs_trip_id,
|
|
6
|
-
stop_times.stop_sequence,
|
|
7
|
-
stop_times.stop_arr_delay,
|
|
8
|
-
stop_times.stop_dep_delay,
|
|
9
|
-
vt.gtfs_route_type,
|
|
10
|
-
vt.gtfs_route_short_name,
|
|
11
|
-
vt.run_number,
|
|
12
|
-
vt.internal_run_number,
|
|
13
|
-
vt.provider_source_type,
|
|
14
|
-
vt.cis_trip_number,
|
|
15
|
-
vt.vehicle_registration_number,
|
|
16
|
-
stop_times.stop_id,
|
|
17
|
-
vcs.cis_stop_platform_code,
|
|
18
|
-
rs.platform_code,
|
|
19
|
-
rs.stop_name
|
|
20
|
-
from
|
|
21
|
-
(
|
|
22
|
-
select
|
|
23
|
-
*
|
|
24
|
-
from
|
|
25
|
-
v_public_vehiclepositions_future_stop_times prediction
|
|
26
|
-
union
|
|
27
|
-
all
|
|
28
|
-
select
|
|
29
|
-
*
|
|
30
|
-
from
|
|
31
|
-
v_public_vehiclepositions_past_stop_times history
|
|
32
|
-
) as stop_times
|
|
33
|
-
join vehiclepositions_trips vt on vt.id = stop_times.rt_trip_id
|
|
34
|
-
join vehiclepositions_positions vp on vt.last_position_id = vp.id
|
|
35
|
-
and (
|
|
36
|
-
vp.valid_to is null
|
|
37
|
-
or vp.valid_to >= now()
|
|
38
|
-
)
|
|
39
|
-
and vp.state_position != 'after_track'
|
|
40
|
-
left join ropidgtfs_stops rs on rs.stop_id = stop_times.stop_id
|
|
41
|
-
left join ropidgtfs_cis_stops rcs on rcs.id = rs.computed_cis_stop_id
|
|
42
|
-
left join vehiclepositions_cis_stops vcs
|
|
43
|
-
on vcs.rt_trip_id = stop_times.rt_trip_id
|
|
44
|
-
and vcs.cis_stop_group_id = rcs.cis
|
|
45
|
-
order by
|
|
46
|
-
rt_trip_id,
|
|
47
|
-
stop_sequence;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.JISInfotextSeverityLevelPriority = void 0;
|
|
4
|
-
const JISInfotextSeverityLevelEnum_1 = require("./JISInfotextSeverityLevelEnum");
|
|
5
|
-
/** Mapping of infotext severity level to numbers, where higher number = higher severity and priority */
|
|
6
|
-
exports.JISInfotextSeverityLevelPriority = {
|
|
7
|
-
[JISInfotextSeverityLevelEnum_1.JISInfotextSeverityLevel.Info]: 1,
|
|
8
|
-
[JISInfotextSeverityLevelEnum_1.JISInfotextSeverityLevel.Warning]: 2,
|
|
9
|
-
[JISInfotextSeverityLevelEnum_1.JISInfotextSeverityLevel.Severe]: 3,
|
|
10
|
-
};
|
|
11
|
-
//# sourceMappingURL=JISInfotextSeverityLevelPriority.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"JISInfotextSeverityLevelPriority.js","sourceRoot":"","sources":["../../../src/helpers/jis/JISInfotextSeverityLevelPriority.ts"],"names":[],"mappings":";;;AAAA,iFAA0E;AAE1E,wGAAwG;AAC3F,QAAA,gCAAgC,GAAG;IAC5C,CAAC,uDAAwB,CAAC,IAAI,CAAC,EAAE,CAAC;IAClC,CAAC,uDAAwB,CAAC,OAAO,CAAC,EAAE,CAAC;IACrC,CAAC,uDAAwB,CAAC,MAAM,CAAC,EAAE,CAAC;CAC9B,CAAC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { IJISInfotextDto } from "../../../schema-definitions/jis/redis/interfaces/IJISInfotextDto";
|
|
2
|
-
import { RedisModel } from "@golemio/core/dist/integration-engine";
|
|
3
|
-
export declare class JISInfotextsRedisRepository extends RedisModel {
|
|
4
|
-
static NAMESPACE_PREFIX: string;
|
|
5
|
-
constructor();
|
|
6
|
-
refreshData(infotexts: IJISInfotextDto[]): Promise<void>;
|
|
7
|
-
private createNewCache;
|
|
8
|
-
private deleteOldCache;
|
|
9
|
-
}
|
|
@@ -1,86 +0,0 @@
|
|
|
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 JISInfotextsRedisRepository_1;
|
|
12
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
exports.JISInfotextsRedisRepository = void 0;
|
|
14
|
-
const const_1 = require("../../../schema-definitions/jis/redis/const");
|
|
15
|
-
const JISInfotextDtoSchema_1 = require("../../../schema-definitions/jis/redis/schemas/JISInfotextDtoSchema");
|
|
16
|
-
const integration_engine_1 = require("@golemio/core/dist/integration-engine");
|
|
17
|
-
const golemio_errors_1 = require("@golemio/core/dist/shared/golemio-errors");
|
|
18
|
-
const golemio_validator_1 = require("@golemio/core/dist/shared/golemio-validator");
|
|
19
|
-
const tsyringe_1 = require("@golemio/core/dist/shared/tsyringe");
|
|
20
|
-
const node_crypto_1 = require("node:crypto");
|
|
21
|
-
const TTL_SECONDS_BEFORE_DELETE = 60;
|
|
22
|
-
let JISInfotextsRedisRepository = exports.JISInfotextsRedisRepository = JISInfotextsRedisRepository_1 = class JISInfotextsRedisRepository extends integration_engine_1.RedisModel {
|
|
23
|
-
constructor() {
|
|
24
|
-
super("JISInfotextsRedisRepository", {
|
|
25
|
-
isKeyConstructedFromData: false,
|
|
26
|
-
prefix: JISInfotextsRedisRepository_1.NAMESPACE_PREFIX,
|
|
27
|
-
}, new golemio_validator_1.JSONSchemaValidator("JISInfotextsRedisRepositoryValidator", JISInfotextDtoSchema_1.JISInfotextDtoSchema));
|
|
28
|
-
}
|
|
29
|
-
async refreshData(infotexts) {
|
|
30
|
-
try {
|
|
31
|
-
const oldSetName = (await this.connection.get(`${this.prefix}:activeSetName`)) ?? "";
|
|
32
|
-
await this.createNewCache(infotexts);
|
|
33
|
-
await this.deleteOldCache(oldSetName);
|
|
34
|
-
}
|
|
35
|
-
catch (err) {
|
|
36
|
-
throw new golemio_errors_1.GeneralError("refreshData failed", this.constructor.name, err);
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
async createNewCache(infotexts) {
|
|
40
|
-
try {
|
|
41
|
-
await this.validator.Validate(infotexts);
|
|
42
|
-
}
|
|
43
|
-
catch (error) {
|
|
44
|
-
throw new golemio_errors_1.GeneralError(`JISInfotextsRedisRepository: data validation failed: ${error.message}`, this.constructor.name, error);
|
|
45
|
-
}
|
|
46
|
-
try {
|
|
47
|
-
const infotextIdsByStopId = new Map();
|
|
48
|
-
const infotextsByInfotextId = new Map();
|
|
49
|
-
for (const infotext of infotexts) {
|
|
50
|
-
infotextsByInfotextId.set(infotext.id, JSON.stringify(infotext));
|
|
51
|
-
for (const { stop_id } of infotext?.stops ?? []) {
|
|
52
|
-
let stopInfotextsIds = infotextIdsByStopId.get(stop_id) ?? [];
|
|
53
|
-
stopInfotextsIds.push(infotext.id);
|
|
54
|
-
infotextIdsByStopId.set(stop_id, stopInfotextsIds);
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
const setName = (0, node_crypto_1.randomBytes)(4).toString("hex");
|
|
58
|
-
const pipeline = this.connection.pipeline();
|
|
59
|
-
pipeline.hset(`${this.prefix}:${setName}:infotexts`, infotextsByInfotextId);
|
|
60
|
-
pipeline.hset(`${this.prefix}:${setName}:stops-infotexts`, infotextIdsByStopId);
|
|
61
|
-
pipeline.publish(`${this.prefix}`, `${this.prefix}:${setName}`);
|
|
62
|
-
pipeline.set(`${this.prefix}:activeSetName`, `${this.prefix}:${setName}`);
|
|
63
|
-
await pipeline.exec();
|
|
64
|
-
}
|
|
65
|
-
catch (err) {
|
|
66
|
-
throw new golemio_errors_1.GeneralError("createNewCache failed", this.constructor.name, err);
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
async deleteOldCache(setName) {
|
|
70
|
-
try {
|
|
71
|
-
const pipeline = this.connection.pipeline();
|
|
72
|
-
pipeline.expire(`${setName}:infotexts`, TTL_SECONDS_BEFORE_DELETE);
|
|
73
|
-
pipeline.expire(`${setName}:stops-infotexts`, TTL_SECONDS_BEFORE_DELETE);
|
|
74
|
-
await pipeline.exec();
|
|
75
|
-
}
|
|
76
|
-
catch (err) {
|
|
77
|
-
throw new golemio_errors_1.GeneralError("deleteOldCache failed", this.constructor.name, err);
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
};
|
|
81
|
-
JISInfotextsRedisRepository.NAMESPACE_PREFIX = const_1.JIS_NAMESPACE_PREFIX;
|
|
82
|
-
exports.JISInfotextsRedisRepository = JISInfotextsRedisRepository = JISInfotextsRedisRepository_1 = __decorate([
|
|
83
|
-
(0, tsyringe_1.injectable)(),
|
|
84
|
-
__metadata("design:paramtypes", [])
|
|
85
|
-
], JISInfotextsRedisRepository);
|
|
86
|
-
//# sourceMappingURL=JISInfotextsRedisRepository.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"JISInfotextsRedisRepository.js","sourceRoot":"","sources":["../../../../src/integration-engine/jis/repositories/JISInfotextsRedisRepository.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { JISInfotextsModel } from "../../../schema-definitions/jis/models/JISInfotextsModel";
|
|
2
|
-
import { IJISInfotextDto } from "../../../schema-definitions/jis/redis/interfaces/IJISInfotextDto";
|
|
3
|
-
import { AbstractTransformation } from "@golemio/core/dist/helpers/transformation/AbstractTransformation";
|
|
4
|
-
export declare class JISInfotextCacheTranformation extends AbstractTransformation<JISInfotextsModel, IJISInfotextDto> {
|
|
5
|
-
name: string;
|
|
6
|
-
protected transformInternal: (data: JISInfotextsModel) => IJISInfotextDto;
|
|
7
|
-
}
|
|
@@ -1,37 +0,0 @@
|
|
|
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.JISInfotextCacheTranformation = void 0;
|
|
10
|
-
const AbstractTransformation_1 = require("@golemio/core/dist/helpers/transformation/AbstractTransformation");
|
|
11
|
-
const tsyringe_1 = require("@golemio/core/dist/shared/tsyringe");
|
|
12
|
-
let JISInfotextCacheTranformation = exports.JISInfotextCacheTranformation = class JISInfotextCacheTranformation extends AbstractTransformation_1.AbstractTransformation {
|
|
13
|
-
constructor() {
|
|
14
|
-
super(...arguments);
|
|
15
|
-
this.name = "JISInfotextCacheTranformation";
|
|
16
|
-
this.transformInternal = (data) => {
|
|
17
|
-
return {
|
|
18
|
-
id: data.id,
|
|
19
|
-
severity_level: data.severity_level,
|
|
20
|
-
display_type: data.display_type,
|
|
21
|
-
active_period_start: data.active_period_start.toISOString(),
|
|
22
|
-
active_period_end: data.active_period_end?.toISOString() ?? null,
|
|
23
|
-
description_text: {
|
|
24
|
-
cs: data.description_text.cs,
|
|
25
|
-
en: data.description_text.en ?? null,
|
|
26
|
-
},
|
|
27
|
-
created_timestamp: data.created_timestamp.toISOString(),
|
|
28
|
-
updated_timestamp: data.updated_timestamp.toISOString(),
|
|
29
|
-
stops: data.stops?.map((stop) => ({ stop_id: stop.stop_id })) ?? [],
|
|
30
|
-
};
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
};
|
|
34
|
-
exports.JISInfotextCacheTranformation = JISInfotextCacheTranformation = __decorate([
|
|
35
|
-
(0, tsyringe_1.injectable)()
|
|
36
|
-
], JISInfotextCacheTranformation);
|
|
37
|
-
//# sourceMappingURL=JISInfotextCacheTranformation.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"JISInfotextCacheTranformation.js","sourceRoot":"","sources":["../../../../src/integration-engine/jis/transformations/JISInfotextCacheTranformation.ts"],"names":[],"mappings":";;;;;;;;;AAEA,6GAA0G;AAC1G,iEAAgE;AAGzD,IAAM,6BAA6B,2CAAnC,MAAM,6BAA8B,SAAQ,+CAA0D;IAAtG;;QACI,SAAI,GAAG,+BAA+B,CAAC;QAEpC,sBAAiB,GAAG,CAAC,IAAuB,EAAmB,EAAE;YACvE,OAAO;gBACH,EAAE,EAAE,IAAI,CAAC,EAAE;gBACX,cAAc,EAAE,IAAI,CAAC,cAAc;gBACnC,YAAY,EAAE,IAAI,CAAC,YAAY;gBAC/B,mBAAmB,EAAE,IAAI,CAAC,mBAAmB,CAAC,WAAW,EAAE;gBAC3D,iBAAiB,EAAE,IAAI,CAAC,iBAAiB,EAAE,WAAW,EAAE,IAAI,IAAI;gBAChE,gBAAgB,EAAE;oBACd,EAAE,EAAE,IAAI,CAAC,gBAAgB,CAAC,EAAE;oBAC5B,EAAE,EAAE,IAAI,CAAC,gBAAgB,CAAC,EAAE,IAAI,IAAI;iBACvC;gBACD,iBAAiB,EAAE,IAAI,CAAC,iBAAiB,CAAC,WAAW,EAAE;gBACvD,iBAAiB,EAAE,IAAI,CAAC,iBAAiB,CAAC,WAAW,EAAE;gBACvD,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC,IAAI,EAAE;aACtE,CAAC;QACN,CAAC,CAAC;IACN,CAAC;CAAA,CAAA;wCAnBY,6BAA6B;IADzC,IAAA,qBAAU,GAAE;GACA,6BAA6B,CAmBzC"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { JISInfotextsRedisRepository } from "../../repositories/JISInfotextsRedisRepository";
|
|
2
|
-
import { JISInfotextsRepository } from "../../repositories/JISInfotextsRepository";
|
|
3
|
-
import { AbstractEmptyTask } from "@golemio/core/dist/integration-engine";
|
|
4
|
-
import { JISInfotextCacheTranformation } from "../../transformations/JISInfotextCacheTranformation";
|
|
5
|
-
export declare class RefreshJISInfotextsCacheTask extends AbstractEmptyTask {
|
|
6
|
-
private infotextsRepository;
|
|
7
|
-
private infotextCacheRepository;
|
|
8
|
-
private tranformation;
|
|
9
|
-
readonly queueName = "refreshJISInfotextsCache";
|
|
10
|
-
readonly queueTtl: number;
|
|
11
|
-
constructor(infotextsRepository: JISInfotextsRepository, infotextCacheRepository: JISInfotextsRedisRepository, tranformation: JISInfotextCacheTranformation);
|
|
12
|
-
protected execute(): Promise<void>;
|
|
13
|
-
}
|
|
@@ -1,47 +0,0 @@
|
|
|
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
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.RefreshJISInfotextsCacheTask = void 0;
|
|
16
|
-
const JISContainerToken_1 = require("../../ioc/JISContainerToken");
|
|
17
|
-
const JISInfotextsRedisRepository_1 = require("../../repositories/JISInfotextsRedisRepository");
|
|
18
|
-
const JISInfotextsRepository_1 = require("../../repositories/JISInfotextsRepository");
|
|
19
|
-
const integration_engine_1 = require("@golemio/core/dist/integration-engine");
|
|
20
|
-
const tsyringe_1 = require("@golemio/core/dist/shared/tsyringe");
|
|
21
|
-
const constants_1 = require("../constants");
|
|
22
|
-
const JISInfotextCacheTranformation_1 = require("../../transformations/JISInfotextCacheTranformation");
|
|
23
|
-
let RefreshJISInfotextsCacheTask = exports.RefreshJISInfotextsCacheTask = class RefreshJISInfotextsCacheTask extends integration_engine_1.AbstractEmptyTask {
|
|
24
|
-
constructor(infotextsRepository, infotextCacheRepository, tranformation) {
|
|
25
|
-
super(constants_1.JIS_WORKER_NAME.toLowerCase());
|
|
26
|
-
this.infotextsRepository = infotextsRepository;
|
|
27
|
-
this.infotextCacheRepository = infotextCacheRepository;
|
|
28
|
-
this.tranformation = tranformation;
|
|
29
|
-
this.queueName = "refreshJISInfotextsCache";
|
|
30
|
-
this.queueTtl = 60 * 1000; // 1 minute
|
|
31
|
-
}
|
|
32
|
-
async execute() {
|
|
33
|
-
const infotexts = await this.infotextsRepository.findAll();
|
|
34
|
-
const transformedData = this.tranformation.transformArray(infotexts);
|
|
35
|
-
await this.infotextCacheRepository.refreshData(transformedData);
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
exports.RefreshJISInfotextsCacheTask = RefreshJISInfotextsCacheTask = __decorate([
|
|
39
|
-
(0, tsyringe_1.injectable)(),
|
|
40
|
-
__param(0, (0, tsyringe_1.inject)(JISContainerToken_1.JISContainerToken.JISInfotextsRepository)),
|
|
41
|
-
__param(1, (0, tsyringe_1.inject)(JISContainerToken_1.JISContainerToken.JISInfotextsRedisRepository)),
|
|
42
|
-
__param(2, (0, tsyringe_1.inject)(JISContainerToken_1.JISContainerToken.JISInfotextCacheTranformation)),
|
|
43
|
-
__metadata("design:paramtypes", [JISInfotextsRepository_1.JISInfotextsRepository,
|
|
44
|
-
JISInfotextsRedisRepository_1.JISInfotextsRedisRepository,
|
|
45
|
-
JISInfotextCacheTranformation_1.JISInfotextCacheTranformation])
|
|
46
|
-
], RefreshJISInfotextsCacheTask);
|
|
47
|
-
//# sourceMappingURL=RefreshJISInfotextsCacheTask.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"RefreshJISInfotextsCacheTask.js","sourceRoot":"","sources":["../../../../../src/integration-engine/jis/workers/tasks/RefreshJISInfotextsCacheTask.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,mEAAkE;AAClE,gGAA+F;AAC/F,sFAAqF;AACrF,8EAA0E;AAC1E,iEAAwE;AACxE,4CAA+C;AAC/C,uGAAsG;AAG/F,IAAM,4BAA4B,0CAAlC,MAAM,4BAA6B,SAAQ,sCAAiB;IAI/D,YACsD,mBAAmD,EAC9C,uBAA4D,EAC1D,aAAoD;QAE7G,KAAK,CAAC,2BAAe,CAAC,WAAW,EAAE,CAAC,CAAC;QAJqB,wBAAmB,GAAnB,mBAAmB,CAAwB;QACtC,4BAAuB,GAAvB,uBAAuB,CAA6B;QAClD,kBAAa,GAAb,aAAa,CAA+B;QANjG,cAAS,GAAG,0BAA0B,CAAC;QACvC,aAAQ,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC,WAAW;IAQjD,CAAC;IAES,KAAK,CAAC,OAAO;QACnB,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC,mBAAmB,CAAC,OAAO,EAAE,CAAC;QAC3D,MAAM,eAAe,GAAG,IAAI,CAAC,aAAa,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC;QACrE,MAAM,IAAI,CAAC,uBAAuB,CAAC,WAAW,CAAC,eAAe,CAAC,CAAC;IACpE,CAAC;CACJ,CAAA;uCAjBY,4BAA4B;IADxC,IAAA,qBAAU,GAAE;IAMJ,WAAA,IAAA,iBAAM,EAAC,qCAAiB,CAAC,sBAAsB,CAAC,CAAA;IAChD,WAAA,IAAA,iBAAM,EAAC,qCAAiB,CAAC,2BAA2B,CAAC,CAAA;IACrD,WAAA,IAAA,iBAAM,EAAC,qCAAiB,CAAC,6BAA6B,CAAC,CAAA;qCAFuB,+CAAsB;QACb,yDAA2B;QACnC,6DAA6B;GAPxG,4BAA4B,CAiBxC"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { IStopCisDto } from "../../schema-definitions/ropid-gtfs/interfaces/IStopCisDto";
|
|
2
|
-
import { IModel, PostgresModel } from "@golemio/core/dist/integration-engine";
|
|
3
|
-
import { IValidator } from "@golemio/core/dist/shared/golemio-validator";
|
|
4
|
-
import Sequelize from "@golemio/core/dist/shared/sequelize";
|
|
5
|
-
export declare class RopidGTFSCisStopsModel extends PostgresModel implements IModel {
|
|
6
|
-
/** Model name */
|
|
7
|
-
name: string;
|
|
8
|
-
/** The Sequelize Model */
|
|
9
|
-
sequelizeModel: Sequelize.ModelCtor<any>;
|
|
10
|
-
/** The Sequelize Model for temporary table */
|
|
11
|
-
protected tmpSequelizeModel: Sequelize.ModelCtor<any> | null;
|
|
12
|
-
/** Validation helper */
|
|
13
|
-
protected validator: IValidator;
|
|
14
|
-
/** Type/Strategy of saving the data */
|
|
15
|
-
protected savingType: "insertOnly" | "insertOrUpdate";
|
|
16
|
-
constructor();
|
|
17
|
-
getAll: () => Promise<Array<Pick<IStopCisDto, "id" | "cis">>>;
|
|
18
|
-
}
|
|
@@ -1,44 +0,0 @@
|
|
|
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
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.RopidGTFSCisStopsModel = void 0;
|
|
13
|
-
const const_1 = require("../../schema-definitions/const");
|
|
14
|
-
const StopCisDto_1 = require("../../schema-definitions/ropid-gtfs/models/StopCisDto");
|
|
15
|
-
const integration_engine_1 = require("@golemio/core/dist/integration-engine");
|
|
16
|
-
const golemio_errors_1 = require("@golemio/core/dist/shared/golemio-errors");
|
|
17
|
-
const golemio_validator_1 = require("@golemio/core/dist/shared/golemio-validator");
|
|
18
|
-
const tsyringe_1 = require("@golemio/core/dist/shared/tsyringe");
|
|
19
|
-
let RopidGTFSCisStopsModel = exports.RopidGTFSCisStopsModel = class RopidGTFSCisStopsModel extends integration_engine_1.PostgresModel {
|
|
20
|
-
constructor() {
|
|
21
|
-
super("RopidGTFSCisStopsModel", {
|
|
22
|
-
outputSequelizeAttributes: StopCisDto_1.StopCisDto.attributeModel,
|
|
23
|
-
pgTableName: StopCisDto_1.StopCisDto.tableName,
|
|
24
|
-
pgSchema: const_1.PG_SCHEMA,
|
|
25
|
-
savingType: "insertOnly",
|
|
26
|
-
}, new golemio_validator_1.JSONSchemaValidator(StopCisDto_1.StopCisDto.tableName + "ModelValidator", StopCisDto_1.StopCisDto.jsonSchema));
|
|
27
|
-
this.getAll = async () => {
|
|
28
|
-
try {
|
|
29
|
-
return await this.sequelizeModel.findAll({
|
|
30
|
-
attributes: ["id", "cis"],
|
|
31
|
-
raw: true,
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
catch (err) {
|
|
35
|
-
throw new golemio_errors_1.GeneralError("Database error", this.constructor.name, err, 500);
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
};
|
|
40
|
-
exports.RopidGTFSCisStopsModel = RopidGTFSCisStopsModel = __decorate([
|
|
41
|
-
(0, tsyringe_1.injectable)(),
|
|
42
|
-
__metadata("design:paramtypes", [])
|
|
43
|
-
], RopidGTFSCisStopsModel);
|
|
44
|
-
//# sourceMappingURL=RopidGTFSCisStopsModel.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"RopidGTFSCisStopsModel.js","sourceRoot":"","sources":["../../../src/integration-engine/ropid-gtfs/RopidGTFSCisStopsModel.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,0DAAuC;AAEvC,sFAA+D;AAC/D,8EAA8E;AAC9E,6EAAwE;AACxE,mFAA8F;AAE9F,iEAAgE;AAGzD,IAAM,sBAAsB,oCAA5B,MAAM,sBAAuB,SAAQ,kCAAa;IAYrD;QACI,KAAK,CACD,wBAAwB,EACxB;YACI,yBAAyB,EAAE,uBAAU,CAAC,cAAc;YACpD,WAAW,EAAE,uBAAU,CAAC,SAAS;YACjC,QAAQ,EAAE,iBAAS;YACnB,UAAU,EAAE,YAAY;SAC3B,EACD,IAAI,uCAAmB,CAAC,uBAAU,CAAC,SAAS,GAAG,gBAAgB,EAAE,uBAAU,CAAC,UAAU,CAAC,CAC1F,CAAC;QAGC,WAAM,GAAG,KAAK,IAAqD,EAAE;YACxE,IAAI;gBACA,OAAO,MAAM,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC;oBACrC,UAAU,EAAE,CAAC,IAAI,EAAE,KAAK,CAAC;oBACzB,GAAG,EAAE,IAAI;iBACZ,CAAC,CAAC;aACN;YAAC,OAAO,GAAG,EAAE;gBACV,MAAM,IAAI,6BAAY,CAAC,gBAAgB,EAAE,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;aAC7E;QACL,CAAC,CAAC;IAXF,CAAC;CAYJ,CAAA;iCAnCY,sBAAsB;IADlC,IAAA,qBAAU,GAAE;;GACA,sBAAsB,CAmClC"}
|
package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/RefreshGtfsStopsCacheTask.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { RopidGTFSCisStopsModel } from "../../..";
|
|
2
|
-
import { AbstractEmptyTask } from "@golemio/core/dist/integration-engine";
|
|
3
|
-
import { GtfsStopsRedisRepository } from "./data-access/cache/GtfsStopsRedisRepository";
|
|
4
|
-
export declare class RefreshGtfsStopsCacheTask extends AbstractEmptyTask {
|
|
5
|
-
private gtfsStopsRedisRepository;
|
|
6
|
-
private gtfsStopCisModel;
|
|
7
|
-
readonly queueName = "refreshGtfsStopsCache";
|
|
8
|
-
readonly queueTtl: number;
|
|
9
|
-
private readonly gtfsStopRepository;
|
|
10
|
-
constructor(gtfsStopsRedisRepository: GtfsStopsRedisRepository, gtfsStopCisModel: RopidGTFSCisStopsModel);
|
|
11
|
-
protected execute(): Promise<void>;
|
|
12
|
-
}
|
package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/RefreshGtfsStopsCacheTask.js
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
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
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.RefreshGtfsStopsCacheTask = void 0;
|
|
16
|
-
const ropid_gtfs_1 = require("../../..");
|
|
17
|
-
const RopidGtfsContainerToken_1 = require("../../../ioc/RopidGtfsContainerToken");
|
|
18
|
-
const integration_engine_1 = require("@golemio/core/dist/integration-engine");
|
|
19
|
-
const tsyringe_1 = require("@golemio/core/dist/shared/tsyringe");
|
|
20
|
-
const constants_1 = require("../constants");
|
|
21
|
-
const GtfsStopsRedisRepository_1 = require("./data-access/cache/GtfsStopsRedisRepository");
|
|
22
|
-
let RefreshGtfsStopsCacheTask = exports.RefreshGtfsStopsCacheTask = class RefreshGtfsStopsCacheTask extends integration_engine_1.AbstractEmptyTask {
|
|
23
|
-
constructor(gtfsStopsRedisRepository, gtfsStopCisModel) {
|
|
24
|
-
super(constants_1.TIMETABLE_WORKER_NAME);
|
|
25
|
-
this.gtfsStopsRedisRepository = gtfsStopsRedisRepository;
|
|
26
|
-
this.gtfsStopCisModel = gtfsStopCisModel;
|
|
27
|
-
this.queueName = "refreshGtfsStopsCache";
|
|
28
|
-
this.queueTtl = 59 * 60 * 1000; // 59 minutes
|
|
29
|
-
this.gtfsStopRepository = new ropid_gtfs_1.RopidGTFSStopsModel();
|
|
30
|
-
}
|
|
31
|
-
async execute() {
|
|
32
|
-
const cisStops = await this.gtfsStopCisModel.getAll();
|
|
33
|
-
const gtfsStops = await this.gtfsStopRepository.getAllAswNodeGtfsStops();
|
|
34
|
-
await this.gtfsStopsRedisRepository.refreshData(cisStops, gtfsStops);
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
exports.RefreshGtfsStopsCacheTask = RefreshGtfsStopsCacheTask = __decorate([
|
|
38
|
-
(0, tsyringe_1.injectable)(),
|
|
39
|
-
__param(0, (0, tsyringe_1.inject)(RopidGtfsContainerToken_1.RopidGtfsContainerToken.GtfsStopsRedisRepository)),
|
|
40
|
-
__param(1, (0, tsyringe_1.inject)(RopidGtfsContainerToken_1.RopidGtfsContainerToken.RopidGTFSCisStopsModel)),
|
|
41
|
-
__metadata("design:paramtypes", [GtfsStopsRedisRepository_1.GtfsStopsRedisRepository,
|
|
42
|
-
ropid_gtfs_1.RopidGTFSCisStopsModel])
|
|
43
|
-
], RefreshGtfsStopsCacheTask);
|
|
44
|
-
//# sourceMappingURL=RefreshGtfsStopsCacheTask.js.map
|
package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/RefreshGtfsStopsCacheTask.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"RefreshGtfsStopsCacheTask.js","sourceRoot":"","sources":["../../../../../../src/integration-engine/ropid-gtfs/workers/timetables/tasks/RefreshGtfsStopsCacheTask.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,yCAA6E;AAC7E,kFAAqF;AACrF,8EAA0E;AAC1E,iEAAwE;AACxE,4CAAqD;AACrD,2FAAwF;AAGjF,IAAM,yBAAyB,uCAA/B,MAAM,yBAA0B,SAAQ,sCAAiB;IAM5D,YAC8D,wBAA0D,EAC5D,gBAAgD;QAExG,KAAK,CAAC,iCAAqB,CAAC,CAAC;QAHqC,6BAAwB,GAAxB,wBAAwB,CAA0B;QACpD,qBAAgB,GAAhB,gBAAgB,CAAwB;QAP5F,cAAS,GAAG,uBAAuB,CAAC;QACpC,aAAQ,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC,aAAa;QAUpD,IAAI,CAAC,kBAAkB,GAAG,IAAI,gCAAmB,EAAE,CAAC;IACxD,CAAC;IAES,KAAK,CAAC,OAAO;QACnB,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,gBAAgB,CAAC,MAAM,EAAE,CAAC;QACtD,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC,kBAAkB,CAAC,sBAAsB,EAAE,CAAC;QAEzE,MAAM,IAAI,CAAC,wBAAwB,CAAC,WAAW,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC;IACzE,CAAC;CACJ,CAAA;oCArBY,yBAAyB;IADrC,IAAA,qBAAU,GAAE;IAQJ,WAAA,IAAA,iBAAM,EAAC,iDAAuB,CAAC,wBAAwB,CAAC,CAAA;IACxD,WAAA,IAAA,iBAAM,EAAC,iDAAuB,CAAC,sBAAsB,CAAC,CAAA;qCADqC,mDAAwB;QAClC,mCAAsB;GARnG,yBAAyB,CAqBrC"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { GtfsStopParser } from "../../../../../../../helpers/GtfsStopParser";
|
|
2
|
-
import { IStopCisDto } from "../../../../../../../schema-definitions/ropid-gtfs/interfaces/IStopCisDto";
|
|
3
|
-
import { IAwsNodeIdGtfsStopIdDto } from "../../../../../../../schema-definitions/ropid-gtfs/interfaces/IStopDto";
|
|
4
|
-
import { RedisModel } from "@golemio/core/dist/integration-engine";
|
|
5
|
-
export declare class GtfsStopsRedisRepository extends RedisModel {
|
|
6
|
-
private gtfsStopParser;
|
|
7
|
-
static NAMESPACE_PREFIX: string;
|
|
8
|
-
constructor(gtfsStopParser: GtfsStopParser);
|
|
9
|
-
refreshData(cisStops: Array<Pick<IStopCisDto, "id" | "cis">>, gtfsStops: IAwsNodeIdGtfsStopIdDto[]): Promise<void>;
|
|
10
|
-
private createNewCache;
|
|
11
|
-
private deleteOldCache;
|
|
12
|
-
}
|