@golemio/fypr 1.7.2-dev.2602634331 → 1.7.2-dev.2608202800
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.
- package/db/migrations/postgresql/20260616000000-add-mvt-information-panels-with-routes-view.js +47 -0
- package/db/migrations/postgresql/sqls/20260616000000-add-mvt-information-panels-with-routes-view-down.sql +5 -0
- package/db/migrations/postgresql/sqls/20260616000000-add-mvt-information-panels-with-routes-view-up.sql +30 -0
- package/docs/asyncapi.yaml +3 -5
- package/docs/openapi-output.yaml +37 -48
- package/package.json +1 -1
package/db/migrations/postgresql/20260616000000-add-mvt-information-panels-with-routes-view.js
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var dbm;
|
|
4
|
+
var type;
|
|
5
|
+
var seed;
|
|
6
|
+
var fs = require('fs');
|
|
7
|
+
var path = require('path');
|
|
8
|
+
var Promise;
|
|
9
|
+
|
|
10
|
+
exports.setup = function(options, seedLink) {
|
|
11
|
+
dbm = options.dbmigrate;
|
|
12
|
+
type = dbm.dataType;
|
|
13
|
+
seed = seedLink;
|
|
14
|
+
Promise = options.Promise;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
exports.up = function(db) {
|
|
18
|
+
var filePath = path.join(__dirname, 'sqls', '20260616000000-add-mvt-information-panels-with-routes-view-up.sql');
|
|
19
|
+
return new Promise( function( resolve, reject ) {
|
|
20
|
+
fs.readFile(filePath, {encoding: 'utf-8'}, function(err,data){
|
|
21
|
+
if (err) return reject(err);
|
|
22
|
+
console.log('received data: ' + data);
|
|
23
|
+
resolve(data);
|
|
24
|
+
});
|
|
25
|
+
})
|
|
26
|
+
.then(function(data) {
|
|
27
|
+
return db.runSql(data);
|
|
28
|
+
});
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
exports.down = function(db) {
|
|
32
|
+
var filePath = path.join(__dirname, 'sqls', '20260616000000-add-mvt-information-panels-with-routes-view-down.sql');
|
|
33
|
+
return new Promise( function( resolve, reject ) {
|
|
34
|
+
fs.readFile(filePath, {encoding: 'utf-8'}, function(err,data){
|
|
35
|
+
if (err) return reject(err);
|
|
36
|
+
console.log('received data: ' + data);
|
|
37
|
+
resolve(data);
|
|
38
|
+
});
|
|
39
|
+
})
|
|
40
|
+
.then(function(data) {
|
|
41
|
+
return db.runSql(data);
|
|
42
|
+
});
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
exports._meta = {
|
|
46
|
+
"version": 1
|
|
47
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
-- Generated geometry column on information_panels (computed once at row write)
|
|
2
|
+
ALTER TABLE information_panels
|
|
3
|
+
ADD COLUMN geometry public.geometry(Point, 4326)
|
|
4
|
+
GENERATED ALWAYS AS (public.ST_SetSRID(public.ST_MakePoint(lon, lat), 4326)) STORED;
|
|
5
|
+
|
|
6
|
+
-- Partial GiST index for bbox-driven tile lookups
|
|
7
|
+
CREATE INDEX idx_information_panels_mvt_geom
|
|
8
|
+
ON information_panels USING GIST (geometry)
|
|
9
|
+
WHERE state = 'Hotovo' AND data_source = 'Golemio' AND geometry IS NOT NULL;
|
|
10
|
+
|
|
11
|
+
-- New MVT view enhanced with routes/lines/notes for app-side filterability
|
|
12
|
+
CREATE VIEW v_information_panels_for_mvt_with_routes AS
|
|
13
|
+
SELECT
|
|
14
|
+
ip.id,
|
|
15
|
+
ip.preset,
|
|
16
|
+
ip.geometry,
|
|
17
|
+
concat_ws(' ', ip.name, ip.stop_name, STRING_AGG(p.note, ' ')) AS search_fields,
|
|
18
|
+
JSONB_AGG(JSONB_BUILD_OBJECT(
|
|
19
|
+
'route_name', p.route_name,
|
|
20
|
+
'route_type', r.route_type,
|
|
21
|
+
'route_short_name', r.route_short_name
|
|
22
|
+
)) AS routes
|
|
23
|
+
FROM information_panels ip
|
|
24
|
+
INNER JOIN information_panels_presets p
|
|
25
|
+
ON p.information_panel_document_id = ip.document_id AND NOT p.is_testing
|
|
26
|
+
INNER JOIN information_panels_presets_routes r ON r.preset_id = p.id
|
|
27
|
+
WHERE ip.state = 'Hotovo'
|
|
28
|
+
AND ip.geometry IS NOT NULL
|
|
29
|
+
AND ip.data_source = 'Golemio'
|
|
30
|
+
GROUP BY ip.id;
|
package/docs/asyncapi.yaml
CHANGED
package/docs/openapi-output.yaml
CHANGED
|
@@ -598,11 +598,11 @@ components:
|
|
|
598
598
|
description: Human-readable name of the element. May be null.
|
|
599
599
|
state:
|
|
600
600
|
type: string
|
|
601
|
-
nullable:
|
|
602
|
-
example: "
|
|
601
|
+
nullable: false
|
|
602
|
+
example: "Hotovo"
|
|
603
603
|
description: >-
|
|
604
|
-
Lifecycle state of the element (e.g.
|
|
605
|
-
|
|
604
|
+
Lifecycle state of the element (e.g. Plánováno, Neplánováno, Zrušeno, Hotovo, V přípravě).
|
|
605
|
+
).
|
|
606
606
|
owner:
|
|
607
607
|
type: string
|
|
608
608
|
nullable: true
|
|
@@ -735,8 +735,8 @@ components:
|
|
|
735
735
|
nullable: true
|
|
736
736
|
example: "U123456"
|
|
737
737
|
description: >-
|
|
738
|
-
Stop identifier from the THMP
|
|
739
|
-
|
|
738
|
+
Stop identifier from the THMP system. May be null if not linked
|
|
739
|
+
to a THMP stop.
|
|
740
740
|
shelter_type:
|
|
741
741
|
type: string
|
|
742
742
|
nullable: true
|
|
@@ -775,17 +775,15 @@ components:
|
|
|
775
775
|
asw_node_id:
|
|
776
776
|
type: string
|
|
777
777
|
nullable: true
|
|
778
|
-
example: "
|
|
778
|
+
example: "1040"
|
|
779
779
|
description: >-
|
|
780
|
-
Node identifier
|
|
781
|
-
linking the display case to a stop node. May be null.
|
|
780
|
+
Node identifier in the ASW system. May be null.
|
|
782
781
|
asw_stop_id:
|
|
783
782
|
type: string
|
|
784
783
|
nullable: true
|
|
785
|
-
example: "
|
|
784
|
+
example: "3"
|
|
786
785
|
description: >-
|
|
787
|
-
Stop identifier from the ASW
|
|
788
|
-
May be null.
|
|
786
|
+
Stop identifier from the ASW system on the ASW node. May be null.
|
|
789
787
|
location_description:
|
|
790
788
|
type: string
|
|
791
789
|
nullable: true
|
|
@@ -827,8 +825,8 @@ components:
|
|
|
827
825
|
nullable: true
|
|
828
826
|
example: "THMP-DC-0056"
|
|
829
827
|
description: >-
|
|
830
|
-
Element number assigned by the THMP
|
|
831
|
-
|
|
828
|
+
Element number assigned by the THMP system. May be null if not
|
|
829
|
+
registered in THMP.
|
|
832
830
|
cleaning_frequency:
|
|
833
831
|
type: string
|
|
834
832
|
nullable: true
|
|
@@ -952,8 +950,7 @@ components:
|
|
|
952
950
|
nullable: true
|
|
953
951
|
example: "U100Z1P"
|
|
954
952
|
description: >-
|
|
955
|
-
Stop identifier in the THMP
|
|
956
|
-
registry. May be null.
|
|
953
|
+
Stop identifier in the THMP registry. May be null.
|
|
957
954
|
land_parcel_number:
|
|
958
955
|
type: string
|
|
959
956
|
nullable: true
|
|
@@ -1032,10 +1029,9 @@ components:
|
|
|
1032
1029
|
connection_type:
|
|
1033
1030
|
type: string
|
|
1034
1031
|
nullable: true
|
|
1035
|
-
example: "
|
|
1032
|
+
example: "PRE"
|
|
1036
1033
|
description: >-
|
|
1037
|
-
|
|
1038
|
-
GSM, LTE). May be null.
|
|
1034
|
+
Type of electrical power supply connection for the panel. May be null.
|
|
1039
1035
|
connection_mode:
|
|
1040
1036
|
type: string
|
|
1041
1037
|
nullable: true
|
|
@@ -1178,13 +1174,13 @@ components:
|
|
|
1178
1174
|
presets:
|
|
1179
1175
|
type: array
|
|
1180
1176
|
nullable: true
|
|
1181
|
-
items:
|
|
1182
|
-
|
|
1177
|
+
items:
|
|
1178
|
+
type: string
|
|
1183
1179
|
example:
|
|
1184
1180
|
- "gema-masarykovo_nadrazi-a"
|
|
1185
|
-
- "gema-masarykovo_nadrazi-b"
|
|
1181
|
+
- "gema-masarykovo_nadrazi-b"
|
|
1186
1182
|
description: >-
|
|
1187
|
-
|
|
1183
|
+
Departure preset identifiers assigned to this panel. Null if no presets are configured
|
|
1188
1184
|
data_source:
|
|
1189
1185
|
type: string
|
|
1190
1186
|
nullable: true
|
|
@@ -1204,15 +1200,13 @@ components:
|
|
|
1204
1200
|
nullable: true
|
|
1205
1201
|
example: "cabinet-A3"
|
|
1206
1202
|
description: >-
|
|
1207
|
-
|
|
1208
|
-
this panel. May be null.
|
|
1203
|
+
Specification of location type where the device is connected.
|
|
1209
1204
|
connection_point_number:
|
|
1210
1205
|
type: string
|
|
1211
1206
|
nullable: true
|
|
1212
1207
|
example: "CP-007"
|
|
1213
1208
|
description: >-
|
|
1214
|
-
|
|
1215
|
-
junction. May be null.
|
|
1209
|
+
Identifier of the electrical connection point used by this panel.
|
|
1216
1210
|
foundation_type:
|
|
1217
1211
|
type: string
|
|
1218
1212
|
nullable: true
|
|
@@ -1362,16 +1356,15 @@ components:
|
|
|
1362
1356
|
asw_node_id:
|
|
1363
1357
|
type: string
|
|
1364
1358
|
nullable: true
|
|
1365
|
-
example: "
|
|
1359
|
+
example: "1040"
|
|
1366
1360
|
description: >-
|
|
1367
|
-
Node identifier in the ASW
|
|
1368
|
-
registry. May be null.
|
|
1361
|
+
Node identifier in the ASW system. May be null.
|
|
1369
1362
|
asw_stop_id:
|
|
1370
1363
|
type: string
|
|
1371
1364
|
nullable: true
|
|
1372
|
-
example: "
|
|
1365
|
+
example: "3"
|
|
1373
1366
|
description: >-
|
|
1374
|
-
Stop identifier
|
|
1367
|
+
Stop identifier from the ASW system on the ASW node. May be null.
|
|
1375
1368
|
power_consumption_watt:
|
|
1376
1369
|
type: number
|
|
1377
1370
|
format: float
|
|
@@ -1419,9 +1412,7 @@ components:
|
|
|
1419
1412
|
nullable: true
|
|
1420
1413
|
example: 6
|
|
1421
1414
|
description: >-
|
|
1422
|
-
Count of rows for text or data on the panel.
|
|
1423
|
-
stores this with a "v" prefix which is stripped on output.
|
|
1424
|
-
May be null.
|
|
1415
|
+
Count of rows for text or data on the panel. May be null.
|
|
1425
1416
|
design_price_without_vat:
|
|
1426
1417
|
type: number
|
|
1427
1418
|
format: float
|
|
@@ -1479,9 +1470,10 @@ components:
|
|
|
1479
1470
|
Contact information for the element owner. May be null.
|
|
1480
1471
|
connectivity_internet:
|
|
1481
1472
|
type: string
|
|
1473
|
+
example: "Wi-Fi"
|
|
1482
1474
|
nullable: true
|
|
1483
1475
|
description: >-
|
|
1484
|
-
Internet connectivity type
|
|
1476
|
+
Internet connectivity type for the panel. May be null.
|
|
1485
1477
|
phone_number:
|
|
1486
1478
|
type: string
|
|
1487
1479
|
nullable: true
|
|
@@ -1794,9 +1786,9 @@ components:
|
|
|
1794
1786
|
panel_size:
|
|
1795
1787
|
type: string
|
|
1796
1788
|
nullable: true
|
|
1797
|
-
example: "
|
|
1789
|
+
example: "Standart"
|
|
1798
1790
|
description: >-
|
|
1799
|
-
|
|
1791
|
+
Size of the totem's display panel (e.g. "Standart", "Atyp").
|
|
1800
1792
|
May be null if not yet specified.
|
|
1801
1793
|
locality:
|
|
1802
1794
|
type: string
|
|
@@ -1881,10 +1873,10 @@ components:
|
|
|
1881
1873
|
building_permit_state:
|
|
1882
1874
|
type: string
|
|
1883
1875
|
nullable: true
|
|
1884
|
-
example: "
|
|
1876
|
+
example: "Plánováno"
|
|
1885
1877
|
description: >-
|
|
1886
1878
|
Current state of the building permit process
|
|
1887
|
-
(e.g.
|
|
1879
|
+
(e.g. Plánováno, Neplánováno, Zrušeno, Hotovo). May be null.
|
|
1888
1880
|
location_note:
|
|
1889
1881
|
type: string
|
|
1890
1882
|
nullable: true
|
|
@@ -2100,17 +2092,15 @@ components:
|
|
|
2100
2092
|
asw_node_id:
|
|
2101
2093
|
type: string
|
|
2102
2094
|
nullable: true
|
|
2103
|
-
example: "
|
|
2095
|
+
example: "1040"
|
|
2104
2096
|
description: >-
|
|
2105
|
-
Node identifier in the ASW
|
|
2106
|
-
associated with this totem's location. May be null.
|
|
2097
|
+
Node identifier in the ASW system. May be null.
|
|
2107
2098
|
asw_stop_id:
|
|
2108
2099
|
type: string
|
|
2109
2100
|
nullable: true
|
|
2110
|
-
example: "
|
|
2101
|
+
example: "3"
|
|
2111
2102
|
description: >-
|
|
2112
|
-
Stop identifier
|
|
2113
|
-
May be null.
|
|
2103
|
+
Stop identifier from the ASW system on the ASW node. May be null.
|
|
2114
2104
|
power_consumption_watt:
|
|
2115
2105
|
type: number
|
|
2116
2106
|
format: double
|
|
@@ -2124,8 +2114,7 @@ components:
|
|
|
2124
2114
|
nullable: true
|
|
2125
2115
|
example: "THMP-2024-00456"
|
|
2126
2116
|
description: >-
|
|
2127
|
-
Element number assigned within the THMP
|
|
2128
|
-
of Public Infrastructure) register. May be null.
|
|
2117
|
+
Element number assigned within the THMP register. May be null.
|
|
2129
2118
|
electricity_supply_contract:
|
|
2130
2119
|
type: string
|
|
2131
2120
|
nullable: true
|