@powercalc/power-router 1.0.39 → 1.0.42
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/README.md +6 -0
- package/dist/app.d.ts +1 -1
- package/dist/app.js +26 -26
- package/dist/config/countrydata.json +265 -265
- package/dist/converter.d.ts +8 -8
- package/dist/converter.js +56 -59
- package/dist/converter.js.map +1 -1
- package/dist/genTypes.d.ts +4 -4
- package/dist/genTypes.js +53 -53
- package/dist/index.d.ts +2 -2
- package/dist/index.js +5 -5
- package/dist/load.d.ts +7 -7
- package/dist/load.js +31 -31
- package/dist/router/config/countries.json +194 -0
- package/dist/router/config/countrydata.json +266 -0
- package/dist/router/config/types.json +333 -0
- package/dist/router/controllers/LoadAndParse.d.ts +10 -10
- package/dist/router/controllers/LoadAndParse.js +57 -57
- package/dist/router/controllers/Router.d.ts +7 -7
- package/dist/router/controllers/Router.js +105 -105
- package/dist/router/index.d.ts +2 -2
- package/dist/router/index.js +5 -5
- package/dist/router/interfaces/config.d.ts +5 -5
- package/dist/router/interfaces/config.js +2 -2
- package/dist/router/interfaces/entsoe.d.ts +50 -50
- package/dist/router/interfaces/entsoe.js +2 -2
- package/dist/router/interfaces/queryoptions.d.ts +15 -15
- package/dist/router/interfaces/queryoptions.js +15 -15
- package/dist/router/interfaces/types.d.ts +12 -12
- package/dist/router/interfaces/types.js +2 -2
- package/dist/router/services/CommonTimestamps.d.ts +15 -15
- package/dist/router/services/CommonTimestamps.js +185 -173
- package/dist/router/services/CommonTimestamps.js.map +1 -1
- package/dist/router/services/Eurostat.d.ts +10 -10
- package/dist/router/services/Eurostat.js +72 -72
- package/dist/router/services/Eurostat.js.map +1 -1
- package/dist/router/services/LoadService.d.ts +27 -27
- package/dist/router/services/LoadService.js +82 -82
- package/dist/router/services/Loader.d.ts +38 -38
- package/dist/router/services/Loader.js +119 -121
- package/dist/router/services/Loader.js.map +1 -1
- package/dist/router/services/ParseEdifact.d.ts +28 -28
- package/dist/router/services/ParseEdifact.js +159 -159
- package/dist/router/services/ParseInstalled.d.ts +9 -9
- package/dist/router/services/ParseInstalled.js +45 -45
- package/dist/router/services/batch/maxHydrofill.d.ts +10 -10
- package/dist/router/services/batch/maxHydrofill.js +65 -65
- package/package.json +53 -53
- package/src/converter.ts +61 -64
- package/src/router/config/countrydata.json +265 -265
- package/src/router/services/CommonTimestamps.ts +90 -54
- package/src/router/services/Eurostat.ts +3 -3
- package/src/router/services/Loader.ts +2 -5
|
@@ -1,58 +1,58 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.LoadAndParse = void 0;
|
|
4
|
-
const path_1 = require("path");
|
|
5
|
-
const fs_1 = require("fs");
|
|
6
|
-
const LoadService_1 = require("../services/LoadService");
|
|
7
|
-
const queryoptions_1 = require("../interfaces/queryoptions");
|
|
8
|
-
class LoadAndParse {
|
|
9
|
-
constructor(config) {
|
|
10
|
-
this.country = '';
|
|
11
|
-
const countriesFile = (0, path_1.join)(__dirname, '../config/countries.json'); // Set the path to your config file
|
|
12
|
-
this.countries = JSON.parse((0, fs_1.readFileSync)(countriesFile, 'utf8')); // Read the config file from disk
|
|
13
|
-
this.loadService = new LoadService_1.LoadService(config);
|
|
14
|
-
}
|
|
15
|
-
async get(req, chartType) {
|
|
16
|
-
var _a;
|
|
17
|
-
const country = req.params.country;
|
|
18
|
-
if (this.country !== country) {
|
|
19
|
-
console.log(`=========== ${country} =============`);
|
|
20
|
-
this.country = country;
|
|
21
|
-
}
|
|
22
|
-
const queryOptions = {};
|
|
23
|
-
const year = parseInt(req.params.year);
|
|
24
|
-
const month = parseInt(req.params.month);
|
|
25
|
-
if (req.query.posneg === queryoptions_1.PosNeg.POS || req.query.posneg === queryoptions_1.PosNeg.NEG) {
|
|
26
|
-
queryOptions.posneg = req.query.posneg;
|
|
27
|
-
}
|
|
28
|
-
if (typeof (req.query.format) === 'string' && Object.values(queryoptions_1.Format).includes(req.query.format)) {
|
|
29
|
-
queryOptions.format = req.query.format;
|
|
30
|
-
}
|
|
31
|
-
let reload = false;
|
|
32
|
-
if (typeof (req.headers.reload) === 'string') {
|
|
33
|
-
reload = true;
|
|
34
|
-
queryOptions.reload = true;
|
|
35
|
-
}
|
|
36
|
-
const countryCode = (_a = this.countries.find(item => item.name === country)) === null || _a === void 0 ? void 0 : _a.code;
|
|
37
|
-
if (!countryCode) {
|
|
38
|
-
throw new Error('Unknown country ' + country);
|
|
39
|
-
}
|
|
40
|
-
if (chartType === 'installed') {
|
|
41
|
-
return await this.loadService.getInstalled(countryCode, reload);
|
|
42
|
-
}
|
|
43
|
-
if (chartType === 'power') {
|
|
44
|
-
return await this.loadService.getPower(countryCode, year, month, queryOptions);
|
|
45
|
-
}
|
|
46
|
-
if (chartType === 'hydrofill') {
|
|
47
|
-
return await this.loadService.getHydrofill(countryCode, reload);
|
|
48
|
-
}
|
|
49
|
-
if (chartType === 'fossil') {
|
|
50
|
-
return await this.loadService.getFossil(countryCode);
|
|
51
|
-
}
|
|
52
|
-
if (chartType === 'countrydata') {
|
|
53
|
-
return await this.loadService.getCountrydata(countryCode, reload);
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
exports.LoadAndParse = LoadAndParse;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LoadAndParse = void 0;
|
|
4
|
+
const path_1 = require("path");
|
|
5
|
+
const fs_1 = require("fs");
|
|
6
|
+
const LoadService_1 = require("../services/LoadService");
|
|
7
|
+
const queryoptions_1 = require("../interfaces/queryoptions");
|
|
8
|
+
class LoadAndParse {
|
|
9
|
+
constructor(config) {
|
|
10
|
+
this.country = '';
|
|
11
|
+
const countriesFile = (0, path_1.join)(__dirname, '../config/countries.json'); // Set the path to your config file
|
|
12
|
+
this.countries = JSON.parse((0, fs_1.readFileSync)(countriesFile, 'utf8')); // Read the config file from disk
|
|
13
|
+
this.loadService = new LoadService_1.LoadService(config);
|
|
14
|
+
}
|
|
15
|
+
async get(req, chartType) {
|
|
16
|
+
var _a;
|
|
17
|
+
const country = req.params.country;
|
|
18
|
+
if (this.country !== country) {
|
|
19
|
+
console.log(`=========== ${country} =============`);
|
|
20
|
+
this.country = country;
|
|
21
|
+
}
|
|
22
|
+
const queryOptions = {};
|
|
23
|
+
const year = parseInt(req.params.year);
|
|
24
|
+
const month = parseInt(req.params.month);
|
|
25
|
+
if (req.query.posneg === queryoptions_1.PosNeg.POS || req.query.posneg === queryoptions_1.PosNeg.NEG) {
|
|
26
|
+
queryOptions.posneg = req.query.posneg;
|
|
27
|
+
}
|
|
28
|
+
if (typeof (req.query.format) === 'string' && Object.values(queryoptions_1.Format).includes(req.query.format)) {
|
|
29
|
+
queryOptions.format = req.query.format;
|
|
30
|
+
}
|
|
31
|
+
let reload = false;
|
|
32
|
+
if (typeof (req.headers.reload) === 'string') {
|
|
33
|
+
reload = true;
|
|
34
|
+
queryOptions.reload = true;
|
|
35
|
+
}
|
|
36
|
+
const countryCode = (_a = this.countries.find(item => item.name === country)) === null || _a === void 0 ? void 0 : _a.code;
|
|
37
|
+
if (!countryCode) {
|
|
38
|
+
throw new Error('Unknown country ' + country);
|
|
39
|
+
}
|
|
40
|
+
if (chartType === 'installed') {
|
|
41
|
+
return await this.loadService.getInstalled(countryCode, reload);
|
|
42
|
+
}
|
|
43
|
+
if (chartType === 'power') {
|
|
44
|
+
return await this.loadService.getPower(countryCode, year, month, queryOptions);
|
|
45
|
+
}
|
|
46
|
+
if (chartType === 'hydrofill') {
|
|
47
|
+
return await this.loadService.getHydrofill(countryCode, reload);
|
|
48
|
+
}
|
|
49
|
+
if (chartType === 'fossil') {
|
|
50
|
+
return await this.loadService.getFossil(countryCode);
|
|
51
|
+
}
|
|
52
|
+
if (chartType === 'countrydata') {
|
|
53
|
+
return await this.loadService.getCountrydata(countryCode, reload);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
exports.LoadAndParse = LoadAndParse;
|
|
58
58
|
//# sourceMappingURL=LoadAndParse.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
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
|
+
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,106 +1,106 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PowerRouter = void 0;
|
|
4
|
-
const express_1 = require("express");
|
|
5
|
-
const crypto_1 = require("crypto");
|
|
6
|
-
const promises_1 = require("fs/promises");
|
|
7
|
-
const zlib_1 = require("zlib");
|
|
8
|
-
const node_buffer_1 = require("node:buffer");
|
|
9
|
-
const fs_1 = require("fs");
|
|
10
|
-
const LoadAndParse_1 = require("./LoadAndParse");
|
|
11
|
-
const path_1 = require("path");
|
|
12
|
-
class PowerRouter {
|
|
13
|
-
static init(config) {
|
|
14
|
-
console.log('init', config);
|
|
15
|
-
const router = (0, express_1.Router)();
|
|
16
|
-
router.get(`/:country/:year/:month`, async (req, res) => {
|
|
17
|
-
await this.load(config, req, res, 'power');
|
|
18
|
-
});
|
|
19
|
-
router.get(`/:country/fossil`, async (req, res) => {
|
|
20
|
-
await this.load(config, req, res, 'fossil');
|
|
21
|
-
});
|
|
22
|
-
router.get(`/:country/installed`, async (req, res) => {
|
|
23
|
-
await this.load(config, req, res, 'installed');
|
|
24
|
-
});
|
|
25
|
-
router.get(`/:country/hydrofill`, async (req, res) => {
|
|
26
|
-
await this.load(config, req, res, 'hydrofill');
|
|
27
|
-
});
|
|
28
|
-
router.get(`/:country/countrydata`, async (req, res) => {
|
|
29
|
-
await this.load(config, req, res, 'countrydata');
|
|
30
|
-
});
|
|
31
|
-
router.get('/types', async (req, res) => {
|
|
32
|
-
const filePath = (0, path_1.join)(__dirname, '..', 'config', 'types.json');
|
|
33
|
-
res.set({ 'Cache-Control': 'max-age=86400' });
|
|
34
|
-
res.sendFile(filePath);
|
|
35
|
-
});
|
|
36
|
-
router.get('/countries', async (req, res) => {
|
|
37
|
-
const filePath = (0, path_1.join)(__dirname, '..', 'config', 'countrydata.json');
|
|
38
|
-
res.set({ 'Cache-Control': 'max-age=86400' });
|
|
39
|
-
res.sendFile(filePath);
|
|
40
|
-
});
|
|
41
|
-
return router;
|
|
42
|
-
}
|
|
43
|
-
static async load(config, req, res, type) {
|
|
44
|
-
const entsoeLoader = new LoadAndParse_1.LoadAndParse(config);
|
|
45
|
-
const cacheTime = this.calcCacheTime(req);
|
|
46
|
-
const successHeaders = {
|
|
47
|
-
'Cache-Control': `public, max-age=${cacheTime}`,
|
|
48
|
-
'Content-Encoding': 'gzip',
|
|
49
|
-
'Content-Type': 'application/json'
|
|
50
|
-
};
|
|
51
|
-
try {
|
|
52
|
-
let cacheData;
|
|
53
|
-
const cacheKey = req.url;
|
|
54
|
-
const cacheFilePath = `${config.cacheDir}/${(0, crypto_1.createHash)('md5').update(cacheKey).digest('hex')}.json.gz`;
|
|
55
|
-
if (!(req.headers['reload'] === 'full')) {
|
|
56
|
-
// check if there is a cache file for this request
|
|
57
|
-
try {
|
|
58
|
-
const stats = await (0, promises_1.stat)(cacheFilePath);
|
|
59
|
-
const modtime = stats.mtime.getTime();
|
|
60
|
-
// Check if the If-Modified-Since header matches the last modified date
|
|
61
|
-
const ifModifiedSince = req.headers['if-modified-since'];
|
|
62
|
-
if (ifModifiedSince && (modtime - new Date(ifModifiedSince).getTime()) < 5000) {
|
|
63
|
-
res.status(304).end();
|
|
64
|
-
return;
|
|
65
|
-
}
|
|
66
|
-
res.setHeader('Last-Modified', (new Date(modtime)).toUTCString());
|
|
67
|
-
res.set(successHeaders);
|
|
68
|
-
console.log('cached');
|
|
69
|
-
(0, fs_1.createReadStream)(cacheFilePath)
|
|
70
|
-
.pipe(res);
|
|
71
|
-
return;
|
|
72
|
-
}
|
|
73
|
-
catch (err) {
|
|
74
|
-
// no cache file found, continue with request
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
// if no cache hit, load data and store in cache
|
|
78
|
-
if (!cacheData) {
|
|
79
|
-
// LOAD THE DATA FROM SOURCE
|
|
80
|
-
const body = await entsoeLoader.get(req, type);
|
|
81
|
-
const buf = node_buffer_1.Buffer.from(JSON.stringify(body), 'utf-8');
|
|
82
|
-
const cacheDataBuffer = (0, zlib_1.gzipSync)(buf);
|
|
83
|
-
await (0, promises_1.writeFile)(cacheFilePath, cacheDataBuffer, 'utf-8');
|
|
84
|
-
res.setHeader('Last-Modified', (new Date()).toUTCString());
|
|
85
|
-
res.set(successHeaders);
|
|
86
|
-
res.send(cacheDataBuffer);
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
catch (e) {
|
|
90
|
-
console.log(e);
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
static calcCacheTime(req) {
|
|
94
|
-
const reqMonth = `${req.params.year} ${req.params.month}`;
|
|
95
|
-
const now = new Date();
|
|
96
|
-
const nowMonth = `${now.getFullYear()} ${now.getMonth() + 1}`;
|
|
97
|
-
if (reqMonth === nowMonth) {
|
|
98
|
-
return 5 * 60;
|
|
99
|
-
}
|
|
100
|
-
else {
|
|
101
|
-
return 3600 * 7;
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
exports.PowerRouter = PowerRouter;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PowerRouter = void 0;
|
|
4
|
+
const express_1 = require("express");
|
|
5
|
+
const crypto_1 = require("crypto");
|
|
6
|
+
const promises_1 = require("fs/promises");
|
|
7
|
+
const zlib_1 = require("zlib");
|
|
8
|
+
const node_buffer_1 = require("node:buffer");
|
|
9
|
+
const fs_1 = require("fs");
|
|
10
|
+
const LoadAndParse_1 = require("./LoadAndParse");
|
|
11
|
+
const path_1 = require("path");
|
|
12
|
+
class PowerRouter {
|
|
13
|
+
static init(config) {
|
|
14
|
+
console.log('init', config);
|
|
15
|
+
const router = (0, express_1.Router)();
|
|
16
|
+
router.get(`/:country/:year/:month`, async (req, res) => {
|
|
17
|
+
await this.load(config, req, res, 'power');
|
|
18
|
+
});
|
|
19
|
+
router.get(`/:country/fossil`, async (req, res) => {
|
|
20
|
+
await this.load(config, req, res, 'fossil');
|
|
21
|
+
});
|
|
22
|
+
router.get(`/:country/installed`, async (req, res) => {
|
|
23
|
+
await this.load(config, req, res, 'installed');
|
|
24
|
+
});
|
|
25
|
+
router.get(`/:country/hydrofill`, async (req, res) => {
|
|
26
|
+
await this.load(config, req, res, 'hydrofill');
|
|
27
|
+
});
|
|
28
|
+
router.get(`/:country/countrydata`, async (req, res) => {
|
|
29
|
+
await this.load(config, req, res, 'countrydata');
|
|
30
|
+
});
|
|
31
|
+
router.get('/types', async (req, res) => {
|
|
32
|
+
const filePath = (0, path_1.join)(__dirname, '..', 'config', 'types.json');
|
|
33
|
+
res.set({ 'Cache-Control': 'max-age=86400' });
|
|
34
|
+
res.sendFile(filePath);
|
|
35
|
+
});
|
|
36
|
+
router.get('/countries', async (req, res) => {
|
|
37
|
+
const filePath = (0, path_1.join)(__dirname, '..', 'config', 'countrydata.json');
|
|
38
|
+
res.set({ 'Cache-Control': 'max-age=86400' });
|
|
39
|
+
res.sendFile(filePath);
|
|
40
|
+
});
|
|
41
|
+
return router;
|
|
42
|
+
}
|
|
43
|
+
static async load(config, req, res, type) {
|
|
44
|
+
const entsoeLoader = new LoadAndParse_1.LoadAndParse(config);
|
|
45
|
+
const cacheTime = this.calcCacheTime(req);
|
|
46
|
+
const successHeaders = {
|
|
47
|
+
'Cache-Control': `public, max-age=${cacheTime}`,
|
|
48
|
+
'Content-Encoding': 'gzip',
|
|
49
|
+
'Content-Type': 'application/json'
|
|
50
|
+
};
|
|
51
|
+
try {
|
|
52
|
+
let cacheData;
|
|
53
|
+
const cacheKey = req.url;
|
|
54
|
+
const cacheFilePath = `${config.cacheDir}/${(0, crypto_1.createHash)('md5').update(cacheKey).digest('hex')}.json.gz`;
|
|
55
|
+
if (!(req.headers['reload'] === 'full')) {
|
|
56
|
+
// check if there is a cache file for this request
|
|
57
|
+
try {
|
|
58
|
+
const stats = await (0, promises_1.stat)(cacheFilePath);
|
|
59
|
+
const modtime = stats.mtime.getTime();
|
|
60
|
+
// Check if the If-Modified-Since header matches the last modified date
|
|
61
|
+
const ifModifiedSince = req.headers['if-modified-since'];
|
|
62
|
+
if (ifModifiedSince && (modtime - new Date(ifModifiedSince).getTime()) < 5000) {
|
|
63
|
+
res.status(304).end();
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
res.setHeader('Last-Modified', (new Date(modtime)).toUTCString());
|
|
67
|
+
res.set(successHeaders);
|
|
68
|
+
console.log('cached');
|
|
69
|
+
(0, fs_1.createReadStream)(cacheFilePath)
|
|
70
|
+
.pipe(res);
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
catch (err) {
|
|
74
|
+
// no cache file found, continue with request
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
// if no cache hit, load data and store in cache
|
|
78
|
+
if (!cacheData) {
|
|
79
|
+
// LOAD THE DATA FROM SOURCE
|
|
80
|
+
const body = await entsoeLoader.get(req, type);
|
|
81
|
+
const buf = node_buffer_1.Buffer.from(JSON.stringify(body), 'utf-8');
|
|
82
|
+
const cacheDataBuffer = (0, zlib_1.gzipSync)(buf);
|
|
83
|
+
await (0, promises_1.writeFile)(cacheFilePath, cacheDataBuffer, 'utf-8');
|
|
84
|
+
res.setHeader('Last-Modified', (new Date()).toUTCString());
|
|
85
|
+
res.set(successHeaders);
|
|
86
|
+
res.send(cacheDataBuffer);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
catch (e) {
|
|
90
|
+
console.log(e);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
static calcCacheTime(req) {
|
|
94
|
+
const reqMonth = `${req.params.year} ${req.params.month}`;
|
|
95
|
+
const now = new Date();
|
|
96
|
+
const nowMonth = `${now.getFullYear()} ${now.getMonth() + 1}`;
|
|
97
|
+
if (reqMonth === nowMonth) {
|
|
98
|
+
return 5 * 60;
|
|
99
|
+
}
|
|
100
|
+
else {
|
|
101
|
+
return 3600 * 7;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
exports.PowerRouter = PowerRouter;
|
|
106
106
|
//# sourceMappingURL=Router.js.map
|
package/dist/router/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { PowerRouter } from './controllers/Router';
|
|
2
|
-
export { Config } from './interfaces/config';
|
|
1
|
+
export { PowerRouter } from './controllers/Router';
|
|
2
|
+
export { Config } from './interfaces/config';
|
package/dist/router/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PowerRouter = void 0;
|
|
4
|
-
var Router_1 = require("./controllers/Router");
|
|
5
|
-
Object.defineProperty(exports, "PowerRouter", { enumerable: true, get: function () { return Router_1.PowerRouter; } });
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PowerRouter = void 0;
|
|
4
|
+
var Router_1 = require("./controllers/Router");
|
|
5
|
+
Object.defineProperty(exports, "PowerRouter", { enumerable: true, get: function () { return Router_1.PowerRouter; } });
|
|
6
6
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export interface Config {
|
|
2
|
-
securityToken: string;
|
|
3
|
-
cacheDir: string;
|
|
4
|
-
entsoeDomain: string;
|
|
5
|
-
}
|
|
1
|
+
export interface Config {
|
|
2
|
+
securityToken: string;
|
|
3
|
+
cacheDir: string;
|
|
4
|
+
entsoeDomain: string;
|
|
5
|
+
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
//# sourceMappingURL=config.js.map
|
|
@@ -1,50 +1,50 @@
|
|
|
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
|
+
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,3 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
//# sourceMappingURL=entsoe.js.map
|
|
@@ -1,15 +1,15 @@
|
|
|
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
|
+
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,16 +1,16 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PosNeg = exports.Format = void 0;
|
|
4
|
-
var Format;
|
|
5
|
-
(function (Format) {
|
|
6
|
-
Format["EDIFACT"] = "edifact";
|
|
7
|
-
Format["EDIJSON"] = "edijson";
|
|
8
|
-
Format["SOURCES"] = "sources";
|
|
9
|
-
Format["KEYVALUE"] = "keyvalue";
|
|
10
|
-
})(Format = exports.Format || (exports.Format = {}));
|
|
11
|
-
var PosNeg;
|
|
12
|
-
(function (PosNeg) {
|
|
13
|
-
PosNeg["POS"] = "pos";
|
|
14
|
-
PosNeg["NEG"] = "neg";
|
|
15
|
-
})(PosNeg = exports.PosNeg || (exports.PosNeg = {}));
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PosNeg = exports.Format = void 0;
|
|
4
|
+
var Format;
|
|
5
|
+
(function (Format) {
|
|
6
|
+
Format["EDIFACT"] = "edifact";
|
|
7
|
+
Format["EDIJSON"] = "edijson";
|
|
8
|
+
Format["SOURCES"] = "sources";
|
|
9
|
+
Format["KEYVALUE"] = "keyvalue";
|
|
10
|
+
})(Format = exports.Format || (exports.Format = {}));
|
|
11
|
+
var PosNeg;
|
|
12
|
+
(function (PosNeg) {
|
|
13
|
+
PosNeg["POS"] = "pos";
|
|
14
|
+
PosNeg["NEG"] = "neg";
|
|
15
|
+
})(PosNeg = exports.PosNeg || (exports.PosNeg = {}));
|
|
16
16
|
//# sourceMappingURL=queryoptions.js.map
|
|
@@ -1,12 +1,12 @@
|
|
|
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
|
+
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,3 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
//# sourceMappingURL=types.js.map
|
|
@@ -1,15 +1,15 @@
|
|
|
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
|
-
}
|
|
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
|
+
}
|