import { IMeterDataReadings, IMeteringPointCharges, IMeteringPointDetails, IMyEnergyDataMarketDocument } from './data'; import { ValidTimeAggregation } from './endpoints'; export default class ElOverblik { private refreshToken; private _dataAccessToken?; /** * The data access token currently in use. */ get dataAccessToken(): string | undefined; /** * Instantiate a new ElOverblik class. * * @param refreshToken Refresh token from the ElOverblik portal * @param dataAccessToken Existing data token from a previous authentication */ constructor(refreshToken: string, dataAccessToken?: string); private handleGeneralErrors; private attemptTokenRefresh; /** * Calls the Token endpoint and generates a new data access token. * The token is valid for 24 hours and can be reused later when instantiating the ElOverblik class. * * @returns A newly generated data access token */ refreshDataAccessToken(): Promise; /** * Returns a list of metering points. * * @param includeAll When includeAll is false, only the metering points with relations are returned. When includeAll is true the list will be a merge of the related metering points with a lookup using CPR or CVR. * @param throwIfUnauthenticated Set to avoid refreshing the data access token automatically * * @returns Details of each metering access point available */ getMeteringPoints(includeAll?: boolean, throwIfUnauthenticated?: boolean): Promise; /** * Returns a list of metering points with details. * * @param meteringPointId ID of metering points to query for * @param throwIfUnauthenticated Set to avoid refreshing the data access token automatically * * @returns Expanded details of each metering point */ getMeteringPointsDetails(meteringPointId: string | string[], throwIfUnauthenticated?: boolean): Promise; /** * Returns price data for a list of metering points. * * @param meteringPointId ID of metering points to query for * @param throwIfUnauthenticated Set to avoid refreshing the data access token automatically * * @returns Returns price data broken down by tariffs, fees and subscriptions */ getMeteringPointsCharges(meteringPointId: string | string[], throwIfUnauthenticated?: boolean): Promise; /** * Returns a timeserie for each metering point in list. * * @param dateFrom YYYY-MM-DD formatted date to search from * @param dateTo YYYY-MM-DD formatted date to search to * @param aggregation Time aggregation * @param meteringPointId ID of metering points to query for * @param throwIfUnauthenticated Set to avoid refreshing the data access token automatically * * @returns One MyEnergyData_MarketDocument structure will be returned per metering point */ getMeterDataTimeSeries(dateFrom: string, dateTo: string, aggregation: ValidTimeAggregation, meteringPointId: string | string[], throwIfUnauthenticated?: boolean): Promise; /** * This request is used for querying meter readings for one or more (linked/related) metering points for a specified period. * * @notes Submission of meter readings to DataHub is no longer mandatory since end of 2021. Therefore, data may not be available for all metering points * * @param dateFrom YYYY-MM-DD formatted date to search from * @param dateTo YYYY-MM-DD formatted date to search to * @param meteringPointId ID of metering points to query for * @param throwIfUnauthenticated Set to avoid refreshing the data access token automatically * * @returns Returns a meterreading for at given date for each metering point in list. */ getMeterDataReadings(dateFrom: string, dateTo: string, meteringPointId: string | string[], throwIfUnauthenticated?: boolean): Promise; }