@googlemaps/google-maps-services-js
Advanced tools
Comparing version 2.3.1 to 2.4.0
@@ -1,7 +0,7 @@ | ||
## [2.3.1](https://github.com/googlemaps/google-maps-services-js/compare/v2.3.0...v2.3.1) (2020-03-12) | ||
# [2.4.0](https://github.com/googlemaps/google-maps-services-js/compare/v2.3.1...v2.4.0) (2020-03-26) | ||
### Bug Fixes | ||
### Features | ||
* config merge ([#362](https://github.com/googlemaps/google-maps-services-js/issues/362)) ([a111ffd](https://github.com/googlemaps/google-maps-services-js/commit/a111ffd9d4618a53148caefa9a418d7d6b6e902f)) | ||
* add retry-axios as default ([#374](https://github.com/googlemaps/google-maps-services-js/issues/374)) ([77a2d28](https://github.com/googlemaps/google-maps-services-js/commit/77a2d2862e75670f10ef1c05d99624d3a62417d7)) | ||
@@ -8,0 +8,0 @@ ## [2.0.2](https://github.com/googlemaps/google-maps-services-js/compare/v2.0.1...v2.0.2) (2020-02-08) |
@@ -1,19 +0,20 @@ | ||
import { AxiosRequestConfig, AxiosInstance } from "axios"; | ||
import { HttpsAgent } from "agentkeepalive"; | ||
import * as rax from "retry-axios"; | ||
import { DirectionsRequest, DirectionsResponse } from "./directions"; | ||
import { DistanceMatrixRequest, DistanceMatrixResponse } from "./distance"; | ||
import { ElevationRequest, ElevationResponse } from "./elevation"; | ||
import { FindPlaceFromTextRequest, FindPlaceFromTextResponse } from "./places/findplacefromtext"; | ||
import { GeocodeRequest, GeocodeResponse } from "./geocode/geocode"; | ||
import { GeolocateRequest, GeolocateResponse } from "./geolocate"; | ||
import { TimeZoneRequest, TimeZoneResponse } from "./timezone"; | ||
import { GeocodeRequest, GeocodeResponse } from "./geocode/geocode"; | ||
import { ReverseGeocodeRequest, ReverseGeocodeResponse } from "./geocode/reversegeocode"; | ||
import { NearestRoadsRequest, NearestRoadsResponse } from "./roads/nearestroads"; | ||
import { PlaceAutocompleteRequest, PlaceAutocompleteResponse } from "./places/autocomplete"; | ||
import { PlaceDetailsRequest, PlaceDetailsResponse } from "./places/details"; | ||
import { FindPlaceFromTextRequest, FindPlaceFromTextResponse } from "./places/findplacefromtext"; | ||
import { PlacePhotoRequest, PlacePhotoResponse } from "./places/photo"; | ||
import { PlaceQueryAutocompleteRequest, PlaceQueryAutocompleteResponse } from "./places/queryautocomplete"; | ||
import { PlacesNearbyRequest, PlacesNearbyResponse } from "./places/placesnearby"; | ||
import { PlaceQueryAutocompleteRequest, PlaceQueryAutocompleteResponse } from "./places/queryautocomplete"; | ||
import { ReverseGeocodeRequest, ReverseGeocodeResponse } from "./geocode/reversegeocode"; | ||
import { SnapToRoadsRequest, SnapToRoadsResponse } from "./roads/snaptoroads"; | ||
import { TextSearchRequest, TextSearchResponse } from "./places/textsearch"; | ||
import { NearestRoadsRequest, NearestRoadsResponse } from "./roads/nearestroads"; | ||
import { SnapToRoadsRequest, SnapToRoadsResponse } from "./roads/snaptoroads"; | ||
import { TimeZoneRequest, TimeZoneResponse } from "./timezone"; | ||
import { AxiosInstance, AxiosRequestConfig } from "axios"; | ||
import { HttpsAgent } from "agentkeepalive"; | ||
export declare const defaultHttpsAgent: HttpsAgent; | ||
@@ -25,2 +26,5 @@ export declare const defaultTimeout = 10000; | ||
export declare const defaultAxiosInstance: AxiosInstance; | ||
declare type Config = { | ||
raxConfig?: rax.RetryConfig; | ||
} & AxiosRequestConfig; | ||
export interface ClientOptions { | ||
@@ -30,5 +34,25 @@ /** AxiosInstance to be used by client. Provide one of axiosInstance or config. */ | ||
/** Config used to create AxiosInstance. Provide one of axiosInstance or config. */ | ||
config?: AxiosRequestConfig; | ||
config?: Config; | ||
experienceId?: string[]; | ||
} | ||
/** | ||
* Client is a light wrapper around API methods providing shared configuration for Axios | ||
* settings such as retry logic using the default retry-axios settings and gzip encoding. | ||
* | ||
* ### Instantiate with defaults | ||
* ``` | ||
* const client = Client() | ||
* ``` | ||
* | ||
* ### Instantiate with config | ||
* ``` | ||
* const client = Client({config}) | ||
* ``` | ||
* | ||
* ### Instantiate with axiosInstance **Advanced** | ||
* ``` | ||
* const axiosInstance = axios.create(config) | ||
* const client = Client({axiosInstance}) | ||
* ``` | ||
*/ | ||
export declare class Client { | ||
@@ -35,0 +59,0 @@ private axiosInstance; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const axios_1 = require("axios"); | ||
const index_1 = require("./index"); | ||
const agentkeepalive_1 = require("agentkeepalive"); | ||
const rax = require("retry-axios"); | ||
const directions_1 = require("./directions"); | ||
const distance_1 = require("./distance"); | ||
const elevation_1 = require("./elevation"); | ||
const findplacefromtext_1 = require("./places/findplacefromtext"); | ||
const geocode_1 = require("./geocode/geocode"); | ||
const geolocate_1 = require("./geolocate"); | ||
const timezone_1 = require("./timezone"); | ||
const geocode_1 = require("./geocode/geocode"); | ||
const reversegeocode_1 = require("./geocode/reversegeocode"); | ||
const nearestroads_1 = require("./roads/nearestroads"); | ||
const autocomplete_1 = require("./places/autocomplete"); | ||
const details_1 = require("./places/details"); | ||
const findplacefromtext_1 = require("./places/findplacefromtext"); | ||
const photo_1 = require("./places/photo"); | ||
const queryautocomplete_1 = require("./places/queryautocomplete"); | ||
const placesnearby_1 = require("./places/placesnearby"); | ||
const queryautocomplete_1 = require("./places/queryautocomplete"); | ||
const reversegeocode_1 = require("./geocode/reversegeocode"); | ||
const snaptoroads_1 = require("./roads/snaptoroads"); | ||
const textsearch_1 = require("./places/textsearch"); | ||
const nearestroads_1 = require("./roads/nearestroads"); | ||
const snaptoroads_1 = require("./roads/snaptoroads"); | ||
const timezone_1 = require("./timezone"); | ||
const axios_1 = require("axios"); | ||
const agentkeepalive_1 = require("agentkeepalive"); | ||
const index_1 = require("./index"); | ||
exports.defaultHttpsAgent = new agentkeepalive_1.HttpsAgent({ keepAlive: true }); | ||
@@ -36,2 +37,23 @@ exports.defaultTimeout = 10000; | ||
exports.defaultAxiosInstance = axios_1.default.create(defaultConfig); | ||
rax.attach(exports.defaultAxiosInstance); | ||
/** | ||
* Client is a light wrapper around API methods providing shared configuration for Axios | ||
* settings such as retry logic using the default retry-axios settings and gzip encoding. | ||
* | ||
* ### Instantiate with defaults | ||
* ``` | ||
* const client = Client() | ||
* ``` | ||
* | ||
* ### Instantiate with config | ||
* ``` | ||
* const client = Client({config}) | ||
* ``` | ||
* | ||
* ### Instantiate with axiosInstance **Advanced** | ||
* ``` | ||
* const axiosInstance = axios.create(config) | ||
* const client = Client({axiosInstance}) | ||
* ``` | ||
*/ | ||
class Client { | ||
@@ -50,2 +72,3 @@ constructor({ axiosInstance, config, experienceId } = {}) { | ||
this.axiosInstance = axios_1.default.create(config); | ||
rax.attach(this.axiosInstance); | ||
} | ||
@@ -52,0 +75,0 @@ else { |
{ | ||
"name": "@googlemaps/google-maps-services-js", | ||
"version": "2.3.1", | ||
"version": "2.4.0", | ||
"description": "Node.js client library for Google Maps API Web Services", | ||
@@ -39,2 +39,3 @@ "keywords": [ | ||
"scripts": { | ||
"docs": "rm -rf docs/ && typedoc .", | ||
"prepare": "tsc", | ||
@@ -48,3 +49,4 @@ "test": "jest src", | ||
"axios": "^0.19.0", | ||
"query-string": "^6.11.0" | ||
"query-string": "^6.11.0", | ||
"retry-axios": "^2.1.2" | ||
}, | ||
@@ -56,11 +58,13 @@ "devDependencies": { | ||
"@semantic-release/release-notes-generator": "^9.0.0", | ||
"@types/jest": "^24.0.25", | ||
"@types/jest": "^25.0.25", | ||
"@types/node": "^12.12.15", | ||
"codecov": ">=3.6.5", | ||
"jest": "^24.9.0", | ||
"jest": "^25.2.2", | ||
"semantic-release": "^17.0.2", | ||
"ts-jest": "^24.3.0", | ||
"ts-jest": "^25.2.1", | ||
"typedoc": "^0.16.11", | ||
"typescript": "^3.7.4" | ||
}, | ||
"publishConfig": { | ||
"registry": "https://wombat-dressing-room.appspot.com", | ||
"access": "public" | ||
@@ -67,0 +71,0 @@ }, |
Node.js Client for Google Maps Services | ||
======================================= | ||
[![Build Status](https://travis-ci.org/googlemaps/google-maps-services-js.svg?branch=master)](https://travis-ci.org/googlemaps/google-maps-services-js) | ||
[![npm](https://img.shields.io/npm/v/@googlemaps/google-maps-services-js.svg)](https://www.npmjs.com/package/@googlemaps/google-maps-services-js) | ||
![CI](https://github.com/googlemaps/google-maps-services-js/workflows/CI/badge.svg) | ||
![Release](https://github.com/googlemaps/google-maps-services-js/workflows/Release/badge.svg) | ||
[![codecov](https://codecov.io/gh/googlemaps/google-maps-services-js/branch/master/graph/badge.svg)](https://codecov.io/gh/googlemaps/google-maps-services-js) | ||
@@ -75,2 +76,6 @@ ![GitHub contributors](https://img.shields.io/github/contributors/googlemaps/google-maps-services-js?color=green) | ||
## Reference Documentation | ||
The generated reference documentationcan be found [here](https://googlemaps.github.io/google-maps-services-js/). The TypeScript types are the authoritative documenation for this library and may differ slightly from the descriptions. | ||
## Developing | ||
@@ -77,0 +82,0 @@ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
227925
3382
181
4
12
1
+ Addedretry-axios@^2.1.2
+ Addedretry-axios@2.6.0(transitive)