@golemio/energetics 1.2.3 → 1.2.4-dev.785775004

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.
@@ -425,15 +425,6 @@ AS WITH kalendar AS (
425
425
  FROM fixed_table
426
426
  WHERE fixed_table.value IS NOT NULL;
427
427
 
428
- CREATE OR REPLACE VIEW v_consumption_electricity_oict_api
429
- AS SELECT date_trunc('day'::text, c.timeutc::date::timestamp with time zone) AS den,
430
- c.timeutc::timestamp with time zone AS time_utc,
431
- replace(c.addr, concat('/', c.var), '') AS addr,
432
- 'kWh'::text AS unit,
433
- c.value_txt::integer::numeric * 1.04 AS value_num,
434
- row_number() OVER (PARTITION BY c.addr, (date_trunc('month'::text, c.timeutc::date::timestamp with time zone)) ORDER BY c.value_txt DESC) AS ran
435
- FROM python.consumption_electricity_oict_api2 c;
436
-
437
428
  CREATE OR REPLACE VIEW v_consumption_energy_devices_active
438
429
  AS SELECT consumption_energy_devices.id,
439
430
  consumption_energy_devices.addr,
@@ -1,11 +1 @@
1
- CREATE OR REPLACE VIEW
2
- energetics.v_consumption_electricity_oict_api
3
- AS
4
- SELECT
5
- date_trunc('day'::text, c.timeutc::date::timestamp with time zone) AS den,
6
- c.timeutc::timestamp with time zone AS time_utc,
7
- c.addr,
8
- 'kWh'::text AS unit,
9
- c.value_txt::integer::numeric * 1.04 AS value_num,
10
- row_number() OVER (PARTITION BY c.addr, (date_trunc('month'::text, c.timeutc::date::timestamp with time zone)) ORDER BY c.value_txt DESC) AS ran
11
- FROM python.consumption_electricity_oict_api2 c;
1
+ DROP VIEW IF EXISTS energetics.v_consumption_electricity_oict_api;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@golemio/energetics",
3
- "version": "1.2.3",
3
+ "version": "1.2.4-dev.785775004",
4
4
  "description": "Golemio Energetics Module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -65,4 +65,4 @@
65
65
  "JSONStream": "^1.3.5"
66
66
  },
67
67
  "overrides": {}
68
- }
68
+ }
@@ -1,53 +0,0 @@
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', '20220103101845-electricity-consumption-view-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', '20220103101845-electricity-consumption-view-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
- };
@@ -1,53 +0,0 @@
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', '20221222173532-new-api-source-changes-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', '20221222173532-new-api-source-changes-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
- };
@@ -1 +0,0 @@
1
- DROP VIEW v_consumption_electricity_oict_api;
@@ -1,8 +0,0 @@
1
- CREATE OR REPLACE VIEW v_consumption_electricity_oict_api
2
- AS SELECT date_trunc('day'::text, c.timeutc::date::timestamp with time zone) AS den,
3
- c.timeutc::timestamp with time zone AS time_utc,
4
- c.addr,
5
- c.unit,
6
- c.value_txt::integer::numeric * 1.04 AS value_num,
7
- row_number() OVER (PARTITION BY c.addr, (date_trunc('month'::text, c.timeutc::date::timestamp with time zone)) ORDER BY c.value_txt DESC) AS ran
8
- FROM python.consumption_electricity_oict_api2 c;
@@ -1,18 +0,0 @@
1
- -- pridanie stlpcov
2
- ALTER TABLE python.consumption_electricity_oict_api2
3
- add column timelocal text,
4
- add column meternumber text,
5
- add column commodity text,
6
- add column unit text,
7
- add column ismanualentry bool;
8
-
9
- -- povodna definicia view
10
- CREATE OR REPLACE VIEW v_consumption_electricity_oict_api
11
- AS SELECT date_trunc('day'::text, c.timeutc::date::timestamp with time zone) AS den,
12
- c.timeutc::timestamp with time zone AS time_utc,
13
- c.addr,
14
- c.unit,
15
- c.value_txt::integer::numeric * 1.04 AS value_num,
16
- row_number() OVER (PARTITION BY c.addr, (date_trunc('month'::text, c.timeutc::date::timestamp with time zone)) ORDER BY c.value_txt DESC) AS ran
17
- FROM python.consumption_electricity_oict_api2 c;
18
-
@@ -1,17 +0,0 @@
1
- -- zmena uz existujuceho view v_consumption_electricity_oict_api vyplyvajuca z neexistencie premennej unit v novej api
2
- CREATE OR REPLACE view v_consumption_electricity_oict_api
3
- AS SELECT date_trunc('day'::text, c.timeutc::date::timestamp with time zone) AS den,
4
- c.timeutc::timestamp with time zone AS time_utc,
5
- c.addr,
6
- 'kWh'::text AS unit,
7
- c.value_txt::integer::numeric * 1.04 AS value_num,
8
- row_number() OVER (PARTITION BY c.addr, (date_trunc('month'::text, c.timeutc::date::timestamp with time zone)) ORDER BY c.value_txt DESC) AS ran
9
- FROM python.consumption_electricity_oict_api2 c;
10
-
11
- -- zrusenie premennych, ktore nie su v novej api
12
- ALTER TABLE python.consumption_electricity_oict_api2
13
- DROP COLUMN if exists timelocal,
14
- DROP COLUMN if exists meternumber,
15
- DROP COLUMN if exists commodity,
16
- DROP COLUMN if exists unit,
17
- DROP COLUMN if exists ismanualentry;