Files
tauron-scrapper/src/types/tauron.ts

83 lines
1.5 KiB
TypeScript

export type TauronConfig = {
/**
* Path to file containing a username of Tauron account
*/
username: string;
/**
* Path to file containing a password of Tauron account
*/
password: string;
/**
* The measure point name - should be retrieved with browser dev-tools on website
*/
point: string;
/**
* The path to the json file with cookie jar
*/
cookiesJarPath?: string;
};
export type Payload<T> = {
success: boolean;
data: T;
};
export type EnergyDTO = {
values: number[];
zones: Record<string, number|Zone>;
sum: number;
chartZones: Record<string, boolean[]>;
labels: number[];
tooltipLabels: string[];
zonesName: Record<string, string>;
tariff: string;
labelsRotate?: boolean;
aCnt?: Record<string, number>;
aCnt_sum?: number
average?: number
};
export type Zone = {
EC: number;
Name: string;
ZONE: number;
};
export type PowerDTO = {
DATA: string;
CZAS: string;
MOC_MAX: string;
MOC_UMOWNA: string;
MOC_SREDNIA: string;
};
export type ReadingDTO = {
S1: string;
Date: string;
S2: string;
S3: string;
C: number;
JM: string;
};
export type EnergyRequestDTO = {
from: string;
to: string;
type: 'consum' | 'average' | 'temperature';
profile: 'full time' | 'range' | 'year';
value?: 'G11' | 'G12' | 'G12as' | 'G12w' | 'G13';
};
export type PowerRequestDTO = {
from: string;
to: string;
};
export type ReadingRequestDTO = {
from: string;
to: string;
type: 'energia-pobrana';
};