@nextgis/geocoder 3.0.0-alpha.1 → 3.0.0-alpha.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.
@@ -1,4 +1,4 @@
1
- /** Bundle of @nextgis/geocoder; version: 3.0.0-alpha.1; author: NextGIS */
1
+ /** Bundle of @nextgis/geocoder; version: 3.0.0-alpha.2; author: NextGIS */
2
2
  'use strict';
3
3
 
4
4
  Object.defineProperty(exports, '__esModule', { value: true });
@@ -1,4 +1,4 @@
1
- /** Bundle of @nextgis/geocoder; version: 3.0.0-alpha.1; author: NextGIS */
1
+ /** Bundle of @nextgis/geocoder; version: 3.0.0-alpha.2; author: NextGIS */
2
2
  function defined(val) {
3
3
  return val !== void 0 && val !== null;
4
4
  }
@@ -890,6 +890,62 @@ const _Cache = class _Cache {
890
890
  __publicField$8(_Cache, "instance", {});
891
891
  let Cache = _Cache;
892
892
 
893
+ var pkg = {
894
+ name: "@nextgis/ngw-connector",
895
+ version: "3.0.0-alpha.2",
896
+ _priority: 12,
897
+ description: "A lightweight HTTP client optimized for use with NextGIS Web API",
898
+ main: "index.js",
899
+ module: "lib/ngw-connector.esm-bundler.js",
900
+ unpkg: "lib/ngw-connector.global.prod.js",
901
+ jsdelivr: "lib/ngw-connector.global.prod.js",
902
+ types: "lib/index.d.ts",
903
+ dependencies: {
904
+ "@nextgis/cache": "^3.0.0-alpha.1",
905
+ "@nextgis/cancelable-promise": "^3.0.0-alpha.1",
906
+ "@nextgis/utils": "^3.0.0-alpha.1",
907
+ "@types/events": "^3.0.0",
908
+ events: "*",
909
+ "form-data": "^4.0.0"
910
+ },
911
+ devDependencies: {
912
+ "@nextgis/build-tools": "^3.0.0-alpha.1"
913
+ },
914
+ scripts: {
915
+ clean: "rimraf ./lib",
916
+ dev: "node ../build-tools/lib/build.js",
917
+ prod: "npm run dev -- --release",
918
+ lint: "eslint ./src/**/*.ts --fix --c ../../.eslintrc",
919
+ watch: "npm run dev -- --watch",
920
+ "gen:types": "node ./scripts/generator"
921
+ },
922
+ buildOptions: {
923
+ name: "NgwConnector",
924
+ formats: [
925
+ "esm-bundler",
926
+ "esm-browser",
927
+ "cjs",
928
+ "global"
929
+ ]
930
+ },
931
+ keywords: [
932
+ "NextGIS",
933
+ "MAP"
934
+ ],
935
+ author: "NextGIS",
936
+ files: [
937
+ "index.js",
938
+ "lib"
939
+ ],
940
+ license: "MIT",
941
+ homepage: "https://github.com/nextgis/nextgis_frontend/tree/master/packages/ngw-connector#readme",
942
+ repository: {
943
+ type: "git",
944
+ url: "git://github.com/nextgis/nextgis_frontend.git"
945
+ },
946
+ gitHead: "edc68033f914f6c95c4125b9738bba6d36e990b4"
947
+ };
948
+
893
949
  var __defProp$a = Object.defineProperty;
894
950
  var __defNormalProp$a = (obj, key, value) => key in obj ? __defProp$a(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
895
951
  var __publicField$7 = (obj, key, value) => __defNormalProp$a(obj, typeof key !== "symbol" ? key + "" : key, value);
@@ -1516,6 +1572,7 @@ class NgwConnector {
1516
1572
  __publicField$2(this, "resources");
1517
1573
  __publicField$2(this, "cache");
1518
1574
  __publicField$2(this, "withCredentials");
1575
+ __publicField$2(this, "client", `NextGIS-NGW-Connector/${pkg.version}`);
1519
1576
  __publicField$2(this, "routeStr", "/api/component/pyramid/route");
1520
1577
  __publicField$2(this, "activeRequests", {});
1521
1578
  __publicField$2(this, "requestTransform");
@@ -1586,8 +1643,9 @@ class NgwConnector {
1586
1643
  yield this._login({ login, password });
1587
1644
  }
1588
1645
  }
1646
+ const routeUrl = `${this.routeStr}?client=${this.client}`;
1589
1647
  return yield this.makeQuery(
1590
- this.routeStr,
1648
+ routeUrl,
1591
1649
  {},
1592
1650
  {
1593
1651
  cacheName: "route",
@@ -2124,7 +2182,7 @@ function updateItemRequestParam(params, options) {
2124
2182
  if (extensionsStr !== "*") {
2125
2183
  params.extensions = extensionsStr;
2126
2184
  }
2127
- if (fields !== void 0) {
2185
+ if (fields !== void 0 && fields !== null) {
2128
2186
  params.fields = Array.isArray(fields) ? fields.join(",") : "";
2129
2187
  }
2130
2188
  if (geom !== void 0) {