@golemio/fypr 1.7.2-dev.2594687674 → 1.7.2-dev.2602634331
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/20260615000000-add-is-testing-to-agg-view.js +47 -0
- package/db/migrations/postgresql/sqls/20260615000000-add-is-testing-to-agg-view-down.sql +21 -0
- package/db/migrations/postgresql/sqls/20260615000000-add-is-testing-to-agg-view-up.sql +20 -0
- package/dist/output-gateway/fypr/transformations/InformationPanelOutputTransformation.js +6 -1
- package/dist/output-gateway/fypr/transformations/InformationPanelOutputTransformation.js.map +1 -1
- package/dist/output-gateway/interfaces/IOGInformationPanelScopes.d.ts +1 -0
- package/dist/schema-definitions/models/InformationPanelPresetsRoutesAggModel.d.ts +1 -0
- package/dist/schema-definitions/models/InformationPanelPresetsRoutesAggModel.js +1 -0
- package/dist/schema-definitions/models/InformationPanelPresetsRoutesAggModel.js.map +1 -1
- package/docs/openapi-output.yaml +5 -0
- package/package.json +1 -1
|
@@ -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', '20260615000000-add-is-testing-to-agg-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', '20260615000000-add-is-testing-to-agg-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,21 @@
|
|
|
1
|
+
DROP VIEW IF EXISTS v_information_panels_presets_routes_agg;
|
|
2
|
+
|
|
3
|
+
CREATE VIEW v_information_panels_presets_routes_agg AS
|
|
4
|
+
SELECT
|
|
5
|
+
p.information_panel_document_id,
|
|
6
|
+
p.route_name,
|
|
7
|
+
p.note,
|
|
8
|
+
COALESCE(
|
|
9
|
+
JSONB_AGG(
|
|
10
|
+
JSONB_BUILD_OBJECT(
|
|
11
|
+
'stop_id', r.stop_id,
|
|
12
|
+
'route_type', r.route_type,
|
|
13
|
+
'route_short_name', r.route_short_name
|
|
14
|
+
)
|
|
15
|
+
) FILTER (WHERE r.preset_id IS NOT NULL),
|
|
16
|
+
'[]'::jsonb
|
|
17
|
+
) AS routes
|
|
18
|
+
FROM information_panels_presets p
|
|
19
|
+
INNER JOIN information_panels ip ON ip.document_id = p.information_panel_document_id
|
|
20
|
+
LEFT JOIN information_panels_presets_routes r ON r.preset_id = p.id
|
|
21
|
+
GROUP BY p.id;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
CREATE OR REPLACE VIEW v_information_panels_presets_routes_agg AS
|
|
2
|
+
SELECT
|
|
3
|
+
p.information_panel_document_id,
|
|
4
|
+
p.route_name,
|
|
5
|
+
p.note,
|
|
6
|
+
COALESCE(
|
|
7
|
+
JSONB_AGG(
|
|
8
|
+
JSONB_BUILD_OBJECT(
|
|
9
|
+
'stop_id', r.stop_id,
|
|
10
|
+
'route_type', r.route_type,
|
|
11
|
+
'route_short_name', r.route_short_name
|
|
12
|
+
)
|
|
13
|
+
) FILTER (WHERE r.preset_id IS NOT NULL),
|
|
14
|
+
'[]'::jsonb
|
|
15
|
+
) AS routes,
|
|
16
|
+
p.is_testing
|
|
17
|
+
FROM information_panels_presets p
|
|
18
|
+
INNER JOIN information_panels ip ON ip.document_id = p.information_panel_document_id
|
|
19
|
+
LEFT JOIN information_panels_presets_routes r ON r.preset_id = p.id
|
|
20
|
+
GROUP BY p.id;
|
|
@@ -23,7 +23,12 @@ let InformationPanelOutputTransformation = class InformationPanelOutputTransform
|
|
|
23
23
|
panel_size: this.parsePanelSize(panel_size),
|
|
24
24
|
};
|
|
25
25
|
if (embeds?.includes("routes") && presetsRoutesAgg?.length) {
|
|
26
|
-
result.routes = presetsRoutesAgg.map(({ route_name, note, routes }) => ({
|
|
26
|
+
result.routes = presetsRoutesAgg.map(({ route_name, note, is_testing, routes }) => ({
|
|
27
|
+
route_name,
|
|
28
|
+
note,
|
|
29
|
+
is_testing,
|
|
30
|
+
routes,
|
|
31
|
+
}));
|
|
27
32
|
}
|
|
28
33
|
return result;
|
|
29
34
|
};
|
package/dist/output-gateway/fypr/transformations/InformationPanelOutputTransformation.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InformationPanelOutputTransformation.js","sourceRoot":"","sources":["../../../../src/output-gateway/fypr/transformations/InformationPanelOutputTransformation.ts"],"names":[],"mappings":";;;;;;;;;AAIA,6GAA0G;AAC1G,iEAAgE;AAGzD,IAAM,oCAAoC,GAA1C,MAAM,oCAAqC,SAAQ,+CAA2D;IAA9G;;QACa,SAAI,GAAG,sCAAsC,CAAC;QAE9C,mBAAc,GAAG,CAAC,IAAsB,EAAE,MAAiB,EAAyB,EAAE,CAClG,IAAI,CAAC,GAAG,CAAC,CAAC,IAAwD,EAAE,EAAE,CAClE,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,MAAM,CAAC,CACrE,CAAC;QAEU,qBAAgB,GAAG,CAC/B,OAA2D,EAC3D,MAAiB,EACE,EAAE,CAAC,IAAI,CAAC,iBAAiB,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;QAE5F,sBAAiB,GAAG,CAAC,KAAqB,EAAE,MAAiB,EAAuB,EAAE;YAC5F,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,gBAAgB,EAAE,GAAG,IAAI,EAAE,GAAG,KAEzD,CAAC;YACF,MAAM,MAAM,GAAwB;gBAChC,GAAG,IAAI;gBACP,OAAO,EAAE,IAAI,CAAC,6BAA6B,CAAC,MAAM,CAAC;gBACnD,UAAU,EAAE,IAAI,CAAC,cAAc,CAAC,UAAU,CAAC;aAC9C,CAAC;YACF,IAAI,MAAM,EAAE,QAAQ,CAAC,QAAQ,CAAC,IAAI,gBAAgB,EAAE,MAAM,EAAE,CAAC;gBACzD,MAAM,CAAC,MAAM,GAAG,gBAAgB,CAAC,GAAG,CAAC,CAAC,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"InformationPanelOutputTransformation.js","sourceRoot":"","sources":["../../../../src/output-gateway/fypr/transformations/InformationPanelOutputTransformation.ts"],"names":[],"mappings":";;;;;;;;;AAIA,6GAA0G;AAC1G,iEAAgE;AAGzD,IAAM,oCAAoC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AC;IAdW,6BAA6B,CAAC,KAAoB;QACtD,IAAI,CAAC,KAAK;YAAE,OAAO,IAAI,CAAC;QACxB,MAAM,KAAK,GAAG,KAAK;aACd,KAAK,CAAC,QAAQ,CAAC;aACf,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;aACpB,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QACjC,OAAO,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC;IAC3C,CAAC;IAEO,cAAc,CAAC,KAAoB;QACvC,IAAI,KAAK,IAAI,IAAI;YAAE,OAAO,IAAI,CAAC;QAC/B,MAAM,MAAM,GAAG,QAAQ,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;QACrD,OAAO,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC;IACzC,CAAC;CACJ,CAAA;AA/CY,oFAAoC;+CAApC,oCAAoC;IADhD,IAAA,qBAAU,GAAE;GACA,oCAAoC,CA+ChD"}
|
|
@@ -5,6 +5,7 @@ export declare class InformationPanelPresetsRoutesAggModel extends Model<InferAt
|
|
|
5
5
|
information_panel_document_id: string;
|
|
6
6
|
route_name: string;
|
|
7
7
|
note: string;
|
|
8
|
+
is_testing: boolean;
|
|
8
9
|
routes: IPresetRouteAgg[];
|
|
9
10
|
static readonly attributeModel: ModelAttributes<InformationPanelPresetsRoutesAggModel>;
|
|
10
11
|
}
|
|
@@ -10,6 +10,7 @@ InformationPanelPresetsRoutesAggModel.attributeModel = {
|
|
|
10
10
|
information_panel_document_id: { type: sequelize_1.DataTypes.STRING, primaryKey: true },
|
|
11
11
|
route_name: { type: sequelize_1.DataTypes.STRING, primaryKey: true },
|
|
12
12
|
note: { type: sequelize_1.DataTypes.STRING },
|
|
13
|
+
is_testing: { type: sequelize_1.DataTypes.BOOLEAN },
|
|
13
14
|
routes: { type: sequelize_1.DataTypes.JSONB },
|
|
14
15
|
};
|
|
15
16
|
//# sourceMappingURL=InformationPanelPresetsRoutesAggModel.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InformationPanelPresetsRoutesAggModel.js","sourceRoot":"","sources":["../../../src/schema-definitions/models/InformationPanelPresetsRoutesAggModel.ts"],"names":[],"mappings":";;;AAAA,mEAAkI;AAGlI,MAAa,qCAAsC,SAAQ,iBAG1D;;AAHD,
|
|
1
|
+
{"version":3,"file":"InformationPanelPresetsRoutesAggModel.js","sourceRoot":"","sources":["../../../src/schema-definitions/models/InformationPanelPresetsRoutesAggModel.ts"],"names":[],"mappings":";;;AAAA,mEAAkI;AAGlI,MAAa,qCAAsC,SAAQ,iBAG1D;;AAHD,sFAmBC;AAf0B,+CAAS,GAAG,yCAAyC,CAAC;AAQtD,oDAAc,GAA2D;IAC5F,6BAA6B,EAAE,EAAE,IAAI,EAAE,qBAAS,CAAC,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE;IAC3E,UAAU,EAAE,EAAE,IAAI,EAAE,qBAAS,CAAC,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE;IACxD,IAAI,EAAE,EAAE,IAAI,EAAE,qBAAS,CAAC,MAAM,EAAE;IAChC,UAAU,EAAE,EAAE,IAAI,EAAE,qBAAS,CAAC,OAAO,EAAE;IACvC,MAAM,EAAE,EAAE,IAAI,EAAE,qBAAS,CAAC,KAAK,EAAE;CACpC,CAAC"}
|
package/docs/openapi-output.yaml
CHANGED
|
@@ -867,6 +867,7 @@ components:
|
|
|
867
867
|
required:
|
|
868
868
|
- route_name
|
|
869
869
|
- note
|
|
870
|
+
- is_testing
|
|
870
871
|
- routes
|
|
871
872
|
properties:
|
|
872
873
|
route_name:
|
|
@@ -877,6 +878,10 @@ components:
|
|
|
877
878
|
type: string
|
|
878
879
|
example: "LED v přístřešku Hradčanská B"
|
|
879
880
|
description: Note describing the preset.
|
|
881
|
+
is_testing:
|
|
882
|
+
type: boolean
|
|
883
|
+
example: false
|
|
884
|
+
description: Whether this preset is a testing preset.
|
|
880
885
|
routes:
|
|
881
886
|
type: array
|
|
882
887
|
description: Routes serving stops in this preset.
|