@esri/hub-common 9.1.3 → 9.4.0
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/content.js +127 -19
- package/dist/es2017/content.js.map +1 -1
- package/dist/es2017/search/_searchContent.js +62 -0
- package/dist/es2017/search/_searchContent.js.map +1 -0
- package/dist/es2017/search/content-utils.js +422 -0
- package/dist/es2017/search/content-utils.js.map +1 -0
- package/dist/es2017/search/index.js +4 -0
- package/dist/es2017/search/index.js.map +1 -1
- package/dist/es2017/search/types.js +1 -0
- package/dist/es2017/search/types.js.map +1 -0
- package/dist/es2017/search/utils.js +344 -0
- package/dist/es2017/search/utils.js.map +1 -0
- package/dist/esm/content.js +129 -19
- package/dist/esm/content.js.map +1 -1
- package/dist/esm/search/_searchContent.js +70 -0
- package/dist/esm/search/_searchContent.js.map +1 -0
- package/dist/esm/search/content-utils.js +426 -0
- package/dist/esm/search/content-utils.js.map +1 -0
- package/dist/esm/search/index.js +4 -0
- package/dist/esm/search/index.js.map +1 -1
- package/dist/esm/search/types.js +1 -0
- package/dist/esm/search/types.js.map +1 -0
- package/dist/esm/search/utils.js +341 -0
- package/dist/esm/search/utils.js.map +1 -0
- package/dist/node/content.js +128 -20
- package/dist/node/content.js.map +1 -1
- package/dist/node/search/_searchContent.js +66 -0
- package/dist/node/search/_searchContent.js.map +1 -0
- package/dist/node/search/content-utils.js +432 -0
- package/dist/node/search/content-utils.js.map +1 -0
- package/dist/node/search/index.js +4 -0
- package/dist/node/search/index.js.map +1 -1
- package/dist/node/search/types.js +3 -0
- package/dist/node/search/types.js.map +1 -0
- package/dist/node/search/utils.js +357 -0
- package/dist/node/search/utils.js.map +1 -0
- package/dist/types/content.d.ts +23 -0
- package/dist/types/search/_searchContent.d.ts +7 -0
- package/dist/types/search/content-utils.d.ts +70 -0
- package/dist/types/search/index.d.ts +4 -0
- package/dist/types/search/types.d.ts +294 -0
- package/dist/types/search/utils.d.ts +92 -0
- package/dist/umd/common.umd.js +992 -25
- package/dist/umd/common.umd.js.map +1 -1
- package/dist/umd/common.umd.min.js +1 -1
- package/dist/umd/common.umd.min.js.map +1 -1
- package/package.json +3 -3
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { __awaiter, __generator } from "tslib";
|
|
2
|
+
import { expandContentFilter, serializeContentFilterForPortal, convertPortalResponseToFacets, } from "./content-utils";
|
|
3
|
+
import { searchItems } from "@esri/arcgis-rest-portal";
|
|
4
|
+
import { expandApis, mergeSearchResults } from "./utils";
|
|
5
|
+
import { itemToContent } from "..";
|
|
6
|
+
/**
|
|
7
|
+
* Search for content via the Portal or Hub API
|
|
8
|
+
* @param filter
|
|
9
|
+
* @param options
|
|
10
|
+
*/
|
|
11
|
+
export function _searchContent(filter, options) {
|
|
12
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
13
|
+
var expanded, apis, searchPromises, results;
|
|
14
|
+
return __generator(this, function (_a) {
|
|
15
|
+
switch (_a.label) {
|
|
16
|
+
case 0:
|
|
17
|
+
expanded = expandContentFilter(filter);
|
|
18
|
+
// APIs
|
|
19
|
+
if (!options.apis) {
|
|
20
|
+
// default to AGO PROD
|
|
21
|
+
options.apis = ["arcgis"];
|
|
22
|
+
}
|
|
23
|
+
apis = expandApis(options.apis);
|
|
24
|
+
searchPromises = apis.map(function (api) {
|
|
25
|
+
var _a;
|
|
26
|
+
// Portal Search
|
|
27
|
+
if (api.type === "arcgis") {
|
|
28
|
+
// serialize for portal
|
|
29
|
+
var so = serializeContentFilterForPortal(expanded);
|
|
30
|
+
// pass auth forward
|
|
31
|
+
if (options.authentication) {
|
|
32
|
+
so.authentication = options.authentication;
|
|
33
|
+
}
|
|
34
|
+
// Aggregations
|
|
35
|
+
if ((_a = options.aggregations) === null || _a === void 0 ? void 0 : _a.length) {
|
|
36
|
+
so.countFields = options.aggregations.join(",");
|
|
37
|
+
so.countSize = 200;
|
|
38
|
+
}
|
|
39
|
+
if (options.num) {
|
|
40
|
+
so.num = options.num;
|
|
41
|
+
}
|
|
42
|
+
return searchPortal(so);
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
// Hub API Search
|
|
46
|
+
// TODO: Implement hub api content search
|
|
47
|
+
return Promise.resolve({
|
|
48
|
+
content: [],
|
|
49
|
+
facets: [],
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
return [4 /*yield*/, Promise.all(searchPromises)];
|
|
54
|
+
case 1:
|
|
55
|
+
results = _a.sent();
|
|
56
|
+
// merge and return
|
|
57
|
+
return [2 /*return*/, mergeSearchResults(results)];
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
function searchPortal(searchOptions) {
|
|
63
|
+
return searchItems(searchOptions).then(function (resp) {
|
|
64
|
+
var content = resp.results.map(itemToContent);
|
|
65
|
+
// convert aggregations into facets
|
|
66
|
+
var facets = convertPortalResponseToFacets(resp);
|
|
67
|
+
return { content: content, facets: facets };
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
//# sourceMappingURL=_searchContent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_searchContent.js","sourceRoot":"","sources":["../../../src/search/_searchContent.ts"],"names":[],"mappings":";AAAA,OAAO,EACL,mBAAmB,EACnB,+BAA+B,EAC/B,6BAA6B,GAC9B,MAAM,iBAAiB,CAAC;AAOzB,OAAO,EAAkB,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvE,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AACzD,OAAO,EAAe,aAAa,EAAE,MAAM,IAAI,CAAC;AAEhD;;;;GAIG;AACH,MAAM,UAAgB,cAAc,CAClC,MAAyB,EACzB,OAA0B;;;;;;oBAGpB,QAAQ,GAAG,mBAAmB,CAAC,MAAM,CAAC,CAAC;oBAE7C,OAAO;oBACP,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE;wBACjB,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C,IAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;QAChD,mCAAmC;QACnC,IAAM,MAAM,GAAG,6BAA6B,CAAC,IAAI,CAAC,CAAC;QACnD,OAAO,EAAE,OAAO,SAAA,EAAE,MAAM,QAAA,EAAE,CAAC;IAC7B,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,426 @@
|
|
|
1
|
+
import { __spreadArrays } from "tslib";
|
|
2
|
+
import { cloneObject } from "..";
|
|
3
|
+
import { mergeDateRange, mergeMatchOptions, mergeSearchOptions, relativeDateToDateRange, serializeDateRange, serializeMatchOptions, valueToMatchOptions, } from "./utils";
|
|
4
|
+
// TODO: Implement $dataset
|
|
5
|
+
var ContentFilterExpansions = {
|
|
6
|
+
$apps: [
|
|
7
|
+
{
|
|
8
|
+
type: {
|
|
9
|
+
any: [
|
|
10
|
+
"Code Sample",
|
|
11
|
+
"Web Mapping Application",
|
|
12
|
+
"Mobile Application",
|
|
13
|
+
"Application",
|
|
14
|
+
"Desktop Application Template",
|
|
15
|
+
"Desktop Application",
|
|
16
|
+
"Operation View",
|
|
17
|
+
"Dashboard",
|
|
18
|
+
"Operations Dashboard Extension",
|
|
19
|
+
"Workforce Project",
|
|
20
|
+
"Insights Workbook",
|
|
21
|
+
"Insights Page",
|
|
22
|
+
"Insights Model",
|
|
23
|
+
"Hub Page",
|
|
24
|
+
"Hub Initiative",
|
|
25
|
+
"Hub Site Application",
|
|
26
|
+
"StoryMap",
|
|
27
|
+
"Web Experience",
|
|
28
|
+
"Web Experience Template",
|
|
29
|
+
"Form",
|
|
30
|
+
],
|
|
31
|
+
not: [
|
|
32
|
+
"Code Attachment",
|
|
33
|
+
"Featured Items",
|
|
34
|
+
"Symbol Set",
|
|
35
|
+
"Color Set",
|
|
36
|
+
"Windows Viewer Add In",
|
|
37
|
+
"Windows Viewer Configuration",
|
|
38
|
+
"Map Area",
|
|
39
|
+
"Indoors Map Configuration",
|
|
40
|
+
],
|
|
41
|
+
},
|
|
42
|
+
typekeywords: {
|
|
43
|
+
not: ["MapAreaPackage", "SMX"],
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
],
|
|
47
|
+
$storymap: [
|
|
48
|
+
{
|
|
49
|
+
type: "StoryMap",
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
type: "Web Mapping Application",
|
|
53
|
+
typekeywords: ["Story Map"],
|
|
54
|
+
},
|
|
55
|
+
],
|
|
56
|
+
$dashboard: [
|
|
57
|
+
{
|
|
58
|
+
type: "Dashboard",
|
|
59
|
+
typekeywords: {
|
|
60
|
+
any: ["Dashboard"],
|
|
61
|
+
not: ["ArcGIS Operation View", "Add In", "Extension"],
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
],
|
|
65
|
+
$dataset: [],
|
|
66
|
+
$experience: [
|
|
67
|
+
{
|
|
68
|
+
type: {
|
|
69
|
+
any: ["Web Experience"],
|
|
70
|
+
not: ["Web Experience Template"],
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
],
|
|
74
|
+
$site: [
|
|
75
|
+
{
|
|
76
|
+
type: ["Hub Site Application", "Site Application"],
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
type: ["Web Mapping Application"],
|
|
80
|
+
typekeywords: ["hubSite"],
|
|
81
|
+
},
|
|
82
|
+
],
|
|
83
|
+
$initiative: [
|
|
84
|
+
{
|
|
85
|
+
type: {
|
|
86
|
+
any: "Hub Initiative",
|
|
87
|
+
not: "Hub Initiative Template",
|
|
88
|
+
},
|
|
89
|
+
},
|
|
90
|
+
],
|
|
91
|
+
$document: [
|
|
92
|
+
{
|
|
93
|
+
typekeywords: {
|
|
94
|
+
any: "Document",
|
|
95
|
+
not: ["MapAreaPackage", "SMX"],
|
|
96
|
+
},
|
|
97
|
+
type: {
|
|
98
|
+
any: [
|
|
99
|
+
"Image",
|
|
100
|
+
"Layout",
|
|
101
|
+
"Desktop Style",
|
|
102
|
+
"Project Template",
|
|
103
|
+
"Report Template",
|
|
104
|
+
"Pro Report",
|
|
105
|
+
"Statistical Data Collection",
|
|
106
|
+
"360 VR Experience",
|
|
107
|
+
"netCDF",
|
|
108
|
+
"PDF",
|
|
109
|
+
"CSV",
|
|
110
|
+
"Administrative Report",
|
|
111
|
+
"Raster function template",
|
|
112
|
+
],
|
|
113
|
+
not: [
|
|
114
|
+
"Image Service",
|
|
115
|
+
"Explorer Document",
|
|
116
|
+
"Explorer Map",
|
|
117
|
+
"Globe Document",
|
|
118
|
+
"Scene Document",
|
|
119
|
+
"Code Attachment",
|
|
120
|
+
"Featured Items",
|
|
121
|
+
"Symbol Set",
|
|
122
|
+
"ColorSet",
|
|
123
|
+
"Windows Viewer Add In",
|
|
124
|
+
"Windows Viewer Configuration",
|
|
125
|
+
"Map Area",
|
|
126
|
+
"Indoors Map Configuration",
|
|
127
|
+
],
|
|
128
|
+
},
|
|
129
|
+
},
|
|
130
|
+
],
|
|
131
|
+
};
|
|
132
|
+
/**
|
|
133
|
+
* @private
|
|
134
|
+
* Convert portal search response to items
|
|
135
|
+
* @param response
|
|
136
|
+
* @returns
|
|
137
|
+
*/
|
|
138
|
+
export function convertPortalResponseToFacets(response) {
|
|
139
|
+
var _a;
|
|
140
|
+
var result = [];
|
|
141
|
+
if ((_a = response.aggregations) === null || _a === void 0 ? void 0 : _a.counts) {
|
|
142
|
+
response.aggregations.counts.forEach(function (entry) {
|
|
143
|
+
var facet = {
|
|
144
|
+
label: entry.fieldName,
|
|
145
|
+
attribute: entry.fieldName,
|
|
146
|
+
type: "multi-select",
|
|
147
|
+
};
|
|
148
|
+
var options = [];
|
|
149
|
+
entry.fieldValues.forEach(function (fv) {
|
|
150
|
+
var filter = {
|
|
151
|
+
filterType: "content",
|
|
152
|
+
};
|
|
153
|
+
filter[entry.fieldName] = fv.value;
|
|
154
|
+
var fo = {
|
|
155
|
+
label: fv.value,
|
|
156
|
+
value: fv.value,
|
|
157
|
+
count: fv.count,
|
|
158
|
+
selected: false,
|
|
159
|
+
filter: filter,
|
|
160
|
+
};
|
|
161
|
+
options.push(fo);
|
|
162
|
+
});
|
|
163
|
+
facet.options = options;
|
|
164
|
+
result.push(facet);
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
return result;
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* @private
|
|
171
|
+
* Merge `Filter<"content">` objects
|
|
172
|
+
* @param filters
|
|
173
|
+
* @returns
|
|
174
|
+
*/
|
|
175
|
+
export function mergeContentFilter(filters) {
|
|
176
|
+
// expand all the filters so all prop types are consistent
|
|
177
|
+
var expanded = filters.map(expandContentFilter);
|
|
178
|
+
// now we can merge based on fields
|
|
179
|
+
var dateFields = ["created", "modified"];
|
|
180
|
+
var specialFields = __spreadArrays(["filterType", "subFilters"], dateFields);
|
|
181
|
+
var result = expanded.reduce(function (acc, entry) {
|
|
182
|
+
// process fields
|
|
183
|
+
Object.entries(entry).forEach(function (_a) {
|
|
184
|
+
var key = _a[0], value = _a[1];
|
|
185
|
+
// MatchOption fields
|
|
186
|
+
if (!specialFields.includes(key)) {
|
|
187
|
+
if (acc[key]) {
|
|
188
|
+
acc[key] = mergeMatchOptions(acc[key], value);
|
|
189
|
+
}
|
|
190
|
+
else {
|
|
191
|
+
acc[key] = cloneObject(value);
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
// Dates
|
|
195
|
+
if (dateFields.includes(key)) {
|
|
196
|
+
if (acc[key]) {
|
|
197
|
+
acc[key] = mergeDateRange(acc[key], value);
|
|
198
|
+
}
|
|
199
|
+
else {
|
|
200
|
+
acc[key] = cloneObject(value);
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
// SubFilters
|
|
204
|
+
if (key === "subFilters" && Array.isArray(value)) {
|
|
205
|
+
if (acc.subFilters) {
|
|
206
|
+
acc.subFilters = mergeSubFilters(acc.subFilters, value);
|
|
207
|
+
}
|
|
208
|
+
else {
|
|
209
|
+
acc.subFilters = cloneObject(value);
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
});
|
|
213
|
+
return acc;
|
|
214
|
+
}, {});
|
|
215
|
+
result.filterType = "content";
|
|
216
|
+
return result;
|
|
217
|
+
}
|
|
218
|
+
function mergeSubFilters(sf1, sf2) {
|
|
219
|
+
// Simplistic implementation: we just merge the arrays
|
|
220
|
+
// in the future we may try to de-dupe things as a safeguard
|
|
221
|
+
return __spreadArrays(sf1, sf2);
|
|
222
|
+
}
|
|
223
|
+
/**
|
|
224
|
+
* Prior to serialization into the query syntax for the backing APIs, we first expand [Filters](../Filter)
|
|
225
|
+
*
|
|
226
|
+
* Filter's can express their intent in a very terse form, but to ensure consistent
|
|
227
|
+
* into their more verbose form.
|
|
228
|
+
*
|
|
229
|
+
* i.e. `title: "Water"` expands into `title: { any: ["Water"]}`
|
|
230
|
+
*
|
|
231
|
+
* - "well known" type values are expanded
|
|
232
|
+
* - i.e. `type: "$storymap"` expands into two `subFilter` entries
|
|
233
|
+
* - Fields defined as `string | string[] | MatchOptions` will be converted to a `MatchOptions`
|
|
234
|
+
* - RelativeDate fields are converted to DateRange<number>
|
|
235
|
+
*
|
|
236
|
+
* @param filter
|
|
237
|
+
* @returns
|
|
238
|
+
*/
|
|
239
|
+
export function expandContentFilter(filter) {
|
|
240
|
+
// Expand filter.type first
|
|
241
|
+
var expandedTypeFilter = expandTypeField(filter);
|
|
242
|
+
// Expand subfilters
|
|
243
|
+
// Guard - JS Clients could send in anything...
|
|
244
|
+
if (Array.isArray(filter.subFilters)) {
|
|
245
|
+
// Convert any strings into the coresponding ContentFilterDefinition
|
|
246
|
+
expandedTypeFilter.subFilters = expandedTypeFilter.subFilters.reduce(function (acc, entry) {
|
|
247
|
+
if (typeof entry === "string") {
|
|
248
|
+
// if the entry is not a key of ContentFilterExpansions
|
|
249
|
+
// we just skip over it
|
|
250
|
+
if (ContentFilterExpansions[entry]) {
|
|
251
|
+
acc = acc.concat(ContentFilterExpansions[entry]);
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
else {
|
|
255
|
+
acc.push(entry); // should be a ContentFilterDefinition
|
|
256
|
+
}
|
|
257
|
+
return acc;
|
|
258
|
+
}, []);
|
|
259
|
+
}
|
|
260
|
+
// Convert all props into MatchOptions/DateRanges
|
|
261
|
+
return convertContentDefinitionToFilter(expandedTypeFilter);
|
|
262
|
+
}
|
|
263
|
+
/**
|
|
264
|
+
* @private
|
|
265
|
+
* Expand from a well-known "type" into it's longer form
|
|
266
|
+
*
|
|
267
|
+
* i.e. `type: "$storymap"` expands into two subFilters entries
|
|
268
|
+
*
|
|
269
|
+
* @param filter
|
|
270
|
+
* @returns
|
|
271
|
+
*/
|
|
272
|
+
export function expandTypeField(filter) {
|
|
273
|
+
var clone = cloneObject(filter);
|
|
274
|
+
// ensure subFilters is defined as an array
|
|
275
|
+
clone.subFilters = clone.subFilters || [];
|
|
276
|
+
if (clone.type) {
|
|
277
|
+
// if .type is an Array...
|
|
278
|
+
if (Array.isArray(clone.type)) {
|
|
279
|
+
// remove any well-known-keys and move their expansions into subfilters
|
|
280
|
+
clone.type = clone.type.reduce(function (acc, entry) {
|
|
281
|
+
if (isWellKnownType(entry)) {
|
|
282
|
+
// working with dynamic objects in typescript requires some assertions
|
|
283
|
+
var key = entry;
|
|
284
|
+
clone.subFilters = clone.subFilters.concat(lookupTypeFilters(key));
|
|
285
|
+
}
|
|
286
|
+
else {
|
|
287
|
+
acc.push(entry);
|
|
288
|
+
}
|
|
289
|
+
return acc;
|
|
290
|
+
}, []);
|
|
291
|
+
}
|
|
292
|
+
else if (isWellKnownType(clone.type)) {
|
|
293
|
+
var key = clone.type;
|
|
294
|
+
clone.subFilters = clone.subFilters.concat(lookupTypeFilters(key));
|
|
295
|
+
delete clone.type;
|
|
296
|
+
}
|
|
297
|
+
else {
|
|
298
|
+
// Future?: implement "expansions" inside MatchOptions
|
|
299
|
+
// For now, we only attempt expansions for filter.type
|
|
300
|
+
// if it's a string, or for strings inside an array
|
|
301
|
+
// Unclear if it's of value to allow short-cuts inside MatchOptions
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
return clone;
|
|
305
|
+
}
|
|
306
|
+
/**
|
|
307
|
+
* Is the argument a well-known type "key"
|
|
308
|
+
*
|
|
309
|
+
* Accepts `string`, `string[]` or `IMatchOptions`
|
|
310
|
+
* but only string values can possibly be properties
|
|
311
|
+
* on `ContentFilterExpansions`
|
|
312
|
+
* @param key
|
|
313
|
+
* @returns
|
|
314
|
+
*/
|
|
315
|
+
function isWellKnownType(key) {
|
|
316
|
+
var result = false;
|
|
317
|
+
if (typeof key === "string") {
|
|
318
|
+
result = key in ContentFilterExpansions;
|
|
319
|
+
}
|
|
320
|
+
return result;
|
|
321
|
+
}
|
|
322
|
+
function lookupTypeFilters(key) {
|
|
323
|
+
return ContentFilterExpansions[key];
|
|
324
|
+
}
|
|
325
|
+
/**
|
|
326
|
+
* @private
|
|
327
|
+
* Convert a `ContentFilterDefinition` to a `ContentFilter`
|
|
328
|
+
*
|
|
329
|
+
* ContentFilter is a narrower version of ContentFilterDefinition, without
|
|
330
|
+
* the union types. Using a ContentFilter makes working with the structure
|
|
331
|
+
* in typescript much easier.
|
|
332
|
+
*
|
|
333
|
+
* @param filter
|
|
334
|
+
* @returns
|
|
335
|
+
*/
|
|
336
|
+
export function convertContentDefinitionToFilter(filter) {
|
|
337
|
+
var result = {};
|
|
338
|
+
if (filter.term) {
|
|
339
|
+
result.term = filter.term;
|
|
340
|
+
}
|
|
341
|
+
var dateProps = ["created", "modified"];
|
|
342
|
+
// Some properties should not get converted to MatchOptions
|
|
343
|
+
var specialProps = __spreadArrays(["filterType", "subFilters", "term"], dateProps);
|
|
344
|
+
// Do the conversion
|
|
345
|
+
Object.entries(filter).forEach(function (_a) {
|
|
346
|
+
var key = _a[0], value = _a[1];
|
|
347
|
+
if (!specialProps.includes(key)) {
|
|
348
|
+
result[key] = valueToMatchOptions(value);
|
|
349
|
+
}
|
|
350
|
+
});
|
|
351
|
+
// Special Cases
|
|
352
|
+
// subFilters; Array of ContentFilterDefinitions
|
|
353
|
+
if (filter.subFilters && Array.isArray(filter.subFilters)) {
|
|
354
|
+
// downcast - would be nice to skip this or use some other constuct
|
|
355
|
+
var sf = filter.subFilters;
|
|
356
|
+
result.subFilters = sf.map(convertContentDefinitionToFilter);
|
|
357
|
+
}
|
|
358
|
+
// Dates; Ensure they are all DateRange<number>
|
|
359
|
+
dateProps.forEach(function (fld) {
|
|
360
|
+
if (filter[fld]) {
|
|
361
|
+
if (filter[fld].type === "relative-date") {
|
|
362
|
+
result[fld] = relativeDateToDateRange(filter[fld]);
|
|
363
|
+
}
|
|
364
|
+
else {
|
|
365
|
+
result[fld] = cloneObject(filter[fld]);
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
});
|
|
369
|
+
return result;
|
|
370
|
+
}
|
|
371
|
+
/**
|
|
372
|
+
* @private
|
|
373
|
+
* Serialize a `ContentFilter` into an `ISearchOptions` for use with `searchItems`
|
|
374
|
+
* @param filter
|
|
375
|
+
* @returns
|
|
376
|
+
*/
|
|
377
|
+
export function serializeContentFilterForPortal(filter) {
|
|
378
|
+
var searchOptions = convertContentFilterToSearchOptions(filter);
|
|
379
|
+
if (filter.subFilters) {
|
|
380
|
+
var subFilterOptions = filter.subFilters.reduce(function (acc, entry) {
|
|
381
|
+
// Next guard is present b/c this can be used from javascript
|
|
382
|
+
// but our tests are written in typescript which prevents us
|
|
383
|
+
// from hitting the else
|
|
384
|
+
/* istanbul ignore else */
|
|
385
|
+
if (typeof entry === "object") {
|
|
386
|
+
acc = mergeSearchOptions(acc, convertContentFilterToSearchOptions(entry), "OR");
|
|
387
|
+
}
|
|
388
|
+
return acc;
|
|
389
|
+
}, { q: "", filter: "" });
|
|
390
|
+
// merge with searchOptions using AND
|
|
391
|
+
searchOptions = mergeSearchOptions(searchOptions, subFilterOptions, "AND");
|
|
392
|
+
}
|
|
393
|
+
// term is always last, and pre-pended on searchOptions.q
|
|
394
|
+
if (filter.term) {
|
|
395
|
+
searchOptions.q = (filter.term + " " + searchOptions.q).trim();
|
|
396
|
+
}
|
|
397
|
+
return searchOptions;
|
|
398
|
+
}
|
|
399
|
+
/**
|
|
400
|
+
* @private
|
|
401
|
+
* Convert a ContentFilter to a SearchOptions
|
|
402
|
+
*
|
|
403
|
+
* @param filter
|
|
404
|
+
* @returns
|
|
405
|
+
*/
|
|
406
|
+
export function convertContentFilterToSearchOptions(filter) {
|
|
407
|
+
var result = {
|
|
408
|
+
q: "",
|
|
409
|
+
filter: "",
|
|
410
|
+
};
|
|
411
|
+
var dateProps = ["created", "modified"];
|
|
412
|
+
var specialProps = __spreadArrays(["filterType", "subFilters", "term"], dateProps);
|
|
413
|
+
Object.entries(filter).forEach(function (_a) {
|
|
414
|
+
var key = _a[0], value = _a[1];
|
|
415
|
+
// MatchOptions may go into either q or filter
|
|
416
|
+
if (!specialProps.includes(key)) {
|
|
417
|
+
result = mergeSearchOptions(result, serializeMatchOptions(key, value), "AND");
|
|
418
|
+
}
|
|
419
|
+
// Dates only go into q
|
|
420
|
+
if (dateProps.includes(key)) {
|
|
421
|
+
result = mergeSearchOptions(result, serializeDateRange(key, value), "AND");
|
|
422
|
+
}
|
|
423
|
+
});
|
|
424
|
+
return result;
|
|
425
|
+
}
|
|
426
|
+
//# sourceMappingURL=content-utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"content-utils.js","sourceRoot":"","sources":["../../../src/search/content-utils.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,WAAW,EAAE,MAAM,IAAI,CAAC;AAWjC,OAAO,EACL,cAAc,EACd,iBAAiB,EACjB,kBAAkB,EAClB,uBAAuB,EACvB,kBAAkB,EAClB,qBAAqB,EACrB,mBAAmB,GACpB,MAAM,SAAS,CAAC;AAEjB,2BAA2B;AAC3B,IAAM,uBAAuB,GAA6B;IACxD,KAAK,EAAE;QACL;YACE,IAAI,EAAE;gBACJ,GAAG,EAAE;oBACH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aAAa,GAAG,kBAAkB,CAAC,aAAa,EAAE,gBAAgB,EAAE,KAAK,CAAC,CAAC;KAC5E;IACD,yDAAyD;IACzD,IAAI,MAAM,CAAC,IAAI,EAAE;QACf,aAAa,CAAC,CAAC,GAAG,CAAG,MAAM,CAAC,IAAI,SAAI,aAAa,CAAC,CAAG,CAAA,CAAC,IAAI,EAAE,CAAC;KAC9D;IACD,OAAO,aAAa,CAAC;AACvB,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,mCAAmC,CACjD,MAAsB;IAEtB,IAAI,MAAM,GAAG;QACX,CAAC,EAAE,EAAE;QACL,MAAM,EAAE,EAAE;KACO,CAAC;IAEpB,IAAM,SAAS,GAAG,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;IAC1C,IAAM,YAAY,mBAAI,YAAY,EAAE,YAAY,EAAE,MAAM,GAAK,SAAS,CAAC,CAAC;IACxE,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,UAAC,EAAY;YAAX,GAAG,QAAA,EAAE,KAAK,QAAA;QACzC,8CAA8C;QAC9C,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;YAC/B,MAAM,GAAG,kBAAkB,CACzB,MAAM,EACN,qBAAqB,CAAC,GAAG,EAAE,KAAK,CAAC,EACjC,KAAK,CACN,CAAC;SACH;QACD,uBAAuB;QACvB,IAAI,SAAS,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;YAC3B,MAAM,GAAG,kBAAkB,CACzB,MAAM,EACN,kBAAkB,CAAC,GAAG,EAAE,KAAK,CAAC,EAC9B,KAAK,CACN,CAAC;SACH;IACH,CAAC,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
package/dist/esm/search/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/search/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/search/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,kBAAkB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/search/types.ts"],"names":[],"mappings":""}
|