From fbd54a0626fae88d7ba48f7042fe45b1f8d28ec5 Mon Sep 17 00:00:00 2001 From: Alan Poulain Date: Tue, 30 Jun 2020 23:56:46 +0200 Subject: [PATCH 01/56] Use TypeScript --- .bowerrc | 3 - .editorconfig | 11 + .eslintrc | 31 + .gitignore | 5 +- .travis.yml | 10 +- CHANGELOG.md | 10 + CONTRIBUTING.md | 5 + README.md | 122 +- bower.json | 20 - dist/geocoder.js | 465 -- dist/geocoder.min.js | 1 - example/bing.html | 6 +- example/google.html | 6 +- example/mapbox.html | 20 + example/mapquest.html | 6 +- example/openstreetmap.html | 6 +- example/yandex.html | 6 +- gruntfile.js | 71 - package-lock.json | 5581 +++++++++++++++++ package.json | 68 +- spec/ExternalURILoader.spec.js | 7 - spec/ExternalURILoader.spec.ts | 9 + spec/GeoJSONDumper.spec.js | 22 - spec/GeoJSONDumper.spec.ts | 23 + spec/Geocoded.spec.js | 82 - spec/Geocoded.spec.ts | 124 + spec/GeocoderProviderFactory.spec.js | 25 - spec/GeocoderProviderFactory.spec.ts | 18 + spec/helpers/GoogleHelper.js | 12 - spec/helpers/reporter.ts | 10 + spec/providers/BingProvider.spec.js | 88 - spec/providers/BingProvider.spec.ts | 105 + spec/providers/GoogleAPIProvider.spec.js | 70 - spec/providers/GoogleAPIProvider.spec.ts | 122 + spec/providers/MapboxProvider.spec.ts | 95 + spec/providers/MapquestProvider.spec.js | 61 - spec/providers/MapquestProvider.spec.ts | 81 + spec/providers/OpenStreetMapProvider.spec.js | 68 - spec/providers/OpenStreetMapProvider.spec.ts | 96 + spec/providers/ProviderBase.spec.js | 7 - spec/providers/YandexProvider.spec.js | 71 - spec/providers/YandexProvider.spec.ts | 91 + spec/runner.html | 73 - spec/support/jasmine.json | 11 + src/ExternalURILoader.js | 202 - src/ExternalURILoader.ts | 145 + src/GeoJSONDumper.js | 27 - src/GeoJSONDumper.ts | 31 + src/Geocoded.js | 25 - src/Geocoded.ts | 187 + src/GeocoderJS.js | 19 - src/GeocoderJS.ts | 14 + src/GeocoderProviderFactory.js | 52 - src/GeocoderProviderFactory.ts | 73 + src/global.ts | 16 + src/index.ts | 23 + src/providers/BingProvider.js | 87 - src/providers/BingProvider.ts | 163 + src/providers/GoogleAPIProvider.js | 111 - src/providers/GoogleAPIProvider.ts | 221 + src/providers/MapquestProvider.js | 95 - src/providers/MapquestProvider.ts | 162 + src/providers/OpenStreetMapProvider.js | 89 - src/providers/OpenStreetMapProvider.ts | 197 + src/providers/ProviderBase.js | 17 - src/providers/ProviderHelpers.ts | 75 + src/providers/ProviderInterface.ts | 39 + src/providers/YandexProvider.js | 102 - src/providers/YandexProvider.ts | 250 + src/providers/index.ts | 14 + src/providers/mapbox/MapboxGeocodeQuery.ts | 36 + src/providers/mapbox/MapboxProvider.ts | 268 + src/providers/mapbox/MapboxReverseQuery.ts | 36 + src/providers/mapbox/index.ts | 6 + src/query/GeocodeQuery.ts | 117 + src/query/ReverseQuery.ts | 75 + src/query/index.ts | 4 + src/types.ts | 6 + tsconfig.json | 15 + types/ExternalURILoader.d.ts | 31 + types/ExternalURILoader.d.ts.map | 1 + types/GeoJSONDumper.d.ts | 14 + types/GeoJSONDumper.d.ts.map | 1 + types/Geocoded.d.ts | 53 + types/Geocoded.d.ts.map | 1 + types/GeocoderJS.d.ts | 7 + types/GeocoderJS.d.ts.map | 1 + types/GeocoderProviderFactory.d.ts | 18 + types/GeocoderProviderFactory.d.ts.map | 1 + types/global.d.ts | 7 + types/global.d.ts.map | 1 + types/index.d.ts | 22 + types/index.d.ts.map | 1 + types/providers/BingProvider.d.ts | 41 + types/providers/BingProvider.d.ts.map | 1 + types/providers/GoogleAPIProvider.d.ts | 34 + types/providers/GoogleAPIProvider.d.ts.map | 1 + types/providers/MapquestProvider.d.ts | 42 + types/providers/MapquestProvider.d.ts.map | 1 + types/providers/OpenStreetMapProvider.d.ts | 43 + .../providers/OpenStreetMapProvider.d.ts.map | 1 + types/providers/ProviderHelpers.d.ts | 8 + types/providers/ProviderHelpers.d.ts.map | 1 + types/providers/ProviderInterface.d.ts | 17 + types/providers/ProviderInterface.d.ts.map | 1 + types/providers/YandexProvider.d.ts | 67 + types/providers/YandexProvider.d.ts.map | 1 + types/providers/index.d.ts | 15 + types/providers/index.d.ts.map | 1 + .../providers/mapbox/MapboxGeocodeQuery.d.ts | 13 + .../mapbox/MapboxGeocodeQuery.d.ts.map | 1 + types/providers/mapbox/MapboxProvider.d.ts | 68 + .../providers/mapbox/MapboxProvider.d.ts.map | 1 + .../providers/mapbox/MapboxReverseQuery.d.ts | 13 + .../mapbox/MapboxReverseQuery.d.ts.map | 1 + types/providers/mapbox/index.d.ts | 7 + types/providers/mapbox/index.d.ts.map | 1 + types/query/GeocodeQuery.d.ts | 34 + types/query/GeocodeQuery.d.ts.map | 1 + types/query/ReverseQuery.d.ts | 26 + types/query/ReverseQuery.d.ts.map | 1 + types/query/index.d.ts | 5 + types/query/index.d.ts.map | 1 + types/types.d.ts | 4 + types/types.d.ts.map | 1 + webpack.common.js | 21 + webpack.dev.js | 10 + webpack.prod.js | 9 + 128 files changed, 9449 insertions(+), 2026 deletions(-) delete mode 100644 .bowerrc create mode 100644 .editorconfig create mode 100644 .eslintrc create mode 100644 CHANGELOG.md create mode 100644 CONTRIBUTING.md delete mode 100644 bower.json delete mode 100644 dist/geocoder.js delete mode 100644 dist/geocoder.min.js create mode 100644 example/mapbox.html delete mode 100644 gruntfile.js create mode 100644 package-lock.json delete mode 100644 spec/ExternalURILoader.spec.js create mode 100644 spec/ExternalURILoader.spec.ts delete mode 100644 spec/GeoJSONDumper.spec.js create mode 100644 spec/GeoJSONDumper.spec.ts delete mode 100644 spec/Geocoded.spec.js create mode 100644 spec/Geocoded.spec.ts delete mode 100644 spec/GeocoderProviderFactory.spec.js create mode 100644 spec/GeocoderProviderFactory.spec.ts delete mode 100644 spec/helpers/GoogleHelper.js create mode 100644 spec/helpers/reporter.ts delete mode 100644 spec/providers/BingProvider.spec.js create mode 100644 spec/providers/BingProvider.spec.ts delete mode 100644 spec/providers/GoogleAPIProvider.spec.js create mode 100644 spec/providers/GoogleAPIProvider.spec.ts create mode 100644 spec/providers/MapboxProvider.spec.ts delete mode 100644 spec/providers/MapquestProvider.spec.js create mode 100644 spec/providers/MapquestProvider.spec.ts delete mode 100644 spec/providers/OpenStreetMapProvider.spec.js create mode 100644 spec/providers/OpenStreetMapProvider.spec.ts delete mode 100644 spec/providers/ProviderBase.spec.js delete mode 100644 spec/providers/YandexProvider.spec.js create mode 100644 spec/providers/YandexProvider.spec.ts delete mode 100644 spec/runner.html create mode 100644 spec/support/jasmine.json delete mode 100644 src/ExternalURILoader.js create mode 100644 src/ExternalURILoader.ts delete mode 100644 src/GeoJSONDumper.js create mode 100644 src/GeoJSONDumper.ts delete mode 100644 src/Geocoded.js create mode 100644 src/Geocoded.ts delete mode 100644 src/GeocoderJS.js create mode 100644 src/GeocoderJS.ts delete mode 100644 src/GeocoderProviderFactory.js create mode 100644 src/GeocoderProviderFactory.ts create mode 100644 src/global.ts create mode 100644 src/index.ts delete mode 100644 src/providers/BingProvider.js create mode 100644 src/providers/BingProvider.ts delete mode 100644 src/providers/GoogleAPIProvider.js create mode 100644 src/providers/GoogleAPIProvider.ts delete mode 100644 src/providers/MapquestProvider.js create mode 100644 src/providers/MapquestProvider.ts delete mode 100644 src/providers/OpenStreetMapProvider.js create mode 100644 src/providers/OpenStreetMapProvider.ts delete mode 100644 src/providers/ProviderBase.js create mode 100644 src/providers/ProviderHelpers.ts create mode 100644 src/providers/ProviderInterface.ts delete mode 100644 src/providers/YandexProvider.js create mode 100644 src/providers/YandexProvider.ts create mode 100644 src/providers/index.ts create mode 100644 src/providers/mapbox/MapboxGeocodeQuery.ts create mode 100644 src/providers/mapbox/MapboxProvider.ts create mode 100644 src/providers/mapbox/MapboxReverseQuery.ts create mode 100644 src/providers/mapbox/index.ts create mode 100644 src/query/GeocodeQuery.ts create mode 100644 src/query/ReverseQuery.ts create mode 100644 src/query/index.ts create mode 100644 src/types.ts create mode 100644 tsconfig.json create mode 100644 types/ExternalURILoader.d.ts create mode 100644 types/ExternalURILoader.d.ts.map create mode 100644 types/GeoJSONDumper.d.ts create mode 100644 types/GeoJSONDumper.d.ts.map create mode 100644 types/Geocoded.d.ts create mode 100644 types/Geocoded.d.ts.map create mode 100644 types/GeocoderJS.d.ts create mode 100644 types/GeocoderJS.d.ts.map create mode 100644 types/GeocoderProviderFactory.d.ts create mode 100644 types/GeocoderProviderFactory.d.ts.map create mode 100644 types/global.d.ts create mode 100644 types/global.d.ts.map create mode 100644 types/index.d.ts create mode 100644 types/index.d.ts.map create mode 100644 types/providers/BingProvider.d.ts create mode 100644 types/providers/BingProvider.d.ts.map create mode 100644 types/providers/GoogleAPIProvider.d.ts create mode 100644 types/providers/GoogleAPIProvider.d.ts.map create mode 100644 types/providers/MapquestProvider.d.ts create mode 100644 types/providers/MapquestProvider.d.ts.map create mode 100644 types/providers/OpenStreetMapProvider.d.ts create mode 100644 types/providers/OpenStreetMapProvider.d.ts.map create mode 100644 types/providers/ProviderHelpers.d.ts create mode 100644 types/providers/ProviderHelpers.d.ts.map create mode 100644 types/providers/ProviderInterface.d.ts create mode 100644 types/providers/ProviderInterface.d.ts.map create mode 100644 types/providers/YandexProvider.d.ts create mode 100644 types/providers/YandexProvider.d.ts.map create mode 100644 types/providers/index.d.ts create mode 100644 types/providers/index.d.ts.map create mode 100644 types/providers/mapbox/MapboxGeocodeQuery.d.ts create mode 100644 types/providers/mapbox/MapboxGeocodeQuery.d.ts.map create mode 100644 types/providers/mapbox/MapboxProvider.d.ts create mode 100644 types/providers/mapbox/MapboxProvider.d.ts.map create mode 100644 types/providers/mapbox/MapboxReverseQuery.d.ts create mode 100644 types/providers/mapbox/MapboxReverseQuery.d.ts.map create mode 100644 types/providers/mapbox/index.d.ts create mode 100644 types/providers/mapbox/index.d.ts.map create mode 100644 types/query/GeocodeQuery.d.ts create mode 100644 types/query/GeocodeQuery.d.ts.map create mode 100644 types/query/ReverseQuery.d.ts create mode 100644 types/query/ReverseQuery.d.ts.map create mode 100644 types/query/index.d.ts create mode 100644 types/query/index.d.ts.map create mode 100644 types/types.d.ts create mode 100644 types/types.d.ts.map create mode 100644 webpack.common.js create mode 100644 webpack.dev.js create mode 100644 webpack.prod.js diff --git a/.bowerrc b/.bowerrc deleted file mode 100644 index b5ecdd1..0000000 --- a/.bowerrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "directory": "lib" -} diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..e3b39df --- /dev/null +++ b/.editorconfig @@ -0,0 +1,11 @@ +root = true + +[*] +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true + +[*.{ts,json}] +indent_style = space +indent_size = 2 diff --git a/.eslintrc b/.eslintrc new file mode 100644 index 0000000..f7fd54e --- /dev/null +++ b/.eslintrc @@ -0,0 +1,31 @@ +{ + "parser": "@typescript-eslint/parser", + "extends": [ + "airbnb-base", + "plugin:@typescript-eslint/recommended", + "prettier", + "prettier/@typescript-eslint" + ], + "env": { + "browser": true + }, + "plugins": ["prettier"], + "ignorePatterns": ["types/**/*.ts"], + "rules": { + "prettier/prettier": ["error"], + "no-console": "off" + }, + "overrides": [ + { + "files": ["spec/**/*.ts"], + "rules": { + "import/no-unresolved": "off" + } + } + ], + "settings": { + "import/resolver": { + "typescript": {} + } + } +} diff --git a/.gitignore b/.gitignore index 9750bd9..f06235c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,2 @@ -.idea -lib node_modules -.grunt -.DS_Store +dist diff --git a/.travis.yml b/.travis.yml index 4d7aab0..ae23e1f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,11 @@ language: node_js node_js: - - "0.10" + - "lts/*" + before_install: - - npm install -g grunt-cli + - npm install + +script: + - npm run lint + - npm test + - npm run build diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..2765302 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,10 @@ +# Changelog + +## 0.1.0 + +* Library rewritten in TypeScript +* Library can be used as a module as well +* Add Mapbox provider +* Formatted address, bounds and country support +* Better handling of provider options (JSONP, SSL) +* The methods `geocode` and `geodecode` can take an object or a `Query` diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..a82c409 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,5 @@ +Pull requests will **not** be accepted without: + +1) All unit/functional tests working. +2) Any potentially affected example files still functional. +3) Any additional functionality covered by unit/functional tests. diff --git a/README.md b/README.md index 9311433..f69a575 100644 --- a/README.md +++ b/README.md @@ -1,41 +1,94 @@ GeocoderJS ========== -**GeocoderJS** is a JavaScript port of the [Geocoder -PHP](http://geocoder-php.org/Geocoder/) library. It's meant as a compliment for -client-side geocoding applications. +[![Build Status](https://travis-ci.org/geocoder-php/geocoder-js.png?branch=master)](https://travis-ci.org/geocoder-php/geocoder-js) +[![Dependency Status](https://david-dm.org/geocoder-php/geocoder-js.png)](https://david-dm.org/geocoder-php/geocoder-js) +[![devDependency Status](https://david-dm.org/geocoder-php/geocoder-js/dev-status.png)](https://david-dm.org/geocoder-php/geocoder-js#info=devDependencies) -[![Build -Status](https://travis-ci.org/geocoder-php/geocoder-js.png?branch=master)](https://travis-ci.org/geocoder-php/geocoder-js) +GeocoderJS is a universal JavaScript library for client-side geocoding applications with multiple built-in providers. -[![Dependency Status](https://david-dm.org/geocoder-php/geocoder-js.png)](https://david-dm.org/geocoder-php/geocoder-js) +It is a port of the [Geocoder PHP](https://geocoder-php.org/) library. -[![devDependency Status](https://david-dm.org/geocoder-php/geocoder-js/dev-status.png)](https://david-dm.org/geocoder-php/geocoder-js#info=devDependencies) +This library is platform agnostic: it is available either server-side (Node) or client-side (browsers, React Native). -Building --------- +Installation +------------ -You can build an uglified version of the script by running 'grunt build'. +Add the library to your project: -Testing -------- +```shell +npm install --save geocoder-js +``` -Unit tests are handled by Jasmine. To run unit tests from the command line, use 'grunt test'. +> ⚠️ **Warning**: If you need to use this library in an environment not supporting the Promise API such as Internet Explorer, you must install an ES6 Promise compatible polyfill like [es6-promise](https://github.com/jakearchibald/es6-promise). -Contributing ------------- +Usage +----- + +You can either use GeocoderJS as a module or as a direct dependency. + +As a module: + +```javascript +import GeocoderJS from "geocoder-js"; + +const openStreetMapGeocoder = GeocoderJS.createGeocoder("openstreetmap"); + +openStreetMapGeocoder.geocode("1600 Pennsylvania Ave NW, Washington, DC", (result) => { + console.log(result); +}); +``` + +If you want to use the library as a direct dependecy, copy `dist/geocoder.js` or `dist/geocoder.min.js` to your dependencies. + +GeocoderJS will be available in the global environment: + +```javascript +const openStreetMapGeocoder = GeocoderJS.createGeocoder("openstreetmap"); -Contibution libraries are installed by Bower. Unit tests are covered by Jasmine. -Pull requests will **not** be accepted without: +openStreetMapGeocoder.geodecode("44.915", "-93.21", (result) => { + console.log(result); +}); +``` -* a) all unit/functional tests working -* b) any potentially affected example files still functional -* c) any additional functionality covered by unit/functional tests. +For a more advanced usage, see the example below: + +```javascript +import GeocoderJS, { ReverseQuery } from "geocoder-js"; + +const googleGeocoder = GeocoderJS.createGeocoder({ + provider: "google", + apiKey: "YOUR_API_KEY", + useSsl: true, + useJsonp: false, + // other specific provider options +}); + +googleGeocoder.geocode({ + text: "1600 Pennsylvania Ave, Washington, DC", + locale: "FR", + limit: 10, + // other specific provider parameters +}, (result) => { + console.log(result); +}); + +const reverseQuery = ReverseQuery.create({ + latitude: "44.915", + longitude: "-93.21", +}) +.withLocale("FR") +.withLimit(7); +googleGeocoder.geodecode(reverseQuery, (result) => { + console.log(result); +}); +``` Providers --------- GeocoderJS comes with modules to integrate with various geocoding providers. + The following table summarizes the features of each: @@ -43,25 +96,31 @@ The following table summarizes the features of each: - + - + - + + + + + + + - + @@ -81,3 +140,18 @@ The following table summarizes the features of each:
Provider Works in browsers?Works in Node.JS?Works in Node? Supports reverse geocoding?
Google MapsGoogle API yes yes yes
MapquestOpenStreetMap (Nominatim)yesuntestedyes
Mapbox yes untested yes
OpenStreetMapMapQuest yes untested yes
+Building +-------- + +```shell +npm run build +``` + +Testing +------- + +Unit tests are handled by Jasmine. To run unit tests from the command line, use: + +```shell +npm test +``` diff --git a/bower.json b/bower.json deleted file mode 100644 index 5d4b0ee..0000000 --- a/bower.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "name": "geocoder-js", - "version": "0.0.1", - "authors": [ - "Brandon Morrison " - ], - "main": "dist/geocoder.min.js", - "license": "MIT", - "private": true, - "ignore": [ - "**/.*", - "node_modules", - "bower_components", - "test", - "tests" - ], - "devDependencies": { - "jasmine": "~v1.3.1" - } -} diff --git a/dist/geocoder.js b/dist/geocoder.js deleted file mode 100644 index 34d26ae..0000000 --- a/dist/geocoder.js +++ /dev/null @@ -1,465 +0,0 @@ -if (function() { - "use strict"; - var a = {}; - a.version = "0.0.0", a.createGeocoder = function(b) { - var c = new a.ProviderFactory(); - return c.createProvider(b); - }; - var b = "object" == typeof window ? window : "object" == typeof exports ? exports : {}; - b.GeocoderJS = a; -}(), "function" == typeof define && define.amd && define(GeocoderJS), "undefined" == typeof GeocoderJS && "function" == typeof require) var GeocoderJS = require("../GeocoderJS.js"); - -if (function(a) { - "use strict"; - a.ProviderBase = function() {}, a.ProviderBase.prototype = { - geocode: function() {}, - geodecode: function() {}, - mapToGeocoded: function() {}, - executeRequest: function() {} - }; -}(GeocoderJS), "undefined" == typeof GeocoderJS && "function" == typeof require) var GeocoderJS = require("./GeocoderJS.js"); - -if (function(a) { - "use strict"; - a.Geocoded = function() {}, a.Geocoded.prototype = { - getCoordinates: function() { - return [ this.latitude, this.longitude ]; - }, - getLatitude: function() { - return this.latitude; - }, - getLongitude: function() { - return this.longitude; - }, - getBounds: function() {}, - getStreetNumber: function() { - return this.streetNumber; - }, - getStreetName: function() { - return this.streetName; - }, - getCity: function() { - return this.city; - }, - getZipcode: function() { - return this.postal_code; - }, - getCityDistrict: function() {}, - getCounty: function() {}, - getCountyCode: function() {}, - getRegion: function() { - return this.region; - } - }; -}(GeocoderJS), "undefined" == typeof GeocoderJS && "function" == typeof require) var GeocoderJS = require("./GeocoderJS.js"); - -if (function(a) { - "use strict"; - var b = { - type: "Feature", - properties: {}, - geometry: { - type: "Point", - coordinates: [] - } - }; - a.GeoJSONDumper = function() { - return { - dump: function(a) { - var c = b; - return c.geometry.coordinates = [ a.getLongitude(), a.getLatitude() ], c; - } - }; - }; -}(GeocoderJS), "undefined" == typeof GeocoderJS && "function" == typeof require) { - var GeocoderJS = require("../GeocoderJS.js"); - require("../ExternalURILoader.js"); -} - -if (function(a) { - "use strict"; - a.ProviderFactory = function() {}, a.ProviderFactory.prototype.createProvider = function(b) { - "string" == typeof b && (b = { - provider: b - }); - var c, d = new a.ExternalURILoader(); - switch (b.provider) { - case "google": - c = new a.GoogleAPIProvider(d, b); - break; - - case "mapquest": - c = new a.MapquestProvider(d, b); - break; - - case "openstreetmap": - c = new a.OpenStreetMapProvider(d, b); - break; - - case "bing": - c = new a.BingProvider(d, b); - break; - - case "yandex": - c = new a.YandexProvider(d, b); - } - return c; - }; -}(GeocoderJS), "undefined" == typeof GeocoderJS && "function" == typeof require) var GeocoderJS = require("../GeocoderJS.js"); - -if (function(a, b) { - "use strict"; - function c(a) { - var c = Date.now(), d = "jsonp" + Math.round(c + 1000001 * Math.random()); - return b[d] = function(c) { - a(c), delete b[d]; - }, d; - } - a.ExternalURILoader = function(a) { - this.options = {}, void 0 === a && (a = {}), this.setOptions(a); - }, a.ExternalURILoader.prototype.setOptions = function(a) { - var b = { - protocol: null, - host: null, - pathname: null - }; - for (var c in b) this.options[c] = void 0 !== a[c] ? a[c] : b[c]; - }, a.ExternalURILoader.prototype.executeRequest = function(b, d) { - function e(b, c) { - var d, e = require("url"), f = require(g.options.protocol), h = { - protocol: g.options.protocol, - host: g.options.host, - pathname: g.options.pathname, - query: b - }; - d = e.format(h), f.get(d, function(b) { - if (200 != b.statusCode) throw "Received HTTP status code " + b.statusCode + " when attempting geocoding request."; - b.data = "", b.setEncoding("utf8"), b.on("data", function(a) { - b.data += a; - }), b.on("end", function() { - if (!b.data || !b.data.length) throw "Received empty data when attempting geocoding request."; - var d = !1, e = 0, f = []; - try { - d = JSON.parse(b.data); - } catch (g) { - throw "Received invalid JSON data when attempting geocoding request."; - } - if (d && d.status) { - if ("OVER_QUERY_LIMIT" === d.status) throw "Exceeded daily quota when attempting geocoding request."; - if ("OK" === d.status && d.results) { - for (;e < d.results.length; e++) f.push(a.GoogleAPIProvider.prototype.mapToGeocoded(d.results[e])); - return c(f); - } - } - throw "Received unexpected JSON data when attempting geocoding request."; - }); - }).on("error", function(a) { - throw a; - }); - } - function f(a, b) { - var d, e = new XMLHttpRequest(), f = g.options.protocol + "://" + g.options.host + "/" + g.options.pathname + "?", h = []; - a.JSONPCallback && (d = a.JSONPCallback, delete a.JSONPCallback, a[d] = c(b)); - for (var i in a) a.hasOwnProperty(i) && h.push(i + "=" + a[i]); - if (f += h.join("&"), d) { - var j = document.createElement("script"); - j.src = f, document.getElementsByTagName("head")[0].appendChild(j); - } else e.onload = function() { - if (200 != this.status) return console.log("Received HTTP status code " + this.status + " when attempting geocoding request."), - b(null); - if (!this.responseText || !this.responseText.length) return console.log("Received empty data when attempting geocoding request."), - b(null); - var a = !1; - try { - a = JSON.parse(this.responseText); - } catch (c) { - return console.log("Received invalid JSON data when attempting geocoding request."), - b(null); - } - return a ? b(a) : (console.log("Received unexpected JSON data when attempting geocoding request."), - b(null)); - }, e.open("GET", f), e.send(); - } - var g = this; - if ("undefined" != typeof XMLHttpRequest) return f(b, d); - try { - { - require("url"); - } - return e(b, d); - } catch (h) {} - return d(null); - }; -}(GeocoderJS, window), "undefined" == typeof GeocoderJS && "function" == typeof require) { - var GeocoderJS = require("../GeocoderJS.js"); - require("../Geocoded.js"), require("../providers/ProviderBase.js"); -} - -if (function(a) { - "use strict"; - var b, c; - a.BingProvider = function(a, d) { - if (void 0 === a) throw "No external loader defined."; - this.externalLoader = a, d = d ? d : {}, b = d.useSSL ? d.useSSL : !1, c = d.apiKey ? d.apiKey : null, - c && (b = !0); - }, a.BingProvider.prototype = new a.ProviderBase(), a.BingProvider.prototype.constructor = a.BingProvider, - a.BingProvider.prototype.geocode = function(a, d) { - this.externalLoader.setOptions({ - protocol: b === !0 ? "https" : "http", - host: "dev.virtualearth.net", - pathname: "REST/v1/Locations/" + a - }); - var e = { - key: c, - JSONPCallback: "jsonp" - }; - this.executeRequest(e, d); - }, a.BingProvider.prototype.geodecode = function(a, d, e) { - this.externalLoader.setOptions({ - protocol: b === !0 ? "https" : "http", - host: "dev.virtualearth.net", - pathname: "REST/v1/Locations/" + a + "," + d - }); - var f = { - key: c, - JSONPCallback: "jsonp" - }; - this.executeRequest(f, e); - }, a.BingProvider.prototype.executeRequest = function(a, b) { - var c = this; - this.externalLoader.executeRequest(a, function(a) { - var d = []; - for (var e in a.resourceSets[0].resources) d.push(c.mapToGeocoded(a.resourceSets[0].resources[e])); - b(d); - }); - }, a.BingProvider.prototype.mapToGeocoded = function(b) { - var c = new a.Geocoded(); - return c.latitude = b.point.coordinates[0], c.longitude = b.point.coordinates[1], - c.streetName = b.address.addressLine, c.city = b.address.locality, c.region = b.address.adminDistrict, - c.postal_code = b.address.postalCode, c; - }; -}(GeocoderJS), "undefined" == typeof GeocoderJS && "function" == typeof require) { - var GeocoderJS = require("../GeocoderJS.js"); - require("../Geocoded.js"), require("../providers/ProviderBase.js"); -} - -if (function(a) { - "use strict"; - var b, c; - a.GoogleAPIProvider = function(a, d) { - if (void 0 === a) throw "No external loader defined."; - this.externalLoader = a, d = d ? d : {}, b = d.useSSL ? d.useSSL : !1, c = d.apiKey ? d.apiKey : null, - c && (b = !0); - }, a.GoogleAPIProvider.prototype = new a.ProviderBase(), a.GoogleAPIProvider.prototype.constructor = a.GoogleAPIProvider, - a.GoogleAPIProvider.prototype.geocode = function(a, d) { - this.externalLoader.setOptions({ - protocol: b === !0 ? "https" : "http", - host: "maps.googleapis.com", - pathname: "maps/api/geocode/json" - }); - var e = { - sensor: !1, - address: a - }; - c && (e.key = c), this.executeRequest(e, d); - }, a.GoogleAPIProvider.prototype.geodecode = function(a, d, e) { - this.externalLoader.setOptions({ - protocol: b ? "https" : "http", - host: "maps.googleapis.com", - pathname: "maps/api/geocode/json" - }); - var f = { - sensor: !1, - latlng: a + "," + d - }; - c && (f.key = c), this.executeRequest(f, e); - }, a.GoogleAPIProvider.prototype.executeRequest = function(a, b) { - var c = this; - this.externalLoader.executeRequest(a, function(a) { - var d = []; - for (var e in a.results) d.push(c.mapToGeocoded(a.results[e])); - b(d); - }); - }, a.GoogleAPIProvider.prototype.mapToGeocoded = function(b) { - var c = new a.Geocoded(); - c.latitude = b.geometry.location.lat, c.longitude = b.geometry.location.lng; - for (var d in b.address_components) for (var e in b.address_components[d].types) switch (b.address_components[d].types[e]) { - case "street_number": - c.streetNumber = b.address_components[d].long_name; - break; - - case "route": - c.streetName = b.address_components[d].long_name; - break; - - case "locality": - c.city = b.address_components[d].long_name; - break; - - case "administrative_area_level_1": - c.region = b.address_components[d].long_name; - break; - - case "postal_code": - c.postal_code = b.address_components[d].long_name; - } - return c; - }; -}(GeocoderJS), "undefined" == typeof GeocoderJS && "function" == typeof require) var GeocoderJS = require("../GeocoderJS.js"); - -if (function(a) { - "use strict"; - a.MapquestProvider = function(a, b) { - if (void 0 === a) throw "No external loader defined."; - this.externalLoader = a, "object" != typeof b && (b = {}); - var c = { - apiKey: "" - }; - for (var d in c) void 0 === b[d] && (b[d] = c[d]); - this.apiKey = b.apiKey; - }, a.MapquestProvider.prototype = new a.ProviderBase(), a.MapquestProvider.prototype.constructor = a.MapquestProvider, - a.MapquestProvider.prototype.geocode = function(a, b) { - this.externalLoader.setOptions({ - protocol: "http", - host: "www.mapquestapi.com", - pathname: "geocoding/v1/address" - }); - var c = { - key: this.apiKey, - outputFormat: "json", - location: encodeURIComponent(a), - JSONPCallback: "callback" - }; - this.executeRequest(c, b); - }, a.MapquestProvider.prototype.geodecode = function(a, b, c) { - this.externalLoader.setOptions({ - protocol: "http", - host: "www.mapquestapi.com", - pathname: "geocoding/v1/reverse" - }); - var d = { - key: this.apiKey, - outputFormat: "json", - JSONPCallback: "callback", - location: a + "," + b - }; - this.executeRequest(d, c); - }, a.MapquestProvider.prototype.mapToGeocoded = function(b) { - var c = new a.Geocoded(); - return c.latitude = b.latLng.lat, c.longitude = b.latLng.lng, c.city = b.adminArea5, - c.region = b.adminArea4, c.streetName = b.street, c.postal_code = b.postalCode, - c; - }, a.MapquestProvider.prototype.executeRequest = function(a, b) { - var c = this; - this.externalLoader.executeRequest(a, function(a) { - var d = []; - if (a.results[0].locations.length) for (var e in a.results[0].locations) d.push(c.mapToGeocoded(a.results[0].locations[e])); - b(d); - }); - }; -}(GeocoderJS), "undefined" == typeof GeocoderJS && "function" == typeof require) { - var GeocoderJS = require("../GeocoderJS.js"); - require("../Geocoded.js"), require("../ExternalURILoader.js"), require("../providers/ProviderBase.js"); -} - -if (function(a) { - "use strict"; - a.OpenStreetMapProvider = function(a) { - if (void 0 === a) throw "No external loader defined."; - this.externalLoader = a; - }, a.OpenStreetMapProvider.prototype = new a.ProviderBase(), a.OpenStreetMapProvider.prototype.constructor = a.OpenStreetMapProvider, - a.OpenStreetMapProvider.prototype.geocode = function(a, b) { - this.externalLoader.setOptions({ - protocol: "http", - host: "nominatim.openstreetmap.org", - pathname: "search" - }); - var c = { - format: "json", - q: a, - addressdetails: 1 - }; - this.executeRequest(c, b); - }, a.OpenStreetMapProvider.prototype.geodecode = function(a, b, c) { - this.externalLoader.setOptions({ - protocol: "http", - host: "nominatim.openstreetmap.org", - pathname: "reverse" - }); - var d = { - format: "json", - lat: a, - lon: b, - addressdetails: 1, - zoom: 18 - }; - this.executeRequest(d, c); - }, a.OpenStreetMapProvider.prototype.executeRequest = function(a, b) { - var c = this; - this.externalLoader.executeRequest(a, function(a) { - var d = []; - if (a.length) for (var e in a) d.push(c.mapToGeocoded(a[e])); else d.push(c.mapToGeocoded(a)); - b(d); - }); - }, a.OpenStreetMapProvider.prototype.mapToGeocoded = function(b) { - var c = new a.Geocoded(); - return c.latitude = 1 * b.lat, c.longitude = 1 * b.lon, c.streetNumber = void 0 !== b.address.house_number ? b.address.house_number : void 0, - c.streetName = b.address.road, c.city = b.address.city, c.region = b.address.state, - c.postal_code = b.address.postcode, c; - }; -}(GeocoderJS), "undefined" == typeof GeocoderJS && "function" == typeof require) { - var GeocoderJS = require("../GeocoderJS.js"); - require("../Geocoded.js"), require("../providers/ProviderBase.js"); -} - -!function(a) { - "use strict"; - var b; - a.YandexProvider = function(a, c) { - if (void 0 === a) throw "No external loader defined."; - this.externalLoader = a, c = c ? c : {}, b = c.useSSL ? c.useSSL : !1, this.lang = c.lang ? c.lang : "en-US"; - }, a.YandexProvider.prototype = new a.ProviderBase(), a.YandexProvider.prototype.constructor = a.YandexProvider, - a.YandexProvider.prototype.geocode = function(a, c) { - this.externalLoader.setOptions({ - protocol: b === !0 ? "https" : "http", - host: "geocode-maps.yandex.ru", - pathname: "1.x" - }); - var d = { - format: "json", - geocode: a, - JSONPCallback: "callback", - lang: this.lang - }; - this.executeRequest(d, c); - }, a.YandexProvider.prototype.geodecode = function(a, c, d) { - this.externalLoader.setOptions({ - protocol: b === !0 ? "https" : "http", - host: "geocode-maps.yandex.ru", - pathname: "1.x" - }); - var e = { - format: "json", - geocode: c + "," + a, - JSONPCallback: "callback", - lang: this.lang - }; - this.executeRequest(e, d); - }, a.YandexProvider.prototype.executeRequest = function(a, b) { - var c = this; - this.externalLoader.executeRequest(a, function(a) { - var d = []; - for (var e in a.response.GeoObjectCollection.featureMember) d.push(c.mapToGeocoded(a.response.GeoObjectCollection.featureMember[e].GeoObject)); - b(d); - }); - }, a.YandexProvider.prototype.mapToGeocoded = function(b) { - var c = new a.Geocoded(), d = b.Point.pos.split(" "); - if (c.latitude = d[1], c.longitude = d[0], b.metaDataProperty.GeocoderMetaData.AddressDetails.Country) { - var e = b.metaDataProperty.GeocoderMetaData.AddressDetails.Country; - e.AdministrativeArea && (e = e.AdministrativeArea, c.region = e.AdministrativeAreaName, - e.SubAdministrativeArea && (e = e.SubAdministrativeArea, e.Locality && (e = e.Locality, - c.city = e.LocalityName, e.Thoroughfare && (e = e.Thoroughfare, c.streetName = e.ThoroughfareName)))); - } - return c; - }; -}(GeocoderJS); \ No newline at end of file diff --git a/dist/geocoder.min.js b/dist/geocoder.min.js deleted file mode 100644 index 4b09bcb..0000000 --- a/dist/geocoder.min.js +++ /dev/null @@ -1 +0,0 @@ -if(function(){"use strict";var a={};a.version="0.0.0",a.createGeocoder=function(b){var c=new a.ProviderFactory;return c.createProvider(b)};var b="object"==typeof window?window:"object"==typeof exports?exports:{};b.GeocoderJS=a}(),"function"==typeof define&&define.amd&&define(GeocoderJS),"undefined"==typeof GeocoderJS&&"function"==typeof require)var GeocoderJS=require("../GeocoderJS.js");if(function(a){"use strict";a.ProviderBase=function(){},a.ProviderBase.prototype={geocode:function(){},geodecode:function(){},mapToGeocoded:function(){},executeRequest:function(){}}}(GeocoderJS),"undefined"==typeof GeocoderJS&&"function"==typeof require)var GeocoderJS=require("./GeocoderJS.js");if(function(a){"use strict";a.Geocoded=function(){},a.Geocoded.prototype={getCoordinates:function(){return[this.latitude,this.longitude]},getLatitude:function(){return this.latitude},getLongitude:function(){return this.longitude},getBounds:function(){},getStreetNumber:function(){return this.streetNumber},getStreetName:function(){return this.streetName},getCity:function(){return this.city},getZipcode:function(){return this.postal_code},getCityDistrict:function(){},getCounty:function(){},getCountyCode:function(){},getRegion:function(){return this.region}}}(GeocoderJS),"undefined"==typeof GeocoderJS&&"function"==typeof require)var GeocoderJS=require("./GeocoderJS.js");if(function(a){"use strict";var b={type:"Feature",properties:{},geometry:{type:"Point",coordinates:[]}};a.GeoJSONDumper=function(){return{dump:function(a){var c=b;return c.geometry.coordinates=[a.getLongitude(),a.getLatitude()],c}}}}(GeocoderJS),"undefined"==typeof GeocoderJS&&"function"==typeof require){var GeocoderJS=require("../GeocoderJS.js");require("../ExternalURILoader.js")}if(function(a){"use strict";a.ProviderFactory=function(){},a.ProviderFactory.prototype.createProvider=function(b){"string"==typeof b&&(b={provider:b});var c,d=new a.ExternalURILoader;switch(b.provider){case"google":c=new a.GoogleAPIProvider(d,b);break;case"mapquest":c=new a.MapquestProvider(d,b);break;case"openstreetmap":c=new a.OpenStreetMapProvider(d,b);break;case"bing":c=new a.BingProvider(d,b);break;case"yandex":c=new a.YandexProvider(d,b)}return c}}(GeocoderJS),"undefined"==typeof GeocoderJS&&"function"==typeof require)var GeocoderJS=require("../GeocoderJS.js");if(function(a,b){"use strict";function c(a){var c=Date.now(),d="jsonp"+Math.round(c+1000001*Math.random());return b[d]=function(c){a(c),delete b[d]},d}a.ExternalURILoader=function(a){this.options={},void 0===a&&(a={}),this.setOptions(a)},a.ExternalURILoader.prototype.setOptions=function(a){var b={protocol:null,host:null,pathname:null};for(var c in b)this.options[c]=void 0!==a[c]?a[c]:b[c]},a.ExternalURILoader.prototype.executeRequest=function(b,d){function e(b,c){var d,e=require("url"),f=require(g.options.protocol),h={protocol:g.options.protocol,host:g.options.host,pathname:g.options.pathname,query:b};d=e.format(h),f.get(d,function(b){if(200!=b.statusCode)throw"Received HTTP status code "+b.statusCode+" when attempting geocoding request.";b.data="",b.setEncoding("utf8"),b.on("data",function(a){b.data+=a}),b.on("end",function(){if(!b.data||!b.data.length)throw"Received empty data when attempting geocoding request.";var d=!1,e=0,f=[];try{d=JSON.parse(b.data)}catch(g){throw"Received invalid JSON data when attempting geocoding request."}if(d&&d.status){if("OVER_QUERY_LIMIT"===d.status)throw"Exceeded daily quota when attempting geocoding request.";if("OK"===d.status&&d.results){for(;e - Geocoder.js: Mapquest Simple Example + Geocoder.js: Bing Example + + + + + + \ No newline at end of file diff --git a/example/mapquest.html b/example/mapquest.html index f480a84..9042bea 100644 --- a/example/mapquest.html +++ b/example/mapquest.html @@ -1,11 +1,11 @@ - Geocoder.js: Mapquest Simple Example + Geocoder.js: Mapquest Example - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/spec/support/jasmine.json b/spec/support/jasmine.json new file mode 100644 index 0000000..fac234e --- /dev/null +++ b/spec/support/jasmine.json @@ -0,0 +1,11 @@ +{ + "spec_dir": "spec", + "spec_files": [ + "**/*[sS]pec.ts" + ], + "helpers": [ + "helpers/**/*.ts" + ], + "stopSpecOnExpectationFailure": false, + "random": true +} diff --git a/src/ExternalURILoader.js b/src/ExternalURILoader.js deleted file mode 100644 index a360450..0000000 --- a/src/ExternalURILoader.js +++ /dev/null @@ -1,202 +0,0 @@ -/** - * GeocoderJS.ExternalURILoader - * - Used to load data from external geocoding engines. - */ - -if (typeof GeocoderJS === "undefined" && typeof require === "function") { - var GeocoderJS = require("../GeocoderJS.js"); -} - -;(function (GeocoderJS, window) { - "use strict"; - - GeocoderJS.ExternalURILoader = function(options) { - this.options = {}; - - // @TODO: remove and add a throw if no options are passed. - if (options === undefined) { - options = {}; - } - - this.setOptions(options); - }; - - GeocoderJS.ExternalURILoader.prototype.setOptions = function(options) { - var defaults = { - protocol: null, - host: null, - pathname: null - }; - - for (var i in defaults) { - this.options[i] = (options[i] !== undefined) ? options[i] : defaults[i]; - } - }; - - GeocoderJS.ExternalURILoader.prototype.executeRequest = function(params, callback) { - var _this = this; - if (typeof XMLHttpRequest !== "undefined") { - return executeDOMRequest(params, callback); - } - - try { - var url = require("url"); - return executeNodeRequest(params, callback); - } - catch (err) { - // Intentionally empty. - } - - return callback(null); - - function executeNodeRequest(params, callback) { - var url = require("url"), - http = require(_this.options.protocol), - urlObj = { - "protocol": _this.options.protocol, - "host": _this.options.host, - "pathname": _this.options.pathname, - "query": params - }, - requestUrl; - - requestUrl = url.format(urlObj); - - http.get(requestUrl, function(res) { - if (res.statusCode != 200) { - throw("Received HTTP status code " + res.statusCode + " when attempting geocoding request."); - } - - res.data = ""; - res.setEncoding("utf8"); - - res.on("data", function (chunk) { - res.data += chunk; - }); - - res.on("end", function () { - if (!res.data || !res.data.length) { - throw("Received empty data when attempting geocoding request."); - } - - var data = false, - i = 0, - results = []; - try { - data = JSON.parse(res.data); - } - catch(e) { - throw("Received invalid JSON data when attempting geocoding request."); - } - - if (data && data.status) { - if (data.status === "OVER_QUERY_LIMIT") { - throw("Exceeded daily quota when attempting geocoding request."); - } - else if (data.status === "OK" && data.results) { - for (; i < data.results.length; i++) { - results.push(GeocoderJS.GoogleAPIProvider.prototype.mapToGeocoded(data.results[i])); - } - return callback(results); - } - } - - throw("Received unexpected JSON data when attempting geocoding request."); - }); - }).on("error", function(err) { - throw(err); - }); - } - - function executeDOMRequest(params, callback) { - var req = new XMLHttpRequest(), - requestUrl = _this.options.protocol + "://" + _this.options.host + "/" + _this.options.pathname + "?", - JSONPCallback; - - var paramsList = []; - - if (params.JSONPCallback) { - JSONPCallback = params.JSONPCallback; - delete params.JSONPCallback; - params[JSONPCallback] = generateJSONPCallback(callback); - } - - for (var key in params) { - if (params.hasOwnProperty(key)) { - paramsList.push(key + "=" + params[key]); - //} - } - } - - requestUrl += paramsList.join('&'); - - if (JSONPCallback) { - // Create a new script element - var script_element = document.createElement('script'); - - // Set its source to the JSONP API - script_element.src = requestUrl; - - // Stick the script element in the page - document.getElementsByTagName('head')[0].appendChild(script_element); - } else { - req.onload = function () { - if (this.status != 200) { - console.log("Received HTTP status code " + this.status + " when attempting geocoding request."); - return callback(null); - } - - if (!this.responseText || !this.responseText.length) { - console.log("Received empty data when attempting geocoding request."); - return callback(null); - } - - var data = false, - i = 0, - results = []; - try { - data = JSON.parse(this.responseText); - } - catch(e) { - console.log("Received invalid JSON data when attempting geocoding request."); - return callback(null); - } - - if (data) { - return callback(data); - } - - console.log("Received unexpected JSON data when attempting geocoding request."); - return callback(null); - }; - - req.open("GET", requestUrl); - req.send(); - } - } - - }; - - /** - * Generates randomly-named function to use as a callback for JSONP requests. - * From https://github.com/OscarGodson/JSONP - * @returns {string} - Function name - */ - function generateJSONPCallback(callback) { - //Use timestamp + a random factor to account for a lot of requests in a short time - //e.g. jsonp1394571775161 - var timestamp = Date.now(); - var generatedFunction = 'jsonp'+Math.round(timestamp+Math.random()*1000001); - - //Generate the temp JSONP function using the name above - //First, call the function the user defined in the callback param [callback(json)] - //Then delete the generated function from the window [delete window[generatedFunction]] - window[generatedFunction] = function(json){ - callback(json); - delete window[generatedFunction]; - }; - - return generatedFunction; - } - -})(GeocoderJS, window); diff --git a/src/ExternalURILoader.ts b/src/ExternalURILoader.ts new file mode 100644 index 0000000..c100879 --- /dev/null +++ b/src/ExternalURILoader.ts @@ -0,0 +1,145 @@ +import fetch from "cross-fetch"; + +export interface ExternalLoaderInterface { + setOptions(options: ExternalLoaderOptions): void; + executeRequest( + params: ExternalLoaderParams, + callback: ResponseCallback + ): void; +} + +export interface ExternalLoaderOptions { + readonly protocol: null | string; + readonly host: null | string; + readonly pathname: null | string; +} + +export interface ExternalLoaderParams { + [param: string]: string | undefined; + JSONPCallback?: string; +} + +// eslint-disable-next-line @typescript-eslint/no-explicit-any +type ResponseCallback = (response: any) => void; + +const defaultOptions: ExternalLoaderOptions = { + protocol: null, + host: null, + pathname: null, +}; + +/** + * Load data from external geocoding engines. + */ +export default class ExternalURILoader implements ExternalLoaderInterface { + private options: ExternalLoaderOptions = defaultOptions; + + public constructor(options: ExternalLoaderOptions = defaultOptions) { + this.setOptions(options); + } + + public setOptions(options: ExternalLoaderOptions): void { + this.options = { ...defaultOptions, ...options }; + } + + public executeRequest( + params: ExternalLoaderParams, + callback: ResponseCallback + ): void { + const requestUrl = new URL( + `${this.options.protocol}://${this.options.host}/${this.options.pathname}` + ); + + const { JSONPCallback: jsonpCallback, ...requestParams } = params; + + // eslint-disable-next-line no-restricted-syntax + for (const paramKey in requestParams) { + if ( + Object.prototype.hasOwnProperty.call(requestParams, paramKey) && + requestParams[paramKey] !== undefined + ) { + requestUrl.searchParams.append(paramKey, requestParams[paramKey] ?? ""); + } + } + + if (jsonpCallback) { + ExternalURILoader.runJsonpCallback(requestUrl, callback, jsonpCallback); + return; + } + + fetch(requestUrl.toString()) + .then((response) => { + if (!response.ok) { + throw new Error( + `Received HTTP status code ${response.status} when attempting geocoding request.` + ); + } + return response.json(); + }) + .then( + (data) => callback(data), + () => { + throw new Error( + "Received invalid JSON data when attempting geocoding request." + ); + } + ) + .catch((error) => { + console.log(error); + callback(null); + }); + } + + private static runJsonpCallback( + requestUrl: URL, + callback: ResponseCallback, + jsonpCallback: string + ): void { + if (typeof window === "undefined") { + console.error( + "JSONPCallback parameter can only be used in a browser environment." + ); + + return; + } + + requestUrl.searchParams.append( + jsonpCallback, + ExternalURILoader.generateJsonpCallback(callback) + ); + + // Create a new script element. + const scriptElement = document.createElement("script"); + + // Set its source to the JSONP API. + scriptElement.src = requestUrl.toString(); + + // Stick the script element in the page . + document.getElementsByTagName("head")[0].appendChild(scriptElement); + } + + /** + * Generates randomly-named function to use as a callback for JSONP requests. + * @see https://github.com/OscarGodson/JSONP + */ + private static generateJsonpCallback(callback: ResponseCallback): string { + // Use timestamp + a random factor to account for a lot of requests in a short time. + // e.g. jsonp1394571775161. + const timestamp = Date.now(); + const generatedFunction = `jsonp${Math.round( + timestamp + Math.random() * 1000001 + )}`; + + // Generate the temp JSONP function using the name above. + // First, call the function the user defined in the callback param [callback(json)]. + // Then delete the generated function from the window [delete window[generatedFunction]]. + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (window)[generatedFunction] = (json: string) => { + callback(json); + // eslint-disable-next-line @typescript-eslint/no-explicit-any + delete (window)[generatedFunction]; + }; + + return generatedFunction; + } +} diff --git a/src/GeoJSONDumper.js b/src/GeoJSONDumper.js deleted file mode 100644 index caa7978..0000000 --- a/src/GeoJSONDumper.js +++ /dev/null @@ -1,27 +0,0 @@ -if (typeof GeocoderJS === "undefined" && typeof require === "function") { - var GeocoderJS = require("./GeocoderJS.js"); -} - -;(function (GeocoderJS) { - "use strict"; - - var baseGeoJSON = { - "type": "Feature", - "properties": {}, - "geometry": { - "type": "Point", - "coordinates": [] - } - }; - - GeocoderJS.GeoJSONDumper = function() { - return { - dump: function(geocoded) { - var result = baseGeoJSON; - result.geometry.coordinates = [geocoded.getLongitude(), geocoded.getLatitude()]; - return result; - } - }; - }; - -})(GeocoderJS); diff --git a/src/GeoJSONDumper.ts b/src/GeoJSONDumper.ts new file mode 100644 index 0000000..4468b84 --- /dev/null +++ b/src/GeoJSONDumper.ts @@ -0,0 +1,31 @@ +import Geocoded from "Geocoded"; + +export interface GeoJson { + type: "Feature"; + properties: Record; + geometry: { + type: "Point"; + coordinates: [number | undefined, number | undefined]; + }; +} + +export default class GeoJsonDumper { + private baseGeoJson: GeoJson = { + type: "Feature", + properties: {}, + geometry: { + type: "Point", + coordinates: [undefined, undefined], + }, + }; + + public dump(geocoded: Geocoded): GeoJson { + const result = this.baseGeoJson; + result.geometry.coordinates = [ + geocoded.getLongitude(), + geocoded.getLatitude(), + ]; + + return result; + } +} diff --git a/src/Geocoded.js b/src/Geocoded.js deleted file mode 100644 index f7b8cc9..0000000 --- a/src/Geocoded.js +++ /dev/null @@ -1,25 +0,0 @@ -if (typeof GeocoderJS === "undefined" && typeof require === "function") { - var GeocoderJS = require("./GeocoderJS.js"); -} - -;(function (GeocoderJS) { - "use strict"; - - GeocoderJS.Geocoded = function() {}; - - GeocoderJS.Geocoded.prototype = { - getCoordinates: function() {return[this.latitude, this.longitude];}, - getLatitude: function() {return this.latitude;}, - getLongitude: function() {return this.longitude;}, - getBounds: function() {}, - getStreetNumber: function() {return this.streetNumber;}, - getStreetName: function() {return this.streetName;}, - getCity: function() {return this.city;}, - getZipcode: function() {return this.postal_code;}, - getCityDistrict: function() {}, - getCounty: function() {}, - getCountyCode: function() {}, - getRegion: function() {return this.region;} - }; - -})(GeocoderJS); diff --git a/src/Geocoded.ts b/src/Geocoded.ts new file mode 100644 index 0000000..c2fa4d8 --- /dev/null +++ b/src/Geocoded.ts @@ -0,0 +1,187 @@ +export interface GeocodedObject { + readonly latitude?: number; + readonly longitude?: number; + readonly south?: number; + readonly west?: number; + readonly north?: number; + readonly east?: number; + readonly formattedAddress?: string; + readonly streetNumber?: string; + readonly streetName?: string; + readonly subLocality?: string; + readonly locality?: string; + readonly postalCode?: string; + readonly region?: string; + readonly country?: string; + readonly countryCode?: string; +} + +export default class Geocoded { + private readonly latitude?: number; + + private readonly longitude?: number; + + private readonly south?: number; + + private readonly west?: number; + + private readonly north?: number; + + private readonly east?: number; + + private readonly formattedAddress?: string; + + private readonly streetNumber?: string; + + private readonly streetName?: string; + + private readonly subLocality?: string; + + private readonly locality?: string; + + private readonly postalCode?: string; + + private readonly region?: string; + + private readonly country?: string; + + private readonly countryCode?: string; + + private constructor({ + latitude, + longitude, + south, + west, + north, + east, + formattedAddress, + streetNumber, + streetName, + subLocality, + locality, + postalCode, + region, + country, + countryCode, + }: GeocodedObject) { + this.latitude = latitude; + this.longitude = longitude; + this.south = south; + this.west = west; + this.north = north; + this.east = east; + this.formattedAddress = formattedAddress; + this.streetNumber = streetNumber; + this.streetName = streetName; + this.subLocality = subLocality; + this.locality = locality; + this.postalCode = postalCode; + this.region = region; + this.country = country; + this.countryCode = countryCode; + } + + public static create(object: GeocodedObject): Geocoded { + return new Geocoded(object); + } + + public toObject(): GeocodedObject { + return { + latitude: this.latitude, + longitude: this.longitude, + south: this.south, + west: this.west, + north: this.north, + east: this.east, + formattedAddress: this.formattedAddress, + streetNumber: this.streetNumber, + streetName: this.streetName, + subLocality: this.subLocality, + locality: this.locality, + postalCode: this.postalCode, + region: this.region, + country: this.country, + countryCode: this.countryCode, + }; + } + + public withBounds( + south?: number, + west?: number, + north?: number, + east?: number + ): Geocoded { + return new Geocoded({ + ...this.toObject(), + south, + west, + north, + east, + }); + } + + public withCoordinates(latitude?: number, longitude?: number): Geocoded { + return new Geocoded({ + ...this.toObject(), + latitude, + longitude, + }); + } + + public getCoordinates(): [undefined | number, undefined | number] { + return [this.latitude, this.longitude]; + } + + public getLatitude(): undefined | number { + return this.latitude; + } + + public getLongitude(): undefined | number { + return this.longitude; + } + + public getBounds(): [ + undefined | number, + undefined | number, + undefined | number, + undefined | number + ] { + return [this.south, this.west, this.north, this.east]; + } + + public getFormattedAddress(): undefined | string { + return this.formattedAddress; + } + + public getStreetNumber(): undefined | string { + return this.streetNumber; + } + + public getStreetName(): undefined | string { + return this.streetName; + } + + public getSubLocality(): undefined | string { + return this.subLocality; + } + + public getLocality(): undefined | string { + return this.locality; + } + + public getPostalCode(): undefined | string { + return this.postalCode; + } + + public getRegion(): undefined | string { + return this.region; + } + + public getCountry(): undefined | string { + return this.country; + } + + public getCountryCode(): undefined | string { + return this.countryCode; + } +} diff --git a/src/GeocoderJS.js b/src/GeocoderJS.js deleted file mode 100644 index 732e177..0000000 --- a/src/GeocoderJS.js +++ /dev/null @@ -1,19 +0,0 @@ -;(function () { - "use strict"; - - var GeocoderJS = {}; - GeocoderJS.version = '0.0.0'; - - GeocoderJS.createGeocoder = function(options) { - var factory = new GeocoderJS.ProviderFactory(); - return factory.createProvider(options); - }; - - var container = (typeof window === "object") ? window : (typeof exports === "object") ? exports : {}; - container.GeocoderJS = GeocoderJS; -})(); - -// Define GeocoderJS as an AMD module. -if (typeof define === 'function' && define.amd) { - define(GeocoderJS); -} diff --git a/src/GeocoderJS.ts b/src/GeocoderJS.ts new file mode 100644 index 0000000..b71ccf3 --- /dev/null +++ b/src/GeocoderJS.ts @@ -0,0 +1,14 @@ +import ProviderFactory, { + GeocoderProviderFactoryOptions, +} from "GeocoderProviderFactory"; +import { ProviderInterface } from "providers"; + +export default class GeocoderJS { + public version = "0.1.0"; + + public static createGeocoder( + options: string | GeocoderProviderFactoryOptions + ): ProviderInterface | undefined { + return ProviderFactory.createProvider(options); + } +} diff --git a/src/GeocoderProviderFactory.js b/src/GeocoderProviderFactory.js deleted file mode 100644 index f91eda3..0000000 --- a/src/GeocoderProviderFactory.js +++ /dev/null @@ -1,52 +0,0 @@ -if (typeof GeocoderJS === "undefined" && typeof require === "function") { - var GeocoderJS = require("../GeocoderJS.js"); - require("../ExternalURILoader.js"); -} - -;(function (GeocoderJS) { - "use strict"; - - GeocoderJS.ProviderFactory = function() {}; - - /** - * Creates new Geocoder Provider instances. - * @options - * Either a string representing the registered provider, or an object with the - * following settings for instigating providers. - * - provider: A string representing the registered provider. - * @return - * An object compatable with the ProviderBase class, or undefined if there's - * not a registered provider. - */ - GeocoderJS.ProviderFactory.prototype.createProvider = function(options) { - if (typeof options === "string") { - options = { - 'provider': options - }; - } - - var provider; - var externalLoader = new GeocoderJS.ExternalURILoader(); - - switch (options.provider) { - case 'google': - provider = new GeocoderJS.GoogleAPIProvider(externalLoader, options); - break; - case 'mapquest': - provider = new GeocoderJS.MapquestProvider(externalLoader, options); - break; - case 'openstreetmap': - provider = new GeocoderJS.OpenStreetMapProvider(externalLoader, options); - break; - case 'bing': - provider = new GeocoderJS.BingProvider(externalLoader, options); - break; - case 'yandex': - provider = new GeocoderJS.YandexProvider(externalLoader, options); - break; - } - - return provider; - }; - -})(GeocoderJS); diff --git a/src/GeocoderProviderFactory.ts b/src/GeocoderProviderFactory.ts new file mode 100644 index 0000000..721025c --- /dev/null +++ b/src/GeocoderProviderFactory.ts @@ -0,0 +1,73 @@ +import { + BingProvider, + GoogleAPIProvider, + MapboxProvider, + MapquestProvider, + OpenStreetMapProvider, + YandexProvider, + ProviderInterface, + ProviderOptionsInterface, + defaultProviderOptions, + defaultMapboxProviderOptions, + defaultYandexProviderOptions, +} from "providers"; +import ExternalURILoader from "ExternalURILoader"; + +export interface GeocoderProviderFactoryOptions + extends ProviderOptionsInterface { + provider: + | "bing" + | "google" + | "mapbox" + | "mapquest" + | "openstreetmap" + | "yandex"; +} + +export default class ProviderFactory { + /** + * Creates Geocoder Provider instances. + * @param options + * Either a string representing the registered provider, or an object with the + * following settings for instigating providers: + * - provider: A string representing the registered provider. + * @return + * An object compatible with ProviderInterface, or undefined if there's not a + * registered provider. + */ + public static createProvider( + options: string | GeocoderProviderFactoryOptions + ): ProviderInterface | undefined { + const createProviderOptions = { + ...defaultProviderOptions, + ...(typeof options === "string" ? { provider: options } : options), + }; + + const externalLoader = new ExternalURILoader(); + + const { provider, ...providerOptions } = createProviderOptions; + switch (provider) { + case "bing": + return new BingProvider(externalLoader, providerOptions); + case "google": + return new GoogleAPIProvider(externalLoader, providerOptions); + case "mapbox": + return new MapboxProvider(externalLoader, { + ...defaultMapboxProviderOptions, + ...providerOptions, + }); + case "mapquest": + return new MapquestProvider(externalLoader, providerOptions); + case "openstreetmap": + return new OpenStreetMapProvider(externalLoader, providerOptions); + case "yandex": + return new YandexProvider(externalLoader, { + ...defaultYandexProviderOptions, + ...providerOptions, + }); + default: + } + + return undefined; + } +} diff --git a/src/global.ts b/src/global.ts new file mode 100644 index 0000000..fd17620 --- /dev/null +++ b/src/global.ts @@ -0,0 +1,16 @@ +import GeocoderJS from "GeocoderJS"; + +interface Container { + GeocoderJS: typeof GeocoderJS; +} + +declare global { + interface Window { + GeocoderJS: typeof GeocoderJS; + } +} + +const container: Window | Container = + typeof window === "object" ? window : ({} as Container); + +container.GeocoderJS = GeocoderJS; diff --git a/src/index.ts b/src/index.ts new file mode 100644 index 0000000..d75c3cc --- /dev/null +++ b/src/index.ts @@ -0,0 +1,23 @@ +export interface Bounds { + readonly south: number | string; + readonly west: number | string; + readonly north: number | string; + readonly east: number | string; +} + +export interface Coordinates { + readonly latitude: number | string; + readonly longitude: number | string; +} + +export * from "providers"; +export * from "query"; +export { default as ExternalURILoader } from "ExternalURILoader"; +export * from "ExternalURILoader"; +export { default as Geocoded } from "Geocoded"; +export * from "Geocoded"; +export { default as GeocoderProviderFactory } from "GeocoderProviderFactory"; +export * from "GeocoderProviderFactory"; +export { default as GeoJSONDumper } from "GeoJSONDumper"; +export * from "GeoJSONDumper"; +export { default } from "GeocoderJS"; diff --git a/src/providers/BingProvider.js b/src/providers/BingProvider.js deleted file mode 100644 index 4533490..0000000 --- a/src/providers/BingProvider.js +++ /dev/null @@ -1,87 +0,0 @@ -if (typeof GeocoderJS === "undefined" && typeof require === "function") { - var GeocoderJS = require("../GeocoderJS.js"); - require("../Geocoded.js"); - require("../providers/ProviderBase.js"); -} - -;(function (GeocoderJS) { - "use strict"; - - var useSSL; - var apiKey; - - GeocoderJS.BingProvider = function(_externalLoader, options) { - if (_externalLoader === undefined) { - throw "No external loader defined."; - } - this.externalLoader = _externalLoader; - - options = (options) ? options : {}; - - useSSL = (options.useSSL) ? options.useSSL : false; - apiKey = (options.apiKey) ? options.apiKey : null; - - if (apiKey) { - useSSL = true; - } - }; - - GeocoderJS.BingProvider.prototype = new GeocoderJS.ProviderBase(); - GeocoderJS.BingProvider.prototype.constructor = GeocoderJS.BingProvider; - - GeocoderJS.BingProvider.prototype.geocode = function(searchString, callback) { - this.externalLoader.setOptions({ - protocol: (useSSL === true) ? 'https' : 'http', - host: 'dev.virtualearth.net', - pathname: 'REST/v1/Locations/' + searchString - }); - - var options = { - key: apiKey, - JSONPCallback: 'jsonp', - }; - - this.executeRequest(options, callback); - }; - - GeocoderJS.BingProvider.prototype.geodecode = function(latitude, longitude, callback) { - this.externalLoader.setOptions({ - protocol: (useSSL === true) ? 'https' : 'http', - host: 'dev.virtualearth.net', - pathname: 'REST/v1/Locations/' + latitude + ',' + longitude - }); - - var options = { - key: apiKey, - JSONPCallback: 'jsonp', - }; - - this.executeRequest(options, callback); - }; - - GeocoderJS.BingProvider.prototype.executeRequest = function(params, callback) { - var _this = this; - - this.externalLoader.executeRequest(params, function(data) { - var results = []; - for (var i in data.resourceSets[0].resources) { - results.push(_this.mapToGeocoded(data.resourceSets[0].resources[i])); - } - callback(results); - }); - }; - - GeocoderJS.BingProvider.prototype.mapToGeocoded = function(result) { - var geocoded = new GeocoderJS.Geocoded() - - geocoded.latitude = result.point.coordinates[0]; - geocoded.longitude = result.point.coordinates[1]; - - geocoded.streetName = result.address.addressLine; - geocoded.city = result.address.locality; - geocoded.region = result.address.adminDistrict; - geocoded.postal_code = result.address.postalCode; - - return geocoded; - }; -})(GeocoderJS); diff --git a/src/providers/BingProvider.ts b/src/providers/BingProvider.ts new file mode 100644 index 0000000..404ce8c --- /dev/null +++ b/src/providers/BingProvider.ts @@ -0,0 +1,163 @@ +import { + ExternalLoaderInterface, + ExternalLoaderParams, +} from "ExternalURILoader"; +import { + GeocodedResultsCallback, + ProviderHelpers, + ProviderInterface, + ProviderOptionsInterface, + defaultProviderOptions, +} from "providers"; +import Geocoded from "Geocoded"; +import { + GeocodeQuery, + GeocodeQueryObject, + ReverseQuery, + ReverseQueryObject, +} from "query"; + +interface BingRequestParams { + [param: string]: string | undefined; + readonly key?: string; + readonly JSONPCallback?: string; +} + +export interface BingResult { + __type: string; + bbox: [number, number, number, number]; + name: string; + point: { + type: string; + coordinates: [number, number]; + }; + address: { + addressLine: string; + adminDistrict: string; + adminDistrict2: string; + countryRegion: string; + formattedAddress: string; + locality: string; + postalCode: string; + }; + confidence: string; + entityType: string; + geocodePoints: { + type: string; + coordinates: [number, number]; + calculationMethod: string; + usageTypes: string[]; + }[]; + matchCodes: string[]; +} + +export default class BingProvider implements ProviderInterface { + private externalLoader: ExternalLoaderInterface; + + private options: ProviderOptionsInterface; + + public constructor( + _externalLoader: ExternalLoaderInterface, + options: ProviderOptionsInterface = defaultProviderOptions + ) { + this.externalLoader = _externalLoader; + this.options = { ...defaultProviderOptions, ...options }; + if (!this.options.apiKey) { + throw new Error( + 'An API key is required for the Bing provider. Please add it in the "apiKey" option.' + ); + } + } + + public geocode( + query: string | GeocodeQuery | GeocodeQueryObject, + callback: GeocodedResultsCallback + ): void { + const geocodeQuery = ProviderHelpers.getGeocodeQueryFromParameter(query); + + this.externalLoader.setOptions({ + protocol: this.options.useSsl ? "https" : "http", + host: "dev.virtualearth.net", + pathname: `REST/v1/Locations/${geocodeQuery.getText()}`, + }); + + const params: BingRequestParams = { + key: this.options.apiKey, + JSONPCallback: this.options.useJsonp ? "jsonp" : undefined, + }; + + this.executeRequest(params, callback); + } + + public geodecode( + latitudeOrQuery: number | string | ReverseQuery | ReverseQueryObject, + longitudeOrCallback: number | string | GeocodedResultsCallback, + callback?: GeocodedResultsCallback + ): void { + const reverseQuery = ProviderHelpers.getReverseQueryFromParameters( + latitudeOrQuery, + longitudeOrCallback + ); + const reverseCallback = ProviderHelpers.getCallbackFromParameters( + longitudeOrCallback, + callback + ); + + this.externalLoader.setOptions({ + protocol: this.options.useSsl ? "https" : "http", + host: "dev.virtualearth.net", + pathname: `REST/v1/Locations/${reverseQuery.getCoordinates().latitude},${ + reverseQuery.getCoordinates().longitude + }`, + }); + + const params: BingRequestParams = { + key: this.options.apiKey, + JSONPCallback: this.options.useJsonp ? "jsonp" : undefined, + }; + + this.executeRequest(params, reverseCallback); + } + + public executeRequest( + params: ExternalLoaderParams, + callback: GeocodedResultsCallback + ): void { + this.externalLoader.executeRequest(params, (data) => { + callback( + data.resourceSets[0].resources.map((result: BingResult) => + BingProvider.mapToGeocoded(result) + ) + ); + }); + } + + public static mapToGeocoded(result: BingResult): Geocoded { + const latitude = result.point.coordinates[0]; + const longitude = result.point.coordinates[1]; + const { formattedAddress } = result.address; + const streetName = result.address.addressLine; + const { locality, postalCode } = result.address; + const region = result.address.adminDistrict; + const country = result.address.countryRegion; + + let geocoded = Geocoded.create({ + latitude, + longitude, + formattedAddress, + streetName, + locality, + postalCode, + region, + country, + }); + geocoded = geocoded.withBounds( + result.bbox[0], + result.bbox[1], + result.bbox[2], + result.bbox[3] + ); + + return geocoded; + } +} diff --git a/src/providers/GoogleAPIProvider.js b/src/providers/GoogleAPIProvider.js deleted file mode 100644 index fe0dec1..0000000 --- a/src/providers/GoogleAPIProvider.js +++ /dev/null @@ -1,111 +0,0 @@ -if (typeof GeocoderJS === "undefined" && typeof require === "function") { - var GeocoderJS = require("../GeocoderJS.js"); - require("../Geocoded.js"); - require("../providers/ProviderBase.js"); -} - -;(function (GeocoderJS) { - "use strict"; - - var useSSL; - var apiKey; - - GeocoderJS.GoogleAPIProvider = function(_externalLoader, options) { - if (_externalLoader === undefined) { - throw "No external loader defined."; - } - this.externalLoader = _externalLoader; - - options = (options) ? options : {}; - - useSSL = (options.useSSL) ? options.useSSL : false; - apiKey = (options.apiKey) ? options.apiKey : null; - - if (apiKey) { - useSSL = true; - } - }; - - GeocoderJS.GoogleAPIProvider.prototype = new GeocoderJS.ProviderBase(); - GeocoderJS.GoogleAPIProvider.prototype.constructor = GeocoderJS.GoogleAPIProvider; - - GeocoderJS.GoogleAPIProvider.prototype.geocode = function(searchString, callback) { - this.externalLoader.setOptions({ - protocol: (useSSL === true) ? 'https' : 'http', - host: 'maps.googleapis.com', - pathname: 'maps/api/geocode/json' - }); - - var options = { - sensor: false, - address: searchString - }; - - if (apiKey) { - options["key"] = apiKey; - } - - this.executeRequest(options, callback); - }; - - GeocoderJS.GoogleAPIProvider.prototype.geodecode = function(latitude, longitude, callback) { - this.externalLoader.setOptions({ - protocol: (useSSL) ? 'https' : 'http', - host: 'maps.googleapis.com', - pathname: 'maps/api/geocode/json' - }); - - var options = { - "sensor": false, - "latlng": latitude + "," + longitude - }; - - if (apiKey) { - options["key"] = apiKey; - } - - this.executeRequest(options, callback); - }; - - GeocoderJS.GoogleAPIProvider.prototype.executeRequest = function(params, callback) { - var _this = this; - - this.externalLoader.executeRequest(params, function(data) { - var results = []; - for (var i in data.results) { - results.push(_this.mapToGeocoded(data.results[i])); - } - callback(results); - }); - }; - - GeocoderJS.GoogleAPIProvider.prototype.mapToGeocoded = function(result) { - var geocoded = new GeocoderJS.Geocoded(); - geocoded.latitude = result.geometry.location.lat; - geocoded.longitude = result.geometry.location.lng; - - for (var i in result.address_components) { - for (var j in result.address_components[i].types) { - switch (result.address_components[i].types[j]) { - case "street_number": - geocoded.streetNumber = result.address_components[i].long_name; - break; - case "route": - geocoded.streetName = result.address_components[i].long_name; - break; - case "locality": - geocoded.city = result.address_components[i].long_name; - break; - case "administrative_area_level_1": - geocoded.region = result.address_components[i].long_name; - break; - case "postal_code": - geocoded.postal_code = result.address_components[i].long_name; - break; - } - } - } - - return geocoded; - }; -})(GeocoderJS); diff --git a/src/providers/GoogleAPIProvider.ts b/src/providers/GoogleAPIProvider.ts new file mode 100644 index 0000000..0154527 --- /dev/null +++ b/src/providers/GoogleAPIProvider.ts @@ -0,0 +1,221 @@ +import { + ExternalLoaderInterface, + ExternalLoaderParams, +} from "ExternalURILoader"; +import { + GeocodedResultsCallback, + ProviderHelpers, + ProviderInterface, + ProviderOptionsInterface, + defaultProviderOptions, +} from "providers"; +import Geocoded from "Geocoded"; +import { + GeocodeQuery, + GeocodeQueryObject, + ReverseQuery, + ReverseQueryObject, +} from "query"; + +interface GoogleApiRequestParams { + [param: string]: string | undefined; + readonly key: string; + readonly sensor: string; + readonly address?: string; + readonly latlng?: string; +} + +interface GoogleApiLatLng { + lat: number; + lng: number; +} + +export interface GoogleApiResult { + geometry: { + location: GoogleApiLatLng; + bounds: { + southwest: GoogleApiLatLng; + northeast: GoogleApiLatLng; + }; + }; + // eslint-disable-next-line camelcase + formatted_address: string; + // eslint-disable-next-line camelcase + address_components: { + types: ( + | "street_number" + | "route" + | "sublocality" + | "locality" + | "postal_code" + | "administrative_area_level_1" + | "country" + )[]; + // eslint-disable-next-line camelcase + long_name: string; + // eslint-disable-next-line camelcase + short_name: string; + }[]; +} + +export default class GoogleApiProvider implements ProviderInterface { + private externalLoader: ExternalLoaderInterface; + + private options: ProviderOptionsInterface; + + public constructor( + _externalLoader: ExternalLoaderInterface, + options: ProviderOptionsInterface = defaultProviderOptions + ) { + this.externalLoader = _externalLoader; + this.options = { ...defaultProviderOptions, ...options }; + if (!this.options.apiKey) { + throw new Error( + 'An API key is required for the Google API provider. Please add it in the "apiKey" option.' + ); + } + } + + public geocode( + query: string | GeocodeQuery | GeocodeQueryObject, + callback: GeocodedResultsCallback + ): void { + const geocodeQuery = ProviderHelpers.getGeocodeQueryFromParameter(query); + + this.externalLoader.setOptions({ + protocol: this.options.useSsl ? "https" : "http", + host: "maps.googleapis.com", + pathname: "maps/api/geocode/json", + }); + + const params: GoogleApiRequestParams = { + key: this.options.apiKey || "", + address: geocodeQuery.getText(), + sensor: "0", + }; + + this.executeRequest(params, callback); + } + + public geodecode( + latitudeOrQuery: number | string | ReverseQuery | ReverseQueryObject, + longitudeOrCallback: number | string | GeocodedResultsCallback, + callback?: GeocodedResultsCallback + ): void { + const reverseQuery = ProviderHelpers.getReverseQueryFromParameters( + latitudeOrQuery, + longitudeOrCallback + ); + const reverseCallback = ProviderHelpers.getCallbackFromParameters( + longitudeOrCallback, + callback + ); + + this.externalLoader.setOptions({ + protocol: this.options.useSsl ? "https" : "http", + host: "maps.googleapis.com", + pathname: "maps/api/geocode/json", + }); + + const params: GoogleApiRequestParams = { + key: this.options.apiKey || "", + latlng: `${reverseQuery.getCoordinates().latitude},${ + reverseQuery.getCoordinates().longitude + }`, + sensor: "0", + }; + + this.executeRequest(params, reverseCallback); + } + + public executeRequest( + params: ExternalLoaderParams, + callback: GeocodedResultsCallback + ): void { + this.externalLoader.executeRequest(params, (data) => { + if (data.status === "OVER_QUERY_LIMIT") { + console.error( + "Exceeded daily quota when attempting geocoding request." + ); + callback([]); + return; + } + + callback( + data.results.map((result: GoogleApiResult) => + GoogleApiProvider.mapToGeocoded(result) + ) + ); + }); + } + + public static mapToGeocoded(result: GoogleApiResult): Geocoded { + const latitude = result.geometry.location.lat; + const longitude = result.geometry.location.lng; + const formattedAddress = result.formatted_address; + let streetNumber; + let streetName; + let subLocality; + let locality; + let postalCode; + let region; + let country; + let countryCode; + + result.address_components.forEach((addressComponent) => { + addressComponent.types.forEach((type) => { + switch (type) { + case "street_number": + streetNumber = addressComponent.long_name; + break; + case "route": + streetName = addressComponent.long_name; + break; + case "sublocality": + subLocality = addressComponent.long_name; + break; + case "locality": + locality = addressComponent.long_name; + break; + case "postal_code": + postalCode = addressComponent.long_name; + break; + case "administrative_area_level_1": + region = addressComponent.long_name; + break; + case "country": + country = addressComponent.long_name; + countryCode = addressComponent.short_name; + break; + default: + } + }); + }); + + let geocoded = Geocoded.create({ + latitude, + longitude, + formattedAddress, + streetNumber, + streetName, + subLocality, + locality, + postalCode, + region, + country, + countryCode, + }); + + if (result.geometry.bounds) { + const { bounds } = result.geometry; + geocoded = geocoded.withBounds( + bounds.southwest.lat, + bounds.southwest.lng, + bounds.northeast.lat, + bounds.northeast.lng + ); + } + + return geocoded; + } +} diff --git a/src/providers/MapquestProvider.js b/src/providers/MapquestProvider.js deleted file mode 100644 index 5cdeccf..0000000 --- a/src/providers/MapquestProvider.js +++ /dev/null @@ -1,95 +0,0 @@ -if (typeof GeocoderJS === "undefined" && typeof require === "function") { - var GeocoderJS = require("../GeocoderJS.js"); -} - -;(function (GeocoderJS) { - "use strict"; - - GeocoderJS.MapquestProvider = function(_externalLoader, options) { - if (_externalLoader === undefined) { - throw "No external loader defined."; - } - this.externalLoader = _externalLoader; - - if (typeof options !== 'object') { - options = {}; - } - - var defaults = { - apiKey: '' - }; - - for (var i in defaults) { - if (options[i] === undefined) { - options[i] = defaults[i]; - } - } - - this.apiKey = options.apiKey; - }; - - GeocoderJS.MapquestProvider.prototype = new GeocoderJS.ProviderBase(); - GeocoderJS.MapquestProvider.prototype.constructor = GeocoderJS.MapquestProvider; - - GeocoderJS.MapquestProvider.prototype.geocode = function(searchString, callback) { - this.externalLoader.setOptions({ - protocol: 'http', - host: 'www.mapquestapi.com', - pathname: 'geocoding/v1/address' - }); - - var params = { - key: this.apiKey, - outputFormat: 'json', - location: encodeURIComponent(searchString), - JSONPCallback: 'callback' - }; - - this.executeRequest(params, callback); - }; - - GeocoderJS.MapquestProvider.prototype.geodecode = function(latitude, longitude, callback) { - this.externalLoader.setOptions({ - protocol: 'http', - host: 'www.mapquestapi.com', - pathname: 'geocoding/v1/reverse' - }); - - var options = { - key: this.apiKey, - outputFormat: 'json', - JSONPCallback: 'callback', - "location": latitude + "," + longitude - }; - - this.executeRequest(options, callback); - }; - - GeocoderJS.MapquestProvider.prototype.mapToGeocoded = function(result) { - var geocoded = new GeocoderJS.Geocoded(); - geocoded.latitude = result.latLng.lat; - geocoded.longitude = result.latLng.lng; - - geocoded.city = result.adminArea5; - geocoded.region = result.adminArea4; - geocoded.streetName = result.street; - geocoded.postal_code = result.postalCode; - - return geocoded; - }; - - GeocoderJS.MapquestProvider.prototype.executeRequest = function(params, callback) { - var _this = this; - - this.externalLoader.executeRequest(params, function(data) { - var results = []; - if (data.results[0].locations.length) { - for (var i in data.results[0].locations) { - results.push(_this.mapToGeocoded(data.results[0].locations[i])); - } - } - - callback(results); - }); - }; -})(GeocoderJS); diff --git a/src/providers/MapquestProvider.ts b/src/providers/MapquestProvider.ts new file mode 100644 index 0000000..fd9037c --- /dev/null +++ b/src/providers/MapquestProvider.ts @@ -0,0 +1,162 @@ +import { + ExternalLoaderInterface, + ExternalLoaderParams, +} from "ExternalURILoader"; +import { + GeocodedResultsCallback, + ProviderHelpers, + ProviderInterface, + ProviderOptionsInterface, + defaultProviderOptions, +} from "providers"; +import Geocoded from "Geocoded"; +import { + GeocodeQuery, + GeocodeQueryObject, + ReverseQuery, + ReverseQueryObject, +} from "query"; + +interface MapQuestRequestParams { + [param: string]: string | undefined; + readonly key?: string; + readonly location: string; + readonly JSONPCallback?: string; +} + +export interface MapQuestResult { + latLng: { + lat: number; + lng: number; + }; + displayLatLng: { + lat: number; + lng: number; + }; + street: string; + sideOfStreet: string; + adminArea1?: string; + adminArea1Type?: string; + adminArea3?: string; + adminArea3Type?: string; + adminArea4?: string; + adminArea4Type?: string; + adminArea5?: string; + adminArea5Type?: string; + adminArea6?: string; + adminArea6Type?: string; + postalCode: string; + type: string; + linkId: string; + dragPoint: boolean; + geocodeQuality: string; + geocodeQualityCode: string; +} + +export default class MapQuestProvider implements ProviderInterface { + private externalLoader: ExternalLoaderInterface; + + private options: ProviderOptionsInterface; + + public constructor( + _externalLoader: ExternalLoaderInterface, + options: ProviderOptionsInterface = defaultProviderOptions + ) { + this.externalLoader = _externalLoader; + this.options = { ...defaultProviderOptions, ...options }; + if (!this.options.apiKey) { + throw new Error( + 'An API key is required for the MapQuest provider. Please add it in the "apiKey" option.' + ); + } + } + + public geocode( + query: string | GeocodeQuery | GeocodeQueryObject, + callback: GeocodedResultsCallback + ): void { + const geocodeQuery = ProviderHelpers.getGeocodeQueryFromParameter(query); + + this.externalLoader.setOptions({ + protocol: this.options.useSsl ? "https" : "http", + host: "www.mapquestapi.com", + pathname: "geocoding/v1/address", + }); + + const params: MapQuestRequestParams = { + key: this.options.apiKey, + location: encodeURIComponent(geocodeQuery.getText()), + JSONPCallback: this.options.useJsonp ? "callback" : undefined, + }; + + this.executeRequest(params, callback); + } + + public geodecode( + latitudeOrQuery: number | string | ReverseQuery | ReverseQueryObject, + longitudeOrCallback: number | string | GeocodedResultsCallback, + callback?: GeocodedResultsCallback + ): void { + const reverseQuery = ProviderHelpers.getReverseQueryFromParameters( + latitudeOrQuery, + longitudeOrCallback + ); + const reverseCallback = ProviderHelpers.getCallbackFromParameters( + longitudeOrCallback, + callback + ); + + this.externalLoader.setOptions({ + protocol: this.options.useSsl ? "https" : "http", + host: "www.mapquestapi.com", + pathname: "geocoding/v1/reverse", + }); + + const params: MapQuestRequestParams = { + key: this.options.apiKey, + location: `${reverseQuery.getCoordinates().latitude},${ + reverseQuery.getCoordinates().longitude + }`, + JSONPCallback: this.options.useJsonp ? "callback" : undefined, + }; + + this.executeRequest(params, reverseCallback); + } + + public executeRequest( + params: ExternalLoaderParams, + callback: GeocodedResultsCallback + ): void { + this.externalLoader.executeRequest(params, (data) => { + callback( + data.results[0].locations.map((result: MapQuestResult) => + MapQuestProvider.mapToGeocoded(result) + ) + ); + }); + } + + public static mapToGeocoded(result: MapQuestResult): Geocoded { + const latitude = result.latLng.lat; + const longitude = result.latLng.lng; + const streetName = result.street; + const subLocality = result.adminArea6; + const locality = result.adminArea5; + const { postalCode } = result; + const region = result.adminArea4; + const country = result.adminArea1; + const countryCode = result.adminArea1; + + return Geocoded.create({ + latitude, + longitude, + streetName, + subLocality, + locality, + postalCode, + region, + country, + countryCode, + }); + } +} diff --git a/src/providers/OpenStreetMapProvider.js b/src/providers/OpenStreetMapProvider.js deleted file mode 100644 index dd5d566..0000000 --- a/src/providers/OpenStreetMapProvider.js +++ /dev/null @@ -1,89 +0,0 @@ -if (typeof GeocoderJS === "undefined" && typeof require === "function") { - var GeocoderJS = require("../GeocoderJS.js"); - require("../Geocoded.js"); - require("../ExternalURILoader.js"); - require("../providers/ProviderBase.js"); -} - -;(function (GeocoderJS) { - "use strict"; - - GeocoderJS.OpenStreetMapProvider = function(_externalLoader) { - if (_externalLoader === undefined) { - throw "No external loader defined."; - } - this.externalLoader = _externalLoader; - }; - - GeocoderJS.OpenStreetMapProvider.prototype = new GeocoderJS.ProviderBase(); - GeocoderJS.OpenStreetMapProvider.prototype.constructor = GeocoderJS.OpenStreetMapProvider; - - GeocoderJS.OpenStreetMapProvider.prototype.geocode = function(searchString, callback) { - this.externalLoader.setOptions({ - protocol: 'http', - host: 'nominatim.openstreetmap.org', - pathname: 'search' - }); - - var params = { - format: 'json', - q: searchString, - addressdetails: 1 - }; - - this.executeRequest(params, callback); - }; - - GeocoderJS.OpenStreetMapProvider.prototype.geodecode = function(latitude, longitude, callback) { - this.externalLoader.setOptions({ - protocol: 'http', - host: 'nominatim.openstreetmap.org', - pathname: 'reverse' - }); - - var params = { - format: 'json', - lat: latitude, - lon: longitude, - addressdetails: 1, - zoom: 18 - }; - - var _this = this; - - this.executeRequest(params, callback); - }; - - GeocoderJS.OpenStreetMapProvider.prototype.executeRequest = function(params, callback) { - var _this = this; - - this.externalLoader.executeRequest(params, function(data) { - var results = []; - if (data.length) { - for (var i in data) { - results.push(_this.mapToGeocoded(data[i])); - } - } else { - results.push(_this.mapToGeocoded(data)); - } - - callback(results); - }); - }; - - GeocoderJS.OpenStreetMapProvider.prototype.mapToGeocoded = function(result) { - var geocoded = new GeocoderJS.Geocoded(); - - geocoded.latitude = result.lat * 1; - geocoded.longitude = result.lon * 1; - - geocoded.streetNumber = (result.address.house_number !== undefined) ? result.address.house_number : undefined; - geocoded.streetName = result.address.road; - geocoded.city = result.address.city; - geocoded.region = result.address.state; - geocoded.postal_code = result.address.postcode; - - return geocoded; - }; - -})(GeocoderJS); diff --git a/src/providers/OpenStreetMapProvider.ts b/src/providers/OpenStreetMapProvider.ts new file mode 100644 index 0000000..469641d --- /dev/null +++ b/src/providers/OpenStreetMapProvider.ts @@ -0,0 +1,197 @@ +import { + ExternalLoaderInterface, + ExternalLoaderParams, +} from "ExternalURILoader"; +import { + GeocodedResultsCallback, + ProviderHelpers, + ProviderInterface, + ProviderOptionsInterface, + defaultProviderOptions, +} from "providers"; +import Geocoded from "Geocoded"; +import { + GeocodeQuery, + GeocodeQueryObject, + ReverseQuery, + ReverseQueryObject, +} from "query"; + +interface OpenStreetMapRequestParams { + [param: string]: string | undefined; + readonly q?: string; + readonly lat?: string; + readonly lon?: string; + readonly format: string; + readonly addressdetails: string; + readonly zoom?: string; + readonly JSONPCallback?: string; +} + +export interface OpenStreetMapResult { + // eslint-disable-next-line camelcase + place_id: number; + licence: string; + // eslint-disable-next-line camelcase + osm_type: string; + // eslint-disable-next-line camelcase + osm_id: number; + boundingbox: [string, string, string, string]; + lat: string; + lon: string; + // eslint-disable-next-line camelcase + display_name: string; + class: string; + type: string; + importance: number; + icon: string; + address: { + attraction?: string; + // eslint-disable-next-line camelcase + house_number?: string; + road?: string; + neighbourhood?: string; + suburb?: string; + city?: string; + town?: string; + village?: string; + hamlet?: string; + state?: string; + postcode?: string; + country?: string; + // eslint-disable-next-line camelcase + country_code?: string; + }; +} + +export default class OpenStreetMapProvider implements ProviderInterface { + private externalLoader: ExternalLoaderInterface; + + private options: ProviderOptionsInterface; + + public constructor( + _externalLoader: ExternalLoaderInterface, + options: ProviderOptionsInterface = defaultProviderOptions + ) { + this.externalLoader = _externalLoader; + this.options = { ...defaultProviderOptions, ...options }; + } + + public geocode( + query: string | GeocodeQuery | GeocodeQueryObject, + callback: GeocodedResultsCallback + ): void { + const geocodeQuery = ProviderHelpers.getGeocodeQueryFromParameter(query); + + this.externalLoader.setOptions({ + protocol: this.options.useSsl ? "https" : "http", + host: "nominatim.openstreetmap.org", + pathname: "search", + }); + + const params: OpenStreetMapRequestParams = { + q: geocodeQuery.getText(), + format: "json", + addressdetails: "1", + JSONPCallback: this.options.useJsonp ? "json_callback" : undefined, + }; + + this.executeRequest(params, callback); + } + + public geodecode( + latitudeOrQuery: number | string | ReverseQuery | ReverseQueryObject, + longitudeOrCallback: number | string | GeocodedResultsCallback, + callback?: GeocodedResultsCallback + ): void { + const reverseQuery = ProviderHelpers.getReverseQueryFromParameters( + latitudeOrQuery, + longitudeOrCallback + ); + const reverseCallback = ProviderHelpers.getCallbackFromParameters( + longitudeOrCallback, + callback + ); + + this.externalLoader.setOptions({ + protocol: this.options.useSsl ? "https" : "http", + host: "nominatim.openstreetmap.org", + pathname: "reverse", + }); + + const params: OpenStreetMapRequestParams = { + lat: reverseQuery.getCoordinates().latitude.toString(), + lon: reverseQuery.getCoordinates().longitude.toString(), + format: "json", + addressdetails: "1", + zoom: "18", + JSONPCallback: this.options.useJsonp ? "json_callback" : undefined, + }; + + this.executeRequest(params, reverseCallback); + } + + public executeRequest( + params: ExternalLoaderParams, + callback: GeocodedResultsCallback + ): void { + this.externalLoader.executeRequest(params, (data) => { + callback( + data.length + ? data.map((result: OpenStreetMapResult) => + OpenStreetMapProvider.mapToGeocoded(result) + ) + : [OpenStreetMapProvider.mapToGeocoded(data)] + ); + }); + } + + public static mapToGeocoded(result: OpenStreetMapResult): Geocoded { + const latitude = parseFloat(result.lat); + const longitude = parseFloat(result.lon); + const streetNumber = result.address.house_number; + const streetName = result.address.road; + const subLocality = result.address.suburb; + let locality: string | undefined; + const postalCode = result.address.postcode + ? result.address.postcode.split(";")[0] + : undefined; + const region = result.address.state; + const { country } = result.address; + const countryCode = result.address.country_code; + + const localityTypes: ("city" | "town" | "village" | "hamlet")[] = [ + "city", + "town", + "village", + "hamlet", + ]; + localityTypes.forEach((localityType) => { + if (result.address[localityType] && !locality) { + locality = result.address[localityType]; + } + }); + + let geocoded = Geocoded.create({ + latitude, + longitude, + streetNumber, + streetName, + subLocality, + locality, + postalCode, + region, + country, + countryCode, + }); + + geocoded = geocoded.withBounds( + parseFloat(result.boundingbox[0]), + parseFloat(result.boundingbox[2]), + parseFloat(result.boundingbox[1]), + parseFloat(result.boundingbox[3]) + ); + + return geocoded; + } +} diff --git a/src/providers/ProviderBase.js b/src/providers/ProviderBase.js deleted file mode 100644 index 06f1823..0000000 --- a/src/providers/ProviderBase.js +++ /dev/null @@ -1,17 +0,0 @@ -if (typeof GeocoderJS === "undefined" && typeof require === "function") { - var GeocoderJS = require("../GeocoderJS.js"); -} - -;(function (GeocoderJS) { - "use strict"; - - GeocoderJS.ProviderBase = function() {}; - - GeocoderJS.ProviderBase.prototype = { - geocode: function(searchString, callback) {}, - geodecode: function(latitude, longitude, callback) {}, - mapToGeocoded: function(result) {}, - executeRequest: function(params, callback) {} - }; - -})(GeocoderJS); diff --git a/src/providers/ProviderHelpers.ts b/src/providers/ProviderHelpers.ts new file mode 100644 index 0000000..b16d336 --- /dev/null +++ b/src/providers/ProviderHelpers.ts @@ -0,0 +1,75 @@ +import { GeocodedResultsCallback } from "providers"; +import { + GeocodeQuery, + GeocodeQueryObject, + ReverseQuery, + ReverseQueryObject, +} from "query"; + +export default class ProviderHelpers { + public static getGeocodeQueryFromParameter( + query: string | GeocodeQuery | GeocodeQueryObject, + geocodeQuery = GeocodeQuery + ): GeocodeQuery { + if (typeof query === "string") { + return geocodeQuery.create({ text: query }); + } + if (!(query instanceof geocodeQuery)) { + return geocodeQuery.create(query); + } + + return query; + } + + public static getReverseQueryFromParameters( + latitudeOrQuery: number | string | ReverseQuery | ReverseQueryObject, + longitudeOrCallback: number | string | GeocodedResultsCallback, + reverseQuery = ReverseQuery + ): ReverseQuery { + if ( + typeof latitudeOrQuery === "number" || + typeof latitudeOrQuery === "string" + ) { + if ( + !( + typeof longitudeOrCallback === "number" || + typeof longitudeOrCallback === "string" + ) + ) { + throw new Error( + "The second parameter of geodecode must be a longitude if the first one is a latitude" + ); + } + return reverseQuery.create({ + latitude: latitudeOrQuery, + longitude: longitudeOrCallback, + }); + } + if (!(latitudeOrQuery instanceof reverseQuery)) { + return reverseQuery.create(latitudeOrQuery); + } + + return latitudeOrQuery; + } + + public static getCallbackFromParameters( + longitudeOrCallback: number | string | GeocodedResultsCallback, + callback?: GeocodedResultsCallback + ): GeocodedResultsCallback { + if ( + !( + typeof longitudeOrCallback === "number" || + typeof longitudeOrCallback === "string" + ) + ) { + return longitudeOrCallback; + } + if (callback) { + return callback; + } + + throw new Error( + "A callback must be set at the last parameter of geodecode" + ); + } +} diff --git a/src/providers/ProviderInterface.ts b/src/providers/ProviderInterface.ts new file mode 100644 index 0000000..480b303 --- /dev/null +++ b/src/providers/ProviderInterface.ts @@ -0,0 +1,39 @@ +import { ExternalLoaderParams } from "ExternalURILoader"; +import Geocoded from "Geocoded"; +import { + GeocodeQuery, + GeocodeQueryObject, + ReverseQuery, + ReverseQueryObject, +} from "query"; + +export const DEFAULT_RESULT_LIMIT = 5; + +export const defaultProviderOptions: ProviderOptionsInterface = { + useSsl: false, + useJsonp: false, +}; + +export interface ProviderOptionsInterface { + readonly useSsl: boolean; + readonly useJsonp: boolean; + readonly apiKey?: string; +} + +export type GeocodedResultsCallback = (results: Geocoded[]) => void; + +export default interface ProviderInterface { + geocode( + query: string | GeocodeQuery | GeocodeQueryObject, + callback: GeocodedResultsCallback + ): void; + geodecode( + latitudeOrQuery: number | string | ReverseQuery | ReverseQueryObject, + longitudeOrCallback: number | string | GeocodedResultsCallback, + callback?: GeocodedResultsCallback + ): void; + executeRequest( + params: ExternalLoaderParams, + callback: GeocodedResultsCallback + ): void; +} diff --git a/src/providers/YandexProvider.js b/src/providers/YandexProvider.js deleted file mode 100644 index 6c68607..0000000 --- a/src/providers/YandexProvider.js +++ /dev/null @@ -1,102 +0,0 @@ -if (typeof GeocoderJS === "undefined" && typeof require === "function") { - var GeocoderJS = require("../GeocoderJS.js"); - require("../Geocoded.js"); - require("../providers/ProviderBase.js"); -} - -;(function (GeocoderJS) { - "use strict"; - - var useSSL; - - GeocoderJS.YandexProvider = function(_externalLoader, options) { - if (_externalLoader === undefined) { - throw "No external loader defined."; - } - this.externalLoader = _externalLoader; - - options = (options) ? options : {}; - - useSSL = (options.useSSL) ? options.useSSL : false; - this.lang = (options.lang) ? options.lang : 'en-US'; - }; - - GeocoderJS.YandexProvider.prototype = new GeocoderJS.ProviderBase(); - GeocoderJS.YandexProvider.prototype.constructor = GeocoderJS.YandexProvider; - - GeocoderJS.YandexProvider.prototype.geocode = function(searchString, callback) { - this.externalLoader.setOptions({ - protocol: (useSSL === true) ? 'https' : 'http', - host: 'geocode-maps.yandex.ru', - pathname: '1.x' - }); - - var options = { - format: 'json', - geocode: searchString, - JSONPCallback: 'callback', - lang: this.lang - }; - - this.executeRequest(options, callback); - }; - - GeocoderJS.YandexProvider.prototype.geodecode = function(latitude, longitude, callback) { - this.externalLoader.setOptions({ - protocol: (useSSL === true) ? 'https' : 'http', - host: 'geocode-maps.yandex.ru', - pathname: '1.x' - }); - - var options = { - format: 'json', - geocode: longitude + ',' + latitude, - JSONPCallback: 'callback', - lang: this.lang - }; - - this.executeRequest(options, callback); - }; - - GeocoderJS.YandexProvider.prototype.executeRequest = function(params, callback) { - var _this = this; - - this.externalLoader.executeRequest(params, function(data) { - var results = []; - - for (var i in data.response.GeoObjectCollection.featureMember) { - results.push(_this.mapToGeocoded(data.response.GeoObjectCollection.featureMember[i].GeoObject)); - } - callback(results); - }); - }; - - GeocoderJS.YandexProvider.prototype.mapToGeocoded = function(result) { - var geocoded = new GeocoderJS.Geocoded(); - - var point = result.Point.pos.split(' '); - geocoded.latitude = point[1] * 1; - geocoded.longitude = point[0] * 1; - - if (result.metaDataProperty.GeocoderMetaData.AddressDetails.Country) { - var tmp = result.metaDataProperty.GeocoderMetaData.AddressDetails.Country; - if (tmp.AdministrativeArea) { - tmp = tmp.AdministrativeArea; - geocoded.region = tmp.AdministrativeAreaName; - if (tmp.SubAdministrativeArea) { - tmp = tmp.SubAdministrativeArea; - if (tmp.Locality) { - tmp = tmp.Locality; - geocoded.city = tmp.LocalityName; - if (tmp.Thoroughfare) { - tmp = tmp.Thoroughfare; - geocoded.streetName = tmp.ThoroughfareName; - } - } - } - } - } - - return geocoded; - }; -})(GeocoderJS); diff --git a/src/providers/YandexProvider.ts b/src/providers/YandexProvider.ts new file mode 100644 index 0000000..22c410e --- /dev/null +++ b/src/providers/YandexProvider.ts @@ -0,0 +1,250 @@ +import { + ExternalLoaderInterface, + ExternalLoaderParams, +} from "ExternalURILoader"; +import { + GeocodedResultsCallback, + ProviderHelpers, + ProviderInterface, + ProviderOptionsInterface, + defaultProviderOptions, +} from "providers"; +import Geocoded from "Geocoded"; +import { + GeocodeQuery, + GeocodeQueryObject, + ReverseQuery, + ReverseQueryObject, +} from "query"; + +interface YandexRequestParams { + [param: string]: string | undefined; + readonly apikey?: string; + readonly geocode: string; + readonly format: string; + readonly lang: string; + readonly JSONPCallback?: string; +} + +interface YandexCollectionResult { + GeoObject: YandexResult; +} + +export interface YandexResult { + metaDataProperty: { + GeocoderMetaData: { + kind: string; + text: string; + precision: string; + AddressDetails: { + Country: { + AddressLine: string; + CountryNameCode: string; + CountryName: string; + AdministrativeArea?: { + AdministrativeAreaName: string; + SubAdministrativeArea?: { + SubAdministrativeAreaName: string; + Locality?: { + LocalityName: string; + Thoroughfare?: { + ThoroughfareName: string; + Premise: { + PremiseNumber: string; + }; + }; + }; + }; + }; + }; + }; + }; + }; + description: string; + name: string; + boundedBy: { + Envelope: { + lowerCorner: string; + upperCorner: string; + }; + }; + Point: { + pos: string; + }; +} + +interface YandexFlattenedAddressDetails { + CountryNameCode?: string; + CountryName?: string; + AdministrativeAreaName?: string; + LocalityName?: string; + DependentLocalityName?: string; + ThoroughfareName?: string; + PremiseNumber?: string; +} + +interface YandexProviderOptionsInterface extends ProviderOptionsInterface { + readonly lang: string; +} + +export const defaultYandexProviderOptions = { + ...defaultProviderOptions, + lang: "en-US", +}; + +export default class YandexProvider implements ProviderInterface { + private externalLoader: ExternalLoaderInterface; + + private options: YandexProviderOptionsInterface; + + public constructor( + _externalLoader: ExternalLoaderInterface, + options: YandexProviderOptionsInterface = defaultYandexProviderOptions + ) { + this.externalLoader = _externalLoader; + this.options = { ...defaultYandexProviderOptions, ...options }; + } + + public geocode( + query: string | GeocodeQuery | GeocodeQueryObject, + callback: GeocodedResultsCallback + ): void { + const geocodeQuery = ProviderHelpers.getGeocodeQueryFromParameter(query); + + this.externalLoader.setOptions({ + protocol: this.options.useSsl ? "https" : "http", + host: "geocode-maps.yandex.ru", + pathname: "1.x", + }); + + const params: YandexRequestParams = { + apikey: this.options.apiKey, + geocode: geocodeQuery.getText(), + format: "json", + lang: this.options.lang, + JSONPCallback: this.options.useJsonp ? "callback" : undefined, + }; + + this.executeRequest(params, callback); + } + + public geodecode( + latitudeOrQuery: number | string | ReverseQuery | ReverseQueryObject, + longitudeOrCallback: number | string | GeocodedResultsCallback, + callback?: GeocodedResultsCallback + ): void { + const reverseQuery = ProviderHelpers.getReverseQueryFromParameters( + latitudeOrQuery, + longitudeOrCallback + ); + const reverseCallback = ProviderHelpers.getCallbackFromParameters( + longitudeOrCallback, + callback + ); + + this.externalLoader.setOptions({ + protocol: this.options.useSsl ? "https" : "http", + host: "geocode-maps.yandex.ru", + pathname: "1.x", + }); + + const params: YandexRequestParams = { + apikey: this.options.apiKey, + geocode: `${reverseQuery.getCoordinates().longitude},${ + reverseQuery.getCoordinates().latitude + }`, + format: "json", + lang: this.options.lang, + JSONPCallback: this.options.useJsonp ? "callback" : undefined, + }; + + this.executeRequest(params, reverseCallback); + } + + public executeRequest( + params: ExternalLoaderParams, + callback: GeocodedResultsCallback + ): void { + this.externalLoader.executeRequest(params, (data) => { + callback( + data.response.GeoObjectCollection.featureMember.map( + (result: YandexCollectionResult) => + YandexProvider.mapToGeocoded(result.GeoObject) + ) + ); + }); + } + + public static mapToGeocoded(result: YandexResult): Geocoded { + const point = result.Point.pos.split(" "); + const latitude = parseFloat(point[1]); + const longitude = parseFloat(point[0]); + + const addressDetails: YandexFlattenedAddressDetails = YandexProvider.flattenObject( + result.metaDataProperty.GeocoderMetaData.AddressDetails + ); + + const streetNumber = addressDetails.PremiseNumber; + const streetName = addressDetails.ThoroughfareName; + const subLocality = addressDetails.DependentLocalityName; + const locality = addressDetails.LocalityName; + const region = addressDetails.AdministrativeAreaName; + const country = addressDetails.CountryName; + const countryCode = addressDetails.CountryNameCode; + + let geocoded = Geocoded.create({ + latitude, + longitude, + streetNumber, + streetName, + subLocality, + locality, + region, + country, + countryCode, + }); + + const lowerCorner = result.boundedBy.Envelope.lowerCorner.split(" "); + const upperCorner = result.boundedBy.Envelope.upperCorner.split(" "); + geocoded = geocoded.withBounds( + parseFloat(lowerCorner[1]), + parseFloat(lowerCorner[0]), + parseFloat(upperCorner[1]), + parseFloat(upperCorner[0]) + ); + + return geocoded; + } + + private static flattenObject< + O extends { [key: string]: O[keyof O] | S }, + S extends string | string[] + >(object: O) { + const flattened: { [key: string]: S } = {}; + + const step = (nestedObject: O | O[keyof O]): void => { + Object.keys(nestedObject).forEach((key) => { + const value = (nestedObject)[key]; + const isArray = Array.isArray(value); + const type = Object.prototype.toString.call(value); + const isObject = + type === "[object Object]" || type === "[object Array]"; + + if ( + !isArray && + isObject && + Object.keys(>value).length + ) { + step(value); + return; + } + + flattened[key] = value; + }); + }; + + step(object); + + return flattened; + } +} diff --git a/src/providers/index.ts b/src/providers/index.ts new file mode 100644 index 0000000..72f17b7 --- /dev/null +++ b/src/providers/index.ts @@ -0,0 +1,14 @@ +export { default as ProviderHelpers } from "providers/ProviderHelpers"; +export { default as ProviderInterface } from "providers/ProviderInterface"; +export * from "providers/ProviderInterface"; +export { default as BingProvider } from "providers/BingProvider"; +export * from "providers/BingProvider"; +export { default as GoogleAPIProvider } from "providers/GoogleAPIProvider"; +export * from "providers/GoogleAPIProvider"; +export * from "providers/mapbox"; +export { default as MapquestProvider } from "providers/MapquestProvider"; +export * from "providers/MapquestProvider"; +export { default as OpenStreetMapProvider } from "providers/OpenStreetMapProvider"; +export * from "providers/OpenStreetMapProvider"; +export { default as YandexProvider } from "providers/YandexProvider"; +export * from "providers/YandexProvider"; diff --git a/src/providers/mapbox/MapboxGeocodeQuery.ts b/src/providers/mapbox/MapboxGeocodeQuery.ts new file mode 100644 index 0000000..cd1da39 --- /dev/null +++ b/src/providers/mapbox/MapboxGeocodeQuery.ts @@ -0,0 +1,36 @@ +import { GeocodeQuery, GeocodeQueryObject } from "query"; + +export interface MapboxGeocodeQueryObject extends GeocodeQueryObject { + readonly locationTypes?: string[]; +} + +export default class MapboxGeocodeQuery extends GeocodeQuery { + private readonly locationTypes?: string[]; + + protected constructor({ + locationTypes, + ...geocodeQueryObject + }: MapboxGeocodeQueryObject) { + super(geocodeQueryObject); + this.locationTypes = locationTypes; + } + + public static create(object: MapboxGeocodeQueryObject): MapboxGeocodeQuery { + return new MapboxGeocodeQuery(object); + } + + public toObject(): MapboxGeocodeQueryObject { + return { + ...super.toObject(), + locationTypes: this.locationTypes, + }; + } + + public withLocationTypes(locationTypes: string[]): MapboxGeocodeQuery { + return new MapboxGeocodeQuery({ ...this.toObject(), locationTypes }); + } + + public getLocationTypes(): undefined | string[] { + return this.locationTypes; + } +} diff --git a/src/providers/mapbox/MapboxProvider.ts b/src/providers/mapbox/MapboxProvider.ts new file mode 100644 index 0000000..8c4f83b --- /dev/null +++ b/src/providers/mapbox/MapboxProvider.ts @@ -0,0 +1,268 @@ +import { + ExternalLoaderInterface, + ExternalLoaderParams, +} from "ExternalURILoader"; +import { + GeocodedResultsCallback, + MapboxGeocodeQuery, + MapboxGeocodeQueryObject, + MapboxReverseQuery, + MapboxReverseQueryObject, + ProviderHelpers, + ProviderInterface, + ProviderOptionsInterface, + defaultProviderOptions, +} from "providers"; +import Geocoded from "Geocoded"; + +interface MapboxRequestParams { + [param: string]: string | undefined; + // eslint-disable-next-line camelcase + readonly access_token: string; + readonly country?: string; + readonly language?: string; + readonly limit?: string; + readonly bbox?: string; + readonly types?: string; +} + +interface MapboxFeatureContextProperties { + id: string; + text: string; + wikidata?: string; + // eslint-disable-next-line camelcase + short_code?: string; +} + +interface MapboxFeatureProperties { + accuracy?: string; + address?: string; + category?: string; + maki?: string; + wikidata?: string; + // eslint-disable-next-line camelcase + short_code?: string; +} + +export interface MapboxResult { + id: string; + type: "Feature"; + // eslint-disable-next-line camelcase + place_type: ( + | "country" + | "region" + | "postcode" + | "district" + | "place" + | "locality" + | "neighborhood" + | "address" + | "poi" + )[]; + relevance: number; + address?: string; + properties: MapboxFeatureProperties; + text: string; + // eslint-disable-next-line camelcase + place_name: string; + // eslint-disable-next-line camelcase + matching_text?: string; + // eslint-disable-next-line camelcase + matching_place_name?: string; + language?: string; + bbox?: [number, number, number, number]; + center: [number, number]; + geometry: { + type: "Point"; + coordinates: [number, number]; + }; + context?: MapboxFeatureContextProperties[]; + // eslint-disable-next-line camelcase + routable_points?: { + points?: { + coordinates: [number, number]; + }[]; + }; +} + +export enum GEOCODING_MODES { + GEOCODING_MODE_PLACES = "mapbox.places", + GEOCODING_MODE_PLACES_PERMANENT = "mapbox.places-permanent", +} + +interface MapboxProviderOptionsInterface extends ProviderOptionsInterface { + readonly geocodingMode: GEOCODING_MODES; + readonly country?: string; + readonly language?: string; +} + +export const defaultMapboxProviderOptions = { + ...defaultProviderOptions, + geocodingMode: GEOCODING_MODES.GEOCODING_MODE_PLACES, +}; + +export default class MapboxProvider implements ProviderInterface { + private externalLoader: ExternalLoaderInterface; + + private options: MapboxProviderOptionsInterface; + + public constructor( + _externalLoader: ExternalLoaderInterface, + options: MapboxProviderOptionsInterface = defaultMapboxProviderOptions + ) { + this.externalLoader = _externalLoader; + this.options = { ...defaultMapboxProviderOptions, ...options }; + if (!this.options.apiKey) { + throw new Error( + 'An API key is required for the Mapbox provider. Please add it in the "apiKey" option.' + ); + } + } + + public geocode( + query: string | MapboxGeocodeQuery | MapboxGeocodeQueryObject, + callback: GeocodedResultsCallback + ): void { + const geocodeQuery = ProviderHelpers.getGeocodeQueryFromParameter( + query, + MapboxGeocodeQuery + ); + + this.externalLoader.setOptions({ + protocol: this.options.useSsl ? "https" : "http", + host: "api.mapbox.com", + pathname: `geocoding/v5/${ + this.options.geocodingMode + }/${geocodeQuery.getText()}.json`, + }); + + const params: MapboxRequestParams = { + access_token: this.options.apiKey || "", + country: this.options.country, + language: this.options.language, + limit: geocodeQuery.getLimit().toString(), + bbox: geocodeQuery.getBounds() + ? `${geocodeQuery.getBounds()?.west},${ + geocodeQuery.getBounds()?.south + },${geocodeQuery.getBounds()?.east},${ + geocodeQuery.getBounds()?.north + }` + : undefined, + types: (geocodeQuery).getLocationTypes() + ? (geocodeQuery).getLocationTypes()?.join(",") + : undefined, + }; + + this.executeRequest(params, callback); + } + + public geodecode( + latitudeOrQuery: + | number + | string + | MapboxReverseQuery + | MapboxReverseQueryObject, + longitudeOrCallback: number | string | GeocodedResultsCallback, + callback?: GeocodedResultsCallback + ): void { + const reverseQuery = ProviderHelpers.getReverseQueryFromParameters( + latitudeOrQuery, + longitudeOrCallback, + MapboxReverseQuery + ); + const reverseCallback = ProviderHelpers.getCallbackFromParameters( + longitudeOrCallback, + callback + ); + + this.externalLoader.setOptions({ + protocol: this.options.useSsl ? "https" : "http", + host: "api.mapbox.com", + pathname: `geocoding/v5/${this.options.geocodingMode}/${ + reverseQuery.getCoordinates().longitude + },${reverseQuery.getCoordinates().latitude}.json`, + }); + + const params: MapboxRequestParams = { + access_token: this.options.apiKey || "", + country: this.options.country, + language: this.options.language, + limit: reverseQuery.getLimit().toString(), + types: (reverseQuery).getLocationTypes() + ? (reverseQuery).getLocationTypes()?.join(",") + : "address", + }; + + this.executeRequest(params, reverseCallback); + } + + public executeRequest( + params: ExternalLoaderParams, + callback: GeocodedResultsCallback + ): void { + this.externalLoader.executeRequest(params, (data) => { + callback( + data.features.map((result: MapboxResult) => + MapboxProvider.mapToGeocoded(result) + ) + ); + }); + } + + public static mapToGeocoded(result: MapboxResult): Geocoded { + const latitude = result.geometry.coordinates[1]; + const longitude = result.geometry.coordinates[0]; + const formattedAddress = result.place_name; + const streetNumber = result.address; + const streetName = result.text; + let locality; + let postalCode; + let region; + let country; + let countryCode; + + (result.context || []).forEach((feature) => { + const type = feature.id.split(".")[0]; + switch (type) { + case "locality": + case "place": + locality = feature.text; + break; + case "postcode": + postalCode = feature.text; + break; + case "region": + region = feature.text; + break; + case "country": + country = feature.text; + countryCode = feature.short_code; + break; + default: + } + }); + + let geocoded = Geocoded.create({ + latitude, + longitude, + formattedAddress, + streetNumber, + streetName, + locality, + postalCode, + region, + country, + countryCode, + }); + if (result.bbox) { + geocoded = geocoded.withBounds( + result.bbox[1], + result.bbox[0], + result.bbox[3], + result.bbox[2] + ); + } + + return geocoded; + } +} diff --git a/src/providers/mapbox/MapboxReverseQuery.ts b/src/providers/mapbox/MapboxReverseQuery.ts new file mode 100644 index 0000000..d17736b --- /dev/null +++ b/src/providers/mapbox/MapboxReverseQuery.ts @@ -0,0 +1,36 @@ +import { ReverseQuery, ReverseQueryObject } from "query"; + +export interface MapboxReverseQueryObject extends ReverseQueryObject { + readonly locationTypes?: string[]; +} + +export default class MapboxReverseQuery extends ReverseQuery { + private readonly locationTypes?: string[]; + + protected constructor({ + locationTypes, + ...reverseQueryObject + }: MapboxReverseQueryObject) { + super(reverseQueryObject); + this.locationTypes = locationTypes; + } + + public static create(object: MapboxReverseQueryObject): MapboxReverseQuery { + return new MapboxReverseQuery(object); + } + + public toObject(): MapboxReverseQueryObject { + return { + ...super.toObject(), + locationTypes: this.locationTypes, + }; + } + + public withLocationTypes(locationTypes: string[]): MapboxReverseQuery { + return new MapboxReverseQuery({ ...this.toObject(), locationTypes }); + } + + public getLocationTypes(): undefined | string[] { + return this.locationTypes; + } +} diff --git a/src/providers/mapbox/index.ts b/src/providers/mapbox/index.ts new file mode 100644 index 0000000..b85eca0 --- /dev/null +++ b/src/providers/mapbox/index.ts @@ -0,0 +1,6 @@ +export { default as MapboxGeocodeQuery } from "providers/mapbox/MapboxGeocodeQuery"; +export * from "providers/mapbox/MapboxGeocodeQuery"; +export { default as MapboxProvider } from "providers/mapbox/MapboxProvider"; +export * from "providers/mapbox/MapboxProvider"; +export { default as MapboxReverseQuery } from "providers/mapbox/MapboxReverseQuery"; +export * from "providers/mapbox/MapboxReverseQuery"; diff --git a/src/query/GeocodeQuery.ts b/src/query/GeocodeQuery.ts new file mode 100644 index 0000000..e3e5531 --- /dev/null +++ b/src/query/GeocodeQuery.ts @@ -0,0 +1,117 @@ +import { DEFAULT_RESULT_LIMIT } from "providers/ProviderInterface"; +import { PartialSome } from "types"; +import { Bounds } from "index"; + +type GeocodeQueryObjectCreate = PartialSome; + +export interface GeocodeQueryObject { + readonly text: string; + readonly south?: number | string; + readonly west?: number | string; + readonly north?: number | string; + readonly east?: number | string; + readonly locale?: string; + readonly limit: number; +} + +export default class GeocodeQuery { + private readonly text: string; + + private readonly south?: number | string; + + private readonly west?: number | string; + + private readonly north?: number | string; + + private readonly east?: number | string; + + private readonly locale?: string; + + private readonly limit: number = DEFAULT_RESULT_LIMIT; + + protected constructor({ + text, + south, + west, + north, + east, + locale, + limit = DEFAULT_RESULT_LIMIT, + }: GeocodeQueryObjectCreate) { + this.text = text; + this.south = south; + this.west = west; + this.north = north; + this.east = east; + this.locale = locale; + this.limit = limit; + } + + public static create(object: GeocodeQueryObjectCreate): GeocodeQuery { + return new GeocodeQuery(object); + } + + public toObject(): GeocodeQueryObject { + return { + text: this.text, + south: this.south, + west: this.west, + north: this.north, + east: this.east, + locale: this.locale, + limit: this.limit, + }; + } + + public withText(text: string): GeocodeQuery { + return new GeocodeQuery({ ...this.toObject(), text }); + } + + public withBounds( + south?: number, + west?: number, + north?: number, + east?: number + ): GeocodeQuery { + return new GeocodeQuery({ + ...this.toObject(), + south, + west, + north, + east, + }); + } + + public withLocale(locale: string): GeocodeQuery { + return new GeocodeQuery({ ...this.toObject(), locale }); + } + + public withLimit(limit: number): GeocodeQuery { + return new GeocodeQuery({ ...this.toObject(), limit }); + } + + public getText(): string { + return this.text; + } + + public getBounds(): undefined | Bounds { + if (!this.south || !this.west || !this.north || !this.east) { + return undefined; + } + + return { + south: this.south, + west: this.west, + north: this.north, + east: this.east, + }; + } + + public getLocale(): undefined | string { + return this.locale; + } + + public getLimit(): number { + return this.limit; + } +} diff --git a/src/query/ReverseQuery.ts b/src/query/ReverseQuery.ts new file mode 100644 index 0000000..b68e50b --- /dev/null +++ b/src/query/ReverseQuery.ts @@ -0,0 +1,75 @@ +import { DEFAULT_RESULT_LIMIT } from "providers/ProviderInterface"; +import { PartialSome } from "types"; +import { Coordinates } from "index"; + +type ReverseQueryObjectCreate = PartialSome; + +export interface ReverseQueryObject { + readonly latitude: number | string; + readonly longitude: number | string; + readonly locale?: string; + readonly limit: number; +} + +export default class ReverseQuery { + private readonly latitude: number | string; + + private readonly longitude: number | string; + + private readonly locale?: string; + + private readonly limit: number = DEFAULT_RESULT_LIMIT; + + protected constructor({ + latitude, + longitude, + locale, + limit = DEFAULT_RESULT_LIMIT, + }: ReverseQueryObjectCreate) { + this.latitude = latitude; + this.longitude = longitude; + this.locale = locale; + this.limit = limit; + } + + public static create(object: ReverseQueryObjectCreate): ReverseQuery { + return new ReverseQuery(object); + } + + public toObject(): ReverseQueryObject { + return { + latitude: this.latitude, + longitude: this.longitude, + locale: this.locale, + limit: this.limit, + }; + } + + public withCoordinates(latitude: number, longitude: number): ReverseQuery { + return new ReverseQuery({ + ...this.toObject(), + latitude, + longitude, + }); + } + + public withLocale(locale: string): ReverseQuery { + return new ReverseQuery({ ...this.toObject(), locale }); + } + + public withLimit(limit: number): ReverseQuery { + return new ReverseQuery({ ...this.toObject(), limit }); + } + + public getCoordinates(): Coordinates { + return { latitude: this.latitude, longitude: this.longitude }; + } + + public getLocale(): undefined | string { + return this.locale; + } + + public getLimit(): number { + return this.limit; + } +} diff --git a/src/query/index.ts b/src/query/index.ts new file mode 100644 index 0000000..5566cb5 --- /dev/null +++ b/src/query/index.ts @@ -0,0 +1,4 @@ +export { default as GeocodeQuery } from "query/GeocodeQuery"; +export * from "query/GeocodeQuery"; +export { default as ReverseQuery } from "query/ReverseQuery"; +export * from "query/ReverseQuery"; diff --git a/src/types.ts b/src/types.ts new file mode 100644 index 0000000..cba3725 --- /dev/null +++ b/src/types.ts @@ -0,0 +1,6 @@ +export type PartialSome< + O, + P extends keyof O, + Q = Omit, + R = { [K in P]?: O[P] } +> = Q & R; diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..de3d453 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,15 @@ +{ + "compilerOptions": { + "baseUrl": "src", + "declaration": true, + "declarationDir": "types", + "declarationMap": true, + "outDir": "dist", + "sourceMap": true, + "strict": true, + "target": "ES5" + }, + "include": [ + "src/**/*" + ] +} diff --git a/types/ExternalURILoader.d.ts b/types/ExternalURILoader.d.ts new file mode 100644 index 0000000..7cf496f --- /dev/null +++ b/types/ExternalURILoader.d.ts @@ -0,0 +1,31 @@ +export interface ExternalLoaderInterface { + setOptions(options: ExternalLoaderOptions): void; + executeRequest(params: ExternalLoaderParams, callback: ResponseCallback): void; +} +export interface ExternalLoaderOptions { + readonly protocol: null | string; + readonly host: null | string; + readonly pathname: null | string; +} +export interface ExternalLoaderParams { + [param: string]: string | undefined; + JSONPCallback?: string; +} +declare type ResponseCallback = (response: any) => void; +/** + * Load data from external geocoding engines. + */ +export default class ExternalURILoader implements ExternalLoaderInterface { + private options; + constructor(options?: ExternalLoaderOptions); + setOptions(options: ExternalLoaderOptions): void; + executeRequest(params: ExternalLoaderParams, callback: ResponseCallback): void; + private static runJsonpCallback; + /** + * Generates randomly-named function to use as a callback for JSONP requests. + * @see https://github.com/OscarGodson/JSONP + */ + private static generateJsonpCallback; +} +export {}; +//# sourceMappingURL=ExternalURILoader.d.ts.map \ No newline at end of file diff --git a/types/ExternalURILoader.d.ts.map b/types/ExternalURILoader.d.ts.map new file mode 100644 index 0000000..1535a05 --- /dev/null +++ b/types/ExternalURILoader.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ExternalURILoader.d.ts","sourceRoot":"","sources":["../src/ExternalURILoader.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,uBAAuB;IACtC,UAAU,CAAC,OAAO,EAAE,qBAAqB,GAAG,IAAI,CAAC;IACjD,cAAc,CACZ,MAAM,EAAE,oBAAoB,EAC5B,QAAQ,EAAE,gBAAgB,GACzB,IAAI,CAAC;CACT;AAED,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,QAAQ,EAAE,IAAI,GAAG,MAAM,CAAC;IACjC,QAAQ,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,CAAC;IAC7B,QAAQ,CAAC,QAAQ,EAAE,IAAI,GAAG,MAAM,CAAC;CAClC;AAED,MAAM,WAAW,oBAAoB;IACnC,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;IACpC,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAGD,aAAK,gBAAgB,GAAG,CAAC,QAAQ,EAAE,GAAG,KAAK,IAAI,CAAC;AAQhD;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,iBAAkB,YAAW,uBAAuB;IACvE,OAAO,CAAC,OAAO,CAAyC;gBAErC,OAAO,GAAE,qBAAsC;IAI3D,UAAU,CAAC,OAAO,EAAE,qBAAqB,GAAG,IAAI;IAIhD,cAAc,CACnB,MAAM,EAAE,oBAAoB,EAC5B,QAAQ,EAAE,gBAAgB,GACzB,IAAI;IA6CP,OAAO,CAAC,MAAM,CAAC,gBAAgB;IA4B/B;;;OAGG;IACH,OAAO,CAAC,MAAM,CAAC,qBAAqB;CAoBrC"} \ No newline at end of file diff --git a/types/GeoJSONDumper.d.ts b/types/GeoJSONDumper.d.ts new file mode 100644 index 0000000..d475d11 --- /dev/null +++ b/types/GeoJSONDumper.d.ts @@ -0,0 +1,14 @@ +import Geocoded from "Geocoded"; +export interface GeoJson { + type: "Feature"; + properties: Record; + geometry: { + type: "Point"; + coordinates: [number | undefined, number | undefined]; + }; +} +export default class GeoJsonDumper { + private baseGeoJson; + dump(geocoded: Geocoded): GeoJson; +} +//# sourceMappingURL=GeoJSONDumper.d.ts.map \ No newline at end of file diff --git a/types/GeoJSONDumper.d.ts.map b/types/GeoJSONDumper.d.ts.map new file mode 100644 index 0000000..62be724 --- /dev/null +++ b/types/GeoJSONDumper.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"GeoJSONDumper.d.ts","sourceRoot":"","sources":["../src/GeoJSONDumper.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,UAAU,CAAC;AAEhC,MAAM,WAAW,OAAO;IACtB,IAAI,EAAE,SAAS,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACpC,QAAQ,EAAE;QACR,IAAI,EAAE,OAAO,CAAC;QACd,WAAW,EAAE,CAAC,MAAM,GAAG,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;KACvD,CAAC;CACH;AAED,MAAM,CAAC,OAAO,OAAO,aAAa;IAChC,OAAO,CAAC,WAAW,CAOjB;IAEK,IAAI,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO;CASzC"} \ No newline at end of file diff --git a/types/Geocoded.d.ts b/types/Geocoded.d.ts new file mode 100644 index 0000000..4803e79 --- /dev/null +++ b/types/Geocoded.d.ts @@ -0,0 +1,53 @@ +export interface GeocodedObject { + readonly latitude?: number; + readonly longitude?: number; + readonly south?: number; + readonly west?: number; + readonly north?: number; + readonly east?: number; + readonly formattedAddress?: string; + readonly streetNumber?: string; + readonly streetName?: string; + readonly subLocality?: string; + readonly locality?: string; + readonly postalCode?: string; + readonly region?: string; + readonly country?: string; + readonly countryCode?: string; +} +export default class Geocoded { + private readonly latitude?; + private readonly longitude?; + private readonly south?; + private readonly west?; + private readonly north?; + private readonly east?; + private readonly formattedAddress?; + private readonly streetNumber?; + private readonly streetName?; + private readonly subLocality?; + private readonly locality?; + private readonly postalCode?; + private readonly region?; + private readonly country?; + private readonly countryCode?; + private constructor(); + static create(object: GeocodedObject): Geocoded; + toObject(): GeocodedObject; + withBounds(south?: number, west?: number, north?: number, east?: number): Geocoded; + withCoordinates(latitude?: number, longitude?: number): Geocoded; + getCoordinates(): [undefined | number, undefined | number]; + getLatitude(): undefined | number; + getLongitude(): undefined | number; + getBounds(): [undefined | number, undefined | number, undefined | number, undefined | number]; + getFormattedAddress(): undefined | string; + getStreetNumber(): undefined | string; + getStreetName(): undefined | string; + getSubLocality(): undefined | string; + getLocality(): undefined | string; + getPostalCode(): undefined | string; + getRegion(): undefined | string; + getCountry(): undefined | string; + getCountryCode(): undefined | string; +} +//# sourceMappingURL=Geocoded.d.ts.map \ No newline at end of file diff --git a/types/Geocoded.d.ts.map b/types/Geocoded.d.ts.map new file mode 100644 index 0000000..5c4e9f8 --- /dev/null +++ b/types/Geocoded.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Geocoded.d.ts","sourceRoot":"","sources":["../src/Geocoded.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IACnC,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;CAC/B;AAED,MAAM,CAAC,OAAO,OAAO,QAAQ;IAC3B,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAS;IAEnC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAS;IAEpC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAS;IAEhC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAS;IAE/B,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAS;IAEhC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAS;IAE/B,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAC,CAAS;IAE3C,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAS;IAEvC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAS;IAErC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAS;IAEtC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAS;IAEnC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAS;IAErC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAS;IAEjC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAS;IAElC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAS;IAEtC,OAAO;WAkCO,MAAM,CAAC,MAAM,EAAE,cAAc,GAAG,QAAQ;IAI/C,QAAQ,IAAI,cAAc;IAoB1B,UAAU,CACf,KAAK,CAAC,EAAE,MAAM,EACd,IAAI,CAAC,EAAE,MAAM,EACb,KAAK,CAAC,EAAE,MAAM,EACd,IAAI,CAAC,EAAE,MAAM,GACZ,QAAQ;IAUJ,eAAe,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,QAAQ;IAQhE,cAAc,IAAI,CAAC,SAAS,GAAG,MAAM,EAAE,SAAS,GAAG,MAAM,CAAC;IAI1D,WAAW,IAAI,SAAS,GAAG,MAAM;IAIjC,YAAY,IAAI,SAAS,GAAG,MAAM;IAIlC,SAAS,IAAI,CAClB,SAAS,GAAG,MAAM,EAClB,SAAS,GAAG,MAAM,EAClB,SAAS,GAAG,MAAM,EAClB,SAAS,GAAG,MAAM,CACnB;IAIM,mBAAmB,IAAI,SAAS,GAAG,MAAM;IAIzC,eAAe,IAAI,SAAS,GAAG,MAAM;IAIrC,aAAa,IAAI,SAAS,GAAG,MAAM;IAInC,cAAc,IAAI,SAAS,GAAG,MAAM;IAIpC,WAAW,IAAI,SAAS,GAAG,MAAM;IAIjC,aAAa,IAAI,SAAS,GAAG,MAAM;IAInC,SAAS,IAAI,SAAS,GAAG,MAAM;IAI/B,UAAU,IAAI,SAAS,GAAG,MAAM;IAIhC,cAAc,IAAI,SAAS,GAAG,MAAM;CAG5C"} \ No newline at end of file diff --git a/types/GeocoderJS.d.ts b/types/GeocoderJS.d.ts new file mode 100644 index 0000000..d14f1d0 --- /dev/null +++ b/types/GeocoderJS.d.ts @@ -0,0 +1,7 @@ +import { GeocoderProviderFactoryOptions } from "GeocoderProviderFactory"; +import { ProviderInterface } from "providers"; +export default class GeocoderJS { + version: string; + static createGeocoder(options: string | GeocoderProviderFactoryOptions): ProviderInterface | undefined; +} +//# sourceMappingURL=GeocoderJS.d.ts.map \ No newline at end of file diff --git a/types/GeocoderJS.d.ts.map b/types/GeocoderJS.d.ts.map new file mode 100644 index 0000000..6152e8c --- /dev/null +++ b/types/GeocoderJS.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"GeocoderJS.d.ts","sourceRoot":"","sources":["../src/GeocoderJS.ts"],"names":[],"mappings":"AAAA,OAAwB,EACtB,8BAA8B,EAC/B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAE9C,MAAM,CAAC,OAAO,OAAO,UAAU;IACtB,OAAO,SAAW;WAEX,cAAc,CAC1B,OAAO,EAAE,MAAM,GAAG,8BAA8B,GAC/C,iBAAiB,GAAG,SAAS;CAGjC"} \ No newline at end of file diff --git a/types/GeocoderProviderFactory.d.ts b/types/GeocoderProviderFactory.d.ts new file mode 100644 index 0000000..a5177b8 --- /dev/null +++ b/types/GeocoderProviderFactory.d.ts @@ -0,0 +1,18 @@ +import { ProviderInterface, ProviderOptionsInterface } from "providers"; +export interface GeocoderProviderFactoryOptions extends ProviderOptionsInterface { + provider: "bing" | "google" | "mapbox" | "mapquest" | "openstreetmap" | "yandex"; +} +export default class ProviderFactory { + /** + * Creates Geocoder Provider instances. + * @param options + * Either a string representing the registered provider, or an object with the + * following settings for instigating providers: + * - provider: A string representing the registered provider. + * @return + * An object compatible with ProviderInterface, or undefined if there's not a + * registered provider. + */ + static createProvider(options: string | GeocoderProviderFactoryOptions): ProviderInterface | undefined; +} +//# sourceMappingURL=GeocoderProviderFactory.d.ts.map \ No newline at end of file diff --git a/types/GeocoderProviderFactory.d.ts.map b/types/GeocoderProviderFactory.d.ts.map new file mode 100644 index 0000000..a566a54 --- /dev/null +++ b/types/GeocoderProviderFactory.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"GeocoderProviderFactory.d.ts","sourceRoot":"","sources":["../src/GeocoderProviderFactory.ts"],"names":[],"mappings":"AAAA,OAAO,EAOL,iBAAiB,EACjB,wBAAwB,EAIzB,MAAM,WAAW,CAAC;AAGnB,MAAM,WAAW,8BACf,SAAQ,wBAAwB;IAChC,QAAQ,EACJ,MAAM,GACN,QAAQ,GACR,QAAQ,GACR,UAAU,GACV,eAAe,GACf,QAAQ,CAAC;CACd;AAED,MAAM,CAAC,OAAO,OAAO,eAAe;IAClC;;;;;;;;;OASG;WACW,cAAc,CAC1B,OAAO,EAAE,MAAM,GAAG,8BAA8B,GAC/C,iBAAiB,GAAG,SAAS;CAiCjC"} \ No newline at end of file diff --git a/types/global.d.ts b/types/global.d.ts new file mode 100644 index 0000000..a6d6f0a --- /dev/null +++ b/types/global.d.ts @@ -0,0 +1,7 @@ +import GeocoderJS from "GeocoderJS"; +declare global { + interface Window { + GeocoderJS: typeof GeocoderJS; + } +} +//# sourceMappingURL=global.d.ts.map \ No newline at end of file diff --git a/types/global.d.ts.map b/types/global.d.ts.map new file mode 100644 index 0000000..e085bf0 --- /dev/null +++ b/types/global.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"global.d.ts","sourceRoot":"","sources":["../src/global.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,YAAY,CAAC;AAMpC,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,UAAU,EAAE,OAAO,UAAU,CAAC;KAC/B;CACF"} \ No newline at end of file diff --git a/types/index.d.ts b/types/index.d.ts new file mode 100644 index 0000000..335f1e0 --- /dev/null +++ b/types/index.d.ts @@ -0,0 +1,22 @@ +export interface Bounds { + readonly south: number | string; + readonly west: number | string; + readonly north: number | string; + readonly east: number | string; +} +export interface Coordinates { + readonly latitude: number | string; + readonly longitude: number | string; +} +export * from "providers"; +export * from "query"; +export { default as ExternalURILoader } from "ExternalURILoader"; +export * from "ExternalURILoader"; +export { default as Geocoded } from "Geocoded"; +export * from "Geocoded"; +export { default as GeocoderProviderFactory } from "GeocoderProviderFactory"; +export * from "GeocoderProviderFactory"; +export { default as GeoJSONDumper } from "GeoJSONDumper"; +export * from "GeoJSONDumper"; +export { default } from "GeocoderJS"; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/types/index.d.ts.map b/types/index.d.ts.map new file mode 100644 index 0000000..3559ab1 --- /dev/null +++ b/types/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,MAAM;IACrB,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IAChC,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;IAC/B,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IAChC,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;CAChC;AAED,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAAC;IACnC,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAAC;CACrC;AAED,cAAc,WAAW,CAAC;AAC1B,cAAc,OAAO,CAAC;AACtB,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACjE,cAAc,mBAAmB,CAAC;AAClC,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,UAAU,CAAC;AAC/C,cAAc,UAAU,CAAC;AACzB,OAAO,EAAE,OAAO,IAAI,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AAC7E,cAAc,yBAAyB,CAAC;AACxC,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,eAAe,CAAC;AACzD,cAAc,eAAe,CAAC;AAC9B,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC"} \ No newline at end of file diff --git a/types/providers/BingProvider.d.ts b/types/providers/BingProvider.d.ts new file mode 100644 index 0000000..294e09b --- /dev/null +++ b/types/providers/BingProvider.d.ts @@ -0,0 +1,41 @@ +import { ExternalLoaderInterface, ExternalLoaderParams } from "ExternalURILoader"; +import { GeocodedResultsCallback, ProviderInterface, ProviderOptionsInterface } from "providers"; +import Geocoded from "Geocoded"; +import { GeocodeQuery, GeocodeQueryObject, ReverseQuery, ReverseQueryObject } from "query"; +export interface BingResult { + __type: string; + bbox: [number, number, number, number]; + name: string; + point: { + type: string; + coordinates: [number, number]; + }; + address: { + addressLine: string; + adminDistrict: string; + adminDistrict2: string; + countryRegion: string; + formattedAddress: string; + locality: string; + postalCode: string; + }; + confidence: string; + entityType: string; + geocodePoints: { + type: string; + coordinates: [number, number]; + calculationMethod: string; + usageTypes: string[]; + }[]; + matchCodes: string[]; +} +export default class BingProvider implements ProviderInterface { + private externalLoader; + private options; + constructor(_externalLoader: ExternalLoaderInterface, options?: ProviderOptionsInterface); + geocode(query: string | GeocodeQuery | GeocodeQueryObject, callback: GeocodedResultsCallback): void; + geodecode(latitudeOrQuery: number | string | ReverseQuery | ReverseQueryObject, longitudeOrCallback: number | string | GeocodedResultsCallback, callback?: GeocodedResultsCallback): void; + executeRequest(params: ExternalLoaderParams, callback: GeocodedResultsCallback): void; + static mapToGeocoded(result: BingResult): Geocoded; +} +//# sourceMappingURL=BingProvider.d.ts.map \ No newline at end of file diff --git a/types/providers/BingProvider.d.ts.map b/types/providers/BingProvider.d.ts.map new file mode 100644 index 0000000..eac04a4 --- /dev/null +++ b/types/providers/BingProvider.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"BingProvider.d.ts","sourceRoot":"","sources":["../../src/providers/BingProvider.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EACvB,oBAAoB,EACrB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,uBAAuB,EAEvB,iBAAiB,EACjB,wBAAwB,EAEzB,MAAM,WAAW,CAAC;AACnB,OAAO,QAAQ,MAAM,UAAU,CAAC;AAChC,OAAO,EACL,YAAY,EACZ,kBAAkB,EAClB,YAAY,EACZ,kBAAkB,EACnB,MAAM,OAAO,CAAC;AAQf,MAAM,WAAW,UAAU;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IACvC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE;QACL,IAAI,EAAE,MAAM,CAAC;QACb,WAAW,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;KAC/B,CAAC;IACF,OAAO,EAAE;QACP,WAAW,EAAE,MAAM,CAAC;QACpB,aAAa,EAAE,MAAM,CAAC;QACtB,cAAc,EAAE,MAAM,CAAC;QACvB,aAAa,EAAE,MAAM,CAAC;QACtB,gBAAgB,EAAE,MAAM,CAAC;QACzB,QAAQ,EAAE,MAAM,CAAC;QACjB,UAAU,EAAE,MAAM,CAAC;KACpB,CAAC;IACF,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE;QACb,IAAI,EAAE,MAAM,CAAC;QACb,WAAW,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QAC9B,iBAAiB,EAAE,MAAM,CAAC;QAC1B,UAAU,EAAE,MAAM,EAAE,CAAC;KACtB,EAAE,CAAC;IACJ,UAAU,EAAE,MAAM,EAAE,CAAC;CACtB;AAED,MAAM,CAAC,OAAO,OAAO,YAAa,YAAW,iBAAiB;IAC5D,OAAO,CAAC,cAAc,CAA0B;IAEhD,OAAO,CAAC,OAAO,CAA2B;gBAGxC,eAAe,EAAE,uBAAuB,EACxC,OAAO,GAAE,wBAAiD;IAWrD,OAAO,CACZ,KAAK,EAAE,MAAM,GAAG,YAAY,GAAG,kBAAkB,EACjD,QAAQ,EAAE,uBAAuB,GAChC,IAAI;IAiBA,SAAS,CACd,eAAe,EAAE,MAAM,GAAG,MAAM,GAAG,YAAY,GAAG,kBAAkB,EACpE,mBAAmB,EAAE,MAAM,GAAG,MAAM,GAAG,uBAAuB,EAC9D,QAAQ,CAAC,EAAE,uBAAuB,GACjC,IAAI;IA0BA,cAAc,CACnB,MAAM,EAAE,oBAAoB,EAC5B,QAAQ,EAAE,uBAAuB,GAChC,IAAI;WAUO,aAAa,CAAC,MAAM,EAAE,UAAU,GAAG,QAAQ;CA4B1D"} \ No newline at end of file diff --git a/types/providers/GoogleAPIProvider.d.ts b/types/providers/GoogleAPIProvider.d.ts new file mode 100644 index 0000000..ac73088 --- /dev/null +++ b/types/providers/GoogleAPIProvider.d.ts @@ -0,0 +1,34 @@ +import { ExternalLoaderInterface, ExternalLoaderParams } from "ExternalURILoader"; +import { GeocodedResultsCallback, ProviderInterface, ProviderOptionsInterface } from "providers"; +import Geocoded from "Geocoded"; +import { GeocodeQuery, GeocodeQueryObject, ReverseQuery, ReverseQueryObject } from "query"; +interface GoogleApiLatLng { + lat: number; + lng: number; +} +export interface GoogleApiResult { + geometry: { + location: GoogleApiLatLng; + bounds: { + southwest: GoogleApiLatLng; + northeast: GoogleApiLatLng; + }; + }; + formatted_address: string; + address_components: { + types: ("street_number" | "route" | "sublocality" | "locality" | "postal_code" | "administrative_area_level_1" | "country")[]; + long_name: string; + short_name: string; + }[]; +} +export default class GoogleApiProvider implements ProviderInterface { + private externalLoader; + private options; + constructor(_externalLoader: ExternalLoaderInterface, options?: ProviderOptionsInterface); + geocode(query: string | GeocodeQuery | GeocodeQueryObject, callback: GeocodedResultsCallback): void; + geodecode(latitudeOrQuery: number | string | ReverseQuery | ReverseQueryObject, longitudeOrCallback: number | string | GeocodedResultsCallback, callback?: GeocodedResultsCallback): void; + executeRequest(params: ExternalLoaderParams, callback: GeocodedResultsCallback): void; + static mapToGeocoded(result: GoogleApiResult): Geocoded; +} +export {}; +//# sourceMappingURL=GoogleAPIProvider.d.ts.map \ No newline at end of file diff --git a/types/providers/GoogleAPIProvider.d.ts.map b/types/providers/GoogleAPIProvider.d.ts.map new file mode 100644 index 0000000..147e634 --- /dev/null +++ b/types/providers/GoogleAPIProvider.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"GoogleAPIProvider.d.ts","sourceRoot":"","sources":["../../src/providers/GoogleAPIProvider.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EACvB,oBAAoB,EACrB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,uBAAuB,EAEvB,iBAAiB,EACjB,wBAAwB,EAEzB,MAAM,WAAW,CAAC;AACnB,OAAO,QAAQ,MAAM,UAAU,CAAC;AAChC,OAAO,EACL,YAAY,EACZ,kBAAkB,EAClB,YAAY,EACZ,kBAAkB,EACnB,MAAM,OAAO,CAAC;AAUf,UAAU,eAAe;IACvB,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE;QACR,QAAQ,EAAE,eAAe,CAAC;QAC1B,MAAM,EAAE;YACN,SAAS,EAAE,eAAe,CAAC;YAC3B,SAAS,EAAE,eAAe,CAAC;SAC5B,CAAC;KACH,CAAC;IAEF,iBAAiB,EAAE,MAAM,CAAC;IAE1B,kBAAkB,EAAE;QAClB,KAAK,EAAE,CACH,eAAe,GACf,OAAO,GACP,aAAa,GACb,UAAU,GACV,aAAa,GACb,6BAA6B,GAC7B,SAAS,CACZ,EAAE,CAAC;QAEJ,SAAS,EAAE,MAAM,CAAC;QAElB,UAAU,EAAE,MAAM,CAAC;KACpB,EAAE,CAAC;CACL;AAED,MAAM,CAAC,OAAO,OAAO,iBAAkB,YAAW,iBAAiB;IACjE,OAAO,CAAC,cAAc,CAA0B;IAEhD,OAAO,CAAC,OAAO,CAA2B;gBAGxC,eAAe,EAAE,uBAAuB,EACxC,OAAO,GAAE,wBAAiD;IAWrD,OAAO,CACZ,KAAK,EAAE,MAAM,GAAG,YAAY,GAAG,kBAAkB,EACjD,QAAQ,EAAE,uBAAuB,GAChC,IAAI;IAkBA,SAAS,CACd,eAAe,EAAE,MAAM,GAAG,MAAM,GAAG,YAAY,GAAG,kBAAkB,EACpE,mBAAmB,EAAE,MAAM,GAAG,MAAM,GAAG,uBAAuB,EAC9D,QAAQ,CAAC,EAAE,uBAAuB,GACjC,IAAI;IA2BA,cAAc,CACnB,MAAM,EAAE,oBAAoB,EAC5B,QAAQ,EAAE,uBAAuB,GAChC,IAAI;WAkBO,aAAa,CAAC,MAAM,EAAE,eAAe,GAAG,QAAQ;CAqE/D"} \ No newline at end of file diff --git a/types/providers/MapquestProvider.d.ts b/types/providers/MapquestProvider.d.ts new file mode 100644 index 0000000..5f30bb7 --- /dev/null +++ b/types/providers/MapquestProvider.d.ts @@ -0,0 +1,42 @@ +import { ExternalLoaderInterface, ExternalLoaderParams } from "ExternalURILoader"; +import { GeocodedResultsCallback, ProviderInterface, ProviderOptionsInterface } from "providers"; +import Geocoded from "Geocoded"; +import { GeocodeQuery, GeocodeQueryObject, ReverseQuery, ReverseQueryObject } from "query"; +export interface MapQuestResult { + latLng: { + lat: number; + lng: number; + }; + displayLatLng: { + lat: number; + lng: number; + }; + street: string; + sideOfStreet: string; + adminArea1?: string; + adminArea1Type?: string; + adminArea3?: string; + adminArea3Type?: string; + adminArea4?: string; + adminArea4Type?: string; + adminArea5?: string; + adminArea5Type?: string; + adminArea6?: string; + adminArea6Type?: string; + postalCode: string; + type: string; + linkId: string; + dragPoint: boolean; + geocodeQuality: string; + geocodeQualityCode: string; +} +export default class MapQuestProvider implements ProviderInterface { + private externalLoader; + private options; + constructor(_externalLoader: ExternalLoaderInterface, options?: ProviderOptionsInterface); + geocode(query: string | GeocodeQuery | GeocodeQueryObject, callback: GeocodedResultsCallback): void; + geodecode(latitudeOrQuery: number | string | ReverseQuery | ReverseQueryObject, longitudeOrCallback: number | string | GeocodedResultsCallback, callback?: GeocodedResultsCallback): void; + executeRequest(params: ExternalLoaderParams, callback: GeocodedResultsCallback): void; + static mapToGeocoded(result: MapQuestResult): Geocoded; +} +//# sourceMappingURL=MapquestProvider.d.ts.map \ No newline at end of file diff --git a/types/providers/MapquestProvider.d.ts.map b/types/providers/MapquestProvider.d.ts.map new file mode 100644 index 0000000..7f731b7 --- /dev/null +++ b/types/providers/MapquestProvider.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"MapquestProvider.d.ts","sourceRoot":"","sources":["../../src/providers/MapquestProvider.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EACvB,oBAAoB,EACrB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,uBAAuB,EAEvB,iBAAiB,EACjB,wBAAwB,EAEzB,MAAM,WAAW,CAAC;AACnB,OAAO,QAAQ,MAAM,UAAU,CAAC;AAChC,OAAO,EACL,YAAY,EACZ,kBAAkB,EAClB,YAAY,EACZ,kBAAkB,EACnB,MAAM,OAAO,CAAC;AASf,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE;QACN,GAAG,EAAE,MAAM,CAAC;QACZ,GAAG,EAAE,MAAM,CAAC;KACb,CAAC;IACF,aAAa,EAAE;QACb,GAAG,EAAE,MAAM,CAAC;QACZ,GAAG,EAAE,MAAM,CAAC;KACb,CAAC;IACF,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,OAAO,CAAC;IACnB,cAAc,EAAE,MAAM,CAAC;IACvB,kBAAkB,EAAE,MAAM,CAAC;CAC5B;AAED,MAAM,CAAC,OAAO,OAAO,gBAAiB,YAAW,iBAAiB;IAChE,OAAO,CAAC,cAAc,CAA0B;IAEhD,OAAO,CAAC,OAAO,CAA2B;gBAGxC,eAAe,EAAE,uBAAuB,EACxC,OAAO,GAAE,wBAAiD;IAWrD,OAAO,CACZ,KAAK,EAAE,MAAM,GAAG,YAAY,GAAG,kBAAkB,EACjD,QAAQ,EAAE,uBAAuB,GAChC,IAAI;IAkBA,SAAS,CACd,eAAe,EAAE,MAAM,GAAG,MAAM,GAAG,YAAY,GAAG,kBAAkB,EACpE,mBAAmB,EAAE,MAAM,GAAG,MAAM,GAAG,uBAAuB,EAC9D,QAAQ,CAAC,EAAE,uBAAuB,GACjC,IAAI;IA2BA,cAAc,CACnB,MAAM,EAAE,oBAAoB,EAC5B,QAAQ,EAAE,uBAAuB,GAChC,IAAI;WAUO,aAAa,CAAC,MAAM,EAAE,cAAc,GAAG,QAAQ;CAuB9D"} \ No newline at end of file diff --git a/types/providers/OpenStreetMapProvider.d.ts b/types/providers/OpenStreetMapProvider.d.ts new file mode 100644 index 0000000..f42bec1 --- /dev/null +++ b/types/providers/OpenStreetMapProvider.d.ts @@ -0,0 +1,43 @@ +import { ExternalLoaderInterface, ExternalLoaderParams } from "ExternalURILoader"; +import { GeocodedResultsCallback, ProviderInterface, ProviderOptionsInterface } from "providers"; +import Geocoded from "Geocoded"; +import { GeocodeQuery, GeocodeQueryObject, ReverseQuery, ReverseQueryObject } from "query"; +export interface OpenStreetMapResult { + place_id: number; + licence: string; + osm_type: string; + osm_id: number; + boundingbox: [string, string, string, string]; + lat: string; + lon: string; + display_name: string; + class: string; + type: string; + importance: number; + icon: string; + address: { + attraction?: string; + house_number?: string; + road?: string; + neighbourhood?: string; + suburb?: string; + city?: string; + town?: string; + village?: string; + hamlet?: string; + state?: string; + postcode?: string; + country?: string; + country_code?: string; + }; +} +export default class OpenStreetMapProvider implements ProviderInterface { + private externalLoader; + private options; + constructor(_externalLoader: ExternalLoaderInterface, options?: ProviderOptionsInterface); + geocode(query: string | GeocodeQuery | GeocodeQueryObject, callback: GeocodedResultsCallback): void; + geodecode(latitudeOrQuery: number | string | ReverseQuery | ReverseQueryObject, longitudeOrCallback: number | string | GeocodedResultsCallback, callback?: GeocodedResultsCallback): void; + executeRequest(params: ExternalLoaderParams, callback: GeocodedResultsCallback): void; + static mapToGeocoded(result: OpenStreetMapResult): Geocoded; +} +//# sourceMappingURL=OpenStreetMapProvider.d.ts.map \ No newline at end of file diff --git a/types/providers/OpenStreetMapProvider.d.ts.map b/types/providers/OpenStreetMapProvider.d.ts.map new file mode 100644 index 0000000..875b5aa --- /dev/null +++ b/types/providers/OpenStreetMapProvider.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"OpenStreetMapProvider.d.ts","sourceRoot":"","sources":["../../src/providers/OpenStreetMapProvider.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EACvB,oBAAoB,EACrB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,uBAAuB,EAEvB,iBAAiB,EACjB,wBAAwB,EAEzB,MAAM,WAAW,CAAC;AACnB,OAAO,QAAQ,MAAM,UAAU,CAAC;AAChC,OAAO,EACL,YAAY,EACZ,kBAAkB,EAClB,YAAY,EACZ,kBAAkB,EACnB,MAAM,OAAO,CAAC;AAaf,MAAM,WAAW,mBAAmB;IAElC,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAEhB,QAAQ,EAAE,MAAM,CAAC;IAEjB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IAC9C,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IAEZ,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE;QACP,UAAU,CAAC,EAAE,MAAM,CAAC;QAEpB,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,OAAO,CAAC,EAAE,MAAM,CAAC;QAEjB,YAAY,CAAC,EAAE,MAAM,CAAC;KACvB,CAAC;CACH;AAED,MAAM,CAAC,OAAO,OAAO,qBAAsB,YAAW,iBAAiB;IACrE,OAAO,CAAC,cAAc,CAA0B;IAEhD,OAAO,CAAC,OAAO,CAA2B;gBAGxC,eAAe,EAAE,uBAAuB,EACxC,OAAO,GAAE,wBAAiD;IAMrD,OAAO,CACZ,KAAK,EAAE,MAAM,GAAG,YAAY,GAAG,kBAAkB,EACjD,QAAQ,EAAE,uBAAuB,GAChC,IAAI;IAmBA,SAAS,CACd,eAAe,EAAE,MAAM,GAAG,MAAM,GAAG,YAAY,GAAG,kBAAkB,EACpE,mBAAmB,EAAE,MAAM,GAAG,MAAM,GAAG,uBAAuB,EAC9D,QAAQ,CAAC,EAAE,uBAAuB,GACjC,IAAI;IA4BA,cAAc,CACnB,MAAM,EAAE,oBAAoB,EAC5B,QAAQ,EAAE,uBAAuB,GAChC,IAAI;WAYO,aAAa,CAAC,MAAM,EAAE,mBAAmB,GAAG,QAAQ;CAgDnE"} \ No newline at end of file diff --git a/types/providers/ProviderHelpers.d.ts b/types/providers/ProviderHelpers.d.ts new file mode 100644 index 0000000..f8f729c --- /dev/null +++ b/types/providers/ProviderHelpers.d.ts @@ -0,0 +1,8 @@ +import { GeocodedResultsCallback } from "providers"; +import { GeocodeQuery, GeocodeQueryObject, ReverseQuery, ReverseQueryObject } from "query"; +export default class ProviderHelpers { + static getGeocodeQueryFromParameter(query: string | GeocodeQuery | GeocodeQueryObject, geocodeQuery?: typeof GeocodeQuery): GeocodeQuery; + static getReverseQueryFromParameters(latitudeOrQuery: number | string | ReverseQuery | ReverseQueryObject, longitudeOrCallback: number | string | GeocodedResultsCallback, reverseQuery?: typeof ReverseQuery): ReverseQuery; + static getCallbackFromParameters(longitudeOrCallback: number | string | GeocodedResultsCallback, callback?: GeocodedResultsCallback): GeocodedResultsCallback; +} +//# sourceMappingURL=ProviderHelpers.d.ts.map \ No newline at end of file diff --git a/types/providers/ProviderHelpers.d.ts.map b/types/providers/ProviderHelpers.d.ts.map new file mode 100644 index 0000000..795acd5 --- /dev/null +++ b/types/providers/ProviderHelpers.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ProviderHelpers.d.ts","sourceRoot":"","sources":["../../src/providers/ProviderHelpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,WAAW,CAAC;AACpD,OAAO,EACL,YAAY,EACZ,kBAAkB,EAClB,YAAY,EACZ,kBAAkB,EACnB,MAAM,OAAO,CAAC;AAEf,MAAM,CAAC,OAAO,OAAO,eAAe;WACpB,4BAA4B,CACxC,KAAK,EAAE,MAAM,GAAG,YAAY,GAAG,kBAAkB,EACjD,YAAY,sBAAe,GAC1B,YAAY;WAWD,6BAA6B,CACzC,eAAe,EAAE,MAAM,GAAG,MAAM,GAAG,YAAY,GAAG,kBAAkB,EACpE,mBAAmB,EAAE,MAAM,GAAG,MAAM,GAAG,uBAAuB,EAC9D,YAAY,sBAAe,GAC1B,YAAY;WA2BD,yBAAyB,CACrC,mBAAmB,EAAE,MAAM,GAAG,MAAM,GAAG,uBAAuB,EAC9D,QAAQ,CAAC,EAAE,uBAAuB,GACjC,uBAAuB;CAiB3B"} \ No newline at end of file diff --git a/types/providers/ProviderInterface.d.ts b/types/providers/ProviderInterface.d.ts new file mode 100644 index 0000000..1664af7 --- /dev/null +++ b/types/providers/ProviderInterface.d.ts @@ -0,0 +1,17 @@ +import { ExternalLoaderParams } from "ExternalURILoader"; +import Geocoded from "Geocoded"; +import { GeocodeQuery, GeocodeQueryObject, ReverseQuery, ReverseQueryObject } from "query"; +export declare const DEFAULT_RESULT_LIMIT = 5; +export declare const defaultProviderOptions: ProviderOptionsInterface; +export interface ProviderOptionsInterface { + readonly useSsl: boolean; + readonly useJsonp: boolean; + readonly apiKey?: string; +} +export declare type GeocodedResultsCallback = (results: Geocoded[]) => void; +export default interface ProviderInterface { + geocode(query: string | GeocodeQuery | GeocodeQueryObject, callback: GeocodedResultsCallback): void; + geodecode(latitudeOrQuery: number | string | ReverseQuery | ReverseQueryObject, longitudeOrCallback: number | string | GeocodedResultsCallback, callback?: GeocodedResultsCallback): void; + executeRequest(params: ExternalLoaderParams, callback: GeocodedResultsCallback): void; +} +//# sourceMappingURL=ProviderInterface.d.ts.map \ No newline at end of file diff --git a/types/providers/ProviderInterface.d.ts.map b/types/providers/ProviderInterface.d.ts.map new file mode 100644 index 0000000..ac42e1a --- /dev/null +++ b/types/providers/ProviderInterface.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ProviderInterface.d.ts","sourceRoot":"","sources":["../../src/providers/ProviderInterface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,QAAQ,MAAM,UAAU,CAAC;AAChC,OAAO,EACL,YAAY,EACZ,kBAAkB,EAClB,YAAY,EACZ,kBAAkB,EACnB,MAAM,OAAO,CAAC;AAEf,eAAO,MAAM,oBAAoB,IAAI,CAAC;AAEtC,eAAO,MAAM,sBAAsB,EAAE,wBAGpC,CAAC;AAEF,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IACzB,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,oBAAY,uBAAuB,GAAG,CAAC,OAAO,EAAE,QAAQ,EAAE,KAAK,IAAI,CAAC;AAEpE,MAAM,CAAC,OAAO,WAAW,iBAAiB;IACxC,OAAO,CACL,KAAK,EAAE,MAAM,GAAG,YAAY,GAAG,kBAAkB,EACjD,QAAQ,EAAE,uBAAuB,GAChC,IAAI,CAAC;IACR,SAAS,CACP,eAAe,EAAE,MAAM,GAAG,MAAM,GAAG,YAAY,GAAG,kBAAkB,EACpE,mBAAmB,EAAE,MAAM,GAAG,MAAM,GAAG,uBAAuB,EAC9D,QAAQ,CAAC,EAAE,uBAAuB,GACjC,IAAI,CAAC;IACR,cAAc,CACZ,MAAM,EAAE,oBAAoB,EAC5B,QAAQ,EAAE,uBAAuB,GAChC,IAAI,CAAC;CACT"} \ No newline at end of file diff --git a/types/providers/YandexProvider.d.ts b/types/providers/YandexProvider.d.ts new file mode 100644 index 0000000..7e803d8 --- /dev/null +++ b/types/providers/YandexProvider.d.ts @@ -0,0 +1,67 @@ +import { ExternalLoaderInterface, ExternalLoaderParams } from "ExternalURILoader"; +import { GeocodedResultsCallback, ProviderInterface, ProviderOptionsInterface } from "providers"; +import Geocoded from "Geocoded"; +import { GeocodeQuery, GeocodeQueryObject, ReverseQuery, ReverseQueryObject } from "query"; +export interface YandexResult { + metaDataProperty: { + GeocoderMetaData: { + kind: string; + text: string; + precision: string; + AddressDetails: { + Country: { + AddressLine: string; + CountryNameCode: string; + CountryName: string; + AdministrativeArea?: { + AdministrativeAreaName: string; + SubAdministrativeArea?: { + SubAdministrativeAreaName: string; + Locality?: { + LocalityName: string; + Thoroughfare?: { + ThoroughfareName: string; + Premise: { + PremiseNumber: string; + }; + }; + }; + }; + }; + }; + }; + }; + }; + description: string; + name: string; + boundedBy: { + Envelope: { + lowerCorner: string; + upperCorner: string; + }; + }; + Point: { + pos: string; + }; +} +interface YandexProviderOptionsInterface extends ProviderOptionsInterface { + readonly lang: string; +} +export declare const defaultYandexProviderOptions: { + lang: string; + useSsl: boolean; + useJsonp: boolean; + apiKey?: string | undefined; +}; +export default class YandexProvider implements ProviderInterface { + private externalLoader; + private options; + constructor(_externalLoader: ExternalLoaderInterface, options?: YandexProviderOptionsInterface); + geocode(query: string | GeocodeQuery | GeocodeQueryObject, callback: GeocodedResultsCallback): void; + geodecode(latitudeOrQuery: number | string | ReverseQuery | ReverseQueryObject, longitudeOrCallback: number | string | GeocodedResultsCallback, callback?: GeocodedResultsCallback): void; + executeRequest(params: ExternalLoaderParams, callback: GeocodedResultsCallback): void; + static mapToGeocoded(result: YandexResult): Geocoded; + private static flattenObject; +} +export {}; +//# sourceMappingURL=YandexProvider.d.ts.map \ No newline at end of file diff --git a/types/providers/YandexProvider.d.ts.map b/types/providers/YandexProvider.d.ts.map new file mode 100644 index 0000000..c33214b --- /dev/null +++ b/types/providers/YandexProvider.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"YandexProvider.d.ts","sourceRoot":"","sources":["../../src/providers/YandexProvider.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EACvB,oBAAoB,EACrB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,uBAAuB,EAEvB,iBAAiB,EACjB,wBAAwB,EAEzB,MAAM,WAAW,CAAC;AACnB,OAAO,QAAQ,MAAM,UAAU,CAAC;AAChC,OAAO,EACL,YAAY,EACZ,kBAAkB,EAClB,YAAY,EACZ,kBAAkB,EACnB,MAAM,OAAO,CAAC;AAef,MAAM,WAAW,YAAY;IAC3B,gBAAgB,EAAE;QAChB,gBAAgB,EAAE;YAChB,IAAI,EAAE,MAAM,CAAC;YACb,IAAI,EAAE,MAAM,CAAC;YACb,SAAS,EAAE,MAAM,CAAC;YAClB,cAAc,EAAE;gBACd,OAAO,EAAE;oBACP,WAAW,EAAE,MAAM,CAAC;oBACpB,eAAe,EAAE,MAAM,CAAC;oBACxB,WAAW,EAAE,MAAM,CAAC;oBACpB,kBAAkB,CAAC,EAAE;wBACnB,sBAAsB,EAAE,MAAM,CAAC;wBAC/B,qBAAqB,CAAC,EAAE;4BACtB,yBAAyB,EAAE,MAAM,CAAC;4BAClC,QAAQ,CAAC,EAAE;gCACT,YAAY,EAAE,MAAM,CAAC;gCACrB,YAAY,CAAC,EAAE;oCACb,gBAAgB,EAAE,MAAM,CAAC;oCACzB,OAAO,EAAE;wCACP,aAAa,EAAE,MAAM,CAAC;qCACvB,CAAC;iCACH,CAAC;6BACH,CAAC;yBACH,CAAC;qBACH,CAAC;iBACH,CAAC;aACH,CAAC;SACH,CAAC;KACH,CAAC;IACF,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE;QACT,QAAQ,EAAE;YACR,WAAW,EAAE,MAAM,CAAC;YACpB,WAAW,EAAE,MAAM,CAAC;SACrB,CAAC;KACH,CAAC;IACF,KAAK,EAAE;QACL,GAAG,EAAE,MAAM,CAAC;KACb,CAAC;CACH;AAYD,UAAU,8BAA+B,SAAQ,wBAAwB;IACvE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED,eAAO,MAAM,4BAA4B;;;;;CAGxC,CAAC;AAEF,MAAM,CAAC,OAAO,OAAO,cAAe,YAAW,iBAAiB;IAC9D,OAAO,CAAC,cAAc,CAA0B;IAEhD,OAAO,CAAC,OAAO,CAAiC;gBAG9C,eAAe,EAAE,uBAAuB,EACxC,OAAO,GAAE,8BAA6D;IAMjE,OAAO,CACZ,KAAK,EAAE,MAAM,GAAG,YAAY,GAAG,kBAAkB,EACjD,QAAQ,EAAE,uBAAuB,GAChC,IAAI;IAoBA,SAAS,CACd,eAAe,EAAE,MAAM,GAAG,MAAM,GAAG,YAAY,GAAG,kBAAkB,EACpE,mBAAmB,EAAE,MAAM,GAAG,MAAM,GAAG,uBAAuB,EAC9D,QAAQ,CAAC,EAAE,uBAAuB,GACjC,IAAI;IA6BA,cAAc,CACnB,MAAM,EAAE,oBAAoB,EAC5B,QAAQ,EAAE,uBAAuB,GAChC,IAAI;WAWO,aAAa,CAAC,MAAM,EAAE,YAAY,GAAG,QAAQ;IAyC3D,OAAO,CAAC,MAAM,CAAC,aAAa;CA+B7B"} \ No newline at end of file diff --git a/types/providers/index.d.ts b/types/providers/index.d.ts new file mode 100644 index 0000000..6fd840a --- /dev/null +++ b/types/providers/index.d.ts @@ -0,0 +1,15 @@ +export { default as ProviderHelpers } from "providers/ProviderHelpers"; +export { default as ProviderInterface } from "providers/ProviderInterface"; +export * from "providers/ProviderInterface"; +export { default as BingProvider } from "providers/BingProvider"; +export * from "providers/BingProvider"; +export { default as GoogleAPIProvider } from "providers/GoogleAPIProvider"; +export * from "providers/GoogleAPIProvider"; +export * from "providers/mapbox"; +export { default as MapquestProvider } from "providers/MapquestProvider"; +export * from "providers/MapquestProvider"; +export { default as OpenStreetMapProvider } from "providers/OpenStreetMapProvider"; +export * from "providers/OpenStreetMapProvider"; +export { default as YandexProvider } from "providers/YandexProvider"; +export * from "providers/YandexProvider"; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/types/providers/index.d.ts.map b/types/providers/index.d.ts.map new file mode 100644 index 0000000..5be1593 --- /dev/null +++ b/types/providers/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/providers/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,2BAA2B,CAAC;AACvE,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAC3E,cAAc,6BAA6B,CAAC;AAC5C,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACjE,cAAc,wBAAwB,CAAC;AACvC,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAC3E,cAAc,6BAA6B,CAAC;AAC5C,cAAc,kBAAkB,CAAC;AACjC,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AACzE,cAAc,4BAA4B,CAAC;AAC3C,OAAO,EAAE,OAAO,IAAI,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AACnF,cAAc,iCAAiC,CAAC;AAChD,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,0BAA0B,CAAC;AACrE,cAAc,0BAA0B,CAAC"} \ No newline at end of file diff --git a/types/providers/mapbox/MapboxGeocodeQuery.d.ts b/types/providers/mapbox/MapboxGeocodeQuery.d.ts new file mode 100644 index 0000000..e6ce14b --- /dev/null +++ b/types/providers/mapbox/MapboxGeocodeQuery.d.ts @@ -0,0 +1,13 @@ +import { GeocodeQuery, GeocodeQueryObject } from "query"; +export interface MapboxGeocodeQueryObject extends GeocodeQueryObject { + readonly locationTypes?: string[]; +} +export default class MapboxGeocodeQuery extends GeocodeQuery { + private readonly locationTypes?; + protected constructor({ locationTypes, ...geocodeQueryObject }: MapboxGeocodeQueryObject); + static create(object: MapboxGeocodeQueryObject): MapboxGeocodeQuery; + toObject(): MapboxGeocodeQueryObject; + withLocationTypes(locationTypes: string[]): MapboxGeocodeQuery; + getLocationTypes(): undefined | string[]; +} +//# sourceMappingURL=MapboxGeocodeQuery.d.ts.map \ No newline at end of file diff --git a/types/providers/mapbox/MapboxGeocodeQuery.d.ts.map b/types/providers/mapbox/MapboxGeocodeQuery.d.ts.map new file mode 100644 index 0000000..a3c6079 --- /dev/null +++ b/types/providers/mapbox/MapboxGeocodeQuery.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"MapboxGeocodeQuery.d.ts","sourceRoot":"","sources":["../../../src/providers/mapbox/MapboxGeocodeQuery.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,OAAO,CAAC;AAEzD,MAAM,WAAW,wBAAyB,SAAQ,kBAAkB;IAClE,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;CACnC;AAED,MAAM,CAAC,OAAO,OAAO,kBAAmB,SAAQ,YAAY;IAC1D,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAW;IAE1C,SAAS,aAAa,EACpB,aAAa,EACb,GAAG,kBAAkB,EACtB,EAAE,wBAAwB;WAKb,MAAM,CAAC,MAAM,EAAE,wBAAwB,GAAG,kBAAkB;IAInE,QAAQ,IAAI,wBAAwB;IAOpC,iBAAiB,CAAC,aAAa,EAAE,MAAM,EAAE,GAAG,kBAAkB;IAI9D,gBAAgB,IAAI,SAAS,GAAG,MAAM,EAAE;CAGhD"} \ No newline at end of file diff --git a/types/providers/mapbox/MapboxProvider.d.ts b/types/providers/mapbox/MapboxProvider.d.ts new file mode 100644 index 0000000..9dca18f --- /dev/null +++ b/types/providers/mapbox/MapboxProvider.d.ts @@ -0,0 +1,68 @@ +import { ExternalLoaderInterface, ExternalLoaderParams } from "ExternalURILoader"; +import { GeocodedResultsCallback, MapboxGeocodeQuery, MapboxGeocodeQueryObject, MapboxReverseQuery, MapboxReverseQueryObject, ProviderInterface, ProviderOptionsInterface } from "providers"; +import Geocoded from "Geocoded"; +interface MapboxFeatureContextProperties { + id: string; + text: string; + wikidata?: string; + short_code?: string; +} +interface MapboxFeatureProperties { + accuracy?: string; + address?: string; + category?: string; + maki?: string; + wikidata?: string; + short_code?: string; +} +export interface MapboxResult { + id: string; + type: "Feature"; + place_type: ("country" | "region" | "postcode" | "district" | "place" | "locality" | "neighborhood" | "address" | "poi")[]; + relevance: number; + address?: string; + properties: MapboxFeatureProperties; + text: string; + place_name: string; + matching_text?: string; + matching_place_name?: string; + language?: string; + bbox?: [number, number, number, number]; + center: [number, number]; + geometry: { + type: "Point"; + coordinates: [number, number]; + }; + context?: MapboxFeatureContextProperties[]; + routable_points?: { + points?: { + coordinates: [number, number]; + }[]; + }; +} +export declare enum GEOCODING_MODES { + GEOCODING_MODE_PLACES = "mapbox.places", + GEOCODING_MODE_PLACES_PERMANENT = "mapbox.places-permanent" +} +interface MapboxProviderOptionsInterface extends ProviderOptionsInterface { + readonly geocodingMode: GEOCODING_MODES; + readonly country?: string; + readonly language?: string; +} +export declare const defaultMapboxProviderOptions: { + geocodingMode: GEOCODING_MODES; + useSsl: boolean; + useJsonp: boolean; + apiKey?: string | undefined; +}; +export default class MapboxProvider implements ProviderInterface { + private externalLoader; + private options; + constructor(_externalLoader: ExternalLoaderInterface, options?: MapboxProviderOptionsInterface); + geocode(query: string | MapboxGeocodeQuery | MapboxGeocodeQueryObject, callback: GeocodedResultsCallback): void; + geodecode(latitudeOrQuery: number | string | MapboxReverseQuery | MapboxReverseQueryObject, longitudeOrCallback: number | string | GeocodedResultsCallback, callback?: GeocodedResultsCallback): void; + executeRequest(params: ExternalLoaderParams, callback: GeocodedResultsCallback): void; + static mapToGeocoded(result: MapboxResult): Geocoded; +} +export {}; +//# sourceMappingURL=MapboxProvider.d.ts.map \ No newline at end of file diff --git a/types/providers/mapbox/MapboxProvider.d.ts.map b/types/providers/mapbox/MapboxProvider.d.ts.map new file mode 100644 index 0000000..fda6333 --- /dev/null +++ b/types/providers/mapbox/MapboxProvider.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"MapboxProvider.d.ts","sourceRoot":"","sources":["../../../src/providers/mapbox/MapboxProvider.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EACvB,oBAAoB,EACrB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,uBAAuB,EACvB,kBAAkB,EAClB,wBAAwB,EACxB,kBAAkB,EAClB,wBAAwB,EAExB,iBAAiB,EACjB,wBAAwB,EAEzB,MAAM,WAAW,CAAC;AACnB,OAAO,QAAQ,MAAM,UAAU,CAAC;AAahC,UAAU,8BAA8B;IACtC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,UAAU,uBAAuB;IAC/B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,SAAS,CAAC;IAEhB,UAAU,EAAE,CACR,SAAS,GACT,QAAQ,GACR,UAAU,GACV,UAAU,GACV,OAAO,GACP,UAAU,GACV,cAAc,GACd,SAAS,GACT,KAAK,CACR,EAAE,CAAC;IACJ,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,uBAAuB,CAAC;IACpC,IAAI,EAAE,MAAM,CAAC;IAEb,UAAU,EAAE,MAAM,CAAC;IAEnB,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IACxC,MAAM,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACzB,QAAQ,EAAE;QACR,IAAI,EAAE,OAAO,CAAC;QACd,WAAW,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;KAC/B,CAAC;IACF,OAAO,CAAC,EAAE,8BAA8B,EAAE,CAAC;IAE3C,eAAe,CAAC,EAAE;QAChB,MAAM,CAAC,EAAE;YACP,WAAW,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;SAC/B,EAAE,CAAC;KACL,CAAC;CACH;AAED,oBAAY,eAAe;IACzB,qBAAqB,kBAAkB;IACvC,+BAA+B,4BAA4B;CAC5D;AAED,UAAU,8BAA+B,SAAQ,wBAAwB;IACvE,QAAQ,CAAC,aAAa,EAAE,eAAe,CAAC;IACxC,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED,eAAO,MAAM,4BAA4B;;;;;CAGxC,CAAC;AAEF,MAAM,CAAC,OAAO,OAAO,cAAe,YAAW,iBAAiB;IAC9D,OAAO,CAAC,cAAc,CAA0B;IAEhD,OAAO,CAAC,OAAO,CAAiC;gBAG9C,eAAe,EAAE,uBAAuB,EACxC,OAAO,GAAE,8BAA6D;IAWjE,OAAO,CACZ,KAAK,EAAE,MAAM,GAAG,kBAAkB,GAAG,wBAAwB,EAC7D,QAAQ,EAAE,uBAAuB,GAChC,IAAI;IAkCA,SAAS,CACd,eAAe,EACX,MAAM,GACN,MAAM,GACN,kBAAkB,GAClB,wBAAwB,EAC5B,mBAAmB,EAAE,MAAM,GAAG,MAAM,GAAG,uBAAuB,EAC9D,QAAQ,CAAC,EAAE,uBAAuB,GACjC,IAAI;IAgCA,cAAc,CACnB,MAAM,EAAE,oBAAoB,EAC5B,QAAQ,EAAE,uBAAuB,GAChC,IAAI;WAUO,aAAa,CAAC,MAAM,EAAE,YAAY,GAAG,QAAQ;CAwD5D"} \ No newline at end of file diff --git a/types/providers/mapbox/MapboxReverseQuery.d.ts b/types/providers/mapbox/MapboxReverseQuery.d.ts new file mode 100644 index 0000000..35c1d5f --- /dev/null +++ b/types/providers/mapbox/MapboxReverseQuery.d.ts @@ -0,0 +1,13 @@ +import { ReverseQuery, ReverseQueryObject } from "query"; +export interface MapboxReverseQueryObject extends ReverseQueryObject { + readonly locationTypes?: string[]; +} +export default class MapboxReverseQuery extends ReverseQuery { + private readonly locationTypes?; + protected constructor({ locationTypes, ...reverseQueryObject }: MapboxReverseQueryObject); + static create(object: MapboxReverseQueryObject): MapboxReverseQuery; + toObject(): MapboxReverseQueryObject; + withLocationTypes(locationTypes: string[]): MapboxReverseQuery; + getLocationTypes(): undefined | string[]; +} +//# sourceMappingURL=MapboxReverseQuery.d.ts.map \ No newline at end of file diff --git a/types/providers/mapbox/MapboxReverseQuery.d.ts.map b/types/providers/mapbox/MapboxReverseQuery.d.ts.map new file mode 100644 index 0000000..9edc070 --- /dev/null +++ b/types/providers/mapbox/MapboxReverseQuery.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"MapboxReverseQuery.d.ts","sourceRoot":"","sources":["../../../src/providers/mapbox/MapboxReverseQuery.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,OAAO,CAAC;AAEzD,MAAM,WAAW,wBAAyB,SAAQ,kBAAkB;IAClE,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;CACnC;AAED,MAAM,CAAC,OAAO,OAAO,kBAAmB,SAAQ,YAAY;IAC1D,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAW;IAE1C,SAAS,aAAa,EACpB,aAAa,EACb,GAAG,kBAAkB,EACtB,EAAE,wBAAwB;WAKb,MAAM,CAAC,MAAM,EAAE,wBAAwB,GAAG,kBAAkB;IAInE,QAAQ,IAAI,wBAAwB;IAOpC,iBAAiB,CAAC,aAAa,EAAE,MAAM,EAAE,GAAG,kBAAkB;IAI9D,gBAAgB,IAAI,SAAS,GAAG,MAAM,EAAE;CAGhD"} \ No newline at end of file diff --git a/types/providers/mapbox/index.d.ts b/types/providers/mapbox/index.d.ts new file mode 100644 index 0000000..ece31fe --- /dev/null +++ b/types/providers/mapbox/index.d.ts @@ -0,0 +1,7 @@ +export { default as MapboxGeocodeQuery } from "providers/mapbox/MapboxGeocodeQuery"; +export * from "providers/mapbox/MapboxGeocodeQuery"; +export { default as MapboxProvider } from "providers/mapbox/MapboxProvider"; +export * from "providers/mapbox/MapboxProvider"; +export { default as MapboxReverseQuery } from "providers/mapbox/MapboxReverseQuery"; +export * from "providers/mapbox/MapboxReverseQuery"; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/types/providers/mapbox/index.d.ts.map b/types/providers/mapbox/index.d.ts.map new file mode 100644 index 0000000..78039bd --- /dev/null +++ b/types/providers/mapbox/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/providers/mapbox/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AACpF,cAAc,qCAAqC,CAAC;AACpD,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAC5E,cAAc,iCAAiC,CAAC;AAChD,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AACpF,cAAc,qCAAqC,CAAC"} \ No newline at end of file diff --git a/types/query/GeocodeQuery.d.ts b/types/query/GeocodeQuery.d.ts new file mode 100644 index 0000000..3da0dfa --- /dev/null +++ b/types/query/GeocodeQuery.d.ts @@ -0,0 +1,34 @@ +import { PartialSome } from "types"; +import { Bounds } from "index"; +declare type GeocodeQueryObjectCreate = PartialSome; +export interface GeocodeQueryObject { + readonly text: string; + readonly south?: number | string; + readonly west?: number | string; + readonly north?: number | string; + readonly east?: number | string; + readonly locale?: string; + readonly limit: number; +} +export default class GeocodeQuery { + private readonly text; + private readonly south?; + private readonly west?; + private readonly north?; + private readonly east?; + private readonly locale?; + private readonly limit; + protected constructor({ text, south, west, north, east, locale, limit, }: GeocodeQueryObjectCreate); + static create(object: GeocodeQueryObjectCreate): GeocodeQuery; + toObject(): GeocodeQueryObject; + withText(text: string): GeocodeQuery; + withBounds(south?: number, west?: number, north?: number, east?: number): GeocodeQuery; + withLocale(locale: string): GeocodeQuery; + withLimit(limit: number): GeocodeQuery; + getText(): string; + getBounds(): undefined | Bounds; + getLocale(): undefined | string; + getLimit(): number; +} +export {}; +//# sourceMappingURL=GeocodeQuery.d.ts.map \ No newline at end of file diff --git a/types/query/GeocodeQuery.d.ts.map b/types/query/GeocodeQuery.d.ts.map new file mode 100644 index 0000000..a5c78c9 --- /dev/null +++ b/types/query/GeocodeQuery.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"GeocodeQuery.d.ts","sourceRoot":"","sources":["../../src/query/GeocodeQuery.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACpC,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAE/B,aAAK,wBAAwB,GAAG,WAAW,CAAC,kBAAkB,EAAE,OAAO,CAAC,CAAC;AAEzE,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACjC,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAChC,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACjC,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAChC,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,CAAC,OAAO,OAAO,YAAY;IAC/B,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAS;IAE9B,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAkB;IAEzC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAkB;IAExC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAkB;IAEzC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAkB;IAExC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAS;IAEjC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAgC;IAEtD,SAAS,aAAa,EACpB,IAAI,EACJ,KAAK,EACL,IAAI,EACJ,KAAK,EACL,IAAI,EACJ,MAAM,EACN,KAA4B,GAC7B,EAAE,wBAAwB;WAUb,MAAM,CAAC,MAAM,EAAE,wBAAwB,GAAG,YAAY;IAI7D,QAAQ,IAAI,kBAAkB;IAY9B,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,YAAY;IAIpC,UAAU,CACf,KAAK,CAAC,EAAE,MAAM,EACd,IAAI,CAAC,EAAE,MAAM,EACb,KAAK,CAAC,EAAE,MAAM,EACd,IAAI,CAAC,EAAE,MAAM,GACZ,YAAY;IAUR,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY;IAIxC,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,YAAY;IAItC,OAAO,IAAI,MAAM;IAIjB,SAAS,IAAI,SAAS,GAAG,MAAM;IAa/B,SAAS,IAAI,SAAS,GAAG,MAAM;IAI/B,QAAQ,IAAI,MAAM;CAG1B"} \ No newline at end of file diff --git a/types/query/ReverseQuery.d.ts b/types/query/ReverseQuery.d.ts new file mode 100644 index 0000000..2d719b4 --- /dev/null +++ b/types/query/ReverseQuery.d.ts @@ -0,0 +1,26 @@ +import { PartialSome } from "types"; +import { Coordinates } from "index"; +declare type ReverseQueryObjectCreate = PartialSome; +export interface ReverseQueryObject { + readonly latitude: number | string; + readonly longitude: number | string; + readonly locale?: string; + readonly limit: number; +} +export default class ReverseQuery { + private readonly latitude; + private readonly longitude; + private readonly locale?; + private readonly limit; + protected constructor({ latitude, longitude, locale, limit, }: ReverseQueryObjectCreate); + static create(object: ReverseQueryObjectCreate): ReverseQuery; + toObject(): ReverseQueryObject; + withCoordinates(latitude: number, longitude: number): ReverseQuery; + withLocale(locale: string): ReverseQuery; + withLimit(limit: number): ReverseQuery; + getCoordinates(): Coordinates; + getLocale(): undefined | string; + getLimit(): number; +} +export {}; +//# sourceMappingURL=ReverseQuery.d.ts.map \ No newline at end of file diff --git a/types/query/ReverseQuery.d.ts.map b/types/query/ReverseQuery.d.ts.map new file mode 100644 index 0000000..f1662a4 --- /dev/null +++ b/types/query/ReverseQuery.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ReverseQuery.d.ts","sourceRoot":"","sources":["../../src/query/ReverseQuery.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAEpC,aAAK,wBAAwB,GAAG,WAAW,CAAC,kBAAkB,EAAE,OAAO,CAAC,CAAC;AAEzE,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAAC;IACnC,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAAC;IACpC,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,CAAC,OAAO,OAAO,YAAY;IAC/B,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAkB;IAE3C,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAkB;IAE5C,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAS;IAEjC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAgC;IAEtD,SAAS,aAAa,EACpB,QAAQ,EACR,SAAS,EACT,MAAM,EACN,KAA4B,GAC7B,EAAE,wBAAwB;WAOb,MAAM,CAAC,MAAM,EAAE,wBAAwB,GAAG,YAAY;IAI7D,QAAQ,IAAI,kBAAkB;IAS9B,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,YAAY;IAQlE,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY;IAIxC,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,YAAY;IAItC,cAAc,IAAI,WAAW;IAI7B,SAAS,IAAI,SAAS,GAAG,MAAM;IAI/B,QAAQ,IAAI,MAAM;CAG1B"} \ No newline at end of file diff --git a/types/query/index.d.ts b/types/query/index.d.ts new file mode 100644 index 0000000..b0268c3 --- /dev/null +++ b/types/query/index.d.ts @@ -0,0 +1,5 @@ +export { default as GeocodeQuery } from "query/GeocodeQuery"; +export * from "query/GeocodeQuery"; +export { default as ReverseQuery } from "query/ReverseQuery"; +export * from "query/ReverseQuery"; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/types/query/index.d.ts.map b/types/query/index.d.ts.map new file mode 100644 index 0000000..07911a4 --- /dev/null +++ b/types/query/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/query/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAC7D,cAAc,oBAAoB,CAAC;AACnC,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAC7D,cAAc,oBAAoB,CAAC"} \ No newline at end of file diff --git a/types/types.d.ts b/types/types.d.ts new file mode 100644 index 0000000..c93503a --- /dev/null +++ b/types/types.d.ts @@ -0,0 +1,4 @@ +export declare type PartialSome, R = { + [K in P]?: O[P]; +}> = Q & R; +//# sourceMappingURL=types.d.ts.map \ No newline at end of file diff --git a/types/types.d.ts.map b/types/types.d.ts.map new file mode 100644 index 0000000..6b251ee --- /dev/null +++ b/types/types.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,oBAAY,WAAW,CACrB,CAAC,EACD,CAAC,SAAS,MAAM,CAAC,EACjB,CAAC,GAAG,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,EACd,CAAC,GAAG;KAAG,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;CAAE,IACrB,CAAC,GAAG,CAAC,CAAC"} \ No newline at end of file diff --git a/webpack.common.js b/webpack.common.js new file mode 100644 index 0000000..207b264 --- /dev/null +++ b/webpack.common.js @@ -0,0 +1,21 @@ +const path = require("path"); + +module.exports = { + entry: ["./src/index.ts", "./src/global.ts"], + module: { + rules: [ + { + test: /\.ts$/, + use: "ts-loader", + exclude: /node_modules/, + }, + ], + }, + resolve: { + extensions: [".ts"], + modules: [path.resolve(__dirname, "src"), "node_modules"], + }, + output: { + path: path.resolve(__dirname, "dist"), + }, +}; diff --git a/webpack.dev.js b/webpack.dev.js new file mode 100644 index 0000000..390d492 --- /dev/null +++ b/webpack.dev.js @@ -0,0 +1,10 @@ +const merge = require("webpack-merge"); +const common = require("./webpack.common.js"); + +module.exports = merge(common, { + devtool: "inline-source-map", + mode: "development", + output: { + filename: "geocoder.js", + }, +}); diff --git a/webpack.prod.js b/webpack.prod.js new file mode 100644 index 0000000..2de46e3 --- /dev/null +++ b/webpack.prod.js @@ -0,0 +1,9 @@ +const merge = require("webpack-merge"); +const common = require("./webpack.common.js"); + +module.exports = merge(common, { + mode: "production", + output: { + filename: "geocoder.min.js", + }, +}); From 70dec6b668c6c40e701997c1388789cf84b65398 Mon Sep 17 00:00:00 2001 From: Alan Poulain Date: Sat, 4 Jul 2020 20:00:33 +0200 Subject: [PATCH 02/56] Universal Geocoder --- README.md | 34 +++++++++---------- example/bing.html | 6 ++-- example/google.html | 6 ++-- example/mapbox.html | 6 ++-- example/mapquest.html | 6 ++-- example/openstreetmap.html | 6 ++-- example/yandex.html | 6 ++-- package-lock.json | 2 +- package.json | 8 ++--- src/{GeocoderJS.ts => UniversalGeocoder.ts} | 2 +- src/global.ts | 8 ++--- src/index.ts | 2 +- types/GeocoderJS.d.ts.map | 1 - ...GeocoderJS.d.ts => UniversalGeocoder.d.ts} | 4 +-- types/UniversalGeocoder.d.ts.map | 1 + types/global.d.ts | 4 +-- types/global.d.ts.map | 2 +- types/index.d.ts | 2 +- types/index.d.ts.map | 2 +- webpack.dev.js | 2 +- webpack.prod.js | 2 +- 21 files changed, 56 insertions(+), 56 deletions(-) rename src/{GeocoderJS.ts => UniversalGeocoder.ts} (89%) delete mode 100644 types/GeocoderJS.d.ts.map rename types/{GeocoderJS.d.ts => UniversalGeocoder.d.ts} (74%) create mode 100644 types/UniversalGeocoder.d.ts.map diff --git a/README.md b/README.md index f69a575..b9df912 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,13 @@ -GeocoderJS -========== +Universal Geocoder +================== -[![Build Status](https://travis-ci.org/geocoder-php/geocoder-js.png?branch=master)](https://travis-ci.org/geocoder-php/geocoder-js) -[![Dependency Status](https://david-dm.org/geocoder-php/geocoder-js.png)](https://david-dm.org/geocoder-php/geocoder-js) -[![devDependency Status](https://david-dm.org/geocoder-php/geocoder-js/dev-status.png)](https://david-dm.org/geocoder-php/geocoder-js#info=devDependencies) +[![Build Status](https://travis-ci.com/alanpoulain/universal-geocoder.png?branch=main)](https://travis-ci.com/alanpoulain/universal-geocoder) -GeocoderJS is a universal JavaScript library for client-side geocoding applications with multiple built-in providers. +Universal Geocoder is a universal JavaScript library for client-side geocoding applications with multiple built-in providers. -It is a port of the [Geocoder PHP](https://geocoder-php.org/) library. +Need geocoding 🌍️ in your website or application? Don't want to be vendor-locked to a service? ✨️ Universal Geocoder ✨️ is for you! + +Universal Geocoder is a TypeScript fork of [GeocoderJS](https://github.com/geocoder-php/geocoder-js), itself a port of the [Geocoder PHP](https://geocoder-php.org/) library. This library is platform agnostic: it is available either server-side (Node) or client-side (browsers, React Native). @@ -17,7 +17,7 @@ Installation Add the library to your project: ```shell -npm install --save geocoder-js +npm install --save universal-geocoder ``` > ⚠️ **Warning**: If you need to use this library in an environment not supporting the Promise API such as Internet Explorer, you must install an ES6 Promise compatible polyfill like [es6-promise](https://github.com/jakearchibald/es6-promise). @@ -25,26 +25,26 @@ npm install --save geocoder-js Usage ----- -You can either use GeocoderJS as a module or as a direct dependency. +You can either use Universal Geocoder as a module or as a direct dependency. As a module: ```javascript -import GeocoderJS from "geocoder-js"; +import UniversalGeocoder from "universal-geocoder"; -const openStreetMapGeocoder = GeocoderJS.createGeocoder("openstreetmap"); +const openStreetMapGeocoder = UniversalGeocoder.createGeocoder("openstreetmap"); openStreetMapGeocoder.geocode("1600 Pennsylvania Ave NW, Washington, DC", (result) => { console.log(result); }); ``` -If you want to use the library as a direct dependecy, copy `dist/geocoder.js` or `dist/geocoder.min.js` to your dependencies. +If you want to use the library as a direct dependecy, copy `dist/universal-geocoder.js` or `dist/universal-geocoder.min.js` to your dependencies. -GeocoderJS will be available in the global environment: +Universal Geocoder will be available in the global environment: ```javascript -const openStreetMapGeocoder = GeocoderJS.createGeocoder("openstreetmap"); +const openStreetMapGeocoder = UniversalGeocoder.createGeocoder("openstreetmap"); openStreetMapGeocoder.geodecode("44.915", "-93.21", (result) => { console.log(result); @@ -54,9 +54,9 @@ openStreetMapGeocoder.geodecode("44.915", "-93.21", (result) => { For a more advanced usage, see the example below: ```javascript -import GeocoderJS, { ReverseQuery } from "geocoder-js"; +import UniversalGeocoder, { ReverseQuery } from "universal-geocoder"; -const googleGeocoder = GeocoderJS.createGeocoder({ +const googleGeocoder = UniversalGeocoder.createGeocoder({ provider: "google", apiKey: "YOUR_API_KEY", useSsl: true, @@ -87,7 +87,7 @@ googleGeocoder.geodecode(reverseQuery, (result) => { Providers --------- -GeocoderJS comes with modules to integrate with various geocoding providers. +Universal Geocoder comes with modules to integrate with various geocoding providers. The following table summarizes the features of each: diff --git a/example/bing.html b/example/bing.html index 10355ed..e163da3 100644 --- a/example/bing.html +++ b/example/bing.html @@ -1,10 +1,10 @@ - Geocoder.js: Bing Example - + Universal Geocoder: Bing Example + + Universal Geocoder: Google API Example + + Universal Geocoder: Mapbox Example + + Universal Geocoder: Mapquest Example + + Universal Geocoder: Nominatim Example + + Universal Geocoder: Yandex Example + diff --git a/package.json b/package.json index 8b95875..6055cab 100644 --- a/package.json +++ b/package.json @@ -10,8 +10,7 @@ "universal", "node", "browser", - "react", - "native" + "react-native" ], "license": "(MIT AND GPL-2.0)", "author": "Brandon Morrison ", @@ -56,7 +55,7 @@ "webpack-merge": "^4.2.0" }, "scripts": { - "build": "webpack --config webpack.dev.js && webpack --config webpack.prod.js && tsc", + "build": "rm -rf types && webpack --config webpack.dev.js && webpack --config webpack.prod.js && tsc", "lint": "eslint --fix --ext .ts .", "prepublish": "npm run build", "serve": "http-server", diff --git a/spec/GeoJSONDumper.spec.ts b/spec/GeoJSONDumper.spec.ts deleted file mode 100644 index 488e611..0000000 --- a/spec/GeoJSONDumper.spec.ts +++ /dev/null @@ -1,23 +0,0 @@ -import Geocoded from "Geocoded"; -import GeoJSONDumper, { GeoJson } from "GeoJSONDumper"; - -describe("GeoJSON Dumper", () => { - const geocoded = Geocoded.create({ - latitude: 38.8978378, - longitude: -77.0365123, - }); - const dumper = new GeoJSONDumper(); - - const expectedGeoJson: GeoJson = { - type: "Feature", - properties: {}, - geometry: { - type: "Point", - coordinates: [-77.0365123, 38.8978378], - }, - }; - - it("provides a valid geojson dump", () => { - expect(dumper.dump(geocoded)).toEqual(expectedGeoJson); - }); -}); diff --git a/spec/GeoJsonDumper.spec.ts b/spec/GeoJsonDumper.spec.ts new file mode 100644 index 0000000..21de6c1 --- /dev/null +++ b/spec/GeoJsonDumper.spec.ts @@ -0,0 +1,37 @@ +import Geocoded from "Geocoded"; +import GeoJsonDumper, { GeoJson } from "GeoJsonDumper"; + +describe("GeoJSON Dumper", () => { + const geocoded = Geocoded.create({ + latitude: 38.8978378, + longitude: -77.0365123, + south: 38.89380528242933, + west: -77.04317326462667, + north: 38.90153071757068, + east: -77.02993873537334, + formattedAddress: + "1600 Pennsylvania Avenue Northwest, Washington, DC 20050", + }); + + const expectedGeoJson: GeoJson = { + type: "Feature", + properties: { + formattedAddress: + "1600 Pennsylvania Avenue Northwest, Washington, DC 20050", + }, + geometry: { + type: "Point", + coordinates: [-77.0365123, 38.8978378], + }, + bounds: { + south: 38.89380528242933, + west: -77.04317326462667, + north: 38.90153071757068, + east: -77.02993873537334, + }, + }; + + it("provides a valid GeoJSON dump", () => { + expect(GeoJsonDumper.dump(geocoded)).toEqual(expectedGeoJson); + }); +}); diff --git a/spec/GeocoderProviderFactory.spec.ts b/spec/GeocoderProviderFactory.spec.ts index 69181a4..297129d 100644 --- a/spec/GeocoderProviderFactory.spec.ts +++ b/spec/GeocoderProviderFactory.spec.ts @@ -1,4 +1,7 @@ -import ProviderFactory from "GeocoderProviderFactory"; +import ProviderFactory, { + GeocoderProviderFactoryOptions, +} from "GeocoderProviderFactory"; +import { OpenStreetMapProviderOptionsInterface } from "providers"; describe("Geocoder Factory", () => { it("expects createProvider method to return undefined for an unregistered provider", () => { @@ -12,7 +15,9 @@ describe("Geocoder Factory", () => { }); it("expects createProvider method to return an OpenStreetMap Provider", () => { - const provider = ProviderFactory.createProvider("openstreetmap"); + const provider = ProviderFactory.createProvider(< + GeocoderProviderFactoryOptions & OpenStreetMapProviderOptionsInterface + >{ provider: "openstreetmap", userAgent: "Test User-Agent" }); expect(provider).toBeDefined(); }); }); diff --git a/spec/providers/OpenStreetMapProvider.spec.ts b/spec/providers/NominatimProvider.spec.ts similarity index 58% rename from spec/providers/OpenStreetMapProvider.spec.ts rename to spec/providers/NominatimProvider.spec.ts index ebe79b1..d3dac79 100644 --- a/spec/providers/OpenStreetMapProvider.spec.ts +++ b/spec/providers/NominatimProvider.spec.ts @@ -1,8 +1,13 @@ -import { OpenStreetMapProvider, OpenStreetMapResult } from "providers"; -import Geocoded from "Geocoded"; +import { + NominatimGeocoded, + OpenStreetMapProvider, + OpenStreetMapResult, +} from "providers"; +import ExternalURILoader from "ExternalURILoader"; +import AdminLevel from "AdminLevel"; -describe("OpenStreetMap Geocoder Provider raw result to Geocoded mapping", () => { - let geocoded: Geocoded; +describe("OpenStreetMap / Nominatim Geocoder Provider raw result to Geocoded mapping", () => { + let geocoded: NominatimGeocoded; const stubOpenStreetMapResult: OpenStreetMapResult[] = [ { @@ -21,7 +26,7 @@ describe("OpenStreetMap Geocoder Provider raw result to Geocoded mapping", () => lon: "-77.0365643605898", display_name: "The White House, 1600, Pennsylvania Avenue Northwest, Foggy Bottom, Farragut Square, Washington, District of Columbia, 20500, United States of America", - class: "tourism", + category: "tourism", type: "attraction", importance: 1.5076757387296, icon: @@ -45,10 +50,19 @@ describe("OpenStreetMap Geocoder Provider raw result to Geocoded mapping", () => geocoded = OpenStreetMapProvider.mapToGeocoded(stubOpenStreetMapResult[0]); }); - it("receives results from the OpenStreetMap geocoder", () => { + it("receives results from the OpenStreetMap / Nominatim geocoder", () => { expect(geocoded).toBeDefined(); }); + it("expects User-Agent to be required on initiation", () => { + expect( + () => new OpenStreetMapProvider(new ExternalURILoader()) + ).toThrowError( + Error, + 'An User-Agent identifying your application is required for the OpenStreetMap / Nominatim provider when using the default host. Please add it in the "userAgent" option.' + ); + }); + it("maps coordinates correctly", () => { expect(geocoded.getCoordinates()).toEqual([38.89770045, -77.0365643605898]); }); @@ -62,6 +76,12 @@ describe("OpenStreetMap Geocoder Provider raw result to Geocoded mapping", () => ]); }); + it("maps display name correctly", () => { + expect(geocoded.getDisplayName()).toEqual( + "The White House, 1600, Pennsylvania Avenue Northwest, Foggy Bottom, Farragut Square, Washington, District of Columbia, 20500, United States of America" + ); + }); + it("maps street number correctly", () => { expect(geocoded.getStreetNumber()).toEqual("1600"); }); @@ -86,6 +106,12 @@ describe("OpenStreetMap Geocoder Provider raw result to Geocoded mapping", () => expect(geocoded.getRegion()).toEqual("District of Columbia"); }); + it("maps admin levels correctly", () => { + expect(geocoded.getAdminLevels()).toEqual([ + AdminLevel.create({ level: 1, name: "District of Columbia" }), + ]); + }); + it("maps country correctly", () => { expect(geocoded.getCountry()).toEqual("United States of America"); }); @@ -93,4 +119,26 @@ describe("OpenStreetMap Geocoder Provider raw result to Geocoded mapping", () => it("maps country code correctly", () => { expect(geocoded.getCountryCode()).toEqual("us"); }); + + it("maps OSM id correctly", () => { + expect(geocoded.getOsmId()).toEqual(238241022); + }); + + it("maps OSM type correctly", () => { + expect(geocoded.getOsmType()).toEqual("way"); + }); + + it("maps category correctly", () => { + expect(geocoded.getCategory()).toEqual("tourism"); + }); + + it("maps type correctly", () => { + expect(geocoded.getType()).toEqual("attraction"); + }); + + it("maps attribution correctly", () => { + expect(geocoded.getAttribution()).toEqual( + "Data © OpenStreetMap contributors, ODbL 1.0. http://www.openstreetmap.org/copyright" + ); + }); }); diff --git a/src/AdminLevel.ts b/src/AdminLevel.ts new file mode 100644 index 0000000..bb34d87 --- /dev/null +++ b/src/AdminLevel.ts @@ -0,0 +1,43 @@ +export interface AdminLevelObject { + readonly level: number; + readonly name: string; + readonly code?: string; +} + +export default class AdminLevel { + private readonly level: number; + + private readonly name: string; + + private readonly code?: string; + + private constructor({ level, name, code }: AdminLevelObject) { + this.level = level; + this.name = name; + this.code = code; + } + + public static create(object: AdminLevelObject): AdminLevel { + return new this(object); + } + + public toObject(): AdminLevelObject { + return { + level: this.level, + name: this.name, + code: this.code, + }; + } + + public getLevel(): number { + return this.level; + } + + public getName(): string { + return this.name; + } + + public getCode(): undefined | string { + return this.code; + } +} diff --git a/src/ExternalURILoader.ts b/src/ExternalURILoader.ts index c100879..032069a 100644 --- a/src/ExternalURILoader.ts +++ b/src/ExternalURILoader.ts @@ -4,14 +4,15 @@ export interface ExternalLoaderInterface { setOptions(options: ExternalLoaderOptions): void; executeRequest( params: ExternalLoaderParams, - callback: ResponseCallback + callback: ResponseCallback, + headers?: ExternalLoaderHeaders ): void; } export interface ExternalLoaderOptions { - readonly protocol: null | string; - readonly host: null | string; - readonly pathname: null | string; + readonly protocol: string; + readonly host?: string; + readonly pathname?: string; } export interface ExternalLoaderParams { @@ -19,13 +20,15 @@ export interface ExternalLoaderParams { JSONPCallback?: string; } +export interface ExternalLoaderHeaders { + [header: string]: string; +} + // eslint-disable-next-line @typescript-eslint/no-explicit-any type ResponseCallback = (response: any) => void; const defaultOptions: ExternalLoaderOptions = { - protocol: null, - host: null, - pathname: null, + protocol: "http", }; /** @@ -44,8 +47,16 @@ export default class ExternalURILoader implements ExternalLoaderInterface { public executeRequest( params: ExternalLoaderParams, - callback: ResponseCallback + callback: ResponseCallback, + externalLoaderHeaders?: ExternalLoaderHeaders ): void { + if (!this.options.host) { + throw new Error("A host is required for the external URI loader."); + } + if (!this.options.pathname) { + throw new Error("A pathname is required for the external URI loader."); + } + const requestUrl = new URL( `${this.options.protocol}://${this.options.host}/${this.options.pathname}` ); @@ -67,7 +78,10 @@ export default class ExternalURILoader implements ExternalLoaderInterface { return; } - fetch(requestUrl.toString()) + const headers = externalLoaderHeaders || {}; + fetch(requestUrl.toString(), { + headers, + }) .then((response) => { if (!response.ok) { throw new Error( diff --git a/src/GeoJSONDumper.ts b/src/GeoJSONDumper.ts deleted file mode 100644 index 4468b84..0000000 --- a/src/GeoJSONDumper.ts +++ /dev/null @@ -1,31 +0,0 @@ -import Geocoded from "Geocoded"; - -export interface GeoJson { - type: "Feature"; - properties: Record; - geometry: { - type: "Point"; - coordinates: [number | undefined, number | undefined]; - }; -} - -export default class GeoJsonDumper { - private baseGeoJson: GeoJson = { - type: "Feature", - properties: {}, - geometry: { - type: "Point", - coordinates: [undefined, undefined], - }, - }; - - public dump(geocoded: Geocoded): GeoJson { - const result = this.baseGeoJson; - result.geometry.coordinates = [ - geocoded.getLongitude(), - geocoded.getLatitude(), - ]; - - return result; - } -} diff --git a/src/GeoJsonDumper.ts b/src/GeoJsonDumper.ts new file mode 100644 index 0000000..a086214 --- /dev/null +++ b/src/GeoJsonDumper.ts @@ -0,0 +1,85 @@ +import Geocoded from "Geocoded"; +import AdminLevel, { AdminLevelObject } from "AdminLevel"; + +export interface GeoJson { + readonly type: "Feature"; + readonly properties: { + readonly [property: string]: + | string + | number + | AdminLevel[] + | AdminLevelObject[] + | undefined; + }; + readonly geometry: { + readonly type: "Point"; + readonly coordinates: [number | undefined, number | undefined]; + }; + readonly bounds?: { + readonly south: number; + readonly west: number; + readonly north: number; + readonly east: number; + }; +} + +export default class GeoJsonDumper { + private static baseGeoJson: GeoJson = { + type: "Feature", + properties: {}, + geometry: { + type: "Point", + coordinates: [undefined, undefined], + }, + }; + + public static dump(geocoded: Geocoded): GeoJson { + let result = GeoJsonDumper.baseGeoJson; + result = { + ...result, + ...{ + geometry: { + ...result.geometry, + coordinates: [geocoded.getLongitude(), geocoded.getLatitude()], + }, + }, + }; + const { + latitude, + longitude, + south, + west, + north, + east, + adminLevels, + ...geocodedProperties + } = geocoded.toObject(); + + let properties: { + [property: string]: + | string + | number + | AdminLevel[] + | AdminLevelObject[] + | undefined; + } = { ...geocodedProperties }; + Object.keys(properties).forEach( + (property) => + properties[property] === undefined && delete properties[property] + ); + + if (adminLevels && adminLevels.length > 0) { + properties = { + ...properties, + adminLevels: adminLevels.map((adminLevel) => adminLevel.toObject()), + }; + } + + result = { ...result, properties }; + if (south && west && north && east) { + result = { ...result, bounds: { south, west, north, east } }; + } + + return result; + } +} diff --git a/src/Geocoded.ts b/src/Geocoded.ts index c2fa4d8..3e57540 100644 --- a/src/Geocoded.ts +++ b/src/Geocoded.ts @@ -1,4 +1,7 @@ +import AdminLevel from "AdminLevel"; + export interface GeocodedObject { + readonly [property: string]: string | number | AdminLevel[] | undefined; readonly latitude?: number; readonly longitude?: number; readonly south?: number; @@ -12,6 +15,7 @@ export interface GeocodedObject { readonly locality?: string; readonly postalCode?: string; readonly region?: string; + readonly adminLevels?: AdminLevel[]; readonly country?: string; readonly countryCode?: string; } @@ -43,11 +47,13 @@ export default class Geocoded { private readonly region?: string; + private readonly adminLevels: AdminLevel[]; + private readonly country?: string; private readonly countryCode?: string; - private constructor({ + protected constructor({ latitude, longitude, south, @@ -61,6 +67,7 @@ export default class Geocoded { locality, postalCode, region, + adminLevels, country, countryCode, }: GeocodedObject) { @@ -77,12 +84,13 @@ export default class Geocoded { this.locality = locality; this.postalCode = postalCode; this.region = region; + this.adminLevels = adminLevels || []; this.country = country; this.countryCode = countryCode; } public static create(object: GeocodedObject): Geocoded { - return new Geocoded(object); + return new this(object); } public toObject(): GeocodedObject { @@ -100,6 +108,7 @@ export default class Geocoded { locality: this.locality, postalCode: this.postalCode, region: this.region, + adminLevels: this.adminLevels, country: this.country, countryCode: this.countryCode, }; @@ -111,7 +120,7 @@ export default class Geocoded { north?: number, east?: number ): Geocoded { - return new Geocoded({ + return (this.constructor).create({ ...this.toObject(), south, west, @@ -121,7 +130,7 @@ export default class Geocoded { } public withCoordinates(latitude?: number, longitude?: number): Geocoded { - return new Geocoded({ + return (this.constructor).create({ ...this.toObject(), latitude, longitude, @@ -177,6 +186,14 @@ export default class Geocoded { return this.region; } + public addAdminLevel(adminLevel: AdminLevel): void { + this.adminLevels.push(adminLevel); + } + + public getAdminLevels(): AdminLevel[] { + return this.adminLevels; + } + public getCountry(): undefined | string { return this.country; } diff --git a/src/GeocoderProviderFactory.ts b/src/GeocoderProviderFactory.ts index 721025c..9fbf312 100644 --- a/src/GeocoderProviderFactory.ts +++ b/src/GeocoderProviderFactory.ts @@ -7,9 +7,9 @@ import { YandexProvider, ProviderInterface, ProviderOptionsInterface, - defaultProviderOptions, defaultMapboxProviderOptions, - defaultYandexProviderOptions, + defaultOpenStreetMapProviderOptions, + defaultProviderOptions, } from "providers"; import ExternalURILoader from "ExternalURILoader"; @@ -20,6 +20,7 @@ export interface GeocoderProviderFactoryOptions | "google" | "mapbox" | "mapquest" + | "nominatim" | "openstreetmap" | "yandex"; } @@ -59,12 +60,13 @@ export default class ProviderFactory { case "mapquest": return new MapquestProvider(externalLoader, providerOptions); case "openstreetmap": - return new OpenStreetMapProvider(externalLoader, providerOptions); - case "yandex": - return new YandexProvider(externalLoader, { - ...defaultYandexProviderOptions, + case "nominatim": + return new OpenStreetMapProvider(externalLoader, { + ...defaultOpenStreetMapProviderOptions, ...providerOptions, }); + case "yandex": + return new YandexProvider(externalLoader, providerOptions); default: } diff --git a/src/global.ts b/src/global.ts index 62eb117..fef70c9 100644 --- a/src/global.ts +++ b/src/global.ts @@ -1,12 +1,15 @@ import UniversalGeocoder from "UniversalGeocoder"; +import GeoJsonDumper from "GeoJsonDumper"; interface Container { UniversalGeocoder: typeof UniversalGeocoder; + GeoJsonDumper: typeof GeoJsonDumper; } declare global { interface Window { UniversalGeocoder: typeof UniversalGeocoder; + GeoJsonDumper: typeof GeoJsonDumper; } } @@ -14,3 +17,4 @@ const container: Window | Container = typeof window === "object" ? window : ({} as Container); container.UniversalGeocoder = UniversalGeocoder; +container.GeoJsonDumper = GeoJsonDumper; diff --git a/src/index.ts b/src/index.ts index 77fa5ce..59bfe9b 100644 --- a/src/index.ts +++ b/src/index.ts @@ -12,12 +12,14 @@ export interface Coordinates { export * from "providers"; export * from "query"; +export { default as AdminLevel } from "AdminLevel"; +export * from "AdminLevel"; export { default as ExternalURILoader } from "ExternalURILoader"; export * from "ExternalURILoader"; export { default as Geocoded } from "Geocoded"; export * from "Geocoded"; export { default as GeocoderProviderFactory } from "GeocoderProviderFactory"; export * from "GeocoderProviderFactory"; -export { default as GeoJSONDumper } from "GeoJSONDumper"; -export * from "GeoJSONDumper"; +export { default as GeoJsonDumper } from "GeoJsonDumper"; +export * from "GeoJsonDumper"; export { default } from "UniversalGeocoder"; diff --git a/src/providers/BingProvider.ts b/src/providers/BingProvider.ts index 404ce8c..cd8b65a 100644 --- a/src/providers/BingProvider.ts +++ b/src/providers/BingProvider.ts @@ -16,6 +16,7 @@ import { ReverseQuery, ReverseQueryObject, } from "query"; +import { Box } from "types"; interface BingRequestParams { [param: string]: string | undefined; @@ -25,7 +26,7 @@ interface BingRequestParams { export interface BingResult { __type: string; - bbox: [number, number, number, number]; + bbox: Box; name: string; point: { type: string; diff --git a/src/providers/OpenStreetMapProvider.ts b/src/providers/OpenStreetMapProvider.ts deleted file mode 100644 index 469641d..0000000 --- a/src/providers/OpenStreetMapProvider.ts +++ /dev/null @@ -1,197 +0,0 @@ -import { - ExternalLoaderInterface, - ExternalLoaderParams, -} from "ExternalURILoader"; -import { - GeocodedResultsCallback, - ProviderHelpers, - ProviderInterface, - ProviderOptionsInterface, - defaultProviderOptions, -} from "providers"; -import Geocoded from "Geocoded"; -import { - GeocodeQuery, - GeocodeQueryObject, - ReverseQuery, - ReverseQueryObject, -} from "query"; - -interface OpenStreetMapRequestParams { - [param: string]: string | undefined; - readonly q?: string; - readonly lat?: string; - readonly lon?: string; - readonly format: string; - readonly addressdetails: string; - readonly zoom?: string; - readonly JSONPCallback?: string; -} - -export interface OpenStreetMapResult { - // eslint-disable-next-line camelcase - place_id: number; - licence: string; - // eslint-disable-next-line camelcase - osm_type: string; - // eslint-disable-next-line camelcase - osm_id: number; - boundingbox: [string, string, string, string]; - lat: string; - lon: string; - // eslint-disable-next-line camelcase - display_name: string; - class: string; - type: string; - importance: number; - icon: string; - address: { - attraction?: string; - // eslint-disable-next-line camelcase - house_number?: string; - road?: string; - neighbourhood?: string; - suburb?: string; - city?: string; - town?: string; - village?: string; - hamlet?: string; - state?: string; - postcode?: string; - country?: string; - // eslint-disable-next-line camelcase - country_code?: string; - }; -} - -export default class OpenStreetMapProvider implements ProviderInterface { - private externalLoader: ExternalLoaderInterface; - - private options: ProviderOptionsInterface; - - public constructor( - _externalLoader: ExternalLoaderInterface, - options: ProviderOptionsInterface = defaultProviderOptions - ) { - this.externalLoader = _externalLoader; - this.options = { ...defaultProviderOptions, ...options }; - } - - public geocode( - query: string | GeocodeQuery | GeocodeQueryObject, - callback: GeocodedResultsCallback - ): void { - const geocodeQuery = ProviderHelpers.getGeocodeQueryFromParameter(query); - - this.externalLoader.setOptions({ - protocol: this.options.useSsl ? "https" : "http", - host: "nominatim.openstreetmap.org", - pathname: "search", - }); - - const params: OpenStreetMapRequestParams = { - q: geocodeQuery.getText(), - format: "json", - addressdetails: "1", - JSONPCallback: this.options.useJsonp ? "json_callback" : undefined, - }; - - this.executeRequest(params, callback); - } - - public geodecode( - latitudeOrQuery: number | string | ReverseQuery | ReverseQueryObject, - longitudeOrCallback: number | string | GeocodedResultsCallback, - callback?: GeocodedResultsCallback - ): void { - const reverseQuery = ProviderHelpers.getReverseQueryFromParameters( - latitudeOrQuery, - longitudeOrCallback - ); - const reverseCallback = ProviderHelpers.getCallbackFromParameters( - longitudeOrCallback, - callback - ); - - this.externalLoader.setOptions({ - protocol: this.options.useSsl ? "https" : "http", - host: "nominatim.openstreetmap.org", - pathname: "reverse", - }); - - const params: OpenStreetMapRequestParams = { - lat: reverseQuery.getCoordinates().latitude.toString(), - lon: reverseQuery.getCoordinates().longitude.toString(), - format: "json", - addressdetails: "1", - zoom: "18", - JSONPCallback: this.options.useJsonp ? "json_callback" : undefined, - }; - - this.executeRequest(params, reverseCallback); - } - - public executeRequest( - params: ExternalLoaderParams, - callback: GeocodedResultsCallback - ): void { - this.externalLoader.executeRequest(params, (data) => { - callback( - data.length - ? data.map((result: OpenStreetMapResult) => - OpenStreetMapProvider.mapToGeocoded(result) - ) - : [OpenStreetMapProvider.mapToGeocoded(data)] - ); - }); - } - - public static mapToGeocoded(result: OpenStreetMapResult): Geocoded { - const latitude = parseFloat(result.lat); - const longitude = parseFloat(result.lon); - const streetNumber = result.address.house_number; - const streetName = result.address.road; - const subLocality = result.address.suburb; - let locality: string | undefined; - const postalCode = result.address.postcode - ? result.address.postcode.split(";")[0] - : undefined; - const region = result.address.state; - const { country } = result.address; - const countryCode = result.address.country_code; - - const localityTypes: ("city" | "town" | "village" | "hamlet")[] = [ - "city", - "town", - "village", - "hamlet", - ]; - localityTypes.forEach((localityType) => { - if (result.address[localityType] && !locality) { - locality = result.address[localityType]; - } - }); - - let geocoded = Geocoded.create({ - latitude, - longitude, - streetNumber, - streetName, - subLocality, - locality, - postalCode, - region, - country, - countryCode, - }); - - geocoded = geocoded.withBounds( - parseFloat(result.boundingbox[0]), - parseFloat(result.boundingbox[2]), - parseFloat(result.boundingbox[1]), - parseFloat(result.boundingbox[3]) - ); - - return geocoded; - } -} diff --git a/src/providers/ProviderInterface.ts b/src/providers/ProviderInterface.ts index 480b303..6b39d4d 100644 --- a/src/providers/ProviderInterface.ts +++ b/src/providers/ProviderInterface.ts @@ -1,4 +1,4 @@ -import { ExternalLoaderParams } from "ExternalURILoader"; +import { ExternalLoaderHeaders, ExternalLoaderParams } from "ExternalURILoader"; import Geocoded from "Geocoded"; import { GeocodeQuery, @@ -34,6 +34,7 @@ export default interface ProviderInterface { ): void; executeRequest( params: ExternalLoaderParams, - callback: GeocodedResultsCallback + callback: GeocodedResultsCallback, + headers?: ExternalLoaderHeaders ): void; } diff --git a/src/providers/YandexProvider.ts b/src/providers/YandexProvider.ts index 22c410e..b251f65 100644 --- a/src/providers/YandexProvider.ts +++ b/src/providers/YandexProvider.ts @@ -22,7 +22,8 @@ interface YandexRequestParams { readonly apikey?: string; readonly geocode: string; readonly format: string; - readonly lang: string; + readonly lang?: string; + readonly toponym?: "house" | "street" | "metro" | "district" | "locality"; readonly JSONPCallback?: string; } @@ -83,15 +84,11 @@ interface YandexFlattenedAddressDetails { PremiseNumber?: string; } -interface YandexProviderOptionsInterface extends ProviderOptionsInterface { - readonly lang: string; +export interface YandexProviderOptionsInterface + extends ProviderOptionsInterface { + readonly toponym?: "house" | "street" | "metro" | "district" | "locality"; } -export const defaultYandexProviderOptions = { - ...defaultProviderOptions, - lang: "en-US", -}; - export default class YandexProvider implements ProviderInterface { private externalLoader: ExternalLoaderInterface; @@ -99,10 +96,10 @@ export default class YandexProvider implements ProviderInterface { public constructor( _externalLoader: ExternalLoaderInterface, - options: YandexProviderOptionsInterface = defaultYandexProviderOptions + options: YandexProviderOptionsInterface = defaultProviderOptions ) { this.externalLoader = _externalLoader; - this.options = { ...defaultYandexProviderOptions, ...options }; + this.options = { ...defaultProviderOptions, ...options }; } public geocode( @@ -121,7 +118,7 @@ export default class YandexProvider implements ProviderInterface { apikey: this.options.apiKey, geocode: geocodeQuery.getText(), format: "json", - lang: this.options.lang, + lang: geocodeQuery.getLocale(), JSONPCallback: this.options.useJsonp ? "callback" : undefined, }; @@ -154,7 +151,8 @@ export default class YandexProvider implements ProviderInterface { reverseQuery.getCoordinates().latitude }`, format: "json", - lang: this.options.lang, + lang: reverseQuery.getLocale(), + toponym: this.options.toponym, JSONPCallback: this.options.useJsonp ? "callback" : undefined, }; diff --git a/src/providers/index.ts b/src/providers/index.ts index 72f17b7..7f615f8 100644 --- a/src/providers/index.ts +++ b/src/providers/index.ts @@ -8,7 +8,6 @@ export * from "providers/GoogleAPIProvider"; export * from "providers/mapbox"; export { default as MapquestProvider } from "providers/MapquestProvider"; export * from "providers/MapquestProvider"; -export { default as OpenStreetMapProvider } from "providers/OpenStreetMapProvider"; -export * from "providers/OpenStreetMapProvider"; +export * from "providers/nominatim"; export { default as YandexProvider } from "providers/YandexProvider"; export * from "providers/YandexProvider"; diff --git a/src/providers/mapbox/MapboxGeocodeQuery.ts b/src/providers/mapbox/MapboxGeocodeQuery.ts index cd1da39..110b0cc 100644 --- a/src/providers/mapbox/MapboxGeocodeQuery.ts +++ b/src/providers/mapbox/MapboxGeocodeQuery.ts @@ -16,7 +16,7 @@ export default class MapboxGeocodeQuery extends GeocodeQuery { } public static create(object: MapboxGeocodeQueryObject): MapboxGeocodeQuery { - return new MapboxGeocodeQuery(object); + return new this(object); } public toObject(): MapboxGeocodeQueryObject { diff --git a/src/providers/mapbox/MapboxProvider.ts b/src/providers/mapbox/MapboxProvider.ts index 8c4f83b..d0d865d 100644 --- a/src/providers/mapbox/MapboxProvider.ts +++ b/src/providers/mapbox/MapboxProvider.ts @@ -14,6 +14,7 @@ import { defaultProviderOptions, } from "providers"; import Geocoded from "Geocoded"; +import { Box } from "types"; interface MapboxRequestParams { [param: string]: string | undefined; @@ -70,7 +71,7 @@ export interface MapboxResult { // eslint-disable-next-line camelcase matching_place_name?: string; language?: string; - bbox?: [number, number, number, number]; + bbox?: Box; center: [number, number]; geometry: { type: "Point"; @@ -90,10 +91,10 @@ export enum GEOCODING_MODES { GEOCODING_MODE_PLACES_PERMANENT = "mapbox.places-permanent", } -interface MapboxProviderOptionsInterface extends ProviderOptionsInterface { +export interface MapboxProviderOptionsInterface + extends ProviderOptionsInterface { readonly geocodingMode: GEOCODING_MODES; readonly country?: string; - readonly language?: string; } export const defaultMapboxProviderOptions = { @@ -139,7 +140,7 @@ export default class MapboxProvider implements ProviderInterface { const params: MapboxRequestParams = { access_token: this.options.apiKey || "", country: this.options.country, - language: this.options.language, + language: geocodeQuery.getLocale(), limit: geocodeQuery.getLimit().toString(), bbox: geocodeQuery.getBounds() ? `${geocodeQuery.getBounds()?.west},${ @@ -186,7 +187,7 @@ export default class MapboxProvider implements ProviderInterface { const params: MapboxRequestParams = { access_token: this.options.apiKey || "", country: this.options.country, - language: this.options.language, + language: reverseQuery.getLocale(), limit: reverseQuery.getLimit().toString(), types: (reverseQuery).getLocationTypes() ? (reverseQuery).getLocationTypes()?.join(",") diff --git a/src/providers/mapbox/MapboxReverseQuery.ts b/src/providers/mapbox/MapboxReverseQuery.ts index d17736b..60e1f8f 100644 --- a/src/providers/mapbox/MapboxReverseQuery.ts +++ b/src/providers/mapbox/MapboxReverseQuery.ts @@ -16,7 +16,7 @@ export default class MapboxReverseQuery extends ReverseQuery { } public static create(object: MapboxReverseQueryObject): MapboxReverseQuery { - return new MapboxReverseQuery(object); + return new this(object); } public toObject(): MapboxReverseQueryObject { diff --git a/src/providers/nominatim/NominatimGeocodeQuery.ts b/src/providers/nominatim/NominatimGeocodeQuery.ts new file mode 100644 index 0000000..129ab1a --- /dev/null +++ b/src/providers/nominatim/NominatimGeocodeQuery.ts @@ -0,0 +1,89 @@ +import { GeocodeQuery, GeocodeQueryObject } from "query"; +import { Box } from "types"; + +export interface NominatimGeocodeQueryObject extends GeocodeQueryObject { + readonly countryCodes?: string[]; + readonly excludePlaceIds?: number[]; + readonly viewBox?: Box; + readonly bounded?: boolean; +} + +export default class NominatimGeocodeQuery extends GeocodeQuery { + private readonly countryCodes?: string[]; + + private readonly excludePlaceIds?: number[]; + + private readonly viewBox?: Box; + + private readonly bounded?: boolean; + + protected constructor({ + countryCodes, + excludePlaceIds, + viewBox, + bounded, + ...geocodeQueryObject + }: NominatimGeocodeQueryObject) { + super(geocodeQueryObject); + this.countryCodes = countryCodes; + this.excludePlaceIds = excludePlaceIds; + if (viewBox && viewBox.length !== 4) { + throw new Error('The "viewBox" parameter must be 4 numbers.'); + } + this.viewBox = viewBox; + if (bounded && !viewBox) { + throw new Error( + 'The "bounded" parameter can only be used with the "viewBox" parameter.' + ); + } + this.bounded = bounded; + } + + public static create( + object: NominatimGeocodeQueryObject + ): NominatimGeocodeQuery { + return new this(object); + } + + public toObject(): NominatimGeocodeQueryObject { + return { + ...super.toObject(), + countryCodes: this.countryCodes, + excludePlaceIds: this.excludePlaceIds, + viewBox: this.viewBox, + bounded: this.bounded, + }; + } + + public withCountryCodes(countryCodes: string[]): NominatimGeocodeQuery { + return new NominatimGeocodeQuery({ ...this.toObject(), countryCodes }); + } + + public getCountryCodes(): undefined | string[] { + return this.countryCodes; + } + + public withExcludePlaceIds(excludePlaceIds: number[]): NominatimGeocodeQuery { + return new NominatimGeocodeQuery({ ...this.toObject(), excludePlaceIds }); + } + + public getExcludePlaceIds(): undefined | number[] { + return this.excludePlaceIds; + } + + public withViewBox(viewBox: Box): NominatimGeocodeQuery { + return new NominatimGeocodeQuery({ ...this.toObject(), viewBox }); + } + + public getViewBox(): undefined | Box { + return this.viewBox; + } + + public withBounded(bounded: boolean): NominatimGeocodeQuery { + return new NominatimGeocodeQuery({ ...this.toObject(), bounded }); + } + + public getBounded(): undefined | boolean { + return this.bounded; + } +} diff --git a/src/providers/nominatim/NominatimGeocoded.ts b/src/providers/nominatim/NominatimGeocoded.ts new file mode 100644 index 0000000..bb1e0ae --- /dev/null +++ b/src/providers/nominatim/NominatimGeocoded.ts @@ -0,0 +1,124 @@ +import Geocoded, { GeocodedObject } from "Geocoded"; + +export interface NominatimGeocodedObject extends GeocodedObject { + readonly displayName?: string; + readonly osmId?: number; + readonly osmType?: string; + readonly category?: string; + readonly type?: string; + readonly attribution?: string; +} + +export default class NominatimGeocoded extends Geocoded { + private readonly displayName?: string; + + private readonly osmId?: number; + + private readonly osmType?: string; + + private readonly category?: string; + + private readonly type?: string; + + private readonly attribution?: string; + + protected constructor({ + displayName, + osmId, + osmType, + category, + type, + attribution, + ...geocodedObject + }: NominatimGeocodedObject) { + super(geocodedObject); + this.displayName = displayName; + this.osmId = osmId; + this.osmType = osmType; + this.category = category; + this.type = type; + this.attribution = attribution; + } + + public static create(object: NominatimGeocodedObject): NominatimGeocoded { + return new this(object); + } + + public toObject(): NominatimGeocodedObject { + return { + ...super.toObject(), + displayName: this.displayName, + osmId: this.osmId, + osmType: this.osmType, + category: this.category, + type: this.type, + attribution: this.attribution, + }; + } + + public withDisplayName(displayName: string): NominatimGeocoded { + return new NominatimGeocoded({ + ...this.toObject(), + displayName, + }); + } + + public getDisplayName(): undefined | string { + return this.displayName; + } + + public withOsmId(osmId: number): NominatimGeocoded { + return new NominatimGeocoded({ + ...this.toObject(), + osmId, + }); + } + + public getOsmId(): undefined | number { + return this.osmId; + } + + public withOsmType(osmType: string): NominatimGeocoded { + return new NominatimGeocoded({ + ...this.toObject(), + osmType, + }); + } + + public getOsmType(): undefined | string { + return this.osmType; + } + + public withCategory(category: string): NominatimGeocoded { + return new NominatimGeocoded({ + ...this.toObject(), + category, + }); + } + + public getCategory(): undefined | string { + return this.category; + } + + public withType(type: string): NominatimGeocoded { + return new NominatimGeocoded({ + ...this.toObject(), + type, + }); + } + + public getType(): undefined | string { + return this.type; + } + + public withAttribution(attribution: string): NominatimGeocoded { + return new NominatimGeocoded({ + ...this.toObject(), + attribution, + }); + } + + public getAttribution(): undefined | string { + return this.attribution; + } +} diff --git a/src/providers/nominatim/NominatimProvider.ts b/src/providers/nominatim/NominatimProvider.ts new file mode 100644 index 0000000..dee3e1e --- /dev/null +++ b/src/providers/nominatim/NominatimProvider.ts @@ -0,0 +1,316 @@ +import { + ExternalLoaderHeaders, + ExternalLoaderInterface, + ExternalLoaderParams, +} from "ExternalURILoader"; +import { + GeocodedResultsCallback, + NominatimGeocoded, + NominatimReverseQuery, + NominatimReverseQueryObject, + NominatimGeocodeQueryObject, + NominatimGeocodeQuery, + ProviderHelpers, + ProviderInterface, + ProviderOptionsInterface, + defaultProviderOptions, +} from "providers"; +import AdminLevel from "AdminLevel"; + +interface NominatimRequestParams { + [param: string]: string | undefined; + readonly q?: string; + readonly lat?: string; + readonly lon?: string; + readonly format: string; + readonly addressdetails: string; + readonly zoom?: string; + readonly limit?: string; + // eslint-disable-next-line camelcase + readonly "accept-language"?: string; + readonly countrycodes?: string; + // eslint-disable-next-line camelcase + readonly exclude_place_ids?: string; + readonly viewbox?: string; + readonly bounded?: string; + readonly JSONPCallback?: string; +} + +export interface NominatimResult { + // eslint-disable-next-line camelcase + place_id: number; + licence: string; + // eslint-disable-next-line camelcase + osm_type: string; + // eslint-disable-next-line camelcase + osm_id: number; + boundingbox: [string, string, string, string]; + lat: string; + lon: string; + // eslint-disable-next-line camelcase + display_name: string; + category: string; + type: string; + importance: number; + icon: string; + address: { + attraction?: string; + // eslint-disable-next-line camelcase + house_number?: string; + road?: string; + pedestrian?: string; + neighbourhood?: string; + suburb?: string; + city?: string; + town?: string; + village?: string; + hamlet?: string; + state?: string; + county?: string; + postcode?: string; + country?: string; + // eslint-disable-next-line camelcase + country_code?: string; + }; +} + +export interface NominatimProviderOptionsInterface + extends ProviderOptionsInterface { + readonly host: string; + readonly userAgent?: string; + readonly referer?: string; +} + +export const defaultNominatimProviderOptions = { + ...defaultProviderOptions, + host: "nominatim.openstreetmap.org", +}; + +export default class NominatimProvider implements ProviderInterface { + private externalLoader: ExternalLoaderInterface; + + private options: NominatimProviderOptionsInterface; + + public constructor( + _externalLoader: ExternalLoaderInterface, + options: NominatimProviderOptionsInterface = defaultNominatimProviderOptions + ) { + this.externalLoader = _externalLoader; + this.options = { ...defaultNominatimProviderOptions, ...options }; + if ( + this.options.host === defaultNominatimProviderOptions.host && + !this.options.userAgent + ) { + throw new Error( + 'An User-Agent identifying your application is required for the OpenStreetMap / Nominatim provider when using the default host. Please add it in the "userAgent" option.' + ); + } + } + + public geocode( + query: string | NominatimGeocodeQuery | NominatimGeocodeQueryObject, + callback: GeocodedResultsCallback + ): void { + const geocodeQuery = ProviderHelpers.getGeocodeQueryFromParameter( + query, + NominatimGeocodeQuery + ); + + this.externalLoader.setOptions({ + protocol: this.options.useSsl ? "https" : "http", + host: this.options.host, + pathname: "search", + }); + + const params: NominatimRequestParams = this.getCommonParams( + { + q: geocodeQuery.getText(), + limit: geocodeQuery.getLimit().toString(), + ...((geocodeQuery).getCountryCodes() + ? { + countrycodes: (geocodeQuery) + .getCountryCodes() + ?.join(","), + } + : {}), + ...((geocodeQuery).getExcludePlaceIds() + ? { + exclude_place_ids: (geocodeQuery) + .getExcludePlaceIds() + ?.join(","), + } + : {}), + ...((geocodeQuery).getViewBox() + ? { + viewbox: (geocodeQuery) + .getViewBox() + ?.join(","), + } + : {}), + ...((geocodeQuery).getBounded() + ? { + bounded: (geocodeQuery) + .getBounded() + ?.toString(), + } + : {}), + }, + geocodeQuery + ); + + this.executeRequest(params, callback, this.getHeaders()); + } + + public geodecode( + latitudeOrQuery: + | number + | string + | NominatimReverseQuery + | NominatimReverseQueryObject, + longitudeOrCallback: number | string | GeocodedResultsCallback, + callback?: GeocodedResultsCallback + ): void { + const reverseQuery = ProviderHelpers.getReverseQueryFromParameters( + latitudeOrQuery, + longitudeOrCallback, + NominatimReverseQuery + ); + const reverseCallback = ProviderHelpers.getCallbackFromParameters( + longitudeOrCallback, + callback + ); + + this.externalLoader.setOptions({ + protocol: this.options.useSsl ? "https" : "http", + host: this.options.host, + pathname: "reverse", + }); + + const params: NominatimRequestParams = this.getCommonParams( + { + lat: reverseQuery.getCoordinates().latitude.toString(), + lon: reverseQuery.getCoordinates().longitude.toString(), + zoom: + (reverseQuery).getZoom()?.toString() || "18", + }, + reverseQuery + ); + + this.executeRequest(params, reverseCallback, this.getHeaders()); + } + + private getCommonParams( + params: Partial, + query: NominatimGeocodeQuery | NominatimReverseQuery + ): NominatimRequestParams { + return { + ...params, + format: "jsonv2", + addressdetails: "1", + JSONPCallback: this.options.useJsonp ? "json_callback" : undefined, + ...(query.getLocale() ? { "accept-language": query.getLocale() } : {}), + }; + } + + private getHeaders(): ExternalLoaderHeaders { + return { + "User-Agent": this.options.userAgent || "", + ...(this.options.referer ? { Referer: this.options.referer } : {}), + }; + } + + public executeRequest( + params: ExternalLoaderParams, + callback: GeocodedResultsCallback, + headers?: ExternalLoaderHeaders + ): void { + this.externalLoader.executeRequest( + params, + (data) => { + callback( + data.length + ? data.map((result: NominatimResult) => + NominatimProvider.mapToGeocoded(result) + ) + : [NominatimProvider.mapToGeocoded(data)] + ); + }, + headers + ); + } + + public static mapToGeocoded(result: NominatimResult): NominatimGeocoded { + const latitude = parseFloat(result.lat); + const longitude = parseFloat(result.lon); + const displayName = result.display_name; + const streetNumber = result.address.house_number; + const streetName = result.address.road || result.address.pedestrian; + const subLocality = result.address.suburb; + let locality: string | undefined; + const postalCode = result.address.postcode + ? result.address.postcode.split(";")[0] + : undefined; + const region = result.address.state; + const { country } = result.address; + const countryCode = result.address.country_code; + const osmId = result.osm_id; + const osmType = result.osm_type; + const { category } = result; + const { type } = result; + const attribution = result.licence; + + const localityTypes: ("city" | "town" | "village" | "hamlet")[] = [ + "city", + "town", + "village", + "hamlet", + ]; + localityTypes.forEach((localityType) => { + if (result.address[localityType] && !locality) { + locality = result.address[localityType]; + } + }); + + let geocoded = NominatimGeocoded.create({ + latitude, + longitude, + displayName, + streetNumber, + streetName, + subLocality, + locality, + postalCode, + region, + country, + countryCode, + osmId, + osmType, + category, + type, + attribution, + }); + + geocoded = ( + geocoded.withBounds( + parseFloat(result.boundingbox[0]), + parseFloat(result.boundingbox[2]), + parseFloat(result.boundingbox[1]), + parseFloat(result.boundingbox[3]) + ) + ); + + const adminLevels: ("state" | "county")[] = ["state", "county"]; + adminLevels.forEach((adminLevel, level) => { + if (result.address[adminLevel]) { + geocoded.addAdminLevel( + AdminLevel.create({ + level: level + 1, + name: result.address[adminLevel] || "", + }) + ); + } + }); + + return geocoded; + } +} diff --git a/src/providers/nominatim/NominatimReverseQuery.ts b/src/providers/nominatim/NominatimReverseQuery.ts new file mode 100644 index 0000000..b0718bf --- /dev/null +++ b/src/providers/nominatim/NominatimReverseQuery.ts @@ -0,0 +1,38 @@ +import { ReverseQuery, ReverseQueryObject } from "query"; + +export interface NominatimReverseQueryObject extends ReverseQueryObject { + readonly zoom?: number; +} + +export default class NominatimReverseQuery extends ReverseQuery { + private readonly zoom?: number; + + protected constructor({ + zoom, + ...reverseQueryObject + }: NominatimReverseQueryObject) { + super(reverseQueryObject); + this.zoom = zoom; + } + + public static create( + object: NominatimReverseQueryObject + ): NominatimReverseQuery { + return new this(object); + } + + public toObject(): NominatimReverseQueryObject { + return { + ...super.toObject(), + zoom: this.zoom, + }; + } + + public withZoom(zoom: number): NominatimReverseQuery { + return new NominatimReverseQuery({ ...this.toObject(), zoom }); + } + + public getZoom(): undefined | number { + return this.zoom; + } +} diff --git a/src/providers/nominatim/index.ts b/src/providers/nominatim/index.ts new file mode 100644 index 0000000..11d429c --- /dev/null +++ b/src/providers/nominatim/index.ts @@ -0,0 +1,20 @@ +export { default as NominatimGeocoded } from "providers/nominatim/NominatimGeocoded"; +export { default as OpenStreetMapGeocoded } from "providers/nominatim/NominatimGeocoded"; +export * from "providers/nominatim/NominatimGeocoded"; +export { NominatimGeocodedObject as OpenStreetMapGeocodedObject } from "providers/nominatim/NominatimGeocoded"; +export { default as NominatimGeocodeQuery } from "providers/nominatim/NominatimGeocodeQuery"; +export { default as OpenStreetMapGeocodeQuery } from "providers/nominatim/NominatimGeocodeQuery"; +export * from "providers/nominatim/NominatimGeocodeQuery"; +export { NominatimGeocodeQueryObject as OpenStreetMapGeocodeQueryObject } from "providers/nominatim/NominatimGeocodeQuery"; +export { default as NominatimProvider } from "providers/nominatim/NominatimProvider"; +export { default as OpenStreetMapProvider } from "providers/nominatim/NominatimProvider"; +export * from "providers/nominatim/NominatimProvider"; +export { + NominatimProviderOptionsInterface as OpenStreetMapProviderOptionsInterface, + NominatimResult as OpenStreetMapResult, + defaultNominatimProviderOptions as defaultOpenStreetMapProviderOptions, +} from "providers/nominatim/NominatimProvider"; +export { default as NominatimReverseQuery } from "providers/nominatim/NominatimReverseQuery"; +export { default as OpenStreetMapReverseQuery } from "providers/nominatim/NominatimReverseQuery"; +export * from "providers/nominatim/NominatimReverseQuery"; +export { NominatimReverseQueryObject as OpenStreetMapReverseQueryObject } from "providers/nominatim/NominatimReverseQuery"; diff --git a/src/query/GeocodeQuery.ts b/src/query/GeocodeQuery.ts index e3e5531..e460528 100644 --- a/src/query/GeocodeQuery.ts +++ b/src/query/GeocodeQuery.ts @@ -48,7 +48,7 @@ export default class GeocodeQuery { } public static create(object: GeocodeQueryObjectCreate): GeocodeQuery { - return new GeocodeQuery(object); + return new this(object); } public toObject(): GeocodeQueryObject { @@ -64,7 +64,10 @@ export default class GeocodeQuery { } public withText(text: string): GeocodeQuery { - return new GeocodeQuery({ ...this.toObject(), text }); + return (this.constructor).create({ + ...this.toObject(), + text, + }); } public withBounds( @@ -73,7 +76,7 @@ export default class GeocodeQuery { north?: number, east?: number ): GeocodeQuery { - return new GeocodeQuery({ + return (this.constructor).create({ ...this.toObject(), south, west, @@ -83,11 +86,17 @@ export default class GeocodeQuery { } public withLocale(locale: string): GeocodeQuery { - return new GeocodeQuery({ ...this.toObject(), locale }); + return (this.constructor).create({ + ...this.toObject(), + locale, + }); } public withLimit(limit: number): GeocodeQuery { - return new GeocodeQuery({ ...this.toObject(), limit }); + return (this.constructor).create({ + ...this.toObject(), + limit, + }); } public getText(): string { diff --git a/src/query/ReverseQuery.ts b/src/query/ReverseQuery.ts index b68e50b..b0766e9 100644 --- a/src/query/ReverseQuery.ts +++ b/src/query/ReverseQuery.ts @@ -33,7 +33,7 @@ export default class ReverseQuery { } public static create(object: ReverseQueryObjectCreate): ReverseQuery { - return new ReverseQuery(object); + return new this(object); } public toObject(): ReverseQueryObject { @@ -46,7 +46,7 @@ export default class ReverseQuery { } public withCoordinates(latitude: number, longitude: number): ReverseQuery { - return new ReverseQuery({ + return (this.constructor).create({ ...this.toObject(), latitude, longitude, @@ -54,11 +54,17 @@ export default class ReverseQuery { } public withLocale(locale: string): ReverseQuery { - return new ReverseQuery({ ...this.toObject(), locale }); + return (this.constructor).create({ + ...this.toObject(), + locale, + }); } public withLimit(limit: number): ReverseQuery { - return new ReverseQuery({ ...this.toObject(), limit }); + return (this.constructor).create({ + ...this.toObject(), + limit, + }); } public getCoordinates(): Coordinates { diff --git a/src/types.ts b/src/types.ts index cba3725..22ec1f4 100644 --- a/src/types.ts +++ b/src/types.ts @@ -4,3 +4,5 @@ export type PartialSome< Q = Omit, R = { [K in P]?: O[P] } > = Q & R; + +export type Box = [number, number, number, number]; diff --git a/types/AdminLevel.d.ts b/types/AdminLevel.d.ts new file mode 100644 index 0000000..0a36627 --- /dev/null +++ b/types/AdminLevel.d.ts @@ -0,0 +1,17 @@ +export interface AdminLevelObject { + readonly level: number; + readonly name: string; + readonly code?: string; +} +export default class AdminLevel { + private readonly level; + private readonly name; + private readonly code?; + private constructor(); + static create(object: AdminLevelObject): AdminLevel; + toObject(): AdminLevelObject; + getLevel(): number; + getName(): string; + getCode(): undefined | string; +} +//# sourceMappingURL=AdminLevel.d.ts.map \ No newline at end of file diff --git a/types/AdminLevel.d.ts.map b/types/AdminLevel.d.ts.map new file mode 100644 index 0000000..25f429a --- /dev/null +++ b/types/AdminLevel.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"AdminLevel.d.ts","sourceRoot":"","sources":["../src/AdminLevel.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,CAAC,OAAO,OAAO,UAAU;IAC7B,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAS;IAE/B,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAS;IAE9B,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAS;IAE/B,OAAO;WAMO,MAAM,CAAC,MAAM,EAAE,gBAAgB,GAAG,UAAU;IAInD,QAAQ,IAAI,gBAAgB;IAQ5B,QAAQ,IAAI,MAAM;IAIlB,OAAO,IAAI,MAAM;IAIjB,OAAO,IAAI,SAAS,GAAG,MAAM;CAGrC"} \ No newline at end of file diff --git a/types/ExternalURILoader.d.ts b/types/ExternalURILoader.d.ts index 7cf496f..c36d884 100644 --- a/types/ExternalURILoader.d.ts +++ b/types/ExternalURILoader.d.ts @@ -1,16 +1,19 @@ export interface ExternalLoaderInterface { setOptions(options: ExternalLoaderOptions): void; - executeRequest(params: ExternalLoaderParams, callback: ResponseCallback): void; + executeRequest(params: ExternalLoaderParams, callback: ResponseCallback, headers?: ExternalLoaderHeaders): void; } export interface ExternalLoaderOptions { - readonly protocol: null | string; - readonly host: null | string; - readonly pathname: null | string; + readonly protocol: string; + readonly host?: string; + readonly pathname?: string; } export interface ExternalLoaderParams { [param: string]: string | undefined; JSONPCallback?: string; } +export interface ExternalLoaderHeaders { + [header: string]: string; +} declare type ResponseCallback = (response: any) => void; /** * Load data from external geocoding engines. @@ -19,7 +22,7 @@ export default class ExternalURILoader implements ExternalLoaderInterface { private options; constructor(options?: ExternalLoaderOptions); setOptions(options: ExternalLoaderOptions): void; - executeRequest(params: ExternalLoaderParams, callback: ResponseCallback): void; + executeRequest(params: ExternalLoaderParams, callback: ResponseCallback, externalLoaderHeaders?: ExternalLoaderHeaders): void; private static runJsonpCallback; /** * Generates randomly-named function to use as a callback for JSONP requests. diff --git a/types/ExternalURILoader.d.ts.map b/types/ExternalURILoader.d.ts.map index 1535a05..357ad06 100644 --- a/types/ExternalURILoader.d.ts.map +++ b/types/ExternalURILoader.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"ExternalURILoader.d.ts","sourceRoot":"","sources":["../src/ExternalURILoader.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,uBAAuB;IACtC,UAAU,CAAC,OAAO,EAAE,qBAAqB,GAAG,IAAI,CAAC;IACjD,cAAc,CACZ,MAAM,EAAE,oBAAoB,EAC5B,QAAQ,EAAE,gBAAgB,GACzB,IAAI,CAAC;CACT;AAED,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,QAAQ,EAAE,IAAI,GAAG,MAAM,CAAC;IACjC,QAAQ,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,CAAC;IAC7B,QAAQ,CAAC,QAAQ,EAAE,IAAI,GAAG,MAAM,CAAC;CAClC;AAED,MAAM,WAAW,oBAAoB;IACnC,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;IACpC,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAGD,aAAK,gBAAgB,GAAG,CAAC,QAAQ,EAAE,GAAG,KAAK,IAAI,CAAC;AAQhD;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,iBAAkB,YAAW,uBAAuB;IACvE,OAAO,CAAC,OAAO,CAAyC;gBAErC,OAAO,GAAE,qBAAsC;IAI3D,UAAU,CAAC,OAAO,EAAE,qBAAqB,GAAG,IAAI;IAIhD,cAAc,CACnB,MAAM,EAAE,oBAAoB,EAC5B,QAAQ,EAAE,gBAAgB,GACzB,IAAI;IA6CP,OAAO,CAAC,MAAM,CAAC,gBAAgB;IA4B/B;;;OAGG;IACH,OAAO,CAAC,MAAM,CAAC,qBAAqB;CAoBrC"} \ No newline at end of file +{"version":3,"file":"ExternalURILoader.d.ts","sourceRoot":"","sources":["../src/ExternalURILoader.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,uBAAuB;IACtC,UAAU,CAAC,OAAO,EAAE,qBAAqB,GAAG,IAAI,CAAC;IACjD,cAAc,CACZ,MAAM,EAAE,oBAAoB,EAC5B,QAAQ,EAAE,gBAAgB,EAC1B,OAAO,CAAC,EAAE,qBAAqB,GAC9B,IAAI,CAAC;CACT;AAED,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED,MAAM,WAAW,oBAAoB;IACnC,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;IACpC,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,qBAAqB;IACpC,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC;CAC1B;AAGD,aAAK,gBAAgB,GAAG,CAAC,QAAQ,EAAE,GAAG,KAAK,IAAI,CAAC;AAMhD;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,iBAAkB,YAAW,uBAAuB;IACvE,OAAO,CAAC,OAAO,CAAyC;gBAErC,OAAO,GAAE,qBAAsC;IAI3D,UAAU,CAAC,OAAO,EAAE,qBAAqB,GAAG,IAAI;IAIhD,cAAc,CACnB,MAAM,EAAE,oBAAoB,EAC5B,QAAQ,EAAE,gBAAgB,EAC1B,qBAAqB,CAAC,EAAE,qBAAqB,GAC5C,IAAI;IAuDP,OAAO,CAAC,MAAM,CAAC,gBAAgB;IA4B/B;;;OAGG;IACH,OAAO,CAAC,MAAM,CAAC,qBAAqB;CAoBrC"} \ No newline at end of file diff --git a/types/GeoJSONDumper.d.ts b/types/GeoJSONDumper.d.ts deleted file mode 100644 index d475d11..0000000 --- a/types/GeoJSONDumper.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -import Geocoded from "Geocoded"; -export interface GeoJson { - type: "Feature"; - properties: Record; - geometry: { - type: "Point"; - coordinates: [number | undefined, number | undefined]; - }; -} -export default class GeoJsonDumper { - private baseGeoJson; - dump(geocoded: Geocoded): GeoJson; -} -//# sourceMappingURL=GeoJSONDumper.d.ts.map \ No newline at end of file diff --git a/types/GeoJSONDumper.d.ts.map b/types/GeoJSONDumper.d.ts.map deleted file mode 100644 index 62be724..0000000 --- a/types/GeoJSONDumper.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"GeoJSONDumper.d.ts","sourceRoot":"","sources":["../src/GeoJSONDumper.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,UAAU,CAAC;AAEhC,MAAM,WAAW,OAAO;IACtB,IAAI,EAAE,SAAS,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACpC,QAAQ,EAAE;QACR,IAAI,EAAE,OAAO,CAAC;QACd,WAAW,EAAE,CAAC,MAAM,GAAG,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;KACvD,CAAC;CACH;AAED,MAAM,CAAC,OAAO,OAAO,aAAa;IAChC,OAAO,CAAC,WAAW,CAOjB;IAEK,IAAI,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO;CASzC"} \ No newline at end of file diff --git a/types/GeoJsonDumper.d.ts b/types/GeoJsonDumper.d.ts new file mode 100644 index 0000000..ca38053 --- /dev/null +++ b/types/GeoJsonDumper.d.ts @@ -0,0 +1,23 @@ +import Geocoded from "Geocoded"; +import AdminLevel, { AdminLevelObject } from "AdminLevel"; +export interface GeoJson { + readonly type: "Feature"; + readonly properties: { + readonly [property: string]: string | number | AdminLevel[] | AdminLevelObject[] | undefined; + }; + readonly geometry: { + readonly type: "Point"; + readonly coordinates: [number | undefined, number | undefined]; + }; + readonly bounds?: { + readonly south: number; + readonly west: number; + readonly north: number; + readonly east: number; + }; +} +export default class GeoJsonDumper { + private static baseGeoJson; + static dump(geocoded: Geocoded): GeoJson; +} +//# sourceMappingURL=GeoJsonDumper.d.ts.map \ No newline at end of file diff --git a/types/GeoJsonDumper.d.ts.map b/types/GeoJsonDumper.d.ts.map new file mode 100644 index 0000000..7ca84b7 --- /dev/null +++ b/types/GeoJsonDumper.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"GeoJsonDumper.d.ts","sourceRoot":"","sources":["../src/GeoJsonDumper.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,UAAU,CAAC;AAChC,OAAO,UAAU,EAAE,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAE1D,MAAM,WAAW,OAAO;IACtB,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IACzB,QAAQ,CAAC,UAAU,EAAE;QACnB,QAAQ,EAAE,QAAQ,EAAE,MAAM,GACtB,MAAM,GACN,MAAM,GACN,UAAU,EAAE,GACZ,gBAAgB,EAAE,GAClB,SAAS,CAAC;KACf,CAAC;IACF,QAAQ,CAAC,QAAQ,EAAE;QACjB,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;QACvB,QAAQ,CAAC,WAAW,EAAE,CAAC,MAAM,GAAG,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;KAChE,CAAC;IACF,QAAQ,CAAC,MAAM,CAAC,EAAE;QAChB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;QACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;QACtB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;QACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;KACvB,CAAC;CACH;AAED,MAAM,CAAC,OAAO,OAAO,aAAa;IAChC,OAAO,CAAC,MAAM,CAAC,WAAW,CAOxB;WAEY,IAAI,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO;CAiDhD"} \ No newline at end of file diff --git a/types/Geocoded.d.ts b/types/Geocoded.d.ts index 4803e79..b9806c2 100644 --- a/types/Geocoded.d.ts +++ b/types/Geocoded.d.ts @@ -1,4 +1,6 @@ +import AdminLevel from "AdminLevel"; export interface GeocodedObject { + readonly [property: string]: string | number | AdminLevel[] | undefined; readonly latitude?: number; readonly longitude?: number; readonly south?: number; @@ -12,6 +14,7 @@ export interface GeocodedObject { readonly locality?: string; readonly postalCode?: string; readonly region?: string; + readonly adminLevels?: AdminLevel[]; readonly country?: string; readonly countryCode?: string; } @@ -29,9 +32,10 @@ export default class Geocoded { private readonly locality?; private readonly postalCode?; private readonly region?; + private readonly adminLevels; private readonly country?; private readonly countryCode?; - private constructor(); + protected constructor({ latitude, longitude, south, west, north, east, formattedAddress, streetNumber, streetName, subLocality, locality, postalCode, region, adminLevels, country, countryCode, }: GeocodedObject); static create(object: GeocodedObject): Geocoded; toObject(): GeocodedObject; withBounds(south?: number, west?: number, north?: number, east?: number): Geocoded; @@ -47,6 +51,8 @@ export default class Geocoded { getLocality(): undefined | string; getPostalCode(): undefined | string; getRegion(): undefined | string; + addAdminLevel(adminLevel: AdminLevel): void; + getAdminLevels(): AdminLevel[]; getCountry(): undefined | string; getCountryCode(): undefined | string; } diff --git a/types/Geocoded.d.ts.map b/types/Geocoded.d.ts.map index 5c4e9f8..2805ade 100644 --- a/types/Geocoded.d.ts.map +++ b/types/Geocoded.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"Geocoded.d.ts","sourceRoot":"","sources":["../src/Geocoded.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IACnC,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;CAC/B;AAED,MAAM,CAAC,OAAO,OAAO,QAAQ;IAC3B,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAS;IAEnC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAS;IAEpC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAS;IAEhC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAS;IAE/B,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAS;IAEhC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAS;IAE/B,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAC,CAAS;IAE3C,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAS;IAEvC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAS;IAErC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAS;IAEtC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAS;IAEnC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAS;IAErC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAS;IAEjC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAS;IAElC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAS;IAEtC,OAAO;WAkCO,MAAM,CAAC,MAAM,EAAE,cAAc,GAAG,QAAQ;IAI/C,QAAQ,IAAI,cAAc;IAoB1B,UAAU,CACf,KAAK,CAAC,EAAE,MAAM,EACd,IAAI,CAAC,EAAE,MAAM,EACb,KAAK,CAAC,EAAE,MAAM,EACd,IAAI,CAAC,EAAE,MAAM,GACZ,QAAQ;IAUJ,eAAe,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,QAAQ;IAQhE,cAAc,IAAI,CAAC,SAAS,GAAG,MAAM,EAAE,SAAS,GAAG,MAAM,CAAC;IAI1D,WAAW,IAAI,SAAS,GAAG,MAAM;IAIjC,YAAY,IAAI,SAAS,GAAG,MAAM;IAIlC,SAAS,IAAI,CAClB,SAAS,GAAG,MAAM,EAClB,SAAS,GAAG,MAAM,EAClB,SAAS,GAAG,MAAM,EAClB,SAAS,GAAG,MAAM,CACnB;IAIM,mBAAmB,IAAI,SAAS,GAAG,MAAM;IAIzC,eAAe,IAAI,SAAS,GAAG,MAAM;IAIrC,aAAa,IAAI,SAAS,GAAG,MAAM;IAInC,cAAc,IAAI,SAAS,GAAG,MAAM;IAIpC,WAAW,IAAI,SAAS,GAAG,MAAM;IAIjC,aAAa,IAAI,SAAS,GAAG,MAAM;IAInC,SAAS,IAAI,SAAS,GAAG,MAAM;IAI/B,UAAU,IAAI,SAAS,GAAG,MAAM;IAIhC,cAAc,IAAI,SAAS,GAAG,MAAM;CAG5C"} \ No newline at end of file +{"version":3,"file":"Geocoded.d.ts","sourceRoot":"","sources":["../src/Geocoded.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,YAAY,CAAC;AAEpC,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,UAAU,EAAE,GAAG,SAAS,CAAC;IACxE,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IACnC,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,WAAW,CAAC,EAAE,UAAU,EAAE,CAAC;IACpC,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;CAC/B;AAED,MAAM,CAAC,OAAO,OAAO,QAAQ;IAC3B,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAS;IAEnC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAS;IAEpC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAS;IAEhC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAS;IAE/B,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAS;IAEhC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAS;IAE/B,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAC,CAAS;IAE3C,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAS;IAEvC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAS;IAErC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAS;IAEtC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAS;IAEnC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAS;IAErC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAS;IAEjC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAe;IAE3C,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAS;IAElC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAS;IAEtC,SAAS,aAAa,EACpB,QAAQ,EACR,SAAS,EACT,KAAK,EACL,IAAI,EACJ,KAAK,EACL,IAAI,EACJ,gBAAgB,EAChB,YAAY,EACZ,UAAU,EACV,WAAW,EACX,QAAQ,EACR,UAAU,EACV,MAAM,EACN,WAAW,EACX,OAAO,EACP,WAAW,GACZ,EAAE,cAAc;WAmBH,MAAM,CAAC,MAAM,EAAE,cAAc,GAAG,QAAQ;IAI/C,QAAQ,IAAI,cAAc;IAqB1B,UAAU,CACf,KAAK,CAAC,EAAE,MAAM,EACd,IAAI,CAAC,EAAE,MAAM,EACb,KAAK,CAAC,EAAE,MAAM,EACd,IAAI,CAAC,EAAE,MAAM,GACZ,QAAQ;IAUJ,eAAe,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,QAAQ;IAQhE,cAAc,IAAI,CAAC,SAAS,GAAG,MAAM,EAAE,SAAS,GAAG,MAAM,CAAC;IAI1D,WAAW,IAAI,SAAS,GAAG,MAAM;IAIjC,YAAY,IAAI,SAAS,GAAG,MAAM;IAIlC,SAAS,IAAI,CAClB,SAAS,GAAG,MAAM,EAClB,SAAS,GAAG,MAAM,EAClB,SAAS,GAAG,MAAM,EAClB,SAAS,GAAG,MAAM,CACnB;IAIM,mBAAmB,IAAI,SAAS,GAAG,MAAM;IAIzC,eAAe,IAAI,SAAS,GAAG,MAAM;IAIrC,aAAa,IAAI,SAAS,GAAG,MAAM;IAInC,cAAc,IAAI,SAAS,GAAG,MAAM;IAIpC,WAAW,IAAI,SAAS,GAAG,MAAM;IAIjC,aAAa,IAAI,SAAS,GAAG,MAAM;IAInC,SAAS,IAAI,SAAS,GAAG,MAAM;IAI/B,aAAa,CAAC,UAAU,EAAE,UAAU,GAAG,IAAI;IAI3C,cAAc,IAAI,UAAU,EAAE;IAI9B,UAAU,IAAI,SAAS,GAAG,MAAM;IAIhC,cAAc,IAAI,SAAS,GAAG,MAAM;CAG5C"} \ No newline at end of file diff --git a/types/GeocoderProviderFactory.d.ts b/types/GeocoderProviderFactory.d.ts index a5177b8..56bdd5b 100644 --- a/types/GeocoderProviderFactory.d.ts +++ b/types/GeocoderProviderFactory.d.ts @@ -1,6 +1,6 @@ import { ProviderInterface, ProviderOptionsInterface } from "providers"; export interface GeocoderProviderFactoryOptions extends ProviderOptionsInterface { - provider: "bing" | "google" | "mapbox" | "mapquest" | "openstreetmap" | "yandex"; + provider: "bing" | "google" | "mapbox" | "mapquest" | "nominatim" | "openstreetmap" | "yandex"; } export default class ProviderFactory { /** diff --git a/types/GeocoderProviderFactory.d.ts.map b/types/GeocoderProviderFactory.d.ts.map index a566a54..8983d3d 100644 --- a/types/GeocoderProviderFactory.d.ts.map +++ b/types/GeocoderProviderFactory.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"GeocoderProviderFactory.d.ts","sourceRoot":"","sources":["../src/GeocoderProviderFactory.ts"],"names":[],"mappings":"AAAA,OAAO,EAOL,iBAAiB,EACjB,wBAAwB,EAIzB,MAAM,WAAW,CAAC;AAGnB,MAAM,WAAW,8BACf,SAAQ,wBAAwB;IAChC,QAAQ,EACJ,MAAM,GACN,QAAQ,GACR,QAAQ,GACR,UAAU,GACV,eAAe,GACf,QAAQ,CAAC;CACd;AAED,MAAM,CAAC,OAAO,OAAO,eAAe;IAClC;;;;;;;;;OASG;WACW,cAAc,CAC1B,OAAO,EAAE,MAAM,GAAG,8BAA8B,GAC/C,iBAAiB,GAAG,SAAS;CAiCjC"} \ No newline at end of file +{"version":3,"file":"GeocoderProviderFactory.d.ts","sourceRoot":"","sources":["../src/GeocoderProviderFactory.ts"],"names":[],"mappings":"AAAA,OAAO,EAOL,iBAAiB,EACjB,wBAAwB,EAIzB,MAAM,WAAW,CAAC;AAGnB,MAAM,WAAW,8BACf,SAAQ,wBAAwB;IAChC,QAAQ,EACJ,MAAM,GACN,QAAQ,GACR,QAAQ,GACR,UAAU,GACV,WAAW,GACX,eAAe,GACf,QAAQ,CAAC;CACd;AAED,MAAM,CAAC,OAAO,OAAO,eAAe;IAClC;;;;;;;;;OASG;WACW,cAAc,CAC1B,OAAO,EAAE,MAAM,GAAG,8BAA8B,GAC/C,iBAAiB,GAAG,SAAS;CAkCjC"} \ No newline at end of file diff --git a/types/global.d.ts b/types/global.d.ts index db0c5f0..51ef465 100644 --- a/types/global.d.ts +++ b/types/global.d.ts @@ -1,7 +1,9 @@ import UniversalGeocoder from "UniversalGeocoder"; +import GeoJsonDumper from "GeoJsonDumper"; declare global { interface Window { UniversalGeocoder: typeof UniversalGeocoder; + GeoJsonDumper: typeof GeoJsonDumper; } } //# sourceMappingURL=global.d.ts.map \ No newline at end of file diff --git a/types/global.d.ts.map b/types/global.d.ts.map index a32cec4..f22c822 100644 --- a/types/global.d.ts.map +++ b/types/global.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"global.d.ts","sourceRoot":"","sources":["../src/global.ts"],"names":[],"mappings":"AAAA,OAAO,iBAAiB,MAAM,mBAAmB,CAAC;AAMlD,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,iBAAiB,EAAE,OAAO,iBAAiB,CAAC;KAC7C;CACF"} \ No newline at end of file +{"version":3,"file":"global.d.ts","sourceRoot":"","sources":["../src/global.ts"],"names":[],"mappings":"AAAA,OAAO,iBAAiB,MAAM,mBAAmB,CAAC;AAClD,OAAO,aAAa,MAAM,eAAe,CAAC;AAO1C,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,iBAAiB,EAAE,OAAO,iBAAiB,CAAC;QAC5C,aAAa,EAAE,OAAO,aAAa,CAAC;KACrC;CACF"} \ No newline at end of file diff --git a/types/index.d.ts b/types/index.d.ts index a5c5322..5118a5f 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -10,13 +10,15 @@ export interface Coordinates { } export * from "providers"; export * from "query"; +export { default as AdminLevel } from "AdminLevel"; +export * from "AdminLevel"; export { default as ExternalURILoader } from "ExternalURILoader"; export * from "ExternalURILoader"; export { default as Geocoded } from "Geocoded"; export * from "Geocoded"; export { default as GeocoderProviderFactory } from "GeocoderProviderFactory"; export * from "GeocoderProviderFactory"; -export { default as GeoJSONDumper } from "GeoJSONDumper"; -export * from "GeoJSONDumper"; +export { default as GeoJsonDumper } from "GeoJsonDumper"; +export * from "GeoJsonDumper"; export { default } from "UniversalGeocoder"; //# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/types/index.d.ts.map b/types/index.d.ts.map index 292855e..c758aca 100644 --- a/types/index.d.ts.map +++ b/types/index.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,MAAM;IACrB,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IAChC,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;IAC/B,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IAChC,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;CAChC;AAED,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAAC;IACnC,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAAC;CACrC;AAED,cAAc,WAAW,CAAC;AAC1B,cAAc,OAAO,CAAC;AACtB,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACjE,cAAc,mBAAmB,CAAC;AAClC,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,UAAU,CAAC;AAC/C,cAAc,UAAU,CAAC;AACzB,OAAO,EAAE,OAAO,IAAI,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AAC7E,cAAc,yBAAyB,CAAC;AACxC,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,eAAe,CAAC;AACzD,cAAc,eAAe,CAAC;AAC9B,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC"} \ No newline at end of file +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,MAAM;IACrB,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IAChC,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;IAC/B,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IAChC,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;CAChC;AAED,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAAC;IACnC,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAAC;CACrC;AAED,cAAc,WAAW,CAAC;AAC1B,cAAc,OAAO,CAAC;AACtB,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,YAAY,CAAC;AACnD,cAAc,YAAY,CAAC;AAC3B,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACjE,cAAc,mBAAmB,CAAC;AAClC,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,UAAU,CAAC;AAC/C,cAAc,UAAU,CAAC;AACzB,OAAO,EAAE,OAAO,IAAI,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AAC7E,cAAc,yBAAyB,CAAC;AACxC,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,eAAe,CAAC;AACzD,cAAc,eAAe,CAAC;AAC9B,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC"} \ No newline at end of file diff --git a/types/providers/BingProvider.d.ts b/types/providers/BingProvider.d.ts index 294e09b..4ae089d 100644 --- a/types/providers/BingProvider.d.ts +++ b/types/providers/BingProvider.d.ts @@ -2,9 +2,10 @@ import { ExternalLoaderInterface, ExternalLoaderParams } from "ExternalURILoader import { GeocodedResultsCallback, ProviderInterface, ProviderOptionsInterface } from "providers"; import Geocoded from "Geocoded"; import { GeocodeQuery, GeocodeQueryObject, ReverseQuery, ReverseQueryObject } from "query"; +import { Box } from "types"; export interface BingResult { __type: string; - bbox: [number, number, number, number]; + bbox: Box; name: string; point: { type: string; diff --git a/types/providers/BingProvider.d.ts.map b/types/providers/BingProvider.d.ts.map index eac04a4..5dd1fd1 100644 --- a/types/providers/BingProvider.d.ts.map +++ b/types/providers/BingProvider.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"BingProvider.d.ts","sourceRoot":"","sources":["../../src/providers/BingProvider.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EACvB,oBAAoB,EACrB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,uBAAuB,EAEvB,iBAAiB,EACjB,wBAAwB,EAEzB,MAAM,WAAW,CAAC;AACnB,OAAO,QAAQ,MAAM,UAAU,CAAC;AAChC,OAAO,EACL,YAAY,EACZ,kBAAkB,EAClB,YAAY,EACZ,kBAAkB,EACnB,MAAM,OAAO,CAAC;AAQf,MAAM,WAAW,UAAU;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IACvC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE;QACL,IAAI,EAAE,MAAM,CAAC;QACb,WAAW,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;KAC/B,CAAC;IACF,OAAO,EAAE;QACP,WAAW,EAAE,MAAM,CAAC;QACpB,aAAa,EAAE,MAAM,CAAC;QACtB,cAAc,EAAE,MAAM,CAAC;QACvB,aAAa,EAAE,MAAM,CAAC;QACtB,gBAAgB,EAAE,MAAM,CAAC;QACzB,QAAQ,EAAE,MAAM,CAAC;QACjB,UAAU,EAAE,MAAM,CAAC;KACpB,CAAC;IACF,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE;QACb,IAAI,EAAE,MAAM,CAAC;QACb,WAAW,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QAC9B,iBAAiB,EAAE,MAAM,CAAC;QAC1B,UAAU,EAAE,MAAM,EAAE,CAAC;KACtB,EAAE,CAAC;IACJ,UAAU,EAAE,MAAM,EAAE,CAAC;CACtB;AAED,MAAM,CAAC,OAAO,OAAO,YAAa,YAAW,iBAAiB;IAC5D,OAAO,CAAC,cAAc,CAA0B;IAEhD,OAAO,CAAC,OAAO,CAA2B;gBAGxC,eAAe,EAAE,uBAAuB,EACxC,OAAO,GAAE,wBAAiD;IAWrD,OAAO,CACZ,KAAK,EAAE,MAAM,GAAG,YAAY,GAAG,kBAAkB,EACjD,QAAQ,EAAE,uBAAuB,GAChC,IAAI;IAiBA,SAAS,CACd,eAAe,EAAE,MAAM,GAAG,MAAM,GAAG,YAAY,GAAG,kBAAkB,EACpE,mBAAmB,EAAE,MAAM,GAAG,MAAM,GAAG,uBAAuB,EAC9D,QAAQ,CAAC,EAAE,uBAAuB,GACjC,IAAI;IA0BA,cAAc,CACnB,MAAM,EAAE,oBAAoB,EAC5B,QAAQ,EAAE,uBAAuB,GAChC,IAAI;WAUO,aAAa,CAAC,MAAM,EAAE,UAAU,GAAG,QAAQ;CA4B1D"} \ No newline at end of file +{"version":3,"file":"BingProvider.d.ts","sourceRoot":"","sources":["../../src/providers/BingProvider.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EACvB,oBAAoB,EACrB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,uBAAuB,EAEvB,iBAAiB,EACjB,wBAAwB,EAEzB,MAAM,WAAW,CAAC;AACnB,OAAO,QAAQ,MAAM,UAAU,CAAC;AAChC,OAAO,EACL,YAAY,EACZ,kBAAkB,EAClB,YAAY,EACZ,kBAAkB,EACnB,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAQ5B,MAAM,WAAW,UAAU;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,GAAG,CAAC;IACV,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE;QACL,IAAI,EAAE,MAAM,CAAC;QACb,WAAW,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;KAC/B,CAAC;IACF,OAAO,EAAE;QACP,WAAW,EAAE,MAAM,CAAC;QACpB,aAAa,EAAE,MAAM,CAAC;QACtB,cAAc,EAAE,MAAM,CAAC;QACvB,aAAa,EAAE,MAAM,CAAC;QACtB,gBAAgB,EAAE,MAAM,CAAC;QACzB,QAAQ,EAAE,MAAM,CAAC;QACjB,UAAU,EAAE,MAAM,CAAC;KACpB,CAAC;IACF,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE;QACb,IAAI,EAAE,MAAM,CAAC;QACb,WAAW,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QAC9B,iBAAiB,EAAE,MAAM,CAAC;QAC1B,UAAU,EAAE,MAAM,EAAE,CAAC;KACtB,EAAE,CAAC;IACJ,UAAU,EAAE,MAAM,EAAE,CAAC;CACtB;AAED,MAAM,CAAC,OAAO,OAAO,YAAa,YAAW,iBAAiB;IAC5D,OAAO,CAAC,cAAc,CAA0B;IAEhD,OAAO,CAAC,OAAO,CAA2B;gBAGxC,eAAe,EAAE,uBAAuB,EACxC,OAAO,GAAE,wBAAiD;IAWrD,OAAO,CACZ,KAAK,EAAE,MAAM,GAAG,YAAY,GAAG,kBAAkB,EACjD,QAAQ,EAAE,uBAAuB,GAChC,IAAI;IAiBA,SAAS,CACd,eAAe,EAAE,MAAM,GAAG,MAAM,GAAG,YAAY,GAAG,kBAAkB,EACpE,mBAAmB,EAAE,MAAM,GAAG,MAAM,GAAG,uBAAuB,EAC9D,QAAQ,CAAC,EAAE,uBAAuB,GACjC,IAAI;IA0BA,cAAc,CACnB,MAAM,EAAE,oBAAoB,EAC5B,QAAQ,EAAE,uBAAuB,GAChC,IAAI;WAUO,aAAa,CAAC,MAAM,EAAE,UAAU,GAAG,QAAQ;CA4B1D"} \ No newline at end of file diff --git a/types/providers/OpenStreetMapProvider.d.ts b/types/providers/OpenStreetMapProvider.d.ts deleted file mode 100644 index f42bec1..0000000 --- a/types/providers/OpenStreetMapProvider.d.ts +++ /dev/null @@ -1,43 +0,0 @@ -import { ExternalLoaderInterface, ExternalLoaderParams } from "ExternalURILoader"; -import { GeocodedResultsCallback, ProviderInterface, ProviderOptionsInterface } from "providers"; -import Geocoded from "Geocoded"; -import { GeocodeQuery, GeocodeQueryObject, ReverseQuery, ReverseQueryObject } from "query"; -export interface OpenStreetMapResult { - place_id: number; - licence: string; - osm_type: string; - osm_id: number; - boundingbox: [string, string, string, string]; - lat: string; - lon: string; - display_name: string; - class: string; - type: string; - importance: number; - icon: string; - address: { - attraction?: string; - house_number?: string; - road?: string; - neighbourhood?: string; - suburb?: string; - city?: string; - town?: string; - village?: string; - hamlet?: string; - state?: string; - postcode?: string; - country?: string; - country_code?: string; - }; -} -export default class OpenStreetMapProvider implements ProviderInterface { - private externalLoader; - private options; - constructor(_externalLoader: ExternalLoaderInterface, options?: ProviderOptionsInterface); - geocode(query: string | GeocodeQuery | GeocodeQueryObject, callback: GeocodedResultsCallback): void; - geodecode(latitudeOrQuery: number | string | ReverseQuery | ReverseQueryObject, longitudeOrCallback: number | string | GeocodedResultsCallback, callback?: GeocodedResultsCallback): void; - executeRequest(params: ExternalLoaderParams, callback: GeocodedResultsCallback): void; - static mapToGeocoded(result: OpenStreetMapResult): Geocoded; -} -//# sourceMappingURL=OpenStreetMapProvider.d.ts.map \ No newline at end of file diff --git a/types/providers/OpenStreetMapProvider.d.ts.map b/types/providers/OpenStreetMapProvider.d.ts.map deleted file mode 100644 index 875b5aa..0000000 --- a/types/providers/OpenStreetMapProvider.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"OpenStreetMapProvider.d.ts","sourceRoot":"","sources":["../../src/providers/OpenStreetMapProvider.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EACvB,oBAAoB,EACrB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,uBAAuB,EAEvB,iBAAiB,EACjB,wBAAwB,EAEzB,MAAM,WAAW,CAAC;AACnB,OAAO,QAAQ,MAAM,UAAU,CAAC;AAChC,OAAO,EACL,YAAY,EACZ,kBAAkB,EAClB,YAAY,EACZ,kBAAkB,EACnB,MAAM,OAAO,CAAC;AAaf,MAAM,WAAW,mBAAmB;IAElC,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAEhB,QAAQ,EAAE,MAAM,CAAC;IAEjB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IAC9C,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IAEZ,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE;QACP,UAAU,CAAC,EAAE,MAAM,CAAC;QAEpB,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,OAAO,CAAC,EAAE,MAAM,CAAC;QAEjB,YAAY,CAAC,EAAE,MAAM,CAAC;KACvB,CAAC;CACH;AAED,MAAM,CAAC,OAAO,OAAO,qBAAsB,YAAW,iBAAiB;IACrE,OAAO,CAAC,cAAc,CAA0B;IAEhD,OAAO,CAAC,OAAO,CAA2B;gBAGxC,eAAe,EAAE,uBAAuB,EACxC,OAAO,GAAE,wBAAiD;IAMrD,OAAO,CACZ,KAAK,EAAE,MAAM,GAAG,YAAY,GAAG,kBAAkB,EACjD,QAAQ,EAAE,uBAAuB,GAChC,IAAI;IAmBA,SAAS,CACd,eAAe,EAAE,MAAM,GAAG,MAAM,GAAG,YAAY,GAAG,kBAAkB,EACpE,mBAAmB,EAAE,MAAM,GAAG,MAAM,GAAG,uBAAuB,EAC9D,QAAQ,CAAC,EAAE,uBAAuB,GACjC,IAAI;IA4BA,cAAc,CACnB,MAAM,EAAE,oBAAoB,EAC5B,QAAQ,EAAE,uBAAuB,GAChC,IAAI;WAYO,aAAa,CAAC,MAAM,EAAE,mBAAmB,GAAG,QAAQ;CAgDnE"} \ No newline at end of file diff --git a/types/providers/ProviderInterface.d.ts b/types/providers/ProviderInterface.d.ts index 1664af7..fd959cb 100644 --- a/types/providers/ProviderInterface.d.ts +++ b/types/providers/ProviderInterface.d.ts @@ -1,4 +1,4 @@ -import { ExternalLoaderParams } from "ExternalURILoader"; +import { ExternalLoaderHeaders, ExternalLoaderParams } from "ExternalURILoader"; import Geocoded from "Geocoded"; import { GeocodeQuery, GeocodeQueryObject, ReverseQuery, ReverseQueryObject } from "query"; export declare const DEFAULT_RESULT_LIMIT = 5; @@ -12,6 +12,6 @@ export declare type GeocodedResultsCallback = (results: Geocoded[]) => void; export default interface ProviderInterface { geocode(query: string | GeocodeQuery | GeocodeQueryObject, callback: GeocodedResultsCallback): void; geodecode(latitudeOrQuery: number | string | ReverseQuery | ReverseQueryObject, longitudeOrCallback: number | string | GeocodedResultsCallback, callback?: GeocodedResultsCallback): void; - executeRequest(params: ExternalLoaderParams, callback: GeocodedResultsCallback): void; + executeRequest(params: ExternalLoaderParams, callback: GeocodedResultsCallback, headers?: ExternalLoaderHeaders): void; } //# sourceMappingURL=ProviderInterface.d.ts.map \ No newline at end of file diff --git a/types/providers/ProviderInterface.d.ts.map b/types/providers/ProviderInterface.d.ts.map index ac42e1a..510ec82 100644 --- a/types/providers/ProviderInterface.d.ts.map +++ b/types/providers/ProviderInterface.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"ProviderInterface.d.ts","sourceRoot":"","sources":["../../src/providers/ProviderInterface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,QAAQ,MAAM,UAAU,CAAC;AAChC,OAAO,EACL,YAAY,EACZ,kBAAkB,EAClB,YAAY,EACZ,kBAAkB,EACnB,MAAM,OAAO,CAAC;AAEf,eAAO,MAAM,oBAAoB,IAAI,CAAC;AAEtC,eAAO,MAAM,sBAAsB,EAAE,wBAGpC,CAAC;AAEF,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IACzB,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,oBAAY,uBAAuB,GAAG,CAAC,OAAO,EAAE,QAAQ,EAAE,KAAK,IAAI,CAAC;AAEpE,MAAM,CAAC,OAAO,WAAW,iBAAiB;IACxC,OAAO,CACL,KAAK,EAAE,MAAM,GAAG,YAAY,GAAG,kBAAkB,EACjD,QAAQ,EAAE,uBAAuB,GAChC,IAAI,CAAC;IACR,SAAS,CACP,eAAe,EAAE,MAAM,GAAG,MAAM,GAAG,YAAY,GAAG,kBAAkB,EACpE,mBAAmB,EAAE,MAAM,GAAG,MAAM,GAAG,uBAAuB,EAC9D,QAAQ,CAAC,EAAE,uBAAuB,GACjC,IAAI,CAAC;IACR,cAAc,CACZ,MAAM,EAAE,oBAAoB,EAC5B,QAAQ,EAAE,uBAAuB,GAChC,IAAI,CAAC;CACT"} \ No newline at end of file +{"version":3,"file":"ProviderInterface.d.ts","sourceRoot":"","sources":["../../src/providers/ProviderInterface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAChF,OAAO,QAAQ,MAAM,UAAU,CAAC;AAChC,OAAO,EACL,YAAY,EACZ,kBAAkB,EAClB,YAAY,EACZ,kBAAkB,EACnB,MAAM,OAAO,CAAC;AAEf,eAAO,MAAM,oBAAoB,IAAI,CAAC;AAEtC,eAAO,MAAM,sBAAsB,EAAE,wBAGpC,CAAC;AAEF,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IACzB,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,oBAAY,uBAAuB,GAAG,CAAC,OAAO,EAAE,QAAQ,EAAE,KAAK,IAAI,CAAC;AAEpE,MAAM,CAAC,OAAO,WAAW,iBAAiB;IACxC,OAAO,CACL,KAAK,EAAE,MAAM,GAAG,YAAY,GAAG,kBAAkB,EACjD,QAAQ,EAAE,uBAAuB,GAChC,IAAI,CAAC;IACR,SAAS,CACP,eAAe,EAAE,MAAM,GAAG,MAAM,GAAG,YAAY,GAAG,kBAAkB,EACpE,mBAAmB,EAAE,MAAM,GAAG,MAAM,GAAG,uBAAuB,EAC9D,QAAQ,CAAC,EAAE,uBAAuB,GACjC,IAAI,CAAC;IACR,cAAc,CACZ,MAAM,EAAE,oBAAoB,EAC5B,QAAQ,EAAE,uBAAuB,EACjC,OAAO,CAAC,EAAE,qBAAqB,GAC9B,IAAI,CAAC;CACT"} \ No newline at end of file diff --git a/types/providers/YandexProvider.d.ts b/types/providers/YandexProvider.d.ts index 7e803d8..0c622c8 100644 --- a/types/providers/YandexProvider.d.ts +++ b/types/providers/YandexProvider.d.ts @@ -44,15 +44,9 @@ export interface YandexResult { pos: string; }; } -interface YandexProviderOptionsInterface extends ProviderOptionsInterface { - readonly lang: string; +export interface YandexProviderOptionsInterface extends ProviderOptionsInterface { + readonly toponym?: "house" | "street" | "metro" | "district" | "locality"; } -export declare const defaultYandexProviderOptions: { - lang: string; - useSsl: boolean; - useJsonp: boolean; - apiKey?: string | undefined; -}; export default class YandexProvider implements ProviderInterface { private externalLoader; private options; @@ -63,5 +57,4 @@ export default class YandexProvider implements ProviderInterface { static mapToGeocoded(result: YandexResult): Geocoded; private static flattenObject; } -export {}; //# sourceMappingURL=YandexProvider.d.ts.map \ No newline at end of file diff --git a/types/providers/YandexProvider.d.ts.map b/types/providers/YandexProvider.d.ts.map index c33214b..c6abf03 100644 --- a/types/providers/YandexProvider.d.ts.map +++ b/types/providers/YandexProvider.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"YandexProvider.d.ts","sourceRoot":"","sources":["../../src/providers/YandexProvider.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EACvB,oBAAoB,EACrB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,uBAAuB,EAEvB,iBAAiB,EACjB,wBAAwB,EAEzB,MAAM,WAAW,CAAC;AACnB,OAAO,QAAQ,MAAM,UAAU,CAAC;AAChC,OAAO,EACL,YAAY,EACZ,kBAAkB,EAClB,YAAY,EACZ,kBAAkB,EACnB,MAAM,OAAO,CAAC;AAef,MAAM,WAAW,YAAY;IAC3B,gBAAgB,EAAE;QAChB,gBAAgB,EAAE;YAChB,IAAI,EAAE,MAAM,CAAC;YACb,IAAI,EAAE,MAAM,CAAC;YACb,SAAS,EAAE,MAAM,CAAC;YAClB,cAAc,EAAE;gBACd,OAAO,EAAE;oBACP,WAAW,EAAE,MAAM,CAAC;oBACpB,eAAe,EAAE,MAAM,CAAC;oBACxB,WAAW,EAAE,MAAM,CAAC;oBACpB,kBAAkB,CAAC,EAAE;wBACnB,sBAAsB,EAAE,MAAM,CAAC;wBAC/B,qBAAqB,CAAC,EAAE;4BACtB,yBAAyB,EAAE,MAAM,CAAC;4BAClC,QAAQ,CAAC,EAAE;gCACT,YAAY,EAAE,MAAM,CAAC;gCACrB,YAAY,CAAC,EAAE;oCACb,gBAAgB,EAAE,MAAM,CAAC;oCACzB,OAAO,EAAE;wCACP,aAAa,EAAE,MAAM,CAAC;qCACvB,CAAC;iCACH,CAAC;6BACH,CAAC;yBACH,CAAC;qBACH,CAAC;iBACH,CAAC;aACH,CAAC;SACH,CAAC;KACH,CAAC;IACF,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE;QACT,QAAQ,EAAE;YACR,WAAW,EAAE,MAAM,CAAC;YACpB,WAAW,EAAE,MAAM,CAAC;SACrB,CAAC;KACH,CAAC;IACF,KAAK,EAAE;QACL,GAAG,EAAE,MAAM,CAAC;KACb,CAAC;CACH;AAYD,UAAU,8BAA+B,SAAQ,wBAAwB;IACvE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED,eAAO,MAAM,4BAA4B;;;;;CAGxC,CAAC;AAEF,MAAM,CAAC,OAAO,OAAO,cAAe,YAAW,iBAAiB;IAC9D,OAAO,CAAC,cAAc,CAA0B;IAEhD,OAAO,CAAC,OAAO,CAAiC;gBAG9C,eAAe,EAAE,uBAAuB,EACxC,OAAO,GAAE,8BAA6D;IAMjE,OAAO,CACZ,KAAK,EAAE,MAAM,GAAG,YAAY,GAAG,kBAAkB,EACjD,QAAQ,EAAE,uBAAuB,GAChC,IAAI;IAoBA,SAAS,CACd,eAAe,EAAE,MAAM,GAAG,MAAM,GAAG,YAAY,GAAG,kBAAkB,EACpE,mBAAmB,EAAE,MAAM,GAAG,MAAM,GAAG,uBAAuB,EAC9D,QAAQ,CAAC,EAAE,uBAAuB,GACjC,IAAI;IA6BA,cAAc,CACnB,MAAM,EAAE,oBAAoB,EAC5B,QAAQ,EAAE,uBAAuB,GAChC,IAAI;WAWO,aAAa,CAAC,MAAM,EAAE,YAAY,GAAG,QAAQ;IAyC3D,OAAO,CAAC,MAAM,CAAC,aAAa;CA+B7B"} \ No newline at end of file +{"version":3,"file":"YandexProvider.d.ts","sourceRoot":"","sources":["../../src/providers/YandexProvider.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EACvB,oBAAoB,EACrB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,uBAAuB,EAEvB,iBAAiB,EACjB,wBAAwB,EAEzB,MAAM,WAAW,CAAC;AACnB,OAAO,QAAQ,MAAM,UAAU,CAAC;AAChC,OAAO,EACL,YAAY,EACZ,kBAAkB,EAClB,YAAY,EACZ,kBAAkB,EACnB,MAAM,OAAO,CAAC;AAgBf,MAAM,WAAW,YAAY;IAC3B,gBAAgB,EAAE;QAChB,gBAAgB,EAAE;YAChB,IAAI,EAAE,MAAM,CAAC;YACb,IAAI,EAAE,MAAM,CAAC;YACb,SAAS,EAAE,MAAM,CAAC;YAClB,cAAc,EAAE;gBACd,OAAO,EAAE;oBACP,WAAW,EAAE,MAAM,CAAC;oBACpB,eAAe,EAAE,MAAM,CAAC;oBACxB,WAAW,EAAE,MAAM,CAAC;oBACpB,kBAAkB,CAAC,EAAE;wBACnB,sBAAsB,EAAE,MAAM,CAAC;wBAC/B,qBAAqB,CAAC,EAAE;4BACtB,yBAAyB,EAAE,MAAM,CAAC;4BAClC,QAAQ,CAAC,EAAE;gCACT,YAAY,EAAE,MAAM,CAAC;gCACrB,YAAY,CAAC,EAAE;oCACb,gBAAgB,EAAE,MAAM,CAAC;oCACzB,OAAO,EAAE;wCACP,aAAa,EAAE,MAAM,CAAC;qCACvB,CAAC;iCACH,CAAC;6BACH,CAAC;yBACH,CAAC;qBACH,CAAC;iBACH,CAAC;aACH,CAAC;SACH,CAAC;KACH,CAAC;IACF,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE;QACT,QAAQ,EAAE;YACR,WAAW,EAAE,MAAM,CAAC;YACpB,WAAW,EAAE,MAAM,CAAC;SACrB,CAAC;KACH,CAAC;IACF,KAAK,EAAE;QACL,GAAG,EAAE,MAAM,CAAC;KACb,CAAC;CACH;AAYD,MAAM,WAAW,8BACf,SAAQ,wBAAwB;IAChC,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,GAAG,UAAU,GAAG,UAAU,CAAC;CAC3E;AAED,MAAM,CAAC,OAAO,OAAO,cAAe,YAAW,iBAAiB;IAC9D,OAAO,CAAC,cAAc,CAA0B;IAEhD,OAAO,CAAC,OAAO,CAAiC;gBAG9C,eAAe,EAAE,uBAAuB,EACxC,OAAO,GAAE,8BAAuD;IAM3D,OAAO,CACZ,KAAK,EAAE,MAAM,GAAG,YAAY,GAAG,kBAAkB,EACjD,QAAQ,EAAE,uBAAuB,GAChC,IAAI;IAoBA,SAAS,CACd,eAAe,EAAE,MAAM,GAAG,MAAM,GAAG,YAAY,GAAG,kBAAkB,EACpE,mBAAmB,EAAE,MAAM,GAAG,MAAM,GAAG,uBAAuB,EAC9D,QAAQ,CAAC,EAAE,uBAAuB,GACjC,IAAI;IA8BA,cAAc,CACnB,MAAM,EAAE,oBAAoB,EAC5B,QAAQ,EAAE,uBAAuB,GAChC,IAAI;WAWO,aAAa,CAAC,MAAM,EAAE,YAAY,GAAG,QAAQ;IAyC3D,OAAO,CAAC,MAAM,CAAC,aAAa;CA+B7B"} \ No newline at end of file diff --git a/types/providers/index.d.ts b/types/providers/index.d.ts index 6fd840a..b46cbc0 100644 --- a/types/providers/index.d.ts +++ b/types/providers/index.d.ts @@ -8,8 +8,7 @@ export * from "providers/GoogleAPIProvider"; export * from "providers/mapbox"; export { default as MapquestProvider } from "providers/MapquestProvider"; export * from "providers/MapquestProvider"; -export { default as OpenStreetMapProvider } from "providers/OpenStreetMapProvider"; -export * from "providers/OpenStreetMapProvider"; +export * from "providers/nominatim"; export { default as YandexProvider } from "providers/YandexProvider"; export * from "providers/YandexProvider"; //# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/types/providers/index.d.ts.map b/types/providers/index.d.ts.map index 5be1593..6ed9430 100644 --- a/types/providers/index.d.ts.map +++ b/types/providers/index.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/providers/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,2BAA2B,CAAC;AACvE,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAC3E,cAAc,6BAA6B,CAAC;AAC5C,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACjE,cAAc,wBAAwB,CAAC;AACvC,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAC3E,cAAc,6BAA6B,CAAC;AAC5C,cAAc,kBAAkB,CAAC;AACjC,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AACzE,cAAc,4BAA4B,CAAC;AAC3C,OAAO,EAAE,OAAO,IAAI,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AACnF,cAAc,iCAAiC,CAAC;AAChD,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,0BAA0B,CAAC;AACrE,cAAc,0BAA0B,CAAC"} \ No newline at end of file +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/providers/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,2BAA2B,CAAC;AACvE,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAC3E,cAAc,6BAA6B,CAAC;AAC5C,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACjE,cAAc,wBAAwB,CAAC;AACvC,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAC3E,cAAc,6BAA6B,CAAC;AAC5C,cAAc,kBAAkB,CAAC;AACjC,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AACzE,cAAc,4BAA4B,CAAC;AAC3C,cAAc,qBAAqB,CAAC;AACpC,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,0BAA0B,CAAC;AACrE,cAAc,0BAA0B,CAAC"} \ No newline at end of file diff --git a/types/providers/mapbox/MapboxProvider.d.ts b/types/providers/mapbox/MapboxProvider.d.ts index 9dca18f..009f3bf 100644 --- a/types/providers/mapbox/MapboxProvider.d.ts +++ b/types/providers/mapbox/MapboxProvider.d.ts @@ -1,6 +1,7 @@ import { ExternalLoaderInterface, ExternalLoaderParams } from "ExternalURILoader"; import { GeocodedResultsCallback, MapboxGeocodeQuery, MapboxGeocodeQueryObject, MapboxReverseQuery, MapboxReverseQueryObject, ProviderInterface, ProviderOptionsInterface } from "providers"; import Geocoded from "Geocoded"; +import { Box } from "types"; interface MapboxFeatureContextProperties { id: string; text: string; @@ -27,7 +28,7 @@ export interface MapboxResult { matching_text?: string; matching_place_name?: string; language?: string; - bbox?: [number, number, number, number]; + bbox?: Box; center: [number, number]; geometry: { type: "Point"; @@ -44,10 +45,9 @@ export declare enum GEOCODING_MODES { GEOCODING_MODE_PLACES = "mapbox.places", GEOCODING_MODE_PLACES_PERMANENT = "mapbox.places-permanent" } -interface MapboxProviderOptionsInterface extends ProviderOptionsInterface { +export interface MapboxProviderOptionsInterface extends ProviderOptionsInterface { readonly geocodingMode: GEOCODING_MODES; readonly country?: string; - readonly language?: string; } export declare const defaultMapboxProviderOptions: { geocodingMode: GEOCODING_MODES; diff --git a/types/providers/mapbox/MapboxProvider.d.ts.map b/types/providers/mapbox/MapboxProvider.d.ts.map index fda6333..3f159d6 100644 --- a/types/providers/mapbox/MapboxProvider.d.ts.map +++ b/types/providers/mapbox/MapboxProvider.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"MapboxProvider.d.ts","sourceRoot":"","sources":["../../../src/providers/mapbox/MapboxProvider.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EACvB,oBAAoB,EACrB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,uBAAuB,EACvB,kBAAkB,EAClB,wBAAwB,EACxB,kBAAkB,EAClB,wBAAwB,EAExB,iBAAiB,EACjB,wBAAwB,EAEzB,MAAM,WAAW,CAAC;AACnB,OAAO,QAAQ,MAAM,UAAU,CAAC;AAahC,UAAU,8BAA8B;IACtC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,UAAU,uBAAuB;IAC/B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,SAAS,CAAC;IAEhB,UAAU,EAAE,CACR,SAAS,GACT,QAAQ,GACR,UAAU,GACV,UAAU,GACV,OAAO,GACP,UAAU,GACV,cAAc,GACd,SAAS,GACT,KAAK,CACR,EAAE,CAAC;IACJ,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,uBAAuB,CAAC;IACpC,IAAI,EAAE,MAAM,CAAC;IAEb,UAAU,EAAE,MAAM,CAAC;IAEnB,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IACxC,MAAM,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACzB,QAAQ,EAAE;QACR,IAAI,EAAE,OAAO,CAAC;QACd,WAAW,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;KAC/B,CAAC;IACF,OAAO,CAAC,EAAE,8BAA8B,EAAE,CAAC;IAE3C,eAAe,CAAC,EAAE;QAChB,MAAM,CAAC,EAAE;YACP,WAAW,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;SAC/B,EAAE,CAAC;KACL,CAAC;CACH;AAED,oBAAY,eAAe;IACzB,qBAAqB,kBAAkB;IACvC,+BAA+B,4BAA4B;CAC5D;AAED,UAAU,8BAA+B,SAAQ,wBAAwB;IACvE,QAAQ,CAAC,aAAa,EAAE,eAAe,CAAC;IACxC,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED,eAAO,MAAM,4BAA4B;;;;;CAGxC,CAAC;AAEF,MAAM,CAAC,OAAO,OAAO,cAAe,YAAW,iBAAiB;IAC9D,OAAO,CAAC,cAAc,CAA0B;IAEhD,OAAO,CAAC,OAAO,CAAiC;gBAG9C,eAAe,EAAE,uBAAuB,EACxC,OAAO,GAAE,8BAA6D;IAWjE,OAAO,CACZ,KAAK,EAAE,MAAM,GAAG,kBAAkB,GAAG,wBAAwB,EAC7D,QAAQ,EAAE,uBAAuB,GAChC,IAAI;IAkCA,SAAS,CACd,eAAe,EACX,MAAM,GACN,MAAM,GACN,kBAAkB,GAClB,wBAAwB,EAC5B,mBAAmB,EAAE,MAAM,GAAG,MAAM,GAAG,uBAAuB,EAC9D,QAAQ,CAAC,EAAE,uBAAuB,GACjC,IAAI;IAgCA,cAAc,CACnB,MAAM,EAAE,oBAAoB,EAC5B,QAAQ,EAAE,uBAAuB,GAChC,IAAI;WAUO,aAAa,CAAC,MAAM,EAAE,YAAY,GAAG,QAAQ;CAwD5D"} \ No newline at end of file +{"version":3,"file":"MapboxProvider.d.ts","sourceRoot":"","sources":["../../../src/providers/mapbox/MapboxProvider.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EACvB,oBAAoB,EACrB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,uBAAuB,EACvB,kBAAkB,EAClB,wBAAwB,EACxB,kBAAkB,EAClB,wBAAwB,EAExB,iBAAiB,EACjB,wBAAwB,EAEzB,MAAM,WAAW,CAAC;AACnB,OAAO,QAAQ,MAAM,UAAU,CAAC;AAChC,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAa5B,UAAU,8BAA8B;IACtC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,UAAU,uBAAuB;IAC/B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,SAAS,CAAC;IAEhB,UAAU,EAAE,CACR,SAAS,GACT,QAAQ,GACR,UAAU,GACV,UAAU,GACV,OAAO,GACP,UAAU,GACV,cAAc,GACd,SAAS,GACT,KAAK,CACR,EAAE,CAAC;IACJ,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,uBAAuB,CAAC;IACpC,IAAI,EAAE,MAAM,CAAC;IAEb,UAAU,EAAE,MAAM,CAAC;IAEnB,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,GAAG,CAAC;IACX,MAAM,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACzB,QAAQ,EAAE;QACR,IAAI,EAAE,OAAO,CAAC;QACd,WAAW,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;KAC/B,CAAC;IACF,OAAO,CAAC,EAAE,8BAA8B,EAAE,CAAC;IAE3C,eAAe,CAAC,EAAE;QAChB,MAAM,CAAC,EAAE;YACP,WAAW,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;SAC/B,EAAE,CAAC;KACL,CAAC;CACH;AAED,oBAAY,eAAe;IACzB,qBAAqB,kBAAkB;IACvC,+BAA+B,4BAA4B;CAC5D;AAED,MAAM,WAAW,8BACf,SAAQ,wBAAwB;IAChC,QAAQ,CAAC,aAAa,EAAE,eAAe,CAAC;IACxC,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,eAAO,MAAM,4BAA4B;;;;;CAGxC,CAAC;AAEF,MAAM,CAAC,OAAO,OAAO,cAAe,YAAW,iBAAiB;IAC9D,OAAO,CAAC,cAAc,CAA0B;IAEhD,OAAO,CAAC,OAAO,CAAiC;gBAG9C,eAAe,EAAE,uBAAuB,EACxC,OAAO,GAAE,8BAA6D;IAWjE,OAAO,CACZ,KAAK,EAAE,MAAM,GAAG,kBAAkB,GAAG,wBAAwB,EAC7D,QAAQ,EAAE,uBAAuB,GAChC,IAAI;IAkCA,SAAS,CACd,eAAe,EACX,MAAM,GACN,MAAM,GACN,kBAAkB,GAClB,wBAAwB,EAC5B,mBAAmB,EAAE,MAAM,GAAG,MAAM,GAAG,uBAAuB,EAC9D,QAAQ,CAAC,EAAE,uBAAuB,GACjC,IAAI;IAgCA,cAAc,CACnB,MAAM,EAAE,oBAAoB,EAC5B,QAAQ,EAAE,uBAAuB,GAChC,IAAI;WAUO,aAAa,CAAC,MAAM,EAAE,YAAY,GAAG,QAAQ;CAwD5D"} \ No newline at end of file diff --git a/types/providers/nominatim/NominatimGeocodeQuery.d.ts b/types/providers/nominatim/NominatimGeocodeQuery.d.ts new file mode 100644 index 0000000..2c1dd59 --- /dev/null +++ b/types/providers/nominatim/NominatimGeocodeQuery.d.ts @@ -0,0 +1,26 @@ +import { GeocodeQuery, GeocodeQueryObject } from "query"; +import { Box } from "types"; +export interface NominatimGeocodeQueryObject extends GeocodeQueryObject { + readonly countryCodes?: string[]; + readonly excludePlaceIds?: number[]; + readonly viewBox?: Box; + readonly bounded?: boolean; +} +export default class NominatimGeocodeQuery extends GeocodeQuery { + private readonly countryCodes?; + private readonly excludePlaceIds?; + private readonly viewBox?; + private readonly bounded?; + protected constructor({ countryCodes, excludePlaceIds, viewBox, bounded, ...geocodeQueryObject }: NominatimGeocodeQueryObject); + static create(object: NominatimGeocodeQueryObject): NominatimGeocodeQuery; + toObject(): NominatimGeocodeQueryObject; + withCountryCodes(countryCodes: string[]): NominatimGeocodeQuery; + getCountryCodes(): undefined | string[]; + withExcludePlaceIds(excludePlaceIds: number[]): NominatimGeocodeQuery; + getExcludePlaceIds(): undefined | number[]; + withViewBox(viewBox: Box): NominatimGeocodeQuery; + getViewBox(): undefined | Box; + withBounded(bounded: boolean): NominatimGeocodeQuery; + getBounded(): undefined | boolean; +} +//# sourceMappingURL=NominatimGeocodeQuery.d.ts.map \ No newline at end of file diff --git a/types/providers/nominatim/NominatimGeocodeQuery.d.ts.map b/types/providers/nominatim/NominatimGeocodeQuery.d.ts.map new file mode 100644 index 0000000..e289732 --- /dev/null +++ b/types/providers/nominatim/NominatimGeocodeQuery.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"NominatimGeocodeQuery.d.ts","sourceRoot":"","sources":["../../../src/providers/nominatim/NominatimGeocodeQuery.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,OAAO,CAAC;AACzD,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAE5B,MAAM,WAAW,2BAA4B,SAAQ,kBAAkB;IACrE,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACjC,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;IACpC,QAAQ,CAAC,OAAO,CAAC,EAAE,GAAG,CAAC;IACvB,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED,MAAM,CAAC,OAAO,OAAO,qBAAsB,SAAQ,YAAY;IAC7D,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAW;IAEzC,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAW;IAE5C,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAM;IAE/B,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAU;IAEnC,SAAS,aAAa,EACpB,YAAY,EACZ,eAAe,EACf,OAAO,EACP,OAAO,EACP,GAAG,kBAAkB,EACtB,EAAE,2BAA2B;WAgBhB,MAAM,CAClB,MAAM,EAAE,2BAA2B,GAClC,qBAAqB;IAIjB,QAAQ,IAAI,2BAA2B;IAUvC,gBAAgB,CAAC,YAAY,EAAE,MAAM,EAAE,GAAG,qBAAqB;IAI/D,eAAe,IAAI,SAAS,GAAG,MAAM,EAAE;IAIvC,mBAAmB,CAAC,eAAe,EAAE,MAAM,EAAE,GAAG,qBAAqB;IAIrE,kBAAkB,IAAI,SAAS,GAAG,MAAM,EAAE;IAI1C,WAAW,CAAC,OAAO,EAAE,GAAG,GAAG,qBAAqB;IAIhD,UAAU,IAAI,SAAS,GAAG,GAAG;IAI7B,WAAW,CAAC,OAAO,EAAE,OAAO,GAAG,qBAAqB;IAIpD,UAAU,IAAI,SAAS,GAAG,OAAO;CAGzC"} \ No newline at end of file diff --git a/types/providers/nominatim/NominatimGeocoded.d.ts b/types/providers/nominatim/NominatimGeocoded.d.ts new file mode 100644 index 0000000..a4b55de --- /dev/null +++ b/types/providers/nominatim/NominatimGeocoded.d.ts @@ -0,0 +1,33 @@ +import Geocoded, { GeocodedObject } from "Geocoded"; +export interface NominatimGeocodedObject extends GeocodedObject { + readonly displayName?: string; + readonly osmId?: number; + readonly osmType?: string; + readonly category?: string; + readonly type?: string; + readonly attribution?: string; +} +export default class NominatimGeocoded extends Geocoded { + private readonly displayName?; + private readonly osmId?; + private readonly osmType?; + private readonly category?; + private readonly type?; + private readonly attribution?; + protected constructor({ displayName, osmId, osmType, category, type, attribution, ...geocodedObject }: NominatimGeocodedObject); + static create(object: NominatimGeocodedObject): NominatimGeocoded; + toObject(): NominatimGeocodedObject; + withDisplayName(displayName: string): NominatimGeocoded; + getDisplayName(): undefined | string; + withOsmId(osmId: number): NominatimGeocoded; + getOsmId(): undefined | number; + withOsmType(osmType: string): NominatimGeocoded; + getOsmType(): undefined | string; + withCategory(category: string): NominatimGeocoded; + getCategory(): undefined | string; + withType(type: string): NominatimGeocoded; + getType(): undefined | string; + withAttribution(attribution: string): NominatimGeocoded; + getAttribution(): undefined | string; +} +//# sourceMappingURL=NominatimGeocoded.d.ts.map \ No newline at end of file diff --git a/types/providers/nominatim/NominatimGeocoded.d.ts.map b/types/providers/nominatim/NominatimGeocoded.d.ts.map new file mode 100644 index 0000000..e09ceb8 --- /dev/null +++ b/types/providers/nominatim/NominatimGeocoded.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"NominatimGeocoded.d.ts","sourceRoot":"","sources":["../../../src/providers/nominatim/NominatimGeocoded.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,EAAE,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAEpD,MAAM,WAAW,uBAAwB,SAAQ,cAAc;IAC7D,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;CAC/B;AAED,MAAM,CAAC,OAAO,OAAO,iBAAkB,SAAQ,QAAQ;IACrD,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAS;IAEtC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAS;IAEhC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAS;IAElC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAS;IAEnC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAS;IAE/B,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAS;IAEtC,SAAS,aAAa,EACpB,WAAW,EACX,KAAK,EACL,OAAO,EACP,QAAQ,EACR,IAAI,EACJ,WAAW,EACX,GAAG,cAAc,EAClB,EAAE,uBAAuB;WAUZ,MAAM,CAAC,MAAM,EAAE,uBAAuB,GAAG,iBAAiB;IAIjE,QAAQ,IAAI,uBAAuB;IAYnC,eAAe,CAAC,WAAW,EAAE,MAAM,GAAG,iBAAiB;IAOvD,cAAc,IAAI,SAAS,GAAG,MAAM;IAIpC,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,iBAAiB;IAO3C,QAAQ,IAAI,SAAS,GAAG,MAAM;IAI9B,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,iBAAiB;IAO/C,UAAU,IAAI,SAAS,GAAG,MAAM;IAIhC,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,iBAAiB;IAOjD,WAAW,IAAI,SAAS,GAAG,MAAM;IAIjC,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,iBAAiB;IAOzC,OAAO,IAAI,SAAS,GAAG,MAAM;IAI7B,eAAe,CAAC,WAAW,EAAE,MAAM,GAAG,iBAAiB;IAOvD,cAAc,IAAI,SAAS,GAAG,MAAM;CAG5C"} \ No newline at end of file diff --git a/types/providers/nominatim/NominatimProvider.d.ts b/types/providers/nominatim/NominatimProvider.d.ts new file mode 100644 index 0000000..270448b --- /dev/null +++ b/types/providers/nominatim/NominatimProvider.d.ts @@ -0,0 +1,56 @@ +import { ExternalLoaderHeaders, ExternalLoaderInterface, ExternalLoaderParams } from "ExternalURILoader"; +import { GeocodedResultsCallback, NominatimGeocoded, NominatimReverseQuery, NominatimReverseQueryObject, NominatimGeocodeQueryObject, NominatimGeocodeQuery, ProviderInterface, ProviderOptionsInterface } from "providers"; +export interface NominatimResult { + place_id: number; + licence: string; + osm_type: string; + osm_id: number; + boundingbox: [string, string, string, string]; + lat: string; + lon: string; + display_name: string; + category: string; + type: string; + importance: number; + icon: string; + address: { + attraction?: string; + house_number?: string; + road?: string; + pedestrian?: string; + neighbourhood?: string; + suburb?: string; + city?: string; + town?: string; + village?: string; + hamlet?: string; + state?: string; + county?: string; + postcode?: string; + country?: string; + country_code?: string; + }; +} +export interface NominatimProviderOptionsInterface extends ProviderOptionsInterface { + readonly host: string; + readonly userAgent?: string; + readonly referer?: string; +} +export declare const defaultNominatimProviderOptions: { + host: string; + useSsl: boolean; + useJsonp: boolean; + apiKey?: string | undefined; +}; +export default class NominatimProvider implements ProviderInterface { + private externalLoader; + private options; + constructor(_externalLoader: ExternalLoaderInterface, options?: NominatimProviderOptionsInterface); + geocode(query: string | NominatimGeocodeQuery | NominatimGeocodeQueryObject, callback: GeocodedResultsCallback): void; + geodecode(latitudeOrQuery: number | string | NominatimReverseQuery | NominatimReverseQueryObject, longitudeOrCallback: number | string | GeocodedResultsCallback, callback?: GeocodedResultsCallback): void; + private getCommonParams; + private getHeaders; + executeRequest(params: ExternalLoaderParams, callback: GeocodedResultsCallback, headers?: ExternalLoaderHeaders): void; + static mapToGeocoded(result: NominatimResult): NominatimGeocoded; +} +//# sourceMappingURL=NominatimProvider.d.ts.map \ No newline at end of file diff --git a/types/providers/nominatim/NominatimProvider.d.ts.map b/types/providers/nominatim/NominatimProvider.d.ts.map new file mode 100644 index 0000000..6a57c93 --- /dev/null +++ b/types/providers/nominatim/NominatimProvider.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"NominatimProvider.d.ts","sourceRoot":"","sources":["../../../src/providers/nominatim/NominatimProvider.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EACrB,uBAAuB,EACvB,oBAAoB,EACrB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,uBAAuB,EACvB,iBAAiB,EACjB,qBAAqB,EACrB,2BAA2B,EAC3B,2BAA2B,EAC3B,qBAAqB,EAErB,iBAAiB,EACjB,wBAAwB,EAEzB,MAAM,WAAW,CAAC;AAsBnB,MAAM,WAAW,eAAe;IAE9B,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAEhB,QAAQ,EAAE,MAAM,CAAC;IAEjB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IAC9C,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IAEZ,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE;QACP,UAAU,CAAC,EAAE,MAAM,CAAC;QAEpB,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,OAAO,CAAC,EAAE,MAAM,CAAC;QAEjB,YAAY,CAAC,EAAE,MAAM,CAAC;KACvB,CAAC;CACH;AAED,MAAM,WAAW,iCACf,SAAQ,wBAAwB;IAChC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,eAAO,MAAM,+BAA+B;;;;;CAG3C,CAAC;AAEF,MAAM,CAAC,OAAO,OAAO,iBAAkB,YAAW,iBAAiB;IACjE,OAAO,CAAC,cAAc,CAA0B;IAEhD,OAAO,CAAC,OAAO,CAAoC;gBAGjD,eAAe,EAAE,uBAAuB,EACxC,OAAO,GAAE,iCAAmE;IAcvE,OAAO,CACZ,KAAK,EAAE,MAAM,GAAG,qBAAqB,GAAG,2BAA2B,EACnE,QAAQ,EAAE,uBAAuB,GAChC,IAAI;IAmDA,SAAS,CACd,eAAe,EACX,MAAM,GACN,MAAM,GACN,qBAAqB,GACrB,2BAA2B,EAC/B,mBAAmB,EAAE,MAAM,GAAG,MAAM,GAAG,uBAAuB,EAC9D,QAAQ,CAAC,EAAE,uBAAuB,GACjC,IAAI;IA8BP,OAAO,CAAC,eAAe;IAavB,OAAO,CAAC,UAAU;IAOX,cAAc,CACnB,MAAM,EAAE,oBAAoB,EAC5B,QAAQ,EAAE,uBAAuB,EACjC,OAAO,CAAC,EAAE,qBAAqB,GAC9B,IAAI;WAgBO,aAAa,CAAC,MAAM,EAAE,eAAe,GAAG,iBAAiB;CA0ExE"} \ No newline at end of file diff --git a/types/providers/nominatim/NominatimReverseQuery.d.ts b/types/providers/nominatim/NominatimReverseQuery.d.ts new file mode 100644 index 0000000..799b4de --- /dev/null +++ b/types/providers/nominatim/NominatimReverseQuery.d.ts @@ -0,0 +1,13 @@ +import { ReverseQuery, ReverseQueryObject } from "query"; +export interface NominatimReverseQueryObject extends ReverseQueryObject { + readonly zoom?: number; +} +export default class NominatimReverseQuery extends ReverseQuery { + private readonly zoom?; + protected constructor({ zoom, ...reverseQueryObject }: NominatimReverseQueryObject); + static create(object: NominatimReverseQueryObject): NominatimReverseQuery; + toObject(): NominatimReverseQueryObject; + withZoom(zoom: number): NominatimReverseQuery; + getZoom(): undefined | number; +} +//# sourceMappingURL=NominatimReverseQuery.d.ts.map \ No newline at end of file diff --git a/types/providers/nominatim/NominatimReverseQuery.d.ts.map b/types/providers/nominatim/NominatimReverseQuery.d.ts.map new file mode 100644 index 0000000..d0ddc7b --- /dev/null +++ b/types/providers/nominatim/NominatimReverseQuery.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"NominatimReverseQuery.d.ts","sourceRoot":"","sources":["../../../src/providers/nominatim/NominatimReverseQuery.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,OAAO,CAAC;AAEzD,MAAM,WAAW,2BAA4B,SAAQ,kBAAkB;IACrE,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,CAAC,OAAO,OAAO,qBAAsB,SAAQ,YAAY;IAC7D,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAS;IAE/B,SAAS,aAAa,EACpB,IAAI,EACJ,GAAG,kBAAkB,EACtB,EAAE,2BAA2B;WAKhB,MAAM,CAClB,MAAM,EAAE,2BAA2B,GAClC,qBAAqB;IAIjB,QAAQ,IAAI,2BAA2B;IAOvC,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,qBAAqB;IAI7C,OAAO,IAAI,SAAS,GAAG,MAAM;CAGrC"} \ No newline at end of file diff --git a/types/providers/nominatim/index.d.ts b/types/providers/nominatim/index.d.ts new file mode 100644 index 0000000..626912d --- /dev/null +++ b/types/providers/nominatim/index.d.ts @@ -0,0 +1,17 @@ +export { default as NominatimGeocoded } from "providers/nominatim/NominatimGeocoded"; +export { default as OpenStreetMapGeocoded } from "providers/nominatim/NominatimGeocoded"; +export * from "providers/nominatim/NominatimGeocoded"; +export { NominatimGeocodedObject as OpenStreetMapGeocodedObject } from "providers/nominatim/NominatimGeocoded"; +export { default as NominatimGeocodeQuery } from "providers/nominatim/NominatimGeocodeQuery"; +export { default as OpenStreetMapGeocodeQuery } from "providers/nominatim/NominatimGeocodeQuery"; +export * from "providers/nominatim/NominatimGeocodeQuery"; +export { NominatimGeocodeQueryObject as OpenStreetMapGeocodeQueryObject } from "providers/nominatim/NominatimGeocodeQuery"; +export { default as NominatimProvider } from "providers/nominatim/NominatimProvider"; +export { default as OpenStreetMapProvider } from "providers/nominatim/NominatimProvider"; +export * from "providers/nominatim/NominatimProvider"; +export { NominatimProviderOptionsInterface as OpenStreetMapProviderOptionsInterface, NominatimResult as OpenStreetMapResult, defaultNominatimProviderOptions as defaultOpenStreetMapProviderOptions, } from "providers/nominatim/NominatimProvider"; +export { default as NominatimReverseQuery } from "providers/nominatim/NominatimReverseQuery"; +export { default as OpenStreetMapReverseQuery } from "providers/nominatim/NominatimReverseQuery"; +export * from "providers/nominatim/NominatimReverseQuery"; +export { NominatimReverseQueryObject as OpenStreetMapReverseQueryObject } from "providers/nominatim/NominatimReverseQuery"; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/types/providers/nominatim/index.d.ts.map b/types/providers/nominatim/index.d.ts.map new file mode 100644 index 0000000..f86562d --- /dev/null +++ b/types/providers/nominatim/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/providers/nominatim/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,uCAAuC,CAAC;AACrF,OAAO,EAAE,OAAO,IAAI,qBAAqB,EAAE,MAAM,uCAAuC,CAAC;AACzF,cAAc,uCAAuC,CAAC;AACtD,OAAO,EAAE,uBAAuB,IAAI,2BAA2B,EAAE,MAAM,uCAAuC,CAAC;AAC/G,OAAO,EAAE,OAAO,IAAI,qBAAqB,EAAE,MAAM,2CAA2C,CAAC;AAC7F,OAAO,EAAE,OAAO,IAAI,yBAAyB,EAAE,MAAM,2CAA2C,CAAC;AACjG,cAAc,2CAA2C,CAAC;AAC1D,OAAO,EAAE,2BAA2B,IAAI,+BAA+B,EAAE,MAAM,2CAA2C,CAAC;AAC3H,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,uCAAuC,CAAC;AACrF,OAAO,EAAE,OAAO,IAAI,qBAAqB,EAAE,MAAM,uCAAuC,CAAC;AACzF,cAAc,uCAAuC,CAAC;AACtD,OAAO,EACL,iCAAiC,IAAI,qCAAqC,EAC1E,eAAe,IAAI,mBAAmB,EACtC,+BAA+B,IAAI,mCAAmC,GACvE,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAAE,OAAO,IAAI,qBAAqB,EAAE,MAAM,2CAA2C,CAAC;AAC7F,OAAO,EAAE,OAAO,IAAI,yBAAyB,EAAE,MAAM,2CAA2C,CAAC;AACjG,cAAc,2CAA2C,CAAC;AAC1D,OAAO,EAAE,2BAA2B,IAAI,+BAA+B,EAAE,MAAM,2CAA2C,CAAC"} \ No newline at end of file diff --git a/types/query/GeocodeQuery.d.ts.map b/types/query/GeocodeQuery.d.ts.map index a5c78c9..c918515 100644 --- a/types/query/GeocodeQuery.d.ts.map +++ b/types/query/GeocodeQuery.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"GeocodeQuery.d.ts","sourceRoot":"","sources":["../../src/query/GeocodeQuery.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACpC,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAE/B,aAAK,wBAAwB,GAAG,WAAW,CAAC,kBAAkB,EAAE,OAAO,CAAC,CAAC;AAEzE,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACjC,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAChC,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACjC,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAChC,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,CAAC,OAAO,OAAO,YAAY;IAC/B,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAS;IAE9B,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAkB;IAEzC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAkB;IAExC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAkB;IAEzC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAkB;IAExC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAS;IAEjC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAgC;IAEtD,SAAS,aAAa,EACpB,IAAI,EACJ,KAAK,EACL,IAAI,EACJ,KAAK,EACL,IAAI,EACJ,MAAM,EACN,KAA4B,GAC7B,EAAE,wBAAwB;WAUb,MAAM,CAAC,MAAM,EAAE,wBAAwB,GAAG,YAAY;IAI7D,QAAQ,IAAI,kBAAkB;IAY9B,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,YAAY;IAIpC,UAAU,CACf,KAAK,CAAC,EAAE,MAAM,EACd,IAAI,CAAC,EAAE,MAAM,EACb,KAAK,CAAC,EAAE,MAAM,EACd,IAAI,CAAC,EAAE,MAAM,GACZ,YAAY;IAUR,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY;IAIxC,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,YAAY;IAItC,OAAO,IAAI,MAAM;IAIjB,SAAS,IAAI,SAAS,GAAG,MAAM;IAa/B,SAAS,IAAI,SAAS,GAAG,MAAM;IAI/B,QAAQ,IAAI,MAAM;CAG1B"} \ No newline at end of file +{"version":3,"file":"GeocodeQuery.d.ts","sourceRoot":"","sources":["../../src/query/GeocodeQuery.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACpC,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAE/B,aAAK,wBAAwB,GAAG,WAAW,CAAC,kBAAkB,EAAE,OAAO,CAAC,CAAC;AAEzE,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACjC,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAChC,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACjC,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAChC,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,CAAC,OAAO,OAAO,YAAY;IAC/B,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAS;IAE9B,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAkB;IAEzC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAkB;IAExC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAkB;IAEzC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAkB;IAExC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAS;IAEjC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAgC;IAEtD,SAAS,aAAa,EACpB,IAAI,EACJ,KAAK,EACL,IAAI,EACJ,KAAK,EACL,IAAI,EACJ,MAAM,EACN,KAA4B,GAC7B,EAAE,wBAAwB;WAUb,MAAM,CAAC,MAAM,EAAE,wBAAwB,GAAG,YAAY;IAI7D,QAAQ,IAAI,kBAAkB;IAY9B,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,YAAY;IAOpC,UAAU,CACf,KAAK,CAAC,EAAE,MAAM,EACd,IAAI,CAAC,EAAE,MAAM,EACb,KAAK,CAAC,EAAE,MAAM,EACd,IAAI,CAAC,EAAE,MAAM,GACZ,YAAY;IAUR,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY;IAOxC,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,YAAY;IAOtC,OAAO,IAAI,MAAM;IAIjB,SAAS,IAAI,SAAS,GAAG,MAAM;IAa/B,SAAS,IAAI,SAAS,GAAG,MAAM;IAI/B,QAAQ,IAAI,MAAM;CAG1B"} \ No newline at end of file diff --git a/types/query/ReverseQuery.d.ts.map b/types/query/ReverseQuery.d.ts.map index f1662a4..95a70ee 100644 --- a/types/query/ReverseQuery.d.ts.map +++ b/types/query/ReverseQuery.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"ReverseQuery.d.ts","sourceRoot":"","sources":["../../src/query/ReverseQuery.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAEpC,aAAK,wBAAwB,GAAG,WAAW,CAAC,kBAAkB,EAAE,OAAO,CAAC,CAAC;AAEzE,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAAC;IACnC,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAAC;IACpC,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,CAAC,OAAO,OAAO,YAAY;IAC/B,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAkB;IAE3C,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAkB;IAE5C,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAS;IAEjC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAgC;IAEtD,SAAS,aAAa,EACpB,QAAQ,EACR,SAAS,EACT,MAAM,EACN,KAA4B,GAC7B,EAAE,wBAAwB;WAOb,MAAM,CAAC,MAAM,EAAE,wBAAwB,GAAG,YAAY;IAI7D,QAAQ,IAAI,kBAAkB;IAS9B,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,YAAY;IAQlE,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY;IAIxC,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,YAAY;IAItC,cAAc,IAAI,WAAW;IAI7B,SAAS,IAAI,SAAS,GAAG,MAAM;IAI/B,QAAQ,IAAI,MAAM;CAG1B"} \ No newline at end of file +{"version":3,"file":"ReverseQuery.d.ts","sourceRoot":"","sources":["../../src/query/ReverseQuery.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAEpC,aAAK,wBAAwB,GAAG,WAAW,CAAC,kBAAkB,EAAE,OAAO,CAAC,CAAC;AAEzE,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAAC;IACnC,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAAC;IACpC,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,CAAC,OAAO,OAAO,YAAY;IAC/B,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAkB;IAE3C,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAkB;IAE5C,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAS;IAEjC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAgC;IAEtD,SAAS,aAAa,EACpB,QAAQ,EACR,SAAS,EACT,MAAM,EACN,KAA4B,GAC7B,EAAE,wBAAwB;WAOb,MAAM,CAAC,MAAM,EAAE,wBAAwB,GAAG,YAAY;IAI7D,QAAQ,IAAI,kBAAkB;IAS9B,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,YAAY;IAQlE,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY;IAOxC,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,YAAY;IAOtC,cAAc,IAAI,WAAW;IAI7B,SAAS,IAAI,SAAS,GAAG,MAAM;IAI/B,QAAQ,IAAI,MAAM;CAG1B"} \ No newline at end of file diff --git a/types/types.d.ts b/types/types.d.ts index c93503a..6c1a0e1 100644 --- a/types/types.d.ts +++ b/types/types.d.ts @@ -1,4 +1,5 @@ export declare type PartialSome, R = { [K in P]?: O[P]; }> = Q & R; +export declare type Box = [number, number, number, number]; //# sourceMappingURL=types.d.ts.map \ No newline at end of file diff --git a/types/types.d.ts.map b/types/types.d.ts.map index 6b251ee..0d59c2a 100644 --- a/types/types.d.ts.map +++ b/types/types.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,oBAAY,WAAW,CACrB,CAAC,EACD,CAAC,SAAS,MAAM,CAAC,EACjB,CAAC,GAAG,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,EACd,CAAC,GAAG;KAAG,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;CAAE,IACrB,CAAC,GAAG,CAAC,CAAC"} \ No newline at end of file +{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,oBAAY,WAAW,CACrB,CAAC,EACD,CAAC,SAAS,MAAM,CAAC,EACjB,CAAC,GAAG,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,EACd,CAAC,GAAG;KAAG,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;CAAE,IACrB,CAAC,GAAG,CAAC,CAAC;AAEV,oBAAY,GAAG,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC"} \ No newline at end of file From 972e0546fc205bd9f83847ce305fafa37f308c8d Mon Sep 17 00:00:00 2001 From: Alan Poulain Date: Tue, 14 Jul 2020 21:23:31 +0200 Subject: [PATCH 04/56] 0.2.0 --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 7b54092..76ec394 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "universal-geocoder", - "version": "0.1.0", + "version": "0.2.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 6055cab..2f72460 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "universal-geocoder", "description": "Universal geocoding abstraction with multiple built-in providers", - "version": "0.1.0", + "version": "0.2.0", "keywords": [ "geocoder", "geocoding", From ae90f6cbad22fffcd11f9f6d17eaf1fb31b33097 Mon Sep 17 00:00:00 2001 From: Alan Poulain Date: Tue, 14 Jul 2020 21:27:23 +0200 Subject: [PATCH 05/56] Missing types folder when publishing --- package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 2f72460..2f73ccd 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,8 @@ "types": "types/index.d.ts", "files": [ "/dist", - "/src" + "/src", + "/types" ], "dependencies": { "cross-fetch": "^3.0.0" From 85281e6f2d3dc64b35f66540d435daf8d3a39ec9 Mon Sep 17 00:00:00 2001 From: Alan Poulain Date: Tue, 14 Jul 2020 21:27:35 +0200 Subject: [PATCH 06/56] 0.2.1 --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 76ec394..d8b6004 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "universal-geocoder", - "version": "0.2.0", + "version": "0.2.1", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 2f73ccd..a9f4691 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "universal-geocoder", "description": "Universal geocoding abstraction with multiple built-in providers", - "version": "0.2.0", + "version": "0.2.1", "keywords": [ "geocoder", "geocoding", From 8b79f4feddc4553181bd2fefe8901f5cdce121ad Mon Sep 17 00:00:00 2001 From: Alan Poulain Date: Tue, 14 Jul 2020 21:46:15 +0200 Subject: [PATCH 07/56] Revert "Universal Geocoder" This reverts commit 70dec6b668c6c40e701997c1388789cf84b65398. --- README.md | 38 +++++++++---------- example/bing.html | 6 +-- example/google.html | 6 +-- example/mapbox.html | 6 +-- example/mapquest.html | 6 +-- example/openstreetmap.html | 6 +-- example/yandex.html | 6 +-- package-lock.json | 2 +- package.json | 8 ++-- src/{UniversalGeocoder.ts => GeocoderJS.ts} | 2 +- src/global.ts | 8 ++-- src/index.ts | 2 +- ...UniversalGeocoder.d.ts => GeocoderJS.d.ts} | 4 +- types/GeocoderJS.d.ts.map | 1 + types/UniversalGeocoder.d.ts.map | 1 - types/global.d.ts | 4 +- types/global.d.ts.map | 2 +- types/index.d.ts | 2 +- types/index.d.ts.map | 2 +- webpack.dev.js | 2 +- webpack.prod.js | 2 +- 21 files changed, 58 insertions(+), 58 deletions(-) rename src/{UniversalGeocoder.ts => GeocoderJS.ts} (89%) rename types/{UniversalGeocoder.d.ts => GeocoderJS.d.ts} (74%) create mode 100644 types/GeocoderJS.d.ts.map delete mode 100644 types/UniversalGeocoder.d.ts.map diff --git a/README.md b/README.md index 2913ac6..20eaf2f 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,13 @@ -Universal Geocoder -================== +GeocoderJS +========== -[![Build Status](https://travis-ci.com/alanpoulain/universal-geocoder.png?branch=main)](https://travis-ci.com/alanpoulain/universal-geocoder) +[![Build Status](https://travis-ci.org/geocoder-php/geocoder-js.png?branch=master)](https://travis-ci.org/geocoder-php/geocoder-js) +[![Dependency Status](https://david-dm.org/geocoder-php/geocoder-js.png)](https://david-dm.org/geocoder-php/geocoder-js) +[![devDependency Status](https://david-dm.org/geocoder-php/geocoder-js/dev-status.png)](https://david-dm.org/geocoder-php/geocoder-js#info=devDependencies) -Universal Geocoder is a universal JavaScript library for client-side geocoding applications with multiple built-in providers. +GeocoderJS is a universal JavaScript library for client-side geocoding applications with multiple built-in providers. -Need geocoding 🌍️ in your website or application? Don't want to be vendor-locked to a service? ✨️ Universal Geocoder ✨️ is for you! - -Universal Geocoder is a TypeScript fork of [GeocoderJS](https://github.com/geocoder-php/geocoder-js), itself a port of the [Geocoder PHP](https://geocoder-php.org/) library. +It is a port of the [Geocoder PHP](https://geocoder-php.org/) library. This library is platform agnostic: it is available either server-side (Node) or client-side (browsers, React Native). @@ -17,7 +17,7 @@ Installation Add the library to your project: ```shell -npm install --save universal-geocoder +npm install --save geocoder-js ``` > ⚠️ **Warning**: If you need to use this library in an environment not supporting the Promise API such as Internet Explorer, you must install an ES6 Promise compatible polyfill like [es6-promise](https://github.com/jakearchibald/es6-promise). @@ -25,26 +25,26 @@ npm install --save universal-geocoder Usage ----- -You can either use Universal Geocoder as a module or as a direct dependency. +You can either use GeocoderJS as a module or as a direct dependency. As a module: ```javascript -import UniversalGeocoder from "universal-geocoder"; +import GeocoderJS from "geocoder-js"; -const openStreetMapGeocoder = UniversalGeocoder.createGeocoder("openstreetmap"); +const openStreetMapGeocoder = GeocoderJS.createGeocoder("openstreetmap"); openStreetMapGeocoder.geocode("1600 Pennsylvania Ave NW, Washington, DC", (result) => { console.log(result); }); ``` -If you want to use the library as a direct dependecy, copy `dist/universal-geocoder.js` or `dist/universal-geocoder.min.js` to your dependencies. +If you want to use the library as a direct dependecy, copy `dist/geocoder.js` or `dist/geocoder.min.js` to your dependencies. -Universal Geocoder will be available in the global environment: +GeocoderJS will be available in the global environment: ```javascript -const openStreetMapGeocoder = UniversalGeocoder.createGeocoder("openstreetmap"); +const openStreetMapGeocoder = GeocoderJS.createGeocoder("openstreetmap"); openStreetMapGeocoder.geodecode("44.915", "-93.21", (result) => { console.log(result); @@ -54,9 +54,9 @@ openStreetMapGeocoder.geodecode("44.915", "-93.21", (result) => { For a more advanced usage, see the example below: ```javascript -import UniversalGeocoder, { ReverseQuery } from "universal-geocoder"; +import GeocoderJS, { ReverseQuery } from "geocoder-js"; -const googleGeocoder = UniversalGeocoder.createGeocoder({ +const googleGeocoder = GeocoderJS.createGeocoder({ provider: "google", apiKey: "YOUR_API_KEY", useSsl: true, @@ -87,7 +87,7 @@ googleGeocoder.geodecode(reverseQuery, (result) => { Providers --------- -Universal Geocoder comes with modules to integrate with various geocoding providers. +GeocoderJS comes with modules to integrate with various geocoding providers. The following table summarizes the features of each: @@ -246,9 +246,9 @@ Dumpers transform a `Geocoded` object to another format. Usage ```javascript - import UniversalGeocoder, { GeoJsonDumper } from "universal-geocoder"; + import GeocoderJS, { GeoJsonDumper } from "geocoder-js"; - const nominatimGeocoder = UniversalGeocoder.createGeocoder("nominatim"); + const nominatimGeocoder = GeocoderJS.createGeocoder("nominatim"); nominatimGeocoder.geocode("1600 Pennsylvania Ave, Washington, DC", (result) => { console.log(result); diff --git a/example/bing.html b/example/bing.html index 2aa31f9..da6967d 100644 --- a/example/bing.html +++ b/example/bing.html @@ -1,10 +1,10 @@ - Universal Geocoder: Bing Example - + Geocoder.js: Bing Example + + Geocoder.js: Google API Example + + Geocoder.js: Mapbox Example + + Geocoder.js: Mapquest Example + + Geocoder.js: Nominatim Example + + Geocoder.js: Yandex Example + + + + + + + + From 892639d773212eb5f6c075fd394616ffa89b2ea6 Mon Sep 17 00:00:00 2001 From: Alan Poulain Date: Thu, 23 Jul 2020 23:27:25 +0200 Subject: [PATCH 15/56] Automatically deploy website when pushing on main (#6) --- .github/workflows/deploy-website.yml | 21 +++++++++++++++++++++ package.json | 2 +- website/bower.json | 2 +- 3 files changed, 23 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/deploy-website.yml diff --git a/.github/workflows/deploy-website.yml b/.github/workflows/deploy-website.yml new file mode 100644 index 0000000..5f81199 --- /dev/null +++ b/.github/workflows/deploy-website.yml @@ -0,0 +1,21 @@ +name: Deploy website + +on: + push: + branches: + - main + +jobs: + couscous: + name: Deploy website with Couscous + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Couscous + uses: CouscousPHP/GitHub-Action@v1 + - name: Deploy + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./.couscous/generated diff --git a/package.json b/package.json index b75e1bd..84ce2a0 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,7 @@ "contributors": [ "Alan Poulain " ], - "homepage": "https://github.com/alanpoulain/universal-geocoder#readme", + "homepage": "https://alanpoulain.github.io/universal-geocoder/", "bugs": "https://github.com/alanpoulain/universal-geocoder/issues", "repository": { "type": "git", diff --git a/website/bower.json b/website/bower.json index 9f1feb9..cd5cd17 100644 --- a/website/bower.json +++ b/website/bower.json @@ -1,6 +1,6 @@ { "name": "universal-geocoder-website", - "homepage": "https://github.com/alanpoulain/universal-geocoder", + "homepage": "https://alanpoulain.github.io/universal-geocoder/", "authors": [ "Alan Poulain " ], From 5e15983c0470d83433142409495d801be1fa297f Mon Sep 17 00:00:00 2001 From: Alan Poulain Date: Thu, 23 Jul 2020 23:49:37 +0200 Subject: [PATCH 16/56] Deploy website without Couscous action Couscous action cannot launch Bower --- .github/workflows/deploy-website.yml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy-website.yml b/.github/workflows/deploy-website.yml index 5f81199..eef7bfe 100644 --- a/.github/workflows/deploy-website.yml +++ b/.github/workflows/deploy-website.yml @@ -12,8 +12,21 @@ jobs: steps: - name: Checkout uses: actions/checkout@v2 + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: "7.4" + tools: composer + - name: Setup Node + uses: actions/setup-node@v2-beta + with: + node-version: "14" + - name: Setup Bower + run: npm install -g bower + - name: Setup Couscous + run: composer global require couscous/couscous - name: Couscous - uses: CouscousPHP/GitHub-Action@v1 + run: couscous generate - name: Deploy uses: peaceiris/actions-gh-pages@v3 with: From d46adb9f99c0dd786ee6d6d7ce37e73cf90959f1 Mon Sep 17 00:00:00 2001 From: Alan Poulain Date: Fri, 24 Jul 2020 11:11:17 +0200 Subject: [PATCH 17/56] Add logo (#7) --- README.md | 2 + assets/logo.svg | 146 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 148 insertions(+) create mode 100644 assets/logo.svg diff --git a/README.md b/README.md index a073a5b..861123d 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ +![Universal Geocoder Logo](https://raw.githubusercontent.com/alanpoulain/universal-geocoder/main/assets/logo.svg) + Universal Geocoder ================== diff --git a/assets/logo.svg b/assets/logo.svg new file mode 100644 index 0000000..d74ab8c --- /dev/null +++ b/assets/logo.svg @@ -0,0 +1,146 @@ + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + From 1f3d2b397387cdcba41b266a04be8579b2613f0d Mon Sep 17 00:00:00 2001 From: Alan Poulain Date: Fri, 24 Jul 2020 11:15:53 +0200 Subject: [PATCH 18/56] Remove border and background for images --- website/css/main.css | 3 --- 1 file changed, 3 deletions(-) diff --git a/website/css/main.css b/website/css/main.css index ea27922..609fe0d 100644 --- a/website/css/main.css +++ b/website/css/main.css @@ -50,9 +50,6 @@ img[alt="Build Status"] { #content img { max-width: 100%; padding: 4px; - background-color: #fff; - border: 1px solid #ddd; - border-radius: 4px; } header.navbar { From 0f6620992873d221119588ccfbb8e21b0b017da0 Mon Sep 17 00:00:00 2001 From: Alan Poulain Date: Fri, 24 Jul 2020 11:52:24 +0200 Subject: [PATCH 19/56] Use organization instead of personal account --- README.md | 4 +--- couscous.yml | 4 ++-- package.json | 8 ++++---- website/bower.json | 2 +- 4 files changed, 8 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 861123d..9bd07f8 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,8 @@ -![Universal Geocoder Logo](https://raw.githubusercontent.com/alanpoulain/universal-geocoder/main/assets/logo.svg) +![Universal Geocoder Logo](https://raw.githubusercontent.com/universal-geocoder/universal-geocoder-js/main/assets/logo.svg) Universal Geocoder ================== -[![Build Status](https://travis-ci.com/alanpoulain/universal-geocoder.png?branch=main)](https://travis-ci.com/alanpoulain/universal-geocoder) - Universal Geocoder is a universal JavaScript library for client-side geocoding applications with multiple built-in providers. Need geocoding 🌍️ in your website or application? Don't want to be vendor-locked to a service? ✨️ Universal Geocoder ✨️ is for you! diff --git a/couscous.yml b/couscous.yml index 96ab56c..9149085 100644 --- a/couscous.yml +++ b/couscous.yml @@ -2,8 +2,8 @@ title: Universal Geocoder subTitle: A universal JavaScript library for client-side geocoding applications with multiple built-in providers github: - user: alanpoulain - repo: universal-geocoder + user: universal-geocoder + repo: universal-geocoder-js menu: items: diff --git a/package.json b/package.json index 84ce2a0..43ab7da 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "universal-geocoder", + "name": "@universal-geocoder/universal-geocoder", "description": "Universal geocoding abstraction with multiple built-in providers", "version": "0.2.4", "keywords": [ @@ -17,11 +17,11 @@ "contributors": [ "Alan Poulain " ], - "homepage": "https://alanpoulain.github.io/universal-geocoder/", - "bugs": "https://github.com/alanpoulain/universal-geocoder/issues", + "homepage": "https://universal-geocoder.github.io/universal-geocoder-js/", + "bugs": "https://github.com/universal-geocoder/universal-geocoder-js/issues", "repository": { "type": "git", - "url": "git+https://github.com/alanpoulain/universal-geocoder.git" + "url": "git+https://github.com/universal-geocoder/universal-geocoder-js.git" }, "main": "dist/index.js", "types": "types/index.d.ts", diff --git a/website/bower.json b/website/bower.json index cd5cd17..3d08f73 100644 --- a/website/bower.json +++ b/website/bower.json @@ -1,6 +1,6 @@ { "name": "universal-geocoder-website", - "homepage": "https://alanpoulain.github.io/universal-geocoder/", + "homepage": "https://universal-geocoder.github.io/universal-geocoder-js/", "authors": [ "Alan Poulain " ], From ada4aa390d4db15119cd94e77a387b83120c0972 Mon Sep 17 00:00:00 2001 From: Alan Poulain Date: Fri, 24 Jul 2020 12:51:40 +0200 Subject: [PATCH 20/56] Use GitHub Actions instead of Travis for CI --- .github/workflows/ci.yml | 25 +++++++++++++++++++++++++ .travis.yml | 11 ----------- README.md | 2 ++ website/css/main.css | 2 +- 4 files changed, 28 insertions(+), 12 deletions(-) create mode 100644 .github/workflows/ci.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..a02e0b1 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,25 @@ +name: Continuous Integration + +on: + - pull_request + - push + +jobs: + ci: + name: Continuous integration + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Setup Node + uses: actions/setup-node@v2-beta + with: + node-version: "14" + - name: Install dependencies + run: npm install + - name: Check coding standards + run: npm run lint + - name: Run tests + run: npm test + - name: Check build + run: npm run build diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index ae23e1f..0000000 --- a/.travis.yml +++ /dev/null @@ -1,11 +0,0 @@ -language: node_js -node_js: - - "lts/*" - -before_install: - - npm install - -script: - - npm run lint - - npm test - - npm run build diff --git a/README.md b/README.md index 9bd07f8..8460e40 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,8 @@ Universal Geocoder ================== +[![CI](https://github.com/universal-geocoder/universal-geocoder-js/workflows/Continuous%20Integration/badge.svg?branch=main&event=push)](https://github.com/universal-geocoder/universal-geocoder-js/actions) + Universal Geocoder is a universal JavaScript library for client-side geocoding applications with multiple built-in providers. Need geocoding 🌍️ in your website or application? Don't want to be vendor-locked to a service? ✨️ Universal Geocoder ✨️ is for you! diff --git a/website/css/main.css b/website/css/main.css index 609fe0d..e44dd5f 100644 --- a/website/css/main.css +++ b/website/css/main.css @@ -43,7 +43,7 @@ code { color: #18Bc9c; } -img[alt="Build Status"] { +img[alt="CI"] { display: none; } From fb82b7845d4da47d066da6245e975fd399c79786 Mon Sep 17 00:00:00 2001 From: Alan Poulain Date: Fri, 24 Jul 2020 12:55:18 +0200 Subject: [PATCH 21/56] Fix baseUrl in Couscous --- couscous.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/couscous.yml b/couscous.yml index 9149085..7094123 100644 --- a/couscous.yml +++ b/couscous.yml @@ -13,4 +13,4 @@ menu: text: Provider Usage relativeUrl: docs/provider_usage.html -baseUrl: /universal-geocoder/ +baseUrl: /universal-geocoder-js/ From 925b27903d01d5daeecf90437dffab91c4b31129 Mon Sep 17 00:00:00 2001 From: Alan Poulain Date: Tue, 28 Jul 2020 19:13:08 +0200 Subject: [PATCH 22/56] OpenCage provider (#1) --- .eslintrc | 2 +- .github/workflows/release.yml | 43 ++ CHANGELOG.md | 9 + README.md | 8 + docs/provider_usage.md | 40 +- example/opencage.html | 20 + package.json | 2 +- spec/ExternalLoader.spec.ts | 9 + spec/ExternalURILoader.spec.ts | 9 - spec/Geocoded.spec.ts | 8 + spec/GeocoderProviderFactory.spec.ts | 2 +- .../BingProvider.spec.ts | 6 +- .../GoogleAPIProvider.spec.ts | 6 +- .../MapboxProvider.spec.ts | 21 +- .../MapquestProvider.spec.ts | 6 +- .../NominatimProvider.spec.ts | 8 +- spec/provider/OpenCageProvider.spec.ts | 229 ++++++++ .../YandexProvider.spec.ts | 2 +- ...ExternalURILoader.ts => ExternalLoader.ts} | 76 ++- src/GeoJsonDumper.ts | 2 + src/Geocoded.ts | 17 +- src/GeocoderProviderFactory.ts | 27 +- src/error/ResponseError.ts | 18 + src/error/index.ts | 2 + src/index.ts | 6 +- src/{providers => provider}/BingProvider.ts | 7 +- .../GoogleAPIProvider.ts | 7 +- .../MapquestProvider.ts | 7 +- .../ProviderHelpers.ts | 2 +- .../ProviderInterface.ts | 9 +- src/{providers => provider}/YandexProvider.ts | 7 +- src/provider/index.ts | 14 + .../mapbox/MapboxGeocodeQuery.ts | 28 + src/provider/mapbox/MapboxGeocoded.ts | 39 ++ .../mapbox/MapboxProvider.ts | 137 +++-- .../mapbox/MapboxReverseQuery.ts | 30 + src/provider/mapbox/index.ts | 7 + .../nominatim/NominatimGeocodeQuery.ts | 0 .../nominatim/NominatimGeocoded.ts | 0 .../nominatim/NominatimProvider.ts | 60 +- .../nominatim/NominatimReverseQuery.ts | 0 src/provider/nominatim/index.ts | 20 + src/provider/opencage/OpenCageGeocodeQuery.ts | 92 +++ src/provider/opencage/OpenCageGeocoded.ts | 124 ++++ src/provider/opencage/OpenCageProvider.ts | 551 ++++++++++++++++++ src/provider/opencage/OpenCageReverseQuery.ts | 77 +++ src/provider/opencage/index.ts | 7 + src/providers/index.ts | 13 - src/providers/mapbox/index.ts | 6 - src/providers/nominatim/index.ts | 20 - src/query/GeocodeQuery.ts | 2 +- src/query/ReverseQuery.ts | 2 +- ...rnalURILoader.d.ts => ExternalLoader.d.ts} | 13 +- types/ExternalLoader.d.ts.map | 1 + types/ExternalURILoader.d.ts.map | 1 - types/GeoJsonDumper.d.ts | 2 +- types/GeoJsonDumper.d.ts.map | 2 +- types/Geocoded.d.ts | 7 +- types/Geocoded.d.ts.map | 2 +- types/GeocoderProviderFactory.d.ts | 13 +- types/GeocoderProviderFactory.d.ts.map | 2 +- types/error/ResponseError.d.ts | 7 + types/error/ResponseError.d.ts.map | 1 + types/error/index.d.ts | 2 + types/error/index.d.ts.map | 1 + types/index.d.ts | 6 +- types/index.d.ts.map | 2 +- .../{providers => provider}/BingProvider.d.ts | 2 +- types/provider/BingProvider.d.ts.map | 1 + .../GoogleAPIProvider.d.ts | 2 +- types/provider/GoogleAPIProvider.d.ts.map | 1 + .../MapquestProvider.d.ts | 2 +- types/provider/MapquestProvider.d.ts.map | 1 + .../ProviderHelpers.d.ts | 0 types/provider/ProviderHelpers.d.ts.map | 1 + .../ProviderInterface.d.ts | 4 +- types/provider/ProviderInterface.d.ts.map | 1 + .../YandexProvider.d.ts | 2 +- types/provider/YandexProvider.d.ts.map | 1 + types/{providers => provider}/index.d.ts | 1 + types/provider/index.d.ts.map | 1 + .../mapbox/MapboxGeocodeQuery.d.ts | 10 +- .../mapbox/MapboxGeocodeQuery.d.ts.map | 1 + types/provider/mapbox/MapboxGeocoded.d.ts | 13 + types/provider/mapbox/MapboxGeocoded.d.ts.map | 1 + .../mapbox/MapboxProvider.d.ts | 10 +- types/provider/mapbox/MapboxProvider.d.ts.map | 1 + types/provider/mapbox/MapboxReverseQuery.d.ts | 23 + .../mapbox/MapboxReverseQuery.d.ts.map | 1 + .../{providers => provider}/mapbox/index.d.ts | 1 + types/provider/mapbox/index.d.ts.map | 1 + .../nominatim/NominatimGeocodeQuery.d.ts | 0 .../nominatim/NominatimGeocodeQuery.d.ts.map | 1 + .../nominatim/NominatimGeocoded.d.ts | 0 .../nominatim/NominatimGeocoded.d.ts.map | 1 + .../nominatim/NominatimProvider.d.ts | 2 +- .../nominatim/NominatimProvider.d.ts.map | 1 + .../nominatim/NominatimReverseQuery.d.ts | 0 .../nominatim/NominatimReverseQuery.d.ts.map | 1 + .../nominatim/index.d.ts | 0 types/provider/nominatim/index.d.ts.map | 1 + .../opencage/OpenCageGeocodeQuery.d.ts | 26 + .../opencage/OpenCageGeocodeQuery.d.ts.map | 1 + types/provider/opencage/OpenCageGeocoded.d.ts | 33 ++ .../opencage/OpenCageGeocoded.d.ts.map | 1 + types/provider/opencage/OpenCageProvider.d.ts | 157 +++++ .../opencage/OpenCageProvider.d.ts.map | 1 + .../opencage/OpenCageReverseQuery.d.ts | 21 + .../opencage/OpenCageReverseQuery.d.ts.map | 1 + types/provider/opencage/index.d.ts | 8 + types/provider/opencage/index.d.ts.map | 1 + types/providers/BingProvider.d.ts.map | 1 - types/providers/GoogleAPIProvider.d.ts.map | 1 - types/providers/MapquestProvider.d.ts.map | 1 - types/providers/ProviderHelpers.d.ts.map | 1 - types/providers/ProviderInterface.d.ts.map | 1 - types/providers/YandexProvider.d.ts.map | 1 - types/providers/index.d.ts.map | 1 - .../mapbox/MapboxGeocodeQuery.d.ts.map | 1 - .../providers/mapbox/MapboxProvider.d.ts.map | 1 - .../providers/mapbox/MapboxReverseQuery.d.ts | 13 - .../mapbox/MapboxReverseQuery.d.ts.map | 1 - types/providers/mapbox/index.d.ts.map | 1 - .../nominatim/NominatimGeocodeQuery.d.ts.map | 1 - .../nominatim/NominatimGeocoded.d.ts.map | 1 - .../nominatim/NominatimProvider.d.ts.map | 1 - .../nominatim/NominatimReverseQuery.d.ts.map | 1 - types/providers/nominatim/index.d.ts.map | 1 - 128 files changed, 2001 insertions(+), 275 deletions(-) create mode 100644 .github/workflows/release.yml create mode 100644 example/opencage.html create mode 100644 spec/ExternalLoader.spec.ts delete mode 100644 spec/ExternalURILoader.spec.ts rename spec/{providers => provider}/BingProvider.spec.ts (93%) rename spec/{providers => provider}/GoogleAPIProvider.spec.ts (94%) rename spec/{providers => provider}/MapboxProvider.spec.ts (81%) rename spec/{providers => provider}/MapquestProvider.spec.ts (91%) rename spec/{providers => provider}/NominatimProvider.spec.ts (96%) create mode 100644 spec/provider/OpenCageProvider.spec.ts rename spec/{providers => provider}/YandexProvider.spec.ts (97%) rename src/{ExternalURILoader.ts => ExternalLoader.ts} (67%) create mode 100644 src/error/ResponseError.ts create mode 100644 src/error/index.ts rename src/{providers => provider}/BingProvider.ts (97%) rename src/{providers => provider}/GoogleAPIProvider.ts (98%) rename src/{providers => provider}/MapquestProvider.ts (97%) rename src/{providers => provider}/ProviderHelpers.ts (97%) rename src/{providers => provider}/ProviderInterface.ts (84%) rename src/{providers => provider}/YandexProvider.ts (98%) create mode 100644 src/provider/index.ts rename src/{providers => provider}/mapbox/MapboxGeocodeQuery.ts (54%) create mode 100644 src/provider/mapbox/MapboxGeocoded.ts rename src/{providers => provider}/mapbox/MapboxProvider.ts (63%) rename src/{providers => provider}/mapbox/MapboxReverseQuery.ts (52%) create mode 100644 src/provider/mapbox/index.ts rename src/{providers => provider}/nominatim/NominatimGeocodeQuery.ts (100%) rename src/{providers => provider}/nominatim/NominatimGeocoded.ts (100%) rename src/{providers => provider}/nominatim/NominatimProvider.ts (85%) rename src/{providers => provider}/nominatim/NominatimReverseQuery.ts (100%) create mode 100644 src/provider/nominatim/index.ts create mode 100644 src/provider/opencage/OpenCageGeocodeQuery.ts create mode 100644 src/provider/opencage/OpenCageGeocoded.ts create mode 100644 src/provider/opencage/OpenCageProvider.ts create mode 100644 src/provider/opencage/OpenCageReverseQuery.ts create mode 100644 src/provider/opencage/index.ts delete mode 100644 src/providers/index.ts delete mode 100644 src/providers/mapbox/index.ts delete mode 100644 src/providers/nominatim/index.ts rename types/{ExternalURILoader.d.ts => ExternalLoader.d.ts} (66%) create mode 100644 types/ExternalLoader.d.ts.map delete mode 100644 types/ExternalURILoader.d.ts.map create mode 100644 types/error/ResponseError.d.ts create mode 100644 types/error/ResponseError.d.ts.map create mode 100644 types/error/index.d.ts create mode 100644 types/error/index.d.ts.map rename types/{providers => provider}/BingProvider.d.ts (98%) create mode 100644 types/provider/BingProvider.d.ts.map rename types/{providers => provider}/GoogleAPIProvider.d.ts (98%) create mode 100644 types/provider/GoogleAPIProvider.d.ts.map rename types/{providers => provider}/MapquestProvider.d.ts (98%) create mode 100644 types/provider/MapquestProvider.d.ts.map rename types/{providers => provider}/ProviderHelpers.d.ts (100%) create mode 100644 types/provider/ProviderHelpers.d.ts.map rename types/{providers => provider}/ProviderInterface.d.ts (83%) create mode 100644 types/provider/ProviderInterface.d.ts.map rename types/{providers => provider}/YandexProvider.d.ts (99%) create mode 100644 types/provider/YandexProvider.d.ts.map rename types/{providers => provider}/index.d.ts (95%) create mode 100644 types/provider/index.d.ts.map rename types/{providers => provider}/mapbox/MapboxGeocodeQuery.d.ts (53%) create mode 100644 types/provider/mapbox/MapboxGeocodeQuery.d.ts.map create mode 100644 types/provider/mapbox/MapboxGeocoded.d.ts create mode 100644 types/provider/mapbox/MapboxGeocoded.d.ts.map rename types/{providers => provider}/mapbox/MapboxProvider.d.ts (86%) create mode 100644 types/provider/mapbox/MapboxProvider.d.ts.map create mode 100644 types/provider/mapbox/MapboxReverseQuery.d.ts create mode 100644 types/provider/mapbox/MapboxReverseQuery.d.ts.map rename types/{providers => provider}/mapbox/index.d.ts (84%) create mode 100644 types/provider/mapbox/index.d.ts.map rename types/{providers => provider}/nominatim/NominatimGeocodeQuery.d.ts (100%) create mode 100644 types/provider/nominatim/NominatimGeocodeQuery.d.ts.map rename types/{providers => provider}/nominatim/NominatimGeocoded.d.ts (100%) create mode 100644 types/provider/nominatim/NominatimGeocoded.d.ts.map rename types/{providers => provider}/nominatim/NominatimProvider.d.ts (97%) create mode 100644 types/provider/nominatim/NominatimProvider.d.ts.map rename types/{providers => provider}/nominatim/NominatimReverseQuery.d.ts (100%) create mode 100644 types/provider/nominatim/NominatimReverseQuery.d.ts.map rename types/{providers => provider}/nominatim/index.d.ts (100%) create mode 100644 types/provider/nominatim/index.d.ts.map create mode 100644 types/provider/opencage/OpenCageGeocodeQuery.d.ts create mode 100644 types/provider/opencage/OpenCageGeocodeQuery.d.ts.map create mode 100644 types/provider/opencage/OpenCageGeocoded.d.ts create mode 100644 types/provider/opencage/OpenCageGeocoded.d.ts.map create mode 100644 types/provider/opencage/OpenCageProvider.d.ts create mode 100644 types/provider/opencage/OpenCageProvider.d.ts.map create mode 100644 types/provider/opencage/OpenCageReverseQuery.d.ts create mode 100644 types/provider/opencage/OpenCageReverseQuery.d.ts.map create mode 100644 types/provider/opencage/index.d.ts create mode 100644 types/provider/opencage/index.d.ts.map delete mode 100644 types/providers/BingProvider.d.ts.map delete mode 100644 types/providers/GoogleAPIProvider.d.ts.map delete mode 100644 types/providers/MapquestProvider.d.ts.map delete mode 100644 types/providers/ProviderHelpers.d.ts.map delete mode 100644 types/providers/ProviderInterface.d.ts.map delete mode 100644 types/providers/YandexProvider.d.ts.map delete mode 100644 types/providers/index.d.ts.map delete mode 100644 types/providers/mapbox/MapboxGeocodeQuery.d.ts.map delete mode 100644 types/providers/mapbox/MapboxProvider.d.ts.map delete mode 100644 types/providers/mapbox/MapboxReverseQuery.d.ts delete mode 100644 types/providers/mapbox/MapboxReverseQuery.d.ts.map delete mode 100644 types/providers/mapbox/index.d.ts.map delete mode 100644 types/providers/nominatim/NominatimGeocodeQuery.d.ts.map delete mode 100644 types/providers/nominatim/NominatimGeocoded.d.ts.map delete mode 100644 types/providers/nominatim/NominatimProvider.d.ts.map delete mode 100644 types/providers/nominatim/NominatimReverseQuery.d.ts.map delete mode 100644 types/providers/nominatim/index.d.ts.map diff --git a/.eslintrc b/.eslintrc index f46ee49..d5c1b40 100644 --- a/.eslintrc +++ b/.eslintrc @@ -10,7 +10,7 @@ "browser": true }, "plugins": ["prettier"], - "ignorePatterns": ["types/**/*.ts"], + "ignorePatterns": ["/types/**/*.ts", "/website/vendor/**/*"], "rules": { "prettier/prettier": ["error"], "no-console": "off", diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..f87520a --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,43 @@ +name: Release + +on: + push: + tags: + - 'v*' + +jobs: + release: + name: Create and publish a release + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Setup Node (npm registry) + uses: actions/setup-node@v2-beta + with: + node-version: "14" + registry-url: https://registry.npmjs.org + - name: Install dependencies + run: npm install + - name: Run tests + run: npm test + - name: Create a GitHub release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ github.ref }} + release_name: Release ${{ github.ref }} + - name: Publish to npm + run: npm publish + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + - name: Setup Node (GitHub registry) + uses: actions/setup-node@v2-beta + with: + node-version: "14" + registry-url: https://npm.pkg.github.com + - name: Publish to GitHub + run: npm publish + env: + NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/CHANGELOG.md b/CHANGELOG.md index 38ebf6b..3750b20 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,14 @@ # Changelog +## O.3.0 + +* Add OpenCage Provider +* Add time zone to `Geocoded` +* [Mapbox] Add `countryCodes`, `proximity` and `reverseMode` to geo(de)code parameters +* [Mapbox] Add `resultType` to `Geocoded` +* [Mapbox] Add admin levels to `Geocoded` +* Rename `ExternalURILoader` to `ExternalLoader` + ## 0.2.4 * [Nominatim] Fix error when no result is received diff --git a/README.md b/README.md index 8460e40..9ead963 100644 --- a/README.md +++ b/README.md @@ -112,6 +112,7 @@ The result of a query is a `Geocoded` object which maps the following common inf - Bounds (south, west, north, east) - Formatted address - Address details: street number, street name, (sub) locality, postal code, region, administration levels, country (with its code) +- Time zone You can either use getter methods to retrieve them or use the `toObject` method to manipulate an object containing the properties. @@ -140,6 +141,13 @@ The following table summarizes the features of each: ❓️ untested ✅️ yes + + OpenCage + opencage + ✅️ yes + ❓️ untested + ✅️ yes + Google API google diff --git a/docs/provider_usage.md b/docs/provider_usage.md index 1aeac04..11bdae4 100644 --- a/docs/provider_usage.md +++ b/docs/provider_usage.md @@ -10,7 +10,7 @@ ### `geocode` parameters -- `countryCodes`: a list of country codes to limit the results to one or more countries +- `countryCodes`: to restrict the results to one or more countries (ISO 3166 alpha 2 country codes) - `excludePlaceIds`: for excluding some OpenStreetMap objects from the results - `viewBox` ([longitude 1, latitude 1, longitude 2, latitude 2]): the preferred area to find search results - `bounded` (only if `viewBox` is used): boolean to restrict the results to items within the view box @@ -26,21 +26,57 @@ - `category`, `type`: key and value of the main OpenStreetMap tag - `attribution`: OpenStreetMap licensing information +## OpenCage + +### Options + +- `countryCodes`: to restrict the results to one or more countries (ISO 3166 alpha 2 country codes) + +### `geocode` parameters + +- `countryCodes`: to restrict the results to one or more countries (ISO 3166 alpha 2 country codes) +- `proximity`: to provide a hint to bias results in favour of those closer to the specified location +- `minConfidence` (from 1 to 10): only results with at least this confidence will be returned +- `noRecord`: boolean to ask for the query to not be logged + +### `geodecode` parameters + +- `countryCodes`: to restrict the results to one or more countries (ISO 3166 alpha 2 country codes) +- `minConfidence` (from 1 to 10): only results with at least this confidence will be returned +- `noRecord`: boolean to ask for the query to not be logged + +### `Geocoded` properties + +- `callingCode`: the international telephone calling code for the country of the result +- `flag`: emoji flag of the country of the result +- `mgrs`: Military Grid Reference System code for the center point of the result +- `maidenhead`: Maidenhead location reference for the center point of the result +- `geohash`: Geohash for the center point of the result +- `what3words`: key words whose value is a 3 words address (3wa) + ## Mapbox ### Options - `geocodingMode` (default: "mapbox.places"): the geocoding mode to use -- `country`: to limit the results to one or more countries (ISO 3166 alpha 2 country codes separated by commas) +- `countryCodes`: to restrict the results to one or more countries (ISO 3166 alpha 2 country codes) ### `geocode` parameters +- `countryCodes`: to restrict the results to one or more countries (ISO 3166 alpha 2 country codes) +- `proximity`: to bias the response to favor results that are closer to the specified location - `locationTypes` (possible values: "country", "region", "postcode", "district", "place", "locality", "neighborhood", "address", "poi"): to filter the results to a subset of location types ### `geodecode` parameters +- `countryCodes`: to restrict the results to one or more countries (ISO 3166 alpha 2 country codes) +- `reverseMode` ("distance" or "score", default: "distance"): how results are sorted - `locationTypes` (possible values: "country", "region", "postcode", "district", "place", "locality", "neighborhood", "address", "poi"): to filter the results to a subset of location types +### `Geocoded` properties + +- `resultType`: an array of result types + ## Yandex ### Options diff --git a/example/opencage.html b/example/opencage.html new file mode 100644 index 0000000..5bd3c36 --- /dev/null +++ b/example/opencage.html @@ -0,0 +1,20 @@ + + + + Universal Geocoder: OpenCage Example + + + + + + + \ No newline at end of file diff --git a/package.json b/package.json index 43ab7da..fcb98a3 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "@universal-geocoder/universal-geocoder", + "name": "universal-geocoder", "description": "Universal geocoding abstraction with multiple built-in providers", "version": "0.2.4", "keywords": [ diff --git a/spec/ExternalLoader.spec.ts b/spec/ExternalLoader.spec.ts new file mode 100644 index 0000000..7811cab --- /dev/null +++ b/spec/ExternalLoader.spec.ts @@ -0,0 +1,9 @@ +import ExternalLoader from "ExternalLoader"; + +describe("ExternalLoader", () => { + const loader = new ExternalLoader(); + + it("has executeRequest method", () => { + expect(loader.executeRequest).toBeDefined(); + }); +}); diff --git a/spec/ExternalURILoader.spec.ts b/spec/ExternalURILoader.spec.ts deleted file mode 100644 index e6fd7ff..0000000 --- a/spec/ExternalURILoader.spec.ts +++ /dev/null @@ -1,9 +0,0 @@ -import ExternalURILoader from "ExternalURILoader"; - -describe("ExternalURILoader", () => { - const loader = new ExternalURILoader(); - - it("has executeRequest method", () => { - expect(loader.executeRequest).toBeDefined(); - }); -}); diff --git a/spec/Geocoded.spec.ts b/spec/Geocoded.spec.ts index beade7f..b270568 100644 --- a/spec/Geocoded.spec.ts +++ b/spec/Geocoded.spec.ts @@ -42,6 +42,9 @@ describe("Geocoded API", () => { it("has getCountryCode method", () => { expect(geocoded.getCountryCode).toBeDefined(); }); + it("has getTimezone method", () => { + expect(geocoded.getTimezone).toBeDefined(); + }); }); describe("Geocoded returns data properly", () => { @@ -57,6 +60,7 @@ describe("Geocoded returns data properly", () => { region: "DC", country: "United States", countryCode: "US", + timezone: "America/New_York", }); geocoded = geocoded.withBounds( 38.89380528242933, @@ -121,4 +125,8 @@ describe("Geocoded returns data properly", () => { it("returns proper country code", () => { expect(geocoded.getCountryCode()).toEqual("US"); }); + + it("returns proper timezone", () => { + expect(geocoded.getTimezone()).toEqual("America/New_York"); + }); }); diff --git a/spec/GeocoderProviderFactory.spec.ts b/spec/GeocoderProviderFactory.spec.ts index 297129d..21e4ea4 100644 --- a/spec/GeocoderProviderFactory.spec.ts +++ b/spec/GeocoderProviderFactory.spec.ts @@ -1,7 +1,7 @@ import ProviderFactory, { GeocoderProviderFactoryOptions, } from "GeocoderProviderFactory"; -import { OpenStreetMapProviderOptionsInterface } from "providers"; +import { OpenStreetMapProviderOptionsInterface } from "provider"; describe("Geocoder Factory", () => { it("expects createProvider method to return undefined for an unregistered provider", () => { diff --git a/spec/providers/BingProvider.spec.ts b/spec/provider/BingProvider.spec.ts similarity index 93% rename from spec/providers/BingProvider.spec.ts rename to spec/provider/BingProvider.spec.ts index 78f0763..79a8f1a 100644 --- a/spec/providers/BingProvider.spec.ts +++ b/spec/provider/BingProvider.spec.ts @@ -1,5 +1,5 @@ -import { BingProvider, BingResult } from "providers"; -import ExternalURILoader from "ExternalURILoader"; +import { BingProvider, BingResult } from "provider"; +import ExternalLoader from "ExternalLoader"; import Geocoded from "Geocoded"; describe("Bing Geocoder Provider raw result to Geocoded mapping", () => { @@ -55,7 +55,7 @@ describe("Bing Geocoder Provider raw result to Geocoded mapping", () => { }); it("expects API Key to be required on initiation", () => { - expect(() => new BingProvider(new ExternalURILoader())).toThrowError( + expect(() => new BingProvider(new ExternalLoader())).toThrowError( Error, 'An API key is required for the Bing provider. Please add it in the "apiKey" option.' ); diff --git a/spec/providers/GoogleAPIProvider.spec.ts b/spec/provider/GoogleAPIProvider.spec.ts similarity index 94% rename from spec/providers/GoogleAPIProvider.spec.ts rename to spec/provider/GoogleAPIProvider.spec.ts index 3dc529e..9712c2e 100644 --- a/spec/providers/GoogleAPIProvider.spec.ts +++ b/spec/provider/GoogleAPIProvider.spec.ts @@ -1,5 +1,5 @@ -import { GoogleAPIProvider, GoogleApiResult } from "providers"; -import ExternalURILoader from "ExternalURILoader"; +import { GoogleAPIProvider, GoogleApiResult } from "provider"; +import ExternalLoader from "ExternalLoader"; import Geocoded from "Geocoded"; describe("Google API Geocoder Provider raw result to Geocoded mapping", () => { @@ -69,7 +69,7 @@ describe("Google API Geocoder Provider raw result to Geocoded mapping", () => { }); it("expects API Key to be required on initiation", () => { - expect(() => new GoogleAPIProvider(new ExternalURILoader())).toThrowError( + expect(() => new GoogleAPIProvider(new ExternalLoader())).toThrowError( Error, 'An API key is required for the Google API provider. Please add it in the "apiKey" option.' ); diff --git a/spec/providers/MapboxProvider.spec.ts b/spec/provider/MapboxProvider.spec.ts similarity index 81% rename from spec/providers/MapboxProvider.spec.ts rename to spec/provider/MapboxProvider.spec.ts index 15c67b1..0171075 100644 --- a/spec/providers/MapboxProvider.spec.ts +++ b/spec/provider/MapboxProvider.spec.ts @@ -1,9 +1,9 @@ -import { MapboxProvider, MapboxResult } from "providers"; -import ExternalURILoader from "ExternalURILoader"; -import Geocoded from "Geocoded"; +import { MapboxGeocoded, MapboxProvider, MapboxResult } from "provider"; +import ExternalLoader from "ExternalLoader"; +import AdminLevel from "AdminLevel"; describe("Mapbox Geocoder Provider raw result to Geocoded mapping", () => { - let geocoded: Geocoded; + let geocoded: MapboxGeocoded; const stubMapboxResult: MapboxResult[] = [ { @@ -49,7 +49,7 @@ describe("Mapbox Geocoder Provider raw result to Geocoded mapping", () => { }); it("expects API Key to be required on initiation", () => { - expect(() => new MapboxProvider(new ExternalURILoader())).toThrowError( + expect(() => new MapboxProvider(new ExternalLoader())).toThrowError( Error, 'An API key is required for the Mapbox provider. Please add it in the "apiKey" option.' ); @@ -85,6 +85,13 @@ describe("Mapbox Geocoder Provider raw result to Geocoded mapping", () => { expect(geocoded.getRegion()).toEqual("District of Columbia"); }); + it("maps admin levels correctly", () => { + expect(geocoded.getAdminLevels()).toEqual([ + AdminLevel.create({ level: 2, name: "Washington" }), + AdminLevel.create({ level: 1, name: "District of Columbia", code: "DC" }), + ]); + }); + it("maps country correctly", () => { expect(geocoded.getCountry()).toEqual("United States"); }); @@ -92,4 +99,8 @@ describe("Mapbox Geocoder Provider raw result to Geocoded mapping", () => { it("maps country code correctly", () => { expect(geocoded.getCountryCode()).toEqual("us"); }); + + it("maps result type correctly", () => { + expect(geocoded.getResultType()).toEqual(["address"]); + }); }); diff --git a/spec/providers/MapquestProvider.spec.ts b/spec/provider/MapquestProvider.spec.ts similarity index 91% rename from spec/providers/MapquestProvider.spec.ts rename to spec/provider/MapquestProvider.spec.ts index b66b8e6..0b3a566 100644 --- a/spec/providers/MapquestProvider.spec.ts +++ b/spec/provider/MapquestProvider.spec.ts @@ -1,5 +1,5 @@ -import { MapquestProvider, MapQuestResult } from "providers"; -import ExternalURILoader from "ExternalURILoader"; +import { MapquestProvider, MapQuestResult } from "provider"; +import ExternalLoader from "ExternalLoader"; import Geocoded from "Geocoded"; describe("Mapquest Geocoder Provider raw result to Geocoded mapping", () => { @@ -41,7 +41,7 @@ describe("Mapquest Geocoder Provider raw result to Geocoded mapping", () => { }); it("expects API Key to be required on initiation", () => { - expect(() => new MapquestProvider(new ExternalURILoader())).toThrowError( + expect(() => new MapquestProvider(new ExternalLoader())).toThrowError( Error, 'An API key is required for the MapQuest provider. Please add it in the "apiKey" option.' ); diff --git a/spec/providers/NominatimProvider.spec.ts b/spec/provider/NominatimProvider.spec.ts similarity index 96% rename from spec/providers/NominatimProvider.spec.ts rename to spec/provider/NominatimProvider.spec.ts index d3dac79..877300f 100644 --- a/spec/providers/NominatimProvider.spec.ts +++ b/spec/provider/NominatimProvider.spec.ts @@ -2,8 +2,8 @@ import { NominatimGeocoded, OpenStreetMapProvider, OpenStreetMapResult, -} from "providers"; -import ExternalURILoader from "ExternalURILoader"; +} from "provider"; +import ExternalLoader from "ExternalLoader"; import AdminLevel from "AdminLevel"; describe("OpenStreetMap / Nominatim Geocoder Provider raw result to Geocoded mapping", () => { @@ -55,9 +55,7 @@ describe("OpenStreetMap / Nominatim Geocoder Provider raw result to Geocoded map }); it("expects User-Agent to be required on initiation", () => { - expect( - () => new OpenStreetMapProvider(new ExternalURILoader()) - ).toThrowError( + expect(() => new OpenStreetMapProvider(new ExternalLoader())).toThrowError( Error, 'An User-Agent identifying your application is required for the OpenStreetMap / Nominatim provider when using the default host. Please add it in the "userAgent" option.' ); diff --git a/spec/provider/OpenCageProvider.spec.ts b/spec/provider/OpenCageProvider.spec.ts new file mode 100644 index 0000000..a3ed425 --- /dev/null +++ b/spec/provider/OpenCageProvider.spec.ts @@ -0,0 +1,229 @@ +import { OpenCageGeocoded, OpenCageProvider, OpenCageResult } from "provider"; +import ExternalLoader from "ExternalLoader"; +import AdminLevel from "AdminLevel"; + +describe("OpenCage Geocoder Provider raw result to Geocoded mapping", () => { + let geocoded: OpenCageGeocoded; + + const stubOpenCageResult: OpenCageResult[] = [ + { + annotations: { + DMS: { + lat: "38° 53' 51.71928'' N", + lng: "77° 2' 11.59260'' W", + }, + FIPS: { + county: "11001", + state: "11", + }, + MGRS: "18SUJ2338907395", + Maidenhead: "FM18lv55ok", + Mercator: { + x: -8575669.907, + y: 4680193.667, + }, + OSM: { + edit_url: + "https://www.openstreetmap.org/edit?way=238241022#map=16/38.89770/-77.03655", + note_url: + "https://www.openstreetmap.org/note/new#map=16/38.89770/-77.03655&layers=N", + url: + "https://www.openstreetmap.org/?mlat=38.89770&mlon=-77.03655#map=16/38.89770/-77.03655", + }, + UN_M49: { + regions: { + AMERICAS: "019", + NORTHERN_AMERICA: "021", + US: "840", + WORLD: "001", + }, + statistical_groupings: ["MEDC"], + }, + callingcode: 1, + currency: { + alternate_symbols: ["US$"], + decimal_mark: ".", + disambiguate_symbol: "US$", + html_entity: "$", + iso_code: "USD", + iso_numeric: "840", + name: "United States Dollar", + smallest_denomination: 1, + subunit: "Cent", + subunit_to_unit: 100, + symbol: "$", + symbol_first: 1, + thousands_separator: ",", + }, + flag: "🇺🇸", + geohash: "dqcjqcpew0y36kbv76ew", + qibla: 56.56, + roadinfo: { + drive_on: "right", + speed_in: "mph", + }, + sun: { + rise: { + apparent: 1595844420, + astronomical: 1595837940, + civil: 1595842620, + nautical: 1595840400, + }, + set: { + apparent: 1595809320, + astronomical: 1595815740, + civil: 1595811120, + nautical: 1595813340, + }, + }, + timezone: { + name: "America/New_York", + now_in_dst: 1, + offset_sec: -14400, + offset_string: "-0400", + short_name: "EDT", + }, + what3words: { + words: "deeply.bunk.farmer", + }, + wikidata: "Q35525", + }, + bounds: { + northeast: { + lat: 38.897911, + lng: -77.0362526, + }, + southwest: { + lat: 38.8974898, + lng: -77.0368542, + }, + }, + components: { + "ISO_3166-1_alpha-2": "US", + "ISO_3166-1_alpha-3": "USA", + _category: "travel/tourism", + _type: "castle", + castle: "White House", + city: "Washington D.C.", + continent: "North America", + country: "United States of America", + country_code: "us", + county: "Washington", + house_number: "1600", + neighbourhood: "Golden Triangle", + pedestrian: "Pennsylvania Avenue Northwest", + postcode: "20500", + state: "District of Columbia", + state_code: "DC", + }, + confidence: 9, + formatted: + "White House, 1600 Pennsylvania Avenue Northwest, Washington, DC 20500, United States of America", + geometry: { + lat: 38.8976998, + lng: -77.0365535, + }, + }, + ]; + + beforeEach(() => { + geocoded = OpenCageProvider.mapToGeocoded(stubOpenCageResult[0]); + }); + + it("receives results from the OpenCage geocoder", () => { + expect(geocoded).toBeDefined(); + }); + + it("expects API Key to be required on initiation", () => { + expect(() => new OpenCageProvider(new ExternalLoader())).toThrowError( + Error, + 'An API key is required for the OpenCage provider. Please add it in the "apiKey" option.' + ); + }); + + it("maps coordinates correctly", () => { + expect(geocoded.getCoordinates()).toEqual([38.8976998, -77.0365535]); + }); + + it("maps bounds correctly", () => { + expect(geocoded.getBounds()).toEqual([ + 38.8974898, + -77.0368542, + 38.897911, + -77.0362526, + ]); + }); + + it("maps formatted address correctly", () => { + expect(geocoded.getFormattedAddress()).toEqual( + "White House, 1600 Pennsylvania Avenue Northwest, Washington, DC 20500, United States of America" + ); + }); + + it("maps street number correctly", () => { + expect(geocoded.getStreetNumber()).toEqual("1600"); + }); + + it("maps street name correctly", () => { + expect(geocoded.getStreetName()).toEqual("Pennsylvania Avenue Northwest"); + }); + + it("maps sublocality correctly", () => { + expect(geocoded.getSubLocality()).toEqual("Golden Triangle"); + }); + + it("maps locality correctly", () => { + expect(geocoded.getLocality()).toEqual("Washington D.C."); + }); + + it("maps postal code correctly", () => { + expect(geocoded.getPostalCode()).toEqual("20500"); + }); + + it("maps region correctly", () => { + expect(geocoded.getRegion()).toEqual("District of Columbia"); + }); + + it("maps admin levels correctly", () => { + expect(geocoded.getAdminLevels()).toEqual([ + AdminLevel.create({ level: 1, name: "District of Columbia", code: "DC" }), + AdminLevel.create({ level: 2, name: "Washington" }), + ]); + }); + + it("maps country correctly", () => { + expect(geocoded.getCountry()).toEqual("United States of America"); + }); + + it("maps country code correctly", () => { + expect(geocoded.getCountryCode()).toEqual("us"); + }); + + it("maps timezone correctly", () => { + expect(geocoded.getTimezone()).toEqual("America/New_York"); + }); + + it("maps calling code correctly", () => { + expect(geocoded.getCallingCode()).toEqual(1); + }); + + it("maps flag correctly", () => { + expect(geocoded.getFlag()).toEqual("🇺🇸"); + }); + + it("maps MGRS correctly", () => { + expect(geocoded.getMgrs()).toEqual("18SUJ2338907395"); + }); + + it("maps Maidenhead correctly", () => { + expect(geocoded.getMaidenhead()).toEqual("FM18lv55ok"); + }); + + it("maps Geohash correctly", () => { + expect(geocoded.getGeohash()).toEqual("dqcjqcpew0y36kbv76ew"); + }); + + it("maps What3words correctly", () => { + expect(geocoded.getWhat3words()).toEqual("deeply.bunk.farmer"); + }); +}); diff --git a/spec/providers/YandexProvider.spec.ts b/spec/provider/YandexProvider.spec.ts similarity index 97% rename from spec/providers/YandexProvider.spec.ts rename to spec/provider/YandexProvider.spec.ts index 20094f7..0ec84a2 100644 --- a/spec/providers/YandexProvider.spec.ts +++ b/spec/provider/YandexProvider.spec.ts @@ -1,4 +1,4 @@ -import { YandexProvider, YandexResult } from "providers"; +import { YandexProvider, YandexResult } from "provider"; import Geocoded from "Geocoded"; describe("Yandex Geocoder Provider raw result to Geocoded mapping", () => { diff --git a/src/ExternalURILoader.ts b/src/ExternalLoader.ts similarity index 67% rename from src/ExternalURILoader.ts rename to src/ExternalLoader.ts index 032069a..4b67d0a 100644 --- a/src/ExternalURILoader.ts +++ b/src/ExternalLoader.ts @@ -1,11 +1,13 @@ import fetch from "cross-fetch"; +import { ResponseError } from "error"; export interface ExternalLoaderInterface { setOptions(options: ExternalLoaderOptions): void; executeRequest( params: ExternalLoaderParams, callback: ResponseCallback, - headers?: ExternalLoaderHeaders + headers?: ExternalLoaderHeaders, + errorCallback?: ErrorCallback ): void; } @@ -21,11 +23,12 @@ export interface ExternalLoaderParams { } export interface ExternalLoaderHeaders { - [header: string]: string; + [header: string]: string | undefined; } // eslint-disable-next-line @typescript-eslint/no-explicit-any type ResponseCallback = (response: any) => void; +export type ErrorCallback = (responseError: ResponseError) => void; const defaultOptions: ExternalLoaderOptions = { protocol: "http", @@ -34,7 +37,7 @@ const defaultOptions: ExternalLoaderOptions = { /** * Load data from external geocoding engines. */ -export default class ExternalURILoader implements ExternalLoaderInterface { +export default class ExternalLoader implements ExternalLoaderInterface { private options: ExternalLoaderOptions = defaultOptions; public constructor(options: ExternalLoaderOptions = defaultOptions) { @@ -48,13 +51,14 @@ export default class ExternalURILoader implements ExternalLoaderInterface { public executeRequest( params: ExternalLoaderParams, callback: ResponseCallback, - externalLoaderHeaders?: ExternalLoaderHeaders + externalLoaderHeaders?: ExternalLoaderHeaders, + errorCallback?: ErrorCallback ): void { if (!this.options.host) { - throw new Error("A host is required for the external URI loader."); + throw new Error("A host is required for the external loader."); } if (!this.options.pathname) { - throw new Error("A pathname is required for the external URI loader."); + throw new Error("A pathname is required for the external loader."); } const requestUrl = new URL( @@ -63,47 +67,59 @@ export default class ExternalURILoader implements ExternalLoaderInterface { const { JSONPCallback: jsonpCallback, ...requestParams } = params; - // eslint-disable-next-line no-restricted-syntax - for (const paramKey in requestParams) { - if ( - Object.prototype.hasOwnProperty.call(requestParams, paramKey) && - requestParams[paramKey] !== undefined - ) { - requestUrl.searchParams.append(paramKey, requestParams[paramKey] ?? ""); - } - } + const filteredRequestParams = ExternalLoader.filterUndefinedObjectValues( + requestParams + ); + Object.keys(filteredRequestParams).forEach((paramKey) => + requestUrl.searchParams.append( + paramKey, + filteredRequestParams[paramKey] ?? "" + ) + ); if (jsonpCallback) { - ExternalURILoader.runJsonpCallback(requestUrl, callback, jsonpCallback); + ExternalLoader.runJsonpCallback(requestUrl, callback, jsonpCallback); return; } - const headers = externalLoaderHeaders || {}; + const headers = ExternalLoader.filterUndefinedObjectValues( + externalLoaderHeaders || {} + ); fetch(requestUrl.toString(), { headers, }) .then((response) => { if (!response.ok) { - throw new Error( - `Received HTTP status code ${response.status} when attempting geocoding request.` + throw new ResponseError( + `Received HTTP status code ${response.status} when attempting geocoding request.`, + response ); } return response.json(); }) - .then( - (data) => callback(data), - () => { - throw new Error( - "Received invalid JSON data when attempting geocoding request." - ); - } - ) + .then((data) => callback(data)) .catch((error) => { - console.log(error); - callback(null); + if (errorCallback && error instanceof ResponseError) { + errorCallback(error); + return; + } + throw error; }); } + private static filterUndefinedObjectValues( + object: Record + ): Record { + return Object.keys(object).reduce((acc: Record, key) => { + const filtered = acc; + const value = object[key]; + if (value !== undefined) { + filtered[key] = value; + } + return filtered; + }, {}); + } + private static runJsonpCallback( requestUrl: URL, callback: ResponseCallback, @@ -119,7 +135,7 @@ export default class ExternalURILoader implements ExternalLoaderInterface { requestUrl.searchParams.append( jsonpCallback, - ExternalURILoader.generateJsonpCallback(callback) + ExternalLoader.generateJsonpCallback(callback) ); // Create a new script element. diff --git a/src/GeoJsonDumper.ts b/src/GeoJsonDumper.ts index a086214..2f3b7aa 100644 --- a/src/GeoJsonDumper.ts +++ b/src/GeoJsonDumper.ts @@ -6,6 +6,7 @@ export interface GeoJson { readonly properties: { readonly [property: string]: | string + | string[] | number | AdminLevel[] | AdminLevelObject[] @@ -58,6 +59,7 @@ export default class GeoJsonDumper { let properties: { [property: string]: | string + | string[] | number | AdminLevel[] | AdminLevelObject[] diff --git a/src/Geocoded.ts b/src/Geocoded.ts index 3e57540..d99a7a1 100644 --- a/src/Geocoded.ts +++ b/src/Geocoded.ts @@ -1,7 +1,12 @@ import AdminLevel from "AdminLevel"; export interface GeocodedObject { - readonly [property: string]: string | number | AdminLevel[] | undefined; + readonly [property: string]: + | string + | string[] + | number + | AdminLevel[] + | undefined; readonly latitude?: number; readonly longitude?: number; readonly south?: number; @@ -18,6 +23,7 @@ export interface GeocodedObject { readonly adminLevels?: AdminLevel[]; readonly country?: string; readonly countryCode?: string; + readonly timezone?: string; } export default class Geocoded { @@ -53,6 +59,8 @@ export default class Geocoded { private readonly countryCode?: string; + private readonly timezone?: string; + protected constructor({ latitude, longitude, @@ -70,6 +78,7 @@ export default class Geocoded { adminLevels, country, countryCode, + timezone, }: GeocodedObject) { this.latitude = latitude; this.longitude = longitude; @@ -87,6 +96,7 @@ export default class Geocoded { this.adminLevels = adminLevels || []; this.country = country; this.countryCode = countryCode; + this.timezone = timezone; } public static create(object: GeocodedObject): Geocoded { @@ -111,6 +121,7 @@ export default class Geocoded { adminLevels: this.adminLevels, country: this.country, countryCode: this.countryCode, + timezone: this.timezone, }; } @@ -201,4 +212,8 @@ export default class Geocoded { public getCountryCode(): undefined | string { return this.countryCode; } + + public getTimezone(): undefined | string { + return this.timezone; + } } diff --git a/src/GeocoderProviderFactory.ts b/src/GeocoderProviderFactory.ts index 43e7785..68a766c 100644 --- a/src/GeocoderProviderFactory.ts +++ b/src/GeocoderProviderFactory.ts @@ -6,14 +6,17 @@ import { MapquestProvider, NominatimProvider, NominatimProviderOptionsInterface, + OpenCageProvider, + OpenCageProviderOptionsInterface, YandexProvider, YandexProviderOptionsInterface, ProviderOptionsInterface, defaultMapboxProviderOptions, defaultNominatimProviderOptions, + defaultOpenCageProviderOptions, defaultProviderOptions, -} from "providers"; -import ExternalURILoader from "ExternalURILoader"; +} from "provider"; +import ExternalLoader from "ExternalLoader"; interface ProviderOptionInterface { provider: @@ -22,6 +25,7 @@ interface ProviderOptionInterface { | "mapbox" | "mapquest" | "nominatim" + | "opencage" | "openstreetmap" | "yandex"; } @@ -42,6 +46,12 @@ interface NominatimGeocoderProviderFactoryOptions provider: "nominatim" | "openstreetmap"; } +interface OpenCageGeocoderProviderFactoryOptions + extends ProviderOptionInterface, + OpenCageProviderOptionsInterface { + provider: "opencage"; +} + interface YandexGeocoderProviderFactoryOptions extends ProviderOptionInterface, YandexProviderOptionsInterface { @@ -52,6 +62,7 @@ export type GeocoderProviderFactoryOptions = | ProviderFactoryOptions | MapboxGeocoderProviderFactoryOptions | NominatimGeocoderProviderFactoryOptions + | OpenCageGeocoderProviderFactoryOptions | YandexGeocoderProviderFactoryOptions; export type GeocoderProvider = @@ -60,6 +71,7 @@ export type GeocoderProvider = | MapboxProvider | MapquestProvider | NominatimProvider + | OpenCageProvider | YandexProvider; export type GeocoderProviderByOptionsType< @@ -68,6 +80,8 @@ export type GeocoderProviderByOptionsType< ? MapboxProvider : O extends NominatimGeocoderProviderFactoryOptions ? NominatimProvider + : O extends OpenCageGeocoderProviderFactoryOptions + ? OpenCageProvider : O extends YandexGeocoderProviderFactoryOptions ? YandexProvider : GeocoderProvider; @@ -91,7 +105,7 @@ export default class ProviderFactory { ...(typeof options === "string" ? { provider: options } : options), }; - const externalLoader = new ExternalURILoader(); + const externalLoader = new ExternalLoader(); const { provider, ...providerOptions } = createProviderOptions; switch (provider) { @@ -122,6 +136,13 @@ export default class ProviderFactory { ...providerOptions, }) ); + case "opencage": + return >( + new OpenCageProvider(externalLoader, { + ...defaultOpenCageProviderOptions, + ...providerOptions, + }) + ); case "yandex": return >( new YandexProvider(externalLoader, providerOptions) diff --git a/src/error/ResponseError.ts b/src/error/ResponseError.ts new file mode 100644 index 0000000..c3758df --- /dev/null +++ b/src/error/ResponseError.ts @@ -0,0 +1,18 @@ +export default class ResponseError extends Error { + public __proto__: ResponseError; + + private readonly response: Response; + + public constructor(message: string, response: Response) { + super(message); + this.name = "ResponseError"; + this.response = response; + + // eslint-disable-next-line no-proto + this.__proto__ = ResponseError.prototype; + } + + public getResponse(): Response { + return this.response; + } +} diff --git a/src/error/index.ts b/src/error/index.ts new file mode 100644 index 0000000..f3dc9db --- /dev/null +++ b/src/error/index.ts @@ -0,0 +1,2 @@ +// eslint-disable-next-line import/prefer-default-export +export { default as ResponseError } from "error/ResponseError"; diff --git a/src/index.ts b/src/index.ts index 59bfe9b..90392dc 100644 --- a/src/index.ts +++ b/src/index.ts @@ -10,12 +10,12 @@ export interface Coordinates { readonly longitude: number | string; } -export * from "providers"; +export * from "provider"; export * from "query"; export { default as AdminLevel } from "AdminLevel"; export * from "AdminLevel"; -export { default as ExternalURILoader } from "ExternalURILoader"; -export * from "ExternalURILoader"; +export { default as ExternalLoader } from "ExternalLoader"; +export * from "ExternalLoader"; export { default as Geocoded } from "Geocoded"; export * from "Geocoded"; export { default as GeocoderProviderFactory } from "GeocoderProviderFactory"; diff --git a/src/providers/BingProvider.ts b/src/provider/BingProvider.ts similarity index 97% rename from src/providers/BingProvider.ts rename to src/provider/BingProvider.ts index cd8b65a..5999132 100644 --- a/src/providers/BingProvider.ts +++ b/src/provider/BingProvider.ts @@ -1,14 +1,11 @@ -import { - ExternalLoaderInterface, - ExternalLoaderParams, -} from "ExternalURILoader"; +import { ExternalLoaderInterface, ExternalLoaderParams } from "ExternalLoader"; import { GeocodedResultsCallback, ProviderHelpers, ProviderInterface, ProviderOptionsInterface, defaultProviderOptions, -} from "providers"; +} from "provider"; import Geocoded from "Geocoded"; import { GeocodeQuery, diff --git a/src/providers/GoogleAPIProvider.ts b/src/provider/GoogleAPIProvider.ts similarity index 98% rename from src/providers/GoogleAPIProvider.ts rename to src/provider/GoogleAPIProvider.ts index 0154527..7ffd2e0 100644 --- a/src/providers/GoogleAPIProvider.ts +++ b/src/provider/GoogleAPIProvider.ts @@ -1,14 +1,11 @@ -import { - ExternalLoaderInterface, - ExternalLoaderParams, -} from "ExternalURILoader"; +import { ExternalLoaderInterface, ExternalLoaderParams } from "ExternalLoader"; import { GeocodedResultsCallback, ProviderHelpers, ProviderInterface, ProviderOptionsInterface, defaultProviderOptions, -} from "providers"; +} from "provider"; import Geocoded from "Geocoded"; import { GeocodeQuery, diff --git a/src/providers/MapquestProvider.ts b/src/provider/MapquestProvider.ts similarity index 97% rename from src/providers/MapquestProvider.ts rename to src/provider/MapquestProvider.ts index fd9037c..3f4d0d7 100644 --- a/src/providers/MapquestProvider.ts +++ b/src/provider/MapquestProvider.ts @@ -1,14 +1,11 @@ -import { - ExternalLoaderInterface, - ExternalLoaderParams, -} from "ExternalURILoader"; +import { ExternalLoaderInterface, ExternalLoaderParams } from "ExternalLoader"; import { GeocodedResultsCallback, ProviderHelpers, ProviderInterface, ProviderOptionsInterface, defaultProviderOptions, -} from "providers"; +} from "provider"; import Geocoded from "Geocoded"; import { GeocodeQuery, diff --git a/src/providers/ProviderHelpers.ts b/src/provider/ProviderHelpers.ts similarity index 97% rename from src/providers/ProviderHelpers.ts rename to src/provider/ProviderHelpers.ts index b16d336..05fa086 100644 --- a/src/providers/ProviderHelpers.ts +++ b/src/provider/ProviderHelpers.ts @@ -1,4 +1,4 @@ -import { GeocodedResultsCallback } from "providers"; +import { GeocodedResultsCallback } from "provider"; import { GeocodeQuery, GeocodeQueryObject, diff --git a/src/providers/ProviderInterface.ts b/src/provider/ProviderInterface.ts similarity index 84% rename from src/providers/ProviderInterface.ts rename to src/provider/ProviderInterface.ts index b8d512a..66f067a 100644 --- a/src/providers/ProviderInterface.ts +++ b/src/provider/ProviderInterface.ts @@ -1,4 +1,8 @@ -import { ExternalLoaderHeaders, ExternalLoaderParams } from "ExternalURILoader"; +import { + ErrorCallback, + ExternalLoaderHeaders, + ExternalLoaderParams, +} from "ExternalLoader"; import Geocoded from "Geocoded"; import { GeocodeQuery, @@ -35,6 +39,7 @@ export default interface ProviderInterface { executeRequest( params: ExternalLoaderParams, callback: GeocodedResultsCallback, - headers?: ExternalLoaderHeaders + headers?: ExternalLoaderHeaders, + errorCallback?: ErrorCallback ): void; } diff --git a/src/providers/YandexProvider.ts b/src/provider/YandexProvider.ts similarity index 98% rename from src/providers/YandexProvider.ts rename to src/provider/YandexProvider.ts index b251f65..6e3983d 100644 --- a/src/providers/YandexProvider.ts +++ b/src/provider/YandexProvider.ts @@ -1,14 +1,11 @@ -import { - ExternalLoaderInterface, - ExternalLoaderParams, -} from "ExternalURILoader"; +import { ExternalLoaderInterface, ExternalLoaderParams } from "ExternalLoader"; import { GeocodedResultsCallback, ProviderHelpers, ProviderInterface, ProviderOptionsInterface, defaultProviderOptions, -} from "providers"; +} from "provider"; import Geocoded from "Geocoded"; import { GeocodeQuery, diff --git a/src/provider/index.ts b/src/provider/index.ts new file mode 100644 index 0000000..d5b0a0a --- /dev/null +++ b/src/provider/index.ts @@ -0,0 +1,14 @@ +export { default as ProviderHelpers } from "provider/ProviderHelpers"; +export { default as ProviderInterface } from "provider/ProviderInterface"; +export * from "provider/ProviderInterface"; +export { default as BingProvider } from "provider/BingProvider"; +export * from "provider/BingProvider"; +export { default as GoogleAPIProvider } from "provider/GoogleAPIProvider"; +export * from "provider/GoogleAPIProvider"; +export * from "provider/mapbox"; +export { default as MapquestProvider } from "provider/MapquestProvider"; +export * from "provider/MapquestProvider"; +export * from "provider/nominatim"; +export * from "provider/opencage"; +export { default as YandexProvider } from "provider/YandexProvider"; +export * from "provider/YandexProvider"; diff --git a/src/providers/mapbox/MapboxGeocodeQuery.ts b/src/provider/mapbox/MapboxGeocodeQuery.ts similarity index 54% rename from src/providers/mapbox/MapboxGeocodeQuery.ts rename to src/provider/mapbox/MapboxGeocodeQuery.ts index 110b0cc..f9cedf6 100644 --- a/src/providers/mapbox/MapboxGeocodeQuery.ts +++ b/src/provider/mapbox/MapboxGeocodeQuery.ts @@ -1,17 +1,27 @@ import { GeocodeQuery, GeocodeQueryObject } from "query"; export interface MapboxGeocodeQueryObject extends GeocodeQueryObject { + readonly countryCodes?: string[]; + readonly proximity?: Coordinates; readonly locationTypes?: string[]; } export default class MapboxGeocodeQuery extends GeocodeQuery { + private readonly countryCodes?: string[]; + + private readonly proximity?: Coordinates; + private readonly locationTypes?: string[]; protected constructor({ + countryCodes, + proximity, locationTypes, ...geocodeQueryObject }: MapboxGeocodeQueryObject) { super(geocodeQueryObject); + this.countryCodes = countryCodes; + this.proximity = proximity; this.locationTypes = locationTypes; } @@ -22,10 +32,28 @@ export default class MapboxGeocodeQuery extends GeocodeQuery { public toObject(): MapboxGeocodeQueryObject { return { ...super.toObject(), + countryCodes: this.countryCodes, + proximity: this.proximity, locationTypes: this.locationTypes, }; } + public withCountryCodes(countryCodes: string[]): MapboxGeocodeQuery { + return new MapboxGeocodeQuery({ ...this.toObject(), countryCodes }); + } + + public getCountryCodes(): undefined | string[] { + return this.countryCodes; + } + + public withProximity(proximity: Coordinates): MapboxGeocodeQuery { + return new MapboxGeocodeQuery({ ...this.toObject(), proximity }); + } + + public getProximity(): undefined | Coordinates { + return this.proximity; + } + public withLocationTypes(locationTypes: string[]): MapboxGeocodeQuery { return new MapboxGeocodeQuery({ ...this.toObject(), locationTypes }); } diff --git a/src/provider/mapbox/MapboxGeocoded.ts b/src/provider/mapbox/MapboxGeocoded.ts new file mode 100644 index 0000000..47065e1 --- /dev/null +++ b/src/provider/mapbox/MapboxGeocoded.ts @@ -0,0 +1,39 @@ +import Geocoded, { GeocodedObject } from "Geocoded"; + +export interface MapboxGeocodedObject extends GeocodedObject { + readonly resultType?: string[]; +} + +export default class MapboxGeocoded extends Geocoded { + private readonly resultType?: string[]; + + protected constructor({ + resultType, + ...geocodedObject + }: MapboxGeocodedObject) { + super(geocodedObject); + this.resultType = resultType; + } + + public static create(object: MapboxGeocodedObject): MapboxGeocoded { + return new this(object); + } + + public toObject(): MapboxGeocodedObject { + return { + ...super.toObject(), + resultType: this.resultType, + }; + } + + public withResultType(resultType: string[]): MapboxGeocoded { + return new MapboxGeocoded({ + ...this.toObject(), + resultType, + }); + } + + public getResultType(): undefined | string[] { + return this.resultType; + } +} diff --git a/src/providers/mapbox/MapboxProvider.ts b/src/provider/mapbox/MapboxProvider.ts similarity index 63% rename from src/providers/mapbox/MapboxProvider.ts rename to src/provider/mapbox/MapboxProvider.ts index 037840e..f967634 100644 --- a/src/providers/mapbox/MapboxProvider.ts +++ b/src/provider/mapbox/MapboxProvider.ts @@ -1,9 +1,7 @@ -import { - ExternalLoaderInterface, - ExternalLoaderParams, -} from "ExternalURILoader"; +import { ExternalLoaderInterface, ExternalLoaderParams } from "ExternalLoader"; import { GeocodedResultsCallback, + MapboxGeocoded, MapboxGeocodeQuery, MapboxGeocodeQueryObject, MapboxReverseQuery, @@ -12,9 +10,9 @@ import { ProviderInterface, ProviderOptionsInterface, defaultProviderOptions, -} from "providers"; -import Geocoded from "Geocoded"; +} from "provider"; import { Box } from "types"; +import AdminLevel from "AdminLevel"; interface MapboxRequestParams { [param: string]: string | undefined; @@ -24,9 +22,18 @@ interface MapboxRequestParams { readonly language?: string; readonly limit?: string; readonly bbox?: string; + readonly proximity?: string; + readonly reverseMode?: "distance" | "score"; readonly types?: string; } +interface MapboxResponse { + type: "FeatureCollection"; + query: string[]; + features: MapboxResult[]; + attribution: string; +} + interface MapboxFeatureContextProperties { id: string; text: string; @@ -95,7 +102,7 @@ export interface MapboxProviderOptionsInterface extends ProviderOptionsInterface { readonly apiKey: string; readonly geocodingMode?: MAPBOX_GEOCODING_MODES; - readonly country?: string; + readonly countryCodes?: string[]; } export const defaultMapboxProviderOptions = { @@ -139,22 +146,26 @@ export default class MapboxProvider implements ProviderInterface { }/${geocodeQuery.getText()}.json`, }); - const params: MapboxRequestParams = { - access_token: this.options.apiKey || "", - country: this.options.country, - language: geocodeQuery.getLocale(), - limit: geocodeQuery.getLimit().toString(), - bbox: geocodeQuery.getBounds() - ? `${geocodeQuery.getBounds()?.west},${ - geocodeQuery.getBounds()?.south - },${geocodeQuery.getBounds()?.east},${ - geocodeQuery.getBounds()?.north - }` - : undefined, - types: (geocodeQuery).getLocationTypes() - ? (geocodeQuery).getLocationTypes()?.join(",") - : undefined, - }; + const params: MapboxRequestParams = this.getCommonParams( + { + bbox: geocodeQuery.getBounds() + ? `${geocodeQuery.getBounds()?.west},${ + geocodeQuery.getBounds()?.south + },${geocodeQuery.getBounds()?.east},${ + geocodeQuery.getBounds()?.north + }` + : undefined, + proximity: (geocodeQuery).getProximity() + ? `${(geocodeQuery).getProximity()?.longitude},${ + (geocodeQuery).getProximity()?.latitude + }` + : undefined, + types: (geocodeQuery).getLocationTypes() + ? (geocodeQuery).getLocationTypes()?.join(",") + : undefined, + }, + geocodeQuery + ); this.executeRequest(params, callback); } @@ -186,24 +197,44 @@ export default class MapboxProvider implements ProviderInterface { },${reverseQuery.getCoordinates().latitude}.json`, }); - const params: MapboxRequestParams = { - access_token: this.options.apiKey || "", - country: this.options.country, - language: reverseQuery.getLocale(), - limit: reverseQuery.getLimit().toString(), - types: (reverseQuery).getLocationTypes() - ? (reverseQuery).getLocationTypes()?.join(",") - : "address", - }; + const params: MapboxRequestParams = this.getCommonParams( + { + reverseMode: (reverseQuery).getReverseMode() + ? (reverseQuery).getReverseMode() + : undefined, + types: (reverseQuery).getLocationTypes() + ? (reverseQuery).getLocationTypes()?.join(",") + : "address", + }, + reverseQuery + ); this.executeRequest(params, reverseCallback); } + private getCommonParams( + params: Pick< + MapboxRequestParams, + "bbox" | "proximity" | "reverseMode" | "types" + >, + query: MapboxGeocodeQuery | MapboxReverseQuery + ): MapboxRequestParams { + return { + ...params, + access_token: this.options.apiKey || "", + country: query.getCountryCodes() + ? query.getCountryCodes()?.join(",") + : this.options.countryCodes?.join(","), + language: query.getLocale(), + limit: query.getLimit().toString(), + }; + } + public executeRequest( params: ExternalLoaderParams, callback: GeocodedResultsCallback ): void { - this.externalLoader.executeRequest(params, (data) => { + this.externalLoader.executeRequest(params, (data: MapboxResponse) => { callback( data.features.map((result: MapboxResult) => MapboxProvider.mapToGeocoded(result) @@ -212,7 +243,7 @@ export default class MapboxProvider implements ProviderInterface { }); } - public static mapToGeocoded(result: MapboxResult): Geocoded { + public static mapToGeocoded(result: MapboxResult): MapboxGeocoded { const latitude = result.geometry.coordinates[1]; const longitude = result.geometry.coordinates[0]; const formattedAddress = result.place_name; @@ -223,19 +254,41 @@ export default class MapboxProvider implements ProviderInterface { let region; let country; let countryCode; + const adminLevels: AdminLevel[] = []; + const resultType = result.place_type; + let adminLevelCode: undefined | string; (result.context || []).forEach((feature) => { const type = feature.id.split(".")[0]; switch (type) { case "locality": + locality = feature.text; + break; case "place": locality = feature.text; + adminLevels.push( + AdminLevel.create({ + level: 2, + name: locality, + }) + ); break; case "postcode": postalCode = feature.text; break; case "region": region = feature.text; + adminLevelCode = undefined; + if (feature.short_code && feature.short_code.match(/[A-z]{2}-/)) { + adminLevelCode = feature.short_code.replace(/[A-z]{2}-/, ""); + } + adminLevels.push( + AdminLevel.create({ + level: 1, + name: region, + code: adminLevelCode, + }) + ); break; case "country": country = feature.text; @@ -245,7 +298,7 @@ export default class MapboxProvider implements ProviderInterface { } }); - let geocoded = Geocoded.create({ + let geocoded = MapboxGeocoded.create({ latitude, longitude, formattedAddress, @@ -254,15 +307,19 @@ export default class MapboxProvider implements ProviderInterface { locality, postalCode, region, + adminLevels, country, countryCode, + resultType, }); if (result.bbox) { - geocoded = geocoded.withBounds( - result.bbox[1], - result.bbox[0], - result.bbox[3], - result.bbox[2] + geocoded = ( + geocoded.withBounds( + result.bbox[1], + result.bbox[0], + result.bbox[3], + result.bbox[2] + ) ); } diff --git a/src/providers/mapbox/MapboxReverseQuery.ts b/src/provider/mapbox/MapboxReverseQuery.ts similarity index 52% rename from src/providers/mapbox/MapboxReverseQuery.ts rename to src/provider/mapbox/MapboxReverseQuery.ts index 60e1f8f..dd730dd 100644 --- a/src/providers/mapbox/MapboxReverseQuery.ts +++ b/src/provider/mapbox/MapboxReverseQuery.ts @@ -1,17 +1,29 @@ import { ReverseQuery, ReverseQueryObject } from "query"; +type ReverseMode = "distance" | "score"; + export interface MapboxReverseQueryObject extends ReverseQueryObject { + readonly countryCodes?: string[]; + readonly reverseMode?: ReverseMode; readonly locationTypes?: string[]; } export default class MapboxReverseQuery extends ReverseQuery { + private readonly countryCodes?: string[]; + + private readonly reverseMode?: ReverseMode; + private readonly locationTypes?: string[]; protected constructor({ + countryCodes, + reverseMode, locationTypes, ...reverseQueryObject }: MapboxReverseQueryObject) { super(reverseQueryObject); + this.countryCodes = countryCodes; + this.reverseMode = reverseMode; this.locationTypes = locationTypes; } @@ -22,10 +34,28 @@ export default class MapboxReverseQuery extends ReverseQuery { public toObject(): MapboxReverseQueryObject { return { ...super.toObject(), + countryCodes: this.countryCodes, + reverseMode: this.reverseMode, locationTypes: this.locationTypes, }; } + public withCountryCodes(countryCodes: string[]): MapboxReverseQuery { + return new MapboxReverseQuery({ ...this.toObject(), countryCodes }); + } + + public getCountryCodes(): undefined | string[] { + return this.countryCodes; + } + + public withReverseMode(reverseMode: ReverseMode): MapboxReverseQuery { + return new MapboxReverseQuery({ ...this.toObject(), reverseMode }); + } + + public getReverseMode(): undefined | ReverseMode { + return this.reverseMode; + } + public withLocationTypes(locationTypes: string[]): MapboxReverseQuery { return new MapboxReverseQuery({ ...this.toObject(), locationTypes }); } diff --git a/src/provider/mapbox/index.ts b/src/provider/mapbox/index.ts new file mode 100644 index 0000000..acf0bd9 --- /dev/null +++ b/src/provider/mapbox/index.ts @@ -0,0 +1,7 @@ +export { default as MapboxGeocoded } from "provider/mapbox/MapboxGeocoded"; +export { default as MapboxGeocodeQuery } from "provider/mapbox/MapboxGeocodeQuery"; +export * from "provider/mapbox/MapboxGeocodeQuery"; +export { default as MapboxProvider } from "provider/mapbox/MapboxProvider"; +export * from "provider/mapbox/MapboxProvider"; +export { default as MapboxReverseQuery } from "provider/mapbox/MapboxReverseQuery"; +export * from "provider/mapbox/MapboxReverseQuery"; diff --git a/src/providers/nominatim/NominatimGeocodeQuery.ts b/src/provider/nominatim/NominatimGeocodeQuery.ts similarity index 100% rename from src/providers/nominatim/NominatimGeocodeQuery.ts rename to src/provider/nominatim/NominatimGeocodeQuery.ts diff --git a/src/providers/nominatim/NominatimGeocoded.ts b/src/provider/nominatim/NominatimGeocoded.ts similarity index 100% rename from src/providers/nominatim/NominatimGeocoded.ts rename to src/provider/nominatim/NominatimGeocoded.ts diff --git a/src/providers/nominatim/NominatimProvider.ts b/src/provider/nominatim/NominatimProvider.ts similarity index 85% rename from src/providers/nominatim/NominatimProvider.ts rename to src/provider/nominatim/NominatimProvider.ts index ad0a6f5..d87eda0 100644 --- a/src/providers/nominatim/NominatimProvider.ts +++ b/src/provider/nominatim/NominatimProvider.ts @@ -2,7 +2,7 @@ import { ExternalLoaderHeaders, ExternalLoaderInterface, ExternalLoaderParams, -} from "ExternalURILoader"; +} from "ExternalLoader"; import { GeocodedResultsCallback, NominatimGeocoded, @@ -14,7 +14,7 @@ import { ProviderInterface, ProviderOptionsInterface, defaultProviderOptions, -} from "providers"; +} from "provider"; import AdminLevel from "AdminLevel"; interface NominatimRequestParams { @@ -127,34 +127,22 @@ export default class NominatimProvider implements ProviderInterface { { q: geocodeQuery.getText(), limit: geocodeQuery.getLimit().toString(), - ...((geocodeQuery).getCountryCodes() - ? { - countrycodes: (geocodeQuery) - .getCountryCodes() - ?.join(","), - } - : {}), - ...((geocodeQuery).getExcludePlaceIds() - ? { - exclude_place_ids: (geocodeQuery) - .getExcludePlaceIds() - ?.join(","), - } - : {}), - ...((geocodeQuery).getViewBox() - ? { - viewbox: (geocodeQuery) - .getViewBox() - ?.join(","), - } - : {}), - ...((geocodeQuery).getBounded() - ? { - bounded: (geocodeQuery) - .getBounded() - ?.toString(), - } - : {}), + countrycodes: (geocodeQuery).getCountryCodes() + ? (geocodeQuery).getCountryCodes()?.join(",") + : undefined, + exclude_place_ids: (( + geocodeQuery + )).getExcludePlaceIds() + ? (geocodeQuery) + .getExcludePlaceIds() + ?.join(",") + : undefined, + viewbox: (geocodeQuery).getViewBox() + ? (geocodeQuery).getViewBox()?.join(",") + : undefined, + bounded: (geocodeQuery).getBounded() + ? (geocodeQuery).getBounded()?.toString() + : undefined, }, geocodeQuery ); @@ -209,14 +197,14 @@ export default class NominatimProvider implements ProviderInterface { format: "jsonv2", addressdetails: "1", JSONPCallback: this.options.useJsonp ? "json_callback" : undefined, - ...(query.getLocale() ? { "accept-language": query.getLocale() } : {}), + "accept-language": query.getLocale(), }; } private getHeaders(): ExternalLoaderHeaders { return { "User-Agent": this.options.userAgent || "", - ...(this.options.referer ? { Referer: this.options.referer } : {}), + Referer: this.options.referer, }; } @@ -229,11 +217,9 @@ export default class NominatimProvider implements ProviderInterface { params, (data) => { callback( - data.length - ? data.map((result: NominatimResult) => - NominatimProvider.mapToGeocoded(result) - ) - : [] + data.map((result: NominatimResult) => + NominatimProvider.mapToGeocoded(result) + ) ); }, headers diff --git a/src/providers/nominatim/NominatimReverseQuery.ts b/src/provider/nominatim/NominatimReverseQuery.ts similarity index 100% rename from src/providers/nominatim/NominatimReverseQuery.ts rename to src/provider/nominatim/NominatimReverseQuery.ts diff --git a/src/provider/nominatim/index.ts b/src/provider/nominatim/index.ts new file mode 100644 index 0000000..38cc645 --- /dev/null +++ b/src/provider/nominatim/index.ts @@ -0,0 +1,20 @@ +export { default as NominatimGeocoded } from "provider/nominatim/NominatimGeocoded"; +export { default as OpenStreetMapGeocoded } from "provider/nominatim/NominatimGeocoded"; +export * from "provider/nominatim/NominatimGeocoded"; +export { NominatimGeocodedObject as OpenStreetMapGeocodedObject } from "provider/nominatim/NominatimGeocoded"; +export { default as NominatimGeocodeQuery } from "provider/nominatim/NominatimGeocodeQuery"; +export { default as OpenStreetMapGeocodeQuery } from "provider/nominatim/NominatimGeocodeQuery"; +export * from "provider/nominatim/NominatimGeocodeQuery"; +export { NominatimGeocodeQueryObject as OpenStreetMapGeocodeQueryObject } from "provider/nominatim/NominatimGeocodeQuery"; +export { default as NominatimProvider } from "provider/nominatim/NominatimProvider"; +export { default as OpenStreetMapProvider } from "provider/nominatim/NominatimProvider"; +export * from "provider/nominatim/NominatimProvider"; +export { + NominatimProviderOptionsInterface as OpenStreetMapProviderOptionsInterface, + NominatimResult as OpenStreetMapResult, + defaultNominatimProviderOptions as defaultOpenStreetMapProviderOptions, +} from "provider/nominatim/NominatimProvider"; +export { default as NominatimReverseQuery } from "provider/nominatim/NominatimReverseQuery"; +export { default as OpenStreetMapReverseQuery } from "provider/nominatim/NominatimReverseQuery"; +export * from "provider/nominatim/NominatimReverseQuery"; +export { NominatimReverseQueryObject as OpenStreetMapReverseQueryObject } from "provider/nominatim/NominatimReverseQuery"; diff --git a/src/provider/opencage/OpenCageGeocodeQuery.ts b/src/provider/opencage/OpenCageGeocodeQuery.ts new file mode 100644 index 0000000..ca64409 --- /dev/null +++ b/src/provider/opencage/OpenCageGeocodeQuery.ts @@ -0,0 +1,92 @@ +import { GeocodeQuery, GeocodeQueryObject } from "query"; +import { Coordinates } from "index"; + +export interface OpenCageGeocodeQueryObject extends GeocodeQueryObject { + readonly countryCodes?: string[]; + readonly proximity?: Coordinates; + readonly minConfidence?: number; + readonly noRecord?: boolean; +} + +export default class OpenCageGeocodeQuery extends GeocodeQuery { + private readonly countryCodes?: string[]; + + private readonly proximity?: Coordinates; + + private readonly minConfidence?: number; + + private readonly noRecord?: boolean; + + protected constructor({ + countryCodes, + proximity, + minConfidence, + noRecord, + ...geocodeQueryObject + }: OpenCageGeocodeQueryObject) { + super(geocodeQueryObject); + this.countryCodes = countryCodes; + this.proximity = proximity; + if ( + minConfidence && + (minConfidence.toString() !== + parseInt(minConfidence.toString(), 10).toString() || + minConfidence < 1 || + minConfidence > 10) + ) { + throw new Error( + 'The "minConfidence" parameter must be an integer from 1 to 10.' + ); + } + this.minConfidence = minConfidence; + this.noRecord = noRecord; + } + + public static create( + object: OpenCageGeocodeQueryObject + ): OpenCageGeocodeQuery { + return new this(object); + } + + public toObject(): OpenCageGeocodeQueryObject { + return { + ...super.toObject(), + countryCodes: this.countryCodes, + proximity: this.proximity, + minConfidence: this.minConfidence, + noRecord: this.noRecord, + }; + } + + public withCountryCodes(countryCodes: string[]): OpenCageGeocodeQuery { + return new OpenCageGeocodeQuery({ ...this.toObject(), countryCodes }); + } + + public getCountryCodes(): undefined | string[] { + return this.countryCodes; + } + + public withProximity(proximity: Coordinates): OpenCageGeocodeQuery { + return new OpenCageGeocodeQuery({ ...this.toObject(), proximity }); + } + + public getProximity(): undefined | Coordinates { + return this.proximity; + } + + public withMinConfidence(minConfidence: number): OpenCageGeocodeQuery { + return new OpenCageGeocodeQuery({ ...this.toObject(), minConfidence }); + } + + public getMinConfidence(): undefined | number { + return this.minConfidence; + } + + public withNoRecord(noRecord: boolean): OpenCageGeocodeQuery { + return new OpenCageGeocodeQuery({ ...this.toObject(), noRecord }); + } + + public getNoRecord(): undefined | boolean { + return this.noRecord; + } +} diff --git a/src/provider/opencage/OpenCageGeocoded.ts b/src/provider/opencage/OpenCageGeocoded.ts new file mode 100644 index 0000000..3243279 --- /dev/null +++ b/src/provider/opencage/OpenCageGeocoded.ts @@ -0,0 +1,124 @@ +import Geocoded, { GeocodedObject } from "Geocoded"; + +export interface OpenCageGeocodedObject extends GeocodedObject { + readonly callingCode?: number; + readonly flag?: string; + readonly mgrs?: string; + readonly maidenhead?: string; + readonly geohash?: string; + readonly what3words?: string; +} + +export default class OpenCageGeocoded extends Geocoded { + private readonly callingCode?: number; + + private readonly flag?: string; + + private readonly mgrs?: string; + + private readonly maidenhead?: string; + + private readonly geohash?: string; + + private readonly what3words?: string; + + protected constructor({ + callingCode, + flag, + mgrs, + maidenhead, + geohash, + what3words, + ...geocodedObject + }: OpenCageGeocodedObject) { + super(geocodedObject); + this.callingCode = callingCode; + this.flag = flag; + this.mgrs = mgrs; + this.maidenhead = maidenhead; + this.geohash = geohash; + this.what3words = what3words; + } + + public static create(object: OpenCageGeocodedObject): OpenCageGeocoded { + return new this(object); + } + + public toObject(): OpenCageGeocodedObject { + return { + ...super.toObject(), + callingCode: this.callingCode, + flag: this.flag, + mgrs: this.mgrs, + maidenhead: this.maidenhead, + geohash: this.geohash, + what3words: this.what3words, + }; + } + + public withCallingCode(callingCode: number): OpenCageGeocoded { + return new OpenCageGeocoded({ + ...this.toObject(), + callingCode, + }); + } + + public getCallingCode(): undefined | number { + return this.callingCode; + } + + public withFlag(flag: string): OpenCageGeocoded { + return new OpenCageGeocoded({ + ...this.toObject(), + flag, + }); + } + + public getFlag(): undefined | string { + return this.flag; + } + + public withMgrs(mgrs: string): OpenCageGeocoded { + return new OpenCageGeocoded({ + ...this.toObject(), + mgrs, + }); + } + + public getMgrs(): undefined | string { + return this.mgrs; + } + + public withMaidenhead(maidenhead: string): OpenCageGeocoded { + return new OpenCageGeocoded({ + ...this.toObject(), + maidenhead, + }); + } + + public getMaidenhead(): undefined | string { + return this.maidenhead; + } + + public withGeohash(geohash: string): OpenCageGeocoded { + return new OpenCageGeocoded({ + ...this.toObject(), + geohash, + }); + } + + public getGeohash(): undefined | string { + return this.geohash; + } + + public withWhat3words(what3words: string): OpenCageGeocoded { + return new OpenCageGeocoded({ + ...this.toObject(), + what3words, + }); + } + + public getWhat3words(): undefined | string { + return this.what3words; + } +} diff --git a/src/provider/opencage/OpenCageProvider.ts b/src/provider/opencage/OpenCageProvider.ts new file mode 100644 index 0000000..19382d9 --- /dev/null +++ b/src/provider/opencage/OpenCageProvider.ts @@ -0,0 +1,551 @@ +import { ExternalLoaderInterface, ExternalLoaderParams } from "ExternalLoader"; +import { + GeocodedResultsCallback, + OpenCageGeocoded, + OpenCageGeocodeQuery, + OpenCageGeocodeQueryObject, + OpenCageReverseQuery, + OpenCageReverseQueryObject, + ProviderHelpers, + ProviderInterface, + ProviderOptionsInterface, + defaultProviderOptions, +} from "provider"; +import AdminLevel from "AdminLevel"; + +interface OpenCageRequestParams { + [param: string]: string | undefined; + readonly key: string; + readonly q: string; + readonly countrycode?: string; + readonly language?: string; + readonly limit?: string; + readonly bounds?: string; + readonly proximity?: string; + // eslint-disable-next-line camelcase + readonly min_confidence?: string; + // eslint-disable-next-line camelcase + readonly no_record?: string; + readonly JSONPCallback?: string; +} + +interface OpenCageCoordinates { + lat: number; + lng: number; +} + +interface OpenCageSun { + apparent: number; + astronomical: number; + civil: number; + nautical: number; +} + +interface OpenCageResponse { + documentation: string; + licences: { + name: string; + url: string; + }[]; + rate: { + limit: number; + remaining: number; + reset: number; + }; + results: OpenCageResult[]; + status: { + code: 200 | 400 | 401 | 402 | 403 | 404 | 405 | 408 | 410 | 429 | 503; + message: string; + }; + // eslint-disable-next-line camelcase + stay_informed: { + blog: string; + twitter: string; + }; + thanks: string; + timestamp: { + // eslint-disable-next-line camelcase + created_http: string; + // eslint-disable-next-line camelcase + created_unix: number; + }; + // eslint-disable-next-line camelcase + total_results: number; +} + +export interface OpenCageResult { + annotations: { + callingcode: number; + currency: { + // eslint-disable-next-line camelcase + alternate_symbols: string[]; + // eslint-disable-next-line camelcase + decimal_mark: string; + // eslint-disable-next-line camelcase + disambiguate_symbol?: string; + // eslint-disable-next-line camelcase + html_entity: string; + // eslint-disable-next-line camelcase + iso_code: string; + // eslint-disable-next-line camelcase + iso_numeric: string; + name: string; + // eslint-disable-next-line camelcase + smallest_denomination: number; + subunit: string; + // eslint-disable-next-line camelcase + subunit_to_unit: number; + symbol: string; + // eslint-disable-next-line camelcase + symbol_first: number; + // eslint-disable-next-line camelcase + thousands_separator: string; + }; + DMS: { + lat: string; + lng: string; + }; + FIPS?: { + state?: string; + county?: string; + }; + flag: string; + geohash?: string; + ITM?: { + easting: string; + northing: string; + }; + Maidenhead?: string; + Mercator: { + x: number; + y: number; + }; + MGRS?: string; + OSM: { + // eslint-disable-next-line camelcase + edit_url?: string; + // eslint-disable-next-line camelcase + note_url: string; + url: string; + }; + qibla: number; + roadinfo: { + // eslint-disable-next-line camelcase + drive_on: "left" | "right"; + road?: string; + // eslint-disable-next-line camelcase + road_type?: string; + // eslint-disable-next-line camelcase + road_reference?: string; + // eslint-disable-next-line camelcase + road_reference_intl?: string; + // eslint-disable-next-line camelcase + speed_in: "km/h" | "mph"; + }; + sun: { + rise: OpenCageSun; + set: OpenCageSun; + }; + timezone: { + name: string; + // eslint-disable-next-line camelcase + now_in_dst: number; + // eslint-disable-next-line camelcase + offset_sec: number; + // eslint-disable-next-line camelcase + offset_string: string; + // eslint-disable-next-line camelcase + short_name: string; + }; + // eslint-disable-next-line camelcase + UN_M49: { + regions: { + [region: string]: string; + }; + // eslint-disable-next-line camelcase + statistical_groupings: ("LDC" | "LEDC" | "LLDC" | "MEDC" | "SIDS")[]; + }; + what3words?: { + words: string; + }; + wikidata?: string; + }; + bounds: { + northeast: OpenCageCoordinates; + southwest: OpenCageCoordinates; + }; + components: { + "ISO_3166-1_alpha-2"?: string; + "ISO_3166-1_alpha-3"?: string; + _category: + | "agriculture" + | "building" + | "castle" + | "commerce" + | "construction" + | "education" + | "financial" + | "government" + | "health" + | "industrial" + | "military" + | "natural/water" + | "outdoors/recreation" + | "place" + | "place_of_worship" + | "postcode" + | "road" + | "social" + | "transportation" + | "travel/tourism" + | "unknown"; + _type: string; + castle?: string; + city?: string; + // eslint-disable-next-line camelcase + city_district?: string; + continent?: + | "Africa" + | "Antarctica" + | "Asia" + | "Europe" + | "Oceania" + | "North America" + | "South America"; + country?: string; + // eslint-disable-next-line camelcase + country_code?: string; + county?: string; + // eslint-disable-next-line camelcase + county_code?: string; + croft?: string; + district?: string; + footway?: string; + hamlet?: string; + // eslint-disable-next-line camelcase + house_number?: string; + houses?: string; + locality?: string; + municipality?: string; + neighbourhood?: string; + path?: string; + pedestrian?: string; + // eslint-disable-next-line camelcase + political_union?: string; + postcode?: string; + quarter?: string; + residential?: string; + road?: string; + // eslint-disable-next-line camelcase + road_reference?: string; + // eslint-disable-next-line camelcase + road_reference_intl?: string; + // eslint-disable-next-line camelcase + road_type?: string; + state?: string; + // eslint-disable-next-line camelcase + state_code?: string; + // eslint-disable-next-line camelcase + state_district?: string; + street?: string; + // eslint-disable-next-line camelcase + street_name?: string; + subdivision?: string; + suburb?: string; + town?: string; + village?: string; + }; + confidence: number; + formatted: string; + geometry: OpenCageCoordinates; +} + +export interface OpenCageProviderOptionsInterface + extends ProviderOptionsInterface { + readonly apiKey: string; + readonly countryCodes?: string[]; +} + +export const defaultOpenCageProviderOptions = { + ...defaultProviderOptions, + apiKey: "", +}; + +export default class OpenCageProvider implements ProviderInterface { + private externalLoader: ExternalLoaderInterface; + + private options: OpenCageProviderOptionsInterface; + + public constructor( + _externalLoader: ExternalLoaderInterface, + options: OpenCageProviderOptionsInterface = defaultOpenCageProviderOptions + ) { + this.externalLoader = _externalLoader; + this.options = { ...defaultOpenCageProviderOptions, ...options }; + if (!this.options.apiKey) { + throw new Error( + 'An API key is required for the OpenCage provider. Please add it in the "apiKey" option.' + ); + } + } + + public geocode( + query: string | OpenCageGeocodeQuery | OpenCageGeocodeQueryObject, + callback: GeocodedResultsCallback + ): void { + const geocodeQuery = ProviderHelpers.getGeocodeQueryFromParameter( + query, + OpenCageGeocodeQuery + ); + + this.externalLoader.setOptions({ + protocol: this.options.useSsl ? "https" : "http", + host: "api.opencagedata.com", + pathname: "geocode/v1/json", + }); + + const params: OpenCageRequestParams = this.getCommonParams( + { + q: geocodeQuery.getText(), + bounds: geocodeQuery.getBounds() + ? `${geocodeQuery.getBounds()?.west},${ + geocodeQuery.getBounds()?.south + },${geocodeQuery.getBounds()?.east},${ + geocodeQuery.getBounds()?.north + }` + : undefined, + proximity: (geocodeQuery).getProximity() + ? `${(geocodeQuery).getProximity()?.latitude},${ + (geocodeQuery).getProximity()?.longitude + }` + : undefined, + }, + geocodeQuery + ); + + this.executeRequest(params, callback); + } + + public geodecode( + latitudeOrQuery: + | number + | string + | OpenCageReverseQuery + | OpenCageReverseQueryObject, + longitudeOrCallback: number | string | GeocodedResultsCallback, + callback?: GeocodedResultsCallback + ): void { + const reverseQuery = ProviderHelpers.getReverseQueryFromParameters( + latitudeOrQuery, + longitudeOrCallback, + OpenCageReverseQuery + ); + const reverseCallback = ProviderHelpers.getCallbackFromParameters( + longitudeOrCallback, + callback + ); + + this.externalLoader.setOptions({ + protocol: this.options.useSsl ? "https" : "http", + host: "api.opencagedata.com", + pathname: "geocode/v1/json", + }); + + const params: OpenCageRequestParams = this.getCommonParams( + { + q: `${reverseQuery.getCoordinates().latitude},${ + reverseQuery.getCoordinates().longitude + }`, + }, + reverseQuery + ); + + this.executeRequest(params, reverseCallback); + } + + private getCommonParams( + params: Pick, + query: OpenCageGeocodeQuery | OpenCageReverseQuery + ): OpenCageRequestParams { + return { + ...params, + key: this.options.apiKey || "", + countrycode: query.getCountryCodes() + ? query.getCountryCodes()?.join(",") + : this.options.countryCodes?.join(","), + language: query.getLocale(), + limit: query.getLimit().toString(), + min_confidence: query.getMinConfidence()?.toString(), + no_record: query.getNoRecord()?.toString(), + JSONPCallback: this.options.useJsonp ? "jsonp" : undefined, + }; + } + + public executeRequest( + params: ExternalLoaderParams, + callback: GeocodedResultsCallback + ): void { + this.externalLoader.executeRequest( + params, + (data: OpenCageResponse) => { + callback( + data.results.map((result: OpenCageResult) => + OpenCageProvider.mapToGeocoded(result) + ) + ); + }, + {}, + (error) => { + error + .getResponse() + .json() + .then((data: OpenCageResponse) => { + if (data.status) { + switch (data.status.code) { + case 400: + throw new Error( + `Invalid request (400): ${data.status.message}` + ); + case 401: + throw new Error( + `Unable to authenticate (401): ${data.status.message}` + ); + case 402: + throw new Error( + `Quota exceeded (402): ${data.status.message}` + ); + case 403: + throw new Error(`Forbidden (403): ${data.status.message}`); + case 404: + throw new Error( + `Invalid API endpoint (404): ${data.status.message}` + ); + case 405: + throw new Error( + `Method not allowed (405): ${data.status.message}` + ); + case 408: + throw new Error(`Timeout (408): ${data.status.message}`); + case 410: + throw new Error( + `Request too long (410): ${data.status.message}` + ); + case 429: + throw new Error( + `Too many requests (429): ${data.status.message}` + ); + case 503: + throw new Error( + `Internal server error (503): ${data.status.message}` + ); + default: + throw new Error( + `Error (${data.status.code}): ${data.status.message}` + ); + } + } + }); + } + ); + } + + public static mapToGeocoded(result: OpenCageResult): OpenCageGeocoded { + const latitude = result.geometry.lat; + const longitude = result.geometry.lng; + const formattedAddress = result.formatted; + const streetNumber = result.components.house_number; + const postalCode = result.components.postcode; + const region = result.components.state; + const { country } = result.components; + const countryCode = result.components.country_code; + const timezone = result.annotations.timezone.name; + const callingCode = result.annotations.callingcode; + const { flag } = result.annotations; + const mgrs = result.annotations.MGRS; + const maidenhead = result.annotations.Maidenhead; + const { geohash } = result.annotations; + const what3words = result.annotations.what3words?.words; + + const streetName = + result.components.road || + result.components.footway || + result.components.street || + result.components.street_name || + result.components.residential || + result.components.path || + result.components.pedestrian || + result.components.road_reference || + result.components.road_reference_intl; + + const subLocality = + result.components.neighbourhood || + result.components.suburb || + result.components.city_district || + result.components.district || + result.components.quarter || + result.components.houses || + result.components.subdivision; + + const locality = + result.components.city || + result.components.town || + result.components.municipality || + result.components.village || + result.components.hamlet || + result.components.locality || + result.components.croft; + + let geocoded = OpenCageGeocoded.create({ + latitude, + longitude, + formattedAddress, + streetNumber, + streetName, + subLocality, + locality, + postalCode, + region, + country, + countryCode, + timezone, + callingCode, + flag, + mgrs, + maidenhead, + geohash, + what3words, + }); + + if (result.bounds) { + geocoded = ( + geocoded.withBounds( + result.bounds.southwest.lat, + result.bounds.southwest.lng, + result.bounds.northeast.lat, + result.bounds.northeast.lng + ) + ); + } + + const adminLevels: { + nameKey: "state" | "county"; + codeKey: "state_code" | "county_code"; + }[] = [ + { nameKey: "state", codeKey: "state_code" }, + { nameKey: "county", codeKey: "county_code" }, + ]; + adminLevels.forEach(({ nameKey, codeKey }, level) => { + if (result.components[nameKey]) { + geocoded.addAdminLevel( + AdminLevel.create({ + level: level + 1, + name: result.components[nameKey] || "", + code: result.components[codeKey] || undefined, + }) + ); + } + }); + + return geocoded; + } +} diff --git a/src/provider/opencage/OpenCageReverseQuery.ts b/src/provider/opencage/OpenCageReverseQuery.ts new file mode 100644 index 0000000..1947698 --- /dev/null +++ b/src/provider/opencage/OpenCageReverseQuery.ts @@ -0,0 +1,77 @@ +import { ReverseQuery, ReverseQueryObject } from "query"; + +export interface OpenCageReverseQueryObject extends ReverseQueryObject { + readonly countryCodes?: string[]; + readonly minConfidence?: number; + readonly noRecord?: boolean; +} + +export default class OpenCageReverseQuery extends ReverseQuery { + private readonly countryCodes?: string[]; + + private readonly minConfidence?: number; + + private readonly noRecord?: boolean; + + protected constructor({ + countryCodes, + minConfidence, + noRecord, + ...reverseQueryObject + }: OpenCageReverseQueryObject) { + super(reverseQueryObject); + this.countryCodes = countryCodes; + if ( + minConfidence && + (minConfidence.toString() !== + parseInt(minConfidence.toString(), 10).toString() || + minConfidence < 1 || + minConfidence > 10) + ) { + throw new Error( + 'The "minConfidence" parameter must be an integer from 1 to 10.' + ); + } + this.minConfidence = minConfidence; + this.noRecord = noRecord; + } + + public static create( + object: OpenCageReverseQueryObject + ): OpenCageReverseQuery { + return new this(object); + } + + public toObject(): OpenCageReverseQueryObject { + return { + ...super.toObject(), + countryCodes: this.countryCodes, + minConfidence: this.minConfidence, + noRecord: this.noRecord, + }; + } + + public withCountryCodes(countryCodes: string[]): OpenCageReverseQuery { + return new OpenCageReverseQuery({ ...this.toObject(), countryCodes }); + } + + public getCountryCodes(): undefined | string[] { + return this.countryCodes; + } + + public withMinConfidence(minConfidence: number): OpenCageReverseQuery { + return new OpenCageReverseQuery({ ...this.toObject(), minConfidence }); + } + + public getMinConfidence(): undefined | number { + return this.minConfidence; + } + + public withNoRecord(noRecord: boolean): OpenCageReverseQuery { + return new OpenCageReverseQuery({ ...this.toObject(), noRecord }); + } + + public getNoRecord(): undefined | boolean { + return this.noRecord; + } +} diff --git a/src/provider/opencage/index.ts b/src/provider/opencage/index.ts new file mode 100644 index 0000000..0c69151 --- /dev/null +++ b/src/provider/opencage/index.ts @@ -0,0 +1,7 @@ +export { default as OpenCageGeocoded } from "provider/opencage/OpenCageGeocoded"; +export { default as OpenCageGeocodeQuery } from "provider/opencage/OpenCageGeocodeQuery"; +export * from "provider/opencage/OpenCageGeocodeQuery"; +export { default as OpenCageProvider } from "provider/opencage/OpenCageProvider"; +export * from "provider/opencage/OpenCageProvider"; +export { default as OpenCageReverseQuery } from "provider/opencage/OpenCageReverseQuery"; +export * from "provider/opencage/OpenCageReverseQuery"; diff --git a/src/providers/index.ts b/src/providers/index.ts deleted file mode 100644 index 7f615f8..0000000 --- a/src/providers/index.ts +++ /dev/null @@ -1,13 +0,0 @@ -export { default as ProviderHelpers } from "providers/ProviderHelpers"; -export { default as ProviderInterface } from "providers/ProviderInterface"; -export * from "providers/ProviderInterface"; -export { default as BingProvider } from "providers/BingProvider"; -export * from "providers/BingProvider"; -export { default as GoogleAPIProvider } from "providers/GoogleAPIProvider"; -export * from "providers/GoogleAPIProvider"; -export * from "providers/mapbox"; -export { default as MapquestProvider } from "providers/MapquestProvider"; -export * from "providers/MapquestProvider"; -export * from "providers/nominatim"; -export { default as YandexProvider } from "providers/YandexProvider"; -export * from "providers/YandexProvider"; diff --git a/src/providers/mapbox/index.ts b/src/providers/mapbox/index.ts deleted file mode 100644 index b85eca0..0000000 --- a/src/providers/mapbox/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -export { default as MapboxGeocodeQuery } from "providers/mapbox/MapboxGeocodeQuery"; -export * from "providers/mapbox/MapboxGeocodeQuery"; -export { default as MapboxProvider } from "providers/mapbox/MapboxProvider"; -export * from "providers/mapbox/MapboxProvider"; -export { default as MapboxReverseQuery } from "providers/mapbox/MapboxReverseQuery"; -export * from "providers/mapbox/MapboxReverseQuery"; diff --git a/src/providers/nominatim/index.ts b/src/providers/nominatim/index.ts deleted file mode 100644 index 11d429c..0000000 --- a/src/providers/nominatim/index.ts +++ /dev/null @@ -1,20 +0,0 @@ -export { default as NominatimGeocoded } from "providers/nominatim/NominatimGeocoded"; -export { default as OpenStreetMapGeocoded } from "providers/nominatim/NominatimGeocoded"; -export * from "providers/nominatim/NominatimGeocoded"; -export { NominatimGeocodedObject as OpenStreetMapGeocodedObject } from "providers/nominatim/NominatimGeocoded"; -export { default as NominatimGeocodeQuery } from "providers/nominatim/NominatimGeocodeQuery"; -export { default as OpenStreetMapGeocodeQuery } from "providers/nominatim/NominatimGeocodeQuery"; -export * from "providers/nominatim/NominatimGeocodeQuery"; -export { NominatimGeocodeQueryObject as OpenStreetMapGeocodeQueryObject } from "providers/nominatim/NominatimGeocodeQuery"; -export { default as NominatimProvider } from "providers/nominatim/NominatimProvider"; -export { default as OpenStreetMapProvider } from "providers/nominatim/NominatimProvider"; -export * from "providers/nominatim/NominatimProvider"; -export { - NominatimProviderOptionsInterface as OpenStreetMapProviderOptionsInterface, - NominatimResult as OpenStreetMapResult, - defaultNominatimProviderOptions as defaultOpenStreetMapProviderOptions, -} from "providers/nominatim/NominatimProvider"; -export { default as NominatimReverseQuery } from "providers/nominatim/NominatimReverseQuery"; -export { default as OpenStreetMapReverseQuery } from "providers/nominatim/NominatimReverseQuery"; -export * from "providers/nominatim/NominatimReverseQuery"; -export { NominatimReverseQueryObject as OpenStreetMapReverseQueryObject } from "providers/nominatim/NominatimReverseQuery"; diff --git a/src/query/GeocodeQuery.ts b/src/query/GeocodeQuery.ts index ea9db0b..97ae0a3 100644 --- a/src/query/GeocodeQuery.ts +++ b/src/query/GeocodeQuery.ts @@ -1,4 +1,4 @@ -import { DEFAULT_RESULT_LIMIT } from "providers/ProviderInterface"; +import { DEFAULT_RESULT_LIMIT } from "provider"; import { PartialSome } from "types"; import { Bounds } from "index"; diff --git a/src/query/ReverseQuery.ts b/src/query/ReverseQuery.ts index b0766e9..912ac69 100644 --- a/src/query/ReverseQuery.ts +++ b/src/query/ReverseQuery.ts @@ -1,4 +1,4 @@ -import { DEFAULT_RESULT_LIMIT } from "providers/ProviderInterface"; +import { DEFAULT_RESULT_LIMIT } from "provider"; import { PartialSome } from "types"; import { Coordinates } from "index"; diff --git a/types/ExternalURILoader.d.ts b/types/ExternalLoader.d.ts similarity index 66% rename from types/ExternalURILoader.d.ts rename to types/ExternalLoader.d.ts index c36d884..a5e231d 100644 --- a/types/ExternalURILoader.d.ts +++ b/types/ExternalLoader.d.ts @@ -1,6 +1,7 @@ +import { ResponseError } from "./error"; export interface ExternalLoaderInterface { setOptions(options: ExternalLoaderOptions): void; - executeRequest(params: ExternalLoaderParams, callback: ResponseCallback, headers?: ExternalLoaderHeaders): void; + executeRequest(params: ExternalLoaderParams, callback: ResponseCallback, headers?: ExternalLoaderHeaders, errorCallback?: ErrorCallback): void; } export interface ExternalLoaderOptions { readonly protocol: string; @@ -12,17 +13,19 @@ export interface ExternalLoaderParams { JSONPCallback?: string; } export interface ExternalLoaderHeaders { - [header: string]: string; + [header: string]: string | undefined; } declare type ResponseCallback = (response: any) => void; +export declare type ErrorCallback = (responseError: ResponseError) => void; /** * Load data from external geocoding engines. */ -export default class ExternalURILoader implements ExternalLoaderInterface { +export default class ExternalLoader implements ExternalLoaderInterface { private options; constructor(options?: ExternalLoaderOptions); setOptions(options: ExternalLoaderOptions): void; - executeRequest(params: ExternalLoaderParams, callback: ResponseCallback, externalLoaderHeaders?: ExternalLoaderHeaders): void; + executeRequest(params: ExternalLoaderParams, callback: ResponseCallback, externalLoaderHeaders?: ExternalLoaderHeaders, errorCallback?: ErrorCallback): void; + private static filterUndefinedObjectValues; private static runJsonpCallback; /** * Generates randomly-named function to use as a callback for JSONP requests. @@ -31,4 +34,4 @@ export default class ExternalURILoader implements ExternalLoaderInterface { private static generateJsonpCallback; } export {}; -//# sourceMappingURL=ExternalURILoader.d.ts.map \ No newline at end of file +//# sourceMappingURL=ExternalLoader.d.ts.map \ No newline at end of file diff --git a/types/ExternalLoader.d.ts.map b/types/ExternalLoader.d.ts.map new file mode 100644 index 0000000..b04260e --- /dev/null +++ b/types/ExternalLoader.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ExternalLoader.d.ts","sourceRoot":"","sources":["../src/ExternalLoader.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,gBAAc;AAEtC,MAAM,WAAW,uBAAuB;IACtC,UAAU,CAAC,OAAO,EAAE,qBAAqB,GAAG,IAAI,CAAC;IACjD,cAAc,CACZ,MAAM,EAAE,oBAAoB,EAC5B,QAAQ,EAAE,gBAAgB,EAC1B,OAAO,CAAC,EAAE,qBAAqB,EAC/B,aAAa,CAAC,EAAE,aAAa,GAC5B,IAAI,CAAC;CACT;AAED,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED,MAAM,WAAW,oBAAoB;IACnC,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;IACpC,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,qBAAqB;IACpC,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;CACtC;AAGD,aAAK,gBAAgB,GAAG,CAAC,QAAQ,EAAE,GAAG,KAAK,IAAI,CAAC;AAChD,oBAAY,aAAa,GAAG,CAAC,aAAa,EAAE,aAAa,KAAK,IAAI,CAAC;AAMnE;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,cAAe,YAAW,uBAAuB;IACpE,OAAO,CAAC,OAAO,CAAyC;gBAErC,OAAO,GAAE,qBAAsC;IAI3D,UAAU,CAAC,OAAO,EAAE,qBAAqB,GAAG,IAAI;IAIhD,cAAc,CACnB,MAAM,EAAE,oBAAoB,EAC5B,QAAQ,EAAE,gBAAgB,EAC1B,qBAAqB,CAAC,EAAE,qBAAqB,EAC7C,aAAa,CAAC,EAAE,aAAa,GAC5B,IAAI;IAsDP,OAAO,CAAC,MAAM,CAAC,2BAA2B;IAa1C,OAAO,CAAC,MAAM,CAAC,gBAAgB;IA4B/B;;;OAGG;IACH,OAAO,CAAC,MAAM,CAAC,qBAAqB;CAoBrC"} \ No newline at end of file diff --git a/types/ExternalURILoader.d.ts.map b/types/ExternalURILoader.d.ts.map deleted file mode 100644 index 357ad06..0000000 --- a/types/ExternalURILoader.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ExternalURILoader.d.ts","sourceRoot":"","sources":["../src/ExternalURILoader.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,uBAAuB;IACtC,UAAU,CAAC,OAAO,EAAE,qBAAqB,GAAG,IAAI,CAAC;IACjD,cAAc,CACZ,MAAM,EAAE,oBAAoB,EAC5B,QAAQ,EAAE,gBAAgB,EAC1B,OAAO,CAAC,EAAE,qBAAqB,GAC9B,IAAI,CAAC;CACT;AAED,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED,MAAM,WAAW,oBAAoB;IACnC,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;IACpC,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,qBAAqB;IACpC,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC;CAC1B;AAGD,aAAK,gBAAgB,GAAG,CAAC,QAAQ,EAAE,GAAG,KAAK,IAAI,CAAC;AAMhD;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,iBAAkB,YAAW,uBAAuB;IACvE,OAAO,CAAC,OAAO,CAAyC;gBAErC,OAAO,GAAE,qBAAsC;IAI3D,UAAU,CAAC,OAAO,EAAE,qBAAqB,GAAG,IAAI;IAIhD,cAAc,CACnB,MAAM,EAAE,oBAAoB,EAC5B,QAAQ,EAAE,gBAAgB,EAC1B,qBAAqB,CAAC,EAAE,qBAAqB,GAC5C,IAAI;IAuDP,OAAO,CAAC,MAAM,CAAC,gBAAgB;IA4B/B;;;OAGG;IACH,OAAO,CAAC,MAAM,CAAC,qBAAqB;CAoBrC"} \ No newline at end of file diff --git a/types/GeoJsonDumper.d.ts b/types/GeoJsonDumper.d.ts index 68ec369..3de20f6 100644 --- a/types/GeoJsonDumper.d.ts +++ b/types/GeoJsonDumper.d.ts @@ -3,7 +3,7 @@ import AdminLevel, { AdminLevelObject } from "./AdminLevel"; export interface GeoJson { readonly type: "Feature"; readonly properties: { - readonly [property: string]: string | number | AdminLevel[] | AdminLevelObject[] | undefined; + readonly [property: string]: string | string[] | number | AdminLevel[] | AdminLevelObject[] | undefined; }; readonly geometry: { readonly type: "Point"; diff --git a/types/GeoJsonDumper.d.ts.map b/types/GeoJsonDumper.d.ts.map index 453963c..bc539fb 100644 --- a/types/GeoJsonDumper.d.ts.map +++ b/types/GeoJsonDumper.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"GeoJsonDumper.d.ts","sourceRoot":"","sources":["../src/GeoJsonDumper.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,mBAAiB;AAChC,OAAO,UAAU,EAAE,EAAE,gBAAgB,EAAE,qBAAmB;AAE1D,MAAM,WAAW,OAAO;IACtB,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IACzB,QAAQ,CAAC,UAAU,EAAE;QACnB,QAAQ,EAAE,QAAQ,EAAE,MAAM,GACtB,MAAM,GACN,MAAM,GACN,UAAU,EAAE,GACZ,gBAAgB,EAAE,GAClB,SAAS,CAAC;KACf,CAAC;IACF,QAAQ,CAAC,QAAQ,EAAE;QACjB,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;QACvB,QAAQ,CAAC,WAAW,EAAE,CAAC,MAAM,GAAG,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;KAChE,CAAC;IACF,QAAQ,CAAC,MAAM,CAAC,EAAE;QAChB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;QACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;QACtB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;QACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;KACvB,CAAC;CACH;AAED,MAAM,CAAC,OAAO,OAAO,aAAa;IAChC,OAAO,CAAC,MAAM,CAAC,WAAW,CAOxB;WAEY,IAAI,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO;CAiDhD"} \ No newline at end of file +{"version":3,"file":"GeoJsonDumper.d.ts","sourceRoot":"","sources":["../src/GeoJsonDumper.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,mBAAiB;AAChC,OAAO,UAAU,EAAE,EAAE,gBAAgB,EAAE,qBAAmB;AAE1D,MAAM,WAAW,OAAO;IACtB,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IACzB,QAAQ,CAAC,UAAU,EAAE;QACnB,QAAQ,EAAE,QAAQ,EAAE,MAAM,GACtB,MAAM,GACN,MAAM,EAAE,GACR,MAAM,GACN,UAAU,EAAE,GACZ,gBAAgB,EAAE,GAClB,SAAS,CAAC;KACf,CAAC;IACF,QAAQ,CAAC,QAAQ,EAAE;QACjB,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;QACvB,QAAQ,CAAC,WAAW,EAAE,CAAC,MAAM,GAAG,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;KAChE,CAAC;IACF,QAAQ,CAAC,MAAM,CAAC,EAAE;QAChB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;QACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;QACtB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;QACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;KACvB,CAAC;CACH;AAED,MAAM,CAAC,OAAO,OAAO,aAAa;IAChC,OAAO,CAAC,MAAM,CAAC,WAAW,CAOxB;WAEY,IAAI,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO;CAkDhD"} \ No newline at end of file diff --git a/types/Geocoded.d.ts b/types/Geocoded.d.ts index 36be346..26a0d1f 100644 --- a/types/Geocoded.d.ts +++ b/types/Geocoded.d.ts @@ -1,6 +1,6 @@ import AdminLevel from "./AdminLevel"; export interface GeocodedObject { - readonly [property: string]: string | number | AdminLevel[] | undefined; + readonly [property: string]: string | string[] | number | AdminLevel[] | undefined; readonly latitude?: number; readonly longitude?: number; readonly south?: number; @@ -17,6 +17,7 @@ export interface GeocodedObject { readonly adminLevels?: AdminLevel[]; readonly country?: string; readonly countryCode?: string; + readonly timezone?: string; } export default class Geocoded { private readonly latitude?; @@ -35,7 +36,8 @@ export default class Geocoded { private readonly adminLevels; private readonly country?; private readonly countryCode?; - protected constructor({ latitude, longitude, south, west, north, east, formattedAddress, streetNumber, streetName, subLocality, locality, postalCode, region, adminLevels, country, countryCode, }: GeocodedObject); + private readonly timezone?; + protected constructor({ latitude, longitude, south, west, north, east, formattedAddress, streetNumber, streetName, subLocality, locality, postalCode, region, adminLevels, country, countryCode, timezone, }: GeocodedObject); static create(object: GeocodedObject): Geocoded; toObject(): GeocodedObject; withBounds(south?: number, west?: number, north?: number, east?: number): Geocoded; @@ -55,5 +57,6 @@ export default class Geocoded { getAdminLevels(): AdminLevel[]; getCountry(): undefined | string; getCountryCode(): undefined | string; + getTimezone(): undefined | string; } //# sourceMappingURL=Geocoded.d.ts.map \ No newline at end of file diff --git a/types/Geocoded.d.ts.map b/types/Geocoded.d.ts.map index e70edb2..072a508 100644 --- a/types/Geocoded.d.ts.map +++ b/types/Geocoded.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"Geocoded.d.ts","sourceRoot":"","sources":["../src/Geocoded.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,qBAAmB;AAEpC,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,UAAU,EAAE,GAAG,SAAS,CAAC;IACxE,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IACnC,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,WAAW,CAAC,EAAE,UAAU,EAAE,CAAC;IACpC,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;CAC/B;AAED,MAAM,CAAC,OAAO,OAAO,QAAQ;IAC3B,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAS;IAEnC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAS;IAEpC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAS;IAEhC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAS;IAE/B,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAS;IAEhC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAS;IAE/B,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAC,CAAS;IAE3C,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAS;IAEvC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAS;IAErC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAS;IAEtC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAS;IAEnC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAS;IAErC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAS;IAEjC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAe;IAE3C,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAS;IAElC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAS;IAEtC,SAAS,aAAa,EACpB,QAAQ,EACR,SAAS,EACT,KAAK,EACL,IAAI,EACJ,KAAK,EACL,IAAI,EACJ,gBAAgB,EAChB,YAAY,EACZ,UAAU,EACV,WAAW,EACX,QAAQ,EACR,UAAU,EACV,MAAM,EACN,WAAW,EACX,OAAO,EACP,WAAW,GACZ,EAAE,cAAc;WAmBH,MAAM,CAAC,MAAM,EAAE,cAAc,GAAG,QAAQ;IAI/C,QAAQ,IAAI,cAAc;IAqB1B,UAAU,CACf,KAAK,CAAC,EAAE,MAAM,EACd,IAAI,CAAC,EAAE,MAAM,EACb,KAAK,CAAC,EAAE,MAAM,EACd,IAAI,CAAC,EAAE,MAAM,GACZ,QAAQ;IAUJ,eAAe,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,QAAQ;IAQhE,cAAc,IAAI,CAAC,SAAS,GAAG,MAAM,EAAE,SAAS,GAAG,MAAM,CAAC;IAI1D,WAAW,IAAI,SAAS,GAAG,MAAM;IAIjC,YAAY,IAAI,SAAS,GAAG,MAAM;IAIlC,SAAS,IAAI,CAClB,SAAS,GAAG,MAAM,EAClB,SAAS,GAAG,MAAM,EAClB,SAAS,GAAG,MAAM,EAClB,SAAS,GAAG,MAAM,CACnB;IAIM,mBAAmB,IAAI,SAAS,GAAG,MAAM;IAIzC,eAAe,IAAI,SAAS,GAAG,MAAM;IAIrC,aAAa,IAAI,SAAS,GAAG,MAAM;IAInC,cAAc,IAAI,SAAS,GAAG,MAAM;IAIpC,WAAW,IAAI,SAAS,GAAG,MAAM;IAIjC,aAAa,IAAI,SAAS,GAAG,MAAM;IAInC,SAAS,IAAI,SAAS,GAAG,MAAM;IAI/B,aAAa,CAAC,UAAU,EAAE,UAAU,GAAG,IAAI;IAI3C,cAAc,IAAI,UAAU,EAAE;IAI9B,UAAU,IAAI,SAAS,GAAG,MAAM;IAIhC,cAAc,IAAI,SAAS,GAAG,MAAM;CAG5C"} \ No newline at end of file +{"version":3,"file":"Geocoded.d.ts","sourceRoot":"","sources":["../src/Geocoded.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,qBAAmB;AAEpC,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE,QAAQ,EAAE,MAAM,GACtB,MAAM,GACN,MAAM,EAAE,GACR,MAAM,GACN,UAAU,EAAE,GACZ,SAAS,CAAC;IACd,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IACnC,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,WAAW,CAAC,EAAE,UAAU,EAAE,CAAC;IACpC,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED,MAAM,CAAC,OAAO,OAAO,QAAQ;IAC3B,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAS;IAEnC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAS;IAEpC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAS;IAEhC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAS;IAE/B,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAS;IAEhC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAS;IAE/B,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAC,CAAS;IAE3C,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAS;IAEvC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAS;IAErC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAS;IAEtC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAS;IAEnC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAS;IAErC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAS;IAEjC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAe;IAE3C,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAS;IAElC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAS;IAEtC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAS;IAEnC,SAAS,aAAa,EACpB,QAAQ,EACR,SAAS,EACT,KAAK,EACL,IAAI,EACJ,KAAK,EACL,IAAI,EACJ,gBAAgB,EAChB,YAAY,EACZ,UAAU,EACV,WAAW,EACX,QAAQ,EACR,UAAU,EACV,MAAM,EACN,WAAW,EACX,OAAO,EACP,WAAW,EACX,QAAQ,GACT,EAAE,cAAc;WAoBH,MAAM,CAAC,MAAM,EAAE,cAAc,GAAG,QAAQ;IAI/C,QAAQ,IAAI,cAAc;IAsB1B,UAAU,CACf,KAAK,CAAC,EAAE,MAAM,EACd,IAAI,CAAC,EAAE,MAAM,EACb,KAAK,CAAC,EAAE,MAAM,EACd,IAAI,CAAC,EAAE,MAAM,GACZ,QAAQ;IAUJ,eAAe,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,QAAQ;IAQhE,cAAc,IAAI,CAAC,SAAS,GAAG,MAAM,EAAE,SAAS,GAAG,MAAM,CAAC;IAI1D,WAAW,IAAI,SAAS,GAAG,MAAM;IAIjC,YAAY,IAAI,SAAS,GAAG,MAAM;IAIlC,SAAS,IAAI,CAClB,SAAS,GAAG,MAAM,EAClB,SAAS,GAAG,MAAM,EAClB,SAAS,GAAG,MAAM,EAClB,SAAS,GAAG,MAAM,CACnB;IAIM,mBAAmB,IAAI,SAAS,GAAG,MAAM;IAIzC,eAAe,IAAI,SAAS,GAAG,MAAM;IAIrC,aAAa,IAAI,SAAS,GAAG,MAAM;IAInC,cAAc,IAAI,SAAS,GAAG,MAAM;IAIpC,WAAW,IAAI,SAAS,GAAG,MAAM;IAIjC,aAAa,IAAI,SAAS,GAAG,MAAM;IAInC,SAAS,IAAI,SAAS,GAAG,MAAM;IAI/B,aAAa,CAAC,UAAU,EAAE,UAAU,GAAG,IAAI;IAI3C,cAAc,IAAI,UAAU,EAAE;IAI9B,UAAU,IAAI,SAAS,GAAG,MAAM;IAIhC,cAAc,IAAI,SAAS,GAAG,MAAM;IAIpC,WAAW,IAAI,SAAS,GAAG,MAAM;CAGzC"} \ No newline at end of file diff --git a/types/GeocoderProviderFactory.d.ts b/types/GeocoderProviderFactory.d.ts index a66885c..7ed5994 100644 --- a/types/GeocoderProviderFactory.d.ts +++ b/types/GeocoderProviderFactory.d.ts @@ -1,6 +1,6 @@ -import { BingProvider, GoogleAPIProvider, MapboxProvider, MapboxProviderOptionsInterface, MapquestProvider, NominatimProvider, NominatimProviderOptionsInterface, YandexProvider, YandexProviderOptionsInterface, ProviderOptionsInterface } from "./providers"; +import { BingProvider, GoogleAPIProvider, MapboxProvider, MapboxProviderOptionsInterface, MapquestProvider, NominatimProvider, NominatimProviderOptionsInterface, OpenCageProvider, OpenCageProviderOptionsInterface, YandexProvider, YandexProviderOptionsInterface, ProviderOptionsInterface } from "./provider"; interface ProviderOptionInterface { - provider: "bing" | "google" | "mapbox" | "mapquest" | "nominatim" | "openstreetmap" | "yandex"; + provider: "bing" | "google" | "mapbox" | "mapquest" | "nominatim" | "opencage" | "openstreetmap" | "yandex"; } interface ProviderFactoryOptions extends ProviderOptionsInterface, ProviderOptionInterface { } @@ -10,12 +10,15 @@ interface MapboxGeocoderProviderFactoryOptions extends ProviderOptionInterface, interface NominatimGeocoderProviderFactoryOptions extends ProviderOptionInterface, NominatimProviderOptionsInterface { provider: "nominatim" | "openstreetmap"; } +interface OpenCageGeocoderProviderFactoryOptions extends ProviderOptionInterface, OpenCageProviderOptionsInterface { + provider: "opencage"; +} interface YandexGeocoderProviderFactoryOptions extends ProviderOptionInterface, YandexProviderOptionsInterface { provider: "yandex"; } -export declare type GeocoderProviderFactoryOptions = ProviderFactoryOptions | MapboxGeocoderProviderFactoryOptions | NominatimGeocoderProviderFactoryOptions | YandexGeocoderProviderFactoryOptions; -export declare type GeocoderProvider = BingProvider | GoogleAPIProvider | MapboxProvider | MapquestProvider | NominatimProvider | YandexProvider; -export declare type GeocoderProviderByOptionsType = O extends MapboxGeocoderProviderFactoryOptions ? MapboxProvider : O extends NominatimGeocoderProviderFactoryOptions ? NominatimProvider : O extends YandexGeocoderProviderFactoryOptions ? YandexProvider : GeocoderProvider; +export declare type GeocoderProviderFactoryOptions = ProviderFactoryOptions | MapboxGeocoderProviderFactoryOptions | NominatimGeocoderProviderFactoryOptions | OpenCageGeocoderProviderFactoryOptions | YandexGeocoderProviderFactoryOptions; +export declare type GeocoderProvider = BingProvider | GoogleAPIProvider | MapboxProvider | MapquestProvider | NominatimProvider | OpenCageProvider | YandexProvider; +export declare type GeocoderProviderByOptionsType = O extends MapboxGeocoderProviderFactoryOptions ? MapboxProvider : O extends NominatimGeocoderProviderFactoryOptions ? NominatimProvider : O extends OpenCageGeocoderProviderFactoryOptions ? OpenCageProvider : O extends YandexGeocoderProviderFactoryOptions ? YandexProvider : GeocoderProvider; export default class ProviderFactory { /** * Creates Geocoder Provider instances. diff --git a/types/GeocoderProviderFactory.d.ts.map b/types/GeocoderProviderFactory.d.ts.map index 16608a6..ba4efc3 100644 --- a/types/GeocoderProviderFactory.d.ts.map +++ b/types/GeocoderProviderFactory.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"GeocoderProviderFactory.d.ts","sourceRoot":"","sources":["../src/GeocoderProviderFactory.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,iBAAiB,EACjB,cAAc,EACd,8BAA8B,EAC9B,gBAAgB,EAChB,iBAAiB,EACjB,iCAAiC,EACjC,cAAc,EACd,8BAA8B,EAC9B,wBAAwB,EAIzB,oBAAkB;AAGnB,UAAU,uBAAuB;IAC/B,QAAQ,EACJ,MAAM,GACN,QAAQ,GACR,QAAQ,GACR,UAAU,GACV,WAAW,GACX,eAAe,GACf,QAAQ,CAAC;CACd;AAED,UAAU,sBACR,SAAQ,wBAAwB,EAC9B,uBAAuB;CAAG;AAE9B,UAAU,oCACR,SAAQ,uBAAuB,EAC7B,8BAA8B;IAChC,QAAQ,EAAE,QAAQ,CAAC;CACpB;AAED,UAAU,uCACR,SAAQ,uBAAuB,EAC7B,iCAAiC;IACnC,QAAQ,EAAE,WAAW,GAAG,eAAe,CAAC;CACzC;AAED,UAAU,oCACR,SAAQ,uBAAuB,EAC7B,8BAA8B;IAChC,QAAQ,EAAE,QAAQ,CAAC;CACpB;AAED,oBAAY,8BAA8B,GACtC,sBAAsB,GACtB,oCAAoC,GACpC,uCAAuC,GACvC,oCAAoC,CAAC;AAEzC,oBAAY,gBAAgB,GACxB,YAAY,GACZ,iBAAiB,GACjB,cAAc,GACd,gBAAgB,GAChB,iBAAiB,GACjB,cAAc,CAAC;AAEnB,oBAAY,6BAA6B,CACvC,CAAC,IACC,CAAC,SAAS,oCAAoC,GAC9C,cAAc,GACd,CAAC,SAAS,uCAAuC,GACjD,iBAAiB,GACjB,CAAC,SAAS,oCAAoC,GAC9C,cAAc,GACd,gBAAgB,CAAC;AAErB,MAAM,CAAC,OAAO,OAAO,eAAe;IAClC;;;;;;;;;OASG;WACW,cAAc,CAAC,CAAC,SAAS,8BAA8B,EACnE,OAAO,EAAE,MAAM,GAAG,CAAC,GAClB,6BAA6B,CAAC,CAAC,CAAC,GAAG,SAAS;CA8ChD"} \ No newline at end of file +{"version":3,"file":"GeocoderProviderFactory.d.ts","sourceRoot":"","sources":["../src/GeocoderProviderFactory.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,iBAAiB,EACjB,cAAc,EACd,8BAA8B,EAC9B,gBAAgB,EAChB,iBAAiB,EACjB,iCAAiC,EACjC,gBAAgB,EAChB,gCAAgC,EAChC,cAAc,EACd,8BAA8B,EAC9B,wBAAwB,EAKzB,mBAAiB;AAGlB,UAAU,uBAAuB;IAC/B,QAAQ,EACJ,MAAM,GACN,QAAQ,GACR,QAAQ,GACR,UAAU,GACV,WAAW,GACX,UAAU,GACV,eAAe,GACf,QAAQ,CAAC;CACd;AAED,UAAU,sBACR,SAAQ,wBAAwB,EAC9B,uBAAuB;CAAG;AAE9B,UAAU,oCACR,SAAQ,uBAAuB,EAC7B,8BAA8B;IAChC,QAAQ,EAAE,QAAQ,CAAC;CACpB;AAED,UAAU,uCACR,SAAQ,uBAAuB,EAC7B,iCAAiC;IACnC,QAAQ,EAAE,WAAW,GAAG,eAAe,CAAC;CACzC;AAED,UAAU,sCACR,SAAQ,uBAAuB,EAC7B,gCAAgC;IAClC,QAAQ,EAAE,UAAU,CAAC;CACtB;AAED,UAAU,oCACR,SAAQ,uBAAuB,EAC7B,8BAA8B;IAChC,QAAQ,EAAE,QAAQ,CAAC;CACpB;AAED,oBAAY,8BAA8B,GACtC,sBAAsB,GACtB,oCAAoC,GACpC,uCAAuC,GACvC,sCAAsC,GACtC,oCAAoC,CAAC;AAEzC,oBAAY,gBAAgB,GACxB,YAAY,GACZ,iBAAiB,GACjB,cAAc,GACd,gBAAgB,GAChB,iBAAiB,GACjB,gBAAgB,GAChB,cAAc,CAAC;AAEnB,oBAAY,6BAA6B,CACvC,CAAC,IACC,CAAC,SAAS,oCAAoC,GAC9C,cAAc,GACd,CAAC,SAAS,uCAAuC,GACjD,iBAAiB,GACjB,CAAC,SAAS,sCAAsC,GAChD,gBAAgB,GAChB,CAAC,SAAS,oCAAoC,GAC9C,cAAc,GACd,gBAAgB,CAAC;AAErB,MAAM,CAAC,OAAO,OAAO,eAAe;IAClC;;;;;;;;;OASG;WACW,cAAc,CAAC,CAAC,SAAS,8BAA8B,EACnE,OAAO,EAAE,MAAM,GAAG,CAAC,GAClB,6BAA6B,CAAC,CAAC,CAAC,GAAG,SAAS;CAqDhD"} \ No newline at end of file diff --git a/types/error/ResponseError.d.ts b/types/error/ResponseError.d.ts new file mode 100644 index 0000000..298d03b --- /dev/null +++ b/types/error/ResponseError.d.ts @@ -0,0 +1,7 @@ +export default class ResponseError extends Error { + __proto__: ResponseError; + private readonly response; + constructor(message: string, response: Response); + getResponse(): Response; +} +//# sourceMappingURL=ResponseError.d.ts.map \ No newline at end of file diff --git a/types/error/ResponseError.d.ts.map b/types/error/ResponseError.d.ts.map new file mode 100644 index 0000000..5d9d08f --- /dev/null +++ b/types/error/ResponseError.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ResponseError.d.ts","sourceRoot":"","sources":["../../src/error/ResponseError.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,OAAO,aAAc,SAAQ,KAAK;IACvC,SAAS,EAAE,aAAa,CAAC;IAEhC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAW;gBAEjB,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ;IAS/C,WAAW,IAAI,QAAQ;CAG/B"} \ No newline at end of file diff --git a/types/error/index.d.ts b/types/error/index.d.ts new file mode 100644 index 0000000..a690fb6 --- /dev/null +++ b/types/error/index.d.ts @@ -0,0 +1,2 @@ +export { default as ResponseError } from "./ResponseError"; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/types/error/index.d.ts.map b/types/error/index.d.ts.map new file mode 100644 index 0000000..caf8182 --- /dev/null +++ b/types/error/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/error/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAClB,iBAAiB,CAD6B"} \ No newline at end of file diff --git a/types/index.d.ts b/types/index.d.ts index 97e181f..73a4931 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -8,12 +8,12 @@ export interface Coordinates { readonly latitude: number | string; readonly longitude: number | string; } -export * from "./providers"; +export * from "./provider"; export * from "./query"; export { default as AdminLevel } from "./AdminLevel"; export * from "./AdminLevel"; -export { default as ExternalURILoader } from "./ExternalURILoader"; -export * from "./ExternalURILoader"; +export { default as ExternalLoader } from "./ExternalLoader"; +export * from "./ExternalLoader"; export { default as Geocoded } from "./Geocoded"; export * from "./Geocoded"; export { default as GeocoderProviderFactory } from "./GeocoderProviderFactory"; diff --git a/types/index.d.ts.map b/types/index.d.ts.map index b7df41c..45690a2 100644 --- a/types/index.d.ts.map +++ b/types/index.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,MAAM;IACrB,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IAChC,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;IAC/B,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IAChC,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;CAChC;AAED,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAAC;IACnC,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAAC;CACrC;AAED,cAasI,aAAa,CAbzH;AAC1B,cAYmJ,SAAS,CAZtI;AACtB,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAW4H,cAAc,CAXvH;AACnD,cAU4J,cAAc,CAV/I;AAC3B,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MASmI,qBAAqB,CAT9H;AACjE,cAQ0K,qBAAqB,CAR7J;AAClC,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAOiK,YAAY,CAP5J;AAC/C,cAM+L,YAAY,CANlL;AACzB,OAAO,EAAE,OAAO,IAAI,uBAAuB,EAAE,MAK8J,2BAA2B,CALzJ;AAC7E,cAI2M,2BAA2B,CAJ9L;AACxC,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAGmM,iBAAiB,CAH9L;AACzD,cAEsO,iBAAiB,CAFzN;AAC9B,OAAO,EAAE,OAAO,EAAE,MACqO,qBAAqB,CADhO"} \ No newline at end of file +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,MAAM;IACrB,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IAChC,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;IAC/B,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IAChC,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;CAChC;AAED,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAAC;IACnC,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAAC;CACrC;AAED,cAakI,YAAY,CAbrH;AACzB,cAY8I,SAAS,CAZjI;AACtB,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAWuH,cAAc,CAXlH;AACnD,cAUuJ,cAAc,CAV1I;AAC3B,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MASiI,kBAAkB,CAT5H;AAC3D,cAQqK,kBAAkB,CARxJ;AAC/B,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAOyJ,YAAY,CAPpJ;AAC/C,cAMuL,YAAY,CAN1K;AACzB,OAAO,EAAE,OAAO,IAAI,uBAAuB,EAAE,MAKsJ,2BAA2B,CALjJ;AAC7E,cAImM,2BAA2B,CAJtL;AACxC,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAG2L,iBAAiB,CAHtL;AACzD,cAE8N,iBAAiB,CAFjN;AAC9B,OAAO,EAAE,OAAO,EAAE,MAC6N,qBAAqB,CADxN"} \ No newline at end of file diff --git a/types/providers/BingProvider.d.ts b/types/provider/BingProvider.d.ts similarity index 98% rename from types/providers/BingProvider.d.ts rename to types/provider/BingProvider.d.ts index cd852a5..4deb1e3 100644 --- a/types/providers/BingProvider.d.ts +++ b/types/provider/BingProvider.d.ts @@ -1,4 +1,4 @@ -import { ExternalLoaderInterface, ExternalLoaderParams } from "../ExternalURILoader"; +import { ExternalLoaderInterface, ExternalLoaderParams } from "../ExternalLoader"; import { GeocodedResultsCallback, ProviderInterface, ProviderOptionsInterface } from "./"; import Geocoded from "../Geocoded"; import { GeocodeQuery, GeocodeQueryObject, ReverseQuery, ReverseQueryObject } from "../query"; diff --git a/types/provider/BingProvider.d.ts.map b/types/provider/BingProvider.d.ts.map new file mode 100644 index 0000000..9e7c394 --- /dev/null +++ b/types/provider/BingProvider.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"BingProvider.d.ts","sourceRoot":"","sources":["../../src/provider/BingProvider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,oBAAoB,EAAE,0BAAuB;AAC/E,OAAO,EACL,uBAAuB,EAEvB,iBAAiB,EACjB,wBAAwB,EAEzB,WAAiB;AAClB,OAAO,QAAQ,oBAAiB;AAChC,OAAO,EACL,YAAY,EACZ,kBAAkB,EAClB,YAAY,EACZ,kBAAkB,EACnB,iBAAc;AACf,OAAO,EAAE,GAAG,EAAE,iBAAc;AAQ5B,MAAM,WAAW,UAAU;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,GAAG,CAAC;IACV,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE;QACL,IAAI,EAAE,MAAM,CAAC;QACb,WAAW,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;KAC/B,CAAC;IACF,OAAO,EAAE;QACP,WAAW,EAAE,MAAM,CAAC;QACpB,aAAa,EAAE,MAAM,CAAC;QACtB,cAAc,EAAE,MAAM,CAAC;QACvB,aAAa,EAAE,MAAM,CAAC;QACtB,gBAAgB,EAAE,MAAM,CAAC;QACzB,QAAQ,EAAE,MAAM,CAAC;QACjB,UAAU,EAAE,MAAM,CAAC;KACpB,CAAC;IACF,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE;QACb,IAAI,EAAE,MAAM,CAAC;QACb,WAAW,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QAC9B,iBAAiB,EAAE,MAAM,CAAC;QAC1B,UAAU,EAAE,MAAM,EAAE,CAAC;KACtB,EAAE,CAAC;IACJ,UAAU,EAAE,MAAM,EAAE,CAAC;CACtB;AAED,MAAM,CAAC,OAAO,OAAO,YAAa,YAAW,iBAAiB;IAC5D,OAAO,CAAC,cAAc,CAA0B;IAEhD,OAAO,CAAC,OAAO,CAA2B;gBAGxC,eAAe,EAAE,uBAAuB,EACxC,OAAO,GAAE,wBAAiD;IAWrD,OAAO,CACZ,KAAK,EAAE,MAAM,GAAG,YAAY,GAAG,kBAAkB,EACjD,QAAQ,EAAE,uBAAuB,GAChC,IAAI;IAiBA,SAAS,CACd,eAAe,EAAE,MAAM,GAAG,MAAM,GAAG,YAAY,GAAG,kBAAkB,EACpE,mBAAmB,EAAE,MAAM,GAAG,MAAM,GAAG,uBAAuB,EAC9D,QAAQ,CAAC,EAAE,uBAAuB,GACjC,IAAI;IA0BA,cAAc,CACnB,MAAM,EAAE,oBAAoB,EAC5B,QAAQ,EAAE,uBAAuB,GAChC,IAAI;WAUO,aAAa,CAAC,MAAM,EAAE,UAAU,GAAG,QAAQ;CA4B1D"} \ No newline at end of file diff --git a/types/providers/GoogleAPIProvider.d.ts b/types/provider/GoogleAPIProvider.d.ts similarity index 98% rename from types/providers/GoogleAPIProvider.d.ts rename to types/provider/GoogleAPIProvider.d.ts index f972dbf..289a763 100644 --- a/types/providers/GoogleAPIProvider.d.ts +++ b/types/provider/GoogleAPIProvider.d.ts @@ -1,4 +1,4 @@ -import { ExternalLoaderInterface, ExternalLoaderParams } from "../ExternalURILoader"; +import { ExternalLoaderInterface, ExternalLoaderParams } from "../ExternalLoader"; import { GeocodedResultsCallback, ProviderInterface, ProviderOptionsInterface } from "./"; import Geocoded from "../Geocoded"; import { GeocodeQuery, GeocodeQueryObject, ReverseQuery, ReverseQueryObject } from "../query"; diff --git a/types/provider/GoogleAPIProvider.d.ts.map b/types/provider/GoogleAPIProvider.d.ts.map new file mode 100644 index 0000000..aa114c4 --- /dev/null +++ b/types/provider/GoogleAPIProvider.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"GoogleAPIProvider.d.ts","sourceRoot":"","sources":["../../src/provider/GoogleAPIProvider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,oBAAoB,EAAE,0BAAuB;AAC/E,OAAO,EACL,uBAAuB,EAEvB,iBAAiB,EACjB,wBAAwB,EAEzB,WAAiB;AAClB,OAAO,QAAQ,oBAAiB;AAChC,OAAO,EACL,YAAY,EACZ,kBAAkB,EAClB,YAAY,EACZ,kBAAkB,EACnB,iBAAc;AAUf,UAAU,eAAe;IACvB,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE;QACR,QAAQ,EAAE,eAAe,CAAC;QAC1B,MAAM,EAAE;YACN,SAAS,EAAE,eAAe,CAAC;YAC3B,SAAS,EAAE,eAAe,CAAC;SAC5B,CAAC;KACH,CAAC;IAEF,iBAAiB,EAAE,MAAM,CAAC;IAE1B,kBAAkB,EAAE;QAClB,KAAK,EAAE,CACH,eAAe,GACf,OAAO,GACP,aAAa,GACb,UAAU,GACV,aAAa,GACb,6BAA6B,GAC7B,SAAS,CACZ,EAAE,CAAC;QAEJ,SAAS,EAAE,MAAM,CAAC;QAElB,UAAU,EAAE,MAAM,CAAC;KACpB,EAAE,CAAC;CACL;AAED,MAAM,CAAC,OAAO,OAAO,iBAAkB,YAAW,iBAAiB;IACjE,OAAO,CAAC,cAAc,CAA0B;IAEhD,OAAO,CAAC,OAAO,CAA2B;gBAGxC,eAAe,EAAE,uBAAuB,EACxC,OAAO,GAAE,wBAAiD;IAWrD,OAAO,CACZ,KAAK,EAAE,MAAM,GAAG,YAAY,GAAG,kBAAkB,EACjD,QAAQ,EAAE,uBAAuB,GAChC,IAAI;IAkBA,SAAS,CACd,eAAe,EAAE,MAAM,GAAG,MAAM,GAAG,YAAY,GAAG,kBAAkB,EACpE,mBAAmB,EAAE,MAAM,GAAG,MAAM,GAAG,uBAAuB,EAC9D,QAAQ,CAAC,EAAE,uBAAuB,GACjC,IAAI;IA2BA,cAAc,CACnB,MAAM,EAAE,oBAAoB,EAC5B,QAAQ,EAAE,uBAAuB,GAChC,IAAI;WAkBO,aAAa,CAAC,MAAM,EAAE,eAAe,GAAG,QAAQ;CAqE/D"} \ No newline at end of file diff --git a/types/providers/MapquestProvider.d.ts b/types/provider/MapquestProvider.d.ts similarity index 98% rename from types/providers/MapquestProvider.d.ts rename to types/provider/MapquestProvider.d.ts index 946f9c0..41933f8 100644 --- a/types/providers/MapquestProvider.d.ts +++ b/types/provider/MapquestProvider.d.ts @@ -1,4 +1,4 @@ -import { ExternalLoaderInterface, ExternalLoaderParams } from "../ExternalURILoader"; +import { ExternalLoaderInterface, ExternalLoaderParams } from "../ExternalLoader"; import { GeocodedResultsCallback, ProviderInterface, ProviderOptionsInterface } from "./"; import Geocoded from "../Geocoded"; import { GeocodeQuery, GeocodeQueryObject, ReverseQuery, ReverseQueryObject } from "../query"; diff --git a/types/provider/MapquestProvider.d.ts.map b/types/provider/MapquestProvider.d.ts.map new file mode 100644 index 0000000..4c873aa --- /dev/null +++ b/types/provider/MapquestProvider.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"MapquestProvider.d.ts","sourceRoot":"","sources":["../../src/provider/MapquestProvider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,oBAAoB,EAAE,0BAAuB;AAC/E,OAAO,EACL,uBAAuB,EAEvB,iBAAiB,EACjB,wBAAwB,EAEzB,WAAiB;AAClB,OAAO,QAAQ,oBAAiB;AAChC,OAAO,EACL,YAAY,EACZ,kBAAkB,EAClB,YAAY,EACZ,kBAAkB,EACnB,iBAAc;AASf,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE;QACN,GAAG,EAAE,MAAM,CAAC;QACZ,GAAG,EAAE,MAAM,CAAC;KACb,CAAC;IACF,aAAa,EAAE;QACb,GAAG,EAAE,MAAM,CAAC;QACZ,GAAG,EAAE,MAAM,CAAC;KACb,CAAC;IACF,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,OAAO,CAAC;IACnB,cAAc,EAAE,MAAM,CAAC;IACvB,kBAAkB,EAAE,MAAM,CAAC;CAC5B;AAED,MAAM,CAAC,OAAO,OAAO,gBAAiB,YAAW,iBAAiB;IAChE,OAAO,CAAC,cAAc,CAA0B;IAEhD,OAAO,CAAC,OAAO,CAA2B;gBAGxC,eAAe,EAAE,uBAAuB,EACxC,OAAO,GAAE,wBAAiD;IAWrD,OAAO,CACZ,KAAK,EAAE,MAAM,GAAG,YAAY,GAAG,kBAAkB,EACjD,QAAQ,EAAE,uBAAuB,GAChC,IAAI;IAkBA,SAAS,CACd,eAAe,EAAE,MAAM,GAAG,MAAM,GAAG,YAAY,GAAG,kBAAkB,EACpE,mBAAmB,EAAE,MAAM,GAAG,MAAM,GAAG,uBAAuB,EAC9D,QAAQ,CAAC,EAAE,uBAAuB,GACjC,IAAI;IA2BA,cAAc,CACnB,MAAM,EAAE,oBAAoB,EAC5B,QAAQ,EAAE,uBAAuB,GAChC,IAAI;WAUO,aAAa,CAAC,MAAM,EAAE,cAAc,GAAG,QAAQ;CAuB9D"} \ No newline at end of file diff --git a/types/providers/ProviderHelpers.d.ts b/types/provider/ProviderHelpers.d.ts similarity index 100% rename from types/providers/ProviderHelpers.d.ts rename to types/provider/ProviderHelpers.d.ts diff --git a/types/provider/ProviderHelpers.d.ts.map b/types/provider/ProviderHelpers.d.ts.map new file mode 100644 index 0000000..329632d --- /dev/null +++ b/types/provider/ProviderHelpers.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ProviderHelpers.d.ts","sourceRoot":"","sources":["../../src/provider/ProviderHelpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,WAAiB;AACnD,OAAO,EACL,YAAY,EACZ,kBAAkB,EAClB,YAAY,EACZ,kBAAkB,EACnB,iBAAc;AAEf,MAAM,CAAC,OAAO,OAAO,eAAe;WACpB,4BAA4B,CACxC,KAAK,EAAE,MAAM,GAAG,YAAY,GAAG,kBAAkB,EACjD,YAAY,sBAAe,GAC1B,YAAY;WAWD,6BAA6B,CACzC,eAAe,EAAE,MAAM,GAAG,MAAM,GAAG,YAAY,GAAG,kBAAkB,EACpE,mBAAmB,EAAE,MAAM,GAAG,MAAM,GAAG,uBAAuB,EAC9D,YAAY,sBAAe,GAC1B,YAAY;WA2BD,yBAAyB,CACrC,mBAAmB,EAAE,MAAM,GAAG,MAAM,GAAG,uBAAuB,EAC9D,QAAQ,CAAC,EAAE,uBAAuB,GACjC,uBAAuB;CAiB3B"} \ No newline at end of file diff --git a/types/providers/ProviderInterface.d.ts b/types/provider/ProviderInterface.d.ts similarity index 83% rename from types/providers/ProviderInterface.d.ts rename to types/provider/ProviderInterface.d.ts index f9e300f..8de87dc 100644 --- a/types/providers/ProviderInterface.d.ts +++ b/types/provider/ProviderInterface.d.ts @@ -1,4 +1,4 @@ -import { ExternalLoaderHeaders, ExternalLoaderParams } from "../ExternalURILoader"; +import { ErrorCallback, ExternalLoaderHeaders, ExternalLoaderParams } from "../ExternalLoader"; import Geocoded from "../Geocoded"; import { GeocodeQuery, GeocodeQueryObject, ReverseQuery, ReverseQueryObject } from "../query"; export declare const DEFAULT_RESULT_LIMIT = 5; @@ -12,6 +12,6 @@ export declare type GeocodedResultsCallback = (results: Geocoded[]) => void; export default interface ProviderInterface { geocode(query: string | GeocodeQuery | GeocodeQueryObject, callback: GeocodedResultsCallback): void; geodecode(latitudeOrQuery: number | string | ReverseQuery | ReverseQueryObject, longitudeOrCallback: number | string | GeocodedResultsCallback, callback?: GeocodedResultsCallback): void; - executeRequest(params: ExternalLoaderParams, callback: GeocodedResultsCallback, headers?: ExternalLoaderHeaders): void; + executeRequest(params: ExternalLoaderParams, callback: GeocodedResultsCallback, headers?: ExternalLoaderHeaders, errorCallback?: ErrorCallback): void; } //# sourceMappingURL=ProviderInterface.d.ts.map \ No newline at end of file diff --git a/types/provider/ProviderInterface.d.ts.map b/types/provider/ProviderInterface.d.ts.map new file mode 100644 index 0000000..eab79c6 --- /dev/null +++ b/types/provider/ProviderInterface.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ProviderInterface.d.ts","sourceRoot":"","sources":["../../src/provider/ProviderInterface.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EACb,qBAAqB,EACrB,oBAAoB,EACrB,0BAAuB;AACxB,OAAO,QAAQ,oBAAiB;AAChC,OAAO,EACL,YAAY,EACZ,kBAAkB,EAClB,YAAY,EACZ,kBAAkB,EACnB,iBAAc;AAEf,eAAO,MAAM,oBAAoB,IAAI,CAAC;AAEtC,eAAO,MAAM,sBAAsB,EAAE,wBAGpC,CAAC;AAEF,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,oBAAY,uBAAuB,GAAG,CAAC,OAAO,EAAE,QAAQ,EAAE,KAAK,IAAI,CAAC;AAEpE,MAAM,CAAC,OAAO,WAAW,iBAAiB;IACxC,OAAO,CACL,KAAK,EAAE,MAAM,GAAG,YAAY,GAAG,kBAAkB,EACjD,QAAQ,EAAE,uBAAuB,GAChC,IAAI,CAAC;IACR,SAAS,CACP,eAAe,EAAE,MAAM,GAAG,MAAM,GAAG,YAAY,GAAG,kBAAkB,EACpE,mBAAmB,EAAE,MAAM,GAAG,MAAM,GAAG,uBAAuB,EAC9D,QAAQ,CAAC,EAAE,uBAAuB,GACjC,IAAI,CAAC;IACR,cAAc,CACZ,MAAM,EAAE,oBAAoB,EAC5B,QAAQ,EAAE,uBAAuB,EACjC,OAAO,CAAC,EAAE,qBAAqB,EAC/B,aAAa,CAAC,EAAE,aAAa,GAC5B,IAAI,CAAC;CACT"} \ No newline at end of file diff --git a/types/providers/YandexProvider.d.ts b/types/provider/YandexProvider.d.ts similarity index 99% rename from types/providers/YandexProvider.d.ts rename to types/provider/YandexProvider.d.ts index 24b213e..0db4e2c 100644 --- a/types/providers/YandexProvider.d.ts +++ b/types/provider/YandexProvider.d.ts @@ -1,4 +1,4 @@ -import { ExternalLoaderInterface, ExternalLoaderParams } from "../ExternalURILoader"; +import { ExternalLoaderInterface, ExternalLoaderParams } from "../ExternalLoader"; import { GeocodedResultsCallback, ProviderInterface, ProviderOptionsInterface } from "./"; import Geocoded from "../Geocoded"; import { GeocodeQuery, GeocodeQueryObject, ReverseQuery, ReverseQueryObject } from "../query"; diff --git a/types/provider/YandexProvider.d.ts.map b/types/provider/YandexProvider.d.ts.map new file mode 100644 index 0000000..b3755c7 --- /dev/null +++ b/types/provider/YandexProvider.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"YandexProvider.d.ts","sourceRoot":"","sources":["../../src/provider/YandexProvider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,oBAAoB,EAAE,0BAAuB;AAC/E,OAAO,EACL,uBAAuB,EAEvB,iBAAiB,EACjB,wBAAwB,EAEzB,WAAiB;AAClB,OAAO,QAAQ,oBAAiB;AAChC,OAAO,EACL,YAAY,EACZ,kBAAkB,EAClB,YAAY,EACZ,kBAAkB,EACnB,iBAAc;AAgBf,MAAM,WAAW,YAAY;IAC3B,gBAAgB,EAAE;QAChB,gBAAgB,EAAE;YAChB,IAAI,EAAE,MAAM,CAAC;YACb,IAAI,EAAE,MAAM,CAAC;YACb,SAAS,EAAE,MAAM,CAAC;YAClB,cAAc,EAAE;gBACd,OAAO,EAAE;oBACP,WAAW,EAAE,MAAM,CAAC;oBACpB,eAAe,EAAE,MAAM,CAAC;oBACxB,WAAW,EAAE,MAAM,CAAC;oBACpB,kBAAkB,CAAC,EAAE;wBACnB,sBAAsB,EAAE,MAAM,CAAC;wBAC/B,qBAAqB,CAAC,EAAE;4BACtB,yBAAyB,EAAE,MAAM,CAAC;4BAClC,QAAQ,CAAC,EAAE;gCACT,YAAY,EAAE,MAAM,CAAC;gCACrB,YAAY,CAAC,EAAE;oCACb,gBAAgB,EAAE,MAAM,CAAC;oCACzB,OAAO,EAAE;wCACP,aAAa,EAAE,MAAM,CAAC;qCACvB,CAAC;iCACH,CAAC;6BACH,CAAC;yBACH,CAAC;qBACH,CAAC;iBACH,CAAC;aACH,CAAC;SACH,CAAC;KACH,CAAC;IACF,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE;QACT,QAAQ,EAAE;YACR,WAAW,EAAE,MAAM,CAAC;YACpB,WAAW,EAAE,MAAM,CAAC;SACrB,CAAC;KACH,CAAC;IACF,KAAK,EAAE;QACL,GAAG,EAAE,MAAM,CAAC;KACb,CAAC;CACH;AAYD,MAAM,WAAW,8BACf,SAAQ,wBAAwB;IAChC,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,GAAG,UAAU,GAAG,UAAU,CAAC;CAC3E;AAED,MAAM,CAAC,OAAO,OAAO,cAAe,YAAW,iBAAiB;IAC9D,OAAO,CAAC,cAAc,CAA0B;IAEhD,OAAO,CAAC,OAAO,CAAiC;gBAG9C,eAAe,EAAE,uBAAuB,EACxC,OAAO,GAAE,8BAAuD;IAM3D,OAAO,CACZ,KAAK,EAAE,MAAM,GAAG,YAAY,GAAG,kBAAkB,EACjD,QAAQ,EAAE,uBAAuB,GAChC,IAAI;IAoBA,SAAS,CACd,eAAe,EAAE,MAAM,GAAG,MAAM,GAAG,YAAY,GAAG,kBAAkB,EACpE,mBAAmB,EAAE,MAAM,GAAG,MAAM,GAAG,uBAAuB,EAC9D,QAAQ,CAAC,EAAE,uBAAuB,GACjC,IAAI;IA8BA,cAAc,CACnB,MAAM,EAAE,oBAAoB,EAC5B,QAAQ,EAAE,uBAAuB,GAChC,IAAI;WAWO,aAAa,CAAC,MAAM,EAAE,YAAY,GAAG,QAAQ;IAyC3D,OAAO,CAAC,MAAM,CAAC,aAAa;CA+B7B"} \ No newline at end of file diff --git a/types/providers/index.d.ts b/types/provider/index.d.ts similarity index 95% rename from types/providers/index.d.ts rename to types/provider/index.d.ts index 32c79c8..60b9e9b 100644 --- a/types/providers/index.d.ts +++ b/types/provider/index.d.ts @@ -9,6 +9,7 @@ export * from "./mapbox"; export { default as MapquestProvider } from "./MapquestProvider"; export * from "./MapquestProvider"; export * from "./nominatim"; +export * from "./opencage"; export { default as YandexProvider } from "./YandexProvider"; export * from "./YandexProvider"; //# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/types/provider/index.d.ts.map b/types/provider/index.d.ts.map new file mode 100644 index 0000000..47dd7a3 --- /dev/null +++ b/types/provider/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/provider/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAciH,mBAAmB,CAdnG;AACtE,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAakI,qBAAqB,CAbpH;AAC1E,cAYyK,qBAAqB,CAZnJ;AAC3C,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAW4J,gBAAgB,CAX9I;AAChE,cAU8L,gBAAgB,CAVxK;AACtC,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MASuK,qBAAqB,CATzJ;AAC1E,cAQ8M,qBAAqB,CARxL;AAC3C,cAOmO,UAAU,CAP7M;AAChC,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAMuM,oBAAoB,CANzL;AACxE,cAK6O,oBAAoB,CALvN;AAC1C,cAIiQ,aAAa,CAJ3O;AACnC,cAG8Q,YAAY,CAHxP;AAClC,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAEsP,kBAAkB,CAFxO;AACpE,cAC0R,kBAAkB,CADpQ"} \ No newline at end of file diff --git a/types/providers/mapbox/MapboxGeocodeQuery.d.ts b/types/provider/mapbox/MapboxGeocodeQuery.d.ts similarity index 53% rename from types/providers/mapbox/MapboxGeocodeQuery.d.ts rename to types/provider/mapbox/MapboxGeocodeQuery.d.ts index 034f5fa..81ece1c 100644 --- a/types/providers/mapbox/MapboxGeocodeQuery.d.ts +++ b/types/provider/mapbox/MapboxGeocodeQuery.d.ts @@ -1,12 +1,20 @@ import { GeocodeQuery, GeocodeQueryObject } from "../../query"; export interface MapboxGeocodeQueryObject extends GeocodeQueryObject { + readonly countryCodes?: string[]; + readonly proximity?: Coordinates; readonly locationTypes?: string[]; } export default class MapboxGeocodeQuery extends GeocodeQuery { + private readonly countryCodes?; + private readonly proximity?; private readonly locationTypes?; - protected constructor({ locationTypes, ...geocodeQueryObject }: MapboxGeocodeQueryObject); + protected constructor({ countryCodes, proximity, locationTypes, ...geocodeQueryObject }: MapboxGeocodeQueryObject); static create(object: MapboxGeocodeQueryObject): MapboxGeocodeQuery; toObject(): MapboxGeocodeQueryObject; + withCountryCodes(countryCodes: string[]): MapboxGeocodeQuery; + getCountryCodes(): undefined | string[]; + withProximity(proximity: Coordinates): MapboxGeocodeQuery; + getProximity(): undefined | Coordinates; withLocationTypes(locationTypes: string[]): MapboxGeocodeQuery; getLocationTypes(): undefined | string[]; } diff --git a/types/provider/mapbox/MapboxGeocodeQuery.d.ts.map b/types/provider/mapbox/MapboxGeocodeQuery.d.ts.map new file mode 100644 index 0000000..878c441 --- /dev/null +++ b/types/provider/mapbox/MapboxGeocodeQuery.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"MapboxGeocodeQuery.d.ts","sourceRoot":"","sources":["../../../src/provider/mapbox/MapboxGeocodeQuery.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,oBAAc;AAEzD,MAAM,WAAW,wBAAyB,SAAQ,kBAAkB;IAClE,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACjC,QAAQ,CAAC,SAAS,CAAC,EAAE,WAAW,CAAC;IACjC,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;CACnC;AAED,MAAM,CAAC,OAAO,OAAO,kBAAmB,SAAQ,YAAY;IAC1D,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAW;IAEzC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAc;IAEzC,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAW;IAE1C,SAAS,aAAa,EACpB,YAAY,EACZ,SAAS,EACT,aAAa,EACb,GAAG,kBAAkB,EACtB,EAAE,wBAAwB;WAOb,MAAM,CAAC,MAAM,EAAE,wBAAwB,GAAG,kBAAkB;IAInE,QAAQ,IAAI,wBAAwB;IASpC,gBAAgB,CAAC,YAAY,EAAE,MAAM,EAAE,GAAG,kBAAkB;IAI5D,eAAe,IAAI,SAAS,GAAG,MAAM,EAAE;IAIvC,aAAa,CAAC,SAAS,EAAE,WAAW,GAAG,kBAAkB;IAIzD,YAAY,IAAI,SAAS,GAAG,WAAW;IAIvC,iBAAiB,CAAC,aAAa,EAAE,MAAM,EAAE,GAAG,kBAAkB;IAI9D,gBAAgB,IAAI,SAAS,GAAG,MAAM,EAAE;CAGhD"} \ No newline at end of file diff --git a/types/provider/mapbox/MapboxGeocoded.d.ts b/types/provider/mapbox/MapboxGeocoded.d.ts new file mode 100644 index 0000000..581a798 --- /dev/null +++ b/types/provider/mapbox/MapboxGeocoded.d.ts @@ -0,0 +1,13 @@ +import Geocoded, { GeocodedObject } from "../../Geocoded"; +export interface MapboxGeocodedObject extends GeocodedObject { + readonly resultType?: string[]; +} +export default class MapboxGeocoded extends Geocoded { + private readonly resultType?; + protected constructor({ resultType, ...geocodedObject }: MapboxGeocodedObject); + static create(object: MapboxGeocodedObject): MapboxGeocoded; + toObject(): MapboxGeocodedObject; + withResultType(resultType: string[]): MapboxGeocoded; + getResultType(): undefined | string[]; +} +//# sourceMappingURL=MapboxGeocoded.d.ts.map \ No newline at end of file diff --git a/types/provider/mapbox/MapboxGeocoded.d.ts.map b/types/provider/mapbox/MapboxGeocoded.d.ts.map new file mode 100644 index 0000000..307d672 --- /dev/null +++ b/types/provider/mapbox/MapboxGeocoded.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"MapboxGeocoded.d.ts","sourceRoot":"","sources":["../../../src/provider/mapbox/MapboxGeocoded.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,EAAE,EAAE,cAAc,EAAE,uBAAiB;AAEpD,MAAM,WAAW,oBAAqB,SAAQ,cAAc;IAC1D,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;CAChC;AAED,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,QAAQ;IAClD,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAW;IAEvC,SAAS,aAAa,EACpB,UAAU,EACV,GAAG,cAAc,EAClB,EAAE,oBAAoB;WAKT,MAAM,CAAC,MAAM,EAAE,oBAAoB,GAAG,cAAc;IAI3D,QAAQ,IAAI,oBAAoB;IAOhC,cAAc,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,cAAc;IAOpD,aAAa,IAAI,SAAS,GAAG,MAAM,EAAE;CAG7C"} \ No newline at end of file diff --git a/types/providers/mapbox/MapboxProvider.d.ts b/types/provider/mapbox/MapboxProvider.d.ts similarity index 86% rename from types/providers/mapbox/MapboxProvider.d.ts rename to types/provider/mapbox/MapboxProvider.d.ts index 641ee00..e591a74 100644 --- a/types/providers/mapbox/MapboxProvider.d.ts +++ b/types/provider/mapbox/MapboxProvider.d.ts @@ -1,6 +1,5 @@ -import { ExternalLoaderInterface, ExternalLoaderParams } from "../../ExternalURILoader"; -import { GeocodedResultsCallback, MapboxGeocodeQuery, MapboxGeocodeQueryObject, MapboxReverseQuery, MapboxReverseQueryObject, ProviderInterface, ProviderOptionsInterface } from "./.."; -import Geocoded from "../../Geocoded"; +import { ExternalLoaderInterface, ExternalLoaderParams } from "../../ExternalLoader"; +import { GeocodedResultsCallback, MapboxGeocoded, MapboxGeocodeQuery, MapboxGeocodeQueryObject, MapboxReverseQuery, MapboxReverseQueryObject, ProviderInterface, ProviderOptionsInterface } from "./.."; import { Box } from "../../types"; interface MapboxFeatureContextProperties { id: string; @@ -48,7 +47,7 @@ export declare enum MAPBOX_GEOCODING_MODES { export interface MapboxProviderOptionsInterface extends ProviderOptionsInterface { readonly apiKey: string; readonly geocodingMode?: MAPBOX_GEOCODING_MODES; - readonly country?: string; + readonly countryCodes?: string[]; } export declare const defaultMapboxProviderOptions: { apiKey: string; @@ -62,8 +61,9 @@ export default class MapboxProvider implements ProviderInterface { constructor(_externalLoader: ExternalLoaderInterface, options?: MapboxProviderOptionsInterface); geocode(query: string | MapboxGeocodeQuery | MapboxGeocodeQueryObject, callback: GeocodedResultsCallback): void; geodecode(latitudeOrQuery: number | string | MapboxReverseQuery | MapboxReverseQueryObject, longitudeOrCallback: number | string | GeocodedResultsCallback, callback?: GeocodedResultsCallback): void; + private getCommonParams; executeRequest(params: ExternalLoaderParams, callback: GeocodedResultsCallback): void; - static mapToGeocoded(result: MapboxResult): Geocoded; + static mapToGeocoded(result: MapboxResult): MapboxGeocoded; } export {}; //# sourceMappingURL=MapboxProvider.d.ts.map \ No newline at end of file diff --git a/types/provider/mapbox/MapboxProvider.d.ts.map b/types/provider/mapbox/MapboxProvider.d.ts.map new file mode 100644 index 0000000..21f05f0 --- /dev/null +++ b/types/provider/mapbox/MapboxProvider.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"MapboxProvider.d.ts","sourceRoot":"","sources":["../../../src/provider/mapbox/MapboxProvider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,oBAAoB,EAAE,6BAAuB;AAC/E,OAAO,EACL,uBAAuB,EACvB,cAAc,EACd,kBAAkB,EAClB,wBAAwB,EACxB,kBAAkB,EAClB,wBAAwB,EAExB,iBAAiB,EACjB,wBAAwB,EAEzB,aAAiB;AAClB,OAAO,EAAE,GAAG,EAAE,oBAAc;AAuB5B,UAAU,8BAA8B;IACtC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,UAAU,uBAAuB;IAC/B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,SAAS,CAAC;IAEhB,UAAU,EAAE,CACR,SAAS,GACT,QAAQ,GACR,UAAU,GACV,UAAU,GACV,OAAO,GACP,UAAU,GACV,cAAc,GACd,SAAS,GACT,KAAK,CACR,EAAE,CAAC;IACJ,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,uBAAuB,CAAC;IACpC,IAAI,EAAE,MAAM,CAAC;IAEb,UAAU,EAAE,MAAM,CAAC;IAEnB,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,GAAG,CAAC;IACX,MAAM,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACzB,QAAQ,EAAE;QACR,IAAI,EAAE,OAAO,CAAC;QACd,WAAW,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;KAC/B,CAAC;IACF,OAAO,CAAC,EAAE,8BAA8B,EAAE,CAAC;IAE3C,eAAe,CAAC,EAAE;QAChB,MAAM,CAAC,EAAE;YACP,WAAW,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;SAC/B,EAAE,CAAC;KACL,CAAC;CACH;AAED,oBAAY,sBAAsB;IAChC,qBAAqB,kBAAkB;IACvC,+BAA+B,4BAA4B;CAC5D;AAED,MAAM,WAAW,8BACf,SAAQ,wBAAwB;IAChC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,aAAa,CAAC,EAAE,sBAAsB,CAAC;IAChD,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;CAClC;AAED,eAAO,MAAM,4BAA4B;;;;;CAIxC,CAAC;AAEF,MAAM,CAAC,OAAO,OAAO,cAAe,YAAW,iBAAiB;IAC9D,OAAO,CAAC,cAAc,CAA0B;IAEhD,OAAO,CAAC,OAAO,CAAiC;gBAG9C,eAAe,EAAE,uBAAuB,EACxC,OAAO,GAAE,8BAA6D;IAWjE,OAAO,CACZ,KAAK,EAAE,MAAM,GAAG,kBAAkB,GAAG,wBAAwB,EAC7D,QAAQ,EAAE,uBAAuB,GAChC,IAAI;IAsCA,SAAS,CACd,eAAe,EACX,MAAM,GACN,MAAM,GACN,kBAAkB,GAClB,wBAAwB,EAC5B,mBAAmB,EAAE,MAAM,GAAG,MAAM,GAAG,uBAAuB,EAC9D,QAAQ,CAAC,EAAE,uBAAuB,GACjC,IAAI;IAkCP,OAAO,CAAC,eAAe;IAkBhB,cAAc,CACnB,MAAM,EAAE,oBAAoB,EAC5B,QAAQ,EAAE,uBAAuB,GAChC,IAAI;WAUO,aAAa,CAAC,MAAM,EAAE,YAAY,GAAG,cAAc;CAkFlE"} \ No newline at end of file diff --git a/types/provider/mapbox/MapboxReverseQuery.d.ts b/types/provider/mapbox/MapboxReverseQuery.d.ts new file mode 100644 index 0000000..db61756 --- /dev/null +++ b/types/provider/mapbox/MapboxReverseQuery.d.ts @@ -0,0 +1,23 @@ +import { ReverseQuery, ReverseQueryObject } from "../../query"; +declare type ReverseMode = "distance" | "score"; +export interface MapboxReverseQueryObject extends ReverseQueryObject { + readonly countryCodes?: string[]; + readonly reverseMode?: ReverseMode; + readonly locationTypes?: string[]; +} +export default class MapboxReverseQuery extends ReverseQuery { + private readonly countryCodes?; + private readonly reverseMode?; + private readonly locationTypes?; + protected constructor({ countryCodes, reverseMode, locationTypes, ...reverseQueryObject }: MapboxReverseQueryObject); + static create(object: MapboxReverseQueryObject): MapboxReverseQuery; + toObject(): MapboxReverseQueryObject; + withCountryCodes(countryCodes: string[]): MapboxReverseQuery; + getCountryCodes(): undefined | string[]; + withReverseMode(reverseMode: ReverseMode): MapboxReverseQuery; + getReverseMode(): undefined | ReverseMode; + withLocationTypes(locationTypes: string[]): MapboxReverseQuery; + getLocationTypes(): undefined | string[]; +} +export {}; +//# sourceMappingURL=MapboxReverseQuery.d.ts.map \ No newline at end of file diff --git a/types/provider/mapbox/MapboxReverseQuery.d.ts.map b/types/provider/mapbox/MapboxReverseQuery.d.ts.map new file mode 100644 index 0000000..e9f31af --- /dev/null +++ b/types/provider/mapbox/MapboxReverseQuery.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"MapboxReverseQuery.d.ts","sourceRoot":"","sources":["../../../src/provider/mapbox/MapboxReverseQuery.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,oBAAc;AAEzD,aAAK,WAAW,GAAG,UAAU,GAAG,OAAO,CAAC;AAExC,MAAM,WAAW,wBAAyB,SAAQ,kBAAkB;IAClE,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACjC,QAAQ,CAAC,WAAW,CAAC,EAAE,WAAW,CAAC;IACnC,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;CACnC;AAED,MAAM,CAAC,OAAO,OAAO,kBAAmB,SAAQ,YAAY;IAC1D,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAW;IAEzC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAc;IAE3C,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAW;IAE1C,SAAS,aAAa,EACpB,YAAY,EACZ,WAAW,EACX,aAAa,EACb,GAAG,kBAAkB,EACtB,EAAE,wBAAwB;WAOb,MAAM,CAAC,MAAM,EAAE,wBAAwB,GAAG,kBAAkB;IAInE,QAAQ,IAAI,wBAAwB;IASpC,gBAAgB,CAAC,YAAY,EAAE,MAAM,EAAE,GAAG,kBAAkB;IAI5D,eAAe,IAAI,SAAS,GAAG,MAAM,EAAE;IAIvC,eAAe,CAAC,WAAW,EAAE,WAAW,GAAG,kBAAkB;IAI7D,cAAc,IAAI,SAAS,GAAG,WAAW;IAIzC,iBAAiB,CAAC,aAAa,EAAE,MAAM,EAAE,GAAG,kBAAkB;IAI9D,gBAAgB,IAAI,SAAS,GAAG,MAAM,EAAE;CAGhD"} \ No newline at end of file diff --git a/types/providers/mapbox/index.d.ts b/types/provider/mapbox/index.d.ts similarity index 84% rename from types/providers/mapbox/index.d.ts rename to types/provider/mapbox/index.d.ts index 20215dd..ecf1827 100644 --- a/types/providers/mapbox/index.d.ts +++ b/types/provider/mapbox/index.d.ts @@ -1,3 +1,4 @@ +export { default as MapboxGeocoded } from "./MapboxGeocoded"; export { default as MapboxGeocodeQuery } from "./MapboxGeocodeQuery"; export * from "./MapboxGeocodeQuery"; export { default as MapboxProvider } from "./MapboxProvider"; diff --git a/types/provider/mapbox/index.d.ts.map b/types/provider/mapbox/index.d.ts.map new file mode 100644 index 0000000..2991fb5 --- /dev/null +++ b/types/provider/mapbox/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/provider/mapbox/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAO4C,kBAAkB,CAPvB;AAC3E,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAM0D,sBAAsB,CANrC;AACnF,cAKkG,sBAAsB,CALrE;AACnD,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAIoF,kBAAkB,CAJ/D;AAC3E,cAGwH,kBAAkB,CAH3F;AAC/C,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAEkG,sBAAsB,CAF7E;AACnF,cAC0I,sBAAsB,CAD7G"} \ No newline at end of file diff --git a/types/providers/nominatim/NominatimGeocodeQuery.d.ts b/types/provider/nominatim/NominatimGeocodeQuery.d.ts similarity index 100% rename from types/providers/nominatim/NominatimGeocodeQuery.d.ts rename to types/provider/nominatim/NominatimGeocodeQuery.d.ts diff --git a/types/provider/nominatim/NominatimGeocodeQuery.d.ts.map b/types/provider/nominatim/NominatimGeocodeQuery.d.ts.map new file mode 100644 index 0000000..c910f21 --- /dev/null +++ b/types/provider/nominatim/NominatimGeocodeQuery.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"NominatimGeocodeQuery.d.ts","sourceRoot":"","sources":["../../../src/provider/nominatim/NominatimGeocodeQuery.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,oBAAc;AACzD,OAAO,EAAE,GAAG,EAAE,oBAAc;AAE5B,MAAM,WAAW,2BAA4B,SAAQ,kBAAkB;IACrE,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACjC,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;IACpC,QAAQ,CAAC,OAAO,CAAC,EAAE,GAAG,CAAC;IACvB,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED,MAAM,CAAC,OAAO,OAAO,qBAAsB,SAAQ,YAAY;IAC7D,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAW;IAEzC,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAW;IAE5C,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAM;IAE/B,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAU;IAEnC,SAAS,aAAa,EACpB,YAAY,EACZ,eAAe,EACf,OAAO,EACP,OAAO,EACP,GAAG,kBAAkB,EACtB,EAAE,2BAA2B;WAgBhB,MAAM,CAClB,MAAM,EAAE,2BAA2B,GAClC,qBAAqB;IAIjB,QAAQ,IAAI,2BAA2B;IAUvC,gBAAgB,CAAC,YAAY,EAAE,MAAM,EAAE,GAAG,qBAAqB;IAI/D,eAAe,IAAI,SAAS,GAAG,MAAM,EAAE;IAIvC,mBAAmB,CAAC,eAAe,EAAE,MAAM,EAAE,GAAG,qBAAqB;IAIrE,kBAAkB,IAAI,SAAS,GAAG,MAAM,EAAE;IAI1C,WAAW,CAAC,OAAO,EAAE,GAAG,GAAG,qBAAqB;IAIhD,UAAU,IAAI,SAAS,GAAG,GAAG;IAI7B,WAAW,CAAC,OAAO,EAAE,OAAO,GAAG,qBAAqB;IAIpD,UAAU,IAAI,SAAS,GAAG,OAAO;CAGzC"} \ No newline at end of file diff --git a/types/providers/nominatim/NominatimGeocoded.d.ts b/types/provider/nominatim/NominatimGeocoded.d.ts similarity index 100% rename from types/providers/nominatim/NominatimGeocoded.d.ts rename to types/provider/nominatim/NominatimGeocoded.d.ts diff --git a/types/provider/nominatim/NominatimGeocoded.d.ts.map b/types/provider/nominatim/NominatimGeocoded.d.ts.map new file mode 100644 index 0000000..85c0b2f --- /dev/null +++ b/types/provider/nominatim/NominatimGeocoded.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"NominatimGeocoded.d.ts","sourceRoot":"","sources":["../../../src/provider/nominatim/NominatimGeocoded.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,EAAE,EAAE,cAAc,EAAE,uBAAiB;AAEpD,MAAM,WAAW,uBAAwB,SAAQ,cAAc;IAC7D,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;CAC/B;AAED,MAAM,CAAC,OAAO,OAAO,iBAAkB,SAAQ,QAAQ;IACrD,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAS;IAEtC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAS;IAEhC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAS;IAElC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAS;IAEnC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAS;IAE/B,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAS;IAEtC,SAAS,aAAa,EACpB,WAAW,EACX,KAAK,EACL,OAAO,EACP,QAAQ,EACR,IAAI,EACJ,WAAW,EACX,GAAG,cAAc,EAClB,EAAE,uBAAuB;WAUZ,MAAM,CAAC,MAAM,EAAE,uBAAuB,GAAG,iBAAiB;IAIjE,QAAQ,IAAI,uBAAuB;IAYnC,eAAe,CAAC,WAAW,EAAE,MAAM,GAAG,iBAAiB;IAOvD,cAAc,IAAI,SAAS,GAAG,MAAM;IAIpC,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,iBAAiB;IAO3C,QAAQ,IAAI,SAAS,GAAG,MAAM;IAI9B,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,iBAAiB;IAO/C,UAAU,IAAI,SAAS,GAAG,MAAM;IAIhC,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,iBAAiB;IAOjD,WAAW,IAAI,SAAS,GAAG,MAAM;IAIjC,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,iBAAiB;IAOzC,OAAO,IAAI,SAAS,GAAG,MAAM;IAI7B,eAAe,CAAC,WAAW,EAAE,MAAM,GAAG,iBAAiB;IAOvD,cAAc,IAAI,SAAS,GAAG,MAAM;CAG5C"} \ No newline at end of file diff --git a/types/providers/nominatim/NominatimProvider.d.ts b/types/provider/nominatim/NominatimProvider.d.ts similarity index 97% rename from types/providers/nominatim/NominatimProvider.d.ts rename to types/provider/nominatim/NominatimProvider.d.ts index 73bae29..943751b 100644 --- a/types/providers/nominatim/NominatimProvider.d.ts +++ b/types/provider/nominatim/NominatimProvider.d.ts @@ -1,4 +1,4 @@ -import { ExternalLoaderHeaders, ExternalLoaderInterface, ExternalLoaderParams } from "../../ExternalURILoader"; +import { ExternalLoaderHeaders, ExternalLoaderInterface, ExternalLoaderParams } from "../../ExternalLoader"; import { GeocodedResultsCallback, NominatimGeocoded, NominatimReverseQuery, NominatimReverseQueryObject, NominatimGeocodeQueryObject, NominatimGeocodeQuery, ProviderInterface, ProviderOptionsInterface } from "./.."; export interface NominatimResult { place_id: number; diff --git a/types/provider/nominatim/NominatimProvider.d.ts.map b/types/provider/nominatim/NominatimProvider.d.ts.map new file mode 100644 index 0000000..82c8112 --- /dev/null +++ b/types/provider/nominatim/NominatimProvider.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"NominatimProvider.d.ts","sourceRoot":"","sources":["../../../src/provider/nominatim/NominatimProvider.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EACrB,uBAAuB,EACvB,oBAAoB,EACrB,6BAAuB;AACxB,OAAO,EACL,uBAAuB,EACvB,iBAAiB,EACjB,qBAAqB,EACrB,2BAA2B,EAC3B,2BAA2B,EAC3B,qBAAqB,EAErB,iBAAiB,EACjB,wBAAwB,EAEzB,aAAiB;AAsBlB,MAAM,WAAW,eAAe;IAE9B,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAEhB,QAAQ,EAAE,MAAM,CAAC;IAEjB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IAC9C,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IAEZ,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE;QACP,UAAU,CAAC,EAAE,MAAM,CAAC;QAEpB,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,OAAO,CAAC,EAAE,MAAM,CAAC;QAEjB,YAAY,CAAC,EAAE,MAAM,CAAC;KACvB,CAAC;CACH;AAED,MAAM,WAAW,iCACf,SAAQ,wBAAwB;IAChC,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,eAAO,MAAM,+BAA+B;;;;;;CAI3C,CAAC;AAEF,MAAM,CAAC,OAAO,OAAO,iBAAkB,YAAW,iBAAiB;IACjE,OAAO,CAAC,cAAc,CAA0B;IAEhD,OAAO,CAAC,OAAO,CAAoC;gBAGjD,eAAe,EAAE,uBAAuB,EACxC,OAAO,GAAE,iCAAmE;IAcvE,OAAO,CACZ,KAAK,EAAE,MAAM,GAAG,qBAAqB,GAAG,2BAA2B,EACnE,QAAQ,EAAE,uBAAuB,GAChC,IAAI;IAuCA,SAAS,CACd,eAAe,EACX,MAAM,GACN,MAAM,GACN,qBAAqB,GACrB,2BAA2B,EAC/B,mBAAmB,EAAE,MAAM,GAAG,MAAM,GAAG,uBAAuB,EAC9D,QAAQ,CAAC,EAAE,uBAAuB,GACjC,IAAI;IA8BP,OAAO,CAAC,eAAe;IAavB,OAAO,CAAC,UAAU;IAOX,cAAc,CACnB,MAAM,EAAE,oBAAoB,EAC5B,QAAQ,EAAE,uBAAuB,EACjC,OAAO,CAAC,EAAE,qBAAqB,GAC9B,IAAI;WAcO,aAAa,CAAC,MAAM,EAAE,eAAe,GAAG,iBAAiB;CA0ExE"} \ No newline at end of file diff --git a/types/providers/nominatim/NominatimReverseQuery.d.ts b/types/provider/nominatim/NominatimReverseQuery.d.ts similarity index 100% rename from types/providers/nominatim/NominatimReverseQuery.d.ts rename to types/provider/nominatim/NominatimReverseQuery.d.ts diff --git a/types/provider/nominatim/NominatimReverseQuery.d.ts.map b/types/provider/nominatim/NominatimReverseQuery.d.ts.map new file mode 100644 index 0000000..ad4729b --- /dev/null +++ b/types/provider/nominatim/NominatimReverseQuery.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"NominatimReverseQuery.d.ts","sourceRoot":"","sources":["../../../src/provider/nominatim/NominatimReverseQuery.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,oBAAc;AAEzD,MAAM,WAAW,2BAA4B,SAAQ,kBAAkB;IACrE,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,CAAC,OAAO,OAAO,qBAAsB,SAAQ,YAAY;IAC7D,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAS;IAE/B,SAAS,aAAa,EACpB,IAAI,EACJ,GAAG,kBAAkB,EACtB,EAAE,2BAA2B;WAKhB,MAAM,CAClB,MAAM,EAAE,2BAA2B,GAClC,qBAAqB;IAIjB,QAAQ,IAAI,2BAA2B;IAOvC,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,qBAAqB;IAI7C,OAAO,IAAI,SAAS,GAAG,MAAM;CAGrC"} \ No newline at end of file diff --git a/types/providers/nominatim/index.d.ts b/types/provider/nominatim/index.d.ts similarity index 100% rename from types/providers/nominatim/index.d.ts rename to types/provider/nominatim/index.d.ts diff --git a/types/provider/nominatim/index.d.ts.map b/types/provider/nominatim/index.d.ts.map new file mode 100644 index 0000000..6d26359 --- /dev/null +++ b/types/provider/nominatim/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/provider/nominatim/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAoBqD,qBAAqB,CApB7B;AACpF,OAAO,EAAE,OAAO,IAAI,qBAAqB,EAAE,MAmBiD,qBAAqB,CAnBzB;AACxF,cAkB4F,qBAAqB,CAlB5D;AACrD,OAAO,EAAE,uBAAuB,IAAI,2BAA2B,EAAE,MAiB2B,qBAAqB,CAjBH;AAC9G,OAAO,EAAE,OAAO,IAAI,qBAAqB,EAAE,MAgBsE,yBAAyB,CAhB9C;AAC5F,OAAO,EAAE,OAAO,IAAI,yBAAyB,EAAE,MAekE,yBAAyB,CAf1C;AAChG,cAciH,yBAAyB,CAdjF;AACzD,OAAO,EAAE,2BAA2B,IAAI,+BAA+B,EAAE,MAawC,yBAAyB,CAbhB;AAC1H,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAYmG,qBAAqB,CAZ3E;AACpF,OAAO,EAAE,OAAO,IAAI,qBAAqB,EAAE,MAW+F,qBAAqB,CAXvE;AACxF,cAU0I,qBAAqB,CAV1G;AACrD,OAAO,EACL,iCAAiC,IAAI,qCAAqC,EAC1E,eAAe,IAAI,mBAAmB,EACtC,+BAA+B,IAAI,mCAAmC,GACvE,MAKyI,qBAAqB,CALjH;AAC9C,OAAO,EAAE,OAAO,IAAI,qBAAqB,EAAE,MAIoH,yBAAyB,CAJ5F;AAC5F,OAAO,EAAE,OAAO,IAAI,yBAAyB,EAAE,MAGgH,yBAAyB,CAHxF;AAChG,cAE+J,yBAAyB,CAF/H;AACzD,OAAO,EAAE,2BAA2B,IAAI,+BAA+B,EAAE,MACsF,yBAAyB,CAD9D"} \ No newline at end of file diff --git a/types/provider/opencage/OpenCageGeocodeQuery.d.ts b/types/provider/opencage/OpenCageGeocodeQuery.d.ts new file mode 100644 index 0000000..0824d14 --- /dev/null +++ b/types/provider/opencage/OpenCageGeocodeQuery.d.ts @@ -0,0 +1,26 @@ +import { GeocodeQuery, GeocodeQueryObject } from "../../query"; +import { Coordinates } from "../../index"; +export interface OpenCageGeocodeQueryObject extends GeocodeQueryObject { + readonly countryCodes?: string[]; + readonly proximity?: Coordinates; + readonly minConfidence?: number; + readonly noRecord?: boolean; +} +export default class OpenCageGeocodeQuery extends GeocodeQuery { + private readonly countryCodes?; + private readonly proximity?; + private readonly minConfidence?; + private readonly noRecord?; + protected constructor({ countryCodes, proximity, minConfidence, noRecord, ...geocodeQueryObject }: OpenCageGeocodeQueryObject); + static create(object: OpenCageGeocodeQueryObject): OpenCageGeocodeQuery; + toObject(): OpenCageGeocodeQueryObject; + withCountryCodes(countryCodes: string[]): OpenCageGeocodeQuery; + getCountryCodes(): undefined | string[]; + withProximity(proximity: Coordinates): OpenCageGeocodeQuery; + getProximity(): undefined | Coordinates; + withMinConfidence(minConfidence: number): OpenCageGeocodeQuery; + getMinConfidence(): undefined | number; + withNoRecord(noRecord: boolean): OpenCageGeocodeQuery; + getNoRecord(): undefined | boolean; +} +//# sourceMappingURL=OpenCageGeocodeQuery.d.ts.map \ No newline at end of file diff --git a/types/provider/opencage/OpenCageGeocodeQuery.d.ts.map b/types/provider/opencage/OpenCageGeocodeQuery.d.ts.map new file mode 100644 index 0000000..36c6cf0 --- /dev/null +++ b/types/provider/opencage/OpenCageGeocodeQuery.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"OpenCageGeocodeQuery.d.ts","sourceRoot":"","sources":["../../../src/provider/opencage/OpenCageGeocodeQuery.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,oBAAc;AACzD,OAAO,EAAE,WAAW,EAAE,oBAAc;AAEpC,MAAM,WAAW,0BAA2B,SAAQ,kBAAkB;IACpE,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACjC,QAAQ,CAAC,SAAS,CAAC,EAAE,WAAW,CAAC;IACjC,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED,MAAM,CAAC,OAAO,OAAO,oBAAqB,SAAQ,YAAY;IAC5D,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAW;IAEzC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAc;IAEzC,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAS;IAExC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAU;IAEpC,SAAS,aAAa,EACpB,YAAY,EACZ,SAAS,EACT,aAAa,EACb,QAAQ,EACR,GAAG,kBAAkB,EACtB,EAAE,0BAA0B;WAmBf,MAAM,CAClB,MAAM,EAAE,0BAA0B,GACjC,oBAAoB;IAIhB,QAAQ,IAAI,0BAA0B;IAUtC,gBAAgB,CAAC,YAAY,EAAE,MAAM,EAAE,GAAG,oBAAoB;IAI9D,eAAe,IAAI,SAAS,GAAG,MAAM,EAAE;IAIvC,aAAa,CAAC,SAAS,EAAE,WAAW,GAAG,oBAAoB;IAI3D,YAAY,IAAI,SAAS,GAAG,WAAW;IAIvC,iBAAiB,CAAC,aAAa,EAAE,MAAM,GAAG,oBAAoB;IAI9D,gBAAgB,IAAI,SAAS,GAAG,MAAM;IAItC,YAAY,CAAC,QAAQ,EAAE,OAAO,GAAG,oBAAoB;IAIrD,WAAW,IAAI,SAAS,GAAG,OAAO;CAG1C"} \ No newline at end of file diff --git a/types/provider/opencage/OpenCageGeocoded.d.ts b/types/provider/opencage/OpenCageGeocoded.d.ts new file mode 100644 index 0000000..be9139a --- /dev/null +++ b/types/provider/opencage/OpenCageGeocoded.d.ts @@ -0,0 +1,33 @@ +import Geocoded, { GeocodedObject } from "../../Geocoded"; +export interface OpenCageGeocodedObject extends GeocodedObject { + readonly callingCode?: number; + readonly flag?: string; + readonly mgrs?: string; + readonly maidenhead?: string; + readonly geohash?: string; + readonly what3words?: string; +} +export default class OpenCageGeocoded extends Geocoded { + private readonly callingCode?; + private readonly flag?; + private readonly mgrs?; + private readonly maidenhead?; + private readonly geohash?; + private readonly what3words?; + protected constructor({ callingCode, flag, mgrs, maidenhead, geohash, what3words, ...geocodedObject }: OpenCageGeocodedObject); + static create(object: OpenCageGeocodedObject): OpenCageGeocoded; + toObject(): OpenCageGeocodedObject; + withCallingCode(callingCode: number): OpenCageGeocoded; + getCallingCode(): undefined | number; + withFlag(flag: string): OpenCageGeocoded; + getFlag(): undefined | string; + withMgrs(mgrs: string): OpenCageGeocoded; + getMgrs(): undefined | string; + withMaidenhead(maidenhead: string): OpenCageGeocoded; + getMaidenhead(): undefined | string; + withGeohash(geohash: string): OpenCageGeocoded; + getGeohash(): undefined | string; + withWhat3words(what3words: string): OpenCageGeocoded; + getWhat3words(): undefined | string; +} +//# sourceMappingURL=OpenCageGeocoded.d.ts.map \ No newline at end of file diff --git a/types/provider/opencage/OpenCageGeocoded.d.ts.map b/types/provider/opencage/OpenCageGeocoded.d.ts.map new file mode 100644 index 0000000..b7aaebb --- /dev/null +++ b/types/provider/opencage/OpenCageGeocoded.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"OpenCageGeocoded.d.ts","sourceRoot":"","sources":["../../../src/provider/opencage/OpenCageGeocoded.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,EAAE,EAAE,cAAc,EAAE,uBAAiB;AAEpD,MAAM,WAAW,sBAAuB,SAAQ,cAAc;IAC5D,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED,MAAM,CAAC,OAAO,OAAO,gBAAiB,SAAQ,QAAQ;IACpD,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAS;IAEtC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAS;IAE/B,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAS;IAE/B,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAS;IAErC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAS;IAElC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAS;IAErC,SAAS,aAAa,EACpB,WAAW,EACX,IAAI,EACJ,IAAI,EACJ,UAAU,EACV,OAAO,EACP,UAAU,EACV,GAAG,cAAc,EAClB,EAAE,sBAAsB;WAUX,MAAM,CAAC,MAAM,EAAE,sBAAsB,GAAG,gBAAgB;IAI/D,QAAQ,IAAI,sBAAsB;IAYlC,eAAe,CAAC,WAAW,EAAE,MAAM,GAAG,gBAAgB;IAOtD,cAAc,IAAI,SAAS,GAAG,MAAM;IAIpC,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,gBAAgB;IAOxC,OAAO,IAAI,SAAS,GAAG,MAAM;IAI7B,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,gBAAgB;IAOxC,OAAO,IAAI,SAAS,GAAG,MAAM;IAI7B,cAAc,CAAC,UAAU,EAAE,MAAM,GAAG,gBAAgB;IAOpD,aAAa,IAAI,SAAS,GAAG,MAAM;IAInC,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,gBAAgB;IAO9C,UAAU,IAAI,SAAS,GAAG,MAAM;IAIhC,cAAc,CAAC,UAAU,EAAE,MAAM,GAAG,gBAAgB;IAOpD,aAAa,IAAI,SAAS,GAAG,MAAM;CAG3C"} \ No newline at end of file diff --git a/types/provider/opencage/OpenCageProvider.d.ts b/types/provider/opencage/OpenCageProvider.d.ts new file mode 100644 index 0000000..7074d6b --- /dev/null +++ b/types/provider/opencage/OpenCageProvider.d.ts @@ -0,0 +1,157 @@ +import { ExternalLoaderInterface, ExternalLoaderParams } from "../../ExternalLoader"; +import { GeocodedResultsCallback, OpenCageGeocoded, OpenCageGeocodeQuery, OpenCageGeocodeQueryObject, OpenCageReverseQuery, OpenCageReverseQueryObject, ProviderInterface, ProviderOptionsInterface } from "./.."; +interface OpenCageCoordinates { + lat: number; + lng: number; +} +interface OpenCageSun { + apparent: number; + astronomical: number; + civil: number; + nautical: number; +} +export interface OpenCageResult { + annotations: { + callingcode: number; + currency: { + alternate_symbols: string[]; + decimal_mark: string; + disambiguate_symbol?: string; + html_entity: string; + iso_code: string; + iso_numeric: string; + name: string; + smallest_denomination: number; + subunit: string; + subunit_to_unit: number; + symbol: string; + symbol_first: number; + thousands_separator: string; + }; + DMS: { + lat: string; + lng: string; + }; + FIPS?: { + state?: string; + county?: string; + }; + flag: string; + geohash?: string; + ITM?: { + easting: string; + northing: string; + }; + Maidenhead?: string; + Mercator: { + x: number; + y: number; + }; + MGRS?: string; + OSM: { + edit_url?: string; + note_url: string; + url: string; + }; + qibla: number; + roadinfo: { + drive_on: "left" | "right"; + road?: string; + road_type?: string; + road_reference?: string; + road_reference_intl?: string; + speed_in: "km/h" | "mph"; + }; + sun: { + rise: OpenCageSun; + set: OpenCageSun; + }; + timezone: { + name: string; + now_in_dst: number; + offset_sec: number; + offset_string: string; + short_name: string; + }; + UN_M49: { + regions: { + [region: string]: string; + }; + statistical_groupings: ("LDC" | "LEDC" | "LLDC" | "MEDC" | "SIDS")[]; + }; + what3words?: { + words: string; + }; + wikidata?: string; + }; + bounds: { + northeast: OpenCageCoordinates; + southwest: OpenCageCoordinates; + }; + components: { + "ISO_3166-1_alpha-2"?: string; + "ISO_3166-1_alpha-3"?: string; + _category: "agriculture" | "building" | "castle" | "commerce" | "construction" | "education" | "financial" | "government" | "health" | "industrial" | "military" | "natural/water" | "outdoors/recreation" | "place" | "place_of_worship" | "postcode" | "road" | "social" | "transportation" | "travel/tourism" | "unknown"; + _type: string; + castle?: string; + city?: string; + city_district?: string; + continent?: "Africa" | "Antarctica" | "Asia" | "Europe" | "Oceania" | "North America" | "South America"; + country?: string; + country_code?: string; + county?: string; + county_code?: string; + croft?: string; + district?: string; + footway?: string; + hamlet?: string; + house_number?: string; + houses?: string; + locality?: string; + municipality?: string; + neighbourhood?: string; + path?: string; + pedestrian?: string; + political_union?: string; + postcode?: string; + quarter?: string; + residential?: string; + road?: string; + road_reference?: string; + road_reference_intl?: string; + road_type?: string; + state?: string; + state_code?: string; + state_district?: string; + street?: string; + street_name?: string; + subdivision?: string; + suburb?: string; + town?: string; + village?: string; + }; + confidence: number; + formatted: string; + geometry: OpenCageCoordinates; +} +export interface OpenCageProviderOptionsInterface extends ProviderOptionsInterface { + readonly apiKey: string; + readonly countryCodes?: string[]; +} +export declare const defaultOpenCageProviderOptions: { + apiKey: string; + useSsl?: boolean | undefined; + useJsonp?: boolean | undefined; +}; +export default class OpenCageProvider implements ProviderInterface { + private externalLoader; + private options; + constructor(_externalLoader: ExternalLoaderInterface, options?: OpenCageProviderOptionsInterface); + geocode(query: string | OpenCageGeocodeQuery | OpenCageGeocodeQueryObject, callback: GeocodedResultsCallback): void; + geodecode(latitudeOrQuery: number | string | OpenCageReverseQuery | OpenCageReverseQueryObject, longitudeOrCallback: number | string | GeocodedResultsCallback, callback?: GeocodedResultsCallback): void; + private getCommonParams; + executeRequest(params: ExternalLoaderParams, callback: GeocodedResultsCallback): void; + static mapToGeocoded(result: OpenCageResult): OpenCageGeocoded; +} +export {}; +//# sourceMappingURL=OpenCageProvider.d.ts.map \ No newline at end of file diff --git a/types/provider/opencage/OpenCageProvider.d.ts.map b/types/provider/opencage/OpenCageProvider.d.ts.map new file mode 100644 index 0000000..e154ca8 --- /dev/null +++ b/types/provider/opencage/OpenCageProvider.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"OpenCageProvider.d.ts","sourceRoot":"","sources":["../../../src/provider/opencage/OpenCageProvider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,oBAAoB,EAAE,6BAAuB;AAC/E,OAAO,EACL,uBAAuB,EACvB,gBAAgB,EAChB,oBAAoB,EACpB,0BAA0B,EAC1B,oBAAoB,EACpB,0BAA0B,EAE1B,iBAAiB,EACjB,wBAAwB,EAEzB,aAAiB;AAmBlB,UAAU,mBAAmB;IAC3B,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;CACb;AAED,UAAU,WAAW;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;CAClB;AAkCD,MAAM,WAAW,cAAc;IAC7B,WAAW,EAAE;QACX,WAAW,EAAE,MAAM,CAAC;QACpB,QAAQ,EAAE;YAER,iBAAiB,EAAE,MAAM,EAAE,CAAC;YAE5B,YAAY,EAAE,MAAM,CAAC;YAErB,mBAAmB,CAAC,EAAE,MAAM,CAAC;YAE7B,WAAW,EAAE,MAAM,CAAC;YAEpB,QAAQ,EAAE,MAAM,CAAC;YAEjB,WAAW,EAAE,MAAM,CAAC;YACpB,IAAI,EAAE,MAAM,CAAC;YAEb,qBAAqB,EAAE,MAAM,CAAC;YAC9B,OAAO,EAAE,MAAM,CAAC;YAEhB,eAAe,EAAE,MAAM,CAAC;YACxB,MAAM,EAAE,MAAM,CAAC;YAEf,YAAY,EAAE,MAAM,CAAC;YAErB,mBAAmB,EAAE,MAAM,CAAC;SAC7B,CAAC;QACF,GAAG,EAAE;YACH,GAAG,EAAE,MAAM,CAAC;YACZ,GAAG,EAAE,MAAM,CAAC;SACb,CAAC;QACF,IAAI,CAAC,EAAE;YACL,KAAK,CAAC,EAAE,MAAM,CAAC;YACf,MAAM,CAAC,EAAE,MAAM,CAAC;SACjB,CAAC;QACF,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,GAAG,CAAC,EAAE;YACJ,OAAO,EAAE,MAAM,CAAC;YAChB,QAAQ,EAAE,MAAM,CAAC;SAClB,CAAC;QACF,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,QAAQ,EAAE;YACR,CAAC,EAAE,MAAM,CAAC;YACV,CAAC,EAAE,MAAM,CAAC;SACX,CAAC;QACF,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,GAAG,EAAE;YAEH,QAAQ,CAAC,EAAE,MAAM,CAAC;YAElB,QAAQ,EAAE,MAAM,CAAC;YACjB,GAAG,EAAE,MAAM,CAAC;SACb,CAAC;QACF,KAAK,EAAE,MAAM,CAAC;QACd,QAAQ,EAAE;YAER,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;YAC3B,IAAI,CAAC,EAAE,MAAM,CAAC;YAEd,SAAS,CAAC,EAAE,MAAM,CAAC;YAEnB,cAAc,CAAC,EAAE,MAAM,CAAC;YAExB,mBAAmB,CAAC,EAAE,MAAM,CAAC;YAE7B,QAAQ,EAAE,MAAM,GAAG,KAAK,CAAC;SAC1B,CAAC;QACF,GAAG,EAAE;YACH,IAAI,EAAE,WAAW,CAAC;YAClB,GAAG,EAAE,WAAW,CAAC;SAClB,CAAC;QACF,QAAQ,EAAE;YACR,IAAI,EAAE,MAAM,CAAC;YAEb,UAAU,EAAE,MAAM,CAAC;YAEnB,UAAU,EAAE,MAAM,CAAC;YAEnB,aAAa,EAAE,MAAM,CAAC;YAEtB,UAAU,EAAE,MAAM,CAAC;SACpB,CAAC;QAEF,MAAM,EAAE;YACN,OAAO,EAAE;gBACP,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC;aAC1B,CAAC;YAEF,qBAAqB,EAAE,CAAC,KAAK,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC,EAAE,CAAC;SACtE,CAAC;QACF,UAAU,CAAC,EAAE;YACX,KAAK,EAAE,MAAM,CAAC;SACf,CAAC;QACF,QAAQ,CAAC,EAAE,MAAM,CAAC;KACnB,CAAC;IACF,MAAM,EAAE;QACN,SAAS,EAAE,mBAAmB,CAAC;QAC/B,SAAS,EAAE,mBAAmB,CAAC;KAChC,CAAC;IACF,UAAU,EAAE;QACV,oBAAoB,CAAC,EAAE,MAAM,CAAC;QAC9B,oBAAoB,CAAC,EAAE,MAAM,CAAC;QAC9B,SAAS,EACL,aAAa,GACb,UAAU,GACV,QAAQ,GACR,UAAU,GACV,cAAc,GACd,WAAW,GACX,WAAW,GACX,YAAY,GACZ,QAAQ,GACR,YAAY,GACZ,UAAU,GACV,eAAe,GACf,qBAAqB,GACrB,OAAO,GACP,kBAAkB,GAClB,UAAU,GACV,MAAM,GACN,QAAQ,GACR,gBAAgB,GAChB,gBAAgB,GAChB,SAAS,CAAC;QACd,KAAK,EAAE,MAAM,CAAC;QACd,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,IAAI,CAAC,EAAE,MAAM,CAAC;QAEd,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB,SAAS,CAAC,EACN,QAAQ,GACR,YAAY,GACZ,MAAM,GACN,QAAQ,GACR,SAAS,GACT,eAAe,GACf,eAAe,CAAC;QACpB,OAAO,CAAC,EAAE,MAAM,CAAC;QAEjB,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,MAAM,CAAC,EAAE,MAAM,CAAC;QAEhB,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,MAAM,CAAC,EAAE,MAAM,CAAC;QAEhB,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,UAAU,CAAC,EAAE,MAAM,CAAC;QAEpB,eAAe,CAAC,EAAE,MAAM,CAAC;QACzB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,IAAI,CAAC,EAAE,MAAM,CAAC;QAEd,cAAc,CAAC,EAAE,MAAM,CAAC;QAExB,mBAAmB,CAAC,EAAE,MAAM,CAAC;QAE7B,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,KAAK,CAAC,EAAE,MAAM,CAAC;QAEf,UAAU,CAAC,EAAE,MAAM,CAAC;QAEpB,cAAc,CAAC,EAAE,MAAM,CAAC;QACxB,MAAM,CAAC,EAAE,MAAM,CAAC;QAEhB,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,CAAC;IACF,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,mBAAmB,CAAC;CAC/B;AAED,MAAM,WAAW,gCACf,SAAQ,wBAAwB;IAChC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;CAClC;AAED,eAAO,MAAM,8BAA8B;;;;CAG1C,CAAC;AAEF,MAAM,CAAC,OAAO,OAAO,gBAAiB,YAAW,iBAAiB;IAChE,OAAO,CAAC,cAAc,CAA0B;IAEhD,OAAO,CAAC,OAAO,CAAmC;gBAGhD,eAAe,EAAE,uBAAuB,EACxC,OAAO,GAAE,gCAAiE;IAWrE,OAAO,CACZ,KAAK,EAAE,MAAM,GAAG,oBAAoB,GAAG,0BAA0B,EACjE,QAAQ,EAAE,uBAAuB,GAChC,IAAI;IAkCA,SAAS,CACd,eAAe,EACX,MAAM,GACN,MAAM,GACN,oBAAoB,GACpB,0BAA0B,EAC9B,mBAAmB,EAAE,MAAM,GAAG,MAAM,GAAG,uBAAuB,EAC9D,QAAQ,CAAC,EAAE,uBAAuB,GACjC,IAAI;IA6BP,OAAO,CAAC,eAAe;IAkBhB,cAAc,CACnB,MAAM,EAAE,oBAAoB,EAC5B,QAAQ,EAAE,uBAAuB,GAChC,IAAI;WAiEO,aAAa,CAAC,MAAM,EAAE,cAAc,GAAG,gBAAgB;CAmGtE"} \ No newline at end of file diff --git a/types/provider/opencage/OpenCageReverseQuery.d.ts b/types/provider/opencage/OpenCageReverseQuery.d.ts new file mode 100644 index 0000000..2358d54 --- /dev/null +++ b/types/provider/opencage/OpenCageReverseQuery.d.ts @@ -0,0 +1,21 @@ +import { ReverseQuery, ReverseQueryObject } from "../../query"; +export interface OpenCageReverseQueryObject extends ReverseQueryObject { + readonly countryCodes?: string[]; + readonly minConfidence?: number; + readonly noRecord?: boolean; +} +export default class OpenCageReverseQuery extends ReverseQuery { + private readonly countryCodes?; + private readonly minConfidence?; + private readonly noRecord?; + protected constructor({ countryCodes, minConfidence, noRecord, ...reverseQueryObject }: OpenCageReverseQueryObject); + static create(object: OpenCageReverseQueryObject): OpenCageReverseQuery; + toObject(): OpenCageReverseQueryObject; + withCountryCodes(countryCodes: string[]): OpenCageReverseQuery; + getCountryCodes(): undefined | string[]; + withMinConfidence(minConfidence: number): OpenCageReverseQuery; + getMinConfidence(): undefined | number; + withNoRecord(noRecord: boolean): OpenCageReverseQuery; + getNoRecord(): undefined | boolean; +} +//# sourceMappingURL=OpenCageReverseQuery.d.ts.map \ No newline at end of file diff --git a/types/provider/opencage/OpenCageReverseQuery.d.ts.map b/types/provider/opencage/OpenCageReverseQuery.d.ts.map new file mode 100644 index 0000000..708dcb3 --- /dev/null +++ b/types/provider/opencage/OpenCageReverseQuery.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"OpenCageReverseQuery.d.ts","sourceRoot":"","sources":["../../../src/provider/opencage/OpenCageReverseQuery.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,oBAAc;AAEzD,MAAM,WAAW,0BAA2B,SAAQ,kBAAkB;IACpE,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACjC,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED,MAAM,CAAC,OAAO,OAAO,oBAAqB,SAAQ,YAAY;IAC5D,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAW;IAEzC,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAS;IAExC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAU;IAEpC,SAAS,aAAa,EACpB,YAAY,EACZ,aAAa,EACb,QAAQ,EACR,GAAG,kBAAkB,EACtB,EAAE,0BAA0B;WAkBf,MAAM,CAClB,MAAM,EAAE,0BAA0B,GACjC,oBAAoB;IAIhB,QAAQ,IAAI,0BAA0B;IAStC,gBAAgB,CAAC,YAAY,EAAE,MAAM,EAAE,GAAG,oBAAoB;IAI9D,eAAe,IAAI,SAAS,GAAG,MAAM,EAAE;IAIvC,iBAAiB,CAAC,aAAa,EAAE,MAAM,GAAG,oBAAoB;IAI9D,gBAAgB,IAAI,SAAS,GAAG,MAAM;IAItC,YAAY,CAAC,QAAQ,EAAE,OAAO,GAAG,oBAAoB;IAIrD,WAAW,IAAI,SAAS,GAAG,OAAO;CAG1C"} \ No newline at end of file diff --git a/types/provider/opencage/index.d.ts b/types/provider/opencage/index.d.ts new file mode 100644 index 0000000..c1ba98e --- /dev/null +++ b/types/provider/opencage/index.d.ts @@ -0,0 +1,8 @@ +export { default as OpenCageGeocoded } from "./OpenCageGeocoded"; +export { default as OpenCageGeocodeQuery } from "./OpenCageGeocodeQuery"; +export * from "./OpenCageGeocodeQuery"; +export { default as OpenCageProvider } from "./OpenCageProvider"; +export * from "./OpenCageProvider"; +export { default as OpenCageReverseQuery } from "./OpenCageReverseQuery"; +export * from "./OpenCageReverseQuery"; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/types/provider/opencage/index.d.ts.map b/types/provider/opencage/index.d.ts.map new file mode 100644 index 0000000..ee51336 --- /dev/null +++ b/types/provider/opencage/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/provider/opencage/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAOkD,oBAAoB,CAP3B;AACjF,OAAO,EAAE,OAAO,IAAI,oBAAoB,EAAE,MAMkE,wBAAwB,CAN3C;AACzF,cAK4G,wBAAwB,CAL7E;AACvD,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAI8F,oBAAoB,CAJvE;AACjF,cAGoI,oBAAoB,CAHrG;AACnD,OAAO,EAAE,OAAO,IAAI,oBAAoB,EAAE,MAE8G,wBAAwB,CAFvF;AACzF,cACwJ,wBAAwB,CADzH"} \ No newline at end of file diff --git a/types/providers/BingProvider.d.ts.map b/types/providers/BingProvider.d.ts.map deleted file mode 100644 index 1316d9a..0000000 --- a/types/providers/BingProvider.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"BingProvider.d.ts","sourceRoot":"","sources":["../../src/providers/BingProvider.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EACvB,oBAAoB,EACrB,6BAA0B;AAC3B,OAAO,EACL,uBAAuB,EAEvB,iBAAiB,EACjB,wBAAwB,EAEzB,WAAkB;AACnB,OAAO,QAAQ,oBAAiB;AAChC,OAAO,EACL,YAAY,EACZ,kBAAkB,EAClB,YAAY,EACZ,kBAAkB,EACnB,iBAAc;AACf,OAAO,EAAE,GAAG,EAAE,iBAAc;AAQ5B,MAAM,WAAW,UAAU;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,GAAG,CAAC;IACV,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE;QACL,IAAI,EAAE,MAAM,CAAC;QACb,WAAW,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;KAC/B,CAAC;IACF,OAAO,EAAE;QACP,WAAW,EAAE,MAAM,CAAC;QACpB,aAAa,EAAE,MAAM,CAAC;QACtB,cAAc,EAAE,MAAM,CAAC;QACvB,aAAa,EAAE,MAAM,CAAC;QACtB,gBAAgB,EAAE,MAAM,CAAC;QACzB,QAAQ,EAAE,MAAM,CAAC;QACjB,UAAU,EAAE,MAAM,CAAC;KACpB,CAAC;IACF,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE;QACb,IAAI,EAAE,MAAM,CAAC;QACb,WAAW,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QAC9B,iBAAiB,EAAE,MAAM,CAAC;QAC1B,UAAU,EAAE,MAAM,EAAE,CAAC;KACtB,EAAE,CAAC;IACJ,UAAU,EAAE,MAAM,EAAE,CAAC;CACtB;AAED,MAAM,CAAC,OAAO,OAAO,YAAa,YAAW,iBAAiB;IAC5D,OAAO,CAAC,cAAc,CAA0B;IAEhD,OAAO,CAAC,OAAO,CAA2B;gBAGxC,eAAe,EAAE,uBAAuB,EACxC,OAAO,GAAE,wBAAiD;IAWrD,OAAO,CACZ,KAAK,EAAE,MAAM,GAAG,YAAY,GAAG,kBAAkB,EACjD,QAAQ,EAAE,uBAAuB,GAChC,IAAI;IAiBA,SAAS,CACd,eAAe,EAAE,MAAM,GAAG,MAAM,GAAG,YAAY,GAAG,kBAAkB,EACpE,mBAAmB,EAAE,MAAM,GAAG,MAAM,GAAG,uBAAuB,EAC9D,QAAQ,CAAC,EAAE,uBAAuB,GACjC,IAAI;IA0BA,cAAc,CACnB,MAAM,EAAE,oBAAoB,EAC5B,QAAQ,EAAE,uBAAuB,GAChC,IAAI;WAUO,aAAa,CAAC,MAAM,EAAE,UAAU,GAAG,QAAQ;CA4B1D"} \ No newline at end of file diff --git a/types/providers/GoogleAPIProvider.d.ts.map b/types/providers/GoogleAPIProvider.d.ts.map deleted file mode 100644 index 69e3be3..0000000 --- a/types/providers/GoogleAPIProvider.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"GoogleAPIProvider.d.ts","sourceRoot":"","sources":["../../src/providers/GoogleAPIProvider.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EACvB,oBAAoB,EACrB,6BAA0B;AAC3B,OAAO,EACL,uBAAuB,EAEvB,iBAAiB,EACjB,wBAAwB,EAEzB,WAAkB;AACnB,OAAO,QAAQ,oBAAiB;AAChC,OAAO,EACL,YAAY,EACZ,kBAAkB,EAClB,YAAY,EACZ,kBAAkB,EACnB,iBAAc;AAUf,UAAU,eAAe;IACvB,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE;QACR,QAAQ,EAAE,eAAe,CAAC;QAC1B,MAAM,EAAE;YACN,SAAS,EAAE,eAAe,CAAC;YAC3B,SAAS,EAAE,eAAe,CAAC;SAC5B,CAAC;KACH,CAAC;IAEF,iBAAiB,EAAE,MAAM,CAAC;IAE1B,kBAAkB,EAAE;QAClB,KAAK,EAAE,CACH,eAAe,GACf,OAAO,GACP,aAAa,GACb,UAAU,GACV,aAAa,GACb,6BAA6B,GAC7B,SAAS,CACZ,EAAE,CAAC;QAEJ,SAAS,EAAE,MAAM,CAAC;QAElB,UAAU,EAAE,MAAM,CAAC;KACpB,EAAE,CAAC;CACL;AAED,MAAM,CAAC,OAAO,OAAO,iBAAkB,YAAW,iBAAiB;IACjE,OAAO,CAAC,cAAc,CAA0B;IAEhD,OAAO,CAAC,OAAO,CAA2B;gBAGxC,eAAe,EAAE,uBAAuB,EACxC,OAAO,GAAE,wBAAiD;IAWrD,OAAO,CACZ,KAAK,EAAE,MAAM,GAAG,YAAY,GAAG,kBAAkB,EACjD,QAAQ,EAAE,uBAAuB,GAChC,IAAI;IAkBA,SAAS,CACd,eAAe,EAAE,MAAM,GAAG,MAAM,GAAG,YAAY,GAAG,kBAAkB,EACpE,mBAAmB,EAAE,MAAM,GAAG,MAAM,GAAG,uBAAuB,EAC9D,QAAQ,CAAC,EAAE,uBAAuB,GACjC,IAAI;IA2BA,cAAc,CACnB,MAAM,EAAE,oBAAoB,EAC5B,QAAQ,EAAE,uBAAuB,GAChC,IAAI;WAkBO,aAAa,CAAC,MAAM,EAAE,eAAe,GAAG,QAAQ;CAqE/D"} \ No newline at end of file diff --git a/types/providers/MapquestProvider.d.ts.map b/types/providers/MapquestProvider.d.ts.map deleted file mode 100644 index 4c088f9..0000000 --- a/types/providers/MapquestProvider.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"MapquestProvider.d.ts","sourceRoot":"","sources":["../../src/providers/MapquestProvider.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EACvB,oBAAoB,EACrB,6BAA0B;AAC3B,OAAO,EACL,uBAAuB,EAEvB,iBAAiB,EACjB,wBAAwB,EAEzB,WAAkB;AACnB,OAAO,QAAQ,oBAAiB;AAChC,OAAO,EACL,YAAY,EACZ,kBAAkB,EAClB,YAAY,EACZ,kBAAkB,EACnB,iBAAc;AASf,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE;QACN,GAAG,EAAE,MAAM,CAAC;QACZ,GAAG,EAAE,MAAM,CAAC;KACb,CAAC;IACF,aAAa,EAAE;QACb,GAAG,EAAE,MAAM,CAAC;QACZ,GAAG,EAAE,MAAM,CAAC;KACb,CAAC;IACF,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,OAAO,CAAC;IACnB,cAAc,EAAE,MAAM,CAAC;IACvB,kBAAkB,EAAE,MAAM,CAAC;CAC5B;AAED,MAAM,CAAC,OAAO,OAAO,gBAAiB,YAAW,iBAAiB;IAChE,OAAO,CAAC,cAAc,CAA0B;IAEhD,OAAO,CAAC,OAAO,CAA2B;gBAGxC,eAAe,EAAE,uBAAuB,EACxC,OAAO,GAAE,wBAAiD;IAWrD,OAAO,CACZ,KAAK,EAAE,MAAM,GAAG,YAAY,GAAG,kBAAkB,EACjD,QAAQ,EAAE,uBAAuB,GAChC,IAAI;IAkBA,SAAS,CACd,eAAe,EAAE,MAAM,GAAG,MAAM,GAAG,YAAY,GAAG,kBAAkB,EACpE,mBAAmB,EAAE,MAAM,GAAG,MAAM,GAAG,uBAAuB,EAC9D,QAAQ,CAAC,EAAE,uBAAuB,GACjC,IAAI;IA2BA,cAAc,CACnB,MAAM,EAAE,oBAAoB,EAC5B,QAAQ,EAAE,uBAAuB,GAChC,IAAI;WAUO,aAAa,CAAC,MAAM,EAAE,cAAc,GAAG,QAAQ;CAuB9D"} \ No newline at end of file diff --git a/types/providers/ProviderHelpers.d.ts.map b/types/providers/ProviderHelpers.d.ts.map deleted file mode 100644 index 2f403e5..0000000 --- a/types/providers/ProviderHelpers.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ProviderHelpers.d.ts","sourceRoot":"","sources":["../../src/providers/ProviderHelpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,WAAkB;AACpD,OAAO,EACL,YAAY,EACZ,kBAAkB,EAClB,YAAY,EACZ,kBAAkB,EACnB,iBAAc;AAEf,MAAM,CAAC,OAAO,OAAO,eAAe;WACpB,4BAA4B,CACxC,KAAK,EAAE,MAAM,GAAG,YAAY,GAAG,kBAAkB,EACjD,YAAY,sBAAe,GAC1B,YAAY;WAWD,6BAA6B,CACzC,eAAe,EAAE,MAAM,GAAG,MAAM,GAAG,YAAY,GAAG,kBAAkB,EACpE,mBAAmB,EAAE,MAAM,GAAG,MAAM,GAAG,uBAAuB,EAC9D,YAAY,sBAAe,GAC1B,YAAY;WA2BD,yBAAyB,CACrC,mBAAmB,EAAE,MAAM,GAAG,MAAM,GAAG,uBAAuB,EAC9D,QAAQ,CAAC,EAAE,uBAAuB,GACjC,uBAAuB;CAiB3B"} \ No newline at end of file diff --git a/types/providers/ProviderInterface.d.ts.map b/types/providers/ProviderInterface.d.ts.map deleted file mode 100644 index 09fcb66..0000000 --- a/types/providers/ProviderInterface.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ProviderInterface.d.ts","sourceRoot":"","sources":["../../src/providers/ProviderInterface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,6BAA0B;AAChF,OAAO,QAAQ,oBAAiB;AAChC,OAAO,EACL,YAAY,EACZ,kBAAkB,EAClB,YAAY,EACZ,kBAAkB,EACnB,iBAAc;AAEf,eAAO,MAAM,oBAAoB,IAAI,CAAC;AAEtC,eAAO,MAAM,sBAAsB,EAAE,wBAGpC,CAAC;AAEF,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,oBAAY,uBAAuB,GAAG,CAAC,OAAO,EAAE,QAAQ,EAAE,KAAK,IAAI,CAAC;AAEpE,MAAM,CAAC,OAAO,WAAW,iBAAiB;IACxC,OAAO,CACL,KAAK,EAAE,MAAM,GAAG,YAAY,GAAG,kBAAkB,EACjD,QAAQ,EAAE,uBAAuB,GAChC,IAAI,CAAC;IACR,SAAS,CACP,eAAe,EAAE,MAAM,GAAG,MAAM,GAAG,YAAY,GAAG,kBAAkB,EACpE,mBAAmB,EAAE,MAAM,GAAG,MAAM,GAAG,uBAAuB,EAC9D,QAAQ,CAAC,EAAE,uBAAuB,GACjC,IAAI,CAAC;IACR,cAAc,CACZ,MAAM,EAAE,oBAAoB,EAC5B,QAAQ,EAAE,uBAAuB,EACjC,OAAO,CAAC,EAAE,qBAAqB,GAC9B,IAAI,CAAC;CACT"} \ No newline at end of file diff --git a/types/providers/YandexProvider.d.ts.map b/types/providers/YandexProvider.d.ts.map deleted file mode 100644 index c02028f..0000000 --- a/types/providers/YandexProvider.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"YandexProvider.d.ts","sourceRoot":"","sources":["../../src/providers/YandexProvider.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EACvB,oBAAoB,EACrB,6BAA0B;AAC3B,OAAO,EACL,uBAAuB,EAEvB,iBAAiB,EACjB,wBAAwB,EAEzB,WAAkB;AACnB,OAAO,QAAQ,oBAAiB;AAChC,OAAO,EACL,YAAY,EACZ,kBAAkB,EAClB,YAAY,EACZ,kBAAkB,EACnB,iBAAc;AAgBf,MAAM,WAAW,YAAY;IAC3B,gBAAgB,EAAE;QAChB,gBAAgB,EAAE;YAChB,IAAI,EAAE,MAAM,CAAC;YACb,IAAI,EAAE,MAAM,CAAC;YACb,SAAS,EAAE,MAAM,CAAC;YAClB,cAAc,EAAE;gBACd,OAAO,EAAE;oBACP,WAAW,EAAE,MAAM,CAAC;oBACpB,eAAe,EAAE,MAAM,CAAC;oBACxB,WAAW,EAAE,MAAM,CAAC;oBACpB,kBAAkB,CAAC,EAAE;wBACnB,sBAAsB,EAAE,MAAM,CAAC;wBAC/B,qBAAqB,CAAC,EAAE;4BACtB,yBAAyB,EAAE,MAAM,CAAC;4BAClC,QAAQ,CAAC,EAAE;gCACT,YAAY,EAAE,MAAM,CAAC;gCACrB,YAAY,CAAC,EAAE;oCACb,gBAAgB,EAAE,MAAM,CAAC;oCACzB,OAAO,EAAE;wCACP,aAAa,EAAE,MAAM,CAAC;qCACvB,CAAC;iCACH,CAAC;6BACH,CAAC;yBACH,CAAC;qBACH,CAAC;iBACH,CAAC;aACH,CAAC;SACH,CAAC;KACH,CAAC;IACF,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE;QACT,QAAQ,EAAE;YACR,WAAW,EAAE,MAAM,CAAC;YACpB,WAAW,EAAE,MAAM,CAAC;SACrB,CAAC;KACH,CAAC;IACF,KAAK,EAAE;QACL,GAAG,EAAE,MAAM,CAAC;KACb,CAAC;CACH;AAYD,MAAM,WAAW,8BACf,SAAQ,wBAAwB;IAChC,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,GAAG,UAAU,GAAG,UAAU,CAAC;CAC3E;AAED,MAAM,CAAC,OAAO,OAAO,cAAe,YAAW,iBAAiB;IAC9D,OAAO,CAAC,cAAc,CAA0B;IAEhD,OAAO,CAAC,OAAO,CAAiC;gBAG9C,eAAe,EAAE,uBAAuB,EACxC,OAAO,GAAE,8BAAuD;IAM3D,OAAO,CACZ,KAAK,EAAE,MAAM,GAAG,YAAY,GAAG,kBAAkB,EACjD,QAAQ,EAAE,uBAAuB,GAChC,IAAI;IAoBA,SAAS,CACd,eAAe,EAAE,MAAM,GAAG,MAAM,GAAG,YAAY,GAAG,kBAAkB,EACpE,mBAAmB,EAAE,MAAM,GAAG,MAAM,GAAG,uBAAuB,EAC9D,QAAQ,CAAC,EAAE,uBAAuB,GACjC,IAAI;IA8BA,cAAc,CACnB,MAAM,EAAE,oBAAoB,EAC5B,QAAQ,EAAE,uBAAuB,GAChC,IAAI;WAWO,aAAa,CAAC,MAAM,EAAE,YAAY,GAAG,QAAQ;IAyC3D,OAAO,CAAC,MAAM,CAAC,aAAa;CA+B7B"} \ No newline at end of file diff --git a/types/providers/index.d.ts.map b/types/providers/index.d.ts.map deleted file mode 100644 index 6854104..0000000 --- a/types/providers/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/providers/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAaqG,mBAAmB,CAbtF;AACvE,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAYsH,qBAAqB,CAZvG;AAC3E,cAW6J,qBAAqB,CAXtI;AAC5C,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAUgJ,gBAAgB,CAVjI;AACjE,cASkL,gBAAgB,CAT3J;AACvC,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAQ2J,qBAAqB,CAR5I;AAC3E,cAOkM,qBAAqB,CAP3K;AAC5C,cAMuN,UAAU,CANhM;AACjC,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAK2L,oBAAoB,CAL5K;AACzE,cAIiO,oBAAoB,CAJ1M;AAC3C,cAGqP,aAAa,CAH9N;AACpC,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAE8N,kBAAkB,CAF/M;AACrE,cACkQ,kBAAkB,CAD3O"} \ No newline at end of file diff --git a/types/providers/mapbox/MapboxGeocodeQuery.d.ts.map b/types/providers/mapbox/MapboxGeocodeQuery.d.ts.map deleted file mode 100644 index cb137d1..0000000 --- a/types/providers/mapbox/MapboxGeocodeQuery.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"MapboxGeocodeQuery.d.ts","sourceRoot":"","sources":["../../../src/providers/mapbox/MapboxGeocodeQuery.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,oBAAc;AAEzD,MAAM,WAAW,wBAAyB,SAAQ,kBAAkB;IAClE,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;CACnC;AAED,MAAM,CAAC,OAAO,OAAO,kBAAmB,SAAQ,YAAY;IAC1D,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAW;IAE1C,SAAS,aAAa,EACpB,aAAa,EACb,GAAG,kBAAkB,EACtB,EAAE,wBAAwB;WAKb,MAAM,CAAC,MAAM,EAAE,wBAAwB,GAAG,kBAAkB;IAInE,QAAQ,IAAI,wBAAwB;IAOpC,iBAAiB,CAAC,aAAa,EAAE,MAAM,EAAE,GAAG,kBAAkB;IAI9D,gBAAgB,IAAI,SAAS,GAAG,MAAM,EAAE;CAGhD"} \ No newline at end of file diff --git a/types/providers/mapbox/MapboxProvider.d.ts.map b/types/providers/mapbox/MapboxProvider.d.ts.map deleted file mode 100644 index a4b2aee..0000000 --- a/types/providers/mapbox/MapboxProvider.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"MapboxProvider.d.ts","sourceRoot":"","sources":["../../../src/providers/mapbox/MapboxProvider.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EACvB,oBAAoB,EACrB,gCAA0B;AAC3B,OAAO,EACL,uBAAuB,EACvB,kBAAkB,EAClB,wBAAwB,EACxB,kBAAkB,EAClB,wBAAwB,EAExB,iBAAiB,EACjB,wBAAwB,EAEzB,aAAkB;AACnB,OAAO,QAAQ,uBAAiB;AAChC,OAAO,EAAE,GAAG,EAAE,oBAAc;AAa5B,UAAU,8BAA8B;IACtC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,UAAU,uBAAuB;IAC/B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,SAAS,CAAC;IAEhB,UAAU,EAAE,CACR,SAAS,GACT,QAAQ,GACR,UAAU,GACV,UAAU,GACV,OAAO,GACP,UAAU,GACV,cAAc,GACd,SAAS,GACT,KAAK,CACR,EAAE,CAAC;IACJ,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,uBAAuB,CAAC;IACpC,IAAI,EAAE,MAAM,CAAC;IAEb,UAAU,EAAE,MAAM,CAAC;IAEnB,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,GAAG,CAAC;IACX,MAAM,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACzB,QAAQ,EAAE;QACR,IAAI,EAAE,OAAO,CAAC;QACd,WAAW,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;KAC/B,CAAC;IACF,OAAO,CAAC,EAAE,8BAA8B,EAAE,CAAC;IAE3C,eAAe,CAAC,EAAE;QAChB,MAAM,CAAC,EAAE;YACP,WAAW,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;SAC/B,EAAE,CAAC;KACL,CAAC;CACH;AAED,oBAAY,sBAAsB;IAChC,qBAAqB,kBAAkB;IACvC,+BAA+B,4BAA4B;CAC5D;AAED,MAAM,WAAW,8BACf,SAAQ,wBAAwB;IAChC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,aAAa,CAAC,EAAE,sBAAsB,CAAC;IAChD,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,eAAO,MAAM,4BAA4B;;;;;CAIxC,CAAC;AAEF,MAAM,CAAC,OAAO,OAAO,cAAe,YAAW,iBAAiB;IAC9D,OAAO,CAAC,cAAc,CAA0B;IAEhD,OAAO,CAAC,OAAO,CAAiC;gBAG9C,eAAe,EAAE,uBAAuB,EACxC,OAAO,GAAE,8BAA6D;IAWjE,OAAO,CACZ,KAAK,EAAE,MAAM,GAAG,kBAAkB,GAAG,wBAAwB,EAC7D,QAAQ,EAAE,uBAAuB,GAChC,IAAI;IAkCA,SAAS,CACd,eAAe,EACX,MAAM,GACN,MAAM,GACN,kBAAkB,GAClB,wBAAwB,EAC5B,mBAAmB,EAAE,MAAM,GAAG,MAAM,GAAG,uBAAuB,EAC9D,QAAQ,CAAC,EAAE,uBAAuB,GACjC,IAAI;IAgCA,cAAc,CACnB,MAAM,EAAE,oBAAoB,EAC5B,QAAQ,EAAE,uBAAuB,GAChC,IAAI;WAUO,aAAa,CAAC,MAAM,EAAE,YAAY,GAAG,QAAQ;CAwD5D"} \ No newline at end of file diff --git a/types/providers/mapbox/MapboxReverseQuery.d.ts b/types/providers/mapbox/MapboxReverseQuery.d.ts deleted file mode 100644 index aa0c53d..0000000 --- a/types/providers/mapbox/MapboxReverseQuery.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { ReverseQuery, ReverseQueryObject } from "../../query"; -export interface MapboxReverseQueryObject extends ReverseQueryObject { - readonly locationTypes?: string[]; -} -export default class MapboxReverseQuery extends ReverseQuery { - private readonly locationTypes?; - protected constructor({ locationTypes, ...reverseQueryObject }: MapboxReverseQueryObject); - static create(object: MapboxReverseQueryObject): MapboxReverseQuery; - toObject(): MapboxReverseQueryObject; - withLocationTypes(locationTypes: string[]): MapboxReverseQuery; - getLocationTypes(): undefined | string[]; -} -//# sourceMappingURL=MapboxReverseQuery.d.ts.map \ No newline at end of file diff --git a/types/providers/mapbox/MapboxReverseQuery.d.ts.map b/types/providers/mapbox/MapboxReverseQuery.d.ts.map deleted file mode 100644 index 6ba70e3..0000000 --- a/types/providers/mapbox/MapboxReverseQuery.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"MapboxReverseQuery.d.ts","sourceRoot":"","sources":["../../../src/providers/mapbox/MapboxReverseQuery.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,oBAAc;AAEzD,MAAM,WAAW,wBAAyB,SAAQ,kBAAkB;IAClE,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;CACnC;AAED,MAAM,CAAC,OAAO,OAAO,kBAAmB,SAAQ,YAAY;IAC1D,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAW;IAE1C,SAAS,aAAa,EACpB,aAAa,EACb,GAAG,kBAAkB,EACtB,EAAE,wBAAwB;WAKb,MAAM,CAAC,MAAM,EAAE,wBAAwB,GAAG,kBAAkB;IAInE,QAAQ,IAAI,wBAAwB;IAOpC,iBAAiB,CAAC,aAAa,EAAE,MAAM,EAAE,GAAG,kBAAkB;IAI9D,gBAAgB,IAAI,SAAS,GAAG,MAAM,EAAE;CAGhD"} \ No newline at end of file diff --git a/types/providers/mapbox/index.d.ts.map b/types/providers/mapbox/index.d.ts.map deleted file mode 100644 index a487225..0000000 --- a/types/providers/mapbox/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/providers/mapbox/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAMsB,sBAAsB,CANA;AACpF,cAK8D,sBAAsB,CALhC;AACpD,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAIgD,kBAAkB,CAJ1B;AAC5E,cAGoF,kBAAkB,CAHtD;AAChD,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAE8D,sBAAsB,CAFxC;AACpF,cACsG,sBAAsB,CADxE"} \ No newline at end of file diff --git a/types/providers/nominatim/NominatimGeocodeQuery.d.ts.map b/types/providers/nominatim/NominatimGeocodeQuery.d.ts.map deleted file mode 100644 index ec028ff..0000000 --- a/types/providers/nominatim/NominatimGeocodeQuery.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"NominatimGeocodeQuery.d.ts","sourceRoot":"","sources":["../../../src/providers/nominatim/NominatimGeocodeQuery.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,oBAAc;AACzD,OAAO,EAAE,GAAG,EAAE,oBAAc;AAE5B,MAAM,WAAW,2BAA4B,SAAQ,kBAAkB;IACrE,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACjC,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;IACpC,QAAQ,CAAC,OAAO,CAAC,EAAE,GAAG,CAAC;IACvB,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED,MAAM,CAAC,OAAO,OAAO,qBAAsB,SAAQ,YAAY;IAC7D,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAW;IAEzC,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAW;IAE5C,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAM;IAE/B,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAU;IAEnC,SAAS,aAAa,EACpB,YAAY,EACZ,eAAe,EACf,OAAO,EACP,OAAO,EACP,GAAG,kBAAkB,EACtB,EAAE,2BAA2B;WAgBhB,MAAM,CAClB,MAAM,EAAE,2BAA2B,GAClC,qBAAqB;IAIjB,QAAQ,IAAI,2BAA2B;IAUvC,gBAAgB,CAAC,YAAY,EAAE,MAAM,EAAE,GAAG,qBAAqB;IAI/D,eAAe,IAAI,SAAS,GAAG,MAAM,EAAE;IAIvC,mBAAmB,CAAC,eAAe,EAAE,MAAM,EAAE,GAAG,qBAAqB;IAIrE,kBAAkB,IAAI,SAAS,GAAG,MAAM,EAAE;IAI1C,WAAW,CAAC,OAAO,EAAE,GAAG,GAAG,qBAAqB;IAIhD,UAAU,IAAI,SAAS,GAAG,GAAG;IAI7B,WAAW,CAAC,OAAO,EAAE,OAAO,GAAG,qBAAqB;IAIpD,UAAU,IAAI,SAAS,GAAG,OAAO;CAGzC"} \ No newline at end of file diff --git a/types/providers/nominatim/NominatimGeocoded.d.ts.map b/types/providers/nominatim/NominatimGeocoded.d.ts.map deleted file mode 100644 index af8b467..0000000 --- a/types/providers/nominatim/NominatimGeocoded.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"NominatimGeocoded.d.ts","sourceRoot":"","sources":["../../../src/providers/nominatim/NominatimGeocoded.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,EAAE,EAAE,cAAc,EAAE,uBAAiB;AAEpD,MAAM,WAAW,uBAAwB,SAAQ,cAAc;IAC7D,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;CAC/B;AAED,MAAM,CAAC,OAAO,OAAO,iBAAkB,SAAQ,QAAQ;IACrD,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAS;IAEtC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAS;IAEhC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAS;IAElC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAS;IAEnC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAS;IAE/B,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAS;IAEtC,SAAS,aAAa,EACpB,WAAW,EACX,KAAK,EACL,OAAO,EACP,QAAQ,EACR,IAAI,EACJ,WAAW,EACX,GAAG,cAAc,EAClB,EAAE,uBAAuB;WAUZ,MAAM,CAAC,MAAM,EAAE,uBAAuB,GAAG,iBAAiB;IAIjE,QAAQ,IAAI,uBAAuB;IAYnC,eAAe,CAAC,WAAW,EAAE,MAAM,GAAG,iBAAiB;IAOvD,cAAc,IAAI,SAAS,GAAG,MAAM;IAIpC,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,iBAAiB;IAO3C,QAAQ,IAAI,SAAS,GAAG,MAAM;IAI9B,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,iBAAiB;IAO/C,UAAU,IAAI,SAAS,GAAG,MAAM;IAIhC,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,iBAAiB;IAOjD,WAAW,IAAI,SAAS,GAAG,MAAM;IAIjC,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,iBAAiB;IAOzC,OAAO,IAAI,SAAS,GAAG,MAAM;IAI7B,eAAe,CAAC,WAAW,EAAE,MAAM,GAAG,iBAAiB;IAOvD,cAAc,IAAI,SAAS,GAAG,MAAM;CAG5C"} \ No newline at end of file diff --git a/types/providers/nominatim/NominatimProvider.d.ts.map b/types/providers/nominatim/NominatimProvider.d.ts.map deleted file mode 100644 index db4be40..0000000 --- a/types/providers/nominatim/NominatimProvider.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"NominatimProvider.d.ts","sourceRoot":"","sources":["../../../src/providers/nominatim/NominatimProvider.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EACrB,uBAAuB,EACvB,oBAAoB,EACrB,gCAA0B;AAC3B,OAAO,EACL,uBAAuB,EACvB,iBAAiB,EACjB,qBAAqB,EACrB,2BAA2B,EAC3B,2BAA2B,EAC3B,qBAAqB,EAErB,iBAAiB,EACjB,wBAAwB,EAEzB,aAAkB;AAsBnB,MAAM,WAAW,eAAe;IAE9B,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAEhB,QAAQ,EAAE,MAAM,CAAC;IAEjB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IAC9C,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IAEZ,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE;QACP,UAAU,CAAC,EAAE,MAAM,CAAC;QAEpB,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,OAAO,CAAC,EAAE,MAAM,CAAC;QAEjB,YAAY,CAAC,EAAE,MAAM,CAAC;KACvB,CAAC;CACH;AAED,MAAM,WAAW,iCACf,SAAQ,wBAAwB;IAChC,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,eAAO,MAAM,+BAA+B;;;;;;CAI3C,CAAC;AAEF,MAAM,CAAC,OAAO,OAAO,iBAAkB,YAAW,iBAAiB;IACjE,OAAO,CAAC,cAAc,CAA0B;IAEhD,OAAO,CAAC,OAAO,CAAoC;gBAGjD,eAAe,EAAE,uBAAuB,EACxC,OAAO,GAAE,iCAAmE;IAcvE,OAAO,CACZ,KAAK,EAAE,MAAM,GAAG,qBAAqB,GAAG,2BAA2B,EACnE,QAAQ,EAAE,uBAAuB,GAChC,IAAI;IAmDA,SAAS,CACd,eAAe,EACX,MAAM,GACN,MAAM,GACN,qBAAqB,GACrB,2BAA2B,EAC/B,mBAAmB,EAAE,MAAM,GAAG,MAAM,GAAG,uBAAuB,EAC9D,QAAQ,CAAC,EAAE,uBAAuB,GACjC,IAAI;IA8BP,OAAO,CAAC,eAAe;IAavB,OAAO,CAAC,UAAU;IAOX,cAAc,CACnB,MAAM,EAAE,oBAAoB,EAC5B,QAAQ,EAAE,uBAAuB,EACjC,OAAO,CAAC,EAAE,qBAAqB,GAC9B,IAAI;WAgBO,aAAa,CAAC,MAAM,EAAE,eAAe,GAAG,iBAAiB;CA0ExE"} \ No newline at end of file diff --git a/types/providers/nominatim/NominatimReverseQuery.d.ts.map b/types/providers/nominatim/NominatimReverseQuery.d.ts.map deleted file mode 100644 index d588d2a..0000000 --- a/types/providers/nominatim/NominatimReverseQuery.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"NominatimReverseQuery.d.ts","sourceRoot":"","sources":["../../../src/providers/nominatim/NominatimReverseQuery.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,oBAAc;AAEzD,MAAM,WAAW,2BAA4B,SAAQ,kBAAkB;IACrE,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,CAAC,OAAO,OAAO,qBAAsB,SAAQ,YAAY;IAC7D,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAS;IAE/B,SAAS,aAAa,EACpB,IAAI,EACJ,GAAG,kBAAkB,EACtB,EAAE,2BAA2B;WAKhB,MAAM,CAClB,MAAM,EAAE,2BAA2B,GAClC,qBAAqB;IAIjB,QAAQ,IAAI,2BAA2B;IAOvC,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,qBAAqB;IAI7C,OAAO,IAAI,SAAS,GAAG,MAAM;CAGrC"} \ No newline at end of file diff --git a/types/providers/nominatim/index.d.ts.map b/types/providers/nominatim/index.d.ts.map deleted file mode 100644 index 04999be..0000000 --- a/types/providers/nominatim/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/providers/nominatim/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAoBqD,qBAAqB,CApB5B;AACrF,OAAO,EAAE,OAAO,IAAI,qBAAqB,EAAE,MAmBiD,qBAAqB,CAnBxB;AACzF,cAkB4F,qBAAqB,CAlB3D;AACtD,OAAO,EAAE,uBAAuB,IAAI,2BAA2B,EAAE,MAiB2B,qBAAqB,CAjBF;AAC/G,OAAO,EAAE,OAAO,IAAI,qBAAqB,EAAE,MAgBsE,yBAAyB,CAhB7C;AAC7F,OAAO,EAAE,OAAO,IAAI,yBAAyB,EAAE,MAekE,yBAAyB,CAfzC;AACjG,cAciH,yBAAyB,CAdhF;AAC1D,OAAO,EAAE,2BAA2B,IAAI,+BAA+B,EAAE,MAawC,yBAAyB,CAbf;AAC3H,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAYmG,qBAAqB,CAZ1E;AACrF,OAAO,EAAE,OAAO,IAAI,qBAAqB,EAAE,MAW+F,qBAAqB,CAXtE;AACzF,cAU0I,qBAAqB,CAVzG;AACtD,OAAO,EACL,iCAAiC,IAAI,qCAAqC,EAC1E,eAAe,IAAI,mBAAmB,EACtC,+BAA+B,IAAI,mCAAmC,GACvE,MAKyI,qBAAqB,CALhH;AAC/C,OAAO,EAAE,OAAO,IAAI,qBAAqB,EAAE,MAIoH,yBAAyB,CAJ3F;AAC7F,OAAO,EAAE,OAAO,IAAI,yBAAyB,EAAE,MAGgH,yBAAyB,CAHvF;AACjG,cAE+J,yBAAyB,CAF9H;AAC1D,OAAO,EAAE,2BAA2B,IAAI,+BAA+B,EAAE,MACsF,yBAAyB,CAD7D"} \ No newline at end of file From 2afffd85dc8b745ce858b8360e759f753af67e08 Mon Sep 17 00:00:00 2001 From: Alan Poulain Date: Tue, 28 Jul 2020 19:14:41 +0200 Subject: [PATCH 23/56] 0.3.0 --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 3c22e78..374c4d4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "universal-geocoder", - "version": "0.2.4", + "version": "0.3.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index fcb98a3..7629796 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "universal-geocoder", "description": "Universal geocoding abstraction with multiple built-in providers", - "version": "0.2.4", + "version": "0.3.0", "keywords": [ "geocoder", "geocoding", From 2d2fa10c0feb8dc4d078185bd79ffbfdc0016b5a Mon Sep 17 00:00:00 2001 From: Alan Poulain Date: Tue, 28 Jul 2020 20:10:13 +0200 Subject: [PATCH 24/56] Fix publish to GitHub registry --- .github/workflows/release.yml | 5 +++++ package.json | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f87520a..0b9d415 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -37,6 +37,11 @@ jobs: with: node-version: "14" registry-url: https://npm.pkg.github.com + - name: Change package name + uses: datamonsters/replace-action + with: + files: package.json + replacements: '"name": "universal-geocoder","name": "@universal-geocoder/universal-geocoder"' - name: Publish to GitHub run: npm publish env: diff --git a/package.json b/package.json index 7629796..6a7fbff 100644 --- a/package.json +++ b/package.json @@ -60,7 +60,7 @@ "scripts": { "build": "rm -rf types && webpack --config webpack.dev.js && webpack --config webpack.prod.js && ttsc", "lint": "eslint --fix --ext .ts .", - "prepublish": "npm run build", + "prepublishOnly": "npm run build", "serve": "http-server", "test": "ts-node --compiler ttypescript -r tsconfig-paths/register node_modules/.bin/jasmine", "watch": "webpack --config webpack.dev.js --watch" From baf7325ea67217d37a24f79fb100191aaa537b78 Mon Sep 17 00:00:00 2001 From: Alan Poulain Date: Tue, 28 Jul 2020 20:27:05 +0200 Subject: [PATCH 25/56] Fix typo in CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3750b20..6290d49 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Changelog -## O.3.0 +## 0.3.0 * Add OpenCage Provider * Add time zone to `Geocoded` From 2da527993f95f01ffe99a085610bbdcd9b2fdadf Mon Sep 17 00:00:00 2001 From: Alan Poulain Date: Sun, 9 Aug 2020 21:22:29 +0200 Subject: [PATCH 26/56] Better Google Maps provider (#2) --- .eslintrc | 1 - .github/workflows/ci.yml | 4 +- CHANGELOG.md | 9 + README.md | 38 +- couscous.yml | 30 +- docs/provider_usage.md | 87 +- docs/provider_usage/googlemaps.md | 29 + docs/provider_usage/mapbox.md | 22 + docs/provider_usage/nominatim.md | 25 + docs/provider_usage/opencage.md | 27 + docs/provider_usage/yandex.md | 5 + example/node/bing.ts | 16 + example/node/googlemaps.ts | 14 + example/node/mapbox.ts | 11 + example/node/mapquest.ts | 17 + example/node/opencage.ts | 16 + example/node/openstreetmap.ts | 17 + example/node/yandex.ts | 17 + example/{ => web}/bing.html | 2 +- example/{google.html => web/googlemaps.html} | 6 +- example/{ => web}/mapbox.html | 2 +- example/{ => web}/mapquest.html | 2 +- example/{ => web}/opencage.html | 2 +- example/{ => web}/openstreetmap.html | 2 +- example/{ => web}/yandex.html | 2 +- package-lock.json | 867 ++++++++---------- package.json | 8 +- spec/provider/GoogleAPIProvider.spec.ts | 122 --- spec/provider/GoogleMapsProvider.spec.ts | 193 ++++ src/ExternalLoader.ts | 39 +- src/GeoJsonDumper.ts | 2 + src/Geocoded.ts | 1 + src/GeocoderProviderFactory.ts | 20 +- src/index.ts | 1 + src/provider/BingProvider.ts | 6 +- src/provider/GoogleAPIProvider.ts | 218 ----- src/provider/MapquestProvider.ts | 6 +- src/provider/YandexProvider.ts | 6 +- .../googlemaps/GoogleMapsGeocodeQuery.ts | 78 ++ src/provider/googlemaps/GoogleMapsGeocoded.ts | 343 +++++++ src/provider/googlemaps/GoogleMapsProvider.ts | 596 ++++++++++++ .../googlemaps/GoogleMapsReverseQuery.ts | 66 ++ src/provider/googlemaps/index.ts | 7 + src/provider/index.ts | 3 +- src/provider/mapbox/MapboxProvider.ts | 6 +- src/provider/nominatim/NominatimProvider.ts | 19 +- src/provider/opencage/OpenCageProvider.ts | 10 +- src/utils.ts | 41 + types/ExternalLoader.d.ts | 5 +- types/ExternalLoader.d.ts.map | 2 +- types/GeoJsonDumper.d.ts | 2 +- types/GeoJsonDumper.d.ts.map | 2 +- types/Geocoded.d.ts | 2 +- types/Geocoded.d.ts.map | 2 +- types/GeocoderProviderFactory.d.ts | 13 +- types/GeocoderProviderFactory.d.ts.map | 2 +- types/index.d.ts | 1 + types/index.d.ts.map | 2 +- types/provider/GoogleAPIProvider.d.ts | 34 - types/provider/GoogleAPIProvider.d.ts.map | 1 - .../googlemaps/GoogleMapsGeocodeQuery.d.ts | 26 + .../GoogleMapsGeocodeQuery.d.ts.map | 1 + .../googlemaps/GoogleMapsGeocoded.d.ts | 86 ++ .../googlemaps/GoogleMapsGeocoded.d.ts.map | 1 + .../googlemaps/GoogleMapsProvider.d.ts | 54 ++ .../googlemaps/GoogleMapsProvider.d.ts.map | 1 + .../googlemaps/GoogleMapsReverseQuery.d.ts | 21 + .../GoogleMapsReverseQuery.d.ts.map | 1 + types/provider/googlemaps/index.d.ts | 8 + types/provider/googlemaps/index.d.ts.map | 1 + types/provider/index.d.ts | 3 +- types/provider/index.d.ts.map | 2 +- types/provider/mapbox/MapboxProvider.d.ts | 2 +- types/provider/mapbox/MapboxProvider.d.ts.map | 2 +- .../provider/nominatim/NominatimProvider.d.ts | 2 +- .../nominatim/NominatimProvider.d.ts.map | 2 +- types/provider/opencage/OpenCageProvider.d.ts | 2 +- .../opencage/OpenCageProvider.d.ts.map | 2 +- types/utils.d.ts | 13 + types/utils.d.ts.map | 1 + webpack.common.js | 1 + website/default.twig | 25 +- 82 files changed, 2328 insertions(+), 1058 deletions(-) create mode 100644 docs/provider_usage/googlemaps.md create mode 100644 docs/provider_usage/mapbox.md create mode 100644 docs/provider_usage/nominatim.md create mode 100644 docs/provider_usage/opencage.md create mode 100644 docs/provider_usage/yandex.md create mode 100644 example/node/bing.ts create mode 100644 example/node/googlemaps.ts create mode 100644 example/node/mapbox.ts create mode 100644 example/node/mapquest.ts create mode 100644 example/node/opencage.ts create mode 100644 example/node/openstreetmap.ts create mode 100644 example/node/yandex.ts rename example/{ => web}/bing.html (90%) rename example/{google.html => web/googlemaps.html} (71%) rename example/{ => web}/mapbox.html (88%) rename example/{ => web}/mapquest.html (89%) rename example/{ => web}/opencage.html (88%) rename example/{ => web}/openstreetmap.html (89%) rename example/{ => web}/yandex.html (89%) delete mode 100644 spec/provider/GoogleAPIProvider.spec.ts create mode 100644 spec/provider/GoogleMapsProvider.spec.ts delete mode 100644 src/provider/GoogleAPIProvider.ts create mode 100644 src/provider/googlemaps/GoogleMapsGeocodeQuery.ts create mode 100644 src/provider/googlemaps/GoogleMapsGeocoded.ts create mode 100644 src/provider/googlemaps/GoogleMapsProvider.ts create mode 100644 src/provider/googlemaps/GoogleMapsReverseQuery.ts create mode 100644 src/provider/googlemaps/index.ts create mode 100644 src/utils.ts delete mode 100644 types/provider/GoogleAPIProvider.d.ts delete mode 100644 types/provider/GoogleAPIProvider.d.ts.map create mode 100644 types/provider/googlemaps/GoogleMapsGeocodeQuery.d.ts create mode 100644 types/provider/googlemaps/GoogleMapsGeocodeQuery.d.ts.map create mode 100644 types/provider/googlemaps/GoogleMapsGeocoded.d.ts create mode 100644 types/provider/googlemaps/GoogleMapsGeocoded.d.ts.map create mode 100644 types/provider/googlemaps/GoogleMapsProvider.d.ts create mode 100644 types/provider/googlemaps/GoogleMapsProvider.d.ts.map create mode 100644 types/provider/googlemaps/GoogleMapsReverseQuery.d.ts create mode 100644 types/provider/googlemaps/GoogleMapsReverseQuery.d.ts.map create mode 100644 types/provider/googlemaps/index.d.ts create mode 100644 types/provider/googlemaps/index.d.ts.map create mode 100644 types/utils.d.ts create mode 100644 types/utils.d.ts.map diff --git a/.eslintrc b/.eslintrc index d5c1b40..d798a22 100644 --- a/.eslintrc +++ b/.eslintrc @@ -13,7 +13,6 @@ "ignorePatterns": ["/types/**/*.ts", "/website/vendor/**/*"], "rules": { "prettier/prettier": ["error"], - "no-console": "off", "@typescript-eslint/no-unused-vars": ["error", { "ignoreRestSiblings": true }] }, "overrides": [ diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a02e0b1..80cfa6f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,9 +17,9 @@ jobs: node-version: "14" - name: Install dependencies run: npm install + - name: Check build + run: npm run build - name: Check coding standards run: npm run lint - name: Run tests run: npm test - - name: Check build - run: npm run build diff --git a/CHANGELOG.md b/CHANGELOG.md index 6290d49..7d692b6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,14 @@ # Changelog +## 0.4.0 + +* [Google] Better Google Maps provider +* [Nominatim] Better handling of geodecode errors +* [ExternalLoader] Add `getOptions` method to interface +* [ExternalLoader] Rename `JSONPCallback` in params to `jsonpCallback` +* Rename `GoogleAPIProvider` to `GoogleMapsProvider` +* Add Node examples + ## 0.3.0 * Add OpenCage Provider diff --git a/README.md b/README.md index 9ead963..5ad8d70 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ Need geocoding 🌍️ in your website or application? Don't want to be vendor-l Universal Geocoder is a TypeScript fork of [GeocoderJS](https://github.com/geocoder-php/geocoder-js), itself a port of the [Geocoder PHP](https://geocoder-php.org/) library. -This library is platform agnostic: it is available either server-side (Node) or client-side (browsers, React Native). +This library is platform agnostic: it is available either server-side (Node) or client-side (browsers, React Native, Electron). Installation ------------ @@ -41,7 +41,7 @@ openStreetMapGeocoder.geocode("1600 Pennsylvania Ave NW, Washington, DC", (resul }); ``` -If you want to use the library as a direct dependecy, copy `dist/universal-geocoder.js` or `dist/universal-geocoder.min.js` to your dependencies. +If you want to use the library as a direct dependecy (for browsers only), copy `dist/universal-geocoder.js` or `dist/universal-geocoder.min.js` to your dependencies. Universal Geocoder will be available in the global environment: @@ -59,7 +59,7 @@ For a more advanced usage, see the example below: import UniversalGeocoder, { ReverseQuery } from "universal-geocoder"; const googleGeocoder = UniversalGeocoder.createGeocoder({ - provider: "google", + provider: "googlemaps", apiKey: "YOUR_API_KEY", useSsl: true, useJsonp: false, @@ -130,6 +130,8 @@ The following table summarizes the features of each: Name Works in browsers? Works in Node? + Works in React Native? + Works in Electron? Supports reverse geocoding? @@ -138,6 +140,8 @@ The following table summarizes the features of each: OpenStreetMap (Nominatim) openstreetmap or nominatim ✅️ yes + ✅️ yes + ❓️ untested ❓️ untested ✅️ yes @@ -145,20 +149,26 @@ The following table summarizes the features of each: OpenCage opencage ✅️ yes + ✅️ yes + ❓️ untested ❓️ untested ✅️ yes - Google API - google + Google Maps (Geocoding API) + google or googlemaps ✅️ yes ✅️ yes + ❓️ untested + ❓️ untested ✅️ yes Mapbox mapbox ✅️ yes + ✅️ yes + ❓️ untested ❓️ untested ✅️ yes @@ -166,6 +176,8 @@ The following table summarizes the features of each: MapQuest mapquest ✅️ yes + ✅️ yes + ❓️ untested ❓️ untested ✅️ yes @@ -173,6 +185,8 @@ The following table summarizes the features of each: Bing bing ✅️ yes + ✅️ yes + ❓️ untested ❓️ untested ✅️ yes @@ -180,6 +194,8 @@ The following table summarizes the features of each: Yandex yandex ✅️ yes + ✅️ yes + ❓️ untested ❓️ untested ✅️ yes @@ -228,10 +244,18 @@ Unit tests are handled by Jasmine. To run unit tests from the command line, use: npm test ``` -You can also check if the examples are running correctly: +You can also check if the examples are running correctly. + +For the Web: ```shell npm run serve ``` -Then go to http://localhost:8080/example, choose a provider and open the console. +Then go to http://localhost:8080/example/web, choose a provider and open the console. + +For Node: + +```shell +npm run ts-node -- example/node/provider.ts +``` diff --git a/couscous.yml b/couscous.yml index 7094123..1891347 100644 --- a/couscous.yml +++ b/couscous.yml @@ -6,11 +6,31 @@ github: repo: universal-geocoder-js menu: - items: - readme: - text: Home + sections: + main: + items: + readme: + text: 🌏️ Home + provider_usage: + text: 🔎️ Provider Usage + relativeUrl: docs/provider_usage.html provider_usage: - text: Provider Usage - relativeUrl: docs/provider_usage.html + name: Provider + items: + nominatim: + text: 📌️ OpenStreetMap (Nominatim) + relativeUrl: docs/provider_usage/nominatim.html + opencage: + text: 📌️ OpenCage + relativeUrl: docs/provider_usage/opencage.html + googlemaps: + text: 📌️ Google Maps (Geocoding API) + relativeUrl: docs/provider_usage/googlemaps.html + mapbox: + text: 📌️ Mapbox + relativeUrl: docs/provider_usage/mapbox.html + yandex: + text: 📌️ Yandex + relativeUrl: docs/provider_usage/yandex.html baseUrl: /universal-geocoder-js/ diff --git a/docs/provider_usage.md b/docs/provider_usage.md index 11bdae4..f79244d 100644 --- a/docs/provider_usage.md +++ b/docs/provider_usage.md @@ -1,84 +1,9 @@ # Specific Provider Usage -## OpenStreetMap (Nominatim) +Each provider has its own options, parameters or results because of its specific features. -### Options - -- `userAgent` (required if default host): a User-Agent identifying your application is needed to use Nominatim (see https://operations.osmfoundation.org/policies/nominatim/) -- `referer`: if you want to set a Referer as well -- `host` (default: "nominatim.openstreetmap.org"): to use another host - -### `geocode` parameters - -- `countryCodes`: to restrict the results to one or more countries (ISO 3166 alpha 2 country codes) -- `excludePlaceIds`: for excluding some OpenStreetMap objects from the results -- `viewBox` ([longitude 1, latitude 1, longitude 2, latitude 2]): the preferred area to find search results -- `bounded` (only if `viewBox` is used): boolean to restrict the results to items within the view box - -### `geodecode` parameters - -- `zoom` (default: 18, from 0 to 18): the level of details required for the address - -### `Geocoded` properties - -- `displayName`: full comma-separated address -- `osmId`, `osmType`: reference to the OpenStreetMap object -- `category`, `type`: key and value of the main OpenStreetMap tag -- `attribution`: OpenStreetMap licensing information - -## OpenCage - -### Options - -- `countryCodes`: to restrict the results to one or more countries (ISO 3166 alpha 2 country codes) - -### `geocode` parameters - -- `countryCodes`: to restrict the results to one or more countries (ISO 3166 alpha 2 country codes) -- `proximity`: to provide a hint to bias results in favour of those closer to the specified location -- `minConfidence` (from 1 to 10): only results with at least this confidence will be returned -- `noRecord`: boolean to ask for the query to not be logged - -### `geodecode` parameters - -- `countryCodes`: to restrict the results to one or more countries (ISO 3166 alpha 2 country codes) -- `minConfidence` (from 1 to 10): only results with at least this confidence will be returned -- `noRecord`: boolean to ask for the query to not be logged - -### `Geocoded` properties - -- `callingCode`: the international telephone calling code for the country of the result -- `flag`: emoji flag of the country of the result -- `mgrs`: Military Grid Reference System code for the center point of the result -- `maidenhead`: Maidenhead location reference for the center point of the result -- `geohash`: Geohash for the center point of the result -- `what3words`: key words whose value is a 3 words address (3wa) - -## Mapbox - -### Options - -- `geocodingMode` (default: "mapbox.places"): the geocoding mode to use -- `countryCodes`: to restrict the results to one or more countries (ISO 3166 alpha 2 country codes) - -### `geocode` parameters - -- `countryCodes`: to restrict the results to one or more countries (ISO 3166 alpha 2 country codes) -- `proximity`: to bias the response to favor results that are closer to the specified location -- `locationTypes` (possible values: "country", "region", "postcode", "district", "place", "locality", "neighborhood", "address", "poi"): to filter the results to a subset of location types - -### `geodecode` parameters - -- `countryCodes`: to restrict the results to one or more countries (ISO 3166 alpha 2 country codes) -- `reverseMode` ("distance" or "score", default: "distance"): how results are sorted -- `locationTypes` (possible values: "country", "region", "postcode", "district", "place", "locality", "neighborhood", "address", "poi"): to filter the results to a subset of location types - -### `Geocoded` properties - -- `resultType`: an array of result types - -## Yandex - -### Options - -- `toponym`: the type of toponym ("house", "street", "metro", "district", "locality") +- [OpenStreetMap (Nominatim)](provider_usage/nominatim.md) +- [OpenCage](provider_usage/opencage.md) +- [Google Maps (Geocoding API)](provider_usage/googlemaps.md) +- [Mapbox](provider_usage/mapbox.md) +- [Yandex](provider_usage/yandex.md) diff --git a/docs/provider_usage/googlemaps.md b/docs/provider_usage/googlemaps.md new file mode 100644 index 0000000..c2258fc --- /dev/null +++ b/docs/provider_usage/googlemaps.md @@ -0,0 +1,29 @@ +# Google Maps (Geocoding API) Usage + +## Options + +- `countryCodes`: to restrict the results to one or more countries (ccTLD country codes) +- `clientId`: to use a client ID instead of the API key (Premium only) +- `secret`: the URL signing secret to use to digitally sign the request (Premium only and only server-side) + +## `geocode` parameters + +- `countryCodes`: to restrict the results to one or more countries (ccTLD country codes) +- `components` (array of objects with `name` and `value` properties): to filter the results by components +- `channel`: channel to use for this request (Premium only) + +## `geodecode` parameters + +- `resultTypes`: to filter the results by address types +- `locationTypes` (possible values: "ROOFTOP", "RANGE_INTERPOLATED", "GEOMETRIC_CENTER", "APPROXIMATE"): to filter the results by location types +- `channel`: channel to use for this request (Premium only) + +## `Geocoded` properties + +- `placeId`: a unique identifier used with other Google APIs +- `partialMatch`: to indicate the geocoder did not return an exact match +- `resultType`: an array of result types +- `locationType`: a type representing the precision of the result +- `streetAddress`: the street number with the street name +- `intersection`, `political`, `colloquialArea`, `ward`, `neighborhood`, `premise`, `subpremise`, `naturalFeature`, `airport`, `park`, `pointOfInterest`, `establishment`, `postalCodeSuffix`: additional address components +- `subLocalityLevels`: levels for the sublocality diff --git a/docs/provider_usage/mapbox.md b/docs/provider_usage/mapbox.md new file mode 100644 index 0000000..55afd3c --- /dev/null +++ b/docs/provider_usage/mapbox.md @@ -0,0 +1,22 @@ +# Mapbox Usage + +## Options + +- `geocodingMode` (default: "mapbox.places"): the geocoding mode to use +- `countryCodes`: to restrict the results to one or more countries (ISO 3166 alpha 2 country codes) + +## `geocode` parameters + +- `countryCodes`: to restrict the results to one or more countries (ISO 3166 alpha 2 country codes) +- `proximity`: to bias the response to favor results that are closer to the specified location +- `locationTypes` (possible values: "country", "region", "postcode", "district", "place", "locality", "neighborhood", "address", "poi"): to filter the results to a subset of location types + +## `geodecode` parameters + +- `countryCodes`: to restrict the results to one or more countries (ISO 3166 alpha 2 country codes) +- `reverseMode` ("distance" or "score", default: "distance"): how results are sorted +- `locationTypes` (possible values: "country", "region", "postcode", "district", "place", "locality", "neighborhood", "address", "poi"): to filter the results to a subset of location types + +## `Geocoded` properties + +- `resultType`: an array of result types diff --git a/docs/provider_usage/nominatim.md b/docs/provider_usage/nominatim.md new file mode 100644 index 0000000..8334f38 --- /dev/null +++ b/docs/provider_usage/nominatim.md @@ -0,0 +1,25 @@ +# OpenStreetMap (Nominatim) Usage + +## Options + +- `userAgent` (required if default host): a User-Agent identifying your application is needed to use Nominatim (see https://operations.osmfoundation.org/policies/nominatim/) +- `referer`: if you want to set a Referer as well +- `host` (default: "nominatim.openstreetmap.org"): to use another host + +## `geocode` parameters + +- `countryCodes`: to restrict the results to one or more countries (ISO 3166 alpha 2 country codes) +- `excludePlaceIds`: for excluding some OpenStreetMap objects from the results +- `viewBox` ([longitude 1, latitude 1, longitude 2, latitude 2]): the preferred area to find search results +- `bounded` (only if `viewBox` is used): boolean to restrict the results to items within the view box + +## `geodecode` parameters + +- `zoom` (default: 18, from 0 to 18): the level of details required for the address + +## `Geocoded` properties + +- `displayName`: full comma-separated address +- `osmId`, `osmType`: reference to the OpenStreetMap object +- `category`, `type`: key and value of the main OpenStreetMap tag +- `attribution`: OpenStreetMap licensing information diff --git a/docs/provider_usage/opencage.md b/docs/provider_usage/opencage.md new file mode 100644 index 0000000..c967c3f --- /dev/null +++ b/docs/provider_usage/opencage.md @@ -0,0 +1,27 @@ +# OpenCage Usage + +## Options + +- `countryCodes`: to restrict the results to one or more countries (ISO 3166 alpha 2 country codes) + +## `geocode` parameters + +- `countryCodes`: to restrict the results to one or more countries (ISO 3166 alpha 2 country codes) +- `proximity`: to provide a hint to bias results in favour of those closer to the specified location +- `minConfidence` (from 1 to 10): only results with at least this confidence will be returned +- `noRecord`: boolean to ask for the query to not be logged + +## `geodecode` parameters + +- `countryCodes`: to restrict the results to one or more countries (ISO 3166 alpha 2 country codes) +- `minConfidence` (from 1 to 10): only results with at least this confidence will be returned +- `noRecord`: boolean to ask for the query to not be logged + +## `Geocoded` properties + +- `callingCode`: the international telephone calling code for the country of the result +- `flag`: emoji flag of the country of the result +- `mgrs`: Military Grid Reference System code for the center point of the result +- `maidenhead`: Maidenhead location reference for the center point of the result +- `geohash`: Geohash for the center point of the result +- `what3words`: key words whose value is a 3 words address (3wa) diff --git a/docs/provider_usage/yandex.md b/docs/provider_usage/yandex.md new file mode 100644 index 0000000..c8b8409 --- /dev/null +++ b/docs/provider_usage/yandex.md @@ -0,0 +1,5 @@ +# Yandex Usage + +## Options + +- `toponym`: the type of toponym ("house", "street", "metro", "district", "locality") diff --git a/example/node/bing.ts b/example/node/bing.ts new file mode 100644 index 0000000..6efc23b --- /dev/null +++ b/example/node/bing.ts @@ -0,0 +1,16 @@ +/* eslint-disable no-console */ +import UniversalGeocoder from "../../dist/UniversalGeocoder"; +import GeoJsonDumper from "../../dist/GeoJsonDumper"; + +const bingGeocoder = UniversalGeocoder.createGeocoder({ + provider: "bing", + apiKey: "As11PsBXYvAoGEXmz59ZWl93T8_OACdXi2QnRKWMRIUK6hzOXgN3BcZHnbKyPZYo", +}); +bingGeocoder.geocode("1600 Pennsylvania Ave NW, Washington, DC", (result) => { + console.log(result); + console.log("GeoJSON:", GeoJsonDumper.dump(result[0])); +}); + +bingGeocoder.geodecode("44.915", "-93.21", (result) => { + console.log(result); +}); diff --git a/example/node/googlemaps.ts b/example/node/googlemaps.ts new file mode 100644 index 0000000..3a40692 --- /dev/null +++ b/example/node/googlemaps.ts @@ -0,0 +1,14 @@ +/* eslint-disable no-console */ +import UniversalGeocoder from "../../dist/UniversalGeocoder"; + +const googleGeocoder = UniversalGeocoder.createGeocoder({ + provider: "googlemaps", + useSsl: true, +}); +googleGeocoder.geocode("1600 Pennsylvania Ave, Washington, DC", (result) => { + console.log(result); +}); + +googleGeocoder.geodecode("44.915", "-93.21", (result) => { + console.log(result); +}); diff --git a/example/node/mapbox.ts b/example/node/mapbox.ts new file mode 100644 index 0000000..3d30804 --- /dev/null +++ b/example/node/mapbox.ts @@ -0,0 +1,11 @@ +/* eslint-disable no-console */ +import UniversalGeocoder from "../../dist/UniversalGeocoder"; + +const mapboxGeocoder = UniversalGeocoder.createGeocoder({ provider: "mapbox" }); +mapboxGeocoder.geocode("1600 Pennsylvania Ave NW, Washington, DC", (result) => { + console.log(result); +}); + +mapboxGeocoder.geodecode("44.915", "-93.21", (result) => { + console.log(result); +}); diff --git a/example/node/mapquest.ts b/example/node/mapquest.ts new file mode 100644 index 0000000..95f1de3 --- /dev/null +++ b/example/node/mapquest.ts @@ -0,0 +1,17 @@ +/* eslint-disable no-console */ +import UniversalGeocoder from "../../dist/UniversalGeocoder"; + +const mapQuestGeocoder = UniversalGeocoder.createGeocoder({ + provider: "mapquest", + apiKey: "Fmjtd%7Cluurnu6al1%2Cbg%3Do5-9wbg94", +}); +mapQuestGeocoder.geocode( + "1600 Pennsylvania Ave NW, Washington, DC", + (result) => { + console.log(result); + } +); + +mapQuestGeocoder.geodecode("44.915", "-93.21", (result) => { + console.log(result); +}); diff --git a/example/node/opencage.ts b/example/node/opencage.ts new file mode 100644 index 0000000..47a2264 --- /dev/null +++ b/example/node/opencage.ts @@ -0,0 +1,16 @@ +/* eslint-disable no-console */ +import UniversalGeocoder from "../../dist/UniversalGeocoder"; + +const openCageGeocoder = UniversalGeocoder.createGeocoder({ + provider: "opencage", +}); +openCageGeocoder.geocode( + "1600 Pennsylvania Ave NW, Washington, DC", + (result) => { + console.log(result); + } +); + +openCageGeocoder.geodecode("44.915", "-93.21", (result) => { + console.log(result); +}); diff --git a/example/node/openstreetmap.ts b/example/node/openstreetmap.ts new file mode 100644 index 0000000..9a5578d --- /dev/null +++ b/example/node/openstreetmap.ts @@ -0,0 +1,17 @@ +/* eslint-disable no-console */ +import UniversalGeocoder from "../../dist/UniversalGeocoder"; + +const openStreetMapGeocoder = UniversalGeocoder.createGeocoder({ + provider: "openstreetmap", + userAgent: "Universal Geocoder Example", +}); +openStreetMapGeocoder.geocode( + "1600 Pennsylvania Ave NW, Washington, DC", + (result) => { + console.log(result); + } +); + +openStreetMapGeocoder.geodecode("44.915", "-93.21", (result) => { + console.log(result); +}); diff --git a/example/node/yandex.ts b/example/node/yandex.ts new file mode 100644 index 0000000..0171db8 --- /dev/null +++ b/example/node/yandex.ts @@ -0,0 +1,17 @@ +/* eslint-disable no-console */ +import UniversalGeocoder from "../../dist/UniversalGeocoder"; + +const yandexGeocoder = UniversalGeocoder.createGeocoder("yandex"); +yandexGeocoder.geocode( + { text: "1600 Pennsylvania Ave, Washington, DC", locale: "en-US" }, + (result) => { + console.log(result); + } +); + +yandexGeocoder.geodecode( + { latitude: "44.915", longitude: "-93.21", locale: "en-US" }, + (result) => { + console.log(result); + } +); diff --git a/example/bing.html b/example/web/bing.html similarity index 90% rename from example/bing.html rename to example/web/bing.html index 2aa31f9..592029d 100644 --- a/example/bing.html +++ b/example/web/bing.html @@ -2,7 +2,7 @@ Universal Geocoder: Bing Example - + + Universal Geocoder: Google Maps Example + + + + + + + + + + + + \ No newline at end of file diff --git a/src/ExternalLoader.ts b/src/ExternalLoader.ts index 0340059..bc5dbb5 100644 --- a/src/ExternalLoader.ts +++ b/src/ExternalLoader.ts @@ -1,4 +1,5 @@ import fetch from "cross-fetch"; +import { ErrorCallback } from "provider"; import { ResponseError } from "error"; import { isBrowser, filterUndefinedObjectValues } from "utils"; @@ -30,7 +31,6 @@ export interface ExternalLoaderHeaders { // eslint-disable-next-line @typescript-eslint/no-explicit-any type ResponseCallback = (response: any) => void; -export type ErrorCallback = (responseError: ResponseError) => void; const defaultOptions: ExternalLoaderOptions = { protocol: "http", @@ -105,7 +105,9 @@ export default class ExternalLoader implements ExternalLoaderInterface { errorCallback(error); return; } - throw error; + setTimeout(() => { + throw error; + }); }); } diff --git a/src/GeocoderProviderFactory.ts b/src/GeocoderProviderFactory.ts index a4825f5..df13ac4 100644 --- a/src/GeocoderProviderFactory.ts +++ b/src/GeocoderProviderFactory.ts @@ -1,5 +1,7 @@ import { BingProvider, + ChainProvider, + ChainProviderOptionsInterface, GoogleMapsProvider, GoogleMapsProviderOptionsInterface, MapboxProvider, @@ -12,6 +14,7 @@ import { YandexProvider, YandexProviderOptionsInterface, ProviderOptionsInterface, + defaultChainProviderOptions, defaultMapboxProviderOptions, defaultNominatimProviderOptions, defaultOpenCageProviderOptions, @@ -22,6 +25,7 @@ import ExternalLoader from "ExternalLoader"; interface ProviderOptionInterface { provider: | "bing" + | "chain" | "google" | "googlemaps" | "mapbox" @@ -36,6 +40,12 @@ interface ProviderFactoryOptions extends ProviderOptionsInterface, ProviderOptionInterface {} +interface ChainGeocoderProviderFactoryOptions + extends ProviderOptionInterface, + ChainProviderOptionsInterface { + provider: "chain"; +} + interface GoogleMapsGeocoderProviderFactoryOptions extends ProviderOptionInterface, GoogleMapsProviderOptionsInterface { @@ -68,6 +78,7 @@ interface YandexGeocoderProviderFactoryOptions export type GeocoderProviderFactoryOptions = | ProviderFactoryOptions + | ChainGeocoderProviderFactoryOptions | GoogleMapsGeocoderProviderFactoryOptions | MapboxGeocoderProviderFactoryOptions | NominatimGeocoderProviderFactoryOptions @@ -76,6 +87,7 @@ export type GeocoderProviderFactoryOptions = export type GeocoderProvider = | BingProvider + | ChainProvider | GoogleMapsProvider | MapboxProvider | MapquestProvider @@ -85,7 +97,9 @@ export type GeocoderProvider = export type GeocoderProviderByOptionsType< O -> = O extends GoogleMapsGeocoderProviderFactoryOptions +> = O extends ChainGeocoderProviderFactoryOptions + ? ChainProvider + : O extends GoogleMapsGeocoderProviderFactoryOptions ? GoogleMapsProvider : O extends MapboxGeocoderProviderFactoryOptions ? MapboxProvider @@ -124,6 +138,11 @@ export default class ProviderFactory { return >( new BingProvider(externalLoader, providerOptions) ); + case "chain": + return >new ChainProvider({ + ...defaultChainProviderOptions, + ...providerOptions, + }); case "google": case "googlemaps": return >( diff --git a/src/error/ResponseError.ts b/src/error/ResponseError.ts index c3758df..b6cf97a 100644 --- a/src/error/ResponseError.ts +++ b/src/error/ResponseError.ts @@ -1,9 +1,29 @@ +import { + GoogleMapsResponse, + MapboxResponse, + NominatimResponse, + OpenCageResponse, +} from "provider"; + export default class ResponseError extends Error { public __proto__: ResponseError; - private readonly response: Response; + private readonly response: + | Response + | GoogleMapsResponse + | MapboxResponse + | NominatimResponse + | OpenCageResponse; - public constructor(message: string, response: Response) { + public constructor( + message: string, + response: + | Response + | GoogleMapsResponse + | MapboxResponse + | NominatimResponse + | OpenCageResponse + ) { super(message); this.name = "ResponseError"; this.response = response; @@ -12,7 +32,12 @@ export default class ResponseError extends Error { this.__proto__ = ResponseError.prototype; } - public getResponse(): Response { + public getResponse(): + | Response + | GoogleMapsResponse + | MapboxResponse + | NominatimResponse + | OpenCageResponse { return this.response; } } diff --git a/src/provider/BingProvider.ts b/src/provider/BingProvider.ts index e532936..f2198bd 100644 --- a/src/provider/BingProvider.ts +++ b/src/provider/BingProvider.ts @@ -1,5 +1,10 @@ -import { ExternalLoaderInterface, ExternalLoaderParams } from "ExternalLoader"; import { + ExternalLoaderHeaders, + ExternalLoaderInterface, + ExternalLoaderParams, +} from "ExternalLoader"; +import { + ErrorCallback, GeocodedResultsCallback, ProviderHelpers, ProviderInterface, @@ -69,7 +74,8 @@ export default class BingProvider implements ProviderInterface { public geocode( query: string | GeocodeQuery | GeocodeQueryObject, - callback: GeocodedResultsCallback + callback: GeocodedResultsCallback, + errorCallback?: ErrorCallback ): void { const geocodeQuery = ProviderHelpers.getGeocodeQueryFromParameter(query); @@ -84,13 +90,14 @@ export default class BingProvider implements ProviderInterface { jsonpCallback: this.options.useJsonp ? "jsonp" : undefined, }; - this.executeRequest(params, callback); + this.executeRequest(params, callback, {}, errorCallback); } public geodecode( latitudeOrQuery: number | string | ReverseQuery | ReverseQueryObject, longitudeOrCallback: number | string | GeocodedResultsCallback, - callback?: GeocodedResultsCallback + callbackOrErrorCallback?: GeocodedResultsCallback | ErrorCallback, + errorCallback?: ErrorCallback ): void { const reverseQuery = ProviderHelpers.getReverseQueryFromParameters( latitudeOrQuery, @@ -98,7 +105,12 @@ export default class BingProvider implements ProviderInterface { ); const reverseCallback = ProviderHelpers.getCallbackFromParameters( longitudeOrCallback, - callback + callbackOrErrorCallback + ); + const reverseErrorCallback = ProviderHelpers.getErrorCallbackFromParameters( + longitudeOrCallback, + callbackOrErrorCallback, + errorCallback ); this.externalLoader.setOptions({ @@ -114,20 +126,27 @@ export default class BingProvider implements ProviderInterface { jsonpCallback: this.options.useJsonp ? "jsonp" : undefined, }; - this.executeRequest(params, reverseCallback); + this.executeRequest(params, reverseCallback, {}, reverseErrorCallback); } public executeRequest( params: ExternalLoaderParams, - callback: GeocodedResultsCallback + callback: GeocodedResultsCallback, + headers?: ExternalLoaderHeaders, + errorCallback?: ErrorCallback ): void { - this.externalLoader.executeRequest(params, (data) => { - callback( - data.resourceSets[0].resources.map((result: BingResult) => - BingProvider.mapToGeocoded(result) - ) - ); - }); + this.externalLoader.executeRequest( + params, + (data) => { + callback( + data.resourceSets[0].resources.map((result: BingResult) => + BingProvider.mapToGeocoded(result) + ) + ); + }, + headers, + errorCallback + ); } public static mapToGeocoded(result: BingResult): Geocoded { diff --git a/src/provider/ChainProvider.ts b/src/provider/ChainProvider.ts new file mode 100644 index 0000000..47edca7 --- /dev/null +++ b/src/provider/ChainProvider.ts @@ -0,0 +1,288 @@ +import { ExternalLoaderParams } from "ExternalLoader"; +import Geocoded from "Geocoded"; +import { + ErrorCallback, + GeocodedResultsCallback, + ProviderHelpers, + ProviderInterface, + ProviderOptionsInterface, + defaultProviderOptions, +} from "provider"; +import { + GeocodeQuery, + GeocodeQueryObject, + ReverseQuery, + ReverseQueryObject, +} from "query"; + +export interface ChainProviderOptionsInterface + extends ProviderOptionsInterface { + readonly providers: ProviderInterface[]; + readonly parallelize?: boolean; + readonly first?: boolean; +} + +export const defaultChainProviderOptions = { + ...defaultProviderOptions, + providers: [], +}; + +export default class ChainProvider implements ProviderInterface { + private options: ChainProviderOptionsInterface; + + public constructor( + options: ChainProviderOptionsInterface = defaultChainProviderOptions + ) { + this.options = options; + } + + public geocode( + query: string | GeocodeQuery | GeocodeQueryObject, + callback: GeocodedResultsCallback, + errorCallback?: ErrorCallback + ): void { + if (this.options.parallelize || this.options.first) { + this.geocodeAllProviders(query, callback, errorCallback); + return; + } + + this.geocodeNextProvider( + this.options.providers, + query, + callback, + errorCallback + ); + } + + public geodecode( + latitudeOrQuery: number | string | ReverseQuery | ReverseQueryObject, + longitudeOrCallback: number | string | GeocodedResultsCallback, + callbackOrErrorCallback?: GeocodedResultsCallback | ErrorCallback, + errorCallback?: ErrorCallback + ): void { + const reverseQuery = ProviderHelpers.getReverseQueryFromParameters( + latitudeOrQuery, + longitudeOrCallback + ); + const reverseCallback = ProviderHelpers.getCallbackFromParameters( + longitudeOrCallback, + callbackOrErrorCallback + ); + const reverseErrorCallback = ProviderHelpers.getErrorCallbackFromParameters( + longitudeOrCallback, + callbackOrErrorCallback, + errorCallback + ); + + if (this.options.parallelize || this.options.first) { + this.geodecodeAllProviders( + reverseQuery, + reverseCallback, + reverseErrorCallback + ); + return; + } + + this.geodecodeNextProvider( + this.options.providers, + reverseQuery, + reverseCallback, + reverseErrorCallback + ); + } + + private geocodeNextProvider( + providers: ProviderInterface[], + query: string | GeocodeQuery | GeocodeQueryObject, + callback: GeocodedResultsCallback, + errorCallback?: ErrorCallback + ): void { + const [provider, ...nextProviders] = providers; + const resultCallback: GeocodedResultsCallback = (results) => { + if (results.length > 0) { + callback(results); + return; + } + this.geocodeNextProvider(nextProviders, query, callback, errorCallback); + }; + const resultErrorCallback: ErrorCallback = (responseError) => { + if (errorCallback) { + errorCallback(responseError); + } + if (!errorCallback) { + // eslint-disable-next-line no-console + console.error( + `An error has occurred when geocoding with the provider ${provider.constructor.name}`, + responseError + ); + } + resultCallback([]); + }; + + provider.geocode(query, resultCallback, resultErrorCallback); + } + + private geodecodeNextProvider( + providers: ProviderInterface[], + reverseQuery: ReverseQuery, + callback: GeocodedResultsCallback, + errorCallback?: ErrorCallback + ): void { + const [provider, ...nextProviders] = providers; + const resultCallback: GeocodedResultsCallback = (results) => { + if (results.length > 0) { + callback(results); + return; + } + this.geodecodeNextProvider( + nextProviders, + reverseQuery, + callback, + errorCallback + ); + }; + const resultErrorCallback: ErrorCallback = (responseError) => { + if (errorCallback) { + errorCallback(responseError); + } + if (!errorCallback) { + // eslint-disable-next-line no-console + console.error( + `An error has occurred when geodecoding with the provider ${provider.constructor.name}`, + responseError + ); + } + resultCallback([]); + }; + + provider.geodecode(reverseQuery, resultCallback, resultErrorCallback); + } + + private geocodeAllProviders( + query: string | GeocodeQuery | GeocodeQueryObject, + callback: GeocodedResultsCallback, + errorCallback?: ErrorCallback + ): void { + const providerResults: Map = new Map(); + let callbackCalled = false; + const getProviderResult = () => + this.options.providers.reduce((result, provider) => { + let providerResult = result; + if (undefined === providerResult && this.options.first) { + providerResult = []; + } + if (undefined === providerResult) { + return undefined; + } + if (providerResult.length > 0) { + return providerResult; + } + + return providerResults.get(provider.constructor.name); + }, []); + const resultProviderCallback: ( + providerName: string + ) => GeocodedResultsCallback = (providerName) => (results) => { + providerResults.set(providerName, results); + const providerResult = getProviderResult(); + if (!callbackCalled && providerResult) { + callback(providerResult); + callbackCalled = true; + } + }; + const resultProviderErrorCallback: ( + providerName: string + ) => ErrorCallback = (providerName) => (responseError) => { + if (errorCallback) { + errorCallback(responseError); + } + if (!errorCallback) { + // eslint-disable-next-line no-console + console.error( + `An error has occurred when geocoding with the provider ${providerName}`, + responseError + ); + } + resultProviderCallback(providerName)([]); + }; + + this.options.providers.forEach((provider) => { + const providerName = provider.constructor.name; + provider.geocode( + query, + resultProviderCallback(providerName), + resultProviderErrorCallback(providerName) + ); + }); + } + + private geodecodeAllProviders( + reverseQuery: ReverseQuery, + callback: GeocodedResultsCallback, + errorCallback?: ErrorCallback + ): void { + const providerResults: Map = new Map(); + let callbackCalled = false; + const getProviderResult = () => + this.options.providers.reduce((result, provider) => { + let providerResult = result; + if (undefined === providerResult && this.options.first) { + providerResult = []; + } + if (undefined === providerResult) { + return undefined; + } + if (providerResult.length > 0) { + return providerResult; + } + + return providerResults.get(provider.constructor.name); + }, []); + const resultProviderCallback: ( + providerName: string + ) => GeocodedResultsCallback = (providerName) => (results) => { + providerResults.set(providerName, results); + const providerResult = getProviderResult(); + if (!callbackCalled && providerResult) { + callback(providerResult); + callbackCalled = true; + } + }; + const resultProviderErrorCallback: ( + providerName: string + ) => ErrorCallback = (providerName) => (responseError) => { + if (errorCallback) { + errorCallback(responseError); + } + if (!errorCallback) { + // eslint-disable-next-line no-console + console.error( + `An error has occurred when geodecoding with the provider ${providerName}`, + responseError + ); + } + resultProviderCallback(providerName)([]); + }; + + this.options.providers.forEach((provider) => { + const providerName = provider.constructor.name; + provider.geodecode( + reverseQuery, + resultProviderCallback(providerName), + resultProviderErrorCallback(providerName) + ); + }); + } + + // eslint-disable-next-line class-methods-use-this + public executeRequest( + // eslint-disable-next-line @typescript-eslint/no-unused-vars + params: ExternalLoaderParams, + // eslint-disable-next-line @typescript-eslint/no-unused-vars + callback: GeocodedResultsCallback + ): void { + throw new Error( + "executeRequest cannot be called directly from the chain provider." + ); + } +} diff --git a/src/provider/MapquestProvider.ts b/src/provider/MapquestProvider.ts index ac731c6..8382378 100644 --- a/src/provider/MapquestProvider.ts +++ b/src/provider/MapquestProvider.ts @@ -1,5 +1,10 @@ -import { ExternalLoaderInterface, ExternalLoaderParams } from "ExternalLoader"; import { + ExternalLoaderHeaders, + ExternalLoaderInterface, + ExternalLoaderParams, +} from "ExternalLoader"; +import { + ErrorCallback, GeocodedResultsCallback, ProviderHelpers, ProviderInterface, @@ -70,7 +75,8 @@ export default class MapQuestProvider implements ProviderInterface { public geocode( query: string | GeocodeQuery | GeocodeQueryObject, - callback: GeocodedResultsCallback + callback: GeocodedResultsCallback, + errorCallback?: ErrorCallback ): void { const geocodeQuery = ProviderHelpers.getGeocodeQueryFromParameter(query); @@ -86,13 +92,14 @@ export default class MapQuestProvider implements ProviderInterface { jsonpCallback: this.options.useJsonp ? "callback" : undefined, }; - this.executeRequest(params, callback); + this.executeRequest(params, callback, {}, errorCallback); } public geodecode( latitudeOrQuery: number | string | ReverseQuery | ReverseQueryObject, longitudeOrCallback: number | string | GeocodedResultsCallback, - callback?: GeocodedResultsCallback + callbackOrErrorCallback?: GeocodedResultsCallback | ErrorCallback, + errorCallback?: ErrorCallback ): void { const reverseQuery = ProviderHelpers.getReverseQueryFromParameters( latitudeOrQuery, @@ -100,7 +107,12 @@ export default class MapQuestProvider implements ProviderInterface { ); const reverseCallback = ProviderHelpers.getCallbackFromParameters( longitudeOrCallback, - callback + callbackOrErrorCallback + ); + const reverseErrorCallback = ProviderHelpers.getErrorCallbackFromParameters( + longitudeOrCallback, + callbackOrErrorCallback, + errorCallback ); this.externalLoader.setOptions({ @@ -117,20 +129,27 @@ export default class MapQuestProvider implements ProviderInterface { jsonpCallback: this.options.useJsonp ? "callback" : undefined, }; - this.executeRequest(params, reverseCallback); + this.executeRequest(params, reverseCallback, {}, reverseErrorCallback); } public executeRequest( params: ExternalLoaderParams, - callback: GeocodedResultsCallback + callback: GeocodedResultsCallback, + headers?: ExternalLoaderHeaders, + errorCallback?: ErrorCallback ): void { - this.externalLoader.executeRequest(params, (data) => { - callback( - data.results[0].locations.map((result: MapQuestResult) => - MapQuestProvider.mapToGeocoded(result) - ) - ); - }); + this.externalLoader.executeRequest( + params, + (data) => { + callback( + data.results[0].locations.map((result: MapQuestResult) => + MapQuestProvider.mapToGeocoded(result) + ) + ); + }, + headers, + errorCallback + ); } public static mapToGeocoded(result: MapQuestResult): Geocoded { diff --git a/src/provider/ProviderHelpers.ts b/src/provider/ProviderHelpers.ts index 05fa086..7da92fc 100644 --- a/src/provider/ProviderHelpers.ts +++ b/src/provider/ProviderHelpers.ts @@ -1,4 +1,4 @@ -import { GeocodedResultsCallback } from "provider"; +import { ErrorCallback, GeocodedResultsCallback } from "provider"; import { GeocodeQuery, GeocodeQueryObject, @@ -54,7 +54,7 @@ export default class ProviderHelpers { public static getCallbackFromParameters( longitudeOrCallback: number | string | GeocodedResultsCallback, - callback?: GeocodedResultsCallback + callbackOrErrorCallback?: GeocodedResultsCallback | ErrorCallback ): GeocodedResultsCallback { if ( !( @@ -64,12 +64,31 @@ export default class ProviderHelpers { ) { return longitudeOrCallback; } - if (callback) { - return callback; + if (callbackOrErrorCallback) { + return callbackOrErrorCallback; } throw new Error( "A callback must be set at the last parameter of geodecode" ); } + + public static getErrorCallbackFromParameters( + longitudeOrCallback: number | string | GeocodedResultsCallback, + callbackOrErrorCallback?: GeocodedResultsCallback | ErrorCallback, + errorCallback?: ErrorCallback + ): undefined | ErrorCallback { + if (errorCallback) { + return errorCallback; + } + + if ( + typeof longitudeOrCallback === "number" || + typeof longitudeOrCallback === "string" + ) { + return undefined; + } + + return callbackOrErrorCallback; + } } diff --git a/src/provider/ProviderInterface.ts b/src/provider/ProviderInterface.ts index 66f067a..9d5c5bf 100644 --- a/src/provider/ProviderInterface.ts +++ b/src/provider/ProviderInterface.ts @@ -1,8 +1,4 @@ -import { - ErrorCallback, - ExternalLoaderHeaders, - ExternalLoaderParams, -} from "ExternalLoader"; +import { ExternalLoaderHeaders, ExternalLoaderParams } from "ExternalLoader"; import Geocoded from "Geocoded"; import { GeocodeQuery, @@ -10,6 +6,7 @@ import { ReverseQuery, ReverseQueryObject, } from "query"; +import { ResponseError } from "error"; export const DEFAULT_RESULT_LIMIT = 5; @@ -25,16 +22,19 @@ export interface ProviderOptionsInterface { } export type GeocodedResultsCallback = (results: Geocoded[]) => void; +export type ErrorCallback = (responseError: ResponseError) => void; export default interface ProviderInterface { geocode( query: string | GeocodeQuery | GeocodeQueryObject, - callback: GeocodedResultsCallback + callback: GeocodedResultsCallback, + errorCallback?: ErrorCallback ): void; geodecode( latitudeOrQuery: number | string | ReverseQuery | ReverseQueryObject, longitudeOrCallback: number | string | GeocodedResultsCallback, - callback?: GeocodedResultsCallback + callbackOrErrorCallback?: GeocodedResultsCallback | ErrorCallback, + errorCallback?: ErrorCallback ): void; executeRequest( params: ExternalLoaderParams, diff --git a/src/provider/YandexProvider.ts b/src/provider/YandexProvider.ts index fef5304..78fe75e 100644 --- a/src/provider/YandexProvider.ts +++ b/src/provider/YandexProvider.ts @@ -1,5 +1,10 @@ -import { ExternalLoaderInterface, ExternalLoaderParams } from "ExternalLoader"; import { + ExternalLoaderHeaders, + ExternalLoaderInterface, + ExternalLoaderParams, +} from "ExternalLoader"; +import { + ErrorCallback, GeocodedResultsCallback, ProviderHelpers, ProviderInterface, @@ -101,7 +106,8 @@ export default class YandexProvider implements ProviderInterface { public geocode( query: string | GeocodeQuery | GeocodeQueryObject, - callback: GeocodedResultsCallback + callback: GeocodedResultsCallback, + errorCallback?: ErrorCallback ): void { const geocodeQuery = ProviderHelpers.getGeocodeQueryFromParameter(query); @@ -119,13 +125,14 @@ export default class YandexProvider implements ProviderInterface { jsonpCallback: this.options.useJsonp ? "callback" : undefined, }; - this.executeRequest(params, callback); + this.executeRequest(params, callback, {}, errorCallback); } public geodecode( latitudeOrQuery: number | string | ReverseQuery | ReverseQueryObject, longitudeOrCallback: number | string | GeocodedResultsCallback, - callback?: GeocodedResultsCallback + callbackOrErrorCallback?: GeocodedResultsCallback | ErrorCallback, + errorCallback?: ErrorCallback ): void { const reverseQuery = ProviderHelpers.getReverseQueryFromParameters( latitudeOrQuery, @@ -133,7 +140,12 @@ export default class YandexProvider implements ProviderInterface { ); const reverseCallback = ProviderHelpers.getCallbackFromParameters( longitudeOrCallback, - callback + callbackOrErrorCallback + ); + const reverseErrorCallback = ProviderHelpers.getErrorCallbackFromParameters( + longitudeOrCallback, + callbackOrErrorCallback, + errorCallback ); this.externalLoader.setOptions({ @@ -153,21 +165,28 @@ export default class YandexProvider implements ProviderInterface { jsonpCallback: this.options.useJsonp ? "callback" : undefined, }; - this.executeRequest(params, reverseCallback); + this.executeRequest(params, reverseCallback, {}, reverseErrorCallback); } public executeRequest( params: ExternalLoaderParams, - callback: GeocodedResultsCallback + callback: GeocodedResultsCallback, + headers?: ExternalLoaderHeaders, + errorCallback?: ErrorCallback ): void { - this.externalLoader.executeRequest(params, (data) => { - callback( - data.response.GeoObjectCollection.featureMember.map( - (result: YandexCollectionResult) => - YandexProvider.mapToGeocoded(result.GeoObject) - ) - ); - }); + this.externalLoader.executeRequest( + params, + (data) => { + callback( + data.response.GeoObjectCollection.featureMember.map( + (result: YandexCollectionResult) => + YandexProvider.mapToGeocoded(result.GeoObject) + ) + ); + }, + headers, + errorCallback + ); } public static mapToGeocoded(result: YandexResult): Geocoded { diff --git a/src/provider/googlemaps/GoogleMapsProvider.ts b/src/provider/googlemaps/GoogleMapsProvider.ts index aa3042a..f258d66 100644 --- a/src/provider/googlemaps/GoogleMapsProvider.ts +++ b/src/provider/googlemaps/GoogleMapsProvider.ts @@ -1,5 +1,10 @@ -import { ExternalLoaderInterface, ExternalLoaderParams } from "ExternalLoader"; import { + ExternalLoaderHeaders, + ExternalLoaderInterface, + ExternalLoaderParams, +} from "ExternalLoader"; +import { + ErrorCallback, GeocodedResultsCallback, GoogleMapsGeocoded, GoogleMapsGeocodeQuery, @@ -12,6 +17,7 @@ import { defaultProviderOptions, } from "provider"; import AdminLevel from "AdminLevel"; +import { ResponseError } from "error"; import { decodeBase64, decodeUrlSafeBase64, @@ -96,7 +102,7 @@ type GoogleMapsPlaceType = | "transit_station" | "ward"; -interface GoogleMapsResponse { +export interface GoogleMapsResponse { results: GoogleMapsResult[]; status: | "OK" @@ -197,7 +203,8 @@ export default class GoogleMapsProvider implements ProviderInterface { public geocode( query: string | GoogleMapsGeocodeQuery | GoogleMapsGeocodeQueryObject, - callback: GeocodedResultsCallback + callback: GeocodedResultsCallback, + errorCallback?: ErrorCallback ): void { const geocodeQuery = ProviderHelpers.getGeocodeQueryFromParameter( query, @@ -233,7 +240,7 @@ export default class GoogleMapsProvider implements ProviderInterface { geocodeQuery ); - this.executeRequest(params, callback); + this.executeRequest(params, callback, {}, errorCallback); } public geodecode( @@ -243,7 +250,8 @@ export default class GoogleMapsProvider implements ProviderInterface { | GoogleMapsReverseQuery | GoogleMapsReverseQueryObject, longitudeOrCallback: number | string | GeocodedResultsCallback, - callback?: GeocodedResultsCallback + callbackOrErrorCallback?: GeocodedResultsCallback | ErrorCallback, + errorCallback?: ErrorCallback ): void { const reverseQuery = ProviderHelpers.getReverseQueryFromParameters( latitudeOrQuery, @@ -252,7 +260,12 @@ export default class GoogleMapsProvider implements ProviderInterface { ); const reverseCallback = ProviderHelpers.getCallbackFromParameters( longitudeOrCallback, - callback + callbackOrErrorCallback + ); + const reverseErrorCallback = ProviderHelpers.getErrorCallbackFromParameters( + longitudeOrCallback, + callbackOrErrorCallback, + errorCallback ); this.externalLoader.setOptions({ @@ -276,7 +289,7 @@ export default class GoogleMapsProvider implements ProviderInterface { reverseQuery ); - this.executeRequest(params, reverseCallback); + this.executeRequest(params, reverseCallback, {}, reverseErrorCallback); } private withCommonParams( @@ -317,49 +330,60 @@ export default class GoogleMapsProvider implements ProviderInterface { public executeRequest( params: ExternalLoaderParams, - callback: GeocodedResultsCallback + callback: GeocodedResultsCallback, + headers?: ExternalLoaderHeaders, + errorCallback?: ErrorCallback ): void { const { limit, ...externalLoaderParams } = params; this.externalLoader.executeRequest( externalLoaderParams, (data: GoogleMapsResponse) => { - let errorMessage; + let errorMessage: undefined | string; switch (data.status) { case "REQUEST_DENIED": errorMessage = "Request has been denied"; if (data.error_message) { errorMessage += `: ${data.error_message}`; } - throw new Error(errorMessage); + break; case "OVER_QUERY_LIMIT": errorMessage = "Exceeded daily quota when attempting geocoding request"; if (data.error_message) { errorMessage += `: ${data.error_message}`; } - throw new Error(errorMessage); + break; case "OVER_DAILY_LIMIT": errorMessage = "API usage has been limited"; if (data.error_message) { errorMessage += `: ${data.error_message}`; } - throw new Error(errorMessage); + break; case "INVALID_REQUEST": errorMessage = "The request is invalid"; if (data.error_message) { errorMessage += `: ${data.error_message}`; } - throw new Error(errorMessage); + break; case "UNKNOWN_ERROR": errorMessage = "Unknown error"; if (data.error_message) { errorMessage += `: ${data.error_message}`; } - throw new Error(errorMessage); + break; default: // Intentionnaly left empty } + if (errorMessage && errorCallback) { + errorCallback(new ResponseError(errorMessage, data)); + return; + } + if (errorMessage) { + setTimeout(() => { + throw new Error(errorMessage); + }); + } const { results } = data; const resultsToRemove = @@ -373,7 +397,9 @@ export default class GoogleMapsProvider implements ProviderInterface { GoogleMapsProvider.mapToGeocoded(result) ) ); - } + }, + headers, + errorCallback ); } diff --git a/src/provider/index.ts b/src/provider/index.ts index d4737a1..552f0c9 100644 --- a/src/provider/index.ts +++ b/src/provider/index.ts @@ -3,6 +3,8 @@ export { default as ProviderInterface } from "provider/ProviderInterface"; export * from "provider/ProviderInterface"; export { default as BingProvider } from "provider/BingProvider"; export * from "provider/BingProvider"; +export { default as ChainProvider } from "provider/ChainProvider"; +export * from "provider/ChainProvider"; export * from "provider/googlemaps"; export * from "provider/mapbox"; export { default as MapquestProvider } from "provider/MapquestProvider"; diff --git a/src/provider/mapbox/MapboxProvider.ts b/src/provider/mapbox/MapboxProvider.ts index d39c23c..ad4479a 100644 --- a/src/provider/mapbox/MapboxProvider.ts +++ b/src/provider/mapbox/MapboxProvider.ts @@ -1,5 +1,10 @@ -import { ExternalLoaderInterface, ExternalLoaderParams } from "ExternalLoader"; import { + ExternalLoaderHeaders, + ExternalLoaderInterface, + ExternalLoaderParams, +} from "ExternalLoader"; +import { + ErrorCallback, GeocodedResultsCallback, MapboxGeocoded, MapboxGeocodeQuery, @@ -27,7 +32,7 @@ interface MapboxRequestParams { readonly types?: string; } -interface MapboxResponse { +export interface MapboxResponse { type: "FeatureCollection"; query: string[]; features: MapboxResult[]; @@ -131,7 +136,8 @@ export default class MapboxProvider implements ProviderInterface { public geocode( query: string | MapboxGeocodeQuery | MapboxGeocodeQueryObject, - callback: GeocodedResultsCallback + callback: GeocodedResultsCallback, + errorCallback?: ErrorCallback ): void { const geocodeQuery = ProviderHelpers.getGeocodeQueryFromParameter( query, @@ -167,7 +173,7 @@ export default class MapboxProvider implements ProviderInterface { geocodeQuery ); - this.executeRequest(params, callback); + this.executeRequest(params, callback, {}, errorCallback); } public geodecode( @@ -177,7 +183,8 @@ export default class MapboxProvider implements ProviderInterface { | MapboxReverseQuery | MapboxReverseQueryObject, longitudeOrCallback: number | string | GeocodedResultsCallback, - callback?: GeocodedResultsCallback + callbackOrErrorCallback?: GeocodedResultsCallback | ErrorCallback, + errorCallback?: ErrorCallback ): void { const reverseQuery = ProviderHelpers.getReverseQueryFromParameters( latitudeOrQuery, @@ -186,7 +193,12 @@ export default class MapboxProvider implements ProviderInterface { ); const reverseCallback = ProviderHelpers.getCallbackFromParameters( longitudeOrCallback, - callback + callbackOrErrorCallback + ); + const reverseErrorCallback = ProviderHelpers.getErrorCallbackFromParameters( + longitudeOrCallback, + callbackOrErrorCallback, + errorCallback ); this.externalLoader.setOptions({ @@ -209,7 +221,7 @@ export default class MapboxProvider implements ProviderInterface { reverseQuery ); - this.executeRequest(params, reverseCallback); + this.executeRequest(params, reverseCallback, {}, reverseErrorCallback); } private withCommonParams( @@ -232,15 +244,22 @@ export default class MapboxProvider implements ProviderInterface { public executeRequest( params: ExternalLoaderParams, - callback: GeocodedResultsCallback + callback: GeocodedResultsCallback, + headers?: ExternalLoaderHeaders, + errorCallback?: ErrorCallback ): void { - this.externalLoader.executeRequest(params, (data: MapboxResponse) => { - callback( - data.features.map((result: MapboxResult) => - MapboxProvider.mapToGeocoded(result) - ) - ); - }); + this.externalLoader.executeRequest( + params, + (data: MapboxResponse) => { + callback( + data.features.map((result: MapboxResult) => + MapboxProvider.mapToGeocoded(result) + ) + ); + }, + headers, + errorCallback + ); } public static mapToGeocoded(result: MapboxResult): MapboxGeocoded { diff --git a/src/provider/nominatim/NominatimProvider.ts b/src/provider/nominatim/NominatimProvider.ts index 37303be..5442495 100644 --- a/src/provider/nominatim/NominatimProvider.ts +++ b/src/provider/nominatim/NominatimProvider.ts @@ -4,6 +4,7 @@ import { ExternalLoaderParams, } from "ExternalLoader"; import { + ErrorCallback, GeocodedResultsCallback, NominatimGeocoded, NominatimReverseQuery, @@ -16,6 +17,7 @@ import { defaultProviderOptions, } from "provider"; import AdminLevel from "AdminLevel"; +import { ResponseError } from "error"; interface NominatimRequestParams { [param: string]: string | undefined; @@ -36,6 +38,15 @@ interface NominatimRequestParams { readonly jsonpCallback?: string; } +interface NominatimErrorResponse { + error: string; +} + +export type NominatimResponse = + | NominatimErrorResponse + | NominatimResult + | NominatimResult[]; + export interface NominatimResult { // eslint-disable-next-line camelcase place_id: number; @@ -110,7 +121,8 @@ export default class NominatimProvider implements ProviderInterface { public geocode( query: string | NominatimGeocodeQuery | NominatimGeocodeQueryObject, - callback: GeocodedResultsCallback + callback: GeocodedResultsCallback, + errorCallback?: ErrorCallback ): void { const geocodeQuery = ProviderHelpers.getGeocodeQueryFromParameter( query, @@ -147,7 +159,7 @@ export default class NominatimProvider implements ProviderInterface { geocodeQuery ); - this.executeRequest(params, callback, this.getHeaders()); + this.executeRequest(params, callback, this.getHeaders(), errorCallback); } public geodecode( @@ -157,7 +169,8 @@ export default class NominatimProvider implements ProviderInterface { | NominatimReverseQuery | NominatimReverseQueryObject, longitudeOrCallback: number | string | GeocodedResultsCallback, - callback?: GeocodedResultsCallback + callbackOrErrorCallback?: GeocodedResultsCallback | ErrorCallback, + errorCallback?: ErrorCallback ): void { const reverseQuery = ProviderHelpers.getReverseQueryFromParameters( latitudeOrQuery, @@ -166,7 +179,12 @@ export default class NominatimProvider implements ProviderInterface { ); const reverseCallback = ProviderHelpers.getCallbackFromParameters( longitudeOrCallback, - callback + callbackOrErrorCallback + ); + const reverseErrorCallback = ProviderHelpers.getErrorCallbackFromParameters( + longitudeOrCallback, + callbackOrErrorCallback, + errorCallback ); this.externalLoader.setOptions({ @@ -185,7 +203,12 @@ export default class NominatimProvider implements ProviderInterface { reverseQuery ); - this.executeRequest(params, reverseCallback, this.getHeaders()); + this.executeRequest( + params, + reverseCallback, + this.getHeaders(), + reverseErrorCallback + ); } private withCommonParams( @@ -211,25 +234,36 @@ export default class NominatimProvider implements ProviderInterface { public executeRequest( params: ExternalLoaderParams, callback: GeocodedResultsCallback, - headers?: ExternalLoaderHeaders + headers?: ExternalLoaderHeaders, + errorCallback?: ErrorCallback ): void { this.externalLoader.executeRequest( params, - (data) => { + (data: NominatimResponse) => { let results = data; if (!Array.isArray(data)) { - if (data.error) { - throw new Error(`An error has occurred: ${data.error}`); + if ((data).error) { + const errorMessage = `An error has occurred: ${ + (data).error + }`; + if (errorCallback) { + errorCallback(new ResponseError(errorMessage, data)); + return; + } + setTimeout(() => { + throw new Error(errorMessage); + }); } - results = [data]; + results = [data]; } callback( - results.map((result: NominatimResult) => + (results).map((result: NominatimResult) => NominatimProvider.mapToGeocoded(result) ) ); }, - headers + headers, + errorCallback ); } diff --git a/src/provider/opencage/OpenCageProvider.ts b/src/provider/opencage/OpenCageProvider.ts index a9a7881..8efc8bf 100644 --- a/src/provider/opencage/OpenCageProvider.ts +++ b/src/provider/opencage/OpenCageProvider.ts @@ -1,5 +1,10 @@ -import { ExternalLoaderInterface, ExternalLoaderParams } from "ExternalLoader"; import { + ExternalLoaderHeaders, + ExternalLoaderInterface, + ExternalLoaderParams, +} from "ExternalLoader"; +import { + ErrorCallback, GeocodedResultsCallback, OpenCageGeocoded, OpenCageGeocodeQuery, @@ -12,6 +17,7 @@ import { defaultProviderOptions, } from "provider"; import AdminLevel from "AdminLevel"; +import { ResponseError } from "error"; interface OpenCageRequestParams { [param: string]: string | undefined; @@ -41,7 +47,7 @@ interface OpenCageSun { nautical: number; } -interface OpenCageResponse { +export interface OpenCageResponse { documentation: string; licences: { name: string; @@ -291,7 +297,8 @@ export default class OpenCageProvider implements ProviderInterface { public geocode( query: string | OpenCageGeocodeQuery | OpenCageGeocodeQueryObject, - callback: GeocodedResultsCallback + callback: GeocodedResultsCallback, + errorCallback?: ErrorCallback ): void { const geocodeQuery = ProviderHelpers.getGeocodeQueryFromParameter( query, @@ -323,7 +330,7 @@ export default class OpenCageProvider implements ProviderInterface { geocodeQuery ); - this.executeRequest(params, callback); + this.executeRequest(params, callback, {}, errorCallback); } public geodecode( @@ -333,7 +340,8 @@ export default class OpenCageProvider implements ProviderInterface { | OpenCageReverseQuery | OpenCageReverseQueryObject, longitudeOrCallback: number | string | GeocodedResultsCallback, - callback?: GeocodedResultsCallback + callbackOrErrorCallback?: GeocodedResultsCallback | ErrorCallback, + errorCallback?: ErrorCallback ): void { const reverseQuery = ProviderHelpers.getReverseQueryFromParameters( latitudeOrQuery, @@ -342,7 +350,12 @@ export default class OpenCageProvider implements ProviderInterface { ); const reverseCallback = ProviderHelpers.getCallbackFromParameters( longitudeOrCallback, - callback + callbackOrErrorCallback + ); + const reverseErrorCallback = ProviderHelpers.getErrorCallbackFromParameters( + longitudeOrCallback, + callbackOrErrorCallback, + errorCallback ); this.externalLoader.setOptions({ @@ -360,7 +373,7 @@ export default class OpenCageProvider implements ProviderInterface { reverseQuery ); - this.executeRequest(params, reverseCallback); + this.executeRequest(params, reverseCallback, {}, reverseErrorCallback); } private withCommonParams( @@ -383,7 +396,9 @@ export default class OpenCageProvider implements ProviderInterface { public executeRequest( params: ExternalLoaderParams, - callback: GeocodedResultsCallback + callback: GeocodedResultsCallback, + headers?: ExternalLoaderHeaders, + errorCallback?: ErrorCallback ): void { this.externalLoader.executeRequest( params, @@ -394,57 +409,55 @@ export default class OpenCageProvider implements ProviderInterface { ) ); }, - {}, + headers, (error) => { - error - .getResponse() - .json() - .then((data: OpenCageResponse) => { - if (data.status) { - switch (data.status.code) { - case 400: - throw new Error( - `Invalid request (400): ${data.status.message}` - ); - case 401: - throw new Error( - `Unable to authenticate (401): ${data.status.message}` - ); - case 402: - throw new Error( - `Quota exceeded (402): ${data.status.message}` - ); - case 403: - throw new Error(`Forbidden (403): ${data.status.message}`); - case 404: - throw new Error( - `Invalid API endpoint (404): ${data.status.message}` - ); - case 405: - throw new Error( - `Method not allowed (405): ${data.status.message}` - ); - case 408: - throw new Error(`Timeout (408): ${data.status.message}`); - case 410: - throw new Error( - `Request too long (410): ${data.status.message}` - ); - case 429: - throw new Error( - `Too many requests (429): ${data.status.message}` - ); - case 503: - throw new Error( - `Internal server error (503): ${data.status.message}` - ); - default: - throw new Error( - `Error (${data.status.code}): ${data.status.message}` - ); - } + const response = error.getResponse(); + response.json().then((data: OpenCageResponse) => { + if (data.status) { + let errorMessage: string; + switch (data.status.code) { + case 400: + errorMessage = `Invalid request (400): ${data.status.message}`; + break; + case 401: + errorMessage = `Unable to authenticate (401): ${data.status.message}`; + break; + case 402: + errorMessage = `Quota exceeded (402): ${data.status.message}`; + break; + case 403: + errorMessage = `Forbidden (403): ${data.status.message}`; + break; + case 404: + errorMessage = `Invalid API endpoint (404): ${data.status.message}`; + break; + case 405: + errorMessage = `Method not allowed (405): ${data.status.message}`; + break; + case 408: + errorMessage = `Timeout (408): ${data.status.message}`; + break; + case 410: + errorMessage = `Request too long (410): ${data.status.message}`; + break; + case 429: + errorMessage = `Too many requests (429): ${data.status.message}`; + break; + case 503: + errorMessage = `Internal server error (503): ${data.status.message}`; + break; + default: + errorMessage = `Error (${data.status.code}): ${data.status.message}`; + } + if (errorCallback) { + errorCallback(new ResponseError(errorMessage, data)); + return; } - }); + setTimeout(() => { + throw new Error(errorMessage); + }); + } + }); } ); } diff --git a/types/ExternalLoader.d.ts b/types/ExternalLoader.d.ts index b4432f6..904813d 100644 --- a/types/ExternalLoader.d.ts +++ b/types/ExternalLoader.d.ts @@ -1,4 +1,4 @@ -import { ResponseError } from "./error"; +import { ErrorCallback } from "./provider"; export interface ExternalLoaderInterface { setOptions(options: ExternalLoaderOptions): void; getOptions(): ExternalLoaderOptions; @@ -17,7 +17,6 @@ export interface ExternalLoaderHeaders { [header: string]: string | undefined; } declare type ResponseCallback = (response: any) => void; -export declare type ErrorCallback = (responseError: ResponseError) => void; /** * Load data from external geocoding engines. */ diff --git a/types/ExternalLoader.d.ts.map b/types/ExternalLoader.d.ts.map index a82e205..6c4e64d 100644 --- a/types/ExternalLoader.d.ts.map +++ b/types/ExternalLoader.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"ExternalLoader.d.ts","sourceRoot":"","sources":["../src/ExternalLoader.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,gBAAc;AAGtC,MAAM,WAAW,uBAAuB;IACtC,UAAU,CAAC,OAAO,EAAE,qBAAqB,GAAG,IAAI,CAAC;IACjD,UAAU,IAAI,qBAAqB,CAAC;IACpC,cAAc,CACZ,MAAM,EAAE,oBAAoB,EAC5B,QAAQ,EAAE,gBAAgB,EAC1B,OAAO,CAAC,EAAE,qBAAqB,EAC/B,aAAa,CAAC,EAAE,aAAa,GAC5B,IAAI,CAAC;CACT;AAED,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED,MAAM,WAAW,oBAAoB;IACnC,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;IACpC,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,qBAAqB;IACpC,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;CACtC;AAGD,aAAK,gBAAgB,GAAG,CAAC,QAAQ,EAAE,GAAG,KAAK,IAAI,CAAC;AAChD,oBAAY,aAAa,GAAG,CAAC,aAAa,EAAE,aAAa,KAAK,IAAI,CAAC;AAMnE;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,cAAe,YAAW,uBAAuB;IACpE,OAAO,CAAC,OAAO,CAAyC;gBAErC,OAAO,GAAE,qBAAsC;IAI3D,UAAU,CAAC,OAAO,EAAE,qBAAqB,GAAG,IAAI;IAIhD,UAAU,IAAI,qBAAqB;IAInC,cAAc,CACnB,MAAM,EAAE,oBAAoB,EAC5B,QAAQ,EAAE,gBAAgB,EAC1B,qBAAqB,CAAC,EAAE,qBAAqB,EAC7C,aAAa,CAAC,EAAE,aAAa,GAC5B,IAAI;IAkDP,OAAO,CAAC,MAAM,CAAC,gBAAgB;IA0B/B;;;OAGG;IACH,OAAO,CAAC,MAAM,CAAC,qBAAqB;CAoBrC"} \ No newline at end of file +{"version":3,"file":"ExternalLoader.d.ts","sourceRoot":"","sources":["../src/ExternalLoader.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,mBAAiB;AAIzC,MAAM,WAAW,uBAAuB;IACtC,UAAU,CAAC,OAAO,EAAE,qBAAqB,GAAG,IAAI,CAAC;IACjD,UAAU,IAAI,qBAAqB,CAAC;IACpC,cAAc,CACZ,MAAM,EAAE,oBAAoB,EAC5B,QAAQ,EAAE,gBAAgB,EAC1B,OAAO,CAAC,EAAE,qBAAqB,EAC/B,aAAa,CAAC,EAAE,aAAa,GAC5B,IAAI,CAAC;CACT;AAED,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED,MAAM,WAAW,oBAAoB;IACnC,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;IACpC,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,qBAAqB;IACpC,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;CACtC;AAGD,aAAK,gBAAgB,GAAG,CAAC,QAAQ,EAAE,GAAG,KAAK,IAAI,CAAC;AAMhD;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,cAAe,YAAW,uBAAuB;IACpE,OAAO,CAAC,OAAO,CAAyC;gBAErC,OAAO,GAAE,qBAAsC;IAI3D,UAAU,CAAC,OAAO,EAAE,qBAAqB,GAAG,IAAI;IAIhD,UAAU,IAAI,qBAAqB;IAInC,cAAc,CACnB,MAAM,EAAE,oBAAoB,EAC5B,QAAQ,EAAE,gBAAgB,EAC1B,qBAAqB,CAAC,EAAE,qBAAqB,EAC7C,aAAa,CAAC,EAAE,aAAa,GAC5B,IAAI;IAoDP,OAAO,CAAC,MAAM,CAAC,gBAAgB;IA0B/B;;;OAGG;IACH,OAAO,CAAC,MAAM,CAAC,qBAAqB;CAoBrC"} \ No newline at end of file diff --git a/types/GeocoderProviderFactory.d.ts b/types/GeocoderProviderFactory.d.ts index e816867..011acd9 100644 --- a/types/GeocoderProviderFactory.d.ts +++ b/types/GeocoderProviderFactory.d.ts @@ -1,9 +1,12 @@ -import { BingProvider, GoogleMapsProvider, GoogleMapsProviderOptionsInterface, MapboxProvider, MapboxProviderOptionsInterface, MapquestProvider, NominatimProvider, NominatimProviderOptionsInterface, OpenCageProvider, OpenCageProviderOptionsInterface, YandexProvider, YandexProviderOptionsInterface, ProviderOptionsInterface } from "./provider"; +import { BingProvider, ChainProvider, ChainProviderOptionsInterface, GoogleMapsProvider, GoogleMapsProviderOptionsInterface, MapboxProvider, MapboxProviderOptionsInterface, MapquestProvider, NominatimProvider, NominatimProviderOptionsInterface, OpenCageProvider, OpenCageProviderOptionsInterface, YandexProvider, YandexProviderOptionsInterface, ProviderOptionsInterface } from "./provider"; interface ProviderOptionInterface { - provider: "bing" | "google" | "googlemaps" | "mapbox" | "mapquest" | "nominatim" | "opencage" | "openstreetmap" | "yandex"; + provider: "bing" | "chain" | "google" | "googlemaps" | "mapbox" | "mapquest" | "nominatim" | "opencage" | "openstreetmap" | "yandex"; } interface ProviderFactoryOptions extends ProviderOptionsInterface, ProviderOptionInterface { } +interface ChainGeocoderProviderFactoryOptions extends ProviderOptionInterface, ChainProviderOptionsInterface { + provider: "chain"; +} interface GoogleMapsGeocoderProviderFactoryOptions extends ProviderOptionInterface, GoogleMapsProviderOptionsInterface { provider: "google" | "googlemaps"; } @@ -19,9 +22,9 @@ interface OpenCageGeocoderProviderFactoryOptions extends ProviderOptionInterface interface YandexGeocoderProviderFactoryOptions extends ProviderOptionInterface, YandexProviderOptionsInterface { provider: "yandex"; } -export declare type GeocoderProviderFactoryOptions = ProviderFactoryOptions | GoogleMapsGeocoderProviderFactoryOptions | MapboxGeocoderProviderFactoryOptions | NominatimGeocoderProviderFactoryOptions | OpenCageGeocoderProviderFactoryOptions | YandexGeocoderProviderFactoryOptions; -export declare type GeocoderProvider = BingProvider | GoogleMapsProvider | MapboxProvider | MapquestProvider | NominatimProvider | OpenCageProvider | YandexProvider; -export declare type GeocoderProviderByOptionsType = O extends GoogleMapsGeocoderProviderFactoryOptions ? GoogleMapsProvider : O extends MapboxGeocoderProviderFactoryOptions ? MapboxProvider : O extends NominatimGeocoderProviderFactoryOptions ? NominatimProvider : O extends OpenCageGeocoderProviderFactoryOptions ? OpenCageProvider : O extends YandexGeocoderProviderFactoryOptions ? YandexProvider : GeocoderProvider; +export declare type GeocoderProviderFactoryOptions = ProviderFactoryOptions | ChainGeocoderProviderFactoryOptions | GoogleMapsGeocoderProviderFactoryOptions | MapboxGeocoderProviderFactoryOptions | NominatimGeocoderProviderFactoryOptions | OpenCageGeocoderProviderFactoryOptions | YandexGeocoderProviderFactoryOptions; +export declare type GeocoderProvider = BingProvider | ChainProvider | GoogleMapsProvider | MapboxProvider | MapquestProvider | NominatimProvider | OpenCageProvider | YandexProvider; +export declare type GeocoderProviderByOptionsType = O extends ChainGeocoderProviderFactoryOptions ? ChainProvider : O extends GoogleMapsGeocoderProviderFactoryOptions ? GoogleMapsProvider : O extends MapboxGeocoderProviderFactoryOptions ? MapboxProvider : O extends NominatimGeocoderProviderFactoryOptions ? NominatimProvider : O extends OpenCageGeocoderProviderFactoryOptions ? OpenCageProvider : O extends YandexGeocoderProviderFactoryOptions ? YandexProvider : GeocoderProvider; export default class ProviderFactory { /** * Creates Geocoder Provider instances. diff --git a/types/GeocoderProviderFactory.d.ts.map b/types/GeocoderProviderFactory.d.ts.map index ee2bffa..7d8286a 100644 --- a/types/GeocoderProviderFactory.d.ts.map +++ b/types/GeocoderProviderFactory.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"GeocoderProviderFactory.d.ts","sourceRoot":"","sources":["../src/GeocoderProviderFactory.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,kBAAkB,EAClB,kCAAkC,EAClC,cAAc,EACd,8BAA8B,EAC9B,gBAAgB,EAChB,iBAAiB,EACjB,iCAAiC,EACjC,gBAAgB,EAChB,gCAAgC,EAChC,cAAc,EACd,8BAA8B,EAC9B,wBAAwB,EAKzB,mBAAiB;AAGlB,UAAU,uBAAuB;IAC/B,QAAQ,EACJ,MAAM,GACN,QAAQ,GACR,YAAY,GACZ,QAAQ,GACR,UAAU,GACV,WAAW,GACX,UAAU,GACV,eAAe,GACf,QAAQ,CAAC;CACd;AAED,UAAU,sBACR,SAAQ,wBAAwB,EAC9B,uBAAuB;CAAG;AAE9B,UAAU,wCACR,SAAQ,uBAAuB,EAC7B,kCAAkC;IACpC,QAAQ,EAAE,QAAQ,GAAG,YAAY,CAAC;CACnC;AAED,UAAU,oCACR,SAAQ,uBAAuB,EAC7B,8BAA8B;IAChC,QAAQ,EAAE,QAAQ,CAAC;CACpB;AAED,UAAU,uCACR,SAAQ,uBAAuB,EAC7B,iCAAiC;IACnC,QAAQ,EAAE,WAAW,GAAG,eAAe,CAAC;CACzC;AAED,UAAU,sCACR,SAAQ,uBAAuB,EAC7B,gCAAgC;IAClC,QAAQ,EAAE,UAAU,CAAC;CACtB;AAED,UAAU,oCACR,SAAQ,uBAAuB,EAC7B,8BAA8B;IAChC,QAAQ,EAAE,QAAQ,CAAC;CACpB;AAED,oBAAY,8BAA8B,GACtC,sBAAsB,GACtB,wCAAwC,GACxC,oCAAoC,GACpC,uCAAuC,GACvC,sCAAsC,GACtC,oCAAoC,CAAC;AAEzC,oBAAY,gBAAgB,GACxB,YAAY,GACZ,kBAAkB,GAClB,cAAc,GACd,gBAAgB,GAChB,iBAAiB,GACjB,gBAAgB,GAChB,cAAc,CAAC;AAEnB,oBAAY,6BAA6B,CACvC,CAAC,IACC,CAAC,SAAS,wCAAwC,GAClD,kBAAkB,GAClB,CAAC,SAAS,oCAAoC,GAC9C,cAAc,GACd,CAAC,SAAS,uCAAuC,GACjD,iBAAiB,GACjB,CAAC,SAAS,sCAAsC,GAChD,gBAAgB,GAChB,CAAC,SAAS,oCAAoC,GAC9C,cAAc,GACd,gBAAgB,CAAC;AAErB,MAAM,CAAC,OAAO,OAAO,eAAe;IAClC;;;;;;;;;OASG;WACW,cAAc,CAAC,CAAC,SAAS,8BAA8B,EACnE,OAAO,EAAE,MAAM,GAAG,CAAC,GAClB,6BAA6B,CAAC,CAAC,CAAC,GAAG,SAAS;CAsDhD"} \ No newline at end of file +{"version":3,"file":"GeocoderProviderFactory.d.ts","sourceRoot":"","sources":["../src/GeocoderProviderFactory.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,aAAa,EACb,6BAA6B,EAC7B,kBAAkB,EAClB,kCAAkC,EAClC,cAAc,EACd,8BAA8B,EAC9B,gBAAgB,EAChB,iBAAiB,EACjB,iCAAiC,EACjC,gBAAgB,EAChB,gCAAgC,EAChC,cAAc,EACd,8BAA8B,EAC9B,wBAAwB,EAMzB,mBAAiB;AAGlB,UAAU,uBAAuB;IAC/B,QAAQ,EACJ,MAAM,GACN,OAAO,GACP,QAAQ,GACR,YAAY,GACZ,QAAQ,GACR,UAAU,GACV,WAAW,GACX,UAAU,GACV,eAAe,GACf,QAAQ,CAAC;CACd;AAED,UAAU,sBACR,SAAQ,wBAAwB,EAC9B,uBAAuB;CAAG;AAE9B,UAAU,mCACR,SAAQ,uBAAuB,EAC7B,6BAA6B;IAC/B,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED,UAAU,wCACR,SAAQ,uBAAuB,EAC7B,kCAAkC;IACpC,QAAQ,EAAE,QAAQ,GAAG,YAAY,CAAC;CACnC;AAED,UAAU,oCACR,SAAQ,uBAAuB,EAC7B,8BAA8B;IAChC,QAAQ,EAAE,QAAQ,CAAC;CACpB;AAED,UAAU,uCACR,SAAQ,uBAAuB,EAC7B,iCAAiC;IACnC,QAAQ,EAAE,WAAW,GAAG,eAAe,CAAC;CACzC;AAED,UAAU,sCACR,SAAQ,uBAAuB,EAC7B,gCAAgC;IAClC,QAAQ,EAAE,UAAU,CAAC;CACtB;AAED,UAAU,oCACR,SAAQ,uBAAuB,EAC7B,8BAA8B;IAChC,QAAQ,EAAE,QAAQ,CAAC;CACpB;AAED,oBAAY,8BAA8B,GACtC,sBAAsB,GACtB,mCAAmC,GACnC,wCAAwC,GACxC,oCAAoC,GACpC,uCAAuC,GACvC,sCAAsC,GACtC,oCAAoC,CAAC;AAEzC,oBAAY,gBAAgB,GACxB,YAAY,GACZ,aAAa,GACb,kBAAkB,GAClB,cAAc,GACd,gBAAgB,GAChB,iBAAiB,GACjB,gBAAgB,GAChB,cAAc,CAAC;AAEnB,oBAAY,6BAA6B,CACvC,CAAC,IACC,CAAC,SAAS,mCAAmC,GAC7C,aAAa,GACb,CAAC,SAAS,wCAAwC,GAClD,kBAAkB,GAClB,CAAC,SAAS,oCAAoC,GAC9C,cAAc,GACd,CAAC,SAAS,uCAAuC,GACjD,iBAAiB,GACjB,CAAC,SAAS,sCAAsC,GAChD,gBAAgB,GAChB,CAAC,SAAS,oCAAoC,GAC9C,cAAc,GACd,gBAAgB,CAAC;AAErB,MAAM,CAAC,OAAO,OAAO,eAAe;IAClC;;;;;;;;;OASG;WACW,cAAc,CAAC,CAAC,SAAS,8BAA8B,EACnE,OAAO,EAAE,MAAM,GAAG,CAAC,GAClB,6BAA6B,CAAC,CAAC,CAAC,GAAG,SAAS;CA2DhD"} \ No newline at end of file diff --git a/types/error/ResponseError.d.ts b/types/error/ResponseError.d.ts index 298d03b..a99d576 100644 --- a/types/error/ResponseError.d.ts +++ b/types/error/ResponseError.d.ts @@ -1,7 +1,8 @@ +import { GoogleMapsResponse, MapboxResponse, NominatimResponse, OpenCageResponse } from "../provider"; export default class ResponseError extends Error { __proto__: ResponseError; private readonly response; - constructor(message: string, response: Response); - getResponse(): Response; + constructor(message: string, response: Response | GoogleMapsResponse | MapboxResponse | NominatimResponse | OpenCageResponse); + getResponse(): Response | GoogleMapsResponse | MapboxResponse | NominatimResponse | OpenCageResponse; } //# sourceMappingURL=ResponseError.d.ts.map \ No newline at end of file diff --git a/types/error/ResponseError.d.ts.map b/types/error/ResponseError.d.ts.map index 5d9d08f..3d3b33c 100644 --- a/types/error/ResponseError.d.ts.map +++ b/types/error/ResponseError.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"ResponseError.d.ts","sourceRoot":"","sources":["../../src/error/ResponseError.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,OAAO,aAAc,SAAQ,KAAK;IACvC,SAAS,EAAE,aAAa,CAAC;IAEhC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAW;gBAEjB,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ;IAS/C,WAAW,IAAI,QAAQ;CAG/B"} \ No newline at end of file +{"version":3,"file":"ResponseError.d.ts","sourceRoot":"","sources":["../../src/error/ResponseError.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAClB,cAAc,EACd,iBAAiB,EACjB,gBAAgB,EACjB,oBAAiB;AAElB,MAAM,CAAC,OAAO,OAAO,aAAc,SAAQ,KAAK;IACvC,SAAS,EAAE,aAAa,CAAC;IAEhC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAKJ;gBAGnB,OAAO,EAAE,MAAM,EACf,QAAQ,EACJ,QAAQ,GACR,kBAAkB,GAClB,cAAc,GACd,iBAAiB,GACjB,gBAAgB;IAUf,WAAW,IACd,QAAQ,GACR,kBAAkB,GAClB,cAAc,GACd,iBAAiB,GACjB,gBAAgB;CAGrB"} \ No newline at end of file diff --git a/types/provider/BingProvider.d.ts b/types/provider/BingProvider.d.ts index 4deb1e3..5b1c7b5 100644 --- a/types/provider/BingProvider.d.ts +++ b/types/provider/BingProvider.d.ts @@ -1,5 +1,5 @@ -import { ExternalLoaderInterface, ExternalLoaderParams } from "../ExternalLoader"; -import { GeocodedResultsCallback, ProviderInterface, ProviderOptionsInterface } from "./"; +import { ExternalLoaderHeaders, ExternalLoaderInterface, ExternalLoaderParams } from "../ExternalLoader"; +import { ErrorCallback, GeocodedResultsCallback, ProviderInterface, ProviderOptionsInterface } from "./"; import Geocoded from "../Geocoded"; import { GeocodeQuery, GeocodeQueryObject, ReverseQuery, ReverseQueryObject } from "../query"; import { Box } from "../types"; @@ -34,9 +34,9 @@ export default class BingProvider implements ProviderInterface { private externalLoader; private options; constructor(_externalLoader: ExternalLoaderInterface, options?: ProviderOptionsInterface); - geocode(query: string | GeocodeQuery | GeocodeQueryObject, callback: GeocodedResultsCallback): void; - geodecode(latitudeOrQuery: number | string | ReverseQuery | ReverseQueryObject, longitudeOrCallback: number | string | GeocodedResultsCallback, callback?: GeocodedResultsCallback): void; - executeRequest(params: ExternalLoaderParams, callback: GeocodedResultsCallback): void; + geocode(query: string | GeocodeQuery | GeocodeQueryObject, callback: GeocodedResultsCallback, errorCallback?: ErrorCallback): void; + geodecode(latitudeOrQuery: number | string | ReverseQuery | ReverseQueryObject, longitudeOrCallback: number | string | GeocodedResultsCallback, callbackOrErrorCallback?: GeocodedResultsCallback | ErrorCallback, errorCallback?: ErrorCallback): void; + executeRequest(params: ExternalLoaderParams, callback: GeocodedResultsCallback, headers?: ExternalLoaderHeaders, errorCallback?: ErrorCallback): void; static mapToGeocoded(result: BingResult): Geocoded; } //# sourceMappingURL=BingProvider.d.ts.map \ No newline at end of file diff --git a/types/provider/BingProvider.d.ts.map b/types/provider/BingProvider.d.ts.map index 9e7c394..571d965 100644 --- a/types/provider/BingProvider.d.ts.map +++ b/types/provider/BingProvider.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"BingProvider.d.ts","sourceRoot":"","sources":["../../src/provider/BingProvider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,oBAAoB,EAAE,0BAAuB;AAC/E,OAAO,EACL,uBAAuB,EAEvB,iBAAiB,EACjB,wBAAwB,EAEzB,WAAiB;AAClB,OAAO,QAAQ,oBAAiB;AAChC,OAAO,EACL,YAAY,EACZ,kBAAkB,EAClB,YAAY,EACZ,kBAAkB,EACnB,iBAAc;AACf,OAAO,EAAE,GAAG,EAAE,iBAAc;AAQ5B,MAAM,WAAW,UAAU;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,GAAG,CAAC;IACV,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE;QACL,IAAI,EAAE,MAAM,CAAC;QACb,WAAW,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;KAC/B,CAAC;IACF,OAAO,EAAE;QACP,WAAW,EAAE,MAAM,CAAC;QACpB,aAAa,EAAE,MAAM,CAAC;QACtB,cAAc,EAAE,MAAM,CAAC;QACvB,aAAa,EAAE,MAAM,CAAC;QACtB,gBAAgB,EAAE,MAAM,CAAC;QACzB,QAAQ,EAAE,MAAM,CAAC;QACjB,UAAU,EAAE,MAAM,CAAC;KACpB,CAAC;IACF,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE;QACb,IAAI,EAAE,MAAM,CAAC;QACb,WAAW,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QAC9B,iBAAiB,EAAE,MAAM,CAAC;QAC1B,UAAU,EAAE,MAAM,EAAE,CAAC;KACtB,EAAE,CAAC;IACJ,UAAU,EAAE,MAAM,EAAE,CAAC;CACtB;AAED,MAAM,CAAC,OAAO,OAAO,YAAa,YAAW,iBAAiB;IAC5D,OAAO,CAAC,cAAc,CAA0B;IAEhD,OAAO,CAAC,OAAO,CAA2B;gBAGxC,eAAe,EAAE,uBAAuB,EACxC,OAAO,GAAE,wBAAiD;IAWrD,OAAO,CACZ,KAAK,EAAE,MAAM,GAAG,YAAY,GAAG,kBAAkB,EACjD,QAAQ,EAAE,uBAAuB,GAChC,IAAI;IAiBA,SAAS,CACd,eAAe,EAAE,MAAM,GAAG,MAAM,GAAG,YAAY,GAAG,kBAAkB,EACpE,mBAAmB,EAAE,MAAM,GAAG,MAAM,GAAG,uBAAuB,EAC9D,QAAQ,CAAC,EAAE,uBAAuB,GACjC,IAAI;IA0BA,cAAc,CACnB,MAAM,EAAE,oBAAoB,EAC5B,QAAQ,EAAE,uBAAuB,GAChC,IAAI;WAUO,aAAa,CAAC,MAAM,EAAE,UAAU,GAAG,QAAQ;CA4B1D"} \ No newline at end of file +{"version":3,"file":"BingProvider.d.ts","sourceRoot":"","sources":["../../src/provider/BingProvider.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EACrB,uBAAuB,EACvB,oBAAoB,EACrB,0BAAuB;AACxB,OAAO,EACL,aAAa,EACb,uBAAuB,EAEvB,iBAAiB,EACjB,wBAAwB,EAEzB,WAAiB;AAClB,OAAO,QAAQ,oBAAiB;AAChC,OAAO,EACL,YAAY,EACZ,kBAAkB,EAClB,YAAY,EACZ,kBAAkB,EACnB,iBAAc;AACf,OAAO,EAAE,GAAG,EAAE,iBAAc;AAQ5B,MAAM,WAAW,UAAU;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,GAAG,CAAC;IACV,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE;QACL,IAAI,EAAE,MAAM,CAAC;QACb,WAAW,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;KAC/B,CAAC;IACF,OAAO,EAAE;QACP,WAAW,EAAE,MAAM,CAAC;QACpB,aAAa,EAAE,MAAM,CAAC;QACtB,cAAc,EAAE,MAAM,CAAC;QACvB,aAAa,EAAE,MAAM,CAAC;QACtB,gBAAgB,EAAE,MAAM,CAAC;QACzB,QAAQ,EAAE,MAAM,CAAC;QACjB,UAAU,EAAE,MAAM,CAAC;KACpB,CAAC;IACF,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE;QACb,IAAI,EAAE,MAAM,CAAC;QACb,WAAW,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QAC9B,iBAAiB,EAAE,MAAM,CAAC;QAC1B,UAAU,EAAE,MAAM,EAAE,CAAC;KACtB,EAAE,CAAC;IACJ,UAAU,EAAE,MAAM,EAAE,CAAC;CACtB;AAED,MAAM,CAAC,OAAO,OAAO,YAAa,YAAW,iBAAiB;IAC5D,OAAO,CAAC,cAAc,CAA0B;IAEhD,OAAO,CAAC,OAAO,CAA2B;gBAGxC,eAAe,EAAE,uBAAuB,EACxC,OAAO,GAAE,wBAAiD;IAWrD,OAAO,CACZ,KAAK,EAAE,MAAM,GAAG,YAAY,GAAG,kBAAkB,EACjD,QAAQ,EAAE,uBAAuB,EACjC,aAAa,CAAC,EAAE,aAAa,GAC5B,IAAI;IAiBA,SAAS,CACd,eAAe,EAAE,MAAM,GAAG,MAAM,GAAG,YAAY,GAAG,kBAAkB,EACpE,mBAAmB,EAAE,MAAM,GAAG,MAAM,GAAG,uBAAuB,EAC9D,uBAAuB,CAAC,EAAE,uBAAuB,GAAG,aAAa,EACjE,aAAa,CAAC,EAAE,aAAa,GAC5B,IAAI;IA+BA,cAAc,CACnB,MAAM,EAAE,oBAAoB,EAC5B,QAAQ,EAAE,uBAAuB,EACjC,OAAO,CAAC,EAAE,qBAAqB,EAC/B,aAAa,CAAC,EAAE,aAAa,GAC5B,IAAI;WAeO,aAAa,CAAC,MAAM,EAAE,UAAU,GAAG,QAAQ;CA4B1D"} \ No newline at end of file diff --git a/types/provider/ChainProvider.d.ts b/types/provider/ChainProvider.d.ts new file mode 100644 index 0000000..70268b6 --- /dev/null +++ b/types/provider/ChainProvider.d.ts @@ -0,0 +1,26 @@ +import { ExternalLoaderParams } from "../ExternalLoader"; +import { ErrorCallback, GeocodedResultsCallback, ProviderInterface, ProviderOptionsInterface } from "./"; +import { GeocodeQuery, GeocodeQueryObject, ReverseQuery, ReverseQueryObject } from "../query"; +export interface ChainProviderOptionsInterface extends ProviderOptionsInterface { + readonly providers: ProviderInterface[]; + readonly parallelize?: boolean; + readonly first?: boolean; +} +export declare const defaultChainProviderOptions: { + providers: never[]; + useSsl?: boolean | undefined; + useJsonp?: boolean | undefined; + apiKey?: string | undefined; +}; +export default class ChainProvider implements ProviderInterface { + private options; + constructor(options?: ChainProviderOptionsInterface); + geocode(query: string | GeocodeQuery | GeocodeQueryObject, callback: GeocodedResultsCallback, errorCallback?: ErrorCallback): void; + geodecode(latitudeOrQuery: number | string | ReverseQuery | ReverseQueryObject, longitudeOrCallback: number | string | GeocodedResultsCallback, callbackOrErrorCallback?: GeocodedResultsCallback | ErrorCallback, errorCallback?: ErrorCallback): void; + private geocodeNextProvider; + private geodecodeNextProvider; + private geocodeAllProviders; + private geodecodeAllProviders; + executeRequest(params: ExternalLoaderParams, callback: GeocodedResultsCallback): void; +} +//# sourceMappingURL=ChainProvider.d.ts.map \ No newline at end of file diff --git a/types/provider/ChainProvider.d.ts.map b/types/provider/ChainProvider.d.ts.map new file mode 100644 index 0000000..cb2ccb9 --- /dev/null +++ b/types/provider/ChainProvider.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ChainProvider.d.ts","sourceRoot":"","sources":["../../src/provider/ChainProvider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,0BAAuB;AAEtD,OAAO,EACL,aAAa,EACb,uBAAuB,EAEvB,iBAAiB,EACjB,wBAAwB,EAEzB,WAAiB;AAClB,OAAO,EACL,YAAY,EACZ,kBAAkB,EAClB,YAAY,EACZ,kBAAkB,EACnB,iBAAc;AAEf,MAAM,WAAW,6BACf,SAAQ,wBAAwB;IAChC,QAAQ,CAAC,SAAS,EAAE,iBAAiB,EAAE,CAAC;IACxC,QAAQ,CAAC,WAAW,CAAC,EAAE,OAAO,CAAC;IAC/B,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED,eAAO,MAAM,2BAA2B;;;;;CAGvC,CAAC;AAEF,MAAM,CAAC,OAAO,OAAO,aAAc,YAAW,iBAAiB;IAC7D,OAAO,CAAC,OAAO,CAAgC;gBAG7C,OAAO,GAAE,6BAA2D;IAK/D,OAAO,CACZ,KAAK,EAAE,MAAM,GAAG,YAAY,GAAG,kBAAkB,EACjD,QAAQ,EAAE,uBAAuB,EACjC,aAAa,CAAC,EAAE,aAAa,GAC5B,IAAI;IAcA,SAAS,CACd,eAAe,EAAE,MAAM,GAAG,MAAM,GAAG,YAAY,GAAG,kBAAkB,EACpE,mBAAmB,EAAE,MAAM,GAAG,MAAM,GAAG,uBAAuB,EAC9D,uBAAuB,CAAC,EAAE,uBAAuB,GAAG,aAAa,EACjE,aAAa,CAAC,EAAE,aAAa,GAC5B,IAAI;IAgCP,OAAO,CAAC,mBAAmB;IA+B3B,OAAO,CAAC,qBAAqB;IAoC7B,OAAO,CAAC,mBAAmB;IA0D3B,OAAO,CAAC,qBAAqB;IA2DtB,cAAc,CAEnB,MAAM,EAAE,oBAAoB,EAE5B,QAAQ,EAAE,uBAAuB,GAChC,IAAI;CAKR"} \ No newline at end of file diff --git a/types/provider/MapquestProvider.d.ts b/types/provider/MapquestProvider.d.ts index 41933f8..04323b9 100644 --- a/types/provider/MapquestProvider.d.ts +++ b/types/provider/MapquestProvider.d.ts @@ -1,5 +1,5 @@ -import { ExternalLoaderInterface, ExternalLoaderParams } from "../ExternalLoader"; -import { GeocodedResultsCallback, ProviderInterface, ProviderOptionsInterface } from "./"; +import { ExternalLoaderHeaders, ExternalLoaderInterface, ExternalLoaderParams } from "../ExternalLoader"; +import { ErrorCallback, GeocodedResultsCallback, ProviderInterface, ProviderOptionsInterface } from "./"; import Geocoded from "../Geocoded"; import { GeocodeQuery, GeocodeQueryObject, ReverseQuery, ReverseQueryObject } from "../query"; export interface MapQuestResult { @@ -34,9 +34,9 @@ export default class MapQuestProvider implements ProviderInterface { private externalLoader; private options; constructor(_externalLoader: ExternalLoaderInterface, options?: ProviderOptionsInterface); - geocode(query: string | GeocodeQuery | GeocodeQueryObject, callback: GeocodedResultsCallback): void; - geodecode(latitudeOrQuery: number | string | ReverseQuery | ReverseQueryObject, longitudeOrCallback: number | string | GeocodedResultsCallback, callback?: GeocodedResultsCallback): void; - executeRequest(params: ExternalLoaderParams, callback: GeocodedResultsCallback): void; + geocode(query: string | GeocodeQuery | GeocodeQueryObject, callback: GeocodedResultsCallback, errorCallback?: ErrorCallback): void; + geodecode(latitudeOrQuery: number | string | ReverseQuery | ReverseQueryObject, longitudeOrCallback: number | string | GeocodedResultsCallback, callbackOrErrorCallback?: GeocodedResultsCallback | ErrorCallback, errorCallback?: ErrorCallback): void; + executeRequest(params: ExternalLoaderParams, callback: GeocodedResultsCallback, headers?: ExternalLoaderHeaders, errorCallback?: ErrorCallback): void; static mapToGeocoded(result: MapQuestResult): Geocoded; } //# sourceMappingURL=MapquestProvider.d.ts.map \ No newline at end of file diff --git a/types/provider/MapquestProvider.d.ts.map b/types/provider/MapquestProvider.d.ts.map index 4c873aa..d4c8d33 100644 --- a/types/provider/MapquestProvider.d.ts.map +++ b/types/provider/MapquestProvider.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"MapquestProvider.d.ts","sourceRoot":"","sources":["../../src/provider/MapquestProvider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,oBAAoB,EAAE,0BAAuB;AAC/E,OAAO,EACL,uBAAuB,EAEvB,iBAAiB,EACjB,wBAAwB,EAEzB,WAAiB;AAClB,OAAO,QAAQ,oBAAiB;AAChC,OAAO,EACL,YAAY,EACZ,kBAAkB,EAClB,YAAY,EACZ,kBAAkB,EACnB,iBAAc;AASf,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE;QACN,GAAG,EAAE,MAAM,CAAC;QACZ,GAAG,EAAE,MAAM,CAAC;KACb,CAAC;IACF,aAAa,EAAE;QACb,GAAG,EAAE,MAAM,CAAC;QACZ,GAAG,EAAE,MAAM,CAAC;KACb,CAAC;IACF,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,OAAO,CAAC;IACnB,cAAc,EAAE,MAAM,CAAC;IACvB,kBAAkB,EAAE,MAAM,CAAC;CAC5B;AAED,MAAM,CAAC,OAAO,OAAO,gBAAiB,YAAW,iBAAiB;IAChE,OAAO,CAAC,cAAc,CAA0B;IAEhD,OAAO,CAAC,OAAO,CAA2B;gBAGxC,eAAe,EAAE,uBAAuB,EACxC,OAAO,GAAE,wBAAiD;IAWrD,OAAO,CACZ,KAAK,EAAE,MAAM,GAAG,YAAY,GAAG,kBAAkB,EACjD,QAAQ,EAAE,uBAAuB,GAChC,IAAI;IAkBA,SAAS,CACd,eAAe,EAAE,MAAM,GAAG,MAAM,GAAG,YAAY,GAAG,kBAAkB,EACpE,mBAAmB,EAAE,MAAM,GAAG,MAAM,GAAG,uBAAuB,EAC9D,QAAQ,CAAC,EAAE,uBAAuB,GACjC,IAAI;IA2BA,cAAc,CACnB,MAAM,EAAE,oBAAoB,EAC5B,QAAQ,EAAE,uBAAuB,GAChC,IAAI;WAUO,aAAa,CAAC,MAAM,EAAE,cAAc,GAAG,QAAQ;CAuB9D"} \ No newline at end of file +{"version":3,"file":"MapquestProvider.d.ts","sourceRoot":"","sources":["../../src/provider/MapquestProvider.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EACrB,uBAAuB,EACvB,oBAAoB,EACrB,0BAAuB;AACxB,OAAO,EACL,aAAa,EACb,uBAAuB,EAEvB,iBAAiB,EACjB,wBAAwB,EAEzB,WAAiB;AAClB,OAAO,QAAQ,oBAAiB;AAChC,OAAO,EACL,YAAY,EACZ,kBAAkB,EAClB,YAAY,EACZ,kBAAkB,EACnB,iBAAc;AASf,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE;QACN,GAAG,EAAE,MAAM,CAAC;QACZ,GAAG,EAAE,MAAM,CAAC;KACb,CAAC;IACF,aAAa,EAAE;QACb,GAAG,EAAE,MAAM,CAAC;QACZ,GAAG,EAAE,MAAM,CAAC;KACb,CAAC;IACF,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,OAAO,CAAC;IACnB,cAAc,EAAE,MAAM,CAAC;IACvB,kBAAkB,EAAE,MAAM,CAAC;CAC5B;AAED,MAAM,CAAC,OAAO,OAAO,gBAAiB,YAAW,iBAAiB;IAChE,OAAO,CAAC,cAAc,CAA0B;IAEhD,OAAO,CAAC,OAAO,CAA2B;gBAGxC,eAAe,EAAE,uBAAuB,EACxC,OAAO,GAAE,wBAAiD;IAWrD,OAAO,CACZ,KAAK,EAAE,MAAM,GAAG,YAAY,GAAG,kBAAkB,EACjD,QAAQ,EAAE,uBAAuB,EACjC,aAAa,CAAC,EAAE,aAAa,GAC5B,IAAI;IAkBA,SAAS,CACd,eAAe,EAAE,MAAM,GAAG,MAAM,GAAG,YAAY,GAAG,kBAAkB,EACpE,mBAAmB,EAAE,MAAM,GAAG,MAAM,GAAG,uBAAuB,EAC9D,uBAAuB,CAAC,EAAE,uBAAuB,GAAG,aAAa,EACjE,aAAa,CAAC,EAAE,aAAa,GAC5B,IAAI;IAgCA,cAAc,CACnB,MAAM,EAAE,oBAAoB,EAC5B,QAAQ,EAAE,uBAAuB,EACjC,OAAO,CAAC,EAAE,qBAAqB,EAC/B,aAAa,CAAC,EAAE,aAAa,GAC5B,IAAI;WAeO,aAAa,CAAC,MAAM,EAAE,cAAc,GAAG,QAAQ;CAuB9D"} \ No newline at end of file diff --git a/types/provider/ProviderHelpers.d.ts b/types/provider/ProviderHelpers.d.ts index a0208fe..f68f1de 100644 --- a/types/provider/ProviderHelpers.d.ts +++ b/types/provider/ProviderHelpers.d.ts @@ -1,8 +1,9 @@ -import { GeocodedResultsCallback } from "./"; +import { ErrorCallback, GeocodedResultsCallback } from "./"; import { GeocodeQuery, GeocodeQueryObject, ReverseQuery, ReverseQueryObject } from "../query"; export default class ProviderHelpers { static getGeocodeQueryFromParameter(query: string | GeocodeQuery | GeocodeQueryObject, geocodeQuery?: typeof GeocodeQuery): GeocodeQuery; static getReverseQueryFromParameters(latitudeOrQuery: number | string | ReverseQuery | ReverseQueryObject, longitudeOrCallback: number | string | GeocodedResultsCallback, reverseQuery?: typeof ReverseQuery): ReverseQuery; - static getCallbackFromParameters(longitudeOrCallback: number | string | GeocodedResultsCallback, callback?: GeocodedResultsCallback): GeocodedResultsCallback; + static getCallbackFromParameters(longitudeOrCallback: number | string | GeocodedResultsCallback, callbackOrErrorCallback?: GeocodedResultsCallback | ErrorCallback): GeocodedResultsCallback; + static getErrorCallbackFromParameters(longitudeOrCallback: number | string | GeocodedResultsCallback, callbackOrErrorCallback?: GeocodedResultsCallback | ErrorCallback, errorCallback?: ErrorCallback): undefined | ErrorCallback; } //# sourceMappingURL=ProviderHelpers.d.ts.map \ No newline at end of file diff --git a/types/provider/ProviderHelpers.d.ts.map b/types/provider/ProviderHelpers.d.ts.map index 329632d..2219e3b 100644 --- a/types/provider/ProviderHelpers.d.ts.map +++ b/types/provider/ProviderHelpers.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"ProviderHelpers.d.ts","sourceRoot":"","sources":["../../src/provider/ProviderHelpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,WAAiB;AACnD,OAAO,EACL,YAAY,EACZ,kBAAkB,EAClB,YAAY,EACZ,kBAAkB,EACnB,iBAAc;AAEf,MAAM,CAAC,OAAO,OAAO,eAAe;WACpB,4BAA4B,CACxC,KAAK,EAAE,MAAM,GAAG,YAAY,GAAG,kBAAkB,EACjD,YAAY,sBAAe,GAC1B,YAAY;WAWD,6BAA6B,CACzC,eAAe,EAAE,MAAM,GAAG,MAAM,GAAG,YAAY,GAAG,kBAAkB,EACpE,mBAAmB,EAAE,MAAM,GAAG,MAAM,GAAG,uBAAuB,EAC9D,YAAY,sBAAe,GAC1B,YAAY;WA2BD,yBAAyB,CACrC,mBAAmB,EAAE,MAAM,GAAG,MAAM,GAAG,uBAAuB,EAC9D,QAAQ,CAAC,EAAE,uBAAuB,GACjC,uBAAuB;CAiB3B"} \ No newline at end of file +{"version":3,"file":"ProviderHelpers.d.ts","sourceRoot":"","sources":["../../src/provider/ProviderHelpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,uBAAuB,EAAE,WAAiB;AAClE,OAAO,EACL,YAAY,EACZ,kBAAkB,EAClB,YAAY,EACZ,kBAAkB,EACnB,iBAAc;AAEf,MAAM,CAAC,OAAO,OAAO,eAAe;WACpB,4BAA4B,CACxC,KAAK,EAAE,MAAM,GAAG,YAAY,GAAG,kBAAkB,EACjD,YAAY,sBAAe,GAC1B,YAAY;WAWD,6BAA6B,CACzC,eAAe,EAAE,MAAM,GAAG,MAAM,GAAG,YAAY,GAAG,kBAAkB,EACpE,mBAAmB,EAAE,MAAM,GAAG,MAAM,GAAG,uBAAuB,EAC9D,YAAY,sBAAe,GAC1B,YAAY;WA2BD,yBAAyB,CACrC,mBAAmB,EAAE,MAAM,GAAG,MAAM,GAAG,uBAAuB,EAC9D,uBAAuB,CAAC,EAAE,uBAAuB,GAAG,aAAa,GAChE,uBAAuB;WAkBZ,8BAA8B,CAC1C,mBAAmB,EAAE,MAAM,GAAG,MAAM,GAAG,uBAAuB,EAC9D,uBAAuB,CAAC,EAAE,uBAAuB,GAAG,aAAa,EACjE,aAAa,CAAC,EAAE,aAAa,GAC5B,SAAS,GAAG,aAAa;CAc7B"} \ No newline at end of file diff --git a/types/provider/ProviderInterface.d.ts b/types/provider/ProviderInterface.d.ts index 8de87dc..ee41b26 100644 --- a/types/provider/ProviderInterface.d.ts +++ b/types/provider/ProviderInterface.d.ts @@ -1,6 +1,7 @@ -import { ErrorCallback, ExternalLoaderHeaders, ExternalLoaderParams } from "../ExternalLoader"; +import { ExternalLoaderHeaders, ExternalLoaderParams } from "../ExternalLoader"; import Geocoded from "../Geocoded"; import { GeocodeQuery, GeocodeQueryObject, ReverseQuery, ReverseQueryObject } from "../query"; +import { ResponseError } from "../error"; export declare const DEFAULT_RESULT_LIMIT = 5; export declare const defaultProviderOptions: ProviderOptionsInterface; export interface ProviderOptionsInterface { @@ -9,9 +10,10 @@ export interface ProviderOptionsInterface { readonly apiKey?: string; } export declare type GeocodedResultsCallback = (results: Geocoded[]) => void; +export declare type ErrorCallback = (responseError: ResponseError) => void; export default interface ProviderInterface { - geocode(query: string | GeocodeQuery | GeocodeQueryObject, callback: GeocodedResultsCallback): void; - geodecode(latitudeOrQuery: number | string | ReverseQuery | ReverseQueryObject, longitudeOrCallback: number | string | GeocodedResultsCallback, callback?: GeocodedResultsCallback): void; + geocode(query: string | GeocodeQuery | GeocodeQueryObject, callback: GeocodedResultsCallback, errorCallback?: ErrorCallback): void; + geodecode(latitudeOrQuery: number | string | ReverseQuery | ReverseQueryObject, longitudeOrCallback: number | string | GeocodedResultsCallback, callbackOrErrorCallback?: GeocodedResultsCallback | ErrorCallback, errorCallback?: ErrorCallback): void; executeRequest(params: ExternalLoaderParams, callback: GeocodedResultsCallback, headers?: ExternalLoaderHeaders, errorCallback?: ErrorCallback): void; } //# sourceMappingURL=ProviderInterface.d.ts.map \ No newline at end of file diff --git a/types/provider/ProviderInterface.d.ts.map b/types/provider/ProviderInterface.d.ts.map index eab79c6..453c118 100644 --- a/types/provider/ProviderInterface.d.ts.map +++ b/types/provider/ProviderInterface.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"ProviderInterface.d.ts","sourceRoot":"","sources":["../../src/provider/ProviderInterface.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EACb,qBAAqB,EACrB,oBAAoB,EACrB,0BAAuB;AACxB,OAAO,QAAQ,oBAAiB;AAChC,OAAO,EACL,YAAY,EACZ,kBAAkB,EAClB,YAAY,EACZ,kBAAkB,EACnB,iBAAc;AAEf,eAAO,MAAM,oBAAoB,IAAI,CAAC;AAEtC,eAAO,MAAM,sBAAsB,EAAE,wBAGpC,CAAC;AAEF,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,oBAAY,uBAAuB,GAAG,CAAC,OAAO,EAAE,QAAQ,EAAE,KAAK,IAAI,CAAC;AAEpE,MAAM,CAAC,OAAO,WAAW,iBAAiB;IACxC,OAAO,CACL,KAAK,EAAE,MAAM,GAAG,YAAY,GAAG,kBAAkB,EACjD,QAAQ,EAAE,uBAAuB,GAChC,IAAI,CAAC;IACR,SAAS,CACP,eAAe,EAAE,MAAM,GAAG,MAAM,GAAG,YAAY,GAAG,kBAAkB,EACpE,mBAAmB,EAAE,MAAM,GAAG,MAAM,GAAG,uBAAuB,EAC9D,QAAQ,CAAC,EAAE,uBAAuB,GACjC,IAAI,CAAC;IACR,cAAc,CACZ,MAAM,EAAE,oBAAoB,EAC5B,QAAQ,EAAE,uBAAuB,EACjC,OAAO,CAAC,EAAE,qBAAqB,EAC/B,aAAa,CAAC,EAAE,aAAa,GAC5B,IAAI,CAAC;CACT"} \ No newline at end of file +{"version":3,"file":"ProviderInterface.d.ts","sourceRoot":"","sources":["../../src/provider/ProviderInterface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,0BAAuB;AAC7E,OAAO,QAAQ,oBAAiB;AAChC,OAAO,EACL,YAAY,EACZ,kBAAkB,EAClB,YAAY,EACZ,kBAAkB,EACnB,iBAAc;AACf,OAAO,EAAE,aAAa,EAAE,iBAAc;AAEtC,eAAO,MAAM,oBAAoB,IAAI,CAAC;AAEtC,eAAO,MAAM,sBAAsB,EAAE,wBAGpC,CAAC;AAEF,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,oBAAY,uBAAuB,GAAG,CAAC,OAAO,EAAE,QAAQ,EAAE,KAAK,IAAI,CAAC;AACpE,oBAAY,aAAa,GAAG,CAAC,aAAa,EAAE,aAAa,KAAK,IAAI,CAAC;AAEnE,MAAM,CAAC,OAAO,WAAW,iBAAiB;IACxC,OAAO,CACL,KAAK,EAAE,MAAM,GAAG,YAAY,GAAG,kBAAkB,EACjD,QAAQ,EAAE,uBAAuB,EACjC,aAAa,CAAC,EAAE,aAAa,GAC5B,IAAI,CAAC;IACR,SAAS,CACP,eAAe,EAAE,MAAM,GAAG,MAAM,GAAG,YAAY,GAAG,kBAAkB,EACpE,mBAAmB,EAAE,MAAM,GAAG,MAAM,GAAG,uBAAuB,EAC9D,uBAAuB,CAAC,EAAE,uBAAuB,GAAG,aAAa,EACjE,aAAa,CAAC,EAAE,aAAa,GAC5B,IAAI,CAAC;IACR,cAAc,CACZ,MAAM,EAAE,oBAAoB,EAC5B,QAAQ,EAAE,uBAAuB,EACjC,OAAO,CAAC,EAAE,qBAAqB,EAC/B,aAAa,CAAC,EAAE,aAAa,GAC5B,IAAI,CAAC;CACT"} \ No newline at end of file diff --git a/types/provider/YandexProvider.d.ts b/types/provider/YandexProvider.d.ts index 0db4e2c..7944082 100644 --- a/types/provider/YandexProvider.d.ts +++ b/types/provider/YandexProvider.d.ts @@ -1,5 +1,5 @@ -import { ExternalLoaderInterface, ExternalLoaderParams } from "../ExternalLoader"; -import { GeocodedResultsCallback, ProviderInterface, ProviderOptionsInterface } from "./"; +import { ExternalLoaderHeaders, ExternalLoaderInterface, ExternalLoaderParams } from "../ExternalLoader"; +import { ErrorCallback, GeocodedResultsCallback, ProviderInterface, ProviderOptionsInterface } from "./"; import Geocoded from "../Geocoded"; import { GeocodeQuery, GeocodeQueryObject, ReverseQuery, ReverseQueryObject } from "../query"; export interface YandexResult { @@ -51,9 +51,9 @@ export default class YandexProvider implements ProviderInterface { private externalLoader; private options; constructor(_externalLoader: ExternalLoaderInterface, options?: YandexProviderOptionsInterface); - geocode(query: string | GeocodeQuery | GeocodeQueryObject, callback: GeocodedResultsCallback): void; - geodecode(latitudeOrQuery: number | string | ReverseQuery | ReverseQueryObject, longitudeOrCallback: number | string | GeocodedResultsCallback, callback?: GeocodedResultsCallback): void; - executeRequest(params: ExternalLoaderParams, callback: GeocodedResultsCallback): void; + geocode(query: string | GeocodeQuery | GeocodeQueryObject, callback: GeocodedResultsCallback, errorCallback?: ErrorCallback): void; + geodecode(latitudeOrQuery: number | string | ReverseQuery | ReverseQueryObject, longitudeOrCallback: number | string | GeocodedResultsCallback, callbackOrErrorCallback?: GeocodedResultsCallback | ErrorCallback, errorCallback?: ErrorCallback): void; + executeRequest(params: ExternalLoaderParams, callback: GeocodedResultsCallback, headers?: ExternalLoaderHeaders, errorCallback?: ErrorCallback): void; static mapToGeocoded(result: YandexResult): Geocoded; private static flattenObject; } diff --git a/types/provider/YandexProvider.d.ts.map b/types/provider/YandexProvider.d.ts.map index b3755c7..7e8ec45 100644 --- a/types/provider/YandexProvider.d.ts.map +++ b/types/provider/YandexProvider.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"YandexProvider.d.ts","sourceRoot":"","sources":["../../src/provider/YandexProvider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,oBAAoB,EAAE,0BAAuB;AAC/E,OAAO,EACL,uBAAuB,EAEvB,iBAAiB,EACjB,wBAAwB,EAEzB,WAAiB;AAClB,OAAO,QAAQ,oBAAiB;AAChC,OAAO,EACL,YAAY,EACZ,kBAAkB,EAClB,YAAY,EACZ,kBAAkB,EACnB,iBAAc;AAgBf,MAAM,WAAW,YAAY;IAC3B,gBAAgB,EAAE;QAChB,gBAAgB,EAAE;YAChB,IAAI,EAAE,MAAM,CAAC;YACb,IAAI,EAAE,MAAM,CAAC;YACb,SAAS,EAAE,MAAM,CAAC;YAClB,cAAc,EAAE;gBACd,OAAO,EAAE;oBACP,WAAW,EAAE,MAAM,CAAC;oBACpB,eAAe,EAAE,MAAM,CAAC;oBACxB,WAAW,EAAE,MAAM,CAAC;oBACpB,kBAAkB,CAAC,EAAE;wBACnB,sBAAsB,EAAE,MAAM,CAAC;wBAC/B,qBAAqB,CAAC,EAAE;4BACtB,yBAAyB,EAAE,MAAM,CAAC;4BAClC,QAAQ,CAAC,EAAE;gCACT,YAAY,EAAE,MAAM,CAAC;gCACrB,YAAY,CAAC,EAAE;oCACb,gBAAgB,EAAE,MAAM,CAAC;oCACzB,OAAO,EAAE;wCACP,aAAa,EAAE,MAAM,CAAC;qCACvB,CAAC;iCACH,CAAC;6BACH,CAAC;yBACH,CAAC;qBACH,CAAC;iBACH,CAAC;aACH,CAAC;SACH,CAAC;KACH,CAAC;IACF,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE;QACT,QAAQ,EAAE;YACR,WAAW,EAAE,MAAM,CAAC;YACpB,WAAW,EAAE,MAAM,CAAC;SACrB,CAAC;KACH,CAAC;IACF,KAAK,EAAE;QACL,GAAG,EAAE,MAAM,CAAC;KACb,CAAC;CACH;AAYD,MAAM,WAAW,8BACf,SAAQ,wBAAwB;IAChC,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,GAAG,UAAU,GAAG,UAAU,CAAC;CAC3E;AAED,MAAM,CAAC,OAAO,OAAO,cAAe,YAAW,iBAAiB;IAC9D,OAAO,CAAC,cAAc,CAA0B;IAEhD,OAAO,CAAC,OAAO,CAAiC;gBAG9C,eAAe,EAAE,uBAAuB,EACxC,OAAO,GAAE,8BAAuD;IAM3D,OAAO,CACZ,KAAK,EAAE,MAAM,GAAG,YAAY,GAAG,kBAAkB,EACjD,QAAQ,EAAE,uBAAuB,GAChC,IAAI;IAoBA,SAAS,CACd,eAAe,EAAE,MAAM,GAAG,MAAM,GAAG,YAAY,GAAG,kBAAkB,EACpE,mBAAmB,EAAE,MAAM,GAAG,MAAM,GAAG,uBAAuB,EAC9D,QAAQ,CAAC,EAAE,uBAAuB,GACjC,IAAI;IA8BA,cAAc,CACnB,MAAM,EAAE,oBAAoB,EAC5B,QAAQ,EAAE,uBAAuB,GAChC,IAAI;WAWO,aAAa,CAAC,MAAM,EAAE,YAAY,GAAG,QAAQ;IAyC3D,OAAO,CAAC,MAAM,CAAC,aAAa;CA+B7B"} \ No newline at end of file +{"version":3,"file":"YandexProvider.d.ts","sourceRoot":"","sources":["../../src/provider/YandexProvider.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EACrB,uBAAuB,EACvB,oBAAoB,EACrB,0BAAuB;AACxB,OAAO,EACL,aAAa,EACb,uBAAuB,EAEvB,iBAAiB,EACjB,wBAAwB,EAEzB,WAAiB;AAClB,OAAO,QAAQ,oBAAiB;AAChC,OAAO,EACL,YAAY,EACZ,kBAAkB,EAClB,YAAY,EACZ,kBAAkB,EACnB,iBAAc;AAgBf,MAAM,WAAW,YAAY;IAC3B,gBAAgB,EAAE;QAChB,gBAAgB,EAAE;YAChB,IAAI,EAAE,MAAM,CAAC;YACb,IAAI,EAAE,MAAM,CAAC;YACb,SAAS,EAAE,MAAM,CAAC;YAClB,cAAc,EAAE;gBACd,OAAO,EAAE;oBACP,WAAW,EAAE,MAAM,CAAC;oBACpB,eAAe,EAAE,MAAM,CAAC;oBACxB,WAAW,EAAE,MAAM,CAAC;oBACpB,kBAAkB,CAAC,EAAE;wBACnB,sBAAsB,EAAE,MAAM,CAAC;wBAC/B,qBAAqB,CAAC,EAAE;4BACtB,yBAAyB,EAAE,MAAM,CAAC;4BAClC,QAAQ,CAAC,EAAE;gCACT,YAAY,EAAE,MAAM,CAAC;gCACrB,YAAY,CAAC,EAAE;oCACb,gBAAgB,EAAE,MAAM,CAAC;oCACzB,OAAO,EAAE;wCACP,aAAa,EAAE,MAAM,CAAC;qCACvB,CAAC;iCACH,CAAC;6BACH,CAAC;yBACH,CAAC;qBACH,CAAC;iBACH,CAAC;aACH,CAAC;SACH,CAAC;KACH,CAAC;IACF,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE;QACT,QAAQ,EAAE;YACR,WAAW,EAAE,MAAM,CAAC;YACpB,WAAW,EAAE,MAAM,CAAC;SACrB,CAAC;KACH,CAAC;IACF,KAAK,EAAE;QACL,GAAG,EAAE,MAAM,CAAC;KACb,CAAC;CACH;AAYD,MAAM,WAAW,8BACf,SAAQ,wBAAwB;IAChC,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,GAAG,UAAU,GAAG,UAAU,CAAC;CAC3E;AAED,MAAM,CAAC,OAAO,OAAO,cAAe,YAAW,iBAAiB;IAC9D,OAAO,CAAC,cAAc,CAA0B;IAEhD,OAAO,CAAC,OAAO,CAAiC;gBAG9C,eAAe,EAAE,uBAAuB,EACxC,OAAO,GAAE,8BAAuD;IAM3D,OAAO,CACZ,KAAK,EAAE,MAAM,GAAG,YAAY,GAAG,kBAAkB,EACjD,QAAQ,EAAE,uBAAuB,EACjC,aAAa,CAAC,EAAE,aAAa,GAC5B,IAAI;IAoBA,SAAS,CACd,eAAe,EAAE,MAAM,GAAG,MAAM,GAAG,YAAY,GAAG,kBAAkB,EACpE,mBAAmB,EAAE,MAAM,GAAG,MAAM,GAAG,uBAAuB,EAC9D,uBAAuB,CAAC,EAAE,uBAAuB,GAAG,aAAa,EACjE,aAAa,CAAC,EAAE,aAAa,GAC5B,IAAI;IAmCA,cAAc,CACnB,MAAM,EAAE,oBAAoB,EAC5B,QAAQ,EAAE,uBAAuB,EACjC,OAAO,CAAC,EAAE,qBAAqB,EAC/B,aAAa,CAAC,EAAE,aAAa,GAC5B,IAAI;WAgBO,aAAa,CAAC,MAAM,EAAE,YAAY,GAAG,QAAQ;IAyC3D,OAAO,CAAC,MAAM,CAAC,aAAa;CA+B7B"} \ No newline at end of file diff --git a/types/provider/googlemaps/GoogleMapsProvider.d.ts b/types/provider/googlemaps/GoogleMapsProvider.d.ts index bfe4238..e7afec0 100644 --- a/types/provider/googlemaps/GoogleMapsProvider.d.ts +++ b/types/provider/googlemaps/GoogleMapsProvider.d.ts @@ -1,10 +1,15 @@ -import { ExternalLoaderInterface, ExternalLoaderParams } from "../../ExternalLoader"; -import { GeocodedResultsCallback, GoogleMapsGeocoded, GoogleMapsGeocodeQuery, GoogleMapsGeocodeQueryObject, GoogleMapsReverseQuery, GoogleMapsReverseQueryObject, ProviderInterface, ProviderOptionsInterface } from "./.."; +import { ExternalLoaderHeaders, ExternalLoaderInterface, ExternalLoaderParams } from "../../ExternalLoader"; +import { ErrorCallback, GeocodedResultsCallback, GoogleMapsGeocoded, GoogleMapsGeocodeQuery, GoogleMapsGeocodeQueryObject, GoogleMapsReverseQuery, GoogleMapsReverseQueryObject, ProviderInterface, ProviderOptionsInterface } from "./.."; interface GoogleMapsLatLng { lat: number; lng: number; } declare type GoogleMapsPlaceType = "airport" | "administrative_area_level_1" | "administrative_area_level_2" | "administrative_area_level_3" | "administrative_area_level_4" | "administrative_area_level_5" | "archipelago" | "bus_station" | "colloquial_area" | "continent" | "country" | "establishment" | "finance" | "floor" | "food" | "general_contractor" | "geocode" | "health" | "intersection" | "locality" | "natural_feature" | "neighborhood" | "park" | "parking" | "place_of_worship" | "plus_code" | "point_of_interest" | "political" | "post_box" | "postal_code" | "postal_code_prefix" | "postal_code_suffix" | "postal_town" | "premise" | "room" | "route" | "street_address" | "street_number" | "sublocality" | "sublocality_level_1" | "sublocality_level_2" | "sublocality_level_3" | "sublocality_level_4" | "sublocality_level_5" | "subpremise" | "town_square" | "train_station" | "transit_station" | "ward"; +export interface GoogleMapsResponse { + results: GoogleMapsResult[]; + status: "OK" | "ZERO_RESULTS" | "OVER_DAILY_LIMIT" | "OVER_QUERY_LIMIT" | "REQUEST_DENIED" | "INVALID_REQUEST" | "UNKNOWN_ERROR"; + error_message?: string; +} export interface GoogleMapsResult { geometry: { location: GoogleMapsLatLng; @@ -43,10 +48,10 @@ export default class GoogleMapsProvider implements ProviderInterface { private externalLoader; private options; constructor(_externalLoader: ExternalLoaderInterface, options?: GoogleMapsProviderOptionsInterface); - geocode(query: string | GoogleMapsGeocodeQuery | GoogleMapsGeocodeQueryObject, callback: GeocodedResultsCallback): void; - geodecode(latitudeOrQuery: number | string | GoogleMapsReverseQuery | GoogleMapsReverseQueryObject, longitudeOrCallback: number | string | GeocodedResultsCallback, callback?: GeocodedResultsCallback): void; + geocode(query: string | GoogleMapsGeocodeQuery | GoogleMapsGeocodeQueryObject, callback: GeocodedResultsCallback, errorCallback?: ErrorCallback): void; + geodecode(latitudeOrQuery: number | string | GoogleMapsReverseQuery | GoogleMapsReverseQueryObject, longitudeOrCallback: number | string | GeocodedResultsCallback, callbackOrErrorCallback?: GeocodedResultsCallback | ErrorCallback, errorCallback?: ErrorCallback): void; private withCommonParams; - executeRequest(params: ExternalLoaderParams, callback: GeocodedResultsCallback): void; + executeRequest(params: ExternalLoaderParams, callback: GeocodedResultsCallback, headers?: ExternalLoaderHeaders, errorCallback?: ErrorCallback): void; static mapToGeocoded(result: GoogleMapsResult): GoogleMapsGeocoded; private static signQuery; } diff --git a/types/provider/googlemaps/GoogleMapsProvider.d.ts.map b/types/provider/googlemaps/GoogleMapsProvider.d.ts.map index a2b89a8..b1bf606 100644 --- a/types/provider/googlemaps/GoogleMapsProvider.d.ts.map +++ b/types/provider/googlemaps/GoogleMapsProvider.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"GoogleMapsProvider.d.ts","sourceRoot":"","sources":["../../../src/provider/googlemaps/GoogleMapsProvider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,oBAAoB,EAAE,6BAAuB;AAC/E,OAAO,EACL,uBAAuB,EACvB,kBAAkB,EAClB,sBAAsB,EACtB,4BAA4B,EAC5B,sBAAsB,EACtB,4BAA4B,EAE5B,iBAAiB,EACjB,wBAAwB,EAEzB,aAAiB;AA8BlB,UAAU,gBAAgB;IACxB,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;CACb;AAED,aAAK,mBAAmB,GACpB,SAAS,GACT,6BAA6B,GAC7B,6BAA6B,GAC7B,6BAA6B,GAC7B,6BAA6B,GAC7B,6BAA6B,GAC7B,aAAa,GACb,aAAa,GACb,iBAAiB,GACjB,WAAW,GACX,SAAS,GACT,eAAe,GACf,SAAS,GACT,OAAO,GACP,MAAM,GACN,oBAAoB,GACpB,SAAS,GACT,QAAQ,GACR,cAAc,GACd,UAAU,GACV,iBAAiB,GACjB,cAAc,GACd,MAAM,GACN,SAAS,GACT,kBAAkB,GAClB,WAAW,GACX,mBAAmB,GACnB,WAAW,GACX,UAAU,GACV,aAAa,GACb,oBAAoB,GACpB,oBAAoB,GACpB,aAAa,GACb,SAAS,GACT,MAAM,GACN,OAAO,GACP,gBAAgB,GAChB,eAAe,GACf,aAAa,GACb,qBAAqB,GACrB,qBAAqB,GACrB,qBAAqB,GACrB,qBAAqB,GACrB,qBAAqB,GACrB,YAAY,GACZ,aAAa,GACb,eAAe,GACf,iBAAiB,GACjB,MAAM,CAAC;AAgBX,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,EAAE;QACR,QAAQ,EAAE,gBAAgB,CAAC;QAE3B,aAAa,EACT,SAAS,GACT,oBAAoB,GACpB,kBAAkB,GAClB,aAAa,CAAC;QAClB,QAAQ,EAAE;YACR,SAAS,EAAE,gBAAgB,CAAC;YAC5B,SAAS,EAAE,gBAAgB,CAAC;SAC7B,CAAC;QACF,MAAM,CAAC,EAAE;YACP,SAAS,EAAE,gBAAgB,CAAC;YAC5B,SAAS,EAAE,gBAAgB,CAAC;SAC7B,CAAC;KACH,CAAC;IAEF,iBAAiB,EAAE,MAAM,CAAC;IAE1B,kBAAkB,EAAE;QAClB,KAAK,EAAE,mBAAmB,EAAE,CAAC;QAE7B,SAAS,EAAE,MAAM,CAAC;QAElB,UAAU,EAAE,MAAM,CAAC;KACpB,EAAE,CAAC;IAEJ,QAAQ,EAAE,MAAM,CAAC;IAEjB,SAAS,CAAC,EAAE;QAEV,WAAW,EAAE,MAAM,CAAC;QAEpB,aAAa,CAAC,EAAE,MAAM,CAAC;KACxB,CAAC;IACF,KAAK,EAAE,mBAAmB,EAAE,CAAC;IAE7B,mBAAmB,CAAC,EAAE,MAAM,EAAE,CAAC;IAE/B,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAED,MAAM,WAAW,kCACf,SAAQ,wBAAwB;IAChC,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;CAClC;AAED,MAAM,CAAC,OAAO,OAAO,kBAAmB,YAAW,iBAAiB;IAClE,OAAO,CAAC,cAAc,CAA0B;IAEhD,OAAO,CAAC,OAAO,CAAqC;gBAGlD,eAAe,EAAE,uBAAuB,EACxC,OAAO,GAAE,kCAA2D;IA0B/D,OAAO,CACZ,KAAK,EAAE,MAAM,GAAG,sBAAsB,GAAG,4BAA4B,EACrE,QAAQ,EAAE,uBAAuB,GAChC,IAAI;IAsCA,SAAS,CACd,eAAe,EACX,MAAM,GACN,MAAM,GACN,sBAAsB,GACtB,4BAA4B,EAChC,mBAAmB,EAAE,MAAM,GAAG,MAAM,GAAG,uBAAuB,EAC9D,QAAQ,CAAC,EAAE,uBAAuB,GACjC,IAAI;IAmCP,OAAO,CAAC,gBAAgB;IAoCjB,cAAc,CACnB,MAAM,EAAE,oBAAoB,EAC5B,QAAQ,EAAE,uBAAuB,GAChC,IAAI;WA2DO,aAAa,CAAC,MAAM,EAAE,gBAAgB,GAAG,kBAAkB;IAqMzE,OAAO,CAAC,MAAM,CAAC,SAAS;CAmBzB"} \ No newline at end of file +{"version":3,"file":"GoogleMapsProvider.d.ts","sourceRoot":"","sources":["../../../src/provider/googlemaps/GoogleMapsProvider.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EACrB,uBAAuB,EACvB,oBAAoB,EACrB,6BAAuB;AACxB,OAAO,EACL,aAAa,EACb,uBAAuB,EACvB,kBAAkB,EAClB,sBAAsB,EACtB,4BAA4B,EAC5B,sBAAsB,EACtB,4BAA4B,EAE5B,iBAAiB,EACjB,wBAAwB,EAEzB,aAAiB;AA+BlB,UAAU,gBAAgB;IACxB,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;CACb;AAED,aAAK,mBAAmB,GACpB,SAAS,GACT,6BAA6B,GAC7B,6BAA6B,GAC7B,6BAA6B,GAC7B,6BAA6B,GAC7B,6BAA6B,GAC7B,aAAa,GACb,aAAa,GACb,iBAAiB,GACjB,WAAW,GACX,SAAS,GACT,eAAe,GACf,SAAS,GACT,OAAO,GACP,MAAM,GACN,oBAAoB,GACpB,SAAS,GACT,QAAQ,GACR,cAAc,GACd,UAAU,GACV,iBAAiB,GACjB,cAAc,GACd,MAAM,GACN,SAAS,GACT,kBAAkB,GAClB,WAAW,GACX,mBAAmB,GACnB,WAAW,GACX,UAAU,GACV,aAAa,GACb,oBAAoB,GACpB,oBAAoB,GACpB,aAAa,GACb,SAAS,GACT,MAAM,GACN,OAAO,GACP,gBAAgB,GAChB,eAAe,GACf,aAAa,GACb,qBAAqB,GACrB,qBAAqB,GACrB,qBAAqB,GACrB,qBAAqB,GACrB,qBAAqB,GACrB,YAAY,GACZ,aAAa,GACb,eAAe,GACf,iBAAiB,GACjB,MAAM,CAAC;AAEX,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,gBAAgB,EAAE,CAAC;IAC5B,MAAM,EACF,IAAI,GACJ,cAAc,GACd,kBAAkB,GAClB,kBAAkB,GAClB,gBAAgB,GAChB,iBAAiB,GACjB,eAAe,CAAC;IAEpB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,EAAE;QACR,QAAQ,EAAE,gBAAgB,CAAC;QAE3B,aAAa,EACT,SAAS,GACT,oBAAoB,GACpB,kBAAkB,GAClB,aAAa,CAAC;QAClB,QAAQ,EAAE;YACR,SAAS,EAAE,gBAAgB,CAAC;YAC5B,SAAS,EAAE,gBAAgB,CAAC;SAC7B,CAAC;QACF,MAAM,CAAC,EAAE;YACP,SAAS,EAAE,gBAAgB,CAAC;YAC5B,SAAS,EAAE,gBAAgB,CAAC;SAC7B,CAAC;KACH,CAAC;IAEF,iBAAiB,EAAE,MAAM,CAAC;IAE1B,kBAAkB,EAAE;QAClB,KAAK,EAAE,mBAAmB,EAAE,CAAC;QAE7B,SAAS,EAAE,MAAM,CAAC;QAElB,UAAU,EAAE,MAAM,CAAC;KACpB,EAAE,CAAC;IAEJ,QAAQ,EAAE,MAAM,CAAC;IAEjB,SAAS,CAAC,EAAE;QAEV,WAAW,EAAE,MAAM,CAAC;QAEpB,aAAa,CAAC,EAAE,MAAM,CAAC;KACxB,CAAC;IACF,KAAK,EAAE,mBAAmB,EAAE,CAAC;IAE7B,mBAAmB,CAAC,EAAE,MAAM,EAAE,CAAC;IAE/B,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAED,MAAM,WAAW,kCACf,SAAQ,wBAAwB;IAChC,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;CAClC;AAED,MAAM,CAAC,OAAO,OAAO,kBAAmB,YAAW,iBAAiB;IAClE,OAAO,CAAC,cAAc,CAA0B;IAEhD,OAAO,CAAC,OAAO,CAAqC;gBAGlD,eAAe,EAAE,uBAAuB,EACxC,OAAO,GAAE,kCAA2D;IA0B/D,OAAO,CACZ,KAAK,EAAE,MAAM,GAAG,sBAAsB,GAAG,4BAA4B,EACrE,QAAQ,EAAE,uBAAuB,EACjC,aAAa,CAAC,EAAE,aAAa,GAC5B,IAAI;IAsCA,SAAS,CACd,eAAe,EACX,MAAM,GACN,MAAM,GACN,sBAAsB,GACtB,4BAA4B,EAChC,mBAAmB,EAAE,MAAM,GAAG,MAAM,GAAG,uBAAuB,EAC9D,uBAAuB,CAAC,EAAE,uBAAuB,GAAG,aAAa,EACjE,aAAa,CAAC,EAAE,aAAa,GAC5B,IAAI;IAwCP,OAAO,CAAC,gBAAgB;IAoCjB,cAAc,CACnB,MAAM,EAAE,oBAAoB,EAC5B,QAAQ,EAAE,uBAAuB,EACjC,OAAO,CAAC,EAAE,qBAAqB,EAC/B,aAAa,CAAC,EAAE,aAAa,GAC5B,IAAI;WAsEO,aAAa,CAAC,MAAM,EAAE,gBAAgB,GAAG,kBAAkB;IAqMzE,OAAO,CAAC,MAAM,CAAC,SAAS;CAmBzB"} \ No newline at end of file diff --git a/types/provider/index.d.ts b/types/provider/index.d.ts index 008f669..5845fec 100644 --- a/types/provider/index.d.ts +++ b/types/provider/index.d.ts @@ -3,6 +3,8 @@ export { default as ProviderInterface } from "./ProviderInterface"; export * from "./ProviderInterface"; export { default as BingProvider } from "./BingProvider"; export * from "./BingProvider"; +export { default as ChainProvider } from "./ChainProvider"; +export * from "./ChainProvider"; export * from "./googlemaps"; export * from "./mapbox"; export { default as MapquestProvider } from "./MapquestProvider"; diff --git a/types/provider/index.d.ts.map b/types/provider/index.d.ts.map index a755e43..c4e4280 100644 --- a/types/provider/index.d.ts.map +++ b/types/provider/index.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/provider/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAa0G,mBAAmB,CAb5F;AACtE,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAY2H,qBAAqB,CAZ7G;AAC1E,cAWkK,qBAAqB,CAX5I;AAC3C,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAUqJ,gBAAgB,CAVvI;AAChE,cASuL,gBAAgB,CATjK;AACtC,cAQuM,cAAc,CARjL;AACpC,cAOqN,UAAU,CAP/L;AAChC,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAMyL,oBAAoB,CAN3K;AACxE,cAK+N,oBAAoB,CALzM;AAC1C,cAImP,aAAa,CAJ7N;AACnC,cAGgQ,YAAY,CAH1O;AAClC,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAEwO,kBAAkB,CAF1N;AACpE,cAC4Q,kBAAkB,CADtP"} \ No newline at end of file +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/provider/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAe2H,mBAAmB,CAf7G;AACtE,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAc4I,qBAAqB,CAd9H;AAC1E,cAamL,qBAAqB,CAb7J;AAC3C,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAYsK,gBAAgB,CAZxJ;AAChE,cAWwM,gBAAgB,CAXlL;AACtC,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAUqL,iBAAiB,CAVvK;AAClE,cASwN,iBAAiB,CATlM;AACvC,cAQyO,cAAc,CARnN;AACpC,cAOuP,UAAU,CAPjO;AAChC,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAM2N,oBAAoB,CAN7M;AACxE,cAKiQ,oBAAoB,CAL3O;AAC1C,cAIqR,aAAa,CAJ/P;AACnC,cAGkS,YAAY,CAH5Q;AAClC,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAE0Q,kBAAkB,CAF5P;AACpE,cAC8S,kBAAkB,CADxR"} \ No newline at end of file diff --git a/types/provider/mapbox/MapboxProvider.d.ts b/types/provider/mapbox/MapboxProvider.d.ts index 353639e..26f0073 100644 --- a/types/provider/mapbox/MapboxProvider.d.ts +++ b/types/provider/mapbox/MapboxProvider.d.ts @@ -1,6 +1,12 @@ -import { ExternalLoaderInterface, ExternalLoaderParams } from "../../ExternalLoader"; -import { GeocodedResultsCallback, MapboxGeocoded, MapboxGeocodeQuery, MapboxGeocodeQueryObject, MapboxReverseQuery, MapboxReverseQueryObject, ProviderInterface, ProviderOptionsInterface } from "./.."; +import { ExternalLoaderHeaders, ExternalLoaderInterface, ExternalLoaderParams } from "../../ExternalLoader"; +import { ErrorCallback, GeocodedResultsCallback, MapboxGeocoded, MapboxGeocodeQuery, MapboxGeocodeQueryObject, MapboxReverseQuery, MapboxReverseQueryObject, ProviderInterface, ProviderOptionsInterface } from "./.."; import { Box } from "../../types"; +export interface MapboxResponse { + type: "FeatureCollection"; + query: string[]; + features: MapboxResult[]; + attribution: string; +} interface MapboxFeatureContextProperties { id: string; text: string; @@ -59,10 +65,10 @@ export default class MapboxProvider implements ProviderInterface { private externalLoader; private options; constructor(_externalLoader: ExternalLoaderInterface, options?: MapboxProviderOptionsInterface); - geocode(query: string | MapboxGeocodeQuery | MapboxGeocodeQueryObject, callback: GeocodedResultsCallback): void; - geodecode(latitudeOrQuery: number | string | MapboxReverseQuery | MapboxReverseQueryObject, longitudeOrCallback: number | string | GeocodedResultsCallback, callback?: GeocodedResultsCallback): void; + geocode(query: string | MapboxGeocodeQuery | MapboxGeocodeQueryObject, callback: GeocodedResultsCallback, errorCallback?: ErrorCallback): void; + geodecode(latitudeOrQuery: number | string | MapboxReverseQuery | MapboxReverseQueryObject, longitudeOrCallback: number | string | GeocodedResultsCallback, callbackOrErrorCallback?: GeocodedResultsCallback | ErrorCallback, errorCallback?: ErrorCallback): void; private withCommonParams; - executeRequest(params: ExternalLoaderParams, callback: GeocodedResultsCallback): void; + executeRequest(params: ExternalLoaderParams, callback: GeocodedResultsCallback, headers?: ExternalLoaderHeaders, errorCallback?: ErrorCallback): void; static mapToGeocoded(result: MapboxResult): MapboxGeocoded; } export {}; diff --git a/types/provider/mapbox/MapboxProvider.d.ts.map b/types/provider/mapbox/MapboxProvider.d.ts.map index 99faf51..3fd765a 100644 --- a/types/provider/mapbox/MapboxProvider.d.ts.map +++ b/types/provider/mapbox/MapboxProvider.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"MapboxProvider.d.ts","sourceRoot":"","sources":["../../../src/provider/mapbox/MapboxProvider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,oBAAoB,EAAE,6BAAuB;AAC/E,OAAO,EACL,uBAAuB,EACvB,cAAc,EACd,kBAAkB,EAClB,wBAAwB,EACxB,kBAAkB,EAClB,wBAAwB,EAExB,iBAAiB,EACjB,wBAAwB,EAEzB,aAAiB;AAClB,OAAO,EAAE,GAAG,EAAE,oBAAc;AAuB5B,UAAU,8BAA8B;IACtC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,UAAU,uBAAuB;IAC/B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,SAAS,CAAC;IAEhB,UAAU,EAAE,CACR,SAAS,GACT,QAAQ,GACR,UAAU,GACV,UAAU,GACV,OAAO,GACP,UAAU,GACV,cAAc,GACd,SAAS,GACT,KAAK,CACR,EAAE,CAAC;IACJ,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,uBAAuB,CAAC;IACpC,IAAI,EAAE,MAAM,CAAC;IAEb,UAAU,EAAE,MAAM,CAAC;IAEnB,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,GAAG,CAAC;IACX,MAAM,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACzB,QAAQ,EAAE;QACR,IAAI,EAAE,OAAO,CAAC;QACd,WAAW,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;KAC/B,CAAC;IACF,OAAO,CAAC,EAAE,8BAA8B,EAAE,CAAC;IAE3C,eAAe,CAAC,EAAE;QAChB,MAAM,CAAC,EAAE;YACP,WAAW,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;SAC/B,EAAE,CAAC;KACL,CAAC;CACH;AAED,oBAAY,sBAAsB;IAChC,qBAAqB,kBAAkB;IACvC,+BAA+B,4BAA4B;CAC5D;AAED,MAAM,WAAW,8BACf,SAAQ,wBAAwB;IAChC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,aAAa,CAAC,EAAE,sBAAsB,CAAC;IAChD,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;CAClC;AAED,eAAO,MAAM,4BAA4B;;;;;CAIxC,CAAC;AAEF,MAAM,CAAC,OAAO,OAAO,cAAe,YAAW,iBAAiB;IAC9D,OAAO,CAAC,cAAc,CAA0B;IAEhD,OAAO,CAAC,OAAO,CAAiC;gBAG9C,eAAe,EAAE,uBAAuB,EACxC,OAAO,GAAE,8BAA6D;IAWjE,OAAO,CACZ,KAAK,EAAE,MAAM,GAAG,kBAAkB,GAAG,wBAAwB,EAC7D,QAAQ,EAAE,uBAAuB,GAChC,IAAI;IAsCA,SAAS,CACd,eAAe,EACX,MAAM,GACN,MAAM,GACN,kBAAkB,GAClB,wBAAwB,EAC5B,mBAAmB,EAAE,MAAM,GAAG,MAAM,GAAG,uBAAuB,EAC9D,QAAQ,CAAC,EAAE,uBAAuB,GACjC,IAAI;IAkCP,OAAO,CAAC,gBAAgB;IAkBjB,cAAc,CACnB,MAAM,EAAE,oBAAoB,EAC5B,QAAQ,EAAE,uBAAuB,GAChC,IAAI;WAUO,aAAa,CAAC,MAAM,EAAE,YAAY,GAAG,cAAc;CAkFlE"} \ No newline at end of file +{"version":3,"file":"MapboxProvider.d.ts","sourceRoot":"","sources":["../../../src/provider/mapbox/MapboxProvider.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EACrB,uBAAuB,EACvB,oBAAoB,EACrB,6BAAuB;AACxB,OAAO,EACL,aAAa,EACb,uBAAuB,EACvB,cAAc,EACd,kBAAkB,EAClB,wBAAwB,EACxB,kBAAkB,EAClB,wBAAwB,EAExB,iBAAiB,EACjB,wBAAwB,EAEzB,aAAiB;AAClB,OAAO,EAAE,GAAG,EAAE,oBAAc;AAgB5B,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,mBAAmB,CAAC;IAC1B,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,QAAQ,EAAE,YAAY,EAAE,CAAC;IACzB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,UAAU,8BAA8B;IACtC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,UAAU,uBAAuB;IAC/B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,SAAS,CAAC;IAEhB,UAAU,EAAE,CACR,SAAS,GACT,QAAQ,GACR,UAAU,GACV,UAAU,GACV,OAAO,GACP,UAAU,GACV,cAAc,GACd,SAAS,GACT,KAAK,CACR,EAAE,CAAC;IACJ,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,uBAAuB,CAAC;IACpC,IAAI,EAAE,MAAM,CAAC;IAEb,UAAU,EAAE,MAAM,CAAC;IAEnB,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,GAAG,CAAC;IACX,MAAM,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACzB,QAAQ,EAAE;QACR,IAAI,EAAE,OAAO,CAAC;QACd,WAAW,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;KAC/B,CAAC;IACF,OAAO,CAAC,EAAE,8BAA8B,EAAE,CAAC;IAE3C,eAAe,CAAC,EAAE;QAChB,MAAM,CAAC,EAAE;YACP,WAAW,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;SAC/B,EAAE,CAAC;KACL,CAAC;CACH;AAED,oBAAY,sBAAsB;IAChC,qBAAqB,kBAAkB;IACvC,+BAA+B,4BAA4B;CAC5D;AAED,MAAM,WAAW,8BACf,SAAQ,wBAAwB;IAChC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,aAAa,CAAC,EAAE,sBAAsB,CAAC;IAChD,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;CAClC;AAED,eAAO,MAAM,4BAA4B;;;;;CAIxC,CAAC;AAEF,MAAM,CAAC,OAAO,OAAO,cAAe,YAAW,iBAAiB;IAC9D,OAAO,CAAC,cAAc,CAA0B;IAEhD,OAAO,CAAC,OAAO,CAAiC;gBAG9C,eAAe,EAAE,uBAAuB,EACxC,OAAO,GAAE,8BAA6D;IAWjE,OAAO,CACZ,KAAK,EAAE,MAAM,GAAG,kBAAkB,GAAG,wBAAwB,EAC7D,QAAQ,EAAE,uBAAuB,EACjC,aAAa,CAAC,EAAE,aAAa,GAC5B,IAAI;IAsCA,SAAS,CACd,eAAe,EACX,MAAM,GACN,MAAM,GACN,kBAAkB,GAClB,wBAAwB,EAC5B,mBAAmB,EAAE,MAAM,GAAG,MAAM,GAAG,uBAAuB,EAC9D,uBAAuB,CAAC,EAAE,uBAAuB,GAAG,aAAa,EACjE,aAAa,CAAC,EAAE,aAAa,GAC5B,IAAI;IAuCP,OAAO,CAAC,gBAAgB;IAkBjB,cAAc,CACnB,MAAM,EAAE,oBAAoB,EAC5B,QAAQ,EAAE,uBAAuB,EACjC,OAAO,CAAC,EAAE,qBAAqB,EAC/B,aAAa,CAAC,EAAE,aAAa,GAC5B,IAAI;WAeO,aAAa,CAAC,MAAM,EAAE,YAAY,GAAG,cAAc;CAkFlE"} \ No newline at end of file diff --git a/types/provider/nominatim/NominatimProvider.d.ts b/types/provider/nominatim/NominatimProvider.d.ts index 7260a1a..8c1dddd 100644 --- a/types/provider/nominatim/NominatimProvider.d.ts +++ b/types/provider/nominatim/NominatimProvider.d.ts @@ -1,5 +1,9 @@ import { ExternalLoaderHeaders, ExternalLoaderInterface, ExternalLoaderParams } from "../../ExternalLoader"; -import { GeocodedResultsCallback, NominatimGeocoded, NominatimReverseQuery, NominatimReverseQueryObject, NominatimGeocodeQueryObject, NominatimGeocodeQuery, ProviderInterface, ProviderOptionsInterface } from "./.."; +import { ErrorCallback, GeocodedResultsCallback, NominatimGeocoded, NominatimReverseQuery, NominatimReverseQueryObject, NominatimGeocodeQueryObject, NominatimGeocodeQuery, ProviderInterface, ProviderOptionsInterface } from "./.."; +interface NominatimErrorResponse { + error: string; +} +export declare type NominatimResponse = NominatimErrorResponse | NominatimResult | NominatimResult[]; export interface NominatimResult { place_id: number; licence: string; @@ -47,11 +51,12 @@ export default class NominatimProvider implements ProviderInterface { private externalLoader; private options; constructor(_externalLoader: ExternalLoaderInterface, options?: NominatimProviderOptionsInterface); - geocode(query: string | NominatimGeocodeQuery | NominatimGeocodeQueryObject, callback: GeocodedResultsCallback): void; - geodecode(latitudeOrQuery: number | string | NominatimReverseQuery | NominatimReverseQueryObject, longitudeOrCallback: number | string | GeocodedResultsCallback, callback?: GeocodedResultsCallback): void; + geocode(query: string | NominatimGeocodeQuery | NominatimGeocodeQueryObject, callback: GeocodedResultsCallback, errorCallback?: ErrorCallback): void; + geodecode(latitudeOrQuery: number | string | NominatimReverseQuery | NominatimReverseQueryObject, longitudeOrCallback: number | string | GeocodedResultsCallback, callbackOrErrorCallback?: GeocodedResultsCallback | ErrorCallback, errorCallback?: ErrorCallback): void; private withCommonParams; private getHeaders; - executeRequest(params: ExternalLoaderParams, callback: GeocodedResultsCallback, headers?: ExternalLoaderHeaders): void; + executeRequest(params: ExternalLoaderParams, callback: GeocodedResultsCallback, headers?: ExternalLoaderHeaders, errorCallback?: ErrorCallback): void; static mapToGeocoded(result: NominatimResult): NominatimGeocoded; } +export {}; //# sourceMappingURL=NominatimProvider.d.ts.map \ No newline at end of file diff --git a/types/provider/nominatim/NominatimProvider.d.ts.map b/types/provider/nominatim/NominatimProvider.d.ts.map index 8e77eac..b930e3f 100644 --- a/types/provider/nominatim/NominatimProvider.d.ts.map +++ b/types/provider/nominatim/NominatimProvider.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"NominatimProvider.d.ts","sourceRoot":"","sources":["../../../src/provider/nominatim/NominatimProvider.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EACrB,uBAAuB,EACvB,oBAAoB,EACrB,6BAAuB;AACxB,OAAO,EACL,uBAAuB,EACvB,iBAAiB,EACjB,qBAAqB,EACrB,2BAA2B,EAC3B,2BAA2B,EAC3B,qBAAqB,EAErB,iBAAiB,EACjB,wBAAwB,EAEzB,aAAiB;AAsBlB,MAAM,WAAW,eAAe;IAE9B,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAEhB,QAAQ,EAAE,MAAM,CAAC;IAEjB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IAC9C,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IAEZ,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE;QACP,UAAU,CAAC,EAAE,MAAM,CAAC;QAEpB,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,OAAO,CAAC,EAAE,MAAM,CAAC;QAEjB,YAAY,CAAC,EAAE,MAAM,CAAC;KACvB,CAAC;CACH;AAED,MAAM,WAAW,iCACf,SAAQ,wBAAwB;IAChC,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,eAAO,MAAM,+BAA+B;;;;;;CAI3C,CAAC;AAEF,MAAM,CAAC,OAAO,OAAO,iBAAkB,YAAW,iBAAiB;IACjE,OAAO,CAAC,cAAc,CAA0B;IAEhD,OAAO,CAAC,OAAO,CAAoC;gBAGjD,eAAe,EAAE,uBAAuB,EACxC,OAAO,GAAE,iCAAmE;IAcvE,OAAO,CACZ,KAAK,EAAE,MAAM,GAAG,qBAAqB,GAAG,2BAA2B,EACnE,QAAQ,EAAE,uBAAuB,GAChC,IAAI;IAuCA,SAAS,CACd,eAAe,EACX,MAAM,GACN,MAAM,GACN,qBAAqB,GACrB,2BAA2B,EAC/B,mBAAmB,EAAE,MAAM,GAAG,MAAM,GAAG,uBAAuB,EAC9D,QAAQ,CAAC,EAAE,uBAAuB,GACjC,IAAI;IA8BP,OAAO,CAAC,gBAAgB;IAaxB,OAAO,CAAC,UAAU;IAOX,cAAc,CACnB,MAAM,EAAE,oBAAoB,EAC5B,QAAQ,EAAE,uBAAuB,EACjC,OAAO,CAAC,EAAE,qBAAqB,GAC9B,IAAI;WAqBO,aAAa,CAAC,MAAM,EAAE,eAAe,GAAG,iBAAiB;CA0ExE"} \ No newline at end of file +{"version":3,"file":"NominatimProvider.d.ts","sourceRoot":"","sources":["../../../src/provider/nominatim/NominatimProvider.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EACrB,uBAAuB,EACvB,oBAAoB,EACrB,6BAAuB;AACxB,OAAO,EACL,aAAa,EACb,uBAAuB,EACvB,iBAAiB,EACjB,qBAAqB,EACrB,2BAA2B,EAC3B,2BAA2B,EAC3B,qBAAqB,EAErB,iBAAiB,EACjB,wBAAwB,EAEzB,aAAiB;AAuBlB,UAAU,sBAAsB;IAC9B,KAAK,EAAE,MAAM,CAAC;CACf;AAED,oBAAY,iBAAiB,GACzB,sBAAsB,GACtB,eAAe,GACf,eAAe,EAAE,CAAC;AAEtB,MAAM,WAAW,eAAe;IAE9B,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAEhB,QAAQ,EAAE,MAAM,CAAC;IAEjB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IAC9C,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IAEZ,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE;QACP,UAAU,CAAC,EAAE,MAAM,CAAC;QAEpB,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,OAAO,CAAC,EAAE,MAAM,CAAC;QAEjB,YAAY,CAAC,EAAE,MAAM,CAAC;KACvB,CAAC;CACH;AAED,MAAM,WAAW,iCACf,SAAQ,wBAAwB;IAChC,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,eAAO,MAAM,+BAA+B;;;;;;CAI3C,CAAC;AAEF,MAAM,CAAC,OAAO,OAAO,iBAAkB,YAAW,iBAAiB;IACjE,OAAO,CAAC,cAAc,CAA0B;IAEhD,OAAO,CAAC,OAAO,CAAoC;gBAGjD,eAAe,EAAE,uBAAuB,EACxC,OAAO,GAAE,iCAAmE;IAcvE,OAAO,CACZ,KAAK,EAAE,MAAM,GAAG,qBAAqB,GAAG,2BAA2B,EACnE,QAAQ,EAAE,uBAAuB,EACjC,aAAa,CAAC,EAAE,aAAa,GAC5B,IAAI;IAuCA,SAAS,CACd,eAAe,EACX,MAAM,GACN,MAAM,GACN,qBAAqB,GACrB,2BAA2B,EAC/B,mBAAmB,EAAE,MAAM,GAAG,MAAM,GAAG,uBAAuB,EAC9D,uBAAuB,CAAC,EAAE,uBAAuB,GAAG,aAAa,EACjE,aAAa,CAAC,EAAE,aAAa,GAC5B,IAAI;IAwCP,OAAO,CAAC,gBAAgB;IAaxB,OAAO,CAAC,UAAU;IAOX,cAAc,CACnB,MAAM,EAAE,oBAAoB,EAC5B,QAAQ,EAAE,uBAAuB,EACjC,OAAO,CAAC,EAAE,qBAAqB,EAC/B,aAAa,CAAC,EAAE,aAAa,GAC5B,IAAI;WA+BO,aAAa,CAAC,MAAM,EAAE,eAAe,GAAG,iBAAiB;CA0ExE"} \ No newline at end of file diff --git a/types/provider/opencage/OpenCageProvider.d.ts b/types/provider/opencage/OpenCageProvider.d.ts index ad37f01..a45f815 100644 --- a/types/provider/opencage/OpenCageProvider.d.ts +++ b/types/provider/opencage/OpenCageProvider.d.ts @@ -1,5 +1,5 @@ -import { ExternalLoaderInterface, ExternalLoaderParams } from "../../ExternalLoader"; -import { GeocodedResultsCallback, OpenCageGeocoded, OpenCageGeocodeQuery, OpenCageGeocodeQueryObject, OpenCageReverseQuery, OpenCageReverseQueryObject, ProviderInterface, ProviderOptionsInterface } from "./.."; +import { ExternalLoaderHeaders, ExternalLoaderInterface, ExternalLoaderParams } from "../../ExternalLoader"; +import { ErrorCallback, GeocodedResultsCallback, OpenCageGeocoded, OpenCageGeocodeQuery, OpenCageGeocodeQueryObject, OpenCageReverseQuery, OpenCageReverseQueryObject, ProviderInterface, ProviderOptionsInterface } from "./.."; interface OpenCageCoordinates { lat: number; lng: number; @@ -10,6 +10,33 @@ interface OpenCageSun { civil: number; nautical: number; } +export interface OpenCageResponse { + documentation: string; + licences: { + name: string; + url: string; + }[]; + rate: { + limit: number; + remaining: number; + reset: number; + }; + results: OpenCageResult[]; + status: { + code: 200 | 400 | 401 | 402 | 403 | 404 | 405 | 408 | 410 | 429 | 503; + message: string; + }; + stay_informed: { + blog: string; + twitter: string; + }; + thanks: string; + timestamp: { + created_http: string; + created_unix: number; + }; + total_results: number; +} export interface OpenCageResult { annotations: { callingcode: number; @@ -147,10 +174,10 @@ export default class OpenCageProvider implements ProviderInterface { private externalLoader; private options; constructor(_externalLoader: ExternalLoaderInterface, options?: OpenCageProviderOptionsInterface); - geocode(query: string | OpenCageGeocodeQuery | OpenCageGeocodeQueryObject, callback: GeocodedResultsCallback): void; - geodecode(latitudeOrQuery: number | string | OpenCageReverseQuery | OpenCageReverseQueryObject, longitudeOrCallback: number | string | GeocodedResultsCallback, callback?: GeocodedResultsCallback): void; + geocode(query: string | OpenCageGeocodeQuery | OpenCageGeocodeQueryObject, callback: GeocodedResultsCallback, errorCallback?: ErrorCallback): void; + geodecode(latitudeOrQuery: number | string | OpenCageReverseQuery | OpenCageReverseQueryObject, longitudeOrCallback: number | string | GeocodedResultsCallback, callbackOrErrorCallback?: GeocodedResultsCallback | ErrorCallback, errorCallback?: ErrorCallback): void; private withCommonParams; - executeRequest(params: ExternalLoaderParams, callback: GeocodedResultsCallback): void; + executeRequest(params: ExternalLoaderParams, callback: GeocodedResultsCallback, headers?: ExternalLoaderHeaders, errorCallback?: ErrorCallback): void; static mapToGeocoded(result: OpenCageResult): OpenCageGeocoded; } export {}; diff --git a/types/provider/opencage/OpenCageProvider.d.ts.map b/types/provider/opencage/OpenCageProvider.d.ts.map index 40a1780..f7cb8dc 100644 --- a/types/provider/opencage/OpenCageProvider.d.ts.map +++ b/types/provider/opencage/OpenCageProvider.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"OpenCageProvider.d.ts","sourceRoot":"","sources":["../../../src/provider/opencage/OpenCageProvider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,oBAAoB,EAAE,6BAAuB;AAC/E,OAAO,EACL,uBAAuB,EACvB,gBAAgB,EAChB,oBAAoB,EACpB,0BAA0B,EAC1B,oBAAoB,EACpB,0BAA0B,EAE1B,iBAAiB,EACjB,wBAAwB,EAEzB,aAAiB;AAmBlB,UAAU,mBAAmB;IAC3B,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;CACb;AAED,UAAU,WAAW;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;CAClB;AAkCD,MAAM,WAAW,cAAc;IAC7B,WAAW,EAAE;QACX,WAAW,EAAE,MAAM,CAAC;QACpB,QAAQ,EAAE;YAER,iBAAiB,EAAE,MAAM,EAAE,CAAC;YAE5B,YAAY,EAAE,MAAM,CAAC;YAErB,mBAAmB,CAAC,EAAE,MAAM,CAAC;YAE7B,WAAW,EAAE,MAAM,CAAC;YAEpB,QAAQ,EAAE,MAAM,CAAC;YAEjB,WAAW,EAAE,MAAM,CAAC;YACpB,IAAI,EAAE,MAAM,CAAC;YAEb,qBAAqB,EAAE,MAAM,CAAC;YAC9B,OAAO,EAAE,MAAM,CAAC;YAEhB,eAAe,EAAE,MAAM,CAAC;YACxB,MAAM,EAAE,MAAM,CAAC;YAEf,YAAY,EAAE,MAAM,CAAC;YAErB,mBAAmB,EAAE,MAAM,CAAC;SAC7B,CAAC;QACF,GAAG,EAAE;YACH,GAAG,EAAE,MAAM,CAAC;YACZ,GAAG,EAAE,MAAM,CAAC;SACb,CAAC;QACF,IAAI,CAAC,EAAE;YACL,KAAK,CAAC,EAAE,MAAM,CAAC;YACf,MAAM,CAAC,EAAE,MAAM,CAAC;SACjB,CAAC;QACF,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,GAAG,CAAC,EAAE;YACJ,OAAO,EAAE,MAAM,CAAC;YAChB,QAAQ,EAAE,MAAM,CAAC;SAClB,CAAC;QACF,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,QAAQ,EAAE;YACR,CAAC,EAAE,MAAM,CAAC;YACV,CAAC,EAAE,MAAM,CAAC;SACX,CAAC;QACF,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,GAAG,EAAE;YAEH,QAAQ,CAAC,EAAE,MAAM,CAAC;YAElB,QAAQ,EAAE,MAAM,CAAC;YACjB,GAAG,EAAE,MAAM,CAAC;SACb,CAAC;QACF,KAAK,EAAE,MAAM,CAAC;QACd,QAAQ,EAAE;YAER,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;YAC3B,IAAI,CAAC,EAAE,MAAM,CAAC;YAEd,SAAS,CAAC,EAAE,MAAM,CAAC;YAEnB,cAAc,CAAC,EAAE,MAAM,CAAC;YAExB,mBAAmB,CAAC,EAAE,MAAM,CAAC;YAE7B,QAAQ,EAAE,MAAM,GAAG,KAAK,CAAC;SAC1B,CAAC;QACF,GAAG,EAAE;YACH,IAAI,EAAE,WAAW,CAAC;YAClB,GAAG,EAAE,WAAW,CAAC;SAClB,CAAC;QACF,QAAQ,EAAE;YACR,IAAI,EAAE,MAAM,CAAC;YAEb,UAAU,EAAE,MAAM,CAAC;YAEnB,UAAU,EAAE,MAAM,CAAC;YAEnB,aAAa,EAAE,MAAM,CAAC;YAEtB,UAAU,EAAE,MAAM,CAAC;SACpB,CAAC;QAEF,MAAM,EAAE;YACN,OAAO,EAAE;gBACP,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC;aAC1B,CAAC;YAEF,qBAAqB,EAAE,CAAC,KAAK,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC,EAAE,CAAC;SACtE,CAAC;QACF,UAAU,CAAC,EAAE;YACX,KAAK,EAAE,MAAM,CAAC;SACf,CAAC;QACF,QAAQ,CAAC,EAAE,MAAM,CAAC;KACnB,CAAC;IACF,MAAM,EAAE;QACN,SAAS,EAAE,mBAAmB,CAAC;QAC/B,SAAS,EAAE,mBAAmB,CAAC;KAChC,CAAC;IACF,UAAU,EAAE;QACV,oBAAoB,CAAC,EAAE,MAAM,CAAC;QAC9B,oBAAoB,CAAC,EAAE,MAAM,CAAC;QAC9B,SAAS,EACL,aAAa,GACb,UAAU,GACV,QAAQ,GACR,UAAU,GACV,cAAc,GACd,WAAW,GACX,WAAW,GACX,YAAY,GACZ,QAAQ,GACR,YAAY,GACZ,UAAU,GACV,eAAe,GACf,qBAAqB,GACrB,OAAO,GACP,kBAAkB,GAClB,UAAU,GACV,MAAM,GACN,QAAQ,GACR,gBAAgB,GAChB,gBAAgB,GAChB,SAAS,CAAC;QACd,KAAK,EAAE,MAAM,CAAC;QACd,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,IAAI,CAAC,EAAE,MAAM,CAAC;QAEd,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB,SAAS,CAAC,EACN,QAAQ,GACR,YAAY,GACZ,MAAM,GACN,QAAQ,GACR,SAAS,GACT,eAAe,GACf,eAAe,CAAC;QACpB,OAAO,CAAC,EAAE,MAAM,CAAC;QAEjB,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,MAAM,CAAC,EAAE,MAAM,CAAC;QAEhB,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,MAAM,CAAC,EAAE,MAAM,CAAC;QAEhB,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,UAAU,CAAC,EAAE,MAAM,CAAC;QAEpB,eAAe,CAAC,EAAE,MAAM,CAAC;QACzB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,IAAI,CAAC,EAAE,MAAM,CAAC;QAEd,cAAc,CAAC,EAAE,MAAM,CAAC;QAExB,mBAAmB,CAAC,EAAE,MAAM,CAAC;QAE7B,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,KAAK,CAAC,EAAE,MAAM,CAAC;QAEf,UAAU,CAAC,EAAE,MAAM,CAAC;QAEpB,cAAc,CAAC,EAAE,MAAM,CAAC;QACxB,MAAM,CAAC,EAAE,MAAM,CAAC;QAEhB,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,CAAC;IACF,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,mBAAmB,CAAC;CAC/B;AAED,MAAM,WAAW,gCACf,SAAQ,wBAAwB;IAChC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;CAClC;AAED,eAAO,MAAM,8BAA8B;;;;CAG1C,CAAC;AAEF,MAAM,CAAC,OAAO,OAAO,gBAAiB,YAAW,iBAAiB;IAChE,OAAO,CAAC,cAAc,CAA0B;IAEhD,OAAO,CAAC,OAAO,CAAmC;gBAGhD,eAAe,EAAE,uBAAuB,EACxC,OAAO,GAAE,gCAAiE;IAWrE,OAAO,CACZ,KAAK,EAAE,MAAM,GAAG,oBAAoB,GAAG,0BAA0B,EACjE,QAAQ,EAAE,uBAAuB,GAChC,IAAI;IAkCA,SAAS,CACd,eAAe,EACX,MAAM,GACN,MAAM,GACN,oBAAoB,GACpB,0BAA0B,EAC9B,mBAAmB,EAAE,MAAM,GAAG,MAAM,GAAG,uBAAuB,EAC9D,QAAQ,CAAC,EAAE,uBAAuB,GACjC,IAAI;IA6BP,OAAO,CAAC,gBAAgB;IAkBjB,cAAc,CACnB,MAAM,EAAE,oBAAoB,EAC5B,QAAQ,EAAE,uBAAuB,GAChC,IAAI;WAiEO,aAAa,CAAC,MAAM,EAAE,cAAc,GAAG,gBAAgB;CAmGtE"} \ No newline at end of file +{"version":3,"file":"OpenCageProvider.d.ts","sourceRoot":"","sources":["../../../src/provider/opencage/OpenCageProvider.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EACrB,uBAAuB,EACvB,oBAAoB,EACrB,6BAAuB;AACxB,OAAO,EACL,aAAa,EACb,uBAAuB,EACvB,gBAAgB,EAChB,oBAAoB,EACpB,0BAA0B,EAC1B,oBAAoB,EACpB,0BAA0B,EAE1B,iBAAiB,EACjB,wBAAwB,EAEzB,aAAiB;AAoBlB,UAAU,mBAAmB;IAC3B,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;CACb;AAED,UAAU,WAAW;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,gBAAgB;IAC/B,aAAa,EAAE,MAAM,CAAC;IACtB,QAAQ,EAAE;QACR,IAAI,EAAE,MAAM,CAAC;QACb,GAAG,EAAE,MAAM,CAAC;KACb,EAAE,CAAC;IACJ,IAAI,EAAE;QACJ,KAAK,EAAE,MAAM,CAAC;QACd,SAAS,EAAE,MAAM,CAAC;QAClB,KAAK,EAAE,MAAM,CAAC;KACf,CAAC;IACF,OAAO,EAAE,cAAc,EAAE,CAAC;IAC1B,MAAM,EAAE;QACN,IAAI,EAAE,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;QACtE,OAAO,EAAE,MAAM,CAAC;KACjB,CAAC;IAEF,aAAa,EAAE;QACb,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,EAAE,MAAM,CAAC;KACjB,CAAC;IACF,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE;QAET,YAAY,EAAE,MAAM,CAAC;QAErB,YAAY,EAAE,MAAM,CAAC;KACtB,CAAC;IAEF,aAAa,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,cAAc;IAC7B,WAAW,EAAE;QACX,WAAW,EAAE,MAAM,CAAC;QACpB,QAAQ,EAAE;YAER,iBAAiB,EAAE,MAAM,EAAE,CAAC;YAE5B,YAAY,EAAE,MAAM,CAAC;YAErB,mBAAmB,CAAC,EAAE,MAAM,CAAC;YAE7B,WAAW,EAAE,MAAM,CAAC;YAEpB,QAAQ,EAAE,MAAM,CAAC;YAEjB,WAAW,EAAE,MAAM,CAAC;YACpB,IAAI,EAAE,MAAM,CAAC;YAEb,qBAAqB,EAAE,MAAM,CAAC;YAC9B,OAAO,EAAE,MAAM,CAAC;YAEhB,eAAe,EAAE,MAAM,CAAC;YACxB,MAAM,EAAE,MAAM,CAAC;YAEf,YAAY,EAAE,MAAM,CAAC;YAErB,mBAAmB,EAAE,MAAM,CAAC;SAC7B,CAAC;QACF,GAAG,EAAE;YACH,GAAG,EAAE,MAAM,CAAC;YACZ,GAAG,EAAE,MAAM,CAAC;SACb,CAAC;QACF,IAAI,CAAC,EAAE;YACL,KAAK,CAAC,EAAE,MAAM,CAAC;YACf,MAAM,CAAC,EAAE,MAAM,CAAC;SACjB,CAAC;QACF,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,GAAG,CAAC,EAAE;YACJ,OAAO,EAAE,MAAM,CAAC;YAChB,QAAQ,EAAE,MAAM,CAAC;SAClB,CAAC;QACF,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,QAAQ,EAAE;YACR,CAAC,EAAE,MAAM,CAAC;YACV,CAAC,EAAE,MAAM,CAAC;SACX,CAAC;QACF,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,GAAG,EAAE;YAEH,QAAQ,CAAC,EAAE,MAAM,CAAC;YAElB,QAAQ,EAAE,MAAM,CAAC;YACjB,GAAG,EAAE,MAAM,CAAC;SACb,CAAC;QACF,KAAK,EAAE,MAAM,CAAC;QACd,QAAQ,EAAE;YAER,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;YAC3B,IAAI,CAAC,EAAE,MAAM,CAAC;YAEd,SAAS,CAAC,EAAE,MAAM,CAAC;YAEnB,cAAc,CAAC,EAAE,MAAM,CAAC;YAExB,mBAAmB,CAAC,EAAE,MAAM,CAAC;YAE7B,QAAQ,EAAE,MAAM,GAAG,KAAK,CAAC;SAC1B,CAAC;QACF,GAAG,EAAE;YACH,IAAI,EAAE,WAAW,CAAC;YAClB,GAAG,EAAE,WAAW,CAAC;SAClB,CAAC;QACF,QAAQ,EAAE;YACR,IAAI,EAAE,MAAM,CAAC;YAEb,UAAU,EAAE,MAAM,CAAC;YAEnB,UAAU,EAAE,MAAM,CAAC;YAEnB,aAAa,EAAE,MAAM,CAAC;YAEtB,UAAU,EAAE,MAAM,CAAC;SACpB,CAAC;QAEF,MAAM,EAAE;YACN,OAAO,EAAE;gBACP,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC;aAC1B,CAAC;YAEF,qBAAqB,EAAE,CAAC,KAAK,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC,EAAE,CAAC;SACtE,CAAC;QACF,UAAU,CAAC,EAAE;YACX,KAAK,EAAE,MAAM,CAAC;SACf,CAAC;QACF,QAAQ,CAAC,EAAE,MAAM,CAAC;KACnB,CAAC;IACF,MAAM,EAAE;QACN,SAAS,EAAE,mBAAmB,CAAC;QAC/B,SAAS,EAAE,mBAAmB,CAAC;KAChC,CAAC;IACF,UAAU,EAAE;QACV,oBAAoB,CAAC,EAAE,MAAM,CAAC;QAC9B,oBAAoB,CAAC,EAAE,MAAM,CAAC;QAC9B,SAAS,EACL,aAAa,GACb,UAAU,GACV,QAAQ,GACR,UAAU,GACV,cAAc,GACd,WAAW,GACX,WAAW,GACX,YAAY,GACZ,QAAQ,GACR,YAAY,GACZ,UAAU,GACV,eAAe,GACf,qBAAqB,GACrB,OAAO,GACP,kBAAkB,GAClB,UAAU,GACV,MAAM,GACN,QAAQ,GACR,gBAAgB,GAChB,gBAAgB,GAChB,SAAS,CAAC;QACd,KAAK,EAAE,MAAM,CAAC;QACd,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,IAAI,CAAC,EAAE,MAAM,CAAC;QAEd,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB,SAAS,CAAC,EACN,QAAQ,GACR,YAAY,GACZ,MAAM,GACN,QAAQ,GACR,SAAS,GACT,eAAe,GACf,eAAe,CAAC;QACpB,OAAO,CAAC,EAAE,MAAM,CAAC;QAEjB,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,MAAM,CAAC,EAAE,MAAM,CAAC;QAEhB,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,MAAM,CAAC,EAAE,MAAM,CAAC;QAEhB,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,UAAU,CAAC,EAAE,MAAM,CAAC;QAEpB,eAAe,CAAC,EAAE,MAAM,CAAC;QACzB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,IAAI,CAAC,EAAE,MAAM,CAAC;QAEd,cAAc,CAAC,EAAE,MAAM,CAAC;QAExB,mBAAmB,CAAC,EAAE,MAAM,CAAC;QAE7B,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,KAAK,CAAC,EAAE,MAAM,CAAC;QAEf,UAAU,CAAC,EAAE,MAAM,CAAC;QAEpB,cAAc,CAAC,EAAE,MAAM,CAAC;QACxB,MAAM,CAAC,EAAE,MAAM,CAAC;QAEhB,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,CAAC;IACF,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,mBAAmB,CAAC;CAC/B;AAED,MAAM,WAAW,gCACf,SAAQ,wBAAwB;IAChC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;CAClC;AAED,eAAO,MAAM,8BAA8B;;;;CAG1C,CAAC;AAEF,MAAM,CAAC,OAAO,OAAO,gBAAiB,YAAW,iBAAiB;IAChE,OAAO,CAAC,cAAc,CAA0B;IAEhD,OAAO,CAAC,OAAO,CAAmC;gBAGhD,eAAe,EAAE,uBAAuB,EACxC,OAAO,GAAE,gCAAiE;IAWrE,OAAO,CACZ,KAAK,EAAE,MAAM,GAAG,oBAAoB,GAAG,0BAA0B,EACjE,QAAQ,EAAE,uBAAuB,EACjC,aAAa,CAAC,EAAE,aAAa,GAC5B,IAAI;IAkCA,SAAS,CACd,eAAe,EACX,MAAM,GACN,MAAM,GACN,oBAAoB,GACpB,0BAA0B,EAC9B,mBAAmB,EAAE,MAAM,GAAG,MAAM,GAAG,uBAAuB,EAC9D,uBAAuB,CAAC,EAAE,uBAAuB,GAAG,aAAa,EACjE,aAAa,CAAC,EAAE,aAAa,GAC5B,IAAI;IAkCP,OAAO,CAAC,gBAAgB;IAkBjB,cAAc,CACnB,MAAM,EAAE,oBAAoB,EAC5B,QAAQ,EAAE,uBAAuB,EACjC,OAAO,CAAC,EAAE,qBAAqB,EAC/B,aAAa,CAAC,EAAE,aAAa,GAC5B,IAAI;WA+DO,aAAa,CAAC,MAAM,EAAE,cAAc,GAAG,gBAAgB;CAmGtE"} \ No newline at end of file From 19cca4a45be4a18fd58c2749088ce605ae9775df Mon Sep 17 00:00:00 2001 From: Alan Poulain Date: Fri, 14 Aug 2020 21:08:29 +0200 Subject: [PATCH 33/56] Replace stub tests with record tests (#4) --- .eslintrc | 13 +- .github/workflows/coverage.yml | 26 + .github/workflows/release.yml | 2 + .gitignore | 5 +- .nycrc.json | 4 + CHANGELOG.md | 2 + README.md | 9 +- package-lock.json | 2234 +++++++++++++++-- package.json | 18 +- spec/provider/BingProvider.spec.ts | 167 +- spec/provider/ChainProvider.spec.ts | 394 +++ spec/provider/GoogleMapsProvider.spec.ts | 297 +-- spec/provider/MapboxProvider.spec.ts | 191 +- spec/provider/MapquestProvider.spec.ts | 141 +- spec/provider/NominatimProvider.spec.ts | 224 +- spec/provider/OpenCageProvider.spec.ts | 376 ++- spec/provider/YandexProvider.spec.ts | 164 +- .../recording.har | 158 ++ .../recording.har | 154 ++ .../recording.har | 141 ++ .../recording.har | 267 ++ .../recording.har | 250 ++ .../recording.har | 151 ++ .../recording.har | 250 ++ .../recording.har | 267 ++ .../recording.har | 271 ++ .../recording.har | 254 ++ .../recording.har | 151 ++ .../recording.har | 254 ++ .../recording.har | 271 ++ .../recording.har | 151 ++ .../recording.har | 151 ++ .../recording.har | 147 ++ .../recording.har | 163 ++ .../recording.har | 163 ++ .../recording.har | 114 + .../recording.har | 163 ++ .../recording.har | 167 ++ .../recording.har | 147 ++ .../recording.har | 139 + .../recording.har | 139 + .../recording.har | 127 + .../recording.har | 127 + .../recording.har | 98 + .../recording.har | 139 + .../recording.har | 126 + .../recording.har | 130 + .../recording.har | 151 ++ .../recording.har | 151 ++ .../recording.har | 130 + spec/setupPolly.ts | 48 + src/ExternalLoader.ts | 31 +- src/provider/BingProvider.ts | 19 +- src/provider/ChainProvider.ts | 34 +- src/provider/MapquestProvider.ts | 21 +- src/provider/ProviderHelpers.ts | 21 +- src/provider/ProviderInterface.ts | 21 +- src/provider/YandexProvider.ts | 19 +- src/provider/googlemaps/GoogleMapsProvider.ts | 23 +- src/provider/mapbox/MapboxProvider.ts | 20 +- src/provider/nominatim/NominatimProvider.ts | 22 +- src/provider/opencage/OpenCageProvider.ts | 22 +- src/query/GeocodeQuery.ts | 7 +- src/query/ReverseQuery.ts | 9 +- tsconfig.json | 1 + types/AdminLevel.d.ts | 17 - types/AdminLevel.d.ts.map | 1 - types/ExternalLoader.d.ts | 37 - types/ExternalLoader.d.ts.map | 1 - types/GeoJsonDumper.d.ts | 23 - types/GeoJsonDumper.d.ts.map | 1 - types/Geocoded.d.ts | 62 - types/Geocoded.d.ts.map | 1 - types/GeocoderProviderFactory.d.ts | 42 - types/GeocoderProviderFactory.d.ts.map | 1 - types/UniversalGeocoder.d.ts | 6 - types/UniversalGeocoder.d.ts.map | 1 - types/error/ResponseError.d.ts | 8 - types/error/ResponseError.d.ts.map | 1 - types/error/index.d.ts | 2 - types/error/index.d.ts.map | 1 - types/global.d.ts | 9 - types/global.d.ts.map | 1 - types/index.d.ts | 25 - types/index.d.ts.map | 1 - types/provider/BingProvider.d.ts | 42 - types/provider/BingProvider.d.ts.map | 1 - types/provider/ChainProvider.d.ts | 26 - types/provider/ChainProvider.d.ts.map | 1 - types/provider/MapquestProvider.d.ts | 42 - types/provider/MapquestProvider.d.ts.map | 1 - types/provider/ProviderHelpers.d.ts | 9 - types/provider/ProviderHelpers.d.ts.map | 1 - types/provider/ProviderInterface.d.ts | 19 - types/provider/ProviderInterface.d.ts.map | 1 - types/provider/YandexProvider.d.ts | 60 - types/provider/YandexProvider.d.ts.map | 1 - .../googlemaps/GoogleMapsGeocodeQuery.d.ts | 26 - .../GoogleMapsGeocodeQuery.d.ts.map | 1 - .../googlemaps/GoogleMapsGeocoded.d.ts | 86 - .../googlemaps/GoogleMapsGeocoded.d.ts.map | 1 - .../googlemaps/GoogleMapsProvider.d.ts | 59 - .../googlemaps/GoogleMapsProvider.d.ts.map | 1 - .../googlemaps/GoogleMapsReverseQuery.d.ts | 21 - .../GoogleMapsReverseQuery.d.ts.map | 1 - types/provider/googlemaps/index.d.ts | 8 - types/provider/googlemaps/index.d.ts.map | 1 - types/provider/index.d.ts | 16 - types/provider/index.d.ts.map | 1 - types/provider/mapbox/MapboxGeocodeQuery.d.ts | 21 - .../mapbox/MapboxGeocodeQuery.d.ts.map | 1 - types/provider/mapbox/MapboxGeocoded.d.ts | 13 - types/provider/mapbox/MapboxGeocoded.d.ts.map | 1 - types/provider/mapbox/MapboxProvider.d.ts | 75 - types/provider/mapbox/MapboxProvider.d.ts.map | 1 - types/provider/mapbox/MapboxReverseQuery.d.ts | 23 - .../mapbox/MapboxReverseQuery.d.ts.map | 1 - types/provider/mapbox/index.d.ts | 8 - types/provider/mapbox/index.d.ts.map | 1 - .../nominatim/NominatimGeocodeQuery.d.ts | 26 - .../nominatim/NominatimGeocodeQuery.d.ts.map | 1 - .../provider/nominatim/NominatimGeocoded.d.ts | 33 - .../nominatim/NominatimGeocoded.d.ts.map | 1 - .../provider/nominatim/NominatimProvider.d.ts | 62 - .../nominatim/NominatimProvider.d.ts.map | 1 - .../nominatim/NominatimReverseQuery.d.ts | 13 - .../nominatim/NominatimReverseQuery.d.ts.map | 1 - types/provider/nominatim/index.d.ts | 17 - types/provider/nominatim/index.d.ts.map | 1 - .../opencage/OpenCageGeocodeQuery.d.ts | 26 - .../opencage/OpenCageGeocodeQuery.d.ts.map | 1 - types/provider/opencage/OpenCageGeocoded.d.ts | 33 - .../opencage/OpenCageGeocoded.d.ts.map | 1 - types/provider/opencage/OpenCageProvider.d.ts | 184 -- .../opencage/OpenCageProvider.d.ts.map | 1 - .../opencage/OpenCageReverseQuery.d.ts | 21 - .../opencage/OpenCageReverseQuery.d.ts.map | 1 - types/provider/opencage/index.d.ts | 8 - types/provider/opencage/index.d.ts.map | 1 - types/query/GeocodeQuery.d.ts | 34 - types/query/GeocodeQuery.d.ts.map | 1 - types/query/ReverseQuery.d.ts | 26 - types/query/ReverseQuery.d.ts.map | 1 - types/query/index.d.ts | 5 - types/query/index.d.ts.map | 1 - types/types.d.ts | 5 - types/types.d.ts.map | 1 - types/utils.d.ts | 13 - types/utils.d.ts.map | 1 - webpack.dev.js | 2 +- webpack.prod.js | 2 +- website/css/main.css | 3 + 152 files changed, 9200 insertions(+), 2387 deletions(-) create mode 100644 .github/workflows/coverage.yml create mode 100644 .nycrc.json create mode 100644 spec/provider/ChainProvider.spec.ts create mode 100644 spec/recordings/Bing-Geocoder-Provider_2231523888/receives-correct-geocoding-results_3640432360/recording.har create mode 100644 spec/recordings/Bing-Geocoder-Provider_2231523888/receives-correct-geodecoding-results_1602611079/recording.har create mode 100644 spec/recordings/Bing-Geocoder-Provider_2231523888/receives-error-when-the-API-key-is-bad_860720186/recording.har create mode 100644 spec/recordings/Chain-Geocoder-Provider_1409790517/receives-correct-geocoding-results-first-first-provider-OK-_818242361/recording.har create mode 100644 spec/recordings/Chain-Geocoder-Provider_1409790517/receives-correct-geocoding-results-first-provider-KO-_279561490/recording.har create mode 100644 spec/recordings/Chain-Geocoder-Provider_1409790517/receives-correct-geocoding-results-first-provider-OK-_2076694978/recording.har create mode 100644 spec/recordings/Chain-Geocoder-Provider_1409790517/receives-correct-geocoding-results-parallelize-first-provider-KO-_726443114/recording.har create mode 100644 spec/recordings/Chain-Geocoder-Provider_1409790517/receives-correct-geocoding-results-parallelize-first-provider-OK-_2565153306/recording.har create mode 100644 spec/recordings/Chain-Geocoder-Provider_1409790517/receives-correct-geodecoding-results-first-first-provider-OK-_48817278/recording.har create mode 100644 spec/recordings/Chain-Geocoder-Provider_1409790517/receives-correct-geodecoding-results-first-provider-KO-_1165577657/recording.har create mode 100644 spec/recordings/Chain-Geocoder-Provider_1409790517/receives-correct-geodecoding-results-first-provider-OK-_2544227361/recording.har create mode 100644 spec/recordings/Chain-Geocoder-Provider_1409790517/receives-correct-geodecoding-results-parallelize-first-provider-KO-_268891293/recording.har create mode 100644 spec/recordings/Chain-Geocoder-Provider_1409790517/receives-correct-geodecoding-results-parallelize-first-provider-OK-_4258976501/recording.har create mode 100644 spec/recordings/Google-Maps-Geocoder-Provider_3854403838/receives-correct-geocoding-results_3640432360/recording.har create mode 100644 spec/recordings/Google-Maps-Geocoder-Provider_3854403838/receives-correct-geodecoding-results_1602611079/recording.har create mode 100644 spec/recordings/Google-Maps-Geocoder-Provider_3854403838/receives-error-when-the-API-key-is-bad_860720186/recording.har create mode 100644 spec/recordings/MapQuest-Geocoder-Provider_1759071530/receives-correct-geocoding-results_3640432360/recording.har create mode 100644 spec/recordings/MapQuest-Geocoder-Provider_1759071530/receives-correct-geodecoding-results_1602611079/recording.har create mode 100644 spec/recordings/MapQuest-Geocoder-Provider_1759071530/receives-error-when-the-API-key-is-bad_860720186/recording.har create mode 100644 spec/recordings/Mapbox-Geocoder-Provider_114047645/receives-correct-geocoding-results_3640432360/recording.har create mode 100644 spec/recordings/Mapbox-Geocoder-Provider_114047645/receives-correct-geodecoding-results_1602611079/recording.har create mode 100644 spec/recordings/Mapbox-Geocoder-Provider_114047645/receives-error-when-the-API-key-is-bad_860720186/recording.har create mode 100644 spec/recordings/OpenCage-Geocoder-Provider_1524131378/receives-correct-geocoding-results_3640432360/recording.har create mode 100644 spec/recordings/OpenCage-Geocoder-Provider_1524131378/receives-correct-geodecoding-results_1602611079/recording.har create mode 100644 spec/recordings/OpenCage-Geocoder-Provider_1524131378/receives-error-when-requesting-too-quickly_2039275820/recording.har create mode 100644 spec/recordings/OpenCage-Geocoder-Provider_1524131378/receives-error-when-suspended_3006968534/recording.har create mode 100644 spec/recordings/OpenCage-Geocoder-Provider_1524131378/receives-error-when-the-IP-address-is-rejected_1610178983/recording.har create mode 100644 spec/recordings/OpenCage-Geocoder-Provider_1524131378/receives-error-when-the-quota-is-exceeded_98860701/recording.har create mode 100644 spec/recordings/OpenStreetMap-_925808948/-Nominatim-Geocoder-Provider_1884184056/receives-correct-geocoding-results_3640432360/recording.har create mode 100644 spec/recordings/OpenStreetMap-_925808948/-Nominatim-Geocoder-Provider_1884184056/receives-correct-geodecoding-results_1602611079/recording.har create mode 100644 spec/recordings/Yandex-Geocoder-Provider_3381125107/receives-correct-geocoding-results_3640432360/recording.har create mode 100644 spec/recordings/Yandex-Geocoder-Provider_3381125107/receives-correct-geodecoding-results_1602611079/recording.har create mode 100644 spec/recordings/Yandex-Geocoder-Provider_3381125107/receives-error-when-the-API-key-is-bad_860720186/recording.har create mode 100644 spec/setupPolly.ts delete mode 100644 types/AdminLevel.d.ts delete mode 100644 types/AdminLevel.d.ts.map delete mode 100644 types/ExternalLoader.d.ts delete mode 100644 types/ExternalLoader.d.ts.map delete mode 100644 types/GeoJsonDumper.d.ts delete mode 100644 types/GeoJsonDumper.d.ts.map delete mode 100644 types/Geocoded.d.ts delete mode 100644 types/Geocoded.d.ts.map delete mode 100644 types/GeocoderProviderFactory.d.ts delete mode 100644 types/GeocoderProviderFactory.d.ts.map delete mode 100644 types/UniversalGeocoder.d.ts delete mode 100644 types/UniversalGeocoder.d.ts.map delete mode 100644 types/error/ResponseError.d.ts delete mode 100644 types/error/ResponseError.d.ts.map delete mode 100644 types/error/index.d.ts delete mode 100644 types/error/index.d.ts.map delete mode 100644 types/global.d.ts delete mode 100644 types/global.d.ts.map delete mode 100644 types/index.d.ts delete mode 100644 types/index.d.ts.map delete mode 100644 types/provider/BingProvider.d.ts delete mode 100644 types/provider/BingProvider.d.ts.map delete mode 100644 types/provider/ChainProvider.d.ts delete mode 100644 types/provider/ChainProvider.d.ts.map delete mode 100644 types/provider/MapquestProvider.d.ts delete mode 100644 types/provider/MapquestProvider.d.ts.map delete mode 100644 types/provider/ProviderHelpers.d.ts delete mode 100644 types/provider/ProviderHelpers.d.ts.map delete mode 100644 types/provider/ProviderInterface.d.ts delete mode 100644 types/provider/ProviderInterface.d.ts.map delete mode 100644 types/provider/YandexProvider.d.ts delete mode 100644 types/provider/YandexProvider.d.ts.map delete mode 100644 types/provider/googlemaps/GoogleMapsGeocodeQuery.d.ts delete mode 100644 types/provider/googlemaps/GoogleMapsGeocodeQuery.d.ts.map delete mode 100644 types/provider/googlemaps/GoogleMapsGeocoded.d.ts delete mode 100644 types/provider/googlemaps/GoogleMapsGeocoded.d.ts.map delete mode 100644 types/provider/googlemaps/GoogleMapsProvider.d.ts delete mode 100644 types/provider/googlemaps/GoogleMapsProvider.d.ts.map delete mode 100644 types/provider/googlemaps/GoogleMapsReverseQuery.d.ts delete mode 100644 types/provider/googlemaps/GoogleMapsReverseQuery.d.ts.map delete mode 100644 types/provider/googlemaps/index.d.ts delete mode 100644 types/provider/googlemaps/index.d.ts.map delete mode 100644 types/provider/index.d.ts delete mode 100644 types/provider/index.d.ts.map delete mode 100644 types/provider/mapbox/MapboxGeocodeQuery.d.ts delete mode 100644 types/provider/mapbox/MapboxGeocodeQuery.d.ts.map delete mode 100644 types/provider/mapbox/MapboxGeocoded.d.ts delete mode 100644 types/provider/mapbox/MapboxGeocoded.d.ts.map delete mode 100644 types/provider/mapbox/MapboxProvider.d.ts delete mode 100644 types/provider/mapbox/MapboxProvider.d.ts.map delete mode 100644 types/provider/mapbox/MapboxReverseQuery.d.ts delete mode 100644 types/provider/mapbox/MapboxReverseQuery.d.ts.map delete mode 100644 types/provider/mapbox/index.d.ts delete mode 100644 types/provider/mapbox/index.d.ts.map delete mode 100644 types/provider/nominatim/NominatimGeocodeQuery.d.ts delete mode 100644 types/provider/nominatim/NominatimGeocodeQuery.d.ts.map delete mode 100644 types/provider/nominatim/NominatimGeocoded.d.ts delete mode 100644 types/provider/nominatim/NominatimGeocoded.d.ts.map delete mode 100644 types/provider/nominatim/NominatimProvider.d.ts delete mode 100644 types/provider/nominatim/NominatimProvider.d.ts.map delete mode 100644 types/provider/nominatim/NominatimReverseQuery.d.ts delete mode 100644 types/provider/nominatim/NominatimReverseQuery.d.ts.map delete mode 100644 types/provider/nominatim/index.d.ts delete mode 100644 types/provider/nominatim/index.d.ts.map delete mode 100644 types/provider/opencage/OpenCageGeocodeQuery.d.ts delete mode 100644 types/provider/opencage/OpenCageGeocodeQuery.d.ts.map delete mode 100644 types/provider/opencage/OpenCageGeocoded.d.ts delete mode 100644 types/provider/opencage/OpenCageGeocoded.d.ts.map delete mode 100644 types/provider/opencage/OpenCageProvider.d.ts delete mode 100644 types/provider/opencage/OpenCageProvider.d.ts.map delete mode 100644 types/provider/opencage/OpenCageReverseQuery.d.ts delete mode 100644 types/provider/opencage/OpenCageReverseQuery.d.ts.map delete mode 100644 types/provider/opencage/index.d.ts delete mode 100644 types/provider/opencage/index.d.ts.map delete mode 100644 types/query/GeocodeQuery.d.ts delete mode 100644 types/query/GeocodeQuery.d.ts.map delete mode 100644 types/query/ReverseQuery.d.ts delete mode 100644 types/query/ReverseQuery.d.ts.map delete mode 100644 types/query/index.d.ts delete mode 100644 types/query/index.d.ts.map delete mode 100644 types/types.d.ts delete mode 100644 types/types.d.ts.map delete mode 100644 types/utils.d.ts delete mode 100644 types/utils.d.ts.map diff --git a/.eslintrc b/.eslintrc index d798a22..665f4ed 100644 --- a/.eslintrc +++ b/.eslintrc @@ -13,7 +13,18 @@ "ignorePatterns": ["/types/**/*.ts", "/website/vendor/**/*"], "rules": { "prettier/prettier": ["error"], - "@typescript-eslint/no-unused-vars": ["error", { "ignoreRestSiblings": true }] + "@typescript-eslint/no-unused-vars": ["error", { "ignoreRestSiblings": true }], + "import/extensions": [ + "error", + "ignorePackages", + { + "js": "never", + "mjs": "never", + "jsx": "never", + "ts": "never", + "tsx": "never" + } + ] }, "overrides": [ { diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml new file mode 100644 index 0000000..dd1eeb1 --- /dev/null +++ b/.github/workflows/coverage.yml @@ -0,0 +1,26 @@ +name: Coverage + +on: + push: + branches: + - main + +jobs: + coverage: + name: Measure coverage and upload it + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Setup Node + uses: actions/setup-node@v2-beta + with: + node-version: "14" + - name: Install dependencies + run: npm install + - name: Run tests with coverage + run: npm run coverage-lcov + - name: Upload coverage + uses: codecov/codecov-action@v1 + with: + directory: ./coverage diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1b507e7..af13d19 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -21,6 +21,8 @@ jobs: run: npm install - name: Run tests run: npm test + - name: Build + run: npm run build - name: Create a GitHub release uses: actions/create-release@v1 env: diff --git a/.gitignore b/.gitignore index 9a406aa..fcb5f84 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,7 @@ node_modules -/dist /.couscous +/.nyc_output +/coverage +/dist +/types /website/vendor diff --git a/.nycrc.json b/.nycrc.json new file mode 100644 index 0000000..c2a4c8f --- /dev/null +++ b/.nycrc.json @@ -0,0 +1,4 @@ +{ + "cache": false, + "exclude": ["spec/**", "**/index.ts", "**/AdminLevel.ts", "**/*Geocoded.ts", "**/*GeocodeQuery.ts", "**/*ReverseQuery.ts", "**/ResponseError.ts"] +} diff --git a/CHANGELOG.md b/CHANGELOG.md index d27a02e..590c671 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,8 @@ * Add special chain provider * Add `errorCallback` parameter to `geocode` and `geodecode` +* Add `body` parameter to `executeRequest` +* [MapQuest] Fix geocode request (bad encoded query) ## 0.4.0 diff --git a/README.md b/README.md index cdcd1ce..b1465ef 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,7 @@ Universal Geocoder ================== [![CI](https://github.com/universal-geocoder/universal-geocoder-js/workflows/Continuous%20Integration/badge.svg?branch=main&event=push)](https://github.com/universal-geocoder/universal-geocoder-js/actions) +[![codecov](https://codecov.io/gh/universal-geocoder/universal-geocoder-js/branch/main/graph/badge.svg)](https://codecov.io/gh/universal-geocoder/universal-geocoder-js) Universal Geocoder is a universal JavaScript library for client-side geocoding applications with multiple built-in providers. @@ -245,12 +246,18 @@ npm run build Testing ------- -Unit tests are handled by Jasmine. To run unit tests from the command line, use: +Unit and functional tests are handled by Jasmine. To run tests from the command line, use: ```shell npm test ``` +If you need to record new API calls, use: + +```shell +npm run test-record +``` + You can also check if the examples are running correctly. For the Web: diff --git a/package-lock.json b/package-lock.json index 64d8acb..6d98985 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13,12 +13,168 @@ "@babel/highlight": "^7.10.4" } }, + "@babel/core": { + "version": "7.11.1", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.11.1.tgz", + "integrity": "sha512-XqF7F6FWQdKGGWAzGELL+aCO1p+lRY5Tj5/tbT3St1G8NaH70jhhDIKknIZaDans0OQBG5wRAldROLHSt44BgQ==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.10.4", + "@babel/generator": "^7.11.0", + "@babel/helper-module-transforms": "^7.11.0", + "@babel/helpers": "^7.10.4", + "@babel/parser": "^7.11.1", + "@babel/template": "^7.10.4", + "@babel/traverse": "^7.11.0", + "@babel/types": "^7.11.0", + "convert-source-map": "^1.7.0", + "debug": "^4.1.0", + "gensync": "^1.0.0-beta.1", + "json5": "^2.1.2", + "lodash": "^4.17.19", + "resolve": "^1.3.2", + "semver": "^5.4.1", + "source-map": "^0.5.0" + }, + "dependencies": { + "json5": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.1.3.tgz", + "integrity": "sha512-KXPvOm8K9IJKFM0bmdn8QXh7udDh1g/giieX0NLCaMnb4hEiVFqnop2ImTXCc5e0/oHz3LTqmHGtExn5hfMkOA==", + "dev": true, + "requires": { + "minimist": "^1.2.5" + } + }, + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + } + } + }, + "@babel/generator": { + "version": "7.11.0", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.11.0.tgz", + "integrity": "sha512-fEm3Uzw7Mc9Xi//qU20cBKatTfs2aOtKqmvy/Vm7RkJEGFQ4xc9myCfbXxqK//ZS8MR/ciOHw6meGASJuKmDfQ==", + "dev": true, + "requires": { + "@babel/types": "^7.11.0", + "jsesc": "^2.5.1", + "source-map": "^0.5.0" + } + }, + "@babel/helper-function-name": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.10.4.tgz", + "integrity": "sha512-YdaSyz1n8gY44EmN7x44zBn9zQ1Ry2Y+3GTA+3vH6Mizke1Vw0aWDM66FOYEPw8//qKkmqOckrGgTYa+6sceqQ==", + "dev": true, + "requires": { + "@babel/helper-get-function-arity": "^7.10.4", + "@babel/template": "^7.10.4", + "@babel/types": "^7.10.4" + } + }, + "@babel/helper-get-function-arity": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.10.4.tgz", + "integrity": "sha512-EkN3YDB+SRDgiIUnNgcmiD361ti+AVbL3f3Henf6dqqUyr5dMsorno0lJWJuLhDhkI5sYEpgj6y9kB8AOU1I2A==", + "dev": true, + "requires": { + "@babel/types": "^7.10.4" + } + }, + "@babel/helper-member-expression-to-functions": { + "version": "7.11.0", + "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.11.0.tgz", + "integrity": "sha512-JbFlKHFntRV5qKw3YC0CvQnDZ4XMwgzzBbld7Ly4Mj4cbFy3KywcR8NtNctRToMWJOVvLINJv525Gd6wwVEx/Q==", + "dev": true, + "requires": { + "@babel/types": "^7.11.0" + } + }, + "@babel/helper-module-imports": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.10.4.tgz", + "integrity": "sha512-nEQJHqYavI217oD9+s5MUBzk6x1IlvoS9WTPfgG43CbMEeStE0v+r+TucWdx8KFGowPGvyOkDT9+7DHedIDnVw==", + "dev": true, + "requires": { + "@babel/types": "^7.10.4" + } + }, + "@babel/helper-module-transforms": { + "version": "7.11.0", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.11.0.tgz", + "integrity": "sha512-02EVu8COMuTRO1TAzdMtpBPbe6aQ1w/8fePD2YgQmxZU4gpNWaL9gK3Jp7dxlkUlUCJOTaSeA+Hrm1BRQwqIhg==", + "dev": true, + "requires": { + "@babel/helper-module-imports": "^7.10.4", + "@babel/helper-replace-supers": "^7.10.4", + "@babel/helper-simple-access": "^7.10.4", + "@babel/helper-split-export-declaration": "^7.11.0", + "@babel/template": "^7.10.4", + "@babel/types": "^7.11.0", + "lodash": "^4.17.19" + } + }, + "@babel/helper-optimise-call-expression": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.10.4.tgz", + "integrity": "sha512-n3UGKY4VXwXThEiKrgRAoVPBMqeoPgHVqiHZOanAJCG9nQUL2pLRQirUzl0ioKclHGpGqRgIOkgcIJaIWLpygg==", + "dev": true, + "requires": { + "@babel/types": "^7.10.4" + } + }, + "@babel/helper-replace-supers": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.10.4.tgz", + "integrity": "sha512-sPxZfFXocEymYTdVK1UNmFPBN+Hv5mJkLPsYWwGBxZAxaWfFu+xqp7b6qWD0yjNuNL2VKc6L5M18tOXUP7NU0A==", + "dev": true, + "requires": { + "@babel/helper-member-expression-to-functions": "^7.10.4", + "@babel/helper-optimise-call-expression": "^7.10.4", + "@babel/traverse": "^7.10.4", + "@babel/types": "^7.10.4" + } + }, + "@babel/helper-simple-access": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.10.4.tgz", + "integrity": "sha512-0fMy72ej/VEvF8ULmX6yb5MtHG4uH4Dbd6I/aHDb/JVg0bbivwt9Wg+h3uMvX+QSFtwr5MeItvazbrc4jtRAXw==", + "dev": true, + "requires": { + "@babel/template": "^7.10.4", + "@babel/types": "^7.10.4" + } + }, + "@babel/helper-split-export-declaration": { + "version": "7.11.0", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.11.0.tgz", + "integrity": "sha512-74Vejvp6mHkGE+m+k5vHY93FX2cAtrw1zXrZXRlG4l410Nm9PxfEiVTn1PjDPV5SnmieiueY4AFg2xqhNFuuZg==", + "dev": true, + "requires": { + "@babel/types": "^7.11.0" + } + }, "@babel/helper-validator-identifier": { "version": "7.10.4", "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.10.4.tgz", "integrity": "sha512-3U9y+43hz7ZM+rzG24Qe2mufW5KhvFg/NhnNph+i9mgCtdTCtMJuI1TMkrIUiK7Ix4PYlRF9I5dhqaLYA/ADXw==", "dev": true }, + "@babel/helpers": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.10.4.tgz", + "integrity": "sha512-L2gX/XeUONeEbI78dXSrJzGdz4GQ+ZTA/aazfUsFaWjSe95kiCuOZ5HsXvkiw3iwF+mFHSRUfJU8t6YavocdXA==", + "dev": true, + "requires": { + "@babel/template": "^7.10.4", + "@babel/traverse": "^7.10.4", + "@babel/types": "^7.10.4" + } + }, "@babel/highlight": { "version": "7.10.4", "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.10.4.tgz", @@ -43,6 +199,135 @@ } } }, + "@babel/parser": { + "version": "7.11.3", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.11.3.tgz", + "integrity": "sha512-REo8xv7+sDxkKvoxEywIdsNFiZLybwdI7hcT5uEPyQrSMB4YQ973BfC9OOrD/81MaIjh6UxdulIQXkjmiH3PcA==", + "dev": true + }, + "@babel/template": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.10.4.tgz", + "integrity": "sha512-ZCjD27cGJFUB6nmCB1Enki3r+L5kJveX9pq1SvAUKoICy6CZ9yD8xO086YXdYhvNjBdnekm4ZnaP5yC8Cs/1tA==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.10.4", + "@babel/parser": "^7.10.4", + "@babel/types": "^7.10.4" + } + }, + "@babel/traverse": { + "version": "7.11.0", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.11.0.tgz", + "integrity": "sha512-ZB2V+LskoWKNpMq6E5UUCrjtDUh5IOTAyIl0dTjIEoXum/iKWkoIEKIRDnUucO6f+2FzNkE0oD4RLKoPIufDtg==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.10.4", + "@babel/generator": "^7.11.0", + "@babel/helper-function-name": "^7.10.4", + "@babel/helper-split-export-declaration": "^7.11.0", + "@babel/parser": "^7.11.0", + "@babel/types": "^7.11.0", + "debug": "^4.1.0", + "globals": "^11.1.0", + "lodash": "^4.17.19" + }, + "dependencies": { + "globals": { + "version": "11.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", + "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", + "dev": true + } + } + }, + "@babel/types": { + "version": "7.11.0", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.11.0.tgz", + "integrity": "sha512-O53yME4ZZI0jO1EVGtF1ePGl0LHirG4P1ibcD80XyzZcKhcMFeCXmh4Xb1ifGBIV233Qg12x4rBfQgA+tmOukA==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.10.4", + "lodash": "^4.17.19", + "to-fast-properties": "^2.0.0" + } + }, + "@istanbuljs/load-nyc-config": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz", + "integrity": "sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ==", + "dev": true, + "requires": { + "camelcase": "^5.3.1", + "find-up": "^4.1.0", + "get-package-type": "^0.1.0", + "js-yaml": "^3.13.1", + "resolve-from": "^5.0.0" + }, + "dependencies": { + "find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "requires": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + } + }, + "locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "requires": { + "p-locate": "^4.1.0" + } + }, + "p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "requires": { + "p-try": "^2.0.0" + } + }, + "p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "requires": { + "p-limit": "^2.2.0" + } + }, + "p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "dev": true + }, + "path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true + }, + "resolve-from": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", + "dev": true + } + } + }, + "@istanbuljs/schema": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.2.tgz", + "integrity": "sha512-tsAQNx32a8CoFhjhijUIhI4kccIAgmGhy8LZMZgGfmXcpMbPRUqn5LWmgRttILi6yeGmBJd2xsPkFMs0PzgPCw==", + "dev": true + }, "@mrmlnc/readdir-enhanced": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/@mrmlnc/readdir-enhanced/-/readdir-enhanced-2.2.1.tgz", @@ -59,6 +344,99 @@ "integrity": "sha512-shAmDyaQC4H92APFoIaVDHCx5bStIocgvbwQyxPRrbUY20V1EYTbSDchWbuwlMG3V17cprZhA6+78JfB+3DTPw==", "dev": true }, + "@pollyjs/adapter": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@pollyjs/adapter/-/adapter-5.0.0.tgz", + "integrity": "sha512-GaJUp9hKKKbRbh1FDbjVfxNGIYs8/1QQI5SR+zjz+OjpjV2btRPFCq1cqO4ORrHA2pTIC8IvEL3lgPSG4v/cPg==", + "dev": true, + "requires": { + "@pollyjs/utils": "^5.0.0" + } + }, + "@pollyjs/adapter-node-http": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@pollyjs/adapter-node-http/-/adapter-node-http-5.0.0.tgz", + "integrity": "sha512-9WjV6UVHWpcDZc1Dt5Slxn191iN55RpCirEAdt+h5wvPgRJmsLuXMI1vT3r9va8Z+a3qCqM458waNfr5us2Wuw==", + "dev": true, + "requires": { + "@pollyjs/adapter": "^5.0.0", + "@pollyjs/utils": "^5.0.0", + "lodash-es": "^4.17.11", + "nock": "^12.0.3" + } + }, + "@pollyjs/core": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@pollyjs/core/-/core-5.0.0.tgz", + "integrity": "sha512-f/v5z7aKSWdeBCZQFiQGL4aZmdWAuQWV+U/fMbAIEYjkX8Av0gWPhkFyeMfeFriYMg7Ts1XxPNI7LYroCnjn7w==", + "dev": true, + "requires": { + "@pollyjs/utils": "^5.0.0", + "@sindresorhus/fnv1a": "^1.2.0", + "blueimp-md5": "^2.10.0", + "fast-json-stable-stringify": "^2.0.0", + "is-absolute-url": "^3.0.0", + "lodash-es": "^4.17.11", + "route-recognizer": "^0.3.4", + "slugify": "^1.3.4" + } + }, + "@pollyjs/node-server": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@pollyjs/node-server/-/node-server-5.0.0.tgz", + "integrity": "sha512-DK1hqsZnIU7TXECNPI6E+ojaSpv62lt3+8eGn3qFbsa61ToTFQLFEMNfcTWA6ZXArrpdzYAdKVTt8BsdEujHkg==", + "dev": true, + "requires": { + "@pollyjs/utils": "^5.0.0", + "body-parser": "^1.19.0", + "cors": "^2.8.5", + "express": "^4.17.1", + "fs-extra": "^8.0.1", + "http-graceful-shutdown": "^2.3.1", + "morgan": "^1.9.1", + "nocache": "^2.1.0" + } + }, + "@pollyjs/persister": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@pollyjs/persister/-/persister-5.0.0.tgz", + "integrity": "sha512-bTJes0c2/y4xrXi1vPypJhup/N/VPC1jY7maOuSv4pOFo6VAvoVJGT2sgMMnPU7qHSRn9Y6v+S7QqGtLOZCyAA==", + "dev": true, + "requires": { + "@pollyjs/utils": "^5.0.0", + "bowser": "^2.4.0", + "fast-json-stable-stringify": "^2.0.0", + "lodash-es": "^4.17.11", + "set-cookie-parser": "^2.3.5", + "utf8-byte-length": "^1.0.4" + } + }, + "@pollyjs/persister-fs": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@pollyjs/persister-fs/-/persister-fs-5.0.0.tgz", + "integrity": "sha512-ju75JJ6sSJ/q68rB74wxIlvXCq/riuCqW3pS/Ucd4SFfks/HxXxM3yGTHn0Qq5SrmY9cYbQFfpOz0WCNDIqr+A==", + "dev": true, + "requires": { + "@pollyjs/node-server": "^5.0.0", + "@pollyjs/persister": "^5.0.0" + } + }, + "@pollyjs/utils": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@pollyjs/utils/-/utils-5.0.0.tgz", + "integrity": "sha512-zXoR13NGR1fVoUAcKR9/8AYCXZsMkG5EdvTZbR1nk5hCYJN1AR73HAKXMPsk/2vkLnBr6LWoAr3f9LjwqJOehQ==", + "dev": true, + "requires": { + "qs": "^6.7.0", + "url-parse": "^1.4.7" + } + }, + "@sindresorhus/fnv1a": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@sindresorhus/fnv1a/-/fnv1a-1.2.0.tgz", + "integrity": "sha512-5ezb/dBSTWtKQ4sLQwMgOJyREXJcZZkTMbendMwKrXTghUhWjZhstzkkmt4/WkFy/GSTSGzfJOKU7dEXv3C/XQ==", + "dev": true + }, "@types/color-name": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/@types/color-name/-/color-name-1.1.1.tgz", @@ -95,6 +473,64 @@ "integrity": "sha512-kVrqXhbclHNHGu9ztnAwSncIgJv/FaxmzXJvGXNdcCpV1b8u1/Mi6z6m0vwy0LzKeXFTPLH0NzwmoJ3fNCIq0g==", "dev": true }, + "@types/pollyjs__adapter": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/@types/pollyjs__adapter/-/pollyjs__adapter-4.3.0.tgz", + "integrity": "sha512-aJ4+ianTKgbdZRnBjcB9D1Kn4ALn3YatGlAzgEdGHyv63aV+gzukKH8xqdrRB76pwrXXCQwLosNBFNTSEmRA9A==", + "dev": true, + "requires": { + "@types/pollyjs__core": "*" + } + }, + "@types/pollyjs__adapter-node-http": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@types/pollyjs__adapter-node-http/-/pollyjs__adapter-node-http-2.0.0.tgz", + "integrity": "sha512-v8g65xEnADlb1UZe4fNPO9KpU04uY6HAPns307RWqePlVtftctD73FA++74PbO17PNgMbi/7IzrZatiEEn9CPQ==", + "dev": true, + "requires": { + "@types/pollyjs__adapter": "*" + } + }, + "@types/pollyjs__core": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/@types/pollyjs__core/-/pollyjs__core-4.3.0.tgz", + "integrity": "sha512-gloFb5e36G8Tice0J2GhdzqAAongh2ALBel5QjvjmTk4Vv0+mD3xkE3O50XHdRfbJwCOo7A/rpH+6J+kuKXdZg==", + "dev": true, + "requires": { + "@types/pollyjs__adapter": "*", + "@types/pollyjs__persister": "*" + } + }, + "@types/pollyjs__persister": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/@types/pollyjs__persister/-/pollyjs__persister-4.3.0.tgz", + "integrity": "sha512-gEwKh9XQSHo+1iBTHKqBIa/BHfG0cLidgryU6jEWzQ9NTtYOGb2V5tf3qb0ddihO7kJW/d0MCKTN28hDS+XCDg==", + "dev": true + }, + "@types/pollyjs__persister-fs": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@types/pollyjs__persister-fs/-/pollyjs__persister-fs-2.0.0.tgz", + "integrity": "sha512-m788FLVtzE+qqrNeotBel2S1EhNMkkNRVJa9XQqeNdwvaJvOp7h/EWacKCrdHLK406LBo7vhL8dpWldkRBm0lg==", + "dev": true, + "requires": { + "@types/pollyjs__persister": "*" + } + }, + "@types/pollyjs__utils": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/@types/pollyjs__utils/-/pollyjs__utils-2.6.0.tgz", + "integrity": "sha512-2jP956xmnYBM7VWevpSonSiYutlbnl5nRrS/tuYz2eab4YczvkXI3yIgBzF83kqRmeg2nHB8T8WLlJNdu0ppBw==", + "dev": true + }, + "@types/setup-polly-jest": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/@types/setup-polly-jest/-/setup-polly-jest-0.5.0.tgz", + "integrity": "sha512-adGkOa52Z/zU6gZ6oU7iUyS6BOmueFUjPIXrW0INNZPZqB5p68Q6dukWVk2bqVXwDUy3Cd6B/aADSouClwwmew==", + "dev": true, + "requires": { + "@types/pollyjs__core": "*" + } + }, "@types/webpack-env": { "version": "1.15.2", "resolved": "https://registry.npmjs.org/@types/webpack-env/-/webpack-env-1.15.2.tgz", @@ -102,12 +538,12 @@ "dev": true }, "@typescript-eslint/eslint-plugin": { - "version": "3.8.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-3.8.0.tgz", - "integrity": "sha512-lFb4VCDleFSR+eo4Ew+HvrJ37ZH1Y9ZyE+qyP7EiwBpcCVxwmUc5PAqhShCQ8N8U5vqYydm74nss+a0wrrCErw==", + "version": "3.9.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-3.9.0.tgz", + "integrity": "sha512-UD6b4p0/hSe1xdTvRCENSx7iQ+KR6ourlZFfYuPC7FlXEzdHuLPrEmuxZ23b2zW96KJX9Z3w05GE/wNOiEzrVg==", "dev": true, "requires": { - "@typescript-eslint/experimental-utils": "3.8.0", + "@typescript-eslint/experimental-utils": "3.9.0", "debug": "^4.1.1", "functional-red-black-tree": "^1.0.1", "regexpp": "^3.0.0", @@ -116,45 +552,45 @@ } }, "@typescript-eslint/experimental-utils": { - "version": "3.8.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-3.8.0.tgz", - "integrity": "sha512-o8T1blo1lAJE0QDsW7nSyvZHbiDzQDjINJKyB44Z3sSL39qBy5L10ScI/XwDtaiunoyKGLiY9bzRk4YjsUZl8w==", + "version": "3.9.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-3.9.0.tgz", + "integrity": "sha512-/vSHUDYizSOhrOJdjYxPNGfb4a3ibO8zd4nUKo/QBFOmxosT3cVUV7KIg8Dwi6TXlr667G7YPqFK9+VSZOorNA==", "dev": true, "requires": { "@types/json-schema": "^7.0.3", - "@typescript-eslint/types": "3.8.0", - "@typescript-eslint/typescript-estree": "3.8.0", + "@typescript-eslint/types": "3.9.0", + "@typescript-eslint/typescript-estree": "3.9.0", "eslint-scope": "^5.0.0", "eslint-utils": "^2.0.0" } }, "@typescript-eslint/parser": { - "version": "3.8.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-3.8.0.tgz", - "integrity": "sha512-u5vjOBaCsnMVQOvkKCXAmmOhyyMmFFf5dbkM3TIbg3MZ2pyv5peE4gj81UAbTHwTOXEwf7eCQTUMKrDl/+qGnA==", + "version": "3.9.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-3.9.0.tgz", + "integrity": "sha512-rDHOKb6uW2jZkHQniUQVZkixQrfsZGUCNWWbKWep4A5hGhN5dLHMUCNAWnC4tXRlHedXkTDptIpxs6e4Pz8UfA==", "dev": true, "requires": { "@types/eslint-visitor-keys": "^1.0.0", - "@typescript-eslint/experimental-utils": "3.8.0", - "@typescript-eslint/types": "3.8.0", - "@typescript-eslint/typescript-estree": "3.8.0", + "@typescript-eslint/experimental-utils": "3.9.0", + "@typescript-eslint/types": "3.9.0", + "@typescript-eslint/typescript-estree": "3.9.0", "eslint-visitor-keys": "^1.1.0" } }, "@typescript-eslint/types": { - "version": "3.8.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-3.8.0.tgz", - "integrity": "sha512-8kROmEQkv6ss9kdQ44vCN1dTrgu4Qxrd2kXr10kz2NP5T8/7JnEfYNxCpPkArbLIhhkGLZV3aVMplH1RXQRF7Q==", + "version": "3.9.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-3.9.0.tgz", + "integrity": "sha512-rb6LDr+dk9RVVXO/NJE8dT1pGlso3voNdEIN8ugm4CWM5w5GimbThCMiMl4da1t5u3YwPWEwOnKAULCZgBtBHg==", "dev": true }, "@typescript-eslint/typescript-estree": { - "version": "3.8.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-3.8.0.tgz", - "integrity": "sha512-MTv9nPDhlKfclwnplRNDL44mP2SY96YmPGxmMbMy6x12I+pERcxpIUht7DXZaj4mOKKtet53wYYXU0ABaiXrLw==", + "version": "3.9.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-3.9.0.tgz", + "integrity": "sha512-N+158NKgN4rOmWVfvKOMoMFV5n8XxAliaKkArm/sOypzQ0bUL8MSnOEBW3VFIeffb/K5ce/cAV0yYhR7U4ALAA==", "dev": true, "requires": { - "@typescript-eslint/types": "3.8.0", - "@typescript-eslint/visitor-keys": "3.8.0", + "@typescript-eslint/types": "3.9.0", + "@typescript-eslint/visitor-keys": "3.9.0", "debug": "^4.1.1", "glob": "^7.1.6", "is-glob": "^4.0.1", @@ -164,9 +600,9 @@ } }, "@typescript-eslint/visitor-keys": { - "version": "3.8.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-3.8.0.tgz", - "integrity": "sha512-gfqQWyVPpT9NpLREXNR820AYwgz+Kr1GuF3nf1wxpHD6hdxI62tq03ToomFnDxY0m3pUB39IF7sil7D5TQexLA==", + "version": "3.9.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-3.9.0.tgz", + "integrity": "sha512-O1qeoGqDbu0EZUC/MZ6F1WHTIzcBVhGqDj3LhTnj65WUA548RXVxUHbYhAW9bZWfb2rnX9QsbbP5nmeJ5Z4+ng==", "dev": true, "requires": { "eslint-visitor-keys": "^1.1.0" @@ -377,6 +813,16 @@ "@zerollup/ts-helpers": "^1.7.18" } }, + "accepts": { + "version": "1.3.7", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.7.tgz", + "integrity": "sha512-Il80Qs2WjYlJIBNzNkK6KYqlVMTbZLXgHx2oT0pU/fjRHyEp+PEfEPY0R3WCwAGVOtauxh1hOxNgIf5bv7dQpA==", + "dev": true, + "requires": { + "mime-types": "~2.1.24", + "negotiator": "0.6.2" + } + }, "acorn": { "version": "7.4.0", "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.0.tgz", @@ -389,6 +835,16 @@ "integrity": "sha512-HiUX/+K2YpkpJ+SzBffkM/AQ2YE03S0U1kjTLVpoJdhZMOWy8qvXVN9JdLqv2QsaQ6MPYQIuNmwD8zOiYUofLQ==", "dev": true }, + "aggregate-error": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.0.1.tgz", + "integrity": "sha512-quoaXsZ9/BLNae5yiNoUz+Nhkwz83GhWwtYFglcjEQB2NDHCIpApbqXxIFnm4Pq/Nvhrsq5sYJFyohrrxnTGAA==", + "dev": true, + "requires": { + "clean-stack": "^2.0.0", + "indent-string": "^4.0.0" + } + }, "ajv": { "version": "6.12.3", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.3.tgz", @@ -445,12 +901,27 @@ "picomatch": "^2.0.4" } }, + "append-transform": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/append-transform/-/append-transform-2.0.0.tgz", + "integrity": "sha512-7yeyCEurROLQJFv5Xj4lEGTy0borxepjFv1g22oAdqFu//SrAlDl1O1Nxx15SH1RoliUml6p8dwJW9jvZughhg==", + "dev": true, + "requires": { + "default-require-extensions": "^3.0.0" + } + }, "aproba": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz", "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==", "dev": true }, + "archy": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/archy/-/archy-1.0.0.tgz", + "integrity": "sha1-+cjBN1fMHde8N5rHeyxipcKGjEA=", + "dev": true + }, "arg": { "version": "4.1.3", "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", @@ -484,6 +955,12 @@ "integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=", "dev": true }, + "array-flatten": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", + "integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=", + "dev": true + }, "array-includes": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.1.tgz", @@ -512,14 +989,15 @@ } }, "asn1.js": { - "version": "4.10.1", - "resolved": "https://registry.npmjs.org/asn1.js/-/asn1.js-4.10.1.tgz", - "integrity": "sha512-p32cOF5q0Zqs9uBiONKYLm6BClCoBCM5O9JfeUSlnQLBTxYdTK+pW+nXflm8UkKd2UYlEbYz5qEi0JuZR9ckSw==", + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/asn1.js/-/asn1.js-5.4.1.tgz", + "integrity": "sha512-+I//4cYPccV8LdmBLiX8CYvf9Sp3vQsrqu2QNXRcrbiWvcx/UdlFiqUJJzxRQxgsZmvhXhn4cSKeSmoFjVdupA==", "dev": true, "requires": { "bn.js": "^4.0.0", "inherits": "^2.0.1", - "minimalistic-assert": "^1.0.0" + "minimalistic-assert": "^1.0.0", + "safer-buffer": "^2.1.0" }, "dependencies": { "bn.js": { @@ -659,10 +1137,13 @@ "dev": true }, "basic-auth": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/basic-auth/-/basic-auth-1.1.0.tgz", - "integrity": "sha1-RSIe5Cn37h5QNb4/UVM/HN/SmIQ=", - "dev": true + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/basic-auth/-/basic-auth-2.0.1.tgz", + "integrity": "sha512-NF+epuEdnUYVlGuhaxbbq+dvJttwLnGY+YixlXlME5KpQ5W3CnXA5cVTneY3SPbPDRkcjMbifrwmFYcClgOZeg==", + "dev": true, + "requires": { + "safe-buffer": "5.1.2" + } }, "big.js": { "version": "5.2.2", @@ -683,12 +1164,65 @@ "integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==", "dev": true }, + "blueimp-md5": { + "version": "2.17.0", + "resolved": "https://registry.npmjs.org/blueimp-md5/-/blueimp-md5-2.17.0.tgz", + "integrity": "sha512-x5PKJHY5rHQYaADj6NwPUR2QRCUVSggPzrUKkeENpj871o9l9IefJbO2jkT5UvYykeOK9dx0VmkIo6dZ+vThYw==", + "dev": true + }, "bn.js": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.1.2.tgz", "integrity": "sha512-40rZaf3bUNKTVYu9sIeeEGOg7g14Yvnj9kH7b50EiwX0Q7A6umbvfI5tvHaOERH0XigqKkfLkFQxzb4e6CIXnA==", "dev": true }, + "body-parser": { + "version": "1.19.0", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.19.0.tgz", + "integrity": "sha512-dhEPs72UPbDnAQJ9ZKMNTP6ptJaionhP5cBb541nXPlW60Jepo9RV/a4fX4XWW9CuFNK22krhrj1+rgzifNCsw==", + "dev": true, + "requires": { + "bytes": "3.1.0", + "content-type": "~1.0.4", + "debug": "2.6.9", + "depd": "~1.1.2", + "http-errors": "1.7.2", + "iconv-lite": "0.4.24", + "on-finished": "~2.3.0", + "qs": "6.7.0", + "raw-body": "2.4.0", + "type-is": "~1.6.17" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + }, + "qs": { + "version": "6.7.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.7.0.tgz", + "integrity": "sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ==", + "dev": true + } + } + }, + "bowser": { + "version": "2.10.0", + "resolved": "https://registry.npmjs.org/bowser/-/bowser-2.10.0.tgz", + "integrity": "sha512-OCsqTQboTEWWsUjcp5jLSw2ZHsBiv2C105iFs61bOT0Hnwi9p7/uuXdd7mu8RYcarREfdjNN+8LitmEHATsLYg==", + "dev": true + }, "brace-expansion": { "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", @@ -806,6 +1340,12 @@ "safe-buffer": "^5.2.0" }, "dependencies": { + "inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true + }, "readable-stream": { "version": "3.6.0", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", @@ -863,6 +1403,12 @@ "integrity": "sha1-hZgoeOIbmOHGZCXgPQF0eI9Wnug=", "dev": true }, + "bytes": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.0.tgz", + "integrity": "sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg==", + "dev": true + }, "cacache": { "version": "12.0.4", "resolved": "https://registry.npmjs.org/cacache/-/cacache-12.0.4.tgz", @@ -903,6 +1449,18 @@ "unset-value": "^1.0.0" } }, + "caching-transform": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/caching-transform/-/caching-transform-4.0.0.tgz", + "integrity": "sha512-kpqOvwXnjjN44D89K5ccQC+RUrsy7jB/XLlRrx0D7/2HNcTPqzsb6XgYoErwko6QsV184CA2YgS1fxDiiDZMWA==", + "dev": true, + "requires": { + "hasha": "^5.0.0", + "make-dir": "^3.0.0", + "package-hash": "^4.0.0", + "write-file-atomic": "^3.0.0" + } + }, "call-me-maybe": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/call-me-maybe/-/call-me-maybe-1.0.1.tgz", @@ -974,9 +1532,9 @@ } }, "chokidar": { - "version": "3.4.1", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.4.1.tgz", - "integrity": "sha512-TQTJyr2stihpC4Sya9hs2Xh+O2wf+igjL36Y75xx2WdHuiICcn/XJza46Jwt0eT5hVpQOzo3FpY3cj3RVYLX0g==", + "version": "3.4.2", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.4.2.tgz", + "integrity": "sha512-IZHaDeBeI+sZJRX7lGcXsdzgvZqKv6sECqsbErJA4mHWfpRrD8B97kSFN4cQz6nGBGiuFia1MKR4d6c1o8Cv7A==", "dev": true, "optional": true, "requires": { @@ -1077,34 +1635,59 @@ } } }, + "clean-stack": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", + "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==", + "dev": true + }, "cliui": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz", - "integrity": "sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", + "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", "dev": true, "requires": { - "string-width": "^3.1.0", - "strip-ansi": "^5.2.0", - "wrap-ansi": "^5.1.0" + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^6.2.0" }, "dependencies": { - "ansi-regex": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", - "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", "dev": true }, - "strip-ansi": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", - "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true + }, + "string-width": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz", + "integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==", "dev": true, "requires": { - "ansi-regex": "^4.1.0" + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.0" } } } }, + "clone-deep": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/clone-deep/-/clone-deep-4.0.1.tgz", + "integrity": "sha512-neHB9xuzh/wk0dIHweyAXv2aPGZIVk3pLMe+/RNzINf17fe0OG96QroktYAUm7SM1PBnzTabaLboqqxDyMU+SQ==", + "dev": true, + "requires": { + "is-plain-object": "^2.0.4", + "kind-of": "^6.0.2", + "shallow-clone": "^3.0.0" + } + }, "collection-visit": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz", @@ -1196,6 +1779,42 @@ "integrity": "sha1-/ozxhP9mcLa67wGp1IYaXL7EEgo=", "dev": true }, + "content-disposition": { + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.3.tgz", + "integrity": "sha512-ExO0774ikEObIAEV9kDo50o+79VCUdEB6n6lzKgGwupcVeRlhrj3qGAfwq8G6uBJjkqLrhT0qEYFcWng8z1z0g==", + "dev": true, + "requires": { + "safe-buffer": "5.1.2" + } + }, + "content-type": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz", + "integrity": "sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA==", + "dev": true + }, + "convert-source-map": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.7.0.tgz", + "integrity": "sha512-4FJkXzKXEDB1snCFZlLP4gpC3JILicCpGbzG9f9G7tGqGCzETQ2hWPrcinA9oU4wtf2biUaEH5065UnMeR33oA==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.1" + } + }, + "cookie": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.0.tgz", + "integrity": "sha512-+Hp8fLp57wnUSt0tY0tHEXh4voZRDnoIrZPqlo3DPiI4y9lwg/jqx+1Om94/W6ZaPDOUbnjOt/99w66zk+l1Xg==", + "dev": true + }, + "cookie-signature": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", + "integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw=", + "dev": true + }, "copy-concurrently": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/copy-concurrently/-/copy-concurrently-1.0.5.tgz", @@ -1222,6 +1841,16 @@ "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", "dev": true }, + "cors": { + "version": "2.8.5", + "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.5.tgz", + "integrity": "sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==", + "dev": true, + "requires": { + "object-assign": "^4", + "vary": "^1" + } + }, "corser": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/corser/-/corser-2.0.1.tgz", @@ -1344,6 +1973,23 @@ "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", "dev": true }, + "default-require-extensions": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/default-require-extensions/-/default-require-extensions-3.0.0.tgz", + "integrity": "sha512-ek6DpXq/SCpvjhpFsLFRVtIxJCRw6fUR42lYMVZuUMK7n8eMz4Uh5clckdBjEpLhn/gEBZo7hDJnJcwdKLKQjg==", + "dev": true, + "requires": { + "strip-bom": "^4.0.0" + }, + "dependencies": { + "strip-bom": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz", + "integrity": "sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==", + "dev": true + } + } + }, "define-properties": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", @@ -1394,6 +2040,12 @@ } } }, + "depd": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", + "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=", + "dev": true + }, "des.js": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/des.js/-/des.js-1.0.1.tgz", @@ -1404,6 +2056,12 @@ "minimalistic-assert": "^1.0.0" } }, + "destroy": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", + "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=", + "dev": true + }, "detect-file": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/detect-file/-/detect-file-1.0.0.tgz", @@ -1474,6 +2132,12 @@ "url-join": "^2.0.5" } }, + "ee-first": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", + "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=", + "dev": true + }, "elliptic": { "version": "6.5.3", "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.3.tgz", @@ -1509,6 +2173,12 @@ "integrity": "sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q==", "dev": true }, + "encodeurl": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", + "integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k=", + "dev": true + }, "end-of-stream": { "version": "1.4.4", "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", @@ -1586,6 +2256,18 @@ "is-symbol": "^1.0.2" } }, + "es6-error": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/es6-error/-/es6-error-4.1.1.tgz", + "integrity": "sha512-Um/+FxMr9CISWh0bi5Zv0iOD+4cFh5qLeks1qhAopKVAJw3drgKbKySikp7wGhDL0HPeaja0P5ULZrxLkniUVg==", + "dev": true + }, + "escape-html": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg=", + "dev": true + }, "escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", @@ -1860,6 +2542,12 @@ "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", "dev": true }, + "etag": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", + "integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc=", + "dev": true + }, "eventemitter3": { "version": "4.0.4", "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.4.tgz", @@ -1941,6 +2629,67 @@ "homedir-polyfill": "^1.0.1" } }, + "express": { + "version": "4.17.1", + "resolved": "https://registry.npmjs.org/express/-/express-4.17.1.tgz", + "integrity": "sha512-mHJ9O79RqluphRrcw2X/GTh3k9tVv8YcoyY4Kkh4WDMUYKRZUq0h1o0w2rrrxBqM7VoeUVqgb27xlEMXTnYt4g==", + "dev": true, + "requires": { + "accepts": "~1.3.7", + "array-flatten": "1.1.1", + "body-parser": "1.19.0", + "content-disposition": "0.5.3", + "content-type": "~1.0.4", + "cookie": "0.4.0", + "cookie-signature": "1.0.6", + "debug": "2.6.9", + "depd": "~1.1.2", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "finalhandler": "~1.1.2", + "fresh": "0.5.2", + "merge-descriptors": "1.0.1", + "methods": "~1.1.2", + "on-finished": "~2.3.0", + "parseurl": "~1.3.3", + "path-to-regexp": "0.1.7", + "proxy-addr": "~2.0.5", + "qs": "6.7.0", + "range-parser": "~1.2.1", + "safe-buffer": "5.1.2", + "send": "0.17.1", + "serve-static": "1.14.1", + "setprototypeof": "1.1.1", + "statuses": "~1.5.0", + "type-is": "~1.6.18", + "utils-merge": "1.0.1", + "vary": "~1.1.2" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + }, + "qs": { + "version": "6.7.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.7.0.tgz", + "integrity": "sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ==", + "dev": true + } + } + }, "extend-shallow": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", @@ -2126,34 +2875,66 @@ } } }, + "finalhandler": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.2.tgz", + "integrity": "sha512-aAWcW57uxVNrQZqFXjITpW3sIUQmHGG3qSb9mUah9MgMC4NeWhNOlNjXEYq3HjRAvL6arUviZGGJsBg6z0zsWA==", + "dev": true, + "requires": { + "debug": "2.6.9", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "on-finished": "~2.3.0", + "parseurl": "~1.3.3", + "statuses": "~1.5.0", + "unpipe": "~1.0.0" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + } + } + }, "find-cache-dir": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-2.1.0.tgz", - "integrity": "sha512-Tq6PixE0w/VMFfCgbONnkiQIVol/JJL7nRMi20fqzA4NRs9AfeqMGeRdPi3wIhYkxjeBaWh2rxwapn5Tu3IqOQ==", + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-3.3.1.tgz", + "integrity": "sha512-t2GDMt3oGC/v+BMwzmllWDuJF/xcDtE5j/fCGbqDD7OLuJkj0cfh1YSA5VKPvwMeLFLNDBkwOKZ2X85jGLVftQ==", "dev": true, "requires": { "commondir": "^1.0.1", - "make-dir": "^2.0.0", - "pkg-dir": "^3.0.0" + "make-dir": "^3.0.2", + "pkg-dir": "^4.1.0" }, "dependencies": { "find-up": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", - "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", "dev": true, "requires": { - "locate-path": "^3.0.0" + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" } }, "locate-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", - "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", "dev": true, "requires": { - "p-locate": "^3.0.0", - "path-exists": "^3.0.0" + "p-locate": "^4.1.0" } }, "p-limit": { @@ -2166,12 +2947,12 @@ } }, "p-locate": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", - "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", "dev": true, "requires": { - "p-limit": "^2.0.0" + "p-limit": "^2.2.0" } }, "p-try": { @@ -2180,13 +2961,19 @@ "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", "dev": true }, + "path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true + }, "pkg-dir": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-3.0.0.tgz", - "integrity": "sha512-/E57AYkoeQ25qkxMj5PBOVgF8Kiu/h7cYS30Z5+R7WaiCCBfLq58ZI/dSeaEKb9WVJV5n/03QwrN3IeWIFllvw==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", + "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", "dev": true, "requires": { - "find-up": "^3.0.0" + "find-up": "^4.0.0" } } } @@ -2240,9 +3027,9 @@ } }, "follow-redirects": { - "version": "1.12.1", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.12.1.tgz", - "integrity": "sha512-tmRv0AVuR7ZyouUHLeNSiO6pqulF7dYa3s19c6t+wz9LD69/uSzdMxJ2S91nTI9U3rt/IldxpzMOFejp6f0hjg==", + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.13.0.tgz", + "integrity": "sha512-aq6gF1BEKje4a9i9+5jimNFIpq4Q1WiwBToeRK5NvZBd/TRsmW8BsJfOEGkr76TbOyPVD3OVDN910EcUNtRYEA==", "dev": true }, "for-in": { @@ -2251,6 +3038,22 @@ "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=", "dev": true }, + "foreground-child": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-2.0.0.tgz", + "integrity": "sha512-dCIq9FpEcyQyXKCkyzmlPTFNgrCzPudOe+mhvJU5zAtlBnGVy2yKxtfsxK2tQBThwq225jcvBjpw1Gr40uzZCA==", + "dev": true, + "requires": { + "cross-spawn": "^7.0.0", + "signal-exit": "^3.0.2" + } + }, + "forwarded": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.1.2.tgz", + "integrity": "sha1-mMI9qxF1ZXuMBXPozszZGw/xjIQ=", + "dev": true + }, "fragment-cache": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz", @@ -2260,6 +3063,12 @@ "map-cache": "^0.2.2" } }, + "fresh": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", + "integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=", + "dev": true + }, "from2": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/from2/-/from2-2.3.0.tgz", @@ -2270,6 +3079,23 @@ "readable-stream": "^2.0.0" } }, + "fromentries": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/fromentries/-/fromentries-1.2.1.tgz", + "integrity": "sha512-Xu2Qh8yqYuDhQGOhD5iJGninErSfI9A3FrriD3tjUgV5VbJFeH8vfgZ9HnC6jWN80QDVNQK5vmxRAmEAp7Mevw==", + "dev": true + }, + "fs-extra": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", + "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", + "dev": true, + "requires": { + "graceful-fs": "^4.2.0", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + } + }, "fs-write-stream-atomic": { "version": "1.0.10", "resolved": "https://registry.npmjs.org/fs-write-stream-atomic/-/fs-write-stream-atomic-1.0.10.tgz", @@ -2307,12 +3133,24 @@ "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", "dev": true }, + "gensync": { + "version": "1.0.0-beta.1", + "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.1.tgz", + "integrity": "sha512-r8EC6NO1sngH/zdD9fiRDLdcgnbayXah+mLgManTaIZJqEC1MZstmnox8KpnI2/fxQwrp5OpCOYWLp4rBl4Jcg==", + "dev": true + }, "get-caller-file": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", "dev": true }, + "get-package-type": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/get-package-type/-/get-package-type-0.1.0.tgz", + "integrity": "sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==", + "dev": true + }, "get-stdin": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-6.0.0.tgz", @@ -2488,6 +3326,12 @@ "safe-buffer": "^5.2.0" }, "dependencies": { + "inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true + }, "readable-stream": { "version": "3.6.0", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", @@ -2517,6 +3361,16 @@ "minimalistic-assert": "^1.0.1" } }, + "hasha": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/hasha/-/hasha-5.2.0.tgz", + "integrity": "sha512-2W+jKdQbAdSIrggA8Q35Br8qKadTrqCTC8+XZvBWepKDK6m9XkX6Iz1a2yh2KP01kzAR/dpuMeUnocoLYDcskw==", + "dev": true, + "requires": { + "is-stream": "^2.0.0", + "type-fest": "^0.8.0" + } + }, "he": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", @@ -2549,6 +3403,34 @@ "integrity": "sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg==", "dev": true }, + "html-escaper": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", + "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", + "dev": true + }, + "http-errors": { + "version": "1.7.2", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.7.2.tgz", + "integrity": "sha512-uUQBt3H/cSIVfch6i1EuPNy/YsRSOUBXTVfZ+yR7Zjez3qjBz6i9+i4zjNaoqcoFVI4lQJ5plg63TvGfRSDCRg==", + "dev": true, + "requires": { + "depd": "~1.1.2", + "inherits": "2.0.3", + "setprototypeof": "1.1.1", + "statuses": ">= 1.5.0 < 2", + "toidentifier": "1.0.0" + } + }, + "http-graceful-shutdown": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/http-graceful-shutdown/-/http-graceful-shutdown-2.3.2.tgz", + "integrity": "sha512-Dn7fJjHWboN7WjNDuo7d7ZISdUlbnyQEtOjBwMGJig45ZztHQxCsnW9N89Pr3gb6VzvZy1HySgAu2Q98j6S17w==", + "dev": true, + "requires": { + "debug": "^4.1.1" + } + }, "http-proxy": { "version": "1.18.1", "resolved": "https://registry.npmjs.org/http-proxy/-/http-proxy-1.18.1.tgz", @@ -2576,6 +3458,14 @@ "portfinder": "^1.0.25", "secure-compare": "3.0.1", "union": "~0.5.0" + }, + "dependencies": { + "basic-auth": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/basic-auth/-/basic-auth-1.1.0.tgz", + "integrity": "sha1-RSIe5Cn37h5QNb4/UVM/HN/SmIQ=", + "dev": true + } } }, "https-browserify": { @@ -2584,6 +3474,15 @@ "integrity": "sha1-7AbBDgo0wPL68Zn3/X/Hj//QPHM=", "dev": true }, + "iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "dev": true, + "requires": { + "safer-buffer": ">= 2.1.2 < 3" + } + }, "ieee754": { "version": "1.1.13", "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.13.tgz", @@ -2682,6 +3581,12 @@ "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", "dev": true }, + "indent-string": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", + "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", + "dev": true + }, "infer-owner": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/infer-owner/-/infer-owner-1.0.4.tgz", @@ -2699,9 +3604,9 @@ } }, "inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", "dev": true }, "ini": { @@ -2716,6 +3621,18 @@ "integrity": "sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA==", "dev": true }, + "ipaddr.js": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", + "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==", + "dev": true + }, + "is-absolute-url": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/is-absolute-url/-/is-absolute-url-3.0.3.tgz", + "integrity": "sha512-opmNIX7uFnS96NtPmhWQgQx6/NYFgsUXYMllcfzwWKUMwfo8kku1TvE6hkNcH+Q1ts5cMVrsY7j0bxXQDciu9Q==", + "dev": true + }, "is-accessor-descriptor": { "version": "0.1.6", "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", @@ -2874,6 +3791,12 @@ "has-symbols": "^1.0.1" } }, + "is-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.0.tgz", + "integrity": "sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw==", + "dev": true + }, "is-string": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.5.tgz", @@ -2889,6 +3812,12 @@ "has-symbols": "^1.0.1" } }, + "is-typedarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", + "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", + "dev": true + }, "is-windows": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", @@ -2919,6 +3848,124 @@ "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", "dev": true }, + "istanbul-lib-coverage": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.0.0.tgz", + "integrity": "sha512-UiUIqxMgRDET6eR+o5HbfRYP1l0hqkWOs7vNxC/mggutCMUIhWMm8gAHb8tHlyfD3/l6rlgNA5cKdDzEAf6hEg==", + "dev": true + }, + "istanbul-lib-hook": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-hook/-/istanbul-lib-hook-3.0.0.tgz", + "integrity": "sha512-Pt/uge1Q9s+5VAZ+pCo16TYMWPBIl+oaNIjgLQxcX0itS6ueeaA+pEfThZpH8WxhFgCiEb8sAJY6MdUKgiIWaQ==", + "dev": true, + "requires": { + "append-transform": "^2.0.0" + } + }, + "istanbul-lib-instrument": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-4.0.3.tgz", + "integrity": "sha512-BXgQl9kf4WTCPCCpmFGoJkz/+uhvm7h7PFKUYxh7qarQd3ER33vHG//qaE8eN25l07YqZPpHXU9I09l/RD5aGQ==", + "dev": true, + "requires": { + "@babel/core": "^7.7.5", + "@istanbuljs/schema": "^0.1.2", + "istanbul-lib-coverage": "^3.0.0", + "semver": "^6.3.0" + }, + "dependencies": { + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + } + } + }, + "istanbul-lib-processinfo": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/istanbul-lib-processinfo/-/istanbul-lib-processinfo-2.0.2.tgz", + "integrity": "sha512-kOwpa7z9hme+IBPZMzQ5vdQj8srYgAtaRqeI48NGmAQ+/5yKiHLV0QbYqQpxsdEF0+w14SoB8YbnHKcXE2KnYw==", + "dev": true, + "requires": { + "archy": "^1.0.0", + "cross-spawn": "^7.0.0", + "istanbul-lib-coverage": "^3.0.0-alpha.1", + "make-dir": "^3.0.0", + "p-map": "^3.0.0", + "rimraf": "^3.0.0", + "uuid": "^3.3.3" + }, + "dependencies": { + "rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + } + } + }, + "istanbul-lib-report": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz", + "integrity": "sha512-wcdi+uAKzfiGT2abPpKZ0hSU1rGQjUQnLvtY5MpQ7QCTahD3VODhcu4wcfY1YtkGaDD5yuydOLINXsfbus9ROw==", + "dev": true, + "requires": { + "istanbul-lib-coverage": "^3.0.0", + "make-dir": "^3.0.0", + "supports-color": "^7.1.0" + }, + "dependencies": { + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "supports-color": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz", + "integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, + "istanbul-lib-source-maps": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.0.tgz", + "integrity": "sha512-c16LpFRkR8vQXyHZ5nLpY35JZtzj1PQY1iZmesUbf1FZHbIupcWfjgOXBY9YHkLEQ6puz1u4Dgj6qmU/DisrZg==", + "dev": true, + "requires": { + "debug": "^4.1.1", + "istanbul-lib-coverage": "^3.0.0", + "source-map": "^0.6.1" + }, + "dependencies": { + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, + "istanbul-reports": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.0.2.tgz", + "integrity": "sha512-9tZvz7AiR3PEDNGiV9vIouQ/EAcqMXFmkcA1CDFTwOB98OZVDL0PH9glHotf5Ugp6GCOTypfzGWI/OqjWNCRUw==", + "dev": true, + "requires": { + "html-escaper": "^2.0.0", + "istanbul-lib-report": "^3.0.0" + } + }, "jasmine": { "version": "3.6.1", "resolved": "https://registry.npmjs.org/jasmine/-/jasmine-3.6.1.tgz", @@ -2960,6 +4007,12 @@ "esprima": "^4.0.0" } }, + "jsesc": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", + "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", + "dev": true + }, "json-parse-better-errors": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", @@ -2978,6 +4031,12 @@ "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", "dev": true }, + "json-stringify-safe": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", + "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=", + "dev": true + }, "json5": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", @@ -2987,6 +4046,15 @@ "minimist": "^1.2.0" } }, + "jsonfile": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", + "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.6" + } + }, "kind-of": { "version": "6.0.3", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", @@ -3043,9 +4111,21 @@ } }, "lodash": { - "version": "4.17.19", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.19.tgz", - "integrity": "sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ==", + "version": "4.17.20", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz", + "integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==", + "dev": true + }, + "lodash-es": { + "version": "4.17.15", + "resolved": "https://registry.npmjs.org/lodash-es/-/lodash-es-4.17.15.tgz", + "integrity": "sha512-rlrc3yU3+JNOpZ9zj5pQtxnx2THmvRykwL4Xlxoa8I9lHBlVbbyPhgyPMioxVZ4NqyxaVVtaJnzsyOidQIhyyQ==", + "dev": true + }, + "lodash.flattendeep": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/lodash.flattendeep/-/lodash.flattendeep-4.4.0.tgz", + "integrity": "sha1-+wMJF/hqMTTlvJvsDWngAT3f7bI=", "dev": true }, "lru-cache": { @@ -3058,25 +4138,18 @@ } }, "make-dir": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-2.1.0.tgz", - "integrity": "sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", + "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", "dev": true, "requires": { - "pify": "^4.0.1", - "semver": "^5.6.0" + "semver": "^6.0.0" }, "dependencies": { - "pify": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", - "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", - "dev": true - }, "semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", "dev": true } } @@ -3113,6 +4186,12 @@ "safe-buffer": "^5.1.2" } }, + "media-typer": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", + "integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=", + "dev": true + }, "memory-fs": { "version": "0.5.0", "resolved": "https://registry.npmjs.org/memory-fs/-/memory-fs-0.5.0.tgz", @@ -3123,12 +4202,24 @@ "readable-stream": "^2.0.1" } }, + "merge-descriptors": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", + "integrity": "sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E=", + "dev": true + }, "merge2": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", "dev": true }, + "methods": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", + "integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=", + "dev": true + }, "micromatch": { "version": "3.1.10", "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", @@ -3174,6 +4265,21 @@ "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", "dev": true }, + "mime-db": { + "version": "1.44.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.44.0.tgz", + "integrity": "sha512-/NOTfLrsPBVeH7YtFPgsVWveuL+4SjjYxaQ1xtM1KMFj7HdxlBlxeyNLzhyJVx7r4rZGJAZ/6lkKCitSc/Nmpg==", + "dev": true + }, + "mime-types": { + "version": "2.1.27", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.27.tgz", + "integrity": "sha512-JIhqnCasI9yD+SsmkquHBxTSEuZdQX5BuQnS2Vc7puQQQ+8yiP5AY5uWhpdv4YL4VM5c6iliiYWPgJ/nJQLp7w==", + "dev": true, + "requires": { + "mime-db": "1.44.0" + } + }, "minimalistic-assert": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", @@ -3249,6 +4355,42 @@ "minimist": "^1.2.5" } }, + "morgan": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/morgan/-/morgan-1.10.0.tgz", + "integrity": "sha512-AbegBVI4sh6El+1gNwvD5YIck7nSA36weD7xvIxG4in80j/UoK8AEGaWnnz8v1GxonMCltmlNs5ZKbGvl9b1XQ==", + "dev": true, + "requires": { + "basic-auth": "~2.0.1", + "debug": "2.6.9", + "depd": "~2.0.0", + "on-finished": "~2.3.0", + "on-headers": "~1.0.2" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "depd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", + "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", + "dev": true + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + } + } + }, "move-concurrently": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/move-concurrently/-/move-concurrently-1.0.1.tgz", @@ -3294,6 +4436,12 @@ "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", "dev": true }, + "negotiator": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.2.tgz", + "integrity": "sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw==", + "dev": true + }, "neo-async": { "version": "2.6.2", "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", @@ -3306,6 +4454,24 @@ "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", "dev": true }, + "nocache": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/nocache/-/nocache-2.1.0.tgz", + "integrity": "sha512-0L9FvHG3nfnnmaEQPjT9xhfN4ISk0A8/2j4M37Np4mcDesJjHgEUfgPhdCyZuFI954tjokaIj/A3NdpFNdEh4Q==", + "dev": true + }, + "nock": { + "version": "12.0.3", + "resolved": "https://registry.npmjs.org/nock/-/nock-12.0.3.tgz", + "integrity": "sha512-QNb/j8kbFnKCiyqi9C5DD0jH/FubFGj5rt9NQFONXwQm3IPB0CULECg/eS3AU1KgZb/6SwUa4/DTRKhVxkGABw==", + "dev": true, + "requires": { + "debug": "^4.1.0", + "json-stringify-safe": "^5.0.1", + "lodash": "^4.17.13", + "propagate": "^2.0.0" + } + }, "node-fetch": { "version": "2.6.0", "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.0.tgz", @@ -3350,6 +4516,15 @@ } } }, + "node-preload": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/node-preload/-/node-preload-0.2.1.tgz", + "integrity": "sha512-RM5oyBy45cLEoHqCeh+MNuFAxO0vTFBLskvQbOKnEE7YTTSN4tbN8QWDIPQ6L+WvKsB/qLEGpYe2ZZ9d4W9OIQ==", + "dev": true, + "requires": { + "process-on-spawn": "^1.0.0" + } + }, "normalize-package-data": { "version": "2.5.0", "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", @@ -3377,6 +4552,107 @@ "dev": true, "optional": true }, + "nyc": { + "version": "15.1.0", + "resolved": "https://registry.npmjs.org/nyc/-/nyc-15.1.0.tgz", + "integrity": "sha512-jMW04n9SxKdKi1ZMGhvUTHBN0EICCRkHemEoE5jm6mTYcqcdas0ATzgUgejlQUHMvpnOZqGB5Xxsv9KxJW1j8A==", + "dev": true, + "requires": { + "@istanbuljs/load-nyc-config": "^1.0.0", + "@istanbuljs/schema": "^0.1.2", + "caching-transform": "^4.0.0", + "convert-source-map": "^1.7.0", + "decamelize": "^1.2.0", + "find-cache-dir": "^3.2.0", + "find-up": "^4.1.0", + "foreground-child": "^2.0.0", + "get-package-type": "^0.1.0", + "glob": "^7.1.6", + "istanbul-lib-coverage": "^3.0.0", + "istanbul-lib-hook": "^3.0.0", + "istanbul-lib-instrument": "^4.0.0", + "istanbul-lib-processinfo": "^2.0.2", + "istanbul-lib-report": "^3.0.0", + "istanbul-lib-source-maps": "^4.0.0", + "istanbul-reports": "^3.0.2", + "make-dir": "^3.0.0", + "node-preload": "^0.2.1", + "p-map": "^3.0.0", + "process-on-spawn": "^1.0.0", + "resolve-from": "^5.0.0", + "rimraf": "^3.0.0", + "signal-exit": "^3.0.2", + "spawn-wrap": "^2.0.0", + "test-exclude": "^6.0.0", + "yargs": "^15.0.2" + }, + "dependencies": { + "find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "requires": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + } + }, + "locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "requires": { + "p-locate": "^4.1.0" + } + }, + "p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "requires": { + "p-try": "^2.0.0" + } + }, + "p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "requires": { + "p-limit": "^2.2.0" + } + }, + "p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "dev": true + }, + "path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true + }, + "resolve-from": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", + "dev": true + }, + "rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + } + } + }, "object-assign": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", @@ -3479,6 +4755,21 @@ "has": "^1.0.3" } }, + "on-finished": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", + "integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=", + "dev": true, + "requires": { + "ee-first": "1.1.1" + } + }, + "on-headers": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/on-headers/-/on-headers-1.0.2.tgz", + "integrity": "sha512-pZAE+FJLoyITytdqK0U5s+FIpjN0JP3OzFi/u8Rx+EV5/W+JTWGXG8xFzevE7AjBfDqHv/8vL8qQsIhHnqRkrA==", + "dev": true + }, "once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", @@ -3532,12 +4823,33 @@ "p-limit": "^1.1.0" } }, + "p-map": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-3.0.0.tgz", + "integrity": "sha512-d3qXVTF/s+W+CdJ5A29wywV2n8CQQYahlgz2bFiA+4eVNJbHJodPZ+/gXwPGh0bOqA+j8S+6+ckmvLGPk1QpxQ==", + "dev": true, + "requires": { + "aggregate-error": "^3.0.0" + } + }, "p-try": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", "dev": true }, + "package-hash": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/package-hash/-/package-hash-4.0.0.tgz", + "integrity": "sha512-whdkPIooSu/bASggZ96BWVvZTRMOFxnyUG5PnTSGKoJE2gd5mbVNmR2Nj20QFzxYYgAXpoqC+AiXzl+UMRh7zQ==", + "dev": true, + "requires": { + "graceful-fs": "^4.1.15", + "hasha": "^5.0.0", + "lodash.flattendeep": "^4.4.0", + "release-zalgo": "^1.0.0" + } + }, "pako": { "version": "1.0.11", "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.11.tgz", @@ -3565,14 +4877,13 @@ } }, "parse-asn1": { - "version": "5.1.5", - "resolved": "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.5.tgz", - "integrity": "sha512-jkMYn1dcJqF6d5CpU689bq7w/b5ALS9ROVSpQDPrZsqqesUJii9qutvoT5ltGedNXMO2e16YUWIghG9KxaViTQ==", + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.6.tgz", + "integrity": "sha512-RnZRo1EPU6JBnra2vGHj0yhp6ebyjBZpmUCLHWiFhxlzvBCCpAuZ7elsBp1PVAbQN0/04VD/19rfzlBSwLstMw==", "dev": true, "requires": { - "asn1.js": "^4.0.0", + "asn1.js": "^5.2.0", "browserify-aes": "^1.0.0", - "create-hash": "^1.1.0", "evp_bytestokey": "^1.0.0", "pbkdf2": "^3.0.3", "safe-buffer": "^5.1.1" @@ -3593,6 +4904,12 @@ "integrity": "sha1-bVuTSkVpk7I9N/QKOC1vFmao5cY=", "dev": true }, + "parseurl": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", + "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", + "dev": true + }, "pascalcase": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz", @@ -3635,6 +4952,12 @@ "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", "dev": true }, + "path-to-regexp": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", + "integrity": "sha1-32BBeABfUi8V60SQ5yR6G/qmf4w=", + "dev": true + }, "path-type": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/path-type/-/path-type-2.0.0.tgz", @@ -3739,6 +5062,15 @@ "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", "dev": true }, + "process-on-spawn": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/process-on-spawn/-/process-on-spawn-1.0.0.tgz", + "integrity": "sha512-1WsPDsUSMmZH5LeMLegqkPDrsGgsWwk1Exipy2hvB0o/F0ASzbpIctSCcZIK1ykJvtTJULEH+20WOFjMvGnCTg==", + "dev": true, + "requires": { + "fromentries": "^1.2.0" + } + }, "progress": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", @@ -3751,6 +5083,22 @@ "integrity": "sha1-mEcocL8igTL8vdhoEputEsPAKeM=", "dev": true }, + "propagate": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/propagate/-/propagate-2.0.1.tgz", + "integrity": "sha512-vGrhOavPSTz4QVNuBNdcNXePNdNMaO1xj9yBeH1ScQPjk/rhg9sSlCXPhMkFuaNNW/syTvYqsnbIJxMBfRbbag==", + "dev": true + }, + "proxy-addr": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.6.tgz", + "integrity": "sha512-dh/frvCBVmSsDYzw6n926jv974gddhkFPfiN8hPOi30Wax25QZyZEGveluCgliBnqmuM+UJmBErbAUFIoDbjOw==", + "dev": true, + "requires": { + "forwarded": "~0.1.2", + "ipaddr.js": "1.9.1" + } + }, "prr": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/prr/-/prr-1.0.1.tgz", @@ -3836,6 +5184,12 @@ "integrity": "sha1-nsYfeQSYdXB9aUFFlv2Qek1xHnM=", "dev": true }, + "querystringify": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.1.1.tgz", + "integrity": "sha512-w7fLxIRCRT7U8Qu53jQnJyPkYZIaR4n5151KMfcJlO/A9397Wxb1amJvROTK6TOnp7PfoAmg/qXiNHI+08jRfA==", + "dev": true + }, "randombytes": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", @@ -3855,6 +5209,24 @@ "safe-buffer": "^5.1.0" } }, + "range-parser": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", + "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", + "dev": true + }, + "raw-body": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.4.0.tgz", + "integrity": "sha512-4Oz8DUIwdvoa5qMJelxipzi/iJIi40O5cGV1wNYp5hvZP8ZN0T+jiNkL0QepXs+EsQ9XJ8ipEDoiH70ySUJP3Q==", + "dev": true, + "requires": { + "bytes": "3.1.0", + "http-errors": "1.7.2", + "iconv-lite": "0.4.24", + "unpipe": "1.0.0" + } + }, "read-pkg": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-2.0.0.tgz", @@ -3917,6 +5289,15 @@ "integrity": "sha512-ZOIzd8yVsQQA7j8GCSlPGXwg5PfmA1mrq0JP4nGhh54LaKN3xdai/vHUDu74pKwV8OxseMS65u2NImosQcSD0Q==", "dev": true }, + "release-zalgo": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/release-zalgo/-/release-zalgo-1.0.0.tgz", + "integrity": "sha1-CXALflB0Mpc5Mw5TXFqQ+2eFFzA=", + "dev": true, + "requires": { + "es6-error": "^4.0.1" + } + }, "remove-trailing-separator": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", @@ -4040,6 +5421,12 @@ "inherits": "^2.0.1" } }, + "route-recognizer": { + "version": "0.3.4", + "resolved": "https://registry.npmjs.org/route-recognizer/-/route-recognizer-0.3.4.tgz", + "integrity": "sha512-2+MhsfPhvauN1O8KaXpXAOfR/fwe8dnUXVM+xw7yt40lJRfPVQxV6yryZm0cgRvAj5fMF/mdRZbL2ptwbs5i2g==", + "dev": true + }, "run-queue": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/run-queue/-/run-queue-1.0.3.tgz", @@ -4064,6 +5451,12 @@ "ret": "~0.1.10" } }, + "safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "dev": true + }, "schema-utils": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-1.0.0.tgz", @@ -4087,21 +5480,85 @@ "integrity": "sha512-OrOb32TeeambH6UrhtShmF7CRDqhL6/5XpPNp2DuRH6+9QLw/orhp72j87v8Qa1ScDkvrrBNpZcDejAirJmfXQ==", "dev": true }, + "send": { + "version": "0.17.1", + "resolved": "https://registry.npmjs.org/send/-/send-0.17.1.tgz", + "integrity": "sha512-BsVKsiGcQMFwT8UxypobUKyv7irCNRHk1T0G680vk88yf6LBByGcZJOTJCrTP2xVN6yI+XjPJcNuE3V4fT9sAg==", + "dev": true, + "requires": { + "debug": "2.6.9", + "depd": "~1.1.2", + "destroy": "~1.0.4", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "fresh": "0.5.2", + "http-errors": "~1.7.2", + "mime": "1.6.0", + "ms": "2.1.1", + "on-finished": "~2.3.0", + "range-parser": "~1.2.1", + "statuses": "~1.5.0" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + }, + "dependencies": { + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + } + } + }, + "ms": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", + "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", + "dev": true + } + } + }, "serialize-javascript": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-3.1.0.tgz", - "integrity": "sha512-JIJT1DGiWmIKhzRsG91aS6Ze4sFUrYbltlkg2onR5OrnNM02Kl/hnY/T4FN2omvyeBbQmMJv+K4cPOpGzOTFBg==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-4.0.0.tgz", + "integrity": "sha512-GaNA54380uFefWghODBWEGisLZFj00nS5ACs6yHa9nLqlLpVLO8ChDGeKRjZnV4Nh4n0Qi7nhYZD/9fCPzEqkw==", "dev": true, "requires": { "randombytes": "^2.1.0" } }, + "serve-static": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.14.1.tgz", + "integrity": "sha512-JMrvUwE54emCYWlTI+hGrGv5I8dEwmco/00EvkzIIsR7MqrHonbD9pO2MOfFnpFntl7ecpZs+3mW+XbQZu9QCg==", + "dev": true, + "requires": { + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "parseurl": "~1.3.3", + "send": "0.17.1" + } + }, "set-blocking": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", "dev": true }, + "set-cookie-parser": { + "version": "2.4.6", + "resolved": "https://registry.npmjs.org/set-cookie-parser/-/set-cookie-parser-2.4.6.tgz", + "integrity": "sha512-mNCnTUF0OYPwYzSHbdRdCfNNHqrne+HS5tS5xNb6yJbdP9wInV0q5xPLE0EyfV/Q3tImo3y/OXpD8Jn0Jtnjrg==", + "dev": true + }, "set-value": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.1.tgz", @@ -4131,6 +5588,18 @@ "integrity": "sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU=", "dev": true }, + "setprototypeof": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.1.tgz", + "integrity": "sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw==", + "dev": true + }, + "setup-polly-jest": { + "version": "0.9.1", + "resolved": "https://registry.npmjs.org/setup-polly-jest/-/setup-polly-jest-0.9.1.tgz", + "integrity": "sha512-BbOxCvMnDHAPG9e3Qw3Ol4/ZWLwnDnhODqrfiIpAtF7Azu0O3PI4svZIfsh+/EV9xNj15LMkvchaWsDvF4A3hQ==", + "dev": true + }, "sha.js": { "version": "2.4.11", "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", @@ -4141,6 +5610,15 @@ "safe-buffer": "^5.0.1" } }, + "shallow-clone": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/shallow-clone/-/shallow-clone-3.0.1.tgz", + "integrity": "sha512-/6KqX+GVUdqPuPPd2LxDDxzX6CAbjJehAAOKlNpqqUpAqPM6HeL8f+o3a+JsyGjn2lv0WY8UsTgUJjU9Ok55NA==", + "dev": true, + "requires": { + "kind-of": "^6.0.2" + } + }, "shebang-command": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", @@ -4156,6 +5634,12 @@ "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", "dev": true }, + "signal-exit": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz", + "integrity": "sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==", + "dev": true + }, "slice-ansi": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-2.1.0.tgz", @@ -4167,6 +5651,12 @@ "is-fullwidth-code-point": "^2.0.0" } }, + "slugify": { + "version": "1.4.5", + "resolved": "https://registry.npmjs.org/slugify/-/slugify-1.4.5.tgz", + "integrity": "sha512-WpECLAgYaxHoEAJ8Q1Lo8HOs1ngn7LN7QjXgOLbmmfkcWvosyk4ZTXkTzKyhngK640USTZUlgoQJfED1kz5fnQ==", + "dev": true + }, "snapdragon": { "version": "0.8.2", "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz", @@ -4338,6 +5828,31 @@ "integrity": "sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM=", "dev": true }, + "spawn-wrap": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/spawn-wrap/-/spawn-wrap-2.0.0.tgz", + "integrity": "sha512-EeajNjfN9zMnULLwhZZQU3GWBoFNkbngTUPfaawT4RkMiviTxcX0qfhVbGey39mfctfDHkWtuecgQ8NJcyQWHg==", + "dev": true, + "requires": { + "foreground-child": "^2.0.0", + "is-windows": "^1.0.2", + "make-dir": "^3.0.0", + "rimraf": "^3.0.0", + "signal-exit": "^3.0.2", + "which": "^2.0.1" + }, + "dependencies": { + "rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + } + } + }, "spdx-correct": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.1.tgz", @@ -4415,6 +5930,12 @@ } } }, + "statuses": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", + "integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow=", + "dev": true + }, "stream-browserify": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/stream-browserify/-/stream-browserify-2.0.2.tgz", @@ -4578,29 +6099,125 @@ } } }, - "terser-webpack-plugin": { - "version": "1.4.4", - "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-1.4.4.tgz", - "integrity": "sha512-U4mACBHIegmfoEe5fdongHESNJWqsGU+W0S/9+BmYGVQDw1+c2Ow05TpMhxjPK1sRb7cuYq1BPl1e5YHJMTCqA==", + "terser-webpack-plugin": { + "version": "1.4.5", + "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-1.4.5.tgz", + "integrity": "sha512-04Rfe496lN8EYruwi6oPQkG0vo8C+HT49X687FZnpPF0qMAIHONI6HEXYPKDOE8e5HjXTyKfqRd/agHtH0kOtw==", + "dev": true, + "requires": { + "cacache": "^12.0.2", + "find-cache-dir": "^2.1.0", + "is-wsl": "^1.1.0", + "schema-utils": "^1.0.0", + "serialize-javascript": "^4.0.0", + "source-map": "^0.6.1", + "terser": "^4.1.2", + "webpack-sources": "^1.4.0", + "worker-farm": "^1.7.0" + }, + "dependencies": { + "find-cache-dir": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-2.1.0.tgz", + "integrity": "sha512-Tq6PixE0w/VMFfCgbONnkiQIVol/JJL7nRMi20fqzA4NRs9AfeqMGeRdPi3wIhYkxjeBaWh2rxwapn5Tu3IqOQ==", + "dev": true, + "requires": { + "commondir": "^1.0.1", + "make-dir": "^2.0.0", + "pkg-dir": "^3.0.0" + } + }, + "find-up": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", + "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "dev": true, + "requires": { + "locate-path": "^3.0.0" + } + }, + "locate-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", + "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", + "dev": true, + "requires": { + "p-locate": "^3.0.0", + "path-exists": "^3.0.0" + } + }, + "make-dir": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-2.1.0.tgz", + "integrity": "sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==", + "dev": true, + "requires": { + "pify": "^4.0.1", + "semver": "^5.6.0" + } + }, + "p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "requires": { + "p-try": "^2.0.0" + } + }, + "p-locate": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", + "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", + "dev": true, + "requires": { + "p-limit": "^2.0.0" + } + }, + "p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "dev": true + }, + "pify": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", + "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", + "dev": true + }, + "pkg-dir": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-3.0.0.tgz", + "integrity": "sha512-/E57AYkoeQ25qkxMj5PBOVgF8Kiu/h7cYS30Z5+R7WaiCCBfLq58ZI/dSeaEKb9WVJV5n/03QwrN3IeWIFllvw==", + "dev": true, + "requires": { + "find-up": "^3.0.0" + } + }, + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, + "test-exclude": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz", + "integrity": "sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==", "dev": true, "requires": { - "cacache": "^12.0.2", - "find-cache-dir": "^2.1.0", - "is-wsl": "^1.1.0", - "schema-utils": "^1.0.0", - "serialize-javascript": "^3.1.0", - "source-map": "^0.6.1", - "terser": "^4.1.2", - "webpack-sources": "^1.4.0", - "worker-farm": "^1.7.0" - }, - "dependencies": { - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true - } + "@istanbuljs/schema": "^0.1.2", + "glob": "^7.1.4", + "minimatch": "^3.0.4" } }, "text-table": { @@ -4634,6 +6251,12 @@ "integrity": "sha1-fSKbH8xjfkZsoIEYCDanqr/4P0M=", "dev": true }, + "to-fast-properties": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", + "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=", + "dev": true + }, "to-object-path": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/to-object-path/-/to-object-path-0.3.0.tgz", @@ -4676,10 +6299,16 @@ "repeat-string": "^1.6.1" } }, + "toidentifier": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.0.tgz", + "integrity": "sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw==", + "dev": true + }, "ts-loader": { - "version": "7.0.5", - "resolved": "https://registry.npmjs.org/ts-loader/-/ts-loader-7.0.5.tgz", - "integrity": "sha512-zXypEIT6k3oTc+OZNx/cqElrsbBtYqDknf48OZos0NQ3RTt045fBIU8RRSu+suObBzYB355aIPGOe/3kj9h7Ig==", + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/ts-loader/-/ts-loader-8.0.2.tgz", + "integrity": "sha512-oYT7wOTUawYXQ8XIDsRhziyW0KUEV38jISYlE+9adP6tDtG+O5GkRe4QKQXrHVH4mJJ88DysvEtvGP65wMLlhg==", "dev": true, "requires": { "chalk": "^2.3.0", @@ -4821,12 +6450,31 @@ "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", "dev": true }, + "type-is": { + "version": "1.6.18", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", + "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", + "dev": true, + "requires": { + "media-typer": "0.3.0", + "mime-types": "~2.1.24" + } + }, "typedarray": { "version": "0.0.6", "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=", "dev": true }, + "typedarray-to-buffer": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz", + "integrity": "sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q==", + "dev": true, + "requires": { + "is-typedarray": "^1.0.0" + } + }, "typescript": { "version": "3.9.7", "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.7.tgz", @@ -4872,6 +6520,18 @@ "imurmurhash": "^0.1.4" } }, + "universalify": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", + "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", + "dev": true + }, + "unpipe": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=", + "dev": true + }, "unset-value": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz", @@ -4958,12 +6618,28 @@ "integrity": "sha1-WvIvGMBSoACkjXuCxenC4v7tpyg=", "dev": true }, + "url-parse": { + "version": "1.4.7", + "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.4.7.tgz", + "integrity": "sha512-d3uaVyzDB9tQoSXFvuSUNFibTd9zxd2bkVrDRvF5TmvWWQwqE4lgYJ5m+x1DbecWkw+LK4RNl2CU1hHuOKPVlg==", + "dev": true, + "requires": { + "querystringify": "^2.1.1", + "requires-port": "^1.0.0" + } + }, "use": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz", "integrity": "sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==", "dev": true }, + "utf8-byte-length": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/utf8-byte-length/-/utf8-byte-length-1.0.4.tgz", + "integrity": "sha1-9F8VDExm7uloGGUFq5P8u4rWv2E=", + "dev": true + }, "util": { "version": "0.11.1", "resolved": "https://registry.npmjs.org/util/-/util-0.11.1.tgz", @@ -4971,14 +6647,6 @@ "dev": true, "requires": { "inherits": "2.0.3" - }, - "dependencies": { - "inherits": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", - "dev": true - } } }, "util-deprecate": { @@ -4987,6 +6655,18 @@ "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", "dev": true }, + "utils-merge": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", + "integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=", + "dev": true + }, + "uuid": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", + "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", + "dev": true + }, "v8-compile-cache": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.1.1.tgz", @@ -5003,6 +6683,12 @@ "spdx-expression-parse": "^3.0.0" } }, + "vary": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", + "integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=", + "dev": true + }, "vm-browserify": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/vm-browserify/-/vm-browserify-1.1.2.tgz", @@ -5214,6 +6900,12 @@ "yargs": "^13.3.2" }, "dependencies": { + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true + }, "chalk": { "version": "2.4.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", @@ -5236,6 +6928,17 @@ } } }, + "cliui": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz", + "integrity": "sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==", + "dev": true, + "requires": { + "string-width": "^3.1.0", + "strip-ansi": "^5.2.0", + "wrap-ansi": "^5.1.0" + } + }, "cross-spawn": { "version": "6.0.5", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", @@ -5249,6 +6952,49 @@ "which": "^1.2.9" } }, + "find-up": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", + "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "dev": true, + "requires": { + "locate-path": "^3.0.0" + } + }, + "locate-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", + "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", + "dev": true, + "requires": { + "p-locate": "^3.0.0", + "path-exists": "^3.0.0" + } + }, + "p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "requires": { + "p-try": "^2.0.0" + } + }, + "p-locate": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", + "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", + "dev": true, + "requires": { + "p-limit": "^2.0.0" + } + }, + "p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "dev": true + }, "path-key": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", @@ -5276,6 +7022,15 @@ "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", "dev": true }, + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "requires": { + "ansi-regex": "^4.1.0" + } + }, "supports-color": { "version": "6.1.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.1.0.tgz", @@ -5293,16 +7048,56 @@ "requires": { "isexe": "^2.0.0" } + }, + "wrap-ansi": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz", + "integrity": "sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.0", + "string-width": "^3.0.0", + "strip-ansi": "^5.0.0" + } + }, + "yargs": { + "version": "13.3.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.3.2.tgz", + "integrity": "sha512-AX3Zw5iPruN5ie6xGRIDgqkT+ZhnRlZMLMHAs8tg7nRruy2Nb+i5o9bwghAogtM08q1dpr2LVoS8KSTMYpWXUw==", + "dev": true, + "requires": { + "cliui": "^5.0.0", + "find-up": "^3.0.0", + "get-caller-file": "^2.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^2.0.0", + "set-blocking": "^2.0.0", + "string-width": "^3.0.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^13.1.2" + } + }, + "yargs-parser": { + "version": "13.1.2", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.2.tgz", + "integrity": "sha512-3lbsNRf/j+A4QuSZfDRA7HRSfWrzO0YjqTJd5kjAq37Zep1CEgaYmrH9Q3GwPiB9cHyd1Y1UwggGhJGoxipbzg==", + "dev": true, + "requires": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + } } } }, "webpack-merge": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/webpack-merge/-/webpack-merge-4.2.2.tgz", - "integrity": "sha512-TUE1UGoTX2Cd42j3krGYqObZbOD+xF7u28WB7tfUordytSjbWTIjK/8V0amkBfTYN4/pB/GIDlJZZ657BGG19g==", + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/webpack-merge/-/webpack-merge-5.1.1.tgz", + "integrity": "sha512-UhIkHAVqeG9EqFfYo7dRELrVfH6HYaOTYM7ssKCwfIIHYnWepGVOFp1E166GwgPGFqV6M68UgRiKOERjVOKIXA==", "dev": true, "requires": { - "lodash": "^4.17.15" + "clone-deep": "^4.0.1", + "wildcard": "^2.0.0" } }, "webpack-sources": { @@ -5338,6 +7133,12 @@ "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", "dev": true }, + "wildcard": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/wildcard/-/wildcard-2.0.0.tgz", + "integrity": "sha512-JcKqAHLPxcdb9KM49dufGXn2x3ssnfjbcaQdLlfZsL9rH9wgDQjUtDxbo8NE0F6SFvydeu1VhZe7hZuHsB2/pw==", + "dev": true + }, "word-wrap": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", @@ -5354,29 +7155,62 @@ } }, "wrap-ansi": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz", - "integrity": "sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==", + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", + "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", "dev": true, "requires": { - "ansi-styles": "^3.2.0", - "string-width": "^3.0.0", - "strip-ansi": "^5.0.0" + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" }, "dependencies": { - "ansi-regex": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", - "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "ansi-styles": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz", + "integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==", + "dev": true, + "requires": { + "@types/color-name": "^1.1.1", + "color-convert": "^2.0.1" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, - "strip-ansi": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", - "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true + }, + "string-width": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz", + "integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==", "dev": true, "requires": { - "ansi-regex": "^4.1.0" + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.0" } } } @@ -5396,6 +7230,18 @@ "mkdirp": "^0.5.1" } }, + "write-file-atomic": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-3.0.3.tgz", + "integrity": "sha512-AvHcyZ5JnSfq3ioSyjrBkH9yW4m7Ayk8/9My/DD9onKeu/94fwrMocemO2QAJFAlnnDN+ZDS+ZjAR5ua1/PV/Q==", + "dev": true, + "requires": { + "imurmurhash": "^0.1.4", + "is-typedarray": "^1.0.0", + "signal-exit": "^3.0.2", + "typedarray-to-buffer": "^3.1.5" + } + }, "xtend": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", @@ -5415,40 +7261,53 @@ "dev": true }, "yargs": { - "version": "13.3.2", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.3.2.tgz", - "integrity": "sha512-AX3Zw5iPruN5ie6xGRIDgqkT+ZhnRlZMLMHAs8tg7nRruy2Nb+i5o9bwghAogtM08q1dpr2LVoS8KSTMYpWXUw==", + "version": "15.4.1", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz", + "integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==", "dev": true, "requires": { - "cliui": "^5.0.0", - "find-up": "^3.0.0", + "cliui": "^6.0.0", + "decamelize": "^1.2.0", + "find-up": "^4.1.0", "get-caller-file": "^2.0.1", "require-directory": "^2.1.1", "require-main-filename": "^2.0.0", "set-blocking": "^2.0.0", - "string-width": "^3.0.0", + "string-width": "^4.2.0", "which-module": "^2.0.0", "y18n": "^4.0.0", - "yargs-parser": "^13.1.2" + "yargs-parser": "^18.1.2" }, "dependencies": { + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, "find-up": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", - "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", "dev": true, "requires": { - "locate-path": "^3.0.0" + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" } }, - "locate-path": { + "is-fullwidth-code-point": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", - "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true + }, + "locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", "dev": true, "requires": { - "p-locate": "^3.0.0", - "path-exists": "^3.0.0" + "p-locate": "^4.1.0" } }, "p-limit": { @@ -5461,12 +7320,12 @@ } }, "p-locate": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", - "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", "dev": true, "requires": { - "p-limit": "^2.0.0" + "p-limit": "^2.2.0" } }, "p-try": { @@ -5474,13 +7333,30 @@ "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", "dev": true + }, + "path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true + }, + "string-width": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz", + "integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==", + "dev": true, + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.0" + } } } }, "yargs-parser": { - "version": "13.1.2", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.2.tgz", - "integrity": "sha512-3lbsNRf/j+A4QuSZfDRA7HRSfWrzO0YjqTJd5kjAq37Zep1CEgaYmrH9Q3GwPiB9cHyd1Y1UwggGhJGoxipbzg==", + "version": "18.1.3", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", + "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", "dev": true, "requires": { "camelcase": "^5.0.0", diff --git a/package.json b/package.json index 579895a..a7b26ed 100644 --- a/package.json +++ b/package.json @@ -35,8 +35,17 @@ "cross-fetch": "^3.0.0" }, "devDependencies": { + "@pollyjs/adapter-node-http": "^5.0.0", + "@pollyjs/core": "^5.0.0", + "@pollyjs/persister-fs": "^5.0.0", + "@pollyjs/utils": "^5.0.0", "@types/jasmine": "^3.5.0", "@types/node": "^14.0.0", + "@types/pollyjs__adapter-node-http": "^2.0.0", + "@types/pollyjs__core": "^4.3.0", + "@types/pollyjs__persister-fs": "^2.0.0", + "@types/pollyjs__utils": "^2.6.0", + "@types/setup-polly-jest": "^0.5.0", "@types/webpack-env": "^1.15.0", "@typescript-eslint/eslint-plugin": "^3.2.0", "@typescript-eslint/parser": "^3.2.0", @@ -50,22 +59,27 @@ "http-server": "^0.12.0", "jasmine": "^3.5.0", "jasmine-spec-reporter": "^5.0.0", + "nyc": "^15.1.0", "prettier": "^2.0.0", - "ts-loader": "^7.0.0", + "setup-polly-jest": "^0.9.0", + "ts-loader": "^8.0.0", "ts-node": "^8.10.0", "tsconfig-paths": "^3.9.0", "ttypescript": "^1.5.0", "typescript": "^3.9.0", "webpack": "^4.43.0", "webpack-cli": "^3.3.0", - "webpack-merge": "^4.2.0" + "webpack-merge": "^5.1.0" }, "scripts": { "build": "rm -rf types && rm -rf dist && webpack --config webpack.dev.js && webpack --config webpack.prod.js && ttsc", + "coverage": "nyc npm test", + "coverage-lcov": "nyc --reporter=lcov npm test", "lint": "eslint --fix --ext .ts .", "prepublishOnly": "npm run build", "serve": "http-server", "test": "ts-node --compiler ttypescript -r tsconfig-paths/register node_modules/.bin/jasmine", + "test-record": "POLLY_RECORD=1 npm test", "ts-node": "ts-node --skip-project", "watch": "webpack --config webpack.dev.js --watch" } diff --git a/spec/provider/BingProvider.spec.ts b/spec/provider/BingProvider.spec.ts index 79a8f1a..4bbb889 100644 --- a/spec/provider/BingProvider.spec.ts +++ b/spec/provider/BingProvider.spec.ts @@ -1,57 +1,18 @@ -import { BingProvider, BingResult } from "provider"; +import UniversalGeocoder from "UniversalGeocoder"; +import { BingProvider } from "provider"; import ExternalLoader from "ExternalLoader"; import Geocoded from "Geocoded"; +import setupPolly, { cleanRecording } from "../setupPolly"; -describe("Bing Geocoder Provider raw result to Geocoded mapping", () => { - let geocoded: Geocoded; - - const stubBingResult: BingResult = { - __type: "Location:http://schemas.microsoft.com/search/local/ws/rest/v1", - bbox: [ - 47.636186665473566, - -122.13744013372656, - 47.64391210061492, - -122.12215365108256, - ], - name: "1 Microsoft Way, Redmond, WA 98052", - point: { - type: "Point", - coordinates: [47.64004938304424, -122.12979689240456], - }, - address: { - addressLine: "1 Microsoft Way", - adminDistrict: "WA", - adminDistrict2: "King Co.", - countryRegion: "United States", - formattedAddress: "1 Microsoft Way, Redmond, WA 98052", - locality: "Redmond", - postalCode: "98052", - }, - confidence: "High", - entityType: "Address", - geocodePoints: [ - { - type: "Point", - coordinates: [47.64004938304424, -122.12979689240456], - calculationMethod: "InterpolationOffset", - usageTypes: ["Display"], - }, - { - type: "Point", - coordinates: [47.64006815850735, -122.12985791265965], - calculationMethod: "Interpolation", - usageTypes: ["Route"], - }, - ], - matchCodes: ["Good"], - }; +describe("Bing Geocoder Provider", () => { + const pollyContext = setupPolly(); beforeEach(() => { - geocoded = BingProvider.mapToGeocoded(stubBingResult); + cleanRecording(pollyContext); }); - it("receives results from the Bing geocoder", () => { - expect(geocoded).toBeDefined(); + afterEach(async () => { + await pollyContext.polly.flush(); }); it("expects API Key to be required on initiation", () => { @@ -61,45 +22,97 @@ describe("Bing Geocoder Provider raw result to Geocoded mapping", () => { ); }); - it("maps coordinates correctly", () => { - expect(geocoded.getCoordinates()).toEqual([ - 47.64004938304424, - -122.12979689240456, - ]); - }); + it("receives correct geocoding results", (done) => { + const provider = UniversalGeocoder.createGeocoder({ + provider: "bing", + useSsl: true, + apiKey: "api_key", + }); - it("maps bounds correctly", () => { - expect(geocoded.getBounds()).toEqual([ - 47.636186665473566, - -122.13744013372656, - 47.64391210061492, - -122.12215365108256, - ]); - }); + provider?.geocode( + "1600 Pennsylvania Ave, Washington, DC", + (results: Geocoded[]) => { + const geocoded = results[0]; + + expect(geocoded).toBeDefined(); + expect(geocoded.getCoordinates()).toEqual([38.897668, -77.036556]); + expect(geocoded.getBounds()).toEqual([ + 38.89380528242933, + -77.04317326462667, + 38.90153071757068, + -77.02993873537334, + ]); + expect(geocoded.getFormattedAddress()).toEqual( + "1600 Pennsylvania Ave NW, Washington, DC 20006" + ); + expect(geocoded.getStreetNumber()).toEqual(undefined); + expect(geocoded.getStreetName()).toEqual("1600 Pennsylvania Ave NW"); + expect(geocoded.getSubLocality()).toEqual(undefined); + expect(geocoded.getLocality()).toEqual("Washington"); + expect(geocoded.getPostalCode()).toEqual("20006"); + expect(geocoded.getRegion()).toEqual("DC"); + expect(geocoded.getAdminLevels()).toEqual([]); + expect(geocoded.getCountry()).toEqual("United States"); + expect(geocoded.getCountryCode()).toEqual(undefined); - it("maps formatted address correctly", () => { - expect(geocoded.getFormattedAddress()).toEqual( - "1 Microsoft Way, Redmond, WA 98052" + done(); + } ); }); - it("maps street name correctly", () => { - expect(geocoded.getStreetName()).toEqual("1 Microsoft Way"); - }); + it("receives correct geodecoding results", (done) => { + const provider = UniversalGeocoder.createGeocoder({ + provider: "bing", + useSsl: true, + apiKey: "api_key", + }); - it("maps locality correctly", () => { - expect(geocoded.getLocality()).toEqual("Redmond"); - }); + provider?.geodecode(48.8631507, 2.388911, (results: Geocoded[]) => { + const geocoded = results[0]; - it("maps postal code correctly", () => { - expect(geocoded.getPostalCode()).toEqual("98052"); - }); + expect(geocoded).toBeDefined(); + expect(geocoded.getCoordinates()).toEqual([48.8631093, 2.3887809]); + expect(geocoded.getBounds()).toEqual([ + 48.85924658242932, + 2.380952653445271, + 48.866972017570674, + 2.396609146554729, + ]); + expect(geocoded.getFormattedAddress()).toEqual( + "8 Avenue Gambetta, 75020 Paris" + ); + expect(geocoded.getStreetNumber()).toEqual(undefined); + expect(geocoded.getStreetName()).toEqual("8 Avenue Gambetta"); + expect(geocoded.getSubLocality()).toEqual(undefined); + expect(geocoded.getLocality()).toEqual("Paris"); + expect(geocoded.getPostalCode()).toEqual("75020"); + expect(geocoded.getRegion()).toEqual("Île-de-France"); + expect(geocoded.getAdminLevels()).toEqual([]); + expect(geocoded.getCountry()).toEqual("France"); + expect(geocoded.getCountryCode()).toEqual(undefined); - it("maps region correctly", () => { - expect(geocoded.getRegion()).toEqual("WA"); + done(); + }); }); - it("maps country correctly", () => { - expect(geocoded.getCountry()).toEqual("United States"); + it("receives error when the API key is bad", (done) => { + const provider = UniversalGeocoder.createGeocoder({ + provider: "bing", + useSsl: true, + apiKey: "api_key", + }); + + provider?.geocode( + "1600 Pennsylvania Ave, Washington, DC", + () => { + done(); + }, + (error) => { + expect(error.message).toEqual( + "Received HTTP status code 401 when attempting geocoding request." + ); + done(); + } + ); }); }); diff --git a/spec/provider/ChainProvider.spec.ts b/spec/provider/ChainProvider.spec.ts new file mode 100644 index 0000000..9c89311 --- /dev/null +++ b/spec/provider/ChainProvider.spec.ts @@ -0,0 +1,394 @@ +import UniversalGeocoder from "UniversalGeocoder"; +import Geocoded from "Geocoded"; +import AdminLevel from "AdminLevel"; +import setupPolly, { cleanRecording } from "../setupPolly"; + +const expectGeocodedYandex = (geocoded: Geocoded) => { + expect(geocoded).toBeDefined(); + expect(geocoded.getCoordinates()).toEqual([38.895512, -77.033608]); + expect(geocoded.getBounds()).toEqual([ + 38.890612, + -77.058105, + 38.905248, + -77.012426, + ]); + expect(geocoded.getFormattedAddress()).toEqual(undefined); + expect(geocoded.getStreetNumber()).toEqual(undefined); + expect(geocoded.getStreetName()).toEqual("Pennsylvania Avenue Northwest"); + expect(geocoded.getSubLocality()).toEqual(undefined); + expect(geocoded.getLocality()).toEqual("Washington"); + expect(geocoded.getPostalCode()).toEqual(undefined); + expect(geocoded.getRegion()).toEqual("District of Columbia"); + expect(geocoded.getAdminLevels()).toEqual([]); + expect(geocoded.getCountry()).toEqual("United States of America"); + expect(geocoded.getCountryCode()).toEqual("US"); +}; + +const expectGeodecodedYandex = (geocoded: Geocoded) => { + expect(geocoded).toBeDefined(); + expect(geocoded.getCoordinates()).toEqual([48.8631, 2.388899]); + expect(geocoded.getBounds()).toEqual([ + 48.860391, + 2.384794, + 48.865808, + 2.393004, + ]); + expect(geocoded.getFormattedAddress()).toEqual(undefined); + expect(geocoded.getStreetNumber()).toEqual("10"); + expect(geocoded.getStreetName()).toEqual("Avenue Gambetta"); + expect(geocoded.getSubLocality()).toEqual("20e Arrondissement"); + expect(geocoded.getLocality()).toEqual("Paris"); + expect(geocoded.getPostalCode()).toEqual(undefined); + expect(geocoded.getRegion()).toEqual("Île-de-France"); + expect(geocoded.getAdminLevels()).toEqual([]); + expect(geocoded.getCountry()).toEqual("France"); + expect(geocoded.getCountryCode()).toEqual("FR"); +}; + +const expectGeocodedOpenStreetMap = (geocoded: Geocoded) => { + expect(geocoded).toBeDefined(); + expect(geocoded.getCoordinates()).toEqual([38.8636383, -76.9463651]); + expect(geocoded.getBounds()).toEqual([ + 38.8633822, + -76.9467576, + 38.8637409, + -76.945632, + ]); + expect(geocoded.getFormattedAddress()).toEqual(undefined); + expect(geocoded.getStreetNumber()).toEqual(undefined); + expect(geocoded.getStreetName()).toEqual("Pennsylvania Avenue"); + expect(geocoded.getSubLocality()).toEqual(undefined); + expect(geocoded.getLocality()).toEqual("Dillon Park"); + expect(geocoded.getPostalCode()).toEqual("20746-8001"); + expect(geocoded.getRegion()).toEqual("Washington, D.C."); + expect(geocoded.getAdminLevels()).toEqual([ + AdminLevel.create({ level: 1, name: "Washington, D.C." }), + AdminLevel.create({ level: 2, name: "Prince George's County" }), + ]); + expect(geocoded.getCountry()).toEqual("United States of America"); + expect(geocoded.getCountryCode()).toEqual("us"); +}; + +const expectGeodecodedOpenStreetMap = (geocoded: Geocoded) => { + expect(geocoded.getCoordinates()).toEqual([ + 48.863744499999996, + 2.3911562136123106, + ]); + expect(geocoded.getBounds()).toEqual([ + 48.8625929, + 2.3877078, + 48.8648832, + 2.3956964, + ]); + expect(geocoded.getFormattedAddress()).toEqual(undefined); + expect(geocoded.getStreetNumber()).toEqual(undefined); + expect(geocoded.getStreetName()).toEqual(undefined); + expect(geocoded.getSubLocality()).toEqual("Quartier du Père-Lachaise"); + expect(geocoded.getLocality()).toEqual("Paris"); + expect(geocoded.getPostalCode()).toEqual("75020"); + expect(geocoded.getRegion()).toEqual("Ile-de-France"); + expect(geocoded.getAdminLevels()).toEqual([ + AdminLevel.create({ level: 1, name: "Ile-de-France" }), + AdminLevel.create({ level: 2, name: "Paris" }), + ]); + expect(geocoded.getCountry()).toEqual("France"); + expect(geocoded.getCountryCode()).toEqual("fr"); +}; + +describe("Chain Geocoder Provider", () => { + const pollyContext = setupPolly(); + + beforeEach(() => { + cleanRecording(pollyContext); + }); + + afterEach(async () => { + await pollyContext.polly.flush(); + }); + + it("receives correct geocoding results (first provider OK)", (done) => { + const yandexGeocoder = UniversalGeocoder.createGeocoder({ + provider: "yandex", + useSsl: true, + apiKey: "api_key", + }); + const openStreetMapGeocoder = UniversalGeocoder.createGeocoder({ + provider: "openstreetmap", + useSsl: true, + userAgent: "Universal Geocoder Example", + }); + const provider = UniversalGeocoder.createGeocoder({ + provider: "chain", + providers: [yandexGeocoder, openStreetMapGeocoder], + }); + + provider?.geocode( + { text: "1600 Pennsylvania Ave, Washington, DC", locale: "en_US" }, + (results: Geocoded[]) => { + const geocoded = results[0]; + + expectGeocodedYandex(geocoded); + + done(); + } + ); + }); + + it("receives correct geocoding results (first provider KO)", (done) => { + const yandexGeocoder = UniversalGeocoder.createGeocoder({ + provider: "yandex", + useSsl: true, + apiKey: "api_key", + }); + const openStreetMapGeocoder = UniversalGeocoder.createGeocoder({ + provider: "openstreetmap", + useSsl: true, + userAgent: "Universal Geocoder Example", + }); + const provider = UniversalGeocoder.createGeocoder({ + provider: "chain", + providers: [yandexGeocoder, openStreetMapGeocoder], + }); + + provider?.geocode( + { text: "1600 Pennsylvania Ave, Washington, DC", locale: "en_US" }, + (results: Geocoded[]) => { + const geocoded = results[0]; + + expectGeocodedOpenStreetMap(geocoded); + + done(); + } + ); + }); + + it("receives correct geocoding results (parallelize - first provider OK)", (done) => { + const yandexGeocoder = UniversalGeocoder.createGeocoder({ + provider: "yandex", + useSsl: true, + apiKey: "api_key", + }); + const openStreetMapGeocoder = UniversalGeocoder.createGeocoder({ + provider: "openstreetmap", + useSsl: true, + userAgent: "Universal Geocoder Example", + }); + const provider = UniversalGeocoder.createGeocoder({ + provider: "chain", + providers: [yandexGeocoder, openStreetMapGeocoder], + parallelize: true, + }); + + provider?.geocode( + { text: "1600 Pennsylvania Ave, Washington, DC", locale: "en_US" }, + (results: Geocoded[]) => { + const geocoded = results[0]; + + expectGeocodedYandex(geocoded); + + done(); + } + ); + }); + + it("receives correct geocoding results (parallelize - first provider KO)", (done) => { + const yandexGeocoder = UniversalGeocoder.createGeocoder({ + provider: "yandex", + useSsl: true, + apiKey: "api_key", + }); + const openStreetMapGeocoder = UniversalGeocoder.createGeocoder({ + provider: "openstreetmap", + useSsl: true, + userAgent: "Universal Geocoder Example", + }); + const provider = UniversalGeocoder.createGeocoder({ + provider: "chain", + providers: [yandexGeocoder, openStreetMapGeocoder], + parallelize: true, + }); + + provider?.geocode( + { text: "1600 Pennsylvania Ave, Washington, DC", locale: "en_US" }, + (results: Geocoded[]) => { + const geocoded = results[0]; + + expectGeocodedOpenStreetMap(geocoded); + + done(); + } + ); + }); + + it("receives correct geocoding results (first - first provider OK)", (done) => { + const yandexGeocoder = UniversalGeocoder.createGeocoder({ + provider: "yandex", + useSsl: true, + apiKey: "api_key", + }); + const openStreetMapGeocoder = UniversalGeocoder.createGeocoder({ + provider: "openstreetmap", + useSsl: true, + userAgent: "Universal Geocoder Example", + }); + const provider = UniversalGeocoder.createGeocoder({ + provider: "chain", + providers: [yandexGeocoder, openStreetMapGeocoder], + first: true, + }); + + provider?.geocode( + { text: "1600 Pennsylvania Ave, Washington, DC", locale: "en_US" }, + (results: Geocoded[]) => { + const geocoded = results[0]; + + expectGeocodedOpenStreetMap(geocoded); + + done(); + } + ); + }); + + it("receives correct geodecoding results (first provider OK)", (done) => { + const yandexGeocoder = UniversalGeocoder.createGeocoder({ + provider: "yandex", + useSsl: true, + apiKey: "api_key", + }); + const openStreetMapGeocoder = UniversalGeocoder.createGeocoder({ + provider: "openstreetmap", + useSsl: true, + userAgent: "Universal Geocoder Example", + }); + const provider = UniversalGeocoder.createGeocoder({ + provider: "chain", + providers: [yandexGeocoder, openStreetMapGeocoder], + }); + + provider?.geodecode( + { latitude: 48.8631507, longitude: 2.388911, locale: "en_US" }, + (results: Geocoded[]) => { + const geocoded = results[0]; + + expectGeodecodedYandex(geocoded); + + done(); + } + ); + }); + + it("receives correct geodecoding results (first provider KO)", (done) => { + const yandexGeocoder = UniversalGeocoder.createGeocoder({ + provider: "yandex", + useSsl: true, + apiKey: "api_key", + }); + const openStreetMapGeocoder = UniversalGeocoder.createGeocoder({ + provider: "openstreetmap", + useSsl: true, + userAgent: "Universal Geocoder Example", + }); + const provider = UniversalGeocoder.createGeocoder({ + provider: "chain", + providers: [yandexGeocoder, openStreetMapGeocoder], + }); + + provider?.geodecode( + { latitude: 48.8631507, longitude: 2.388911, locale: "en_US" }, + (results: Geocoded[]) => { + const geocoded = results[0]; + + expectGeodecodedOpenStreetMap(geocoded); + + done(); + } + ); + }); + + it("receives correct geodecoding results (parallelize - first provider OK)", (done) => { + const yandexGeocoder = UniversalGeocoder.createGeocoder({ + provider: "yandex", + useSsl: true, + apiKey: "api_key", + }); + const openStreetMapGeocoder = UniversalGeocoder.createGeocoder({ + provider: "openstreetmap", + useSsl: true, + userAgent: "Universal Geocoder Example", + }); + const provider = UniversalGeocoder.createGeocoder({ + provider: "chain", + providers: [yandexGeocoder, openStreetMapGeocoder], + parallelize: true, + }); + + provider?.geodecode( + { latitude: 48.8631507, longitude: 2.388911, locale: "en_US" }, + (results: Geocoded[]) => { + const geocoded = results[0]; + + expectGeodecodedYandex(geocoded); + + done(); + } + ); + }); + + it("receives correct geodecoding results (parallelize - first provider KO)", (done) => { + const yandexGeocoder = UniversalGeocoder.createGeocoder({ + provider: "yandex", + useSsl: true, + apiKey: "api_key", + }); + const openStreetMapGeocoder = UniversalGeocoder.createGeocoder({ + provider: "openstreetmap", + useSsl: true, + userAgent: "Universal Geocoder Example", + }); + const provider = UniversalGeocoder.createGeocoder({ + provider: "chain", + providers: [yandexGeocoder, openStreetMapGeocoder], + parallelize: true, + }); + + provider?.geodecode( + { latitude: 48.8631507, longitude: 2.388911, locale: "en_US" }, + (results: Geocoded[]) => { + const geocoded = results[0]; + + expectGeodecodedOpenStreetMap(geocoded); + + done(); + } + ); + }); + + it("receives correct geodecoding results (first - first provider OK)", (done) => { + const yandexGeocoder = UniversalGeocoder.createGeocoder({ + provider: "yandex", + useSsl: true, + apiKey: "api_key", + }); + const openStreetMapGeocoder = UniversalGeocoder.createGeocoder({ + provider: "openstreetmap", + useSsl: true, + userAgent: "Universal Geocoder Example", + }); + const provider = UniversalGeocoder.createGeocoder({ + provider: "chain", + providers: [yandexGeocoder, openStreetMapGeocoder], + first: true, + }); + + provider?.geodecode( + { latitude: 48.8631507, longitude: 2.388911, locale: "en_US" }, + (results: Geocoded[]) => { + const geocoded = results[0]; + + expectGeodecodedOpenStreetMap(geocoded); + + done(); + } + ); + }); +}); diff --git a/spec/provider/GoogleMapsProvider.spec.ts b/spec/provider/GoogleMapsProvider.spec.ts index ffadbe1..1620543 100644 --- a/spec/provider/GoogleMapsProvider.spec.ts +++ b/spec/provider/GoogleMapsProvider.spec.ts @@ -1,93 +1,18 @@ -import { - GoogleMapsGeocoded, - GoogleMapsProvider, - GoogleMapsResult, -} from "provider"; +import UniversalGeocoder from "UniversalGeocoder"; +import { GoogleMapsGeocoded, GoogleMapsProvider } from "provider"; import ExternalLoader from "ExternalLoader"; import AdminLevel from "AdminLevel"; +import setupPolly, { cleanRecording } from "../setupPolly"; -describe("Google Maps Geocoder Provider raw result to Geocoded mapping", () => { - let geocoded: GoogleMapsGeocoded; - - const stubGoogleMapsResult: GoogleMapsResult[] = [ - { - address_components: [ - { - long_name: "1600", - short_name: "1600", - types: ["street_number"], - }, - { - long_name: "Pennsylvania Avenue Northwest", - short_name: "Pennsylvania Avenue NW", - types: ["route"], - }, - { - long_name: "Northwest Washington", - short_name: "Northwest Washington", - types: ["neighborhood", "political"], - }, - { - long_name: "Washington", - short_name: "Washington", - types: ["locality", "political"], - }, - { - long_name: "District of Columbia", - short_name: "DC", - types: ["administrative_area_level_1", "political"], - }, - { - long_name: "United States", - short_name: "US", - types: ["country", "political"], - }, - { - long_name: "20500", - short_name: "20500", - types: ["postal_code"], - }, - ], - formatted_address: - "1600 Pennsylvania Avenue NW, Washington, DC 20500, USA", - geometry: { - bounds: { - northeast: { - lat: 38.8979044, - lng: -77.0355124, - }, - southwest: { - lat: 38.8973063, - lng: -77.03795749999999, - }, - }, - location: { - lat: 38.8976633, - lng: -77.03657389999999, - }, - location_type: "ROOFTOP", - viewport: { - northeast: { - lat: 38.8989543302915, - lng: -77.03538596970849, - }, - southwest: { - lat: 38.8962563697085, - lng: -77.03808393029151, - }, - }, - }, - place_id: "ChIJGVtI4by3t4kRr51d_Qm_x58", - types: ["establishment", "point_of_interest", "premise"], - }, - ]; +describe("Google Maps Geocoder Provider", () => { + const pollyContext = setupPolly(); beforeEach(() => { - geocoded = GoogleMapsProvider.mapToGeocoded(stubGoogleMapsResult[0]); + cleanRecording(pollyContext); }); - it("receives results from the Google Maps geocoder", () => { - expect(geocoded).toBeDefined(); + afterEach(async () => { + await pollyContext.polly.flush(); }); it("expects API Key or client ID to be required on initiation", () => { @@ -97,6 +22,18 @@ describe("Google Maps Geocoder Provider raw result to Geocoded mapping", () => { ); }); + it("expects secret to be required on initiation when client ID is set", () => { + expect( + () => + new GoogleMapsProvider(new ExternalLoader(), { + clientId: "client_id", + }) + ).toThrowError( + Error, + 'An URL signing secret is required if you use a client ID (Premium only). Please add it in the "secret" option.' + ); + }); + it("expects country codes option to have only one value when set", () => { expect( () => @@ -110,84 +47,128 @@ describe("Google Maps Geocoder Provider raw result to Geocoded mapping", () => { ); }); - it("maps coordinates correctly", () => { - expect(geocoded.getCoordinates()).toEqual([38.8976633, -77.0365739]); - }); - - it("maps bounds correctly", () => { - expect(geocoded.getBounds()).toEqual([ - 38.8973063, - -77.03795749999999, - 38.8979044, - -77.0355124, - ]); - }); - - it("maps formatted address correctly", () => { - expect(geocoded.getFormattedAddress()).toEqual( - "1600 Pennsylvania Avenue NW, Washington, DC 20500, USA" + it("receives correct geocoding results", (done) => { + const provider = UniversalGeocoder.createGeocoder({ + provider: "googlemaps", + useSsl: true, + apiKey: "api_key", + }); + + provider?.geocode("1600 Pennsylvania Ave, Washington, DC", (results) => { + const geocoded = results[0]; + + expect(geocoded).toBeDefined(); + expect(geocoded.getCoordinates()).toEqual([38.8976633, -77.0365739]); + expect(geocoded.getBounds()).toEqual([ + 38.8973063, + -77.03795749999999, + 38.8979044, + -77.0355124, + ]); + expect(geocoded.getFormattedAddress()).toEqual( + "1600 Pennsylvania Avenue NW, Washington, DC 20500, USA" + ); + expect(geocoded.getStreetNumber()).toEqual("1600"); + expect(geocoded.getStreetName()).toEqual("Pennsylvania Avenue Northwest"); + expect(geocoded.getSubLocality()).toEqual(undefined); + expect(geocoded.getLocality()).toEqual("Washington"); + expect(geocoded.getPostalCode()).toEqual("20500"); + expect(geocoded.getRegion()).toEqual("District of Columbia"); + expect(geocoded.getAdminLevels()).toEqual([ + AdminLevel.create({ + level: 1, + name: "District of Columbia", + code: "DC", + }), + ]); + expect(geocoded.getCountry()).toEqual("United States"); + expect(geocoded.getCountryCode()).toEqual("US"); + expect(geocoded.getPlaceId()).toEqual("ChIJGVtI4by3t4kRr51d_Qm_x58"); + expect(geocoded.getResultType()).toEqual([ + "establishment", + "point_of_interest", + "premise", + ]); + expect(geocoded.getLocationType()).toEqual("ROOFTOP"); + expect(geocoded.getPolitical()).toEqual("United States"); + expect(geocoded.getNeighborhood()).toEqual("Northwest Washington"); + + done(); + }); + }); + + it("receives correct geodecoding results", (done) => { + const provider = UniversalGeocoder.createGeocoder({ + provider: "googlemaps", + useSsl: true, + apiKey: "api_key", + }); + + provider?.geodecode( + 48.8631507, + 2.388911, + (results: GoogleMapsGeocoded[]) => { + const geocoded = results[0]; + + expect(geocoded).toBeDefined(); + expect(geocoded.getCoordinates()).toEqual([48.8631361, 2.3889219]); + expect(geocoded.getBounds()).toEqual([ + 48.8617871197085, + 2.387572919708498, + 48.8644850802915, + 2.390270880291502, + ]); + expect(geocoded.getFormattedAddress()).toEqual( + "12 Avenue Gambetta, 75020 Paris, France" + ); + expect(geocoded.getStreetNumber()).toEqual("12"); + expect(geocoded.getStreetName()).toEqual("Avenue Gambetta"); + expect(geocoded.getSubLocality()).toEqual(undefined); + expect(geocoded.getLocality()).toEqual("Paris"); + expect(geocoded.getPostalCode()).toEqual("75020"); + expect(geocoded.getRegion()).toEqual("Île-de-France"); + expect(geocoded.getAdminLevels()).toEqual([ + AdminLevel.create({ + level: 2, + name: "Arrondissement de Paris", + code: "Arrondissement de Paris", + }), + AdminLevel.create({ + level: 1, + name: "Île-de-France", + code: "IDF", + }), + ]); + expect(geocoded.getCountry()).toEqual("France"); + expect(geocoded.getCountryCode()).toEqual("FR"); + expect(geocoded.getPlaceId()).toEqual("ChIJ9aLL3vJt5kcR61GCze3v6fg"); + expect(geocoded.getResultType()).toEqual(["street_address"]); + expect(geocoded.getLocationType()).toEqual("ROOFTOP"); + expect(geocoded.getPolitical()).toEqual("France"); + + done(); + } ); }); - it("maps street number correctly", () => { - expect(geocoded.getStreetNumber()).toEqual("1600"); - }); - - it("maps street name correctly", () => { - expect(geocoded.getStreetName()).toEqual("Pennsylvania Avenue Northwest"); - }); - - it("maps sublocality correctly", () => { - expect(geocoded.getSubLocality()).toEqual(undefined); - }); - - it("maps locality correctly", () => { - expect(geocoded.getLocality()).toEqual("Washington"); - }); + it("receives error when the API key is bad", (done) => { + const provider = UniversalGeocoder.createGeocoder({ + provider: "googlemaps", + useSsl: true, + apiKey: "api_key", + }); - it("maps postal code correctly", () => { - expect(geocoded.getPostalCode()).toEqual("20500"); - }); - - it("maps region correctly", () => { - expect(geocoded.getRegion()).toEqual("District of Columbia"); - }); - - it("maps admin levels correctly", () => { - expect(geocoded.getAdminLevels()).toEqual([ - AdminLevel.create({ level: 1, name: "District of Columbia", code: "DC" }), - ]); - }); - - it("maps country correctly", () => { - expect(geocoded.getCountry()).toEqual("United States"); - }); - - it("maps country code correctly", () => { - expect(geocoded.getCountryCode()).toEqual("US"); - }); - - it("maps place ID correctly", () => { - expect(geocoded.getPlaceId()).toEqual("ChIJGVtI4by3t4kRr51d_Qm_x58"); - }); - - it("maps result type correctly", () => { - expect(geocoded.getResultType()).toEqual([ - "establishment", - "point_of_interest", - "premise", - ]); - }); - - it("maps location type correctly", () => { - expect(geocoded.getLocationType()).toEqual("ROOFTOP"); - }); - - it("maps political correctly", () => { - expect(geocoded.getPolitical()).toEqual("United States"); - }); - - it("maps neighborhood correctly", () => { - expect(geocoded.getNeighborhood()).toEqual("Northwest Washington"); + provider?.geocode( + "1600 Pennsylvania Ave, Washington, DC", + () => { + done(); + }, + (error) => { + expect(error.message).toEqual( + "Request has been denied: The provided API key is invalid." + ); + done(); + } + ); }); }); diff --git a/spec/provider/MapboxProvider.spec.ts b/spec/provider/MapboxProvider.spec.ts index 0171075..421530a 100644 --- a/spec/provider/MapboxProvider.spec.ts +++ b/spec/provider/MapboxProvider.spec.ts @@ -1,51 +1,18 @@ -import { MapboxGeocoded, MapboxProvider, MapboxResult } from "provider"; +import UniversalGeocoder from "UniversalGeocoder"; +import { MapboxGeocoded, MapboxProvider } from "provider"; import ExternalLoader from "ExternalLoader"; import AdminLevel from "AdminLevel"; +import setupPolly, { cleanRecording } from "../setupPolly"; -describe("Mapbox Geocoder Provider raw result to Geocoded mapping", () => { - let geocoded: MapboxGeocoded; - - const stubMapboxResult: MapboxResult[] = [ - { - id: "address.8134540196038770", - type: "Feature", - place_type: ["address"], - relevance: 1, - properties: { accuracy: "rooftop" }, - text: "Pennsylvania Avenue Northwest", - place_name: - "1600 Pennsylvania Avenue Northwest, Washington, District of Columbia 20500, United States", - matching_place_name: - "1600 Pennsylvania Avenue Northwest, Washington, DC 20500, United States", - center: [-77.036547, 38.897675], - geometry: { type: "Point", coordinates: [-77.036547, 38.897675] }, - address: "1600", - context: [ - { id: "neighborhood.291451", text: "Downtown" }, - { id: "postcode.8134540196038770", text: "20500" }, - { id: "place.7673410831246050", wikidata: "Q61", text: "Washington" }, - { - id: "region.14064402149979320", - wikidata: "Q3551781", - short_code: "US-DC", - text: "District of Columbia", - }, - { - id: "country.19678805456372290", - short_code: "us", - wikidata: "Q30", - text: "United States", - }, - ], - }, - ]; +describe("Mapbox Geocoder Provider", () => { + const pollyContext = setupPolly(); beforeEach(() => { - geocoded = MapboxProvider.mapToGeocoded(stubMapboxResult[0]); + cleanRecording(pollyContext); }); - it("receives results from the Mapbox geocoder", () => { - expect(geocoded).toBeDefined(); + afterEach(async () => { + await pollyContext.polly.flush(); }); it("expects API Key to be required on initiation", () => { @@ -55,52 +22,108 @@ describe("Mapbox Geocoder Provider raw result to Geocoded mapping", () => { ); }); - it("maps coordinates correctly", () => { - expect(geocoded.getCoordinates()).toEqual([38.897675, -77.036547]); - }); - - it("maps formatted address correctly", () => { - expect(geocoded.getFormattedAddress()).toEqual( - "1600 Pennsylvania Avenue Northwest, Washington, District of Columbia 20500, United States" - ); - }); - - it("maps street number correctly", () => { - expect(geocoded.getStreetNumber()).toEqual("1600"); - }); - - it("maps street name correctly", () => { - expect(geocoded.getStreetName()).toEqual("Pennsylvania Avenue Northwest"); - }); - - it("maps locality correctly", () => { - expect(geocoded.getLocality()).toEqual("Washington"); + it("receives correct geocoding results", (done) => { + const provider = UniversalGeocoder.createGeocoder({ + provider: "mapbox", + useSsl: true, + apiKey: "api_key", + }); + + provider?.geocode("1600 Pennsylvania Ave, Washington, DC", (results) => { + const geocoded = results[0]; + + expect(geocoded).toBeDefined(); + expect(geocoded.getCoordinates()).toEqual([38.87925, -76.98204]); + expect(geocoded.getBounds()).toEqual([ + undefined, + undefined, + undefined, + undefined, + ]); + expect(geocoded.getFormattedAddress()).toEqual( + "1600 Pennsylvania Ave SE, Washington, District of Columbia 20003, United States" + ); + expect(geocoded.getStreetNumber()).toEqual("1600"); + expect(geocoded.getStreetName()).toEqual("Pennsylvania Ave SE"); + expect(geocoded.getSubLocality()).toEqual(undefined); + expect(geocoded.getLocality()).toEqual("Washington"); + expect(geocoded.getPostalCode()).toEqual("20003"); + expect(geocoded.getRegion()).toEqual("District of Columbia"); + expect(geocoded.getAdminLevels()).toEqual([ + AdminLevel.create({ level: 2, name: "Washington" }), + AdminLevel.create({ + level: 1, + name: "District of Columbia", + code: "DC", + }), + ]); + expect(geocoded.getCountry()).toEqual("United States"); + expect(geocoded.getCountryCode()).toEqual("us"); + expect(geocoded.getResultType()).toEqual(["address"]); + + done(); + }); }); - it("maps postal code correctly", () => { - expect(geocoded.getPostalCode()).toEqual("20500"); + it("receives correct geodecoding results", (done) => { + const provider = UniversalGeocoder.createGeocoder({ + provider: "mapbox", + useSsl: true, + apiKey: "api_key", + }); + + provider?.geodecode(48.8631507, 2.388911, (results: MapboxGeocoded[]) => { + const geocoded = results[0]; + + expect(geocoded).toBeDefined(); + expect(geocoded.getCoordinates()).toEqual([48.863134, 2.388886]); + expect(geocoded.getBounds()).toEqual([ + undefined, + undefined, + undefined, + undefined, + ]); + expect(geocoded.getFormattedAddress()).toEqual( + "12 Avenue Gambetta, 75020 Paris, France" + ); + expect(geocoded.getStreetNumber()).toEqual("12"); + expect(geocoded.getStreetName()).toEqual("Avenue Gambetta"); + expect(geocoded.getSubLocality()).toEqual(undefined); + expect(geocoded.getLocality()).toEqual("Paris"); + expect(geocoded.getPostalCode()).toEqual("75020"); + expect(geocoded.getRegion()).toEqual(undefined); + expect(geocoded.getAdminLevels()).toEqual([ + AdminLevel.create({ + level: 2, + name: "Paris", + }), + ]); + expect(geocoded.getCountry()).toEqual("France"); + expect(geocoded.getCountryCode()).toEqual("fr"); + expect(geocoded.getResultType()).toEqual(["address"]); + + done(); + }); }); - it("maps region correctly", () => { - expect(geocoded.getRegion()).toEqual("District of Columbia"); - }); - - it("maps admin levels correctly", () => { - expect(geocoded.getAdminLevels()).toEqual([ - AdminLevel.create({ level: 2, name: "Washington" }), - AdminLevel.create({ level: 1, name: "District of Columbia", code: "DC" }), - ]); - }); - - it("maps country correctly", () => { - expect(geocoded.getCountry()).toEqual("United States"); - }); - - it("maps country code correctly", () => { - expect(geocoded.getCountryCode()).toEqual("us"); - }); - - it("maps result type correctly", () => { - expect(geocoded.getResultType()).toEqual(["address"]); + it("receives error when the API key is bad", (done) => { + const provider = UniversalGeocoder.createGeocoder({ + provider: "mapbox", + useSsl: true, + apiKey: "api_key", + }); + + provider?.geocode( + "1600 Pennsylvania Ave, Washington, DC", + () => { + done(); + }, + (error) => { + expect(error.message).toEqual( + "Received HTTP status code 401 when attempting geocoding request." + ); + done(); + } + ); }); }); diff --git a/spec/provider/MapquestProvider.spec.ts b/spec/provider/MapquestProvider.spec.ts index 0b3a566..4713f95 100644 --- a/spec/provider/MapquestProvider.spec.ts +++ b/spec/provider/MapquestProvider.spec.ts @@ -1,43 +1,18 @@ -import { MapquestProvider, MapQuestResult } from "provider"; +import UniversalGeocoder from "UniversalGeocoder"; +import { MapquestProvider } from "provider"; import ExternalLoader from "ExternalLoader"; import Geocoded from "Geocoded"; +import setupPolly, { cleanRecording } from "../setupPolly"; -describe("Mapquest Geocoder Provider raw result to Geocoded mapping", () => { - let geocoded: Geocoded; - - const stubMapQuestResult: MapQuestResult = { - adminArea1: "US", - adminArea1Type: "Country", - adminArea3: "", - adminArea3Type: "State", - latLng: { - lng: -77.036372, - lat: 38.895115, - }, - adminArea4: "District of Columbia", - adminArea5Type: "City", - adminArea4Type: "County", - adminArea5: "Washington", - street: "1600 Pennsylvania Ave", - type: "s", - displayLatLng: { - lng: -77.036372, - lat: 38.895115, - }, - linkId: "0", - postalCode: "20050", - sideOfStreet: "N", - dragPoint: false, - geocodeQuality: "CITY", - geocodeQualityCode: "A5XCX", - }; +describe("MapQuest Geocoder Provider", () => { + const pollyContext = setupPolly(); beforeEach(() => { - geocoded = MapquestProvider.mapToGeocoded(stubMapQuestResult); + cleanRecording(pollyContext); }); - it("receives results from the MapQuest geocoder", () => { - expect(geocoded).toBeDefined(); + afterEach(async () => { + await pollyContext.polly.flush(); }); it("expects API Key to be required on initiation", () => { @@ -47,35 +22,93 @@ describe("Mapquest Geocoder Provider raw result to Geocoded mapping", () => { ); }); - it("maps coordinates correctly", () => { - expect(geocoded.getCoordinates()).toEqual([38.895115, -77.036372]); - }); + it("receives correct geocoding results", (done) => { + const provider = UniversalGeocoder.createGeocoder({ + provider: "mapquest", + useSsl: true, + apiKey: "api_key", + }); - it("maps street name correctly", () => { - expect(geocoded.getStreetName()).toEqual("1600 Pennsylvania Ave"); - }); + provider?.geocode( + "1600 Pennsylvania Ave, Washington, DC", + (results: Geocoded[]) => { + const geocoded = results[0]; - it("maps sublocality correctly", () => { - expect(geocoded.getSubLocality()).toEqual(undefined); - }); + expect(geocoded).toBeDefined(); + expect(geocoded.getCoordinates()).toEqual([38.895206, -77.036515]); + expect(geocoded.getBounds()).toEqual([ + undefined, + undefined, + undefined, + undefined, + ]); + expect(geocoded.getFormattedAddress()).toEqual(undefined); + expect(geocoded.getStreetNumber()).toEqual(undefined); + expect(geocoded.getStreetName()).toEqual("1600 Pennsylvania Ave"); + expect(geocoded.getSubLocality()).toEqual(""); + expect(geocoded.getLocality()).toEqual("Washington"); + expect(geocoded.getPostalCode()).toEqual(""); + expect(geocoded.getRegion()).toEqual("District Of Columbia"); + expect(geocoded.getAdminLevels()).toEqual([]); + expect(geocoded.getCountry()).toEqual("US"); + expect(geocoded.getCountryCode()).toEqual("US"); - it("maps locality correctly", () => { - expect(geocoded.getLocality()).toEqual("Washington"); + done(); + } + ); }); - it("maps postal code correctly", () => { - expect(geocoded.getPostalCode()).toEqual("20050"); - }); + it("receives correct geodecoding results", (done) => { + const provider = UniversalGeocoder.createGeocoder({ + provider: "mapquest", + useSsl: true, + apiKey: "api_key", + }); - it("maps region correctly", () => { - expect(geocoded.getRegion()).toEqual("District of Columbia"); - }); + provider?.geodecode(48.8631507, 2.388911, (results: Geocoded[]) => { + const geocoded = results[0]; + + expect(geocoded).toBeDefined(); + expect(geocoded.getCoordinates()).toEqual([48.863116, 2.38878]); + expect(geocoded.getBounds()).toEqual([ + undefined, + undefined, + undefined, + undefined, + ]); + expect(geocoded.getFormattedAddress()).toEqual(undefined); + expect(geocoded.getStreetNumber()).toEqual(undefined); + expect(geocoded.getStreetName()).toEqual("8 Avenue Gambetta"); + expect(geocoded.getSubLocality()).toEqual(""); + expect(geocoded.getLocality()).toEqual("Paris"); + expect(geocoded.getPostalCode()).toEqual("75020"); + expect(geocoded.getRegion()).toEqual(""); + expect(geocoded.getAdminLevels()).toEqual([]); + expect(geocoded.getCountry()).toEqual("FR"); + expect(geocoded.getCountryCode()).toEqual("FR"); - it("maps country correctly", () => { - expect(geocoded.getCountry()).toEqual("US"); + done(); + }); }); - it("maps country code correctly", () => { - expect(geocoded.getCountryCode()).toEqual("US"); + it("receives error when the API key is bad", (done) => { + const provider = UniversalGeocoder.createGeocoder({ + provider: "mapquest", + useSsl: true, + apiKey: "api_key", + }); + + provider?.geocode( + "1600 Pennsylvania Ave, Washington, DC", + () => { + done(); + }, + (error) => { + expect(error.message).toEqual( + "Received HTTP status code 403 when attempting geocoding request." + ); + done(); + } + ); }); }); diff --git a/spec/provider/NominatimProvider.spec.ts b/spec/provider/NominatimProvider.spec.ts index 877300f..2797b7b 100644 --- a/spec/provider/NominatimProvider.spec.ts +++ b/spec/provider/NominatimProvider.spec.ts @@ -1,57 +1,18 @@ -import { - NominatimGeocoded, - OpenStreetMapProvider, - OpenStreetMapResult, -} from "provider"; +import UniversalGeocoder from "UniversalGeocoder"; +import { NominatimGeocoded, OpenStreetMapProvider } from "provider"; import ExternalLoader from "ExternalLoader"; import AdminLevel from "AdminLevel"; +import setupPolly, { cleanRecording } from "../setupPolly"; -describe("OpenStreetMap / Nominatim Geocoder Provider raw result to Geocoded mapping", () => { - let geocoded: NominatimGeocoded; - - const stubOpenStreetMapResult: OpenStreetMapResult[] = [ - { - place_id: 9141060761, - licence: - "Data © OpenStreetMap contributors, ODbL 1.0. http://www.openstreetmap.org/copyright", - osm_type: "way", - osm_id: 238241022, - boundingbox: [ - "38.8974876403809", - "38.8979148864746", - "-77.0368804931641", - "-77.036247253418", - ], - lat: "38.89770045", - lon: "-77.0365643605898", - display_name: - "The White House, 1600, Pennsylvania Avenue Northwest, Foggy Bottom, Farragut Square, Washington, District of Columbia, 20500, United States of America", - category: "tourism", - type: "attraction", - importance: 1.5076757387296, - icon: - "http://nominatim.openstreetmap.org/images/mapicons/poi_point_of_interest.p.20.png", - address: { - attraction: "The White House", - house_number: "1600", - road: "Pennsylvania Avenue Northwest", - neighbourhood: "Foggy Bottom", - suburb: "Farragut Square", - city: "Washington", - state: "District of Columbia", - postcode: "20500", - country: "United States of America", - country_code: "us", - }, - }, - ]; +describe("OpenStreetMap / Nominatim Geocoder Provider", () => { + const pollyContext = setupPolly(); beforeEach(() => { - geocoded = OpenStreetMapProvider.mapToGeocoded(stubOpenStreetMapResult[0]); + cleanRecording(pollyContext); }); - it("receives results from the OpenStreetMap / Nominatim geocoder", () => { - expect(geocoded).toBeDefined(); + afterEach(async () => { + await pollyContext.polly.flush(); }); it("expects User-Agent to be required on initiation", () => { @@ -61,82 +22,105 @@ describe("OpenStreetMap / Nominatim Geocoder Provider raw result to Geocoded map ); }); - it("maps coordinates correctly", () => { - expect(geocoded.getCoordinates()).toEqual([38.89770045, -77.0365643605898]); - }); - - it("maps bounds correctly", () => { - expect(geocoded.getBounds()).toEqual([ - 38.8974876403809, - -77.0368804931641, - 38.8979148864746, - -77.036247253418, - ]); - }); - - it("maps display name correctly", () => { - expect(geocoded.getDisplayName()).toEqual( - "The White House, 1600, Pennsylvania Avenue Northwest, Foggy Bottom, Farragut Square, Washington, District of Columbia, 20500, United States of America" + it("receives correct geocoding results", (done) => { + const provider = UniversalGeocoder.createGeocoder({ + provider: "nominatim", + useSsl: true, + userAgent: "Universal Geocoder Example", + }); + + provider?.geocode( + "1600 Pennsylvania Ave, Washington, DC", + (results: NominatimGeocoded[]) => { + const geocoded = results[0]; + + expect(geocoded).toBeDefined(); + expect(geocoded.getCoordinates()).toEqual([38.8958536, -77.0307129]); + expect(geocoded.getBounds()).toEqual([ + 38.8957842, + -77.0309688, + 38.895924, + -77.0304609, + ]); + expect(geocoded.getFormattedAddress()).toEqual(undefined); + expect(geocoded.getDisplayName()).toEqual( + "Pennsylvania Avenue, Penn Quarter, Washington, District of Columbia, 20045, United States of America" + ); + expect(geocoded.getStreetNumber()).toEqual(undefined); + expect(geocoded.getStreetName()).toEqual("Pennsylvania Avenue"); + expect(geocoded.getSubLocality()).toEqual(undefined); + expect(geocoded.getLocality()).toEqual("Washington"); + expect(geocoded.getPostalCode()).toEqual("20045"); + expect(geocoded.getRegion()).toEqual("District of Columbia"); + expect(geocoded.getAdminLevels()).toEqual([ + AdminLevel.create({ level: 1, name: "District of Columbia" }), + AdminLevel.create({ level: 2, name: "Washington" }), + ]); + expect(geocoded.getCountry()).toEqual("United States of America"); + expect(geocoded.getCountryCode()).toEqual("us"); + expect(geocoded.getOsmId()).toEqual(564931814); + expect(geocoded.getOsmType()).toEqual("way"); + expect(geocoded.getCategory()).toEqual("highway"); + expect(geocoded.getType()).toEqual("path"); + expect(geocoded.getAttribution()).toEqual( + "Data © OpenStreetMap contributors, ODbL 1.0. https://osm.org/copyright" + ); + + done(); + } ); }); - it("maps street number correctly", () => { - expect(geocoded.getStreetNumber()).toEqual("1600"); - }); - - it("maps street name correctly", () => { - expect(geocoded.getStreetName()).toEqual("Pennsylvania Avenue Northwest"); - }); - - it("maps sublocality correctly", () => { - expect(geocoded.getSubLocality()).toEqual("Farragut Square"); - }); - - it("maps locality correctly", () => { - expect(geocoded.getLocality()).toEqual("Washington"); - }); - - it("maps postal code correctly", () => { - expect(geocoded.getPostalCode()).toEqual("20500"); - }); - - it("maps region correctly", () => { - expect(geocoded.getRegion()).toEqual("District of Columbia"); - }); - - it("maps admin levels correctly", () => { - expect(geocoded.getAdminLevels()).toEqual([ - AdminLevel.create({ level: 1, name: "District of Columbia" }), - ]); - }); - - it("maps country correctly", () => { - expect(geocoded.getCountry()).toEqual("United States of America"); - }); - - it("maps country code correctly", () => { - expect(geocoded.getCountryCode()).toEqual("us"); - }); - - it("maps OSM id correctly", () => { - expect(geocoded.getOsmId()).toEqual(238241022); - }); - - it("maps OSM type correctly", () => { - expect(geocoded.getOsmType()).toEqual("way"); - }); - - it("maps category correctly", () => { - expect(geocoded.getCategory()).toEqual("tourism"); - }); - - it("maps type correctly", () => { - expect(geocoded.getType()).toEqual("attraction"); - }); - - it("maps attribution correctly", () => { - expect(geocoded.getAttribution()).toEqual( - "Data © OpenStreetMap contributors, ODbL 1.0. http://www.openstreetmap.org/copyright" + it("receives correct geodecoding results", (done) => { + const provider = UniversalGeocoder.createGeocoder({ + provider: "nominatim", + useSsl: true, + userAgent: "Universal Geocoder Example", + }); + + provider?.geodecode( + 48.8631507, + 2.388911, + (results: NominatimGeocoded[]) => { + const geocoded = results[0]; + + expect(geocoded).toBeDefined(); + expect(geocoded.getCoordinates()).toEqual([ + 48.863744499999996, + 2.3911562136123106, + ]); + expect(geocoded.getBounds()).toEqual([ + 48.8625929, + 2.3877078, + 48.8648832, + 2.3956964, + ]); + expect(geocoded.getFormattedAddress()).toEqual(undefined); + expect(geocoded.getDisplayName()).toEqual( + "Quartier du Père-Lachaise, Paris, Île-de-France, France métropolitaine, 75020, France" + ); + expect(geocoded.getStreetNumber()).toEqual(undefined); + expect(geocoded.getStreetName()).toEqual(undefined); + expect(geocoded.getSubLocality()).toEqual("Quartier du Père-Lachaise"); + expect(geocoded.getLocality()).toEqual("Paris"); + expect(geocoded.getPostalCode()).toEqual("75020"); + expect(geocoded.getRegion()).toEqual("Île-de-France"); + expect(geocoded.getAdminLevels()).toEqual([ + AdminLevel.create({ level: 1, name: "Île-de-France" }), + AdminLevel.create({ level: 2, name: "Paris" }), + ]); + expect(geocoded.getCountry()).toEqual("France"); + expect(geocoded.getCountryCode()).toEqual("fr"); + expect(geocoded.getOsmId()).toEqual(322777831); + expect(geocoded.getOsmType()).toEqual("way"); + expect(geocoded.getCategory()).toEqual("highway"); + expect(geocoded.getType()).toEqual("pedestrian"); + expect(geocoded.getAttribution()).toEqual( + "Data © OpenStreetMap contributors, ODbL 1.0. https://osm.org/copyright" + ); + + done(); + } ); }); }); diff --git a/spec/provider/OpenCageProvider.spec.ts b/spec/provider/OpenCageProvider.spec.ts index a3ed425..fbc7836 100644 --- a/spec/provider/OpenCageProvider.spec.ts +++ b/spec/provider/OpenCageProvider.spec.ts @@ -1,137 +1,18 @@ -import { OpenCageGeocoded, OpenCageProvider, OpenCageResult } from "provider"; +import UniversalGeocoder from "UniversalGeocoder"; +import { OpenCageGeocoded, OpenCageProvider } from "provider"; import ExternalLoader from "ExternalLoader"; import AdminLevel from "AdminLevel"; +import setupPolly, { cleanRecording } from "../setupPolly"; -describe("OpenCage Geocoder Provider raw result to Geocoded mapping", () => { - let geocoded: OpenCageGeocoded; - - const stubOpenCageResult: OpenCageResult[] = [ - { - annotations: { - DMS: { - lat: "38° 53' 51.71928'' N", - lng: "77° 2' 11.59260'' W", - }, - FIPS: { - county: "11001", - state: "11", - }, - MGRS: "18SUJ2338907395", - Maidenhead: "FM18lv55ok", - Mercator: { - x: -8575669.907, - y: 4680193.667, - }, - OSM: { - edit_url: - "https://www.openstreetmap.org/edit?way=238241022#map=16/38.89770/-77.03655", - note_url: - "https://www.openstreetmap.org/note/new#map=16/38.89770/-77.03655&layers=N", - url: - "https://www.openstreetmap.org/?mlat=38.89770&mlon=-77.03655#map=16/38.89770/-77.03655", - }, - UN_M49: { - regions: { - AMERICAS: "019", - NORTHERN_AMERICA: "021", - US: "840", - WORLD: "001", - }, - statistical_groupings: ["MEDC"], - }, - callingcode: 1, - currency: { - alternate_symbols: ["US$"], - decimal_mark: ".", - disambiguate_symbol: "US$", - html_entity: "$", - iso_code: "USD", - iso_numeric: "840", - name: "United States Dollar", - smallest_denomination: 1, - subunit: "Cent", - subunit_to_unit: 100, - symbol: "$", - symbol_first: 1, - thousands_separator: ",", - }, - flag: "🇺🇸", - geohash: "dqcjqcpew0y36kbv76ew", - qibla: 56.56, - roadinfo: { - drive_on: "right", - speed_in: "mph", - }, - sun: { - rise: { - apparent: 1595844420, - astronomical: 1595837940, - civil: 1595842620, - nautical: 1595840400, - }, - set: { - apparent: 1595809320, - astronomical: 1595815740, - civil: 1595811120, - nautical: 1595813340, - }, - }, - timezone: { - name: "America/New_York", - now_in_dst: 1, - offset_sec: -14400, - offset_string: "-0400", - short_name: "EDT", - }, - what3words: { - words: "deeply.bunk.farmer", - }, - wikidata: "Q35525", - }, - bounds: { - northeast: { - lat: 38.897911, - lng: -77.0362526, - }, - southwest: { - lat: 38.8974898, - lng: -77.0368542, - }, - }, - components: { - "ISO_3166-1_alpha-2": "US", - "ISO_3166-1_alpha-3": "USA", - _category: "travel/tourism", - _type: "castle", - castle: "White House", - city: "Washington D.C.", - continent: "North America", - country: "United States of America", - country_code: "us", - county: "Washington", - house_number: "1600", - neighbourhood: "Golden Triangle", - pedestrian: "Pennsylvania Avenue Northwest", - postcode: "20500", - state: "District of Columbia", - state_code: "DC", - }, - confidence: 9, - formatted: - "White House, 1600 Pennsylvania Avenue Northwest, Washington, DC 20500, United States of America", - geometry: { - lat: 38.8976998, - lng: -77.0365535, - }, - }, - ]; +describe("OpenCage Geocoder Provider", () => { + const pollyContext = setupPolly(); beforeEach(() => { - geocoded = OpenCageProvider.mapToGeocoded(stubOpenCageResult[0]); + cleanRecording(pollyContext); }); - it("receives results from the OpenCage geocoder", () => { - expect(geocoded).toBeDefined(); + afterEach(async () => { + await pollyContext.polly.flush(); }); it("expects API Key to be required on initiation", () => { @@ -141,89 +22,182 @@ describe("OpenCage Geocoder Provider raw result to Geocoded mapping", () => { ); }); - it("maps coordinates correctly", () => { - expect(geocoded.getCoordinates()).toEqual([38.8976998, -77.0365535]); - }); - - it("maps bounds correctly", () => { - expect(geocoded.getBounds()).toEqual([ - 38.8974898, - -77.0368542, - 38.897911, - -77.0362526, - ]); - }); - - it("maps formatted address correctly", () => { - expect(geocoded.getFormattedAddress()).toEqual( - "White House, 1600 Pennsylvania Avenue Northwest, Washington, DC 20500, United States of America" + it("receives correct geocoding results", (done) => { + const provider = UniversalGeocoder.createGeocoder({ + provider: "opencage", + useSsl: true, + apiKey: "api_key", + }); + + provider?.geocode("1600 Pennsylvania Ave, Washington, DC", (results) => { + const geocoded = results[0]; + + expect(geocoded).toBeDefined(); + expect(geocoded.getCoordinates()).toEqual([38.8636383, -76.9463651]); + expect(geocoded.getBounds()).toEqual([ + 38.8633822, + -76.9467576, + 38.8637409, + -76.945632, + ]); + expect(geocoded.getFormattedAddress()).toEqual( + "Pennsylvania Avenue, Washington, DC 20746-8001, United States of America" + ); + expect(geocoded.getStreetNumber()).toEqual(undefined); + expect(geocoded.getStreetName()).toEqual("Pennsylvania Avenue"); + expect(geocoded.getSubLocality()).toEqual(undefined); + expect(geocoded.getLocality()).toEqual("Dillon Park"); + expect(geocoded.getPostalCode()).toEqual("20746-8001"); + expect(geocoded.getRegion()).toEqual("District of Columbia"); + expect(geocoded.getAdminLevels()).toEqual([ + AdminLevel.create({ + level: 1, + name: "District of Columbia", + code: "DC", + }), + AdminLevel.create({ level: 2, name: "Prince George's County" }), + ]); + expect(geocoded.getCountry()).toEqual("United States of America"); + expect(geocoded.getCountryCode()).toEqual("us"); + expect(geocoded.getTimezone()).toEqual("America/New_York"); + expect(geocoded.getCallingCode()).toEqual(1); + expect(geocoded.getFlag()).toEqual("🇺🇸"); + expect(geocoded.getMgrs()).toEqual("18SUJ3113003444"); + expect(geocoded.getMaidenhead()).toEqual("FM18mu67kg"); + expect(geocoded.getGeohash()).toEqual("dqcm14cm5er8th99jt7w"); + expect(geocoded.getWhat3words()).toEqual("bottom.grace.mass"); + + done(); + }); + }); + + it("receives correct geodecoding results", (done) => { + const provider = UniversalGeocoder.createGeocoder({ + provider: "opencage", + useSsl: true, + apiKey: "api_key", + }); + + provider?.geodecode(48.8631507, 2.388911, (results: OpenCageGeocoded[]) => { + const geocoded = results[0]; + + expect(geocoded).toBeDefined(); + expect(geocoded.getCoordinates()).toEqual([48.863116, 2.38878]); + expect(geocoded.getBounds()).toEqual([ + undefined, + undefined, + undefined, + undefined, + ]); + expect(geocoded.getFormattedAddress()).toEqual( + "8 Avenue Gambetta, 75020 Paris, France" + ); + expect(geocoded.getStreetNumber()).toEqual("8"); + expect(geocoded.getStreetName()).toEqual("Avenue Gambetta"); + expect(geocoded.getSubLocality()).toEqual(undefined); + expect(geocoded.getLocality()).toEqual("Paris"); + expect(geocoded.getPostalCode()).toEqual("75020"); + expect(geocoded.getRegion()).toEqual("Île-de-France"); + expect(geocoded.getAdminLevels()).toEqual([ + AdminLevel.create({ + level: 1, + name: "Île-de-France", + code: "IDF", + }), + ]); + expect(geocoded.getCountry()).toEqual("France"); + expect(geocoded.getCountryCode()).toEqual("fr"); + expect(geocoded.getTimezone()).toEqual("Europe/Paris"); + expect(geocoded.getCallingCode()).toEqual(33); + expect(geocoded.getFlag()).toEqual("🇫🇷"); + expect(geocoded.getMgrs()).toEqual("31UDQ5517112419"); + expect(geocoded.getMaidenhead()).toEqual("JN18eu67pd"); + expect(geocoded.getGeohash()).toEqual("u09tyr72q952wcz9bf5x"); + expect(geocoded.getWhat3words()).toEqual("snatched.juniors.tedious"); + + done(); + }); + }); + + it("receives error when the quota is exceeded", (done) => { + const provider = UniversalGeocoder.createGeocoder({ + provider: "opencage", + useSsl: true, + // see https://opencagedata.com/api#testingkeys + apiKey: "4372eff77b8343cebfc843eb4da4ddc4", + }); + + provider?.geocode( + "1600 Pennsylvania Ave, Washington, DC", + () => { + done(); + }, + (error) => { + expect(error.message).toEqual("Quota exceeded (402): quota exceeded"); + done(); + } ); }); - it("maps street number correctly", () => { - expect(geocoded.getStreetNumber()).toEqual("1600"); - }); - - it("maps street name correctly", () => { - expect(geocoded.getStreetName()).toEqual("Pennsylvania Avenue Northwest"); - }); - - it("maps sublocality correctly", () => { - expect(geocoded.getSubLocality()).toEqual("Golden Triangle"); - }); - - it("maps locality correctly", () => { - expect(geocoded.getLocality()).toEqual("Washington D.C."); - }); - - it("maps postal code correctly", () => { - expect(geocoded.getPostalCode()).toEqual("20500"); - }); - - it("maps region correctly", () => { - expect(geocoded.getRegion()).toEqual("District of Columbia"); - }); - - it("maps admin levels correctly", () => { - expect(geocoded.getAdminLevels()).toEqual([ - AdminLevel.create({ level: 1, name: "District of Columbia", code: "DC" }), - AdminLevel.create({ level: 2, name: "Washington" }), - ]); - }); - - it("maps country correctly", () => { - expect(geocoded.getCountry()).toEqual("United States of America"); - }); + it("receives error when suspended", (done) => { + const provider = UniversalGeocoder.createGeocoder({ + provider: "opencage", + useSsl: true, + // see https://opencagedata.com/api#testingkeys + apiKey: "2e10e5e828262eb243ec0b54681d699a", + }); - it("maps country code correctly", () => { - expect(geocoded.getCountryCode()).toEqual("us"); - }); - - it("maps timezone correctly", () => { - expect(geocoded.getTimezone()).toEqual("America/New_York"); - }); - - it("maps calling code correctly", () => { - expect(geocoded.getCallingCode()).toEqual(1); - }); - - it("maps flag correctly", () => { - expect(geocoded.getFlag()).toEqual("🇺🇸"); + provider?.geocode( + "1600 Pennsylvania Ave, Washington, DC", + () => { + done(); + }, + (error) => { + expect(error.message).toEqual("Forbidden (403): suspended"); + done(); + } + ); }); - it("maps MGRS correctly", () => { - expect(geocoded.getMgrs()).toEqual("18SUJ2338907395"); - }); + it("receives error when the IP address is rejected", (done) => { + const provider = UniversalGeocoder.createGeocoder({ + provider: "opencage", + useSsl: true, + // see https://opencagedata.com/api#testingkeys + apiKey: "6c79ee8e1ca44ad58ad1fc493ba9542f", + }); - it("maps Maidenhead correctly", () => { - expect(geocoded.getMaidenhead()).toEqual("FM18lv55ok"); + provider?.geocode( + "1600 Pennsylvania Ave, Washington, DC", + () => { + done(); + }, + (error) => { + expect(error.message).toEqual("Forbidden (403): IP address rejected"); + done(); + } + ); }); - it("maps Geohash correctly", () => { - expect(geocoded.getGeohash()).toEqual("dqcjqcpew0y36kbv76ew"); - }); + it("receives error when requesting too quickly", (done) => { + const provider = UniversalGeocoder.createGeocoder({ + provider: "opencage", + useSsl: true, + // see https://opencagedata.com/api#testingkeys + apiKey: "d6d0f0065f4348a4bdfe4587ba02714b", + }); - it("maps What3words correctly", () => { - expect(geocoded.getWhat3words()).toEqual("deeply.bunk.farmer"); + provider?.geocode( + "1600 Pennsylvania Ave, Washington, DC", + () => { + done(); + }, + (error) => { + expect(error.message).toEqual( + "Too many requests (429): requesting too quickly" + ); + done(); + } + ); }); }); diff --git a/spec/provider/YandexProvider.spec.ts b/spec/provider/YandexProvider.spec.ts index 0ec84a2..f4019d7 100644 --- a/spec/provider/YandexProvider.spec.ts +++ b/spec/provider/YandexProvider.spec.ts @@ -1,91 +1,109 @@ -import { YandexProvider, YandexResult } from "provider"; -import Geocoded from "Geocoded"; +import UniversalGeocoder from "UniversalGeocoder"; +import setupPolly, { cleanRecording } from "../setupPolly"; -describe("Yandex Geocoder Provider raw result to Geocoded mapping", () => { - let geocoded: Geocoded; - - const stubYandexResult: YandexResult = { - metaDataProperty: { - GeocoderMetaData: { - kind: "house", - text: - "United States, District of Columbia, Washington, Pennsylvania Ave NW, 1600", - precision: "exact", - AddressDetails: { - Country: { - AddressLine: - "District of Columbia, Washington, Pennsylvania Ave NW, 1600", - CountryNameCode: "US", - CountryName: "United States", - AdministrativeArea: { - AdministrativeAreaName: "District of Columbia", - SubAdministrativeArea: { - SubAdministrativeAreaName: "District of Columbia", - Locality: { - LocalityName: "Washington", - Thoroughfare: { - ThoroughfareName: "Pennsylvania Ave NW", - Premise: { - PremiseNumber: "1600", - }, - }, - }, - }, - }, - }, - }, - }, - }, - description: "Washington, District of Columbia, United States", - name: "Pennsylvania Ave NW, 1600", - boundedBy: { - Envelope: { - lowerCorner: "-77.046921 38.891265", - upperCorner: "-77.030464 38.904125", - }, - }, - Point: { - pos: "-77.038692 38.897695", - }, - }; +describe("Yandex Geocoder Provider", () => { + const pollyContext = setupPolly(); beforeEach(() => { - geocoded = YandexProvider.mapToGeocoded(stubYandexResult); + cleanRecording(pollyContext); }); - it("receives results from the Yandex geocoder", () => { - expect(geocoded).toBeDefined(); + afterEach(async () => { + await pollyContext.polly.flush(); }); - it("maps coordinates correctly", () => { - expect(geocoded.getCoordinates()).toEqual([38.897695, -77.038692]); - }); + it("receives correct geocoding results", (done) => { + const provider = UniversalGeocoder.createGeocoder({ + provider: "yandex", + useSsl: true, + apiKey: "api_key", + }); - it("maps street number correctly", () => { - expect(geocoded.getStreetNumber()).toEqual("1600"); - }); + provider?.geocode( + { text: "1600 Pennsylvania Ave, Washington, DC", locale: "en_US" }, + (results) => { + const geocoded = results[0]; - it("maps street name correctly", () => { - expect(geocoded.getStreetName()).toEqual("Pennsylvania Ave NW"); - }); + expect(geocoded).toBeDefined(); + expect(geocoded.getCoordinates()).toEqual([38.895512, -77.033608]); + expect(geocoded.getBounds()).toEqual([ + 38.890612, + -77.058105, + 38.905248, + -77.012426, + ]); + expect(geocoded.getFormattedAddress()).toEqual(undefined); + expect(geocoded.getStreetNumber()).toEqual(undefined); + expect(geocoded.getStreetName()).toEqual( + "Pennsylvania Avenue Northwest" + ); + expect(geocoded.getSubLocality()).toEqual(undefined); + expect(geocoded.getLocality()).toEqual("Washington"); + expect(geocoded.getPostalCode()).toEqual(undefined); + expect(geocoded.getRegion()).toEqual("District of Columbia"); + expect(geocoded.getAdminLevels()).toEqual([]); + expect(geocoded.getCountry()).toEqual("United States of America"); + expect(geocoded.getCountryCode()).toEqual("US"); - it("maps sublocality correctly", () => { - expect(geocoded.getSubLocality()).toEqual(undefined); + done(); + } + ); }); - it("maps locality correctly", () => { - expect(geocoded.getLocality()).toEqual("Washington"); - }); + it("receives correct geodecoding results", (done) => { + const provider = UniversalGeocoder.createGeocoder({ + provider: "yandex", + useSsl: true, + apiKey: "api_key", + }); - it("maps region correctly", () => { - expect(geocoded.getRegion()).toEqual("District of Columbia"); - }); + provider?.geodecode( + { latitude: 48.8631507, longitude: 2.388911, locale: "en_US" }, + (results) => { + const geocoded = results[0]; + + expect(geocoded).toBeDefined(); + expect(geocoded.getCoordinates()).toEqual([48.8631, 2.388899]); + expect(geocoded.getBounds()).toEqual([ + 48.860391, + 2.384794, + 48.865808, + 2.393004, + ]); + expect(geocoded.getFormattedAddress()).toEqual(undefined); + expect(geocoded.getStreetNumber()).toEqual("10"); + expect(geocoded.getStreetName()).toEqual("Avenue Gambetta"); + expect(geocoded.getSubLocality()).toEqual("20e Arrondissement"); + expect(geocoded.getLocality()).toEqual("Paris"); + expect(geocoded.getPostalCode()).toEqual(undefined); + expect(geocoded.getRegion()).toEqual("Île-de-France"); + expect(geocoded.getAdminLevels()).toEqual([]); + expect(geocoded.getCountry()).toEqual("France"); + expect(geocoded.getCountryCode()).toEqual("FR"); - it("maps country correctly", () => { - expect(geocoded.getCountry()).toEqual("United States"); + done(); + } + ); }); - it("maps country code correctly", () => { - expect(geocoded.getCountryCode()).toEqual("US"); + it("receives error when the API key is bad", (done) => { + const provider = UniversalGeocoder.createGeocoder({ + provider: "yandex", + useSsl: true, + apiKey: "api_key", + }); + + provider?.geocode( + "1600 Pennsylvania Ave, Washington, DC", + () => { + done(); + }, + (error) => { + expect(error.message).toEqual( + "Received HTTP status code 403 when attempting geocoding request." + ); + done(); + } + ); }); }); diff --git a/spec/recordings/Bing-Geocoder-Provider_2231523888/receives-correct-geocoding-results_3640432360/recording.har b/spec/recordings/Bing-Geocoder-Provider_2231523888/receives-correct-geocoding-results_3640432360/recording.har new file mode 100644 index 0000000..9b670dc --- /dev/null +++ b/spec/recordings/Bing-Geocoder-Provider_2231523888/receives-correct-geocoding-results_3640432360/recording.har @@ -0,0 +1,158 @@ +{ + "log": { + "_recordingName": "Bing Geocoder Provider/receives correct geocoding results", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "5.0.0" + }, + "entries": [ + { + "_id": "a820e960ea8aecdecdbba0cecbc709ca", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + }, + { + "_fromType": "array", + "name": "user-agent", + "value": "node-fetch/1.0 (+https://github.com/bitinn/node-fetch)" + }, + { + "_fromType": "array", + "name": "accept-encoding", + "value": "gzip,deflate" + }, + { + "_fromType": "array", + "name": "connection", + "value": "close" + }, + { + "name": "host", + "value": "dev.virtualearth.net" + } + ], + "headersSize": 337, + "httpVersion": "HTTP/1.1", + "method": "GET", + "queryString": [], + "url": "https://dev.virtualearth.net/REST/v1/Locations/1600%20Pennsylvania%20Ave,%20Washington,%20DC" + }, + "response": { + "bodySize": 2389, + "content": { + "_isBinary": true, + "mimeType": "application/json; charset=utf-8", + "size": 2389, + "text": "[\"1f8b0800000000000400\",\"ec57eb6edb36147e1542bf5d87f78bff39b63b146bd7224937604b1130126d13904541a4921a6d1f68afb127dba16477dd50b449b714ddb0c4482cf25cbe73f978a83785edd3d635c99736f9d09cb9d8d769112a57cc8a1f6dedab45e7aabc6feb584c8aebce36d5d3b0092f3b0f12db94dad9e5c9e549e56ea637be4bbdad9dedd276dab87479729aa57db3b93ca941e5aa0db70eac5d5defa76db3016b6568f79ddf6c13985a1cbfa3df7e4514538c9ef9b20b31ac13022bc8a78862dfb6b5775d9ca2795da3413ca2ce45d7ddb86a8a2eb63ea2f98b27a8b44d1312ba76c896a58bd155830d881495a14910cff06c9b7dd6868823dad93d3ae8f4203f818db60b555f826ee8508250e2cea7048fbe193477e0c475e8d6a76de81372af5bb015d16d97a51ad4ba6ee76384a4a27517761f84b3085d1bba21df53c8026885be2bddb94bb198fdf2a67031f99d054f1721d9ba98f13f644681ababb46f73859e86b16cb3f78588e5d6ed6c9cee8edea665d8c13254a5dce63a94b6be3cb98d972760124a74437255afc36b30ccf4541ba6b1a09a726a185593474a4d316744312ab9a4522a3e01318389605811251496ca8c62d480b2628229c6987835291abbcb2089c418bd704d13f7f58d6dbc45f31b877ef869827eb2710bed91423341cb05541d630970dae01b688937c521ca17c3736e97d0413b4166e211ad92528fde991442be7a37296c55e53a64fdc3d7a7bef9148e22ebec7cb3f43175becccdb85cfc7591e616f5698fc2fa03d803a8be49ddfecc6da00e20f4b2f1b947ced3007352ac4307b584a5f911d7fd1332540d9c83ee9f7cb72142831cd83a0abfcb889ab507ce9679f599ab7cbf03d9cce1b4bf18337ac43229362e94a03fa4786caefb271d846c5df6f5d08acf1cd0a102036701ba2fb460a28f76e3b2e76ca1808cb6b5dd1750abbb38d34af1dc8d94b33f7c52ae295146ddd3f519f0d4816350839a94db9cb96163bebbf69b3ef47144f580fc5282092ac9c82f0e11c9a9d15a7082b9248a1039f04b6b6097c67ce4971ac540151b2398a65a73f2397e9daf3eda4eec5efc528602d1d901263154882fa0d8f9ea1ba1d8277272678ab1af41b18fe5fd2159a60ce6f9d05782d083530ac7be1184406ffefb586614300822c2027825c6734370ca607e496ee09c64e31413126b2d1924981f461dc198c014a330c124ffb219c6d47d3806a35401f5b99070a2517a80a1243198112d8926fcbf37d58614dd957220fcf094bb4b193e4e8327709f84fbdcb8fa7cbd8e2efd3d3666287007935868f863de43e10c6ba6b9217701f24db2126886a59690e42327a5e04034f84f04247d085e1a09f39108e0b038b29241e89868c628f9fce4fb6758c908661c734ce1967bb8ed700840286d38979a91ff59f93558f9f9327c3556322c0c3192c0bb8f30efa130c904d71a00b287e3e5b00df94f7d1c2b0005382e2c5d2c3bdfa6b1259e7f0f1ee065b5744fb2efca94953525378e59ae2d33c6894ae06b2bd715dc30c5dbe54b9c7f964abec5d3fc4bde9eb9359acfd07cfe18a6a3a08a62c3178fb159c0485dad083ba56265b44059ee748696a76cb5fc6e452825c3d26236bcbe3fc2fa116117c4cce043c9cfc5bbdf070012b8e2076c100000\"]" + }, + "cookies": [], + "headers": [ + { + "name": "cache-control", + "value": "no-cache" + }, + { + "name": "transfer-encoding", + "value": "chunked" + }, + { + "name": "content-type", + "value": "application/json; charset=utf-8" + }, + { + "name": "content-encoding", + "value": "gzip" + }, + { + "name": "vary", + "value": "Accept-Encoding" + }, + { + "name": "server", + "value": "Microsoft-IIS/10.0" + }, + { + "name": "x-bm-traceid", + "value": "d9cda9c49e3a48a399e5d50ba6fd0785" + }, + { + "name": "x-bm-be-elapsed", + "value": "209" + }, + { + "name": "x-msedge-ref", + "value": "Ref A: AAF6085272094CF09C834EE13B25E985 Ref B: DB3EDGE1221 Ref C: 2020-08-13T19:19:21Z" + }, + { + "name": "x-bm-fe-elapsed", + "value": "228" + }, + { + "name": "x-bm-srv", + "value": "DU00000D76" + }, + { + "name": "x-ms-bm-ws-info", + "value": "0" + }, + { + "name": "access-control-allow-origin", + "value": "*" + }, + { + "name": "access-control-allow-methods", + "value": "POST, GET, OPTIONS" + }, + { + "name": "access-control-allow-headers", + "value": "Content-Type,X-FD-Features,X-FD-FLIGHT,PreferAnonymous" + }, + { + "name": "x-aspnet-version", + "value": "4.0.30319" + }, + { + "name": "x-powered-by", + "value": "ASP.NET" + }, + { + "name": "date", + "value": "Thu, 13 Aug 2020 19:19:21 GMT" + }, + { + "name": "connection", + "value": "close" + } + ], + "headersSize": 689, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2020-08-13T19:19:21.497Z", + "time": 437, + "timings": { + "blocked": -1, + "connect": -1, + "dns": -1, + "receive": 0, + "send": 0, + "ssl": -1, + "wait": 437 + } + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/spec/recordings/Bing-Geocoder-Provider_2231523888/receives-correct-geodecoding-results_1602611079/recording.har b/spec/recordings/Bing-Geocoder-Provider_2231523888/receives-correct-geodecoding-results_1602611079/recording.har new file mode 100644 index 0000000..ee18310 --- /dev/null +++ b/spec/recordings/Bing-Geocoder-Provider_2231523888/receives-correct-geodecoding-results_1602611079/recording.har @@ -0,0 +1,154 @@ +{ + "log": { + "_recordingName": "Bing Geocoder Provider/receives correct geodecoding results", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "5.0.0" + }, + "entries": [ + { + "_id": "4687a99f7b313e37e7bc7bfc408ade84", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + }, + { + "_fromType": "array", + "name": "user-agent", + "value": "node-fetch/1.0 (+https://github.com/bitinn/node-fetch)" + }, + { + "_fromType": "array", + "name": "accept-encoding", + "value": "gzip,deflate" + }, + { + "_fromType": "array", + "name": "connection", + "value": "close" + }, + { + "name": "host", + "value": "dev.virtualearth.net" + } + ], + "headersSize": 311, + "httpVersion": "HTTP/1.1", + "method": "GET", + "queryString": [], + "url": "https://dev.virtualearth.net/REST/v1/Locations/48.8631507,2.388911" + }, + "response": { + "bodySize": 1675, + "content": { + "_isBinary": true, + "mimeType": "application/json; charset=utf-8", + "size": 1675, + "text": "[\"1f8b0800000000000400\",\"94545172db3610bd0a06df0a45429428ea4f96d23453bbf5384e7f2a8f07045722664880032c25731c5fa1f7c8359a8b75414a49266ea753e98700debe7dbb6f81672e3bacc0a05612b53577e0bb1a37b604bee2bfcb5a971b07653897b5e7135e3869ca6b7bb01f9d264485d8ae76d3ddb4846374d40e3b5983745845067037bd0a686d0ebb694d218fad3d01b13d167dd49a03b129dbf64e1f2a24aacde59bfdf5998958c4ec462b67bddd232316a6d133dfb56dadc1f988adeb9a0d70cf1c7870472823765f69cfd6b7ef9992c658640530a914780fe5c0419532650d523dc35a9a3e4453c59e35b267e7988ef0133a689d2d3b45b1d631a4527ca31169a9cd10d9501270eca4b1b21d32786a89cbb3930b28c35a708df69e9acaf6ce36df95b3b1aeb56ee877445da028db39051f003d5ffdf1ccc1a36e2465bab7286bbe4abe6146c0e323f66d70e8da8eb6adbe1ae155058df45173c91629dbd036b9a2aae08392f56e7af2bb29519245c724b85ad827224e97d1729e8b74315f8a54e433914c44345bc6f95c2ce6b3349d8b2c9904d0629167224eb279162fb23480f2c522ce138a9ca799c81f26dcc826085cb2f5114c07ec9d6c0a40941396cd83b9b7d2e93050add586ec7fe6e78a6e8775180deb6874a80bfeac6c314be27c36285a6624eae165c26559869e87f8f3e7b536ff98970770a3cd567b745a8589fbf2670d6f4a78f31359abe047800862ce2295ed0cbafe0e0ed46bdaff1ab1b78e8c22a7d61721ff5d31d547130c0a07ae675e480f1fd001044daf5513d29a52ba7ec42441562d15b07577e83c02bbf9f219f5916ec56bb0f8c6b8d14e75b5d40e7e90703ff6fd0af00460e8b0d4bead65ffeb68e0ab628a11c8fe45c470af5ee724af86d1d3d87fd7d7d67a1af0f36b33742900a984bda6374785dd9fe98e1332bc40d89fb55e9a3de107b08aa287a119afc6ff1f2302c93ae80cddb801bacc2511dc59ba3bb6258acecb0384cc81816fc7eef087170a24ef5515e40f47ef2c45d27e38a1bab0f36365228e2f1b5bf0cae976b49efff60bd1d3c3a2e07d48994b250a21f6324b45badcef97c59ed62acdf6b3b25033f969fb310ebfab6cf9298ec23f095bc9dbf5edb03fdbbee52f7f0f0073c36f20d1050000\"]" + }, + "cookies": [], + "headers": [ + { + "name": "cache-control", + "value": "no-cache" + }, + { + "name": "transfer-encoding", + "value": "chunked" + }, + { + "name": "content-type", + "value": "application/json; charset=utf-8" + }, + { + "name": "content-encoding", + "value": "gzip" + }, + { + "name": "vary", + "value": "Accept-Encoding" + }, + { + "name": "server", + "value": "Microsoft-IIS/10.0" + }, + { + "name": "x-bm-traceid", + "value": "9ac2b22fa74248ff8bf2b2c47f3dbc3a" + }, + { + "name": "x-bm-be-elapsed", + "value": "21" + }, + { + "name": "x-bm-fe-elapsed", + "value": "38" + }, + { + "name": "x-bm-srv", + "value": "DU00000B78, DU01EAP000003DE" + }, + { + "name": "x-ms-bm-ws-info", + "value": "0" + }, + { + "name": "access-control-allow-origin", + "value": "*" + }, + { + "name": "access-control-allow-methods", + "value": "POST, GET, OPTIONS" + }, + { + "name": "access-control-allow-headers", + "value": "Content-Type,X-FD-Features,X-FD-FLIGHT,PreferAnonymous" + }, + { + "name": "x-aspnet-version", + "value": "4.0.30319" + }, + { + "name": "x-powered-by", + "value": "ASP.NET" + }, + { + "name": "date", + "value": "Thu, 13 Aug 2020 19:22:07 GMT" + }, + { + "name": "connection", + "value": "close" + } + ], + "headersSize": 602, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2020-08-13T19:22:07.358Z", + "time": 181, + "timings": { + "blocked": -1, + "connect": -1, + "dns": -1, + "receive": 0, + "send": 0, + "ssl": -1, + "wait": 181 + } + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/spec/recordings/Bing-Geocoder-Provider_2231523888/receives-error-when-the-API-key-is-bad_860720186/recording.har b/spec/recordings/Bing-Geocoder-Provider_2231523888/receives-error-when-the-API-key-is-bad_860720186/recording.har new file mode 100644 index 0000000..3ce6c51 --- /dev/null +++ b/spec/recordings/Bing-Geocoder-Provider_2231523888/receives-error-when-the-API-key-is-bad_860720186/recording.har @@ -0,0 +1,141 @@ +{ + "log": { + "_recordingName": "Bing Geocoder Provider/receives error when the API key is bad", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "5.0.0" + }, + "entries": [ + { + "_id": "a820e960ea8aecdecdbba0cecbc709ca", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + }, + { + "_fromType": "array", + "name": "user-agent", + "value": "node-fetch/1.0 (+https://github.com/bitinn/node-fetch)" + }, + { + "_fromType": "array", + "name": "accept-encoding", + "value": "gzip,deflate" + }, + { + "_fromType": "array", + "name": "connection", + "value": "close" + }, + { + "name": "host", + "value": "dev.virtualearth.net" + } + ], + "headersSize": 280, + "httpVersion": "HTTP/1.1", + "method": "GET", + "queryString": [], + "url": "https://dev.virtualearth.net/REST/v1/Locations/1600%20Pennsylvania%20Ave,%20Washington,%20DC" + }, + "response": { + "bodySize": 681, + "content": { + "mimeType": "application/json; charset=utf-8", + "size": 681, + "text": "{\"authenticationResultCode\":\"InvalidCredentials\",\"brandLogoUri\":\"http:\\/\\/dev.virtualearth.net\\/Branding\\/logo_powered_by.png\",\"copyright\":\"Copyright © 2020 Microsoft and its suppliers. All rights reserved. This API cannot be accessed and the content and any results may not be used, reproduced or transmitted in any manner without express written permission from Microsoft Corporation.\",\"errorDetails\":[\"Access was denied. You may have entered your credentials incorrectly, or you might not have access to the requested resource or operation.\"],\"resourceSets\":[],\"statusCode\":401,\"statusDescription\":\"Unauthorized\",\"traceId\":\"82cbc934601245deaa1400bd45a88f70|DU00000D6E|0.0.0.1\"}" + }, + "cookies": [], + "headers": [ + { + "name": "cache-control", + "value": "no-cache" + }, + { + "name": "transfer-encoding", + "value": "chunked" + }, + { + "name": "content-type", + "value": "application/json; charset=utf-8" + }, + { + "name": "server", + "value": "Microsoft-IIS/10.0" + }, + { + "name": "x-bm-traceid", + "value": "82cbc934601245deaa1400bd45a88f70" + }, + { + "name": "x-bm-fe-elapsed", + "value": "0" + }, + { + "name": "x-bm-srv", + "value": "DU00000D6E" + }, + { + "name": "x-ms-bm-ws-info", + "value": "0" + }, + { + "name": "access-control-allow-origin", + "value": "*" + }, + { + "name": "access-control-allow-methods", + "value": "POST, GET, OPTIONS" + }, + { + "name": "access-control-allow-headers", + "value": "Content-Type,X-FD-Features,X-FD-FLIGHT,PreferAnonymous" + }, + { + "name": "x-aspnet-version", + "value": "4.0.30319" + }, + { + "name": "x-powered-by", + "value": "ASP.NET" + }, + { + "name": "date", + "value": "Thu, 13 Aug 2020 19:24:13 GMT" + }, + { + "name": "connection", + "value": "close" + } + ], + "headersSize": 516, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 401, + "statusText": "Unauthorized" + }, + "startedDateTime": "2020-08-13T19:24:13.532Z", + "time": 629, + "timings": { + "blocked": -1, + "connect": -1, + "dns": -1, + "receive": 0, + "send": 0, + "ssl": -1, + "wait": 629 + } + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/spec/recordings/Chain-Geocoder-Provider_1409790517/receives-correct-geocoding-results-first-first-provider-OK-_818242361/recording.har b/spec/recordings/Chain-Geocoder-Provider_1409790517/receives-correct-geocoding-results-first-first-provider-OK-_818242361/recording.har new file mode 100644 index 0000000..bcfa619 --- /dev/null +++ b/spec/recordings/Chain-Geocoder-Provider_1409790517/receives-correct-geocoding-results-first-first-provider-OK-_818242361/recording.har @@ -0,0 +1,267 @@ +{ + "log": { + "_recordingName": "Chain Geocoder Provider/receives correct geocoding results (first - first provider OK)", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "5.0.0" + }, + "entries": [ + { + "_id": "b6aa6930788fbb267d1d27a53d7c375a", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "user-agent", + "value": "Universal Geocoder Example" + }, + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + }, + { + "_fromType": "array", + "name": "accept-encoding", + "value": "gzip,deflate" + }, + { + "_fromType": "array", + "name": "connection", + "value": "close" + }, + { + "name": "host", + "value": "nominatim.openstreetmap.org" + } + ], + "headersSize": 310, + "httpVersion": "HTTP/1.1", + "method": "GET", + "queryString": [ + { + "name": "q", + "value": "1600 Pennsylvania Ave, Washington, DC" + }, + { + "name": "limit", + "value": "5" + }, + { + "name": "format", + "value": "jsonv2" + }, + { + "name": "addressdetails", + "value": "1" + }, + { + "name": "accept-language", + "value": "en_US" + } + ], + "url": "https://nominatim.openstreetmap.org/search?q=1600+Pennsylvania+Ave%2C+Washington%2C+DC&limit=5&format=jsonv2&addressdetails=1&accept-language=en_US" + }, + "response": { + "bodySize": 1385, + "content": { + "mimeType": "application/json; charset=UTF-8", + "size": 1385, + "text": "[{\"place_id\":176517326,\"licence\":\"Data © OpenStreetMap contributors, ODbL 1.0. https://osm.org/copyright\",\"osm_type\":\"way\",\"osm_id\":397325778,\"boundingbox\":[\"38.8633822\",\"38.8637409\",\"-76.9467576\",\"-76.945632\"],\"lat\":\"38.8636383\",\"lon\":\"-76.9463651\",\"display_name\":\"Pennsylvania Avenue, Dillon Park, Coral Hills, Prince George's County, Washington, D.C., 20746-8001, United States of America\",\"place_rank\":26,\"category\":\"highway\",\"type\":\"trunk\",\"importance\":0.41000000000000003,\"address\":{\"road\":\"Pennsylvania Avenue\",\"hamlet\":\"Dillon Park\",\"locality\":\"Coral Hills\",\"county\":\"Prince George's County\",\"state\":\"Washington, D.C.\",\"postcode\":\"20746-8001\",\"country\":\"United States of America\",\"country_code\":\"us\"}},{\"place_id\":205327805,\"licence\":\"Data © OpenStreetMap contributors, ODbL 1.0. https://osm.org/copyright\",\"osm_type\":\"way\",\"osm_id\":564931814,\"boundingbox\":[\"38.8957842\",\"38.895924\",\"-77.0309688\",\"-77.0304609\"],\"lat\":\"38.8958536\",\"lon\":\"-77.0307129\",\"display_name\":\"Pennsylvania Avenue, Penn Quarter, Washington D.C., Washington, Washington, D.C., 20045, United States of America\",\"place_rank\":27,\"category\":\"highway\",\"type\":\"path\",\"importance\":0.385,\"address\":{\"road\":\"Pennsylvania Avenue\",\"neighbourhood\":\"Penn Quarter\",\"city\":\"Washington D.C.\",\"county\":\"Washington\",\"state\":\"Washington, D.C.\",\"postcode\":\"20045\",\"country\":\"United States of America\",\"country_code\":\"us\"}}]" + }, + "cookies": [], + "headers": [ + { + "name": "server", + "value": "nginx" + }, + { + "name": "date", + "value": "Fri, 14 Aug 2020 17:59:57 GMT" + }, + { + "name": "content-type", + "value": "application/json; charset=UTF-8" + }, + { + "name": "transfer-encoding", + "value": "chunked" + }, + { + "name": "connection", + "value": "close" + }, + { + "name": "access-control-allow-origin", + "value": "*" + }, + { + "name": "access-control-allow-methods", + "value": "OPTIONS,GET" + } + ], + "headersSize": 223, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2020-08-14T17:59:56.783Z", + "time": 345, + "timings": { + "blocked": -1, + "connect": -1, + "dns": -1, + "receive": 0, + "send": 0, + "ssl": -1, + "wait": 345 + } + }, + { + "_id": "e2aec0c20d9e28623deca09660dd67b0", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + }, + { + "_fromType": "array", + "name": "user-agent", + "value": "node-fetch/1.0 (+https://github.com/bitinn/node-fetch)" + }, + { + "_fromType": "array", + "name": "accept-encoding", + "value": "gzip,deflate" + }, + { + "_fromType": "array", + "name": "connection", + "value": "close" + }, + { + "name": "host", + "value": "geocode-maps.yandex.ru" + } + ], + "headersSize": 337, + "httpVersion": "HTTP/1.1", + "method": "GET", + "queryString": [ + { + "name": "geocode", + "value": "1600 Pennsylvania Ave, Washington, DC" + }, + { + "name": "format", + "value": "json" + }, + { + "name": "lang", + "value": "en_US" + } + ], + "url": "https://geocode-maps.yandex.ru/1.x?geocode=1600+Pennsylvania+Ave%2C+Washington%2C+DC&format=json&lang=en_US" + }, + "response": { + "bodySize": 1402, + "content": { + "_isBinary": true, + "mimeType": "application/json; charset=utf-8", + "size": 1402, + "text": "[\"1f8b0800000000000003e4945d6fd3301486ff4ae4eb30e5a3cec7ee4a8be062948981b840137293b3d590d8c1713aa6a9ff7dc7499a795b09bdd8540695aadace39f6fbbe6e9e1ba2a0aea4a8811cdf90b7203f2cbf43a667b228f0874b61964bd06cce343b55b202a5affbd24ce6a03ef6edeffb1af34cc1cf066a4d8e891f799e730a42d4d7c59a09ce9ce91a5ce70bab575c5c6a295c673e23ae11d114ba361d1e4e2f6423729c8464b3c11930dd283ca15c8222c75f2d9d7f5267abaa1464bc6e2d915a2b008d2769f865747e165c43ee9c69a6a176e485332d41f18ca13c8eb53cd366115369ca2567f70d3cb4271a701652e9d595c9c0253f78eb6538729ae768b7369232f4a9d5f537a3d5a8386bbdab926954f3ccb266b2c48b036152c7487b95bd227c2e58092312c8c61d9a2a25d75c6470d7b54b9edd51c88c155c5be7dc49b7eb86d0faaa71539bf3cd10ef1c6f9e176dcab3de130efb87275c8c797b9a78db4317a87b66ddaeb53c16aeb15172615430cdd73055c03afd0f57172381bbe4649b33f66ec78b4781bbe4d34a2ad95cae2e986a4160cf177b45df7df6bc2897e450678a571d61c83d1eec8c7e24a9a58105e4af5b936fc41a0ae4801917f20ad44c2a61a8415ec5f1914713dfa34e981c25a917f901763755f5b0c80f2641648a528f0693a465d0a9e4a2a54d25eb6d5d18465ed26d46296e66fcbf00369dc946af80fd6d6cb265fd336cba33756836dd8ff73f609315fd1e6cb2e339109bbc7092b6d849e284a6bbd8141da5894f69da16257114f8bbd984756940c3b8ab0bbdf4c9d8243124f57c687ac72f57f8ce0f5ccafb5d0e4ba641d58bc09295d9c8ffbdf774682a59d1be2424cda1027caf85b61b1e2d8ec0691bff1e641a223a04969024314594b424a1340ce86e2c4d8230f03bdcf85efc5b2a51445b47a528f1d3d4f83fc7ef2d000000ffff03008b808d24850e0000\"]" + }, + "cookies": [], + "headers": [ + { + "name": "server", + "value": "nginx" + }, + { + "name": "date", + "value": "Fri, 14 Aug 2020 17:59:57 GMT" + }, + { + "name": "content-type", + "value": "application/json; charset=utf-8" + }, + { + "name": "transfer-encoding", + "value": "chunked" + }, + { + "name": "connection", + "value": "close" + }, + { + "name": "vary", + "value": "Accept-Encoding" + }, + { + "name": "access-control-allow-origin", + "value": "*" + }, + { + "name": "access-control-allow-methods", + "value": "GET" + }, + { + "name": "access-control-allow-headers", + "value": "*" + }, + { + "name": "etag", + "value": "W/\"e85-jED9/6YYFGyACPhZmEaIwSqxDds\"" + }, + { + "name": "x-xss-protection", + "value": "1; mode=block" + }, + { + "name": "x-content-type-options", + "value": "nosniff" + }, + { + "name": "content-encoding", + "value": "gzip" + }, + { + "name": "x-qloud-router", + "value": "man4-a74d0ae6f388.qloud-c.yandex.net" + } + ], + "headersSize": 458, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2020-08-14T17:59:56.783Z", + "time": 753, + "timings": { + "blocked": -1, + "connect": -1, + "dns": -1, + "receive": 0, + "send": 0, + "ssl": -1, + "wait": 753 + } + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/spec/recordings/Chain-Geocoder-Provider_1409790517/receives-correct-geocoding-results-first-provider-KO-_279561490/recording.har b/spec/recordings/Chain-Geocoder-Provider_1409790517/receives-correct-geocoding-results-first-provider-KO-_279561490/recording.har new file mode 100644 index 0000000..39233ee --- /dev/null +++ b/spec/recordings/Chain-Geocoder-Provider_1409790517/receives-correct-geocoding-results-first-provider-KO-_279561490/recording.har @@ -0,0 +1,250 @@ +{ + "log": { + "_recordingName": "Chain Geocoder Provider/receives correct geocoding results (first provider KO)", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "5.0.0" + }, + "entries": [ + { + "_id": "e2aec0c20d9e28623deca09660dd67b0", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + }, + { + "_fromType": "array", + "name": "user-agent", + "value": "node-fetch/1.0 (+https://github.com/bitinn/node-fetch)" + }, + { + "_fromType": "array", + "name": "accept-encoding", + "value": "gzip,deflate" + }, + { + "_fromType": "array", + "name": "connection", + "value": "close" + }, + { + "name": "host", + "value": "geocode-maps.yandex.ru" + } + ], + "headersSize": 308, + "httpVersion": "HTTP/1.1", + "method": "GET", + "queryString": [ + { + "name": "geocode", + "value": "1600 Pennsylvania Ave, Washington, DC" + }, + { + "name": "format", + "value": "json" + }, + { + "name": "lang", + "value": "en_US" + } + ], + "url": "https://geocode-maps.yandex.ru/1.x?geocode=1600+Pennsylvania+Ave%2C+Washington%2C+DC&format=json&lang=en_US" + }, + "response": { + "bodySize": 62, + "content": { + "mimeType": "application/json; charset=utf-8", + "size": 62, + "text": "{\"statusCode\":403,\"error\":\"Forbidden\",\"message\":\"Invalid key\"}" + }, + "cookies": [], + "headers": [ + { + "name": "server", + "value": "nginx" + }, + { + "name": "date", + "value": "Fri, 14 Aug 2020 17:46:02 GMT" + }, + { + "name": "content-type", + "value": "application/json; charset=utf-8" + }, + { + "name": "content-length", + "value": "62" + }, + { + "name": "connection", + "value": "close" + }, + { + "name": "access-control-allow-origin", + "value": "*" + }, + { + "name": "access-control-allow-methods", + "value": "GET" + }, + { + "name": "access-control-allow-headers", + "value": "*" + }, + { + "name": "etag", + "value": "W/\"3e-cw06Pdy6OiytV8KcUexnEAwoCRw\"" + }, + { + "name": "x-qloud-router", + "value": "man2-7275f28abf80.qloud-c.yandex.net" + } + ], + "headersSize": 336, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 403, + "statusText": "Forbidden" + }, + "startedDateTime": "2020-08-14T17:46:02.311Z", + "time": 263, + "timings": { + "blocked": -1, + "connect": -1, + "dns": -1, + "receive": 0, + "send": 0, + "ssl": -1, + "wait": 263 + } + }, + { + "_id": "b6aa6930788fbb267d1d27a53d7c375a", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "user-agent", + "value": "Universal Geocoder Example" + }, + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + }, + { + "_fromType": "array", + "name": "accept-encoding", + "value": "gzip,deflate" + }, + { + "_fromType": "array", + "name": "connection", + "value": "close" + }, + { + "name": "host", + "value": "nominatim.openstreetmap.org" + } + ], + "headersSize": 310, + "httpVersion": "HTTP/1.1", + "method": "GET", + "queryString": [ + { + "name": "q", + "value": "1600 Pennsylvania Ave, Washington, DC" + }, + { + "name": "limit", + "value": "5" + }, + { + "name": "format", + "value": "jsonv2" + }, + { + "name": "addressdetails", + "value": "1" + }, + { + "name": "accept-language", + "value": "en_US" + } + ], + "url": "https://nominatim.openstreetmap.org/search?q=1600+Pennsylvania+Ave%2C+Washington%2C+DC&limit=5&format=jsonv2&addressdetails=1&accept-language=en_US" + }, + "response": { + "bodySize": 1385, + "content": { + "mimeType": "application/json; charset=UTF-8", + "size": 1385, + "text": "[{\"place_id\":176517326,\"licence\":\"Data © OpenStreetMap contributors, ODbL 1.0. https://osm.org/copyright\",\"osm_type\":\"way\",\"osm_id\":397325778,\"boundingbox\":[\"38.8633822\",\"38.8637409\",\"-76.9467576\",\"-76.945632\"],\"lat\":\"38.8636383\",\"lon\":\"-76.9463651\",\"display_name\":\"Pennsylvania Avenue, Dillon Park, Coral Hills, Prince George's County, Washington, D.C., 20746-8001, United States of America\",\"place_rank\":26,\"category\":\"highway\",\"type\":\"trunk\",\"importance\":0.41000000000000003,\"address\":{\"road\":\"Pennsylvania Avenue\",\"hamlet\":\"Dillon Park\",\"locality\":\"Coral Hills\",\"county\":\"Prince George's County\",\"state\":\"Washington, D.C.\",\"postcode\":\"20746-8001\",\"country\":\"United States of America\",\"country_code\":\"us\"}},{\"place_id\":205327805,\"licence\":\"Data © OpenStreetMap contributors, ODbL 1.0. https://osm.org/copyright\",\"osm_type\":\"way\",\"osm_id\":564931814,\"boundingbox\":[\"38.8957842\",\"38.895924\",\"-77.0309688\",\"-77.0304609\"],\"lat\":\"38.8958536\",\"lon\":\"-77.0307129\",\"display_name\":\"Pennsylvania Avenue, Penn Quarter, Washington D.C., Washington, Washington, D.C., 20045, United States of America\",\"place_rank\":27,\"category\":\"highway\",\"type\":\"path\",\"importance\":0.385,\"address\":{\"road\":\"Pennsylvania Avenue\",\"neighbourhood\":\"Penn Quarter\",\"city\":\"Washington D.C.\",\"county\":\"Washington\",\"state\":\"Washington, D.C.\",\"postcode\":\"20045\",\"country\":\"United States of America\",\"country_code\":\"us\"}}]" + }, + "cookies": [], + "headers": [ + { + "name": "server", + "value": "nginx" + }, + { + "name": "date", + "value": "Fri, 14 Aug 2020 17:46:02 GMT" + }, + { + "name": "content-type", + "value": "application/json; charset=UTF-8" + }, + { + "name": "transfer-encoding", + "value": "chunked" + }, + { + "name": "connection", + "value": "close" + }, + { + "name": "access-control-allow-origin", + "value": "*" + }, + { + "name": "access-control-allow-methods", + "value": "OPTIONS,GET" + } + ], + "headersSize": 223, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2020-08-14T17:46:02.605Z", + "time": 237, + "timings": { + "blocked": -1, + "connect": -1, + "dns": -1, + "receive": 0, + "send": 0, + "ssl": -1, + "wait": 237 + } + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/spec/recordings/Chain-Geocoder-Provider_1409790517/receives-correct-geocoding-results-first-provider-OK-_2076694978/recording.har b/spec/recordings/Chain-Geocoder-Provider_1409790517/receives-correct-geocoding-results-first-provider-OK-_2076694978/recording.har new file mode 100644 index 0000000..4bae870 --- /dev/null +++ b/spec/recordings/Chain-Geocoder-Provider_1409790517/receives-correct-geocoding-results-first-provider-OK-_2076694978/recording.har @@ -0,0 +1,151 @@ +{ + "log": { + "_recordingName": "Chain Geocoder Provider/receives correct geocoding results (first provider OK)", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "5.0.0" + }, + "entries": [ + { + "_id": "e2aec0c20d9e28623deca09660dd67b0", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + }, + { + "_fromType": "array", + "name": "user-agent", + "value": "node-fetch/1.0 (+https://github.com/bitinn/node-fetch)" + }, + { + "_fromType": "array", + "name": "accept-encoding", + "value": "gzip,deflate" + }, + { + "_fromType": "array", + "name": "connection", + "value": "close" + }, + { + "name": "host", + "value": "geocode-maps.yandex.ru" + } + ], + "headersSize": 337, + "httpVersion": "HTTP/1.1", + "method": "GET", + "queryString": [ + { + "name": "geocode", + "value": "1600 Pennsylvania Ave, Washington, DC" + }, + { + "name": "format", + "value": "json" + }, + { + "name": "lang", + "value": "en_US" + } + ], + "url": "https://geocode-maps.yandex.ru/1.x?geocode=1600+Pennsylvania+Ave%2C+Washington%2C+DC&format=json&lang=en_US" + }, + "response": { + "bodySize": 1405, + "content": { + "_isBinary": true, + "mimeType": "application/json; charset=utf-8", + "size": 1405, + "text": "[\"1f8b0800000000000003e4945d6fd3301486ff4ae4eb30e5a3cec7ee4a8be062948981b840137293b3d590d8c1713aa6a9ff7dc7499a795b09bdd8540695aadace39f6fbbe6e9e1ba2a0aea4a8811cdf90b7203f2cbf43a667b228f0874b61964bd06cce343b55b202a5affbd24ce6a03ef6edeffb1af34cc1cf066a4d8e891f799e730a42d4d7c59a09ce9ce91a5ce70bab575c5c6a295c673e23ae11d114ba361d1e4e2f6423729c8464b3c11930dd283ca15c8222c75f2d9d7f5267abaa1464bc6e2d915a2b008d2769f865747e165c43ee9c69a6a176e485332d41f18ca13c8eb53cd366115369ca2567f70d3cb4271a701652e9d595c9c0253f78eb6538729ae768b7369232f4a9d5f537a3d5a8386bbdab926954f3ccb266b2c48b036152c7487b95bd227c2e58092312c8c61d9a2a25d75c6470d7b54b9edd51c88c155c5be7dc49b7eb86d0faaa71539bf3cd10ef1c6f9e176dcab3de130efb87275c8c797b9a78db4317a87b66ddaeb53c16aeb15172615430cdd73055c03afd0f57172381bbe4649b33f66ec78b4781bbe4d34a2ad95cae2e986a4160cf177b45df7df6bc2897e450678a571d61c83d1eec8c7e24a9a58105e4af5b936fc41a0ae4801917f20ad44c2a61a8415ec5f1914713dfa34e981c25a917f901763755f5b0c80f2641648a528f0693a465d0a9e4a2a54d25eb6d5d18465ed26d46296e66fcbf00369dc946af80fd6d6cb265fd336cba33756836dd8ff73f609315fd1e6cb2e339109bbc7092b6d849e284a6bbd8141da5894f69da16257114f8bbd984756940c3b8ab0bbdf4c9d8243124f57c687ac72f57f8ce0f5ccafb5d0e4ba641d58bc09295d9c8ffbdf774682a59d1be2424cda1027caf85b61b1e2d8ec0691bff1e641a223a04969024314594b424a1340ce86e2c4d8230f03bdcf85efc5b2a51445b47a528f1d3d4f83fc7ef2d000000ffff\",\"03008b808d24850e0000\"]" + }, + "cookies": [], + "headers": [ + { + "name": "server", + "value": "nginx" + }, + { + "name": "date", + "value": "Fri, 14 Aug 2020 17:46:03 GMT" + }, + { + "name": "content-type", + "value": "application/json; charset=utf-8" + }, + { + "name": "transfer-encoding", + "value": "chunked" + }, + { + "name": "connection", + "value": "close" + }, + { + "name": "vary", + "value": "Accept-Encoding" + }, + { + "name": "access-control-allow-origin", + "value": "*" + }, + { + "name": "access-control-allow-methods", + "value": "GET" + }, + { + "name": "access-control-allow-headers", + "value": "*" + }, + { + "name": "etag", + "value": "W/\"e85-jED9/6YYFGyACPhZmEaIwSqxDds\"" + }, + { + "name": "x-xss-protection", + "value": "1; mode=block" + }, + { + "name": "x-content-type-options", + "value": "nosniff" + }, + { + "name": "content-encoding", + "value": "gzip" + }, + { + "name": "x-qloud-router", + "value": "man4-a74d0ae6f388.qloud-c.yandex.net" + } + ], + "headersSize": 458, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2020-08-14T17:46:02.879Z", + "time": 273, + "timings": { + "blocked": -1, + "connect": -1, + "dns": -1, + "receive": 0, + "send": 0, + "ssl": -1, + "wait": 273 + } + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/spec/recordings/Chain-Geocoder-Provider_1409790517/receives-correct-geocoding-results-parallelize-first-provider-KO-_726443114/recording.har b/spec/recordings/Chain-Geocoder-Provider_1409790517/receives-correct-geocoding-results-parallelize-first-provider-KO-_726443114/recording.har new file mode 100644 index 0000000..bbe8852 --- /dev/null +++ b/spec/recordings/Chain-Geocoder-Provider_1409790517/receives-correct-geocoding-results-parallelize-first-provider-KO-_726443114/recording.har @@ -0,0 +1,250 @@ +{ + "log": { + "_recordingName": "Chain Geocoder Provider/receives correct geocoding results (parallelize - first provider KO)", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "5.0.0" + }, + "entries": [ + { + "_id": "b6aa6930788fbb267d1d27a53d7c375a", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "user-agent", + "value": "Universal Geocoder Example" + }, + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + }, + { + "_fromType": "array", + "name": "accept-encoding", + "value": "gzip,deflate" + }, + { + "_fromType": "array", + "name": "connection", + "value": "close" + }, + { + "name": "host", + "value": "nominatim.openstreetmap.org" + } + ], + "headersSize": 310, + "httpVersion": "HTTP/1.1", + "method": "GET", + "queryString": [ + { + "name": "q", + "value": "1600 Pennsylvania Ave, Washington, DC" + }, + { + "name": "limit", + "value": "5" + }, + { + "name": "format", + "value": "jsonv2" + }, + { + "name": "addressdetails", + "value": "1" + }, + { + "name": "accept-language", + "value": "en_US" + } + ], + "url": "https://nominatim.openstreetmap.org/search?q=1600+Pennsylvania+Ave%2C+Washington%2C+DC&limit=5&format=jsonv2&addressdetails=1&accept-language=en_US" + }, + "response": { + "bodySize": 1385, + "content": { + "mimeType": "application/json; charset=UTF-8", + "size": 1385, + "text": "[{\"place_id\":176517326,\"licence\":\"Data © OpenStreetMap contributors, ODbL 1.0. https://osm.org/copyright\",\"osm_type\":\"way\",\"osm_id\":397325778,\"boundingbox\":[\"38.8633822\",\"38.8637409\",\"-76.9467576\",\"-76.945632\"],\"lat\":\"38.8636383\",\"lon\":\"-76.9463651\",\"display_name\":\"Pennsylvania Avenue, Dillon Park, Coral Hills, Prince George's County, Washington, D.C., 20746-8001, United States of America\",\"place_rank\":26,\"category\":\"highway\",\"type\":\"trunk\",\"importance\":0.41000000000000003,\"address\":{\"road\":\"Pennsylvania Avenue\",\"hamlet\":\"Dillon Park\",\"locality\":\"Coral Hills\",\"county\":\"Prince George's County\",\"state\":\"Washington, D.C.\",\"postcode\":\"20746-8001\",\"country\":\"United States of America\",\"country_code\":\"us\"}},{\"place_id\":205327805,\"licence\":\"Data © OpenStreetMap contributors, ODbL 1.0. https://osm.org/copyright\",\"osm_type\":\"way\",\"osm_id\":564931814,\"boundingbox\":[\"38.8957842\",\"38.895924\",\"-77.0309688\",\"-77.0304609\"],\"lat\":\"38.8958536\",\"lon\":\"-77.0307129\",\"display_name\":\"Pennsylvania Avenue, Penn Quarter, Washington D.C., Washington, Washington, D.C., 20045, United States of America\",\"place_rank\":27,\"category\":\"highway\",\"type\":\"path\",\"importance\":0.385,\"address\":{\"road\":\"Pennsylvania Avenue\",\"neighbourhood\":\"Penn Quarter\",\"city\":\"Washington D.C.\",\"county\":\"Washington\",\"state\":\"Washington, D.C.\",\"postcode\":\"20045\",\"country\":\"United States of America\",\"country_code\":\"us\"}}]" + }, + "cookies": [], + "headers": [ + { + "name": "server", + "value": "nginx" + }, + { + "name": "date", + "value": "Fri, 14 Aug 2020 17:58:41 GMT" + }, + { + "name": "content-type", + "value": "application/json; charset=UTF-8" + }, + { + "name": "transfer-encoding", + "value": "chunked" + }, + { + "name": "connection", + "value": "close" + }, + { + "name": "access-control-allow-origin", + "value": "*" + }, + { + "name": "access-control-allow-methods", + "value": "OPTIONS,GET" + } + ], + "headersSize": 223, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2020-08-14T17:58:41.587Z", + "time": 159, + "timings": { + "blocked": -1, + "connect": -1, + "dns": -1, + "receive": 0, + "send": 0, + "ssl": -1, + "wait": 159 + } + }, + { + "_id": "e2aec0c20d9e28623deca09660dd67b0", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + }, + { + "_fromType": "array", + "name": "user-agent", + "value": "node-fetch/1.0 (+https://github.com/bitinn/node-fetch)" + }, + { + "_fromType": "array", + "name": "accept-encoding", + "value": "gzip,deflate" + }, + { + "_fromType": "array", + "name": "connection", + "value": "close" + }, + { + "name": "host", + "value": "geocode-maps.yandex.ru" + } + ], + "headersSize": 308, + "httpVersion": "HTTP/1.1", + "method": "GET", + "queryString": [ + { + "name": "geocode", + "value": "1600 Pennsylvania Ave, Washington, DC" + }, + { + "name": "format", + "value": "json" + }, + { + "name": "lang", + "value": "en_US" + } + ], + "url": "https://geocode-maps.yandex.ru/1.x?geocode=1600+Pennsylvania+Ave%2C+Washington%2C+DC&format=json&lang=en_US" + }, + "response": { + "bodySize": 62, + "content": { + "mimeType": "application/json; charset=utf-8", + "size": 62, + "text": "{\"statusCode\":403,\"error\":\"Forbidden\",\"message\":\"Invalid key\"}" + }, + "cookies": [], + "headers": [ + { + "name": "server", + "value": "nginx" + }, + { + "name": "date", + "value": "Fri, 14 Aug 2020 17:58:41 GMT" + }, + { + "name": "content-type", + "value": "application/json; charset=utf-8" + }, + { + "name": "content-length", + "value": "62" + }, + { + "name": "connection", + "value": "close" + }, + { + "name": "access-control-allow-origin", + "value": "*" + }, + { + "name": "access-control-allow-methods", + "value": "GET" + }, + { + "name": "access-control-allow-headers", + "value": "*" + }, + { + "name": "etag", + "value": "W/\"3e-cw06Pdy6OiytV8KcUexnEAwoCRw\"" + }, + { + "name": "x-qloud-router", + "value": "man4-3cc44c5fdead.qloud-c.yandex.net" + } + ], + "headersSize": 336, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 403, + "statusText": "Forbidden" + }, + "startedDateTime": "2020-08-14T17:58:41.587Z", + "time": 247, + "timings": { + "blocked": -1, + "connect": -1, + "dns": -1, + "receive": 0, + "send": 0, + "ssl": -1, + "wait": 247 + } + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/spec/recordings/Chain-Geocoder-Provider_1409790517/receives-correct-geocoding-results-parallelize-first-provider-OK-_2565153306/recording.har b/spec/recordings/Chain-Geocoder-Provider_1409790517/receives-correct-geocoding-results-parallelize-first-provider-OK-_2565153306/recording.har new file mode 100644 index 0000000..3a589ec --- /dev/null +++ b/spec/recordings/Chain-Geocoder-Provider_1409790517/receives-correct-geocoding-results-parallelize-first-provider-OK-_2565153306/recording.har @@ -0,0 +1,267 @@ +{ + "log": { + "_recordingName": "Chain Geocoder Provider/receives correct geocoding results (parallelize - first provider OK)", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "5.0.0" + }, + "entries": [ + { + "_id": "b6aa6930788fbb267d1d27a53d7c375a", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "user-agent", + "value": "Universal Geocoder Example" + }, + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + }, + { + "_fromType": "array", + "name": "accept-encoding", + "value": "gzip,deflate" + }, + { + "_fromType": "array", + "name": "connection", + "value": "close" + }, + { + "name": "host", + "value": "nominatim.openstreetmap.org" + } + ], + "headersSize": 310, + "httpVersion": "HTTP/1.1", + "method": "GET", + "queryString": [ + { + "name": "q", + "value": "1600 Pennsylvania Ave, Washington, DC" + }, + { + "name": "limit", + "value": "5" + }, + { + "name": "format", + "value": "jsonv2" + }, + { + "name": "addressdetails", + "value": "1" + }, + { + "name": "accept-language", + "value": "en_US" + } + ], + "url": "https://nominatim.openstreetmap.org/search?q=1600+Pennsylvania+Ave%2C+Washington%2C+DC&limit=5&format=jsonv2&addressdetails=1&accept-language=en_US" + }, + "response": { + "bodySize": 1385, + "content": { + "mimeType": "application/json; charset=UTF-8", + "size": 1385, + "text": "[{\"place_id\":176517326,\"licence\":\"Data © OpenStreetMap contributors, ODbL 1.0. https://osm.org/copyright\",\"osm_type\":\"way\",\"osm_id\":397325778,\"boundingbox\":[\"38.8633822\",\"38.8637409\",\"-76.9467576\",\"-76.945632\"],\"lat\":\"38.8636383\",\"lon\":\"-76.9463651\",\"display_name\":\"Pennsylvania Avenue, Dillon Park, Coral Hills, Prince George's County, Washington, D.C., 20746-8001, United States of America\",\"place_rank\":26,\"category\":\"highway\",\"type\":\"trunk\",\"importance\":0.41000000000000003,\"address\":{\"road\":\"Pennsylvania Avenue\",\"hamlet\":\"Dillon Park\",\"locality\":\"Coral Hills\",\"county\":\"Prince George's County\",\"state\":\"Washington, D.C.\",\"postcode\":\"20746-8001\",\"country\":\"United States of America\",\"country_code\":\"us\"}},{\"place_id\":205327805,\"licence\":\"Data © OpenStreetMap contributors, ODbL 1.0. https://osm.org/copyright\",\"osm_type\":\"way\",\"osm_id\":564931814,\"boundingbox\":[\"38.8957842\",\"38.895924\",\"-77.0309688\",\"-77.0304609\"],\"lat\":\"38.8958536\",\"lon\":\"-77.0307129\",\"display_name\":\"Pennsylvania Avenue, Penn Quarter, Washington D.C., Washington, Washington, D.C., 20045, United States of America\",\"place_rank\":27,\"category\":\"highway\",\"type\":\"path\",\"importance\":0.385,\"address\":{\"road\":\"Pennsylvania Avenue\",\"neighbourhood\":\"Penn Quarter\",\"city\":\"Washington D.C.\",\"county\":\"Washington\",\"state\":\"Washington, D.C.\",\"postcode\":\"20045\",\"country\":\"United States of America\",\"country_code\":\"us\"}}]" + }, + "cookies": [], + "headers": [ + { + "name": "server", + "value": "nginx" + }, + { + "name": "date", + "value": "Fri, 14 Aug 2020 17:57:16 GMT" + }, + { + "name": "content-type", + "value": "application/json; charset=UTF-8" + }, + { + "name": "transfer-encoding", + "value": "chunked" + }, + { + "name": "connection", + "value": "close" + }, + { + "name": "access-control-allow-origin", + "value": "*" + }, + { + "name": "access-control-allow-methods", + "value": "OPTIONS,GET" + } + ], + "headersSize": 223, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2020-08-14T17:57:16.219Z", + "time": 207, + "timings": { + "blocked": -1, + "connect": -1, + "dns": -1, + "receive": 0, + "send": 0, + "ssl": -1, + "wait": 207 + } + }, + { + "_id": "e2aec0c20d9e28623deca09660dd67b0", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + }, + { + "_fromType": "array", + "name": "user-agent", + "value": "node-fetch/1.0 (+https://github.com/bitinn/node-fetch)" + }, + { + "_fromType": "array", + "name": "accept-encoding", + "value": "gzip,deflate" + }, + { + "_fromType": "array", + "name": "connection", + "value": "close" + }, + { + "name": "host", + "value": "geocode-maps.yandex.ru" + } + ], + "headersSize": 337, + "httpVersion": "HTTP/1.1", + "method": "GET", + "queryString": [ + { + "name": "geocode", + "value": "1600 Pennsylvania Ave, Washington, DC" + }, + { + "name": "format", + "value": "json" + }, + { + "name": "lang", + "value": "en_US" + } + ], + "url": "https://geocode-maps.yandex.ru/1.x?geocode=1600+Pennsylvania+Ave%2C+Washington%2C+DC&format=json&lang=en_US" + }, + "response": { + "bodySize": 1402, + "content": { + "_isBinary": true, + "mimeType": "application/json; charset=utf-8", + "size": 1402, + "text": "[\"1f8b0800000000000003e4945d6fd3301486ff4ae4eb30e5a3cec7ee4a8be062948981b840137293b3d590d8c1713aa6a9ff7dc7499a795b09bdd8540695aadace39f6fbbe6e9e1ba2a0aea4a8811cdf90b7203f2cbf43a667b228f0874b61964bd06cce343b55b202a5affbd24ce6a03ef6edeffb1af34cc1cf066a4d8e891f799e730a42d4d7c59a09ce9ce91a5ce70bab575c5c6a295c673e23ae11d114ba361d1e4e2f6423729c8464b3c11930dd283ca15c8222c75f2d9d7f5267abaa1464bc6e2d915a2b008d2769f865747e165c43ee9c69a6a176e485332d41f18ca13c8eb53cd366115369ca2567f70d3cb4271a701652e9d595c9c0253f78eb6538729ae768b7369232f4a9d5f537a3d5a8386bbdab926954f3ccb266b2c48b036152c7487b95bd227c2e58092312c8c61d9a2a25d75c6470d7b54b9edd51c88c155c5be7dc49b7eb86d0faaa71539bf3cd10ef1c6f9e176dcab3de130efb87275c8c797b9a78db4317a87b66ddaeb53c16aeb15172615430cdd73055c03afd0f57172381bbe4649b33f66ec78b4781bbe4d34a2ad95cae2e986a4160cf177b45df7df6bc2897e450678a571d61c83d1eec8c7e24a9a58105e4af5b936fc41a0ae4801917f20ad44c2a61a8415ec5f1914713dfa34e981c25a917f901763755f5b0c80f2641648a528f0693a465d0a9e4a2a54d25eb6d5d18465ed26d46296e66fcbf00369dc946af80fd6d6cb265fd336cba33756836dd8ff73f609315fd1e6cb2e339109bbc7092b6d849e284a6bbd8141da5894f69da16257114f8bbd984756940c3b8ab0bbdf4c9d8243124f57c687ac72f57f8ce0f5ccafb5d0e4ba641d58bc09295d9c8ffbdf774682a59d1be2424cda1027caf85b61b1e2d8ec0691bff1e641a223a04969024314594b424a1340ce86e2c4d8230f03bdcf85efc5b2a51445b47a528f1d3d4f83fc7ef2d000000ffff03008b808d24850e0000\"]" + }, + "cookies": [], + "headers": [ + { + "name": "server", + "value": "nginx" + }, + { + "name": "date", + "value": "Fri, 14 Aug 2020 17:57:16 GMT" + }, + { + "name": "content-type", + "value": "application/json; charset=utf-8" + }, + { + "name": "transfer-encoding", + "value": "chunked" + }, + { + "name": "connection", + "value": "close" + }, + { + "name": "vary", + "value": "Accept-Encoding" + }, + { + "name": "access-control-allow-origin", + "value": "*" + }, + { + "name": "access-control-allow-methods", + "value": "GET" + }, + { + "name": "access-control-allow-headers", + "value": "*" + }, + { + "name": "etag", + "value": "W/\"e85-jED9/6YYFGyACPhZmEaIwSqxDds\"" + }, + { + "name": "x-xss-protection", + "value": "1; mode=block" + }, + { + "name": "x-content-type-options", + "value": "nosniff" + }, + { + "name": "content-encoding", + "value": "gzip" + }, + { + "name": "x-qloud-router", + "value": "man2-7275f28abf80.qloud-c.yandex.net" + } + ], + "headersSize": 458, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2020-08-14T17:57:16.219Z", + "time": 344, + "timings": { + "blocked": -1, + "connect": -1, + "dns": -1, + "receive": 0, + "send": 0, + "ssl": -1, + "wait": 344 + } + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/spec/recordings/Chain-Geocoder-Provider_1409790517/receives-correct-geodecoding-results-first-first-provider-OK-_48817278/recording.har b/spec/recordings/Chain-Geocoder-Provider_1409790517/receives-correct-geodecoding-results-first-first-provider-OK-_48817278/recording.har new file mode 100644 index 0000000..3ccb747 --- /dev/null +++ b/spec/recordings/Chain-Geocoder-Provider_1409790517/receives-correct-geodecoding-results-first-first-provider-OK-_48817278/recording.har @@ -0,0 +1,271 @@ +{ + "log": { + "_recordingName": "Chain Geocoder Provider/receives correct geodecoding results (first - first provider OK)", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "5.0.0" + }, + "entries": [ + { + "_id": "35af77943d19f4c062f0b16b5a319928", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + }, + { + "_fromType": "array", + "name": "user-agent", + "value": "node-fetch/1.0 (+https://github.com/bitinn/node-fetch)" + }, + { + "_fromType": "array", + "name": "accept-encoding", + "value": "gzip,deflate" + }, + { + "_fromType": "array", + "name": "connection", + "value": "close" + }, + { + "name": "host", + "value": "geocode-maps.yandex.ru" + } + ], + "headersSize": 309, + "httpVersion": "HTTP/1.1", + "method": "GET", + "queryString": [ + { + "name": "geocode", + "value": "2.388911,48.8631507" + }, + { + "name": "format", + "value": "json" + }, + { + "name": "lang", + "value": "en_US" + } + ], + "url": "https://geocode-maps.yandex.ru/1.x?geocode=2.388911%2C48.8631507&format=json&lang=en_US" + }, + "response": { + "bodySize": 2269, + "content": { + "_isBinary": true, + "mimeType": "application/json; charset=utf-8", + "size": 2269, + "text": "[\"1f8b0800000000000003ec97df6ed33014c65f25f27536397fda26bb2b1dec669432718710f292336a48ece03865d3d457e039788fbd18b6e3645e9b7542940a267a53c7fe1c7fe73bcaafe92d1250579cd5804e6ed119f037979f2193335e14ea8b72a6a74b90e49448b210bc02216fac34e339880bbbfdb5d5e8b505a74cea41c56b7482c2e32849d220f0e2e4381947c128406b5f9dfbb5815a3aeb7eb78e2748afd74d21f5fe00abcb2bdeb05c5da468ad365f01918d5087969720d0c97bc7fa53865da395808cd6a64a04d7446df691846b6dea95202c03dfbbfb5ec0510e47ddf582085afb5e88c19b0ac1594eeb1a4a60d2f7a62b600d786744999292f89e31fe851adf4bdea88c7d34cd735559ad4fcf544952dc7cd4b6f48917a64c51122921dfa785192f558f94a036515947f678b5ce4809fd79aa37bda4127c45f55caf79e8c5d5163c230595cefd8c4f57a28c4a414dca56b25d83ab576a0047bd519d2bede2b54a55f6fac3ba4ffb54f59c1626f499ad5a0dede23965f7d5ef256d73c25c3999399d75a6efb3d60e4bca742e44d2154c0590d6dae6ec7c307f1f9d77b1ab5ddd78eee6efa353a880e5cab1abdd9a9c3fda111fbd5b72c19b4fcb2b220c27dcebf9706f7cb41050d2962b76386fdac7d5b4a7fb3cd65d9b660e752668d5a268c05ddfa0cdbef5095d6a7240fec294fd92ada05050d0e3827f0331e382194f9a42f1248d5b4ae1280dd4dea6aa1e4ad208632b19253831301ac25d92a61dee74a9fe1e00d53f0d7b23d43d9dfa7b1f144fcf194d07a7cf7ff274d13f0196434345b1c0a2208c069012e331c691514c4693301c464a8c7198b4b719a7a3645f4ce172a96cfc0e52de3644480ac2cb1b6f71f743c0d139c996849a5fe3ed87ebcff265a7997f1535dbfa1d651e803b4f84fcec10f44b77d8d59a4d2eed0cf2a0880a2749fbef6c348ec361464571fbda33c149307ee4b5270d8360d4422ac649fc3740ea27000000ffff\",\"ec984112c2200c00bfe20b3a24840077cf5e7c818edebdf828dfe1c76c2bdad2824e2dc5daf10cc324e96e0875df306f23fab9663375d3586263e8da1cccdab7389db19a0ddf8d2566a290b2c052bab1c21044c70a4466379e18b499955d5f2fa7b207d6d55a1d8e0f80fc323e171a8f771510491c1e1c4116b15d7e6e5f30c6f8f658eca92cffa06439d5df9ef7e123820b9b9725eebc23a219fa9a470a345e7b4442ac6505459643d6b32defde6a8b1508022217350aa1ee0729a3ad9e83f5d9e49e95c3532ab920f362f9f9defd056bcf618d50ad3131815459258a4eb889c4f98e286fa7d30efeb3c75d8152ec1e90cc322bee0de72db046733e2de049e8cd8cad8f642f149fcda12c4241c420eb9f078002751f4659a8b297568f155b2001910ec3a8d06a5353cd46981b000000ffff\",\"b4d84b0ac0300804d0abe4029518ff87cbdd2b74114ab2b1d0fdac9c87a02abf625cf8968bb2bdbab54f7e8a5e5e7557fbbc249702c5c8031461a8b1efafef00eb6e484d32c29e67eaa9508460228bc60a16fd49e500e6bc010000ffff\",\"0300ac42889cbb200000\"]" + }, + "cookies": [], + "headers": [ + { + "name": "server", + "value": "nginx" + }, + { + "name": "date", + "value": "Fri, 14 Aug 2020 18:24:50 GMT" + }, + { + "name": "content-type", + "value": "application/json; charset=utf-8" + }, + { + "name": "transfer-encoding", + "value": "chunked" + }, + { + "name": "connection", + "value": "close" + }, + { + "name": "vary", + "value": "Accept-Encoding" + }, + { + "name": "access-control-allow-origin", + "value": "*" + }, + { + "name": "access-control-allow-methods", + "value": "GET" + }, + { + "name": "access-control-allow-headers", + "value": "*" + }, + { + "name": "etag", + "value": "W/\"20bb-MO3+B80DGyD1s+UZB68tAeaEiSk\"" + }, + { + "name": "x-xss-protection", + "value": "1; mode=block" + }, + { + "name": "x-content-type-options", + "value": "nosniff" + }, + { + "name": "content-encoding", + "value": "gzip" + }, + { + "name": "x-qloud-router", + "value": "man4-3cc44c5fdead.qloud-c.yandex.net" + } + ], + "headersSize": 459, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2020-08-14T18:24:50.603Z", + "time": 230, + "timings": { + "blocked": -1, + "connect": -1, + "dns": -1, + "receive": 0, + "send": 0, + "ssl": -1, + "wait": 230 + } + }, + { + "_id": "42d81ccdbafcdf460e8c2ea8919b8659", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "user-agent", + "value": "Universal Geocoder Example" + }, + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + }, + { + "_fromType": "array", + "name": "accept-encoding", + "value": "gzip,deflate" + }, + { + "_fromType": "array", + "name": "connection", + "value": "close" + }, + { + "name": "host", + "value": "nominatim.openstreetmap.org" + } + ], + "headersSize": 287, + "httpVersion": "HTTP/1.1", + "method": "GET", + "queryString": [ + { + "name": "lat", + "value": "48.8631507" + }, + { + "name": "lon", + "value": "2.388911" + }, + { + "name": "zoom", + "value": "18" + }, + { + "name": "format", + "value": "jsonv2" + }, + { + "name": "addressdetails", + "value": "1" + }, + { + "name": "accept-language", + "value": "en_US" + } + ], + "url": "https://nominatim.openstreetmap.org/reverse?lat=48.8631507&lon=2.388911&zoom=18&format=jsonv2&addressdetails=1&accept-language=en_US" + }, + "response": { + "bodySize": 674, + "content": { + "mimeType": "application/json; charset=UTF-8", + "size": 674, + "text": "{\"place_id\":161274479,\"licence\":\"Data © OpenStreetMap contributors, ODbL 1.0. https://osm.org/copyright\",\"osm_type\":\"way\",\"osm_id\":322777831,\"lat\":\"48.863744499999996\",\"lon\":\"2.3911562136123106\",\"place_rank\":26,\"category\":\"highway\",\"type\":\"pedestrian\",\"importance\":0.09999999999999998,\"addresstype\":\"road\",\"name\":null,\"display_name\":\"Quartier du Père-Lachaise, Paris, Ile-de-France, Metropolitan France, 75020, France\",\"address\":{\"suburb\":\"Quartier du Père-Lachaise\",\"city\":\"Paris\",\"municipality\":\"Paris\",\"county\":\"Paris\",\"state\":\"Ile-de-France\",\"country\":\"France\",\"postcode\":\"75020\",\"country_code\":\"fr\"},\"boundingbox\":[\"48.8625929\",\"48.8648832\",\"2.3877078\",\"2.3956964\"]}" + }, + "cookies": [], + "headers": [ + { + "name": "server", + "value": "nginx" + }, + { + "name": "date", + "value": "Fri, 14 Aug 2020 18:24:51 GMT" + }, + { + "name": "content-type", + "value": "application/json; charset=UTF-8" + }, + { + "name": "transfer-encoding", + "value": "chunked" + }, + { + "name": "connection", + "value": "close" + }, + { + "name": "access-control-allow-origin", + "value": "*" + }, + { + "name": "access-control-allow-methods", + "value": "OPTIONS,GET" + } + ], + "headersSize": 223, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2020-08-14T18:24:50.603Z", + "time": 457, + "timings": { + "blocked": -1, + "connect": -1, + "dns": -1, + "receive": 0, + "send": 0, + "ssl": -1, + "wait": 457 + } + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/spec/recordings/Chain-Geocoder-Provider_1409790517/receives-correct-geodecoding-results-first-provider-KO-_1165577657/recording.har b/spec/recordings/Chain-Geocoder-Provider_1409790517/receives-correct-geodecoding-results-first-provider-KO-_1165577657/recording.har new file mode 100644 index 0000000..f0d1438 --- /dev/null +++ b/spec/recordings/Chain-Geocoder-Provider_1409790517/receives-correct-geodecoding-results-first-provider-KO-_1165577657/recording.har @@ -0,0 +1,254 @@ +{ + "log": { + "_recordingName": "Chain Geocoder Provider/receives correct geodecoding results (first provider KO)", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "5.0.0" + }, + "entries": [ + { + "_id": "35af77943d19f4c062f0b16b5a319928", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + }, + { + "_fromType": "array", + "name": "user-agent", + "value": "node-fetch/1.0 (+https://github.com/bitinn/node-fetch)" + }, + { + "_fromType": "array", + "name": "accept-encoding", + "value": "gzip,deflate" + }, + { + "_fromType": "array", + "name": "connection", + "value": "close" + }, + { + "name": "host", + "value": "geocode-maps.yandex.ru" + } + ], + "headersSize": 280, + "httpVersion": "HTTP/1.1", + "method": "GET", + "queryString": [ + { + "name": "geocode", + "value": "2.388911,48.8631507" + }, + { + "name": "format", + "value": "json" + }, + { + "name": "lang", + "value": "en_US" + } + ], + "url": "https://geocode-maps.yandex.ru/1.x?geocode=2.388911%2C48.8631507&format=json&lang=en_US" + }, + "response": { + "bodySize": 62, + "content": { + "mimeType": "application/json; charset=utf-8", + "size": 62, + "text": "{\"statusCode\":403,\"error\":\"Forbidden\",\"message\":\"Invalid key\"}" + }, + "cookies": [], + "headers": [ + { + "name": "server", + "value": "nginx" + }, + { + "name": "date", + "value": "Fri, 14 Aug 2020 18:24:49 GMT" + }, + { + "name": "content-type", + "value": "application/json; charset=utf-8" + }, + { + "name": "content-length", + "value": "62" + }, + { + "name": "connection", + "value": "close" + }, + { + "name": "access-control-allow-origin", + "value": "*" + }, + { + "name": "access-control-allow-methods", + "value": "GET" + }, + { + "name": "access-control-allow-headers", + "value": "*" + }, + { + "name": "etag", + "value": "W/\"3e-cw06Pdy6OiytV8KcUexnEAwoCRw\"" + }, + { + "name": "x-qloud-router", + "value": "man4-a74d0ae6f388.qloud-c.yandex.net" + } + ], + "headersSize": 336, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 403, + "statusText": "Forbidden" + }, + "startedDateTime": "2020-08-14T18:24:49.153Z", + "time": 292, + "timings": { + "blocked": -1, + "connect": -1, + "dns": -1, + "receive": 0, + "send": 0, + "ssl": -1, + "wait": 292 + } + }, + { + "_id": "42d81ccdbafcdf460e8c2ea8919b8659", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "user-agent", + "value": "Universal Geocoder Example" + }, + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + }, + { + "_fromType": "array", + "name": "accept-encoding", + "value": "gzip,deflate" + }, + { + "_fromType": "array", + "name": "connection", + "value": "close" + }, + { + "name": "host", + "value": "nominatim.openstreetmap.org" + } + ], + "headersSize": 287, + "httpVersion": "HTTP/1.1", + "method": "GET", + "queryString": [ + { + "name": "lat", + "value": "48.8631507" + }, + { + "name": "lon", + "value": "2.388911" + }, + { + "name": "zoom", + "value": "18" + }, + { + "name": "format", + "value": "jsonv2" + }, + { + "name": "addressdetails", + "value": "1" + }, + { + "name": "accept-language", + "value": "en_US" + } + ], + "url": "https://nominatim.openstreetmap.org/reverse?lat=48.8631507&lon=2.388911&zoom=18&format=jsonv2&addressdetails=1&accept-language=en_US" + }, + "response": { + "bodySize": 674, + "content": { + "mimeType": "application/json; charset=UTF-8", + "size": 674, + "text": "{\"place_id\":161274479,\"licence\":\"Data © OpenStreetMap contributors, ODbL 1.0. https://osm.org/copyright\",\"osm_type\":\"way\",\"osm_id\":322777831,\"lat\":\"48.863744499999996\",\"lon\":\"2.3911562136123106\",\"place_rank\":26,\"category\":\"highway\",\"type\":\"pedestrian\",\"importance\":0.09999999999999998,\"addresstype\":\"road\",\"name\":null,\"display_name\":\"Quartier du Père-Lachaise, Paris, Ile-de-France, Metropolitan France, 75020, France\",\"address\":{\"suburb\":\"Quartier du Père-Lachaise\",\"city\":\"Paris\",\"municipality\":\"Paris\",\"county\":\"Paris\",\"state\":\"Ile-de-France\",\"country\":\"France\",\"postcode\":\"75020\",\"country_code\":\"fr\"},\"boundingbox\":[\"48.8625929\",\"48.8648832\",\"2.3877078\",\"2.3956964\"]}" + }, + "cookies": [], + "headers": [ + { + "name": "server", + "value": "nginx" + }, + { + "name": "date", + "value": "Fri, 14 Aug 2020 18:24:49 GMT" + }, + { + "name": "content-type", + "value": "application/json; charset=UTF-8" + }, + { + "name": "transfer-encoding", + "value": "chunked" + }, + { + "name": "connection", + "value": "close" + }, + { + "name": "access-control-allow-origin", + "value": "*" + }, + { + "name": "access-control-allow-methods", + "value": "OPTIONS,GET" + } + ], + "headersSize": 223, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2020-08-14T18:24:49.452Z", + "time": 168, + "timings": { + "blocked": -1, + "connect": -1, + "dns": -1, + "receive": 0, + "send": 0, + "ssl": -1, + "wait": 168 + } + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/spec/recordings/Chain-Geocoder-Provider_1409790517/receives-correct-geodecoding-results-first-provider-OK-_2544227361/recording.har b/spec/recordings/Chain-Geocoder-Provider_1409790517/receives-correct-geodecoding-results-first-provider-OK-_2544227361/recording.har new file mode 100644 index 0000000..72c482c --- /dev/null +++ b/spec/recordings/Chain-Geocoder-Provider_1409790517/receives-correct-geodecoding-results-first-provider-OK-_2544227361/recording.har @@ -0,0 +1,151 @@ +{ + "log": { + "_recordingName": "Chain Geocoder Provider/receives correct geodecoding results (first provider OK)", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "5.0.0" + }, + "entries": [ + { + "_id": "35af77943d19f4c062f0b16b5a319928", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + }, + { + "_fromType": "array", + "name": "user-agent", + "value": "node-fetch/1.0 (+https://github.com/bitinn/node-fetch)" + }, + { + "_fromType": "array", + "name": "accept-encoding", + "value": "gzip,deflate" + }, + { + "_fromType": "array", + "name": "connection", + "value": "close" + }, + { + "name": "host", + "value": "geocode-maps.yandex.ru" + } + ], + "headersSize": 309, + "httpVersion": "HTTP/1.1", + "method": "GET", + "queryString": [ + { + "name": "geocode", + "value": "2.388911,48.8631507" + }, + { + "name": "format", + "value": "json" + }, + { + "name": "lang", + "value": "en_US" + } + ], + "url": "https://geocode-maps.yandex.ru/1.x?geocode=2.388911%2C48.8631507&format=json&lang=en_US" + }, + "response": { + "bodySize": 2263, + "content": { + "_isBinary": true, + "mimeType": "application/json; charset=utf-8", + "size": 2263, + "text": "[\"1f8b0800000000000003ec97df6ed33014c65f25f27536397fda26bb2b1dec669432718710f292336a48ece03865d3d457e039788fbd18b6e3645e9b7542940a267a53c7fe1c7fe73bcaafe92d1250579cd5804e6ed119f037979f2193335e14ea8b72a6a74b90e49448b210bc02216fac34e339880bbbfdb5d5e8b505a74cea41c56b7482c2e32849d220f0e2e4381947c128406b5f9dfbb5815a3aeb7eb78e2748afd74d21f5fe00abcb2bdeb05c5da468ad365f01918d5087969720d0c97bc7fa53865da395808cd6a64a04d7446df691846b6dea95202c03dfbbfb5ec0510e47ddf582085afb5e88c19b0ac1594eeb1a4a60d2f7a62b600d786744999292f89e31fe851adf4bdea88c7d34cd735559ad4fcf544952dc7cd4b6f48917a64c51122921dfa785192f558f94a036515947f678b5ce4809fd79aa37bda4127c45f55caf79e8c5d5163c230595cefd8c4f57a28c4a414dca56b25d83ab576a0047bd519d2bede2b54a55f6fac3ba4ffb54f59c1626f499ad5a0dede23965f7d5ef256d73c25c3999399d75a6efb3d60e4bca742e44d2154c0590d6dae6ec7c307f1f9d77b1ab5ddd78eee6efa353a880e5cab1abdd9a9c3fda111fbd5b72c19b4fcb2b220c27dcebf9706f7cb41050d2962b76386fdac7d5b4a7fb3cd65d9b660e752668d5a268c05ddfa0cdbef5095d6a7240fec294fd92ada05050d0e3827f0331e382194f9a42f1248d5b4ae1280dd4dea6aa1e4ad208632b19253831301ac25d92a61dee74a9fe1e00d53f0d7b23d43d9dfa7b1f144fcf194d07a7cf7ff274d13f0196434345b1c0a2208c069012e331c691514c4693301c464a8c7198b4b719a7a3645f4ce172a96cfc0e52de3644480ac2cb1b6f71f743c0d139c996849a5fe3ed87ebcff265a7997f1535dbfa1d651e803b4f84fcec10f44b77d8d59a4d2eed0cf2a0880a2749fbef6c348ec361464571fbda33c149307ee4b5270d8360d4422ac649fc3740ea27000000ffff\",\"ec984112c2200c00bfe20b3a24840077cf5e7c818edebdf828dfe1c76c2bdad2824e2dc5daf10cc324e96e0875df306f23fab9663375d3586263e8da1cccdab7389db19a0ddf8d2566a290b2c052bab1c21044c70a4466379e18b499955d5f2fa7b207d6d55a1d8e0f80fc323e171a8f771510491c1e1c4116b15d7e6e5f30c6f8f658eca92cffa06439d5df9ef7e123820b9b9725eebc23a219fa9a470a345e7b4442ac6505459643d6b32defde6a8b1508022217350aa1ee0729a3ad9e83f5d9e49e95c3532ab920f362f9f9defd056bcf618d50ad3131815459258a4eb889c4f98e286fa7d30efeb3c75d8152ec1e90cc322bee0de72db046733e2de049e8cd8cad8f642f149fcda12c4241c420eb9f078002751f4659a8b297568f155b2001910ec3a8d06a5353cd46981b000000ffffb4d84b0ac0300804d0abe4029518ff87cbdd2b74114ab2b1d0fdac9c87a02abf625cf8968bb2bdbab54f7e8a5e5e7557fbbc249702c5c8031461a8b1efafef00eb6e484d32c29e67eaa9508460228bc60a16fd49e500e6bc010000ffff0300ac42889cbb200000\"]" + }, + "cookies": [], + "headers": [ + { + "name": "server", + "value": "nginx" + }, + { + "name": "date", + "value": "Fri, 14 Aug 2020 18:24:49 GMT" + }, + { + "name": "content-type", + "value": "application/json; charset=utf-8" + }, + { + "name": "transfer-encoding", + "value": "chunked" + }, + { + "name": "connection", + "value": "close" + }, + { + "name": "vary", + "value": "Accept-Encoding" + }, + { + "name": "access-control-allow-origin", + "value": "*" + }, + { + "name": "access-control-allow-methods", + "value": "GET" + }, + { + "name": "access-control-allow-headers", + "value": "*" + }, + { + "name": "etag", + "value": "W/\"20bb-MO3+B80DGyD1s+UZB68tAeaEiSk\"" + }, + { + "name": "x-xss-protection", + "value": "1; mode=block" + }, + { + "name": "x-content-type-options", + "value": "nosniff" + }, + { + "name": "content-encoding", + "value": "gzip" + }, + { + "name": "x-qloud-router", + "value": "man1-043f58f4a44d.qloud-c.yandex.net" + } + ], + "headersSize": 459, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2020-08-14T18:24:49.686Z", + "time": 249, + "timings": { + "blocked": -1, + "connect": -1, + "dns": -1, + "receive": 0, + "send": 0, + "ssl": -1, + "wait": 249 + } + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/spec/recordings/Chain-Geocoder-Provider_1409790517/receives-correct-geodecoding-results-parallelize-first-provider-KO-_268891293/recording.har b/spec/recordings/Chain-Geocoder-Provider_1409790517/receives-correct-geodecoding-results-parallelize-first-provider-KO-_268891293/recording.har new file mode 100644 index 0000000..1a804f3 --- /dev/null +++ b/spec/recordings/Chain-Geocoder-Provider_1409790517/receives-correct-geodecoding-results-parallelize-first-provider-KO-_268891293/recording.har @@ -0,0 +1,254 @@ +{ + "log": { + "_recordingName": "Chain Geocoder Provider/receives correct geodecoding results (parallelize - first provider KO)", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "5.0.0" + }, + "entries": [ + { + "_id": "42d81ccdbafcdf460e8c2ea8919b8659", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "user-agent", + "value": "Universal Geocoder Example" + }, + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + }, + { + "_fromType": "array", + "name": "accept-encoding", + "value": "gzip,deflate" + }, + { + "_fromType": "array", + "name": "connection", + "value": "close" + }, + { + "name": "host", + "value": "nominatim.openstreetmap.org" + } + ], + "headersSize": 287, + "httpVersion": "HTTP/1.1", + "method": "GET", + "queryString": [ + { + "name": "lat", + "value": "48.8631507" + }, + { + "name": "lon", + "value": "2.388911" + }, + { + "name": "zoom", + "value": "18" + }, + { + "name": "format", + "value": "jsonv2" + }, + { + "name": "addressdetails", + "value": "1" + }, + { + "name": "accept-language", + "value": "en_US" + } + ], + "url": "https://nominatim.openstreetmap.org/reverse?lat=48.8631507&lon=2.388911&zoom=18&format=jsonv2&addressdetails=1&accept-language=en_US" + }, + "response": { + "bodySize": 674, + "content": { + "mimeType": "application/json; charset=UTF-8", + "size": 674, + "text": "{\"place_id\":161274479,\"licence\":\"Data © OpenStreetMap contributors, ODbL 1.0. https://osm.org/copyright\",\"osm_type\":\"way\",\"osm_id\":322777831,\"lat\":\"48.863744499999996\",\"lon\":\"2.3911562136123106\",\"place_rank\":26,\"category\":\"highway\",\"type\":\"pedestrian\",\"importance\":0.09999999999999998,\"addresstype\":\"road\",\"name\":null,\"display_name\":\"Quartier du Père-Lachaise, Paris, Ile-de-France, Metropolitan France, 75020, France\",\"address\":{\"suburb\":\"Quartier du Père-Lachaise\",\"city\":\"Paris\",\"municipality\":\"Paris\",\"county\":\"Paris\",\"state\":\"Ile-de-France\",\"country\":\"France\",\"postcode\":\"75020\",\"country_code\":\"fr\"},\"boundingbox\":[\"48.8625929\",\"48.8648832\",\"2.3877078\",\"2.3956964\"]}" + }, + "cookies": [], + "headers": [ + { + "name": "server", + "value": "nginx" + }, + { + "name": "date", + "value": "Fri, 14 Aug 2020 18:24:50 GMT" + }, + { + "name": "content-type", + "value": "application/json; charset=UTF-8" + }, + { + "name": "transfer-encoding", + "value": "chunked" + }, + { + "name": "connection", + "value": "close" + }, + { + "name": "access-control-allow-origin", + "value": "*" + }, + { + "name": "access-control-allow-methods", + "value": "OPTIONS,GET" + } + ], + "headersSize": 223, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2020-08-14T18:24:49.976Z", + "time": 81, + "timings": { + "blocked": -1, + "connect": -1, + "dns": -1, + "receive": 0, + "send": 0, + "ssl": -1, + "wait": 81 + } + }, + { + "_id": "35af77943d19f4c062f0b16b5a319928", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + }, + { + "_fromType": "array", + "name": "user-agent", + "value": "node-fetch/1.0 (+https://github.com/bitinn/node-fetch)" + }, + { + "_fromType": "array", + "name": "accept-encoding", + "value": "gzip,deflate" + }, + { + "_fromType": "array", + "name": "connection", + "value": "close" + }, + { + "name": "host", + "value": "geocode-maps.yandex.ru" + } + ], + "headersSize": 280, + "httpVersion": "HTTP/1.1", + "method": "GET", + "queryString": [ + { + "name": "geocode", + "value": "2.388911,48.8631507" + }, + { + "name": "format", + "value": "json" + }, + { + "name": "lang", + "value": "en_US" + } + ], + "url": "https://geocode-maps.yandex.ru/1.x?geocode=2.388911%2C48.8631507&format=json&lang=en_US" + }, + "response": { + "bodySize": 62, + "content": { + "mimeType": "application/json; charset=utf-8", + "size": 62, + "text": "{\"statusCode\":403,\"error\":\"Forbidden\",\"message\":\"Invalid key\"}" + }, + "cookies": [], + "headers": [ + { + "name": "server", + "value": "nginx" + }, + { + "name": "date", + "value": "Fri, 14 Aug 2020 18:24:50 GMT" + }, + { + "name": "content-type", + "value": "application/json; charset=utf-8" + }, + { + "name": "content-length", + "value": "62" + }, + { + "name": "connection", + "value": "close" + }, + { + "name": "access-control-allow-origin", + "value": "*" + }, + { + "name": "access-control-allow-methods", + "value": "GET" + }, + { + "name": "access-control-allow-headers", + "value": "*" + }, + { + "name": "etag", + "value": "W/\"3e-cw06Pdy6OiytV8KcUexnEAwoCRw\"" + }, + { + "name": "x-qloud-router", + "value": "man1-043f58f4a44d.qloud-c.yandex.net" + } + ], + "headersSize": 336, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 403, + "statusText": "Forbidden" + }, + "startedDateTime": "2020-08-14T18:24:49.976Z", + "time": 191, + "timings": { + "blocked": -1, + "connect": -1, + "dns": -1, + "receive": 0, + "send": 0, + "ssl": -1, + "wait": 191 + } + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/spec/recordings/Chain-Geocoder-Provider_1409790517/receives-correct-geodecoding-results-parallelize-first-provider-OK-_4258976501/recording.har b/spec/recordings/Chain-Geocoder-Provider_1409790517/receives-correct-geodecoding-results-parallelize-first-provider-OK-_4258976501/recording.har new file mode 100644 index 0000000..a52c765 --- /dev/null +++ b/spec/recordings/Chain-Geocoder-Provider_1409790517/receives-correct-geodecoding-results-parallelize-first-provider-OK-_4258976501/recording.har @@ -0,0 +1,271 @@ +{ + "log": { + "_recordingName": "Chain Geocoder Provider/receives correct geodecoding results (parallelize - first provider OK)", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "5.0.0" + }, + "entries": [ + { + "_id": "35af77943d19f4c062f0b16b5a319928", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + }, + { + "_fromType": "array", + "name": "user-agent", + "value": "node-fetch/1.0 (+https://github.com/bitinn/node-fetch)" + }, + { + "_fromType": "array", + "name": "accept-encoding", + "value": "gzip,deflate" + }, + { + "_fromType": "array", + "name": "connection", + "value": "close" + }, + { + "name": "host", + "value": "geocode-maps.yandex.ru" + } + ], + "headersSize": 309, + "httpVersion": "HTTP/1.1", + "method": "GET", + "queryString": [ + { + "name": "geocode", + "value": "2.388911,48.8631507" + }, + { + "name": "format", + "value": "json" + }, + { + "name": "lang", + "value": "en_US" + } + ], + "url": "https://geocode-maps.yandex.ru/1.x?geocode=2.388911%2C48.8631507&format=json&lang=en_US" + }, + "response": { + "bodySize": 2266, + "content": { + "_isBinary": true, + "mimeType": "application/json; charset=utf-8", + "size": 2266, + "text": "[\"1f8b0800000000000003ec97df6ed33014c65f25f27536397fda26bb2b1dec669432718710f292336a48ece03865d3d457e039788fbd18b6e3645e9b7542940a267a53c7fe1c7fe73bcaafe92d1250579cd5804e6ed119f037979f2193335e14ea8b72a6a74b90e49448b210bc02216fac34e339880bbbfdb5d5e8b505a74cea41c56b7482c2e32849d220f0e2e4381947c128406b5f9dfbb5815a3aeb7eb78e2748afd74d21f5fe00abcb2bdeb05c5da468ad365f01918d5087969720d0c97bc7fa53865da395808cd6a64a04d7446df691846b6dea95202c03dfbbfb5ec0510e47ddf582085afb5e88c19b0ac1594eeb1a4a60d2f7a62b600d786744999292f89e31fe851adf4bdea88c7d34cd735559ad4fcf544952dc7cd4b6f48917a64c51122921dfa785192f558f94a036515947f678b5ce4809fd79aa37bda4127c45f55caf79e8c5d5163c230595cefd8c4f57a28c4a414dca56b25d83ab576a0047bd519d2bede2b54a55f6fac3ba4ffb54f59c1626f499ad5a0dede23965f7d5ef256d73c25c3999399d75a6efb3d60e4bca742e44d2154c0590d6dae6ec7c307f1f9d77b1ab5ddd78eee6efa353a880e5cab1abdd9a9c3fda111fbd5b72c19b4fcb2b220c27dcebf9706f7cb41050d2962b76386fdac7d5b4a7fb3cd65d9b660e752668d5a268c05ddfa0cdbef5095d6a7240fec294fd92ada05050d0e3827f0331e382194f9a42f1248d5b4ae1280dd4dea6aa1e4ad208632b19253831301ac25d92a61dee74a9fe1e00d53f0d7b23d43d9dfa7b1f144fcf194d07a7cf7ff274d13f0196434345b1c0a2208c069012e331c691514c4693301c464a8c7198b4b719a7a3645f4ce172a96cfc0e52de3644480ac2cb1b6f71f743c0d139c996849a5fe3ed87ebcff265a7997f1535dbfa1d651e803b4f84fcec10f44b77d8d59a4d2eed0cf2a0880a2749fbef6c348ec361464571fbda33c149307ee4b5270d8360d4422ac649fc3740ea27000000ffff\",\"ec984112c2200c00bfe20b3a24840077cf5e7c818edebdf828dfe1c76c2bdad2824e2dc5daf10cc324e96e0875df306f23fab9663375d3586263e8da1cccdab7389db19a0ddf8d2566a290b2c052bab1c21044c70a4466379e18b499955d5f2fa7b207d6d55a1d8e0f80fc323e171a8f771510491c1e1c4116b15d7e6e5f30c6f8f658eca92cffa06439d5df9ef7e123820b9b9725eebc23a219fa9a470a345e7b4442ac6505459643d6b32defde6a8b1508022217350aa1ee0729a3ad9e83f5d9e49e95c3532ab920f362f9f9defd056bcf618d50ad3131815459258a4eb889c4f98e286fa7d30efeb3c75d8152ec1e90cc322bee0de72db046733e2de049e8cd8cad8f642f149fcda12c4241c420eb9f078002751f4659a8b297568f155b2001910ec3a8d06a5353cd46981b000000ffffb4d84b0ac0300804d0abe4029518ff87cbdd2b74114ab2b1d0fdac9c87a02abf625cf8968bb2bdbab54f7e8a5e5e7557fbbc249702c5c8031461a8b1efafef00eb6e484d32c29e67eaa9508460228bc60a16fd49e500e6bc010000ffff\",\"0300ac42889cbb200000\"]" + }, + "cookies": [], + "headers": [ + { + "name": "server", + "value": "nginx" + }, + { + "name": "date", + "value": "Fri, 14 Aug 2020 18:24:50 GMT" + }, + { + "name": "content-type", + "value": "application/json; charset=utf-8" + }, + { + "name": "transfer-encoding", + "value": "chunked" + }, + { + "name": "connection", + "value": "close" + }, + { + "name": "vary", + "value": "Accept-Encoding" + }, + { + "name": "access-control-allow-origin", + "value": "*" + }, + { + "name": "access-control-allow-methods", + "value": "GET" + }, + { + "name": "access-control-allow-headers", + "value": "*" + }, + { + "name": "etag", + "value": "W/\"20bb-MO3+B80DGyD1s+UZB68tAeaEiSk\"" + }, + { + "name": "x-xss-protection", + "value": "1; mode=block" + }, + { + "name": "x-content-type-options", + "value": "nosniff" + }, + { + "name": "content-encoding", + "value": "gzip" + }, + { + "name": "x-qloud-router", + "value": "man1-043f58f4a44d.qloud-c.yandex.net" + } + ], + "headersSize": 459, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2020-08-14T18:24:50.210Z", + "time": 240, + "timings": { + "blocked": -1, + "connect": -1, + "dns": -1, + "receive": 0, + "send": 0, + "ssl": -1, + "wait": 240 + } + }, + { + "_id": "42d81ccdbafcdf460e8c2ea8919b8659", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "user-agent", + "value": "Universal Geocoder Example" + }, + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + }, + { + "_fromType": "array", + "name": "accept-encoding", + "value": "gzip,deflate" + }, + { + "_fromType": "array", + "name": "connection", + "value": "close" + }, + { + "name": "host", + "value": "nominatim.openstreetmap.org" + } + ], + "headersSize": 287, + "httpVersion": "HTTP/1.1", + "method": "GET", + "queryString": [ + { + "name": "lat", + "value": "48.8631507" + }, + { + "name": "lon", + "value": "2.388911" + }, + { + "name": "zoom", + "value": "18" + }, + { + "name": "format", + "value": "jsonv2" + }, + { + "name": "addressdetails", + "value": "1" + }, + { + "name": "accept-language", + "value": "en_US" + } + ], + "url": "https://nominatim.openstreetmap.org/reverse?lat=48.8631507&lon=2.388911&zoom=18&format=jsonv2&addressdetails=1&accept-language=en_US" + }, + "response": { + "bodySize": 674, + "content": { + "mimeType": "application/json; charset=UTF-8", + "size": 674, + "text": "{\"place_id\":161274479,\"licence\":\"Data © OpenStreetMap contributors, ODbL 1.0. https://osm.org/copyright\",\"osm_type\":\"way\",\"osm_id\":322777831,\"lat\":\"48.863744499999996\",\"lon\":\"2.3911562136123106\",\"place_rank\":26,\"category\":\"highway\",\"type\":\"pedestrian\",\"importance\":0.09999999999999998,\"addresstype\":\"road\",\"name\":null,\"display_name\":\"Quartier du Père-Lachaise, Paris, Ile-de-France, Metropolitan France, 75020, France\",\"address\":{\"suburb\":\"Quartier du Père-Lachaise\",\"city\":\"Paris\",\"municipality\":\"Paris\",\"county\":\"Paris\",\"state\":\"Ile-de-France\",\"country\":\"France\",\"postcode\":\"75020\",\"country_code\":\"fr\"},\"boundingbox\":[\"48.8625929\",\"48.8648832\",\"2.3877078\",\"2.3956964\"]}" + }, + "cookies": [], + "headers": [ + { + "name": "server", + "value": "nginx" + }, + { + "name": "date", + "value": "Fri, 14 Aug 2020 18:24:50 GMT" + }, + { + "name": "content-type", + "value": "application/json; charset=UTF-8" + }, + { + "name": "transfer-encoding", + "value": "chunked" + }, + { + "name": "connection", + "value": "close" + }, + { + "name": "access-control-allow-origin", + "value": "*" + }, + { + "name": "access-control-allow-methods", + "value": "OPTIONS,GET" + } + ], + "headersSize": 223, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2020-08-14T18:24:50.210Z", + "time": 359, + "timings": { + "blocked": -1, + "connect": -1, + "dns": -1, + "receive": 0, + "send": 0, + "ssl": -1, + "wait": 359 + } + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/spec/recordings/Google-Maps-Geocoder-Provider_3854403838/receives-correct-geocoding-results_3640432360/recording.har b/spec/recordings/Google-Maps-Geocoder-Provider_3854403838/receives-correct-geocoding-results_3640432360/recording.har new file mode 100644 index 0000000..9efb837 --- /dev/null +++ b/spec/recordings/Google-Maps-Geocoder-Provider_3854403838/receives-correct-geocoding-results_3640432360/recording.har @@ -0,0 +1,151 @@ +{ + "log": { + "_recordingName": "Google Maps Geocoder Provider/receives correct geocoding results", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "5.0.0" + }, + "entries": [ + { + "_id": "abd7b981a33a2e9c17490b975032040c", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + }, + { + "_fromType": "array", + "name": "user-agent", + "value": "node-fetch/1.0 (+https://github.com/bitinn/node-fetch)" + }, + { + "_fromType": "array", + "name": "accept-encoding", + "value": "gzip,deflate" + }, + { + "_fromType": "array", + "name": "connection", + "value": "close" + }, + { + "name": "host", + "value": "maps.googleapis.com" + } + ], + "headersSize": 326, + "httpVersion": "HTTP/1.1", + "method": "GET", + "queryString": [ + { + "name": "address", + "value": "1600 Pennsylvania Ave, Washington, DC" + } + ], + "url": "https://maps.googleapis.com/maps/api/geocode/json?address=1600+Pennsylvania+Ave%2C+Washington%2C+DC" + }, + "response": { + "bodySize": 1256, + "content": { + "_isBinary": true, + "mimeType": "application/json; charset=UTF-8", + "size": 1256, + "text": "[\"1f\",\"8b\",\"08\",\"00\",\"00\",\"00\",\"00\",\"00\",\"02\",\"ff\",\"ad\",\"965d6f9b301486eff32b2c5fb30ac2f7eeaa449bba494bd72cebc554594e3809d6c046c6a48baafcf71a885a28745025dc207c5edb0fafcf39f034410861097991a81ca3cfe84f39a0afa7d3bd0cd328d28a9c6c449a090ebcadece84fb312c17784d3144a31b63cd3c4464794c742aa41953a6450efa9672809a0a714e91a24460f2df1d1f810d42d709e1f923de58ca2eb3df002d00f0d143f42ae86697ba7df0ff04b51283893fb8511ddd33c667ca7041fc61d39ab09cb81ede2b590b110113610ce44c214dbd0e4cc17f808f668d8446830a60e97049d339d6f6ca390d8a2994874d2313a8c3c9f0da0d22865bc5c9a2ab60742255092c01e12625d927ec59982082d15557aeb41ecd572007b230aaee4450d9e9aee98c6f09eac4997895cd14477a9a85b5faf4f0f8d45f056c8942aed1139f5b8972e84fa8bdb68d48e81e63354811968b5bc6ed2e11d88144aabf47a6d0bf05a9b18e5dd4019e3658902d5cda72f5cb947ab981d5c05a11f9a8ed3f1a452f15da9fae4fb57a6edbad6d479ab3af658ae3b53ddf9466d6e9b9e3dbcb91fbabe13d65787e17f895395b362baea7b9d6aa1789edd45697378ae6f077d1cef6d4bcad4aad2e16eb1f8f26b71fb26fbf09ec163a6cfeb12271984ae63dbe634b4dc11e769076ee885be19385d4bcf3d566fea7a76b5f80892c00cecb0c6b6060ef7f5a98988b3846e80b0a8327a16df7cfbfa5bdd38eb83ad9cbf77d2b522f23325ffdca0555ccda2d7ef45d709cbe354ff97d48d897145c496e81bc8ea3bae0725a42c6fb4858aa76e05fa8f82aaa2ae\",\"fcc5773c394e9e014ab94ebe15090000\"]" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json; charset=UTF-8" + }, + { + "name": "date", + "value": "Thu, 13 Aug 2020 14:48:14 GMT" + }, + { + "name": "pragma", + "value": "no-cache" + }, + { + "name": "expires", + "value": "Fri, 01 Jan 1990 00:00:00 GMT" + }, + { + "name": "cache-control", + "value": "no-cache, must-revalidate" + }, + { + "name": "vary", + "value": "Accept-Language" + }, + { + "name": "access-control-allow-origin", + "value": "*" + }, + { + "name": "x-goog-maps-metro-area", + "value": "Washington, DC" + }, + { + "name": "content-encoding", + "value": "gzip" + }, + { + "name": "server", + "value": "mafe" + }, + { + "name": "x-xss-protection", + "value": "0" + }, + { + "name": "x-frame-options", + "value": "SAMEORIGIN" + }, + { + "name": "server-timing", + "value": "gfet4t7; dur=545" + }, + { + "name": "alt-svc", + "value": "h3-29=\":443\"; ma=2592000,h3-27=\":443\"; ma=2592000,h3-T050=\":443\"; ma=2592000,h3-Q050=\":443\"; ma=2592000,h3-Q046=\":443\"; ma=2592000,h3-Q043=\":443\"; ma=2592000,quic=\":443\"; ma=2592000; v=\"46,43\"" + }, + { + "name": "connection", + "value": "close" + }, + { + "name": "transfer-encoding", + "value": "chunked" + } + ], + "headersSize": 652, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2020-08-13T14:48:14.144Z", + "time": 571, + "timings": { + "blocked": -1, + "connect": -1, + "dns": -1, + "receive": 0, + "send": 0, + "ssl": -1, + "wait": 571 + } + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/spec/recordings/Google-Maps-Geocoder-Provider_3854403838/receives-correct-geodecoding-results_1602611079/recording.har b/spec/recordings/Google-Maps-Geocoder-Provider_3854403838/receives-correct-geodecoding-results_1602611079/recording.har new file mode 100644 index 0000000..811a0a0 --- /dev/null +++ b/spec/recordings/Google-Maps-Geocoder-Provider_3854403838/receives-correct-geodecoding-results_1602611079/recording.har @@ -0,0 +1,151 @@ +{ + "log": { + "_recordingName": "Google Maps Geocoder Provider/receives correct geodecoding results", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "5.0.0" + }, + "entries": [ + { + "_id": "d768d27f86a79d9146e3a6ef1cc421f3", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + }, + { + "_fromType": "array", + "name": "user-agent", + "value": "node-fetch/1.0 (+https://github.com/bitinn/node-fetch)" + }, + { + "_fromType": "array", + "name": "accept-encoding", + "value": "gzip,deflate" + }, + { + "_fromType": "array", + "name": "connection", + "value": "close" + }, + { + "name": "host", + "value": "maps.googleapis.com" + } + ], + "headersSize": 297, + "httpVersion": "HTTP/1.1", + "method": "GET", + "queryString": [ + { + "name": "latlng", + "value": "48.8631507,2.388911" + } + ], + "url": "https://maps.googleapis.com/maps/api/geocode/json?latlng=48.8631507%2C2.388911" + }, + "response": { + "bodySize": 3715, + "content": { + "_isBinary": true, + "mimeType": "application/json; charset=UTF-8", + "size": 3715, + "text": "[\"1f\",\"8b\",\"08\",\"00\",\"00\",\"00\",\"00\",\"00\",\"02\",\"ff\",\"ed\",\"9b\",\"dd\",\"72\",\"da381886cf7b151e4e37c948b2245b7b460824b4a1501a92b23b1d8f6314ec2db6b3fec94f3bb985bd8eddebe88dad0c9400c6d8043ba1a97b92127f42af2ceb7d3e7d56bebd9124a9723d0a7dcd7007bc22fd2e7d8b7e15fdd670ed6b377406b32b9573a67cf84d39913aba67f97b52c3d31d8357f67e34188edc4b7df418ae362ef0b449258a791847563cee87a3c08f42fe9c36fdd16774591f0c4444a44774ef70673132163f6d35729da1e6e8f6a4678866aa1e437cd3f5829498e0fe9a4ffa13f181c7b96810da97dcab489f17821ff6361254bde14ec8a5635d7c5710e8e9ead21bcc4bf5dc30e05b4a1c4f6abab0a4b0793923d7d04756705fd913cf962bfe6789cfdbde41cf739d81e5fbdc16cf8434e05246c1d91bce0f411fd896638947400fac1baee91ed7b511bfe1230de539aaefff8cf8fe80ef2f2da5c4c1348f1a4f160ef3149e5570a39ba2d710161378b93e2a0a0108a44b4b0a9b5777edfac1ccd296443d7efa3cf725952bd7b3f520e0036dea6453b7919696f49e34169060a6d1370db96bf3e8deccb9f26cc086985fd7895f1a5fd583e802560f542a4399c2f82047ce300a4107b2aa3204d9bafb3deb4d8b6ecd7838dd76bb71d6ee2cddbdca8dc56fafc54d5e2dcb11574caefbab2f2f0bc75825400588411293bf3802069002d4492840cbb10f2b1e046197e62dcf28042aaa0221135da4095115a208115128666a4c48d2e333af50b05837b8660dc6b7b96636df32fdf454be791b902f46\",\"97c2e3da572edfd0ab6165b1d10a804faf6d8af169b33498af90be029eb325f063edcc1ae48efc0c2b7e654c89fc12f925f233082f91bf21f2c14b215fe007a5201f40b28bc897659815f904e002912f139415f904919c916f023443be892efa678d00b1a0bf2df2e953914f33215fdc5cfd7264f96664bad1e216133f0accc932b79c4073af34f1837be359283c21a0e976b02aa4a874a0134db2540d87a11f70a9f5fd3fe1d596f8d674fa666e58a607657ab091f0323d78c1f4804a092b7bab2ce132f27d3f0f18cb4001721afd042a89923b7e11c3884dffa52ac0488529dc4dc86db26452504d299e1020ef62f1442644a8cf9049a94c2db47842894269b64c0ae65f3cf972c11cdc9964524af0d721fce3cefed8731756d3c2eaf6b86df9fc39ea15e52b8a322129139232215927ed17794581e414c8aa946ecad8eafbe3bad67c7f56ef76daa7d5b3fa51a1b8250a63590b1710b3e270abaa08642d5c4005e488dbba65dcb5acc3c3817d1e0e2e7ac32e6a047dfb1c0c8eeb7ef3c880ada3e66db371681af6e8eb69edf0d8b01b611ff5ac63b3d9af991fded5878e469d4f866acb76f7ae7ece87d54e0d86bd5eb7da4ae4f5b3bf6650f6618665bb32a8047709ee12dc198497e0de0cdcc26e7225778e35040c57bc89909636a044256c39666b12ca50a14a7af982a034f63dbd78801889537861e4103279c3c4e6b8de6ed5cfbacd9a56ab47d94da1690dc5184faa08f1046d712c0c60aaca7261790d135a2665843425aaa22840a6f9d611b4fd6b284feb088d13b77a741b5c8e1af5c4bc64099a85a5239defff7a7cff54374c3d2a5ba413362d7e7e100eb786e6a5eb99ae3bc8d343773c1bc8515e49faf5c24bd26f46fac5e5bb1b90578082579c3094e64d1903e1de4aee9027824fa9e9850c978e3a48f9211e0bdad17588672a5628ccd4db23e2ab9d4eb7fda9d9aa9ed50ba4fb2b98b7acf456f9f951cbbd1bd3fbc40f4f6d469b27b69a48ef0ce02b8ce80804a6a42fee2bddabac1bd20d5b2f9ad48f418a11fbe1e53c5ae73ece30b033902d73803207f8857280754b7c473202156398f2e21e432a768bf117f75b9205538ad23688627b08088df59c5f4a4041d2d985a5cc00a8993a7df6cce015cc5fd6d4806a5f750b93716a303c0c7b7aab5dabddf6920f083c9592c5bd91781e8f2af1be5a5e89f7f5c29f17ef1b917447580994943ab5f05a4c58dcf1b6f65ac2707cf72a2d9a2d65001675be8e30a6a2752572b1ffa418a24cbdbd00257ffe997b0a265b8dd33e36f45aedee760d265790a4b82a78499b9236bb4e9b17e5ccf8d8114ecbe9296308c45f996de956901025e520394262c3112f33e644194a215eb71523086dfe17f0cf0299d7306d591173a45c5987260b23c4f4df7e6c4d76621f121193e2d43f036c9ec9cd771c8f256c4ad83c0e73475cebe9b0212a8a0b58a40dc43b59f87b0df3f614dab46a7f9f4e68937cd07873ab2e0c40a55fe6ef978bf7f4658c931d88079c8078aa2a3dae02f980100600cdfb953c4400a8706de51d1e604c61fc8f3df3f14dcc1864ea1adfa4b20230dcc1a314af62dab2da6603dfdb55f5cc243da36bd42ea6b6997c0e72736729cc3677d87d5ec06d08140f4fc4d3b5b867079422b134f37d6ee1810cb1bc96f6fb245a3185d49da94824142aaff31a046505ef5e41e055cc5956a7699d0f70ebde1e9e574197b1d1c91de96bda859fe834eb57e5b8dbc94aacf8811e849385d77e5779f3f0e67fe4db093b05570000\"]" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json; charset=UTF-8" + }, + { + "name": "date", + "value": "Thu, 13 Aug 2020 15:02:13 GMT" + }, + { + "name": "pragma", + "value": "no-cache" + }, + { + "name": "expires", + "value": "Fri, 01 Jan 1990 00:00:00 GMT" + }, + { + "name": "cache-control", + "value": "no-cache, must-revalidate" + }, + { + "name": "vary", + "value": "Accept-Language" + }, + { + "name": "access-control-allow-origin", + "value": "*" + }, + { + "name": "x-goog-maps-metro-area", + "value": "Paris" + }, + { + "name": "content-encoding", + "value": "gzip" + }, + { + "name": "server", + "value": "mafe" + }, + { + "name": "x-xss-protection", + "value": "0" + }, + { + "name": "x-frame-options", + "value": "SAMEORIGIN" + }, + { + "name": "server-timing", + "value": "gfet4t7; dur=174" + }, + { + "name": "alt-svc", + "value": "h3-29=\":443\"; ma=2592000,h3-27=\":443\"; ma=2592000,h3-T050=\":443\"; ma=2592000,h3-Q050=\":443\"; ma=2592000,h3-Q046=\":443\"; ma=2592000,h3-Q043=\":443\"; ma=2592000,quic=\":443\"; ma=2592000; v=\"46,43\"" + }, + { + "name": "connection", + "value": "close" + }, + { + "name": "transfer-encoding", + "value": "chunked" + } + ], + "headersSize": 643, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2020-08-13T15:02:13.751Z", + "time": 226, + "timings": { + "blocked": -1, + "connect": -1, + "dns": -1, + "receive": 0, + "send": 0, + "ssl": -1, + "wait": 226 + } + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/spec/recordings/Google-Maps-Geocoder-Provider_3854403838/receives-error-when-the-API-key-is-bad_860720186/recording.har b/spec/recordings/Google-Maps-Geocoder-Provider_3854403838/receives-error-when-the-API-key-is-bad_860720186/recording.har new file mode 100644 index 0000000..b5c70a7 --- /dev/null +++ b/spec/recordings/Google-Maps-Geocoder-Provider_3854403838/receives-error-when-the-API-key-is-bad_860720186/recording.har @@ -0,0 +1,147 @@ +{ + "log": { + "_recordingName": "Google Maps Geocoder Provider/receives error when the API key is bad", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "5.0.0" + }, + "entries": [ + { + "_id": "abd7b981a33a2e9c17490b975032040c", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + }, + { + "_fromType": "array", + "name": "user-agent", + "value": "node-fetch/1.0 (+https://github.com/bitinn/node-fetch)" + }, + { + "_fromType": "array", + "name": "accept-encoding", + "value": "gzip,deflate" + }, + { + "_fromType": "array", + "name": "connection", + "value": "close" + }, + { + "name": "host", + "value": "maps.googleapis.com" + } + ], + "headersSize": 294, + "httpVersion": "HTTP/1.1", + "method": "GET", + "queryString": [ + { + "name": "address", + "value": "1600 Pennsylvania Ave, Washington, DC" + } + ], + "url": "https://maps.googleapis.com/maps/api/geocode/json?address=1600+Pennsylvania+Ave%2C+Washington%2C+DC" + }, + "response": { + "bodySize": 255, + "content": { + "_isBinary": true, + "mimeType": "application/json; charset=UTF-8", + "size": 255, + "text": "[\"1f\",\"8b\",\"08\",\"00\",\"00\",\"00000002ffabe6525050504a2d2aca2f8acf4d2d2e4e4c4f5552b052500ac948552828ca2fcb4c494d51700cf054c84ead54c82c56c8cc2b4bccc94cd153d2016b2c4a2d2ecd29290669898e85081597249694824594825c03435d8343e25d5cfd3c5d5d94b86ab9002ddcf75a6f000000\"]" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json; charset=UTF-8" + }, + { + "name": "date", + "value": "Thu, 13 Aug 2020 14:48:14 GMT" + }, + { + "name": "pragma", + "value": "no-cache" + }, + { + "name": "expires", + "value": "Fri, 01 Jan 1990 00:00:00 GMT" + }, + { + "name": "cache-control", + "value": "no-cache, must-revalidate" + }, + { + "name": "vary", + "value": "Accept-Language" + }, + { + "name": "access-control-allow-origin", + "value": "*" + }, + { + "name": "content-encoding", + "value": "gzip" + }, + { + "name": "server", + "value": "mafe" + }, + { + "name": "x-xss-protection", + "value": "0" + }, + { + "name": "x-frame-options", + "value": "SAMEORIGIN" + }, + { + "name": "server-timing", + "value": "gfet4t7; dur=10" + }, + { + "name": "alt-svc", + "value": "h3-29=\":443\"; ma=2592000,h3-27=\":443\"; ma=2592000,h3-T050=\":443\"; ma=2592000,h3-Q050=\":443\"; ma=2592000,h3-Q046=\":443\"; ma=2592000,h3-Q043=\":443\"; ma=2592000,quic=\":443\"; ma=2592000; v=\"46,43\"" + }, + { + "name": "connection", + "value": "close" + }, + { + "name": "transfer-encoding", + "value": "chunked" + } + ], + "headersSize": 611, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2020-08-13T14:48:14.007Z", + "time": 85, + "timings": { + "blocked": -1, + "connect": -1, + "dns": -1, + "receive": 0, + "send": 0, + "ssl": -1, + "wait": 85 + } + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/spec/recordings/MapQuest-Geocoder-Provider_1759071530/receives-correct-geocoding-results_3640432360/recording.har b/spec/recordings/MapQuest-Geocoder-Provider_1759071530/receives-correct-geocoding-results_3640432360/recording.har new file mode 100644 index 0000000..f09443a --- /dev/null +++ b/spec/recordings/MapQuest-Geocoder-Provider_1759071530/receives-correct-geocoding-results_3640432360/recording.har @@ -0,0 +1,163 @@ +{ + "log": { + "_recordingName": "MapQuest Geocoder Provider/receives correct geocoding results", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "5.0.0" + }, + "entries": [ + { + "_id": "23726ea12e730e66843c80cff1bb6610", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + }, + { + "_fromType": "array", + "name": "user-agent", + "value": "node-fetch/1.0 (+https://github.com/bitinn/node-fetch)" + }, + { + "_fromType": "array", + "name": "accept-encoding", + "value": "gzip,deflate" + }, + { + "_fromType": "array", + "name": "connection", + "value": "close" + }, + { + "name": "host", + "value": "www.mapquestapi.com" + } + ], + "headersSize": 328, + "httpVersion": "HTTP/1.1", + "method": "GET", + "queryString": [ + { + "name": "location", + "value": "1600 Pennsylvania Ave, Washington, DC" + } + ], + "url": "https://www.mapquestapi.com/geocoding/v1/address?location=1600+Pennsylvania+Ave%2C+Washington%2C+DC" + }, + "response": { + "bodySize": 1115, + "content": { + "mimeType": "application/json;charset=UTF-8", + "size": 1115, + "text": "{\"info\":{\"statuscode\":0,\"copyright\":{\"text\":\"\\u00A9 2020 MapQuest, Inc.\",\"imageUrl\":\"http://api.mqcdn.com/res/mqlogo.gif\",\"imageAltText\":\"\\u00A9 2020 MapQuest, Inc.\"},\"messages\":[]},\"options\":{\"maxResults\":-1,\"thumbMaps\":true,\"ignoreLatLngInput\":false},\"results\":[{\"providedLocation\":{\"location\":\"1600 Pennsylvania Ave, Washington, DC\"},\"locations\":[{\"street\":\"1600 Pennsylvania Ave\",\"adminArea6\":\"\",\"adminArea6Type\":\"Neighborhood\",\"adminArea5\":\"Washington\",\"adminArea5Type\":\"City\",\"adminArea4\":\"District Of Columbia\",\"adminArea4Type\":\"County\",\"adminArea3\":\"DC\",\"adminArea3Type\":\"State\",\"adminArea1\":\"US\",\"adminArea1Type\":\"Country\",\"postalCode\":\"\",\"geocodeQualityCode\":\"P1AAA\",\"geocodeQuality\":\"POINT\",\"dragPoint\":false,\"sideOfStreet\":\"N\",\"linkId\":\"58f8ddbf-64f2-4ea2-b8f9-78b5364924e9\",\"unknownInput\":\"\",\"type\":\"s\",\"latLng\":{\"lat\":38.895206,\"lng\":-77.036515},\"displayLatLng\":{\"lat\":38.895206,\"lng\":-77.036515},\"mapUrl\":\"http://www.mapquestapi.com/staticmap/v5/map?key=Fmjtd|luurnu6al1,bg=o5-9wbg94&type=map&size=225,160&locations=38.895206,-77.036515|marker-sm-50318A-1&scalebar=true&zoom=15&rand=-2063980493\"}]}]}" + }, + "cookies": [ + { + "httpOnly": true, + "name": "JSESSIONID", + "path": "/", + "secure": true, + "value": "E91FC02E5CF83DDD961FAAA8E50373B1" + } + ], + "headers": [ + { + "name": "date", + "value": "Fri, 14 Aug 2020 14:28:16 GMT" + }, + { + "name": "content-type", + "value": "application/json;charset=UTF-8" + }, + { + "name": "content-length", + "value": "1115" + }, + { + "name": "connection", + "value": "close" + }, + { + "name": "access-control-allow-methods", + "value": "OPTIONS,GET,POST" + }, + { + "name": "access-control-allow-origin", + "value": "*" + }, + { + "name": "cache-control", + "value": "no-cache, must-revalidate" + }, + { + "name": "expires", + "value": "Mon, 20 Dec 1998 01:00:00 GMT" + }, + { + "name": "geocodetransactioncount", + "value": "1" + }, + { + "name": "last-modified", + "value": "Fri, 14 Aug 2020 14:28:16 GMT" + }, + { + "name": "pragma", + "value": "no-cache" + }, + { + "name": "reversegeocodetransactioncount", + "value": "0" + }, + { + "name": "server", + "value": "Apache-Coyote/1.1" + }, + { + "_fromType": "array", + "name": "set-cookie", + "value": "JSESSIONID=E91FC02E5CF83DDD961FAAA8E50373B1; Path=/; HttpOnly; Secure" + }, + { + "name": "status", + "value": "success" + }, + { + "name": "transactionweight", + "value": "1.0" + }, + { + "name": "strict-transport-security", + "value": "max-age=0" + } + ], + "headersSize": 604, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2020-08-14T14:28:16.418Z", + "time": 424, + "timings": { + "blocked": -1, + "connect": -1, + "dns": -1, + "receive": 0, + "send": 0, + "ssl": -1, + "wait": 424 + } + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/spec/recordings/MapQuest-Geocoder-Provider_1759071530/receives-correct-geodecoding-results_1602611079/recording.har b/spec/recordings/MapQuest-Geocoder-Provider_1759071530/receives-correct-geodecoding-results_1602611079/recording.har new file mode 100644 index 0000000..bf679e3 --- /dev/null +++ b/spec/recordings/MapQuest-Geocoder-Provider_1759071530/receives-correct-geodecoding-results_1602611079/recording.har @@ -0,0 +1,163 @@ +{ + "log": { + "_recordingName": "MapQuest Geocoder Provider/receives correct geodecoding results", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "5.0.0" + }, + "entries": [ + { + "_id": "b8e3b1d9aa55c0dd7339774f6f9af07d", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + }, + { + "_fromType": "array", + "name": "user-agent", + "value": "node-fetch/1.0 (+https://github.com/bitinn/node-fetch)" + }, + { + "_fromType": "array", + "name": "accept-encoding", + "value": "gzip,deflate" + }, + { + "_fromType": "array", + "name": "connection", + "value": "close" + }, + { + "name": "host", + "value": "www.mapquestapi.com" + } + ], + "headersSize": 300, + "httpVersion": "HTTP/1.1", + "method": "GET", + "queryString": [ + { + "name": "location", + "value": "48.8631507,2.388911" + } + ], + "url": "https://www.mapquestapi.com/geocoding/v1/reverse?location=48.8631507%2C2.388911" + }, + "response": { + "bodySize": 1047, + "content": { + "mimeType": "application/json;charset=UTF-8", + "size": 1047, + "text": "{\"info\":{\"statuscode\":0,\"copyright\":{\"text\":\"\\u00A9 2020 MapQuest, Inc.\",\"imageUrl\":\"http://api.mqcdn.com/res/mqlogo.gif\",\"imageAltText\":\"\\u00A9 2020 MapQuest, Inc.\"},\"messages\":[]},\"options\":{\"maxResults\":1,\"thumbMaps\":true,\"ignoreLatLngInput\":false},\"results\":[{\"providedLocation\":{\"latLng\":{\"lat\":48.8631507,\"lng\":2.388911}},\"locations\":[{\"street\":\"8 Avenue Gambetta\",\"adminArea6\":\"\",\"adminArea6Type\":\"Neighborhood\",\"adminArea5\":\"Paris\",\"adminArea5Type\":\"City\",\"adminArea4\":\"\",\"adminArea4Type\":\"County\",\"adminArea3\":\"Ile-de-France\",\"adminArea3Type\":\"State\",\"adminArea1\":\"FR\",\"adminArea1Type\":\"Country\",\"postalCode\":\"75020\",\"geocodeQualityCode\":\"P1AAA\",\"geocodeQuality\":\"POINT\",\"dragPoint\":false,\"sideOfStreet\":\"N\",\"linkId\":\"0\",\"unknownInput\":\"\",\"type\":\"s\",\"latLng\":{\"lat\":48.863116,\"lng\":2.38878},\"displayLatLng\":{\"lat\":48.863116,\"lng\":2.38878},\"mapUrl\":\"http://www.mapquestapi.com/staticmap/v5/map?key=Fmjtd|luurnu6al1,bg=o5-9wbg94&type=map&size=225,160&locations=48.8631163,2.38878|marker-sm-50318A-1&scalebar=true&zoom=15&rand=69343397\"}]}]}" + }, + "cookies": [ + { + "httpOnly": true, + "name": "JSESSIONID", + "path": "/", + "secure": true, + "value": "085B8BDD5465DE9C0888D4694DAC0059" + } + ], + "headers": [ + { + "name": "date", + "value": "Fri, 14 Aug 2020 14:31:37 GMT" + }, + { + "name": "content-type", + "value": "application/json;charset=UTF-8" + }, + { + "name": "content-length", + "value": "1047" + }, + { + "name": "connection", + "value": "close" + }, + { + "name": "access-control-allow-methods", + "value": "OPTIONS,GET,POST" + }, + { + "name": "access-control-allow-origin", + "value": "*" + }, + { + "name": "cache-control", + "value": "no-cache, must-revalidate" + }, + { + "name": "expires", + "value": "Mon, 20 Dec 1998 01:00:00 GMT" + }, + { + "name": "geocodetransactioncount", + "value": "0" + }, + { + "name": "last-modified", + "value": "Fri, 14 Aug 2020 14:31:37 GMT" + }, + { + "name": "pragma", + "value": "no-cache" + }, + { + "name": "reversegeocodetransactioncount", + "value": "1" + }, + { + "name": "server", + "value": "Apache-Coyote/1.1" + }, + { + "_fromType": "array", + "name": "set-cookie", + "value": "JSESSIONID=085B8BDD5465DE9C0888D4694DAC0059; Path=/; HttpOnly; Secure" + }, + { + "name": "status", + "value": "success" + }, + { + "name": "transactionweight", + "value": "1.0" + }, + { + "name": "strict-transport-security", + "value": "max-age=0" + } + ], + "headersSize": 604, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2020-08-14T14:31:37.001Z", + "time": 523, + "timings": { + "blocked": -1, + "connect": -1, + "dns": -1, + "receive": 0, + "send": 0, + "ssl": -1, + "wait": 523 + } + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/spec/recordings/MapQuest-Geocoder-Provider_1759071530/receives-error-when-the-API-key-is-bad_860720186/recording.har b/spec/recordings/MapQuest-Geocoder-Provider_1759071530/receives-error-when-the-API-key-is-bad_860720186/recording.har new file mode 100644 index 0000000..1d45688 --- /dev/null +++ b/spec/recordings/MapQuest-Geocoder-Provider_1759071530/receives-error-when-the-API-key-is-bad_860720186/recording.har @@ -0,0 +1,114 @@ +{ + "log": { + "_recordingName": "MapQuest Geocoder Provider/receives error when the API key is bad", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "5.0.0" + }, + "entries": [ + { + "_id": "23726ea12e730e66843c80cff1bb6610", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + }, + { + "_fromType": "array", + "name": "user-agent", + "value": "node-fetch/1.0 (+https://github.com/bitinn/node-fetch)" + }, + { + "_fromType": "array", + "name": "accept-encoding", + "value": "gzip,deflate" + }, + { + "_fromType": "array", + "name": "connection", + "value": "close" + }, + { + "name": "host", + "value": "www.mapquestapi.com" + } + ], + "headersSize": 294, + "httpVersion": "HTTP/1.1", + "method": "GET", + "queryString": [ + { + "name": "location", + "value": "1600 Pennsylvania Ave, Washington, DC" + } + ], + "url": "https://www.mapquestapi.com/geocoding/v1/address?location=1600+Pennsylvania+Ave%2C+Washington%2C+DC" + }, + "response": { + "bodySize": 50, + "content": { + "mimeType": "text/plain", + "size": 50, + "text": "The AppKey submitted with this request is invalid." + }, + "cookies": [], + "headers": [ + { + "name": "date", + "value": "Fri, 14 Aug 2020 14:33:19 GMT" + }, + { + "name": "content-type", + "value": "text/plain" + }, + { + "name": "content-length", + "value": "50" + }, + { + "name": "connection", + "value": "close" + }, + { + "name": "access-control-allow-origin", + "value": "*" + }, + { + "name": "access-control-allow-methods", + "value": "OPTIONS,GET,POST" + }, + { + "name": "strict-transport-security", + "value": "max-age=0" + } + ], + "headersSize": 222, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 403, + "statusText": "Forbidden" + }, + "startedDateTime": "2020-08-14T14:33:18.658Z", + "time": 504, + "timings": { + "blocked": -1, + "connect": -1, + "dns": -1, + "receive": 0, + "send": 0, + "ssl": -1, + "wait": 504 + } + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/spec/recordings/Mapbox-Geocoder-Provider_114047645/receives-correct-geocoding-results_3640432360/recording.har b/spec/recordings/Mapbox-Geocoder-Provider_114047645/receives-correct-geocoding-results_3640432360/recording.har new file mode 100644 index 0000000..c472f1b --- /dev/null +++ b/spec/recordings/Mapbox-Geocoder-Provider_114047645/receives-correct-geocoding-results_3640432360/recording.har @@ -0,0 +1,163 @@ +{ + "log": { + "_recordingName": "Mapbox Geocoder Provider/receives correct geocoding results", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "5.0.0" + }, + "entries": [ + { + "_id": "30081e229aee3d9a6201d55010f0f3ad", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + }, + { + "_fromType": "array", + "name": "user-agent", + "value": "node-fetch/1.0 (+https://github.com/bitinn/node-fetch)" + }, + { + "_fromType": "array", + "name": "accept-encoding", + "value": "gzip,deflate" + }, + { + "_fromType": "array", + "name": "connection", + "value": "close" + }, + { + "name": "host", + "value": "api.mapbox.com" + } + ], + "headersSize": 384, + "httpVersion": "HTTP/1.1", + "method": "GET", + "queryString": [ + { + "name": "limit", + "value": "5" + } + ], + "url": "https://api.mapbox.com/geocoding/v5/mapbox.places/1600%20Pennsylvania%20Ave,%20Washington,%20DC.json?limit=5" + }, + "response": { + "bodySize": 2319, + "content": { + "_isBinary": true, + "mimeType": "application/vnd.geo+json; charset=utf-8", + "size": 2319, + "text": "[\"1f8b0800000000000003\",\"ed98db4ee33818805fc5cad58c94093ec476d23ba6cc68e762194680b81821e4262ef54e1b671c8752211e685f639f6c7f97969636740b7bba411555edfc67ff9fed7017f959ada35ef4592bdf3addb7e3b12ebcb15514473f5bed6651ef7b4404c630ae755535b3f18daa8c82a1bad1f03d55cdc854d77eae5116d1651c0d1f6c35a07a179912acabb2847193604c31c68c519ae5390585a7de838fb12af4d5c3f4f7a55e30eaf45883e702e649fcf8a0b78ccdeb5b0fa393b510d1e18d46a79f1e8d566aa2170aa8432e46178fa9c4e8c834de99c2233b445094763200c179f0313aaf8cd7253af5ca43927154e8ca6b07f17e9022c9338ad39865492673ca21f0dad95a3b6f423dee225514ad53c52c14a58647b7660256a2fb38bad676a27d28f8ddb22c27d6543e38b0d695a69abbebf4721f64aa871a2c6b5e69733d1a5837b2b64c68ce5391adeaf451b94acf50dfb8621cbc2f746adbf8c2963a21324b894c4926b22ccfb274adc4f322aca984da26524896129c3142538179109f9a1fa6545e81cc374156faab2aaf8c387d0d2d9790148b34c594a4792e734637cd30ce21b060ab1959e7af42a8307f7efae1a8bf72d0b5742b57856d2ba872427221b30cf3940b2629cdb77ce14d376db3f2f1b405ee2fd72a68923c1729a39c3022f6e871d0d8e86f0ccb4b722a367b67a3149487d68000ae6de89a6804795b481c35105b8c9643101adad6353f5be5421c6c580a018b38842815a7b814434cb466203756553951ee47d4f3aed59b946d43737c111a775192b391461723708d7eb16da337b1db781ca3e74ceec9a1d8e610482a82e2d522a24e0f55abd745ff7a6b0085bd83ed3f17dada162113cc04e7624e6f2e250c2e5f447f97813d360092f2350a8fecb4f2f0d7c53e06ecb9c4544ac1e916fbe28dfd67d85f9e723423384f332e89608c3f1c4faf39e7601fc0b9603b8e1067edd0db7a8dc28eee45c790c868aa1bbfd751f844632f1821c51d30fe3d8ffde7ec6f1195ca051042be0aa827faf71d578c7f0cb0aefe58f215866f7cede64b3202db509a659c51c279f67ff3b5e71df341f4f5d7cc1712b5e5aabfe7fd9564195d5c2d492a5e865287fe6b507abbacfeb74051914aa049c870f6cb57bf9861b0c43b2eae6b4499d06ab51d4328e56eacf6652a461f9d9e80b3d0e4abf54279c698dcd5ec84d244a414e7324e65c225e44f5ed4edcf187892e2fc26fd0a04a08d53b1d6877032aef2ec608049f8504205958c43abac54e775d8448048413995340571f8c1b6180004895c4370dbf502835c1226e15522979d30418d5807021787bb19fb971a1f564779e06dd0ceffc5d18b8ebf9e7de97feaa13f7e87cd9162f4abaa07f616c17b1032be414d5bd763a35d93a0c3f118395821988585d4ee4697093a6f7400d7c3bb160a2121137406bf6900da5b98d74b8b67da4d9a207b0aaaa6d0e8ddc8fbbae91d1c4ca7d36432174a0a3b395003dbfa0398680ede27e82c58067fb5adc055082bd834d5d03a380e20070813855652a66ad044cd50653d1a68d0095321c693af5fde35ef111079634aa8c660863e3fbe0f26d1fd9f6f19c05303120000\"]" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/vnd.geo+json; charset=utf-8" + }, + { + "name": "transfer-encoding", + "value": "chunked" + }, + { + "name": "connection", + "value": "close" + }, + { + "name": "date", + "value": "Thu, 13 Aug 2020 22:45:54 GMT" + }, + { + "name": "x-powered-by", + "value": "Express" + }, + { + "name": "access-control-allow-origin", + "value": "*" + }, + { + "name": "access-control-expose-headers", + "value": "x-rate-limit-interval,x-rate-limit-limit,x-rate-limit-remaining,x-rate-limit-reset" + }, + { + "name": "cache-control", + "value": "max-age=604800" + }, + { + "name": "x-rate-limit-limit", + "value": "600" + }, + { + "name": "x-rate-limit-interval", + "value": "60" + }, + { + "name": "x-rate-limit-reset", + "value": "1597358814" + }, + { + "name": "last-modified", + "value": "Tue, 11 Aug 2020 20:26:36 GMT" + }, + { + "name": "etag", + "value": "\"c403e3c1ac6e74313bdf5900b6fb1885\"" + }, + { + "name": "content-encoding", + "value": "gzip" + }, + { + "name": "vary", + "value": "Accept-Encoding" + }, + { + "name": "x-cache", + "value": "Miss from cloudfront" + }, + { + "name": "via", + "value": "1.1 41dc616ebfce47f0587493804969040a.cloudfront.net (CloudFront)" + }, + { + "name": "x-amz-cf-pop", + "value": "CDG3-C2" + }, + { + "name": "x-amz-cf-id", + "value": "i2y6vfTB4FZ7qj4efugVrwZWHp7e6U_fanypH37d1mJ22qJ6bRuHoA==" + } + ], + "headersSize": 757, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2020-08-13T22:45:54.128Z", + "time": 592, + "timings": { + "blocked": -1, + "connect": -1, + "dns": -1, + "receive": 0, + "send": 0, + "ssl": -1, + "wait": 592 + } + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/spec/recordings/Mapbox-Geocoder-Provider_114047645/receives-correct-geodecoding-results_1602611079/recording.har b/spec/recordings/Mapbox-Geocoder-Provider_114047645/receives-correct-geodecoding-results_1602611079/recording.har new file mode 100644 index 0000000..9182d42 --- /dev/null +++ b/spec/recordings/Mapbox-Geocoder-Provider_114047645/receives-correct-geodecoding-results_1602611079/recording.har @@ -0,0 +1,167 @@ +{ + "log": { + "_recordingName": "Mapbox Geocoder Provider/receives correct geodecoding results", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "5.0.0" + }, + "entries": [ + { + "_id": "4caa3833527d0cf02613027b30e3e02d", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + }, + { + "_fromType": "array", + "name": "user-agent", + "value": "node-fetch/1.0 (+https://github.com/bitinn/node-fetch)" + }, + { + "_fromType": "array", + "name": "accept-encoding", + "value": "gzip,deflate" + }, + { + "_fromType": "array", + "name": "connection", + "value": "close" + }, + { + "name": "host", + "value": "api.mapbox.com" + } + ], + "headersSize": 372, + "httpVersion": "HTTP/1.1", + "method": "GET", + "queryString": [ + { + "name": "types", + "value": "address" + }, + { + "name": "limit", + "value": "5" + } + ], + "url": "https://api.mapbox.com/geocoding/v5/mapbox.places/2.388911,48.8631507.json?types=address&limit=5" + }, + "response": { + "bodySize": 1519, + "content": { + "_isBinary": true, + "mimeType": "application/vnd.geo+json; charset=utf-8", + "size": 1519, + "text": "[\"1f8b0800000000000003\",\"ed565d4fdb3014fd2b969f8654d2d8f972fa86d89890c6e8187b4208b9c9857a4be2603b850af17fc6df187f6cd785405b3689ed016d1252a52a57f79c7beef189952beae62dd011dd01e93a03dbbaaaa0704a377440cf3b30733a3ae2412444ced820168148239684d9f1809ede212c365c515522872c4b7cb6014f44c652c1592898602132ad0ec1425bc9024eeeca473d9022ab810a66b229b0ceb0cde8168c537eca159545d11959a024da6ad5387a8dcc70e9f0796b064d07e4bdac27e09c7c98d0c8da0f669cac750c4896843c246369941d901db39839a005340e4cbfb41069bf7414a3ba33d035386fca55bfd378a104815a9b5235d22d1cf9051ac5f67b7a410b487327bf37b00175369d6833d5ba0c188f2311a6393acf63ceb9f7f1427d53a5c4fd46f45314b3888b9c3e7830befd6e60f3832ca652594073ee595b6d5da14b08181369c279c272a44d59143e6217663c422a5dc84ab9f91284f13c89e2751178c6195fe2e1a19b12698c6e4a652dd4e826d1a7772e2f29f26713b0388b73244843fccfa2689d3bf7053bd5c69d78f93e3f079b59b2b4f02a6ba1bb06cf26c0f53078f84b441ab3345de765315f273e358facf751b83e7e20ee73cd44c2c228ca127c051296f29708f6d8f391adeeacb30ec8deed8d533305e649c023f29bcee7053d89ef93caf3ec8f73be025e8d79f41af3ff2ee6110f451ef330ceb224cb63f112313fc0abf92d58b2554bb4148c5d0f38274f5a9e9becfe128e92fc2fa2bd8c5ec9f6eb0dfeef471bcf5b3a67d4a45b7cd28ce8c7fdc3dded7723f2e386709f9d3dd94ef425c14411e52cb15ddb563e5b01d9aa2a62f030b18a070e66066540be58f066b8a9b2c48b21ca63265ff19389388d75e8190fc1d4d6f77e46a8c28bf9cdd4b9d68e86c38b8b8ba05e340585ae8772a23b37c4821d6e04e4d033e3bc563738cacbf29caa39d5a6967e0794497ceaa46a2ca9e59c34da910920c697bcc6f1feee1bbb41f0d59ba9124a3299931ddd197bde490301bdfe0909438741f3090000\"]" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/vnd.geo+json; charset=utf-8" + }, + { + "name": "transfer-encoding", + "value": "chunked" + }, + { + "name": "connection", + "value": "close" + }, + { + "name": "date", + "value": "Thu, 13 Aug 2020 22:50:04 GMT" + }, + { + "name": "x-powered-by", + "value": "Express" + }, + { + "name": "access-control-allow-origin", + "value": "*" + }, + { + "name": "access-control-expose-headers", + "value": "x-rate-limit-interval,x-rate-limit-limit,x-rate-limit-remaining,x-rate-limit-reset" + }, + { + "name": "cache-control", + "value": "max-age=604800" + }, + { + "name": "x-rate-limit-limit", + "value": "600" + }, + { + "name": "x-rate-limit-interval", + "value": "60" + }, + { + "name": "x-rate-limit-reset", + "value": "1597359064" + }, + { + "name": "last-modified", + "value": "Tue, 11 Aug 2020 20:26:36 GMT" + }, + { + "name": "etag", + "value": "\"5a00586e9671c374ddca5293cd31d8a8\"" + }, + { + "name": "content-encoding", + "value": "gzip" + }, + { + "name": "vary", + "value": "Accept-Encoding" + }, + { + "name": "x-cache", + "value": "Miss from cloudfront" + }, + { + "name": "via", + "value": "1.1 9f63706579db7391acaa39a0dddcff5e.cloudfront.net (CloudFront)" + }, + { + "name": "x-amz-cf-pop", + "value": "CDG3-C2" + }, + { + "name": "x-amz-cf-id", + "value": "DPUT-1WE2wtLS3RZCtRCfaEw5Ogz6eNMO5K0OYLwkF0pwHGcgpkRgA==" + } + ], + "headersSize": 757, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2020-08-13T22:50:04.032Z", + "time": 129, + "timings": { + "blocked": -1, + "connect": -1, + "dns": -1, + "receive": 0, + "send": 0, + "ssl": -1, + "wait": 129 + } + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/spec/recordings/Mapbox-Geocoder-Provider_114047645/receives-error-when-the-API-key-is-bad_860720186/recording.har b/spec/recordings/Mapbox-Geocoder-Provider_114047645/receives-error-when-the-API-key-is-bad_860720186/recording.har new file mode 100644 index 0000000..1419819 --- /dev/null +++ b/spec/recordings/Mapbox-Geocoder-Provider_114047645/receives-error-when-the-API-key-is-bad_860720186/recording.har @@ -0,0 +1,147 @@ +{ + "log": { + "_recordingName": "Mapbox Geocoder Provider/receives error when the API key is bad", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "5.0.0" + }, + "entries": [ + { + "_id": "30081e229aee3d9a6201d55010f0f3ad", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + }, + { + "_fromType": "array", + "name": "user-agent", + "value": "node-fetch/1.0 (+https://github.com/bitinn/node-fetch)" + }, + { + "_fromType": "array", + "name": "accept-encoding", + "value": "gzip,deflate" + }, + { + "_fromType": "array", + "name": "connection", + "value": "close" + }, + { + "name": "host", + "value": "api.mapbox.com" + } + ], + "headersSize": 299, + "httpVersion": "HTTP/1.1", + "method": "GET", + "queryString": [ + { + "name": "limit", + "value": "5" + } + ], + "url": "https://api.mapbox.com/geocoding/v5/mapbox.places/1600%20Pennsylvania%20Ave,%20Washington,%20DC.json?limit=5" + }, + "response": { + "bodySize": 135, + "content": { + "_isBinary": true, + "mimeType": "application/json; charset=utf-8", + "size": 135, + "text": "[\"1f8b0800000000000003\",\"ab56ca4d2d2e4e4c4f55b252f2cb2f51702c2dc9c82fcaac4a4d51d055f0cc2b4bccc94c5108c9cf4ecd53aa050000841cd42c000000\"]" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json; charset=utf-8" + }, + { + "name": "transfer-encoding", + "value": "chunked" + }, + { + "name": "connection", + "value": "close" + }, + { + "name": "date", + "value": "Thu, 13 Aug 2020 22:57:32 GMT" + }, + { + "name": "x-powered-by", + "value": "Express" + }, + { + "name": "access-control-allow-origin", + "value": "*" + }, + { + "name": "access-control-expose-headers", + "value": "x-rate-limit-interval,x-rate-limit-limit,x-rate-limit-remaining,x-rate-limit-reset" + }, + { + "name": "cache-control", + "value": "max-age=604800" + }, + { + "name": "etag", + "value": "W/\"2c-d41c8400\"" + }, + { + "name": "content-encoding", + "value": "gzip" + }, + { + "name": "vary", + "value": "Accept-Encoding" + }, + { + "name": "x-cache", + "value": "Error from cloudfront" + }, + { + "name": "via", + "value": "1.1 8517cf95bad5514a037b3099aa429186.cloudfront.net (CloudFront)" + }, + { + "name": "x-amz-cf-pop", + "value": "CDG3-C2" + }, + { + "name": "x-amz-cf-id", + "value": "O5wUM40p7PL4AY__Ju41V01wTZEXIwMWA-DDDr5YgU7QBNZj0oY5PA==" + } + ], + "headersSize": 601, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 401, + "statusText": "Unauthorized" + }, + "startedDateTime": "2020-08-13T22:57:32.012Z", + "time": 77, + "timings": { + "blocked": -1, + "connect": -1, + "dns": -1, + "receive": 0, + "send": 0, + "ssl": -1, + "wait": 77 + } + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/spec/recordings/OpenCage-Geocoder-Provider_1524131378/receives-correct-geocoding-results_3640432360/recording.har b/spec/recordings/OpenCage-Geocoder-Provider_1524131378/receives-correct-geocoding-results_3640432360/recording.har new file mode 100644 index 0000000..b6b2a58 --- /dev/null +++ b/spec/recordings/OpenCage-Geocoder-Provider_1524131378/receives-correct-geocoding-results_3640432360/recording.har @@ -0,0 +1,139 @@ +{ + "log": { + "_recordingName": "OpenCage Geocoder Provider/receives correct geocoding results", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "5.0.0" + }, + "entries": [ + { + "_id": "5926205db8a399d6edc02640d8616cf2", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + }, + { + "_fromType": "array", + "name": "user-agent", + "value": "node-fetch/1.0 (+https://github.com/bitinn/node-fetch)" + }, + { + "_fromType": "array", + "name": "accept-encoding", + "value": "gzip,deflate" + }, + { + "_fromType": "array", + "name": "connection", + "value": "close" + }, + { + "name": "host", + "value": "api.opencagedata.com" + } + ], + "headersSize": 317, + "httpVersion": "HTTP/1.1", + "method": "GET", + "queryString": [ + { + "name": "q", + "value": "1600 Pennsylvania Ave, Washington, DC" + }, + { + "name": "limit", + "value": "5" + } + ], + "url": "https://api.opencagedata.com/geocode/v1/json?q=1600+Pennsylvania+Ave%2C+Washington%2C+DC&limit=5" + }, + "response": { + "bodySize": 1972, + "content": { + "_isBinary": true, + "mimeType": "application/json; charset=utf-8", + "size": 1972, + "text": "[\"1f8b0800000000000003ed596d6fdc3612fe2b82aea8bfd83229529468c0280c6f92a6ad5f6ac7080ed742e04adc5dc592b8a6286ff602fff79bd16a6dafdf1a7b9bdee59a2f86c519ce90f3f23ca3d5273f37595be9da295798dadff127ce4d9b9ded6d33d575a6c63a574e0599a9b6d5b4f037fdb2c874dde8c6dff9d727bf5695862d8dd69e72ce16c3168d78e3b6c835e8b6b67cca6066755eb8c6bffa7dd3b7ca81a54f60be2a9cbf134684c0a2ae545117f51816b894b8d06890d248c64cb09090ab6ead2ddde23caaaecde2220d1a1b1c9c763615ecf159f25b4bc8907811ddf0b80c888c936463c33bc44ba10b3f164b0d011a22909433011aef7d70f3faed71672c336dede6a04d292114f636ae3b3a3ca3dac19b93537c484ecf7e6294324218e71cd40e14c4a49e689583f8f5014daa56c4e76394689b29672c5affe8ef6c2591880423014de8a60f9eb88823c6c34008010e8e4e0f50112397aec677369b0518e3c659ad5da5a681b1e36d54fc61a6e6bb0c621646719cfc0344bb34de6649900826f8f6560c77e582c57018889ffe2cbba8b85debd9e3d6be2fd55cdb66f7f05e253c6cf1870a12b5bbb4f37d559a7af7dad8138786a09c1da6075c625cac1e2fb3bf77f0eae4edfe1ea683500987383c3a79f7e3ab93c3b497a020c4149ea14ec209fcfbfee8e497010a48974e4c6ed1b82253653ab6a69d423162a9f907af06fbfeefa001921216330315bf0309cb5a6ba1cee77802553a6d6b288fb499574353763bcf4ebff3a1e0739d151558ad943d077f01f8ce8b4655c362dcdeec0009ea6f42e8aa32852e2dbadac395a231e9c22ba80cfa851a5ad916d9f575fa063dab0ba773ef144bb5f106a62c95c5d2850394ba712954a6a98aba8700b845d30edb1a1bd1df07a7fef542ea4cba10506cd0eb43e281160fe9a8b08deb8cb889691b55e74ddae8a9b28b1a074588daa854d871bfb579c232f89b8fd4adff13501a6b3351cd0494f28baca23cab226d133791f2838b67a070510c4be5ef44221021a0805179518f0c863db7c5a54e3b30b3c57882c747313c1eebba6ee6e5a5aa0be5ed5deabad5bd3075f32946cad9b63ec7cb4cb5ced3026d54d349570a6ddd1558d17440a5a670258ccd028d28270202a2a0a40dc612caa29790848620c98acb62b9444396104c4eeb6e2952122608681dc4dd7510c642260f3a089350de7110c68910f71c80f558902bf0e08a4affdbd4dd3dfa0ad9ebea466d1fea59fa4f63cf3b28984100d2bccfa6198de064904aa8ae2dca39e67fb906d0df21e81681658cdec45897f6a65f0dde61fc6613e5d8ccd8bc6bcefe1f7f689c335530b62ad341a51a6003d01d02c82ef46a3004a0d9b86b205f2040cc89ec717b810400992106cfb46e32d3f7f45912862bfa00aab1405fc044538845ed3a7f6f4f8f524685d8a2a92aa713b51576fd0577ba27619d640f4429e0b71e1b8badd9551a2cf5f5d43f66065ab7eeb2e91fe295bc3ee09d0c18a5dbbbdaa666745f69d9f16db35cc37dc710fe4c7b6f34c0a8de68bcfd85005043552556933f284a8053ef5875992d0d14c50249f68d55a5f72388d1e2d434aef71092988bad64c171cf6f9f9e140705d646e6f032fba66c01ded452bcbc0b006997867a840c99c1126476646c0523857ec4eda6f71ec0018ace997ad31bec7b37c7ddf49e0823a04aa5bb60af548760095bad0e26220ad5f1b923058381210a481c4ab13a52c4bd06cc1c11092221385f63a200dc9094c434960f4d14e5a58826eac189228e8002839845cb89424a983044ccd7992822c125832985df266719251190731c1006075d77a258b5f6f28902ed2c278aded81387fe3651fcdf4f141f2c190fe7a13c3f9f3419e596ad4c1451fc8713c5f307846e0c586f4060fc850342726f4088c3af634068a6a0d904c3b61c0619e44f7fd680202319f26b44effa9a0b221f1d106414273c5cdd204592fc7503c2a20d6f58cd1b04fbc1179f1c6efc613e35d43644d64e8c59f2aef76bab2c600e0e07ca4d1e1d02562607c2a3ffce0c008e9f4fff08fe4cace63ea6a17c1efd47511086d0410fd37fb8e151127001d5bf16fd732a0970397b98fea3687af108fd0b06e3098ecc1dfd2784b130809eb8a1fff5683a1171cf9f22e46bd034d8b94dd360ec7137df68fa6f40d31799cd3ecc483d0a1d2717e717ab342d5efae2ef1dbeffc6e17f19875700d781c9f32698420232ffeb7eed7ebaa49e477a902633ab5789f80e11264f1321b8bd4b842fa0400056b6c28080afcfe0bf08e82de0549047e88f6c78249084acc77e02889a481e3ff8737a3993e463f630fb5111268108973fa7432f4534805ef973d84fd29888052d1112462f66bfcece2df643638fbbf9c67e7f03f6b36d3e39a72dadec90cf3f5ef055f64bfe375f525ffc2bf6d74b7056156530d2ba0c20dd68e433de51a58c229edcfed5914826d963afa8b1a402de6e6e309a521947f20b50e9b45499bec5a50b44fe4264bade4b225fe5c63569b043d8db2c88387b855fa7f1186db3e02b3c4a886553e9a651633cd8d1cf3d68ce536c465be1693ef9c3d28c6fc13f3e06773f82e304302b1cbe61df68f62bdd47f223d8b08f6eb0e227aa3ec77a7b6dacd73670554fd5de52c3db3b7eeb2fda028e524dbbe35a0d77cf53b40cfbde4dda4d8f326faf1dc3db72483c1aed500694e8bd39788719ead501eb3ef6fd0c0513e27767076340995e7f6ce757ff015f2c82353a200000\"]" + }, + "cookies": [], + "headers": [ + { + "name": "date", + "value": "Thu, 13 Aug 2020 15:13:46 GMT" + }, + { + "name": "server", + "value": "Apache" + }, + { + "name": "access-control-allow-origin", + "value": "*" + }, + { + "name": "x-ratelimit-limit", + "value": "2500" + }, + { + "name": "x-ratelimit-remaining", + "value": "2499" + }, + { + "name": "x-ratelimit-reset", + "value": "1597363200" + }, + { + "name": "vary", + "value": "Accept-Encoding" + }, + { + "name": "content-encoding", + "value": "gzip" + }, + { + "name": "content-length", + "value": "1972" + }, + { + "name": "content-type", + "value": "application/json; charset=utf-8" + }, + { + "name": "strict-transport-security", + "value": "max-age=31536000; includeSubDomains; preload" + }, + { + "name": "connection", + "value": "close" + } + ], + "headersSize": 380, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2020-08-13T15:13:46.811Z", + "time": 464, + "timings": { + "blocked": -1, + "connect": -1, + "dns": -1, + "receive": 0, + "send": 0, + "ssl": -1, + "wait": 464 + } + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/spec/recordings/OpenCage-Geocoder-Provider_1524131378/receives-correct-geodecoding-results_1602611079/recording.har b/spec/recordings/OpenCage-Geocoder-Provider_1524131378/receives-correct-geodecoding-results_1602611079/recording.har new file mode 100644 index 0000000..a5ae5a7 --- /dev/null +++ b/spec/recordings/OpenCage-Geocoder-Provider_1524131378/receives-correct-geodecoding-results_1602611079/recording.har @@ -0,0 +1,139 @@ +{ + "log": { + "_recordingName": "OpenCage Geocoder Provider/receives correct geodecoding results", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "5.0.0" + }, + "entries": [ + { + "_id": "b817fbe792a368ef82b2256a30a81567", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + }, + { + "_fromType": "array", + "name": "user-agent", + "value": "node-fetch/1.0 (+https://github.com/bitinn/node-fetch)" + }, + { + "_fromType": "array", + "name": "accept-encoding", + "value": "gzip,deflate" + }, + { + "_fromType": "array", + "name": "connection", + "value": "close" + }, + { + "name": "host", + "value": "api.opencagedata.com" + } + ], + "headersSize": 289, + "httpVersion": "HTTP/1.1", + "method": "GET", + "queryString": [ + { + "name": "q", + "value": "48.8631507,2.388911" + }, + { + "name": "limit", + "value": "5" + } + ], + "url": "https://api.opencagedata.com/geocode/v1/json?q=48.8631507%2C2.388911&limit=5" + }, + "response": { + "bodySize": 1207, + "content": { + "_isBinary": true, + "mimeType": "application/json; charset=utf-8", + "size": 1207, + "text": "[\"1f8b08000000000000037d556d6fdb3610fe2b020b341fe6c8a2dee5211882c409d2cd499734d887b5106889b6b848a44a5275dc20ff7d77b49cba4d370408ac7b79eeedb9e313a95535745c5a66859264461a6b7b339b4e55cf65c5d6bc6696f995eaa6ac1764425a517169b821b3bf9f88641d0717c3b9c7acd562392088b71e44cdc176d0edff01569ad7c21af2fc694234b380f404f09db0641626410042de3121855c83202e7214180e5a9a1459944661103c3bd9d0da5d3e4c4ab52bc420d8f9e2ce6132f02171fe71088265e025f4c88b333fa4591a1c1d79d758148620e1681046471e2dfc34c80334981388b2b8bc052c12d1fbf33f9384669486312dc075c1a056d9705683fadd35cdf990667d8d1aae2b6695c6141ea182342968e6675934215b324b435ac469ee674906f037770b3483ec79f97dd7369b8d8f9d3356736e3bd6fb4aafa76838957cf3060427349dc6b99fa7110da7a11fe57996bf6dd9966b7372fd6a0a3fc7fbad83269dec51de76ad922723d47f85c0aedc5f978bb8c0cc355fefbb3ebfbfbd793f8790340920fcc52db6d6fdfc6b7ef7617e7b5d1e582428beb9fde31cbe828022a8c1091a2b2ad6966bad861e0880e3258bf9f919f90416a06941582960d92c827e5683d640ae2d8667ade55a029d4ab3ed96aa45572058cd2bd10162c7f403c49ac05f63bbb604e60b0b8ee4ed9bc730383dfb1514c2a872078ec58c02095ba24505b2028a9fecb93f1fb4822f03d82d37b60432a84ec8719b286886e52091d3e40c629117416955b95350e4fa2e59b0fa388401abc85e52ae8436d621d9460d86c9da9486f74cefb8457cecd9aa656be75be75105ff6bbefcf67b9501da9aab8699068c86a0b05b9d859f8b24dc545f8be52a790483cf62d9328803cc0f219856ac1672a5b0a5b5165f78e9ae8316ebc615d1735e9702450fddb471731ba46382306e93590f3962c56e5dc322ca42289301ef14760866386af2244f4153892f622f2a688ac6920df6d0302f42dc7877037e0c10c5499aff3440944471fe7d8028ceb2fc5580280962080011ace8f857255d1d0773eef9f43d83fa70fa6a03d597f5381ab55a41563017e007d4197c93c05574c7e59700c4d8b846695b8ea067b010d8ba4dc36cb451ba760b34fe2006585435bcf6ff019e286d7c0bf7122840304538a03d6428ad73b9babb29239aa6c7b4646ddfb0e310fc2f90baaf3491d39c82aa84f3c4d74a23fb9783686bcc14c476dbf3ef45d56e45f6c5570a9646bad68f7d71c2415a8775a199ac0e44fb5d5a695c3a2880e3322d39b21737a957add8ad3bd6295f4099f4ee9d004d8c1d51b2043a497667823bce0741c55b7e5cf3e397c84eb98f7b757ef122aa054ea4b207d5ec2e21084ebf703970ef92416ed632e2ba2c5778df0114d614f64ce90e5e3a8ec73ef77e7098782e37cf014fbc976460f53aee5a33be45e329a5e9f8f28c17f5191f424c737033dd65efc8d47163e0e584a037bf8f27725be276ea0e537922cb56ad0f8e3c7efa3fbeb79089dd08485e1f588e12f71edf80c31986c10d68987c40125e28ed0d0668e0c138f616dee9fb2bb25b1348a5eb5dba9a4383eb1291c1ef43334c3c1a79a7c3da0bb12b34815a6634f62e171f901ba3398cfc715c3f78d0698cb1e10d6fcb97779d3eff0be5505bbfa5080000\"]" + }, + "cookies": [], + "headers": [ + { + "name": "date", + "value": "Thu, 13 Aug 2020 15:20:14 GMT" + }, + { + "name": "server", + "value": "Apache" + }, + { + "name": "access-control-allow-origin", + "value": "*" + }, + { + "name": "x-ratelimit-limit", + "value": "2500" + }, + { + "name": "x-ratelimit-remaining", + "value": "2498" + }, + { + "name": "x-ratelimit-reset", + "value": "1597363200" + }, + { + "name": "vary", + "value": "Accept-Encoding" + }, + { + "name": "content-encoding", + "value": "gzip" + }, + { + "name": "content-length", + "value": "1207" + }, + { + "name": "content-type", + "value": "application/json; charset=utf-8" + }, + { + "name": "strict-transport-security", + "value": "max-age=31536000; includeSubDomains; preload" + }, + { + "name": "connection", + "value": "close" + } + ], + "headersSize": 380, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2020-08-13T15:20:13.933Z", + "time": 285, + "timings": { + "blocked": -1, + "connect": -1, + "dns": -1, + "receive": 0, + "send": 0, + "ssl": -1, + "wait": 285 + } + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/spec/recordings/OpenCage-Geocoder-Provider_1524131378/receives-error-when-requesting-too-quickly_2039275820/recording.har b/spec/recordings/OpenCage-Geocoder-Provider_1524131378/receives-error-when-requesting-too-quickly_2039275820/recording.har new file mode 100644 index 0000000..fcdf476 --- /dev/null +++ b/spec/recordings/OpenCage-Geocoder-Provider_1524131378/receives-error-when-requesting-too-quickly_2039275820/recording.har @@ -0,0 +1,127 @@ +{ + "log": { + "_recordingName": "OpenCage Geocoder Provider/receives error when requesting too quickly", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "5.0.0" + }, + "entries": [ + { + "_id": "5926205db8a399d6edc02640d8616cf2", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + }, + { + "_fromType": "array", + "name": "user-agent", + "value": "node-fetch/1.0 (+https://github.com/bitinn/node-fetch)" + }, + { + "_fromType": "array", + "name": "accept-encoding", + "value": "gzip,deflate" + }, + { + "_fromType": "array", + "name": "connection", + "value": "close" + }, + { + "name": "host", + "value": "api.opencagedata.com" + } + ], + "headersSize": 317, + "httpVersion": "HTTP/1.1", + "method": "GET", + "queryString": [ + { + "name": "q", + "value": "1600 Pennsylvania Ave, Washington, DC" + }, + { + "name": "limit", + "value": "5" + } + ], + "url": "https://api.opencagedata.com/geocode/v1/json?q=1600+Pennsylvania+Ave%2C+Washington%2C+DC&limit=5" + }, + "response": { + "bodySize": 296, + "content": { + "_isBinary": true, + "mimeType": "application/json; charset=utf-8", + "size": 296, + "text": "[\"1f8b08000000000000037d904d4b03311086ff4a98f3d2ee87b56c6e45503c881e7a1359d2ec741bba49b6c9042da5ffdd49b1523c78cb84f77de6494ed07b9d2c3a5264bc03093ba229caf9dc4fe8b41ab057a466dadbb99a0c14301a8d2e6204f97e02a72c7225220a4514cc2665881892e991b3298cff0175c0de5084f3470101631a295379882c93f87c02ed1924efeab6008b31729b81010f0923193708f25e1c92d1fbf108e74bf1d819b7f5c1629ffb9bd10f370a799cfdf56051fa3444186e923f3717cf572e3ce4d5bc8176caed590d1e7d10296607e5c43521566fcf19675896949d2e4f08a808fb2e93b9b7dea542548d58a541d4655d8a6a21eb7b59b5e2e965cddd6b3c39f305b25ab4cba6a99b659b777b5263f7fb53e5f91bb7128e78bd010000\"]" + }, + "cookies": [], + "headers": [ + { + "name": "date", + "value": "Thu, 13 Aug 2020 15:26:19 GMT" + }, + { + "name": "server", + "value": "Apache" + }, + { + "name": "access-control-allow-origin", + "value": "*" + }, + { + "name": "vary", + "value": "Accept-Encoding" + }, + { + "name": "content-encoding", + "value": "gzip" + }, + { + "name": "content-length", + "value": "296" + }, + { + "name": "content-type", + "value": "application/json; charset=utf-8" + }, + { + "name": "strict-transport-security", + "value": "max-age=31536000; includeSubDomains; preload" + }, + { + "name": "connection", + "value": "close" + } + ], + "headersSize": 294, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 429, + "statusText": "OK" + }, + "startedDateTime": "2020-08-13T15:26:19.277Z", + "time": 70, + "timings": { + "blocked": -1, + "connect": -1, + "dns": -1, + "receive": 0, + "send": 0, + "ssl": -1, + "wait": 70 + } + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/spec/recordings/OpenCage-Geocoder-Provider_1524131378/receives-error-when-suspended_3006968534/recording.har b/spec/recordings/OpenCage-Geocoder-Provider_1524131378/receives-error-when-suspended_3006968534/recording.har new file mode 100644 index 0000000..8ddd56e --- /dev/null +++ b/spec/recordings/OpenCage-Geocoder-Provider_1524131378/receives-error-when-suspended_3006968534/recording.har @@ -0,0 +1,127 @@ +{ + "log": { + "_recordingName": "OpenCage Geocoder Provider/receives error when suspended", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "5.0.0" + }, + "entries": [ + { + "_id": "5926205db8a399d6edc02640d8616cf2", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + }, + { + "_fromType": "array", + "name": "user-agent", + "value": "node-fetch/1.0 (+https://github.com/bitinn/node-fetch)" + }, + { + "_fromType": "array", + "name": "accept-encoding", + "value": "gzip,deflate" + }, + { + "_fromType": "array", + "name": "connection", + "value": "close" + }, + { + "name": "host", + "value": "api.opencagedata.com" + } + ], + "headersSize": 317, + "httpVersion": "HTTP/1.1", + "method": "GET", + "queryString": [ + { + "name": "q", + "value": "1600 Pennsylvania Ave, Washington, DC" + }, + { + "name": "limit", + "value": "5" + } + ], + "url": "https://api.opencagedata.com/geocode/v1/json?q=1600+Pennsylvania+Ave%2C+Washington%2C+DC&limit=5" + }, + "response": { + "bodySize": 286, + "content": { + "_isBinary": true, + "mimeType": "application/json; charset=utf-8", + "size": 286, + "text": "[\"1f8b08000000000000037d904f4bc43010c5bf4a9873d9fe735d9adb22281e440f7b1329d966b60db6494926a894fdee4e8a2b8b076f33c37bbff79805b4ebe2849614196741c240340799e76e46dba91eb522b5e9dc94abd94006a3e9d0060c205f17b06a42b60444a188bc39c604117d341a591bfdf81fb0f3a80d0538bf65e031c491129597c06522cf0b748e41f2a6a83398300476a7b81818a551c379d57eb5c69e9c9ff8c096e3e8faabd4b46efe467337fa3044e8af943f97b5da331bee521a27d0a0ec3bb7817be7450cc6f64259715188fdcb63c219ee476a9ad7d61e15a16e13997d872166a2acc53ef6a22aaa42945b59ddcab2110f4f07f65ee4d19a4f90e5b6d9d57555ef9a94ed488dedef738af337a14951f7b0010000\"]" + }, + "cookies": [], + "headers": [ + { + "name": "date", + "value": "Thu, 13 Aug 2020 15:26:19 GMT" + }, + { + "name": "server", + "value": "Apache" + }, + { + "name": "access-control-allow-origin", + "value": "*" + }, + { + "name": "vary", + "value": "Accept-Encoding" + }, + { + "name": "content-encoding", + "value": "gzip" + }, + { + "name": "content-length", + "value": "286" + }, + { + "name": "content-type", + "value": "application/json; charset=utf-8" + }, + { + "name": "strict-transport-security", + "value": "max-age=31536000; includeSubDomains; preload" + }, + { + "name": "connection", + "value": "close" + } + ], + "headersSize": 294, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 403, + "statusText": "Forbidden" + }, + "startedDateTime": "2020-08-13T15:26:19.404Z", + "time": 70, + "timings": { + "blocked": -1, + "connect": -1, + "dns": -1, + "receive": 0, + "send": 0, + "ssl": -1, + "wait": 70 + } + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/spec/recordings/OpenCage-Geocoder-Provider_1524131378/receives-error-when-the-IP-address-is-rejected_1610178983/recording.har b/spec/recordings/OpenCage-Geocoder-Provider_1524131378/receives-error-when-the-IP-address-is-rejected_1610178983/recording.har new file mode 100644 index 0000000..a6493ba --- /dev/null +++ b/spec/recordings/OpenCage-Geocoder-Provider_1524131378/receives-error-when-the-IP-address-is-rejected_1610178983/recording.har @@ -0,0 +1,98 @@ +{ + "log": { + "_recordingName": "OpenCage Geocoder Provider/receives error when the IP address is rejected", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "5.0.0" + }, + "entries": [ + { + "_id": "5926205db8a399d6edc02640d8616cf2", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + }, + { + "_fromType": "array", + "name": "user-agent", + "value": "node-fetch/1.0 (+https://github.com/bitinn/node-fetch)" + }, + { + "_fromType": "array", + "name": "accept-encoding", + "value": "gzip,deflate" + }, + { + "_fromType": "array", + "name": "connection", + "value": "close" + }, + { + "name": "host", + "value": "api.opencagedata.com" + } + ], + "headersSize": 317, + "httpVersion": "HTTP/1.1", + "method": "GET", + "queryString": [ + { + "name": "q", + "value": "1600 Pennsylvania Ave, Washington, DC" + }, + { + "name": "limit", + "value": "5" + } + ], + "url": "https://api.opencagedata.com/geocode/v1/json?q=1600+Pennsylvania+Ave%2C+Washington%2C+DC&limit=5" + }, + "response": { + "bodySize": 127, + "content": { + "mimeType": "application/json; charset=utf-8", + "size": 127, + "text": "{\n \"results\" : [],\n \"status\" : {\n \"code\" : 403,\n \"message\" : \"IP address rejected\"\n },\n \"total_results\" : 0\n}" + }, + "cookies": [], + "headers": [ + { + "name": "cache-control", + "value": "no-cache" + }, + { + "name": "content-type", + "value": "application/json; charset=utf-8" + } + ], + "headersSize": 74, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 403, + "statusText": "Forbidden" + }, + "startedDateTime": "2020-08-13T15:26:19.071Z", + "time": 159, + "timings": { + "blocked": -1, + "connect": -1, + "dns": -1, + "receive": 0, + "send": 0, + "ssl": -1, + "wait": 159 + } + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/spec/recordings/OpenCage-Geocoder-Provider_1524131378/receives-error-when-the-quota-is-exceeded_98860701/recording.har b/spec/recordings/OpenCage-Geocoder-Provider_1524131378/receives-error-when-the-quota-is-exceeded_98860701/recording.har new file mode 100644 index 0000000..e6074f2 --- /dev/null +++ b/spec/recordings/OpenCage-Geocoder-Provider_1524131378/receives-error-when-the-quota-is-exceeded_98860701/recording.har @@ -0,0 +1,139 @@ +{ + "log": { + "_recordingName": "OpenCage Geocoder Provider/receives error when the quota is exceeded", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "5.0.0" + }, + "entries": [ + { + "_id": "5926205db8a399d6edc02640d8616cf2", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + }, + { + "_fromType": "array", + "name": "user-agent", + "value": "node-fetch/1.0 (+https://github.com/bitinn/node-fetch)" + }, + { + "_fromType": "array", + "name": "accept-encoding", + "value": "gzip,deflate" + }, + { + "_fromType": "array", + "name": "connection", + "value": "close" + }, + { + "name": "host", + "value": "api.opencagedata.com" + } + ], + "headersSize": 317, + "httpVersion": "HTTP/1.1", + "method": "GET", + "queryString": [ + { + "name": "q", + "value": "1600 Pennsylvania Ave, Washington, DC" + }, + { + "name": "limit", + "value": "5" + } + ], + "url": "https://api.opencagedata.com/geocode/v1/json?q=1600+Pennsylvania+Ave%2C+Washington%2C+DC&limit=5" + }, + "response": { + "bodySize": 337, + "content": { + "_isBinary": true, + "mimeType": "application/json; charset=utf-8", + "size": 337, + "text": "[\"1f8b08000000000000037d90414fc3300c85ff4a9473b565e956446e1312880382c36e0855596aba882629892386a6fe779c6a20e0b05becd8df7b7e27de05931d78d46883e78a1f10c7a496cb308237ba874ea35e98e0967ab4bce28335e01324ae9e4fdc6b07b4920098468c769f0b84f5d97640b3390e978026426731f1e9a5e25123914e847716b9921b21a8094e5b6f7dcfd55c25a0afd5e6faaa6e6a29c434f7f280c50c3112dd9053a1ec81f8d0ead6e484f48a976c8cd19aa2517113c8b65a0b59710729d110edbde7809ac1d10074d0f169d6f96cad7f0dd151a3c80da1ffa550cac57f19c2e38745fce3e5dc996d3cd2c24d9124053c68ff4697f0db10594ee48e69cfbe27d8f6e9bee02c9944edc66281b2a404bbb690696f77c8155bd56c9b7b2685146cb55172ad64c3ee1e76e5d2f378f6f6788eb496b2698a369d3bb43fc18ae90bdda5150a23020000\"]" + }, + "cookies": [], + "headers": [ + { + "name": "date", + "value": "Thu, 13 Aug 2020 15:24:26 GMT" + }, + { + "name": "server", + "value": "Apache" + }, + { + "name": "access-control-allow-origin", + "value": "*" + }, + { + "name": "x-ratelimit-limit", + "value": "2500" + }, + { + "name": "x-ratelimit-remaining", + "value": "0" + }, + { + "name": "x-ratelimit-reset", + "value": "1597363200" + }, + { + "name": "vary", + "value": "Accept-Encoding" + }, + { + "name": "content-encoding", + "value": "gzip" + }, + { + "name": "content-length", + "value": "337" + }, + { + "name": "content-type", + "value": "application/json; charset=utf-8" + }, + { + "name": "strict-transport-security", + "value": "max-age=31536000; includeSubDomains; preload" + }, + { + "name": "connection", + "value": "close" + } + ], + "headersSize": 376, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 402, + "statusText": "Payment Required" + }, + "startedDateTime": "2020-08-13T15:24:26.286Z", + "time": 209, + "timings": { + "blocked": -1, + "connect": -1, + "dns": -1, + "receive": 0, + "send": 0, + "ssl": -1, + "wait": 209 + } + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/spec/recordings/OpenStreetMap-_925808948/-Nominatim-Geocoder-Provider_1884184056/receives-correct-geocoding-results_3640432360/recording.har b/spec/recordings/OpenStreetMap-_925808948/-Nominatim-Geocoder-Provider_1884184056/receives-correct-geocoding-results_3640432360/recording.har new file mode 100644 index 0000000..7bf04a1 --- /dev/null +++ b/spec/recordings/OpenStreetMap-_925808948/-Nominatim-Geocoder-Provider_1884184056/receives-correct-geocoding-results_3640432360/recording.har @@ -0,0 +1,126 @@ +{ + "log": { + "_recordingName": "OpenStreetMap / Nominatim Geocoder Provider/receives correct geocoding results", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "5.0.0" + }, + "entries": [ + { + "_id": "0959cf92632b07046bedde27c0d0e8b6", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "user-agent", + "value": "Universal Geocoder Example" + }, + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + }, + { + "_fromType": "array", + "name": "accept-encoding", + "value": "gzip,deflate" + }, + { + "_fromType": "array", + "name": "connection", + "value": "close" + }, + { + "name": "host", + "value": "nominatim.openstreetmap.org" + } + ], + "headersSize": 288, + "httpVersion": "HTTP/1.1", + "method": "GET", + "queryString": [ + { + "name": "q", + "value": "1600 Pennsylvania Ave, Washington, DC" + }, + { + "name": "limit", + "value": "5" + }, + { + "name": "format", + "value": "jsonv2" + }, + { + "name": "addressdetails", + "value": "1" + } + ], + "url": "https://nominatim.openstreetmap.org/search?q=1600+Pennsylvania+Ave%2C+Washington%2C+DC&limit=5&format=jsonv2&addressdetails=1" + }, + "response": { + "bodySize": 1363, + "content": { + "mimeType": "application/json; charset=UTF-8", + "size": 1363, + "text": "[{\"place_id\":205327805,\"licence\":\"Data © OpenStreetMap contributors, ODbL 1.0. https://osm.org/copyright\",\"osm_type\":\"way\",\"osm_id\":564931814,\"boundingbox\":[\"38.8957842\",\"38.895924\",\"-77.0309688\",\"-77.0304609\"],\"lat\":\"38.8958536\",\"lon\":\"-77.0307129\",\"display_name\":\"Pennsylvania Avenue, Penn Quarter, Washington, District of Columbia, 20045, United States of America\",\"place_rank\":27,\"category\":\"highway\",\"type\":\"path\",\"importance\":0.385,\"address\":{\"road\":\"Pennsylvania Avenue\",\"neighbourhood\":\"Penn Quarter\",\"city\":\"Washington\",\"county\":\"Washington\",\"state\":\"District of Columbia\",\"postcode\":\"20045\",\"country\":\"United States of America\",\"country_code\":\"us\"}},{\"place_id\":176517326,\"licence\":\"Data © OpenStreetMap contributors, ODbL 1.0. https://osm.org/copyright\",\"osm_type\":\"way\",\"osm_id\":397325778,\"boundingbox\":[\"38.8633822\",\"38.8637409\",\"-76.9467576\",\"-76.945632\"],\"lat\":\"38.8636383\",\"lon\":\"-76.9463651\",\"display_name\":\"Pennsylvania Avenue, Dillon Park, Coral Hills, Prince George's County, District of Columbia, 20746-8001, United States of America\",\"place_rank\":26,\"category\":\"highway\",\"type\":\"trunk\",\"importance\":0.3,\"address\":{\"road\":\"Pennsylvania Avenue\",\"hamlet\":\"Dillon Park\",\"locality\":\"Coral Hills\",\"county\":\"Prince George's County\",\"state\":\"District of Columbia\",\"postcode\":\"20746-8001\",\"country\":\"United States of America\",\"country_code\":\"us\"}}]" + }, + "cookies": [], + "headers": [ + { + "name": "server", + "value": "nginx" + }, + { + "name": "date", + "value": "Fri, 14 Aug 2020 16:44:22 GMT" + }, + { + "name": "content-type", + "value": "application/json; charset=UTF-8" + }, + { + "name": "transfer-encoding", + "value": "chunked" + }, + { + "name": "connection", + "value": "close" + }, + { + "name": "access-control-allow-origin", + "value": "*" + }, + { + "name": "access-control-allow-methods", + "value": "OPTIONS,GET" + } + ], + "headersSize": 223, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2020-08-14T16:44:22.076Z", + "time": 228, + "timings": { + "blocked": -1, + "connect": -1, + "dns": -1, + "receive": 0, + "send": 0, + "ssl": -1, + "wait": 228 + } + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/spec/recordings/OpenStreetMap-_925808948/-Nominatim-Geocoder-Provider_1884184056/receives-correct-geodecoding-results_1602611079/recording.har b/spec/recordings/OpenStreetMap-_925808948/-Nominatim-Geocoder-Provider_1884184056/receives-correct-geodecoding-results_1602611079/recording.har new file mode 100644 index 0000000..540882f --- /dev/null +++ b/spec/recordings/OpenStreetMap-_925808948/-Nominatim-Geocoder-Provider_1884184056/receives-correct-geodecoding-results_1602611079/recording.har @@ -0,0 +1,130 @@ +{ + "log": { + "_recordingName": "OpenStreetMap / Nominatim Geocoder Provider/receives correct geodecoding results", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "5.0.0" + }, + "entries": [ + { + "_id": "61905e2b3d3f99307bb007e96f88d082", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "user-agent", + "value": "Universal Geocoder Example" + }, + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + }, + { + "_fromType": "array", + "name": "accept-encoding", + "value": "gzip,deflate" + }, + { + "_fromType": "array", + "name": "connection", + "value": "close" + }, + { + "name": "host", + "value": "nominatim.openstreetmap.org" + } + ], + "headersSize": 265, + "httpVersion": "HTTP/1.1", + "method": "GET", + "queryString": [ + { + "name": "lat", + "value": "48.8631507" + }, + { + "name": "lon", + "value": "2.388911" + }, + { + "name": "zoom", + "value": "18" + }, + { + "name": "format", + "value": "jsonv2" + }, + { + "name": "addressdetails", + "value": "1" + } + ], + "url": "https://nominatim.openstreetmap.org/reverse?lat=48.8631507&lon=2.388911&zoom=18&format=jsonv2&addressdetails=1" + }, + "response": { + "bodySize": 679, + "content": { + "mimeType": "application/json; charset=UTF-8", + "size": 679, + "text": "{\"place_id\":161274479,\"licence\":\"Data © OpenStreetMap contributors, ODbL 1.0. https://osm.org/copyright\",\"osm_type\":\"way\",\"osm_id\":322777831,\"lat\":\"48.863744499999996\",\"lon\":\"2.3911562136123106\",\"place_rank\":26,\"category\":\"highway\",\"type\":\"pedestrian\",\"importance\":0.09999999999999998,\"addresstype\":\"road\",\"name\":null,\"display_name\":\"Quartier du Père-Lachaise, Paris, Île-de-France, France métropolitaine, 75020, France\",\"address\":{\"suburb\":\"Quartier du Père-Lachaise\",\"city\":\"Paris\",\"municipality\":\"Paris\",\"county\":\"Paris\",\"state\":\"Île-de-France\",\"country\":\"France\",\"postcode\":\"75020\",\"country_code\":\"fr\"},\"boundingbox\":[\"48.8625929\",\"48.8648832\",\"2.3877078\",\"2.3956964\"]}" + }, + "cookies": [], + "headers": [ + { + "name": "server", + "value": "nginx" + }, + { + "name": "date", + "value": "Fri, 14 Aug 2020 16:51:39 GMT" + }, + { + "name": "content-type", + "value": "application/json; charset=UTF-8" + }, + { + "name": "transfer-encoding", + "value": "chunked" + }, + { + "name": "connection", + "value": "close" + }, + { + "name": "access-control-allow-origin", + "value": "*" + }, + { + "name": "access-control-allow-methods", + "value": "OPTIONS,GET" + } + ], + "headersSize": 223, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2020-08-14T16:51:39.152Z", + "time": 159, + "timings": { + "blocked": -1, + "connect": -1, + "dns": -1, + "receive": 0, + "send": 0, + "ssl": -1, + "wait": 159 + } + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/spec/recordings/Yandex-Geocoder-Provider_3381125107/receives-correct-geocoding-results_3640432360/recording.har b/spec/recordings/Yandex-Geocoder-Provider_3381125107/receives-correct-geocoding-results_3640432360/recording.har new file mode 100644 index 0000000..91ccff6 --- /dev/null +++ b/spec/recordings/Yandex-Geocoder-Provider_3381125107/receives-correct-geocoding-results_3640432360/recording.har @@ -0,0 +1,151 @@ +{ + "log": { + "_recordingName": "Yandex Geocoder Provider/receives correct geocoding results", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "5.0.0" + }, + "entries": [ + { + "_id": "e2aec0c20d9e28623deca09660dd67b0", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + }, + { + "_fromType": "array", + "name": "user-agent", + "value": "node-fetch/1.0 (+https://github.com/bitinn/node-fetch)" + }, + { + "_fromType": "array", + "name": "accept-encoding", + "value": "gzip,deflate" + }, + { + "_fromType": "array", + "name": "connection", + "value": "close" + }, + { + "name": "host", + "value": "geocode-maps.yandex.ru" + } + ], + "headersSize": 337, + "httpVersion": "HTTP/1.1", + "method": "GET", + "queryString": [ + { + "name": "geocode", + "value": "1600 Pennsylvania Ave, Washington, DC" + }, + { + "name": "format", + "value": "json" + }, + { + "name": "lang", + "value": "en_US" + } + ], + "url": "https://geocode-maps.yandex.ru/1.x?geocode=1600+Pennsylvania+Ave%2C+Washington%2C+DC&format=json&lang=en_US" + }, + "response": { + "bodySize": 1405, + "content": { + "_isBinary": true, + "mimeType": "application/json; charset=utf-8", + "size": 1405, + "text": "[\"1f8b0800000000000003e4945d6fd3301486ff4ae4eb30e5a3cec7ee4a8be062948981b840137293b3d590d8c1713aa6a9ff7dc7499a795b09bdd8540695aadace39f6fbbe6e9e1ba2a0aea4a8811cdf90b7203f2cbf43a667b228f0874b61964bd06cce343b55b202a5affbd24ce6a03ef6edeffb1af34cc1cf066a4d8e891f799e730a42d4d7c59a09ce9ce91a5ce70bab575c5c6a295c673e23ae11d114ba361d1e4e2f6423729c8464b3c11930dd283ca15c8222c75f2d9d7f5267abaa1464bc6e2d915a2b008d2769f865747e165c43ee9c69a6a176e485332d41f18ca13c8eb53cd366115369ca2567f70d3cb4271a701652e9d595c9c0253f78eb6538729ae768b7369232f4a9d5f537a3d5a8386bbdab926954f3ccb266b2c48b036152c7487b95bd227c2e58092312c8c61d9a2a25d75c6470d7b54b9edd51c88c155c5be7dc49b7eb86d0faaa71539bf3cd10ef1c6f9e176dcab3de130efb87275c8c797b9a78db4317a87b66ddaeb53c16aeb15172615430cdd73055c03afd0f57172381bbe4649b33f66ec78b4781bbe4d34a2ad95cae2e986a4160cf177b45df7df6bc2897e450678a571d61c83d1eec8c7e24a9a58105e4af5b936fc41a0ae4801917f20ad44c2a61a8415ec5f1914713dfa34e981c25a917f901763755f5b0c80f2641648a528f0693a465d0a9e4a2a54d25eb6d5d18465ed26d46296e66fcbf00369dc946af80fd6d6cb265fd336cba33756836dd8ff73f609315fd1e6cb2e339109bbc7092b6d849e284a6bbd8141da5894f69da16257114f8bbd984756940c3b8ab0bbdf4c9d8243124f57c687ac72f57f8ce0f5ccafb5d0e4ba641d58bc09295d9c8ffbdf774682a59d1be2424cda1027caf85b61b1e2d8ec0691bff1e641a223a04969024314594b424a1340ce86e2c4d8230f03bdcf85efc5b2a51445b47a528f1d3d4f83fc7ef2d000000ffff\",\"03008b808d24850e0000\"]" + }, + "cookies": [], + "headers": [ + { + "name": "server", + "value": "nginx" + }, + { + "name": "date", + "value": "Fri, 14 Aug 2020 17:29:45 GMT" + }, + { + "name": "content-type", + "value": "application/json; charset=utf-8" + }, + { + "name": "transfer-encoding", + "value": "chunked" + }, + { + "name": "connection", + "value": "close" + }, + { + "name": "vary", + "value": "Accept-Encoding" + }, + { + "name": "access-control-allow-origin", + "value": "*" + }, + { + "name": "access-control-allow-methods", + "value": "GET" + }, + { + "name": "access-control-allow-headers", + "value": "*" + }, + { + "name": "etag", + "value": "W/\"e85-jED9/6YYFGyACPhZmEaIwSqxDds\"" + }, + { + "name": "x-xss-protection", + "value": "1; mode=block" + }, + { + "name": "x-content-type-options", + "value": "nosniff" + }, + { + "name": "content-encoding", + "value": "gzip" + }, + { + "name": "x-qloud-router", + "value": "man4-a74d0ae6f388.qloud-c.yandex.net" + } + ], + "headersSize": 458, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2020-08-14T17:29:45.683Z", + "time": 306, + "timings": { + "blocked": -1, + "connect": -1, + "dns": -1, + "receive": 0, + "send": 0, + "ssl": -1, + "wait": 306 + } + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/spec/recordings/Yandex-Geocoder-Provider_3381125107/receives-correct-geodecoding-results_1602611079/recording.har b/spec/recordings/Yandex-Geocoder-Provider_3381125107/receives-correct-geodecoding-results_1602611079/recording.har new file mode 100644 index 0000000..bb41767 --- /dev/null +++ b/spec/recordings/Yandex-Geocoder-Provider_3381125107/receives-correct-geodecoding-results_1602611079/recording.har @@ -0,0 +1,151 @@ +{ + "log": { + "_recordingName": "Yandex Geocoder Provider/receives correct geodecoding results", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "5.0.0" + }, + "entries": [ + { + "_id": "35af77943d19f4c062f0b16b5a319928", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + }, + { + "_fromType": "array", + "name": "user-agent", + "value": "node-fetch/1.0 (+https://github.com/bitinn/node-fetch)" + }, + { + "_fromType": "array", + "name": "accept-encoding", + "value": "gzip,deflate" + }, + { + "_fromType": "array", + "name": "connection", + "value": "close" + }, + { + "name": "host", + "value": "geocode-maps.yandex.ru" + } + ], + "headersSize": 309, + "httpVersion": "HTTP/1.1", + "method": "GET", + "queryString": [ + { + "name": "geocode", + "value": "2.388911,48.8631507" + }, + { + "name": "format", + "value": "json" + }, + { + "name": "lang", + "value": "en_US" + } + ], + "url": "https://geocode-maps.yandex.ru/1.x?geocode=2.388911%2C48.8631507&format=json&lang=en_US" + }, + "response": { + "bodySize": 2263, + "content": { + "_isBinary": true, + "mimeType": "application/json; charset=utf-8", + "size": 2263, + "text": "[\"1f8b0800000000000003ec97df6ed33014c65f25f27536397fda26bb2b1dec669432718710f292336a48ece03865d3d457e039788fbd18b6e3645e9b7542940a267a53c7fe1c7fe73bcaafe92d1250579cd5804e6ed119f037979f2193335e14ea8b72a6a74b90e49448b210bc02216fac34e339880bbbfdb5d5e8b505a74cea41c56b7482c2e32849d220f0e2e4381947c128406b5f9dfbb5815a3aeb7eb78e2748afd74d21f5fe00abcb2bdeb05c5da468ad365f01918d5087969720d0c97bc7fa53865da395808cd6a64a04d7446df691846b6dea95202c03dfbbfb5ec0510e47ddf582085afb5e88c19b0ac1594eeb1a4a60d2f7a62b600d786744999292f89e31fe851adf4bdea88c7d34cd735559ad4fcf544952dc7cd4b6f48917a64c51122921dfa785192f558f94a036515947f678b5ce4809fd79aa37bda4127c45f55caf79e8c5d5163c230595cefd8c4f57a28c4a414dca56b25d83ab576a0047bd519d2bede2b54a55f6fac3ba4ffb54f59c1626f499ad5a0dede23965f7d5ef256d73c25c3999399d75a6efb3d60e4bca742e44d2154c0590d6dae6ec7c307f1f9d77b1ab5ddd78eee6efa353a880e5cab1abdd9a9c3fda111fbd5b72c19b4fcb2b220c27dcebf9706f7cb41050d2962b76386fdac7d5b4a7fb3cd65d9b660e752668d5a268c05ddfa0cdbef5095d6a7240fec294fd92ada05050d0e3827f0331e382194f9a42f1248d5b4ae1280dd4dea6aa1e4ad208632b19253831301ac25d92a61dee74a9fe1e00d53f0d7b23d43d9dfa7b1f144fcf194d07a7cf7ff274d13f0196434345b1c0a2208c069012e331c691514c4693301c464a8c7198b4b719a7a3645f4ce172a96cfc0e52de3644480ac2cb1b6f71f743c0d139c996849a5fe3ed87ebcff265a7997f1535dbfa1d651e803b4f84fcec10f44b77d8d59a4d2eed0cf2a0880a2749fbef6c348ec361464571fbda33c149307ee4b5270d8360d4422ac649fc3740ea27000000ffff\",\"ec984112c2200c00bfe20b3a24840077cf5e7c818edebdf828dfe1c76c2bdad2824e2dc5daf10cc324e96e0875df306f23fab9663375d3586263e8da1cccdab7389db19a0ddf8d2566a290b2c052bab1c21044c70a4466379e18b499955d5f2fa7b207d6d55a1d8e0f80fc323e171a8f771510491c1e1c4116b15d7e6e5f30c6f8f658eca92cffa06439d5df9ef7e123820b9b9725eebc23a219fa9a470a345e7b4442ac6505459643d6b32defde6a8b1508022217350aa1ee0729a3ad9e83f5d9e49e95c3532ab920f362f9f9defd056bcf618d50ad3131815459258a4eb889c4f98e286fa7d30efeb3c75d8152ec1e90cc322bee0de72db046733e2de049e8cd8cad8f642f149fcda12c4241c420eb9f078002751f4659a8b297568f155b2001910ec3a8d06a5353cd46981b000000ffffb4d84b0ac0300804d0abe4029518ff87cbdd2b74114ab2b1d0fdac9c87a02abf625cf8968bb2bdbab54f7e8a5e5e7557fbbc249702c5c8031461a8b1efafef00eb6e484d32c29e67eaa9508460228bc60a16fd49e500e6bc010000ffff0300ac42889cbb200000\"]" + }, + "cookies": [], + "headers": [ + { + "name": "server", + "value": "nginx" + }, + { + "name": "date", + "value": "Fri, 14 Aug 2020 17:36:59 GMT" + }, + { + "name": "content-type", + "value": "application/json; charset=utf-8" + }, + { + "name": "transfer-encoding", + "value": "chunked" + }, + { + "name": "connection", + "value": "close" + }, + { + "name": "vary", + "value": "Accept-Encoding" + }, + { + "name": "access-control-allow-origin", + "value": "*" + }, + { + "name": "access-control-allow-methods", + "value": "GET" + }, + { + "name": "access-control-allow-headers", + "value": "*" + }, + { + "name": "etag", + "value": "W/\"20bb-MO3+B80DGyD1s+UZB68tAeaEiSk\"" + }, + { + "name": "x-xss-protection", + "value": "1; mode=block" + }, + { + "name": "x-content-type-options", + "value": "nosniff" + }, + { + "name": "content-encoding", + "value": "gzip" + }, + { + "name": "x-qloud-router", + "value": "man1-043f58f4a44d.qloud-c.yandex.net" + } + ], + "headersSize": 459, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2020-08-14T17:36:59.280Z", + "time": 283, + "timings": { + "blocked": -1, + "connect": -1, + "dns": -1, + "receive": 0, + "send": 0, + "ssl": -1, + "wait": 283 + } + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/spec/recordings/Yandex-Geocoder-Provider_3381125107/receives-error-when-the-API-key-is-bad_860720186/recording.har b/spec/recordings/Yandex-Geocoder-Provider_3381125107/receives-error-when-the-API-key-is-bad_860720186/recording.har new file mode 100644 index 0000000..522c3e3 --- /dev/null +++ b/spec/recordings/Yandex-Geocoder-Provider_3381125107/receives-error-when-the-API-key-is-bad_860720186/recording.har @@ -0,0 +1,130 @@ +{ + "log": { + "_recordingName": "Yandex Geocoder Provider/receives error when the API key is bad", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "5.0.0" + }, + "entries": [ + { + "_id": "44cb5465efd97e699724d4a04ef7b766", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + }, + { + "_fromType": "array", + "name": "user-agent", + "value": "node-fetch/1.0 (+https://github.com/bitinn/node-fetch)" + }, + { + "_fromType": "array", + "name": "accept-encoding", + "value": "gzip,deflate" + }, + { + "_fromType": "array", + "name": "connection", + "value": "close" + }, + { + "name": "host", + "value": "geocode-maps.yandex.ru" + } + ], + "headersSize": 297, + "httpVersion": "HTTP/1.1", + "method": "GET", + "queryString": [ + { + "name": "geocode", + "value": "1600 Pennsylvania Ave, Washington, DC" + }, + { + "name": "format", + "value": "json" + } + ], + "url": "https://geocode-maps.yandex.ru/1.x?geocode=1600+Pennsylvania+Ave%2C+Washington%2C+DC&format=json" + }, + "response": { + "bodySize": 62, + "content": { + "mimeType": "application/json; charset=utf-8", + "size": 62, + "text": "{\"statusCode\":403,\"error\":\"Forbidden\",\"message\":\"Invalid key\"}" + }, + "cookies": [], + "headers": [ + { + "name": "server", + "value": "nginx" + }, + { + "name": "date", + "value": "Fri, 14 Aug 2020 17:39:04 GMT" + }, + { + "name": "content-type", + "value": "application/json; charset=utf-8" + }, + { + "name": "content-length", + "value": "62" + }, + { + "name": "connection", + "value": "close" + }, + { + "name": "access-control-allow-origin", + "value": "*" + }, + { + "name": "access-control-allow-methods", + "value": "GET" + }, + { + "name": "access-control-allow-headers", + "value": "*" + }, + { + "name": "etag", + "value": "W/\"3e-cw06Pdy6OiytV8KcUexnEAwoCRw\"" + }, + { + "name": "x-qloud-router", + "value": "man1-043f58f4a44d.qloud-c.yandex.net" + } + ], + "headersSize": 336, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 403, + "statusText": "Forbidden" + }, + "startedDateTime": "2020-08-14T17:39:04.688Z", + "time": 228, + "timings": { + "blocked": -1, + "connect": -1, + "dns": -1, + "receive": 0, + "send": 0, + "ssl": -1, + "wait": 228 + } + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/spec/setupPolly.ts b/spec/setupPolly.ts new file mode 100644 index 0000000..e554e16 --- /dev/null +++ b/spec/setupPolly.ts @@ -0,0 +1,48 @@ +import { Polly } from "@pollyjs/core"; +import NodeHttpAdapter from "@pollyjs/adapter-node-http"; +import FSPersister from "@pollyjs/persister-fs"; +import { MODES } from "@pollyjs/utils"; +import { setupPolly, Context } from "setup-polly-jest"; +import path from "path"; + +Polly.register(NodeHttpAdapter); +Polly.register(FSPersister); + +const excludedQueryParams = ["access_token", "apikey", "key"]; + +export const cleanRecording = (context: Context): void => { + context.polly.server.any().on("beforePersist", (req, { request }) => { + request.queryString = request.queryString.filter( + ({ name }: { name: string }) => !excludedQueryParams.includes(name) + ); + const url = new URL(request.url); + excludedQueryParams.forEach((param) => url.searchParams.delete(param)); + request.url = url.toString(); + }); +}; + +export default (): Context => + setupPolly({ + mode: MODES.REPLAY, + recordIfMissing: process.env.POLLY_RECORD + ? process.env.POLLY_RECORD === "1" + : false, + recordFailedRequests: true, + adapters: ["node-http"], + persister: "fs", + persisterOptions: { + fs: { + recordingsDir: path.resolve(__dirname, "./recordings"), + }, + }, + matchRequestsBy: { + url: { + query: (query) => { + const filteredQuery = { ...query }; + excludedQueryParams.forEach((param) => delete filteredQuery[param]); + + return filteredQuery; + }, + }, + }, + }); diff --git a/src/ExternalLoader.ts b/src/ExternalLoader.ts index bc5dbb5..94ab715 100644 --- a/src/ExternalLoader.ts +++ b/src/ExternalLoader.ts @@ -2,14 +2,16 @@ import fetch from "cross-fetch"; import { ErrorCallback } from "provider"; import { ResponseError } from "error"; import { isBrowser, filterUndefinedObjectValues } from "utils"; +import { PartialSome } from "types"; export interface ExternalLoaderInterface { - setOptions(options: ExternalLoaderOptions): void; + setOptions(options: PartialSome): void; getOptions(): ExternalLoaderOptions; executeRequest( params: ExternalLoaderParams, callback: ResponseCallback, headers?: ExternalLoaderHeaders, + body?: ExternalLoaderBody, errorCallback?: ErrorCallback ): void; } @@ -18,6 +20,11 @@ export interface ExternalLoaderOptions { readonly protocol: string; readonly host?: string; readonly pathname?: string; + readonly method: "GET" | "POST"; +} + +export interface ExternalLoaderBody { + [param: string]: string | undefined; } export interface ExternalLoaderParams { @@ -34,6 +41,7 @@ type ResponseCallback = (response: any) => void; const defaultOptions: ExternalLoaderOptions = { protocol: "http", + method: "GET", }; /** @@ -42,11 +50,15 @@ const defaultOptions: ExternalLoaderOptions = { export default class ExternalLoader implements ExternalLoaderInterface { private options: ExternalLoaderOptions = defaultOptions; - public constructor(options: ExternalLoaderOptions = defaultOptions) { + public constructor( + options: PartialSome = defaultOptions + ) { this.setOptions(options); } - public setOptions(options: ExternalLoaderOptions): void { + public setOptions( + options: PartialSome + ): void { this.options = { ...defaultOptions, ...options }; } @@ -58,18 +70,19 @@ export default class ExternalLoader implements ExternalLoaderInterface { params: ExternalLoaderParams, callback: ResponseCallback, externalLoaderHeaders?: ExternalLoaderHeaders, + body?: ExternalLoaderBody, errorCallback?: ErrorCallback ): void { - if (!this.options.host) { + const { protocol, host, pathname, method } = this.options; + + if (!host) { throw new Error("A host is required for the external loader."); } - if (!this.options.pathname) { + if (!pathname) { throw new Error("A pathname is required for the external loader."); } - const requestUrl = new URL( - `${this.options.protocol}://${this.options.host}/${this.options.pathname}` - ); + const requestUrl = new URL(`${protocol}://${host}/${pathname}`); const { jsonpCallback, ...requestParams } = params; @@ -89,6 +102,8 @@ export default class ExternalLoader implements ExternalLoaderInterface { const headers = filterUndefinedObjectValues(externalLoaderHeaders || {}); fetch(requestUrl.toString(), { headers, + method, + body: method === "POST" ? JSON.stringify(body) : undefined, }) .then((response) => { if (!response.ok) { diff --git a/src/provider/BingProvider.ts b/src/provider/BingProvider.ts index f2198bd..9d86140 100644 --- a/src/provider/BingProvider.ts +++ b/src/provider/BingProvider.ts @@ -1,4 +1,5 @@ import { + ExternalLoaderBody, ExternalLoaderHeaders, ExternalLoaderInterface, ExternalLoaderParams, @@ -54,7 +55,9 @@ export interface BingResult { matchCodes: string[]; } -export default class BingProvider implements ProviderInterface { +type BingGeocodedResultsCallback = GeocodedResultsCallback; + +export default class BingProvider implements ProviderInterface { private externalLoader: ExternalLoaderInterface; private options: ProviderOptionsInterface; @@ -74,7 +77,7 @@ export default class BingProvider implements ProviderInterface { public geocode( query: string | GeocodeQuery | GeocodeQueryObject, - callback: GeocodedResultsCallback, + callback: BingGeocodedResultsCallback, errorCallback?: ErrorCallback ): void { const geocodeQuery = ProviderHelpers.getGeocodeQueryFromParameter(query); @@ -90,13 +93,13 @@ export default class BingProvider implements ProviderInterface { jsonpCallback: this.options.useJsonp ? "jsonp" : undefined, }; - this.executeRequest(params, callback, {}, errorCallback); + this.executeRequest(params, callback, {}, {}, errorCallback); } public geodecode( latitudeOrQuery: number | string | ReverseQuery | ReverseQueryObject, - longitudeOrCallback: number | string | GeocodedResultsCallback, - callbackOrErrorCallback?: GeocodedResultsCallback | ErrorCallback, + longitudeOrCallback: number | string | BingGeocodedResultsCallback, + callbackOrErrorCallback?: BingGeocodedResultsCallback | ErrorCallback, errorCallback?: ErrorCallback ): void { const reverseQuery = ProviderHelpers.getReverseQueryFromParameters( @@ -126,13 +129,14 @@ export default class BingProvider implements ProviderInterface { jsonpCallback: this.options.useJsonp ? "jsonp" : undefined, }; - this.executeRequest(params, reverseCallback, {}, reverseErrorCallback); + this.executeRequest(params, reverseCallback, {}, {}, reverseErrorCallback); } public executeRequest( params: ExternalLoaderParams, - callback: GeocodedResultsCallback, + callback: BingGeocodedResultsCallback, headers?: ExternalLoaderHeaders, + body?: ExternalLoaderBody, errorCallback?: ErrorCallback ): void { this.externalLoader.executeRequest( @@ -145,6 +149,7 @@ export default class BingProvider implements ProviderInterface { ); }, headers, + body, errorCallback ); } diff --git a/src/provider/ChainProvider.ts b/src/provider/ChainProvider.ts index 47edca7..4165743 100644 --- a/src/provider/ChainProvider.ts +++ b/src/provider/ChainProvider.ts @@ -17,7 +17,7 @@ import { export interface ChainProviderOptionsInterface extends ProviderOptionsInterface { - readonly providers: ProviderInterface[]; + readonly providers: ProviderInterface[]; readonly parallelize?: boolean; readonly first?: boolean; } @@ -27,7 +27,9 @@ export const defaultChainProviderOptions = { providers: [], }; -export default class ChainProvider implements ProviderInterface { +type ChainGeocodedResultsCallback = GeocodedResultsCallback; + +export default class ChainProvider implements ProviderInterface { private options: ChainProviderOptionsInterface; public constructor( @@ -38,7 +40,7 @@ export default class ChainProvider implements ProviderInterface { public geocode( query: string | GeocodeQuery | GeocodeQueryObject, - callback: GeocodedResultsCallback, + callback: ChainGeocodedResultsCallback, errorCallback?: ErrorCallback ): void { if (this.options.parallelize || this.options.first) { @@ -56,8 +58,8 @@ export default class ChainProvider implements ProviderInterface { public geodecode( latitudeOrQuery: number | string | ReverseQuery | ReverseQueryObject, - longitudeOrCallback: number | string | GeocodedResultsCallback, - callbackOrErrorCallback?: GeocodedResultsCallback | ErrorCallback, + longitudeOrCallback: number | string | ChainGeocodedResultsCallback, + callbackOrErrorCallback?: ChainGeocodedResultsCallback | ErrorCallback, errorCallback?: ErrorCallback ): void { const reverseQuery = ProviderHelpers.getReverseQueryFromParameters( @@ -92,13 +94,13 @@ export default class ChainProvider implements ProviderInterface { } private geocodeNextProvider( - providers: ProviderInterface[], + providers: ProviderInterface[], query: string | GeocodeQuery | GeocodeQueryObject, - callback: GeocodedResultsCallback, + callback: ChainGeocodedResultsCallback, errorCallback?: ErrorCallback ): void { const [provider, ...nextProviders] = providers; - const resultCallback: GeocodedResultsCallback = (results) => { + const resultCallback: ChainGeocodedResultsCallback = (results) => { if (results.length > 0) { callback(results); return; @@ -123,13 +125,13 @@ export default class ChainProvider implements ProviderInterface { } private geodecodeNextProvider( - providers: ProviderInterface[], + providers: ProviderInterface[], reverseQuery: ReverseQuery, - callback: GeocodedResultsCallback, + callback: ChainGeocodedResultsCallback, errorCallback?: ErrorCallback ): void { const [provider, ...nextProviders] = providers; - const resultCallback: GeocodedResultsCallback = (results) => { + const resultCallback: ChainGeocodedResultsCallback = (results) => { if (results.length > 0) { callback(results); return; @@ -160,7 +162,7 @@ export default class ChainProvider implements ProviderInterface { private geocodeAllProviders( query: string | GeocodeQuery | GeocodeQueryObject, - callback: GeocodedResultsCallback, + callback: ChainGeocodedResultsCallback, errorCallback?: ErrorCallback ): void { const providerResults: Map = new Map(); @@ -182,7 +184,7 @@ export default class ChainProvider implements ProviderInterface { }, []); const resultProviderCallback: ( providerName: string - ) => GeocodedResultsCallback = (providerName) => (results) => { + ) => ChainGeocodedResultsCallback = (providerName) => (results) => { providerResults.set(providerName, results); const providerResult = getProviderResult(); if (!callbackCalled && providerResult) { @@ -218,7 +220,7 @@ export default class ChainProvider implements ProviderInterface { private geodecodeAllProviders( reverseQuery: ReverseQuery, - callback: GeocodedResultsCallback, + callback: ChainGeocodedResultsCallback, errorCallback?: ErrorCallback ): void { const providerResults: Map = new Map(); @@ -240,7 +242,7 @@ export default class ChainProvider implements ProviderInterface { }, []); const resultProviderCallback: ( providerName: string - ) => GeocodedResultsCallback = (providerName) => (results) => { + ) => ChainGeocodedResultsCallback = (providerName) => (results) => { providerResults.set(providerName, results); const providerResult = getProviderResult(); if (!callbackCalled && providerResult) { @@ -279,7 +281,7 @@ export default class ChainProvider implements ProviderInterface { // eslint-disable-next-line @typescript-eslint/no-unused-vars params: ExternalLoaderParams, // eslint-disable-next-line @typescript-eslint/no-unused-vars - callback: GeocodedResultsCallback + callback: ChainGeocodedResultsCallback ): void { throw new Error( "executeRequest cannot be called directly from the chain provider." diff --git a/src/provider/MapquestProvider.ts b/src/provider/MapquestProvider.ts index 8382378..0cd5043 100644 --- a/src/provider/MapquestProvider.ts +++ b/src/provider/MapquestProvider.ts @@ -1,4 +1,5 @@ import { + ExternalLoaderBody, ExternalLoaderHeaders, ExternalLoaderInterface, ExternalLoaderParams, @@ -55,7 +56,9 @@ export interface MapQuestResult { geocodeQualityCode: string; } -export default class MapQuestProvider implements ProviderInterface { +type MapQuestGeocodedResultsCallback = GeocodedResultsCallback; + +export default class MapQuestProvider implements ProviderInterface { private externalLoader: ExternalLoaderInterface; private options: ProviderOptionsInterface; @@ -75,7 +78,7 @@ export default class MapQuestProvider implements ProviderInterface { public geocode( query: string | GeocodeQuery | GeocodeQueryObject, - callback: GeocodedResultsCallback, + callback: MapQuestGeocodedResultsCallback, errorCallback?: ErrorCallback ): void { const geocodeQuery = ProviderHelpers.getGeocodeQueryFromParameter(query); @@ -88,17 +91,17 @@ export default class MapQuestProvider implements ProviderInterface { const params: MapQuestRequestParams = { key: this.options.apiKey, - location: encodeURIComponent(geocodeQuery.getText()), + location: geocodeQuery.getText(), jsonpCallback: this.options.useJsonp ? "callback" : undefined, }; - this.executeRequest(params, callback, {}, errorCallback); + this.executeRequest(params, callback, {}, {}, errorCallback); } public geodecode( latitudeOrQuery: number | string | ReverseQuery | ReverseQueryObject, - longitudeOrCallback: number | string | GeocodedResultsCallback, - callbackOrErrorCallback?: GeocodedResultsCallback | ErrorCallback, + longitudeOrCallback: number | string | MapQuestGeocodedResultsCallback, + callbackOrErrorCallback?: MapQuestGeocodedResultsCallback | ErrorCallback, errorCallback?: ErrorCallback ): void { const reverseQuery = ProviderHelpers.getReverseQueryFromParameters( @@ -129,13 +132,14 @@ export default class MapQuestProvider implements ProviderInterface { jsonpCallback: this.options.useJsonp ? "callback" : undefined, }; - this.executeRequest(params, reverseCallback, {}, reverseErrorCallback); + this.executeRequest(params, reverseCallback, {}, {}, reverseErrorCallback); } public executeRequest( params: ExternalLoaderParams, - callback: GeocodedResultsCallback, + callback: MapQuestGeocodedResultsCallback, headers?: ExternalLoaderHeaders, + body?: ExternalLoaderBody, errorCallback?: ErrorCallback ): void { this.externalLoader.executeRequest( @@ -148,6 +152,7 @@ export default class MapQuestProvider implements ProviderInterface { ); }, headers, + body, errorCallback ); } diff --git a/src/provider/ProviderHelpers.ts b/src/provider/ProviderHelpers.ts index 7da92fc..a96c881 100644 --- a/src/provider/ProviderHelpers.ts +++ b/src/provider/ProviderHelpers.ts @@ -1,4 +1,5 @@ import { ErrorCallback, GeocodedResultsCallback } from "provider"; +import Geocoded from "Geocoded"; import { GeocodeQuery, GeocodeQueryObject, @@ -21,9 +22,9 @@ export default class ProviderHelpers { return query; } - public static getReverseQueryFromParameters( + public static getReverseQueryFromParameters( latitudeOrQuery: number | string | ReverseQuery | ReverseQueryObject, - longitudeOrCallback: number | string | GeocodedResultsCallback, + longitudeOrCallback: number | string | GeocodedResultsCallback, reverseQuery = ReverseQuery ): ReverseQuery { if ( @@ -52,10 +53,10 @@ export default class ProviderHelpers { return latitudeOrQuery; } - public static getCallbackFromParameters( - longitudeOrCallback: number | string | GeocodedResultsCallback, - callbackOrErrorCallback?: GeocodedResultsCallback | ErrorCallback - ): GeocodedResultsCallback { + public static getCallbackFromParameters( + longitudeOrCallback: number | string | GeocodedResultsCallback, + callbackOrErrorCallback?: GeocodedResultsCallback | ErrorCallback + ): GeocodedResultsCallback { if ( !( typeof longitudeOrCallback === "number" || @@ -65,7 +66,7 @@ export default class ProviderHelpers { return longitudeOrCallback; } if (callbackOrErrorCallback) { - return callbackOrErrorCallback; + return >callbackOrErrorCallback; } throw new Error( @@ -73,9 +74,9 @@ export default class ProviderHelpers { ); } - public static getErrorCallbackFromParameters( - longitudeOrCallback: number | string | GeocodedResultsCallback, - callbackOrErrorCallback?: GeocodedResultsCallback | ErrorCallback, + public static getErrorCallbackFromParameters( + longitudeOrCallback: number | string | GeocodedResultsCallback, + callbackOrErrorCallback?: GeocodedResultsCallback | ErrorCallback, errorCallback?: ErrorCallback ): undefined | ErrorCallback { if (errorCallback) { diff --git a/src/provider/ProviderInterface.ts b/src/provider/ProviderInterface.ts index 9d5c5bf..38c3585 100644 --- a/src/provider/ProviderInterface.ts +++ b/src/provider/ProviderInterface.ts @@ -1,4 +1,8 @@ -import { ExternalLoaderHeaders, ExternalLoaderParams } from "ExternalLoader"; +import { + ExternalLoaderBody, + ExternalLoaderHeaders, + ExternalLoaderParams, +} from "ExternalLoader"; import Geocoded from "Geocoded"; import { GeocodeQuery, @@ -21,25 +25,28 @@ export interface ProviderOptionsInterface { readonly apiKey?: string; } -export type GeocodedResultsCallback = (results: Geocoded[]) => void; +export type GeocodedResultsCallback = ( + results: G[] +) => void; export type ErrorCallback = (responseError: ResponseError) => void; -export default interface ProviderInterface { +export default interface ProviderInterface { geocode( query: string | GeocodeQuery | GeocodeQueryObject, - callback: GeocodedResultsCallback, + callback: GeocodedResultsCallback, errorCallback?: ErrorCallback ): void; geodecode( latitudeOrQuery: number | string | ReverseQuery | ReverseQueryObject, - longitudeOrCallback: number | string | GeocodedResultsCallback, - callbackOrErrorCallback?: GeocodedResultsCallback | ErrorCallback, + longitudeOrCallback: number | string | GeocodedResultsCallback, + callbackOrErrorCallback?: GeocodedResultsCallback | ErrorCallback, errorCallback?: ErrorCallback ): void; executeRequest( params: ExternalLoaderParams, - callback: GeocodedResultsCallback, + callback: GeocodedResultsCallback, headers?: ExternalLoaderHeaders, + body?: ExternalLoaderBody, errorCallback?: ErrorCallback ): void; } diff --git a/src/provider/YandexProvider.ts b/src/provider/YandexProvider.ts index 78fe75e..12a9ab4 100644 --- a/src/provider/YandexProvider.ts +++ b/src/provider/YandexProvider.ts @@ -1,4 +1,5 @@ import { + ExternalLoaderBody, ExternalLoaderHeaders, ExternalLoaderInterface, ExternalLoaderParams, @@ -91,7 +92,9 @@ export interface YandexProviderOptionsInterface readonly toponym?: "house" | "street" | "metro" | "district" | "locality"; } -export default class YandexProvider implements ProviderInterface { +type YandexGeocodedResultsCallback = GeocodedResultsCallback; + +export default class YandexProvider implements ProviderInterface { private externalLoader: ExternalLoaderInterface; private options: YandexProviderOptionsInterface; @@ -106,7 +109,7 @@ export default class YandexProvider implements ProviderInterface { public geocode( query: string | GeocodeQuery | GeocodeQueryObject, - callback: GeocodedResultsCallback, + callback: YandexGeocodedResultsCallback, errorCallback?: ErrorCallback ): void { const geocodeQuery = ProviderHelpers.getGeocodeQueryFromParameter(query); @@ -125,13 +128,13 @@ export default class YandexProvider implements ProviderInterface { jsonpCallback: this.options.useJsonp ? "callback" : undefined, }; - this.executeRequest(params, callback, {}, errorCallback); + this.executeRequest(params, callback, {}, {}, errorCallback); } public geodecode( latitudeOrQuery: number | string | ReverseQuery | ReverseQueryObject, - longitudeOrCallback: number | string | GeocodedResultsCallback, - callbackOrErrorCallback?: GeocodedResultsCallback | ErrorCallback, + longitudeOrCallback: number | string | YandexGeocodedResultsCallback, + callbackOrErrorCallback?: YandexGeocodedResultsCallback | ErrorCallback, errorCallback?: ErrorCallback ): void { const reverseQuery = ProviderHelpers.getReverseQueryFromParameters( @@ -165,13 +168,14 @@ export default class YandexProvider implements ProviderInterface { jsonpCallback: this.options.useJsonp ? "callback" : undefined, }; - this.executeRequest(params, reverseCallback, {}, reverseErrorCallback); + this.executeRequest(params, reverseCallback, {}, {}, reverseErrorCallback); } public executeRequest( params: ExternalLoaderParams, - callback: GeocodedResultsCallback, + callback: YandexGeocodedResultsCallback, headers?: ExternalLoaderHeaders, + body?: ExternalLoaderBody, errorCallback?: ErrorCallback ): void { this.externalLoader.executeRequest( @@ -185,6 +189,7 @@ export default class YandexProvider implements ProviderInterface { ); }, headers, + body, errorCallback ); } diff --git a/src/provider/googlemaps/GoogleMapsProvider.ts b/src/provider/googlemaps/GoogleMapsProvider.ts index f258d66..11373ba 100644 --- a/src/provider/googlemaps/GoogleMapsProvider.ts +++ b/src/provider/googlemaps/GoogleMapsProvider.ts @@ -1,4 +1,5 @@ import { + ExternalLoaderBody, ExternalLoaderHeaders, ExternalLoaderInterface, ExternalLoaderParams, @@ -168,7 +169,12 @@ export interface GoogleMapsProviderOptionsInterface readonly countryCodes?: string[]; } -export default class GoogleMapsProvider implements ProviderInterface { +type GoogleMapsGeocodedResultsCallback = GeocodedResultsCallback< + GoogleMapsGeocoded +>; + +export default class GoogleMapsProvider + implements ProviderInterface { private externalLoader: ExternalLoaderInterface; private options: GoogleMapsProviderOptionsInterface; @@ -203,7 +209,7 @@ export default class GoogleMapsProvider implements ProviderInterface { public geocode( query: string | GoogleMapsGeocodeQuery | GoogleMapsGeocodeQueryObject, - callback: GeocodedResultsCallback, + callback: GoogleMapsGeocodedResultsCallback, errorCallback?: ErrorCallback ): void { const geocodeQuery = ProviderHelpers.getGeocodeQueryFromParameter( @@ -240,7 +246,7 @@ export default class GoogleMapsProvider implements ProviderInterface { geocodeQuery ); - this.executeRequest(params, callback, {}, errorCallback); + this.executeRequest(params, callback, {}, {}, errorCallback); } public geodecode( @@ -249,8 +255,8 @@ export default class GoogleMapsProvider implements ProviderInterface { | string | GoogleMapsReverseQuery | GoogleMapsReverseQueryObject, - longitudeOrCallback: number | string | GeocodedResultsCallback, - callbackOrErrorCallback?: GeocodedResultsCallback | ErrorCallback, + longitudeOrCallback: number | string | GoogleMapsGeocodedResultsCallback, + callbackOrErrorCallback?: GoogleMapsGeocodedResultsCallback | ErrorCallback, errorCallback?: ErrorCallback ): void { const reverseQuery = ProviderHelpers.getReverseQueryFromParameters( @@ -289,7 +295,7 @@ export default class GoogleMapsProvider implements ProviderInterface { reverseQuery ); - this.executeRequest(params, reverseCallback, {}, reverseErrorCallback); + this.executeRequest(params, reverseCallback, {}, {}, reverseErrorCallback); } private withCommonParams( @@ -330,8 +336,9 @@ export default class GoogleMapsProvider implements ProviderInterface { public executeRequest( params: ExternalLoaderParams, - callback: GeocodedResultsCallback, + callback: GoogleMapsGeocodedResultsCallback, headers?: ExternalLoaderHeaders, + body?: ExternalLoaderBody, errorCallback?: ErrorCallback ): void { const { limit, ...externalLoaderParams } = params; @@ -383,6 +390,7 @@ export default class GoogleMapsProvider implements ProviderInterface { setTimeout(() => { throw new Error(errorMessage); }); + return; } const { results } = data; @@ -399,6 +407,7 @@ export default class GoogleMapsProvider implements ProviderInterface { ); }, headers, + body, errorCallback ); } diff --git a/src/provider/mapbox/MapboxProvider.ts b/src/provider/mapbox/MapboxProvider.ts index ad4479a..6a9b679 100644 --- a/src/provider/mapbox/MapboxProvider.ts +++ b/src/provider/mapbox/MapboxProvider.ts @@ -1,4 +1,5 @@ import { + ExternalLoaderBody, ExternalLoaderHeaders, ExternalLoaderInterface, ExternalLoaderParams, @@ -116,7 +117,10 @@ export const defaultMapboxProviderOptions = { geocodingMode: MAPBOX_GEOCODING_MODES.GEOCODING_MODE_PLACES, }; -export default class MapboxProvider implements ProviderInterface { +type MapboxGeocodedResultsCallback = GeocodedResultsCallback; + +export default class MapboxProvider + implements ProviderInterface { private externalLoader: ExternalLoaderInterface; private options: MapboxProviderOptionsInterface; @@ -136,7 +140,7 @@ export default class MapboxProvider implements ProviderInterface { public geocode( query: string | MapboxGeocodeQuery | MapboxGeocodeQueryObject, - callback: GeocodedResultsCallback, + callback: MapboxGeocodedResultsCallback, errorCallback?: ErrorCallback ): void { const geocodeQuery = ProviderHelpers.getGeocodeQueryFromParameter( @@ -173,7 +177,7 @@ export default class MapboxProvider implements ProviderInterface { geocodeQuery ); - this.executeRequest(params, callback, {}, errorCallback); + this.executeRequest(params, callback, {}, {}, errorCallback); } public geodecode( @@ -182,8 +186,8 @@ export default class MapboxProvider implements ProviderInterface { | string | MapboxReverseQuery | MapboxReverseQueryObject, - longitudeOrCallback: number | string | GeocodedResultsCallback, - callbackOrErrorCallback?: GeocodedResultsCallback | ErrorCallback, + longitudeOrCallback: number | string | MapboxGeocodedResultsCallback, + callbackOrErrorCallback?: MapboxGeocodedResultsCallback | ErrorCallback, errorCallback?: ErrorCallback ): void { const reverseQuery = ProviderHelpers.getReverseQueryFromParameters( @@ -221,7 +225,7 @@ export default class MapboxProvider implements ProviderInterface { reverseQuery ); - this.executeRequest(params, reverseCallback, {}, reverseErrorCallback); + this.executeRequest(params, reverseCallback, {}, {}, reverseErrorCallback); } private withCommonParams( @@ -244,8 +248,9 @@ export default class MapboxProvider implements ProviderInterface { public executeRequest( params: ExternalLoaderParams, - callback: GeocodedResultsCallback, + callback: MapboxGeocodedResultsCallback, headers?: ExternalLoaderHeaders, + body?: ExternalLoaderBody, errorCallback?: ErrorCallback ): void { this.externalLoader.executeRequest( @@ -258,6 +263,7 @@ export default class MapboxProvider implements ProviderInterface { ); }, headers, + body, errorCallback ); } diff --git a/src/provider/nominatim/NominatimProvider.ts b/src/provider/nominatim/NominatimProvider.ts index 5442495..172a714 100644 --- a/src/provider/nominatim/NominatimProvider.ts +++ b/src/provider/nominatim/NominatimProvider.ts @@ -1,4 +1,5 @@ import { + ExternalLoaderBody, ExternalLoaderHeaders, ExternalLoaderInterface, ExternalLoaderParams, @@ -98,7 +99,12 @@ export const defaultNominatimProviderOptions = { userAgent: "", }; -export default class NominatimProvider implements ProviderInterface { +type NominatimGeocodedResultsCallback = GeocodedResultsCallback< + NominatimGeocoded +>; + +export default class NominatimProvider + implements ProviderInterface { private externalLoader: ExternalLoaderInterface; private options: NominatimProviderOptionsInterface; @@ -121,7 +127,7 @@ export default class NominatimProvider implements ProviderInterface { public geocode( query: string | NominatimGeocodeQuery | NominatimGeocodeQueryObject, - callback: GeocodedResultsCallback, + callback: NominatimGeocodedResultsCallback, errorCallback?: ErrorCallback ): void { const geocodeQuery = ProviderHelpers.getGeocodeQueryFromParameter( @@ -159,7 +165,7 @@ export default class NominatimProvider implements ProviderInterface { geocodeQuery ); - this.executeRequest(params, callback, this.getHeaders(), errorCallback); + this.executeRequest(params, callback, this.getHeaders(), {}, errorCallback); } public geodecode( @@ -168,8 +174,8 @@ export default class NominatimProvider implements ProviderInterface { | string | NominatimReverseQuery | NominatimReverseQueryObject, - longitudeOrCallback: number | string | GeocodedResultsCallback, - callbackOrErrorCallback?: GeocodedResultsCallback | ErrorCallback, + longitudeOrCallback: number | string | NominatimGeocodedResultsCallback, + callbackOrErrorCallback?: NominatimGeocodedResultsCallback | ErrorCallback, errorCallback?: ErrorCallback ): void { const reverseQuery = ProviderHelpers.getReverseQueryFromParameters( @@ -207,6 +213,7 @@ export default class NominatimProvider implements ProviderInterface { params, reverseCallback, this.getHeaders(), + {}, reverseErrorCallback ); } @@ -233,8 +240,9 @@ export default class NominatimProvider implements ProviderInterface { public executeRequest( params: ExternalLoaderParams, - callback: GeocodedResultsCallback, + callback: NominatimGeocodedResultsCallback, headers?: ExternalLoaderHeaders, + body?: ExternalLoaderBody, errorCallback?: ErrorCallback ): void { this.externalLoader.executeRequest( @@ -253,6 +261,7 @@ export default class NominatimProvider implements ProviderInterface { setTimeout(() => { throw new Error(errorMessage); }); + return; } results = [data]; } @@ -263,6 +272,7 @@ export default class NominatimProvider implements ProviderInterface { ); }, headers, + body, errorCallback ); } diff --git a/src/provider/opencage/OpenCageProvider.ts b/src/provider/opencage/OpenCageProvider.ts index 8efc8bf..82b91a9 100644 --- a/src/provider/opencage/OpenCageProvider.ts +++ b/src/provider/opencage/OpenCageProvider.ts @@ -1,4 +1,5 @@ import { + ExternalLoaderBody, ExternalLoaderHeaders, ExternalLoaderInterface, ExternalLoaderParams, @@ -277,7 +278,12 @@ export const defaultOpenCageProviderOptions = { apiKey: "", }; -export default class OpenCageProvider implements ProviderInterface { +type OpenCageGeocodedResultsCallback = GeocodedResultsCallback< + OpenCageGeocoded +>; + +export default class OpenCageProvider + implements ProviderInterface { private externalLoader: ExternalLoaderInterface; private options: OpenCageProviderOptionsInterface; @@ -297,7 +303,7 @@ export default class OpenCageProvider implements ProviderInterface { public geocode( query: string | OpenCageGeocodeQuery | OpenCageGeocodeQueryObject, - callback: GeocodedResultsCallback, + callback: OpenCageGeocodedResultsCallback, errorCallback?: ErrorCallback ): void { const geocodeQuery = ProviderHelpers.getGeocodeQueryFromParameter( @@ -330,7 +336,7 @@ export default class OpenCageProvider implements ProviderInterface { geocodeQuery ); - this.executeRequest(params, callback, {}, errorCallback); + this.executeRequest(params, callback, {}, {}, errorCallback); } public geodecode( @@ -339,8 +345,8 @@ export default class OpenCageProvider implements ProviderInterface { | string | OpenCageReverseQuery | OpenCageReverseQueryObject, - longitudeOrCallback: number | string | GeocodedResultsCallback, - callbackOrErrorCallback?: GeocodedResultsCallback | ErrorCallback, + longitudeOrCallback: number | string | OpenCageGeocodedResultsCallback, + callbackOrErrorCallback?: OpenCageGeocodedResultsCallback | ErrorCallback, errorCallback?: ErrorCallback ): void { const reverseQuery = ProviderHelpers.getReverseQueryFromParameters( @@ -373,7 +379,7 @@ export default class OpenCageProvider implements ProviderInterface { reverseQuery ); - this.executeRequest(params, reverseCallback, {}, reverseErrorCallback); + this.executeRequest(params, reverseCallback, {}, {}, reverseErrorCallback); } private withCommonParams( @@ -396,8 +402,9 @@ export default class OpenCageProvider implements ProviderInterface { public executeRequest( params: ExternalLoaderParams, - callback: GeocodedResultsCallback, + callback: OpenCageGeocodedResultsCallback, headers?: ExternalLoaderHeaders, + body?: ExternalLoaderBody, errorCallback?: ErrorCallback ): void { this.externalLoader.executeRequest( @@ -410,6 +417,7 @@ export default class OpenCageProvider implements ProviderInterface { ); }, headers, + body, (error) => { const response = error.getResponse(); response.json().then((data: OpenCageResponse) => { diff --git a/src/query/GeocodeQuery.ts b/src/query/GeocodeQuery.ts index 97ae0a3..8a090a2 100644 --- a/src/query/GeocodeQuery.ts +++ b/src/query/GeocodeQuery.ts @@ -1,9 +1,6 @@ import { DEFAULT_RESULT_LIMIT } from "provider"; -import { PartialSome } from "types"; import { Bounds } from "index"; -type GeocodeQueryObjectCreate = PartialSome; - export interface GeocodeQueryObject { readonly text: string; readonly south?: number | string; @@ -37,7 +34,7 @@ export default class GeocodeQuery { east, locale, limit = DEFAULT_RESULT_LIMIT, - }: GeocodeQueryObjectCreate) { + }: GeocodeQueryObject) { this.text = text; this.south = south; this.west = west; @@ -47,7 +44,7 @@ export default class GeocodeQuery { this.limit = limit; } - public static create(object: GeocodeQueryObjectCreate): GeocodeQuery { + public static create(object: GeocodeQueryObject): GeocodeQuery { return new this(object); } diff --git a/src/query/ReverseQuery.ts b/src/query/ReverseQuery.ts index 912ac69..78227f2 100644 --- a/src/query/ReverseQuery.ts +++ b/src/query/ReverseQuery.ts @@ -1,14 +1,11 @@ import { DEFAULT_RESULT_LIMIT } from "provider"; -import { PartialSome } from "types"; import { Coordinates } from "index"; -type ReverseQueryObjectCreate = PartialSome; - export interface ReverseQueryObject { readonly latitude: number | string; readonly longitude: number | string; readonly locale?: string; - readonly limit: number; + readonly limit?: number; } export default class ReverseQuery { @@ -25,14 +22,14 @@ export default class ReverseQuery { longitude, locale, limit = DEFAULT_RESULT_LIMIT, - }: ReverseQueryObjectCreate) { + }: ReverseQueryObject) { this.latitude = latitude; this.longitude = longitude; this.locale = locale; this.limit = limit; } - public static create(object: ReverseQueryObjectCreate): ReverseQuery { + public static create(object: ReverseQueryObject): ReverseQuery { return new this(object); } diff --git a/tsconfig.json b/tsconfig.json index e66b723..7372b85 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -4,6 +4,7 @@ "declaration": true, "declarationDir": "types", "declarationMap": true, + "esModuleInterop": true, "outDir": "dist", "sourceMap": true, "strict": true, diff --git a/types/AdminLevel.d.ts b/types/AdminLevel.d.ts deleted file mode 100644 index 0a36627..0000000 --- a/types/AdminLevel.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -export interface AdminLevelObject { - readonly level: number; - readonly name: string; - readonly code?: string; -} -export default class AdminLevel { - private readonly level; - private readonly name; - private readonly code?; - private constructor(); - static create(object: AdminLevelObject): AdminLevel; - toObject(): AdminLevelObject; - getLevel(): number; - getName(): string; - getCode(): undefined | string; -} -//# sourceMappingURL=AdminLevel.d.ts.map \ No newline at end of file diff --git a/types/AdminLevel.d.ts.map b/types/AdminLevel.d.ts.map deleted file mode 100644 index 25f429a..0000000 --- a/types/AdminLevel.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"AdminLevel.d.ts","sourceRoot":"","sources":["../src/AdminLevel.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,CAAC,OAAO,OAAO,UAAU;IAC7B,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAS;IAE/B,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAS;IAE9B,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAS;IAE/B,OAAO;WAMO,MAAM,CAAC,MAAM,EAAE,gBAAgB,GAAG,UAAU;IAInD,QAAQ,IAAI,gBAAgB;IAQ5B,QAAQ,IAAI,MAAM;IAIlB,OAAO,IAAI,MAAM;IAIjB,OAAO,IAAI,SAAS,GAAG,MAAM;CAGrC"} \ No newline at end of file diff --git a/types/ExternalLoader.d.ts b/types/ExternalLoader.d.ts deleted file mode 100644 index 904813d..0000000 --- a/types/ExternalLoader.d.ts +++ /dev/null @@ -1,37 +0,0 @@ -import { ErrorCallback } from "./provider"; -export interface ExternalLoaderInterface { - setOptions(options: ExternalLoaderOptions): void; - getOptions(): ExternalLoaderOptions; - executeRequest(params: ExternalLoaderParams, callback: ResponseCallback, headers?: ExternalLoaderHeaders, errorCallback?: ErrorCallback): void; -} -export interface ExternalLoaderOptions { - readonly protocol: string; - readonly host?: string; - readonly pathname?: string; -} -export interface ExternalLoaderParams { - [param: string]: string | undefined; - jsonpCallback?: string; -} -export interface ExternalLoaderHeaders { - [header: string]: string | undefined; -} -declare type ResponseCallback = (response: any) => void; -/** - * Load data from external geocoding engines. - */ -export default class ExternalLoader implements ExternalLoaderInterface { - private options; - constructor(options?: ExternalLoaderOptions); - setOptions(options: ExternalLoaderOptions): void; - getOptions(): ExternalLoaderOptions; - executeRequest(params: ExternalLoaderParams, callback: ResponseCallback, externalLoaderHeaders?: ExternalLoaderHeaders, errorCallback?: ErrorCallback): void; - private static runJsonpCallback; - /** - * Generates randomly-named function to use as a callback for JSONP requests. - * @see https://github.com/OscarGodson/JSONP - */ - private static generateJsonpCallback; -} -export {}; -//# sourceMappingURL=ExternalLoader.d.ts.map \ No newline at end of file diff --git a/types/ExternalLoader.d.ts.map b/types/ExternalLoader.d.ts.map deleted file mode 100644 index 6c4e64d..0000000 --- a/types/ExternalLoader.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ExternalLoader.d.ts","sourceRoot":"","sources":["../src/ExternalLoader.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,mBAAiB;AAIzC,MAAM,WAAW,uBAAuB;IACtC,UAAU,CAAC,OAAO,EAAE,qBAAqB,GAAG,IAAI,CAAC;IACjD,UAAU,IAAI,qBAAqB,CAAC;IACpC,cAAc,CACZ,MAAM,EAAE,oBAAoB,EAC5B,QAAQ,EAAE,gBAAgB,EAC1B,OAAO,CAAC,EAAE,qBAAqB,EAC/B,aAAa,CAAC,EAAE,aAAa,GAC5B,IAAI,CAAC;CACT;AAED,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED,MAAM,WAAW,oBAAoB;IACnC,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;IACpC,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,qBAAqB;IACpC,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;CACtC;AAGD,aAAK,gBAAgB,GAAG,CAAC,QAAQ,EAAE,GAAG,KAAK,IAAI,CAAC;AAMhD;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,cAAe,YAAW,uBAAuB;IACpE,OAAO,CAAC,OAAO,CAAyC;gBAErC,OAAO,GAAE,qBAAsC;IAI3D,UAAU,CAAC,OAAO,EAAE,qBAAqB,GAAG,IAAI;IAIhD,UAAU,IAAI,qBAAqB;IAInC,cAAc,CACnB,MAAM,EAAE,oBAAoB,EAC5B,QAAQ,EAAE,gBAAgB,EAC1B,qBAAqB,CAAC,EAAE,qBAAqB,EAC7C,aAAa,CAAC,EAAE,aAAa,GAC5B,IAAI;IAoDP,OAAO,CAAC,MAAM,CAAC,gBAAgB;IA0B/B;;;OAGG;IACH,OAAO,CAAC,MAAM,CAAC,qBAAqB;CAoBrC"} \ No newline at end of file diff --git a/types/GeoJsonDumper.d.ts b/types/GeoJsonDumper.d.ts deleted file mode 100644 index fcc10d5..0000000 --- a/types/GeoJsonDumper.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -import Geocoded from "./Geocoded"; -import AdminLevel, { AdminLevelObject } from "./AdminLevel"; -export interface GeoJson { - readonly type: "Feature"; - readonly properties: { - readonly [property: string]: string | string[] | number | boolean | AdminLevel[] | AdminLevelObject[] | undefined; - }; - readonly geometry: { - readonly type: "Point"; - readonly coordinates: [number | undefined, number | undefined]; - }; - readonly bounds?: { - readonly south: number; - readonly west: number; - readonly north: number; - readonly east: number; - }; -} -export default class GeoJsonDumper { - private static baseGeoJson; - static dump(geocoded: Geocoded): GeoJson; -} -//# sourceMappingURL=GeoJsonDumper.d.ts.map \ No newline at end of file diff --git a/types/GeoJsonDumper.d.ts.map b/types/GeoJsonDumper.d.ts.map deleted file mode 100644 index b2dce88..0000000 --- a/types/GeoJsonDumper.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"GeoJsonDumper.d.ts","sourceRoot":"","sources":["../src/GeoJsonDumper.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,mBAAiB;AAChC,OAAO,UAAU,EAAE,EAAE,gBAAgB,EAAE,qBAAmB;AAE1D,MAAM,WAAW,OAAO;IACtB,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IACzB,QAAQ,CAAC,UAAU,EAAE;QACnB,QAAQ,EAAE,QAAQ,EAAE,MAAM,GACtB,MAAM,GACN,MAAM,EAAE,GACR,MAAM,GACN,OAAO,GACP,UAAU,EAAE,GACZ,gBAAgB,EAAE,GAClB,SAAS,CAAC;KACf,CAAC;IACF,QAAQ,CAAC,QAAQ,EAAE;QACjB,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;QACvB,QAAQ,CAAC,WAAW,EAAE,CAAC,MAAM,GAAG,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;KAChE,CAAC;IACF,QAAQ,CAAC,MAAM,CAAC,EAAE;QAChB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;QACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;QACtB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;QACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;KACvB,CAAC;CACH;AAED,MAAM,CAAC,OAAO,OAAO,aAAa;IAChC,OAAO,CAAC,MAAM,CAAC,WAAW,CAOxB;WAEY,IAAI,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO;CAmDhD"} \ No newline at end of file diff --git a/types/Geocoded.d.ts b/types/Geocoded.d.ts deleted file mode 100644 index 692a2e8..0000000 --- a/types/Geocoded.d.ts +++ /dev/null @@ -1,62 +0,0 @@ -import AdminLevel from "./AdminLevel"; -export interface GeocodedObject { - readonly [property: string]: string | string[] | number | boolean | AdminLevel[] | undefined; - readonly latitude?: number; - readonly longitude?: number; - readonly south?: number; - readonly west?: number; - readonly north?: number; - readonly east?: number; - readonly formattedAddress?: string; - readonly streetNumber?: string; - readonly streetName?: string; - readonly subLocality?: string; - readonly locality?: string; - readonly postalCode?: string; - readonly region?: string; - readonly adminLevels?: AdminLevel[]; - readonly country?: string; - readonly countryCode?: string; - readonly timezone?: string; -} -export default class Geocoded { - private readonly latitude?; - private readonly longitude?; - private readonly south?; - private readonly west?; - private readonly north?; - private readonly east?; - private readonly formattedAddress?; - private readonly streetNumber?; - private readonly streetName?; - private readonly subLocality?; - private readonly locality?; - private readonly postalCode?; - private readonly region?; - private readonly adminLevels; - private readonly country?; - private readonly countryCode?; - private readonly timezone?; - protected constructor({ latitude, longitude, south, west, north, east, formattedAddress, streetNumber, streetName, subLocality, locality, postalCode, region, adminLevels, country, countryCode, timezone, }: GeocodedObject); - static create(object: GeocodedObject): Geocoded; - toObject(): GeocodedObject; - withBounds(south?: number, west?: number, north?: number, east?: number): Geocoded; - withCoordinates(latitude?: number, longitude?: number): Geocoded; - getCoordinates(): [undefined | number, undefined | number]; - getLatitude(): undefined | number; - getLongitude(): undefined | number; - getBounds(): [undefined | number, undefined | number, undefined | number, undefined | number]; - getFormattedAddress(): undefined | string; - getStreetNumber(): undefined | string; - getStreetName(): undefined | string; - getSubLocality(): undefined | string; - getLocality(): undefined | string; - getPostalCode(): undefined | string; - getRegion(): undefined | string; - addAdminLevel(adminLevel: AdminLevel): void; - getAdminLevels(): AdminLevel[]; - getCountry(): undefined | string; - getCountryCode(): undefined | string; - getTimezone(): undefined | string; -} -//# sourceMappingURL=Geocoded.d.ts.map \ No newline at end of file diff --git a/types/Geocoded.d.ts.map b/types/Geocoded.d.ts.map deleted file mode 100644 index 2365e81..0000000 --- a/types/Geocoded.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Geocoded.d.ts","sourceRoot":"","sources":["../src/Geocoded.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,qBAAmB;AAEpC,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE,QAAQ,EAAE,MAAM,GACtB,MAAM,GACN,MAAM,EAAE,GACR,MAAM,GACN,OAAO,GACP,UAAU,EAAE,GACZ,SAAS,CAAC;IACd,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IACnC,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,WAAW,CAAC,EAAE,UAAU,EAAE,CAAC;IACpC,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED,MAAM,CAAC,OAAO,OAAO,QAAQ;IAC3B,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAS;IAEnC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAS;IAEpC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAS;IAEhC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAS;IAE/B,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAS;IAEhC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAS;IAE/B,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAC,CAAS;IAE3C,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAS;IAEvC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAS;IAErC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAS;IAEtC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAS;IAEnC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAS;IAErC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAS;IAEjC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAe;IAE3C,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAS;IAElC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAS;IAEtC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAS;IAEnC,SAAS,aAAa,EACpB,QAAQ,EACR,SAAS,EACT,KAAK,EACL,IAAI,EACJ,KAAK,EACL,IAAI,EACJ,gBAAgB,EAChB,YAAY,EACZ,UAAU,EACV,WAAW,EACX,QAAQ,EACR,UAAU,EACV,MAAM,EACN,WAAW,EACX,OAAO,EACP,WAAW,EACX,QAAQ,GACT,EAAE,cAAc;WAoBH,MAAM,CAAC,MAAM,EAAE,cAAc,GAAG,QAAQ;IAI/C,QAAQ,IAAI,cAAc;IAsB1B,UAAU,CACf,KAAK,CAAC,EAAE,MAAM,EACd,IAAI,CAAC,EAAE,MAAM,EACb,KAAK,CAAC,EAAE,MAAM,EACd,IAAI,CAAC,EAAE,MAAM,GACZ,QAAQ;IAUJ,eAAe,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,QAAQ;IAQhE,cAAc,IAAI,CAAC,SAAS,GAAG,MAAM,EAAE,SAAS,GAAG,MAAM,CAAC;IAI1D,WAAW,IAAI,SAAS,GAAG,MAAM;IAIjC,YAAY,IAAI,SAAS,GAAG,MAAM;IAIlC,SAAS,IAAI,CAClB,SAAS,GAAG,MAAM,EAClB,SAAS,GAAG,MAAM,EAClB,SAAS,GAAG,MAAM,EAClB,SAAS,GAAG,MAAM,CACnB;IAIM,mBAAmB,IAAI,SAAS,GAAG,MAAM;IAIzC,eAAe,IAAI,SAAS,GAAG,MAAM;IAIrC,aAAa,IAAI,SAAS,GAAG,MAAM;IAInC,cAAc,IAAI,SAAS,GAAG,MAAM;IAIpC,WAAW,IAAI,SAAS,GAAG,MAAM;IAIjC,aAAa,IAAI,SAAS,GAAG,MAAM;IAInC,SAAS,IAAI,SAAS,GAAG,MAAM;IAI/B,aAAa,CAAC,UAAU,EAAE,UAAU,GAAG,IAAI;IAI3C,cAAc,IAAI,UAAU,EAAE;IAI9B,UAAU,IAAI,SAAS,GAAG,MAAM;IAIhC,cAAc,IAAI,SAAS,GAAG,MAAM;IAIpC,WAAW,IAAI,SAAS,GAAG,MAAM;CAGzC"} \ No newline at end of file diff --git a/types/GeocoderProviderFactory.d.ts b/types/GeocoderProviderFactory.d.ts deleted file mode 100644 index 011acd9..0000000 --- a/types/GeocoderProviderFactory.d.ts +++ /dev/null @@ -1,42 +0,0 @@ -import { BingProvider, ChainProvider, ChainProviderOptionsInterface, GoogleMapsProvider, GoogleMapsProviderOptionsInterface, MapboxProvider, MapboxProviderOptionsInterface, MapquestProvider, NominatimProvider, NominatimProviderOptionsInterface, OpenCageProvider, OpenCageProviderOptionsInterface, YandexProvider, YandexProviderOptionsInterface, ProviderOptionsInterface } from "./provider"; -interface ProviderOptionInterface { - provider: "bing" | "chain" | "google" | "googlemaps" | "mapbox" | "mapquest" | "nominatim" | "opencage" | "openstreetmap" | "yandex"; -} -interface ProviderFactoryOptions extends ProviderOptionsInterface, ProviderOptionInterface { -} -interface ChainGeocoderProviderFactoryOptions extends ProviderOptionInterface, ChainProviderOptionsInterface { - provider: "chain"; -} -interface GoogleMapsGeocoderProviderFactoryOptions extends ProviderOptionInterface, GoogleMapsProviderOptionsInterface { - provider: "google" | "googlemaps"; -} -interface MapboxGeocoderProviderFactoryOptions extends ProviderOptionInterface, MapboxProviderOptionsInterface { - provider: "mapbox"; -} -interface NominatimGeocoderProviderFactoryOptions extends ProviderOptionInterface, NominatimProviderOptionsInterface { - provider: "nominatim" | "openstreetmap"; -} -interface OpenCageGeocoderProviderFactoryOptions extends ProviderOptionInterface, OpenCageProviderOptionsInterface { - provider: "opencage"; -} -interface YandexGeocoderProviderFactoryOptions extends ProviderOptionInterface, YandexProviderOptionsInterface { - provider: "yandex"; -} -export declare type GeocoderProviderFactoryOptions = ProviderFactoryOptions | ChainGeocoderProviderFactoryOptions | GoogleMapsGeocoderProviderFactoryOptions | MapboxGeocoderProviderFactoryOptions | NominatimGeocoderProviderFactoryOptions | OpenCageGeocoderProviderFactoryOptions | YandexGeocoderProviderFactoryOptions; -export declare type GeocoderProvider = BingProvider | ChainProvider | GoogleMapsProvider | MapboxProvider | MapquestProvider | NominatimProvider | OpenCageProvider | YandexProvider; -export declare type GeocoderProviderByOptionsType = O extends ChainGeocoderProviderFactoryOptions ? ChainProvider : O extends GoogleMapsGeocoderProviderFactoryOptions ? GoogleMapsProvider : O extends MapboxGeocoderProviderFactoryOptions ? MapboxProvider : O extends NominatimGeocoderProviderFactoryOptions ? NominatimProvider : O extends OpenCageGeocoderProviderFactoryOptions ? OpenCageProvider : O extends YandexGeocoderProviderFactoryOptions ? YandexProvider : GeocoderProvider; -export default class ProviderFactory { - /** - * Creates Geocoder Provider instances. - * @param options - * Either a string representing the registered provider, or an object with the - * following settings for instigating providers: - * - provider: A string representing the registered provider. - * @return - * An object compatible with ProviderInterface, or undefined if there's not a - * registered provider. - */ - static createProvider(options: string | O): GeocoderProviderByOptionsType | undefined; -} -export {}; -//# sourceMappingURL=GeocoderProviderFactory.d.ts.map \ No newline at end of file diff --git a/types/GeocoderProviderFactory.d.ts.map b/types/GeocoderProviderFactory.d.ts.map deleted file mode 100644 index 7d8286a..0000000 --- a/types/GeocoderProviderFactory.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"GeocoderProviderFactory.d.ts","sourceRoot":"","sources":["../src/GeocoderProviderFactory.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,aAAa,EACb,6BAA6B,EAC7B,kBAAkB,EAClB,kCAAkC,EAClC,cAAc,EACd,8BAA8B,EAC9B,gBAAgB,EAChB,iBAAiB,EACjB,iCAAiC,EACjC,gBAAgB,EAChB,gCAAgC,EAChC,cAAc,EACd,8BAA8B,EAC9B,wBAAwB,EAMzB,mBAAiB;AAGlB,UAAU,uBAAuB;IAC/B,QAAQ,EACJ,MAAM,GACN,OAAO,GACP,QAAQ,GACR,YAAY,GACZ,QAAQ,GACR,UAAU,GACV,WAAW,GACX,UAAU,GACV,eAAe,GACf,QAAQ,CAAC;CACd;AAED,UAAU,sBACR,SAAQ,wBAAwB,EAC9B,uBAAuB;CAAG;AAE9B,UAAU,mCACR,SAAQ,uBAAuB,EAC7B,6BAA6B;IAC/B,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED,UAAU,wCACR,SAAQ,uBAAuB,EAC7B,kCAAkC;IACpC,QAAQ,EAAE,QAAQ,GAAG,YAAY,CAAC;CACnC;AAED,UAAU,oCACR,SAAQ,uBAAuB,EAC7B,8BAA8B;IAChC,QAAQ,EAAE,QAAQ,CAAC;CACpB;AAED,UAAU,uCACR,SAAQ,uBAAuB,EAC7B,iCAAiC;IACnC,QAAQ,EAAE,WAAW,GAAG,eAAe,CAAC;CACzC;AAED,UAAU,sCACR,SAAQ,uBAAuB,EAC7B,gCAAgC;IAClC,QAAQ,EAAE,UAAU,CAAC;CACtB;AAED,UAAU,oCACR,SAAQ,uBAAuB,EAC7B,8BAA8B;IAChC,QAAQ,EAAE,QAAQ,CAAC;CACpB;AAED,oBAAY,8BAA8B,GACtC,sBAAsB,GACtB,mCAAmC,GACnC,wCAAwC,GACxC,oCAAoC,GACpC,uCAAuC,GACvC,sCAAsC,GACtC,oCAAoC,CAAC;AAEzC,oBAAY,gBAAgB,GACxB,YAAY,GACZ,aAAa,GACb,kBAAkB,GAClB,cAAc,GACd,gBAAgB,GAChB,iBAAiB,GACjB,gBAAgB,GAChB,cAAc,CAAC;AAEnB,oBAAY,6BAA6B,CACvC,CAAC,IACC,CAAC,SAAS,mCAAmC,GAC7C,aAAa,GACb,CAAC,SAAS,wCAAwC,GAClD,kBAAkB,GAClB,CAAC,SAAS,oCAAoC,GAC9C,cAAc,GACd,CAAC,SAAS,uCAAuC,GACjD,iBAAiB,GACjB,CAAC,SAAS,sCAAsC,GAChD,gBAAgB,GAChB,CAAC,SAAS,oCAAoC,GAC9C,cAAc,GACd,gBAAgB,CAAC;AAErB,MAAM,CAAC,OAAO,OAAO,eAAe;IAClC;;;;;;;;;OASG;WACW,cAAc,CAAC,CAAC,SAAS,8BAA8B,EACnE,OAAO,EAAE,MAAM,GAAG,CAAC,GAClB,6BAA6B,CAAC,CAAC,CAAC,GAAG,SAAS;CA2DhD"} \ No newline at end of file diff --git a/types/UniversalGeocoder.d.ts b/types/UniversalGeocoder.d.ts deleted file mode 100644 index 82cba6d..0000000 --- a/types/UniversalGeocoder.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { GeocoderProviderByOptionsType, GeocoderProviderFactoryOptions } from "./GeocoderProviderFactory"; -export default class UniversalGeocoder { - version: string; - static createGeocoder(options: string | O): GeocoderProviderByOptionsType | undefined; -} -//# sourceMappingURL=UniversalGeocoder.d.ts.map \ No newline at end of file diff --git a/types/UniversalGeocoder.d.ts.map b/types/UniversalGeocoder.d.ts.map deleted file mode 100644 index 85fa654..0000000 --- a/types/UniversalGeocoder.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"UniversalGeocoder.d.ts","sourceRoot":"","sources":["../src/UniversalGeocoder.ts"],"names":[],"mappings":"AAAA,OAAwB,EACtB,6BAA6B,EAC7B,8BAA8B,EAC/B,kCAAgC;AAEjC,MAAM,CAAC,OAAO,OAAO,iBAAiB;IAC7B,OAAO,SAAW;WAEX,cAAc,CAAC,CAAC,SAAS,8BAA8B,EACnE,OAAO,EAAE,MAAM,GAAG,CAAC,GAClB,6BAA6B,CAAC,CAAC,CAAC,GAAG,SAAS;CAGhD"} \ No newline at end of file diff --git a/types/error/ResponseError.d.ts b/types/error/ResponseError.d.ts deleted file mode 100644 index a99d576..0000000 --- a/types/error/ResponseError.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { GoogleMapsResponse, MapboxResponse, NominatimResponse, OpenCageResponse } from "../provider"; -export default class ResponseError extends Error { - __proto__: ResponseError; - private readonly response; - constructor(message: string, response: Response | GoogleMapsResponse | MapboxResponse | NominatimResponse | OpenCageResponse); - getResponse(): Response | GoogleMapsResponse | MapboxResponse | NominatimResponse | OpenCageResponse; -} -//# sourceMappingURL=ResponseError.d.ts.map \ No newline at end of file diff --git a/types/error/ResponseError.d.ts.map b/types/error/ResponseError.d.ts.map deleted file mode 100644 index 3d3b33c..0000000 --- a/types/error/ResponseError.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ResponseError.d.ts","sourceRoot":"","sources":["../../src/error/ResponseError.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAClB,cAAc,EACd,iBAAiB,EACjB,gBAAgB,EACjB,oBAAiB;AAElB,MAAM,CAAC,OAAO,OAAO,aAAc,SAAQ,KAAK;IACvC,SAAS,EAAE,aAAa,CAAC;IAEhC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAKJ;gBAGnB,OAAO,EAAE,MAAM,EACf,QAAQ,EACJ,QAAQ,GACR,kBAAkB,GAClB,cAAc,GACd,iBAAiB,GACjB,gBAAgB;IAUf,WAAW,IACd,QAAQ,GACR,kBAAkB,GAClB,cAAc,GACd,iBAAiB,GACjB,gBAAgB;CAGrB"} \ No newline at end of file diff --git a/types/error/index.d.ts b/types/error/index.d.ts deleted file mode 100644 index a690fb6..0000000 --- a/types/error/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { default as ResponseError } from "./ResponseError"; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/types/error/index.d.ts.map b/types/error/index.d.ts.map deleted file mode 100644 index caf8182..0000000 --- a/types/error/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/error/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAClB,iBAAiB,CAD6B"} \ No newline at end of file diff --git a/types/global.d.ts b/types/global.d.ts deleted file mode 100644 index 0dc3864..0000000 --- a/types/global.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import UniversalGeocoder from "./UniversalGeocoder"; -import GeoJsonDumper from "./GeoJsonDumper"; -declare global { - interface Window { - UniversalGeocoder: typeof UniversalGeocoder; - GeoJsonDumper: typeof GeoJsonDumper; - } -} -//# sourceMappingURL=global.d.ts.map \ No newline at end of file diff --git a/types/global.d.ts.map b/types/global.d.ts.map deleted file mode 100644 index 1b82656..0000000 --- a/types/global.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"global.d.ts","sourceRoot":"","sources":["../src/global.ts"],"names":[],"mappings":"AAAA,OAAO,iBAAiB,4BAA0B;AAClD,OAAO,aAAa,wBAAsB;AAO1C,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,iBAAiB,EAAE,OAAO,iBAAiB,CAAC;QAC5C,aAAa,EAAE,OAAO,aAAa,CAAC;KACrC;CACF"} \ No newline at end of file diff --git a/types/index.d.ts b/types/index.d.ts deleted file mode 100644 index 422f23e..0000000 --- a/types/index.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -export interface Bounds { - readonly south: number | string; - readonly west: number | string; - readonly north: number | string; - readonly east: number | string; -} -export interface Coordinates { - readonly latitude: number | string; - readonly longitude: number | string; -} -export * from "./provider"; -export * from "./query"; -export * from "./utils"; -export { default as AdminLevel } from "./AdminLevel"; -export * from "./AdminLevel"; -export { default as ExternalLoader } from "./ExternalLoader"; -export * from "./ExternalLoader"; -export { default as Geocoded } from "./Geocoded"; -export * from "./Geocoded"; -export { default as GeocoderProviderFactory } from "./GeocoderProviderFactory"; -export * from "./GeocoderProviderFactory"; -export { default as GeoJsonDumper } from "./GeoJsonDumper"; -export * from "./GeoJsonDumper"; -export { default } from "./UniversalGeocoder"; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/types/index.d.ts.map b/types/index.d.ts.map deleted file mode 100644 index 1a26a70..0000000 --- a/types/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,MAAM;IACrB,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IAChC,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;IAC/B,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IAChC,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;CAChC;AAED,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAAC;IACnC,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAAC;CACrC;AAED,cAc2I,YAAY,CAd9H;AACzB,cAauJ,SAAS,CAb1I;AACtB,cAYgK,SAAS,CAZnJ;AACtB,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAWyI,cAAc,CAXpI;AACnD,cAUyK,cAAc,CAV5J;AAC3B,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MASmJ,kBAAkB,CAT9I;AAC3D,cAQuL,kBAAkB,CAR1K;AAC/B,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAO2K,YAAY,CAPtK;AAC/C,cAMyM,YAAY,CAN5L;AACzB,OAAO,EAAE,OAAO,IAAI,uBAAuB,EAAE,MAKwK,2BAA2B,CALnK;AAC7E,cAIqN,2BAA2B,CAJxM;AACxC,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAG6M,iBAAiB,CAHxM;AACzD,cAEgP,iBAAiB,CAFnO;AAC9B,OAAO,EAAE,OAAO,EAAE,MAC+O,qBAAqB,CAD1O"} \ No newline at end of file diff --git a/types/provider/BingProvider.d.ts b/types/provider/BingProvider.d.ts deleted file mode 100644 index 5b1c7b5..0000000 --- a/types/provider/BingProvider.d.ts +++ /dev/null @@ -1,42 +0,0 @@ -import { ExternalLoaderHeaders, ExternalLoaderInterface, ExternalLoaderParams } from "../ExternalLoader"; -import { ErrorCallback, GeocodedResultsCallback, ProviderInterface, ProviderOptionsInterface } from "./"; -import Geocoded from "../Geocoded"; -import { GeocodeQuery, GeocodeQueryObject, ReverseQuery, ReverseQueryObject } from "../query"; -import { Box } from "../types"; -export interface BingResult { - __type: string; - bbox: Box; - name: string; - point: { - type: string; - coordinates: [number, number]; - }; - address: { - addressLine: string; - adminDistrict: string; - adminDistrict2: string; - countryRegion: string; - formattedAddress: string; - locality: string; - postalCode: string; - }; - confidence: string; - entityType: string; - geocodePoints: { - type: string; - coordinates: [number, number]; - calculationMethod: string; - usageTypes: string[]; - }[]; - matchCodes: string[]; -} -export default class BingProvider implements ProviderInterface { - private externalLoader; - private options; - constructor(_externalLoader: ExternalLoaderInterface, options?: ProviderOptionsInterface); - geocode(query: string | GeocodeQuery | GeocodeQueryObject, callback: GeocodedResultsCallback, errorCallback?: ErrorCallback): void; - geodecode(latitudeOrQuery: number | string | ReverseQuery | ReverseQueryObject, longitudeOrCallback: number | string | GeocodedResultsCallback, callbackOrErrorCallback?: GeocodedResultsCallback | ErrorCallback, errorCallback?: ErrorCallback): void; - executeRequest(params: ExternalLoaderParams, callback: GeocodedResultsCallback, headers?: ExternalLoaderHeaders, errorCallback?: ErrorCallback): void; - static mapToGeocoded(result: BingResult): Geocoded; -} -//# sourceMappingURL=BingProvider.d.ts.map \ No newline at end of file diff --git a/types/provider/BingProvider.d.ts.map b/types/provider/BingProvider.d.ts.map deleted file mode 100644 index 571d965..0000000 --- a/types/provider/BingProvider.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"BingProvider.d.ts","sourceRoot":"","sources":["../../src/provider/BingProvider.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EACrB,uBAAuB,EACvB,oBAAoB,EACrB,0BAAuB;AACxB,OAAO,EACL,aAAa,EACb,uBAAuB,EAEvB,iBAAiB,EACjB,wBAAwB,EAEzB,WAAiB;AAClB,OAAO,QAAQ,oBAAiB;AAChC,OAAO,EACL,YAAY,EACZ,kBAAkB,EAClB,YAAY,EACZ,kBAAkB,EACnB,iBAAc;AACf,OAAO,EAAE,GAAG,EAAE,iBAAc;AAQ5B,MAAM,WAAW,UAAU;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,GAAG,CAAC;IACV,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE;QACL,IAAI,EAAE,MAAM,CAAC;QACb,WAAW,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;KAC/B,CAAC;IACF,OAAO,EAAE;QACP,WAAW,EAAE,MAAM,CAAC;QACpB,aAAa,EAAE,MAAM,CAAC;QACtB,cAAc,EAAE,MAAM,CAAC;QACvB,aAAa,EAAE,MAAM,CAAC;QACtB,gBAAgB,EAAE,MAAM,CAAC;QACzB,QAAQ,EAAE,MAAM,CAAC;QACjB,UAAU,EAAE,MAAM,CAAC;KACpB,CAAC;IACF,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE;QACb,IAAI,EAAE,MAAM,CAAC;QACb,WAAW,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QAC9B,iBAAiB,EAAE,MAAM,CAAC;QAC1B,UAAU,EAAE,MAAM,EAAE,CAAC;KACtB,EAAE,CAAC;IACJ,UAAU,EAAE,MAAM,EAAE,CAAC;CACtB;AAED,MAAM,CAAC,OAAO,OAAO,YAAa,YAAW,iBAAiB;IAC5D,OAAO,CAAC,cAAc,CAA0B;IAEhD,OAAO,CAAC,OAAO,CAA2B;gBAGxC,eAAe,EAAE,uBAAuB,EACxC,OAAO,GAAE,wBAAiD;IAWrD,OAAO,CACZ,KAAK,EAAE,MAAM,GAAG,YAAY,GAAG,kBAAkB,EACjD,QAAQ,EAAE,uBAAuB,EACjC,aAAa,CAAC,EAAE,aAAa,GAC5B,IAAI;IAiBA,SAAS,CACd,eAAe,EAAE,MAAM,GAAG,MAAM,GAAG,YAAY,GAAG,kBAAkB,EACpE,mBAAmB,EAAE,MAAM,GAAG,MAAM,GAAG,uBAAuB,EAC9D,uBAAuB,CAAC,EAAE,uBAAuB,GAAG,aAAa,EACjE,aAAa,CAAC,EAAE,aAAa,GAC5B,IAAI;IA+BA,cAAc,CACnB,MAAM,EAAE,oBAAoB,EAC5B,QAAQ,EAAE,uBAAuB,EACjC,OAAO,CAAC,EAAE,qBAAqB,EAC/B,aAAa,CAAC,EAAE,aAAa,GAC5B,IAAI;WAeO,aAAa,CAAC,MAAM,EAAE,UAAU,GAAG,QAAQ;CA4B1D"} \ No newline at end of file diff --git a/types/provider/ChainProvider.d.ts b/types/provider/ChainProvider.d.ts deleted file mode 100644 index 70268b6..0000000 --- a/types/provider/ChainProvider.d.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { ExternalLoaderParams } from "../ExternalLoader"; -import { ErrorCallback, GeocodedResultsCallback, ProviderInterface, ProviderOptionsInterface } from "./"; -import { GeocodeQuery, GeocodeQueryObject, ReverseQuery, ReverseQueryObject } from "../query"; -export interface ChainProviderOptionsInterface extends ProviderOptionsInterface { - readonly providers: ProviderInterface[]; - readonly parallelize?: boolean; - readonly first?: boolean; -} -export declare const defaultChainProviderOptions: { - providers: never[]; - useSsl?: boolean | undefined; - useJsonp?: boolean | undefined; - apiKey?: string | undefined; -}; -export default class ChainProvider implements ProviderInterface { - private options; - constructor(options?: ChainProviderOptionsInterface); - geocode(query: string | GeocodeQuery | GeocodeQueryObject, callback: GeocodedResultsCallback, errorCallback?: ErrorCallback): void; - geodecode(latitudeOrQuery: number | string | ReverseQuery | ReverseQueryObject, longitudeOrCallback: number | string | GeocodedResultsCallback, callbackOrErrorCallback?: GeocodedResultsCallback | ErrorCallback, errorCallback?: ErrorCallback): void; - private geocodeNextProvider; - private geodecodeNextProvider; - private geocodeAllProviders; - private geodecodeAllProviders; - executeRequest(params: ExternalLoaderParams, callback: GeocodedResultsCallback): void; -} -//# sourceMappingURL=ChainProvider.d.ts.map \ No newline at end of file diff --git a/types/provider/ChainProvider.d.ts.map b/types/provider/ChainProvider.d.ts.map deleted file mode 100644 index cb2ccb9..0000000 --- a/types/provider/ChainProvider.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ChainProvider.d.ts","sourceRoot":"","sources":["../../src/provider/ChainProvider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,0BAAuB;AAEtD,OAAO,EACL,aAAa,EACb,uBAAuB,EAEvB,iBAAiB,EACjB,wBAAwB,EAEzB,WAAiB;AAClB,OAAO,EACL,YAAY,EACZ,kBAAkB,EAClB,YAAY,EACZ,kBAAkB,EACnB,iBAAc;AAEf,MAAM,WAAW,6BACf,SAAQ,wBAAwB;IAChC,QAAQ,CAAC,SAAS,EAAE,iBAAiB,EAAE,CAAC;IACxC,QAAQ,CAAC,WAAW,CAAC,EAAE,OAAO,CAAC;IAC/B,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED,eAAO,MAAM,2BAA2B;;;;;CAGvC,CAAC;AAEF,MAAM,CAAC,OAAO,OAAO,aAAc,YAAW,iBAAiB;IAC7D,OAAO,CAAC,OAAO,CAAgC;gBAG7C,OAAO,GAAE,6BAA2D;IAK/D,OAAO,CACZ,KAAK,EAAE,MAAM,GAAG,YAAY,GAAG,kBAAkB,EACjD,QAAQ,EAAE,uBAAuB,EACjC,aAAa,CAAC,EAAE,aAAa,GAC5B,IAAI;IAcA,SAAS,CACd,eAAe,EAAE,MAAM,GAAG,MAAM,GAAG,YAAY,GAAG,kBAAkB,EACpE,mBAAmB,EAAE,MAAM,GAAG,MAAM,GAAG,uBAAuB,EAC9D,uBAAuB,CAAC,EAAE,uBAAuB,GAAG,aAAa,EACjE,aAAa,CAAC,EAAE,aAAa,GAC5B,IAAI;IAgCP,OAAO,CAAC,mBAAmB;IA+B3B,OAAO,CAAC,qBAAqB;IAoC7B,OAAO,CAAC,mBAAmB;IA0D3B,OAAO,CAAC,qBAAqB;IA2DtB,cAAc,CAEnB,MAAM,EAAE,oBAAoB,EAE5B,QAAQ,EAAE,uBAAuB,GAChC,IAAI;CAKR"} \ No newline at end of file diff --git a/types/provider/MapquestProvider.d.ts b/types/provider/MapquestProvider.d.ts deleted file mode 100644 index 04323b9..0000000 --- a/types/provider/MapquestProvider.d.ts +++ /dev/null @@ -1,42 +0,0 @@ -import { ExternalLoaderHeaders, ExternalLoaderInterface, ExternalLoaderParams } from "../ExternalLoader"; -import { ErrorCallback, GeocodedResultsCallback, ProviderInterface, ProviderOptionsInterface } from "./"; -import Geocoded from "../Geocoded"; -import { GeocodeQuery, GeocodeQueryObject, ReverseQuery, ReverseQueryObject } from "../query"; -export interface MapQuestResult { - latLng: { - lat: number; - lng: number; - }; - displayLatLng: { - lat: number; - lng: number; - }; - street: string; - sideOfStreet: string; - adminArea1?: string; - adminArea1Type?: string; - adminArea3?: string; - adminArea3Type?: string; - adminArea4?: string; - adminArea4Type?: string; - adminArea5?: string; - adminArea5Type?: string; - adminArea6?: string; - adminArea6Type?: string; - postalCode: string; - type: string; - linkId: string; - dragPoint: boolean; - geocodeQuality: string; - geocodeQualityCode: string; -} -export default class MapQuestProvider implements ProviderInterface { - private externalLoader; - private options; - constructor(_externalLoader: ExternalLoaderInterface, options?: ProviderOptionsInterface); - geocode(query: string | GeocodeQuery | GeocodeQueryObject, callback: GeocodedResultsCallback, errorCallback?: ErrorCallback): void; - geodecode(latitudeOrQuery: number | string | ReverseQuery | ReverseQueryObject, longitudeOrCallback: number | string | GeocodedResultsCallback, callbackOrErrorCallback?: GeocodedResultsCallback | ErrorCallback, errorCallback?: ErrorCallback): void; - executeRequest(params: ExternalLoaderParams, callback: GeocodedResultsCallback, headers?: ExternalLoaderHeaders, errorCallback?: ErrorCallback): void; - static mapToGeocoded(result: MapQuestResult): Geocoded; -} -//# sourceMappingURL=MapquestProvider.d.ts.map \ No newline at end of file diff --git a/types/provider/MapquestProvider.d.ts.map b/types/provider/MapquestProvider.d.ts.map deleted file mode 100644 index d4c8d33..0000000 --- a/types/provider/MapquestProvider.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"MapquestProvider.d.ts","sourceRoot":"","sources":["../../src/provider/MapquestProvider.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EACrB,uBAAuB,EACvB,oBAAoB,EACrB,0BAAuB;AACxB,OAAO,EACL,aAAa,EACb,uBAAuB,EAEvB,iBAAiB,EACjB,wBAAwB,EAEzB,WAAiB;AAClB,OAAO,QAAQ,oBAAiB;AAChC,OAAO,EACL,YAAY,EACZ,kBAAkB,EAClB,YAAY,EACZ,kBAAkB,EACnB,iBAAc;AASf,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE;QACN,GAAG,EAAE,MAAM,CAAC;QACZ,GAAG,EAAE,MAAM,CAAC;KACb,CAAC;IACF,aAAa,EAAE;QACb,GAAG,EAAE,MAAM,CAAC;QACZ,GAAG,EAAE,MAAM,CAAC;KACb,CAAC;IACF,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,OAAO,CAAC;IACnB,cAAc,EAAE,MAAM,CAAC;IACvB,kBAAkB,EAAE,MAAM,CAAC;CAC5B;AAED,MAAM,CAAC,OAAO,OAAO,gBAAiB,YAAW,iBAAiB;IAChE,OAAO,CAAC,cAAc,CAA0B;IAEhD,OAAO,CAAC,OAAO,CAA2B;gBAGxC,eAAe,EAAE,uBAAuB,EACxC,OAAO,GAAE,wBAAiD;IAWrD,OAAO,CACZ,KAAK,EAAE,MAAM,GAAG,YAAY,GAAG,kBAAkB,EACjD,QAAQ,EAAE,uBAAuB,EACjC,aAAa,CAAC,EAAE,aAAa,GAC5B,IAAI;IAkBA,SAAS,CACd,eAAe,EAAE,MAAM,GAAG,MAAM,GAAG,YAAY,GAAG,kBAAkB,EACpE,mBAAmB,EAAE,MAAM,GAAG,MAAM,GAAG,uBAAuB,EAC9D,uBAAuB,CAAC,EAAE,uBAAuB,GAAG,aAAa,EACjE,aAAa,CAAC,EAAE,aAAa,GAC5B,IAAI;IAgCA,cAAc,CACnB,MAAM,EAAE,oBAAoB,EAC5B,QAAQ,EAAE,uBAAuB,EACjC,OAAO,CAAC,EAAE,qBAAqB,EAC/B,aAAa,CAAC,EAAE,aAAa,GAC5B,IAAI;WAeO,aAAa,CAAC,MAAM,EAAE,cAAc,GAAG,QAAQ;CAuB9D"} \ No newline at end of file diff --git a/types/provider/ProviderHelpers.d.ts b/types/provider/ProviderHelpers.d.ts deleted file mode 100644 index f68f1de..0000000 --- a/types/provider/ProviderHelpers.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { ErrorCallback, GeocodedResultsCallback } from "./"; -import { GeocodeQuery, GeocodeQueryObject, ReverseQuery, ReverseQueryObject } from "../query"; -export default class ProviderHelpers { - static getGeocodeQueryFromParameter(query: string | GeocodeQuery | GeocodeQueryObject, geocodeQuery?: typeof GeocodeQuery): GeocodeQuery; - static getReverseQueryFromParameters(latitudeOrQuery: number | string | ReverseQuery | ReverseQueryObject, longitudeOrCallback: number | string | GeocodedResultsCallback, reverseQuery?: typeof ReverseQuery): ReverseQuery; - static getCallbackFromParameters(longitudeOrCallback: number | string | GeocodedResultsCallback, callbackOrErrorCallback?: GeocodedResultsCallback | ErrorCallback): GeocodedResultsCallback; - static getErrorCallbackFromParameters(longitudeOrCallback: number | string | GeocodedResultsCallback, callbackOrErrorCallback?: GeocodedResultsCallback | ErrorCallback, errorCallback?: ErrorCallback): undefined | ErrorCallback; -} -//# sourceMappingURL=ProviderHelpers.d.ts.map \ No newline at end of file diff --git a/types/provider/ProviderHelpers.d.ts.map b/types/provider/ProviderHelpers.d.ts.map deleted file mode 100644 index 2219e3b..0000000 --- a/types/provider/ProviderHelpers.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ProviderHelpers.d.ts","sourceRoot":"","sources":["../../src/provider/ProviderHelpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,uBAAuB,EAAE,WAAiB;AAClE,OAAO,EACL,YAAY,EACZ,kBAAkB,EAClB,YAAY,EACZ,kBAAkB,EACnB,iBAAc;AAEf,MAAM,CAAC,OAAO,OAAO,eAAe;WACpB,4BAA4B,CACxC,KAAK,EAAE,MAAM,GAAG,YAAY,GAAG,kBAAkB,EACjD,YAAY,sBAAe,GAC1B,YAAY;WAWD,6BAA6B,CACzC,eAAe,EAAE,MAAM,GAAG,MAAM,GAAG,YAAY,GAAG,kBAAkB,EACpE,mBAAmB,EAAE,MAAM,GAAG,MAAM,GAAG,uBAAuB,EAC9D,YAAY,sBAAe,GAC1B,YAAY;WA2BD,yBAAyB,CACrC,mBAAmB,EAAE,MAAM,GAAG,MAAM,GAAG,uBAAuB,EAC9D,uBAAuB,CAAC,EAAE,uBAAuB,GAAG,aAAa,GAChE,uBAAuB;WAkBZ,8BAA8B,CAC1C,mBAAmB,EAAE,MAAM,GAAG,MAAM,GAAG,uBAAuB,EAC9D,uBAAuB,CAAC,EAAE,uBAAuB,GAAG,aAAa,EACjE,aAAa,CAAC,EAAE,aAAa,GAC5B,SAAS,GAAG,aAAa;CAc7B"} \ No newline at end of file diff --git a/types/provider/ProviderInterface.d.ts b/types/provider/ProviderInterface.d.ts deleted file mode 100644 index ee41b26..0000000 --- a/types/provider/ProviderInterface.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { ExternalLoaderHeaders, ExternalLoaderParams } from "../ExternalLoader"; -import Geocoded from "../Geocoded"; -import { GeocodeQuery, GeocodeQueryObject, ReverseQuery, ReverseQueryObject } from "../query"; -import { ResponseError } from "../error"; -export declare const DEFAULT_RESULT_LIMIT = 5; -export declare const defaultProviderOptions: ProviderOptionsInterface; -export interface ProviderOptionsInterface { - readonly useSsl?: boolean; - readonly useJsonp?: boolean; - readonly apiKey?: string; -} -export declare type GeocodedResultsCallback = (results: Geocoded[]) => void; -export declare type ErrorCallback = (responseError: ResponseError) => void; -export default interface ProviderInterface { - geocode(query: string | GeocodeQuery | GeocodeQueryObject, callback: GeocodedResultsCallback, errorCallback?: ErrorCallback): void; - geodecode(latitudeOrQuery: number | string | ReverseQuery | ReverseQueryObject, longitudeOrCallback: number | string | GeocodedResultsCallback, callbackOrErrorCallback?: GeocodedResultsCallback | ErrorCallback, errorCallback?: ErrorCallback): void; - executeRequest(params: ExternalLoaderParams, callback: GeocodedResultsCallback, headers?: ExternalLoaderHeaders, errorCallback?: ErrorCallback): void; -} -//# sourceMappingURL=ProviderInterface.d.ts.map \ No newline at end of file diff --git a/types/provider/ProviderInterface.d.ts.map b/types/provider/ProviderInterface.d.ts.map deleted file mode 100644 index 453c118..0000000 --- a/types/provider/ProviderInterface.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ProviderInterface.d.ts","sourceRoot":"","sources":["../../src/provider/ProviderInterface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,0BAAuB;AAC7E,OAAO,QAAQ,oBAAiB;AAChC,OAAO,EACL,YAAY,EACZ,kBAAkB,EAClB,YAAY,EACZ,kBAAkB,EACnB,iBAAc;AACf,OAAO,EAAE,aAAa,EAAE,iBAAc;AAEtC,eAAO,MAAM,oBAAoB,IAAI,CAAC;AAEtC,eAAO,MAAM,sBAAsB,EAAE,wBAGpC,CAAC;AAEF,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,oBAAY,uBAAuB,GAAG,CAAC,OAAO,EAAE,QAAQ,EAAE,KAAK,IAAI,CAAC;AACpE,oBAAY,aAAa,GAAG,CAAC,aAAa,EAAE,aAAa,KAAK,IAAI,CAAC;AAEnE,MAAM,CAAC,OAAO,WAAW,iBAAiB;IACxC,OAAO,CACL,KAAK,EAAE,MAAM,GAAG,YAAY,GAAG,kBAAkB,EACjD,QAAQ,EAAE,uBAAuB,EACjC,aAAa,CAAC,EAAE,aAAa,GAC5B,IAAI,CAAC;IACR,SAAS,CACP,eAAe,EAAE,MAAM,GAAG,MAAM,GAAG,YAAY,GAAG,kBAAkB,EACpE,mBAAmB,EAAE,MAAM,GAAG,MAAM,GAAG,uBAAuB,EAC9D,uBAAuB,CAAC,EAAE,uBAAuB,GAAG,aAAa,EACjE,aAAa,CAAC,EAAE,aAAa,GAC5B,IAAI,CAAC;IACR,cAAc,CACZ,MAAM,EAAE,oBAAoB,EAC5B,QAAQ,EAAE,uBAAuB,EACjC,OAAO,CAAC,EAAE,qBAAqB,EAC/B,aAAa,CAAC,EAAE,aAAa,GAC5B,IAAI,CAAC;CACT"} \ No newline at end of file diff --git a/types/provider/YandexProvider.d.ts b/types/provider/YandexProvider.d.ts deleted file mode 100644 index 7944082..0000000 --- a/types/provider/YandexProvider.d.ts +++ /dev/null @@ -1,60 +0,0 @@ -import { ExternalLoaderHeaders, ExternalLoaderInterface, ExternalLoaderParams } from "../ExternalLoader"; -import { ErrorCallback, GeocodedResultsCallback, ProviderInterface, ProviderOptionsInterface } from "./"; -import Geocoded from "../Geocoded"; -import { GeocodeQuery, GeocodeQueryObject, ReverseQuery, ReverseQueryObject } from "../query"; -export interface YandexResult { - metaDataProperty: { - GeocoderMetaData: { - kind: string; - text: string; - precision: string; - AddressDetails: { - Country: { - AddressLine: string; - CountryNameCode: string; - CountryName: string; - AdministrativeArea?: { - AdministrativeAreaName: string; - SubAdministrativeArea?: { - SubAdministrativeAreaName: string; - Locality?: { - LocalityName: string; - Thoroughfare?: { - ThoroughfareName: string; - Premise: { - PremiseNumber: string; - }; - }; - }; - }; - }; - }; - }; - }; - }; - description: string; - name: string; - boundedBy: { - Envelope: { - lowerCorner: string; - upperCorner: string; - }; - }; - Point: { - pos: string; - }; -} -export interface YandexProviderOptionsInterface extends ProviderOptionsInterface { - readonly toponym?: "house" | "street" | "metro" | "district" | "locality"; -} -export default class YandexProvider implements ProviderInterface { - private externalLoader; - private options; - constructor(_externalLoader: ExternalLoaderInterface, options?: YandexProviderOptionsInterface); - geocode(query: string | GeocodeQuery | GeocodeQueryObject, callback: GeocodedResultsCallback, errorCallback?: ErrorCallback): void; - geodecode(latitudeOrQuery: number | string | ReverseQuery | ReverseQueryObject, longitudeOrCallback: number | string | GeocodedResultsCallback, callbackOrErrorCallback?: GeocodedResultsCallback | ErrorCallback, errorCallback?: ErrorCallback): void; - executeRequest(params: ExternalLoaderParams, callback: GeocodedResultsCallback, headers?: ExternalLoaderHeaders, errorCallback?: ErrorCallback): void; - static mapToGeocoded(result: YandexResult): Geocoded; - private static flattenObject; -} -//# sourceMappingURL=YandexProvider.d.ts.map \ No newline at end of file diff --git a/types/provider/YandexProvider.d.ts.map b/types/provider/YandexProvider.d.ts.map deleted file mode 100644 index 7e8ec45..0000000 --- a/types/provider/YandexProvider.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"YandexProvider.d.ts","sourceRoot":"","sources":["../../src/provider/YandexProvider.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EACrB,uBAAuB,EACvB,oBAAoB,EACrB,0BAAuB;AACxB,OAAO,EACL,aAAa,EACb,uBAAuB,EAEvB,iBAAiB,EACjB,wBAAwB,EAEzB,WAAiB;AAClB,OAAO,QAAQ,oBAAiB;AAChC,OAAO,EACL,YAAY,EACZ,kBAAkB,EAClB,YAAY,EACZ,kBAAkB,EACnB,iBAAc;AAgBf,MAAM,WAAW,YAAY;IAC3B,gBAAgB,EAAE;QAChB,gBAAgB,EAAE;YAChB,IAAI,EAAE,MAAM,CAAC;YACb,IAAI,EAAE,MAAM,CAAC;YACb,SAAS,EAAE,MAAM,CAAC;YAClB,cAAc,EAAE;gBACd,OAAO,EAAE;oBACP,WAAW,EAAE,MAAM,CAAC;oBACpB,eAAe,EAAE,MAAM,CAAC;oBACxB,WAAW,EAAE,MAAM,CAAC;oBACpB,kBAAkB,CAAC,EAAE;wBACnB,sBAAsB,EAAE,MAAM,CAAC;wBAC/B,qBAAqB,CAAC,EAAE;4BACtB,yBAAyB,EAAE,MAAM,CAAC;4BAClC,QAAQ,CAAC,EAAE;gCACT,YAAY,EAAE,MAAM,CAAC;gCACrB,YAAY,CAAC,EAAE;oCACb,gBAAgB,EAAE,MAAM,CAAC;oCACzB,OAAO,EAAE;wCACP,aAAa,EAAE,MAAM,CAAC;qCACvB,CAAC;iCACH,CAAC;6BACH,CAAC;yBACH,CAAC;qBACH,CAAC;iBACH,CAAC;aACH,CAAC;SACH,CAAC;KACH,CAAC;IACF,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE;QACT,QAAQ,EAAE;YACR,WAAW,EAAE,MAAM,CAAC;YACpB,WAAW,EAAE,MAAM,CAAC;SACrB,CAAC;KACH,CAAC;IACF,KAAK,EAAE;QACL,GAAG,EAAE,MAAM,CAAC;KACb,CAAC;CACH;AAYD,MAAM,WAAW,8BACf,SAAQ,wBAAwB;IAChC,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,GAAG,UAAU,GAAG,UAAU,CAAC;CAC3E;AAED,MAAM,CAAC,OAAO,OAAO,cAAe,YAAW,iBAAiB;IAC9D,OAAO,CAAC,cAAc,CAA0B;IAEhD,OAAO,CAAC,OAAO,CAAiC;gBAG9C,eAAe,EAAE,uBAAuB,EACxC,OAAO,GAAE,8BAAuD;IAM3D,OAAO,CACZ,KAAK,EAAE,MAAM,GAAG,YAAY,GAAG,kBAAkB,EACjD,QAAQ,EAAE,uBAAuB,EACjC,aAAa,CAAC,EAAE,aAAa,GAC5B,IAAI;IAoBA,SAAS,CACd,eAAe,EAAE,MAAM,GAAG,MAAM,GAAG,YAAY,GAAG,kBAAkB,EACpE,mBAAmB,EAAE,MAAM,GAAG,MAAM,GAAG,uBAAuB,EAC9D,uBAAuB,CAAC,EAAE,uBAAuB,GAAG,aAAa,EACjE,aAAa,CAAC,EAAE,aAAa,GAC5B,IAAI;IAmCA,cAAc,CACnB,MAAM,EAAE,oBAAoB,EAC5B,QAAQ,EAAE,uBAAuB,EACjC,OAAO,CAAC,EAAE,qBAAqB,EAC/B,aAAa,CAAC,EAAE,aAAa,GAC5B,IAAI;WAgBO,aAAa,CAAC,MAAM,EAAE,YAAY,GAAG,QAAQ;IAyC3D,OAAO,CAAC,MAAM,CAAC,aAAa;CA+B7B"} \ No newline at end of file diff --git a/types/provider/googlemaps/GoogleMapsGeocodeQuery.d.ts b/types/provider/googlemaps/GoogleMapsGeocodeQuery.d.ts deleted file mode 100644 index 835edfd..0000000 --- a/types/provider/googlemaps/GoogleMapsGeocodeQuery.d.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { GeocodeQuery, GeocodeQueryObject } from "../../query"; -interface GoogleMapsComponent { - name: string; - value: string; -} -export interface GoogleMapsGeocodeQueryObject extends GeocodeQueryObject { - readonly countryCodes?: string[]; - readonly components?: GoogleMapsComponent[]; - readonly channel?: string; -} -export default class GoogleMapsGeocodeQuery extends GeocodeQuery { - private readonly countryCodes?; - private readonly components?; - private readonly channel?; - protected constructor({ countryCodes, components, channel, ...geocodeQueryObject }: GoogleMapsGeocodeQueryObject); - static create(object: GoogleMapsGeocodeQueryObject): GoogleMapsGeocodeQuery; - toObject(): GoogleMapsGeocodeQueryObject; - withCountryCodes(countryCodes: string[]): GoogleMapsGeocodeQuery; - getCountryCodes(): undefined | string[]; - withComponents(components: GoogleMapsComponent[]): GoogleMapsGeocodeQuery; - getComponents(): undefined | GoogleMapsComponent[]; - withChannel(channel: string): GoogleMapsGeocodeQuery; - getChannel(): undefined | string; -} -export {}; -//# sourceMappingURL=GoogleMapsGeocodeQuery.d.ts.map \ No newline at end of file diff --git a/types/provider/googlemaps/GoogleMapsGeocodeQuery.d.ts.map b/types/provider/googlemaps/GoogleMapsGeocodeQuery.d.ts.map deleted file mode 100644 index 7ae281b..0000000 --- a/types/provider/googlemaps/GoogleMapsGeocodeQuery.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"GoogleMapsGeocodeQuery.d.ts","sourceRoot":"","sources":["../../../src/provider/googlemaps/GoogleMapsGeocodeQuery.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,oBAAc;AAEzD,UAAU,mBAAmB;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,4BAA6B,SAAQ,kBAAkB;IACtE,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACjC,QAAQ,CAAC,UAAU,CAAC,EAAE,mBAAmB,EAAE,CAAC;IAC5C,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,MAAM,CAAC,OAAO,OAAO,sBAAuB,SAAQ,YAAY;IAC9D,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAW;IAEzC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAwB;IAEpD,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAS;IAElC,SAAS,aAAa,EACpB,YAAY,EACZ,UAAU,EACV,OAAO,EACP,GAAG,kBAAkB,EACtB,EAAE,4BAA4B;WAYjB,MAAM,CAClB,MAAM,EAAE,4BAA4B,GACnC,sBAAsB;IAIlB,QAAQ,IAAI,4BAA4B;IASxC,gBAAgB,CAAC,YAAY,EAAE,MAAM,EAAE,GAAG,sBAAsB;IAIhE,eAAe,IAAI,SAAS,GAAG,MAAM,EAAE;IAIvC,cAAc,CACnB,UAAU,EAAE,mBAAmB,EAAE,GAChC,sBAAsB;IAIlB,aAAa,IAAI,SAAS,GAAG,mBAAmB,EAAE;IAIlD,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,sBAAsB;IAIpD,UAAU,IAAI,SAAS,GAAG,MAAM;CAGxC"} \ No newline at end of file diff --git a/types/provider/googlemaps/GoogleMapsGeocoded.d.ts b/types/provider/googlemaps/GoogleMapsGeocoded.d.ts deleted file mode 100644 index 44152b2..0000000 --- a/types/provider/googlemaps/GoogleMapsGeocoded.d.ts +++ /dev/null @@ -1,86 +0,0 @@ -import Geocoded, { GeocodedObject } from "../../Geocoded"; -import AdminLevel from "../../AdminLevel"; -export interface GoogleMapsGeocodedObject extends GeocodedObject { - readonly placeId?: string; - readonly partialMatch?: boolean; - readonly resultType?: string[]; - readonly locationType?: string; - readonly streetAddress?: string; - readonly intersection?: string; - readonly political?: string; - readonly colloquialArea?: string; - readonly ward?: string; - readonly neighborhood?: string; - readonly premise?: string; - readonly subpremise?: string; - readonly naturalFeature?: string; - readonly airport?: string; - readonly park?: string; - readonly pointOfInterest?: string; - readonly establishment?: string; - readonly postalCodeSuffix?: string; - readonly subLocalityLevels?: AdminLevel[]; -} -export default class GoogleMapsGeocoded extends Geocoded { - private readonly placeId?; - private readonly partialMatch?; - private readonly resultType?; - private readonly locationType?; - private readonly streetAddress?; - private readonly intersection?; - private readonly political?; - private readonly colloquialArea?; - private readonly ward?; - private readonly neighborhood?; - private readonly premise?; - private readonly subpremise?; - private readonly naturalFeature?; - private readonly airport?; - private readonly park?; - private readonly pointOfInterest?; - private readonly establishment?; - private readonly postalCodeSuffix?; - private readonly subLocalityLevels; - protected constructor({ placeId, partialMatch, resultType, locationType, streetAddress, intersection, political, colloquialArea, ward, neighborhood, premise, subpremise, naturalFeature, airport, park, pointOfInterest, establishment, postalCodeSuffix, subLocalityLevels, ...geocodedObject }: GoogleMapsGeocodedObject); - static create(object: GoogleMapsGeocodedObject): GoogleMapsGeocoded; - toObject(): GoogleMapsGeocodedObject; - withPlaceId(placeId: string): GoogleMapsGeocoded; - getPlaceId(): undefined | string; - withPartialMatch(partialMatch: boolean): GoogleMapsGeocoded; - isPartialMatch(): undefined | boolean; - withResultType(resultType: string[]): GoogleMapsGeocoded; - getResultType(): undefined | string[]; - withLocationType(locationType: string): GoogleMapsGeocoded; - getLocationType(): undefined | string; - withStreetAddress(streetAddress: string): GoogleMapsGeocoded; - getStreetAddress(): undefined | string; - withIntersection(intersection: string): GoogleMapsGeocoded; - getIntersection(): undefined | string; - withPolitical(political: string): GoogleMapsGeocoded; - getPolitical(): undefined | string; - withColloquialArea(colloquialArea: string): GoogleMapsGeocoded; - getColloquialArea(): undefined | string; - withWard(ward: string): GoogleMapsGeocoded; - getWard(): undefined | string; - withNeighborhood(neighborhood: string): GoogleMapsGeocoded; - getNeighborhood(): undefined | string; - withPremise(premise: string): GoogleMapsGeocoded; - getPremise(): undefined | string; - withSubpremise(subpremise: string): GoogleMapsGeocoded; - getSubpremise(): undefined | string; - withNaturalFeature(naturalFeature: string): GoogleMapsGeocoded; - getNaturalFeature(): undefined | string; - withAirport(airport: string): GoogleMapsGeocoded; - getAirport(): undefined | string; - withPark(park: string): GoogleMapsGeocoded; - getPark(): undefined | string; - withPointOfInterest(pointOfInterest: string): GoogleMapsGeocoded; - getPointOfInterest(): undefined | string; - withEstablishment(establishment: string): GoogleMapsGeocoded; - getEstablishment(): undefined | string; - withPostalCodeSuffix(postalCodeSuffix: string): GoogleMapsGeocoded; - getPostalCodeSuffix(): undefined | string; - addSubLocalityLevel(subLocalityLevel: AdminLevel): void; - getSubLocalityLevels(): AdminLevel[]; -} -//# sourceMappingURL=GoogleMapsGeocoded.d.ts.map \ No newline at end of file diff --git a/types/provider/googlemaps/GoogleMapsGeocoded.d.ts.map b/types/provider/googlemaps/GoogleMapsGeocoded.d.ts.map deleted file mode 100644 index a3343ac..0000000 --- a/types/provider/googlemaps/GoogleMapsGeocoded.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"GoogleMapsGeocoded.d.ts","sourceRoot":"","sources":["../../../src/provider/googlemaps/GoogleMapsGeocoded.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,EAAE,EAAE,cAAc,EAAE,uBAAiB;AACpD,OAAO,UAAU,yBAAmB;AAEpC,MAAM,WAAW,wBAAyB,SAAQ,cAAc;IAC9D,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,YAAY,CAAC,EAAE,OAAO,CAAC;IAChC,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IAC/B,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC;IACjC,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC;IACjC,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,CAAC;IAClC,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IACnC,QAAQ,CAAC,iBAAiB,CAAC,EAAE,UAAU,EAAE,CAAC;CAC3C;AAED,MAAM,CAAC,OAAO,OAAO,kBAAmB,SAAQ,QAAQ;IACtD,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAS;IAElC,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAU;IAExC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAW;IAEvC,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAS;IAEvC,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAS;IAExC,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAS;IAEvC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAS;IAEpC,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAS;IAEzC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAS;IAE/B,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAS;IAEvC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAS;IAElC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAS;IAErC,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAS;IAEzC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAS;IAElC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAS;IAE/B,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAS;IAE1C,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAS;IAExC,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAC,CAAS;IAE3C,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAe;IAEjD,SAAS,aAAa,EACpB,OAAO,EACP,YAAY,EACZ,UAAU,EACV,YAAY,EACZ,aAAa,EACb,YAAY,EACZ,SAAS,EACT,cAAc,EACd,IAAI,EACJ,YAAY,EACZ,OAAO,EACP,UAAU,EACV,cAAc,EACd,OAAO,EACP,IAAI,EACJ,eAAe,EACf,aAAa,EACb,gBAAgB,EAChB,iBAAiB,EACjB,GAAG,cAAc,EAClB,EAAE,wBAAwB;WAuBb,MAAM,CAAC,MAAM,EAAE,wBAAwB,GAAG,kBAAkB;IAInE,QAAQ,IAAI,wBAAwB;IAyBpC,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,kBAAkB;IAOhD,UAAU,IAAI,SAAS,GAAG,MAAM;IAIhC,gBAAgB,CAAC,YAAY,EAAE,OAAO,GAAG,kBAAkB;IAO3D,cAAc,IAAI,SAAS,GAAG,OAAO;IAIrC,cAAc,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,kBAAkB;IAOxD,aAAa,IAAI,SAAS,GAAG,MAAM,EAAE;IAIrC,gBAAgB,CAAC,YAAY,EAAE,MAAM,GAAG,kBAAkB;IAO1D,eAAe,IAAI,SAAS,GAAG,MAAM;IAIrC,iBAAiB,CAAC,aAAa,EAAE,MAAM,GAAG,kBAAkB;IAO5D,gBAAgB,IAAI,SAAS,GAAG,MAAM;IAItC,gBAAgB,CAAC,YAAY,EAAE,MAAM,GAAG,kBAAkB;IAO1D,eAAe,IAAI,SAAS,GAAG,MAAM;IAIrC,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,kBAAkB;IAOpD,YAAY,IAAI,SAAS,GAAG,MAAM;IAIlC,kBAAkB,CAAC,cAAc,EAAE,MAAM,GAAG,kBAAkB;IAO9D,iBAAiB,IAAI,SAAS,GAAG,MAAM;IAIvC,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,kBAAkB;IAO1C,OAAO,IAAI,SAAS,GAAG,MAAM;IAI7B,gBAAgB,CAAC,YAAY,EAAE,MAAM,GAAG,kBAAkB;IAO1D,eAAe,IAAI,SAAS,GAAG,MAAM;IAIrC,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,kBAAkB;IAOhD,UAAU,IAAI,SAAS,GAAG,MAAM;IAIhC,cAAc,CAAC,UAAU,EAAE,MAAM,GAAG,kBAAkB;IAOtD,aAAa,IAAI,SAAS,GAAG,MAAM;IAInC,kBAAkB,CAAC,cAAc,EAAE,MAAM,GAAG,kBAAkB;IAO9D,iBAAiB,IAAI,SAAS,GAAG,MAAM;IAIvC,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,kBAAkB;IAOhD,UAAU,IAAI,SAAS,GAAG,MAAM;IAIhC,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,kBAAkB;IAO1C,OAAO,IAAI,SAAS,GAAG,MAAM;IAI7B,mBAAmB,CAAC,eAAe,EAAE,MAAM,GAAG,kBAAkB;IAOhE,kBAAkB,IAAI,SAAS,GAAG,MAAM;IAIxC,iBAAiB,CAAC,aAAa,EAAE,MAAM,GAAG,kBAAkB;IAO5D,gBAAgB,IAAI,SAAS,GAAG,MAAM;IAItC,oBAAoB,CAAC,gBAAgB,EAAE,MAAM,GAAG,kBAAkB;IAOlE,mBAAmB,IAAI,SAAS,GAAG,MAAM;IAIzC,mBAAmB,CAAC,gBAAgB,EAAE,UAAU,GAAG,IAAI;IAIvD,oBAAoB,IAAI,UAAU,EAAE;CAG5C"} \ No newline at end of file diff --git a/types/provider/googlemaps/GoogleMapsProvider.d.ts b/types/provider/googlemaps/GoogleMapsProvider.d.ts deleted file mode 100644 index e7afec0..0000000 --- a/types/provider/googlemaps/GoogleMapsProvider.d.ts +++ /dev/null @@ -1,59 +0,0 @@ -import { ExternalLoaderHeaders, ExternalLoaderInterface, ExternalLoaderParams } from "../../ExternalLoader"; -import { ErrorCallback, GeocodedResultsCallback, GoogleMapsGeocoded, GoogleMapsGeocodeQuery, GoogleMapsGeocodeQueryObject, GoogleMapsReverseQuery, GoogleMapsReverseQueryObject, ProviderInterface, ProviderOptionsInterface } from "./.."; -interface GoogleMapsLatLng { - lat: number; - lng: number; -} -declare type GoogleMapsPlaceType = "airport" | "administrative_area_level_1" | "administrative_area_level_2" | "administrative_area_level_3" | "administrative_area_level_4" | "administrative_area_level_5" | "archipelago" | "bus_station" | "colloquial_area" | "continent" | "country" | "establishment" | "finance" | "floor" | "food" | "general_contractor" | "geocode" | "health" | "intersection" | "locality" | "natural_feature" | "neighborhood" | "park" | "parking" | "place_of_worship" | "plus_code" | "point_of_interest" | "political" | "post_box" | "postal_code" | "postal_code_prefix" | "postal_code_suffix" | "postal_town" | "premise" | "room" | "route" | "street_address" | "street_number" | "sublocality" | "sublocality_level_1" | "sublocality_level_2" | "sublocality_level_3" | "sublocality_level_4" | "sublocality_level_5" | "subpremise" | "town_square" | "train_station" | "transit_station" | "ward"; -export interface GoogleMapsResponse { - results: GoogleMapsResult[]; - status: "OK" | "ZERO_RESULTS" | "OVER_DAILY_LIMIT" | "OVER_QUERY_LIMIT" | "REQUEST_DENIED" | "INVALID_REQUEST" | "UNKNOWN_ERROR"; - error_message?: string; -} -export interface GoogleMapsResult { - geometry: { - location: GoogleMapsLatLng; - location_type: "ROOFTOP" | "RANGE_INTERPOLATED" | "GEOMETRIC_CENTER" | "APPROXIMATE"; - viewport: { - northeast: GoogleMapsLatLng; - southwest: GoogleMapsLatLng; - }; - bounds?: { - northeast: GoogleMapsLatLng; - southwest: GoogleMapsLatLng; - }; - }; - formatted_address: string; - address_components: { - types: GoogleMapsPlaceType[]; - long_name: string; - short_name: string; - }[]; - place_id: string; - plus_code?: { - global_code: string; - compound_code?: string; - }; - types: GoogleMapsPlaceType[]; - postcode_localities?: string[]; - partial_match?: boolean; -} -export interface GoogleMapsProviderOptionsInterface extends ProviderOptionsInterface { - readonly apiKey?: string; - readonly secret?: string; - readonly clientId?: string; - readonly countryCodes?: string[]; -} -export default class GoogleMapsProvider implements ProviderInterface { - private externalLoader; - private options; - constructor(_externalLoader: ExternalLoaderInterface, options?: GoogleMapsProviderOptionsInterface); - geocode(query: string | GoogleMapsGeocodeQuery | GoogleMapsGeocodeQueryObject, callback: GeocodedResultsCallback, errorCallback?: ErrorCallback): void; - geodecode(latitudeOrQuery: number | string | GoogleMapsReverseQuery | GoogleMapsReverseQueryObject, longitudeOrCallback: number | string | GeocodedResultsCallback, callbackOrErrorCallback?: GeocodedResultsCallback | ErrorCallback, errorCallback?: ErrorCallback): void; - private withCommonParams; - executeRequest(params: ExternalLoaderParams, callback: GeocodedResultsCallback, headers?: ExternalLoaderHeaders, errorCallback?: ErrorCallback): void; - static mapToGeocoded(result: GoogleMapsResult): GoogleMapsGeocoded; - private static signQuery; -} -export {}; -//# sourceMappingURL=GoogleMapsProvider.d.ts.map \ No newline at end of file diff --git a/types/provider/googlemaps/GoogleMapsProvider.d.ts.map b/types/provider/googlemaps/GoogleMapsProvider.d.ts.map deleted file mode 100644 index b1bf606..0000000 --- a/types/provider/googlemaps/GoogleMapsProvider.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"GoogleMapsProvider.d.ts","sourceRoot":"","sources":["../../../src/provider/googlemaps/GoogleMapsProvider.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EACrB,uBAAuB,EACvB,oBAAoB,EACrB,6BAAuB;AACxB,OAAO,EACL,aAAa,EACb,uBAAuB,EACvB,kBAAkB,EAClB,sBAAsB,EACtB,4BAA4B,EAC5B,sBAAsB,EACtB,4BAA4B,EAE5B,iBAAiB,EACjB,wBAAwB,EAEzB,aAAiB;AA+BlB,UAAU,gBAAgB;IACxB,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;CACb;AAED,aAAK,mBAAmB,GACpB,SAAS,GACT,6BAA6B,GAC7B,6BAA6B,GAC7B,6BAA6B,GAC7B,6BAA6B,GAC7B,6BAA6B,GAC7B,aAAa,GACb,aAAa,GACb,iBAAiB,GACjB,WAAW,GACX,SAAS,GACT,eAAe,GACf,SAAS,GACT,OAAO,GACP,MAAM,GACN,oBAAoB,GACpB,SAAS,GACT,QAAQ,GACR,cAAc,GACd,UAAU,GACV,iBAAiB,GACjB,cAAc,GACd,MAAM,GACN,SAAS,GACT,kBAAkB,GAClB,WAAW,GACX,mBAAmB,GACnB,WAAW,GACX,UAAU,GACV,aAAa,GACb,oBAAoB,GACpB,oBAAoB,GACpB,aAAa,GACb,SAAS,GACT,MAAM,GACN,OAAO,GACP,gBAAgB,GAChB,eAAe,GACf,aAAa,GACb,qBAAqB,GACrB,qBAAqB,GACrB,qBAAqB,GACrB,qBAAqB,GACrB,qBAAqB,GACrB,YAAY,GACZ,aAAa,GACb,eAAe,GACf,iBAAiB,GACjB,MAAM,CAAC;AAEX,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,gBAAgB,EAAE,CAAC;IAC5B,MAAM,EACF,IAAI,GACJ,cAAc,GACd,kBAAkB,GAClB,kBAAkB,GAClB,gBAAgB,GAChB,iBAAiB,GACjB,eAAe,CAAC;IAEpB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,EAAE;QACR,QAAQ,EAAE,gBAAgB,CAAC;QAE3B,aAAa,EACT,SAAS,GACT,oBAAoB,GACpB,kBAAkB,GAClB,aAAa,CAAC;QAClB,QAAQ,EAAE;YACR,SAAS,EAAE,gBAAgB,CAAC;YAC5B,SAAS,EAAE,gBAAgB,CAAC;SAC7B,CAAC;QACF,MAAM,CAAC,EAAE;YACP,SAAS,EAAE,gBAAgB,CAAC;YAC5B,SAAS,EAAE,gBAAgB,CAAC;SAC7B,CAAC;KACH,CAAC;IAEF,iBAAiB,EAAE,MAAM,CAAC;IAE1B,kBAAkB,EAAE;QAClB,KAAK,EAAE,mBAAmB,EAAE,CAAC;QAE7B,SAAS,EAAE,MAAM,CAAC;QAElB,UAAU,EAAE,MAAM,CAAC;KACpB,EAAE,CAAC;IAEJ,QAAQ,EAAE,MAAM,CAAC;IAEjB,SAAS,CAAC,EAAE;QAEV,WAAW,EAAE,MAAM,CAAC;QAEpB,aAAa,CAAC,EAAE,MAAM,CAAC;KACxB,CAAC;IACF,KAAK,EAAE,mBAAmB,EAAE,CAAC;IAE7B,mBAAmB,CAAC,EAAE,MAAM,EAAE,CAAC;IAE/B,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAED,MAAM,WAAW,kCACf,SAAQ,wBAAwB;IAChC,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;CAClC;AAED,MAAM,CAAC,OAAO,OAAO,kBAAmB,YAAW,iBAAiB;IAClE,OAAO,CAAC,cAAc,CAA0B;IAEhD,OAAO,CAAC,OAAO,CAAqC;gBAGlD,eAAe,EAAE,uBAAuB,EACxC,OAAO,GAAE,kCAA2D;IA0B/D,OAAO,CACZ,KAAK,EAAE,MAAM,GAAG,sBAAsB,GAAG,4BAA4B,EACrE,QAAQ,EAAE,uBAAuB,EACjC,aAAa,CAAC,EAAE,aAAa,GAC5B,IAAI;IAsCA,SAAS,CACd,eAAe,EACX,MAAM,GACN,MAAM,GACN,sBAAsB,GACtB,4BAA4B,EAChC,mBAAmB,EAAE,MAAM,GAAG,MAAM,GAAG,uBAAuB,EAC9D,uBAAuB,CAAC,EAAE,uBAAuB,GAAG,aAAa,EACjE,aAAa,CAAC,EAAE,aAAa,GAC5B,IAAI;IAwCP,OAAO,CAAC,gBAAgB;IAoCjB,cAAc,CACnB,MAAM,EAAE,oBAAoB,EAC5B,QAAQ,EAAE,uBAAuB,EACjC,OAAO,CAAC,EAAE,qBAAqB,EAC/B,aAAa,CAAC,EAAE,aAAa,GAC5B,IAAI;WAsEO,aAAa,CAAC,MAAM,EAAE,gBAAgB,GAAG,kBAAkB;IAqMzE,OAAO,CAAC,MAAM,CAAC,SAAS;CAmBzB"} \ No newline at end of file diff --git a/types/provider/googlemaps/GoogleMapsReverseQuery.d.ts b/types/provider/googlemaps/GoogleMapsReverseQuery.d.ts deleted file mode 100644 index 5052495..0000000 --- a/types/provider/googlemaps/GoogleMapsReverseQuery.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { ReverseQuery, ReverseQueryObject } from "../../query"; -export interface GoogleMapsReverseQueryObject extends ReverseQueryObject { - readonly resultTypes?: string[]; - readonly locationTypes?: string[]; - readonly channel?: string; -} -export default class GoogleMapsReverseQuery extends ReverseQuery { - private readonly resultTypes?; - private readonly locationTypes?; - private readonly channel?; - protected constructor({ resultTypes, locationTypes, channel, ...reverseQueryObject }: GoogleMapsReverseQueryObject); - static create(object: GoogleMapsReverseQueryObject): GoogleMapsReverseQuery; - toObject(): GoogleMapsReverseQueryObject; - withResultTypes(resultTypes: string[]): GoogleMapsReverseQuery; - getResultTypes(): undefined | string[]; - withLocationTypes(locationTypes: string[]): GoogleMapsReverseQuery; - getLocationTypes(): undefined | string[]; - withChannel(channel: string): GoogleMapsReverseQuery; - getChannel(): undefined | string; -} -//# sourceMappingURL=GoogleMapsReverseQuery.d.ts.map \ No newline at end of file diff --git a/types/provider/googlemaps/GoogleMapsReverseQuery.d.ts.map b/types/provider/googlemaps/GoogleMapsReverseQuery.d.ts.map deleted file mode 100644 index d93e0ef..0000000 --- a/types/provider/googlemaps/GoogleMapsReverseQuery.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"GoogleMapsReverseQuery.d.ts","sourceRoot":"","sources":["../../../src/provider/googlemaps/GoogleMapsReverseQuery.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,oBAAc;AAEzD,MAAM,WAAW,4BAA6B,SAAQ,kBAAkB;IACtE,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IAChC,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IAClC,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,MAAM,CAAC,OAAO,OAAO,sBAAuB,SAAQ,YAAY;IAC9D,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAW;IAExC,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAW;IAE1C,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAS;IAElC,SAAS,aAAa,EACpB,WAAW,EACX,aAAa,EACb,OAAO,EACP,GAAG,kBAAkB,EACtB,EAAE,4BAA4B;WAOjB,MAAM,CAClB,MAAM,EAAE,4BAA4B,GACnC,sBAAsB;IAIlB,QAAQ,IAAI,4BAA4B;IASxC,eAAe,CAAC,WAAW,EAAE,MAAM,EAAE,GAAG,sBAAsB;IAI9D,cAAc,IAAI,SAAS,GAAG,MAAM,EAAE;IAItC,iBAAiB,CAAC,aAAa,EAAE,MAAM,EAAE,GAAG,sBAAsB;IAIlE,gBAAgB,IAAI,SAAS,GAAG,MAAM,EAAE;IAIxC,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,sBAAsB;IAIpD,UAAU,IAAI,SAAS,GAAG,MAAM;CAGxC"} \ No newline at end of file diff --git a/types/provider/googlemaps/index.d.ts b/types/provider/googlemaps/index.d.ts deleted file mode 100644 index 00b8715..0000000 --- a/types/provider/googlemaps/index.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -export { default as GoogleMapsGeocoded } from "./GoogleMapsGeocoded"; -export { default as GoogleMapsGeocodeQuery } from "./GoogleMapsGeocodeQuery"; -export * from "./GoogleMapsGeocodeQuery"; -export { default as GoogleMapsProvider } from "./GoogleMapsProvider"; -export * from "./GoogleMapsProvider"; -export { default as GoogleMapsReverseQuery } from "./GoogleMapsReverseQuery"; -export * from "./GoogleMapsReverseQuery"; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/types/provider/googlemaps/index.d.ts.map b/types/provider/googlemaps/index.d.ts.map deleted file mode 100644 index 5ca23d1..0000000 --- a/types/provider/googlemaps/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/provider/googlemaps/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAOwD,sBAAsB,CAP/B;AACvF,OAAO,EAAE,OAAO,IAAI,sBAAsB,EAAE,MAM0E,0BAA0B,CANjD;AAC/F,cAKsH,0BAA0B,CALrF;AAC3D,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAIwG,sBAAsB,CAJ/E;AACvF,cAGgJ,sBAAsB,CAH/G;AACvD,OAAO,EAAE,OAAO,IAAI,sBAAsB,EAAE,MAE0H,0BAA0B,CAFjG;AAC/F,cACsK,0BAA0B,CADrI"} \ No newline at end of file diff --git a/types/provider/index.d.ts b/types/provider/index.d.ts deleted file mode 100644 index 5845fec..0000000 --- a/types/provider/index.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -export { default as ProviderHelpers } from "./ProviderHelpers"; -export { default as ProviderInterface } from "./ProviderInterface"; -export * from "./ProviderInterface"; -export { default as BingProvider } from "./BingProvider"; -export * from "./BingProvider"; -export { default as ChainProvider } from "./ChainProvider"; -export * from "./ChainProvider"; -export * from "./googlemaps"; -export * from "./mapbox"; -export { default as MapquestProvider } from "./MapquestProvider"; -export * from "./MapquestProvider"; -export * from "./nominatim"; -export * from "./opencage"; -export { default as YandexProvider } from "./YandexProvider"; -export * from "./YandexProvider"; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/types/provider/index.d.ts.map b/types/provider/index.d.ts.map deleted file mode 100644 index c4e4280..0000000 --- a/types/provider/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/provider/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAe2H,mBAAmB,CAf7G;AACtE,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAc4I,qBAAqB,CAd9H;AAC1E,cAamL,qBAAqB,CAb7J;AAC3C,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAYsK,gBAAgB,CAZxJ;AAChE,cAWwM,gBAAgB,CAXlL;AACtC,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAUqL,iBAAiB,CAVvK;AAClE,cASwN,iBAAiB,CATlM;AACvC,cAQyO,cAAc,CARnN;AACpC,cAOuP,UAAU,CAPjO;AAChC,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAM2N,oBAAoB,CAN7M;AACxE,cAKiQ,oBAAoB,CAL3O;AAC1C,cAIqR,aAAa,CAJ/P;AACnC,cAGkS,YAAY,CAH5Q;AAClC,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAE0Q,kBAAkB,CAF5P;AACpE,cAC8S,kBAAkB,CADxR"} \ No newline at end of file diff --git a/types/provider/mapbox/MapboxGeocodeQuery.d.ts b/types/provider/mapbox/MapboxGeocodeQuery.d.ts deleted file mode 100644 index 81ece1c..0000000 --- a/types/provider/mapbox/MapboxGeocodeQuery.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { GeocodeQuery, GeocodeQueryObject } from "../../query"; -export interface MapboxGeocodeQueryObject extends GeocodeQueryObject { - readonly countryCodes?: string[]; - readonly proximity?: Coordinates; - readonly locationTypes?: string[]; -} -export default class MapboxGeocodeQuery extends GeocodeQuery { - private readonly countryCodes?; - private readonly proximity?; - private readonly locationTypes?; - protected constructor({ countryCodes, proximity, locationTypes, ...geocodeQueryObject }: MapboxGeocodeQueryObject); - static create(object: MapboxGeocodeQueryObject): MapboxGeocodeQuery; - toObject(): MapboxGeocodeQueryObject; - withCountryCodes(countryCodes: string[]): MapboxGeocodeQuery; - getCountryCodes(): undefined | string[]; - withProximity(proximity: Coordinates): MapboxGeocodeQuery; - getProximity(): undefined | Coordinates; - withLocationTypes(locationTypes: string[]): MapboxGeocodeQuery; - getLocationTypes(): undefined | string[]; -} -//# sourceMappingURL=MapboxGeocodeQuery.d.ts.map \ No newline at end of file diff --git a/types/provider/mapbox/MapboxGeocodeQuery.d.ts.map b/types/provider/mapbox/MapboxGeocodeQuery.d.ts.map deleted file mode 100644 index 878c441..0000000 --- a/types/provider/mapbox/MapboxGeocodeQuery.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"MapboxGeocodeQuery.d.ts","sourceRoot":"","sources":["../../../src/provider/mapbox/MapboxGeocodeQuery.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,oBAAc;AAEzD,MAAM,WAAW,wBAAyB,SAAQ,kBAAkB;IAClE,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACjC,QAAQ,CAAC,SAAS,CAAC,EAAE,WAAW,CAAC;IACjC,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;CACnC;AAED,MAAM,CAAC,OAAO,OAAO,kBAAmB,SAAQ,YAAY;IAC1D,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAW;IAEzC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAc;IAEzC,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAW;IAE1C,SAAS,aAAa,EACpB,YAAY,EACZ,SAAS,EACT,aAAa,EACb,GAAG,kBAAkB,EACtB,EAAE,wBAAwB;WAOb,MAAM,CAAC,MAAM,EAAE,wBAAwB,GAAG,kBAAkB;IAInE,QAAQ,IAAI,wBAAwB;IASpC,gBAAgB,CAAC,YAAY,EAAE,MAAM,EAAE,GAAG,kBAAkB;IAI5D,eAAe,IAAI,SAAS,GAAG,MAAM,EAAE;IAIvC,aAAa,CAAC,SAAS,EAAE,WAAW,GAAG,kBAAkB;IAIzD,YAAY,IAAI,SAAS,GAAG,WAAW;IAIvC,iBAAiB,CAAC,aAAa,EAAE,MAAM,EAAE,GAAG,kBAAkB;IAI9D,gBAAgB,IAAI,SAAS,GAAG,MAAM,EAAE;CAGhD"} \ No newline at end of file diff --git a/types/provider/mapbox/MapboxGeocoded.d.ts b/types/provider/mapbox/MapboxGeocoded.d.ts deleted file mode 100644 index 581a798..0000000 --- a/types/provider/mapbox/MapboxGeocoded.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import Geocoded, { GeocodedObject } from "../../Geocoded"; -export interface MapboxGeocodedObject extends GeocodedObject { - readonly resultType?: string[]; -} -export default class MapboxGeocoded extends Geocoded { - private readonly resultType?; - protected constructor({ resultType, ...geocodedObject }: MapboxGeocodedObject); - static create(object: MapboxGeocodedObject): MapboxGeocoded; - toObject(): MapboxGeocodedObject; - withResultType(resultType: string[]): MapboxGeocoded; - getResultType(): undefined | string[]; -} -//# sourceMappingURL=MapboxGeocoded.d.ts.map \ No newline at end of file diff --git a/types/provider/mapbox/MapboxGeocoded.d.ts.map b/types/provider/mapbox/MapboxGeocoded.d.ts.map deleted file mode 100644 index 307d672..0000000 --- a/types/provider/mapbox/MapboxGeocoded.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"MapboxGeocoded.d.ts","sourceRoot":"","sources":["../../../src/provider/mapbox/MapboxGeocoded.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,EAAE,EAAE,cAAc,EAAE,uBAAiB;AAEpD,MAAM,WAAW,oBAAqB,SAAQ,cAAc;IAC1D,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;CAChC;AAED,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,QAAQ;IAClD,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAW;IAEvC,SAAS,aAAa,EACpB,UAAU,EACV,GAAG,cAAc,EAClB,EAAE,oBAAoB;WAKT,MAAM,CAAC,MAAM,EAAE,oBAAoB,GAAG,cAAc;IAI3D,QAAQ,IAAI,oBAAoB;IAOhC,cAAc,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,cAAc;IAOpD,aAAa,IAAI,SAAS,GAAG,MAAM,EAAE;CAG7C"} \ No newline at end of file diff --git a/types/provider/mapbox/MapboxProvider.d.ts b/types/provider/mapbox/MapboxProvider.d.ts deleted file mode 100644 index 26f0073..0000000 --- a/types/provider/mapbox/MapboxProvider.d.ts +++ /dev/null @@ -1,75 +0,0 @@ -import { ExternalLoaderHeaders, ExternalLoaderInterface, ExternalLoaderParams } from "../../ExternalLoader"; -import { ErrorCallback, GeocodedResultsCallback, MapboxGeocoded, MapboxGeocodeQuery, MapboxGeocodeQueryObject, MapboxReverseQuery, MapboxReverseQueryObject, ProviderInterface, ProviderOptionsInterface } from "./.."; -import { Box } from "../../types"; -export interface MapboxResponse { - type: "FeatureCollection"; - query: string[]; - features: MapboxResult[]; - attribution: string; -} -interface MapboxFeatureContextProperties { - id: string; - text: string; - wikidata?: string; - short_code?: string; -} -interface MapboxFeatureProperties { - accuracy?: string; - address?: string; - category?: string; - maki?: string; - wikidata?: string; - short_code?: string; -} -export interface MapboxResult { - id: string; - type: "Feature"; - place_type: ("country" | "region" | "postcode" | "district" | "place" | "locality" | "neighborhood" | "address" | "poi")[]; - relevance: number; - address?: string; - properties: MapboxFeatureProperties; - text: string; - place_name: string; - matching_text?: string; - matching_place_name?: string; - language?: string; - bbox?: Box; - center: [number, number]; - geometry: { - type: "Point"; - coordinates: [number, number]; - }; - context?: MapboxFeatureContextProperties[]; - routable_points?: { - points?: { - coordinates: [number, number]; - }[]; - }; -} -export declare enum MAPBOX_GEOCODING_MODES { - GEOCODING_MODE_PLACES = "mapbox.places", - GEOCODING_MODE_PLACES_PERMANENT = "mapbox.places-permanent" -} -export interface MapboxProviderOptionsInterface extends ProviderOptionsInterface { - readonly apiKey: string; - readonly geocodingMode?: MAPBOX_GEOCODING_MODES; - readonly countryCodes?: string[]; -} -export declare const defaultMapboxProviderOptions: { - apiKey: string; - geocodingMode: MAPBOX_GEOCODING_MODES; - useSsl?: boolean | undefined; - useJsonp?: boolean | undefined; -}; -export default class MapboxProvider implements ProviderInterface { - private externalLoader; - private options; - constructor(_externalLoader: ExternalLoaderInterface, options?: MapboxProviderOptionsInterface); - geocode(query: string | MapboxGeocodeQuery | MapboxGeocodeQueryObject, callback: GeocodedResultsCallback, errorCallback?: ErrorCallback): void; - geodecode(latitudeOrQuery: number | string | MapboxReverseQuery | MapboxReverseQueryObject, longitudeOrCallback: number | string | GeocodedResultsCallback, callbackOrErrorCallback?: GeocodedResultsCallback | ErrorCallback, errorCallback?: ErrorCallback): void; - private withCommonParams; - executeRequest(params: ExternalLoaderParams, callback: GeocodedResultsCallback, headers?: ExternalLoaderHeaders, errorCallback?: ErrorCallback): void; - static mapToGeocoded(result: MapboxResult): MapboxGeocoded; -} -export {}; -//# sourceMappingURL=MapboxProvider.d.ts.map \ No newline at end of file diff --git a/types/provider/mapbox/MapboxProvider.d.ts.map b/types/provider/mapbox/MapboxProvider.d.ts.map deleted file mode 100644 index 3fd765a..0000000 --- a/types/provider/mapbox/MapboxProvider.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"MapboxProvider.d.ts","sourceRoot":"","sources":["../../../src/provider/mapbox/MapboxProvider.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EACrB,uBAAuB,EACvB,oBAAoB,EACrB,6BAAuB;AACxB,OAAO,EACL,aAAa,EACb,uBAAuB,EACvB,cAAc,EACd,kBAAkB,EAClB,wBAAwB,EACxB,kBAAkB,EAClB,wBAAwB,EAExB,iBAAiB,EACjB,wBAAwB,EAEzB,aAAiB;AAClB,OAAO,EAAE,GAAG,EAAE,oBAAc;AAgB5B,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,mBAAmB,CAAC;IAC1B,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,QAAQ,EAAE,YAAY,EAAE,CAAC;IACzB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,UAAU,8BAA8B;IACtC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,UAAU,uBAAuB;IAC/B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,SAAS,CAAC;IAEhB,UAAU,EAAE,CACR,SAAS,GACT,QAAQ,GACR,UAAU,GACV,UAAU,GACV,OAAO,GACP,UAAU,GACV,cAAc,GACd,SAAS,GACT,KAAK,CACR,EAAE,CAAC;IACJ,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,uBAAuB,CAAC;IACpC,IAAI,EAAE,MAAM,CAAC;IAEb,UAAU,EAAE,MAAM,CAAC;IAEnB,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,GAAG,CAAC;IACX,MAAM,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACzB,QAAQ,EAAE;QACR,IAAI,EAAE,OAAO,CAAC;QACd,WAAW,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;KAC/B,CAAC;IACF,OAAO,CAAC,EAAE,8BAA8B,EAAE,CAAC;IAE3C,eAAe,CAAC,EAAE;QAChB,MAAM,CAAC,EAAE;YACP,WAAW,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;SAC/B,EAAE,CAAC;KACL,CAAC;CACH;AAED,oBAAY,sBAAsB;IAChC,qBAAqB,kBAAkB;IACvC,+BAA+B,4BAA4B;CAC5D;AAED,MAAM,WAAW,8BACf,SAAQ,wBAAwB;IAChC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,aAAa,CAAC,EAAE,sBAAsB,CAAC;IAChD,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;CAClC;AAED,eAAO,MAAM,4BAA4B;;;;;CAIxC,CAAC;AAEF,MAAM,CAAC,OAAO,OAAO,cAAe,YAAW,iBAAiB;IAC9D,OAAO,CAAC,cAAc,CAA0B;IAEhD,OAAO,CAAC,OAAO,CAAiC;gBAG9C,eAAe,EAAE,uBAAuB,EACxC,OAAO,GAAE,8BAA6D;IAWjE,OAAO,CACZ,KAAK,EAAE,MAAM,GAAG,kBAAkB,GAAG,wBAAwB,EAC7D,QAAQ,EAAE,uBAAuB,EACjC,aAAa,CAAC,EAAE,aAAa,GAC5B,IAAI;IAsCA,SAAS,CACd,eAAe,EACX,MAAM,GACN,MAAM,GACN,kBAAkB,GAClB,wBAAwB,EAC5B,mBAAmB,EAAE,MAAM,GAAG,MAAM,GAAG,uBAAuB,EAC9D,uBAAuB,CAAC,EAAE,uBAAuB,GAAG,aAAa,EACjE,aAAa,CAAC,EAAE,aAAa,GAC5B,IAAI;IAuCP,OAAO,CAAC,gBAAgB;IAkBjB,cAAc,CACnB,MAAM,EAAE,oBAAoB,EAC5B,QAAQ,EAAE,uBAAuB,EACjC,OAAO,CAAC,EAAE,qBAAqB,EAC/B,aAAa,CAAC,EAAE,aAAa,GAC5B,IAAI;WAeO,aAAa,CAAC,MAAM,EAAE,YAAY,GAAG,cAAc;CAkFlE"} \ No newline at end of file diff --git a/types/provider/mapbox/MapboxReverseQuery.d.ts b/types/provider/mapbox/MapboxReverseQuery.d.ts deleted file mode 100644 index db61756..0000000 --- a/types/provider/mapbox/MapboxReverseQuery.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { ReverseQuery, ReverseQueryObject } from "../../query"; -declare type ReverseMode = "distance" | "score"; -export interface MapboxReverseQueryObject extends ReverseQueryObject { - readonly countryCodes?: string[]; - readonly reverseMode?: ReverseMode; - readonly locationTypes?: string[]; -} -export default class MapboxReverseQuery extends ReverseQuery { - private readonly countryCodes?; - private readonly reverseMode?; - private readonly locationTypes?; - protected constructor({ countryCodes, reverseMode, locationTypes, ...reverseQueryObject }: MapboxReverseQueryObject); - static create(object: MapboxReverseQueryObject): MapboxReverseQuery; - toObject(): MapboxReverseQueryObject; - withCountryCodes(countryCodes: string[]): MapboxReverseQuery; - getCountryCodes(): undefined | string[]; - withReverseMode(reverseMode: ReverseMode): MapboxReverseQuery; - getReverseMode(): undefined | ReverseMode; - withLocationTypes(locationTypes: string[]): MapboxReverseQuery; - getLocationTypes(): undefined | string[]; -} -export {}; -//# sourceMappingURL=MapboxReverseQuery.d.ts.map \ No newline at end of file diff --git a/types/provider/mapbox/MapboxReverseQuery.d.ts.map b/types/provider/mapbox/MapboxReverseQuery.d.ts.map deleted file mode 100644 index e9f31af..0000000 --- a/types/provider/mapbox/MapboxReverseQuery.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"MapboxReverseQuery.d.ts","sourceRoot":"","sources":["../../../src/provider/mapbox/MapboxReverseQuery.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,oBAAc;AAEzD,aAAK,WAAW,GAAG,UAAU,GAAG,OAAO,CAAC;AAExC,MAAM,WAAW,wBAAyB,SAAQ,kBAAkB;IAClE,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACjC,QAAQ,CAAC,WAAW,CAAC,EAAE,WAAW,CAAC;IACnC,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;CACnC;AAED,MAAM,CAAC,OAAO,OAAO,kBAAmB,SAAQ,YAAY;IAC1D,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAW;IAEzC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAc;IAE3C,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAW;IAE1C,SAAS,aAAa,EACpB,YAAY,EACZ,WAAW,EACX,aAAa,EACb,GAAG,kBAAkB,EACtB,EAAE,wBAAwB;WAOb,MAAM,CAAC,MAAM,EAAE,wBAAwB,GAAG,kBAAkB;IAInE,QAAQ,IAAI,wBAAwB;IASpC,gBAAgB,CAAC,YAAY,EAAE,MAAM,EAAE,GAAG,kBAAkB;IAI5D,eAAe,IAAI,SAAS,GAAG,MAAM,EAAE;IAIvC,eAAe,CAAC,WAAW,EAAE,WAAW,GAAG,kBAAkB;IAI7D,cAAc,IAAI,SAAS,GAAG,WAAW;IAIzC,iBAAiB,CAAC,aAAa,EAAE,MAAM,EAAE,GAAG,kBAAkB;IAI9D,gBAAgB,IAAI,SAAS,GAAG,MAAM,EAAE;CAGhD"} \ No newline at end of file diff --git a/types/provider/mapbox/index.d.ts b/types/provider/mapbox/index.d.ts deleted file mode 100644 index ecf1827..0000000 --- a/types/provider/mapbox/index.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -export { default as MapboxGeocoded } from "./MapboxGeocoded"; -export { default as MapboxGeocodeQuery } from "./MapboxGeocodeQuery"; -export * from "./MapboxGeocodeQuery"; -export { default as MapboxProvider } from "./MapboxProvider"; -export * from "./MapboxProvider"; -export { default as MapboxReverseQuery } from "./MapboxReverseQuery"; -export * from "./MapboxReverseQuery"; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/types/provider/mapbox/index.d.ts.map b/types/provider/mapbox/index.d.ts.map deleted file mode 100644 index 2991fb5..0000000 --- a/types/provider/mapbox/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/provider/mapbox/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAO4C,kBAAkB,CAPvB;AAC3E,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAM0D,sBAAsB,CANrC;AACnF,cAKkG,sBAAsB,CALrE;AACnD,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAIoF,kBAAkB,CAJ/D;AAC3E,cAGwH,kBAAkB,CAH3F;AAC/C,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAEkG,sBAAsB,CAF7E;AACnF,cAC0I,sBAAsB,CAD7G"} \ No newline at end of file diff --git a/types/provider/nominatim/NominatimGeocodeQuery.d.ts b/types/provider/nominatim/NominatimGeocodeQuery.d.ts deleted file mode 100644 index 31827cf..0000000 --- a/types/provider/nominatim/NominatimGeocodeQuery.d.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { GeocodeQuery, GeocodeQueryObject } from "../../query"; -import { Box } from "../../types"; -export interface NominatimGeocodeQueryObject extends GeocodeQueryObject { - readonly countryCodes?: string[]; - readonly excludePlaceIds?: number[]; - readonly viewBox?: Box; - readonly bounded?: boolean; -} -export default class NominatimGeocodeQuery extends GeocodeQuery { - private readonly countryCodes?; - private readonly excludePlaceIds?; - private readonly viewBox?; - private readonly bounded?; - protected constructor({ countryCodes, excludePlaceIds, viewBox, bounded, ...geocodeQueryObject }: NominatimGeocodeQueryObject); - static create(object: NominatimGeocodeQueryObject): NominatimGeocodeQuery; - toObject(): NominatimGeocodeQueryObject; - withCountryCodes(countryCodes: string[]): NominatimGeocodeQuery; - getCountryCodes(): undefined | string[]; - withExcludePlaceIds(excludePlaceIds: number[]): NominatimGeocodeQuery; - getExcludePlaceIds(): undefined | number[]; - withViewBox(viewBox: Box): NominatimGeocodeQuery; - getViewBox(): undefined | Box; - withBounded(bounded: boolean): NominatimGeocodeQuery; - getBounded(): undefined | boolean; -} -//# sourceMappingURL=NominatimGeocodeQuery.d.ts.map \ No newline at end of file diff --git a/types/provider/nominatim/NominatimGeocodeQuery.d.ts.map b/types/provider/nominatim/NominatimGeocodeQuery.d.ts.map deleted file mode 100644 index c910f21..0000000 --- a/types/provider/nominatim/NominatimGeocodeQuery.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"NominatimGeocodeQuery.d.ts","sourceRoot":"","sources":["../../../src/provider/nominatim/NominatimGeocodeQuery.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,oBAAc;AACzD,OAAO,EAAE,GAAG,EAAE,oBAAc;AAE5B,MAAM,WAAW,2BAA4B,SAAQ,kBAAkB;IACrE,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACjC,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;IACpC,QAAQ,CAAC,OAAO,CAAC,EAAE,GAAG,CAAC;IACvB,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED,MAAM,CAAC,OAAO,OAAO,qBAAsB,SAAQ,YAAY;IAC7D,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAW;IAEzC,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAW;IAE5C,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAM;IAE/B,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAU;IAEnC,SAAS,aAAa,EACpB,YAAY,EACZ,eAAe,EACf,OAAO,EACP,OAAO,EACP,GAAG,kBAAkB,EACtB,EAAE,2BAA2B;WAgBhB,MAAM,CAClB,MAAM,EAAE,2BAA2B,GAClC,qBAAqB;IAIjB,QAAQ,IAAI,2BAA2B;IAUvC,gBAAgB,CAAC,YAAY,EAAE,MAAM,EAAE,GAAG,qBAAqB;IAI/D,eAAe,IAAI,SAAS,GAAG,MAAM,EAAE;IAIvC,mBAAmB,CAAC,eAAe,EAAE,MAAM,EAAE,GAAG,qBAAqB;IAIrE,kBAAkB,IAAI,SAAS,GAAG,MAAM,EAAE;IAI1C,WAAW,CAAC,OAAO,EAAE,GAAG,GAAG,qBAAqB;IAIhD,UAAU,IAAI,SAAS,GAAG,GAAG;IAI7B,WAAW,CAAC,OAAO,EAAE,OAAO,GAAG,qBAAqB;IAIpD,UAAU,IAAI,SAAS,GAAG,OAAO;CAGzC"} \ No newline at end of file diff --git a/types/provider/nominatim/NominatimGeocoded.d.ts b/types/provider/nominatim/NominatimGeocoded.d.ts deleted file mode 100644 index 98ae755..0000000 --- a/types/provider/nominatim/NominatimGeocoded.d.ts +++ /dev/null @@ -1,33 +0,0 @@ -import Geocoded, { GeocodedObject } from "../../Geocoded"; -export interface NominatimGeocodedObject extends GeocodedObject { - readonly displayName?: string; - readonly osmId?: number; - readonly osmType?: string; - readonly category?: string; - readonly type?: string; - readonly attribution?: string; -} -export default class NominatimGeocoded extends Geocoded { - private readonly displayName?; - private readonly osmId?; - private readonly osmType?; - private readonly category?; - private readonly type?; - private readonly attribution?; - protected constructor({ displayName, osmId, osmType, category, type, attribution, ...geocodedObject }: NominatimGeocodedObject); - static create(object: NominatimGeocodedObject): NominatimGeocoded; - toObject(): NominatimGeocodedObject; - withDisplayName(displayName: string): NominatimGeocoded; - getDisplayName(): undefined | string; - withOsmId(osmId: number): NominatimGeocoded; - getOsmId(): undefined | number; - withOsmType(osmType: string): NominatimGeocoded; - getOsmType(): undefined | string; - withCategory(category: string): NominatimGeocoded; - getCategory(): undefined | string; - withType(type: string): NominatimGeocoded; - getType(): undefined | string; - withAttribution(attribution: string): NominatimGeocoded; - getAttribution(): undefined | string; -} -//# sourceMappingURL=NominatimGeocoded.d.ts.map \ No newline at end of file diff --git a/types/provider/nominatim/NominatimGeocoded.d.ts.map b/types/provider/nominatim/NominatimGeocoded.d.ts.map deleted file mode 100644 index 85c0b2f..0000000 --- a/types/provider/nominatim/NominatimGeocoded.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"NominatimGeocoded.d.ts","sourceRoot":"","sources":["../../../src/provider/nominatim/NominatimGeocoded.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,EAAE,EAAE,cAAc,EAAE,uBAAiB;AAEpD,MAAM,WAAW,uBAAwB,SAAQ,cAAc;IAC7D,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;CAC/B;AAED,MAAM,CAAC,OAAO,OAAO,iBAAkB,SAAQ,QAAQ;IACrD,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAS;IAEtC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAS;IAEhC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAS;IAElC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAS;IAEnC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAS;IAE/B,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAS;IAEtC,SAAS,aAAa,EACpB,WAAW,EACX,KAAK,EACL,OAAO,EACP,QAAQ,EACR,IAAI,EACJ,WAAW,EACX,GAAG,cAAc,EAClB,EAAE,uBAAuB;WAUZ,MAAM,CAAC,MAAM,EAAE,uBAAuB,GAAG,iBAAiB;IAIjE,QAAQ,IAAI,uBAAuB;IAYnC,eAAe,CAAC,WAAW,EAAE,MAAM,GAAG,iBAAiB;IAOvD,cAAc,IAAI,SAAS,GAAG,MAAM;IAIpC,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,iBAAiB;IAO3C,QAAQ,IAAI,SAAS,GAAG,MAAM;IAI9B,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,iBAAiB;IAO/C,UAAU,IAAI,SAAS,GAAG,MAAM;IAIhC,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,iBAAiB;IAOjD,WAAW,IAAI,SAAS,GAAG,MAAM;IAIjC,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,iBAAiB;IAOzC,OAAO,IAAI,SAAS,GAAG,MAAM;IAI7B,eAAe,CAAC,WAAW,EAAE,MAAM,GAAG,iBAAiB;IAOvD,cAAc,IAAI,SAAS,GAAG,MAAM;CAG5C"} \ No newline at end of file diff --git a/types/provider/nominatim/NominatimProvider.d.ts b/types/provider/nominatim/NominatimProvider.d.ts deleted file mode 100644 index 8c1dddd..0000000 --- a/types/provider/nominatim/NominatimProvider.d.ts +++ /dev/null @@ -1,62 +0,0 @@ -import { ExternalLoaderHeaders, ExternalLoaderInterface, ExternalLoaderParams } from "../../ExternalLoader"; -import { ErrorCallback, GeocodedResultsCallback, NominatimGeocoded, NominatimReverseQuery, NominatimReverseQueryObject, NominatimGeocodeQueryObject, NominatimGeocodeQuery, ProviderInterface, ProviderOptionsInterface } from "./.."; -interface NominatimErrorResponse { - error: string; -} -export declare type NominatimResponse = NominatimErrorResponse | NominatimResult | NominatimResult[]; -export interface NominatimResult { - place_id: number; - licence: string; - osm_type: string; - osm_id: number; - boundingbox: [string, string, string, string]; - lat: string; - lon: string; - display_name: string; - category: string; - type: string; - importance: number; - icon: string; - address: { - attraction?: string; - house_number?: string; - road?: string; - pedestrian?: string; - neighbourhood?: string; - suburb?: string; - city?: string; - town?: string; - village?: string; - hamlet?: string; - state?: string; - county?: string; - postcode?: string; - country?: string; - country_code?: string; - }; -} -export interface NominatimProviderOptionsInterface extends ProviderOptionsInterface { - readonly host?: string; - readonly userAgent: string; - readonly referer?: string; -} -export declare const defaultNominatimProviderOptions: { - host: string; - userAgent: string; - useSsl?: boolean | undefined; - useJsonp?: boolean | undefined; - apiKey?: string | undefined; -}; -export default class NominatimProvider implements ProviderInterface { - private externalLoader; - private options; - constructor(_externalLoader: ExternalLoaderInterface, options?: NominatimProviderOptionsInterface); - geocode(query: string | NominatimGeocodeQuery | NominatimGeocodeQueryObject, callback: GeocodedResultsCallback, errorCallback?: ErrorCallback): void; - geodecode(latitudeOrQuery: number | string | NominatimReverseQuery | NominatimReverseQueryObject, longitudeOrCallback: number | string | GeocodedResultsCallback, callbackOrErrorCallback?: GeocodedResultsCallback | ErrorCallback, errorCallback?: ErrorCallback): void; - private withCommonParams; - private getHeaders; - executeRequest(params: ExternalLoaderParams, callback: GeocodedResultsCallback, headers?: ExternalLoaderHeaders, errorCallback?: ErrorCallback): void; - static mapToGeocoded(result: NominatimResult): NominatimGeocoded; -} -export {}; -//# sourceMappingURL=NominatimProvider.d.ts.map \ No newline at end of file diff --git a/types/provider/nominatim/NominatimProvider.d.ts.map b/types/provider/nominatim/NominatimProvider.d.ts.map deleted file mode 100644 index b930e3f..0000000 --- a/types/provider/nominatim/NominatimProvider.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"NominatimProvider.d.ts","sourceRoot":"","sources":["../../../src/provider/nominatim/NominatimProvider.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EACrB,uBAAuB,EACvB,oBAAoB,EACrB,6BAAuB;AACxB,OAAO,EACL,aAAa,EACb,uBAAuB,EACvB,iBAAiB,EACjB,qBAAqB,EACrB,2BAA2B,EAC3B,2BAA2B,EAC3B,qBAAqB,EAErB,iBAAiB,EACjB,wBAAwB,EAEzB,aAAiB;AAuBlB,UAAU,sBAAsB;IAC9B,KAAK,EAAE,MAAM,CAAC;CACf;AAED,oBAAY,iBAAiB,GACzB,sBAAsB,GACtB,eAAe,GACf,eAAe,EAAE,CAAC;AAEtB,MAAM,WAAW,eAAe;IAE9B,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAEhB,QAAQ,EAAE,MAAM,CAAC;IAEjB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IAC9C,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IAEZ,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE;QACP,UAAU,CAAC,EAAE,MAAM,CAAC;QAEpB,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,OAAO,CAAC,EAAE,MAAM,CAAC;QAEjB,YAAY,CAAC,EAAE,MAAM,CAAC;KACvB,CAAC;CACH;AAED,MAAM,WAAW,iCACf,SAAQ,wBAAwB;IAChC,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,eAAO,MAAM,+BAA+B;;;;;;CAI3C,CAAC;AAEF,MAAM,CAAC,OAAO,OAAO,iBAAkB,YAAW,iBAAiB;IACjE,OAAO,CAAC,cAAc,CAA0B;IAEhD,OAAO,CAAC,OAAO,CAAoC;gBAGjD,eAAe,EAAE,uBAAuB,EACxC,OAAO,GAAE,iCAAmE;IAcvE,OAAO,CACZ,KAAK,EAAE,MAAM,GAAG,qBAAqB,GAAG,2BAA2B,EACnE,QAAQ,EAAE,uBAAuB,EACjC,aAAa,CAAC,EAAE,aAAa,GAC5B,IAAI;IAuCA,SAAS,CACd,eAAe,EACX,MAAM,GACN,MAAM,GACN,qBAAqB,GACrB,2BAA2B,EAC/B,mBAAmB,EAAE,MAAM,GAAG,MAAM,GAAG,uBAAuB,EAC9D,uBAAuB,CAAC,EAAE,uBAAuB,GAAG,aAAa,EACjE,aAAa,CAAC,EAAE,aAAa,GAC5B,IAAI;IAwCP,OAAO,CAAC,gBAAgB;IAaxB,OAAO,CAAC,UAAU;IAOX,cAAc,CACnB,MAAM,EAAE,oBAAoB,EAC5B,QAAQ,EAAE,uBAAuB,EACjC,OAAO,CAAC,EAAE,qBAAqB,EAC/B,aAAa,CAAC,EAAE,aAAa,GAC5B,IAAI;WA+BO,aAAa,CAAC,MAAM,EAAE,eAAe,GAAG,iBAAiB;CA0ExE"} \ No newline at end of file diff --git a/types/provider/nominatim/NominatimReverseQuery.d.ts b/types/provider/nominatim/NominatimReverseQuery.d.ts deleted file mode 100644 index feadce6..0000000 --- a/types/provider/nominatim/NominatimReverseQuery.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { ReverseQuery, ReverseQueryObject } from "../../query"; -export interface NominatimReverseQueryObject extends ReverseQueryObject { - readonly zoom?: number; -} -export default class NominatimReverseQuery extends ReverseQuery { - private readonly zoom?; - protected constructor({ zoom, ...reverseQueryObject }: NominatimReverseQueryObject); - static create(object: NominatimReverseQueryObject): NominatimReverseQuery; - toObject(): NominatimReverseQueryObject; - withZoom(zoom: number): NominatimReverseQuery; - getZoom(): undefined | number; -} -//# sourceMappingURL=NominatimReverseQuery.d.ts.map \ No newline at end of file diff --git a/types/provider/nominatim/NominatimReverseQuery.d.ts.map b/types/provider/nominatim/NominatimReverseQuery.d.ts.map deleted file mode 100644 index ad4729b..0000000 --- a/types/provider/nominatim/NominatimReverseQuery.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"NominatimReverseQuery.d.ts","sourceRoot":"","sources":["../../../src/provider/nominatim/NominatimReverseQuery.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,oBAAc;AAEzD,MAAM,WAAW,2BAA4B,SAAQ,kBAAkB;IACrE,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,CAAC,OAAO,OAAO,qBAAsB,SAAQ,YAAY;IAC7D,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAS;IAE/B,SAAS,aAAa,EACpB,IAAI,EACJ,GAAG,kBAAkB,EACtB,EAAE,2BAA2B;WAKhB,MAAM,CAClB,MAAM,EAAE,2BAA2B,GAClC,qBAAqB;IAIjB,QAAQ,IAAI,2BAA2B;IAOvC,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,qBAAqB;IAI7C,OAAO,IAAI,SAAS,GAAG,MAAM;CAGrC"} \ No newline at end of file diff --git a/types/provider/nominatim/index.d.ts b/types/provider/nominatim/index.d.ts deleted file mode 100644 index 5378a61..0000000 --- a/types/provider/nominatim/index.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -export { default as NominatimGeocoded } from "./NominatimGeocoded"; -export { default as OpenStreetMapGeocoded } from "./NominatimGeocoded"; -export * from "./NominatimGeocoded"; -export { NominatimGeocodedObject as OpenStreetMapGeocodedObject } from "./NominatimGeocoded"; -export { default as NominatimGeocodeQuery } from "./NominatimGeocodeQuery"; -export { default as OpenStreetMapGeocodeQuery } from "./NominatimGeocodeQuery"; -export * from "./NominatimGeocodeQuery"; -export { NominatimGeocodeQueryObject as OpenStreetMapGeocodeQueryObject } from "./NominatimGeocodeQuery"; -export { default as NominatimProvider } from "./NominatimProvider"; -export { default as OpenStreetMapProvider } from "./NominatimProvider"; -export * from "./NominatimProvider"; -export { NominatimProviderOptionsInterface as OpenStreetMapProviderOptionsInterface, NominatimResult as OpenStreetMapResult, defaultNominatimProviderOptions as defaultOpenStreetMapProviderOptions, } from "./NominatimProvider"; -export { default as NominatimReverseQuery } from "./NominatimReverseQuery"; -export { default as OpenStreetMapReverseQuery } from "./NominatimReverseQuery"; -export * from "./NominatimReverseQuery"; -export { NominatimReverseQueryObject as OpenStreetMapReverseQueryObject } from "./NominatimReverseQuery"; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/types/provider/nominatim/index.d.ts.map b/types/provider/nominatim/index.d.ts.map deleted file mode 100644 index 6d26359..0000000 --- a/types/provider/nominatim/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/provider/nominatim/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAoBqD,qBAAqB,CApB7B;AACpF,OAAO,EAAE,OAAO,IAAI,qBAAqB,EAAE,MAmBiD,qBAAqB,CAnBzB;AACxF,cAkB4F,qBAAqB,CAlB5D;AACrD,OAAO,EAAE,uBAAuB,IAAI,2BAA2B,EAAE,MAiB2B,qBAAqB,CAjBH;AAC9G,OAAO,EAAE,OAAO,IAAI,qBAAqB,EAAE,MAgBsE,yBAAyB,CAhB9C;AAC5F,OAAO,EAAE,OAAO,IAAI,yBAAyB,EAAE,MAekE,yBAAyB,CAf1C;AAChG,cAciH,yBAAyB,CAdjF;AACzD,OAAO,EAAE,2BAA2B,IAAI,+BAA+B,EAAE,MAawC,yBAAyB,CAbhB;AAC1H,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAYmG,qBAAqB,CAZ3E;AACpF,OAAO,EAAE,OAAO,IAAI,qBAAqB,EAAE,MAW+F,qBAAqB,CAXvE;AACxF,cAU0I,qBAAqB,CAV1G;AACrD,OAAO,EACL,iCAAiC,IAAI,qCAAqC,EAC1E,eAAe,IAAI,mBAAmB,EACtC,+BAA+B,IAAI,mCAAmC,GACvE,MAKyI,qBAAqB,CALjH;AAC9C,OAAO,EAAE,OAAO,IAAI,qBAAqB,EAAE,MAIoH,yBAAyB,CAJ5F;AAC5F,OAAO,EAAE,OAAO,IAAI,yBAAyB,EAAE,MAGgH,yBAAyB,CAHxF;AAChG,cAE+J,yBAAyB,CAF/H;AACzD,OAAO,EAAE,2BAA2B,IAAI,+BAA+B,EAAE,MACsF,yBAAyB,CAD9D"} \ No newline at end of file diff --git a/types/provider/opencage/OpenCageGeocodeQuery.d.ts b/types/provider/opencage/OpenCageGeocodeQuery.d.ts deleted file mode 100644 index 0824d14..0000000 --- a/types/provider/opencage/OpenCageGeocodeQuery.d.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { GeocodeQuery, GeocodeQueryObject } from "../../query"; -import { Coordinates } from "../../index"; -export interface OpenCageGeocodeQueryObject extends GeocodeQueryObject { - readonly countryCodes?: string[]; - readonly proximity?: Coordinates; - readonly minConfidence?: number; - readonly noRecord?: boolean; -} -export default class OpenCageGeocodeQuery extends GeocodeQuery { - private readonly countryCodes?; - private readonly proximity?; - private readonly minConfidence?; - private readonly noRecord?; - protected constructor({ countryCodes, proximity, minConfidence, noRecord, ...geocodeQueryObject }: OpenCageGeocodeQueryObject); - static create(object: OpenCageGeocodeQueryObject): OpenCageGeocodeQuery; - toObject(): OpenCageGeocodeQueryObject; - withCountryCodes(countryCodes: string[]): OpenCageGeocodeQuery; - getCountryCodes(): undefined | string[]; - withProximity(proximity: Coordinates): OpenCageGeocodeQuery; - getProximity(): undefined | Coordinates; - withMinConfidence(minConfidence: number): OpenCageGeocodeQuery; - getMinConfidence(): undefined | number; - withNoRecord(noRecord: boolean): OpenCageGeocodeQuery; - getNoRecord(): undefined | boolean; -} -//# sourceMappingURL=OpenCageGeocodeQuery.d.ts.map \ No newline at end of file diff --git a/types/provider/opencage/OpenCageGeocodeQuery.d.ts.map b/types/provider/opencage/OpenCageGeocodeQuery.d.ts.map deleted file mode 100644 index 36c6cf0..0000000 --- a/types/provider/opencage/OpenCageGeocodeQuery.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"OpenCageGeocodeQuery.d.ts","sourceRoot":"","sources":["../../../src/provider/opencage/OpenCageGeocodeQuery.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,oBAAc;AACzD,OAAO,EAAE,WAAW,EAAE,oBAAc;AAEpC,MAAM,WAAW,0BAA2B,SAAQ,kBAAkB;IACpE,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACjC,QAAQ,CAAC,SAAS,CAAC,EAAE,WAAW,CAAC;IACjC,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED,MAAM,CAAC,OAAO,OAAO,oBAAqB,SAAQ,YAAY;IAC5D,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAW;IAEzC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAc;IAEzC,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAS;IAExC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAU;IAEpC,SAAS,aAAa,EACpB,YAAY,EACZ,SAAS,EACT,aAAa,EACb,QAAQ,EACR,GAAG,kBAAkB,EACtB,EAAE,0BAA0B;WAmBf,MAAM,CAClB,MAAM,EAAE,0BAA0B,GACjC,oBAAoB;IAIhB,QAAQ,IAAI,0BAA0B;IAUtC,gBAAgB,CAAC,YAAY,EAAE,MAAM,EAAE,GAAG,oBAAoB;IAI9D,eAAe,IAAI,SAAS,GAAG,MAAM,EAAE;IAIvC,aAAa,CAAC,SAAS,EAAE,WAAW,GAAG,oBAAoB;IAI3D,YAAY,IAAI,SAAS,GAAG,WAAW;IAIvC,iBAAiB,CAAC,aAAa,EAAE,MAAM,GAAG,oBAAoB;IAI9D,gBAAgB,IAAI,SAAS,GAAG,MAAM;IAItC,YAAY,CAAC,QAAQ,EAAE,OAAO,GAAG,oBAAoB;IAIrD,WAAW,IAAI,SAAS,GAAG,OAAO;CAG1C"} \ No newline at end of file diff --git a/types/provider/opencage/OpenCageGeocoded.d.ts b/types/provider/opencage/OpenCageGeocoded.d.ts deleted file mode 100644 index be9139a..0000000 --- a/types/provider/opencage/OpenCageGeocoded.d.ts +++ /dev/null @@ -1,33 +0,0 @@ -import Geocoded, { GeocodedObject } from "../../Geocoded"; -export interface OpenCageGeocodedObject extends GeocodedObject { - readonly callingCode?: number; - readonly flag?: string; - readonly mgrs?: string; - readonly maidenhead?: string; - readonly geohash?: string; - readonly what3words?: string; -} -export default class OpenCageGeocoded extends Geocoded { - private readonly callingCode?; - private readonly flag?; - private readonly mgrs?; - private readonly maidenhead?; - private readonly geohash?; - private readonly what3words?; - protected constructor({ callingCode, flag, mgrs, maidenhead, geohash, what3words, ...geocodedObject }: OpenCageGeocodedObject); - static create(object: OpenCageGeocodedObject): OpenCageGeocoded; - toObject(): OpenCageGeocodedObject; - withCallingCode(callingCode: number): OpenCageGeocoded; - getCallingCode(): undefined | number; - withFlag(flag: string): OpenCageGeocoded; - getFlag(): undefined | string; - withMgrs(mgrs: string): OpenCageGeocoded; - getMgrs(): undefined | string; - withMaidenhead(maidenhead: string): OpenCageGeocoded; - getMaidenhead(): undefined | string; - withGeohash(geohash: string): OpenCageGeocoded; - getGeohash(): undefined | string; - withWhat3words(what3words: string): OpenCageGeocoded; - getWhat3words(): undefined | string; -} -//# sourceMappingURL=OpenCageGeocoded.d.ts.map \ No newline at end of file diff --git a/types/provider/opencage/OpenCageGeocoded.d.ts.map b/types/provider/opencage/OpenCageGeocoded.d.ts.map deleted file mode 100644 index b7aaebb..0000000 --- a/types/provider/opencage/OpenCageGeocoded.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"OpenCageGeocoded.d.ts","sourceRoot":"","sources":["../../../src/provider/opencage/OpenCageGeocoded.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,EAAE,EAAE,cAAc,EAAE,uBAAiB;AAEpD,MAAM,WAAW,sBAAuB,SAAQ,cAAc;IAC5D,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED,MAAM,CAAC,OAAO,OAAO,gBAAiB,SAAQ,QAAQ;IACpD,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAS;IAEtC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAS;IAE/B,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAS;IAE/B,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAS;IAErC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAS;IAElC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAS;IAErC,SAAS,aAAa,EACpB,WAAW,EACX,IAAI,EACJ,IAAI,EACJ,UAAU,EACV,OAAO,EACP,UAAU,EACV,GAAG,cAAc,EAClB,EAAE,sBAAsB;WAUX,MAAM,CAAC,MAAM,EAAE,sBAAsB,GAAG,gBAAgB;IAI/D,QAAQ,IAAI,sBAAsB;IAYlC,eAAe,CAAC,WAAW,EAAE,MAAM,GAAG,gBAAgB;IAOtD,cAAc,IAAI,SAAS,GAAG,MAAM;IAIpC,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,gBAAgB;IAOxC,OAAO,IAAI,SAAS,GAAG,MAAM;IAI7B,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,gBAAgB;IAOxC,OAAO,IAAI,SAAS,GAAG,MAAM;IAI7B,cAAc,CAAC,UAAU,EAAE,MAAM,GAAG,gBAAgB;IAOpD,aAAa,IAAI,SAAS,GAAG,MAAM;IAInC,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,gBAAgB;IAO9C,UAAU,IAAI,SAAS,GAAG,MAAM;IAIhC,cAAc,CAAC,UAAU,EAAE,MAAM,GAAG,gBAAgB;IAOpD,aAAa,IAAI,SAAS,GAAG,MAAM;CAG3C"} \ No newline at end of file diff --git a/types/provider/opencage/OpenCageProvider.d.ts b/types/provider/opencage/OpenCageProvider.d.ts deleted file mode 100644 index a45f815..0000000 --- a/types/provider/opencage/OpenCageProvider.d.ts +++ /dev/null @@ -1,184 +0,0 @@ -import { ExternalLoaderHeaders, ExternalLoaderInterface, ExternalLoaderParams } from "../../ExternalLoader"; -import { ErrorCallback, GeocodedResultsCallback, OpenCageGeocoded, OpenCageGeocodeQuery, OpenCageGeocodeQueryObject, OpenCageReverseQuery, OpenCageReverseQueryObject, ProviderInterface, ProviderOptionsInterface } from "./.."; -interface OpenCageCoordinates { - lat: number; - lng: number; -} -interface OpenCageSun { - apparent: number; - astronomical: number; - civil: number; - nautical: number; -} -export interface OpenCageResponse { - documentation: string; - licences: { - name: string; - url: string; - }[]; - rate: { - limit: number; - remaining: number; - reset: number; - }; - results: OpenCageResult[]; - status: { - code: 200 | 400 | 401 | 402 | 403 | 404 | 405 | 408 | 410 | 429 | 503; - message: string; - }; - stay_informed: { - blog: string; - twitter: string; - }; - thanks: string; - timestamp: { - created_http: string; - created_unix: number; - }; - total_results: number; -} -export interface OpenCageResult { - annotations: { - callingcode: number; - currency: { - alternate_symbols: string[]; - decimal_mark: string; - disambiguate_symbol?: string; - html_entity: string; - iso_code: string; - iso_numeric: string; - name: string; - smallest_denomination: number; - subunit: string; - subunit_to_unit: number; - symbol: string; - symbol_first: number; - thousands_separator: string; - }; - DMS: { - lat: string; - lng: string; - }; - FIPS?: { - state?: string; - county?: string; - }; - flag: string; - geohash?: string; - ITM?: { - easting: string; - northing: string; - }; - Maidenhead?: string; - Mercator: { - x: number; - y: number; - }; - MGRS?: string; - OSM: { - edit_url?: string; - note_url: string; - url: string; - }; - qibla: number; - roadinfo: { - drive_on: "left" | "right"; - road?: string; - road_type?: string; - road_reference?: string; - road_reference_intl?: string; - speed_in: "km/h" | "mph"; - }; - sun: { - rise: OpenCageSun; - set: OpenCageSun; - }; - timezone: { - name: string; - now_in_dst: number; - offset_sec: number; - offset_string: string; - short_name: string; - }; - UN_M49: { - regions: { - [region: string]: string; - }; - statistical_groupings: ("LDC" | "LEDC" | "LLDC" | "MEDC" | "SIDS")[]; - }; - what3words?: { - words: string; - }; - wikidata?: string; - }; - bounds: { - northeast: OpenCageCoordinates; - southwest: OpenCageCoordinates; - }; - components: { - "ISO_3166-1_alpha-2"?: string; - "ISO_3166-1_alpha-3"?: string; - _category: "agriculture" | "building" | "castle" | "commerce" | "construction" | "education" | "financial" | "government" | "health" | "industrial" | "military" | "natural/water" | "outdoors/recreation" | "place" | "place_of_worship" | "postcode" | "road" | "social" | "transportation" | "travel/tourism" | "unknown"; - _type: string; - castle?: string; - city?: string; - city_district?: string; - continent?: "Africa" | "Antarctica" | "Asia" | "Europe" | "Oceania" | "North America" | "South America"; - country?: string; - country_code?: string; - county?: string; - county_code?: string; - croft?: string; - district?: string; - footway?: string; - hamlet?: string; - house_number?: string; - houses?: string; - locality?: string; - municipality?: string; - neighbourhood?: string; - path?: string; - pedestrian?: string; - political_union?: string; - postcode?: string; - quarter?: string; - residential?: string; - road?: string; - road_reference?: string; - road_reference_intl?: string; - road_type?: string; - state?: string; - state_code?: string; - state_district?: string; - street?: string; - street_name?: string; - subdivision?: string; - suburb?: string; - town?: string; - village?: string; - }; - confidence: number; - formatted: string; - geometry: OpenCageCoordinates; -} -export interface OpenCageProviderOptionsInterface extends ProviderOptionsInterface { - readonly apiKey: string; - readonly countryCodes?: string[]; -} -export declare const defaultOpenCageProviderOptions: { - apiKey: string; - useSsl?: boolean | undefined; - useJsonp?: boolean | undefined; -}; -export default class OpenCageProvider implements ProviderInterface { - private externalLoader; - private options; - constructor(_externalLoader: ExternalLoaderInterface, options?: OpenCageProviderOptionsInterface); - geocode(query: string | OpenCageGeocodeQuery | OpenCageGeocodeQueryObject, callback: GeocodedResultsCallback, errorCallback?: ErrorCallback): void; - geodecode(latitudeOrQuery: number | string | OpenCageReverseQuery | OpenCageReverseQueryObject, longitudeOrCallback: number | string | GeocodedResultsCallback, callbackOrErrorCallback?: GeocodedResultsCallback | ErrorCallback, errorCallback?: ErrorCallback): void; - private withCommonParams; - executeRequest(params: ExternalLoaderParams, callback: GeocodedResultsCallback, headers?: ExternalLoaderHeaders, errorCallback?: ErrorCallback): void; - static mapToGeocoded(result: OpenCageResult): OpenCageGeocoded; -} -export {}; -//# sourceMappingURL=OpenCageProvider.d.ts.map \ No newline at end of file diff --git a/types/provider/opencage/OpenCageProvider.d.ts.map b/types/provider/opencage/OpenCageProvider.d.ts.map deleted file mode 100644 index f7cb8dc..0000000 --- a/types/provider/opencage/OpenCageProvider.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"OpenCageProvider.d.ts","sourceRoot":"","sources":["../../../src/provider/opencage/OpenCageProvider.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EACrB,uBAAuB,EACvB,oBAAoB,EACrB,6BAAuB;AACxB,OAAO,EACL,aAAa,EACb,uBAAuB,EACvB,gBAAgB,EAChB,oBAAoB,EACpB,0BAA0B,EAC1B,oBAAoB,EACpB,0BAA0B,EAE1B,iBAAiB,EACjB,wBAAwB,EAEzB,aAAiB;AAoBlB,UAAU,mBAAmB;IAC3B,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;CACb;AAED,UAAU,WAAW;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,gBAAgB;IAC/B,aAAa,EAAE,MAAM,CAAC;IACtB,QAAQ,EAAE;QACR,IAAI,EAAE,MAAM,CAAC;QACb,GAAG,EAAE,MAAM,CAAC;KACb,EAAE,CAAC;IACJ,IAAI,EAAE;QACJ,KAAK,EAAE,MAAM,CAAC;QACd,SAAS,EAAE,MAAM,CAAC;QAClB,KAAK,EAAE,MAAM,CAAC;KACf,CAAC;IACF,OAAO,EAAE,cAAc,EAAE,CAAC;IAC1B,MAAM,EAAE;QACN,IAAI,EAAE,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;QACtE,OAAO,EAAE,MAAM,CAAC;KACjB,CAAC;IAEF,aAAa,EAAE;QACb,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,EAAE,MAAM,CAAC;KACjB,CAAC;IACF,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE;QAET,YAAY,EAAE,MAAM,CAAC;QAErB,YAAY,EAAE,MAAM,CAAC;KACtB,CAAC;IAEF,aAAa,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,cAAc;IAC7B,WAAW,EAAE;QACX,WAAW,EAAE,MAAM,CAAC;QACpB,QAAQ,EAAE;YAER,iBAAiB,EAAE,MAAM,EAAE,CAAC;YAE5B,YAAY,EAAE,MAAM,CAAC;YAErB,mBAAmB,CAAC,EAAE,MAAM,CAAC;YAE7B,WAAW,EAAE,MAAM,CAAC;YAEpB,QAAQ,EAAE,MAAM,CAAC;YAEjB,WAAW,EAAE,MAAM,CAAC;YACpB,IAAI,EAAE,MAAM,CAAC;YAEb,qBAAqB,EAAE,MAAM,CAAC;YAC9B,OAAO,EAAE,MAAM,CAAC;YAEhB,eAAe,EAAE,MAAM,CAAC;YACxB,MAAM,EAAE,MAAM,CAAC;YAEf,YAAY,EAAE,MAAM,CAAC;YAErB,mBAAmB,EAAE,MAAM,CAAC;SAC7B,CAAC;QACF,GAAG,EAAE;YACH,GAAG,EAAE,MAAM,CAAC;YACZ,GAAG,EAAE,MAAM,CAAC;SACb,CAAC;QACF,IAAI,CAAC,EAAE;YACL,KAAK,CAAC,EAAE,MAAM,CAAC;YACf,MAAM,CAAC,EAAE,MAAM,CAAC;SACjB,CAAC;QACF,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,GAAG,CAAC,EAAE;YACJ,OAAO,EAAE,MAAM,CAAC;YAChB,QAAQ,EAAE,MAAM,CAAC;SAClB,CAAC;QACF,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,QAAQ,EAAE;YACR,CAAC,EAAE,MAAM,CAAC;YACV,CAAC,EAAE,MAAM,CAAC;SACX,CAAC;QACF,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,GAAG,EAAE;YAEH,QAAQ,CAAC,EAAE,MAAM,CAAC;YAElB,QAAQ,EAAE,MAAM,CAAC;YACjB,GAAG,EAAE,MAAM,CAAC;SACb,CAAC;QACF,KAAK,EAAE,MAAM,CAAC;QACd,QAAQ,EAAE;YAER,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;YAC3B,IAAI,CAAC,EAAE,MAAM,CAAC;YAEd,SAAS,CAAC,EAAE,MAAM,CAAC;YAEnB,cAAc,CAAC,EAAE,MAAM,CAAC;YAExB,mBAAmB,CAAC,EAAE,MAAM,CAAC;YAE7B,QAAQ,EAAE,MAAM,GAAG,KAAK,CAAC;SAC1B,CAAC;QACF,GAAG,EAAE;YACH,IAAI,EAAE,WAAW,CAAC;YAClB,GAAG,EAAE,WAAW,CAAC;SAClB,CAAC;QACF,QAAQ,EAAE;YACR,IAAI,EAAE,MAAM,CAAC;YAEb,UAAU,EAAE,MAAM,CAAC;YAEnB,UAAU,EAAE,MAAM,CAAC;YAEnB,aAAa,EAAE,MAAM,CAAC;YAEtB,UAAU,EAAE,MAAM,CAAC;SACpB,CAAC;QAEF,MAAM,EAAE;YACN,OAAO,EAAE;gBACP,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC;aAC1B,CAAC;YAEF,qBAAqB,EAAE,CAAC,KAAK,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC,EAAE,CAAC;SACtE,CAAC;QACF,UAAU,CAAC,EAAE;YACX,KAAK,EAAE,MAAM,CAAC;SACf,CAAC;QACF,QAAQ,CAAC,EAAE,MAAM,CAAC;KACnB,CAAC;IACF,MAAM,EAAE;QACN,SAAS,EAAE,mBAAmB,CAAC;QAC/B,SAAS,EAAE,mBAAmB,CAAC;KAChC,CAAC;IACF,UAAU,EAAE;QACV,oBAAoB,CAAC,EAAE,MAAM,CAAC;QAC9B,oBAAoB,CAAC,EAAE,MAAM,CAAC;QAC9B,SAAS,EACL,aAAa,GACb,UAAU,GACV,QAAQ,GACR,UAAU,GACV,cAAc,GACd,WAAW,GACX,WAAW,GACX,YAAY,GACZ,QAAQ,GACR,YAAY,GACZ,UAAU,GACV,eAAe,GACf,qBAAqB,GACrB,OAAO,GACP,kBAAkB,GAClB,UAAU,GACV,MAAM,GACN,QAAQ,GACR,gBAAgB,GAChB,gBAAgB,GAChB,SAAS,CAAC;QACd,KAAK,EAAE,MAAM,CAAC;QACd,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,IAAI,CAAC,EAAE,MAAM,CAAC;QAEd,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB,SAAS,CAAC,EACN,QAAQ,GACR,YAAY,GACZ,MAAM,GACN,QAAQ,GACR,SAAS,GACT,eAAe,GACf,eAAe,CAAC;QACpB,OAAO,CAAC,EAAE,MAAM,CAAC;QAEjB,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,MAAM,CAAC,EAAE,MAAM,CAAC;QAEhB,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,MAAM,CAAC,EAAE,MAAM,CAAC;QAEhB,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,UAAU,CAAC,EAAE,MAAM,CAAC;QAEpB,eAAe,CAAC,EAAE,MAAM,CAAC;QACzB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,IAAI,CAAC,EAAE,MAAM,CAAC;QAEd,cAAc,CAAC,EAAE,MAAM,CAAC;QAExB,mBAAmB,CAAC,EAAE,MAAM,CAAC;QAE7B,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,KAAK,CAAC,EAAE,MAAM,CAAC;QAEf,UAAU,CAAC,EAAE,MAAM,CAAC;QAEpB,cAAc,CAAC,EAAE,MAAM,CAAC;QACxB,MAAM,CAAC,EAAE,MAAM,CAAC;QAEhB,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,CAAC;IACF,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,mBAAmB,CAAC;CAC/B;AAED,MAAM,WAAW,gCACf,SAAQ,wBAAwB;IAChC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;CAClC;AAED,eAAO,MAAM,8BAA8B;;;;CAG1C,CAAC;AAEF,MAAM,CAAC,OAAO,OAAO,gBAAiB,YAAW,iBAAiB;IAChE,OAAO,CAAC,cAAc,CAA0B;IAEhD,OAAO,CAAC,OAAO,CAAmC;gBAGhD,eAAe,EAAE,uBAAuB,EACxC,OAAO,GAAE,gCAAiE;IAWrE,OAAO,CACZ,KAAK,EAAE,MAAM,GAAG,oBAAoB,GAAG,0BAA0B,EACjE,QAAQ,EAAE,uBAAuB,EACjC,aAAa,CAAC,EAAE,aAAa,GAC5B,IAAI;IAkCA,SAAS,CACd,eAAe,EACX,MAAM,GACN,MAAM,GACN,oBAAoB,GACpB,0BAA0B,EAC9B,mBAAmB,EAAE,MAAM,GAAG,MAAM,GAAG,uBAAuB,EAC9D,uBAAuB,CAAC,EAAE,uBAAuB,GAAG,aAAa,EACjE,aAAa,CAAC,EAAE,aAAa,GAC5B,IAAI;IAkCP,OAAO,CAAC,gBAAgB;IAkBjB,cAAc,CACnB,MAAM,EAAE,oBAAoB,EAC5B,QAAQ,EAAE,uBAAuB,EACjC,OAAO,CAAC,EAAE,qBAAqB,EAC/B,aAAa,CAAC,EAAE,aAAa,GAC5B,IAAI;WA+DO,aAAa,CAAC,MAAM,EAAE,cAAc,GAAG,gBAAgB;CAmGtE"} \ No newline at end of file diff --git a/types/provider/opencage/OpenCageReverseQuery.d.ts b/types/provider/opencage/OpenCageReverseQuery.d.ts deleted file mode 100644 index 2358d54..0000000 --- a/types/provider/opencage/OpenCageReverseQuery.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { ReverseQuery, ReverseQueryObject } from "../../query"; -export interface OpenCageReverseQueryObject extends ReverseQueryObject { - readonly countryCodes?: string[]; - readonly minConfidence?: number; - readonly noRecord?: boolean; -} -export default class OpenCageReverseQuery extends ReverseQuery { - private readonly countryCodes?; - private readonly minConfidence?; - private readonly noRecord?; - protected constructor({ countryCodes, minConfidence, noRecord, ...reverseQueryObject }: OpenCageReverseQueryObject); - static create(object: OpenCageReverseQueryObject): OpenCageReverseQuery; - toObject(): OpenCageReverseQueryObject; - withCountryCodes(countryCodes: string[]): OpenCageReverseQuery; - getCountryCodes(): undefined | string[]; - withMinConfidence(minConfidence: number): OpenCageReverseQuery; - getMinConfidence(): undefined | number; - withNoRecord(noRecord: boolean): OpenCageReverseQuery; - getNoRecord(): undefined | boolean; -} -//# sourceMappingURL=OpenCageReverseQuery.d.ts.map \ No newline at end of file diff --git a/types/provider/opencage/OpenCageReverseQuery.d.ts.map b/types/provider/opencage/OpenCageReverseQuery.d.ts.map deleted file mode 100644 index 708dcb3..0000000 --- a/types/provider/opencage/OpenCageReverseQuery.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"OpenCageReverseQuery.d.ts","sourceRoot":"","sources":["../../../src/provider/opencage/OpenCageReverseQuery.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,oBAAc;AAEzD,MAAM,WAAW,0BAA2B,SAAQ,kBAAkB;IACpE,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACjC,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED,MAAM,CAAC,OAAO,OAAO,oBAAqB,SAAQ,YAAY;IAC5D,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAW;IAEzC,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAS;IAExC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAU;IAEpC,SAAS,aAAa,EACpB,YAAY,EACZ,aAAa,EACb,QAAQ,EACR,GAAG,kBAAkB,EACtB,EAAE,0BAA0B;WAkBf,MAAM,CAClB,MAAM,EAAE,0BAA0B,GACjC,oBAAoB;IAIhB,QAAQ,IAAI,0BAA0B;IAStC,gBAAgB,CAAC,YAAY,EAAE,MAAM,EAAE,GAAG,oBAAoB;IAI9D,eAAe,IAAI,SAAS,GAAG,MAAM,EAAE;IAIvC,iBAAiB,CAAC,aAAa,EAAE,MAAM,GAAG,oBAAoB;IAI9D,gBAAgB,IAAI,SAAS,GAAG,MAAM;IAItC,YAAY,CAAC,QAAQ,EAAE,OAAO,GAAG,oBAAoB;IAIrD,WAAW,IAAI,SAAS,GAAG,OAAO;CAG1C"} \ No newline at end of file diff --git a/types/provider/opencage/index.d.ts b/types/provider/opencage/index.d.ts deleted file mode 100644 index c1ba98e..0000000 --- a/types/provider/opencage/index.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -export { default as OpenCageGeocoded } from "./OpenCageGeocoded"; -export { default as OpenCageGeocodeQuery } from "./OpenCageGeocodeQuery"; -export * from "./OpenCageGeocodeQuery"; -export { default as OpenCageProvider } from "./OpenCageProvider"; -export * from "./OpenCageProvider"; -export { default as OpenCageReverseQuery } from "./OpenCageReverseQuery"; -export * from "./OpenCageReverseQuery"; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/types/provider/opencage/index.d.ts.map b/types/provider/opencage/index.d.ts.map deleted file mode 100644 index ee51336..0000000 --- a/types/provider/opencage/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/provider/opencage/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAOkD,oBAAoB,CAP3B;AACjF,OAAO,EAAE,OAAO,IAAI,oBAAoB,EAAE,MAMkE,wBAAwB,CAN3C;AACzF,cAK4G,wBAAwB,CAL7E;AACvD,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAI8F,oBAAoB,CAJvE;AACjF,cAGoI,oBAAoB,CAHrG;AACnD,OAAO,EAAE,OAAO,IAAI,oBAAoB,EAAE,MAE8G,wBAAwB,CAFvF;AACzF,cACwJ,wBAAwB,CADzH"} \ No newline at end of file diff --git a/types/query/GeocodeQuery.d.ts b/types/query/GeocodeQuery.d.ts deleted file mode 100644 index 4d31021..0000000 --- a/types/query/GeocodeQuery.d.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { PartialSome } from "../types"; -import { Bounds } from "../index"; -declare type GeocodeQueryObjectCreate = PartialSome; -export interface GeocodeQueryObject { - readonly text: string; - readonly south?: number | string; - readonly west?: number | string; - readonly north?: number | string; - readonly east?: number | string; - readonly locale?: string; - readonly limit?: number; -} -export default class GeocodeQuery { - private readonly text; - private readonly south?; - private readonly west?; - private readonly north?; - private readonly east?; - private readonly locale?; - private readonly limit; - protected constructor({ text, south, west, north, east, locale, limit, }: GeocodeQueryObjectCreate); - static create(object: GeocodeQueryObjectCreate): GeocodeQuery; - toObject(): GeocodeQueryObject; - withText(text: string): GeocodeQuery; - withBounds(south?: number, west?: number, north?: number, east?: number): GeocodeQuery; - withLocale(locale: string): GeocodeQuery; - withLimit(limit: number): GeocodeQuery; - getText(): string; - getBounds(): undefined | Bounds; - getLocale(): undefined | string; - getLimit(): number; -} -export {}; -//# sourceMappingURL=GeocodeQuery.d.ts.map \ No newline at end of file diff --git a/types/query/GeocodeQuery.d.ts.map b/types/query/GeocodeQuery.d.ts.map deleted file mode 100644 index 5583009..0000000 --- a/types/query/GeocodeQuery.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"GeocodeQuery.d.ts","sourceRoot":"","sources":["../../src/query/GeocodeQuery.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,iBAAc;AACpC,OAAO,EAAE,MAAM,EAAE,iBAAc;AAE/B,aAAK,wBAAwB,GAAG,WAAW,CAAC,kBAAkB,EAAE,OAAO,CAAC,CAAC;AAEzE,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACjC,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAChC,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACjC,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAChC,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,CAAC,OAAO,OAAO,YAAY;IAC/B,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAS;IAE9B,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAkB;IAEzC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAkB;IAExC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAkB;IAEzC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAkB;IAExC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAS;IAEjC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAgC;IAEtD,SAAS,aAAa,EACpB,IAAI,EACJ,KAAK,EACL,IAAI,EACJ,KAAK,EACL,IAAI,EACJ,MAAM,EACN,KAA4B,GAC7B,EAAE,wBAAwB;WAUb,MAAM,CAAC,MAAM,EAAE,wBAAwB,GAAG,YAAY;IAI7D,QAAQ,IAAI,kBAAkB;IAY9B,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,YAAY;IAOpC,UAAU,CACf,KAAK,CAAC,EAAE,MAAM,EACd,IAAI,CAAC,EAAE,MAAM,EACb,KAAK,CAAC,EAAE,MAAM,EACd,IAAI,CAAC,EAAE,MAAM,GACZ,YAAY;IAUR,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY;IAOxC,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,YAAY;IAOtC,OAAO,IAAI,MAAM;IAIjB,SAAS,IAAI,SAAS,GAAG,MAAM;IAa/B,SAAS,IAAI,SAAS,GAAG,MAAM;IAI/B,QAAQ,IAAI,MAAM;CAG1B"} \ No newline at end of file diff --git a/types/query/ReverseQuery.d.ts b/types/query/ReverseQuery.d.ts deleted file mode 100644 index 62ab75c..0000000 --- a/types/query/ReverseQuery.d.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { PartialSome } from "../types"; -import { Coordinates } from "../index"; -declare type ReverseQueryObjectCreate = PartialSome; -export interface ReverseQueryObject { - readonly latitude: number | string; - readonly longitude: number | string; - readonly locale?: string; - readonly limit: number; -} -export default class ReverseQuery { - private readonly latitude; - private readonly longitude; - private readonly locale?; - private readonly limit; - protected constructor({ latitude, longitude, locale, limit, }: ReverseQueryObjectCreate); - static create(object: ReverseQueryObjectCreate): ReverseQuery; - toObject(): ReverseQueryObject; - withCoordinates(latitude: number, longitude: number): ReverseQuery; - withLocale(locale: string): ReverseQuery; - withLimit(limit: number): ReverseQuery; - getCoordinates(): Coordinates; - getLocale(): undefined | string; - getLimit(): number; -} -export {}; -//# sourceMappingURL=ReverseQuery.d.ts.map \ No newline at end of file diff --git a/types/query/ReverseQuery.d.ts.map b/types/query/ReverseQuery.d.ts.map deleted file mode 100644 index 09f18c0..0000000 --- a/types/query/ReverseQuery.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ReverseQuery.d.ts","sourceRoot":"","sources":["../../src/query/ReverseQuery.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,iBAAc;AACpC,OAAO,EAAE,WAAW,EAAE,iBAAc;AAEpC,aAAK,wBAAwB,GAAG,WAAW,CAAC,kBAAkB,EAAE,OAAO,CAAC,CAAC;AAEzE,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAAC;IACnC,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAAC;IACpC,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,CAAC,OAAO,OAAO,YAAY;IAC/B,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAkB;IAE3C,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAkB;IAE5C,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAS;IAEjC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAgC;IAEtD,SAAS,aAAa,EACpB,QAAQ,EACR,SAAS,EACT,MAAM,EACN,KAA4B,GAC7B,EAAE,wBAAwB;WAOb,MAAM,CAAC,MAAM,EAAE,wBAAwB,GAAG,YAAY;IAI7D,QAAQ,IAAI,kBAAkB;IAS9B,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,YAAY;IAQlE,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY;IAOxC,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,YAAY;IAOtC,cAAc,IAAI,WAAW;IAI7B,SAAS,IAAI,SAAS,GAAG,MAAM;IAI/B,QAAQ,IAAI,MAAM;CAG1B"} \ No newline at end of file diff --git a/types/query/index.d.ts b/types/query/index.d.ts deleted file mode 100644 index b09e0ed..0000000 --- a/types/query/index.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -export { default as GeocodeQuery } from "./GeocodeQuery"; -export * from "./GeocodeQuery"; -export { default as ReverseQuery } from "./ReverseQuery"; -export * from "./ReverseQuery"; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/types/query/index.d.ts.map b/types/query/index.d.ts.map deleted file mode 100644 index d7882fb..0000000 --- a/types/query/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/query/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAIF,gBAAgB,CAJa;AAC7D,cAGgC,gBAAgB,CAHb;AACnC,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAEc,gBAAgB,CAFH;AAC7D,cACgD,gBAAgB,CAD7B"} \ No newline at end of file diff --git a/types/types.d.ts b/types/types.d.ts deleted file mode 100644 index 6c1a0e1..0000000 --- a/types/types.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -export declare type PartialSome, R = { - [K in P]?: O[P]; -}> = Q & R; -export declare type Box = [number, number, number, number]; -//# sourceMappingURL=types.d.ts.map \ No newline at end of file diff --git a/types/types.d.ts.map b/types/types.d.ts.map deleted file mode 100644 index 0d59c2a..0000000 --- a/types/types.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,oBAAY,WAAW,CACrB,CAAC,EACD,CAAC,SAAS,MAAM,CAAC,EACjB,CAAC,GAAG,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,EACd,CAAC,GAAG;KAAG,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;CAAE,IACrB,CAAC,GAAG,CAAC,CAAC;AAEV,oBAAY,GAAG,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC"} \ No newline at end of file diff --git a/types/utils.d.ts b/types/utils.d.ts deleted file mode 100644 index 16d5059..0000000 --- a/types/utils.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -export declare const isBrowser: () => boolean; -export declare const filterUndefinedObjectValues: (object: Record) => Record; -/** - * Decode from URL-safe base64 to true base64. - */ -export declare const decodeUrlSafeBase64: (safe: string) => string; -/** - * Encode from true base64 to URL-safe base64. - */ -export declare const encodeUrlSafeBase64: (base64: string) => string; -export declare const decodeBase64: (base64: string) => string; -export declare const getRequireFunc: () => Function; -//# sourceMappingURL=utils.d.ts.map \ No newline at end of file diff --git a/types/utils.d.ts.map b/types/utils.d.ts.map deleted file mode 100644 index 4ba480a..0000000 --- a/types/utils.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,SAAS,QAAO,OAAwC,CAAC;AAEtE,eAAO,MAAM,2BAA2B,iEAUhC,CAAC;AAET;;GAEG;AACH,eAAO,MAAM,mBAAmB,SAAU,MAAM,KAAG,MACP,CAAC;AAE7C;;GAEG;AACH,eAAO,MAAM,mBAAmB,WAAY,MAAM,KAAG,MACL,CAAC;AAEjD,eAAO,MAAM,YAAY,WAAY,MAAM,KAAG,MAM7C,CAAC;AAGF,eAAO,MAAM,cAAc,QAAO,QAKrB,CAAC"} \ No newline at end of file diff --git a/webpack.dev.js b/webpack.dev.js index 673dc3d..0c11c9c 100644 --- a/webpack.dev.js +++ b/webpack.dev.js @@ -1,4 +1,4 @@ -const merge = require("webpack-merge"); +const { merge } = require("webpack-merge"); const common = require("./webpack.common.js"); module.exports = merge(common, { diff --git a/webpack.prod.js b/webpack.prod.js index ed03128..29c39f1 100644 --- a/webpack.prod.js +++ b/webpack.prod.js @@ -1,4 +1,4 @@ -const merge = require("webpack-merge"); +const { merge } = require("webpack-merge"); const common = require("./webpack.common.js"); module.exports = merge(common, { diff --git a/website/css/main.css b/website/css/main.css index e44dd5f..436e61f 100644 --- a/website/css/main.css +++ b/website/css/main.css @@ -46,6 +46,9 @@ code { img[alt="CI"] { display: none; } +img[alt="codecov"] { + display: none; +} #content img { max-width: 100%; From c28cc47ee235c7710eaf8ef47c8a625486b7129d Mon Sep 17 00:00:00 2001 From: Alan Poulain Date: Sat, 15 Aug 2020 17:42:33 +0200 Subject: [PATCH 34/56] Add GeoPlugin provider (#5) --- CHANGELOG.md | 1 + README.md | 46 ++-- couscous.yml | 3 + docs/provider_usage.md | 1 + docs/provider_usage/geoplugin.md | 5 + example/node/geoplugin.ts | 9 + example/web/geoplugin.html | 16 ++ package.json | 2 + spec/provider/BingProvider.spec.ts | 19 ++ spec/provider/GeoPluginProvider.spec.ts | 132 +++++++++++ spec/provider/GoogleMapsProvider.spec.ts | 19 ++ spec/provider/MapboxProvider.spec.ts | 19 ++ spec/provider/MapquestProvider.spec.ts | 19 ++ spec/provider/NominatimProvider.spec.ts | 19 ++ spec/provider/OpenCageProvider.spec.ts | 19 ++ spec/provider/YandexProvider.spec.ts | 19 ++ .../recording.har | 110 +++++++++ .../recording.har | 110 +++++++++ spec/utils.spec.ts | 52 +++++ src/GeocoderProviderFactory.ts | 15 ++ src/error/ResponseError.ts | 4 + src/provider/BingProvider.ts | 6 + src/provider/ChainProvider.ts | 14 +- src/provider/MapquestProvider.ts | 8 +- src/provider/ProviderHelpers.ts | 4 + src/provider/YandexProvider.ts | 8 +- src/provider/geoplugin/GeoPluginGeocoded.ts | 39 ++++ src/provider/geoplugin/GeoPluginProvider.ts | 215 ++++++++++++++++++ src/provider/geoplugin/index.ts | 3 + src/provider/googlemaps/GoogleMapsProvider.ts | 6 + src/provider/index.ts | 1 + src/provider/mapbox/MapboxProvider.ts | 6 + src/provider/nominatim/NominatimProvider.ts | 6 + src/provider/opencage/OpenCageProvider.ts | 8 +- src/query/GeocodeQuery.ts | 26 ++- src/utils.ts | 12 + 36 files changed, 967 insertions(+), 34 deletions(-) create mode 100644 docs/provider_usage/geoplugin.md create mode 100644 example/node/geoplugin.ts create mode 100644 example/web/geoplugin.html create mode 100644 spec/provider/GeoPluginProvider.spec.ts create mode 100644 spec/recordings/GeoPlugin-Geocoder-Provider_1191504894/receives-correct-IP-geolocation-results_4027179090/recording.har create mode 100644 spec/recordings/GeoPlugin-Geocoder-Provider_1191504894/receives-error-when-IP-is-not-found_3609480229/recording.har create mode 100644 spec/utils.spec.ts create mode 100644 src/provider/geoplugin/GeoPluginGeocoded.ts create mode 100644 src/provider/geoplugin/GeoPluginProvider.ts create mode 100644 src/provider/geoplugin/index.ts diff --git a/CHANGELOG.md b/CHANGELOG.md index 590c671..4aa4445 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ## 0.5.0 * Add special chain provider +* Add GeoPlugin provider * Add `errorCallback` parameter to `geocode` and `geodecode` * Add `body` parameter to `executeRequest` * [MapQuest] Fix geocode request (bad encoded query) diff --git a/README.md b/README.md index b1465ef..d0c7e5f 100644 --- a/README.md +++ b/README.md @@ -10,9 +10,11 @@ Universal Geocoder is a universal JavaScript library for client-side geocoding a Need geocoding 🌍️ in your website or application? Don't want to be vendor-locked to a service? ✨️ Universal Geocoder ✨️ is for you! +Depending of the chosen provider, it can use geocoding, reverse geocoding or IP geolocation. + Universal Geocoder is a TypeScript fork of [GeocoderJS](https://github.com/geocoder-php/geocoder-js), itself a port of the [Geocoder PHP](https://geocoder-php.org/) library. -This library is platform agnostic: it is available either server-side (Node) or client-side (browsers, React Native, Electron). +This library is platform agnostic: it is available either server-side (**Node**) or client-side (**browsers**, **React Native**, **Electron**). Installation ------------ @@ -96,6 +98,7 @@ googleGeocoder.geodecode(reverseQuery, (result) => { ### Common `geocode` parameters (`GeocodeQuery` object) - `text`: what is searched +- `ip`: the IP searched - `south`, `west`, `north`, `east` (`withBounds` method): the bounds to use - `locale`: the locale to use for the query - `limit`: the maximum number of results to have @@ -128,12 +131,10 @@ The following table summarizes the features of each: Provider - Name - Works in browsers? - Works in Node? - Works in React Native? - Works in Electron? + Codename + Supports location geocoding? Supports reverse geocoding? + Supports IP geolocation? @@ -142,62 +143,55 @@ The following table summarizes the features of each: openstreetmap or nominatim ✅️ yes ✅️ yes - ❓️ untested - ❓️ untested - ✅️ yes + ❌️ no OpenCage opencage ✅️ yes ✅️ yes - ❓️ untested - ❓️ untested - ✅️ yes + ❌️ no Google Maps (Geocoding API) google or googlemaps ✅️ yes ✅️ yes - ❓️ untested - ❓️ untested - ✅️ yes + ❌️ no Mapbox mapbox ✅️ yes ✅️ yes - ❓️ untested - ❓️ untested - ✅️ yes + ❌️ no MapQuest mapquest ✅️ yes ✅️ yes - ❓️ untested - ❓️ untested - ✅️ yes + ❌️ no Bing bing ✅️ yes ✅️ yes - ❓️ untested - ❓️ untested - ✅️ yes + ❌️ no Yandex yandex ✅️ yes ✅️ yes - ❓️ untested - ❓️ untested + ❌️ no + + + GeoPlugin + geoplugin + ❌️ no + ❌️ no ✅️ yes diff --git a/couscous.yml b/couscous.yml index d03f12a..d4593ee 100644 --- a/couscous.yml +++ b/couscous.yml @@ -38,5 +38,8 @@ menu: yandex: text: 📌️ Yandex relativeUrl: docs/provider_usage/yandex.html + geoplugin: + text: 📌️ GeoPlugin + relativeUrl: docs/provider_usage/geoplugin.html baseUrl: /universal-geocoder-js/ diff --git a/docs/provider_usage.md b/docs/provider_usage.md index a2768da..ffcefa8 100644 --- a/docs/provider_usage.md +++ b/docs/provider_usage.md @@ -8,3 +8,4 @@ Each provider has its own options, parameters or results because of its specific - [Google Maps (Geocoding API)](provider_usage/googlemaps.md) - [Mapbox](provider_usage/mapbox.md) - [Yandex](provider_usage/yandex.md) +- [GeoPlugin](provider_usage/geoplugin.md) diff --git a/docs/provider_usage/geoplugin.md b/docs/provider_usage/geoplugin.md new file mode 100644 index 0000000..68be0aa --- /dev/null +++ b/docs/provider_usage/geoplugin.md @@ -0,0 +1,5 @@ +# GeoPlugin Usage + +## `Geocoded` properties + +- `attribution`: credit information diff --git a/example/node/geoplugin.ts b/example/node/geoplugin.ts new file mode 100644 index 0000000..d06f0d1 --- /dev/null +++ b/example/node/geoplugin.ts @@ -0,0 +1,9 @@ +/* eslint-disable no-console */ +import UniversalGeocoder from "../../dist/UniversalGeocoder"; + +const geoPluginGeocoder = UniversalGeocoder.createGeocoder({ + provider: "geoplugin", +}); +geoPluginGeocoder.geocode("190.226.155.134", (result) => { + console.log(result); +}); diff --git a/example/web/geoplugin.html b/example/web/geoplugin.html new file mode 100644 index 0000000..dc0e1e4 --- /dev/null +++ b/example/web/geoplugin.html @@ -0,0 +1,16 @@ + + + + Universal Geocoder: GeoPlugin Example + + + + + + + \ No newline at end of file diff --git a/package.json b/package.json index a7b26ed..8cebcce 100644 --- a/package.json +++ b/package.json @@ -5,6 +5,8 @@ "keywords": [ "geocoder", "geocoding", + "geolocation", + "ip-geolocation", "typescript", "isomorphic", "universal", diff --git a/spec/provider/BingProvider.spec.ts b/spec/provider/BingProvider.spec.ts index 4bbb889..a1720dc 100644 --- a/spec/provider/BingProvider.spec.ts +++ b/spec/provider/BingProvider.spec.ts @@ -22,6 +22,25 @@ describe("Bing Geocoder Provider", () => { ); }); + it("expects to not support IP geolocation", () => { + const provider = UniversalGeocoder.createGeocoder({ + provider: "bing", + useSsl: true, + apiKey: "api_key", + }); + + expect(() => + provider?.geocode( + "66.147.244.214", + // eslint-disable-next-line @typescript-eslint/no-empty-function + () => {} + ) + ).toThrowError( + Error, + "The Bing provider does not support IP geolocation, only location geocoding." + ); + }); + it("receives correct geocoding results", (done) => { const provider = UniversalGeocoder.createGeocoder({ provider: "bing", diff --git a/spec/provider/GeoPluginProvider.spec.ts b/spec/provider/GeoPluginProvider.spec.ts new file mode 100644 index 0000000..2cbe284 --- /dev/null +++ b/spec/provider/GeoPluginProvider.spec.ts @@ -0,0 +1,132 @@ +import UniversalGeocoder from "UniversalGeocoder"; +import { GeoPluginGeocoded } from "provider"; +import AdminLevel from "AdminLevel"; +import setupPolly, { cleanRecording } from "../setupPolly"; + +describe("GeoPlugin Geocoder Provider", () => { + const pollyContext = setupPolly(); + + beforeEach(() => { + cleanRecording(pollyContext); + }); + + afterEach(async () => { + await pollyContext.polly.flush(); + }); + + it("expects to not support location geocoding", () => { + const provider = UniversalGeocoder.createGeocoder({ + provider: "geoplugin", + }); + + expect(() => + provider?.geocode( + "1600 Pennsylvania Ave, Washington, DC", + // eslint-disable-next-line @typescript-eslint/no-empty-function + () => {} + ) + ).toThrowError( + Error, + "The GeoPlugin provider does not support location geocoding, only IP geolocation." + ); + }); + + it("expects to not support reverse geocoding", () => { + const provider = UniversalGeocoder.createGeocoder({ + provider: "geoplugin", + }); + + expect(() => + provider?.geodecode( + 48.8631507, + 2.388911, + // eslint-disable-next-line @typescript-eslint/no-empty-function + () => {} + ) + ).toThrowError( + Error, + "The GeoPlugin provider does not support reverse geocoding." + ); + }); + + it("receives correct IP geolocation results", (done) => { + const provider = UniversalGeocoder.createGeocoder({ + provider: "geoplugin", + }); + + provider?.geocode("190.226.155.134", (results: GeoPluginGeocoded[]) => { + const geocoded = results[0]; + + expect(geocoded).toBeDefined(); + expect(geocoded.getCoordinates()).toEqual([-32.2167, -58.1333]); + expect(geocoded.getBounds()).toEqual([ + undefined, + undefined, + undefined, + undefined, + ]); + expect(geocoded.getFormattedAddress()).toEqual(undefined); + expect(geocoded.getStreetNumber()).toEqual(undefined); + expect(geocoded.getStreetName()).toEqual(undefined); + expect(geocoded.getSubLocality()).toEqual(undefined); + expect(geocoded.getLocality()).toEqual("Colon"); + expect(geocoded.getPostalCode()).toEqual(undefined); + expect(geocoded.getRegion()).toEqual("Entre Rios"); + expect(geocoded.getAdminLevels()).toEqual([ + AdminLevel.create({ level: 1, name: "Entre Rios", code: "E" }), + ]); + expect(geocoded.getCountry()).toEqual("Argentina"); + expect(geocoded.getCountryCode()).toEqual("AR"); + + done(); + }); + }); + + it("receives correct IP geolocation localhost results", (done) => { + const provider = UniversalGeocoder.createGeocoder({ + provider: "geoplugin", + }); + + provider?.geocode("127.0.0.1", (results: GeoPluginGeocoded[]) => { + const geocoded = results[0]; + + expect(geocoded).toBeDefined(); + expect(geocoded.getCoordinates()).toEqual([undefined, undefined]); + expect(geocoded.getBounds()).toEqual([ + undefined, + undefined, + undefined, + undefined, + ]); + expect(geocoded.getFormattedAddress()).toEqual(undefined); + expect(geocoded.getStreetNumber()).toEqual(undefined); + expect(geocoded.getStreetName()).toEqual(undefined); + expect(geocoded.getSubLocality()).toEqual(undefined); + expect(geocoded.getLocality()).toEqual("localhost"); + expect(geocoded.getPostalCode()).toEqual(undefined); + expect(geocoded.getRegion()).toEqual(undefined); + expect(geocoded.getAdminLevels()).toEqual([]); + expect(geocoded.getCountry()).toEqual("localhost"); + expect(geocoded.getCountryCode()).toEqual(undefined); + + done(); + }); + }); + + it("receives error when IP is not found", (done) => { + const provider = UniversalGeocoder.createGeocoder({ + provider: "geoplugin", + }); + + provider?.geocode( + "192.168.1.10", + () => { + done(); + }, + (error) => { + expect(error.message).toEqual("An error has occurred. Status: 404."); + done(); + } + ); + }); +}); diff --git a/spec/provider/GoogleMapsProvider.spec.ts b/spec/provider/GoogleMapsProvider.spec.ts index 1620543..3bdff07 100644 --- a/spec/provider/GoogleMapsProvider.spec.ts +++ b/spec/provider/GoogleMapsProvider.spec.ts @@ -47,6 +47,25 @@ describe("Google Maps Geocoder Provider", () => { ); }); + it("expects to not support IP geolocation", () => { + const provider = UniversalGeocoder.createGeocoder({ + provider: "googlemaps", + useSsl: true, + apiKey: "api_key", + }); + + expect(() => + provider?.geocode( + "66.147.244.214", + // eslint-disable-next-line @typescript-eslint/no-empty-function + () => {} + ) + ).toThrowError( + Error, + "The GoogleMaps provider does not support IP geolocation, only location geocoding." + ); + }); + it("receives correct geocoding results", (done) => { const provider = UniversalGeocoder.createGeocoder({ provider: "googlemaps", diff --git a/spec/provider/MapboxProvider.spec.ts b/spec/provider/MapboxProvider.spec.ts index 421530a..30d5d7e 100644 --- a/spec/provider/MapboxProvider.spec.ts +++ b/spec/provider/MapboxProvider.spec.ts @@ -22,6 +22,25 @@ describe("Mapbox Geocoder Provider", () => { ); }); + it("expects to not support IP geolocation", () => { + const provider = UniversalGeocoder.createGeocoder({ + provider: "mapbox", + useSsl: true, + apiKey: "api_key", + }); + + expect(() => + provider?.geocode( + "66.147.244.214", + // eslint-disable-next-line @typescript-eslint/no-empty-function + () => {} + ) + ).toThrowError( + Error, + "The Mapbox provider does not support IP geolocation, only location geocoding." + ); + }); + it("receives correct geocoding results", (done) => { const provider = UniversalGeocoder.createGeocoder({ provider: "mapbox", diff --git a/spec/provider/MapquestProvider.spec.ts b/spec/provider/MapquestProvider.spec.ts index 4713f95..0e7949b 100644 --- a/spec/provider/MapquestProvider.spec.ts +++ b/spec/provider/MapquestProvider.spec.ts @@ -22,6 +22,25 @@ describe("MapQuest Geocoder Provider", () => { ); }); + it("expects to not support IP geolocation", () => { + const provider = UniversalGeocoder.createGeocoder({ + provider: "mapquest", + useSsl: true, + apiKey: "api_key", + }); + + expect(() => + provider?.geocode( + "66.147.244.214", + // eslint-disable-next-line @typescript-eslint/no-empty-function + () => {} + ) + ).toThrowError( + Error, + "The MapQuest provider does not support IP geolocation, only location geocoding." + ); + }); + it("receives correct geocoding results", (done) => { const provider = UniversalGeocoder.createGeocoder({ provider: "mapquest", diff --git a/spec/provider/NominatimProvider.spec.ts b/spec/provider/NominatimProvider.spec.ts index 2797b7b..07e2eb8 100644 --- a/spec/provider/NominatimProvider.spec.ts +++ b/spec/provider/NominatimProvider.spec.ts @@ -22,6 +22,25 @@ describe("OpenStreetMap / Nominatim Geocoder Provider", () => { ); }); + it("expects to not support IP geolocation", () => { + const provider = UniversalGeocoder.createGeocoder({ + provider: "nominatim", + useSsl: true, + userAgent: "Universal Geocoder Example", + }); + + expect(() => + provider?.geocode( + "66.147.244.214", + // eslint-disable-next-line @typescript-eslint/no-empty-function + () => {} + ) + ).toThrowError( + Error, + "The OpenStreetMap / Nominatim provider does not support IP geolocation, only location geocoding." + ); + }); + it("receives correct geocoding results", (done) => { const provider = UniversalGeocoder.createGeocoder({ provider: "nominatim", diff --git a/spec/provider/OpenCageProvider.spec.ts b/spec/provider/OpenCageProvider.spec.ts index fbc7836..306353e 100644 --- a/spec/provider/OpenCageProvider.spec.ts +++ b/spec/provider/OpenCageProvider.spec.ts @@ -22,6 +22,25 @@ describe("OpenCage Geocoder Provider", () => { ); }); + it("expects to not support IP geolocation", () => { + const provider = UniversalGeocoder.createGeocoder({ + provider: "opencage", + useSsl: true, + apiKey: "api_key", + }); + + expect(() => + provider?.geocode( + "66.147.244.214", + // eslint-disable-next-line @typescript-eslint/no-empty-function + () => {} + ) + ).toThrowError( + Error, + "The OpenCage provider does not support IP geolocation, only location geocoding." + ); + }); + it("receives correct geocoding results", (done) => { const provider = UniversalGeocoder.createGeocoder({ provider: "opencage", diff --git a/spec/provider/YandexProvider.spec.ts b/spec/provider/YandexProvider.spec.ts index f4019d7..f8ddab4 100644 --- a/spec/provider/YandexProvider.spec.ts +++ b/spec/provider/YandexProvider.spec.ts @@ -12,6 +12,25 @@ describe("Yandex Geocoder Provider", () => { await pollyContext.polly.flush(); }); + it("expects to not support IP geolocation", () => { + const provider = UniversalGeocoder.createGeocoder({ + provider: "yandex", + useSsl: true, + apiKey: "api_key", + }); + + expect(() => + provider?.geocode( + "66.147.244.214", + // eslint-disable-next-line @typescript-eslint/no-empty-function + () => {} + ) + ).toThrowError( + Error, + "The Yandex provider does not support IP geolocation, only location geocoding." + ); + }); + it("receives correct geocoding results", (done) => { const provider = UniversalGeocoder.createGeocoder({ provider: "yandex", diff --git a/spec/recordings/GeoPlugin-Geocoder-Provider_1191504894/receives-correct-IP-geolocation-results_4027179090/recording.har b/spec/recordings/GeoPlugin-Geocoder-Provider_1191504894/receives-correct-IP-geolocation-results_4027179090/recording.har new file mode 100644 index 0000000..74ff019 --- /dev/null +++ b/spec/recordings/GeoPlugin-Geocoder-Provider_1191504894/receives-correct-IP-geolocation-results_4027179090/recording.har @@ -0,0 +1,110 @@ +{ + "log": { + "_recordingName": "GeoPlugin Geocoder Provider/receives correct IP geolocation results", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "5.0.0" + }, + "entries": [ + { + "_id": "05202cf8a6f2058fa16406cb3e37e3a4", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + }, + { + "_fromType": "array", + "name": "user-agent", + "value": "node-fetch/1.0 (+https://github.com/bitinn/node-fetch)" + }, + { + "_fromType": "array", + "name": "accept-encoding", + "value": "gzip,deflate" + }, + { + "_fromType": "array", + "name": "connection", + "value": "close" + }, + { + "name": "host", + "value": "www.geoplugin.net" + } + ], + "headersSize": 224, + "httpVersion": "HTTP/1.1", + "method": "GET", + "queryString": [ + { + "name": "ip", + "value": "190.226.155.134" + } + ], + "url": "http://www.geoplugin.net/json.gp?ip=190.226.155.134" + }, + "response": { + "bodySize": 974, + "content": { + "mimeType": "text/plain; charset=utf-8", + "size": 974, + "text": "{\n \"geoplugin_request\":\"190.226.155.134\",\n \"geoplugin_status\":200,\n \"geoplugin_delay\":\"1ms\",\n \"geoplugin_credit\":\"Some of the returned data includes GeoLite data created by MaxMind, available from http:\\/\\/www.maxmind.com<\\/a>.\",\n \"geoplugin_city\":\"Colon\",\n \"geoplugin_region\":\"Entre Rios\",\n \"geoplugin_regionCode\":\"E\",\n \"geoplugin_regionName\":\"Entre Rios\",\n \"geoplugin_areaCode\":\"\",\n \"geoplugin_dmaCode\":\"\",\n \"geoplugin_countryCode\":\"AR\",\n \"geoplugin_countryName\":\"Argentina\",\n \"geoplugin_inEU\":0,\n \"geoplugin_euVATrate\":false,\n \"geoplugin_continentCode\":\"SA\",\n \"geoplugin_continentName\":\"South America\",\n \"geoplugin_latitude\":\"-32.2167\",\n \"geoplugin_longitude\":\"-58.1333\",\n \"geoplugin_locationAccuracyRadius\":\"500\",\n \"geoplugin_timezone\":\"America\\/Argentina\\/Cordoba\",\n \"geoplugin_currencyCode\":\"ARS\",\n \"geoplugin_currencySymbol\":\"$\",\n \"geoplugin_currencySymbol_UTF8\":\"$\",\n \"geoplugin_currencyConverter\":73.1556\n}" + }, + "cookies": [], + "headers": [ + { + "name": "date", + "value": "Sat, 15 Aug 2020 15:09:59 GMT" + }, + { + "name": "content-type", + "value": "text/plain; charset=utf-8" + }, + { + "name": "content-length", + "value": "974" + }, + { + "name": "connection", + "value": "close" + }, + { + "name": "server", + "value": "Apache" + }, + { + "name": "access-control-allow-origin", + "value": "*" + } + ], + "headersSize": 168, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2020-08-15T15:09:37.597Z", + "time": 58, + "timings": { + "blocked": -1, + "connect": -1, + "dns": -1, + "receive": 0, + "send": 0, + "ssl": -1, + "wait": 58 + } + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/spec/recordings/GeoPlugin-Geocoder-Provider_1191504894/receives-error-when-IP-is-not-found_3609480229/recording.har b/spec/recordings/GeoPlugin-Geocoder-Provider_1191504894/receives-error-when-IP-is-not-found_3609480229/recording.har new file mode 100644 index 0000000..0ed1654 --- /dev/null +++ b/spec/recordings/GeoPlugin-Geocoder-Provider_1191504894/receives-error-when-IP-is-not-found_3609480229/recording.har @@ -0,0 +1,110 @@ +{ + "log": { + "_recordingName": "GeoPlugin Geocoder Provider/receives error when IP is not found", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "5.0.0" + }, + "entries": [ + { + "_id": "75bbd00961b4fee62d52c7fec2a92956", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + }, + { + "_fromType": "array", + "name": "user-agent", + "value": "node-fetch/1.0 (+https://github.com/bitinn/node-fetch)" + }, + { + "_fromType": "array", + "name": "accept-encoding", + "value": "gzip,deflate" + }, + { + "_fromType": "array", + "name": "connection", + "value": "close" + }, + { + "name": "host", + "value": "www.geoplugin.net" + } + ], + "headersSize": 221, + "httpVersion": "HTTP/1.1", + "method": "GET", + "queryString": [ + { + "name": "ip", + "value": "192.168.1.10" + } + ], + "url": "http://www.geoplugin.net/json.gp?ip=192.168.1.10" + }, + "response": { + "bodySize": 894, + "content": { + "mimeType": "text/plain; charset=utf-8", + "size": 894, + "text": "{\n \"geoplugin_request\":\"192.168.1.10\",\n \"geoplugin_status\":404,\n \"geoplugin_delay\":\"2ms\",\n \"geoplugin_credit\":\"Some of the returned data includes GeoLite data created by MaxMind, available from http:\\/\\/www.maxmind.com<\\/a>.\",\n \"geoplugin_city\":null,\n \"geoplugin_region\":null,\n \"geoplugin_regionCode\":null,\n \"geoplugin_regionName\":null,\n \"geoplugin_areaCode\":null,\n \"geoplugin_dmaCode\":null,\n \"geoplugin_countryCode\":null,\n \"geoplugin_countryName\":null,\n \"geoplugin_inEU\":0,\n \"geoplugin_euVATrate\":false,\n \"geoplugin_continentCode\":null,\n \"geoplugin_continentName\":null,\n \"geoplugin_latitude\":null,\n \"geoplugin_longitude\":null,\n \"geoplugin_locationAccuracyRadius\":null,\n \"geoplugin_timezone\":null,\n \"geoplugin_currencyCode\":null,\n \"geoplugin_currencySymbol\":null,\n \"geoplugin_currencySymbol_UTF8\":\"\",\n \"geoplugin_currencyConverter\":0\n}" + }, + "cookies": [], + "headers": [ + { + "name": "date", + "value": "Sat, 15 Aug 2020 15:39:23 GMT" + }, + { + "name": "content-type", + "value": "text/plain; charset=utf-8" + }, + { + "name": "content-length", + "value": "894" + }, + { + "name": "connection", + "value": "close" + }, + { + "name": "server", + "value": "Apache" + }, + { + "name": "access-control-allow-origin", + "value": "*" + } + ], + "headersSize": 168, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2020-08-15T15:39:01.398Z", + "time": 61, + "timings": { + "blocked": -1, + "connect": -1, + "dns": -1, + "receive": 0, + "send": 0, + "ssl": -1, + "wait": 61 + } + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/spec/utils.spec.ts b/spec/utils.spec.ts new file mode 100644 index 0000000..5103f38 --- /dev/null +++ b/spec/utils.spec.ts @@ -0,0 +1,52 @@ +import { + filterUndefinedObjectValues, + decodeUrlSafeBase64, + encodeUrlSafeBase64, + decodeBase64, + isIpv4, + isIpv6, +} from "utils"; + +describe("Utilities", () => { + it("can filter undefined object values", () => { + const object = { + string: "string", + undefined, + boolean: true, + }; + + expect(filterUndefinedObjectValues(object)).toEqual({ + string: "string", + boolean: true, + }); + }); + + const encodedBase64 = + "RW5jb2RlZCBzdHJpbmcgd2l0aCBub24tc2FmZSBjaGFyYWN0ZXJzOiA/Lg=="; + const urlSafeBase64 = + "RW5jb2RlZCBzdHJpbmcgd2l0aCBub24tc2FmZSBjaGFyYWN0ZXJzOiA_Lg=="; + + it("can decode URL-safe base64", () => { + expect(decodeUrlSafeBase64(urlSafeBase64)).toEqual(encodedBase64); + }); + + it("can encode URL-safe base64", () => { + expect(encodeUrlSafeBase64(encodedBase64)).toEqual(urlSafeBase64); + }); + + it("can decode base64", () => { + expect(decodeBase64(encodedBase64)).toEqual( + "Encoded string with non-safe characters: ?." + ); + }); + + it("can test IPV4", () => { + expect(isIpv4("190.226.155.134")).toBeTrue(); + expect(isIpv4("1aa3:9379:0fcb:0044:f09a:ca53:baf4:0472")).toBeFalse(); + }); + + it("can test IPV6", () => { + expect(isIpv6("1aa3:9379:0fcb:0044:f09a:ca53:baf4:0472")).toBeTrue(); + expect(isIpv6("190.226.155.134")).toBeFalse(); + }); +}); diff --git a/src/GeocoderProviderFactory.ts b/src/GeocoderProviderFactory.ts index df13ac4..6f40100 100644 --- a/src/GeocoderProviderFactory.ts +++ b/src/GeocoderProviderFactory.ts @@ -2,6 +2,7 @@ import { BingProvider, ChainProvider, ChainProviderOptionsInterface, + GeoPluginProvider, GoogleMapsProvider, GoogleMapsProviderOptionsInterface, MapboxProvider, @@ -26,6 +27,7 @@ interface ProviderOptionInterface { provider: | "bing" | "chain" + | "geoplugin" | "google" | "googlemaps" | "mapbox" @@ -46,6 +48,11 @@ interface ChainGeocoderProviderFactoryOptions provider: "chain"; } +interface GeoPluginGeocoderProviderFactoryOptions + extends ProviderOptionInterface { + provider: "geoplugin"; +} + interface GoogleMapsGeocoderProviderFactoryOptions extends ProviderOptionInterface, GoogleMapsProviderOptionsInterface { @@ -79,6 +86,7 @@ interface YandexGeocoderProviderFactoryOptions export type GeocoderProviderFactoryOptions = | ProviderFactoryOptions | ChainGeocoderProviderFactoryOptions + | GeoPluginGeocoderProviderFactoryOptions | GoogleMapsGeocoderProviderFactoryOptions | MapboxGeocoderProviderFactoryOptions | NominatimGeocoderProviderFactoryOptions @@ -88,6 +96,7 @@ export type GeocoderProviderFactoryOptions = export type GeocoderProvider = | BingProvider | ChainProvider + | GeoPluginProvider | GoogleMapsProvider | MapboxProvider | MapquestProvider @@ -99,6 +108,8 @@ export type GeocoderProviderByOptionsType< O > = O extends ChainGeocoderProviderFactoryOptions ? ChainProvider + : O extends GeoPluginGeocoderProviderFactoryOptions + ? GeoPluginProvider : O extends GoogleMapsGeocoderProviderFactoryOptions ? GoogleMapsProvider : O extends MapboxGeocoderProviderFactoryOptions @@ -143,6 +154,10 @@ export default class ProviderFactory { ...defaultChainProviderOptions, ...providerOptions, }); + case "geoplugin": + return >( + new GeoPluginProvider(externalLoader, providerOptions) + ); case "google": case "googlemaps": return >( diff --git a/src/error/ResponseError.ts b/src/error/ResponseError.ts index b6cf97a..90e23bf 100644 --- a/src/error/ResponseError.ts +++ b/src/error/ResponseError.ts @@ -1,4 +1,5 @@ import { + GeoPluginResult, GoogleMapsResponse, MapboxResponse, NominatimResponse, @@ -10,6 +11,7 @@ export default class ResponseError extends Error { private readonly response: | Response + | GeoPluginResult | GoogleMapsResponse | MapboxResponse | NominatimResponse @@ -19,6 +21,7 @@ export default class ResponseError extends Error { message: string, response: | Response + | GeoPluginResult | GoogleMapsResponse | MapboxResponse | NominatimResponse @@ -34,6 +37,7 @@ export default class ResponseError extends Error { public getResponse(): | Response + | GeoPluginResult | GoogleMapsResponse | MapboxResponse | NominatimResponse diff --git a/src/provider/BingProvider.ts b/src/provider/BingProvider.ts index 9d86140..c1bfb33 100644 --- a/src/provider/BingProvider.ts +++ b/src/provider/BingProvider.ts @@ -82,6 +82,12 @@ export default class BingProvider implements ProviderInterface { ): void { const geocodeQuery = ProviderHelpers.getGeocodeQueryFromParameter(query); + if (geocodeQuery.getIp()) { + throw new Error( + "The Bing provider does not support IP geolocation, only location geocoding." + ); + } + this.externalLoader.setOptions({ protocol: this.options.useSsl ? "https" : "http", host: "dev.virtualearth.net", diff --git a/src/provider/ChainProvider.ts b/src/provider/ChainProvider.ts index 4165743..43b8dae 100644 --- a/src/provider/ChainProvider.ts +++ b/src/provider/ChainProvider.ts @@ -1,4 +1,8 @@ -import { ExternalLoaderParams } from "ExternalLoader"; +import { + ExternalLoaderBody, + ExternalLoaderHeaders, + ExternalLoaderParams, +} from "ExternalLoader"; import Geocoded from "Geocoded"; import { ErrorCallback, @@ -281,7 +285,13 @@ export default class ChainProvider implements ProviderInterface { // eslint-disable-next-line @typescript-eslint/no-unused-vars params: ExternalLoaderParams, // eslint-disable-next-line @typescript-eslint/no-unused-vars - callback: ChainGeocodedResultsCallback + callback: ChainGeocodedResultsCallback, + // eslint-disable-next-line @typescript-eslint/no-unused-vars + headers?: ExternalLoaderHeaders, + // eslint-disable-next-line @typescript-eslint/no-unused-vars + body?: ExternalLoaderBody, + // eslint-disable-next-line @typescript-eslint/no-unused-vars + errorCallback?: ErrorCallback ): void { throw new Error( "executeRequest cannot be called directly from the chain provider." diff --git a/src/provider/MapquestProvider.ts b/src/provider/MapquestProvider.ts index 0cd5043..99b8975 100644 --- a/src/provider/MapquestProvider.ts +++ b/src/provider/MapquestProvider.ts @@ -83,6 +83,12 @@ export default class MapQuestProvider implements ProviderInterface { ): void { const geocodeQuery = ProviderHelpers.getGeocodeQueryFromParameter(query); + if (geocodeQuery.getIp()) { + throw new Error( + "The MapQuest provider does not support IP geolocation, only location geocoding." + ); + } + this.externalLoader.setOptions({ protocol: this.options.useSsl ? "https" : "http", host: "www.mapquestapi.com", @@ -91,7 +97,7 @@ export default class MapQuestProvider implements ProviderInterface { const params: MapQuestRequestParams = { key: this.options.apiKey, - location: geocodeQuery.getText(), + location: geocodeQuery.getText() || "", jsonpCallback: this.options.useJsonp ? "callback" : undefined, }; diff --git a/src/provider/ProviderHelpers.ts b/src/provider/ProviderHelpers.ts index a96c881..e1d57de 100644 --- a/src/provider/ProviderHelpers.ts +++ b/src/provider/ProviderHelpers.ts @@ -6,6 +6,7 @@ import { ReverseQuery, ReverseQueryObject, } from "query"; +import { isIpv4, isIpv6 } from "utils"; export default class ProviderHelpers { public static getGeocodeQueryFromParameter( @@ -13,6 +14,9 @@ export default class ProviderHelpers { geocodeQuery = GeocodeQuery ): GeocodeQuery { if (typeof query === "string") { + if (isIpv4(query) || isIpv6(query)) { + return geocodeQuery.create({ ip: query }); + } return geocodeQuery.create({ text: query }); } if (!(query instanceof geocodeQuery)) { diff --git a/src/provider/YandexProvider.ts b/src/provider/YandexProvider.ts index 12a9ab4..40f42bb 100644 --- a/src/provider/YandexProvider.ts +++ b/src/provider/YandexProvider.ts @@ -114,6 +114,12 @@ export default class YandexProvider implements ProviderInterface { ): void { const geocodeQuery = ProviderHelpers.getGeocodeQueryFromParameter(query); + if (geocodeQuery.getIp()) { + throw new Error( + "The Yandex provider does not support IP geolocation, only location geocoding." + ); + } + this.externalLoader.setOptions({ protocol: this.options.useSsl ? "https" : "http", host: "geocode-maps.yandex.ru", @@ -122,7 +128,7 @@ export default class YandexProvider implements ProviderInterface { const params: YandexRequestParams = { apikey: this.options.apiKey, - geocode: geocodeQuery.getText(), + geocode: geocodeQuery.getText() || "", format: "json", lang: geocodeQuery.getLocale(), jsonpCallback: this.options.useJsonp ? "callback" : undefined, diff --git a/src/provider/geoplugin/GeoPluginGeocoded.ts b/src/provider/geoplugin/GeoPluginGeocoded.ts new file mode 100644 index 0000000..103fa9f --- /dev/null +++ b/src/provider/geoplugin/GeoPluginGeocoded.ts @@ -0,0 +1,39 @@ +import Geocoded, { GeocodedObject } from "Geocoded"; + +export interface GeoPluginGeocodedObject extends GeocodedObject { + readonly attribution?: string; +} + +export default class GeoPluginGeocoded extends Geocoded { + private readonly attribution?: string; + + protected constructor({ + attribution, + ...geocodedObject + }: GeoPluginGeocodedObject) { + super(geocodedObject); + this.attribution = attribution; + } + + public static create(object: GeoPluginGeocodedObject): GeoPluginGeocoded { + return new this(object); + } + + public toObject(): GeoPluginGeocodedObject { + return { + ...super.toObject(), + attribution: this.attribution, + }; + } + + public withAttribution(attribution: string): GeoPluginGeocoded { + return new GeoPluginGeocoded({ + ...this.toObject(), + attribution, + }); + } + + public getAttribution(): undefined | string { + return this.attribution; + } +} diff --git a/src/provider/geoplugin/GeoPluginProvider.ts b/src/provider/geoplugin/GeoPluginProvider.ts new file mode 100644 index 0000000..b91bcc0 --- /dev/null +++ b/src/provider/geoplugin/GeoPluginProvider.ts @@ -0,0 +1,215 @@ +import { + ExternalLoaderBody, + ExternalLoaderHeaders, + ExternalLoaderInterface, + ExternalLoaderParams, +} from "ExternalLoader"; +import { + ErrorCallback, + GeocodedResultsCallback, + GeoPluginGeocoded, + ProviderHelpers, + ProviderInterface, + ProviderOptionsInterface, + defaultProviderOptions, +} from "provider"; +import { + GeocodeQuery, + GeocodeQueryObject, + ReverseQuery, + ReverseQueryObject, +} from "query"; +import { ResponseError } from "error"; +import AdminLevel from "AdminLevel"; + +interface GeoPluginRequestParams { + [param: string]: string | undefined; + readonly ip: string; +} + +export interface GeoPluginResult { + // eslint-disable-next-line camelcase + geoplugin_request: string; + // eslint-disable-next-line camelcase + geoplugin_status: number; + // eslint-disable-next-line camelcase + geoplugin_delay: string; + // eslint-disable-next-line camelcase + geoplugin_credit: string; + // eslint-disable-next-line camelcase + geoplugin_city: string; + // eslint-disable-next-line camelcase + geoplugin_region: string; + // eslint-disable-next-line camelcase + geoplugin_regionCode: string; + // eslint-disable-next-line camelcase + geoplugin_regionName: string; + // eslint-disable-next-line camelcase + geoplugin_areaCode: string; + // eslint-disable-next-line camelcase + geoplugin_dmaCode: string; + // eslint-disable-next-line camelcase + geoplugin_countryCode: string; + // eslint-disable-next-line camelcase + geoplugin_countryName: string; + // eslint-disable-next-line camelcase + geoplugin_inEU: boolean; + // eslint-disable-next-line camelcase + geoplugin_euVATrate: number; + // eslint-disable-next-line camelcase + geoplugin_continentCode: string; + // eslint-disable-next-line camelcase + geoplugin_continentName: string; + // eslint-disable-next-line camelcase + geoplugin_latitude: string; + // eslint-disable-next-line camelcase + geoplugin_longitude: string; + // eslint-disable-next-line camelcase + geoplugin_locationAccuracyRadius: string; + // eslint-disable-next-line camelcase + geoplugin_timezone: string; + // eslint-disable-next-line camelcase + geoplugin_currencyCode: string; + // eslint-disable-next-line camelcase + geoplugin_currencySymbol: string; + // eslint-disable-next-line camelcase + geoplugin_currencySymbol_UTF8: string; + // eslint-disable-next-line camelcase + geoplugin_currencyConverter: string; +} + +type GeoPluginGeocodedResultsCallback = GeocodedResultsCallback< + GeoPluginGeocoded +>; + +export default class GeoPluginProvider + implements ProviderInterface { + private externalLoader: ExternalLoaderInterface; + + private options: ProviderOptionsInterface; + + public constructor( + _externalLoader: ExternalLoaderInterface, + options: ProviderOptionsInterface = defaultProviderOptions + ) { + this.externalLoader = _externalLoader; + this.options = { ...defaultProviderOptions, ...options }; + } + + public geocode( + query: string | GeocodeQuery | GeocodeQueryObject, + callback: GeoPluginGeocodedResultsCallback, + errorCallback?: ErrorCallback + ): void { + const geocodeQuery = ProviderHelpers.getGeocodeQueryFromParameter(query); + + if (geocodeQuery.getText()) { + throw new Error( + "The GeoPlugin provider does not support location geocoding, only IP geolocation." + ); + } + + if (["127.0.0.1", "::1"].includes(geocodeQuery.getIp() || "")) { + callback([ + GeoPluginGeocoded.create({ + locality: "localhost", + country: "localhost", + }), + ]); + return; + } + + this.externalLoader.setOptions({ + protocol: this.options.useSsl ? "https" : "http", + host: "www.geoplugin.net", + pathname: "json.gp", + }); + + const params: GeoPluginRequestParams = { + ip: geocodeQuery.getIp() || "", + }; + + this.executeRequest(params, callback, {}, {}, errorCallback); + } + + // eslint-disable-next-line class-methods-use-this + public geodecode( + // eslint-disable-next-line @typescript-eslint/no-unused-vars + latitudeOrQuery: number | string | ReverseQuery | ReverseQueryObject, + // eslint-disable-next-line @typescript-eslint/no-unused-vars + longitudeOrCallback: number | string | GeoPluginGeocodedResultsCallback, + // eslint-disable-next-line @typescript-eslint/no-unused-vars + callbackOrErrorCallback?: GeoPluginGeocodedResultsCallback | ErrorCallback, + // eslint-disable-next-line @typescript-eslint/no-unused-vars + errorCallback?: ErrorCallback + ): void { + throw new Error( + "The GeoPlugin provider does not support reverse geocoding." + ); + } + + public executeRequest( + params: ExternalLoaderParams, + callback: GeoPluginGeocodedResultsCallback, + headers?: ExternalLoaderHeaders, + body?: ExternalLoaderBody, + errorCallback?: ErrorCallback + ): void { + this.externalLoader.executeRequest( + params, + (data: GeoPluginResult) => { + if (![200, 206].includes(data.geoplugin_status)) { + const errorMessage = `An error has occurred. Status: ${data.geoplugin_status}.`; + if (errorCallback) { + errorCallback(new ResponseError(errorMessage, data)); + return; + } + setTimeout(() => { + throw new Error(errorMessage); + }); + return; + } + callback([GeoPluginProvider.mapToGeocoded(data)]); + }, + headers, + body, + errorCallback + ); + } + + public static mapToGeocoded(result: GeoPluginResult): GeoPluginGeocoded { + const latitude = parseFloat(result.geoplugin_latitude); + const longitude = parseFloat(result.geoplugin_longitude); + const locality = result.geoplugin_city || undefined; + const region = result.geoplugin_region || undefined; + const country = result.geoplugin_countryName || undefined; + const countryCode = result.geoplugin_countryCode || undefined; + const timezone = result.geoplugin_timezone || undefined; + const adminLevels: AdminLevel[] = []; + const attribution = result.geoplugin_credit || undefined; + + if (result.geoplugin_regionName) { + adminLevels.push( + AdminLevel.create({ + level: 1, + name: result.geoplugin_regionName, + code: result.geoplugin_regionCode || undefined, + }) + ); + } + + const geocoded = GeoPluginGeocoded.create({ + latitude, + longitude, + locality, + region, + adminLevels, + country, + countryCode, + timezone, + attribution, + }); + + return geocoded; + } +} diff --git a/src/provider/geoplugin/index.ts b/src/provider/geoplugin/index.ts new file mode 100644 index 0000000..1144901 --- /dev/null +++ b/src/provider/geoplugin/index.ts @@ -0,0 +1,3 @@ +export { default as GeoPluginGeocoded } from "provider/geoplugin/GeoPluginGeocoded"; +export { default as GeoPluginProvider } from "provider/geoplugin/GeoPluginProvider"; +export * from "provider/geoplugin/GeoPluginProvider"; diff --git a/src/provider/googlemaps/GoogleMapsProvider.ts b/src/provider/googlemaps/GoogleMapsProvider.ts index 11373ba..5f2e3a1 100644 --- a/src/provider/googlemaps/GoogleMapsProvider.ts +++ b/src/provider/googlemaps/GoogleMapsProvider.ts @@ -217,6 +217,12 @@ export default class GoogleMapsProvider GoogleMapsGeocodeQuery ); + if (geocodeQuery.getIp()) { + throw new Error( + "The GoogleMaps provider does not support IP geolocation, only location geocoding." + ); + } + this.externalLoader.setOptions({ protocol: this.options.useSsl ? "https" : "http", host: "maps.googleapis.com", diff --git a/src/provider/index.ts b/src/provider/index.ts index 552f0c9..8311be4 100644 --- a/src/provider/index.ts +++ b/src/provider/index.ts @@ -5,6 +5,7 @@ export { default as BingProvider } from "provider/BingProvider"; export * from "provider/BingProvider"; export { default as ChainProvider } from "provider/ChainProvider"; export * from "provider/ChainProvider"; +export * from "provider/geoplugin"; export * from "provider/googlemaps"; export * from "provider/mapbox"; export { default as MapquestProvider } from "provider/MapquestProvider"; diff --git a/src/provider/mapbox/MapboxProvider.ts b/src/provider/mapbox/MapboxProvider.ts index 6a9b679..fb158a5 100644 --- a/src/provider/mapbox/MapboxProvider.ts +++ b/src/provider/mapbox/MapboxProvider.ts @@ -148,6 +148,12 @@ export default class MapboxProvider MapboxGeocodeQuery ); + if (geocodeQuery.getIp()) { + throw new Error( + "The Mapbox provider does not support IP geolocation, only location geocoding." + ); + } + this.externalLoader.setOptions({ protocol: this.options.useSsl ? "https" : "http", host: "api.mapbox.com", diff --git a/src/provider/nominatim/NominatimProvider.ts b/src/provider/nominatim/NominatimProvider.ts index 172a714..8734a55 100644 --- a/src/provider/nominatim/NominatimProvider.ts +++ b/src/provider/nominatim/NominatimProvider.ts @@ -135,6 +135,12 @@ export default class NominatimProvider NominatimGeocodeQuery ); + if (geocodeQuery.getIp()) { + throw new Error( + "The OpenStreetMap / Nominatim provider does not support IP geolocation, only location geocoding." + ); + } + this.externalLoader.setOptions({ protocol: this.options.useSsl ? "https" : "http", host: this.options.host, diff --git a/src/provider/opencage/OpenCageProvider.ts b/src/provider/opencage/OpenCageProvider.ts index 82b91a9..3867bed 100644 --- a/src/provider/opencage/OpenCageProvider.ts +++ b/src/provider/opencage/OpenCageProvider.ts @@ -311,6 +311,12 @@ export default class OpenCageProvider OpenCageGeocodeQuery ); + if (geocodeQuery.getIp()) { + throw new Error( + "The OpenCage provider does not support IP geolocation, only location geocoding." + ); + } + this.externalLoader.setOptions({ protocol: this.options.useSsl ? "https" : "http", host: "api.opencagedata.com", @@ -319,7 +325,7 @@ export default class OpenCageProvider const params: OpenCageRequestParams = this.withCommonParams( { - q: geocodeQuery.getText(), + q: geocodeQuery.getText() || "", bounds: geocodeQuery.getBounds() ? `${geocodeQuery.getBounds()?.west},${ geocodeQuery.getBounds()?.south diff --git a/src/query/GeocodeQuery.ts b/src/query/GeocodeQuery.ts index 8a090a2..41e63e9 100644 --- a/src/query/GeocodeQuery.ts +++ b/src/query/GeocodeQuery.ts @@ -2,7 +2,8 @@ import { DEFAULT_RESULT_LIMIT } from "provider"; import { Bounds } from "index"; export interface GeocodeQueryObject { - readonly text: string; + readonly text?: string; + readonly ip?: string; readonly south?: number | string; readonly west?: number | string; readonly north?: number | string; @@ -12,7 +13,9 @@ export interface GeocodeQueryObject { } export default class GeocodeQuery { - private readonly text: string; + private readonly text?: string; + + private readonly ip?: string; private readonly south?: number | string; @@ -28,6 +31,7 @@ export default class GeocodeQuery { protected constructor({ text, + ip, south, west, north, @@ -36,6 +40,10 @@ export default class GeocodeQuery { limit = DEFAULT_RESULT_LIMIT, }: GeocodeQueryObject) { this.text = text; + this.ip = ip; + if (!text && !ip) { + throw new Error('Either "text" or "ip" parameter is required.'); + } this.south = south; this.west = west; this.north = north; @@ -51,6 +59,7 @@ export default class GeocodeQuery { public toObject(): GeocodeQueryObject { return { text: this.text, + ip: this.ip, south: this.south, west: this.west, north: this.north, @@ -67,6 +76,13 @@ export default class GeocodeQuery { }); } + public withIp(ip: string): GeocodeQuery { + return (this.constructor).create({ + ...this.toObject(), + ip, + }); + } + public withBounds( south?: number, west?: number, @@ -96,10 +112,14 @@ export default class GeocodeQuery { }); } - public getText(): string { + public getText(): undefined | string { return this.text; } + public getIp(): undefined | string { + return this.ip; + } + public getBounds(): undefined | Bounds { if (!this.south || !this.west || !this.north || !this.east) { return undefined; diff --git a/src/utils.ts b/src/utils.ts index c3f5073..ca6cf2d 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -32,6 +32,18 @@ export const decodeBase64 = (base64: string): string => { return Buffer.from(base64, "base64").toString(); }; +// From https://github.com/sindresorhus/ip-regex +const ipv4RegExp = + "(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}"; +export const isIpv4 = (ip: string): boolean => + new RegExp(`^${ipv4RegExp}$`).test(ip); + +// From https://github.com/sindresorhus/ip-regex +const ipv6Seg = "[a-fA-F\\d]{1,4}"; +const ipv6RegExp = `((?:${ipv6Seg}:){7}(?:${ipv6Seg}|:)|(?:${ipv6Seg}:){6}(?:${ipv4RegExp}|:${ipv6Seg}|:)|(?:${ipv6Seg}:){5}(?::${ipv4RegExp}|(:${ipv6Seg}){1,2}|:)|(?:${ipv6Seg}:){4}(?:(:${ipv6Seg}){0,1}:${ipv4RegExp}|(:${ipv6Seg}){1,3}|:)|(?:${ipv6Seg}:){3}(?:(:${ipv6Seg}){0,2}:${ipv4RegExp}|(:${ipv6Seg}){1,4}|:)|(?:${ipv6Seg}:){2}(?:(:${ipv6Seg}){0,3}:${ipv4RegExp}|(:${ipv6Seg}){1,5}|:)|(?:${ipv6Seg}:){1}(?:(:${ipv6Seg}){0,4}:${ipv4RegExp}|(:${ipv6Seg}){1,6}|:)|(?::((?::${ipv6Seg}){0,5}:${ipv4RegExp}|(?::${ipv6Seg}){1,7}|:)))(%[0-9a-zA-Z]{1,})?`; +export const isIpv6 = (ip: string): boolean => + new RegExp(`^${ipv6RegExp}$`).test(ip); + // eslint-disable-next-line @typescript-eslint/ban-types export const getRequireFunc = (): Function => // eslint-disable-next-line camelcase From 7c99559c9233b01349c8a191a02e6721566f9745 Mon Sep 17 00:00:00 2001 From: Alan Poulain Date: Sat, 15 Aug 2020 17:43:41 +0200 Subject: [PATCH 35/56] 0.5.0 --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 6d98985..335fdbb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "universal-geocoder", - "version": "0.4.2", + "version": "0.5.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 8cebcce..50a9cc9 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "universal-geocoder", "description": "Universal geocoding abstraction with multiple built-in providers", - "version": "0.4.2", + "version": "0.5.0", "keywords": [ "geocoder", "geocoding", From 38365aea9618d217c3193b678230460299d46404 Mon Sep 17 00:00:00 2001 From: Alan Poulain Date: Sat, 15 Aug 2020 17:46:56 +0200 Subject: [PATCH 36/56] Remove build step from release workflow --- .github/workflows/release.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index af13d19..1b507e7 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -21,8 +21,6 @@ jobs: run: npm install - name: Run tests run: npm test - - name: Build - run: npm run build - name: Create a GitHub release uses: actions/create-release@v1 env: From a387ad05b0ca8fb11000e6342968135c3f8dab02 Mon Sep 17 00:00:00 2001 From: Alan Poulain Date: Fri, 21 Aug 2020 00:07:48 +0200 Subject: [PATCH 37/56] chore: add hooks for files and commits lint --- .commitlintrc.json | 3 + package-lock.json | 2253 ++++++++++++++++++++++++++++++++------------ package.json | 16 + 3 files changed, 1680 insertions(+), 592 deletions(-) create mode 100644 .commitlintrc.json diff --git a/.commitlintrc.json b/.commitlintrc.json new file mode 100644 index 0000000..c30e5a9 --- /dev/null +++ b/.commitlintrc.json @@ -0,0 +1,3 @@ +{ + "extends": ["@commitlint/config-conventional"] +} diff --git a/package-lock.json b/package-lock.json index 335fdbb..6cf4eef 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,16 +14,16 @@ } }, "@babel/core": { - "version": "7.11.1", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.11.1.tgz", - "integrity": "sha512-XqF7F6FWQdKGGWAzGELL+aCO1p+lRY5Tj5/tbT3St1G8NaH70jhhDIKknIZaDans0OQBG5wRAldROLHSt44BgQ==", + "version": "7.11.4", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.11.4.tgz", + "integrity": "sha512-5deljj5HlqRXN+5oJTY7Zs37iH3z3b++KjiKtIsJy1NrjOOVSEaJHEetLBhyu0aQOSNNZ/0IuEAan9GzRuDXHg==", "dev": true, "requires": { "@babel/code-frame": "^7.10.4", - "@babel/generator": "^7.11.0", + "@babel/generator": "^7.11.4", "@babel/helper-module-transforms": "^7.11.0", "@babel/helpers": "^7.10.4", - "@babel/parser": "^7.11.1", + "@babel/parser": "^7.11.4", "@babel/template": "^7.10.4", "@babel/traverse": "^7.11.0", "@babel/types": "^7.11.0", @@ -55,9 +55,9 @@ } }, "@babel/generator": { - "version": "7.11.0", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.11.0.tgz", - "integrity": "sha512-fEm3Uzw7Mc9Xi//qU20cBKatTfs2aOtKqmvy/Vm7RkJEGFQ4xc9myCfbXxqK//ZS8MR/ciOHw6meGASJuKmDfQ==", + "version": "7.11.4", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.11.4.tgz", + "integrity": "sha512-Rn26vueFx0eOoz7iifCN2UHT6rGtnkSGWSoDRIy8jZN3B91PzeSULbswfLoOWuTuAcNwpG/mxy+uCTDnZ9Mp1g==", "dev": true, "requires": { "@babel/types": "^7.11.0", @@ -186,6 +186,15 @@ "js-tokens": "^4.0.0" }, "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, "chalk": { "version": "2.4.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", @@ -196,15 +205,54 @@ "escape-string-regexp": "^1.0.5", "supports-color": "^5.3.0" } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "dev": true + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } } } }, "@babel/parser": { - "version": "7.11.3", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.11.3.tgz", - "integrity": "sha512-REo8xv7+sDxkKvoxEywIdsNFiZLybwdI7hcT5uEPyQrSMB4YQ973BfC9OOrD/81MaIjh6UxdulIQXkjmiH3PcA==", + "version": "7.11.4", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.11.4.tgz", + "integrity": "sha512-MggwidiH+E9j5Sh8pbrX5sJvMcsqS5o+7iB42M9/k0CD63MjYbdP4nhSh7uB5wnv2/RVzTZFTxzF/kIa5mrCqA==", "dev": true }, + "@babel/runtime": { + "version": "7.11.2", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.11.2.tgz", + "integrity": "sha512-TeWkU52so0mPtDcaCTxNBI/IHiz0pZgr8VEFqXFtZWpYD08ZB6FaSwVAS8MKRQAP3bYKiVjwysOJgMFY28o6Tw==", + "dev": true, + "requires": { + "regenerator-runtime": "^0.13.4" + } + }, "@babel/template": { "version": "7.10.4", "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.10.4.tgz", @@ -252,76 +300,222 @@ "to-fast-properties": "^2.0.0" } }, - "@istanbuljs/load-nyc-config": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz", - "integrity": "sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ==", + "@commitlint/cli": { + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/@commitlint/cli/-/cli-10.0.0.tgz", + "integrity": "sha512-a+dLjNovvMyom0GNcKj9ebmgtbJEKuhJuqwPUmfNy3yPoM4h12b3hjVOS33IyvpbKmlYUJg8dgcr4S5FhFvhFg==", "dev": true, "requires": { - "camelcase": "^5.3.1", - "find-up": "^4.1.0", - "get-package-type": "^0.1.0", - "js-yaml": "^3.13.1", + "@babel/runtime": "^7.9.6", + "@commitlint/format": "^10.0.0", + "@commitlint/lint": "^10.0.0", + "@commitlint/load": "^10.0.0", + "@commitlint/read": "^10.0.0", + "chalk": "4.1.0", + "core-js": "^3.6.1", + "get-stdin": "8.0.0", + "lodash": "^4.17.19", + "resolve-from": "5.0.0", + "resolve-global": "1.0.0", + "yargs": "^15.1.0" + } + }, + "@commitlint/config-conventional": { + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/@commitlint/config-conventional/-/config-conventional-10.0.0.tgz", + "integrity": "sha512-M9l7hh2a1GB9nQ/Gm+aDLGPmzGdpgxqJoSmrbTxDlapJDyaL7FPe5aQf66F50Eq3j0bmaRaJihFCA6mIUBQAag==", + "dev": true, + "requires": { + "conventional-changelog-conventionalcommits": "^4.3.1" + } + }, + "@commitlint/ensure": { + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/@commitlint/ensure/-/ensure-10.0.0.tgz", + "integrity": "sha512-OBlv6Hw91u4Gqz4ocKO7IyIvQ6ZmKbJaLFf8MD0EOH3Prn0aatiiqUB0+paBELKt3yWdwQNYI8ZkzZWtj4EcYw==", + "dev": true, + "requires": { + "@commitlint/types": "^10.0.0", + "lodash": "^4.17.19" + } + }, + "@commitlint/execute-rule": { + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/@commitlint/execute-rule/-/execute-rule-10.0.0.tgz", + "integrity": "sha512-vRIp6Cwy+C1dOh5VAcoBks+8UI+rpxOB5cwhU/RQZhlVd2hgFiAPXnyKWMOB7HDO9XFI5amLJehvaaDI+eLDnA==", + "dev": true + }, + "@commitlint/format": { + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/@commitlint/format/-/format-10.0.0.tgz", + "integrity": "sha512-EpCmMCcjloeaoUtgmzlpYmIYJzAvZhYfLJ7YCrOlnmt5/MAeywuNgxcr/EM2xHgEKotTWqRQdiIgAtkIWHhgrQ==", + "dev": true, + "requires": { + "@commitlint/types": "^10.0.0", + "chalk": "^4.0.0" + } + }, + "@commitlint/is-ignored": { + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/@commitlint/is-ignored/-/is-ignored-10.0.0.tgz", + "integrity": "sha512-OLjUs/0HaQGh5iSqv/jF/TXqQ8sJ5VShujTmADSvnGTyruZu+d1Hfgw9QM1FMjzcx2NpMDsX/EFBU0ZMx9hmEg==", + "dev": true, + "requires": { + "@commitlint/types": "^10.0.0", + "semver": "7.3.2" + } + }, + "@commitlint/lint": { + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/@commitlint/lint/-/lint-10.0.0.tgz", + "integrity": "sha512-KcDzOMQYVLziWIXNedTDnf5LS9NMYKzcdzjuCH8jTZLx/oX3kuOVB0jYZHVaKPwjj0miZSOhONqIMJDlLZpn+g==", + "dev": true, + "requires": { + "@commitlint/is-ignored": "^10.0.0", + "@commitlint/parse": "^10.0.0", + "@commitlint/rules": "^10.0.0", + "@commitlint/types": "^10.0.0" + } + }, + "@commitlint/load": { + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/@commitlint/load/-/load-10.0.0.tgz", + "integrity": "sha512-pUwGshEpxkU2R9U3O5hwHU4VT0zkyIs5gzGrGbR2c/aurI9qe00LZ9DquYVVYVmfwG6UaQpatCG4TrXNXIj5Mg==", + "dev": true, + "requires": { + "@commitlint/execute-rule": "^10.0.0", + "@commitlint/resolve-extends": "^10.0.0", + "@commitlint/types": "^10.0.0", + "chalk": "4.1.0", + "cosmiconfig": "^7.0.0", + "lodash": "^4.17.19", "resolve-from": "^5.0.0" + } + }, + "@commitlint/message": { + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/@commitlint/message/-/message-10.0.0.tgz", + "integrity": "sha512-2ZDgHc6v3t1C/zkAkRwPDIRVD/jbrQAu+Iqe7VH1/Y//cJhwte6OuSGfs2Qze/6gh+/RbvUIBskR8OUIY6VTrA==", + "dev": true + }, + "@commitlint/parse": { + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/@commitlint/parse/-/parse-10.0.0.tgz", + "integrity": "sha512-xIBD0w85FVhrlX4pI/m4xF9MvTQNMbvilPSr42yIds2xn7GJcJidN4Z8O6qCqcjwl6f3ruQ8G8Pdi3PggVjZrw==", + "dev": true, + "requires": { + "conventional-changelog-angular": "^5.0.0", + "conventional-commits-parser": "^3.0.0" + } + }, + "@commitlint/read": { + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/@commitlint/read/-/read-10.0.0.tgz", + "integrity": "sha512-ARebcoJMDNtlCTV9jpSacN9gCvua+JiGQLQlq4PsaNo/e4hyyIWu+wOEAXO8IhD5xycoTBaJRVWzgXRncEyrkg==", + "dev": true, + "requires": { + "@commitlint/top-level": "^10.0.0", + "fs-extra": "^9.0.0", + "git-raw-commits": "^2.0.0" + } + }, + "@commitlint/resolve-extends": { + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/@commitlint/resolve-extends/-/resolve-extends-10.0.0.tgz", + "integrity": "sha512-ltj4LvdCEJeYzWdzFS9AhLMkc4rweKvfju/JYBgbLqFx7lAGz3e2Wub0uuuWuLBJqCjL7UJbYiA0T2Hzhhd91Q==", + "dev": true, + "requires": { + "import-fresh": "^3.0.0", + "lodash": "^4.17.19", + "resolve-from": "^5.0.0", + "resolve-global": "^1.0.0" + } + }, + "@commitlint/rules": { + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/@commitlint/rules/-/rules-10.0.0.tgz", + "integrity": "sha512-myHG8pgUHIOtceJsALRRXvYBuLbTwWl7/6soDrIJudDhKsyhV3yFtAbRX40pujg25IlAUra6nuy8JDU86bVxog==", + "dev": true, + "requires": { + "@commitlint/ensure": "^10.0.0", + "@commitlint/message": "^10.0.0", + "@commitlint/to-lines": "^10.0.0", + "@commitlint/types": "^10.0.0" + } + }, + "@commitlint/to-lines": { + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/@commitlint/to-lines/-/to-lines-10.0.0.tgz", + "integrity": "sha512-qUHuYiLgE7ioBRgHUR2EOwXuEhb2TnAktEc9NBZcQNzfqu5nbOaf2iOBx5mlDK0heTJyTjLboAmzojXxuqJNcA==", + "dev": true + }, + "@commitlint/top-level": { + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/@commitlint/top-level/-/top-level-10.0.0.tgz", + "integrity": "sha512-FHlDD31gTQptInSuRGQt/9fNiSQ4euBZtcBZD4NImCtQCkwBP1cyxClN6wr9DmqISG0KSJybReF4z8rm5znNDA==", + "dev": true, + "requires": { + "find-up": "^5.0.0" }, "dependencies": { "find-up": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", - "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", "dev": true, "requires": { - "locate-path": "^5.0.0", + "locate-path": "^6.0.0", "path-exists": "^4.0.0" } }, "locate-path": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", - "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", "dev": true, "requires": { - "p-locate": "^4.1.0" + "p-locate": "^5.0.0" } }, "p-limit": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", - "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.0.2.tgz", + "integrity": "sha512-iwqZSOoWIW+Ew4kAGUlN16J4M7OB3ysMLSZtnhmqx7njIHFPlxWBX8xo3lVTyFVq6mI/lL9qt2IsN1sHwaxJkg==", "dev": true, "requires": { "p-try": "^2.0.0" } }, "p-locate": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", - "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", "dev": true, "requires": { - "p-limit": "^2.2.0" + "p-limit": "^3.0.2" } - }, - "p-try": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", - "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", - "dev": true - }, - "path-exists": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", - "dev": true - }, - "resolve-from": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", - "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", - "dev": true } } }, + "@commitlint/types": { + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/@commitlint/types/-/types-10.0.0.tgz", + "integrity": "sha512-b7uumSfDI1guYnNc11BpkTZjiY7gC1DPedeUa0r+csd/1DiFyRo4oNOaxXHve0cC4NzaHaOHa0aPktWMTYJlVQ==", + "dev": true + }, + "@istanbuljs/load-nyc-config": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz", + "integrity": "sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ==", + "dev": true, + "requires": { + "camelcase": "^5.3.1", + "find-up": "^4.1.0", + "get-package-type": "^0.1.0", + "js-yaml": "^3.13.1", + "resolve-from": "^5.0.0" + } + }, "@istanbuljs/schema": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.2.tgz", @@ -395,6 +589,34 @@ "http-graceful-shutdown": "^2.3.1", "morgan": "^1.9.1", "nocache": "^2.1.0" + }, + "dependencies": { + "fs-extra": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", + "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", + "dev": true, + "requires": { + "graceful-fs": "^4.2.0", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + } + }, + "jsonfile": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", + "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.6" + } + }, + "universalify": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", + "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", + "dev": true + } } }, "@pollyjs/persister": { @@ -467,10 +689,28 @@ "integrity": "sha1-7ihweulOEdK4J7y+UnC86n8+ce4=", "dev": true }, + "@types/minimist": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@types/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-aaI6OtKcrwCX8G7aWbNh7i8GOfY=", + "dev": true + }, "@types/node": { - "version": "14.0.27", - "resolved": "https://registry.npmjs.org/@types/node/-/node-14.0.27.tgz", - "integrity": "sha512-kVrqXhbclHNHGu9ztnAwSncIgJv/FaxmzXJvGXNdcCpV1b8u1/Mi6z6m0vwy0LzKeXFTPLH0NzwmoJ3fNCIq0g==", + "version": "14.6.0", + "resolved": "https://registry.npmjs.org/@types/node/-/node-14.6.0.tgz", + "integrity": "sha512-mikldZQitV94akrc4sCcSjtJfsTKt4p+e/s0AGscVA6XArQ9kFclP+ZiYUMnq987rc6QlYxXv/EivqlfSLxpKA==", + "dev": true + }, + "@types/normalize-package-data": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.0.tgz", + "integrity": "sha512-f5j5b/Gf71L+dbqxIpQ4Z2WlmI/mPJ0fOkGGmFgtb6sAu97EPczzbS3/tJKxmcYDj55OX6ssqwDAWOHIYDRDGA==", + "dev": true + }, + "@types/parse-json": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@types/parse-json/-/parse-json-4.0.0.tgz", + "integrity": "sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA==", "dev": true }, "@types/pollyjs__adapter": { @@ -538,12 +778,12 @@ "dev": true }, "@typescript-eslint/eslint-plugin": { - "version": "3.9.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-3.9.0.tgz", - "integrity": "sha512-UD6b4p0/hSe1xdTvRCENSx7iQ+KR6ourlZFfYuPC7FlXEzdHuLPrEmuxZ23b2zW96KJX9Z3w05GE/wNOiEzrVg==", + "version": "3.9.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-3.9.1.tgz", + "integrity": "sha512-XIr+Mfv7i4paEdBf0JFdIl9/tVxyj+rlilWIfZ97Be0lZ7hPvUbS5iHt9Glc8kRI53dsr0PcAEudbf8rO2wGgg==", "dev": true, "requires": { - "@typescript-eslint/experimental-utils": "3.9.0", + "@typescript-eslint/experimental-utils": "3.9.1", "debug": "^4.1.1", "functional-red-black-tree": "^1.0.1", "regexpp": "^3.0.0", @@ -552,45 +792,45 @@ } }, "@typescript-eslint/experimental-utils": { - "version": "3.9.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-3.9.0.tgz", - "integrity": "sha512-/vSHUDYizSOhrOJdjYxPNGfb4a3ibO8zd4nUKo/QBFOmxosT3cVUV7KIg8Dwi6TXlr667G7YPqFK9+VSZOorNA==", + "version": "3.9.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-3.9.1.tgz", + "integrity": "sha512-lkiZ8iBBaYoyEKhCkkw4SAeatXyBq9Ece5bZXdLe1LWBUwTszGbmbiqmQbwWA8cSYDnjWXp9eDbXpf9Sn0hLAg==", "dev": true, "requires": { "@types/json-schema": "^7.0.3", - "@typescript-eslint/types": "3.9.0", - "@typescript-eslint/typescript-estree": "3.9.0", + "@typescript-eslint/types": "3.9.1", + "@typescript-eslint/typescript-estree": "3.9.1", "eslint-scope": "^5.0.0", "eslint-utils": "^2.0.0" } }, "@typescript-eslint/parser": { - "version": "3.9.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-3.9.0.tgz", - "integrity": "sha512-rDHOKb6uW2jZkHQniUQVZkixQrfsZGUCNWWbKWep4A5hGhN5dLHMUCNAWnC4tXRlHedXkTDptIpxs6e4Pz8UfA==", + "version": "3.9.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-3.9.1.tgz", + "integrity": "sha512-y5QvPFUn4Vl4qM40lI+pNWhTcOWtpZAJ8pOEQ21fTTW4xTJkRplMjMRje7LYTXqVKKX9GJhcyweMz2+W1J5bMg==", "dev": true, "requires": { "@types/eslint-visitor-keys": "^1.0.0", - "@typescript-eslint/experimental-utils": "3.9.0", - "@typescript-eslint/types": "3.9.0", - "@typescript-eslint/typescript-estree": "3.9.0", + "@typescript-eslint/experimental-utils": "3.9.1", + "@typescript-eslint/types": "3.9.1", + "@typescript-eslint/typescript-estree": "3.9.1", "eslint-visitor-keys": "^1.1.0" } }, "@typescript-eslint/types": { - "version": "3.9.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-3.9.0.tgz", - "integrity": "sha512-rb6LDr+dk9RVVXO/NJE8dT1pGlso3voNdEIN8ugm4CWM5w5GimbThCMiMl4da1t5u3YwPWEwOnKAULCZgBtBHg==", + "version": "3.9.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-3.9.1.tgz", + "integrity": "sha512-15JcTlNQE1BsYy5NBhctnEhEoctjXOjOK+Q+rk8ugC+WXU9rAcS2BYhoh6X4rOaXJEpIYDl+p7ix+A5U0BqPTw==", "dev": true }, "@typescript-eslint/typescript-estree": { - "version": "3.9.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-3.9.0.tgz", - "integrity": "sha512-N+158NKgN4rOmWVfvKOMoMFV5n8XxAliaKkArm/sOypzQ0bUL8MSnOEBW3VFIeffb/K5ce/cAV0yYhR7U4ALAA==", + "version": "3.9.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-3.9.1.tgz", + "integrity": "sha512-IqM0gfGxOmIKPhiHW/iyAEXwSVqMmR2wJ9uXHNdFpqVvPaQ3dWg302vW127sBpAiqM9SfHhyS40NKLsoMpN2KA==", "dev": true, "requires": { - "@typescript-eslint/types": "3.9.0", - "@typescript-eslint/visitor-keys": "3.9.0", + "@typescript-eslint/types": "3.9.1", + "@typescript-eslint/visitor-keys": "3.9.1", "debug": "^4.1.1", "glob": "^7.1.6", "is-glob": "^4.0.1", @@ -600,9 +840,9 @@ } }, "@typescript-eslint/visitor-keys": { - "version": "3.9.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-3.9.0.tgz", - "integrity": "sha512-O1qeoGqDbu0EZUC/MZ6F1WHTIzcBVhGqDj3LhTnj65WUA548RXVxUHbYhAW9bZWfb2rnX9QsbbP5nmeJ5Z4+ng==", + "version": "3.9.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-3.9.1.tgz", + "integrity": "sha512-zxdtUjeoSh+prCpogswMwVUJfEFmCOjdzK9rpNjNBfm6EyPt99x3RrJoBOGZO23FCt0WPKUCOL5mb/9D5LjdwQ==", "dev": true, "requires": { "eslint-visitor-keys": "^1.1.0" @@ -813,6 +1053,16 @@ "@zerollup/ts-helpers": "^1.7.18" } }, + "JSONStream": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.5.tgz", + "integrity": "sha512-E+iruNOY8VV9s4JEbe1aNEm6MiszPRr/UfcHMz0TQh1BXSxHK+ASV1R6W4HpjBhSeS+54PIsAMCBmwD06LLsqQ==", + "dev": true, + "requires": { + "jsonparse": "^1.2.0", + "through": ">=2.2.7 <3" + } + }, "accepts": { "version": "1.3.7", "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.7.tgz", @@ -846,9 +1096,9 @@ } }, "ajv": { - "version": "6.12.3", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.3.tgz", - "integrity": "sha512-4K0cK3L1hsqk9xIb2z9vs/XU+PGJZ9PNpJRDS9YLzmNdX6jmVPfamLvTJr0aDAusnHyCHO6MjzlkAsgtqp9teA==", + "version": "6.12.4", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.4.tgz", + "integrity": "sha512-eienB2c9qVQs2KWexhkrdMLVDoIQCz5KSeLxwg9Lzk4DOfBtIK9PQwwufcsn1jjGuf9WZmqPMbGxOzfcuphJCQ==", "dev": true, "requires": { "fast-deep-equal": "^3.1.1", @@ -875,6 +1125,23 @@ "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", "dev": true }, + "ansi-escapes": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.1.tgz", + "integrity": "sha512-JWF7ocqNrp8u9oqpgV+wH5ftbt+cfvv+PTjOvKLT3AdYly/LmORARfEVT1iyjwN+4MqE5UmVKoAdIBqeoCHgLA==", + "dev": true, + "requires": { + "type-fest": "^0.11.0" + }, + "dependencies": { + "type-fest": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.11.0.tgz", + "integrity": "sha512-OdjXJxnCN1AvyLSzeKIgXTXxV+99ZuXl3Hpo9XpJAv9MBcHrrJOQ5kV7ypXOuQie+AmWG25hLbiKdwYTifzcfQ==", + "dev": true + } + } + }, "ansi-regex": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", @@ -882,12 +1149,13 @@ "dev": true }, "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz", + "integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==", "dev": true, "requires": { - "color-convert": "^1.9.0" + "@types/color-name": "^1.1.1", + "color-convert": "^2.0.1" } }, "anymatch": { @@ -961,6 +1229,12 @@ "integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=", "dev": true }, + "array-ify": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/array-ify/-/array-ify-1.0.0.tgz", + "integrity": "sha1-nlKHYrSpBmrRY6aWKjZEGOlibs4=", + "dev": true + }, "array-includes": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.1.tgz", @@ -988,6 +1262,12 @@ "es-abstract": "^1.17.0-next.1" } }, + "arrify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", + "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=", + "dev": true + }, "asn1.js": { "version": "5.4.1", "resolved": "https://registry.npmjs.org/asn1.js/-/asn1.js-5.4.1.tgz", @@ -1063,6 +1343,12 @@ "dev": true, "optional": true }, + "at-least-node": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/at-least-node/-/at-least-node-1.0.0.tgz", + "integrity": "sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg==", + "dev": true + }, "atob": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz", @@ -1171,9 +1457,9 @@ "dev": true }, "bn.js": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.1.2.tgz", - "integrity": "sha512-40rZaf3bUNKTVYu9sIeeEGOg7g14Yvnj9kH7b50EiwX0Q7A6umbvfI5tvHaOERH0XigqKkfLkFQxzb4e6CIXnA==", + "version": "5.1.3", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.1.3.tgz", + "integrity": "sha512-GkTiFpjFtUzU9CbMeJ5iazkCzGL3jrhzerzZIuqLABjbwRaFt33I9tUdSNryIptM+RxDet6OKm2WnLXzW51KsQ==", "dev": true }, "body-parser": { @@ -1340,12 +1626,6 @@ "safe-buffer": "^5.2.0" }, "dependencies": { - "inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "dev": true - }, "readable-stream": { "version": "3.6.0", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", @@ -1479,6 +1759,17 @@ "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", "dev": true }, + "camelcase-keys": { + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-6.2.2.tgz", + "integrity": "sha512-YrwaA0vEKazPBkn0ipTiMpSajYDSe+KjQfrjhcBMxJt/znbvlHd8Pw/Vamaz5EB4Wfhs3SUR3Z9mwRu/P3s3Yg==", + "dev": true, + "requires": { + "camelcase": "^5.3.1", + "map-obj": "^4.0.0", + "quick-lru": "^4.0.1" + } + }, "chalk": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", @@ -1487,48 +1778,6 @@ "requires": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" - }, - "dependencies": { - "ansi-styles": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz", - "integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==", - "dev": true, - "requires": { - "@types/color-name": "^1.1.1", - "color-convert": "^2.0.1" - } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true - }, - "supports-color": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz", - "integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==", - "dev": true, - "requires": { - "has-flag": "^4.0.0" - } - } } }, "chokidar": { @@ -1602,6 +1851,12 @@ "tslib": "^1.9.0" } }, + "ci-info": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-2.0.0.tgz", + "integrity": "sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==", + "dev": true + }, "cipher-base": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", @@ -1641,42 +1896,55 @@ "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==", "dev": true }, - "cliui": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", - "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", + "cli-cursor": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-3.1.0.tgz", + "integrity": "sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==", "dev": true, "requires": { - "string-width": "^4.2.0", - "strip-ansi": "^6.0.0", - "wrap-ansi": "^6.2.0" + "restore-cursor": "^3.1.0" + } + }, + "cli-truncate": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/cli-truncate/-/cli-truncate-2.1.0.tgz", + "integrity": "sha512-n8fOixwDD6b/ObinzTrp1ZKFzbgvKZvuz/TvejnLn1aQfC6r52XEx85FmuC+3HI+JM7coBRXUvNqEU2PHVrHpg==", + "dev": true, + "requires": { + "slice-ansi": "^3.0.0", + "string-width": "^4.2.0" }, "dependencies": { - "emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "astral-regex": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz", + "integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==", "dev": true }, - "is-fullwidth-code-point": { + "slice-ansi": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true - }, - "string-width": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz", - "integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-3.0.0.tgz", + "integrity": "sha512-pSyv7bSTC7ig9Dcgbw9AuRNUb5k5V6oDudjZoMBSr13qpLBG7tB+zgCkARjq7xIUgdz5P1Qe8u+rSGdouOOIyQ==", "dev": true, "requires": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.0" + "ansi-styles": "^4.0.0", + "astral-regex": "^2.0.0", + "is-fullwidth-code-point": "^3.0.0" } } } }, + "cliui": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", + "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", + "dev": true, + "requires": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^6.2.0" + } + }, "clone-deep": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/clone-deep/-/clone-deep-4.0.1.tgz", @@ -1699,18 +1967,18 @@ } }, "color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, "requires": { - "color-name": "1.1.3" + "color-name": "~1.1.4" } }, "color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, "colors": { @@ -1731,13 +1999,29 @@ "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=", "dev": true }, - "component-emitter": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz", - "integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==", - "dev": true - }, - "concat-map": { + "compare-func": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/compare-func/-/compare-func-2.0.0.tgz", + "integrity": "sha512-zHig5N+tPWARooBnb0Zx1MFcdfpyJrfTJ3Y5L+IFvUm8rM74hHz66z0gw0x4tijh5CorKkKUCnW82R2vmpeCRA==", + "dev": true, + "requires": { + "array-ify": "^1.0.0", + "dot-prop": "^5.1.0" + } + }, + "compare-versions": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/compare-versions/-/compare-versions-3.6.0.tgz", + "integrity": "sha512-W6Af2Iw1z4CB7q4uU4hv646dW9GQuBM+YpC0UvUCWSD8w90SJjp+ujJuXaEMtAXBtSqGfMPuFOVn4/+FlaqfBA==", + "dev": true + }, + "component-emitter": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz", + "integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==", + "dev": true + }, + "concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", @@ -1794,6 +2078,42 @@ "integrity": "sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA==", "dev": true }, + "conventional-changelog-angular": { + "version": "5.0.11", + "resolved": "https://registry.npmjs.org/conventional-changelog-angular/-/conventional-changelog-angular-5.0.11.tgz", + "integrity": "sha512-nSLypht/1yEflhuTogC03i7DX7sOrXGsRn14g131Potqi6cbGbGEE9PSDEHKldabB6N76HiSyw9Ph+kLmC04Qw==", + "dev": true, + "requires": { + "compare-func": "^2.0.0", + "q": "^1.5.1" + } + }, + "conventional-changelog-conventionalcommits": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/conventional-changelog-conventionalcommits/-/conventional-changelog-conventionalcommits-4.4.0.tgz", + "integrity": "sha512-ybvx76jTh08tpaYrYn/yd0uJNLt5yMrb1BphDe4WBredMlvPisvMghfpnJb6RmRNcqXeuhR6LfGZGewbkRm9yA==", + "dev": true, + "requires": { + "compare-func": "^2.0.0", + "lodash": "^4.17.15", + "q": "^1.5.1" + } + }, + "conventional-commits-parser": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/conventional-commits-parser/-/conventional-commits-parser-3.1.0.tgz", + "integrity": "sha512-RSo5S0WIwXZiRxUGTPuYFbqvrR4vpJ1BDdTlthFgvHt5kEdnd1+pdvwWphWn57/oIl4V72NMmOocFqqJ8mFFhA==", + "dev": true, + "requires": { + "JSONStream": "^1.0.4", + "is-text-path": "^1.0.1", + "lodash": "^4.17.15", + "meow": "^7.0.0", + "split2": "^2.0.0", + "through2": "^3.0.0", + "trim-off-newlines": "^1.0.0" + } + }, "convert-source-map": { "version": "1.7.0", "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.7.0.tgz", @@ -1835,6 +2155,12 @@ "integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=", "dev": true }, + "core-js": { + "version": "3.6.5", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.6.5.tgz", + "integrity": "sha512-vZVEEwZoIsI+vPEuoF9Iqf5H7/M3eeQqWlQnYa8FSKKePuYTf5MWnxb5SDAzCa60b3JBRS5g9b+Dq7b1y/RCrA==", + "dev": true + }, "core-util-is": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", @@ -1857,6 +2183,19 @@ "integrity": "sha1-jtolLsqrWEDc2XXOuQ2TcMgZ/4c=", "dev": true }, + "cosmiconfig": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-7.0.0.tgz", + "integrity": "sha512-pondGvTuVYDk++upghXJabWzL6Kxu6f26ljFw64Swq9v6sQPUL3EUlVDV56diOjpCayKihL6hVe8exIACU4XcA==", + "dev": true, + "requires": { + "@types/parse-json": "^4.0.0", + "import-fresh": "^3.2.1", + "parse-json": "^5.0.0", + "path-type": "^4.0.0", + "yaml": "^1.10.0" + } + }, "create-ecdh": { "version": "4.0.4", "resolved": "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.4.tgz", @@ -1946,6 +2285,12 @@ "integrity": "sha1-WW6WmP0MgOEgOMK4LW6xs1tiJNk=", "dev": true }, + "dargs": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/dargs/-/dargs-7.0.0.tgz", + "integrity": "sha512-2iy1EkLdlBzQGvbweYRFxmFath8+K7+AKB0TlhHWkNuH+TmovaMH/Wp7V7R4u7f4SnX3OgLsU9t1NI9ioDnUpg==", + "dev": true + }, "debug": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", @@ -1961,12 +2306,36 @@ "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", "dev": true }, + "decamelize-keys": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/decamelize-keys/-/decamelize-keys-1.1.0.tgz", + "integrity": "sha1-0XGoeTMlKAfrPLYdwcFEXQeN8tk=", + "dev": true, + "requires": { + "decamelize": "^1.1.0", + "map-obj": "^1.0.0" + }, + "dependencies": { + "map-obj": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz", + "integrity": "sha1-2TPOuSBdgr3PSIb2dCvcK03qFG0=", + "dev": true + } + } + }, "decode-uri-component": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz", "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=", "dev": true }, + "dedent": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/dedent/-/dedent-0.7.0.tgz", + "integrity": "sha1-JJXduvbrh0q7Dhvp3yLS5aVEMmw=", + "dev": true + }, "deep-is": { "version": "0.1.3", "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", @@ -2108,6 +2477,15 @@ "integrity": "sha512-jnjyiM6eRyZl2H+W8Q/zLMA481hzi0eszAaBUzIVnmYVDBbnLxVNnfu1HgEBvCbL+71FrxMl3E6lpKH7Ge3OXA==", "dev": true }, + "dot-prop": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-5.2.0.tgz", + "integrity": "sha512-uEUyaDKoSQ1M4Oq8l45hSE26SnTxL6snNnqvK/VWx5wJhmff5z0FUVJDKDanor/6w3kzE3i7XZOk+7wC0EXr1A==", + "dev": true, + "requires": { + "is-obj": "^2.0.0" + } + }, "duplexify": { "version": "3.7.1", "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-3.7.1.tgz", @@ -2162,9 +2540,9 @@ } }, "emoji-regex": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", - "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", "dev": true }, "emojis-list": { @@ -2275,9 +2653,9 @@ "dev": true }, "eslint": { - "version": "7.6.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.6.0.tgz", - "integrity": "sha512-QlAManNtqr7sozWm5TF4wIH9gmUm2hE3vNRUvyoYAa4y1l5/jxD/PQStEjBMQtCqZmSep8UxrcecI60hOpe61w==", + "version": "7.7.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.7.0.tgz", + "integrity": "sha512-1KUxLzos0ZVsyL81PnRN335nDtQ8/vZUD6uMtWbF+5zDtjKcsklIi78XoE0MVL93QvWTu+E5y44VyyCsOMBrIg==", "dev": true, "requires": { "@babel/code-frame": "^7.0.0", @@ -2336,6 +2714,14 @@ "dev": true, "requires": { "get-stdin": "^6.0.0" + }, + "dependencies": { + "get-stdin": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-6.0.0.tgz", + "integrity": "sha512-jp4tHawyV7+fkkSKyvjuLZswblUtz+SQKzSWnBbii16BuZksJlU1wuBYXY75r+duh/llF1ur6oNwi+2ZzjKZ7g==", + "dev": true + } } }, "eslint-import-resolver-node": { @@ -2366,9 +2752,9 @@ } }, "eslint-import-resolver-typescript": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/eslint-import-resolver-typescript/-/eslint-import-resolver-typescript-2.2.0.tgz", - "integrity": "sha512-/NhKEH1gbRlcb9RcaZJe5zRn5eIffGTf1qh3JAyvkEuPli3DEa5HQWWUO5OTfUjj7buUXsDq8lEsdwbbSeqywg==", + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/eslint-import-resolver-typescript/-/eslint-import-resolver-typescript-2.2.1.tgz", + "integrity": "sha512-wxlVdwuWY6R5+CoesIy6n8EZX4k9lEeZGWTVBoX9g//8Xma8JMtL/p3AGnG43rRyXmIrX+/0IN8lpOPzrw1fSw==", "dev": true, "requires": { "debug": "^4.1.1", @@ -2445,11 +2831,90 @@ "isarray": "^1.0.0" } }, + "find-up": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", + "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", + "dev": true, + "requires": { + "locate-path": "^2.0.0" + } + }, + "locate-path": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", + "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", + "dev": true, + "requires": { + "p-locate": "^2.0.0", + "path-exists": "^3.0.0" + } + }, "ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", "dev": true + }, + "p-limit": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", + "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", + "dev": true, + "requires": { + "p-try": "^1.0.0" + } + }, + "p-locate": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", + "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", + "dev": true, + "requires": { + "p-limit": "^1.1.0" + } + }, + "p-try": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", + "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", + "dev": true + }, + "path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", + "dev": true + }, + "path-type": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-2.0.0.tgz", + "integrity": "sha1-8BLMuEFbcJb8LaoQVMPXI4lZTHM=", + "dev": true, + "requires": { + "pify": "^2.0.0" + } + }, + "read-pkg": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-2.0.0.tgz", + "integrity": "sha1-jvHAYjxqbbDcZxPEv6xGMysjaPg=", + "dev": true, + "requires": { + "load-json-file": "^2.0.0", + "normalize-package-data": "^2.3.2", + "path-type": "^2.0.0" + } + }, + "read-pkg-up": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-2.0.0.tgz", + "integrity": "sha1-a3KoBImE4MQeeVEP1en6mbO1Sb4=", + "dev": true, + "requires": { + "find-up": "^2.0.0", + "read-pkg": "^2.0.0" + } } } }, @@ -2570,6 +3035,23 @@ "safe-buffer": "^5.1.1" } }, + "execa": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/execa/-/execa-4.0.3.tgz", + "integrity": "sha512-WFDXGHckXPWZX19t1kCsXzOpqX9LWYNqn4C+HqZlk/V0imTkzJZqf87ZBhvpHaftERYknpk0fjSylnXVlVgI0A==", + "dev": true, + "requires": { + "cross-spawn": "^7.0.0", + "get-stream": "^5.0.0", + "human-signals": "^1.1.1", + "is-stream": "^2.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^4.0.0", + "onetime": "^5.1.0", + "signal-exit": "^3.0.2", + "strip-final-newline": "^2.0.0" + } + }, "expand-brackets": { "version": "2.1.4", "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", @@ -2843,6 +3325,15 @@ "integrity": "sha512-0btnI/H8f2pavGMN8w40mlSKOfTK2SVJmBfBeVIj3kNw0swwgzyRq0d5TJVOwodFmtvpPeWPN/MCcfuWF0Ezbw==", "dev": true }, + "figures": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-3.2.0.tgz", + "integrity": "sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==", + "dev": true, + "requires": { + "escape-string-regexp": "^1.0.5" + } + }, "file-entry-cache": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-5.0.1.tgz", @@ -2918,55 +3409,6 @@ "pkg-dir": "^4.1.0" }, "dependencies": { - "find-up": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", - "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", - "dev": true, - "requires": { - "locate-path": "^5.0.0", - "path-exists": "^4.0.0" - } - }, - "locate-path": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", - "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", - "dev": true, - "requires": { - "p-locate": "^4.1.0" - } - }, - "p-limit": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", - "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", - "dev": true, - "requires": { - "p-try": "^2.0.0" - } - }, - "p-locate": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", - "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", - "dev": true, - "requires": { - "p-limit": "^2.2.0" - } - }, - "p-try": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", - "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", - "dev": true - }, - "path-exists": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", - "dev": true - }, "pkg-dir": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", @@ -2979,12 +3421,22 @@ } }, "find-up": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", - "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "requires": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + } + }, + "find-versions": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/find-versions/-/find-versions-3.2.0.tgz", + "integrity": "sha512-P8WRou2S+oe222TOCHitLy8zj+SIsVJh52VP4lvXkaFVnOFFdoWv1H1Jjvel1aI6NCFOAaeAVm8qrI0odiLcww==", "dev": true, "requires": { - "locate-path": "^2.0.0" + "semver-regex": "^2.0.0" } }, "findup-sync": { @@ -3086,14 +3538,15 @@ "dev": true }, "fs-extra": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", - "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.0.1.tgz", + "integrity": "sha512-h2iAoN838FqAFJY2/qVpzFXy+EBxfVE220PalAqQLDVsFOHLJrZvut5puAbCdNv6WJk+B8ihI+k0c7JK5erwqQ==", "dev": true, "requires": { + "at-least-node": "^1.0.0", "graceful-fs": "^4.2.0", - "jsonfile": "^4.0.0", - "universalify": "^0.1.0" + "jsonfile": "^6.0.1", + "universalify": "^1.0.0" } }, "fs-write-stream-atomic": { @@ -3145,6 +3598,12 @@ "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", "dev": true }, + "get-own-enumerable-property-symbols": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/get-own-enumerable-property-symbols/-/get-own-enumerable-property-symbols-3.0.2.tgz", + "integrity": "sha512-I0UBV/XOz1XkIJHEUDMZAbzCThU/H8DxmSfmdGcKPnVhu2VfFqr34jr9777IyaTYvxjedWhqVIilEDsCdP5G6g==", + "dev": true + }, "get-package-type": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/get-package-type/-/get-package-type-0.1.0.tgz", @@ -3152,17 +3611,39 @@ "dev": true }, "get-stdin": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-6.0.0.tgz", - "integrity": "sha512-jp4tHawyV7+fkkSKyvjuLZswblUtz+SQKzSWnBbii16BuZksJlU1wuBYXY75r+duh/llF1ur6oNwi+2ZzjKZ7g==", + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-8.0.0.tgz", + "integrity": "sha512-sY22aA6xchAzprjyqmSEQv4UbAAzRN0L2dQB0NlN5acTTK9Don6nhoc3eAbUnpZiCANAMfd/+40kVdKfFygohg==", "dev": true }, + "get-stream": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz", + "integrity": "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==", + "dev": true, + "requires": { + "pump": "^3.0.0" + } + }, "get-value": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", "integrity": "sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=", "dev": true }, + "git-raw-commits": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/git-raw-commits/-/git-raw-commits-2.0.7.tgz", + "integrity": "sha512-SkwrTqrDxw8y0G1uGJ9Zw13F7qu3LF8V4BifyDeiJCxSnjRGZD9SaoMiMqUvvXMXh6S3sOQ1DsBN7L2fMUZW/g==", + "dev": true, + "requires": { + "dargs": "^7.0.0", + "lodash.template": "^4.0.2", + "meow": "^7.0.0", + "split2": "^2.0.0", + "through2": "^3.0.0" + } + }, "glob": { "version": "7.1.6", "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", @@ -3192,6 +3673,15 @@ "integrity": "sha1-jFoUlNIGbFcMw7/kSWF1rMTVAqs=", "dev": true }, + "global-dirs": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/global-dirs/-/global-dirs-0.1.1.tgz", + "integrity": "sha1-sxnA3UYH81PzvpzKTHL8FIxJ9EU=", + "dev": true, + "requires": { + "ini": "^1.3.4" + } + }, "global-modules": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/global-modules/-/global-modules-2.0.0.tgz", @@ -3254,6 +3744,14 @@ "dev": true, "requires": { "type-fest": "^0.8.1" + }, + "dependencies": { + "type-fest": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", + "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", + "dev": true + } } }, "graceful-fs": { @@ -3262,6 +3760,12 @@ "integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==", "dev": true }, + "hard-rejection": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/hard-rejection/-/hard-rejection-2.1.0.tgz", + "integrity": "sha512-VIZB+ibDhx7ObhAe7OVtoEbuP4h/MuOTHJ+J8h/eBXotJYl0fBgR72xDFCKgIh22OJZIOVNxBMWuhAr10r8HdA==", + "dev": true + }, "has": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", @@ -3272,9 +3776,9 @@ } }, "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true }, "has-symbols": { @@ -3326,12 +3830,6 @@ "safe-buffer": "^5.2.0" }, "dependencies": { - "inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "dev": true - }, "readable-stream": { "version": "3.6.0", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", @@ -3369,6 +3867,14 @@ "requires": { "is-stream": "^2.0.0", "type-fest": "^0.8.0" + }, + "dependencies": { + "type-fest": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", + "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", + "dev": true + } } }, "he": { @@ -3420,6 +3926,14 @@ "setprototypeof": "1.1.1", "statuses": ">= 1.5.0 < 2", "toidentifier": "1.0.0" + }, + "dependencies": { + "inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", + "dev": true + } } }, "http-graceful-shutdown": { @@ -3474,6 +3988,54 @@ "integrity": "sha1-7AbBDgo0wPL68Zn3/X/Hj//QPHM=", "dev": true }, + "human-signals": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-1.1.1.tgz", + "integrity": "sha512-SEQu7vl8KjNL2eoGBLF3+wAjpsNfA9XMlXAYj/3EdaNfAlxKthD1xjEQfGOUhllCGGJVNY34bRr6lPINhNjyZw==", + "dev": true + }, + "husky": { + "version": "4.2.5", + "resolved": "https://registry.npmjs.org/husky/-/husky-4.2.5.tgz", + "integrity": "sha512-SYZ95AjKcX7goYVZtVZF2i6XiZcHknw50iXvY7b0MiGoj5RwdgRQNEHdb+gPDPCXKlzwrybjFjkL6FOj8uRhZQ==", + "dev": true, + "requires": { + "chalk": "^4.0.0", + "ci-info": "^2.0.0", + "compare-versions": "^3.6.0", + "cosmiconfig": "^6.0.0", + "find-versions": "^3.2.0", + "opencollective-postinstall": "^2.0.2", + "pkg-dir": "^4.2.0", + "please-upgrade-node": "^3.2.0", + "slash": "^3.0.0", + "which-pm-runs": "^1.0.0" + }, + "dependencies": { + "cosmiconfig": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-6.0.0.tgz", + "integrity": "sha512-xb3ZL6+L8b9JLLCx3ZdoZy4+2ECphCMo2PwqgP1tlfVq6M6YReyzBJtvWWtbDSpNr9hn96pkCiZqUcFEc+54Qg==", + "dev": true, + "requires": { + "@types/parse-json": "^4.0.0", + "import-fresh": "^3.1.0", + "parse-json": "^5.0.0", + "path-type": "^4.0.0", + "yaml": "^1.7.2" + } + }, + "pkg-dir": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", + "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", + "dev": true, + "requires": { + "find-up": "^4.0.0" + } + } + } + }, "iconv-lite": { "version": "0.4.24", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", @@ -3509,6 +4071,14 @@ "requires": { "parent-module": "^1.0.0", "resolve-from": "^4.0.0" + }, + "dependencies": { + "resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true + } } }, "import-local": { @@ -3540,15 +4110,6 @@ "path-exists": "^3.0.0" } }, - "p-limit": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", - "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", - "dev": true, - "requires": { - "p-try": "^2.0.0" - } - }, "p-locate": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", @@ -3558,10 +4119,10 @@ "p-limit": "^2.0.0" } }, - "p-try": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", - "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", "dev": true }, "pkg-dir": { @@ -3604,9 +4165,9 @@ } }, "inherits": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", "dev": true }, "ini": { @@ -3739,9 +4300,9 @@ "dev": true }, "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", "dev": true }, "is-glob": { @@ -3773,6 +4334,18 @@ } } }, + "is-obj": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-2.0.0.tgz", + "integrity": "sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w==", + "dev": true + }, + "is-plain-obj": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz", + "integrity": "sha1-caUMhCnfync8kqOQpKA7OfzVHT4=", + "dev": true + }, "is-plain-object": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", @@ -3791,6 +4364,12 @@ "has-symbols": "^1.0.1" } }, + "is-regexp": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-regexp/-/is-regexp-1.0.0.tgz", + "integrity": "sha1-/S2INUXEa6xaYz57mgnof6LLUGk=", + "dev": true + }, "is-stream": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.0.tgz", @@ -3812,8 +4391,17 @@ "has-symbols": "^1.0.1" } }, - "is-typedarray": { - "version": "1.0.0", + "is-text-path": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-text-path/-/is-text-path-1.0.1.tgz", + "integrity": "sha1-Thqg+1G/vLPpJogAE5cgLBd1tm4=", + "dev": true, + "requires": { + "text-extensions": "^1.0.0" + } + }, + "is-typedarray": { + "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", "dev": true @@ -3918,23 +4506,6 @@ "istanbul-lib-coverage": "^3.0.0", "make-dir": "^3.0.0", "supports-color": "^7.1.0" - }, - "dependencies": { - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true - }, - "supports-color": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz", - "integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==", - "dev": true, - "requires": { - "has-flag": "^4.0.0" - } - } } }, "istanbul-lib-source-maps": { @@ -4047,14 +4618,21 @@ } }, "jsonfile": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", - "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.0.1.tgz", + "integrity": "sha512-jR2b5v7d2vIOust+w3wtFKZIfpC2pnRmFAhAC/BuweZFQR8qZzxH1OyrQ10HmdVYiXWkYUqPVsz91cG7EL2FBg==", "dev": true, "requires": { - "graceful-fs": "^4.1.6" + "graceful-fs": "^4.1.6", + "universalify": "^1.0.0" } }, + "jsonparse": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/jsonparse/-/jsonparse-1.3.1.tgz", + "integrity": "sha1-P02uSpH6wxX3EGL4UhzCOfE2YoA=", + "dev": true + }, "kind-of": { "version": "6.0.3", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", @@ -4071,6 +4649,126 @@ "type-check": "~0.4.0" } }, + "lines-and-columns": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.1.6.tgz", + "integrity": "sha1-HADHQ7QzzQpOgHWPe2SldEDZ/wA=", + "dev": true + }, + "lint-staged": { + "version": "10.2.11", + "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-10.2.11.tgz", + "integrity": "sha512-LRRrSogzbixYaZItE2APaS4l2eJMjjf5MbclRZpLJtcQJShcvUzKXsNeZgsLIZ0H0+fg2tL4B59fU9wHIHtFIA==", + "dev": true, + "requires": { + "chalk": "^4.0.0", + "cli-truncate": "2.1.0", + "commander": "^5.1.0", + "cosmiconfig": "^6.0.0", + "debug": "^4.1.1", + "dedent": "^0.7.0", + "enquirer": "^2.3.5", + "execa": "^4.0.1", + "listr2": "^2.1.0", + "log-symbols": "^4.0.0", + "micromatch": "^4.0.2", + "normalize-path": "^3.0.0", + "please-upgrade-node": "^3.2.0", + "string-argv": "0.3.1", + "stringify-object": "^3.3.0" + }, + "dependencies": { + "braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dev": true, + "requires": { + "fill-range": "^7.0.1" + } + }, + "commander": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-5.1.0.tgz", + "integrity": "sha512-P0CysNDQ7rtVw4QIQtm+MRxV66vKFSvlsQvGYXZWR3qFU0jlMKHZZZgw8e+8DSah4UDKMqnknRDQz+xuQXQ/Zg==", + "dev": true + }, + "cosmiconfig": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-6.0.0.tgz", + "integrity": "sha512-xb3ZL6+L8b9JLLCx3ZdoZy4+2ECphCMo2PwqgP1tlfVq6M6YReyzBJtvWWtbDSpNr9hn96pkCiZqUcFEc+54Qg==", + "dev": true, + "requires": { + "@types/parse-json": "^4.0.0", + "import-fresh": "^3.1.0", + "parse-json": "^5.0.0", + "path-type": "^4.0.0", + "yaml": "^1.7.2" + } + }, + "fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dev": true, + "requires": { + "to-regex-range": "^5.0.1" + } + }, + "is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true + }, + "micromatch": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.2.tgz", + "integrity": "sha512-y7FpHSbMUMoyPbYUSzO6PaZ6FyRnQOpHuKwbo1G+Knck95XVU4QAiKdGEnj5wwoS7PlOgthX/09u5iFJ+aYf5Q==", + "dev": true, + "requires": { + "braces": "^3.0.1", + "picomatch": "^2.0.5" + } + }, + "to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "requires": { + "is-number": "^7.0.0" + } + } + } + }, + "listr2": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/listr2/-/listr2-2.6.0.tgz", + "integrity": "sha512-nwmqTJYQQ+AsKb4fCXH/6/UmLCEDL1jkRAdSn9M6cEUzoRGrs33YD/3N86gAZQnGZ6hxV18XSdlBcJ1GTmetJA==", + "dev": true, + "requires": { + "chalk": "^4.1.0", + "cli-truncate": "^2.1.0", + "figures": "^3.2.0", + "indent-string": "^4.0.0", + "log-update": "^4.0.0", + "p-map": "^4.0.0", + "rxjs": "^6.6.2", + "through": "^2.3.8" + }, + "dependencies": { + "p-map": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-4.0.0.tgz", + "integrity": "sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ==", + "dev": true, + "requires": { + "aggregate-error": "^3.0.0" + } + } + } + }, "load-json-file": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-2.0.0.tgz", @@ -4081,6 +4779,17 @@ "parse-json": "^2.2.0", "pify": "^2.0.0", "strip-bom": "^3.0.0" + }, + "dependencies": { + "parse-json": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", + "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", + "dev": true, + "requires": { + "error-ex": "^1.2.0" + } + } } }, "loader-runner": { @@ -4101,13 +4810,12 @@ } }, "locate-path": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", - "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", "dev": true, "requires": { - "p-locate": "^2.0.0", - "path-exists": "^3.0.0" + "p-locate": "^4.1.0" } }, "lodash": { @@ -4122,12 +4830,77 @@ "integrity": "sha512-rlrc3yU3+JNOpZ9zj5pQtxnx2THmvRykwL4Xlxoa8I9lHBlVbbyPhgyPMioxVZ4NqyxaVVtaJnzsyOidQIhyyQ==", "dev": true }, + "lodash._reinterpolate": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/lodash._reinterpolate/-/lodash._reinterpolate-3.0.0.tgz", + "integrity": "sha1-DM8tiRZq8Ds2Y8eWU4t1rG4RTZ0=", + "dev": true + }, "lodash.flattendeep": { "version": "4.4.0", "resolved": "https://registry.npmjs.org/lodash.flattendeep/-/lodash.flattendeep-4.4.0.tgz", "integrity": "sha1-+wMJF/hqMTTlvJvsDWngAT3f7bI=", "dev": true }, + "lodash.template": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.template/-/lodash.template-4.5.0.tgz", + "integrity": "sha512-84vYFxIkmidUiFxidA/KjjH9pAycqW+h980j7Fuz5qxRtO9pgB7MDFTdys1N7A5mcucRiDyEq4fusljItR1T/A==", + "dev": true, + "requires": { + "lodash._reinterpolate": "^3.0.0", + "lodash.templatesettings": "^4.0.0" + } + }, + "lodash.templatesettings": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/lodash.templatesettings/-/lodash.templatesettings-4.2.0.tgz", + "integrity": "sha512-stgLz+i3Aa9mZgnjr/O+v9ruKZsPsndy7qPZOchbqk2cnTU1ZaldKK+v7m54WoKIyxiuMZTKT2H81F8BeAc3ZQ==", + "dev": true, + "requires": { + "lodash._reinterpolate": "^3.0.0" + } + }, + "log-symbols": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.0.0.tgz", + "integrity": "sha512-FN8JBzLx6CzeMrB0tg6pqlGU1wCrXW+ZXGH481kfsBqer0hToTIiHdjH4Mq8xJUbvATujKCvaREGWpGUionraA==", + "dev": true, + "requires": { + "chalk": "^4.0.0" + } + }, + "log-update": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/log-update/-/log-update-4.0.0.tgz", + "integrity": "sha512-9fkkDevMefjg0mmzWFBW8YkFP91OrizzkW3diF7CpG+S2EYdy4+TVfGwz1zeF8x7hCx1ovSPTOE9Ngib74qqUg==", + "dev": true, + "requires": { + "ansi-escapes": "^4.3.0", + "cli-cursor": "^3.1.0", + "slice-ansi": "^4.0.0", + "wrap-ansi": "^6.2.0" + }, + "dependencies": { + "astral-regex": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz", + "integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==", + "dev": true + }, + "slice-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-4.0.0.tgz", + "integrity": "sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==", + "dev": true, + "requires": { + "ansi-styles": "^4.0.0", + "astral-regex": "^2.0.0", + "is-fullwidth-code-point": "^3.0.0" + } + } + } + }, "lru-cache": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", @@ -4166,6 +4939,12 @@ "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=", "dev": true }, + "map-obj": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-4.1.0.tgz", + "integrity": "sha512-glc9y00wgtwcDmp7GaE/0b0OnxpNJsVf3ael/An6Fe2Q51LLwN1er6sdomLRzz5h0+yMpiYLhWYF5R7HeqVd4g==", + "dev": true + }, "map-visit": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz", @@ -4202,12 +4981,37 @@ "readable-stream": "^2.0.1" } }, + "meow": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/meow/-/meow-7.1.0.tgz", + "integrity": "sha512-kq5F0KVteskZ3JdfyQFivJEj2RaA8NFsS4+r9DaMKLcUHpk5OcHS3Q0XkCXONB1mZRPsu/Y/qImKri0nwSEZog==", + "dev": true, + "requires": { + "@types/minimist": "^1.2.0", + "camelcase-keys": "^6.2.2", + "decamelize-keys": "^1.1.0", + "hard-rejection": "^2.1.0", + "minimist-options": "4.1.0", + "normalize-package-data": "^2.5.0", + "read-pkg-up": "^7.0.1", + "redent": "^3.0.0", + "trim-newlines": "^3.0.0", + "type-fest": "^0.13.1", + "yargs-parser": "^18.1.3" + } + }, "merge-descriptors": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", "integrity": "sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E=", "dev": true }, + "merge-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", + "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", + "dev": true + }, "merge2": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", @@ -4280,6 +5084,18 @@ "mime-db": "1.44.0" } }, + "mimic-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", + "dev": true + }, + "min-indent": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/min-indent/-/min-indent-1.0.1.tgz", + "integrity": "sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==", + "dev": true + }, "minimalistic-assert": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", @@ -4307,6 +5123,17 @@ "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", "dev": true }, + "minimist-options": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/minimist-options/-/minimist-options-4.1.0.tgz", + "integrity": "sha512-Q4r8ghd80yhO/0j1O3B2BjweX3fiHg9cdOwjJd2J76Q135c+NDxGCqdYKQ1SKBuFfgWbAUzBfvYjPUEeNgqN1A==", + "dev": true, + "requires": { + "arrify": "^1.0.1", + "is-plain-obj": "^1.1.0", + "kind-of": "^6.0.3" + } + }, "mississippi": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/mississippi/-/mississippi-3.0.0.tgz", @@ -4323,6 +5150,18 @@ "pumpify": "^1.3.3", "stream-each": "^1.1.0", "through2": "^2.0.0" + }, + "dependencies": { + "through2": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", + "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", + "dev": true, + "requires": { + "readable-stream": "~2.3.6", + "xtend": "~4.0.1" + } + } } }, "mixin-deep": { @@ -4549,8 +5388,16 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true + }, + "npm-run-path": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", + "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", "dev": true, - "optional": true + "requires": { + "path-key": "^3.0.0" + } }, "nyc": { "version": "15.1.0", @@ -4587,61 +5434,6 @@ "yargs": "^15.0.2" }, "dependencies": { - "find-up": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", - "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", - "dev": true, - "requires": { - "locate-path": "^5.0.0", - "path-exists": "^4.0.0" - } - }, - "locate-path": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", - "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", - "dev": true, - "requires": { - "p-locate": "^4.1.0" - } - }, - "p-limit": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", - "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", - "dev": true, - "requires": { - "p-try": "^2.0.0" - } - }, - "p-locate": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", - "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", - "dev": true, - "requires": { - "p-limit": "^2.2.0" - } - }, - "p-try": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", - "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", - "dev": true - }, - "path-exists": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", - "dev": true - }, - "resolve-from": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", - "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", - "dev": true - }, "rimraf": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", @@ -4779,6 +5571,21 @@ "wrappy": "1" } }, + "onetime": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", + "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", + "dev": true, + "requires": { + "mimic-fn": "^2.1.0" + } + }, + "opencollective-postinstall": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/opencollective-postinstall/-/opencollective-postinstall-2.0.3.tgz", + "integrity": "sha512-8AV/sCtuzUeTo8gQK5qDZzARrulB3egtLzFgteqB2tcT4Mw7B8Kt7JcDHmltjz6FOAHsvTevk70gZEbhM4ZS9Q==", + "dev": true + }, "opener": { "version": "1.5.1", "resolved": "https://registry.npmjs.org/opener/-/opener-1.5.1.tgz", @@ -4806,21 +5613,21 @@ "dev": true }, "p-limit": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", - "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", "dev": true, "requires": { - "p-try": "^1.0.0" + "p-try": "^2.0.0" } }, "p-locate": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", - "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", "dev": true, "requires": { - "p-limit": "^1.1.0" + "p-limit": "^2.2.0" } }, "p-map": { @@ -4833,9 +5640,9 @@ } }, "p-try": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", - "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", "dev": true }, "package-hash": { @@ -4890,12 +5697,15 @@ } }, "parse-json": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", - "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.0.1.tgz", + "integrity": "sha512-ztoZ4/DYeXQq4E21v169sC8qWINGpcosGv9XhTDvg9/hWvx/zrFkc9BiWxR58OJLHGk28j5BL0SDLeV2WmFZlQ==", "dev": true, "requires": { - "error-ex": "^1.2.0" + "@babel/code-frame": "^7.0.0", + "error-ex": "^1.3.1", + "json-parse-better-errors": "^1.0.1", + "lines-and-columns": "^1.1.6" } }, "parse-passwd": { @@ -4929,9 +5739,9 @@ "dev": true }, "path-exists": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", - "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", "dev": true }, "path-is-absolute": { @@ -4959,13 +5769,10 @@ "dev": true }, "path-type": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-2.0.0.tgz", - "integrity": "sha1-8BLMuEFbcJb8LaoQVMPXI4lZTHM=", - "dev": true, - "requires": { - "pify": "^2.0.0" - } + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "dev": true }, "pbkdf2": { "version": "3.1.1", @@ -4999,6 +5806,66 @@ "dev": true, "requires": { "find-up": "^2.1.0" + }, + "dependencies": { + "find-up": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", + "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", + "dev": true, + "requires": { + "locate-path": "^2.0.0" + } + }, + "locate-path": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", + "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", + "dev": true, + "requires": { + "p-locate": "^2.0.0", + "path-exists": "^3.0.0" + } + }, + "p-limit": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", + "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", + "dev": true, + "requires": { + "p-try": "^1.0.0" + } + }, + "p-locate": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", + "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", + "dev": true, + "requires": { + "p-limit": "^1.1.0" + } + }, + "p-try": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", + "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", + "dev": true + }, + "path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", + "dev": true + } + } + }, + "please-upgrade-node": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/please-upgrade-node/-/please-upgrade-node-3.2.0.tgz", + "integrity": "sha512-gQR3WpIgNIKwBMVLkpMUeR3e1/E1y42bqDQZfql+kDeXd8COYfM8PQA4X6y7a8u9Ua9FHmsrrmirW2vHs45hWg==", + "dev": true, + "requires": { + "semver-compare": "^1.0.0" } }, "portfinder": { @@ -5166,6 +6033,12 @@ "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", "dev": true }, + "q": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/q/-/q-1.5.1.tgz", + "integrity": "sha1-fjL3W0E4EpHQRhHxvxQQmsAGUdc=", + "dev": true + }, "qs": { "version": "6.9.4", "resolved": "https://registry.npmjs.org/qs/-/qs-6.9.4.tgz", @@ -5185,9 +6058,15 @@ "dev": true }, "querystringify": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.1.1.tgz", - "integrity": "sha512-w7fLxIRCRT7U8Qu53jQnJyPkYZIaR4n5151KMfcJlO/A9397Wxb1amJvROTK6TOnp7PfoAmg/qXiNHI+08jRfA==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.2.0.tgz", + "integrity": "sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ==", + "dev": true + }, + "quick-lru": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-4.0.1.tgz", + "integrity": "sha512-ARhCpm70fzdcvNQfPoy49IaanKkTlRWF2JMzqhcJbhSFRZv7nPTvZJdcY7301IPmvW+/p0RgIWnQDLJxifsQ7g==", "dev": true }, "randombytes": { @@ -5228,24 +6107,42 @@ } }, "read-pkg": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-2.0.0.tgz", - "integrity": "sha1-jvHAYjxqbbDcZxPEv6xGMysjaPg=", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-5.2.0.tgz", + "integrity": "sha512-Ug69mNOpfvKDAc2Q8DRpMjjzdtrnv9HcSMX+4VsZxD1aZ6ZzrIE7rlzXBtWTyhULSMKg076AW6WR5iZpD0JiOg==", "dev": true, "requires": { - "load-json-file": "^2.0.0", - "normalize-package-data": "^2.3.2", - "path-type": "^2.0.0" + "@types/normalize-package-data": "^2.4.0", + "normalize-package-data": "^2.5.0", + "parse-json": "^5.0.0", + "type-fest": "^0.6.0" + }, + "dependencies": { + "type-fest": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.6.0.tgz", + "integrity": "sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg==", + "dev": true + } } }, "read-pkg-up": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-2.0.0.tgz", - "integrity": "sha1-a3KoBImE4MQeeVEP1en6mbO1Sb4=", + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-7.0.1.tgz", + "integrity": "sha512-zK0TB7Xd6JpCLmlLmufqykGE+/TlOePD6qKClNW7hHDKFh/J7/7gCWGR7joEQEW1bKq3a3yUZSObOoWLFQ4ohg==", "dev": true, "requires": { - "find-up": "^2.0.0", - "read-pkg": "^2.0.0" + "find-up": "^4.1.0", + "read-pkg": "^5.2.0", + "type-fest": "^0.8.1" + }, + "dependencies": { + "type-fest": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", + "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", + "dev": true + } } }, "readable-stream": { @@ -5273,6 +6170,22 @@ "picomatch": "^2.2.1" } }, + "redent": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/redent/-/redent-3.0.0.tgz", + "integrity": "sha512-6tDA8g98We0zd0GvVeMT9arEOnTw9qM03L9cJXaCjrip1OO764RDBLBfrB4cwzNGDj5OA5ioymC9GkizgWJDUg==", + "dev": true, + "requires": { + "indent-string": "^4.0.0", + "strip-indent": "^3.0.0" + } + }, + "regenerator-runtime": { + "version": "0.13.7", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.7.tgz", + "integrity": "sha512-a54FxoJDIr27pgf7IgeQGxmqUNYrcV338lf/6gH456HZ/PhX+5BcwHXG9ajESmwe6WRO0tAzRUrRmNONWgkrew==", + "dev": true + }, "regex-not": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz", @@ -5385,17 +6298,36 @@ } }, "resolve-from": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", - "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", "dev": true }, + "resolve-global": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/resolve-global/-/resolve-global-1.0.0.tgz", + "integrity": "sha512-zFa12V4OLtT5XUX/Q4VLvTfBf+Ok0SPc1FNGM/z9ctUdiU618qwKpWnd0CHs3+RqROfyEg/DhuHbMWYqcgljEw==", + "dev": true, + "requires": { + "global-dirs": "^0.1.1" + } + }, "resolve-url": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=", "dev": true }, + "restore-cursor": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz", + "integrity": "sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==", + "dev": true, + "requires": { + "onetime": "^5.1.0", + "signal-exit": "^3.0.2" + } + }, "ret": { "version": "0.1.15", "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz", @@ -5436,6 +6368,15 @@ "aproba": "^1.1.1" } }, + "rxjs": { + "version": "6.6.2", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.6.2.tgz", + "integrity": "sha512-BHdBMVoWC2sL26w//BCu3YzKT4s2jip/WhwsGEDmeKYBhKDZeYezVUnHatYB7L85v5xs0BAQmg6BEYJEKxBabg==", + "dev": true, + "requires": { + "tslib": "^1.9.0" + } + }, "safe-buffer": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", @@ -5480,6 +6421,18 @@ "integrity": "sha512-OrOb32TeeambH6UrhtShmF7CRDqhL6/5XpPNp2DuRH6+9QLw/orhp72j87v8Qa1ScDkvrrBNpZcDejAirJmfXQ==", "dev": true }, + "semver-compare": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/semver-compare/-/semver-compare-1.0.0.tgz", + "integrity": "sha1-De4hahyUGrN+nvsXiPavxf9VN/w=", + "dev": true + }, + "semver-regex": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/semver-regex/-/semver-regex-2.0.0.tgz", + "integrity": "sha512-mUdIBBvdn0PLOeP3TEkMH7HHeUP3GjsXCwKarjv/kGmUFOYg1VqEemKhoQpWMu6X2I8kHeuVdGibLGkVK+/5Qw==", + "dev": true + }, "send": { "version": "0.17.1", "resolved": "https://registry.npmjs.org/send/-/send-0.17.1.tgz", @@ -5640,6 +6593,12 @@ "integrity": "sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==", "dev": true }, + "slash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "dev": true + }, "slice-ansi": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-2.1.0.tgz", @@ -5649,6 +6608,38 @@ "ansi-styles": "^3.2.0", "astral-regex": "^1.0.0", "is-fullwidth-code-point": "^2.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + } } }, "slugify": { @@ -5891,7 +6882,28 @@ "integrity": "sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw==", "dev": true, "requires": { - "extend-shallow": "^3.0.0" + "extend-shallow": "^3.0.0" + } + }, + "split2": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/split2/-/split2-2.2.0.tgz", + "integrity": "sha512-RAb22TG39LhI31MbreBgIuKiIKhVsawfTgEGqKHTK87aG+ul/PB8Sqoi3I7kVdRWiCfrKxK3uo4/YUkpNvhPbw==", + "dev": true, + "requires": { + "through2": "^2.0.2" + }, + "dependencies": { + "through2": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", + "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", + "dev": true, + "requires": { + "readable-stream": "~2.3.6", + "xtend": "~4.0.1" + } + } } }, "sprintf-js": { @@ -5975,32 +6987,21 @@ "integrity": "sha512-AiisoFqQ0vbGcZgQPY1cdP2I76glaVA/RauYR4G4thNFgkTqr90yXTo4LYX60Jl+sIlPNHHdGSwo01AvbKUSVQ==", "dev": true }, + "string-argv": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/string-argv/-/string-argv-0.3.1.tgz", + "integrity": "sha512-a1uQGz7IyVy9YwhqjZIZu1c8JO8dNIe20xBmSS6qu9kv++k3JGzCVmprbNN5Kn+BgzD5E7YYwg1CcjuJMRNsvg==", + "dev": true + }, "string-width": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", - "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz", + "integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==", "dev": true, "requires": { - "emoji-regex": "^7.0.1", - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^5.1.0" - }, - "dependencies": { - "ansi-regex": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", - "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", - "dev": true - }, - "strip-ansi": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", - "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", - "dev": true, - "requires": { - "ansi-regex": "^4.1.0" - } - } + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.0" } }, "string.prototype.trimend": { @@ -6032,6 +7033,25 @@ "safe-buffer": "~5.1.0" } }, + "stringify-object": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/stringify-object/-/stringify-object-3.3.0.tgz", + "integrity": "sha512-rHqiFh1elqCQ9WPLIC8I0Q/g/wj5J1eMkyoiD6eoQApWHP0FtlK7rqnhmabL5VUY9JQCcqwwvlOaSuutekgyrw==", + "dev": true, + "requires": { + "get-own-enumerable-property-symbols": "^3.0.0", + "is-obj": "^1.0.1", + "is-regexp": "^1.0.0" + }, + "dependencies": { + "is-obj": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-1.0.1.tgz", + "integrity": "sha1-PkcprB9f3gJc19g6iW2rn09n2w8=", + "dev": true + } + } + }, "strip-ansi": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", @@ -6047,6 +7067,21 @@ "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", "dev": true }, + "strip-final-newline": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz", + "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==", + "dev": true + }, + "strip-indent": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-3.0.0.tgz", + "integrity": "sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ==", + "dev": true, + "requires": { + "min-indent": "^1.0.0" + } + }, "strip-json-comments": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", @@ -6054,12 +7089,12 @@ "dev": true }, "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz", + "integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==", "dev": true, "requires": { - "has-flag": "^3.0.0" + "has-flag": "^4.0.0" } }, "table": { @@ -6072,6 +7107,46 @@ "lodash": "^4.17.14", "slice-ansi": "^2.1.0", "string-width": "^3.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true + }, + "emoji-regex": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", + "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + }, + "string-width": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "dev": true, + "requires": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" + } + }, + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "requires": { + "ansi-regex": "^4.1.0" + } + } } }, "tapable": { @@ -6156,15 +7231,6 @@ "semver": "^5.6.0" } }, - "p-limit": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", - "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", - "dev": true, - "requires": { - "p-try": "^2.0.0" - } - }, "p-locate": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", @@ -6174,10 +7240,10 @@ "p-limit": "^2.0.0" } }, - "p-try": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", - "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", "dev": true }, "pify": { @@ -6220,20 +7286,32 @@ "minimatch": "^3.0.4" } }, + "text-extensions": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/text-extensions/-/text-extensions-1.9.0.tgz", + "integrity": "sha512-wiBrwC1EhBelW12Zy26JeOUkQ5mRu+5o8rpsJk5+2t+Y5vE7e842qtZDQ2g1NpX/29HdyFeJ4nSIhI47ENSxlQ==", + "dev": true + }, "text-table": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", "dev": true }, + "through": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", + "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", + "dev": true + }, "through2": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", - "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/through2/-/through2-3.0.2.tgz", + "integrity": "sha512-enaDQ4MUyP2W6ZyT6EsMzqBPZaM/avg8iuo+l2d3QCs0J+6RaqkHV/2/lOwDTueBHeJ/2LG9lrLW3d5rWPucuQ==", "dev": true, "requires": { - "readable-stream": "~2.3.6", - "xtend": "~4.0.1" + "inherits": "^2.0.4", + "readable-stream": "2 || 3" } }, "timers-browserify": { @@ -6305,6 +7383,18 @@ "integrity": "sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw==", "dev": true }, + "trim-newlines": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-3.0.0.tgz", + "integrity": "sha512-C4+gOpvmxaSMKuEf9Qc134F1ZuOHVXKRbtEflf4NTtuuJDEIJ9p5PXsalL8SkeRw+qit1Mo+yuvMPAKwWg/1hA==", + "dev": true + }, + "trim-off-newlines": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/trim-off-newlines/-/trim-off-newlines-1.0.1.tgz", + "integrity": "sha1-n5up2e+odkw4dpi8v+sshI8RrbM=", + "dev": true + }, "ts-loader": { "version": "8.0.2", "resolved": "https://registry.npmjs.org/ts-loader/-/ts-loader-8.0.2.tgz", @@ -6318,6 +7408,15 @@ "semver": "^6.0.0" }, "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, "braces": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", @@ -6338,6 +7437,21 @@ "supports-color": "^5.3.0" } }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "dev": true + }, "fill-range": { "version": "7.0.1", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", @@ -6347,6 +7461,12 @@ "to-regex-range": "^5.0.1" } }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, "is-number": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", @@ -6369,6 +7489,15 @@ "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", "dev": true }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + }, "to-regex-range": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", @@ -6445,9 +7574,9 @@ } }, "type-fest": { - "version": "0.8.1", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", - "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", + "version": "0.13.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.13.1.tgz", + "integrity": "sha512-34R7HTnG0XIJcBSn5XhDd7nNFPRcXYRZrBB2O2jdKqYODldSzBAqzsWoZYYvduky73toYS/ESqxPvkDf/F0XMg==", "dev": true }, "type-is": { @@ -6521,9 +7650,9 @@ } }, "universalify": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", - "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-1.0.0.tgz", + "integrity": "sha512-rb6X1W158d7pRQBg5gkR8uPaSfiids68LTJQYOtEUhoJUWBdaQHsuT/EUduxXYxcrt4r5PJ4fuHW1MHT6p0qug==", "dev": true }, "unpipe": { @@ -6647,6 +7776,14 @@ "dev": true, "requires": { "inherits": "2.0.3" + }, + "dependencies": { + "inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", + "dev": true + } } }, "util-deprecate": { @@ -6906,6 +8043,15 @@ "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", "dev": true }, + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, "chalk": { "version": "2.4.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", @@ -6939,6 +8085,21 @@ "wrap-ansi": "^5.1.0" } }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "dev": true + }, "cross-spawn": { "version": "6.0.5", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", @@ -6952,6 +8113,12 @@ "which": "^1.2.9" } }, + "emoji-regex": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", + "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", + "dev": true + }, "find-up": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", @@ -6961,6 +8128,18 @@ "locate-path": "^3.0.0" } }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + }, "locate-path": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", @@ -6971,15 +8150,6 @@ "path-exists": "^3.0.0" } }, - "p-limit": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", - "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", - "dev": true, - "requires": { - "p-try": "^2.0.0" - } - }, "p-locate": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", @@ -6989,10 +8159,10 @@ "p-limit": "^2.0.0" } }, - "p-try": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", - "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", "dev": true }, "path-key": { @@ -7022,6 +8192,17 @@ "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", "dev": true }, + "string-width": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "dev": true, + "requires": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" + } + }, "strip-ansi": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", @@ -7091,9 +8272,9 @@ } }, "webpack-merge": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/webpack-merge/-/webpack-merge-5.1.1.tgz", - "integrity": "sha512-UhIkHAVqeG9EqFfYo7dRELrVfH6HYaOTYM7ssKCwfIIHYnWepGVOFp1E166GwgPGFqV6M68UgRiKOERjVOKIXA==", + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/webpack-merge/-/webpack-merge-5.1.2.tgz", + "integrity": "sha512-/slG0Kh0OKTf0zxdFJlhQHzv8bU9gUYVK5DkBjB3i/yoc1Xx4ADG0KITGO5S/6cqn2Ug43+8VR6Sz8daA/c+5g==", "dev": true, "requires": { "clone-deep": "^4.0.1", @@ -7133,6 +8314,12 @@ "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", "dev": true }, + "which-pm-runs": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/which-pm-runs/-/which-pm-runs-1.0.0.tgz", + "integrity": "sha1-Zws6+8VS4LVd9rd4DKdGFfI60cs=", + "dev": true + }, "wildcard": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/wildcard/-/wildcard-2.0.0.tgz", @@ -7163,56 +8350,6 @@ "ansi-styles": "^4.0.0", "string-width": "^4.1.0", "strip-ansi": "^6.0.0" - }, - "dependencies": { - "ansi-styles": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz", - "integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==", - "dev": true, - "requires": { - "@types/color-name": "^1.1.1", - "color-convert": "^2.0.1" - } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true - }, - "is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true - }, - "string-width": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz", - "integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==", - "dev": true, - "requires": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.0" - } - } } }, "wrappy": { @@ -7260,6 +8397,12 @@ "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", "dev": true }, + "yaml": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.0.tgz", + "integrity": "sha512-yr2icI4glYaNG+KWONODapy2/jDdMSDnrONSjblABjD9B4Z5LgiircSt8m8sRZFNi08kG9Sm0uSHtEmP3zaEGg==", + "dev": true + }, "yargs": { "version": "15.4.1", "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz", @@ -7277,80 +8420,6 @@ "which-module": "^2.0.0", "y18n": "^4.0.0", "yargs-parser": "^18.1.2" - }, - "dependencies": { - "emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true - }, - "find-up": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", - "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", - "dev": true, - "requires": { - "locate-path": "^5.0.0", - "path-exists": "^4.0.0" - } - }, - "is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true - }, - "locate-path": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", - "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", - "dev": true, - "requires": { - "p-locate": "^4.1.0" - } - }, - "p-limit": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", - "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", - "dev": true, - "requires": { - "p-try": "^2.0.0" - } - }, - "p-locate": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", - "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", - "dev": true, - "requires": { - "p-limit": "^2.2.0" - } - }, - "p-try": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", - "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", - "dev": true - }, - "path-exists": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", - "dev": true - }, - "string-width": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz", - "integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==", - "dev": true, - "requires": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.0" - } - } } }, "yargs-parser": { diff --git a/package.json b/package.json index 50a9cc9..0330b37 100644 --- a/package.json +++ b/package.json @@ -37,6 +37,8 @@ "cross-fetch": "^3.0.0" }, "devDependencies": { + "@commitlint/cli": "^10.0.0", + "@commitlint/config-conventional": "^10.0.0", "@pollyjs/adapter-node-http": "^5.0.0", "@pollyjs/core": "^5.0.0", "@pollyjs/persister-fs": "^5.0.0", @@ -59,8 +61,10 @@ "eslint-plugin-import": "^2.0.0", "eslint-plugin-prettier": "^3.0.0", "http-server": "^0.12.0", + "husky": "^4.2.0", "jasmine": "^3.5.0", "jasmine-spec-reporter": "^5.0.0", + "lint-staged": "^10.2.0", "nyc": "^15.1.0", "prettier": "^2.0.0", "setup-polly-jest": "^0.9.0", @@ -84,5 +88,17 @@ "test-record": "POLLY_RECORD=1 npm test", "ts-node": "ts-node --skip-project", "watch": "webpack --config webpack.dev.js --watch" + }, + "husky": { + "hooks": { + "pre-commit": "lint-staged", + "commit-msg": "commitlint --env HUSKY_GIT_PARAMS" + } + }, + "lint-staged": { + "*.ts": [ + "npm run lint", + "git add" + ] } } From 2f87942ffc5a1dbabd46ff4e3027cc94cea93522 Mon Sep 17 00:00:00 2001 From: Alan Poulain Date: Fri, 21 Aug 2020 00:14:55 +0200 Subject: [PATCH 38/56] ci: check commit messages in ci workflow --- .github/workflows/ci.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 80cfa6f..f9506fe 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,6 +11,8 @@ jobs: steps: - name: Checkout uses: actions/checkout@v2 + with: + fetch-depth: 0 - name: Setup Node uses: actions/setup-node@v2-beta with: @@ -19,6 +21,8 @@ jobs: run: npm install - name: Check build run: npm run build + - name: Check commit messages + uses: wagoid/commitlint-github-action@v2 - name: Check coding standards run: npm run lint - name: Run tests From 109237becfdb45c731cd4a9041f8a9508dcb9382 Mon Sep 17 00:00:00 2001 From: Alan Poulain Date: Fri, 21 Aug 2020 00:37:56 +0200 Subject: [PATCH 39/56] website: add changelog item (#7) --- couscous.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/couscous.yml b/couscous.yml index d4593ee..229fb28 100644 --- a/couscous.yml +++ b/couscous.yml @@ -14,6 +14,9 @@ menu: provider_usage: text: 🔎️ Provider Usage relativeUrl: docs/provider_usage.html + changelog: + text: 📃️ Changelog + relativeUrl: changelog.html special_provider_usage: name: Special Provider items: From 3fc1039a264f93aa645935e56a2f0c98dd864601 Mon Sep 17 00:00:00 2001 From: Alan Poulain Date: Sat, 22 Aug 2020 23:59:09 +0200 Subject: [PATCH 40/56] fix: missing config file in ci workflow --- .commitlintrc.json | 22 +++++++++++++++++++++- .github/workflows/ci.yml | 2 ++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/.commitlintrc.json b/.commitlintrc.json index c30e5a9..b5caa5a 100644 --- a/.commitlintrc.json +++ b/.commitlintrc.json @@ -1,3 +1,23 @@ { - "extends": ["@commitlint/config-conventional"] + "extends": ["@commitlint/config-conventional"], + "rules": { + "type-enum": [ + 2, + "always", + [ + "build", + "chore", + "ci", + "docs", + "feat", + "fix", + "perf", + "refactor", + "revert", + "style", + "test", + "website" + ] + ] + } } diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f9506fe..e79dc41 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,6 +23,8 @@ jobs: run: npm run build - name: Check commit messages uses: wagoid/commitlint-github-action@v2 + with: + configFile: .commitlintrc.json - name: Check coding standards run: npm run lint - name: Run tests From a48de981e14b7f52774b42fd87d0e08dd7a74558 Mon Sep 17 00:00:00 2001 From: Alan Poulain Date: Sun, 23 Aug 2020 00:04:35 +0200 Subject: [PATCH 41/56] chore: bump typescript and ts-node --- package-lock.json | 105 ++++++++++++++++++++++++++-------------------- package.json | 4 +- 2 files changed, 61 insertions(+), 48 deletions(-) diff --git a/package-lock.json b/package-lock.json index 6cf4eef..f70a737 100644 --- a/package-lock.json +++ b/package-lock.json @@ -672,9 +672,9 @@ "dev": true }, "@types/jasmine": { - "version": "3.5.12", - "resolved": "https://registry.npmjs.org/@types/jasmine/-/jasmine-3.5.12.tgz", - "integrity": "sha512-vJaQ58oceFao+NzpKNqLOWwHPsqA7YEhKv+mOXvYU4/qh+BfVWIxaBtL0Ck5iCS67yOkNwGkDCrzepnzIWF+7g==", + "version": "3.5.13", + "resolved": "https://registry.npmjs.org/@types/jasmine/-/jasmine-3.5.13.tgz", + "integrity": "sha512-bVSrTEWdCNH2RHN+E0QlEr4pGPMRA6puKOmL/X13ZeZmUS0q12ZR1rkB9PVvJSX0zi/OXrMDNvUai+PC380+rQ==", "dev": true }, "@types/json-schema": { @@ -1086,9 +1086,9 @@ "dev": true }, "aggregate-error": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.0.1.tgz", - "integrity": "sha512-quoaXsZ9/BLNae5yiNoUz+Nhkwz83GhWwtYFglcjEQB2NDHCIpApbqXxIFnm4Pq/Nvhrsq5sYJFyohrrxnTGAA==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz", + "integrity": "sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==", "dev": true, "requires": { "clean-stack": "^2.0.0", @@ -1988,9 +1988,9 @@ "dev": true }, "commander": { - "version": "2.20.3", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", - "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-5.1.0.tgz", + "integrity": "sha512-P0CysNDQ7rtVw4QIQtm+MRxV66vKFSvlsQvGYXZWR3qFU0jlMKHZZZgw8e+8DSah4UDKMqnknRDQz+xuQXQ/Zg==", "dev": true }, "commondir": { @@ -2953,12 +2953,12 @@ "dev": true }, "espree": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/espree/-/espree-7.2.0.tgz", - "integrity": "sha512-H+cQ3+3JYRMEIOl87e7QdHX70ocly5iW4+dttuR8iYSPr/hXKFb+7dBsZ7+u1adC4VrnPlTkv0+OwuPnDop19g==", + "version": "7.3.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-7.3.0.tgz", + "integrity": "sha512-dksIWsvKCixn1yrEXO8UosNSxaDoSYpq9reEjZSbHLpT5hpaCAKTLBwq0RHtLrIr+c0ByiYzWT8KTMRzoRCNlw==", "dev": true, "requires": { - "acorn": "^7.3.1", + "acorn": "^7.4.0", "acorn-jsx": "^5.2.0", "eslint-visitor-keys": "^1.3.0" } @@ -3014,9 +3014,9 @@ "dev": true }, "eventemitter3": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.4.tgz", - "integrity": "sha512-rlaVLnVxtxvoyLsQQFBx53YmXHDxRIzzTLbdfxqi4yocpSjAxXwkU0cScM5JgSKMqEhrZpnvQ2D9gjylR0AimQ==", + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.5.tgz", + "integrity": "sha512-QR0rh0YiPuxuDQ6+T9GAO/xWTExXpxIes1Nl9RykNGTnE1HJmkuEfxJH9cubjIOQZ/GH4qNBR4u8VSHaKiWs4g==", "dev": true }, "events": { @@ -4486,6 +4486,15 @@ "uuid": "^3.3.3" }, "dependencies": { + "p-map": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-3.0.0.tgz", + "integrity": "sha512-d3qXVTF/s+W+CdJ5A29wywV2n8CQQYahlgz2bFiA+4eVNJbHJodPZ+/gXwPGh0bOqA+j8S+6+ckmvLGPk1QpxQ==", + "dev": true, + "requires": { + "aggregate-error": "^3.0.0" + } + }, "rimraf": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", @@ -4590,6 +4599,12 @@ "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", "dev": true }, + "json-parse-even-better-errors": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.0.tgz", + "integrity": "sha512-o3aP+RsWDJZayj1SbHNQAI8x0v3T3SKiGoZlNYfbUP1S3omJQ6i9CnqADqkSPaOAxwua4/1YWx5CM7oiChJt2Q==", + "dev": true + }, "json-schema-traverse": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", @@ -4687,12 +4702,6 @@ "fill-range": "^7.0.1" } }, - "commander": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-5.1.0.tgz", - "integrity": "sha512-P0CysNDQ7rtVw4QIQtm+MRxV66vKFSvlsQvGYXZWR3qFU0jlMKHZZZgw8e+8DSah4UDKMqnknRDQz+xuQXQ/Zg==", - "dev": true - }, "cosmiconfig": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-6.0.0.tgz", @@ -4756,17 +4765,6 @@ "p-map": "^4.0.0", "rxjs": "^6.6.2", "through": "^2.3.8" - }, - "dependencies": { - "p-map": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/p-map/-/p-map-4.0.0.tgz", - "integrity": "sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ==", - "dev": true, - "requires": { - "aggregate-error": "^3.0.0" - } - } } }, "load-json-file": { @@ -5434,6 +5432,15 @@ "yargs": "^15.0.2" }, "dependencies": { + "p-map": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-3.0.0.tgz", + "integrity": "sha512-d3qXVTF/s+W+CdJ5A29wywV2n8CQQYahlgz2bFiA+4eVNJbHJodPZ+/gXwPGh0bOqA+j8S+6+ckmvLGPk1QpxQ==", + "dev": true, + "requires": { + "aggregate-error": "^3.0.0" + } + }, "rimraf": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", @@ -5631,9 +5638,9 @@ } }, "p-map": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/p-map/-/p-map-3.0.0.tgz", - "integrity": "sha512-d3qXVTF/s+W+CdJ5A29wywV2n8CQQYahlgz2bFiA+4eVNJbHJodPZ+/gXwPGh0bOqA+j8S+6+ckmvLGPk1QpxQ==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-4.0.0.tgz", + "integrity": "sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ==", "dev": true, "requires": { "aggregate-error": "^3.0.0" @@ -5697,14 +5704,14 @@ } }, "parse-json": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.0.1.tgz", - "integrity": "sha512-ztoZ4/DYeXQq4E21v169sC8qWINGpcosGv9XhTDvg9/hWvx/zrFkc9BiWxR58OJLHGk28j5BL0SDLeV2WmFZlQ==", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.1.0.tgz", + "integrity": "sha512-+mi/lmVVNKFNVyLXV31ERiy2CY5E1/F6QtJFEzoChPRwwngMNXRDQ9GJ5WdE2Z2P4AujsOi0/+2qHID68KwfIQ==", "dev": true, "requires": { "@babel/code-frame": "^7.0.0", "error-ex": "^1.3.1", - "json-parse-better-errors": "^1.0.1", + "json-parse-even-better-errors": "^2.3.0", "lines-and-columns": "^1.1.6" } }, @@ -7166,6 +7173,12 @@ "source-map-support": "~0.5.12" }, "dependencies": { + "commander": { + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", + "dev": true + }, "source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", @@ -7510,9 +7523,9 @@ } }, "ts-node": { - "version": "8.10.2", - "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-8.10.2.tgz", - "integrity": "sha512-ISJJGgkIpDdBhWVu3jufsWpK3Rzo7bdiIXJjQc0ynKxVOVcg2oIrf2H2cejminGrptVc6q6/uynAHNCuWGbpVA==", + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-9.0.0.tgz", + "integrity": "sha512-/TqB4SnererCDR/vb4S/QvSZvzQMJN8daAslg7MeaiHvD8rDZsSfXmNeNumyZZzMned72Xoq/isQljYSt8Ynfg==", "dev": true, "requires": { "arg": "^4.1.0", @@ -7605,9 +7618,9 @@ } }, "typescript": { - "version": "3.9.7", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.7.tgz", - "integrity": "sha512-BLbiRkiBzAwsjut4x/dsibSTB6yWpwT5qWmC2OfuCg3GgVQCSgMs4vEctYPhsaGtd0AeuuHMkjZ2h2WG8MSzRw==", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.0.2.tgz", + "integrity": "sha512-e4ERvRV2wb+rRZ/IQeb3jm2VxBsirQLpQhdxplZ2MEzGvDkkMmPglecnNDfSUBivMjP93vRbngYYDQqQ/78bcQ==", "dev": true }, "union": { diff --git a/package.json b/package.json index 0330b37..617f3a2 100644 --- a/package.json +++ b/package.json @@ -69,10 +69,10 @@ "prettier": "^2.0.0", "setup-polly-jest": "^0.9.0", "ts-loader": "^8.0.0", - "ts-node": "^8.10.0", + "ts-node": "^9.0.0", "tsconfig-paths": "^3.9.0", "ttypescript": "^1.5.0", - "typescript": "^3.9.0", + "typescript": "^4.0.0", "webpack": "^4.43.0", "webpack-cli": "^3.3.0", "webpack-merge": "^5.1.0" From c360af93715ba0bc4cfbaa3a28cf640dafaba803 Mon Sep 17 00:00:00 2001 From: Alan Poulain Date: Fri, 4 Sep 2020 18:37:29 +0200 Subject: [PATCH 42/56] feat: better MapQuest provider (#8) --- CHANGELOG.md | 4 + couscous.yml | 3 + docs/provider_usage.md | 1 + docs/provider_usage/mapquest.md | 17 + example/node/mapquest.ts | 48 +- example/web/mapquest.html | 31 +- package-lock.json | 1179 +++++++++++------ package.json | 4 +- spec/provider/MapQuestProvider.spec.ts | 260 ++++ spec/provider/MapquestProvider.spec.ts | 133 -- .../recording.har | 168 +++ .../recording.har | 28 +- .../recording.har | 168 +++ .../recording.har | 24 +- .../recording.har | 163 +++ .../recording.har | 18 +- spec/setupPolly.ts | 24 +- src/AdminLevel.ts | 6 + src/ExternalLoader.ts | 26 +- src/GeocoderProviderFactory.ts | 20 +- src/error/ResponseError.ts | 4 + src/provider/MapquestProvider.ts | 189 --- src/provider/ProviderInterface.ts | 10 +- src/provider/YandexProvider.ts | 12 +- src/provider/geoplugin/GeoPluginProvider.ts | 4 +- src/provider/googlemaps/GoogleMapsProvider.ts | 28 +- src/provider/index.ts | 3 +- src/provider/mapbox/MapboxProvider.ts | 21 +- src/provider/mapquest/MapQuestGeocodeQuery.ts | 133 ++ src/provider/mapquest/MapQuestGeocoded.ts | 90 ++ src/provider/mapquest/MapQuestLocation.ts | 139 ++ src/provider/mapquest/MapQuestProvider.ts | 374 ++++++ src/provider/mapquest/index.ts | 7 + src/provider/nominatim/NominatimProvider.ts | 10 +- src/provider/opencage/OpenCageProvider.ts | 64 +- 35 files changed, 2567 insertions(+), 846 deletions(-) create mode 100644 docs/provider_usage/mapquest.md create mode 100644 spec/provider/MapQuestProvider.spec.ts delete mode 100644 spec/provider/MapquestProvider.spec.ts create mode 100644 spec/recordings/MapQuest-Geocoder-Provider_1759071530/receives-correct-geocoding-results-using-POST-and-open-domain_4225723019/recording.har create mode 100644 spec/recordings/MapQuest-Geocoder-Provider_1759071530/receives-correct-geodecoding-results-using-POST-and-open-domain_1453160210/recording.har create mode 100644 spec/recordings/MapQuest-Geocoder-Provider_1759071530/receives-error-when-parameters-are-missing_2925123479/recording.har delete mode 100644 src/provider/MapquestProvider.ts create mode 100644 src/provider/mapquest/MapQuestGeocodeQuery.ts create mode 100644 src/provider/mapquest/MapQuestGeocoded.ts create mode 100644 src/provider/mapquest/MapQuestLocation.ts create mode 100644 src/provider/mapquest/MapQuestProvider.ts create mode 100644 src/provider/mapquest/index.ts diff --git a/CHANGELOG.md b/CHANGELOG.md index 4aa4445..fb751a7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## 0.6.0 + +* [MapQuest] Better MapQuest provider + ## 0.5.0 * Add special chain provider diff --git a/couscous.yml b/couscous.yml index 229fb28..3e88978 100644 --- a/couscous.yml +++ b/couscous.yml @@ -38,6 +38,9 @@ menu: mapbox: text: 📌️ Mapbox relativeUrl: docs/provider_usage/mapbox.html + mapquest: + text: 📌️ MapQuest + relativeUrl: docs/provider_usage/mapquest.html yandex: text: 📌️ Yandex relativeUrl: docs/provider_usage/yandex.html diff --git a/docs/provider_usage.md b/docs/provider_usage.md index ffcefa8..dfa96a4 100644 --- a/docs/provider_usage.md +++ b/docs/provider_usage.md @@ -7,5 +7,6 @@ Each provider has its own options, parameters or results because of its specific - [OpenCage](provider_usage/opencage.md) - [Google Maps (Geocoding API)](provider_usage/googlemaps.md) - [Mapbox](provider_usage/mapbox.md) +- [MapQuest](provider_usage/mapquest.md) - [Yandex](provider_usage/yandex.md) - [GeoPlugin](provider_usage/geoplugin.md) diff --git a/docs/provider_usage/mapquest.md b/docs/provider_usage/mapquest.md new file mode 100644 index 0000000..a6ec5f9 --- /dev/null +++ b/docs/provider_usage/mapquest.md @@ -0,0 +1,17 @@ +# MapQuest Usage + +## Options + +- `method` ("GET" or "POST", default: "GET"): the HTTP method to use when executing the query +- `openDomain` (default: false): boolean to use the Open Geocoding API (relies solely on data contributed to OpenStreetMap) + +## `geocode` parameters + +- `location`: use this parameter to use an advanced location. You can specify it using the MapQuest format or the Geocoded class or format. + +## `Geocoded` properties + +- `precision`: the quality of the geocoding result +- `precisionCode`: the quality code of the geocoding result +- `mapUrl`: the URL to a static map thumbnail image for the location being geocoded +- `attribution`: MapQuest copyright information diff --git a/example/node/mapquest.ts b/example/node/mapquest.ts index 95f1de3..77a6b67 100644 --- a/example/node/mapquest.ts +++ b/example/node/mapquest.ts @@ -1,9 +1,11 @@ /* eslint-disable no-console */ import UniversalGeocoder from "../../dist/UniversalGeocoder"; +import Geocoded from "../../dist/Geocoded"; +import { MapQuestGeocodeQuery, MapQuestLocation } from "../../dist/provider"; -const mapQuestGeocoder = UniversalGeocoder.createGeocoder({ +let mapQuestGeocoder = UniversalGeocoder.createGeocoder({ provider: "mapquest", - apiKey: "Fmjtd%7Cluurnu6al1%2Cbg%3Do5-9wbg94", + apiKey: "Fmjtd|luurnu6al1,bg=o5-9wbg94", }); mapQuestGeocoder.geocode( "1600 Pennsylvania Ave NW, Washington, DC", @@ -15,3 +17,45 @@ mapQuestGeocoder.geocode( mapQuestGeocoder.geodecode("44.915", "-93.21", (result) => { console.log(result); }); + +mapQuestGeocoder.geocode( + MapQuestGeocodeQuery.create({ + location: Geocoded.create({ + streetNumber: 1600, + streetName: "Pennsylvania Ave NW", + locality: "Washington", + }), + }), + (result) => { + console.log(result); + } +); + +mapQuestGeocoder = UniversalGeocoder.createGeocoder({ + provider: "mapquest", + apiKey: "Fmjtd|luurnu6al1,bg=o5-9wbg94", + method: "POST", + openDomain: true, +}); +mapQuestGeocoder.geocode( + "1600 Pennsylvania Ave NW, Washington, DC", + (result) => { + console.log(result); + } +); + +mapQuestGeocoder.geodecode("44.915", "-93.21", (result) => { + console.log(result); +}); + +mapQuestGeocoder.geocode( + MapQuestGeocodeQuery.create({ + location: MapQuestLocation.create({ + street: "1600 Pennsylvania Ave NW", + city: "Washington", + }), + }), + (result) => { + console.log(result); + } +); diff --git a/example/web/mapquest.html b/example/web/mapquest.html index f605c82..feb2c0d 100644 --- a/example/web/mapquest.html +++ b/example/web/mapquest.html @@ -4,7 +4,7 @@ Universal Geocoder: Mapquest Example diff --git a/package-lock.json b/package-lock.json index f70a737..e37a7be 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,19 +14,19 @@ } }, "@babel/core": { - "version": "7.11.4", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.11.4.tgz", - "integrity": "sha512-5deljj5HlqRXN+5oJTY7Zs37iH3z3b++KjiKtIsJy1NrjOOVSEaJHEetLBhyu0aQOSNNZ/0IuEAan9GzRuDXHg==", + "version": "7.11.6", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.11.6.tgz", + "integrity": "sha512-Wpcv03AGnmkgm6uS6k8iwhIwTrcP0m17TL1n1sy7qD0qelDu4XNeW0dN0mHfa+Gei211yDaLoEe/VlbXQzM4Bg==", "dev": true, "requires": { "@babel/code-frame": "^7.10.4", - "@babel/generator": "^7.11.4", + "@babel/generator": "^7.11.6", "@babel/helper-module-transforms": "^7.11.0", "@babel/helpers": "^7.10.4", - "@babel/parser": "^7.11.4", + "@babel/parser": "^7.11.5", "@babel/template": "^7.10.4", - "@babel/traverse": "^7.11.0", - "@babel/types": "^7.11.0", + "@babel/traverse": "^7.11.5", + "@babel/types": "^7.11.5", "convert-source-map": "^1.7.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.1", @@ -55,12 +55,12 @@ } }, "@babel/generator": { - "version": "7.11.4", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.11.4.tgz", - "integrity": "sha512-Rn26vueFx0eOoz7iifCN2UHT6rGtnkSGWSoDRIy8jZN3B91PzeSULbswfLoOWuTuAcNwpG/mxy+uCTDnZ9Mp1g==", + "version": "7.11.6", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.11.6.tgz", + "integrity": "sha512-DWtQ1PV3r+cLbySoHrwn9RWEgKMBLLma4OBQloPRyDYvc5msJM9kvTLo1YnlJd1P/ZuKbdli3ijr5q3FvAF3uA==", "dev": true, "requires": { - "@babel/types": "^7.11.0", + "@babel/types": "^7.11.5", "jsesc": "^2.5.1", "source-map": "^0.5.0" } @@ -239,9 +239,9 @@ } }, "@babel/parser": { - "version": "7.11.4", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.11.4.tgz", - "integrity": "sha512-MggwidiH+E9j5Sh8pbrX5sJvMcsqS5o+7iB42M9/k0CD63MjYbdP4nhSh7uB5wnv2/RVzTZFTxzF/kIa5mrCqA==", + "version": "7.11.5", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.11.5.tgz", + "integrity": "sha512-X9rD8qqm695vgmeaQ4fvz/o3+Wk4ZzQvSHkDBgpYKxpD4qTAUm88ZKtHkVqIOsYFFbIQ6wQYhC6q7pjqVK0E0Q==", "dev": true }, "@babel/runtime": { @@ -265,17 +265,17 @@ } }, "@babel/traverse": { - "version": "7.11.0", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.11.0.tgz", - "integrity": "sha512-ZB2V+LskoWKNpMq6E5UUCrjtDUh5IOTAyIl0dTjIEoXum/iKWkoIEKIRDnUucO6f+2FzNkE0oD4RLKoPIufDtg==", + "version": "7.11.5", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.11.5.tgz", + "integrity": "sha512-EjiPXt+r7LiCZXEfRpSJd+jUMnBd4/9OUv7Nx3+0u9+eimMwJmG0Q98lw4/289JCoxSE8OolDMNZaaF/JZ69WQ==", "dev": true, "requires": { "@babel/code-frame": "^7.10.4", - "@babel/generator": "^7.11.0", + "@babel/generator": "^7.11.5", "@babel/helper-function-name": "^7.10.4", "@babel/helper-split-export-declaration": "^7.11.0", - "@babel/parser": "^7.11.0", - "@babel/types": "^7.11.0", + "@babel/parser": "^7.11.5", + "@babel/types": "^7.11.5", "debug": "^4.1.0", "globals": "^11.1.0", "lodash": "^4.17.19" @@ -290,9 +290,9 @@ } }, "@babel/types": { - "version": "7.11.0", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.11.0.tgz", - "integrity": "sha512-O53yME4ZZI0jO1EVGtF1ePGl0LHirG4P1ibcD80XyzZcKhcMFeCXmh4Xb1ifGBIV233Qg12x4rBfQgA+tmOukA==", + "version": "7.11.5", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.11.5.tgz", + "integrity": "sha512-bvM7Qz6eKnJVFIn+1LPtjlBFPVN5jNDc1XmN15vWe7Q3DPBufWWsLiIvUu7xW87uTG6QoggpIDnUgLQvPheU+Q==", "dev": true, "requires": { "@babel/helper-validator-identifier": "^7.10.4", @@ -503,6 +503,32 @@ "integrity": "sha512-b7uumSfDI1guYnNc11BpkTZjiY7gC1DPedeUa0r+csd/1DiFyRo4oNOaxXHve0cC4NzaHaOHa0aPktWMTYJlVQ==", "dev": true }, + "@eslint/eslintrc": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.1.3.tgz", + "integrity": "sha512-4YVwPkANLeNtRjMekzux1ci8hIaH5eGKktGqR0d3LWsKNn5B2X/1Z6Trxy7jQXl9EBGE6Yj02O+t09FMeRllaA==", + "dev": true, + "requires": { + "ajv": "^6.12.4", + "debug": "^4.1.1", + "espree": "^7.3.0", + "globals": "^12.1.0", + "ignore": "^4.0.6", + "import-fresh": "^3.2.1", + "js-yaml": "^3.13.1", + "lodash": "^4.17.19", + "minimatch": "^3.0.4", + "strip-json-comments": "^3.1.1" + }, + "dependencies": { + "ignore": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", + "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", + "dev": true + } + } + }, "@istanbuljs/load-nyc-config": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz", @@ -532,12 +558,32 @@ "glob-to-regexp": "^0.3.0" } }, + "@nodelib/fs.scandir": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.3.tgz", + "integrity": "sha512-eGmwYQn3gxo4r7jdQnkrrN6bY478C3P+a/y72IJukF8LjB6ZHeB3c+Ehacj3sYeSmUXGlnA67/PmbM9CVwL7Dw==", + "dev": true, + "requires": { + "@nodelib/fs.stat": "2.0.3", + "run-parallel": "^1.1.9" + } + }, "@nodelib/fs.stat": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-1.1.3.tgz", - "integrity": "sha512-shAmDyaQC4H92APFoIaVDHCx5bStIocgvbwQyxPRrbUY20V1EYTbSDchWbuwlMG3V17cprZhA6+78JfB+3DTPw==", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.3.tgz", + "integrity": "sha512-bQBFruR2TAwoevBEd/NWMoAAtNGzTRgdrqnYCc7dhzfoNvqPzLyqlEQnzZ3kVnNrSp25iyxE00/3h2fqGAGArA==", "dev": true }, + "@nodelib/fs.walk": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.4.tgz", + "integrity": "sha512-1V9XOY4rDW0rehzbrcqAmHnz8e7SKvX27gh8Gt2WgB0+pdzdiLV83p72kZPU+jvMbS1qU5mauP2iOvO8rhmurQ==", + "dev": true, + "requires": { + "@nodelib/fs.scandir": "2.1.3", + "fastq": "^1.6.0" + } + }, "@pollyjs/adapter": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/@pollyjs/adapter/-/adapter-5.0.0.tgz", @@ -665,22 +711,16 @@ "integrity": "sha512-rr+OQyAjxze7GgWrSaJwydHStIhHq2lvY3BOC2Mj7KnzI7XK0Uw1TOOdI9lDoajEbSWLiYgoo4f1R51erQfhPQ==", "dev": true }, - "@types/eslint-visitor-keys": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@types/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz", - "integrity": "sha512-OCutwjDZ4aFS6PB1UZ988C4YgwlBHJd6wCeQqaLdmadZ/7e+w79+hbMUFC1QXDNCmdyoRfAFdm0RypzwR+Qpag==", - "dev": true - }, "@types/jasmine": { - "version": "3.5.13", - "resolved": "https://registry.npmjs.org/@types/jasmine/-/jasmine-3.5.13.tgz", - "integrity": "sha512-bVSrTEWdCNH2RHN+E0QlEr4pGPMRA6puKOmL/X13ZeZmUS0q12ZR1rkB9PVvJSX0zi/OXrMDNvUai+PC380+rQ==", + "version": "3.5.14", + "resolved": "https://registry.npmjs.org/@types/jasmine/-/jasmine-3.5.14.tgz", + "integrity": "sha512-Fkgk536sHPqcOtd+Ow+WiUNuk0TSo/BntKkF8wSvcd6M2FvPjeXcUE6Oz/bwDZiUZEaXLslAgw00Q94Pnx6T4w==", "dev": true }, "@types/json-schema": { - "version": "7.0.5", - "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.5.tgz", - "integrity": "sha512-7+2BITlgjgDhH0vvwZU/HZJVyk+2XUlvxXe8dFMedNX/aMkaOq++rMAFXc0tM7ij15QaWlbdQASBR9dihi+bDQ==", + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.6.tgz", + "integrity": "sha512-3c+yGKvVP5Y9TYBEibGNR+kLtijnj7mYrXRg+WpFb2X9xm04g/DXYkfg4hmzJQosc9snFNUPkbYIhu+KAm6jJw==", "dev": true }, "@types/json5": { @@ -696,9 +736,9 @@ "dev": true }, "@types/node": { - "version": "14.6.0", - "resolved": "https://registry.npmjs.org/@types/node/-/node-14.6.0.tgz", - "integrity": "sha512-mikldZQitV94akrc4sCcSjtJfsTKt4p+e/s0AGscVA6XArQ9kFclP+ZiYUMnq987rc6QlYxXv/EivqlfSLxpKA==", + "version": "14.6.4", + "resolved": "https://registry.npmjs.org/@types/node/-/node-14.6.4.tgz", + "integrity": "sha512-Wk7nG1JSaMfMpoMJDKUsWYugliB2Vy55pdjLpmLixeyMi7HizW2I/9QoxsPCkXl3dO+ZOVqPumKaDUv5zJu2uQ==", "dev": true }, "@types/normalize-package-data": { @@ -778,12 +818,13 @@ "dev": true }, "@typescript-eslint/eslint-plugin": { - "version": "3.9.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-3.9.1.tgz", - "integrity": "sha512-XIr+Mfv7i4paEdBf0JFdIl9/tVxyj+rlilWIfZ97Be0lZ7hPvUbS5iHt9Glc8kRI53dsr0PcAEudbf8rO2wGgg==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.0.1.tgz", + "integrity": "sha512-pQZtXupCn11O4AwpYVUX4PDFfmIJl90ZgrEBg0CEcqlwvPiG0uY81fimr1oMFblZnpKAq6prrT9a59pj1x58rw==", "dev": true, "requires": { - "@typescript-eslint/experimental-utils": "3.9.1", + "@typescript-eslint/experimental-utils": "4.0.1", + "@typescript-eslint/scope-manager": "4.0.1", "debug": "^4.1.1", "functional-red-black-tree": "^1.0.1", "regexpp": "^3.0.0", @@ -792,47 +833,57 @@ } }, "@typescript-eslint/experimental-utils": { - "version": "3.9.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-3.9.1.tgz", - "integrity": "sha512-lkiZ8iBBaYoyEKhCkkw4SAeatXyBq9Ece5bZXdLe1LWBUwTszGbmbiqmQbwWA8cSYDnjWXp9eDbXpf9Sn0hLAg==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-4.0.1.tgz", + "integrity": "sha512-gAqOjLiHoED79iYTt3F4uSHrYmg/GPz/zGezdB0jAdr6S6gwNiR/j7cTZ8nREKVzMVKLd9G3xbg1sV9GClW3sw==", "dev": true, "requires": { "@types/json-schema": "^7.0.3", - "@typescript-eslint/types": "3.9.1", - "@typescript-eslint/typescript-estree": "3.9.1", + "@typescript-eslint/scope-manager": "4.0.1", + "@typescript-eslint/types": "4.0.1", + "@typescript-eslint/typescript-estree": "4.0.1", "eslint-scope": "^5.0.0", "eslint-utils": "^2.0.0" } }, "@typescript-eslint/parser": { - "version": "3.9.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-3.9.1.tgz", - "integrity": "sha512-y5QvPFUn4Vl4qM40lI+pNWhTcOWtpZAJ8pOEQ21fTTW4xTJkRplMjMRje7LYTXqVKKX9GJhcyweMz2+W1J5bMg==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-4.0.1.tgz", + "integrity": "sha512-1+qLmXHNAWSQ7RB6fdSQszAiA7JTwzakj5cNYjBTUmpH2cqilxMZEIV+DRKjVZs8NzP3ALmKexB0w/ExjcK9Iw==", "dev": true, "requires": { - "@types/eslint-visitor-keys": "^1.0.0", - "@typescript-eslint/experimental-utils": "3.9.1", - "@typescript-eslint/types": "3.9.1", - "@typescript-eslint/typescript-estree": "3.9.1", - "eslint-visitor-keys": "^1.1.0" + "@typescript-eslint/scope-manager": "4.0.1", + "@typescript-eslint/types": "4.0.1", + "@typescript-eslint/typescript-estree": "4.0.1", + "debug": "^4.1.1" + } + }, + "@typescript-eslint/scope-manager": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-4.0.1.tgz", + "integrity": "sha512-u3YEXVJ8jsj7QCJk3om0Y457fy2euEOkkzxIB/LKU3MdyI+FJ2gI0M4aKEaXzwCSfNDiZ13a3lDo5DVozc+XLQ==", + "dev": true, + "requires": { + "@typescript-eslint/types": "4.0.1", + "@typescript-eslint/visitor-keys": "4.0.1" } }, "@typescript-eslint/types": { - "version": "3.9.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-3.9.1.tgz", - "integrity": "sha512-15JcTlNQE1BsYy5NBhctnEhEoctjXOjOK+Q+rk8ugC+WXU9rAcS2BYhoh6X4rOaXJEpIYDl+p7ix+A5U0BqPTw==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-4.0.1.tgz", + "integrity": "sha512-S+gD3fgbkZYW2rnbjugNMqibm9HpEjqZBZkTiI3PwbbNGWmAcxolWIUwZ0SKeG4Dy2ktpKKaI/6+HGYVH8Qrlg==", "dev": true }, "@typescript-eslint/typescript-estree": { - "version": "3.9.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-3.9.1.tgz", - "integrity": "sha512-IqM0gfGxOmIKPhiHW/iyAEXwSVqMmR2wJ9uXHNdFpqVvPaQ3dWg302vW127sBpAiqM9SfHhyS40NKLsoMpN2KA==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-4.0.1.tgz", + "integrity": "sha512-zGzleORFXrRWRJAMLTB2iJD1IZbCPkg4hsI8mGdpYlKaqzvKYSEWVAYh14eauaR+qIoZVWrXgYSXqLtTlxotiw==", "dev": true, "requires": { - "@typescript-eslint/types": "3.9.1", - "@typescript-eslint/visitor-keys": "3.9.1", + "@typescript-eslint/types": "4.0.1", + "@typescript-eslint/visitor-keys": "4.0.1", "debug": "^4.1.1", - "glob": "^7.1.6", + "globby": "^11.0.1", "is-glob": "^4.0.1", "lodash": "^4.17.15", "semver": "^7.3.2", @@ -840,12 +891,13 @@ } }, "@typescript-eslint/visitor-keys": { - "version": "3.9.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-3.9.1.tgz", - "integrity": "sha512-zxdtUjeoSh+prCpogswMwVUJfEFmCOjdzK9rpNjNBfm6EyPt99x3RrJoBOGZO23FCt0WPKUCOL5mb/9D5LjdwQ==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-4.0.1.tgz", + "integrity": "sha512-yBSqd6FjnTzbg5RUy9J+9kJEyQjTI34JdGMJz+9ttlJzLCnGkBikxw+N5n2VDcc3CesbIEJ0MnZc5uRYnrEnCw==", "dev": true, "requires": { - "eslint-visitor-keys": "^1.1.0" + "@typescript-eslint/types": "4.0.1", + "eslint-visitor-keys": "^2.0.0" } }, "@webassemblyjs/ast": { @@ -1246,6 +1298,12 @@ "is-string": "^1.0.5" } }, + "array-union": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", + "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", + "dev": true + }, "array-unique": { "version": "0.3.2", "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", @@ -1520,32 +1578,12 @@ } }, "braces": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", - "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", "dev": true, "requires": { - "arr-flatten": "^1.1.0", - "array-unique": "^0.3.2", - "extend-shallow": "^2.0.1", - "fill-range": "^4.0.0", - "isobject": "^3.0.1", - "repeat-element": "^1.1.2", - "snapdragon": "^0.8.1", - "snapdragon-node": "^2.0.1", - "split-string": "^3.0.2", - "to-regex": "^3.0.1" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - } + "fill-range": "^7.0.1" } }, "brorand": { @@ -1795,45 +1833,6 @@ "is-glob": "~4.0.1", "normalize-path": "~3.0.0", "readdirp": "~3.4.0" - }, - "dependencies": { - "braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", - "dev": true, - "optional": true, - "requires": { - "fill-range": "^7.0.1" - } - }, - "fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", - "dev": true, - "optional": true, - "requires": { - "to-regex-range": "^5.0.1" - } - }, - "is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "dev": true, - "optional": true - }, - "to-regex-range": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "dev": true, - "optional": true, - "requires": { - "is-number": "^7.0.0" - } - } } }, "chownr": { @@ -1988,9 +1987,9 @@ "dev": true }, "commander": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-5.1.0.tgz", - "integrity": "sha512-P0CysNDQ7rtVw4QIQtm+MRxV66vKFSvlsQvGYXZWR3qFU0jlMKHZZZgw8e+8DSah4UDKMqnknRDQz+xuQXQ/Zg==", + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-6.1.0.tgz", + "integrity": "sha512-wl7PNrYWd2y5mp1OK/LhTlv8Ff4kQJQRXXAvF+uU/TPNiVJUxZLRYGj/B0y/lPGAVcSbJqH2Za/cvHmrPMC8mA==", "dev": true }, "commondir": { @@ -2462,6 +2461,15 @@ } } }, + "dir-glob": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", + "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", + "dev": true, + "requires": { + "path-type": "^4.0.0" + } + }, "doctrine": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", @@ -2653,12 +2661,13 @@ "dev": true }, "eslint": { - "version": "7.7.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.7.0.tgz", - "integrity": "sha512-1KUxLzos0ZVsyL81PnRN335nDtQ8/vZUD6uMtWbF+5zDtjKcsklIi78XoE0MVL93QvWTu+E5y44VyyCsOMBrIg==", + "version": "7.8.1", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.8.1.tgz", + "integrity": "sha512-/2rX2pfhyUG0y+A123d0ccXtMm7DV7sH1m3lk9nk2DZ2LReq39FXHueR9xZwshE5MdfSf0xunSaMWRqyIA6M1w==", "dev": true, "requires": { "@babel/code-frame": "^7.0.0", + "@eslint/eslintrc": "^0.1.3", "ajv": "^6.10.0", "chalk": "^4.0.0", "cross-spawn": "^7.0.2", @@ -2668,7 +2677,7 @@ "eslint-scope": "^5.1.0", "eslint-utils": "^2.1.0", "eslint-visitor-keys": "^1.3.0", - "espree": "^7.2.0", + "espree": "^7.3.0", "esquery": "^1.2.0", "esutils": "^2.0.2", "file-entry-cache": "^5.0.1", @@ -2694,6 +2703,20 @@ "table": "^5.2.3", "text-table": "^0.2.0", "v8-compile-cache": "^2.0.3" + }, + "dependencies": { + "eslint-visitor-keys": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", + "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", + "dev": true + }, + "ignore": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", + "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", + "dev": true + } } }, "eslint-config-airbnb-base": { @@ -2752,9 +2775,9 @@ } }, "eslint-import-resolver-typescript": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/eslint-import-resolver-typescript/-/eslint-import-resolver-typescript-2.2.1.tgz", - "integrity": "sha512-wxlVdwuWY6R5+CoesIy6n8EZX4k9lEeZGWTVBoX9g//8Xma8JMtL/p3AGnG43rRyXmIrX+/0IN8lpOPzrw1fSw==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/eslint-import-resolver-typescript/-/eslint-import-resolver-typescript-2.3.0.tgz", + "integrity": "sha512-MHSXvmj5e0SGOOBhBbt7C+fWj1bJbtSYFAD85Xeg8nvUtuooTod2HQb8bfhE9f5QyyNxEfgzqOYFCvmdDIcCuw==", "dev": true, "requires": { "debug": "^4.1.1", @@ -2944,12 +2967,20 @@ "dev": true, "requires": { "eslint-visitor-keys": "^1.1.0" + }, + "dependencies": { + "eslint-visitor-keys": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", + "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", + "dev": true + } } }, "eslint-visitor-keys": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", - "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.0.0.tgz", + "integrity": "sha512-QudtT6av5WXels9WjIM7qz1XD1cWGvX4gGXvp/zBn9nXG02D0utdU3Em2m/QjTnrsk6bBjmCygl3rmj118msQQ==", "dev": true }, "espree": { @@ -2961,6 +2992,14 @@ "acorn": "^7.4.0", "acorn-jsx": "^5.2.0", "eslint-visitor-keys": "^1.3.0" + }, + "dependencies": { + "eslint-visitor-keys": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", + "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", + "dev": true + } } }, "esprima": { @@ -2987,12 +3026,20 @@ } }, "esrecurse": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.2.1.tgz", - "integrity": "sha512-64RBB++fIOAXPw3P9cy89qfMlvZEXZkqqJkjqqXIvzP5ezRZjW+lPWjw35UX/3EhUPFYbg5ER4JYgDw4007/DQ==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", "dev": true, "requires": { - "estraverse": "^4.1.0" + "estraverse": "^5.2.0" + }, + "dependencies": { + "estraverse": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz", + "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==", + "dev": true + } } }, "estraverse": { @@ -3014,9 +3061,9 @@ "dev": true }, "eventemitter3": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.5.tgz", - "integrity": "sha512-QR0rh0YiPuxuDQ6+T9GAO/xWTExXpxIes1Nl9RykNGTnE1HJmkuEfxJH9cubjIOQZ/GH4qNBR4u8VSHaKiWs4g==", + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz", + "integrity": "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==", "dev": true }, "events": { @@ -3271,40 +3318,17 @@ "dev": true }, "fast-glob": { - "version": "2.2.7", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-2.2.7.tgz", - "integrity": "sha512-g1KuQwHOZAmOZMuBtHdxDtju+T2RT8jgCC9aANsbpdiDDTSnjgfuVsIBNKbUeJI3oKMRExcfNDtJl4OhbffMsw==", + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.4.tgz", + "integrity": "sha512-kr/Oo6PX51265qeuCYsyGypiO5uJFgBS0jksyG7FUeCyQzNwYnzrNIMR1NXfkZXsMYXYLRAHgISHBz8gQcxKHQ==", "dev": true, "requires": { - "@mrmlnc/readdir-enhanced": "^2.2.1", - "@nodelib/fs.stat": "^1.1.2", - "glob-parent": "^3.1.0", - "is-glob": "^4.0.0", - "merge2": "^1.2.3", - "micromatch": "^3.1.10" - }, - "dependencies": { - "glob-parent": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz", - "integrity": "sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4=", - "dev": true, - "requires": { - "is-glob": "^3.1.0", - "path-dirname": "^1.0.0" - }, - "dependencies": { - "is-glob": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", - "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", - "dev": true, - "requires": { - "is-extglob": "^2.1.0" - } - } - } - } + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.0", + "merge2": "^1.3.0", + "micromatch": "^4.0.2", + "picomatch": "^2.2.1" } }, "fast-json-stable-stringify": { @@ -3319,6 +3343,15 @@ "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", "dev": true }, + "fastq": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.8.0.tgz", + "integrity": "sha512-SMIZoZdLh/fgofivvIkmknUXyPnvxRE3DhtZ5Me3Mrsk5gyPL42F0xr51TdRXskBxHfMp+07bcYzfsYEsSQA9Q==", + "dev": true, + "requires": { + "reusify": "^1.0.4" + } + }, "figgy-pudding": { "version": "3.5.2", "resolved": "https://registry.npmjs.org/figgy-pudding/-/figgy-pudding-3.5.2.tgz", @@ -3344,26 +3377,12 @@ } }, "fill-range": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", - "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", "dev": true, "requires": { - "extend-shallow": "^2.0.1", - "is-number": "^3.0.0", - "repeat-string": "^1.6.1", - "to-regex-range": "^2.1.0" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - } + "to-regex-range": "^5.0.1" } }, "finalhandler": { @@ -3449,6 +3468,111 @@ "is-glob": "^4.0.0", "micromatch": "^3.0.4", "resolve-dir": "^1.0.1" + }, + "dependencies": { + "braces": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", + "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", + "dev": true, + "requires": { + "arr-flatten": "^1.1.0", + "array-unique": "^0.3.2", + "extend-shallow": "^2.0.1", + "fill-range": "^4.0.0", + "isobject": "^3.0.1", + "repeat-element": "^1.1.2", + "snapdragon": "^0.8.1", + "snapdragon-node": "^2.0.1", + "split-string": "^3.0.2", + "to-regex": "^3.0.1" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "fill-range": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", + "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", + "dev": true, + "requires": { + "extend-shallow": "^2.0.1", + "is-number": "^3.0.0", + "repeat-string": "^1.6.1", + "to-regex-range": "^2.1.0" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "is-number": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "micromatch": { + "version": "3.1.10", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", + "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", + "dev": true, + "requires": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "braces": "^2.3.1", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "extglob": "^2.0.4", + "fragment-cache": "^0.2.1", + "kind-of": "^6.0.2", + "nanomatch": "^1.2.9", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.2" + } + }, + "to-regex-range": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", + "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", + "dev": true, + "requires": { + "is-number": "^3.0.0", + "repeat-string": "^1.6.1" + } + } } }, "flat-cache": { @@ -3754,6 +3878,20 @@ } } }, + "globby": { + "version": "11.0.1", + "resolved": "https://registry.npmjs.org/globby/-/globby-11.0.1.tgz", + "integrity": "sha512-iH9RmgwCmUJHi2z5o2l3eTtGBtXek1OYlHrbcxOYugyHLmAsZrPj43OtHThd62Buh/Vv6VyCBD2bdyWcGNQqoQ==", + "dev": true, + "requires": { + "array-union": "^2.1.0", + "dir-glob": "^3.0.1", + "fast-glob": "^3.1.1", + "ignore": "^5.1.4", + "merge2": "^1.3.0", + "slash": "^3.0.0" + } + }, "graceful-fs": { "version": "4.2.4", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz", @@ -3808,6 +3946,26 @@ "kind-of": "^4.0.0" }, "dependencies": { + "is-number": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, "kind-of": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", @@ -4058,9 +4216,9 @@ "dev": true }, "ignore": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", - "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", + "version": "5.1.8", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.1.8.tgz", + "integrity": "sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw==", "dev": true }, "import-fresh": { @@ -4315,24 +4473,10 @@ } }, "is-number": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", - "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", - "dev": true, - "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true }, "is-obj": { "version": "2.0.0", @@ -4554,6 +4698,152 @@ "requires": { "fast-glob": "^2.2.6", "jasmine-core": "~3.6.0" + }, + "dependencies": { + "@nodelib/fs.stat": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-1.1.3.tgz", + "integrity": "sha512-shAmDyaQC4H92APFoIaVDHCx5bStIocgvbwQyxPRrbUY20V1EYTbSDchWbuwlMG3V17cprZhA6+78JfB+3DTPw==", + "dev": true + }, + "braces": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", + "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", + "dev": true, + "requires": { + "arr-flatten": "^1.1.0", + "array-unique": "^0.3.2", + "extend-shallow": "^2.0.1", + "fill-range": "^4.0.0", + "isobject": "^3.0.1", + "repeat-element": "^1.1.2", + "snapdragon": "^0.8.1", + "snapdragon-node": "^2.0.1", + "split-string": "^3.0.2", + "to-regex": "^3.0.1" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "fast-glob": { + "version": "2.2.7", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-2.2.7.tgz", + "integrity": "sha512-g1KuQwHOZAmOZMuBtHdxDtju+T2RT8jgCC9aANsbpdiDDTSnjgfuVsIBNKbUeJI3oKMRExcfNDtJl4OhbffMsw==", + "dev": true, + "requires": { + "@mrmlnc/readdir-enhanced": "^2.2.1", + "@nodelib/fs.stat": "^1.1.2", + "glob-parent": "^3.1.0", + "is-glob": "^4.0.0", + "merge2": "^1.2.3", + "micromatch": "^3.1.10" + } + }, + "fill-range": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", + "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", + "dev": true, + "requires": { + "extend-shallow": "^2.0.1", + "is-number": "^3.0.0", + "repeat-string": "^1.6.1", + "to-regex-range": "^2.1.0" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "glob-parent": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz", + "integrity": "sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4=", + "dev": true, + "requires": { + "is-glob": "^3.1.0", + "path-dirname": "^1.0.0" + }, + "dependencies": { + "is-glob": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", + "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", + "dev": true, + "requires": { + "is-extglob": "^2.1.0" + } + } + } + }, + "is-number": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "micromatch": { + "version": "3.1.10", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", + "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", + "dev": true, + "requires": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "braces": "^2.3.1", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "extglob": "^2.0.4", + "fragment-cache": "^0.2.1", + "kind-of": "^6.0.2", + "nanomatch": "^1.2.9", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.2" + } + }, + "to-regex-range": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", + "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", + "dev": true, + "requires": { + "is-number": "^3.0.0", + "repeat-string": "^1.6.1" + } + } } }, "jasmine-core": { @@ -4600,9 +4890,9 @@ "dev": true }, "json-parse-even-better-errors": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.0.tgz", - "integrity": "sha512-o3aP+RsWDJZayj1SbHNQAI8x0v3T3SKiGoZlNYfbUP1S3omJQ6i9CnqADqkSPaOAxwua4/1YWx5CM7oiChJt2Q==", + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", + "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", "dev": true }, "json-schema-traverse": { @@ -4671,90 +4961,32 @@ "dev": true }, "lint-staged": { - "version": "10.2.11", - "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-10.2.11.tgz", - "integrity": "sha512-LRRrSogzbixYaZItE2APaS4l2eJMjjf5MbclRZpLJtcQJShcvUzKXsNeZgsLIZ0H0+fg2tL4B59fU9wHIHtFIA==", + "version": "10.3.0", + "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-10.3.0.tgz", + "integrity": "sha512-an3VgjHqmJk0TORB/sdQl0CTkRg4E5ybYCXTTCSJ5h9jFwZbcgKIx5oVma5e7wp/uKt17s1QYFmYqT9MGVosGw==", "dev": true, "requires": { - "chalk": "^4.0.0", - "cli-truncate": "2.1.0", - "commander": "^5.1.0", - "cosmiconfig": "^6.0.0", + "chalk": "^4.1.0", + "cli-truncate": "^2.1.0", + "commander": "^6.0.0", + "cosmiconfig": "^7.0.0", "debug": "^4.1.1", "dedent": "^0.7.0", - "enquirer": "^2.3.5", - "execa": "^4.0.1", - "listr2": "^2.1.0", + "enquirer": "^2.3.6", + "execa": "^4.0.3", + "listr2": "^2.6.0", "log-symbols": "^4.0.0", "micromatch": "^4.0.2", "normalize-path": "^3.0.0", "please-upgrade-node": "^3.2.0", "string-argv": "0.3.1", "stringify-object": "^3.3.0" - }, - "dependencies": { - "braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", - "dev": true, - "requires": { - "fill-range": "^7.0.1" - } - }, - "cosmiconfig": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-6.0.0.tgz", - "integrity": "sha512-xb3ZL6+L8b9JLLCx3ZdoZy4+2ECphCMo2PwqgP1tlfVq6M6YReyzBJtvWWtbDSpNr9hn96pkCiZqUcFEc+54Qg==", - "dev": true, - "requires": { - "@types/parse-json": "^4.0.0", - "import-fresh": "^3.1.0", - "parse-json": "^5.0.0", - "path-type": "^4.0.0", - "yaml": "^1.7.2" - } - }, - "fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", - "dev": true, - "requires": { - "to-regex-range": "^5.0.1" - } - }, - "is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "dev": true - }, - "micromatch": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.2.tgz", - "integrity": "sha512-y7FpHSbMUMoyPbYUSzO6PaZ6FyRnQOpHuKwbo1G+Knck95XVU4QAiKdGEnj5wwoS7PlOgthX/09u5iFJ+aYf5Q==", - "dev": true, - "requires": { - "braces": "^3.0.1", - "picomatch": "^2.0.5" - } - }, - "to-regex-range": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "dev": true, - "requires": { - "is-number": "^7.0.0" - } - } } }, "listr2": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/listr2/-/listr2-2.6.0.tgz", - "integrity": "sha512-nwmqTJYQQ+AsKb4fCXH/6/UmLCEDL1jkRAdSn9M6cEUzoRGrs33YD/3N86gAZQnGZ6hxV18XSdlBcJ1GTmetJA==", + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/listr2/-/listr2-2.6.2.tgz", + "integrity": "sha512-6x6pKEMs8DSIpA/tixiYY2m/GcbgMplMVmhQAaLFxEtNSKLeWTGjtmU57xvv6QCm2XcqzyNXL/cTSVf4IChCRA==", "dev": true, "requires": { "chalk": "^4.1.0", @@ -4980,9 +5212,9 @@ } }, "meow": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/meow/-/meow-7.1.0.tgz", - "integrity": "sha512-kq5F0KVteskZ3JdfyQFivJEj2RaA8NFsS4+r9DaMKLcUHpk5OcHS3Q0XkCXONB1mZRPsu/Y/qImKri0nwSEZog==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/meow/-/meow-7.1.1.tgz", + "integrity": "sha512-GWHvA5QOcS412WCo8vwKDlTelGLsCGBVevQB5Kva961rmNfun0PCbv5+xta2kUMFJyR8/oWnn7ddeKdosbAPbA==", "dev": true, "requires": { "@types/minimist": "^1.2.0", @@ -5023,24 +5255,13 @@ "dev": true }, "micromatch": { - "version": "3.1.10", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", - "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.2.tgz", + "integrity": "sha512-y7FpHSbMUMoyPbYUSzO6PaZ6FyRnQOpHuKwbo1G+Knck95XVU4QAiKdGEnj5wwoS7PlOgthX/09u5iFJ+aYf5Q==", "dev": true, "requires": { - "arr-diff": "^4.0.0", - "array-unique": "^0.3.2", - "braces": "^2.3.1", - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "extglob": "^2.0.4", - "fragment-cache": "^0.2.1", - "kind-of": "^6.0.2", - "nanomatch": "^1.2.9", - "object.pick": "^1.3.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.2" + "braces": "^3.0.1", + "picomatch": "^2.0.5" } }, "miller-rabin": { @@ -5594,9 +5815,9 @@ "dev": true }, "opener": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/opener/-/opener-1.5.1.tgz", - "integrity": "sha512-goYSy5c2UXE4Ra1xixabeVh1guIX/ZV/YokJksb6q2lubWu6UbvPQ20p542/sFIll1nl8JnCyK9oBaOcCWXwvA==", + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/opener/-/opener-1.5.2.tgz", + "integrity": "sha512-ur5UIdyw5Y7yEj9wLzhqXiy6GZ3Mwx0yGI+5sMn2r0N0v3cKJvUmFH5yPP+WXh9e0xfyzyJX95D8l088DNFj7A==", "dev": true }, "optionator": { @@ -5910,9 +6131,9 @@ "dev": true }, "prettier": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.0.5.tgz", - "integrity": "sha512-7PtVymN48hGcO4fGjybyBSIWDsLU4H4XlvOHfq91pz9kkGlonzwTfYkaIEwiRg/dAJF9YlbsduBAgtYLi+8cFg==", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.1.1.tgz", + "integrity": "sha512-9bY+5ZWCfqj3ghYBLxApy2zf6m+NJo5GzmLTpr9FsApsfjriNnS2dahWReHMi7qNPhhHl9SYHJs2cHZLgexNIw==", "dev": true }, "prettier-linter-helpers": { @@ -6341,6 +6562,12 @@ "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==", "dev": true }, + "reusify": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "dev": true + }, "rimraf": { "version": "2.6.3", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", @@ -6366,6 +6593,12 @@ "integrity": "sha512-2+MhsfPhvauN1O8KaXpXAOfR/fwe8dnUXVM+xw7yt40lJRfPVQxV6yryZm0cgRvAj5fMF/mdRZbL2ptwbs5i2g==", "dev": true }, + "run-parallel": { + "version": "1.1.9", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.1.9.tgz", + "integrity": "sha512-DEqnSRTDw/Tc3FXf49zedI638Z9onwUotBMiUFKmrO2sdFKIbXamXGQ3Axd4qgphxKB4kw/qP1w5kTxnfU1B9Q==", + "dev": true + }, "run-queue": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/run-queue/-/run-queue-1.0.3.tgz", @@ -7096,9 +7329,9 @@ "dev": true }, "supports-color": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz", - "integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==", + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, "requires": { "has-flag": "^4.0.0" @@ -7381,13 +7614,12 @@ } }, "to-regex-range": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", - "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", "dev": true, "requires": { - "is-number": "^3.0.0", - "repeat-string": "^1.6.1" + "is-number": "^7.0.0" } }, "toidentifier": { @@ -7409,9 +7641,9 @@ "dev": true }, "ts-loader": { - "version": "8.0.2", - "resolved": "https://registry.npmjs.org/ts-loader/-/ts-loader-8.0.2.tgz", - "integrity": "sha512-oYT7wOTUawYXQ8XIDsRhziyW0KUEV38jISYlE+9adP6tDtG+O5GkRe4QKQXrHVH4mJJ88DysvEtvGP65wMLlhg==", + "version": "8.0.3", + "resolved": "https://registry.npmjs.org/ts-loader/-/ts-loader-8.0.3.tgz", + "integrity": "sha512-wsqfnVdB7xQiqhqbz2ZPLGHLPZbHVV5Qn/MNFZkCFxRU1miDyxKORucDGxKtsQJ63Rfza0udiUxWF5nHY6bpdQ==", "dev": true, "requires": { "chalk": "^2.3.0", @@ -7430,15 +7662,6 @@ "color-convert": "^1.9.0" } }, - "braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", - "dev": true, - "requires": { - "fill-range": "^7.0.1" - } - }, "chalk": { "version": "2.4.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", @@ -7465,37 +7688,12 @@ "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", "dev": true }, - "fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", - "dev": true, - "requires": { - "to-regex-range": "^5.0.1" - } - }, "has-flag": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", "dev": true }, - "is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "dev": true - }, - "micromatch": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.2.tgz", - "integrity": "sha512-y7FpHSbMUMoyPbYUSzO6PaZ6FyRnQOpHuKwbo1G+Knck95XVU4QAiKdGEnj5wwoS7PlOgthX/09u5iFJ+aYf5Q==", - "dev": true, - "requires": { - "braces": "^3.0.1", - "picomatch": "^2.0.5" - } - }, "semver": { "version": "6.3.0", "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", @@ -7510,15 +7708,6 @@ "requires": { "has-flag": "^3.0.0" } - }, - "to-regex-range": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "dev": true, - "requires": { - "is-number": "^7.0.0" - } } } }, @@ -7569,12 +7758,12 @@ "dev": true }, "ttypescript": { - "version": "1.5.10", - "resolved": "https://registry.npmjs.org/ttypescript/-/ttypescript-1.5.10.tgz", - "integrity": "sha512-Hk7TRej1hM+p+Fo+Pyb/XK9pe9CAt3Sh5n5YRutxFS8hUgkh2u1Vd2K40kMcNP3WYhiVFBMqXwM/2E8O95Ep6g==", + "version": "1.5.11", + "resolved": "https://registry.npmjs.org/ttypescript/-/ttypescript-1.5.11.tgz", + "integrity": "sha512-sN7WE3Gnty0Wbs+AfSeXOaG2zYWw0/ghtlGftutidgwaZwEC8/Lg6yHiYFlqc6DEYynxrRPvU7UkNloygdCQVQ==", "dev": true, "requires": { - "resolve": "^1.9.0" + "resolve": ">=1.9.0" } }, "type-check": { @@ -7722,9 +7911,9 @@ "optional": true }, "uri-js": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz", - "integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.0.tgz", + "integrity": "sha512-B0yRTzYdUCCn9n+F4+Gh4yIDtMQcaJsmYBDsTSG8g/OejKBodLQ2IHfN3bM7jUsRXndopT7OIXWdYqc1fjmV6g==", "dev": true, "requires": { "punycode": "^2.1.0" @@ -7897,6 +8086,37 @@ "dev": true, "optional": true }, + "braces": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", + "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", + "dev": true, + "optional": true, + "requires": { + "arr-flatten": "^1.1.0", + "array-unique": "^0.3.2", + "extend-shallow": "^2.0.1", + "fill-range": "^4.0.0", + "isobject": "^3.0.1", + "repeat-element": "^1.1.2", + "snapdragon": "^0.8.1", + "snapdragon-node": "^2.0.1", + "split-string": "^3.0.2", + "to-regex": "^3.0.1" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "optional": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, "chokidar": { "version": "2.1.8", "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-2.1.8.tgz", @@ -7918,6 +8138,31 @@ "upath": "^1.1.1" } }, + "fill-range": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", + "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", + "dev": true, + "optional": true, + "requires": { + "extend-shallow": "^2.0.1", + "is-number": "^3.0.0", + "repeat-string": "^1.6.1", + "to-regex-range": "^2.1.0" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "optional": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, "fsevents": { "version": "1.2.13", "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.13.tgz", @@ -7958,6 +8203,50 @@ "binary-extensions": "^1.0.0" } }, + "is-number": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", + "dev": true, + "optional": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "optional": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "micromatch": { + "version": "3.1.10", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", + "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", + "dev": true, + "optional": true, + "requires": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "braces": "^2.3.1", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "extglob": "^2.0.4", + "fragment-cache": "^0.2.1", + "kind-of": "^6.0.2", + "nanomatch": "^1.2.9", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.2" + } + }, "readdirp": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-2.2.1.tgz", @@ -7969,6 +8258,17 @@ "micromatch": "^3.1.10", "readable-stream": "^2.0.2" } + }, + "to-regex-range": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", + "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", + "dev": true, + "optional": true, + "requires": { + "is-number": "^3.0.0", + "repeat-string": "^1.6.1" + } } } }, @@ -8009,6 +8309,35 @@ "integrity": "sha512-ZVA9k326Nwrj3Cj9jlh3wGFutC2ZornPNARZwsNYqQYgN0EsV2d53w5RN/co65Ohn4sUAUtb1rSUAOD6XN9idA==", "dev": true }, + "braces": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", + "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", + "dev": true, + "requires": { + "arr-flatten": "^1.1.0", + "array-unique": "^0.3.2", + "extend-shallow": "^2.0.1", + "fill-range": "^4.0.0", + "isobject": "^3.0.1", + "repeat-element": "^1.1.2", + "snapdragon": "^0.8.1", + "snapdragon-node": "^2.0.1", + "split-string": "^3.0.2", + "to-regex": "^3.0.1" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, "eslint-scope": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-4.0.3.tgz", @@ -8019,6 +8348,49 @@ "estraverse": "^4.1.1" } }, + "fill-range": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", + "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", + "dev": true, + "requires": { + "extend-shallow": "^2.0.1", + "is-number": "^3.0.0", + "repeat-string": "^1.6.1", + "to-regex-range": "^2.1.0" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "is-number": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, "memory-fs": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/memory-fs/-/memory-fs-0.4.1.tgz", @@ -8028,6 +8400,37 @@ "errno": "^0.1.3", "readable-stream": "^2.0.1" } + }, + "micromatch": { + "version": "3.1.10", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", + "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", + "dev": true, + "requires": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "braces": "^2.3.1", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "extglob": "^2.0.4", + "fragment-cache": "^0.2.1", + "kind-of": "^6.0.2", + "nanomatch": "^1.2.9", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.2" + } + }, + "to-regex-range": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", + "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", + "dev": true, + "requires": { + "is-number": "^3.0.0", + "repeat-string": "^1.6.1" + } } } }, @@ -8285,9 +8688,9 @@ } }, "webpack-merge": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/webpack-merge/-/webpack-merge-5.1.2.tgz", - "integrity": "sha512-/slG0Kh0OKTf0zxdFJlhQHzv8bU9gUYVK5DkBjB3i/yoc1Xx4ADG0KITGO5S/6cqn2Ug43+8VR6Sz8daA/c+5g==", + "version": "5.1.3", + "resolved": "https://registry.npmjs.org/webpack-merge/-/webpack-merge-5.1.3.tgz", + "integrity": "sha512-fz/xHgfHyxq3uzGGrMryPnpPZ6x3vF1tHtws6vYwYX+8e6Dw+4U4r6rXuEPCqtSwmUIeD8hniWwFem+5FVLjzg==", "dev": true, "requires": { "clone-deep": "^4.0.1", diff --git a/package.json b/package.json index 617f3a2..0c7154a 100644 --- a/package.json +++ b/package.json @@ -51,8 +51,8 @@ "@types/pollyjs__utils": "^2.6.0", "@types/setup-polly-jest": "^0.5.0", "@types/webpack-env": "^1.15.0", - "@typescript-eslint/eslint-plugin": "^3.2.0", - "@typescript-eslint/parser": "^3.2.0", + "@typescript-eslint/eslint-plugin": "^4.0.0", + "@typescript-eslint/parser": "^4.0.0", "@zerollup/ts-transform-paths": "^1.7.0", "eslint": "^7.0.0", "eslint-config-airbnb-base": "^14.0.0", diff --git a/spec/provider/MapQuestProvider.spec.ts b/spec/provider/MapQuestProvider.spec.ts new file mode 100644 index 0000000..162fdf7 --- /dev/null +++ b/spec/provider/MapQuestProvider.spec.ts @@ -0,0 +1,260 @@ +import UniversalGeocoder from "UniversalGeocoder"; +import { MapQuestGeocoded, MapQuestProvider } from "provider"; +import ExternalLoader from "ExternalLoader"; +import AdminLevel from "AdminLevel"; +import setupPolly, { cleanRecording } from "../setupPolly"; + +describe("MapQuest Geocoder Provider", () => { + const pollyContext = setupPolly(); + + beforeEach(() => { + cleanRecording(pollyContext); + }); + + afterEach(async () => { + await pollyContext.polly.flush(); + }); + + it("expects API Key to be required on initiation", () => { + expect(() => new MapQuestProvider(new ExternalLoader())).toThrowError( + Error, + 'An API key is required for the MapQuest provider. Please add it in the "apiKey" option.' + ); + }); + + it("expects to not support IP geolocation", () => { + const provider = UniversalGeocoder.createGeocoder({ + provider: "mapquest", + useSsl: true, + apiKey: "api_key", + }); + + expect(() => + provider?.geocode( + "66.147.244.214", + // eslint-disable-next-line @typescript-eslint/no-empty-function + () => {} + ) + ).toThrowError( + Error, + "The MapQuest provider does not support IP geolocation, only location geocoding." + ); + }); + + it("receives correct geocoding results", (done) => { + const provider = UniversalGeocoder.createGeocoder({ + provider: "mapquest", + useSsl: true, + apiKey: "api_key", + }); + + provider?.geocode( + "1600 Pennsylvania Ave, Washington, DC", + (results: MapQuestGeocoded[]) => { + const geocoded = results[0]; + + expect(geocoded).toBeDefined(); + expect(geocoded.getCoordinates()).toEqual([38.895206, -77.036515]); + expect(geocoded.getBounds()).toEqual([ + undefined, + undefined, + undefined, + undefined, + ]); + expect(geocoded.getFormattedAddress()).toEqual(undefined); + expect(geocoded.getStreetNumber()).toEqual(undefined); + expect(geocoded.getStreetName()).toEqual("1600 Pennsylvania Ave"); + expect(geocoded.getSubLocality()).toEqual(""); + expect(geocoded.getLocality()).toEqual("Washington"); + expect(geocoded.getPostalCode()).toEqual(""); + expect(geocoded.getRegion()).toEqual("District Of Columbia"); + expect(geocoded.getAdminLevels()).toEqual([ + AdminLevel.create({ level: 1, name: "DC", code: "DC" }), + AdminLevel.create({ level: 2, name: "District Of Columbia" }), + ]); + expect(geocoded.getCountry()).toEqual("US"); + expect(geocoded.getCountryCode()).toEqual("US"); + expect(geocoded.getPrecision()).toEqual("POINT"); + expect(geocoded.getPrecisionCode()).toEqual("P1AAA"); + expect(geocoded.getMapUrl()).toEqual( + "http://www.mapquestapi.com/staticmap/v5/map?type=map&size=225,160&locations=38.895206,-77.036515|marker-sm-50318A-1&scalebar=true&zoom=15&rand=1195279033" + ); + expect(geocoded.getAttribution()).toEqual("© 2020 MapQuest, Inc."); + + done(); + } + ); + }); + + it("receives correct geocoding results using POST and open domain", (done) => { + const provider = UniversalGeocoder.createGeocoder({ + provider: "mapquest", + useSsl: true, + apiKey: "api_key", + method: "POST", + openDomain: true, + }); + + provider?.geocode( + "1600 Pennsylvania Ave, Washington, DC", + (results: MapQuestGeocoded[]) => { + const geocoded = results[0]; + + expect(geocoded).toBeDefined(); + expect(geocoded.getCoordinates()).toEqual([38.895854, -77.030713]); + expect(geocoded.getBounds()).toEqual([ + undefined, + undefined, + undefined, + undefined, + ]); + expect(geocoded.getFormattedAddress()).toEqual(undefined); + expect(geocoded.getStreetNumber()).toEqual(undefined); + expect(geocoded.getStreetName()).toEqual(""); + expect(geocoded.getSubLocality()).toEqual("Penn Quarter"); + expect(geocoded.getLocality()).toEqual("Washington"); + expect(geocoded.getPostalCode()).toEqual("20006"); + expect(geocoded.getRegion()).toEqual(""); + expect(geocoded.getAdminLevels()).toEqual([ + AdminLevel.create({ level: 1, name: "District of Columbia" }), + ]); + expect(geocoded.getCountry()).toEqual("US"); + expect(geocoded.getCountryCode()).toEqual("US"); + expect(geocoded.getPrecision()).toEqual("STREET"); + expect(geocoded.getPrecisionCode()).toEqual("B1XAX"); + expect(geocoded.getMapUrl()).toEqual( + "http://open.mapquestapi.com/staticmap/v5/map?type=map&size=225,160&locations=38.8958536,-77.0307129|marker-sm-50318A-1&scalebar=true&zoom=15&rand=942576975" + ); + expect(geocoded.getAttribution()).toEqual("© 2020 MapQuest, Inc."); + + done(); + } + ); + }); + + it("receives correct geodecoding results", (done) => { + const provider = UniversalGeocoder.createGeocoder({ + provider: "mapquest", + useSsl: true, + apiKey: "api_key", + }); + + provider?.geodecode(48.8631507, 2.388911, (results: MapQuestGeocoded[]) => { + const geocoded = results[0]; + + expect(geocoded).toBeDefined(); + expect(geocoded.getCoordinates()).toEqual([48.863116, 2.38878]); + expect(geocoded.getBounds()).toEqual([ + undefined, + undefined, + undefined, + undefined, + ]); + expect(geocoded.getFormattedAddress()).toEqual(undefined); + expect(geocoded.getStreetNumber()).toEqual(undefined); + expect(geocoded.getStreetName()).toEqual("8 Avenue Gambetta"); + expect(geocoded.getSubLocality()).toEqual(""); + expect(geocoded.getLocality()).toEqual("Paris"); + expect(geocoded.getPostalCode()).toEqual("75020"); + expect(geocoded.getRegion()).toEqual(""); + expect(geocoded.getAdminLevels()).toEqual([ + AdminLevel.create({ level: 1, name: "Ile-de-France" }), + ]); + expect(geocoded.getCountry()).toEqual("FR"); + expect(geocoded.getCountryCode()).toEqual("FR"); + expect(geocoded.getPrecision()).toEqual("POINT"); + expect(geocoded.getPrecisionCode()).toEqual("P1AAA"); + expect(geocoded.getMapUrl()).toEqual( + "http://www.mapquestapi.com/staticmap/v5/map?type=map&size=225,160&locations=48.8631163,2.38878|marker-sm-50318A-1&scalebar=true&zoom=15&rand=1980906355" + ); + expect(geocoded.getAttribution()).toEqual("© 2020 MapQuest, Inc."); + + done(); + }); + }); + + it("receives correct geodecoding results using POST and open domain", (done) => { + const provider = UniversalGeocoder.createGeocoder({ + provider: "mapquest", + useSsl: true, + apiKey: "api_key", + method: "POST", + openDomain: true, + }); + + provider?.geodecode(48.8631507, 2.388911, (results: MapQuestGeocoded[]) => { + const geocoded = results[0]; + + expect(geocoded).toBeDefined(); + expect(geocoded.getCoordinates()).toEqual([48.863116, 2.38878]); + expect(geocoded.getBounds()).toEqual([ + undefined, + undefined, + undefined, + undefined, + ]); + expect(geocoded.getFormattedAddress()).toEqual(undefined); + expect(geocoded.getStreetNumber()).toEqual(undefined); + expect(geocoded.getStreetName()).toEqual("8 Avenue Gambetta"); + expect(geocoded.getSubLocality()).toEqual(""); + expect(geocoded.getLocality()).toEqual("Paris"); + expect(geocoded.getPostalCode()).toEqual("75020"); + expect(geocoded.getRegion()).toEqual(""); + expect(geocoded.getAdminLevels()).toEqual([ + AdminLevel.create({ level: 1, name: "Ile-de-France" }), + ]); + expect(geocoded.getCountry()).toEqual("FR"); + expect(geocoded.getCountryCode()).toEqual("FR"); + expect(geocoded.getPrecision()).toEqual("POINT"); + expect(geocoded.getPrecisionCode()).toEqual("P1AAA"); + expect(geocoded.getMapUrl()).toEqual( + "http://open.mapquestapi.com/staticmap/v5/map?type=map&size=225,160&locations=48.8631163,2.38878|marker-sm-50318A-1&scalebar=true&zoom=15&rand=-1000393223" + ); + expect(geocoded.getAttribution()).toEqual("© 2020 MapQuest, Inc."); + + done(); + }); + }); + + it("receives error when parameters are missing", (done) => { + const provider = UniversalGeocoder.createGeocoder({ + provider: "mapquest", + useSsl: true, + apiKey: "api_key", + }); + + provider?.geocode( + { location: {} }, + () => { + done(); + }, + (error) => { + expect(error.message).toEqual( + "An error has occurred (400): Illegal argument from request: Insufficient info for location" + ); + done(); + } + ); + }); + + it("receives error when the API key is bad", (done) => { + const provider = UniversalGeocoder.createGeocoder({ + provider: "mapquest", + useSsl: true, + apiKey: "api_key", + }); + + provider?.geocode( + "1600 Pennsylvania Ave, Washington, DC", + () => { + done(); + }, + (error) => { + expect(error.message).toEqual( + "Received HTTP status code 403 when attempting geocoding request." + ); + done(); + } + ); + }); +}); diff --git a/spec/provider/MapquestProvider.spec.ts b/spec/provider/MapquestProvider.spec.ts deleted file mode 100644 index 0e7949b..0000000 --- a/spec/provider/MapquestProvider.spec.ts +++ /dev/null @@ -1,133 +0,0 @@ -import UniversalGeocoder from "UniversalGeocoder"; -import { MapquestProvider } from "provider"; -import ExternalLoader from "ExternalLoader"; -import Geocoded from "Geocoded"; -import setupPolly, { cleanRecording } from "../setupPolly"; - -describe("MapQuest Geocoder Provider", () => { - const pollyContext = setupPolly(); - - beforeEach(() => { - cleanRecording(pollyContext); - }); - - afterEach(async () => { - await pollyContext.polly.flush(); - }); - - it("expects API Key to be required on initiation", () => { - expect(() => new MapquestProvider(new ExternalLoader())).toThrowError( - Error, - 'An API key is required for the MapQuest provider. Please add it in the "apiKey" option.' - ); - }); - - it("expects to not support IP geolocation", () => { - const provider = UniversalGeocoder.createGeocoder({ - provider: "mapquest", - useSsl: true, - apiKey: "api_key", - }); - - expect(() => - provider?.geocode( - "66.147.244.214", - // eslint-disable-next-line @typescript-eslint/no-empty-function - () => {} - ) - ).toThrowError( - Error, - "The MapQuest provider does not support IP geolocation, only location geocoding." - ); - }); - - it("receives correct geocoding results", (done) => { - const provider = UniversalGeocoder.createGeocoder({ - provider: "mapquest", - useSsl: true, - apiKey: "api_key", - }); - - provider?.geocode( - "1600 Pennsylvania Ave, Washington, DC", - (results: Geocoded[]) => { - const geocoded = results[0]; - - expect(geocoded).toBeDefined(); - expect(geocoded.getCoordinates()).toEqual([38.895206, -77.036515]); - expect(geocoded.getBounds()).toEqual([ - undefined, - undefined, - undefined, - undefined, - ]); - expect(geocoded.getFormattedAddress()).toEqual(undefined); - expect(geocoded.getStreetNumber()).toEqual(undefined); - expect(geocoded.getStreetName()).toEqual("1600 Pennsylvania Ave"); - expect(geocoded.getSubLocality()).toEqual(""); - expect(geocoded.getLocality()).toEqual("Washington"); - expect(geocoded.getPostalCode()).toEqual(""); - expect(geocoded.getRegion()).toEqual("District Of Columbia"); - expect(geocoded.getAdminLevels()).toEqual([]); - expect(geocoded.getCountry()).toEqual("US"); - expect(geocoded.getCountryCode()).toEqual("US"); - - done(); - } - ); - }); - - it("receives correct geodecoding results", (done) => { - const provider = UniversalGeocoder.createGeocoder({ - provider: "mapquest", - useSsl: true, - apiKey: "api_key", - }); - - provider?.geodecode(48.8631507, 2.388911, (results: Geocoded[]) => { - const geocoded = results[0]; - - expect(geocoded).toBeDefined(); - expect(geocoded.getCoordinates()).toEqual([48.863116, 2.38878]); - expect(geocoded.getBounds()).toEqual([ - undefined, - undefined, - undefined, - undefined, - ]); - expect(geocoded.getFormattedAddress()).toEqual(undefined); - expect(geocoded.getStreetNumber()).toEqual(undefined); - expect(geocoded.getStreetName()).toEqual("8 Avenue Gambetta"); - expect(geocoded.getSubLocality()).toEqual(""); - expect(geocoded.getLocality()).toEqual("Paris"); - expect(geocoded.getPostalCode()).toEqual("75020"); - expect(geocoded.getRegion()).toEqual(""); - expect(geocoded.getAdminLevels()).toEqual([]); - expect(geocoded.getCountry()).toEqual("FR"); - expect(geocoded.getCountryCode()).toEqual("FR"); - - done(); - }); - }); - - it("receives error when the API key is bad", (done) => { - const provider = UniversalGeocoder.createGeocoder({ - provider: "mapquest", - useSsl: true, - apiKey: "api_key", - }); - - provider?.geocode( - "1600 Pennsylvania Ave, Washington, DC", - () => { - done(); - }, - (error) => { - expect(error.message).toEqual( - "Received HTTP status code 403 when attempting geocoding request." - ); - done(); - } - ); - }); -}); diff --git a/spec/recordings/MapQuest-Geocoder-Provider_1759071530/receives-correct-geocoding-results-using-POST-and-open-domain_4225723019/recording.har b/spec/recordings/MapQuest-Geocoder-Provider_1759071530/receives-correct-geocoding-results-using-POST-and-open-domain_4225723019/recording.har new file mode 100644 index 0000000..48cd991 --- /dev/null +++ b/spec/recordings/MapQuest-Geocoder-Provider_1759071530/receives-correct-geocoding-results-using-POST-and-open-domain_4225723019/recording.har @@ -0,0 +1,168 @@ +{ + "log": { + "_recordingName": "MapQuest Geocoder Provider/receives correct geocoding results using POST and open domain", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "5.0.0" + }, + "entries": [ + { + "_id": "7e078b8475093693faf7f1bf13216ac4", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 81, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "content-type", + "value": "text/plain;charset=UTF-8" + }, + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + }, + { + "_fromType": "array", + "name": "content-length", + "value": "81" + }, + { + "_fromType": "array", + "name": "user-agent", + "value": "node-fetch/1.0 (+https://github.com/bitinn/node-fetch)" + }, + { + "_fromType": "array", + "name": "accept-encoding", + "value": "gzip,deflate" + }, + { + "_fromType": "array", + "name": "connection", + "value": "close" + }, + { + "name": "host", + "value": "open.mapquestapi.com" + } + ], + "headersSize": 326, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "text/plain;charset=UTF-8", + "params": [], + "text": "{\"location\":\"1600 Pennsylvania Ave, Washington, DC\",\"options\":{\"maxResults\":\"5\"}}" + }, + "queryString": [], + "url": "https://open.mapquestapi.com/geocoding/v1/address" + }, + "response": { + "bodySize": 1816, + "content": { + "mimeType": "application/json;charset=UTF-8", + "size": 1816, + "text": "{\"info\":{\"statuscode\":0,\"copyright\":{\"text\":\"\\u00A9 2020 MapQuest, Inc.\",\"imageUrl\":\"http://api.mqcdn.com/res/mqlogo.gif\",\"imageAltText\":\"\\u00A9 2020 MapQuest, Inc.\"},\"messages\":[]},\"options\":{\"maxResults\":5,\"thumbMaps\":true,\"ignoreLatLngInput\":false},\"results\":[{\"providedLocation\":{\"street\":\"1600 Pennsylvania Ave, Washington, DC\"},\"locations\":[{\"street\":\"\",\"adminArea6\":\"Penn Quarter\",\"adminArea6Type\":\"Neighborhood\",\"adminArea5\":\"Washington\",\"adminArea5Type\":\"City\",\"adminArea4\":\"\",\"adminArea4Type\":\"County\",\"adminArea3\":\"District of Columbia\",\"adminArea3Type\":\"State\",\"adminArea1\":\"US\",\"adminArea1Type\":\"Country\",\"postalCode\":\"20006\",\"geocodeQualityCode\":\"B1XAX\",\"geocodeQuality\":\"STREET\",\"dragPoint\":false,\"sideOfStreet\":\"N\",\"linkId\":\"0\",\"unknownInput\":\"\",\"type\":\"s\",\"latLng\":{\"lat\":38.895854,\"lng\":-77.030713},\"displayLatLng\":{\"lat\":38.895854,\"lng\":-77.030713},\"mapUrl\":\"http://open.mapquestapi.com/staticmap/v5/map?type=map&size=225,160&locations=38.8958536,-77.0307129|marker-sm-50318A-1&scalebar=true&zoom=15&rand=942576975\"},{\"street\":\"Pennsylvania Avenue\",\"adminArea6\":\"\",\"adminArea6Type\":\"Neighborhood\",\"adminArea5\":\"\",\"adminArea5Type\":\"City\",\"adminArea4\":\"Prince George's County\",\"adminArea4Type\":\"County\",\"adminArea3\":\"District of Columbia\",\"adminArea3Type\":\"State\",\"adminArea1\":\"US\",\"adminArea1Type\":\"Country\",\"postalCode\":\"20020\",\"geocodeQualityCode\":\"B1XXX\",\"geocodeQuality\":\"STREET\",\"dragPoint\":false,\"sideOfStreet\":\"N\",\"linkId\":\"0\",\"unknownInput\":\"\",\"type\":\"s\",\"latLng\":{\"lat\":38.863638,\"lng\":-76.946365},\"displayLatLng\":{\"lat\":38.863638,\"lng\":-76.946365},\"mapUrl\":\"http://open.mapquestapi.com/staticmap/v5/map?key=Fmjtd|luurnu6al1,bg=o5-9wbg94&type=map&size=225,160&locations=38.8636383,-76.9463651|marker-sm-50318A-2&scalebar=true&zoom=15&rand=1210831717\"}]}]}" + }, + "cookies": [ + { + "httpOnly": true, + "name": "JSESSIONID", + "path": "/", + "value": "F38AEDBEA9FEDE1C7E22071726AE8DB6" + } + ], + "headers": [ + { + "name": "date", + "value": "Fri, 04 Sep 2020 15:04:40 GMT" + }, + { + "name": "content-type", + "value": "application/json;charset=UTF-8" + }, + { + "name": "content-length", + "value": "1816" + }, + { + "name": "connection", + "value": "close" + }, + { + "name": "access-control-allow-methods", + "value": "OPTIONS,GET,POST" + }, + { + "name": "access-control-allow-origin", + "value": "*" + }, + { + "name": "cache-control", + "value": "no-cache, must-revalidate" + }, + { + "name": "expires", + "value": "Mon, 20 Dec 1998 01:00:00 GMT" + }, + { + "name": "geocodetransactioncount", + "value": "1" + }, + { + "name": "last-modified", + "value": "Fri, 04 Sep 2020 15:04:40 GMT" + }, + { + "name": "pragma", + "value": "no-cache" + }, + { + "name": "reversegeocodetransactioncount", + "value": "0" + }, + { + "name": "server", + "value": "Apache-Coyote/1.1" + }, + { + "_fromType": "array", + "name": "set-cookie", + "value": "JSESSIONID=F38AEDBEA9FEDE1C7E22071726AE8DB6; Path=/; HttpOnly" + }, + { + "name": "status", + "value": "success" + }, + { + "name": "transactionweight", + "value": "1.0" + } + ], + "headersSize": 558, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2020-09-04T15:04:39.229Z", + "time": 871, + "timings": { + "blocked": -1, + "connect": -1, + "dns": -1, + "receive": 0, + "send": 0, + "ssl": -1, + "wait": 871 + } + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/spec/recordings/MapQuest-Geocoder-Provider_1759071530/receives-correct-geocoding-results_3640432360/recording.har b/spec/recordings/MapQuest-Geocoder-Provider_1759071530/receives-correct-geocoding-results_3640432360/recording.har index f09443a..5e1b9f7 100644 --- a/spec/recordings/MapQuest-Geocoder-Provider_1759071530/receives-correct-geocoding-results_3640432360/recording.har +++ b/spec/recordings/MapQuest-Geocoder-Provider_1759071530/receives-correct-geocoding-results_3640432360/recording.har @@ -8,7 +8,7 @@ }, "entries": [ { - "_id": "23726ea12e730e66843c80cff1bb6610", + "_id": "a9df5ae9db36156ea719a0bc70a91cbd", "_order": 0, "cache": {}, "request": { @@ -40,23 +40,27 @@ "value": "www.mapquestapi.com" } ], - "headersSize": 328, + "headersSize": 335, "httpVersion": "HTTP/1.1", "method": "GET", "queryString": [ { "name": "location", "value": "1600 Pennsylvania Ave, Washington, DC" + }, + { + "name": "maxResults", + "value": "5" } ], - "url": "https://www.mapquestapi.com/geocoding/v1/address?location=1600+Pennsylvania+Ave%2C+Washington%2C+DC" + "url": "https://www.mapquestapi.com/geocoding/v1/address?location=1600+Pennsylvania+Ave%2C+Washington%2C+DC&maxResults=5" }, "response": { - "bodySize": 1115, + "bodySize": 1113, "content": { "mimeType": "application/json;charset=UTF-8", - "size": 1115, - "text": "{\"info\":{\"statuscode\":0,\"copyright\":{\"text\":\"\\u00A9 2020 MapQuest, Inc.\",\"imageUrl\":\"http://api.mqcdn.com/res/mqlogo.gif\",\"imageAltText\":\"\\u00A9 2020 MapQuest, Inc.\"},\"messages\":[]},\"options\":{\"maxResults\":-1,\"thumbMaps\":true,\"ignoreLatLngInput\":false},\"results\":[{\"providedLocation\":{\"location\":\"1600 Pennsylvania Ave, Washington, DC\"},\"locations\":[{\"street\":\"1600 Pennsylvania Ave\",\"adminArea6\":\"\",\"adminArea6Type\":\"Neighborhood\",\"adminArea5\":\"Washington\",\"adminArea5Type\":\"City\",\"adminArea4\":\"District Of Columbia\",\"adminArea4Type\":\"County\",\"adminArea3\":\"DC\",\"adminArea3Type\":\"State\",\"adminArea1\":\"US\",\"adminArea1Type\":\"Country\",\"postalCode\":\"\",\"geocodeQualityCode\":\"P1AAA\",\"geocodeQuality\":\"POINT\",\"dragPoint\":false,\"sideOfStreet\":\"N\",\"linkId\":\"58f8ddbf-64f2-4ea2-b8f9-78b5364924e9\",\"unknownInput\":\"\",\"type\":\"s\",\"latLng\":{\"lat\":38.895206,\"lng\":-77.036515},\"displayLatLng\":{\"lat\":38.895206,\"lng\":-77.036515},\"mapUrl\":\"http://www.mapquestapi.com/staticmap/v5/map?key=Fmjtd|luurnu6al1,bg=o5-9wbg94&type=map&size=225,160&locations=38.895206,-77.036515|marker-sm-50318A-1&scalebar=true&zoom=15&rand=-2063980493\"}]}]}" + "size": 1113, + "text": "{\"info\":{\"statuscode\":0,\"copyright\":{\"text\":\"\\u00A9 2020 MapQuest, Inc.\",\"imageUrl\":\"http://api.mqcdn.com/res/mqlogo.gif\",\"imageAltText\":\"\\u00A9 2020 MapQuest, Inc.\"},\"messages\":[]},\"options\":{\"maxResults\":5,\"thumbMaps\":true,\"ignoreLatLngInput\":false},\"results\":[{\"providedLocation\":{\"location\":\"1600 Pennsylvania Ave, Washington, DC\"},\"locations\":[{\"street\":\"1600 Pennsylvania Ave\",\"adminArea6\":\"\",\"adminArea6Type\":\"Neighborhood\",\"adminArea5\":\"Washington\",\"adminArea5Type\":\"City\",\"adminArea4\":\"District Of Columbia\",\"adminArea4Type\":\"County\",\"adminArea3\":\"DC\",\"adminArea3Type\":\"State\",\"adminArea1\":\"US\",\"adminArea1Type\":\"Country\",\"postalCode\":\"\",\"geocodeQualityCode\":\"P1AAA\",\"geocodeQuality\":\"POINT\",\"dragPoint\":false,\"sideOfStreet\":\"N\",\"linkId\":\"58f8ddbf-64f2-4ea2-b8f9-78b5364924e9\",\"unknownInput\":\"\",\"type\":\"s\",\"latLng\":{\"lat\":38.895206,\"lng\":-77.036515},\"displayLatLng\":{\"lat\":38.895206,\"lng\":-77.036515},\"mapUrl\":\"http://www.mapquestapi.com/staticmap/v5/map?type=map&size=225,160&locations=38.895206,-77.036515|marker-sm-50318A-1&scalebar=true&zoom=15&rand=1195279033\"}]}]}" }, "cookies": [ { @@ -64,13 +68,13 @@ "name": "JSESSIONID", "path": "/", "secure": true, - "value": "E91FC02E5CF83DDD961FAAA8E50373B1" + "value": "E72DD9ED6E9A6E1FDA3B690993B6E232" } ], "headers": [ { "name": "date", - "value": "Fri, 14 Aug 2020 14:28:16 GMT" + "value": "Fri, 04 Sep 2020 15:04:40 GMT" }, { "name": "content-type", @@ -78,7 +82,7 @@ }, { "name": "content-length", - "value": "1115" + "value": "1113" }, { "name": "connection", @@ -106,7 +110,7 @@ }, { "name": "last-modified", - "value": "Fri, 14 Aug 2020 14:28:16 GMT" + "value": "Fri, 04 Sep 2020 15:04:40 GMT" }, { "name": "pragma", @@ -123,7 +127,7 @@ { "_fromType": "array", "name": "set-cookie", - "value": "JSESSIONID=E91FC02E5CF83DDD961FAAA8E50373B1; Path=/; HttpOnly; Secure" + "value": "JSESSIONID=E72DD9ED6E9A6E1FDA3B690993B6E232; Path=/; HttpOnly; Secure" }, { "name": "status", @@ -144,7 +148,7 @@ "status": 200, "statusText": "OK" }, - "startedDateTime": "2020-08-14T14:28:16.418Z", + "startedDateTime": "2020-09-04T15:04:40.531Z", "time": 424, "timings": { "blocked": -1, diff --git a/spec/recordings/MapQuest-Geocoder-Provider_1759071530/receives-correct-geodecoding-results-using-POST-and-open-domain_1453160210/recording.har b/spec/recordings/MapQuest-Geocoder-Provider_1759071530/receives-correct-geodecoding-results-using-POST-and-open-domain_1453160210/recording.har new file mode 100644 index 0000000..83dea1d --- /dev/null +++ b/spec/recordings/MapQuest-Geocoder-Provider_1759071530/receives-correct-geodecoding-results-using-POST-and-open-domain_1453160210/recording.har @@ -0,0 +1,168 @@ +{ + "log": { + "_recordingName": "MapQuest Geocoder Provider/receives correct geodecoding results using POST and open domain", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "5.0.0" + }, + "entries": [ + { + "_id": "7d440f03ebc52909ae14852e82a068e9", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 57, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "content-type", + "value": "text/plain;charset=UTF-8" + }, + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + }, + { + "_fromType": "array", + "name": "content-length", + "value": "57" + }, + { + "_fromType": "array", + "name": "user-agent", + "value": "node-fetch/1.0 (+https://github.com/bitinn/node-fetch)" + }, + { + "_fromType": "array", + "name": "accept-encoding", + "value": "gzip,deflate" + }, + { + "_fromType": "array", + "name": "connection", + "value": "close" + }, + { + "name": "host", + "value": "open.mapquestapi.com" + } + ], + "headersSize": 326, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "text/plain;charset=UTF-8", + "params": [], + "text": "{\"location\":{\"latLng\":{\"lat\":48.8631507,\"lng\":2.388911}}}" + }, + "queryString": [], + "url": "https://open.mapquestapi.com/geocoding/v1/reverse" + }, + "response": { + "bodySize": 1051, + "content": { + "mimeType": "application/json;charset=UTF-8", + "size": 1051, + "text": "{\"info\":{\"statuscode\":0,\"copyright\":{\"text\":\"\\u00A9 2020 MapQuest, Inc.\",\"imageUrl\":\"http://api.mqcdn.com/res/mqlogo.gif\",\"imageAltText\":\"\\u00A9 2020 MapQuest, Inc.\"},\"messages\":[]},\"options\":{\"maxResults\":1,\"thumbMaps\":true,\"ignoreLatLngInput\":false},\"results\":[{\"providedLocation\":{\"latLng\":{\"lat\":48.8631507,\"lng\":2.388911}},\"locations\":[{\"street\":\"8 Avenue Gambetta\",\"adminArea6\":\"\",\"adminArea6Type\":\"Neighborhood\",\"adminArea5\":\"Paris\",\"adminArea5Type\":\"City\",\"adminArea4\":\"\",\"adminArea4Type\":\"County\",\"adminArea3\":\"Ile-de-France\",\"adminArea3Type\":\"State\",\"adminArea1\":\"FR\",\"adminArea1Type\":\"Country\",\"postalCode\":\"75020\",\"geocodeQualityCode\":\"P1AAA\",\"geocodeQuality\":\"POINT\",\"dragPoint\":false,\"sideOfStreet\":\"N\",\"linkId\":\"0\",\"unknownInput\":\"\",\"type\":\"s\",\"latLng\":{\"lat\":48.863116,\"lng\":2.38878},\"displayLatLng\":{\"lat\":48.863116,\"lng\":2.38878},\"mapUrl\":\"http://open.mapquestapi.com/staticmap/v5/map?type=map&size=225,160&locations=48.8631163,2.38878|marker-sm-50318A-1&scalebar=true&zoom=15&rand=-1000393223\"}]}]}" + }, + "cookies": [ + { + "httpOnly": true, + "name": "JSESSIONID", + "path": "/", + "value": "91D16241582ABFB3D392A13162BCBAA5" + } + ], + "headers": [ + { + "name": "date", + "value": "Fri, 04 Sep 2020 15:04:41 GMT" + }, + { + "name": "content-type", + "value": "application/json;charset=UTF-8" + }, + { + "name": "content-length", + "value": "1051" + }, + { + "name": "connection", + "value": "close" + }, + { + "name": "access-control-allow-methods", + "value": "OPTIONS,GET,POST" + }, + { + "name": "access-control-allow-origin", + "value": "*" + }, + { + "name": "cache-control", + "value": "no-cache, must-revalidate" + }, + { + "name": "expires", + "value": "Mon, 20 Dec 1998 01:00:00 GMT" + }, + { + "name": "geocodetransactioncount", + "value": "0" + }, + { + "name": "last-modified", + "value": "Fri, 04 Sep 2020 15:04:41 GMT" + }, + { + "name": "pragma", + "value": "no-cache" + }, + { + "name": "reversegeocodetransactioncount", + "value": "1" + }, + { + "name": "server", + "value": "Apache-Coyote/1.1" + }, + { + "_fromType": "array", + "name": "set-cookie", + "value": "JSESSIONID=91D16241582ABFB3D392A13162BCBAA5; Path=/; HttpOnly" + }, + { + "name": "status", + "value": "success" + }, + { + "name": "transactionweight", + "value": "1.0" + } + ], + "headersSize": 558, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2020-09-04T15:04:40.972Z", + "time": 283, + "timings": { + "blocked": -1, + "connect": -1, + "dns": -1, + "receive": 0, + "send": 0, + "ssl": -1, + "wait": 283 + } + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/spec/recordings/MapQuest-Geocoder-Provider_1759071530/receives-correct-geodecoding-results_1602611079/recording.har b/spec/recordings/MapQuest-Geocoder-Provider_1759071530/receives-correct-geodecoding-results_1602611079/recording.har index bf679e3..bac998f 100644 --- a/spec/recordings/MapQuest-Geocoder-Provider_1759071530/receives-correct-geodecoding-results_1602611079/recording.har +++ b/spec/recordings/MapQuest-Geocoder-Provider_1759071530/receives-correct-geodecoding-results_1602611079/recording.har @@ -40,7 +40,7 @@ "value": "www.mapquestapi.com" } ], - "headersSize": 300, + "headersSize": 294, "httpVersion": "HTTP/1.1", "method": "GET", "queryString": [ @@ -52,11 +52,11 @@ "url": "https://www.mapquestapi.com/geocoding/v1/reverse?location=48.8631507%2C2.388911" }, "response": { - "bodySize": 1047, + "bodySize": 1049, "content": { "mimeType": "application/json;charset=UTF-8", - "size": 1047, - "text": "{\"info\":{\"statuscode\":0,\"copyright\":{\"text\":\"\\u00A9 2020 MapQuest, Inc.\",\"imageUrl\":\"http://api.mqcdn.com/res/mqlogo.gif\",\"imageAltText\":\"\\u00A9 2020 MapQuest, Inc.\"},\"messages\":[]},\"options\":{\"maxResults\":1,\"thumbMaps\":true,\"ignoreLatLngInput\":false},\"results\":[{\"providedLocation\":{\"latLng\":{\"lat\":48.8631507,\"lng\":2.388911}},\"locations\":[{\"street\":\"8 Avenue Gambetta\",\"adminArea6\":\"\",\"adminArea6Type\":\"Neighborhood\",\"adminArea5\":\"Paris\",\"adminArea5Type\":\"City\",\"adminArea4\":\"\",\"adminArea4Type\":\"County\",\"adminArea3\":\"Ile-de-France\",\"adminArea3Type\":\"State\",\"adminArea1\":\"FR\",\"adminArea1Type\":\"Country\",\"postalCode\":\"75020\",\"geocodeQualityCode\":\"P1AAA\",\"geocodeQuality\":\"POINT\",\"dragPoint\":false,\"sideOfStreet\":\"N\",\"linkId\":\"0\",\"unknownInput\":\"\",\"type\":\"s\",\"latLng\":{\"lat\":48.863116,\"lng\":2.38878},\"displayLatLng\":{\"lat\":48.863116,\"lng\":2.38878},\"mapUrl\":\"http://www.mapquestapi.com/staticmap/v5/map?key=Fmjtd|luurnu6al1,bg=o5-9wbg94&type=map&size=225,160&locations=48.8631163,2.38878|marker-sm-50318A-1&scalebar=true&zoom=15&rand=69343397\"}]}]}" + "size": 1049, + "text": "{\"info\":{\"statuscode\":0,\"copyright\":{\"text\":\"\\u00A9 2020 MapQuest, Inc.\",\"imageUrl\":\"http://api.mqcdn.com/res/mqlogo.gif\",\"imageAltText\":\"\\u00A9 2020 MapQuest, Inc.\"},\"messages\":[]},\"options\":{\"maxResults\":1,\"thumbMaps\":true,\"ignoreLatLngInput\":false},\"results\":[{\"providedLocation\":{\"latLng\":{\"lat\":48.8631507,\"lng\":2.388911}},\"locations\":[{\"street\":\"8 Avenue Gambetta\",\"adminArea6\":\"\",\"adminArea6Type\":\"Neighborhood\",\"adminArea5\":\"Paris\",\"adminArea5Type\":\"City\",\"adminArea4\":\"\",\"adminArea4Type\":\"County\",\"adminArea3\":\"Ile-de-France\",\"adminArea3Type\":\"State\",\"adminArea1\":\"FR\",\"adminArea1Type\":\"Country\",\"postalCode\":\"75020\",\"geocodeQualityCode\":\"P1AAA\",\"geocodeQuality\":\"POINT\",\"dragPoint\":false,\"sideOfStreet\":\"N\",\"linkId\":\"0\",\"unknownInput\":\"\",\"type\":\"s\",\"latLng\":{\"lat\":48.863116,\"lng\":2.38878},\"displayLatLng\":{\"lat\":48.863116,\"lng\":2.38878},\"mapUrl\":\"http://www.mapquestapi.com/staticmap/v5/map?type=map&size=225,160&locations=48.8631163,2.38878|marker-sm-50318A-1&scalebar=true&zoom=15&rand=1980906355\"}]}]}" }, "cookies": [ { @@ -64,13 +64,13 @@ "name": "JSESSIONID", "path": "/", "secure": true, - "value": "085B8BDD5465DE9C0888D4694DAC0059" + "value": "D9956F384D31623C6B29759C36B34AD7" } ], "headers": [ { "name": "date", - "value": "Fri, 14 Aug 2020 14:31:37 GMT" + "value": "Fri, 04 Sep 2020 15:04:40 GMT" }, { "name": "content-type", @@ -78,7 +78,7 @@ }, { "name": "content-length", - "value": "1047" + "value": "1049" }, { "name": "connection", @@ -106,7 +106,7 @@ }, { "name": "last-modified", - "value": "Fri, 14 Aug 2020 14:31:37 GMT" + "value": "Fri, 04 Sep 2020 15:04:40 GMT" }, { "name": "pragma", @@ -123,7 +123,7 @@ { "_fromType": "array", "name": "set-cookie", - "value": "JSESSIONID=085B8BDD5465DE9C0888D4694DAC0059; Path=/; HttpOnly; Secure" + "value": "JSESSIONID=D9956F384D31623C6B29759C36B34AD7; Path=/; HttpOnly; Secure" }, { "name": "status", @@ -144,8 +144,8 @@ "status": 200, "statusText": "OK" }, - "startedDateTime": "2020-08-14T14:31:37.001Z", - "time": 523, + "startedDateTime": "2020-09-04T15:04:40.152Z", + "time": 365, "timings": { "blocked": -1, "connect": -1, @@ -153,7 +153,7 @@ "receive": 0, "send": 0, "ssl": -1, - "wait": 523 + "wait": 365 } } ], diff --git a/spec/recordings/MapQuest-Geocoder-Provider_1759071530/receives-error-when-parameters-are-missing_2925123479/recording.har b/spec/recordings/MapQuest-Geocoder-Provider_1759071530/receives-error-when-parameters-are-missing_2925123479/recording.har new file mode 100644 index 0000000..89fd43d --- /dev/null +++ b/spec/recordings/MapQuest-Geocoder-Provider_1759071530/receives-error-when-parameters-are-missing_2925123479/recording.har @@ -0,0 +1,163 @@ +{ + "log": { + "_recordingName": "MapQuest Geocoder Provider/receives error when parameters are missing", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "5.0.0" + }, + "entries": [ + { + "_id": "e5ca2255cb904c7b4fba9d6b7d4f5ebd", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + }, + { + "_fromType": "array", + "name": "user-agent", + "value": "node-fetch/1.0 (+https://github.com/bitinn/node-fetch)" + }, + { + "_fromType": "array", + "name": "accept-encoding", + "value": "gzip,deflate" + }, + { + "_fromType": "array", + "name": "connection", + "value": "close" + }, + { + "name": "host", + "value": "www.mapquestapi.com" + } + ], + "headersSize": 276, + "httpVersion": "HTTP/1.1", + "method": "GET", + "queryString": [ + { + "name": "maxResults", + "value": "5" + } + ], + "url": "https://www.mapquestapi.com/geocoding/v1/address?maxResults=5" + }, + "response": { + "bodySize": 369, + "content": { + "mimeType": "application/json;charset=UTF-8", + "size": 369, + "text": "{\"info\":{\"statuscode\":400,\"copyright\":{\"text\":\"\\u00A9 2020 MapQuest, Inc.\",\"imageUrl\":\"http://api.mqcdn.com/res/mqlogo.gif\",\"imageAltText\":\"\\u00A9 2020 MapQuest, Inc.\"},\"messages\":[\"Illegal argument from request: Insufficient info for location\"]},\"options\":{\"maxResults\":-1,\"thumbMaps\":true,\"ignoreLatLngInput\":false},\"results\":[{\"providedLocation\":{},\"locations\":[]}]}" + }, + "cookies": [ + { + "httpOnly": true, + "name": "JSESSIONID", + "path": "/", + "secure": true, + "value": "145949FDB8481DDBF9EEA1B4D3DB5C4E" + } + ], + "headers": [ + { + "name": "date", + "value": "Fri, 04 Sep 2020 15:04:41 GMT" + }, + { + "name": "content-type", + "value": "application/json;charset=UTF-8" + }, + { + "name": "content-length", + "value": "369" + }, + { + "name": "connection", + "value": "close" + }, + { + "name": "access-control-allow-methods", + "value": "OPTIONS,GET,POST" + }, + { + "name": "access-control-allow-origin", + "value": "*" + }, + { + "name": "cache-control", + "value": "no-cache, must-revalidate" + }, + { + "name": "expires", + "value": "Mon, 20 Dec 1998 01:00:00 GMT" + }, + { + "name": "geocodetransactioncount", + "value": "0" + }, + { + "name": "last-modified", + "value": "Fri, 04 Sep 2020 15:04:41 GMT" + }, + { + "name": "pragma", + "value": "no-cache" + }, + { + "name": "reversegeocodetransactioncount", + "value": "0" + }, + { + "name": "server", + "value": "Apache-Coyote/1.1" + }, + { + "_fromType": "array", + "name": "set-cookie", + "value": "JSESSIONID=145949FDB8481DDBF9EEA1B4D3DB5C4E; Path=/; HttpOnly; Secure" + }, + { + "name": "status", + "value": "success" + }, + { + "name": "transactionweight", + "value": "0.0" + }, + { + "name": "strict-transport-security", + "value": "max-age=0" + } + ], + "headersSize": 603, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2020-09-04T15:04:41.271Z", + "time": 367, + "timings": { + "blocked": -1, + "connect": -1, + "dns": -1, + "receive": 0, + "send": 0, + "ssl": -1, + "wait": 367 + } + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/spec/recordings/MapQuest-Geocoder-Provider_1759071530/receives-error-when-the-API-key-is-bad_860720186/recording.har b/spec/recordings/MapQuest-Geocoder-Provider_1759071530/receives-error-when-the-API-key-is-bad_860720186/recording.har index 1d45688..cdef2d7 100644 --- a/spec/recordings/MapQuest-Geocoder-Provider_1759071530/receives-error-when-the-API-key-is-bad_860720186/recording.har +++ b/spec/recordings/MapQuest-Geocoder-Provider_1759071530/receives-error-when-the-API-key-is-bad_860720186/recording.har @@ -8,7 +8,7 @@ }, "entries": [ { - "_id": "23726ea12e730e66843c80cff1bb6610", + "_id": "a9df5ae9db36156ea719a0bc70a91cbd", "_order": 0, "cache": {}, "request": { @@ -40,16 +40,20 @@ "value": "www.mapquestapi.com" } ], - "headersSize": 294, + "headersSize": 307, "httpVersion": "HTTP/1.1", "method": "GET", "queryString": [ { "name": "location", "value": "1600 Pennsylvania Ave, Washington, DC" + }, + { + "name": "maxResults", + "value": "5" } ], - "url": "https://www.mapquestapi.com/geocoding/v1/address?location=1600+Pennsylvania+Ave%2C+Washington%2C+DC" + "url": "https://www.mapquestapi.com/geocoding/v1/address?location=1600+Pennsylvania+Ave%2C+Washington%2C+DC&maxResults=5" }, "response": { "bodySize": 50, @@ -62,7 +66,7 @@ "headers": [ { "name": "date", - "value": "Fri, 14 Aug 2020 14:33:19 GMT" + "value": "Fri, 04 Sep 2020 15:04:39 GMT" }, { "name": "content-type", @@ -95,8 +99,8 @@ "status": 403, "statusText": "Forbidden" }, - "startedDateTime": "2020-08-14T14:33:18.658Z", - "time": 504, + "startedDateTime": "2020-09-04T15:04:38.848Z", + "time": 367, "timings": { "blocked": -1, "connect": -1, @@ -104,7 +108,7 @@ "receive": 0, "send": 0, "ssl": -1, - "wait": 504 + "wait": 367 } } ], diff --git a/spec/setupPolly.ts b/spec/setupPolly.ts index e554e16..fb7ecb7 100644 --- a/spec/setupPolly.ts +++ b/spec/setupPolly.ts @@ -11,14 +11,22 @@ Polly.register(FSPersister); const excludedQueryParams = ["access_token", "apikey", "key"]; export const cleanRecording = (context: Context): void => { - context.polly.server.any().on("beforePersist", (req, { request }) => { - request.queryString = request.queryString.filter( - ({ name }: { name: string }) => !excludedQueryParams.includes(name) - ); - const url = new URL(request.url); - excludedQueryParams.forEach((param) => url.searchParams.delete(param)); - request.url = url.toString(); - }); + context.polly.server + .any() + .on("beforePersist", (req, { request, response }) => { + request.queryString = request.queryString.filter( + ({ name }: { name: string }) => !excludedQueryParams.includes(name) + ); + const url = new URL(request.url); + excludedQueryParams.forEach((param) => url.searchParams.delete(param)); + request.url = url.toString(); + excludedQueryParams.forEach((param) => { + response.content.text = response.content.text.replace( + new RegExp(`${param}=[^&]+&`), + "" + ); + }); + }); }; export default (): Context => diff --git a/src/AdminLevel.ts b/src/AdminLevel.ts index bb34d87..186126f 100644 --- a/src/AdminLevel.ts +++ b/src/AdminLevel.ts @@ -4,6 +4,12 @@ export interface AdminLevelObject { readonly code?: string; } +// eslint-disable-next-line no-shadow +export enum ADMIN_LEVEL_CODES { + STATE_CODE = 1, + COUNTY_CODE = 2, +} + export default class AdminLevel { private readonly level: number; diff --git a/src/ExternalLoader.ts b/src/ExternalLoader.ts index 94ab715..3d07542 100644 --- a/src/ExternalLoader.ts +++ b/src/ExternalLoader.ts @@ -4,18 +4,6 @@ import { ResponseError } from "error"; import { isBrowser, filterUndefinedObjectValues } from "utils"; import { PartialSome } from "types"; -export interface ExternalLoaderInterface { - setOptions(options: PartialSome): void; - getOptions(): ExternalLoaderOptions; - executeRequest( - params: ExternalLoaderParams, - callback: ResponseCallback, - headers?: ExternalLoaderHeaders, - body?: ExternalLoaderBody, - errorCallback?: ErrorCallback - ): void; -} - export interface ExternalLoaderOptions { readonly protocol: string; readonly host?: string; @@ -24,7 +12,7 @@ export interface ExternalLoaderOptions { } export interface ExternalLoaderBody { - [param: string]: string | undefined; + [param: string]: ExternalLoaderBody | string | number | undefined; } export interface ExternalLoaderParams { @@ -39,6 +27,18 @@ export interface ExternalLoaderHeaders { // eslint-disable-next-line @typescript-eslint/no-explicit-any type ResponseCallback = (response: any) => void; +export interface ExternalLoaderInterface { + setOptions(options: PartialSome): void; + getOptions(): ExternalLoaderOptions; + executeRequest( + params: ExternalLoaderParams, + callback: ResponseCallback, + headers?: ExternalLoaderHeaders, + body?: ExternalLoaderBody, + errorCallback?: ErrorCallback + ): void; +} + const defaultOptions: ExternalLoaderOptions = { protocol: "http", method: "GET", diff --git a/src/GeocoderProviderFactory.ts b/src/GeocoderProviderFactory.ts index 6f40100..f5804b4 100644 --- a/src/GeocoderProviderFactory.ts +++ b/src/GeocoderProviderFactory.ts @@ -7,7 +7,8 @@ import { GoogleMapsProviderOptionsInterface, MapboxProvider, MapboxProviderOptionsInterface, - MapquestProvider, + MapQuestProvider, + MapQuestProviderOptionsInterface, NominatimProvider, NominatimProviderOptionsInterface, OpenCageProvider, @@ -17,6 +18,7 @@ import { ProviderOptionsInterface, defaultChainProviderOptions, defaultMapboxProviderOptions, + defaultMapQuestProviderOptions, defaultNominatimProviderOptions, defaultOpenCageProviderOptions, defaultProviderOptions, @@ -65,6 +67,12 @@ interface MapboxGeocoderProviderFactoryOptions provider: "mapbox"; } +interface MapQuestGeocoderProviderFactoryOptions + extends ProviderOptionInterface, + MapQuestProviderOptionsInterface { + provider: "mapquest"; +} + interface NominatimGeocoderProviderFactoryOptions extends ProviderOptionInterface, NominatimProviderOptionsInterface { @@ -89,6 +97,7 @@ export type GeocoderProviderFactoryOptions = | GeoPluginGeocoderProviderFactoryOptions | GoogleMapsGeocoderProviderFactoryOptions | MapboxGeocoderProviderFactoryOptions + | MapQuestGeocoderProviderFactoryOptions | NominatimGeocoderProviderFactoryOptions | OpenCageGeocoderProviderFactoryOptions | YandexGeocoderProviderFactoryOptions; @@ -99,7 +108,7 @@ export type GeocoderProvider = | GeoPluginProvider | GoogleMapsProvider | MapboxProvider - | MapquestProvider + | MapQuestProvider | NominatimProvider | OpenCageProvider | YandexProvider; @@ -114,6 +123,8 @@ export type GeocoderProviderByOptionsType< ? GoogleMapsProvider : O extends MapboxGeocoderProviderFactoryOptions ? MapboxProvider + : O extends MapQuestGeocoderProviderFactoryOptions + ? MapQuestProvider : O extends NominatimGeocoderProviderFactoryOptions ? NominatimProvider : O extends OpenCageGeocoderProviderFactoryOptions @@ -172,7 +183,10 @@ export default class ProviderFactory { ); case "mapquest": return >( - new MapquestProvider(externalLoader, providerOptions) + new MapQuestProvider(externalLoader, { + ...defaultMapQuestProviderOptions, + ...providerOptions, + }) ); case "openstreetmap": case "nominatim": diff --git a/src/error/ResponseError.ts b/src/error/ResponseError.ts index 90e23bf..b42bee1 100644 --- a/src/error/ResponseError.ts +++ b/src/error/ResponseError.ts @@ -2,6 +2,7 @@ import { GeoPluginResult, GoogleMapsResponse, MapboxResponse, + MapQuestResponse, NominatimResponse, OpenCageResponse, } from "provider"; @@ -14,6 +15,7 @@ export default class ResponseError extends Error { | GeoPluginResult | GoogleMapsResponse | MapboxResponse + | MapQuestResponse | NominatimResponse | OpenCageResponse; @@ -24,6 +26,7 @@ export default class ResponseError extends Error { | GeoPluginResult | GoogleMapsResponse | MapboxResponse + | MapQuestResponse | NominatimResponse | OpenCageResponse ) { @@ -40,6 +43,7 @@ export default class ResponseError extends Error { | GeoPluginResult | GoogleMapsResponse | MapboxResponse + | MapQuestResponse | NominatimResponse | OpenCageResponse { return this.response; diff --git a/src/provider/MapquestProvider.ts b/src/provider/MapquestProvider.ts deleted file mode 100644 index 99b8975..0000000 --- a/src/provider/MapquestProvider.ts +++ /dev/null @@ -1,189 +0,0 @@ -import { - ExternalLoaderBody, - ExternalLoaderHeaders, - ExternalLoaderInterface, - ExternalLoaderParams, -} from "ExternalLoader"; -import { - ErrorCallback, - GeocodedResultsCallback, - ProviderHelpers, - ProviderInterface, - ProviderOptionsInterface, - defaultProviderOptions, -} from "provider"; -import Geocoded from "Geocoded"; -import { - GeocodeQuery, - GeocodeQueryObject, - ReverseQuery, - ReverseQueryObject, -} from "query"; - -interface MapQuestRequestParams { - [param: string]: string | undefined; - readonly key?: string; - readonly location: string; - readonly jsonpCallback?: string; -} - -export interface MapQuestResult { - latLng: { - lat: number; - lng: number; - }; - displayLatLng: { - lat: number; - lng: number; - }; - street: string; - sideOfStreet: string; - adminArea1?: string; - adminArea1Type?: string; - adminArea3?: string; - adminArea3Type?: string; - adminArea4?: string; - adminArea4Type?: string; - adminArea5?: string; - adminArea5Type?: string; - adminArea6?: string; - adminArea6Type?: string; - postalCode: string; - type: string; - linkId: string; - dragPoint: boolean; - geocodeQuality: string; - geocodeQualityCode: string; -} - -type MapQuestGeocodedResultsCallback = GeocodedResultsCallback; - -export default class MapQuestProvider implements ProviderInterface { - private externalLoader: ExternalLoaderInterface; - - private options: ProviderOptionsInterface; - - public constructor( - _externalLoader: ExternalLoaderInterface, - options: ProviderOptionsInterface = defaultProviderOptions - ) { - this.externalLoader = _externalLoader; - this.options = { ...defaultProviderOptions, ...options }; - if (!this.options.apiKey) { - throw new Error( - 'An API key is required for the MapQuest provider. Please add it in the "apiKey" option.' - ); - } - } - - public geocode( - query: string | GeocodeQuery | GeocodeQueryObject, - callback: MapQuestGeocodedResultsCallback, - errorCallback?: ErrorCallback - ): void { - const geocodeQuery = ProviderHelpers.getGeocodeQueryFromParameter(query); - - if (geocodeQuery.getIp()) { - throw new Error( - "The MapQuest provider does not support IP geolocation, only location geocoding." - ); - } - - this.externalLoader.setOptions({ - protocol: this.options.useSsl ? "https" : "http", - host: "www.mapquestapi.com", - pathname: "geocoding/v1/address", - }); - - const params: MapQuestRequestParams = { - key: this.options.apiKey, - location: geocodeQuery.getText() || "", - jsonpCallback: this.options.useJsonp ? "callback" : undefined, - }; - - this.executeRequest(params, callback, {}, {}, errorCallback); - } - - public geodecode( - latitudeOrQuery: number | string | ReverseQuery | ReverseQueryObject, - longitudeOrCallback: number | string | MapQuestGeocodedResultsCallback, - callbackOrErrorCallback?: MapQuestGeocodedResultsCallback | ErrorCallback, - errorCallback?: ErrorCallback - ): void { - const reverseQuery = ProviderHelpers.getReverseQueryFromParameters( - latitudeOrQuery, - longitudeOrCallback - ); - const reverseCallback = ProviderHelpers.getCallbackFromParameters( - longitudeOrCallback, - callbackOrErrorCallback - ); - const reverseErrorCallback = ProviderHelpers.getErrorCallbackFromParameters( - longitudeOrCallback, - callbackOrErrorCallback, - errorCallback - ); - - this.externalLoader.setOptions({ - protocol: this.options.useSsl ? "https" : "http", - host: "www.mapquestapi.com", - pathname: "geocoding/v1/reverse", - }); - - const params: MapQuestRequestParams = { - key: this.options.apiKey, - location: `${reverseQuery.getCoordinates().latitude},${ - reverseQuery.getCoordinates().longitude - }`, - jsonpCallback: this.options.useJsonp ? "callback" : undefined, - }; - - this.executeRequest(params, reverseCallback, {}, {}, reverseErrorCallback); - } - - public executeRequest( - params: ExternalLoaderParams, - callback: MapQuestGeocodedResultsCallback, - headers?: ExternalLoaderHeaders, - body?: ExternalLoaderBody, - errorCallback?: ErrorCallback - ): void { - this.externalLoader.executeRequest( - params, - (data) => { - callback( - data.results[0].locations.map((result: MapQuestResult) => - MapQuestProvider.mapToGeocoded(result) - ) - ); - }, - headers, - body, - errorCallback - ); - } - - public static mapToGeocoded(result: MapQuestResult): Geocoded { - const latitude = result.latLng.lat; - const longitude = result.latLng.lng; - const streetName = result.street; - const subLocality = result.adminArea6; - const locality = result.adminArea5; - const { postalCode } = result; - const region = result.adminArea4; - const country = result.adminArea1; - const countryCode = result.adminArea1; - - return Geocoded.create({ - latitude, - longitude, - streetName, - subLocality, - locality, - postalCode, - region, - country, - countryCode, - }); - } -} diff --git a/src/provider/ProviderInterface.ts b/src/provider/ProviderInterface.ts index 38c3585..02b75cd 100644 --- a/src/provider/ProviderInterface.ts +++ b/src/provider/ProviderInterface.ts @@ -14,17 +14,17 @@ import { ResponseError } from "error"; export const DEFAULT_RESULT_LIMIT = 5; -export const defaultProviderOptions: ProviderOptionsInterface = { - useSsl: false, - useJsonp: false, -}; - export interface ProviderOptionsInterface { readonly useSsl?: boolean; readonly useJsonp?: boolean; readonly apiKey?: string; } +export const defaultProviderOptions: ProviderOptionsInterface = { + useSsl: false, + useJsonp: false, +}; + export type GeocodedResultsCallback = ( results: G[] ) => void; diff --git a/src/provider/YandexProvider.ts b/src/provider/YandexProvider.ts index 40f42bb..4a54cd3 100644 --- a/src/provider/YandexProvider.ts +++ b/src/provider/YandexProvider.ts @@ -30,10 +30,6 @@ interface YandexRequestParams { readonly jsonpCallback?: string; } -interface YandexCollectionResult { - GeoObject: YandexResult; -} - export interface YandexResult { metaDataProperty: { GeocoderMetaData: { @@ -77,6 +73,10 @@ export interface YandexResult { }; } +interface YandexCollectionResult { + GeoObject: YandexResult; +} + interface YandexFlattenedAddressDetails { CountryNameCode?: string; CountryName?: string; @@ -242,8 +242,8 @@ export default class YandexProvider implements ProviderInterface { } private static flattenObject< - O extends { [key: string]: O[keyof O] | S }, - S extends string | string[] + S extends string | string[], + O extends { [key: string]: O[keyof O] | S } >(object: O) { const flattened: { [key: string]: S } = {}; diff --git a/src/provider/geoplugin/GeoPluginProvider.ts b/src/provider/geoplugin/GeoPluginProvider.ts index b91bcc0..27342b4 100644 --- a/src/provider/geoplugin/GeoPluginProvider.ts +++ b/src/provider/geoplugin/GeoPluginProvider.ts @@ -20,7 +20,7 @@ import { ReverseQueryObject, } from "query"; import { ResponseError } from "error"; -import AdminLevel from "AdminLevel"; +import AdminLevel, { ADMIN_LEVEL_CODES } from "AdminLevel"; interface GeoPluginRequestParams { [param: string]: string | undefined; @@ -191,7 +191,7 @@ export default class GeoPluginProvider if (result.geoplugin_regionName) { adminLevels.push( AdminLevel.create({ - level: 1, + level: ADMIN_LEVEL_CODES.STATE_CODE, name: result.geoplugin_regionName, code: result.geoplugin_regionCode || undefined, }) diff --git a/src/provider/googlemaps/GoogleMapsProvider.ts b/src/provider/googlemaps/GoogleMapsProvider.ts index 5f2e3a1..064d881 100644 --- a/src/provider/googlemaps/GoogleMapsProvider.ts +++ b/src/provider/googlemaps/GoogleMapsProvider.ts @@ -103,20 +103,6 @@ type GoogleMapsPlaceType = | "transit_station" | "ward"; -export interface GoogleMapsResponse { - results: GoogleMapsResult[]; - status: - | "OK" - | "ZERO_RESULTS" - | "OVER_DAILY_LIMIT" - | "OVER_QUERY_LIMIT" - | "REQUEST_DENIED" - | "INVALID_REQUEST" - | "UNKNOWN_ERROR"; - // eslint-disable-next-line camelcase - error_message?: string; -} - export interface GoogleMapsResult { geometry: { location: GoogleMapsLatLng; @@ -161,6 +147,20 @@ export interface GoogleMapsResult { partial_match?: boolean; } +export interface GoogleMapsResponse { + results: GoogleMapsResult[]; + status: + | "OK" + | "ZERO_RESULTS" + | "OVER_DAILY_LIMIT" + | "OVER_QUERY_LIMIT" + | "REQUEST_DENIED" + | "INVALID_REQUEST" + | "UNKNOWN_ERROR"; + // eslint-disable-next-line camelcase + error_message?: string; +} + export interface GoogleMapsProviderOptionsInterface extends ProviderOptionsInterface { readonly apiKey?: string; diff --git a/src/provider/index.ts b/src/provider/index.ts index 8311be4..c3da807 100644 --- a/src/provider/index.ts +++ b/src/provider/index.ts @@ -8,8 +8,7 @@ export * from "provider/ChainProvider"; export * from "provider/geoplugin"; export * from "provider/googlemaps"; export * from "provider/mapbox"; -export { default as MapquestProvider } from "provider/MapquestProvider"; -export * from "provider/MapquestProvider"; +export * from "provider/mapquest"; export * from "provider/nominatim"; export * from "provider/opencage"; export { default as YandexProvider } from "provider/YandexProvider"; diff --git a/src/provider/mapbox/MapboxProvider.ts b/src/provider/mapbox/MapboxProvider.ts index fb158a5..69b4912 100644 --- a/src/provider/mapbox/MapboxProvider.ts +++ b/src/provider/mapbox/MapboxProvider.ts @@ -18,7 +18,7 @@ import { defaultProviderOptions, } from "provider"; import { Box } from "types"; -import AdminLevel from "AdminLevel"; +import AdminLevel, { ADMIN_LEVEL_CODES } from "AdminLevel"; interface MapboxRequestParams { [param: string]: string | undefined; @@ -33,13 +33,6 @@ interface MapboxRequestParams { readonly types?: string; } -export interface MapboxResponse { - type: "FeatureCollection"; - query: string[]; - features: MapboxResult[]; - attribution: string; -} - interface MapboxFeatureContextProperties { id: string; text: string; @@ -99,6 +92,14 @@ export interface MapboxResult { }; } +export interface MapboxResponse { + type: "FeatureCollection"; + query: string[]; + features: MapboxResult[]; + attribution: string; +} + +// eslint-disable-next-line no-shadow export enum MAPBOX_GEOCODING_MODES { GEOCODING_MODE_PLACES = "mapbox.places", GEOCODING_MODE_PLACES_PERMANENT = "mapbox.places-permanent", @@ -299,7 +300,7 @@ export default class MapboxProvider locality = feature.text; adminLevels.push( AdminLevel.create({ - level: 2, + level: ADMIN_LEVEL_CODES.COUNTY_CODE, name: locality, }) ); @@ -315,7 +316,7 @@ export default class MapboxProvider } adminLevels.push( AdminLevel.create({ - level: 1, + level: ADMIN_LEVEL_CODES.STATE_CODE, name: region, code: adminLevelCode, }) diff --git a/src/provider/mapquest/MapQuestGeocodeQuery.ts b/src/provider/mapquest/MapQuestGeocodeQuery.ts new file mode 100644 index 0000000..34387e7 --- /dev/null +++ b/src/provider/mapquest/MapQuestGeocodeQuery.ts @@ -0,0 +1,133 @@ +import { GeocodeQuery, GeocodeQueryObject } from "query"; +import { MapQuestLocation, MapQuestLocationObject } from "provider"; +import Geocoded, { GeocodedObject } from "Geocoded"; +import { ADMIN_LEVEL_CODES } from "AdminLevel"; + +export interface MapQuestGeocodeQueryObject extends GeocodeQueryObject { + readonly location?: + | MapQuestLocationObject + | MapQuestLocation + | GeocodedObject + | Geocoded; +} + +export default class MapQuestGeocodeQuery extends GeocodeQuery { + private readonly location?: MapQuestLocationObject; + + protected constructor({ + location, + ...geocodeQueryObject + }: MapQuestGeocodeQueryObject) { + super({ + ...geocodeQueryObject, + text: location ? "from_location" : geocodeQueryObject.text, + }); + if (!location) { + return; + } + if ("getLatLng" in location) { + this.location = (location).toObject(); + return; + } + if ("getLocality" in location) { + this.location = MapQuestGeocodeQuery.convertGeocodedToLocationObject( + location + ); + return; + } + let geocodedPropsNumber = 0; + let mapQuestLocationPropsNumber = 0; + const geocodedObject = Geocoded.create({}).toObject(); + Object.keys(geocodedObject).forEach((prop) => { + if (prop in location) { + geocodedPropsNumber += 1; + } + }); + [ + "street", + "adminArea5", + "city", + "adminArea4", + "county", + "adminArea3", + "state", + "adminArea1", + "country", + "postalCode", + "type", + ].forEach((prop) => { + if (prop in location) { + mapQuestLocationPropsNumber += 1; + } + }); + if (geocodedPropsNumber > mapQuestLocationPropsNumber) { + this.location = MapQuestGeocodeQuery.convertGeocodedToLocationObject( + Geocoded.create(location) + ); + return; + } + + this.location = location; + } + + public static create( + object: MapQuestGeocodeQueryObject + ): MapQuestGeocodeQuery { + return new this(object); + } + + public toObject(): MapQuestGeocodeQueryObject { + return { + ...super.toObject(), + location: this.location, + }; + } + + public withLocation( + location: + | MapQuestLocationObject + | MapQuestLocation + | GeocodedObject + | Geocoded + ): MapQuestGeocodeQuery { + return new MapQuestGeocodeQuery({ ...this.toObject(), location }); + } + + public getLocation(): undefined | MapQuestLocationObject { + return this.location; + } + + private static convertGeocodedToLocationObject( + geocoded: Geocoded + ): MapQuestLocationObject { + const location: MapQuestLocationObject = {}; + + const streetParts = [ + geocoded.getStreetNumber() || "", + geocoded.getStreetName() || "", + ]; + const street = streetParts.join(" "); + if (street) { + location.street = street; + } + if (geocoded.getLocality()) { + location.city = geocoded.getLocality(); + } + if (geocoded.getCountry()) { + location.country = geocoded.getCountry(); + } + if (geocoded.getPostalCode()) { + location.postalCode = geocoded.getPostalCode(); + } + geocoded.getAdminLevels().forEach((adminLevel) => { + if (adminLevel.getLevel() === ADMIN_LEVEL_CODES.STATE_CODE) { + location.state = adminLevel.getCode() || adminLevel.getName(); + } + if (adminLevel.getLevel() === ADMIN_LEVEL_CODES.COUNTY_CODE) { + location.county = adminLevel.getCode() || adminLevel.getName(); + } + }); + + return location; + } +} diff --git a/src/provider/mapquest/MapQuestGeocoded.ts b/src/provider/mapquest/MapQuestGeocoded.ts new file mode 100644 index 0000000..794e6de --- /dev/null +++ b/src/provider/mapquest/MapQuestGeocoded.ts @@ -0,0 +1,90 @@ +import Geocoded, { GeocodedObject } from "Geocoded"; + +export interface MapQuestGeocodedObject extends GeocodedObject { + readonly precision?: string; + readonly precisionCode?: string; + readonly mapUrl?: string; + readonly attribution?: string; +} + +export default class MapQuestGeocoded extends Geocoded { + private readonly precision?: string; + + private readonly precisionCode?: string; + + private readonly mapUrl?: string; + + private readonly attribution?: string; + + protected constructor({ + precision, + precisionCode, + mapUrl, + attribution, + ...geocodedObject + }: MapQuestGeocodedObject) { + super(geocodedObject); + this.precision = precision; + this.precisionCode = precisionCode; + this.mapUrl = mapUrl; + this.attribution = attribution; + } + + public static create(object: MapQuestGeocodedObject): MapQuestGeocoded { + return new this(object); + } + + public toObject(): MapQuestGeocodedObject { + return { + ...super.toObject(), + precision: this.precision, + precisionCode: this.precisionCode, + mapUrl: this.mapUrl, + attribution: this.attribution, + }; + } + + public withPrecision(precision: string): MapQuestGeocoded { + return new MapQuestGeocoded({ + ...this.toObject(), + precision, + }); + } + + public getPrecision(): undefined | string { + return this.precision; + } + + public withPrecisionCode(precisionCode: string): MapQuestGeocoded { + return new MapQuestGeocoded({ + ...this.toObject(), + precisionCode, + }); + } + + public getPrecisionCode(): undefined | string { + return this.precisionCode; + } + + public withMapUrl(mapUrl: string): MapQuestGeocoded { + return new MapQuestGeocoded({ + ...this.toObject(), + mapUrl, + }); + } + + public getMapUrl(): undefined | string { + return this.mapUrl; + } + + public withAttribution(attribution: string): MapQuestGeocoded { + return new MapQuestGeocoded({ + ...this.toObject(), + attribution, + }); + } + + public getAttribution(): undefined | string { + return this.attribution; + } +} diff --git a/src/provider/mapquest/MapQuestLocation.ts b/src/provider/mapquest/MapQuestLocation.ts new file mode 100644 index 0000000..a70e2e6 --- /dev/null +++ b/src/provider/mapquest/MapQuestLocation.ts @@ -0,0 +1,139 @@ +import { MapQuestCoordinates } from "provider"; + +export interface MapQuestLocationObject { + latLng?: MapQuestCoordinates; + street?: string; + adminArea1?: string; + country?: string; + adminArea3?: string; + state?: string; + adminArea4?: string; + county?: string; + adminArea5?: string; + city?: string; + postalCode?: string; + type?: "s" | "v"; +} + +export default class MapQuestLocation { + private readonly latLng?: MapQuestCoordinates; + + private readonly street?: string; + + private readonly adminArea1?: string; + + private readonly country?: string; + + private readonly adminArea3?: string; + + private readonly state?: string; + + private readonly adminArea4?: string; + + private readonly county?: string; + + private readonly adminArea5?: string; + + private readonly city?: string; + + private readonly postalCode?: string; + + private readonly type?: "s" | "v"; + + protected constructor({ + latLng, + street, + adminArea1, + country, + adminArea3, + state, + adminArea4, + county, + adminArea5, + city, + postalCode, + type, + }: MapQuestLocationObject) { + this.latLng = latLng; + this.street = street; + this.adminArea1 = adminArea1; + this.country = country; + this.adminArea3 = adminArea3; + this.state = state; + this.adminArea4 = adminArea4; + this.county = county; + this.adminArea5 = adminArea5; + this.city = city; + this.postalCode = postalCode; + this.type = type; + } + + public static create(object: MapQuestLocationObject): MapQuestLocation { + return new this(object); + } + + public toObject(): MapQuestLocationObject { + return { + latLng: this.latLng, + street: this.street, + adminArea1: this.adminArea1, + country: this.country, + adminArea3: this.adminArea3, + state: this.state, + adminArea4: this.adminArea4, + county: this.county, + adminArea5: this.adminArea5, + city: this.city, + postalCode: this.postalCode, + type: this.type, + }; + } + + public getLatLng(): undefined | MapQuestCoordinates { + return this.latLng; + } + + public getStreet(): undefined | string { + return this.street; + } + + public getAdminArea1(): undefined | string { + return this.adminArea1; + } + + public getCountry(): undefined | string { + return this.country; + } + + public getAdminArea3(): undefined | string { + return this.adminArea3; + } + + public getState(): undefined | string { + return this.state; + } + + public getAdminArea4(): undefined | string { + return this.adminArea4; + } + + public getCounty(): undefined | string { + return this.county; + } + + public getAdminArea5(): undefined | string { + return this.adminArea5; + } + + public getCity(): undefined | string { + return this.city; + } + + public getPostalCode(): undefined | string { + return this.postalCode; + } + + public getType(): undefined | "s" | "v" { + return this.type; + } +} diff --git a/src/provider/mapquest/MapQuestProvider.ts b/src/provider/mapquest/MapQuestProvider.ts new file mode 100644 index 0000000..238b4c1 --- /dev/null +++ b/src/provider/mapquest/MapQuestProvider.ts @@ -0,0 +1,374 @@ +import { + ExternalLoaderBody, + ExternalLoaderHeaders, + ExternalLoaderInterface, + ExternalLoaderParams, +} from "ExternalLoader"; +import { + ErrorCallback, + GeocodedResultsCallback, + MapQuestGeocoded, + MapQuestGeocodeQuery, + MapQuestGeocodeQueryObject, + ProviderHelpers, + ProviderInterface, + ProviderOptionsInterface, + defaultProviderOptions, +} from "provider"; +import { ReverseQuery, ReverseQueryObject } from "query"; +import AdminLevel, { ADMIN_LEVEL_CODES } from "AdminLevel"; +import { ResponseError } from "error"; + +interface MapQuestRequestParams { + [param: string]: string | undefined; + readonly key: string; + readonly location?: string; + readonly boundingBox?: string; + readonly maxResults?: string; + readonly jsonpCallback?: string; +} + +export interface MapQuestCoordinates { + lat: number; + lng: number; +} + +export interface MapQuestResult { + latLng: MapQuestCoordinates; + displayLatLng: MapQuestCoordinates; + street: string; + sideOfStreet: string; + adminArea1?: string; + adminArea1Type?: string; + adminArea3?: string; + adminArea3Type?: string; + adminArea4?: string; + adminArea4Type?: string; + adminArea5?: string; + adminArea5Type?: string; + adminArea6?: string; + adminArea6Type?: string; + postalCode: string; + type: "s" | "v"; + linkId: string; + dragPoint: boolean; + geocodeQuality: + | "POINT" + | "ADDRESS" + | "INTERSECTION" + | "STREET" + | "COUNTRY" + | "STATE" + | "COUNTY" + | "CITY" + | "NEIGHBORHOOD" + | "ZIP" + | "ZIP_EXTENDED"; + geocodeQualityCode: string; + mapUrl: string; +} + +export interface MapQuestResponse { + info: { + statuscode: 0 | 400 | 403 | 500; + copyright: { + text: string; + imageUrl: string; + imageAltText: string; + }; + messages: string[]; + }; + results: { + providedLocation: { + location?: string; + latLng?: MapQuestCoordinates; + }; + locations: MapQuestResult[]; + }[]; +} + +export interface MapQuestProviderOptionsInterface + extends ProviderOptionsInterface { + readonly apiKey: string; + readonly method?: "GET" | "POST"; + readonly openDomain?: boolean; +} + +export const defaultMapQuestProviderOptions: MapQuestProviderOptionsInterface = { + ...defaultProviderOptions, + apiKey: "", + method: "GET", + openDomain: false, +}; + +type MapQuestGeocodedResultsCallback = GeocodedResultsCallback< + MapQuestGeocoded +>; + +export default class MapQuestProvider + implements ProviderInterface { + private externalLoader: ExternalLoaderInterface; + + private options: MapQuestProviderOptionsInterface; + + public constructor( + _externalLoader: ExternalLoaderInterface, + options: MapQuestProviderOptionsInterface = defaultMapQuestProviderOptions + ) { + this.externalLoader = _externalLoader; + this.options = { ...defaultMapQuestProviderOptions, ...options }; + if (!this.options.apiKey) { + throw new Error( + 'An API key is required for the MapQuest provider. Please add it in the "apiKey" option.' + ); + } + if (this.options.method && !["GET", "POST"].includes(this.options.method)) { + throw new Error('The "method" option can either be "GET" or "POST".'); + } + } + + public geocode( + query: string | MapQuestGeocodeQuery | MapQuestGeocodeQueryObject, + callback: MapQuestGeocodedResultsCallback, + errorCallback?: ErrorCallback + ): void { + const geocodeQuery = ProviderHelpers.getGeocodeQueryFromParameter( + query, + MapQuestGeocodeQuery + ); + + if (geocodeQuery.getIp()) { + throw new Error( + "The MapQuest provider does not support IP geolocation, only location geocoding." + ); + } + + this.externalLoader.setOptions({ + method: this.options.method, + protocol: this.options.useSsl ? "https" : "http", + host: this.options.openDomain + ? "open.mapquestapi.com" + : "www.mapquestapi.com", + pathname: "geocoding/v1/address", + }); + + let requestParams: { + location?: string; + boundingBox?: string; + maxResults?: string; + } = { + boundingBox: geocodeQuery.getBounds() + ? `${geocodeQuery.getBounds()?.north},${ + geocodeQuery.getBounds()?.west + },${geocodeQuery.getBounds()?.south},${ + geocodeQuery.getBounds()?.east + }` + : undefined, + maxResults: geocodeQuery.getLimit().toString(), + }; + if ((geocodeQuery).getLocation()) { + requestParams = { + ...(geocodeQuery).getLocation(), + ...requestParams, + }; + } else { + requestParams = { + location: geocodeQuery.getText(), + ...requestParams, + }; + } + + requestParams = this.options.method === "GET" ? requestParams : {}; + const params: MapQuestRequestParams = this.withCommonParams(requestParams); + + const body = + this.options.method === "POST" + ? { + location: (geocodeQuery).getLocation() + ? ( + (geocodeQuery).getLocation() + ) + : geocodeQuery.getText(), + options: { + boundingBox: geocodeQuery.getBounds() + ? { + ul: { + lat: geocodeQuery.getBounds()?.north, + lng: geocodeQuery.getBounds()?.west, + }, + lr: { + lat: geocodeQuery.getBounds()?.south, + lng: geocodeQuery.getBounds()?.east, + }, + } + : undefined, + maxResults: geocodeQuery.getLimit().toString(), + }, + } + : {}; + + this.executeRequest(params, callback, {}, body, errorCallback); + } + + public geodecode( + latitudeOrQuery: number | string | ReverseQuery | ReverseQueryObject, + longitudeOrCallback: number | string | MapQuestGeocodedResultsCallback, + callbackOrErrorCallback?: MapQuestGeocodedResultsCallback | ErrorCallback, + errorCallback?: ErrorCallback + ): void { + const reverseQuery = ProviderHelpers.getReverseQueryFromParameters( + latitudeOrQuery, + longitudeOrCallback + ); + const reverseCallback = ProviderHelpers.getCallbackFromParameters( + longitudeOrCallback, + callbackOrErrorCallback + ); + const reverseErrorCallback = ProviderHelpers.getErrorCallbackFromParameters( + longitudeOrCallback, + callbackOrErrorCallback, + errorCallback + ); + + this.externalLoader.setOptions({ + method: this.options.method, + protocol: this.options.useSsl ? "https" : "http", + host: this.options.openDomain + ? "open.mapquestapi.com" + : "www.mapquestapi.com", + pathname: "geocoding/v1/reverse", + }); + + const requestParams = + this.options.method === "GET" + ? { + location: `${reverseQuery.getCoordinates().latitude},${ + reverseQuery.getCoordinates().longitude + }`, + } + : {}; + const params: MapQuestRequestParams = this.withCommonParams(requestParams); + + const body = + this.options.method === "POST" + ? { + location: { + latLng: { + lat: reverseQuery.getCoordinates().latitude, + lng: reverseQuery.getCoordinates().longitude, + }, + }, + } + : {}; + + this.executeRequest( + params, + reverseCallback, + {}, + body, + reverseErrorCallback + ); + } + + private withCommonParams( + params: Pick< + MapQuestRequestParams, + "location" | "boundingBox" | "maxResults" + > + ): MapQuestRequestParams { + return { + ...params, + key: this.options.apiKey || "", + jsonpCallback: this.options.useJsonp ? "callback" : undefined, + }; + } + + public executeRequest( + params: ExternalLoaderParams, + callback: MapQuestGeocodedResultsCallback, + headers?: ExternalLoaderHeaders, + body?: ExternalLoaderBody, + errorCallback?: ErrorCallback + ): void { + this.externalLoader.executeRequest( + params, + (data: MapQuestResponse) => { + if (data.info.statuscode !== 0) { + const errorMessage = `An error has occurred (${ + data.info.statuscode + }): ${data.info.messages.join(" / ")}`; + if (errorCallback) { + errorCallback(new ResponseError(errorMessage, data)); + return; + } + setTimeout(() => { + throw new Error(errorMessage); + }); + return; + } + callback( + data.results[0].locations.map((result: MapQuestResult) => + MapQuestProvider.mapToGeocoded(result, data.info.copyright.text) + ) + ); + }, + headers, + body, + errorCallback + ); + } + + public static mapToGeocoded( + result: MapQuestResult, + attribution?: string + ): MapQuestGeocoded { + const latitude = result.latLng.lat; + const longitude = result.latLng.lng; + const streetName = result.street; + const subLocality = result.adminArea6; + const locality = result.adminArea5; + const { postalCode } = result; + const region = result.adminArea4; + const country = result.adminArea1; + const countryCode = result.adminArea1; + const precision = result.geocodeQuality; + const precisionCode = result.geocodeQualityCode; + const { mapUrl } = result; + + const geocoded = MapQuestGeocoded.create({ + latitude, + longitude, + streetName, + subLocality, + locality, + postalCode, + region, + country, + countryCode, + attribution, + precision, + precisionCode, + mapUrl, + }); + + if (result.adminArea3) { + geocoded.addAdminLevel( + AdminLevel.create({ + level: ADMIN_LEVEL_CODES.STATE_CODE, + name: result.adminArea3, + code: result.adminArea3.length === 2 ? result.adminArea3 : undefined, + }) + ); + } + if (result.adminArea4) { + geocoded.addAdminLevel( + AdminLevel.create({ + level: ADMIN_LEVEL_CODES.COUNTY_CODE, + name: result.adminArea4, + }) + ); + } + + return geocoded; + } +} diff --git a/src/provider/mapquest/index.ts b/src/provider/mapquest/index.ts new file mode 100644 index 0000000..f499690 --- /dev/null +++ b/src/provider/mapquest/index.ts @@ -0,0 +1,7 @@ +export { default as MapQuestGeocoded } from "provider/mapquest/MapQuestGeocoded"; +export { default as MapQuestGeocodeQuery } from "provider/mapquest/MapQuestGeocodeQuery"; +export * from "provider/mapquest/MapQuestGeocodeQuery"; +export { default as MapQuestLocation } from "provider/mapquest/MapQuestLocation"; +export * from "provider/mapquest/MapQuestLocation"; +export { default as MapQuestProvider } from "provider/mapquest/MapQuestProvider"; +export * from "provider/mapquest/MapQuestProvider"; diff --git a/src/provider/nominatim/NominatimProvider.ts b/src/provider/nominatim/NominatimProvider.ts index 8734a55..4a2b52e 100644 --- a/src/provider/nominatim/NominatimProvider.ts +++ b/src/provider/nominatim/NominatimProvider.ts @@ -43,11 +43,6 @@ interface NominatimErrorResponse { error: string; } -export type NominatimResponse = - | NominatimErrorResponse - | NominatimResult - | NominatimResult[]; - export interface NominatimResult { // eslint-disable-next-line camelcase place_id: number; @@ -86,6 +81,11 @@ export interface NominatimResult { }; } +export type NominatimResponse = + | NominatimErrorResponse + | NominatimResult + | NominatimResult[]; + export interface NominatimProviderOptionsInterface extends ProviderOptionsInterface { readonly host?: string; diff --git a/src/provider/opencage/OpenCageProvider.ts b/src/provider/opencage/OpenCageProvider.ts index 3867bed..2e356cf 100644 --- a/src/provider/opencage/OpenCageProvider.ts +++ b/src/provider/opencage/OpenCageProvider.ts @@ -48,38 +48,6 @@ interface OpenCageSun { nautical: number; } -export interface OpenCageResponse { - documentation: string; - licences: { - name: string; - url: string; - }[]; - rate: { - limit: number; - remaining: number; - reset: number; - }; - results: OpenCageResult[]; - status: { - code: 200 | 400 | 401 | 402 | 403 | 404 | 405 | 408 | 410 | 429 | 503; - message: string; - }; - // eslint-disable-next-line camelcase - stay_informed: { - blog: string; - twitter: string; - }; - thanks: string; - timestamp: { - // eslint-disable-next-line camelcase - created_http: string; - // eslint-disable-next-line camelcase - created_unix: number; - }; - // eslint-disable-next-line camelcase - total_results: number; -} - export interface OpenCageResult { annotations: { callingcode: number; @@ -267,6 +235,38 @@ export interface OpenCageResult { geometry: OpenCageCoordinates; } +export interface OpenCageResponse { + documentation: string; + licences: { + name: string; + url: string; + }[]; + rate: { + limit: number; + remaining: number; + reset: number; + }; + results: OpenCageResult[]; + status: { + code: 200 | 400 | 401 | 402 | 403 | 404 | 405 | 408 | 410 | 429 | 503; + message: string; + }; + // eslint-disable-next-line camelcase + stay_informed: { + blog: string; + twitter: string; + }; + thanks: string; + timestamp: { + // eslint-disable-next-line camelcase + created_http: string; + // eslint-disable-next-line camelcase + created_unix: number; + }; + // eslint-disable-next-line camelcase + total_results: number; +} + export interface OpenCageProviderOptionsInterface extends ProviderOptionsInterface { readonly apiKey: string; From 977923a93b70f616cc7086a32656683def80a557 Mon Sep 17 00:00:00 2001 From: Alan Poulain Date: Fri, 4 Sep 2020 18:43:32 +0200 Subject: [PATCH 43/56] chore: exclude MapQuestLocation from coverage --- .nycrc.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.nycrc.json b/.nycrc.json index c2a4c8f..8e47560 100644 --- a/.nycrc.json +++ b/.nycrc.json @@ -1,4 +1,4 @@ { "cache": false, - "exclude": ["spec/**", "**/index.ts", "**/AdminLevel.ts", "**/*Geocoded.ts", "**/*GeocodeQuery.ts", "**/*ReverseQuery.ts", "**/ResponseError.ts"] + "exclude": ["spec/**", "**/index.ts", "**/AdminLevel.ts", "**/*Geocoded.ts", "**/*GeocodeQuery.ts", "**/*ReverseQuery.ts", "**/ResponseError.ts", "src/provider/mapquest/MapQuestLocation.ts"] } From 5827f554d4b358aac5a0dbdebae978f8386f27ca Mon Sep 17 00:00:00 2001 From: Alan Poulain Date: Fri, 4 Sep 2020 18:45:59 +0200 Subject: [PATCH 44/56] 0.6.0 --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index e37a7be..ee4889d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "universal-geocoder", - "version": "0.5.0", + "version": "0.6.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 0c7154a..41c1c31 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "universal-geocoder", "description": "Universal geocoding abstraction with multiple built-in providers", - "version": "0.5.0", + "version": "0.6.0", "keywords": [ "geocoder", "geocoding", From b904a7af8ff0f2ad397dff56df282791c03a6b34 Mon Sep 17 00:00:00 2001 From: Alan Poulain Date: Mon, 7 Sep 2020 18:29:42 +0200 Subject: [PATCH 45/56] chore: use Shields.io badges in README --- README.md | 8 ++++++-- website/css/main.css | 9 +++++++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index d0c7e5f..50567f6 100644 --- a/README.md +++ b/README.md @@ -3,8 +3,12 @@ Universal Geocoder ================== -[![CI](https://github.com/universal-geocoder/universal-geocoder-js/workflows/Continuous%20Integration/badge.svg?branch=main&event=push)](https://github.com/universal-geocoder/universal-geocoder-js/actions) -[![codecov](https://codecov.io/gh/universal-geocoder/universal-geocoder-js/branch/main/graph/badge.svg)](https://codecov.io/gh/universal-geocoder/universal-geocoder-js) +[![CI](https://img.shields.io/github/workflow/status/universal-geocoder/universal-geocoder-js/Continuous%20Integration?event=push)](https://github.com/universal-geocoder/universal-geocoder-js/actions) +[![codecov](https://img.shields.io/codecov/c/gh/universal-geocoder/universal-geocoder-js/main)](https://codecov.io/gh/universal-geocoder/universal-geocoder-js) + +[![npm](https://img.shields.io/npm/v/universal-geocoder)](https://www.npmjs.com/package/universal-geocoder) +![minified-size](https://img.shields.io/bundlephobia/min/universal-geocoder) +![downloads](https://img.shields.io/npm/dw/universal-geocoder) Universal Geocoder is a universal JavaScript library for client-side geocoding applications with multiple built-in providers. diff --git a/website/css/main.css b/website/css/main.css index 436e61f..145c144 100644 --- a/website/css/main.css +++ b/website/css/main.css @@ -49,6 +49,15 @@ img[alt="CI"] { img[alt="codecov"] { display: none; } +img[alt="npm"] { + display: none; +} +img[alt="minified-size"] { + display: none; +} +img[alt="downloads"] { + display: none; +} #content img { max-width: 100%; From 93e34ff345db5756b40d4ca4f2735dd0642a5319 Mon Sep 17 00:00:00 2001 From: Alan Poulain Date: Mon, 7 Sep 2020 18:37:46 +0200 Subject: [PATCH 46/56] chore: add missing links for badges in README --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 50567f6..2482f6c 100644 --- a/README.md +++ b/README.md @@ -7,8 +7,8 @@ Universal Geocoder [![codecov](https://img.shields.io/codecov/c/gh/universal-geocoder/universal-geocoder-js/main)](https://codecov.io/gh/universal-geocoder/universal-geocoder-js) [![npm](https://img.shields.io/npm/v/universal-geocoder)](https://www.npmjs.com/package/universal-geocoder) -![minified-size](https://img.shields.io/bundlephobia/min/universal-geocoder) -![downloads](https://img.shields.io/npm/dw/universal-geocoder) +[![minified-size](https://img.shields.io/bundlephobia/min/universal-geocoder)](https://bundlephobia.com/result?p=universal-geocoder) +[![downloads](https://img.shields.io/npm/dw/universal-geocoder)](https://www.npmjs.com/package/universal-geocoder) Universal Geocoder is a universal JavaScript library for client-side geocoding applications with multiple built-in providers. From 39717526337b84212e554e9cddb62abdd6c79160 Mon Sep 17 00:00:00 2001 From: Alan Poulain Date: Fri, 25 Sep 2020 22:49:14 +0200 Subject: [PATCH 47/56] feat: better Yandex provider (#9) * feat: better Yandex provider Make the use of bounds more coherent too. * chore: bump dev dependencies --- CHANGELOG.md | 8 + README.md | 4 +- docs/provider_usage/mapbox.md | 2 +- docs/provider_usage/nominatim.md | 3 +- docs/provider_usage/opencage.md | 2 +- docs/provider_usage/yandex.md | 17 +- package-lock.json | 532 +++++++++++------- package.json | 6 +- spec/GeoJsonDumper.spec.ts | 18 +- spec/Geocoded.spec.ts | 24 +- spec/GeocoderProviderFactory.spec.ts | 4 +- spec/provider/BingProvider.spec.ts | 24 +- spec/provider/ChainProvider.spec.ts | 56 +- spec/provider/GeoPluginProvider.spec.ts | 14 +- spec/provider/GoogleMapsProvider.spec.ts | 24 +- spec/provider/MapQuestProvider.spec.ts | 28 +- spec/provider/MapboxProvider.spec.ts | 14 +- spec/provider/NominatimProvider.spec.ts | 24 +- spec/provider/OpenCageProvider.spec.ts | 19 +- spec/provider/YandexProvider.spec.ts | 56 +- .../recording.har | 36 +- .../recording.har | 26 +- .../recording.har | 26 +- .../recording.har | 24 +- .../recording.har | 32 +- .../recording.har | 30 +- .../recording.har | 28 +- .../recording.har | 28 +- .../recording.har | 24 +- .../recording.har | 34 +- .../recording.har | 26 +- .../recording.har | 28 +- .../recording.har | 20 +- src/GeoJsonDumper.ts | 19 +- src/Geocoded.ts | 51 +- src/GeocoderProviderFactory.ts | 6 +- src/index.ts | 12 - src/provider/BingProvider.ts | 12 +- src/provider/googlemaps/GoogleMapsProvider.ts | 45 +- src/provider/index.ts | 3 +- src/provider/mapbox/MapboxGeocodeQuery.ts | 6 + src/provider/mapbox/MapboxProvider.ts | 22 +- src/provider/mapquest/MapQuestProvider.ts | 16 +- .../nominatim/NominatimGeocodeQuery.ts | 25 +- src/provider/nominatim/NominatimProvider.ts | 22 +- src/provider/opencage/OpenCageGeocodeQuery.ts | 7 +- src/provider/opencage/OpenCageProvider.ts | 22 +- src/provider/yandex/YandexGeocodeQuery.ts | 110 ++++ src/provider/yandex/YandexGeocoded.ts | 57 ++ src/provider/{ => yandex}/YandexProvider.ts | 226 ++++++-- src/provider/yandex/YandexReverseQuery.ts | 56 ++ src/provider/yandex/index.ts | 7 + src/query/GeocodeQuery.ts | 66 +-- src/query/ReverseQuery.ts | 2 +- src/types.ts | 14 + 55 files changed, 1261 insertions(+), 786 deletions(-) create mode 100644 src/provider/yandex/YandexGeocodeQuery.ts create mode 100644 src/provider/yandex/YandexGeocoded.ts rename src/provider/{ => yandex}/YandexProvider.ts (52%) create mode 100644 src/provider/yandex/YandexReverseQuery.ts create mode 100644 src/provider/yandex/index.ts diff --git a/CHANGELOG.md b/CHANGELOG.md index fb751a7..b136fc3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 0.7.0 + +* [Yandex] Better Yandex provider +* [Nominatim] Remove `viewBox` parameter in `GeocodeQuery` to use `bounds` instead +* [GeoJsonDumper] Returns an object with `latitude1`, `longitude1`, `latitude2`, `longitude2` keys for `bounds`. +* The `bounds` parameter in `GeocodeQuery` is now an object with `latitude1`, `longitude1`, `latitude2`, `longitude2` keys. +* `Geocoded` returns an object with `latitude1`, `longitude1`, `latitude2`, `longitude2` keys for the `bounds`. + ## 0.6.0 * [MapQuest] Better MapQuest provider diff --git a/README.md b/README.md index 2482f6c..c91fa73 100644 --- a/README.md +++ b/README.md @@ -103,7 +103,7 @@ googleGeocoder.geodecode(reverseQuery, (result) => { - `text`: what is searched - `ip`: the IP searched -- `south`, `west`, `north`, `east` (`withBounds` method): the bounds to use +- `bounds` (object with `latitude1`, `longitude1`, `latitude2` and `longitude2` keys): the bounds to use - `locale`: the locale to use for the query - `limit`: the maximum number of results to have @@ -117,7 +117,7 @@ googleGeocoder.geodecode(reverseQuery, (result) => { The result of a query is a `Geocoded` object which maps the following common information: - Coordinates (latitute and longitude) -- Bounds (south, west, north, east) +- Bounds (latitude1, longitude1, latitude2, longitude2) - Formatted address - Address details: street number, street name, (sub) locality, postal code, region, administration levels, country (with its code) - Time zone diff --git a/docs/provider_usage/mapbox.md b/docs/provider_usage/mapbox.md index 55afd3c..e7d02c0 100644 --- a/docs/provider_usage/mapbox.md +++ b/docs/provider_usage/mapbox.md @@ -8,7 +8,7 @@ ## `geocode` parameters - `countryCodes`: to restrict the results to one or more countries (ISO 3166 alpha 2 country codes) -- `proximity`: to bias the response to favor results that are closer to the specified location +- `proximity` (object with `latitude` and `longitude` keys): to bias the response to favor results that are closer to the specified location - `locationTypes` (possible values: "country", "region", "postcode", "district", "place", "locality", "neighborhood", "address", "poi"): to filter the results to a subset of location types ## `geodecode` parameters diff --git a/docs/provider_usage/nominatim.md b/docs/provider_usage/nominatim.md index 8334f38..57b2699 100644 --- a/docs/provider_usage/nominatim.md +++ b/docs/provider_usage/nominatim.md @@ -10,8 +10,7 @@ - `countryCodes`: to restrict the results to one or more countries (ISO 3166 alpha 2 country codes) - `excludePlaceIds`: for excluding some OpenStreetMap objects from the results -- `viewBox` ([longitude 1, latitude 1, longitude 2, latitude 2]): the preferred area to find search results -- `bounded` (only if `viewBox` is used): boolean to restrict the results to items within the view box +- `bounded` (only if `bounds` is used): boolean to restrict the results to items within the bounds ## `geodecode` parameters diff --git a/docs/provider_usage/opencage.md b/docs/provider_usage/opencage.md index c967c3f..ce33455 100644 --- a/docs/provider_usage/opencage.md +++ b/docs/provider_usage/opencage.md @@ -7,7 +7,7 @@ ## `geocode` parameters - `countryCodes`: to restrict the results to one or more countries (ISO 3166 alpha 2 country codes) -- `proximity`: to provide a hint to bias results in favour of those closer to the specified location +- `proximity` (object with `latitude` and `longitude` keys): to provide a hint to bias results in favour of those closer to the specified location - `minConfidence` (from 1 to 10): only results with at least this confidence will be returned - `noRecord`: boolean to ask for the query to not be logged diff --git a/docs/provider_usage/yandex.md b/docs/provider_usage/yandex.md index c8b8409..23577b1 100644 --- a/docs/provider_usage/yandex.md +++ b/docs/provider_usage/yandex.md @@ -1,5 +1,18 @@ # Yandex Usage -## Options +## `geocode` parameters -- `toponym`: the type of toponym ("house", "street", "metro", "district", "locality") +- `bounded` (only if `bounds` or `proximity` is used): boolean to restrict the results to items within the bounds +- `proximity` (object with `latitude` and `longitude` keys): center of the search area +- `span` (object with `spanLatitude` and `spanLongitude` keys): span of the search area +- `skip`: the number of items to skip in the response + +## `geodecode` parameters + +- `locationTypes` (possible values: "house", "street", "metro", "district", "locality", ...): to filter the results by location types +- `skip`: the number of items to skip in the response + +## `Geocoded` properties + +- `locationType`: the type of location +- `precision`: the quality of the geocoding result diff --git a/package-lock.json b/package-lock.json index ee4889d..95aa6f5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -301,16 +301,16 @@ } }, "@commitlint/cli": { - "version": "10.0.0", - "resolved": "https://registry.npmjs.org/@commitlint/cli/-/cli-10.0.0.tgz", - "integrity": "sha512-a+dLjNovvMyom0GNcKj9ebmgtbJEKuhJuqwPUmfNy3yPoM4h12b3hjVOS33IyvpbKmlYUJg8dgcr4S5FhFvhFg==", + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/@commitlint/cli/-/cli-11.0.0.tgz", + "integrity": "sha512-YWZWg1DuqqO5Zjh7vUOeSX76vm0FFyz4y0cpGMFhrhvUi5unc4IVfCXZ6337R9zxuBtmveiRuuhQqnRRer+13g==", "dev": true, "requires": { - "@babel/runtime": "^7.9.6", - "@commitlint/format": "^10.0.0", - "@commitlint/lint": "^10.0.0", - "@commitlint/load": "^10.0.0", - "@commitlint/read": "^10.0.0", + "@babel/runtime": "^7.11.2", + "@commitlint/format": "^11.0.0", + "@commitlint/lint": "^11.0.0", + "@commitlint/load": "^11.0.0", + "@commitlint/read": "^11.0.0", "chalk": "4.1.0", "core-js": "^3.6.1", "get-stdin": "8.0.0", @@ -321,71 +321,71 @@ } }, "@commitlint/config-conventional": { - "version": "10.0.0", - "resolved": "https://registry.npmjs.org/@commitlint/config-conventional/-/config-conventional-10.0.0.tgz", - "integrity": "sha512-M9l7hh2a1GB9nQ/Gm+aDLGPmzGdpgxqJoSmrbTxDlapJDyaL7FPe5aQf66F50Eq3j0bmaRaJihFCA6mIUBQAag==", + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/@commitlint/config-conventional/-/config-conventional-11.0.0.tgz", + "integrity": "sha512-SNDRsb5gLuDd2PL83yCOQX6pE7gevC79UPFx+GLbLfw6jGnnbO9/tlL76MLD8MOViqGbo7ZicjChO9Gn+7tHhA==", "dev": true, "requires": { "conventional-changelog-conventionalcommits": "^4.3.1" } }, "@commitlint/ensure": { - "version": "10.0.0", - "resolved": "https://registry.npmjs.org/@commitlint/ensure/-/ensure-10.0.0.tgz", - "integrity": "sha512-OBlv6Hw91u4Gqz4ocKO7IyIvQ6ZmKbJaLFf8MD0EOH3Prn0aatiiqUB0+paBELKt3yWdwQNYI8ZkzZWtj4EcYw==", + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/@commitlint/ensure/-/ensure-11.0.0.tgz", + "integrity": "sha512-/T4tjseSwlirKZdnx4AuICMNNlFvRyPQimbZIOYujp9DSO6XRtOy9NrmvWujwHsq9F5Wb80QWi4WMW6HMaENug==", "dev": true, "requires": { - "@commitlint/types": "^10.0.0", + "@commitlint/types": "^11.0.0", "lodash": "^4.17.19" } }, "@commitlint/execute-rule": { - "version": "10.0.0", - "resolved": "https://registry.npmjs.org/@commitlint/execute-rule/-/execute-rule-10.0.0.tgz", - "integrity": "sha512-vRIp6Cwy+C1dOh5VAcoBks+8UI+rpxOB5cwhU/RQZhlVd2hgFiAPXnyKWMOB7HDO9XFI5amLJehvaaDI+eLDnA==", + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/@commitlint/execute-rule/-/execute-rule-11.0.0.tgz", + "integrity": "sha512-g01p1g4BmYlZ2+tdotCavrMunnPFPhTzG1ZiLKTCYrooHRbmvqo42ZZn4QMStUEIcn+jfLb6BRZX3JzIwA1ezQ==", "dev": true }, "@commitlint/format": { - "version": "10.0.0", - "resolved": "https://registry.npmjs.org/@commitlint/format/-/format-10.0.0.tgz", - "integrity": "sha512-EpCmMCcjloeaoUtgmzlpYmIYJzAvZhYfLJ7YCrOlnmt5/MAeywuNgxcr/EM2xHgEKotTWqRQdiIgAtkIWHhgrQ==", + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/@commitlint/format/-/format-11.0.0.tgz", + "integrity": "sha512-bpBLWmG0wfZH/svzqD1hsGTpm79TKJWcf6EXZllh2J/LSSYKxGlv967lpw0hNojme0sZd4a/97R3qA2QHWWSLg==", "dev": true, "requires": { - "@commitlint/types": "^10.0.0", + "@commitlint/types": "^11.0.0", "chalk": "^4.0.0" } }, "@commitlint/is-ignored": { - "version": "10.0.0", - "resolved": "https://registry.npmjs.org/@commitlint/is-ignored/-/is-ignored-10.0.0.tgz", - "integrity": "sha512-OLjUs/0HaQGh5iSqv/jF/TXqQ8sJ5VShujTmADSvnGTyruZu+d1Hfgw9QM1FMjzcx2NpMDsX/EFBU0ZMx9hmEg==", + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/@commitlint/is-ignored/-/is-ignored-11.0.0.tgz", + "integrity": "sha512-VLHOUBN+sOlkYC4tGuzE41yNPO2w09sQnOpfS+pSPnBFkNUUHawEuA44PLHtDvQgVuYrMAmSWFQpWabMoP5/Xg==", "dev": true, "requires": { - "@commitlint/types": "^10.0.0", + "@commitlint/types": "^11.0.0", "semver": "7.3.2" } }, "@commitlint/lint": { - "version": "10.0.0", - "resolved": "https://registry.npmjs.org/@commitlint/lint/-/lint-10.0.0.tgz", - "integrity": "sha512-KcDzOMQYVLziWIXNedTDnf5LS9NMYKzcdzjuCH8jTZLx/oX3kuOVB0jYZHVaKPwjj0miZSOhONqIMJDlLZpn+g==", + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/@commitlint/lint/-/lint-11.0.0.tgz", + "integrity": "sha512-Q8IIqGIHfwKr8ecVZyYh6NtXFmKw4YSEWEr2GJTB/fTZXgaOGtGFZDWOesCZllQ63f1s/oWJYtVv5RAEuwN8BQ==", "dev": true, "requires": { - "@commitlint/is-ignored": "^10.0.0", - "@commitlint/parse": "^10.0.0", - "@commitlint/rules": "^10.0.0", - "@commitlint/types": "^10.0.0" + "@commitlint/is-ignored": "^11.0.0", + "@commitlint/parse": "^11.0.0", + "@commitlint/rules": "^11.0.0", + "@commitlint/types": "^11.0.0" } }, "@commitlint/load": { - "version": "10.0.0", - "resolved": "https://registry.npmjs.org/@commitlint/load/-/load-10.0.0.tgz", - "integrity": "sha512-pUwGshEpxkU2R9U3O5hwHU4VT0zkyIs5gzGrGbR2c/aurI9qe00LZ9DquYVVYVmfwG6UaQpatCG4TrXNXIj5Mg==", + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/@commitlint/load/-/load-11.0.0.tgz", + "integrity": "sha512-t5ZBrtgvgCwPfxmG811FCp39/o3SJ7L+SNsxFL92OR4WQxPcu6c8taD0CG2lzOHGuRyuMxZ7ps3EbngT2WpiCg==", "dev": true, "requires": { - "@commitlint/execute-rule": "^10.0.0", - "@commitlint/resolve-extends": "^10.0.0", - "@commitlint/types": "^10.0.0", + "@commitlint/execute-rule": "^11.0.0", + "@commitlint/resolve-extends": "^11.0.0", + "@commitlint/types": "^11.0.0", "chalk": "4.1.0", "cosmiconfig": "^7.0.0", "lodash": "^4.17.19", @@ -393,15 +393,15 @@ } }, "@commitlint/message": { - "version": "10.0.0", - "resolved": "https://registry.npmjs.org/@commitlint/message/-/message-10.0.0.tgz", - "integrity": "sha512-2ZDgHc6v3t1C/zkAkRwPDIRVD/jbrQAu+Iqe7VH1/Y//cJhwte6OuSGfs2Qze/6gh+/RbvUIBskR8OUIY6VTrA==", + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/@commitlint/message/-/message-11.0.0.tgz", + "integrity": "sha512-01ObK/18JL7PEIE3dBRtoMmU6S3ecPYDTQWWhcO+ErA3Ai0KDYqV5VWWEijdcVafNpdeUNrEMigRkxXHQLbyJA==", "dev": true }, "@commitlint/parse": { - "version": "10.0.0", - "resolved": "https://registry.npmjs.org/@commitlint/parse/-/parse-10.0.0.tgz", - "integrity": "sha512-xIBD0w85FVhrlX4pI/m4xF9MvTQNMbvilPSr42yIds2xn7GJcJidN4Z8O6qCqcjwl6f3ruQ8G8Pdi3PggVjZrw==", + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/@commitlint/parse/-/parse-11.0.0.tgz", + "integrity": "sha512-DekKQAIYWAXIcyAZ6/PDBJylWJ1BROTfDIzr9PMVxZRxBPc1gW2TG8fLgjZfBP5mc0cuthPkVi91KQQKGri/7A==", "dev": true, "requires": { "conventional-changelog-angular": "^5.0.0", @@ -409,20 +409,20 @@ } }, "@commitlint/read": { - "version": "10.0.0", - "resolved": "https://registry.npmjs.org/@commitlint/read/-/read-10.0.0.tgz", - "integrity": "sha512-ARebcoJMDNtlCTV9jpSacN9gCvua+JiGQLQlq4PsaNo/e4hyyIWu+wOEAXO8IhD5xycoTBaJRVWzgXRncEyrkg==", + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/@commitlint/read/-/read-11.0.0.tgz", + "integrity": "sha512-37V0V91GSv0aDzMzJioKpCoZw6l0shk7+tRG8RkW1GfZzUIytdg3XqJmM+IaIYpaop0m6BbZtfq+idzUwJnw7g==", "dev": true, "requires": { - "@commitlint/top-level": "^10.0.0", + "@commitlint/top-level": "^11.0.0", "fs-extra": "^9.0.0", "git-raw-commits": "^2.0.0" } }, "@commitlint/resolve-extends": { - "version": "10.0.0", - "resolved": "https://registry.npmjs.org/@commitlint/resolve-extends/-/resolve-extends-10.0.0.tgz", - "integrity": "sha512-ltj4LvdCEJeYzWdzFS9AhLMkc4rweKvfju/JYBgbLqFx7lAGz3e2Wub0uuuWuLBJqCjL7UJbYiA0T2Hzhhd91Q==", + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/@commitlint/resolve-extends/-/resolve-extends-11.0.0.tgz", + "integrity": "sha512-WinU6Uv6L7HDGLqn/To13KM1CWvZ09VHZqryqxXa1OY+EvJkfU734CwnOEeNlSCK7FVLrB4kmodLJtL1dkEpXw==", "dev": true, "requires": { "import-fresh": "^3.0.0", @@ -432,27 +432,27 @@ } }, "@commitlint/rules": { - "version": "10.0.0", - "resolved": "https://registry.npmjs.org/@commitlint/rules/-/rules-10.0.0.tgz", - "integrity": "sha512-myHG8pgUHIOtceJsALRRXvYBuLbTwWl7/6soDrIJudDhKsyhV3yFtAbRX40pujg25IlAUra6nuy8JDU86bVxog==", + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/@commitlint/rules/-/rules-11.0.0.tgz", + "integrity": "sha512-2hD9y9Ep5ZfoNxDDPkQadd2jJeocrwC4vJ98I0g8pNYn/W8hS9+/FuNpolREHN8PhmexXbkjrwyQrWbuC0DVaA==", "dev": true, "requires": { - "@commitlint/ensure": "^10.0.0", - "@commitlint/message": "^10.0.0", - "@commitlint/to-lines": "^10.0.0", - "@commitlint/types": "^10.0.0" + "@commitlint/ensure": "^11.0.0", + "@commitlint/message": "^11.0.0", + "@commitlint/to-lines": "^11.0.0", + "@commitlint/types": "^11.0.0" } }, "@commitlint/to-lines": { - "version": "10.0.0", - "resolved": "https://registry.npmjs.org/@commitlint/to-lines/-/to-lines-10.0.0.tgz", - "integrity": "sha512-qUHuYiLgE7ioBRgHUR2EOwXuEhb2TnAktEc9NBZcQNzfqu5nbOaf2iOBx5mlDK0heTJyTjLboAmzojXxuqJNcA==", + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/@commitlint/to-lines/-/to-lines-11.0.0.tgz", + "integrity": "sha512-TIDTB0Y23jlCNubDROUVokbJk6860idYB5cZkLWcRS9tlb6YSoeLn1NLafPlrhhkkkZzTYnlKYzCVrBNVes1iw==", "dev": true }, "@commitlint/top-level": { - "version": "10.0.0", - "resolved": "https://registry.npmjs.org/@commitlint/top-level/-/top-level-10.0.0.tgz", - "integrity": "sha512-FHlDD31gTQptInSuRGQt/9fNiSQ4euBZtcBZD4NImCtQCkwBP1cyxClN6wr9DmqISG0KSJybReF4z8rm5znNDA==", + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/@commitlint/top-level/-/top-level-11.0.0.tgz", + "integrity": "sha512-O0nFU8o+Ws+py5pfMQIuyxOtfR/kwtr5ybqTvR+C2lUPer2x6lnQU+OnfD7hPM+A+COIUZWx10mYQvkR3MmtAA==", "dev": true, "requires": { "find-up": "^5.0.0" @@ -498,9 +498,9 @@ } }, "@commitlint/types": { - "version": "10.0.0", - "resolved": "https://registry.npmjs.org/@commitlint/types/-/types-10.0.0.tgz", - "integrity": "sha512-b7uumSfDI1guYnNc11BpkTZjiY7gC1DPedeUa0r+csd/1DiFyRo4oNOaxXHve0cC4NzaHaOHa0aPktWMTYJlVQ==", + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/@commitlint/types/-/types-11.0.0.tgz", + "integrity": "sha512-VoNqai1vR5anRF5Tuh/+SWDFk7xi7oMwHrHrbm1BprYXjB2RJsWLhUrStMssDxEl5lW/z3EUdg8RvH/IUBccSQ==", "dev": true }, "@eslint/eslintrc": { @@ -736,9 +736,9 @@ "dev": true }, "@types/node": { - "version": "14.6.4", - "resolved": "https://registry.npmjs.org/@types/node/-/node-14.6.4.tgz", - "integrity": "sha512-Wk7nG1JSaMfMpoMJDKUsWYugliB2Vy55pdjLpmLixeyMi7HizW2I/9QoxsPCkXl3dO+ZOVqPumKaDUv5zJu2uQ==", + "version": "14.11.2", + "resolved": "https://registry.npmjs.org/@types/node/-/node-14.11.2.tgz", + "integrity": "sha512-jiE3QIxJ8JLNcb1Ps6rDbysDhN4xa8DJJvuC9prr6w+1tIh+QAbYyNF3tyiZNLDBIuBCf4KEcV2UvQm/V60xfA==", "dev": true }, "@types/normalize-package-data": { @@ -812,19 +812,19 @@ } }, "@types/webpack-env": { - "version": "1.15.2", - "resolved": "https://registry.npmjs.org/@types/webpack-env/-/webpack-env-1.15.2.tgz", - "integrity": "sha512-67ZgZpAlhIICIdfQrB5fnDvaKFcDxpKibxznfYRVAT4mQE41Dido/3Ty+E3xGBmTogc5+0Qb8tWhna+5B8z1iQ==", + "version": "1.15.3", + "resolved": "https://registry.npmjs.org/@types/webpack-env/-/webpack-env-1.15.3.tgz", + "integrity": "sha512-5oiXqR7kwDGZ6+gmzIO2lTC+QsriNuQXZDWNYRV3l2XRN/zmPgnC21DLSx2D05zvD8vnXW6qUg7JnXZ4I6qLVQ==", "dev": true }, "@typescript-eslint/eslint-plugin": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.0.1.tgz", - "integrity": "sha512-pQZtXupCn11O4AwpYVUX4PDFfmIJl90ZgrEBg0CEcqlwvPiG0uY81fimr1oMFblZnpKAq6prrT9a59pj1x58rw==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.2.0.tgz", + "integrity": "sha512-zBNRkzvLSwo6y5TG0DVcmshZIYBHKtmzD4N+LYnfTFpzc4bc79o8jNRSb728WV7A4Cegbs+MV5IRAj8BKBgOVQ==", "dev": true, "requires": { - "@typescript-eslint/experimental-utils": "4.0.1", - "@typescript-eslint/scope-manager": "4.0.1", + "@typescript-eslint/experimental-utils": "4.2.0", + "@typescript-eslint/scope-manager": "4.2.0", "debug": "^4.1.1", "functional-red-black-tree": "^1.0.1", "regexpp": "^3.0.0", @@ -833,55 +833,55 @@ } }, "@typescript-eslint/experimental-utils": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-4.0.1.tgz", - "integrity": "sha512-gAqOjLiHoED79iYTt3F4uSHrYmg/GPz/zGezdB0jAdr6S6gwNiR/j7cTZ8nREKVzMVKLd9G3xbg1sV9GClW3sw==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-4.2.0.tgz", + "integrity": "sha512-5BBj6BjgHEndBaQQpUVzRIPERz03LBc0MCQkHwUaH044FJFL08SwWv/sQftk7gf0ShZ2xZysz0LTwCwNt4Xu3w==", "dev": true, "requires": { "@types/json-schema": "^7.0.3", - "@typescript-eslint/scope-manager": "4.0.1", - "@typescript-eslint/types": "4.0.1", - "@typescript-eslint/typescript-estree": "4.0.1", + "@typescript-eslint/scope-manager": "4.2.0", + "@typescript-eslint/types": "4.2.0", + "@typescript-eslint/typescript-estree": "4.2.0", "eslint-scope": "^5.0.0", "eslint-utils": "^2.0.0" } }, "@typescript-eslint/parser": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-4.0.1.tgz", - "integrity": "sha512-1+qLmXHNAWSQ7RB6fdSQszAiA7JTwzakj5cNYjBTUmpH2cqilxMZEIV+DRKjVZs8NzP3ALmKexB0w/ExjcK9Iw==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-4.2.0.tgz", + "integrity": "sha512-54jJ6MwkOtowpE48C0QJF9iTz2/NZxfKVJzv1ha5imigzHbNSLN9yvbxFFH1KdlRPQrlR8qxqyOvLHHxd397VA==", "dev": true, "requires": { - "@typescript-eslint/scope-manager": "4.0.1", - "@typescript-eslint/types": "4.0.1", - "@typescript-eslint/typescript-estree": "4.0.1", + "@typescript-eslint/scope-manager": "4.2.0", + "@typescript-eslint/types": "4.2.0", + "@typescript-eslint/typescript-estree": "4.2.0", "debug": "^4.1.1" } }, "@typescript-eslint/scope-manager": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-4.0.1.tgz", - "integrity": "sha512-u3YEXVJ8jsj7QCJk3om0Y457fy2euEOkkzxIB/LKU3MdyI+FJ2gI0M4aKEaXzwCSfNDiZ13a3lDo5DVozc+XLQ==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-4.2.0.tgz", + "integrity": "sha512-Tb402cxxObSxWIVT+PnBp5ruT2V/36yj6gG4C9AjkgRlZpxrLAzWDk3neen6ToMBGeGdxtnfFLoJRUecGz9mYQ==", "dev": true, "requires": { - "@typescript-eslint/types": "4.0.1", - "@typescript-eslint/visitor-keys": "4.0.1" + "@typescript-eslint/types": "4.2.0", + "@typescript-eslint/visitor-keys": "4.2.0" } }, "@typescript-eslint/types": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-4.0.1.tgz", - "integrity": "sha512-S+gD3fgbkZYW2rnbjugNMqibm9HpEjqZBZkTiI3PwbbNGWmAcxolWIUwZ0SKeG4Dy2ktpKKaI/6+HGYVH8Qrlg==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-4.2.0.tgz", + "integrity": "sha512-xkv5nIsxfI/Di9eVwN+G9reWl7Me9R5jpzmZUch58uQ7g0/hHVuGUbbn4NcxcM5y/R4wuJIIEPKPDb5l4Fdmwg==", "dev": true }, "@typescript-eslint/typescript-estree": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-4.0.1.tgz", - "integrity": "sha512-zGzleORFXrRWRJAMLTB2iJD1IZbCPkg4hsI8mGdpYlKaqzvKYSEWVAYh14eauaR+qIoZVWrXgYSXqLtTlxotiw==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-4.2.0.tgz", + "integrity": "sha512-iWDLCB7z4MGkLipduF6EOotdHNtgxuNKnYD54nMS/oitFnsk4S3S/TE/UYXQTra550lHtlv9eGmp+dvN9pUDtA==", "dev": true, "requires": { - "@typescript-eslint/types": "4.0.1", - "@typescript-eslint/visitor-keys": "4.0.1", + "@typescript-eslint/types": "4.2.0", + "@typescript-eslint/visitor-keys": "4.2.0", "debug": "^4.1.1", "globby": "^11.0.1", "is-glob": "^4.0.1", @@ -891,12 +891,12 @@ } }, "@typescript-eslint/visitor-keys": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-4.0.1.tgz", - "integrity": "sha512-yBSqd6FjnTzbg5RUy9J+9kJEyQjTI34JdGMJz+9ttlJzLCnGkBikxw+N5n2VDcc3CesbIEJ0MnZc5uRYnrEnCw==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-4.2.0.tgz", + "integrity": "sha512-WIf4BNOlFOH2W+YqGWa6YKLcK/EB3gEj2apCrqLw6mme1RzBy0jtJ9ewJgnrZDB640zfnv8L+/gwGH5sYp/rGw==", "dev": true, "requires": { - "@typescript-eslint/types": "4.0.1", + "@typescript-eslint/types": "4.2.0", "eslint-visitor-keys": "^2.0.0" } }, @@ -1132,9 +1132,9 @@ "dev": true }, "acorn-jsx": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.2.0.tgz", - "integrity": "sha512-HiUX/+K2YpkpJ+SzBffkM/AQ2YE03S0U1kjTLVpoJdhZMOWy8qvXVN9JdLqv2QsaQ6MPYQIuNmwD8zOiYUofLQ==", + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.1.tgz", + "integrity": "sha512-K0Ptm/47OKfQRpNQ2J/oIN/3QYiK6FwW+eJbILhsdxh2WTLdl+30o8aGdTbm5JbffpFFAg/g+zi1E+jvJha5ng==", "dev": true }, "aggregate-error": { @@ -1148,9 +1148,9 @@ } }, "ajv": { - "version": "6.12.4", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.4.tgz", - "integrity": "sha512-eienB2c9qVQs2KWexhkrdMLVDoIQCz5KSeLxwg9Lzk4DOfBtIK9PQwwufcsn1jjGuf9WZmqPMbGxOzfcuphJCQ==", + "version": "6.12.5", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.5.tgz", + "integrity": "sha512-lRF8RORchjpKG50/WFf8xmg7sgCLFiYNNnqdKflk63whMQcWR5ngGjiSXkL9bjxy6B2npOK2HSMN49jEBMSkag==", "dev": true, "requires": { "fast-deep-equal": "^3.1.1", @@ -1296,6 +1296,27 @@ "define-properties": "^1.1.3", "es-abstract": "^1.17.0", "is-string": "^1.0.5" + }, + "dependencies": { + "es-abstract": { + "version": "1.17.6", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.6.tgz", + "integrity": "sha512-Fr89bON3WFyUi5EvAeI48QTWX0AyekGgLA8H+c+7fbfCkJwRWRMLd8CQedNEyJuoYYhmtEqY92pgte1FAhBlhw==", + "dev": true, + "requires": { + "es-to-primitive": "^1.2.1", + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.1", + "is-callable": "^1.2.0", + "is-regex": "^1.1.0", + "object-inspect": "^1.7.0", + "object-keys": "^1.1.1", + "object.assign": "^4.1.0", + "string.prototype.trimend": "^1.0.1", + "string.prototype.trimstart": "^1.0.1" + } + } } }, "array-union": { @@ -1318,6 +1339,27 @@ "requires": { "define-properties": "^1.1.3", "es-abstract": "^1.17.0-next.1" + }, + "dependencies": { + "es-abstract": { + "version": "1.17.6", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.6.tgz", + "integrity": "sha512-Fr89bON3WFyUi5EvAeI48QTWX0AyekGgLA8H+c+7fbfCkJwRWRMLd8CQedNEyJuoYYhmtEqY92pgte1FAhBlhw==", + "dev": true, + "requires": { + "es-to-primitive": "^1.2.1", + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.1", + "is-callable": "^1.2.0", + "is-regex": "^1.1.0", + "object-inspect": "^1.7.0", + "object-keys": "^1.1.1", + "object.assign": "^4.1.0", + "string.prototype.trimend": "^1.0.1", + "string.prototype.trimstart": "^1.0.1" + } + } } }, "arrify": { @@ -1509,9 +1551,9 @@ "dev": true }, "blueimp-md5": { - "version": "2.17.0", - "resolved": "https://registry.npmjs.org/blueimp-md5/-/blueimp-md5-2.17.0.tgz", - "integrity": "sha512-x5PKJHY5rHQYaADj6NwPUR2QRCUVSggPzrUKkeENpj871o9l9IefJbO2jkT5UvYykeOK9dx0VmkIo6dZ+vThYw==", + "version": "2.18.0", + "resolved": "https://registry.npmjs.org/blueimp-md5/-/blueimp-md5-2.18.0.tgz", + "integrity": "sha512-vE52okJvzsVWhcgUHOv+69OG3Mdg151xyn41aVQN/5W5S+S43qZhxECtYLAEHMSFWX6Mv5IZrzj3T5+JqXfj5Q==", "dev": true }, "bn.js": { @@ -1562,9 +1604,9 @@ } }, "bowser": { - "version": "2.10.0", - "resolved": "https://registry.npmjs.org/bowser/-/bowser-2.10.0.tgz", - "integrity": "sha512-OCsqTQboTEWWsUjcp5jLSw2ZHsBiv2C105iFs61bOT0Hnwi9p7/uuXdd7mu8RYcarREfdjNN+8LitmEHATsLYg==", + "version": "2.11.0", + "resolved": "https://registry.npmjs.org/bowser/-/bowser-2.11.0.tgz", + "integrity": "sha512-AlcaJBi/pqqJBIQ8U9Mcpc9i8Aqxn88Skv5d+xBX006BY5u8N3mGLHa5Lgppa7L/HfwgwLgZ6NYs+Ag6uUmJRA==", "dev": true }, "brace-expansion": { @@ -2241,11 +2283,11 @@ } }, "cross-fetch": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-3.0.5.tgz", - "integrity": "sha512-FFLcLtraisj5eteosnX1gf01qYDCOc4fDy0+euOt8Kn9YBY2NtXL/pCoYPavw24NIQkQqm5ZOLsGD5Zzj0gyew==", + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-3.0.6.tgz", + "integrity": "sha512-KBPUbqgFjzWlVcURG+Svp9TlhA5uliYtiNx/0r8nv0pdypeQCRJ9IaSIc3q/x3q8t3F75cHuwxVql1HFGHCNJQ==", "requires": { - "node-fetch": "2.6.0" + "node-fetch": "2.6.1" } }, "cross-spawn": { @@ -2291,12 +2333,12 @@ "dev": true }, "debug": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", - "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.2.0.tgz", + "integrity": "sha512-IX2ncY78vDTjZMFUdmsvIRFY2Cf4FnD0wRs+nQwJU8Lu99/tPFdb0VybiiMTPe3I6rQmwsqQqRBvxU+bZ/I8sg==", "dev": true, "requires": { - "ms": "^2.1.1" + "ms": "2.1.2" } }, "decamelize": { @@ -2486,9 +2528,9 @@ "dev": true }, "dot-prop": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-5.2.0.tgz", - "integrity": "sha512-uEUyaDKoSQ1M4Oq8l45hSE26SnTxL6snNnqvK/VWx5wJhmff5z0FUVJDKDanor/6w3kzE3i7XZOk+7wC0EXr1A==", + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-5.3.0.tgz", + "integrity": "sha512-QM8q3zDe58hqUqjraQOmzZ1LIH9SWQJTlEKCH4kJ2oQvLZk7RbQXvtDM2XEq3fwkV9CCvvH4LA0AV+ogFsBM2Q==", "dev": true, "requires": { "is-obj": "^2.0.0" @@ -2613,9 +2655,9 @@ } }, "es-abstract": { - "version": "1.17.6", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.6.tgz", - "integrity": "sha512-Fr89bON3WFyUi5EvAeI48QTWX0AyekGgLA8H+c+7fbfCkJwRWRMLd8CQedNEyJuoYYhmtEqY92pgte1FAhBlhw==", + "version": "1.18.0-next.0", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.18.0-next.0.tgz", + "integrity": "sha512-elZXTZXKn51hUBdJjSZGYRujuzilgXo8vSPQzjGYXLvSlGiCo8VO8ZGV3kjo9a0WNJJ57hENagwbtlRuHuzkcQ==", "dev": true, "requires": { "es-to-primitive": "^1.2.1", @@ -2623,8 +2665,9 @@ "has": "^1.0.3", "has-symbols": "^1.0.1", "is-callable": "^1.2.0", - "is-regex": "^1.1.0", - "object-inspect": "^1.7.0", + "is-negative-zero": "^2.0.0", + "is-regex": "^1.1.1", + "object-inspect": "^1.8.0", "object-keys": "^1.1.1", "object.assign": "^4.1.0", "string.prototype.trimend": "^1.0.1", @@ -2661,9 +2704,9 @@ "dev": true }, "eslint": { - "version": "7.8.1", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.8.1.tgz", - "integrity": "sha512-/2rX2pfhyUG0y+A123d0ccXtMm7DV7sH1m3lk9nk2DZ2LReq39FXHueR9xZwshE5MdfSf0xunSaMWRqyIA6M1w==", + "version": "7.9.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.9.0.tgz", + "integrity": "sha512-V6QyhX21+uXp4T+3nrNfI3hQNBDa/P8ga7LoQOenwrlEFXrEnUEE+ok1dMtaS3b6rmLXhT1TkTIsG75HMLbknA==", "dev": true, "requires": { "@babel/code-frame": "^7.0.0", @@ -2731,9 +2774,9 @@ } }, "eslint-config-prettier": { - "version": "6.11.0", - "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-6.11.0.tgz", - "integrity": "sha512-oB8cpLWSAjOVFEJhhyMZh6NOEOtBVziaqdDQ86+qhDHFbZXoRTM7pNSvFRfW/W/L/LrQ38C99J5CGuRBBzBsdA==", + "version": "6.12.0", + "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-6.12.0.tgz", + "integrity": "sha512-9jWPlFlgNwRUYVoujvWTQ1aMO8o6648r+K7qU7K5Jmkbyqav1fuEZC0COYpGBxyiAJb65Ra9hrmFx19xRGwXWw==", "dev": true, "requires": { "get-stdin": "^6.0.0" @@ -2951,12 +2994,12 @@ } }, "eslint-scope": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.0.tgz", - "integrity": "sha512-iiGRvtxWqgtx5m8EyQUJihBloE4EnYeGE/bz1wSPwJE6tZuJUtHlhqDM4Xj2ukE8Dyy1+HCZ4hE0fzIVMzb58w==", + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", + "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", "dev": true, "requires": { - "esrecurse": "^4.1.0", + "esrecurse": "^4.3.0", "estraverse": "^4.1.1" } }, @@ -4153,15 +4196,15 @@ "dev": true }, "husky": { - "version": "4.2.5", - "resolved": "https://registry.npmjs.org/husky/-/husky-4.2.5.tgz", - "integrity": "sha512-SYZ95AjKcX7goYVZtVZF2i6XiZcHknw50iXvY7b0MiGoj5RwdgRQNEHdb+gPDPCXKlzwrybjFjkL6FOj8uRhZQ==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/husky/-/husky-4.3.0.tgz", + "integrity": "sha512-tTMeLCLqSBqnflBZnlVDhpaIMucSGaYyX6855jM4AguGeWCeSzNdb1mfyWduTZ3pe3SJVvVWGL0jO1iKZVPfTA==", "dev": true, "requires": { "chalk": "^4.0.0", "ci-info": "^2.0.0", "compare-versions": "^3.6.0", - "cosmiconfig": "^6.0.0", + "cosmiconfig": "^7.0.0", "find-versions": "^3.2.0", "opencollective-postinstall": "^2.0.2", "pkg-dir": "^4.2.0", @@ -4170,19 +4213,6 @@ "which-pm-runs": "^1.0.0" }, "dependencies": { - "cosmiconfig": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-6.0.0.tgz", - "integrity": "sha512-xb3ZL6+L8b9JLLCx3ZdoZy4+2ECphCMo2PwqgP1tlfVq6M6YReyzBJtvWWtbDSpNr9hn96pkCiZqUcFEc+54Qg==", - "dev": true, - "requires": { - "@types/parse-json": "^4.0.0", - "import-fresh": "^3.1.0", - "parse-json": "^5.0.0", - "path-type": "^4.0.0", - "yaml": "^1.7.2" - } - }, "pkg-dir": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", @@ -4395,9 +4425,9 @@ "dev": true }, "is-callable": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.0.tgz", - "integrity": "sha512-pyVD9AaGLxtg6srb2Ng6ynWJqkHU9bEM087AKck0w8QwDarTfNcpIYoU8x8Hv2Icm8u6kFJM18Dag8lyqGkviw==", + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.2.tgz", + "integrity": "sha512-dnMqspv5nU3LoewK2N/y7KLtxtakvTuaCsU9FU50/QDmdbHNy/4/JuRtMHqRU22o3q+W89YQndQEeCVwK+3qrA==", "dev": true }, "is-data-descriptor": { @@ -4472,6 +4502,12 @@ "is-extglob": "^2.1.1" } }, + "is-negative-zero": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.0.tgz", + "integrity": "sha1-lVOxIbD6wohp2p7UWeIMdUN4hGE=", + "dev": true + }, "is-number": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", @@ -4853,9 +4889,9 @@ "dev": true }, "jasmine-spec-reporter": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/jasmine-spec-reporter/-/jasmine-spec-reporter-5.0.2.tgz", - "integrity": "sha512-6gP1LbVgJ+d7PKksQBc2H0oDGNRQI3gKUsWlswKaQ2fif9X5gzhQcgM5+kiJGCQVurOG09jqNhk7payggyp5+g==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/jasmine-spec-reporter/-/jasmine-spec-reporter-6.0.0.tgz", + "integrity": "sha512-MvTOVoMxDZAftQYBApIlSfKnGMzi9cj351nXeqtnZTuXffPlbONN31+Es7F+Ke4okUeQ2xISukt4U1npfzLVrQ==", "dev": true, "requires": { "colors": "1.4.0" @@ -4961,9 +4997,9 @@ "dev": true }, "lint-staged": { - "version": "10.3.0", - "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-10.3.0.tgz", - "integrity": "sha512-an3VgjHqmJk0TORB/sdQl0CTkRg4E5ybYCXTTCSJ5h9jFwZbcgKIx5oVma5e7wp/uKt17s1QYFmYqT9MGVosGw==", + "version": "10.4.0", + "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-10.4.0.tgz", + "integrity": "sha512-uaiX4U5yERUSiIEQc329vhCTDDwUcSvKdRLsNomkYLRzijk3v8V9GWm2Nz0RMVB87VcuzLvtgy6OsjoH++QHIg==", "dev": true, "requires": { "chalk": "^4.1.0", @@ -5531,9 +5567,9 @@ } }, "node-fetch": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.0.tgz", - "integrity": "sha512-8dG4H5ujfvFiqDmVu9fQ5bOHUC15JMjMY/Zumv26oOvvVJjM67KF8koCWIabKQ1GJIa9r2mMZscBq/TbdOcmNA==" + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz", + "integrity": "sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw==" }, "node-libs-browser": { "version": "2.2.1", @@ -5732,15 +5768,15 @@ } }, "object.assign": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.0.tgz", - "integrity": "sha512-exHJeq6kBKj58mqGyTQ9DFvrZC/eR6OwxzoM9YRoGBqrXYonaFyGiFMuc9VZrXf7DarreEwMpurG3dd+CNyW5w==", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.1.tgz", + "integrity": "sha512-VT/cxmx5yaoHSOTSyrCygIDFco+RsibY2NM0a4RdEeY/4KgqezwFtK1yr3U67xYhqJSlASm2pKhLVzPj2lr4bA==", "dev": true, "requires": { - "define-properties": "^1.1.2", - "function-bind": "^1.1.1", - "has-symbols": "^1.0.0", - "object-keys": "^1.0.11" + "define-properties": "^1.1.3", + "es-abstract": "^1.18.0-next.0", + "has-symbols": "^1.0.1", + "object-keys": "^1.1.1" } }, "object.entries": { @@ -5752,6 +5788,27 @@ "define-properties": "^1.1.3", "es-abstract": "^1.17.5", "has": "^1.0.3" + }, + "dependencies": { + "es-abstract": { + "version": "1.17.6", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.6.tgz", + "integrity": "sha512-Fr89bON3WFyUi5EvAeI48QTWX0AyekGgLA8H+c+7fbfCkJwRWRMLd8CQedNEyJuoYYhmtEqY92pgte1FAhBlhw==", + "dev": true, + "requires": { + "es-to-primitive": "^1.2.1", + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.1", + "is-callable": "^1.2.0", + "is-regex": "^1.1.0", + "object-inspect": "^1.7.0", + "object-keys": "^1.1.1", + "object.assign": "^4.1.0", + "string.prototype.trimend": "^1.0.1", + "string.prototype.trimstart": "^1.0.1" + } + } } }, "object.pick": { @@ -5773,6 +5830,27 @@ "es-abstract": "^1.17.0-next.1", "function-bind": "^1.1.1", "has": "^1.0.3" + }, + "dependencies": { + "es-abstract": { + "version": "1.17.6", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.6.tgz", + "integrity": "sha512-Fr89bON3WFyUi5EvAeI48QTWX0AyekGgLA8H+c+7fbfCkJwRWRMLd8CQedNEyJuoYYhmtEqY92pgte1FAhBlhw==", + "dev": true, + "requires": { + "es-to-primitive": "^1.2.1", + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.1", + "is-callable": "^1.2.0", + "is-regex": "^1.1.0", + "object-inspect": "^1.7.0", + "object-keys": "^1.1.1", + "object.assign": "^4.1.0", + "string.prototype.trimend": "^1.0.1", + "string.prototype.trimstart": "^1.0.1" + } + } } }, "on-finished": { @@ -6131,9 +6209,9 @@ "dev": true }, "prettier": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.1.1.tgz", - "integrity": "sha512-9bY+5ZWCfqj3ghYBLxApy2zf6m+NJo5GzmLTpr9FsApsfjriNnS2dahWReHMi7qNPhhHl9SYHJs2cHZLgexNIw==", + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.1.2.tgz", + "integrity": "sha512-16c7K+x4qVlJg9rEbXl7HEGmQyZlG4R9AgP+oHKRMsMsuk8s+ATStlf1NpDqyBI1HpVyfjLOeMhH2LvuNvV5Vg==", "dev": true }, "prettier-linter-helpers": { @@ -6609,9 +6687,9 @@ } }, "rxjs": { - "version": "6.6.2", - "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.6.2.tgz", - "integrity": "sha512-BHdBMVoWC2sL26w//BCu3YzKT4s2jip/WhwsGEDmeKYBhKDZeYezVUnHatYB7L85v5xs0BAQmg6BEYJEKxBabg==", + "version": "6.6.3", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.6.3.tgz", + "integrity": "sha512-trsQc+xYYXZ3urjOiJOuCOa5N3jAZ3eiSpQB5hIT8zGlL2QfnHLJ2r7GMkBGuIausdJN1OneaI6gQlsqNHHmZQ==", "dev": true, "requires": { "tslib": "^1.9.0" @@ -7111,9 +7189,9 @@ } }, "spdx-license-ids": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.5.tgz", - "integrity": "sha512-J+FWzZoynJEXGphVIS+XEh3kFSjZX/1i9gFBaWQcB+/tmpe2qUsSBABpcxqxnAxFdiUFEgAX1bjYGQvIZmoz9Q==", + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.6.tgz", + "integrity": "sha512-+orQK83kyMva3WyPf59k1+Y525csj5JejicWut55zeTWANuN17qSiSLUXWtzHeNWORSvT7GLDJ/E/XiIWoXBTw==", "dev": true }, "split-string": { @@ -7252,6 +7330,27 @@ "requires": { "define-properties": "^1.1.3", "es-abstract": "^1.17.5" + }, + "dependencies": { + "es-abstract": { + "version": "1.17.6", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.6.tgz", + "integrity": "sha512-Fr89bON3WFyUi5EvAeI48QTWX0AyekGgLA8H+c+7fbfCkJwRWRMLd8CQedNEyJuoYYhmtEqY92pgte1FAhBlhw==", + "dev": true, + "requires": { + "es-to-primitive": "^1.2.1", + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.1", + "is-callable": "^1.2.0", + "is-regex": "^1.1.0", + "object-inspect": "^1.7.0", + "object-keys": "^1.1.1", + "object.assign": "^4.1.0", + "string.prototype.trimend": "^1.0.1", + "string.prototype.trimstart": "^1.0.1" + } + } } }, "string.prototype.trimstart": { @@ -7262,6 +7361,27 @@ "requires": { "define-properties": "^1.1.3", "es-abstract": "^1.17.5" + }, + "dependencies": { + "es-abstract": { + "version": "1.17.6", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.6.tgz", + "integrity": "sha512-Fr89bON3WFyUi5EvAeI48QTWX0AyekGgLA8H+c+7fbfCkJwRWRMLd8CQedNEyJuoYYhmtEqY92pgte1FAhBlhw==", + "dev": true, + "requires": { + "es-to-primitive": "^1.2.1", + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.1", + "is-callable": "^1.2.0", + "is-regex": "^1.1.0", + "object-inspect": "^1.7.0", + "object-keys": "^1.1.1", + "object.assign": "^4.1.0", + "string.prototype.trimend": "^1.0.1", + "string.prototype.trimstart": "^1.0.1" + } + } } }, "string_decoder": { @@ -7641,9 +7761,9 @@ "dev": true }, "ts-loader": { - "version": "8.0.3", - "resolved": "https://registry.npmjs.org/ts-loader/-/ts-loader-8.0.3.tgz", - "integrity": "sha512-wsqfnVdB7xQiqhqbz2ZPLGHLPZbHVV5Qn/MNFZkCFxRU1miDyxKORucDGxKtsQJ63Rfza0udiUxWF5nHY6bpdQ==", + "version": "8.0.4", + "resolved": "https://registry.npmjs.org/ts-loader/-/ts-loader-8.0.4.tgz", + "integrity": "sha512-5u8KF1SW8eCUb/Ff7At81e3wznPmT/27fvaGRO9CziVy+6NlPVRvrzSox4OwU0/e6OflOUB32Err4VquysCSAQ==", "dev": true, "requires": { "chalk": "^2.3.0", @@ -7758,9 +7878,9 @@ "dev": true }, "ttypescript": { - "version": "1.5.11", - "resolved": "https://registry.npmjs.org/ttypescript/-/ttypescript-1.5.11.tgz", - "integrity": "sha512-sN7WE3Gnty0Wbs+AfSeXOaG2zYWw0/ghtlGftutidgwaZwEC8/Lg6yHiYFlqc6DEYynxrRPvU7UkNloygdCQVQ==", + "version": "1.5.12", + "resolved": "https://registry.npmjs.org/ttypescript/-/ttypescript-1.5.12.tgz", + "integrity": "sha512-1ojRyJvpnmgN9kIHmUnQPlEV1gq+VVsxVYjk/NfvMlHSmYxjK5hEvOOU2MQASrbekTUiUM7pR/nXeCc8bzvMOQ==", "dev": true, "requires": { "resolve": ">=1.9.0" @@ -7807,9 +7927,9 @@ } }, "typescript": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.0.2.tgz", - "integrity": "sha512-e4ERvRV2wb+rRZ/IQeb3jm2VxBsirQLpQhdxplZ2MEzGvDkkMmPglecnNDfSUBivMjP93vRbngYYDQqQ/78bcQ==", + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.0.3.tgz", + "integrity": "sha512-tEu6DGxGgRJPb/mVPIZ48e69xCn2yRmCgYmDugAVwmJ6o+0u1RI18eO7E7WBTLYLaEVVOhwQmcdhQHweux/WPg==", "dev": true }, "union": { @@ -8273,9 +8393,9 @@ } }, "webpack": { - "version": "4.44.1", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-4.44.1.tgz", - "integrity": "sha512-4UOGAohv/VGUNQJstzEywwNxqX417FnjZgZJpJQegddzPmTvph37eBIRbRTfdySXzVtJXLJfbMN3mMYhM6GdmQ==", + "version": "4.44.2", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-4.44.2.tgz", + "integrity": "sha512-6KJVGlCxYdISyurpQ0IPTklv+DULv05rs2hseIXer6D7KrUicRDLFb4IUM1S6LUAKypPM/nSiVSuv8jHu1m3/Q==", "dev": true, "requires": { "@webassemblyjs/ast": "1.9.0", @@ -8688,9 +8808,9 @@ } }, "webpack-merge": { - "version": "5.1.3", - "resolved": "https://registry.npmjs.org/webpack-merge/-/webpack-merge-5.1.3.tgz", - "integrity": "sha512-fz/xHgfHyxq3uzGGrMryPnpPZ6x3vF1tHtws6vYwYX+8e6Dw+4U4r6rXuEPCqtSwmUIeD8hniWwFem+5FVLjzg==", + "version": "5.1.4", + "resolved": "https://registry.npmjs.org/webpack-merge/-/webpack-merge-5.1.4.tgz", + "integrity": "sha512-LSmRD59mxREGkCBm9PCW3AaV4doDqxykGlx1NvioEE0FgkT2GQI54Wyvg39ptkiq2T11eRVoV39udNPsQvK+QQ==", "dev": true, "requires": { "clone-deep": "^4.0.1", diff --git a/package.json b/package.json index 41c1c31..75f10c9 100644 --- a/package.json +++ b/package.json @@ -37,8 +37,8 @@ "cross-fetch": "^3.0.0" }, "devDependencies": { - "@commitlint/cli": "^10.0.0", - "@commitlint/config-conventional": "^10.0.0", + "@commitlint/cli": "^11.0.0", + "@commitlint/config-conventional": "^11.0.0", "@pollyjs/adapter-node-http": "^5.0.0", "@pollyjs/core": "^5.0.0", "@pollyjs/persister-fs": "^5.0.0", @@ -63,7 +63,7 @@ "http-server": "^0.12.0", "husky": "^4.2.0", "jasmine": "^3.5.0", - "jasmine-spec-reporter": "^5.0.0", + "jasmine-spec-reporter": "^6.0.0", "lint-staged": "^10.2.0", "nyc": "^15.1.0", "prettier": "^2.0.0", diff --git a/spec/GeoJsonDumper.spec.ts b/spec/GeoJsonDumper.spec.ts index 21de6c1..b8b54cf 100644 --- a/spec/GeoJsonDumper.spec.ts +++ b/spec/GeoJsonDumper.spec.ts @@ -5,10 +5,12 @@ describe("GeoJSON Dumper", () => { const geocoded = Geocoded.create({ latitude: 38.8978378, longitude: -77.0365123, - south: 38.89380528242933, - west: -77.04317326462667, - north: 38.90153071757068, - east: -77.02993873537334, + bounds: { + latitude1: 38.89380528242933, + longitude1: -77.04317326462667, + latitude2: 38.90153071757068, + longitude2: -77.02993873537334, + }, formattedAddress: "1600 Pennsylvania Avenue Northwest, Washington, DC 20050", }); @@ -24,10 +26,10 @@ describe("GeoJSON Dumper", () => { coordinates: [-77.0365123, 38.8978378], }, bounds: { - south: 38.89380528242933, - west: -77.04317326462667, - north: 38.90153071757068, - east: -77.02993873537334, + latitude1: 38.89380528242933, + longitude1: -77.04317326462667, + latitude2: 38.90153071757068, + longitude2: -77.02993873537334, }, }; diff --git a/spec/Geocoded.spec.ts b/spec/Geocoded.spec.ts index b270568..c909c6a 100644 --- a/spec/Geocoded.spec.ts +++ b/spec/Geocoded.spec.ts @@ -62,12 +62,12 @@ describe("Geocoded returns data properly", () => { countryCode: "US", timezone: "America/New_York", }); - geocoded = geocoded.withBounds( - 38.89380528242933, - -77.04317326462667, - 38.90153071757068, - -77.02993873537334 - ); + geocoded = geocoded.withBounds({ + latitude1: 38.89380528242933, + longitude1: -77.04317326462667, + latitude2: 38.90153071757068, + longitude2: -77.02993873537334, + }); it("returns proper coordinates", () => { const expectedCoordinates = [38.8978378, -77.0365123]; @@ -80,12 +80,12 @@ describe("Geocoded returns data properly", () => { }); it("returns proper bounds", () => { - expect(geocoded.getBounds()).toEqual([ - 38.89380528242933, - -77.04317326462667, - 38.90153071757068, - -77.02993873537334, - ]); + expect(geocoded.getBounds()).toEqual({ + latitude1: 38.89380528242933, + longitude1: -77.04317326462667, + latitude2: 38.90153071757068, + longitude2: -77.02993873537334, + }); }); it("returns proper formatted address", () => { diff --git a/spec/GeocoderProviderFactory.spec.ts b/spec/GeocoderProviderFactory.spec.ts index 21e4ea4..821ba7b 100644 --- a/spec/GeocoderProviderFactory.spec.ts +++ b/spec/GeocoderProviderFactory.spec.ts @@ -9,8 +9,8 @@ describe("Geocoder Factory", () => { expect(provider).toBeUndefined(); }); - it("expects createProvider method to return a Yandex Provider", () => { - const provider = ProviderFactory.createProvider("yandex"); + it("expects createProvider method to return a GeoPlugin Provider", () => { + const provider = ProviderFactory.createProvider("geoplugin"); expect(provider).toBeDefined(); }); diff --git a/spec/provider/BingProvider.spec.ts b/spec/provider/BingProvider.spec.ts index a1720dc..5560f13 100644 --- a/spec/provider/BingProvider.spec.ts +++ b/spec/provider/BingProvider.spec.ts @@ -55,12 +55,12 @@ describe("Bing Geocoder Provider", () => { expect(geocoded).toBeDefined(); expect(geocoded.getCoordinates()).toEqual([38.897668, -77.036556]); - expect(geocoded.getBounds()).toEqual([ - 38.89380528242933, - -77.04317326462667, - 38.90153071757068, - -77.02993873537334, - ]); + expect(geocoded.getBounds()).toEqual({ + latitude1: 38.89380528242933, + longitude1: -77.04317326462667, + latitude2: 38.90153071757068, + longitude2: -77.02993873537334, + }); expect(geocoded.getFormattedAddress()).toEqual( "1600 Pennsylvania Ave NW, Washington, DC 20006" ); @@ -91,12 +91,12 @@ describe("Bing Geocoder Provider", () => { expect(geocoded).toBeDefined(); expect(geocoded.getCoordinates()).toEqual([48.8631093, 2.3887809]); - expect(geocoded.getBounds()).toEqual([ - 48.85924658242932, - 2.380952653445271, - 48.866972017570674, - 2.396609146554729, - ]); + expect(geocoded.getBounds()).toEqual({ + latitude1: 48.85924658242932, + longitude1: 2.380952653445271, + latitude2: 48.866972017570674, + longitude2: 2.396609146554729, + }); expect(geocoded.getFormattedAddress()).toEqual( "8 Avenue Gambetta, 75020 Paris" ); diff --git a/spec/provider/ChainProvider.spec.ts b/spec/provider/ChainProvider.spec.ts index 9c89311..5f634f4 100644 --- a/spec/provider/ChainProvider.spec.ts +++ b/spec/provider/ChainProvider.spec.ts @@ -6,12 +6,12 @@ import setupPolly, { cleanRecording } from "../setupPolly"; const expectGeocodedYandex = (geocoded: Geocoded) => { expect(geocoded).toBeDefined(); expect(geocoded.getCoordinates()).toEqual([38.895512, -77.033608]); - expect(geocoded.getBounds()).toEqual([ - 38.890612, - -77.058105, - 38.905248, - -77.012426, - ]); + expect(geocoded.getBounds()).toEqual({ + latitude1: 38.890612, + longitude1: -77.058105, + latitude2: 38.905248, + longitude2: -77.012426, + }); expect(geocoded.getFormattedAddress()).toEqual(undefined); expect(geocoded.getStreetNumber()).toEqual(undefined); expect(geocoded.getStreetName()).toEqual("Pennsylvania Avenue Northwest"); @@ -19,7 +19,9 @@ const expectGeocodedYandex = (geocoded: Geocoded) => { expect(geocoded.getLocality()).toEqual("Washington"); expect(geocoded.getPostalCode()).toEqual(undefined); expect(geocoded.getRegion()).toEqual("District of Columbia"); - expect(geocoded.getAdminLevels()).toEqual([]); + expect(geocoded.getAdminLevels()).toEqual([ + AdminLevel.create({ level: 1, name: "District of Columbia" }), + ]); expect(geocoded.getCountry()).toEqual("United States of America"); expect(geocoded.getCountryCode()).toEqual("US"); }; @@ -27,12 +29,12 @@ const expectGeocodedYandex = (geocoded: Geocoded) => { const expectGeodecodedYandex = (geocoded: Geocoded) => { expect(geocoded).toBeDefined(); expect(geocoded.getCoordinates()).toEqual([48.8631, 2.388899]); - expect(geocoded.getBounds()).toEqual([ - 48.860391, - 2.384794, - 48.865808, - 2.393004, - ]); + expect(geocoded.getBounds()).toEqual({ + latitude1: 48.860391, + longitude1: 2.384794, + latitude2: 48.865808, + longitude2: 2.393004, + }); expect(geocoded.getFormattedAddress()).toEqual(undefined); expect(geocoded.getStreetNumber()).toEqual("10"); expect(geocoded.getStreetName()).toEqual("Avenue Gambetta"); @@ -40,7 +42,9 @@ const expectGeodecodedYandex = (geocoded: Geocoded) => { expect(geocoded.getLocality()).toEqual("Paris"); expect(geocoded.getPostalCode()).toEqual(undefined); expect(geocoded.getRegion()).toEqual("Île-de-France"); - expect(geocoded.getAdminLevels()).toEqual([]); + expect(geocoded.getAdminLevels()).toEqual([ + AdminLevel.create({ level: 1, name: "Île-de-France" }), + ]); expect(geocoded.getCountry()).toEqual("France"); expect(geocoded.getCountryCode()).toEqual("FR"); }; @@ -48,12 +52,12 @@ const expectGeodecodedYandex = (geocoded: Geocoded) => { const expectGeocodedOpenStreetMap = (geocoded: Geocoded) => { expect(geocoded).toBeDefined(); expect(geocoded.getCoordinates()).toEqual([38.8636383, -76.9463651]); - expect(geocoded.getBounds()).toEqual([ - 38.8633822, - -76.9467576, - 38.8637409, - -76.945632, - ]); + expect(geocoded.getBounds()).toEqual({ + latitude1: 38.8633822, + longitude1: -76.9467576, + latitude2: 38.8637409, + longitude2: -76.945632, + }); expect(geocoded.getFormattedAddress()).toEqual(undefined); expect(geocoded.getStreetNumber()).toEqual(undefined); expect(geocoded.getStreetName()).toEqual("Pennsylvania Avenue"); @@ -74,12 +78,12 @@ const expectGeodecodedOpenStreetMap = (geocoded: Geocoded) => { 48.863744499999996, 2.3911562136123106, ]); - expect(geocoded.getBounds()).toEqual([ - 48.8625929, - 2.3877078, - 48.8648832, - 2.3956964, - ]); + expect(geocoded.getBounds()).toEqual({ + latitude1: 48.8625929, + longitude1: 2.3877078, + latitude2: 48.8648832, + longitude2: 2.3956964, + }); expect(geocoded.getFormattedAddress()).toEqual(undefined); expect(geocoded.getStreetNumber()).toEqual(undefined); expect(geocoded.getStreetName()).toEqual(undefined); diff --git a/spec/provider/GeoPluginProvider.spec.ts b/spec/provider/GeoPluginProvider.spec.ts index 2cbe284..7761f2c 100644 --- a/spec/provider/GeoPluginProvider.spec.ts +++ b/spec/provider/GeoPluginProvider.spec.ts @@ -59,12 +59,7 @@ describe("GeoPlugin Geocoder Provider", () => { expect(geocoded).toBeDefined(); expect(geocoded.getCoordinates()).toEqual([-32.2167, -58.1333]); - expect(geocoded.getBounds()).toEqual([ - undefined, - undefined, - undefined, - undefined, - ]); + expect(geocoded.getBounds()).toEqual(undefined); expect(geocoded.getFormattedAddress()).toEqual(undefined); expect(geocoded.getStreetNumber()).toEqual(undefined); expect(geocoded.getStreetName()).toEqual(undefined); @@ -92,12 +87,7 @@ describe("GeoPlugin Geocoder Provider", () => { expect(geocoded).toBeDefined(); expect(geocoded.getCoordinates()).toEqual([undefined, undefined]); - expect(geocoded.getBounds()).toEqual([ - undefined, - undefined, - undefined, - undefined, - ]); + expect(geocoded.getBounds()).toEqual(undefined); expect(geocoded.getFormattedAddress()).toEqual(undefined); expect(geocoded.getStreetNumber()).toEqual(undefined); expect(geocoded.getStreetName()).toEqual(undefined); diff --git a/spec/provider/GoogleMapsProvider.spec.ts b/spec/provider/GoogleMapsProvider.spec.ts index 3bdff07..e85722e 100644 --- a/spec/provider/GoogleMapsProvider.spec.ts +++ b/spec/provider/GoogleMapsProvider.spec.ts @@ -78,12 +78,12 @@ describe("Google Maps Geocoder Provider", () => { expect(geocoded).toBeDefined(); expect(geocoded.getCoordinates()).toEqual([38.8976633, -77.0365739]); - expect(geocoded.getBounds()).toEqual([ - 38.8973063, - -77.03795749999999, - 38.8979044, - -77.0355124, - ]); + expect(geocoded.getBounds()).toEqual({ + latitude1: 38.8973063, + longitude1: -77.03795749999999, + latitude2: 38.8979044, + longitude2: -77.0355124, + }); expect(geocoded.getFormattedAddress()).toEqual( "1600 Pennsylvania Avenue NW, Washington, DC 20500, USA" ); @@ -131,12 +131,12 @@ describe("Google Maps Geocoder Provider", () => { expect(geocoded).toBeDefined(); expect(geocoded.getCoordinates()).toEqual([48.8631361, 2.3889219]); - expect(geocoded.getBounds()).toEqual([ - 48.8617871197085, - 2.387572919708498, - 48.8644850802915, - 2.390270880291502, - ]); + expect(geocoded.getBounds()).toEqual({ + latitude1: 48.8617871197085, + longitude1: 2.387572919708498, + latitude2: 48.8644850802915, + longitude2: 2.390270880291502, + }); expect(geocoded.getFormattedAddress()).toEqual( "12 Avenue Gambetta, 75020 Paris, France" ); diff --git a/spec/provider/MapQuestProvider.spec.ts b/spec/provider/MapQuestProvider.spec.ts index 162fdf7..d8a3938 100644 --- a/spec/provider/MapQuestProvider.spec.ts +++ b/spec/provider/MapQuestProvider.spec.ts @@ -55,12 +55,7 @@ describe("MapQuest Geocoder Provider", () => { expect(geocoded).toBeDefined(); expect(geocoded.getCoordinates()).toEqual([38.895206, -77.036515]); - expect(geocoded.getBounds()).toEqual([ - undefined, - undefined, - undefined, - undefined, - ]); + expect(geocoded.getBounds()).toEqual(undefined); expect(geocoded.getFormattedAddress()).toEqual(undefined); expect(geocoded.getStreetNumber()).toEqual(undefined); expect(geocoded.getStreetName()).toEqual("1600 Pennsylvania Ave"); @@ -102,12 +97,7 @@ describe("MapQuest Geocoder Provider", () => { expect(geocoded).toBeDefined(); expect(geocoded.getCoordinates()).toEqual([38.895854, -77.030713]); - expect(geocoded.getBounds()).toEqual([ - undefined, - undefined, - undefined, - undefined, - ]); + expect(geocoded.getBounds()).toEqual(undefined); expect(geocoded.getFormattedAddress()).toEqual(undefined); expect(geocoded.getStreetNumber()).toEqual(undefined); expect(geocoded.getStreetName()).toEqual(""); @@ -144,12 +134,7 @@ describe("MapQuest Geocoder Provider", () => { expect(geocoded).toBeDefined(); expect(geocoded.getCoordinates()).toEqual([48.863116, 2.38878]); - expect(geocoded.getBounds()).toEqual([ - undefined, - undefined, - undefined, - undefined, - ]); + expect(geocoded.getBounds()).toEqual(undefined); expect(geocoded.getFormattedAddress()).toEqual(undefined); expect(geocoded.getStreetNumber()).toEqual(undefined); expect(geocoded.getStreetName()).toEqual("8 Avenue Gambetta"); @@ -187,12 +172,7 @@ describe("MapQuest Geocoder Provider", () => { expect(geocoded).toBeDefined(); expect(geocoded.getCoordinates()).toEqual([48.863116, 2.38878]); - expect(geocoded.getBounds()).toEqual([ - undefined, - undefined, - undefined, - undefined, - ]); + expect(geocoded.getBounds()).toEqual(undefined); expect(geocoded.getFormattedAddress()).toEqual(undefined); expect(geocoded.getStreetNumber()).toEqual(undefined); expect(geocoded.getStreetName()).toEqual("8 Avenue Gambetta"); diff --git a/spec/provider/MapboxProvider.spec.ts b/spec/provider/MapboxProvider.spec.ts index 30d5d7e..e987b42 100644 --- a/spec/provider/MapboxProvider.spec.ts +++ b/spec/provider/MapboxProvider.spec.ts @@ -53,12 +53,7 @@ describe("Mapbox Geocoder Provider", () => { expect(geocoded).toBeDefined(); expect(geocoded.getCoordinates()).toEqual([38.87925, -76.98204]); - expect(geocoded.getBounds()).toEqual([ - undefined, - undefined, - undefined, - undefined, - ]); + expect(geocoded.getBounds()).toEqual(undefined); expect(geocoded.getFormattedAddress()).toEqual( "1600 Pennsylvania Ave SE, Washington, District of Columbia 20003, United States" ); @@ -96,12 +91,7 @@ describe("Mapbox Geocoder Provider", () => { expect(geocoded).toBeDefined(); expect(geocoded.getCoordinates()).toEqual([48.863134, 2.388886]); - expect(geocoded.getBounds()).toEqual([ - undefined, - undefined, - undefined, - undefined, - ]); + expect(geocoded.getBounds()).toEqual(undefined); expect(geocoded.getFormattedAddress()).toEqual( "12 Avenue Gambetta, 75020 Paris, France" ); diff --git a/spec/provider/NominatimProvider.spec.ts b/spec/provider/NominatimProvider.spec.ts index 07e2eb8..b3c733f 100644 --- a/spec/provider/NominatimProvider.spec.ts +++ b/spec/provider/NominatimProvider.spec.ts @@ -55,12 +55,12 @@ describe("OpenStreetMap / Nominatim Geocoder Provider", () => { expect(geocoded).toBeDefined(); expect(geocoded.getCoordinates()).toEqual([38.8958536, -77.0307129]); - expect(geocoded.getBounds()).toEqual([ - 38.8957842, - -77.0309688, - 38.895924, - -77.0304609, - ]); + expect(geocoded.getBounds()).toEqual({ + latitude1: 38.8957842, + longitude1: -77.0309688, + latitude2: 38.895924, + longitude2: -77.0304609, + }); expect(geocoded.getFormattedAddress()).toEqual(undefined); expect(geocoded.getDisplayName()).toEqual( "Pennsylvania Avenue, Penn Quarter, Washington, District of Columbia, 20045, United States of America" @@ -108,12 +108,12 @@ describe("OpenStreetMap / Nominatim Geocoder Provider", () => { 48.863744499999996, 2.3911562136123106, ]); - expect(geocoded.getBounds()).toEqual([ - 48.8625929, - 2.3877078, - 48.8648832, - 2.3956964, - ]); + expect(geocoded.getBounds()).toEqual({ + latitude1: 48.8625929, + longitude1: 2.3877078, + latitude2: 48.8648832, + longitude2: 2.3956964, + }); expect(geocoded.getFormattedAddress()).toEqual(undefined); expect(geocoded.getDisplayName()).toEqual( "Quartier du Père-Lachaise, Paris, Île-de-France, France métropolitaine, 75020, France" diff --git a/spec/provider/OpenCageProvider.spec.ts b/spec/provider/OpenCageProvider.spec.ts index 306353e..53475d4 100644 --- a/spec/provider/OpenCageProvider.spec.ts +++ b/spec/provider/OpenCageProvider.spec.ts @@ -53,12 +53,12 @@ describe("OpenCage Geocoder Provider", () => { expect(geocoded).toBeDefined(); expect(geocoded.getCoordinates()).toEqual([38.8636383, -76.9463651]); - expect(geocoded.getBounds()).toEqual([ - 38.8633822, - -76.9467576, - 38.8637409, - -76.945632, - ]); + expect(geocoded.getBounds()).toEqual({ + latitude1: 38.8633822, + longitude1: -76.9467576, + latitude2: 38.8637409, + longitude2: -76.945632, + }); expect(geocoded.getFormattedAddress()).toEqual( "Pennsylvania Avenue, Washington, DC 20746-8001, United States of America" ); @@ -102,12 +102,7 @@ describe("OpenCage Geocoder Provider", () => { expect(geocoded).toBeDefined(); expect(geocoded.getCoordinates()).toEqual([48.863116, 2.38878]); - expect(geocoded.getBounds()).toEqual([ - undefined, - undefined, - undefined, - undefined, - ]); + expect(geocoded.getBounds()).toEqual(undefined); expect(geocoded.getFormattedAddress()).toEqual( "8 Avenue Gambetta, 75020 Paris, France" ); diff --git a/spec/provider/YandexProvider.spec.ts b/spec/provider/YandexProvider.spec.ts index f8ddab4..3ec5fe9 100644 --- a/spec/provider/YandexProvider.spec.ts +++ b/spec/provider/YandexProvider.spec.ts @@ -1,4 +1,7 @@ import UniversalGeocoder from "UniversalGeocoder"; +import { YandexGeocoded, YandexProvider } from "provider"; +import ExternalLoader from "ExternalLoader"; +import AdminLevel from "AdminLevel"; import setupPolly, { cleanRecording } from "../setupPolly"; describe("Yandex Geocoder Provider", () => { @@ -12,6 +15,13 @@ describe("Yandex Geocoder Provider", () => { await pollyContext.polly.flush(); }); + it("expects API Key to be required on initiation", () => { + expect(() => new YandexProvider(new ExternalLoader())).toThrowError( + Error, + 'An API key is required for the Yandex provider. Please add it in the "apiKey" option.' + ); + }); + it("expects to not support IP geolocation", () => { const provider = UniversalGeocoder.createGeocoder({ provider: "yandex", @@ -40,17 +50,17 @@ describe("Yandex Geocoder Provider", () => { provider?.geocode( { text: "1600 Pennsylvania Ave, Washington, DC", locale: "en_US" }, - (results) => { + (results: YandexGeocoded[]) => { const geocoded = results[0]; expect(geocoded).toBeDefined(); expect(geocoded.getCoordinates()).toEqual([38.895512, -77.033608]); - expect(geocoded.getBounds()).toEqual([ - 38.890612, - -77.058105, - 38.905248, - -77.012426, - ]); + expect(geocoded.getBounds()).toEqual({ + latitude1: 38.890612, + longitude1: -77.058105, + latitude2: 38.905248, + longitude2: -77.012426, + }); expect(geocoded.getFormattedAddress()).toEqual(undefined); expect(geocoded.getStreetNumber()).toEqual(undefined); expect(geocoded.getStreetName()).toEqual( @@ -60,9 +70,16 @@ describe("Yandex Geocoder Provider", () => { expect(geocoded.getLocality()).toEqual("Washington"); expect(geocoded.getPostalCode()).toEqual(undefined); expect(geocoded.getRegion()).toEqual("District of Columbia"); - expect(geocoded.getAdminLevels()).toEqual([]); + expect(geocoded.getAdminLevels()).toEqual([ + AdminLevel.create({ + level: 1, + name: "District of Columbia", + }), + ]); expect(geocoded.getCountry()).toEqual("United States of America"); expect(geocoded.getCountryCode()).toEqual("US"); + expect(geocoded.getLocationType()).toEqual("street"); + expect(geocoded.getPrecision()).toEqual("street"); done(); } @@ -78,17 +95,17 @@ describe("Yandex Geocoder Provider", () => { provider?.geodecode( { latitude: 48.8631507, longitude: 2.388911, locale: "en_US" }, - (results) => { + (results: YandexGeocoded[]) => { const geocoded = results[0]; expect(geocoded).toBeDefined(); expect(geocoded.getCoordinates()).toEqual([48.8631, 2.388899]); - expect(geocoded.getBounds()).toEqual([ - 48.860391, - 2.384794, - 48.865808, - 2.393004, - ]); + expect(geocoded.getBounds()).toEqual({ + latitude1: 48.860391, + longitude1: 2.384794, + latitude2: 48.865808, + longitude2: 2.393004, + }); expect(geocoded.getFormattedAddress()).toEqual(undefined); expect(geocoded.getStreetNumber()).toEqual("10"); expect(geocoded.getStreetName()).toEqual("Avenue Gambetta"); @@ -96,9 +113,16 @@ describe("Yandex Geocoder Provider", () => { expect(geocoded.getLocality()).toEqual("Paris"); expect(geocoded.getPostalCode()).toEqual(undefined); expect(geocoded.getRegion()).toEqual("Île-de-France"); - expect(geocoded.getAdminLevels()).toEqual([]); + expect(geocoded.getAdminLevels()).toEqual([ + AdminLevel.create({ + level: 1, + name: "Île-de-France", + }), + ]); expect(geocoded.getCountry()).toEqual("France"); expect(geocoded.getCountryCode()).toEqual("FR"); + expect(geocoded.getLocationType()).toEqual("house"); + expect(geocoded.getPrecision()).toEqual("exact"); done(); } diff --git a/spec/recordings/Chain-Geocoder-Provider_1409790517/receives-correct-geocoding-results-first-first-provider-OK-_818242361/recording.har b/spec/recordings/Chain-Geocoder-Provider_1409790517/receives-correct-geocoding-results-first-first-provider-OK-_818242361/recording.har index bcfa619..9b75a7a 100644 --- a/spec/recordings/Chain-Geocoder-Provider_1409790517/receives-correct-geocoding-results-first-first-provider-OK-_818242361/recording.har +++ b/spec/recordings/Chain-Geocoder-Provider_1409790517/receives-correct-geocoding-results-first-first-provider-OK-_818242361/recording.har @@ -82,7 +82,7 @@ }, { "name": "date", - "value": "Fri, 14 Aug 2020 17:59:57 GMT" + "value": "Fri, 25 Sep 2020 18:26:50 GMT" }, { "name": "content-type", @@ -111,8 +111,8 @@ "status": 200, "statusText": "OK" }, - "startedDateTime": "2020-08-14T17:59:56.783Z", - "time": 345, + "startedDateTime": "2020-09-25T18:26:49.713Z", + "time": 307, "timings": { "blocked": -1, "connect": -1, @@ -120,11 +120,11 @@ "receive": 0, "send": 0, "ssl": -1, - "wait": 345 + "wait": 307 } }, { - "_id": "e2aec0c20d9e28623deca09660dd67b0", + "_id": "78a91888b5016be96b3a58fdabda2662", "_order": 0, "cache": {}, "request": { @@ -156,7 +156,7 @@ "value": "geocode-maps.yandex.ru" } ], - "headersSize": 337, + "headersSize": 347, "httpVersion": "HTTP/1.1", "method": "GET", "queryString": [ @@ -171,17 +171,21 @@ { "name": "lang", "value": "en_US" + }, + { + "name": "results", + "value": "5" } ], - "url": "https://geocode-maps.yandex.ru/1.x?geocode=1600+Pennsylvania+Ave%2C+Washington%2C+DC&format=json&lang=en_US" + "url": "https://geocode-maps.yandex.ru/1.x?geocode=1600+Pennsylvania+Ave%2C+Washington%2C+DC&format=json&lang=en_US&results=5" }, "response": { - "bodySize": 1402, + "bodySize": 1403, "content": { "_isBinary": true, "mimeType": "application/json; charset=utf-8", - "size": 1402, - "text": "[\"1f8b0800000000000003e4945d6fd3301486ff4ae4eb30e5a3cec7ee4a8be062948981b840137293b3d590d8c1713aa6a9ff7dc7499a795b09bdd8540695aadace39f6fbbe6e9e1ba2a0aea4a8811cdf90b7203f2cbf43a667b228f0874b61964bd06cce343b55b202a5affbd24ce6a03ef6edeffb1af34cc1cf066a4d8e891f799e730a42d4d7c59a09ce9ce91a5ce70bab575c5c6a295c673e23ae11d114ba361d1e4e2f6423729c8464b3c11930dd283ca15c8222c75f2d9d7f5267abaa1464bc6e2d915a2b008d2769f865747e165c43ee9c69a6a176e485332d41f18ca13c8eb53cd366115369ca2567f70d3cb4271a701652e9d595c9c0253f78eb6538729ae768b7369232f4a9d5f537a3d5a8386bbdab926954f3ccb266b2c48b036152c7487b95bd227c2e58092312c8c61d9a2a25d75c6470d7b54b9edd51c88c155c5be7dc49b7eb86d0faaa71539bf3cd10ef1c6f9e176dcab3de130efb87275c8c797b9a78db4317a87b66ddaeb53c16aeb15172615430cdd73055c03afd0f57172381bbe4649b33f66ec78b4781bbe4d34a2ad95cae2e986a4160cf177b45df7df6bc2897e450678a571d61c83d1eec8c7e24a9a58105e4af5b936fc41a0ae4801917f20ad44c2a61a8415ec5f1914713dfa34e981c25a917f901763755f5b0c80f2641648a528f0693a465d0a9e4a2a54d25eb6d5d18465ed26d46296e66fcbf00369dc946af80fd6d6cb265fd336cba33756836dd8ff73f609315fd1e6cb2e339109bbc7092b6d849e284a6bbd8141da5894f69da16257114f8bbd984756940c3b8ab0bbdf4c9d8243124f57c687ac72f57f8ce0f5ccafb5d0e4ba641d58bc09295d9c8ffbdf774682a59d1be2424cda1027caf85b61b1e2d8ec0691bff1e641a223a04969024314594b424a1340ce86e2c4d8230f03bdcf85efc5b2a51445b47a528f1d3d4f83fc7ef2d000000ffff03008b808d24850e0000\"]" + "size": 1403, + "text": "[\"1f8b0800000000000003e4945d6fd3301486ff4ae4eb30e5a3cec7ee4a8be062948981b840137293b3d590d8c1713aa6a9ff7dc7499a795b09bdd8540695aadace39f6fbbe6e9e1ba2a0aea4a8811cdf90b7203f2cbf43a667b228f0874b61964bd06cce343b55b202a5affbd24ce6a03ef6edeffb1af34cc1cf066a4d8e891f799e730a42d4d7c59a09ce9ce91a5ce70bab575c5c6a295c673e23ae11d114bac60e8ab30bd9881cc721d96c70064c370a0f2897a0c8f1574be69fc4d9a22a0519af5b47a4d60a40e3491a7e19999f05d7903b679a69a81d79e14c4b503c63a88e632dcfb459c4509a72c9d97dfd0fdd89069c85547a75652270c90fde7a198e9ce639baad8da40c7d6a75fdcd68352ace5aefaa641ad53cb3ac992cf1de4098d031d25e65af089f0b56c28804b27187a64ac9351719dc75ed92677714326305d7d63977d2edba21b4be6adcd4e67c33c43bc79be7459bf2acf784c3fee1091763de9e26def6d005ea9e59b76b2d8f856b6c945c18154cf3354c15b04effc3d5c548e02e39d9e68cbddbf1e251e02ef9b4924a3697ab0ba65a0ed8f3c55ed1779f3d2fca2539d499e2550718720f073ba31f496a696001f9ebd6e41bb186023960c685bc0235934a186a9057717ce4d1c4f7a813264749ea457e80dd4d553d2cf283491099a2d4a3c1246919742ab9686953c97a5b17869197749b518a9b19ff2f804d67b2d12b607f1b9b6c59ff0c9bee4c1d9a4df7e3fd0fd86445bf079bec780ec4262f9ca42d769238a1e92e36454769e2539ab645491c05fe6e36615d1ad030eeea422f7d3236490c493d1f9adef1cb15bef30397f27e97c3926950f522b0646536f27fef3d1d9a4a56b42f094973a800df6ba1ed86478b2370dac6bf079986880e812524494c11252d49280d03ba1b4b93200cfc0e37be17ff964a14d1d651294afc3435fecff17b0b0000ffff\",\"030097724dfd840e0000\"]" }, "cookies": [], "headers": [ @@ -191,7 +195,7 @@ }, { "name": "date", - "value": "Fri, 14 Aug 2020 17:59:57 GMT" + "value": "Fri, 25 Sep 2020 18:26:49 GMT" }, { "name": "content-type", @@ -223,7 +227,7 @@ }, { "name": "etag", - "value": "W/\"e85-jED9/6YYFGyACPhZmEaIwSqxDds\"" + "value": "W/\"e84-Gkzjv5mxlcw0btuJhYzfeK72c44\"" }, { "name": "x-xss-protection", @@ -239,7 +243,7 @@ }, { "name": "x-qloud-router", - "value": "man4-a74d0ae6f388.qloud-c.yandex.net" + "value": "man1-043f58f4a44d.qloud-c.yandex.net" } ], "headersSize": 458, @@ -248,8 +252,8 @@ "status": 200, "statusText": "OK" }, - "startedDateTime": "2020-08-14T17:59:56.783Z", - "time": 753, + "startedDateTime": "2020-09-25T18:26:49.713Z", + "time": 534, "timings": { "blocked": -1, "connect": -1, @@ -257,7 +261,7 @@ "receive": 0, "send": 0, "ssl": -1, - "wait": 753 + "wait": 534 } } ], diff --git a/spec/recordings/Chain-Geocoder-Provider_1409790517/receives-correct-geocoding-results-first-provider-KO-_279561490/recording.har b/spec/recordings/Chain-Geocoder-Provider_1409790517/receives-correct-geocoding-results-first-provider-KO-_279561490/recording.har index 39233ee..b89e918 100644 --- a/spec/recordings/Chain-Geocoder-Provider_1409790517/receives-correct-geocoding-results-first-provider-KO-_279561490/recording.har +++ b/spec/recordings/Chain-Geocoder-Provider_1409790517/receives-correct-geocoding-results-first-provider-KO-_279561490/recording.har @@ -8,7 +8,7 @@ }, "entries": [ { - "_id": "e2aec0c20d9e28623deca09660dd67b0", + "_id": "78a91888b5016be96b3a58fdabda2662", "_order": 0, "cache": {}, "request": { @@ -40,7 +40,7 @@ "value": "geocode-maps.yandex.ru" } ], - "headersSize": 308, + "headersSize": 318, "httpVersion": "HTTP/1.1", "method": "GET", "queryString": [ @@ -55,9 +55,13 @@ { "name": "lang", "value": "en_US" + }, + { + "name": "results", + "value": "5" } ], - "url": "https://geocode-maps.yandex.ru/1.x?geocode=1600+Pennsylvania+Ave%2C+Washington%2C+DC&format=json&lang=en_US" + "url": "https://geocode-maps.yandex.ru/1.x?geocode=1600+Pennsylvania+Ave%2C+Washington%2C+DC&format=json&lang=en_US&results=5" }, "response": { "bodySize": 62, @@ -74,7 +78,7 @@ }, { "name": "date", - "value": "Fri, 14 Aug 2020 17:46:02 GMT" + "value": "Fri, 25 Sep 2020 18:26:51 GMT" }, { "name": "content-type", @@ -115,8 +119,8 @@ "status": 403, "statusText": "Forbidden" }, - "startedDateTime": "2020-08-14T17:46:02.311Z", - "time": 263, + "startedDateTime": "2020-09-25T18:26:51.027Z", + "time": 236, "timings": { "blocked": -1, "connect": -1, @@ -124,7 +128,7 @@ "receive": 0, "send": 0, "ssl": -1, - "wait": 263 + "wait": 236 } }, { @@ -202,7 +206,7 @@ }, { "name": "date", - "value": "Fri, 14 Aug 2020 17:46:02 GMT" + "value": "Fri, 25 Sep 2020 18:26:51 GMT" }, { "name": "content-type", @@ -231,8 +235,8 @@ "status": 200, "statusText": "OK" }, - "startedDateTime": "2020-08-14T17:46:02.605Z", - "time": 237, + "startedDateTime": "2020-09-25T18:26:51.268Z", + "time": 243, "timings": { "blocked": -1, "connect": -1, @@ -240,7 +244,7 @@ "receive": 0, "send": 0, "ssl": -1, - "wait": 237 + "wait": 243 } } ], diff --git a/spec/recordings/Chain-Geocoder-Provider_1409790517/receives-correct-geocoding-results-first-provider-OK-_2076694978/recording.har b/spec/recordings/Chain-Geocoder-Provider_1409790517/receives-correct-geocoding-results-first-provider-OK-_2076694978/recording.har index 4bae870..b081bdc 100644 --- a/spec/recordings/Chain-Geocoder-Provider_1409790517/receives-correct-geocoding-results-first-provider-OK-_2076694978/recording.har +++ b/spec/recordings/Chain-Geocoder-Provider_1409790517/receives-correct-geocoding-results-first-provider-OK-_2076694978/recording.har @@ -8,7 +8,7 @@ }, "entries": [ { - "_id": "e2aec0c20d9e28623deca09660dd67b0", + "_id": "78a91888b5016be96b3a58fdabda2662", "_order": 0, "cache": {}, "request": { @@ -40,7 +40,7 @@ "value": "geocode-maps.yandex.ru" } ], - "headersSize": 337, + "headersSize": 347, "httpVersion": "HTTP/1.1", "method": "GET", "queryString": [ @@ -55,17 +55,21 @@ { "name": "lang", "value": "en_US" + }, + { + "name": "results", + "value": "5" } ], - "url": "https://geocode-maps.yandex.ru/1.x?geocode=1600+Pennsylvania+Ave%2C+Washington%2C+DC&format=json&lang=en_US" + "url": "https://geocode-maps.yandex.ru/1.x?geocode=1600+Pennsylvania+Ave%2C+Washington%2C+DC&format=json&lang=en_US&results=5" }, "response": { - "bodySize": 1405, + "bodySize": 1403, "content": { "_isBinary": true, "mimeType": "application/json; charset=utf-8", - "size": 1405, - "text": "[\"1f8b0800000000000003e4945d6fd3301486ff4ae4eb30e5a3cec7ee4a8be062948981b840137293b3d590d8c1713aa6a9ff7dc7499a795b09bdd8540695aadace39f6fbbe6e9e1ba2a0aea4a8811cdf90b7203f2cbf43a667b228f0874b61964bd06cce343b55b202a5affbd24ce6a03ef6edeffb1af34cc1cf066a4d8e891f799e730a42d4d7c59a09ce9ce91a5ce70bab575c5c6a295c673e23ae11d114ba361d1e4e2f6423729c8464b3c11930dd283ca15c8222c75f2d9d7f5267abaa1464bc6e2d915a2b008d2769f865747e165c43ee9c69a6a176e485332d41f18ca13c8eb53cd366115369ca2567f70d3cb4271a701652e9d595c9c0253f78eb6538729ae768b7369232f4a9d5f537a3d5a8386bbdab926954f3ccb266b2c48b036152c7487b95bd227c2e58092312c8c61d9a2a25d75c6470d7b54b9edd51c88c155c5be7dc49b7eb86d0faaa71539bf3cd10ef1c6f9e176dcab3de130efb87275c8c797b9a78db4317a87b66ddaeb53c16aeb15172615430cdd73055c03afd0f57172381bbe4649b33f66ec78b4781bbe4d34a2ad95cae2e986a4160cf177b45df7df6bc2897e450678a571d61c83d1eec8c7e24a9a58105e4af5b936fc41a0ae4801917f20ad44c2a61a8415ec5f1914713dfa34e981c25a917f901763755f5b0c80f2641648a528f0693a465d0a9e4a2a54d25eb6d5d18465ed26d46296e66fcbf00369dc946af80fd6d6cb265fd336cba33756836dd8ff73f609315fd1e6cb2e339109bbc7092b6d849e284a6bbd8141da5894f69da16257114f8bbd984756940c3b8ab0bbdf4c9d8243124f57c687ac72f57f8ce0f5ccafb5d0e4ba641d58bc09295d9c8ffbdf774682a59d1be2424cda1027caf85b61b1e2d8ec0691bff1e641a223a04969024314594b424a1340ce86e2c4d8230f03bdcf85efc5b2a51445b47a528f1d3d4f83fc7ef2d000000ffff\",\"03008b808d24850e0000\"]" + "size": 1403, + "text": "[\"1f8b0800000000000003e4945d6fd3301486ff4ae4eb30e5a3cec7ee4a8be062948981b840137293b3d590d8c1713aa6a9ff7dc7499a795b09bdd8540695aadace39f6fbbe6e9e1ba2a0aea4a8811cdf90b7203f2cbf43a667b228f0874b61964bd06cce343b55b202a5affbd24ce6a03ef6edeffb1af34cc1cf066a4d8e891f799e730a42d4d7c59a09ce9ce91a5ce70bab575c5c6a295c673e23ae11d114bac60e8ab30bd9881cc721d96c70064c370a0f2897a0c8f1574be69fc4d9a22a0519af5b47a4d60a40e3491a7e19999f05d7903b679a69a81d79e14c4b503c63a88e632dcfb459c4509a72c9d97dfd0fdd89069c85547a75652270c90fde7a198e9ce639baad8da40c7d6a75fdcd68352ace5aefaa641ad53cb3ac992cf1de4098d031d25e65af089f0b56c28804b27187a64ac9351719dc75ed92677714326305d7d63977d2edba21b4be6adcd4e67c33c43bc79be7459bf2acf784c3fee1091763de9e26def6d005ea9e59b76b2d8f856b6c945c18154cf3354c15b04effc3d5c548e02e39d9e68cbddbf1e251e02ef9b4924a3697ab0ba65a0ed8f3c55ed1779f3d2fca2539d499e2550718720f073ba31f496a696001f9ebd6e41bb186023960c685bc0235934a186a9057717ce4d1c4f7a813264749ea457e80dd4d553d2cf283491099a2d4a3c1246919742ab9686953c97a5b17869197749b518a9b19ff2f804d67b2d12b607f1b9b6c59ff0c9bee4c1d9a4df7e3fd0fd86445bf079bec780ec4262f9ca42d769238a1e92e36454769e2539ab645491c05fe6e36615d1ad030eeea422f7d3236490c493d1f9adef1cb15bef30397f27e97c3926950f522b0646536f27fef3d1d9a4a56b42f094973a800df6ba1ed86478b2370dac6bf079986880e812524494c11252d49280d03ba1b4b93200cfc0e37be17ff964a14d1d651294afc3435fecff17b0b0000ffff\",\"030097724dfd840e0000\"]" }, "cookies": [], "headers": [ @@ -75,7 +79,7 @@ }, { "name": "date", - "value": "Fri, 14 Aug 2020 17:46:03 GMT" + "value": "Fri, 25 Sep 2020 18:26:53 GMT" }, { "name": "content-type", @@ -107,7 +111,7 @@ }, { "name": "etag", - "value": "W/\"e85-jED9/6YYFGyACPhZmEaIwSqxDds\"" + "value": "W/\"e84-Gkzjv5mxlcw0btuJhYzfeK72c44\"" }, { "name": "x-xss-protection", @@ -132,8 +136,8 @@ "status": 200, "statusText": "OK" }, - "startedDateTime": "2020-08-14T17:46:02.879Z", - "time": 273, + "startedDateTime": "2020-09-25T18:26:53.060Z", + "time": 364, "timings": { "blocked": -1, "connect": -1, @@ -141,7 +145,7 @@ "receive": 0, "send": 0, "ssl": -1, - "wait": 273 + "wait": 364 } } ], diff --git a/spec/recordings/Chain-Geocoder-Provider_1409790517/receives-correct-geocoding-results-parallelize-first-provider-KO-_726443114/recording.har b/spec/recordings/Chain-Geocoder-Provider_1409790517/receives-correct-geocoding-results-parallelize-first-provider-KO-_726443114/recording.har index bbe8852..419af89 100644 --- a/spec/recordings/Chain-Geocoder-Provider_1409790517/receives-correct-geocoding-results-parallelize-first-provider-KO-_726443114/recording.har +++ b/spec/recordings/Chain-Geocoder-Provider_1409790517/receives-correct-geocoding-results-parallelize-first-provider-KO-_726443114/recording.har @@ -82,7 +82,7 @@ }, { "name": "date", - "value": "Fri, 14 Aug 2020 17:58:41 GMT" + "value": "Fri, 25 Sep 2020 18:26:50 GMT" }, { "name": "content-type", @@ -111,7 +111,7 @@ "status": 200, "statusText": "OK" }, - "startedDateTime": "2020-08-14T17:58:41.587Z", + "startedDateTime": "2020-09-25T18:26:50.035Z", "time": 159, "timings": { "blocked": -1, @@ -124,7 +124,7 @@ } }, { - "_id": "e2aec0c20d9e28623deca09660dd67b0", + "_id": "78a91888b5016be96b3a58fdabda2662", "_order": 0, "cache": {}, "request": { @@ -156,7 +156,7 @@ "value": "geocode-maps.yandex.ru" } ], - "headersSize": 308, + "headersSize": 318, "httpVersion": "HTTP/1.1", "method": "GET", "queryString": [ @@ -171,9 +171,13 @@ { "name": "lang", "value": "en_US" + }, + { + "name": "results", + "value": "5" } ], - "url": "https://geocode-maps.yandex.ru/1.x?geocode=1600+Pennsylvania+Ave%2C+Washington%2C+DC&format=json&lang=en_US" + "url": "https://geocode-maps.yandex.ru/1.x?geocode=1600+Pennsylvania+Ave%2C+Washington%2C+DC&format=json&lang=en_US&results=5" }, "response": { "bodySize": 62, @@ -190,7 +194,7 @@ }, { "name": "date", - "value": "Fri, 14 Aug 2020 17:58:41 GMT" + "value": "Fri, 25 Sep 2020 18:26:50 GMT" }, { "name": "content-type", @@ -222,7 +226,7 @@ }, { "name": "x-qloud-router", - "value": "man4-3cc44c5fdead.qloud-c.yandex.net" + "value": "man2-7275f28abf80.qloud-c.yandex.net" } ], "headersSize": 336, @@ -231,8 +235,8 @@ "status": 403, "statusText": "Forbidden" }, - "startedDateTime": "2020-08-14T17:58:41.587Z", - "time": 247, + "startedDateTime": "2020-09-25T18:26:50.035Z", + "time": 242, "timings": { "blocked": -1, "connect": -1, @@ -240,7 +244,7 @@ "receive": 0, "send": 0, "ssl": -1, - "wait": 247 + "wait": 242 } } ], diff --git a/spec/recordings/Chain-Geocoder-Provider_1409790517/receives-correct-geocoding-results-parallelize-first-provider-OK-_2565153306/recording.har b/spec/recordings/Chain-Geocoder-Provider_1409790517/receives-correct-geocoding-results-parallelize-first-provider-OK-_2565153306/recording.har index 3a589ec..4126f4f 100644 --- a/spec/recordings/Chain-Geocoder-Provider_1409790517/receives-correct-geocoding-results-parallelize-first-provider-OK-_2565153306/recording.har +++ b/spec/recordings/Chain-Geocoder-Provider_1409790517/receives-correct-geocoding-results-parallelize-first-provider-OK-_2565153306/recording.har @@ -82,7 +82,7 @@ }, { "name": "date", - "value": "Fri, 14 Aug 2020 17:57:16 GMT" + "value": "Fri, 25 Sep 2020 18:26:51 GMT" }, { "name": "content-type", @@ -111,7 +111,7 @@ "status": 200, "statusText": "OK" }, - "startedDateTime": "2020-08-14T17:57:16.219Z", + "startedDateTime": "2020-09-25T18:26:50.529Z", "time": 207, "timings": { "blocked": -1, @@ -124,7 +124,7 @@ } }, { - "_id": "e2aec0c20d9e28623deca09660dd67b0", + "_id": "78a91888b5016be96b3a58fdabda2662", "_order": 0, "cache": {}, "request": { @@ -156,7 +156,7 @@ "value": "geocode-maps.yandex.ru" } ], - "headersSize": 337, + "headersSize": 347, "httpVersion": "HTTP/1.1", "method": "GET", "queryString": [ @@ -171,17 +171,21 @@ { "name": "lang", "value": "en_US" + }, + { + "name": "results", + "value": "5" } ], - "url": "https://geocode-maps.yandex.ru/1.x?geocode=1600+Pennsylvania+Ave%2C+Washington%2C+DC&format=json&lang=en_US" + "url": "https://geocode-maps.yandex.ru/1.x?geocode=1600+Pennsylvania+Ave%2C+Washington%2C+DC&format=json&lang=en_US&results=5" }, "response": { - "bodySize": 1402, + "bodySize": 1403, "content": { "_isBinary": true, "mimeType": "application/json; charset=utf-8", - "size": 1402, - "text": "[\"1f8b0800000000000003e4945d6fd3301486ff4ae4eb30e5a3cec7ee4a8be062948981b840137293b3d590d8c1713aa6a9ff7dc7499a795b09bdd8540695aadace39f6fbbe6e9e1ba2a0aea4a8811cdf90b7203f2cbf43a667b228f0874b61964bd06cce343b55b202a5affbd24ce6a03ef6edeffb1af34cc1cf066a4d8e891f799e730a42d4d7c59a09ce9ce91a5ce70bab575c5c6a295c673e23ae11d114ba361d1e4e2f6423729c8464b3c11930dd283ca15c8222c75f2d9d7f5267abaa1464bc6e2d915a2b008d2769f865747e165c43ee9c69a6a176e485332d41f18ca13c8eb53cd366115369ca2567f70d3cb4271a701652e9d595c9c0253f78eb6538729ae768b7369232f4a9d5f537a3d5a8386bbdab926954f3ccb266b2c48b036152c7487b95bd227c2e58092312c8c61d9a2a25d75c6470d7b54b9edd51c88c155c5be7dc49b7eb86d0faaa71539bf3cd10ef1c6f9e176dcab3de130efb87275c8c797b9a78db4317a87b66ddaeb53c16aeb15172615430cdd73055c03afd0f57172381bbe4649b33f66ec78b4781bbe4d34a2ad95cae2e986a4160cf177b45df7df6bc2897e450678a571d61c83d1eec8c7e24a9a58105e4af5b936fc41a0ae4801917f20ad44c2a61a8415ec5f1914713dfa34e981c25a917f901763755f5b0c80f2641648a528f0693a465d0a9e4a2a54d25eb6d5d18465ed26d46296e66fcbf00369dc946af80fd6d6cb265fd336cba33756836dd8ff73f609315fd1e6cb2e339109bbc7092b6d849e284a6bbd8141da5894f69da16257114f8bbd984756940c3b8ab0bbdf4c9d8243124f57c687ac72f57f8ce0f5ccafb5d0e4ba641d58bc09295d9c8ffbdf774682a59d1be2424cda1027caf85b61b1e2d8ec0691bff1e641a223a04969024314594b424a1340ce86e2c4d8230f03bdcf85efc5b2a51445b47a528f1d3d4f83fc7ef2d000000ffff03008b808d24850e0000\"]" + "size": 1403, + "text": "[\"1f8b0800000000000003e4945d6fd3301486ff4ae4eb30e5a3cec7ee4a8be062948981b840137293b3d590d8c1713aa6a9ff7dc7499a795b09bdd8540695aadace39f6fbbe6e9e1ba2a0aea4a8811cdf90b7203f2cbf43a667b228f0874b61964bd06cce343b55b202a5affbd24ce6a03ef6edeffb1af34cc1cf066a4d8e891f799e730a42d4d7c59a09ce9ce91a5ce70bab575c5c6a295c673e23ae11d114bac60e8ab30bd9881cc721d96c70064c370a0f2897a0c8f1574be69fc4d9a22a0519af5b47a4d60a40e3491a7e19999f05d7903b679a69a81d79e14c4b503c63a88e632dcfb459c4509a72c9d97dfd0fdd89069c85547a75652270c90fde7a198e9ce639baad8da40c7d6a75fdcd68352ace5aefaa641ad53cb3ac992cf1de4098d031d25e65af089f0b56c28804b27187a64ac9351719dc75ed92677714326305d7d63977d2edba21b4be6adcd4e67c33c43bc79be7459bf2acf784c3fee1091763de9e26def6d005ea9e59b76b2d8f856b6c945c18154cf3354c15b04effc3d5c548e02e39d9e68cbddbf1e251e02ef9b4924a3697ab0ba65a0ed8f3c55ed1779f3d2fca2539d499e2550718720f073ba31f496a696001f9ebd6e41bb186023960c685bc0235934a186a9057717ce4d1c4f7a813264749ea457e80dd4d553d2cf283491099a2d4a3c1246919742ab9686953c97a5b17869197749b518a9b19ff2f804d67b2d12b607f1b9b6c59ff0c9bee4c1d9a4df7e3fd0fd86445bf079bec780ec4262f9ca42d769238a1e92e36454769e2539ab645491c05fe6e36615d1ad030eeea422f7d3236490c493d1f9adef1cb15bef30397f27e97c3926950f522b0646536f27fef3d1d9a4a56b42f094973a800df6ba1ed86478b2370dac6bf079986880e812524494c11252d49280d03ba1b4b93200cfc0e37be17ff964a14d1d651294afc3435fecff17b0b0000ffff\",\"030097724dfd840e0000\"]" }, "cookies": [], "headers": [ @@ -191,7 +195,7 @@ }, { "name": "date", - "value": "Fri, 14 Aug 2020 17:57:16 GMT" + "value": "Fri, 25 Sep 2020 18:26:50 GMT" }, { "name": "content-type", @@ -223,7 +227,7 @@ }, { "name": "etag", - "value": "W/\"e85-jED9/6YYFGyACPhZmEaIwSqxDds\"" + "value": "W/\"e84-Gkzjv5mxlcw0btuJhYzfeK72c44\"" }, { "name": "x-xss-protection", @@ -239,7 +243,7 @@ }, { "name": "x-qloud-router", - "value": "man2-7275f28abf80.qloud-c.yandex.net" + "value": "man4-3cc44c5fdead.qloud-c.yandex.net" } ], "headersSize": 458, @@ -248,8 +252,8 @@ "status": 200, "statusText": "OK" }, - "startedDateTime": "2020-08-14T17:57:16.219Z", - "time": 344, + "startedDateTime": "2020-09-25T18:26:50.529Z", + "time": 334, "timings": { "blocked": -1, "connect": -1, @@ -257,7 +261,7 @@ "receive": 0, "send": 0, "ssl": -1, - "wait": 344 + "wait": 334 } } ], diff --git a/spec/recordings/Chain-Geocoder-Provider_1409790517/receives-correct-geodecoding-results-first-first-provider-OK-_48817278/recording.har b/spec/recordings/Chain-Geocoder-Provider_1409790517/receives-correct-geodecoding-results-first-first-provider-OK-_48817278/recording.har index 3ccb747..ac7301c 100644 --- a/spec/recordings/Chain-Geocoder-Provider_1409790517/receives-correct-geodecoding-results-first-first-provider-OK-_48817278/recording.har +++ b/spec/recordings/Chain-Geocoder-Provider_1409790517/receives-correct-geodecoding-results-first-first-provider-OK-_48817278/recording.har @@ -8,7 +8,7 @@ }, "entries": [ { - "_id": "35af77943d19f4c062f0b16b5a319928", + "_id": "c47d435f272384213688cbf36c8295a1", "_order": 0, "cache": {}, "request": { @@ -40,7 +40,7 @@ "value": "geocode-maps.yandex.ru" } ], - "headersSize": 309, + "headersSize": 319, "httpVersion": "HTTP/1.1", "method": "GET", "queryString": [ @@ -55,17 +55,21 @@ { "name": "lang", "value": "en_US" + }, + { + "name": "results", + "value": "5" } ], - "url": "https://geocode-maps.yandex.ru/1.x?geocode=2.388911%2C48.8631507&format=json&lang=en_US" + "url": "https://geocode-maps.yandex.ru/1.x?geocode=2.388911%2C48.8631507&format=json&lang=en_US&results=5" }, "response": { - "bodySize": 2269, + "bodySize": 1831, "content": { "_isBinary": true, "mimeType": "application/json; charset=utf-8", - "size": 2269, - "text": "[\"1f8b0800000000000003ec97df6ed33014c65f25f27536397fda26bb2b1dec669432718710f292336a48ece03865d3d457e039788fbd18b6e3645e9b7542940a267a53c7fe1c7fe73bcaafe92d1250579cd5804e6ed119f037979f2193335e14ea8b72a6a74b90e49448b210bc02216fac34e339880bbbfdb5d5e8b505a74cea41c56b7482c2e32849d220f0e2e4381947c128406b5f9dfbb5815a3aeb7eb78e2748afd74d21f5fe00abcb2bdeb05c5da468ad365f01918d5087969720d0c97bc7fa53865da395808cd6a64a04d7446df691846b6dea95202c03dfbbfb5ec0510e47ddf582085afb5e88c19b0ac1594eeb1a4a60d2f7a62b600d786744999292f89e31fe851adf4bdea88c7d34cd735559ad4fcf544952dc7cd4b6f48917a64c51122921dfa785192f558f94a036515947f678b5ce4809fd79aa37bda4127c45f55caf79e8c5d5163c230595cefd8c4f57a28c4a414dca56b25d83ab576a0047bd519d2bede2b54a55f6fac3ba4ffb54f59c1626f499ad5a0dede23965f7d5ef256d73c25c3999399d75a6efb3d60e4bca742e44d2154c0590d6dae6ec7c307f1f9d77b1ab5ddd78eee6efa353a880e5cab1abdd9a9c3fda111fbd5b72c19b4fcb2b220c27dcebf9706f7cb41050d2962b76386fdac7d5b4a7fb3cd65d9b660e752668d5a268c05ddfa0cdbef5095d6a7240fec294fd92ada05050d0e3827f0331e382194f9a42f1248d5b4ae1280dd4dea6aa1e4ad208632b19253831301ac25d92a61dee74a9fe1e00d53f0d7b23d43d9dfa7b1f144fcf194d07a7cf7ff274d13f0196434345b1c0a2208c069012e331c691514c4693301c464a8c7198b4b719a7a3645f4ce172a96cfc0e52de3644480ac2cb1b6f71f743c0d139c996849a5fe3ed87ebcff265a7997f1535dbfa1d651e803b4f84fcec10f44b77d8d59a4d2eed0cf2a0880a2749fbef6c348ec361464571fbda33c149307ee4b5270d8360d4422ac649fc3740ea27000000ffff\",\"ec984112c2200c00bfe20b3a24840077cf5e7c818edebdf828dfe1c76c2bdad2824e2dc5daf10cc324e96e0875df306f23fab9663375d3586263e8da1cccdab7389db19a0ddf8d2566a290b2c052bab1c21044c70a4466379e18b499955d5f2fa7b207d6d55a1d8e0f80fc323e171a8f771510491c1e1c4116b15d7e6e5f30c6f8f658eca92cffa06439d5df9ef7e123820b9b9725eebc23a219fa9a470a345e7b4442ac6505459643d6b32defde6a8b1508022217350aa1ee0729a3ad9e83f5d9e49e95c3532ab920f362f9f9defd056bcf618d50ad3131815459258a4eb889c4f98e286fa7d30efeb3c75d8152ec1e90cc322bee0de72db046733e2de049e8cd8cad8f642f149fcda12c4241c420eb9f078002751f4659a8b297568f155b2001910ec3a8d06a5353cd46981b000000ffff\",\"b4d84b0ac0300804d0abe4029518ff87cbdd2b74114ab2b1d0fdac9c87a02abf625cf8968bb2bdbab54f7e8a5e5e7557fbbc249702c5c8031461a8b1efafef00eb6e484d32c29e67eaa9508460228bc60a16fd49e500e6bc010000ffff\",\"0300ac42889cbb200000\"]" + "size": 1831, + "text": "[\"1f8b0800000000000003ec97df6ed33014c65f25f27536e56f9becae74b09b51cac41d42c84bcea821b183e3944d535f81e7e03df6621c3b7fe6b55d2744a960a23775eccff677bea3fcd6dd12097525780de4e4969c817873f91932351545815f4c703d5d82a2a754d1b914154875d349339183bce8b6bfee347a6d2e18577a50899a9c90e0384c92d4f79d28394e46a11ffb64e5e2bd5f1ba895b5eef6ebde98e8f5ba2994de1fe3d39568788ee394ac70ef1550d548bcb3bc04494ede5bce9ff26bfbac2464ac364512b8a6b8d9250aaeb5a75792f20c5ce7ee7b0147391cf5cf732a59ed3a8107ce444ac17356d7500257ae3359026fc039a3684a29ea3abe87e77d61c6f7423418b14b26798e85d5faf60c4b52f2e6a3b6a56fbc3065ca922a05f93e2d4c45892d42416da2ea1c75d7e33aa7250cf7616b064925c592e9b941f3d08bad2d44460ba6acf38c4f5b8246956426e54eb25983ad473580a55eabce96f6f1764a2c7bf56135a47d8a3d6785097dda558dc36ef19cf1fbeaf792b6b961864ea65667ade9fbacb5c392719d0b556c091309b4b5b63e3bdb9abf4bcefbd871573f9ed9f9bbe4142ae0393ab6b51b93b3473be292770b2145f3697145a5c184fd3cdbde1b97cc2594acc54a379c35edeb6adad37f1eeb6e97660e752659d592688bbba141eb7d1b12bad4e480fc8529fb255f428150d0e3427c033915921b4f1a42d1388d5a487961eae3dea6aa1e4ad2d0f33a499c788981d136da2569dad34e97eaee0150c3dbb03742ddd36938fba0787ace683a387dfe93a78ffe09b01c1a2ac8820e0541b805299137f2bcd028c6f13808b62325f2bc20698f19a571b22fa608b5401bbf8394b70d958a8174f2c699dffd9070744eb30565e6aff1e6cbf567f9b2d3ccbf8a9a4dfd8e320fc09d27427e7608faa51376b5669d4b3b833c28a28271d2fe73168fa2603ba3c2a8fdd933f6127ff4c8cf9e34f0fdb88554e425d15f01a99f000000ffff\",\"dc96311202210c45afb24720d910a0b7b6b1b6d0597b1b0fe539bc98b0c40227b19165460b2a98c04f783fa9351c6b443f67365b9bc63f1ac33bcdaaea96e27ec4068e5c892566220d59e07996b1221298630522b38c2711d36064778ffb357be09aad69b94cafdac8e73d95ba7741d5ba6808a62243cee94fe985a02d74247e87db590fa16eec3f26a6a5ccd2d782f63d618884b872019e126b8071ca6dae1c490ec181d113d1395f03f91852287a8e793d010000ffff0300377eef3b77150000\"]" }, "cookies": [], "headers": [ @@ -75,7 +79,7 @@ }, { "name": "date", - "value": "Fri, 14 Aug 2020 18:24:50 GMT" + "value": "Fri, 25 Sep 2020 18:26:49 GMT" }, { "name": "content-type", @@ -107,7 +111,7 @@ }, { "name": "etag", - "value": "W/\"20bb-MO3+B80DGyD1s+UZB68tAeaEiSk\"" + "value": "W/\"1577-SWIN9f7y+Rbp/Lt3aKBPRwRs6GI\"" }, { "name": "x-xss-protection", @@ -123,7 +127,7 @@ }, { "name": "x-qloud-router", - "value": "man4-3cc44c5fdead.qloud-c.yandex.net" + "value": "man1-043f58f4a44d.qloud-c.yandex.net" } ], "headersSize": 459, @@ -132,8 +136,8 @@ "status": 200, "statusText": "OK" }, - "startedDateTime": "2020-08-14T18:24:50.603Z", - "time": 230, + "startedDateTime": "2020-09-25T18:26:49.346Z", + "time": 348, "timings": { "blocked": -1, "connect": -1, @@ -141,7 +145,7 @@ "receive": 0, "send": 0, "ssl": -1, - "wait": 230 + "wait": 348 } }, { @@ -223,7 +227,7 @@ }, { "name": "date", - "value": "Fri, 14 Aug 2020 18:24:51 GMT" + "value": "Fri, 25 Sep 2020 18:26:49 GMT" }, { "name": "content-type", diff --git a/spec/recordings/Chain-Geocoder-Provider_1409790517/receives-correct-geodecoding-results-first-provider-KO-_1165577657/recording.har b/spec/recordings/Chain-Geocoder-Provider_1409790517/receives-correct-geodecoding-results-first-provider-KO-_1165577657/recording.har index f0d1438..37f1f7b 100644 --- a/spec/recordings/Chain-Geocoder-Provider_1409790517/receives-correct-geodecoding-results-first-provider-KO-_1165577657/recording.har +++ b/spec/recordings/Chain-Geocoder-Provider_1409790517/receives-correct-geodecoding-results-first-provider-KO-_1165577657/recording.har @@ -8,7 +8,7 @@ }, "entries": [ { - "_id": "35af77943d19f4c062f0b16b5a319928", + "_id": "c47d435f272384213688cbf36c8295a1", "_order": 0, "cache": {}, "request": { @@ -40,7 +40,7 @@ "value": "geocode-maps.yandex.ru" } ], - "headersSize": 280, + "headersSize": 290, "httpVersion": "HTTP/1.1", "method": "GET", "queryString": [ @@ -55,9 +55,13 @@ { "name": "lang", "value": "en_US" + }, + { + "name": "results", + "value": "5" } ], - "url": "https://geocode-maps.yandex.ru/1.x?geocode=2.388911%2C48.8631507&format=json&lang=en_US" + "url": "https://geocode-maps.yandex.ru/1.x?geocode=2.388911%2C48.8631507&format=json&lang=en_US&results=5" }, "response": { "bodySize": 62, @@ -74,7 +78,7 @@ }, { "name": "date", - "value": "Fri, 14 Aug 2020 18:24:49 GMT" + "value": "Fri, 25 Sep 2020 18:26:52 GMT" }, { "name": "content-type", @@ -106,7 +110,7 @@ }, { "name": "x-qloud-router", - "value": "man4-a74d0ae6f388.qloud-c.yandex.net" + "value": "man1-043f58f4a44d.qloud-c.yandex.net" } ], "headersSize": 336, @@ -115,8 +119,8 @@ "status": 403, "statusText": "Forbidden" }, - "startedDateTime": "2020-08-14T18:24:49.153Z", - "time": 292, + "startedDateTime": "2020-09-25T18:26:51.999Z", + "time": 265, "timings": { "blocked": -1, "connect": -1, @@ -124,7 +128,7 @@ "receive": 0, "send": 0, "ssl": -1, - "wait": 292 + "wait": 265 } }, { @@ -206,7 +210,7 @@ }, { "name": "date", - "value": "Fri, 14 Aug 2020 18:24:49 GMT" + "value": "Fri, 25 Sep 2020 18:26:52 GMT" }, { "name": "content-type", @@ -235,8 +239,8 @@ "status": 200, "statusText": "OK" }, - "startedDateTime": "2020-08-14T18:24:49.452Z", - "time": 168, + "startedDateTime": "2020-09-25T18:26:52.277Z", + "time": 217, "timings": { "blocked": -1, "connect": -1, @@ -244,7 +248,7 @@ "receive": 0, "send": 0, "ssl": -1, - "wait": 168 + "wait": 217 } } ], diff --git a/spec/recordings/Chain-Geocoder-Provider_1409790517/receives-correct-geodecoding-results-first-provider-OK-_2544227361/recording.har b/spec/recordings/Chain-Geocoder-Provider_1409790517/receives-correct-geodecoding-results-first-provider-OK-_2544227361/recording.har index 72c482c..ae256d1 100644 --- a/spec/recordings/Chain-Geocoder-Provider_1409790517/receives-correct-geodecoding-results-first-provider-OK-_2544227361/recording.har +++ b/spec/recordings/Chain-Geocoder-Provider_1409790517/receives-correct-geodecoding-results-first-provider-OK-_2544227361/recording.har @@ -8,7 +8,7 @@ }, "entries": [ { - "_id": "35af77943d19f4c062f0b16b5a319928", + "_id": "c47d435f272384213688cbf36c8295a1", "_order": 0, "cache": {}, "request": { @@ -40,7 +40,7 @@ "value": "geocode-maps.yandex.ru" } ], - "headersSize": 309, + "headersSize": 319, "httpVersion": "HTTP/1.1", "method": "GET", "queryString": [ @@ -55,17 +55,21 @@ { "name": "lang", "value": "en_US" + }, + { + "name": "results", + "value": "5" } ], - "url": "https://geocode-maps.yandex.ru/1.x?geocode=2.388911%2C48.8631507&format=json&lang=en_US" + "url": "https://geocode-maps.yandex.ru/1.x?geocode=2.388911%2C48.8631507&format=json&lang=en_US&results=5" }, "response": { - "bodySize": 2263, + "bodySize": 1831, "content": { "_isBinary": true, "mimeType": "application/json; charset=utf-8", - "size": 2263, - "text": "[\"1f8b0800000000000003ec97df6ed33014c65f25f27536397fda26bb2b1dec669432718710f292336a48ece03865d3d457e039788fbd18b6e3645e9b7542940a267a53c7fe1c7fe73bcaafe92d1250579cd5804e6ed119f037979f2193335e14ea8b72a6a74b90e49448b210bc02216fac34e339880bbbfdb5d5e8b505a74cea41c56b7482c2e32849d220f0e2e4381947c128406b5f9dfbb5815a3aeb7eb78e2748afd74d21f5fe00abcb2bdeb05c5da468ad365f01918d5087969720d0c97bc7fa53865da395808cd6a64a04d7446df691846b6dea95202c03dfbbfb5ec0510e47ddf582085afb5e88c19b0ac1594eeb1a4a60d2f7a62b600d786744999292f89e31fe851adf4bdea88c7d34cd735559ad4fcf544952dc7cd4b6f48917a64c51122921dfa785192f558f94a036515947f678b5ce4809fd79aa37bda4127c45f55caf79e8c5d5163c230595cefd8c4f57a28c4a414dca56b25d83ab576a0047bd519d2bede2b54a55f6fac3ba4ffb54f59c1626f499ad5a0dede23965f7d5ef256d73c25c3999399d75a6efb3d60e4bca742e44d2154c0590d6dae6ec7c307f1f9d77b1ab5ddd78eee6efa353a880e5cab1abdd9a9c3fda111fbd5b72c19b4fcb2b220c27dcebf9706f7cb41050d2962b76386fdac7d5b4a7fb3cd65d9b660e752668d5a268c05ddfa0cdbef5095d6a7240fec294fd92ada05050d0e3827f0331e382194f9a42f1248d5b4ae1280dd4dea6aa1e4ad208632b19253831301ac25d92a61dee74a9fe1e00d53f0d7b23d43d9dfa7b1f144fcf194d07a7cf7ff274d13f0196434345b1c0a2208c069012e331c691514c4693301c464a8c7198b4b719a7a3645f4ce172a96cfc0e52de3644480ac2cb1b6f71f743c0d139c996849a5fe3ed87ebcff265a7997f1535dbfa1d651e803b4f84fcec10f44b77d8d59a4d2eed0cf2a0880a2749fbef6c348ec361464571fbda33c149307ee4b5270d8360d4422ac649fc3740ea27000000ffff\",\"ec984112c2200c00bfe20b3a24840077cf5e7c818edebdf828dfe1c76c2bdad2824e2dc5daf10cc324e96e0875df306f23fab9663375d3586263e8da1cccdab7389db19a0ddf8d2566a290b2c052bab1c21044c70a4466379e18b499955d5f2fa7b207d6d55a1d8e0f80fc323e171a8f771510491c1e1c4116b15d7e6e5f30c6f8f658eca92cffa06439d5df9ef7e123820b9b9725eebc23a219fa9a470a345e7b4442ac6505459643d6b32defde6a8b1508022217350aa1ee0729a3ad9e83f5d9e49e95c3532ab920f362f9f9defd056bcf618d50ad3131815459258a4eb889c4f98e286fa7d30efeb3c75d8152ec1e90cc322bee0de72db046733e2de049e8cd8cad8f642f149fcda12c4241c420eb9f078002751f4659a8b297568f155b2001910ec3a8d06a5353cd46981b000000ffffb4d84b0ac0300804d0abe4029518ff87cbdd2b74114ab2b1d0fdac9c87a02abf625cf8968bb2bdbab54f7e8a5e5e7557fbbc249702c5c8031461a8b1efafef00eb6e484d32c29e67eaa9508460228bc60a16fd49e500e6bc010000ffff0300ac42889cbb200000\"]" + "size": 1831, + "text": "[\"1f8b0800000000000003ec97df6ed33014c65f25f27536e56f9becae74b09b51cac41d42c84bcea821b183e3944d535f81e7e03df6621c3b7fe6b55d2744a960a23775eccff677bea3fcd6dd12097525780de4e4969c817873f91932351545815f4c703d5d82a2a754d1b914154875d349339183bce8b6bfee347a6d2e18577a50899a9c90e0384c92d4f79d28394e46a11ffb64e5e2bd5f1ba895b5eef6ebde98e8f5ba2994de1fe3d39568788ee394ac70ef1550d548bcb3bc04494ede5bce9ff26bfbac2464ac364512b8a6b8d9250aaeb5a75792f20c5ce7ee7b0147391cf5cf732a59ed3a8107ce444ac17356d7500257ae3359026fc039a3684a29ea3abe87e77d61c6f7423418b14b26798e85d5faf60c4b52f2e6a3b6a56fbc3065ca922a05f93e2d4c45892d42416da2ea1c75d7e33aa7250cf7616b064925c592e9b941f3d08bad2d44460ba6acf38c4f5b8246956426e54eb25983ad473580a55eabce96f6f1764a2c7bf56135a47d8a3d6785097dda558dc36ef19cf1fbeaf792b6b961864ea65667ade9fbacb5c392719d0b556c091309b4b5b63e3bdb9abf4bcefbd871573f9ed9f9bbe4142ae0393ab6b51b93b3473be292770b2145f3697145a5c184fd3cdbde1b97cc2594acc54a379c35edeb6adad37f1eeb6e97660e752659d592688bbba141eb7d1b12bad4e480fc8529fb255f428150d0e3427c033915921b4f1a42d1388d5a487961eae3dea6aa1e4ad2d0f33a499c788981d136da2569dad34e97eaee0150c3dbb03742ddd36938fba0787ace683a387dfe93a78ffe09b01c1a2ac8820e0541b805299137f2bcd028c6f13808b62325f2bc20698f19a571b22fa608b5401bbf8394b70d958a8174f2c699dffd9070744eb30565e6aff1e6cbf567f9b2d3ccbf8a9a4dfd8e320fc09d27427e7608faa51376b5669d4b3b833c28a28271d2fe73168fa2603ba3c2a8fdd933f6127ff4c8cf9e34f0fdb88554e425d15f01a99f000000ffff\",\"dc96311202210c45afb24720d910a0b7b6b1b6d0597b1b0fe539bc98b0c40227b19165460b2a98c04f783fa9351c6b443f67365b9bc63f1ac33bcdaaea96e27ec4068e5c892566220d59e07996b1221298630522b38c2711d36064778ffb357be09aad69b94cafdac8e73d95ba7741d5ba6808a62243cee94fe985a02d74247e87db590fa16eec3f26a6a5ccd2d782f63d618884b872019e126b8071ca6dae1c490ec181d113d1395f03f91852287a8e793d010000ffff0300377eef3b77150000\"]" }, "cookies": [], "headers": [ @@ -75,7 +79,7 @@ }, { "name": "date", - "value": "Fri, 14 Aug 2020 18:24:49 GMT" + "value": "Fri, 25 Sep 2020 18:26:52 GMT" }, { "name": "content-type", @@ -107,7 +111,7 @@ }, { "name": "etag", - "value": "W/\"20bb-MO3+B80DGyD1s+UZB68tAeaEiSk\"" + "value": "W/\"1577-SWIN9f7y+Rbp/Lt3aKBPRwRs6GI\"" }, { "name": "x-xss-protection", @@ -123,7 +127,7 @@ }, { "name": "x-qloud-router", - "value": "man1-043f58f4a44d.qloud-c.yandex.net" + "value": "man4-3cc44c5fdead.qloud-c.yandex.net" } ], "headersSize": 459, @@ -132,8 +136,8 @@ "status": 200, "statusText": "OK" }, - "startedDateTime": "2020-08-14T18:24:49.686Z", - "time": 249, + "startedDateTime": "2020-09-25T18:26:52.507Z", + "time": 241, "timings": { "blocked": -1, "connect": -1, @@ -141,7 +145,7 @@ "receive": 0, "send": 0, "ssl": -1, - "wait": 249 + "wait": 241 } } ], diff --git a/spec/recordings/Chain-Geocoder-Provider_1409790517/receives-correct-geodecoding-results-parallelize-first-provider-KO-_268891293/recording.har b/spec/recordings/Chain-Geocoder-Provider_1409790517/receives-correct-geodecoding-results-parallelize-first-provider-KO-_268891293/recording.har index 1a804f3..e9ad86a 100644 --- a/spec/recordings/Chain-Geocoder-Provider_1409790517/receives-correct-geodecoding-results-parallelize-first-provider-KO-_268891293/recording.har +++ b/spec/recordings/Chain-Geocoder-Provider_1409790517/receives-correct-geodecoding-results-parallelize-first-provider-KO-_268891293/recording.har @@ -86,7 +86,7 @@ }, { "name": "date", - "value": "Fri, 14 Aug 2020 18:24:50 GMT" + "value": "Fri, 25 Sep 2020 18:26:51 GMT" }, { "name": "content-type", @@ -115,7 +115,7 @@ "status": 200, "statusText": "OK" }, - "startedDateTime": "2020-08-14T18:24:49.976Z", + "startedDateTime": "2020-09-25T18:26:51.531Z", "time": 81, "timings": { "blocked": -1, @@ -128,7 +128,7 @@ } }, { - "_id": "35af77943d19f4c062f0b16b5a319928", + "_id": "c47d435f272384213688cbf36c8295a1", "_order": 0, "cache": {}, "request": { @@ -160,7 +160,7 @@ "value": "geocode-maps.yandex.ru" } ], - "headersSize": 280, + "headersSize": 290, "httpVersion": "HTTP/1.1", "method": "GET", "queryString": [ @@ -175,9 +175,13 @@ { "name": "lang", "value": "en_US" + }, + { + "name": "results", + "value": "5" } ], - "url": "https://geocode-maps.yandex.ru/1.x?geocode=2.388911%2C48.8631507&format=json&lang=en_US" + "url": "https://geocode-maps.yandex.ru/1.x?geocode=2.388911%2C48.8631507&format=json&lang=en_US&results=5" }, "response": { "bodySize": 62, @@ -194,7 +198,7 @@ }, { "name": "date", - "value": "Fri, 14 Aug 2020 18:24:50 GMT" + "value": "Fri, 25 Sep 2020 18:26:51 GMT" }, { "name": "content-type", @@ -226,7 +230,7 @@ }, { "name": "x-qloud-router", - "value": "man1-043f58f4a44d.qloud-c.yandex.net" + "value": "man4-3cc44c5fdead.qloud-c.yandex.net" } ], "headersSize": 336, @@ -235,8 +239,8 @@ "status": 403, "statusText": "Forbidden" }, - "startedDateTime": "2020-08-14T18:24:49.976Z", - "time": 191, + "startedDateTime": "2020-09-25T18:26:51.531Z", + "time": 240, "timings": { "blocked": -1, "connect": -1, @@ -244,7 +248,7 @@ "receive": 0, "send": 0, "ssl": -1, - "wait": 191 + "wait": 240 } } ], diff --git a/spec/recordings/Chain-Geocoder-Provider_1409790517/receives-correct-geodecoding-results-parallelize-first-provider-OK-_4258976501/recording.har b/spec/recordings/Chain-Geocoder-Provider_1409790517/receives-correct-geodecoding-results-parallelize-first-provider-OK-_4258976501/recording.har index a52c765..57247e1 100644 --- a/spec/recordings/Chain-Geocoder-Provider_1409790517/receives-correct-geodecoding-results-parallelize-first-provider-OK-_4258976501/recording.har +++ b/spec/recordings/Chain-Geocoder-Provider_1409790517/receives-correct-geodecoding-results-parallelize-first-provider-OK-_4258976501/recording.har @@ -8,7 +8,7 @@ }, "entries": [ { - "_id": "35af77943d19f4c062f0b16b5a319928", + "_id": "c47d435f272384213688cbf36c8295a1", "_order": 0, "cache": {}, "request": { @@ -40,7 +40,7 @@ "value": "geocode-maps.yandex.ru" } ], - "headersSize": 309, + "headersSize": 319, "httpVersion": "HTTP/1.1", "method": "GET", "queryString": [ @@ -55,17 +55,21 @@ { "name": "lang", "value": "en_US" + }, + { + "name": "results", + "value": "5" } ], - "url": "https://geocode-maps.yandex.ru/1.x?geocode=2.388911%2C48.8631507&format=json&lang=en_US" + "url": "https://geocode-maps.yandex.ru/1.x?geocode=2.388911%2C48.8631507&format=json&lang=en_US&results=5" }, "response": { - "bodySize": 2266, + "bodySize": 1831, "content": { "_isBinary": true, "mimeType": "application/json; charset=utf-8", - "size": 2266, - "text": "[\"1f8b0800000000000003ec97df6ed33014c65f25f27536397fda26bb2b1dec669432718710f292336a48ece03865d3d457e039788fbd18b6e3645e9b7542940a267a53c7fe1c7fe73bcaafe92d1250579cd5804e6ed119f037979f2193335e14ea8b72a6a74b90e49448b210bc02216fac34e339880bbbfdb5d5e8b505a74cea41c56b7482c2e32849d220f0e2e4381947c128406b5f9dfbb5815a3aeb7eb78e2748afd74d21f5fe00abcb2bdeb05c5da468ad365f01918d5087969720d0c97bc7fa53865da395808cd6a64a04d7446df691846b6dea95202c03dfbbfb5ec0510e47ddf582085afb5e88c19b0ac1594eeb1a4a60d2f7a62b600d786744999292f89e31fe851adf4bdea88c7d34cd735559ad4fcf544952dc7cd4b6f48917a64c51122921dfa785192f558f94a036515947f678b5ce4809fd79aa37bda4127c45f55caf79e8c5d5163c230595cefd8c4f57a28c4a414dca56b25d83ab576a0047bd519d2bede2b54a55f6fac3ba4ffb54f59c1626f499ad5a0dede23965f7d5ef256d73c25c3999399d75a6efb3d60e4bca742e44d2154c0590d6dae6ec7c307f1f9d77b1ab5ddd78eee6efa353a880e5cab1abdd9a9c3fda111fbd5b72c19b4fcb2b220c27dcebf9706f7cb41050d2962b76386fdac7d5b4a7fb3cd65d9b660e752668d5a268c05ddfa0cdbef5095d6a7240fec294fd92ada05050d0e3827f0331e382194f9a42f1248d5b4ae1280dd4dea6aa1e4ad208632b19253831301ac25d92a61dee74a9fe1e00d53f0d7b23d43d9dfa7b1f144fcf194d07a7cf7ff274d13f0196434345b1c0a2208c069012e331c691514c4693301c464a8c7198b4b719a7a3645f4ce172a96cfc0e52de3644480ac2cb1b6f71f743c0d139c996849a5fe3ed87ebcff265a7997f1535dbfa1d651e803b4f84fcec10f44b77d8d59a4d2eed0cf2a0880a2749fbef6c348ec361464571fbda33c149307ee4b5270d8360d4422ac649fc3740ea27000000ffff\",\"ec984112c2200c00bfe20b3a24840077cf5e7c818edebdf828dfe1c76c2bdad2824e2dc5daf10cc324e96e0875df306f23fab9663375d3586263e8da1cccdab7389db19a0ddf8d2566a290b2c052bab1c21044c70a4466379e18b499955d5f2fa7b207d6d55a1d8e0f80fc323e171a8f771510491c1e1c4116b15d7e6e5f30c6f8f658eca92cffa06439d5df9ef7e123820b9b9725eebc23a219fa9a470a345e7b4442ac6505459643d6b32defde6a8b1508022217350aa1ee0729a3ad9e83f5d9e49e95c3532ab920f362f9f9defd056bcf618d50ad3131815459258a4eb889c4f98e286fa7d30efeb3c75d8152ec1e90cc322bee0de72db046733e2de049e8cd8cad8f642f149fcda12c4241c420eb9f078002751f4659a8b297568f155b2001910ec3a8d06a5353cd46981b000000ffffb4d84b0ac0300804d0abe4029518ff87cbdd2b74114ab2b1d0fdac9c87a02abf625cf8968bb2bdbab54f7e8a5e5e7557fbbc249702c5c8031461a8b1efafef00eb6e484d32c29e67eaa9508460228bc60a16fd49e500e6bc010000ffff\",\"0300ac42889cbb200000\"]" + "size": 1831, + "text": "[\"1f8b0800000000000003ec97df6ed33014c65f25f27536e56f9becae74b09b51cac41d42c84bcea821b183e3944d535f81e7e03df6621c3b7fe6b55d2744a960a23775eccff677bea3fcd6dd12097525780de4e4969c817873f91932351545815f4c703d5d82a2a754d1b914154875d349339183bce8b6bfee347a6d2e18577a50899a9c90e0384c92d4f79d28394e46a11ffb64e5e2bd5f1ba895b5eef6ebde98e8f5ba2994de1fe3d39568788ee394ac70ef1550d548bcb3bc04494ede5bce9ff26bfbac2464ac364512b8a6b8d9250aaeb5a75792f20c5ce7ee7b0147391cf5cf732a59ed3a8107ce444ac17356d7500257ae3359026fc039a3684a29ea3abe87e77d61c6f7423418b14b26798e85d5faf60c4b52f2e6a3b6a56fbc3065ca922a05f93e2d4c45892d42416da2ea1c75d7e33aa7250cf7616b064925c592e9b941f3d08bad2d44460ba6acf38c4f5b8246956426e54eb25983ad473580a55eabce96f6f1764a2c7bf56135a47d8a3d6785097dda558dc36ef19cf1fbeaf792b6b961864ea65667ade9fbacb5c392719d0b556c091309b4b5b63e3bdb9abf4bcefbd871573f9ed9f9bbe4142ae0393ab6b51b93b3473be292770b2145f3697145a5c184fd3cdbde1b97cc2594acc54a379c35edeb6adad37f1eeb6e97660e752659d592688bbba141eb7d1b12bad4e480fc8529fb255f428150d0e3427c033915921b4f1a42d1388d5a487961eae3dea6aa1e4ad2d0f33a499c788981d136da2569dad34e97eaee0150c3dbb03742ddd36938fba0787ace683a387dfe93a78ffe09b01c1a2ac8820e0541b805299137f2bcd028c6f13808b62325f2bc20698f19a571b22fa608b5401bbf8394b70d958a8174f2c699dffd9070744eb30565e6aff1e6cbf567f9b2d3ccbf8a9a4dfd8e320fc09d27427e7608faa51376b5669d4b3b833c28a28271d2fe73168fa2603ba3c2a8fdd933f6127ff4c8cf9e34f0fdb88554e425d15f01a99f000000ffff\",\"dc96311202210c45afb24720d910a0b7b6b1b6d0597b1b0fe539bc98b0c40227b19165460b2a98c04f783fa9351c6b443f67365b9bc63f1ac33bcdaaea96e27ec4068e5c892566220d59e07996b1221298630522b38c2711d36064778ffb357be09aad69b94cafdac8e73d95ba7741d5ba6808a62243cee94fe985a02d74247e87db590fa16eec3f26a6a5ccd2d782f63d618884b872019e126b8071ca6dae1c490ec181d113d1395f03f91852287a8e793d010000ffff0300377eef3b77150000\"]" }, "cookies": [], "headers": [ @@ -75,7 +79,7 @@ }, { "name": "date", - "value": "Fri, 14 Aug 2020 18:24:50 GMT" + "value": "Fri, 25 Sep 2020 18:26:53 GMT" }, { "name": "content-type", @@ -107,7 +111,7 @@ }, { "name": "etag", - "value": "W/\"20bb-MO3+B80DGyD1s+UZB68tAeaEiSk\"" + "value": "W/\"1577-SWIN9f7y+Rbp/Lt3aKBPRwRs6GI\"" }, { "name": "x-xss-protection", @@ -132,8 +136,8 @@ "status": 200, "statusText": "OK" }, - "startedDateTime": "2020-08-14T18:24:50.210Z", - "time": 240, + "startedDateTime": "2020-09-25T18:26:52.766Z", + "time": 280, "timings": { "blocked": -1, "connect": -1, @@ -141,7 +145,7 @@ "receive": 0, "send": 0, "ssl": -1, - "wait": 240 + "wait": 280 } }, { @@ -223,7 +227,7 @@ }, { "name": "date", - "value": "Fri, 14 Aug 2020 18:24:50 GMT" + "value": "Fri, 25 Sep 2020 18:26:52 GMT" }, { "name": "content-type", @@ -252,8 +256,8 @@ "status": 200, "statusText": "OK" }, - "startedDateTime": "2020-08-14T18:24:50.210Z", - "time": 359, + "startedDateTime": "2020-09-25T18:26:52.766Z", + "time": 224, "timings": { "blocked": -1, "connect": -1, @@ -261,7 +265,7 @@ "receive": 0, "send": 0, "ssl": -1, - "wait": 359 + "wait": 224 } } ], diff --git a/spec/recordings/Yandex-Geocoder-Provider_3381125107/receives-correct-geocoding-results_3640432360/recording.har b/spec/recordings/Yandex-Geocoder-Provider_3381125107/receives-correct-geocoding-results_3640432360/recording.har index 91ccff6..7561443 100644 --- a/spec/recordings/Yandex-Geocoder-Provider_3381125107/receives-correct-geocoding-results_3640432360/recording.har +++ b/spec/recordings/Yandex-Geocoder-Provider_3381125107/receives-correct-geocoding-results_3640432360/recording.har @@ -8,7 +8,7 @@ }, "entries": [ { - "_id": "e2aec0c20d9e28623deca09660dd67b0", + "_id": "78a91888b5016be96b3a58fdabda2662", "_order": 0, "cache": {}, "request": { @@ -40,7 +40,7 @@ "value": "geocode-maps.yandex.ru" } ], - "headersSize": 337, + "headersSize": 347, "httpVersion": "HTTP/1.1", "method": "GET", "queryString": [ @@ -55,17 +55,21 @@ { "name": "lang", "value": "en_US" + }, + { + "name": "results", + "value": "5" } ], - "url": "https://geocode-maps.yandex.ru/1.x?geocode=1600+Pennsylvania+Ave%2C+Washington%2C+DC&format=json&lang=en_US" + "url": "https://geocode-maps.yandex.ru/1.x?geocode=1600+Pennsylvania+Ave%2C+Washington%2C+DC&format=json&lang=en_US&results=5" }, "response": { - "bodySize": 1405, + "bodySize": 1400, "content": { "_isBinary": true, "mimeType": "application/json; charset=utf-8", - "size": 1405, - "text": "[\"1f8b0800000000000003e4945d6fd3301486ff4ae4eb30e5a3cec7ee4a8be062948981b840137293b3d590d8c1713aa6a9ff7dc7499a795b09bdd8540695aadace39f6fbbe6e9e1ba2a0aea4a8811cdf90b7203f2cbf43a667b228f0874b61964bd06cce343b55b202a5affbd24ce6a03ef6edeffb1af34cc1cf066a4d8e891f799e730a42d4d7c59a09ce9ce91a5ce70bab575c5c6a295c673e23ae11d114ba361d1e4e2f6423729c8464b3c11930dd283ca15c8222c75f2d9d7f5267abaa1464bc6e2d915a2b008d2769f865747e165c43ee9c69a6a176e485332d41f18ca13c8eb53cd366115369ca2567f70d3cb4271a701652e9d595c9c0253f78eb6538729ae768b7369232f4a9d5f537a3d5a8386bbdab926954f3ccb266b2c48b036152c7487b95bd227c2e58092312c8c61d9a2a25d75c6470d7b54b9edd51c88c155c5be7dc49b7eb86d0faaa71539bf3cd10ef1c6f9e176dcab3de130efb87275c8c797b9a78db4317a87b66ddaeb53c16aeb15172615430cdd73055c03afd0f57172381bbe4649b33f66ec78b4781bbe4d34a2ad95cae2e986a4160cf177b45df7df6bc2897e450678a571d61c83d1eec8c7e24a9a58105e4af5b936fc41a0ae4801917f20ad44c2a61a8415ec5f1914713dfa34e981c25a917f901763755f5b0c80f2641648a528f0693a465d0a9e4a2a54d25eb6d5d18465ed26d46296e66fcbf00369dc946af80fd6d6cb265fd336cba33756836dd8ff73f609315fd1e6cb2e339109bbc7092b6d849e284a6bbd8141da5894f69da16257114f8bbd984756940c3b8ab0bbdf4c9d8243124f57c687ac72f57f8ce0f5ccafb5d0e4ba641d58bc09295d9c8ffbdf774682a59d1be2424cda1027caf85b61b1e2d8ec0691bff1e641a223a04969024314594b424a1340ce86e2c4d8230f03bdcf85efc5b2a51445b47a528f1d3d4f83fc7ef2d000000ffff\",\"03008b808d24850e0000\"]" + "size": 1400, + "text": "[\"1f8b0800000000000003e4945d6fd3301486ff4ae4eb30e5a3cec7ee4a8be062948981b840137293b3d590d8c1713aa6a9ff7dc7499a795b09bdd8540695aadace39f6fbbe6e9e1ba2a0aea4a8811cdf90b7203f2cbf43a667b228f0874b61964bd06cce343b55b202a5affbd24ce6a03ef6edeffb1af34cc1cf066a4d8e891f799e730a42d4d7c59a09ce9ce91a5ce70bab575c5c6a295c673e23ae11d114bac60e8ab30bd9881cc721d96c70064c370a0f2897a0c8f1574be69fc4d9a22a0519af5b47a4d60a40e3491a7e19999f05d7903b679a69a81d79e14c4b503c63a88e632dcfb459c4509a72c9d97dfd0fdd89069c85547a75652270c90fde7a198e9ce639baad8da40c7d6a75fdcd68352ace5aefaa641ad53cb3ac992cf1de4098d031d25e65af089f0b56c28804b27187a64ac9351719dc75ed92677714326305d7d63977d2edba21b4be6adcd4e67c33c43bc79be7459bf2acf784c3fee1091763de9e26def6d005ea9e59b76b2d8f856b6c945c18154cf3354c15b04effc3d5c548e02e39d9e68cbddbf1e251e02ef9b4924a3697ab0ba65a0ed8f3c55ed1779f3d2fca2539d499e2550718720f073ba31f496a696001f9ebd6e41bb186023960c685bc0235934a186a9057717ce4d1c4f7a813264749ea457e80dd4d553d2cf283491099a2d4a3c1246919742ab9686953c97a5b17869197749b518a9b19ff2f804d67b2d12b607f1b9b6c59ff0c9bee4c1d9a4df7e3fd0fd86445bf079bec780ec4262f9ca42d769238a1e92e36454769e2539ab645491c05fe6e36615d1ad030eeea422f7d3236490c493d1f9adef1cb15bef30397f27e97c3926950f522b0646536f27fef3d1d9a4a56b42f094973a800df6ba1ed86478b2370dac6bf079986880e812524494c11252d49280d03ba1b4b93200cfc0e37be17ff964a14d1d651294afc3435fecff17b0b0000ffff030097724dfd840e0000\"]" }, "cookies": [], "headers": [ @@ -75,7 +79,7 @@ }, { "name": "date", - "value": "Fri, 14 Aug 2020 17:29:45 GMT" + "value": "Fri, 25 Sep 2020 18:16:29 GMT" }, { "name": "content-type", @@ -107,7 +111,7 @@ }, { "name": "etag", - "value": "W/\"e85-jED9/6YYFGyACPhZmEaIwSqxDds\"" + "value": "W/\"e84-Gkzjv5mxlcw0btuJhYzfeK72c44\"" }, { "name": "x-xss-protection", @@ -132,8 +136,8 @@ "status": 200, "statusText": "OK" }, - "startedDateTime": "2020-08-14T17:29:45.683Z", - "time": 306, + "startedDateTime": "2020-09-25T18:16:29.490Z", + "time": 274, "timings": { "blocked": -1, "connect": -1, @@ -141,7 +145,7 @@ "receive": 0, "send": 0, "ssl": -1, - "wait": 306 + "wait": 274 } } ], diff --git a/spec/recordings/Yandex-Geocoder-Provider_3381125107/receives-correct-geodecoding-results_1602611079/recording.har b/spec/recordings/Yandex-Geocoder-Provider_3381125107/receives-correct-geodecoding-results_1602611079/recording.har index bb41767..0b31798 100644 --- a/spec/recordings/Yandex-Geocoder-Provider_3381125107/receives-correct-geodecoding-results_1602611079/recording.har +++ b/spec/recordings/Yandex-Geocoder-Provider_3381125107/receives-correct-geodecoding-results_1602611079/recording.har @@ -8,7 +8,7 @@ }, "entries": [ { - "_id": "35af77943d19f4c062f0b16b5a319928", + "_id": "c47d435f272384213688cbf36c8295a1", "_order": 0, "cache": {}, "request": { @@ -40,7 +40,7 @@ "value": "geocode-maps.yandex.ru" } ], - "headersSize": 309, + "headersSize": 319, "httpVersion": "HTTP/1.1", "method": "GET", "queryString": [ @@ -55,17 +55,21 @@ { "name": "lang", "value": "en_US" + }, + { + "name": "results", + "value": "5" } ], - "url": "https://geocode-maps.yandex.ru/1.x?geocode=2.388911%2C48.8631507&format=json&lang=en_US" + "url": "https://geocode-maps.yandex.ru/1.x?geocode=2.388911%2C48.8631507&format=json&lang=en_US&results=5" }, "response": { - "bodySize": 2263, + "bodySize": 1834, "content": { "_isBinary": true, "mimeType": "application/json; charset=utf-8", - "size": 2263, - "text": "[\"1f8b0800000000000003ec97df6ed33014c65f25f27536397fda26bb2b1dec669432718710f292336a48ece03865d3d457e039788fbd18b6e3645e9b7542940a267a53c7fe1c7fe73bcaafe92d1250579cd5804e6ed119f037979f2193335e14ea8b72a6a74b90e49448b210bc02216fac34e339880bbbfdb5d5e8b505a74cea41c56b7482c2e32849d220f0e2e4381947c128406b5f9dfbb5815a3aeb7eb78e2748afd74d21f5fe00abcb2bdeb05c5da468ad365f01918d5087969720d0c97bc7fa53865da395808cd6a64a04d7446df691846b6dea95202c03dfbbfb5ec0510e47ddf582085afb5e88c19b0ac1594eeb1a4a60d2f7a62b600d786744999292f89e31fe851adf4bdea88c7d34cd735559ad4fcf544952dc7cd4b6f48917a64c51122921dfa785192f558f94a036515947f678b5ce4809fd79aa37bda4127c45f55caf79e8c5d5163c230595cefd8c4f57a28c4a414dca56b25d83ab576a0047bd519d2bede2b54a55f6fac3ba4ffb54f59c1626f499ad5a0dede23965f7d5ef256d73c25c3999399d75a6efb3d60e4bca742e44d2154c0590d6dae6ec7c307f1f9d77b1ab5ddd78eee6efa353a880e5cab1abdd9a9c3fda111fbd5b72c19b4fcb2b220c27dcebf9706f7cb41050d2962b76386fdac7d5b4a7fb3cd65d9b660e752668d5a268c05ddfa0cdbef5095d6a7240fec294fd92ada05050d0e3827f0331e382194f9a42f1248d5b4ae1280dd4dea6aa1e4ad208632b19253831301ac25d92a61dee74a9fe1e00d53f0d7b23d43d9dfa7b1f144fcf194d07a7cf7ff274d13f0196434345b1c0a2208c069012e331c691514c4693301c464a8c7198b4b719a7a3645f4ce172a96cfc0e52de3644480ac2cb1b6f71f743c0d139c996849a5fe3ed87ebcff265a7997f1535dbfa1d651e803b4f84fcec10f44b77d8d59a4d2eed0cf2a0880a2749fbef6c348ec361464571fbda33c149307ee4b5270d8360d4422ac649fc3740ea27000000ffff\",\"ec984112c2200c00bfe20b3a24840077cf5e7c818edebdf828dfe1c76c2bdad2824e2dc5daf10cc324e96e0875df306f23fab9663375d3586263e8da1cccdab7389db19a0ddf8d2566a290b2c052bab1c21044c70a4466379e18b499955d5f2fa7b207d6d55a1d8e0f80fc323e171a8f771510491c1e1c4116b15d7e6e5f30c6f8f658eca92cffa06439d5df9ef7e123820b9b9725eebc23a219fa9a470a345e7b4442ac6505459643d6b32defde6a8b1508022217350aa1ee0729a3ad9e83f5d9e49e95c3532ab920f362f9f9defd056bcf618d50ad3131815459258a4eb889c4f98e286fa7d30efeb3c75d8152ec1e90cc322bee0de72db046733e2de049e8cd8cad8f642f149fcda12c4241c420eb9f078002751f4659a8b297568f155b2001910ec3a8d06a5353cd46981b000000ffffb4d84b0ac0300804d0abe4029518ff87cbdd2b74114ab2b1d0fdac9c87a02abf625cf8968bb2bdbab54f7e8a5e5e7557fbbc249702c5c8031461a8b1efafef00eb6e484d32c29e67eaa9508460228bc60a16fd49e500e6bc010000ffff0300ac42889cbb200000\"]" + "size": 1834, + "text": "[\"1f8b0800000000000003ec97df6ed33014c65f25f27536e56f9becae74b09b51cac41d42c84bcea821b183e3944d535f81e7e03df6621c3b7fe6b55d2744a960a23775eccff677bea3fcd6dd12097525780de4e4969c817873f91932351545815f4c703d5d82a2a754d1b914154875d349339183bce8b6bfee347a6d2e18577a50899a9c90e0384c92d4f79d28394e46a11ffb64e5e2bd5f1ba895b5eef6ebde98e8f5ba2994de1fe3d39568788ee394ac70ef1550d548bcb3bc04494ede5bce9ff26bfbac2464ac364512b8a6b8d9250aaeb5a75792f20c5ce7ee7b0147391cf5cf732a59ed3a8107ce444ac17356d7500257ae3359026fc039a3684a29ea3abe87e77d61c6f7423418b14b26798e85d5faf60c4b52f2e6a3b6a56fbc3065ca922a05f93e2d4c45892d42416da2ea1c75d7e33aa7250cf7616b064925c592e9b941f3d08bad2d44460ba6acf38c4f5b8246956426e54eb25983ad473580a55eabce96f6f1764a2c7bf56135a47d8a3d6785097dda558dc36ef19cf1fbeaf792b6b961864ea65667ade9fbacb5c392719d0b556c091309b4b5b63e3bdb9abf4bcefbd871573f9ed9f9bbe4142ae0393ab6b51b93b3473be292770b2145f3697145a5c184fd3cdbde1b97cc2594acc54a379c35edeb6adad37f1eeb6e97660e752659d592688bbba141eb7d1b12bad4e480fc8529fb255f428150d0e3427c033915921b4f1a42d1388d5a487961eae3dea6aa1e4ad2d0f33a499c788981d136da2569dad34e97eaee0150c3dbb03742ddd36938fba0787ace683a387dfe93a78ffe09b01c1a2ac8820e0541b805299137f2bcd028c6f13808b62325f2bc20698f19a571b22fa608b5401bbf8394b70d958a8174f2c699dffd9070744eb30565e6aff1e6cbf567f9b2d3ccbf8a9a4dfd8e320fc09d27427e7608faa51376b5669d4b3b833c28a28271d2fe73168fa2603ba3c2a8fdd933f6127ff4c8cf9e34f0fdb88554e425d15f01a99f000000ffff\",\"dc96311202210c45afb24720d910a0b7b6b1b6d0597b1b0fe539bc98b0c40227b19165460b2a98c04f783fa9351c6b443f67365b9bc63f1ac33bcdaaea96e27ec4068e5c892566220d59e07996b1221298630522b38c2711d36064778ffb357be09aad69b94cafdac8e73d95ba7741d5ba6808a62243cee94fe985a02d74247e87db590fa16eec3f26a6a5ccd2d782f63d618884b872019e126b8071ca6dae1c490ec181d113d1395f03f91852287a8e793d010000ffff\",\"0300377eef3b77150000\"]" }, "cookies": [], "headers": [ @@ -75,7 +79,7 @@ }, { "name": "date", - "value": "Fri, 14 Aug 2020 17:36:59 GMT" + "value": "Fri, 25 Sep 2020 18:16:29 GMT" }, { "name": "content-type", @@ -107,7 +111,7 @@ }, { "name": "etag", - "value": "W/\"20bb-MO3+B80DGyD1s+UZB68tAeaEiSk\"" + "value": "W/\"1577-SWIN9f7y+Rbp/Lt3aKBPRwRs6GI\"" }, { "name": "x-xss-protection", @@ -123,7 +127,7 @@ }, { "name": "x-qloud-router", - "value": "man1-043f58f4a44d.qloud-c.yandex.net" + "value": "man4-a74d0ae6f388.qloud-c.yandex.net" } ], "headersSize": 459, @@ -132,8 +136,8 @@ "status": 200, "statusText": "OK" }, - "startedDateTime": "2020-08-14T17:36:59.280Z", - "time": 283, + "startedDateTime": "2020-09-25T18:16:29.142Z", + "time": 323, "timings": { "blocked": -1, "connect": -1, @@ -141,7 +145,7 @@ "receive": 0, "send": 0, "ssl": -1, - "wait": 283 + "wait": 323 } } ], diff --git a/spec/recordings/Yandex-Geocoder-Provider_3381125107/receives-error-when-the-API-key-is-bad_860720186/recording.har b/spec/recordings/Yandex-Geocoder-Provider_3381125107/receives-error-when-the-API-key-is-bad_860720186/recording.har index 522c3e3..3ea9f90 100644 --- a/spec/recordings/Yandex-Geocoder-Provider_3381125107/receives-error-when-the-API-key-is-bad_860720186/recording.har +++ b/spec/recordings/Yandex-Geocoder-Provider_3381125107/receives-error-when-the-API-key-is-bad_860720186/recording.har @@ -8,7 +8,7 @@ }, "entries": [ { - "_id": "44cb5465efd97e699724d4a04ef7b766", + "_id": "dd683a194fccad3abe8af22c9534149d", "_order": 0, "cache": {}, "request": { @@ -40,7 +40,7 @@ "value": "geocode-maps.yandex.ru" } ], - "headersSize": 297, + "headersSize": 307, "httpVersion": "HTTP/1.1", "method": "GET", "queryString": [ @@ -51,9 +51,13 @@ { "name": "format", "value": "json" + }, + { + "name": "results", + "value": "5" } ], - "url": "https://geocode-maps.yandex.ru/1.x?geocode=1600+Pennsylvania+Ave%2C+Washington%2C+DC&format=json" + "url": "https://geocode-maps.yandex.ru/1.x?geocode=1600+Pennsylvania+Ave%2C+Washington%2C+DC&format=json&results=5" }, "response": { "bodySize": 62, @@ -70,7 +74,7 @@ }, { "name": "date", - "value": "Fri, 14 Aug 2020 17:39:04 GMT" + "value": "Fri, 25 Sep 2020 18:16:29 GMT" }, { "name": "content-type", @@ -102,7 +106,7 @@ }, { "name": "x-qloud-router", - "value": "man1-043f58f4a44d.qloud-c.yandex.net" + "value": "man2-7275f28abf80.qloud-c.yandex.net" } ], "headersSize": 336, @@ -111,8 +115,8 @@ "status": 403, "statusText": "Forbidden" }, - "startedDateTime": "2020-08-14T17:39:04.688Z", - "time": 228, + "startedDateTime": "2020-09-25T18:16:28.849Z", + "time": 279, "timings": { "blocked": -1, "connect": -1, @@ -120,7 +124,7 @@ "receive": 0, "send": 0, "ssl": -1, - "wait": 228 + "wait": 279 } } ], diff --git a/src/GeoJsonDumper.ts b/src/GeoJsonDumper.ts index 2a130aa..b7401af 100644 --- a/src/GeoJsonDumper.ts +++ b/src/GeoJsonDumper.ts @@ -1,5 +1,6 @@ import Geocoded from "Geocoded"; import AdminLevel, { AdminLevelObject } from "AdminLevel"; +import { BoundingBox } from "types"; export interface GeoJson { readonly type: "Feature"; @@ -9,6 +10,7 @@ export interface GeoJson { | string[] | number | boolean + | BoundingBox | AdminLevel[] | AdminLevelObject[] | undefined; @@ -17,12 +19,7 @@ export interface GeoJson { readonly type: "Point"; readonly coordinates: [number | undefined, number | undefined]; }; - readonly bounds?: { - readonly south: number; - readonly west: number; - readonly north: number; - readonly east: number; - }; + readonly bounds?: BoundingBox; } export default class GeoJsonDumper { @@ -49,10 +46,7 @@ export default class GeoJsonDumper { const { latitude, longitude, - south, - west, - north, - east, + bounds, adminLevels, ...geocodedProperties } = geocoded.toObject(); @@ -63,6 +57,7 @@ export default class GeoJsonDumper { | string[] | number | boolean + | BoundingBox | AdminLevel[] | AdminLevelObject[] | undefined; @@ -80,8 +75,8 @@ export default class GeoJsonDumper { } result = { ...result, properties }; - if (south && west && north && east) { - result = { ...result, bounds: { south, west, north, east } }; + if (bounds) { + result = { ...result, bounds }; } return result; diff --git a/src/Geocoded.ts b/src/Geocoded.ts index 1da5d29..5afecc7 100644 --- a/src/Geocoded.ts +++ b/src/Geocoded.ts @@ -1,4 +1,5 @@ import AdminLevel from "AdminLevel"; +import { BoundingBox } from "types"; export interface GeocodedObject { readonly [property: string]: @@ -6,14 +7,12 @@ export interface GeocodedObject { | string[] | number | boolean + | BoundingBox | AdminLevel[] | undefined; readonly latitude?: number; readonly longitude?: number; - readonly south?: number; - readonly west?: number; - readonly north?: number; - readonly east?: number; + readonly bounds?: BoundingBox; readonly formattedAddress?: string; readonly streetNumber?: string; readonly streetName?: string; @@ -32,13 +31,7 @@ export default class Geocoded { private readonly longitude?: number; - private readonly south?: number; - - private readonly west?: number; - - private readonly north?: number; - - private readonly east?: number; + private readonly bounds?: BoundingBox; private readonly formattedAddress?: string; @@ -65,10 +58,7 @@ export default class Geocoded { protected constructor({ latitude, longitude, - south, - west, - north, - east, + bounds, formattedAddress, streetNumber, streetName, @@ -83,10 +73,7 @@ export default class Geocoded { }: GeocodedObject) { this.latitude = latitude; this.longitude = longitude; - this.south = south; - this.west = west; - this.north = north; - this.east = east; + this.bounds = bounds; this.formattedAddress = formattedAddress; this.streetNumber = streetNumber; this.streetName = streetName; @@ -108,10 +95,7 @@ export default class Geocoded { return { latitude: this.latitude, longitude: this.longitude, - south: this.south, - west: this.west, - north: this.north, - east: this.east, + bounds: this.bounds, formattedAddress: this.formattedAddress, streetNumber: this.streetNumber, streetName: this.streetName, @@ -126,18 +110,10 @@ export default class Geocoded { }; } - public withBounds( - south?: number, - west?: number, - north?: number, - east?: number - ): Geocoded { + public withBounds(bounds: BoundingBox): Geocoded { return (this.constructor).create({ ...this.toObject(), - south, - west, - north, - east, + bounds, }); } @@ -161,13 +137,8 @@ export default class Geocoded { return this.longitude; } - public getBounds(): [ - undefined | number, - undefined | number, - undefined | number, - undefined | number - ] { - return [this.south, this.west, this.north, this.east]; + public getBounds(): undefined | BoundingBox { + return this.bounds; } public getFormattedAddress(): undefined | string { diff --git a/src/GeocoderProviderFactory.ts b/src/GeocoderProviderFactory.ts index f5804b4..1986bfc 100644 --- a/src/GeocoderProviderFactory.ts +++ b/src/GeocoderProviderFactory.ts @@ -21,6 +21,7 @@ import { defaultMapQuestProviderOptions, defaultNominatimProviderOptions, defaultOpenCageProviderOptions, + defaultYandexProviderOptions, defaultProviderOptions, } from "provider"; import ExternalLoader from "ExternalLoader"; @@ -205,7 +206,10 @@ export default class ProviderFactory { ); case "yandex": return >( - new YandexProvider(externalLoader, providerOptions) + new YandexProvider(externalLoader, { + ...defaultYandexProviderOptions, + ...providerOptions, + }) ); default: } diff --git a/src/index.ts b/src/index.ts index adf4d79..291d6d3 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,15 +1,3 @@ -export interface Bounds { - readonly south: number | string; - readonly west: number | string; - readonly north: number | string; - readonly east: number | string; -} - -export interface Coordinates { - readonly latitude: number | string; - readonly longitude: number | string; -} - export * from "provider"; export * from "query"; export * from "utils"; diff --git a/src/provider/BingProvider.ts b/src/provider/BingProvider.ts index c1bfb33..c3f9773 100644 --- a/src/provider/BingProvider.ts +++ b/src/provider/BingProvider.ts @@ -179,12 +179,12 @@ export default class BingProvider implements ProviderInterface { region, country, }); - geocoded = geocoded.withBounds( - result.bbox[0], - result.bbox[1], - result.bbox[2], - result.bbox[3] - ); + geocoded = geocoded.withBounds({ + latitude1: result.bbox[0], + longitude1: result.bbox[1], + latitude2: result.bbox[2], + longitude2: result.bbox[3], + }); return geocoded; } diff --git a/src/provider/googlemaps/GoogleMapsProvider.ts b/src/provider/googlemaps/GoogleMapsProvider.ts index 064d881..d3279d9 100644 --- a/src/provider/googlemaps/GoogleMapsProvider.ts +++ b/src/provider/googlemaps/GoogleMapsProvider.ts @@ -233,10 +233,10 @@ export default class GoogleMapsProvider { address: geocodeQuery.getText(), bounds: geocodeQuery.getBounds() - ? `${geocodeQuery.getBounds()?.south},${ - geocodeQuery.getBounds()?.west - }|${geocodeQuery.getBounds()?.north},${ - geocodeQuery.getBounds()?.east + ? `${geocodeQuery.getBounds()?.latitude1},${ + geocodeQuery.getBounds()?.longitude1 + }|${geocodeQuery.getBounds()?.latitude2},${ + geocodeQuery.getBounds()?.longitude2 }` : undefined, components: (geocodeQuery).getComponents() @@ -587,29 +587,28 @@ export default class GoogleMapsProvider if (result.geometry.bounds) { const { bounds } = result.geometry; - geocoded = ( - geocoded.withBounds( - bounds.southwest.lat, - bounds.southwest.lng, - bounds.northeast.lat, - bounds.northeast.lng - ) - ); + geocoded = geocoded.withBounds({ + latitude1: bounds.southwest.lat, + longitude1: bounds.southwest.lng, + latitude2: bounds.northeast.lat, + longitude2: bounds.northeast.lng, + }); } else if (result.geometry.viewport) { const { viewport } = result.geometry; - geocoded = ( - geocoded.withBounds( - viewport.southwest.lat, - viewport.southwest.lng, - viewport.northeast.lat, - viewport.northeast.lng - ) - ); + geocoded = geocoded.withBounds({ + latitude1: viewport.southwest.lat, + longitude1: viewport.southwest.lng, + latitude2: viewport.northeast.lat, + longitude2: viewport.northeast.lng, + }); } else if (result.geometry.location_type === "ROOFTOP") { // Fake bounds - geocoded = ( - geocoded.withBounds(latitude, longitude, latitude, longitude) - ); + geocoded = geocoded.withBounds({ + latitude1: latitude, + longitude1: longitude, + latitude2: latitude, + longitude2: longitude, + }); } return geocoded; diff --git a/src/provider/index.ts b/src/provider/index.ts index c3da807..39d0b8b 100644 --- a/src/provider/index.ts +++ b/src/provider/index.ts @@ -11,5 +11,4 @@ export * from "provider/mapbox"; export * from "provider/mapquest"; export * from "provider/nominatim"; export * from "provider/opencage"; -export { default as YandexProvider } from "provider/YandexProvider"; -export * from "provider/YandexProvider"; +export * from "provider/yandex"; diff --git a/src/provider/mapbox/MapboxGeocodeQuery.ts b/src/provider/mapbox/MapboxGeocodeQuery.ts index f9cedf6..f71e209 100644 --- a/src/provider/mapbox/MapboxGeocodeQuery.ts +++ b/src/provider/mapbox/MapboxGeocodeQuery.ts @@ -1,4 +1,5 @@ import { GeocodeQuery, GeocodeQueryObject } from "query"; +import { Coordinates } from "types"; export interface MapboxGeocodeQueryObject extends GeocodeQueryObject { readonly countryCodes?: string[]; @@ -21,6 +22,11 @@ export default class MapboxGeocodeQuery extends GeocodeQuery { }: MapboxGeocodeQueryObject) { super(geocodeQueryObject); this.countryCodes = countryCodes; + if (proximity && (!proximity.latitude || !proximity.longitude)) { + throw new Error( + 'The "proximity" parameter must be an object with the keys: "latitude", "longitude".' + ); + } this.proximity = proximity; this.locationTypes = locationTypes; } diff --git a/src/provider/mapbox/MapboxProvider.ts b/src/provider/mapbox/MapboxProvider.ts index 69b4912..28f6b51 100644 --- a/src/provider/mapbox/MapboxProvider.ts +++ b/src/provider/mapbox/MapboxProvider.ts @@ -166,10 +166,10 @@ export default class MapboxProvider const params: MapboxRequestParams = this.withCommonParams( { bbox: geocodeQuery.getBounds() - ? `${geocodeQuery.getBounds()?.west},${ - geocodeQuery.getBounds()?.south - },${geocodeQuery.getBounds()?.east},${ - geocodeQuery.getBounds()?.north + ? `${geocodeQuery.getBounds()?.longitude1},${ + geocodeQuery.getBounds()?.latitude1 + },${geocodeQuery.getBounds()?.longitude2},${ + geocodeQuery.getBounds()?.latitude2 }` : undefined, proximity: (geocodeQuery).getProximity() @@ -345,14 +345,12 @@ export default class MapboxProvider resultType, }); if (result.bbox) { - geocoded = ( - geocoded.withBounds( - result.bbox[1], - result.bbox[0], - result.bbox[3], - result.bbox[2] - ) - ); + geocoded = geocoded.withBounds({ + latitude1: result.bbox[1], + longitude1: result.bbox[0], + latitude2: result.bbox[3], + longitude2: result.bbox[2], + }); } return geocoded; diff --git a/src/provider/mapquest/MapQuestProvider.ts b/src/provider/mapquest/MapQuestProvider.ts index 238b4c1..71ed704 100644 --- a/src/provider/mapquest/MapQuestProvider.ts +++ b/src/provider/mapquest/MapQuestProvider.ts @@ -158,10 +158,10 @@ export default class MapQuestProvider maxResults?: string; } = { boundingBox: geocodeQuery.getBounds() - ? `${geocodeQuery.getBounds()?.north},${ - geocodeQuery.getBounds()?.west - },${geocodeQuery.getBounds()?.south},${ - geocodeQuery.getBounds()?.east + ? `${geocodeQuery.getBounds()?.latitude1},${ + geocodeQuery.getBounds()?.longitude1 + },${geocodeQuery.getBounds()?.latitude2},${ + geocodeQuery.getBounds()?.longitude2 }` : undefined, maxResults: geocodeQuery.getLimit().toString(), @@ -193,12 +193,12 @@ export default class MapQuestProvider boundingBox: geocodeQuery.getBounds() ? { ul: { - lat: geocodeQuery.getBounds()?.north, - lng: geocodeQuery.getBounds()?.west, + lat: geocodeQuery.getBounds()?.latitude1, + lng: geocodeQuery.getBounds()?.longitude1, }, lr: { - lat: geocodeQuery.getBounds()?.south, - lng: geocodeQuery.getBounds()?.east, + lat: geocodeQuery.getBounds()?.latitude2, + lng: geocodeQuery.getBounds()?.longitude2, }, } : undefined, diff --git a/src/provider/nominatim/NominatimGeocodeQuery.ts b/src/provider/nominatim/NominatimGeocodeQuery.ts index 129ab1a..73f71cd 100644 --- a/src/provider/nominatim/NominatimGeocodeQuery.ts +++ b/src/provider/nominatim/NominatimGeocodeQuery.ts @@ -1,10 +1,8 @@ import { GeocodeQuery, GeocodeQueryObject } from "query"; -import { Box } from "types"; export interface NominatimGeocodeQueryObject extends GeocodeQueryObject { readonly countryCodes?: string[]; readonly excludePlaceIds?: number[]; - readonly viewBox?: Box; readonly bounded?: boolean; } @@ -13,27 +11,21 @@ export default class NominatimGeocodeQuery extends GeocodeQuery { private readonly excludePlaceIds?: number[]; - private readonly viewBox?: Box; - private readonly bounded?: boolean; protected constructor({ countryCodes, excludePlaceIds, - viewBox, bounded, + bounds, ...geocodeQueryObject }: NominatimGeocodeQueryObject) { - super(geocodeQueryObject); + super({ bounds, ...geocodeQueryObject }); this.countryCodes = countryCodes; this.excludePlaceIds = excludePlaceIds; - if (viewBox && viewBox.length !== 4) { - throw new Error('The "viewBox" parameter must be 4 numbers.'); - } - this.viewBox = viewBox; - if (bounded && !viewBox) { + if (bounded && !bounds) { throw new Error( - 'The "bounded" parameter can only be used with the "viewBox" parameter.' + 'The "bounded" parameter can only be used with the "bounds" parameter.' ); } this.bounded = bounded; @@ -50,7 +42,6 @@ export default class NominatimGeocodeQuery extends GeocodeQuery { ...super.toObject(), countryCodes: this.countryCodes, excludePlaceIds: this.excludePlaceIds, - viewBox: this.viewBox, bounded: this.bounded, }; } @@ -71,14 +62,6 @@ export default class NominatimGeocodeQuery extends GeocodeQuery { return this.excludePlaceIds; } - public withViewBox(viewBox: Box): NominatimGeocodeQuery { - return new NominatimGeocodeQuery({ ...this.toObject(), viewBox }); - } - - public getViewBox(): undefined | Box { - return this.viewBox; - } - public withBounded(bounded: boolean): NominatimGeocodeQuery { return new NominatimGeocodeQuery({ ...this.toObject(), bounded }); } diff --git a/src/provider/nominatim/NominatimProvider.ts b/src/provider/nominatim/NominatimProvider.ts index 4a2b52e..ed3a7c7 100644 --- a/src/provider/nominatim/NominatimProvider.ts +++ b/src/provider/nominatim/NominatimProvider.ts @@ -161,8 +161,12 @@ export default class NominatimProvider .getExcludePlaceIds() ?.join(",") : undefined, - viewbox: (geocodeQuery).getViewBox() - ? (geocodeQuery).getViewBox()?.join(",") + viewbox: geocodeQuery.getBounds() + ? `${geocodeQuery.getBounds()?.longitude1},${ + geocodeQuery.getBounds()?.latitude1 + },${geocodeQuery.getBounds()?.longitude2},${ + geocodeQuery.getBounds()?.latitude2 + }` : undefined, bounded: (geocodeQuery).getBounded() ? (geocodeQuery).getBounded()?.toString() @@ -334,14 +338,12 @@ export default class NominatimProvider attribution, }); - geocoded = ( - geocoded.withBounds( - parseFloat(result.boundingbox[0]), - parseFloat(result.boundingbox[2]), - parseFloat(result.boundingbox[1]), - parseFloat(result.boundingbox[3]) - ) - ); + geocoded = geocoded.withBounds({ + latitude1: parseFloat(result.boundingbox[0]), + longitude1: parseFloat(result.boundingbox[2]), + latitude2: parseFloat(result.boundingbox[1]), + longitude2: parseFloat(result.boundingbox[3]), + }); const adminLevels: ("state" | "county")[] = ["state", "county"]; adminLevels.forEach((adminLevel, level) => { diff --git a/src/provider/opencage/OpenCageGeocodeQuery.ts b/src/provider/opencage/OpenCageGeocodeQuery.ts index ca64409..647f5ab 100644 --- a/src/provider/opencage/OpenCageGeocodeQuery.ts +++ b/src/provider/opencage/OpenCageGeocodeQuery.ts @@ -1,5 +1,5 @@ import { GeocodeQuery, GeocodeQueryObject } from "query"; -import { Coordinates } from "index"; +import { Coordinates } from "types"; export interface OpenCageGeocodeQueryObject extends GeocodeQueryObject { readonly countryCodes?: string[]; @@ -26,6 +26,11 @@ export default class OpenCageGeocodeQuery extends GeocodeQuery { }: OpenCageGeocodeQueryObject) { super(geocodeQueryObject); this.countryCodes = countryCodes; + if (proximity && (!proximity.latitude || !proximity.longitude)) { + throw new Error( + 'The "proximity" parameter must be an object with the keys: "latitude", "longitude".' + ); + } this.proximity = proximity; if ( minConfidence && diff --git a/src/provider/opencage/OpenCageProvider.ts b/src/provider/opencage/OpenCageProvider.ts index 2e356cf..f207d05 100644 --- a/src/provider/opencage/OpenCageProvider.ts +++ b/src/provider/opencage/OpenCageProvider.ts @@ -327,10 +327,10 @@ export default class OpenCageProvider { q: geocodeQuery.getText() || "", bounds: geocodeQuery.getBounds() - ? `${geocodeQuery.getBounds()?.west},${ - geocodeQuery.getBounds()?.south - },${geocodeQuery.getBounds()?.east},${ - geocodeQuery.getBounds()?.north + ? `${geocodeQuery.getBounds()?.longitude1},${ + geocodeQuery.getBounds()?.latitude1 + },${geocodeQuery.getBounds()?.longitude2},${ + geocodeQuery.getBounds()?.latitude2 }` : undefined, proximity: (geocodeQuery).getProximity() @@ -544,14 +544,12 @@ export default class OpenCageProvider }); if (result.bounds) { - geocoded = ( - geocoded.withBounds( - result.bounds.southwest.lat, - result.bounds.southwest.lng, - result.bounds.northeast.lat, - result.bounds.northeast.lng - ) - ); + geocoded = geocoded.withBounds({ + latitude1: result.bounds.southwest.lat, + longitude1: result.bounds.southwest.lng, + latitude2: result.bounds.northeast.lat, + longitude2: result.bounds.northeast.lng, + }); } const adminLevels: { diff --git a/src/provider/yandex/YandexGeocodeQuery.ts b/src/provider/yandex/YandexGeocodeQuery.ts new file mode 100644 index 0000000..d2cb988 --- /dev/null +++ b/src/provider/yandex/YandexGeocodeQuery.ts @@ -0,0 +1,110 @@ +import { GeocodeQuery, GeocodeQueryObject } from "query"; +import { Coordinates } from "types"; + +interface YandexSpan { + spanLatitude: string; + spanLongitude: string; +} + +export interface YandexGeocodeQueryObject extends GeocodeQueryObject { + readonly bounded?: boolean; + readonly proximity?: Coordinates; + readonly span?: YandexSpan; + readonly skip?: number; +} + +export default class YandexGeocodeQuery extends GeocodeQuery { + private readonly bounded?: boolean; + + private readonly proximity?: Coordinates; + + private readonly span?: YandexSpan; + + private readonly skip?: number; + + protected constructor({ + bounded, + proximity, + span, + skip, + bounds, + ...geocodeQueryObject + }: YandexGeocodeQueryObject) { + super({ bounds, ...geocodeQueryObject }); + if (bounded && (!bounds || !proximity)) { + throw new Error( + 'The "bounded" parameter can only be used with the "bounds" or "proximity" parameter.' + ); + } + this.bounded = bounded; + if (proximity && (!proximity.latitude || !proximity.longitude)) { + throw new Error( + 'The "proximity" parameter must be an object with the keys: "latitude", "longitude".' + ); + } + this.proximity = proximity; + if (span && !proximity) { + throw new Error( + 'The "proximity" parameter must be defined to use the "span" parameter.' + ); + } + if (span && (!span.spanLatitude || !span.spanLongitude)) { + throw new Error( + 'The "span" parameter must be an object with the keys: "spanLatitude", "spanLongitude".' + ); + } + this.span = span; + if (bounds && proximity) { + throw new Error( + 'The "bounds" and "proximity" parameters cannot be used at the same time.' + ); + } + this.skip = skip; + } + + public static create(object: YandexGeocodeQueryObject): YandexGeocodeQuery { + return new this(object); + } + + public toObject(): YandexGeocodeQueryObject { + return { + ...super.toObject(), + bounded: this.bounded, + proximity: this.proximity, + span: this.span, + skip: this.skip, + }; + } + + public withBounded(bounded: boolean): YandexGeocodeQuery { + return new YandexGeocodeQuery({ ...this.toObject(), bounded }); + } + + public getBounded(): undefined | boolean { + return this.bounded; + } + + public withProximity(proximity: Coordinates): YandexGeocodeQuery { + return new YandexGeocodeQuery({ ...this.toObject(), proximity }); + } + + public getProximity(): undefined | Coordinates { + return this.proximity; + } + + public withSpan(span: YandexSpan): YandexGeocodeQuery { + return new YandexGeocodeQuery({ ...this.toObject(), span }); + } + + public getSpan(): undefined | YandexSpan { + return this.span; + } + + public withSkip(skip: number): YandexGeocodeQuery { + return new YandexGeocodeQuery({ ...this.toObject(), skip }); + } + + public getSkip(): undefined | number { + return this.skip; + } +} diff --git a/src/provider/yandex/YandexGeocoded.ts b/src/provider/yandex/YandexGeocoded.ts new file mode 100644 index 0000000..883684a --- /dev/null +++ b/src/provider/yandex/YandexGeocoded.ts @@ -0,0 +1,57 @@ +import Geocoded, { GeocodedObject } from "Geocoded"; +import { YandexKind, YandexPrecision } from "provider"; + +export interface YandexGeocodedObject extends GeocodedObject { + readonly locationType?: YandexKind; + readonly precision?: YandexPrecision; +} + +export default class YandexGeocoded extends Geocoded { + private readonly locationType?: YandexKind; + + private readonly precision?: YandexPrecision; + + protected constructor({ + locationType, + precision, + ...geocodedObject + }: YandexGeocodedObject) { + super(geocodedObject); + this.locationType = locationType; + this.precision = precision; + } + + public static create(object: YandexGeocodedObject): YandexGeocoded { + return new this(object); + } + + public toObject(): YandexGeocodedObject { + return { + ...super.toObject(), + locationType: this.locationType, + precision: this.precision, + }; + } + + public withLocationType(locationType: YandexKind): YandexGeocoded { + return new YandexGeocoded({ + ...this.toObject(), + locationType, + }); + } + + public getLocationType(): undefined | YandexKind { + return this.locationType; + } + + public withPrecision(precision: YandexPrecision): YandexGeocoded { + return new YandexGeocoded({ + ...this.toObject(), + precision, + }); + } + + public getPrecision(): undefined | YandexPrecision { + return this.precision; + } +} diff --git a/src/provider/YandexProvider.ts b/src/provider/yandex/YandexProvider.ts similarity index 52% rename from src/provider/YandexProvider.ts rename to src/provider/yandex/YandexProvider.ts index 4a54cd3..358f25f 100644 --- a/src/provider/YandexProvider.ts +++ b/src/provider/yandex/YandexProvider.ts @@ -10,15 +10,41 @@ import { ProviderHelpers, ProviderInterface, ProviderOptionsInterface, + YandexGeocoded, + YandexGeocodeQuery, + YandexGeocodeQueryObject, + YandexReverseQuery, + YandexReverseQueryObject, defaultProviderOptions, } from "provider"; -import Geocoded from "Geocoded"; -import { - GeocodeQuery, - GeocodeQueryObject, - ReverseQuery, - ReverseQueryObject, -} from "query"; +import AdminLevel from "AdminLevel"; + +export type YandexKind = + | "house" + | "street" + | "metro" + | "district" + | "locality" + | "area" + | "province" + | "country" + | "region" + | "hydro" + | "railway_station" + | "station" + | "route" + | "vegetation" + | "airport" + | "entrance" + | "other"; + +export type YandexPrecision = + | "exact" + | "number" + | "near" + | "range" + | "street" + | "other"; interface YandexRequestParams { [param: string]: string | undefined; @@ -26,16 +52,22 @@ interface YandexRequestParams { readonly geocode: string; readonly format: string; readonly lang?: string; - readonly toponym?: "house" | "street" | "metro" | "district" | "locality"; + readonly kind?: YandexKind; + readonly rspn?: "0" | "1"; + readonly ll?: string; + readonly spn?: string; + readonly bbox?: string; + readonly skip?: string; + readonly results?: string; readonly jsonpCallback?: string; } export interface YandexResult { metaDataProperty: { GeocoderMetaData: { - kind: string; + kind: YandexKind; text: string; - precision: string; + precision: YandexPrecision; AddressDetails: { Country: { AddressLine: string; @@ -73,14 +105,32 @@ export interface YandexResult { }; } -interface YandexCollectionResult { - GeoObject: YandexResult; +export interface YandexResponse { + response: { + GeoObjectCollection: { + metaDataProperty: { + GeocoderResponseMetaData: { + request: string; + suggest?: { + fix: string; + }; + found: string; + results: string; + skip: string; + }; + }; + featureMember: { + GeoObject: YandexResult; + }[]; + }; + }; } interface YandexFlattenedAddressDetails { CountryNameCode?: string; CountryName?: string; AdministrativeAreaName?: string; + SubAdministrativeAreaName?: string; LocalityName?: string; DependentLocalityName?: string; ThoroughfareName?: string; @@ -89,30 +139,44 @@ interface YandexFlattenedAddressDetails { export interface YandexProviderOptionsInterface extends ProviderOptionsInterface { - readonly toponym?: "house" | "street" | "metro" | "district" | "locality"; + readonly apiKey: string; } -type YandexGeocodedResultsCallback = GeocodedResultsCallback; +export const defaultYandexProviderOptions = { + ...defaultProviderOptions, + apiKey: "", +}; + +type YandexGeocodedResultsCallback = GeocodedResultsCallback; -export default class YandexProvider implements ProviderInterface { +export default class YandexProvider + implements ProviderInterface { private externalLoader: ExternalLoaderInterface; private options: YandexProviderOptionsInterface; public constructor( _externalLoader: ExternalLoaderInterface, - options: YandexProviderOptionsInterface = defaultProviderOptions + options: YandexProviderOptionsInterface = defaultYandexProviderOptions ) { this.externalLoader = _externalLoader; - this.options = { ...defaultProviderOptions, ...options }; + this.options = { ...defaultYandexProviderOptions, ...options }; + if (!this.options.apiKey) { + throw new Error( + 'An API key is required for the Yandex provider. Please add it in the "apiKey" option.' + ); + } } public geocode( - query: string | GeocodeQuery | GeocodeQueryObject, + query: string | YandexGeocodeQuery | YandexGeocodeQueryObject, callback: YandexGeocodedResultsCallback, errorCallback?: ErrorCallback ): void { - const geocodeQuery = ProviderHelpers.getGeocodeQueryFromParameter(query); + const geocodeQuery = ProviderHelpers.getGeocodeQueryFromParameter( + query, + YandexGeocodeQuery + ); if (geocodeQuery.getIp()) { throw new Error( @@ -126,26 +190,55 @@ export default class YandexProvider implements ProviderInterface { pathname: "1.x", }); - const params: YandexRequestParams = { - apikey: this.options.apiKey, - geocode: geocodeQuery.getText() || "", - format: "json", - lang: geocodeQuery.getLocale(), - jsonpCallback: this.options.useJsonp ? "callback" : undefined, - }; + let rspn: "0" | "1" | undefined; + if ((geocodeQuery).getBounded() === false) { + rspn = "0"; + } else if ((geocodeQuery).getBounded() === true) { + rspn = "1"; + } + + const params: YandexRequestParams = this.withCommonParams( + { + geocode: geocodeQuery.getText() || "", + rspn, + ll: (geocodeQuery).getProximity() + ? `${(geocodeQuery).getProximity()?.longitude},${ + (geocodeQuery).getProximity()?.latitude + }` + : undefined, + spn: (geocodeQuery).getSpan() + ? `${(geocodeQuery).getSpan()?.spanLongitude},${ + (geocodeQuery).getSpan()?.spanLatitude + }` + : undefined, + bbox: geocodeQuery.getBounds() + ? `${geocodeQuery.getBounds()?.longitude1},${ + geocodeQuery.getBounds()?.latitude1 + }~${geocodeQuery.getBounds()?.longitude2},${ + geocodeQuery.getBounds()?.latitude2 + }` + : undefined, + }, + geocodeQuery + ); this.executeRequest(params, callback, {}, {}, errorCallback); } public geodecode( - latitudeOrQuery: number | string | ReverseQuery | ReverseQueryObject, + latitudeOrQuery: + | number + | string + | YandexReverseQuery + | YandexReverseQueryObject, longitudeOrCallback: number | string | YandexGeocodedResultsCallback, callbackOrErrorCallback?: YandexGeocodedResultsCallback | ErrorCallback, errorCallback?: ErrorCallback ): void { const reverseQuery = ProviderHelpers.getReverseQueryFromParameters( latitudeOrQuery, - longitudeOrCallback + longitudeOrCallback, + YandexReverseQuery ); const reverseCallback = ProviderHelpers.getCallbackFromParameters( longitudeOrCallback, @@ -163,18 +256,37 @@ export default class YandexProvider implements ProviderInterface { pathname: "1.x", }); - const params: YandexRequestParams = { + const params: YandexRequestParams = this.withCommonParams( + { + geocode: `${reverseQuery.getCoordinates().longitude},${ + reverseQuery.getCoordinates().latitude + }`, + kind: (reverseQuery).getLocationTypes() + ? (reverseQuery).getLocationTypes()?.[0] + : undefined, + }, + reverseQuery + ); + + this.executeRequest(params, reverseCallback, {}, {}, reverseErrorCallback); + } + + private withCommonParams( + params: Pick< + YandexRequestParams, + "geocode" | "rspn" | "ll" | "spn" | "bbox" | "kind" + >, + query: YandexGeocodeQuery | YandexReverseQuery + ): YandexRequestParams { + return { + ...params, apikey: this.options.apiKey, - geocode: `${reverseQuery.getCoordinates().longitude},${ - reverseQuery.getCoordinates().latitude - }`, format: "json", - lang: reverseQuery.getLocale(), - toponym: this.options.toponym, + lang: query.getLocale(), + results: query.getLimit().toString(), + skip: query.getSkip()?.toString(), jsonpCallback: this.options.useJsonp ? "callback" : undefined, }; - - this.executeRequest(params, reverseCallback, {}, {}, reverseErrorCallback); } public executeRequest( @@ -186,11 +298,10 @@ export default class YandexProvider implements ProviderInterface { ): void { this.externalLoader.executeRequest( params, - (data) => { + (data: YandexResponse) => { callback( - data.response.GeoObjectCollection.featureMember.map( - (result: YandexCollectionResult) => - YandexProvider.mapToGeocoded(result.GeoObject) + data.response.GeoObjectCollection.featureMember.map((result) => + YandexProvider.mapToGeocoded(result.GeoObject) ) ); }, @@ -200,7 +311,7 @@ export default class YandexProvider implements ProviderInterface { ); } - public static mapToGeocoded(result: YandexResult): Geocoded { + public static mapToGeocoded(result: YandexResult): YandexGeocoded { const point = result.Point.pos.split(" "); const latitude = parseFloat(point[1]); const longitude = parseFloat(point[0]); @@ -216,8 +327,10 @@ export default class YandexProvider implements ProviderInterface { const region = addressDetails.AdministrativeAreaName; const country = addressDetails.CountryName; const countryCode = addressDetails.CountryNameCode; + const locationType = result.metaDataProperty.GeocoderMetaData.kind; + const { precision } = result.metaDataProperty.GeocoderMetaData; - let geocoded = Geocoded.create({ + let geocoded = YandexGeocoded.create({ latitude, longitude, streetNumber, @@ -227,16 +340,33 @@ export default class YandexProvider implements ProviderInterface { region, country, countryCode, + locationType, + precision, + }); + + const adminLevels: ( + | "AdministrativeAreaName" + | "SubAdministrativeAreaName" + )[] = ["AdministrativeAreaName", "SubAdministrativeAreaName"]; + adminLevels.forEach((adminLevel, level) => { + if (addressDetails[adminLevel]) { + geocoded.addAdminLevel( + AdminLevel.create({ + level: level + 1, + name: addressDetails[adminLevel] || "", + }) + ); + } }); const lowerCorner = result.boundedBy.Envelope.lowerCorner.split(" "); const upperCorner = result.boundedBy.Envelope.upperCorner.split(" "); - geocoded = geocoded.withBounds( - parseFloat(lowerCorner[1]), - parseFloat(lowerCorner[0]), - parseFloat(upperCorner[1]), - parseFloat(upperCorner[0]) - ); + geocoded = geocoded.withBounds({ + latitude1: parseFloat(lowerCorner[1]), + longitude1: parseFloat(lowerCorner[0]), + latitude2: parseFloat(upperCorner[1]), + longitude2: parseFloat(upperCorner[0]), + }); return geocoded; } diff --git a/src/provider/yandex/YandexReverseQuery.ts b/src/provider/yandex/YandexReverseQuery.ts new file mode 100644 index 0000000..d3f7214 --- /dev/null +++ b/src/provider/yandex/YandexReverseQuery.ts @@ -0,0 +1,56 @@ +import { ReverseQuery, ReverseQueryObject } from "query"; +import { YandexKind } from "provider"; + +export interface YandexReverseQueryObject extends ReverseQueryObject { + readonly locationTypes?: YandexKind[]; + readonly skip?: number; +} + +export default class YandexReverseQuery extends ReverseQuery { + private readonly locationTypes?: YandexKind[]; + + private readonly skip?: number; + + protected constructor({ + locationTypes, + skip, + ...reverseQueryObject + }: YandexReverseQueryObject) { + super(reverseQueryObject); + if (locationTypes && locationTypes.length > 1) { + throw new Error( + 'The "locationTypes" parameter must contain only one location type.' + ); + } + this.locationTypes = locationTypes; + this.skip = skip; + } + + public static create(object: YandexReverseQueryObject): YandexReverseQuery { + return new this(object); + } + + public toObject(): YandexReverseQueryObject { + return { + ...super.toObject(), + locationTypes: this.locationTypes, + skip: this.skip, + }; + } + + public withLocationTypes(locationTypes: YandexKind[]): YandexReverseQuery { + return new YandexReverseQuery({ ...this.toObject(), locationTypes }); + } + + public getLocationTypes(): undefined | YandexKind[] { + return this.locationTypes; + } + + public withSkip(skip: number): YandexReverseQuery { + return new YandexReverseQuery({ ...this.toObject(), skip }); + } + + public getSkip(): undefined | number { + return this.skip; + } +} diff --git a/src/provider/yandex/index.ts b/src/provider/yandex/index.ts new file mode 100644 index 0000000..8d69e89 --- /dev/null +++ b/src/provider/yandex/index.ts @@ -0,0 +1,7 @@ +export { default as YandexGeocoded } from "provider/yandex/YandexGeocoded"; +export { default as YandexGeocodeQuery } from "provider/yandex/YandexGeocodeQuery"; +export * from "provider/yandex/YandexGeocodeQuery"; +export { default as YandexProvider } from "provider/yandex/YandexProvider"; +export * from "provider/yandex/YandexProvider"; +export { default as YandexReverseQuery } from "provider/yandex/YandexReverseQuery"; +export * from "provider/yandex/YandexReverseQuery"; diff --git a/src/query/GeocodeQuery.ts b/src/query/GeocodeQuery.ts index 41e63e9..c070a47 100644 --- a/src/query/GeocodeQuery.ts +++ b/src/query/GeocodeQuery.ts @@ -1,13 +1,10 @@ import { DEFAULT_RESULT_LIMIT } from "provider"; -import { Bounds } from "index"; +import { BoundingBox } from "types"; export interface GeocodeQueryObject { readonly text?: string; readonly ip?: string; - readonly south?: number | string; - readonly west?: number | string; - readonly north?: number | string; - readonly east?: number | string; + readonly bounds?: BoundingBox; readonly locale?: string; readonly limit?: number; } @@ -17,13 +14,7 @@ export default class GeocodeQuery { private readonly ip?: string; - private readonly south?: number | string; - - private readonly west?: number | string; - - private readonly north?: number | string; - - private readonly east?: number | string; + private readonly bounds?: BoundingBox; private readonly locale?: string; @@ -32,10 +23,7 @@ export default class GeocodeQuery { protected constructor({ text, ip, - south, - west, - north, - east, + bounds, locale, limit = DEFAULT_RESULT_LIMIT, }: GeocodeQueryObject) { @@ -44,10 +32,18 @@ export default class GeocodeQuery { if (!text && !ip) { throw new Error('Either "text" or "ip" parameter is required.'); } - this.south = south; - this.west = west; - this.north = north; - this.east = east; + if ( + bounds && + (!bounds.latitude1 || + !bounds.longitude1 || + !bounds.latitude2 || + !bounds.longitude2) + ) { + throw new Error( + 'The "bounds" parameter must be an object with the keys: "latitude1", "longitude1", "latitude2", "longitude2".' + ); + } + this.bounds = bounds; this.locale = locale; this.limit = limit; } @@ -60,10 +56,7 @@ export default class GeocodeQuery { return { text: this.text, ip: this.ip, - south: this.south, - west: this.west, - north: this.north, - east: this.east, + bounds: this.bounds, locale: this.locale, limit: this.limit, }; @@ -83,18 +76,10 @@ export default class GeocodeQuery { }); } - public withBounds( - south?: number, - west?: number, - north?: number, - east?: number - ): GeocodeQuery { + public withBounds(bounds: BoundingBox): GeocodeQuery { return (this.constructor).create({ ...this.toObject(), - south, - west, - north, - east, + bounds, }); } @@ -120,17 +105,8 @@ export default class GeocodeQuery { return this.ip; } - public getBounds(): undefined | Bounds { - if (!this.south || !this.west || !this.north || !this.east) { - return undefined; - } - - return { - south: this.south, - west: this.west, - north: this.north, - east: this.east, - }; + public getBounds(): undefined | BoundingBox { + return this.bounds; } public getLocale(): undefined | string { diff --git a/src/query/ReverseQuery.ts b/src/query/ReverseQuery.ts index 78227f2..e4d1e73 100644 --- a/src/query/ReverseQuery.ts +++ b/src/query/ReverseQuery.ts @@ -1,5 +1,5 @@ import { DEFAULT_RESULT_LIMIT } from "provider"; -import { Coordinates } from "index"; +import { Coordinates } from "types"; export interface ReverseQueryObject { readonly latitude: number | string; diff --git a/src/types.ts b/src/types.ts index 22ec1f4..7067cb3 100644 --- a/src/types.ts +++ b/src/types.ts @@ -6,3 +6,17 @@ export type PartialSome< > = Q & R; export type Box = [number, number, number, number]; + +export type Coordinates = { + readonly latitude: number | string; + readonly longitude: number | string; +}; + +export type BoundingBox = { + // Often South-West (Lower-Left) but also North-West (Upper-Left) + readonly latitude1: number | string; + readonly longitude1: number | string; + // Often North-East (Upper-Right) but also South-East (Lower-Right) + readonly latitude2: number | string; + readonly longitude2: number | string; +}; From 59d7f2cbe5ee3b77fcb81c5df2f215c85aa6d86b Mon Sep 17 00:00:00 2001 From: Alan Poulain Date: Sat, 10 Oct 2020 17:21:05 +0200 Subject: [PATCH 48/56] chore: use npm for website dependencies --- .github/workflows/deploy-website.yml | 4 +--- .gitignore | 3 +++ website/.bowerrc | 3 --- website/bower.json | 22 ---------------------- website/copy-vendor.sh | 13 +++++++++++++ website/default.twig | 12 ++++++------ website/package.json | 23 +++++++++++++++++++++++ 7 files changed, 46 insertions(+), 34 deletions(-) delete mode 100644 website/.bowerrc delete mode 100644 website/bower.json create mode 100755 website/copy-vendor.sh create mode 100644 website/package.json diff --git a/.github/workflows/deploy-website.yml b/.github/workflows/deploy-website.yml index eef7bfe..4df8c3f 100644 --- a/.github/workflows/deploy-website.yml +++ b/.github/workflows/deploy-website.yml @@ -21,10 +21,8 @@ jobs: uses: actions/setup-node@v2-beta with: node-version: "14" - - name: Setup Bower - run: npm install -g bower - name: Setup Couscous - run: composer global require couscous/couscous + run: composer global require couscous/couscous:dev-master - name: Couscous run: couscous generate - name: Deploy diff --git a/.gitignore b/.gitignore index fcb5f84..f81248d 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,6 @@ node_modules /dist /types /website/vendor +/website/webfonts +/website/package-lock.json +/website/yarn.lock diff --git a/website/.bowerrc b/website/.bowerrc deleted file mode 100644 index 6866ac2..0000000 --- a/website/.bowerrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "directory": "vendor" -} diff --git a/website/bower.json b/website/bower.json deleted file mode 100644 index 3d08f73..0000000 --- a/website/bower.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "name": "universal-geocoder-website", - "homepage": "https://universal-geocoder.github.io/universal-geocoder-js/", - "authors": [ - "Alan Poulain " - ], - "description": "Website for Universal Geocoder", - "main": "", - "license": "(MIT AND GPL-2.0)", - "private": true, - "ignore": [ - "**/.*", - "node_modules" - ], - "dependencies": { - "bootstrap": "^4.5.0", - "bootswatch": "^4.5.0", - "components-font-awesome": "^5.14.0", - "highlight": "highlightjs/cdn-release#^10.1.1", - "jquery": "^3.5.1" - } -} diff --git a/website/copy-vendor.sh b/website/copy-vendor.sh new file mode 100755 index 0000000..c0d4cd1 --- /dev/null +++ b/website/copy-vendor.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +rm -rf vendor webfonts && +mkdir vendor webfonts && +cp node_modules/bootswatch/dist/flatly/bootstrap.min.css vendor/flatly-bootstrap.min.css && +cp node_modules/components-font-awesome/css/all.min.css vendor/font-awesome.min.css && +cp node_modules/components-font-awesome/webfonts/* webfonts && +cp node_modules/@highlightjs/cdn-assets/styles/dracula.min.css vendor/highlight-dracula.min.css && +cp node_modules/jquery/dist/jquery.min.js vendor/jquery.min.js && +cp node_modules/bootstrap/dist/js/bootstrap.min.js vendor/bootstrap.min.js && +cp node_modules/@highlightjs/cdn-assets/highlight.min.js vendor/highlight.min.js && +rm -rf node_modules && +rm -f package-lock.json yarn.lock diff --git a/website/default.twig b/website/default.twig index fabdb15..1c14584 100644 --- a/website/default.twig +++ b/website/default.twig @@ -6,9 +6,9 @@ {{ title }} - - - + + + @@ -68,9 +68,9 @@ - - - + + + diff --git a/spec/GeoJsonDumper.spec.ts b/spec/GeoJsonDumper.spec.ts index b8b54cf..e718abd 100644 --- a/spec/GeoJsonDumper.spec.ts +++ b/spec/GeoJsonDumper.spec.ts @@ -3,13 +3,15 @@ import GeoJsonDumper, { GeoJson } from "GeoJsonDumper"; describe("GeoJSON Dumper", () => { const geocoded = Geocoded.create({ - latitude: 38.8978378, - longitude: -77.0365123, + coordinates: { + latitude: 38.8978378, + longitude: -77.0365123, + }, bounds: { - latitude1: 38.89380528242933, - longitude1: -77.04317326462667, - latitude2: 38.90153071757068, - longitude2: -77.02993873537334, + latitudeSW: 38.89380528242933, + longitudeSW: -77.04317326462667, + latitudeNE: 38.90153071757068, + longitudeNE: -77.02993873537334, }, formattedAddress: "1600 Pennsylvania Avenue Northwest, Washington, DC 20050", @@ -25,12 +27,12 @@ describe("GeoJSON Dumper", () => { type: "Point", coordinates: [-77.0365123, 38.8978378], }, - bounds: { - latitude1: 38.89380528242933, - longitude1: -77.04317326462667, - latitude2: 38.90153071757068, - longitude2: -77.02993873537334, - }, + bbox: [ + -77.04317326462667, + 38.89380528242933, + -77.02993873537334, + 38.90153071757068, + ], }; it("provides a valid GeoJSON dump", () => { diff --git a/spec/Geocoded.spec.ts b/spec/Geocoded.spec.ts index c909c6a..84aa425 100644 --- a/spec/Geocoded.spec.ts +++ b/spec/Geocoded.spec.ts @@ -6,12 +6,6 @@ describe("Geocoded API", () => { it("has getCoordinates method", () => { expect(geocoded.getCoordinates).toBeDefined(); }); - it("has getLatitude method", () => { - expect(geocoded.getLatitude).toBeDefined(); - }); - it("has getLongitude method", () => { - expect(geocoded.getLongitude).toBeDefined(); - }); it("has getBounds method", () => { expect(geocoded.getBounds).toBeDefined(); }); @@ -49,8 +43,10 @@ describe("Geocoded API", () => { describe("Geocoded returns data properly", () => { let geocoded = Geocoded.create({ - latitude: 38.8978378, - longitude: -77.0365123, + coordinates: { + latitude: 38.8978378, + longitude: -77.0365123, + }, formattedAddress: "1600 Pennsylvania Avenue Northwest, Washington, DC 20050", streetNumber: "1600", @@ -63,28 +59,26 @@ describe("Geocoded returns data properly", () => { timezone: "America/New_York", }); geocoded = geocoded.withBounds({ - latitude1: 38.89380528242933, - longitude1: -77.04317326462667, - latitude2: 38.90153071757068, - longitude2: -77.02993873537334, + latitudeSW: 38.89380528242933, + longitudeSW: -77.04317326462667, + latitudeNE: 38.90153071757068, + longitudeNE: -77.02993873537334, }); it("returns proper coordinates", () => { - const expectedCoordinates = [38.8978378, -77.0365123]; + const expectedCoordinates = { + latitude: 38.8978378, + longitude: -77.0365123, + }; expect(geocoded.getCoordinates()).toEqual(expectedCoordinates); }); - it("returns latitude/longitude individually", () => { - expect(geocoded.getLatitude()).toEqual(38.8978378); - expect(geocoded.getLongitude()).toEqual(-77.0365123); - }); - it("returns proper bounds", () => { expect(geocoded.getBounds()).toEqual({ - latitude1: 38.89380528242933, - longitude1: -77.04317326462667, - latitude2: 38.90153071757068, - longitude2: -77.02993873537334, + latitudeSW: 38.89380528242933, + longitudeSW: -77.04317326462667, + latitudeNE: 38.90153071757068, + longitudeNE: -77.02993873537334, }); }); diff --git a/spec/provider/BingProvider.spec.ts b/spec/provider/BingProvider.spec.ts index 5560f13..d3dc789 100644 --- a/spec/provider/BingProvider.spec.ts +++ b/spec/provider/BingProvider.spec.ts @@ -54,12 +54,15 @@ describe("Bing Geocoder Provider", () => { const geocoded = results[0]; expect(geocoded).toBeDefined(); - expect(geocoded.getCoordinates()).toEqual([38.897668, -77.036556]); + expect(geocoded.getCoordinates()).toEqual({ + latitude: 38.897668, + longitude: -77.036556, + }); expect(geocoded.getBounds()).toEqual({ - latitude1: 38.89380528242933, - longitude1: -77.04317326462667, - latitude2: 38.90153071757068, - longitude2: -77.02993873537334, + latitudeSW: 38.89380528242933, + longitudeSW: -77.04317326462667, + latitudeNE: 38.90153071757068, + longitudeNE: -77.02993873537334, }); expect(geocoded.getFormattedAddress()).toEqual( "1600 Pennsylvania Ave NW, Washington, DC 20006" @@ -90,12 +93,15 @@ describe("Bing Geocoder Provider", () => { const geocoded = results[0]; expect(geocoded).toBeDefined(); - expect(geocoded.getCoordinates()).toEqual([48.8631093, 2.3887809]); + expect(geocoded.getCoordinates()).toEqual({ + latitude: 48.8631093, + longitude: 2.3887809, + }); expect(geocoded.getBounds()).toEqual({ - latitude1: 48.85924658242932, - longitude1: 2.380952653445271, - latitude2: 48.866972017570674, - longitude2: 2.396609146554729, + latitudeSW: 48.85924658242932, + longitudeSW: 2.380952653445271, + latitudeNE: 48.866972017570674, + longitudeNE: 2.396609146554729, }); expect(geocoded.getFormattedAddress()).toEqual( "8 Avenue Gambetta, 75020 Paris" diff --git a/spec/provider/ChainProvider.spec.ts b/spec/provider/ChainProvider.spec.ts index 5f634f4..5917dc2 100644 --- a/spec/provider/ChainProvider.spec.ts +++ b/spec/provider/ChainProvider.spec.ts @@ -5,12 +5,15 @@ import setupPolly, { cleanRecording } from "../setupPolly"; const expectGeocodedYandex = (geocoded: Geocoded) => { expect(geocoded).toBeDefined(); - expect(geocoded.getCoordinates()).toEqual([38.895512, -77.033608]); + expect(geocoded.getCoordinates()).toEqual({ + latitude: 38.895512, + longitude: -77.033608, + }); expect(geocoded.getBounds()).toEqual({ - latitude1: 38.890612, - longitude1: -77.058105, - latitude2: 38.905248, - longitude2: -77.012426, + latitudeSW: 38.890612, + longitudeSW: -77.058105, + latitudeNE: 38.905248, + longitudeNE: -77.012426, }); expect(geocoded.getFormattedAddress()).toEqual(undefined); expect(geocoded.getStreetNumber()).toEqual(undefined); @@ -28,12 +31,15 @@ const expectGeocodedYandex = (geocoded: Geocoded) => { const expectGeodecodedYandex = (geocoded: Geocoded) => { expect(geocoded).toBeDefined(); - expect(geocoded.getCoordinates()).toEqual([48.8631, 2.388899]); + expect(geocoded.getCoordinates()).toEqual({ + latitude: 48.8631, + longitude: 2.388899, + }); expect(geocoded.getBounds()).toEqual({ - latitude1: 48.860391, - longitude1: 2.384794, - latitude2: 48.865808, - longitude2: 2.393004, + latitudeSW: 48.860391, + longitudeSW: 2.384794, + latitudeNE: 48.865808, + longitudeNE: 2.393004, }); expect(geocoded.getFormattedAddress()).toEqual(undefined); expect(geocoded.getStreetNumber()).toEqual("10"); @@ -51,12 +57,15 @@ const expectGeodecodedYandex = (geocoded: Geocoded) => { const expectGeocodedOpenStreetMap = (geocoded: Geocoded) => { expect(geocoded).toBeDefined(); - expect(geocoded.getCoordinates()).toEqual([38.8636383, -76.9463651]); + expect(geocoded.getCoordinates()).toEqual({ + latitude: 38.8636383, + longitude: -76.9463651, + }); expect(geocoded.getBounds()).toEqual({ - latitude1: 38.8633822, - longitude1: -76.9467576, - latitude2: 38.8637409, - longitude2: -76.945632, + latitudeSW: 38.8633822, + longitudeSW: -76.9467576, + latitudeNE: 38.8637409, + longitudeNE: -76.945632, }); expect(geocoded.getFormattedAddress()).toEqual(undefined); expect(geocoded.getStreetNumber()).toEqual(undefined); @@ -74,15 +83,15 @@ const expectGeocodedOpenStreetMap = (geocoded: Geocoded) => { }; const expectGeodecodedOpenStreetMap = (geocoded: Geocoded) => { - expect(geocoded.getCoordinates()).toEqual([ - 48.863744499999996, - 2.3911562136123106, - ]); + expect(geocoded.getCoordinates()).toEqual({ + latitude: 48.863744499999996, + longitude: 2.3911562136123106, + }); expect(geocoded.getBounds()).toEqual({ - latitude1: 48.8625929, - longitude1: 2.3877078, - latitude2: 48.8648832, - longitude2: 2.3956964, + latitudeSW: 48.8625929, + longitudeSW: 2.3877078, + latitudeNE: 48.8648832, + longitudeNE: 2.3956964, }); expect(geocoded.getFormattedAddress()).toEqual(undefined); expect(geocoded.getStreetNumber()).toEqual(undefined); @@ -270,7 +279,10 @@ describe("Chain Geocoder Provider", () => { }); provider?.geodecode( - { latitude: 48.8631507, longitude: 2.388911, locale: "en_US" }, + { + coordinates: { latitude: 48.8631507, longitude: 2.388911 }, + locale: "en_US", + }, (results: Geocoded[]) => { const geocoded = results[0]; @@ -298,7 +310,10 @@ describe("Chain Geocoder Provider", () => { }); provider?.geodecode( - { latitude: 48.8631507, longitude: 2.388911, locale: "en_US" }, + { + coordinates: { latitude: 48.8631507, longitude: 2.388911 }, + locale: "en_US", + }, (results: Geocoded[]) => { const geocoded = results[0]; @@ -327,7 +342,10 @@ describe("Chain Geocoder Provider", () => { }); provider?.geodecode( - { latitude: 48.8631507, longitude: 2.388911, locale: "en_US" }, + { + coordinates: { latitude: 48.8631507, longitude: 2.388911 }, + locale: "en_US", + }, (results: Geocoded[]) => { const geocoded = results[0]; @@ -356,7 +374,10 @@ describe("Chain Geocoder Provider", () => { }); provider?.geodecode( - { latitude: 48.8631507, longitude: 2.388911, locale: "en_US" }, + { + coordinates: { latitude: 48.8631507, longitude: 2.388911 }, + locale: "en_US", + }, (results: Geocoded[]) => { const geocoded = results[0]; @@ -385,7 +406,10 @@ describe("Chain Geocoder Provider", () => { }); provider?.geodecode( - { latitude: 48.8631507, longitude: 2.388911, locale: "en_US" }, + { + coordinates: { latitude: 48.8631507, longitude: 2.388911 }, + locale: "en_US", + }, (results: Geocoded[]) => { const geocoded = results[0]; diff --git a/spec/provider/GeoPluginProvider.spec.ts b/spec/provider/GeoPluginProvider.spec.ts index 7761f2c..1ac00b9 100644 --- a/spec/provider/GeoPluginProvider.spec.ts +++ b/spec/provider/GeoPluginProvider.spec.ts @@ -58,7 +58,10 @@ describe("GeoPlugin Geocoder Provider", () => { const geocoded = results[0]; expect(geocoded).toBeDefined(); - expect(geocoded.getCoordinates()).toEqual([-32.2167, -58.1333]); + expect(geocoded.getCoordinates()).toEqual({ + latitude: -32.2167, + longitude: -58.1333, + }); expect(geocoded.getBounds()).toEqual(undefined); expect(geocoded.getFormattedAddress()).toEqual(undefined); expect(geocoded.getStreetNumber()).toEqual(undefined); @@ -86,7 +89,7 @@ describe("GeoPlugin Geocoder Provider", () => { const geocoded = results[0]; expect(geocoded).toBeDefined(); - expect(geocoded.getCoordinates()).toEqual([undefined, undefined]); + expect(geocoded.getCoordinates()).toEqual(undefined); expect(geocoded.getBounds()).toEqual(undefined); expect(geocoded.getFormattedAddress()).toEqual(undefined); expect(geocoded.getStreetNumber()).toEqual(undefined); diff --git a/spec/provider/GoogleMapsProvider.spec.ts b/spec/provider/GoogleMapsProvider.spec.ts index e85722e..9569839 100644 --- a/spec/provider/GoogleMapsProvider.spec.ts +++ b/spec/provider/GoogleMapsProvider.spec.ts @@ -77,12 +77,15 @@ describe("Google Maps Geocoder Provider", () => { const geocoded = results[0]; expect(geocoded).toBeDefined(); - expect(geocoded.getCoordinates()).toEqual([38.8976633, -77.0365739]); + expect(geocoded.getCoordinates()).toEqual({ + latitude: 38.8976633, + longitude: -77.0365739, + }); expect(geocoded.getBounds()).toEqual({ - latitude1: 38.8973063, - longitude1: -77.03795749999999, - latitude2: 38.8979044, - longitude2: -77.0355124, + latitudeSW: 38.8973063, + longitudeSW: -77.03795749999999, + latitudeNE: 38.8979044, + longitudeNE: -77.0355124, }); expect(geocoded.getFormattedAddress()).toEqual( "1600 Pennsylvania Avenue NW, Washington, DC 20500, USA" @@ -130,12 +133,15 @@ describe("Google Maps Geocoder Provider", () => { const geocoded = results[0]; expect(geocoded).toBeDefined(); - expect(geocoded.getCoordinates()).toEqual([48.8631361, 2.3889219]); + expect(geocoded.getCoordinates()).toEqual({ + latitude: 48.8631361, + longitude: 2.3889219, + }); expect(geocoded.getBounds()).toEqual({ - latitude1: 48.8617871197085, - longitude1: 2.387572919708498, - latitude2: 48.8644850802915, - longitude2: 2.390270880291502, + latitudeSW: 48.8617871197085, + longitudeSW: 2.387572919708498, + latitudeNE: 48.8644850802915, + longitudeNE: 2.390270880291502, }); expect(geocoded.getFormattedAddress()).toEqual( "12 Avenue Gambetta, 75020 Paris, France" diff --git a/spec/provider/MapQuestProvider.spec.ts b/spec/provider/MapQuestProvider.spec.ts index d8a3938..afacaf1 100644 --- a/spec/provider/MapQuestProvider.spec.ts +++ b/spec/provider/MapQuestProvider.spec.ts @@ -54,7 +54,10 @@ describe("MapQuest Geocoder Provider", () => { const geocoded = results[0]; expect(geocoded).toBeDefined(); - expect(geocoded.getCoordinates()).toEqual([38.895206, -77.036515]); + expect(geocoded.getCoordinates()).toEqual({ + latitude: 38.895206, + longitude: -77.036515, + }); expect(geocoded.getBounds()).toEqual(undefined); expect(geocoded.getFormattedAddress()).toEqual(undefined); expect(geocoded.getStreetNumber()).toEqual(undefined); @@ -96,7 +99,10 @@ describe("MapQuest Geocoder Provider", () => { const geocoded = results[0]; expect(geocoded).toBeDefined(); - expect(geocoded.getCoordinates()).toEqual([38.895854, -77.030713]); + expect(geocoded.getCoordinates()).toEqual({ + latitude: 38.895854, + longitude: -77.030713, + }); expect(geocoded.getBounds()).toEqual(undefined); expect(geocoded.getFormattedAddress()).toEqual(undefined); expect(geocoded.getStreetNumber()).toEqual(undefined); @@ -133,7 +139,10 @@ describe("MapQuest Geocoder Provider", () => { const geocoded = results[0]; expect(geocoded).toBeDefined(); - expect(geocoded.getCoordinates()).toEqual([48.863116, 2.38878]); + expect(geocoded.getCoordinates()).toEqual({ + latitude: 48.863116, + longitude: 2.38878, + }); expect(geocoded.getBounds()).toEqual(undefined); expect(geocoded.getFormattedAddress()).toEqual(undefined); expect(geocoded.getStreetNumber()).toEqual(undefined); @@ -171,7 +180,10 @@ describe("MapQuest Geocoder Provider", () => { const geocoded = results[0]; expect(geocoded).toBeDefined(); - expect(geocoded.getCoordinates()).toEqual([48.863116, 2.38878]); + expect(geocoded.getCoordinates()).toEqual({ + latitude: 48.863116, + longitude: 2.38878, + }); expect(geocoded.getBounds()).toEqual(undefined); expect(geocoded.getFormattedAddress()).toEqual(undefined); expect(geocoded.getStreetNumber()).toEqual(undefined); diff --git a/spec/provider/MapboxProvider.spec.ts b/spec/provider/MapboxProvider.spec.ts index e987b42..22f951a 100644 --- a/spec/provider/MapboxProvider.spec.ts +++ b/spec/provider/MapboxProvider.spec.ts @@ -52,7 +52,10 @@ describe("Mapbox Geocoder Provider", () => { const geocoded = results[0]; expect(geocoded).toBeDefined(); - expect(geocoded.getCoordinates()).toEqual([38.87925, -76.98204]); + expect(geocoded.getCoordinates()).toEqual({ + latitude: 38.87925, + longitude: -76.98204, + }); expect(geocoded.getBounds()).toEqual(undefined); expect(geocoded.getFormattedAddress()).toEqual( "1600 Pennsylvania Ave SE, Washington, District of Columbia 20003, United States" @@ -90,7 +93,10 @@ describe("Mapbox Geocoder Provider", () => { const geocoded = results[0]; expect(geocoded).toBeDefined(); - expect(geocoded.getCoordinates()).toEqual([48.863134, 2.388886]); + expect(geocoded.getCoordinates()).toEqual({ + latitude: 48.863134, + longitude: 2.388886, + }); expect(geocoded.getBounds()).toEqual(undefined); expect(geocoded.getFormattedAddress()).toEqual( "12 Avenue Gambetta, 75020 Paris, France" diff --git a/spec/provider/NominatimProvider.spec.ts b/spec/provider/NominatimProvider.spec.ts index b3c733f..e9d4778 100644 --- a/spec/provider/NominatimProvider.spec.ts +++ b/spec/provider/NominatimProvider.spec.ts @@ -54,12 +54,15 @@ describe("OpenStreetMap / Nominatim Geocoder Provider", () => { const geocoded = results[0]; expect(geocoded).toBeDefined(); - expect(geocoded.getCoordinates()).toEqual([38.8958536, -77.0307129]); + expect(geocoded.getCoordinates()).toEqual({ + latitude: 38.8958536, + longitude: -77.0307129, + }); expect(geocoded.getBounds()).toEqual({ - latitude1: 38.8957842, - longitude1: -77.0309688, - latitude2: 38.895924, - longitude2: -77.0304609, + latitudeSW: 38.8957842, + longitudeSW: -77.0309688, + latitudeNE: 38.895924, + longitudeNE: -77.0304609, }); expect(geocoded.getFormattedAddress()).toEqual(undefined); expect(geocoded.getDisplayName()).toEqual( @@ -104,15 +107,15 @@ describe("OpenStreetMap / Nominatim Geocoder Provider", () => { const geocoded = results[0]; expect(geocoded).toBeDefined(); - expect(geocoded.getCoordinates()).toEqual([ - 48.863744499999996, - 2.3911562136123106, - ]); + expect(geocoded.getCoordinates()).toEqual({ + latitude: 48.863744499999996, + longitude: 2.3911562136123106, + }); expect(geocoded.getBounds()).toEqual({ - latitude1: 48.8625929, - longitude1: 2.3877078, - latitude2: 48.8648832, - longitude2: 2.3956964, + latitudeSW: 48.8625929, + longitudeSW: 2.3877078, + latitudeNE: 48.8648832, + longitudeNE: 2.3956964, }); expect(geocoded.getFormattedAddress()).toEqual(undefined); expect(geocoded.getDisplayName()).toEqual( diff --git a/spec/provider/OpenCageProvider.spec.ts b/spec/provider/OpenCageProvider.spec.ts index 53475d4..f026381 100644 --- a/spec/provider/OpenCageProvider.spec.ts +++ b/spec/provider/OpenCageProvider.spec.ts @@ -52,12 +52,15 @@ describe("OpenCage Geocoder Provider", () => { const geocoded = results[0]; expect(geocoded).toBeDefined(); - expect(geocoded.getCoordinates()).toEqual([38.8636383, -76.9463651]); + expect(geocoded.getCoordinates()).toEqual({ + latitude: 38.8636383, + longitude: -76.9463651, + }); expect(geocoded.getBounds()).toEqual({ - latitude1: 38.8633822, - longitude1: -76.9467576, - latitude2: 38.8637409, - longitude2: -76.945632, + latitudeSW: 38.8633822, + longitudeSW: -76.9467576, + latitudeNE: 38.8637409, + longitudeNE: -76.945632, }); expect(geocoded.getFormattedAddress()).toEqual( "Pennsylvania Avenue, Washington, DC 20746-8001, United States of America" @@ -101,7 +104,10 @@ describe("OpenCage Geocoder Provider", () => { const geocoded = results[0]; expect(geocoded).toBeDefined(); - expect(geocoded.getCoordinates()).toEqual([48.863116, 2.38878]); + expect(geocoded.getCoordinates()).toEqual({ + latitude: 48.863116, + longitude: 2.38878, + }); expect(geocoded.getBounds()).toEqual(undefined); expect(geocoded.getFormattedAddress()).toEqual( "8 Avenue Gambetta, 75020 Paris, France" diff --git a/spec/provider/YandexProvider.spec.ts b/spec/provider/YandexProvider.spec.ts index 3ec5fe9..26752f9 100644 --- a/spec/provider/YandexProvider.spec.ts +++ b/spec/provider/YandexProvider.spec.ts @@ -54,12 +54,15 @@ describe("Yandex Geocoder Provider", () => { const geocoded = results[0]; expect(geocoded).toBeDefined(); - expect(geocoded.getCoordinates()).toEqual([38.895512, -77.033608]); + expect(geocoded.getCoordinates()).toEqual({ + latitude: 38.895512, + longitude: -77.033608, + }); expect(geocoded.getBounds()).toEqual({ - latitude1: 38.890612, - longitude1: -77.058105, - latitude2: 38.905248, - longitude2: -77.012426, + latitudeSW: 38.890612, + longitudeSW: -77.058105, + latitudeNE: 38.905248, + longitudeNE: -77.012426, }); expect(geocoded.getFormattedAddress()).toEqual(undefined); expect(geocoded.getStreetNumber()).toEqual(undefined); @@ -94,17 +97,23 @@ describe("Yandex Geocoder Provider", () => { }); provider?.geodecode( - { latitude: 48.8631507, longitude: 2.388911, locale: "en_US" }, + { + coordinates: { latitude: 48.8631507, longitude: 2.388911 }, + locale: "en_US", + }, (results: YandexGeocoded[]) => { const geocoded = results[0]; expect(geocoded).toBeDefined(); - expect(geocoded.getCoordinates()).toEqual([48.8631, 2.388899]); + expect(geocoded.getCoordinates()).toEqual({ + latitude: 48.8631, + longitude: 2.388899, + }); expect(geocoded.getBounds()).toEqual({ - latitude1: 48.860391, - longitude1: 2.384794, - latitude2: 48.865808, - longitude2: 2.393004, + latitudeSW: 48.860391, + longitudeSW: 2.384794, + latitudeNE: 48.865808, + longitudeNE: 2.393004, }); expect(geocoded.getFormattedAddress()).toEqual(undefined); expect(geocoded.getStreetNumber()).toEqual("10"); diff --git a/src/GeoJsonDumper.ts b/src/GeoJsonDumper.ts index b7401af..42de3b8 100644 --- a/src/GeoJsonDumper.ts +++ b/src/GeoJsonDumper.ts @@ -1,6 +1,11 @@ import Geocoded from "Geocoded"; import AdminLevel, { AdminLevelObject } from "AdminLevel"; -import { BoundingBox } from "types"; +import { + BoundingBox, + Coordinates, + FlatBoundingBox, + FlatCoordinates, +} from "types"; export interface GeoJson { readonly type: "Feature"; @@ -10,6 +15,7 @@ export interface GeoJson { | string[] | number | boolean + | Coordinates | BoundingBox | AdminLevel[] | AdminLevelObject[] @@ -17,9 +23,9 @@ export interface GeoJson { }; readonly geometry: { readonly type: "Point"; - readonly coordinates: [number | undefined, number | undefined]; + readonly coordinates: FlatCoordinates; }; - readonly bounds?: BoundingBox; + readonly bbox?: FlatBoundingBox; } export default class GeoJsonDumper { @@ -28,24 +34,14 @@ export default class GeoJsonDumper { properties: {}, geometry: { type: "Point", - coordinates: [undefined, undefined], + coordinates: [0, 0], }, }; public static dump(geocoded: Geocoded): GeoJson { let result = GeoJsonDumper.baseGeoJson; - result = { - ...result, - ...{ - geometry: { - ...result.geometry, - coordinates: [geocoded.getLongitude(), geocoded.getLatitude()], - }, - }, - }; const { - latitude, - longitude, + coordinates, bounds, adminLevels, ...geocodedProperties @@ -57,6 +53,7 @@ export default class GeoJsonDumper { | string[] | number | boolean + | Coordinates | BoundingBox | AdminLevel[] | AdminLevelObject[] @@ -75,8 +72,32 @@ export default class GeoJsonDumper { } result = { ...result, properties }; + + if (coordinates) { + result = { + ...result, + ...{ + geometry: { + ...result.geometry, + coordinates: [ + parseFloat(coordinates.longitude.toString()), + parseFloat(coordinates.latitude.toString()), + ], + }, + }, + }; + } + if (bounds) { - result = { ...result, bounds }; + result = { + ...result, + bbox: [ + parseFloat(bounds.longitudeSW.toString()), + parseFloat(bounds.latitudeSW.toString()), + parseFloat(bounds.longitudeNE.toString()), + parseFloat(bounds.latitudeNE.toString()), + ], + }; } return result; diff --git a/src/Geocoded.ts b/src/Geocoded.ts index 5afecc7..85c1206 100644 --- a/src/Geocoded.ts +++ b/src/Geocoded.ts @@ -1,5 +1,5 @@ import AdminLevel from "AdminLevel"; -import { BoundingBox } from "types"; +import { BoundingBox, Coordinates } from "types"; export interface GeocodedObject { readonly [property: string]: @@ -7,11 +7,11 @@ export interface GeocodedObject { | string[] | number | boolean + | Coordinates | BoundingBox | AdminLevel[] | undefined; - readonly latitude?: number; - readonly longitude?: number; + readonly coordinates?: Coordinates; readonly bounds?: BoundingBox; readonly formattedAddress?: string; readonly streetNumber?: string; @@ -27,9 +27,7 @@ export interface GeocodedObject { } export default class Geocoded { - private readonly latitude?: number; - - private readonly longitude?: number; + private readonly coordinates?: Coordinates; private readonly bounds?: BoundingBox; @@ -56,8 +54,7 @@ export default class Geocoded { private readonly timezone?: string; protected constructor({ - latitude, - longitude, + coordinates, bounds, formattedAddress, streetNumber, @@ -71,8 +68,7 @@ export default class Geocoded { countryCode, timezone, }: GeocodedObject) { - this.latitude = latitude; - this.longitude = longitude; + this.coordinates = coordinates; this.bounds = bounds; this.formattedAddress = formattedAddress; this.streetNumber = streetNumber; @@ -93,8 +89,7 @@ export default class Geocoded { public toObject(): GeocodedObject { return { - latitude: this.latitude, - longitude: this.longitude, + coordinates: this.coordinates, bounds: this.bounds, formattedAddress: this.formattedAddress, streetNumber: this.streetNumber, @@ -117,24 +112,15 @@ export default class Geocoded { }); } - public withCoordinates(latitude?: number, longitude?: number): Geocoded { + public withCoordinates(coordinates: Coordinates): Geocoded { return (this.constructor).create({ ...this.toObject(), - latitude, - longitude, + coordinates, }); } - public getCoordinates(): [undefined | number, undefined | number] { - return [this.latitude, this.longitude]; - } - - public getLatitude(): undefined | number { - return this.latitude; - } - - public getLongitude(): undefined | number { - return this.longitude; + public getCoordinates(): undefined | Coordinates { + return this.coordinates; } public getBounds(): undefined | BoundingBox { diff --git a/src/provider/BingProvider.ts b/src/provider/BingProvider.ts index c3f9773..76f7187 100644 --- a/src/provider/BingProvider.ts +++ b/src/provider/BingProvider.ts @@ -19,7 +19,7 @@ import { ReverseQuery, ReverseQueryObject, } from "query"; -import { Box } from "types"; +import { FlatBoundingBox } from "types"; interface BingRequestParams { [param: string]: string | undefined; @@ -29,7 +29,7 @@ interface BingRequestParams { export interface BingResult { __type: string; - bbox: Box; + bbox: FlatBoundingBox; name: string; point: { type: string; @@ -170,8 +170,10 @@ export default class BingProvider implements ProviderInterface { const country = result.address.countryRegion; let geocoded = Geocoded.create({ - latitude, - longitude, + coordinates: { + latitude, + longitude, + }, formattedAddress, streetName, locality, @@ -180,10 +182,10 @@ export default class BingProvider implements ProviderInterface { country, }); geocoded = geocoded.withBounds({ - latitude1: result.bbox[0], - longitude1: result.bbox[1], - latitude2: result.bbox[2], - longitude2: result.bbox[3], + latitudeSW: result.bbox[0], + longitudeSW: result.bbox[1], + latitudeNE: result.bbox[2], + longitudeNE: result.bbox[3], }); return geocoded; diff --git a/src/provider/ProviderHelpers.ts b/src/provider/ProviderHelpers.ts index e1d57de..29ff2d5 100644 --- a/src/provider/ProviderHelpers.ts +++ b/src/provider/ProviderHelpers.ts @@ -46,8 +46,10 @@ export default class ProviderHelpers { ); } return reverseQuery.create({ - latitude: latitudeOrQuery, - longitude: longitudeOrCallback, + coordinates: { + latitude: latitudeOrQuery, + longitude: longitudeOrCallback, + }, }); } if (!(latitudeOrQuery instanceof reverseQuery)) { diff --git a/src/provider/geoplugin/GeoPluginProvider.ts b/src/provider/geoplugin/GeoPluginProvider.ts index 27342b4..3322231 100644 --- a/src/provider/geoplugin/GeoPluginProvider.ts +++ b/src/provider/geoplugin/GeoPluginProvider.ts @@ -199,8 +199,10 @@ export default class GeoPluginProvider } const geocoded = GeoPluginGeocoded.create({ - latitude, - longitude, + coordinates: { + latitude, + longitude, + }, locality, region, adminLevels, diff --git a/src/provider/googlemaps/GoogleMapsProvider.ts b/src/provider/googlemaps/GoogleMapsProvider.ts index d3279d9..3b3edfa 100644 --- a/src/provider/googlemaps/GoogleMapsProvider.ts +++ b/src/provider/googlemaps/GoogleMapsProvider.ts @@ -233,10 +233,10 @@ export default class GoogleMapsProvider { address: geocodeQuery.getText(), bounds: geocodeQuery.getBounds() - ? `${geocodeQuery.getBounds()?.latitude1},${ - geocodeQuery.getBounds()?.longitude1 - }|${geocodeQuery.getBounds()?.latitude2},${ - geocodeQuery.getBounds()?.longitude2 + ? `${geocodeQuery.getBounds()?.latitudeSW},${ + geocodeQuery.getBounds()?.longitudeSW + }|${geocodeQuery.getBounds()?.latitudeNE},${ + geocodeQuery.getBounds()?.longitudeNE }` : undefined, components: (geocodeQuery).getComponents() @@ -552,8 +552,10 @@ export default class GoogleMapsProvider }); let geocoded = GoogleMapsGeocoded.create({ - latitude, - longitude, + coordinates: { + latitude, + longitude, + }, formattedAddress, streetNumber, streetName, @@ -588,26 +590,26 @@ export default class GoogleMapsProvider if (result.geometry.bounds) { const { bounds } = result.geometry; geocoded = geocoded.withBounds({ - latitude1: bounds.southwest.lat, - longitude1: bounds.southwest.lng, - latitude2: bounds.northeast.lat, - longitude2: bounds.northeast.lng, + latitudeSW: bounds.southwest.lat, + longitudeSW: bounds.southwest.lng, + latitudeNE: bounds.northeast.lat, + longitudeNE: bounds.northeast.lng, }); } else if (result.geometry.viewport) { const { viewport } = result.geometry; geocoded = geocoded.withBounds({ - latitude1: viewport.southwest.lat, - longitude1: viewport.southwest.lng, - latitude2: viewport.northeast.lat, - longitude2: viewport.northeast.lng, + latitudeSW: viewport.southwest.lat, + longitudeSW: viewport.southwest.lng, + latitudeNE: viewport.northeast.lat, + longitudeNE: viewport.northeast.lng, }); } else if (result.geometry.location_type === "ROOFTOP") { // Fake bounds geocoded = geocoded.withBounds({ - latitude1: latitude, - longitude1: longitude, - latitude2: latitude, - longitude2: longitude, + latitudeSW: latitude, + longitudeSW: longitude, + latitudeNE: latitude, + longitudeNE: longitude, }); } diff --git a/src/provider/mapbox/MapboxProvider.ts b/src/provider/mapbox/MapboxProvider.ts index 28f6b51..82cf14b 100644 --- a/src/provider/mapbox/MapboxProvider.ts +++ b/src/provider/mapbox/MapboxProvider.ts @@ -17,7 +17,7 @@ import { ProviderOptionsInterface, defaultProviderOptions, } from "provider"; -import { Box } from "types"; +import { FlatBoundingBox } from "types"; import AdminLevel, { ADMIN_LEVEL_CODES } from "AdminLevel"; interface MapboxRequestParams { @@ -77,7 +77,7 @@ export interface MapboxResult { // eslint-disable-next-line camelcase matching_place_name?: string; language?: string; - bbox?: Box; + bbox?: FlatBoundingBox; center: [number, number]; geometry: { type: "Point"; @@ -166,10 +166,10 @@ export default class MapboxProvider const params: MapboxRequestParams = this.withCommonParams( { bbox: geocodeQuery.getBounds() - ? `${geocodeQuery.getBounds()?.longitude1},${ - geocodeQuery.getBounds()?.latitude1 - },${geocodeQuery.getBounds()?.longitude2},${ - geocodeQuery.getBounds()?.latitude2 + ? `${geocodeQuery.getBounds()?.longitudeSW},${ + geocodeQuery.getBounds()?.latitudeSW + },${geocodeQuery.getBounds()?.longitudeNE},${ + geocodeQuery.getBounds()?.latitudeNE }` : undefined, proximity: (geocodeQuery).getProximity() @@ -331,8 +331,10 @@ export default class MapboxProvider }); let geocoded = MapboxGeocoded.create({ - latitude, - longitude, + coordinates: { + latitude, + longitude, + }, formattedAddress, streetNumber, streetName, @@ -346,10 +348,10 @@ export default class MapboxProvider }); if (result.bbox) { geocoded = geocoded.withBounds({ - latitude1: result.bbox[1], - longitude1: result.bbox[0], - latitude2: result.bbox[3], - longitude2: result.bbox[2], + latitudeSW: result.bbox[1], + longitudeSW: result.bbox[0], + latitudeNE: result.bbox[3], + longitudeNE: result.bbox[2], }); } diff --git a/src/provider/mapquest/MapQuestProvider.ts b/src/provider/mapquest/MapQuestProvider.ts index 71ed704..35e9202 100644 --- a/src/provider/mapquest/MapQuestProvider.ts +++ b/src/provider/mapquest/MapQuestProvider.ts @@ -158,10 +158,10 @@ export default class MapQuestProvider maxResults?: string; } = { boundingBox: geocodeQuery.getBounds() - ? `${geocodeQuery.getBounds()?.latitude1},${ - geocodeQuery.getBounds()?.longitude1 - },${geocodeQuery.getBounds()?.latitude2},${ - geocodeQuery.getBounds()?.longitude2 + ? `${geocodeQuery.getBounds()?.latitudeNE},${ + geocodeQuery.getBounds()?.longitudeSW + },${geocodeQuery.getBounds()?.latitudeSW},${ + geocodeQuery.getBounds()?.longitudeNE }` : undefined, maxResults: geocodeQuery.getLimit().toString(), @@ -193,12 +193,12 @@ export default class MapQuestProvider boundingBox: geocodeQuery.getBounds() ? { ul: { - lat: geocodeQuery.getBounds()?.latitude1, - lng: geocodeQuery.getBounds()?.longitude1, + lat: geocodeQuery.getBounds()?.latitudeNE, + lng: geocodeQuery.getBounds()?.longitudeSW, }, lr: { - lat: geocodeQuery.getBounds()?.latitude2, - lng: geocodeQuery.getBounds()?.longitude2, + lat: geocodeQuery.getBounds()?.latitudeSW, + lng: geocodeQuery.getBounds()?.longitudeNE, }, } : undefined, @@ -336,8 +336,10 @@ export default class MapQuestProvider const { mapUrl } = result; const geocoded = MapQuestGeocoded.create({ - latitude, - longitude, + coordinates: { + latitude, + longitude, + }, streetName, subLocality, locality, diff --git a/src/provider/nominatim/NominatimProvider.ts b/src/provider/nominatim/NominatimProvider.ts index ed3a7c7..a590c4f 100644 --- a/src/provider/nominatim/NominatimProvider.ts +++ b/src/provider/nominatim/NominatimProvider.ts @@ -162,10 +162,10 @@ export default class NominatimProvider ?.join(",") : undefined, viewbox: geocodeQuery.getBounds() - ? `${geocodeQuery.getBounds()?.longitude1},${ - geocodeQuery.getBounds()?.latitude1 - },${geocodeQuery.getBounds()?.longitude2},${ - geocodeQuery.getBounds()?.latitude2 + ? `${geocodeQuery.getBounds()?.longitudeSW},${ + geocodeQuery.getBounds()?.latitudeSW + },${geocodeQuery.getBounds()?.longitudeNE},${ + geocodeQuery.getBounds()?.latitudeNE }` : undefined, bounded: (geocodeQuery).getBounded() @@ -320,8 +320,10 @@ export default class NominatimProvider }); let geocoded = NominatimGeocoded.create({ - latitude, - longitude, + coordinates: { + latitude, + longitude, + }, displayName, streetNumber, streetName, @@ -339,10 +341,10 @@ export default class NominatimProvider }); geocoded = geocoded.withBounds({ - latitude1: parseFloat(result.boundingbox[0]), - longitude1: parseFloat(result.boundingbox[2]), - latitude2: parseFloat(result.boundingbox[1]), - longitude2: parseFloat(result.boundingbox[3]), + latitudeSW: parseFloat(result.boundingbox[0]), + longitudeSW: parseFloat(result.boundingbox[2]), + latitudeNE: parseFloat(result.boundingbox[1]), + longitudeNE: parseFloat(result.boundingbox[3]), }); const adminLevels: ("state" | "county")[] = ["state", "county"]; diff --git a/src/provider/opencage/OpenCageProvider.ts b/src/provider/opencage/OpenCageProvider.ts index f207d05..1e0ffdd 100644 --- a/src/provider/opencage/OpenCageProvider.ts +++ b/src/provider/opencage/OpenCageProvider.ts @@ -327,10 +327,10 @@ export default class OpenCageProvider { q: geocodeQuery.getText() || "", bounds: geocodeQuery.getBounds() - ? `${geocodeQuery.getBounds()?.longitude1},${ - geocodeQuery.getBounds()?.latitude1 - },${geocodeQuery.getBounds()?.longitude2},${ - geocodeQuery.getBounds()?.latitude2 + ? `${geocodeQuery.getBounds()?.longitudeSW},${ + geocodeQuery.getBounds()?.latitudeSW + },${geocodeQuery.getBounds()?.longitudeNE},${ + geocodeQuery.getBounds()?.latitudeNE }` : undefined, proximity: (geocodeQuery).getProximity() @@ -523,8 +523,10 @@ export default class OpenCageProvider result.components.croft; let geocoded = OpenCageGeocoded.create({ - latitude, - longitude, + coordinates: { + latitude, + longitude, + }, formattedAddress, streetNumber, streetName, @@ -545,10 +547,10 @@ export default class OpenCageProvider if (result.bounds) { geocoded = geocoded.withBounds({ - latitude1: result.bounds.southwest.lat, - longitude1: result.bounds.southwest.lng, - latitude2: result.bounds.northeast.lat, - longitude2: result.bounds.northeast.lng, + latitudeSW: result.bounds.southwest.lat, + longitudeSW: result.bounds.southwest.lng, + latitudeNE: result.bounds.northeast.lat, + longitudeNE: result.bounds.northeast.lng, }); } diff --git a/src/provider/yandex/YandexProvider.ts b/src/provider/yandex/YandexProvider.ts index 358f25f..bf8ced1 100644 --- a/src/provider/yandex/YandexProvider.ts +++ b/src/provider/yandex/YandexProvider.ts @@ -212,10 +212,10 @@ export default class YandexProvider }` : undefined, bbox: geocodeQuery.getBounds() - ? `${geocodeQuery.getBounds()?.longitude1},${ - geocodeQuery.getBounds()?.latitude1 - }~${geocodeQuery.getBounds()?.longitude2},${ - geocodeQuery.getBounds()?.latitude2 + ? `${geocodeQuery.getBounds()?.longitudeSW},${ + geocodeQuery.getBounds()?.latitudeSW + }~${geocodeQuery.getBounds()?.longitudeNE},${ + geocodeQuery.getBounds()?.latitudeNE }` : undefined, }, @@ -331,8 +331,10 @@ export default class YandexProvider const { precision } = result.metaDataProperty.GeocoderMetaData; let geocoded = YandexGeocoded.create({ - latitude, - longitude, + coordinates: { + latitude, + longitude, + }, streetNumber, streetName, subLocality, @@ -362,10 +364,10 @@ export default class YandexProvider const lowerCorner = result.boundedBy.Envelope.lowerCorner.split(" "); const upperCorner = result.boundedBy.Envelope.upperCorner.split(" "); geocoded = geocoded.withBounds({ - latitude1: parseFloat(lowerCorner[1]), - longitude1: parseFloat(lowerCorner[0]), - latitude2: parseFloat(upperCorner[1]), - longitude2: parseFloat(upperCorner[0]), + latitudeSW: parseFloat(lowerCorner[1]), + longitudeSW: parseFloat(lowerCorner[0]), + latitudeNE: parseFloat(upperCorner[1]), + longitudeNE: parseFloat(upperCorner[0]), }); return geocoded; diff --git a/src/query/GeocodeQuery.ts b/src/query/GeocodeQuery.ts index c070a47..169cf8a 100644 --- a/src/query/GeocodeQuery.ts +++ b/src/query/GeocodeQuery.ts @@ -34,13 +34,13 @@ export default class GeocodeQuery { } if ( bounds && - (!bounds.latitude1 || - !bounds.longitude1 || - !bounds.latitude2 || - !bounds.longitude2) + (!bounds.latitudeSW || + !bounds.longitudeSW || + !bounds.latitudeNE || + !bounds.longitudeNE) ) { throw new Error( - 'The "bounds" parameter must be an object with the keys: "latitude1", "longitude1", "latitude2", "longitude2".' + 'The "bounds" parameter must be an object with the keys: "latitudeSW", "longitudeSW", "latitudeNE", "longitudeNE".' ); } this.bounds = bounds; diff --git a/src/query/ReverseQuery.ts b/src/query/ReverseQuery.ts index e4d1e73..0bb4179 100644 --- a/src/query/ReverseQuery.ts +++ b/src/query/ReverseQuery.ts @@ -2,29 +2,29 @@ import { DEFAULT_RESULT_LIMIT } from "provider"; import { Coordinates } from "types"; export interface ReverseQueryObject { - readonly latitude: number | string; - readonly longitude: number | string; + readonly coordinates: Coordinates; readonly locale?: string; readonly limit?: number; } export default class ReverseQuery { - private readonly latitude: number | string; - - private readonly longitude: number | string; + private readonly coordinates: Coordinates; private readonly locale?: string; private readonly limit: number = DEFAULT_RESULT_LIMIT; protected constructor({ - latitude, - longitude, + coordinates, locale, limit = DEFAULT_RESULT_LIMIT, }: ReverseQueryObject) { - this.latitude = latitude; - this.longitude = longitude; + if (coordinates && (!coordinates.latitude || !coordinates.longitude)) { + throw new Error( + 'The "coordinates" parameter must be an object with the keys: "latitude", "longitude".' + ); + } + this.coordinates = coordinates; this.locale = locale; this.limit = limit; } @@ -35,18 +35,16 @@ export default class ReverseQuery { public toObject(): ReverseQueryObject { return { - latitude: this.latitude, - longitude: this.longitude, + coordinates: this.coordinates, locale: this.locale, limit: this.limit, }; } - public withCoordinates(latitude: number, longitude: number): ReverseQuery { + public withCoordinates(coordinates: Coordinates): ReverseQuery { return (this.constructor).create({ ...this.toObject(), - latitude, - longitude, + coordinates, }); } @@ -65,7 +63,7 @@ export default class ReverseQuery { } public getCoordinates(): Coordinates { - return { latitude: this.latitude, longitude: this.longitude }; + return this.coordinates; } public getLocale(): undefined | string { diff --git a/src/types.ts b/src/types.ts index 7067cb3..adb719f 100644 --- a/src/types.ts +++ b/src/types.ts @@ -5,7 +5,9 @@ export type PartialSome< R = { [K in P]?: O[P] } > = Q & R; -export type Box = [number, number, number, number]; +export type FlatCoordinates = [number, number]; + +export type FlatBoundingBox = [number, number, number, number]; export type Coordinates = { readonly latitude: number | string; @@ -13,10 +15,10 @@ export type Coordinates = { }; export type BoundingBox = { - // Often South-West (Lower-Left) but also North-West (Upper-Left) - readonly latitude1: number | string; - readonly longitude1: number | string; - // Often North-East (Upper-Right) but also South-East (Lower-Right) - readonly latitude2: number | string; - readonly longitude2: number | string; + // South-West (Lower-Left, minY-minX, minLat-minLon, SouthLatitude-WestLongitude) + readonly latitudeSW: number | string; + readonly longitudeSW: number | string; + // North-East (Upper-Right, maxY-maxX, maxLat-maxLon, NorthLatitude-EastLongitude) + readonly latitudeNE: number | string; + readonly longitudeNE: number | string; }; From e4000999eb766aec3e512508a8832e6b237158c4 Mon Sep 17 00:00:00 2001 From: Alan Poulain Date: Sat, 10 Oct 2020 17:37:22 +0200 Subject: [PATCH 51/56] chore: bump dev dependencies --- package-lock.json | 293 +++++++++++++++++++++------------------------- 1 file changed, 132 insertions(+), 161 deletions(-) diff --git a/package-lock.json b/package-lock.json index 95aa6f5..9d07ee1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -705,12 +705,6 @@ "integrity": "sha512-5ezb/dBSTWtKQ4sLQwMgOJyREXJcZZkTMbendMwKrXTghUhWjZhstzkkmt4/WkFy/GSTSGzfJOKU7dEXv3C/XQ==", "dev": true }, - "@types/color-name": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@types/color-name/-/color-name-1.1.1.tgz", - "integrity": "sha512-rr+OQyAjxze7GgWrSaJwydHStIhHq2lvY3BOC2Mj7KnzI7XK0Uw1TOOdI9lDoajEbSWLiYgoo4f1R51erQfhPQ==", - "dev": true - }, "@types/jasmine": { "version": "3.5.14", "resolved": "https://registry.npmjs.org/@types/jasmine/-/jasmine-3.5.14.tgz", @@ -736,9 +730,9 @@ "dev": true }, "@types/node": { - "version": "14.11.2", - "resolved": "https://registry.npmjs.org/@types/node/-/node-14.11.2.tgz", - "integrity": "sha512-jiE3QIxJ8JLNcb1Ps6rDbysDhN4xa8DJJvuC9prr6w+1tIh+QAbYyNF3tyiZNLDBIuBCf4KEcV2UvQm/V60xfA==", + "version": "14.11.8", + "resolved": "https://registry.npmjs.org/@types/node/-/node-14.11.8.tgz", + "integrity": "sha512-KPcKqKm5UKDkaYPTuXSx8wEP7vE9GnuaXIZKijwRYcePpZFDVuy2a57LarFKiORbHOuTOOwYzxVxcUzsh2P2Pw==", "dev": true }, "@types/normalize-package-data": { @@ -754,27 +748,27 @@ "dev": true }, "@types/pollyjs__adapter": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/@types/pollyjs__adapter/-/pollyjs__adapter-4.3.0.tgz", - "integrity": "sha512-aJ4+ianTKgbdZRnBjcB9D1Kn4ALn3YatGlAzgEdGHyv63aV+gzukKH8xqdrRB76pwrXXCQwLosNBFNTSEmRA9A==", + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/@types/pollyjs__adapter/-/pollyjs__adapter-4.3.1.tgz", + "integrity": "sha512-aQXE2CDxaNV/doHMBaYMsGTj1Xn6GihD7owLRN2kd+rCw6YBRSWXEirtkwuutJYquWU2lbBl2m4usTQearpr6Q==", "dev": true, "requires": { "@types/pollyjs__core": "*" } }, "@types/pollyjs__adapter-node-http": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@types/pollyjs__adapter-node-http/-/pollyjs__adapter-node-http-2.0.0.tgz", - "integrity": "sha512-v8g65xEnADlb1UZe4fNPO9KpU04uY6HAPns307RWqePlVtftctD73FA++74PbO17PNgMbi/7IzrZatiEEn9CPQ==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@types/pollyjs__adapter-node-http/-/pollyjs__adapter-node-http-2.0.1.tgz", + "integrity": "sha512-bUEZZbzCwvUZfBUrVJXYbQfdGVKL7TM/xrPFJYLNPC94I0PWngYtbFdzCkJSKfiOHP9xptgGTQpViDlNoKXYoQ==", "dev": true, "requires": { "@types/pollyjs__adapter": "*" } }, "@types/pollyjs__core": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/@types/pollyjs__core/-/pollyjs__core-4.3.0.tgz", - "integrity": "sha512-gloFb5e36G8Tice0J2GhdzqAAongh2ALBel5QjvjmTk4Vv0+mD3xkE3O50XHdRfbJwCOo7A/rpH+6J+kuKXdZg==", + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/@types/pollyjs__core/-/pollyjs__core-4.3.1.tgz", + "integrity": "sha512-YxAH9Ms9A2jStQKko/wnCCLN6VYQHfrSPvHRC8YlVXuZVoVx56tz8I88QyBxrNO9ZEC4o2dvQqkDO1A8neOQZQ==", "dev": true, "requires": { "@types/pollyjs__adapter": "*", @@ -782,30 +776,30 @@ } }, "@types/pollyjs__persister": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/@types/pollyjs__persister/-/pollyjs__persister-4.3.0.tgz", - "integrity": "sha512-gEwKh9XQSHo+1iBTHKqBIa/BHfG0cLidgryU6jEWzQ9NTtYOGb2V5tf3qb0ddihO7kJW/d0MCKTN28hDS+XCDg==", + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/@types/pollyjs__persister/-/pollyjs__persister-4.3.1.tgz", + "integrity": "sha512-h8MNPbBGM5fRCXGA/xAw6bFZT1oJhnPaoTpDp07PHN63YZvRR0NdeJYphFod+PX1GOhDHrIXxtB912JlwJwGHw==", "dev": true }, "@types/pollyjs__persister-fs": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@types/pollyjs__persister-fs/-/pollyjs__persister-fs-2.0.0.tgz", - "integrity": "sha512-m788FLVtzE+qqrNeotBel2S1EhNMkkNRVJa9XQqeNdwvaJvOp7h/EWacKCrdHLK406LBo7vhL8dpWldkRBm0lg==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@types/pollyjs__persister-fs/-/pollyjs__persister-fs-2.0.1.tgz", + "integrity": "sha512-wYqBN0sqHg+XHGo0Hy5J7pCF0IW6+aWEz9+wKWN6VuLmq3Bh2D/pzLOADSbSH8g5IwYQWNRO4GTYONCffNSlwg==", "dev": true, "requires": { "@types/pollyjs__persister": "*" } }, "@types/pollyjs__utils": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/@types/pollyjs__utils/-/pollyjs__utils-2.6.0.tgz", - "integrity": "sha512-2jP956xmnYBM7VWevpSonSiYutlbnl5nRrS/tuYz2eab4YczvkXI3yIgBzF83kqRmeg2nHB8T8WLlJNdu0ppBw==", + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/@types/pollyjs__utils/-/pollyjs__utils-2.6.1.tgz", + "integrity": "sha512-NYrw4j4QEBCGnjTBVqjQRszsdwoPhykW3hGz3IymFquEXGmeh5EvRgOwXmJE+FvJ9hdcG55UmLfTO6cJ7gzO5w==", "dev": true }, "@types/setup-polly-jest": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/@types/setup-polly-jest/-/setup-polly-jest-0.5.0.tgz", - "integrity": "sha512-adGkOa52Z/zU6gZ6oU7iUyS6BOmueFUjPIXrW0INNZPZqB5p68Q6dukWVk2bqVXwDUy3Cd6B/aADSouClwwmew==", + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/@types/setup-polly-jest/-/setup-polly-jest-0.5.1.tgz", + "integrity": "sha512-YNyz4ANZOtmZxQMQOU2q43jjacEGKWywDTL8CkIBSosmRL7HEgoelcI3GyXSrmlennCCmvC/NEenHYFSqYMg+A==", "dev": true, "requires": { "@types/pollyjs__core": "*" @@ -818,13 +812,13 @@ "dev": true }, "@typescript-eslint/eslint-plugin": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.2.0.tgz", - "integrity": "sha512-zBNRkzvLSwo6y5TG0DVcmshZIYBHKtmzD4N+LYnfTFpzc4bc79o8jNRSb728WV7A4Cegbs+MV5IRAj8BKBgOVQ==", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.4.0.tgz", + "integrity": "sha512-RVt5wU9H/2H+N/ZrCasTXdGbUTkbf7Hfi9eLiA8vPQkzUJ/bLDCC3CsoZioPrNcnoyN8r0gT153dC++A4hKBQQ==", "dev": true, "requires": { - "@typescript-eslint/experimental-utils": "4.2.0", - "@typescript-eslint/scope-manager": "4.2.0", + "@typescript-eslint/experimental-utils": "4.4.0", + "@typescript-eslint/scope-manager": "4.4.0", "debug": "^4.1.1", "functional-red-black-tree": "^1.0.1", "regexpp": "^3.0.0", @@ -833,55 +827,55 @@ } }, "@typescript-eslint/experimental-utils": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-4.2.0.tgz", - "integrity": "sha512-5BBj6BjgHEndBaQQpUVzRIPERz03LBc0MCQkHwUaH044FJFL08SwWv/sQftk7gf0ShZ2xZysz0LTwCwNt4Xu3w==", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-4.4.0.tgz", + "integrity": "sha512-01+OtK/oWeSJTjQcyzDztfLF1YjvKpLFo+JZmurK/qjSRcyObpIecJ4rckDoRCSh5Etw+jKfdSzVEHevh9gJ1w==", "dev": true, "requires": { "@types/json-schema": "^7.0.3", - "@typescript-eslint/scope-manager": "4.2.0", - "@typescript-eslint/types": "4.2.0", - "@typescript-eslint/typescript-estree": "4.2.0", + "@typescript-eslint/scope-manager": "4.4.0", + "@typescript-eslint/types": "4.4.0", + "@typescript-eslint/typescript-estree": "4.4.0", "eslint-scope": "^5.0.0", "eslint-utils": "^2.0.0" } }, "@typescript-eslint/parser": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-4.2.0.tgz", - "integrity": "sha512-54jJ6MwkOtowpE48C0QJF9iTz2/NZxfKVJzv1ha5imigzHbNSLN9yvbxFFH1KdlRPQrlR8qxqyOvLHHxd397VA==", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-4.4.0.tgz", + "integrity": "sha512-yc14iEItCxoGb7W4Nx30FlTyGpU9r+j+n1LUK/exlq2eJeFxczrz/xFRZUk2f6yzWfK+pr1DOTyQnmDkcC4TnA==", "dev": true, "requires": { - "@typescript-eslint/scope-manager": "4.2.0", - "@typescript-eslint/types": "4.2.0", - "@typescript-eslint/typescript-estree": "4.2.0", + "@typescript-eslint/scope-manager": "4.4.0", + "@typescript-eslint/types": "4.4.0", + "@typescript-eslint/typescript-estree": "4.4.0", "debug": "^4.1.1" } }, "@typescript-eslint/scope-manager": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-4.2.0.tgz", - "integrity": "sha512-Tb402cxxObSxWIVT+PnBp5ruT2V/36yj6gG4C9AjkgRlZpxrLAzWDk3neen6ToMBGeGdxtnfFLoJRUecGz9mYQ==", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-4.4.0.tgz", + "integrity": "sha512-r2FIeeU1lmW4K3CxgOAt8djI5c6Q/5ULAgdVo9AF3hPMpu0B14WznBAtxrmB/qFVbVIB6fSx2a+EVXuhSVMEyA==", "dev": true, "requires": { - "@typescript-eslint/types": "4.2.0", - "@typescript-eslint/visitor-keys": "4.2.0" + "@typescript-eslint/types": "4.4.0", + "@typescript-eslint/visitor-keys": "4.4.0" } }, "@typescript-eslint/types": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-4.2.0.tgz", - "integrity": "sha512-xkv5nIsxfI/Di9eVwN+G9reWl7Me9R5jpzmZUch58uQ7g0/hHVuGUbbn4NcxcM5y/R4wuJIIEPKPDb5l4Fdmwg==", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-4.4.0.tgz", + "integrity": "sha512-nU0VUpzanFw3jjX+50OTQy6MehVvf8pkqFcURPAE06xFNFenMj1GPEI6IESvp7UOHAnq+n/brMirZdR+7rCrlA==", "dev": true }, "@typescript-eslint/typescript-estree": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-4.2.0.tgz", - "integrity": "sha512-iWDLCB7z4MGkLipduF6EOotdHNtgxuNKnYD54nMS/oitFnsk4S3S/TE/UYXQTra550lHtlv9eGmp+dvN9pUDtA==", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-4.4.0.tgz", + "integrity": "sha512-Fh85feshKXwki4nZ1uhCJHmqKJqCMba+8ZicQIhNi5d5jSQFteWiGeF96DTjO8br7fn+prTP+t3Cz/a/3yOKqw==", "dev": true, "requires": { - "@typescript-eslint/types": "4.2.0", - "@typescript-eslint/visitor-keys": "4.2.0", + "@typescript-eslint/types": "4.4.0", + "@typescript-eslint/visitor-keys": "4.4.0", "debug": "^4.1.1", "globby": "^11.0.1", "is-glob": "^4.0.1", @@ -891,12 +885,12 @@ } }, "@typescript-eslint/visitor-keys": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-4.2.0.tgz", - "integrity": "sha512-WIf4BNOlFOH2W+YqGWa6YKLcK/EB3gEj2apCrqLw6mme1RzBy0jtJ9ewJgnrZDB640zfnv8L+/gwGH5sYp/rGw==", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-4.4.0.tgz", + "integrity": "sha512-oBWeroUZCVsHLiWRdcTXJB7s1nB3taFY8WGvS23tiAlT6jXVvsdAV4rs581bgdEjOhn43q6ro7NkOiLKu6kFqA==", "dev": true, "requires": { - "@typescript-eslint/types": "4.2.0", + "@typescript-eslint/types": "4.4.0", "eslint-visitor-keys": "^2.0.0" } }, @@ -1126,9 +1120,9 @@ } }, "acorn": { - "version": "7.4.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.0.tgz", - "integrity": "sha512-+G7P8jJmCHr+S+cLfQxygbWhXy+8YTVGzAkpEbcLo2mLoL7tij/VG41QSHACSf5QgYRhMZYHuNc6drJaO0Da+w==", + "version": "7.4.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz", + "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==", "dev": true }, "acorn-jsx": { @@ -1201,12 +1195,11 @@ "dev": true }, "ansi-styles": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz", - "integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, "requires": { - "@types/color-name": "^1.1.1", "color-convert": "^2.0.1" } }, @@ -1299,20 +1292,20 @@ }, "dependencies": { "es-abstract": { - "version": "1.17.6", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.6.tgz", - "integrity": "sha512-Fr89bON3WFyUi5EvAeI48QTWX0AyekGgLA8H+c+7fbfCkJwRWRMLd8CQedNEyJuoYYhmtEqY92pgte1FAhBlhw==", + "version": "1.17.7", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.7.tgz", + "integrity": "sha512-VBl/gnfcJ7OercKA9MVaegWsBHFjV492syMudcnQZvt/Dw8ezpcOHYZXa/J96O8vx+g4x65YKhxOwDUh63aS5g==", "dev": true, "requires": { "es-to-primitive": "^1.2.1", "function-bind": "^1.1.1", "has": "^1.0.3", "has-symbols": "^1.0.1", - "is-callable": "^1.2.0", - "is-regex": "^1.1.0", - "object-inspect": "^1.7.0", + "is-callable": "^1.2.2", + "is-regex": "^1.1.1", + "object-inspect": "^1.8.0", "object-keys": "^1.1.1", - "object.assign": "^4.1.0", + "object.assign": "^4.1.1", "string.prototype.trimend": "^1.0.1", "string.prototype.trimstart": "^1.0.1" } @@ -1342,20 +1335,20 @@ }, "dependencies": { "es-abstract": { - "version": "1.17.6", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.6.tgz", - "integrity": "sha512-Fr89bON3WFyUi5EvAeI48QTWX0AyekGgLA8H+c+7fbfCkJwRWRMLd8CQedNEyJuoYYhmtEqY92pgte1FAhBlhw==", + "version": "1.17.7", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.7.tgz", + "integrity": "sha512-VBl/gnfcJ7OercKA9MVaegWsBHFjV492syMudcnQZvt/Dw8ezpcOHYZXa/J96O8vx+g4x65YKhxOwDUh63aS5g==", "dev": true, "requires": { "es-to-primitive": "^1.2.1", "function-bind": "^1.1.1", "has": "^1.0.3", "has-symbols": "^1.0.1", - "is-callable": "^1.2.0", - "is-regex": "^1.1.0", - "object-inspect": "^1.7.0", + "is-callable": "^1.2.2", + "is-regex": "^1.1.1", + "object-inspect": "^1.8.0", "object-keys": "^1.1.1", - "object.assign": "^4.1.0", + "object.assign": "^4.1.1", "string.prototype.trimend": "^1.0.1", "string.prototype.trimstart": "^1.0.1" } @@ -1869,7 +1862,6 @@ "requires": { "anymatch": "~3.1.1", "braces": "~3.0.2", - "fsevents": "~2.1.2", "glob-parent": "~5.1.0", "is-binary-path": "~2.1.0", "is-glob": "~4.0.1", @@ -2655,21 +2647,21 @@ } }, "es-abstract": { - "version": "1.18.0-next.0", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.18.0-next.0.tgz", - "integrity": "sha512-elZXTZXKn51hUBdJjSZGYRujuzilgXo8vSPQzjGYXLvSlGiCo8VO8ZGV3kjo9a0WNJJ57hENagwbtlRuHuzkcQ==", + "version": "1.18.0-next.1", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.18.0-next.1.tgz", + "integrity": "sha512-I4UGspA0wpZXWENrdA0uHbnhte683t3qT/1VFH9aX2dA5PPSf6QW5HHXf5HImaqPmjXaVeVk4RGWnaylmV7uAA==", "dev": true, "requires": { "es-to-primitive": "^1.2.1", "function-bind": "^1.1.1", "has": "^1.0.3", "has-symbols": "^1.0.1", - "is-callable": "^1.2.0", + "is-callable": "^1.2.2", "is-negative-zero": "^2.0.0", "is-regex": "^1.1.1", "object-inspect": "^1.8.0", "object-keys": "^1.1.1", - "object.assign": "^4.1.0", + "object.assign": "^4.1.1", "string.prototype.trimend": "^1.0.1", "string.prototype.trimstart": "^1.0.1" } @@ -2704,9 +2696,9 @@ "dev": true }, "eslint": { - "version": "7.9.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.9.0.tgz", - "integrity": "sha512-V6QyhX21+uXp4T+3nrNfI3hQNBDa/P8ga7LoQOenwrlEFXrEnUEE+ok1dMtaS3b6rmLXhT1TkTIsG75HMLbknA==", + "version": "7.11.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.11.0.tgz", + "integrity": "sha512-G9+qtYVCHaDi1ZuWzBsOWo2wSwd70TXnU6UHA3cTYHp7gCTXZcpggWFoUVAMRarg68qtPoNfFbzPh+VdOgmwmw==", "dev": true, "requires": { "@babel/code-frame": "^7.0.0", @@ -2717,9 +2709,9 @@ "debug": "^4.0.1", "doctrine": "^3.0.0", "enquirer": "^2.3.5", - "eslint-scope": "^5.1.0", + "eslint-scope": "^5.1.1", "eslint-utils": "^2.1.0", - "eslint-visitor-keys": "^1.3.0", + "eslint-visitor-keys": "^2.0.0", "espree": "^7.3.0", "esquery": "^1.2.0", "esutils": "^2.0.2", @@ -2748,12 +2740,6 @@ "v8-compile-cache": "^2.0.3" }, "dependencies": { - "eslint-visitor-keys": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", - "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", - "dev": true - }, "ignore": { "version": "4.0.6", "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", @@ -2858,9 +2844,9 @@ } }, "eslint-plugin-import": { - "version": "2.22.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.22.0.tgz", - "integrity": "sha512-66Fpf1Ln6aIS5Gr/55ts19eUuoDhAbZgnr6UxK5hbDx6l/QgQgx61AePq+BV4PP2uXQFClgMVzep5zZ94qqsxg==", + "version": "2.22.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.22.1.tgz", + "integrity": "sha512-8K7JjINHOpH64ozkAhpT3sd+FswIZTfMZTjdx052pnWrgRCVfp8op9tbjpAk3DdUeI/Ba4C8OjdC0r90erHEOw==", "dev": true, "requires": { "array-includes": "^3.1.1", @@ -2868,7 +2854,7 @@ "contains-path": "^0.1.0", "debug": "^2.6.9", "doctrine": "1.5.0", - "eslint-import-resolver-node": "^0.3.3", + "eslint-import-resolver-node": "^0.3.4", "eslint-module-utils": "^2.6.0", "has": "^1.0.3", "minimatch": "^3.0.4", @@ -3734,13 +3720,6 @@ "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", "dev": true }, - "fsevents": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.1.3.tgz", - "integrity": "sha512-Auw9a4AxqWpa9GUfj370BMPzzyncfBABW8Mab7BGWBYDj4Isgq+cDKtx0i6u9jcX9pQDnswsaaOTgTmA5pEjuQ==", - "dev": true, - "optional": true - }, "function-bind": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", @@ -4061,9 +4040,9 @@ } }, "hasha": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/hasha/-/hasha-5.2.0.tgz", - "integrity": "sha512-2W+jKdQbAdSIrggA8Q35Br8qKadTrqCTC8+XZvBWepKDK6m9XkX6Iz1a2yh2KP01kzAR/dpuMeUnocoLYDcskw==", + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/hasha/-/hasha-5.2.2.tgz", + "integrity": "sha512-Hrp5vIK/xr5SkeN2onO32H0MgNZ0f17HRNH39WfL0SYUNOTZ5Lz1TJ8Pajo/87dYGEFlLMm7mIc/k/s6Bvz9HQ==", "dev": true, "requires": { "is-stream": "^2.0.0", @@ -5791,20 +5770,20 @@ }, "dependencies": { "es-abstract": { - "version": "1.17.6", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.6.tgz", - "integrity": "sha512-Fr89bON3WFyUi5EvAeI48QTWX0AyekGgLA8H+c+7fbfCkJwRWRMLd8CQedNEyJuoYYhmtEqY92pgte1FAhBlhw==", + "version": "1.17.7", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.7.tgz", + "integrity": "sha512-VBl/gnfcJ7OercKA9MVaegWsBHFjV492syMudcnQZvt/Dw8ezpcOHYZXa/J96O8vx+g4x65YKhxOwDUh63aS5g==", "dev": true, "requires": { "es-to-primitive": "^1.2.1", "function-bind": "^1.1.1", "has": "^1.0.3", "has-symbols": "^1.0.1", - "is-callable": "^1.2.0", - "is-regex": "^1.1.0", - "object-inspect": "^1.7.0", + "is-callable": "^1.2.2", + "is-regex": "^1.1.1", + "object-inspect": "^1.8.0", "object-keys": "^1.1.1", - "object.assign": "^4.1.0", + "object.assign": "^4.1.1", "string.prototype.trimend": "^1.0.1", "string.prototype.trimstart": "^1.0.1" } @@ -5833,20 +5812,20 @@ }, "dependencies": { "es-abstract": { - "version": "1.17.6", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.6.tgz", - "integrity": "sha512-Fr89bON3WFyUi5EvAeI48QTWX0AyekGgLA8H+c+7fbfCkJwRWRMLd8CQedNEyJuoYYhmtEqY92pgte1FAhBlhw==", + "version": "1.17.7", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.7.tgz", + "integrity": "sha512-VBl/gnfcJ7OercKA9MVaegWsBHFjV492syMudcnQZvt/Dw8ezpcOHYZXa/J96O8vx+g4x65YKhxOwDUh63aS5g==", "dev": true, "requires": { "es-to-primitive": "^1.2.1", "function-bind": "^1.1.1", "has": "^1.0.3", "has-symbols": "^1.0.1", - "is-callable": "^1.2.0", - "is-regex": "^1.1.0", - "object-inspect": "^1.7.0", + "is-callable": "^1.2.2", + "is-regex": "^1.1.1", + "object-inspect": "^1.8.0", "object-keys": "^1.1.1", - "object.assign": "^4.1.0", + "object.assign": "^4.1.1", "string.prototype.trimend": "^1.0.1", "string.prototype.trimstart": "^1.0.1" } @@ -7333,20 +7312,20 @@ }, "dependencies": { "es-abstract": { - "version": "1.17.6", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.6.tgz", - "integrity": "sha512-Fr89bON3WFyUi5EvAeI48QTWX0AyekGgLA8H+c+7fbfCkJwRWRMLd8CQedNEyJuoYYhmtEqY92pgte1FAhBlhw==", + "version": "1.17.7", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.7.tgz", + "integrity": "sha512-VBl/gnfcJ7OercKA9MVaegWsBHFjV492syMudcnQZvt/Dw8ezpcOHYZXa/J96O8vx+g4x65YKhxOwDUh63aS5g==", "dev": true, "requires": { "es-to-primitive": "^1.2.1", "function-bind": "^1.1.1", "has": "^1.0.3", "has-symbols": "^1.0.1", - "is-callable": "^1.2.0", - "is-regex": "^1.1.0", - "object-inspect": "^1.7.0", + "is-callable": "^1.2.2", + "is-regex": "^1.1.1", + "object-inspect": "^1.8.0", "object-keys": "^1.1.1", - "object.assign": "^4.1.0", + "object.assign": "^4.1.1", "string.prototype.trimend": "^1.0.1", "string.prototype.trimstart": "^1.0.1" } @@ -7364,20 +7343,20 @@ }, "dependencies": { "es-abstract": { - "version": "1.17.6", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.6.tgz", - "integrity": "sha512-Fr89bON3WFyUi5EvAeI48QTWX0AyekGgLA8H+c+7fbfCkJwRWRMLd8CQedNEyJuoYYhmtEqY92pgte1FAhBlhw==", + "version": "1.17.7", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.7.tgz", + "integrity": "sha512-VBl/gnfcJ7OercKA9MVaegWsBHFjV492syMudcnQZvt/Dw8ezpcOHYZXa/J96O8vx+g4x65YKhxOwDUh63aS5g==", "dev": true, "requires": { "es-to-primitive": "^1.2.1", "function-bind": "^1.1.1", "has": "^1.0.3", "has-symbols": "^1.0.1", - "is-callable": "^1.2.0", - "is-regex": "^1.1.0", - "object-inspect": "^1.7.0", + "is-callable": "^1.2.2", + "is-regex": "^1.1.1", + "object-inspect": "^1.8.0", "object-keys": "^1.1.1", - "object.assign": "^4.1.0", + "object.assign": "^4.1.1", "string.prototype.trimend": "^1.0.1", "string.prototype.trimstart": "^1.0.1" } @@ -7857,9 +7836,9 @@ } }, "tslib": { - "version": "1.13.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.13.0.tgz", - "integrity": "sha512-i/6DQjL8Xf3be4K/E6Wgpekn5Qasl1usyw++dAA35Ue5orEn65VIxOA+YvNNl9HV3qv70T7CNwjODHZrLwvd1Q==", + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", "dev": true }, "tsutils": { @@ -8247,7 +8226,6 @@ "anymatch": "^2.0.0", "async-each": "^1.0.1", "braces": "^2.3.2", - "fsevents": "^1.2.7", "glob-parent": "^3.1.0", "inherits": "^2.0.3", "is-binary-path": "^1.0.0", @@ -8283,13 +8261,6 @@ } } }, - "fsevents": { - "version": "1.2.13", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.13.tgz", - "integrity": "sha512-oWb1Z6mkHIskLzEJ/XWX0srkpkTQ7vaopMQkyaEIoq0fmtFVxOthb8cCxeT+p3ynTdkk/RZwbgG4brR5BeWECw==", - "dev": true, - "optional": true - }, "glob-parent": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz", @@ -8424,9 +8395,9 @@ }, "dependencies": { "acorn": { - "version": "6.4.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.4.1.tgz", - "integrity": "sha512-ZVA9k326Nwrj3Cj9jlh3wGFutC2ZornPNARZwsNYqQYgN0EsV2d53w5RN/co65Ohn4sUAUtb1rSUAOD6XN9idA==", + "version": "6.4.2", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.4.2.tgz", + "integrity": "sha512-XtGIhXwF8YM8bJhGxG5kXgjkEuNGLTkoYqVE+KMR+aspr4KGYmKYg7yUe3KghyQ9yheNwLnjmzh/7+gfDBmHCQ==", "dev": true }, "braces": { @@ -8808,9 +8779,9 @@ } }, "webpack-merge": { - "version": "5.1.4", - "resolved": "https://registry.npmjs.org/webpack-merge/-/webpack-merge-5.1.4.tgz", - "integrity": "sha512-LSmRD59mxREGkCBm9PCW3AaV4doDqxykGlx1NvioEE0FgkT2GQI54Wyvg39ptkiq2T11eRVoV39udNPsQvK+QQ==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/webpack-merge/-/webpack-merge-5.2.0.tgz", + "integrity": "sha512-QBglJBg5+lItm3/Lopv8KDDK01+hjdg2azEwi/4vKJ8ZmGPdtJsTpjtNNOW3a4WiqzXdCATtTudOZJngE7RKkA==", "dev": true, "requires": { "clone-deep": "^4.0.1", From 2fac41a844561869077159729b09185dd3f9821b Mon Sep 17 00:00:00 2001 From: Alan Poulain Date: Sat, 10 Oct 2020 17:44:41 +0200 Subject: [PATCH 52/56] 0.7.0 --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 9d07ee1..d0af6af 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "universal-geocoder", - "version": "0.6.0", + "version": "0.7.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 75f10c9..56cc12e 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "universal-geocoder", "description": "Universal geocoding abstraction with multiple built-in providers", - "version": "0.6.0", + "version": "0.7.0", "keywords": [ "geocoder", "geocoding", From 2ff49f215917f5387281bda2fb097dd4fcde34d3 Mon Sep 17 00:00:00 2001 From: Alan Poulain Date: Thu, 29 Oct 2020 16:41:35 +0100 Subject: [PATCH 53/56] feat: fuzzyMatch parameter for Mapbox geocode --- CHANGELOG.md | 14 +- docs/provider_usage.md | 6 + docs/provider_usage/mapbox.md | 1 + spec/provider/MapboxProvider.spec.ts | 31 ++ .../recording.har | 320 ++++++++++++++++++ src/provider/mapbox/MapboxGeocodeQuery.ts | 14 + src/provider/mapbox/MapboxProvider.ts | 10 +- 7 files changed, 390 insertions(+), 6 deletions(-) create mode 100644 spec/recordings/Mapbox-Geocoder-Provider_114047645/receives-correct-geocoding-results-with-and-without-fuzzy-match_4136676680/recording.har diff --git a/CHANGELOG.md b/CHANGELOG.md index c82b382..7f0c32c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,14 +1,18 @@ # Changelog +## 0.8.0 + +* [Mapbox] Add `fuzzyMatch` geocode parameter + ## 0.7.0 * [Yandex] Better Yandex provider * [Nominatim] Remove `viewBox` parameter in `GeocodeQuery` to use `bounds` instead -* [GeoJsonDumper] Use `bbox` member for `bounds`. -* The `bounds` parameter in `GeocodeQuery` is now an object with `latitudeSW`, `longitudeSW`, `latitudeNE`, `longitudeNE` keys. -* The `latitude` and `longitude` parameters in `GeocodeQuery` are replaced by a `coordinates` parameter (an object with `latitude` and `longitude` keys). -* `Geocoded` returns an object with `latitudeSW`, `longitudeSW`, `latitudeNE`, `longitudeNE` keys for the `bounds`. -* The `latitude` and `longitude` parameters in `Geocoded` are replaced by a `coordinates` parameter (an object with `latitude` and `longitude` keys). +* [GeoJsonDumper] Use `bbox` member for `bounds` +* The `bounds` parameter in `GeocodeQuery` is now an object with `latitudeSW`, `longitudeSW`, `latitudeNE`, `longitudeNE` keys +* The `latitude` and `longitude` parameters in `GeocodeQuery` are replaced by a `coordinates` parameter (an object with `latitude` and `longitude` keys) +* `Geocoded` returns an object with `latitudeSW`, `longitudeSW`, `latitudeNE`, `longitudeNE` keys for the `bounds` +* The `latitude` and `longitude` parameters in `Geocoded` are replaced by a `coordinates` parameter (an object with `latitude` and `longitude` keys) ## 0.6.0 diff --git a/docs/provider_usage.md b/docs/provider_usage.md index 77b932f..c0c5b5d 100644 --- a/docs/provider_usage.md +++ b/docs/provider_usage.md @@ -95,6 +95,12 @@ Here is a table listing the parameters according to the providers: Bias or filter the response to favor results that are closer to the specified location Mapbox, OpenCage, Yandex + + geocode + fuzzyMatch + Should approximate the request terms or do an exact matching + Mapbox + geocode span diff --git a/docs/provider_usage/mapbox.md b/docs/provider_usage/mapbox.md index e7d02c0..053ea81 100644 --- a/docs/provider_usage/mapbox.md +++ b/docs/provider_usage/mapbox.md @@ -9,6 +9,7 @@ - `countryCodes`: to restrict the results to one or more countries (ISO 3166 alpha 2 country codes) - `proximity` (object with `latitude` and `longitude` keys): to bias the response to favor results that are closer to the specified location +- `fuzzyMatch`: to approximate the request terms or do an exact matching - `locationTypes` (possible values: "country", "region", "postcode", "district", "place", "locality", "neighborhood", "address", "poi"): to filter the results to a subset of location types ## `geodecode` parameters diff --git a/spec/provider/MapboxProvider.spec.ts b/spec/provider/MapboxProvider.spec.ts index 22f951a..ce4b432 100644 --- a/spec/provider/MapboxProvider.spec.ts +++ b/spec/provider/MapboxProvider.spec.ts @@ -82,6 +82,37 @@ describe("Mapbox Geocoder Provider", () => { }); }); + it("receives correct geocoding results with and without fuzzy match", (done) => { + const provider = UniversalGeocoder.createGeocoder({ + provider: "mapbox", + useSsl: true, + apiKey: "api_key", + }); + let numberResultsWithFuzzyMatch = -1; + let numberResultsWithoutFuzzyMatch = -1; + + const assertion = () => + expect(numberResultsWithFuzzyMatch).toBeGreaterThan( + numberResultsWithoutFuzzyMatch + ); + + provider?.geocode({ text: "wahsington", fuzzyMatch: true }, (results) => { + numberResultsWithFuzzyMatch = results.length; + if (numberResultsWithoutFuzzyMatch !== -1) { + assertion(); + done(); + } + }); + + provider?.geocode({ text: "wahsington", fuzzyMatch: false }, (results) => { + numberResultsWithoutFuzzyMatch = results.length; + if (numberResultsWithFuzzyMatch !== -1) { + assertion(); + done(); + } + }); + }); + it("receives correct geodecoding results", (done) => { const provider = UniversalGeocoder.createGeocoder({ provider: "mapbox", diff --git a/spec/recordings/Mapbox-Geocoder-Provider_114047645/receives-correct-geocoding-results-with-and-without-fuzzy-match_4136676680/recording.har b/spec/recordings/Mapbox-Geocoder-Provider_114047645/receives-correct-geocoding-results-with-and-without-fuzzy-match_4136676680/recording.har new file mode 100644 index 0000000..5284297 --- /dev/null +++ b/spec/recordings/Mapbox-Geocoder-Provider_114047645/receives-correct-geocoding-results-with-and-without-fuzzy-match_4136676680/recording.har @@ -0,0 +1,320 @@ +{ + "log": { + "_recordingName": "Mapbox Geocoder Provider/receives correct geocoding results with and without fuzzy match", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "5.0.0" + }, + "entries": [ + { + "_id": "354da0ca17937575ecb6f1f74508c349", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + }, + { + "_fromType": "array", + "name": "user-agent", + "value": "node-fetch/1.0 (+https://github.com/bitinn/node-fetch)" + }, + { + "_fromType": "array", + "name": "accept-encoding", + "value": "gzip,deflate" + }, + { + "_fromType": "array", + "name": "connection", + "value": "close" + }, + { + "name": "host", + "value": "api.mapbox.com" + } + ], + "headersSize": 368, + "httpVersion": "HTTP/1.1", + "method": "GET", + "queryString": [ + { + "name": "fuzzyMatch", + "value": "false" + }, + { + "name": "limit", + "value": "5" + } + ], + "url": "https://api.mapbox.com/geocoding/v5/mapbox.places/wahsington.json?fuzzyMatch=false&limit=5" + }, + "response": { + "bodySize": 1631, + "content": { + "_isBinary": true, + "mimeType": "application/vnd.geo+json; charset=utf-8", + "size": 1631, + "text": "[\"1f8b0800000000000003\",\"b555ed6a1b39147d1531bf5a98cafa1acd8cff15d340caa6ede284a59412e4192556634b534913d70d79a07d8d7db2bdb2eb8ceb24a429148cc177ce3de77e1dcf4d16d79dcec6d99156b1f77ae2160bdd44e36c96675f7bedd7d9f853b652f360ec6584e8e73cbbd842033cb9c94c0bc9aa6de177c0b2ae782d0ac919154232061c3fd343a05ba8469f6fc39f769989d6eb85be56b681380598779df6d124999b4c354def5503c564217aad63760bd4fa5b84c03f2accb7c5a1e9f6d94ec4aaa57e0890a3896e95477fa92b9da363db1a65151292139ea3336ba26e01a92268e7d952c526a59fdfc9ed660198fde7079a7ba867e935da46ed6136afaa120bc189a0652e28e6152919a9605097da2d754c9bb9d98df783333615d338e75b6337548f32dc269cddb6b3dba0d5e6723e737eee5c8b392d4a92dd0d78e2dc15ccfb07b2732136aed59895bc92052d521bb22ef612369ded65a4c1604a199525ad28254c10f806fcca5c99564505a0bf192b58cdf665ef663650797d09a789d38d1585ac49554a29c8211515b48050983b1fcf53ad103c9bbe3a7e3790ff58c2c0dcb8dec24c31ad655955a448575c32561f727372c8dc8781f6e765de7ebea3df39a462b564a4a4b2a80a42b8f85d87105c3dc72353d7c7397ad2298fc072f4517d770e4d4c5ce7e8c484903e5d6710af692d9ef6cc14fd9a6b0e70cfd61dbc53130c47c04b2273ce702538a7523ccb3b0f333ce91d56b2aa16c345bc755687e856f601075130645df252820e9595dc3bfe4d83f72c4458919cc604a38cc87bb709ffbe156703c930bd7b0eaa685dd7043a2a4b2e85b8efa04d0f870e3a990ee47bebf8e32e82c5a918bd99f59b37d3387bf7fef478f2668cfefb1731c2083a51ddcc7d43cab6c8c48042df750ba37dc0e8f562813cec07a26023edaf758bd159d0c85da0383701a592904939b32ff0e643d1415cef184fb55f86849d42aa69347a318fb10be3d168b55ae1e506841bb71ca91978670481307a89d1696206bdce59904a65254e632f9c87cb871ea04c940e49191bd052ad917511cd34e4a450aaf1c3fbe317e125028f5f9b16a6315ba323d7fbf0b5575ee3ecf67fc34e93a5ba070000\"]" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/vnd.geo+json; charset=utf-8" + }, + { + "name": "transfer-encoding", + "value": "chunked" + }, + { + "name": "connection", + "value": "close" + }, + { + "name": "date", + "value": "Thu, 29 Oct 2020 15:19:03 GMT" + }, + { + "name": "x-powered-by", + "value": "Express" + }, + { + "name": "access-control-allow-origin", + "value": "*" + }, + { + "name": "access-control-expose-headers", + "value": "x-rate-limit-interval,x-rate-limit-limit,x-rate-limit-remaining,x-rate-limit-reset" + }, + { + "name": "cache-control", + "value": "max-age=604800" + }, + { + "name": "x-rate-limit-limit", + "value": "600" + }, + { + "name": "x-rate-limit-interval", + "value": "60" + }, + { + "name": "x-rate-limit-reset", + "value": "1603984803" + }, + { + "name": "last-modified", + "value": "Wed, 28 Oct 2020 10:22:29 GMT" + }, + { + "name": "etag", + "value": "\"fde07e5da194bfd951367f90138daa9a\"" + }, + { + "name": "content-encoding", + "value": "gzip" + }, + { + "name": "vary", + "value": "Accept-Encoding" + }, + { + "name": "x-cache", + "value": "Miss from cloudfront" + }, + { + "name": "via", + "value": "1.1 32ceb5729c4d415c2eb5bbab5ff21b8f.cloudfront.net (CloudFront)" + }, + { + "name": "x-amz-cf-pop", + "value": "CDG3-C2" + }, + { + "name": "x-amz-cf-id", + "value": "OShsj-DnMREMKlFs6Nb-c_Os4mMzYk5Jl_lYlDfD-zNTw6jdaS7mWw==" + } + ], + "headersSize": 757, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2020-10-29T15:19:03.143Z", + "time": 75, + "timings": { + "blocked": -1, + "connect": -1, + "dns": -1, + "receive": 0, + "send": 0, + "ssl": -1, + "wait": 75 + } + }, + { + "_id": "381b4a2eab2448ad59afb59f8f3c3291", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + }, + { + "_fromType": "array", + "name": "user-agent", + "value": "node-fetch/1.0 (+https://github.com/bitinn/node-fetch)" + }, + { + "_fromType": "array", + "name": "accept-encoding", + "value": "gzip,deflate" + }, + { + "_fromType": "array", + "name": "connection", + "value": "close" + }, + { + "name": "host", + "value": "api.mapbox.com" + } + ], + "headersSize": 367, + "httpVersion": "HTTP/1.1", + "method": "GET", + "queryString": [ + { + "name": "fuzzyMatch", + "value": "true" + }, + { + "name": "limit", + "value": "5" + } + ], + "url": "https://api.mapbox.com/geocoding/v5/mapbox.places/wahsington.json?fuzzyMatch=true&limit=5" + }, + "response": { + "bodySize": 2458, + "content": { + "_isBinary": true, + "mimeType": "application/vnd.geo+json; charset=utf-8", + "size": 2458, + "text": "[\"1f8b0800000000000003bd57db6edb3810fd15424f2da030bc5ff256a45b34c0f686a6e8164551d0121b73638bae44e582201fb4bfb15fb643398eaf49d60fed8b610d6786e4396766a49b225dcf7c7154bcf22ef5ad3f8e9389af52884d51163f7bdf5e17475f8b4b37ee427396c0faad2c7ecc5d3b58b929420dc1aeaee1b9c3ca1a6e85549c5121146390633d3d18661357f9ef73f3d745644edbfa89bf704d05760a6e6d9cf93685bccd4de1aaaa6f5d058729bad47a9f8a5b48edaf12183ebb6e3c3f1cfa385f5b6cd2b8a9dfe550a2635fbb16fde9ce7d894e9a3ab8c621a138e125fad484e46bf07409f62e8ba94b550eff7ebfdd020bf0595ddfd873c56baffd2adf24df0236074663213811549782626e8866c40050673e4e7dcaccdc2ce07d1f43930f53c5d8d6a119523d98e136fb35f3eb2c186c7c381b8f623b8eb1c69c4a4d8a7b808f633c07bcef3c67b14b55ac3d669a1b25a9ccd75056ae040c375b89c8c0604a19559a1a4a0913047ec1ff329c87da25074e1f1893ccb2d56def315ba66afd194813678d49a92c315a2941365351412598ba716cd3f77c56307efa7870f27699fc8e8465e62af60d608aa955da1822b38a3563763337279b99fb6e99769dccdb6f5b07d7946bab84d54c2832c7ecf10299076ed407c1566e96c81a008cf11d007c7eb1b36c1eae976d758e46f12a2b8b32818d62d46a6315d0510a89a5e012c8205433a9ca034a15b654114d943282818bc5044420803605b465292fc54e19c1c40a9080240ac02f85c104fe03134cf1bd54ff44aa5df2ffc5eccf2b402bcd052586d3ff4bfef0b427f78aee4df2cb004d355409c51f0806403f1d05f730f55a432d5bad8895f942ace4066b4ba5847e501e68209d586e69365b2ba584a735a6211e1a86caebc6cabd98dd08ddc5e45da15101d40b92d566b5e56c8b4829a936744791bc3c5e12ba0b98dfd632d65a32b31a26ead38a590d7a5a383b87e8eb9c22758f4cd13b8f12bd71cdd8a5e440436ffd25fa12dbf3e53f4409e13b06dcbd8e381c083ab82d05c18669a9583918a1ab303518415f4aad8b07d6a1cb0cab92d0fdd4b311bb4b3ef7d3cd4253b3d0ae24175c13b13297866b2d553089959b840432600a5a2133b903726de4d654a2ccda659a7becb606a5641a26b5d144c2a4905bd34dad9c6581f5d684a45099d6428796d4400deaadc370237688ffed97c772ff5ec1134bf96f11fc8b0bdff41e0a3cf308e0a103f4c64f631bdc04bd7700c0c395f05468895ec7be1b9aeca9bf721dd29a10fd704d58890154c275c92cd6a03dabcb6ce4302e61906563d6255bab89bc6ea51956f57ea37223f4d18aa054729d6509ad5e51b55a12c3ad36750caf03ca3066ac811702b1ad40788393cb1477386d0b9959653495265722135baf8d5470bb43c8a77f2d530fc8ff721503ee50ce6d18f5c3d713d4cfbbd393e33f8ed0bfff2046188166390396916b6a145287ba7e369b04df7618bd984c503bb454041f43bebdf035469f3a9fc74e1a870ee523a19063467fc3d7194a11ec7e91f1d4b7d32efb7e84d05079f46c9cd2ac3b3a3cbcbcbcc4d3c10957717ae846b14f8760e80e9f63749a33c37eb3d8c056f9583967687ec416be69b2984342590e2e341d9aba6bd4c484461e62b2299ff1fdbb9367dd73042576116a4063748d5ec5beed7ef6aef5b8b8fd0ffab35d1f5e0e0000\"]" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/vnd.geo+json; charset=utf-8" + }, + { + "name": "transfer-encoding", + "value": "chunked" + }, + { + "name": "connection", + "value": "close" + }, + { + "name": "date", + "value": "Thu, 29 Oct 2020 15:19:03 GMT" + }, + { + "name": "x-powered-by", + "value": "Express" + }, + { + "name": "access-control-allow-origin", + "value": "*" + }, + { + "name": "access-control-expose-headers", + "value": "x-rate-limit-interval,x-rate-limit-limit,x-rate-limit-remaining,x-rate-limit-reset" + }, + { + "name": "cache-control", + "value": "max-age=604800" + }, + { + "name": "x-rate-limit-limit", + "value": "600" + }, + { + "name": "x-rate-limit-interval", + "value": "60" + }, + { + "name": "x-rate-limit-reset", + "value": "1603984803" + }, + { + "name": "last-modified", + "value": "Wed, 28 Oct 2020 10:22:29 GMT" + }, + { + "name": "etag", + "value": "\"fde07e5da194bfd951367f90138daa9a\"" + }, + { + "name": "content-encoding", + "value": "gzip" + }, + { + "name": "vary", + "value": "Accept-Encoding" + }, + { + "name": "x-cache", + "value": "Miss from cloudfront" + }, + { + "name": "via", + "value": "1.1 4448f6f0cf46259e83792c753f97a4df.cloudfront.net (CloudFront)" + }, + { + "name": "x-amz-cf-pop", + "value": "CDG3-C2" + }, + { + "name": "x-amz-cf-id", + "value": "N3XTfGuEAA_H4ay29FVfKDcThiiTrVcmqR68-fPSlNaSyt2d5ln9LQ==" + } + ], + "headersSize": 757, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2020-10-29T15:19:03.143Z", + "time": 109, + "timings": { + "blocked": -1, + "connect": -1, + "dns": -1, + "receive": 0, + "send": 0, + "ssl": -1, + "wait": 109 + } + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/src/provider/mapbox/MapboxGeocodeQuery.ts b/src/provider/mapbox/MapboxGeocodeQuery.ts index f71e209..ace9b07 100644 --- a/src/provider/mapbox/MapboxGeocodeQuery.ts +++ b/src/provider/mapbox/MapboxGeocodeQuery.ts @@ -5,6 +5,7 @@ export interface MapboxGeocodeQueryObject extends GeocodeQueryObject { readonly countryCodes?: string[]; readonly proximity?: Coordinates; readonly locationTypes?: string[]; + readonly fuzzyMatch?: boolean; } export default class MapboxGeocodeQuery extends GeocodeQuery { @@ -14,10 +15,13 @@ export default class MapboxGeocodeQuery extends GeocodeQuery { private readonly locationTypes?: string[]; + private readonly fuzzyMatch?: boolean; + protected constructor({ countryCodes, proximity, locationTypes, + fuzzyMatch, ...geocodeQueryObject }: MapboxGeocodeQueryObject) { super(geocodeQueryObject); @@ -29,6 +33,7 @@ export default class MapboxGeocodeQuery extends GeocodeQuery { } this.proximity = proximity; this.locationTypes = locationTypes; + this.fuzzyMatch = fuzzyMatch; } public static create(object: MapboxGeocodeQueryObject): MapboxGeocodeQuery { @@ -41,6 +46,7 @@ export default class MapboxGeocodeQuery extends GeocodeQuery { countryCodes: this.countryCodes, proximity: this.proximity, locationTypes: this.locationTypes, + fuzzyMatch: this.fuzzyMatch, }; } @@ -67,4 +73,12 @@ export default class MapboxGeocodeQuery extends GeocodeQuery { public getLocationTypes(): undefined | string[] { return this.locationTypes; } + + public withFuzzyMatch(fuzzyMatch: boolean): MapboxGeocodeQuery { + return new MapboxGeocodeQuery({ ...this.toObject(), fuzzyMatch }); + } + + public getFuzzyMatch(): undefined | boolean { + return this.fuzzyMatch; + } } diff --git a/src/provider/mapbox/MapboxProvider.ts b/src/provider/mapbox/MapboxProvider.ts index 82cf14b..e7f7fff 100644 --- a/src/provider/mapbox/MapboxProvider.ts +++ b/src/provider/mapbox/MapboxProvider.ts @@ -28,6 +28,7 @@ interface MapboxRequestParams { readonly language?: string; readonly limit?: string; readonly bbox?: string; + readonly fuzzyMatch?: string; readonly proximity?: string; readonly reverseMode?: "distance" | "score"; readonly types?: string; @@ -163,6 +164,9 @@ export default class MapboxProvider }/${geocodeQuery.getText()}.json`, }); + const fuzzyMatch = (geocodeQuery).getFuzzyMatch() + ? "true" + : "false"; const params: MapboxRequestParams = this.withCommonParams( { bbox: geocodeQuery.getBounds() @@ -172,6 +176,10 @@ export default class MapboxProvider geocodeQuery.getBounds()?.latitudeNE }` : undefined, + fuzzyMatch: + (geocodeQuery).getFuzzyMatch() !== undefined + ? fuzzyMatch + : undefined, proximity: (geocodeQuery).getProximity() ? `${(geocodeQuery).getProximity()?.longitude},${ (geocodeQuery).getProximity()?.latitude @@ -238,7 +246,7 @@ export default class MapboxProvider private withCommonParams( params: Pick< MapboxRequestParams, - "bbox" | "proximity" | "reverseMode" | "types" + "bbox" | "fuzzyMatch" | "proximity" | "reverseMode" | "types" >, query: MapboxGeocodeQuery | MapboxReverseQuery ): MapboxRequestParams { From eed7e29918f6fac867338f9376c71cc42a4b9991 Mon Sep 17 00:00:00 2001 From: Alan Poulain Date: Thu, 29 Oct 2020 16:46:55 +0100 Subject: [PATCH 54/56] chore: bump dev dependencies --- package-lock.json | 3936 ++++++--------------------------------------- package.json | 4 +- 2 files changed, 536 insertions(+), 3404 deletions(-) diff --git a/package-lock.json b/package-lock.json index d0af6af..df0a9db 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,19 +14,19 @@ } }, "@babel/core": { - "version": "7.11.6", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.11.6.tgz", - "integrity": "sha512-Wpcv03AGnmkgm6uS6k8iwhIwTrcP0m17TL1n1sy7qD0qelDu4XNeW0dN0mHfa+Gei211yDaLoEe/VlbXQzM4Bg==", + "version": "7.12.3", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.12.3.tgz", + "integrity": "sha512-0qXcZYKZp3/6N2jKYVxZv0aNCsxTSVCiK72DTiTYZAu7sjg73W0/aynWjMbiGd87EQL4WyA8reiJVh92AVla9g==", "dev": true, "requires": { "@babel/code-frame": "^7.10.4", - "@babel/generator": "^7.11.6", - "@babel/helper-module-transforms": "^7.11.0", - "@babel/helpers": "^7.10.4", - "@babel/parser": "^7.11.5", + "@babel/generator": "^7.12.1", + "@babel/helper-module-transforms": "^7.12.1", + "@babel/helpers": "^7.12.1", + "@babel/parser": "^7.12.3", "@babel/template": "^7.10.4", - "@babel/traverse": "^7.11.5", - "@babel/types": "^7.11.5", + "@babel/traverse": "^7.12.1", + "@babel/types": "^7.12.1", "convert-source-map": "^1.7.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.1", @@ -55,12 +55,12 @@ } }, "@babel/generator": { - "version": "7.11.6", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.11.6.tgz", - "integrity": "sha512-DWtQ1PV3r+cLbySoHrwn9RWEgKMBLLma4OBQloPRyDYvc5msJM9kvTLo1YnlJd1P/ZuKbdli3ijr5q3FvAF3uA==", + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.12.1.tgz", + "integrity": "sha512-DB+6rafIdc9o72Yc3/Ph5h+6hUjeOp66pF0naQBgUFFuPqzQwIlPTm3xZR7YNvduIMtkDIj2t21LSQwnbCrXvg==", "dev": true, "requires": { - "@babel/types": "^7.11.5", + "@babel/types": "^7.12.1", "jsesc": "^2.5.1", "source-map": "^0.5.0" } @@ -86,35 +86,37 @@ } }, "@babel/helper-member-expression-to-functions": { - "version": "7.11.0", - "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.11.0.tgz", - "integrity": "sha512-JbFlKHFntRV5qKw3YC0CvQnDZ4XMwgzzBbld7Ly4Mj4cbFy3KywcR8NtNctRToMWJOVvLINJv525Gd6wwVEx/Q==", + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.12.1.tgz", + "integrity": "sha512-k0CIe3tXUKTRSoEx1LQEPFU9vRQfqHtl+kf8eNnDqb4AUJEy5pz6aIiog+YWtVm2jpggjS1laH68bPsR+KWWPQ==", "dev": true, "requires": { - "@babel/types": "^7.11.0" + "@babel/types": "^7.12.1" } }, "@babel/helper-module-imports": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.10.4.tgz", - "integrity": "sha512-nEQJHqYavI217oD9+s5MUBzk6x1IlvoS9WTPfgG43CbMEeStE0v+r+TucWdx8KFGowPGvyOkDT9+7DHedIDnVw==", + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.12.1.tgz", + "integrity": "sha512-ZeC1TlMSvikvJNy1v/wPIazCu3NdOwgYZLIkmIyAsGhqkNpiDoQQRmaCK8YP4Pq3GPTLPV9WXaPCJKvx06JxKA==", "dev": true, "requires": { - "@babel/types": "^7.10.4" + "@babel/types": "^7.12.1" } }, "@babel/helper-module-transforms": { - "version": "7.11.0", - "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.11.0.tgz", - "integrity": "sha512-02EVu8COMuTRO1TAzdMtpBPbe6aQ1w/8fePD2YgQmxZU4gpNWaL9gK3Jp7dxlkUlUCJOTaSeA+Hrm1BRQwqIhg==", + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.12.1.tgz", + "integrity": "sha512-QQzehgFAZ2bbISiCpmVGfiGux8YVFXQ0abBic2Envhej22DVXV9nCFaS5hIQbkyo1AdGb+gNME2TSh3hYJVV/w==", "dev": true, "requires": { - "@babel/helper-module-imports": "^7.10.4", - "@babel/helper-replace-supers": "^7.10.4", - "@babel/helper-simple-access": "^7.10.4", + "@babel/helper-module-imports": "^7.12.1", + "@babel/helper-replace-supers": "^7.12.1", + "@babel/helper-simple-access": "^7.12.1", "@babel/helper-split-export-declaration": "^7.11.0", + "@babel/helper-validator-identifier": "^7.10.4", "@babel/template": "^7.10.4", - "@babel/types": "^7.11.0", + "@babel/traverse": "^7.12.1", + "@babel/types": "^7.12.1", "lodash": "^4.17.19" } }, @@ -128,25 +130,24 @@ } }, "@babel/helper-replace-supers": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.10.4.tgz", - "integrity": "sha512-sPxZfFXocEymYTdVK1UNmFPBN+Hv5mJkLPsYWwGBxZAxaWfFu+xqp7b6qWD0yjNuNL2VKc6L5M18tOXUP7NU0A==", + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.12.1.tgz", + "integrity": "sha512-zJjTvtNJnCFsCXVi5rUInstLd/EIVNmIKA1Q9ynESmMBWPWd+7sdR+G4/wdu+Mppfep0XLyG2m7EBPvjCeFyrw==", "dev": true, "requires": { - "@babel/helper-member-expression-to-functions": "^7.10.4", + "@babel/helper-member-expression-to-functions": "^7.12.1", "@babel/helper-optimise-call-expression": "^7.10.4", - "@babel/traverse": "^7.10.4", - "@babel/types": "^7.10.4" + "@babel/traverse": "^7.12.1", + "@babel/types": "^7.12.1" } }, "@babel/helper-simple-access": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.10.4.tgz", - "integrity": "sha512-0fMy72ej/VEvF8ULmX6yb5MtHG4uH4Dbd6I/aHDb/JVg0bbivwt9Wg+h3uMvX+QSFtwr5MeItvazbrc4jtRAXw==", + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.12.1.tgz", + "integrity": "sha512-OxBp7pMrjVewSSC8fXDFrHrBcJATOOFssZwv16F3/6Xtc138GHybBfPbm9kfiqQHKhYQrlamWILwlDCeyMFEaA==", "dev": true, "requires": { - "@babel/template": "^7.10.4", - "@babel/types": "^7.10.4" + "@babel/types": "^7.12.1" } }, "@babel/helper-split-export-declaration": { @@ -165,14 +166,14 @@ "dev": true }, "@babel/helpers": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.10.4.tgz", - "integrity": "sha512-L2gX/XeUONeEbI78dXSrJzGdz4GQ+ZTA/aazfUsFaWjSe95kiCuOZ5HsXvkiw3iwF+mFHSRUfJU8t6YavocdXA==", + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.12.1.tgz", + "integrity": "sha512-9JoDSBGoWtmbay98efmT2+mySkwjzeFeAL9BuWNoVQpkPFQF8SIIFUfY5os9u8wVzglzoiPRSW7cuJmBDUt43g==", "dev": true, "requires": { "@babel/template": "^7.10.4", - "@babel/traverse": "^7.10.4", - "@babel/types": "^7.10.4" + "@babel/traverse": "^7.12.1", + "@babel/types": "^7.12.1" } }, "@babel/highlight": { @@ -239,15 +240,15 @@ } }, "@babel/parser": { - "version": "7.11.5", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.11.5.tgz", - "integrity": "sha512-X9rD8qqm695vgmeaQ4fvz/o3+Wk4ZzQvSHkDBgpYKxpD4qTAUm88ZKtHkVqIOsYFFbIQ6wQYhC6q7pjqVK0E0Q==", + "version": "7.12.3", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.12.3.tgz", + "integrity": "sha512-kFsOS0IbsuhO5ojF8Hc8z/8vEIOkylVBrjiZUbLTE3XFe0Qi+uu6HjzQixkFaqr0ZPAMZcBVxEwmsnsLPZ2Xsw==", "dev": true }, "@babel/runtime": { - "version": "7.11.2", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.11.2.tgz", - "integrity": "sha512-TeWkU52so0mPtDcaCTxNBI/IHiz0pZgr8VEFqXFtZWpYD08ZB6FaSwVAS8MKRQAP3bYKiVjwysOJgMFY28o6Tw==", + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.12.1.tgz", + "integrity": "sha512-J5AIf3vPj3UwXaAzb5j1xM4WAQDX3EMgemF8rjCP3SoW09LfRKAXQKt6CoVYl230P6iWdRcBbnLDDdnqWxZSCA==", "dev": true, "requires": { "regenerator-runtime": "^0.13.4" @@ -265,17 +266,17 @@ } }, "@babel/traverse": { - "version": "7.11.5", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.11.5.tgz", - "integrity": "sha512-EjiPXt+r7LiCZXEfRpSJd+jUMnBd4/9OUv7Nx3+0u9+eimMwJmG0Q98lw4/289JCoxSE8OolDMNZaaF/JZ69WQ==", + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.12.1.tgz", + "integrity": "sha512-MA3WPoRt1ZHo2ZmoGKNqi20YnPt0B1S0GTZEPhhd+hw2KGUzBlHuVunj6K4sNuK+reEvyiPwtp0cpaqLzJDmAw==", "dev": true, "requires": { "@babel/code-frame": "^7.10.4", - "@babel/generator": "^7.11.5", + "@babel/generator": "^7.12.1", "@babel/helper-function-name": "^7.10.4", "@babel/helper-split-export-declaration": "^7.11.0", - "@babel/parser": "^7.11.5", - "@babel/types": "^7.11.5", + "@babel/parser": "^7.12.1", + "@babel/types": "^7.12.1", "debug": "^4.1.0", "globals": "^11.1.0", "lodash": "^4.17.19" @@ -290,9 +291,9 @@ } }, "@babel/types": { - "version": "7.11.5", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.11.5.tgz", - "integrity": "sha512-bvM7Qz6eKnJVFIn+1LPtjlBFPVN5jNDc1XmN15vWe7Q3DPBufWWsLiIvUu7xW87uTG6QoggpIDnUgLQvPheU+Q==", + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.12.1.tgz", + "integrity": "sha512-BzSY3NJBKM4kyatSOWh3D/JJ2O3CVzBybHWxtgxnggaxEuaSTTDqeiSb/xk9lrkw2Tbqyivw5ZU4rT+EfznQsA==", "dev": true, "requires": { "@babel/helper-validator-identifier": "^7.10.4", @@ -504,9 +505,9 @@ "dev": true }, "@eslint/eslintrc": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.1.3.tgz", - "integrity": "sha512-4YVwPkANLeNtRjMekzux1ci8hIaH5eGKktGqR0d3LWsKNn5B2X/1Z6Trxy7jQXl9EBGE6Yj02O+t09FMeRllaA==", + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.2.1.tgz", + "integrity": "sha512-XRUeBZ5zBWLYgSANMpThFddrZZkEbGHgUdt5UJjZfnlN9BGCiUBrf+nvbRupSjMvqzwnQN0qwCmOxITt1cfywA==", "dev": true, "requires": { "ajv": "^6.12.4", @@ -548,16 +549,6 @@ "integrity": "sha512-tsAQNx32a8CoFhjhijUIhI4kccIAgmGhy8LZMZgGfmXcpMbPRUqn5LWmgRttILi6yeGmBJd2xsPkFMs0PzgPCw==", "dev": true }, - "@mrmlnc/readdir-enhanced": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/@mrmlnc/readdir-enhanced/-/readdir-enhanced-2.2.1.tgz", - "integrity": "sha512-bPHp6Ji8b41szTOcaP63VlnbbO5Ny6dwAATtY6JTjh5N2OLrb5Qk/Th5cRkRQhkWCt+EJsYrNB0MiL+Gpn6e3g==", - "dev": true, - "requires": { - "call-me-maybe": "^1.0.1", - "glob-to-regexp": "^0.3.0" - } - }, "@nodelib/fs.scandir": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.3.tgz", @@ -705,10 +696,36 @@ "integrity": "sha512-5ezb/dBSTWtKQ4sLQwMgOJyREXJcZZkTMbendMwKrXTghUhWjZhstzkkmt4/WkFy/GSTSGzfJOKU7dEXv3C/XQ==", "dev": true }, + "@types/eslint": { + "version": "7.2.4", + "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-7.2.4.tgz", + "integrity": "sha512-YCY4kzHMsHoyKspQH+nwSe+70Kep7Vjt2X+dZe5Vs2vkRudqtoFoUIv1RlJmZB8Hbp7McneupoZij4PadxsK5Q==", + "dev": true, + "requires": { + "@types/estree": "*", + "@types/json-schema": "*" + } + }, + "@types/eslint-scope": { + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/@types/eslint-scope/-/eslint-scope-3.7.0.tgz", + "integrity": "sha512-O/ql2+rrCUe2W2rs7wMR+GqPRcgB6UiqN5RhrR5xruFlY7l9YLMn0ZkDzjoHLeiFkR8MCQZVudUuuvQ2BLC9Qw==", + "dev": true, + "requires": { + "@types/eslint": "*", + "@types/estree": "*" + } + }, + "@types/estree": { + "version": "0.0.45", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.45.tgz", + "integrity": "sha512-jnqIUKDUqJbDIUxm0Uj7bnlMnRm1T/eZ9N+AVMqhPgzrba2GhGG5o/jCTwmdPK709nEZsGoMzXEDUjcXHa3W0g==", + "dev": true + }, "@types/jasmine": { - "version": "3.5.14", - "resolved": "https://registry.npmjs.org/@types/jasmine/-/jasmine-3.5.14.tgz", - "integrity": "sha512-Fkgk536sHPqcOtd+Ow+WiUNuk0TSo/BntKkF8wSvcd6M2FvPjeXcUE6Oz/bwDZiUZEaXLslAgw00Q94Pnx6T4w==", + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/@types/jasmine/-/jasmine-3.6.0.tgz", + "integrity": "sha512-CPT4r0a63e5wpNj5ejMnconM7a+0Hdx6/APsyw8AQOHk0/Mxp3xYrym1ZabWJiYuQkgKB3MonYoN04mxtvAvRA==", "dev": true }, "@types/json-schema": { @@ -730,9 +747,9 @@ "dev": true }, "@types/node": { - "version": "14.11.8", - "resolved": "https://registry.npmjs.org/@types/node/-/node-14.11.8.tgz", - "integrity": "sha512-KPcKqKm5UKDkaYPTuXSx8wEP7vE9GnuaXIZKijwRYcePpZFDVuy2a57LarFKiORbHOuTOOwYzxVxcUzsh2P2Pw==", + "version": "14.14.6", + "resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.6.tgz", + "integrity": "sha512-6QlRuqsQ/Ox/aJEQWBEJG7A9+u7oSYl3mem/K8IzxXG/kAGbV1YPD9Bg9Zw3vyxC/YP+zONKwy8hGkSt1jxFMw==", "dev": true }, "@types/normalize-package-data": { @@ -812,13 +829,13 @@ "dev": true }, "@typescript-eslint/eslint-plugin": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.4.0.tgz", - "integrity": "sha512-RVt5wU9H/2H+N/ZrCasTXdGbUTkbf7Hfi9eLiA8vPQkzUJ/bLDCC3CsoZioPrNcnoyN8r0gT153dC++A4hKBQQ==", + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.6.0.tgz", + "integrity": "sha512-1+419X+Ynijytr1iWI+/IcX/kJryc78YNpdaXR1aRO1sU3bC0vZrIAF1tIX7rudVI84W7o7M4zo5p1aVt70fAg==", "dev": true, "requires": { - "@typescript-eslint/experimental-utils": "4.4.0", - "@typescript-eslint/scope-manager": "4.4.0", + "@typescript-eslint/experimental-utils": "4.6.0", + "@typescript-eslint/scope-manager": "4.6.0", "debug": "^4.1.1", "functional-red-black-tree": "^1.0.1", "regexpp": "^3.0.0", @@ -827,55 +844,55 @@ } }, "@typescript-eslint/experimental-utils": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-4.4.0.tgz", - "integrity": "sha512-01+OtK/oWeSJTjQcyzDztfLF1YjvKpLFo+JZmurK/qjSRcyObpIecJ4rckDoRCSh5Etw+jKfdSzVEHevh9gJ1w==", + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-4.6.0.tgz", + "integrity": "sha512-pnh6Beh2/4xjJVNL+keP49DFHk3orDHHFylSp3WEjtgW3y1U+6l+jNnJrGlbs6qhAz5z96aFmmbUyKhunXKvKw==", "dev": true, "requires": { "@types/json-schema": "^7.0.3", - "@typescript-eslint/scope-manager": "4.4.0", - "@typescript-eslint/types": "4.4.0", - "@typescript-eslint/typescript-estree": "4.4.0", + "@typescript-eslint/scope-manager": "4.6.0", + "@typescript-eslint/types": "4.6.0", + "@typescript-eslint/typescript-estree": "4.6.0", "eslint-scope": "^5.0.0", "eslint-utils": "^2.0.0" } }, "@typescript-eslint/parser": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-4.4.0.tgz", - "integrity": "sha512-yc14iEItCxoGb7W4Nx30FlTyGpU9r+j+n1LUK/exlq2eJeFxczrz/xFRZUk2f6yzWfK+pr1DOTyQnmDkcC4TnA==", + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-4.6.0.tgz", + "integrity": "sha512-Dj6NJxBhbdbPSZ5DYsQqpR32MwujF772F2H3VojWU6iT4AqL4BKuoNWOPFCoSZvCcADDvQjDpa6OLDAaiZPz2Q==", "dev": true, "requires": { - "@typescript-eslint/scope-manager": "4.4.0", - "@typescript-eslint/types": "4.4.0", - "@typescript-eslint/typescript-estree": "4.4.0", + "@typescript-eslint/scope-manager": "4.6.0", + "@typescript-eslint/types": "4.6.0", + "@typescript-eslint/typescript-estree": "4.6.0", "debug": "^4.1.1" } }, "@typescript-eslint/scope-manager": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-4.4.0.tgz", - "integrity": "sha512-r2FIeeU1lmW4K3CxgOAt8djI5c6Q/5ULAgdVo9AF3hPMpu0B14WznBAtxrmB/qFVbVIB6fSx2a+EVXuhSVMEyA==", + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-4.6.0.tgz", + "integrity": "sha512-uZx5KvStXP/lwrMrfQQwDNvh2ppiXzz5TmyTVHb+5TfZ3sUP7U1onlz3pjoWrK9konRyFe1czyxObWTly27Ang==", "dev": true, "requires": { - "@typescript-eslint/types": "4.4.0", - "@typescript-eslint/visitor-keys": "4.4.0" + "@typescript-eslint/types": "4.6.0", + "@typescript-eslint/visitor-keys": "4.6.0" } }, "@typescript-eslint/types": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-4.4.0.tgz", - "integrity": "sha512-nU0VUpzanFw3jjX+50OTQy6MehVvf8pkqFcURPAE06xFNFenMj1GPEI6IESvp7UOHAnq+n/brMirZdR+7rCrlA==", + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-4.6.0.tgz", + "integrity": "sha512-5FAgjqH68SfFG4UTtIFv+rqYJg0nLjfkjD0iv+5O27a0xEeNZ5rZNDvFGZDizlCD1Ifj7MAbSW2DPMrf0E9zjA==", "dev": true }, "@typescript-eslint/typescript-estree": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-4.4.0.tgz", - "integrity": "sha512-Fh85feshKXwki4nZ1uhCJHmqKJqCMba+8ZicQIhNi5d5jSQFteWiGeF96DTjO8br7fn+prTP+t3Cz/a/3yOKqw==", + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-4.6.0.tgz", + "integrity": "sha512-s4Z9qubMrAo/tw0CbN0IN4AtfwuehGXVZM0CHNMdfYMGBDhPdwTEpBrecwhP7dRJu6d9tT9ECYNaWDHvlFSngA==", "dev": true, "requires": { - "@typescript-eslint/types": "4.4.0", - "@typescript-eslint/visitor-keys": "4.4.0", + "@typescript-eslint/types": "4.6.0", + "@typescript-eslint/visitor-keys": "4.6.0", "debug": "^4.1.1", "globby": "^11.0.1", "is-glob": "^4.0.1", @@ -885,12 +902,12 @@ } }, "@typescript-eslint/visitor-keys": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-4.4.0.tgz", - "integrity": "sha512-oBWeroUZCVsHLiWRdcTXJB7s1nB3taFY8WGvS23tiAlT6jXVvsdAV4rs581bgdEjOhn43q6ro7NkOiLKu6kFqA==", + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-4.6.0.tgz", + "integrity": "sha512-38Aa9Ztl0XyFPVzmutHXqDMCu15Xx8yKvUo38Gu3GhsuckCh3StPI5t2WIO9LHEsOH7MLmlGfKUisU8eW1Sjhg==", "dev": true, "requires": { - "@typescript-eslint/types": "4.4.0", + "@typescript-eslint/types": "4.6.0", "eslint-visitor-keys": "^2.0.0" } }, @@ -1069,6 +1086,21 @@ "@xtuc/long": "4.2.2" } }, + "@webpack-cli/info": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@webpack-cli/info/-/info-1.0.2.tgz", + "integrity": "sha512-FEfLQwmN4pXZSYSrtp+KC84rFanoCIxXFpS2wUvviDCE2fnajwxw2GXzbj83IlH4Dl8Wq8kJjavVwvxv3YJmnw==", + "dev": true, + "requires": { + "envinfo": "^7.7.3" + } + }, + "@webpack-cli/serve": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@webpack-cli/serve/-/serve-1.0.1.tgz", + "integrity": "sha512-WGMaTMTK6NOe29Hw1WBEok9vGLfKg5C6jWzNOS/6HH1YadR+RL+TRWRcSyc81Dzulljhk/Ree9mrDM4Np9GGOQ==", + "dev": true + }, "@xtuc/ieee754": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/@xtuc/ieee754/-/ieee754-1.2.0.tgz", @@ -1142,9 +1174,9 @@ } }, "ajv": { - "version": "6.12.5", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.5.tgz", - "integrity": "sha512-lRF8RORchjpKG50/WFf8xmg7sgCLFiYNNnqdKflk63whMQcWR5ngGjiSXkL9bjxy6B2npOK2HSMN49jEBMSkag==", + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", "dev": true, "requires": { "fast-deep-equal": "^3.1.1", @@ -1153,12 +1185,6 @@ "uri-js": "^4.2.2" } }, - "ajv-errors": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/ajv-errors/-/ajv-errors-1.0.1.tgz", - "integrity": "sha512-DCRfO/4nQ+89p/RK43i8Ezd41EqdGIU4ld7nGF8OQ14oc/we5rEntLCUa7+jrn3nn83BosfwZA0wb4pon2o8iQ==", - "dev": true - }, "ajv-keywords": { "version": "3.5.2", "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz", @@ -1203,17 +1229,6 @@ "color-convert": "^2.0.1" } }, - "anymatch": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.1.tgz", - "integrity": "sha512-mM8522psRCqzV+6LhomX5wgp25YVibjh8Wj23I5RPkPppSVSjyKD2A2mBJmWGa+KN7f2D6LNh9jkBCeyLktzjg==", - "dev": true, - "optional": true, - "requires": { - "normalize-path": "^3.0.0", - "picomatch": "^2.0.4" - } - }, "append-transform": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/append-transform/-/append-transform-2.0.0.tgz", @@ -1223,12 +1238,6 @@ "default-require-extensions": "^3.0.0" } }, - "aproba": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz", - "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==", - "dev": true - }, "archy": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/archy/-/archy-1.0.0.tgz", @@ -1250,22 +1259,10 @@ "sprintf-js": "~1.0.2" } }, - "arr-diff": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", - "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=", - "dev": true - }, - "arr-flatten": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz", - "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==", - "dev": true - }, - "arr-union": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz", - "integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=", + "array-back": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/array-back/-/array-back-4.0.1.tgz", + "integrity": "sha512-Z/JnaVEXv+A9xabHzN43FiiiWEE7gPCRXMrVmRm00tWbjZRul1iHm7ECzlyNq1p4a4ATXz+G9FJ3GqGOkOV3fg==", "dev": true }, "array-flatten": { @@ -1318,12 +1315,6 @@ "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", "dev": true }, - "array-unique": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", - "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=", - "dev": true - }, "array.prototype.flat": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.2.3.tgz", @@ -1361,59 +1352,6 @@ "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=", "dev": true }, - "asn1.js": { - "version": "5.4.1", - "resolved": "https://registry.npmjs.org/asn1.js/-/asn1.js-5.4.1.tgz", - "integrity": "sha512-+I//4cYPccV8LdmBLiX8CYvf9Sp3vQsrqu2QNXRcrbiWvcx/UdlFiqUJJzxRQxgsZmvhXhn4cSKeSmoFjVdupA==", - "dev": true, - "requires": { - "bn.js": "^4.0.0", - "inherits": "^2.0.1", - "minimalistic-assert": "^1.0.0", - "safer-buffer": "^2.1.0" - }, - "dependencies": { - "bn.js": { - "version": "4.11.9", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.9.tgz", - "integrity": "sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw==", - "dev": true - } - } - }, - "assert": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/assert/-/assert-1.5.0.tgz", - "integrity": "sha512-EDsgawzwoun2CZkCgtxJbv392v4nbk9XDD06zI+kQYoBM/3RBWLlEyJARDOmhAAosBjWACEkKL6S+lIZtcAubA==", - "dev": true, - "requires": { - "object-assign": "^4.1.1", - "util": "0.10.3" - }, - "dependencies": { - "inherits": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz", - "integrity": "sha1-sX0I0ya0Qj5Wjv9xn5GwscvfafE=", - "dev": true - }, - "util": { - "version": "0.10.3", - "resolved": "https://registry.npmjs.org/util/-/util-0.10.3.tgz", - "integrity": "sha1-evsa/lCAUkZInj23/g7TeTNqwPk=", - "dev": true, - "requires": { - "inherits": "2.0.1" - } - } - } - }, - "assign-symbols": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz", - "integrity": "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=", - "dev": true - }, "astral-regex": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-1.0.0.tgz", @@ -1429,92 +1367,18 @@ "lodash": "^4.17.14" } }, - "async-each": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.3.tgz", - "integrity": "sha512-z/WhQ5FPySLdvREByI2vZiTWwCnF0moMJ1hK9YQwDTHKh6I7/uSckMetoRGb5UBZPC1z0jlw+n/XCgjeH7y1AQ==", - "dev": true, - "optional": true - }, "at-least-node": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/at-least-node/-/at-least-node-1.0.0.tgz", "integrity": "sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg==", "dev": true }, - "atob": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz", - "integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==", - "dev": true - }, "balanced-match": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", "dev": true }, - "base": { - "version": "0.11.2", - "resolved": "https://registry.npmjs.org/base/-/base-0.11.2.tgz", - "integrity": "sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==", - "dev": true, - "requires": { - "cache-base": "^1.0.1", - "class-utils": "^0.3.5", - "component-emitter": "^1.2.1", - "define-property": "^1.0.0", - "isobject": "^3.0.1", - "mixin-deep": "^1.2.0", - "pascalcase": "^0.1.1" - }, - "dependencies": { - "define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", - "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", - "dev": true, - "requires": { - "is-descriptor": "^1.0.0" - } - }, - "is-accessor-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-data-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-descriptor": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", - "dev": true, - "requires": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" - } - } - } - }, - "base64-js": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.3.1.tgz", - "integrity": "sha512-mLQ4i2QO1ytvGWFWmcngKO//JXAQueZvwEKtjgQFM4jIK0kU+ytMfplL8j+n5mspOfjHwoAg+9yhb7BwAHm36g==", - "dev": true - }, "basic-auth": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/basic-auth/-/basic-auth-2.0.1.tgz", @@ -1530,31 +1394,12 @@ "integrity": "sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ==", "dev": true }, - "binary-extensions": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.1.0.tgz", - "integrity": "sha512-1Yj8h9Q+QDF5FzhMs/c9+6UntbD5MkRfRwac8DoEm9ZfUBZ7tZ55YcGVAzEe4bXsdQHEk+s9S5wsOKVdZrw0tQ==", - "dev": true, - "optional": true - }, - "bluebird": { - "version": "3.7.2", - "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz", - "integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==", - "dev": true - }, "blueimp-md5": { "version": "2.18.0", "resolved": "https://registry.npmjs.org/blueimp-md5/-/blueimp-md5-2.18.0.tgz", "integrity": "sha512-vE52okJvzsVWhcgUHOv+69OG3Mdg151xyn41aVQN/5W5S+S43qZhxECtYLAEHMSFWX6Mv5IZrzj3T5+JqXfj5Q==", "dev": true }, - "bn.js": { - "version": "5.1.3", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.1.3.tgz", - "integrity": "sha512-GkTiFpjFtUzU9CbMeJ5iazkCzGL3jrhzerzZIuqLABjbwRaFt33I9tUdSNryIptM+RxDet6OKm2WnLXzW51KsQ==", - "dev": true - }, "body-parser": { "version": "1.19.0", "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.19.0.tgz", @@ -1621,121 +1466,16 @@ "fill-range": "^7.0.1" } }, - "brorand": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", - "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=", - "dev": true - }, - "browserify-aes": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz", - "integrity": "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==", - "dev": true, - "requires": { - "buffer-xor": "^1.0.3", - "cipher-base": "^1.0.0", - "create-hash": "^1.1.0", - "evp_bytestokey": "^1.0.3", - "inherits": "^2.0.1", - "safe-buffer": "^5.0.1" - } - }, - "browserify-cipher": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/browserify-cipher/-/browserify-cipher-1.0.1.tgz", - "integrity": "sha512-sPhkz0ARKbf4rRQt2hTpAHqn47X3llLkUGn+xEJzLjwY8LRs2p0v7ljvI5EyoRO/mexrNunNECisZs+gw2zz1w==", - "dev": true, - "requires": { - "browserify-aes": "^1.0.4", - "browserify-des": "^1.0.0", - "evp_bytestokey": "^1.0.0" - } - }, - "browserify-des": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/browserify-des/-/browserify-des-1.0.2.tgz", - "integrity": "sha512-BioO1xf3hFwz4kc6iBhI3ieDFompMhrMlnDFC4/0/vd5MokpuAc3R+LYbwTA9A5Yc9pq9UYPqffKpW2ObuwX5A==", - "dev": true, - "requires": { - "cipher-base": "^1.0.1", - "des.js": "^1.0.0", - "inherits": "^2.0.1", - "safe-buffer": "^5.1.2" - } - }, - "browserify-rsa": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/browserify-rsa/-/browserify-rsa-4.0.1.tgz", - "integrity": "sha1-IeCr+vbyApzy+vsTNWenAdQTVSQ=", - "dev": true, - "requires": { - "bn.js": "^4.1.0", - "randombytes": "^2.0.1" - }, - "dependencies": { - "bn.js": { - "version": "4.11.9", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.9.tgz", - "integrity": "sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw==", - "dev": true - } - } - }, - "browserify-sign": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/browserify-sign/-/browserify-sign-4.2.1.tgz", - "integrity": "sha512-/vrA5fguVAKKAVTNJjgSm1tRQDHUU6DbwO9IROu/0WAzC8PKhucDSh18J0RMvVeHAn5puMd+QHC2erPRNf8lmg==", + "browserslist": { + "version": "4.14.5", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.14.5.tgz", + "integrity": "sha512-Z+vsCZIvCBvqLoYkBFTwEYH3v5MCQbsAjp50ERycpOjnPmolg1Gjy4+KaWWpm8QOJt9GHkhdqAl14NpCX73CWA==", "dev": true, "requires": { - "bn.js": "^5.1.1", - "browserify-rsa": "^4.0.1", - "create-hash": "^1.2.0", - "create-hmac": "^1.1.7", - "elliptic": "^6.5.3", - "inherits": "^2.0.4", - "parse-asn1": "^5.1.5", - "readable-stream": "^3.6.0", - "safe-buffer": "^5.2.0" - }, - "dependencies": { - "readable-stream": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", - "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", - "dev": true, - "requires": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - } - }, - "safe-buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", - "dev": true - } - } - }, - "browserify-zlib": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/browserify-zlib/-/browserify-zlib-0.2.0.tgz", - "integrity": "sha512-Z942RysHXmJrhqk88FmKBVq/v5tqmSkDz7p54G/MGyjMnCFFnC79XWNbg+Vta8W6Wb2qtSZTSxIGkJrRpCFEiA==", - "dev": true, - "requires": { - "pako": "~1.0.5" - } - }, - "buffer": { - "version": "4.9.2", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-4.9.2.tgz", - "integrity": "sha512-xq+q3SRMOxGivLhBNaUdC64hDTQwejJ+H0T/NB1XMtTVEwNTrfFF3gAxiyW0Bu/xWEGhjVKgUcMhCrUy2+uCWg==", - "dev": true, - "requires": { - "base64-js": "^1.0.2", - "ieee754": "^1.1.4", - "isarray": "^1.0.0" + "caniuse-lite": "^1.0.30001135", + "electron-to-chromium": "^1.3.571", + "escalade": "^3.1.0", + "node-releases": "^1.1.61" } }, "buffer-from": { @@ -1744,64 +1484,12 @@ "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", "dev": true }, - "buffer-xor": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", - "integrity": "sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk=", - "dev": true - }, - "builtin-status-codes": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz", - "integrity": "sha1-hZgoeOIbmOHGZCXgPQF0eI9Wnug=", - "dev": true - }, "bytes": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.0.tgz", "integrity": "sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg==", "dev": true }, - "cacache": { - "version": "12.0.4", - "resolved": "https://registry.npmjs.org/cacache/-/cacache-12.0.4.tgz", - "integrity": "sha512-a0tMB40oefvuInr4Cwb3GerbL9xTj1D5yg0T5xrjGCGyfvbxseIXX7BAO/u/hIXdafzOI5JC3wDwHyf24buOAQ==", - "dev": true, - "requires": { - "bluebird": "^3.5.5", - "chownr": "^1.1.1", - "figgy-pudding": "^3.5.1", - "glob": "^7.1.4", - "graceful-fs": "^4.1.15", - "infer-owner": "^1.0.3", - "lru-cache": "^5.1.1", - "mississippi": "^3.0.0", - "mkdirp": "^0.5.1", - "move-concurrently": "^1.0.1", - "promise-inflight": "^1.0.1", - "rimraf": "^2.6.3", - "ssri": "^6.0.1", - "unique-filename": "^1.1.1", - "y18n": "^4.0.0" - } - }, - "cache-base": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz", - "integrity": "sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==", - "dev": true, - "requires": { - "collection-visit": "^1.0.0", - "component-emitter": "^1.2.1", - "get-value": "^2.0.6", - "has-value": "^1.0.0", - "isobject": "^3.0.1", - "set-value": "^2.0.0", - "to-object-path": "^0.3.0", - "union-value": "^1.0.0", - "unset-value": "^1.0.0" - } - }, "caching-transform": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/caching-transform/-/caching-transform-4.0.0.tgz", @@ -1814,12 +1502,6 @@ "write-file-atomic": "^3.0.0" } }, - "call-me-maybe": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/call-me-maybe/-/call-me-maybe-1.0.1.tgz", - "integrity": "sha1-JtII6onje1y95gJQoV8DHBak1ms=", - "dev": true - }, "callsites": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", @@ -1843,6 +1525,12 @@ "quick-lru": "^4.0.1" } }, + "caniuse-lite": { + "version": "1.0.30001153", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001153.tgz", + "integrity": "sha512-qv14w7kWwm2IW7DBvAKWlCqGTmV2XxNtSejJBVplwRjhkohHuhRUpeSlPjtu9erru0+A12zCDUiSmvx/AcqVRA==", + "dev": true + }, "chalk": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", @@ -1853,28 +1541,6 @@ "supports-color": "^7.1.0" } }, - "chokidar": { - "version": "3.4.2", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.4.2.tgz", - "integrity": "sha512-IZHaDeBeI+sZJRX7lGcXsdzgvZqKv6sECqsbErJA4mHWfpRrD8B97kSFN4cQz6nGBGiuFia1MKR4d6c1o8Cv7A==", - "dev": true, - "optional": true, - "requires": { - "anymatch": "~3.1.1", - "braces": "~3.0.2", - "glob-parent": "~5.1.0", - "is-binary-path": "~2.1.0", - "is-glob": "~4.0.1", - "normalize-path": "~3.0.0", - "readdirp": "~3.4.0" - } - }, - "chownr": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz", - "integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==", - "dev": true - }, "chrome-trace-event": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/chrome-trace-event/-/chrome-trace-event-1.0.2.tgz", @@ -1890,39 +1556,6 @@ "integrity": "sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==", "dev": true }, - "cipher-base": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", - "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==", - "dev": true, - "requires": { - "inherits": "^2.0.1", - "safe-buffer": "^5.0.1" - } - }, - "class-utils": { - "version": "0.3.6", - "resolved": "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz", - "integrity": "sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg==", - "dev": true, - "requires": { - "arr-union": "^3.1.0", - "define-property": "^0.2.5", - "isobject": "^3.0.0", - "static-extend": "^0.1.1" - }, - "dependencies": { - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "dev": true, - "requires": { - "is-descriptor": "^0.1.0" - } - } - } - }, "clean-stack": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", @@ -1989,16 +1622,6 @@ "shallow-clone": "^3.0.0" } }, - "collection-visit": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz", - "integrity": "sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA=", - "dev": true, - "requires": { - "map-visit": "^1.0.0", - "object-visit": "^1.0.0" - } - }, "color-convert": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", @@ -2014,80 +1637,120 @@ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, + "colorette": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/colorette/-/colorette-1.2.1.tgz", + "integrity": "sha512-puCDz0CzydiSYOrnXpz/PKd69zRrribezjtE9yd4zvytoRc8+RY/KJPvtPFKZS3E3wP6neGyMe0vOTlHO5L3Pw==", + "dev": true + }, "colors": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/colors/-/colors-1.4.0.tgz", "integrity": "sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA==", "dev": true }, - "commander": { + "command-line-usage": { "version": "6.1.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-6.1.0.tgz", - "integrity": "sha512-wl7PNrYWd2y5mp1OK/LhTlv8Ff4kQJQRXXAvF+uU/TPNiVJUxZLRYGj/B0y/lPGAVcSbJqH2Za/cvHmrPMC8mA==", - "dev": true - }, - "commondir": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", - "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=", - "dev": true - }, - "compare-func": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/compare-func/-/compare-func-2.0.0.tgz", - "integrity": "sha512-zHig5N+tPWARooBnb0Zx1MFcdfpyJrfTJ3Y5L+IFvUm8rM74hHz66z0gw0x4tijh5CorKkKUCnW82R2vmpeCRA==", + "resolved": "https://registry.npmjs.org/command-line-usage/-/command-line-usage-6.1.0.tgz", + "integrity": "sha512-Ew1clU4pkUeo6AFVDFxCbnN7GIZfXl48HIOQeFQnkO3oOqvpI7wdqtLRwv9iOCZ/7A+z4csVZeiDdEcj8g6Wiw==", "dev": true, "requires": { - "array-ify": "^1.0.0", - "dot-prop": "^5.1.0" - } - }, - "compare-versions": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/compare-versions/-/compare-versions-3.6.0.tgz", - "integrity": "sha512-W6Af2Iw1z4CB7q4uU4hv646dW9GQuBM+YpC0UvUCWSD8w90SJjp+ujJuXaEMtAXBtSqGfMPuFOVn4/+FlaqfBA==", - "dev": true - }, - "component-emitter": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz", - "integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==", - "dev": true - }, - "concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "array-back": "^4.0.0", + "chalk": "^2.4.2", + "table-layout": "^1.0.0", + "typical": "^5.2.0" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "dev": true + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "commander": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-6.2.0.tgz", + "integrity": "sha512-zP4jEKbe8SHzKJYQmq8Y9gYjtO/POJLgIdKgV7B9qNmABVFVc+ctqSX6iXh4mCpJfRBOabiZ2YKPg8ciDw6C+Q==", + "dev": true + }, + "commondir": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", + "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=", "dev": true }, - "concat-stream": { - "version": "1.6.2", - "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", - "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", + "compare-func": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/compare-func/-/compare-func-2.0.0.tgz", + "integrity": "sha512-zHig5N+tPWARooBnb0Zx1MFcdfpyJrfTJ3Y5L+IFvUm8rM74hHz66z0gw0x4tijh5CorKkKUCnW82R2vmpeCRA==", "dev": true, "requires": { - "buffer-from": "^1.0.0", - "inherits": "^2.0.3", - "readable-stream": "^2.2.2", - "typedarray": "^0.0.6" + "array-ify": "^1.0.0", + "dot-prop": "^5.1.0" } }, - "confusing-browser-globals": { - "version": "1.0.9", - "resolved": "https://registry.npmjs.org/confusing-browser-globals/-/confusing-browser-globals-1.0.9.tgz", - "integrity": "sha512-KbS1Y0jMtyPgIxjO7ZzMAuUpAKMt1SzCL9fsrKsX6b0zJPTaT0SiSPmewwVZg9UAO83HVIlEhZF84LIjZ0lmAw==", + "compare-versions": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/compare-versions/-/compare-versions-3.6.0.tgz", + "integrity": "sha512-W6Af2Iw1z4CB7q4uU4hv646dW9GQuBM+YpC0UvUCWSD8w90SJjp+ujJuXaEMtAXBtSqGfMPuFOVn4/+FlaqfBA==", "dev": true }, - "console-browserify": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/console-browserify/-/console-browserify-1.2.0.tgz", - "integrity": "sha512-ZMkYO/LkF17QvCPqM0gxw8yUzigAOZOSWSHg91FH6orS7vcEj5dVZTidN2fQ14yBSdg97RqhSNwLUXInd52OTA==", + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", "dev": true }, - "constants-browserify": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/constants-browserify/-/constants-browserify-1.0.0.tgz", - "integrity": "sha1-wguW2MYXdIqvHBYCF2DNJ/y4y3U=", + "confusing-browser-globals": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/confusing-browser-globals/-/confusing-browser-globals-1.0.10.tgz", + "integrity": "sha512-gNld/3lySHwuhaVluJUKLePYirM3QNCKzVxqAdhJII9/WXKVX5PURzMVJspS1jTslSqjeuG4KMVTSouit5YPHA==", "dev": true }, "contains-path": { @@ -2168,26 +1831,6 @@ "integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw=", "dev": true }, - "copy-concurrently": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/copy-concurrently/-/copy-concurrently-1.0.5.tgz", - "integrity": "sha512-f2domd9fsVDFtaFcbaRZuYXwtdmnzqbADSwhSWYxYB/Q8zsdUUFMXVRwXGDMWmbEzAn1kdRrtI1T/KTFOL4X2A==", - "dev": true, - "requires": { - "aproba": "^1.1.1", - "fs-write-stream-atomic": "^1.0.8", - "iferr": "^0.1.5", - "mkdirp": "^0.5.1", - "rimraf": "^2.5.4", - "run-queue": "^1.0.0" - } - }, - "copy-descriptor": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz", - "integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=", - "dev": true - }, "core-js": { "version": "3.6.5", "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.6.5.tgz", @@ -2229,51 +1872,6 @@ "yaml": "^1.10.0" } }, - "create-ecdh": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.4.tgz", - "integrity": "sha512-mf+TCx8wWc9VpuxfP2ht0iSISLZnt0JgWlrOKZiNqyUZWnjIaCIVNQArMHnCZKfEYRg6IM7A+NeJoN8gf/Ws0A==", - "dev": true, - "requires": { - "bn.js": "^4.1.0", - "elliptic": "^6.5.3" - }, - "dependencies": { - "bn.js": { - "version": "4.11.9", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.9.tgz", - "integrity": "sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw==", - "dev": true - } - } - }, - "create-hash": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", - "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==", - "dev": true, - "requires": { - "cipher-base": "^1.0.1", - "inherits": "^2.0.1", - "md5.js": "^1.3.4", - "ripemd160": "^2.0.1", - "sha.js": "^2.4.0" - } - }, - "create-hmac": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", - "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==", - "dev": true, - "requires": { - "cipher-base": "^1.0.3", - "create-hash": "^1.1.0", - "inherits": "^2.0.1", - "ripemd160": "^2.0.0", - "safe-buffer": "^5.0.1", - "sha.js": "^2.4.8" - } - }, "cross-fetch": { "version": "3.0.6", "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-3.0.6.tgz", @@ -2293,31 +1891,6 @@ "which": "^2.0.1" } }, - "crypto-browserify": { - "version": "3.12.0", - "resolved": "https://registry.npmjs.org/crypto-browserify/-/crypto-browserify-3.12.0.tgz", - "integrity": "sha512-fz4spIh+znjO2VjL+IdhEpRJ3YN6sMzITSBijk6FK2UvTqruSQW+/cCZTSNsMiZNvUeq0CqurF+dAbyiGOY6Wg==", - "dev": true, - "requires": { - "browserify-cipher": "^1.0.0", - "browserify-sign": "^4.0.0", - "create-ecdh": "^4.0.0", - "create-hash": "^1.1.0", - "create-hmac": "^1.1.0", - "diffie-hellman": "^5.0.0", - "inherits": "^2.0.1", - "pbkdf2": "^3.0.3", - "public-encrypt": "^4.0.0", - "randombytes": "^2.0.0", - "randomfill": "^1.0.3" - } - }, - "cyclist": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/cyclist/-/cyclist-1.0.1.tgz", - "integrity": "sha1-WW6WmP0MgOEgOMK4LW6xs1tiJNk=", - "dev": true - }, "dargs": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/dargs/-/dargs-7.0.0.tgz", @@ -2357,18 +1930,18 @@ } } }, - "decode-uri-component": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz", - "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=", - "dev": true - }, "dedent": { "version": "0.7.0", "resolved": "https://registry.npmjs.org/dedent/-/dedent-0.7.0.tgz", "integrity": "sha1-JJXduvbrh0q7Dhvp3yLS5aVEMmw=", "dev": true }, + "deep-extend": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", + "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", + "dev": true + }, "deep-is": { "version": "0.1.3", "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", @@ -2401,100 +1974,24 @@ "object-keys": "^1.0.12" } }, - "define-property": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz", - "integrity": "sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==", - "dev": true, - "requires": { - "is-descriptor": "^1.0.2", - "isobject": "^3.0.1" - }, - "dependencies": { - "is-accessor-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-data-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-descriptor": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", - "dev": true, - "requires": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" - } - } - } - }, "depd": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=", "dev": true }, - "des.js": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/des.js/-/des.js-1.0.1.tgz", - "integrity": "sha512-Q0I4pfFrv2VPd34/vfLrFOoRmlYj3OV50i7fskps1jZWK1kApMWWT9G6RRUeYedLcBDIhnSDaUvJMb3AhUlaEA==", - "dev": true, - "requires": { - "inherits": "^2.0.1", - "minimalistic-assert": "^1.0.0" - } - }, "destroy": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=", "dev": true }, - "detect-file": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/detect-file/-/detect-file-1.0.0.tgz", - "integrity": "sha1-8NZtA2cqglyxtzvbP+YjEMjlUrc=", - "dev": true - }, "diff": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", "dev": true }, - "diffie-hellman": { - "version": "5.0.3", - "resolved": "https://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.3.tgz", - "integrity": "sha512-kqag/Nl+f3GwyK25fhUMYj81BUOrZ9IuJsjIcDE5icNM9FJHAVm3VcUDxdLPoQtTuUylWm6ZIknYJwwaPxsUzg==", - "dev": true, - "requires": { - "bn.js": "^4.1.0", - "miller-rabin": "^4.0.0", - "randombytes": "^2.0.0" - }, - "dependencies": { - "bn.js": { - "version": "4.11.9", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.9.tgz", - "integrity": "sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw==", - "dev": true - } - } - }, "dir-glob": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", @@ -2513,12 +2010,6 @@ "esutils": "^2.0.2" } }, - "domain-browser": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/domain-browser/-/domain-browser-1.2.0.tgz", - "integrity": "sha512-jnjyiM6eRyZl2H+W8Q/zLMA481hzi0eszAaBUzIVnmYVDBbnLxVNnfu1HgEBvCbL+71FrxMl3E6lpKH7Ge3OXA==", - "dev": true - }, "dot-prop": { "version": "5.3.0", "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-5.3.0.tgz", @@ -2528,18 +2019,6 @@ "is-obj": "^2.0.0" } }, - "duplexify": { - "version": "3.7.1", - "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-3.7.1.tgz", - "integrity": "sha512-07z8uv2wMyS51kKhD1KsdXJg5WQ6t93RneqRxUHnskXVtlYYkLqM0gqStQZ3pj073g687jPCHrqNfCzawLYh5g==", - "dev": true, - "requires": { - "end-of-stream": "^1.0.0", - "inherits": "^2.0.1", - "readable-stream": "^2.0.0", - "stream-shift": "^1.0.0" - } - }, "ecstatic": { "version": "3.3.2", "resolved": "https://registry.npmjs.org/ecstatic/-/ecstatic-3.3.2.tgz", @@ -2558,28 +2037,11 @@ "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=", "dev": true }, - "elliptic": { - "version": "6.5.3", - "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.3.tgz", - "integrity": "sha512-IMqzv5wNQf+E6aHeIqATs0tOLeOTwj1QKbRcS3jBbYkl5oLAserA8yJTT7/VyHUYG91PRmPyeQDObKLPpeS4dw==", - "dev": true, - "requires": { - "bn.js": "^4.4.0", - "brorand": "^1.0.1", - "hash.js": "^1.0.0", - "hmac-drbg": "^1.0.0", - "inherits": "^2.0.1", - "minimalistic-assert": "^1.0.0", - "minimalistic-crypto-utils": "^1.0.0" - }, - "dependencies": { - "bn.js": { - "version": "4.11.9", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.9.tgz", - "integrity": "sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw==", - "dev": true - } - } + "electron-to-chromium": { + "version": "1.3.584", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.584.tgz", + "integrity": "sha512-NB3DzrTzJFhWkUp+nl2KtUtoFzrfGXTir2S+BU4tXGyXH9vlluPuFpE3pTKeH7+PY460tHLjKzh6K2+TWwW+Ww==", + "dev": true }, "emoji-regex": { "version": "8.0.0", @@ -2628,6 +2090,12 @@ "ansi-colors": "^4.1.1" } }, + "envinfo": { + "version": "7.7.3", + "resolved": "https://registry.npmjs.org/envinfo/-/envinfo-7.7.3.tgz", + "integrity": "sha512-46+j5QxbPWza0PB1i15nZx0xQ4I/EfQxg9J8Had3b408SV63nEtor2e+oiY63amTo9KTuh2a3XLObNwduxYwwA==", + "dev": true + }, "errno": { "version": "0.1.7", "resolved": "https://registry.npmjs.org/errno/-/errno-0.1.7.tgz", @@ -2683,6 +2151,12 @@ "integrity": "sha512-Um/+FxMr9CISWh0bi5Zv0iOD+4cFh5qLeks1qhAopKVAJw3drgKbKySikp7wGhDL0HPeaja0P5ULZrxLkniUVg==", "dev": true }, + "escalade": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", + "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", + "dev": true + }, "escape-html": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", @@ -2696,13 +2170,13 @@ "dev": true }, "eslint": { - "version": "7.11.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.11.0.tgz", - "integrity": "sha512-G9+qtYVCHaDi1ZuWzBsOWo2wSwd70TXnU6UHA3cTYHp7gCTXZcpggWFoUVAMRarg68qtPoNfFbzPh+VdOgmwmw==", + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.12.1.tgz", + "integrity": "sha512-HlMTEdr/LicJfN08LB3nM1rRYliDXOmfoO4vj39xN6BLpFzF00hbwBoqHk8UcJ2M/3nlARZWy/mslvGEuZFvsg==", "dev": true, "requires": { "@babel/code-frame": "^7.0.0", - "@eslint/eslintrc": "^0.1.3", + "@eslint/eslintrc": "^0.2.1", "ajv": "^6.10.0", "chalk": "^4.0.0", "cross-spawn": "^7.0.2", @@ -2760,9 +2234,9 @@ } }, "eslint-config-prettier": { - "version": "6.12.0", - "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-6.12.0.tgz", - "integrity": "sha512-9jWPlFlgNwRUYVoujvWTQ1aMO8o6648r+K7qU7K5Jmkbyqav1fuEZC0COYpGBxyiAJb65Ra9hrmFx19xRGwXWw==", + "version": "6.15.0", + "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-6.15.0.tgz", + "integrity": "sha512-a1+kOYLR8wMGustcgAjdydMsQ2A/2ipRPwRKUmfYaSxc9ZPcrku080Ctl6zrZzZNs/U82MjSv+qKREkoq3bJaw==", "dev": true, "requires": { "get-stdin": "^6.0.0" @@ -3101,20 +2575,10 @@ "integrity": "sha512-/46HWwbfCX2xTawVfkKLGxMifJYQBWMwY1mjywRtb4c9x8l5NP3KoJtnIOiL1hfdRkIuYhETxQlo62IF8tcnlg==", "dev": true }, - "evp_bytestokey": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz", - "integrity": "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==", - "dev": true, - "requires": { - "md5.js": "^1.3.4", - "safe-buffer": "^5.1.1" - } - }, "execa": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/execa/-/execa-4.0.3.tgz", - "integrity": "sha512-WFDXGHckXPWZX19t1kCsXzOpqX9LWYNqn4C+HqZlk/V0imTkzJZqf87ZBhvpHaftERYknpk0fjSylnXVlVgI0A==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-4.1.0.tgz", + "integrity": "sha512-j5W0//W7f8UxAn8hXVnwG8tLwdiUy4FJLcSupCg6maBYZDpyBvTApK7KyuI4bKj8KOh1r2YH+6ucuYtJv1bTZA==", "dev": true, "requires": { "cross-spawn": "^7.0.0", @@ -3128,65 +2592,6 @@ "strip-final-newline": "^2.0.0" } }, - "expand-brackets": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", - "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=", - "dev": true, - "requires": { - "debug": "^2.3.3", - "define-property": "^0.2.5", - "extend-shallow": "^2.0.1", - "posix-character-classes": "^0.1.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.1" - }, - "dependencies": { - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, - "requires": { - "ms": "2.0.0" - } - }, - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "dev": true, - "requires": { - "is-descriptor": "^0.1.0" - } - }, - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", - "dev": true - } - } - }, - "expand-tilde": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/expand-tilde/-/expand-tilde-2.0.2.tgz", - "integrity": "sha1-l+gBqgUt8CRU3kawK/YhZCzchQI=", - "dev": true, - "requires": { - "homedir-polyfill": "^1.0.1" - } - }, "express": { "version": "4.17.1", "resolved": "https://registry.npmjs.org/express/-/express-4.17.1.tgz", @@ -3248,116 +2653,30 @@ } } }, - "extend-shallow": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", - "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", + "fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true + }, + "fast-diff": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/fast-diff/-/fast-diff-1.2.0.tgz", + "integrity": "sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w==", + "dev": true + }, + "fast-glob": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.4.tgz", + "integrity": "sha512-kr/Oo6PX51265qeuCYsyGypiO5uJFgBS0jksyG7FUeCyQzNwYnzrNIMR1NXfkZXsMYXYLRAHgISHBz8gQcxKHQ==", "dev": true, "requires": { - "assign-symbols": "^1.0.0", - "is-extendable": "^1.0.1" - }, - "dependencies": { - "is-extendable": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", - "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", - "dev": true, - "requires": { - "is-plain-object": "^2.0.4" - } - } - } - }, - "extglob": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", - "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==", - "dev": true, - "requires": { - "array-unique": "^0.3.2", - "define-property": "^1.0.0", - "expand-brackets": "^2.1.4", - "extend-shallow": "^2.0.1", - "fragment-cache": "^0.2.1", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.1" - }, - "dependencies": { - "define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", - "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", - "dev": true, - "requires": { - "is-descriptor": "^1.0.0" - } - }, - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - }, - "is-accessor-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-data-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-descriptor": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", - "dev": true, - "requires": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" - } - } - } - }, - "fast-deep-equal": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", - "dev": true - }, - "fast-diff": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/fast-diff/-/fast-diff-1.2.0.tgz", - "integrity": "sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w==", - "dev": true - }, - "fast-glob": { - "version": "3.2.4", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.4.tgz", - "integrity": "sha512-kr/Oo6PX51265qeuCYsyGypiO5uJFgBS0jksyG7FUeCyQzNwYnzrNIMR1NXfkZXsMYXYLRAHgISHBz8gQcxKHQ==", - "dev": true, - "requires": { - "@nodelib/fs.stat": "^2.0.2", - "@nodelib/fs.walk": "^1.2.3", - "glob-parent": "^5.1.0", - "merge2": "^1.3.0", - "micromatch": "^4.0.2", - "picomatch": "^2.2.1" + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.0", + "merge2": "^1.3.0", + "micromatch": "^4.0.2", + "picomatch": "^2.2.1" } }, "fast-json-stable-stringify": { @@ -3373,20 +2692,14 @@ "dev": true }, "fastq": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.8.0.tgz", - "integrity": "sha512-SMIZoZdLh/fgofivvIkmknUXyPnvxRE3DhtZ5Me3Mrsk5gyPL42F0xr51TdRXskBxHfMp+07bcYzfsYEsSQA9Q==", + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.9.0.tgz", + "integrity": "sha512-i7FVWL8HhVY+CTkwFxkN2mk3h+787ixS5S63eb78diVRc1MCssarHq3W5cj0av7YDSwmaV928RNag+U1etRQ7w==", "dev": true, "requires": { "reusify": "^1.0.4" } }, - "figgy-pudding": { - "version": "3.5.2", - "resolved": "https://registry.npmjs.org/figgy-pudding/-/figgy-pudding-3.5.2.tgz", - "integrity": "sha512-0btnI/H8f2pavGMN8w40mlSKOfTK2SVJmBfBeVIj3kNw0swwgzyRq0d5TJVOwodFmtvpPeWPN/MCcfuWF0Ezbw==", - "dev": true - }, "figures": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/figures/-/figures-3.2.0.tgz", @@ -3487,123 +2800,6 @@ "semver-regex": "^2.0.0" } }, - "findup-sync": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-3.0.0.tgz", - "integrity": "sha512-YbffarhcicEhOrm4CtrwdKBdCuz576RLdhJDsIfvNtxUuhdRet1qZcsMjqbePtAseKdAnDyM/IyXbu7PRPRLYg==", - "dev": true, - "requires": { - "detect-file": "^1.0.0", - "is-glob": "^4.0.0", - "micromatch": "^3.0.4", - "resolve-dir": "^1.0.1" - }, - "dependencies": { - "braces": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", - "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", - "dev": true, - "requires": { - "arr-flatten": "^1.1.0", - "array-unique": "^0.3.2", - "extend-shallow": "^2.0.1", - "fill-range": "^4.0.0", - "isobject": "^3.0.1", - "repeat-element": "^1.1.2", - "snapdragon": "^0.8.1", - "snapdragon-node": "^2.0.1", - "split-string": "^3.0.2", - "to-regex": "^3.0.1" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "fill-range": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", - "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", - "dev": true, - "requires": { - "extend-shallow": "^2.0.1", - "is-number": "^3.0.0", - "repeat-string": "^1.6.1", - "to-regex-range": "^2.1.0" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "is-number": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", - "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", - "dev": true, - "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "micromatch": { - "version": "3.1.10", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", - "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", - "dev": true, - "requires": { - "arr-diff": "^4.0.0", - "array-unique": "^0.3.2", - "braces": "^2.3.1", - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "extglob": "^2.0.4", - "fragment-cache": "^0.2.1", - "kind-of": "^6.0.2", - "nanomatch": "^1.2.9", - "object.pick": "^1.3.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.2" - } - }, - "to-regex-range": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", - "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", - "dev": true, - "requires": { - "is-number": "^3.0.0", - "repeat-string": "^1.6.1" - } - } - } - }, "flat-cache": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-2.0.1.tgz", @@ -3621,28 +2817,12 @@ "integrity": "sha512-r5wGx7YeOwNWNlCA0wQ86zKyDLMQr+/RB8xy74M4hTphfmjlijTSSXGuH8rnvKZnfT9i+75zmd8jcKdMR4O6jA==", "dev": true }, - "flush-write-stream": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/flush-write-stream/-/flush-write-stream-1.1.1.tgz", - "integrity": "sha512-3Z4XhFZ3992uIq0XOqb9AreonueSYphE6oYbpt5+3u06JWklbsPkNv3ZKkP9Bz/r+1MWCaMoSQ28P85+1Yc77w==", - "dev": true, - "requires": { - "inherits": "^2.0.3", - "readable-stream": "^2.3.6" - } - }, "follow-redirects": { "version": "1.13.0", "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.13.0.tgz", "integrity": "sha512-aq6gF1BEKje4a9i9+5jimNFIpq4Q1WiwBToeRK5NvZBd/TRsmW8BsJfOEGkr76TbOyPVD3OVDN910EcUNtRYEA==", "dev": true }, - "for-in": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", - "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=", - "dev": true - }, "foreground-child": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-2.0.0.tgz", @@ -3659,35 +2839,16 @@ "integrity": "sha1-mMI9qxF1ZXuMBXPozszZGw/xjIQ=", "dev": true }, - "fragment-cache": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz", - "integrity": "sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk=", - "dev": true, - "requires": { - "map-cache": "^0.2.2" - } - }, "fresh": { "version": "0.5.2", "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", "integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=", "dev": true }, - "from2": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/from2/-/from2-2.3.0.tgz", - "integrity": "sha1-i/tVAr3kpNNs/e6gB/zKIdfjgq8=", - "dev": true, - "requires": { - "inherits": "^2.0.1", - "readable-stream": "^2.0.0" - } - }, "fromentries": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/fromentries/-/fromentries-1.2.1.tgz", - "integrity": "sha512-Xu2Qh8yqYuDhQGOhD5iJGninErSfI9A3FrriD3tjUgV5VbJFeH8vfgZ9HnC6jWN80QDVNQK5vmxRAmEAp7Mevw==", + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/fromentries/-/fromentries-1.3.1.tgz", + "integrity": "sha512-w4t/zm2J+uAcrpeKyW0VmYiIs3aqe/xKQ+2qwazVNZSCklQHhaVjk6XzKw5GtImq5thgL0IVRjGRAOastb08RQ==", "dev": true }, "fs-extra": { @@ -3702,18 +2863,6 @@ "universalify": "^1.0.0" } }, - "fs-write-stream-atomic": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/fs-write-stream-atomic/-/fs-write-stream-atomic-1.0.10.tgz", - "integrity": "sha1-tH31NJPvkR33VzHnCp3tAYnbQMk=", - "dev": true, - "requires": { - "graceful-fs": "^4.1.2", - "iferr": "^0.1.5", - "imurmurhash": "^0.1.4", - "readable-stream": "1 || 2" - } - }, "fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", @@ -3733,9 +2882,9 @@ "dev": true }, "gensync": { - "version": "1.0.0-beta.1", - "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.1.tgz", - "integrity": "sha512-r8EC6NO1sngH/zdD9fiRDLdcgnbayXah+mLgManTaIZJqEC1MZstmnox8KpnI2/fxQwrp5OpCOYWLp4rBl4Jcg==", + "version": "1.0.0-beta.2", + "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", + "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", "dev": true }, "get-caller-file": { @@ -3771,12 +2920,6 @@ "pump": "^3.0.0" } }, - "get-value": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", - "integrity": "sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=", - "dev": true - }, "git-raw-commits": { "version": "2.0.7", "resolved": "https://registry.npmjs.org/git-raw-commits/-/git-raw-commits-2.0.7.tgz", @@ -3814,9 +2957,9 @@ } }, "glob-to-regexp": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/glob-to-regexp/-/glob-to-regexp-0.3.0.tgz", - "integrity": "sha1-jFoUlNIGbFcMw7/kSWF1rMTVAqs=", + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz", + "integrity": "sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw==", "dev": true }, "global-dirs": { @@ -3828,61 +2971,6 @@ "ini": "^1.3.4" } }, - "global-modules": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/global-modules/-/global-modules-2.0.0.tgz", - "integrity": "sha512-NGbfmJBp9x8IxyJSd1P+otYK8vonoJactOogrVfFRIAEY1ukil8RSKDz2Yo7wh1oihl51l/r6W4epkeKJHqL8A==", - "dev": true, - "requires": { - "global-prefix": "^3.0.0" - }, - "dependencies": { - "global-prefix": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/global-prefix/-/global-prefix-3.0.0.tgz", - "integrity": "sha512-awConJSVCHVGND6x3tmMaKcQvwXLhjdkmomy2W+Goaui8YPgYgXJZewhg3fWC+DlfqqQuWg8AwqjGTD2nAPVWg==", - "dev": true, - "requires": { - "ini": "^1.3.5", - "kind-of": "^6.0.2", - "which": "^1.3.1" - } - }, - "which": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", - "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", - "dev": true, - "requires": { - "isexe": "^2.0.0" - } - } - } - }, - "global-prefix": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/global-prefix/-/global-prefix-1.0.2.tgz", - "integrity": "sha1-2/dDxsFJklk8ZVVoy2btMsASLr4=", - "dev": true, - "requires": { - "expand-tilde": "^2.0.2", - "homedir-polyfill": "^1.0.1", - "ini": "^1.3.4", - "is-windows": "^1.0.1", - "which": "^1.2.14" - }, - "dependencies": { - "which": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", - "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", - "dev": true, - "requires": { - "isexe": "^2.0.0" - } - } - } - }, "globals": { "version": "12.4.0", "resolved": "https://registry.npmjs.org/globals/-/globals-12.4.0.tgz", @@ -3947,98 +3035,6 @@ "integrity": "sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg==", "dev": true }, - "has-value": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz", - "integrity": "sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc=", - "dev": true, - "requires": { - "get-value": "^2.0.6", - "has-values": "^1.0.0", - "isobject": "^3.0.0" - } - }, - "has-values": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-values/-/has-values-1.0.0.tgz", - "integrity": "sha1-lbC2P+whRmGab+V/51Yo1aOe/k8=", - "dev": true, - "requires": { - "is-number": "^3.0.0", - "kind-of": "^4.0.0" - }, - "dependencies": { - "is-number": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", - "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", - "dev": true, - "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "kind-of": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", - "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "hash-base": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.1.0.tgz", - "integrity": "sha512-1nmYp/rhMDiE7AYkDw+lLwlAzz0AntGIe51F3RfFfEqyQ3feY2eI/NcwC6umIQVOASPMsWJLJScWKSSvzL9IVA==", - "dev": true, - "requires": { - "inherits": "^2.0.4", - "readable-stream": "^3.6.0", - "safe-buffer": "^5.2.0" - }, - "dependencies": { - "readable-stream": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", - "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", - "dev": true, - "requires": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - } - }, - "safe-buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", - "dev": true - } - } - }, - "hash.js": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz", - "integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==", - "dev": true, - "requires": { - "inherits": "^2.0.3", - "minimalistic-assert": "^1.0.1" - } - }, "hasha": { "version": "5.2.2", "resolved": "https://registry.npmjs.org/hasha/-/hasha-5.2.2.tgz", @@ -4063,26 +3059,6 @@ "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", "dev": true }, - "hmac-drbg": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", - "integrity": "sha1-0nRXAQJabHdabFRXk+1QL8DGSaE=", - "dev": true, - "requires": { - "hash.js": "^1.0.3", - "minimalistic-assert": "^1.0.0", - "minimalistic-crypto-utils": "^1.0.1" - } - }, - "homedir-polyfill": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/homedir-polyfill/-/homedir-polyfill-1.0.3.tgz", - "integrity": "sha512-eSmmWE5bZTK2Nou4g0AI3zZ9rswp7GRKoKXS1BLUkvPviOqs4YTN1djQIqrXy9k5gEtdLPy86JjRwsNM9tnDcA==", - "dev": true, - "requires": { - "parse-passwd": "^1.0.0" - } - }, "hosted-git-info": { "version": "2.8.8", "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz", @@ -4162,12 +3138,6 @@ } } }, - "https-browserify": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/https-browserify/-/https-browserify-1.0.0.tgz", - "integrity": "sha1-7AbBDgo0wPL68Zn3/X/Hj//QPHM=", - "dev": true - }, "human-signals": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-1.1.1.tgz", @@ -4212,18 +3182,6 @@ "safer-buffer": ">= 2.1.2 < 3" } }, - "ieee754": { - "version": "1.1.13", - "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.13.tgz", - "integrity": "sha512-4vf7I2LYV/HaWerSo3XmlMkp5eZ83i+/CDluXi/IGTs/O1sejBNhTtnxzmRZfvOUqj7lZjqHkeTvpgSFDlWZTg==", - "dev": true - }, - "iferr": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/iferr/-/iferr-0.1.5.tgz", - "integrity": "sha1-xg7taebY/bazEEofy8ocGS3FtQE=", - "dev": true - }, "ignore": { "version": "5.1.8", "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.1.8.tgz", @@ -4249,56 +3207,22 @@ } }, "import-local": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/import-local/-/import-local-2.0.0.tgz", - "integrity": "sha512-b6s04m3O+s3CGSbqDIyP4R6aAwAeYlVq9+WUWep6iHa8ETRf9yei1U48C5MmfJmV9AiLYYBKPMq/W+/WRpQmCQ==", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/import-local/-/import-local-3.0.2.tgz", + "integrity": "sha512-vjL3+w0oulAVZ0hBHnxa/Nm5TAurf9YLQJDhqRZyqb+VKGOB6LU8t9H1Nr5CIo16vh9XfJTOoHwU0B71S557gA==", "dev": true, "requires": { - "pkg-dir": "^3.0.0", - "resolve-cwd": "^2.0.0" + "pkg-dir": "^4.2.0", + "resolve-cwd": "^3.0.0" }, "dependencies": { - "find-up": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", - "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", - "dev": true, - "requires": { - "locate-path": "^3.0.0" - } - }, - "locate-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", - "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", - "dev": true, - "requires": { - "p-locate": "^3.0.0", - "path-exists": "^3.0.0" - } - }, - "p-locate": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", - "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", - "dev": true, - "requires": { - "p-limit": "^2.0.0" - } - }, - "path-exists": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", - "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", - "dev": true - }, "pkg-dir": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-3.0.0.tgz", - "integrity": "sha512-/E57AYkoeQ25qkxMj5PBOVgF8Kiu/h7cYS30Z5+R7WaiCCBfLq58ZI/dSeaEKb9WVJV5n/03QwrN3IeWIFllvw==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", + "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", "dev": true, "requires": { - "find-up": "^3.0.0" + "find-up": "^4.0.0" } } } @@ -4315,12 +3239,6 @@ "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", "dev": true }, - "infer-owner": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/infer-owner/-/infer-owner-1.0.4.tgz", - "integrity": "sha512-IClj+Xz94+d7irH5qRyfJonOdfTzuDaifE6ZPWfx0N0+/ATZCbuTPq2prFl526urkQd90WyUKIh1DfBQ2hMz9A==", - "dev": true - }, "inflight": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", @@ -4344,9 +3262,9 @@ "dev": true }, "interpret": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.4.0.tgz", - "integrity": "sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/interpret/-/interpret-2.2.0.tgz", + "integrity": "sha512-Ju0Bz/cEia55xDwUWEa8+olFpCiQoypjnQySseKtmjNrnps3P+xfpUmGr90T7yjlVJmOtybRvPXhKMbHr+fWnw==", "dev": true }, "ipaddr.js": { @@ -4361,72 +3279,25 @@ "integrity": "sha512-opmNIX7uFnS96NtPmhWQgQx6/NYFgsUXYMllcfzwWKUMwfo8kku1TvE6hkNcH+Q1ts5cMVrsY7j0bxXQDciu9Q==", "dev": true }, - "is-accessor-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", - "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", - "dev": true, - "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, "is-arrayish": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", "dev": true }, - "is-binary-path": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", - "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", - "dev": true, - "optional": true, - "requires": { - "binary-extensions": "^2.0.0" - } - }, - "is-buffer": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", - "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", - "dev": true - }, "is-callable": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.2.tgz", "integrity": "sha512-dnMqspv5nU3LoewK2N/y7KLtxtakvTuaCsU9FU50/QDmdbHNy/4/JuRtMHqRU22o3q+W89YQndQEeCVwK+3qrA==", "dev": true }, - "is-data-descriptor": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", - "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", + "is-core-module": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.0.0.tgz", + "integrity": "sha512-jq1AH6C8MuteOoBPwkxHafmByhL9j5q4OaPGdbuD+ZtQJVzH+i6E3BJDQcBA09k57i2Hh2yQbEG8yObZ0jdlWw==", "dev": true, "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } + "has": "^1.0.3" } }, "is-date-object": { @@ -4435,31 +3306,6 @@ "integrity": "sha512-USlDT524woQ08aoZFzh3/Z6ch9Y/EWXEHQ/AaRN0SkKq4t2Jw2R2339tSXmwuVoY7LLlBCbOIlx2myP/L5zk0g==", "dev": true }, - "is-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", - "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", - "dev": true, - "requires": { - "is-accessor-descriptor": "^0.1.6", - "is-data-descriptor": "^0.1.4", - "kind-of": "^5.0.0" - }, - "dependencies": { - "kind-of": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", - "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", - "dev": true - } - } - }, - "is-extendable": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", - "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", - "dev": true - }, "is-extglob": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", @@ -4571,12 +3417,6 @@ "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", "dev": true }, - "is-wsl": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-1.1.0.tgz", - "integrity": "sha1-HxbkqiKwTRM2tmGIpmrzxgDDpm0=", - "dev": true - }, "isarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", @@ -4706,159 +3546,13 @@ } }, "jasmine": { - "version": "3.6.1", - "resolved": "https://registry.npmjs.org/jasmine/-/jasmine-3.6.1.tgz", - "integrity": "sha512-Jqp8P6ZWkTVFGmJwBK46p+kJNrZCdqkQ4GL+PGuBXZwK1fM4ST9BizkYgIwCFqYYqnTizAy6+XG2Ej5dFrej9Q==", + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/jasmine/-/jasmine-3.6.2.tgz", + "integrity": "sha512-Uc0o2MRnC8TS1MjDrB8jE1umKEo2mflzGvdg0Ncs+yuLtOJ+uz/Wz8VmGsNGtuASr8+E0LDgPkOpvdoC76m5WQ==", "dev": true, "requires": { - "fast-glob": "^2.2.6", + "glob": "^7.1.6", "jasmine-core": "~3.6.0" - }, - "dependencies": { - "@nodelib/fs.stat": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-1.1.3.tgz", - "integrity": "sha512-shAmDyaQC4H92APFoIaVDHCx5bStIocgvbwQyxPRrbUY20V1EYTbSDchWbuwlMG3V17cprZhA6+78JfB+3DTPw==", - "dev": true - }, - "braces": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", - "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", - "dev": true, - "requires": { - "arr-flatten": "^1.1.0", - "array-unique": "^0.3.2", - "extend-shallow": "^2.0.1", - "fill-range": "^4.0.0", - "isobject": "^3.0.1", - "repeat-element": "^1.1.2", - "snapdragon": "^0.8.1", - "snapdragon-node": "^2.0.1", - "split-string": "^3.0.2", - "to-regex": "^3.0.1" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "fast-glob": { - "version": "2.2.7", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-2.2.7.tgz", - "integrity": "sha512-g1KuQwHOZAmOZMuBtHdxDtju+T2RT8jgCC9aANsbpdiDDTSnjgfuVsIBNKbUeJI3oKMRExcfNDtJl4OhbffMsw==", - "dev": true, - "requires": { - "@mrmlnc/readdir-enhanced": "^2.2.1", - "@nodelib/fs.stat": "^1.1.2", - "glob-parent": "^3.1.0", - "is-glob": "^4.0.0", - "merge2": "^1.2.3", - "micromatch": "^3.1.10" - } - }, - "fill-range": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", - "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", - "dev": true, - "requires": { - "extend-shallow": "^2.0.1", - "is-number": "^3.0.0", - "repeat-string": "^1.6.1", - "to-regex-range": "^2.1.0" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "glob-parent": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz", - "integrity": "sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4=", - "dev": true, - "requires": { - "is-glob": "^3.1.0", - "path-dirname": "^1.0.0" - }, - "dependencies": { - "is-glob": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", - "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", - "dev": true, - "requires": { - "is-extglob": "^2.1.0" - } - } - } - }, - "is-number": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", - "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", - "dev": true, - "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "micromatch": { - "version": "3.1.10", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", - "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", - "dev": true, - "requires": { - "arr-diff": "^4.0.0", - "array-unique": "^0.3.2", - "braces": "^2.3.1", - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "extglob": "^2.0.4", - "fragment-cache": "^0.2.1", - "kind-of": "^6.0.2", - "nanomatch": "^1.2.9", - "object.pick": "^1.3.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.2" - } - }, - "to-regex-range": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", - "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", - "dev": true, - "requires": { - "is-number": "^3.0.0", - "repeat-string": "^1.6.1" - } - } } }, "jasmine-core": { @@ -4876,6 +3570,17 @@ "colors": "1.4.0" } }, + "jest-worker": { + "version": "26.6.1", + "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-26.6.1.tgz", + "integrity": "sha512-R5IE3qSGz+QynJx8y+ICEkdI2OJ3RJjRQVEyCcFAd3yVhQSEtquziPO29Mlzgn07LOVE8u8jhJ1FqcwegiXWOw==", + "dev": true, + "requires": { + "@types/node": "*", + "merge-stream": "^2.0.0", + "supports-color": "^7.0.0" + } + }, "js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", @@ -4976,9 +3681,9 @@ "dev": true }, "lint-staged": { - "version": "10.4.0", - "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-10.4.0.tgz", - "integrity": "sha512-uaiX4U5yERUSiIEQc329vhCTDDwUcSvKdRLsNomkYLRzijk3v8V9GWm2Nz0RMVB87VcuzLvtgy6OsjoH++QHIg==", + "version": "10.5.0", + "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-10.5.0.tgz", + "integrity": "sha512-gjC9+HGkBubOF+Yyoj9pd52Qfm/kYB+dRX1UOgWjHKvSDYl+VHkZXlBMlqSZa2cH3Kp5/uNL480sV6e2dTgXSg==", "dev": true, "requires": { "chalk": "^4.1.0", @@ -5038,9 +3743,9 @@ } }, "loader-runner": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/loader-runner/-/loader-runner-2.4.0.tgz", - "integrity": "sha512-Jsmr89RcXGIwivFY21FcRrisYZfvLMTWx5kOLc+JTxtpBOG6xML0vzbc6SEQG2FO9/4Fc3wW4LVcB5DmGflaRw==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/loader-runner/-/loader-runner-4.1.0.tgz", + "integrity": "sha512-oR4lB4WvwFoC70ocraKhn5nkKSs23t57h9udUgw8o0iH8hMXeEoRuUgfcvgUwAJ1ZpRqBvcou4N2SMvM1DwMrA==", "dev": true }, "loader-utils": { @@ -5146,15 +3851,6 @@ } } }, - "lru-cache": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", - "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", - "dev": true, - "requires": { - "yallist": "^3.0.2" - } - }, "make-dir": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", @@ -5178,38 +3874,12 @@ "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", "dev": true }, - "map-cache": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz", - "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=", - "dev": true - }, "map-obj": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-4.1.0.tgz", "integrity": "sha512-glc9y00wgtwcDmp7GaE/0b0OnxpNJsVf3ael/An6Fe2Q51LLwN1er6sdomLRzz5h0+yMpiYLhWYF5R7HeqVd4g==", "dev": true }, - "map-visit": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz", - "integrity": "sha1-7Nyo8TFE5mDxtb1B8S80edmN+48=", - "dev": true, - "requires": { - "object-visit": "^1.0.0" - } - }, - "md5.js": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", - "integrity": "sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg==", - "dev": true, - "requires": { - "hash-base": "^3.0.0", - "inherits": "^2.0.1", - "safe-buffer": "^5.1.2" - } - }, "media-typer": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", @@ -5279,24 +3949,6 @@ "picomatch": "^2.0.5" } }, - "miller-rabin": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/miller-rabin/-/miller-rabin-4.0.1.tgz", - "integrity": "sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA==", - "dev": true, - "requires": { - "bn.js": "^4.0.0", - "brorand": "^1.0.1" - }, - "dependencies": { - "bn.js": { - "version": "4.11.9", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.9.tgz", - "integrity": "sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw==", - "dev": true - } - } - }, "mime": { "version": "1.6.0", "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", @@ -5330,18 +3982,6 @@ "integrity": "sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==", "dev": true }, - "minimalistic-assert": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", - "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==", - "dev": true - }, - "minimalistic-crypto-utils": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", - "integrity": "sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=", - "dev": true - }, "minimatch": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", @@ -5368,57 +4008,6 @@ "kind-of": "^6.0.3" } }, - "mississippi": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/mississippi/-/mississippi-3.0.0.tgz", - "integrity": "sha512-x471SsVjUtBRtcvd4BzKE9kFC+/2TeWgKCgw0bZcw1b9l2X3QX5vCWgF+KaZaYm87Ss//rHnWryupDrgLvmSkA==", - "dev": true, - "requires": { - "concat-stream": "^1.5.0", - "duplexify": "^3.4.2", - "end-of-stream": "^1.1.0", - "flush-write-stream": "^1.0.0", - "from2": "^2.1.0", - "parallel-transform": "^1.1.0", - "pump": "^3.0.0", - "pumpify": "^1.3.3", - "stream-each": "^1.1.0", - "through2": "^2.0.0" - }, - "dependencies": { - "through2": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", - "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", - "dev": true, - "requires": { - "readable-stream": "~2.3.6", - "xtend": "~4.0.1" - } - } - } - }, - "mixin-deep": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.2.tgz", - "integrity": "sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA==", - "dev": true, - "requires": { - "for-in": "^1.0.2", - "is-extendable": "^1.0.1" - }, - "dependencies": { - "is-extendable": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", - "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", - "dev": true, - "requires": { - "is-plain-object": "^2.0.4" - } - } - } - }, "mkdirp": { "version": "0.5.5", "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", @@ -5464,45 +4053,12 @@ } } }, - "move-concurrently": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/move-concurrently/-/move-concurrently-1.0.1.tgz", - "integrity": "sha1-viwAX9oy4LKa8fBdfEszIUxwH5I=", - "dev": true, - "requires": { - "aproba": "^1.1.1", - "copy-concurrently": "^1.0.0", - "fs-write-stream-atomic": "^1.0.8", - "mkdirp": "^0.5.1", - "rimraf": "^2.5.4", - "run-queue": "^1.0.3" - } - }, "ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", "dev": true }, - "nanomatch": { - "version": "1.2.13", - "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz", - "integrity": "sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA==", - "dev": true, - "requires": { - "arr-diff": "^4.0.0", - "array-unique": "^0.3.2", - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "fragment-cache": "^0.2.1", - "is-windows": "^1.0.2", - "kind-of": "^6.0.2", - "object.pick": "^1.3.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.1" - } - }, "natural-compare": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", @@ -5521,12 +4077,6 @@ "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", "dev": true }, - "nice-try": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", - "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", - "dev": true - }, "nocache": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/nocache/-/nocache-2.1.0.tgz", @@ -5550,45 +4100,6 @@ "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz", "integrity": "sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw==" }, - "node-libs-browser": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/node-libs-browser/-/node-libs-browser-2.2.1.tgz", - "integrity": "sha512-h/zcD8H9kaDZ9ALUWwlBUDo6TKF8a7qBSCSEGfjTVIYeqsioSKaAX+BN7NgiMGp6iSIXZ3PxgCu8KS3b71YK5Q==", - "dev": true, - "requires": { - "assert": "^1.1.1", - "browserify-zlib": "^0.2.0", - "buffer": "^4.3.0", - "console-browserify": "^1.1.0", - "constants-browserify": "^1.0.0", - "crypto-browserify": "^3.11.0", - "domain-browser": "^1.1.1", - "events": "^3.0.0", - "https-browserify": "^1.0.0", - "os-browserify": "^0.3.0", - "path-browserify": "0.0.1", - "process": "^0.11.10", - "punycode": "^1.2.4", - "querystring-es3": "^0.2.0", - "readable-stream": "^2.3.3", - "stream-browserify": "^2.0.1", - "stream-http": "^2.7.2", - "string_decoder": "^1.0.0", - "timers-browserify": "^2.0.4", - "tty-browserify": "0.0.0", - "url": "^0.11.0", - "util": "^0.11.0", - "vm-browserify": "^1.0.1" - }, - "dependencies": { - "punycode": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", - "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=", - "dev": true - } - } - }, "node-preload": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/node-preload/-/node-preload-0.2.1.tgz", @@ -5598,6 +4109,12 @@ "process-on-spawn": "^1.0.0" } }, + "node-releases": { + "version": "1.1.64", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.64.tgz", + "integrity": "sha512-Iec8O9166/x2HRMJyLLLWkd0sFFLrFNy+Xf+JQfSQsdBJzPcHpNl3JQ9gD4j+aJxmCa25jNsIbM4bmACtSbkSg==", + "dev": true + }, "normalize-package-data": { "version": "2.5.0", "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", @@ -5694,37 +4211,6 @@ "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", "dev": true }, - "object-copy": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz", - "integrity": "sha1-fn2Fi3gb18mRpBupde04EnVOmYw=", - "dev": true, - "requires": { - "copy-descriptor": "^0.1.0", - "define-property": "^0.2.5", - "kind-of": "^3.0.3" - }, - "dependencies": { - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "dev": true, - "requires": { - "is-descriptor": "^0.1.0" - } - }, - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, "object-inspect": { "version": "1.8.0", "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.8.0.tgz", @@ -5737,15 +4223,6 @@ "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", "dev": true }, - "object-visit": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz", - "integrity": "sha1-95xEk68MU3e1n+OdOV5BBC3QRbs=", - "dev": true, - "requires": { - "isobject": "^3.0.0" - } - }, "object.assign": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.1.tgz", @@ -5790,15 +4267,6 @@ } } }, - "object.pick": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz", - "integrity": "sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c=", - "dev": true, - "requires": { - "isobject": "^3.0.1" - } - }, "object.values": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.1.1.tgz", @@ -5891,12 +4359,6 @@ "word-wrap": "^1.2.3" } }, - "os-browserify": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/os-browserify/-/os-browserify-0.3.0.tgz", - "integrity": "sha1-hUNzx/XCMVkU/Jv8a9gjj92h7Cc=", - "dev": true - }, "p-limit": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", @@ -5942,23 +4404,6 @@ "release-zalgo": "^1.0.0" } }, - "pako": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.11.tgz", - "integrity": "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==", - "dev": true - }, - "parallel-transform": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/parallel-transform/-/parallel-transform-1.2.0.tgz", - "integrity": "sha512-P2vSmIu38uIlvdcU7fDkyrxj33gTUy/ABO5ZUbGowxNCopBq/OoD42bP4UmMrJoPyk4Uqf0mu3mtWBhHCZD8yg==", - "dev": true, - "requires": { - "cyclist": "^1.0.1", - "inherits": "^2.0.3", - "readable-stream": "^2.1.5" - } - }, "parent-module": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", @@ -5968,19 +4413,6 @@ "callsites": "^3.0.0" } }, - "parse-asn1": { - "version": "5.1.6", - "resolved": "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.6.tgz", - "integrity": "sha512-RnZRo1EPU6JBnra2vGHj0yhp6ebyjBZpmUCLHWiFhxlzvBCCpAuZ7elsBp1PVAbQN0/04VD/19rfzlBSwLstMw==", - "dev": true, - "requires": { - "asn1.js": "^5.2.0", - "browserify-aes": "^1.0.0", - "evp_bytestokey": "^1.0.0", - "pbkdf2": "^3.0.3", - "safe-buffer": "^5.1.1" - } - }, "parse-json": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.1.0.tgz", @@ -5993,36 +4425,12 @@ "lines-and-columns": "^1.1.6" } }, - "parse-passwd": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/parse-passwd/-/parse-passwd-1.0.0.tgz", - "integrity": "sha1-bVuTSkVpk7I9N/QKOC1vFmao5cY=", - "dev": true - }, "parseurl": { "version": "1.3.3", "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", "dev": true }, - "pascalcase": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz", - "integrity": "sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=", - "dev": true - }, - "path-browserify": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-0.0.1.tgz", - "integrity": "sha512-BapA40NHICOS+USX9SN4tyhq+A2RrN/Ws5F0Z5aMHDp98Fl86lX8Oti8B7uN93L4Ifv4fHOEA+pQw87gmMO/lQ==", - "dev": true - }, - "path-dirname": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/path-dirname/-/path-dirname-1.0.2.tgz", - "integrity": "sha1-zDPSTVJeCZpTiMAzbG4yuRYGCeA=", - "dev": true - }, "path-exists": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", @@ -6059,19 +4467,6 @@ "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", "dev": true }, - "pbkdf2": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.1.1.tgz", - "integrity": "sha512-4Ejy1OPxi9f2tt1rRV7Go7zmfDQ+ZectEQz3VGUQhgq62HtIRPDyG/JtnwIxs6x3uNMwo2V7q1fMvKjb+Tnpqg==", - "dev": true, - "requires": { - "create-hash": "^1.1.2", - "create-hmac": "^1.1.4", - "ripemd160": "^2.0.1", - "safe-buffer": "^5.0.1", - "sha.js": "^2.4.8" - } - }, "picomatch": { "version": "2.2.2", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz", @@ -6175,12 +4570,6 @@ } } }, - "posix-character-classes": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz", - "integrity": "sha1-AerA/jta9xoqbAL+q7jB/vfgDqs=", - "dev": true - }, "prelude-ls": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", @@ -6202,12 +4591,6 @@ "fast-diff": "^1.1.2" } }, - "process": { - "version": "0.11.10", - "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", - "integrity": "sha1-czIwDoQBYb2j5podHZGn1LwW8YI=", - "dev": true - }, "process-nextick-args": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", @@ -6229,12 +4612,6 @@ "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", "dev": true }, - "promise-inflight": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/promise-inflight/-/promise-inflight-1.0.1.tgz", - "integrity": "sha1-mEcocL8igTL8vdhoEputEsPAKeM=", - "dev": true - }, "propagate": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/propagate/-/propagate-2.0.1.tgz", @@ -6257,28 +4634,6 @@ "integrity": "sha1-0/wRS6BplaRexok/SEzrHXj19HY=", "dev": true }, - "public-encrypt": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/public-encrypt/-/public-encrypt-4.0.3.tgz", - "integrity": "sha512-zVpa8oKZSz5bTMTFClc1fQOnyyEzpl5ozpi1B5YcvBrdohMjH2rfsBtyXcuNuwjsDIXmBYlF2N5FlJYhR29t8Q==", - "dev": true, - "requires": { - "bn.js": "^4.1.0", - "browserify-rsa": "^4.0.0", - "create-hash": "^1.1.0", - "parse-asn1": "^5.0.0", - "randombytes": "^2.0.1", - "safe-buffer": "^5.1.2" - }, - "dependencies": { - "bn.js": { - "version": "4.11.9", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.9.tgz", - "integrity": "sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw==", - "dev": true - } - } - }, "pump": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", @@ -6289,29 +4644,6 @@ "once": "^1.3.1" } }, - "pumpify": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/pumpify/-/pumpify-1.5.1.tgz", - "integrity": "sha512-oClZI37HvuUJJxSKKrC17bZ9Cu0ZYhEAGPsPUy9KlMUmv9dKX2o77RUmq7f3XjIxbwyGwYzbzQ1L2Ks8sIradQ==", - "dev": true, - "requires": { - "duplexify": "^3.6.0", - "inherits": "^2.0.3", - "pump": "^2.0.0" - }, - "dependencies": { - "pump": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/pump/-/pump-2.0.1.tgz", - "integrity": "sha512-ruPMNRkN3MHP1cWJc9OWr+T/xDP0jhXYCLfJcBuX54hhfIBnaQmAUMfDcG4DM5UMWByBbJY69QSphm3jtDKIkA==", - "dev": true, - "requires": { - "end-of-stream": "^1.1.0", - "once": "^1.3.1" - } - } - } - }, "punycode": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", @@ -6330,18 +4662,6 @@ "integrity": "sha512-A1kFqHekCTM7cz0udomYUoYNWjBebHm/5wzU/XqrBRBNWectVH0QIiN+NEcZ0Dte5hvzHwbr8+XQmguPhJ6WdQ==", "dev": true }, - "querystring": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/querystring/-/querystring-0.2.0.tgz", - "integrity": "sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA=", - "dev": true - }, - "querystring-es3": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/querystring-es3/-/querystring-es3-0.2.1.tgz", - "integrity": "sha1-nsYfeQSYdXB9aUFFlv2Qek1xHnM=", - "dev": true - }, "querystringify": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.2.0.tgz", @@ -6363,16 +4683,6 @@ "safe-buffer": "^5.1.0" } }, - "randomfill": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/randomfill/-/randomfill-1.0.4.tgz", - "integrity": "sha512-87lcbR8+MhcWcUiQ+9e+Rwx8MyR2P7qnt15ynUlbm3TU/fjbgz4GsvfSUDTemtCCtVCqb4ZcEFlyPNTh9bBTLw==", - "dev": true, - "requires": { - "randombytes": "^2.0.5", - "safe-buffer": "^5.1.0" - } - }, "range-parser": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", @@ -6445,14 +4755,13 @@ "util-deprecate": "~1.0.1" } }, - "readdirp": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.4.0.tgz", - "integrity": "sha512-0xe001vZBnJEK+uKcj8qOhyAKPzIT+gStxWr3LCB0DwcXR5NZJ3IaC+yGnHCYzB/S7ov3m3EEbZI2zeNvX+hGQ==", + "rechoir": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.7.0.tgz", + "integrity": "sha512-ADsDEH2bvbjltXEP+hTIAmeFekTFK0V2BTxMkok6qILyAJEXV0AFfoWcAq4yfll5VdIMd/RVXq0lR+wQi5ZU3Q==", "dev": true, - "optional": true, "requires": { - "picomatch": "^2.2.1" + "resolve": "^1.9.0" } }, "redent": { @@ -6465,22 +4774,18 @@ "strip-indent": "^3.0.0" } }, + "reduce-flatten": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/reduce-flatten/-/reduce-flatten-2.0.0.tgz", + "integrity": "sha512-EJ4UNY/U1t2P/2k6oqotuX2Cc3T6nxJwsM0N0asT7dhrtH1ltUxDn4NalSYmPE2rCkVpcf/X6R0wDwcFpzhd4w==", + "dev": true + }, "regenerator-runtime": { "version": "0.13.7", "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.7.tgz", "integrity": "sha512-a54FxoJDIr27pgf7IgeQGxmqUNYrcV338lf/6gH456HZ/PhX+5BcwHXG9ajESmwe6WRO0tAzRUrRmNONWgkrew==", "dev": true }, - "regex-not": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz", - "integrity": "sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==", - "dev": true, - "requires": { - "extend-shallow": "^3.0.2", - "safe-regex": "^1.1.0" - } - }, "regexpp": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.1.0.tgz", @@ -6496,25 +4801,6 @@ "es6-error": "^4.0.1" } }, - "remove-trailing-separator": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", - "integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8=", - "dev": true, - "optional": true - }, - "repeat-element": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.3.tgz", - "integrity": "sha512-ahGq0ZnV5m5XtZLMb+vP76kcAM5nkLqk0lpqAuojSKGgQtn4eRi4ZZGm2olo2zKFH+sMsWaqOCW1dqAnOru72g==", - "dev": true - }, - "repeat-string": { - "version": "1.6.1", - "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", - "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=", - "dev": true - }, "require-directory": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", @@ -6534,52 +4820,22 @@ "dev": true }, "resolve": { - "version": "1.17.0", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz", - "integrity": "sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w==", + "version": "1.18.1", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.18.1.tgz", + "integrity": "sha512-lDfCPaMKfOJXjy0dPayzPdF1phampNWr3qFCjAu+rw/qbQmr5jWH5xN2hwh9QKfw9E5v4hwV7A+jrCmL8yjjqA==", "dev": true, "requires": { + "is-core-module": "^2.0.0", "path-parse": "^1.0.6" } }, "resolve-cwd": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-2.0.0.tgz", - "integrity": "sha1-AKn3OHVW4nA46uIyyqNypqWbZlo=", - "dev": true, - "requires": { - "resolve-from": "^3.0.0" - }, - "dependencies": { - "resolve-from": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-3.0.0.tgz", - "integrity": "sha1-six699nWiBvItuZTM17rywoYh0g=", - "dev": true - } - } - }, - "resolve-dir": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/resolve-dir/-/resolve-dir-1.0.1.tgz", - "integrity": "sha1-eaQGRMNivoLybv/nOcm7U4IEb0M=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-3.0.0.tgz", + "integrity": "sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==", "dev": true, "requires": { - "expand-tilde": "^2.0.0", - "global-modules": "^1.0.0" - }, - "dependencies": { - "global-modules": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/global-modules/-/global-modules-1.0.0.tgz", - "integrity": "sha512-sKzpEkf11GpOFuw0Zzjzmt4B4UZwjOcG757PPvrfhxcLFbq0wpsgpOqxpxtxFiCG4DtG93M6XRVbF2oGdev7bg==", - "dev": true, - "requires": { - "global-prefix": "^1.0.1", - "is-windows": "^1.0.1", - "resolve-dir": "^1.0.0" - } - } + "resolve-from": "^5.0.0" } }, "resolve-from": { @@ -6597,12 +4853,6 @@ "global-dirs": "^0.1.1" } }, - "resolve-url": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", - "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=", - "dev": true - }, "restore-cursor": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz", @@ -6613,12 +4863,6 @@ "signal-exit": "^3.0.2" } }, - "ret": { - "version": "0.1.15", - "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz", - "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==", - "dev": true - }, "reusify": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", @@ -6634,16 +4878,6 @@ "glob": "^7.1.3" } }, - "ripemd160": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz", - "integrity": "sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==", - "dev": true, - "requires": { - "hash-base": "^3.0.0", - "inherits": "^2.0.1" - } - }, "route-recognizer": { "version": "0.3.4", "resolved": "https://registry.npmjs.org/route-recognizer/-/route-recognizer-0.3.4.tgz", @@ -6651,20 +4885,11 @@ "dev": true }, "run-parallel": { - "version": "1.1.9", - "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.1.9.tgz", - "integrity": "sha512-DEqnSRTDw/Tc3FXf49zedI638Z9onwUotBMiUFKmrO2sdFKIbXamXGQ3Axd4qgphxKB4kw/qP1w5kTxnfU1B9Q==", + "version": "1.1.10", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.1.10.tgz", + "integrity": "sha512-zb/1OuZ6flOlH6tQyMPUrE3x3Ulxjlo9WIVXR4yVYi4H9UXQaeIsPbLn2R3O3vQCnDKkAl2qHiuocKKX4Tz/Sw==", "dev": true }, - "run-queue": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/run-queue/-/run-queue-1.0.3.tgz", - "integrity": "sha1-6Eg5bwV9Ij8kOGkkYY4laUFh7Ec=", - "dev": true, - "requires": { - "aproba": "^1.1.1" - } - }, "rxjs": { "version": "6.6.3", "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.6.3.tgz", @@ -6680,15 +4905,6 @@ "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", "dev": true }, - "safe-regex": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", - "integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=", - "dev": true, - "requires": { - "ret": "~0.1.10" - } - }, "safer-buffer": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", @@ -6696,14 +4912,14 @@ "dev": true }, "schema-utils": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-1.0.0.tgz", - "integrity": "sha512-i27Mic4KovM/lnGsy8whRCHhc7VicJajAjTrYg11K9zfZXnYIt4k5F+kZkwjnrhKzLic/HLU4j11mjsz2G/75g==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.0.0.tgz", + "integrity": "sha512-6D82/xSzO094ajanoOSbe4YvXWMfn2A//8Y1+MUqFAJul5Bs+yn36xbK9OtNDcRVSBJ9jjeoXftM6CfztsjOAA==", "dev": true, "requires": { - "ajv": "^6.1.0", - "ajv-errors": "^1.0.0", - "ajv-keywords": "^3.1.0" + "@types/json-schema": "^7.0.6", + "ajv": "^6.12.5", + "ajv-keywords": "^3.5.2" } }, "secure-compare": { @@ -6777,9 +4993,9 @@ } }, "serialize-javascript": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-4.0.0.tgz", - "integrity": "sha512-GaNA54380uFefWghODBWEGisLZFj00nS5ACs6yHa9nLqlLpVLO8ChDGeKRjZnV4Nh4n0Qi7nhYZD/9fCPzEqkw==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-5.0.1.tgz", + "integrity": "sha512-SaaNal9imEO737H2c05Og0/8LUXG7EnsZyMa8MzkmuHoELfT6txuj0cMqRj6zfPKnmQ1yasR4PCJc8x+M4JSPA==", "dev": true, "requires": { "randombytes": "^2.1.0" @@ -6809,35 +5025,6 @@ "integrity": "sha512-mNCnTUF0OYPwYzSHbdRdCfNNHqrne+HS5tS5xNb6yJbdP9wInV0q5xPLE0EyfV/Q3tImo3y/OXpD8Jn0Jtnjrg==", "dev": true }, - "set-value": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.1.tgz", - "integrity": "sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw==", - "dev": true, - "requires": { - "extend-shallow": "^2.0.1", - "is-extendable": "^0.1.1", - "is-plain-object": "^2.0.3", - "split-string": "^3.0.1" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "setimmediate": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", - "integrity": "sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU=", - "dev": true - }, "setprototypeof": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.1.tgz", @@ -6850,16 +5037,6 @@ "integrity": "sha512-BbOxCvMnDHAPG9e3Qw3Ol4/ZWLwnDnhODqrfiIpAtF7Azu0O3PI4svZIfsh+/EV9xNj15LMkvchaWsDvF4A3hQ==", "dev": true }, - "sha.js": { - "version": "2.4.11", - "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", - "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", - "dev": true, - "requires": { - "inherits": "^2.0.1", - "safe-buffer": "^5.0.1" - } - }, "shallow-clone": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/shallow-clone/-/shallow-clone-3.0.1.tgz", @@ -6945,128 +5122,6 @@ "integrity": "sha512-WpECLAgYaxHoEAJ8Q1Lo8HOs1ngn7LN7QjXgOLbmmfkcWvosyk4ZTXkTzKyhngK640USTZUlgoQJfED1kz5fnQ==", "dev": true }, - "snapdragon": { - "version": "0.8.2", - "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz", - "integrity": "sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg==", - "dev": true, - "requires": { - "base": "^0.11.1", - "debug": "^2.2.0", - "define-property": "^0.2.5", - "extend-shallow": "^2.0.1", - "map-cache": "^0.2.2", - "source-map": "^0.5.6", - "source-map-resolve": "^0.5.0", - "use": "^3.1.0" - }, - "dependencies": { - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, - "requires": { - "ms": "2.0.0" - } - }, - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "dev": true, - "requires": { - "is-descriptor": "^0.1.0" - } - }, - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", - "dev": true - } - } - }, - "snapdragon-node": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/snapdragon-node/-/snapdragon-node-2.1.1.tgz", - "integrity": "sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw==", - "dev": true, - "requires": { - "define-property": "^1.0.0", - "isobject": "^3.0.0", - "snapdragon-util": "^3.0.1" - }, - "dependencies": { - "define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", - "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", - "dev": true, - "requires": { - "is-descriptor": "^1.0.0" - } - }, - "is-accessor-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-data-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-descriptor": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", - "dev": true, - "requires": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" - } - } - } - }, - "snapdragon-util": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/snapdragon-util/-/snapdragon-util-3.0.1.tgz", - "integrity": "sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ==", - "dev": true, - "requires": { - "kind-of": "^3.2.0" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, "source-list-map": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/source-list-map/-/source-list-map-2.0.1.tgz", @@ -7079,19 +5134,6 @@ "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", "dev": true }, - "source-map-resolve": { - "version": "0.5.3", - "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.3.tgz", - "integrity": "sha512-Htz+RnsXWk5+P2slx5Jh3Q66vhQj1Cllm0zvnaY98+NFx+Dv2CF/f5O/t8x+KaNdrdIAsruNzoh/KpialbqAnw==", - "dev": true, - "requires": { - "atob": "^2.1.2", - "decode-uri-component": "^0.2.0", - "resolve-url": "^0.2.1", - "source-map-url": "^0.4.0", - "urix": "^0.1.0" - } - }, "source-map-support": { "version": "0.5.19", "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.19.tgz", @@ -7110,12 +5152,6 @@ } } }, - "source-map-url": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.0.tgz", - "integrity": "sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM=", - "dev": true - }, "spawn-wrap": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/spawn-wrap/-/spawn-wrap-2.0.0.tgz", @@ -7173,15 +5209,6 @@ "integrity": "sha512-+orQK83kyMva3WyPf59k1+Y525csj5JejicWut55zeTWANuN17qSiSLUXWtzHeNWORSvT7GLDJ/E/XiIWoXBTw==", "dev": true }, - "split-string": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz", - "integrity": "sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw==", - "dev": true, - "requires": { - "extend-shallow": "^3.0.0" - } - }, "split2": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/split2/-/split2-2.2.0.tgz", @@ -7209,81 +5236,12 @@ "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", "dev": true }, - "ssri": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/ssri/-/ssri-6.0.1.tgz", - "integrity": "sha512-3Wge10hNcT1Kur4PDFwEieXSCMCJs/7WvSACcrMYrNp+b8kDL1/0wJch5Ni2WrtwEa2IO8OsVfeKIciKCDx/QA==", - "dev": true, - "requires": { - "figgy-pudding": "^3.5.1" - } - }, - "static-extend": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz", - "integrity": "sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY=", - "dev": true, - "requires": { - "define-property": "^0.2.5", - "object-copy": "^0.1.0" - }, - "dependencies": { - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "dev": true, - "requires": { - "is-descriptor": "^0.1.0" - } - } - } - }, "statuses": { "version": "1.5.0", "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", "integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow=", "dev": true }, - "stream-browserify": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/stream-browserify/-/stream-browserify-2.0.2.tgz", - "integrity": "sha512-nX6hmklHs/gr2FuxYDltq8fJA1GDlxKQCz8O/IM4atRqBH8OORmBNgfvW5gG10GT/qQ9u0CzIvr2X5Pkt6ntqg==", - "dev": true, - "requires": { - "inherits": "~2.0.1", - "readable-stream": "^2.0.2" - } - }, - "stream-each": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/stream-each/-/stream-each-1.2.3.tgz", - "integrity": "sha512-vlMC2f8I2u/bZGqkdfLQW/13Zihpej/7PmSiMQsbYddxuTsJp8vRe2x2FvVExZg7FaOds43ROAuFJwPR4MTZLw==", - "dev": true, - "requires": { - "end-of-stream": "^1.1.0", - "stream-shift": "^1.0.0" - } - }, - "stream-http": { - "version": "2.8.3", - "resolved": "https://registry.npmjs.org/stream-http/-/stream-http-2.8.3.tgz", - "integrity": "sha512-+TSkfINHDo4J+ZobQLWiMouQYB+UVYFttRA94FpEzzJ7ZdqcL4uUUQ7WkdkI4DSozGmgBUE/a47L+38PenXhUw==", - "dev": true, - "requires": { - "builtin-status-codes": "^3.0.0", - "inherits": "^2.0.1", - "readable-stream": "^2.3.6", - "to-arraybuffer": "^1.0.0", - "xtend": "^4.0.0" - } - }, - "stream-shift": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.1.tgz", - "integrity": "sha512-AiisoFqQ0vbGcZgQPY1cdP2I76glaVA/RauYR4G4thNFgkTqr90yXTo4LYX60Jl+sIlPNHHdGSwo01AvbKUSVQ==", - "dev": true - }, "string-argv": { "version": "0.3.1", "resolved": "https://registry.npmjs.org/string-argv/-/string-argv-0.3.1.tgz", @@ -7302,65 +5260,23 @@ } }, "string.prototype.trimend": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.1.tgz", - "integrity": "sha512-LRPxFUaTtpqYsTeNKaFOw3R4bxIzWOnbQ837QfBylo8jIxtcbK/A/sMV7Q+OAV/vWo+7s25pOE10KYSjaSO06g==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.2.tgz", + "integrity": "sha512-8oAG/hi14Z4nOVP0z6mdiVZ/wqjDtWSLygMigTzAb+7aPEDTleeFf+WrF+alzecxIRkckkJVn+dTlwzJXORATw==", "dev": true, "requires": { "define-properties": "^1.1.3", - "es-abstract": "^1.17.5" - }, - "dependencies": { - "es-abstract": { - "version": "1.17.7", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.7.tgz", - "integrity": "sha512-VBl/gnfcJ7OercKA9MVaegWsBHFjV492syMudcnQZvt/Dw8ezpcOHYZXa/J96O8vx+g4x65YKhxOwDUh63aS5g==", - "dev": true, - "requires": { - "es-to-primitive": "^1.2.1", - "function-bind": "^1.1.1", - "has": "^1.0.3", - "has-symbols": "^1.0.1", - "is-callable": "^1.2.2", - "is-regex": "^1.1.1", - "object-inspect": "^1.8.0", - "object-keys": "^1.1.1", - "object.assign": "^4.1.1", - "string.prototype.trimend": "^1.0.1", - "string.prototype.trimstart": "^1.0.1" - } - } + "es-abstract": "^1.18.0-next.1" } }, "string.prototype.trimstart": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.1.tgz", - "integrity": "sha512-XxZn+QpvrBI1FOcg6dIpxUPgWCPuNXvMD72aaRaUQv1eD4e/Qy8i/hFTe0BUmD60p/QA6bh1avmuPTfNjqVWRw==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.2.tgz", + "integrity": "sha512-7F6CdBTl5zyu30BJFdzSTlSlLPwODC23Od+iLoVH8X6+3fvDPPuBVVj9iaB1GOsSTSIgVfsfm27R2FGrAPznWg==", "dev": true, "requires": { "define-properties": "^1.1.3", - "es-abstract": "^1.17.5" - }, - "dependencies": { - "es-abstract": { - "version": "1.17.7", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.7.tgz", - "integrity": "sha512-VBl/gnfcJ7OercKA9MVaegWsBHFjV492syMudcnQZvt/Dw8ezpcOHYZXa/J96O8vx+g4x65YKhxOwDUh63aS5g==", - "dev": true, - "requires": { - "es-to-primitive": "^1.2.1", - "function-bind": "^1.1.1", - "has": "^1.0.3", - "has-symbols": "^1.0.1", - "is-callable": "^1.2.2", - "is-regex": "^1.1.1", - "object-inspect": "^1.8.0", - "object-keys": "^1.1.1", - "object.assign": "^4.1.1", - "string.prototype.trimend": "^1.0.1", - "string.prototype.trimstart": "^1.0.1" - } - } + "es-abstract": "^1.18.0-next.1" } }, "string_decoder": { @@ -7488,6 +5404,18 @@ } } }, + "table-layout": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/table-layout/-/table-layout-1.0.1.tgz", + "integrity": "sha512-dEquqYNJiGwY7iPfZ3wbXDI944iqanTSchrACLL2nOB+1r+h1Nzu2eH+DuPPvWvm5Ry7iAPeFlgEtP5bIp5U7Q==", + "dev": true, + "requires": { + "array-back": "^4.0.1", + "deep-extend": "~0.6.0", + "typical": "^5.2.0", + "wordwrapjs": "^4.0.0" + } + }, "tapable": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/tapable/-/tapable-1.1.3.tgz", @@ -7495,14 +5423,14 @@ "dev": true }, "terser": { - "version": "4.8.0", - "resolved": "https://registry.npmjs.org/terser/-/terser-4.8.0.tgz", - "integrity": "sha512-EAPipTNeWsb/3wLPeup1tVPaXfIaU68xMnVdPafIL1TV05OhASArYyIfFvnvJCNrR2NIOvDVNNTFRa+Re2MWyw==", + "version": "5.3.8", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.3.8.tgz", + "integrity": "sha512-zVotuHoIfnYjtlurOouTazciEfL7V38QMAOhGqpXDEg6yT13cF4+fEP9b0rrCEQTn+tT46uxgFsTZzhygk+CzQ==", "dev": true, "requires": { "commander": "^2.20.0", - "source-map": "~0.6.1", - "source-map-support": "~0.5.12" + "source-map": "~0.7.2", + "source-map-support": "~0.5.19" }, "dependencies": { "commander": { @@ -7512,106 +5440,36 @@ "dev": true }, "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "version": "0.7.3", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.3.tgz", + "integrity": "sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ==", "dev": true } } }, "terser-webpack-plugin": { - "version": "1.4.5", - "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-1.4.5.tgz", - "integrity": "sha512-04Rfe496lN8EYruwi6oPQkG0vo8C+HT49X687FZnpPF0qMAIHONI6HEXYPKDOE8e5HjXTyKfqRd/agHtH0kOtw==", + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.0.3.tgz", + "integrity": "sha512-zFdGk8Lh9ZJGPxxPE6jwysOlATWB8GMW8HcfGULWA/nPal+3VdATflQvSBSLQJRCmYZnfFJl6vkRTiwJGNgPiQ==", "dev": true, "requires": { - "cacache": "^12.0.2", - "find-cache-dir": "^2.1.0", - "is-wsl": "^1.1.0", - "schema-utils": "^1.0.0", - "serialize-javascript": "^4.0.0", + "jest-worker": "^26.6.1", + "p-limit": "^3.0.2", + "schema-utils": "^3.0.0", + "serialize-javascript": "^5.0.1", "source-map": "^0.6.1", - "terser": "^4.1.2", - "webpack-sources": "^1.4.0", - "worker-farm": "^1.7.0" + "terser": "^5.3.8" }, "dependencies": { - "find-cache-dir": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-2.1.0.tgz", - "integrity": "sha512-Tq6PixE0w/VMFfCgbONnkiQIVol/JJL7nRMi20fqzA4NRs9AfeqMGeRdPi3wIhYkxjeBaWh2rxwapn5Tu3IqOQ==", - "dev": true, - "requires": { - "commondir": "^1.0.1", - "make-dir": "^2.0.0", - "pkg-dir": "^3.0.0" - } - }, - "find-up": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", - "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", - "dev": true, - "requires": { - "locate-path": "^3.0.0" - } - }, - "locate-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", - "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", - "dev": true, - "requires": { - "p-locate": "^3.0.0", - "path-exists": "^3.0.0" - } - }, - "make-dir": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-2.1.0.tgz", - "integrity": "sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==", - "dev": true, - "requires": { - "pify": "^4.0.1", - "semver": "^5.6.0" - } - }, - "p-locate": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", - "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", - "dev": true, - "requires": { - "p-limit": "^2.0.0" - } - }, - "path-exists": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", - "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", - "dev": true - }, - "pify": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", - "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", - "dev": true - }, - "pkg-dir": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-3.0.0.tgz", - "integrity": "sha512-/E57AYkoeQ25qkxMj5PBOVgF8Kiu/h7cYS30Z5+R7WaiCCBfLq58ZI/dSeaEKb9WVJV5n/03QwrN3IeWIFllvw==", + "p-limit": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.0.2.tgz", + "integrity": "sha512-iwqZSOoWIW+Ew4kAGUlN16J4M7OB3ysMLSZtnhmqx7njIHFPlxWBX8xo3lVTyFVq6mI/lL9qt2IsN1sHwaxJkg==", "dev": true, "requires": { - "find-up": "^3.0.0" + "p-try": "^2.0.0" } }, - "semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "dev": true - }, "source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", @@ -7659,59 +5517,12 @@ "readable-stream": "2 || 3" } }, - "timers-browserify": { - "version": "2.0.11", - "resolved": "https://registry.npmjs.org/timers-browserify/-/timers-browserify-2.0.11.tgz", - "integrity": "sha512-60aV6sgJ5YEbzUdn9c8kYGIqOubPoUdqQCul3SBAsRCZ40s6Y5cMcrW4dt3/k/EsbLVJNl9n6Vz3fTc+k2GeKQ==", - "dev": true, - "requires": { - "setimmediate": "^1.0.4" - } - }, - "to-arraybuffer": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/to-arraybuffer/-/to-arraybuffer-1.0.1.tgz", - "integrity": "sha1-fSKbH8xjfkZsoIEYCDanqr/4P0M=", - "dev": true - }, "to-fast-properties": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=", "dev": true }, - "to-object-path": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/to-object-path/-/to-object-path-0.3.0.tgz", - "integrity": "sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68=", - "dev": true, - "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "to-regex": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/to-regex/-/to-regex-3.0.2.tgz", - "integrity": "sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw==", - "dev": true, - "requires": { - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "regex-not": "^1.0.2", - "safe-regex": "^1.1.0" - } - }, "to-regex-range": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", @@ -7740,9 +5551,9 @@ "dev": true }, "ts-loader": { - "version": "8.0.4", - "resolved": "https://registry.npmjs.org/ts-loader/-/ts-loader-8.0.4.tgz", - "integrity": "sha512-5u8KF1SW8eCUb/Ff7At81e3wznPmT/27fvaGRO9CziVy+6NlPVRvrzSox4OwU0/e6OflOUB32Err4VquysCSAQ==", + "version": "8.0.7", + "resolved": "https://registry.npmjs.org/ts-loader/-/ts-loader-8.0.7.tgz", + "integrity": "sha512-ooa4wxlZ9TOXaJ/iVyZlWsim79Ul4KyifSwyT2hOrbQA6NZJypsLOE198o8Ko+JV+ZHnMArvWcl4AnRqpCU/Mw==", "dev": true, "requires": { "chalk": "^2.3.0", @@ -7850,12 +5661,6 @@ "tslib": "^1.8.1" } }, - "tty-browserify": { - "version": "0.0.0", - "resolved": "https://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.0.tgz", - "integrity": "sha1-oVe6QC2iTpv5V/mqadUk7tQpAaY=", - "dev": true - }, "ttypescript": { "version": "1.5.12", "resolved": "https://registry.npmjs.org/ttypescript/-/ttypescript-1.5.12.tgz", @@ -7890,12 +5695,6 @@ "mime-types": "~2.1.24" } }, - "typedarray": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", - "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=", - "dev": true - }, "typedarray-to-buffer": { "version": "3.1.5", "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz", @@ -7906,9 +5705,15 @@ } }, "typescript": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.0.3.tgz", - "integrity": "sha512-tEu6DGxGgRJPb/mVPIZ48e69xCn2yRmCgYmDugAVwmJ6o+0u1RI18eO7E7WBTLYLaEVVOhwQmcdhQHweux/WPg==", + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.0.5.tgz", + "integrity": "sha512-ywmr/VrTVCmNTJ6iV2LwIrfG1P+lv6luD8sUJs+2eI9NLGigaN+nUQc13iHqisq7bra9lnmUSYqbJvegraBOPQ==", + "dev": true + }, + "typical": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/typical/-/typical-5.2.0.tgz", + "integrity": "sha512-dvdQgNDNJo+8B2uBQoqdb11eUCE1JQXhvjC/CZtgvZseVd5TYMXnq0+vuUemXbd/Se29cTaUuPX3YIc2xgbvIg==", "dev": true }, "union": { @@ -7920,36 +5725,6 @@ "qs": "^6.4.0" } }, - "union-value": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.1.tgz", - "integrity": "sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg==", - "dev": true, - "requires": { - "arr-union": "^3.1.0", - "get-value": "^2.0.6", - "is-extendable": "^0.1.1", - "set-value": "^2.0.1" - } - }, - "unique-filename": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/unique-filename/-/unique-filename-1.1.1.tgz", - "integrity": "sha512-Vmp0jIp2ln35UTXuryvjzkjGdRyf9b2lTXuSYUiPmzRcl3FDtYqAwOnTJkAngD9SWhnoJzDbTKwaOrZ+STtxNQ==", - "dev": true, - "requires": { - "unique-slug": "^2.0.0" - } - }, - "unique-slug": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/unique-slug/-/unique-slug-2.0.2.tgz", - "integrity": "sha512-zoWr9ObaxALD3DOPfjPSqxt4fnZiWblxHIgeWqW8x7UqDzEtHEQLzji2cuJYQFCU6KmoJikOYAZlrTHHebjx2w==", - "dev": true, - "requires": { - "imurmurhash": "^0.1.4" - } - }, "universalify": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/universalify/-/universalify-1.0.0.tgz", @@ -7962,53 +5737,6 @@ "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=", "dev": true }, - "unset-value": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz", - "integrity": "sha1-g3aHP30jNRef+x5vw6jtDfyKtVk=", - "dev": true, - "requires": { - "has-value": "^0.3.1", - "isobject": "^3.0.0" - }, - "dependencies": { - "has-value": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/has-value/-/has-value-0.3.1.tgz", - "integrity": "sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8=", - "dev": true, - "requires": { - "get-value": "^2.0.3", - "has-values": "^0.1.4", - "isobject": "^2.0.0" - }, - "dependencies": { - "isobject": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", - "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", - "dev": true, - "requires": { - "isarray": "1.0.0" - } - } - } - }, - "has-values": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/has-values/-/has-values-0.1.4.tgz", - "integrity": "sha1-bWHeldkd/Km5oCCJrThL/49it3E=", - "dev": true - } - } - }, - "upath": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/upath/-/upath-1.2.0.tgz", - "integrity": "sha512-aZwGpamFO61g3OlfT7OQCHqhGnW43ieH9WZeP7QxN/G/jS4jfqUkZxoryvJgVPEcrl5NL/ggHsSmLMHuH64Lhg==", - "dev": true, - "optional": true - }, "uri-js": { "version": "4.4.0", "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.0.tgz", @@ -8018,30 +5746,6 @@ "punycode": "^2.1.0" } }, - "urix": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz", - "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=", - "dev": true - }, - "url": { - "version": "0.11.0", - "resolved": "https://registry.npmjs.org/url/-/url-0.11.0.tgz", - "integrity": "sha1-ODjpfPxgUh63PFJajlW/3Z4uKPE=", - "dev": true, - "requires": { - "punycode": "1.3.2", - "querystring": "0.2.0" - }, - "dependencies": { - "punycode": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz", - "integrity": "sha1-llOgNvt8HuQjQvIyXM7v6jkmxI0=", - "dev": true - } - } - }, "url-join": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/url-join/-/url-join-2.0.5.tgz", @@ -8058,35 +5762,12 @@ "requires-port": "^1.0.0" } }, - "use": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz", - "integrity": "sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==", - "dev": true - }, "utf8-byte-length": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/utf8-byte-length/-/utf8-byte-length-1.0.4.tgz", "integrity": "sha1-9F8VDExm7uloGGUFq5P8u4rWv2E=", "dev": true }, - "util": { - "version": "0.11.1", - "resolved": "https://registry.npmjs.org/util/-/util-0.11.1.tgz", - "integrity": "sha512-HShAsny+zS2TZfaXxD9tYj4HQGlBezXZMZuM/S5PKLLoZkShZiGk9o5CzukI1LVHZvjdvZ2Sj1aW/Ndn2NB/HQ==", - "dev": true, - "requires": { - "inherits": "2.0.3" - }, - "dependencies": { - "inherits": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", - "dev": true - } - } - }, "util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", @@ -8106,9 +5787,9 @@ "dev": true }, "v8-compile-cache": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.1.1.tgz", - "integrity": "sha512-8OQ9CL+VWyt3JStj7HX7/ciTL2V3Rl1Wf5OL+SNTm0yK1KvtReVulksyeRnCANHHuUxHlQig+JJDlUhBt1NQDQ==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.2.0.tgz", + "integrity": "sha512-gTpR5XQNKFwOd4clxfnhaqvfqMpqEwr4tOtCyz4MtYZX2JYhfr1JvBFKdS+7K/9rfpZR3VLX+YWBbKoxCgS43Q==", "dev": true }, "validate-npm-package-license": { @@ -8127,653 +5808,109 @@ "integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=", "dev": true }, - "vm-browserify": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/vm-browserify/-/vm-browserify-1.1.2.tgz", - "integrity": "sha512-2ham8XPWTONajOR0ohOKOHXkm3+gaBmGut3SRuu75xLd/RRaY6vqgh8NBYYk7+RW3u5AtzPQZG8F10LHkl0lAQ==", - "dev": true - }, "watchpack": { - "version": "1.7.4", - "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-1.7.4.tgz", - "integrity": "sha512-aWAgTW4MoSJzZPAicljkO1hsi1oKj/RRq/OJQh2PKI2UKL04c2Bs+MBOB+BBABHTXJpf9mCwHN7ANCvYsvY2sg==", - "dev": true, - "requires": { - "chokidar": "^3.4.1", - "graceful-fs": "^4.1.2", - "neo-async": "^2.5.0", - "watchpack-chokidar2": "^2.0.0" - } - }, - "watchpack-chokidar2": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/watchpack-chokidar2/-/watchpack-chokidar2-2.0.0.tgz", - "integrity": "sha512-9TyfOyN/zLUbA288wZ8IsMZ+6cbzvsNyEzSBp6e/zkifi6xxbl8SmQ/CxQq32k8NNqrdVEVUVSEf56L4rQ/ZxA==", + "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.0.0.tgz", + "integrity": "sha512-xSdCxxYZWNk3VK13bZRYhsQpfa8Vg63zXG+3pyU8ouqSLRCv4IGXIp9Kr226q6GBkGRlZrST2wwKtjfKz2m7Cg==", "dev": true, - "optional": true, "requires": { - "chokidar": "^2.1.8" - }, - "dependencies": { - "anymatch": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-2.0.0.tgz", - "integrity": "sha512-5teOsQWABXHHBFP9y3skS5P3d/WfWXpv3FUpy+LorMrNYaT9pI4oLMQX7jzQ2KklNpGpWHzdCXTDT2Y3XGlZBw==", - "dev": true, - "optional": true, - "requires": { - "micromatch": "^3.1.4", - "normalize-path": "^2.1.1" - }, - "dependencies": { - "normalize-path": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", - "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", - "dev": true, - "optional": true, - "requires": { - "remove-trailing-separator": "^1.0.1" - } - } - } - }, - "binary-extensions": { - "version": "1.13.1", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.13.1.tgz", - "integrity": "sha512-Un7MIEDdUC5gNpcGDV97op1Ywk748MpHcFTHoYs6qnj1Z3j7I53VG3nwZhKzoBZmbdRNnb6WRdFlwl7tSDuZGw==", - "dev": true, - "optional": true - }, - "braces": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", - "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", - "dev": true, - "optional": true, - "requires": { - "arr-flatten": "^1.1.0", - "array-unique": "^0.3.2", - "extend-shallow": "^2.0.1", - "fill-range": "^4.0.0", - "isobject": "^3.0.1", - "repeat-element": "^1.1.2", - "snapdragon": "^0.8.1", - "snapdragon-node": "^2.0.1", - "split-string": "^3.0.2", - "to-regex": "^3.0.1" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "optional": true, - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "chokidar": { - "version": "2.1.8", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-2.1.8.tgz", - "integrity": "sha512-ZmZUazfOzf0Nve7duiCKD23PFSCs4JPoYyccjUFF3aQkQadqBhfzhjkwBH2mNOG9cTBwhamM37EIsIkZw3nRgg==", - "dev": true, - "optional": true, - "requires": { - "anymatch": "^2.0.0", - "async-each": "^1.0.1", - "braces": "^2.3.2", - "glob-parent": "^3.1.0", - "inherits": "^2.0.3", - "is-binary-path": "^1.0.0", - "is-glob": "^4.0.0", - "normalize-path": "^3.0.0", - "path-is-absolute": "^1.0.0", - "readdirp": "^2.2.1", - "upath": "^1.1.1" - } - }, - "fill-range": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", - "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", - "dev": true, - "optional": true, - "requires": { - "extend-shallow": "^2.0.1", - "is-number": "^3.0.0", - "repeat-string": "^1.6.1", - "to-regex-range": "^2.1.0" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "optional": true, - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "glob-parent": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz", - "integrity": "sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4=", - "dev": true, - "optional": true, - "requires": { - "is-glob": "^3.1.0", - "path-dirname": "^1.0.0" - }, - "dependencies": { - "is-glob": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", - "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", - "dev": true, - "optional": true, - "requires": { - "is-extglob": "^2.1.0" - } - } - } - }, - "is-binary-path": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-1.0.1.tgz", - "integrity": "sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg=", - "dev": true, - "optional": true, - "requires": { - "binary-extensions": "^1.0.0" - } - }, - "is-number": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", - "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", - "dev": true, - "optional": true, - "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "optional": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "micromatch": { - "version": "3.1.10", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", - "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", - "dev": true, - "optional": true, - "requires": { - "arr-diff": "^4.0.0", - "array-unique": "^0.3.2", - "braces": "^2.3.1", - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "extglob": "^2.0.4", - "fragment-cache": "^0.2.1", - "kind-of": "^6.0.2", - "nanomatch": "^1.2.9", - "object.pick": "^1.3.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.2" - } - }, - "readdirp": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-2.2.1.tgz", - "integrity": "sha512-1JU/8q+VgFZyxwrJ+SVIOsh+KywWGpds3NTqikiKpDMZWScmAYyKIgqkO+ARvNWJfXeXR1zxz7aHF4u4CyH6vQ==", - "dev": true, - "optional": true, - "requires": { - "graceful-fs": "^4.1.11", - "micromatch": "^3.1.10", - "readable-stream": "^2.0.2" - } - }, - "to-regex-range": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", - "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", - "dev": true, - "optional": true, - "requires": { - "is-number": "^3.0.0", - "repeat-string": "^1.6.1" - } - } + "glob-to-regexp": "^0.4.1", + "graceful-fs": "^4.1.2" } }, "webpack": { - "version": "4.44.2", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-4.44.2.tgz", - "integrity": "sha512-6KJVGlCxYdISyurpQ0IPTklv+DULv05rs2hseIXer6D7KrUicRDLFb4IUM1S6LUAKypPM/nSiVSuv8jHu1m3/Q==", + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.3.1.tgz", + "integrity": "sha512-pQfG9Mjyis1HkHb5gpXYF+ymjnuq7/7ssE+m1VdiyulwmCpxjXDPNcNXyObb7vGBZ4vEXnsjPCXUYSQLf1TJAQ==", "dev": true, "requires": { + "@types/eslint-scope": "^3.7.0", + "@types/estree": "^0.0.45", "@webassemblyjs/ast": "1.9.0", "@webassemblyjs/helper-module-context": "1.9.0", "@webassemblyjs/wasm-edit": "1.9.0", "@webassemblyjs/wasm-parser": "1.9.0", - "acorn": "^6.4.1", - "ajv": "^6.10.2", - "ajv-keywords": "^3.4.1", + "acorn": "^8.0.4", + "browserslist": "^4.14.5", "chrome-trace-event": "^1.0.2", - "enhanced-resolve": "^4.3.0", - "eslint-scope": "^4.0.3", + "enhanced-resolve": "^5.3.1", + "eslint-scope": "^5.1.1", + "events": "^3.2.0", + "glob-to-regexp": "^0.4.1", + "graceful-fs": "^4.2.4", "json-parse-better-errors": "^1.0.2", - "loader-runner": "^2.4.0", - "loader-utils": "^1.2.3", - "memory-fs": "^0.4.1", - "micromatch": "^3.1.10", - "mkdirp": "^0.5.3", - "neo-async": "^2.6.1", - "node-libs-browser": "^2.2.1", - "schema-utils": "^1.0.0", - "tapable": "^1.1.3", - "terser-webpack-plugin": "^1.4.3", - "watchpack": "^1.7.4", - "webpack-sources": "^1.4.1" + "loader-runner": "^4.1.0", + "mime-types": "^2.1.27", + "neo-async": "^2.6.2", + "pkg-dir": "^4.2.0", + "schema-utils": "^3.0.0", + "tapable": "^2.0.0", + "terser-webpack-plugin": "^5.0.3", + "watchpack": "^2.0.0", + "webpack-sources": "^2.1.1" }, "dependencies": { "acorn": { - "version": "6.4.2", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.4.2.tgz", - "integrity": "sha512-XtGIhXwF8YM8bJhGxG5kXgjkEuNGLTkoYqVE+KMR+aspr4KGYmKYg7yUe3KghyQ9yheNwLnjmzh/7+gfDBmHCQ==", + "version": "8.0.4", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.0.4.tgz", + "integrity": "sha512-XNP0PqF1XD19ZlLKvB7cMmnZswW4C/03pRHgirB30uSJTaS3A3V1/P4sS3HPvFmjoriPCJQs+JDSbm4bL1TxGQ==", "dev": true }, - "braces": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", - "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", - "dev": true, - "requires": { - "arr-flatten": "^1.1.0", - "array-unique": "^0.3.2", - "extend-shallow": "^2.0.1", - "fill-range": "^4.0.0", - "isobject": "^3.0.1", - "repeat-element": "^1.1.2", - "snapdragon": "^0.8.1", - "snapdragon-node": "^2.0.1", - "split-string": "^3.0.2", - "to-regex": "^3.0.1" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "eslint-scope": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-4.0.3.tgz", - "integrity": "sha512-p7VutNr1O/QrxysMo3E45FjYDTeXBy0iTltPFNSqKAIfjDSXC+4dj+qfyuD8bfAXrW/y6lW3O76VaYNPKfpKrg==", - "dev": true, - "requires": { - "esrecurse": "^4.1.0", - "estraverse": "^4.1.1" - } - }, - "fill-range": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", - "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", - "dev": true, - "requires": { - "extend-shallow": "^2.0.1", - "is-number": "^3.0.0", - "repeat-string": "^1.6.1", - "to-regex-range": "^2.1.0" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "is-number": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", - "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", + "enhanced-resolve": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.3.1.tgz", + "integrity": "sha512-G1XD3MRGrGfNcf6Hg0LVZG7GIKcYkbfHa5QMxt1HDUTdYoXH0JR1xXyg+MaKLF73E9A27uWNVxvFivNRYeUB6w==", "dev": true, "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } + "graceful-fs": "^4.2.4", + "tapable": "^2.0.0" } }, - "memory-fs": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/memory-fs/-/memory-fs-0.4.1.tgz", - "integrity": "sha1-OpoguEYlI+RHz7x+i7gO1me/xVI=", - "dev": true, - "requires": { - "errno": "^0.1.3", - "readable-stream": "^2.0.1" - } - }, - "micromatch": { - "version": "3.1.10", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", - "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", + "pkg-dir": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", + "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", "dev": true, "requires": { - "arr-diff": "^4.0.0", - "array-unique": "^0.3.2", - "braces": "^2.3.1", - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "extglob": "^2.0.4", - "fragment-cache": "^0.2.1", - "kind-of": "^6.0.2", - "nanomatch": "^1.2.9", - "object.pick": "^1.3.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.2" + "find-up": "^4.0.0" } }, - "to-regex-range": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", - "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", - "dev": true, - "requires": { - "is-number": "^3.0.0", - "repeat-string": "^1.6.1" - } + "tapable": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.0.0.tgz", + "integrity": "sha512-bjzn0C0RWoffnNdTzNi7rNDhs1Zlwk2tRXgk8EiHKAOX1Mag3d6T0Y5zNa7l9CJ+EoUne/0UHdwS8tMbkh9zDg==", + "dev": true } } }, "webpack-cli": { - "version": "3.3.12", - "resolved": "https://registry.npmjs.org/webpack-cli/-/webpack-cli-3.3.12.tgz", - "integrity": "sha512-NVWBaz9k839ZH/sinurM+HcDvJOTXwSjYp1ku+5XKeOC03z8v5QitnK/x+lAxGXFyhdayoIf/GOpv85z3/xPag==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/webpack-cli/-/webpack-cli-4.1.0.tgz", + "integrity": "sha512-NdhxXMZmoik62Y05t0h1y65LjBM7BwFPq311ihXuMM3RY6dlc4KkCTyHLzTuBEc+bqq6d3xh+CWmU0xRexNJBA==", "dev": true, "requires": { - "chalk": "^2.4.2", - "cross-spawn": "^6.0.5", - "enhanced-resolve": "^4.1.1", - "findup-sync": "^3.0.0", - "global-modules": "^2.0.0", - "import-local": "^2.0.0", - "interpret": "^1.4.0", - "loader-utils": "^1.4.0", - "supports-color": "^6.1.0", - "v8-compile-cache": "^2.1.1", - "yargs": "^13.3.2" + "@webpack-cli/info": "^1.0.2", + "@webpack-cli/serve": "^1.0.1", + "ansi-escapes": "^4.3.1", + "colorette": "^1.2.1", + "command-line-usage": "^6.1.0", + "commander": "^6.0.0", + "enquirer": "^2.3.4", + "execa": "^4.0.0", + "import-local": "^3.0.2", + "interpret": "^2.0.0", + "rechoir": "^0.7.0", + "v8-compile-cache": "^2.1.0", + "webpack-merge": "^4.2.2" }, "dependencies": { - "ansi-regex": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", - "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", - "dev": true - }, - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "^1.9.0" - } - }, - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - }, - "dependencies": { - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - } - } - }, - "cliui": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz", - "integrity": "sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==", - "dev": true, - "requires": { - "string-width": "^3.1.0", - "strip-ansi": "^5.2.0", - "wrap-ansi": "^5.1.0" - } - }, - "color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, - "requires": { - "color-name": "1.1.3" - } - }, - "color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", - "dev": true - }, - "cross-spawn": { - "version": "6.0.5", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", - "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", + "webpack-merge": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/webpack-merge/-/webpack-merge-4.2.2.tgz", + "integrity": "sha512-TUE1UGoTX2Cd42j3krGYqObZbOD+xF7u28WB7tfUordytSjbWTIjK/8V0amkBfTYN4/pB/GIDlJZZ657BGG19g==", "dev": true, "requires": { - "nice-try": "^1.0.4", - "path-key": "^2.0.1", - "semver": "^5.5.0", - "shebang-command": "^1.2.0", - "which": "^1.2.9" - } - }, - "emoji-regex": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", - "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", - "dev": true - }, - "find-up": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", - "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", - "dev": true, - "requires": { - "locate-path": "^3.0.0" - } - }, - "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", - "dev": true - }, - "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", - "dev": true - }, - "locate-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", - "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", - "dev": true, - "requires": { - "p-locate": "^3.0.0", - "path-exists": "^3.0.0" - } - }, - "p-locate": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", - "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", - "dev": true, - "requires": { - "p-limit": "^2.0.0" - } - }, - "path-exists": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", - "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", - "dev": true - }, - "path-key": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", - "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", - "dev": true - }, - "semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "dev": true - }, - "shebang-command": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", - "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", - "dev": true, - "requires": { - "shebang-regex": "^1.0.0" - } - }, - "shebang-regex": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", - "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", - "dev": true - }, - "string-width": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", - "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", - "dev": true, - "requires": { - "emoji-regex": "^7.0.1", - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^5.1.0" - } - }, - "strip-ansi": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", - "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", - "dev": true, - "requires": { - "ansi-regex": "^4.1.0" - } - }, - "supports-color": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.1.0.tgz", - "integrity": "sha512-qe1jfm1Mg7Nq/NSh6XE24gPXROEVsWHxC1LIx//XNlD9iw7YZQGjZNjYN7xGaEG6iKdA8EtNFW6R0gjnVXp+wQ==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - }, - "which": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", - "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", - "dev": true, - "requires": { - "isexe": "^2.0.0" - } - }, - "wrap-ansi": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz", - "integrity": "sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.0", - "string-width": "^3.0.0", - "strip-ansi": "^5.0.0" - } - }, - "yargs": { - "version": "13.3.2", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.3.2.tgz", - "integrity": "sha512-AX3Zw5iPruN5ie6xGRIDgqkT+ZhnRlZMLMHAs8tg7nRruy2Nb+i5o9bwghAogtM08q1dpr2LVoS8KSTMYpWXUw==", - "dev": true, - "requires": { - "cliui": "^5.0.0", - "find-up": "^3.0.0", - "get-caller-file": "^2.0.1", - "require-directory": "^2.1.1", - "require-main-filename": "^2.0.0", - "set-blocking": "^2.0.0", - "string-width": "^3.0.0", - "which-module": "^2.0.0", - "y18n": "^4.0.0", - "yargs-parser": "^13.1.2" - } - }, - "yargs-parser": { - "version": "13.1.2", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.2.tgz", - "integrity": "sha512-3lbsNRf/j+A4QuSZfDRA7HRSfWrzO0YjqTJd5kjAq37Zep1CEgaYmrH9Q3GwPiB9cHyd1Y1UwggGhJGoxipbzg==", - "dev": true, - "requires": { - "camelcase": "^5.0.0", - "decamelize": "^1.2.0" + "lodash": "^4.17.15" } } } @@ -8789,13 +5926,13 @@ } }, "webpack-sources": { - "version": "1.4.3", - "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-1.4.3.tgz", - "integrity": "sha512-lgTS3Xhv1lCOKo7SA5TjKXMjpSM4sBjNV5+q2bqesbSPs5FjGmU6jjtBSkX9b4qW87vDIsCIlUPOEhbZrMdjeQ==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-2.2.0.tgz", + "integrity": "sha512-bQsA24JLwcnWGArOKUxYKhX3Mz/nK1Xf6hxullKERyktjNMC4x8koOeaDNTA2fEJ09BdWLbM/iTW0ithREUP0w==", "dev": true, "requires": { - "source-list-map": "^2.0.0", - "source-map": "~0.6.1" + "source-list-map": "^2.0.1", + "source-map": "^0.6.1" }, "dependencies": { "source-map": { @@ -8839,13 +5976,14 @@ "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", "dev": true }, - "worker-farm": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/worker-farm/-/worker-farm-1.7.0.tgz", - "integrity": "sha512-rvw3QTZc8lAxyVrqcSGVm5yP/IJ2UcB3U0graE3LCFoZ0Yn2x4EoVSqJKdB/T5M+FLcRPjz4TDacRf3OCfNUzw==", + "wordwrapjs": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/wordwrapjs/-/wordwrapjs-4.0.0.tgz", + "integrity": "sha512-Svqw723a3R34KvsMgpjFBYCgNOSdcW3mQFK4wIfhGQhtaFVOJmdYoXgi63ne3dTlWgatVcUc7t4HtQ/+bUVIzQ==", "dev": true, "requires": { - "errno": "~0.1.7" + "reduce-flatten": "^2.0.0", + "typical": "^5.0.0" } }, "wrap-ansi": { @@ -8898,12 +6036,6 @@ "integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==", "dev": true }, - "yallist": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", - "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", - "dev": true - }, "yaml": { "version": "1.10.0", "resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.0.tgz", diff --git a/package.json b/package.json index 56cc12e..c3c3eb6 100644 --- a/package.json +++ b/package.json @@ -73,8 +73,8 @@ "tsconfig-paths": "^3.9.0", "ttypescript": "^1.5.0", "typescript": "^4.0.0", - "webpack": "^4.43.0", - "webpack-cli": "^3.3.0", + "webpack": "^5.3.0", + "webpack-cli": "^4.1.0", "webpack-merge": "^5.1.0" }, "scripts": { From 37517a6bd19d87dd60c76d50e5d4b2b6ea7cd229 Mon Sep 17 00:00:00 2001 From: Alan Poulain Date: Mon, 2 Nov 2020 19:54:38 +0100 Subject: [PATCH 55/56] feat: better Bing provider (#12) Add `precision` to `OpenCageGeocoded`. Replace `minConfidence` with `minPrecision` for geocode and geodecode. Use `FlatCoordinates`. --- CHANGELOG.md | 3 + couscous.yml | 3 + docs/provider_usage.md | 13 +- docs/provider_usage/bing.md | 6 + docs/provider_usage/opencage.md | 4 +- spec/provider/BingProvider.spec.ts | 56 ++++-- spec/provider/OpenCageProvider.spec.ts | 2 + .../recording.har | 41 +++-- .../recording.har | 37 ++-- .../recording.har | 31 ++-- src/GeocoderProviderFactory.ts | 20 ++- src/error/ResponseError.ts | 4 + src/provider/bing/BingGeocoded.ts | 57 +++++++ src/provider/{ => bing}/BingProvider.ts | 160 +++++++++++++++--- src/provider/bing/index.ts | 3 + src/provider/index.ts | 3 +- src/provider/mapbox/MapboxProvider.ts | 8 +- src/provider/opencage/OpenCageGeocodeQuery.ts | 30 ++-- src/provider/opencage/OpenCageGeocoded.ts | 17 ++ src/provider/opencage/OpenCageProvider.ts | 4 +- src/provider/opencage/OpenCageReverseQuery.ts | 30 ++-- 21 files changed, 402 insertions(+), 130 deletions(-) create mode 100644 docs/provider_usage/bing.md create mode 100644 src/provider/bing/BingGeocoded.ts rename src/provider/{ => bing}/BingProvider.ts (52%) create mode 100644 src/provider/bing/index.ts diff --git a/CHANGELOG.md b/CHANGELOG.md index 7f0c32c..54ab1c6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,10 @@ ## 0.8.0 +* [Bing] Better Bing provider * [Mapbox] Add `fuzzyMatch` geocode parameter +* [OpenCage] Add `precision` to `OpenCageGeocoded` +* [OpenCage] Replace `minConfidence` with `minPrecision` for geocode and geodecode ## 0.7.0 diff --git a/couscous.yml b/couscous.yml index 3e88978..3db675c 100644 --- a/couscous.yml +++ b/couscous.yml @@ -41,6 +41,9 @@ menu: mapquest: text: 📌️ MapQuest relativeUrl: docs/provider_usage/mapquest.html + bing: + text: 📌️ Bing Maps + relativeUrl: docs/provider_usage/bing.html yandex: text: 📌️ Yandex relativeUrl: docs/provider_usage/yandex.html diff --git a/docs/provider_usage.md b/docs/provider_usage.md index c0c5b5d..3b34a3a 100644 --- a/docs/provider_usage.md +++ b/docs/provider_usage.md @@ -8,6 +8,7 @@ Each provider has its own options, parameters or results because of its specific - [Google Maps (Geocoding API)](provider_usage/googlemaps.md) - [Mapbox](provider_usage/mapbox.md) - [MapQuest](provider_usage/mapquest.md) +- [Bing Maps](provider_usage/bing.md) - [Yandex](provider_usage/yandex.md) - [GeoPlugin](provider_usage/geoplugin.md) @@ -109,8 +110,8 @@ Here is a table listing the parameters according to the providers: geocode - minConfidence - Only results with at least this confidence will be returned + minPrecision + Only results with at least this precision will be returned OpenCage @@ -157,8 +158,8 @@ Here is a table listing the parameters according to the providers: geodecode - minConfidence - Only results with at least this confidence will be returned + minPrecision + Only results with at least this precision will be returned OpenCage @@ -207,13 +208,13 @@ Here is a table listing the parameters according to the providers: geocoded attribution Credit information - GeoPlugin, MapQuest, Nominatim + Bing, GeoPlugin, MapQuest, Nominatim geocoded precision Quality of the geocoding result - MapQuest, Yandex + Bing, MapQuest, Yandex geocoded diff --git a/docs/provider_usage/bing.md b/docs/provider_usage/bing.md new file mode 100644 index 0000000..0b9e320 --- /dev/null +++ b/docs/provider_usage/bing.md @@ -0,0 +1,6 @@ +# Bing Usage + +## `Geocoded` properties + +- `attribution`: copyright notice +- `precision`: level of confidence that the geocoded location result is a match diff --git a/docs/provider_usage/opencage.md b/docs/provider_usage/opencage.md index ce33455..e5f96c6 100644 --- a/docs/provider_usage/opencage.md +++ b/docs/provider_usage/opencage.md @@ -8,13 +8,13 @@ - `countryCodes`: to restrict the results to one or more countries (ISO 3166 alpha 2 country codes) - `proximity` (object with `latitude` and `longitude` keys): to provide a hint to bias results in favour of those closer to the specified location -- `minConfidence` (from 1 to 10): only results with at least this confidence will be returned +- `minPrecision` (from 1 to 10): only results with at least this precision will be returned - `noRecord`: boolean to ask for the query to not be logged ## `geodecode` parameters - `countryCodes`: to restrict the results to one or more countries (ISO 3166 alpha 2 country codes) -- `minConfidence` (from 1 to 10): only results with at least this confidence will be returned +- `minPrecision` (from 1 to 10): only results with at least this precision will be returned - `noRecord`: boolean to ask for the query to not be logged ## `Geocoded` properties diff --git a/spec/provider/BingProvider.spec.ts b/spec/provider/BingProvider.spec.ts index d3dc789..493d16a 100644 --- a/spec/provider/BingProvider.spec.ts +++ b/spec/provider/BingProvider.spec.ts @@ -1,7 +1,7 @@ import UniversalGeocoder from "UniversalGeocoder"; -import { BingProvider } from "provider"; +import { BingGeocoded, BingProvider } from "provider"; import ExternalLoader from "ExternalLoader"; -import Geocoded from "Geocoded"; +import AdminLevel from "AdminLevel"; import setupPolly, { cleanRecording } from "../setupPolly"; describe("Bing Geocoder Provider", () => { @@ -50,19 +50,19 @@ describe("Bing Geocoder Provider", () => { provider?.geocode( "1600 Pennsylvania Ave, Washington, DC", - (results: Geocoded[]) => { + (results: BingGeocoded[]) => { const geocoded = results[0]; expect(geocoded).toBeDefined(); expect(geocoded.getCoordinates()).toEqual({ - latitude: 38.897668, - longitude: -77.036556, + latitude: 38.897639, + longitude: -77.036475, }); expect(geocoded.getBounds()).toEqual({ - latitudeSW: 38.89380528242933, - longitudeSW: -77.04317326462667, - latitudeNE: 38.90153071757068, - longitudeNE: -77.02993873537334, + latitudeSW: 38.89377628242932, + longitudeSW: -77.04309226192471, + latitudeNE: 38.901501717570675, + longitudeNE: -77.02985773807528, }); expect(geocoded.getFormattedAddress()).toEqual( "1600 Pennsylvania Ave NW, Washington, DC 20006" @@ -73,9 +73,22 @@ describe("Bing Geocoder Provider", () => { expect(geocoded.getLocality()).toEqual("Washington"); expect(geocoded.getPostalCode()).toEqual("20006"); expect(geocoded.getRegion()).toEqual("DC"); - expect(geocoded.getAdminLevels()).toEqual([]); + expect(geocoded.getAdminLevels()).toEqual([ + AdminLevel.create({ + level: 1, + name: "DC", + }), + AdminLevel.create({ + level: 2, + name: "City of Washington", + }), + ]); expect(geocoded.getCountry()).toEqual("United States"); - expect(geocoded.getCountryCode()).toEqual(undefined); + expect(geocoded.getCountryCode()).toEqual("US"); + expect(geocoded.getAttribution()).toEqual( + "Copyright © 2020 Microsoft and its suppliers. All rights reserved. This API cannot be accessed and the content and any results may not be used, reproduced or transmitted in any manner without express written permission from Microsoft Corporation." + ); + expect(geocoded.getPrecision()).toEqual("Medium"); done(); } @@ -89,7 +102,7 @@ describe("Bing Geocoder Provider", () => { apiKey: "api_key", }); - provider?.geodecode(48.8631507, 2.388911, (results: Geocoded[]) => { + provider?.geodecode(48.8631507, 2.388911, (results: BingGeocoded[]) => { const geocoded = results[0]; expect(geocoded).toBeDefined(); @@ -112,9 +125,22 @@ describe("Bing Geocoder Provider", () => { expect(geocoded.getLocality()).toEqual("Paris"); expect(geocoded.getPostalCode()).toEqual("75020"); expect(geocoded.getRegion()).toEqual("Île-de-France"); - expect(geocoded.getAdminLevels()).toEqual([]); + expect(geocoded.getAdminLevels()).toEqual([ + AdminLevel.create({ + level: 1, + name: "Île-de-France", + }), + AdminLevel.create({ + level: 2, + name: "Paris", + }), + ]); expect(geocoded.getCountry()).toEqual("France"); - expect(geocoded.getCountryCode()).toEqual(undefined); + expect(geocoded.getCountryCode()).toEqual("FR"); + expect(geocoded.getAttribution()).toEqual( + "Copyright © 2020 Microsoft and its suppliers. All rights reserved. This API cannot be accessed and the content and any results may not be used, reproduced or transmitted in any manner without express written permission from Microsoft Corporation." + ); + expect(geocoded.getPrecision()).toEqual("High"); done(); }); @@ -134,7 +160,7 @@ describe("Bing Geocoder Provider", () => { }, (error) => { expect(error.message).toEqual( - "Received HTTP status code 401 when attempting geocoding request." + "Access was denied. You may have entered your credentials incorrectly, or you might not have access to the requested resource or operation." ); done(); } diff --git a/spec/provider/OpenCageProvider.spec.ts b/spec/provider/OpenCageProvider.spec.ts index f026381..f3bbf58 100644 --- a/spec/provider/OpenCageProvider.spec.ts +++ b/spec/provider/OpenCageProvider.spec.ts @@ -84,6 +84,7 @@ describe("OpenCage Geocoder Provider", () => { expect(geocoded.getTimezone()).toEqual("America/New_York"); expect(geocoded.getCallingCode()).toEqual(1); expect(geocoded.getFlag()).toEqual("🇺🇸"); + expect(geocoded.getPrecision()).toEqual(9); expect(geocoded.getMgrs()).toEqual("18SUJ3113003444"); expect(geocoded.getMaidenhead()).toEqual("FM18mu67kg"); expect(geocoded.getGeohash()).toEqual("dqcm14cm5er8th99jt7w"); @@ -130,6 +131,7 @@ describe("OpenCage Geocoder Provider", () => { expect(geocoded.getTimezone()).toEqual("Europe/Paris"); expect(geocoded.getCallingCode()).toEqual(33); expect(geocoded.getFlag()).toEqual("🇫🇷"); + expect(geocoded.getPrecision()).toEqual(10); expect(geocoded.getMgrs()).toEqual("31UDQ5517112419"); expect(geocoded.getMaidenhead()).toEqual("JN18eu67pd"); expect(geocoded.getGeohash()).toEqual("u09tyr72q952wcz9bf5x"); diff --git a/spec/recordings/Bing-Geocoder-Provider_2231523888/receives-correct-geocoding-results_3640432360/recording.har b/spec/recordings/Bing-Geocoder-Provider_2231523888/receives-correct-geocoding-results_3640432360/recording.har index 9b670dc..c125835 100644 --- a/spec/recordings/Bing-Geocoder-Provider_2231523888/receives-correct-geocoding-results_3640432360/recording.har +++ b/spec/recordings/Bing-Geocoder-Provider_2231523888/receives-correct-geocoding-results_3640432360/recording.har @@ -8,7 +8,7 @@ }, "entries": [ { - "_id": "a820e960ea8aecdecdbba0cecbc709ca", + "_id": "5786db4fc459c37d9aa1330f3b69193c", "_order": 0, "cache": {}, "request": { @@ -40,19 +40,28 @@ "value": "dev.virtualearth.net" } ], - "headersSize": 337, + "headersSize": 357, "httpVersion": "HTTP/1.1", "method": "GET", - "queryString": [], - "url": "https://dev.virtualearth.net/REST/v1/Locations/1600%20Pennsylvania%20Ave,%20Washington,%20DC" + "queryString": [ + { + "name": "maxRes", + "value": "5" + }, + { + "name": "incl", + "value": "ciso2" + } + ], + "url": "https://dev.virtualearth.net/REST/v1/Locations/1600%20Pennsylvania%20Ave,%20Washington,%20DC?maxRes=5&incl=ciso2" }, "response": { - "bodySize": 2389, + "bodySize": 2365, "content": { "_isBinary": true, "mimeType": "application/json; charset=utf-8", - "size": 2389, - "text": "[\"1f8b0800000000000400\",\"ec57eb6edb36147e1542bf5d87f78bff39b63b146bd7224937604b1130126d13904541a4921a6d1f68afb127dba16477dd50b449b714ddb0c4482cf25cbe73f978a83785edd3d635c99736f9d09cb9d8d769112a57cc8a1f6dedab45e7aabc6feb584c8aebce36d5d3b0092f3b0f12db94dad9e5c9e549e56ea637be4bbdad9dedd276dab87479729aa57db3b93ca941e5aa0db70eac5d5defa76db3016b6568f79ddf6c13985a1cbfa3df7e4514538c9ef9b20b31ac13022bc8a78862dfb6b5775d9ca2795da3413ca2ce45d7ddb86a8a2eb63ea2f98b27a8b44d1312ba76c896a58bd155830d881495a14910cff06c9b7dd6868823dad93d3ae8f4203f818db60b555f826ee8508250e2cea7048fbe193477e0c475e8d6a76de81372af5bb015d16d97a51ad4ba6ee76384a4a27517761f84b3085d1bba21df53c8026885be2bddb94bb198fdf2a67031f99d054f1721d9ba98f13f644681ababb46f73859e86b16cb3f78588e5d6ed6c9cee8edea665d8c13254a5dce63a94b6be3cb98d972760124a74437255afc36b30ccf4541ba6b1a09a726a185593474a4d316744312ab9a4522a3e01318389605811251496ca8c62d480b2628229c6987835291abbcb2089c418bd704d13f7f58d6dbc45f31b877ef869827eb2710bed91423341cb05541d630970dae01b688937c521ca17c3736e97d0413b4166e211ad92528fde991442be7a37296c55e53a64fdc3d7a7bef9148e22ebec7cb3f43175becccdb85cfc7591e616f5698fc2fa03d803a8be49ddfecc6da00e20f4b2f1b947ced3007352ac4307b584a5f911d7fd1332540d9c83ee9f7cb72142831cd83a0abfcb889ab507ce9679f599ab7cbf03d9cce1b4bf18337ac43229362e94a03fa4786caefb271d846c5df6f5d08acf1cd0a102036701ba2fb460a28f76e3b2e76ca1808cb6b5dd1750abbb38d34af1dc8d94b33f7c52ae295146ddd3f519f0d4816350839a94db9cb96163bebbf69b3ef47144f580fc5282092ac9c82f0e11c9a9d15a7082b9248a1039f04b6b6097c67ce4971ac540151b2398a65a73f2397e9daf3eda4eec5efc528602d1d901263154882fa0d8f9ea1ba1d8277272678ab1af41b18fe5fd2159a60ce6f9d05782d083530ac7be1184406ffefb586614300822c2027825c6734370ca607e496ee09c64e31413126b2d1924981f461dc198c014a330c124ffb219c6d47d3806a35401f5b99070a2517a80a1243198112d8926fcbf37d58614dd957220fcf094bb4b193e4e8327709f84fbdcb8fa7cbd8e2efd3d3666287007935868f863de43e10c6ba6b9217701f24db2126886a59690e42327a5e04034f84f04247d085e1a09f39108e0b038b29241e89868c628f9fce4fb6758c908661c734ce1967bb8ed700840286d38979a91ff59f93558f9f9327c3556322c0c3192c0bb8f30efa130c904d71a00b287e3e5b00df94f7d1c2b0005382e2c5d2c3bdfa6b1259e7f0f1ee065b5744fb2efca94953525378e59ae2d33c6894ae06b2bd715dc30c5dbe54b9c7f964abec5d3fc4bde9eb9359acfd07cfe18a6a3a08a62c3178fb159c0485dad083ba56265b44059ee748696a76cb5fc6e452825c3d26236bcbe3fc2fa116117c4cce043c9cfc5bbdf070012b8e2076c100000\"]" + "size": 2365, + "text": "[\"1f8b0800000000000400\",\"ec58eb6edb36147e1542bf5d87778afee75b87604d1be4b2025b8a8091689b80240a2295d468fb407b8d3dd90e65bb4b87a24d3af4b2612d6058e4b97c3cdff978e4bcc94c1f37b689ae30d1f9e6cc86be8a735fda6c92fd622a57ce3b5ba67d53856c94dd74a6299ff9b5bfec1c586c626c2757475747a5bd1ddfba2ef6a6b2a68b9b7163e3d5d12c59bb667d755481cb75ebef2c44bbbed98edb660dd10adf6e3bb7de4408353f7c477ffc8e28a6189db8a2f3c1af228228c8c58042dfb695b35d18a36955a1c13ca0ce06dbddda728c2e362ea0e9e9312a4cd3f8886e2c32456143b0e510034e8a0adf4438cff06c9a6df2861307549b2ddafbf4603f828db6f3655f80afef5084a384dac5088fae193c6b48623b74e7e2c6f711d9d72dc40ae8ae4b560d6a6d57bb10a0a868d5f9fade71e6be6b7d37d47b0c55002fdf77853db7316493dfde643644571bc874e1a3a9b209ffcb6667707d1db76d62e899dfd136794f442836b636615c1fb28d0b5fc332b0526c120f85a9ae8eeec2d51184048a6e4962f5c6bf86c02c1fe79a2925694e39d58cd2d113a5c69833ac29954453ae081b8199c64460a288120a4b25766654e74229966325a8d2af465963ea0492488cd1a96d9ab0ad6e4de30c9ade5af4fce508bd346103ed117d33428b39b08eb10438ad770db4c49b6c7fcad3e139b58befa09da032e1805649a677d999e44abc7a37ca4c59261e92fffeeb33d77c0a47967c6ad72c5c889d2b52332ee67f5fa4a9455ddc22bfba077b00d537b1db9ed935f00046978d4b3d721e0798a36ce53be01296a6075c8f2fc8c01a2407df0f72b73e4083ecd57a30fe00d071f009f9e579f62eed342b07622e92f9892d5d5f837d1277dc5eec4a7d0039cad6d6171078a8fdaeeb1ecf061899aae8aba1474f2ce8a48400671edad2b710a20f666d53e614218352b795d96640e2839231752f9ba6fa91e9ce40b41692811b10546c5219878d697de3d6bdefc30ec957149b124c50714f6c72acf35c7082b92432674a27b1e539c32ac7f7c40666e08ab5162c674452f939b19d2f3fda5bec5162539a12c1f628e132105f22b7f3e50f22b74f94e4c17263df556e1fe1e36b0a4e69cc69be4f4731e7ff3ebd69055ae24cc278e2bb9b4370caa40421a5d14577a34d489ce78a700a838ced2720c198c007a369c07dd96863ea316a8309abe01200810b8c95dac350308401b316700ffc0787dd50a287aa6f30fe6eea7b083f1fd7c731bc7fc2fbdf6ef5c56a156cfc67ca4c50b0a032cf09d68abc87c219c152730e957a08941f52b09a084a61ecc13b28d99f4c4821390c4792d4391c5fe64a4105141752f2c32b2ba3e0ab388c572ebe8d60195c1130bea12fe0730f436b2e35852d80f7bf5ebfab5e3f4bcf37932bc342132d09fc8812fa3d122699e0798ea9625f4faec336f012fbb0630688392c2c6c283ad7c65dabbcf81932c0afdec21ea7dc98526cccca4a52c2ccbc91393705bc8412c340a105c76f179738fd9b29f9168fd37ff2f6ccaed07482045c9373f974367dba9c71ac9ece16046ea765ae259f4d299128d9cd26683163cbc54f4b42281d96e693e1ef004f087982e905c927044fa8f8357bf7e700f7536879b5100000\"]" }, "cookies": [], "headers": [ @@ -82,23 +91,23 @@ }, { "name": "x-bm-traceid", - "value": "d9cda9c49e3a48a399e5d50ba6fd0785" + "value": "0220aafe61d542b684ac9751a3152c40" }, { "name": "x-bm-be-elapsed", - "value": "209" + "value": "201" }, { "name": "x-msedge-ref", - "value": "Ref A: AAF6085272094CF09C834EE13B25E985 Ref B: DB3EDGE1221 Ref C: 2020-08-13T19:19:21Z" + "value": "Ref A: 5615C6FBAFEB407FBD1476E8964BA216 Ref B: DB3EDGE1122 Ref C: 2020-11-02T18:10:25Z" }, { "name": "x-bm-fe-elapsed", - "value": "228" + "value": "224" }, { "name": "x-bm-srv", - "value": "DU00000D76" + "value": "DU00000B76" }, { "name": "x-ms-bm-ws-info", @@ -126,7 +135,7 @@ }, { "name": "date", - "value": "Thu, 13 Aug 2020 19:19:21 GMT" + "value": "Mon, 02 Nov 2020 18:10:25 GMT" }, { "name": "connection", @@ -139,8 +148,8 @@ "status": 200, "statusText": "OK" }, - "startedDateTime": "2020-08-13T19:19:21.497Z", - "time": 437, + "startedDateTime": "2020-11-02T18:10:25.515Z", + "time": 318, "timings": { "blocked": -1, "connect": -1, @@ -148,7 +157,7 @@ "receive": 0, "send": 0, "ssl": -1, - "wait": 437 + "wait": 318 } } ], diff --git a/spec/recordings/Bing-Geocoder-Provider_2231523888/receives-correct-geodecoding-results_1602611079/recording.har b/spec/recordings/Bing-Geocoder-Provider_2231523888/receives-correct-geodecoding-results_1602611079/recording.har index ee18310..6638483 100644 --- a/spec/recordings/Bing-Geocoder-Provider_2231523888/receives-correct-geodecoding-results_1602611079/recording.har +++ b/spec/recordings/Bing-Geocoder-Provider_2231523888/receives-correct-geodecoding-results_1602611079/recording.har @@ -8,7 +8,7 @@ }, "entries": [ { - "_id": "4687a99f7b313e37e7bc7bfc408ade84", + "_id": "9a281064377e3aa13168e7fc6ca3f252", "_order": 0, "cache": {}, "request": { @@ -40,19 +40,24 @@ "value": "dev.virtualearth.net" } ], - "headersSize": 311, + "headersSize": 322, "httpVersion": "HTTP/1.1", "method": "GET", - "queryString": [], - "url": "https://dev.virtualearth.net/REST/v1/Locations/48.8631507,2.388911" + "queryString": [ + { + "name": "incl", + "value": "ciso2" + } + ], + "url": "https://dev.virtualearth.net/REST/v1/Locations/48.8631507,2.388911?incl=ciso2" }, "response": { - "bodySize": 1675, + "bodySize": 1693, "content": { "_isBinary": true, "mimeType": "application/json; charset=utf-8", - "size": 1675, - "text": "[\"1f8b0800000000000400\",\"94545172db3610bd0a06df0a45429428ea4f96d23453bbf5384e7f2a8f07045722664880032c25731c5fa1f7c8359a8b75414a49266ea753e98700debe7dbb6f81672e3bacc0a05612b53577e0bb1a37b604bee2bfcb5a971b07653897b5e7135e3869ca6b7bb01f9d264485d8ae76d3ddb4846374d40e3b5983745845067037bd0a686d0ebb694d218fad3d01b13d167dd49a03b129dbf64e1f2a24aacde59bfdf5998958c4ec462b67bddd232316a6d133dfb56dadc1f988adeb9a0d70cf1c7870472823765f69cfd6b7ef9992c658640530a914780fe5c0419532650d523dc35a9a3e4453c59e35b267e7988ef0133a689d2d3b45b1d631a4527ca31169a9cd10d9501270eca4b1b21d32786a89cbb3930b28c35a708df69e9acaf6ce36df95b3b1aeb56ee877445da028db39051f003d5ffdf1ccc1a36e2465bab7286bbe4abe6146c0e323f66d70e8da8eb6adbe1ae155058df45173c91629dbd036b9a2aae08392f56e7af2bb29519245c724b85ad827224e97d1729e8b74315f8a54e433914c44345bc6f95c2ce6b3349d8b2c9904d0629167224eb279162fb23480f2c522ce138a9ca799c81f26dcc826085cb2f5114c07ec9d6c0a40941396cd83b9b7d2e93050add586ec7fe6e78a6e8775180deb6874a80bfeac6c314be27c36285a6624eae165c26559869e87f8f3e7b536ff98970770a3cd567b745a8589fbf2670d6f4a78f31359abe047800862ce2295ed0cbafe0e0ed46bdaff1ab1b78e8c22a7d61721ff5d31d547130c0a07ae675e480f1fd001044daf5513d29a52ba7ec42441562d15b07577e83c02bbf9f219f5916ec56bb0f8c6b8d14e75b5d40e7e90703ff6fd0af00460e8b0d4bead65ffeb68e0ab628a11c8fe45c470af5ee724af86d1d3d87fd7d7d67a1af0f36b33742900a984bda6374785dd9fe98e1332bc40d89fb55e9a3de107b08aa287a119afc6ff1f2302c93ae80cddb801bacc2511dc59ba3bb6258acecb0384cc81816fc7eef087170a24ef5515e40f47ef2c45d27e38a1bab0f36365228e2f1b5bf0cae976b49efff60bd1d3c3a2e07d48994b250a21f6324b45badcef97c59ed62acdf6b3b25033f969fb310ebfab6cf9298ec23f095bc9dbf5edb03fdbbee52f7f0f0073c36f20d1050000\"]" + "size": 1693, + "text": "[\"1f8b0800000000000400\",\"94545d6edb3810be0ac167579664fd587e739cb61b6cb20dd2745fd6414093639b80440ae4c8ae90e60a7b8f5e637bb11d4a765b24bb58acfd2292df7c33df7c433e71d1e11e0c6a29505b7307beab716515f005ff5dd45aad1ca8702e6acf277ce38451d776673f394d883d62bb584fd7530587e8a01d76a206e1701f19c0f5f422a0b5d9ada735853cb6f608c4f6b8e9a3d6ec884ddab6777ab747a25a9dbfd95f5f591aa731bbd1d2596fb7c8888569f4cc776d5b6b703e62cbba6603dc33071edc0154c4eef7dab3e5ed1593c2188b6c034c4809de831a38482993d620e919d6c2f4219a147bd6889e9d623ac24fe8a07556759262ad6348527ca31169a9cd10d9501270eca8716f3b64f0b9252ecf8e2ea00c6bc135da7b6a2adb3adbfc2467655d6bddd0ef88ba4051b673123e027abef8e3898347dd08ca746f51d47c91fcc08c80c747ecdbe0d0b51d6d5b7c37c2cb3d34c247cd395b246d43dbe48adc071fa4a8d7d3a35f4f89922c3a24c1d58dfd4cc4d93c9ae7559a15f93ccdd26a962693349acde32a4f8b7c9665795a2693002a8aaa4ce3a4cccbb828b300aa8a22ae128accb332ad1e26dc8826143867cb03980ed87bd16c00514c589907736f85d361a05aab0dd9ffc44f8a6e8775180deb6874a80bfe5459314be26a3654342fa9a887e709174a859e87f8d3e7b536ff98970770a3cda5f6e8b40c13f7edcf1ade2878f38eac95f0129086624e454adb1974fd1deca8d7b4ff3d626b1d19454e2dcf85fcb762d247130c1207ae27be111e3ea2030835bdae9a90d628e1fa119384b26a21812dbb5de711d8cdb7afa80f742b5e83d31f8c2bed64570bede04509f763df2f008f00860e95f66d2dfadf46035f89d98c40f62f450cf7ea754ef26a183d8dfd4f7d6dada7013fbd3643975e36fbcadb20e2dd5d60206d5b4d8f910cf05fe8f2133a3c4dd89f449c5d98f01d5849b4c3348d77e6ffcf1781441d048436dd00dd72450477962e956d89a2f36207217360e09763dbf8c33305d250c87dd0351cbdb71449fbe1840463e747c9691c9f372ec14ba7db7126f8875f899e5e1c095721655648a14065c5a652591a97a282bcd86e8b2a8579b12de22f979fe2f0bb28f32f7114fe49d84ade2e6f87fdd9db397ffe7b0080b67764ea050000\"]" }, "cookies": [], "headers": [ @@ -82,19 +87,19 @@ }, { "name": "x-bm-traceid", - "value": "9ac2b22fa74248ff8bf2b2c47f3dbc3a" + "value": "46caded46b9d4207a9e56ff692e86f60" }, { "name": "x-bm-be-elapsed", - "value": "21" + "value": "96" }, { "name": "x-bm-fe-elapsed", - "value": "38" + "value": "116" }, { "name": "x-bm-srv", - "value": "DU00000B78, DU01EAP000003DE" + "value": "DU00000B75, DU01EAP000003E8" }, { "name": "x-ms-bm-ws-info", @@ -122,21 +127,21 @@ }, { "name": "date", - "value": "Thu, 13 Aug 2020 19:22:07 GMT" + "value": "Mon, 02 Nov 2020 18:10:24 GMT" }, { "name": "connection", "value": "close" } ], - "headersSize": 602, + "headersSize": 603, "httpVersion": "HTTP/1.1", "redirectURL": "", "status": 200, "statusText": "OK" }, - "startedDateTime": "2020-08-13T19:22:07.358Z", - "time": 181, + "startedDateTime": "2020-11-02T18:10:25.267Z", + "time": 211, "timings": { "blocked": -1, "connect": -1, @@ -144,7 +149,7 @@ "receive": 0, "send": 0, "ssl": -1, - "wait": 181 + "wait": 211 } } ], diff --git a/spec/recordings/Bing-Geocoder-Provider_2231523888/receives-error-when-the-API-key-is-bad_860720186/recording.har b/spec/recordings/Bing-Geocoder-Provider_2231523888/receives-error-when-the-API-key-is-bad_860720186/recording.har index 3ce6c51..66178ce 100644 --- a/spec/recordings/Bing-Geocoder-Provider_2231523888/receives-error-when-the-API-key-is-bad_860720186/recording.har +++ b/spec/recordings/Bing-Geocoder-Provider_2231523888/receives-error-when-the-API-key-is-bad_860720186/recording.har @@ -8,7 +8,7 @@ }, "entries": [ { - "_id": "a820e960ea8aecdecdbba0cecbc709ca", + "_id": "5786db4fc459c37d9aa1330f3b69193c", "_order": 0, "cache": {}, "request": { @@ -40,18 +40,27 @@ "value": "dev.virtualearth.net" } ], - "headersSize": 280, + "headersSize": 300, "httpVersion": "HTTP/1.1", "method": "GET", - "queryString": [], - "url": "https://dev.virtualearth.net/REST/v1/Locations/1600%20Pennsylvania%20Ave,%20Washington,%20DC" + "queryString": [ + { + "name": "maxRes", + "value": "5" + }, + { + "name": "incl", + "value": "ciso2" + } + ], + "url": "https://dev.virtualearth.net/REST/v1/Locations/1600%20Pennsylvania%20Ave,%20Washington,%20DC?maxRes=5&incl=ciso2" }, "response": { "bodySize": 681, "content": { "mimeType": "application/json; charset=utf-8", "size": 681, - "text": "{\"authenticationResultCode\":\"InvalidCredentials\",\"brandLogoUri\":\"http:\\/\\/dev.virtualearth.net\\/Branding\\/logo_powered_by.png\",\"copyright\":\"Copyright © 2020 Microsoft and its suppliers. All rights reserved. This API cannot be accessed and the content and any results may not be used, reproduced or transmitted in any manner without express written permission from Microsoft Corporation.\",\"errorDetails\":[\"Access was denied. You may have entered your credentials incorrectly, or you might not have access to the requested resource or operation.\"],\"resourceSets\":[],\"statusCode\":401,\"statusDescription\":\"Unauthorized\",\"traceId\":\"82cbc934601245deaa1400bd45a88f70|DU00000D6E|0.0.0.1\"}" + "text": "{\"authenticationResultCode\":\"InvalidCredentials\",\"brandLogoUri\":\"http:\\/\\/dev.virtualearth.net\\/Branding\\/logo_powered_by.png\",\"copyright\":\"Copyright © 2020 Microsoft and its suppliers. All rights reserved. This API cannot be accessed and the content and any results may not be used, reproduced or transmitted in any manner without express written permission from Microsoft Corporation.\",\"errorDetails\":[\"Access was denied. You may have entered your credentials incorrectly, or you might not have access to the requested resource or operation.\"],\"resourceSets\":[],\"statusCode\":401,\"statusDescription\":\"Unauthorized\",\"traceId\":\"b1d87489fca04848879a05015d540dc3|DU00000D67|0.0.0.1\"}" }, "cookies": [], "headers": [ @@ -73,7 +82,7 @@ }, { "name": "x-bm-traceid", - "value": "82cbc934601245deaa1400bd45a88f70" + "value": "b1d87489fca04848879a05015d540dc3" }, { "name": "x-bm-fe-elapsed", @@ -81,7 +90,7 @@ }, { "name": "x-bm-srv", - "value": "DU00000D6E" + "value": "DU00000D67" }, { "name": "x-ms-bm-ws-info", @@ -109,7 +118,7 @@ }, { "name": "date", - "value": "Thu, 13 Aug 2020 19:24:13 GMT" + "value": "Mon, 02 Nov 2020 18:10:24 GMT" }, { "name": "connection", @@ -122,8 +131,8 @@ "status": 401, "statusText": "Unauthorized" }, - "startedDateTime": "2020-08-13T19:24:13.532Z", - "time": 629, + "startedDateTime": "2020-11-02T18:10:25.103Z", + "time": 151, "timings": { "blocked": -1, "connect": -1, @@ -131,7 +140,7 @@ "receive": 0, "send": 0, "ssl": -1, - "wait": 629 + "wait": 151 } } ], diff --git a/src/GeocoderProviderFactory.ts b/src/GeocoderProviderFactory.ts index 1986bfc..7b05254 100644 --- a/src/GeocoderProviderFactory.ts +++ b/src/GeocoderProviderFactory.ts @@ -1,5 +1,6 @@ import { BingProvider, + BingProviderOptionsInterface, ChainProvider, ChainProviderOptionsInterface, GeoPluginProvider, @@ -16,6 +17,7 @@ import { YandexProvider, YandexProviderOptionsInterface, ProviderOptionsInterface, + defaultBingProviderOptions, defaultChainProviderOptions, defaultMapboxProviderOptions, defaultMapQuestProviderOptions, @@ -29,12 +31,14 @@ import ExternalLoader from "ExternalLoader"; interface ProviderOptionInterface { provider: | "bing" + | "bingmaps" | "chain" | "geoplugin" | "google" | "googlemaps" | "mapbox" | "mapquest" + | "microsoft" | "nominatim" | "opencage" | "openstreetmap" @@ -51,6 +55,12 @@ interface ChainGeocoderProviderFactoryOptions provider: "chain"; } +interface BingGeocoderProviderFactoryOptions + extends ProviderOptionInterface, + BingProviderOptionsInterface { + provider: "bing" | "bingmaps" | "microsoft"; +} + interface GeoPluginGeocoderProviderFactoryOptions extends ProviderOptionInterface { provider: "geoplugin"; @@ -95,6 +105,7 @@ interface YandexGeocoderProviderFactoryOptions export type GeocoderProviderFactoryOptions = | ProviderFactoryOptions | ChainGeocoderProviderFactoryOptions + | BingGeocoderProviderFactoryOptions | GeoPluginGeocoderProviderFactoryOptions | GoogleMapsGeocoderProviderFactoryOptions | MapboxGeocoderProviderFactoryOptions @@ -118,6 +129,8 @@ export type GeocoderProviderByOptionsType< O > = O extends ChainGeocoderProviderFactoryOptions ? ChainProvider + : O extends BingGeocoderProviderFactoryOptions + ? BingProvider : O extends GeoPluginGeocoderProviderFactoryOptions ? GeoPluginProvider : O extends GoogleMapsGeocoderProviderFactoryOptions @@ -158,8 +171,13 @@ export default class ProviderFactory { const { provider, ...providerOptions } = createProviderOptions; switch (provider) { case "bing": + case "bingmaps": + case "microsoft": return >( - new BingProvider(externalLoader, providerOptions) + new BingProvider(externalLoader, { + ...defaultBingProviderOptions, + ...providerOptions, + }) ); case "chain": return >new ChainProvider({ diff --git a/src/error/ResponseError.ts b/src/error/ResponseError.ts index b42bee1..a469ace 100644 --- a/src/error/ResponseError.ts +++ b/src/error/ResponseError.ts @@ -1,4 +1,5 @@ import { + BingResponse, GeoPluginResult, GoogleMapsResponse, MapboxResponse, @@ -12,6 +13,7 @@ export default class ResponseError extends Error { private readonly response: | Response + | BingResponse | GeoPluginResult | GoogleMapsResponse | MapboxResponse @@ -23,6 +25,7 @@ export default class ResponseError extends Error { message: string, response: | Response + | BingResponse | GeoPluginResult | GoogleMapsResponse | MapboxResponse @@ -40,6 +43,7 @@ export default class ResponseError extends Error { public getResponse(): | Response + | BingResponse | GeoPluginResult | GoogleMapsResponse | MapboxResponse diff --git a/src/provider/bing/BingGeocoded.ts b/src/provider/bing/BingGeocoded.ts new file mode 100644 index 0000000..c0276b3 --- /dev/null +++ b/src/provider/bing/BingGeocoded.ts @@ -0,0 +1,57 @@ +import Geocoded, { GeocodedObject } from "Geocoded"; +import { BingPrecision } from "provider"; + +export interface BingGeocodedObject extends GeocodedObject { + readonly attribution?: string; + readonly precision?: BingPrecision; +} + +export default class BingGeocoded extends Geocoded { + private readonly attribution?: string; + + private readonly precision?: BingPrecision; + + protected constructor({ + attribution, + precision, + ...geocodedObject + }: BingGeocodedObject) { + super(geocodedObject); + this.attribution = attribution; + this.precision = precision; + } + + public static create(object: BingGeocodedObject): BingGeocoded { + return new this(object); + } + + public toObject(): BingGeocodedObject { + return { + ...super.toObject(), + attribution: this.attribution, + precision: this.precision, + }; + } + + public withAttribution(attribution: string): BingGeocoded { + return new BingGeocoded({ + ...this.toObject(), + attribution, + }); + } + + public getAttribution(): undefined | string { + return this.attribution; + } + + public withPrecision(precision: BingPrecision): BingGeocoded { + return new BingGeocoded({ + ...this.toObject(), + precision, + }); + } + + public getPrecision(): undefined | BingPrecision { + return this.precision; + } +} diff --git a/src/provider/BingProvider.ts b/src/provider/bing/BingProvider.ts similarity index 52% rename from src/provider/BingProvider.ts rename to src/provider/bing/BingProvider.ts index 76f7187..e5411b1 100644 --- a/src/provider/BingProvider.ts +++ b/src/provider/bing/BingProvider.ts @@ -5,6 +5,7 @@ import { ExternalLoaderParams, } from "ExternalLoader"; import { + BingGeocoded, ErrorCallback, GeocodedResultsCallback, ProviderHelpers, @@ -12,62 +13,117 @@ import { ProviderOptionsInterface, defaultProviderOptions, } from "provider"; -import Geocoded from "Geocoded"; import { GeocodeQuery, GeocodeQueryObject, ReverseQuery, ReverseQueryObject, } from "query"; -import { FlatBoundingBox } from "types"; +import { FlatBoundingBox, FlatCoordinates } from "types"; +import AdminLevel from "AdminLevel"; +import { ResponseError } from "error"; interface BingRequestParams { [param: string]: string | undefined; readonly key?: string; + readonly inclnb?: string; + readonly incl?: string; + readonly maxRes?: string; + readonly includeEntityTypes?: string; + readonly c?: string; readonly jsonpCallback?: string; } +export type BingPrecision = "High" | "Medium" | "Low"; + export interface BingResult { __type: string; bbox: FlatBoundingBox; name: string; point: { type: string; - coordinates: [number, number]; + coordinates: FlatCoordinates; }; address: { addressLine: string; + neighborhood?: string; adminDistrict: string; adminDistrict2: string; countryRegion: string; + countryRegionIso2?: string; + landmark?: string; formattedAddress: string; locality: string; postalCode: string; }; - confidence: string; + confidence: BingPrecision; entityType: string; geocodePoints: { type: string; - coordinates: [number, number]; - calculationMethod: string; - usageTypes: string[]; + coordinates: FlatCoordinates; + calculationMethod: + | "Interpolation" + | "InterpolationOffset" + | "Parcel" + | "Rooftop"; + usageTypes: ("Display" | "Route")[]; + }[]; + queryParseValues?: { + property: + | " AddressLine" + | "Locality" + | "AdminDistrict" + | "AdminDistrict2" + | "PostalCode" + | "CountryRegion" + | "Landmark"; + value: string; + }; + matchCodes: ("Good" | "Ambiguous" | "UpHierarchy")[]; +} + +export interface BingResponse { + statusCode: number; + statusDescription: string | null; + authenticationResultCode: + | "ValidCredentials" + | "InvalidCredentials" + | "CredentialsExpired" + | "NotAuthorized" + | "NoCredentials" + | "None"; + traceId: string; + copyright: string; + brandLogoUri: string; + resourceSets: { + estimatedTotal: number; + resources: BingResult[]; }[]; - matchCodes: string[]; + errorDetails?: string[]; +} + +export interface BingProviderOptionsInterface extends ProviderOptionsInterface { + readonly apiKey: string; } -type BingGeocodedResultsCallback = GeocodedResultsCallback; +export const defaultBingProviderOptions = { + ...defaultProviderOptions, + apiKey: "", +}; + +type BingGeocodedResultsCallback = GeocodedResultsCallback; -export default class BingProvider implements ProviderInterface { +export default class BingProvider implements ProviderInterface { private externalLoader: ExternalLoaderInterface; - private options: ProviderOptionsInterface; + private options: BingProviderOptionsInterface; public constructor( _externalLoader: ExternalLoaderInterface, - options: ProviderOptionsInterface = defaultProviderOptions + options: BingProviderOptionsInterface = defaultBingProviderOptions ) { this.externalLoader = _externalLoader; - this.options = { ...defaultProviderOptions, ...options }; + this.options = { ...defaultBingProviderOptions, ...options }; if (!this.options.apiKey) { throw new Error( 'An API key is required for the Bing provider. Please add it in the "apiKey" option.' @@ -94,10 +150,14 @@ export default class BingProvider implements ProviderInterface { pathname: `REST/v1/Locations/${geocodeQuery.getText()}`, }); - const params: BingRequestParams = { - key: this.options.apiKey, - jsonpCallback: this.options.useJsonp ? "jsonp" : undefined, - }; + const params: BingRequestParams = this.withCommonParams( + { + maxRes: geocodeQuery.getLimit() + ? geocodeQuery.getLimit().toString() + : undefined, + }, + geocodeQuery + ); this.executeRequest(params, callback, {}, {}, errorCallback); } @@ -130,12 +190,22 @@ export default class BingProvider implements ProviderInterface { }`, }); - const params: BingRequestParams = { + const params: BingRequestParams = this.withCommonParams({}, reverseQuery); + + this.executeRequest(params, reverseCallback, {}, {}, reverseErrorCallback); + } + + private withCommonParams( + params: Pick, + query: GeocodeQuery | ReverseQuery + ): BingRequestParams { + return { + ...params, key: this.options.apiKey, + incl: "ciso2", + c: query.getLocale(), jsonpCallback: this.options.useJsonp ? "jsonp" : undefined, }; - - this.executeRequest(params, reverseCallback, {}, {}, reverseErrorCallback); } public executeRequest( @@ -147,20 +217,38 @@ export default class BingProvider implements ProviderInterface { ): void { this.externalLoader.executeRequest( params, - (data) => { + (data: BingResponse) => { callback( data.resourceSets[0].resources.map((result: BingResult) => - BingProvider.mapToGeocoded(result) + BingProvider.mapToGeocoded(result, data.copyright) ) ); }, headers, body, - errorCallback + (error) => { + const response = error.getResponse(); + response.json().then((data: BingResponse) => { + const errorMessage = + data.errorDetails && data.errorDetails.length > 0 + ? data.errorDetails[0] + : data.statusDescription || ""; + if (errorCallback) { + errorCallback(new ResponseError(errorMessage, data)); + return; + } + setTimeout(() => { + throw new Error(errorMessage); + }); + }); + } ); } - public static mapToGeocoded(result: BingResult): Geocoded { + public static mapToGeocoded( + result: BingResult, + attribution?: string + ): BingGeocoded { const latitude = result.point.coordinates[0]; const longitude = result.point.coordinates[1]; const { formattedAddress } = result.address; @@ -168,8 +256,10 @@ export default class BingProvider implements ProviderInterface { const { locality, postalCode } = result.address; const region = result.address.adminDistrict; const country = result.address.countryRegion; + const countryCode = result.address.countryRegionIso2; + const precision = result.confidence; - let geocoded = Geocoded.create({ + let geocoded = BingGeocoded.create({ coordinates: { latitude, longitude, @@ -180,14 +270,32 @@ export default class BingProvider implements ProviderInterface { postalCode, region, country, + countryCode, + attribution, + precision, }); - geocoded = geocoded.withBounds({ + geocoded = geocoded.withBounds({ latitudeSW: result.bbox[0], longitudeSW: result.bbox[1], latitudeNE: result.bbox[2], longitudeNE: result.bbox[3], }); + const adminLevels: ("adminDistrict" | "adminDistrict2")[] = [ + "adminDistrict", + "adminDistrict2", + ]; + adminLevels.forEach((adminLevel, level) => { + if (result.address[adminLevel]) { + geocoded.addAdminLevel( + AdminLevel.create({ + level: level + 1, + name: result.address[adminLevel] || "", + }) + ); + } + }); + return geocoded; } } diff --git a/src/provider/bing/index.ts b/src/provider/bing/index.ts new file mode 100644 index 0000000..a6a34cc --- /dev/null +++ b/src/provider/bing/index.ts @@ -0,0 +1,3 @@ +export { default as BingGeocoded } from "provider/bing/BingGeocoded"; +export { default as BingProvider } from "provider/bing/BingProvider"; +export * from "provider/bing/BingProvider"; diff --git a/src/provider/index.ts b/src/provider/index.ts index 39d0b8b..a546666 100644 --- a/src/provider/index.ts +++ b/src/provider/index.ts @@ -1,10 +1,9 @@ export { default as ProviderHelpers } from "provider/ProviderHelpers"; export { default as ProviderInterface } from "provider/ProviderInterface"; export * from "provider/ProviderInterface"; -export { default as BingProvider } from "provider/BingProvider"; -export * from "provider/BingProvider"; export { default as ChainProvider } from "provider/ChainProvider"; export * from "provider/ChainProvider"; +export * from "provider/bing"; export * from "provider/geoplugin"; export * from "provider/googlemaps"; export * from "provider/mapbox"; diff --git a/src/provider/mapbox/MapboxProvider.ts b/src/provider/mapbox/MapboxProvider.ts index e7f7fff..1ee1372 100644 --- a/src/provider/mapbox/MapboxProvider.ts +++ b/src/provider/mapbox/MapboxProvider.ts @@ -17,7 +17,7 @@ import { ProviderOptionsInterface, defaultProviderOptions, } from "provider"; -import { FlatBoundingBox } from "types"; +import { FlatBoundingBox, FlatCoordinates } from "types"; import AdminLevel, { ADMIN_LEVEL_CODES } from "AdminLevel"; interface MapboxRequestParams { @@ -79,16 +79,16 @@ export interface MapboxResult { matching_place_name?: string; language?: string; bbox?: FlatBoundingBox; - center: [number, number]; + center: FlatCoordinates; geometry: { type: "Point"; - coordinates: [number, number]; + coordinates: FlatCoordinates; }; context?: MapboxFeatureContextProperties[]; // eslint-disable-next-line camelcase routable_points?: { points?: { - coordinates: [number, number]; + coordinates: FlatCoordinates; }[]; }; } diff --git a/src/provider/opencage/OpenCageGeocodeQuery.ts b/src/provider/opencage/OpenCageGeocodeQuery.ts index 647f5ab..d6281eb 100644 --- a/src/provider/opencage/OpenCageGeocodeQuery.ts +++ b/src/provider/opencage/OpenCageGeocodeQuery.ts @@ -4,7 +4,7 @@ import { Coordinates } from "types"; export interface OpenCageGeocodeQueryObject extends GeocodeQueryObject { readonly countryCodes?: string[]; readonly proximity?: Coordinates; - readonly minConfidence?: number; + readonly minPrecision?: number; readonly noRecord?: boolean; } @@ -13,14 +13,14 @@ export default class OpenCageGeocodeQuery extends GeocodeQuery { private readonly proximity?: Coordinates; - private readonly minConfidence?: number; + private readonly minPrecision?: number; private readonly noRecord?: boolean; protected constructor({ countryCodes, proximity, - minConfidence, + minPrecision, noRecord, ...geocodeQueryObject }: OpenCageGeocodeQueryObject) { @@ -33,17 +33,17 @@ export default class OpenCageGeocodeQuery extends GeocodeQuery { } this.proximity = proximity; if ( - minConfidence && - (minConfidence.toString() !== - parseInt(minConfidence.toString(), 10).toString() || - minConfidence < 1 || - minConfidence > 10) + minPrecision && + (minPrecision.toString() !== + parseInt(minPrecision.toString(), 10).toString() || + minPrecision < 1 || + minPrecision > 10) ) { throw new Error( - 'The "minConfidence" parameter must be an integer from 1 to 10.' + 'The "minPrecision" parameter must be an integer from 1 to 10.' ); } - this.minConfidence = minConfidence; + this.minPrecision = minPrecision; this.noRecord = noRecord; } @@ -58,7 +58,7 @@ export default class OpenCageGeocodeQuery extends GeocodeQuery { ...super.toObject(), countryCodes: this.countryCodes, proximity: this.proximity, - minConfidence: this.minConfidence, + minPrecision: this.minPrecision, noRecord: this.noRecord, }; } @@ -79,12 +79,12 @@ export default class OpenCageGeocodeQuery extends GeocodeQuery { return this.proximity; } - public withMinConfidence(minConfidence: number): OpenCageGeocodeQuery { - return new OpenCageGeocodeQuery({ ...this.toObject(), minConfidence }); + public withMinPrecision(minPrecision: number): OpenCageGeocodeQuery { + return new OpenCageGeocodeQuery({ ...this.toObject(), minPrecision }); } - public getMinConfidence(): undefined | number { - return this.minConfidence; + public getMinPrecision(): undefined | number { + return this.minPrecision; } public withNoRecord(noRecord: boolean): OpenCageGeocodeQuery { diff --git a/src/provider/opencage/OpenCageGeocoded.ts b/src/provider/opencage/OpenCageGeocoded.ts index 3243279..98f14d7 100644 --- a/src/provider/opencage/OpenCageGeocoded.ts +++ b/src/provider/opencage/OpenCageGeocoded.ts @@ -3,6 +3,7 @@ import Geocoded, { GeocodedObject } from "Geocoded"; export interface OpenCageGeocodedObject extends GeocodedObject { readonly callingCode?: number; readonly flag?: string; + readonly precision?: number; readonly mgrs?: string; readonly maidenhead?: string; readonly geohash?: string; @@ -14,6 +15,8 @@ export default class OpenCageGeocoded extends Geocoded { private readonly flag?: string; + private readonly precision?: number; + private readonly mgrs?: string; private readonly maidenhead?: string; @@ -25,6 +28,7 @@ export default class OpenCageGeocoded extends Geocoded { protected constructor({ callingCode, flag, + precision, mgrs, maidenhead, geohash, @@ -34,6 +38,7 @@ export default class OpenCageGeocoded extends Geocoded { super(geocodedObject); this.callingCode = callingCode; this.flag = flag; + this.precision = precision; this.mgrs = mgrs; this.maidenhead = maidenhead; this.geohash = geohash; @@ -49,6 +54,7 @@ export default class OpenCageGeocoded extends Geocoded { ...super.toObject(), callingCode: this.callingCode, flag: this.flag, + precision: this.precision, mgrs: this.mgrs, maidenhead: this.maidenhead, geohash: this.geohash, @@ -78,6 +84,17 @@ export default class OpenCageGeocoded extends Geocoded { return this.flag; } + public withPrecision(precision: number): OpenCageGeocoded { + return new OpenCageGeocoded({ + ...this.toObject(), + precision, + }); + } + + public getPrecision(): undefined | number { + return this.precision; + } + public withMgrs(mgrs: string): OpenCageGeocoded { return new OpenCageGeocoded({ ...this.toObject(), diff --git a/src/provider/opencage/OpenCageProvider.ts b/src/provider/opencage/OpenCageProvider.ts index 1e0ffdd..9ce5b22 100644 --- a/src/provider/opencage/OpenCageProvider.ts +++ b/src/provider/opencage/OpenCageProvider.ts @@ -400,7 +400,7 @@ export default class OpenCageProvider : this.options.countryCodes?.join(","), language: query.getLocale(), limit: query.getLimit().toString(), - min_confidence: query.getMinConfidence()?.toString(), + min_confidence: query.getMinPrecision()?.toString(), no_record: query.getNoRecord()?.toString(), jsonpCallback: this.options.useJsonp ? "jsonp" : undefined, }; @@ -488,6 +488,7 @@ export default class OpenCageProvider const timezone = result.annotations.timezone.name; const callingCode = result.annotations.callingcode; const { flag } = result.annotations; + const precision = result.confidence; const mgrs = result.annotations.MGRS; const maidenhead = result.annotations.Maidenhead; const { geohash } = result.annotations; @@ -539,6 +540,7 @@ export default class OpenCageProvider timezone, callingCode, flag, + precision, mgrs, maidenhead, geohash, diff --git a/src/provider/opencage/OpenCageReverseQuery.ts b/src/provider/opencage/OpenCageReverseQuery.ts index 1947698..7cb3193 100644 --- a/src/provider/opencage/OpenCageReverseQuery.ts +++ b/src/provider/opencage/OpenCageReverseQuery.ts @@ -2,37 +2,37 @@ import { ReverseQuery, ReverseQueryObject } from "query"; export interface OpenCageReverseQueryObject extends ReverseQueryObject { readonly countryCodes?: string[]; - readonly minConfidence?: number; + readonly minPrecision?: number; readonly noRecord?: boolean; } export default class OpenCageReverseQuery extends ReverseQuery { private readonly countryCodes?: string[]; - private readonly minConfidence?: number; + private readonly minPrecision?: number; private readonly noRecord?: boolean; protected constructor({ countryCodes, - minConfidence, + minPrecision, noRecord, ...reverseQueryObject }: OpenCageReverseQueryObject) { super(reverseQueryObject); this.countryCodes = countryCodes; if ( - minConfidence && - (minConfidence.toString() !== - parseInt(minConfidence.toString(), 10).toString() || - minConfidence < 1 || - minConfidence > 10) + minPrecision && + (minPrecision.toString() !== + parseInt(minPrecision.toString(), 10).toString() || + minPrecision < 1 || + minPrecision > 10) ) { throw new Error( - 'The "minConfidence" parameter must be an integer from 1 to 10.' + 'The "minPrecision" parameter must be an integer from 1 to 10.' ); } - this.minConfidence = minConfidence; + this.minPrecision = minPrecision; this.noRecord = noRecord; } @@ -46,7 +46,7 @@ export default class OpenCageReverseQuery extends ReverseQuery { return { ...super.toObject(), countryCodes: this.countryCodes, - minConfidence: this.minConfidence, + minPrecision: this.minPrecision, noRecord: this.noRecord, }; } @@ -59,12 +59,12 @@ export default class OpenCageReverseQuery extends ReverseQuery { return this.countryCodes; } - public withMinConfidence(minConfidence: number): OpenCageReverseQuery { - return new OpenCageReverseQuery({ ...this.toObject(), minConfidence }); + public withMinPrecision(minPrecision: number): OpenCageReverseQuery { + return new OpenCageReverseQuery({ ...this.toObject(), minPrecision }); } - public getMinConfidence(): undefined | number { - return this.minConfidence; + public getMinPrecision(): undefined | number { + return this.minPrecision; } public withNoRecord(noRecord: boolean): OpenCageReverseQuery { From a4ec4537ff63631b6df044dc273822cb156d60ff Mon Sep 17 00:00:00 2001 From: Alan Poulain Date: Mon, 2 Nov 2020 19:56:38 +0100 Subject: [PATCH 56/56] 0.8.0 --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index df0a9db..35b62ca 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "universal-geocoder", - "version": "0.7.0", + "version": "0.8.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index c3c3eb6..ab18d4f 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "universal-geocoder", "description": "Universal geocoding abstraction with multiple built-in providers", - "version": "0.7.0", + "version": "0.8.0", "keywords": [ "geocoder", "geocoding",