@golemio/pid 4.1.3 → 4.1.4-dev.2053451259

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/dist/helpers/jis/JISEventTranslationHelper.d.ts +4 -0
  2. package/dist/helpers/jis/JISEventTranslationHelper.js +46 -0
  3. package/dist/helpers/jis/JISEventTranslationHelper.js.map +1 -0
  4. package/dist/helpers/jis/interfaces/IJISEventCustomFormatDto.d.ts +33 -0
  5. package/dist/helpers/jis/interfaces/IJISEventCustomFormatDto.js +3 -0
  6. package/dist/helpers/jis/interfaces/IJISEventCustomFormatDto.js.map +1 -0
  7. package/dist/input-gateway/jis/controllers/JISEventsController.js +1 -1
  8. package/dist/input-gateway/jis/controllers/JISEventsController.js.map +1 -1
  9. package/dist/integration-engine/jis/datasources/JISEventsDataSourceFactory.js +7 -5
  10. package/dist/integration-engine/jis/datasources/JISEventsDataSourceFactory.js.map +1 -1
  11. package/dist/integration-engine/jis/datasources/JISInfotextsDataSourceFactory.js +7 -5
  12. package/dist/integration-engine/jis/datasources/JISInfotextsDataSourceFactory.js.map +1 -1
  13. package/dist/integration-engine/jis/ioc/Di.js +7 -1
  14. package/dist/integration-engine/jis/ioc/Di.js.map +1 -1
  15. package/dist/integration-engine/jis/ioc/JISContainerToken.d.ts +3 -0
  16. package/dist/integration-engine/jis/ioc/JISContainerToken.js +3 -0
  17. package/dist/integration-engine/jis/ioc/JISContainerToken.js.map +1 -1
  18. package/dist/integration-engine/jis/services/JISEventsDataService.d.ts +2 -1
  19. package/dist/integration-engine/jis/services/JISEventsDataService.js +7 -1
  20. package/dist/integration-engine/jis/services/JISEventsDataService.js.map +1 -1
  21. package/dist/integration-engine/jis/transformations/UpdateEventWebhookTransformation.d.ts +13 -0
  22. package/dist/integration-engine/jis/transformations/UpdateEventWebhookTransformation.js +62 -0
  23. package/dist/integration-engine/jis/transformations/UpdateEventWebhookTransformation.js.map +1 -0
  24. package/dist/integration-engine/jis/workers/JISWorker.js +1 -0
  25. package/dist/integration-engine/jis/workers/JISWorker.js.map +1 -1
  26. package/dist/integration-engine/jis/workers/tasks/AbstractFetchJISResourceTask.d.ts +1 -0
  27. package/dist/integration-engine/jis/workers/tasks/AbstractFetchJISResourceTask.js +1 -1
  28. package/dist/integration-engine/jis/workers/tasks/AbstractFetchJISResourceTask.js.map +1 -1
  29. package/dist/integration-engine/jis/workers/tasks/FetchJISEventsTask.d.ts +1 -0
  30. package/dist/integration-engine/jis/workers/tasks/FetchJISEventsTask.js +2 -0
  31. package/dist/integration-engine/jis/workers/tasks/FetchJISEventsTask.js.map +1 -1
  32. package/dist/integration-engine/jis/workers/tasks/FetchJISInfotextsTask.d.ts +1 -0
  33. package/dist/integration-engine/jis/workers/tasks/FetchJISInfotextsTask.js +2 -0
  34. package/dist/integration-engine/jis/workers/tasks/FetchJISInfotextsTask.js.map +1 -1
  35. package/dist/integration-engine/jis/workers/tasks/RefreshJISEventsTask.d.ts +9 -2
  36. package/dist/integration-engine/jis/workers/tasks/RefreshJISEventsTask.js +28 -3
  37. package/dist/integration-engine/jis/workers/tasks/RefreshJISEventsTask.js.map +1 -1
  38. package/dist/integration-engine/jis/workers/tasks/UpdateEventWebhookTask.d.ts +21 -0
  39. package/dist/integration-engine/jis/workers/tasks/UpdateEventWebhookTask.js +132 -0
  40. package/dist/integration-engine/jis/workers/tasks/UpdateEventWebhookTask.js.map +1 -0
  41. package/dist/integration-engine/ropid-gtfs/RopidGTFSStopsModel.d.ts +3 -3
  42. package/dist/integration-engine/ropid-gtfs/RopidGTFSStopsModel.js +11 -3
  43. package/dist/integration-engine/ropid-gtfs/RopidGTFSStopsModel.js.map +1 -1
  44. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/RefreshGtfsStopsCacheTask.js +1 -1
  45. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/RefreshGtfsStopsCacheTask.js.map +1 -1
  46. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/data-access/cache/GtfsStopsRedisRepository.d.ts +2 -2
  47. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/data-access/cache/GtfsStopsRedisRepository.js +4 -0
  48. package/dist/integration-engine/ropid-gtfs/workers/timetables/tasks/data-access/cache/GtfsStopsRedisRepository.js.map +1 -1
  49. package/dist/integration-engine/vehicle-positions/workers/gtfs-rt/helpers/AlertsGenerator.js +1 -1
  50. package/dist/integration-engine/vehicle-positions/workers/gtfs-rt/helpers/AlertsGenerator.js.map +1 -1
  51. package/dist/output-gateway/jis/domain/IJISEventsInterfaces.d.ts +0 -31
  52. package/dist/output-gateway/jis/ioc/Di.js +1 -5
  53. package/dist/output-gateway/jis/ioc/Di.js.map +1 -1
  54. package/dist/output-gateway/jis/ioc/OgJisToken.d.ts +0 -1
  55. package/dist/output-gateway/jis/ioc/OgJisToken.js +0 -1
  56. package/dist/output-gateway/jis/ioc/OgJisToken.js.map +1 -1
  57. package/dist/output-gateway/jis/transformations/JISEventsCustomFormatTransformation.d.ts +2 -5
  58. package/dist/output-gateway/jis/transformations/JISEventsCustomFormatTransformation.js +6 -16
  59. package/dist/output-gateway/jis/transformations/JISEventsCustomFormatTransformation.js.map +1 -1
  60. package/dist/schema-definitions/jis/constants/jisEventType.d.ts +2 -0
  61. package/dist/schema-definitions/jis/constants/jisEventType.js +5 -0
  62. package/dist/schema-definitions/jis/constants/jisEventType.js.map +1 -0
  63. package/dist/schema-definitions/jis/datasources/JISEventsJsonSchema.js +2 -1
  64. package/dist/schema-definitions/jis/datasources/JISEventsJsonSchema.js.map +1 -1
  65. package/dist/schema-definitions/jis/datasources/interfaces/IJISEvent.d.ts +2 -1
  66. package/dist/schema-definitions/jis/models/JISEventsModel.js +2 -1
  67. package/dist/schema-definitions/jis/models/JISEventsModel.js.map +1 -1
  68. package/dist/schema-definitions/ropid-gtfs/interfaces/IStopDto.d.ts +3 -1
  69. package/docs/asyncapi.yaml +33 -5
  70. package/docs/implementation_documentation.md +55 -8
  71. package/package.json +2 -2
  72. package/dist/output-gateway/jis/helpers/TranslationHelper.d.ts +0 -4
  73. package/dist/output-gateway/jis/helpers/TranslationHelper.js +0 -48
  74. package/dist/output-gateway/jis/helpers/TranslationHelper.js.map +0 -1
@@ -17,6 +17,7 @@ const JISContainerToken_1 = require("../../ioc/JISContainerToken");
17
17
  const JISEventsDataService_1 = require("../../services/JISEventsDataService");
18
18
  const JISEventsTransformation_1 = require("../../transformations/JISEventsTransformation");
19
19
  const JISEventsJsonSchema_1 = require("../../../../schema-definitions/jis/datasources/JISEventsJsonSchema");
20
+ const integration_engine_1 = require("@golemio/core/dist/integration-engine");
20
21
  const AbstractTaskJsonSchema_1 = require("@golemio/core/dist/integration-engine/workers/AbstractTaskJsonSchema");
21
22
  const golemio_validator_1 = require("@golemio/core/dist/shared/golemio-validator");
22
23
  const tsyringe_1 = require("@golemio/core/dist/shared/tsyringe");
@@ -26,11 +27,35 @@ let RefreshJISEventsTask = exports.RefreshJISEventsTask = class RefreshJISEvents
26
27
  super(constants_1.JIS_WORKER_NAME.toLowerCase());
27
28
  this.eventsDataService = eventsDataService;
28
29
  this.eventsTransformation = eventsTransformation;
29
- this.schema = new golemio_validator_1.JSONSchemaValidator("JISEventsDataValidation", JISEventsJsonSchema_1.jisEventsJsonSchema);
30
+ this.schema = new golemio_validator_1.JSONSchemaValidator("JISEventsDataValidation", {
31
+ type: "object",
32
+ properties: {
33
+ data: JISEventsJsonSchema_1.jisEventsJsonSchema,
34
+ shouldTriggerWebhooks: { type: "boolean" },
35
+ },
36
+ required: ["data"],
37
+ definitions: {
38
+ Translation: {
39
+ type: "object",
40
+ properties: {
41
+ cs: { type: "string" },
42
+ en: { oneOf: [{ type: "string" }, { type: "null", nullable: true }] },
43
+ },
44
+ additionalProperties: false,
45
+ required: ["cs"],
46
+ },
47
+ },
48
+ });
30
49
  this.queueName = "refreshJISEvents";
31
50
  this.queueTtl = 60 * 1000; // 1 minute
32
51
  }
33
- async execute(data) {
52
+ async execute(input) {
53
+ const savedData = await this.transformAndSave(input.data);
54
+ if (input.shouldTriggerWebhooks && savedData) {
55
+ await integration_engine_1.QueueManager.sendMessageToExchange(this.queuePrefix, "updateEventWebhook", input.data);
56
+ }
57
+ }
58
+ async transformAndSave(data) {
34
59
  const transformedData = this.eventsTransformation.transformArray(data);
35
60
  const events = [];
36
61
  const eventsRopidGTFSRoutes = [];
@@ -38,7 +63,7 @@ let RefreshJISEventsTask = exports.RefreshJISEventsTask = class RefreshJISEvents
38
63
  events.push(event);
39
64
  eventsRopidGTFSRoutes.push(...routes);
40
65
  }
41
- await this.eventsDataService.upsertAll(events, eventsRopidGTFSRoutes);
66
+ return await this.eventsDataService.upsertAll(events, eventsRopidGTFSRoutes);
42
67
  }
43
68
  };
44
69
  exports.RefreshJISEventsTask = RefreshJISEventsTask = __decorate([
@@ -1 +1 @@
1
- {"version":3,"file":"RefreshJISEventsTask.js","sourceRoot":"","sources":["../../../../../src/integration-engine/jis/workers/tasks/RefreshJISEventsTask.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,mEAAkE;AAClE,8EAA6E;AAC7E,2FAA0F;AAE1F,4GAA+E;AAE/E,iHAA8G;AAC9G,mFAAkF;AAClF,iEAAwE;AACxE,4CAA+C;AAGxC,IAAM,oBAAoB,kCAA1B,MAAM,oBAAqB,SAAQ,+CAAmC;IAKzE,YAEI,iBAA+C,EAE/C,oBAAqD;QAErD,KAAK,CAAC,2BAAe,CAAC,WAAW,EAAE,CAAC,CAAC;QAJ7B,sBAAiB,GAAjB,iBAAiB,CAAsB;QAEvC,yBAAoB,GAApB,oBAAoB,CAAyB;QARzC,WAAM,GAAG,IAAI,uCAAmB,CAAC,yBAAyB,EAAE,yCAAmB,CAAC,CAAC;QACjF,cAAS,GAAG,kBAAkB,CAAC;QAC/B,aAAQ,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC,WAAW;IASjD,CAAC;IAES,KAAK,CAAC,OAAO,CAAC,IAAiB;QACrC,MAAM,eAAe,GAAG,IAAI,CAAC,oBAAoB,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;QAEvE,MAAM,MAAM,GAAqB,EAAE,CAAC;QACpC,MAAM,qBAAqB,GAAgC,EAAE,CAAC;QAE9D,KAAK,MAAM,EAAE,KAAK,EAAE,qBAAqB,EAAE,MAAM,EAAE,IAAI,eAAe,EAAE;YACpE,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YACnB,qBAAqB,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC,CAAC;SACzC;QAED,MAAM,IAAI,CAAC,iBAAiB,CAAC,SAAS,CAAC,MAAM,EAAE,qBAAqB,CAAC,CAAC;IAC1E,CAAC;CACJ,CAAA;+BA3BY,oBAAoB;IADhC,IAAA,qBAAU,GAAE;IAOJ,WAAA,IAAA,iBAAM,EAAC,qCAAiB,CAAC,oBAAoB,CAAC,CAAA;IAE9C,WAAA,IAAA,iBAAM,EAAC,qCAAiB,CAAC,uBAAuB,CAAC,CAAA;qCADvB,2CAAoB;QAEjB,iDAAuB;GAThD,oBAAoB,CA2BhC"}
1
+ {"version":3,"file":"RefreshJISEventsTask.js","sourceRoot":"","sources":["../../../../../src/integration-engine/jis/workers/tasks/RefreshJISEventsTask.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,mEAAkE;AAClE,8EAA6E;AAC7E,2FAA0F;AAE1F,4GAA+E;AAE/E,8EAAqE;AACrE,iHAA8G;AAC9G,mFAAkF;AAClF,iEAAwE;AACxE,4CAA+C;AAGxC,IAAM,oBAAoB,kCAA1B,MAAM,oBAAqB,SAAQ,+CAA8E;IAuBpH,YAEI,iBAA+C,EAE/C,oBAAqD;QAErD,KAAK,CAAC,2BAAe,CAAC,WAAW,EAAE,CAAC,CAAC;QAJ7B,sBAAiB,GAAjB,iBAAiB,CAAsB;QAEvC,yBAAoB,GAApB,oBAAoB,CAAyB;QA1BzC,WAAM,GAAG,IAAI,uCAAmB,CAAC,yBAAyB,EAAE;YACxE,IAAI,EA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AAI,CAAC,KAAK,CAAC,CAAC;YACnB,qBAAqB,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC,CAAC;SACzC;QAED,OAAO,MAAM,IAAI,CAAC,iBAAiB,CAAC,SAAS,CAAC,MAAM,EAAE,qBAAqB,CAAC,CAAC;IACjF,CAAC;CACJ,CAAA;+BAnDY,oBAAoB;IADhC,IAAA,qBAAU,GAAE;IAyBJ,WAAA,IAAA,iBAAM,EAAC,qCAAiB,CAAC,oBAAoB,CAAC,CAAA;IAE9C,WAAA,IAAA,iBAAM,EAAC,qCAAiB,CAAC,uBAAuB,CAAC,CAAA;qCADvB,2CAAoB;QAEjB,iDAAuB;GA3BhD,oBAAoB,CAmDhC"}
@@ -0,0 +1,21 @@
1
+ import { IJISEvent } from "../../../../schema-definitions/jis/datasources/interfaces";
2
+ import { ISimpleConfig } from "@golemio/core/dist/helpers/configuration/ISimpleConfig";
3
+ import { AbstractTaskJsonSchema } from "@golemio/core/dist/integration-engine/workers/AbstractTaskJsonSchema";
4
+ import { JSONSchemaValidator } from "@golemio/core/dist/shared/golemio-validator";
5
+ import { UpdateEventWebhookTransformation } from "../../transformations/UpdateEventWebhookTransformation";
6
+ import { RopidGTFSRoutesRepository } from "../../../ropid-gtfs/data-access/RopidGTFSRoutesRepository";
7
+ export declare class UpdateEventWebhookTask extends AbstractTaskJsonSchema<IJISEvent[]> {
8
+ private readonly config;
9
+ private readonly transformation;
10
+ private readonly routesRepository;
11
+ readonly schema: JSONSchemaValidator;
12
+ readonly queueName = "updateEventWebhook";
13
+ readonly queueTtl: number;
14
+ private readonly commonHeaders;
15
+ private readonly targets;
16
+ constructor(config: ISimpleConfig, transformation: UpdateEventWebhookTransformation, routesRepository: RopidGTFSRoutesRepository);
17
+ protected execute(data: IJISEvent[]): Promise<void>;
18
+ private getTargetFetchStrategy;
19
+ private validateResponse;
20
+ private fillMissingDataAndTransform;
21
+ }
@@ -0,0 +1,132 @@
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
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.UpdateEventWebhookTask = void 0;
16
+ const CoreToken_1 = require("@golemio/core/dist/helpers/ioc/CoreToken");
17
+ const HTTPFetchProtocolStrategy_1 = require("@golemio/core/dist/integration-engine/datasources/protocol-strategy/HTTPFetchProtocolStrategy");
18
+ const AbstractTaskJsonSchema_1 = require("@golemio/core/dist/integration-engine/workers/AbstractTaskJsonSchema");
19
+ const golemio_errors_1 = require("@golemio/core/dist/shared/golemio-errors");
20
+ const golemio_validator_1 = require("@golemio/core/dist/shared/golemio-validator");
21
+ const tsyringe_1 = require("@golemio/core/dist/shared/tsyringe");
22
+ const JISContainerToken_1 = require("../../ioc/JISContainerToken");
23
+ const UpdateEventWebhookTransformation_1 = require("../../transformations/UpdateEventWebhookTransformation");
24
+ const constants_1 = require("../constants");
25
+ const RopidGTFSRoutesRepository_1 = require("../../../ropid-gtfs/data-access/RopidGTFSRoutesRepository");
26
+ const sequelize_1 = require("@golemio/core/dist/shared/sequelize");
27
+ const WEBHOOK_TIMEOUT_IN_SECONDS = 120;
28
+ let UpdateEventWebhookTask = exports.UpdateEventWebhookTask = class UpdateEventWebhookTask extends AbstractTaskJsonSchema_1.AbstractTaskJsonSchema {
29
+ constructor(config, transformation, routesRepository) {
30
+ super(constants_1.JIS_WORKER_NAME.toLowerCase());
31
+ this.config = config;
32
+ this.transformation = transformation;
33
+ this.routesRepository = routesRepository;
34
+ this.schema = new golemio_validator_1.JSONSchemaValidator("UpdateEventWebhookTask", {
35
+ type: "array",
36
+ items: {
37
+ type: "object",
38
+ },
39
+ });
40
+ this.queueName = "updateEventWebhook";
41
+ this.queueTtl = 60 * 1000; // 1 minute
42
+ this.commonHeaders = this.config.getValue("module.pid.jis.webhooks.eventUpdate.commonHeaders", {});
43
+ this.targets = this.config.getValue("module.pid.jis.webhooks.eventUpdate.targets.*");
44
+ }
45
+ async execute(data) {
46
+ const posts = [];
47
+ for (const target of this.targets) {
48
+ // filter out events that should not be exported to the target
49
+ const filteredEvents = data.filter((event) => Object.values(target.allowed_orgs).includes(event.organization_name) &&
50
+ Object.values(target.allowed_event_types).includes(event.type));
51
+ if (filteredEvents.length === 0)
52
+ continue;
53
+ const transformedEvents = await this.fillMissingDataAndTransform(filteredEvents);
54
+ const post = this.getTargetFetchStrategy(target, transformedEvents)
55
+ .getRawData()
56
+ .then((res) => this.validateResponse(res, target))
57
+ .catch((err) => {
58
+ if (err instanceof golemio_errors_1.GeneralError)
59
+ throw err;
60
+ throw new golemio_errors_1.GeneralError(`Error while sending event update webhook to ${target.url}`, this.constructor.name, err);
61
+ });
62
+ posts.push(post);
63
+ }
64
+ await Promise.all(posts);
65
+ }
66
+ getTargetFetchStrategy(target, events) {
67
+ const fetchSettings = {
68
+ url: target.url,
69
+ method: "POST",
70
+ headers: {
71
+ ...this.commonHeaders,
72
+ ...target.headers,
73
+ },
74
+ body: JSON.stringify(events),
75
+ timeoutInSeconds: WEBHOOK_TIMEOUT_IN_SECONDS,
76
+ responseType: "text",
77
+ };
78
+ return new HTTPFetchProtocolStrategy_1.HTTPFetchProtocolStrategy(fetchSettings);
79
+ }
80
+ validateResponse(response, target) {
81
+ if (response.meta.statusCode !== 200) {
82
+ throw new golemio_errors_1.GeneralError(`Error while sending event update webhook to ${target.url} (unexpected status code)`, this.constructor.name, JSON.stringify(response), response.meta.statusCode);
83
+ }
84
+ }
85
+ async fillMissingDataAndTransform(events) {
86
+ const routeIds = Array.from(new Set(events.flatMap((event) => event.informed_entity?.routes?.map((route) => route.id) || [])));
87
+ let routeRecords;
88
+ try {
89
+ routeRecords = await this.routesRepository["sequelizeModel"].findAll({
90
+ where: {
91
+ route_id: { [sequelize_1.Op.in]: routeIds },
92
+ },
93
+ attributes: ["route_short_name", "route_long_name", "route_type", "route_id"],
94
+ raw: true,
95
+ });
96
+ }
97
+ catch (err) {
98
+ if (err instanceof golemio_errors_1.GeneralError)
99
+ throw err;
100
+ throw new golemio_errors_1.GeneralError(`Error while getting route details from DB`, this.constructor.name, err);
101
+ }
102
+ const routeMap = new Map();
103
+ for (const route of routeRecords) {
104
+ routeMap.set(route.route_id, route);
105
+ }
106
+ const result = events.map((event) => {
107
+ const routes = [];
108
+ for (const r of event.informed_entity?.routes || []) {
109
+ const routeData = routeMap.get(r.id);
110
+ if (routeData) {
111
+ routes.push({
112
+ route_id: routeData.route_id,
113
+ route_short_name: routeData.route_short_name,
114
+ route_long_name: routeData.route_long_name,
115
+ route_type: routeData.route_type,
116
+ });
117
+ }
118
+ }
119
+ return this.transformation.transformElement({ event, routes });
120
+ });
121
+ return result;
122
+ }
123
+ };
124
+ exports.UpdateEventWebhookTask = UpdateEventWebhookTask = __decorate([
125
+ (0, tsyringe_1.injectable)(),
126
+ __param(0, (0, tsyringe_1.inject)(CoreToken_1.CoreToken.SimpleConfig)),
127
+ __param(1, (0, tsyringe_1.inject)(JISContainerToken_1.JISContainerToken.UpdateEventWebhookTransformation)),
128
+ __param(2, (0, tsyringe_1.inject)(JISContainerToken_1.JISContainerToken.RopidGTFSRoutesRepository)),
129
+ __metadata("design:paramtypes", [Object, UpdateEventWebhookTransformation_1.UpdateEventWebhookTransformation,
130
+ RopidGTFSRoutesRepository_1.RopidGTFSRoutesRepository])
131
+ ], UpdateEventWebhookTask);
132
+ //# sourceMappingURL=UpdateEventWebhookTask.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UpdateEventWebhookTask.js","sourceRoot":"","sources":["../../../../../src/integration-engine/jis/workers/tasks/UpdateEventWebhookTask.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAGA,wEAAqE;AACrE,6IAA0I;AAE1I,iHAA8G;AAC9G,6EAAwE;AACxE,mFAAkF;AAClF,iEAAwE;AACxE,mEAAgE;AAChE,6GAA0G;AAC1G,4CAA+C;AAC/C,yGAAiG;AACjG,mEAAyD;AAIzD,MAAM,0BAA0B,GAAG,GAAG,CAAC;AAShC,IAAM,sBAAsB,oCAA5B,MAAM,sBAAuB,SAAQ,+CAAmC;IAa3E,YACoC,MAAsC,EAEtE,cAAiE,EACZ,gBAA4D;QAEjH,KAAK,CAAC,2BAAe,CAAC,WAAW,EAAE,CAAC,CAAC;QALY,WAAM,GAAN,MAAM,CAAe;QAErD,mBAAc,GAAd,cAAc,CAAkC;QACK,qBAAgB,GAAhB,gBAAgB,CAA2B;QAhBrG,WAAM,GAAG,IAAI,uCAAmB,CAAC,wBAAwB,EAAE;YACvE,IAAI,EAAE,OAAO;YACb,KAAK,EAAE;gBACH,IAAI,EAAE,QAAQ;aACjB;SACJ,CAAC,CAAC;QACa,cAAS,GAAG,oBAAoB,CAAC;QACjC,aAAQ,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC,WAAW;QAY7C,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,MAAM,CAAC,QAAQ,CACrC,mDAAmD,EACnD,EAAE,CACU,CAAC;QACjB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAkB,+CAA+C,CAAoB,CAAC;IAC7H,CAAC;IAES,KAAK,CAAC,OAAO,CAAC,IAAiB;QACrC,MAAM,KAAK,GAAG,EAAE,CAAC;QAEjB,KAAK,MAAM,MAAM,IAAI,IAAI,CAA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AgIlC"}
@@ -1,4 +1,4 @@
1
- import { IAwsNodeIdGtfsStopIdDto, IStopDto } from "../../schema-definitions/ropid-gtfs/interfaces/IStopDto";
1
+ import { IStopsCacheDto, IStopDto } from "../../schema-definitions/ropid-gtfs/interfaces/IStopDto";
2
2
  import { IModel, PostgresModel } from "@golemio/core/dist/integration-engine";
3
3
  import { IValidator } from "@golemio/core/dist/shared/golemio-validator";
4
4
  import Sequelize from "@golemio/core/dist/shared/sequelize";
@@ -16,7 +16,7 @@ export declare class RopidGTFSStopsModel extends PostgresModel implements IModel
16
16
  constructor();
17
17
  getAll: () => Promise<IStopDto[]>;
18
18
  /**
19
- * Retrieve all aswNodeIds and gtfs_ids where location_type is 0 and computed_cis_stop_id is not null
19
+ * Retrieve all stops data needed for cache where location_type is 0 and computed_cis_stop_id is not null
20
20
  */
21
- getAllAswNodeGtfsStops: () => Promise<IAwsNodeIdGtfsStopIdDto[]>;
21
+ getStopsForCache: () => Promise<IStopsCacheDto[]>;
22
22
  }
@@ -36,12 +36,20 @@ let RopidGTFSStopsModel = exports.RopidGTFSStopsModel = class RopidGTFSStopsMode
36
36
  }
37
37
  };
38
38
  /**
39
- * Retrieve all aswNodeIds and gtfs_ids where location_type is 0 and computed_cis_stop_id is not null
39
+ * Retrieve all stops data needed for cache where location_type is 0 and computed_cis_stop_id is not null
40
40
  */
41
- this.getAllAswNodeGtfsStops = async () => {
41
+ this.getStopsForCache = async () => {
42
42
  try {
43
43
  const stops = (await this.sequelizeModel.findAll({
44
- attributes: ["asw_node_id", "stop_id"],
44
+ attributes: [
45
+ "stop_id",
46
+ "asw_node_id",
47
+ "stop_name",
48
+ "platform_code",
49
+ "wheelchair_boarding",
50
+ "zone_id",
51
+ "computed_cis_stop_id",
52
+ ],
45
53
  raw: true,
46
54
  where: {
47
55
  location_type: StopEnums_1.GtfsStopLocationType.StopOrPlatform,
@@ -1 +1 @@
1
- {"version":3,"file":"RopidGTFSStopsModel.js","sourceRoot":"","sources":["../../../src/integration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,GAAG,EAAE,GAAG,CAAC,CAAC;aAC7E;QACL,CAAC,CAAC;QAEF;;WAEG;QACI,qBAAgB,GAAG,KAAK,IAAI,EAAE;YACjC,IAAI;gBACA,MAAM,KAAK,GAAG,CAAC,MAAM,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC;oBAC7C,UAAU,EAAE;wBACR,SAAS;wBACT,aAAa;wBACb,WAAW;wBACX,eAAe;wBACf,qBAAqB;wBACrB,SAAS;wBACT,sBAAsB;qBACzB;oBACD,GAAG,EAAE,IAAI;oBACT,KAAK,EAAE;wBACH,aAAa,EAAE,gCAAoB,CAAC,cAAc;wBAClD,oBAAoB,EAAE,EAAE,CAAC,cAAE,CAAC,GAAG,CAAC,EAAE,IAAI,EAAE;qBAC3C;iBACJ,CAAC,CAAqB,CAAC;gBAExB,IAAI,CAAC,KAAK,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE;oBAC9B,OAAO,EAAE,CAAC;iBACb;gBACD,OAAO,KAAK,CAAC;aAChB;YAAC,OAAO,KAAK,EAAE;gBACZ,MAAM,IAAI,6BAAY,CAAC,mCAAmC,EAAE,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;aAC7F;QACL,CAAC,CAAC;IAvCF,CAAC;CAwCJ,CAAA;8BA/DY,mBAAmB;IAD/B,IAAA,qBAAU,GAAE;;GACA,mBAAmB,CA+D/B"}
@@ -30,7 +30,7 @@ let RefreshGtfsStopsCacheTask = exports.RefreshGtfsStopsCacheTask = class Refres
30
30
  }
31
31
  async execute() {
32
32
  const cisStops = await this.gtfsStopCisModel.getAll();
33
- const gtfsStops = await this.gtfsStopRepository.getAllAswNodeGtfsStops();
33
+ const gtfsStops = await this.gtfsStopRepository.getStopsForCache();
34
34
  await this.gtfsStopsRedisRepository.refreshData(cisStops, gtfsStops);
35
35
  }
36
36
  };
@@ -1 +1 @@
1
- {"version":3,"file":"RefreshGtfsStopsCacheTask.js","sourceRoot":"","sources":["../../../../../../src/integration-engine/ropid-gtfs/workers/timetables/tasks/RefreshGtfsStopsCacheTask.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,yCAA6E;AAC7E,kFAAqF;AACrF,8EAA0E;AAC1E,iEAAwE;AACxE,4CAAqD;AACrD,2FAAwF;AAGjF,IAAM,yBAAyB,uCAA/B,MAAM,yBAA0B,SAAQ,sCAAiB;IAM5D,YAC8D,wBAA0D,EAC5D,gBAAgD;QAExG,KAAK,CAAC,iCAAqB,CAAC,CAAC;QAHqC,6BAAwB,GAAxB,wBAAwB,CAA0B;QACpD,qBAAgB,GAAhB,gBAAgB,CAAwB;QAP5F,cAAS,GAAG,uBAAuB,CAAC;QACpC,aAAQ,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC,aAAa;QAUpD,IAAI,CAAC,kBAAkB,GAAG,IAAI,gCAAmB,EAAE,CAAC;IACxD,CAAC;IAES,KAAK,CAAC,OAAO;QACnB,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,gBAAgB,CAAC,MAAM,EAAE,CAAC;QACtD,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC,kBAAkB,CAAC,sBAAsB,EAAE,CAAC;QAEzE,MAAM,IAAI,CAAC,wBAAwB,CAAC,WAAW,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC;IACzE,CAAC;CACJ,CAAA;oCArBY,yBAAyB;IADrC,IAAA,qBAAU,GAAE;IAQJ,WAAA,IAAA,iBAAM,EAAC,iDAAuB,CAAC,wBAAwB,CAAC,CAAA;IACxD,WAAA,IAAA,iBAAM,EAAC,iDAAuB,CAAC,sBAAsB,CAAC,CAAA;qCADqC,mDAAwB;QAClC,mCAAsB;GARnG,yBAAyB,CAqBrC"}
1
+ {"version":3,"file":"RefreshGtfsStopsCacheTask.js","sourceRoot":"","sources":["../../../../../../src/integration-engine/ropid-gtfs/workers/timetables/tasks/RefreshGtfsStopsCacheTask.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,yCAA6E;AAC7E,kFAAqF;AACrF,8EAA0E;AAC1E,iEAAwE;AACxE,4CAAqD;AACrD,2FAAwF;AAGjF,IAAM,yBAAyB,uCAA/B,MAAM,yBAA0B,SAAQ,sCAAiB;IAM5D,YAC8D,wBAA0D,EAC5D,gBAAgD;QAExG,KAAK,CAAC,iCAAqB,CAAC,CAAC;QAHqC,6BAAwB,GAAxB,wBAAwB,CAA0B;QACpD,qBAAgB,GAAhB,gBAAgB,CAAwB;QAP5F,cAAS,GAAG,uBAAuB,CAAC;QACpC,aAAQ,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC,aAAa;QAUpD,IAAI,CAAC,kBAAkB,GAAG,IAAI,gCAAmB,EAAE,CAAC;IACxD,CAAC;IAES,KAAK,CAAC,OAAO;QACnB,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,gBAAgB,CAAC,MAAM,EAAE,CAAC;QACtD,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC,kBAAkB,CAAC,gBAAgB,EAAE,CAAC;QAEnE,MAAM,IAAI,CAAC,wBAAwB,CAAC,WAAW,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC;IACzE,CAAC;CACJ,CAAA;oCArBY,yBAAyB;IADrC,IAAA,qBAAU,GAAE;IAQJ,WAAA,IAAA,iBAAM,EAAC,iDAAuB,CAAC,wBAAwB,CAAC,CAAA;IACxD,WAAA,IAAA,iBAAM,EAAC,iDAAuB,CAAC,sBAAsB,CAAC,CAAA;qCADqC,mDAAwB;QAClC,mCAAsB;GARnG,yBAAyB,CAqBrC"}
@@ -1,12 +1,12 @@
1
1
  import { GtfsStopParser } from "../../../../../../../helpers/GtfsStopParser";
2
2
  import { IStopCisDto } from "../../../../../../../schema-definitions/ropid-gtfs/interfaces/IStopCisDto";
3
- import { IAwsNodeIdGtfsStopIdDto } from "../../../../../../../schema-definitions/ropid-gtfs/interfaces/IStopDto";
3
+ import { IStopsCacheDto } from "../../../../../../../schema-definitions/ropid-gtfs/interfaces/IStopDto";
4
4
  import { RedisModel } from "@golemio/core/dist/integration-engine";
5
5
  export declare class GtfsStopsRedisRepository extends RedisModel {
6
6
  private gtfsStopParser;
7
7
  static NAMESPACE_PREFIX: string;
8
8
  constructor(gtfsStopParser: GtfsStopParser);
9
- refreshData(cisStops: Array<Pick<IStopCisDto, "id" | "cis">>, gtfsStops: IAwsNodeIdGtfsStopIdDto[]): Promise<void>;
9
+ refreshData(cisStops: Array<Pick<IStopCisDto, "id" | "cis">>, gtfsStops: IStopsCacheDto[]): Promise<void>;
10
10
  private createNewCache;
11
11
  private deleteOldCache;
12
12
  }
@@ -47,7 +47,9 @@ let GtfsStopsRedisRepository = exports.GtfsStopsRedisRepository = GtfsStopsRedis
47
47
  cisToAswNode.set(stop.cis, this.gtfsStopParser.getAswNodeFromId(stop.id));
48
48
  }
49
49
  const aswNodeToGtfsStops = new Map();
50
+ const staticData = new Map();
50
51
  for (const stop of gtfsStops) {
52
+ staticData.set(stop.computed_cis_stop_id, JSON.stringify(stop));
51
53
  const nodeStopIds = aswNodeToGtfsStops.get(stop.asw_node_id) ?? [];
52
54
  if (nodeStopIds.length === 0) {
53
55
  aswNodeToGtfsStops.set(stop.asw_node_id, nodeStopIds);
@@ -56,6 +58,7 @@ let GtfsStopsRedisRepository = exports.GtfsStopsRedisRepository = GtfsStopsRedis
56
58
  }
57
59
  const setName = (0, node_crypto_1.randomBytes)(4).toString("hex");
58
60
  const pipeline = this.connection.pipeline();
61
+ pipeline.hset(`${this.prefix}:${setName}:staticData`, staticData);
59
62
  pipeline.hset(`${this.prefix}:${setName}:aswNodeToGtfsStops`, aswNodeToGtfsStops);
60
63
  pipeline.hset(`${this.prefix}:${setName}:cisToAswNode`, cisToAswNode);
61
64
  pipeline.publish(`${this.prefix}`, `${this.prefix}:${setName}`);
@@ -71,6 +74,7 @@ let GtfsStopsRedisRepository = exports.GtfsStopsRedisRepository = GtfsStopsRedis
71
74
  const pipeline = this.connection.pipeline();
72
75
  pipeline.expire(`${setName}:aswNodeToGtfsStops`, TTL_SECONDS_BEFORE_DELETE);
73
76
  pipeline.expire(`${setName}:cisToAswNode`, TTL_SECONDS_BEFORE_DELETE);
77
+ pipeline.expire(`${setName}:staticData`, TTL_SECONDS_BEFORE_DELETE);
74
78
  await pipeline.exec();
75
79
  }
76
80
  catch (err) {
@@ -1 +1 @@
1
- {"version":3,"file":"GtfsStopsRedisRepository.js","sourceRoot":"","sources":["../../../../../../../../src/integration-engine/ropid-gtfs/workers/timetables/tasks/data-access/cache/GtfsStopsRedisRepository.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gFAAyD;AACzD,wFAAqF;AAGrF,0FAA0E;AAC1E,8EAAmE;AACnE,6EAAwE;AACxE,iEAAwE;AACxE,6CAA0C;AAE1C,MAAM,yBAAyB,GAAG,EAAE,CAAC;AAG9B,IAAM,wBAAwB,mEAA9B,MAAM,wBAAyB,SAAQ,+BAAU;IAGpD,YAAoE,cAA8B;QAC9F,KAAK,CAAC,0BAA0B,EAAE;YAC9B,wBAAwB,EAAE,KAAK;YAC/B,MAAM,EAAE,0BAAwB,CAAC,gBAAgB;SACpD,CAAC,CAAC;QAJ6D,mBAAc,GAAd,cAAc,CAAgB;IAKlG,CAAC;IAEM,KAAK,CAAC,WAAW,CACpB,QAAgD,EAChD,SAAoC;QAEpC,IAAI;YACA,MAAM,UAAU,GAAG,CAAC,MAAM,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,MAAM,gBAAgB,CAAC,CAAC,IAAI,EAAE,CAAC;YACrF,MAAM,IAAI,CAAC,cAAc,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC;YAC/C,MAAM,IAAI,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC;SACzC;QAAC,OAAO,GAAG,EAAE;YACV,MAAM,IAAI,6BAAY,CAAC,oBAAoB,EAAE,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;SAC5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,gBAAgB,EAAE,GAAG,IAAI,CAAC,MAAM,IAAI,OAAO,EAAE,CAAC,CAAC;YAC1E,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;SACzB;QAAC,OAAO,GAAG,EAAE;YACV,MAAM,IAAI,6BAAY,CAAC,uBAAuB,EAAE,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;SAC/E;IACL,CAAC;IAEO,KAAK,CAAC,cAAc,CAAC,OAAe;QACxC,IAAI;YACA,MAAM,QAAQ,GAAG,IAAI,CAAC,UAAU,CAAC,QAAQ,EAAE,CAAC;YAC5C,QAAQ,CAAC,MAAM,CAAC,GAAG,OAAO,qBAAqB,EAAE,yBAAyB,CAAC,CAAC;YAC5E,QAAQ,CAAC,MAAM,CAAC,GAAG,OAAO,eAAe,EAAE,yBAAyB,CAAC,CAAC;YACtE,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;SACzB;QAAC,OAAO,GAAG,EAAE;YACV,MAAM,IAAI,6BAAY,CAAC,uBAAuB,EAAE,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;SAC/E;IACL,CAAC;;AA9Da,yCAAgB,GAAG,mCAA2B,AAA9B,CAA+B;mCADpD,wBAAwB;IADpC,IAAA,qBAAU,GAAE;IAII,WAAA,IAAA,iBAAM,EAAC,iDAAuB,CAAC,cAAc,CAAC,CAAA;qCAAyB,+BAAc;GAHzF,wBAAwB,CAgEpC"}
1
+ {"version":3,"file":"GtfsStopsRedisRepository.js","sourceRoot":"","sources":["../../../../../../../../src/integration-engine/ropid-gtfs/workers/timetables/tasks/data-access/cache/GtfsStopsRedisRepository.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gFAAyD;AACzD,wFAAqF;AAGrF,0FAA0E;AAC1E,8EAAmE;AACnE,6EAAwE;AACxE,iEAAwE;AACxE,6CAA0C;AAE1C,MAAM,yBAAyB,GAAG,EAAE,CAAC;AAG9B,IAAM,wBAA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Ae;QACxC,IAAI;YACA,MAAM,QAAQ,GAAG,IAAI,CAAC,UAAU,CAAC,QAAQ,EAAE,CAAC;YAC5C,QAAQ,CAAC,MAAM,CAAC,GAAG,OAAO,qBAAqB,EAAE,yBAAyB,CAAC,CAAC;YAC5E,QAAQ,CAAC,MAAM,CAAC,GAAG,OAAO,eAAe,EAAE,yBAAyB,CAAC,CAAC;YACtE,QAAQ,CAAC,MAAM,CAAC,GAAG,OAAO,aAAa,EAAE,yBAAyB,CAAC,CAAC;YACpE,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;SACzB;QAAC,OAAO,GAAG,EAAE;YACV,MAAM,IAAI,6BAAY,CAAC,uBAAuB,EAAE,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;SAC/E;IACL,CAAC;;AA7Da,yCAAgB,GAAG,mCAA2B,AAA9B,CAA+B;mCADpD,wBAAwB;IADpC,IAAA,qBAAU,GAAE;IAII,WAAA,IAAA,iBAAM,EAAC,iDAAuB,CAAC,cAAc,CAAC,CAAA;qCAAyB,+BAAc;GAHzF,wBAAwB,CA+DpC"}
@@ -12,7 +12,7 @@ class AlertsGenerator {
12
12
  this.vymiEventsRepository = vymiEventsRepository;
13
13
  this.alertsTransformation = new AlertsTransformation_1.AlertsTransformation(vymiRoutesRepository);
14
14
  this.jisEventsTransformation = new JISEventsGtfsRtTransformation_1.JISEventsGtfsRtTransformation();
15
- this.jisAllowedOrgs = this.config.getValue("module.pid.jis.events.gtfsRtAllowedOrgs.*");
15
+ this.jisAllowedOrgs = this.config.getValue("module.pid.jis.gtfsRt.events.allowedOrgs.*");
16
16
  }
17
17
  async generateAlerts(feedHeader) {
18
18
  const alertsMessage = ovapi_gtfs_realtime_bindings_1.transit_realtime.FeedMessage.create({ header: feedHeader });
@@ -1 +1 @@
1
- {"version":3,"file":"AlertsGenerator.js","sourceRoot":"","sources":["../../../../../../src/integration-engine/vehicle-positions/workers/gtfs-rt/helpers/AlertsGenerator.ts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,GAAG,uBAAuB,EAAE,GAAG,iBAAiB,CAAC,CAAC;QACxE,KAAK,MAAM,KAAK,IAAI,YAAY,EAAE;YAC9B,MAAM,UAAU,GAAG,+CAAY,CAAC,UAAU,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;YAC7D,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;SACzC;QAED,IAAI,+CAAY,CAAC,WAAW,CAAC,MAAM,CAAC,aAAa,CAAC,KAAK,IAAI,EAAE;YACzD,MAAM,MAAM,GAAG,+CAAY,CAAC,WAAW,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,MAAM,EAAY,CAAC;YAEjF,MAAM,IAAI,CAAC,qBAAqB,CAAC,GAAG,CAAC,QAAQ,GAAG,YAAY,EAAE,aAAa,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;YAC9F,MAAM,IAAI,CAAC,qBAAqB,CAAC,IAAI,CAAC,WAAW,EAAE,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC;SACjF;IACL,CAAC;CACJ;AA3CD,0CA2CC"}
1
+ {"version":3,"file":"AlertsGenerator.js","sourceRoot":"","sources":["../../../../../../src/integration-engine/vehicle-positions/workers/gtfs-rt/helpers/AlertsGenerator.ts"],"names":[],"mappings":";;;AACA,iHAAsG;AAGtG,wFAAyF;AAGzF,kFAA+E;AAE/E,MAAa,eAAe;IAKxB,YACqB,MAAqB,EACrB,qBAA4C,EAC5C,mBAAwC,EACxC,oBAA0C,EAC3D,oBAAgD;QAJ/B,WAAM,GAAN,MAAM,CAAe;QACrB,0BAAqB,GAArB,qBAAqB,CAAuB;QAC5C,wBAAmB,GAAnB,mBAAmB,CAAqB;QACxC,yBAAoB,GAApB,oBAAoB,CAAsB;QAG3D,IAAI,CAAC,oBAAoB,GAAG,IAAI,2CAAoB,CAAC,oBAAoB,CAAC,CAAC;QAC3E,IAAI,CAAC,uBAAuB,GAAG,IAAI,6DAA6B,EAAE,CAAC;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BAAqB,CAAC,GAAG,CAAC,QAAQ,GAAG,YAAY,EAAE,aAAa,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;YAC9F,MAAM,IAAI,CAAC,qBAAqB,CAAC,IAAI,CAAC,WAAW,EAAE,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC;SACjF;IACL,CAAC;CACJ;AA3CD,0CA2CC"}
@@ -1,36 +1,5 @@
1
- import { IJISTranslationText } from "../../../schema-definitions/jis/models/interfaces";
2
1
  import { JISEventsModel } from "../../../schema-definitions/jis/models/JISEventsModel";
3
2
  export interface IJISEventCustomFormatInputDto {
4
3
  data: JISEventsModel;
5
4
  timezone: string;
6
5
  }
7
- export interface IJISEventCustomFormatDto {
8
- id: string;
9
- type: string;
10
- header_text: IJISTranslationText;
11
- cause: IJISTranslationText;
12
- cause_detail: IJISTranslationText;
13
- severity_level: string;
14
- active_period: {
15
- start: string;
16
- end?: string | null;
17
- };
18
- display_period: {
19
- start: string;
20
- end?: string | null;
21
- };
22
- effects: IJISTranslationText[];
23
- description_text: IJISTranslationText;
24
- description_html: IJISTranslationText;
25
- organization_name: string;
26
- informed_entity?: {
27
- routes?: Array<{
28
- id: string;
29
- route_short_name: string;
30
- route_long_name: string;
31
- route_type: number;
32
- }>;
33
- } | null;
34
- last_modified_timestamp: string;
35
- created_timestamp: string;
36
- }
@@ -5,9 +5,8 @@ const ioc_1 = require("@golemio/core/dist/output-gateway/ioc");
5
5
  const V1EventsController_1 = require("../controllers/v1/V1EventsController");
6
6
  const JISEventsRepository_1 = require("../data-access/JISEventsRepository");
7
7
  const JISEventsRopidGTFSRoutesRepository_1 = require("../data-access/JISEventsRopidGTFSRoutesRepository");
8
- const JISEventsCustomFormatTransformation_1 = require("../transformations/JISEventsCustomFormatTransformation");
9
- const TranslationHelper_1 = require("../helpers/TranslationHelper");
10
8
  const RopidGTFSRoutesRepository_1 = require("../data-access/RopidGTFSRoutesRepository");
9
+ const JISEventsCustomFormatTransformation_1 = require("../transformations/JISEventsCustomFormatTransformation");
11
10
  const OgJisToken_1 = require("./OgJisToken");
12
11
  const ogJisContainer = ioc_1.OutputGatewayContainer.createChildContainer();
13
12
  exports.OgJisContainer = ogJisContainer;
@@ -21,7 +20,4 @@ ogJisContainer.registerSingleton(OgJisToken_1.OgJisToken.RopidGTFSRoutesReposito
21
20
  //#endregion
22
21
  //#region Transformations
23
22
  ogJisContainer.registerSingleton(OgJisToken_1.OgJisToken.JISEventsCustomFormatTransformation, JISEventsCustomFormatTransformation_1.JISEventsCustomFormatTransformation);
24
- //#endregion
25
- //#region Helpers
26
- ogJisContainer.registerSingleton(OgJisToken_1.OgJisToken.TranslationHelper, TranslationHelper_1.TranslationHelper);
27
23
  //# sourceMappingURL=Di.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Di.js","sourceRoot":"","sources":["../../../../src/output-gateway/jis/ioc/Di.ts"],"names":[],"mappings":";;;AAAA,+DAA+E;AAE/E,6EAA0E;AAC1E,4EAAyE;AACzE,0GAAuG;AACvG,gHAA6G;AAC7G,oEAAiE;AACjE,wFAAqF;AACrF,6CAA0C;AAC1C,MAAM,cAAc,GAAwB,4BAAsB,CAAC,oBAAoB,EAAE,CAAC;AAoB/D,wCAAc;AAlBzC,qBAAqB;AACrB,cAAc,CAAC,iBAAiB,CAAC,uBAAU,CAAC,kBAAkB,EAAE,uCAAkB,CAAC,CAAC;AACpF,YAAY;AAEZ,sBAAsB;AACtB,cAAc,CAAC,iBAAiB,CAAC,uBAAU,CAAC,mBAAmB,EAAE,yCAAmB,CAAC,CAAC;AACtF,cAAc,CAAC,iBAAiB,CAAC,uBAAU,CAAC,kCAAkC,EAAE,uEAAkC,CAAC,CAAC;AACpH,cAAc,CAAC,iBAAiB,CAAC,uBAAU,CAAC,yBAAyB,EAAE,qDAAyB,CAAC,CAAC;AAClG,YAAY;AAEZ,yBAAyB;AACzB,cAAc,CAAC,iBAAiB,CAAC,uBAAU,CAAC,mCAAmC,EAAE,yEAAmC,CAAC,CAAC;AACtH,YAAY;AAEZ,iBAAiB;AACjB,cAAc,CAAC,iBAAiB,CAAC,uBAAU,CAAC,iBAAiB,EAAE,qCAAiB,CAAC,CAAC"}
1
+ {"version":3,"file":"Di.js","sourceRoot":"","sources":["../../../../src/output-gateway/jis/ioc/Di.ts"],"names":[],"mappings":";;;AAAA,+DAA+E;AAE/E,6EAA0E;AAC1E,4EAAyE;AACzE,0GAAuG;AACvG,wFAAqF;AACrF,gHAA6G;AAC7G,6CAA0C;AAE1C,MAAM,cAAc,GAAwB,4BAAsB,CAAC,oBAAoB,EAAE,CAAC;AAgB/D,wCAAc;AAdzC,qBAAqB;AACrB,cAAc,CAAC,iBAAiB,CAAC,uBAAU,CAAC,kBAAkB,EAAE,uCAAkB,CAAC,CAAC;AACpF,YAAY;AAEZ,sBAAsB;AACtB,cAAc,CAAC,iBAAiB,CAAC,uBAAU,CAAC,mBAAmB,EAAE,yCAAmB,CAAC,CAAC;AACtF,cAAc,CAAC,iBAAiB,CAAC,uBAAU,CAAC,kCAAkC,EAAE,uEAAkC,CAAC,CAAC;AACpH,cAAc,CAAC,iBAAiB,CAAC,uBAAU,CAAC,yBAAyB,EAAE,qDAAyB,CAAC,CAAC;AAClG,YAAY;AAEZ,yBAAyB;AACzB,cAAc,CAAC,iBAAiB,CAAC,uBAAU,CAAC,mCAAmC,EAAE,yEAAmC,CAAC,CAAC"}
@@ -5,6 +5,5 @@ export declare const OgJisToken: {
5
5
  JISInfotextsRedisRepository: symbol;
6
6
  RopidGTFSRoutesRepository: symbol;
7
7
  JISEventsCustomFormatTransformation: symbol;
8
- TranslationHelper: symbol;
9
8
  VPSubscriber: symbol;
10
9
  };
@@ -15,7 +15,6 @@ exports.OgJisToken = {
15
15
  JISEventsCustomFormatTransformation: Symbol("JISEventsCustomFormatTransformation"),
16
16
  //#endregion
17
17
  //#region Helpers
18
- TranslationHelper: Symbol("TranslationHelper"),
19
18
  VPSubscriber: Symbol("VPSubscriber"),
20
19
  //#endregion
21
20
  };
@@ -1 +1 @@
1
- {"version":3,"file":"OgJisToken.js","sourceRoot":"","sources":["../../../../src/output-gateway/jis/ioc/OgJisToken.ts"],"names":[],"mappings":";;;AAAa,QAAA,UAAU,GAAG;IACtB,qBAAqB;IACrB,kBAAkB,EAAE,MAAM,CAAC,oBAAoB,CAAC;IAChD,YAAY;IAEZ,sBAAsB;IACtB,mBAAmB,EAAE,MAAM,CAAC,qBAAqB,CAAC;IAClD,kCAAkC,EAAE,MAAM,CAAC,oCAAoC,CAAC;IAChF,2BAA2B,EAAE,MAAM,CAAC,6BAA6B,CAAC;IAClE,yBAAyB,EAAE,MAAM,CAAC,2BAA2B,CAAC;IAC9D,YAAY;IAEZ,yBAAyB;IACzB,mCAAmC,EAAE,MAAM,CAAC,qCAAqC,CAAC;IAClF,YAAY;IAEZ,iBAAiB;IACjB,iBAAiB,EAAE,MAAM,CAAC,mBAAmB,CAAC;IAC9C,YAAY,EAAE,MAAM,CAAC,cAAc,CAAC;IACpC,YAAY;CACf,CAAC"}
1
+ {"version":3,"file":"OgJisToken.js","sourceRoot":"","sources":["../../../../src/output-gateway/jis/ioc/OgJisToken.ts"],"names":[],"mappings":";;;AAAa,QAAA,UAAU,GAAG;IACtB,qBAAqB;IACrB,kBAAkB,EAAE,MAAM,CAAC,oBAAoB,CAAC;IAChD,YAAY;IAEZ,sBAAsB;IACtB,mBAAmB,EAAE,MAAM,CAAC,qBAAqB,CAAC;IAClD,kCAAkC,EAAE,MAAM,CAAC,oCAAoC,CAAC;IAChF,2BAA2B,EAAE,MAAM,CAAC,6BAA6B,CAAC;IAClE,yBAAyB,EAAE,MAAM,CAAC,2BAA2B,CAAC;IAC9D,YAAY;IAEZ,yBAAyB;IACzB,mCAAmC,EAAE,MAAM,CAAC,qCAAqC,CAAC;IAClF,YAAY;IAEZ,iBAAiB;IACjB,YAAY,EAAE,MAAM,CAAC,cAAc,CAAC;IACpC,YAAY;CACf,CAAC"}
@@ -1,10 +1,7 @@
1
- import { AbstractTransformation } from "@golemio/core/dist/helpers/transformation/AbstractTransformation";
2
- import { IJISEventCustomFormatDto } from "../domain/IJISEventsInterfaces";
1
+ import { IJISEventCustomFormatDto } from "../../../helpers/jis/interfaces/IJISEventCustomFormatDto";
3
2
  import { JISEventsModel } from "../../../schema-definitions/jis/models/JISEventsModel";
4
- import { TranslationHelper } from "../helpers/TranslationHelper";
3
+ import { AbstractTransformation } from "@golemio/core/dist/helpers/transformation/AbstractTransformation";
5
4
  export declare class JISEventsCustomFormatTransformation extends AbstractTransformation<JISEventsModel, IJISEventCustomFormatDto> {
6
- private translationHelper;
7
- constructor(translationHelper: TranslationHelper);
8
5
  name: string;
9
6
  protected transformInternal: (event: JISEventsModel) => IJISEventCustomFormatDto;
10
7
  }
@@ -5,22 +5,14 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
5
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
6
  return c > 3 && r && Object.defineProperty(target, key, r), r;
7
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
8
  Object.defineProperty(exports, "__esModule", { value: true });
15
9
  exports.JISEventsCustomFormatTransformation = void 0;
16
10
  const AbstractTransformation_1 = require("@golemio/core/dist/helpers/transformation/AbstractTransformation");
17
11
  const tsyringe_1 = require("@golemio/core/dist/shared/tsyringe");
18
- const TranslationHelper_1 = require("../helpers/TranslationHelper");
19
- const OgJisToken_1 = require("../ioc/OgJisToken");
12
+ const JISEventTranslationHelper_1 = require("../../../helpers/jis/JISEventTranslationHelper");
20
13
  let JISEventsCustomFormatTransformation = exports.JISEventsCustomFormatTransformation = class JISEventsCustomFormatTransformation extends AbstractTransformation_1.AbstractTransformation {
21
- constructor(translationHelper) {
22
- super();
23
- this.translationHelper = translationHelper;
14
+ constructor() {
15
+ super(...arguments);
24
16
  this.name = "JISEventsCustomFormatTransformation";
25
17
  this.transformInternal = (event) => {
26
18
  return {
@@ -28,7 +20,7 @@ let JISEventsCustomFormatTransformation = exports.JISEventsCustomFormatTransform
28
20
  type: event.type,
29
21
  header_text: event.header_text,
30
22
  cause: {
31
- cs: this.translationHelper.causeToCs(event.cause),
23
+ cs: JISEventTranslationHelper_1.JISEventTranslationHelper.causeToCs(event.cause),
32
24
  en: event.cause.charAt(0).toUpperCase() + event.cause.slice(1).toLowerCase().replaceAll("_", " "),
33
25
  },
34
26
  cause_detail: event.cause_detail,
@@ -43,7 +35,7 @@ let JISEventsCustomFormatTransformation = exports.JISEventsCustomFormatTransform
43
35
  },
44
36
  effects: [
45
37
  {
46
- cs: this.translationHelper.effectToCs(event.effect),
38
+ cs: JISEventTranslationHelper_1.JISEventTranslationHelper.effectToCs(event.effect),
47
39
  en: event.effect.charAt(0).toUpperCase() + event.effect.slice(1).toLowerCase().replaceAll("_", " "),
48
40
  },
49
41
  ],
@@ -65,8 +57,6 @@ let JISEventsCustomFormatTransformation = exports.JISEventsCustomFormatTransform
65
57
  }
66
58
  };
67
59
  exports.JISEventsCustomFormatTransformation = JISEventsCustomFormatTransformation = __decorate([
68
- (0, tsyringe_1.injectable)(),
69
- __param(0, (0, tsyringe_1.inject)(OgJisToken_1.OgJisToken.TranslationHelper)),
70
- __metadata("design:paramtypes", [TranslationHelper_1.TranslationHelper])
60
+ (0, tsyringe_1.injectable)()
71
61
  ], JISEventsCustomFormatTransformation);
72
62
  //# sourceMappingURL=JISEventsCustomFormatTransformation.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"JISEventsCustomFormatTransformation.js","sourceRoot":"","sources":["../../../../src/output-gateway/jis/transformations/JISEventsCustomFormatTransformation.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,6GAA0G;AAC1G,iEAAwE;AAGxE,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AC,CAAC,WAAW,EAAE,GAAG,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,UAAU,CAAC,GAAG,EAAE,GAAG,CAAC;qBACtG;iBACJ;gBACD,gBAAgB,EAAE,KAAK,CAAC,gBAAgB;gBACxC,gBAAgB,EAAE,KAAK,CAAC,gBAAgB;gBACxC,iBAAiB,EAAE,KAAK,CAAC,iBAAiB;gBAC1C,eAAe,EAAE;oBACb,MAAM,EACF,KAAK,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;wBAC1B,EAAE,EAAE,KAAK,CAAC,QAAQ;wBAClB,gBAAgB,EAAE,KAAK,CAAC,gBAAgB;wBACxC,eAAe,EAAE,KAAK,CAAC,eAAe;wBACtC,UAAU,EAAE,KAAK,CAAC,UAAU;qBAC/B,CAAC,CAAC,IAAI,EAAE;iBAChB;gBACD,uBAAuB,EAAE,KAAK,CAAC,iBAAiB,CAAC,WAAW,EAAE;gBAC9D,iBAAiB,EAAE,KAAK,CAAC,iBAAiB,CAAC,WAAW,EAAE;aAC3D,CAAC;QACN,CAAC,CAAC;IA5CF,CAAC;CA6CJ,CAAA;8CAhDY,mCAAmC;IAD/C,IAAA,qBAAU,GAAE;IAEI,WAAA,IAAA,iBAAM,EAAC,uBAAU,CAAC,iBAAiB,CAAC,CAAA;qCAA4B,qCAAiB;GADrF,mCAAmC,CAgD/C"}
1
+ {"version":3,"file":"JISEventsCustomFormatTransformation.js","sourceRoot":"","sources":["../../../../src/output-gateway/jis/transformations/JISEventsCustomFormatTransformation.ts"],"names":[],"mappings":";;;;;;;;;AAEA,6GAA0G;AAC1G,iEAAgE;AAChE,8FAA2F;AAGpF,IAAM,mCAAmC,iDAAzC,MAAM,mCAAoC,SAAQ,+CAAgE;IAAlH;;QACI,SAAI,GAAG,qCAAqC,CAAC;QAE1C,sBAAiB,GAAG,CAAC,KAAqB,EAA4B,EAAE;YAC9E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1C,eAAe,EAAE;oBACb,MAAM,EACF,KAAK,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;wBAC1B,EAAE,EAAE,KAAK,CAAC,QAAQ;wBAClB,gBAAgB,EAAE,KAAK,CAAC,gBAAgB;wBACxC,eAAe,EAAE,KAAK,CAAC,eAAe;wBACtC,UAAU,EAAE,KAAK,CAAC,UAAU;qBAC/B,CAAC,CAAC,IAAI,EAAE;iBAChB;gBACD,uBAAuB,EAAE,KAAK,CAAC,iBAAiB,CAAC,WAAW,EAAE;gBAC9D,iBAAiB,EAAE,KAAK,CAAC,iBAAiB,CAAC,WAAW,EAAE;aAC3D,CAAC;QACN,CAAC,CAAC;IACN,CAAC;CAAA,CAAA;8CA5CY,mCAAmC;IAD/C,IAAA,qBAAU,GAAE;GACA,mCAAmC,CA4C/C"}
@@ -0,0 +1,2 @@
1
+ export declare const jisEventType: readonly ["INCIDENT", "DISRUPTION", "SERVICE_CHANGE"];
2
+ export type IJISEventType = (typeof jisEventType)[number];
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.jisEventType = void 0;
4
+ exports.jisEventType = ["INCIDENT", "DISRUPTION", "SERVICE_CHANGE"];
5
+ //# sourceMappingURL=jisEventType.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jisEventType.js","sourceRoot":"","sources":["../../../../src/schema-definitions/jis/constants/jisEventType.ts"],"names":[],"mappings":";;;AAAa,QAAA,YAAY,GAAG,CAAC,UAAU,EAAE,YAAY,EAAE,gBAAgB,CAAU,CAAC"}
@@ -4,13 +4,14 @@ exports.jisEventsJsonSchema = void 0;
4
4
  const JISEventSeverityLevelEnum_1 = require("../../../helpers/jis/JISEventSeverityLevelEnum");
5
5
  const jisEventCause_1 = require("../constants/jisEventCause");
6
6
  const jisEventEffect_1 = require("../constants/jisEventEffect");
7
+ const jisEventType_1 = require("../constants/jisEventType");
7
8
  exports.jisEventsJsonSchema = {
8
9
  type: "array",
9
10
  items: {
10
11
  type: "object",
11
12
  properties: {
12
13
  id: { type: "string" },
13
- type: { type: "string", enum: ["INCIDENT", "DISRUPTION", "SERVICE_CHANGE"] },
14
+ type: { type: "string", enum: jisEventType_1.jisEventType },
14
15
  header_text: { $ref: "#/definitions/Translation" },
15
16
  cause: { type: "string", enum: jisEventCause_1.jisEventCause },
16
17
  cause_detail: { $ref: "#/definitions/Translation" },
@@ -1 +1 @@
1
- {"version":3,"file":"JISEventsJsonSchema.js","sourceRoot":"","sources":["../../../../src/schema-definitions/jis/datasources/JISEventsJsonSchema.ts"],"names":[],"mappings":";;;AAAA,8FAA+E;AAE/E,8DAA2D;AAC3D,gEAA6D;AAGhD,QAAA,mBAAmB,GAAgC;IAC5D,IAAI,EAAE,OAAO;IACb,KAAK,EAAE;QACH,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACR,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;YACtB,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,UAAU,EAAE,YAAY,EAAE,gBAAgB,CAAC,EAAE;YAC5E,WAAW,EAAE,EAAE,IAAI,EAAE,2BAA2B,EAAE;YAClD,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,6BAAa,EAAE;YAC9C,YAAY,EAAE,EAAE,IAAI,EAAE,2BAA2B,EAAE;YACnD,cAAc,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC,iDAAqB,CAAC,EAAE;YAC9E,aAAa,EAAE;gBACX,IAAI,EAAE,QAAQ;gBACd,UAAU,EAAE;oBACR,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,WAAW,EAAE;oBAC9C,GAAG,EAAE;wBACD,KAAK,EAAE;4BACH,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EA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AC;yBACnB;qBACJ;iBACJ;gBACD,oBAAoB,EAAE,KAAK;aAC9B;YACD,iBAAiB,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,WAAW,EAAE;YAC1D,uBAAuB,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,WAAW,EAAE;SACnE;QACD,QAAQ,EAAE;YACN,IAAI;YACJ,MAAM;YACN,aAAa;YACb,OAAO;YACP,cAAc;YACd,gBAAgB;YAChB,eAAe;YACf,gBAAgB;YAChB,QAAQ;YACR,eAAe;YACf,kBAAkB;YAClB,kBAAkB;YAClB,KAAK;YACL,mBAAmB;YACnB,mBAAmB;YACnB,yBAAyB;SAC5B;KACJ;IACD,WAAW,EAAE;QACT,WAAW,EAAE;YACT,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACR,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;gBACtB,EAAE,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,EAAE;aACxE;YACD,oBAAoB,EAAE,KAAK;YAC3B,QAAQ,EAAE,CAAC,IAAI,CAAC;SACnB;KACJ;CACJ,CAAC"}
1
+ {"version":3,"file":"JISEventsJsonSchema.js","sourceRoot":"","sources":["../../../../src/schema-definitions/jis/datasources/JISEventsJsonSchema.ts"],"names":[],"mappings":";;;AAAA,8FAA+E;AAE/E,8DAA2D;AAC3D,gEAA6D;AAE7D,4DAAyD;AAC5C,QAAA,mBAAmB,GAAgC;IAC5D,IAAI,EAAE,OAAO;IACb,KAAK,EAAE;QACH,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACR,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;YACtB,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,2BAAY,EAAE;YAC5C,WAAW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