@esri/hub-common 9.48.0 → 10.0.0-next.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/es2017/core/traits/WithCatalog.js +1 -0
- package/dist/es2017/core/traits/WithCatalog.js.map +1 -0
- package/dist/es2017/index.js +1 -0
- package/dist/es2017/index.js.map +1 -1
- package/dist/es2017/projects/HubProjects.js.map +1 -1
- package/dist/es2017/search/Catalog.js +346 -0
- package/dist/es2017/search/Catalog.js.map +1 -0
- package/dist/es2017/search/Collection.js +38 -19
- package/dist/es2017/search/Collection.js.map +1 -1
- package/dist/es2017/search/_internal/{ipredicate-utils.js → expandPredicate.js} +1 -1
- package/dist/es2017/search/_internal/expandPredicate.js.map +1 -0
- package/dist/es2017/search/_internal/hubSearchItems.js +3 -137
- package/dist/es2017/search/_internal/hubSearchItems.js.map +1 -1
- package/dist/es2017/search/_internal/index.js +0 -1
- package/dist/es2017/search/_internal/index.js.map +1 -1
- package/dist/es2017/search/_internal/portalSearchGroups.js +1 -2
- package/dist/es2017/search/_internal/portalSearchGroups.js.map +1 -1
- package/dist/es2017/search/_internal/portalSearchItems.js +5 -30
- package/dist/es2017/search/_internal/portalSearchItems.js.map +1 -1
- package/dist/es2017/search/_internal/portalSearchUsers.js +1 -2
- package/dist/es2017/search/_internal/portalSearchUsers.js.map +1 -1
- package/dist/es2017/search/fetchCatalog.js +46 -0
- package/dist/es2017/search/fetchCatalog.js.map +1 -0
- package/dist/es2017/search/hubSearch.js +1 -1
- package/dist/es2017/search/hubSearch.js.map +1 -1
- package/dist/es2017/search/index.js +3 -9
- package/dist/es2017/search/index.js.map +1 -1
- package/dist/es2017/search/serializeQueryForPortal.js +1 -1
- package/dist/es2017/search/serializeQueryForPortal.js.map +1 -1
- package/dist/es2017/search/types/index.js +0 -5
- package/dist/es2017/search/types/index.js.map +1 -1
- package/dist/es2017/search/upgradeCatalogSchema.js +66 -0
- package/dist/es2017/search/upgradeCatalogSchema.js.map +1 -0
- package/dist/es2017/search/utils.js +1 -207
- package/dist/es2017/search/utils.js.map +1 -1
- package/dist/es2017/types/IMessage.js +1 -0
- package/dist/es2017/types/IMessage.js.map +1 -0
- package/dist/es2017/types/index.js +2 -0
- package/dist/es2017/types/index.js.map +1 -0
- package/dist/es2017/types.js.map +1 -1
- package/dist/esm/core/traits/WithCatalog.js +1 -0
- package/dist/esm/core/traits/WithCatalog.js.map +1 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/projects/HubProjects.js.map +1 -1
- package/dist/esm/search/Catalog.js +404 -0
- package/dist/esm/search/Catalog.js.map +1 -0
- package/dist/esm/search/Collection.js +40 -24
- package/dist/esm/search/Collection.js.map +1 -1
- package/dist/esm/search/_internal/{ipredicate-utils.js → expandPredicate.js} +1 -1
- package/dist/esm/search/_internal/expandPredicate.js.map +1 -0
- package/dist/esm/search/_internal/hubSearchItems.js +4 -146
- package/dist/esm/search/_internal/hubSearchItems.js.map +1 -1
- package/dist/esm/search/_internal/index.js +0 -1
- package/dist/esm/search/_internal/index.js.map +1 -1
- package/dist/esm/search/_internal/portalSearchGroups.js +1 -2
- package/dist/esm/search/_internal/portalSearchGroups.js.map +1 -1
- package/dist/esm/search/_internal/portalSearchItems.js +6 -30
- package/dist/esm/search/_internal/portalSearchItems.js.map +1 -1
- package/dist/esm/search/_internal/portalSearchUsers.js +1 -2
- package/dist/esm/search/_internal/portalSearchUsers.js.map +1 -1
- package/dist/esm/search/fetchCatalog.js +59 -0
- package/dist/esm/search/fetchCatalog.js.map +1 -0
- package/dist/esm/search/hubSearch.js +1 -1
- package/dist/esm/search/hubSearch.js.map +1 -1
- package/dist/esm/search/index.js +3 -9
- package/dist/esm/search/index.js.map +1 -1
- package/dist/esm/search/serializeQueryForPortal.js +1 -1
- package/dist/esm/search/serializeQueryForPortal.js.map +1 -1
- package/dist/esm/search/types/index.js +0 -5
- package/dist/esm/search/types/index.js.map +1 -1
- package/dist/esm/search/upgradeCatalogSchema.js +66 -0
- package/dist/esm/search/upgradeCatalogSchema.js.map +1 -0
- package/dist/esm/search/utils.js +1 -204
- package/dist/esm/search/utils.js.map +1 -1
- package/dist/esm/types/IMessage.js +1 -0
- package/dist/esm/types/IMessage.js.map +1 -0
- package/dist/esm/types/index.js +2 -0
- package/dist/esm/types/index.js.map +1 -0
- package/dist/esm/types.js.map +1 -1
- package/dist/node/{search/types/ICollection.js → core/traits/WithCatalog.js} +1 -1
- package/dist/node/core/traits/WithCatalog.js.map +1 -0
- package/dist/node/index.js +1 -0
- package/dist/node/index.js.map +1 -1
- package/dist/node/projects/HubProjects.js.map +1 -1
- package/dist/node/search/Catalog.js +350 -0
- package/dist/node/search/Catalog.js.map +1 -0
- package/dist/node/search/Collection.js +37 -18
- package/dist/node/search/Collection.js.map +1 -1
- package/dist/node/search/_internal/{ipredicate-utils.js → expandPredicate.js} +1 -1
- package/dist/node/search/_internal/expandPredicate.js.map +1 -0
- package/dist/node/search/_internal/hubSearchItems.js +4 -139
- package/dist/node/search/_internal/hubSearchItems.js.map +1 -1
- package/dist/node/search/_internal/index.js +0 -1
- package/dist/node/search/_internal/index.js.map +1 -1
- package/dist/node/search/_internal/portalSearchGroups.js +2 -3
- package/dist/node/search/_internal/portalSearchGroups.js.map +1 -1
- package/dist/node/search/_internal/portalSearchItems.js +6 -31
- package/dist/node/search/_internal/portalSearchItems.js.map +1 -1
- package/dist/node/search/_internal/portalSearchUsers.js +2 -3
- package/dist/node/search/_internal/portalSearchUsers.js.map +1 -1
- package/dist/node/search/fetchCatalog.js +50 -0
- package/dist/node/search/fetchCatalog.js.map +1 -0
- package/dist/node/search/hubSearch.js +1 -1
- package/dist/node/search/hubSearch.js.map +1 -1
- package/dist/node/search/index.js +3 -9
- package/dist/node/search/index.js.map +1 -1
- package/dist/node/search/serializeQueryForPortal.js +2 -2
- package/dist/node/search/serializeQueryForPortal.js.map +1 -1
- package/dist/node/search/types/index.js +0 -5
- package/dist/node/search/types/index.js.map +1 -1
- package/dist/node/search/upgradeCatalogSchema.js +71 -0
- package/dist/node/search/upgradeCatalogSchema.js.map +1 -0
- package/dist/node/search/utils.js +1 -213
- package/dist/node/search/utils.js.map +1 -1
- package/dist/node/{search/types/ICatalog.js → types/IMessage.js} +1 -1
- package/dist/node/types/IMessage.js.map +1 -0
- package/dist/node/types/index.js +5 -0
- package/dist/node/types/index.js.map +1 -0
- package/dist/node/types.js.map +1 -1
- package/dist/types/core/traits/WithCatalog.d.ts +7 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/search/Catalog.d.ts +143 -0
- package/dist/types/search/Collection.d.ts +23 -2
- package/dist/types/search/_internal/{ipredicate-utils.d.ts → expandPredicate.d.ts} +0 -0
- package/dist/types/search/_internal/hubSearchItems.d.ts +3 -4
- package/dist/types/search/_internal/index.d.ts +0 -1
- package/dist/types/search/_internal/portalSearchItems.d.ts +15 -15
- package/dist/types/search/fetchCatalog.d.ts +10 -0
- package/dist/types/search/index.d.ts +3 -9
- package/dist/types/search/types/IHubSearchOptions.d.ts +5 -1
- package/dist/types/search/types/IHubSearchResponse.d.ts +3 -3
- package/dist/types/search/types/index.d.ts +0 -5
- package/dist/types/search/types/types.d.ts +0 -206
- package/dist/types/search/upgradeCatalogSchema.d.ts +12 -0
- package/dist/types/search/utils.d.ts +2 -58
- package/dist/types/types/IMessage.d.ts +32 -0
- package/dist/types/types/index.d.ts +1 -0
- package/dist/types/types.d.ts +0 -2
- package/dist/umd/common.umd.js +1374 -2450
- package/dist/umd/common.umd.js.map +1 -1
- package/package.json +1 -1
- package/dist/es2017/search/_internal/ipredicate-utils.js.map +0 -1
- package/dist/es2017/search/_internal/state.js +0 -155
- package/dist/es2017/search/_internal/state.js.map +0 -1
- package/dist/es2017/search/_searchContent.js +0 -116
- package/dist/es2017/search/_searchContent.js.map +0 -1
- package/dist/es2017/search/_searchGroups.js +0 -88
- package/dist/es2017/search/_searchGroups.js.map +0 -1
- package/dist/es2017/search/_searchUsers.js +0 -89
- package/dist/es2017/search/_searchUsers.js.map +0 -1
- package/dist/es2017/search/collectionState.js +0 -60
- package/dist/es2017/search/collectionState.js.map +0 -1
- package/dist/es2017/search/content-utils.js +0 -455
- package/dist/es2017/search/content-utils.js.map +0 -1
- package/dist/es2017/search/convertCatalog.js +0 -33
- package/dist/es2017/search/convertCatalog.js.map +0 -1
- package/dist/es2017/search/filter-utils.js +0 -31
- package/dist/es2017/search/filter-utils.js.map +0 -1
- package/dist/es2017/search/group-utils.js +0 -142
- package/dist/es2017/search/group-utils.js.map +0 -1
- package/dist/es2017/search/types/ICatalog.js +0 -1
- package/dist/es2017/search/types/ICatalog.js.map +0 -1
- package/dist/es2017/search/types/ICollection.js +0 -1
- package/dist/es2017/search/types/ICollection.js.map +0 -1
- package/dist/es2017/search/types/IFacet.js +0 -1
- package/dist/es2017/search/types/IFacet.js.map +0 -1
- package/dist/es2017/search/types/IFacetOption.js +0 -1
- package/dist/es2017/search/types/IFacetOption.js.map +0 -1
- package/dist/es2017/search/types/IHubApiSearchRequest.js +0 -1
- package/dist/es2017/search/types/IHubApiSearchRequest.js.map +0 -1
- package/dist/es2017/search/user-utils.js +0 -139
- package/dist/es2017/search/user-utils.js.map +0 -1
- package/dist/esm/search/_internal/ipredicate-utils.js.map +0 -1
- package/dist/esm/search/_internal/state.js +0 -155
- package/dist/esm/search/_internal/state.js.map +0 -1
- package/dist/esm/search/_searchContent.js +0 -118
- package/dist/esm/search/_searchContent.js.map +0 -1
- package/dist/esm/search/_searchGroups.js +0 -91
- package/dist/esm/search/_searchGroups.js.map +0 -1
- package/dist/esm/search/_searchUsers.js +0 -92
- package/dist/esm/search/_searchUsers.js.map +0 -1
- package/dist/esm/search/collectionState.js +0 -61
- package/dist/esm/search/collectionState.js.map +0 -1
- package/dist/esm/search/content-utils.js +0 -462
- package/dist/esm/search/content-utils.js.map +0 -1
- package/dist/esm/search/convertCatalog.js +0 -33
- package/dist/esm/search/convertCatalog.js.map +0 -1
- package/dist/esm/search/filter-utils.js +0 -31
- package/dist/esm/search/filter-utils.js.map +0 -1
- package/dist/esm/search/group-utils.js +0 -146
- package/dist/esm/search/group-utils.js.map +0 -1
- package/dist/esm/search/types/ICatalog.js +0 -1
- package/dist/esm/search/types/ICatalog.js.map +0 -1
- package/dist/esm/search/types/ICollection.js +0 -1
- package/dist/esm/search/types/ICollection.js.map +0 -1
- package/dist/esm/search/types/IFacet.js +0 -1
- package/dist/esm/search/types/IFacet.js.map +0 -1
- package/dist/esm/search/types/IFacetOption.js +0 -1
- package/dist/esm/search/types/IFacetOption.js.map +0 -1
- package/dist/esm/search/types/IHubApiSearchRequest.js +0 -1
- package/dist/esm/search/types/IHubApiSearchRequest.js.map +0 -1
- package/dist/esm/search/user-utils.js +0 -143
- package/dist/esm/search/user-utils.js.map +0 -1
- package/dist/node/search/_internal/ipredicate-utils.js.map +0 -1
- package/dist/node/search/_internal/state.js +0 -166
- package/dist/node/search/_internal/state.js.map +0 -1
- package/dist/node/search/_searchContent.js +0 -120
- package/dist/node/search/_searchContent.js.map +0 -1
- package/dist/node/search/_searchGroups.js +0 -92
- package/dist/node/search/_searchGroups.js.map +0 -1
- package/dist/node/search/_searchUsers.js +0 -93
- package/dist/node/search/_searchUsers.js.map +0 -1
- package/dist/node/search/collectionState.js +0 -65
- package/dist/node/search/collectionState.js.map +0 -1
- package/dist/node/search/content-utils.js +0 -466
- package/dist/node/search/content-utils.js.map +0 -1
- package/dist/node/search/convertCatalog.js +0 -37
- package/dist/node/search/convertCatalog.js.map +0 -1
- package/dist/node/search/filter-utils.js +0 -36
- package/dist/node/search/filter-utils.js.map +0 -1
- package/dist/node/search/group-utils.js +0 -148
- package/dist/node/search/group-utils.js.map +0 -1
- package/dist/node/search/types/ICatalog.js.map +0 -1
- package/dist/node/search/types/ICollection.js.map +0 -1
- package/dist/node/search/types/IFacet.js +0 -3
- package/dist/node/search/types/IFacet.js.map +0 -1
- package/dist/node/search/types/IFacetOption.js +0 -3
- package/dist/node/search/types/IFacetOption.js.map +0 -1
- package/dist/node/search/types/IHubApiSearchRequest.js +0 -3
- package/dist/node/search/types/IHubApiSearchRequest.js.map +0 -1
- package/dist/node/search/user-utils.js +0 -145
- package/dist/node/search/user-utils.js.map +0 -1
- package/dist/types/search/_internal/state.d.ts +0 -70
- package/dist/types/search/_searchContent.d.ts +0 -9
- package/dist/types/search/_searchGroups.d.ts +0 -17
- package/dist/types/search/_searchUsers.d.ts +0 -31
- package/dist/types/search/collectionState.d.ts +0 -19
- package/dist/types/search/content-utils.d.ts +0 -83
- package/dist/types/search/convertCatalog.d.ts +0 -6
- package/dist/types/search/filter-utils.d.ts +0 -13
- package/dist/types/search/group-utils.d.ts +0 -36
- package/dist/types/search/types/ICatalog.d.ts +0 -87
- package/dist/types/search/types/ICollection.d.ts +0 -28
- package/dist/types/search/types/IFacet.d.ts +0 -62
- package/dist/types/search/types/IFacetOption.d.ts +0 -30
- package/dist/types/search/types/IHubApiSearchRequest.d.ts +0 -16
- package/dist/types/search/user-utils.d.ts +0 -35
|
@@ -1,148 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.serializeGroupFilterForPortal = exports.expandGroupFilter = exports.mergeGroupFilters = void 0;
|
|
4
|
-
const _1 = require(".");
|
|
5
|
-
const __1 = require("..");
|
|
6
|
-
// TODO: Remove with _searchContent
|
|
7
|
-
/**
|
|
8
|
-
*
|
|
9
|
-
* Merge `Filter<"group">` objects
|
|
10
|
-
*
|
|
11
|
-
* Useful in components which may get partial filters from a variety of
|
|
12
|
-
* sub-components, which are then combined into a single filter prior
|
|
13
|
-
* to executing the search.
|
|
14
|
-
* @param filters
|
|
15
|
-
* @returns
|
|
16
|
-
*/
|
|
17
|
-
function mergeGroupFilters(filters) {
|
|
18
|
-
// TODO: Remove with _searchContent
|
|
19
|
-
__1.Logger.warn(`DEPRECATION: mergeGroupFilters will be removed. Work with IFilterGroups<"group"> and hubSearch() instead`);
|
|
20
|
-
// expand all the filters so all prop types are consistent
|
|
21
|
-
const expanded = filters.map(expandGroupFilter);
|
|
22
|
-
// now we can merge based on fields
|
|
23
|
-
const dateFields = ["created", "modified"];
|
|
24
|
-
const specialFields = ["filterType", "term", ...dateFields];
|
|
25
|
-
// acc is initialized as Filter<group> but also needs it
|
|
26
|
-
// in the function signature... for reasons?!
|
|
27
|
-
const result = expanded.reduce((acc, entry) => {
|
|
28
|
-
// process fields
|
|
29
|
-
Object.entries(entry).forEach(([key, value]) => {
|
|
30
|
-
// Note: getProp/setProp are used to get around
|
|
31
|
-
// typescript issues with string indexing
|
|
32
|
-
if (acc.hasOwnProperty(key)) {
|
|
33
|
-
const existingValue = __1.getProp(acc, key);
|
|
34
|
-
// if the key is not to a special field
|
|
35
|
-
if (!specialFields.includes(key)) {
|
|
36
|
-
// treat as an IMatchOptions
|
|
37
|
-
__1.setProp(key, _1.mergeMatchOptions(existingValue, value), acc);
|
|
38
|
-
}
|
|
39
|
-
else if (dateFields.includes(key)) {
|
|
40
|
-
// treat as IDateRange
|
|
41
|
-
__1.setProp(key, _1.mergeDateRange(existingValue, value), acc);
|
|
42
|
-
}
|
|
43
|
-
else if (key === "term") {
|
|
44
|
-
// append terms
|
|
45
|
-
acc[key] = `${acc[key]} ${value}`;
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
else {
|
|
49
|
-
// Acc does not have an entry for this yet
|
|
50
|
-
// so just clone it
|
|
51
|
-
__1.setProp(key, __1.cloneObject(value), acc);
|
|
52
|
-
}
|
|
53
|
-
});
|
|
54
|
-
return acc;
|
|
55
|
-
}, {
|
|
56
|
-
filterType: "group",
|
|
57
|
-
});
|
|
58
|
-
return result;
|
|
59
|
-
}
|
|
60
|
-
exports.mergeGroupFilters = mergeGroupFilters;
|
|
61
|
-
/**
|
|
62
|
-
* Prior to serialization into the query syntax for the backing APIs, we first expand [Filters](../Filter)
|
|
63
|
-
*
|
|
64
|
-
* Filter's can express their intent in a very terse form, but to ensure consistent structures
|
|
65
|
-
* we expand them into their more verbose form.
|
|
66
|
-
*
|
|
67
|
-
* i.e. `title: "Water"` expands into `title: { any: ["Water"]}`
|
|
68
|
-
*
|
|
69
|
-
* - Fields defined as `string | string[] | MatchOptions` will be converted to a `MatchOptions`
|
|
70
|
-
* - RelativeDate fields are converted to DateRange<number>
|
|
71
|
-
*
|
|
72
|
-
* @param filter
|
|
73
|
-
* @returns
|
|
74
|
-
*/
|
|
75
|
-
function expandGroupFilter(filter) {
|
|
76
|
-
// TODO: Remove with _searchContent
|
|
77
|
-
__1.Logger.warn(`DEPRECATION: expandGroupFilters will be removed. Work with IFilterGroups<"group"> and hubSearch() instead`);
|
|
78
|
-
const result = {};
|
|
79
|
-
const dateProps = ["created", "modified"];
|
|
80
|
-
// Some properties should not get converted to MatchOptions
|
|
81
|
-
const specialProps = ["term", "searchUserAccess", ...dateProps];
|
|
82
|
-
// Do the conversion
|
|
83
|
-
Object.entries(filter).forEach(([key, value]) => {
|
|
84
|
-
// handle Matchish fields
|
|
85
|
-
if (!specialProps.includes(key)) {
|
|
86
|
-
// setProp side-steps typescript complaining
|
|
87
|
-
__1.setProp(key, _1.valueToMatchOptions(value), result);
|
|
88
|
-
}
|
|
89
|
-
// Handle date fields
|
|
90
|
-
if (dateProps.includes(key)) {
|
|
91
|
-
const dateFieldValue = __1.cloneObject(__1.getProp(filter, key));
|
|
92
|
-
if (__1.getProp(filter, `${key}.type`) === "relative-date") {
|
|
93
|
-
__1.setProp(key, _1.relativeDateToDateRange(dateFieldValue), result);
|
|
94
|
-
}
|
|
95
|
-
else {
|
|
96
|
-
__1.setProp(key, dateFieldValue, result);
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
});
|
|
100
|
-
// searchUserAccess is boolean, so we check if the prop exists
|
|
101
|
-
// vs checking if the value is truthy
|
|
102
|
-
if (filter.hasOwnProperty("searchUserAccess")) {
|
|
103
|
-
result.searchUserAccess = filter.searchUserAccess;
|
|
104
|
-
}
|
|
105
|
-
if (filter.term) {
|
|
106
|
-
result.term = filter.term;
|
|
107
|
-
}
|
|
108
|
-
return result;
|
|
109
|
-
}
|
|
110
|
-
exports.expandGroupFilter = expandGroupFilter;
|
|
111
|
-
/**
|
|
112
|
-
* @private
|
|
113
|
-
* Serialize an `IGroupFilterDefinition` into an `ISearchOptions` for use
|
|
114
|
-
* with `searchGroups`
|
|
115
|
-
* @param filter
|
|
116
|
-
* @returns
|
|
117
|
-
*/
|
|
118
|
-
function serializeGroupFilterForPortal(filter) {
|
|
119
|
-
// TODO: Remove with _searchContent
|
|
120
|
-
__1.Logger.warn(`DEPRECATION: serializeGroupFilterForPortal will be removed. Work with IFilterGroups<"group"> and hubSearch() instead`);
|
|
121
|
-
let result = {
|
|
122
|
-
q: "",
|
|
123
|
-
filter: "",
|
|
124
|
-
};
|
|
125
|
-
const dateProps = ["created", "modified"];
|
|
126
|
-
const specialProps = ["term", "searchUserAccess", "filterType", ...dateProps];
|
|
127
|
-
Object.entries(filter).forEach(([key, value]) => {
|
|
128
|
-
// MatchOptions fields
|
|
129
|
-
if (!specialProps.includes(key)) {
|
|
130
|
-
result = _1.mergeSearchOptions(result, _1.serializeMatchOptions(key, value), "AND");
|
|
131
|
-
}
|
|
132
|
-
// Dates only go into q
|
|
133
|
-
if (dateProps.includes(key)) {
|
|
134
|
-
result = _1.mergeSearchOptions(result, _1.serializeDateRange(key, value), "AND");
|
|
135
|
-
}
|
|
136
|
-
});
|
|
137
|
-
// searchUserAccess is also a top-level property
|
|
138
|
-
if (filter.hasOwnProperty("searchUserAccess")) {
|
|
139
|
-
result.searchUserAccess = filter.searchUserAccess;
|
|
140
|
-
}
|
|
141
|
-
// add the term
|
|
142
|
-
if (filter.term) {
|
|
143
|
-
result.q = `${filter.term} ${result.q}`.trim();
|
|
144
|
-
}
|
|
145
|
-
return result;
|
|
146
|
-
}
|
|
147
|
-
exports.serializeGroupFilterForPortal = serializeGroupFilterForPortal;
|
|
148
|
-
//# sourceMappingURL=group-utils.js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AC;SACH;QACD,uBAAuB;QACvB,IAAI,SAAS,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;YAC3B,MAAM,GAAG,qBAAkB,CACzB,MAAM,EACN,qBAAkB,CAAC,GAAG,EAAE,KAAK,CAAC,EAC9B,KAAK,CACN,CAAC;SACH;IACH,CAAC,CAAC,CAAC;IACH,gDAAgD;IAChD,IAAI,MAAM,CAAC,cAAc,CAAC,kBAAkB,CAAC,EAAE;QAC7C,MAAM,CAAC,gBAAgB,GAAG,MAAM,CAAC,gBAAgB,CAAC;KACnD;IACD,eAAe;IACf,IAAI,MAAM,CAAC,IAAI,EAAE;QACf,MAAM,CAAC,CAAC,GAAG,GAAG,MAAM,CAAC,IAAI,IAAI,MAAM,CAAC,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC;KAChD;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAzCD,sEAyCC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ICatalog.js","sourceRoot":"","sources":["../../../../src/search/types/ICatalog.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ICollection.js","sourceRoot":"","sources":["../../../../src/search/types/ICollection.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"IFacet.js","sourceRoot":"","sources":["../../../../src/search/types/IFacet.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"IFacetOption.js","sourceRoot":"","sources":["../../../../src/search/types/IFacetOption.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"IHubApiSearchRequest.js","sourceRoot":"","sources":["../../../../src/search/types/IHubApiSearchRequest.ts"],"names":[],"mappings":""}
|
|
@@ -1,145 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.serializeUserFilterForPortal = exports.expandUserFilter = exports.mergeUserFilters = void 0;
|
|
4
|
-
const __1 = require("..");
|
|
5
|
-
// TODO: Remove with _searchContent
|
|
6
|
-
/**
|
|
7
|
-
*
|
|
8
|
-
* Merge `Filter<"user">` objects
|
|
9
|
-
*
|
|
10
|
-
* Useful in components which may get partial filters from a variety of
|
|
11
|
-
* sub-components, which are then combined into a single filter prior
|
|
12
|
-
* to executing the search.
|
|
13
|
-
* @param filters
|
|
14
|
-
* @returns
|
|
15
|
-
*/
|
|
16
|
-
function mergeUserFilters(filters) {
|
|
17
|
-
// TODO: Remove with _searchContent
|
|
18
|
-
__1.Logger.warn(`DEPRECATION: mergeUserFilters will be removed. Work with IFilterGroups<"user"> and hubSearch() instead`);
|
|
19
|
-
// expand all the filters so all prop types are consistent
|
|
20
|
-
const expanded = filters.map(expandUserFilter);
|
|
21
|
-
// now we can merge based on fields
|
|
22
|
-
const dateFields = ["created", "modified", "lastlogin"];
|
|
23
|
-
const specialFields = ["disabled", "term", "filterType", ...dateFields];
|
|
24
|
-
// acc is initialized as Filter<group> but also needs it
|
|
25
|
-
// in the function signature... for reasons?!
|
|
26
|
-
const result = expanded.reduce((acc, entry) => {
|
|
27
|
-
// process fields
|
|
28
|
-
Object.entries(entry).forEach(([key, value]) => {
|
|
29
|
-
// Note: getProp/setProp are used to get around
|
|
30
|
-
// typescript issues with string indexing
|
|
31
|
-
if (acc.hasOwnProperty(key)) {
|
|
32
|
-
const existingValue = __1.getProp(acc, key);
|
|
33
|
-
// if the key is not to a special field
|
|
34
|
-
if (!specialFields.includes(key)) {
|
|
35
|
-
// treat as an IMatchOptions
|
|
36
|
-
__1.setProp(key, __1.mergeMatchOptions(existingValue, value), acc);
|
|
37
|
-
}
|
|
38
|
-
else if (dateFields.includes(key)) {
|
|
39
|
-
// treat as IDateRange
|
|
40
|
-
__1.setProp(key, __1.mergeDateRange(existingValue, value), acc);
|
|
41
|
-
}
|
|
42
|
-
else if (key === "term") {
|
|
43
|
-
// append terms
|
|
44
|
-
acc[key] = `${acc[key]} ${value}`;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
else {
|
|
48
|
-
// Acc does not have an entry for this yet
|
|
49
|
-
// so just clone it
|
|
50
|
-
__1.setProp(key, __1.cloneObject(value), acc);
|
|
51
|
-
}
|
|
52
|
-
});
|
|
53
|
-
return acc;
|
|
54
|
-
}, {
|
|
55
|
-
filterType: "user",
|
|
56
|
-
});
|
|
57
|
-
return result;
|
|
58
|
-
}
|
|
59
|
-
exports.mergeUserFilters = mergeUserFilters;
|
|
60
|
-
/**
|
|
61
|
-
* Prior to serialization into the query syntax for the backing APIs, we first expand [Filters](../Filter)
|
|
62
|
-
*
|
|
63
|
-
* Filter's can express their intent in a very terse form, but to ensure consistent structures
|
|
64
|
-
* we expand them into their more verbose form.
|
|
65
|
-
*
|
|
66
|
-
* i.e. `firstname: "John"` expands into `firstname: { any: ["John"]}`
|
|
67
|
-
*
|
|
68
|
-
* - Fields defined as `string | string[] | MatchOptions` will be converted to a `MatchOptions`
|
|
69
|
-
* - RelativeDate fields are converted to DateRange<number>
|
|
70
|
-
* @param filter
|
|
71
|
-
* @returns
|
|
72
|
-
*/
|
|
73
|
-
function expandUserFilter(filter) {
|
|
74
|
-
// TODO: Remove with _searchContent
|
|
75
|
-
__1.Logger.warn(`DEPRECATION: expandUserFilter will be removed. Work with IFilterGroups<"user"> and hubSearch() instead`);
|
|
76
|
-
const result = {};
|
|
77
|
-
const dateProps = ["created", "modified", "lastlogin"];
|
|
78
|
-
const specialProps = ["disabled", "term", ...dateProps];
|
|
79
|
-
Object.entries(filter).forEach(([key, value]) => {
|
|
80
|
-
// handle Matchish fields
|
|
81
|
-
if (!specialProps.includes(key)) {
|
|
82
|
-
// setProp side-steps typescript complaining
|
|
83
|
-
__1.setProp(key, __1.valueToMatchOptions(value), result);
|
|
84
|
-
}
|
|
85
|
-
// Handle date fields
|
|
86
|
-
if (dateProps.includes(key)) {
|
|
87
|
-
const dateFieldValue = __1.cloneObject(__1.getProp(filter, key));
|
|
88
|
-
if (__1.getProp(filter, `${key}.type`) === "relative-date") {
|
|
89
|
-
__1.setProp(key, __1.relativeDateToDateRange(dateFieldValue), result);
|
|
90
|
-
}
|
|
91
|
-
else {
|
|
92
|
-
__1.setProp(key, dateFieldValue, result);
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
});
|
|
96
|
-
// disabled is boolean, so we check if the prop exists
|
|
97
|
-
// vs checking if the value is truthy
|
|
98
|
-
if (filter.hasOwnProperty("disabled")) {
|
|
99
|
-
result.disabled = filter.disabled;
|
|
100
|
-
}
|
|
101
|
-
if (filter.term) {
|
|
102
|
-
result.term = filter.term;
|
|
103
|
-
}
|
|
104
|
-
return result;
|
|
105
|
-
}
|
|
106
|
-
exports.expandUserFilter = expandUserFilter;
|
|
107
|
-
/**
|
|
108
|
-
* @private
|
|
109
|
-
* Serialize an `IUserFilterDefinition` into an `ISearchOptions` for use
|
|
110
|
-
* with `searchUsers`
|
|
111
|
-
* @param filter
|
|
112
|
-
* @returns
|
|
113
|
-
*/
|
|
114
|
-
function serializeUserFilterForPortal(filter) {
|
|
115
|
-
// TODO: Remove with _searchContent
|
|
116
|
-
__1.Logger.warn(`DEPRECATION: serializeUserFilterForPortal will be removed. Work with IFilterGroups<"user"> and hubSearch() instead`);
|
|
117
|
-
let result = {
|
|
118
|
-
q: "",
|
|
119
|
-
filter: "",
|
|
120
|
-
};
|
|
121
|
-
const dateProps = ["created", "modified", "lastlogin"];
|
|
122
|
-
const specialProps = ["term", "filterType", ...dateProps];
|
|
123
|
-
Object.entries(filter).forEach(([key, value]) => {
|
|
124
|
-
// MatchOptions fields
|
|
125
|
-
if (!specialProps.includes(key)) {
|
|
126
|
-
result = __1.mergeSearchOptions(result, __1.serializeMatchOptions(key, value), "AND");
|
|
127
|
-
}
|
|
128
|
-
// Dates only go into q
|
|
129
|
-
if (dateProps.includes(key)) {
|
|
130
|
-
result = __1.mergeSearchOptions(result, __1.serializeDateRange(key, value), "AND");
|
|
131
|
-
}
|
|
132
|
-
});
|
|
133
|
-
// disabled is also a top-level property
|
|
134
|
-
if (filter.hasOwnProperty("disabled")) {
|
|
135
|
-
result.disabled = filter.disabled;
|
|
136
|
-
}
|
|
137
|
-
// add the term
|
|
138
|
-
if (filter.term) {
|
|
139
|
-
// Note: this is slightly different from other types
|
|
140
|
-
result.q = `(${filter.term}) ${result.q}`.trim();
|
|
141
|
-
}
|
|
142
|
-
return result;
|
|
143
|
-
}
|
|
144
|
-
exports.serializeUserFilterForPortal = serializeUserFilterForPortal;
|
|
145
|
-
//# sourceMappingURL=user-utils.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"user-utils.js","sourceRoot":"","sources":["../../../src/search/user-utils.ts"],"names":[],"mappings":";;;AACA,0BAcY;AAEZ,mCAAmC;AACnC;;;;;;;;;GASG;AACH,SAAgB,gBAAgB,CAC9B,OAA8B;IAE9B,mCAAmC;IACnC,UAAM,CAAC,IAAI,CACT,wGAAwG,CACzG,CAAC;IACF,0DAA0D;IAC1D,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;IAC/C,mCAAmC;IACnC,MAAM,UAAU,GAAG,CAAC,SAAS,EAAE,UAAU,EAAE,WAAW,CAAC,CAAC;IACxD,MAAM,aAAa,GAAG,CAAC,UAAU,EAAE,MAAM,EAAE,YAAY,EAAE,GAAG,UAAU,CAAC,CAAC;IAExE,wDAAwD;IACxD,6CAA6C;IAC7C,MAAM,MAAM,GAAG,QAAQ,CAAC,MAAM,CAC5B,CAAC,GAAmB,EAAE,KAAK,EAAE,EAAE;QAC7B,iBAAiB;QACjB,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE;YAC7C,+CAA+C;YAC/C,yCAAyC;YAEzC,IAAI,GAAG,CAAC,cAAc,CA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,CAAC;IACvD,MAAM,YAAY,GAAG,CAAC,MAAM,EAAE,YAAY,EAAE,GAAG,SAAS,CAAC,CAAC;IAC1D,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE;QAC9C,sBAAsB;QACtB,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;YAC/B,MAAM,GAAG,sBAAkB,CACzB,MAAM,EACN,yBAAqB,CAAC,GAAG,EAAE,KAAK,CAAC,EACjC,KAAK,CACN,CAAC;SACH;QACD,uBAAuB;QACvB,IAAI,SAAS,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;YAC3B,MAAM,GAAG,sBAAkB,CACzB,MAAM,EACN,sBAAkB,CAAC,GAAG,EAAE,KAAK,CAAC,EAC9B,KAAK,CACN,CAAC;SACH;IACH,CAAC,CAAC,CAAC;IACH,wCAAwC;IACxC,IAAI,MAAM,CAAC,cAAc,CAAC,UAAU,CAAC,EAAE;QACrC,MAAM,CAAC,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;KACnC;IACD,eAAe;IACf,IAAI,MAAM,CAAC,IAAI,EAAE;QACf,oDAAoD;QACpD,MAAM,CAAC,CAAC,GAAG,IAAI,MAAM,CAAC,IAAI,KAAK,MAAM,CAAC,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC;KAClD;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AA3CD,oEA2CC"}
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import { IFacet, IFacetState, ISortOption } from "../types";
|
|
2
|
-
/**
|
|
3
|
-
* @private
|
|
4
|
-
* Apply the sortState to SortOptions
|
|
5
|
-
*
|
|
6
|
-
* @param sortOptions
|
|
7
|
-
* @param sortState
|
|
8
|
-
* @returns
|
|
9
|
-
*/
|
|
10
|
-
export declare function applySortState(sortOptions: ISortOption, sortState: string): ISortOption;
|
|
11
|
-
/**
|
|
12
|
-
* @private
|
|
13
|
-
* Apply FacetState to a Facet
|
|
14
|
-
* @param facet
|
|
15
|
-
* @param state
|
|
16
|
-
* @returns
|
|
17
|
-
*/
|
|
18
|
-
export declare function applyFacetState(facet: IFacet, state: IFacetState): IFacet;
|
|
19
|
-
/**
|
|
20
|
-
* @private
|
|
21
|
-
* Apply the Facet State onto a single-select facet
|
|
22
|
-
*
|
|
23
|
-
* Intentionally mutates the facet.
|
|
24
|
-
* @param facet
|
|
25
|
-
* @param state
|
|
26
|
-
* @returns
|
|
27
|
-
*/
|
|
28
|
-
export declare function applySingleSelectFacetState(facet: IFacet, state: IFacetState): IFacet;
|
|
29
|
-
/**
|
|
30
|
-
* @private
|
|
31
|
-
* Serialize single-select facet into IFacetState
|
|
32
|
-
* @param facet
|
|
33
|
-
* @returns
|
|
34
|
-
*/
|
|
35
|
-
export declare function serializeSingleSelectFacetState(facet: IFacet): IFacetState;
|
|
36
|
-
/**
|
|
37
|
-
* @private
|
|
38
|
-
* Apply the Facet State onto a multi-select Facet
|
|
39
|
-
*
|
|
40
|
-
* Intentionally mutates the facet.
|
|
41
|
-
* @param facet
|
|
42
|
-
* @param state
|
|
43
|
-
* @returns
|
|
44
|
-
*/
|
|
45
|
-
export declare function applyMultiSelectFacetState(facet: IFacet, state: IFacetState): IFacet;
|
|
46
|
-
/**
|
|
47
|
-
* @private
|
|
48
|
-
* Serialize multi-select facet into IFacetState
|
|
49
|
-
* @param facet
|
|
50
|
-
* @returns
|
|
51
|
-
*/
|
|
52
|
-
export declare function serializeMultiSelectFacetState(facet: IFacet): IFacetState;
|
|
53
|
-
/**
|
|
54
|
-
* @private
|
|
55
|
-
* Serialize the state of the SortOption into a key/value pair
|
|
56
|
-
*
|
|
57
|
-
* Called from the Sort component
|
|
58
|
-
* @param sort
|
|
59
|
-
* @returns
|
|
60
|
-
*/
|
|
61
|
-
export declare function serializeSortState(sort: ISortOption): string;
|
|
62
|
-
/**
|
|
63
|
-
* @private
|
|
64
|
-
* Serialize the state of a facet into a key/value pair
|
|
65
|
-
*
|
|
66
|
-
* Called from the various facet components
|
|
67
|
-
* @param facet
|
|
68
|
-
* @returns
|
|
69
|
-
*/
|
|
70
|
-
export declare function serializeFacetState(facet: IFacet): IFacetState;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { Filter, IHubSearchOptions } from "./types";
|
|
2
|
-
import { IHubContent, ISearchResponse } from "..";
|
|
3
|
-
/**
|
|
4
|
-
* @private
|
|
5
|
-
* Search for content via the Portal or Hub API
|
|
6
|
-
* @param filter
|
|
7
|
-
* @param options
|
|
8
|
-
*/
|
|
9
|
-
export declare function _searchContent(filter: Filter<"content">, options: IHubSearchOptions): Promise<ISearchResponse<IHubContent>>;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { IGroup } from "@esri/arcgis-rest-portal";
|
|
2
|
-
import { Filter, IHubSearchOptions, IFacet } from "./types";
|
|
3
|
-
import { ISearchResponse } from "..";
|
|
4
|
-
export interface IGroupSearchResult {
|
|
5
|
-
groups: IGroup[];
|
|
6
|
-
facets: IFacet[];
|
|
7
|
-
}
|
|
8
|
-
/**
|
|
9
|
-
* @private
|
|
10
|
-
* Search Groups using Filter<"group">
|
|
11
|
-
*
|
|
12
|
-
* Currently just returns ISearchResult<IGroup>
|
|
13
|
-
* @param filter
|
|
14
|
-
* @param options
|
|
15
|
-
* @returns
|
|
16
|
-
*/
|
|
17
|
-
export declare function _searchGroups(filter: Filter<"group">, options: IHubSearchOptions): Promise<ISearchResponse<IGroup>>;
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { IUser, UserSession } from "@esri/arcgis-rest-auth";
|
|
2
|
-
import { Filter, IHubSearchOptions, ISearchResponse } from "..";
|
|
3
|
-
/**
|
|
4
|
-
* Extends IHubSearchOptions to make auth mandatory
|
|
5
|
-
*/
|
|
6
|
-
export interface IAuthenticatedHubSearchOptions extends IHubSearchOptions {
|
|
7
|
-
authentication: UserSession;
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* Extends `IUser` with url optional props for the user's
|
|
11
|
-
* profile and thumbnail
|
|
12
|
-
*/
|
|
13
|
-
export interface IHubUser extends IUser {
|
|
14
|
-
profileUrl?: string;
|
|
15
|
-
thumbnailUrl?: string;
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* @private
|
|
19
|
-
* Search for Users via the Portal API.
|
|
20
|
-
*
|
|
21
|
-
* **Note** Authentication is required
|
|
22
|
-
*
|
|
23
|
-
* Another trivial comment to force a release
|
|
24
|
-
*
|
|
25
|
-
* Note: in the future, there may be options to search via
|
|
26
|
-
* a Hub specific API
|
|
27
|
-
* @param filter
|
|
28
|
-
* @param options
|
|
29
|
-
* @returns
|
|
30
|
-
*/
|
|
31
|
-
export declare function _searchUsers(filter: Filter<"user">, options: IAuthenticatedHubSearchOptions): Promise<ISearchResponse<IHubUser>>;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { ICollection, ICollectionState } from "./types";
|
|
2
|
-
/**
|
|
3
|
-
* Apply ICollectionState to an ICollection
|
|
4
|
-
*
|
|
5
|
-
* Typically used in a Gallery or Catalog component to
|
|
6
|
-
* set the inital state, based on values deserialized
|
|
7
|
-
* from a query string
|
|
8
|
-
* @param collection
|
|
9
|
-
* @param state
|
|
10
|
-
* @returns
|
|
11
|
-
*/
|
|
12
|
-
export declare function applyCollectionState(collection: ICollection, state: ICollectionState): ICollection;
|
|
13
|
-
/**
|
|
14
|
-
* Serialize the current state of a collection into a hash that
|
|
15
|
-
* can be converted into a query string
|
|
16
|
-
* @param collection
|
|
17
|
-
* @returns
|
|
18
|
-
*/
|
|
19
|
-
export declare function serializeCollectionState(collection: ICollection): ICollectionState;
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
import { IItem, ISearchOptions, ISearchResult } from "@esri/arcgis-rest-portal";
|
|
2
|
-
import { IContentFilter, IContentFilterDefinition, Filter } from "./types/types";
|
|
3
|
-
import { IFacet } from "./types/IFacet";
|
|
4
|
-
/**
|
|
5
|
-
* @private
|
|
6
|
-
* Convert portal search response to facets
|
|
7
|
-
* Note: Only applicable to an item search
|
|
8
|
-
* @param response
|
|
9
|
-
* @returns
|
|
10
|
-
*/
|
|
11
|
-
export declare function convertPortalResponseToFacets(response: ISearchResult<IItem>, operation?: "OR" | "AND"): IFacet[];
|
|
12
|
-
/**
|
|
13
|
-
* @private
|
|
14
|
-
* Convert portal search response to facets
|
|
15
|
-
* Note: Only applicable to an item search
|
|
16
|
-
* @param response
|
|
17
|
-
* @returns
|
|
18
|
-
*/
|
|
19
|
-
export declare function convertPortalItemResponseToFacets(response: ISearchResult<IItem>, operation?: "OR" | "AND", optionProp?: "filter" | "filters"): IFacet[];
|
|
20
|
-
/**
|
|
21
|
-
* Merge `Filter<"content">` objects
|
|
22
|
-
*
|
|
23
|
-
* Useful in components which may get partial filters from a variety of
|
|
24
|
-
* sub-components, which are then combined into a single filter prior
|
|
25
|
-
* to executing the search.
|
|
26
|
-
* @param filters
|
|
27
|
-
* @returns
|
|
28
|
-
*/
|
|
29
|
-
export declare function mergeContentFilter(filters: Array<Filter<"content">>): Filter<"content">;
|
|
30
|
-
/**
|
|
31
|
-
* Prior to serialization into the query syntax for the backing APIs, we first expand [Filters](../Filter)
|
|
32
|
-
*
|
|
33
|
-
* Filter's can express their intent in a very terse form, but to ensure consistent structures
|
|
34
|
-
* we expand them into their more verbose form.
|
|
35
|
-
*
|
|
36
|
-
* i.e. `title: "Water"` expands into `title: { any: ["Water"]}`
|
|
37
|
-
*
|
|
38
|
-
* - "well known" type values are expanded
|
|
39
|
-
* - i.e. `type: "$storymap"` expands into two `subFilter` entries
|
|
40
|
-
* - Fields defined as `string | string[] | MatchOptions` will be converted to a `MatchOptions`
|
|
41
|
-
* - RelativeDate fields are converted to DateRange<number>
|
|
42
|
-
*
|
|
43
|
-
* @param filter
|
|
44
|
-
* @returns
|
|
45
|
-
*/
|
|
46
|
-
export declare function expandContentFilter(filter: Filter<"content">): IContentFilter;
|
|
47
|
-
/**
|
|
48
|
-
* @private
|
|
49
|
-
* Expand from a well-known "type" into it's longer form
|
|
50
|
-
*
|
|
51
|
-
* i.e. `type: "$storymap"` expands into two subFilters entries
|
|
52
|
-
*
|
|
53
|
-
* @param filter
|
|
54
|
-
* @returns
|
|
55
|
-
*/
|
|
56
|
-
export declare function expandTypeField(filter: Filter<"content">): Filter<"content">;
|
|
57
|
-
/**
|
|
58
|
-
* @private
|
|
59
|
-
* Convert a `ContentFilterDefinition` to a `ContentFilter`
|
|
60
|
-
*
|
|
61
|
-
* ContentFilter is a narrower version of ContentFilterDefinition, without
|
|
62
|
-
* the union types. Using a ContentFilter makes working with the structure
|
|
63
|
-
* in typescript much easier.
|
|
64
|
-
*
|
|
65
|
-
* @param filter
|
|
66
|
-
* @returns
|
|
67
|
-
*/
|
|
68
|
-
export declare function convertContentDefinitionToFilter(filter: IContentFilterDefinition): IContentFilter;
|
|
69
|
-
/**
|
|
70
|
-
* @private
|
|
71
|
-
* Serialize a `ContentFilter` into an `ISearchOptions` for use with `searchItems`
|
|
72
|
-
* @param filter
|
|
73
|
-
* @returns
|
|
74
|
-
*/
|
|
75
|
-
export declare function serializeContentFilterForPortal(filter: IContentFilter): ISearchOptions;
|
|
76
|
-
/**
|
|
77
|
-
* @private
|
|
78
|
-
* Convert a ContentFilter to a SearchOptions
|
|
79
|
-
*
|
|
80
|
-
* @param filter
|
|
81
|
-
* @returns
|
|
82
|
-
*/
|
|
83
|
-
export declare function convertContentFilterToSearchOptions(filter: IContentFilter): ISearchOptions;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { Filter, IFilterGroup, FilterType } from "./types";
|
|
2
|
-
/**
|
|
3
|
-
* Determine if a Filter is "empty"
|
|
4
|
-
* @param filter
|
|
5
|
-
* @returns
|
|
6
|
-
*/
|
|
7
|
-
export declare function isEmptyFilter(filter: Filter<FilterType>): boolean;
|
|
8
|
-
/**
|
|
9
|
-
* Determine if a filterGroup is "empty"
|
|
10
|
-
* @param filterGroup
|
|
11
|
-
* @returns
|
|
12
|
-
*/
|
|
13
|
-
export declare function isEmptyFilterGroup(filterGroup: IFilterGroup<FilterType>): boolean;
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { ISearchOptions } from "@esri/arcgis-rest-portal";
|
|
2
|
-
import { Filter, IGroupFilterDefinition } from ".";
|
|
3
|
-
/**
|
|
4
|
-
*
|
|
5
|
-
* Merge `Filter<"group">` objects
|
|
6
|
-
*
|
|
7
|
-
* Useful in components which may get partial filters from a variety of
|
|
8
|
-
* sub-components, which are then combined into a single filter prior
|
|
9
|
-
* to executing the search.
|
|
10
|
-
* @param filters
|
|
11
|
-
* @returns
|
|
12
|
-
*/
|
|
13
|
-
export declare function mergeGroupFilters(filters: Array<Filter<"group">>): Filter<"group">;
|
|
14
|
-
/**
|
|
15
|
-
* Prior to serialization into the query syntax for the backing APIs, we first expand [Filters](../Filter)
|
|
16
|
-
*
|
|
17
|
-
* Filter's can express their intent in a very terse form, but to ensure consistent structures
|
|
18
|
-
* we expand them into their more verbose form.
|
|
19
|
-
*
|
|
20
|
-
* i.e. `title: "Water"` expands into `title: { any: ["Water"]}`
|
|
21
|
-
*
|
|
22
|
-
* - Fields defined as `string | string[] | MatchOptions` will be converted to a `MatchOptions`
|
|
23
|
-
* - RelativeDate fields are converted to DateRange<number>
|
|
24
|
-
*
|
|
25
|
-
* @param filter
|
|
26
|
-
* @returns
|
|
27
|
-
*/
|
|
28
|
-
export declare function expandGroupFilter(filter: Filter<"group">): IGroupFilterDefinition;
|
|
29
|
-
/**
|
|
30
|
-
* @private
|
|
31
|
-
* Serialize an `IGroupFilterDefinition` into an `ISearchOptions` for use
|
|
32
|
-
* with `searchGroups`
|
|
33
|
-
* @param filter
|
|
34
|
-
* @returns
|
|
35
|
-
*/
|
|
36
|
-
export declare function serializeGroupFilterForPortal(filter: IGroupFilterDefinition): ISearchOptions;
|