@golemio/pid 4.1.3-dev.2031964817 → 4.1.3-dev.2040558248
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/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 +1 -1
- 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
|
@@ -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,CAAC,OAAO,EAAE;YAC/B,8DAA8D;YAC9D,MAAM,cAAc,GA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/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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cAAc,CAAC,YAAY,CAAC,CAAC;QAE1F,MAAM,YAAY,GAAG,CAAC,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,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,+CAAgE;IAAlH;;QACI,SAAI,GAAG,qCAAqC,CAAC;QAE1C,sBAAiB,GAAG,CAAC,KAAqB,EAA4B,EAAE;YAC9E,OAAO;gBACH,EAAE,EAAE,KAAK,CAAC,EAAE;gBACZ,IAAI,EAAE,KAAK,CAAC,IAAI;gBAChB,WAAW,EAAE,KAAK,CAAC,WAAW;gBAC9B,KAAK,EAAE;oBACH,EAAE,EAAE,qDAAyB,CAAC,SAAS,CAAC,KAAK,CAAC,KAAK,CAAC;oBACpD,EAAE,EAAE,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,UAAU,CAAC,GAAG,EAAE,GAAG,CAAC;iBACpG;gBACD,YAAY,EAAE,KAAK,CAAC,YAAY;gBAChC,cAAc,EAAE,KAAK,CAAC,cAAc;gBACpC,aAAa,EAAE;oBACX,KAAK,EAAE,KAAK,CAAC,mBAAmB,CAAC,WAAW,EAAE;oBAC9C,GAAG,EAAE,KAAK,CAAC,iBAAiB,EAAE,WAAW,EAAE,IAAI,IAAI;iBACtD;gBACD,cAAc,EAAE;oBACZ,KAAK,EAAE,KAAK,CAAC,oBAAoB,CAAC,WAAW,EAAE;oBAC/C,GAAG,EAAE,KAAK,CAAC,kBAAkB,EAAE,WAAW,EAAE,IAAI,IAAI;iBACvD;gBACD,OAAO,EAAE;oBACL;wBACI,EAAE,EAAE,qDAAyB,CAAC,UAAU,CAAC,KAAK,CAAC,MAAM,CAAC;wBACtD,EAAE,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,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;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,2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everityLevelEnum";
|
|
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":";;;AA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YAChB,QAAQ;YACR,eAAe;YACf,kBAAkB;YAClB,kBAAkB;YAClB,KAAK;YACL,mBAAmB;YACnB,mBAAmB;YACnB,mBAAmB;SACtB;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"}
|
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
|
|
@@ -219,9 +219,9 @@ _:warning: Původním záměrem bylo využití OIS číselníku během zpracová
|
|
|
219
219
|
#### _JIS Events_
|
|
220
220
|
|
|
221
221
|
- zdroj dat
|
|
222
|
-
- baseUrl: module.pid.jis.baseUrl
|
|
223
|
-
- VYMI events path: module.pid.jis.events.path
|
|
224
|
-
- hlavičky VYMI events dotazu: module.pid.jis.events.headers
|
|
222
|
+
- baseUrl: module.pid.jis.vymiApi.baseUrl
|
|
223
|
+
- VYMI events path: module.pid.jis.vymiApi.events.path
|
|
224
|
+
- hlavičky VYMI events dotazu: module.pid.jis.vymiApi.events.headers a module.pid.jis.vymiApi.commonHeaders
|
|
225
225
|
- formát dat
|
|
226
226
|
- protokol: http
|
|
227
227
|
- datový typ: json
|
|
@@ -240,9 +240,9 @@ _:warning: Původním záměrem bylo využití OIS číselníku během zpracová
|
|
|
240
240
|
#### _JIS Infotexts_
|
|
241
241
|
|
|
242
242
|
- zdroj dat
|
|
243
|
-
- baseUrl: module.pid.jis.baseUrl
|
|
244
|
-
- VYMI infotexts path: module.pid.jis.infotexts.path
|
|
245
|
-
- hlavičky VYMI infotexts dotazu: module.pid.jis.infotexts.headers
|
|
243
|
+
- baseUrl: module.pid.jis.vymiApi.baseUrl
|
|
244
|
+
- VYMI infotexts path: module.pid.jis.vymiApi.infotexts.path
|
|
245
|
+
- hlavičky VYMI infotexts dotazu: module.pid.jis.vymiApi.infotexts.headers a module.pid.jis.vymiApi.commonHeaders
|
|
246
246
|
- formát dat
|
|
247
247
|
- protokol: http
|
|
248
248
|
- datový typ: json
|
|
@@ -1157,9 +1157,9 @@ Worker má na starost stahování VYMI (JIS) událostí a infotextů, jejich tra
|
|
|
1157
1157
|
- vstupní rabbitmq fronta
|
|
1158
1158
|
- název: vehicle-positions.jis.refreshJISEvents
|
|
1159
1159
|
- TTL: 20 sekund
|
|
1160
|
-
- parametry:
|
|
1160
|
+
- parametry: `{ data: IJISEvent[]; shouldTriggerWebhooks?: boolean }` ([IJISEvent[]](../src/schema-definitions/jis/datasources/interfaces/IJISEvent.ts))
|
|
1161
1161
|
- závislé fronty (do kterých jsou odesílány zprávy z metody workeru)
|
|
1162
|
-
-
|
|
1162
|
+
- `jis.updateEventWebhook`
|
|
1163
1163
|
- datové zdroje
|
|
1164
1164
|
- JIS Events
|
|
1165
1165
|
- transformace
|
|
@@ -1183,6 +1183,53 @@ Worker má na starost stahování VYMI (JIS) událostí a infotextů, jejich tra
|
|
|
1183
1183
|
- data modely
|
|
1184
1184
|
- JISInfotextsModel `jis_infotexts`
|
|
1185
1185
|
- JISInfotextsRopidGTFSStopsModel `jis_infotexts_ropidgtfs_stops`
|
|
1186
|
+
#### _task: UpdateEventWebhookTask_
|
|
1187
|
+
- Popis tasku
|
|
1188
|
+
- Task posila POST requestem aktualizace dat o změněných událostech hned po přijetí z VYMI a uložení do VP databáze na webhooky definované v module config hodnotami `jis.webhooks.eventUpdate.targets.*`
|
|
1189
|
+
- Jako fallback při výpadku webhooku se muze dotazat uzivatel na `/v1/jis/events/custom-format`
|
|
1190
|
+
|
|
1191
|
+
- vstupní rabbitmq fronta
|
|
1192
|
+
- název: vehicle-positions.jis.updateEventWebhook
|
|
1193
|
+
- TTL: 1 minuta
|
|
1194
|
+
- parametry: [IJISEvent[]](../src/schema-definitions/jis/datasources/interfaces/IJISEvent.ts)
|
|
1195
|
+
- závislé fronty (do kterých jsou odesílány zprávy z metody workeru)
|
|
1196
|
+
- žádné
|
|
1197
|
+
- datové zdroje
|
|
1198
|
+
- JIS Events
|
|
1199
|
+
- transformace
|
|
1200
|
+
- [UpdateEventWebhookTransformation](../src/integration-engine/jis/transformations/UpdateEventWebhookTransformation.ts)
|
|
1201
|
+
- data modely
|
|
1202
|
+
- RopidGTFSRoutes `ropidgtfs_routes`
|
|
1203
|
+
|
|
1204
|
+
#### _task: FetchJISEventsTask_
|
|
1205
|
+
|
|
1206
|
+
- vstupní rabbitmq fronta
|
|
1207
|
+
- název: vehicle-positions.jis.fetchJISEvents
|
|
1208
|
+
- TTL: 20 sekund
|
|
1209
|
+
- parametry: žádné
|
|
1210
|
+
- závislé fronty (do kterých jsou odesílány zprávy z metody workeru)
|
|
1211
|
+
- `jis.refreshJISEvents`
|
|
1212
|
+
- datové zdroje
|
|
1213
|
+
- VYMI
|
|
1214
|
+
- transformace
|
|
1215
|
+
- žádné
|
|
1216
|
+
- data modely
|
|
1217
|
+
- žádné
|
|
1218
|
+
|
|
1219
|
+
#### _task: FetchJISInfotextsTask_
|
|
1220
|
+
|
|
1221
|
+
- vstupní rabbitmq fronta
|
|
1222
|
+
- název: vehicle-positions.jis.fetchJISInfotexts
|
|
1223
|
+
- TTL: 20 sekund
|
|
1224
|
+
- parametry: žádné
|
|
1225
|
+
- závislé fronty (do kterých jsou odesílány zprávy z metody workeru)
|
|
1226
|
+
- `jis.refreshJISInfotexts`
|
|
1227
|
+
- datové zdroje
|
|
1228
|
+
- VYMI
|
|
1229
|
+
- transformace
|
|
1230
|
+
- žádné
|
|
1231
|
+
- data modely
|
|
1232
|
+
- žádné
|
|
1186
1233
|
|
|
1187
1234
|
## Uložení dat
|
|
1188
1235
|
|
package/package.json
CHANGED