@golemio/pid 2.7.8-dev.894145426 โ 2.7.8-dev.894806238
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/db/example/pb/pid_feed.pb +0 -0
- package/dist/integration-engine/vehicle-positions/workers/gtfs-rt/tasks/GenerateFilesTask.d.ts +2 -0
- package/dist/integration-engine/vehicle-positions/workers/gtfs-rt/tasks/GenerateFilesTask.js +24 -16
- package/dist/integration-engine/vehicle-positions/workers/gtfs-rt/tasks/GenerateFilesTask.js.map +1 -1
- package/dist/output-gateway/vehicle-positions/VehiclePositionsRouter.d.ts +1 -12
- package/dist/output-gateway/vehicle-positions/VehiclePositionsRouter.js +24 -102
- package/dist/output-gateway/vehicle-positions/VehiclePositionsRouter.js.map +1 -1
- package/docs/implementation_documentation.md +5 -0
- package/docs/openapi-output.yaml +45 -26
- package/package.json +1 -1
|
Binary file
|
package/dist/integration-engine/vehicle-positions/workers/gtfs-rt/tasks/GenerateFilesTask.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { AbstractEmptyTask } from "@golemio/core/dist/integration-engine/workers
|
|
|
2
2
|
export declare class GenerateFilesTask extends AbstractEmptyTask {
|
|
3
3
|
readonly queueName = "generateFiles";
|
|
4
4
|
readonly queueTtl: number;
|
|
5
|
+
private readonly logger;
|
|
5
6
|
private readonly tripsRepository;
|
|
6
7
|
private readonly gtfsRtRedisRepository;
|
|
7
8
|
private readonly alertsGenerator;
|
|
@@ -14,4 +15,5 @@ export declare class GenerateFilesTask extends AbstractEmptyTask {
|
|
|
14
15
|
* @example 20230101
|
|
15
16
|
*/
|
|
16
17
|
private parseUTCDateFromISO;
|
|
18
|
+
private validateAndSaveBuffer;
|
|
17
19
|
}
|
package/dist/integration-engine/vehicle-positions/workers/gtfs-rt/tasks/GenerateFilesTask.js
CHANGED
|
@@ -11,18 +11,21 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.GenerateFilesTask = void 0;
|
|
13
13
|
const ropid_vymi_1 = require("../../../../ropid-vymi");
|
|
14
|
+
const Di_1 = require("../../../ioc/Di");
|
|
14
15
|
const TripsRepository_1 = require("../../vehicle-positions/data-access/TripsRepository");
|
|
16
|
+
const ioc_1 = require("@golemio/core/dist/integration-engine/ioc");
|
|
15
17
|
const workers_1 = require("@golemio/core/dist/integration-engine/workers");
|
|
16
18
|
const ovapi_gtfs_realtime_bindings_1 = require("@golemio/ovapi-gtfs-realtime-bindings");
|
|
17
19
|
const GtfsRtRedisRepository_1 = require("../data-access/GtfsRtRedisRepository");
|
|
18
20
|
const AlertsGenerator_1 = require("../helpers/AlertsGenerator");
|
|
19
|
-
const VehicleDescriptor_1 = require("../helpers/VehicleDescriptor");
|
|
20
21
|
const const_1 = require("../helpers/const");
|
|
22
|
+
const VehicleDescriptor_1 = require("../helpers/VehicleDescriptor");
|
|
21
23
|
class GenerateFilesTask extends workers_1.AbstractEmptyTask {
|
|
22
24
|
constructor(queuePrefix) {
|
|
23
25
|
super(queuePrefix);
|
|
24
26
|
this.queueName = "generateFiles";
|
|
25
27
|
this.queueTtl = 29 * 1000; // 29 seconds
|
|
28
|
+
this.logger = Di_1.VPContainer.resolve(ioc_1.ContainerToken.Logger);
|
|
26
29
|
this.tripsRepository = new TripsRepository_1.TripsRepository();
|
|
27
30
|
this.gtfsRtRedisRepository = new GtfsRtRedisRepository_1.GtfsRtRedisRepository();
|
|
28
31
|
const vymiEventsRepository = new ropid_vymi_1.RopidVYMIEventsModel();
|
|
@@ -36,6 +39,7 @@ class GenerateFilesTask extends workers_1.AbstractEmptyTask {
|
|
|
36
39
|
const feedHeader = this.createFeedHeader();
|
|
37
40
|
const updatesMessage = ovapi_gtfs_realtime_bindings_1.transit_realtime.FeedMessage.create({ header: feedHeader });
|
|
38
41
|
const positionsMessage = ovapi_gtfs_realtime_bindings_1.transit_realtime.FeedMessage.create({ header: feedHeader });
|
|
42
|
+
const pidFeedMessage = ovapi_gtfs_realtime_bindings_1.transit_realtime.FeedMessage.create({ header: feedHeader });
|
|
39
43
|
for (const tripRecord of tripData) {
|
|
40
44
|
const tripDescriptor = {
|
|
41
45
|
scheduleRelationship: tripRecord.last_position.is_canceled
|
|
@@ -71,7 +75,7 @@ class GenerateFilesTask extends workers_1.AbstractEmptyTask {
|
|
|
71
75
|
},
|
|
72
76
|
};
|
|
73
77
|
const positionEntity = {
|
|
74
|
-
id: tripRecord.
|
|
78
|
+
id: tripRecord.id,
|
|
75
79
|
vehicle: {
|
|
76
80
|
currentStopSequence: tripRecord.last_position.last_stop_sequence,
|
|
77
81
|
position: {
|
|
@@ -90,21 +94,14 @@ class GenerateFilesTask extends workers_1.AbstractEmptyTask {
|
|
|
90
94
|
updatesMessage.entity.push(updatesMessageEntity);
|
|
91
95
|
const positionsMessageEntity = ovapi_gtfs_realtime_bindings_1.transit_realtime.FeedEntity.fromObject(positionEntity);
|
|
92
96
|
positionsMessage.entity.push(positionsMessageEntity);
|
|
97
|
+
// single feed for trip updates and vehicle positions
|
|
98
|
+
const feedMessageEntity = structuredClone(updatesMessageEntity);
|
|
99
|
+
feedMessageEntity.vehicle = positionsMessageEntity.vehicle;
|
|
100
|
+
pidFeedMessage.entity.push(feedMessageEntity);
|
|
93
101
|
}
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
yield this.gtfsRtRedisRepository.hset("trip_updates.pb", buffer.toString("binary"));
|
|
98
|
-
// await fs.writeFile("trip_updates.pb", buffer); // debug
|
|
99
|
-
yield this.gtfsRtRedisRepository.hset("trip_updates.json", JSON.stringify(updatesMessage));
|
|
100
|
-
}
|
|
101
|
-
if (ovapi_gtfs_realtime_bindings_1.transit_realtime.FeedMessage.verify(positionsMessage) === null) {
|
|
102
|
-
const buffer = ovapi_gtfs_realtime_bindings_1.transit_realtime.FeedMessage.encode(positionsMessage).finish();
|
|
103
|
-
// save to Redis
|
|
104
|
-
yield this.gtfsRtRedisRepository.hset("vehicle_positions.pb", buffer.toString("binary"));
|
|
105
|
-
// await fs.writeFile("vehicle_positions.pb", buffer); // debug
|
|
106
|
-
yield this.gtfsRtRedisRepository.hset("vehicle_positions.json", JSON.stringify(positionsMessage));
|
|
107
|
-
}
|
|
102
|
+
this.validateAndSaveBuffer("trip_updates", updatesMessage, true);
|
|
103
|
+
this.validateAndSaveBuffer("vehicle_positions", positionsMessage, true);
|
|
104
|
+
this.validateAndSaveBuffer("pid_feed", pidFeedMessage);
|
|
108
105
|
yield this.alertsGenerator.generateAlerts(feedHeader);
|
|
109
106
|
});
|
|
110
107
|
}
|
|
@@ -127,6 +124,17 @@ class GenerateFilesTask extends workers_1.AbstractEmptyTask {
|
|
|
127
124
|
("0" + startTimestamp.getUTCDate()).slice(-2);
|
|
128
125
|
return formattedDate;
|
|
129
126
|
}
|
|
127
|
+
validateAndSaveBuffer(feedName, message, shouldSaveAsJson = false) {
|
|
128
|
+
if (ovapi_gtfs_realtime_bindings_1.transit_realtime.FeedMessage.verify(message) !== null) {
|
|
129
|
+
this.logger.error(`${this.constructor.name}: invalid GTFS-RT message for ${feedName}`);
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
132
|
+
const buffer = ovapi_gtfs_realtime_bindings_1.transit_realtime.FeedMessage.encode(message).finish();
|
|
133
|
+
this.gtfsRtRedisRepository.hset(feedName + ".pb", buffer.toString("binary"));
|
|
134
|
+
if (shouldSaveAsJson) {
|
|
135
|
+
this.gtfsRtRedisRepository.hset(feedName + ".json", JSON.stringify(message.toJSON()));
|
|
136
|
+
}
|
|
137
|
+
}
|
|
130
138
|
}
|
|
131
139
|
exports.GenerateFilesTask = GenerateFilesTask;
|
|
132
140
|
//# sourceMappingURL=GenerateFilesTask.js.map
|
package/dist/integration-engine/vehicle-positions/workers/gtfs-rt/tasks/GenerateFilesTask.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GenerateFilesTask.js","sourceRoot":"","sources":["../../../../../../src/integration-engine/vehicle-positions/workers/gtfs-rt/tasks/GenerateFilesTask.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,uDAAkF;AAClF,yFAA8G;
|
|
1
|
+
{"version":3,"file":"GenerateFilesTask.js","sourceRoot":"","sources":["../../../../../../src/integration-engine/vehicle-positions/workers/gtfs-rt/tasks/GenerateFilesTask.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,uDAAkF;AAClF,wCAA2D;AAC3D,yFAA8G;AAE9G,mEAA2E;AAC3E,2EAAkF;AAClF,wFAAyF;AACzF,gFAA6E;AAC7E,gEAA6D;AAC7D,4CAA8C;AAC9C,oEAAiE;AAGjE,MAAa,iBAAkB,SAAQ,2BAAiB;IAUpD,YAAY,WAAmB;QAC3B,KAAK,CAAC,WAAW,CAAC,CAAC;QAVP,cAAS,GAAG,eAAe,CAAC;QAC5B,aAAQ,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC,aAAa;QAU/C,IAAI,CAAC,MAAM,GAAG,gBAAW,CAAC,OAAO,CAAU,oBAAc,CAAC,MAAM,CAAC,CAAC;QAElE,IAAI,CAAC,eAAe,GAAG,IAAI,iCAAe,EAAE,CAAC;QAC7C,IAAI,CAAC,qBAAqB,GAAG,IAAI,6CAAqB,EAAE,CAAC;QAEzD,MAAM,oBAAoB,GAAG,IAAI,iCAAoB,EAAE,CAAC;QACxD,MAAM,oBAAoB,GAAG,IAAI,uCAA0B,EAAE,CAAC;QAC9D,IAAI,CAAC,eAAe,GAAG,IAAI,iCAAe,CAAC,IAAI,CAAC,qBAAqB,EAAE,oBAAoB,EAAE,oBAAoB,CAAC,CAAC;QACnH,IAAI,CAAC,iBAAiB,GAAG,IAAI,qCAAiB,EAAE,CAAC;IACrD,CAAC;IAEe,OAAO;;YACnB,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,eAAe,CAAC,gBAAgB,EAAE,CAAC;YAC/D,MAAM,UAAU,GAAG,IAAI,CAAC,gBAAgB,EAA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,EAAE,OAAiC,EAAE,gBAAgB,GAAG,KAAK;QACvG,IAAI,+CAAY,CAAC,WAAW,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,IAAI,EAAE;YACnD,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,iCAAiC,QAAQ,EAAE,CAAC,CAAC;YACvF,OAAO;SACV;QAED,MAAM,MAAM,GAAG,+CAAY,CAAC,WAAW,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,MAAM,EAAY,CAAC;QAC3E,IAAI,CAAC,qBAAqB,CAAC,IAAI,CAAC,QAAQ,GAAG,KAAK,EAAE,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC;QAC7E,IAAI,gBAAgB,EAAE;YAClB,IAAI,CAAC,qBAAqB,CAAC,IAAI,CAAC,QAAQ,GAAG,OAAO,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;SACzF;IACL,CAAC;CACJ;AA5ID,8CA4IC"}
|
|
@@ -12,18 +12,7 @@ export declare class VehiclePositionsRouter {
|
|
|
12
12
|
constructor();
|
|
13
13
|
GetAll: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
14
14
|
GetOne: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
15
|
-
|
|
16
|
-
GetGtfsRtVehiclePositions: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
17
|
-
/**
|
|
18
|
-
* Debug endpoint
|
|
19
|
-
*/
|
|
20
|
-
GetGtfsRtTripUpdatesJSON: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
21
|
-
/**
|
|
22
|
-
* Debug endpoint
|
|
23
|
-
*/
|
|
24
|
-
GetGtfsRtVehiclePositionsJSON: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
25
|
-
GetGtfsRtAlerts: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
26
|
-
GetGtfsRtAlertsJSON: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
15
|
+
private GetGtfsRtFeed;
|
|
27
16
|
/**
|
|
28
17
|
* Initiates all routes. Should respond with correct data to a HTTP requests to all routes.
|
|
29
18
|
* @param {number|string} expire TTL for the caching middleware
|
|
@@ -21,10 +21,10 @@ exports.vehiclepositionsRouter = exports.VehiclePositionsRouter = void 0;
|
|
|
21
21
|
const shared_1 = require("../shared");
|
|
22
22
|
const constants_1 = require("../shared/constants");
|
|
23
23
|
const trace_provider_1 = require("@golemio/core/dist/monitoring/opentelemetry/trace-provider");
|
|
24
|
-
const Utils_1 = require("@golemio/core/dist/output-gateway/Utils");
|
|
25
|
-
const Validation_1 = require("@golemio/core/dist/output-gateway/Validation");
|
|
26
24
|
const config_1 = require("@golemio/core/dist/output-gateway/config");
|
|
27
25
|
const redis_1 = require("@golemio/core/dist/output-gateway/redis");
|
|
26
|
+
const Utils_1 = require("@golemio/core/dist/output-gateway/Utils");
|
|
27
|
+
const Validation_1 = require("@golemio/core/dist/output-gateway/Validation");
|
|
28
28
|
const express_1 = require("@golemio/core/dist/shared/express");
|
|
29
29
|
const express_validator_1 = require("@golemio/core/dist/shared/express-validator");
|
|
30
30
|
const golemio_errors_1 = require("@golemio/core/dist/shared/golemio-errors");
|
|
@@ -76,102 +76,23 @@ class VehiclePositionsRouter {
|
|
|
76
76
|
next(err);
|
|
77
77
|
}
|
|
78
78
|
});
|
|
79
|
-
this.
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
catch (err) {
|
|
91
|
-
next(err);
|
|
92
|
-
}
|
|
93
|
-
});
|
|
94
|
-
this.GetGtfsRtVehiclePositions = (req, res, next) => __awaiter(this, void 0, void 0, function* () {
|
|
95
|
-
try {
|
|
96
|
-
const redisClient = redis_1.RedisConnector.getConnection();
|
|
97
|
-
const redisHGetAsync = (0, util_1.promisify)(redisClient.hget).bind(redisClient);
|
|
98
|
-
const file = yield redisHGetAsync("files:gtfsRt", "vehicle_positions.pb");
|
|
99
|
-
if (!file) {
|
|
100
|
-
throw new golemio_errors_1.GeneralError("not_found", "VehiclePositionsRouter", undefined, 404);
|
|
79
|
+
this.GetGtfsRtFeed = (fileName, sendAsJson = false) => {
|
|
80
|
+
return (_req, res, next) => __awaiter(this, void 0, void 0, function* () {
|
|
81
|
+
try {
|
|
82
|
+
const redisClient = redis_1.RedisConnector.getConnection();
|
|
83
|
+
const redisHGetAsync = (0, util_1.promisify)(redisClient.hget).bind(redisClient);
|
|
84
|
+
const file = yield redisHGetAsync("files:gtfsRt", fileName);
|
|
85
|
+
if (!file) {
|
|
86
|
+
throw new golemio_errors_1.GeneralError("not_found", "VehiclePositionsRouter", undefined, 404);
|
|
87
|
+
}
|
|
88
|
+
res.setHeader("Content-Type", sendAsJson ? "application/json" : "application/octet-stream");
|
|
89
|
+
res.status(200).send(sendAsJson ? file : Buffer.from(file, "binary"));
|
|
101
90
|
}
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
}
|
|
105
|
-
catch (err) {
|
|
106
|
-
next(err);
|
|
107
|
-
}
|
|
108
|
-
});
|
|
109
|
-
/**
|
|
110
|
-
* Debug endpoint
|
|
111
|
-
*/
|
|
112
|
-
this.GetGtfsRtTripUpdatesJSON = (req, res, next) => __awaiter(this, void 0, void 0, function* () {
|
|
113
|
-
try {
|
|
114
|
-
const redisClient = redis_1.RedisConnector.getConnection();
|
|
115
|
-
const redisHGetAsync = (0, util_1.promisify)(redisClient.hget).bind(redisClient);
|
|
116
|
-
const file = yield redisHGetAsync("files:gtfsRt", "trip_updates.json");
|
|
117
|
-
if (!file) {
|
|
118
|
-
throw new golemio_errors_1.GeneralError("not_found", "VehiclePositionsRouter", undefined, 404);
|
|
91
|
+
catch (err) {
|
|
92
|
+
next(err);
|
|
119
93
|
}
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
}
|
|
123
|
-
catch (err) {
|
|
124
|
-
next(err);
|
|
125
|
-
}
|
|
126
|
-
});
|
|
127
|
-
/**
|
|
128
|
-
* Debug endpoint
|
|
129
|
-
*/
|
|
130
|
-
this.GetGtfsRtVehiclePositionsJSON = (req, res, next) => __awaiter(this, void 0, void 0, function* () {
|
|
131
|
-
try {
|
|
132
|
-
const redisClient = redis_1.RedisConnector.getConnection();
|
|
133
|
-
const redisHGetAsync = (0, util_1.promisify)(redisClient.hget).bind(redisClient);
|
|
134
|
-
const file = yield redisHGetAsync("files:gtfsRt", "vehicle_positions.json");
|
|
135
|
-
if (!file) {
|
|
136
|
-
throw new golemio_errors_1.GeneralError("not_found", "VehiclePositionsRouter", undefined, 404);
|
|
137
|
-
}
|
|
138
|
-
res.setHeader("Content-Type", "application/json");
|
|
139
|
-
res.status(200).send(file);
|
|
140
|
-
}
|
|
141
|
-
catch (err) {
|
|
142
|
-
next(err);
|
|
143
|
-
}
|
|
144
|
-
});
|
|
145
|
-
this.GetGtfsRtAlerts = (req, res, next) => __awaiter(this, void 0, void 0, function* () {
|
|
146
|
-
try {
|
|
147
|
-
const redisClient = redis_1.RedisConnector.getConnection();
|
|
148
|
-
const redisHGetAsync = (0, util_1.promisify)(redisClient.hget).bind(redisClient);
|
|
149
|
-
const file = yield redisHGetAsync("files:gtfsRt", "alerts.pb");
|
|
150
|
-
if (!file) {
|
|
151
|
-
throw new golemio_errors_1.GeneralError("not_found", "VehiclePositionsRouter", undefined, 404);
|
|
152
|
-
}
|
|
153
|
-
res.setHeader("Content-Type", "application/octet-stream");
|
|
154
|
-
res.status(200).send(Buffer.from(file, "binary"));
|
|
155
|
-
}
|
|
156
|
-
catch (err) {
|
|
157
|
-
next(err);
|
|
158
|
-
}
|
|
159
|
-
});
|
|
160
|
-
this.GetGtfsRtAlertsJSON = (req, res, next) => __awaiter(this, void 0, void 0, function* () {
|
|
161
|
-
try {
|
|
162
|
-
const redisClient = redis_1.RedisConnector.getConnection();
|
|
163
|
-
const redisHGetAsync = (0, util_1.promisify)(redisClient.hget).bind(redisClient);
|
|
164
|
-
const file = yield redisHGetAsync("files:gtfsRt", "alerts.json");
|
|
165
|
-
if (!file) {
|
|
166
|
-
throw new golemio_errors_1.GeneralError("not_found", "VehiclePositionsRouter", undefined, 404);
|
|
167
|
-
}
|
|
168
|
-
res.setHeader("Content-Type", "application/json");
|
|
169
|
-
res.status(200).send(file);
|
|
170
|
-
}
|
|
171
|
-
catch (err) {
|
|
172
|
-
next(err);
|
|
173
|
-
}
|
|
174
|
-
});
|
|
94
|
+
});
|
|
95
|
+
};
|
|
175
96
|
/**
|
|
176
97
|
* Initiates all routes. Should respond with correct data to a HTTP requests to all routes.
|
|
177
98
|
* @param {number|string} expire TTL for the caching middleware
|
|
@@ -194,12 +115,13 @@ class VehiclePositionsRouter {
|
|
|
194
115
|
(0, express_validator_1.query)("includeNotPublic").optional().isBoolean(),
|
|
195
116
|
(0, express_validator_1.query)("preferredTimezone").optional().isString(),
|
|
196
117
|
], Validation_1.checkErrors, (0, redis_1.useCacheMiddleware)(expire), this.GetOne);
|
|
197
|
-
this.router.get("/gtfsrt/trip_updates.pb", this.
|
|
198
|
-
this.router.get("/gtfsrt/
|
|
199
|
-
this.router.get("/gtfsrt/
|
|
200
|
-
this.router.get("/gtfsrt/vehicle_positions.json", this.
|
|
201
|
-
this.router.get("/gtfsrt/
|
|
202
|
-
this.router.get("/gtfsrt/alerts.pb", this.
|
|
118
|
+
this.router.get("/gtfsrt/trip_updates.pb", this.GetGtfsRtFeed("trip_updates.pb"));
|
|
119
|
+
this.router.get("/gtfsrt/trip_updates.json", this.GetGtfsRtFeed("trip_updates.json", true));
|
|
120
|
+
this.router.get("/gtfsrt/vehicle_positions.pb", this.GetGtfsRtFeed("vehicle_positions.pb"));
|
|
121
|
+
this.router.get("/gtfsrt/vehicle_positions.json", this.GetGtfsRtFeed("vehicle_positions.json", true));
|
|
122
|
+
this.router.get("/gtfsrt/pid_feed.pb", this.GetGtfsRtFeed("pid_feed.pb"));
|
|
123
|
+
this.router.get("/gtfsrt/alerts.pb", this.GetGtfsRtFeed("alerts.pb"));
|
|
124
|
+
this.router.get("/gtfsrt/alerts.json", this.GetGtfsRtFeed("alerts.json", true));
|
|
203
125
|
};
|
|
204
126
|
this.router = (0, express_1.Router)();
|
|
205
127
|
this.tripWithPositionRepository = data_access_1.repositories.tripWithLastPositionRepository;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VehiclePositionsRouter.js","sourceRoot":"","sources":["../../../src/output-gateway/vehicle-positions/VehiclePositionsRouter.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;;;;;;;;;;AAEH,sCAA8C;AAC9C,mDAAwD;AACxD,+FAA6F;AAC7F,mEAAiF;AACjF,6EAAkH;AAClH
|
|
1
|
+
{"version":3,"file":"VehiclePositionsRouter.js","sourceRoot":"","sources":["../../../src/output-gateway/vehicle-positions/VehiclePositionsRouter.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;;;;;;;;;;AAEH,sCAA8C;AAC9C,mDAAwD;AACxD,+FAA6F;AAC7F,qEAAkE;AAClE,mEAA6F;AAC7F,mEAAiF;AACjF,6EAAkH;AAClH,+DAA4G;AAC5G,mFAA2E;AAC3E,6EAAwE;AACxE,gGAA+D;AAC/D,+BAAiC;AACjC,+CAA6C;AAG7C,MAAa,sBAAsB;IAI/B;QAMO,WAAM,GAAG,CAAO,GAAY,EAAE,GAAa,EAAE,IAAkB,EAAE,EAAE;YACtE,MAAM,iBAAiB,GAAG,yBAAgB,CAAC,oBAAoB,CAAC,GAAG,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC;YAC7F,MAAM,IAAI,GAAG,IAAA,gCAAe,EAAC,+BAA+B,EAAE,eAAM,CAAC,SAAS,CAAC,CAAC;YAChF,IAAI;gBACA,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,0BAA0B,CAAC,MAAM,CAAC;oBACxD,aAAa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AAI,CAAC,MAAM,CAAC,GAAG,CAAC,qBAAqB,EAAE,IAAI,CAAC,aAAa,CAAC,aAAa,EAAE,IAAI,CAAC,CAAC,CAAC;QACpF,CAAC,CAAC;QA7GE,IAAI,CAAC,MAAM,GAAG,IAAA,gBAAM,GAAE,CAAC;QACvB,IAAI,CAAC,0BAA0B,GAAG,0BAAY,CAAC,8BAA8B,CAAC;QAC9E,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;IACjC,CAAC;CA2GJ;AAnHD,wDAmHC;AAED,MAAM,sBAAsB,GAAW,IAAI,sBAAsB,EAAE,CAAC,MAAM,CAAC;AAClE,wDAAsB"}
|
|
@@ -1018,6 +1018,11 @@ Worker mรก na starost stahovรกnรญ informacรญ o vozidlech (napล. dostupnost klim
|
|
|
1018
1018
|
- naฤtenรญ souboru z Redis cache
|
|
1019
1019
|
- HGET files:gtfsRt vehicle_positions.json
|
|
1020
1020
|
|
|
1021
|
+
#### _/vehiclepositions/gtfsrt/pid_feed.pb_
|
|
1022
|
+
|
|
1023
|
+
- naฤtenรญ souboru z Redis cache
|
|
1024
|
+
- HGET files:gtfsRt pid_feed.pb
|
|
1025
|
+
|
|
1021
1026
|
#### _/vehiclepositions/gtfsrt/alerts.pb_
|
|
1022
1027
|
|
|
1023
1028
|
- naฤtenรญ souboru z Redis cache
|
package/docs/openapi-output.yaml
CHANGED
|
@@ -19,14 +19,14 @@ servers:
|
|
|
19
19
|
description: Test (development) server
|
|
20
20
|
|
|
21
21
|
tags:
|
|
22
|
-
- name: ๐งพ GTFS
|
|
22
|
+
- name: ๐งพ GTFS Static
|
|
23
23
|
description: General Transit Feed Specification data about the city's public transportation schedules in form of an API.
|
|
24
24
|
|
|
25
|
-
- name:
|
|
26
|
-
description:
|
|
25
|
+
- name: ๐บ GTFS Realtime
|
|
26
|
+
description: Protobuf feeds of GTFS Realtime data. The feeds are updated every 30 seconds. Proto definitions can be found at [gtfs-realtime-OVapi.proto](https://gitlab.com/operator-ict/golemio/code/ovapi-gtfs-realtime-bindings/-/blob/master/src/gtfs-realtime-OVapi.proto).
|
|
27
27
|
|
|
28
|
-
- name:
|
|
29
|
-
description:
|
|
28
|
+
- name: ๐ค PID Realtime Positions
|
|
29
|
+
description: ๐ก Response comes with special header `X-Last-Modified` with timestamp value of the latest resource update. When you use it as `?updatedSince` query parameter you will obtain only newer data than this value.
|
|
30
30
|
|
|
31
31
|
- name: ๐ PID Departure Boards
|
|
32
32
|
description: ""
|
|
@@ -37,7 +37,7 @@ paths:
|
|
|
37
37
|
summary: GET GTFS Services
|
|
38
38
|
description: ""
|
|
39
39
|
tags:
|
|
40
|
-
- ๐งพ GTFS
|
|
40
|
+
- ๐งพ GTFS Static
|
|
41
41
|
parameters:
|
|
42
42
|
- name: date
|
|
43
43
|
in: query
|
|
@@ -82,7 +82,7 @@ paths:
|
|
|
82
82
|
summary: GET All GTFS Routes
|
|
83
83
|
description: ""
|
|
84
84
|
tags:
|
|
85
|
-
- ๐งพ GTFS
|
|
85
|
+
- ๐งพ GTFS Static
|
|
86
86
|
parameters:
|
|
87
87
|
- name: limit
|
|
88
88
|
in: query
|
|
@@ -119,7 +119,7 @@ paths:
|
|
|
119
119
|
summary: GET GTFS Route
|
|
120
120
|
description: ""
|
|
121
121
|
tags:
|
|
122
|
-
- ๐งพ GTFS
|
|
122
|
+
- ๐งพ GTFS Static
|
|
123
123
|
parameters:
|
|
124
124
|
- name: id
|
|
125
125
|
in: path
|
|
@@ -144,7 +144,7 @@ paths:
|
|
|
144
144
|
summary: GET All GTFS Trips
|
|
145
145
|
description: ""
|
|
146
146
|
tags:
|
|
147
|
-
- ๐งพ GTFS
|
|
147
|
+
- ๐งพ GTFS Static
|
|
148
148
|
parameters:
|
|
149
149
|
- name: stopId
|
|
150
150
|
in: query
|
|
@@ -195,7 +195,7 @@ paths:
|
|
|
195
195
|
summary: GET GTFS Trip
|
|
196
196
|
description: ""
|
|
197
197
|
tags:
|
|
198
|
-
- ๐งพ GTFS
|
|
198
|
+
- ๐งพ GTFS Static
|
|
199
199
|
parameters:
|
|
200
200
|
- name: id
|
|
201
201
|
in: path
|
|
@@ -289,7 +289,7 @@ paths:
|
|
|
289
289
|
summary: GET GTFS Shape
|
|
290
290
|
description: ""
|
|
291
291
|
tags:
|
|
292
|
-
- ๐งพ GTFS
|
|
292
|
+
- ๐งพ GTFS Static
|
|
293
293
|
parameters:
|
|
294
294
|
- name: id
|
|
295
295
|
in: path
|
|
@@ -327,7 +327,7 @@ paths:
|
|
|
327
327
|
summary: GET All GTFS Stops
|
|
328
328
|
description: ""
|
|
329
329
|
tags:
|
|
330
|
-
- ๐งพ GTFS
|
|
330
|
+
- ๐งพ GTFS Static
|
|
331
331
|
parameters:
|
|
332
332
|
- name: names
|
|
333
333
|
in: query
|
|
@@ -403,7 +403,7 @@ paths:
|
|
|
403
403
|
summary: GET GTFS Stop
|
|
404
404
|
description: ""
|
|
405
405
|
tags:
|
|
406
|
-
- ๐งพ GTFS
|
|
406
|
+
- ๐งพ GTFS Static
|
|
407
407
|
parameters:
|
|
408
408
|
- name: id
|
|
409
409
|
in: path
|
|
@@ -433,7 +433,7 @@ paths:
|
|
|
433
433
|
summary: GET GTFS Stop times
|
|
434
434
|
description: ""
|
|
435
435
|
tags:
|
|
436
|
-
- ๐งพ GTFS
|
|
436
|
+
- ๐งพ GTFS Static
|
|
437
437
|
parameters:
|
|
438
438
|
- name: id
|
|
439
439
|
in: path
|
|
@@ -506,7 +506,7 @@ paths:
|
|
|
506
506
|
summary: GET All Vehicle Positions
|
|
507
507
|
description: ""
|
|
508
508
|
tags:
|
|
509
|
-
- ๐ค
|
|
509
|
+
- ๐ค PID Realtime Positions
|
|
510
510
|
parameters:
|
|
511
511
|
- name: limit
|
|
512
512
|
in: query
|
|
@@ -608,7 +608,7 @@ paths:
|
|
|
608
608
|
summary: GET Vehicle Position
|
|
609
609
|
description: ""
|
|
610
610
|
tags:
|
|
611
|
-
- ๐ค
|
|
611
|
+
- ๐ค PID Realtime Positions
|
|
612
612
|
parameters:
|
|
613
613
|
- name: gtfsTripId
|
|
614
614
|
in: path
|
|
@@ -657,10 +657,10 @@ paths:
|
|
|
657
657
|
|
|
658
658
|
/vehiclepositions/gtfsrt/trip_updates.pb:
|
|
659
659
|
get:
|
|
660
|
-
summary: GET GTFS
|
|
660
|
+
summary: GET GTFS-RT Trip Updates Feed
|
|
661
661
|
description: ""
|
|
662
662
|
tags:
|
|
663
|
-
- ๐บ GTFS
|
|
663
|
+
- ๐บ GTFS Realtime
|
|
664
664
|
responses:
|
|
665
665
|
"200":
|
|
666
666
|
description: successful operation
|
|
@@ -676,10 +676,29 @@ paths:
|
|
|
676
676
|
|
|
677
677
|
/vehiclepositions/gtfsrt/vehicle_positions.pb:
|
|
678
678
|
get:
|
|
679
|
-
summary: GET GTFS
|
|
679
|
+
summary: GET GTFS-RT Vehicle Positions Feed
|
|
680
|
+
description: ""
|
|
681
|
+
tags:
|
|
682
|
+
- ๐บ GTFS Realtime
|
|
683
|
+
responses:
|
|
684
|
+
"200":
|
|
685
|
+
description: successful operation
|
|
686
|
+
content:
|
|
687
|
+
application/octet-stream:
|
|
688
|
+
schema:
|
|
689
|
+
type: string
|
|
690
|
+
format: binary
|
|
691
|
+
"401":
|
|
692
|
+
$ref: "#/components/responses/UnauthorizedError"
|
|
693
|
+
"404":
|
|
694
|
+
description: Not found
|
|
695
|
+
|
|
696
|
+
/vehiclepositions/gtfsrt/pid_feed.pb:
|
|
697
|
+
get:
|
|
698
|
+
summary: GET GTFS-RT PID Feed (trip updates and vehicle positions, combined)
|
|
680
699
|
description: ""
|
|
681
700
|
tags:
|
|
682
|
-
- ๐บ GTFS
|
|
701
|
+
- ๐บ GTFS Realtime
|
|
683
702
|
responses:
|
|
684
703
|
"200":
|
|
685
704
|
description: successful operation
|
|
@@ -695,10 +714,10 @@ paths:
|
|
|
695
714
|
|
|
696
715
|
/vehiclepositions/gtfsrt/alerts.pb:
|
|
697
716
|
get:
|
|
698
|
-
summary: GET GTFS
|
|
717
|
+
summary: GET GTFS-RT Service Alerts Feed
|
|
699
718
|
description: ""
|
|
700
719
|
tags:
|
|
701
|
-
- ๐บ GTFS
|
|
720
|
+
- ๐บ GTFS Realtime
|
|
702
721
|
responses:
|
|
703
722
|
"200":
|
|
704
723
|
description: successful operation
|
|
@@ -714,7 +733,7 @@ paths:
|
|
|
714
733
|
|
|
715
734
|
/pid/departureboards:
|
|
716
735
|
get:
|
|
717
|
-
summary: GET Departure
|
|
736
|
+
summary: GET Departure Boards
|
|
718
737
|
description: >-
|
|
719
738
|
You have to use query parameters `ids`, `cisIds`, `aswIds` or `names` in array format - eg. `ids[]=1&ids[]=3`.
|
|
720
739
|
**At least one of these IDs is required.** The maximum is 100 stops combined in one request.
|
|
@@ -1334,7 +1353,7 @@ components:
|
|
|
1334
1353
|
properties:
|
|
1335
1354
|
route_id:
|
|
1336
1355
|
type: string
|
|
1337
|
-
description: Identifier of the owner route in the GTFS
|
|
1356
|
+
description: Identifier of the owner route in the GTFS Static feed
|
|
1338
1357
|
example: "L381"
|
|
1339
1358
|
route_short_name:
|
|
1340
1359
|
type: string
|
|
@@ -1342,11 +1361,11 @@ components:
|
|
|
1342
1361
|
example: "381"
|
|
1343
1362
|
route_type:
|
|
1344
1363
|
type: number
|
|
1345
|
-
description: Identifier of the route type in the GTFS
|
|
1364
|
+
description: Identifier of the route type in the GTFS Static feed
|
|
1346
1365
|
example: 1
|
|
1347
1366
|
trip_id:
|
|
1348
1367
|
type: string
|
|
1349
|
-
description: Identifier of the trip in the GTFS
|
|
1368
|
+
description: Identifier of the trip in the GTFS Static feed
|
|
1350
1369
|
example: "381_51_180728"
|
|
1351
1370
|
trip_headsign:
|
|
1352
1371
|
type: string
|