@golemio/pid 2.8.1 → 2.8.2-dev.943885572

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 (74) hide show
  1. package/db/example/12_metro_line_A_gtfs_trips.sql +4 -0
  2. package/dist/helpers/AccessibilityEnums.d.ts +16 -0
  3. package/dist/helpers/AccessibilityEnums.js +22 -0
  4. package/dist/helpers/AccessibilityEnums.js.map +1 -0
  5. package/dist/integration-engine/index.js +2 -0
  6. package/dist/integration-engine/index.js.map +1 -1
  7. package/dist/integration-engine/queueDefinitions.js +0 -50
  8. package/dist/integration-engine/queueDefinitions.js.map +1 -1
  9. package/dist/integration-engine/ropid-gtfs/LegacyRopidGTFSWorker.d.ts +0 -63
  10. package/dist/integration-engine/ropid-gtfs/LegacyRopidGTFSWorker.js +3 -541
  11. package/dist/integration-engine/ropid-gtfs/LegacyRopidGTFSWorker.js.map +1 -1
  12. package/dist/integration-engine/ropid-gtfs/data-access/cache/StaticFileRedisRepository.js +18 -4
  13. package/dist/integration-engine/ropid-gtfs/data-access/cache/StaticFileRedisRepository.js.map +1 -1
  14. package/dist/integration-engine/ropid-gtfs/ioc/Di.d.ts +3 -0
  15. package/dist/integration-engine/ropid-gtfs/ioc/Di.js +29 -0
  16. package/dist/integration-engine/ropid-gtfs/ioc/Di.js.map +1 -0
  17. package/dist/integration-engine/ropid-gtfs/ioc/RopidGtfsContainerToken.d.ts +8 -0
  18. package/dist/integration-engine/ropid-gtfs/ioc/RopidGtfsContainerToken.js +12 -0
  19. package/dist/integration-engine/ropid-gtfs/ioc/RopidGtfsContainerToken.js.map +1 -0
  20. package/dist/integration-engine/ropid-gtfs/transformations/RopidGTFSTransformation.js +16 -3
  21. package/dist/integration-engine/ropid-gtfs/transformations/RopidGTFSTransformation.js.map +1 -1
  22. package/dist/integration-engine/ropid-gtfs/workers/timetables/TimetableWorker.d.ts +5 -0
  23. package/dist/integration-engine/ropid-gtfs/workers/timetables/TimetableWorker.js +23 -0
  24. package/dist/integration-engine/ropid-gtfs/workers/timetables/TimetableWorker.js.map +1 -0
  25. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/CheckForNewDataTask.d.ts +12 -0
  26. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/CheckForNewDataTask.js +61 -0
  27. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/CheckForNewDataTask.js.map +1 -0
  28. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/CheckSavedRowsAndReplaceTablesTask.d.ts +14 -0
  29. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/CheckSavedRowsAndReplaceTablesTask.js +93 -0
  30. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/CheckSavedRowsAndReplaceTablesTask.js.map +1 -0
  31. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/DownloadDatasetsTask.d.ts +19 -0
  32. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/DownloadDatasetsTask.js +152 -0
  33. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/DownloadDatasetsTask.js.map +1 -0
  34. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/RefreshPrecomputedTablesTask.d.ts +11 -0
  35. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/RefreshPrecomputedTablesTask.js +57 -0
  36. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/RefreshPrecomputedTablesTask.js.map +1 -0
  37. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/TransformAndSaveDataTask.d.ts +21 -0
  38. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/TransformAndSaveDataTask.js +160 -0
  39. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/TransformAndSaveDataTask.js.map +1 -0
  40. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/helpers/HelperTypes.d.ts +24 -0
  41. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/helpers/HelperTypes.js +36 -0
  42. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/helpers/HelperTypes.js.map +1 -0
  43. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/helpers/PrecomputedTablesFacade.d.ts +12 -0
  44. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/helpers/PrecomputedTablesFacade.js +67 -0
  45. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/helpers/PrecomputedTablesFacade.js.map +1 -0
  46. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/helpers/RopidGtfsFactory.d.ts +13 -0
  47. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/helpers/RopidGtfsFactory.js +102 -0
  48. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/helpers/RopidGtfsFactory.js.map +1 -0
  49. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/interfaces/ICheckForNewDataInput.js.map +1 -0
  50. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/interfaces/IDatasetsInput.d.ts +4 -0
  51. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/interfaces/IDatasetsInput.js +3 -0
  52. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/interfaces/IDatasetsInput.js.map +1 -0
  53. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/schema/CachedDatasetSchema.d.ts +8 -0
  54. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/schema/CachedDatasetSchema.js +40 -0
  55. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/schema/CachedDatasetSchema.js.map +1 -0
  56. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/schema/CheckForNewDataMessageValidation.d.ts +4 -0
  57. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/schema/CheckForNewDataMessageValidation.js +22 -0
  58. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/schema/CheckForNewDataMessageValidation.js.map +1 -0
  59. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/schema/DownloadDataInputSchema.d.ts +5 -0
  60. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/schema/DownloadDataInputSchema.js +23 -0
  61. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/schema/DownloadDataInputSchema.js.map +1 -0
  62. package/dist/output-gateway/pid/helpers/DepartureBoardMapper.d.ts +3 -3
  63. package/dist/output-gateway/pid/helpers/DepartureBoardMapper.js +21 -3
  64. package/dist/output-gateway/pid/helpers/DepartureBoardMapper.js.map +1 -1
  65. package/dist/output-gateway/pid/index.d.ts +3 -2
  66. package/dist/output-gateway/pid/index.js +1 -1
  67. package/dist/output-gateway/pid/index.js.map +1 -1
  68. package/dist/schema-definitions/ropid-gtfs/models/precomputed/interfaces/IDeparturesModel.d.ts +3 -2
  69. package/docs/implementation_documentation.md +39 -37
  70. package/docs/openapi-output.yaml +1 -1
  71. package/package.json +3 -3
  72. package/dist/integration-engine/ropid-gtfs/interfaces/ICheckForNewDataInput.js.map +0 -1
  73. /package/dist/integration-engine/ropid-gtfs/{interfaces → workers/timetables/tasks/interfaces}/ICheckForNewDataInput.d.ts +0 -0
  74. /package/dist/integration-engine/ropid-gtfs/{interfaces → workers/timetables/tasks/interfaces}/ICheckForNewDataInput.js +0 -0
@@ -1,15 +1,29 @@
1
1
  "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ var StaticFileRedisRepository_1;
2
12
  Object.defineProperty(exports, "__esModule", { value: true });
3
13
  exports.StaticFileRedisRepository = void 0;
4
14
  const RedisModel_1 = require("@golemio/core/dist/integration-engine/models/RedisModel");
5
- class StaticFileRedisRepository extends RedisModel_1.RedisModel {
15
+ const tsyringe_1 = require("@golemio/core/dist/shared/tsyringe");
16
+ let StaticFileRedisRepository = exports.StaticFileRedisRepository = StaticFileRedisRepository_1 = class StaticFileRedisRepository extends RedisModel_1.RedisModel {
6
17
  constructor() {
7
18
  super("GTFSStaticFileRedisRepository", {
8
19
  isKeyConstructedFromData: false,
9
- prefix: StaticFileRedisRepository.NAMESPACE_PREFIX,
20
+ prefix: StaticFileRedisRepository_1.NAMESPACE_PREFIX,
10
21
  });
11
22
  }
12
- }
13
- exports.StaticFileRedisRepository = StaticFileRedisRepository;
23
+ };
14
24
  StaticFileRedisRepository.NAMESPACE_PREFIX = "files:gtfsStatic";
25
+ exports.StaticFileRedisRepository = StaticFileRedisRepository = StaticFileRedisRepository_1 = __decorate([
26
+ (0, tsyringe_1.injectable)(),
27
+ __metadata("design:paramtypes", [])
28
+ ], StaticFileRedisRepository);
15
29
  //# sourceMappingURL=StaticFileRedisRepository.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"StaticFileRedisRepository.js","sourceRoot":"","sources":["../../../../../src/integration-engine/ropid-gtfs/data-access/cache/StaticFileRedisRepository.ts"],"names":[],"mappings":";;;AAAA,wFAAqF;AAErF,MAAa,yBAA0B,SAAQ,uBAAU;IAGrD;QACI,KAAK,CAAC,+BAA+B,EAAE;YACnC,wBAAwB,EAAE,KAAK;YAC/B,MAAM,EAAE,yBAAyB,CAAC,gBAAgB;SACrD,CAAC,CAAC;IACP,CAAC;;AARL,8DASC;AARiB,0CAAgB,GAAG,kBAAkB,CAAC"}
1
+ {"version":3,"file":"StaticFileRedisRepository.js","sourceRoot":"","sources":["../../../../../src/integration-engine/ropid-gtfs/data-access/cache/StaticFileRedisRepository.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,wFAAqF;AACrF,iEAAgE;AAGzD,IAAM,yBAAyB,qEAA/B,MAAM,yBAA0B,SAAQ,uBAAU;IAGrD;QACI,KAAK,CAAC,+BAA+B,EAAE;YACnC,wBAAwB,EAAE,KAAK;YAC/B,MAAM,EAAE,2BAAyB,CAAC,gBAAgB;SACrD,CAAC,CAAC;IACP,CAAC;;AAPa,0CAAgB,GAAG,kBAAkB,AAArB,CAAsB;oCAD3C,yBAAyB;IADrC,IAAA,qBAAU,GAAE;;GACA,yBAAyB,CASrC"}
@@ -0,0 +1,3 @@
1
+ import { DependencyContainer } from "@golemio/core/dist/shared/tsyringe";
2
+ declare const RopidGtfsContainer: DependencyContainer;
3
+ export { RopidGtfsContainer };
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RopidGtfsContainer = void 0;
4
+ const Di_1 = require("../../ioc/Di");
5
+ const ropid_gtfs_1 = require("../../../schema-definitions/ropid-gtfs");
6
+ const pubsub_1 = require("@golemio/core/dist/integration-engine/data-access/pubsub");
7
+ const tsyringe_1 = require("@golemio/core/dist/shared/tsyringe");
8
+ const StaticFileRedisRepository_1 = require("../data-access/cache/StaticFileRedisRepository");
9
+ const RopidGTFSTransformation_1 = require("../transformations/RopidGTFSTransformation");
10
+ const PrecomputedTablesFacade_1 = require("../workers/timetables/tasks/helpers/PrecomputedTablesFacade");
11
+ const RopidGtfsFactory_1 = require("../workers/timetables/tasks/helpers/RopidGtfsFactory");
12
+ const RopidGtfsContainerToken_1 = require("./RopidGtfsContainerToken");
13
+ //#region Initialization
14
+ const RopidGtfsContainer = Di_1.PidContainer.createChildContainer();
15
+ exports.RopidGtfsContainer = RopidGtfsContainer;
16
+ //#endregion
17
+ //#region Datasources
18
+ //#endregion
19
+ //#region Repositories
20
+ RopidGtfsContainer.registerSingleton(RopidGtfsContainerToken_1.RopidGtfsContainerToken.StaticFileRedisRepository, StaticFileRedisRepository_1.StaticFileRedisRepository);
21
+ //#endregion
22
+ //#region Transformations
23
+ RopidGtfsContainer.registerSingleton(RopidGtfsContainerToken_1.RopidGtfsContainerToken.RopidGTFSTransformation, RopidGTFSTransformation_1.RopidGTFSTransformation);
24
+ //#endregion
25
+ //#region Facade
26
+ RopidGtfsContainer.registerSingleton(RopidGtfsContainerToken_1.RopidGtfsContainerToken.PrecomputedTablesFacade, PrecomputedTablesFacade_1.PrecomputedTablesFacade)
27
+ .register(RopidGtfsContainerToken_1.RopidGtfsContainerToken.RopidGtfsFactory, RopidGtfsFactory_1.RopidGtfsFactory, { lifecycle: tsyringe_1.Lifecycle.Transient })
28
+ .registerInstance(RopidGtfsContainerToken_1.RopidGtfsContainerToken.RedisPubSubChannel, new pubsub_1.RedisPubSubChannel(ropid_gtfs_1.RopidGTFS.name));
29
+ //# sourceMappingURL=Di.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Di.js","sourceRoot":"","sources":["../../../../src/integration-engine/ropid-gtfs/ioc/Di.ts"],"names":[],"mappings":";;;AAAA,qCAA0C;AAC1C,uEAA4C;AAC5C,qFAA8F;AAC9F,iEAAoF;AACpF,8FAA2F;AAC3F,wFAAqF;AACrF,yGAAsG;AACtG,2FAAwF;AACxF,uEAAoE;AAEpE,wBAAwB;AACxB,MAAM,kBAAkB,GAAwB,iBAAY,CAAC,oBAAoB,EAAE,CAAC;AAqB3E,gDAAkB;AApB3B,YAAY;AAEZ,qBAAqB;AAErB,YAAY;AAEZ,sBAAsB;AACtB,kBAAkB,CAAC,iBAAiB,CAAC,iDAAuB,CAAC,yBAAyB,EAAE,qDAAyB,CAAC,CAAC;AACnH,YAAY;AAEZ,yBAAyB;AACzB,kBAAkB,CAAC,iBAAiB,CAAC,iDAAuB,CAAC,uBAAuB,EAAE,iDAAuB,CAAC,CAAC;AAC/G,YAAY;AAEZ,gBAAgB;AAChB,kBAAkB,CAAC,iBAAiB,CAAC,iDAAuB,CAAC,uBAAuB,EAAE,iDAAuB,CAAC;KACzG,QAAQ,CAAC,iDAAuB,CAAC,gBAAgB,EAAE,mCAAgB,EAAE,EAAE,SAAS,EAAE,oBAAS,CAAC,SAAS,EAAE,CAAC;KACxG,gBAAgB,CAAC,iDAAuB,CAAC,kBAAkB,EAAE,IAAI,2BAAkB,CAAC,sBAAS,CAAC,IAAI,CAAC,CAAC,CAAC"}
@@ -0,0 +1,8 @@
1
+ declare const RopidGtfsContainerToken: {
2
+ PrecomputedTablesFacade: symbol;
3
+ StaticFileRedisRepository: symbol;
4
+ RopidGTFSTransformation: symbol;
5
+ RopidGtfsFactory: symbol;
6
+ RedisPubSubChannel: symbol;
7
+ };
8
+ export { RopidGtfsContainerToken };
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RopidGtfsContainerToken = void 0;
4
+ const RopidGtfsContainerToken = {
5
+ PrecomputedTablesFacade: Symbol(),
6
+ StaticFileRedisRepository: Symbol(),
7
+ RopidGTFSTransformation: Symbol(),
8
+ RopidGtfsFactory: Symbol(),
9
+ RedisPubSubChannel: Symbol(),
10
+ };
11
+ exports.RopidGtfsContainerToken = RopidGtfsContainerToken;
12
+ //# sourceMappingURL=RopidGtfsContainerToken.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RopidGtfsContainerToken.js","sourceRoot":"","sources":["../../../../src/integration-engine/ropid-gtfs/ioc/RopidGtfsContainerToken.ts"],"names":[],"mappings":";;;AAAA,MAAM,uBAAuB,GAAG;IAC5B,uBAAuB,EAAE,MAAM,EAAE;IACjC,yBAAyB,EAAE,MAAM,EAAE;IACnC,uBAAuB,EAAE,MAAM,EAAE;IACjC,gBAAgB,EAAE,MAAM,EAAE;IAC1B,kBAAkB,EAAE,MAAM,EAAE;CAC/B,CAAC;AAEO,0DAAuB"}
@@ -1,4 +1,13 @@
1
1
  "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
2
11
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
12
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
13
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -16,10 +25,11 @@ exports.RopidGTFSTransformation = void 0;
16
25
  const ropid_gtfs_1 = require("../../../schema-definitions/ropid-gtfs");
17
26
  const integration_engine_1 = require("@golemio/core/dist/integration-engine");
18
27
  const transformations_1 = require("@golemio/core/dist/integration-engine/transformations");
28
+ const tsyringe_1 = require("@golemio/core/dist/shared/tsyringe");
19
29
  const csv_parser_1 = __importDefault(require("csv-parser"));
20
30
  const csv_stringify_1 = __importDefault(require("csv-stringify"));
21
31
  const stream_1 = require("stream");
22
- class RopidGTFSTransformation extends transformations_1.BaseTransformation {
32
+ let RopidGTFSTransformation = exports.RopidGTFSTransformation = class RopidGTFSTransformation extends transformations_1.BaseTransformation {
23
33
  constructor() {
24
34
  super();
25
35
  this.transform = (input) => __awaiter(this, void 0, void 0, function* () {
@@ -52,6 +62,9 @@ class RopidGTFSTransformation extends transformations_1.BaseTransformation {
52
62
  this.transformElement = () => { };
53
63
  this.name = ropid_gtfs_1.RopidGTFS.name;
54
64
  }
55
- }
56
- exports.RopidGTFSTransformation = RopidGTFSTransformation;
65
+ };
66
+ exports.RopidGTFSTransformation = RopidGTFSTransformation = __decorate([
67
+ (0, tsyringe_1.injectable)(),
68
+ __metadata("design:paramtypes", [])
69
+ ], RopidGTFSTransformation);
57
70
  //# sourceMappingURL=RopidGTFSTransformation.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"RopidGTFSTransformation.js","sourceRoot":"","sources":["../../../../src/integration-engine/ropid-gtfs/transformations/RopidGTFSTransformation.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,uEAA4C;AAE5C,8EAA4D;AAC5D,2FAA4G;AAC5G,4DAA6B;AAC7B,kEAAsC;AACtC,mCAAuD;AAOvD,MAAa,uBAAwB,SAAQ,oCAAkB;IAG3D;QACI,KAAK,EAAE,CAAC;QAIL,cAAS,GAAG,CAAO,KAAmC,EAAqB,EAAE;YAChF,iEAAiE;YACjE,MAAM,4BAA4B,GAAG,MAAM,CAAC,IAAI,CAAC,sBAAS,CAAC,KAAK,CAAC,IAAuB,CAAC,CAAC,yBAAyB,CAAC;iBAC/G,MAAM,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;iBACnD,MAAM,CAAC,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,EAAE,GAAG,CAAC,EAAE,EAA0B,CAAC,CAAC;YAElF,MAAM,UAAU,GAAG,IAAI,kBAAS,CAAC;gBAC7B,UAAU,EAAE,IAAI;gBAChB,SAAS,CAAC,KAAK,EAAE,SAAS,EAAE,QAAQ;oBAChC,IAAI,CAAC,IAAI,iCAEF,4BAA4B,GAE5B,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC;yBAChB,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,4BAA4B,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;yBACxE,MAAM,CAAC,CAAC,GAAQ,EAAE,GAAG,EAAE,EAAE;wBACtB,GAAG,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC;wBACtB,OAAO,GAAG,CAAC;oBACf,CAAC,EAAE,EAAE,CAAC,EACZ,CAAC;oBACH,QAAQ,EAAE,CAAC;gBACf,CAAC;aACJ,CAAC,CAAC;YAEH,OAAO,IAAA,iBAAQ,EAAC,KAAK,CAAC,YAAY,EAAE,IAAA,oBAAG,GAAE,EAAE,UAAU,EAAE,IAAA,uBAAS,EAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC,GAAG,EAAE,EAAE;gBACxF,IAAI,GAAG,EAAE;oBACL,wBAAG,CAAC,KAAK,CAAC,mCAAmC,KAAK,CAAC,IAAI,MAAM,GAAG,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;oBAC/E,MAAM,GAAG,CAAC;iBACb;qBAAM;oBACH,wBAAG,CAAC,IAAI,CAAC,qCAAqC,KAAK,CAAC,IAAI,GAAG,CAAC,CAAC;iBAChE;YACL,CAAC,CAAC,CAAC;QACP,CAAC,CAAA,CAAC;QAEQ,qBAAgB,GAAG,GAAG,EAAE,GAAE,CAAC,CAAC;QArClC,IAAI,CAAC,IAAI,GAAG,sBAAS,CAAC,IAAI,CAAC;IAC/B,CAAC;CAqCJ;AA3CD,0DA2CC"}
1
+ {"version":3,"file":"RopidGTFSTransformation.js","sourceRoot":"","sources":["../../../../src/integration-engine/ropid-gtfs/transformations/RopidGTFSTransformation.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,uEAA4C;AAE5C,8EAA4D;AAC5D,2FAA4G;AAC5G,iEAAgE;AAChE,4DAA6B;AAC7B,kEAAsC;AACtC,mCAAuD;AAQhD,IAAM,uBAAuB,qCAA7B,MAAM,uBAAwB,SAAQ,oCAAkB;IAG3D;QACI,KAAK,EAAE,CAAC;QAIL,cAAS,GAAG,CAAO,KAAmC,EAAqB,EAAE;YAChF,iEAAiE;YACjE,MAAM,4BAA4B,GAAG,MAAM,CAAC,IAAI,CAAC,sBAAS,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AAM;oBACH,wBAAG,CAAC,IAAI,CAAC,qCAAqC,KAAK,CAAC,IAAI,GAAG,CAAC,CAAC;iBAChE;YACL,CAAC,CAAC,CAAC;QACP,CAAC,CAAA,CAAC;QAEQ,qBAAgB,GAAG,GAAG,EAAE,GAAE,CAAC,CAAC;QArClC,IAAI,CAAC,IAAI,GAAG,sBAAS,CAAC,IAAI,CAAC;IAC/B,CAAC;CAqCJ,CAAA;kCA3CY,uBAAuB;IADnC,IAAA,qBAAU,GAAE;;GACA,uBAAuB,CA2CnC"}
@@ -0,0 +1,5 @@
1
+ import { AbstractWorker } from "@golemio/core/dist/integration-engine/workers";
2
+ export declare class TimetableWorker extends AbstractWorker {
3
+ protected name: string;
4
+ constructor();
5
+ }
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TimetableWorker = void 0;
4
+ const workers_1 = require("@golemio/core/dist/integration-engine/workers");
5
+ const CheckForNewDataTask_1 = require("./tasks/CheckForNewDataTask");
6
+ const CheckSavedRowsAndReplaceTablesTask_1 = require("./tasks/CheckSavedRowsAndReplaceTablesTask");
7
+ const DownloadDatasetsTask_1 = require("./tasks/DownloadDatasetsTask");
8
+ const RefreshPrecomputedTablesTask_1 = require("./tasks/RefreshPrecomputedTablesTask");
9
+ const TransformAndSaveDataTask_1 = require("./tasks/TransformAndSaveDataTask");
10
+ class TimetableWorker extends workers_1.AbstractWorker {
11
+ constructor() {
12
+ super();
13
+ this.name = "ropidgtfs";
14
+ // Register tasks
15
+ this.registerTask(new CheckForNewDataTask_1.CheckForNewDataTask(this.getQueuePrefix()));
16
+ this.registerTask(new CheckSavedRowsAndReplaceTablesTask_1.CheckSavedRowsAndReplaceTablesTask(this.getQueuePrefix()));
17
+ this.registerTask(new DownloadDatasetsTask_1.DownloadDatasetsTask(this.getQueuePrefix()));
18
+ this.registerTask(new RefreshPrecomputedTablesTask_1.RefreshPrecomputedTablesTask(this.getQueuePrefix()));
19
+ this.registerTask(new TransformAndSaveDataTask_1.TransformAndSaveDataTask(this.getQueuePrefix()));
20
+ }
21
+ }
22
+ exports.TimetableWorker = TimetableWorker;
23
+ //# sourceMappingURL=TimetableWorker.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TimetableWorker.js","sourceRoot":"","sources":["../../../../../src/integration-engine/ropid-gtfs/workers/timetables/TimetableWorker.ts"],"names":[],"mappings":";;;AAAA,2EAA+E;AAC/E,qEAAkE;AAClE,mGAAgG;AAChG,uEAAoE;AACpE,uFAAoF;AACpF,+EAA4E;AAE5E,MAAa,eAAgB,SAAQ,wBAAc;IAG/C;QACI,KAAK,EAAE,CAAC;QAHF,SAAI,GAAG,WAAW,CAAC;QAKzB,iBAAiB;QACjB,IAAI,CAAC,YAAY,CAAC,IAAI,yCAAmB,CAAC,IAAI,CAAC,cAAc,EAAE,CAAC,CAAC,CAAC;QAClE,IAAI,CAAC,YAAY,CAAC,IAAI,uEAAkC,CAAC,IAAI,CAAC,cAAc,EAAE,CAAC,CAAC,CAAC;QACjF,IAAI,CAAC,YAAY,CAAC,IAAI,2CAAoB,CAAC,IAAI,CAAC,cAAc,EAAE,CAAC,CAAC,CAAC;QACnE,IAAI,CAAC,YAAY,CAAC,IAAI,2DAA4B,CAAC,IAAI,CAAC,cAAc,EAAE,CAAC,CAAC,CAAC;QAC3E,IAAI,CAAC,YAAY,CAAC,IAAI,mDAAwB,CAAC,IAAI,CAAC,cAAc,EAAE,CAAC,CAAC,CAAC;IAC3E,CAAC;CACJ;AAbD,0CAaC"}
@@ -0,0 +1,12 @@
1
+ import { ICheckForNewDataInput } from "./interfaces/ICheckForNewDataInput";
2
+ import { AbstractTask } from "@golemio/core/dist/integration-engine/workers";
3
+ import { CheckForNewDataMessageValidation } from "./schema/CheckForNewDataMessageValidation";
4
+ export declare class CheckForNewDataTask extends AbstractTask<ICheckForNewDataInput> {
5
+ readonly queueName = "checkForNewData";
6
+ readonly queueTtl: number;
7
+ readonly schema: typeof CheckForNewDataMessageValidation;
8
+ private logger;
9
+ private metaModel;
10
+ constructor(queuePrefix: string);
11
+ protected execute(data: ICheckForNewDataInput): Promise<void>;
12
+ }
@@ -0,0 +1,61 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.CheckForNewDataTask = void 0;
13
+ const ModuleContainerToken_1 = require("../../../../ioc/ModuleContainerToken");
14
+ const Di_1 = require("../../../ioc/Di");
15
+ const RopidGtfsContainerToken_1 = require("../../../ioc/RopidGtfsContainerToken");
16
+ const CoreToken_1 = require("@golemio/core/dist/helpers/ioc/CoreToken");
17
+ const integration_engine_1 = require("@golemio/core/dist/integration-engine");
18
+ const workers_1 = require("@golemio/core/dist/integration-engine/workers");
19
+ const CheckForNewDataMessageValidation_1 = require("./schema/CheckForNewDataMessageValidation");
20
+ class CheckForNewDataTask extends workers_1.AbstractTask {
21
+ constructor(queuePrefix) {
22
+ super(queuePrefix);
23
+ this.queueName = "checkForNewData";
24
+ this.queueTtl = 19 * 60 * 1000; // 19 minutes
25
+ this.schema = CheckForNewDataMessageValidation_1.CheckForNewDataMessageValidation;
26
+ this.logger = Di_1.RopidGtfsContainer.resolve(CoreToken_1.CoreToken.Logger);
27
+ // MetaData Model
28
+ this.metaModel = Di_1.RopidGtfsContainer.resolve(ModuleContainerToken_1.ModuleContainerToken.RopidGTFSMetadataModel);
29
+ }
30
+ execute(data) {
31
+ return __awaiter(this, void 0, void 0, function* () {
32
+ let forceRefresh = !!data.forceRefresh;
33
+ const datasets = [];
34
+ const ropidGtfsFactory = Di_1.RopidGtfsContainer.resolve(RopidGtfsContainerToken_1.RopidGtfsContainerToken.RopidGtfsFactory);
35
+ const datasetMap = ropidGtfsFactory.getDatasetMap();
36
+ for (const dataset of Object.keys(datasetMap)) {
37
+ const serverLastModified = yield datasetMap[dataset].datasource.getLastModified();
38
+ const dbLastModified = yield this.metaModel.getLastModified(dataset);
39
+ const isDeployed = yield this.metaModel.isDeployed(dataset);
40
+ if (serverLastModified !== dbLastModified.lastModified || !isDeployed) {
41
+ datasets.push(dataset);
42
+ }
43
+ }
44
+ if (datasets.length && datasets.length !== Object.keys(datasetMap).length) {
45
+ this.logger.error(`RopidGTFS datasets are out of sync`);
46
+ }
47
+ if (datasets.length) {
48
+ yield integration_engine_1.QueueManager.sendMessageToExchange(this.queuePrefix, "downloadDatasets", {
49
+ datasets: datasets,
50
+ });
51
+ return;
52
+ }
53
+ this.logger.info("RopidGTFS datasets are up to date");
54
+ if (forceRefresh) {
55
+ yield integration_engine_1.QueueManager.sendMessageToExchange(this.queuePrefix, "refreshPrecomputedTables", {});
56
+ }
57
+ });
58
+ }
59
+ }
60
+ exports.CheckForNewDataTask = CheckForNewDataTask;
61
+ //# sourceMappingURL=CheckForNewDataTask.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CheckForNewDataTask.js","sourceRoot":"","sources":["../../../../../../src/integration-engine/ropid-gtfs/workers/timetables/tasks/CheckForNewDataTask.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,+EAAoE;AAEpE,wCAA2D;AAC3D,kFAAqF;AAErF,wEAAqE;AAErE,8EAAqE;AACrE,2EAA6E;AAI7E,gGAA6F;AAE7F,MAAa,mBAAoB,SAAQ,sBAAmC;IAQxE,YAAY,WAAmB;QAC3B,KAAK,CAAC,WAAW,CAAC,CAAC;QARP,cAAS,GAAG,iBAAiB,CAAC;QAC9B,aAAQ,GAAG,EAAE,GA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CAAC,MAAM,EAAE;gBACjB,MAAM,iCAAY,CAAC,qBAAqB,CAAC,IAAI,CAAC,WAAW,EAAE,kBAAkB,EAAE;oBAC3E,QAAQ,EAAE,QAAQ;iBACH,CAAC,CAAC;gBACrB,OAAO;aACV;YAED,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,mCAAmC,CAAC,CAAC;YACtD,IAAI,YAAY,EAAE;gBACd,MAAM,iCAAY,CAAC,qBAAqB,CAAC,IAAI,CAAC,WAAW,EAAE,0BAA0B,EAAE,EAAE,CAAC,CAAC;aAC9F;QACL,CAAC;KAAA;CACJ;AA/CD,kDA+CC"}
@@ -0,0 +1,14 @@
1
+ import { AbstractTask } from "@golemio/core/dist/integration-engine/workers";
2
+ import { IDatasetsInput } from "./interfaces/IDatasetsInput";
3
+ import { DatasetsInputSchema } from "./schema/DownloadDataInputSchema";
4
+ export declare class CheckSavedRowsAndReplaceTablesTask extends AbstractTask<IDatasetsInput> {
5
+ readonly queueName = "checkSavedRowsAndReplaceTables";
6
+ readonly queueTtl: number;
7
+ readonly schema: typeof DatasetsInputSchema;
8
+ private logger;
9
+ private metaModel;
10
+ private dataCacheManager;
11
+ private precomputeTablesFacade;
12
+ constructor(queuePrefix: string);
13
+ protected execute(data: IDatasetsInput): Promise<void>;
14
+ }
@@ -0,0 +1,93 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.CheckSavedRowsAndReplaceTablesTask = void 0;
13
+ const ModuleContainerToken_1 = require("../../../../ioc/ModuleContainerToken");
14
+ const DataCacheManager_1 = require("../../../helpers/DataCacheManager");
15
+ const SourceTableSuffixEnum_1 = require("../../../helpers/SourceTableSuffixEnum");
16
+ const Di_1 = require("../../../ioc/Di");
17
+ const RopidGtfsContainerToken_1 = require("../../../ioc/RopidGtfsContainerToken");
18
+ const constants_1 = require("../../../../vehicle-positions/workers/vehicle-positions/constants");
19
+ const CoreToken_1 = require("@golemio/core/dist/helpers/ioc/CoreToken");
20
+ const integration_engine_1 = require("@golemio/core/dist/integration-engine");
21
+ const workers_1 = require("@golemio/core/dist/integration-engine/workers");
22
+ const golemio_errors_1 = require("@golemio/core/dist/shared/golemio-errors");
23
+ const DownloadDataInputSchema_1 = require("./schema/DownloadDataInputSchema");
24
+ class CheckSavedRowsAndReplaceTablesTask extends workers_1.AbstractTask {
25
+ constructor(queuePrefix) {
26
+ super(queuePrefix);
27
+ this.queueName = "checkSavedRowsAndReplaceTables";
28
+ this.queueTtl = 23 * 60 * 60 * 1000; // 23 hours
29
+ this.schema = DownloadDataInputSchema_1.DatasetsInputSchema;
30
+ this.logger = Di_1.RopidGtfsContainer.resolve(CoreToken_1.CoreToken.Logger);
31
+ // MetaData Model
32
+ this.metaModel = Di_1.RopidGtfsContainer.resolve(ModuleContainerToken_1.ModuleContainerToken.RopidGTFSMetadataModel);
33
+ this.dataCacheManager = DataCacheManager_1.DataCacheManager.getInstance();
34
+ this.precomputeTablesFacade = Di_1.RopidGtfsContainer.resolve(RopidGtfsContainerToken_1.RopidGtfsContainerToken.PrecomputedTablesFacade);
35
+ }
36
+ execute(data) {
37
+ return __awaiter(this, void 0, void 0, function* () {
38
+ const datasetDeployInfo = yield Promise.all(data.datasets.map((dataset) => __awaiter(this, void 0, void 0, function* () {
39
+ const lastModified = yield this.metaModel.getLastModified(dataset);
40
+ const isDeployed = yield this.metaModel.checkIfNewVersionIsAlreadyDeployed(dataset, lastModified.version);
41
+ return { dataset, lastModified, isDeployed };
42
+ })));
43
+ this.logger.debug(`Datasets status: ${JSON.stringify(datasetDeployInfo)}`);
44
+ const notDeployed = datasetDeployInfo.filter((info) => !info.isDeployed);
45
+ if (data.datasets.length !== notDeployed.length) {
46
+ const names = notDeployed.map((el) => el.dataset);
47
+ this.logger.error(`Error while synchronized download of datasets: [${names}] of [${data.datasets}] deployed already`);
48
+ }
49
+ if (!notDeployed.length) {
50
+ this.logger.debug(`Datasets status: already deployed`);
51
+ return;
52
+ }
53
+ const notDeployedVersions = notDeployed.map((el) => ({ dataset: el.dataset, version: el.lastModified.version }));
54
+ const allSaved = yield this.metaModel.checkAllTablesHasSavedState(notDeployedVersions);
55
+ try {
56
+ if (!allSaved) {
57
+ throw new golemio_errors_1.GeneralError("Some GTFS datasets did not properly save", this.constructor.name);
58
+ }
59
+ yield Promise.all(datasetDeployInfo.map((el) => __awaiter(this, void 0, void 0, function* () {
60
+ yield this.metaModel.checkSavedTmpTables(el.dataset, el.lastModified.version);
61
+ })));
62
+ yield this.precomputeTablesFacade.createAndPopulatePrecomputedTmpTables(SourceTableSuffixEnum_1.SourceTableSuffixEnum.Tmp);
63
+ yield this.metaModel.replaceTables(notDeployedVersions);
64
+ yield this.dataCacheManager.cleanCache();
65
+ yield integration_engine_1.QueueManager.sendMessageToExchange(constants_1.WORKER_NAME.toLowerCase(), "refreshGTFSTripData", {});
66
+ return;
67
+ }
68
+ catch (err) {
69
+ // log failed saving process
70
+ yield Promise.all(notDeployedVersions.map((el) => __awaiter(this, void 0, void 0, function* () {
71
+ yield this.metaModel.rollbackFailedSaving(el.dataset, el.version);
72
+ })));
73
+ // check number of tries
74
+ const retries = yield Promise.all(notDeployedVersions.map((el) => __awaiter(this, void 0, void 0, function* () {
75
+ return yield this.metaModel.getNumberOfDownloadRetries(el.dataset, el.version);
76
+ })));
77
+ if (Math.max(...retries) <= 5) {
78
+ // send new downloadFiles, log it and finish
79
+ integration_engine_1.QueueManager.sendMessageToExchange(this.queuePrefix, "downloadDatasets", data);
80
+ integration_engine_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));
81
+ return;
82
+ }
83
+ else {
84
+ // at least refresh precomputed tables and finish with error
85
+ integration_engine_1.QueueManager.sendMessageToExchange(this.queuePrefix, "refreshPrecomputedTables", {});
86
+ throw new golemio_errors_1.GeneralError("Error while checking RopidGTFS saved rows.", this.constructor.name, err);
87
+ }
88
+ }
89
+ });
90
+ }
91
+ }
92
+ exports.CheckSavedRowsAndReplaceTablesTask = CheckSavedRowsAndReplaceTablesTask;
93
+ //# sourceMappingURL=CheckSavedRowsAndReplaceTablesTask.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CheckSavedRowsAndReplaceTablesTask.js","sourceRoot":"","sources":["../../../../../../src/integration-engine/ropid-gtfs/workers/timetables/tasks/CheckSavedRowsAndReplaceTablesTask.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,+EAAoE;AAEpE,wEAA2E;AAC3E,kFAAqF;AACrF,wCAA2D;AAC3D,kFAAqF;AACrF,iGAA0G;AAC1G,wEAAqE;AAErE,8EAA8F;AAC9F,2EAA6E;AAC7E,6EAAwE;AAGxE,8EAAuE;AAEvE,MAAa,kCAAmC,SAAQ,sBAA4B;IAUhF,YAAY,WAAmB;QAC3B,KAAK,CAAC,WAAW,CAAC,CAAC;QAVP,cAAS,GAAG,gCAAgC,CAAC;QAC7C,aAAQ,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC,WAAW;QAC3C,WAAM,GAAG,6CAAmB,CAAC;QASzC,IAAI,CAAC,MAAM,GAAG,uBAAkB,CAAC,OAAO,CAAU,qBAAS,CAAC,MAAM,CAAC,CAAC;QACpE,iBAAiB;QACjB,IAAI,CAAC,SAAS,GAAG,uBAAkB,CAAC,OAAO,CAAyB,2CAAoB,CAAC,sBAAsB,CAAC,CA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,CAAC,OAAO,CAAC,CAAC;gBACtE,CAAC,CAAA,CAAC,CACL,CAAC;gBACF,wBAAwB;gBACxB,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,GAAG,CAC7B,mBAAmB,CAAC,GAAG,CAAC,CAAO,EAAE,EAAE,EAAE;oBACjC,OAAO,MAAM,IAAI,CAAC,SAAS,CAAC,0BAA0B,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,CAAC;gBACnF,CAAC,CAAA,CAAC,CACL,CAAC;gBAEF,IAAI,IAAI,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,EAAE;oBAC3B,4CAA4C;oBAC5C,iCAAY,CAAC,qBAAqB,CAAC,IAAI,CAAC,WAAW,EAAE,kBAAkB,EAAE,IAAI,CAAC,CAAC;oBAE/E,4CAAuB,CAAC,MAAM,CAC1B,IAAI,6BAAY,CACZ,6DAA6D,IAAI,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,cAAc,EAC/F,IAAI,CAAC,WAAW,CAAC,IAAI,EACrB,GAAG,CACN,CACJ,CAAC;oBACF,OAAO;iBACV;qBAAM;oBACH,4DAA4D;oBAC5D,iCAAY,CAAC,qBAAqB,CAAC,IAAI,CAAC,WAAW,EAAE,0BAA0B,EAAE,EAAE,CAAC,CAAC;oBAErF,MAAM,IAAI,6BAAY,CAAC,4CAA4C,EAAE,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;iBACpG;aACJ;QACL,CAAC;KAAA;CACJ;AAlGD,gFAkGC"}
@@ -0,0 +1,19 @@
1
+ import { AbstractTask } from "@golemio/core/dist/integration-engine/workers";
2
+ import { IDatasetsInput } from "./interfaces/IDatasetsInput";
3
+ import { DatasetsInputSchema } from "./schema/DownloadDataInputSchema";
4
+ export declare class DownloadDatasetsTask extends AbstractTask<IDatasetsInput> {
5
+ readonly queueName = "downloadDatasets";
6
+ readonly queueTtl: number;
7
+ readonly schema: typeof DatasetsInputSchema;
8
+ private logger;
9
+ private metaModel;
10
+ private ropidGtfsFactory?;
11
+ private gtfsRedisChannel;
12
+ private staticFileRedisRepository;
13
+ constructor(queuePrefix: string);
14
+ protected execute(data: IDatasetsInput): Promise<void>;
15
+ /**
16
+ * Helper method - download and persist dataset
17
+ */
18
+ private downloadAndPersistDatasetFiles;
19
+ }
@@ -0,0 +1,152 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
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
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.DownloadDatasetsTask = void 0;
27
+ const Di_1 = require("../../../../ioc/Di");
28
+ const ModuleContainerToken_1 = require("../../../../ioc/ModuleContainerToken");
29
+ const RopidGTFSMetadataModel_1 = require("../../../RopidGTFSMetadataModel");
30
+ const Di_2 = require("../../../ioc/Di");
31
+ const RopidGtfsContainerToken_1 = require("../../../ioc/RopidGtfsContainerToken");
32
+ const RopidMetadataModel_1 = require("../../../../shared/RopidMetadataModel");
33
+ const CoreToken_1 = require("@golemio/core/dist/helpers/ioc/CoreToken");
34
+ const integration_engine_1 = require("@golemio/core/dist/integration-engine");
35
+ const workers_1 = require("@golemio/core/dist/integration-engine/workers");
36
+ const golemio_errors_1 = require("@golemio/core/dist/shared/golemio-errors");
37
+ const os_1 = __importDefault(require("os"));
38
+ const HelperTypes_1 = require("./helpers/HelperTypes");
39
+ const DownloadDataInputSchema_1 = require("./schema/DownloadDataInputSchema");
40
+ class DownloadDatasetsTask extends workers_1.AbstractTask {
41
+ constructor(queuePrefix) {
42
+ super(queuePrefix);
43
+ this.queueName = "downloadDatasets";
44
+ this.queueTtl = 59 * 60 * 1000; // 59 minutes
45
+ this.schema = DownloadDataInputSchema_1.DatasetsInputSchema;
46
+ /**
47
+ * Helper method - download and persist dataset
48
+ */
49
+ this.downloadAndPersistDatasetFiles = (dataset) => __awaiter(this, void 0, void 0, function* () {
50
+ this.logger.info(`Datasets: processing ${dataset}`);
51
+ let files = yield this.ropidGtfsFactory.getDatasetMap()[dataset].datasource.getAll();
52
+ if (!Array.isArray(files))
53
+ files = [files];
54
+ const dbLastModified = yield this.metaModel.getLastModified(dataset);
55
+ const cachedDataset = [];
56
+ for (const file of files) {
57
+ this.logger.info(`Datasets: processing file '${file.name}'`);
58
+ const { data } = file, meta = __rest(file, ["data"]);
59
+ if (dataset === RopidGTFSMetadataModel_1.DatasetEnum.PID_GTFS || dataset === RopidGTFSMetadataModel_1.DatasetEnum.RUN_NUMBERS) {
60
+ yield this.staticFileRedisRepository.pipeStream(file.filepath, data);
61
+ }
62
+ else {
63
+ yield this.staticFileRedisRepository.set(file.filepath, typeof data === "string" ? data : JSON.stringify(data));
64
+ }
65
+ const key = (0, HelperTypes_1.datasetFileModelMap)(dataset, file.name);
66
+ const metaStates = (Array.isArray(key) ? key : [key]).map((name) => {
67
+ return {
68
+ dataset,
69
+ key: name,
70
+ type: RopidMetadataModel_1.MetaTypeEnum.STATE,
71
+ value: RopidMetadataModel_1.MetaStateEnum.DOWNLOADED,
72
+ version: dbLastModified.version + 1,
73
+ };
74
+ });
75
+ for (const metaState of metaStates) {
76
+ yield this.metaModel.save(metaState);
77
+ }
78
+ cachedDataset.push(Object.assign(Object.assign({}, meta), { dataset }));
79
+ }
80
+ const lastModified = yield this.ropidGtfsFactory.getDatasetMap()[dataset].datasource.getLastModified();
81
+ yield this.metaModel.save({
82
+ dataset,
83
+ key: RopidMetadataModel_1.MetaDatasetInfoKeyEnum.LAST_MODIFIED,
84
+ type: RopidMetadataModel_1.MetaTypeEnum.DATASET_INFO,
85
+ value: lastModified,
86
+ version: dbLastModified.version + 1,
87
+ });
88
+ this.logger.info(`Datasets: processing ${dataset} finished - ${JSON.stringify(cachedDataset)}`);
89
+ return cachedDataset;
90
+ });
91
+ this.logger = Di_1.PidContainer.resolve(CoreToken_1.CoreToken.Logger);
92
+ this.gtfsRedisChannel = Di_2.RopidGtfsContainer.resolve(RopidGtfsContainerToken_1.RopidGtfsContainerToken.RedisPubSubChannel);
93
+ this.staticFileRedisRepository = Di_2.RopidGtfsContainer.resolve(RopidGtfsContainerToken_1.RopidGtfsContainerToken.StaticFileRedisRepository);
94
+ // MetaData Model
95
+ this.metaModel = Di_2.RopidGtfsContainer.resolve(ModuleContainerToken_1.ModuleContainerToken.RopidGTFSMetadataModel);
96
+ }
97
+ execute(data) {
98
+ return __awaiter(this, void 0, void 0, function* () {
99
+ this.logger.info(`Datasets: downloading ${data.datasets}`);
100
+ /** Ropid GTFS Dataset Map Dependencies **/
101
+ this.ropidGtfsFactory = Di_2.RopidGtfsContainer.resolve(RopidGtfsContainerToken_1.RopidGtfsContainerToken.RopidGtfsFactory);
102
+ let cachedDatasets = [];
103
+ for (const dataset of data.datasets) {
104
+ try {
105
+ cachedDatasets = cachedDatasets.concat(yield this.downloadAndPersistDatasetFiles(dataset));
106
+ }
107
+ catch (err) {
108
+ yield integration_engine_1.QueueManager.sendMessageToExchange(this.queuePrefix, "refreshPrecomputedTables", {});
109
+ if (err instanceof golemio_errors_1.AbstractGolemioError) {
110
+ throw err;
111
+ }
112
+ throw new golemio_errors_1.GeneralError("Error while downloading GTFS datasets", this.constructor.name, err);
113
+ }
114
+ }
115
+ const subscriber = this.gtfsRedisChannel.createSubscriber({ channelSuffix: os_1.default.hostname() });
116
+ yield subscriber.subscribe();
117
+ for (const cachedDataset of cachedDatasets) {
118
+ integration_engine_1.QueueManager.sendMessageToExchange(this.queuePrefix, "transformAndSaveData", cachedDataset, {
119
+ headers: {
120
+ [HelperTypes_1.ORIGIN_HOSTNAME_HEADER]: os_1.default.hostname(),
121
+ },
122
+ });
123
+ }
124
+ // Listen for messages from workers and wait for all of them to finish
125
+ // before continuing to the next step (replacing tables)
126
+ try {
127
+ yield subscriber.listen(cachedDatasets.length, ({ message, messageCount, isFinal }) => {
128
+ this.logger.debug(`Datasets: received message: ${message} (${messageCount}/${cachedDatasets.length})`);
129
+ if (!message.startsWith("OK")) {
130
+ this.logger.error(`Datasets: subscription error: ${message}`);
131
+ throw new golemio_errors_1.GeneralError(message, this.constructor.name);
132
+ }
133
+ if (isFinal) {
134
+ this.logger.info("Datasets: all messages received");
135
+ }
136
+ });
137
+ }
138
+ catch (err) {
139
+ if (err instanceof golemio_errors_1.AbstractGolemioError) {
140
+ throw err;
141
+ }
142
+ throw new golemio_errors_1.GeneralError("Error while listening for messages", this.constructor.name, err);
143
+ }
144
+ finally {
145
+ yield subscriber.unsubscribe();
146
+ integration_engine_1.QueueManager.sendMessageToExchange(this.queuePrefix, "checkSavedRowsAndReplaceTables", data);
147
+ }
148
+ });
149
+ }
150
+ }
151
+ exports.DownloadDatasetsTask = DownloadDatasetsTask;
152
+ //# sourceMappingURL=DownloadDatasetsTask.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DownloadDatasetsTask.js","sourceRoot":"","sources":["../../../../../../src/integration-engine/ropid-gtf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qBACvD;gBACL,CAAC,CAAC,CAAC;aACN;YAAC,OAAO,GAAG,EAAE;gBACV,IAAI,GAAG,YAAY,qCAAoB,EAAE;oBACrC,MAAM,GAAG,CAAC;iBACb;gBACD,MAAM,IAAI,6BAAY,CAAC,oCAAoC,EAAE,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;aAC5F;oBAAS;gBACN,MAAM,UAAU,CAAC,WAAW,EAAE,CAAC;gBAC/B,iCAAY,CAAC,qBAAqB,CAAC,IAAI,CAAC,WAAW,EAAE,gCAAgC,EAAE,IAAI,CAAC,CAAC;aAChG;QACL,CAAC;KAAA;CAwDJ;AAzID,oDAyIC"}
@@ -0,0 +1,11 @@
1
+ import { AbstractEmptyTask } from "@golemio/core/dist/integration-engine/workers";
2
+ export declare class RefreshPrecomputedTablesTask extends AbstractEmptyTask {
3
+ readonly queueName = "refreshPrecomputedTables";
4
+ readonly queueTtl: number;
5
+ private logger;
6
+ private metaModel;
7
+ private dataCacheManager;
8
+ private precomputeTablesFacade;
9
+ constructor(queuePrefix: string);
10
+ protected execute(): Promise<void>;
11
+ }