@esri/hub-common 9.49.1 → 10.0.0-next.3
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/categories.js +4 -2
- package/dist/es2017/categories.js.map +1 -1
- package/dist/es2017/collections.js +3 -8
- package/dist/es2017/collections.js.map +1 -1
- package/dist/es2017/content/compose.js +1 -18
- package/dist/es2017/content/compose.js.map +1 -1
- package/dist/es2017/content/get-family.js +1 -3
- package/dist/es2017/content/get-family.js.map +1 -1
- package/dist/es2017/content/index.js +8 -71
- package/dist/es2017/content/index.js.map +1 -1
- package/dist/es2017/extent.js +1 -14
- package/dist/es2017/extent.js.map +1 -1
- package/dist/es2017/index.js +1 -0
- package/dist/es2017/index.js.map +1 -1
- package/dist/es2017/projects/HubProjectManager.js +0 -8
- package/dist/es2017/projects/HubProjectManager.js.map +1 -1
- package/dist/es2017/projects/HubProjects.js.map +1 -1
- 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 +0 -1
- package/dist/es2017/search/_internal/portalSearchGroups.js.map +1 -1
- package/dist/es2017/search/_internal/portalSearchItems.js +4 -29
- package/dist/es2017/search/_internal/portalSearchItems.js.map +1 -1
- package/dist/es2017/search/_internal/portalSearchUsers.js +0 -1
- package/dist/es2017/search/_internal/portalSearchUsers.js.map +1 -1
- package/dist/es2017/search/hubSearch.js +0 -16
- package/dist/es2017/search/hubSearch.js.map +1 -1
- package/dist/es2017/search/index.js +0 -9
- package/dist/es2017/search/index.js.map +1 -1
- package/dist/es2017/search/serializeQueryForPortal.js +0 -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 +0 -8
- package/dist/es2017/search/upgradeCatalogSchema.js.map +1 -1
- package/dist/es2017/search/utils.js +1 -207
- package/dist/es2017/search/utils.js.map +1 -1
- package/dist/es2017/sites/fetchSiteModel.js +0 -9
- package/dist/es2017/sites/fetchSiteModel.js.map +1 -1
- package/dist/es2017/types.js.map +1 -1
- package/dist/esm/categories.js +4 -2
- package/dist/esm/categories.js.map +1 -1
- package/dist/esm/collections.js +3 -8
- package/dist/esm/collections.js.map +1 -1
- package/dist/esm/content/compose.js +1 -18
- package/dist/esm/content/compose.js.map +1 -1
- package/dist/esm/content/get-family.js +1 -3
- package/dist/esm/content/get-family.js.map +1 -1
- package/dist/esm/content/index.js +8 -71
- package/dist/esm/content/index.js.map +1 -1
- package/dist/esm/extent.js +1 -14
- package/dist/esm/extent.js.map +1 -1
- package/dist/esm/index.js +1 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/projects/HubProjectManager.js +0 -12
- package/dist/esm/projects/HubProjectManager.js.map +1 -1
- package/dist/esm/projects/HubProjects.js.map +1 -1
- 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 +0 -1
- package/dist/esm/search/_internal/portalSearchGroups.js.map +1 -1
- package/dist/esm/search/_internal/portalSearchItems.js +5 -29
- package/dist/esm/search/_internal/portalSearchItems.js.map +1 -1
- package/dist/esm/search/_internal/portalSearchUsers.js +0 -1
- package/dist/esm/search/_internal/portalSearchUsers.js.map +1 -1
- package/dist/esm/search/hubSearch.js +0 -20
- package/dist/esm/search/hubSearch.js.map +1 -1
- package/dist/esm/search/index.js +0 -9
- package/dist/esm/search/index.js.map +1 -1
- package/dist/esm/search/serializeQueryForPortal.js +0 -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 +0 -8
- package/dist/esm/search/upgradeCatalogSchema.js.map +1 -1
- package/dist/esm/search/utils.js +1 -204
- package/dist/esm/search/utils.js.map +1 -1
- package/dist/esm/sites/fetchSiteModel.js +0 -9
- package/dist/esm/sites/fetchSiteModel.js.map +1 -1
- package/dist/esm/types.js.map +1 -1
- package/dist/node/categories.js +4 -2
- package/dist/node/categories.js.map +1 -1
- package/dist/node/collections.js +3 -8
- package/dist/node/collections.js.map +1 -1
- package/dist/node/content/compose.js +1 -18
- package/dist/node/content/compose.js.map +1 -1
- package/dist/node/content/get-family.js +1 -3
- package/dist/node/content/get-family.js.map +1 -1
- package/dist/node/content/index.js +9 -73
- package/dist/node/content/index.js.map +1 -1
- package/dist/node/extent.js +2 -16
- package/dist/node/extent.js.map +1 -1
- package/dist/node/index.js +1 -0
- package/dist/node/index.js.map +1 -1
- package/dist/node/projects/HubProjectManager.js +0 -8
- package/dist/node/projects/HubProjectManager.js.map +1 -1
- package/dist/node/projects/HubProjects.js.map +1 -1
- 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 +0 -1
- package/dist/node/search/_internal/portalSearchGroups.js.map +1 -1
- package/dist/node/search/_internal/portalSearchItems.js +4 -29
- package/dist/node/search/_internal/portalSearchItems.js.map +1 -1
- package/dist/node/search/_internal/portalSearchUsers.js +0 -1
- package/dist/node/search/_internal/portalSearchUsers.js.map +1 -1
- package/dist/node/search/hubSearch.js +1 -18
- package/dist/node/search/hubSearch.js.map +1 -1
- package/dist/node/search/index.js +0 -9
- package/dist/node/search/index.js.map +1 -1
- package/dist/node/search/serializeQueryForPortal.js +0 -1
- 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 +1 -10
- package/dist/node/search/upgradeCatalogSchema.js.map +1 -1
- package/dist/node/search/utils.js +1 -213
- package/dist/node/search/utils.js.map +1 -1
- package/dist/node/sites/fetchSiteModel.js +1 -11
- package/dist/node/sites/fetchSiteModel.js.map +1 -1
- package/dist/node/types.js.map +1 -1
- package/dist/types/collections.d.ts +1 -6
- package/dist/types/content/_internal.d.ts +0 -3
- package/dist/types/content/get-family.d.ts +1 -1
- package/dist/types/content/index.d.ts +3 -36
- package/dist/types/core/types/IHubContent.d.ts +0 -3
- package/dist/types/core/types/IServerEnrichments.d.ts +0 -2
- package/dist/types/extent.d.ts +0 -2
- package/dist/types/projects/HubProjectManager.d.ts +0 -1
- 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/hubSearch.d.ts +0 -13
- package/dist/types/search/index.d.ts +0 -9
- package/dist/types/search/types/IHubSearchOptions.d.ts +1 -17
- package/dist/types/search/types/IHubSearchResponse.d.ts +0 -5
- package/dist/types/search/types/IHubSearchResult.d.ts +0 -39
- 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 +0 -5
- package/dist/types/search/utils.d.ts +2 -58
- package/dist/types/sites/fetchSiteModel.d.ts +2 -6
- package/dist/types/types.d.ts +0 -70
- package/dist/umd/common.umd.js +42 -1900
- package/dist/umd/common.umd.js.map +1 -1
- package/package.json +1 -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/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/hub-api-search.js +0 -19
- package/dist/es2017/search/hub-api-search.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/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/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/hub-api-search.js +0 -20
- package/dist/esm/search/hub-api-search.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/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/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/hub-api-search.js +0 -23
- package/dist/node/search/hub-api-search.js.map +0 -1
- package/dist/node/search/types/ICatalog.js +0 -3
- package/dist/node/search/types/ICatalog.js.map +0 -1
- package/dist/node/search/types/ICollection.js +0 -3
- 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/filter-utils.d.ts +0 -13
- package/dist/types/search/group-utils.d.ts +0 -36
- package/dist/types/search/hub-api-search.d.ts +0 -10
- 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,23 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.hubApiSearch = void 0;
|
|
4
|
-
const __1 = require("..");
|
|
5
|
-
/**
|
|
6
|
-
* Search the Hub API
|
|
7
|
-
*
|
|
8
|
-
* @param requestOptions
|
|
9
|
-
* @returns JSONAPI response
|
|
10
|
-
*/
|
|
11
|
-
function hubApiSearch(requestOptions) {
|
|
12
|
-
// derive default headers if authentication
|
|
13
|
-
const authentication = requestOptions.authentication;
|
|
14
|
-
const headers = authentication &&
|
|
15
|
-
authentication.serialize && { authentication: authentication.serialize() };
|
|
16
|
-
const defaults = {
|
|
17
|
-
headers,
|
|
18
|
-
httpMethod: "POST",
|
|
19
|
-
};
|
|
20
|
-
return __1.hubApiRequest("/search", Object.assign(Object.assign({}, defaults), requestOptions));
|
|
21
|
-
}
|
|
22
|
-
exports.hubApiSearch = hubApiSearch;
|
|
23
|
-
//# sourceMappingURL=hub-api-search.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hub-api-search.js","sourceRoot":"","sources":["../../../src/search/hub-api-search.ts"],"names":[],"mappings":";;;AAAA,0BAAwE;AACxE;;;;;GAKG;AACH,SAAgB,YAAY,CAC1B,cAAkC;IAElC,2CAA2C;IAC3C,MAAM,cAAc,GAAG,cAAc,CAAC,cAAc,CAAC;IACrD,MAAM,OAAO,GAAG,cAAc;QAC5B,cAAc,CAAC,SAAS,IAAI,EAAE,cAAc,EAAE,cAAc,CAAC,SAAS,EAAE,EAAE,CAAC;IAC7E,MAAM,QAAQ,GAAuB;QACnC,OAAO;QACP,UAAU,EAAE,MAAM;KACnB,CAAC;IACF,OAAO,iBAAa,CAAC,SAAS,kCACzB,QAAQ,GACR,cAAc,EACjB,CAAC;AACL,CAAC;AAfD,oCAeC"}
|
|
@@ -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,CAAC,GAAG,CAAC,EAAE;gBAC3B,MAAM,aAAa,GAAG,WAAO,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;gBACxC,uCAAuC;gBACvC,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;oBAChC,4BAA4B;oBAC5B,WAAO,CAAC,GAAG,EAAE,qBAAiB,CAAC,aAAa,EAAE,KAAK,CAAC,EAAE,GAAG,CAAC,CAAC;iBAC5D;qBAAM,IAAI,UAAU,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;oBACnC,sBAAsB;oBACtB,WAAO,CAAC,GAAG,EAAE,kBAAc,CAAC,aAAa,EAAE,KAAK,CAAC,EAAE,GAAG,CAAC,CAAC;iBACzD;qBAAM,IAAI,GAAG,KAAK,MAAM,EAAE;oBACzB,eAAe;oBACf,GAAG,CAAC,GAAG,CAAC,GAAG,GAAG,GAAG,CAAC,GAAG,CAAC,IAAI,KAAK,EAAE,CAAC;iBACnC;aACF;iBAAM;gBACL,0CAA0C;gBAC1C,mBAAmB;gBACnB,WAAO,CAAC,GAAG,EAAE,eAAW,CAAC,KAAK,CAAC,EAAE,GAAG,CAAC,CAAC;aACvC;QACH,CAAC,CAAC,CAAC;QACH,OAAO,GAAG,CAAC;IACb,CAAC,EACD;QACE,UAAU,EAAE,MAAM;KACD,CACpB,CAAC;IAEF,OAAO,MAAM,CAAC;AAChB,CAAC;AAjDD,4CAiDC;AAED;;;;;;;;;;;;GAYG;AACH,SAAgB,gBAAgB,CAC9B,MAAsB;IAEtB,mCAAmC;IACnC,UAAM,CAAC,IAAI,CACT,wGAAwG,CACzG,CAAC;IACF,MAAM,MAAM,GAAG,EAA2B,CAAC;IAC3C,MAAM,SAAS,GAAG,CAAC,SAAS,EAAE,UAAU,EAAE,WAAW,CAAC,CAAC;IACvD,MAAM,YAAY,GAAG,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,SAAS,CAAC,CAAC;IAExD,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE;QAC9C,yBAAyB;QACzB,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;YAC/B,4CAA4C;YAC5C,WAAO,CAAC,GAAG,EAAE,uBAAmB,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC,CAAC;SAClD;QACD,qBAAqB;QACrB,IAAI,SAAS,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;YAC3B,MAAM,cAAc,GAAG,eAAW,CAAC,WAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CAAC;YACzD,IAAI,WAAO,CAAC,MAAM,EAAE,GAAG,GAAG,OAAO,CAAC,KAAK,eAAe,EAAE;gBACtD,WAAO,CAAC,GAAG,EAAE,2BAAuB,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC,CAAC;aAC/D;iBAAM;gBACL,WAAO,CAAC,GAAG,EAAE,cAAc,EAAE,MAAM,CAAC,CAAC;aACtC;SACF;IACH,CAAC,CAAC,CAAC;IAEH,sDAAsD;IACtD,qCAAqC;IACrC,IAAI,MAAM,CAAC,cAAc,CAAC,UAAU,CAAC,EAAE;QACrC,MAAM,CAAC,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;KACnC;IACD,IAAI,MAAM,CAAC,IAAI,EAAE;QACf,MAAM,CAAC,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC;KAC3B;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AArCD,4CAqCC;AAED;;;;;;GAMG;AACH,SAAgB,4BAA4B,CAC1C,MAA6B;IAE7B,mCAAmC;IACnC,UAAM,CAAC,IAAI,CACT,oHAAoH,CACrH,CAAC;IACF,IAAI,MAAM,GAAG;QACX,CAAC,EAAE,EAAE;QACL,MAAM,EAAE,EAAE;KACO,CAAC;IAEpB,MAAM,SAAS,GAAG,CAAC,SAAS,EAAE,UAAU,EAAE,WAAW,CAAC,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;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { DatasetResource, IHubRequestOptions } from "..";
|
|
2
|
-
/**
|
|
3
|
-
* Search the Hub API
|
|
4
|
-
*
|
|
5
|
-
* @param requestOptions
|
|
6
|
-
* @returns JSONAPI response
|
|
7
|
-
*/
|
|
8
|
-
export declare function hubApiSearch(requestOptions: IHubRequestOptions): Promise<{
|
|
9
|
-
data: DatasetResource[];
|
|
10
|
-
}>;
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
import { ICollection } from "./ICollection";
|
|
2
|
-
import { IFacet } from "./IFacet";
|
|
3
|
-
import { Filter, FilterType, IFilterGroup, ISortOption } from "./types";
|
|
4
|
-
/**
|
|
5
|
-
* Catalog is the definition which powers what options
|
|
6
|
-
* are available in a Gallery. It controls not only
|
|
7
|
-
* the scoping of the search, but also the options
|
|
8
|
-
* available to the UX.
|
|
9
|
-
*
|
|
10
|
-
* Thus the lower-level `searchContent`, `searchUser`, `searchGroup` functions
|
|
11
|
-
* do not take Catalogs, rather they accept [Filters](../Filter)
|
|
12
|
-
*
|
|
13
|
-
* ```ts
|
|
14
|
-
* const simpleCatalog:Catalog = {
|
|
15
|
-
* title: "Select Map",
|
|
16
|
-
* filters: [
|
|
17
|
-
* {
|
|
18
|
-
* fitlerType: "item",
|
|
19
|
-
* operation: "AND",
|
|
20
|
-
* fitlers
|
|
21
|
-
* filterType: "content",
|
|
22
|
-
* type: "Web Map",
|
|
23
|
-
* owner: "jsmith"
|
|
24
|
-
* }
|
|
25
|
-
* }
|
|
26
|
-
* ```
|
|
27
|
-
*
|
|
28
|
-
* ## Collections
|
|
29
|
-
* The key feature of a Catalog is the ability to defined [Collections](../Collection).
|
|
30
|
-
* These are essentially sub-sets of content, typically organized around
|
|
31
|
-
* generalized content types, i.e. "Datasets", vs "Maps", vs "Documents"
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
* ```ts
|
|
35
|
-
* const complex:Catalog = {
|
|
36
|
-
* filter: {
|
|
37
|
-
* type: "content",
|
|
38
|
-
* groups: ["3ef", "bc4"]
|
|
39
|
-
* },
|
|
40
|
-
* collections: [
|
|
41
|
-
* {
|
|
42
|
-
* label: "Documents",
|
|
43
|
-
* filter: {
|
|
44
|
-
* filterType: "content",
|
|
45
|
-
* type: ["Microsoft Word", "PDF", "Microsoft Excel"]
|
|
46
|
-
* }
|
|
47
|
-
* },
|
|
48
|
-
* {
|
|
49
|
-
* label: "Datasets",
|
|
50
|
-
* filter: {
|
|
51
|
-
* filterType: "content",
|
|
52
|
-
* type: ["Feature Layer", "Feature Service", "Map Service", "CSV"]
|
|
53
|
-
* }
|
|
54
|
-
* }
|
|
55
|
-
* ]
|
|
56
|
-
* }
|
|
57
|
-
* ```
|
|
58
|
-
*/
|
|
59
|
-
export interface ICatalog {
|
|
60
|
-
/**
|
|
61
|
-
* Title for the Gallery
|
|
62
|
-
*/
|
|
63
|
-
title?: string;
|
|
64
|
-
/**
|
|
65
|
-
* Scope is a set of FilterGroups which define the limits of the Catalog.
|
|
66
|
-
* Typically it is just a set of group ids, but it may be arbitrarily complex.
|
|
67
|
-
* If one was to "search a catalog", this is the description of what would be returned.
|
|
68
|
-
*/
|
|
69
|
-
scope?: Array<IFilterGroup<FilterType>>;
|
|
70
|
-
/**
|
|
71
|
-
* Filter defines the "scope" of the Catalog, typically a set of groups or orgids
|
|
72
|
-
* DEPRECATED: Use `scope`
|
|
73
|
-
*/
|
|
74
|
-
filter?: Filter<FilterType>;
|
|
75
|
-
/**
|
|
76
|
-
* Sort options to be shown in the Gallery
|
|
77
|
-
*/
|
|
78
|
-
sort?: ISortOption[];
|
|
79
|
-
/**
|
|
80
|
-
* Collections within the Catalog
|
|
81
|
-
*/
|
|
82
|
-
collections?: ICollection[];
|
|
83
|
-
/**
|
|
84
|
-
* Facets to use with all Collections
|
|
85
|
-
*/
|
|
86
|
-
facets?: IFacet[];
|
|
87
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { IFacet } from "./IFacet";
|
|
2
|
-
import { Filter, FilterType, IFilterGroup, ISortOption } from "./types";
|
|
3
|
-
/**
|
|
4
|
-
* A Collection is a subset of a Catalog, but can be used independently
|
|
5
|
-
* in Galleries
|
|
6
|
-
*/
|
|
7
|
-
export interface ICollection {
|
|
8
|
-
label: string;
|
|
9
|
-
key: string;
|
|
10
|
-
/**
|
|
11
|
-
* Filter Type used in this collection
|
|
12
|
-
*/
|
|
13
|
-
filterType?: FilterType;
|
|
14
|
-
/**
|
|
15
|
-
* Scope is a set of FilterGroups which define the limits of the Collection.
|
|
16
|
-
* Typically it is just a set of group ids, but it may be arbitrarily complex.
|
|
17
|
-
* If one was to "search the collection", this is the description of what would be returned.
|
|
18
|
-
*/
|
|
19
|
-
scope?: Array<IFilterGroup<FilterType>>;
|
|
20
|
-
/**
|
|
21
|
-
* Specify the includes to be requested when working with this collection
|
|
22
|
-
*/
|
|
23
|
-
include?: string[];
|
|
24
|
-
sortOption: ISortOption;
|
|
25
|
-
facets?: IFacet[];
|
|
26
|
-
filter?: Filter<FilterType>;
|
|
27
|
-
defaultQuery?: string;
|
|
28
|
-
}
|