@golemio/pid 2.7.12-dev.938565701 → 2.7.12

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.
Files changed (117) hide show
  1. package/dist/integration-engine/index.js +0 -2
  2. package/dist/integration-engine/index.js.map +1 -1
  3. package/dist/integration-engine/queueDefinitions.js +50 -0
  4. package/dist/integration-engine/queueDefinitions.js.map +1 -1
  5. package/dist/integration-engine/ropid-gtfs/LegacyRopidGTFSWorker.d.ts +63 -0
  6. package/dist/integration-engine/ropid-gtfs/LegacyRopidGTFSWorker.js +541 -3
  7. package/dist/integration-engine/ropid-gtfs/LegacyRopidGTFSWorker.js.map +1 -1
  8. package/dist/integration-engine/ropid-gtfs/data-access/cache/StaticFileRedisRepository.js +4 -18
  9. package/dist/integration-engine/ropid-gtfs/data-access/cache/StaticFileRedisRepository.js.map +1 -1
  10. package/dist/integration-engine/ropid-gtfs/data-access/precomputed/TripScheduleRepository.d.ts +2 -2
  11. package/dist/integration-engine/ropid-gtfs/data-access/precomputed/TripScheduleRepository.js.map +1 -1
  12. package/dist/integration-engine/ropid-gtfs/interfaces/ICheckForNewDataInput.js.map +1 -0
  13. package/dist/integration-engine/ropid-gtfs/interfaces/IGtfsRunTripCache.d.ts +28 -0
  14. package/dist/integration-engine/ropid-gtfs/{workers/timetables/tasks/interfaces/IDatasetsInput.js → interfaces/IGtfsRunTripCache.js} +1 -1
  15. package/dist/integration-engine/ropid-gtfs/interfaces/IGtfsRunTripCache.js.map +1 -0
  16. package/dist/integration-engine/ropid-gtfs/transformations/RopidGTFSTransformation.js +3 -16
  17. package/dist/integration-engine/ropid-gtfs/transformations/RopidGTFSTransformation.js.map +1 -1
  18. package/dist/integration-engine/ropid-gtfs/workers/presets/data-access/PresetLogRepository.js +1 -0
  19. package/dist/integration-engine/ropid-gtfs/workers/presets/data-access/PresetLogRepository.js.map +1 -1
  20. package/dist/integration-engine/vehicle-positions/workers/runs/data-access/CommonRunsRepository.d.ts +3 -3
  21. package/dist/integration-engine/vehicle-positions/workers/runs/data-access/CommonRunsRepository.js.map +1 -1
  22. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/data-access/PositionsRepository.d.ts +4 -4
  23. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/data-access/PositionsRepository.js.map +1 -1
  24. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/data-access/TripsRepository.d.ts +3 -3
  25. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/data-access/TripsRepository.js +1 -1
  26. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/data-access/TripsRepository.js.map +1 -1
  27. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/data-access/helpers/PositionsMapper.d.ts +3 -3
  28. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/data-access/helpers/PositionsMapper.js.map +1 -1
  29. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/data-access/helpers/TripsIdGenerator.d.ts +3 -3
  30. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/data-access/helpers/TripsIdGenerator.js.map +1 -1
  31. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/data-access/helpers/TripsMapper.d.ts +3 -3
  32. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/data-access/helpers/TripsMapper.js +1 -1
  33. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/data-access/helpers/TripsMapper.js.map +1 -1
  34. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/DPPUtils.d.ts +2 -2
  35. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/DPPUtils.js.map +1 -1
  36. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/PositionsManager.d.ts +3 -3
  37. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/PositionsManager.js +1 -1
  38. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/PositionsManager.js.map +1 -1
  39. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/gtfs-trip-run/AbstractGTFSTripRunManager.d.ts +5 -8
  40. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/gtfs-trip-run/AbstractGTFSTripRunManager.js +12 -12
  41. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/gtfs-trip-run/AbstractGTFSTripRunManager.js.map +1 -1
  42. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/gtfs-trip-run/GTFSTripCommonRunManager.d.ts +2 -3
  43. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/gtfs-trip-run/GTFSTripCommonRunManager.js +0 -6
  44. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/gtfs-trip-run/GTFSTripCommonRunManager.js.map +1 -1
  45. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/gtfs-trip-run/GTFSTripMetroRunManager.d.ts +2 -3
  46. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/gtfs-trip-run/GTFSTripMetroRunManager.js +0 -6
  47. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/gtfs-trip-run/GTFSTripMetroRunManager.js.map +1 -1
  48. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/gtfs-trip-run/interfaces/IDelayMessage.d.ts +2 -2
  49. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/interfaces/IUpdateDelayInput.d.ts +2 -2
  50. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/schema/UpdateDelaySchema.d.ts +2 -2
  51. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/schema/UpdateDelaySchema.js.map +1 -1
  52. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/tasks/PropagateDelayTask.d.ts +0 -1
  53. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/tasks/PropagateDelayTask.js +38 -33
  54. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/tasks/PropagateDelayTask.js.map +1 -1
  55. package/dist/output-gateway/pid/controllers/DepartureBoardsController.js +2 -1
  56. package/dist/output-gateway/pid/controllers/DepartureBoardsController.js.map +1 -1
  57. package/dist/output-gateway/pid/controllers/InfotextsController.js +1 -1
  58. package/dist/output-gateway/pid/controllers/InfotextsController.js.map +1 -1
  59. package/dist/output-gateway/pid/models/PIDDepartureBoardsModel.js +5 -4
  60. package/dist/output-gateway/pid/models/PIDDepartureBoardsModel.js.map +1 -1
  61. package/dist/output-gateway/vehicle-positions/VehiclePositionsRouter.js +2 -1
  62. package/dist/output-gateway/vehicle-positions/VehiclePositionsRouter.js.map +1 -1
  63. package/dist/schema-definitions/vehicle-positions/redis/interfaces/IGtfsRunTripCacheDto.d.ts +0 -3
  64. package/dist/schema-definitions/vehicle-positions/redis/schemas/GtfsRunTripCacheDtoSchema.js +0 -5
  65. package/dist/schema-definitions/vehicle-positions/redis/schemas/GtfsRunTripCacheDtoSchema.js.map +1 -1
  66. package/docs/implementation_documentation.md +37 -39
  67. package/package.json +2 -2
  68. package/dist/integration-engine/ropid-gtfs/ioc/Di.d.ts +0 -3
  69. package/dist/integration-engine/ropid-gtfs/ioc/Di.js +0 -29
  70. package/dist/integration-engine/ropid-gtfs/ioc/Di.js.map +0 -1
  71. package/dist/integration-engine/ropid-gtfs/ioc/RopidGtfsContainerToken.d.ts +0 -8
  72. package/dist/integration-engine/ropid-gtfs/ioc/RopidGtfsContainerToken.js +0 -12
  73. package/dist/integration-engine/ropid-gtfs/ioc/RopidGtfsContainerToken.js.map +0 -1
  74. package/dist/integration-engine/ropid-gtfs/workers/timetables/TimetableWorker.d.ts +0 -5
  75. package/dist/integration-engine/ropid-gtfs/workers/timetables/TimetableWorker.js +0 -23
  76. package/dist/integration-engine/ropid-gtfs/workers/timetables/TimetableWorker.js.map +0 -1
  77. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/CheckForNewDataTask.d.ts +0 -12
  78. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/CheckForNewDataTask.js +0 -61
  79. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/CheckForNewDataTask.js.map +0 -1
  80. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/CheckSavedRowsAndReplaceTablesTask.d.ts +0 -14
  81. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/CheckSavedRowsAndReplaceTablesTask.js +0 -93
  82. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/CheckSavedRowsAndReplaceTablesTask.js.map +0 -1
  83. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/DownloadDatasetsTask.d.ts +0 -19
  84. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/DownloadDatasetsTask.js +0 -152
  85. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/DownloadDatasetsTask.js.map +0 -1
  86. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/RefreshPrecomputedTablesTask.d.ts +0 -11
  87. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/RefreshPrecomputedTablesTask.js +0 -57
  88. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/RefreshPrecomputedTablesTask.js.map +0 -1
  89. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/TransformAndSaveDataTask.d.ts +0 -21
  90. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/TransformAndSaveDataTask.js +0 -160
  91. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/TransformAndSaveDataTask.js.map +0 -1
  92. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/helpers/HelperTypes.d.ts +0 -24
  93. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/helpers/HelperTypes.js +0 -36
  94. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/helpers/HelperTypes.js.map +0 -1
  95. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/helpers/PrecomputedTablesFacade.d.ts +0 -12
  96. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/helpers/PrecomputedTablesFacade.js +0 -67
  97. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/helpers/PrecomputedTablesFacade.js.map +0 -1
  98. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/helpers/RopidGtfsFactory.d.ts +0 -13
  99. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/helpers/RopidGtfsFactory.js +0 -102
  100. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/helpers/RopidGtfsFactory.js.map +0 -1
  101. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/interfaces/ICheckForNewDataInput.js.map +0 -1
  102. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/interfaces/IDatasetsInput.d.ts +0 -4
  103. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/interfaces/IDatasetsInput.js.map +0 -1
  104. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/schema/CachedDatasetSchema.d.ts +0 -8
  105. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/schema/CachedDatasetSchema.js +0 -40
  106. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/schema/CachedDatasetSchema.js.map +0 -1
  107. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/schema/CheckForNewDataMessageValidation.d.ts +0 -4
  108. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/schema/CheckForNewDataMessageValidation.js +0 -22
  109. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/schema/CheckForNewDataMessageValidation.js.map +0 -1
  110. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/schema/DownloadDataInputSchema.d.ts +0 -5
  111. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/schema/DownloadDataInputSchema.js +0 -23
  112. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/schema/DownloadDataInputSchema.js.map +0 -1
  113. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/gtfs-trip-run/interfaces/ITimeWindow.d.ts +0 -4
  114. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/gtfs-trip-run/interfaces/ITimeWindow.js +0 -2
  115. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/helpers/gtfs-trip-run/interfaces/ITimeWindow.js.map +0 -1
  116. /package/dist/integration-engine/ropid-gtfs/{workers/timetables/tasks/interfaces → interfaces}/ICheckForNewDataInput.d.ts +0 -0
  117. /package/dist/integration-engine/ropid-gtfs/{workers/timetables/tasks/interfaces → interfaces}/ICheckForNewDataInput.js +0 -0
@@ -8,21 +8,226 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  step((generator = generator.apply(thisArg, _arguments || [])).next());
9
9
  });
10
10
  };
11
+ var __rest = (this && this.__rest) || function (s, e) {
12
+ var t = {};
13
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
14
+ t[p] = s[p];
15
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
16
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
17
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
18
+ t[p[i]] = s[p[i]];
19
+ }
20
+ return t;
21
+ };
22
+ var __importDefault = (this && this.__importDefault) || function (mod) {
23
+ return (mod && mod.__esModule) ? mod : { "default": mod };
24
+ };
11
25
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.LegacyRopidGTFSWorker = void 0;
26
+ exports.LegacyRopidGTFSWorker = exports.datasetFileModelMap = void 0;
13
27
  const Di_1 = require("../ioc/Di");
14
28
  const ModuleContainerToken_1 = require("../ioc/ModuleContainerToken");
29
+ const RopidGTFSOisTransformation_1 = require("./transformations/RopidGTFSOisTransformation");
30
+ const utils_1 = require("./utils");
31
+ const shared_1 = require("../shared");
32
+ const constants_1 = require("../vehicle-positions/workers/vehicle-positions/constants");
33
+ const const_1 = require("../../schema-definitions/const");
15
34
  const ropid_departures_presets_1 = require("../../schema-definitions/ropid-departures-presets");
16
35
  const ropid_gtfs_1 = require("../../schema-definitions/ropid-gtfs");
17
36
  const config_1 = require("@golemio/core/dist/integration-engine/config");
37
+ const connectors_1 = require("@golemio/core/dist/integration-engine/connectors");
38
+ const pubsub_1 = require("@golemio/core/dist/integration-engine/data-access/pubsub");
18
39
  const datasources_1 = require("@golemio/core/dist/integration-engine/datasources");
40
+ const helpers_1 = require("@golemio/core/dist/integration-engine/helpers");
41
+ const models_1 = require("@golemio/core/dist/integration-engine/models");
19
42
  const workers_1 = require("@golemio/core/dist/integration-engine/workers");
43
+ const golemio_errors_1 = require("@golemio/core/dist/shared/golemio-errors");
20
44
  const golemio_validator_1 = require("@golemio/core/dist/shared/golemio-validator");
45
+ const os_1 = __importDefault(require("os"));
46
+ const pg_copy_streams_1 = require("pg-copy-streams");
21
47
  const _1 = require(".");
22
- const Di_2 = require("./ioc/Di");
48
+ const cache_1 = require("./data-access/cache");
49
+ const precomputed_1 = require("./data-access/precomputed");
50
+ const DataCacheManager_1 = require("./helpers/DataCacheManager");
51
+ const SourceTableSuffixEnum_1 = require("./helpers/SourceTableSuffixEnum");
52
+ var CacheContentType;
53
+ (function (CacheContentType) {
54
+ CacheContentType["CSV"] = "CSV";
55
+ CacheContentType["JSON"] = "JSON";
56
+ })(CacheContentType || (CacheContentType = {}));
57
+ const isCachedDataset = (obj) => {
58
+ return obj instanceof Object && obj.filepath !== undefined && obj.name !== undefined && obj.dataset !== undefined;
59
+ };
60
+ const datasetFileModelMap = (dataset, name) => {
61
+ let model;
62
+ switch (dataset) {
63
+ case _1.DatasetEnum.PID_GTFS:
64
+ model = name;
65
+ break;
66
+ case _1.DatasetEnum.RUN_NUMBERS:
67
+ model = "run_numbers";
68
+ break;
69
+ case _1.DatasetEnum.OIS_MAPPING:
70
+ model = "ois";
71
+ break;
72
+ case _1.DatasetEnum.CIS_STOPS:
73
+ model = ["cis_stops", "cis_stop_groups"];
74
+ break;
75
+ default:
76
+ throw new Error(`Error mapping dataset ${dataset} and source ${name}`);
77
+ }
78
+ return model;
79
+ };
80
+ exports.datasetFileModelMap = datasetFileModelMap;
23
81
  class LegacyRopidGTFSWorker extends workers_1.BaseWorker {
24
82
  constructor() {
25
83
  super();
84
+ /**
85
+ * Queue listener method - triggers entire flow
86
+ */
87
+ this.checkForNewData = (msg) => __awaiter(this, void 0, void 0, function* () {
88
+ let forceRefresh = false;
89
+ try {
90
+ const inputData = JSON.parse(msg.content.toString());
91
+ forceRefresh = !!inputData.forceRefresh;
92
+ }
93
+ catch (err) {
94
+ helpers_1.log.warn(`Error parsing checkForNewData message: ${err.message}`);
95
+ }
96
+ const datasets = [];
97
+ for (const dataset of Object.keys(this.datasetMap)) {
98
+ const serverLastModified = yield this.datasetMap[dataset].datasource.getLastModified();
99
+ const dbLastModified = yield this.metaModel.getLastModified(dataset);
100
+ const isDeployed = yield this.metaModel.isDeployed(dataset);
101
+ if (serverLastModified !== dbLastModified.lastModified || !isDeployed) {
102
+ datasets.push(dataset);
103
+ }
104
+ }
105
+ if (datasets.length && datasets.length !== Object.keys(this.datasetMap).length) {
106
+ helpers_1.log.error(`RopidGTFS datasets are out of sync`);
107
+ }
108
+ if (datasets.length) {
109
+ yield this.sendMessageToExchange("workers." + this.queuePrefix + ".downloadDatasets", JSON.stringify(datasets));
110
+ return;
111
+ }
112
+ helpers_1.log.info("RopidGTFS datasets are up to date");
113
+ if (forceRefresh) {
114
+ yield this.sendMessageToExchange("workers." + this.queuePrefix + ".refreshPrecomputedTables", "");
115
+ }
116
+ });
117
+ /**
118
+ * Queue listener method - triggers dataset download
119
+ * @param {object} msg
120
+ * @param {Buffer} msg.content - array of dataset names, empty to force downloading all
121
+ */
122
+ this.downloadDatasets = (msg) => __awaiter(this, void 0, void 0, function* () {
123
+ let datasets;
124
+ try {
125
+ const content = msg.content.toString();
126
+ if (content) {
127
+ datasets = JSON.parse(content);
128
+ this.validateDatasetNames(datasets);
129
+ }
130
+ else {
131
+ // utility setup - force run all if message empty
132
+ datasets = Object.keys(this.datasetMap);
133
+ }
134
+ }
135
+ catch (err) {
136
+ throw new golemio_errors_1.GeneralError("Error while parsing input data", this.constructor.name, err);
137
+ }
138
+ helpers_1.log.info(`Datasets: downloading ${datasets}`);
139
+ let cachedDatasets = [];
140
+ for (const dataset of datasets) {
141
+ try {
142
+ cachedDatasets = cachedDatasets.concat(yield this.downloadAndPersistDatasetFiles(dataset));
143
+ }
144
+ catch (err) {
145
+ yield this.sendMessageToExchange("workers." + this.queuePrefix + ".refreshPrecomputedTables", "");
146
+ if (err instanceof golemio_errors_1.AbstractGolemioError) {
147
+ throw err;
148
+ }
149
+ throw new golemio_errors_1.GeneralError("Error while downloading GTFS datasets", this.constructor.name, err);
150
+ }
151
+ }
152
+ const subscriber = this.gtfsRedisChannel.createSubscriber({ channelSuffix: os_1.default.hostname() });
153
+ yield subscriber.subscribe();
154
+ for (const cachedDataset of cachedDatasets) {
155
+ this.sendMessageToExchange("workers." + this.queuePrefix + ".transformAndSaveData", JSON.stringify(cachedDataset), {
156
+ headers: {
157
+ [LegacyRopidGTFSWorker.ORIGIN_HOSTNAME_HEADER]: os_1.default.hostname(),
158
+ },
159
+ });
160
+ }
161
+ // Listen for messages from workers and wait for all of them to finish
162
+ // before continuing to the next step (replacing tables)
163
+ try {
164
+ yield subscriber.listen(cachedDatasets.length, ({ message, messageCount, isFinal }) => {
165
+ helpers_1.log.debug(`Datasets: received message: ${message} (${messageCount}/${cachedDatasets.length})`);
166
+ if (!message.startsWith("OK")) {
167
+ helpers_1.log.error(`Datasets: subscription error: ${message}`);
168
+ throw new golemio_errors_1.GeneralError(message, this.constructor.name);
169
+ }
170
+ if (isFinal) {
171
+ helpers_1.log.info("Datasets: all messages received");
172
+ }
173
+ });
174
+ }
175
+ catch (err) {
176
+ if (err instanceof golemio_errors_1.AbstractGolemioError) {
177
+ throw err;
178
+ }
179
+ throw new golemio_errors_1.GeneralError("Error while listening for messages", this.constructor.name, err);
180
+ }
181
+ finally {
182
+ yield subscriber.unsubscribe();
183
+ this.sendMessageToExchange("workers." + this.queuePrefix + ".checkSavedRowsAndReplaceTables", JSON.stringify(datasets));
184
+ }
185
+ });
186
+ /**
187
+ * Helper method - download and persist dataset
188
+ */
189
+ this.downloadAndPersistDatasetFiles = (dataset) => __awaiter(this, void 0, void 0, function* () {
190
+ helpers_1.log.info(`Datasets: processing ${dataset}`);
191
+ let files = yield this.datasetMap[dataset].datasource.getAll();
192
+ if (!Array.isArray(files))
193
+ files = [files];
194
+ const dbLastModified = yield this.metaModel.getLastModified(dataset);
195
+ const cachedDataset = [];
196
+ for (const file of files) {
197
+ helpers_1.log.info(`Datasets: processing file '${file.name}'`);
198
+ const { data } = file, meta = __rest(file, ["data"]);
199
+ if (dataset === _1.DatasetEnum.PID_GTFS || dataset === _1.DatasetEnum.RUN_NUMBERS) {
200
+ yield this.staticFileRedisRepository.pipeStream(file.filepath, data);
201
+ }
202
+ else {
203
+ yield this.staticFileRedisRepository.set(file.filepath, typeof data === "string" ? data : JSON.stringify(data));
204
+ }
205
+ const key = (0, exports.datasetFileModelMap)(dataset, file.name);
206
+ const metaStates = (Array.isArray(key) ? key : [key]).map((name) => {
207
+ return {
208
+ dataset,
209
+ key: name,
210
+ type: shared_1.MetaTypeEnum.STATE,
211
+ value: shared_1.MetaStateEnum.DOWNLOADED,
212
+ version: dbLastModified.version + 1,
213
+ };
214
+ });
215
+ for (const metaState of metaStates) {
216
+ yield this.metaModel.save(metaState);
217
+ }
218
+ cachedDataset.push(Object.assign(Object.assign({}, meta), { dataset }));
219
+ }
220
+ const lastModified = yield this.datasetMap[dataset].datasource.getLastModified();
221
+ yield this.metaModel.save({
222
+ dataset,
223
+ key: shared_1.MetaDatasetInfoKeyEnum.LAST_MODIFIED,
224
+ type: shared_1.MetaTypeEnum.DATASET_INFO,
225
+ value: lastModified,
226
+ version: dbLastModified.version + 1,
227
+ });
228
+ helpers_1.log.info(`Datasets: processing ${dataset} finished - ${JSON.stringify(cachedDataset)}`);
229
+ return cachedDataset;
230
+ });
26
231
  /**
27
232
  * Queue listener method - triggers for new presets only
28
233
  */
@@ -34,6 +239,165 @@ class LegacyRopidGTFSWorker extends workers_1.BaseWorker {
34
239
  yield this.sendMessageToExchange("workers." + this.queuePrefix + ".downloadDeparturesPresets", "Just do it!");
35
240
  }
36
241
  });
242
+ /**
243
+ * Queue listener method - transform and save dataset item to tmp
244
+ */
245
+ this.transformAndSaveData = (msg) => __awaiter(this, void 0, void 0, function* () {
246
+ let inputData;
247
+ try {
248
+ inputData = JSON.parse(msg.content.toString());
249
+ if (!isCachedDataset(inputData)) {
250
+ throw new Error("Input data has invalid format.");
251
+ }
252
+ }
253
+ catch (err) {
254
+ throw new golemio_errors_1.GeneralError("Error while parsing input data", this.constructor.name, err);
255
+ }
256
+ let modelName = (0, exports.datasetFileModelMap)(inputData.dataset, inputData.name);
257
+ if (!Array.isArray(modelName)) {
258
+ modelName = [modelName];
259
+ }
260
+ let errorMessage;
261
+ if (inputData.dataset === _1.DatasetEnum.PID_GTFS || inputData.dataset === _1.DatasetEnum.RUN_NUMBERS) {
262
+ try {
263
+ const sourceStream = this.staticFileRedisRepository.getReadableStream(inputData.filepath);
264
+ const transformedDataset = yield this.transformationGtfs.transform({
265
+ sourceStream,
266
+ name: modelName[0],
267
+ });
268
+ yield this.saveTransformedDataset(transformedDataset, inputData.dataset, modelName[0]);
269
+ }
270
+ catch (err) {
271
+ errorMessage = err.message;
272
+ }
273
+ }
274
+ else {
275
+ try {
276
+ const data = yield this.staticFileRedisRepository.get(inputData.filepath);
277
+ const transformedDataset = yield this.datasetMap[inputData.dataset].transformation.transform({
278
+ data: this.datasetMap[inputData.dataset].cacheContentType === CacheContentType.JSON ? JSON.parse(data) : data,
279
+ name: inputData.name,
280
+ });
281
+ if (inputData.dataset === _1.DatasetEnum.CIS_STOPS) {
282
+ yield this.saveTransformedDataset(transformedDataset.cis_stops, inputData.dataset, modelName[0]);
283
+ yield this.saveTransformedDataset(transformedDataset.cis_stop_groups, inputData.dataset, modelName[1]);
284
+ }
285
+ else {
286
+ yield this.saveTransformedDataset(transformedDataset, inputData.dataset, modelName[0]);
287
+ }
288
+ }
289
+ catch (err) {
290
+ errorMessage = err.message;
291
+ }
292
+ }
293
+ if (msg.properties.headers[LegacyRopidGTFSWorker.ORIGIN_HOSTNAME_HEADER]) {
294
+ yield this.gtfsRedisChannel.publishMessage(`${errorMessage !== null && errorMessage !== void 0 ? errorMessage : "OK"} (${modelName})`, {
295
+ channelSuffix: msg.properties.headers[LegacyRopidGTFSWorker.ORIGIN_HOSTNAME_HEADER],
296
+ });
297
+ }
298
+ if (errorMessage) {
299
+ throw new golemio_errors_1.GeneralError(errorMessage, this.constructor.name);
300
+ }
301
+ });
302
+ this.saveTransformedDataset = (transformedData, dataset, modelName) => __awaiter(this, void 0, void 0, function* () {
303
+ const model = yield this.createTmpModel(modelName);
304
+ switch (dataset) {
305
+ case _1.DatasetEnum.PID_GTFS:
306
+ case _1.DatasetEnum.RUN_NUMBERS:
307
+ yield this.streamDataToTmp(transformedData, modelName);
308
+ break;
309
+ default:
310
+ yield (model === null || model === void 0 ? void 0 : model.save(transformedData, false));
311
+ helpers_1.log.info(`Datasets: copying to tmp success (${modelName})`);
312
+ }
313
+ const dbLastModified = yield this.metaModel.getLastModified(dataset);
314
+ yield this.metaModel.updateState(dataset, modelName, shared_1.MetaStateEnum.SAVED, dbLastModified.version);
315
+ });
316
+ /**
317
+ * Queue listener method - verify tmp tables and replace public
318
+ */
319
+ this.checkSavedRowsAndReplaceTables = (msg) => __awaiter(this, void 0, void 0, function* () {
320
+ let datasets;
321
+ try {
322
+ datasets = JSON.parse(msg.content.toString());
323
+ this.validateDatasetNames(datasets);
324
+ }
325
+ catch (err) {
326
+ throw new golemio_errors_1.GeneralError("Error while parsing input data", this.constructor.name, err);
327
+ }
328
+ const datasetDeployInfo = yield Promise.all(datasets.map((dataset) => __awaiter(this, void 0, void 0, function* () {
329
+ const lastModified = yield this.metaModel.getLastModified(dataset);
330
+ const isDeployed = yield this.metaModel.checkIfNewVersionIsAlreadyDeployed(dataset, lastModified.version);
331
+ return { dataset, lastModified, isDeployed };
332
+ })));
333
+ helpers_1.log.debug(`Datasets status: ${JSON.stringify(datasetDeployInfo)}`);
334
+ const notDeployed = datasetDeployInfo.filter((info) => !info.isDeployed);
335
+ if (datasets.length !== notDeployed.length) {
336
+ const names = notDeployed.map((el) => el.dataset);
337
+ helpers_1.log.error(`Error while synchronized download of datasets: [${names}] of [${datasets}] deployed already`);
338
+ }
339
+ if (!notDeployed.length) {
340
+ helpers_1.log.debug(`Datasets status: already deployed`);
341
+ return true;
342
+ }
343
+ const notDeployedVersions = notDeployed.map((el) => ({ dataset: el.dataset, version: el.lastModified.version }));
344
+ const allSaved = yield this.metaModel.checkAllTablesHasSavedState(notDeployedVersions);
345
+ try {
346
+ if (!allSaved) {
347
+ throw new golemio_errors_1.GeneralError("Some GTFS datasets did not properly save", this.constructor.name);
348
+ }
349
+ yield Promise.all(datasetDeployInfo.map((el) => __awaiter(this, void 0, void 0, function* () {
350
+ yield this.metaModel.checkSavedTmpTables(el.dataset, el.lastModified.version);
351
+ })));
352
+ yield this.createAndPopulatePrecomputedTmpTables(SourceTableSuffixEnum_1.SourceTableSuffixEnum.Tmp);
353
+ yield this.metaModel.replaceTables(notDeployedVersions);
354
+ yield this.dataCacheManager.cleanCache();
355
+ yield this.sendMessageToExchange(`workers.${config_1.config.RABBIT_EXCHANGE_NAME}.${constants_1.WORKER_NAME.toLowerCase()}.refreshGTFSTripData`, "");
356
+ return true;
357
+ }
358
+ catch (err) {
359
+ // log failed saving process
360
+ yield Promise.all(notDeployedVersions.map((el) => __awaiter(this, void 0, void 0, function* () {
361
+ yield this.metaModel.rollbackFailedSaving(el.dataset, el.version);
362
+ })));
363
+ // check number of tries
364
+ const retries = yield Promise.all(notDeployedVersions.map((el) => __awaiter(this, void 0, void 0, function* () {
365
+ return yield this.metaModel.getNumberOfDownloadRetries(el.dataset, el.version);
366
+ })));
367
+ if (Math.max(...retries) <= 5) {
368
+ // send new downloadFiles, log it and finish
369
+ yield this.sendMessageToExchange("workers." + this.queuePrefix + ".downloadDatasets", JSON.stringify(datasets));
370
+ helpers_1.IntegrationErrorHandler.handle(new golemio_errors_1.GeneralError(`Error while checking RopidGTFS saved rows. Attempt number ${Math.min(...retries)} was resent.`, this.constructor.name, err));
371
+ return true;
372
+ }
373
+ else {
374
+ // at least refresh precomputed tables and finish with error
375
+ yield this.sendMessageToExchange("workers." + this.queuePrefix + ".refreshPrecomputedTables", "");
376
+ throw new golemio_errors_1.GeneralError("Error while checking RopidGTFS saved rows.", this.constructor.name, err);
377
+ }
378
+ }
379
+ });
380
+ this.refreshPrecomputedTables = () => __awaiter(this, void 0, void 0, function* () {
381
+ try {
382
+ yield this.createAndPopulatePrecomputedTmpTables(SourceTableSuffixEnum_1.SourceTableSuffixEnum.Actual);
383
+ }
384
+ catch (err) {
385
+ helpers_1.log.error(err);
386
+ throw new golemio_errors_1.GeneralError("Error while creating RopidGTFS precomputed tables", this.constructor.name);
387
+ }
388
+ const connection = connectors_1.PostgresConnector.getConnection();
389
+ const transaction = yield connection.transaction();
390
+ try {
391
+ yield this.metaModel.replacePrecomputedTables(transaction);
392
+ yield transaction.commit();
393
+ }
394
+ catch (err) {
395
+ yield transaction.rollback();
396
+ helpers_1.log.error(err);
397
+ throw new golemio_errors_1.GeneralError("Error while replacing RopidGTFS precomputed tables", this.constructor.name);
398
+ }
399
+ yield this.dataCacheManager.cleanCache();
400
+ });
37
401
  /**
38
402
  * Queue listener method - triggers processing of DEPARTURES_PRESETS dataset
39
403
  */
@@ -43,8 +407,103 @@ class LegacyRopidGTFSWorker extends workers_1.BaseWorker {
43
407
  const facade = Di_1.PidContainer.resolve(ModuleContainerToken_1.ModuleContainerToken.DeparturePresetsFacade);
44
408
  yield facade.handleNewDeparturePresets(file.data, lastModified);
45
409
  });
410
+ /**
411
+ * Validate dataset list against dataset enum
412
+ *
413
+ * @param {string[]} names - names of datasets
414
+ */
415
+ this.validateDatasetNames = (names) => {
416
+ if (!Array.isArray(names)) {
417
+ throw new Error(`Error validating dataset list: must be an array`);
418
+ }
419
+ if (!names.length) {
420
+ throw new Error(`Error validating dataset list: got empty array`);
421
+ }
422
+ const invalidNames = names.filter((name) => !this.validateDatasetName(name));
423
+ if (invalidNames.length) {
424
+ throw new Error(`Error validating dataset list: "${invalidNames.toString()}" is invalid`);
425
+ }
426
+ };
427
+ /**
428
+ * Validate name against dataset enum
429
+ *
430
+ * @param {string} name - name of datasets
431
+ */
432
+ this.validateDatasetName = (name) => {
433
+ return Object.keys(this.datasetMap).includes(name);
434
+ };
435
+ this.streamDataToTmp = (data, modelName) => __awaiter(this, void 0, void 0, function* () {
436
+ // get connection and db client
437
+ const connection = connectors_1.PostgresConnector.getConnection();
438
+ const client = (yield connection.connectionManager.getConnection({ type: "write" }));
439
+ const tmpTableName = ropid_gtfs_1.RopidGTFS[modelName].pgTableName + SourceTableSuffixEnum_1.SourceTableSuffixEnum.Tmp;
440
+ // copy transformed data to tmp table by stream
441
+ yield new Promise((resolve, reject) => {
442
+ const stream = client
443
+ .query((0, pg_copy_streams_1.from)(`COPY "${const_1.PG_SCHEMA}".${tmpTableName} FROM STDIN DELIMITER ',' CSV HEADER;`))
444
+ .on("error", (err) => __awaiter(this, void 0, void 0, function* () {
445
+ helpers_1.log.error(`Datasets: copying to tmp error (${modelName}): ${err.toString()}`);
446
+ yield connection.connectionManager.releaseConnection(client);
447
+ return reject(err);
448
+ }))
449
+ .on("finish", () => __awaiter(this, void 0, void 0, function* () {
450
+ helpers_1.log.info(`Datasets: copying to tmp success (${modelName})`);
451
+ yield connection.connectionManager.releaseConnection(client);
452
+ return resolve();
453
+ }));
454
+ data.pipe(stream);
455
+ });
456
+ });
457
+ this.getTmpModelByName = (name) => __awaiter(this, void 0, void 0, function* () {
458
+ const modelDef = ropid_gtfs_1.RopidGTFS[name];
459
+ if (!modelDef || !modelDef.name || !modelDef.pgTableName || !modelDef.outputSequelizeAttributes) {
460
+ throw new Error("Model not found.");
461
+ }
462
+ const model = new models_1.PostgresModel(modelDef.name + "Tmp" + "Model", {
463
+ hasTmpTable: false,
464
+ outputSequelizeAttributes: modelDef.outputSequelizeAttributes,
465
+ pgSchema: const_1.PG_SCHEMA,
466
+ pgTableName: modelDef.pgTableName + SourceTableSuffixEnum_1.SourceTableSuffixEnum.Tmp,
467
+ savingType: "insertOnly",
468
+ sequelizeAdditionalSettings: Object.assign({ timestamps: false }, (modelDef.modelIndexOptions &&
469
+ modelDef.modelIndexOptions.length && {
470
+ indexes: modelDef.modelIndexOptions.map((indexDef) => {
471
+ return Object.assign(Object.assign({}, indexDef), { name: indexDef.name + SourceTableSuffixEnum_1.SourceTableSuffixEnum.Tmp });
472
+ }),
473
+ })),
474
+ }, new golemio_validator_1.JSONSchemaValidator(modelDef.name + "Tmp" + "ModelValidator", modelDef.outputMongooseSchemaObject));
475
+ return model;
476
+ });
477
+ this.createTmpModel = (name) => __awaiter(this, void 0, void 0, function* () {
478
+ const model = yield this.getTmpModelByName(name);
479
+ if (ropid_gtfs_1.RopidGTFS[name].modelIndexOptions) {
480
+ yield model.query((0, utils_1.buildDropIndexQuery)(ropid_gtfs_1.RopidGTFS[name].modelIndexOptions));
481
+ }
482
+ yield model.sync({ force: true, schema: const_1.PG_SCHEMA });
483
+ return model;
484
+ });
485
+ this.createAndPopulatePrecomputedTmpTables = (sourceTableSuffix) => __awaiter(this, void 0, void 0, function* () {
486
+ helpers_1.log.info(`Datasets: creating temp table ${this.servicesCalendarRepository["tableName"]}${SourceTableSuffixEnum_1.SourceTableSuffixEnum.Tmp}`);
487
+ yield this.servicesCalendarRepository.createAndPopulate(sourceTableSuffix);
488
+ helpers_1.log.info(`Datasets: creating indexes on ${this.servicesCalendarRepository["tableName"]}${SourceTableSuffixEnum_1.SourceTableSuffixEnum.Tmp}`);
489
+ yield this.servicesCalendarRepository.createIndexes();
490
+ helpers_1.log.info(`Datasets: creating temp table ${this.minMaxStopSequencesRepository["tableName"]}${SourceTableSuffixEnum_1.SourceTableSuffixEnum.Tmp}`);
491
+ yield this.minMaxStopSequencesRepository.createAndPopulate(sourceTableSuffix);
492
+ helpers_1.log.info(`Datasets: creating indexes on ${this.minMaxStopSequencesRepository["tableName"]}${SourceTableSuffixEnum_1.SourceTableSuffixEnum.Tmp}`);
493
+ yield this.minMaxStopSequencesRepository.createIndexes();
494
+ helpers_1.log.info(`Datasets: creating temp table ${this.tripScheduleRepository["tableName"]}${SourceTableSuffixEnum_1.SourceTableSuffixEnum.Tmp}`);
495
+ yield this.tripScheduleRepository.createAndPopulate(sourceTableSuffix);
496
+ helpers_1.log.info(`Datasets: creating indexes on ${this.tripScheduleRepository["tableName"]}${SourceTableSuffixEnum_1.SourceTableSuffixEnum.Tmp}`);
497
+ yield this.tripScheduleRepository.createIndexes();
498
+ helpers_1.log.info(`Datasets: creating temp table ${this.departuresRepository["tableName"]}${SourceTableSuffixEnum_1.SourceTableSuffixEnum.Tmp}`);
499
+ yield this.departuresRepository.createAndPopulate(sourceTableSuffix);
500
+ helpers_1.log.info(`Datasets: creating indexes on ${this.departuresRepository["tableName"]}${SourceTableSuffixEnum_1.SourceTableSuffixEnum.Tmp}`);
501
+ yield this.departuresRepository.createIndexes();
502
+ helpers_1.log.info(`Datasets: running analyze on ${this.departuresRepository["tableName"]}${SourceTableSuffixEnum_1.SourceTableSuffixEnum.Tmp}`);
503
+ yield this.departuresRepository.analyze();
504
+ });
46
505
  // MetaData Model
47
- this.metaModel = Di_2.RopidGtfsContainer.resolve(ModuleContainerToken_1.ModuleContainerToken.RopidGTFSMetadataModel);
506
+ this.metaModel = new _1.RopidGTFSMetadataModel();
48
507
  // Ropid Departures Presets
49
508
  this.dataSourceDeparturesPresets = new datasources_1.DataSource(ropid_departures_presets_1.RopidDeparturesPresets.name + "DataSource", new datasources_1.FTPProtocolStrategy({
50
509
  filename: config_1.config.datasources.RopidDeparturesPresetsFilename,
@@ -52,8 +511,87 @@ class LegacyRopidGTFSWorker extends workers_1.BaseWorker {
52
511
  url: config_1.config.datasources.RopidFTP,
53
512
  encoding: "utf8",
54
513
  }), new datasources_1.JSONDataTypeStrategy({ resultsPath: "" }), new golemio_validator_1.JSONSchemaValidator(ropid_departures_presets_1.RopidDeparturesPresets.name + "DataSource", ropid_departures_presets_1.RopidDeparturesPresets.datasourceJsonSchema));
514
+ /** Ropid GTFS Dataset Map Dependencies **/
515
+ // Ropid GTFS
516
+ this.dataSourceGtfs = new datasources_1.DataSource(ropid_gtfs_1.RopidGTFS.name + "DataSource", new datasources_1.FTPProtocolStrategy({
517
+ filename: config_1.config.datasources.RopidGTFSFilename,
518
+ targetType: datasources_1.FTPTargetType.COMPRESSED,
519
+ returnType: datasources_1.FTPReturnType.Stream,
520
+ path: config_1.config.datasources.RopidGTFSPath,
521
+ url: config_1.config.datasources.RopidFTP,
522
+ whitelistedFiles: [
523
+ "agency.txt",
524
+ "calendar.txt",
525
+ "calendar_dates.txt",
526
+ "shapes.txt",
527
+ "stop_times.txt",
528
+ "stops.txt",
529
+ "routes.txt",
530
+ "trips.txt",
531
+ ],
532
+ encoding: "utf8",
533
+ }), new datasources_1.JSONDataTypeStrategy({ resultsPath: "" }), null);
534
+ this.transformationGtfs = new _1.RopidGTFSTransformation();
535
+ // Ropid GTFS Run Numbers Datasource
536
+ this.dataSourceRunNumbers = new datasources_1.DataSource(ropid_gtfs_1.RopidGTFS.run_numbers.name + "DataSource", new datasources_1.FTPProtocolStrategy({
537
+ filename: config_1.config.datasources.RopidGTFSRunNumbersFilename,
538
+ returnType: datasources_1.FTPReturnType.Stream,
539
+ path: config_1.config.datasources.RopidGTFSRunNumbersPath,
540
+ url: config_1.config.datasources.RopidFTP,
541
+ encoding: "utf8",
542
+ }), new datasources_1.JSONDataTypeStrategy({ resultsPath: "" }), null);
543
+ // Ropid GTFS CIS STOPS Datasource
544
+ const cisStopsTypeStrategy = new datasources_1.JSONDataTypeStrategy({ resultsPath: "stopGroups" });
545
+ cisStopsTypeStrategy.setFilter((item) => item.cis !== 0);
546
+ this.dataSourceCisStops = new datasources_1.DataSource(ropid_gtfs_1.RopidGTFS.name + "CisStops", new datasources_1.FTPProtocolStrategy({
547
+ filename: config_1.config.datasources.RopidGTFSCisStopsFilename,
548
+ path: config_1.config.datasources.RopidGTFSCisStopsPath,
549
+ url: config_1.config.datasources.RopidFTP,
550
+ encoding: "utf8",
551
+ }), cisStopsTypeStrategy, null);
552
+ this.transformationCisStops = new _1.RopidGTFSCisStopsTransformation();
553
+ // Ropid GTFS Ois Datasource
554
+ this.dataSourceOisMapping = new datasources_1.DataSource(ropid_gtfs_1.RopidGTFS.name + "Ois", new datasources_1.FTPProtocolStrategy({
555
+ filename: config_1.config.datasources.RopidGTFSOisFilename,
556
+ path: config_1.config.datasources.RopidGTFSOisPath,
557
+ url: config_1.config.datasources.RopidFTP,
558
+ encoding: "utf8",
559
+ }), new datasources_1.JSONDataTypeStrategy({ resultsPath: "" }), new golemio_validator_1.JSONSchemaValidator(ropid_gtfs_1.RopidGTFS.ois.name + "DataSource", ropid_gtfs_1.RopidGTFS.ois.datasourceJsonSchema));
560
+ this.transformationOisMapping = new RopidGTFSOisTransformation_1.RopidGTFSOisMappingTransformation();
561
+ this.datasetMap = {
562
+ [_1.DatasetEnum.PID_GTFS]: {
563
+ datasource: this.dataSourceGtfs,
564
+ transformation: this.transformationGtfs,
565
+ cacheContentType: CacheContentType.CSV,
566
+ },
567
+ [_1.DatasetEnum.RUN_NUMBERS]: {
568
+ datasource: this.dataSourceRunNumbers,
569
+ transformation: this.transformationGtfs,
570
+ cacheContentType: CacheContentType.CSV,
571
+ },
572
+ [_1.DatasetEnum.CIS_STOPS]: {
573
+ datasource: this.dataSourceCisStops,
574
+ transformation: this.transformationCisStops,
575
+ cacheContentType: CacheContentType.JSON,
576
+ },
577
+ [_1.DatasetEnum.OIS_MAPPING]: {
578
+ datasource: this.dataSourceOisMapping,
579
+ transformation: this.transformationOisMapping,
580
+ cacheContentType: CacheContentType.JSON,
581
+ },
582
+ };
583
+ /** Precomputed data repositories */
584
+ this.departuresRepository = new precomputed_1.DeparturesRepository();
585
+ this.minMaxStopSequencesRepository = new precomputed_1.MinMaxStopSequencesRepository();
586
+ this.tripScheduleRepository = new precomputed_1.TripScheduleRepository();
587
+ this.servicesCalendarRepository = new precomputed_1.ServicesCalendarRepository();
588
+ // Redis repositories
589
+ this.staticFileRedisRepository = new cache_1.StaticFileRedisRepository();
590
+ this.dataCacheManager = DataCacheManager_1.DataCacheManager.getInstance();
591
+ this.gtfsRedisChannel = new pubsub_1.RedisPubSubChannel(ropid_gtfs_1.RopidGTFS.name);
55
592
  this.queuePrefix = config_1.config.RABBIT_EXCHANGE_NAME + "." + ropid_gtfs_1.RopidGTFS.name.toLowerCase();
56
593
  }
57
594
  }
58
595
  exports.LegacyRopidGTFSWorker = LegacyRopidGTFSWorker;
596
+ LegacyRopidGTFSWorker.ORIGIN_HOSTNAME_HEADER = "x-origin-hostname";
59
597
  //# sourceMappingURL=LegacyRopidGTFSWorker.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"LegacyRopidGTFSWorker.js","sourceRoot":"","sources":["../../../src/integration-engine/ropid-gtfs/LegacyRopidGTFSWorker.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,kCAA0C;AAC1C,sEAAoE;AACpE,gGAA+F;AAC/F,oEAA4C;AAC5C,yEAAsE;AACtE,mFAA0H;AAC1H,2EAA2E;AAC3E,mFAAkF;AAClF,wBAAwD;AAExD,iCAA8C;AAM9C,MAAa,qBAAsB,SAAQ,oBAAU;IAKjD;QACI,KAAK,EAAE,CAAC;QAqBZ;;WAEG;QACI,iCAA4B,GAAG,GAAwB,EAAE;YAC5D,sCAAsC;YACtC,MAAM,mCAAmC,GAAG,MAAM,IAAI,CAAC,2BAA2B,CAAC,eAAe,EAAE,CAAC;YACrG,MAAM,+BAA+B,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,eAAe,CAAC,cAAW,CAAC,kBAAkB,CAAC,CAAC;YAC7G,IAAI,mC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