@wayota/redata-api-client
Version:
TypeScript client for the REData (Red Eléctrica de España) public API. Provides convenient methods to fetch Spanish electricity data widgets, supporting category, widget, date range, and geographic filters. The client is based on a custom OpenAPI specific
56 lines (55 loc) • 1.18 kB
TypeScript
export interface DataInValue {
value: number;
percentage: number | null;
datetime: string;
}
export interface ContentAttributes {
title: string;
description: string;
color: string;
icon: string | null;
type: string;
magnitude: string | null;
composite: boolean;
'last-update': string;
values: DataInValue[];
total: number;
'total-percentage': number;
}
export interface Content {
type: string;
id: string;
groupId: string;
attributes: ContentAttributes[];
}
export interface IncludedAttributes {
title: string;
'last-update': string;
description: string;
magnitude: string | null;
content: Content[];
}
export interface DataAttributes {
title: string;
'last-update': string;
description: string;
}
export interface DataMeta {
'cache-control': {
cache: string;
expireAt: string;
};
}
export interface DataInGetResponse {
data: {
type: string;
id: string;
attributes: DataAttributes;
meta: DataMeta;
};
included: {
type: string;
id: string;
attributes: IncludedAttributes;
}[];
}