@mapvx/web-js 1.5.0 → 1.6.0-dev.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/dist/cjs/domain/models/place.js.map +1 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/logger/logger.js +1 -1
- package/dist/cjs/logger/rollbar.js +1 -1
- package/dist/cjs/map/map.js +4 -4
- package/dist/cjs/map/map.js.map +1 -1
- package/dist/cjs/repository/repository.js +31 -14
- package/dist/cjs/repository/repository.js.map +1 -1
- package/dist/cjs/repository/requester.js +37 -5
- package/dist/cjs/repository/requester.js.map +1 -1
- package/dist/cjs/sdk.js +18 -8
- package/dist/cjs/sdk.js.map +1 -1
- package/dist/es/domain/models/place.d.ts +51 -0
- package/dist/es/domain/models/place.d.ts.map +1 -1
- package/dist/es/domain/models/place.js.map +1 -1
- package/dist/es/index.d.ts +1 -0
- package/dist/es/index.d.ts.map +1 -1
- package/dist/es/index.js.map +1 -1
- package/dist/es/logger/logger.js +1 -1
- package/dist/es/logger/rollbar.js +1 -1
- package/dist/es/map/map.js +4 -4
- package/dist/es/map/map.js.map +1 -1
- package/dist/es/repository/repository.d.ts +15 -3
- package/dist/es/repository/repository.d.ts.map +1 -1
- package/dist/es/repository/repository.js +31 -14
- package/dist/es/repository/repository.js.map +1 -1
- package/dist/es/repository/requester.d.ts +19 -5
- package/dist/es/repository/requester.d.ts.map +1 -1
- package/dist/es/repository/requester.js +37 -5
- package/dist/es/repository/requester.js.map +1 -1
- package/dist/es/sdk.d.ts +30 -7
- package/dist/es/sdk.d.ts.map +1 -1
- package/dist/es/sdk.js +18 -8
- package/dist/es/sdk.js.map +1 -1
- package/dist/umd/index.js +151 -54
- package/dist/umd/index.js.map +1 -1
- package/package.json +1 -1
package/dist/umd/index.js
CHANGED
|
@@ -6814,7 +6814,7 @@ var rollbar_umd_min_default = /*#__PURE__*/__webpack_require__.n(rollbar_umd_min
|
|
|
6814
6814
|
// version placeholder is replaced with the package version by
|
|
6815
6815
|
// scripts/inject-build-defines.js. The access token falls back to the MapVX
|
|
6816
6816
|
// SDK-web Rollbar project token when none is injected at build time.
|
|
6817
|
-
var SDK_VERSION = true ? "1.
|
|
6817
|
+
var SDK_VERSION = true ? "1.6.0-dev.1" : 0;
|
|
6818
6818
|
var ACCESS_TOKEN = false ? 0 : "28279d52df43411ebd138c2bee0ab1df";
|
|
6819
6819
|
var _rollbarConfig = {
|
|
6820
6820
|
accessToken: ACCESS_TOKEN,
|
|
@@ -6861,7 +6861,7 @@ function logger_toPrimitive(t, r) { if ("object" != logger_typeof(t) || !t) retu
|
|
|
6861
6861
|
// by scripts/inject-build-defines.js. The Countly key falls back to the
|
|
6862
6862
|
// MapVX key when none is injected at build time.
|
|
6863
6863
|
var IS_DEBUG = true ? false : 0;
|
|
6864
|
-
var logger_SDK_VERSION = true ? "1.
|
|
6864
|
+
var logger_SDK_VERSION = true ? "1.6.0-dev.1" : 0;
|
|
6865
6865
|
var COUNTLY_API_KEY = false ? 0 : "f0c8d3b96d336e857a8628f49dd1baf7d7add0e9";
|
|
6866
6866
|
var logger_countly = {
|
|
6867
6867
|
apiKey: COUNTLY_API_KEY,
|
|
@@ -10755,6 +10755,30 @@ function place_toPrimitive(t, r) { if ("object" != place_typeof(t) || !t) return
|
|
|
10755
10755
|
|
|
10756
10756
|
|
|
10757
10757
|
|
|
10758
|
+
/**
|
|
10759
|
+
* Query used to look up a single place.
|
|
10760
|
+
*
|
|
10761
|
+
* The {@link PlaceQuery.id} can be an internal alias defined by the integrator.
|
|
10762
|
+
* Because aliases are not guaranteed to be globally unique (the same alias may be
|
|
10763
|
+
* reused across different buildings/venues, e.g. the same store alias present in
|
|
10764
|
+
* several shopping malls), provide {@link PlaceQuery.buildingId} —and optionally
|
|
10765
|
+
* {@link PlaceQuery.floorId}— to disambiguate which place the alias refers to.
|
|
10766
|
+
*
|
|
10767
|
+
* This mirrors the disambiguation already available for routes via `IdLocation`.
|
|
10768
|
+
*
|
|
10769
|
+
* @example
|
|
10770
|
+
* ```typescript
|
|
10771
|
+
* // Resolve an alias reused across several malls by pinning the building.
|
|
10772
|
+
* const query: PlaceQuery = {
|
|
10773
|
+
* id: "store-204", // integrator alias, may repeat across buildings
|
|
10774
|
+
* buildingId: "mall-santiago",
|
|
10775
|
+
* floorId: "level-2", // optional; takes precedence over `level`
|
|
10776
|
+
* }
|
|
10777
|
+
* ```
|
|
10778
|
+
*
|
|
10779
|
+
* @group Places & Locations
|
|
10780
|
+
*/
|
|
10781
|
+
|
|
10758
10782
|
/**
|
|
10759
10783
|
* MapVX place object, is a custom object containing data of a specific real place.
|
|
10760
10784
|
* Represents a physical location with all its associated metadata and properties.
|
|
@@ -11625,16 +11649,23 @@ var Requester = /*#__PURE__*/function () {
|
|
|
11625
11649
|
return fetchPlacesFromAnyInstitution;
|
|
11626
11650
|
}()
|
|
11627
11651
|
/**
|
|
11628
|
-
* Obtain info about specific place. Use mainly to obtain innerFloors
|
|
11629
|
-
*
|
|
11652
|
+
* Obtain info about specific place. Use mainly to obtain innerFloors.
|
|
11653
|
+
*
|
|
11654
|
+
* When `placeId` is an internal alias that may be reused across buildings, pass
|
|
11655
|
+
* `buildingId` (and optionally `floorId`/`level`) to disambiguate which venue the
|
|
11656
|
+
* alias refers to. `floorId` takes precedence over the numeric `level`.
|
|
11630
11657
|
* @param token
|
|
11658
|
+
* @param placeId
|
|
11659
|
+
* @param buildingId (Optional) Parent building/venue that contains the place.
|
|
11660
|
+
* @param floorId (Optional) Floor ID within the building.
|
|
11661
|
+
* @param level (Optional) Numeric floor level; used only when `floorId` is absent.
|
|
11631
11662
|
* @returns
|
|
11632
11663
|
*/
|
|
11633
11664
|
)
|
|
11634
11665
|
}, {
|
|
11635
11666
|
key: "fetchPlaceDetail",
|
|
11636
11667
|
value: (function () {
|
|
11637
|
-
var _fetchPlaceDetail = requester_asyncToGenerator(/*#__PURE__*/requester_regenerator().m(function _callee8(token, placeId) {
|
|
11668
|
+
var _fetchPlaceDetail = requester_asyncToGenerator(/*#__PURE__*/requester_regenerator().m(function _callee8(token, placeId, buildingId, floorId, level) {
|
|
11638
11669
|
var options, params;
|
|
11639
11670
|
return requester_regenerator().w(function (_context8) {
|
|
11640
11671
|
while (1) switch (_context8.n) {
|
|
@@ -11650,11 +11681,19 @@ var Requester = /*#__PURE__*/function () {
|
|
|
11650
11681
|
place_id: placeId,
|
|
11651
11682
|
lang: this.lang
|
|
11652
11683
|
};
|
|
11684
|
+
if (buildingId !== undefined) {
|
|
11685
|
+
params.building = buildingId;
|
|
11686
|
+
}
|
|
11687
|
+
if (floorId !== undefined) {
|
|
11688
|
+
params.floor = floorId;
|
|
11689
|
+
} else if (level !== undefined) {
|
|
11690
|
+
params.floor = level;
|
|
11691
|
+
}
|
|
11653
11692
|
return _context8.a(2, this.fetchFromUrl(this.baseUrl + "place", params, options));
|
|
11654
11693
|
}
|
|
11655
11694
|
}, _callee8, this);
|
|
11656
11695
|
}));
|
|
11657
|
-
function fetchPlaceDetail(_x14, _x15) {
|
|
11696
|
+
function fetchPlaceDetail(_x14, _x15, _x16, _x17, _x18) {
|
|
11658
11697
|
return _fetchPlaceDetail.apply(this, arguments);
|
|
11659
11698
|
}
|
|
11660
11699
|
return fetchPlaceDetail;
|
|
@@ -11664,8 +11703,15 @@ var Requester = /*#__PURE__*/function () {
|
|
|
11664
11703
|
* Can be used to obtain any place detail, without the limitation of the ApiKey.
|
|
11665
11704
|
* Therefore, does not make use of an ApiKey but rather an authentication token.
|
|
11666
11705
|
*
|
|
11667
|
-
*
|
|
11706
|
+
* When `placeId` is an internal alias that may be reused across buildings, pass
|
|
11707
|
+
* `buildingId` (and optionally `floorId`/`level`) to disambiguate which venue the
|
|
11708
|
+
* alias refers to. `floorId` takes precedence over the numeric `level`.
|
|
11709
|
+
*
|
|
11710
|
+
* @param authToken - The authentication token used for authorization in the request header.
|
|
11668
11711
|
* @param placeId - The unique identifier of the place to retrieve details for.
|
|
11712
|
+
* @param buildingId - (Optional) Parent building/venue that contains the place.
|
|
11713
|
+
* @param floorId - (Optional) Floor ID within the building.
|
|
11714
|
+
* @param level - (Optional) Numeric floor level; used only when `floorId` is absent.
|
|
11669
11715
|
* @returns A promise that resolves to the HTTP response containing the place details.
|
|
11670
11716
|
*
|
|
11671
11717
|
*/
|
|
@@ -11673,7 +11719,7 @@ var Requester = /*#__PURE__*/function () {
|
|
|
11673
11719
|
}, {
|
|
11674
11720
|
key: "fetchAnyPlaceDetail",
|
|
11675
11721
|
value: (function () {
|
|
11676
|
-
var _fetchAnyPlaceDetail = requester_asyncToGenerator(/*#__PURE__*/requester_regenerator().m(function _callee9(authToken, placeId) {
|
|
11722
|
+
var _fetchAnyPlaceDetail = requester_asyncToGenerator(/*#__PURE__*/requester_regenerator().m(function _callee9(authToken, placeId, buildingId, floorId, level) {
|
|
11677
11723
|
var options, params;
|
|
11678
11724
|
return requester_regenerator().w(function (_context9) {
|
|
11679
11725
|
while (1) switch (_context9.n) {
|
|
@@ -11689,11 +11735,19 @@ var Requester = /*#__PURE__*/function () {
|
|
|
11689
11735
|
place_id: placeId,
|
|
11690
11736
|
lang: this.lang
|
|
11691
11737
|
};
|
|
11738
|
+
if (buildingId !== undefined) {
|
|
11739
|
+
params.building = buildingId;
|
|
11740
|
+
}
|
|
11741
|
+
if (floorId !== undefined) {
|
|
11742
|
+
params.floor = floorId;
|
|
11743
|
+
} else if (level !== undefined) {
|
|
11744
|
+
params.floor = level;
|
|
11745
|
+
}
|
|
11692
11746
|
return _context9.a(2, this.fetchFromUrl(this.baseUrlPortal + "place", params, options));
|
|
11693
11747
|
}
|
|
11694
11748
|
}, _callee9, this);
|
|
11695
11749
|
}));
|
|
11696
|
-
function fetchAnyPlaceDetail(
|
|
11750
|
+
function fetchAnyPlaceDetail(_x19, _x20, _x21, _x22, _x23) {
|
|
11697
11751
|
return _fetchAnyPlaceDetail.apply(this, arguments);
|
|
11698
11752
|
}
|
|
11699
11753
|
return fetchAnyPlaceDetail;
|
|
@@ -11728,7 +11782,7 @@ var Requester = /*#__PURE__*/function () {
|
|
|
11728
11782
|
}
|
|
11729
11783
|
}, _callee0, this);
|
|
11730
11784
|
}));
|
|
11731
|
-
function fetchSubPlaces(
|
|
11785
|
+
function fetchSubPlaces(_x24, _x25) {
|
|
11732
11786
|
return _fetchSubPlaces.apply(this, arguments);
|
|
11733
11787
|
}
|
|
11734
11788
|
return fetchSubPlaces;
|
|
@@ -11769,7 +11823,7 @@ var Requester = /*#__PURE__*/function () {
|
|
|
11769
11823
|
}
|
|
11770
11824
|
}, _callee1, this);
|
|
11771
11825
|
}));
|
|
11772
|
-
function fetchAnySubPlaces(
|
|
11826
|
+
function fetchAnySubPlaces(_x26, _x27) {
|
|
11773
11827
|
return _fetchAnySubPlaces.apply(this, arguments);
|
|
11774
11828
|
}
|
|
11775
11829
|
return fetchAnySubPlaces;
|
|
@@ -11890,7 +11944,7 @@ var Requester = /*#__PURE__*/function () {
|
|
|
11890
11944
|
}
|
|
11891
11945
|
}, _callee10, this);
|
|
11892
11946
|
}));
|
|
11893
|
-
function fetchRoute(
|
|
11947
|
+
function fetchRoute(_x28, _x29) {
|
|
11894
11948
|
return _fetchRoute.apply(this, arguments);
|
|
11895
11949
|
}
|
|
11896
11950
|
return fetchRoute;
|
|
@@ -11921,7 +11975,7 @@ var Requester = /*#__PURE__*/function () {
|
|
|
11921
11975
|
}
|
|
11922
11976
|
}, _callee11, this);
|
|
11923
11977
|
}));
|
|
11924
|
-
function fetchRouteV2(
|
|
11978
|
+
function fetchRouteV2(_x30, _x31) {
|
|
11925
11979
|
return _fetchRouteV.apply(this, arguments);
|
|
11926
11980
|
}
|
|
11927
11981
|
return fetchRouteV2;
|
|
@@ -11956,7 +12010,7 @@ var Requester = /*#__PURE__*/function () {
|
|
|
11956
12010
|
}
|
|
11957
12011
|
}, _callee12, this);
|
|
11958
12012
|
}));
|
|
11959
|
-
function fetchInstitutions(
|
|
12013
|
+
function fetchInstitutions(_x32) {
|
|
11960
12014
|
return _fetchInstitutions.apply(this, arguments);
|
|
11961
12015
|
}
|
|
11962
12016
|
return fetchInstitutions;
|
|
@@ -12013,7 +12067,7 @@ var Requester = /*#__PURE__*/function () {
|
|
|
12013
12067
|
}
|
|
12014
12068
|
}, _callee13, this);
|
|
12015
12069
|
}));
|
|
12016
|
-
function fetchSearchResults(
|
|
12070
|
+
function fetchSearchResults(_x33, _x34, _x35, _x36, _x37, _x38, _x39, _x40) {
|
|
12017
12071
|
return _fetchSearchResults.apply(this, arguments);
|
|
12018
12072
|
}
|
|
12019
12073
|
return fetchSearchResults;
|
|
@@ -12081,7 +12135,7 @@ var Requester = /*#__PURE__*/function () {
|
|
|
12081
12135
|
}
|
|
12082
12136
|
}, _callee14, this);
|
|
12083
12137
|
}));
|
|
12084
|
-
function fetchSearchPlacesByTags(
|
|
12138
|
+
function fetchSearchPlacesByTags(_x41, _x42, _x43, _x44, _x45, _x46, _x47, _x48, _x49) {
|
|
12085
12139
|
return _fetchSearchPlacesByTags.apply(this, arguments);
|
|
12086
12140
|
}
|
|
12087
12141
|
return fetchSearchPlacesByTags;
|
|
@@ -12110,7 +12164,7 @@ var Requester = /*#__PURE__*/function () {
|
|
|
12110
12164
|
}
|
|
12111
12165
|
}, _callee15, this);
|
|
12112
12166
|
}));
|
|
12113
|
-
function fetchConfiguration(
|
|
12167
|
+
function fetchConfiguration(_x50, _x51, _x52) {
|
|
12114
12168
|
return _fetchConfiguration.apply(this, arguments);
|
|
12115
12169
|
}
|
|
12116
12170
|
return fetchConfiguration;
|
|
@@ -12138,7 +12192,7 @@ var Requester = /*#__PURE__*/function () {
|
|
|
12138
12192
|
}
|
|
12139
12193
|
}, _callee16, this);
|
|
12140
12194
|
}));
|
|
12141
|
-
function fetchCategories(
|
|
12195
|
+
function fetchCategories(_x53, _x54) {
|
|
12142
12196
|
return _fetchCategories.apply(this, arguments);
|
|
12143
12197
|
}
|
|
12144
12198
|
return fetchCategories;
|
|
@@ -12170,7 +12224,7 @@ var Requester = /*#__PURE__*/function () {
|
|
|
12170
12224
|
}
|
|
12171
12225
|
}, _callee17, this);
|
|
12172
12226
|
}));
|
|
12173
|
-
function fetchRoutesForOrigin(
|
|
12227
|
+
function fetchRoutesForOrigin(_x55, _x56, _x57, _x58, _x59, _x60) {
|
|
12174
12228
|
return _fetchRoutesForOrigin.apply(this, arguments);
|
|
12175
12229
|
}
|
|
12176
12230
|
return fetchRoutesForOrigin;
|
|
@@ -12197,7 +12251,7 @@ var Requester = /*#__PURE__*/function () {
|
|
|
12197
12251
|
}
|
|
12198
12252
|
}, _callee18, this);
|
|
12199
12253
|
}));
|
|
12200
|
-
function fetchCacheTimestamp(
|
|
12254
|
+
function fetchCacheTimestamp(_x61, _x62) {
|
|
12201
12255
|
return _fetchCacheTimestamp.apply(this, arguments);
|
|
12202
12256
|
}
|
|
12203
12257
|
return fetchCacheTimestamp;
|
|
@@ -12224,7 +12278,7 @@ var Requester = /*#__PURE__*/function () {
|
|
|
12224
12278
|
}
|
|
12225
12279
|
}, _callee19, this);
|
|
12226
12280
|
}));
|
|
12227
|
-
function fetchCssCustomization(
|
|
12281
|
+
function fetchCssCustomization(_x63, _x64) {
|
|
12228
12282
|
return _fetchCssCustomization.apply(this, arguments);
|
|
12229
12283
|
}
|
|
12230
12284
|
return fetchCssCustomization;
|
|
@@ -12257,7 +12311,7 @@ var Requester = /*#__PURE__*/function () {
|
|
|
12257
12311
|
}
|
|
12258
12312
|
}, _callee20, this);
|
|
12259
12313
|
}));
|
|
12260
|
-
function postHealth(
|
|
12314
|
+
function postHealth(_x65, _x66, _x67, _x68, _x69) {
|
|
12261
12315
|
return _postHealth.apply(this, arguments);
|
|
12262
12316
|
}
|
|
12263
12317
|
return postHealth;
|
|
@@ -12529,13 +12583,15 @@ var Repository = /*#__PURE__*/function (_Loggeable) {
|
|
|
12529
12583
|
}, {
|
|
12530
12584
|
key: "fetchAndParsePlaceDetail",
|
|
12531
12585
|
value: function () {
|
|
12532
|
-
var _fetchAndParsePlaceDetail = repository_asyncToGenerator(/*#__PURE__*/repository_regenerator().m(function _callee4(
|
|
12533
|
-
var cachedPlace, response, errorBody, responseData, place, _t4;
|
|
12586
|
+
var _fetchAndParsePlaceDetail = repository_asyncToGenerator(/*#__PURE__*/repository_regenerator().m(function _callee4(query) {
|
|
12587
|
+
var id, buildingId, floorId, level, cacheKey, cachedPlace, response, errorBody, responseData, place, _t4;
|
|
12534
12588
|
return repository_regenerator().w(function (_context4) {
|
|
12535
12589
|
while (1) switch (_context4.p = _context4.n) {
|
|
12536
12590
|
case 0:
|
|
12537
12591
|
_context4.p = 0;
|
|
12538
|
-
|
|
12592
|
+
id = query.id, buildingId = query.buildingId, floorId = query.floorId, level = query.level;
|
|
12593
|
+
cacheKey = this.placeCacheKey(id, buildingId);
|
|
12594
|
+
cachedPlace = this.cache.getPlace(cacheKey, this.currentLang);
|
|
12539
12595
|
if (!(cachedPlace != null)) {
|
|
12540
12596
|
_context4.n = 1;
|
|
12541
12597
|
break;
|
|
@@ -12546,7 +12602,7 @@ var Repository = /*#__PURE__*/function (_Loggeable) {
|
|
|
12546
12602
|
return _context4.a(2, cachedPlace);
|
|
12547
12603
|
case 1:
|
|
12548
12604
|
_context4.n = 2;
|
|
12549
|
-
return this.requester.fetchPlaceDetail(this.token,
|
|
12605
|
+
return this.requester.fetchPlaceDetail(this.token, id, buildingId, floorId, level);
|
|
12550
12606
|
case 2:
|
|
12551
12607
|
response = _context4.v;
|
|
12552
12608
|
if (response.ok) {
|
|
@@ -12564,10 +12620,7 @@ var Repository = /*#__PURE__*/function (_Loggeable) {
|
|
|
12564
12620
|
case 5:
|
|
12565
12621
|
responseData = _context4.v;
|
|
12566
12622
|
place = new place_MVXPlace(responseData);
|
|
12567
|
-
this.
|
|
12568
|
-
if (place.clientId != null) {
|
|
12569
|
-
this.cache.setPlace(place.clientId, place, this.currentLang);
|
|
12570
|
-
}
|
|
12623
|
+
this.cachePlace(place, buildingId);
|
|
12571
12624
|
this.logEvent("fetchAndParsePlaceDetail", {
|
|
12572
12625
|
cached: "false"
|
|
12573
12626
|
});
|
|
@@ -12589,13 +12642,15 @@ var Repository = /*#__PURE__*/function (_Loggeable) {
|
|
|
12589
12642
|
}, {
|
|
12590
12643
|
key: "fetchAndParseAnyPlaceDetail",
|
|
12591
12644
|
value: function () {
|
|
12592
|
-
var _fetchAndParseAnyPlaceDetail = repository_asyncToGenerator(/*#__PURE__*/repository_regenerator().m(function _callee5(
|
|
12593
|
-
var cachedPlace, response, errorBody, responseData, place, _t5;
|
|
12645
|
+
var _fetchAndParseAnyPlaceDetail = repository_asyncToGenerator(/*#__PURE__*/repository_regenerator().m(function _callee5(query, authToken) {
|
|
12646
|
+
var id, buildingId, floorId, level, cacheKey, cachedPlace, response, errorBody, responseData, place, _t5;
|
|
12594
12647
|
return repository_regenerator().w(function (_context5) {
|
|
12595
12648
|
while (1) switch (_context5.p = _context5.n) {
|
|
12596
12649
|
case 0:
|
|
12597
12650
|
_context5.p = 0;
|
|
12598
|
-
|
|
12651
|
+
id = query.id, buildingId = query.buildingId, floorId = query.floorId, level = query.level;
|
|
12652
|
+
cacheKey = this.placeCacheKey(id, buildingId);
|
|
12653
|
+
cachedPlace = this.cache.getPlace(cacheKey, this.currentLang);
|
|
12599
12654
|
if (!(cachedPlace != null)) {
|
|
12600
12655
|
_context5.n = 1;
|
|
12601
12656
|
break;
|
|
@@ -12606,7 +12661,7 @@ var Repository = /*#__PURE__*/function (_Loggeable) {
|
|
|
12606
12661
|
return _context5.a(2, cachedPlace);
|
|
12607
12662
|
case 1:
|
|
12608
12663
|
_context5.n = 2;
|
|
12609
|
-
return this.requester.fetchAnyPlaceDetail(authToken,
|
|
12664
|
+
return this.requester.fetchAnyPlaceDetail(authToken, id, buildingId, floorId, level);
|
|
12610
12665
|
case 2:
|
|
12611
12666
|
response = _context5.v;
|
|
12612
12667
|
if (response.ok) {
|
|
@@ -12624,10 +12679,7 @@ var Repository = /*#__PURE__*/function (_Loggeable) {
|
|
|
12624
12679
|
case 5:
|
|
12625
12680
|
responseData = _context5.v;
|
|
12626
12681
|
place = new place_MVXPlace(responseData);
|
|
12627
|
-
this.
|
|
12628
|
-
if (place.clientId != null) {
|
|
12629
|
-
this.cache.setPlace(place.clientId, place, this.currentLang);
|
|
12630
|
-
}
|
|
12682
|
+
this.cachePlace(place, buildingId);
|
|
12631
12683
|
this.logEvent("fetchAndParseAnyPlaceDetail", {
|
|
12632
12684
|
cached: "false"
|
|
12633
12685
|
});
|
|
@@ -12646,6 +12698,30 @@ var Repository = /*#__PURE__*/function (_Loggeable) {
|
|
|
12646
12698
|
}
|
|
12647
12699
|
return fetchAndParseAnyPlaceDetail;
|
|
12648
12700
|
}()
|
|
12701
|
+
/**
|
|
12702
|
+
* Build the cache key for a place lookup. The canonical `mapvxId` is globally
|
|
12703
|
+
* unique, but integrator aliases (`clientId`) may be reused across buildings, so
|
|
12704
|
+
* alias-based keys are namespaced by `buildingId` to prevent aliases from
|
|
12705
|
+
* different venues from colliding in the cache.
|
|
12706
|
+
*/
|
|
12707
|
+
}, {
|
|
12708
|
+
key: "placeCacheKey",
|
|
12709
|
+
value: function placeCacheKey(id, buildingId) {
|
|
12710
|
+
return buildingId != null ? "".concat(id, "_").concat(buildingId) : id;
|
|
12711
|
+
}
|
|
12712
|
+
|
|
12713
|
+
/**
|
|
12714
|
+
* Cache a place under its globally-unique `mapvxId` and, when present, under its
|
|
12715
|
+
* (possibly non-unique) `clientId` alias namespaced by `buildingId`.
|
|
12716
|
+
*/
|
|
12717
|
+
}, {
|
|
12718
|
+
key: "cachePlace",
|
|
12719
|
+
value: function cachePlace(place, buildingId) {
|
|
12720
|
+
this.cache.setPlace(place.mapvxId, place, this.currentLang);
|
|
12721
|
+
if (place.clientId != null) {
|
|
12722
|
+
this.cache.setPlace(this.placeCacheKey(place.clientId, buildingId), place, this.currentLang);
|
|
12723
|
+
}
|
|
12724
|
+
}
|
|
12649
12725
|
}, {
|
|
12650
12726
|
key: "fetchAndParseSubPlaces",
|
|
12651
12727
|
value: function () {
|
|
@@ -14230,13 +14306,17 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
|
|
|
14230
14306
|
value: function initialPlaceDetailSetUp(parentPlaceId, withBearerToken) {
|
|
14231
14307
|
var _this2 = this;
|
|
14232
14308
|
if (withBearerToken) {
|
|
14233
|
-
this.repository.fetchAndParseAnyPlaceDetail(
|
|
14309
|
+
this.repository.fetchAndParseAnyPlaceDetail({
|
|
14310
|
+
id: parentPlaceId
|
|
14311
|
+
}, withBearerToken).then(function (place) {
|
|
14234
14312
|
_this2.changeParentPlaceTo(place);
|
|
14235
14313
|
_this2.potentialParentPlaces.push(place);
|
|
14236
14314
|
})["catch"](console.error);
|
|
14237
14315
|
return;
|
|
14238
14316
|
}
|
|
14239
|
-
this.repository.fetchAndParsePlaceDetail(
|
|
14317
|
+
this.repository.fetchAndParsePlaceDetail({
|
|
14318
|
+
id: parentPlaceId
|
|
14319
|
+
}).then(function (place) {
|
|
14240
14320
|
_this2.changeParentPlaceTo(place);
|
|
14241
14321
|
_this2.potentialParentPlaces.push(place);
|
|
14242
14322
|
})["catch"](console.error);
|
|
@@ -14246,7 +14326,9 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
|
|
|
14246
14326
|
value: function loadOtherPotentialParentPlaces(ids) {
|
|
14247
14327
|
var _this3 = this;
|
|
14248
14328
|
Promise.all(ids.map(function (id) {
|
|
14249
|
-
return _this3.repository.fetchAndParsePlaceDetail(
|
|
14329
|
+
return _this3.repository.fetchAndParsePlaceDetail({
|
|
14330
|
+
id: id
|
|
14331
|
+
});
|
|
14250
14332
|
})).then(function (places) {
|
|
14251
14333
|
var _this3$potentialParen;
|
|
14252
14334
|
(_this3$potentialParen = _this3.potentialParentPlaces).push.apply(_this3$potentialParen, map_toConsumableArray(places));
|
|
@@ -15662,7 +15744,9 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
|
|
|
15662
15744
|
}
|
|
15663
15745
|
console.log("fetching place detail from server", ref);
|
|
15664
15746
|
_context2.n = 8;
|
|
15665
|
-
return _this12.repository.fetchAndParsePlaceDetail(
|
|
15747
|
+
return _this12.repository.fetchAndParsePlaceDetail({
|
|
15748
|
+
id: ref
|
|
15749
|
+
});
|
|
15666
15750
|
case 8:
|
|
15667
15751
|
clickedPlace = _context2.v;
|
|
15668
15752
|
_context2.n = 10;
|
|
@@ -16409,6 +16493,17 @@ function sdk_toPrimitive(t, r) { if ("object" != sdk_typeof(t) || !t) return t;
|
|
|
16409
16493
|
* @group Main
|
|
16410
16494
|
*/
|
|
16411
16495
|
|
|
16496
|
+
/**
|
|
16497
|
+
* Normalize the argument accepted by the place-detail methods into a
|
|
16498
|
+
* {@link PlaceQuery}. A plain string is treated as the place id/alias with no
|
|
16499
|
+
* building/floor disambiguation, preserving backward compatibility.
|
|
16500
|
+
*/
|
|
16501
|
+
function normalizePlaceQuery(place) {
|
|
16502
|
+
return typeof place === "string" ? {
|
|
16503
|
+
id: place
|
|
16504
|
+
} : place;
|
|
16505
|
+
}
|
|
16506
|
+
|
|
16412
16507
|
/**
|
|
16413
16508
|
* Initialize the SDK.
|
|
16414
16509
|
* @group Main
|
|
@@ -16495,20 +16590,21 @@ var InternalMapVXSDK = /*#__PURE__*/function (_Loggeable) {
|
|
|
16495
16590
|
}, {
|
|
16496
16591
|
key: "getPlaceDetail",
|
|
16497
16592
|
value: function () {
|
|
16498
|
-
var _getPlaceDetail = sdk_asyncToGenerator(/*#__PURE__*/sdk_regenerator().m(function _callee(
|
|
16499
|
-
var
|
|
16593
|
+
var _getPlaceDetail = sdk_asyncToGenerator(/*#__PURE__*/sdk_regenerator().m(function _callee(place) {
|
|
16594
|
+
var query, result, _t;
|
|
16500
16595
|
return sdk_regenerator().w(function (_context) {
|
|
16501
16596
|
while (1) switch (_context.p = _context.n) {
|
|
16502
16597
|
case 0:
|
|
16503
16598
|
_context.p = 0;
|
|
16599
|
+
query = normalizePlaceQuery(place);
|
|
16504
16600
|
_context.n = 1;
|
|
16505
|
-
return this.repository.fetchAndParsePlaceDetail(
|
|
16601
|
+
return this.repository.fetchAndParsePlaceDetail(query);
|
|
16506
16602
|
case 1:
|
|
16507
|
-
|
|
16603
|
+
result = _context.v;
|
|
16508
16604
|
this.logEvent("getPlaceDetail", {
|
|
16509
|
-
id: id
|
|
16605
|
+
id: query.id
|
|
16510
16606
|
});
|
|
16511
|
-
return _context.a(2,
|
|
16607
|
+
return _context.a(2, result);
|
|
16512
16608
|
case 2:
|
|
16513
16609
|
_context.p = 2;
|
|
16514
16610
|
_t = _context.v;
|
|
@@ -16526,20 +16622,21 @@ var InternalMapVXSDK = /*#__PURE__*/function (_Loggeable) {
|
|
|
16526
16622
|
}, {
|
|
16527
16623
|
key: "getAnyPlaceDetail",
|
|
16528
16624
|
value: function () {
|
|
16529
|
-
var _getAnyPlaceDetail = sdk_asyncToGenerator(/*#__PURE__*/sdk_regenerator().m(function _callee2(
|
|
16530
|
-
var
|
|
16625
|
+
var _getAnyPlaceDetail = sdk_asyncToGenerator(/*#__PURE__*/sdk_regenerator().m(function _callee2(place, authToken) {
|
|
16626
|
+
var query, result, _t2;
|
|
16531
16627
|
return sdk_regenerator().w(function (_context2) {
|
|
16532
16628
|
while (1) switch (_context2.p = _context2.n) {
|
|
16533
16629
|
case 0:
|
|
16534
16630
|
_context2.p = 0;
|
|
16631
|
+
query = normalizePlaceQuery(place);
|
|
16535
16632
|
_context2.n = 1;
|
|
16536
|
-
return this.repository.fetchAndParseAnyPlaceDetail(
|
|
16633
|
+
return this.repository.fetchAndParseAnyPlaceDetail(query, authToken);
|
|
16537
16634
|
case 1:
|
|
16538
|
-
|
|
16635
|
+
result = _context2.v;
|
|
16539
16636
|
this.logEvent("getAnyPlaceDetail", {
|
|
16540
|
-
id: id
|
|
16637
|
+
id: query.id
|
|
16541
16638
|
});
|
|
16542
|
-
return _context2.a(2,
|
|
16639
|
+
return _context2.a(2, result);
|
|
16543
16640
|
case 2:
|
|
16544
16641
|
_context2.p = 2;
|
|
16545
16642
|
_t2 = _context2.v;
|