@golemio/parkings 1.6.1-dev.1035889725 → 1.6.1-dev.1048720704

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.
@@ -29,7 +29,7 @@ let TskParkingSectionLevelTransformation = exports.TskParkingSectionLevelTransfo
29
29
  centroid: (0, GeodataHelper_1.getPointOnFeature)(location),
30
30
  total_spot_number: zone.projectedCapacity,
31
31
  source: "tsk_v2",
32
- source_id: zone.idSectionItem,
32
+ source_id: zone.idSection,
33
33
  special_access: (_a = this.specialAccess) !== null && _a !== void 0 ? _a : undefined,
34
34
  };
35
35
  };
@@ -1 +1 @@
1
- {"version":3,"file":"TskParkingSectionLevelTransformation.js","sourceRoot":"","sources":["../../../src/integration-engine/transformations/TskParkingSectionLevelTransformation.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6GAA0G;AAG1G,iEAAgE;AAChE,0CAAgD;AAEhD,4DAA8D;AAGvD,IAAM,oCAAoC,kDAA1C,MAAM,oCAAqC,SAAQ,+CAAiE;IAGvH,YAAoB,aAAsB;QACtC,KAAK,EAAE,CAAC;QADQ,kBAAa,GAAb,aAAa,CAAS;QAF1C,SAAI,GAAW,sCAAsC,CAAC;QAM5C,sBAAiB,GAAG,CAAC,IAA6B,EAAoB,EAAE;;YAC9E,MAAM,QAAQ,GAAG,IAAA,kBAAY,EAAC,IAAI,CAAC,SAAS,CAAoB,CAAC;YACjE,OAAO;gBACH,EAAE,EAAE,SAAS,GAAG,IAAI,CAAC,aAAa;gBAClC,aAAa,EAAE,kBAAkB;gBACjC,QAAQ;gBACR,QAAQ,EAAE,IAAA,iCAAiB,EAAC,QAAQ,CAAC;gBACrC,iBAAiB,EAAE,IAAI,CAAC,iBAAiB;gBACzC,MAAM,EAAE,QAAQ;gBAChB,SAAS,EAAE,IAAI,CAAC,aAAa;gBAC7B,cAAc,EAAE,MAAA,IAAI,CAAC,aAAa,mCAAI,SAAS;aAClD,CAAC;QACN,CAAC,CAAC;IAdF,CAAC;CAeJ,CAAA;+CApBY,oCAAoC;IADhD,IAAA,qBAAU,GAAE;;GACA,oCAAoC,CAoBhD"}
1
+ {"version":3,"file":"TskParkingSectionLevelTransformation.js","sourceRoot":"","sources":["../../../src/integration-engine/transformations/TskParkingSectionLevelTransformation.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6GAA0G;AAG1G,iEAAgE;AAChE,0CAAgD;AAEhD,4DAA8D;AAGvD,IAAM,oCAAoC,kDAA1C,MAAM,oCAAqC,SAAQ,+CAAiE;IAGvH,YAAoB,aAAsB;QACtC,KAAK,EAAE,CAAC;QADQ,kBAAa,GAAb,aAAa,CAAS;QAF1C,SAAI,GAAW,sCAAsC,CAAC;QAM5C,sBAAiB,GAAG,CAAC,IAA6B,EAAoB,EAAE;;YAC9E,MAAM,QAAQ,GAAG,IAAA,kBAAY,EAAC,IAAI,CAAC,SAAS,CAAoB,CAAC;YACjE,OAAO;gBACH,EAAE,EAAE,SAAS,GAAG,IAAI,CAAC,aAAa;gBAClC,aAAa,EAAE,kBAAkB;gBACjC,QAAQ;gBACR,QAAQ,EAAE,IAAA,iCAAiB,EAAC,QAAQ,CAAC;gBACrC,iBAAiB,EAAE,IAAI,CAAC,iBAAiB;gBACzC,MAAM,EAAE,QAAQ;gBAChB,SAAS,EAAE,IAAI,CAAC,SAAS;gBACzB,cAAc,EAAE,MAAA,IAAI,CAAC,aAAa,mCAAI,SAAS;aAClD,CAAC;QACN,CAAC,CAAC;IAdF,CAAC;CAeJ,CAAA;+CApBY,oCAAoC;IADhD,IAAA,qBAAU,GAAE;;GACA,oCAAoC,CAoBhD"}
@@ -53,7 +53,7 @@ let TariffRepository = exports.TariffRepository = class TariffRepository extends
53
53
  where.valid_from = { [sequelize_1.Op.gte]: params.validFrom };
54
54
  }
55
55
  if (params.validTo) {
56
- where.valid_to = { [sequelize_1.Op.lte]: params.validTo };
56
+ where.valid_to = { [sequelize_1.Op.gte]: params.validTo };
57
57
  }
58
58
  const result = yield this.sequelizeModel.findAll({
59
59
  attributes: { include: ["updated_at"] },
@@ -17,32 +17,50 @@ class ParkingDtoTransformation extends AbstractTransformation_1.AbstractTransfor
17
17
  }
18
18
  };
19
19
  this.transformInternal = (element) => {
20
- return (0, Geo_1.buildGeojsonFeature)({
20
+ var _a, _b;
21
+ const properties = {
21
22
  id: element.id,
22
23
  primary_source: element.source,
23
24
  primary_source_id: element.source_id,
24
25
  name: element.name,
25
26
  valid_from: element.valid_from,
26
- centroid: element.centroid,
27
+ centroid: (element === null || element === void 0 ? void 0 : element.centroid)
28
+ ? {
29
+ type: (_a = element === null || element === void 0 ? void 0 : element.centroid) === null || _a === void 0 ? void 0 : _a.type,
30
+ coordinates: (_b = element === null || element === void 0 ? void 0 : element.centroid) === null || _b === void 0 ? void 0 : _b.coordinates,
31
+ }
32
+ : undefined,
27
33
  last_updated_at: element.updated_at,
28
34
  last_modified_at_source: element.date_modified,
29
- space: element.parking_locations.map(this.transformLocation),
35
+ space: (0, Geo_1.buildGeojsonFeatureCollection)(element.parking_locations.map(this.transformLocation)),
30
36
  tariff: element.tariff_id,
31
- lon: element.centroid.coordinates[0],
32
- lat: element.centroid.coordinates[1],
33
- }, "lon", "lat", true);
37
+ };
38
+ return {
39
+ geometry: {
40
+ coordinates: element.location.coordinates,
41
+ type: element.location.type,
42
+ },
43
+ properties: properties,
44
+ type: "Feature",
45
+ };
34
46
  };
35
47
  this.transformLocation = (element) => {
36
- return (0, Geo_1.buildGeojsonFeature)({
48
+ const properties = {
37
49
  id: element.id,
38
50
  capacity: element.total_spot_number,
39
51
  filter: "blue",
40
52
  access_dedicated_to: element.special_access ? [element.special_access] : [],
41
53
  address: element.address,
42
- restriction: [],
43
- lon: element.centroid.coordinates[0],
44
- lat: element.centroid.coordinates[1],
45
- }, "lon", "lat", true);
54
+ restriction: [], // Not implemented for TSKv2
55
+ };
56
+ return {
57
+ geometry: {
58
+ coordinates: element.location.coordinates,
59
+ type: element.location.type,
60
+ },
61
+ properties: properties,
62
+ type: "Feature",
63
+ };
46
64
  };
47
65
  }
48
66
  }
@@ -1 +1 @@
1
- {"version":3,"file":"ParkingDtoTransformation.js","sourceRoot":"","sources":["../../../../src/output-gateway/transformations/v3/ParkingDtoTransformation.ts"],"names":[],"mappings":";;;AAEA,6GAA0G;AAC1G,+DAA4H;AAE5H,6EAAwE;AAExE,MAAa,wBAAyB,SAAQ,+CAA6D;IAA3G;;QACW,SAAI,GAAW,0BAA0B,CAAC;QAE1C,iCAA4B,GAAG,CAAC,QAAgC,EAAE,EAAE;YACvE,IAAI;gBACA,OAAO,IAAA,mCAA6B,EAAC,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC,CAAC;aACvE;YAAC,OAAO,GAAG,EAAE;gBACV,MAAM,IAAI,6BAAY,CAAC,sBAAsB,EAAE,IAAI,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;aACvE;QACL,CAAC,CAAC;QAEQ,sBAAiB,GAAG,CAAC,OAA6B,EAAE,EAAE;YAC5D,OAAO,IAAA,yBAAmB,EACtB;gBACI,EAAE,EAAE,OAAO,CAAC,EAAE;gBACd,cAAc,EAAE,OAAO,CAAC,MAAM;gBAC9B,iBAAiB,EAAE,OAAO,CAAC,SAAS;gBACpC,IAAI,EAAE,OAAO,CAAC,IAAI;gBAClB,UAAU,EAAE,OAAO,CAAC,UAAU;gBAC9B,QAAQ,EAAE,OAAO,CAAC,QAAQ;gBAC1B,eAAe,EAAE,OAAO,CAAC,UAAU;gBACnC,uBAAuB,EAAE,OAAO,CAAC,aAAa;gBAC9C,KAAK,EAAE,OAAO,CAAC,iBAAiB,CAAC,GAAG,CAAC,IAAI,CAAC,iBAAiB,CAAC;gBAC5D,MAAM,EAAE,OAAO,CAAC,SAAS;gBACzB,GAAG,EAAG,OAAO,CAAC,QAAkB,CAAC,WAAW,CAAC,CAAC,CAAC;gBAC/C,GAAG,EAAG,OAAO,CAAC,QAAkB,CAAC,WAAW,CAAC,CAAC,CAAC;aAClD,EACD,KAAK,EACL,KAAK,EACL,IAAI,CACP,CAAC;QACN,CAAC,CAAC;QAEM,sBAAiB,GAAG,CAAC,OAAyB,EAAE,EAAE;YACtD,OAAO,IAAA,yBAAmB,EACtB;gBACI,EAAE,EAAE,OAAO,CAAC,EAAE;gBACd,QAAQ,EAAE,OAAO,CAAC,iBAAiB;gBACnC,MAAM,EAAE,MAAM;gBACd,mBAAmB,EAAE,OAAO,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,EAAE;gBAC3E,OAAO,EAAE,OAAO,CAAC,OAAO;gBACxB,WAAW,EAAE,EAAE;gBACf,GAAG,EAAG,OAAO,CAAC,QAAkB,CAAC,WAAW,CAAC,CAAC,CAAC;gBAC/C,GAAG,EAAG,OAAO,CAAC,QAAkB,CAAC,WAAW,CAAC,CAAC,CAAC;aAClD,EACD,KAAK,EACL,KAAK,EACL,IAAI,CACP,CAAC;QACN,CAAC,CAAC;IACN,CAAC;CAAA;AAlDD,4DAkDC"}
1
+ {"version":3,"file":"ParkingDtoTransformation.js","sourceRoot":"","sources":["../../../../src/output-gateway/transformations/v3/ParkingDtoTransformation.ts"],"names":[],"mappings":";;;AAEA,6GAA0G;AAC1G,+DAAuG;AACvG,6EAAwE;AAExE,MAAa,wBAAyB,SAAQ,+CAA6D;IAA3G;;QACW,SAAI,GAAW,0BAA0B,CAAC;QAE1C,iCAA4B,GAAG,CAAC,QAAgC,EAAE,EAAE;YACvE,IAAI;gBACA,OAAO,IAAA,mCAA6B,EAAC,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC,CAAC;aACvE;YAAC,OAAO,GAAG,EAAE;gBACV,MAAM,IAAI,6BAAY,CAAC,sBAAsB,EAAE,IAAI,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;aACvE;QACL,CAAC,CAAC;QAEQ,sBAAiB,GAAG,CAAC,OAA6B,EAAE,EAAE;;Y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C,EAAE;gBAC3E,OAAO,EAAE,OAAO,CAAC,OAAO;gBACxB,WAAW,EAAE,EAAE,EAAE,4BAA4B;aAChD,CAAC;YAEF,OAAO;gBACH,QAAQ,EAAE;oBACN,WAAW,EAAE,OAAO,CAAC,QAAQ,CAAC,WAAW;oBACzC,IAAI,EAAE,OAAO,CAAC,QAAQ,CAAC,IAAI;iBAC9B;gBACD,UAAU,EAAE,UAAU;gBACtB,IAAI,EAAE,SAAS;aACC,CAAC;QACzB,CAAC,CAAC;IACN,CAAC;CAAA;AA3DD,4DA2DC"}
@@ -218,26 +218,18 @@ paths:
218
218
  schema:
219
219
  type: number
220
220
  example: 0
221
- - name: timeCondition
221
+ - name: minutesBefore
222
222
  in: query
223
- required: true
224
- style: form
225
- explode: true
226
223
  schema:
227
- type: object
228
- properties:
229
- minutesBefore:
230
- type: number
231
- example: 10
232
- description: Lists items updated since given number of minutes
233
- updatedSince:
234
- type: string
235
- example: 2022-07-25
236
- description: Lists items updated after given date (ISO format expected)
237
- additionalProperties: false
238
- oneOf:
239
- - required: [ minutesBefore ]
240
- - required: [ updatedSince ]
224
+ type: integer
225
+ example: 10
226
+ description: 'Filter by time conditions based on last data update. By maximal minutes before last update.'
227
+ - name: updatedSince
228
+ in: query
229
+ schema:
230
+ type: string
231
+ example: '2022-07-25T00:00:00.000Z'
232
+ description: 'Filter by time conditions based on last data update. Date has to be in ISO8601 format. Cannot be used together with minutsBefore.'
241
233
  responses:
242
234
  200:
243
235
  description: OK
@@ -335,26 +327,18 @@ paths:
335
327
  schema:
336
328
  type: number
337
329
  example: 0
338
- - name: timeCondition
339
- in: query
340
- required: true
341
- style: form
342
- explode: true
343
- schema:
344
- type: object
345
- properties:
346
- minutesBefore:
347
- type: number
348
- example: 10
349
- description: Lists items updated since given number of minutes
350
- updatedSince:
351
- type: string
352
- example: 2022-07-25
353
- description: Lists items updated after given date (ISO format expected)
354
- additionalProperties: false
355
- oneOf:
356
- - required: [ minutesBefore ]
357
- - required: [ updatedSince ]
330
+ - name: minutesBefore
331
+ in: query
332
+ schema:
333
+ type: integer
334
+ example: 10
335
+ description: 'Filter by time conditions based on last data update. By maximal minutes before last update.'
336
+ - name: updatedSince
337
+ in: query
338
+ schema:
339
+ type: string
340
+ example: '2022-07-25T00:00:00.000Z'
341
+ description: 'Filter by time conditions based on last data update. Date has to be in ISO8601 format. Cannot be used together with minutsBefore.'
358
342
  - name: zoneType
359
343
  in: query
360
344
  description: Filter by parking zone. Use with square brackets `zoneType[]`,
@@ -470,26 +454,18 @@ paths:
470
454
  schema:
471
455
  type: number
472
456
  example: 0
473
- - name: timeCondition
474
- in: query
475
- required: true
476
- style: form
477
- explode: true
478
- schema:
479
- type: object
480
- properties:
481
- minutesBefore:
482
- type: number
483
- example: 10
484
- description: Lists items updated since given number of minutes
485
- updatedSince:
486
- type: string
487
- example: 2022-07-25
488
- description: Lists items updated after given date (ISO format expected)
489
- additionalProperties: false
490
- oneOf:
491
- - required: [ minutesBefore ]
492
- - required: [ updatedSince ]
457
+ - name: minutesBefore
458
+ in: query
459
+ schema:
460
+ type: integer
461
+ example: 10
462
+ description: 'Filter by time conditions based on last data update. By maximal minutes before last update.'
463
+ - name: updatedSince
464
+ in: query
465
+ schema:
466
+ type: string
467
+ example: '2022-07-25T00:00:00.000Z'
468
+ description: 'Filter by time conditions based on last data update. Date has to be in ISO8601 format. Cannot be used together with minutsBefore.'
493
469
  responses:
494
470
  200:
495
471
  description: OK
@@ -640,7 +616,7 @@ paths:
640
616
  schema:
641
617
  type: string
642
618
  example: '2022-07-25T00:00:00.000Z'
643
- description: 'Filter by time conditions based on last data update. Date has to be in ISO8601 format.'
619
+ description: 'Filter by time conditions based on last data update. Date has to be in ISO8601 format. Cannot be used together with minutsBefore.'
644
620
  - name: limit
645
621
  in: query
646
622
  schema:
@@ -818,7 +794,7 @@ paths:
818
794
  type: string
819
795
  example: '%88'
820
796
  description: |
821
- Filter by code mask using substring match and "%" wildcard (partial match).
797
+ Filter by code mask using substring match and "%" wildcard (partial match). (If used directly in postman or browser, "%" needs to be encoded as "%25".
822
798
  Examples:
823
799
  - `query` matches substring in codes
824
800
  - `start%` matches codes starting with "start"
@@ -1613,9 +1589,15 @@ components:
1613
1589
  format: date-time
1614
1590
  description: 'The date and time when the parking location was last modified at the source. In case data source provides it.'
1615
1591
  space:
1616
- type: array
1617
- items:
1618
- $ref: '#/components/schemas/ParkingSpace'
1592
+ type: object
1593
+ properties:
1594
+ features:
1595
+ type: array
1596
+ items:
1597
+ $ref: '#/components/schemas/ParkingSpace'
1598
+ type:
1599
+ type: string
1600
+ example: FeatureCollection
1619
1601
  tariff:
1620
1602
  type: string
1621
1603
  format: uuid
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@golemio/parkings",
3
- "version": "1.6.1-dev.1035889725",
3
+ "version": "1.6.1-dev.1048720704",
4
4
  "description": "Golemio Parkings Module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",