@golemio/pid 5.4.2 → 5.4.3-dev.2278927547
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/00_clear_test_data.sql +1 -0
- package/db/example/03_ropidgtfs_dump.sql +43 -38
- package/db/example/14_nightDelays.sql +17 -8
- package/db/example/redis/publicDelayCompObjectMock.json +7 -0
- package/db/migrations/postgresql/20251229142106-use-gtfs-icons-in-transferboards.js +53 -0
- package/db/migrations/postgresql/20260119180905-add-precomputed-trip-connections.js +53 -0
- package/db/migrations/postgresql/sqls/20251229142106-use-gtfs-icons-in-transferboards-down.sql +1 -0
- package/db/migrations/postgresql/sqls/20251229142106-use-gtfs-icons-in-transferboards-up.sql +1 -0
- package/db/migrations/postgresql/sqls/20260119180905-add-precomputed-trip-connections-down.sql +72 -0
- package/db/migrations/postgresql/sqls/20260119180905-add-precomputed-trip-connections-up.sql +91 -0
- package/dist/integration-engine/ropid-gtfs/RopidGTFSStopTimesModel.d.ts +1 -0
- package/dist/integration-engine/ropid-gtfs/RopidGTFSStopTimesModel.js +8 -0
- package/dist/integration-engine/ropid-gtfs/RopidGTFSStopTimesModel.js.map +1 -1
- package/dist/integration-engine/ropid-gtfs/RopidGTFSTripsModel.d.ts +2 -0
- package/dist/integration-engine/ropid-gtfs/RopidGTFSTripsModel.js +4 -6
- package/dist/integration-engine/ropid-gtfs/RopidGTFSTripsModel.js.map +1 -1
- package/dist/integration-engine/ropid-gtfs/RopidGtfsFacade.d.ts +1 -0
- package/dist/integration-engine/ropid-gtfs/RopidGtfsFacade.js +2 -0
- package/dist/integration-engine/ropid-gtfs/RopidGtfsFacade.js.map +1 -1
- package/dist/integration-engine/ropid-gtfs/data-access/precomputed/DeparturesRepository.js +9 -1
- package/dist/integration-engine/ropid-gtfs/data-access/precomputed/DeparturesRepository.js.map +1 -1
- package/dist/integration-engine/ropid-gtfs/data-access/precomputed/TripConnectionsRepository.d.ts +6 -0
- package/dist/integration-engine/ropid-gtfs/data-access/precomputed/TripConnectionsRepository.js +46 -0
- package/dist/integration-engine/ropid-gtfs/data-access/precomputed/TripConnectionsRepository.js.map +1 -0
- package/dist/integration-engine/ropid-gtfs/data-access/precomputed/index.d.ts +1 -0
- package/dist/integration-engine/ropid-gtfs/data-access/precomputed/index.js +1 -0
- package/dist/integration-engine/ropid-gtfs/data-access/precomputed/index.js.map +1 -1
- package/dist/integration-engine/ropid-gtfs/facade/DeparturePresetsFacade.js +1 -1
- package/dist/integration-engine/ropid-gtfs/facade/DeparturePresetsFacade.js.map +1 -1
- package/dist/integration-engine/ropid-gtfs/interfaces/IPublicDepartureDto.d.ts +5 -0
- package/dist/integration-engine/ropid-gtfs/interfaces/TripModelInterfaces.d.ts +1 -0
- package/dist/integration-engine/ropid-gtfs/transformations/PublicDepartureCacheTransformation.js +5 -0
- package/dist/integration-engine/ropid-gtfs/transformations/PublicDepartureCacheTransformation.js.map +1 -1
- package/dist/integration-engine/ropid-gtfs/transformations/RopidDeparturesPresetsTransformation.d.ts +3 -7
- package/dist/integration-engine/ropid-gtfs/transformations/RopidDeparturesPresetsTransformation.js +3 -9
- package/dist/integration-engine/ropid-gtfs/transformations/RopidDeparturesPresetsTransformation.js.map +1 -1
- package/dist/integration-engine/ropid-gtfs/transformations/RopidGTFSCisStopsTransformation.d.ts +3 -8
- package/dist/integration-engine/ropid-gtfs/transformations/RopidGTFSCisStopsTransformation.js +19 -26
- package/dist/integration-engine/ropid-gtfs/transformations/RopidGTFSCisStopsTransformation.js.map +1 -1
- package/dist/integration-engine/ropid-gtfs/transformations/RopidGTFSOisTransformation.d.ts +3 -7
- package/dist/integration-engine/ropid-gtfs/transformations/RopidGTFSOisTransformation.js +5 -14
- package/dist/integration-engine/ropid-gtfs/transformations/RopidGTFSOisTransformation.js.map +1 -1
- package/dist/integration-engine/ropid-gtfs/transformations/RopidGTFSTransformation.d.ts +3 -4
- package/dist/integration-engine/ropid-gtfs/transformations/RopidGTFSTransformation.js +6 -6
- package/dist/integration-engine/ropid-gtfs/transformations/RopidGTFSTransformation.js.map +1 -1
- package/dist/integration-engine/ropid-gtfs/workers/presets/tasks/CollectAndSaveLogsTask.js +1 -1
- package/dist/integration-engine/ropid-gtfs/workers/presets/tasks/CollectAndSaveLogsTask.js.map +1 -1
- package/dist/integration-engine/ropid-gtfs/workers/presets/transformations/PresetLogTransformation.d.ts +3 -5
- package/dist/integration-engine/ropid-gtfs/workers/presets/transformations/PresetLogTransformation.js +3 -13
- package/dist/integration-engine/ropid-gtfs/workers/presets/transformations/PresetLogTransformation.js.map +1 -1
- package/dist/integration-engine/ropid-gtfs/workers/presets/transformations/interfaces/IPresetLogTransformation.d.ts +2 -4
- package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/helpers/HelperTypes.d.ts +15 -3
- package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/helpers/HelperTypes.js.map +1 -1
- package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/helpers/PrecomputedTablesFacade.d.ts +1 -0
- package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/helpers/PrecomputedTablesFacade.js +4 -0
- package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/helpers/PrecomputedTablesFacade.js.map +1 -1
- package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/helpers/RopidGtfsFactory.d.ts +1 -1
- package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/helpers/RopidGtfsFactory.js +13 -4
- package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/helpers/RopidGtfsFactory.js.map +1 -1
- package/dist/integration-engine/ropid-vymi/RopidVYMIEventsTransformation.d.ts +4 -4
- package/dist/integration-engine/ropid-vymi/RopidVYMIEventsTransformation.js +9 -15
- package/dist/integration-engine/ropid-vymi/RopidVYMIEventsTransformation.js.map +1 -1
- package/dist/integration-engine/ropid-vymi/workers/tasks/FetchAndProcessEventsTask.js +1 -1
- package/dist/integration-engine/ropid-vymi/workers/tasks/FetchAndProcessEventsTask.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/workers/gtfs-rt/transformations/AlertsTransformation.d.ts +3 -3
- package/dist/integration-engine/vehicle-positions/workers/gtfs-rt/transformations/AlertsTransformation.js +4 -8
- package/dist/integration-engine/vehicle-positions/workers/gtfs-rt/transformations/AlertsTransformation.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/workers/runs/tasks/ProcessMetroRunMessagesTask.js +1 -1
- package/dist/integration-engine/vehicle-positions/workers/runs/tasks/ProcessMetroRunMessagesTask.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/workers/runs/tasks/SaveBusRunsToDBTask.js +1 -1
- package/dist/integration-engine/vehicle-positions/workers/runs/tasks/SaveBusRunsToDBTask.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/workers/runs/tasks/SaveMetroRunsToDBTask.js +1 -1
- package/dist/integration-engine/vehicle-positions/workers/runs/tasks/SaveMetroRunsToDBTask.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/workers/runs/tasks/SaveTramRunsToDBTask.js +1 -1
- package/dist/integration-engine/vehicle-positions/workers/runs/tasks/SaveTramRunsToDBTask.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/workers/runs/transformations/CommonRunsMessagesTransformation.d.ts +5 -7
- package/dist/integration-engine/vehicle-positions/workers/runs/transformations/CommonRunsMessagesTransformation.js +11 -10
- package/dist/integration-engine/vehicle-positions/workers/runs/transformations/CommonRunsMessagesTransformation.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/workers/runs/transformations/MetroRunsMessageProcessingTransformation.d.ts +3 -4
- package/dist/integration-engine/vehicle-positions/workers/runs/transformations/MetroRunsMessageProcessingTransformation.js +3 -4
- package/dist/integration-engine/vehicle-positions/workers/runs/transformations/MetroRunsMessageProcessingTransformation.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/workers/runs/transformations/MetroRunsMessagesTransformation.d.ts +4 -4
- package/dist/integration-engine/vehicle-positions/workers/runs/transformations/MetroRunsMessagesTransformation.js +6 -10
- package/dist/integration-engine/vehicle-positions/workers/runs/transformations/MetroRunsMessagesTransformation.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/workers/vehicle-descriptors/tasks/RefreshDescriptorsTask.js +1 -1
- package/dist/integration-engine/vehicle-positions/workers/vehicle-descriptors/tasks/RefreshDescriptorsTask.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/workers/vehicle-descriptors/transformations/DescriptorTransformation.d.ts +3 -4
- package/dist/integration-engine/vehicle-positions/workers/vehicle-descriptors/transformations/DescriptorTransformation.js +3 -13
- package/dist/integration-engine/vehicle-positions/workers/vehicle-descriptors/transformations/DescriptorTransformation.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/data-access/TripsRepository.d.ts +1 -0
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/data-access/TripsRepository.js +13 -0
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/data-access/TripsRepository.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/tasks/SaveDataToDBTask.js +1 -1
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/tasks/SaveDataToDBTask.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/transformations/MpvMessageTransformation.d.ts +4 -7
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/transformations/MpvMessageTransformation.js +20 -27
- package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/transformations/MpvMessageTransformation.js.map +1 -1
- package/dist/output-gateway/pid/controllers/v4/V4TransferBoardsController.js +1 -3
- package/dist/output-gateway/pid/controllers/v4/V4TransferBoardsController.js.map +1 -1
- package/dist/output-gateway/pid/helpers/TransferBoardIconsResolver.d.ts +1 -3
- package/dist/output-gateway/pid/helpers/TransferBoardIconsResolver.js +5 -33
- package/dist/output-gateway/pid/helpers/TransferBoardIconsResolver.js.map +1 -1
- package/dist/output-gateway/pid/interfaces/IV4TransferDto.d.ts +4 -1
- package/dist/output-gateway/pid/service/facade/TransferFacade.js +2 -1
- package/dist/output-gateway/pid/service/facade/TransferFacade.js.map +1 -1
- package/dist/output-gateway/pid/service/transformations/TransferDepartureCacheTransformation.d.ts +1 -1
- package/dist/output-gateway/pid/service/transformations/TransferDepartureCacheTransformation.js +2 -1
- package/dist/output-gateway/pid/service/transformations/TransferDepartureCacheTransformation.js.map +1 -1
- package/dist/output-gateway/public/service/transformations/scopes/PublicVPTripStopTimesTransformation.js.map +1 -1
- package/dist/schema-definitions/ropid-gtfs/RopidGTFSPrecomputed.d.ts +32 -0
- package/dist/schema-definitions/ropid-gtfs/RopidGTFSPrecomputed.js +34 -0
- package/dist/schema-definitions/ropid-gtfs/RopidGTFSPrecomputed.js.map +1 -1
- package/dist/schema-definitions/ropid-gtfs/models/precomputed/DeparturesModel.d.ts +2 -0
- package/dist/schema-definitions/ropid-gtfs/models/precomputed/DeparturesModel.js +17 -0
- package/dist/schema-definitions/ropid-gtfs/models/precomputed/DeparturesModel.js.map +1 -1
- package/dist/schema-definitions/ropid-gtfs/models/precomputed/interfaces/IDeparturesModel.d.ts +6 -0
- package/dist/schema-definitions/ropid-gtfs/redis/interfaces/IDelayComputationDto.d.ts +1 -0
- package/dist/schema-definitions/ropid-gtfs/redis/interfaces/IPublicGtfsDepartureCacheDto.d.ts +5 -0
- package/dist/schema-definitions/ropid-gtfs/redis/schemas/DelayComputationDtoSchema.js +2 -0
- package/dist/schema-definitions/ropid-gtfs/redis/schemas/DelayComputationDtoSchema.js.map +1 -1
- package/dist/schema-definitions/ropid-gtfs/redis/schemas/PublicGtfsDepartureDtoSchema.js +31 -0
- package/dist/schema-definitions/ropid-gtfs/redis/schemas/PublicGtfsDepartureDtoSchema.js.map +1 -1
- package/docs/assets/pid_precomputed_erd.png +0 -0
- package/docs/assets/pid_preset_logs_and_static_erd.png +0 -0
- package/docs/implementation_documentation.md +4 -4
- package/docs/openapi-output.yaml +2 -0
- package/package.json +2 -2
- package/docs/assets/pid_preset_logs_erd.png +0 -0
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { IModel, PostgresModel } from "@golemio/core/dist/integration-engine/models";
|
|
2
|
+
import Sequelize from "@golemio/core/dist/shared/sequelize";
|
|
2
3
|
import { ITripWithShapesAndStopTimes } from "./interfaces/TripModelInterfaces";
|
|
3
4
|
export declare class RopidGTFSTripsModel extends PostgresModel implements IModel {
|
|
4
5
|
private modelGTFSShapes;
|
|
5
6
|
private modelGTFSStopTimes;
|
|
6
7
|
private modelGTFSStops;
|
|
8
|
+
get publicSequelizeModel(): Sequelize.ModelCtor<any>;
|
|
7
9
|
constructor();
|
|
8
10
|
findByIdForDelayComputation: (tripId: string) => Promise<ITripWithShapesAndStopTimes | null>;
|
|
9
11
|
}
|
|
@@ -14,6 +14,9 @@ const RopidGTFSShapesModel_1 = require("./RopidGTFSShapesModel");
|
|
|
14
14
|
const RopidGTFSStopsModel_1 = require("./RopidGTFSStopsModel");
|
|
15
15
|
const RopidGTFSStopTimesModel_1 = require("./RopidGTFSStopTimesModel");
|
|
16
16
|
class RopidGTFSTripsModel extends models_1.PostgresModel {
|
|
17
|
+
get publicSequelizeModel() {
|
|
18
|
+
return this.sequelizeModel;
|
|
19
|
+
}
|
|
17
20
|
constructor() {
|
|
18
21
|
super(ropid_gtfs_1.RopidGTFS.trips.name + "Model", {
|
|
19
22
|
outputSequelizeAttributes: ropid_gtfs_1.RopidGTFS.trips.outputSequelizeAttributes,
|
|
@@ -39,6 +42,7 @@ class RopidGTFSTripsModel extends models_1.PostgresModel {
|
|
|
39
42
|
sequelize_1.default.literal(`CASE when drop_off_type = '1' and pickup_type = '1' then true else false END`),
|
|
40
43
|
"is_no_stop_waypoint",
|
|
41
44
|
],
|
|
45
|
+
"stop_icons",
|
|
42
46
|
],
|
|
43
47
|
as: "stop_times",
|
|
44
48
|
model: this.modelGTFSStopTimes.sequelizeModel,
|
|
@@ -77,12 +81,6 @@ class RopidGTFSTripsModel extends models_1.PostgresModel {
|
|
|
77
81
|
sourceKey: "trip_id",
|
|
78
82
|
constraints: false,
|
|
79
83
|
});
|
|
80
|
-
this.modelGTFSStopTimes.sequelizeModel.hasOne(this.modelGTFSStops.sequelizeModel, {
|
|
81
|
-
as: "stop",
|
|
82
|
-
foreignKey: "stop_id",
|
|
83
|
-
sourceKey: "stop_id",
|
|
84
|
-
constraints: false,
|
|
85
|
-
});
|
|
86
84
|
this.sequelizeModel.hasMany(this.modelGTFSShapes.sequelizeModel, {
|
|
87
85
|
as: "shapes",
|
|
88
86
|
foreignKey: "shape_id",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RopidGTFSTripsModel.js","sourceRoot":"","sources":["../../../src/integration-engine/ropid-gtfs/RopidGTFSTripsModel.ts"],"names":[],"mappings":";;;;;;AAAA,0DAAuC;AACvC,oEAA4C;AAC5C,gFAAyD;AACzD,yEAAqF;AACrF,mFAAkF;AAClF,oFAA4D;AAE5D,iEAA8D;AAC9D,+DAA4D;AAC5D,uEAAoE;AAEpE,MAAa,mBAAoB,SAAQ,sBAAa;IAKlD;QACI,KAAK,CACD,sBAAS,CAAC,KAAK,CAAC,IAAI,GAAG,OAAO,EAC9B;YACI,yBAAyB,EAAE,sBAAS,CAAC,KAAK,CAAC,yBAAyB;YACpE,WAAW,EAAE,sBAAS,CAAC,KAAK,CAAC,WAAW;YACxC,QAAQ,EAAE,iBAAS;YACnB,UAAU,EAAE,YAAY;SAC3B,EACD,IAAI,uCAAmB,CAAC,sBAAS,CAAC,KAAK,CAAC,IAAI,GAAG,gBAAgB,EAAE,iBAAO,CAAC,UAAU,CAAC,CACvF,CAAC;
|
|
1
|
+
{"version":3,"file":"RopidGTFSTripsModel.js","sourceRoot":"","sources":["../../../src/integration-engine/ropid-gtfs/RopidGTFSTripsModel.ts"],"names":[],"mappings":";;;;;;AAAA,0DAAuC;AACvC,oEAA4C;AAC5C,gFAAyD;AACzD,yEAAqF;AACrF,mFAAkF;AAClF,oFAA4D;AAE5D,iEAA8D;AAC9D,+DAA4D;AAC5D,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|
11
11
|
private name;
|
|
12
12
|
/** Precomputed data repositories */
|
|
13
13
|
private minMaxStopSequencesRepository;
|
|
14
|
+
private tripConnectionsRepository;
|
|
14
15
|
private tripScheduleRepository;
|
|
15
16
|
private servicesCalendarRepository;
|
|
16
17
|
constructor(ropidGtfsRepository: RopidGtfsRepository, ropidGtfsMetadataRepository: RopidGtfsMetadataRepository, departureRepository: DeparturesRepository, databaseConnector: IDatabaseConnector);
|
|
@@ -115,11 +115,13 @@ let RopidGtfsFacade = class RopidGtfsFacade {
|
|
|
115
115
|
await this.ropidGtfsRepository.replaceAllTable([
|
|
116
116
|
this.servicesCalendarRepository["tableName"],
|
|
117
117
|
this.minMaxStopSequencesRepository["tableName"],
|
|
118
|
+
this.tripConnectionsRepository["tableName"],
|
|
118
119
|
this.tripScheduleRepository["tableName"],
|
|
119
120
|
], t);
|
|
120
121
|
await this.departureRepository.replaceByTmp(t);
|
|
121
122
|
};
|
|
122
123
|
this.minMaxStopSequencesRepository = new precomputed_1.MinMaxStopSequencesRepository();
|
|
124
|
+
this.tripConnectionsRepository = new precomputed_1.TripConnectionsRepository();
|
|
123
125
|
this.tripScheduleRepository = new precomputed_1.TripScheduleRepository();
|
|
124
126
|
this.servicesCalendarRepository = new precomputed_1.ServicesCalendarRepository();
|
|
125
127
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RopidGtfsFacade.js","sourceRoot":"","sources":["../../../src/integration-engine/ropid-gtfs/RopidGtfsFacade.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"RopidGtfsFacade.js","sourceRoot":"","sources":["../../../src/integration-engine/ropid-gtfs/RopidGtfsFacade.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,2DAMgD;AAChD,sCAAiF;AACjF,0DAAuC;AACvC,oEAA8D;AAG9D,wEAAqE;AACrE,2EAAoE;AACpE,6EAAwE;AACxE,oFAAoF;AACpF,iEAAwE;A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AC,iBAAiB,CAAC,CAAA;qCAJ8C,yCAAmB;QAEhE,yDAA2B;QACkB,kCAAoB;GAZjG,eAAe,CA2H3B"}
|
|
@@ -70,7 +70,12 @@ let DeparturesRepository = class DeparturesRepository extends models_1.PostgresM
|
|
|
70
70
|
t6.stop_id AS next_stop_id,
|
|
71
71
|
t7.stop_sequence AS last_stop_sequence,
|
|
72
72
|
t7.stop_id AS last_stop_id,
|
|
73
|
-
cis_stop.cis AS cis_stop_group_id
|
|
73
|
+
cis_stop.cis AS cis_stop_group_id,
|
|
74
|
+
CASE
|
|
75
|
+
WHEN t.stop_headsign IS NOT NULL THEN t.headsign_icons
|
|
76
|
+
ELSE t2.headsign_icons
|
|
77
|
+
END AS trip_headsign_icons,
|
|
78
|
+
t8."connections" AS trip_connections
|
|
74
79
|
FROM ropidgtfs_stop_times${sourceTableSuffix} t
|
|
75
80
|
LEFT JOIN ropidgtfs_stops${sourceTableSuffix} t0 ON t.stop_id = t0.stop_id
|
|
76
81
|
LEFT JOIN ropidgtfs_trips${sourceTableSuffix} t2 ON t.trip_id = t2.trip_id
|
|
@@ -81,6 +86,7 @@ let DeparturesRepository = class DeparturesRepository extends models_1.PostgresM
|
|
|
81
86
|
LEFT JOIN ropidgtfs_stop_times${sourceTableSuffix} t6 ON t.trip_id = t6.trip_id AND t6.stop_sequence = t.stop_sequence + 1
|
|
82
87
|
LEFT JOIN ropidgtfs_stop_times${sourceTableSuffix} t7 ON t.trip_id = t7.trip_id AND t7.stop_sequence = t.stop_sequence - 1
|
|
83
88
|
LEFT JOIN ropidgtfs_cis_stops cis_stop on cis_stop.id = t0.computed_cis_stop_id
|
|
89
|
+
LEFT JOIN ropidgtfs_precomputed_trip_connections_tmp t8 ON t8.to_trip_id = t2.trip_id AND t8.to_stop_id = t.stop_id
|
|
84
90
|
${timeConstraintLiteral}`;
|
|
85
91
|
/* eslint-enable max-len */
|
|
86
92
|
try {
|
|
@@ -137,6 +143,8 @@ let DeparturesRepository = class DeparturesRepository extends models_1.PostgresM
|
|
|
137
143
|
"platform_code",
|
|
138
144
|
"trip_headsign",
|
|
139
145
|
"stop_headsign",
|
|
146
|
+
"trip_headsign_icons",
|
|
147
|
+
"trip_connections",
|
|
140
148
|
],
|
|
141
149
|
where: {
|
|
142
150
|
departure_datetime: {
|
package/dist/integration-engine/ropid-gtfs/data-access/precomputed/DeparturesRepository.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DeparturesRepository.js","sourceRoot":"","sources":["../../../../../src/integration-engine/ropid-gtfs/data-access/precomputed/DeparturesRepository.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,uEAA4D;AAG5D,gEAAuC;AACvC,8FAAqE;AAErE,wEAAqE;AAErE,yEAAqF;AACrF,6EAAwE;AACxE,mFAAkF;AAClF,mEAAiF;AACjF,iEAAwE;AACxE,+EAA4E;AAGrE,IAAM,oBAAoB,GAA1B,MAAM,oBAAqB,SAAQ,sBAAa;IACnD,YACoC,MAA6B,EACnC,MAAuB;QAEjD,KAAK,CACD,sBAAsB,EACtB;YACI,WAAW,EAAE,6BAAe,CAAC,UAAU;YACvC,QAAQ,EAAE,iBAAS;YACnB,yBAAyB,EAAE,6BAAe,CAAC,cAAc;YACzD,kBAAkB,EAAE,CAAC,IAAI,EAAE,YAAY,EAAE,YAAY,CAAC;YACtD,UAAU,EAAE,YAAY;SAC3B,EACD,IAAI,uCAAmB,CAAC,sBAAsB,EAAE,6BAAe,CAAC,UAAU,CAAC,CAC9E,CAAC;QAbsC,WAAM,GAAN,MAAM,CAAe;QAC3B,WAAM,GAAN,MAAM,CAAS;QAe9C,sBAAiB,GAAG,KAAK,EAAE,iBAAwC,EAAiB,EAAE;YACzF,MAAM,OAAO,GAAG,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,cAAc,EAAE,aAAa,CAAC,CAAC;YACpE,MAAM,qBAAqB,GACvB,OAAO,KAAK,MAAM,CAAC,CAAC,CAAC,4EAA4E,CAAC,CAAC,CAAC,EAAE,CAAC;YAE3G,4BAA4B;YAC5B,MAAM,GAAG,GAAG
|
|
1
|
+
{"version":3,"file":"DeparturesRepository.js","sourceRoot":"","sources":["../../../../../src/integration-engine/ropid-gtfs/data-access/precomputed/DeparturesRepository.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,uEAA4D;AAG5D,gEAAuC;AACvC,8FAAqE;AAErE,wEAAqE;AAErE,yEAAqF;AACrF,6EAAwE;AACxE,mFAAkF;AAClF,mEAAiF;AACjF,iEAAwE;AACxE,+EAA4E;AAGrE,IAAM,oBAAoB,GAA1B,MAAM,oBAAqB,SAAQ,sBAAa;IACnD,YACoC,MAA6B,EACnC,MAAuB;QAEjD,KAAK,CACD,sBAAsB,EACtB;YACI,WAAW,EAAE,6BAAe,CAAC,UAAU;YACvC,QAAQ,EAAE,iBAAS;YACnB,yBAAyB,EAAE,6BAAe,CAAC,cAAc;YACzD,kBAAkB,EAAE,CAAC,IAAI,EAAE,YAAY,EAAE,YAAY,CAAC;YACtD,UAAU,EAAE,YAAY;SAC3B,EACD,IAAI,uCAAmB,CAAC,sBAAsB,EAAE,6BAAe,CAAC,UAAU,CAAC,CAC9E,CAAC;QAbsC,WAAM,GAAN,MAAM,CAAe;QAC3B,WAAM,GAAN,MAAM,CAAS;QAe9C,sBAAiB,GAAG,KAAK,EAAE,iBAAwC,EAAiB,EAAE;YACzF,MAAM,OAAO,GAAG,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,cAAc,EAAE,aAAa,CAAC,CAAC;YACpE,MAAM,qBAAqB,GACvB,OAAO,KAAK,MAAM,CAAC,CAAC,CAAC,4EAA4E,CAAC,CAAC,CAAC,EAAE,CAAC;YAE3G,4BAA4B;YAC5B,MAAM,GAAG,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uCAsCmB,iBAAiB;2CACb,iBAAiB;2CACjB,iBAAiB;;;8CAGd,iBAAiB;4CACnB,iBAAiB;gDACb,iBAAiB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ConnectionsRepository.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { IModel, PostgresModel } from "@golemio/core/dist/integration-engine/models";
|
|
2
|
+
import { SourceTableSuffixEnum } from "../../helpers/SourceTableSuffixEnum";
|
|
3
|
+
export declare class TripConnectionsRepository extends PostgresModel implements IModel {
|
|
4
|
+
constructor();
|
|
5
|
+
populate: (sourceTableSuffix: SourceTableSuffixEnum) => Promise<void>;
|
|
6
|
+
}
|
package/dist/integration-engine/ropid-gtfs/data-access/precomputed/TripConnectionsRepository.js
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TripConnectionsRepository = void 0;
|
|
4
|
+
const const_1 = require("../../../../schema-definitions/const");
|
|
5
|
+
const ropid_gtfs_1 = require("../../../../schema-definitions/ropid-gtfs");
|
|
6
|
+
const helpers_1 = require("@golemio/core/dist/integration-engine/helpers");
|
|
7
|
+
const models_1 = require("@golemio/core/dist/integration-engine/models");
|
|
8
|
+
const golemio_validator_1 = require("@golemio/core/dist/shared/golemio-validator");
|
|
9
|
+
const SourceTableSuffixEnum_1 = require("../../helpers/SourceTableSuffixEnum");
|
|
10
|
+
class TripConnectionsRepository extends models_1.PostgresModel {
|
|
11
|
+
constructor() {
|
|
12
|
+
super("TripConnectionsRepository", {
|
|
13
|
+
outputSequelizeAttributes: ropid_gtfs_1.RopidGTFS.tripConnections.outputSequelizeAttributes,
|
|
14
|
+
pgTableName: ropid_gtfs_1.RopidGTFS.tripConnections.pgTableName,
|
|
15
|
+
pgSchema: const_1.PG_SCHEMA,
|
|
16
|
+
savingType: "insertOnly",
|
|
17
|
+
attributesToRemove: ["id", "created_at", "updated_at"],
|
|
18
|
+
}, new golemio_validator_1.JSONSchemaValidator("TripConnectionsRepositoryValidator", ropid_gtfs_1.RopidGTFS.tripConnections.outputJsonSchema));
|
|
19
|
+
this.populate = async (sourceTableSuffix) => {
|
|
20
|
+
const sql = `
|
|
21
|
+
SELECT
|
|
22
|
+
to_stop_id,
|
|
23
|
+
to_trip_id,
|
|
24
|
+
JSONB_AGG(
|
|
25
|
+
JSON_BUILD_OBJECT(
|
|
26
|
+
'from_trip_id', from_trip_id,
|
|
27
|
+
'max_wait_sec', max_waiting_time
|
|
28
|
+
)
|
|
29
|
+
) AS "connections"
|
|
30
|
+
FROM "${const_1.PG_SCHEMA}".ropidgtfs_transfers${sourceTableSuffix}
|
|
31
|
+
WHERE "transfer_type" = '1'
|
|
32
|
+
GROUP BY "to_stop_id", "to_trip_id"
|
|
33
|
+
`;
|
|
34
|
+
try {
|
|
35
|
+
const tmpTable = ropid_gtfs_1.RopidGTFS.tripConnections.pgTableName + SourceTableSuffixEnum_1.SourceTableSuffixEnum.Tmp;
|
|
36
|
+
await this.sequelizeModel.sequelize.query(`INSERT INTO "${const_1.PG_SCHEMA}"."${tmpTable}" ${sql};`);
|
|
37
|
+
}
|
|
38
|
+
catch (err) {
|
|
39
|
+
helpers_1.log.error(err);
|
|
40
|
+
throw err;
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
exports.TripConnectionsRepository = TripConnectionsRepository;
|
|
46
|
+
//# sourceMappingURL=TripConnectionsRepository.js.map
|
package/dist/integration-engine/ropid-gtfs/data-access/precomputed/TripConnectionsRepository.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TripConnectionsRepository.js","sourceRoot":"","sources":["../../../../../src/integration-engine/ropid-gtfs/data-access/precomputed/TripConnectionsRepository.ts"],"names":[],"mappings":";;;AAAA,gEAAuC;AACvC,0EAA4C;AAC5C,2EAAoE;AACpE,yEAAqF;AACrF,mFAAkF;AAClF,+EAA4E;AAE5E,MAAa,yBAA0B,SAAQ,sBAAa;IACxD;QACI,KAAK,CACD,2BAA2B,EAC3B;YACI,yBAAyB,EAAE,sBAAS,CAAC,eAAe,CAAC,yBAAyB;YAC9E,WAAW,EAAE,sBAAS,CAAC,eAAe,CAAC,WAAW;YAClD,QAAQ,EAAE,iBAAS;YACnB,UAAU,EAAE,YAAY;YACxB,kBAAkB,EAAE,CAAC,IAAI,EAAE,YAAY,EAAE,YAAY,CAAC;SACzD,EACD,IAAI,uCAAmB,CAAC,oCAAoC,EAAE,sBAAS,CAAC,eAAe,CAAC,gBAAgB,CAAC,CAC5G,CAAC;QAGC,aAAQ,GAAG,KAAK,EAAE,iBAAwC,EAAiB,EAAE;YAChF,MAAM,GAAG,GAAG;;;;;;;;;;oBAUA,iBAAS,wBAAwB,iBAAiB;;;SAG7D,CAAC;YAEF,IAAI,CAAC;gBACD,MAAM,QAAQ,GAAG,sBAAS,CAAC,eAAe,CAAC,WAAW,GAAG,6CAAqB,CAAC,GAAG,CAAC;gBAEnF,MAAM,IAAI,CAAC,cAAc,CAAC,SAAU,CAAC,KAAK,CAAC,gBAAgB,iBAAS,MAAM,QAAQ,KAAK,GAAG,GAAG,CAAC,CAAC;YACnG,CAAC;YAAC,OAAO,GAAG,EAAE,CAAC;gBACX,aAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;gBACf,MAAM,GAAG,CAAC;YACd,CAAC;QACL,CAAC,CAAC;IA1BF,CAAC;CA2BJ;AAxCD,8DAwCC"}
|
|
@@ -18,4 +18,5 @@ __exportStar(require("./TripScheduleRepository"), exports);
|
|
|
18
18
|
__exportStar(require("./ServicesCalendarRepository"), exports);
|
|
19
19
|
__exportStar(require("./MinMaxStopSequencesRepository"), exports);
|
|
20
20
|
__exportStar(require("./DeparturesRepository"), exports);
|
|
21
|
+
__exportStar(require("./TripConnectionsRepository"), exports);
|
|
21
22
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/integration-engine/ropid-gtfs/data-access/precomputed/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2DAAyC;AACzC,+DAA6C;AAC7C,kEAAgD;AAChD,yDAAuC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/integration-engine/ropid-gtfs/data-access/precomputed/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2DAAyC;AACzC,+DAA6C;AAC7C,kEAAgD;AAChD,yDAAuC;AACvC,8DAA4C"}
|
|
@@ -43,7 +43,7 @@ let DeparturePresetsFacade = class DeparturePresetsFacade {
|
|
|
43
43
|
value: lastModified,
|
|
44
44
|
version: dbLastModified.version + 1,
|
|
45
45
|
});
|
|
46
|
-
const transformedData =
|
|
46
|
+
const transformedData = this.transformationDeparturesPresets.transformArray(data);
|
|
47
47
|
await this.metadataRepository.save({
|
|
48
48
|
dataset: DatasetEnum_1.DatasetEnum.DEPARTURES_PRESETS,
|
|
49
49
|
key: "departuresPresets",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DeparturePresetsFacade.js","sourceRoot":"","sources":["../../../../src/integration-engine/ropid-gtfs/facade/DeparturePresetsFacade.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,oEAAyD;AACzD,yEAAoE;AACpE,0IAAqI;AACrI,wEAAoG;AAKpG,6FAA0F;AAC1F,iEAAwE;AACxE,gEAA6D;AAC7D,gFAA6E;AAC7E,0FAAuF;AACvF,wDAAqD;AACrD,4EAAyE;AACzE,kHAA+G;AAGxG,IAAM,sBAAsB,GAA5B,MAAM,sBAAsB;IAC/B,YACyE,kBAA+C,EACvD,mBAAwC,EACpC,0BAAsD,EAE/G,8CAA8F,EAE9F,+BAAqE,EACtC,MAAe;QAPe,uBAAkB,GAAlB,kBAAkB,CAA6B;QACvD,wBAAmB,GAAnB,mBAAmB,CAAqB;QACpC,+BAA0B,GAA1B,0BAA0B,CAA4B;QAE/G,mDAA8C,GAA9C,8CAA8C,CAAgD;QAE9F,oCAA+B,GAA/B,+BAA+B,CAAsC;QACtC,WAAM,GAAN,MAAM,CAAS;IACvD,CAAC;IAEG,KAAK,CAAC,yBAAyB,CAAC,IAA8B,EAAE,YAAoB;QACvF,MAAM,cAAc,GAAG,MAAM,IAAI,CAAC,kBAAkB,CAAC,eAAe,CAAC,yBAAW,CAAC,kBAAkB,CAAC,CAAC;QACrG,MAAM,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC;YAC/B,OAAO,EAAE,yBAAW,CAAC,kBAAkB;YACvC,GAAG,EAAE,2CAAsB,CAAC,aAAa;YACzC,IAAI,EAAE,iCAAY,CAAC,YAAY;YAC/B,KAAK,EAAE,YAAY;YACnB,OAAO,EAAE,cAAc,CAAC,OAAO,GAAG,CAAC;SACtC,CAAC,CAAC;QAEH,MAAM,eAAe,GAAG,
|
|
1
|
+
{"version":3,"file":"DeparturePresetsFacade.js","sourceRoot":"","sources":["../../../../src/integration-engine/ropid-gtfs/facade/DeparturePresetsFacade.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,oEAAyD;AACzD,yEAAoE;AACpE,0IAAqI;AACrI,wEAAoG;AAKpG,6FAA0F;AAC1F,iEAAwE;AACxE,gEAA6D;AAC7D,gFAA6E;AAC7E,0FAAuF;AACvF,wDAAqD;AACrD,4EAAyE;AACzE,kHAA+G;AAGxG,IAAM,sBAAsB,GAA5B,MAAM,sBAAsB;IAC/B,YACyE,kBAA+C,EACvD,mBAAwC,EACpC,0BAAsD,EAE/G,8CAA8F,EAE9F,+BAAqE,EACtC,MAAe;QAPe,uBAAkB,GAAlB,kBAAkB,CAA6B;QACvD,wBAAmB,GAAnB,mBAAmB,CAAqB;QACpC,+BAA0B,GAA1B,0BAA0B,CAA4B;QAE/G,mDAA8C,GAA9C,8CAA8C,CAAgD;QAE9F,oCAA+B,GAA/B,+BAA+B,CAAsC;QACtC,WAAM,GAAN,MAAM,CAAS;IACvD,CAAC;IAEG,KAAK,CAAC,yBAAyB,CAAC,IAA8B,EAAE,YAAoB;QACvF,MAAM,cAAc,GAAG,MAAM,IAAI,CAAC,kBAAkB,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KAAK,CAAC,EAAE,CAAC;oBACrB,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,WAAW,EAAE,0CAA0C,CAAC,CAAC;oBAC1E,SAAS;gBACb,CAAC;gBAED,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;oBACvB,0BAA0B,CAAC,IAAI,CAAC,EAAE,SAAS,EAAE,MAAM,CAAC,EAAE,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC;gBACrF,CAAC;YACL,CAAC;QACL,CAAC;QAED,OAAO,0BAA0B,CAAC;IACtC,CAAC;CACJ,CAAA;AArFY,wDAAsB;iCAAtB,sBAAsB;IADlC,IAAA,qBAAU,GAAE;IAGJ,WAAA,IAAA,iBAAM,EAAC,iDAAuB,CAAC,2BAA2B,CAAC,CAAA;IAC3D,WAAA,IAAA,iBAAM,EAAC,iDAAuB,CAAC,mBAAmB,CAAC,CAAA;IACnD,WAAA,IAAA,iBAAM,EAAC,2CAAoB,CAAC,0BAA0B,CAAC,CAAA;IACvD,WAAA,IAAA,iBAAM,EAAC,iDAAuB,CAAC,8CAA8C,CAAC,CAAA;IAE9E,WAAA,IAAA,iBAAM,EAAC,2CAAoB,CAAC,oCAAoC,CAAC,CAAA;IAEjE,WAAA,IAAA,iBAAM,EAAC,+BAAc,CAAC,MAAM,CAAC,CAAA;qCAP2D,yDAA2B;QAClC,yCAAmB;QACR,uDAA0B;QAE/D,+FAA8C;QAE7D,2EAAoC;GARxE,sBAAsB,CAqFlC"}
|
|
@@ -10,4 +10,9 @@ export interface IPublicDepartureDto {
|
|
|
10
10
|
platform_code: string | null;
|
|
11
11
|
trip_headsign: string;
|
|
12
12
|
stop_headsign: string | null;
|
|
13
|
+
trip_headsign_icons?: string | null;
|
|
14
|
+
trip_connections?: Array<{
|
|
15
|
+
from_trip_id: string;
|
|
16
|
+
max_wait_sec: number;
|
|
17
|
+
}> | null;
|
|
13
18
|
}
|
package/dist/integration-engine/ropid-gtfs/transformations/PublicDepartureCacheTransformation.js
CHANGED
|
@@ -24,6 +24,11 @@ let PublicDepartureCacheTransformation = class PublicDepartureCacheTransformatio
|
|
|
24
24
|
stop_sequence: inputDto.stop_sequence,
|
|
25
25
|
platform_code: inputDto.platform_code,
|
|
26
26
|
trip_headsign: inputDto.stop_headsign ?? inputDto.trip_headsign,
|
|
27
|
+
// TODO: One day, when we resolve issues around ajv's handling of undefined/null type unions,
|
|
28
|
+
// refactor this to only include the property if it's non-nullish, to save Valkey memory
|
|
29
|
+
// (see <https://golemiocz.slack.com/archives/C03H9T45QTA/p1767640758044149>).
|
|
30
|
+
trip_headsign_icons: inputDto.trip_headsign_icons ?? null,
|
|
31
|
+
connections: inputDto.trip_connections ?? null,
|
|
27
32
|
};
|
|
28
33
|
return outputDto;
|
|
29
34
|
};
|
package/dist/integration-engine/ropid-gtfs/transformations/PublicDepartureCacheTransformation.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PublicDepartureCacheTransformation.js","sourceRoot":"","sources":["../../../../src/integration-engine/ropid-gtfs/transformations/PublicDepartureCacheTransformation.ts"],"names":[],"mappings":";;;;;;;;;AACA,6GAA0G;AAC1G,iEAAgE;AAIzD,IAAM,kCAAkC,GAAxC,MAAM,kCAAmC,SAAQ,+CAGvD;IAHM;;QAII,SAAI,GAAG,oCAAoC,CAAC;QAEzC,sBAAiB,GAAG,CAAC,QAA6B,EAAE,EAAE;YAC5D,MAAM,SAAS,GAAiC;gBAC5C,OAAO,EAAE,QAAQ,CAAC,OAAO;gBACzB,kBAAkB,EAAE,QAAQ,CAAC,kBAAkB,CAAC,WAAW,EAAE;gBAC7D,gBAAgB,EAAE,QAAQ,CAAC,gBAAgB,EAAE,WAAW,EAAE,IAAI,IAAI;gBAClE,gBAAgB,EAAE,QAAQ,CAAC,gBAAgB;gBAC3C,UAAU,EAAE,QAAQ,CAAC,UAAU;gBAC/B,OAAO,EAAE,QAAQ,CAAC,OAAO;gBACzB,aAAa,EAAE,QAAQ,CAAC,aAAa;gBACrC,aAAa,EAAE,QAAQ,CAAC,aAAa;gBACrC,aAAa,EAAE,QAAQ,CAAC,aAAa,IAAI,QAAQ,CAAC,aAAa;
|
|
1
|
+
{"version":3,"file":"PublicDepartureCacheTransformation.js","sourceRoot":"","sources":["../../../../src/integration-engine/ropid-gtfs/transformations/PublicDepartureCacheTransformation.ts"],"names":[],"mappings":";;;;;;;;;AACA,6GAA0G;AAC1G,iEAAgE;AAIzD,IAAM,kCAAkC,GAAxC,MAAM,kCAAmC,SAAQ,+CAGvD;IAHM;;QAII,SAAI,GAAG,oCAAoC,CAAC;QAEzC,sBAAiB,GAAG,CAAC,QAA6B,EAAE,EAAE;YAC5D,MAAM,SAAS,GAAiC;gBAC5C,OAAO,EAAE,QAAQ,CAAC,OAAO;gBACzB,kBAAkB,EAAE,QAAQ,CAAC,kBAAkB,CAAC,WAAW,EAAE;gBAC7D,gBAAgB,EAAE,QAAQ,CAAC,gBAAgB,EAAE,WAAW,EAAE,IAAI,IAAI;gBAClE,gBAAgB,EAAE,QAAQ,CAAC,gBAAgB;gBAC3C,UAAU,EAAE,QAAQ,CAAC,UAAU;gBAC/B,OAAO,EAAE,QAAQ,CAAC,OAAO;gBACzB,aAAa,EAAE,QAAQ,CAAC,aAAa;gBACrC,aAAa,EAAE,QAAQ,CAAC,aAAa;gBACrC,aAAa,EAAE,QAAQ,CAAC,aAAa,IAAI,QAAQ,CAAC,aAAa;gBAC/D,6FAA6F;gBAC7F,wFAAwF;gBACxF,8EAA8E;gBAC9E,mBAAmB,EAAE,QAAQ,CAAC,mBAAmB,IAAI,IAAI;gBACzD,WAAW,EAAE,QAAQ,CAAC,gBAAgB,IAAI,IAAI;aACjD,CAAC;YAEF,OAAO,SAAS,CAAC;QACrB,CAAC,CAAC;IACN,CAAC;CAAA,CAAA;AA1BY,gFAAkC;6CAAlC,kCAAkC;IAD9C,IAAA,qBAAU,GAAE;GACA,kCAAkC,CA0B9C"}
|
package/dist/integration-engine/ropid-gtfs/transformations/RopidDeparturesPresetsTransformation.d.ts
CHANGED
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
import { IRopidDeparturesPreset, IRopidDeparturesPresetsOutput } from "../../../schema-definitions/ropid-departures-presets";
|
|
2
|
-
import {
|
|
3
|
-
export declare class RopidDeparturesPresetsTransformation extends
|
|
2
|
+
import { AbstractTransformation } from "@golemio/core/dist/helpers/transformation/AbstractTransformation";
|
|
3
|
+
export declare class RopidDeparturesPresetsTransformation extends AbstractTransformation<IRopidDeparturesPreset, IRopidDeparturesPresetsOutput> {
|
|
4
4
|
name: string;
|
|
5
5
|
constructor();
|
|
6
|
-
|
|
7
|
-
* Overrides BaseTransformation::transform
|
|
8
|
-
*/
|
|
9
|
-
transform: (data: IRopidDeparturesPreset[]) => Promise<IRopidDeparturesPresetsOutput[]>;
|
|
10
|
-
protected transformElement: (element: IRopidDeparturesPreset) => IRopidDeparturesPresetsOutput;
|
|
6
|
+
protected transformInternal: (element: IRopidDeparturesPreset) => IRopidDeparturesPresetsOutput;
|
|
11
7
|
}
|
package/dist/integration-engine/ropid-gtfs/transformations/RopidDeparturesPresetsTransformation.js
CHANGED
|
@@ -2,17 +2,11 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.RopidDeparturesPresetsTransformation = void 0;
|
|
4
4
|
const ropid_departures_presets_1 = require("../../../schema-definitions/ropid-departures-presets");
|
|
5
|
-
const
|
|
6
|
-
class RopidDeparturesPresetsTransformation extends
|
|
5
|
+
const AbstractTransformation_1 = require("@golemio/core/dist/helpers/transformation/AbstractTransformation");
|
|
6
|
+
class RopidDeparturesPresetsTransformation extends AbstractTransformation_1.AbstractTransformation {
|
|
7
7
|
constructor() {
|
|
8
8
|
super();
|
|
9
|
-
|
|
10
|
-
* Overrides BaseTransformation::transform
|
|
11
|
-
*/
|
|
12
|
-
this.transform = (data) => {
|
|
13
|
-
return Promise.resolve(data.map((element) => this.transformElement(element)));
|
|
14
|
-
};
|
|
15
|
-
this.transformElement = (element) => {
|
|
9
|
+
this.transformInternal = (element) => {
|
|
16
10
|
return {
|
|
17
11
|
route_name: element.routeName,
|
|
18
12
|
api_version: element.apiVersion,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RopidDeparturesPresetsTransformation.js","sourceRoot":"","sources":["../../../../src/integration-engine/ropid-gtfs/transformations/RopidDeparturesPresetsTransformation.ts"],"names":[],"mappings":";;;AAAA,mGAA8H;AAC9H,
|
|
1
|
+
{"version":3,"file":"RopidDeparturesPresetsTransformation.js","sourceRoot":"","sources":["../../../../src/integration-engine/ropid-gtfs/transformations/RopidDeparturesPresetsTransformation.ts"],"names":[],"mappings":";;;AAAA,mGAA8H;AAC9H,6GAA0G;AAG1G,MAAa,oCAAqC,SAAQ,+CAGzD;IAGG;QACI,KAAK,EAAE,CAAC;QAIF,sBAAiB,GAAG,CAAC,OAA+B,EAAiC,EAAE;YAC7F,OAAO;gBACH,UAAU,EAAE,OAAO,CAAC,SAAS;gBAC7B,WAAW,EAAE,OAAO,CAAC,UAAU;gBAC/B,KAAK,EAAE,OAAO,CAAC,KAAK;gBACpB,gBAAgB,EAAE,IAAI,eAAe,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,QAAQ,EAAE;gBAC/D,IAAI,EAAE,OAAO,CAAC,IAAI;gBAClB,UAAU,EAAE,OAAO,CAAC,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,aAAa,CAAC;aACxE,CAAC;QACN,CAAC,CAAC;QAZE,IAAI,CAAC,IAAI,GAAG,iDAAsB,CAAC,IAAI,CAAC;IAC5C,CAAC;CAYJ;AArBD,oFAqBC"}
|
package/dist/integration-engine/ropid-gtfs/transformations/RopidGTFSCisStopsTransformation.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { BaseTransformation, ITransformation } from "@golemio/core/dist/integration-engine/transformations";
|
|
2
1
|
import { IRopidGTFSCisStopsData, IRopidGTFSCisStopsInputData } from "../../../schema-definitions/ropid-gtfs/RopidGTFSCisStops";
|
|
3
2
|
import { IRopidGTFSCisStopGroupsData, IRopidGTFSCisStopGroupsInputData } from "../../../schema-definitions/ropid-gtfs/RopidGTFSCisStopGroups";
|
|
3
|
+
import { AbstractTransformation } from "@golemio/core/dist/helpers/transformation/AbstractTransformation";
|
|
4
4
|
export interface ICisStopsTransformationData {
|
|
5
5
|
data: IInputDataset[];
|
|
6
6
|
name: string;
|
|
@@ -12,14 +12,9 @@ export interface ICisStopsTransformedData {
|
|
|
12
12
|
cis_stop_groups: IRopidGTFSCisStopGroupsData[];
|
|
13
13
|
cis_stops: IRopidGTFSCisStopsData[];
|
|
14
14
|
}
|
|
15
|
-
export declare class RopidGTFSCisStopsTransformation extends
|
|
15
|
+
export declare class RopidGTFSCisStopsTransformation extends AbstractTransformation<ICisStopsTransformationData, ICisStopsTransformedData> {
|
|
16
16
|
name: string;
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Overrides BaseTransformation::transform
|
|
20
|
-
*/
|
|
21
|
-
transform: ({ data }: ICisStopsTransformationData) => Promise<ICisStopsTransformedData>;
|
|
22
|
-
protected transformElement: () => Promise<any>;
|
|
17
|
+
protected transformInternal: ({ data }: ICisStopsTransformationData) => ICisStopsTransformedData;
|
|
23
18
|
private getUniqueStopGroups;
|
|
24
19
|
}
|
|
25
20
|
export {};
|
package/dist/integration-engine/ropid-gtfs/transformations/RopidGTFSCisStopsTransformation.js
CHANGED
|
@@ -1,23 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.RopidGTFSCisStopsTransformation = void 0;
|
|
4
|
-
const transformations_1 = require("@golemio/core/dist/integration-engine/transformations");
|
|
5
4
|
const ropid_gtfs_1 = require("../../../schema-definitions/ropid-gtfs");
|
|
6
5
|
const helpers_1 = require("@golemio/core/dist/integration-engine/helpers");
|
|
7
|
-
|
|
6
|
+
const AbstractTransformation_1 = require("@golemio/core/dist/helpers/transformation/AbstractTransformation");
|
|
7
|
+
class RopidGTFSCisStopsTransformation extends AbstractTransformation_1.AbstractTransformation {
|
|
8
8
|
constructor() {
|
|
9
|
-
super();
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
};
|
|
18
|
-
const promises = data.map(async (stopGroup) => {
|
|
19
|
-
const promisesStops = stopGroup.stops.map((stop) => {
|
|
20
|
-
return {
|
|
9
|
+
super(...arguments);
|
|
10
|
+
this.name = ropid_gtfs_1.RopidGTFS.name + "CisStops";
|
|
11
|
+
this.transformInternal = ({ data }) => {
|
|
12
|
+
const cis_stops = [];
|
|
13
|
+
const stopGroups = [];
|
|
14
|
+
for (const stopGroup of data) {
|
|
15
|
+
for (const stop of stopGroup.stops) {
|
|
16
|
+
cis_stops.push({
|
|
21
17
|
alt_idos_name: stop.altIdosName,
|
|
22
18
|
cis: stopGroup.cis,
|
|
23
19
|
id: stop.id,
|
|
@@ -28,10 +24,9 @@ class RopidGTFSCisStopsTransformation extends transformations_1.BaseTransformati
|
|
|
28
24
|
platform: stop.platform,
|
|
29
25
|
wheelchair_access: stop.wheelchairAccess,
|
|
30
26
|
zone: stop.zone,
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
return {
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
stopGroups.push({
|
|
35
30
|
avg_jtsk_x: stopGroup.avgJtskX,
|
|
36
31
|
avg_jtsk_y: stopGroup.avgJtskY,
|
|
37
32
|
avg_lat: stopGroup.avgLat,
|
|
@@ -45,15 +40,14 @@ class RopidGTFSCisStopsTransformation extends transformations_1.BaseTransformati
|
|
|
45
40
|
name: stopGroup.name,
|
|
46
41
|
node: stopGroup.node,
|
|
47
42
|
unique_name: stopGroup.uniqueName,
|
|
48
|
-
};
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
return {
|
|
46
|
+
cis_stops,
|
|
47
|
+
cis_stop_groups: this.getUniqueStopGroups(stopGroups),
|
|
48
|
+
};
|
|
52
49
|
};
|
|
53
|
-
this.transformElement = async () => { };
|
|
54
50
|
this.getUniqueStopGroups = (data) => {
|
|
55
|
-
// duplicity checking
|
|
56
|
-
// TODO is it ok if all duplicate items are removed?
|
|
57
51
|
const uniqueMap = new Map();
|
|
58
52
|
const duplicateCisStopGroups = [];
|
|
59
53
|
data.forEach((item) => {
|
|
@@ -71,7 +65,6 @@ class RopidGTFSCisStopsTransformation extends transformations_1.BaseTransformati
|
|
|
71
65
|
}
|
|
72
66
|
return [...uniqueMap.values()];
|
|
73
67
|
};
|
|
74
|
-
this.name = ropid_gtfs_1.RopidGTFS.name + "CisStops";
|
|
75
68
|
}
|
|
76
69
|
}
|
|
77
70
|
exports.RopidGTFSCisStopsTransformation = RopidGTFSCisStopsTransformation;
|
package/dist/integration-engine/ropid-gtfs/transformations/RopidGTFSCisStopsTransformation.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RopidGTFSCisStopsTransformation.js","sourceRoot":"","sources":["../../../../src/integration-engine/ropid-gtfs/transformations/RopidGTFSCisStopsTransformation.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"RopidGTFSCisStopsTransformation.js","sourceRoot":"","sources":["../../../../src/integration-engine/ropid-gtfs/transformations/RopidGTFSCisStopsTransformation.ts"],"names":[],"mappings":";;;AAAA,uEAA4C;AAC5C,2EAAoE;AAGpE,6GAA0G;AAgB1G,MAAa,+BAAgC,SAAQ,+CAGpD;IAHD;;QAIW,SAAI,GAAG,sBAAS,CAAC,IAAI,GAAG,UAAU,CAAC;QAEhC,sBAAiB,GAAG,CAAC,EAAE,IAAI,EAA+B,EAA4B,EAAE;YAC9F,MAAM,SAAS,GAA6B,EAAE,CAAC;YAC/C,MAAM,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CAAC;QAEM,wBAAmB,GAAG,CAAC,IAAmC,EAAiC,EAAE;YACjG,MAAM,SAAS,GAAG,IAAI,GAAG,EAAuC,CAAC;YACjE,MAAM,sBAAsB,GAAa,EAAE,CAAC;YAE5C,IAAI,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;gBAClB,IAAI,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;oBAC1B,sBAAsB,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;oBACtC,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;gBAC/B,CAAC;qBAAM,CAAC;oBACJ,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;gBAClC,CAAC;YACL,CAAC,CAAC,CAAC;YAEH,IAAI,sBAAsB,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBACpC,aAAG,CAAC,IAAI,CACJ,2EAA2E;oBACvE,IAAI,CAAC,SAAS,CAAC,sBAAsB,CAAC,CAC7C,CAAC;YACN,CAAC;YAED,OAAO,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,CAAC;QACnC,CAAC,CAAC;IACN,CAAC;CAAA;AAvED,0EAuEC"}
|
|
@@ -1,15 +1,11 @@
|
|
|
1
|
-
import { BaseTransformation, ITransformation } from "@golemio/core/dist/integration-engine/transformations";
|
|
2
1
|
import { IRopidGTFSOisMappingInputData, IRopidGTFSOisMappingData } from "../../../schema-definitions/ropid-gtfs/RopidGTFSOisMapping";
|
|
2
|
+
import { AbstractTransformation } from "@golemio/core/dist/helpers/transformation/AbstractTransformation";
|
|
3
3
|
export interface IOisMappingTransformationData {
|
|
4
4
|
data: IRopidGTFSOisMappingInputData[];
|
|
5
5
|
name: string;
|
|
6
6
|
}
|
|
7
|
-
export declare class RopidGTFSOisMappingTransformation extends
|
|
7
|
+
export declare class RopidGTFSOisMappingTransformation extends AbstractTransformation<IOisMappingTransformationData, IRopidGTFSOisMappingData[]> {
|
|
8
8
|
name: string;
|
|
9
9
|
constructor();
|
|
10
|
-
|
|
11
|
-
* Overrides BaseTransformation::transform
|
|
12
|
-
*/
|
|
13
|
-
transform: ({ data }: IOisMappingTransformationData) => Promise<IRopidGTFSOisMappingData[]>;
|
|
14
|
-
protected transformElement: (element: IRopidGTFSOisMappingInputData) => IRopidGTFSOisMappingData;
|
|
10
|
+
protected transformInternal: (input: IOisMappingTransformationData) => IRopidGTFSOisMappingData[];
|
|
15
11
|
}
|
|
@@ -1,26 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.RopidGTFSOisMappingTransformation = void 0;
|
|
4
|
-
const transformations_1 = require("@golemio/core/dist/integration-engine/transformations");
|
|
5
4
|
const ropid_gtfs_1 = require("../../../schema-definitions/ropid-gtfs");
|
|
6
|
-
|
|
5
|
+
const AbstractTransformation_1 = require("@golemio/core/dist/helpers/transformation/AbstractTransformation");
|
|
6
|
+
class RopidGTFSOisMappingTransformation extends AbstractTransformation_1.AbstractTransformation {
|
|
7
7
|
constructor() {
|
|
8
8
|
super();
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
*/
|
|
12
|
-
this.transform = async ({ data }) => {
|
|
13
|
-
const promises = data.map((element) => {
|
|
14
|
-
return this.transformElement(element);
|
|
15
|
-
});
|
|
16
|
-
return await Promise.all(promises);
|
|
17
|
-
};
|
|
18
|
-
this.transformElement = (element) => {
|
|
19
|
-
return {
|
|
9
|
+
this.transformInternal = (input) => {
|
|
10
|
+
return input.data.map((element) => ({
|
|
20
11
|
ois: element.ois,
|
|
21
12
|
node: element.node,
|
|
22
13
|
name: element.name,
|
|
23
|
-
};
|
|
14
|
+
}));
|
|
24
15
|
};
|
|
25
16
|
this.name = ropid_gtfs_1.RopidGTFS.ois.name;
|
|
26
17
|
}
|
package/dist/integration-engine/ropid-gtfs/transformations/RopidGTFSOisTransformation.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RopidGTFSOisTransformation.js","sourceRoot":"","sources":["../../../../src/integration-engine/ropid-gtfs/transformations/RopidGTFSOisTransformation.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"RopidGTFSOisTransformation.js","sourceRoot":"","sources":["../../../../src/integration-engine/ropid-gtfs/transformations/RopidGTFSOisTransformation.ts"],"names":[],"mappings":";;;AAAA,uEAA4C;AAE5C,6GAA0G;AAO1G,MAAa,iCAAkC,SAAQ,+CAGtD;IAGG;QACI,KAAK,EAAE,CAAC;QAIF,sBAAiB,GAAG,CAAC,KAAoC,EAA8B,EAAE;YAC/F,OAAO,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;gBAChC,GAAG,EAAE,OAAO,CAAC,GAAG;gBAChB,IAAI,EAAE,OAAO,CAAC,IAAI;gBAClB,IAAI,EAAE,OAAO,CAAC,IAAI;aACrB,CAAC,CAAC,CAAC;QACR,CAAC,CAAC;QATE,IAAI,CAAC,IAAI,GAAG,sBAAS,CAAC,GAAG,CAAC,IAAI,CAAC;IACnC,CAAC;CASJ;AAlBD,8EAkBC"}
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AbstractTransformation } from "@golemio/core/dist/helpers/transformation/AbstractTransformation";
|
|
2
2
|
import { Readable } from "stream";
|
|
3
3
|
export interface IRopidGtfsTransformationData {
|
|
4
4
|
sourceStream: Readable;
|
|
5
5
|
name: string;
|
|
6
6
|
}
|
|
7
|
-
export declare class RopidGTFSTransformation extends
|
|
7
|
+
export declare class RopidGTFSTransformation extends AbstractTransformation<IRopidGtfsTransformationData, Readable> {
|
|
8
8
|
name: string;
|
|
9
9
|
constructor();
|
|
10
|
-
|
|
11
|
-
protected transformElement: () => void;
|
|
10
|
+
protected transformInternal: (input: IRopidGtfsTransformationData) => Readable;
|
|
12
11
|
}
|
|
@@ -15,15 +15,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
15
15
|
exports.RopidGTFSTransformation = void 0;
|
|
16
16
|
const ropid_gtfs_1 = require("../../../schema-definitions/ropid-gtfs");
|
|
17
17
|
const integration_engine_1 = require("@golemio/core/dist/integration-engine");
|
|
18
|
-
const
|
|
18
|
+
const AbstractTransformation_1 = require("@golemio/core/dist/helpers/transformation/AbstractTransformation");
|
|
19
19
|
const tsyringe_1 = require("@golemio/core/dist/shared/tsyringe");
|
|
20
20
|
const csv_parser_1 = __importDefault(require("csv-parser"));
|
|
21
21
|
const csv_stringify_1 = __importDefault(require("csv-stringify"));
|
|
22
22
|
const stream_1 = require("stream");
|
|
23
|
-
let RopidGTFSTransformation = class RopidGTFSTransformation extends
|
|
23
|
+
let RopidGTFSTransformation = class RopidGTFSTransformation extends AbstractTransformation_1.AbstractTransformation {
|
|
24
24
|
constructor() {
|
|
25
25
|
super();
|
|
26
|
-
this.
|
|
26
|
+
this.transformInternal = (input) => {
|
|
27
27
|
// create object by table structure and fill its values with null
|
|
28
28
|
const tableToObjectFilledWithNulls = Object.keys(ropid_gtfs_1.RopidGTFS[input.name].outputSequelizeAttributes)
|
|
29
29
|
.filter((column) => !column.startsWith("computed_"))
|
|
@@ -36,7 +36,7 @@ let RopidGTFSTransformation = class RopidGTFSTransformation extends transformati
|
|
|
36
36
|
...tableToObjectFilledWithNulls,
|
|
37
37
|
// filter redundant properties and fill data to prepared structure
|
|
38
38
|
...Object.keys(chunk)
|
|
39
|
-
.filter((key) =>
|
|
39
|
+
.filter((key) => key in tableToObjectFilledWithNulls)
|
|
40
40
|
.reduce((obj, key) => {
|
|
41
41
|
obj[key] = chunk[key];
|
|
42
42
|
return obj;
|
|
@@ -45,7 +45,7 @@ let RopidGTFSTransformation = class RopidGTFSTransformation extends transformati
|
|
|
45
45
|
callback();
|
|
46
46
|
},
|
|
47
47
|
});
|
|
48
|
-
|
|
48
|
+
const out = (0, stream_1.pipeline)(input.sourceStream, (0, csv_parser_1.default)(), addColumns, (0, csv_stringify_1.default)({ header: true }), (err) => {
|
|
49
49
|
if (err) {
|
|
50
50
|
integration_engine_1.log.error(`Datasets: transformation error (${input.name}): ${err.toString()}`);
|
|
51
51
|
throw err;
|
|
@@ -54,8 +54,8 @@ let RopidGTFSTransformation = class RopidGTFSTransformation extends transformati
|
|
|
54
54
|
integration_engine_1.log.info(`Datasets: transformation success (${input.name})`);
|
|
55
55
|
}
|
|
56
56
|
});
|
|
57
|
+
return out;
|
|
57
58
|
};
|
|
58
|
-
this.transformElement = () => { };
|
|
59
59
|
this.name = ropid_gtfs_1.RopidGTFS.name;
|
|
60
60
|
}
|
|
61
61
|
};
|