@golemio/pid 2.8.4-dev.951931360 → 2.8.4-dev.952072231
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/dist/integration-engine/ropid-gtfs/LegacyRopidGTFSWorker.js +31 -9
- package/dist/integration-engine/ropid-gtfs/LegacyRopidGTFSWorker.js.map +1 -1
- package/dist/integration-engine/vehicle-positions/workers/runs/transformations/CommonRunsMessagesTransformation.js +1 -1
- package/dist/integration-engine/vehicle-positions/workers/runs/transformations/CommonRunsMessagesTransformation.js.map +1 -1
- package/package.json +1 -1
|
@@ -16,7 +16,9 @@ const ropid_departures_presets_1 = require("../../schema-definitions/ropid-depar
|
|
|
16
16
|
const ropid_gtfs_1 = require("../../schema-definitions/ropid-gtfs");
|
|
17
17
|
const config_1 = require("@golemio/core/dist/integration-engine/config");
|
|
18
18
|
const datasources_1 = require("@golemio/core/dist/integration-engine/datasources");
|
|
19
|
+
const RetryDataSource_1 = require("@golemio/core/dist/integration-engine/datasources/RetryDataSource");
|
|
19
20
|
const workers_1 = require("@golemio/core/dist/integration-engine/workers");
|
|
21
|
+
const golemio_errors_1 = require("@golemio/core/dist/shared/golemio-errors");
|
|
20
22
|
const golemio_validator_1 = require("@golemio/core/dist/shared/golemio-validator");
|
|
21
23
|
const _1 = require(".");
|
|
22
24
|
const Di_2 = require("./ioc/Di");
|
|
@@ -28,25 +30,45 @@ class LegacyRopidGTFSWorker extends workers_1.BaseWorker {
|
|
|
28
30
|
*/
|
|
29
31
|
this.checkForNewDeparturesPresets = () => __awaiter(this, void 0, void 0, function* () {
|
|
30
32
|
// checking DEPARTURES_PRESETS dataset
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
try {
|
|
34
|
+
const departuresPresetsServerLastModified = yield this.dataSourceDeparturesPresets.getLastModified();
|
|
35
|
+
const departuresPresetsDbLastModified = yield this.metaModel.getLastModified(_1.DatasetEnum.DEPARTURES_PRESETS);
|
|
36
|
+
if (departuresPresetsServerLastModified !== departuresPresetsDbLastModified.lastModified) {
|
|
37
|
+
yield this.sendMessageToExchange("workers." + this.queuePrefix + ".downloadDeparturesPresets", "Just do it!");
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
catch (err) {
|
|
41
|
+
if (err instanceof golemio_errors_1.AbstractGolemioError) {
|
|
42
|
+
throw err;
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
throw new golemio_errors_1.GeneralError("Error while checking for new departures presets", this.constructor.name, err);
|
|
46
|
+
}
|
|
35
47
|
}
|
|
36
48
|
});
|
|
37
49
|
/**
|
|
38
50
|
* Queue listener method - triggers processing of DEPARTURES_PRESETS dataset
|
|
39
51
|
*/
|
|
40
52
|
this.downloadDeparturesPresets = () => __awaiter(this, void 0, void 0, function* () {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
53
|
+
try {
|
|
54
|
+
const file = yield this.dataSourceDeparturesPresets.getAll();
|
|
55
|
+
const lastModified = yield this.dataSourceDeparturesPresets.getLastModified();
|
|
56
|
+
const facade = Di_1.PidContainer.resolve(ModuleContainerToken_1.ModuleContainerToken.DeparturePresetsFacade);
|
|
57
|
+
yield facade.handleNewDeparturePresets(file.data, lastModified);
|
|
58
|
+
}
|
|
59
|
+
catch (err) {
|
|
60
|
+
if (err instanceof golemio_errors_1.AbstractGolemioError) {
|
|
61
|
+
throw err;
|
|
62
|
+
}
|
|
63
|
+
else {
|
|
64
|
+
throw new golemio_errors_1.GeneralError("Error while downloading departures presets", this.constructor.name, err);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
45
67
|
});
|
|
46
68
|
// MetaData Model
|
|
47
69
|
this.metaModel = Di_2.RopidGtfsContainer.resolve(ModuleContainerToken_1.ModuleContainerToken.RopidGTFSMetadataModel);
|
|
48
70
|
// Ropid Departures Presets
|
|
49
|
-
this.dataSourceDeparturesPresets = new
|
|
71
|
+
this.dataSourceDeparturesPresets = new RetryDataSource_1.RetryDataSource(ropid_departures_presets_1.RopidDeparturesPresets.name + "DataSource", new datasources_1.FTPProtocolStrategy({
|
|
50
72
|
filename: config_1.config.datasources.RopidDeparturesPresetsFilename,
|
|
51
73
|
path: config_1.config.datasources.RopidDeparturesPresetsPath,
|
|
52
74
|
url: config_1.config.datasources.RopidFTP,
|
|
@@ -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;
|
|
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,uGAAoG;AACpG,2EAA2E;AAC3E,6EAA8F;AAC9F,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,IAAI;gBACA,MAAM,mCAAmC,GAAG,MAAM,IAAI,CAAC,2BAA2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AAyB,2CAAoB,CAAC,sBAAsB,CAAC,CAAC;QAEjH,2BAA2B;QAC3B,IAAI,CAAC,2BAA2B,GAAG,IAAI,iCAAe,CAClD,iDAAsB,CAAC,IAAI,GAAG,YAAY,EAC1C,IAAI,iCAAmB,CAAC;YACpB,QAAQ,EAAE,eAAM,CAAC,WAAW,CAAC,8BAA8B;YAC3D,IAAI,EAAE,eAAM,CAAC,WAAW,CAAC,0BAA0B;YACnD,GAAG,EAAE,eAAM,CAAC,WAAW,CAAC,QAAQ;YAChC,QAAQ,EAAE,MAAM;SACnB,CAAC,EACF,IAAI,kCAAoB,CAAC,EAAE,WAAW,EAAE,EAAE,EAAE,CAAC,EAC7C,IAAI,uCAAmB,CAAC,iDAAsB,CAAC,IAAI,GAAG,YAAY,EAAE,iDAAsB,CAAC,oBAAoB,CAAC,CACnH,CAAC;QAEF,IAAI,CAAC,WAAW,GAAG,eAAM,CAAC,oBAAoB,GAAG,GAAG,GAAG,sBAAS,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC;IACxF,CAAC;CAwCJ;AAjED,sDAiEC"}
|
|
@@ -36,7 +36,7 @@ class CommonRunsMessagesTransformation extends transformations_1.BaseTransformat
|
|
|
36
36
|
res.push(elementTransformed);
|
|
37
37
|
}
|
|
38
38
|
catch (err) {
|
|
39
|
-
helpers_1.log.
|
|
39
|
+
helpers_1.log.verbose(`${this.name}: invalid run parameters: ${JSON.stringify(element).substring(0, 2000)}`);
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
42
|
return res;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CommonRunsMessagesTransformation.js","sourceRoot":"","sources":["../../../../../../src/integration-engine/vehicle-positions/workers/runs/transformations/CommonRunsMessagesTransformation.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AACA,2EAAoE;AACpE,2FAA4G;AAC5G,gGAA+D;AAC/D,gEAA6D;AAI7D,MAAa,gCAAiC,SAAQ,oCAAkB;IAIpE;QACI,KAAK,EAAE,CAAC;QAJL,SAAI,GAAG,kCAAkC,CAAC;QAQjD;;WAEG;QACI,cAAS,GAAG,CACf,EAAE,IAAI,EAAE,SAAS,EAAwB,EACzC,SAAkB,KAAK,EACY,EAAE;YACrC,MAAM,GAAG,GAAG,IAAA,yBAAM,EAAC,SAAS,CAAC,CAAC,EAAE,CAAC,eAAe,CAAC,CAAC,MAAM,EAAE,CAAC;YAC3D,MAAM,GAAG,GAA+B,EAAE,CAAC;YAE3C,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;gBACtB,IAAI,GAAG,CAAC,IAAI,CAAC,CAAC;aACjB;YACD,KAAK,MAAM,OAAO,IAAI,IAAI,EAAE;gBACxB,IAAI;oBACA,MAAM,kBAAkB,GAAG,MAAM,IAAI,CAAC,gBAAgB,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,GAAG,EAAE,EAAE,MAAM,CAAC,CAAC;oBAClG,GAAG,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC;iBAChC;gBAAC,OAAO,GAAG,EAAE;oBACV,aAAG,CAAC,
|
|
1
|
+
{"version":3,"file":"CommonRunsMessagesTransformation.js","sourceRoot":"","sources":["../../../../../../src/integration-engine/vehicle-positions/workers/runs/transformations/CommonRunsMessagesTransformation.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AACA,2EAAoE;AACpE,2FAA4G;AAC5G,gGAA+D;AAC/D,gEAA6D;AAI7D,MAAa,gCAAiC,SAAQ,oCAAkB;IAIpE;QACI,KAAK,EAAE,CAAC;QAJL,SAAI,GAAG,kCAAkC,CAAC;QAQjD;;WAEG;QACI,cAAS,GAAG,CACf,EAAE,IAAI,EAAE,SAAS,EAAwB,EACzC,SAAkB,KAAK,EACY,EAAE;YACrC,MAAM,GAAG,GAAG,IAAA,yBAAM,EAAC,SAAS,CAAC,CAAC,EAAE,CAAC,eAAe,CAAC,CAAC,MAAM,EAAE,CAAC;YAC3D,MAAM,GAAG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