@powercalc/power-router 1.0.34 → 1.0.37

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 (42) hide show
  1. package/package.json +1 -2
  2. package/dist/app.d.ts +0 -1
  3. package/dist/app.js +0 -21
  4. package/dist/converter.d.ts +0 -8
  5. package/dist/converter.js +0 -76
  6. package/dist/genTypes.d.ts +0 -4
  7. package/dist/genTypes.js +0 -60
  8. package/dist/index.d.ts +0 -2
  9. package/dist/index.js +0 -1
  10. package/dist/load.d.ts +0 -7
  11. package/dist/load.js +0 -46
  12. package/dist/router/controllers/LoadAndParse.d.ts +0 -10
  13. package/dist/router/controllers/LoadAndParse.js +0 -64
  14. package/dist/router/controllers/Router.d.ts +0 -7
  15. package/dist/router/controllers/Router.js +0 -112
  16. package/dist/router/index.d.ts +0 -2
  17. package/dist/router/index.js +0 -1
  18. package/dist/router/interfaces/config.d.ts +0 -5
  19. package/dist/router/interfaces/config.js +0 -1
  20. package/dist/router/interfaces/entsoe.d.ts +0 -50
  21. package/dist/router/interfaces/entsoe.js +0 -1
  22. package/dist/router/interfaces/queryoptions.d.ts +0 -15
  23. package/dist/router/interfaces/queryoptions.js +0 -12
  24. package/dist/router/interfaces/types.d.ts +0 -12
  25. package/dist/router/interfaces/types.js +0 -1
  26. package/dist/router/services/CommonTimestamps.d.ts +0 -15
  27. package/dist/router/services/CommonTimestamps.js +0 -169
  28. package/dist/router/services/Eurostat.d.ts +0 -10
  29. package/dist/router/services/Eurostat.js +0 -81
  30. package/dist/router/services/LoadService.d.ts +0 -27
  31. package/dist/router/services/LoadService.js +0 -97
  32. package/dist/router/services/Loader.d.ts +0 -38
  33. package/dist/router/services/Loader.js +0 -134
  34. package/dist/router/services/ParseEdifact.d.ts +0 -28
  35. package/dist/router/services/ParseEdifact.js +0 -155
  36. package/dist/router/services/ParseInstalled.d.ts +0 -9
  37. package/dist/router/services/ParseInstalled.js +0 -41
  38. package/dist/router/services/batch/maxHydrofill.d.ts +0 -10
  39. package/dist/router/services/batch/maxHydrofill.js +0 -78
  40. /package/dist/{config/countries.json → countries.json} +0 -0
  41. /package/dist/{config/countrydata.json → countrydata.json} +0 -0
  42. /package/dist/{config/types.json → types.json} +0 -0
package/package.json CHANGED
@@ -1,10 +1,9 @@
1
1
  {
2
2
  "name": "@powercalc/power-router",
3
- "version": "1.0.34",
3
+ "version": "1.0.37",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
- "type":"module",
8
7
  "scripts": {
9
8
  "test": "echo \"Error: no test specified\" && exit 1",
10
9
  "v": "node -v",
package/dist/app.d.ts DELETED
@@ -1 +0,0 @@
1
- import 'reflect-metadata';
package/dist/app.js DELETED
@@ -1,21 +0,0 @@
1
- import 'reflect-metadata';
2
- process.env["NODE_TLS_REJECT_UNAUTHORIZED"] = '0';
3
- import express from 'express';
4
- import cors from 'cors';
5
- import { join } from 'path';
6
- import { cwd } from 'process';
7
- import { PowerRouter } from './router/controllers/Router';
8
- const app = express();
9
- const port = 30000;
10
- const config = {
11
- securityToken: '1c608639-afff-4d73-bfe1-a960fe7ea8da',
12
- cacheDir: join(cwd(), 'data'),
13
- entsoeDomain: "https://web-api.tp.entsoe.eu"
14
- };
15
- app.use(cors());
16
- app.use('/entsoe', PowerRouter.init(config));
17
- app.use('/public', express.static('public'));
18
- // app.use('/config', express.static('dist/config', { maxAge: 100000 }));
19
- app.listen(port, () => {
20
- console.log(`Server listening on port ${port}`);
21
- });
@@ -1,8 +0,0 @@
1
- export declare class Convert {
2
- static start(): Promise<void>;
3
- static getCountries(): Promise<any>;
4
- static getGeneration(countryCode: string): Promise<any>;
5
- static getLoad(countryCode: string): Promise<any>;
6
- static getPrice(countryCode: string): Promise<any>;
7
- static getHydrofill(countryCode: string): Promise<any>;
8
- }
package/dist/converter.js DELETED
@@ -1,76 +0,0 @@
1
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
- return new (P || (P = Promise))(function (resolve, reject) {
4
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
- step((generator = generator.apply(thisArg, _arguments || [])).next());
8
- });
9
- };
10
- import { GenTypes } from "./genTypes";
11
- import { Hydrofill } from "./router/services/batch/maxHydrofill";
12
- import { writeFile } from 'node:fs/promises';
13
- export class Convert {
14
- static start() {
15
- return __awaiter(this, void 0, void 0, function* () {
16
- const countries = yield this.getCountries();
17
- console.log(countries);
18
- for (const country of countries) {
19
- const types = yield GenTypes.getTypes(country.code);
20
- country.types = types;
21
- console.log(country.name, types.join(', '));
22
- const h = yield Hydrofill.getMaxHydrofill(country.code);
23
- if (h.max) {
24
- const GW = Math.round(h.max / 1000) + ' GW';
25
- console.log(country.name, GW);
26
- country.hydrofill = {
27
- min: h.min,
28
- max: h.max
29
- };
30
- }
31
- const gen = yield this.getGeneration(country.code);
32
- const load = yield this.getLoad(country.code);
33
- const price = yield this.getPrice(country.code);
34
- const hydrofill = yield this.getHydrofill(country.code);
35
- }
36
- console.log(countries);
37
- writeFile('data/countrydata.json', JSON.stringify(countries, null, 2), 'utf-8');
38
- });
39
- }
40
- static getCountries() {
41
- return __awaiter(this, void 0, void 0, function* () {
42
- const url = 'https://powercalculator.eu/entsoe/datalists/countries';
43
- const response = yield fetch(url);
44
- return yield response.json();
45
- });
46
- }
47
- static getGeneration(countryCode) {
48
- return __awaiter(this, void 0, void 0, function* () {
49
- const url = `https://powercalculator.eu/entsoe/${countryCode}/generation?year=2021&month=9`;
50
- const response = yield fetch(url);
51
- return yield response.json();
52
- });
53
- }
54
- static getLoad(countryCode) {
55
- return __awaiter(this, void 0, void 0, function* () {
56
- const url = `https://powercalculator.eu/entsoe/${countryCode}/load?year=2021&month=9`;
57
- const response = yield fetch(url);
58
- return yield response.json();
59
- });
60
- }
61
- static getPrice(countryCode) {
62
- return __awaiter(this, void 0, void 0, function* () {
63
- const url = `https://powercalculator.eu/entsoe/${countryCode}/prices?year=2021&month=9`;
64
- const response = yield fetch(url);
65
- return yield response.json();
66
- });
67
- }
68
- static getHydrofill(countryCode) {
69
- return __awaiter(this, void 0, void 0, function* () {
70
- const url = `https://powercalculator.eu/entsoe/${countryCode}/hydrofill?year=2021`;
71
- const response = yield fetch(url);
72
- return yield response.json();
73
- });
74
- }
75
- }
76
- Convert.start();
@@ -1,4 +0,0 @@
1
- export declare class GenTypes {
2
- static getTypes(country: string): Promise<any[]>;
3
- static makeGen(gen: any, load: any, price: any): any;
4
- }
package/dist/genTypes.js DELETED
@@ -1,60 +0,0 @@
1
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
- return new (P || (P = Promise))(function (resolve, reject) {
4
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
- step((generator = generator.apply(thisArg, _arguments || [])).next());
8
- });
9
- };
10
- import { gzip } from "node:zlib";
11
- import { Load } from "./load";
12
- import { writeFile } from 'node:fs/promises';
13
- export class GenTypes {
14
- static getTypes(country) {
15
- return __awaiter(this, void 0, void 0, function* () {
16
- let types = [];
17
- const minYear = 2015;
18
- const maxYear = 2023;
19
- let min;
20
- let max;
21
- for (let year = minYear; year <= maxYear; year++) {
22
- for (let month = 1; month <= 12; month++) {
23
- const gen = yield Load.getGeneration(country, year, month);
24
- const price = yield Load.getPrice(country, year, month);
25
- const load = yield Load.getLoad(country, year, month);
26
- const all = this.makeGen(gen, load, price);
27
- const gzipfilename = `data/gzip/${country}-${year}-${month}.json.gzip`;
28
- const filename = `data/generation/${country}-${year}-${month}.json`;
29
- const buf = Buffer.from(JSON.stringify(all), 'utf-8');
30
- gzip(buf, (_, result) => __awaiter(this, void 0, void 0, function* () {
31
- var _a;
32
- yield writeFile(gzipfilename, result, 'utf-8');
33
- // console.log(gen.dataset.map((item:any) => item.label))
34
- types = types.concat(((_a = gen.dataset) === null || _a === void 0 ? void 0 : _a.map((item) => item.psrType)) || []);
35
- }));
36
- yield writeFile(filename, JSON.stringify(all, null, 2), 'utf-8');
37
- }
38
- }
39
- return [...new Set(types)].sort();
40
- });
41
- }
42
- static makeGen(gen, load, price) {
43
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
44
- const all = {};
45
- if ((_a = gen.dataset) === null || _a === void 0 ? void 0 : _a[0]) {
46
- all.time = (_d = (_c = (_b = gen.dataset) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c.data) === null || _d === void 0 ? void 0 : _d.map((item) => item.x);
47
- gen.dataset.forEach((dataset) => {
48
- all[dataset.psrType] = dataset.data.map((item) => item.y);
49
- });
50
- }
51
- if ((_f = (_e = load === null || load === void 0 ? void 0 : load.dataset) === null || _e === void 0 ? void 0 : _e[0]) === null || _f === void 0 ? void 0 : _f.data) {
52
- all.A05 = load.dataset[0].data.map((item) => item.y);
53
- }
54
- if ((_g = price === null || price === void 0 ? void 0 : price.dataset) === null || _g === void 0 ? void 0 : _g[0]) {
55
- all.price = price.dataset[0].data.map((item) => item.y);
56
- }
57
- console.log((_h = all.time) === null || _h === void 0 ? void 0 : _h.length, (_j = all.A05) === null || _j === void 0 ? void 0 : _j.length, (_k = all.price) === null || _k === void 0 ? void 0 : _k.length);
58
- return all;
59
- }
60
- }
package/dist/index.d.ts DELETED
@@ -1,2 +0,0 @@
1
- export { Config } from './router/interfaces/config';
2
- export { PowerRouter } from './router/controllers/Router';
package/dist/index.js DELETED
@@ -1 +0,0 @@
1
- export { PowerRouter } from './router/controllers/Router';
package/dist/load.d.ts DELETED
@@ -1,7 +0,0 @@
1
- export declare class Load {
2
- static getCountries(): Promise<any>;
3
- static getGeneration(countryCode: string, year: number, month: number): Promise<any>;
4
- static getLoad(countryCode: string, year: number, month: number): Promise<any>;
5
- static getPrice(countryCode: string, year: number, month: number): Promise<any>;
6
- static getHydrofill(countryCode: string, year: number): Promise<any>;
7
- }
package/dist/load.js DELETED
@@ -1,46 +0,0 @@
1
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
- return new (P || (P = Promise))(function (resolve, reject) {
4
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
- step((generator = generator.apply(thisArg, _arguments || [])).next());
8
- });
9
- };
10
- export class Load {
11
- static getCountries() {
12
- return __awaiter(this, void 0, void 0, function* () {
13
- const url = 'https://powercalculator.eu/entsoe/datalists/countries';
14
- const response = yield fetch(url);
15
- return yield response.json();
16
- });
17
- }
18
- static getGeneration(countryCode, year, month) {
19
- return __awaiter(this, void 0, void 0, function* () {
20
- const url = `https://powercalculator.eu/entsoe/${countryCode}/generation?year=${year}&month=${month}`;
21
- const response = yield fetch(url);
22
- return yield response.json();
23
- });
24
- }
25
- static getLoad(countryCode, year, month) {
26
- return __awaiter(this, void 0, void 0, function* () {
27
- const url = `https://powercalculator.eu/entsoe/${countryCode}/load?year=${year}&month=${month}`;
28
- const response = yield fetch(url);
29
- return yield response.json();
30
- });
31
- }
32
- static getPrice(countryCode, year, month) {
33
- return __awaiter(this, void 0, void 0, function* () {
34
- const url = `https://powercalculator.eu/entsoe/${countryCode}/prices?year=${year}&month=${month}`;
35
- const response = yield fetch(url);
36
- return yield response.json();
37
- });
38
- }
39
- static getHydrofill(countryCode, year) {
40
- return __awaiter(this, void 0, void 0, function* () {
41
- const url = `https://powercalculator.eu/entsoe/${countryCode}/hydrofill?year=${year}`;
42
- const response = yield fetch(url);
43
- return yield response.json();
44
- });
45
- }
46
- }
@@ -1,10 +0,0 @@
1
- import { Request } from 'express';
2
- import { LoadService } from '../services/LoadService';
3
- import { Config } from '../interfaces/config';
4
- export declare class LoadAndParse {
5
- country: string;
6
- private countries;
7
- loadService: LoadService;
8
- constructor(config: Config);
9
- get(req: Request, chartType: string): Promise<any>;
10
- }
@@ -1,64 +0,0 @@
1
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
- return new (P || (P = Promise))(function (resolve, reject) {
4
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
- step((generator = generator.apply(thisArg, _arguments || [])).next());
8
- });
9
- };
10
- import { join } from 'path';
11
- import { readFileSync } from 'fs';
12
- import { LoadService } from '../services/LoadService';
13
- import { Format, PosNeg } from '../interfaces/queryoptions';
14
- export class LoadAndParse {
15
- constructor(config) {
16
- this.country = '';
17
- const countriesFile = join(__dirname, '../config/countries.json'); // Set the path to your config file
18
- this.countries = JSON.parse(readFileSync(countriesFile, 'utf8')); // Read the config file from disk
19
- this.loadService = new LoadService(config);
20
- }
21
- get(req, chartType) {
22
- var _a;
23
- return __awaiter(this, void 0, void 0, function* () {
24
- const country = req.params.country;
25
- if (this.country !== country) {
26
- console.log(`=========== ${country} =============`);
27
- this.country = country;
28
- }
29
- const queryOptions = {};
30
- const year = parseInt(req.params.year);
31
- const month = parseInt(req.params.month);
32
- if (req.query.posneg === PosNeg.POS || req.query.posneg === PosNeg.NEG) {
33
- queryOptions.posneg = req.query.posneg;
34
- }
35
- if (typeof (req.query.format) === 'string' && Object.values(Format).includes(req.query.format)) {
36
- queryOptions.format = req.query.format;
37
- }
38
- let reload = false;
39
- if (typeof (req.headers.reload) === 'string') {
40
- reload = true;
41
- queryOptions.reload = true;
42
- }
43
- const countryCode = (_a = this.countries.find(item => item.name === country)) === null || _a === void 0 ? void 0 : _a.code;
44
- if (!countryCode) {
45
- throw new Error('Unknown country ' + country);
46
- }
47
- if (chartType === 'installed') {
48
- return yield this.loadService.getInstalled(countryCode, reload);
49
- }
50
- if (chartType === 'power') {
51
- return yield this.loadService.getPower(countryCode, year, month, queryOptions);
52
- }
53
- if (chartType === 'hydrofill') {
54
- return yield this.loadService.getHydrofill(countryCode, reload);
55
- }
56
- if (chartType === 'fossil') {
57
- return yield this.loadService.getFossil(countryCode);
58
- }
59
- if (chartType === 'countrydata') {
60
- return yield this.loadService.getCountrydata(countryCode, reload);
61
- }
62
- });
63
- }
64
- }
@@ -1,7 +0,0 @@
1
- import { Router, Request, Response } from 'express';
2
- import { Config } from '../interfaces/config';
3
- export declare class PowerRouter {
4
- static init(config: Config): Router;
5
- static load(config: Config, req: Request, res: Response, type: string): Promise<void>;
6
- static calcCacheTime(req: Request): number;
7
- }
@@ -1,112 +0,0 @@
1
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
- return new (P || (P = Promise))(function (resolve, reject) {
4
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
- step((generator = generator.apply(thisArg, _arguments || [])).next());
8
- });
9
- };
10
- import { Router } from 'express';
11
- import { createHash } from 'crypto';
12
- import { stat, writeFile } from 'fs/promises';
13
- import { gzipSync } from 'zlib';
14
- import { Buffer } from 'node:buffer';
15
- import { createReadStream } from 'fs';
16
- import { LoadAndParse } from './LoadAndParse';
17
- import { join } from 'path';
18
- export class PowerRouter {
19
- static init(config) {
20
- console.log('init', config);
21
- const router = Router();
22
- router.get(`/:country/:year/:month`, (req, res) => __awaiter(this, void 0, void 0, function* () {
23
- yield this.load(config, req, res, 'power');
24
- }));
25
- router.get(`/:country/fossil`, (req, res) => __awaiter(this, void 0, void 0, function* () {
26
- yield this.load(config, req, res, 'fossil');
27
- }));
28
- router.get(`/:country/installed`, (req, res) => __awaiter(this, void 0, void 0, function* () {
29
- yield this.load(config, req, res, 'installed');
30
- }));
31
- router.get(`/:country/hydrofill`, (req, res) => __awaiter(this, void 0, void 0, function* () {
32
- yield this.load(config, req, res, 'hydrofill');
33
- }));
34
- router.get(`/:country/countrydata`, (req, res) => __awaiter(this, void 0, void 0, function* () {
35
- yield this.load(config, req, res, 'countrydata');
36
- }));
37
- router.get('/types', (req, res) => __awaiter(this, void 0, void 0, function* () {
38
- const filePath = join(__dirname, '..', 'config', 'types.json');
39
- res.set({ 'Cache-Control': 'max-age=86400' });
40
- res.sendFile(filePath);
41
- }));
42
- router.get('/countries', (req, res) => __awaiter(this, void 0, void 0, function* () {
43
- const filePath = join(__dirname, '..', 'config', 'countrydata.json');
44
- res.set({ 'Cache-Control': 'max-age=86400' });
45
- res.sendFile(filePath);
46
- }));
47
- return router;
48
- }
49
- static load(config, req, res, type) {
50
- return __awaiter(this, void 0, void 0, function* () {
51
- const entsoeLoader = new LoadAndParse(config);
52
- const cacheTime = this.calcCacheTime(req);
53
- const successHeaders = {
54
- 'Cache-Control': `public, max-age=${cacheTime}`,
55
- 'Content-Encoding': 'gzip',
56
- 'Content-Type': 'application/json'
57
- };
58
- try {
59
- let cacheData;
60
- const cacheKey = req.url;
61
- const cacheFilePath = `${config.cacheDir}/${createHash('md5').update(cacheKey).digest('hex')}.json.gz`;
62
- if (!(req.headers['reload'] === 'full')) {
63
- // check if there is a cache file for this request
64
- try {
65
- const stats = yield stat(cacheFilePath);
66
- const modtime = stats.mtime.getTime();
67
- // Check if the If-Modified-Since header matches the last modified date
68
- const ifModifiedSince = req.headers['if-modified-since'];
69
- if (ifModifiedSince && (modtime - new Date(ifModifiedSince).getTime()) < 5000) {
70
- res.status(304).end();
71
- return;
72
- }
73
- res.setHeader('Last-Modified', (new Date(modtime)).toUTCString());
74
- res.set(successHeaders);
75
- console.log('cached');
76
- createReadStream(cacheFilePath)
77
- .pipe(res);
78
- return;
79
- }
80
- catch (err) {
81
- // no cache file found, continue with request
82
- }
83
- }
84
- // if no cache hit, load data and store in cache
85
- if (!cacheData) {
86
- // LOAD THE DATA FROM SOURCE
87
- const body = yield entsoeLoader.get(req, type);
88
- const buf = Buffer.from(JSON.stringify(body), 'utf-8');
89
- const cacheDataBuffer = gzipSync(buf);
90
- yield writeFile(cacheFilePath, cacheDataBuffer, 'utf-8');
91
- res.setHeader('Last-Modified', (new Date()).toUTCString());
92
- res.set(successHeaders);
93
- res.send(cacheDataBuffer);
94
- }
95
- }
96
- catch (e) {
97
- console.log(e);
98
- }
99
- });
100
- }
101
- static calcCacheTime(req) {
102
- const reqMonth = `${req.params.year} ${req.params.month}`;
103
- const now = new Date();
104
- const nowMonth = `${now.getFullYear()} ${now.getMonth() + 1}`;
105
- if (reqMonth === nowMonth) {
106
- return 5 * 60;
107
- }
108
- else {
109
- return 3600 * 7;
110
- }
111
- }
112
- }
@@ -1,2 +0,0 @@
1
- export { PowerRouter } from './controllers/Router';
2
- export { Config } from './interfaces/config';
@@ -1 +0,0 @@
1
- export { PowerRouter } from './controllers/Router';
@@ -1,5 +0,0 @@
1
- export interface Config {
2
- securityToken: string;
3
- cacheDir: string;
4
- entsoeDomain: string;
5
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1,50 +0,0 @@
1
- export interface Entsoe {
2
- GL_MarketDocument?: EntsoeDocument;
3
- Publication_MarketDocument?: EntsoeDocument;
4
- Acknowledgement_MarketDocument?: ErrorDocument;
5
- }
6
- export interface EntsoeDocument {
7
- TimeSeries: TimeSeries[];
8
- 'period.timeInterval'?: TimeInterval[];
9
- 'time_Period.timeInterval'?: TimeInterval[];
10
- type?: string[];
11
- }
12
- export interface TimeSeries {
13
- Period: EntsoePeriod[];
14
- MktPSRType?: MktPSRType[];
15
- 'outBiddingZone_Domain.mRID': string;
16
- }
17
- export interface EntsoePeriod {
18
- Point: EntsoePoint[];
19
- resolution: string;
20
- timeInterval: TimeInterval[];
21
- }
22
- interface TimeInterval {
23
- start: string[];
24
- end: string[];
25
- }
26
- export interface MktPSRType {
27
- psrType?: string[];
28
- PowerSystemResources?: PowerSystemResource[];
29
- }
30
- export interface EntsoePoint {
31
- position: string[];
32
- quantity?: string[];
33
- 'price.amount'?: string[];
34
- }
35
- export interface PowerSystemResource {
36
- mRID: mRID[];
37
- name: string[];
38
- }
39
- export interface mRID {
40
- _: string;
41
- }
42
- export interface ErrorDocument {
43
- mRID: string;
44
- Reason: Reason[];
45
- }
46
- interface Reason {
47
- code: string[];
48
- text: string[];
49
- }
50
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1,15 +0,0 @@
1
- export interface QueryOptions {
2
- reload?: boolean;
3
- format?: Format;
4
- posneg?: PosNeg;
5
- }
6
- export declare enum Format {
7
- EDIFACT = "edifact",
8
- EDIJSON = "edijson",
9
- SOURCES = "sources",
10
- KEYVALUE = "keyvalue"
11
- }
12
- export declare enum PosNeg {
13
- POS = "pos",
14
- NEG = "neg"
15
- }
@@ -1,12 +0,0 @@
1
- export var Format;
2
- (function (Format) {
3
- Format["EDIFACT"] = "edifact";
4
- Format["EDIJSON"] = "edijson";
5
- Format["SOURCES"] = "sources";
6
- Format["KEYVALUE"] = "keyvalue";
7
- })(Format || (Format = {}));
8
- export var PosNeg;
9
- (function (PosNeg) {
10
- PosNeg["POS"] = "pos";
11
- PosNeg["NEG"] = "neg";
12
- })(PosNeg || (PosNeg = {}));
@@ -1,12 +0,0 @@
1
- export interface Types {
2
- [key: string]: Type;
3
- }
4
- export interface Type {
5
- name: string;
6
- psrType: string;
7
- co2Footprint: number;
8
- color: string;
9
- abbr: string;
10
- yAxis: string;
11
- stack: string;
12
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1,15 +0,0 @@
1
- import { AllInResulotions, DataPoint, DataPointResolutions } from "./ParseEdifact";
2
- export interface Result {
3
- [key: string]: (number | null)[];
4
- }
5
- export declare class CommonTimestamps {
6
- static transform(all: AllInResulotions, startMonth: string, endMonth: string): Result;
7
- static makeCommonTimeBase(all: DataPointResolutions, newTimes: number[], best: string): (number | null)[] | undefined;
8
- static shouldMerge(all: DataPointResolutions): boolean;
9
- static interpolate(all: DataPointResolutions, newTimes: number[]): (number | null)[] | undefined;
10
- private static findTime;
11
- static makeNumbers(all: DataPoint[], newTimes: number[]): (number | null)[];
12
- static makeTimeArray(startIsoString: string, endIsoString: string, resolution: string): number[];
13
- static best(all: any): string;
14
- static bestResolution(all: any): string;
15
- }