@golemio/flow 1.2.13 → 1.2.14-dev.1311678859

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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AE,cAAc;aAC/B;YACD;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,+BAAc;gBACtB,YAAY,EAAE,cAAc;aAC/B;YACD;gBACI,IAAI,EAAE,UAAU;gBAChB,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,+BAAc;gBACtB,YAAY,EAAE,UAAU;aAC3B;YACD;gBACI,IAAI,EAAE,yBAAyB;gBAC/B,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,+BAAc;gBACtB,YAAY,EAAE,yBAAyB;aAC1C;YACD;gBACI,IAAI,EAAE,iBAAiB;gBACvB,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,+BAAc;gBACtB,YAAY,EAAE,iBAAiB;aAClC;SACJ;KACJ;CACJ,CAAC;AAEO,4CAAgB"}
@@ -1,10 +1,12 @@
1
1
  /// <reference types="express" />
2
- import { NextFunction, Request, Response, Router } from "@golemio/core/dist/shared/express";
2
+ import { CacheHeaderMiddleware } from "@golemio/core/dist/output-gateway/CacheHeaderMiddleware";
3
3
  import { BaseRouter } from "@golemio/core/dist/output-gateway/routes/BaseRouter";
4
+ import { NextFunction, Request, Response, Router } from "@golemio/core/dist/shared/express";
4
5
  import { PedestriansLocationsModel, PedestriansMeasurementsModel } from "./models";
5
6
  export declare class PedestriansRouter extends BaseRouter {
6
7
  protected pedestriansLocationsModel: PedestriansLocationsModel;
7
8
  protected pedestriansMeasurementsModel: PedestriansMeasurementsModel;
9
+ protected cacheHeaderMiddleware: CacheHeaderMiddleware;
8
10
  constructor();
9
11
  GetPedestriansLocations: (req: Request, res: Response, next: NextFunction) => Promise<Response<any, Record<string, any>> | undefined>;
10
12
  GetPedestriansMeasurements: (req: Request, res: Response, next: NextFunction) => Promise<Response<any, Record<string, any>> | undefined>;
@@ -10,10 +10,11 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.pedestriansRouter = exports.PedestriansRouter = void 0;
13
- const express_validator_1 = require("@golemio/core/dist/shared/express-validator");
14
- const redis_1 = require("@golemio/core/dist/output-gateway/redis");
15
- const BaseRouter_1 = require("@golemio/core/dist/output-gateway/routes/BaseRouter");
13
+ const Di_1 = require("./ioc/Di");
16
14
  const Validation_1 = require("@golemio/core/dist/output-gateway/Validation");
15
+ const ioc_1 = require("@golemio/core/dist/output-gateway/ioc");
16
+ const BaseRouter_1 = require("@golemio/core/dist/output-gateway/routes/BaseRouter");
17
+ const express_validator_1 = require("@golemio/core/dist/shared/express-validator");
17
18
  const models_1 = require("./models");
18
19
  class PedestriansRouter extends BaseRouter_1.BaseRouter {
19
20
  constructor() {
@@ -56,16 +57,17 @@ class PedestriansRouter extends BaseRouter_1.BaseRouter {
56
57
  next(err);
57
58
  }
58
59
  });
60
+ this.cacheHeaderMiddleware = Di_1.FlowContainer.resolve(ioc_1.ContainerToken.CacheHeaderMiddleware);
59
61
  this.router.get("/locations", [
60
62
  (0, express_validator_1.query)("locationId").optional().not().isEmpty({ ignore_whitespace: true }).not().isArray(),
61
63
  (0, express_validator_1.query)("locationName").optional().not().isEmpty({ ignore_whitespace: true }).not().isArray(),
62
- ], Validation_1.pagination, Validation_1.checkErrors, (0, Validation_1.paginationLimitMiddleware)("PedestriansRouter"), (0, redis_1.useCacheMiddleware)(), this.GetPedestriansLocations);
64
+ ], Validation_1.pagination, Validation_1.checkErrors, (0, Validation_1.paginationLimitMiddleware)("PedestriansRouter"), this.cacheHeaderMiddleware.getMiddleware(60 * 60, 300), this.GetPedestriansLocations);
63
65
  this.router.get("/measurements", [
64
66
  (0, express_validator_1.query)("locationId").optional().not().isEmpty({ ignore_whitespace: true }).not().isArray(),
65
67
  (0, express_validator_1.query)("directionId").optional().not().isEmpty({ ignore_whitespace: true }).not().isArray(),
66
68
  (0, express_validator_1.query)("from").optional().isISO8601().not().isArray(),
67
69
  (0, express_validator_1.query)("to").optional().isISO8601().not().isArray(),
68
- ], Validation_1.pagination, Validation_1.checkErrors, (0, Validation_1.paginationLimitMiddleware)("PedestriansRouter"), (0, redis_1.useCacheMiddleware)(), this.GetPedestriansMeasurements);
70
+ ], Validation_1.pagination, Validation_1.checkErrors, (0, Validation_1.paginationLimitMiddleware)("PedestriansRouter"), this.cacheHeaderMiddleware.getMiddleware(60 * 60, 300), this.GetPedestriansMeasurements);
69
71
  }
70
72
  }
71
73
  exports.PedestriansRouter = PedestriansRouter;
@@ -1 +1 @@
1
- {"version":3,"file":"PedestriansRouter.js","sourceRoot":"","sources":["../../src/output-gateway/PedestriansRouter.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,mFAAoE;AACpE,mEAA6E;AAC7E,oFAAiF;AACjF,6EAAkH;AAClH,qCAAmF;AAEnF,MAAa,iBAAkB,SAAQ,uBAAU;IAI7C;QACI,KAAK,EAAE,CAAC;QAJF,8BAAyB,GAA8B,IAAI,kCAAyB,EAAE,CAAC;QACvF,iCAA4B,GAAiC,IAAI,qCAA4B,EAAE,CAAC;QAkCnG,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,CAAC,EAAE,iBAAiB,EAAE,IAAI,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC,OAAO,EAAE;YACzF,IAAA,yBAAK,EAAC,aAAa,CAAC,CAAC,QAAQ,EAAE,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,EAAE,iBAAiB,EAAE,IAAI,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC,OAAO,EAAE;YAC1F,IAAA,yBAAK,EAAC,MAAM,CAAC,CAAC,QAAQ,EAAE,CAAC,SAAS,EAAE,CAAC,GAAG,EAAE,CAAC,OAAO,EAAE;YACpD,IAAA,yBAAK,EAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,CAAC,SAAS,EAAE,CAAC,GAAG,EAAE,CAAC,OAAO,EAAE;SACrD,EACD,uBAAU,EACV,wBAAW,EACX,IAAA,sCAAyB,EAAC,mBAAmB,CAAC,EAC9C,IAAI,CAAC,qBAAqB,CAAC,aAAa,CAAC,EAAE,GAAG,EAAE,EAAE,GAAG,CAAC,EACtD,IAAI,CAAC,0BAA0B,CAClC,CAAC;IACN,CAAC;CAmCJ;AAtED,8CAsEC;AAED,MAAM,iBAAiB,GAAW,IAAI,iBAAiB,EAAE,CAAC,MAAM,CAAC;AAExD,8CAAiB"}
@@ -0,0 +1,3 @@
1
+ import { DependencyContainer } from "@golemio/core/dist/shared/tsyringe";
2
+ declare const flowContainer: DependencyContainer;
3
+ export { flowContainer as FlowContainer };
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FlowContainer = void 0;
4
+ const Di_1 = require("@golemio/core/dist/output-gateway/ioc/Di");
5
+ //#region Initialization
6
+ const flowContainer = Di_1.OutputGatewayContainer.createChildContainer();
7
+ exports.FlowContainer = flowContainer;
8
+ //# sourceMappingURL=Di.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Di.js","sourceRoot":"","sources":["../../../src/output-gateway/ioc/Di.ts"],"names":[],"mappings":";;;AAAA,iEAAkF;AAGlF,wBAAwB;AACxB,MAAM,aAAa,GAAwB,2BAAsB,CAAC,oBAAoB,EAAE,CAAC;AAG/D,sCAAa"}
package/docs/openapi.yaml CHANGED
@@ -1,248 +1,260 @@
1
- openapi: 3.0.3
2
-
3
- info:
4
- title: 🚶 Pedestrians
5
- description: Locations and Measurements of movement
6
- version: 1.0.0
7
- contact:
8
- name: Golemio Prague Data Platform
9
- email: golemio@operatorict.cz
10
- url: https://golemio.cz
11
-
12
- servers:
13
- - url: https://api.golemio.cz
14
- description: Main (production) server
15
- - url: https://rabin.golemio.cz
16
- description: Test (development) server
17
-
18
- tags:
19
- - name: 🚶 Pedestrians (v2)
20
- description: 💡 Locations and Measurements of movement
21
- paths:
22
- /v2/pedestrians/locations:
23
- get:
24
- summary: Get locations and directions
25
- description: ""
26
- tags:
27
- - 🚶 Pedestrians (v2)
28
- parameters:
29
- - name: locationId
30
- in: query
31
- description: Lists only locations with this ID
32
- required: false
33
- schema:
34
- type: integer
35
- format: int64
36
- - name: locationName
37
- in: query
38
- description: Lists only locations with this NAME
39
- required: false
40
- schema:
41
- type: string
42
- - name: limit
43
- in: query
44
- description: Limits number of retrieved items
45
- required: false
46
- schema:
47
- type: integer
48
- format: int64
49
- - name: offset
50
- in: query
51
- description: Number of the first items that are skipped
52
- required: false
53
- schema:
54
- type: integer
55
- format: int64
56
- responses:
57
- "200":
58
- description: successful operation
59
- content:
60
- application/json:
61
- schema:
62
- $ref: "#/components/schemas/PedestriansLocation"
63
- "401":
64
- $ref: "#/components/responses/UnauthorizedError"
65
- "404":
66
- description: Location not found
67
-
68
- /v2/pedestrians/measurements:
69
- get:
70
- summary: GET measurements of pedestrian traffic
71
- description: ""
72
- tags:
73
- - 🚶 Pedestrians (v2)
74
- parameters:
75
- - name: locationId
76
- in: query
77
- description: Lists only measurements for this location
78
- required: false
79
- schema:
80
- type: integer
81
- format: int64
82
- example: 0
83
- - name: directionId
84
- in: query
85
- description: Lists only measurements for this direction
86
- required: false
87
- schema:
88
- type: integer
89
- format: int64
90
- example: 4
91
- - name: limit
92
- in: query
93
- description: Limits number of retrieved items
94
- required: false
95
- schema:
96
- type: integer
97
- format: int64
98
- example: 1
99
- - name: offset
100
- in: query
101
- description: Number of the first items that are skipped
102
- required: false
103
- schema:
104
- type: integer
105
- format: int64
106
- example: 1
107
- - name: from
108
- in: query
109
- description: Date in ISO8601, limits data measured from this datetime
110
- required: false
111
- schema:
112
- type: string
113
- format: date
114
- example: 2020-09-01T01:15:00.000Z
115
- - name: to
116
- in: query
117
- description: Date in ISO8601, limits data measured up until this datetime
118
- required: false
119
- schema:
120
- type: string
121
- format: date
122
- example: 2020-10-22T01:15:00.000Z
123
- responses:
124
- "200":
125
- description: successful operation
126
- content:
127
- application/json:
128
- schema:
129
- $ref: "#/components/schemas/PedestriansMeasurement"
130
- "401":
131
- $ref: "#/components/responses/UnauthorizedError"
132
- "404":
133
- description: Location not found
134
-
135
- components:
136
- responses:
137
- UnauthorizedError:
138
- description: API key is missing or invalid
139
- headers:
140
- WWW_Authenticate:
141
- schema:
142
- type: string
143
-
144
- schemas:
145
- PedestriansLocation:
146
- type: object
147
- properties:
148
- id:
149
- type: string
150
- description: Location id
151
- example: "2"
152
- location_name:
153
- type: string
154
- example: Rytířská 12
155
- lat:
156
- type: string
157
- example: "50.084781715549276"
158
- lng:
159
- type: string
160
- example: "14.422412102465428"
161
- address:
162
- type: string
163
- example: Na Můstku 12
164
- city_district:
165
- type: string
166
- example: Praha 1
167
- tech:
168
- type: string
169
- example: kamera
170
- map_url:
171
- type: string
172
- example: https://storage.golemio.cz/intenzita-pesi-dopravy/2-map.png
173
- photo_url:
174
- type: string
175
- example: https://storage.golemio.cz/intenzita-pesi-dopravy/2.png
176
- measurement_start:
177
- type: string
178
- format: date
179
- example: 2020-09-02 12:00
180
- measurement_end:
181
- type: string
182
- format: date
183
- example: 2020-09-05 12:00
184
- directions:
185
- type: array
186
- items:
187
- $ref: "#/components/schemas/PedestriansDirection"
188
- required:
189
- - id
190
- - location_name
191
- - lat
192
- - lng
193
- - address
194
- - city_district
195
- - tech
196
- - map_url
197
- - photo_url
198
- - measurement_start
199
-
200
- PedestriansDirection:
201
- type: object
202
- properties:
203
- id:
204
- type: integer
205
- format: int64
206
- example: "2"
207
- name:
208
- type: string
209
- example: Můstek
210
- to:
211
- type: integer
212
- format: int64
213
- example: "1"
214
- required:
215
- - id
216
- - name
217
- - to
218
-
219
- PedestriansMeasurement:
220
- type: object
221
- properties:
222
- location_id:
223
- type: string
224
- example: "1"
225
- direction_id:
226
- type: string
227
- example: "3"
228
- value:
229
- type: string
230
- example: "114"
231
- quality:
232
- type: string
233
- example: "1.00000000000000000000"
234
- measured_from:
235
- type: string
236
- format: date
237
- example: 2020-08-21T17:30:00.000Z
238
- measured_to:
239
- type: string
240
- format: date
241
- example: 2020-08-21T17:45:00.000Z
242
- required:
243
- - location_id
244
- - direction_id
245
- - value
246
- - quality
247
- - measured_from
248
- - measured_to
1
+ openapi: 3.0.3
2
+
3
+ info:
4
+ title: 🚶 Pedestrians
5
+ description: Locations and Measurements of movement
6
+ version: 1.0.0
7
+ contact:
8
+ name: Golemio Prague Data Platform
9
+ email: golemio@operatorict.cz
10
+ url: https://golemio.cz
11
+
12
+ servers:
13
+ - url: https://api.golemio.cz
14
+ description: Main (production) server
15
+ - url: https://rabin.golemio.cz
16
+ description: Test (development) server
17
+
18
+ tags:
19
+ - name: 🚶 Pedestrians (v2)
20
+ description: 💡 Locations and Measurements of movement
21
+ paths:
22
+ /v2/pedestrians/locations:
23
+ get:
24
+ summary: Get locations and directions
25
+ description: ""
26
+ tags:
27
+ - 🚶 Pedestrians (v2)
28
+ parameters:
29
+ - name: locationId
30
+ in: query
31
+ description: Lists only locations with this ID
32
+ required: false
33
+ schema:
34
+ type: integer
35
+ format: int64
36
+ - name: locationName
37
+ in: query
38
+ description: Lists only locations with this NAME
39
+ required: false
40
+ schema:
41
+ type: string
42
+ - name: limit
43
+ in: query
44
+ description: Limits number of retrieved items
45
+ required: false
46
+ schema:
47
+ type: integer
48
+ format: int64
49
+ - name: offset
50
+ in: query
51
+ description: Number of the first items that are skipped
52
+ required: false
53
+ schema:
54
+ type: integer
55
+ format: int64
56
+ responses:
57
+ "200":
58
+ description: successful operation
59
+ headers:
60
+ Cache-Control:
61
+ description: Cache control directive for caching proxies
62
+ schema:
63
+ type: string
64
+ example: public, s-maxage=3600, stale-while-revalidate=300
65
+ content:
66
+ application/json:
67
+ schema:
68
+ $ref: "#/components/schemas/PedestriansLocation"
69
+ "401":
70
+ $ref: "#/components/responses/UnauthorizedError"
71
+ "404":
72
+ description: Location not found
73
+
74
+ /v2/pedestrians/measurements:
75
+ get:
76
+ summary: GET measurements of pedestrian traffic
77
+ description: ""
78
+ tags:
79
+ - 🚶 Pedestrians (v2)
80
+ parameters:
81
+ - name: locationId
82
+ in: query
83
+ description: Lists only measurements for this location
84
+ required: false
85
+ schema:
86
+ type: integer
87
+ format: int64
88
+ example: 0
89
+ - name: directionId
90
+ in: query
91
+ description: Lists only measurements for this direction
92
+ required: false
93
+ schema:
94
+ type: integer
95
+ format: int64
96
+ example: 4
97
+ - name: limit
98
+ in: query
99
+ description: Limits number of retrieved items
100
+ required: false
101
+ schema:
102
+ type: integer
103
+ format: int64
104
+ example: 1
105
+ - name: offset
106
+ in: query
107
+ description: Number of the first items that are skipped
108
+ required: false
109
+ schema:
110
+ type: integer
111
+ format: int64
112
+ example: 1
113
+ - name: from
114
+ in: query
115
+ description: Date in ISO8601, limits data measured from this datetime
116
+ required: false
117
+ schema:
118
+ type: string
119
+ format: date
120
+ example: 2020-09-01T01:15:00.000Z
121
+ - name: to
122
+ in: query
123
+ description: Date in ISO8601, limits data measured up until this datetime
124
+ required: false
125
+ schema:
126
+ type: string
127
+ format: date
128
+ example: 2020-10-22T01:15:00.000Z
129
+ responses:
130
+ "200":
131
+ description: successful operation
132
+ headers:
133
+ Cache-Control:
134
+ description: Cache control directive for caching proxies
135
+ schema:
136
+ type: string
137
+ example: public, s-maxage=3600, stale-while-revalidate=300
138
+ content:
139
+ application/json:
140
+ schema:
141
+ $ref: "#/components/schemas/PedestriansMeasurement"
142
+ "401":
143
+ $ref: "#/components/responses/UnauthorizedError"
144
+ "404":
145
+ description: Location not found
146
+
147
+ components:
148
+ responses:
149
+ UnauthorizedError:
150
+ description: API key is missing or invalid
151
+ headers:
152
+ WWW_Authenticate:
153
+ schema:
154
+ type: string
155
+
156
+ schemas:
157
+ PedestriansLocation:
158
+ type: object
159
+ properties:
160
+ id:
161
+ type: string
162
+ description: Location id
163
+ example: "2"
164
+ location_name:
165
+ type: string
166
+ example: Rytířská 12
167
+ lat:
168
+ type: string
169
+ example: "50.084781715549276"
170
+ lng:
171
+ type: string
172
+ example: "14.422412102465428"
173
+ address:
174
+ type: string
175
+ example: Na Můstku 12
176
+ city_district:
177
+ type: string
178
+ example: Praha 1
179
+ tech:
180
+ type: string
181
+ example: kamera
182
+ map_url:
183
+ type: string
184
+ example: https://storage.golemio.cz/intenzita-pesi-dopravy/2-map.png
185
+ photo_url:
186
+ type: string
187
+ example: https://storage.golemio.cz/intenzita-pesi-dopravy/2.png
188
+ measurement_start:
189
+ type: string
190
+ format: date
191
+ example: 2020-09-02 12:00
192
+ measurement_end:
193
+ type: string
194
+ format: date
195
+ example: 2020-09-05 12:00
196
+ directions:
197
+ type: array
198
+ items:
199
+ $ref: "#/components/schemas/PedestriansDirection"
200
+ required:
201
+ - id
202
+ - location_name
203
+ - lat
204
+ - lng
205
+ - address
206
+ - city_district
207
+ - tech
208
+ - map_url
209
+ - photo_url
210
+ - measurement_start
211
+
212
+ PedestriansDirection:
213
+ type: object
214
+ properties:
215
+ id:
216
+ type: integer
217
+ format: int64
218
+ example: "2"
219
+ name:
220
+ type: string
221
+ example: Můstek
222
+ to:
223
+ type: integer
224
+ format: int64
225
+ example: "1"
226
+ required:
227
+ - id
228
+ - name
229
+ - to
230
+
231
+ PedestriansMeasurement:
232
+ type: object
233
+ properties:
234
+ location_id:
235
+ type: string
236
+ example: "1"
237
+ direction_id:
238
+ type: string
239
+ example: "3"
240
+ value:
241
+ type: string
242
+ example: "114"
243
+ quality:
244
+ type: string
245
+ example: "1.00000000000000000000"
246
+ measured_from:
247
+ type: string
248
+ format: date
249
+ example: 2020-08-21T17:30:00.000Z
250
+ measured_to:
251
+ type: string
252
+ format: date
253
+ example: 2020-08-21T17:45:00.000Z
254
+ required:
255
+ - location_id
256
+ - direction_id
257
+ - value
258
+ - quality
259
+ - measured_from
260
+ - measured_to
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@golemio/flow",
3
- "version": "1.2.13",
3
+ "version": "1.2.14-dev.1311678859",
4
4
  "description": "Golemio Flow Module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -36,13 +36,14 @@
36
36
  "@golemio/core": "1.10.0",
37
37
  "@golemio/db-common": "1.1.4",
38
38
  "@golemio/eslint-config": "1.1.2",
39
- "@types/chai": "4.2.3",
40
- "@types/chai-as-promised": "7.1.2",
39
+ "@types/chai": "^4.2.3",
40
+ "@types/chai-as-promised": "^7.1.2",
41
41
  "@types/mocha": "^8.2.0",
42
42
  "@types/node": "^20.12.7",
43
43
  "@types/sinon": "^9.0.10",
44
- "chai": "4.2.0",
45
- "chai-as-promised": "7.1.1",
44
+ "@types/supertest": "^6.0.2",
45
+ "chai": "^4.2.0",
46
+ "chai-as-promised": "^7.1.1",
46
47
  "cross-env": "^7.0.3",
47
48
  "eslint": "^8.1.1",
48
49
  "husky": "^4.3.7",
@@ -54,6 +55,7 @@
54
55
  "rimraf": "^3.0.2",
55
56
  "sinon": "^9.2.3",
56
57
  "source-map-support": "0.5.21",
58
+ "supertest": "^7.0.0",
57
59
  "ts-node": "^10.9.1",
58
60
  "ts-patch": "3.0.0-beta3",
59
61
  "tsconfig-paths": "^4.2.0",