Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/abn/node-vattenfall-europe-sales-api
Typescript client for the Vattenfall Europe Sales GmbH Service API
https://github.com/abn/node-vattenfall-europe-sales-api
Last synced: 7 days ago
JSON representation
Typescript client for the Vattenfall Europe Sales GmbH Service API
- Host: GitHub
- URL: https://github.com/abn/node-vattenfall-europe-sales-api
- Owner: abn
- License: mit
- Created: 2024-11-03T19:42:35.000Z (about 2 months ago)
- Default Branch: main
- Last Pushed: 2024-12-10T23:06:53.000Z (16 days ago)
- Last Synced: 2024-12-11T00:20:17.428Z (16 days ago)
- Language: TypeScript
- Size: 212 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Vattenfall Europe Sales GmbH API Client
This is a node client libary written in Typescript, which provides methods to interact with the Vattenfall Europe Sales GmbH service's API.
## Installation
```bash
# using npm
npm install vattenfall-europe-sales-api# using pnpm
pnpm add vattenfall-europe-sales-api
```## Example Usage
```typescript
import { VattenfallService, VattenfallServiceHelpers } from "vattenfall-europe-sales-api";async function displayMeterReadings() {
const service = new VattenfallService("your-username", "your-password");try {
const contract_ids = VattenfallServiceHelpers.getContractIDs(await service.getContractList());for (const contract_id of contract_ids) {
console.log(`Meter readings for contract ${contract_id}:`);const meter_readings = VattenfallServiceHelpers.mapMeterReadings(
await service.getMeterReadings(contract_id),
);
console.log(meter_readings);
}
} catch (e) {
await service.logOut();
throw e;
}
}
```