Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

openweathermap-api-client

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

openweathermap-api-client - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

7

CHANGELOG.md

@@ -0,1 +1,8 @@

## [1.0.1](https://github.com/tdolsen/openweathermap-api-client/compare/v1.0.0...v1.0.1) (2018-07-26)
### Bug Fixes
* **api:** sets return type for current/forecast for proper definitions ([647a03a](https://github.com/tdolsen/openweathermap-api-client/commit/647a03a))
# 1.0.0 (2018-07-25)

@@ -2,0 +9,0 @@

8

lib/api-client.d.ts
import { AxiosInstance } from "axios";
import { Coord, CountryCode, Endpoint, Options, RequestQuery, Response } from "./interfaces";
import { Coord, CountryCode, Endpoint, ForecastResponse, Options, RequestQuery, Response, WeatherResponse } from "./interfaces";
export declare class ApiClient {

@@ -7,5 +7,5 @@ axios: AxiosInstance;

constructor(options: string | Options);
current(query: number | string | Coord | RequestQuery<Endpoint.Weather>): Promise<import("src/interfaces").WeatherResponse>;
weather(query: number | string | Coord | RequestQuery<Endpoint.Weather>): Promise<import("src/interfaces").WeatherResponse>;
forecast(query: number | string | Coord | RequestQuery<Endpoint.Forecast>): Promise<import("src/interfaces").ForecastResponse>;
current(query: number | string | Coord | RequestQuery<Endpoint.Weather>): Promise<WeatherResponse>;
weather(query: number | string | Coord | RequestQuery<Endpoint.Weather>): Promise<WeatherResponse>;
forecast(query: number | string | Coord | RequestQuery<Endpoint.Forecast>): Promise<ForecastResponse>;
getByCityId<T extends Endpoint>(id: number, endpoint?: T): Promise<Response<T>>;

@@ -12,0 +12,0 @@ getByCityName<T extends Endpoint>(name: string, endpoint?: T): Promise<Response<T>>;

{
"name": "openweathermap-api-client",
"version": "1.0.0",
"version": "1.0.1",
"description": "Promise based API client for getting weather data and forecasts from openweathermap.org",

@@ -5,0 +5,0 @@ "author": "Torkild Dyvik Olsen",

import axios, { AxiosInstance, AxiosResponse } from "axios";
import qs from "query-string";
import { Coord, CountryCode, Endpoint, Language, Options, RequestQuery, Response, Units } from "./interfaces";
import {
Coord,
CountryCode,
Endpoint,
ForecastResponse,
Language,
Options,
RequestQuery,
Response,
Units,
WeatherResponse,
} from "./interfaces";
import { isEndpoint, isCoord, isRequestQuery, isCountryCode } from "./utils";

@@ -44,3 +55,3 @@ import { ApiException } from "./api-exception";

// Returns the current weather for given query.
async current(query: number | string | Coord | RequestQuery<Endpoint.Weather>) {
async current(query: number | string | Coord | RequestQuery<Endpoint.Weather>): Promise<WeatherResponse> {
return this.request("weather", this._prepQuery(query));

@@ -55,3 +66,3 @@ }

// Returns forecast for given query.
async forecast(query: number | string | Coord | RequestQuery<Endpoint.Forecast>) {
async forecast(query: number | string | Coord | RequestQuery<Endpoint.Forecast>): Promise<ForecastResponse> {
return this.request("forecast", this._prepQuery(query));

@@ -58,0 +69,0 @@ }

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc