@golemio/pid 3.5.2-dev.1636445607 → 3.5.2-rc.1637873076
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/dist/integration-engine/ropid-gtfs/data-access/cache/RunTripsRedisRepository.js +1 -2
- package/dist/integration-engine/ropid-gtfs/data-access/cache/RunTripsRedisRepository.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/data-access/TripsRepository.js +5 -6
- 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/helpers/RawQueryProvider.d.ts +1 -1
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/data-access/helpers/RawQueryProvider.js +165 -101
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/data-access/helpers/RawQueryProvider.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/tasks/PropagateTrainDelayTask.js.map +1 -1
- package/dist/output-gateway/pid/controllers/v2/V2DepartureBoardsController.js +1 -1
- package/dist/output-gateway/pid/index.d.ts +5 -4
- package/dist/output-gateway/pid/index.js +0 -1
- package/dist/output-gateway/pid/index.js.map +1 -1
- package/dist/output-gateway/pid/ioc/Di.js +0 -4
- package/dist/output-gateway/pid/ioc/Di.js.map +1 -1
- package/dist/output-gateway/pid/ioc/OgPidToken.d.ts +0 -2
- package/dist/output-gateway/pid/ioc/OgPidToken.js +0 -2
- package/dist/output-gateway/pid/ioc/OgPidToken.js.map +1 -1
- package/dist/output-gateway/pid/models/PIDDepartureBoardsModel.d.ts +28 -14
- package/dist/output-gateway/pid/models/PIDDepartureBoardsModel.js +72 -192
- package/dist/output-gateway/pid/models/PIDDepartureBoardsModel.js.map +1 -1
- package/dist/output-gateway/pid/models/helpers/PIDDepartureModel.js +15 -26
- package/dist/output-gateway/pid/models/helpers/PIDDepartureModel.js.map +1 -1
- package/dist/output-gateway/pid/models/helpers/SkipHelper.d.ts +0 -11
- package/dist/output-gateway/pid/models/helpers/SkipHelper.js +0 -91
- package/dist/output-gateway/pid/models/helpers/SkipHelper.js.map +1 -1
- package/dist/output-gateway/pid/models/helpers/interfaces/IPIDDepartureQueryOptions.d.ts +0 -3
- package/dist/output-gateway/pid/service/facade/TransferFacade.js +0 -2
- package/dist/output-gateway/pid/service/facade/TransferFacade.js.map +1 -1
- package/dist/output-gateway/public/data-access/redis/PublicVehiclePositionsRepository.d.ts +2 -4
- package/dist/output-gateway/public/data-access/redis/PublicVehiclePositionsRepository.js +68 -90
- package/dist/output-gateway/public/data-access/redis/PublicVehiclePositionsRepository.js.map +1 -1
- package/dist/output-gateway/public/domain/repository/IVehiclePositionsRepository.d.ts +1 -2
- package/dist/output-gateway/shared/constants/validations.js +1 -1
- package/dist/output-gateway/shared/constants/validations.js.map +1 -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/docs/openapi-output.yaml +2 -10
- package/package.json +2 -2
- package/db/migrations/postgresql/20250103092631-skip-missing.js +0 -53
- package/db/migrations/postgresql/20250109122504-braking-down-mapping-queries.js +0 -53
- package/db/migrations/postgresql/sqls/20250103092631-skip-missing-down.sql +0 -184
- package/db/migrations/postgresql/sqls/20250103092631-skip-missing-up.sql +0 -195
- package/db/migrations/postgresql/sqls/20250109122504-braking-down-mapping-queries-down.sql +0 -12
- package/db/migrations/postgresql/sqls/20250109122504-braking-down-mapping-queries-up.sql +0 -139
- package/dist/output-gateway/pid/domain/DepartureInterfaces.d.ts +0 -7
- package/dist/output-gateway/pid/domain/DepartureInterfaces.js +0 -3
- package/dist/output-gateway/pid/domain/DepartureInterfaces.js.map +0 -1
- package/dist/output-gateway/pid/models/helpers/const.d.ts +0 -4
- package/dist/output-gateway/pid/models/helpers/const.js +0 -8
- package/dist/output-gateway/pid/models/helpers/const.js.map +0 -1
- package/dist/output-gateway/pid/models/interfaces/IGetDeparturesOptions.d.ts +0 -21
- package/dist/output-gateway/pid/models/interfaces/IGetDeparturesOptions.js +0 -3
- package/dist/output-gateway/pid/models/interfaces/IGetDeparturesOptions.js.map +0 -1
- package/dist/output-gateway/ropid-gtfs/data-access/redis/RunTripsRedisRepository.d.ts +0 -10
- package/dist/output-gateway/ropid-gtfs/data-access/redis/RunTripsRedisRepository.js +0 -65
- package/dist/output-gateway/ropid-gtfs/data-access/redis/RunTripsRedisRepository.js.map +0 -1
- package/dist/output-gateway/ropid-gtfs/domain/repository/IRunTripsRedisRepository.d.ts +0 -4
- package/dist/output-gateway/ropid-gtfs/domain/repository/IRunTripsRedisRepository.js +0 -3
- package/dist/output-gateway/ropid-gtfs/domain/repository/IRunTripsRedisRepository.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TransferFacade.js","sourceRoot":"","sources":["../../../../../src/output-gateway/pid/service/facade/TransferFacade.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,+BAAgI;AAChI,mDAA2D;AAC3D,qDAAoD;AACpD,+FAA0E;AAC1E,0HAAoG;AACpG,4CAA8C;AAC9C,6EAA8F;AAE9F,iEAAwE;AACxE,wGAAqG;AAG9F,IAAM,cAAc,4BAApB,MAAM,cAAc;IACvB,YACqD,mBAAyC,EAC9B,uBAAwD;QADnE,wBAAmB,GAAnB,mBAAmB,CAAsB;QAC9B,4BAAuB,GAAvB,uBAAuB,CAAiC;IACrH,CAAC;IAEJ;;;;;OAKG;IACI,KAAK,CAAC,qBAAqB,CAC9B,OAAiB,EACjB,UAAyB,EACzB,aAAqB,EACrB,aAAqB,EACrB,QAAQ,GAAG,yBAAgB,CAAC,QAAQ;QAEpC,IAAI,iBAAiB,GAAyB,EAAE,CAAC;QACjD,IAAI;YACA,iBAAiB,GAAG,MAAM,IAAI,CAAC,mBAAmB,CAAC,qBAAqB,CAAC;gBACrE,QAA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":"TransferFacade.js","sourceRoot":"","sources":["../../../../../src/output-gateway/pid/service/facade/TransferFacade.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,+BAAgI;AAChI,mDAA2D;AAC3D,qDAAoD;AACpD,+FAA0E;AAC1E,0HAAoG;AACpG,4CAA8C;AAC9C,6EAA8F;AAE9F,iEAAwE;AACxE,wGAAqG;AAG9F,IAAM,cAAc,4BAApB,MAAM,cAAc;IACvB,YACqD,mBAAyC,EAC9B,uBAAwD;QADnE,wBAAmB,GAAnB,mBAAmB,CAAsB;QAC9B,4BAAuB,GAAvB,uBAAuB,CAAiC;IACrH,CAAC;IAEJ;;;;;OAKG;IACI,KAAK,CAAC,qBAAqB,CAC9B,OAAiB,EACjB,UAAyB,EACzB,aAAqB,EACrB,aAAqB,EACrB,QAAQ,GAAG,yBAAgB,CAAC,QAAQ;QAEpC,IAAI,iBAAiB,GAAyB,EAAE,CAAC;QACjD,IAAI;YACA,iBAAiB,GAAG,MAAM,IAAI,CAAC,mBAAmB,CAAC,qBAAqB,CAAC;gBACrE,QAAQ,EAAE,OAAO;gBACjB,aAAa;gBACb,aAAa;aAChB,CAAC,CAAC;SACN;QAAC,OAAO,KAAK,EAAE;YACZ,IAAI,KAAK,YAAY,qCAAoB,EAAE;gBACvC,MAAM,KAAK,CAAC;aACf;YAED,MAAM,IAAI,6BAAY,CAAC,wCAAwC,EAAE,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC;SACvG;QAED,IAAI,iBAAiB,CAAC,MAAM,KAAK,CAAC,EAAE;YAChC,OAAO,EAAE,CAAC;SACb;QAED,IAAI,kBAAkB,GAAyB,EAAE,CAAC;QAClD,IAAI;YACA,MAAM,mBAAmB,GAAG,IAAI,2BAAkB,CAAC,iBAAiB,EAAE;gBAClE,GAAG,IAAI,CAAC,cAAc;gBACtB,QAAQ,EAAE,QAAQ;gBAClB,UAAU;aACb,CAAC,CAAC,yBAAyB,EAAE,CAAC;YAE/B,kBAAkB,GAAG,IAAI,CAAC,uBAAuB,CAAC,cAAc,CAAC,mBAAmB,CAAC,CAAC;SACzF;QAAC,OAAO,KAAK,EAAE;YACZ,IAAI,KAAK,YAAY,qCAAoB,EAAE;gBACvC,MAAM,KAAK,CAAC;aACf;YAED,MAAM,IAAI,6BAAY,CAAC,uCAAuC,EAAE,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC;SACtG;QAED,OAAO,kBAAkB,CAAC;IAC9B,CAAC;IAED;;OAEG;IACH,IAAY,cAAc;QACtB,OAAO;YACH,KAAK,EAAE,EAAE;YACT,KAAK,EAAE,EAAE;YACT,MAAM,EAAE,CAAC;YACT,IAAI,EAAE,mBAAa,CAAC,UAAU;YAC9B,KAAK,EAAE,oBAAc,CAAC,IAAI;YAC1B,MAAM,EAAE,qBAAe,CAAC,6BAA6B;YACrD,IAAI,EAAE,CAAC,mBAAa,CAAC,QAAQ,CAAC;YAC9B,oBAAoB,EAAE,EAAE;SAC3B,CAAC;IACN,CAAC;CACJ,CAAA;yBAzEY,cAAc;IAD1B,IAAA,qBAAU,GAAE;IAGJ,WAAA,IAAA,iBAAM,EAAC,uBAAU,CAAC,oBAAoB,CAAC,CAAA;IACvC,WAAA,IAAA,iBAAM,EAAC,uBAAU,CAAC,+BAA+B,CAAC,CAAA;qCADmB,kCAAoB;QACL,iEAA+B;GAH/G,cAAc,CAyE1B"}
|
|
@@ -8,12 +8,10 @@ export declare class PublicVehiclePositionsRepository implements IVehiclePositio
|
|
|
8
8
|
private log;
|
|
9
9
|
private setName;
|
|
10
10
|
constructor(redisConnector: IoRedisConnector, log: ILogger);
|
|
11
|
-
setCurrentSetName(name: string): void;
|
|
12
11
|
getAllVehicleIds(boundingBox: IBoundingBoxWithCenter): Promise<string[]>;
|
|
13
12
|
getAllVehiclePositions(vehicleIds: string[], tripIds?: string[]): Promise<IPublicApiCacheDto[]>;
|
|
14
13
|
getAllVehiclePositionsForMultipleTrips(tripIds: string[]): Promise<Map<string, IPublicApiCacheDto[]>>;
|
|
15
|
-
getTripsWithUntrackedVehicles(tripIds: string[]): Promise<Set<string>>;
|
|
16
|
-
getDetailedVehiclePosition(vehicleId: string, tripId?: string): Promise<IPublicApiCacheDto | null>;
|
|
17
|
-
private getVehicleIdsForMultiple;
|
|
18
14
|
private getCanceledTrips;
|
|
15
|
+
getDetailedVehiclePosition(vehicleId: string, tripId?: string): Promise<IPublicApiCacheDto | null>;
|
|
16
|
+
setCurrentSetName(name: string): void;
|
|
19
17
|
}
|
|
@@ -24,9 +24,6 @@ let PublicVehiclePositionsRepository = exports.PublicVehiclePositionsRepository
|
|
|
24
24
|
this.log = log;
|
|
25
25
|
this.setName = undefined; // loaded via pub sub
|
|
26
26
|
}
|
|
27
|
-
setCurrentSetName(name) {
|
|
28
|
-
this.setName = name;
|
|
29
|
-
}
|
|
30
27
|
async getAllVehicleIds(boundingBox) {
|
|
31
28
|
if (!this.setName) {
|
|
32
29
|
this.log.debug("Empty setName for public vehicle positions api.");
|
|
@@ -40,8 +37,8 @@ let PublicVehiclePositionsRepository = exports.PublicVehiclePositionsRepository
|
|
|
40
37
|
try {
|
|
41
38
|
vehicleIds = (await connection.geosearch(this.setName, "FROMLONLAT", boundingBox.centerPoint.longitude, boundingBox.centerPoint.latitude, "BYBOX", boundingBox.width, boundingBox.height, "m", "ASC"));
|
|
42
39
|
}
|
|
43
|
-
catch (
|
|
44
|
-
throw new golemio_errors_1.GeneralError(
|
|
40
|
+
catch (err) {
|
|
41
|
+
throw new golemio_errors_1.GeneralError(`${this.constructor.name}: Cannot get vehicle ids from cache: ${err.message}`, this.constructor.name, err);
|
|
45
42
|
}
|
|
46
43
|
return vehicleIds;
|
|
47
44
|
}
|
|
@@ -64,8 +61,8 @@ let PublicVehiclePositionsRepository = exports.PublicVehiclePositionsRepository
|
|
|
64
61
|
}
|
|
65
62
|
vehiclePositions = await connection.mget(keys);
|
|
66
63
|
}
|
|
67
|
-
catch (
|
|
68
|
-
throw new golemio_errors_1.GeneralError(
|
|
64
|
+
catch (err) {
|
|
65
|
+
throw new golemio_errors_1.GeneralError(`${this.constructor.name}: Cannot get vehicle positions from cache: ${err.message}`, this.constructor.name, err);
|
|
69
66
|
}
|
|
70
67
|
const parsedVehiclePositions = [];
|
|
71
68
|
for (const vehiclePosition of vehiclePositions) {
|
|
@@ -75,8 +72,8 @@ let PublicVehiclePositionsRepository = exports.PublicVehiclePositionsRepository
|
|
|
75
72
|
try {
|
|
76
73
|
parsedVehiclePositions.push(JSON.parse(vehiclePosition));
|
|
77
74
|
}
|
|
78
|
-
catch (
|
|
79
|
-
throw new golemio_errors_1.GeneralError(
|
|
75
|
+
catch (err) {
|
|
76
|
+
throw new golemio_errors_1.GeneralError(`${this.constructor.name}: Cannot parse vehicle position: ${err.message}`, this.constructor.name, err);
|
|
80
77
|
}
|
|
81
78
|
}
|
|
82
79
|
return parsedVehiclePositions;
|
|
@@ -90,20 +87,46 @@ let PublicVehiclePositionsRepository = exports.PublicVehiclePositionsRepository
|
|
|
90
87
|
if (!this.redisConnector.isConnected()) {
|
|
91
88
|
await this.redisConnector.connect();
|
|
92
89
|
}
|
|
93
|
-
const
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
const
|
|
98
|
-
|
|
99
|
-
|
|
90
|
+
const vehicleIdsByTrip = new Map();
|
|
91
|
+
const vehicleIdsByFutureTrip = new Map();
|
|
92
|
+
const connection = this.redisConnector.getConnection();
|
|
93
|
+
const pipeline = connection.pipeline();
|
|
94
|
+
const futurePipeline = connection.pipeline();
|
|
95
|
+
for (const tripId of tripIds) {
|
|
96
|
+
pipeline.lrange(`${this.setName}:trip-${tripId}`, 0, -1);
|
|
97
|
+
futurePipeline.lrange(`${this.setName}:future-trip-${tripId}`, 0, -1);
|
|
98
|
+
}
|
|
99
|
+
try {
|
|
100
|
+
const [trips, futureTrips] = await Promise.all([pipeline.exec(), futurePipeline.exec()]);
|
|
101
|
+
for (const [err, vehicleIds] of trips) {
|
|
102
|
+
if (err) {
|
|
103
|
+
throw new golemio_errors_1.GeneralError("Cannot get vehicle ids for trip from cache", this.constructor.name, err);
|
|
104
|
+
}
|
|
105
|
+
vehicleIdsByTrip.set(tripIds[vehicleIdsByTrip.size], vehicleIds);
|
|
106
|
+
}
|
|
107
|
+
for (const [err, vehicleIds] of futureTrips) {
|
|
108
|
+
if (err) {
|
|
109
|
+
throw new golemio_errors_1.GeneralError("Cannot get vehicle ids for future-trip from cache", this.constructor.name, err);
|
|
110
|
+
}
|
|
111
|
+
vehicleIdsByFutureTrip.set(tripIds[vehicleIdsByFutureTrip.size], vehicleIds);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
catch (err) {
|
|
115
|
+
if (err instanceof golemio_errors_1.GeneralError) {
|
|
116
|
+
throw err;
|
|
117
|
+
}
|
|
118
|
+
throw new golemio_errors_1.GeneralError("Cannot get vehicle ids for trip from cache", this.constructor.name, err);
|
|
119
|
+
}
|
|
120
|
+
const positionValues = Array.from(new Set([...vehicleIdsByTrip.values(), ...vehicleIdsByFutureTrip.values()].flat()));
|
|
121
|
+
if (positionValues.length > 0) {
|
|
122
|
+
const allPositions = await this.getAllVehiclePositions(positionValues);
|
|
100
123
|
for (const position of allPositions) {
|
|
101
124
|
if (!positionsByTrip.has(position.gtfs_trip_id)) {
|
|
102
125
|
positionsByTrip.set(position.gtfs_trip_id, []);
|
|
103
126
|
}
|
|
104
127
|
positionsByTrip.get(position.gtfs_trip_id).push(position);
|
|
105
128
|
}
|
|
106
|
-
const futurePositions = await this.getAllVehiclePositions(
|
|
129
|
+
const futurePositions = await this.getAllVehiclePositions(positionValues, tripIds);
|
|
107
130
|
for (const position of futurePositions) {
|
|
108
131
|
if (!positionsByTrip.has(position.gtfs_trip_id)) {
|
|
109
132
|
positionsByTrip.set(position.gtfs_trip_id, []);
|
|
@@ -117,29 +140,31 @@ let PublicVehiclePositionsRepository = exports.PublicVehiclePositionsRepository
|
|
|
117
140
|
}
|
|
118
141
|
return positionsByTrip;
|
|
119
142
|
}
|
|
120
|
-
async
|
|
121
|
-
const
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
return
|
|
143
|
+
async getCanceledTrips(tripIds) {
|
|
144
|
+
const connection = this.redisConnector.getConnection();
|
|
145
|
+
const parsedCanceledTrips = [];
|
|
146
|
+
if (tripIds.length === 0) {
|
|
147
|
+
return [];
|
|
125
148
|
}
|
|
126
|
-
|
|
127
|
-
|
|
149
|
+
const keys = [];
|
|
150
|
+
for (const tripId of tripIds) {
|
|
151
|
+
keys.push(`${this.setName}:canceled-trips-${tripId}`);
|
|
128
152
|
}
|
|
129
|
-
const
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
153
|
+
const canceledTrips = await connection.mget(keys);
|
|
154
|
+
for (const canceledTrip of canceledTrips) {
|
|
155
|
+
if (canceledTrip === null) {
|
|
156
|
+
continue;
|
|
157
|
+
}
|
|
158
|
+
else {
|
|
159
|
+
try {
|
|
160
|
+
parsedCanceledTrips.push(JSON.parse(canceledTrip));
|
|
161
|
+
}
|
|
162
|
+
catch (err) {
|
|
163
|
+
throw new golemio_errors_1.GeneralError(`${this.constructor.name}: Cannot parse canceled trip: ${err.message}`, this.constructor.name, err);
|
|
136
164
|
}
|
|
137
165
|
}
|
|
138
166
|
}
|
|
139
|
-
|
|
140
|
-
throw new golemio_errors_1.GeneralError("Cannot get vehicle positions from cache", this.constructor.name, error);
|
|
141
|
-
}
|
|
142
|
-
return untrackedTrips;
|
|
167
|
+
return parsedCanceledTrips;
|
|
143
168
|
}
|
|
144
169
|
// Current trips are saved in the cache with key made from vehicleId only. For future trips tripId has to be also provided.
|
|
145
170
|
async getDetailedVehiclePosition(vehicleId, tripId) {
|
|
@@ -156,9 +181,9 @@ let PublicVehiclePositionsRepository = exports.PublicVehiclePositionsRepository
|
|
|
156
181
|
const key = tripId ? `${this.setName}:future-trip-${vehicleId}-${tripId}` : `${this.setName}:vehicle-${vehicleId}`;
|
|
157
182
|
vehiclePosition = await connection.get(key);
|
|
158
183
|
}
|
|
159
|
-
catch (
|
|
160
|
-
this.log.error(
|
|
161
|
-
throw new golemio_errors_1.GeneralError(
|
|
184
|
+
catch (err) {
|
|
185
|
+
this.log.error(`${this.constructor.name}: Cannot get vehicle position from cache: ${err.message}`);
|
|
186
|
+
throw new golemio_errors_1.GeneralError(`${this.constructor.name}: Cannot get vehicle position from cache: ${err.message}`, this.constructor.name, err);
|
|
162
187
|
}
|
|
163
188
|
if (vehiclePosition === null) {
|
|
164
189
|
this.log.info(`${this.constructor.name}: Cannot find vehicle_id ${vehicleId}`);
|
|
@@ -167,60 +192,13 @@ let PublicVehiclePositionsRepository = exports.PublicVehiclePositionsRepository
|
|
|
167
192
|
try {
|
|
168
193
|
return JSON.parse(vehiclePosition);
|
|
169
194
|
}
|
|
170
|
-
catch (
|
|
171
|
-
this.log.error(
|
|
172
|
-
throw new golemio_errors_1.GeneralError(
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
async getVehicleIdsForMultiple(tripIds, keyPrefix) {
|
|
176
|
-
const vehicleIdsByTrip = new Map();
|
|
177
|
-
const connection = this.redisConnector.getConnection();
|
|
178
|
-
const pipeline = connection.pipeline();
|
|
179
|
-
for (const tripId of tripIds) {
|
|
180
|
-
pipeline.lrange(`${this.setName}:${keyPrefix}-${tripId}`, 0, -1);
|
|
181
|
-
}
|
|
182
|
-
try {
|
|
183
|
-
const trips = await pipeline.exec();
|
|
184
|
-
for (const [error, vehicleIds] of trips) {
|
|
185
|
-
if (error) {
|
|
186
|
-
throw new golemio_errors_1.GeneralError(`Cannot get vehicle ids for ${keyPrefix} from cache`, this.constructor.name, error);
|
|
187
|
-
}
|
|
188
|
-
vehicleIdsByTrip.set(tripIds[vehicleIdsByTrip.size], vehicleIds);
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
catch (error) {
|
|
192
|
-
if (error instanceof golemio_errors_1.GeneralError) {
|
|
193
|
-
throw error;
|
|
194
|
-
}
|
|
195
|
-
throw new golemio_errors_1.GeneralError(`Cannot get vehicle ids for ${keyPrefix} from cache`, this.constructor.name, error);
|
|
195
|
+
catch (err) {
|
|
196
|
+
this.log.error(`${this.constructor.name}: Cannot parse ${vehicleId}: ${err.message}`);
|
|
197
|
+
throw new golemio_errors_1.GeneralError(`${this.constructor.name}: Cannot parse ${vehicleId}: ${err.message}`, this.constructor.name, err);
|
|
196
198
|
}
|
|
197
|
-
return Array.from(vehicleIdsByTrip.values()).flat();
|
|
198
199
|
}
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
const parsedCanceledTrips = [];
|
|
202
|
-
if (tripIds.length === 0) {
|
|
203
|
-
return [];
|
|
204
|
-
}
|
|
205
|
-
const keys = [];
|
|
206
|
-
for (const tripId of tripIds) {
|
|
207
|
-
keys.push(`${this.setName}:canceled-trips-${tripId}`);
|
|
208
|
-
}
|
|
209
|
-
const canceledTrips = await connection.mget(keys);
|
|
210
|
-
for (const canceledTrip of canceledTrips) {
|
|
211
|
-
if (canceledTrip === null) {
|
|
212
|
-
continue;
|
|
213
|
-
}
|
|
214
|
-
else {
|
|
215
|
-
try {
|
|
216
|
-
parsedCanceledTrips.push(JSON.parse(canceledTrip));
|
|
217
|
-
}
|
|
218
|
-
catch (error) {
|
|
219
|
-
throw new golemio_errors_1.GeneralError("Cannot parse canceled trip", this.constructor.name, error);
|
|
220
|
-
}
|
|
221
|
-
}
|
|
222
|
-
}
|
|
223
|
-
return parsedCanceledTrips;
|
|
200
|
+
setCurrentSetName(name) {
|
|
201
|
+
this.setName = name;
|
|
224
202
|
}
|
|
225
203
|
};
|
|
226
204
|
exports.PublicVehiclePositionsRepository = PublicVehiclePositionsRepository = __decorate([
|
package/dist/output-gateway/public/data-access/redis/PublicVehiclePositionsRepository.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PublicVehiclePositionsRepository.js","sourceRoot":"","sources":["../../../../../src/output-gateway/public/data-access/redis/PublicVehiclePositionsRepository.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAGA,oGAAiG;AACjG,wEAAqE;AAErE,+DAAuE;AACvE,6EAAwE;AACxE,iEAAwE;AAGjE,IAAM,gCAAgC,8CAAtC,MAAM,gCAAgC;IAGzC,YAC2C,cAAwC,EACrD,GAAoB;QADC,mBAAc,GAAd,cAAc,CAAkB;QAC7C,QAAG,GAAH,GAAG,CAAS;QAJ1C,YAAO,GAAuB,SAAS,CAAC,CAAC,qBAAqB;IAKnE,CAAC;IAEG,
|
|
1
|
+
{"version":3,"file":"PublicVehiclePositionsRepository.js","sourceRoot":"","sources":["../../../../../src/output-gateway/public/data-access/redis/PublicVehiclePositionsRepository.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAGA,oGAAiG;AACjG,wEAAqE;AAErE,+DAAuE;AACvE,6EAAwE;AACxE,iEAAwE;AAGjE,IAAM,gCAAgC,8CAAtC,MAAM,gCAAgC;IAGzC,YAC2C,cAAwC,EACrD,GAAoB;QADC,mBAAc,GAAd,cAAc,CAAkB;QAC7C,QAAG,GAAH,GAAG,CAAS;QAJ1C,YAAO,GAAuB,SAAS,CAAC,CAAC,qBAAqB;IAKnE,CAAC;IAEG,KAAK,CAAC,gBAAgB,CAAC,WAAmC;QAC7D,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE;YACf,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,iDAAiD,CAAC,CAAC;YAClE,OAAO,EAAE,CAAC;SACb;QAED,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,WAAW,EAAE,EAAE;YACpC,MAAM,IAAI,CAAC,cAAc,CAAC,OAAO,EAAE,CAAC;SACvC;QAED,MAAM,UAAU,GAAG,IAAI,CAAC,cAAc,CAAC,aAAa,EAAE,CAAC;QACvD,IAAI,UAAU,GAAa,EAAE,CAAC;QAE9B,IAAI;YACA,UAAU,GAAG,CAAC,MAAM,UAAU,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;YACtF,MAAM,IAAI,6BAAY,CAClB,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,kBAAkB,SAAS,KAAK,GAAG,CAAC,OAAO,EAAE,EACrE,IAAI,CAAC,WAAW,CAAC,IAAI,EACrB,GAAG,CACN,CAAC;SACL;IACL,CAAC;IAEM,iBAAiB,CAAC,IAAY;QACjC,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;IACxB,CAAC;CACJ,CAAA;2CAnPY,gCAAgC;IAD5C,IAAA,qBAAU,GAAE;IAKJ,WAAA,IAAA,iBAAM,EAAC,oBAAc,CAAC,cAAc,CAAC,CAAA;IACrC,WAAA,IAAA,iBAAM,EAAC,qBAAS,CAAC,MAAM,CAAC,CAAA;qCADsC,mCAAgB;GAJ1E,gCAAgC,CAmP5C"}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { IPublicApiCacheDto } from "../../../../schema-definitions/vehicle-positions/redis/interfaces/IPublicApiCacheDto";
|
|
2
2
|
import { IBoundingBoxWithCenter } from "../IBoudingBox";
|
|
3
3
|
export interface IVehiclePositionsRepository {
|
|
4
|
-
setCurrentSetName(name: string): void;
|
|
5
4
|
getAllVehicleIds(boundingBox: IBoundingBoxWithCenter): Promise<string[]>;
|
|
6
5
|
getAllVehiclePositions(vehicleIds: string[]): Promise<IPublicApiCacheDto[]>;
|
|
7
6
|
getAllVehiclePositionsForMultipleTrips(tripIds: string[]): Promise<Map<string, IPublicApiCacheDto[]>>;
|
|
8
7
|
getDetailedVehiclePosition(vehicleId: string, tripdId?: string): Promise<IPublicApiCacheDto | null>;
|
|
9
|
-
|
|
8
|
+
setCurrentSetName(name: string): void;
|
|
10
9
|
}
|
|
@@ -18,7 +18,7 @@ exports.ValidationArrays = {
|
|
|
18
18
|
"routeHeadingOnceNoGap",
|
|
19
19
|
"routeHeadingOnceNoGapFill",
|
|
20
20
|
],
|
|
21
|
-
skip: ["untracked", "
|
|
21
|
+
skip: ["untracked", "canceled", "atStop" /*, "onInfotext"*/],
|
|
22
22
|
},
|
|
23
23
|
// TODO replace moment.tz.names() with Intl.supportedValuesOf("timeZone") after migrating to Node 18
|
|
24
24
|
preferredTimezone: [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validations.js","sourceRoot":"","sources":["../../../../src/output-gateway/shared/constants/validations.ts"],"names":[],"mappings":";;;;;;AAAA,gGAA+D;AAElD,QAAA,gBAAgB,GAAG;IAC5B,eAAe,EAAE;QACb,aAAa,EAAE,CAAC,YAAY,EAAE,UAAU,EAAE,OAAO,CAAC;QAClD,KAAK,EAAE,CAAC,MAAM,EAAE,WAAW,CAAC;QAC5B,MAAM,EAAE;YACJ,MAAM;YACN,WAAW;YACX,kBAAkB;YAClB,eAAe;YACf,sBAAsB;YACtB,uBAAuB;YACvB,2BAA2B;SAC9B;QACD,IAAI,EAAE,CAAC,WAAW,EAAE,
|
|
1
|
+
{"version":3,"file":"validations.js","sourceRoot":"","sources":["../../../../src/output-gateway/shared/constants/validations.ts"],"names":[],"mappings":";;;;;;AAAA,gGAA+D;AAElD,QAAA,gBAAgB,GAAG;IAC5B,eAAe,EAAE;QACb,aAAa,EAAE,CAAC,YAAY,EAAE,UAAU,EAAE,OAAO,CAAC;QAClD,KAAK,EAAE,CAAC,MAAM,EAAE,WAAW,CAAC;QAC5B,MAAM,EAAE;YACJ,MAAM;YACN,WAAW;YACX,kBAAkB;YAClB,eAAe;YACf,sBAAsB;YACtB,uBAAuB;YACvB,2BAA2B;SAC9B;QACD,IAAI,EAAE,CAAC,WAAW,EAAE,UAAU,EAAE,QAAQ,CAAC,kBAAkB,CAAC;KAC/D;IACD,oGAAoG;IACpG,iBAAiB,EAAE;QACf,GAAG,yBAAM,CAAC,EAAE,CAAC,KAAK,EAAE;QACpB,GAAG,yBAAM,CAAC,EAAE;aACP,KAAK,EAAE;YACR,iDAAiD;aAChD,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;YACpC,0BAA0B;aACzB,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;KAC/C;CACJ,CAAC"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PUBLIC_DEPARTURE_NAMESPACE_PREFIX =
|
|
4
|
-
exports.GTFS_RUN_SCHEDULE_NAMESPACE_PREFIX = "gtfsRunSchedule";
|
|
3
|
+
exports.PUBLIC_DEPARTURE_NAMESPACE_PREFIX = void 0;
|
|
5
4
|
exports.PUBLIC_DEPARTURE_NAMESPACE_PREFIX = "gtfsPublicDepartureCache";
|
|
6
5
|
//# sourceMappingURL=const.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"const.js","sourceRoot":"","sources":["../../../../src/schema-definitions/ropid-gtfs/redis/const.ts"],"names":[],"mappings":";;;AAAa,QAAA,
|
|
1
|
+
{"version":3,"file":"const.js","sourceRoot":"","sources":["../../../../src/schema-definitions/ropid-gtfs/redis/const.ts"],"names":[],"mappings":";;;AAAa,QAAA,iCAAiC,GAAG,0BAA0B,CAAC"}
|
package/docs/openapi-output.yaml
CHANGED
|
@@ -976,20 +976,12 @@ paths:
|
|
|
976
976
|
example: "routeOnce"
|
|
977
977
|
- name: skip
|
|
978
978
|
in: query
|
|
979
|
-
description:
|
|
980
|
-
|
|
981
|
-
Multiple filters can be applied using array syntax, e.g., `&skip[]=canceled&skip[]=atStop`.
|
|
982
|
-
Using both `untracked` and `missing` will exclude all untracked vehicles, as missing vehicles are a subset of untracked vehicles.
|
|
983
|
-
We recommend using `missing` instead of `untracked`, as skipping all untracked vehicles may result in departures not appearing in the API response until the last few minutes before departure, especially for departure boards near the starting station/stop.
|
|
979
|
+
description: >-
|
|
980
|
+
Valid entries: `canceled`, `atStop`, `untracked`. Skips trips with these attributes. Use multiple rules with `&skip[]=cancelled&skip[]=atStop` query parameter array form.
|
|
984
981
|
required: false
|
|
985
982
|
schema:
|
|
986
983
|
type: string
|
|
987
984
|
example: "canceled"
|
|
988
|
-
enum:
|
|
989
|
-
- canceled
|
|
990
|
-
- atStop
|
|
991
|
-
- untracked
|
|
992
|
-
- missing
|
|
993
985
|
- name: limit
|
|
994
986
|
in: query
|
|
995
987
|
description: Limits the number of items in response. The maximum is 1000 (default value is 20).
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@golemio/pid",
|
|
3
|
-
"version": "3.5.2-
|
|
3
|
+
"version": "3.5.2-rc.1637873076",
|
|
4
4
|
"description": "Golemio PID Module",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
"@golemio/core": ">=1.16.0-rc.1551191551"
|
|
77
77
|
},
|
|
78
78
|
"dependencies": {
|
|
79
|
-
"@golemio/ovapi-gtfs-realtime-bindings": "1.2.
|
|
79
|
+
"@golemio/ovapi-gtfs-realtime-bindings": "1.2.3",
|
|
80
80
|
"@turf/turf": "^6.5.0",
|
|
81
81
|
"cheap-ruler": "^3.0.2",
|
|
82
82
|
"csv-parser": "^3.0.0",
|
|
@@ -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', '20250103092631-skip-missing-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', '20250103092631-skip-missing-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
|
-
};
|
|
@@ -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', '20250109122504-braking-down-mapping-queries-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', '20250109122504-braking-down-mapping-queries-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
|
-
};
|