@nextgis/ngw-connector 3.0.0 → 3.1.1
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/index.d.ts +2 -2
- package/lib/ngw-connector.cjs.js +6 -61
- package/lib/ngw-connector.cjs.js.map +1 -1
- package/lib/ngw-connector.cjs.prod.js +1 -1
- package/lib/ngw-connector.cjs.prod.js.map +1 -1
- package/lib/ngw-connector.esm-browser.js +10 -63
- package/lib/ngw-connector.esm-browser.js.map +1 -1
- package/lib/ngw-connector.esm-browser.prod.js +1 -1
- package/lib/ngw-connector.esm-browser.prod.js.map +1 -1
- package/lib/ngw-connector.esm-bundler.js +7 -62
- package/lib/ngw-connector.esm-bundler.js.map +1 -1
- package/lib/ngw-connector.esm-bundler.prod.js +1 -1
- package/lib/ngw-connector.esm-bundler.prod.js.map +1 -1
- package/lib/ngw-connector.global.js +10 -63
- package/lib/ngw-connector.global.js.map +1 -1
- package/lib/ngw-connector.global.prod.js +1 -1
- package/lib/ngw-connector.global.prod.js.map +1 -1
- package/package.json +2 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** Bundle of @nextgis/ngw-connector; version: 3.
|
|
1
|
+
/** Bundle of @nextgis/ngw-connector; version: 3.1.1; author: NextGIS */
|
|
2
2
|
var NgwConnector = (function () {
|
|
3
3
|
'use strict';
|
|
4
4
|
|
|
@@ -332,7 +332,9 @@ var NgwConnector = (function () {
|
|
|
332
332
|
this.domain = null;
|
|
333
333
|
if (EventEmitter.usingDomains) {
|
|
334
334
|
// if there is an active domain, then attach to it.
|
|
335
|
-
if (domain.active)
|
|
335
|
+
if (domain.active && !(this instanceof domain.Domain)) {
|
|
336
|
+
this.domain = domain.active;
|
|
337
|
+
}
|
|
336
338
|
}
|
|
337
339
|
|
|
338
340
|
if (!this._events || this._events === Object.getPrototypeOf(this)._events) {
|
|
@@ -775,63 +777,7 @@ var NgwConnector = (function () {
|
|
|
775
777
|
}
|
|
776
778
|
|
|
777
779
|
var pkg = {
|
|
778
|
-
|
|
779
|
-
version: "3.0.0",
|
|
780
|
-
_priority: 12,
|
|
781
|
-
description: "A lightweight HTTP client optimized for use with NextGIS Web API",
|
|
782
|
-
main: "index.js",
|
|
783
|
-
module: "lib/ngw-connector.esm-bundler.js",
|
|
784
|
-
unpkg: "lib/ngw-connector.global.prod.js",
|
|
785
|
-
jsdelivr: "lib/ngw-connector.global.prod.js",
|
|
786
|
-
types: "lib/index.d.ts",
|
|
787
|
-
dependencies: {
|
|
788
|
-
"@nextgis/cache": "3.0.0",
|
|
789
|
-
"@nextgis/cancelable-promise": "3.0.0",
|
|
790
|
-
"@nextgis/utils": "3.0.0",
|
|
791
|
-
"@types/events": "^3.0.0",
|
|
792
|
-
events: "*",
|
|
793
|
-
"form-data": "^4.0.0"
|
|
794
|
-
},
|
|
795
|
-
devDependencies: {
|
|
796
|
-
"@nextgis/build-tools": "3.0.0"
|
|
797
|
-
},
|
|
798
|
-
scripts: {
|
|
799
|
-
clean: "rimraf ./lib",
|
|
800
|
-
dev: "node ../build-tools/lib/build.js",
|
|
801
|
-
prod: "npm run dev -- --release",
|
|
802
|
-
lint: "eslint ./src/**/*.ts --fix --c ../../.eslintrc",
|
|
803
|
-
watch: "npm run dev -- --watch",
|
|
804
|
-
"gen:types": "node ./scripts/generator"
|
|
805
|
-
},
|
|
806
|
-
buildOptions: {
|
|
807
|
-
name: "NgwConnector",
|
|
808
|
-
formats: [
|
|
809
|
-
"esm-bundler",
|
|
810
|
-
"esm-browser",
|
|
811
|
-
"cjs",
|
|
812
|
-
"global"
|
|
813
|
-
]
|
|
814
|
-
},
|
|
815
|
-
keywords: [
|
|
816
|
-
"NextGIS",
|
|
817
|
-
"MAP"
|
|
818
|
-
],
|
|
819
|
-
author: "NextGIS",
|
|
820
|
-
files: [
|
|
821
|
-
"index.js",
|
|
822
|
-
"lib"
|
|
823
|
-
],
|
|
824
|
-
license: "MIT",
|
|
825
|
-
homepage: "https://github.com/nextgis/nextgis_frontend/tree/master/packages/ngw-connector#readme",
|
|
826
|
-
repository: {
|
|
827
|
-
type: "git",
|
|
828
|
-
url: "git://github.com/nextgis/nextgis_frontend.git"
|
|
829
|
-
},
|
|
830
|
-
engines: {
|
|
831
|
-
node: ">=18.20.4"
|
|
832
|
-
},
|
|
833
|
-
gitHead: "edc68033f914f6c95c4125b9738bba6d36e990b4"
|
|
834
|
-
};
|
|
780
|
+
version: "3.1.1"};
|
|
835
781
|
|
|
836
782
|
class AbortError extends Error {
|
|
837
783
|
constructor(message = "AbortError") {
|
|
@@ -1709,7 +1655,7 @@ var NgwConnector = (function () {
|
|
|
1709
1655
|
credentials = credentials || this.options.auth;
|
|
1710
1656
|
if (credentials) {
|
|
1711
1657
|
const { login, password } = credentials;
|
|
1712
|
-
const encodedStr =
|
|
1658
|
+
const encodedStr = `${login}:${password}`;
|
|
1713
1659
|
{
|
|
1714
1660
|
return window.btoa(encodedStr);
|
|
1715
1661
|
}
|
|
@@ -1742,7 +1688,7 @@ var NgwConnector = (function () {
|
|
|
1742
1688
|
throw new Error("Empty `url` not allowed");
|
|
1743
1689
|
}
|
|
1744
1690
|
if (params) {
|
|
1745
|
-
const _a = params, restParams = __objRest(_a, ["paramList"]);
|
|
1691
|
+
const _a = params, { paramList } = _a, restParams = __objRest(_a, ["paramList"]);
|
|
1746
1692
|
url = template(url, restParams);
|
|
1747
1693
|
}
|
|
1748
1694
|
url = encodeURI(fixUrlStr(url));
|
|
@@ -2032,8 +1978,9 @@ var NgwConnector = (function () {
|
|
|
2032
1978
|
query: __spreadValues({
|
|
2033
1979
|
serialization: "full"
|
|
2034
1980
|
}, query)
|
|
2035
|
-
})).then((
|
|
2036
|
-
|
|
1981
|
+
})).then((response) => {
|
|
1982
|
+
const resources = Array.isArray(response) ? response : response.items;
|
|
1983
|
+
if (requestOptions == null ? void 0 : requestOptions.cache) {
|
|
2037
1984
|
for (const x of resources) {
|
|
2038
1985
|
this.cache.add("resource.item", Promise.resolve(x), {
|
|
2039
1986
|
id: x.resource.id
|