@nextgis/geocoder 3.0.0-alpha.12 → 3.0.0-alpha.13
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 +2 -2
- package/lib/geocoder.cjs.js.map +1 -1
- package/lib/geocoder.cjs.prod.js +1 -1
- package/lib/geocoder.cjs.prod.js.map +1 -1
- package/lib/geocoder.esm-browser.js +449 -441
- 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 +2 -2
- package/lib/geocoder.esm-bundler.js.map +1 -1
- package/lib/geocoder.esm-bundler.prod.js.map +1 -1
- package/lib/geocoder.global.js +449 -441
- 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/lib/index.d.ts +15 -15
- package/package.json +7 -7
package/lib/geocoder.global.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** Bundle of @nextgis/geocoder; version: 3.0.0-alpha.
|
|
1
|
+
/** Bundle of @nextgis/geocoder; version: 3.0.0-alpha.13; author: NextGIS */
|
|
2
2
|
var Geocoder = (function (exports) {
|
|
3
3
|
'use strict';
|
|
4
4
|
|
|
@@ -9,14 +9,6 @@ var Geocoder = (function (exports) {
|
|
|
9
9
|
return typeof val === "string" ? !!val : defined(val);
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
function getBoundsCoordinates(b) {
|
|
13
|
-
const westNorth = [b[0], b[1]];
|
|
14
|
-
const eastNorth = [b[2], b[1]];
|
|
15
|
-
const eastSouth = [b[2], b[3]];
|
|
16
|
-
const westSouth = [b[0], b[3]];
|
|
17
|
-
return [westNorth, eastNorth, eastSouth, westSouth, westNorth];
|
|
18
|
-
}
|
|
19
|
-
|
|
20
12
|
function degrees2meters(lng, lat) {
|
|
21
13
|
lat = lat > 85.06 ? 85.06 : lat < -85.06 ? -85.06 : lat;
|
|
22
14
|
const x = lng * 2003750834e-2 / 180;
|
|
@@ -25,10 +17,23 @@ var Geocoder = (function (exports) {
|
|
|
25
17
|
return [x, y];
|
|
26
18
|
}
|
|
27
19
|
|
|
20
|
+
function getBoundsCoordinates(b) {
|
|
21
|
+
const westNorth = [b[0], b[1]];
|
|
22
|
+
const eastNorth = [b[2], b[1]];
|
|
23
|
+
const eastSouth = [b[2], b[3]];
|
|
24
|
+
const westSouth = [b[0], b[3]];
|
|
25
|
+
return [westNorth, eastNorth, eastSouth, westSouth, westNorth];
|
|
26
|
+
}
|
|
27
|
+
|
|
28
28
|
function isLngLatBoundsArray(array) {
|
|
29
29
|
return Array.isArray(array) && array.length === 4 && array.every((x) => typeof x === "number");
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
+
function round(val, toFixed) {
|
|
33
|
+
const n = 1;
|
|
34
|
+
return Math.round((val + Number.EPSILON) * n) / n;
|
|
35
|
+
}
|
|
36
|
+
|
|
32
37
|
function objectAssign(target, ...sources) {
|
|
33
38
|
for (const source of sources) {
|
|
34
39
|
for (const prop of Object.getOwnPropertyNames(source)) {
|
|
@@ -83,11 +88,6 @@ var Geocoder = (function (exports) {
|
|
|
83
88
|
return newObj;
|
|
84
89
|
}
|
|
85
90
|
|
|
86
|
-
function round(val, toFixed) {
|
|
87
|
-
const n = 1;
|
|
88
|
-
return Math.round((val + Number.EPSILON) * n) / n;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
91
|
function isObject$1(val) {
|
|
92
92
|
return Object.prototype.toString.call(val) === "[object Object]";
|
|
93
93
|
}
|
|
@@ -247,7 +247,7 @@ var Geocoder = (function (exports) {
|
|
|
247
247
|
throw error[0];
|
|
248
248
|
}
|
|
249
249
|
}
|
|
250
|
-
} catch (
|
|
250
|
+
} catch (e) {
|
|
251
251
|
}
|
|
252
252
|
}
|
|
253
253
|
});
|
|
@@ -307,6 +307,245 @@ var Geocoder = (function (exports) {
|
|
|
307
307
|
}
|
|
308
308
|
}
|
|
309
309
|
|
|
310
|
+
const templateRe = /\{ *([\w_-]+) *\}/g;
|
|
311
|
+
function template(str, data) {
|
|
312
|
+
return str.replace(templateRe, (s, key) => {
|
|
313
|
+
let value = data[key];
|
|
314
|
+
if (value === void 0) {
|
|
315
|
+
throw new Error("No value provided for letiable " + s);
|
|
316
|
+
} else if (typeof value === "function") {
|
|
317
|
+
value = value(data);
|
|
318
|
+
}
|
|
319
|
+
return value;
|
|
320
|
+
});
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
var __defProp$g = Object.defineProperty;
|
|
324
|
+
var __getOwnPropSymbols$7 = Object.getOwnPropertySymbols;
|
|
325
|
+
var __hasOwnProp$7 = Object.prototype.hasOwnProperty;
|
|
326
|
+
var __propIsEnum$7 = Object.prototype.propertyIsEnumerable;
|
|
327
|
+
var __defNormalProp$g = (obj, key, value) => key in obj ? __defProp$g(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
328
|
+
var __spreadValues$7 = (a, b) => {
|
|
329
|
+
for (var prop in b || (b = {}))
|
|
330
|
+
if (__hasOwnProp$7.call(b, prop))
|
|
331
|
+
__defNormalProp$g(a, prop, b[prop]);
|
|
332
|
+
if (__getOwnPropSymbols$7)
|
|
333
|
+
for (var prop of __getOwnPropSymbols$7(b)) {
|
|
334
|
+
if (__propIsEnum$7.call(b, prop))
|
|
335
|
+
__defNormalProp$g(a, prop, b[prop]);
|
|
336
|
+
}
|
|
337
|
+
return a;
|
|
338
|
+
};
|
|
339
|
+
var __async$6 = (__this, __arguments, generator) => {
|
|
340
|
+
return new Promise((resolve, reject) => {
|
|
341
|
+
var fulfilled = (value) => {
|
|
342
|
+
try {
|
|
343
|
+
step(generator.next(value));
|
|
344
|
+
} catch (e) {
|
|
345
|
+
reject(e);
|
|
346
|
+
}
|
|
347
|
+
};
|
|
348
|
+
var rejected = (value) => {
|
|
349
|
+
try {
|
|
350
|
+
step(generator.throw(value));
|
|
351
|
+
} catch (e) {
|
|
352
|
+
reject(e);
|
|
353
|
+
}
|
|
354
|
+
};
|
|
355
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
356
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
357
|
+
});
|
|
358
|
+
};
|
|
359
|
+
function apiRequest(opt) {
|
|
360
|
+
return __async$6(this, null, function* () {
|
|
361
|
+
const { params, name, connector, requestOptions } = opt;
|
|
362
|
+
const apiItems = yield connector.connect();
|
|
363
|
+
let apiItem = apiItems && apiItems[name];
|
|
364
|
+
if (apiItem) {
|
|
365
|
+
apiItem = [...apiItem];
|
|
366
|
+
let url = apiItem.shift();
|
|
367
|
+
if (apiItem.length) {
|
|
368
|
+
const replaceParams = {};
|
|
369
|
+
for (let fry = 0; fry < apiItem.length; fry++) {
|
|
370
|
+
const arg = apiItem[fry];
|
|
371
|
+
replaceParams[fry] = `{${arg}}`;
|
|
372
|
+
if (params[arg] === void 0) {
|
|
373
|
+
throw new Error(`\`${arg}\` URL API argument is not specified`);
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
if (url) {
|
|
377
|
+
url = template(url, replaceParams);
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
if (params) {
|
|
381
|
+
const paramArray = [];
|
|
382
|
+
const paramList = params.paramList;
|
|
383
|
+
if (Array.isArray(paramList)) {
|
|
384
|
+
paramList.forEach(([key, value]) => {
|
|
385
|
+
paramArray.push(`${key}=${value}`);
|
|
386
|
+
});
|
|
387
|
+
}
|
|
388
|
+
for (const p in params) {
|
|
389
|
+
if (apiItem.indexOf(p) === -1) {
|
|
390
|
+
paramArray.push(`${p}=${params[p]}`);
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
if (paramArray.length) {
|
|
394
|
+
url = `${url}?${paramArray.join("&")}`;
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
if (url) {
|
|
398
|
+
return connector.makeQuery(url, params, __spreadValues$7({
|
|
399
|
+
cacheName: name
|
|
400
|
+
}, requestOptions));
|
|
401
|
+
} else {
|
|
402
|
+
throw new Error("Request URL is not set");
|
|
403
|
+
}
|
|
404
|
+
} else {
|
|
405
|
+
return void 0;
|
|
406
|
+
}
|
|
407
|
+
});
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
var __defProp$f = Object.defineProperty;
|
|
411
|
+
var __defNormalProp$f = (obj, key, value) => key in obj ? __defProp$f(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
412
|
+
var __publicField$b = (obj, key, value) => __defNormalProp$f(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
413
|
+
const _Cache = class _Cache {
|
|
414
|
+
constructor(options = {}) {
|
|
415
|
+
__publicField$b(this, "cache", []);
|
|
416
|
+
var _a;
|
|
417
|
+
const namespace = (_a = options.namespace) != null ? _a : "default";
|
|
418
|
+
if (_Cache.instance[namespace]) {
|
|
419
|
+
return _Cache.instance[namespace];
|
|
420
|
+
}
|
|
421
|
+
_Cache.instance[namespace] = this;
|
|
422
|
+
return this;
|
|
423
|
+
}
|
|
424
|
+
clean() {
|
|
425
|
+
this.cache.length = 0;
|
|
426
|
+
}
|
|
427
|
+
all() {
|
|
428
|
+
return this.cache;
|
|
429
|
+
}
|
|
430
|
+
/**
|
|
431
|
+
* Caching only a non-empty value.
|
|
432
|
+
*
|
|
433
|
+
* Useful for get or create strategy
|
|
434
|
+
* @example
|
|
435
|
+
* ```javascript
|
|
436
|
+
* const cache = new Cache();
|
|
437
|
+
* const getItemFunc = () => fetch(url).then((data) => {
|
|
438
|
+
* return data.json(); // undefined
|
|
439
|
+
* });
|
|
440
|
+
* const item = await cache.addFull('foo', getItemFunc);
|
|
441
|
+
* if (!item) {
|
|
442
|
+
* await createItem(); // 'New item'
|
|
443
|
+
* }
|
|
444
|
+
*
|
|
445
|
+
* // somewhere else in the code
|
|
446
|
+
* const item = await cache.addFull('foo', getItemFunc).then((resp) => {
|
|
447
|
+
* console.log(resp); // 'New item'
|
|
448
|
+
* });
|
|
449
|
+
* ```
|
|
450
|
+
*/
|
|
451
|
+
addFull(key, valueToSet, propsOrOptions, expirationTime) {
|
|
452
|
+
if (typeof propsOrOptions === "object" && "valueToSet" in propsOrOptions) {
|
|
453
|
+
propsOrOptions.onlyFull = true;
|
|
454
|
+
}
|
|
455
|
+
return this.add(key, valueToSet, propsOrOptions, true, expirationTime);
|
|
456
|
+
}
|
|
457
|
+
add(key, valueToSet, propsOrOptions, onlyFull, expirationTime) {
|
|
458
|
+
let opt;
|
|
459
|
+
let props;
|
|
460
|
+
if (typeof propsOrOptions === "object" && "valueToSet" in propsOrOptions) {
|
|
461
|
+
opt = propsOrOptions;
|
|
462
|
+
onlyFull = opt.onlyFull;
|
|
463
|
+
expirationTime = opt.expirationTime;
|
|
464
|
+
props = opt.props;
|
|
465
|
+
} else {
|
|
466
|
+
props = propsOrOptions;
|
|
467
|
+
}
|
|
468
|
+
const exist = this._find(key, props);
|
|
469
|
+
if (!exist) {
|
|
470
|
+
let value;
|
|
471
|
+
if (valueToSet instanceof Function) {
|
|
472
|
+
value = valueToSet();
|
|
473
|
+
} else {
|
|
474
|
+
value = valueToSet;
|
|
475
|
+
}
|
|
476
|
+
const nonEmptyProps = props && JSON.parse(JSON.stringify(objectRemoveEmpty(props)));
|
|
477
|
+
expirationTime = expirationTime ? Date.now() + expirationTime : void 0;
|
|
478
|
+
const cacheItem = {
|
|
479
|
+
key,
|
|
480
|
+
value,
|
|
481
|
+
props: nonEmptyProps,
|
|
482
|
+
expirationTime
|
|
483
|
+
};
|
|
484
|
+
if (onlyFull && !full(value)) {
|
|
485
|
+
return value;
|
|
486
|
+
}
|
|
487
|
+
this.cache.push(cacheItem);
|
|
488
|
+
if (value instanceof Promise) {
|
|
489
|
+
value.catch(() => {
|
|
490
|
+
this.delete(key, props);
|
|
491
|
+
});
|
|
492
|
+
if (onlyFull) {
|
|
493
|
+
value.then((x) => {
|
|
494
|
+
if (!full(x)) {
|
|
495
|
+
this.delete(key, props);
|
|
496
|
+
}
|
|
497
|
+
return x;
|
|
498
|
+
});
|
|
499
|
+
}
|
|
500
|
+
return value;
|
|
501
|
+
}
|
|
502
|
+
return value;
|
|
503
|
+
} else {
|
|
504
|
+
return exist.value;
|
|
505
|
+
}
|
|
506
|
+
}
|
|
507
|
+
match(key, props) {
|
|
508
|
+
const cacheRecord = this._find(key, props);
|
|
509
|
+
if (cacheRecord && cacheRecord.expirationTime && Date.now() > cacheRecord.expirationTime) {
|
|
510
|
+
this.delete(cacheRecord);
|
|
511
|
+
return void 0;
|
|
512
|
+
}
|
|
513
|
+
return cacheRecord == null ? void 0 : cacheRecord.value;
|
|
514
|
+
}
|
|
515
|
+
matchAll(key, props) {
|
|
516
|
+
const now = Date.now();
|
|
517
|
+
this.cache.forEach((item) => {
|
|
518
|
+
if (item.expirationTime && now > item.expirationTime) {
|
|
519
|
+
this.delete(item);
|
|
520
|
+
}
|
|
521
|
+
});
|
|
522
|
+
if (key) {
|
|
523
|
+
return this.cache.filter((x) => this._filter(x, key, props)).map((x) => x.value);
|
|
524
|
+
}
|
|
525
|
+
return this.cache.map((x) => x.value);
|
|
526
|
+
}
|
|
527
|
+
delete(keyOrItem, props) {
|
|
528
|
+
const itemsToDelete = typeof keyOrItem === "string" ? this.cache.filter((x) => this._filter(x, keyOrItem, props)) : [keyOrItem];
|
|
529
|
+
for (const item of itemsToDelete) {
|
|
530
|
+
const index = this.cache.indexOf(item);
|
|
531
|
+
if (index !== -1) {
|
|
532
|
+
this.cache.splice(index, 1);
|
|
533
|
+
}
|
|
534
|
+
}
|
|
535
|
+
}
|
|
536
|
+
_find(key, props) {
|
|
537
|
+
return this.cache.find((x) => this._filter(x, key, props));
|
|
538
|
+
}
|
|
539
|
+
_filter(item, key, props) {
|
|
540
|
+
if (item.key !== key) return false;
|
|
541
|
+
if (!props) return true;
|
|
542
|
+
const itemProps = item.props;
|
|
543
|
+
return objectDeepEqual(itemProps || {}, objectRemoveEmpty(props));
|
|
544
|
+
}
|
|
545
|
+
};
|
|
546
|
+
__publicField$b(_Cache, "instance", {});
|
|
547
|
+
let Cache = _Cache;
|
|
548
|
+
|
|
310
549
|
var domain;
|
|
311
550
|
|
|
312
551
|
// This constructor is used to store event handlers. Instantiating this is
|
|
@@ -779,148 +1018,9 @@ var Geocoder = (function (exports) {
|
|
|
779
1018
|
return ret;
|
|
780
1019
|
}
|
|
781
1020
|
|
|
782
|
-
var __defProp$g = Object.defineProperty;
|
|
783
|
-
var __defNormalProp$g = (obj, key, value) => key in obj ? __defProp$g(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
784
|
-
var __publicField$b = (obj, key, value) => __defNormalProp$g(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
785
|
-
const _Cache = class _Cache {
|
|
786
|
-
constructor(options = {}) {
|
|
787
|
-
__publicField$b(this, "cache", []);
|
|
788
|
-
var _a;
|
|
789
|
-
const namespace = (_a = options.namespace) != null ? _a : "default";
|
|
790
|
-
if (_Cache.instance[namespace]) {
|
|
791
|
-
return _Cache.instance[namespace];
|
|
792
|
-
}
|
|
793
|
-
_Cache.instance[namespace] = this;
|
|
794
|
-
return this;
|
|
795
|
-
}
|
|
796
|
-
clean() {
|
|
797
|
-
this.cache.length = 0;
|
|
798
|
-
}
|
|
799
|
-
all() {
|
|
800
|
-
return this.cache;
|
|
801
|
-
}
|
|
802
|
-
/**
|
|
803
|
-
* Caching only a non-empty value.
|
|
804
|
-
*
|
|
805
|
-
* Useful for get or create strategy
|
|
806
|
-
* @example
|
|
807
|
-
* ```javascript
|
|
808
|
-
* const cache = new Cache();
|
|
809
|
-
* const getItemFunc = () => fetch(url).then((data) => {
|
|
810
|
-
* return data.json(); // undefined
|
|
811
|
-
* });
|
|
812
|
-
* const item = await cache.addFull('foo', getItemFunc);
|
|
813
|
-
* if (!item) {
|
|
814
|
-
* await createItem(); // 'New item'
|
|
815
|
-
* }
|
|
816
|
-
*
|
|
817
|
-
* // somewhere else in the code
|
|
818
|
-
* const item = await cache.addFull('foo', getItemFunc).then((resp) => {
|
|
819
|
-
* console.log(resp); // 'New item'
|
|
820
|
-
* });
|
|
821
|
-
* ```
|
|
822
|
-
*/
|
|
823
|
-
addFull(key, valueToSet, propsOrOptions, expirationTime) {
|
|
824
|
-
if (typeof propsOrOptions === "object" && "valueToSet" in propsOrOptions) {
|
|
825
|
-
propsOrOptions.onlyFull = true;
|
|
826
|
-
}
|
|
827
|
-
return this.add(key, valueToSet, propsOrOptions, true, expirationTime);
|
|
828
|
-
}
|
|
829
|
-
add(key, valueToSet, propsOrOptions, onlyFull, expirationTime) {
|
|
830
|
-
let opt;
|
|
831
|
-
let props;
|
|
832
|
-
if (typeof propsOrOptions === "object" && "valueToSet" in propsOrOptions) {
|
|
833
|
-
opt = propsOrOptions;
|
|
834
|
-
onlyFull = opt.onlyFull;
|
|
835
|
-
expirationTime = opt.expirationTime;
|
|
836
|
-
props = opt.props;
|
|
837
|
-
} else {
|
|
838
|
-
props = propsOrOptions;
|
|
839
|
-
}
|
|
840
|
-
const exist = this._find(key, props);
|
|
841
|
-
if (!exist) {
|
|
842
|
-
let value;
|
|
843
|
-
if (valueToSet instanceof Function) {
|
|
844
|
-
value = valueToSet();
|
|
845
|
-
} else {
|
|
846
|
-
value = valueToSet;
|
|
847
|
-
}
|
|
848
|
-
const nonEmptyProps = props && JSON.parse(JSON.stringify(objectRemoveEmpty(props)));
|
|
849
|
-
expirationTime = expirationTime ? Date.now() + expirationTime : void 0;
|
|
850
|
-
const cacheItem = {
|
|
851
|
-
key,
|
|
852
|
-
value,
|
|
853
|
-
props: nonEmptyProps,
|
|
854
|
-
expirationTime
|
|
855
|
-
};
|
|
856
|
-
if (onlyFull && !full(value)) {
|
|
857
|
-
return value;
|
|
858
|
-
}
|
|
859
|
-
this.cache.push(cacheItem);
|
|
860
|
-
if (value instanceof Promise) {
|
|
861
|
-
value.catch((er) => {
|
|
862
|
-
this.delete(key, props);
|
|
863
|
-
});
|
|
864
|
-
if (onlyFull) {
|
|
865
|
-
value.then((x) => {
|
|
866
|
-
if (!full(x)) {
|
|
867
|
-
this.delete(key, props);
|
|
868
|
-
}
|
|
869
|
-
return x;
|
|
870
|
-
});
|
|
871
|
-
}
|
|
872
|
-
return value;
|
|
873
|
-
}
|
|
874
|
-
return value;
|
|
875
|
-
} else {
|
|
876
|
-
return exist.value;
|
|
877
|
-
}
|
|
878
|
-
}
|
|
879
|
-
match(key, props) {
|
|
880
|
-
const cacheRecord = this._find(key, props);
|
|
881
|
-
if (cacheRecord && cacheRecord.expirationTime && Date.now() > cacheRecord.expirationTime) {
|
|
882
|
-
this.delete(cacheRecord);
|
|
883
|
-
return void 0;
|
|
884
|
-
}
|
|
885
|
-
return cacheRecord == null ? void 0 : cacheRecord.value;
|
|
886
|
-
}
|
|
887
|
-
matchAll(key, props) {
|
|
888
|
-
const now = Date.now();
|
|
889
|
-
this.cache.forEach((item) => {
|
|
890
|
-
if (item.expirationTime && now > item.expirationTime) {
|
|
891
|
-
this.delete(item);
|
|
892
|
-
}
|
|
893
|
-
});
|
|
894
|
-
if (key) {
|
|
895
|
-
return this.cache.filter((x) => this._filter(x, key, props)).map((x) => x.value);
|
|
896
|
-
}
|
|
897
|
-
return this.cache.map((x) => x.value);
|
|
898
|
-
}
|
|
899
|
-
delete(keyOrItem, props) {
|
|
900
|
-
const itemsToDelete = typeof keyOrItem === "string" ? this.cache.filter((x) => this._filter(x, keyOrItem, props)) : [keyOrItem];
|
|
901
|
-
for (const item of itemsToDelete) {
|
|
902
|
-
const index = this.cache.indexOf(item);
|
|
903
|
-
if (index !== -1) {
|
|
904
|
-
this.cache.splice(index, 1);
|
|
905
|
-
}
|
|
906
|
-
}
|
|
907
|
-
}
|
|
908
|
-
_find(key, props) {
|
|
909
|
-
return this.cache.find((x) => this._filter(x, key, props));
|
|
910
|
-
}
|
|
911
|
-
_filter(item, key, props) {
|
|
912
|
-
if (item.key !== key) return false;
|
|
913
|
-
if (!props) return true;
|
|
914
|
-
const itemProps = item.props;
|
|
915
|
-
return objectDeepEqual(itemProps || {}, objectRemoveEmpty(props));
|
|
916
|
-
}
|
|
917
|
-
};
|
|
918
|
-
__publicField$b(_Cache, "instance", {});
|
|
919
|
-
let Cache = _Cache;
|
|
920
|
-
|
|
921
1021
|
var pkg = {
|
|
922
1022
|
name: "@nextgis/ngw-connector",
|
|
923
|
-
version: "3.0.0-alpha.
|
|
1023
|
+
version: "3.0.0-alpha.13",
|
|
924
1024
|
_priority: 12,
|
|
925
1025
|
description: "A lightweight HTTP client optimized for use with NextGIS Web API",
|
|
926
1026
|
main: "index.js",
|
|
@@ -929,15 +1029,15 @@ var Geocoder = (function (exports) {
|
|
|
929
1029
|
jsdelivr: "lib/ngw-connector.global.prod.js",
|
|
930
1030
|
types: "lib/index.d.ts",
|
|
931
1031
|
dependencies: {
|
|
932
|
-
"@nextgis/cache": "^3.0.0-alpha.
|
|
933
|
-
"@nextgis/cancelable-promise": "^3.0.0-alpha.
|
|
934
|
-
"@nextgis/utils": "^3.0.0-alpha.
|
|
1032
|
+
"@nextgis/cache": "^3.0.0-alpha.13",
|
|
1033
|
+
"@nextgis/cancelable-promise": "^3.0.0-alpha.13",
|
|
1034
|
+
"@nextgis/utils": "^3.0.0-alpha.13",
|
|
935
1035
|
"@types/events": "^3.0.0",
|
|
936
1036
|
events: "*",
|
|
937
1037
|
"form-data": "^4.0.0"
|
|
938
1038
|
},
|
|
939
1039
|
devDependencies: {
|
|
940
|
-
"@nextgis/build-tools": "^3.0.0-alpha.
|
|
1040
|
+
"@nextgis/build-tools": "^3.0.0-alpha.13"
|
|
941
1041
|
},
|
|
942
1042
|
scripts: {
|
|
943
1043
|
clean: "rimraf ./lib",
|
|
@@ -977,30 +1077,6 @@ var Geocoder = (function (exports) {
|
|
|
977
1077
|
gitHead: "edc68033f914f6c95c4125b9738bba6d36e990b4"
|
|
978
1078
|
};
|
|
979
1079
|
|
|
980
|
-
const CONNECTORS = [];
|
|
981
|
-
function addConnector(connector) {
|
|
982
|
-
CONNECTORS.push(connector);
|
|
983
|
-
}
|
|
984
|
-
function findConnector(options) {
|
|
985
|
-
return CONNECTORS.find((x) => {
|
|
986
|
-
if (x.options.baseUrl === options.baseUrl) {
|
|
987
|
-
if (options.auth) {
|
|
988
|
-
if (x.options.auth) {
|
|
989
|
-
return objectDeepEqual(x.options.auth, options.auth);
|
|
990
|
-
}
|
|
991
|
-
} else {
|
|
992
|
-
return true;
|
|
993
|
-
}
|
|
994
|
-
}
|
|
995
|
-
});
|
|
996
|
-
}
|
|
997
|
-
function removeConnector(connector) {
|
|
998
|
-
const index = CONNECTORS.indexOf(connector);
|
|
999
|
-
if (index !== -1) {
|
|
1000
|
-
CONNECTORS.splice(index, 1);
|
|
1001
|
-
}
|
|
1002
|
-
}
|
|
1003
|
-
|
|
1004
1080
|
class AbortError extends Error {
|
|
1005
1081
|
constructor(message = "AbortError") {
|
|
1006
1082
|
super(message);
|
|
@@ -1008,9 +1084,9 @@ var Geocoder = (function (exports) {
|
|
|
1008
1084
|
}
|
|
1009
1085
|
}
|
|
1010
1086
|
|
|
1011
|
-
var __defProp$
|
|
1012
|
-
var __defNormalProp$
|
|
1013
|
-
var __publicField$a = (obj, key, value) => __defNormalProp$
|
|
1087
|
+
var __defProp$e = Object.defineProperty;
|
|
1088
|
+
var __defNormalProp$e = (obj, key, value) => key in obj ? __defProp$e(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
1089
|
+
var __publicField$a = (obj, key, value) => __defNormalProp$e(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
1014
1090
|
class NgwError extends Error {
|
|
1015
1091
|
constructor(er) {
|
|
1016
1092
|
super();
|
|
@@ -1027,9 +1103,9 @@ var Geocoder = (function (exports) {
|
|
|
1027
1103
|
}
|
|
1028
1104
|
}
|
|
1029
1105
|
|
|
1030
|
-
var __defProp$
|
|
1031
|
-
var __defNormalProp$
|
|
1032
|
-
var __publicField$9 = (obj, key, value) => __defNormalProp$
|
|
1106
|
+
var __defProp$d = Object.defineProperty;
|
|
1107
|
+
var __defNormalProp$d = (obj, key, value) => key in obj ? __defProp$d(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
1108
|
+
var __publicField$9 = (obj, key, value) => __defNormalProp$d(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
1033
1109
|
class InsufficientPermissionsError extends NgwError {
|
|
1034
1110
|
constructor(obj) {
|
|
1035
1111
|
super(obj);
|
|
@@ -1039,51 +1115,19 @@ var Geocoder = (function (exports) {
|
|
|
1039
1115
|
}
|
|
1040
1116
|
}
|
|
1041
1117
|
|
|
1042
|
-
var __defProp$d = Object.defineProperty;
|
|
1043
|
-
var __defNormalProp$d = (obj, key, value) => key in obj ? __defProp$d(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
1044
|
-
var __publicField$8 = (obj, key, value) => __defNormalProp$d(obj, key + "" , value);
|
|
1045
|
-
class NetworkError extends Error {
|
|
1046
|
-
constructor(url) {
|
|
1047
|
-
super();
|
|
1048
|
-
__publicField$8(this, "name", "NetworkError");
|
|
1049
|
-
Object.setPrototypeOf(this, NetworkError.prototype);
|
|
1050
|
-
this.message = `Unable to request ${url}.
|
|
1051
|
-
Possibly invalid NGW URL entered or CORS not configured to get request from ${location.origin}`;
|
|
1052
|
-
}
|
|
1053
|
-
}
|
|
1054
|
-
|
|
1055
1118
|
var __defProp$c = Object.defineProperty;
|
|
1056
1119
|
var __defNormalProp$c = (obj, key, value) => key in obj ? __defProp$c(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
1057
|
-
var __publicField$
|
|
1120
|
+
var __publicField$8 = (obj, key, value) => __defNormalProp$c(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
1058
1121
|
let NetworksResponseError$1 = class NetworksResponseError extends NgwError {
|
|
1059
1122
|
constructor(obj) {
|
|
1060
1123
|
super(obj);
|
|
1061
|
-
__publicField$
|
|
1062
|
-
__publicField$
|
|
1063
|
-
__publicField$
|
|
1124
|
+
__publicField$8(this, "message", "There is no response from the server or problem connecting to server.");
|
|
1125
|
+
__publicField$8(this, "title", "Network error");
|
|
1126
|
+
__publicField$8(this, "detail", "Check network connectivity and try again later.");
|
|
1064
1127
|
Object.setPrototypeOf(this, NetworksResponseError.prototype);
|
|
1065
1128
|
}
|
|
1066
1129
|
};
|
|
1067
1130
|
|
|
1068
|
-
var __defProp$b = Object.defineProperty;
|
|
1069
|
-
var __defNormalProp$b = (obj, key, value) => key in obj ? __defProp$b(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
1070
|
-
var __publicField$6 = (obj, key, value) => __defNormalProp$b(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
1071
|
-
class ResourceNotFoundError extends NgwError {
|
|
1072
|
-
constructor(obj) {
|
|
1073
|
-
super(obj);
|
|
1074
|
-
__publicField$6(this, "name", "ResourceNotFoundError");
|
|
1075
|
-
__publicField$6(this, "exception", "nextgisweb.resource.exception.ResourceNotFound");
|
|
1076
|
-
Object.setPrototypeOf(this, ResourceNotFoundError.prototype);
|
|
1077
|
-
}
|
|
1078
|
-
}
|
|
1079
|
-
|
|
1080
|
-
function isError(error) {
|
|
1081
|
-
if (isObject$1(error)) {
|
|
1082
|
-
return error.status_code && error.exception && error.title;
|
|
1083
|
-
}
|
|
1084
|
-
return false;
|
|
1085
|
-
}
|
|
1086
|
-
|
|
1087
1131
|
function extractError(error) {
|
|
1088
1132
|
if (isObject$1(error)) {
|
|
1089
1133
|
if (error.name && error.message && error.title) {
|
|
@@ -1109,6 +1153,38 @@ var Geocoder = (function (exports) {
|
|
|
1109
1153
|
}
|
|
1110
1154
|
}
|
|
1111
1155
|
|
|
1156
|
+
function isError(error) {
|
|
1157
|
+
if (isObject$1(error)) {
|
|
1158
|
+
return error.status_code && error.exception && error.title;
|
|
1159
|
+
}
|
|
1160
|
+
return false;
|
|
1161
|
+
}
|
|
1162
|
+
|
|
1163
|
+
var __defProp$b = Object.defineProperty;
|
|
1164
|
+
var __defNormalProp$b = (obj, key, value) => key in obj ? __defProp$b(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
1165
|
+
var __publicField$7 = (obj, key, value) => __defNormalProp$b(obj, key + "" , value);
|
|
1166
|
+
class NetworkError extends Error {
|
|
1167
|
+
constructor(url) {
|
|
1168
|
+
super();
|
|
1169
|
+
__publicField$7(this, "name", "NetworkError");
|
|
1170
|
+
Object.setPrototypeOf(this, NetworkError.prototype);
|
|
1171
|
+
this.message = `Unable to request ${url}.
|
|
1172
|
+
Possibly invalid NGW URL entered or CORS not configured to get request from ${location.origin}`;
|
|
1173
|
+
}
|
|
1174
|
+
}
|
|
1175
|
+
|
|
1176
|
+
var __defProp$a = Object.defineProperty;
|
|
1177
|
+
var __defNormalProp$a = (obj, key, value) => key in obj ? __defProp$a(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
1178
|
+
var __publicField$6 = (obj, key, value) => __defNormalProp$a(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
1179
|
+
class ResourceNotFoundError extends NgwError {
|
|
1180
|
+
constructor(obj) {
|
|
1181
|
+
super(obj);
|
|
1182
|
+
__publicField$6(this, "name", "ResourceNotFoundError");
|
|
1183
|
+
__publicField$6(this, "exception", "nextgisweb.resource.exception.ResourceNotFound");
|
|
1184
|
+
Object.setPrototypeOf(this, ResourceNotFoundError.prototype);
|
|
1185
|
+
}
|
|
1186
|
+
}
|
|
1187
|
+
|
|
1112
1188
|
var errors = /*#__PURE__*/Object.freeze({
|
|
1113
1189
|
__proto__: null,
|
|
1114
1190
|
AbortError: AbortError,
|
|
@@ -1121,9 +1197,9 @@ var Geocoder = (function (exports) {
|
|
|
1121
1197
|
isError: isError
|
|
1122
1198
|
});
|
|
1123
1199
|
|
|
1124
|
-
var __defProp$
|
|
1125
|
-
var __defNormalProp$
|
|
1126
|
-
var __publicField$5 = (obj, key, value) => __defNormalProp$
|
|
1200
|
+
var __defProp$9 = Object.defineProperty;
|
|
1201
|
+
var __defNormalProp$9 = (obj, key, value) => key in obj ? __defProp$9(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
1202
|
+
var __publicField$5 = (obj, key, value) => __defNormalProp$9(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
1127
1203
|
class BaseAPIError extends Error {
|
|
1128
1204
|
constructor(message) {
|
|
1129
1205
|
super(message || "Something went wrong.");
|
|
@@ -1180,40 +1256,40 @@ var Geocoder = (function (exports) {
|
|
|
1180
1256
|
}
|
|
1181
1257
|
}
|
|
1182
1258
|
class LunkwillRequestFailed extends LunkwillError {
|
|
1183
|
-
constructor(data) {
|
|
1184
|
-
super(void 0, data);
|
|
1185
|
-
}
|
|
1186
|
-
}
|
|
1187
|
-
|
|
1188
|
-
var __defProp$
|
|
1189
|
-
var __getOwnPropSymbols$
|
|
1190
|
-
var __hasOwnProp$
|
|
1191
|
-
var __propIsEnum$
|
|
1192
|
-
var __defNormalProp$
|
|
1193
|
-
var __spreadValues$
|
|
1259
|
+
constructor(data) {
|
|
1260
|
+
super(void 0, data);
|
|
1261
|
+
}
|
|
1262
|
+
}
|
|
1263
|
+
|
|
1264
|
+
var __defProp$8 = Object.defineProperty;
|
|
1265
|
+
var __getOwnPropSymbols$6 = Object.getOwnPropertySymbols;
|
|
1266
|
+
var __hasOwnProp$6 = Object.prototype.hasOwnProperty;
|
|
1267
|
+
var __propIsEnum$6 = Object.prototype.propertyIsEnumerable;
|
|
1268
|
+
var __defNormalProp$8 = (obj, key, value) => key in obj ? __defProp$8(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
1269
|
+
var __spreadValues$6 = (a, b) => {
|
|
1194
1270
|
for (var prop in b || (b = {}))
|
|
1195
|
-
if (__hasOwnProp$
|
|
1196
|
-
__defNormalProp$
|
|
1197
|
-
if (__getOwnPropSymbols$
|
|
1198
|
-
for (var prop of __getOwnPropSymbols$
|
|
1199
|
-
if (__propIsEnum$
|
|
1200
|
-
__defNormalProp$
|
|
1271
|
+
if (__hasOwnProp$6.call(b, prop))
|
|
1272
|
+
__defNormalProp$8(a, prop, b[prop]);
|
|
1273
|
+
if (__getOwnPropSymbols$6)
|
|
1274
|
+
for (var prop of __getOwnPropSymbols$6(b)) {
|
|
1275
|
+
if (__propIsEnum$6.call(b, prop))
|
|
1276
|
+
__defNormalProp$8(a, prop, b[prop]);
|
|
1201
1277
|
}
|
|
1202
1278
|
return a;
|
|
1203
1279
|
};
|
|
1204
1280
|
var __objRest$2 = (source, exclude) => {
|
|
1205
1281
|
var target = {};
|
|
1206
1282
|
for (var prop in source)
|
|
1207
|
-
if (__hasOwnProp$
|
|
1283
|
+
if (__hasOwnProp$6.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
1208
1284
|
target[prop] = source[prop];
|
|
1209
|
-
if (source != null && __getOwnPropSymbols$
|
|
1210
|
-
for (var prop of __getOwnPropSymbols$
|
|
1211
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
|
1285
|
+
if (source != null && __getOwnPropSymbols$6)
|
|
1286
|
+
for (var prop of __getOwnPropSymbols$6(source)) {
|
|
1287
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$6.call(source, prop))
|
|
1212
1288
|
target[prop] = source[prop];
|
|
1213
1289
|
}
|
|
1214
1290
|
return target;
|
|
1215
1291
|
};
|
|
1216
|
-
var __async$
|
|
1292
|
+
var __async$5 = (__this, __arguments, generator) => {
|
|
1217
1293
|
return new Promise((resolve, reject) => {
|
|
1218
1294
|
var fulfilled = (value) => {
|
|
1219
1295
|
try {
|
|
@@ -1238,7 +1314,7 @@ var Geocoder = (function (exports) {
|
|
|
1238
1314
|
return ct !== void 0 && ct !== null && ct.includes("application/vnd.lunkwill.request-summary+json");
|
|
1239
1315
|
}
|
|
1240
1316
|
function responseJson(response) {
|
|
1241
|
-
return __async$
|
|
1317
|
+
return __async$5(this, null, function* () {
|
|
1242
1318
|
try {
|
|
1243
1319
|
return response.json();
|
|
1244
1320
|
} catch (e) {
|
|
@@ -1247,7 +1323,7 @@ var Geocoder = (function (exports) {
|
|
|
1247
1323
|
});
|
|
1248
1324
|
}
|
|
1249
1325
|
function lunkwillResponseUrl(lwResp) {
|
|
1250
|
-
return __async$
|
|
1326
|
+
return __async$5(this, null, function* () {
|
|
1251
1327
|
const lwData = yield responseJson(lwResp);
|
|
1252
1328
|
let delay = lwData.delay_ms;
|
|
1253
1329
|
const retry = lwData.retry_ms !== void 0 ? lwData.retry_ms : 2e3;
|
|
@@ -1291,7 +1367,7 @@ var Geocoder = (function (exports) {
|
|
|
1291
1367
|
});
|
|
1292
1368
|
}
|
|
1293
1369
|
function lunkwillFetch(lwRespUrl) {
|
|
1294
|
-
return __async$
|
|
1370
|
+
return __async$5(this, null, function* () {
|
|
1295
1371
|
try {
|
|
1296
1372
|
return yield window.fetch(lwRespUrl, { credentials: "same-origin" });
|
|
1297
1373
|
} catch (e) {
|
|
@@ -1339,14 +1415,14 @@ var Geocoder = (function (exports) {
|
|
|
1339
1415
|
return path + urlParams;
|
|
1340
1416
|
}
|
|
1341
1417
|
function request(path, options, cacheEngine) {
|
|
1342
|
-
return __async$
|
|
1418
|
+
return __async$5(this, null, function* () {
|
|
1343
1419
|
var _b;
|
|
1344
1420
|
const defaults = {
|
|
1345
1421
|
method: "GET",
|
|
1346
1422
|
credentials: "same-origin",
|
|
1347
1423
|
headers: {}
|
|
1348
1424
|
};
|
|
1349
|
-
const _a = __spreadValues$
|
|
1425
|
+
const _a = __spreadValues$6(__spreadValues$6({}, defaults), options), {
|
|
1350
1426
|
withCredentials,
|
|
1351
1427
|
responseType,
|
|
1352
1428
|
cacheProps,
|
|
@@ -1382,7 +1458,7 @@ var Geocoder = (function (exports) {
|
|
|
1382
1458
|
opt.headers = headers;
|
|
1383
1459
|
}
|
|
1384
1460
|
const url = generateUrl(path, query);
|
|
1385
|
-
const makeRequest = () => __async$
|
|
1461
|
+
const makeRequest = () => __async$5(this, null, function* () {
|
|
1386
1462
|
let response;
|
|
1387
1463
|
try {
|
|
1388
1464
|
response = yield fetch(url, opt);
|
|
@@ -1422,8 +1498,8 @@ var Geocoder = (function (exports) {
|
|
|
1422
1498
|
}
|
|
1423
1499
|
return body;
|
|
1424
1500
|
});
|
|
1425
|
-
if (cacheEngine && ((_b = opt.method) == null ? void 0 : _b.toUpperCase()) === "GET") {
|
|
1426
|
-
const props = cacheProps ? cacheProps : __spreadValues$
|
|
1501
|
+
if (cacheEngine && cache !== false && ((_b = opt.method) == null ? void 0 : _b.toUpperCase()) === "GET") {
|
|
1502
|
+
const props = cacheProps ? cacheProps : __spreadValues$6({}, objectRemoveEmpty({
|
|
1427
1503
|
withCredentials,
|
|
1428
1504
|
responseType
|
|
1429
1505
|
}));
|
|
@@ -1436,21 +1512,21 @@ var Geocoder = (function (exports) {
|
|
|
1436
1512
|
});
|
|
1437
1513
|
}
|
|
1438
1514
|
|
|
1439
|
-
var __defProp$
|
|
1515
|
+
var __defProp$7 = Object.defineProperty;
|
|
1440
1516
|
var __defProps$4 = Object.defineProperties;
|
|
1441
1517
|
var __getOwnPropDescs$4 = Object.getOwnPropertyDescriptors;
|
|
1442
|
-
var __getOwnPropSymbols$
|
|
1443
|
-
var __hasOwnProp$
|
|
1444
|
-
var __propIsEnum$
|
|
1445
|
-
var __defNormalProp$
|
|
1446
|
-
var __spreadValues$
|
|
1518
|
+
var __getOwnPropSymbols$5 = Object.getOwnPropertySymbols;
|
|
1519
|
+
var __hasOwnProp$5 = Object.prototype.hasOwnProperty;
|
|
1520
|
+
var __propIsEnum$5 = Object.prototype.propertyIsEnumerable;
|
|
1521
|
+
var __defNormalProp$7 = (obj, key, value) => key in obj ? __defProp$7(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
1522
|
+
var __spreadValues$5 = (a, b) => {
|
|
1447
1523
|
for (var prop in b || (b = {}))
|
|
1448
|
-
if (__hasOwnProp$
|
|
1449
|
-
__defNormalProp$
|
|
1450
|
-
if (__getOwnPropSymbols$
|
|
1451
|
-
for (var prop of __getOwnPropSymbols$
|
|
1452
|
-
if (__propIsEnum$
|
|
1453
|
-
__defNormalProp$
|
|
1524
|
+
if (__hasOwnProp$5.call(b, prop))
|
|
1525
|
+
__defNormalProp$7(a, prop, b[prop]);
|
|
1526
|
+
if (__getOwnPropSymbols$5)
|
|
1527
|
+
for (var prop of __getOwnPropSymbols$5(b)) {
|
|
1528
|
+
if (__propIsEnum$5.call(b, prop))
|
|
1529
|
+
__defNormalProp$7(a, prop, b[prop]);
|
|
1454
1530
|
}
|
|
1455
1531
|
return a;
|
|
1456
1532
|
};
|
|
@@ -1458,16 +1534,16 @@ var Geocoder = (function (exports) {
|
|
|
1458
1534
|
var __objRest$1 = (source, exclude) => {
|
|
1459
1535
|
var target = {};
|
|
1460
1536
|
for (var prop in source)
|
|
1461
|
-
if (__hasOwnProp$
|
|
1537
|
+
if (__hasOwnProp$5.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
1462
1538
|
target[prop] = source[prop];
|
|
1463
|
-
if (source != null && __getOwnPropSymbols$
|
|
1464
|
-
for (var prop of __getOwnPropSymbols$
|
|
1465
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
|
1539
|
+
if (source != null && __getOwnPropSymbols$5)
|
|
1540
|
+
for (var prop of __getOwnPropSymbols$5(source)) {
|
|
1541
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$5.call(source, prop))
|
|
1466
1542
|
target[prop] = source[prop];
|
|
1467
1543
|
}
|
|
1468
1544
|
return target;
|
|
1469
1545
|
};
|
|
1470
|
-
var __async$
|
|
1546
|
+
var __async$4 = (__this, __arguments, generator) => {
|
|
1471
1547
|
return new Promise((resolve, reject) => {
|
|
1472
1548
|
var fulfilled = (value) => {
|
|
1473
1549
|
try {
|
|
@@ -1518,7 +1594,7 @@ var Geocoder = (function (exports) {
|
|
|
1518
1594
|
}
|
|
1519
1595
|
function route(name, connector, ...rest) {
|
|
1520
1596
|
const result = {
|
|
1521
|
-
url: (opt) => __async$
|
|
1597
|
+
url: (opt) => __async$4(this, null, function* () {
|
|
1522
1598
|
var _a;
|
|
1523
1599
|
const routeData = yield connector.connect();
|
|
1524
1600
|
const template = routeURL(
|
|
@@ -1532,27 +1608,32 @@ var Geocoder = (function (exports) {
|
|
|
1532
1608
|
};
|
|
1533
1609
|
const methods = ["get", "post", "put", "delete", "patch"];
|
|
1534
1610
|
for (const method of methods) {
|
|
1535
|
-
const methodResp = (requestOptions) =>
|
|
1611
|
+
const methodResp = (requestOptions) => {
|
|
1536
1612
|
var _b;
|
|
1537
1613
|
const _a = requestOptions || {}, { headers: optHeaders } = _a, restOpt = __objRest$1(_a, ["headers"]);
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1614
|
+
if ((_b = requestOptions == null ? void 0 : requestOptions.signal) == null ? void 0 : _b.aborted) {
|
|
1615
|
+
throw new AbortError();
|
|
1616
|
+
}
|
|
1617
|
+
return connector.connect().then((routeData) => {
|
|
1618
|
+
var _a2;
|
|
1619
|
+
const template = routeURL(
|
|
1620
|
+
name,
|
|
1621
|
+
(_a2 = connector.options.baseUrl) != null ? _a2 : "",
|
|
1622
|
+
routeData,
|
|
1623
|
+
...rest
|
|
1624
|
+
);
|
|
1625
|
+
const headers = objectRemoveEmpty(__spreadValues$5(__spreadValues$5({}, connector.getAuthorizationHeaders()), optHeaders != null ? optHeaders : {}));
|
|
1626
|
+
return request(
|
|
1627
|
+
template,
|
|
1628
|
+
__spreadProps$4(__spreadValues$5({
|
|
1629
|
+
headers
|
|
1630
|
+
}, restOpt), {
|
|
1631
|
+
method
|
|
1632
|
+
}),
|
|
1633
|
+
connector.cache
|
|
1634
|
+
);
|
|
1635
|
+
});
|
|
1636
|
+
};
|
|
1556
1637
|
result[method] = methodResp;
|
|
1557
1638
|
}
|
|
1558
1639
|
return result;
|
|
@@ -1574,7 +1655,7 @@ var Geocoder = (function (exports) {
|
|
|
1574
1655
|
const getResponseText = () => {
|
|
1575
1656
|
try {
|
|
1576
1657
|
return JSON.parse(xhr.responseText);
|
|
1577
|
-
} catch (
|
|
1658
|
+
} catch (e) {
|
|
1578
1659
|
return xhr.responseText;
|
|
1579
1660
|
}
|
|
1580
1661
|
};
|
|
@@ -1644,34 +1725,45 @@ var Geocoder = (function (exports) {
|
|
|
1644
1725
|
};
|
|
1645
1726
|
}
|
|
1646
1727
|
|
|
1647
|
-
const
|
|
1648
|
-
function
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1728
|
+
const CONNECTORS = [];
|
|
1729
|
+
function addConnector(connector) {
|
|
1730
|
+
CONNECTORS.push(connector);
|
|
1731
|
+
}
|
|
1732
|
+
function findConnector(options) {
|
|
1733
|
+
return CONNECTORS.find((x) => {
|
|
1734
|
+
if (x.options.baseUrl === options.baseUrl) {
|
|
1735
|
+
if (options.auth) {
|
|
1736
|
+
if (x.options.auth) {
|
|
1737
|
+
return objectDeepEqual(x.options.auth, options.auth);
|
|
1738
|
+
}
|
|
1739
|
+
} else {
|
|
1740
|
+
return true;
|
|
1741
|
+
}
|
|
1655
1742
|
}
|
|
1656
|
-
return value;
|
|
1657
1743
|
});
|
|
1658
1744
|
}
|
|
1745
|
+
function removeConnector(connector) {
|
|
1746
|
+
const index = CONNECTORS.indexOf(connector);
|
|
1747
|
+
if (index !== -1) {
|
|
1748
|
+
CONNECTORS.splice(index, 1);
|
|
1749
|
+
}
|
|
1750
|
+
}
|
|
1659
1751
|
|
|
1660
|
-
var __defProp$
|
|
1752
|
+
var __defProp$6 = Object.defineProperty;
|
|
1661
1753
|
var __defProps$3 = Object.defineProperties;
|
|
1662
1754
|
var __getOwnPropDescs$3 = Object.getOwnPropertyDescriptors;
|
|
1663
|
-
var __getOwnPropSymbols$
|
|
1664
|
-
var __hasOwnProp$
|
|
1665
|
-
var __propIsEnum$
|
|
1666
|
-
var __defNormalProp$
|
|
1667
|
-
var __spreadValues$
|
|
1755
|
+
var __getOwnPropSymbols$4 = Object.getOwnPropertySymbols;
|
|
1756
|
+
var __hasOwnProp$4 = Object.prototype.hasOwnProperty;
|
|
1757
|
+
var __propIsEnum$4 = Object.prototype.propertyIsEnumerable;
|
|
1758
|
+
var __defNormalProp$6 = (obj, key, value) => key in obj ? __defProp$6(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
1759
|
+
var __spreadValues$4 = (a, b) => {
|
|
1668
1760
|
for (var prop in b || (b = {}))
|
|
1669
|
-
if (__hasOwnProp$
|
|
1670
|
-
__defNormalProp$
|
|
1671
|
-
if (__getOwnPropSymbols$
|
|
1672
|
-
for (var prop of __getOwnPropSymbols$
|
|
1673
|
-
if (__propIsEnum$
|
|
1674
|
-
__defNormalProp$
|
|
1761
|
+
if (__hasOwnProp$4.call(b, prop))
|
|
1762
|
+
__defNormalProp$6(a, prop, b[prop]);
|
|
1763
|
+
if (__getOwnPropSymbols$4)
|
|
1764
|
+
for (var prop of __getOwnPropSymbols$4(b)) {
|
|
1765
|
+
if (__propIsEnum$4.call(b, prop))
|
|
1766
|
+
__defNormalProp$6(a, prop, b[prop]);
|
|
1675
1767
|
}
|
|
1676
1768
|
return a;
|
|
1677
1769
|
};
|
|
@@ -1679,17 +1771,17 @@ var Geocoder = (function (exports) {
|
|
|
1679
1771
|
var __objRest = (source, exclude) => {
|
|
1680
1772
|
var target = {};
|
|
1681
1773
|
for (var prop in source)
|
|
1682
|
-
if (__hasOwnProp$
|
|
1774
|
+
if (__hasOwnProp$4.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
1683
1775
|
target[prop] = source[prop];
|
|
1684
|
-
if (source != null && __getOwnPropSymbols$
|
|
1685
|
-
for (var prop of __getOwnPropSymbols$
|
|
1686
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
|
1776
|
+
if (source != null && __getOwnPropSymbols$4)
|
|
1777
|
+
for (var prop of __getOwnPropSymbols$4(source)) {
|
|
1778
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$4.call(source, prop))
|
|
1687
1779
|
target[prop] = source[prop];
|
|
1688
1780
|
}
|
|
1689
1781
|
return target;
|
|
1690
1782
|
};
|
|
1691
|
-
var __publicField$4 = (obj, key, value) => __defNormalProp$
|
|
1692
|
-
var __async$
|
|
1783
|
+
var __publicField$4 = (obj, key, value) => __defNormalProp$6(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
1784
|
+
var __async$3 = (__this, __arguments, generator) => {
|
|
1693
1785
|
return new Promise((resolve, reject) => {
|
|
1694
1786
|
var fulfilled = (value) => {
|
|
1695
1787
|
try {
|
|
@@ -1774,7 +1866,9 @@ var Geocoder = (function (exports) {
|
|
|
1774
1866
|
* ```
|
|
1775
1867
|
*/
|
|
1776
1868
|
connect() {
|
|
1777
|
-
return __async$
|
|
1869
|
+
return __async$3(this, arguments, function* ({
|
|
1870
|
+
signal
|
|
1871
|
+
} = {}) {
|
|
1778
1872
|
const auth = this.options.auth;
|
|
1779
1873
|
if (auth) {
|
|
1780
1874
|
const { login, password } = auth;
|
|
@@ -1783,11 +1877,12 @@ var Geocoder = (function (exports) {
|
|
|
1783
1877
|
}
|
|
1784
1878
|
}
|
|
1785
1879
|
const routeUrl = `${this.routeStr}?client=${this.client}`;
|
|
1786
|
-
return
|
|
1880
|
+
return this.makeQuery(
|
|
1787
1881
|
routeUrl,
|
|
1788
1882
|
{},
|
|
1789
1883
|
{
|
|
1790
1884
|
cacheName: "route",
|
|
1885
|
+
signal,
|
|
1791
1886
|
cache: true,
|
|
1792
1887
|
cacheProps: {
|
|
1793
1888
|
id: this.id,
|
|
@@ -1819,14 +1914,14 @@ var Geocoder = (function (exports) {
|
|
|
1819
1914
|
this.emitter.emit("logout");
|
|
1820
1915
|
}
|
|
1821
1916
|
getUserInfo(credentials, options) {
|
|
1822
|
-
return __async$
|
|
1917
|
+
return __async$3(this, null, function* () {
|
|
1823
1918
|
if (this.user && this.user.id) {
|
|
1824
1919
|
return this.user;
|
|
1825
1920
|
}
|
|
1826
1921
|
if (credentials) {
|
|
1827
1922
|
this.options.auth = credentials;
|
|
1828
1923
|
}
|
|
1829
|
-
const options_ = __spreadValues$
|
|
1924
|
+
const options_ = __spreadValues$4({
|
|
1830
1925
|
headers: this.getAuthorizationHeaders(credentials),
|
|
1831
1926
|
cache: true
|
|
1832
1927
|
}, options);
|
|
@@ -1867,7 +1962,7 @@ var Geocoder = (function (exports) {
|
|
|
1867
1962
|
this.activeRequests = {};
|
|
1868
1963
|
}
|
|
1869
1964
|
getActiveApiRequests() {
|
|
1870
|
-
return __spreadValues$
|
|
1965
|
+
return __spreadValues$4({}, this.activeRequests);
|
|
1871
1966
|
}
|
|
1872
1967
|
route(name, ...rest) {
|
|
1873
1968
|
return route(name, this, ...rest);
|
|
@@ -1879,7 +1974,7 @@ var Geocoder = (function (exports) {
|
|
|
1879
1974
|
* @param options - Request options
|
|
1880
1975
|
*/
|
|
1881
1976
|
makeQuery(_0, _1) {
|
|
1882
|
-
return __async$
|
|
1977
|
+
return __async$3(this, arguments, function* (url, params, options = {}) {
|
|
1883
1978
|
var _b;
|
|
1884
1979
|
url = (this.options.baseUrl ? this.options.baseUrl : "") + url;
|
|
1885
1980
|
if (!url) {
|
|
@@ -1890,7 +1985,7 @@ var Geocoder = (function (exports) {
|
|
|
1890
1985
|
url = template(url, restParams);
|
|
1891
1986
|
}
|
|
1892
1987
|
url = encodeURI(fixUrlStr(url));
|
|
1893
|
-
options = __spreadValues$
|
|
1988
|
+
options = __spreadValues$4({ withCredentials: this.withCredentials }, options);
|
|
1894
1989
|
const {
|
|
1895
1990
|
cache,
|
|
1896
1991
|
signal: externalSignal,
|
|
@@ -1912,7 +2007,7 @@ var Geocoder = (function (exports) {
|
|
|
1912
2007
|
});
|
|
1913
2008
|
}
|
|
1914
2009
|
options.signal = internalSignal;
|
|
1915
|
-
const createPromise = () => __async$
|
|
2010
|
+
const createPromise = () => __async$3(this, null, function* () {
|
|
1916
2011
|
const id = REQUEST_ID++;
|
|
1917
2012
|
this.activeRequests[id] = internalAbortController;
|
|
1918
2013
|
try {
|
|
@@ -1922,7 +2017,7 @@ var Geocoder = (function (exports) {
|
|
|
1922
2017
|
}
|
|
1923
2018
|
});
|
|
1924
2019
|
if (method === "GET") {
|
|
1925
|
-
const cacheOptions = cacheProps ? cacheProps : __spreadProps$3(__spreadValues$
|
|
2020
|
+
const cacheOptions = cacheProps ? cacheProps : __spreadProps$3(__spreadValues$4({}, objectRemoveEmpty({
|
|
1926
2021
|
headers,
|
|
1927
2022
|
withCredentials,
|
|
1928
2023
|
responseType,
|
|
@@ -1945,7 +2040,7 @@ var Geocoder = (function (exports) {
|
|
|
1945
2040
|
var _a;
|
|
1946
2041
|
if (this.user) {
|
|
1947
2042
|
options = options || {};
|
|
1948
|
-
options.headers = __spreadValues$
|
|
2043
|
+
options.headers = __spreadValues$4(__spreadValues$4({}, this.getAuthorizationHeaders()), options.headers);
|
|
1949
2044
|
}
|
|
1950
2045
|
if (this.requestTransform) {
|
|
1951
2046
|
const [transUrl, transOptions] = this.requestTransform(url, options);
|
|
@@ -1976,7 +2071,7 @@ var Geocoder = (function (exports) {
|
|
|
1976
2071
|
});
|
|
1977
2072
|
}
|
|
1978
2073
|
_login(credentials, options) {
|
|
1979
|
-
return __async$
|
|
2074
|
+
return __async$3(this, null, function* () {
|
|
1980
2075
|
try {
|
|
1981
2076
|
const data = yield this.getUserInfo(credentials, options);
|
|
1982
2077
|
this.user = data;
|
|
@@ -2034,27 +2129,27 @@ var Geocoder = (function (exports) {
|
|
|
2034
2129
|
return query;
|
|
2035
2130
|
}
|
|
2036
2131
|
|
|
2037
|
-
var __defProp$
|
|
2132
|
+
var __defProp$5 = Object.defineProperty;
|
|
2038
2133
|
var __defProps$2 = Object.defineProperties;
|
|
2039
2134
|
var __getOwnPropDescs$2 = Object.getOwnPropertyDescriptors;
|
|
2040
|
-
var __getOwnPropSymbols$
|
|
2041
|
-
var __hasOwnProp$
|
|
2042
|
-
var __propIsEnum$
|
|
2043
|
-
var __defNormalProp$
|
|
2044
|
-
var __spreadValues$
|
|
2135
|
+
var __getOwnPropSymbols$3 = Object.getOwnPropertySymbols;
|
|
2136
|
+
var __hasOwnProp$3 = Object.prototype.hasOwnProperty;
|
|
2137
|
+
var __propIsEnum$3 = Object.prototype.propertyIsEnumerable;
|
|
2138
|
+
var __defNormalProp$5 = (obj, key, value) => key in obj ? __defProp$5(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
2139
|
+
var __spreadValues$3 = (a, b) => {
|
|
2045
2140
|
for (var prop in b || (b = {}))
|
|
2046
|
-
if (__hasOwnProp$
|
|
2047
|
-
__defNormalProp$
|
|
2048
|
-
if (__getOwnPropSymbols$
|
|
2049
|
-
for (var prop of __getOwnPropSymbols$
|
|
2050
|
-
if (__propIsEnum$
|
|
2051
|
-
__defNormalProp$
|
|
2141
|
+
if (__hasOwnProp$3.call(b, prop))
|
|
2142
|
+
__defNormalProp$5(a, prop, b[prop]);
|
|
2143
|
+
if (__getOwnPropSymbols$3)
|
|
2144
|
+
for (var prop of __getOwnPropSymbols$3(b)) {
|
|
2145
|
+
if (__propIsEnum$3.call(b, prop))
|
|
2146
|
+
__defNormalProp$5(a, prop, b[prop]);
|
|
2052
2147
|
}
|
|
2053
2148
|
return a;
|
|
2054
2149
|
};
|
|
2055
2150
|
var __spreadProps$2 = (a, b) => __defProps$2(a, __getOwnPropDescs$2(b));
|
|
2056
|
-
var __publicField$3 = (obj, key, value) => __defNormalProp$
|
|
2057
|
-
var __async$
|
|
2151
|
+
var __publicField$3 = (obj, key, value) => __defNormalProp$5(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
2152
|
+
var __async$2 = (__this, __arguments, generator) => {
|
|
2058
2153
|
return new Promise((resolve, reject) => {
|
|
2059
2154
|
var fulfilled = (value) => {
|
|
2060
2155
|
try {
|
|
@@ -2095,7 +2190,7 @@ var Geocoder = (function (exports) {
|
|
|
2095
2190
|
* Fetching resource would be cached to speed up next call
|
|
2096
2191
|
*/
|
|
2097
2192
|
getOne(resource, requestOptions) {
|
|
2098
|
-
const opt = __spreadValues$
|
|
2193
|
+
const opt = __spreadValues$3({}, requestOptions);
|
|
2099
2194
|
if (typeof resource === "string") ; else if (typeof resource === "number") ; else if (isObject(resource)) {
|
|
2100
2195
|
if (resource.id !== void 0) {
|
|
2101
2196
|
resource.id;
|
|
@@ -2172,8 +2267,8 @@ var Geocoder = (function (exports) {
|
|
|
2172
2267
|
} else {
|
|
2173
2268
|
Object.assign(query, resourceToQuery(resource));
|
|
2174
2269
|
}
|
|
2175
|
-
return this.connector.route("resource.search").get(__spreadProps$2(__spreadValues$
|
|
2176
|
-
query: __spreadValues$
|
|
2270
|
+
return this.connector.route("resource.search").get(__spreadProps$2(__spreadValues$3({}, requestOptions), {
|
|
2271
|
+
query: __spreadValues$3({
|
|
2177
2272
|
serialization: "full"
|
|
2178
2273
|
}, query)
|
|
2179
2274
|
})).then((resources) => {
|
|
@@ -2226,7 +2321,7 @@ var Geocoder = (function (exports) {
|
|
|
2226
2321
|
});
|
|
2227
2322
|
}
|
|
2228
2323
|
_getChildrenOf(_0, _1) {
|
|
2229
|
-
return __async$
|
|
2324
|
+
return __async$2(this, arguments, function* (parentDef, requestOptions, _items = []) {
|
|
2230
2325
|
let parent = void 0;
|
|
2231
2326
|
if (typeof parentDef === "string") {
|
|
2232
2327
|
parent = yield this.getId(parentDef, requestOptions);
|
|
@@ -2235,7 +2330,7 @@ var Geocoder = (function (exports) {
|
|
|
2235
2330
|
} else {
|
|
2236
2331
|
parent = parentDef;
|
|
2237
2332
|
}
|
|
2238
|
-
const items = yield this.connector.route("resource.collection").get(__spreadProps$2(__spreadValues$
|
|
2333
|
+
const items = yield this.connector.route("resource.collection").get(__spreadProps$2(__spreadValues$3({}, requestOptions), {
|
|
2239
2334
|
query: {
|
|
2240
2335
|
parent
|
|
2241
2336
|
}
|
|
@@ -2263,7 +2358,7 @@ var Geocoder = (function (exports) {
|
|
|
2263
2358
|
});
|
|
2264
2359
|
}
|
|
2265
2360
|
_cleanResourceItemCache(id) {
|
|
2266
|
-
return __async$
|
|
2361
|
+
return __async$2(this, null, function* () {
|
|
2267
2362
|
var _a;
|
|
2268
2363
|
const all = this.cache.all();
|
|
2269
2364
|
const toDelete = [];
|
|
@@ -2316,93 +2411,6 @@ var Geocoder = (function (exports) {
|
|
|
2316
2411
|
}
|
|
2317
2412
|
}
|
|
2318
2413
|
|
|
2319
|
-
var __defProp$5 = Object.defineProperty;
|
|
2320
|
-
var __getOwnPropSymbols$3 = Object.getOwnPropertySymbols;
|
|
2321
|
-
var __hasOwnProp$3 = Object.prototype.hasOwnProperty;
|
|
2322
|
-
var __propIsEnum$3 = Object.prototype.propertyIsEnumerable;
|
|
2323
|
-
var __defNormalProp$5 = (obj, key, value) => key in obj ? __defProp$5(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
2324
|
-
var __spreadValues$3 = (a, b) => {
|
|
2325
|
-
for (var prop in b || (b = {}))
|
|
2326
|
-
if (__hasOwnProp$3.call(b, prop))
|
|
2327
|
-
__defNormalProp$5(a, prop, b[prop]);
|
|
2328
|
-
if (__getOwnPropSymbols$3)
|
|
2329
|
-
for (var prop of __getOwnPropSymbols$3(b)) {
|
|
2330
|
-
if (__propIsEnum$3.call(b, prop))
|
|
2331
|
-
__defNormalProp$5(a, prop, b[prop]);
|
|
2332
|
-
}
|
|
2333
|
-
return a;
|
|
2334
|
-
};
|
|
2335
|
-
var __async$2 = (__this, __arguments, generator) => {
|
|
2336
|
-
return new Promise((resolve, reject) => {
|
|
2337
|
-
var fulfilled = (value) => {
|
|
2338
|
-
try {
|
|
2339
|
-
step(generator.next(value));
|
|
2340
|
-
} catch (e) {
|
|
2341
|
-
reject(e);
|
|
2342
|
-
}
|
|
2343
|
-
};
|
|
2344
|
-
var rejected = (value) => {
|
|
2345
|
-
try {
|
|
2346
|
-
step(generator.throw(value));
|
|
2347
|
-
} catch (e) {
|
|
2348
|
-
reject(e);
|
|
2349
|
-
}
|
|
2350
|
-
};
|
|
2351
|
-
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
2352
|
-
step((generator = generator.apply(__this, __arguments)).next());
|
|
2353
|
-
});
|
|
2354
|
-
};
|
|
2355
|
-
function apiRequest(opt) {
|
|
2356
|
-
return __async$2(this, null, function* () {
|
|
2357
|
-
const { params, name, connector, requestOptions } = opt;
|
|
2358
|
-
const apiItems = yield connector.connect();
|
|
2359
|
-
let apiItem = apiItems && apiItems[name];
|
|
2360
|
-
if (apiItem) {
|
|
2361
|
-
apiItem = [...apiItem];
|
|
2362
|
-
let url = apiItem.shift();
|
|
2363
|
-
if (apiItem.length) {
|
|
2364
|
-
const replaceParams = {};
|
|
2365
|
-
for (let fry = 0; fry < apiItem.length; fry++) {
|
|
2366
|
-
const arg = apiItem[fry];
|
|
2367
|
-
replaceParams[fry] = `{${arg}}`;
|
|
2368
|
-
if (params[arg] === void 0) {
|
|
2369
|
-
throw new Error(`\`${arg}\` URL API argument is not specified`);
|
|
2370
|
-
}
|
|
2371
|
-
}
|
|
2372
|
-
if (url) {
|
|
2373
|
-
url = template(url, replaceParams);
|
|
2374
|
-
}
|
|
2375
|
-
}
|
|
2376
|
-
if (params) {
|
|
2377
|
-
const paramArray = [];
|
|
2378
|
-
const paramList = params.paramList;
|
|
2379
|
-
if (Array.isArray(paramList)) {
|
|
2380
|
-
paramList.forEach(([key, value]) => {
|
|
2381
|
-
paramArray.push(`${key}=${value}`);
|
|
2382
|
-
});
|
|
2383
|
-
}
|
|
2384
|
-
for (const p in params) {
|
|
2385
|
-
if (apiItem.indexOf(p) === -1) {
|
|
2386
|
-
paramArray.push(`${p}=${params[p]}`);
|
|
2387
|
-
}
|
|
2388
|
-
}
|
|
2389
|
-
if (paramArray.length) {
|
|
2390
|
-
url = `${url}?${paramArray.join("&")}`;
|
|
2391
|
-
}
|
|
2392
|
-
}
|
|
2393
|
-
if (url) {
|
|
2394
|
-
return connector.makeQuery(url, params, __spreadValues$3({
|
|
2395
|
-
cacheName: name
|
|
2396
|
-
}, requestOptions));
|
|
2397
|
-
} else {
|
|
2398
|
-
throw new Error("Request URL is not set");
|
|
2399
|
-
}
|
|
2400
|
-
} else {
|
|
2401
|
-
return void 0;
|
|
2402
|
-
}
|
|
2403
|
-
});
|
|
2404
|
-
}
|
|
2405
|
-
|
|
2406
2414
|
var __defProp$4 = Object.defineProperty;
|
|
2407
2415
|
var __defNormalProp$4 = (obj, key, value) => key in obj ? __defProp$4(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
2408
2416
|
var __publicField$2 = (obj, key, value) => __defNormalProp$4(obj, key + "" , value);
|