@golemio/pid 2.12.10-dev.1266077057 → 2.12.10-dev.1267735301
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/15_vehicle_descriptors.sql +3 -3
- package/db/example/redis/publicDepartureBoardsMock.json +13 -0
- package/db/example/redis/publicVehiclePositionsMock.json +24 -0
- package/dist/integration-engine/ropid-gtfs/RopidGtfsFacade.d.ts +4 -3
- package/dist/integration-engine/ropid-gtfs/RopidGtfsFacade.js +8 -6
- package/dist/integration-engine/ropid-gtfs/RopidGtfsFacade.js.map +1 -1
- package/dist/integration-engine/ropid-gtfs/data-access/cache/PublicGtfsDepartureRepository.d.ts +14 -0
- package/dist/integration-engine/ropid-gtfs/data-access/cache/PublicGtfsDepartureRepository.js +82 -0
- package/dist/integration-engine/ropid-gtfs/data-access/cache/PublicGtfsDepartureRepository.js.map +1 -0
- package/dist/integration-engine/ropid-gtfs/data-access/precomputed/DeparturesRepository.d.ts +10 -2
- package/dist/integration-engine/ropid-gtfs/data-access/precomputed/DeparturesRepository.js +81 -10
- package/dist/integration-engine/ropid-gtfs/data-access/precomputed/DeparturesRepository.js.map +1 -1
- package/dist/integration-engine/ropid-gtfs/interfaces/IPublicDepartureDto.d.ts +12 -0
- package/dist/integration-engine/ropid-gtfs/interfaces/IPublicDepartureDto.js +3 -0
- package/dist/integration-engine/ropid-gtfs/interfaces/IPublicDepartureDto.js.map +1 -0
- package/dist/integration-engine/ropid-gtfs/ioc/Di.js +10 -0
- package/dist/integration-engine/ropid-gtfs/ioc/Di.js.map +1 -1
- package/dist/integration-engine/ropid-gtfs/ioc/RopidGtfsContainerToken.d.ts +4 -0
- package/dist/integration-engine/ropid-gtfs/ioc/RopidGtfsContainerToken.js +4 -0
- package/dist/integration-engine/ropid-gtfs/ioc/RopidGtfsContainerToken.js.map +1 -1
- package/dist/integration-engine/ropid-gtfs/transformations/PublicDepartureCacheTransformation.d.ts +7 -0
- package/dist/integration-engine/ropid-gtfs/transformations/PublicDepartureCacheTransformation.js +36 -0
- package/dist/integration-engine/ropid-gtfs/transformations/PublicDepartureCacheTransformation.js.map +1 -0
- package/dist/integration-engine/ropid-gtfs/workers/timetables/TimetableWorker.d.ts +2 -1
- package/dist/integration-engine/ropid-gtfs/workers/timetables/TimetableWorker.js +9 -1
- package/dist/integration-engine/ropid-gtfs/workers/timetables/TimetableWorker.js.map +1 -1
- package/dist/integration-engine/ropid-gtfs/workers/timetables/constants.d.ts +1 -0
- package/dist/integration-engine/ropid-gtfs/workers/timetables/constants.js +5 -0
- package/dist/integration-engine/ropid-gtfs/workers/timetables/constants.js.map +1 -0
- package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/CheckSavedRowsAndReplaceTablesTask.js +4 -0
- package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/CheckSavedRowsAndReplaceTablesTask.js.map +1 -1
- package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/RefreshPublicGtfsDepartureCacheTask.d.ts +21 -0
- package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/RefreshPublicGtfsDepartureCacheTask.js +102 -0
- package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/RefreshPublicGtfsDepartureCacheTask.js.map +1 -0
- package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/helpers/PrecomputedTablesFacade.d.ts +3 -2
- package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/helpers/PrecomputedTablesFacade.js +9 -7
- package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/helpers/PrecomputedTablesFacade.js.map +1 -1
- package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/interfaces/IRefreshPublicDepartureParams.d.ts +4 -0
- package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/interfaces/IRefreshPublicDepartureParams.js +3 -0
- package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/interfaces/IRefreshPublicDepartureParams.js.map +1 -0
- package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/schema/RefreshPublicDepartureSchema.d.ts +5 -0
- package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/schema/RefreshPublicDepartureSchema.js +31 -0
- package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/schema/RefreshPublicDepartureSchema.js.map +1 -0
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/data-access/cache/PublicApiCacheRepository.js +6 -1
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/data-access/cache/PublicApiCacheRepository.js.map +1 -1
- package/dist/output-gateway/index.js.map +1 -1
- package/dist/output-gateway/pid/helpers/DepartureBoardMapper.js +2 -1
- package/dist/output-gateway/pid/helpers/DepartureBoardMapper.js.map +1 -1
- package/dist/output-gateway/public/controllers/v1/PublicDepartureBoardsController.d.ts +8 -0
- package/dist/output-gateway/public/controllers/v1/PublicDepartureBoardsController.js +60 -0
- package/dist/output-gateway/public/controllers/v1/PublicDepartureBoardsController.js.map +1 -0
- package/dist/output-gateway/public/controllers/v1/interfaces/PublicParamsInterfaces.d.ts +10 -0
- package/dist/output-gateway/public/data-access/redis/PublicGtfsDepartureRepository.d.ts +11 -0
- package/dist/output-gateway/public/data-access/redis/PublicGtfsDepartureRepository.js +72 -0
- package/dist/output-gateway/public/data-access/redis/PublicGtfsDepartureRepository.js.map +1 -0
- package/dist/output-gateway/public/data-access/redis/PublicVehiclePositionsRepository.d.ts +1 -0
- package/dist/output-gateway/public/data-access/redis/PublicVehiclePositionsRepository.js +22 -2
- package/dist/output-gateway/public/data-access/redis/PublicVehiclePositionsRepository.js.map +1 -1
- package/dist/output-gateway/public/domain/IPublicDepartureTransformInputDto.d.ts +9 -0
- package/dist/output-gateway/public/domain/IPublicDepartureTransformInputDto.js +3 -0
- package/dist/output-gateway/public/domain/IPublicDepartureTransformInputDto.js.map +1 -0
- package/dist/output-gateway/public/domain/PublicApiDepartureInterfaces.d.ts +34 -0
- package/dist/output-gateway/public/domain/PublicApiDepartureInterfaces.js +3 -0
- package/dist/output-gateway/public/domain/PublicApiDepartureInterfaces.js.map +1 -0
- package/dist/output-gateway/public/domain/repository/IGtfsDepartureRepository.d.ts +4 -0
- package/dist/output-gateway/public/domain/repository/IGtfsDepartureRepository.js +3 -0
- package/dist/output-gateway/public/domain/repository/IGtfsDepartureRepository.js.map +1 -0
- package/dist/output-gateway/public/domain/repository/IVehiclePositionsRepository.d.ts +1 -0
- package/dist/output-gateway/public/ioc/Di.js +8 -0
- package/dist/output-gateway/public/ioc/Di.js.map +1 -1
- package/dist/output-gateway/public/ioc/OgModuleToken.d.ts +2 -0
- package/dist/output-gateway/public/ioc/OgModuleToken.js +2 -0
- package/dist/output-gateway/public/ioc/OgModuleToken.js.map +1 -1
- package/dist/output-gateway/public/routers/v1/PublicDeparturesRouter.d.ts +10 -0
- package/dist/output-gateway/public/routers/v1/PublicDeparturesRouter.js +27 -0
- package/dist/output-gateway/public/routers/v1/PublicDeparturesRouter.js.map +1 -0
- package/dist/output-gateway/public/routers/v1/{PublicRouter.d.ts → PublicVehiclePositionsRouter.d.ts} +3 -3
- package/dist/output-gateway/public/routers/v1/{PublicRouter.js → PublicVehiclePositionsRouter.js} +8 -8
- package/dist/output-gateway/public/routers/v1/PublicVehiclePositionsRouter.js.map +1 -0
- package/dist/output-gateway/public/routers/v1/helpers/CustomStopIdGroupValidator.d.ts +5 -0
- package/dist/output-gateway/public/routers/v1/helpers/CustomStopIdGroupValidator.js +42 -0
- package/dist/output-gateway/public/routers/v1/helpers/CustomStopIdGroupValidator.js.map +1 -0
- package/dist/output-gateway/public/service/facade/DepartureBoardFacade.d.ts +17 -0
- package/dist/output-gateway/public/service/facade/DepartureBoardFacade.js +106 -0
- package/dist/output-gateway/public/service/facade/DepartureBoardFacade.js.map +1 -0
- package/dist/output-gateway/public/service/transformations/PublicDepartureTransformation.d.ts +34 -0
- package/dist/output-gateway/public/service/transformations/PublicDepartureTransformation.js +54 -0
- package/dist/output-gateway/public/service/transformations/PublicDepartureTransformation.js.map +1 -0
- package/dist/output-gateway/shared/DepartureCalculator.d.ts +10 -0
- package/dist/output-gateway/shared/DepartureCalculator.js +26 -0
- package/dist/output-gateway/shared/DepartureCalculator.js.map +1 -0
- package/dist/output-gateway/shared/RopidRouterUtils.d.ts +2 -1
- package/dist/output-gateway/shared/RopidRouterUtils.js +4 -3
- package/dist/output-gateway/shared/RopidRouterUtils.js.map +1 -1
- package/dist/schema-definitions/ropid-gtfs/redis/const.d.ts +1 -0
- package/dist/schema-definitions/ropid-gtfs/redis/const.js +5 -0
- package/dist/schema-definitions/ropid-gtfs/redis/const.js.map +1 -0
- package/dist/schema-definitions/ropid-gtfs/redis/interfaces/IPublicGtfsDepartureCacheDto.d.ts +12 -0
- package/dist/schema-definitions/ropid-gtfs/redis/interfaces/IPublicGtfsDepartureCacheDto.js +3 -0
- package/dist/schema-definitions/ropid-gtfs/redis/interfaces/IPublicGtfsDepartureCacheDto.js.map +1 -0
- package/dist/schema-definitions/ropid-gtfs/redis/schemas/PublicGtfsDepartureDtoSchema.d.ts +4 -0
- package/dist/schema-definitions/ropid-gtfs/redis/schemas/PublicGtfsDepartureDtoSchema.js +69 -0
- package/dist/schema-definitions/ropid-gtfs/redis/schemas/PublicGtfsDepartureDtoSchema.js.map +1 -0
- package/docs/implementation_documentation.md +26 -0
- package/docs/openapi-output.yaml +233 -0
- package/package.json +1 -1
- package/dist/output-gateway/public/routers/v1/PublicRouter.js.map +0 -1
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PublicDepartureTransformation = void 0;
|
|
4
|
+
const RouteTypeEnums_1 = require("../../../../helpers/RouteTypeEnums");
|
|
5
|
+
const DepartureCalculator_1 = require("../../../shared/DepartureCalculator");
|
|
6
|
+
const RopidRouterUtils_1 = require("../../../shared/RopidRouterUtils");
|
|
7
|
+
const AbstractTransformation_1 = require("@golemio/core/dist/helpers/transformation/AbstractTransformation");
|
|
8
|
+
const const_1 = require("../../../../const");
|
|
9
|
+
class PublicDepartureTransformation extends AbstractTransformation_1.AbstractTransformation {
|
|
10
|
+
constructor() {
|
|
11
|
+
super(...arguments);
|
|
12
|
+
this.name = "PublicDepartureTransformation";
|
|
13
|
+
this.transformInternal = (inputDto) => {
|
|
14
|
+
var _a, _b, _c, _d, _e, _f;
|
|
15
|
+
const { departure, vehicleId, vehiclePosition, vehicleDescriptor } = inputDto;
|
|
16
|
+
const delayInSeconds = (_a = vehiclePosition === null || vehiclePosition === void 0 ? void 0 : vehiclePosition.delay) !== null && _a !== void 0 ? _a : null;
|
|
17
|
+
const departureTime = new Date(departure.departure_datetime);
|
|
18
|
+
const arrivalTime = departure.arrival_datetime ? new Date(departure.arrival_datetime) : null;
|
|
19
|
+
const predictedDepartureTime = DepartureCalculator_1.DepartureCalculator.getPredictedDepartureTime(departureTime, arrivalTime, delayInSeconds);
|
|
20
|
+
return {
|
|
21
|
+
departure: {
|
|
22
|
+
timestamp_scheduled: (_b = RopidRouterUtils_1.RopidRouterUtils.formatTimestamp(departureTime)) !== null && _b !== void 0 ? _b : departure.departure_datetime,
|
|
23
|
+
timestamp_predicted: (_c = RopidRouterUtils_1.RopidRouterUtils.formatTimestamp(predictedDepartureTime)) !== null && _c !== void 0 ? _c : departure.departure_datetime,
|
|
24
|
+
delay_seconds: delayInSeconds,
|
|
25
|
+
minutes: DepartureCalculator_1.DepartureCalculator.getDepartureMinutes(predictedDepartureTime),
|
|
26
|
+
},
|
|
27
|
+
stop: {
|
|
28
|
+
id: departure.stop_id,
|
|
29
|
+
sequence: departure.stop_sequence,
|
|
30
|
+
// NOTE platform_code is always null for trains
|
|
31
|
+
// fill from realtime data (CIS stop platform code) if needed in the future
|
|
32
|
+
platform_code: departure.platform_code,
|
|
33
|
+
},
|
|
34
|
+
route: {
|
|
35
|
+
type: RouteTypeEnums_1.GTFSRouteTypeEnum[departure.route_type].toLowerCase(),
|
|
36
|
+
short_name: departure.route_short_name,
|
|
37
|
+
},
|
|
38
|
+
trip: {
|
|
39
|
+
id: departure.trip_id,
|
|
40
|
+
headsign: departure.trip_headsign,
|
|
41
|
+
is_canceled: (vehiclePosition === null || vehiclePosition === void 0 ? void 0 : vehiclePosition.state_position) === const_1.StatePositionEnum.CANCELED,
|
|
42
|
+
},
|
|
43
|
+
vehicle: {
|
|
44
|
+
id: vehicleId,
|
|
45
|
+
is_wheelchair_accessible: (_d = vehiclePosition === null || vehiclePosition === void 0 ? void 0 : vehiclePosition.detailed_info.is_wheelchair_accessible) !== null && _d !== void 0 ? _d : null,
|
|
46
|
+
is_air_conditioned: (_e = vehicleDescriptor === null || vehicleDescriptor === void 0 ? void 0 : vehicleDescriptor.is_air_conditioned) !== null && _e !== void 0 ? _e : null,
|
|
47
|
+
has_charger: (_f = vehicleDescriptor === null || vehicleDescriptor === void 0 ? void 0 : vehicleDescriptor.has_usb_chargers) !== null && _f !== void 0 ? _f : null,
|
|
48
|
+
},
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
exports.PublicDepartureTransformation = PublicDepartureTransformation;
|
|
54
|
+
//# sourceMappingURL=PublicDepartureTransformation.js.map
|
package/dist/output-gateway/public/service/transformations/PublicDepartureTransformation.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PublicDepartureTransformation.js","sourceRoot":"","sources":["../../../../../src/output-gateway/public/service/transformations/PublicDepartureTransformation.ts"],"names":[],"mappings":";;;AAAA,uEAA4D;AAG5D,6EAAqE;AACrE,uEAA+D;AAC/D,6GAA0G;AAC1G,6CAA8C;AAE9C,MAAa,6BAA8B,SAAQ,+CAGlD;IAHD;;QAIW,SAAI,GAAG,+BAA+B,CAAC;QAEpC,sBAAiB,GAAG,CAAC,QAA2C,EAAE,EAAE;;YAC1E,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,eAAe,EAAE,iBAAiB,EAAE,GAAG,QAAQ,CAAC;YAE9E,MAAM,cAAc,GAAG,MAAA,eAAe,aAAf,eAAe,uBAAf,eAAe,CAAE,KAAK,mCAAI,IAAI,CAAC;YACtD,MAAM,aAAa,GAAG,IAAI,IAAI,CAAC,SAAS,CAAC,kBAAkB,CAAC,CAAC;YAC7D,MAAM,WAAW,GAAG,SAAS,CAAC,gBAAgB,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,SAAS,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;YAC7F,MAAM,sBAAsB,GAAG,yCAAmB,CAAC,yBAAyB,CAAC,aAAa,EAAE,WAAW,EAAE,cAAc,CAAC,CAAC;YAEzH,OAAO;gBACH,SAAS,EAAE;oBACP,mBAAmB,EAAE,MAAA,mCAAgB,CAAC,eAAe,CAAC,aAAa,CAAC,mCAAI,SAAS,CAAC,kBAAkB;oBACpG,mBAAmB,EAAE,MAAA,mCAAgB,CAAC,eAAe,CAAC,sBAAsB,CAAC,mCAAI,SAAS,CAAC,kBAAkB;oBAC7G,aAAa,EAAE,cAAc;oBAC7B,OAAO,EAAE,yCAAmB,CAAC,mBAAmB,CAAC,sBAAsB,CAAC;iBAC3E;gBACD,IAAI,EAAE;oBACF,EAAE,EAAE,SAAS,CAAC,OAAO;oBACrB,QAAQ,EAAE,SAAS,CAAC,aAAa;oBACjC,+CAA+C;oBAC/C,6EAA6E;oBAC7E,aAAa,EAAE,SAAS,CAAC,aAAa;iBACzC;gBACD,KAAK,EAAE;oBACH,IAAI,EAAE,kCAAiB,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC,WAAW,EAAE;oBAC3D,UAAU,EAAE,SAAS,CAAC,gBAAgB;iBACzC;gBACD,IAAI,EAAE;oBACF,EAAE,EAAE,SAAS,CAAC,OAAO;oBACrB,QAAQ,EAAE,SAAS,CAAC,aAAa;oBACjC,WAAW,EAAE,CAAA,eAAe,aAAf,eAAe,uBAAf,eAAe,CAAE,cAAc,MAAK,yBAAiB,CAAC,QAAQ;iBAC9E;gBACD,OAAO,EAAE;oBACL,EAAE,EAAE,SAAS;oBACb,wBAAwB,EAAE,MAAA,eAAe,aAAf,eAAe,uBAAf,eAAe,CAAE,aAAa,CAAC,wBAAwB,mCAAI,IAAI;oBACzF,kBAAkB,EAAE,MAAA,iBAAiB,aAAjB,iBAAiB,uBAAjB,iBAAiB,CAAE,kBAAkB,mCAAI,IAAI;oBACjE,WAAW,EAAE,MAAA,iBAAiB,aAAjB,iBAAiB,uBAAjB,iBAAiB,CAAE,gBAAgB,mCAAI,IAAI;iBAC3D;aACJ,CAAC;QACN,CAAC,CAAC;IACN,CAAC;CAAA;AA7CD,sEA6CC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare class DepartureCalculator {
|
|
2
|
+
/**
|
|
3
|
+
* Calculates the predicted departure time based on the scheduled departure time, arrival time and delay.
|
|
4
|
+
**/
|
|
5
|
+
static getPredictedDepartureTime: (departureTime: Date, arrivalTime: Date | null, delayInSeconds: number | null) => Date;
|
|
6
|
+
/**
|
|
7
|
+
* Calculates the number of minutes until the predicted departure time.
|
|
8
|
+
**/
|
|
9
|
+
static getDepartureMinutes: (predictedDepartureTime: Date) => number;
|
|
10
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DepartureCalculator = void 0;
|
|
4
|
+
class DepartureCalculator {
|
|
5
|
+
}
|
|
6
|
+
exports.DepartureCalculator = DepartureCalculator;
|
|
7
|
+
/**
|
|
8
|
+
* Calculates the predicted departure time based on the scheduled departure time, arrival time and delay.
|
|
9
|
+
**/
|
|
10
|
+
DepartureCalculator.getPredictedDepartureTime = (departureTime, arrivalTime, delayInSeconds) => {
|
|
11
|
+
let delayInSecondsWithDefault = delayInSeconds !== null && delayInSeconds !== void 0 ? delayInSeconds : 0;
|
|
12
|
+
let adjustedDepartureTime = new Date(departureTime.getTime() + delayInSecondsWithDefault * 1000);
|
|
13
|
+
if (arrivalTime && delayInSecondsWithDefault > 0) {
|
|
14
|
+
const dwellInSeconds = (departureTime.getTime() - arrivalTime.getTime()) / 1000;
|
|
15
|
+
const minDwellInSeconds = Math.min(delayInSecondsWithDefault, dwellInSeconds);
|
|
16
|
+
adjustedDepartureTime.setTime(adjustedDepartureTime.getTime() - minDwellInSeconds * 1000);
|
|
17
|
+
}
|
|
18
|
+
return adjustedDepartureTime;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Calculates the number of minutes until the predicted departure time.
|
|
22
|
+
**/
|
|
23
|
+
DepartureCalculator.getDepartureMinutes = (predictedDepartureTime) => {
|
|
24
|
+
return Math.round((predictedDepartureTime.getTime() - new Date().getTime()) / (60 * 1000));
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=DepartureCalculator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DepartureCalculator.js","sourceRoot":"","sources":["../../../src/output-gateway/shared/DepartureCalculator.ts"],"names":[],"mappings":";;;AAAA,MAAa,mBAAmB;;AAAhC,kDA4BC;AA3BG;;IAEI;AACU,6CAAyB,GAAG,CACtC,aAAmB,EACnB,WAAwB,EACxB,cAA6B,EACzB,EAAE;IACN,IAAI,yBAAyB,GAAG,cAAc,aAAd,cAAc,cAAd,cAAc,GAAI,CAAC,CAAC;IACpD,IAAI,qBAAqB,GAAG,IAAI,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE,GAAG,yBAAyB,GAAG,IAAI,CAAC,CAAC;IAEjG,IAAI,WAAW,IAAI,yBAAyB,GAAG,CAAC,EAAE;QAC9C,MAAM,cAAc,GAAG,CAAC,aAAa,CAAC,OAAO,EAAE,GAAG,WAAW,CAAC,OAAO,EAAE,CAAC,GAAG,IAAI,CAAC;QAChF,MAAM,iBAAiB,GAAG,IAAI,CAAC,GAAG,CAAC,yBAAyB,EAAE,cAAc,CAAC,CAAC;QAE9E,qBAAqB,CAAC,OAAO,CAAC,qBAAqB,CAAC,OAAO,EAAE,GAAG,iBAAiB,GAAG,IAAI,CAAC,CAAC;KAC7F;IAED,OAAO,qBAAqB,CAAC;AACjC,CAAC,CAAC;AAEF;;IAEI;AACU,uCAAmB,GAAG,CAAC,sBAA4B,EAAU,EAAE;IACzE,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,sBAAsB,CAAC,OAAO,EAAE,GAAG,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE,CAAC,GAAG,CAAC,EAAE,GAAG,IAAI,CAAC,CAAC,CAAC;AAC/F,CAAC,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ClassConstructor } from "@golemio/core/dist/shared/class-transformer";
|
|
2
2
|
import { ParsedQs } from "qs";
|
|
3
3
|
export declare class RopidRouterUtils {
|
|
4
|
+
static TIMEZONE: string;
|
|
4
5
|
/**
|
|
5
6
|
* Convert plain object to DTO class instance
|
|
6
7
|
*/
|
|
@@ -8,7 +9,7 @@ export declare class RopidRouterUtils {
|
|
|
8
9
|
/**
|
|
9
10
|
* Format to ISO 8601 (without milliseconds)
|
|
10
11
|
*/
|
|
11
|
-
static formatTimestamp: (dateObject: Date | null, preferredTimezone
|
|
12
|
+
static formatTimestamp: (dateObject: Date | null, preferredTimezone?: string) => string | null;
|
|
12
13
|
/**
|
|
13
14
|
* Validate and return timezone (it is possible to use _ symbol instead of URL encoded / symbol)
|
|
14
15
|
*/
|
|
@@ -4,13 +4,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.RopidRouterUtils = void 0;
|
|
7
|
-
const config_1 = require("@golemio/core/dist/output-gateway/config");
|
|
8
7
|
const Logger_1 = require("@golemio/core/dist/output-gateway/Logger");
|
|
9
|
-
const
|
|
8
|
+
const config_1 = require("@golemio/core/dist/output-gateway/config");
|
|
10
9
|
const class_transformer_1 = require("@golemio/core/dist/shared/class-transformer");
|
|
10
|
+
const moment_timezone_1 = __importDefault(require("@golemio/core/dist/shared/moment-timezone"));
|
|
11
11
|
class RopidRouterUtils {
|
|
12
12
|
}
|
|
13
13
|
exports.RopidRouterUtils = RopidRouterUtils;
|
|
14
|
+
RopidRouterUtils.TIMEZONE = "Europe/Prague";
|
|
14
15
|
/**
|
|
15
16
|
* Convert plain object to DTO class instance
|
|
16
17
|
*/
|
|
@@ -20,7 +21,7 @@ RopidRouterUtils.mapObjectToDTOInstance = (dto, data) => {
|
|
|
20
21
|
/**
|
|
21
22
|
* Format to ISO 8601 (without milliseconds)
|
|
22
23
|
*/
|
|
23
|
-
RopidRouterUtils.formatTimestamp = (dateObject, preferredTimezone) => {
|
|
24
|
+
RopidRouterUtils.formatTimestamp = (dateObject, preferredTimezone = RopidRouterUtils.TIMEZONE) => {
|
|
24
25
|
if (!dateObject)
|
|
25
26
|
return null;
|
|
26
27
|
try {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RopidRouterUtils.js","sourceRoot":"","sources":["../../../src/output-gateway/shared/RopidRouterUtils.ts"],"names":[],"mappings":";;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"RopidRouterUtils.js","sourceRoot":"","sources":["../../../src/output-gateway/shared/RopidRouterUtils.ts"],"names":[],"mappings":";;;;;;AAAA,qEAA+D;AAC/D,qEAAkE;AAClE,mFAAgG;AAChG,gGAA+D;AAG/D,MAAa,gBAAgB;;AAA7B,4CA0CC;AAzCiB,yBAAQ,GAAG,eAAe,CAAC;AAEzC;;GAEG;AACW,uCAAsB,GAAG,CAAI,GAAwB,EAAE,IAAS,EAAE,EAAE;IAC9E,OAAO,IAAA,mCAAe,EAAC,GAAG,EAAE,IAAI,EAAE,EAAE,mBAAmB,EAAE,IAAI,EAAE,CAAC,CAAC;AACrE,CAAC,CAAC;AAEF;;GAEG;AACW,gCAAe,GAAG,CAAC,UAAuB,EAAE,iBAAiB,GAAG,gBAAgB,CAAC,QAAQ,EAAiB,EAAE;IACtH,IAAI,CAAC,UAAU;QAAE,OAAO,IAAI,CAAC;IAE7B,IAAI;QACA,MAAM,QAAQ,GAAG,IAAA,yBAAM,EAAC,UAAU,CAAC,CAAC,EAAE,CAAC,iBAAiB,CAAC,CAAC,MAAM,EAAE,CAAC;QAEnE,IAAI,QAAQ,KAAK,cAAc,EAAE;YAC7B,YAAG,CAAC,KAAK,CAAC,wDAAwD,CAAC,CAAC;YACpE,OAAO,IAAI,CAAC;SACf;QAED,OAAO,QAAQ,CAAC;KACnB;IAAC,OAAO,GAAG,EAAE;QACV,YAAG,CAAC,KAAK,CAAC,wDAAwD,EAAE,GAAG,CAAC,CAAC;QACzE,OAAO,IAAI,CAAC;KACf;AACL,CAAC,CAAC;AAEF;;GAEG;AACW,qCAAoB,GAAG,CAAC,iBAAmC,EAAU,EAAE;IACjF,MAAM,QAAQ,GACV,OAAO,iBAAiB,KAAK,QAAQ;QACjC,CAAC,CAAC,iBAAiB,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC;QACtC,CAAC,CAAC,eAAM,CAAC,gBAAgB,CAAC,eAAe,CAAC;IAElD,OAAO,QAAQ,CAAC;AACpB,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const PUBLIC_DEPARTURE_NAMESPACE_PREFIX = "gtfsPublicDepartureCache";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"const.js","sourceRoot":"","sources":["../../../../src/schema-definitions/ropid-gtfs/redis/const.ts"],"names":[],"mappings":";;;AAAa,QAAA,iCAAiC,GAAG,0BAA0B,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { GTFSRouteTypeEnum } from "../../../../helpers/RouteTypeEnums";
|
|
2
|
+
export interface IPublicGtfsDepartureCacheDto {
|
|
3
|
+
stop_id: string;
|
|
4
|
+
departure_datetime: string;
|
|
5
|
+
arrival_datetime: string | null;
|
|
6
|
+
route_short_name: string;
|
|
7
|
+
route_type: GTFSRouteTypeEnum;
|
|
8
|
+
trip_id: string;
|
|
9
|
+
stop_sequence: number;
|
|
10
|
+
platform_code: string | null;
|
|
11
|
+
trip_headsign: string;
|
|
12
|
+
}
|
package/dist/schema-definitions/ropid-gtfs/redis/interfaces/IPublicGtfsDepartureCacheDto.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IPublicGtfsDepartureCacheDto.js","sourceRoot":"","sources":["../../../../../src/schema-definitions/ropid-gtfs/redis/interfaces/IPublicGtfsDepartureCacheDto.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { JSONSchemaType } from "@golemio/core/dist/shared/ajv";
|
|
2
|
+
import { IPublicGtfsDepartureCacheDto } from "../interfaces/IPublicGtfsDepartureCacheDto";
|
|
3
|
+
declare const publicGtfsDepartureDtoSchema: JSONSchemaType<IPublicGtfsDepartureCacheDto[]>;
|
|
4
|
+
export { publicGtfsDepartureDtoSchema as PublicGtfsDepartureDtoSchema };
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PublicGtfsDepartureDtoSchema = void 0;
|
|
4
|
+
const publicGtfsDepartureDtoSchema = {
|
|
5
|
+
$schema: "http://json-schema.org/draft-04/schema#",
|
|
6
|
+
title: "PublicGtfsDepartureDto",
|
|
7
|
+
type: "array",
|
|
8
|
+
items: {
|
|
9
|
+
type: "object",
|
|
10
|
+
properties: {
|
|
11
|
+
stop_id: {
|
|
12
|
+
type: "string",
|
|
13
|
+
},
|
|
14
|
+
departure_datetime: {
|
|
15
|
+
type: "string",
|
|
16
|
+
},
|
|
17
|
+
arrival_datetime: {
|
|
18
|
+
oneOf: [
|
|
19
|
+
{
|
|
20
|
+
type: "string",
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
type: "null",
|
|
24
|
+
nullable: true,
|
|
25
|
+
},
|
|
26
|
+
],
|
|
27
|
+
},
|
|
28
|
+
route_short_name: {
|
|
29
|
+
type: "string",
|
|
30
|
+
},
|
|
31
|
+
route_type: {
|
|
32
|
+
type: "number",
|
|
33
|
+
},
|
|
34
|
+
trip_id: {
|
|
35
|
+
type: "string",
|
|
36
|
+
},
|
|
37
|
+
stop_sequence: {
|
|
38
|
+
type: "number",
|
|
39
|
+
},
|
|
40
|
+
platform_code: {
|
|
41
|
+
oneOf: [
|
|
42
|
+
{
|
|
43
|
+
type: "string",
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
type: "null",
|
|
47
|
+
nullable: true,
|
|
48
|
+
},
|
|
49
|
+
],
|
|
50
|
+
},
|
|
51
|
+
trip_headsign: {
|
|
52
|
+
type: "string",
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
required: [
|
|
56
|
+
"stop_id",
|
|
57
|
+
"departure_datetime",
|
|
58
|
+
"arrival_datetime",
|
|
59
|
+
"route_short_name",
|
|
60
|
+
"route_type",
|
|
61
|
+
"trip_id",
|
|
62
|
+
"stop_sequence",
|
|
63
|
+
"platform_code",
|
|
64
|
+
"trip_headsign",
|
|
65
|
+
],
|
|
66
|
+
},
|
|
67
|
+
};
|
|
68
|
+
exports.PublicGtfsDepartureDtoSchema = publicGtfsDepartureDtoSchema;
|
|
69
|
+
//# sourceMappingURL=PublicGtfsDepartureDtoSchema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PublicGtfsDepartureDtoSchema.js","sourceRoot":"","sources":["../../../../../src/schema-definitions/ropid-gtfs/redis/schemas/PublicGtfsDepartureDtoSchema.ts"],"names":[],"mappings":";;;AAGA,MAAM,4BAA4B,GAAmD;IACjF,OAAO,EAAE,yCAAyC;IAClD,KAAK,EAAE,wBAAwB;IAC/B,IAAI,EAAE,OAAO;IACb,KAAK,EAAE;QACH,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACR,OAAO,EAAE;gBACL,IAAI,EAAE,QAAQ;aACjB;YACD,kBAAkB,EAAE;gBAChB,IAAI,EAAE,QAAQ;aACjB;YACD,gBAAgB,EAAE;gBACd,KAAK,EAAE;oBACH;wBACI,IAAI,EAAE,QAAQ;qBACjB;oBACD;wBACI,IAAI,EAAE,MAAM;wBACZ,QAAQ,EAAE,IAAI;qBACjB;iBACJ;aACJ;YACD,gBAAgB,EAAE;gBACd,IAAI,EAAE,QAAQ;aACjB;YACD,UAAU,EAAE;gBACR,IAAI,EAAE,QAAQ;aACjB;YACD,OAAO,EAAE;gBACL,IAAI,EAAE,QAAQ;aACjB;YACD,aAAa,EAAE;gBACX,IAAI,EAAE,QAAQ;aACjB;YACD,aAAa,EAAE;gBACX,KAAK,EAAE;oBACH;wBACI,IAAI,EAAE,QAAQ;qBACjB;oBACD;wBACI,IAAI,EAAE,MAAM;wBACZ,QAAQ,EAAE,IAAI;qBACjB;iBACJ;aACJ;YACD,aAAa,EAAE;gBACX,IAAI,EAAE,QAAQ;aACjB;SACJ;QACD,QAAQ,EAAE;YACN,SAAS;YACT,oBAAoB;YACpB,kBAAkB;YAClB,kBAAkB;YAClB,YAAY;YACZ,SAAS;YACT,eAAe;YACf,eAAe;YACf,eAAe;SAClB;KACJ;CACJ,CAAC;AACuC,oEAA4B"}
|
|
@@ -504,6 +504,7 @@ Worker má na starost aktualizaci presets číselníků
|
|
|
504
504
|
- závislé fronty (do kterých jsou odesílány zprávy z metody workeru)
|
|
505
505
|
- název: vehicle-positions.ropidgtfs.downloadDatasets
|
|
506
506
|
- název: vehicle-positions.ropidgtfs.refreshPrecomputedTables
|
|
507
|
+
- název: vehicle-positions.ropidgtfs.refreshPublicGtfsDepartureCache
|
|
507
508
|
- název: vehicle-positions.vehiclepositions.refreshGTFSTripData
|
|
508
509
|
- datové zdroje
|
|
509
510
|
- ROPID FTP
|
|
@@ -548,6 +549,23 @@ Worker má na starost aktualizaci presets číselníků
|
|
|
548
549
|
- RopidGTFSPrecomputedDeparturesModel `ropidgtfs_precomputed_departures`
|
|
549
550
|
- RopidGTFSPrecomputedTripScheduleModel `ropidgtfs_precomputed_trip_schedule`
|
|
550
551
|
|
|
552
|
+
#### task _RefreshPublicGtfsDepartureCacheTask_
|
|
553
|
+
|
|
554
|
+
Task se stará o aktualizaci cache pro public odjezdy. Pouští se pravidelně cronem a po dokončení načtení nových JŘ.
|
|
555
|
+
|
|
556
|
+
- vstupní rabbitmq fronta
|
|
557
|
+
- název: vehicle-positions.ropidgtfs.refreshPublicGtfsDepartureCache
|
|
558
|
+
- TTL: 59 minut
|
|
559
|
+
- parametry: `{intervalFromHours, intervalToHours}`
|
|
560
|
+
- závislé fronty (do kterých jsou odesílány zprávy z metody workeru)
|
|
561
|
+
- žádné
|
|
562
|
+
- datové zdroje
|
|
563
|
+
- ROPID FTP
|
|
564
|
+
- transformace
|
|
565
|
+
- [PublicDepartureCacheTransformation](../src/integration-engine/ropid-gtfs/transformations/PublicDepartureCacheTransformation.ts)
|
|
566
|
+
- data modely
|
|
567
|
+
- RopidGTFSPrecomputedDeparturesModel `ropidgtfs_precomputed_departures`
|
|
568
|
+
|
|
551
569
|
### PresetWorker
|
|
552
570
|
|
|
553
571
|
#### _Task ~ SavePresetsDataTask_
|
|
@@ -1256,3 +1274,11 @@ Worker má na starost retenci dat tabulek Azure Table Storage
|
|
|
1256
1274
|
- `stop_times`: seznam zastávek, které vozidlo projelo a projede, vč. informací o zpoždění (historických/predikovaných), ve formátu geojson
|
|
1257
1275
|
- `shapes`: seznam tvarů trasy (podle GTFS; nejedná se o naše předpočítané anchor pointy, které se mimo zastávky oproti GTFS shapes mohou lišit), ve formátu geojson
|
|
1258
1276
|
- `vehicle_descriptor`: informace o vozidle (dopravce, dostupnost klimatizace, USB, ...)
|
|
1277
|
+
|
|
1278
|
+
#### _/public/departureboards_
|
|
1279
|
+
|
|
1280
|
+
- načte nacacheované odjezdy z redisu
|
|
1281
|
+
- možno filtrovat podle skupin zastávek `stopIds` (podle GTFS číselníku) s možností nastavení pořadí navrácených skupin s odjezdy - příklad `?stopIds[]={"0": ["U717Z5P"]}&stopIds[]={"1": ["U718Z5P", "U719Z5P"]}`
|
|
1282
|
+
- podle názvů linek a jak daleko do budoucnosti se mají odjezdy navracet
|
|
1283
|
+
- limitování počtu odjezdů v každé skupině
|
|
1284
|
+
- EP je optimalizován pro vyšší zátěž z mobilní aplikace PID lítačka - požadavek do databáze z OG pouze v případě nutnosti obnovit cache s vehicle descriptory (klimatizace, usb nabíječky), jinak je vše z Redisu
|
package/docs/openapi-output.yaml
CHANGED
|
@@ -34,6 +34,9 @@ tags:
|
|
|
34
34
|
- name: 🕐 Public Vehicle Positions (experimental)
|
|
35
35
|
description: ""
|
|
36
36
|
|
|
37
|
+
- name: 🕒 Public Departures (experimental)
|
|
38
|
+
description: ""
|
|
39
|
+
|
|
37
40
|
paths:
|
|
38
41
|
/gtfs/services:
|
|
39
42
|
get:
|
|
@@ -1046,16 +1049,122 @@ paths:
|
|
|
1046
1049
|
$ref: "#/components/responses/UnauthorizedError"
|
|
1047
1050
|
404:
|
|
1048
1051
|
description: Not found
|
|
1052
|
+
/public/departureboards:
|
|
1053
|
+
get:
|
|
1054
|
+
tags:
|
|
1055
|
+
- 🕒 Public Departures (experimental)
|
|
1056
|
+
summary: Get Departure Boards
|
|
1057
|
+
parameters:
|
|
1058
|
+
- in: query
|
|
1059
|
+
name: stopIds
|
|
1060
|
+
required: true
|
|
1061
|
+
schema:
|
|
1062
|
+
type: array
|
|
1063
|
+
items:
|
|
1064
|
+
type: string
|
|
1065
|
+
example: ["{\"0\": [\"U717Z5P\"]}", "{\"1\": [\"U718Z5P\", \"U719Z5P\"]}"]
|
|
1066
|
+
description: "Groups of stop IDs formatted as JSON (index/priority -> stop IDs). For example ?stopIds[]={\"0\": [\"U717Z5P\"]}&stopIds[]={\"1\": [\"U718Z5P\", \"U719Z5P\"]}. Maximum is 10 groups with a maximum of 10 stop IDs in each group."
|
|
1067
|
+
- in: query
|
|
1068
|
+
name: limit
|
|
1069
|
+
required: false
|
|
1070
|
+
schema:
|
|
1071
|
+
type: integer
|
|
1072
|
+
description: Limit for each group of departures. Default is 5. Maximum is 20.
|
|
1073
|
+
example: 5
|
|
1074
|
+
- in: query
|
|
1075
|
+
name: routeShortNames
|
|
1076
|
+
required: false
|
|
1077
|
+
schema:
|
|
1078
|
+
type: array
|
|
1079
|
+
items:
|
|
1080
|
+
type: string
|
|
1081
|
+
example: ["27"]
|
|
1082
|
+
description: Default is null
|
|
1083
|
+
- in: query
|
|
1084
|
+
name: minutesAfter
|
|
1085
|
+
required: false
|
|
1086
|
+
schema:
|
|
1087
|
+
type: integer
|
|
1088
|
+
minimum: 0
|
|
1089
|
+
maximum: 360
|
|
1090
|
+
description: Default is 60. Maximum is 360 (6 hours)
|
|
1091
|
+
example: 60
|
|
1092
|
+
responses:
|
|
1093
|
+
200:
|
|
1094
|
+
description: OK
|
|
1095
|
+
content:
|
|
1096
|
+
application/json:
|
|
1097
|
+
schema:
|
|
1098
|
+
type: array
|
|
1099
|
+
items:
|
|
1100
|
+
$ref: "#/components/schemas/PublicDepartureGroup"
|
|
1101
|
+
|
|
1102
|
+
400:
|
|
1103
|
+
$ref: "#/components/responses/BadRequestError"
|
|
1104
|
+
401:
|
|
1105
|
+
$ref: "#/components/responses/UnauthorizedError"
|
|
1106
|
+
404:
|
|
1107
|
+
description: Not found - no departures found for the given query parameters
|
|
1108
|
+
content:
|
|
1109
|
+
application/json:
|
|
1110
|
+
schema:
|
|
1111
|
+
type: array
|
|
1112
|
+
items:
|
|
1113
|
+
type: array
|
|
1114
|
+
maxItems: 0
|
|
1115
|
+
items:
|
|
1116
|
+
type: object
|
|
1117
|
+
|
|
1049
1118
|
|
|
1050
1119
|
|
|
1051
1120
|
components:
|
|
1052
1121
|
responses:
|
|
1122
|
+
BadRequestError:
|
|
1123
|
+
description: Bad request - invalid query parameters
|
|
1124
|
+
content:
|
|
1125
|
+
application/json:
|
|
1126
|
+
schema:
|
|
1127
|
+
type: object
|
|
1128
|
+
properties:
|
|
1129
|
+
error_message:
|
|
1130
|
+
type: string
|
|
1131
|
+
example: "Bad request"
|
|
1132
|
+
nullable: false
|
|
1133
|
+
error_status:
|
|
1134
|
+
type: integer
|
|
1135
|
+
example: 400
|
|
1136
|
+
nullable: false
|
|
1137
|
+
error_info:
|
|
1138
|
+
type: string
|
|
1139
|
+
example: "{...}"
|
|
1140
|
+
nullable: true
|
|
1141
|
+
required:
|
|
1142
|
+
- error_message
|
|
1143
|
+
- error_status
|
|
1144
|
+
|
|
1053
1145
|
UnauthorizedError:
|
|
1054
1146
|
description: API key is missing or invalid
|
|
1055
1147
|
headers:
|
|
1056
1148
|
WWW_Authenticate:
|
|
1057
1149
|
schema:
|
|
1058
1150
|
type: string
|
|
1151
|
+
content:
|
|
1152
|
+
application/json:
|
|
1153
|
+
schema:
|
|
1154
|
+
type: object
|
|
1155
|
+
properties:
|
|
1156
|
+
error_message:
|
|
1157
|
+
type: string
|
|
1158
|
+
example: "Unauthorized. Failed to authenticate user."
|
|
1159
|
+
nullable: false
|
|
1160
|
+
error_status:
|
|
1161
|
+
type: integer
|
|
1162
|
+
example: 401
|
|
1163
|
+
nullable: false
|
|
1164
|
+
required:
|
|
1165
|
+
- error_message
|
|
1166
|
+
- error_status
|
|
1167
|
+
|
|
1059
1168
|
|
|
1060
1169
|
schemas:
|
|
1061
1170
|
GTFSService:
|
|
@@ -2301,3 +2410,127 @@ components:
|
|
|
2301
2410
|
type: string
|
|
2302
2411
|
enum:
|
|
2303
2412
|
- Point
|
|
2413
|
+
|
|
2414
|
+
PublicDepartureGroup:
|
|
2415
|
+
type: array
|
|
2416
|
+
items:
|
|
2417
|
+
type: object
|
|
2418
|
+
properties:
|
|
2419
|
+
departure:
|
|
2420
|
+
$ref: "#/components/schemas/PublicDeparture"
|
|
2421
|
+
stop:
|
|
2422
|
+
$ref: "#/components/schemas/PublicDepartureStop"
|
|
2423
|
+
route:
|
|
2424
|
+
$ref: "#/components/schemas/PublicDepartureRoute"
|
|
2425
|
+
trip:
|
|
2426
|
+
$ref: "#/components/schemas/PublicDepartureTrip"
|
|
2427
|
+
vehicle:
|
|
2428
|
+
$ref: "#/components/schemas/PublicDepartureVehicle"
|
|
2429
|
+
required:
|
|
2430
|
+
- departure
|
|
2431
|
+
- stop
|
|
2432
|
+
- route
|
|
2433
|
+
- trip
|
|
2434
|
+
- vehicle
|
|
2435
|
+
|
|
2436
|
+
PublicDeparture:
|
|
2437
|
+
type: object
|
|
2438
|
+
properties:
|
|
2439
|
+
timestamp_scheduled:
|
|
2440
|
+
type: string
|
|
2441
|
+
format: date-time
|
|
2442
|
+
example: "2024-04-05T16:09:00+02:00"
|
|
2443
|
+
nullable: false
|
|
2444
|
+
timestamp_predicted:
|
|
2445
|
+
type: string
|
|
2446
|
+
format: date-time
|
|
2447
|
+
example: "2024-04-05T16:09:16+02:00"
|
|
2448
|
+
nullable: false
|
|
2449
|
+
delay_seconds:
|
|
2450
|
+
type: number
|
|
2451
|
+
description: Delay in seconds
|
|
2452
|
+
example: 0
|
|
2453
|
+
nullable: true
|
|
2454
|
+
minutes:
|
|
2455
|
+
type: number
|
|
2456
|
+
description: Minutes until the departure
|
|
2457
|
+
example: 0
|
|
2458
|
+
nullable: false
|
|
2459
|
+
required:
|
|
2460
|
+
- timestamp_scheduled
|
|
2461
|
+
- timestamp_predicted
|
|
2462
|
+
- minutes
|
|
2463
|
+
|
|
2464
|
+
PublicDepartureStop:
|
|
2465
|
+
type: object
|
|
2466
|
+
properties:
|
|
2467
|
+
id:
|
|
2468
|
+
type: string
|
|
2469
|
+
example: "U717Z5P" # Strossmayerovo náměstí
|
|
2470
|
+
nullable: false
|
|
2471
|
+
sequence:
|
|
2472
|
+
type: number
|
|
2473
|
+
example: 8
|
|
2474
|
+
nullable: false
|
|
2475
|
+
platform_code:
|
|
2476
|
+
type: string
|
|
2477
|
+
example: "E"
|
|
2478
|
+
nullable: true
|
|
2479
|
+
required:
|
|
2480
|
+
- id
|
|
2481
|
+
- sequence
|
|
2482
|
+
|
|
2483
|
+
PublicDepartureRoute:
|
|
2484
|
+
type: object
|
|
2485
|
+
properties:
|
|
2486
|
+
type:
|
|
2487
|
+
type: string
|
|
2488
|
+
example: "tram"
|
|
2489
|
+
enum: ["tram", "metro", "train", "bus", "ferry", "funicular", "trolleybus", "ext_miscellaneous"]
|
|
2490
|
+
nullable: false
|
|
2491
|
+
short_name:
|
|
2492
|
+
type: string
|
|
2493
|
+
example: "27"
|
|
2494
|
+
nullable: false
|
|
2495
|
+
required:
|
|
2496
|
+
- type
|
|
2497
|
+
- short_name
|
|
2498
|
+
|
|
2499
|
+
PublicDepartureTrip:
|
|
2500
|
+
type: object
|
|
2501
|
+
properties:
|
|
2502
|
+
id:
|
|
2503
|
+
type: string
|
|
2504
|
+
example: "27_3206_240318"
|
|
2505
|
+
nullable: false
|
|
2506
|
+
headsign:
|
|
2507
|
+
type: string
|
|
2508
|
+
example: "Libuš"
|
|
2509
|
+
nullable: false
|
|
2510
|
+
is_canceled:
|
|
2511
|
+
type: boolean
|
|
2512
|
+
example: false
|
|
2513
|
+
nullable: true
|
|
2514
|
+
required:
|
|
2515
|
+
- id
|
|
2516
|
+
- headsign
|
|
2517
|
+
|
|
2518
|
+
PublicDepartureVehicle:
|
|
2519
|
+
type: object
|
|
2520
|
+
properties:
|
|
2521
|
+
id:
|
|
2522
|
+
type: string
|
|
2523
|
+
example: "service-0-9072"
|
|
2524
|
+
nullable: true
|
|
2525
|
+
is_wheelchair_accessible:
|
|
2526
|
+
type: boolean
|
|
2527
|
+
example: true
|
|
2528
|
+
nullable: true
|
|
2529
|
+
is_air_conditioned:
|
|
2530
|
+
type: boolean
|
|
2531
|
+
example: false
|
|
2532
|
+
nullable: true
|
|
2533
|
+
has_charger:
|
|
2534
|
+
type: boolean
|
|
2535
|
+
example: true
|
|
2536
|
+
nullable: true
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PublicRouter.js","sourceRoot":"","sources":["../../../../../src/output-gateway/public/routers/v1/PublicRouter.ts"],"names":[],"mappings":";;;AAAA,4GAA8G;AAC9G,qCAAsD;AACtD,2DAA6D;AAE7D,6EAA2E;AAC3E,+DAA2D;AAC3D,mFAA2E;AAC3E,yEAAsE;AACtE,uEAAoE;AAEpE,MAAa,YAAY;IAKrB;QACI,IAAI,CAAC,MAAM,GAAG,IAAA,gBAAM,GAAE,CAAC;QACvB,IAAI,CAAC,0BAA0B,GAAG,IAAI,mEAAgC,EAAE,CAAC;QACzE,IAAI,CAAC,UAAU,EAAE,CAAC;QAClB,IAAI,CAAC,eAAe,GAAG,sBAAiB,CAAC,OAAO,CAAe,6BAAa,CAAC,YAAY,CAAC,CAAC;QAC3F,IAAI,CAAC,eAAe,CAAC,UAAU,EAAE,CAAC;IACtC,CAAC;IAES,UAAU,CAAC,MAAoC;QACrD,IAAI,CAAC,MAAM,CAAC,GAAG,CACX,mBAAmB,EACnB;YACI,IAAA,yBAAK,EAAC,aAAa,CAAC;iBACf,QAAQ,EAAE;iBACV,OAAO,CAAC,4BAA4B,CAAC,CAAC,8BAA8B;iBACpE,GAAG,EAAE;iBACL,OAAO,EAAE;YACd,IAAA,yBAAK,EAAC,gBAAgB,CAAC,CAAC,QAAQ,EAAE,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,EAAE,iBAAiB,EAAE,IAAI,EAAE,CAAC;YAC7E,IAAA,yBAAK,EAAC,WAAW,CAAC,CAAC,QAAQ,EAAE,CAAC,MAAM,CAAC,yCAAmB,CAAC,QAAQ,CAAC;SACrE,EACD,wBAAW,EACX,IAAI,CAAC,0BAA0B,CAAC,MAAM,CACzC,CAAC;QAEF,IAAI,CAAC,MAAM,CAAC,GAAG,CACX,8BAA8B,EAC9B,CAAC,IAAA,yBAAK,EAAC,WAAW,CAAC,CAAC,MAAM,EAAE,EAAE,IAAA,yBAAK,EAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,2CAAoB,CAAC,QAAQ,CAAC,CAAC,EACpF,wBAAW,EACX,IAAI,CAAC,0BAA0B,CAAC,iBAAiB,CACpD,CAAC;IACN,CAAC;CACJ;AApCD,oCAoCC;AAED,MAAM,cAAc,GAAG,IAAI,YAAY,EAAE,CAAC,MAAM,CAAC;AAExC,wCAAc"}
|