@nextgis/geocoder 2.5.0 → 2.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/geocoder.cjs.js +1 -1
- package/lib/geocoder.esm-browser.js +63 -5
- package/lib/geocoder.esm-browser.js.map +1 -1
- package/lib/geocoder.esm-browser.prod.js +1 -1
- package/lib/geocoder.esm-browser.prod.js.map +1 -1
- package/lib/geocoder.esm-bundler.js +1 -1
- package/lib/geocoder.global.js +63 -5
- package/lib/geocoder.global.js.map +1 -1
- package/lib/geocoder.global.prod.js +1 -1
- package/lib/geocoder.global.prod.js.map +1 -1
- package/package.json +4 -4
package/lib/geocoder.cjs.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** Bundle of @nextgis/geocoder; version: 2.5.
|
|
1
|
+
/** Bundle of @nextgis/geocoder; version: 2.5.2; author: NextGIS */
|
|
2
2
|
var __defProp$g = Object.defineProperty;
|
|
3
3
|
var __defNormalProp$g = (obj, key, value) => key in obj ? __defProp$g(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
4
4
|
var __publicField$e = (obj, key, value) => __defNormalProp$g(obj, key + "" , value);
|
|
@@ -1205,6 +1205,62 @@ const _Cache = class _Cache {
|
|
|
1205
1205
|
__publicField$8(_Cache, "instance", {});
|
|
1206
1206
|
let Cache = _Cache;
|
|
1207
1207
|
|
|
1208
|
+
var pkg = {
|
|
1209
|
+
name: "@nextgis/ngw-connector",
|
|
1210
|
+
version: "2.5.2",
|
|
1211
|
+
_priority: 12,
|
|
1212
|
+
description: "A lightweight HTTP client optimized for use with NextGIS Web API",
|
|
1213
|
+
main: "index.js",
|
|
1214
|
+
module: "lib/ngw-connector.esm-bundler.js",
|
|
1215
|
+
unpkg: "lib/ngw-connector.global.prod.js",
|
|
1216
|
+
jsdelivr: "lib/ngw-connector.global.prod.js",
|
|
1217
|
+
types: "lib/index.d.ts",
|
|
1218
|
+
dependencies: {
|
|
1219
|
+
"@nextgis/cache": "^2.5.0",
|
|
1220
|
+
"@nextgis/cancelable-promise": "^2.5.0",
|
|
1221
|
+
"@nextgis/utils": "^2.5.0",
|
|
1222
|
+
"@types/events": "^3.0.0",
|
|
1223
|
+
events: "*",
|
|
1224
|
+
"form-data": "^4.0.0"
|
|
1225
|
+
},
|
|
1226
|
+
devDependencies: {
|
|
1227
|
+
"@nextgis/build-tools": "^2.5.0"
|
|
1228
|
+
},
|
|
1229
|
+
scripts: {
|
|
1230
|
+
clean: "rimraf ./lib",
|
|
1231
|
+
dev: "node ../build-tools/lib/build.js",
|
|
1232
|
+
prod: "npm run dev -- --release",
|
|
1233
|
+
lint: "eslint ./src/**/*.ts --fix --c ../../.eslintrc",
|
|
1234
|
+
watch: "npm run dev -- --watch",
|
|
1235
|
+
"gen:types": "node ./scripts/generator"
|
|
1236
|
+
},
|
|
1237
|
+
buildOptions: {
|
|
1238
|
+
name: "NgwConnector",
|
|
1239
|
+
formats: [
|
|
1240
|
+
"esm-bundler",
|
|
1241
|
+
"esm-browser",
|
|
1242
|
+
"cjs",
|
|
1243
|
+
"global"
|
|
1244
|
+
]
|
|
1245
|
+
},
|
|
1246
|
+
keywords: [
|
|
1247
|
+
"NextGIS",
|
|
1248
|
+
"MAP"
|
|
1249
|
+
],
|
|
1250
|
+
author: "NextGIS",
|
|
1251
|
+
files: [
|
|
1252
|
+
"index.js",
|
|
1253
|
+
"lib"
|
|
1254
|
+
],
|
|
1255
|
+
license: "MIT",
|
|
1256
|
+
homepage: "https://github.com/nextgis/nextgis_frontend/tree/master/packages/ngw-connector#readme",
|
|
1257
|
+
repository: {
|
|
1258
|
+
type: "git",
|
|
1259
|
+
url: "git://github.com/nextgis/nextgis_frontend.git"
|
|
1260
|
+
},
|
|
1261
|
+
gitHead: "edc68033f914f6c95c4125b9738bba6d36e990b4"
|
|
1262
|
+
};
|
|
1263
|
+
|
|
1208
1264
|
var __defProp$9 = Object.defineProperty;
|
|
1209
1265
|
var __defNormalProp$9 = (obj, key, value) => key in obj ? __defProp$9(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
1210
1266
|
var __publicField$7 = (obj, key, value) => __defNormalProp$9(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
@@ -1783,6 +1839,7 @@ class NgwConnector {
|
|
|
1783
1839
|
__publicField$2(this, "resources");
|
|
1784
1840
|
__publicField$2(this, "cache");
|
|
1785
1841
|
__publicField$2(this, "withCredentials");
|
|
1842
|
+
__publicField$2(this, "client", `NextGIS-NGW-Connector/${pkg.version}`);
|
|
1786
1843
|
__publicField$2(this, "routeStr", "/api/component/pyramid/route");
|
|
1787
1844
|
__publicField$2(this, "activeRequests", []);
|
|
1788
1845
|
__publicField$2(this, "requestTransform");
|
|
@@ -1848,7 +1905,8 @@ class NgwConnector {
|
|
|
1848
1905
|
const auth = this.options.auth;
|
|
1849
1906
|
const makeConnect = () => new CancelablePromise((resolve, reject) => {
|
|
1850
1907
|
const makeQuery = () => {
|
|
1851
|
-
|
|
1908
|
+
const routeUrl = `${this.routeStr}?client=${this.client}`;
|
|
1909
|
+
return this.makeQuery(routeUrl.toString(), {}, {}).then((route) => {
|
|
1852
1910
|
resolve(route);
|
|
1853
1911
|
}).catch((er) => {
|
|
1854
1912
|
reject(er);
|
|
@@ -1921,9 +1979,9 @@ class NgwConnector {
|
|
|
1921
1979
|
credentials = credentials || this.options.auth;
|
|
1922
1980
|
if (credentials) {
|
|
1923
1981
|
const { login, password } = credentials;
|
|
1924
|
-
const
|
|
1982
|
+
const encodedStr = [login, password].map(encodeURIComponent).join(":");
|
|
1925
1983
|
{
|
|
1926
|
-
return window.btoa(
|
|
1984
|
+
return window.btoa(encodedStr);
|
|
1927
1985
|
}
|
|
1928
1986
|
}
|
|
1929
1987
|
}
|
|
@@ -2339,7 +2397,7 @@ function updateItemRequestParam(params, options) {
|
|
|
2339
2397
|
if (extensionsStr !== "*") {
|
|
2340
2398
|
params.extensions = extensionsStr;
|
|
2341
2399
|
}
|
|
2342
|
-
if (fields !== void 0) {
|
|
2400
|
+
if (fields !== void 0 && fields !== null) {
|
|
2343
2401
|
params.fields = Array.isArray(fields) ? fields.join(",") : "";
|
|
2344
2402
|
}
|
|
2345
2403
|
if (geom !== void 0) {
|