@golemio/fypr 1.11.0 → 1.11.1-dev.2826403964

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,16 @@
1
+ 'use strict';
2
+
3
+ const fs = require('fs/promises');
4
+ const path = require('path');
5
+
6
+ const runSql = (db, name) =>
7
+ fs.readFile(path.join(__dirname, 'sqls', name), 'utf-8').then((sql) => {
8
+ console.log('received data: ' + sql);
9
+ return db.runSql(sql);
10
+ });
11
+
12
+ exports.up = (db) => runSql(db, '20260904120000-narrow-mvt-panels-search-fields-to-name-up.sql');
13
+
14
+ exports.down = (db) => runSql(db, '20260904120000-narrow-mvt-panels-search-fields-to-name-down.sql');
15
+
16
+ exports._meta = { version: 1 };
@@ -0,0 +1,28 @@
1
+ DROP VIEW IF EXISTS v_information_panels_for_mvt_with_routes;
2
+
3
+ CREATE VIEW v_information_panels_for_mvt_with_routes AS
4
+ SELECT
5
+ ip.id,
6
+ ip.preset,
7
+ ip.geometry,
8
+ concat_ws(' ', ip.name, ip.stop_name, STRING_AGG(p.note, ' ')) AS search_fields,
9
+ -- Cast to text so mvt-maps' FilterBuilder can process the column via `NULLIF(routes, '')::jsonb`
10
+ COALESCE(
11
+ JSONB_AGG(
12
+ JSONB_BUILD_OBJECT(
13
+ 'route_name', p.route_name,
14
+ 'route_type', r.route_type,
15
+ 'route_short_name', r.route_short_name,
16
+ 'route_id', r.route_id
17
+ )
18
+ ) FILTER (WHERE r.preset_id IS NOT NULL),
19
+ '[]'::jsonb
20
+ )::text AS routes
21
+ FROM information_panels ip
22
+ INNER JOIN information_panels_presets p
23
+ ON p.information_panel_document_id = ip.document_id AND NOT p.is_testing
24
+ LEFT JOIN information_panels_presets_routes r ON r.preset_id = p.id
25
+ WHERE ip.state = 'Hotovo'
26
+ AND ip.geometry IS NOT NULL
27
+ AND ip.data_source = 'Golemio'
28
+ GROUP BY ip.id;
@@ -0,0 +1,28 @@
1
+ DROP VIEW IF EXISTS v_information_panels_for_mvt_with_routes;
2
+
3
+ CREATE VIEW v_information_panels_for_mvt_with_routes AS
4
+ SELECT
5
+ ip.id,
6
+ ip.preset,
7
+ ip.geometry,
8
+ ip.name AS search_fields,
9
+ -- Cast to text so mvt-maps' FilterBuilder can process the column via `NULLIF(routes, '')::jsonb`
10
+ COALESCE(
11
+ JSONB_AGG(
12
+ JSONB_BUILD_OBJECT(
13
+ 'route_name', p.route_name,
14
+ 'route_type', r.route_type,
15
+ 'route_short_name', r.route_short_name,
16
+ 'route_id', r.route_id
17
+ )
18
+ ) FILTER (WHERE r.preset_id IS NOT NULL),
19
+ '[]'::jsonb
20
+ )::text AS routes
21
+ FROM information_panels ip
22
+ INNER JOIN information_panels_presets p
23
+ ON p.information_panel_document_id = ip.document_id AND NOT p.is_testing
24
+ LEFT JOIN information_panels_presets_routes r ON r.preset_id = p.id
25
+ WHERE ip.state = 'Hotovo'
26
+ AND ip.geometry IS NOT NULL
27
+ AND ip.data_source = 'Golemio'
28
+ GROUP BY ip.id;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@golemio/fypr",
3
- "version": "1.11.0",
3
+ "version": "1.11.1-dev.2826403964",
4
4
  "description": "Golemio FYPR Module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",