@golemio/air-quality-stations 1.0.3-dev.427106071 → 1.0.3-dev.509098240

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (71) hide show
  1. package/dist/integration-engine/AirQualityStationsWorker.d.ts +4 -0
  2. package/dist/integration-engine/AirQualityStationsWorker.js +34 -6
  3. package/dist/integration-engine/AirQualityStationsWorker.js.map +1 -1
  4. package/dist/integration-engine/queueDefinitions.js +10 -0
  5. package/dist/integration-engine/queueDefinitions.js.map +1 -1
  6. package/dist/output-gateway/AirQualityHistoryRouter.d.ts +6 -0
  7. package/dist/output-gateway/AirQualityHistoryRouter.js +27 -0
  8. package/dist/output-gateway/AirQualityHistoryRouter.js.map +1 -0
  9. package/dist/output-gateway/AirQualityRouter.d.ts +13 -0
  10. package/dist/output-gateway/AirQualityRouter.js +57 -0
  11. package/dist/output-gateway/AirQualityRouter.js.map +1 -0
  12. package/dist/output-gateway/index.d.ts +1 -0
  13. package/dist/output-gateway/index.js +14 -0
  14. package/dist/output-gateway/index.js.map +1 -0
  15. package/dist/output-gateway/models/AirQualityComponentTypes.d.ts +6 -0
  16. package/dist/output-gateway/models/AirQualityComponentTypes.js +17 -0
  17. package/dist/output-gateway/models/AirQualityComponentTypes.js.map +1 -0
  18. package/dist/output-gateway/models/AirQualityHistoryModel.d.ts +10 -0
  19. package/dist/output-gateway/models/AirQualityHistoryModel.js +84 -0
  20. package/dist/output-gateway/models/AirQualityHistoryModel.js.map +1 -0
  21. package/dist/output-gateway/models/AirQualityIndexTypesModel.d.ts +6 -0
  22. package/dist/output-gateway/models/AirQualityIndexTypesModel.js +17 -0
  23. package/dist/output-gateway/models/AirQualityIndexTypesModel.js.map +1 -0
  24. package/dist/output-gateway/models/AirQualityIndexesModel.d.ts +9 -0
  25. package/dist/output-gateway/models/AirQualityIndexesModel.js +55 -0
  26. package/dist/output-gateway/models/AirQualityIndexesModel.js.map +1 -0
  27. package/dist/output-gateway/models/AirQualityMeasurementsModel.d.ts +6 -0
  28. package/dist/output-gateway/models/AirQualityMeasurementsModel.js +17 -0
  29. package/dist/output-gateway/models/AirQualityMeasurementsModel.js.map +1 -0
  30. package/dist/output-gateway/models/AirQualityStationsModel.d.ts +6 -0
  31. package/dist/output-gateway/models/AirQualityStationsModel.js +26 -0
  32. package/dist/output-gateway/models/AirQualityStationsModel.js.map +1 -0
  33. package/dist/output-gateway/models/helpers/HistoryModelHelper.d.ts +7 -0
  34. package/dist/output-gateway/models/helpers/HistoryModelHelper.js +34 -0
  35. package/dist/output-gateway/models/helpers/HistoryModelHelper.js.map +1 -0
  36. package/dist/output-gateway/models/helpers/OutputDtoMapper.d.ts +7 -0
  37. package/dist/output-gateway/models/helpers/OutputDtoMapper.js +50 -0
  38. package/dist/output-gateway/models/helpers/OutputDtoMapper.js.map +1 -0
  39. package/dist/output-gateway/models/helpers/ParamHelper.d.ts +3 -0
  40. package/dist/output-gateway/models/helpers/ParamHelper.js +16 -0
  41. package/dist/output-gateway/models/helpers/ParamHelper.js.map +1 -0
  42. package/dist/output-gateway/models/helpers/RawQueryProvider.d.ts +2 -0
  43. package/dist/output-gateway/models/helpers/RawQueryProvider.js +86 -0
  44. package/dist/output-gateway/models/helpers/RawQueryProvider.js.map +1 -0
  45. package/dist/schema-definitions/index.js +4 -0
  46. package/dist/schema-definitions/index.js.map +1 -1
  47. package/dist/schema-definitions/sequelize-models/AirQualityComponentType.d.ts +10 -0
  48. package/dist/schema-definitions/sequelize-models/AirQualityComponentType.js +15 -0
  49. package/dist/schema-definitions/sequelize-models/AirQualityComponentType.js.map +1 -0
  50. package/dist/schema-definitions/sequelize-models/AirQualityIndex.d.ts +13 -0
  51. package/dist/schema-definitions/sequelize-models/AirQualityIndex.js +8 -0
  52. package/dist/schema-definitions/sequelize-models/AirQualityIndex.js.map +1 -0
  53. package/dist/schema-definitions/sequelize-models/AirQualityIndexType.d.ts +13 -0
  54. package/dist/schema-definitions/sequelize-models/AirQualityIndexType.js +18 -0
  55. package/dist/schema-definitions/sequelize-models/AirQualityIndexType.js.map +1 -0
  56. package/dist/schema-definitions/sequelize-models/interfaces/IAirQualityComponentType.d.ts +7 -0
  57. package/dist/schema-definitions/sequelize-models/interfaces/IAirQualityComponentType.js +3 -0
  58. package/dist/schema-definitions/sequelize-models/interfaces/IAirQualityComponentType.js.map +1 -0
  59. package/dist/schema-definitions/sequelize-models/interfaces/IAirQualityIndex.d.ts +11 -0
  60. package/dist/schema-definitions/sequelize-models/interfaces/IAirQualityIndex.js +3 -0
  61. package/dist/schema-definitions/sequelize-models/interfaces/IAirQualityIndex.js.map +1 -0
  62. package/dist/schema-definitions/sequelize-models/interfaces/IAirQualityIndexType.d.ts +10 -0
  63. package/dist/schema-definitions/sequelize-models/interfaces/IAirQualityIndexType.js +3 -0
  64. package/dist/schema-definitions/sequelize-models/interfaces/IAirQualityIndexType.js.map +1 -0
  65. package/dist/schema-definitions/sequelize-models/interfaces/IAirQualityMeasurement.d.ts +8 -0
  66. package/dist/schema-definitions/sequelize-models/interfaces/IAirQualityMeasurement.js +3 -0
  67. package/dist/schema-definitions/sequelize-models/interfaces/IAirQualityMeasurement.js.map +1 -0
  68. package/dist/schema-definitions/sequelize-models/interfaces/IAirQualityStation.d.ts +15 -0
  69. package/dist/schema-definitions/sequelize-models/interfaces/IAirQualityStation.js +3 -0
  70. package/dist/schema-definitions/sequelize-models/interfaces/IAirQualityStation.js.map +1 -0
  71. package/package.json +6 -3
@@ -1,12 +1,16 @@
1
1
  import { BaseWorker } from "@golemio/core/dist/integration-engine/workers";
2
2
  export declare class AirQualityStationsWorker extends BaseWorker {
3
+ private queuePrefix;
3
4
  private dataSource1H;
4
5
  private dataSource3H;
5
6
  private transformation;
6
7
  private indexesModel;
7
8
  private measurementsModel;
8
9
  private stationsModel;
10
+ private cityDistrictModel;
9
11
  constructor();
10
12
  refresh1HDataInDB: (msg: any) => Promise<void>;
11
13
  refresh3HDataInDB: (msg: any) => Promise<void>;
14
+ updateDistrict: (msg: any) => Promise<void>;
15
+ private prepareQueueForDistrictUpdate;
12
16
  }
@@ -8,14 +8,18 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  step((generator = generator.apply(thisArg, _arguments || [])).next());
9
9
  });
10
10
  };
11
+ var __importDefault = (this && this.__importDefault) || function (mod) {
12
+ return (mod && mod.__esModule) ? mod : { "default": mod };
13
+ };
11
14
  Object.defineProperty(exports, "__esModule", { value: true });
12
15
  exports.AirQualityStationsWorker = void 0;
13
- const golemio_validator_1 = require("@golemio/core/dist/shared/golemio-validator");
16
+ const index_1 = require("../schema-definitions/index");
17
+ const CityDistrictModel_1 = __importDefault(require("@golemio/city-districts/dist/integration-engine/models/CityDistrictModel"));
18
+ const integration_engine_1 = require("@golemio/core/dist/integration-engine");
14
19
  const config_1 = require("@golemio/core/dist/integration-engine/config");
15
20
  const datasources_1 = require("@golemio/core/dist/integration-engine/datasources");
16
- const models_1 = require("@golemio/core/dist/integration-engine/models");
17
21
  const workers_1 = require("@golemio/core/dist/integration-engine/workers");
18
- const index_1 = require("../schema-definitions/index");
22
+ const golemio_validator_1 = require("@golemio/core/dist/shared/golemio-validator");
19
23
  const _1 = require("./");
20
24
  class AirQualityStationsWorker extends workers_1.BaseWorker {
21
25
  constructor() {
@@ -37,7 +41,30 @@ class AirQualityStationsWorker extends workers_1.BaseWorker {
37
41
  this.measurementsModel.save(transformedData.measurements),
38
42
  this.indexesModel.save(transformedData.indexes),
39
43
  ]);
44
+ this.prepareQueueForDistrictUpdate();
45
+ });
46
+ this.updateDistrict = (msg) => __awaiter(this, void 0, void 0, function* () {
47
+ const airQualityStation = JSON.parse(msg.content.toString());
48
+ if (airQualityStation.id) {
49
+ const dbData = yield this.stationsModel.findOne({
50
+ where: { id: airQualityStation.id },
51
+ });
52
+ if (!dbData.district) {
53
+ dbData.district = yield this.cityDistrictModel.getDistrict(dbData.longitude, dbData.latitude);
54
+ dbData.save();
55
+ }
56
+ }
57
+ });
58
+ this.prepareQueueForDistrictUpdate = () => __awaiter(this, void 0, void 0, function* () {
59
+ const result = yield this.stationsModel["sequelizeModel"].findAll({ where: { district: null, region_name: "Praha" } });
60
+ const stationIds = result.map((station) => station.id);
61
+ let promises = [];
62
+ for (const stationId of stationIds) {
63
+ promises.push(this.sendMessageToExchange("workers." + this.queuePrefix + ".updateDistrict", JSON.stringify({ id: stationId })));
64
+ }
65
+ yield Promise.all(promises);
40
66
  });
67
+ this.queuePrefix = config_1.config.RABBIT_EXCHANGE_NAME + "." + index_1.AirQualityStations.name.toLowerCase();
41
68
  this.dataSource1H = new datasources_1.DataSource(index_1.AirQualityStations.name + "1HDataSource", new datasources_1.HTTPProtocolStrategy({
42
69
  headers: {},
43
70
  method: "GET",
@@ -49,21 +76,22 @@ class AirQualityStationsWorker extends workers_1.BaseWorker {
49
76
  url: config_1.config.datasources.AirQualityStations3H,
50
77
  }), new datasources_1.JSONDataTypeStrategy({ resultsPath: "" }), new golemio_validator_1.JSONSchemaValidator(index_1.AirQualityStations.name + "3HDataSource", index_1.AirQualityStations.datasourceJsonSchema));
51
78
  this.transformation = new _1.AirQualityStationsTransformation();
52
- this.stationsModel = new models_1.PostgresModel(index_1.AirQualityStations.stations.name + "Model", {
79
+ this.stationsModel = new integration_engine_1.PostgresModel(index_1.AirQualityStations.stations.name + "Model", {
53
80
  outputSequelizeAttributes: index_1.AirQualityStations.stations.outputSequelizeAttributes,
54
81
  pgTableName: index_1.AirQualityStations.stations.pgTableName,
55
82
  savingType: "insertOrUpdate",
56
83
  }, new golemio_validator_1.Validator(index_1.AirQualityStations.stations.name + "ModelValidator", index_1.AirQualityStations.stations.outputMongooseSchemaObject));
57
- this.measurementsModel = new models_1.PostgresModel(index_1.AirQualityStations.measurements.name + "Model", {
84
+ this.measurementsModel = new integration_engine_1.PostgresModel(index_1.AirQualityStations.measurements.name + "Model", {
58
85
  outputSequelizeAttributes: index_1.AirQualityStations.measurements.outputSequelizeAttributes,
59
86
  pgTableName: index_1.AirQualityStations.measurements.pgTableName,
60
87
  savingType: "insertOrUpdate",
61
88
  }, new golemio_validator_1.Validator(index_1.AirQualityStations.measurements.name + "ModelValidator", index_1.AirQualityStations.measurements.outputMongooseSchemaObject));
62
- this.indexesModel = new models_1.PostgresModel(index_1.AirQualityStations.indexes.name + "Model", {
89
+ this.indexesModel = new integration_engine_1.PostgresModel(index_1.AirQualityStations.indexes.name + "Model", {
63
90
  outputSequelizeAttributes: index_1.AirQualityStations.indexes.outputSequelizeAttributes,
64
91
  pgTableName: index_1.AirQualityStations.indexes.pgTableName,
65
92
  savingType: "insertOrUpdate",
66
93
  }, new golemio_validator_1.Validator(index_1.AirQualityStations.indexes.name + "ModelValidator", index_1.AirQualityStations.indexes.outputMongooseSchemaObject));
94
+ this.cityDistrictModel = new CityDistrictModel_1.default();
67
95
  }
68
96
  }
69
97
  exports.AirQualityStationsWorker = AirQualityStationsWorker;
@@ -1 +1 @@
1
- {"version":3,"file":"AirQualityStationsWorker.js","sourceRoot":"","sources":["../../src/integration-engine/AirQualityStationsWorker.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,mFAA6F;AAC7F,yEAAsE;AACtE,mFAA2H;AAC3H,yEAA6E;AAC7E,2EAA2E;AAC3E,uDAAgD;AAChD,yBAAsD;AAEtD,MAAa,wBAAyB,SAAQ,oBAAU;IAQpD;QACI,KAAK,EAAE,CAAC;QA4DL,sBAAiB,GAAG,CAAO,GAAQ,EAAiB,EAAE;YACzD,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE,CAAC;YAC9C,MAAM,eAAe,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;YAClE,MAAM,OAAO,CAAC,GAAG,CAAC;gBACd,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,eAAe,CAAC,QAAQ,CAAC;gBACjD,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,eAAe,CAAC,YAAY,CAAC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ethod: "refresh3HDataInDB",
31
31
  },
32
+ {
33
+ name: "updateDistrict",
34
+ options: {
35
+ deadLetterExchange: config_1.config.RABBIT_EXCHANGE_NAME,
36
+ deadLetterRoutingKey: "dead",
37
+ messageTtl: 23 * 60 * 60 * 1000, // 23 hours
38
+ },
39
+ worker: AirQualityStationsWorker_1.AirQualityStationsWorker,
40
+ workerMethod: "updateDistrict",
41
+ },
32
42
  ],
33
43
  },
34
44
  ];
@@ -1 +1 @@
1
- {"version":3,"file":"queueDefinitions.js","sourceRoot":"","sources":["../../src/integration-engine/queueDefinitions.ts"],"names":[],"mappings":";;;AAAA,yEAAsE;AAEtE,uDAAgD;AAChD,yEAAwE;AAExE,MAAM,gBAAgB,GAAuB;IACzC;QACI,IAAI,EAAE,0BAAkB,CAAC,IAAI;QAC7B,WAAW,EAAE,eAAM,CAAC,oBAAoB,GAAG,GAAG,GAAG,0BAAkB,CAAC,IAAI,CAAC,WAAW,EAAE;QACtF,MAAM,EAAE;YACJ;gBACI,IAAI,EAAE,mBAAmB;gBACzB,OAAO,EAAE;oBACL,kBAAkB,EAAE,eAAM,CAAC,oBAAoB;oBAC/C,oBAAoB,EAAE,MAAM;oBAC5B,UAAU,EAAE,EAAE,GAAG,EAAE,GAAG,IAAI,EAAE,aAAa;iBAC5C;gBACD,MAAM,EAAE,mDAAwB;gBAChC,YAAY,EAAE,mBAAmB;aACpC;YACD;gBACI,IAAI,EAAE,mBAAmB;gBACzB,OAAO,EAAE;oBACL,kBAAkB,EAAE,eAAM,CAAC,oBAAoB;oBAC/C,oBAAoB,EAAE,MAAM;oBAC5B,UAAU,EAAE,EAAE,GAAG,EAAE,GAAG,IAAI,EAAE,aAAa;iBAC5C;gBACD,MAAM,EAAE,mDAAwB;gBAChC,YAAY,EAAE,mBAAmB;aACpC;SACJ;KACJ;CACJ,CAAC;AAEO,4CAAgB"}
1
+ {"version":3,"file":"queueDefinitions.js","sourceRoot":"","sources":["../../src/integration-engine/queueDefinitions.ts"],"names":[],"mappings":";;;AAAA,yEAAsE;AAEtE,uDAAgD;AAChD,yEAAwE;AAExE,MAAM,gBAAgB,GAAuB;IACzC;QACI,IAAI,EAAE,0BAAkB,CAAC,IAAI;QAC7B,WAAW,EAAE,eAAM,CAAC,oBAAoB,GAAG,GAAG,GAAG,0BAAkB,CAAC,IAAI,CAAC,WAAW,EAAE;QACtF,MAAM,EAAE;YACJ;gBACI,IAAI,EAAE,mBAAmB;gBACzB,OAAO,EAAE;oBACL,kBAAkB,EAAE,eAAM,CAAC,oBAAoB;oBAC/C,oBAAoB,EAAE,MAAM;oBAC5B,UAAU,EAAE,EAAE,GAAG,EAAE,GAAG,IAAI,EAAE,aAAa;iBAC5C;gBACD,MAAM,EAAE,mDAAwB;gBAChC,YAAY,EAAE,mBAAmB;aACpC;YACD;gBACI,IAAI,EAAE,mBAAmB;gBACzB,OAAO,EAAE;oBACL,kBAAkB,EAAE,eAAM,CAAC,oBAAoB;oBAC/C,oBAAoB,EAAE,MAAM;oBAC5B,UAAU,EAAE,EAAE,GAAG,EAAE,GAAG,IAAI,EAAE,aAAa;iBAC5C;gBACD,MAAM,EAAE,mDAAwB;gBAChC,YAAY,EAAE,mBAAmB;aACpC;YACD;gBACI,IAAI,EAAE,gBAAgB;gBACtB,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,mDAAwB;gBAChC,YAAY,EAAE,gBAAgB;aACjC;SACJ;KACJ;CACJ,CAAC;AAEO,4CAAgB"}
@@ -0,0 +1,6 @@
1
+ import { AbstractHistoryRouter } from "@golemio/core/dist/output-gateway/routes/AbstractHistoryRouter";
2
+ import { ValidationChain } from "express-validator/check";
3
+ export default class AirQualityHistoryRouter extends AbstractHistoryRouter {
4
+ constructor();
5
+ protected GetIdQueryParamWithCorrectType: () => Promise<ValidationChain>;
6
+ }
@@ -0,0 +1,27 @@
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
+ const AbstractHistoryRouter_1 = require("@golemio/core/dist/output-gateway/routes/AbstractHistoryRouter");
16
+ const check_1 = require("express-validator/check");
17
+ const AirQualityHistoryModel_1 = __importDefault(require("./models/AirQualityHistoryModel"));
18
+ class AirQualityHistoryRouter extends AbstractHistoryRouter_1.AbstractHistoryRouter {
19
+ constructor() {
20
+ super(new AirQualityHistoryModel_1.default());
21
+ this.GetIdQueryParamWithCorrectType = () => __awaiter(this, void 0, void 0, function* () {
22
+ return (0, check_1.query)("sensorId.*").optional().isString();
23
+ });
24
+ }
25
+ }
26
+ exports.default = AirQualityHistoryRouter;
27
+ //# sourceMappingURL=AirQualityHistoryRouter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AirQualityHistoryRouter.js","sourceRoot":"","sources":["../../src/output-gateway/AirQualityHistoryRouter.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,0GAAuG;AACvG,mDAAiE;AACjE,6FAA2D;AAE3D,MAAqB,uBAAwB,SAAQ,6CAAqB;IACtE;QACI,KAAK,CAAC,IAAI,gCAAY,EAAE,CAAC,CAAC;QAGpB,mCAA8B,GAAG,GAAmC,EAAE;YAC5E,OAAO,IAAA,aAAK,EAAC,YAAY,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE,CAAC;QACrD,CAAC,CAAA,CAAC;IAJF,CAAC;CAKJ;AARD,0CAQC"}
@@ -0,0 +1,13 @@
1
+ /// <reference types="express" />
2
+ import { GeoJsonRouter } from "@golemio/core/dist/output-gateway";
3
+ import { NextFunction, Request, Response, Router } from "@golemio/core/dist/shared/express";
4
+ export default class AirQualityRouter extends GeoJsonRouter {
5
+ router: Router;
6
+ private airQualityComponentTypes;
7
+ private airQualityIndexTypes;
8
+ constructor();
9
+ GetIndexTypes: (req: Request, res: Response, next: NextFunction) => Promise<void>;
10
+ GetComponentTypes: (req: Request, res: Response, next: any) => Promise<void>;
11
+ }
12
+ declare const airQualityRouter: Router;
13
+ export { airQualityRouter };
@@ -0,0 +1,57 @@
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.airQualityRouter = void 0;
16
+ const output_gateway_1 = require("@golemio/core/dist/output-gateway");
17
+ const express_1 = require("@golemio/core/dist/shared/express");
18
+ const AirQualityHistoryRouter_1 = __importDefault(require("./AirQualityHistoryRouter"));
19
+ const AirQualityComponentTypes_1 = __importDefault(require("./models/AirQualityComponentTypes"));
20
+ const AirQualityIndexesModel_1 = __importDefault(require("./models/AirQualityIndexesModel"));
21
+ const AirQualityIndexTypesModel_1 = __importDefault(require("./models/AirQualityIndexTypesModel"));
22
+ class AirQualityRouter extends output_gateway_1.GeoJsonRouter {
23
+ constructor() {
24
+ super(new AirQualityIndexesModel_1.default());
25
+ this.router = (0, express_1.Router)();
26
+ this.GetIndexTypes = (req, res, next) => __awaiter(this, void 0, void 0, function* () {
27
+ try {
28
+ const data = yield this.airQualityIndexTypes.GetAll();
29
+ res.status(200).send(data);
30
+ }
31
+ catch (err) {
32
+ next(err);
33
+ }
34
+ });
35
+ this.GetComponentTypes = (req, res, next) => __awaiter(this, void 0, void 0, function* () {
36
+ try {
37
+ const data = yield this.airQualityComponentTypes.GetAll();
38
+ res.status(200).send(data);
39
+ }
40
+ catch (err) {
41
+ next(err);
42
+ }
43
+ });
44
+ this.initRoutes();
45
+ this.router.get("/indextypes", (0, output_gateway_1.useCacheMiddleware)(), this.GetIndexTypes);
46
+ this.router.get("/componenttypes", (0, output_gateway_1.useCacheMiddleware)(), this.GetComponentTypes);
47
+ this.airQualityComponentTypes = new AirQualityComponentTypes_1.default();
48
+ this.airQualityIndexTypes = new AirQualityIndexTypesModel_1.default();
49
+ const historyRouter = new AirQualityHistoryRouter_1.default();
50
+ historyRouter.initRoutes();
51
+ this.router.use("/history", historyRouter.router);
52
+ }
53
+ }
54
+ exports.default = AirQualityRouter;
55
+ const airQualityRouter = new AirQualityRouter().router;
56
+ exports.airQualityRouter = airQualityRouter;
57
+ //# sourceMappingURL=AirQualityRouter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AirQualityRouter.js","sourceRoot":"","sources":["../../src/output-gateway/AirQualityRouter.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,sEAAsF;AACtF,+DAA4F;AAC5F,wFAAgE;AAChE,iGAA6E;AAC7E,6FAAqE;AACrE,mGAA2E;AAE3E,MAAqB,gBAAiB,SAAQ,8BAAa;IAKvD;QACI,KAAK,CAAC,IAAI,gCAAsB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G,CAAC,UAAU,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;IACtD,CAAC;CAmBJ;AApCD,mCAoCC;AAED,MAAM,gBAAgB,GAAW,IAAI,gBAAgB,EAAE,CAAC,MAAM,CAAC;AAEtD,4CAAgB"}
@@ -0,0 +1 @@
1
+ export * from "./AirQualityRouter";
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
+ }) : (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ o[k2] = m[k];
8
+ }));
9
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
+ };
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ __exportStar(require("./AirQualityRouter"), exports);
14
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/output-gateway/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAAmC"}
@@ -0,0 +1,6 @@
1
+ import { SequelizeModel } from "@golemio/core/dist/output-gateway";
2
+ export default class AirQualityComponentTypeModel extends SequelizeModel {
3
+ constructor();
4
+ GetAll: (options?: any) => Promise<any>;
5
+ GetOne(id: any): Promise<any>;
6
+ }
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const AirQualityComponentType_1 = require("../../schema-definitions/sequelize-models/AirQualityComponentType");
4
+ const output_gateway_1 = require("@golemio/core/dist/output-gateway");
5
+ class AirQualityComponentTypeModel extends output_gateway_1.SequelizeModel {
6
+ constructor() {
7
+ super("AirQualityComponentTypesModel", "airqualitystations_component_types", AirQualityComponentType_1.AirQualityComponentType.attributeModel);
8
+ this.GetAll = (options) => {
9
+ return this.sequelizeModel.findAll();
10
+ };
11
+ }
12
+ GetOne(id) {
13
+ throw new Error("Method not implemented.");
14
+ }
15
+ }
16
+ exports.default = AirQualityComponentTypeModel;
17
+ //# sourceMappingURL=AirQualityComponentTypes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AirQualityComponentTypes.js","sourceRoot":"","sources":["../../../src/output-gateway/models/AirQualityComponentTypes.ts"],"names":[],"mappings":";;AAAA,+GAAwF;AACxF,sEAAmE;AAEnE,MAAqB,4BAA6B,SAAQ,+BAAc;IACpE;QACI,KAAK,CAAC,+BAA+B,EAAE,oCAAoC,EAAE,iDAAuB,CAAC,cAAc,CAAC,CAAC;QAGlH,WAAM,GAAG,CAAC,OAAa,EAAgB,EAAE;YAC5C,OAAO,IAAI,CAAC,cAAc,CAAC,OAAO,EAA2B,CAAC;QAClE,CAAC,CAAC;IAJF,CAAC;IAMD,MAAM,CAAC,EAAO;QACV,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;IAC/C,CAAC;CACJ;AAZD,+CAYC"}
@@ -0,0 +1,10 @@
1
+ import { SequelizeModel } from "@golemio/core/dist/output-gateway";
2
+ import { IBaseModel } from "@golemio/core/dist/output-gateway/models/interfaces/IBaseModel";
3
+ import IHistoryFilterParameters from "@golemio/core/dist/output-gateway/routes/interfaces/IHistoryFilterParameters";
4
+ export default class HistoryModel extends SequelizeModel implements IBaseModel {
5
+ private stationModel;
6
+ private measurementsModel;
7
+ constructor();
8
+ GetAll: (options?: IHistoryFilterParameters | undefined) => Promise<any>;
9
+ GetOne(id: any): Promise<any>;
10
+ }
@@ -0,0 +1,84 @@
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
+ const _sch_1 = require("../../schema-definitions");
16
+ const output_gateway_1 = require("@golemio/core/dist/output-gateway");
17
+ const sequelize_1 = __importDefault(require("@golemio/core/dist/shared/sequelize"));
18
+ const AirQualityMeasurementsModel_1 = __importDefault(require("./AirQualityMeasurementsModel"));
19
+ const AirQualityStationsModel_1 = __importDefault(require("./AirQualityStationsModel"));
20
+ const HistoryModelHelper_1 = __importDefault(require("./helpers/HistoryModelHelper"));
21
+ const OutputDtoMapper_1 = __importDefault(require("./helpers/OutputDtoMapper"));
22
+ const ParamHelper_1 = require("./helpers/ParamHelper");
23
+ class HistoryModel extends output_gateway_1.SequelizeModel {
24
+ constructor() {
25
+ super(_sch_1.AirQualityStations.indexes.name + "Model", _sch_1.AirQualityStations.indexes.pgTableName, _sch_1.AirQualityStations.indexes.outputSequelizeAttributes);
26
+ this.GetAll = (options) => __awaiter(this, void 0, void 0, function* () {
27
+ const result = yield this.sequelizeModel.findAll({
28
+ attributes: {
29
+ include: ["updated_at"],
30
+ },
31
+ include: [
32
+ {
33
+ model: this.stationModel.sequelizeModel,
34
+ attributes: {
35
+ include: ["updated_at"],
36
+ },
37
+ as: "station",
38
+ required: true,
39
+ where: {
40
+ [sequelize_1.default.Op.and]: [
41
+ { region_code: "A" },
42
+ ...HistoryModelHelper_1.default.filterByStationId(options),
43
+ ],
44
+ },
45
+ },
46
+ {
47
+ model: this.measurementsModel.sequelizeModel,
48
+ where: sequelize_1.default.literal(`airqualitystations_indexes.measured_from = measurements.measured_from
49
+ and airqualitystations_indexes.measured_to = measurements.measured_to`),
50
+ as: "measurements",
51
+ },
52
+ ],
53
+ where: options
54
+ ? {
55
+ [sequelize_1.default.Op.and]: [
56
+ ...HistoryModelHelper_1.default.filterByMeasuredFrom(options),
57
+ ...HistoryModelHelper_1.default.filterByMeasuredTo(options),
58
+ ],
59
+ }
60
+ : {},
61
+ limit: ParamHelper_1.ParamHelper.getPaginationLimit(options === null || options === void 0 ? void 0 : options.limit),
62
+ offset: Number.isInteger(options === null || options === void 0 ? void 0 : options.offset) ? options === null || options === void 0 ? void 0 : options.offset : 0,
63
+ });
64
+ return result.map((element) => OutputDtoMapper_1.default.mapToHistoricItem(element));
65
+ });
66
+ this.stationModel = new AirQualityStationsModel_1.default();
67
+ this.measurementsModel = new AirQualityMeasurementsModel_1.default();
68
+ this.sequelizeModel.hasOne(this.stationModel.sequelizeModel, {
69
+ sourceKey: "station_id",
70
+ foreignKey: "id",
71
+ as: "station",
72
+ });
73
+ this.sequelizeModel.hasMany(this.measurementsModel.sequelizeModel, {
74
+ sourceKey: "station_id",
75
+ foreignKey: "station_id",
76
+ as: "measurements",
77
+ });
78
+ }
79
+ GetOne(id) {
80
+ throw new Error("Method not implemented.");
81
+ }
82
+ }
83
+ exports.default = HistoryModel;
84
+ //# sourceMappingURL=AirQualityHistoryModel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AirQualityHistoryModel.js","sourceRoot":"","sources":["../../../src/output-gateway/models/AirQualityHistoryModel.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,mDAA0C;AAE1C,sEAAmE;AAGnE,oFAA4D;AAC5D,gGAAwE;AACxE,wFAAgE;AAChE,sFAAoE;AACpE,gFAAwD;AACxD,uDAAoD;AAEpD,MAAqB,YAAa,SAAQ,+BAAc;IAIpD;QACI,KAAK,CACD,yBAAkB,CAAC,OAAO,CAAC,IAAI,GAAG,OAAO,EACzC,yBAAkB,CAAC,OAAO,CAAC,WAAW,EACtC,yBAAkB,CAAC,OAAO,CAAC,yBAAyB,CACvD,CAAC;Q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,CAAC;YAEH,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,yBAAe,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC,CAAC;QAC/E,CAAC,CAAA,CAAC;QA1DE,IAAI,CAAC,YAAY,GAAG,IAAI,iCAAuB,EAAE,CAAC;QAClD,IAAI,CAAC,iBAAiB,GAAG,IAAI,qCAA2B,EAAE,CAAC;QAE3D,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,cAAc,EAAE;YACzD,SAAS,EAAE,YAAY;YACvB,UAAU,EAAE,IAAI;YAChB,EAAE,EAAE,SAAS;SAChB,CAAC,CAAC;QAEH,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,IAAI,CAAC,iBAAiB,CAAC,cAAc,EAAE;YAC/D,SAAS,EAAE,YAAY;YACvB,UAAU,EAAE,YAAY;YACxB,EAAE,EAAE,cAAc;SACrB,CAAC,CAAC;IACP,CAAC;IA8CM,MAAM,CAAC,EAAO;QACjB,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;IAC/C,CAAC;CACJ;AA1ED,+BA0EC"}
@@ -0,0 +1,6 @@
1
+ import { SequelizeModel } from "@golemio/core/dist/output-gateway";
2
+ export default class AirQualityIndexTypeModel extends SequelizeModel {
3
+ constructor();
4
+ GetAll: (options?: any) => Promise<any>;
5
+ GetOne(id: any): Promise<any>;
6
+ }
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const AirQualityIndexType_1 = require("../../schema-definitions/sequelize-models/AirQualityIndexType");
4
+ const output_gateway_1 = require("@golemio/core/dist/output-gateway");
5
+ class AirQualityIndexTypeModel extends output_gateway_1.SequelizeModel {
6
+ constructor() {
7
+ super("AirQualityIndexTypesModel", "airqualitystations_index_types", AirQualityIndexType_1.AirQualityIndexType.attributeModel);
8
+ this.GetAll = (options) => {
9
+ return this.sequelizeModel.findAll();
10
+ };
11
+ }
12
+ GetOne(id) {
13
+ throw new Error("Method not implemented.");
14
+ }
15
+ }
16
+ exports.default = AirQualityIndexTypeModel;
17
+ //# sourceMappingURL=AirQualityIndexTypesModel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AirQualityIndexTypesModel.js","sourceRoot":"","sources":["../../../src/output-gateway/models/AirQualityIndexTypesModel.ts"],"names":[],"mappings":";;AACA,uGAAgF;AAChF,sEAAmE;AAEnE,MAAqB,wBAAyB,SAAQ,+BAAc;IAChE;QACI,KAAK,CAAC,2BAA2B,EAAE,gCAAgC,EAAE,yCAAmB,CAAC,cAAc,CAAC,CAAC;QAGtG,WAAM,GAAG,CAAC,OAAa,EAAgB,EAAE;YAC5C,OAAO,IAAI,CAAC,cAAc,CAAC,OAAO,EAA2B,CAAC;QAClE,CAAC,CAAC;IAJF,CAAC;IAMD,MAAM,CAAC,EAAO;QACV,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;IAC/C,CAAC;CACJ;AAZD,2CAYC"}
@@ -0,0 +1,9 @@
1
+ import { IGeoJsonAllFilterParameters, SequelizeModel } from "@golemio/core/dist/output-gateway";
2
+ import { IGeoJsonModel } from "@golemio/core/dist/output-gateway/models/interfaces/IGeoJsonModel";
3
+ export default class AirQualityIndexesModel extends SequelizeModel implements IGeoJsonModel {
4
+ constructor();
5
+ GetAll: (options?: IGeoJsonAllFilterParameters | undefined) => Promise<any>;
6
+ GetOne(id: any): Promise<any>;
7
+ IsPrimaryIdNumber(idKey: string): Promise<boolean>;
8
+ PrimaryIdentifierSelection(arg0: string): object;
9
+ }
@@ -0,0 +1,55 @@
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
+ const RawQueryProvider_1 = require("./helpers/RawQueryProvider");
16
+ const index_1 = require("../../schema-definitions/index");
17
+ const output_gateway_1 = require("@golemio/core/dist/output-gateway");
18
+ const sequelize_1 = require("@golemio/core/dist/shared/sequelize");
19
+ const OutputDtoMapper_1 = __importDefault(require("./helpers/OutputDtoMapper"));
20
+ const ParamHelper_1 = require("./helpers/ParamHelper");
21
+ class AirQualityIndexesModel extends output_gateway_1.SequelizeModel {
22
+ constructor() {
23
+ super(index_1.AirQualityStations.indexes.name + "BaseModel", index_1.AirQualityStations.indexes.pgTableName, index_1.AirQualityStations.indexes.outputSequelizeAttributes);
24
+ this.GetAll = (options) => __awaiter(this, void 0, void 0, function* () {
25
+ var _a;
26
+ const result = yield ((_a = this.sequelizeModel.sequelize) === null || _a === void 0 ? void 0 : _a.query((0, RawQueryProvider_1.buildIndexesQuery)(options), {
27
+ type: sequelize_1.QueryTypes.SELECT,
28
+ nest: true,
29
+ raw: true,
30
+ replacements: {
31
+ districts: options === null || options === void 0 ? void 0 : options.districts,
32
+ updatedAt: options === null || options === void 0 ? void 0 : options.updatedSince,
33
+ longitude: options === null || options === void 0 ? void 0 : options.lng,
34
+ latitude: options === null || options === void 0 ? void 0 : options.lat,
35
+ range: options === null || options === void 0 ? void 0 : options.range,
36
+ limit: ParamHelper_1.ParamHelper.getPaginationLimit(options === null || options === void 0 ? void 0 : options.limit),
37
+ offset: Number.isInteger(options === null || options === void 0 ? void 0 : options.offset) ? options === null || options === void 0 ? void 0 : options.offset : 0,
38
+ },
39
+ }));
40
+ return (0, output_gateway_1.buildGeojsonFeatureCollection)(result === null || result === void 0 ? void 0 : result.map((element) => OutputDtoMapper_1.default.mapToFeatureItem(element)));
41
+ });
42
+ }
43
+ GetOne(id) {
44
+ throw new Error("Method not implemented.");
45
+ }
46
+ //backwards compatibility
47
+ IsPrimaryIdNumber(idKey) {
48
+ return Promise.resolve(false);
49
+ }
50
+ PrimaryIdentifierSelection(arg0) {
51
+ return { station_id: arg0 };
52
+ }
53
+ }
54
+ exports.default = AirQualityIndexesModel;
55
+ //# sourceMappingURL=AirQualityIndexesModel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AirQualityIndexesModel.js","sourceRoot":"","sources":["../../../src/output-gateway/models/AirQualityIndexesModel.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,iEAAwE;AACxE,0DAAgD;AAEhD,sEAA+H;AAE/H,mEAAiE;AACjE,gFAAwD;AACxD,uDAAoD;AAEpD,MAAqB,sBAAuB,SAAQ,+BAAc;IAC9D;QACI,KAAK,CACD,0BAAkB,CAAC,OAAO,CAAC,IAAI,GAAG,WAAW,EAC7C,0BAAkB,CAAC,OAAO,CAAC,WAAW,EACtC,0BAAkB,CAAC,OAAO,CAAC,yBAAyB,CACvD,CAAC;QAGC,WAAM,GAAG,CAAO,OAAqC,EAAgB,EAAE;;YAC1E,MAAM,MAAM,GAAG,MAAM,CAAA,MAAA,IAAI,CAAC,cAAc,CAAC,SAAS,0CAAE,KAAK,CAAkB,IAAA,oCAAiB,EAAC,OAAO,CAAC,EAAE;gBACnG,IAAI,EAAE,sBAAU,CAAC,MAAM;gBACvB,IAAI,EAAE,IAAI;gBACV,GAAG,EAAE,IAAI;gBACT,YAAY,EAAE;oBACV,SAAS,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,SAAS;oBAC7B,SAAS,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,YAAY;oBAChC,SAAS,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,GAAG;oBACvB,QAAQ,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,GAAG;oBACtB,KAAK,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,KAAK;oBACrB,KAAK,EAAE,yBAAW,CAAC,kBAAkB,CAAC,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,KAAK,CAAC;oBACrD,MAAM,EAAE,MAAM,CAAC,SAAS,CAAC,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,MAAM,CAAC,CAAC,CAAC,CAAC,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,MAAM,CAAC,CAAC,CAAC,CAAC;iBAClE;aACJ,CAAC,CAAA,CAAC;YAEH,OAAO,IAAA,8CAA6B,EAAC,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,yBAAe,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;QAC9G,CAAC,CAAA,CAAC;IAnBF,CAAC;IAqBD,MAAM,CAAC,EAAO;QACV,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;IAC/C,CAAC;IAED,yBAAyB;IACzB,iBAAiB,CAAC,KAAa;QAC3B,OAAO,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IAClC,CAAC;IAED,0BAA0B,CAAC,IAAY;QACnC,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC;IAChC,CAAC;CACJ;AAxCD,yCAwCC"}
@@ -0,0 +1,6 @@
1
+ import { SequelizeModel } from "@golemio/core/dist/output-gateway";
2
+ export default class AirQualityMeasurementsModel extends SequelizeModel {
3
+ constructor();
4
+ GetAll(options?: any): Promise<any>;
5
+ GetOne(id: any): Promise<any>;
6
+ }
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const index_1 = require("../../schema-definitions/index");
4
+ const output_gateway_1 = require("@golemio/core/dist/output-gateway");
5
+ class AirQualityMeasurementsModel extends output_gateway_1.SequelizeModel {
6
+ constructor() {
7
+ super(index_1.AirQualityStations.measurements.name + "Model", index_1.AirQualityStations.measurements.pgTableName, index_1.AirQualityStations.measurements.outputSequelizeAttributes);
8
+ }
9
+ GetAll(options) {
10
+ throw new Error("Method not implemented.");
11
+ }
12
+ GetOne(id) {
13
+ throw new Error("Method not implemented.");
14
+ }
15
+ }
16
+ exports.default = AirQualityMeasurementsModel;
17
+ //# sourceMappingURL=AirQualityMeasurementsModel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AirQualityMeasurementsModel.js","sourceRoot":"","sources":["../../../src/output-gateway/models/AirQualityMeasurementsModel.ts"],"names":[],"mappings":";;AAAA,0DAAgD;AAChD,sEAAmE;AAEnE,MAAqB,2BAA4B,SAAQ,+BAAc;IACnE;QACI,KAAK,CACD,0BAAkB,CAAC,YAAY,CAAC,IAAI,GAAG,OAAO,EAC9C,0BAAkB,CAAC,YAAY,CAAC,WAAW,EAC3C,0BAAkB,CAAC,YAAY,CAAC,yBAAyB,CAC5D,CAAC;IACN,CAAC;IAED,MAAM,CAAC,OAAa;QAChB,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;IAC/C,CAAC;IACD,MAAM,CAAC,EAAO;QACV,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;IAC/C,CAAC;CACJ;AAfD,8CAeC"}
@@ -0,0 +1,6 @@
1
+ import { IGeoJsonAllFilterParameters, SequelizeModel } from "@golemio/core/dist/output-gateway";
2
+ export default class AirQualityStationsModel extends SequelizeModel {
3
+ constructor();
4
+ GetAll: (options?: IGeoJsonAllFilterParameters | undefined) => Promise<any>;
5
+ GetOne(id: any): Promise<any>;
6
+ }
@@ -0,0 +1,26 @@
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
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ const index_1 = require("../../schema-definitions/index");
13
+ const output_gateway_1 = require("@golemio/core/dist/output-gateway");
14
+ class AirQualityStationsModel extends output_gateway_1.SequelizeModel {
15
+ constructor() {
16
+ super(index_1.AirQualityStations.stations.name + "Model", index_1.AirQualityStations.stations.pgTableName, index_1.AirQualityStations.stations.outputSequelizeAttributes);
17
+ this.GetAll = (options) => __awaiter(this, void 0, void 0, function* () {
18
+ throw new Error("Method not implemented.");
19
+ });
20
+ }
21
+ GetOne(id) {
22
+ throw new Error("Method not implemented.");
23
+ }
24
+ }
25
+ exports.default = AirQualityStationsModel;
26
+ //# sourceMappingURL=AirQualityStationsModel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AirQualityStationsModel.js","sourceRoot":"","sources":["../../../src/output-gateway/models/AirQualityStationsModel.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,0DAAgD;AAChD,sEAAgG;AAEhG,MAAqB,uBAAwB,SAAQ,+BAAc;IAC/D;QACI,KAAK,CACD,0BAAkB,CAAC,QAAQ,CAAC,IAAI,GAAG,OAAO,EAC1C,0BAAkB,CAAC,QAAQ,CAAC,WAAW,EACvC,0BAAkB,CAAC,QAAQ,CAAC,yBAAyB,CACxD,CAAC;QAGN,WAAM,GAAG,CAAO,OAAqC,EAAgB,EAAE;YACnE,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;QAC/C,CAAC,CAAA,CAAC;IAJF,CAAC;IAMD,MAAM,CAAC,EAAO;QACV,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;IAC/C,CAAC;CACJ;AAhBD,0CAgBC"}
@@ -0,0 +1,7 @@
1
+ import IHistoryFilterParameters from "@golemio/core/dist/output-gateway/routes/interfaces/IHistoryFilterParameters";
2
+ import { WhereOptions } from "@golemio/core/dist/shared/sequelize";
3
+ export default class HistoryModelHelper {
4
+ static filterByMeasuredFrom(options: IHistoryFilterParameters): WhereOptions[];
5
+ static filterByMeasuredTo(options: IHistoryFilterParameters): WhereOptions[];
6
+ static filterByStationId(options: IHistoryFilterParameters | undefined): WhereOptions[];
7
+ }
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const sequelize_1 = require("@golemio/core/dist/shared/sequelize");
4
+ class HistoryModelHelper {
5
+ static filterByMeasuredFrom(options) {
6
+ return options.from && Number.isInteger(options.from)
7
+ ? [
8
+ {
9
+ measured_from: { [sequelize_1.Op.gte]: options.from },
10
+ },
11
+ ]
12
+ : [];
13
+ }
14
+ static filterByMeasuredTo(options) {
15
+ return options.to && Number.isInteger(options.to)
16
+ ? [
17
+ {
18
+ measured_to: { [sequelize_1.Op.lt]: options.to },
19
+ },
20
+ ]
21
+ : [];
22
+ }
23
+ static filterByStationId(options) {
24
+ return (options === null || options === void 0 ? void 0 : options.sensorId)
25
+ ? [
26
+ {
27
+ station_vendor_id: options.sensorId,
28
+ },
29
+ ]
30
+ : [];
31
+ }
32
+ }
33
+ exports.default = HistoryModelHelper;
34
+ //# sourceMappingURL=HistoryModelHelper.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HistoryModelHelper.js","sourceRoot":"","sources":["../../../../src/output-gateway/models/helpers/HistoryModelHelper.ts"],"names":[],"mappings":";;AACA,mEAAuE;AAEvE,MAAqB,kBAAkB;IAC5B,MAAM,CAAC,oBAAoB,CAAC,OAAiC;QAChE,OAAO,OAAO,CAAC,IAAI,IAAI,MAAM,CAAC,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC;YACjD,CAAC,CAAC;gBACI;oBACI,aAAa,EAAE,EAAE,CAAC,cAAE,CAAC,GAAG,CAAC,EAAE,OAAO,CAAC,IAAI,EAAE;iBAC5C;aACJ;YACH,CAAC,CAAC,EAAE,CAAC;IACb,CAAC;IAEM,MAAM,CAAC,kBAAkB,CAAC,OAAiC;QAC9D,OAAO,OAAO,CAAC,EAAE,IAAI,MAAM,CAAC,SAAS,CAAC,OAAO,CAAC,EAAE,CAAC;YAC7C,CAAC,CAAC;gBACI;oBACI,WAAW,EAAE,EAAE,CAAC,cAAE,CAAC,EAAE,CAAC,EAAE,OAAO,CAAC,EAAE,EAAE;iBACvC;aACJ;YACH,CAAC,CAAC,EAAE,CAAC;IACb,CAAC;IAEM,MAAM,CAAC,iBAAiB,CAAC,OAA6C;QACzE,OAAO,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,QAAQ;YACpB,CAAC,CAAC;gBACI;oBACI,iBAAiB,EAAE,OAAO,CAAC,QAAQ;iBACtC;aACJ;YACH,CAAC,CAAC,EAAE,CAAC;IACb,CAAC;CACJ;AA9BD,qCA8BC"}
@@ -0,0 +1,7 @@
1
+ import IAirQualityIndex from "../../../schema-definitions/sequelize-models/interfaces/IAirQualityIndex";
2
+ import { IGeoJSONFeature } from "@golemio/core/dist/output-gateway";
3
+ export default class OutputDtoMapper {
4
+ static mapToHistoricItem: (result: IAirQualityIndex) => any | undefined;
5
+ static mapToFeatureItem: (result: IAirQualityIndex) => IGeoJSONFeature | undefined;
6
+ private static mapToMeasurementDto;
7
+ }
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ class OutputDtoMapper {
4
+ static mapToMeasurementDto(indexCode, measurements) {
5
+ let measurement = {};
6
+ measurement.AQ_hourly_index = indexCode;
7
+ measurement.components = measurements
8
+ .filter((element) => element.value) // do not show null values
9
+ .map((element) => {
10
+ return {
11
+ averaged_time: {
12
+ // atm we get intervals only 1h, 3h, 24h, removes h at the end
13
+ averaged_hours: element.aggregation_interval.endsWith("h")
14
+ ? element.aggregation_interval.slice(0, -1)
15
+ : element.aggregation_interval,
16
+ value: element.value,
17
+ },
18
+ type: element.component_code,
19
+ };
20
+ });
21
+ return measurement;
22
+ }
23
+ }
24
+ exports.default = OutputDtoMapper;
25
+ OutputDtoMapper.mapToHistoricItem = (result) => {
26
+ if (!result || !result.station || !result.measurements)
27
+ return undefined;
28
+ let output = {};
29
+ output.id = result.station.station_vendor_id;
30
+ output.measurement = OutputDtoMapper.mapToMeasurementDto(result.index_code, result.measurements);
31
+ output.updated_at = result.station.updated_at;
32
+ return output;
33
+ };
34
+ OutputDtoMapper.mapToFeatureItem = (result) => {
35
+ if (!result || !result.station || !result.measurements)
36
+ return undefined;
37
+ let output = {};
38
+ output.geometry = {};
39
+ output.geometry.coordinates = [result.station.longitude, result.station.latitude];
40
+ output.geometry.type = "Point";
41
+ output.properties = {};
42
+ output.properties.measurement = OutputDtoMapper.mapToMeasurementDto(result.index_code, result.measurements);
43
+ output.properties.id = result.station.station_vendor_id;
44
+ output.properties.name = result.station.station_name;
45
+ output.properties.updated_at = result.station.updated_at;
46
+ output.properties.district = result.station.district;
47
+ output.type = "Feature";
48
+ return output;
49
+ };
50
+ //# sourceMappingURL=OutputDtoMapper.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OutputDtoMapper.js","sourceRoot":"","sources":["../../../../src/output-gateway/models/helpers/OutputDtoMapper.ts"],"names":[],"mappings":";;AAIA,MAAqB,eAAe;IA8BxB,MAAM,CAAC,mBAAmB,CAAC,SAAiB,EAAE,YAAsC;QACxF,IAAI,WAAW,GAAG,EAAS,CAAC;QAC5B,WAAW,CAAC,eAAe,GAAG,SAAS,CAAC;QACxC,WAAW,CAAC,UAAU,GAAG,YAAY;aAChC,MAAM,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,0BAA0B;aAC7D,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE;YACb,OAAO;g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,QAAQ,CAAC,CAAC;IAClF,MAAM,CAAC,QAAQ,CAAC,IAAI,GAAG,OAAO,CAAC;IAC/B,MAAM,CAAC,UAAU,GAAG,EAAS,CAAC;IAC9B,MAAM,CAAC,UAAU,CAAC,WAAW,GAAG,eAAe,CAAC,mBAAmB,CAAC,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC,YAAY,CAAC,CAAC;IAC5G,MAAM,CAAC,UAAU,CAAC,EAAE,GAAG,MAAM,CAAC,OAAO,CAAC,iBAAiB,CAAC;IACxD,MAAM,CAAC,UAAU,CAAC,IAAI,GAAG,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC;IACrD,MAAM,CAAC,UAAU,CAAC,UAAU,GAAG,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC;IACzD,MAAM,CAAC,UAAU,CAAC,QAAQ,GAAG,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC;IACrD,MAAM,CAAC,IAAI,GAAG,SAAS,CAAC;IAExB,OAAO,MAAM,CAAC;AAClB,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ export declare class ParamHelper {
2
+ static getPaginationLimit(queryLimit: number | undefined): number;
3
+ }
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ParamHelper = void 0;
4
+ const config_1 = require("@golemio/core/dist/output-gateway/config");
5
+ class ParamHelper {
6
+ static getPaginationLimit(queryLimit) {
7
+ return queryLimit != undefined &&
8
+ Number.isInteger(queryLimit) &&
9
+ queryLimit < config_1.config.pagination_max_limit &&
10
+ queryLimit >= 0
11
+ ? queryLimit
12
+ : config_1.config.pagination_max_limit;
13
+ }
14
+ }
15
+ exports.ParamHelper = ParamHelper;
16
+ //# sourceMappingURL=ParamHelper.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ParamHelper.js","sourceRoot":"","sources":["../../../../src/output-gateway/models/helpers/ParamHelper.ts"],"names":[],"mappings":";;;AAAA,qEAAkE;AAElE,MAAa,WAAW;IACb,MAAM,CAAC,kBAAkB,CAAC,UAA8B;QAC3D,OAAO,UAAU,IAAI,SAAS;YAC1B,MAAM,CAAC,SAAS,CAAC,UAAU,CAAC;YAC5B,UAAU,GAAG,eAAM,CAAC,oBAAoB;YACxC,UAAU,IAAI,CAAC;YACf,CAAC,CAAC,UAAU;YACZ,CAAC,CAAC,eAAM,CAAC,oBAAoB,CAAC;IACtC,CAAC;CACJ;AATD,kCASC"}
@@ -0,0 +1,2 @@
1
+ import { IGeoJsonAllFilterParameters } from "@golemio/core/dist/output-gateway";
2
+ export declare const buildIndexesQuery: (options: IGeoJsonAllFilterParameters | undefined) => string;
@@ -0,0 +1,86 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.buildIndexesQuery = void 0;
4
+ const allIndexes = `
5
+ select
6
+ "aqi"."index_code",
7
+ "aqi"."measured_from",
8
+ "aqi"."measured_to",
9
+ "aqi"."station_id",
10
+ "aqi"."updated_at",
11
+ "stations"."classification" as "station.classification",
12
+ "stations"."id" as "station.id",
13
+ "stations"."latitude" as "station.latitude",
14
+ "stations"."longitude" as "station.longitude",
15
+ "stations"."owner" as "station.owner",
16
+ "stations"."region_code" as "station.region_code",
17
+ "stations"."region_name" as "station.region_name",
18
+ "stations"."state_code" as "station.state_code",
19
+ "stations"."state_name" as "station.state_name",
20
+ "stations"."station_name" as "station.station_name",
21
+ "stations"."station_vendor_id" as "station.station_vendor_id",
22
+ "stations"."district" as "station.district",
23
+ "stations"."create_batch_id" as "station.create_batch_id",
24
+ "stations"."created_at" as "station.created_at",
25
+ "stations"."created_by" as "station.created_by",
26
+ "stations"."update_batch_id" as "station.update_batch_id",
27
+ "stations"."updated_at" as "station.updated_at",
28
+ "stations"."updated_by" as "station.updated_by",
29
+ (SELECT json_agg(item) FROM (
30
+ select component_code, aggregation_interval, value
31
+ from airqualitystations_measurements am
32
+ where am.station_id = "currentData".station_id
33
+ and am.measured_from = "currentData".measured_from
34
+ and am.measured_to = "currentData".measured_to
35
+ ) item
36
+ ) AS "measurements"
37
+ |additionalColumns|
38
+ from
39
+ (select
40
+ station_id,
41
+ max(measured_from) as "measured_from",
42
+ max(measured_to) as "measured_to"
43
+ from
44
+ airqualitystations_indexes ai
45
+ where
46
+ station_id in (select id from airqualitystations a where a.region_code = 'A')
47
+ group by station_id) as "currentData"
48
+ inner join "airqualitystations" as "stations" on
49
+ "currentData"."station_id" = "stations"."id"
50
+ inner join "airqualitystations_indexes" as "aqi" on
51
+ "currentData"."station_id" = "aqi"."station_id"
52
+ and "currentData"."measured_from" = "aqi"."measured_from"
53
+ and "currentData"."measured_to" = "aqi"."measured_to"`;
54
+ const whereUpdateAt = `"stations"."updated_at" > :updatedAt`;
55
+ const whereInRange = `(ST_DWithin(
56
+ ST_SetSRID(ST_MakePoint("stations"."longitude","stations"."latitude"), 4326),
57
+ cast(ST_SetSRID(ST_MakePoint(:longitude, :latitude), 4326) as GEOGRAPHY),
58
+ :range
59
+ ))`;
60
+ const whereDistrict = `"stations"."district" in (:districts)`;
61
+ const distanceColumn = `,ST_Distance(
62
+ ST_SetSRID(ST_MakePoint("stations"."longitude","stations"."latitude"),4326),
63
+ cast(ST_SetSRID(ST_MakePoint(:longitude, :latitude), 4326) as GEOGRAPHY)
64
+ ) as "station.distance"`;
65
+ const orderBy = ` order by "station.distance" `;
66
+ const footerLimit = ` limit :limit`;
67
+ const footerOffset = ` offset :offset`;
68
+ const buildIndexesQuery = (options) => {
69
+ let preparedQuery = allIndexes;
70
+ preparedQuery = allIndexes.replace("|additionalColumns|", (options === null || options === void 0 ? void 0 : options.lng) && (options === null || options === void 0 ? void 0 : options.lat) ? distanceColumn : "");
71
+ let whereConditions = [];
72
+ if (options === null || options === void 0 ? void 0 : options.updatedSince)
73
+ whereConditions.push(whereUpdateAt);
74
+ if ((options === null || options === void 0 ? void 0 : options.lng) && options.lat && options.range)
75
+ whereConditions.push(whereInRange);
76
+ if (options === null || options === void 0 ? void 0 : options.districts)
77
+ whereConditions.push(whereDistrict);
78
+ preparedQuery = preparedQuery
79
+ .concat(...(whereConditions.length > 0 ? [" where ", whereConditions.join(" and ")] : ""))
80
+ .concat(Number.isInteger(options === null || options === void 0 ? void 0 : options.lng) && Number.isInteger(options === null || options === void 0 ? void 0 : options.lat) ? orderBy : "")
81
+ .concat(Number.isInteger(options === null || options === void 0 ? void 0 : options.limit) ? footerLimit : "")
82
+ .concat(Number.isInteger(options === null || options === void 0 ? void 0 : options.offset) ? footerOffset : "");
83
+ return preparedQuery;
84
+ };
85
+ exports.buildIndexesQuery = buildIndexesQuery;
86
+ //# sourceMappingURL=RawQueryProvider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RawQueryProvider.js","sourceRoot":"","sources":["../../../../src/output-gateway/models/helpers/RawQueryProvider.ts"],"names":[],"mappings":";;;AAEA,MAAM,UAAU,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uDAiDoC,CAAC;AAExD,MAAM,aAAa,GAAG,sCAAsC,CAAC;AAC7D,MAAM,YAAY,GAAG;;;;GAIlB,CAAC;AACJ,MAAM,aAAa,GAAG,uCAAuC,CAAC;AAC9D,MAAM,cAAc,GAAG;;;wBAGC,CAAC;AACzB,MAAM,OAAO,GAAG,+BAA+B,CAAC;AAChD,MAAM,WAAW,GAAG,eAAe,CAAC;AACpC,MAAM,YAAY,GAAG,iBAAiB,CAAC;AAEhC,MAAM,iBAAiB,GAAG,CAAC,OAAgD,EAAU,EAAE;IAC1F,IAAI,aAAa,GAAG,UAAU,CAAC;IAC/B,aAAa,GAAG,UAAU,CAAC,OAAO,CAAC,qBAAqB,EAAE,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,GAAG,MAAI,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,GAAG,CAAA,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;IAE9G,IAAI,eAAe,GAA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: false,
187
187
  type: sequelize_1.default.STRING,
188
188
  },
189
+ district: {
190
+ allowNull: true,
191
+ type: sequelize_1.default.STRING,
192
+ },
189
193
  // ⬐ Auditni pole
190
194
  create_batch_id: { type: sequelize_1.default.BIGINT },
191
195
  created_at: { type: sequelize_1.default.DATE },
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/schema-definitions/index.ts"],"names":[],"mappings":";;;;;;AACA,oFAA4D;AAE5D,8BAA8B;AAC9B,yCAAyC;AAEzC,MAAM,oBAAoB,GAAG;IACzB,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE,CAAC,YAAY,EAAE,QAAQ,CAAC;IAClC,oBAAoB,EAAE,IAAI;IAC1B,UAAU,EAAE;QACR,UAAU,EAAE;YACR,IAAI,EAAE,QAAQ;SACjB;QACD,kBAAkB,EAAE;YAChB,IAAI,EAAE,SAAS;SAClB;QACD,OAAO,EAAE;YACL,IAAI,EAAE,SAAS;SAClB;QACD,IAAI,EAAE;YACF,IAAI,EAAE,QAAQ;SACjB;QACD,WAAW,EAAE;YACT,IAAI,EAAE,OAAO;YACb,eAAe,EAAE,IAAI;SACxB;QACD,WAAW,EAAE;YACT,IAAI,EAAE,OAAO;YACb,eAAe,EAAE,IAAI;SACxB;QACD,UAAU,EAAE;YACR,IAAI,EAAE,OAAO;YACb,eAAe,EAAE,IAAI;SACxB;QACD,MAAM,EAAE;YACJ,IAAI,EAAE,OAAO;YACb,eAAe,EAAE,KAAK;YACtB,KAAK,EAAE;gBACH,KAAK,EAAE;oBACH;wBACI,IAAI,EAAE,QAAQ;wBACd,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,aAAa,EAAE,WAAW,EAAE,SAAS,CAAC;wBAC/E,oBAAoB,EAAE,KAAK;wBAC3B,UAAU,EAAE;4BACR,IAAI,EAAE;gCACF,IAAI,EAAE,QAAQ;6BACjB;4BACD,IAAI,EAAE;gCACF,IAAI,EAAE,QAAQ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AG;IACd,qBAAqB;IACrB,OAAO,EAAE;QACL,mBAAmB,EAAE,4BAA4B;QACjD,IAAI,EAAE,2BAA2B;QACjC,0BAA0B,EAAE,gBAAgB;KAC/C;IACD,mBAAmB,EAAE,oBAAoB;IACzC,0BAA0B,EAAE,SAAS;IAErC,oBAAoB;IACpB,OAAO,EAAE;QACL,IAAI,EAAE,2BAA2B;QACjC,0BAA0B,EAAE,kCAAkC;QAC9D,yBAAyB,EAAE,mCAAmC;QAC9D,WAAW,EAAE,4BAA4B;KAC5C;IACD,YAAY,EAAE;QACV,IAAI,EAAE,gCAAgC;QACtC,0BAA0B,EAAE,uCAAuC;QACnE,yBAAyB,EAAE,wCAAwC;QACnE,WAAW,EAAE,iCAAiC;KACjD;IACD,IAAI,EAAE,oBAAoB;IAC1B,QAAQ,EAAE;QACN,IAAI,EAAE,oBAAoB;QAC1B,0BAA0B,EAAE,2BAA2B;QACvD,yBAAyB,EAAE,4BAA4B;QACvD,WAAW,EAAE,oBAAoB;KACpC;CACJ,CAAC;AAEoB,uCAAkB"}
@@ -0,0 +1,10 @@
1
+ import { Model, ModelAttributes } from "@golemio/core/dist/shared/sequelize";
2
+ import IAirQualityComponentType from "./interfaces/IAirQualityComponentType";
3
+ export declare class AirQualityComponentType extends Model<AirQualityComponentType> implements IAirQualityComponentType {
4
+ id: number;
5
+ component_code: string;
6
+ unit: string;
7
+ description_cs: string;
8
+ description_en: string;
9
+ static attributeModel: ModelAttributes<AirQualityComponentType>;
10
+ }
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AirQualityComponentType = void 0;
4
+ const sequelize_1 = require("@golemio/core/dist/shared/sequelize");
5
+ class AirQualityComponentType extends sequelize_1.Model {
6
+ }
7
+ exports.AirQualityComponentType = AirQualityComponentType;
8
+ AirQualityComponentType.attributeModel = {
9
+ id: { type: sequelize_1.DataTypes.INTEGER, primaryKey: true },
10
+ component_code: { type: sequelize_1.DataTypes.TEXT },
11
+ unit: { type: sequelize_1.DataTypes.TEXT },
12
+ description_cs: { type: sequelize_1.DataTypes.TEXT },
13
+ description_en: { type: sequelize_1.DataTypes.TEXT },
14
+ };
15
+ //# sourceMappingURL=AirQualityComponentType.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AirQualityComponentType.js","sourceRoot":"","sources":["../../../src/schema-definitions/sequelize-models/AirQualityComponentType.ts"],"names":[],"mappings":";;;AAAA,mEAAwF;AAGxF,MAAa,uBAAwB,SAAQ,iBAA8B;;AAA3E,0DAcC;AAPiB,sCAAc,GAA6C;IACrE,EAAE,EAAE,EAAE,IAAI,EAAE,qBAAS,CAAC,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE;IACjD,cAAc,EAAE,EAAE,IAAI,EAAE,qBAAS,CAAC,IAAI,EAAE;IACxC,IAAI,EAAE,EAAE,IAAI,EAAE,qBAAS,CAAC,IAAI,EAAE;IAC9B,cAAc,EAAE,EAAE,IAAI,EAAE,qBAAS,CAAC,IAAI,EAAE;IACxC,cAAc,EAAE,EAAE,IAAI,EAAE,qBAAS,CAAC,IAAI,EAAE;CAC3C,CAAC"}
@@ -0,0 +1,13 @@
1
+ import { Model } from "@golemio/core/dist/shared/sequelize";
2
+ import IAirQualityIndex from "./interfaces/IAirQualityIndex";
3
+ import IAirQualityMeasurement from "./interfaces/IAirQualityMeasurement";
4
+ import IAirQualityStation from "./interfaces/IAirQualityStation";
5
+ export declare class AirQualityIndex extends Model<AirQualityIndex> implements IAirQualityIndex {
6
+ index_code: string;
7
+ measured_from: number;
8
+ measured_to: number;
9
+ station_id: string;
10
+ updated_at: string;
11
+ station?: IAirQualityStation;
12
+ measurements?: IAirQualityMeasurement[];
13
+ }
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AirQualityIndex = void 0;
4
+ const sequelize_1 = require("@golemio/core/dist/shared/sequelize");
5
+ class AirQualityIndex extends sequelize_1.Model {
6
+ }
7
+ exports.AirQualityIndex = AirQualityIndex;
8
+ //# sourceMappingURL=AirQualityIndex.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AirQualityIndex.js","sourceRoot":"","sources":["../../../src/schema-definitions/sequelize-models/AirQualityIndex.ts"],"names":[],"mappings":";;;AAAA,mEAA4D;AAK5D,MAAa,eAAgB,SAAQ,iBAAsB;CAS1D;AATD,0CASC"}
@@ -0,0 +1,13 @@
1
+ import { Model, ModelAttributes } from "@golemio/core/dist/shared/sequelize";
2
+ import IAirQualityIndexType from "./interfaces/IAirQualityIndexType";
3
+ export declare class AirQualityIndexType extends Model<AirQualityIndexType> implements IAirQualityIndexType {
4
+ id: number;
5
+ index_code: string;
6
+ limit_gte: string;
7
+ limit_lt: string;
8
+ color: string;
9
+ color_text: string;
10
+ description_cs: string;
11
+ description_en: string;
12
+ static attributeModel: ModelAttributes<AirQualityIndexType>;
13
+ }
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AirQualityIndexType = void 0;
4
+ const sequelize_1 = require("@golemio/core/dist/shared/sequelize");
5
+ class AirQualityIndexType extends sequelize_1.Model {
6
+ }
7
+ exports.AirQualityIndexType = AirQualityIndexType;
8
+ AirQualityIndexType.attributeModel = {
9
+ id: { type: sequelize_1.DataTypes.INTEGER, primaryKey: true },
10
+ index_code: { type: sequelize_1.DataTypes.TEXT },
11
+ limit_gte: { type: sequelize_1.DataTypes.TEXT },
12
+ limit_lt: { type: sequelize_1.DataTypes.TEXT },
13
+ color: { type: sequelize_1.DataTypes.TEXT },
14
+ color_text: { type: sequelize_1.DataTypes.TEXT },
15
+ description_cs: { type: sequelize_1.DataTypes.TEXT },
16
+ description_en: { type: sequelize_1.DataTypes.TEXT },
17
+ };
18
+ //# sourceMappingURL=AirQualityIndexType.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AirQualityIndexType.js","sourceRoot":"","sources":["../../../src/schema-definitions/sequelize-models/AirQualityIndexType.ts"],"names":[],"mappings":";;;AAAA,mEAAwF;AAGxF,MAAa,mBAAoB,SAAQ,iBAA0B;;AAAnE,kDAoBC;AAViB,kCAAc,GAAyC;IACjE,EAAE,EAAE,EAAE,IAAI,EAAE,qBAAS,CAAC,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE;IACjD,UAAU,EAAE,EAAE,IAAI,EAAE,qBAAS,CAAC,IAAI,EAAE;IACpC,SAAS,EAAE,EAAE,IAAI,EAAE,qBAAS,CAAC,IAAI,EAAE;IACnC,QAAQ,EAAE,EAAE,IAAI,EAAE,qBAAS,CAAC,IAAI,EAAE;IAClC,KAAK,EAAE,EAAE,IAAI,EAAE,qBAAS,CAAC,IAAI,EAAE;IAC/B,UAAU,EAAE,EAAE,IAAI,EAAE,qBAAS,CAAC,IAAI,EAAE;IACpC,cAAc,EAAE,EAAE,IAAI,EAAE,qBAAS,CAAC,IAAI,EAAE;IACxC,cAAc,EAAE,EAAE,IAAI,EAAE,qBAAS,CAAC,IAAI,EAAE;CAC3C,CAAC"}
@@ -0,0 +1,7 @@
1
+ export default interface IAirQualityComponentType {
2
+ id: number;
3
+ component_code: string;
4
+ unit: string;
5
+ description_cs: string;
6
+ description_en: string;
7
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=IAirQualityComponentType.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IAirQualityComponentType.js","sourceRoot":"","sources":["../../../../src/schema-definitions/sequelize-models/interfaces/IAirQualityComponentType.ts"],"names":[],"mappings":""}
@@ -0,0 +1,11 @@
1
+ import IAirQualityMeasurement from "./IAirQualityMeasurement";
2
+ import IAirQualityStation from "./IAirQualityStation";
3
+ export default interface IAirQualityIndex {
4
+ index_code: string;
5
+ measured_from: number;
6
+ measured_to: number;
7
+ station_id: string;
8
+ updated_at: string;
9
+ station?: IAirQualityStation;
10
+ measurements?: IAirQualityMeasurement[];
11
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=IAirQualityIndex.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IAirQualityIndex.js","sourceRoot":"","sources":["../../../../src/schema-definitions/sequelize-models/interfaces/IAirQualityIndex.ts"],"names":[],"mappings":""}
@@ -0,0 +1,10 @@
1
+ export default interface IAirQualityIndexType {
2
+ id: number;
3
+ index_code: string;
4
+ limit_gte: string;
5
+ limit_lt: string;
6
+ color: string;
7
+ color_text: string;
8
+ description_cs: string;
9
+ description_en: string;
10
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=IAirQualityIndexType.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IAirQualityIndexType.js","sourceRoot":"","sources":["../../../../src/schema-definitions/sequelize-models/interfaces/IAirQualityIndexType.ts"],"names":[],"mappings":""}
@@ -0,0 +1,8 @@
1
+ export default interface IAirQualityMeasurement {
2
+ aggregation_interval: string;
3
+ component_code: string;
4
+ measured_from: string;
5
+ measured_to: string;
6
+ station_id: string;
7
+ value: number | null;
8
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=IAirQualityMeasurement.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IAirQualityMeasurement.js","sourceRoot":"","sources":["../../../../src/schema-definitions/sequelize-models/interfaces/IAirQualityMeasurement.ts"],"names":[],"mappings":""}
@@ -0,0 +1,15 @@
1
+ export default interface IAirQualityStation {
2
+ classification: string;
3
+ id: string;
4
+ latitude: number;
5
+ longitude: number;
6
+ owner: string;
7
+ region_code: string;
8
+ region_name: string;
9
+ state_code: string;
10
+ state_name: string;
11
+ station_name: string;
12
+ station_vendor_id: string;
13
+ district: string;
14
+ updated_at: string;
15
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=IAirQualityStation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IAirQualityStation.js","sourceRoot":"","sources":["../../../../src/schema-definitions/sequelize-models/interfaces/IAirQualityStation.ts"],"names":[],"mappings":""}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@golemio/air-quality-stations",
3
- "version": "1.0.3-dev.427106071",
3
+ "version": "1.0.3-dev.509098240",
4
4
  "description": "Golemio Air Quality Stations Module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -12,7 +12,7 @@
12
12
  "test-debug": "run-s 'test --inspect-brk=9230'",
13
13
  "code-coverage": "nyc run-s 'test -r source-map-support/register'",
14
14
  "generate-docs": "typedoc --out docs/typedoc src",
15
- "lint": "eslint '{src,test}/**/*.ts'"
15
+ "lint": "eslint \"{src,test}/**/*.ts\""
16
16
  },
17
17
  "keywords": [
18
18
  "golemio"
@@ -26,7 +26,7 @@
26
26
  "devDependencies": {
27
27
  "@commitlint/cli": "^11.0.0",
28
28
  "@commitlint/config-conventional": "^11.0.0",
29
- "@golemio/core": "1.1.6",
29
+ "@golemio/core": "1.2.6-dev.508166941",
30
30
  "@golemio/eslint-config": "^1.0.2",
31
31
  "@types/chai": "4.2.3",
32
32
  "@types/chai-as-promised": "7.1.2",
@@ -54,5 +54,8 @@
54
54
  },
55
55
  "peerDependencies": {
56
56
  "@golemio/core": "^1.0.5"
57
+ },
58
+ "dependencies": {
59
+ "@golemio/city-districts": "^1.0.4-dev.508157651"
57
60
  }
58
61
  }