atriusmaps-node-sdk 3.3.898 → 3.3.900
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/nodesdk/nodeEntry.js +36 -58
- package/dist/cjs/package.json.js +8 -4
- package/dist/cjs/plugins/clientAPI/src/clientAPI.js +8 -6
- package/dist/cjs/plugins/dynamicPois/src/dynamicPois.js +50 -142
- package/dist/cjs/plugins/dynamicPois/src/processors.js +31 -53
- package/dist/cjs/plugins/flightStatus/src/flightDetailsMapper.js +47 -116
- package/dist/cjs/plugins/flightStatus/src/flightStatus.js +48 -82
- package/dist/cjs/plugins/flightStatus/src/utils.js +4 -14
- package/dist/cjs/plugins/poiDataManager/src/poiDataManager.js +77 -154
- package/dist/cjs/plugins/sdkServer/src/prepareSDKConfig.js +45 -76
- package/dist/cjs/plugins/sdkServer/src/sdkHeadless.js +70 -79
- package/dist/cjs/plugins/sdkServer/src/sdkServer.js +97 -147
- package/dist/cjs/plugins/searchService/src/flexsearchExports/lang.js +16 -190
- package/dist/cjs/plugins/searchService/src/flexsearchExports/simple.js +28 -35
- package/dist/cjs/plugins/searchService/src/poiSearch.js +10 -21
- package/dist/cjs/plugins/searchService/src/searchService.js +45 -147
- package/dist/cjs/plugins/searchService/src/searchTypeahead.js +17 -28
- package/dist/cjs/plugins/searchService/src/utils.js +9 -13
- package/dist/cjs/plugins/venueDataLoader/src/venueDataLoader.js +148 -304
- package/dist/cjs/plugins/venueDataLoader/src/venueLoadingUtils.js +47 -126
- package/dist/cjs/plugins/wayfinder/src/findRoute.js +6 -73
- package/dist/cjs/plugins/wayfinder/src/minPriorityQueue.js +7 -27
- package/dist/cjs/plugins/wayfinder/src/navGraph.js +78 -259
- package/dist/cjs/plugins/wayfinder/src/navGraphDebug.js +26 -57
- package/dist/cjs/plugins/wayfinder/src/segmentBadges.js +25 -25
- package/dist/cjs/plugins/wayfinder/src/segmentBuilder.js +50 -133
- package/dist/cjs/plugins/wayfinder/src/segmentCategories.js +29 -29
- package/dist/cjs/plugins/wayfinder/src/stepBuilder.js +53 -145
- package/dist/cjs/plugins/wayfinder/src/wayfinder.js +105 -349
- package/dist/cjs/src/app.js +53 -91
- package/dist/cjs/src/configs/postproc-mol-url-parms.js +34 -43
- package/dist/cjs/src/configs/postproc-stateTracking.js +1 -19
- package/dist/cjs/src/controller.js +4 -26
- package/dist/cjs/src/debugTools.js +55 -94
- package/dist/cjs/src/env.js +8 -19
- package/dist/cjs/src/extModules/bustle.js +15 -71
- package/dist/cjs/src/extModules/flexapi/src/help.js +7 -22
- package/dist/cjs/src/extModules/flexapi/src/index.js +15 -29
- package/dist/cjs/src/extModules/flexapi/src/validate.js +45 -93
- package/dist/cjs/src/extModules/geohasher.js +13 -31
- package/dist/cjs/src/extModules/log.js +18 -29
- package/dist/cjs/src/historyManager.js +4 -6
- package/dist/cjs/src/utils/bounds.js +2 -4
- package/dist/cjs/src/utils/buildStructureLookup.js +7 -7
- package/dist/cjs/src/utils/configUtils.js +7 -43
- package/dist/cjs/src/utils/date.js +5 -17
- package/dist/cjs/src/utils/distance.js +2 -2
- package/dist/cjs/src/utils/dom.js +9 -24
- package/dist/cjs/src/utils/funcs.js +15 -30
- package/dist/cjs/src/utils/geodesy.js +24 -39
- package/dist/cjs/src/utils/geom.js +32 -148
- package/dist/cjs/src/utils/i18n.js +39 -70
- package/dist/cjs/src/utils/isInitialState.js +7 -13
- package/dist/cjs/src/utils/location.js +10 -29
- package/dist/cjs/src/utils/observable.js +4 -29
- package/dist/cjs/src/utils/rand.js +9 -80
- package/dist/cjs/utils/constants.js +1 -1
- package/dist/package.json.js +1 -1
- package/dist/plugins/sdkServer/src/prepareSDKConfig.js +1 -1
- package/dist/src/utils/buildStructureLookup.js +1 -1
- package/dist/src/utils/date.js +1 -1
- package/package.json +1 -1
|
@@ -5,56 +5,45 @@ var utils = require('./utils.js');
|
|
|
5
5
|
|
|
6
6
|
function createSearchTypeahead(pois, poiSearch, lang) {
|
|
7
7
|
const suggestedKeywordsSearch = createSuggestedKeywordsSearch(pois, lang);
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
const filteredSuggestions = withSuggestions.filter(poi => matchedIds.indexOf(poi.poiId) === -1);
|
|
8
|
+
function queryPois(query2, limit) {
|
|
9
|
+
const matches = poiSearch({ query: query2, limit });
|
|
10
|
+
const withSuggestions = poiSearch({ query: query2, suggest: true, limit });
|
|
11
|
+
const matchedIds = matches.map((poi) => poi.poiId);
|
|
12
|
+
const filteredSuggestions = withSuggestions.filter((poi) => matchedIds.indexOf(poi.poiId) === -1);
|
|
14
13
|
return matches.concat(filteredSuggestions);
|
|
15
14
|
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
const
|
|
19
|
-
const queryLengthUnderLimit = query.length < 3;
|
|
15
|
+
const query = (query2, limit) => {
|
|
16
|
+
const suggestedKeywords = suggestedKeywordsSearch.search({ query: query2, limit });
|
|
17
|
+
const queryLengthUnderLimit = query2.length < 3;
|
|
20
18
|
const shouldQueryPois = !queryLengthUnderLimit && suggestedKeywords.length;
|
|
21
19
|
const poisLimit = limit - suggestedKeywords.length;
|
|
22
|
-
const
|
|
23
|
-
return { keywords: suggestedKeywords, pois };
|
|
20
|
+
const pois2 = shouldQueryPois ? queryPois(query2, poisLimit) : [];
|
|
21
|
+
return { keywords: suggestedKeywords, pois: pois2 };
|
|
24
22
|
};
|
|
25
|
-
|
|
26
|
-
const addKeyword = keyword => {
|
|
23
|
+
const addKeyword = (keyword) => {
|
|
27
24
|
suggestedKeywordsSearch.add(keyword);
|
|
28
25
|
};
|
|
29
|
-
|
|
30
26
|
return { query, addKeyword };
|
|
31
27
|
}
|
|
32
|
-
|
|
33
28
|
function createSuggestedKeywordsSearch(pois, lang) {
|
|
34
29
|
const categories = extractParentCategories(pois);
|
|
35
|
-
const poisKeywords = R.pipe(R.values, R.chain(R.prop(
|
|
30
|
+
const poisKeywords = R.pipe(R.values, R.chain(R.prop("keywords")), R.filter(R.prop("isUserSearchable")), R.pluck("name"))(pois);
|
|
36
31
|
const allPotentialKeywords = [...categories, ...poisKeywords];
|
|
37
|
-
const keywords = Array.from(new Set([...allPotentialKeywords]));
|
|
32
|
+
const keywords = Array.from(/* @__PURE__ */ new Set([...allPotentialKeywords]));
|
|
38
33
|
const index = utils.getFlexSearchInstance({ lang});
|
|
39
|
-
|
|
40
34
|
keywords.forEach((keyword, i) => index.add(i, keyword));
|
|
41
|
-
|
|
42
|
-
const search = queryParams => {
|
|
35
|
+
const search = (queryParams) => {
|
|
43
36
|
const ids = index.search(queryParams);
|
|
44
|
-
return ids.map(
|
|
37
|
+
return ids.map((index2) => keywords[index2]);
|
|
45
38
|
};
|
|
46
|
-
const add = newKeyword => {
|
|
39
|
+
const add = (newKeyword) => {
|
|
47
40
|
keywords.push(newKeyword);
|
|
48
41
|
index.add(keywords.length - 1, newKeyword);
|
|
49
42
|
};
|
|
50
43
|
return { search, add };
|
|
51
44
|
}
|
|
52
|
-
|
|
53
45
|
function extractParentCategories(pois) {
|
|
54
|
-
return Object.values(pois)
|
|
55
|
-
.map(poi => poi.category)
|
|
56
|
-
.map(fullCategory => fullCategory.split('.'))
|
|
57
|
-
.map(subcategories => subcategories[0]);
|
|
46
|
+
return Object.values(pois).map((poi) => poi.category).map((fullCategory) => fullCategory.split(".")).map((subcategories) => subcategories[0]);
|
|
58
47
|
}
|
|
59
48
|
|
|
60
49
|
module.exports = createSearchTypeahead;
|
|
@@ -3,26 +3,22 @@
|
|
|
3
3
|
var FlexSearch = require('flexsearch');
|
|
4
4
|
var simple = require('./flexsearchExports/simple.js');
|
|
5
5
|
|
|
6
|
-
const NON_ASCII_LANGUAGES = [
|
|
7
|
-
|
|
6
|
+
const NON_ASCII_LANGUAGES = ["ko", "ja", "zh-Hans", "zh-Hant"];
|
|
8
7
|
const getFlexSearchInstance = ({ lang }) => {
|
|
9
8
|
const options = {
|
|
10
|
-
tokenize:
|
|
11
|
-
rtl: lang ===
|
|
9
|
+
tokenize: "reverse",
|
|
10
|
+
rtl: lang === "ar",
|
|
11
|
+
// only for arabic
|
|
12
12
|
stemmer: {
|
|
13
|
-
s:
|
|
14
|
-
es:
|
|
15
|
-
ies:
|
|
13
|
+
s: "",
|
|
14
|
+
es: "",
|
|
15
|
+
ies: "y"
|
|
16
16
|
},
|
|
17
|
-
encode: simple.encode
|
|
17
|
+
encode: simple.encode
|
|
18
18
|
};
|
|
19
|
-
|
|
20
|
-
// Use the full tokenizer for non-ASCII languages and for standard searching
|
|
21
|
-
// but use "forward" for typeahead
|
|
22
19
|
if (NON_ASCII_LANGUAGES.includes(lang)) {
|
|
23
|
-
options.tokenize =
|
|
20
|
+
options.tokenize = "full";
|
|
24
21
|
}
|
|
25
|
-
|
|
26
22
|
return new FlexSearch.Index(options);
|
|
27
23
|
};
|
|
28
24
|
|