@golemio/waze-tt 1.0.8-dev.576822019 → 1.0.9-dev.634446547

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.
Files changed (31) hide show
  1. package/db/migrations/postgresql/.config.json +3 -0
  2. package/db/migrations/postgresql/20220519071520-wazett.js +53 -0
  3. package/db/migrations/postgresql/20220908064516-analytic-function-and-views.js +53 -0
  4. package/db/migrations/postgresql/package.json +3 -0
  5. package/db/migrations/postgresql/sqls/20220519071520-wazett-down.sql +6 -0
  6. package/db/migrations/postgresql/sqls/20220519071520-wazett-up.sql +127 -0
  7. package/db/migrations/postgresql/sqls/20220908064516-analytic-function-and-views-down.sql +19 -0
  8. package/db/migrations/postgresql/sqls/20220908064516-analytic-function-and-views-up.sql +866 -0
  9. package/db/migrations/postgresql/sqls/package.json +3 -0
  10. package/dist/integration-engine/WazeTTWorker.d.ts +6 -0
  11. package/dist/integration-engine/WazeTTWorker.js +75 -52
  12. package/dist/integration-engine/WazeTTWorker.js.map +1 -1
  13. package/dist/integration-engine/wazeTTTransformations/WazeTTTransformationsSubRouteLives.d.ts +3 -2
  14. package/dist/integration-engine/wazeTTTransformations/WazeTTTransformationsSubRouteLives.js +0 -5
  15. package/dist/integration-engine/wazeTTTransformations/WazeTTTransformationsSubRouteLives.js.map +1 -1
  16. package/dist/integration-engine/wazeTTTransformations/WazeTTTransformationsSubRoutes.d.ts +3 -2
  17. package/dist/integration-engine/wazeTTTransformations/WazeTTTransformationsSubRoutes.js +7 -2
  18. package/dist/integration-engine/wazeTTTransformations/WazeTTTransformationsSubRoutes.js.map +1 -1
  19. package/dist/integration-engine/wazeTTTransformations/helpers/SubRouteIdHelper.d.ts +8 -0
  20. package/dist/integration-engine/wazeTTTransformations/helpers/SubRouteIdHelper.js +36 -0
  21. package/dist/integration-engine/wazeTTTransformations/helpers/SubRouteIdHelper.js.map +1 -0
  22. package/dist/integration-engine/wazeTTTransformations/interfaces/ISubRoute.d.ts +8 -0
  23. package/dist/integration-engine/wazeTTTransformations/interfaces/ISubRoute.js +3 -0
  24. package/dist/integration-engine/wazeTTTransformations/interfaces/ISubRoute.js.map +1 -0
  25. package/dist/integration-engine/wazeTTTransformations/interfaces/ISubRouteLives.d.ts +9 -0
  26. package/dist/integration-engine/wazeTTTransformations/interfaces/ISubRouteLives.js +3 -0
  27. package/dist/integration-engine/wazeTTTransformations/interfaces/ISubRouteLives.js.map +1 -0
  28. package/dist/schema-definitions/index.d.ts +3 -2
  29. package/dist/schema-definitions/index.js +12 -12
  30. package/dist/schema-definitions/index.js.map +1 -1
  31. package/package.json +4 -1
@@ -0,0 +1,3 @@
1
+ {
2
+ "schema": "wazett, public"
3
+ }
@@ -0,0 +1,53 @@
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
+ /**
11
+ * We receive the dbmigrate dependency from dbmigrate initially.
12
+ * This enables us to not have to rely on NODE_PATH.
13
+ */
14
+ exports.setup = function(options, seedLink) {
15
+ dbm = options.dbmigrate;
16
+ type = dbm.dataType;
17
+ seed = seedLink;
18
+ Promise = options.Promise;
19
+ };
20
+
21
+ exports.up = function(db) {
22
+ var filePath = path.join(__dirname, 'sqls', '20220519071520-wazett-up.sql');
23
+ return new Promise( function( resolve, reject ) {
24
+ fs.readFile(filePath, {encoding: 'utf-8'}, function(err,data){
25
+ if (err) return reject(err);
26
+ console.log('received data: ' + data);
27
+
28
+ resolve(data);
29
+ });
30
+ })
31
+ .then(function(data) {
32
+ return db.runSql(data);
33
+ });
34
+ };
35
+
36
+ exports.down = function(db) {
37
+ var filePath = path.join(__dirname, 'sqls', '20220519071520-wazett-down.sql');
38
+ return new Promise( function( resolve, reject ) {
39
+ fs.readFile(filePath, {encoding: 'utf-8'}, function(err,data){
40
+ if (err) return reject(err);
41
+ console.log('received data: ' + data);
42
+
43
+ resolve(data);
44
+ });
45
+ })
46
+ .then(function(data) {
47
+ return db.runSql(data);
48
+ });
49
+ };
50
+
51
+ exports._meta = {
52
+ "version": 1
53
+ };
@@ -0,0 +1,53 @@
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
+ /**
11
+ * We receive the dbmigrate dependency from dbmigrate initially.
12
+ * This enables us to not have to rely on NODE_PATH.
13
+ */
14
+ exports.setup = function(options, seedLink) {
15
+ dbm = options.dbmigrate;
16
+ type = dbm.dataType;
17
+ seed = seedLink;
18
+ Promise = options.Promise;
19
+ };
20
+
21
+ exports.up = function(db) {
22
+ var filePath = path.join(__dirname, 'sqls', '20220908064516-analytic-function-and-views-up.sql');
23
+ return new Promise( function( resolve, reject ) {
24
+ fs.readFile(filePath, {encoding: 'utf-8'}, function(err,data){
25
+ if (err) return reject(err);
26
+ console.log('received data: ' + data);
27
+
28
+ resolve(data);
29
+ });
30
+ })
31
+ .then(function(data) {
32
+ return db.runSql(data);
33
+ });
34
+ };
35
+
36
+ exports.down = function(db) {
37
+ var filePath = path.join(__dirname, 'sqls', '20220908064516-analytic-function-and-views-down.sql');
38
+ return new Promise( function( resolve, reject ) {
39
+ fs.readFile(filePath, {encoding: 'utf-8'}, function(err,data){
40
+ if (err) return reject(err);
41
+ console.log('received data: ' + data);
42
+
43
+ resolve(data);
44
+ });
45
+ })
46
+ .then(function(data) {
47
+ return db.runSql(data);
48
+ });
49
+ };
50
+
51
+ exports._meta = {
52
+ "version": 1
53
+ };
@@ -0,0 +1,3 @@
1
+ {
2
+ "type": "commonjs"
3
+ }
@@ -0,0 +1,6 @@
1
+ DROP TABLE wazett_subroute_lives;
2
+ DROP TABLE wazett_route_lives;
3
+ DROP TABLE wazett_subroutes;
4
+ DROP TABLE wazett_routes;
5
+ DROP TABLE wazett_jams_stats;
6
+ DROP TABLE wazett_feeds;
@@ -0,0 +1,127 @@
1
+ -- Drop table
2
+
3
+ -- DROP TABLE wazett_feeds;
4
+
5
+ CREATE TABLE wazett_feeds (
6
+ id int4 NOT NULL,
7
+ area_name text NULL,
8
+ broadcaster_id text NULL,
9
+ "name" text NULL,
10
+ bbox jsonb NULL,
11
+ ismetric bool NULL,
12
+ create_batch_id int8 NULL,
13
+ created_at timestamptz NULL,
14
+ created_by varchar(150) NULL,
15
+ update_batch_id int8 NULL,
16
+ updated_at timestamptz NULL,
17
+ updated_by varchar(150) NULL,
18
+ CONSTRAINT wazett_feeds_pkey PRIMARY KEY (id)
19
+ );
20
+
21
+ -- Drop table
22
+
23
+ -- DROP TABLE wazett_jams_stats;
24
+
25
+ CREATE TABLE wazett_jams_stats (
26
+ feed_id int4 NOT NULL,
27
+ update_time int8 NOT NULL,
28
+ jam_level int4 NOT NULL,
29
+ wazers_count numeric NULL,
30
+ length_of_jams int4 NULL,
31
+ created_at timestamptz NULL,
32
+ updated_at timestamptz NULL,
33
+ create_batch_id int8 NULL,
34
+ created_by varchar(150) NULL,
35
+ update_batch_id int8 NULL,
36
+ updated_by varchar(150) NULL,
37
+ CONSTRAINT wazett_jams_stats_pkey PRIMARY KEY (feed_id, update_time, jam_level),
38
+ CONSTRAINT wazett_jams_stats_to_feed_id FOREIGN KEY (feed_id) REFERENCES wazett_feeds(id)
39
+ );
40
+
41
+ -- Drop table
42
+
43
+ -- DROP TABLE wazett_routes;
44
+
45
+ CREATE TABLE wazett_routes (
46
+ id int8 NOT NULL,
47
+ feed_id int4 NULL,
48
+ from_name text NULL,
49
+ to_name text NULL,
50
+ "name" text NULL,
51
+ bbox jsonb NULL,
52
+ last_update int8 NULL,
53
+ line geometry(linestring, 4326) NULL,
54
+ create_batch_id int8 NULL,
55
+ created_at timestamptz NULL,
56
+ created_by varchar(150) NULL,
57
+ update_batch_id int8 NULL,
58
+ updated_at timestamptz NULL,
59
+ updated_by varchar(150) NULL,
60
+ CONSTRAINT wazett_routes_pkey PRIMARY KEY (id),
61
+ CONSTRAINT wazett_routes_to_feed_id FOREIGN KEY (feed_id) REFERENCES wazett_feeds(id)
62
+ );
63
+
64
+ -- Drop table
65
+
66
+ -- DROP TABLE wazett_route_lives;
67
+
68
+ CREATE TABLE wazett_route_lives (
69
+ route_id int8 NOT NULL,
70
+ update_time int8 NOT NULL,
71
+ "time" int4 NULL,
72
+ length int4 NULL,
73
+ historic_time int4 NULL,
74
+ jam_level int4 NULL,
75
+ create_batch_id int8 NULL,
76
+ created_at timestamptz NULL,
77
+ created_by varchar(150) NULL,
78
+ update_batch_id int8 NULL,
79
+ updated_at timestamptz NULL,
80
+ updated_by varchar(150) NULL,
81
+ CONSTRAINT wazett_route_lives_pkey PRIMARY KEY (update_time, route_id),
82
+ CONSTRAINT wazett_route_lives_to_route_id FOREIGN KEY (route_id) REFERENCES wazett_routes(id)
83
+ );
84
+
85
+ -- Drop table
86
+
87
+ -- DROP TABLE wazett_subroutes;
88
+
89
+ CREATE TABLE wazett_subroutes (
90
+ line_md5 uuid NOT NULL,
91
+ route_id int8 NOT NULL,
92
+ line geometry(linestring, 4326) NULL,
93
+ from_name text NULL,
94
+ to_name text NULL,
95
+ create_batch_id int8 NULL,
96
+ created_at timestamptz NULL,
97
+ created_by varchar(150) NULL,
98
+ update_batch_id int8 NULL,
99
+ updated_at timestamptz NULL,
100
+ updated_by varchar(150) NULL,
101
+ CONSTRAINT wazett_subroutes_pk PRIMARY KEY (line_md5, route_id),
102
+ CONSTRAINT wazett_subroutes_fk FOREIGN KEY (line_md5,route_id) REFERENCES wazett_subroutes(line_md5,route_id),
103
+ CONSTRAINT wazett_subroutes_to_route_id FOREIGN KEY (route_id) REFERENCES wazett_routes(id)
104
+ );
105
+
106
+ -- Drop table
107
+
108
+ -- DROP TABLE wazett_subroute_lives;
109
+
110
+ CREATE TABLE wazett_subroute_lives (
111
+ route_id int8 NOT NULL,
112
+ subroute_line_md5 uuid NOT NULL,
113
+ update_time int8 NOT NULL,
114
+ "time" int4 NULL,
115
+ length int4 NULL,
116
+ historic_time int4 NULL,
117
+ jam_level int4 NULL,
118
+ create_batch_id int8 NULL,
119
+ created_at timestamptz NULL,
120
+ created_by varchar(150) NULL,
121
+ update_batch_id int8 NULL,
122
+ updated_at timestamptz NULL,
123
+ updated_by varchar(150) NULL,
124
+ CONSTRAINT wazett_subroute_lives_pk PRIMARY KEY (route_id, update_time, subroute_line_md5),
125
+ CONSTRAINT wazett_subroute_lives_fk FOREIGN KEY (subroute_line_md5,route_id) REFERENCES wazett_subroutes(line_md5,route_id),
126
+ CONSTRAINT wazett_subroute_lives_to_route_id FOREIGN KEY (route_id) REFERENCES wazett_routes(id)
127
+ );
@@ -0,0 +1,19 @@
1
+ DROP VIEW analytic.v_barrande_data_all;
2
+ DROP VIEW analytic.v_barrande_union_time_interval;
3
+ DROP VIEW analytic.v_barrande_route_hour;
4
+ DROP MATERIALIZED VIEW analytic.mv_barrande_normal;
5
+ DROP VIEW analytic.v_barrande_route_hour_core;
6
+ DROP VIEW public.v_lkpr_export;
7
+ DROP VIEW analytic.v_barrandov_bridge_route_details;
8
+ DROP VIEW analytic.v_lkpr_route_details;
9
+ DROP VIEW analytic.v_barrande_route;
10
+ DROP VIEW analytic.v_wazett_routes_lines;
11
+ DROP VIEW analytic.v_barrandov_bridge_route_live;
12
+ DROP VIEW analytic.v_instatntomtom_days;
13
+ DROP VIEW analytic.v_route_travel_times;
14
+ DROP VIEW analytic.v_barrande_last_update;
15
+ DROP VIEW analytic.v_route_live;
16
+ DROP PROCEDURE analytic.update_barande();
17
+ DROP TABLE analytic.lkpr_dashboard_route_names;
18
+ DROP TABLE analytic.barrande_black_list_route;
19
+ DROP TABLE analytic.waze_dashboard_route_name;