node-apple-weatherkit
Version:
Apple WeatherKit API node.js implementation
16 lines • 526 B
JavaScript
import { BaseEndpoint } from './Base';
const ENDPOINT_PATH = '/weather';
const DEFAULT_PARAMS = {
timezone: 'Etc/UTC',
dataSets: ['currentWeather', 'forecastDaily'],
};
export class WeatherEndpoint extends BaseEndpoint {
constructor(accessToken) {
super(accessToken);
this.accessToken = accessToken;
}
async get(lat, lon, params = DEFAULT_PARAMS, lang = 'en') {
return await this.api.get(`${ENDPOINT_PATH}/${lang}/${lat}/${lon}`, params);
}
}
//# sourceMappingURL=Weather.js.map