@golemio/parkings 1.22.2 → 1.22.3-dev.1916701849

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 (26) hide show
  1. package/dist/integration-engine/ParkingsWorker.d.ts +0 -13
  2. package/dist/integration-engine/ParkingsWorker.js +1 -53
  3. package/dist/integration-engine/ParkingsWorker.js.map +1 -1
  4. package/dist/integration-engine/queueDefinitions.js +0 -18
  5. package/dist/integration-engine/queueDefinitions.js.map +1 -1
  6. package/dist/integration-engine/workers/tasks/SaveTskParkingSectionLevelTask.js +1 -1
  7. package/dist/integration-engine/workers/tasks/SaveTskParkingSectionLevelTask.js.map +1 -1
  8. package/docs/asyncapi.yaml +0 -30
  9. package/docs/implementation_documentation.md +0 -33
  10. package/docs/openapi-output.yaml +1 -2
  11. package/package.json +5 -5
  12. package/dist/integration-engine/datasources/StaticParkingLotsGeoDataSourceFactory.d.ts +0 -4
  13. package/dist/integration-engine/datasources/StaticParkingLotsGeoDataSourceFactory.js +0 -18
  14. package/dist/integration-engine/datasources/StaticParkingLotsGeoDataSourceFactory.js.map +0 -1
  15. package/dist/integration-engine/transformations/ParkingLotsTransformation.d.ts +0 -21
  16. package/dist/integration-engine/transformations/ParkingLotsTransformation.js +0 -127
  17. package/dist/integration-engine/transformations/ParkingLotsTransformation.js.map +0 -1
  18. package/dist/schema-definitions/datasources/InputParkingLotsSchema.d.ts +0 -4
  19. package/dist/schema-definitions/datasources/InputParkingLotsSchema.js +0 -24
  20. package/dist/schema-definitions/datasources/InputParkingLotsSchema.js.map +0 -1
  21. package/dist/schema-definitions/datasources/StaticParkingLotsGeoJsonSchema.d.ts +0 -3
  22. package/dist/schema-definitions/datasources/StaticParkingLotsGeoJsonSchema.js +0 -47
  23. package/dist/schema-definitions/datasources/StaticParkingLotsGeoJsonSchema.js.map +0 -1
  24. package/dist/schema-definitions/datasources/interfaces/IStaticParkingLotsGeo.d.ts +0 -12
  25. package/dist/schema-definitions/datasources/interfaces/IStaticParkingLotsGeo.js +0 -3
  26. package/dist/schema-definitions/datasources/interfaces/IStaticParkingLotsGeo.js.map +0 -1
@@ -1,6 +1,5 @@
1
1
  import { BaseWorker } from "@golemio/core/dist/integration-engine/workers";
2
2
  export declare class ParkingsWorker extends BaseWorker {
3
- private dataSource;
4
3
  private koridParkingConfigTransformation;
5
4
  private koridParkingDataTransformation;
6
5
  private parkingsModel;
@@ -9,21 +8,9 @@ export declare class ParkingsWorker extends BaseWorker {
9
8
  private parkingsTariffsModel;
10
9
  private parkingTariffRelationsRepository;
11
10
  private tskAverageOccupancyRepository;
12
- private parkingLotsTransformation;
13
11
  private config;
14
- private logger;
15
12
  private parkingsLocationRepository;
16
13
  constructor();
17
- /**
18
- * Parking lots Prague queue worker method
19
- * - store all data for parking lots in Prague.
20
- */
21
- saveParkingLotsPrague: () => Promise<void>;
22
- /**
23
- * Parking lots measurements Prague queue worker method
24
- * - store all data for parking lots in Prague.
25
- */
26
- saveParkingLotsMeasurementsPrague: () => Promise<void>;
27
14
  /**
28
15
  * Stores locations and tariffs of parking lots in Liberec.
29
16
  */
@@ -1,67 +1,25 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ParkingsWorker = void 0;
4
+ const SourceEnum_1 = require("../helpers/constants/SourceEnum");
4
5
  const ParkingsLocationRepository_1 = require("./repositories/ParkingsLocationRepository");
5
- const ParkingLotsTransformation_1 = require("./transformations/ParkingLotsTransformation");
6
6
  const UpdateAddressWorker_1 = require("./workers/UpdateAddressWorker");
7
- const InputParkingLotsSchema_1 = require("../schema-definitions/datasources/InputParkingLotsSchema");
8
7
  const ParkingMeasurementsDtoSchema_1 = require("../schema-definitions/datasources/ParkingMeasurementsDtoSchema");
9
8
  const index_1 = require("../schema-definitions/index");
10
9
  const integration_engine_1 = require("@golemio/core/dist/integration-engine");
11
- const datasources_1 = require("@golemio/core/dist/integration-engine/datasources");
12
- const HTTPFetchProtocolStrategy_1 = require("@golemio/core/dist/integration-engine/datasources/protocol-strategy/HTTPFetchProtocolStrategy");
13
10
  const ContainerToken_1 = require("@golemio/core/dist/integration-engine/ioc/ContainerToken");
14
11
  const models_1 = require("@golemio/core/dist/integration-engine/models");
15
12
  const workers_1 = require("@golemio/core/dist/integration-engine/workers");
16
13
  const golemio_errors_1 = require("@golemio/core/dist/shared/golemio-errors");
17
14
  const golemio_validator_1 = require("@golemio/core/dist/shared/golemio-validator");
18
- const StaticParkingLotsGeoDataSourceFactory_1 = require("./datasources/StaticParkingLotsGeoDataSourceFactory");
19
15
  const Di_1 = require("./ioc/Di");
20
16
  const ModuleContainerToken_1 = require("./ioc/ModuleContainerToken");
21
17
  const TskAverageOccupancyRepository_1 = require("./repositories/TskAverageOccupancyRepository");
22
18
  const KoridParkingConfigTransformation_1 = require("./transformations/KoridParkingConfigTransformation");
23
19
  const KoridParkingDataTransformation_1 = require("./transformations/KoridParkingDataTransformation");
24
- const SourceEnum_1 = require("../helpers/constants/SourceEnum");
25
20
  class ParkingsWorker extends workers_1.BaseWorker {
26
21
  constructor() {
27
22
  super();
28
- /**
29
- * Parking lots Prague queue worker method
30
- * - store all data for parking lots in Prague.
31
- */
32
- this.saveParkingLotsPrague = async () => {
33
- const data = await this.dataSource.getAll();
34
- if (data.length === 0) {
35
- this.logger.debug("No recent data. Nothing to do.");
36
- return;
37
- }
38
- let staticGeoData;
39
- try {
40
- // "optional" datasource enhancing geolocations
41
- // objectively the datasource is static data maintained by IPT
42
- staticGeoData = (await StaticParkingLotsGeoDataSourceFactory_1.StaticParkingLotsGeoDataSourceFactory.getDataSource(this.config.datasources.StaticParkingLotsGeoSourceUrl).getAll()).features;
43
- }
44
- catch (err) {
45
- this.logger.error(`Error while getting static parking lots geo: ${err.message}`);
46
- }
47
- const { geo: geoData } = await this.parkingLotsTransformation.transform(data, staticGeoData);
48
- await this.parkingsModel.saveActiveParkingsWithoutAddress(geoData, SourceEnum_1.SourceEnum.TSK);
49
- await integration_engine_1.QueueManager.sendMessageToExchange(this.config.RABBIT_EXCHANGE_NAME + "." + UpdateAddressWorker_1.UpdateAddressWorker.workerName.toLowerCase(), "updateMissingParkingsAddresses", {});
50
- };
51
- /**
52
- * Parking lots measurements Prague queue worker method
53
- * - store all data for parking lots in Prague.
54
- */
55
- this.saveParkingLotsMeasurementsPrague = async () => {
56
- const data = await this.dataSource.getAll();
57
- if (data.length === 0) {
58
- this.logger.debug("No recent data. Nothing to do.");
59
- return;
60
- }
61
- const { measurements: measurementsData } = await this.parkingLotsTransformation.transform(data);
62
- await this.parkingsMeasurementsModel.bulkSave(measurementsData);
63
- await this.parkingsMeasurementsActualModel.bulkSave(measurementsData);
64
- };
65
23
  /**
66
24
  * Stores locations and tariffs of parking lots in Liberec.
67
25
  */
@@ -96,16 +54,6 @@ class ParkingsWorker extends workers_1.BaseWorker {
96
54
  }
97
55
  };
98
56
  this.config = Di_1.ParkingsContainer.resolve(ContainerToken_1.ContainerToken.Config);
99
- this.logger = Di_1.ParkingsContainer.resolve(ContainerToken_1.ContainerToken.Logger);
100
- const dataTypeStrategy = new datasources_1.JSONDataTypeStrategy({ resultsPath: "results" });
101
- // filter items with lastUpdated lower than two days
102
- dataTypeStrategy.setFilter((item) => item.lastUpdated > new Date().getTime() - 2 * 24 * 60 * 60 * 1000);
103
- this.dataSource = new datasources_1.DataSource(index_1.Parkings.name + "DataSource", new HTTPFetchProtocolStrategy_1.HTTPFetchProtocolStrategy({
104
- headers: {},
105
- method: "GET",
106
- url: this.config.datasources.TSKParkings,
107
- }), dataTypeStrategy, new golemio_validator_1.JSONSchemaValidator(index_1.Parkings.name + "DataSource", InputParkingLotsSchema_1.InputParkingLotsSchema));
108
- this.parkingLotsTransformation = new ParkingLotsTransformation_1.ParkingLotsTransformation();
109
57
  this.koridParkingConfigTransformation = new KoridParkingConfigTransformation_1.KoridParkingConfigTransformation();
110
58
  this.koridParkingDataTransformation = new KoridParkingDataTransformation_1.KoridParkingDataTransformation();
111
59
  this.parkingsMeasurementsModel = new models_1.PostgresModel(index_1.Parkings.measurements.name + "Model", {
@@ -1 +1 @@
1
- {"version":3,"file":"ParkingsWorker.js","sourceRoot":"","sources":["../../src/integration-engine/ParkingsWorker.ts"],"names":[],"mappings":";;;AAEA,0FAAyF;AAEzF,2FAA0F;AAC1F,uEAAsE;AACtE,qGAAiF;AACjF,iHAA6F;AAE7F,uDAAsC;AAEtC,8EAAqE;AAErE,mFAAqG;AACrG,6IAA0I;AAC1I,6FAA0F;AAC1F,yEAA6E;AAC7E,2EAA2E;AAC3E,6EAAwE;AACxE,mFAAkF;AAClF,+GAA4G;AAC5G,iCAA6C;AAC7C,qEAAkE;AAClE,gGAA6F;AAC7F,yGAAsG;AACtG,qGAAkG;AAClG,gEAA2D;AAE3D,MAAa,cAAe,SAAQ,oBAAU;IAe1C;QACI,KAAK,EAAE,CAAC;QAuDZ;;;WAGG;QACI,0BAAqB,GAAG,KAAK,IAAmB,EAAE;YACrD,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,MAAM,EAAE,CAAC;YAE5C,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE;gBACnB,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,gCAAgC,CAAC,CAAC;gBACpD,OAAO;aACV;YAED,IAAI,aAAyD,CAAC;YAC9D,IAAI;gBACA,+CAA+C;gBAC/C,8DAA8D;gBAC9D,aAAa,GAAG,CACZ,MAAM,6EAAqC,CAAC,aAAa,CACrD,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,6BAA6B,CACxD,CAAC,MAAM,EAAE,CACb,CAAC,QAAQ,CAAC;aACd;YAAC,OAAO,GAAG,EAAE;gBACV,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,gDAAgD,GAAG,CAAC,OAAO,EAAE,CAAC,CAAC;aACpF;YAED,MAAM,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,MAAM,IAAI,CAAC,yBAAyB,CAAC,SAAS,CAAC,IAAI,EAAE,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BAAQ,CAAC,QAAQ;YAC3B,WAAW,EAAE,gBAAQ,CAAC,kBAAkB,CAAC,WAAW;YACpD,UAAU,EAAE,gBAAgB;SAC/B,EACD,IAAI,uCAAmB,CAAC,gBAAQ,CAAC,kBAAkB,CAAC,IAAI,GAAG,kBAAkB,EAAE,2DAA4B,CAAC,CAC/G,CAAC;QAEF,IAAI,CAAC,6BAA6B,GAAG,IAAI,6DAA6B,EAAE,CAAC;QAEzE,IAAI,CAAC,gCAAgC,GAAG,sBAAiB,CAAC,OAAO,CAC7D,2CAAoB,CAAC,gCAAgC,CACxD,CAAC;QACF,IAAI,CAAC,aAAa,GAAG,sBAAiB,CAAC,OAAO,CAAqB,2CAAoB,CAAC,kBAAkB,CAAC,CAAC;QAC5G,IAAI,CAAC,oBAAoB,GAAG,sBAAiB,CAAC,OAAO,CACjD,2CAAoB,CAAC,wBAAwB,CAChD,CAAC;QACF,IAAI,CAAC,0BAA0B,GAAG,IAAI,uDAA0B,EAAE,CAAC;IACvE,CAAC;CAiDJ;AAnGD,wCAmGC"}
@@ -28,24 +28,6 @@ const queueDefinitions = [
28
28
  worker: ParkingsWorker_1.ParkingsWorker,
29
29
  workerMethod: "saveKoridDataToDB",
30
30
  },
31
- {
32
- name: "saveParkingLotsPrague",
33
- options: {
34
- deadLetterExchange: config_1.config.RABBIT_EXCHANGE_NAME,
35
- deadLetterRoutingKey: "dead",
36
- },
37
- worker: ParkingsWorker_1.ParkingsWorker,
38
- workerMethod: "saveParkingLotsPrague",
39
- },
40
- {
41
- name: "saveParkingLotsMeasurementsPrague",
42
- options: {
43
- deadLetterExchange: config_1.config.RABBIT_EXCHANGE_NAME,
44
- deadLetterRoutingKey: "dead",
45
- },
46
- worker: ParkingsWorker_1.ParkingsWorker,
47
- workerMethod: "saveParkingLotsMeasurementsPrague",
48
- },
49
31
  {
50
32
  name: "refreshTskOccupancyView",
51
33
  options: {
@@ -1 +1 @@
1
- {"version":3,"file":"queueDefinitions.js","sourceRoot":"","sources":["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gBACD,MAAM,EAAE,+BAAc;gBACtB,YAAY,EAAE,yBAAyB;aAC1C;YACD;gBACI,IAAI,EAAE,mBAAmB;gBACzB,OAAO,EAAE;oBACL,kBAAkB,EAAE,eAAM,CAAC,oBAAoB;oBAC/C,oBAAoB,EAAE,MAAM;iBAC/B;gBACD,MAAM,EAAE,6CAAqB;gBAC7B,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,uDAAsC;AACtC,qDAAoD;AACpD,mFAAkF;AAElF,MAAM,gBAAgB,GAAuB;IACzC;QACI,IAAI,EAAE,gBAAQ,CAAC,IAAI;QACnB,WAAW,EAAE,eAAM,CAAC,oBAAoB,GAAG,GAAG,GAAG,gBAAQ,CAAC,IAAI,CAAC,WAAW,EAAE;QAC5E,MAAM,EAAE;YACJ;gBACI,IAAI,EAAE,mBAAmB;gBACzB,OAAO,EAAE;oBACL,kBAAkB,EAAE,eAAM,CAAC,oBAAoB;oBAC/C,oBAAoB,EAAE,MAAM;iBAC/B;gBACD,MAAM,EAAE,+BAAc;gBACtB,YAAY,EAAE,mBAAmB;aACpC;YACD;gBACI,IAAI,EAAE,mBAAmB;gBACzB,OAAO,EAAE;oBACL,kBAAkB,EAAE,eAAM,CAAC,oBAAoB;oBAC/C,oBAAoB,EAAE,MAAM;iBAC/B;gBACD,MAAM,EAAE,+BAAc;gBACtB,YAAY,EAAE,mBAAmB;aACpC;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,IAAI,EAAE,aAAa;iBAC5C;gBACD,MAAM,EAAE,+BAAc;gBACtB,YAAY,EAAE,yBAAyB;aAC1C;YACD;gBACI,IAAI,EAAE,mBAAmB;gBACzB,OAAO,EAAE;oBACL,kBAAkB,EAAE,eAAM,CAAC,oBAAoB;oBAC/C,oBAAoB,EAAE,MAAM;iBAC/B;gBACD,MAAM,EAAE,6CAAqB;gBAC7B,YAAY,EAAE,mBAAmB;aACpC;SACJ;KACJ;CACJ,CAAC;AAEO,4CAAgB"}
@@ -20,7 +20,7 @@ class SaveTskParkingSectionLevelTask extends integration_engine_1.AbstractEmptyT
20
20
  const sourceData = await this.dataSource.getAll();
21
21
  const filteredData = sourceData.filter((parking) => TskParkingFilter_1.TskParkingFilter.isWithinValidityPeriod(parking));
22
22
  const parkingLocations = this.transformation.transformArray(filteredData);
23
- await this.parkingsLocationRepository.saveWithoutAddress(parkingLocations, SourceEnum_1.SourceEnum.TSK);
23
+ await this.parkingsLocationRepository.saveWithoutAddress(parkingLocations, SourceEnum_1.SourceEnum.TSK_V2);
24
24
  const exchange = this.config.getValue("env.RABBIT_EXCHANGE_NAME");
25
25
  await integration_engine_1.QueueManager.sendMessageToExchange(exchange + "." + UpdateAddressWorker_1.UpdateAddressWorker.workerName.toLowerCase(), "updateMissingParkingsLocationAddresses", {});
26
26
  }
@@ -1 +1 @@
1
- {"version":3,"file":"SaveTskParkingSectionLevelTask.js","sourceRoot":"","sources":["../../../../src/integration-engine/workers/tasks/SaveTskParkingSectionLevelTask.ts"],"names":[],"mappings":";;;AAAA,sEAA2D;AAE3D,6EAAwE;AAExE,gEAAsE;AAGtE,8EAAwF;AAExF,6EAA8F;AAE9F,MAAa,8BAA+B,SAAQ,sCAAiB;IACjE,YACoB,SAAiB,EACjC,WAAmB,EACX,UAAiD,EACjD,cAAoD,EACpD,0BAAsD,EACtD,MAAqB;QAE7B,KAAK,CAAC,WAAW,CAAC,CAAC;QAPH,cAAS,GAAT,SAAS,CAAQ;QAEzB,eAAU,GAAV,UAAU,CAAuC;QACjD,mBAAc,GAAd,cAAc,CAAsC;QACpD,+BAA0B,GAA1B,0BAA0B,CAA4B;QACtD,WAAM,GAAN,MAAM,CAAe;IAGjC,CAAC;IAEM,KAAK,CAAC,OAAO;QAChB,IAAI;YACA,MAAM,UAAU,GAA8B,MAAM,IAAI,CAAC,UAAU,CAAC,MAAM,EAAE,CAAC;YAC7E,MAAM,YAAY,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,mCAAgB,CAAC,sBAAsB,CAAC,OAAO,CAAC,CAAC,CAAC;YACtG,MAAM,gBAAgB,GAAG,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,YAAY,CAAC,CAAC;YAC1E,MAAM,IAAI,CAAC,0BAA0B,CAAC,kBAAkB,CAAC,gBAAgB,EAAE,uBAAU,CAAC,GAAG,CAAC,CAAC;YAE3F,MAAM,QAAQ,GAAG,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAS,0BAA0B,CAAC,CAAC;YAC1E,MAAM,iCAAY,CAAC,qBAAqB,CACpC,QAAQ,GAAG,GAAG,GAAG,yCAAmB,CAAC,UAAU,CAAC,WAAW,EAAE,EAC7D,wCAAwC,EACxC,EAAE,CACL,CAAC;SACL;QAAC,OAAO,KAAK,EAAE;YACZ,IAAI,KAAK,YAAY,qCAAoB,EAAE;gBACvC,MAAM,KAAK,CAAC;aACf;YACD,MAAM,IAAI,6BAAY,CAAC,+CAA+C,EAAE,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;SACzG;IACL,CAAC;CACJ;AAhCD,wEAgCC"}
1
+ {"version":3,"file":"SaveTskParkingSectionLevelTask.js","sourceRoot":"","sources":["../../../../src/integration-engine/workers/tasks/SaveTskParkingSectionLevelTask.ts"],"names":[],"mappings":";;;AAAA,sEAA2D;AAE3D,6EAAwE;AAExE,gEAAsE;AAGtE,8EAAwF;AAExF,6EAA8F;AAE9F,MAAa,8BAA+B,SAAQ,sCAAiB;IACjE,YACoB,SAAiB,EACjC,WAAmB,EACX,UAAiD,EACj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easurementsPrague:
250
- address: dataplatform.parkings.saveParkingLotsMeasurementsPrague
251
- description: Update P+R parking lots measurements from TSK (Praha)
252
- bindings:
253
- amqp:
254
- is: queue
255
- queue:
256
- durable: true
257
- messages:
258
- empty:
259
- $ref: "#/components/messages/emptyMessage"
260
- parkings.saveParkingLotsPrague:
261
- address: dataplatform.parkings.saveParkingLotsPrague
262
- description: Update P+R parking lots from TSK (Praha)
263
- bindings:
264
- amqp:
265
- is: queue
266
- queue:
267
- durable: true
268
- messages:
269
- empty:
270
- $ref: "#/components/messages/emptyMessage"
271
249
  parkings.saveParkingZonesPrague:
272
250
  address: dataplatform.parkings.saveParkingZonesPrague
273
251
  description: Update parking zones combined from IPR, TSK and tariffs from TSK (Praha)
@@ -511,14 +489,6 @@ operations:
511
489
  action: "send"
512
490
  channel:
513
491
  $ref: "#/channels/parkings.saveMrParkitData"
514
- parkings.saveParkingLotsMeasurementsPrague:
515
- action: "send"
516
- channel:
517
- $ref: "#/channels/parkings.saveParkingLotsMeasurementsPrague"
518
- parkings.saveParkingLotsPrague:
519
- action: "send"
520
- channel:
521
- $ref: "#/channels/parkings.saveParkingLotsPrague"
522
492
  parkings.saveParkingZonesPrague:
523
493
  action: "send"
524
494
  channel:
@@ -682,39 +682,6 @@ Vybraným parkovištím může být nahrazena location za Multipolygon ze zdroje
682
682
 
683
683
  ### Worker _ParkingsWorker_
684
684
 
685
- #### _saveParkingLotsPrague_
686
-
687
- - vstupní rabbitmq fronta
688
- - název: `dataplatform.parkings.saveParkingLotsPrague`
689
- - bez parametrů
690
- - datové zdroje
691
- - dataSource (http),
692
- - statický IPT zdroj (http),
693
- - transformace
694
- - [ParkingLotsTransformation](https://gitlab.com/operator-ict/golemio/code/modules/parkings/-/blob/development/src/integration-engine/ParkingLotsTransformation.ts) - mapování pro `parkingsModel` a `parkingsLocationModel`
695
- - data modely
696
- - parkingsModel -> `parkings`
697
- - důležité informace pro zpracování dat ze zdroje TSKParkings
698
- - V budoucnu přibydou další hodnoty parking_type: `park_sharing` pro službu Mr. Parkit atp.
699
- - Parametr `zone_type` je povinný pokud je `parking_type == on_street`. Jinak má být `NULL`
700
- - `zone_free` - placeholder pro Zóny neplaceného stání (zone_type), které se budou integrovat v budoucnu
701
-
702
- #### _saveParkingLotsMeasurementsPrague_
703
-
704
- - vstupní rabbitmq fronta
705
- - název: `dataplatform.parkings.saveParkingLotsMeasurementsPrague`
706
- - bez parametrů
707
- - datové zdroje
708
- - dataSource (http),
709
- - transformace
710
- - [ParkingLotsTransformation](https://gitlab.com/operator-ict/golemio/code/modules/parkings/-/blob/development/src/integration-engine/ParkingLotsTransformation.ts) - mapování pro `parkingsModel` a `parkingsLocationModel`
711
- - data modely
712
-
713
- - parkingsMeasurementsModel -> `parkings_measurements_part`
714
- - parkingsMeasurementsActualModel -> `parkings_measurements_actual`
715
-
716
- Všechny historické údaje jsou uloženy v tabulce `parkings_measurements_part`. Aktualizujeme pouze aktuální údaje v tabulce `parkings_measurements_actual`.
717
-
718
685
  #### _saveKoridConfToDB_
719
686
 
720
687
  - vstupní rabbitmq fronta
@@ -987,8 +987,7 @@ paths:
987
987
  enum:
988
988
  - payment_machine
989
989
  - info_box
990
- example: type[]=payment_machine&type[]=info_box
991
- description: 'Filter by type'
990
+ description: 'Filter by type. Use with square brackets `type[]`'
992
991
  - name: boundingBox
993
992
  in: query
994
993
  schema:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@golemio/parkings",
3
- "version": "1.22.2",
3
+ "version": "1.22.3-dev.1916701849",
4
4
  "description": "Golemio Parkings Module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -28,7 +28,7 @@
28
28
  "url": "https://gitlab.com/operator-ict/golemio/code/modules/parkings"
29
29
  },
30
30
  "engines": {
31
- "node": ">=20.0.0",
31
+ "node": ">=22.0.0",
32
32
  "npm": ">=8.0.0"
33
33
  },
34
34
  "devDependencies": {
@@ -36,14 +36,14 @@
36
36
  "@commitlint/cli": "^19.3.0",
37
37
  "@commitlint/config-conventional": "^11.0.0",
38
38
  "@golemio/cli": "1.10.0",
39
- "@golemio/core": "1.20.7",
39
+ "@golemio/core": "1.20.11",
40
40
  "@golemio/db-common": "1.2.0",
41
41
  "@golemio/eslint-config": "1.1.2",
42
42
  "@types/body-parser": "^1.19.5",
43
43
  "@types/chai": "4.2.3",
44
44
  "@types/chai-as-promised": "7.1.2",
45
45
  "@types/mocha": "^10.0.6",
46
- "@types/node": "^20.12.7",
46
+ "@types/node": "^22.16.0",
47
47
  "@types/sinon": "^9.0.10",
48
48
  "@types/supertest": "^2.0.10",
49
49
  "@types/terraformer__wkt": "^2.0.0",
@@ -80,4 +80,4 @@
80
80
  "@turf/turf": "^6.5.0",
81
81
  "uuid-by-string": "^3.0.2"
82
82
  }
83
- }
83
+ }
@@ -1,4 +0,0 @@
1
- import { DataSource } from "@golemio/core/dist/integration-engine/datasources";
2
- export declare class StaticParkingLotsGeoDataSourceFactory {
3
- static getDataSource(sourceUrl: string): DataSource;
4
- }
@@ -1,18 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.StaticParkingLotsGeoDataSourceFactory = void 0;
4
- const StaticParkingLotsGeoJsonSchema_1 = require("../../schema-definitions/datasources/StaticParkingLotsGeoJsonSchema");
5
- const datasources_1 = require("@golemio/core/dist/integration-engine/datasources");
6
- const HTTPFetchProtocolStrategy_1 = require("@golemio/core/dist/integration-engine/datasources/protocol-strategy/HTTPFetchProtocolStrategy");
7
- const golemio_validator_1 = require("@golemio/core/dist/shared/golemio-validator");
8
- class StaticParkingLotsGeoDataSourceFactory {
9
- static getDataSource(sourceUrl) {
10
- return new datasources_1.DataSource("StaticParkingLotsGeoDataSource", new HTTPFetchProtocolStrategy_1.HTTPFetchProtocolStrategy({
11
- headers: {},
12
- method: "GET",
13
- url: sourceUrl,
14
- }), new datasources_1.JSONDataTypeStrategy({ resultsPath: "" }), new golemio_validator_1.JSONSchemaValidator(StaticParkingLotsGeoJsonSchema_1.StaticParkingLotsGeoJsonSchema.name, StaticParkingLotsGeoJsonSchema_1.StaticParkingLotsGeoJsonSchema.jsonSchema));
15
- }
16
- }
17
- exports.StaticParkingLotsGeoDataSourceFactory = StaticParkingLotsGeoDataSourceFactory;
18
- //# sourceMappingURL=StaticParkingLotsGeoDataSourceFactory.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"StaticParkingLotsGeoDataSourceFactory.js","sourceRoot":"","sources":["../../../src/integration-engine/datasources/StaticParkingLotsGeoDataSourceFactory.ts"],"names":[],"mappings":";;;AAAA,wHAAiG;AACjG,mFAAqG;AACrG,6IAA0I;AAC1I,mFAAkF;AAElF,MAAa,qCAAqC;IACvC,MAAM,CAAC,aAAa,CAAC,SAAiB;QACzC,OAAO,IAAI,wBAAU,CACjB,gCAAgC,EAChC,IAAI,qDAAyB,CAAC;YAC1B,OAAO,EAAE,EAAE;YACX,MAAM,EAAE,KAAK;YACb,GAAG,EAAE,SAAS;SACjB,CAAC,EACF,IAAI,kCAAoB,CAAC,EAAE,WAAW,EAAE,EAAE,EAAE,CAAC,EAC7C,IAAI,uCAAmB,CAAC,+DAA8B,CAAC,IAAI,EAAE,+DAA8B,CAAC,UAAU,CAAC,CAC1G,CAAC;IACN,CAAC;CACJ;AAbD,sFAaC"}
@@ -1,21 +0,0 @@
1
- import { IPayment } from "../../schema-definitions/models/interfaces/IPayment";
2
- import { BaseTransformation, ITransformation } from "@golemio/core/dist/integration-engine";
3
- import { IParking, IParkingMeasurements } from "../ParkingInterface";
4
- import { IStaticParkingLotsGeoFeature } from "../../schema-definitions/datasources/interfaces/IStaticParkingLotsGeo";
5
- export interface IParkingLotsTransform {
6
- geo: IParking[];
7
- measurements: IParkingMeasurements[];
8
- payments: IPayment[];
9
- }
10
- export declare class ParkingLotsTransformation extends BaseTransformation implements ITransformation {
11
- name: string;
12
- private readonly dataSource;
13
- constructor();
14
- transform: (data: any, customGeoFeatures?: IStaticParkingLotsGeoFeature[]) => Promise<IParkingLotsTransform>;
15
- protected transformElement: (element: any) => {
16
- geo: IParking;
17
- measurements: IParkingMeasurements;
18
- payments?: IPayment;
19
- };
20
- private getMPLAPaymentShortName;
21
- }
@@ -1,127 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ParkingLotsTransformation = void 0;
4
- const integration_engine_1 = require("@golemio/core/dist/integration-engine");
5
- const _sch_1 = require("../../schema-definitions");
6
- const Geo_1 = require("@golemio/core/dist/output-gateway/Geo");
7
- const config_1 = require("@golemio/core/dist/integration-engine/config");
8
- const golemio_errors_1 = require("@golemio/core/dist/shared/golemio-errors");
9
- const SourceEnum_1 = require("../../helpers/constants/SourceEnum");
10
- const ParkingLotType = {
11
- true: "park_and_ride",
12
- false: "park_paid_private",
13
- };
14
- class ParkingLotsTransformation extends integration_engine_1.BaseTransformation {
15
- constructor() {
16
- super();
17
- this.transform = async (data, customGeoFeatures) => {
18
- const result = { geo: [], measurements: [], payments: [] };
19
- for (const element of data) {
20
- const transformedData = this.transformElement(element);
21
- // "optional" geo location enhancement
22
- if (customGeoFeatures) {
23
- for (const customGeoFeature of customGeoFeatures) {
24
- if (customGeoFeature.properties.id === transformedData.geo.id) {
25
- transformedData.geo = {
26
- ...transformedData.geo,
27
- location: customGeoFeature.geometry,
28
- };
29
- break;
30
- }
31
- }
32
- }
33
- result.geo.push(transformedData.geo);
34
- result.measurements.push(transformedData.measurements);
35
- if (transformedData.payments) {
36
- result.payments.push(transformedData.payments);
37
- }
38
- }
39
- return result;
40
- };
41
- this.transformElement = (element) => {
42
- const paymentUrlShortname = this.getMPLAPaymentShortName(element.id);
43
- const parkingId = `${this.dataSource}-${element.id}`.toLowerCase();
44
- if (isNaN(parseInt(element.lastUpdated, 10))) {
45
- throw new golemio_errors_1.GeneralError(`Could not parse date: ${element.lastUpdated}`, "ParkingLotsTransformation");
46
- }
47
- const dateModified = new Date(element.lastUpdated).toISOString();
48
- // location is always a Point, so no need to use turf for centroid
49
- return {
50
- geo: {
51
- id: parkingId,
52
- source: this.dataSource,
53
- source_id: "" + element.id,
54
- data_provider: "www.tsk-praha.cz",
55
- location: {
56
- coordinates: [parseFloat(element.lng), parseFloat(element.lat)],
57
- type: Geo_1.GeoCoordinatesType.Point,
58
- },
59
- total_spot_number: element.totalNumOfPlaces,
60
- name: element.name,
61
- category: ParkingLotType[element.pr],
62
- parking_type: ParkingLotType[element.pr],
63
- centroid: {
64
- coordinates: [parseFloat(element.lng), parseFloat(element.lat)],
65
- type: Geo_1.GeoCoordinatesType.Point,
66
- },
67
- date_modified: dateModified,
68
- active: true,
69
- },
70
- measurements: {
71
- source: this.dataSource,
72
- source_id: "" + element.id,
73
- parking_id: parkingId,
74
- available_spot_number: element.numOfFreePlaces,
75
- occupied_spot_number: element.numOfTakenPlaces,
76
- total_spot_number: element.totalNumOfPlaces,
77
- date_modified: dateModified,
78
- },
79
- ...(paymentUrlShortname && {
80
- payments: {
81
- parking_id: parkingId,
82
- source: this.dataSource,
83
- payment_web_url: `${config_1.config.PARKINGS_PAYMENT_URL}?shortname=${paymentUrlShortname}`,
84
- },
85
- }),
86
- };
87
- };
88
- this.getMPLAPaymentShortName = (id) => {
89
- switch (id) {
90
- case 534002:
91
- return "139"; // Holešovice
92
- case 534004:
93
- return "142"; // Rajska Zahrada
94
- case 534007:
95
- return "141"; // Radotín
96
- case 534008:
97
- return "144"; // Zličín 1
98
- case 534009:
99
- return "145"; // Zličín 2
100
- case 534010:
101
- return "143"; // Skalka 2
102
- case 534011:
103
- return "147"; // Černý most
104
- case 534012:
105
- return "143"; // Skalka 1
106
- case 534014:
107
- return "121"; // Ládví
108
- case 534015:
109
- return "122"; // Depo Hostivař
110
- case 534016:
111
- return "123"; // Letňany
112
- case 534017:
113
- return "106"; // Westfield Chodov
114
- case 5340171:
115
- return "106"; // Chodov A
116
- case 5340172:
117
- return "106"; // Chodov E
118
- default:
119
- return null;
120
- }
121
- };
122
- this.name = _sch_1.Parkings.tsk.name + "Data";
123
- this.dataSource = SourceEnum_1.SourceEnum.TSK;
124
- }
125
- }
126
- exports.ParkingLotsTransformation = ParkingLotsTransformation;
127
- //# sourceMappingURL=ParkingLotsTransformation.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ParkingLotsTransformation.js","sourceRoot":"","sources":["../../../src/integration-engine/transformations/ParkingLotsTransformation.ts"],"names":[],"mappings":";;;AACA,8EAA4F;AAC5F,mDAAgC;AAEhC,+DAA2E;AAC3E,yEAAsE;AACtE,6EAAwE;AAExE,mEAA2D;AAE3D,MAAM,cAAc,GAAG;IACnB,IAAI,EAAE,eAAe;IACrB,KAAK,EAAE,mBAAmB;CAC7B,CAAC;AAQF,MAAa,yBAA0B,SAAQ,uCAAkB;IAI7D;QACI,KAAK,EAAE,CAAC;QAKL,cAAS,GAAG,KAAK,EAAE,IAAS,EAAE,iBAAkD,EAAkC,EAAE;YACvH,MAAM,MAAM,GAA0B,EAAE,GAAG,EAAE,EAAE,EAAE,YAAY,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC;YAClF,KAAK,MAAM,OAAO,IAAI,IAAI,EAAE;gBACxB,MAAM,eAAe,GAAG,IAAI,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC;gBAEvD,sCAAsC;gBACtC,IAAI,iBAAiB,EAAE;oBACnB,KAAK,MAAM,gBAAgB,IAAI,iBAAiB,EAAE;wBAC9C,IAAI,gBAAgB,CAAC,UAAU,CAAC,EAAE,KAAK,eAAe,CAAC,GAAG,CAAC,EAAE,EAAE;4BAC3D,eAAe,CAAC,GAAG,GAAG;gCAClB,GAAG,eAAe,CAAC,GAAG;gCACtB,QAAQ,EAAE,gBAAgB,CAAC,QAAQ;6BACtC,CAAC;4BACF,MAAM;yBACT;qBACJ;iBACJ;gBAED,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC;gBACrC,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,e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AC,CAAC,aAAa;gBAC/B,KAAK,MAAM;oBACP,OAAO,KAAK,CAAC,CAAC,WAAW;gBAC7B,KAAK,MAAM;oBACP,OAAO,KAAK,CAAC,CAAC,QAAQ;gBAC1B,KAAK,MAAM;oBACP,OAAO,KAAK,CAAC,CAAC,gBAAgB;gBAClC,KAAK,MAAM;oBACP,OAAO,KAAK,CAAC,CAAC,UAAU;gBAC5B,KAAK,MAAM;oBACP,OAAO,KAAK,CAAC,CAAC,mBAAmB;gBACrC,KAAK,OAAO;oBACR,OAAO,KAAK,CAAC,CAAC,WAAW;gBAC7B,KAAK,OAAO;oBACR,OAAO,KAAK,CAAC,CAAC,WAAW;gBAC7B;oBACI,OAAO,IAAI,CAAC;aACnB;QACL,CAAC,CAAC;QAnHE,IAAI,CAAC,IAAI,GAAG,eAAQ,CAAC,GAAG,CAAC,IAAI,GAAG,MAAM,CAAC;QACvC,IAAI,CAAC,UAAU,GAAG,uBAAU,CAAC,GAAG,CAAC;IACrC,CAAC;CAkHJ;AA1HD,8DA0HC"}
@@ -1,4 +0,0 @@
1
- import { JSONSchemaType } from "@golemio/core/dist/shared/ajv";
2
- import { IInputParkingLots } from "./interfaces/IInputParkingLots";
3
- declare const inputParkingLotsSchema: JSONSchemaType<IInputParkingLots[]>;
4
- export { inputParkingLotsSchema as InputParkingLotsSchema };
@@ -1,24 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.InputParkingLotsSchema = void 0;
4
- const inputParkingLotsSchema = {
5
- type: "array",
6
- items: {
7
- type: "object",
8
- required: ["id", "lastUpdated", "lat", "lng", "name", "numOfFreePlaces", "numOfTakenPlaces", "totalNumOfPlaces"],
9
- properties: {
10
- gid: { type: "integer" },
11
- id: { type: "integer" },
12
- lastUpdated: { type: "integer" },
13
- lat: { type: "number" },
14
- lng: { type: "number" },
15
- name: { type: "string" },
16
- numOfFreePlaces: { type: "integer" },
17
- numOfTakenPlaces: { type: "integer" },
18
- pr: { type: "boolean" },
19
- totalNumOfPlaces: { type: "integer" },
20
- },
21
- },
22
- };
23
- exports.InputParkingLotsSchema = inputParkingLotsSchema;
24
- //# sourceMappingURL=InputParkingLotsSchema.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"InputParkingLotsSchema.js","sourceRoot":"","sources":["../../../src/schema-definitions/datasources/InputParkingLotsSchema.ts"],"names":[],"mappings":";;;AAGA,MAAM,sBAAsB,GAAwC;IAChE,IAAI,EAAE,OAAO;IACb,KAAK,EAAE;QACH,IAAI,EAAE,QAAQ;QACd,QAAQ,EAAE,CAAC,IAAI,EAAE,aAAa,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,kBAAkB,CAAC;QAChH,UAAU,EAAE;YACR,GAAG,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;YACxB,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;YACvB,WAAW,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;YAChC,GAAG,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;YACvB,GAAG,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;YACvB,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;YACxB,eAAe,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;YACpC,gBAAgB,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;YACrC,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;YACvB,gBAAgB,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;SACxC;KACJ;CACJ,CAAC;AAEiC,wDAAsB"}
@@ -1,3 +0,0 @@
1
- import { ISchemaDefinition } from "..";
2
- import { IStaticParkingLotsGeo } from "./interfaces/IStaticParkingLotsGeo";
3
- export declare const StaticParkingLotsGeoJsonSchema: ISchemaDefinition<IStaticParkingLotsGeo>;
@@ -1,47 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.StaticParkingLotsGeoJsonSchema = void 0;
4
- const SharedSchemaProvider_1 = require("@golemio/core/dist/schema-definitions/SharedSchemaProvider");
5
- exports.StaticParkingLotsGeoJsonSchema = {
6
- name: "StaticParkingLotsGeo",
7
- jsonSchema: {
8
- type: "object",
9
- properties: {
10
- type: {
11
- type: "string",
12
- enum: ["FeatureCollection"],
13
- },
14
- features: {
15
- type: "array",
16
- items: {
17
- type: "object",
18
- properties: {
19
- type: {
20
- type: "string",
21
- enum: ["Feature"],
22
- },
23
- properties: {
24
- type: "object",
25
- properties: {
26
- id: {
27
- type: "string",
28
- },
29
- },
30
- required: ["id"],
31
- },
32
- geometry: {
33
- $ref: "#/definitions/geometry",
34
- },
35
- },
36
- required: ["geometry", "properties", "type"],
37
- },
38
- },
39
- },
40
- required: ["features", "type"],
41
- definitions: {
42
- // @ts-expect-error since it is referenced definition from other file ts doesnt like it.
43
- geometry: SharedSchemaProvider_1.SharedSchemaProvider.Geometry,
44
- },
45
- },
46
- };
47
- //# sourceMappingURL=StaticParkingLotsGeoJsonSchema.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"StaticParkingLotsGeoJsonSchema.js","sourceRoot":"","sources":["../../../src/schema-definitions/datasources/StaticParkingLotsGeoJsonSchema.ts"],"names":[],"mappings":";;;AAEA,qGAAkG;AAErF,QAAA,8BAA8B,GAA6C;IACpF,IAAI,EAAE,sBAAsB;IAC5B,UAAU,EAAE;QACR,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACR,IAAI,EAAE;gBACF,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,CAAC,mBAAmB,CAAC;aAC9B;YACD,QAAQ,EAAE;gBACN,IAAI,EAAE,OAAO;gBACb,KAAK,EAAE;oBACH,IAAI,EAAE,QAAQ;oBACd,UAAU,EAAE;wBACR,IAAI,EAAE;4BACF,IAAI,EAAE,QAAQ;4BACd,IAAI,EAAE,CAAC,SAAS,CAAC;yBACpB;wBACD,UAAU,EAAE;4BACR,IAAI,EAAE,QAAQ;4BACd,UAAU,EAAE;gCACR,EAAE,EAAE;oCACA,IAAI,EAAE,QAAQ;iCACjB;6BACJ;4BACD,QAAQ,EAAE,CAAC,IAAI,CAAC;yBACnB;wBACD,QAAQ,EAAE;4BACN,IAAI,EAAE,wBAAwB;yBACjC;qBACJ;oBACD,QAAQ,EAAE,CAAC,UAAU,EAAE,YAAY,EAAE,MAAM,CAAC;iBAC/C;aACJ;SACJ;QACD,QAAQ,EAAE,CAAC,UAAU,EAAE,MAAM,CAAC;QAC9B,WAAW,EAAE;YACT,wFAAwF;YACxF,QAAQ,EAAE,2CAAoB,CAAC,QAAQ;SAC1C;KACJ;CACJ,CAAC"}
@@ -1,12 +0,0 @@
1
- import { TGeoCoordinates } from "@golemio/core/dist/output-gateway/Geo";
2
- export interface IStaticParkingLotsGeo {
3
- type: "FeatureCollection";
4
- features: IStaticParkingLotsGeoFeature[];
5
- }
6
- export interface IStaticParkingLotsGeoFeature {
7
- type: "Feature";
8
- geometry: TGeoCoordinates;
9
- properties: {
10
- id: string;
11
- };
12
- }
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=IStaticParkingLotsGeo.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"IStaticParkingLotsGeo.js","sourceRoot":"","sources":["../../../../src/schema-definitions/datasources/interfaces/IStaticParkingLotsGeo.ts"],"names":[],"mappings":""}