@golemio/flow 1.3.3 → 1.3.4-dev.1844193115

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.
@@ -0,0 +1,29 @@
1
+ import { BaseWorker } from "@golemio/core/dist/integration-engine/workers";
2
+ /**
3
+ * Temporary worker for testing purposes
4
+ */
5
+ export declare class FlowWorkerTest extends BaseWorker {
6
+ private static testSchema;
7
+ private test_url;
8
+ private cubesDataSource;
9
+ private analyticsDataSource;
10
+ private sinksDataSource;
11
+ private sinksHistoryDataSource;
12
+ private flowCubesModel;
13
+ private flowMeasurementModel;
14
+ private flowODMeasurementModel;
15
+ private flowSinksModel;
16
+ private queuePrefix;
17
+ constructor();
18
+ private getHistoryIntervalFromMsg;
19
+ refreshCubes: (msg: any) => Promise<void>;
20
+ getAnalytics: (msg: any) => Promise<void>;
21
+ getSinks: (msg: any) => Promise<void>;
22
+ getSinksHistoryPayloads: (msg: any) => Promise<void>;
23
+ getSinksHistory: (msg: any) => Promise<void>;
24
+ private getMeasurementsDistribution;
25
+ private getMeasurementsOdMatrix;
26
+ private getHistoryPayload;
27
+ private getTimeRanges;
28
+ private getHttpSettings;
29
+ }
@@ -0,0 +1,469 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __importDefault = (this && this.__importDefault) || function (mod) {
12
+ return (mod && mod.__esModule) ? mod : { "default": mod };
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.FlowWorkerTest = void 0;
16
+ const datasources_1 = require("../schema-definitions/datasources");
17
+ const index_1 = require("../schema-definitions/index");
18
+ const DateTime_1 = require("@golemio/core/dist/helpers/DateTime");
19
+ const config_1 = require("@golemio/core/dist/integration-engine/config");
20
+ const datasources_2 = require("@golemio/core/dist/integration-engine/datasources");
21
+ const HTTPRequestProtocolStrategyStreamed_1 = require("@golemio/core/dist/integration-engine/datasources/protocol-strategy/HTTPRequestProtocolStrategyStreamed");
22
+ const helpers_1 = require("@golemio/core/dist/integration-engine/helpers");
23
+ const models_1 = require("@golemio/core/dist/integration-engine/models");
24
+ const workers_1 = require("@golemio/core/dist/integration-engine/workers");
25
+ const golemio_errors_1 = require("@golemio/core/dist/shared/golemio-errors");
26
+ const golemio_validator_1 = require("@golemio/core/dist/shared/golemio-validator");
27
+ const undici_1 = require("@golemio/core/dist/shared/undici");
28
+ const JSONStream_1 = __importDefault(require("JSONStream"));
29
+ const https_1 = __importDefault(require("https"));
30
+ /**
31
+ * Temporary worker for testing purposes
32
+ */
33
+ class FlowWorkerTest extends workers_1.BaseWorker {
34
+ constructor() {
35
+ super();
36
+ this.queuePrefix = `${config_1.config.RABBIT_EXCHANGE_NAME}.${index_1.Flow.detections.name.toLowerCase()}-TEST`;
37
+ this.getHistoryIntervalFromMsg = (msg) => {
38
+ let historyIntervalsArr = [];
39
+ let msgObj = {};
40
+ try {
41
+ msgObj = JSON.parse(msg.content.toString());
42
+ }
43
+ catch (err) {
44
+ return null;
45
+ }
46
+ const customIntervalArr = !Array.isArray(msgObj) ? [msgObj] : msgObj;
47
+ customIntervalArr.forEach((intervalObj) => {
48
+ if (intervalObj.from && intervalObj.to) {
49
+ const from = +new Date(intervalObj.from);
50
+ const to = +new Date(intervalObj.to);
51
+ // if range is more than 12hrs:
52
+ if (to - from > 43200000) {
53
+ throw new golemio_errors_1.GeneralError("Maximum interval size exceeded. Use intervals of up to 12 hours.", this.constructor.name);
54
+ }
55
+ helpers_1.log.debug(`History interval from: ${from} to ${to} was used.`);
56
+ historyIntervalsArr.push([from, to]);
57
+ }
58
+ else {
59
+ throw new golemio_errors_1.GeneralError("Interval must contain from and to properties.", this.constructor.name);
60
+ }
61
+ });
62
+ return historyIntervalsArr;
63
+ };
64
+ this.refreshCubes = (msg) => __awaiter(this, void 0, void 0, function* () {
65
+ let historyIntervalsArr = this.getHistoryIntervalFromMsg(msg);
66
+ let dataStream;
67
+ try {
68
+ this.cubesDataSource.protocolStrategy.setConnectionSettings(this.getHttpSettings("", "GET", null));
69
+ dataStream = yield this.cubesDataSource.getAll(true);
70
+ }
71
+ catch (err) {
72
+ throw new golemio_errors_1.GeneralError("Error while getting data.", this.constructor.name, err);
73
+ }
74
+ try {
75
+ yield dataStream
76
+ .setDataProcessor((data) => __awaiter(this, void 0, void 0, function* () {
77
+ yield this.flowCubesModel.save(data.map((cube) => {
78
+ return {
79
+ id: cube.id,
80
+ name: cube.name,
81
+ };
82
+ }));
83
+ const promises = data.map((cube) => {
84
+ cube.historyIntervalsArr = historyIntervalsArr;
85
+ return this.sendMessageToExchange("workers." + this.queuePrefix + ".getAnalytics", JSON.stringify(cube));
86
+ });
87
+ yield Promise.all(promises);
88
+ }))
89
+ .proceed();
90
+ }
91
+ catch (err) {
92
+ throw new golemio_errors_1.GeneralError("Error while processing data.", this.constructor.name, err);
93
+ }
94
+ });
95
+ this.getAnalytics = (msg) => __awaiter(this, void 0, void 0, function* () {
96
+ let input;
97
+ let dataStream;
98
+ let historyIntervalsArr;
99
+ try {
100
+ input = JSON.parse(msg.content.toString());
101
+ if ((input === null || input === void 0 ? void 0 : input.id) === undefined) {
102
+ throw new Error(`Can not process getAnalytics input: ${input}`);
103
+ }
104
+ historyIntervalsArr = input.historyIntervalsArr;
105
+ this.analyticsDataSource.protocolStrategy.setConnectionSettings(this.getHttpSettings(`/${input.id}/analytics`, "GET", null));
106
+ dataStream = yield this.analyticsDataSource.getAll(true);
107
+ }
108
+ catch (err) {
109
+ throw new golemio_errors_1.GeneralError("Error while getting data.", this.constructor.name, err);
110
+ }
111
+ try {
112
+ yield dataStream
113
+ .setDataProcessor((data) => __awaiter(this, void 0, void 0, function* () {
114
+ const url = new URL(this.test_url);
115
+ const clientOptions = {
116
+ connect: {
117
+ rejectUnauthorized: false,
118
+ },
119
+ };
120
+ const client = new undici_1.Client(url.origin, clientOptions);
121
+ const httpsAgent = new https_1.default.Agent({
122
+ rejectUnauthorized: false,
123
+ });
124
+ const axPromises = data.map((analytic) => __awaiter(this, void 0, void 0, function* () {
125
+ // no need for DataSource
126
+ const fullUrl = new URL(`${this.test_url}/${input.id}/analytics/${analytic.id}`);
127
+ const requestOptions = {
128
+ path: fullUrl.pathname + fullUrl.search,
129
+ method: "GET",
130
+ headers: {
131
+ "Accept-Version": "1.3",
132
+ Authorization: `Bearer ${config_1.config.datasources.FlowAPI.token}`,
133
+ "Content-Type": "application/json",
134
+ },
135
+ };
136
+ const result = yield client.request(requestOptions);
137
+ return result.body.json();
138
+ }));
139
+ const analytics = yield Promise.all(axPromises);
140
+ const exPromises = analytics.map((analytic) => {
141
+ return this.sendMessageToExchange("workers." + this.queuePrefix + ".getSinks", JSON.stringify({
142
+ analytic: analytic,
143
+ cube: input,
144
+ historyIntervalsArr,
145
+ }));
146
+ });
147
+ yield Promise.all(exPromises);
148
+ }))
149
+ .proceed();
150
+ }
151
+ catch (err) {
152
+ throw new golemio_errors_1.GeneralError("Error while processing data.", this.constructor.name, err);
153
+ }
154
+ });
155
+ this.getSinks = (msg) => __awaiter(this, void 0, void 0, function* () {
156
+ var _a, _b;
157
+ let input;
158
+ let dataStream;
159
+ let historyIntervalsArr;
160
+ try {
161
+ input = JSON.parse(msg.content.toString());
162
+ if (((_a = input === null || input === void 0 ? void 0 : input.analytic) === null || _a === void 0 ? void 0 : _a.id) === undefined || ((_b = input === null || input === void 0 ? void 0 : input.cube) === null || _b === void 0 ? void 0 : _b.id) === undefined) {
163
+ throw new Error(`Can not process getAnalytics input: ${JSON.stringify(input)}`);
164
+ }
165
+ historyIntervalsArr = input.historyIntervalsArr;
166
+ this.sinksDataSource.protocolStrategy.setConnectionSettings(this.getHttpSettings(`/${input.cube.id}/analytics/${input.analytic.id}/sinks`, "GET", null));
167
+ dataStream = yield this.sinksDataSource.getAll(true);
168
+ }
169
+ catch (err) {
170
+ throw new golemio_errors_1.GeneralError("Error while getting data.", this.constructor.name, err);
171
+ }
172
+ try {
173
+ yield dataStream
174
+ .setDataProcessor((data) => __awaiter(this, void 0, void 0, function* () {
175
+ yield this.flowSinksModel.save(data.map((sink) => {
176
+ return {
177
+ cube_id: +input.cube.id,
178
+ history_start_timestamp: new Date(+sink.history_start_timestamp),
179
+ id: sink.id,
180
+ name: sink.name,
181
+ output_value_type: sink.output_value_type,
182
+ };
183
+ }));
184
+ const dataWithDistributionSinks = data.filter((sink) => {
185
+ return (sink === null || sink === void 0 ? void 0 : sink.output_value_type) === "distribution";
186
+ });
187
+ const dataWithOdMatrixSinks = data.filter((sink) => {
188
+ return (sink === null || sink === void 0 ? void 0 : sink.output_value_type) === "od_matrix";
189
+ });
190
+ if (dataWithDistributionSinks.length)
191
+ yield this.sendMessageToExchange("workers." + this.queuePrefix + ".getSinksHistoryPayloads", JSON.stringify({
192
+ analytic: input.analytic,
193
+ cube: input.cube,
194
+ sinks: dataWithDistributionSinks,
195
+ sinksOutputValueType: "distribution",
196
+ historyIntervalsArr,
197
+ }));
198
+ if (dataWithOdMatrixSinks.length)
199
+ yield this.sendMessageToExchange("workers." + this.queuePrefix + ".getSinksHistoryPayloads", JSON.stringify({
200
+ analytic: input.analytic,
201
+ cube: input.cube,
202
+ sinks: dataWithOdMatrixSinks,
203
+ sinksOutputValueType: "od_matrix",
204
+ historyIntervalsArr,
205
+ }));
206
+ }))
207
+ .proceed();
208
+ }
209
+ catch (err) {
210
+ throw new golemio_errors_1.GeneralError("Error while processing data.", this.constructor.name, err);
211
+ }
212
+ });
213
+ this.getSinksHistoryPayloads = (msg) => __awaiter(this, void 0, void 0, function* () {
214
+ var _c, _d;
215
+ let input;
216
+ let historyIntervalsArr;
217
+ let timeRanges;
218
+ try {
219
+ input = JSON.parse(msg.content.toString());
220
+ if (((_c = input === null || input === void 0 ? void 0 : input.analytic) === null || _c === void 0 ? void 0 : _c.id) === undefined ||
221
+ ((_d = input === null || input === void 0 ? void 0 : input.cube) === null || _d === void 0 ? void 0 : _d.id) === undefined ||
222
+ !input.sinks ||
223
+ !input.sinksOutputValueType) {
224
+ throw new Error(`Can not process getAnalytics input: ${JSON.stringify(input)}`);
225
+ }
226
+ historyIntervalsArr = input.historyIntervalsArr;
227
+ if (historyIntervalsArr)
228
+ timeRanges = historyIntervalsArr;
229
+ else
230
+ timeRanges = this.getTimeRanges();
231
+ yield Promise.all(this.getHistoryPayload(timeRanges, input).map((payload) => {
232
+ return this.sendMessageToExchange("workers." + this.queuePrefix + ".getSinksHistory", JSON.stringify({
233
+ analytic: input.analytic,
234
+ cube: input.cube,
235
+ payload,
236
+ sinksOutputValueType: input.sinksOutputValueType,
237
+ }));
238
+ }));
239
+ }
240
+ catch (err) {
241
+ throw new golemio_errors_1.GeneralError("Error while getting data.", this.constructor.name, err);
242
+ }
243
+ });
244
+ this.getSinksHistory = (msg) => __awaiter(this, void 0, void 0, function* () {
245
+ var _e, _f;
246
+ let dataStream;
247
+ let input;
248
+ try {
249
+ input = JSON.parse(msg.content.toString());
250
+ if (((_e = input === null || input === void 0 ? void 0 : input.analytic) === null || _e === void 0 ? void 0 : _e.id) === undefined ||
251
+ ((_f = input === null || input === void 0 ? void 0 : input.cube) === null || _f === void 0 ? void 0 : _f.id) === undefined ||
252
+ !input.payload ||
253
+ !input.sinksOutputValueType) {
254
+ throw new Error(`Can not process getAnalytics input: ${JSON.stringify(input)}`);
255
+ }
256
+ this.sinksHistoryDataSource.protocolStrategy.setConnectionSettings(this.getHttpSettings(`/${input.cube.id}/analytics/${input.analytic.id}/sinks/history`, "POST", input.payload));
257
+ dataStream = yield this.sinksHistoryDataSource.getAll(true);
258
+ }
259
+ catch (err) {
260
+ throw new golemio_errors_1.GeneralError("Error while getting data.", this.constructor.name, err);
261
+ }
262
+ if (input.sinksOutputValueType === "distribution")
263
+ try {
264
+ yield dataStream
265
+ .setDataProcessor((data) => __awaiter(this, void 0, void 0, function* () {
266
+ const detections = this.getMeasurementsDistribution(data, input.cube.id, input.payload.sequence_number, input.analytic.id);
267
+ // filter duplicate data
268
+ const uniq = detections.filter((thing, index, self) => index ===
269
+ self.findIndex((t) => t.cube_id === thing.cube_id &&
270
+ t.sink_id === thing.sink_id &&
271
+ t.start_timestamp === thing.start_timestamp &&
272
+ t.end_timestamp === thing.end_timestamp &&
273
+ t.category === thing.category &&
274
+ t.sequence_number === thing.sequence_number &&
275
+ t.data_validity === thing.data_validity));
276
+ yield this.flowMeasurementModel.save(uniq, false);
277
+ }))
278
+ .proceed();
279
+ }
280
+ catch (err) {
281
+ throw new golemio_errors_1.GeneralError("Error while processing data (distribution sinks).", this.constructor.name, err);
282
+ }
283
+ if (input.sinksOutputValueType === "od_matrix")
284
+ try {
285
+ yield dataStream
286
+ .setDataProcessor((data) => __awaiter(this, void 0, void 0, function* () {
287
+ const detections = this.getMeasurementsOdMatrix(data, input.cube.id, input.payload.sequence_number, input.analytic.id);
288
+ // filter duplicate data
289
+ const uniq = detections.filter((thing, index, self) => index ===
290
+ self.findIndex((t) => t.cube_id === thing.cube_id &&
291
+ t.sink_id === thing.sink_id &&
292
+ t.start_timestamp === thing.start_timestamp &&
293
+ t.end_timestamp === thing.end_timestamp &&
294
+ t.category === thing.category &&
295
+ t.sequence_number === thing.sequence_number &&
296
+ t.data_validity === thing.data_validity &&
297
+ t.origin === thing.origin &&
298
+ t.destination === thing.destination));
299
+ yield this.flowODMeasurementModel.save(uniq, false);
300
+ }))
301
+ .proceed();
302
+ }
303
+ catch (err) {
304
+ throw new golemio_errors_1.GeneralError("Error while processing data (od_matrix sinks).", this.constructor.name, err);
305
+ }
306
+ });
307
+ this.getMeasurementsDistribution = (data, cube_id, sequence_number, analytic_id) => {
308
+ const measurementsNormalised = [];
309
+ data.forEach((element) => {
310
+ ((element === null || element === void 0 ? void 0 : element.snapshots) || []).forEach((snapshot) => {
311
+ var _a;
312
+ (((_a = snapshot === null || snapshot === void 0 ? void 0 : snapshot.data) === null || _a === void 0 ? void 0 : _a.categories) || []).forEach((category) => {
313
+ // filter out 'old' format
314
+ const startTimestamp = parseInt(snapshot.data_start_timestamp, 10);
315
+ if (startTimestamp && !isNaN(startTimestamp)) {
316
+ measurementsNormalised.push({
317
+ sink_id: element.id,
318
+ cube_id,
319
+ sequence_number: +sequence_number,
320
+ analytic_id,
321
+ start_timestamp: new Date(+snapshot.data_start_timestamp),
322
+ end_timestamp: new Date(+snapshot.data_end_timestamp),
323
+ category: category.category,
324
+ value: category.count,
325
+ data_validity: snapshot.data.data_validity,
326
+ });
327
+ }
328
+ });
329
+ });
330
+ });
331
+ return measurementsNormalised;
332
+ };
333
+ this.getMeasurementsOdMatrix = (data, cube_id, sequence_number, analytic_id) => {
334
+ const measurementsNormalised = [];
335
+ data.forEach((element) => {
336
+ ((element === null || element === void 0 ? void 0 : element.snapshots) || []).forEach((snapshot) => {
337
+ var _a;
338
+ const destinations = snapshot.data.destinations;
339
+ const origins = snapshot.data.origins;
340
+ (((_a = snapshot === null || snapshot === void 0 ? void 0 : snapshot.data) === null || _a === void 0 ? void 0 : _a.turning_movements) || []).forEach((category, categoryIndex) => {
341
+ const categoryName = category.category;
342
+ // filter out 'old' format
343
+ const startTimestamp = parseInt(snapshot.data_start_timestamp, 10);
344
+ if (startTimestamp && !isNaN(startTimestamp)) {
345
+ category.data.forEach((originRow, originIndex) => {
346
+ originRow.forEach((value, destinationIndex) => {
347
+ measurementsNormalised.push({
348
+ sink_id: element.id,
349
+ cube_id,
350
+ sequence_number: +sequence_number,
351
+ analytic_id,
352
+ start_timestamp: new Date(+snapshot.data_start_timestamp),
353
+ end_timestamp: new Date(+snapshot.data_end_timestamp),
354
+ category: categoryName,
355
+ origin: origins[originIndex].name,
356
+ destination: destinations[destinationIndex].name,
357
+ value,
358
+ data_validity: snapshot.data.data_validity,
359
+ });
360
+ });
361
+ });
362
+ }
363
+ });
364
+ });
365
+ });
366
+ return measurementsNormalised;
367
+ };
368
+ // get array of all pastOffset to past timeranges [startTS, endTS]
369
+ // where endTS - startTS === interval starting now - pastOffset
370
+ this.getTimeRanges = (pastOffset = 60, interval = 15) => {
371
+ const start = (0, DateTime_1.dateTime)(new Date(new Date().setUTCSeconds(0, 0)));
372
+ const fullMinsDiv2 = start.toDate().getMinutes() % interval;
373
+ const startTs = start.subtract(fullMinsDiv2, "minutes").valueOf();
374
+ const endTs = start.subtract(pastOffset, "minutes").valueOf();
375
+ const ranges = [];
376
+ let currentTs = startTs;
377
+ const intervalMs = interval * 60 * 1000;
378
+ while (currentTs - intervalMs > endTs) {
379
+ ranges.push([currentTs - intervalMs, currentTs]);
380
+ currentTs = currentTs - intervalMs;
381
+ }
382
+ return ranges;
383
+ };
384
+ this.getHttpSettings = (suffix = "", method = "GET", body = null) => {
385
+ const settings = {
386
+ headers: {
387
+ "Accept-Version": "1.3",
388
+ Authorization: `Bearer ${config_1.config.datasources.FlowAPI.token}`,
389
+ "Content-Type": "application/json",
390
+ },
391
+ method,
392
+ rejectUnauthorized: false,
393
+ url: `${this.test_url}${suffix}`,
394
+ };
395
+ if (body) {
396
+ settings.body = JSON.stringify(body);
397
+ }
398
+ return settings;
399
+ };
400
+ this.test_url = "https://10.200.210.1:8088/api/cubes";
401
+ this.flowMeasurementModel = new models_1.PostgresModel(index_1.Flow.detections.name + "Model", {
402
+ outputSequelizeAttributes: index_1.Flow.detections.outputSequelizeAttributes,
403
+ pgSchema: FlowWorkerTest.testSchema,
404
+ pgTableName: index_1.Flow.detections.pgTableName,
405
+ savingType: "insertOrUpdate",
406
+ }, new golemio_validator_1.JSONSchemaValidator("FlowMeasurementValidator", index_1.Flow.detections.jsonSchema));
407
+ this.flowODMeasurementModel = new models_1.PostgresModel(index_1.Flow.detectionsOD.name + "Model", {
408
+ outputSequelizeAttributes: index_1.Flow.detectionsOD.outputSequelizeAttributes,
409
+ pgSchema: FlowWorkerTest.testSchema,
410
+ pgTableName: index_1.Flow.detectionsOD.pgTableName,
411
+ savingType: "insertOrUpdate",
412
+ }, new golemio_validator_1.JSONSchemaValidator("FlowODMeasurementValidator", index_1.Flow.detectionsOD.jsonSchema));
413
+ this.flowCubesModel = new models_1.PostgresModel(index_1.Flow.cubes.name + "Model", {
414
+ outputSequelizeAttributes: index_1.Flow.cubes.outputSequelizeAttributes,
415
+ pgSchema: FlowWorkerTest.testSchema,
416
+ pgTableName: index_1.Flow.cubes.pgTableName,
417
+ savingType: "insertOrUpdate",
418
+ }, new golemio_validator_1.JSONSchemaValidator("FlowCubesValidator", index_1.Flow.cubes.jsonSchema));
419
+ this.flowSinksModel = new models_1.PostgresModel(index_1.Flow.sinks.name + "Model", {
420
+ outputSequelizeAttributes: index_1.Flow.sinks.outputSequelizeAttributes,
421
+ pgSchema: FlowWorkerTest.testSchema,
422
+ pgTableName: index_1.Flow.sinks.pgTableName,
423
+ savingType: "insertOrUpdate",
424
+ }, new golemio_validator_1.JSONSchemaValidator("FlowSinksValidator", index_1.Flow.sinks.jsonSchema));
425
+ this.cubesDataSource = new datasources_2.DataSourceStreamed(datasources_1.cubesDatasource.name, new HTTPRequestProtocolStrategyStreamed_1.HTTPRequestProtocolStrategyStreamed({
426
+ headers: {},
427
+ method: "GET",
428
+ url: this.test_url,
429
+ }).setStreamTransformer(JSONStream_1.default.parse("cubes.*")), new datasources_2.JSONDataTypeStrategy({ resultsPath: "" }), new golemio_validator_1.JSONSchemaValidator(datasources_1.cubesDatasource.name + "Validator", datasources_1.cubesDatasource.jsonSchema));
430
+ this.analyticsDataSource = new datasources_2.DataSourceStreamed(datasources_1.analyticsDatasource.name, new HTTPRequestProtocolStrategyStreamed_1.HTTPRequestProtocolStrategyStreamed({
431
+ headers: {},
432
+ method: "GET",
433
+ url: this.test_url,
434
+ }).setStreamTransformer(JSONStream_1.default.parse("analytics.*")), new datasources_2.JSONDataTypeStrategy({ resultsPath: "" }), new golemio_validator_1.JSONSchemaValidator(datasources_1.analyticsDatasource.name + "Validator", datasources_1.analyticsDatasource.jsonSchema));
435
+ this.sinksDataSource = new datasources_2.DataSourceStreamed(datasources_1.sinksDatasource.name, new HTTPRequestProtocolStrategyStreamed_1.HTTPRequestProtocolStrategyStreamed({
436
+ headers: {},
437
+ method: "GET",
438
+ url: this.test_url,
439
+ }).setStreamTransformer(JSONStream_1.default.parse("sinks.*")), new datasources_2.JSONDataTypeStrategy({ resultsPath: "" }), new golemio_validator_1.JSONSchemaValidator(datasources_1.sinksDatasource.name + "Validator", datasources_1.sinksDatasource.jsonSchema));
440
+ this.sinksHistoryDataSource = new datasources_2.DataSourceStreamed(datasources_1.sinksHistoryDatasource.name, new HTTPRequestProtocolStrategyStreamed_1.HTTPRequestProtocolStrategyStreamed({
441
+ headers: {},
442
+ method: "POST",
443
+ url: this.test_url,
444
+ }).setStreamTransformer(JSONStream_1.default.parse("sinks.*")), new datasources_2.JSONDataTypeStrategy({ resultsPath: "" }), new golemio_validator_1.JSONSchemaValidator(datasources_1.sinksHistoryDatasource.name + "Validator", datasources_1.sinksHistoryDatasource.jsonSchema));
445
+ }
446
+ getHistoryPayload(timeRanges, data) {
447
+ const payloads = [];
448
+ timeRanges.forEach((range) => {
449
+ const payload = {
450
+ sequence_number: data.analytic.sequence_number,
451
+ sinks: [],
452
+ };
453
+ data.sinks.forEach((sink) => {
454
+ payload.sinks.push({
455
+ // has to be string!
456
+ end_timestamp: `${range[1]}`,
457
+ id: sink.id,
458
+ // has to be string!
459
+ start_timestamp: `${range[0]}`,
460
+ });
461
+ });
462
+ payloads.push(payload);
463
+ });
464
+ return payloads;
465
+ }
466
+ }
467
+ exports.FlowWorkerTest = FlowWorkerTest;
468
+ FlowWorkerTest.testSchema = "flow_test";
469
+ //# sourceMappingURL=FlowWorkerTest.js.map
@@ -0,0 +1 @@
1
+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AAO,CAAC,CAAC;QAC3B,CAAC,CAAC,CAAC;QACH,OAAO,QAAQ,CAAC;IACpB,CAAC;;AA3hBL,wCAukBC;AAtkBkB,yBAAU,GAAG,WAAW,AAAd,CAAe"}
@@ -5,6 +5,7 @@ const config_1 = require("@golemio/core/dist/integration-engine/config");
5
5
  const index_1 = require("../schema-definitions/index");
6
6
  const FlowWorker_1 = require("./FlowWorker");
7
7
  const CountersWorker_1 = require("./CountersWorker");
8
+ const FlowWorkerTest_1 = require("./FlowWorkerTest");
8
9
  const queueDefinitions = [
9
10
  {
10
11
  name: index_1.Flow.detections.name,
@@ -98,6 +99,62 @@ const queueDefinitions = [
98
99
  },
99
100
  ],
100
101
  },
102
+ {
103
+ name: index_1.Flow.detections.name + "-TEST",
104
+ queuePrefix: config_1.config.RABBIT_EXCHANGE_NAME + "." + index_1.Flow.detections.name.toLowerCase() + "-TEST",
105
+ queues: [
106
+ {
107
+ name: "refreshCubes",
108
+ options: {
109
+ deadLetterExchange: config_1.config.RABBIT_EXCHANGE_NAME,
110
+ deadLetterRoutingKey: "dead",
111
+ messageTtl: 23 * 60 * 60 * 1000, // 23 hours
112
+ },
113
+ worker: FlowWorkerTest_1.FlowWorkerTest,
114
+ workerMethod: "refreshCubes",
115
+ },
116
+ {
117
+ name: "getAnalytics",
118
+ options: {
119
+ deadLetterExchange: config_1.config.RABBIT_EXCHANGE_NAME,
120
+ deadLetterRoutingKey: "dead",
121
+ messageTtl: 23 * 60 * 60 * 1000, // 23 hours
122
+ },
123
+ worker: FlowWorkerTest_1.FlowWorkerTest,
124
+ workerMethod: "getAnalytics",
125
+ },
126
+ {
127
+ name: "getSinks",
128
+ options: {
129
+ deadLetterExchange: config_1.config.RABBIT_EXCHANGE_NAME,
130
+ deadLetterRoutingKey: "dead",
131
+ messageTtl: 23 * 60 * 60 * 1000, // 23 hours
132
+ },
133
+ worker: FlowWorkerTest_1.FlowWorkerTest,
134
+ workerMethod: "getSinks",
135
+ },
136
+ {
137
+ name: "getSinksHistoryPayloads",
138
+ options: {
139
+ deadLetterExchange: config_1.config.RABBIT_EXCHANGE_NAME,
140
+ deadLetterRoutingKey: "dead",
141
+ messageTtl: 23 * 60 * 60 * 1000, // 23 hours
142
+ },
143
+ worker: FlowWorkerTest_1.FlowWorkerTest,
144
+ workerMethod: "getSinksHistoryPayloads",
145
+ },
146
+ {
147
+ name: "getSinksHistory",
148
+ options: {
149
+ deadLetterExchange: config_1.config.RABBIT_EXCHANGE_NAME,
150
+ deadLetterRoutingKey: "dead",
151
+ messageTtl: 23 * 60 * 60 * 1000, // 23 hours
152
+ },
153
+ worker: FlowWorkerTest_1.FlowWorkerTest,
154
+ workerMethod: "getSinksHistory",
155
+ },
156
+ ],
157
+ },
101
158
  ];
102
159
  exports.queueDefinitions = queueDefinitions;
103
160
  //# sourceMappingURL=queueDefinitions.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"queueDefinitions.js","sourceRoot":"","sources":["../../src/integration-engine/queueDefinitions.ts"],"names":[],"mappings":";;;AAAA,yEAAsE;AAEtE,uDAAkC;AAClC,6CAA4C;AAC5C,qDAAkD;AAElD,MAAM,gBAAgB,GAAuB;IACzC;QACI,IAAI,EAAE,YAAI,CAAC,UAAU,CAAC,IAAI;QAC1B,WAAW,EAAE,eAAM,CAAC,oBAAoB,GAAG,GAAG,GAAG,YAAI,CAAC,UAAU,CAAC,IAAI,CAAC,WAAW,EAAE;QACnF,MAAM,EAAE;YACJ;gBACI,IAAI,EAAE,cAAc;gBACpB,OAAO,EAAE;oBACL,kBAAkB,EAAE,eAAM,CAAC,oBAAoB;oBAC/C,oBAAoB,EAAE,MAAM;oBAC5B,UAAU,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,EAAE,WAAW;iBAC/C;gBACD,MAAM,EAAE,uBAAU;gBAClB,YAAY,EAAE,cAAc;aAC/B;YACD;gBACI,IAAI,EAAE,cAAc;gBACpB,OAAO,EAAE;oBACL,kBAAkB,EAAE,eAAM,CAAC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openapi-output.yaml)
138
138
  - veřejné / neveřejné endpointy
139
139
  - api je neveřejné
140
140
 
@@ -33,12 +33,14 @@ paths:
33
33
  schema:
34
34
  type: integer
35
35
  format: int64
36
+ example: 1
36
37
  - name: locationName
37
38
  in: query
38
39
  description: Lists only locations with this NAME
39
40
  required: false
40
41
  schema:
41
42
  type: string
43
+ example: "Výstaviště - viadukt VO 2"
42
44
  - name: limit
43
45
  in: query
44
46
  description: Limits number of retrieved items
@@ -46,6 +48,7 @@ paths:
46
48
  schema:
47
49
  type: integer
48
50
  format: int64
51
+ example: 5
49
52
  - name: offset
50
53
  in: query
51
54
  description: Number of the first items that are skipped
@@ -53,6 +56,7 @@ paths:
53
56
  schema:
54
57
  type: integer
55
58
  format: int64
59
+ example: 0
56
60
  responses:
57
61
  "200":
58
62
  description: successful operation
@@ -65,7 +69,9 @@ paths:
65
69
  content:
66
70
  application/json:
67
71
  schema:
68
- $ref: "#/components/schemas/PedestriansLocation"
72
+ type: array
73
+ items:
74
+ $ref: "#/components/schemas/PedestriansLocation"
69
75
  "401":
70
76
  $ref: "#/components/responses/UnauthorizedError"
71
77
  "404":
@@ -83,17 +89,15 @@ paths:
83
89
  description: Lists only measurements for this location
84
90
  required: false
85
91
  schema:
86
- type: integer
87
- format: int64
88
- example: 0
92
+ type: string
93
+ example: wifi1
89
94
  - name: directionId
90
95
  in: query
91
96
  description: Lists only measurements for this direction
92
97
  required: false
93
98
  schema:
94
- type: integer
95
- format: int64
96
- example: 4
99
+ type: string
100
+ example: dir2
97
101
  - name: limit
98
102
  in: query
99
103
  description: Limits number of retrieved items
@@ -101,7 +105,7 @@ paths:
101
105
  schema:
102
106
  type: integer
103
107
  format: int64
104
- example: 1
108
+ example: 2
105
109
  - name: offset
106
110
  in: query
107
111
  description: Number of the first items that are skipped
@@ -109,7 +113,7 @@ paths:
109
113
  schema:
110
114
  type: integer
111
115
  format: int64
112
- example: 1
116
+ example: 0
113
117
  - name: from
114
118
  in: query
115
119
  description: Date in ISO8601, limits data measured from this datetime
@@ -117,7 +121,7 @@ paths:
117
121
  schema:
118
122
  type: string
119
123
  format: date
120
- example: 2020-09-01T01:15:00.000Z
124
+ example: 2020-11-24T10:30:00.000Z
121
125
  - name: to
122
126
  in: query
123
127
  description: Date in ISO8601, limits data measured up until this datetime
@@ -125,7 +129,7 @@ paths:
125
129
  schema:
126
130
  type: string
127
131
  format: date
128
- example: 2020-10-22T01:15:00.000Z
132
+ example: 2020-11-24T10:45:00.000Z
129
133
  responses:
130
134
  "200":
131
135
  description: successful operation
@@ -138,7 +142,9 @@ paths:
138
142
  content:
139
143
  application/json:
140
144
  schema:
141
- $ref: "#/components/schemas/PedestriansMeasurement"
145
+ type: array
146
+ items:
147
+ $ref: "#/components/schemas/PedestriansMeasurement"
142
148
  "401":
143
149
  $ref: "#/components/responses/UnauthorizedError"
144
150
  "404":
@@ -187,12 +193,11 @@ components:
187
193
  example: https://storage.golemio.cz/intenzita-pesi-dopravy/2.png
188
194
  measurement_start:
189
195
  type: string
190
- format: date
191
196
  example: 2020-09-02 12:00
192
197
  measurement_end:
193
198
  type: string
194
- format: date
195
199
  example: 2020-09-05 12:00
200
+ nullable: true
196
201
  directions:
197
202
  type: array
198
203
  items:
@@ -213,8 +218,7 @@ components:
213
218
  type: object
214
219
  properties:
215
220
  id:
216
- type: integer
217
- format: int64
221
+ type: string
218
222
  example: "2"
219
223
  name:
220
224
  type: string
@@ -222,7 +226,7 @@ components:
222
226
  to:
223
227
  type: integer
224
228
  format: int64
225
- example: "1"
229
+ example: 1
226
230
  required:
227
231
  - id
228
232
  - name
@@ -245,11 +249,11 @@ components:
245
249
  example: "1.00000000000000000000"
246
250
  measured_from:
247
251
  type: string
248
- format: date
252
+ format: date-time
249
253
  example: 2020-08-21T17:30:00.000Z
250
254
  measured_to:
251
255
  type: string
252
- format: date
256
+ format: date-time
253
257
  example: 2020-08-21T17:45:00.000Z
254
258
  required:
255
259
  - location_id
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@golemio/flow",
3
- "version": "1.3.3",
3
+ "version": "1.3.4-dev.1844193115",
4
4
  "description": "Golemio Flow Module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -13,6 +13,8 @@
13
13
  "test": "cross-env NODE_ENV=test mocha --exit --check-leaks --timeout 120000 -r ts-node/register -r tsconfig-paths/register -r dotenv/config --file 'test/setup.ts' 'test/**/*.test.ts'",
14
14
  "test-debug": "run-s 'test -- --inspect-brk=9230'",
15
15
  "code-coverage": "nyc run-s 'test -- -r source-map-support/register'",
16
+ "apidocs-test": "npm run apidocs-test-output",
17
+ "apidocs-test-output": "cross-env NODE_ENV=test golemio swagger api-test --oas docs/openapi-output.yaml --script test/api-docs/output-gateway/server.js --config test/api-docs/output-gateway/portman-config.json",
16
18
  "generate-docs": "typedoc --out docs/typedoc src",
17
19
  "lint": "eslint \"{src,test}/**/*.ts\""
18
20
  },
@@ -30,9 +32,10 @@
30
32
  "npm": ">=8.0.0"
31
33
  },
32
34
  "devDependencies": {
35
+ "@apideck/portman": "^1.26.5",
33
36
  "@commitlint/cli": "^11.0.0",
34
37
  "@commitlint/config-conventional": "^11.0.0",
35
- "@golemio/cli": "1.7.3",
38
+ "@golemio/cli": "1.9.2",
36
39
  "@golemio/core": "1.15.0",
37
40
  "@golemio/db-common": "1.1.4",
38
41
  "@golemio/eslint-config": "1.1.2",
@@ -69,4 +72,4 @@
69
72
  "peerDependencies": {
70
73
  "@golemio/core": ">=1.9.0"
71
74
  }
72
- }
75
+ }