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