@golemio/pid 3.2.3-dev.1590852474 → 3.3.0

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 (24) hide show
  1. package/dist/integration-engine/jis/ioc/Di.js +0 -2
  2. package/dist/integration-engine/jis/ioc/Di.js.map +1 -1
  3. package/dist/integration-engine/jis/ioc/JISContainerToken.d.ts +0 -1
  4. package/dist/integration-engine/jis/ioc/JISContainerToken.js +0 -1
  5. package/dist/integration-engine/jis/ioc/JISContainerToken.js.map +1 -1
  6. package/dist/integration-engine/jis/workers/JISWorker.js +0 -1
  7. package/dist/integration-engine/jis/workers/JISWorker.js.map +1 -1
  8. package/dist/integration-engine/jis/workers/tasks/RefreshJISInfotextsTask.d.ts +12 -8
  9. package/dist/integration-engine/jis/workers/tasks/RefreshJISInfotextsTask.js +48 -13
  10. package/dist/integration-engine/jis/workers/tasks/RefreshJISInfotextsTask.js.map +1 -1
  11. package/dist/integration-engine/vehicle-positions/workers/vehicle-positions/tasks/PropagateTrainDelayTask.js.map +1 -1
  12. package/docs/asyncapi.yaml +2 -96
  13. package/docs/implementation_documentation.md +20 -9
  14. package/docs/openapi-input.yaml +1 -192
  15. package/package.json +3 -3
  16. package/dist/input-gateway/jis/JisInfotextsController.d.ts +0 -9
  17. package/dist/input-gateway/jis/JisInfotextsController.js +0 -37
  18. package/dist/input-gateway/jis/JisInfotextsController.js.map +0 -1
  19. package/dist/input-gateway/jis/JisInfotextsRouter.d.ts +0 -9
  20. package/dist/input-gateway/jis/JisInfotextsRouter.js +0 -36
  21. package/dist/input-gateway/jis/JisInfotextsRouter.js.map +0 -1
  22. package/dist/integration-engine/jis/workers/tasks/FetchJISInfotextsTask.d.ts +0 -10
  23. package/dist/integration-engine/jis/workers/tasks/FetchJISInfotextsTask.js +0 -62
  24. package/dist/integration-engine/jis/workers/tasks/FetchJISInfotextsTask.js.map +0 -1
@@ -10,7 +10,6 @@ const JISInfotextsDataService_1 = require("../services/JISInfotextsDataService")
10
10
  const JISInfotextsTransformation_1 = require("../transformations/JISInfotextsTransformation");
11
11
  const RefreshJISInfotextsTask_1 = require("../workers/tasks/RefreshJISInfotextsTask");
12
12
  const JISContainerToken_1 = require("./JISContainerToken");
13
- const FetchJISInfotextsTask_1 = require("../workers/tasks/FetchJISInfotextsTask");
14
13
  //#region Initialization
15
14
  const JISContainer = Di_1.PidContainer.createChildContainer();
16
15
  exports.JISContainer = JISContainer;
@@ -28,7 +27,6 @@ JISContainer.register(JISContainerToken_1.JISContainerToken.JISInfotextsDataServ
28
27
  //#endregion
29
28
  //#region Tasks
30
29
  JISContainer.registerSingleton(JISContainerToken_1.JISContainerToken.RefreshJISInfotextsTask, RefreshJISInfotextsTask_1.RefreshJISInfotextsTask);
31
- JISContainer.registerSingleton(JISContainerToken_1.JISContainerToken.FetchJISInfotextsTask, FetchJISInfotextsTask_1.FetchJISInfotextsTask);
32
30
  //#endregion
33
31
  //#region Transformations
34
32
  JISContainer.registerSingleton(JISContainerToken_1.JISContainerToken.JISInfotextsTransformation, JISInfotextsTransformation_1.JISInfotextsTransformation);
@@ -1 +1 @@
1
- {"version":3,"file":"Di.js","sourceRoot":"","sources":["../../../../src/integration-engine/jis/ioc/Di.ts"],"names":[],"mappings":";;;AAAA,qCAA0C;AAE1C,gGAA6F;AAC7F,mFAAgF;AAChF,+GAA4G;AAC5G,iFAA8E;AAC9E,iFAA8E;AAC9E,8FAA2F;AAC3F,sFAAmF;AACnF,2DAAwD;AACxD,kFAA+E;AAE/E,wBAAwB;AACxB,MAAM,YAAY,GAAwB,iBAAY,CAAC,oBAAoB,EAAE,CAAC;AA0BrE,oCAAY;AAzBrB,YAAY;AAEZ,sBAAsB;AACtB,YAAY,CAAC,iBAAiB,CAAC,qCAAiB,CAAC,6BAA6B,EAAE,6DAA6B,CAAC,CAAC;AAC/G,YAAY;AAEZ,sBAAsB;AACtB,YAAY,CAAC,iBAAiB,CAAC,qCAAiB,CAAC,sBAAsB,EAAE,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iBAAiB,CAAC,qCAAiB,CAAC,qBAAqB,EAAE,6CAAqB,CAAC,CAAC;AAC/F,YAAY;AAEZ,kBAAkB;AAClB,YAAY,CAAC,QAAQ,CAAC,qCAAiB,CAAC,uBAAuB,EAAE,iDAAuB,CAAC,CAAC;AAC1F,YAAY;AAEZ,eAAe;AACf,YAAY,CAAC,iBAAiB,CAAC,qCAAiB,CAAC,uBAAuB,EAAE,iDAAuB,CAAC,CAAC;AACnG,YAAY;AAEZ,yBAAyB;AACzB,YAAY,CAAC,iBAAiB,CAAC,qCAAiB,CAAC,0BAA0B,EAAE,uDAA0B,CAAC,CAAC"}
@@ -6,6 +6,5 @@ declare const JISContainerToken: {
6
6
  JISInfotextsDataService: symbol;
7
7
  JISInfotextsTransformation: symbol;
8
8
  RefreshJISInfotextsTask: symbol;
9
- FetchJISInfotextsTask: symbol;
10
9
  };
11
10
  export { JISContainerToken };
@@ -14,7 +14,6 @@ const JISContainerToken = {
14
14
  JISInfotextsTransformation: Symbol(),
15
15
  /* Tasks */
16
16
  RefreshJISInfotextsTask: Symbol(),
17
- FetchJISInfotextsTask: Symbol(),
18
17
  };
19
18
  exports.JISContainerToken = JISContainerToken;
20
19
  //# sourceMappingURL=JISContainerToken.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"JISContainerToken.js","sourceRoot":"","sources":["../../../../src/integration-engine/jis/ioc/JISContainerToken.ts"],"names":[],"mappings":";;;AAAA,MAAM,iBAAiB,GAAG;IACtB,kBAAkB;IAClB,6BAA6B,EAAE,MAAM,EAAE;IACvC,kBAAkB;IAClB,sBAAsB,EAAE,MAAM,EAAE;IAChC,oCAAoC,EAAE,MAAM,EAAE;IAC9C,qBAAqB,EAAE,MAAM,EAAE;IAC/B,cAAc;IACd,uBAAuB,EAAE,MAAM,EAAE;IACjC,qBAAqB;IACrB,0BAA0B,EAAE,MAAM,EAAE;IACpC,WAAW;IACX,uBAAuB,EAAE,MAAM,EAAE;IACjC,qBAAqB,EAAE,MAAM,EAAE;CAClC,CAAC;AAEO,8CAAiB"}
1
+ {"version":3,"file":"JISContainerToken.js","sourceRoot":"","sources":["../../../../src/integration-engine/jis/ioc/JISContainerToken.ts"],"names":[],"mappings":";;;AAAA,MAAM,iBAAiB,GAAG;IACtB,kBAAkB;IAClB,6BAA6B,EAAE,MAAM,EAAE;IACvC,kBAAkB;IAClB,sBAAsB,EAAE,MAAM,EAAE;IAChC,oCAAoC,EAAE,MAAM,EAAE;IAC9C,qBAAqB,EAAE,MAAM,EAAE;IAC/B,cAAc;IACd,uBAAuB,EAAE,MAAM,EAAE;IACjC,qBAAqB;IACrB,0BAA0B,EAAE,MAAM,EAAE;IACpC,WAAW;IACX,uBAAuB,EAAE,MAAM,EAAE;CACpC,CAAC;AAEO,8CAAiB"}
@@ -15,7 +15,6 @@ class JISWorker extends workers_1.AbstractWorker {
15
15
  };
16
16
  // Register tasks
17
17
  this.registerTask(Di_1.JISContainer.resolve(JISContainerToken_1.JISContainerToken.RefreshJISInfotextsTask));
18
- this.registerTask(Di_1.JISContainer.resolve(JISContainerToken_1.JISContainerToken.FetchJISInfotextsTask));
19
18
  }
20
19
  }
21
20
  exports.JISWorker = JISWorker;
@@ -1 +1 @@
1
- {"version":3,"file":"JISWorker.js","sourceRoot":"","sources":["../../../../src/integration-engine/jis/workers/JISWorker.ts"],"names":[],"mappings":";;;AAAA,2EAA+E;AAE/E,kCAAyC;AACzC,gEAA6D;AAC7D,2CAA8C;AAI9C,MAAa,SAAU,SAAQ,wBAAc;IAGzC;QACI,KAAK,EAAE,CAAC;QAHF,SAAI,GAAG,2BAAe,CAAC,WAAW,EAAE,CAAC;QAUxC,iBAAY,GAAG,CAAC,IAAW,EAAQ,EAAE;YACxC,KAAK,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;YACzB,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,cAAc,EAAE,CAAC;QAC7C,CAAC,CAAC;QARE,iBAAiB;QACjB,IAAI,CAAC,YAAY,CAAC,iBAAY,CAAC,OAAO,CAA0B,qCAAiB,CAAC,uBAAuB,CAAC,CAAC,CAAC;QAC5G,IAAI,CAAC,YAAY,CAAC,iBAAY,CAAC,OAAO,CAAwB,qCAAiB,CAAC,qBAAqB,CAAC,CAAC,CAAC;IAC5G,CAAC;CAMJ;AAfD,8BAeC"}
1
+ {"version":3,"file":"JISWorker.js","sourceRoot":"","sources":["../../../../src/integration-engine/jis/workers/JISWorker.ts"],"names":[],"mappings":";;;AAAA,2EAA+E;AAE/E,kCAAyC;AACzC,gEAA6D;AAC7D,2CAA8C;AAG9C,MAAa,SAAU,SAAQ,wBAAc;IAGzC;QACI,KAAK,EAAE,CAAC;QAHF,SAAI,GAAG,2BAAe,CAAC,WAAW,EAAE,CAAC;QASxC,iBAAY,GAAG,CAAC,IAAW,EAAQ,EAAE;YACxC,KAAK,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;YACzB,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,cAAc,EAAE,CAAC;QAC7C,CAAC,CAAC;QAPE,iBAAiB;QACjB,IAAI,CAAC,YAAY,CAAC,iBAAY,CAAC,OAAO,CAA0B,qCAAiB,CAAC,uBAAuB,CAAC,CAAC,CAAC;IAChH,CAAC;CAMJ;AAdD,8BAcC"}
@@ -1,16 +1,20 @@
1
+ import { JISInfotextsDataSourceFactory } from "../../datasources/JISInfotextsDataSourceFactory";
2
+ import { JISMetadataRepository } from "../../repositories/JISMetadataRepository";
1
3
  import { JISInfotextsDataService } from "../../services/JISInfotextsDataService";
2
4
  import { JISInfotextsTransformation } from "../../transformations/JISInfotextsTransformation";
3
- import { AbstractTaskJsonSchema } from "@golemio/core/dist/integration-engine/workers/AbstractTaskJsonSchema";
4
- import { JSONSchemaValidator } from "@golemio/core/dist/shared/golemio-validator";
5
- import { IJISInfotext } from "../../../../schema-definitions/jis/datasources/interfaces";
6
- export declare class RefreshJISInfotextsTask extends AbstractTaskJsonSchema<IJISInfotext[]> {
5
+ import { ILogger } from "@golemio/core/dist/helpers";
6
+ import { AbstractEmptyTask } from "@golemio/core/dist/integration-engine";
7
+ export declare class RefreshJISInfotextsTask extends AbstractEmptyTask {
8
+ private dataSourceFactory;
7
9
  private infotextsDataService;
8
10
  private infotextsTransformation;
9
- readonly schema: JSONSchemaValidator;
11
+ private metadataRepository;
12
+ private logger;
10
13
  readonly queueName = "refreshJISInfotexts";
11
14
  readonly queueTtl: number;
12
- constructor(infotextsDataService: JISInfotextsDataService, infotextsTransformation: JISInfotextsTransformation);
13
- /** refresh JIS Infotexts data in database */
14
- protected execute(data: IJISInfotext[]): Promise<void>;
15
+ constructor(dataSourceFactory: JISInfotextsDataSourceFactory, infotextsDataService: JISInfotextsDataService, infotextsTransformation: JISInfotextsTransformation, metadataRepository: JISMetadataRepository, logger: ILogger);
16
+ /** Fetch JIS Infotexts data source and if it has been updated, refresh JIS Infotexts data in database */
17
+ protected execute(): Promise<void>;
18
+ private getResponseEtag;
15
19
  private getEntitiesFromTransformationResult;
16
20
  }
@@ -22,31 +22,61 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
22
22
  };
23
23
  Object.defineProperty(exports, "__esModule", { value: true });
24
24
  exports.RefreshJISInfotextsTask = void 0;
25
+ const JISInfotextsDataSourceFactory_1 = require("../../datasources/JISInfotextsDataSourceFactory");
25
26
  const JISContainerToken_1 = require("../../ioc/JISContainerToken");
27
+ const JISMetadataRepository_1 = require("../../repositories/JISMetadataRepository");
26
28
  const JISInfotextsDataService_1 = require("../../services/JISInfotextsDataService");
27
29
  const JISInfotextsTransformation_1 = require("../../transformations/JISInfotextsTransformation");
30
+ const CoreToken_1 = require("@golemio/core/dist/helpers/ioc/CoreToken");
31
+ const integration_engine_1 = require("@golemio/core/dist/integration-engine");
32
+ const ResourceNotModified_1 = require("@golemio/core/dist/integration-engine/helpers/ResourceNotModified");
28
33
  const tsyringe_1 = require("@golemio/core/dist/shared/tsyringe");
29
34
  const constants_1 = require("../constants");
30
- const AbstractTaskJsonSchema_1 = require("@golemio/core/dist/integration-engine/workers/AbstractTaskJsonSchema");
31
- const JISInfotextsJsonSchema_1 = require("../../../../schema-definitions/jis/datasources/JISInfotextsJsonSchema");
32
- const golemio_validator_1 = require("@golemio/core/dist/shared/golemio-validator");
33
- let RefreshJISInfotextsTask = exports.RefreshJISInfotextsTask = class RefreshJISInfotextsTask extends AbstractTaskJsonSchema_1.AbstractTaskJsonSchema {
34
- constructor(infotextsDataService, infotextsTransformation) {
35
+ let RefreshJISInfotextsTask = exports.RefreshJISInfotextsTask = class RefreshJISInfotextsTask extends integration_engine_1.AbstractEmptyTask {
36
+ constructor(dataSourceFactory, infotextsDataService, infotextsTransformation, metadataRepository, logger) {
35
37
  super(constants_1.JIS_WORKER_NAME.toLowerCase());
38
+ this.dataSourceFactory = dataSourceFactory;
36
39
  this.infotextsDataService = infotextsDataService;
37
40
  this.infotextsTransformation = infotextsTransformation;
38
- this.schema = new golemio_validator_1.JSONSchemaValidator("jisInfotextsDataValidation", JISInfotextsJsonSchema_1.jisInfotextsJsonSchema);
41
+ this.metadataRepository = metadataRepository;
42
+ this.logger = logger;
39
43
  this.queueName = "refreshJISInfotexts";
40
- this.queueTtl = 60 * 1000; // 1 minute
44
+ this.queueTtl = 20 * 1000; // 20 seconds
41
45
  }
42
- /** refresh JIS Infotexts data in database */
43
- execute(data) {
46
+ /** Fetch JIS Infotexts data source and if it has been updated, refresh JIS Infotexts data in database */
47
+ execute() {
44
48
  return __awaiter(this, void 0, void 0, function* () {
49
+ const lastEtag = yield this.metadataRepository.getLastInfotextsEtag();
50
+ const dataSource = this.dataSourceFactory.getDataSource(lastEtag);
51
+ const { data, metadata } = yield dataSource.getAllWithMetadata();
52
+ if (data instanceof ResourceNotModified_1.ResourceNotModified) {
53
+ this.logger.info(`${this.constructor.name}.execute: JIS infotexts data source hasn't been updated since last refresh in ` +
54
+ `database (received 304 Not Modified for request with ETag: ${lastEtag}).`);
55
+ return;
56
+ }
45
57
  const transformedData = this.infotextsTransformation.transformArray(data);
46
58
  const { infotexts, infotextsRopidGTFSStops } = this.getEntitiesFromTransformationResult(transformedData);
47
59
  yield this.infotextsDataService.refreshData(infotexts, infotextsRopidGTFSStops);
60
+ const responseEtag = this.getResponseEtag(metadata);
61
+ if (typeof responseEtag === "string") {
62
+ yield this.metadataRepository.setLastInfotextsEtag(responseEtag);
63
+ }
64
+ else {
65
+ this.logger.warn(`${this.constructor.name}.execute: JIS infotexts data source response has no ETag.`);
66
+ }
48
67
  });
49
68
  }
69
+ getResponseEtag(metadata) {
70
+ if (typeof metadata === "object" &&
71
+ metadata !== null &&
72
+ "headers" in metadata &&
73
+ typeof metadata.headers === "object" &&
74
+ metadata.headers !== null &&
75
+ "etag" in metadata.headers &&
76
+ typeof metadata.headers["etag"] === "string") {
77
+ return metadata.headers["etag"];
78
+ }
79
+ }
50
80
  getEntitiesFromTransformationResult(transformedData) {
51
81
  const infotextEntities = [];
52
82
  const infotextsRopidGTFSStopsEntities = [];
@@ -65,9 +95,14 @@ let RefreshJISInfotextsTask = exports.RefreshJISInfotextsTask = class RefreshJIS
65
95
  };
66
96
  exports.RefreshJISInfotextsTask = RefreshJISInfotextsTask = __decorate([
67
97
  (0, tsyringe_1.injectable)(),
68
- __param(0, (0, tsyringe_1.inject)(JISContainerToken_1.JISContainerToken.JISInfotextsDataService)),
69
- __param(1, (0, tsyringe_1.inject)(JISContainerToken_1.JISContainerToken.JISInfotextsTransformation)),
70
- __metadata("design:paramtypes", [JISInfotextsDataService_1.JISInfotextsDataService,
71
- JISInfotextsTransformation_1.JISInfotextsTransformation])
98
+ __param(0, (0, tsyringe_1.inject)(JISContainerToken_1.JISContainerToken.JISInfotextsDataSourceFactory)),
99
+ __param(1, (0, tsyringe_1.inject)(JISContainerToken_1.JISContainerToken.JISInfotextsDataService)),
100
+ __param(2, (0, tsyringe_1.inject)(JISContainerToken_1.JISContainerToken.JISInfotextsTransformation)),
101
+ __param(3, (0, tsyringe_1.inject)(JISContainerToken_1.JISContainerToken.JISMetadataRepository)),
102
+ __param(4, (0, tsyringe_1.inject)(CoreToken_1.CoreToken.Logger)),
103
+ __metadata("design:paramtypes", [JISInfotextsDataSourceFactory_1.JISInfotextsDataSourceFactory,
104
+ JISInfotextsDataService_1.JISInfotextsDataService,
105
+ JISInfotextsTransformation_1.JISInfotextsTransformation,
106
+ JISMetadataRepository_1.JISMetadataRepository, Object])
72
107
  ], RefreshJISInfotextsTask);
73
108
  //# sourceMappingURL=RefreshJISInfotextsTask.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"RefreshJISInfotextsTask.js","sourceRoot":"","sources":["../../../../../src/integration-engine/jis/workers/tasks/RefreshJISInfotextsTask.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,mEAAkE;AAClE,oFAAmF;AACnF,iGAAgG;AAEhG,iEAAwE;AACxE,4CAA+C;AAC/C,iHAA8G;AAC9G,kHAAqF;AACrF,mFAAkF;AAK3E,IAAM,uBAAuB,qCAA7B,MAAM,uBAAwB,SAAQ,+CAAsC;IAK/E,YAEI,oBAAqD,EAErD,uBAA2D;QAE3D,KAAK,CAAC,2BAAe,CAAC,WAAW,EAAE,CAAC,CAAC;QAJ7B,yBAAoB,GAApB,oBAAoB,CAAyB;QAE7C,4BAAuB,GAAvB,uBAAuB,CAA4B;QAR/C,WAAM,GAAG,IAAI,uCAAmB,CAAC,4BAA4B,EAAE,+CAAsB,CAAC,CAAC;QACvF,cAAS,GAAG,qBAAqB,CAAC;QAClC,aAAQ,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC,WAAW;IASjD,CAAC;IAED,6CAA6C;IAC7B,OAAO,CAAC,IAAoB;;YACxC,MAAM,eAAe,GAAG,IAAI,CAAC,uBAAuB,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;YAC1E,MAAM,EAAE,SAAS,EAAE,uBAAuB,EAAE,GAAG,IAAI,CAAC,mCAAmC,CAAC,eAAe,CAAC,CAAC;YACzG,MAAM,IAAI,CAAC,oBAAoB,CAAC,WAAW,CAAC,SAAS,EAAE,uBAAuB,CAAC,CAAC;QACpF,CAAC;KAAA;IAEO,mCAAmC,CAAC,eAAyE;QACjH,MAAM,gBAAgB,GAAwB,EAAE,CAAC;QACjD,MAAM,+BAA+B,GAAkC,EAAE,CAAC;QAC1E,KAAK,MAAM,EAAE,QAAQ,EAAE,uBAAuB,EAAE,IAAI,eAAe,EAAE;YACjE,IAAI,uBAAuB,CAAC,MAAM,KAAK,CAAC,EAAE;gBACtC,SAAS;aACZ;YACD,gBAAgB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;YAChC,+BAA+B,CAAC,IAAI,CAAC,GAAG,uBAAuB,CAAC,CAAC;SACpE;QACD,OAAO;YACH,SAAS,EAAE,gBAAgB;YAC3B,uBAAuB,EAAE,+BAA+B;SAC3D,CAAC;IACN,CAAC;CACJ,CAAA;kCApCY,uBAAuB;IADnC,IAAA,qBAAU,GAAE;IAOJ,WAAA,IAAA,iBAAM,EAAC,qCAAiB,CAAC,uBAAuB,CAAC,CAAA;IAEjD,WAAA,IAAA,iBAAM,EAAC,qCAAiB,CAAC,0BAA0B,CAAC,CAAA;qCADvB,iDAAuB;QAEpB,uDAA0B;GATtD,uBAAuB,CAoCnC"}
1
+ {"version":3,"file":"RefreshJISInfotextsTask.js","sourceRoot":"","sources":["../../../../../src/integration-engine/jis/workers/tasks/RefreshJISInfotextsTask.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,mGAAkG;AAClG,mEAAkE;AAClE,oFAAmF;AACnF,oFAAmF;AACnF,iGAAgG;AAGhG,wEAAqE;AACrE,8EAA0E;AAC1E,2GAAwG;AACxG,iEAAwE;AACxE,4CAA+C;AAGxC,IAAM,uBAAuB,qCAA7B,MAAM,uBAAwB,SAAQ,sCAAiB;IAI1D,YAEI,iBAAwD,EAExD,oBAAqD,EAErD,uBAA2D,EAE3D,kBAAiD,EACvB,MAAuB;QAEjD,KAAK,CAAC,2BAAe,CAAC,WAAW,EA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AAC,qBAAqB,CAAC,CAAA;IAE/C,WAAA,IAAA,iBAAM,EAAC,qBAAS,CAAC,MAAM,CAAC,CAAA;qCAPE,6DAA6B;QAE1B,iDAAuB;QAEpB,uDAA0B;QAE/B,6CAAqB;GAZ5C,uBAAuB,CAwEnC"}
@@ -1 +1 @@
1
- {"version":3,"file":"PropagateTrainDelayTask.js","sourceRoot":"","sources":["../../../../../../src/integration-engine/vehicle-positions/workers/vehicle-positions/tasks/PropagateTrainDelayTask.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,sDAA2D;AAC3D,gGAAqF;AAErF,wEAAqE;AAErE,mEAAuF;AACvF,mEAAyD;AAGzD,mFAAqF;AACrF,sFAAmF;AAEnF,MAAa,uBAAwB,SAAQ,uDAAqD;IAU9F,YAAY,WAAmB;QAC3B,KAAK,CAAC,WAAW,CAAC,CAAC;QAVP,cAAS,GAAG,qBAAqB,CAAC;QAClC,aAAQ,GAAG,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC,YAAY;QACtC,WAAM,GAAG,0DAA8B,CAAC;QAgEhD,sBAAiB,GAAG,CACxB,aAAiC,EACjC,eAAuB,EACI,EAAE;YAC7B,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC;gBAC5C,UAAU,EAAE,CAAC,cAAc,CAAC;gBAC5B,KAAK,EAAE;oBACH,aAAa,EAAE,aAAa;oBAC5B,eAAe,EAAE,EAAE,CAAC,cAAE,CAAC,EAAE,CAAC,EAAE,eAAe,EAAE;iBAChD;gBACD,KAAK,EAAE,CAAC,CAAC,iBAAiB,EAAE,KAAK,CAAC,CAAC;gBACnC,GAAG,EAAE,IAAI;aACZ,CAAC,CAAC;YAEH,OAAO,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,YAAY,CAAC;QAC9B,CAAC,CAAA,CAAC;QAtEE,IAAI,CAAC,MAAM,GAAG,gCAA0B,CAAC,OAAO,CAAU,qBAAS,CAAC,MAAM,CAA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aAAa,aAAb,aAAa,cAAb,aAAa,GAAI,IAAI;wBACzC,sBAAsB,EAAE,gBAAgB,CAAC,QAAQ,CAAC,eAAe;wBACjE,YAAY,EAAE,gBAAgB,CAAC,QAAQ,CAAC,cAAc;wBACtD,yBAAyB,EAAE,2BAA2B;wBACtD,gBAAgB,EAAE,eAAe;wBACjC,cAAc,EAAE,aAAc;wBAC9B,cAAc,EAAE,gBAAgB,CAAC,QAAQ,CAAC,OAAO;wBACjD,aAAa,EAAE,cAAc;4BACzB,CAAC,CAAC;gCACI;oCACI,OAAO,EAAE,cAAc;oCACvB,yBAAyB,EAAE,yBAAyB;iCACvD;6BACJ;4BACH,CAAC,CAAC,EAAE;qBACX,CAAC,CAAC;iBACN;gBAAC,OAAO,GAAG,EAAE;oBACV,IAAI,CAAC,MAAM,CAAC,IAAI,CACZ,GAAG,IAAI,CAAC,SAAS,oDAAoD,YAAY,MAAM,GAAG,CAAC,OAAO,EAAE,CACvG,CAAC;iBACL;aACJ;;KACJ;CAkBJ;AAnFD,0DAmFC"}
1
+ {"version":3,"file":"PropagateTrainDelayTask.js","sourceRoot":"","sources":["../../../../../../src/integration-engine/vehicle-positions/workers/vehicle-positions/tasks/PropagateTrainDelayTask.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,sDAA2D;AAC3D,gGAAqF;AAErF,wEAAqE;AAErE,mEAAuF;AACvF,mEAAyD;AAGzD,mFAAqF;AACrF,sFAAmF;AAEnF,MAAa,uBAAwB,SAAQ,uDAAqD;IAU9F,YAAY,WAAmB;QAC3B,KAAK,CAAC,WAAW,CAAC,CAAC;QAVP,cAAS,GAAG,qBAAqB,CAAC;QAClC,aAAQ,GAAG,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC,YAAY;QACtC,WAAM,GAAG,0DAA8B,CAAC;QAgEhD,sBAAiB,GAAG,CACxB,aAAiC,EACjC,eAAuB,EACI,EAAE;YAC7B,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,eAAe,CA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ch JIS Infotexts from data source
10
- bindings:
11
- amqp:
12
- is: queue
13
- queue:
14
- durable: true
15
- messages:
16
- empty:
17
- $ref: "#/components/messages/emptyMessage"
18
7
  jis.refreshJISInfotexts:
19
8
  address: vehicle-positions.jis.refreshJISInfotexts
20
- description: Refresh JIS Infotexts in database
9
+ description: Fetch JIS Infotexts data source and if it has been updated, refresh JIS Infotexts data in database
21
10
  bindings:
22
11
  amqp:
23
12
  is: queue
@@ -25,7 +14,7 @@ channels:
25
14
  durable: true
26
15
  messages:
27
16
  empty:
28
- $ref: "#/components/messages/IJISInfotext"
17
+ $ref: "#/components/messages/emptyMessage"
29
18
  updateGTFSTripId:
30
19
  address: vehicle-positions.vehiclepositions.updateGTFSTripId
31
20
  description: some description
@@ -458,12 +447,6 @@ components:
458
447
  type: array
459
448
  items:
460
449
  $ref: "#/components/schemas/IScheduleDto"
461
- IJISInfotext:
462
- payload:
463
- type: array
464
- items:
465
- $ref: "#/components/schemas/JisInfotext"
466
-
467
450
  schemas:
468
451
  IUpdateGTFSTripIdData:
469
452
  type: object
@@ -1525,80 +1508,3 @@ components:
1525
1508
  actual_position_timestamp_scheduled:
1526
1509
  type: string
1527
1510
  format: date-time
1528
- JisInfotext:
1529
- type: object
1530
- properties:
1531
- id:
1532
- type: string
1533
- format: uuid
1534
- description: Unique identifier for the infotext
1535
- severity_level:
1536
- type: string
1537
- enum:
1538
- - SEVERE
1539
- - WARNING
1540
- - INFO
1541
- description: Severity level of the infotext
1542
- display_type:
1543
- type: string
1544
- description: How the infotext is displayed
1545
- active_period:
1546
- type: object
1547
- properties:
1548
- start:
1549
- type: string
1550
- format: date-time
1551
- description: Start time of the active period
1552
- end:
1553
- type: string
1554
- format: date-time
1555
- description: End time of the active period
1556
- required:
1557
- - start
1558
- - end
1559
- description: The period during which the infotext is active
1560
- description_text:
1561
- type: object
1562
- properties:
1563
- cs:
1564
- type: string
1565
- description: Description in Czech
1566
- en:
1567
- type: string
1568
- description: Description in English
1569
- required:
1570
- - cs
1571
- - en
1572
- description: Localized descriptions of the infotext
1573
- informed_entity:
1574
- type: object
1575
- properties:
1576
- stops:
1577
- type: array
1578
- items:
1579
- type: object
1580
- properties:
1581
- stop_id:
1582
- type: string
1583
- description: Unique identifier for the stop
1584
- required:
1585
- - stop_id
1586
- required:
1587
- - stops
1588
- created_timestamp:
1589
- type: string
1590
- format: date-time
1591
- description: Timestamp when the infotext was created in VYMI
1592
- last_modified_timestamp:
1593
- type: string
1594
- format: date-time
1595
- description: Timestamp when the infotext was updated in VYMI
1596
- required:
1597
- - id
1598
- - severity_level
1599
- - display_type
1600
- - active_period
1601
- - description_text
1602
- - informed_entity
1603
- - created_timestamp
1604
- - last_modified_timestamp
@@ -215,6 +215,26 @@ _:warning: Původním záměrem bylo využití OIS číselníku během zpracová
215
215
  - prod `0 */1 * * * *`
216
216
  - názvy rabbitmq front
217
217
  - vehicle-positions.ropidpresets.collectAndSaveLogs se zprávou `{ "targetMinutes": n }`
218
+
219
+ #### _JIS Infotexty_
220
+
221
+ - zdroj dat
222
+ - baseUrl: module.pid.jis.baseUrl
223
+ - infotexts path: module.pid.jis.infotexts.path
224
+ - hlavičky infotexts dotazu: module.pid.jis.infotexts.headers
225
+ - formát dat
226
+ - protokol: http
227
+ - datový typ: json
228
+ - validační schéma: [JISInfotextsJsonSchema](../src/schema-definitions/jis/datasources/JISInfotextsJsonSchema.ts)
229
+ - příklad vstupnich dat: [infotextsDataSourceFixture](../test/integration-engine/jis/fixtures/infotextsDataSourceFixture.ts)
230
+ - frekvence stahování
231
+ - cron definice:
232
+ - cron.vehicle-positions.jis.refreshJISInfotexts
233
+ - rabin `*/30 * * * * *`
234
+ - prod `*/30 * * * * *`
235
+ - název rabbitmq fronty
236
+ - vehicle-positions.jis.refreshJISInfotexts
237
+
218
238
  ### _Ropid staticka data_
219
239
 
220
240
  - zdroj dat
@@ -365,15 +385,6 @@ _:warning: Původním záměrem bylo využití OIS číselníku během zpracová
365
385
  - agregace dat: 1 MB
366
386
  - odhadovaná zátěž
367
387
  - desítky až stovky zpráv za minutu
368
- #### _JIS Infotexty_
369
-
370
- - formát dat
371
- - protokol: http
372
- - datový typ: json
373
- - validační schéma: [JISInfotextsJsonSchema](../src/schema-definitions/jis/datasources/JISInfotextsJsonSchema.ts)
374
- - příklad vstupnich dat: [infotextsDataSourceFixture](../test/integration-engine/jis/fixtures/infotextsDataSourceFixture.ts)
375
- - název rabbitmq fronty
376
- - vehicle-positions.jis.refreshJISInfotexts
377
388
 
378
389
  ## Výstupní data
379
390
 
@@ -18,8 +18,6 @@ servers:
18
18
  tags:
19
19
  - name: 🛤 Vehicle Positions
20
20
  description: ""
21
- - name: 🪧 JIS
22
- description: ""
23
21
  paths:
24
22
  /vehiclepositions:
25
23
  post:
@@ -161,62 +159,6 @@ paths:
161
159
  WWW_Authenticate:
162
160
  schema:
163
161
  type: string
164
- /jis/infotexts:
165
- post:
166
- summary: POST JIS infotexts
167
- description: ""
168
- tags:
169
- - 🪧 JIS
170
- parameters:
171
- - in: header
172
- name: Content-Type
173
- schema:
174
- type: string
175
- example: "application/json"
176
- required: true
177
- requestBody:
178
- required: true
179
- content:
180
- application/json:
181
- schema:
182
- $ref: "#/components/schemas/JisInfotexts"
183
- examples:
184
- json:
185
- $ref: "#/components/examples/JisInfotextsExample"
186
- responses:
187
- "204":
188
- description: Successful Operation
189
-
190
- "422":
191
- description: Unprocessable Entity
192
- content:
193
- application/json:
194
- schema:
195
- $ref: "#/components/schemas/Error"
196
- example:
197
- error_info: "validation failed [{\"keyword\":\"type\",\"dataPath\":\"[0].severity_level\",\"schemaPath\":\"#/items/properties/severity_level/type\",\"params\":{\"type\":\"string\"},\"message\":\"should be string\"}]"
198
- error_message: "Unprocessable Entity"
199
- error_status: 422
200
- "400":
201
- description: Bad Request
202
- content:
203
- application/json:
204
- schema:
205
- $ref: "#/components/schemas/Error"
206
- example:
207
- error_message: "Bad Request"
208
- error_status: 400
209
- "406":
210
- description: Not Acceptable
211
- "413":
212
- description: Payload Too Large
213
- content:
214
- application/json:
215
- schema:
216
- $ref: "#/components/schemas/Error"
217
- example:
218
- error_message: "Request entity too large"
219
- error_status: 413
220
162
 
221
163
  components:
222
164
  schemas:
@@ -415,86 +357,7 @@ components:
415
357
  query:
416
358
  type: string
417
359
  example: "?minutesAfter=300&limit=8&mode=departures&cisIds=40110"
418
- JisInfotexts:
419
- title: Jis infotexts
420
- type: array
421
- items:
422
- type: object
423
- properties:
424
- id:
425
- type: string
426
- format: uuid
427
- description: Unique identifier for the infotext
428
- severity_level:
429
- type: string
430
- enum:
431
- - SEVERE
432
- - WARNING
433
- - INFO
434
- description: Severity level of the infotext
435
- display_type:
436
- type: string
437
- description: How the infotext is displayed
438
- active_period:
439
- type: object
440
- properties:
441
- start:
442
- type: string
443
- format: date-time
444
- description: Start time of the active period
445
- end:
446
- type: string
447
- format: date-time
448
- description: End time of the active period
449
- required:
450
- - start
451
- - end
452
- description: The period during which the infotext is active
453
- description_text:
454
- type: object
455
- properties:
456
- cs:
457
- type: string
458
- description: Description in Czech
459
- en:
460
- type: string
461
- description: Description in English
462
- required:
463
- - cs
464
- - en
465
- description: Localized descriptions of the infotext
466
- informed_entity:
467
- type: object
468
- properties:
469
- stops:
470
- type: array
471
- items:
472
- type: object
473
- properties:
474
- stop_id:
475
- type: string
476
- description: Unique identifier for the stop
477
- required:
478
- - stop_id
479
- required:
480
- - stops
481
- created_timestamp:
482
- type: string
483
- format: date-time
484
- description: Timestamp when the infotext was created in VYMI
485
- last_modified_timestamp:
486
- type: string
487
- format: date-time
488
- description: Timestamp when the infotext was updated in VYMI
489
- required:
490
- - id
491
- - severity_level
492
- - display_type
493
- - active_period
494
- - description_text
495
- - informed_entity
496
- - created_timestamp
497
- - last_modified_timestamp
360
+
498
361
  examples:
499
362
  VehiclePositionsBodyExample:
500
363
  value: |-
@@ -570,57 +433,3 @@ components:
570
433
  "query": "?minutesAfter=40&limit=6&mode=departures&filter=routeHeadingOnceNoGapFill&order=real&aswIds=2781_2&aswIds=2781_52&skip=atStop&airCondition=true"
571
434
  }
572
435
  ]
573
- JisInfotextsExample:
574
- value : |-
575
- [
576
- {
577
- "id": "1833020b-b8c2-4903-85d5-469b0a2ebc70",
578
- "severity_level": "SEVERE",
579
- "display_type": "INLINE",
580
- "active_period": {
581
- "start": "2024-12-05T11:12:00.000Z",
582
- "end": "2025-01-30T23:00:00.000Z"
583
- },
584
- "description_text": {
585
- "cs": "Test po aktualizaci Node.js",
586
- "en": "This is a test"
587
- },
588
- "informed_entity": {
589
- "stops": [
590
- {
591
- "stop_id": "U31070Z20"
592
- },
593
- {
594
- "stop_id": "U32268Z1"
595
- }
596
- ]
597
- },
598
- "created_timestamp": "2024-12-06T14:08:02.669Z"
599
- "last_modified_timestamp": "2024-12-06T14:08:02.669Z"
600
- },
601
- {
602
- "id": "178c4bff-b098-41a9-b0e7-d611bd3c54ac",
603
- "severity_level": "INFO",
604
- "display_type": "INLINE",
605
- "active_period": {
606
- "start": "2024-12-03T10:44:00.000Z",
607
- "end": null
608
- },
609
- "description_text": {
610
- "cs": "Tento text se zobrazí v budoucnosti a bude mít historii",
611
- "en": null
612
- },
613
- "informed_entity": {
614
- "stops": [
615
- {
616
- "stop_id": "U85Z1P"
617
- },
618
- {
619
- "stop_id": "U876Z1P"
620
- }
621
- ]
622
- },
623
- "created_timestamp": "2024-11-08T10:44:34.701Z"
624
- "last_modified_timestamp": "2024-11-08T10:44:34.701Z"
625
- }
626
- ]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@golemio/pid",
3
- "version": "3.2.3-dev.1590852474",
3
+ "version": "3.3.0",
4
4
  "description": "Golemio PID Module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -37,7 +37,7 @@
37
37
  "@commitlint/cli": "^11.0.0",
38
38
  "@commitlint/config-conventional": "^11.0.0",
39
39
  "@golemio/cli": "1.7.3",
40
- "@golemio/core": "1.17.1",
40
+ "@golemio/core": "1.18.0",
41
41
  "@golemio/db-common": "1.1.4",
42
42
  "@golemio/eslint-config": "1.1.2",
43
43
  "@types/amqplib": "^0.5.17",
@@ -76,7 +76,7 @@
76
76
  "@golemio/core": ">=1.16.0-rc.1551191551"
77
77
  },
78
78
  "dependencies": {
79
- "@golemio/ovapi-gtfs-realtime-bindings": "1.2.4-dev.1288219308",
79
+ "@golemio/ovapi-gtfs-realtime-bindings": "1.2.3",
80
80
  "@turf/turf": "^6.5.0",
81
81
  "cheap-ruler": "^3.0.2",
82
82
  "csv-parser": "^3.0.0",
@@ -1,9 +0,0 @@
1
- import { BaseController } from "@golemio/core/dist/input-gateway/controllers";
2
- import { JSONSchemaValidator } from "@golemio/core/dist/shared/golemio-validator";
3
- export declare class JisInfotextsController extends BaseController {
4
- name: string;
5
- protected validator: JSONSchemaValidator;
6
- protected queuePrefix: string;
7
- constructor();
8
- processData: (inputData: any) => Promise<void>;
9
- }
@@ -1,37 +0,0 @@
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.JisInfotextsController = void 0;
13
- const JISInfotextsJsonSchema_1 = require("../../schema-definitions/jis/datasources/JISInfotextsJsonSchema");
14
- const controllers_1 = require("@golemio/core/dist/input-gateway/controllers");
15
- const golemio_errors_1 = require("@golemio/core/dist/shared/golemio-errors");
16
- const golemio_validator_1 = require("@golemio/core/dist/shared/golemio-validator");
17
- class JisInfotextsController extends controllers_1.BaseController {
18
- constructor() {
19
- super("jis", new golemio_validator_1.JSONSchemaValidator("jisInfotextsDataValidation", JISInfotextsJsonSchema_1.jisInfotextsJsonSchema));
20
- this.processData = (inputData) => __awaiter(this, void 0, void 0, function* () {
21
- try {
22
- yield this.validator.Validate(inputData);
23
- yield this.sendMessageToExchange("input." + this.queuePrefix + ".refreshJISInfotexts", JSON.stringify(inputData));
24
- }
25
- catch (err) {
26
- if (err instanceof golemio_errors_1.AbstractGolemioError) {
27
- throw err;
28
- }
29
- else {
30
- throw new golemio_errors_1.GeneralError("Error while validating input data.", this.constructor.name, err, 422);
31
- }
32
- }
33
- });
34
- }
35
- }
36
- exports.JisInfotextsController = JisInfotextsController;
37
- //# sourceMappingURL=JisInfotextsController.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"JisInfotextsController.js","sourceRoot":"","sources":["../../../src/input-gateway/jis/JisInfotextsController.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,4GAAqF;AACrF,8EAA8E;AAC9E,6EAA8F;AAC9F,mFAAkF;AAElF,MAAa,sBAAuB,SAAQ,4BAAc;IAKtD;QACI,KAAK,CAAC,KAAK,EAAE,IAAI,uCAAmB,CAAC,4BAA4B,EAAE,+CAAsB,CAAC,CAAC,CAAC;QAGzF,gBAAW,GAAG,CAAO,SAAc,EAAiB,EAAE;YACzD,IAAI;gBACA,MAAM,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;gBACzC,MAAM,IAAI,CAAC,qBAAqB,CAAC,QAAQ,GAAG,IAAI,CAAC,WAAW,GAAG,sBAAsB,EAAE,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC,CAAC;aACrH;YAAC,OAAO,GAAG,EAAE;gBACV,IAAI,GAAG,YAAY,qCAAoB,EAAE;oBACrC,MAAM,GAAG,CAAC;iBACb;qBAAM;oBACH,MAAM,IAAI,6BAAY,CAAC,oCAAoC,EAAE,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;iBACjG;aACJ;QACL,CAAC,CAAA,CAAC;IAbF,CAAC;CAcJ;AArBD,wDAqBC"}
@@ -1,9 +0,0 @@
1
- /// <reference types="express" />
2
- import { Router } from "@golemio/core/dist/shared/express";
3
- export declare class JisInfotextsRouter {
4
- router: Router;
5
- private controller;
6
- constructor();
7
- private initRoutes;
8
- private post;
9
- }
@@ -1,36 +0,0 @@
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.JisInfotextsRouter = void 0;
13
- const CheckContentTypeMiddleware_1 = require("@golemio/core/dist/input-gateway/helpers/CheckContentTypeMiddleware");
14
- const express_1 = require("@golemio/core/dist/shared/express");
15
- const JisInfotextsController_1 = require("./JisInfotextsController");
16
- class JisInfotextsRouter {
17
- constructor() {
18
- this.post = (req, res, next) => __awaiter(this, void 0, void 0, function* () {
19
- try {
20
- yield this.controller.processData(req.body);
21
- res.sendStatus(204);
22
- }
23
- catch (err) {
24
- next(err);
25
- }
26
- });
27
- this.router = (0, express_1.Router)();
28
- this.controller = new JisInfotextsController_1.JisInfotextsController();
29
- this.initRoutes();
30
- }
31
- initRoutes() {
32
- this.router.post("/infotexts", (0, CheckContentTypeMiddleware_1.checkContentTypeMiddleware)(["application/json"]), this.post);
33
- }
34
- }
35
- exports.JisInfotextsRouter = JisInfotextsRouter;
36
- //# sourceMappingURL=JisInfotextsRouter.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"JisInfotextsRouter.js","sourceRoot":"","sources":["../../../src/input-gateway/jis/JisInfotextsRouter.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oHAAiH;AACjH,+DAA4F;AAC5F,qEAAkE;AAElE,MAAa,kBAAkB;IAI3B;QAUQ,SAAI,GAAG,CAAO,GAAY,EAAE,GAAa,EAAE,IAAkB,EAAiB,EAAE;YACpF,IAAI;gBACA,MAAM,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;gBAC5C,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;aACvB;YAAC,OAAO,GAAG,EAAE;gBACV,IAAI,CAAC,GAAG,CAAC,CAAC;aACb;QACL,CAAC,CAAA,CAAC;QAhBE,IAAI,CAAC,MAAM,GAAG,IAAA,gBAAM,GAAE,CAAC;QACvB,IAAI,CAAC,UAAU,GAAG,IAAI,+CAAsB,EAAE,CAAC;QAC/C,IAAI,CAAC,UAAU,EAAE,CAAC;IACtB,CAAC;IAEO,UAAU;QACd,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,YAAY,EAAE,IAAA,uDAA0B,EAAC,CAAC,kBAAkB,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;IAChG,CAAC;CAUJ;AAtBD,gDAsBC"}
@@ -1,10 +0,0 @@
1
- import { JISInfotextsDataSourceFactory } from "../../datasources/JISInfotextsDataSourceFactory";
2
- import { AbstractEmptyTask } from "@golemio/core/dist/integration-engine";
3
- export declare class FetchJISInfotextsTask extends AbstractEmptyTask {
4
- private dataSourceFactory;
5
- readonly queueName = "fetchJISInfotexts";
6
- readonly queueTtl: number;
7
- constructor(dataSourceFactory: JISInfotextsDataSourceFactory);
8
- /** Fetch JIS Infotexts data source */
9
- protected execute(): Promise<void>;
10
- }
@@ -1,62 +0,0 @@
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 __param = (this && this.__param) || function (paramIndex, decorator) {
12
- return function (target, key) { decorator(target, key, paramIndex); }
13
- };
14
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
15
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
16
- return new (P || (P = Promise))(function (resolve, reject) {
17
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
18
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
19
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
20
- step((generator = generator.apply(thisArg, _arguments || [])).next());
21
- });
22
- };
23
- Object.defineProperty(exports, "__esModule", { value: true });
24
- exports.FetchJISInfotextsTask = void 0;
25
- const JISInfotextsDataSourceFactory_1 = require("../../datasources/JISInfotextsDataSourceFactory");
26
- const JISContainerToken_1 = require("../../ioc/JISContainerToken");
27
- const integration_engine_1 = require("@golemio/core/dist/integration-engine");
28
- const tsyringe_1 = require("@golemio/core/dist/shared/tsyringe");
29
- const constants_1 = require("../constants");
30
- const golemio_errors_1 = require("@golemio/core/dist/shared/golemio-errors");
31
- let FetchJISInfotextsTask = exports.FetchJISInfotextsTask = class FetchJISInfotextsTask extends integration_engine_1.AbstractEmptyTask {
32
- constructor(dataSourceFactory) {
33
- super(constants_1.JIS_WORKER_NAME.toLowerCase());
34
- this.dataSourceFactory = dataSourceFactory;
35
- this.queueName = "fetchJISInfotexts";
36
- this.queueTtl = 20 * 1000; // 20 seconds
37
- }
38
- /** Fetch JIS Infotexts data source */
39
- execute() {
40
- return __awaiter(this, void 0, void 0, function* () {
41
- try {
42
- const dataSource = this.dataSourceFactory.getDataSource();
43
- const data = yield dataSource.getAll();
44
- yield integration_engine_1.QueueManager.sendMessageToExchange(this.queuePrefix, "refreshJISInfotexts", data);
45
- }
46
- catch (err) {
47
- if (err instanceof golemio_errors_1.AbstractGolemioError) {
48
- throw err;
49
- }
50
- else {
51
- throw new golemio_errors_1.GeneralError("Error while fetching new JIS infotexts", this.constructor.name, err);
52
- }
53
- }
54
- });
55
- }
56
- };
57
- exports.FetchJISInfotextsTask = FetchJISInfotextsTask = __decorate([
58
- (0, tsyringe_1.injectable)(),
59
- __param(0, (0, tsyringe_1.inject)(JISContainerToken_1.JISContainerToken.JISInfotextsDataSourceFactory)),
60
- __metadata("design:paramtypes", [JISInfotextsDataSourceFactory_1.JISInfotextsDataSourceFactory])
61
- ], FetchJISInfotextsTask);
62
- //# sourceMappingURL=FetchJISInfotextsTask.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"FetchJISInfotextsTask.js","sourceRoot":"","sources":["../../../../../src/integration-engine/jis/workers/tasks/FetchJISInfotextsTask.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,mGAAkG;AAClG,mEAAkE;AAClE,8EAAwF;AACxF,iEAAwE;AACxE,4CAA+C;AAC/C,6EAA8F;AAGvF,IAAM,qBAAqB,mCAA3B,MAAM,qBAAsB,SAAQ,sCAAiB;IAIxD,YAEI,iBAAwD;QAExD,KAAK,CAAC,2BAAe,CAAC,WAAW,EAAE,CAAC,CAAC;QAF7B,sBAAiB,GAAjB,iBAAiB,CAA+B;QAL5C,cAAS,GAAG,mBAAmB,CAAC;QAChC,aAAQ,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC,aAAa;IAOnD,CAAC;IAED,sCAAsC;IACtB,OAAO;;YACnB,IAAI;gBACA,MAAM,UAAU,GAAG,IAAI,CAAC,iBAAiB,CAAC,aAAa,EAAE,CAAC;gBAC1D,MAAM,IAAI,GAAG,MAAM,UAAU,CAAC,MAAM,EAAE,CAAC;gBAEvC,MAAM,iCAAY,CAAC,qBAAqB,CAAC,IAAI,CAAC,WAAW,EAAE,qBAAqB,EAAE,IAAI,CAAC,CAAC;aAC3F;YAAC,OAAO,GAAG,EAAE;gBACV,IAAI,GAAG,YAAY,qCAAoB,EAAE;oBACrC,MAAM,GAAG,CAAC;iBACb;qBAAM;oBACH,MAAM,IAAI,6BAAY,CAAC,wCAAwC,EAAE,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;iBAChG;aACJ;QACL,CAAC;KAAA;CACJ,CAAA;gCA1BY,qBAAqB;IADjC,IAAA,qBAAU,GAAE;IAMJ,WAAA,IAAA,iBAAM,EAAC,qCAAiB,CAAC,6BAA6B,CAAC,CAAA;qCAC7B,6DAA6B;GANnD,qBAAqB,CA0BjC"}