@golemio/pid 4.1.3 → 4.1.4-dev.2044449114
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/helpers/jis/JISEventTranslationHelper.d.ts +4 -0
- package/dist/helpers/jis/JISEventTranslationHelper.js +46 -0
- package/dist/helpers/jis/JISEventTranslationHelper.js.map +1 -0
- package/dist/helpers/jis/interfaces/IJISEventCustomFormatDto.d.ts +33 -0
- package/dist/helpers/jis/interfaces/IJISEventCustomFormatDto.js +3 -0
- package/dist/helpers/jis/interfaces/IJISEventCustomFormatDto.js.map +1 -0
- package/dist/input-gateway/jis/controllers/JISEventsController.js +1 -1
- package/dist/input-gateway/jis/controllers/JISEventsController.js.map +1 -1
- package/dist/integration-engine/jis/datasources/JISEventsDataSourceFactory.js +7 -5
- package/dist/integration-engine/jis/datasources/JISEventsDataSourceFactory.js.map +1 -1
- package/dist/integration-engine/jis/datasources/JISInfotextsDataSourceFactory.js +7 -5
- package/dist/integration-engine/jis/datasources/JISInfotextsDataSourceFactory.js.map +1 -1
- package/dist/integration-engine/jis/ioc/Di.js +7 -1
- package/dist/integration-engine/jis/ioc/Di.js.map +1 -1
- package/dist/integration-engine/jis/ioc/JISContainerToken.d.ts +3 -0
- package/dist/integration-engine/jis/ioc/JISContainerToken.js +3 -0
- package/dist/integration-engine/jis/ioc/JISContainerToken.js.map +1 -1
- package/dist/integration-engine/jis/services/JISEventsDataService.d.ts +2 -1
- package/dist/integration-engine/jis/services/JISEventsDataService.js +7 -1
- package/dist/integration-engine/jis/services/JISEventsDataService.js.map +1 -1
- package/dist/integration-engine/jis/transformations/UpdateEventWebhookTransformation.d.ts +13 -0
- package/dist/integration-engine/jis/transformations/UpdateEventWebhookTransformation.js +62 -0
- package/dist/integration-engine/jis/transformations/UpdateEventWebhookTransformation.js.map +1 -0
- package/dist/integration-engine/jis/workers/JISWorker.js +1 -0
- package/dist/integration-engine/jis/workers/JISWorker.js.map +1 -1
- package/dist/integration-engine/jis/workers/tasks/AbstractFetchJISResourceTask.d.ts +1 -0
- package/dist/integration-engine/jis/workers/tasks/AbstractFetchJISResourceTask.js +1 -1
- package/dist/integration-engine/jis/workers/tasks/AbstractFetchJISResourceTask.js.map +1 -1
- package/dist/integration-engine/jis/workers/tasks/FetchJISEventsTask.d.ts +1 -0
- package/dist/integration-engine/jis/workers/tasks/FetchJISEventsTask.js +2 -0
- package/dist/integration-engine/jis/workers/tasks/FetchJISEventsTask.js.map +1 -1
- package/dist/integration-engine/jis/workers/tasks/FetchJISInfotextsTask.d.ts +1 -0
- package/dist/integration-engine/jis/workers/tasks/FetchJISInfotextsTask.js +2 -0
- package/dist/integration-engine/jis/workers/tasks/FetchJISInfotextsTask.js.map +1 -1
- package/dist/integration-engine/jis/workers/tasks/RefreshJISEventsTask.d.ts +9 -2
- package/dist/integration-engine/jis/workers/tasks/RefreshJISEventsTask.js +28 -3
- package/dist/integration-engine/jis/workers/tasks/RefreshJISEventsTask.js.map +1 -1
- package/dist/integration-engine/jis/workers/tasks/UpdateEventWebhookTask.d.ts +21 -0
- package/dist/integration-engine/jis/workers/tasks/UpdateEventWebhookTask.js +132 -0
- package/dist/integration-engine/jis/workers/tasks/UpdateEventWebhookTask.js.map +1 -0
- package/dist/integration-engine/vehicle-positions/workers/gtfs-rt/helpers/AlertsGenerator.js +1 -1
- package/dist/integration-engine/vehicle-positions/workers/gtfs-rt/helpers/AlertsGenerator.js.map +1 -1
- package/dist/output-gateway/jis/domain/IJISEventsInterfaces.d.ts +0 -31
- package/dist/output-gateway/jis/ioc/Di.js +1 -5
- package/dist/output-gateway/jis/ioc/Di.js.map +1 -1
- package/dist/output-gateway/jis/ioc/OgJisToken.d.ts +0 -1
- package/dist/output-gateway/jis/ioc/OgJisToken.js +0 -1
- package/dist/output-gateway/jis/ioc/OgJisToken.js.map +1 -1
- package/dist/output-gateway/jis/transformations/JISEventsCustomFormatTransformation.d.ts +2 -5
- package/dist/output-gateway/jis/transformations/JISEventsCustomFormatTransformation.js +6 -16
- package/dist/output-gateway/jis/transformations/JISEventsCustomFormatTransformation.js.map +1 -1
- package/dist/schema-definitions/jis/constants/jisEventType.d.ts +2 -0
- package/dist/schema-definitions/jis/constants/jisEventType.js +5 -0
- package/dist/schema-definitions/jis/constants/jisEventType.js.map +1 -0
- package/dist/schema-definitions/jis/datasources/JISEventsJsonSchema.js +2 -1
- package/dist/schema-definitions/jis/datasources/JISEventsJsonSchema.js.map +1 -1
- package/dist/schema-definitions/jis/datasources/interfaces/IJISEvent.d.ts +2 -1
- package/dist/schema-definitions/jis/models/JISEventsModel.js +2 -1
- package/dist/schema-definitions/jis/models/JISEventsModel.js.map +1 -1
- package/docs/asyncapi.yaml +33 -5
- package/docs/implementation_documentation.md +55 -8
- package/package.json +2 -2
- package/dist/output-gateway/jis/helpers/TranslationHelper.d.ts +0 -4
- package/dist/output-gateway/jis/helpers/TranslationHelper.js +0 -48
- 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",
|
|
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(
|
|
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,+
|
|
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,EAAE,QAAQ;YACd,UAAU,EAAE;gBACR,IAAI,EAAE,yCAAmB;gBACzB,qBAAqB,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;aAC7C;YACD,QAAQ,EAAE,CAAC,MAAM,CAAC;YAClB,WAAW,EAAE;gBACT,WAAW,EAAE;oBACT,IAAI,EAAE,QAAQ;oBACd,UAAU,EAAE;wBACR,EAAE,E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AE;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,4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5D,MAAM,MAAM,GAKP,EAAE,CAAC;YACR,KAAK,MAAM,CAAC,IAAI,KAAK,CAAC,eAAe,EAAE,MAAM,IAAI,EAAE,EAAE;gBACjD,MAAM,SAAS,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;gBACrC,IAAI,SAAS,EAAE;oBACX,MAAM,CAAC,IAAI,CAAC;wBACR,QAAQ,EAAE,SAAS,CAAC,QAAQ;wBAC5B,gBAAgB,EAAE,SAAS,CAAC,gBAAgB;wBAC5C,eAAe,EAAE,SAAS,CAAC,eAAe;wBAC1C,UAAU,EAAE,SAAS,CAAC,UAAU;qBACnC,CAAC,CAAC;iBACN;aACJ;YACD,OAAO,IAAI,CAAC,cAAc,CAAC,gBAAgB,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC;QACnE,CAAC,CAAC,CAAC;QACH,OAAO,MAAM,CAAC;IAClB,CAAC;CACJ,CAAA;iCAhIY,sBAAsB;IADlC,IAAA,qBAAU,GAAE;IAeJ,WAAA,IAAA,iBAAM,EAAC,qBAAS,CAAC,YAAY,CAAC,CAAA;IAC9B,WAAA,IAAA,iBAAM,EAAC,qCAAiB,CAAC,gCAAgC,CAAC,CAAA;IAE1D,WAAA,IAAA,iBAAM,EAAC,qCAAiB,CAAC,yBAAyB,CAAC,CAAA;6CADnB,mEAAgC;QACuB,qDAAyB;GAjB5G,sBAAsB,CAgIlC"}
|
package/dist/integration-engine/vehicle-positions/workers/gtfs-rt/helpers/AlertsGenerator.js
CHANGED
|
@@ -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.
|
|
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 });
|
package/dist/integration-engine/vehicle-positions/workers/gtfs-rt/helpers/AlertsGenerator.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
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;QACnE,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAW,
|
|
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;Q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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,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,
|
|
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"}
|
|
@@ -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,
|
|
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 {
|
|
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 {
|
|
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
|
|
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(
|
|
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:
|
|
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:
|
|
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":"
|
|
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,+CAA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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;IACN,CAAC;CAAA,CAAA;8CA5CY,mCAAmC;IAD/C,IAAA,qBAAU,GAAE;GACA,mCAAmC,CA4C/C"}
|
|
@@ -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:
|
|
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;
|
|
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,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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AAE,KAAK;4BAC3B,QAAQ,EAAE,CAAC,IAAI,CAAC;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,9 +1,10 @@
|
|
|
1
1
|
import { JISEventSeverityLevel } from "../../../../helpers/jis/JISEventSeverityLevelEnum";
|
|
2
|
+
import { IJISEventType } from "../../constants/jisEventType";
|
|
2
3
|
import { IJISEventRoute } from "./IJISEventRoute";
|
|
3
4
|
import { IJISTranslationText } from "./IJISTranslationText";
|
|
4
5
|
export interface IJISEvent {
|
|
5
6
|
id: string;
|
|
6
|
-
type:
|
|
7
|
+
type: IJISEventType;
|
|
7
8
|
header_text: IJISTranslationText;
|
|
8
9
|
cause: string;
|
|
9
10
|
cause_detail: IJISTranslationText;
|
|
@@ -5,6 +5,7 @@ const JISEventSeverityLevelEnum_1 = require("../../../helpers/jis/JISEventSeveri
|
|
|
5
5
|
const sequelize_1 = require("@golemio/core/dist/shared/sequelize");
|
|
6
6
|
const jisEventCause_1 = require("../constants/jisEventCause");
|
|
7
7
|
const jisEventEffect_1 = require("../constants/jisEventEffect");
|
|
8
|
+
const jisEventType_1 = require("../constants/jisEventType");
|
|
8
9
|
class JISEventsModel extends sequelize_1.Model {
|
|
9
10
|
}
|
|
10
11
|
exports.JISEventsModel = JISEventsModel;
|
|
@@ -96,7 +97,7 @@ JISEventsModel.jsonSchema = {
|
|
|
96
97
|
type: "object",
|
|
97
98
|
properties: {
|
|
98
99
|
id: { type: "string" },
|
|
99
|
-
type: { type: "string", enum:
|
|
100
|
+
type: { type: "string", enum: jisEventType_1.jisEventType },
|
|
100
101
|
header_text: { $ref: "#/definitions/Translation" },
|
|
101
102
|
cause: { type: "string", enum: jisEventCause_1.jisEventCause },
|
|
102
103
|
cause_detail: { $ref: "#/definitions/Translation" },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"JISEventsModel.js","sourceRoot":"","sources":["../../../../src/schema-definitions/jis/models/JISEventsModel.ts"],"names":[],"mappings":";;;AAAA,8FAA+E;AAG/E,mEAO6C;AAC7C,8DAA2D;AAC3D,gEAA6D;
|
|
1
|
+
{"version":3,"file":"JISEventsModel.js","sourceRoot":"","sources":["../../../../src/schema-definitions/jis/models/JISEventsModel.ts"],"names":[],"mappings":";;;AAAA,8FAA+E;AAG/E,mEAO6C;AAC7C,8DAA2D;AAC3D,gEAA6D;AAE7D,4DAAyD;AAEzD,MAAa,cACT,SAAQ,iBAA+E;;AAD3F,wCAgLC;AA5K0B,wBAAS,GAAG,YAAY,CAAC;AA0BzB,6BAAc,GAAoC;IACrE,EAAE,EAAE;QACA,UAAU,EAAE,IAAI;QAChB,SAAS,EAAE,KAAK;QAChB,IAAI,EAAE,qBAAS,CAAC,IAAI;KACvB;IAC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AAI,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"}
|
package/docs/asyncapi.yaml
CHANGED
|
@@ -35,8 +35,21 @@ channels:
|
|
|
35
35
|
queue:
|
|
36
36
|
durable: true
|
|
37
37
|
messages:
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
data:
|
|
39
|
+
payload:
|
|
40
|
+
type: object
|
|
41
|
+
properties:
|
|
42
|
+
data:
|
|
43
|
+
$ref: "#/components/schemas/JISEvent"
|
|
44
|
+
shouldTriggerWebhooks:
|
|
45
|
+
type: boolean
|
|
46
|
+
default:
|
|
47
|
+
- false
|
|
48
|
+
examples:
|
|
49
|
+
- true
|
|
50
|
+
required:
|
|
51
|
+
- data
|
|
52
|
+
|
|
40
53
|
jis.refreshJISInfotexts:
|
|
41
54
|
address: vehicle-positions.jis.refreshJISInfotexts
|
|
42
55
|
description: Refresh JIS infotexts in database
|
|
@@ -46,7 +59,7 @@ channels:
|
|
|
46
59
|
queue:
|
|
47
60
|
durable: true
|
|
48
61
|
messages:
|
|
49
|
-
|
|
62
|
+
data:
|
|
50
63
|
$ref: "#/components/messages/JISInfotexts"
|
|
51
64
|
jis.refreshJISInfotextsCache:
|
|
52
65
|
address: vehicle-positions.jis.refreshJISInfotextsCache
|
|
@@ -59,6 +72,17 @@ channels:
|
|
|
59
72
|
messages:
|
|
60
73
|
empty:
|
|
61
74
|
$ref: "#/components/messages/emptyMessage"
|
|
75
|
+
jis.updateEventWebhook:
|
|
76
|
+
description: post updated events to predefined websites
|
|
77
|
+
bindings:
|
|
78
|
+
amqp:
|
|
79
|
+
is: queue
|
|
80
|
+
queue:
|
|
81
|
+
durable: true
|
|
82
|
+
address: vehicle-positions.jis.updateEventWebhook
|
|
83
|
+
messages:
|
|
84
|
+
data:
|
|
85
|
+
$ref: "#/components/messages/JISEvents"
|
|
62
86
|
ropidgtfs.refreshPublicGtfsDepartureCache:
|
|
63
87
|
address: vehicle-positions.ropidgtfs.refreshPublicGtfsDepartureCache
|
|
64
88
|
description: Refresh PublicGtfsDepartureCache
|
|
@@ -331,6 +355,10 @@ operations:
|
|
|
331
355
|
action: "send"
|
|
332
356
|
channel:
|
|
333
357
|
$ref: "#/channels/jis.refreshJISInfotextsCache"
|
|
358
|
+
jis.updateEventWebhook:
|
|
359
|
+
action: "send"
|
|
360
|
+
channel:
|
|
361
|
+
$ref: "#/channels/jis.updateEventWebhook"
|
|
334
362
|
ropidgtfs.refreshPublicGtfsDepartureCache:
|
|
335
363
|
action: "send"
|
|
336
364
|
channel:
|
|
@@ -1797,11 +1825,11 @@ components:
|
|
|
1797
1825
|
items:
|
|
1798
1826
|
type: object
|
|
1799
1827
|
properties:
|
|
1800
|
-
|
|
1828
|
+
id:
|
|
1801
1829
|
type: string
|
|
1802
1830
|
description: Unique GTFS identifier of the affected route
|
|
1803
1831
|
required:
|
|
1804
|
-
-
|
|
1832
|
+
- id
|
|
1805
1833
|
last_modified_timestamp:
|
|
1806
1834
|
type: string
|
|
1807
1835
|
format: date-time
|