@golemio/waze-tt 1.2.4 → 1.2.5-rc.1496549354

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.
@@ -1,9 +1,9 @@
1
- DROP VIEW analytic.v_wazett_routes_lines;
2
-
3
- CREATE OR REPLACE VIEW analytic.v_wazett_routes_lines
4
- AS SELECT wazett_routes.id,
5
- wazett_routes.name,
6
- st_astext(wazett_routes.line) AS line,
7
- concat('#', "left"(lpad(to_hex((wazett_routes.id::double precision * character_length(wazett_routes.name)::double precision / (( SELECT max(wazett_routes_1.id * character_length(wazett_routes_1.name)) AS max
8
- FROM wazett.wazett_routes wazett_routes_1))::double precision * 10000000::double precision)::bigint), 6, '0'::text), 6)) AS color
9
- FROM wazett.wazett_routes;
1
+ DROP VIEW analytic.v_wazett_routes_lines;
2
+
3
+ CREATE OR REPLACE VIEW analytic.v_wazett_routes_lines
4
+ AS SELECT wazett_routes.id,
5
+ wazett_routes.name,
6
+ st_astext(wazett_routes.line) AS line,
7
+ concat('#', "left"(lpad(to_hex((wazett_routes.id::double precision * character_length(wazett_routes.name)::double precision / (( SELECT max(wazett_routes_1.id * character_length(wazett_routes_1.name)) AS max
8
+ FROM wazett.wazett_routes wazett_routes_1))::double precision * 10000000::double precision)::bigint), 6, '0'::text), 6)) AS color
9
+ FROM wazett.wazett_routes;
@@ -1,10 +1,10 @@
1
- DROP VIEW analytic.v_wazett_routes_lines;
2
-
3
- CREATE OR REPLACE VIEW analytic.v_wazett_routes_lines
4
- AS SELECT wazett_routes.id,
5
- wazett_routes.name,
6
- st_astext(wazett_routes.line) AS line,
7
- concat('#', "left"(lpad(to_hex((wazett_routes.id::double precision * character_length(wazett_routes.name)::double precision / (( SELECT min(wazett_routes_1.id * character_length(wazett_routes_1.name)) AS min
8
- FROM wazett.wazett_routes wazett_routes_1))::double precision * 10000000::double precision)::bigint), 6, '0'::text), 6)) AS color
9
- FROM wazett.wazett_routes;
1
+ DROP VIEW analytic.v_wazett_routes_lines;
2
+
3
+ CREATE OR REPLACE VIEW analytic.v_wazett_routes_lines
4
+ AS SELECT wazett_routes.id,
5
+ wazett_routes.name,
6
+ st_astext(wazett_routes.line) AS line,
7
+ concat('#', "left"(lpad(to_hex((wazett_routes.id::double precision * character_length(wazett_routes.name)::double precision / (( SELECT min(wazett_routes_1.id * character_length(wazett_routes_1.name)) AS min
8
+ FROM wazett.wazett_routes wazett_routes_1))::double precision * 10000000::double precision)::bigint), 6, '0'::text), 6)) AS color
9
+ FROM wazett.wazett_routes;
10
10
 
@@ -1,2 +1,2 @@
1
- drop VIEW analytic.v_sck_route_live;
1
+ drop VIEW analytic.v_sck_route_live;
2
2
  drop VIEW analytic.v_sck_route_details;
@@ -1,63 +1,63 @@
1
- -- pavelp.v_sck_route_details source
2
-
3
- CREATE OR REPLACE VIEW analytic.v_sck_route_details
4
- AS
5
- SELECT DISTINCT
6
- ON ((wazett_routes.name::json ->> 'project'::text), (wazett_routes.name::json ->> 'route number'::text), (wazett_routes.name::json ->> 'dir'::text)) wazett_routes.id,
7
- wazett_routes.name::json ->> 'name'::text AS name ,
8
- false AS section ,
9
- CASE
10
- WHEN
11
- (wazett_routes.name::json ->> 'dir'::text) = 'Tam'::text
12
- THEN
13
- false
14
- ELSE
15
- true
16
- END AS reverse_direction,
17
- wazett_routes.from_name ,
18
- wazett_routes.to_name ,
19
- wazett_routes.name::json ->> 'route number'::text AS poradi
20
- FROM
21
- wazett.wazett_routes
22
- WHERE
23
- wazett_routes.feed_id = 7
24
- AND wazett_routes.name ~~ '{%'::text
25
- AND (
26
- wazett_routes.name::json ->> 'project'::text) = 'IPR SčK'::text
27
- ORDER BY
28
- (wazett_routes.name::json ->> 'project'::text) ,
29
- (wazett_routes.name::json ->> 'route number'::text),
30
- (wazett_routes.name::json ->> 'dir'::text) ,
31
- wazett_routes.created_at DESC;
32
-
33
-
34
-
35
-
36
- -- v_sck_route_live source
37
-
38
- CREATE OR REPLACE VIEW analytic.v_sck_route_live
39
- AS
40
- SELECT
41
- wrl.route_id ,
42
- wrl.update_time ,
43
- wrl."time" ,
44
- wrl.length ,
45
- wrl.historic_time ,
46
- wrl.jam_level ,
47
- wrl.create_batch_id,
48
- wrl.created_at ,
49
- wrl.created_by ,
50
- wrl.update_batch_id,
51
- wrl.updated_at ,
52
- wrl.updated_by
53
- FROM
54
- wazett.wazett_route_lives wrl
55
- WHERE
56
- (
57
- wrl.route_id IN
58
- (
59
- SELECT DISTINCT
60
- vsrd.id
61
- FROM
62
- analytic.v_sck_route_details vsrd))
1
+ -- pavelp.v_sck_route_details source
2
+
3
+ CREATE OR REPLACE VIEW analytic.v_sck_route_details
4
+ AS
5
+ SELECT DISTINCT
6
+ ON ((wazett_routes.name::json ->> 'project'::text), (wazett_routes.name::json ->> 'route number'::text), (wazett_routes.name::json ->> 'dir'::text)) wazett_routes.id,
7
+ wazett_routes.name::json ->> 'name'::text AS name ,
8
+ false AS section ,
9
+ CASE
10
+ WHEN
11
+ (wazett_routes.name::json ->> 'dir'::text) = 'Tam'::text
12
+ THEN
13
+ false
14
+ ELSE
15
+ true
16
+ END AS reverse_direction,
17
+ wazett_routes.from_name ,
18
+ wazett_routes.to_name ,
19
+ wazett_routes.name::json ->> 'route number'::text AS poradi
20
+ FROM
21
+ wazett.wazett_routes
22
+ WHERE
23
+ wazett_routes.feed_id = 7
24
+ AND wazett_routes.name ~~ '{%'::text
25
+ AND (
26
+ wazett_routes.name::json ->> 'project'::text) = 'IPR SčK'::text
27
+ ORDER BY
28
+ (wazett_routes.name::json ->> 'project'::text) ,
29
+ (wazett_routes.name::json ->> 'route number'::text),
30
+ (wazett_routes.name::json ->> 'dir'::text) ,
31
+ wazett_routes.created_at DESC;
32
+
33
+
34
+
35
+
36
+ -- v_sck_route_live source
37
+
38
+ CREATE OR REPLACE VIEW analytic.v_sck_route_live
39
+ AS
40
+ SELECT
41
+ wrl.route_id ,
42
+ wrl.update_time ,
43
+ wrl."time" ,
44
+ wrl.length ,
45
+ wrl.historic_time ,
46
+ wrl.jam_level ,
47
+ wrl.create_batch_id,
48
+ wrl.created_at ,
49
+ wrl.created_by ,
50
+ wrl.update_batch_id,
51
+ wrl.updated_at ,
52
+ wrl.updated_by
53
+ FROM
54
+ wazett.wazett_route_lives wrl
55
+ WHERE
56
+ (
57
+ wrl.route_id IN
58
+ (
59
+ SELECT DISTINCT
60
+ vsrd.id
61
+ FROM
62
+ analytic.v_sck_route_details vsrd))
63
63
  AND wrl.update_time::double precision >= (date_part('epoch'::text, CURRENT_DATE - '7 days'::interval) * 1000::double precision);
@@ -1,32 +1,32 @@
1
- -- pavelp.v_sck_route_details source
2
-
3
- CREATE OR REPLACE VIEW analytic.v_sck_route_details
4
- AS
5
- SELECT DISTINCT
6
- ON ((wazett_routes.name::json ->> 'project'::text), (wazett_routes.name::json ->> 'route number'::text), (wazett_routes.name::json ->> 'dir'::text)) wazett_routes.id,
7
- wazett_routes.name::json ->> 'name'::text AS name ,
8
- false AS section ,
9
- CASE
10
- WHEN
11
- (wazett_routes.name::json ->> 'dir'::text) = 'Tam'::text
12
- THEN
13
- false
14
- ELSE
15
- true
16
- END AS reverse_direction,
17
- wazett_routes.from_name ,
18
- wazett_routes.to_name ,
19
- wazett_routes.name::json ->> 'route number'::text AS poradi
20
- FROM
21
- wazett.wazett_routes
22
- WHERE
23
- wazett_routes.feed_id = 7
24
- AND wazett_routes.name ~~ '{%'::text
25
- AND (
26
- wazett_routes.name::json ->> 'project'::text) = 'IPR SčK'::text
27
- ORDER BY
28
- (wazett_routes.name::json ->> 'project'::text) ,
29
- (wazett_routes.name::json ->> 'route number'::text),
30
- (wazett_routes.name::json ->> 'dir'::text) ,
31
- wazett_routes.created_at DESC;
32
-
1
+ -- pavelp.v_sck_route_details source
2
+
3
+ CREATE OR REPLACE VIEW analytic.v_sck_route_details
4
+ AS
5
+ SELECT DISTINCT
6
+ ON ((wazett_routes.name::json ->> 'project'::text), (wazett_routes.name::json ->> 'route number'::text), (wazett_routes.name::json ->> 'dir'::text)) wazett_routes.id,
7
+ wazett_routes.name::json ->> 'name'::text AS name ,
8
+ false AS section ,
9
+ CASE
10
+ WHEN
11
+ (wazett_routes.name::json ->> 'dir'::text) = 'Tam'::text
12
+ THEN
13
+ false
14
+ ELSE
15
+ true
16
+ END AS reverse_direction,
17
+ wazett_routes.from_name ,
18
+ wazett_routes.to_name ,
19
+ wazett_routes.name::json ->> 'route number'::text AS poradi
20
+ FROM
21
+ wazett.wazett_routes
22
+ WHERE
23
+ wazett_routes.feed_id = 7
24
+ AND wazett_routes.name ~~ '{%'::text
25
+ AND (
26
+ wazett_routes.name::json ->> 'project'::text) = 'IPR SčK'::text
27
+ ORDER BY
28
+ (wazett_routes.name::json ->> 'project'::text) ,
29
+ (wazett_routes.name::json ->> 'route number'::text),
30
+ (wazett_routes.name::json ->> 'dir'::text) ,
31
+ wazett_routes.created_at DESC;
32
+
@@ -1,16 +1,16 @@
1
- -- pavelp.v_sck_route_details source
2
-
3
- CREATE OR REPLACE VIEW analytic.v_sck_route_details
4
- AS SELECT DISTINCT ON ((wazett_routes.name::json ->> 'project'::text), (wazett_routes.name::json ->> 'route number'::text), (wazett_routes.name::json ->> 'dir'::text)) wazett_routes.id,
5
- concat(wazett_routes.name::json ->> 'route number'::text, ' ', wazett_routes.name::json ->> 'name'::text) AS name,
6
- false AS section,
7
- CASE
8
- WHEN (wazett_routes.name::json ->> 'dir'::text) = 'Tam'::text THEN false
9
- ELSE true
10
- END AS reverse_direction,
11
- wazett_routes.from_name,
12
- wazett_routes.to_name,
13
- wazett_routes.name::json ->> 'route number'::text AS poradi
14
- FROM wazett.wazett_routes
15
- WHERE wazett_routes.feed_id = 7 AND wazett_routes.name ~~ '{%'::text AND (wazett_routes.name::json ->> 'project'::text) = 'IPR SčK'::text
1
+ -- pavelp.v_sck_route_details source
2
+
3
+ CREATE OR REPLACE VIEW analytic.v_sck_route_details
4
+ AS SELECT DISTINCT ON ((wazett_routes.name::json ->> 'project'::text), (wazett_routes.name::json ->> 'route number'::text), (wazett_routes.name::json ->> 'dir'::text)) wazett_routes.id,
5
+ concat(wazett_routes.name::json ->> 'route number'::text, ' ', wazett_routes.name::json ->> 'name'::text) AS name,
6
+ false AS section,
7
+ CASE
8
+ WHEN (wazett_routes.name::json ->> 'dir'::text) = 'Tam'::text THEN false
9
+ ELSE true
10
+ END AS reverse_direction,
11
+ wazett_routes.from_name,
12
+ wazett_routes.to_name,
13
+ wazett_routes.name::json ->> 'route number'::text AS poradi
14
+ FROM wazett.wazett_routes
15
+ WHERE wazett_routes.feed_id = 7 AND wazett_routes.name ~~ '{%'::text AND (wazett_routes.name::json ->> 'project'::text) = 'IPR SčK'::text
16
16
  ORDER BY (wazett_routes.name::json ->> 'project'::text), (wazett_routes.name::json ->> 'route number'::text), (wazett_routes.name::json ->> 'dir'::text), wazett_routes.created_at DESC;
@@ -1,28 +1,28 @@
1
- -- v_sck_route_live source
2
-
3
- CREATE OR REPLACE VIEW analytic.v_sck_route_live
4
- AS
5
- SELECT
6
- wrl.route_id ,
7
- wrl.update_time ,
8
- wrl."time" ,
9
- wrl.length ,
10
- wrl.historic_time ,
11
- wrl.jam_level ,
12
- wrl.create_batch_id,
13
- wrl.created_at ,
14
- wrl.created_by ,
15
- wrl.update_batch_id,
16
- wrl.updated_at ,
17
- wrl.updated_by
18
- FROM
19
- wazett.wazett_route_lives wrl
20
- WHERE
21
- (
22
- wrl.route_id IN
23
- (
24
- SELECT DISTINCT
25
- vsrd.id
26
- FROM
27
- analytic.v_sck_route_details vsrd))
1
+ -- v_sck_route_live source
2
+
3
+ CREATE OR REPLACE VIEW analytic.v_sck_route_live
4
+ AS
5
+ SELECT
6
+ wrl.route_id ,
7
+ wrl.update_time ,
8
+ wrl."time" ,
9
+ wrl.length ,
10
+ wrl.historic_time ,
11
+ wrl.jam_level ,
12
+ wrl.create_batch_id,
13
+ wrl.created_at ,
14
+ wrl.created_by ,
15
+ wrl.update_batch_id,
16
+ wrl.updated_at ,
17
+ wrl.updated_by
18
+ FROM
19
+ wazett.wazett_route_lives wrl
20
+ WHERE
21
+ (
22
+ wrl.route_id IN
23
+ (
24
+ SELECT DISTINCT
25
+ vsrd.id
26
+ FROM
27
+ analytic.v_sck_route_details vsrd))
28
28
  AND wrl.update_time::double precision >= (date_part('epoch'::text, CURRENT_DATE - '7 days'::interval) * 1000::double precision);
@@ -1,16 +1,16 @@
1
- CREATE OR REPLACE VIEW analytic.v_sck_route_live AS
2
- SELECT wrl.route_id,
3
- wrl.update_time,
4
- wrl."time",
5
- wrl.length,
6
- wrl.historic_time,
7
- wrl.jam_level,
8
- wrl.create_batch_id,
9
- wrl.created_at,
10
- wrl.created_by,
11
- wrl.update_batch_id,
12
- wrl.updated_at,
13
- wrl.updated_by
14
- FROM wazett.wazett_route_lives wrl
15
- WHERE (wrl.route_id IN ( SELECT DISTINCT vsrd.id FROM analytic.v_sck_route_details vsrd))
16
- AND wrl.update_time >= 1675206000; -- 2023-02-01
1
+ CREATE OR REPLACE VIEW analytic.v_sck_route_live AS
2
+ SELECT wrl.route_id,
3
+ wrl.update_time,
4
+ wrl."time",
5
+ wrl.length,
6
+ wrl.historic_time,
7
+ wrl.jam_level,
8
+ wrl.create_batch_id,
9
+ wrl.created_at,
10
+ wrl.created_by,
11
+ wrl.update_batch_id,
12
+ wrl.updated_at,
13
+ wrl.updated_by
14
+ FROM wazett.wazett_route_lives wrl
15
+ WHERE (wrl.route_id IN ( SELECT DISTINCT vsrd.id FROM analytic.v_sck_route_details vsrd))
16
+ AND wrl.update_time >= 1675206000; -- 2023-02-01
@@ -1,7 +1,7 @@
1
- drop PROCEDURE analytic.update_tsk_bm2;
2
-
3
- drop TABLE analytic.tsk_bm2_route_hour_core;
4
- drop TABLE analytic.tsk_bm2_data_all;
5
-
6
- drop MATERIALIZED VIEW analytic.mv_tsk_bm2_normal;
1
+ drop PROCEDURE analytic.update_tsk_bm2;
2
+
3
+ drop TABLE analytic.tsk_bm2_route_hour_core;
4
+ drop TABLE analytic.tsk_bm2_data_all;
5
+
6
+ drop MATERIALIZED VIEW analytic.mv_tsk_bm2_normal;
7
7
  drop VIEW analytic.v_tsk_bm2_route;
@@ -0,0 +1,121 @@
1
+ asyncapi: 3.0.0
2
+ info:
3
+ title: 💡👻 Waze TT
4
+ version: 1.0.0
5
+ description: This document describes internal RabbitMQ queues of the Waze TT module.
6
+ contact:
7
+ name: Golemio Prague Data Plaform
8
+ email: golemio@operatorict.cz
9
+ url: https://golemio.cz
10
+ operations:
11
+ wazett.fetchAndSaveDataToDB:
12
+ action: "send"
13
+ channel:
14
+ $ref: "#/channels/wazett.fetchAndSaveDataToDB"
15
+ wazett.saveS3DataToDB:
16
+ action: "send"
17
+ channel:
18
+ $ref: "#/channels/wazett.saveS3DataToDB"
19
+ channels:
20
+ wazett.fetchAndSaveDataToDB:
21
+ address: dataplatform.wazett.fetchAndSaveDataToDB
22
+ description: Fetch data from sources and save the data to database
23
+ bindings:
24
+ amqp:
25
+ is: queue
26
+ queue:
27
+ durable: true
28
+ messages:
29
+ empty:
30
+ $ref: "#/components/messages/emptyMessage"
31
+ wazett.saveS3DataToDB:
32
+ address: dataplatform.wazett.saveS3DataToDB
33
+ description: Save data to database
34
+ bindings:
35
+ amqp:
36
+ is: queue
37
+ queue:
38
+ durable: true
39
+ messages:
40
+ data:
41
+ $ref: "#/components/messages/wazett.saveS3DataToDB"
42
+ components:
43
+ messages:
44
+ emptyMessage:
45
+ title: Empty message
46
+ wazett.saveS3DataToDB:
47
+ payload:
48
+ $ref: "#/components/schemas/wazett.IWazeTTData"
49
+ schemas:
50
+ wazett.IWazeTTData:
51
+ type: object
52
+ properties:
53
+ usersOnJams:
54
+ type: array
55
+ items:
56
+ type: object
57
+ properties:
58
+ wazersCount:
59
+ type:
60
+ - number
61
+ - string
62
+ jamLevel:
63
+ type:
64
+ - integer
65
+ - string
66
+ routes:
67
+ type: array
68
+ items:
69
+ type: object
70
+ properties:
71
+ toName:
72
+ type: string
73
+ historicTime:
74
+ type:
75
+ - integer
76
+ - string
77
+ line:
78
+ type: array
79
+ items:
80
+ type: object
81
+ bbox:
82
+ type: object
83
+ name:
84
+ type: string
85
+ fromName:
86
+ type: string
87
+ length:
88
+ type: number
89
+ jamLevel:
90
+ type: number
91
+ id:
92
+ type: string
93
+ pattern: "^[0-9]+$"
94
+ time:
95
+ type:
96
+ - integer
97
+ - string
98
+ type:
99
+ type:
100
+ - integer
101
+ - string
102
+ jams:
103
+ type: array
104
+ irregularities:
105
+ type: array
106
+ broadcasterId:
107
+ type: string
108
+ areaName:
109
+ type: string
110
+ bbox:
111
+ type: object
112
+ name:
113
+ type: string
114
+ isMetric:
115
+ type: boolean
116
+ restrictions:
117
+ type: object
118
+ lengthOfJams:
119
+ type: array
120
+ updateTime:
121
+ type: number
@@ -0,0 +1,5 @@
1
+ # Implementační dokumentace modulu *waze-tt*
2
+
3
+ ## Zpracování dat / transformace
4
+
5
+ Interní RabbitMQ fronty jsou popsány v [AsyncAPI](./asyncapi.yaml).
package/docs/index.md ADDED
@@ -0,0 +1,3 @@
1
+ # @golemio/waze-tt
2
+
3
+ This module is intended for use with Golemio services.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@golemio/waze-tt",
3
- "version": "1.2.4",
3
+ "version": "1.2.5-rc.1496549354",
4
4
  "description": "Golemio Waze TT Module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",