@golemio/pid 2.13.6-dev.1310475463 → 2.13.6-dev.1313672574
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/02_pid_line_example_115.sql +148 -0
- package/db/migrations/postgresql/20240523123717-add-stop-name-and-gps-to-history-data.js +53 -0
- package/db/migrations/postgresql/20240529165139-gtfs-index-optimization.js +53 -0
- package/db/migrations/postgresql/sqls/20240523123717-add-stop-name-and-gps-to-history-data-down.sql +107 -0
- package/db/migrations/postgresql/sqls/20240523123717-add-stop-name-and-gps-to-history-data-up.sql +118 -0
- package/db/migrations/postgresql/sqls/20240529165139-gtfs-index-optimization-down.sql +2 -0
- package/db/migrations/postgresql/sqls/20240529165139-gtfs-index-optimization-up.sql +2 -0
- package/dist/helpers/PassengerTransferEnums.d.ts +20 -0
- package/dist/helpers/PassengerTransferEnums.js +26 -0
- package/dist/helpers/PassengerTransferEnums.js.map +1 -0
- package/dist/integration-engine/ropid-gtfs/workers/presets/tasks/CheckForNewDeparturesPresetsTask.js +0 -1
- package/dist/integration-engine/ropid-gtfs/workers/presets/tasks/CheckForNewDeparturesPresetsTask.js.map +1 -1
- package/dist/integration-engine/ropid-gtfs/workers/presets/tasks/DownloadDeparturesPresetsTask.js +0 -1
- package/dist/integration-engine/ropid-gtfs/workers/presets/tasks/DownloadDeparturesPresetsTask.js.map +1 -1
- package/dist/output-gateway/departure-boards/DepartureBoardsRouter.d.ts +1 -0
- package/dist/output-gateway/departure-boards/DepartureBoardsRouter.js +9 -6
- package/dist/output-gateway/departure-boards/DepartureBoardsRouter.js.map +1 -1
- package/dist/output-gateway/pid/PIDRouter.d.ts +1 -0
- package/dist/output-gateway/pid/PIDRouter.js +9 -9
- package/dist/output-gateway/pid/PIDRouter.js.map +1 -1
- package/dist/output-gateway/public/controllers/v1/PublicGtfsController.d.ts +6 -0
- package/dist/output-gateway/public/controllers/v1/PublicGtfsController.js +44 -0
- package/dist/output-gateway/public/controllers/v1/PublicGtfsController.js.map +1 -0
- package/dist/output-gateway/public/controllers/v1/interfaces/PublicParamsInterfaces.d.ts +4 -0
- package/dist/output-gateway/public/domain/ITripScopeHandler.d.ts +7 -0
- package/dist/output-gateway/public/domain/{ITripScopeHandlerFactory.js → ITripScopeHandler.js} +1 -1
- package/dist/output-gateway/public/domain/ITripScopeHandler.js.map +1 -0
- package/dist/output-gateway/public/domain/PublicApiGtfsTripLookupInterfaces.d.ts +35 -0
- package/dist/output-gateway/public/domain/PublicApiGtfsTripLookupInterfaces.js +3 -0
- package/dist/output-gateway/public/domain/PublicApiGtfsTripLookupInterfaces.js.map +1 -0
- package/dist/output-gateway/public/ioc/Di.js +34 -8
- package/dist/output-gateway/public/ioc/Di.js.map +1 -1
- package/dist/output-gateway/public/ioc/OgModuleToken.d.ts +10 -0
- package/dist/output-gateway/public/ioc/OgModuleToken.js +14 -0
- package/dist/output-gateway/public/ioc/OgModuleToken.js.map +1 -1
- package/dist/output-gateway/public/routers/v1/PublicDeparturesRouter.d.ts +2 -1
- package/dist/output-gateway/public/routers/v1/PublicDeparturesRouter.js +8 -4
- package/dist/output-gateway/public/routers/v1/PublicDeparturesRouter.js.map +1 -1
- package/dist/output-gateway/public/routers/v1/PublicGtfsRouter.d.ts +11 -0
- package/dist/output-gateway/public/routers/v1/PublicGtfsRouter.js +27 -0
- package/dist/output-gateway/public/routers/v1/PublicGtfsRouter.js.map +1 -0
- package/dist/output-gateway/public/routers/v1/PublicVehiclePositionsRouter.d.ts +2 -1
- package/dist/output-gateway/public/routers/v1/PublicVehiclePositionsRouter.js +9 -3
- package/dist/output-gateway/public/routers/v1/PublicVehiclePositionsRouter.js.map +1 -1
- package/dist/output-gateway/public/service/facade/DetailedTripFacade.d.ts +2 -2
- package/dist/output-gateway/public/service/facade/DetailedTripFacade.js.map +1 -1
- package/dist/output-gateway/public/service/facade/GtfsTripLookupFacade.d.ts +10 -0
- package/dist/output-gateway/public/service/facade/GtfsTripLookupFacade.js +50 -0
- package/dist/output-gateway/public/service/facade/GtfsTripLookupFacade.js.map +1 -0
- package/dist/output-gateway/public/service/helpers/gtfs-trip-scope/GtfsTripScopeHandlerFactory.d.ts +11 -0
- package/dist/output-gateway/public/service/helpers/gtfs-trip-scope/GtfsTripScopeHandlerFactory.js +43 -0
- package/dist/output-gateway/public/service/helpers/gtfs-trip-scope/GtfsTripScopeHandlerFactory.js.map +1 -0
- package/dist/output-gateway/public/service/helpers/gtfs-trip-scope/strategy/AbstractGtfsTripScopeHandler.d.ts +6 -0
- package/dist/output-gateway/public/service/helpers/gtfs-trip-scope/strategy/AbstractGtfsTripScopeHandler.js +7 -0
- package/dist/output-gateway/public/service/helpers/gtfs-trip-scope/strategy/AbstractGtfsTripScopeHandler.js.map +1 -0
- package/dist/output-gateway/public/service/helpers/gtfs-trip-scope/strategy/InfoTripScopeHandler.d.ts +9 -0
- package/dist/output-gateway/public/service/helpers/gtfs-trip-scope/strategy/InfoTripScopeHandler.js +35 -0
- package/dist/output-gateway/public/service/helpers/gtfs-trip-scope/strategy/InfoTripScopeHandler.js.map +1 -0
- package/dist/output-gateway/public/service/helpers/gtfs-trip-scope/strategy/ShapesTripScopeHandler.d.ts +9 -0
- package/dist/output-gateway/public/service/helpers/gtfs-trip-scope/strategy/ShapesTripScopeHandler.js +36 -0
- package/dist/output-gateway/public/service/helpers/gtfs-trip-scope/strategy/ShapesTripScopeHandler.js.map +1 -0
- package/dist/output-gateway/public/service/helpers/gtfs-trip-scope/strategy/StopTimesTripScopeHandler.d.ts +9 -0
- package/dist/output-gateway/public/service/helpers/gtfs-trip-scope/strategy/StopTimesTripScopeHandler.js +38 -0
- package/dist/output-gateway/public/service/helpers/gtfs-trip-scope/strategy/StopTimesTripScopeHandler.js.map +1 -0
- package/dist/output-gateway/public/service/helpers/gtfs-trip-scope/strategy/VehicleDescriptorTripScopeHandler.d.ts +9 -0
- package/dist/output-gateway/public/service/helpers/gtfs-trip-scope/strategy/VehicleDescriptorTripScopeHandler.js +35 -0
- package/dist/output-gateway/public/service/helpers/gtfs-trip-scope/strategy/VehicleDescriptorTripScopeHandler.js.map +1 -0
- package/dist/output-gateway/public/service/helpers/trip-scope/TripScopeHandlerFactory.d.ts +4 -5
- package/dist/output-gateway/public/service/helpers/trip-scope/TripScopeHandlerFactory.js +6 -6
- package/dist/output-gateway/public/service/helpers/trip-scope/TripScopeHandlerFactory.js.map +1 -1
- package/dist/output-gateway/public/service/helpers/trip-scope/strategy/{AbstractTripScopeHandler.d.ts → AbstractDetailedTripScopeHandler.d.ts} +2 -1
- package/dist/output-gateway/public/service/helpers/trip-scope/strategy/AbstractDetailedTripScopeHandler.js +7 -0
- package/dist/output-gateway/public/service/helpers/trip-scope/strategy/AbstractDetailedTripScopeHandler.js.map +1 -0
- package/dist/output-gateway/public/service/helpers/trip-scope/strategy/InfoTripScopeHandler.d.ts +2 -2
- package/dist/output-gateway/public/service/helpers/trip-scope/strategy/InfoTripScopeHandler.js +2 -2
- package/dist/output-gateway/public/service/helpers/trip-scope/strategy/InfoTripScopeHandler.js.map +1 -1
- package/dist/output-gateway/public/service/helpers/trip-scope/strategy/ShapesTripScopeHandler.d.ts +2 -2
- package/dist/output-gateway/public/service/helpers/trip-scope/strategy/ShapesTripScopeHandler.js +2 -2
- package/dist/output-gateway/public/service/helpers/trip-scope/strategy/ShapesTripScopeHandler.js.map +1 -1
- package/dist/output-gateway/public/service/helpers/trip-scope/strategy/StopTimesTripScopeHandler.d.ts +2 -2
- package/dist/output-gateway/public/service/helpers/trip-scope/strategy/StopTimesTripScopeHandler.js +2 -2
- package/dist/output-gateway/public/service/helpers/trip-scope/strategy/StopTimesTripScopeHandler.js.map +1 -1
- package/dist/output-gateway/public/service/helpers/trip-scope/strategy/VehicleDescriptorTripScopeHandler.d.ts +2 -2
- package/dist/output-gateway/public/service/helpers/trip-scope/strategy/VehicleDescriptorTripScopeHandler.js +2 -2
- package/dist/output-gateway/public/service/helpers/trip-scope/strategy/VehicleDescriptorTripScopeHandler.js.map +1 -1
- package/dist/output-gateway/public/service/transformations/gtfs-trip-scopes/PublicGtfsTripInfoTransformation.d.ts +15 -0
- package/dist/output-gateway/public/service/transformations/gtfs-trip-scopes/PublicGtfsTripInfoTransformation.js +35 -0
- package/dist/output-gateway/public/service/transformations/gtfs-trip-scopes/PublicGtfsTripInfoTransformation.js.map +1 -0
- package/dist/output-gateway/public/service/transformations/gtfs-trip-scopes/PublicGtfsTripShapesTransformation.d.ts +7 -0
- package/dist/output-gateway/public/service/transformations/gtfs-trip-scopes/PublicGtfsTripShapesTransformation.js +30 -0
- package/dist/output-gateway/public/service/transformations/gtfs-trip-scopes/PublicGtfsTripShapesTransformation.js.map +1 -0
- package/dist/output-gateway/public/service/transformations/gtfs-trip-scopes/PublicGtfsVehicleDescriptorTransformation.d.ts +10 -0
- package/dist/output-gateway/public/service/transformations/gtfs-trip-scopes/PublicGtfsVehicleDescriptorTransformation.js +33 -0
- package/dist/output-gateway/public/service/transformations/gtfs-trip-scopes/PublicGtfsVehicleDescriptorTransformation.js.map +1 -0
- package/dist/output-gateway/public/service/transformations/gtfs-trip-scopes/PublicTripStopTimesTransformation.d.ts +8 -0
- package/dist/output-gateway/public/service/transformations/gtfs-trip-scopes/PublicTripStopTimesTransformation.js +46 -0
- package/dist/output-gateway/public/service/transformations/gtfs-trip-scopes/PublicTripStopTimesTransformation.js.map +1 -0
- package/dist/output-gateway/ropid-gtfs/GTFSRouter.d.ts +2 -1
- package/dist/output-gateway/ropid-gtfs/GTFSRouter.js +30 -27
- package/dist/output-gateway/ropid-gtfs/GTFSRouter.js.map +1 -1
- package/dist/output-gateway/ropid-gtfs/data-access/GtfsTripScheduleRepository.d.ts +8 -0
- package/dist/output-gateway/ropid-gtfs/data-access/GtfsTripScheduleRepository.js +22 -0
- package/dist/output-gateway/ropid-gtfs/data-access/GtfsTripScheduleRepository.js.map +1 -0
- package/dist/output-gateway/ropid-gtfs/models/GTFSStopTimesModel.js +2 -1
- package/dist/output-gateway/ropid-gtfs/models/GTFSStopTimesModel.js.map +1 -1
- package/dist/output-gateway/ropid-gtfs/models/GTFSTripsModel.d.ts +9 -1
- package/dist/output-gateway/ropid-gtfs/models/GTFSTripsModel.js +93 -2
- package/dist/output-gateway/ropid-gtfs/models/GTFSTripsModel.js.map +1 -1
- package/dist/output-gateway/vehicle-positions/VehiclePositionsRouter.d.ts +1 -0
- package/dist/output-gateway/vehicle-positions/VehiclePositionsRouter.js +27 -9
- package/dist/output-gateway/vehicle-positions/VehiclePositionsRouter.js.map +1 -1
- package/dist/schema-definitions/ropid-gtfs/RopidGTFSPrecomputed.js +8 -2
- package/dist/schema-definitions/ropid-gtfs/RopidGTFSPrecomputed.js.map +1 -1
- package/dist/schema-definitions/ropid-gtfs/RopidGTFSRunNumbers.d.ts +1 -1
- package/dist/schema-definitions/ropid-gtfs/interfaces/ITripWithOptionalAssociationsDto.d.ts +19 -0
- package/dist/schema-definitions/ropid-gtfs/interfaces/ITripWithOptionalAssociationsDto.js +3 -0
- package/dist/schema-definitions/ropid-gtfs/interfaces/ITripWithOptionalAssociationsDto.js.map +1 -0
- package/docs/implementation_documentation.md +10 -1
- package/docs/openapi-output.yaml +151 -13
- package/package.json +2 -2
- package/dist/output-gateway/public/domain/ITripScopeHandlerFactory.d.ts +0 -5
- package/dist/output-gateway/public/domain/ITripScopeHandlerFactory.js.map +0 -1
- package/dist/output-gateway/public/service/helpers/trip-scope/strategy/AbstractTripScopeHandler.js +0 -7
- package/dist/output-gateway/public/service/helpers/trip-scope/strategy/AbstractTripScopeHandler.js.map +0 -1
|
@@ -19,8 +19,12 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
19
19
|
}
|
|
20
20
|
return t;
|
|
21
21
|
};
|
|
22
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
23
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
24
|
+
};
|
|
22
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23
26
|
exports.GTFSTripsModel = void 0;
|
|
27
|
+
const PassengerTransferEnums_1 = require("../../../helpers/PassengerTransferEnums");
|
|
24
28
|
const const_1 = require("../../../schema-definitions/const");
|
|
25
29
|
const ropid_gtfs_1 = require("../../../schema-definitions/ropid-gtfs");
|
|
26
30
|
const TripDto_1 = require("../../../schema-definitions/ropid-gtfs/models/TripDto");
|
|
@@ -28,6 +32,8 @@ const Geo_1 = require("@golemio/core/dist/output-gateway/Geo");
|
|
|
28
32
|
const ioc_1 = require("@golemio/core/dist/output-gateway/ioc/");
|
|
29
33
|
const models_1 = require("@golemio/core/dist/output-gateway/models");
|
|
30
34
|
const golemio_errors_1 = require("@golemio/core/dist/shared/golemio-errors");
|
|
35
|
+
const sequelize_1 = __importDefault(require("@golemio/core/dist/shared/sequelize"));
|
|
36
|
+
const GtfsTripScheduleRepository_1 = require("../data-access/GtfsTripScheduleRepository");
|
|
31
37
|
class GTFSTripsModel extends models_1.SequelizeModel {
|
|
32
38
|
constructor() {
|
|
33
39
|
super(ropid_gtfs_1.RopidGTFS.trips.name, ropid_gtfs_1.RopidGTFS.trips.pgTableName, TripDto_1.TripDto.attributeModel, {
|
|
@@ -61,6 +67,14 @@ class GTFSTripsModel extends models_1.SequelizeModel {
|
|
|
61
67
|
otherKey: "stop_id",
|
|
62
68
|
through: models.GTFSStopTimesModel.sequelizeModel,
|
|
63
69
|
});
|
|
70
|
+
this.sequelizeModel.hasOne(this.tripScheduleRepository.sequelizeModel, {
|
|
71
|
+
as: "schedule",
|
|
72
|
+
foreignKey: "trip_id",
|
|
73
|
+
sourceKey: "trip_id",
|
|
74
|
+
scope: {
|
|
75
|
+
[sequelize_1.default.Op.and]: [sequelize_1.default.literal(`start_timestamp::date = CURRENT_DATE`)],
|
|
76
|
+
},
|
|
77
|
+
});
|
|
64
78
|
};
|
|
65
79
|
/** Retrieves all gtfs trips
|
|
66
80
|
* @param {object} options Options object with params
|
|
@@ -129,6 +143,18 @@ class GTFSTripsModel extends models_1.SequelizeModel {
|
|
|
129
143
|
}
|
|
130
144
|
return trip ? this.ConvertItem(trip, { route, stops, shapes, stopTimes }) : null;
|
|
131
145
|
});
|
|
146
|
+
this.getOneForPublicGtfsLookup = (id, options = {}) => __awaiter(this, void 0, void 0, function* () {
|
|
147
|
+
try {
|
|
148
|
+
const tripEntity = yield this.sequelizeModel.findByPk(id, {
|
|
149
|
+
attributes: ["trip_id", "shape_id", "trip_headsign", "wheelchair_accessible"],
|
|
150
|
+
include: this.getInclusionsForPublicGtfsLookup(options),
|
|
151
|
+
});
|
|
152
|
+
return tripEntity ? tripEntity.toJSON() : null;
|
|
153
|
+
}
|
|
154
|
+
catch (err) {
|
|
155
|
+
throw new golemio_errors_1.GeneralError("Cannot get GTFS trip from database", this.constructor.name, err, 500);
|
|
156
|
+
}
|
|
157
|
+
});
|
|
132
158
|
/** Prepare ORM query with selected params
|
|
133
159
|
* @param {object} options Options object with params
|
|
134
160
|
* @param {boolean} [options.route] Enhance response with route data
|
|
@@ -146,12 +172,17 @@ class GTFSTripsModel extends models_1.SequelizeModel {
|
|
|
146
172
|
if (stops && stopTimes) {
|
|
147
173
|
include.push({
|
|
148
174
|
as: "stop_times",
|
|
175
|
+
attributes: {
|
|
176
|
+
exclude: ["arrival_time_seconds", "departure_time_seconds", "timepoint"],
|
|
177
|
+
},
|
|
149
178
|
include: [
|
|
150
179
|
{
|
|
151
180
|
as: "stop",
|
|
152
181
|
model: this.dbConnector.getConnection().models[ropid_gtfs_1.RopidGTFS.stops.pgTableName],
|
|
153
182
|
},
|
|
154
183
|
],
|
|
184
|
+
order: [["stop_sequence", "ASC"]],
|
|
185
|
+
separate: true,
|
|
155
186
|
model: this.dbConnector.getConnection().models[ropid_gtfs_1.RopidGTFS.stop_times.pgTableName],
|
|
156
187
|
});
|
|
157
188
|
// Only stops or only stop times selected to include
|
|
@@ -166,6 +197,11 @@ class GTFSTripsModel extends models_1.SequelizeModel {
|
|
|
166
197
|
stopTimes &&
|
|
167
198
|
include.push({
|
|
168
199
|
as: "stop_times",
|
|
200
|
+
attributes: {
|
|
201
|
+
exclude: ["arrival_time_seconds", "departure_time_seconds", "timepoint"],
|
|
202
|
+
},
|
|
203
|
+
order: [["stop_sequence", "ASC"]],
|
|
204
|
+
separate: true,
|
|
169
205
|
model: this.dbConnector.getConnection().models[ropid_gtfs_1.RopidGTFS.stop_times.pgTableName],
|
|
170
206
|
});
|
|
171
207
|
}
|
|
@@ -189,6 +225,55 @@ class GTFSTripsModel extends models_1.SequelizeModel {
|
|
|
189
225
|
});
|
|
190
226
|
return include;
|
|
191
227
|
};
|
|
228
|
+
this.getInclusionsForPublicGtfsLookup = (options) => {
|
|
229
|
+
const { shouldIncludeStopTimes, shouldIncludeShapes } = options;
|
|
230
|
+
const include = [];
|
|
231
|
+
include.push({
|
|
232
|
+
as: "route",
|
|
233
|
+
attributes: ["route_id", "route_short_name", "route_type"],
|
|
234
|
+
model: this.dbConnector.getConnection().models[ropid_gtfs_1.RopidGTFS.routes.pgTableName],
|
|
235
|
+
});
|
|
236
|
+
include.push({
|
|
237
|
+
as: "schedule",
|
|
238
|
+
attributes: ["run_number"],
|
|
239
|
+
model: this.dbConnector.getConnection().models[this.tripScheduleRepository.tableName],
|
|
240
|
+
});
|
|
241
|
+
if (shouldIncludeStopTimes) {
|
|
242
|
+
include.push({
|
|
243
|
+
as: "stop_times",
|
|
244
|
+
attributes: [
|
|
245
|
+
"stop_sequence",
|
|
246
|
+
"shape_dist_traveled",
|
|
247
|
+
[sequelize_1.default.literal(`EXTRACT(EPOCH FROM "arrival_time"::INTERVAL)::int`), "arrival_time_seconds"],
|
|
248
|
+
[sequelize_1.default.literal(`EXTRACT(EPOCH FROM "departure_time"::INTERVAL)::int`), "departure_time_seconds"],
|
|
249
|
+
],
|
|
250
|
+
include: [
|
|
251
|
+
{
|
|
252
|
+
as: "stop",
|
|
253
|
+
attributes: ["stop_name", "zone_id", "stop_lon", "stop_lat", "wheelchair_boarding"],
|
|
254
|
+
required: true,
|
|
255
|
+
model: this.dbConnector.getConnection().models[ropid_gtfs_1.RopidGTFS.stops.pgTableName],
|
|
256
|
+
},
|
|
257
|
+
],
|
|
258
|
+
where: {
|
|
259
|
+
// exclude no stop waypoints
|
|
260
|
+
drop_off_type: { [sequelize_1.default.Op.ne]: PassengerTransferEnums_1.GtfsStopTimeDropOffType.NoDropOff.toString() },
|
|
261
|
+
pickup_type: { [sequelize_1.default.Op.ne]: PassengerTransferEnums_1.GtfsStopTimePickupType.NoPickup.toString() },
|
|
262
|
+
},
|
|
263
|
+
order: [["stop_sequence", "ASC"]],
|
|
264
|
+
separate: true,
|
|
265
|
+
model: this.dbConnector.getConnection().models[ropid_gtfs_1.RopidGTFS.stop_times.pgTableName],
|
|
266
|
+
});
|
|
267
|
+
}
|
|
268
|
+
if (shouldIncludeShapes) {
|
|
269
|
+
include.push({
|
|
270
|
+
as: "shapes",
|
|
271
|
+
attributes: ["shape_dist_traveled", "shape_pt_lon", "shape_pt_lat"],
|
|
272
|
+
model: this.dbConnector.getConnection().models[ropid_gtfs_1.RopidGTFS.shapes.pgTableName],
|
|
273
|
+
});
|
|
274
|
+
}
|
|
275
|
+
return include;
|
|
276
|
+
};
|
|
192
277
|
/**
|
|
193
278
|
* Convert a single db result to proper output format with all its included sub-elements
|
|
194
279
|
* @param {object} trip Trip object
|
|
@@ -204,7 +289,8 @@ class GTFSTripsModel extends models_1.SequelizeModel {
|
|
|
204
289
|
})), (options.stops &&
|
|
205
290
|
options.stopTimes && {
|
|
206
291
|
stop_times: stopTimesItems.map((stopTime) => {
|
|
207
|
-
|
|
292
|
+
// exclude computed fields from stop time
|
|
293
|
+
const { arrival_time_seconds, departure_time_seconds } = stopTime, convertedStopTime = __rest(stopTime, ["arrival_time_seconds", "departure_time_seconds"]);
|
|
208
294
|
convertedStopTime.stop = this.BuildResponse(stopTime.stop, "stop_lon", "stop_lat");
|
|
209
295
|
return convertedStopTime;
|
|
210
296
|
}),
|
|
@@ -213,7 +299,11 @@ class GTFSTripsModel extends models_1.SequelizeModel {
|
|
|
213
299
|
stops: stopItems.map((stop) => this.BuildResponse(stop, "stop_lon", "stop_lat")),
|
|
214
300
|
})), (!options.stops &&
|
|
215
301
|
options.stopTimes && {
|
|
216
|
-
stop_times: stopTimesItems
|
|
302
|
+
stop_times: stopTimesItems.map((stopTime) => {
|
|
303
|
+
// exclude computed fields from stop time
|
|
304
|
+
const { arrival_time_seconds, departure_time_seconds } = stopTime, convertedStopTime = __rest(stopTime, ["arrival_time_seconds", "departure_time_seconds"]);
|
|
305
|
+
return convertedStopTime;
|
|
306
|
+
}),
|
|
217
307
|
})), (options.shapes && {
|
|
218
308
|
shapes: shapeItems.map((shape) => this.BuildResponse(shape, "shape_pt_lon", "shape_pt_lat")),
|
|
219
309
|
}));
|
|
@@ -225,6 +315,7 @@ class GTFSTripsModel extends models_1.SequelizeModel {
|
|
|
225
315
|
return (0, Geo_1.buildGeojsonFeature)(responseObject, longLoc, latLoc, true);
|
|
226
316
|
};
|
|
227
317
|
this.dbConnector = ioc_1.OutputGatewayContainer.resolve(ioc_1.ContainerToken.PostgresDatabase);
|
|
318
|
+
this.tripScheduleRepository = new GtfsTripScheduleRepository_1.GtfsTripScheduleRepository();
|
|
228
319
|
}
|
|
229
320
|
}
|
|
230
321
|
exports.GTFSTripsModel = GTFSTripsModel;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GTFSTripsModel.js","sourceRoot":"","sources":["../../../../src/output-gateway/ropid-gtfs/models/GTFSTripsModel.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"GTFSTripsModel.js","sourceRoot":"","sources":["../../../../src/output-gateway/ropid-gtfs/models/GTFSTripsModel.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oFAAkG;AAClG,6DAAuC;AACvC,uEAA4C;AAE5C,mFAAyD;AAEzD,+DAA4E;AAC5E,gEAAgG;AAChG,qEAA0E;AAC1E,6EAAwE;AACxE,oFAA6E;AAC7E,0FAAuF;AAEvF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K,EAAE,cAAc,EAAE,cAAc,CAAC,CAAC;aACpG,CAAC,EACJ;QACN,CAAC,CAAC;QAEF;;WAEG;QACO,kBAAa,GAAG,CAAC,cAAmB,EAAE,OAAe,EAAE,MAAc,EAAE,EAAE;YAC/E,OAAO,IAAA,yBAAmB,EAAC,cAAc,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC;QACtE,CAAC,CAAC;QA1VE,IAAI,CAAC,WAAW,GAAG,4BAAsB,CAAC,OAAO,CAAqB,oBAAc,CAAC,gBAAgB,CAAC,CAAC;QACvG,IAAI,CAAC,sBAAsB,GAAG,IAAI,uDAA0B,EAAE,CAAC;IACnE,CAAC;CAyVJ;AAnWD,wCAmWC"}
|
|
@@ -8,6 +8,7 @@ import { NextFunction, Request, Response, Router } from "@golemio/core/dist/shar
|
|
|
8
8
|
import { ITripWithPositionRepository } from "./data-access/interfaces/ITripWithPositionRepository";
|
|
9
9
|
export declare class VehiclePositionsRouter {
|
|
10
10
|
router: Router;
|
|
11
|
+
private cacheHeaderMiddleware;
|
|
11
12
|
protected tripWithPositionRepository: ITripWithPositionRepository;
|
|
12
13
|
constructor();
|
|
13
14
|
GetAll: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
@@ -21,9 +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 redis_1 = require("@golemio/core/dist/output-gateway/redis");
|
|
25
24
|
const Utils_1 = require("@golemio/core/dist/output-gateway/Utils");
|
|
26
25
|
const Validation_1 = require("@golemio/core/dist/output-gateway/Validation");
|
|
26
|
+
const ioc_1 = require("@golemio/core/dist/output-gateway/ioc");
|
|
27
|
+
const redis_1 = require("@golemio/core/dist/output-gateway/redis");
|
|
27
28
|
const express_1 = require("@golemio/core/dist/shared/express");
|
|
28
29
|
const express_validator_1 = require("@golemio/core/dist/shared/express-validator");
|
|
29
30
|
const golemio_errors_1 = require("@golemio/core/dist/shared/golemio-errors");
|
|
@@ -96,7 +97,8 @@ class VehiclePositionsRouter {
|
|
|
96
97
|
* Initiates all routes. Should respond with correct data to a HTTP requests to all routes.
|
|
97
98
|
* @param {number|string} expire TTL for the caching middleware
|
|
98
99
|
*/
|
|
99
|
-
this.initRoutes = (
|
|
100
|
+
this.initRoutes = () => {
|
|
101
|
+
//#region PID Vehicle Positions
|
|
100
102
|
this.router.get("/", [
|
|
101
103
|
(0, express_validator_1.query)("cisTripNumber").optional().isNumeric().not().isArray(),
|
|
102
104
|
(0, express_validator_1.query)("routeId").optional().not().isArray(),
|
|
@@ -106,22 +108,38 @@ class VehiclePositionsRouter {
|
|
|
106
108
|
(0, express_validator_1.query)("includeNotPublic").optional().isBoolean().not().isArray(),
|
|
107
109
|
(0, express_validator_1.query)("updatedSince").optional().isISO8601().not().isArray(),
|
|
108
110
|
(0, express_validator_1.query)("preferredTimezone").optional().isIn(constants_1.ValidationArrays.preferredTimezone).not().isArray(),
|
|
109
|
-
], Validation_1.pagination, Validation_1.checkErrors, (0, Validation_1.paginationLimitMiddleware)("VehiclePositionsRouter"),
|
|
111
|
+
], Validation_1.pagination, Validation_1.checkErrors, (0, Validation_1.paginationLimitMiddleware)("VehiclePositionsRouter"),
|
|
112
|
+
// max-age 5 seconds, stale-while-revalidate 5 seconds
|
|
113
|
+
this.cacheHeaderMiddleware.getMiddleware(5, 5), this.GetAll);
|
|
110
114
|
this.router.get("/:id", [
|
|
111
115
|
(0, express_validator_1.param)("id").exists(),
|
|
112
116
|
(0, express_validator_1.query)("includeNotTracking").optional().isBoolean().not().isArray(),
|
|
113
117
|
(0, express_validator_1.query)("includePositions").optional().isBoolean().not().isArray(),
|
|
114
118
|
(0, express_validator_1.query)("includeNotPublic").optional().isBoolean().not().isArray(),
|
|
115
119
|
(0, express_validator_1.query)("preferredTimezone").optional().not().isEmpty({ ignore_whitespace: true }),
|
|
116
|
-
], Validation_1.checkErrors,
|
|
117
|
-
|
|
118
|
-
this.
|
|
119
|
-
|
|
120
|
-
|
|
120
|
+
], Validation_1.checkErrors,
|
|
121
|
+
// max-age 5 seconds, stale-while-revalidate 5 seconds
|
|
122
|
+
this.cacheHeaderMiddleware.getMiddleware(5, 5), this.GetOne);
|
|
123
|
+
//#endregion
|
|
124
|
+
//#region GTFS Realtime
|
|
125
|
+
this.router.get("/gtfsrt/trip_updates.pb",
|
|
126
|
+
// no-cache
|
|
127
|
+
this.cacheHeaderMiddleware.getNoCacheMiddleware(), this.GetGtfsRtFeed("trip_updates.pb"));
|
|
128
|
+
this.router.get("/gtfsrt/vehicle_positions.pb",
|
|
129
|
+
// no-cache
|
|
130
|
+
this.cacheHeaderMiddleware.getNoCacheMiddleware(), this.GetGtfsRtFeed("vehicle_positions.pb"));
|
|
131
|
+
this.router.get("/gtfsrt/pid_feed.pb",
|
|
132
|
+
// no-cache
|
|
133
|
+
this.cacheHeaderMiddleware.getNoCacheMiddleware(), this.GetGtfsRtFeed("pid_feed.pb"));
|
|
134
|
+
this.router.get("/gtfsrt/alerts.pb",
|
|
135
|
+
// no-cache
|
|
136
|
+
this.cacheHeaderMiddleware.getNoCacheMiddleware(), this.GetGtfsRtFeed("alerts.pb"));
|
|
137
|
+
//#endregion
|
|
121
138
|
};
|
|
122
139
|
this.router = (0, express_1.Router)();
|
|
140
|
+
this.cacheHeaderMiddleware = ioc_1.OutputGatewayContainer.resolve(ioc_1.ContainerToken.CacheHeaderMiddleware);
|
|
123
141
|
this.tripWithPositionRepository = data_access_1.repositories.tripWithLastPositionRepository;
|
|
124
|
-
this.initRoutes(
|
|
142
|
+
this.initRoutes();
|
|
125
143
|
}
|
|
126
144
|
}
|
|
127
145
|
exports.VehiclePositionsRouter = VehiclePositionsRouter;
|
|
@@ -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;
|
|
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;AAE7F,mEAAiF;AACjF,6EAAkH;AAClH,+DAA+F;AAC/F,mEAAyE;AACzE,+DAA4G;AAC5G,mFAA2E;AAC3E,6EAAwE;AACxE,gGAA+D;AAC/D,+BAAiC;AACjC,+CAA6C;AAG7C,MAAa,sBAAsB;IAK/B;QAOO,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,CAAC,CAAC;YAC9D,IAAI;gBACA,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,0BAA0B,CAAC,MAAM,CAAC;oBACxD,aAAa,EAAE,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,aAAa,CAAC,IAAI,SAAS;oBAC3D,kBAAkB,EAAE,IAAA,8BAAsB,EAAC,GAAG,CAAC,KAAK,CAAC,kBAA4B,CAAC;oBAClF,gBAAgB,EAAE,IAAA,8BAAsB,EAAC,GAAG,CAAC,KAAK,CAAC,gBAA0B,CAAC;oBAC9E,gBAAgB,EAAE,IAAA,8BAAsB,EAAC,GAAG,CAAC,KAAK,CAAC,gBAA0B,CAAC;oBAC9E,KAAK,EAAE,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,SAAS;oBAC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AAG,CACX,mBAAmB;YACnB,WAAW;YACX,IAAI,CAAC,qBAAqB,CAAC,oBAAoB,EAAE,EACjD,IAAI,CAAC,aAAa,CAAC,WAAW,CAAC,CAClC,CAAC;YACF,YAAY;QAChB,CAAC,CAAC;QAtIE,IAAI,CAAC,MAAM,GAAG,IAAA,gBAAM,GAAE,CAAC;QACvB,IAAI,CAAC,qBAAqB,GAAG,4BAAsB,CAAC,OAAO,CAAwB,oBAAc,CAAC,qBAAqB,CAAC,CAAC;QACzH,IAAI,CAAC,0BAA0B,GAAG,0BAAY,CAAC,8BAA8B,CAAC;QAC9E,IAAI,CAAC,UAAU,EAAE,CAAC;IACtB,CAAC;CAmIJ;AA7ID,wDA6IC;AAED,MAAM,sBAAsB,GAAW,IAAI,sBAAsB,EAAE,CAAC,MAAM,CAAC;AAClE,wDAAsB"}
|
|
@@ -52,12 +52,18 @@ const outputMinMaxStopSequencesJsonSchema = {
|
|
|
52
52
|
};
|
|
53
53
|
const outputTripScheduleSDMA = {
|
|
54
54
|
origin_route_id: sequelize_1.DataTypes.STRING,
|
|
55
|
-
trip_id:
|
|
55
|
+
trip_id: {
|
|
56
|
+
type: sequelize_1.DataTypes.STRING,
|
|
57
|
+
primaryKey: true,
|
|
58
|
+
},
|
|
56
59
|
service_id: sequelize_1.DataTypes.STRING,
|
|
57
60
|
direction_id: sequelize_1.DataTypes.SMALLINT,
|
|
58
61
|
shape_id: sequelize_1.DataTypes.STRING(15),
|
|
59
62
|
run_number: sequelize_1.DataTypes.INTEGER,
|
|
60
|
-
date:
|
|
63
|
+
date: {
|
|
64
|
+
type: sequelize_1.DataTypes.STRING,
|
|
65
|
+
primaryKey: true,
|
|
66
|
+
},
|
|
61
67
|
route_id: sequelize_1.DataTypes.STRING,
|
|
62
68
|
route_type: {
|
|
63
69
|
type: sequelize_1.DataTypes.SMALLINT,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RopidGTFSPrecomputed.js","sourceRoot":"","sources":["../../../src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AAE,qBAAS,CAAC,MAAM;IACjC,OAAO,EAAE,qBAAS,CAAC,MAAM;
|
|
1
|
+
{"version":3,"file":"RopidGTFSPrecomputed.js","sourceRoot":"","sources":["../../../src/schema-definitions/ropid-gtfs/RopidGTFSPrecomputed.ts"],"names":[],"mappings":";;;AAAA,mEAAiF;AAEjF,MAAM,0BAA0B,GAAyB;IACrD,IAAI,EAAE,qBAAS,CAAC,IAAI;IACpB,QAAQ,EAAE,qBAAS,CAAC,OAAO;IAC3B,UAAU,EAAE,qBAAS,CAAC,MAAM,CAAC,GAAG,CAAC;CACpC,CAAC;AAEF,MAAM,gCAAgC,GAAG;IACrC,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE;QACR,IAAI,EAAE;YACF,IAAI,EAAE,QAAQ;SACjB;QACD,QAAQ,EAAE;YACN,IAAI,EAAE,SAAS;SAClB;QACD,UAAU,EAAE;YACR,IAAI,EAAE,QAAQ;SACjB;KACJ;IACD,QAAQ,EAAE,CAAC,MAAM,EAAE,UAAU,EAAE,YAAY,CAAC;CAC/C,CAAC;AAEF,MAAM,6BAA6B,GAAyB;IACxD,OAAO,EAAE,qBAAS,CAAC,MAAM;IACzB,iBAAiB,EAAE,qBAAS,CAAC,OAAO;IACpC,iBAAiB,EAAE,qBAAS,CAAC,OAAO;IACpC,aAAa,EAAE,qBAAS,CAAC,MAAM;IAC/B,aAAa,EAAE,qBAAS,CAAC,MAAM,EAAE,aAAa;CACjD,CAAC;AAEF,MAAM,mCAAmC,GAAG;IACxC,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE;QACR,OAAO,EAAE;YACL,IAAI,EAAE,QAAQ;SACjB;QACD,iBAAiB,EAAE;YACf,IAAI,EAAE,SAAS;SAClB;QACD,iBAAiB,EAAE;YACf,IAAI,EAAE,SAAS;SAClB;QACD,aAAa,EAAE;YACX,IAAI,EAAE,QAAQ;SACjB;QACD,aAAa,EAAE;YACX,IAAI,EAAE,QAAQ;SACjB;KACJ;IACD,QAAQ,EAA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,iBAAiB,EAAE;YACf,IAAI,EAAE,QAAQ;SACjB;QACD,WAAW,EAAE;YACT,IAAI,EAAE,SAAS;SAClB;QACD,oBAAoB,EAAE;YAClB,IAAI,EAAE,SAAS;SAClB;KACJ;IACD,QAAQ,EAAE,CAAC,YAAY,CAAC;CAC3B,CAAC;AAEW,QAAA,oBAAoB,GAAG;IAChC,gBAAgB,EAAE;QACd,gBAAgB,EAAE,gCAAgC;QAClD,yBAAyB,EAAE,0BAA0B;QACrD,WAAW,EAAE,yCAAyC;KACzD;IACD,mBAAmB,EAAE;QACjB,gBAAgB,EAAE,mCAAmC;QACrD,yBAAyB,EAAE,6BAA6B;QACxD,WAAW,EAAE,6CAA6C;KAC7D;IACD,YAAY,EAAE;QACV,gBAAgB,EAAE,4BAA4B;QAC9C,yBAAyB,EAAE,sBAAsB;QACjD,WAAW,EAAE,qCAAqC;KACrD;CACJ,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { IRouteDto } from "./IRouteDto";
|
|
2
|
+
import { IShapeDto } from "./IShapeDto";
|
|
3
|
+
import { IStopDto } from "./IStopDto";
|
|
4
|
+
import { IStopTimesDto } from "./IStopTimesDto";
|
|
5
|
+
import { ITripDto } from "./ITripDto";
|
|
6
|
+
export interface IStopTimeWithStopDto extends IStopTimesDto {
|
|
7
|
+
stop: IStopDto;
|
|
8
|
+
}
|
|
9
|
+
export interface ITripWithDefinedRouteDto extends ITripWithOptionalAssociationsDto {
|
|
10
|
+
route: IRouteDto;
|
|
11
|
+
}
|
|
12
|
+
export interface ITripWithOptionalAssociationsDto extends ITripDto {
|
|
13
|
+
route?: IRouteDto;
|
|
14
|
+
stop_times?: IStopTimeWithStopDto[];
|
|
15
|
+
shapes?: IShapeDto[];
|
|
16
|
+
schedule?: {
|
|
17
|
+
run_number: number;
|
|
18
|
+
};
|
|
19
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ITripWithOptionalAssociationsDto.js","sourceRoot":"","sources":["../../../../src/schema-definitions/ropid-gtfs/interfaces/ITripWithOptionalAssociationsDto.ts"],"names":[],"mappings":""}
|
|
@@ -595,7 +595,7 @@ Task se stará o aktualizaci cache pro public odjezdy. Pouští se pravidelně c
|
|
|
595
595
|
- žádné
|
|
596
596
|
- data modely
|
|
597
597
|
- RopidGTFSMetadataModel `ropidgtfs_metadata`
|
|
598
|
-
|
|
598
|
+
|
|
599
599
|
#### _DownloadDeparturesPresetsTask_
|
|
600
600
|
|
|
601
601
|
- vstupní rabbitmq fronta
|
|
@@ -1256,6 +1256,15 @@ Worker má na starost retenci dat tabulek Azure Table Storage
|
|
|
1256
1256
|
|
|
1257
1257
|
### Public
|
|
1258
1258
|
|
|
1259
|
+
#### _/public/gtfs/trips/{gtfsTripId}_
|
|
1260
|
+
|
|
1261
|
+
- načte statické informace o GTFS spoji z PSQL, případně jeho oběhové číslo pro současný den (pokud je k dispozici), shapes a zastávky
|
|
1262
|
+
- `info`: statické informace o GTFS spoji a jeho oběhové číslo pro současný den (pokud je k dispozici)
|
|
1263
|
+
- `stop_times`: seznam zastávek ve formátu geojson
|
|
1264
|
+
- `shapes`: seznam tvarů trasy podle GTFS ve formátu geojson
|
|
1265
|
+
- `vehicle_descriptor`: informace o vozidle - pouze očekáváná nízkopodlažnost vozidla načtená z GTFS trips.txt
|
|
1266
|
+
- cachováno na 4 hodiny pomocí cache-control hlavičky
|
|
1267
|
+
|
|
1259
1268
|
#### _/public/vehiclepositions_
|
|
1260
1269
|
|
|
1261
1270
|
- načte aktuální polohy vozidel z redisu a vrátí je ve formátu geojson
|
package/docs/openapi-output.yaml
CHANGED
|
@@ -31,6 +31,9 @@ tags:
|
|
|
31
31
|
- name: 🚏 PID Departure Boards
|
|
32
32
|
description: ""
|
|
33
33
|
|
|
34
|
+
- name: 🗓️ Public GTFS Static Lookup (experimental)
|
|
35
|
+
description: ""
|
|
36
|
+
|
|
34
37
|
- name: 🕐 Public Vehicle Positions (experimental)
|
|
35
38
|
description: ""
|
|
36
39
|
|
|
@@ -949,6 +952,52 @@ paths:
|
|
|
949
952
|
"404":
|
|
950
953
|
description: Not found
|
|
951
954
|
|
|
955
|
+
/public/gtfs/trips/{gtfsTripId}:
|
|
956
|
+
get:
|
|
957
|
+
tags:
|
|
958
|
+
- 🗓️ Public GTFS Static Lookup (experimental)
|
|
959
|
+
summary: GET GTFS Trip
|
|
960
|
+
description: "Get GTFS static trip info by trip ID, including associated stop times (without no stop waypoints) and shapes."
|
|
961
|
+
parameters:
|
|
962
|
+
- name: gtfsTripId
|
|
963
|
+
in: path
|
|
964
|
+
description:
|
|
965
|
+
Filter result by GTFS trip ID.
|
|
966
|
+
required: true
|
|
967
|
+
schema:
|
|
968
|
+
type: string
|
|
969
|
+
example: "115_107_180501"
|
|
970
|
+
- name: scopes
|
|
971
|
+
in: query
|
|
972
|
+
schema:
|
|
973
|
+
type: array
|
|
974
|
+
items:
|
|
975
|
+
type: string
|
|
976
|
+
enum:
|
|
977
|
+
- info
|
|
978
|
+
- stop_times
|
|
979
|
+
- shapes
|
|
980
|
+
- vehicle_descriptor
|
|
981
|
+
description: "Choose which scopes to include in response."
|
|
982
|
+
required: true
|
|
983
|
+
example: ["info"]
|
|
984
|
+
responses:
|
|
985
|
+
200:
|
|
986
|
+
description: OK
|
|
987
|
+
content:
|
|
988
|
+
application/json; charset=utf-8:
|
|
989
|
+
schema:
|
|
990
|
+
allOf:
|
|
991
|
+
- $ref: "#/components/schemas/ScopeStaticInfo"
|
|
992
|
+
- $ref: "#/components/schemas/ScopeStaticStopTimes"
|
|
993
|
+
- $ref: "#/components/schemas/ScopeShapes"
|
|
994
|
+
- $ref: "#/components/schemas/ScopeStaticVehicleDescriptor"
|
|
995
|
+
|
|
996
|
+
401:
|
|
997
|
+
$ref: "#/components/responses/UnauthorizedError"
|
|
998
|
+
404:
|
|
999
|
+
description: Not found
|
|
1000
|
+
|
|
952
1001
|
/public/vehiclepositions:
|
|
953
1002
|
get:
|
|
954
1003
|
tags:
|
|
@@ -1324,17 +1373,9 @@ components:
|
|
|
1324
1373
|
arrival_time:
|
|
1325
1374
|
type: string
|
|
1326
1375
|
example: "13:12:05"
|
|
1327
|
-
arrival_time_seconds:
|
|
1328
|
-
type: number
|
|
1329
|
-
format: int64
|
|
1330
|
-
nullable: true
|
|
1331
1376
|
departure_time:
|
|
1332
1377
|
type: string
|
|
1333
1378
|
example: "13:12:35"
|
|
1334
|
-
departure_time_seconds:
|
|
1335
|
-
type: number
|
|
1336
|
-
format: int64
|
|
1337
|
-
nullable: true
|
|
1338
1379
|
drop_off_type:
|
|
1339
1380
|
type: string
|
|
1340
1381
|
example: "0"
|
|
@@ -1362,10 +1403,6 @@ components:
|
|
|
1362
1403
|
trip_id:
|
|
1363
1404
|
type: string
|
|
1364
1405
|
example: "991_1156_180709"
|
|
1365
|
-
timepoint:
|
|
1366
|
-
type: number
|
|
1367
|
-
nullable: true
|
|
1368
|
-
example: 1
|
|
1369
1406
|
required:
|
|
1370
1407
|
- arrival_time
|
|
1371
1408
|
- departure_time
|
|
@@ -1375,7 +1412,6 @@ components:
|
|
|
1375
1412
|
- stop_id
|
|
1376
1413
|
- stop_sequence
|
|
1377
1414
|
- trip_id
|
|
1378
|
-
- timepoint
|
|
1379
1415
|
|
|
1380
1416
|
GTFSShape:
|
|
1381
1417
|
title: GTFS Shape
|
|
@@ -2248,12 +2284,51 @@ components:
|
|
|
2248
2284
|
description: "time when vehicle send last update"
|
|
2249
2285
|
example: "2023-12-06T12:00:00+01:00"
|
|
2250
2286
|
|
|
2287
|
+
ScopeStaticInfo:
|
|
2288
|
+
type: object
|
|
2289
|
+
properties:
|
|
2290
|
+
gtfs_trip_id:
|
|
2291
|
+
type: string
|
|
2292
|
+
nullable: false
|
|
2293
|
+
example: "115_107_180501"
|
|
2294
|
+
route_type:
|
|
2295
|
+
type: string
|
|
2296
|
+
nullable: false
|
|
2297
|
+
enum: ["tram", "metro", "train", "bus", "ferry", "funicular", "trolleybus", "ext_miscellaneous"]
|
|
2298
|
+
example: "bus"
|
|
2299
|
+
route_short_name:
|
|
2300
|
+
type: string
|
|
2301
|
+
nullable: false
|
|
2302
|
+
example: "22"
|
|
2303
|
+
shape_id:
|
|
2304
|
+
type: string
|
|
2305
|
+
nullable: true
|
|
2306
|
+
example: "L22V3"
|
|
2307
|
+
origin_route_name:
|
|
2308
|
+
type: string
|
|
2309
|
+
nullable: true
|
|
2310
|
+
example: "22"
|
|
2311
|
+
run_number:
|
|
2312
|
+
type: integer
|
|
2313
|
+
nullable: true
|
|
2314
|
+
example: 1
|
|
2315
|
+
trip_headsign:
|
|
2316
|
+
type: string
|
|
2317
|
+
nullable: true
|
|
2318
|
+
example: "Bílá Hora"
|
|
2319
|
+
|
|
2251
2320
|
ScopeStopTimes:
|
|
2252
2321
|
type: object
|
|
2253
2322
|
properties:
|
|
2254
2323
|
stop_times:
|
|
2255
2324
|
$ref: "#/components/schemas/PublicTripStopTimeFeatureCollection"
|
|
2256
2325
|
|
|
2326
|
+
ScopeStaticStopTimes:
|
|
2327
|
+
type: object
|
|
2328
|
+
properties:
|
|
2329
|
+
stop_times:
|
|
2330
|
+
$ref: "#/components/schemas/PublicTripStaticStopTimeFeatureCollection"
|
|
2331
|
+
|
|
2257
2332
|
ScopeShapes:
|
|
2258
2333
|
type: object
|
|
2259
2334
|
properties:
|
|
@@ -2292,6 +2367,17 @@ components:
|
|
|
2292
2367
|
nullable: true
|
|
2293
2368
|
example: "1001"
|
|
2294
2369
|
|
|
2370
|
+
ScopeStaticVehicleDescriptor:
|
|
2371
|
+
type: object
|
|
2372
|
+
properties:
|
|
2373
|
+
vehicle_descriptor:
|
|
2374
|
+
type: object
|
|
2375
|
+
properties:
|
|
2376
|
+
is_wheelchair_accessible:
|
|
2377
|
+
type: boolean
|
|
2378
|
+
nullable: true
|
|
2379
|
+
example: true
|
|
2380
|
+
|
|
2295
2381
|
PublicTripShapeFeatureCollection:
|
|
2296
2382
|
type: object
|
|
2297
2383
|
properties:
|
|
@@ -2379,6 +2465,58 @@ components:
|
|
|
2379
2465
|
type: string
|
|
2380
2466
|
example: FeatureCollection
|
|
2381
2467
|
|
|
2468
|
+
PublicTripStaticStopTimeFeatureCollection:
|
|
2469
|
+
type: object
|
|
2470
|
+
description: "List of stop and arrival, departure times for the trip. No stop waypoints are not included."
|
|
2471
|
+
properties:
|
|
2472
|
+
features:
|
|
2473
|
+
type: array
|
|
2474
|
+
items:
|
|
2475
|
+
type: object
|
|
2476
|
+
properties:
|
|
2477
|
+
geometry:
|
|
2478
|
+
$ref: "#/components/schemas/GeometryPoint"
|
|
2479
|
+
properties:
|
|
2480
|
+
type: object
|
|
2481
|
+
properties:
|
|
2482
|
+
stop_name:
|
|
2483
|
+
type: string
|
|
2484
|
+
nullable: false
|
|
2485
|
+
example: "Nádraží Veleslavín"
|
|
2486
|
+
stop_sequence:
|
|
2487
|
+
type: number
|
|
2488
|
+
nullable: false
|
|
2489
|
+
example: 3
|
|
2490
|
+
zone_id:
|
|
2491
|
+
type: string
|
|
2492
|
+
nullable: true
|
|
2493
|
+
example: "P"
|
|
2494
|
+
is_wheelchair_accessible:
|
|
2495
|
+
type: boolean
|
|
2496
|
+
nullable: true
|
|
2497
|
+
example: true
|
|
2498
|
+
shape_dist_traveled:
|
|
2499
|
+
type: number
|
|
2500
|
+
nullable: false
|
|
2501
|
+
example: 0
|
|
2502
|
+
arrival_time:
|
|
2503
|
+
type: string
|
|
2504
|
+
nullable: false
|
|
2505
|
+
description: "Time for arrival to the stop according to trip schedule."
|
|
2506
|
+
example: "12:00:00"
|
|
2507
|
+
departure_time:
|
|
2508
|
+
type: string
|
|
2509
|
+
nullable: false
|
|
2510
|
+
description: "Time for departure from the stop according to trip schedule."
|
|
2511
|
+
example: "12:00:10"
|
|
2512
|
+
type:
|
|
2513
|
+
type: string
|
|
2514
|
+
example: Feature
|
|
2515
|
+
|
|
2516
|
+
type:
|
|
2517
|
+
type: string
|
|
2518
|
+
example: FeatureCollection
|
|
2519
|
+
|
|
2382
2520
|
GeometryPoint:
|
|
2383
2521
|
type: object
|
|
2384
2522
|
description: GeoJson point
|