@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.
Files changed (248) hide show
  1. package/dist/es2017/core/traits/WithCatalog.js +1 -0
  2. package/dist/es2017/core/traits/WithCatalog.js.map +1 -0
  3. package/dist/es2017/index.js +1 -0
  4. package/dist/es2017/index.js.map +1 -1
  5. package/dist/es2017/projects/HubProjects.js.map +1 -1
  6. package/dist/es2017/search/Catalog.js +346 -0
  7. package/dist/es2017/search/Catalog.js.map +1 -0
  8. package/dist/es2017/search/Collection.js +38 -19
  9. package/dist/es2017/search/Collection.js.map +1 -1
  10. package/dist/es2017/search/_internal/{ipredicate-utils.js → expandPredicate.js} +1 -1
  11. package/dist/es2017/search/_internal/expandPredicate.js.map +1 -0
  12. package/dist/es2017/search/_internal/hubSearchItems.js +3 -137
  13. package/dist/es2017/search/_internal/hubSearchItems.js.map +1 -1
  14. package/dist/es2017/search/_internal/index.js +0 -1
  15. package/dist/es2017/search/_internal/index.js.map +1 -1
  16. package/dist/es2017/search/_internal/portalSearchGroups.js +1 -2
  17. package/dist/es2017/search/_internal/portalSearchGroups.js.map +1 -1
  18. package/dist/es2017/search/_internal/portalSearchItems.js +5 -30
  19. package/dist/es2017/search/_internal/portalSearchItems.js.map +1 -1
  20. package/dist/es2017/search/_internal/portalSearchUsers.js +1 -2
  21. package/dist/es2017/search/_internal/portalSearchUsers.js.map +1 -1
  22. package/dist/es2017/search/fetchCatalog.js +46 -0
  23. package/dist/es2017/search/fetchCatalog.js.map +1 -0
  24. package/dist/es2017/search/hubSearch.js +1 -1
  25. package/dist/es2017/search/hubSearch.js.map +1 -1
  26. package/dist/es2017/search/index.js +3 -9
  27. package/dist/es2017/search/index.js.map +1 -1
  28. package/dist/es2017/search/serializeQueryForPortal.js +1 -1
  29. package/dist/es2017/search/serializeQueryForPortal.js.map +1 -1
  30. package/dist/es2017/search/types/index.js +0 -5
  31. package/dist/es2017/search/types/index.js.map +1 -1
  32. package/dist/es2017/search/upgradeCatalogSchema.js +66 -0
  33. package/dist/es2017/search/upgradeCatalogSchema.js.map +1 -0
  34. package/dist/es2017/search/utils.js +1 -207
  35. package/dist/es2017/search/utils.js.map +1 -1
  36. package/dist/es2017/types/IMessage.js +1 -0
  37. package/dist/es2017/types/IMessage.js.map +1 -0
  38. package/dist/es2017/types/index.js +2 -0
  39. package/dist/es2017/types/index.js.map +1 -0
  40. package/dist/es2017/types.js.map +1 -1
  41. package/dist/esm/core/traits/WithCatalog.js +1 -0
  42. package/dist/esm/core/traits/WithCatalog.js.map +1 -0
  43. package/dist/esm/index.js +1 -0
  44. package/dist/esm/index.js.map +1 -1
  45. package/dist/esm/projects/HubProjects.js.map +1 -1
  46. package/dist/esm/search/Catalog.js +404 -0
  47. package/dist/esm/search/Catalog.js.map +1 -0
  48. package/dist/esm/search/Collection.js +40 -24
  49. package/dist/esm/search/Collection.js.map +1 -1
  50. package/dist/esm/search/_internal/{ipredicate-utils.js → expandPredicate.js} +1 -1
  51. package/dist/esm/search/_internal/expandPredicate.js.map +1 -0
  52. package/dist/esm/search/_internal/hubSearchItems.js +4 -146
  53. package/dist/esm/search/_internal/hubSearchItems.js.map +1 -1
  54. package/dist/esm/search/_internal/index.js +0 -1
  55. package/dist/esm/search/_internal/index.js.map +1 -1
  56. package/dist/esm/search/_internal/portalSearchGroups.js +1 -2
  57. package/dist/esm/search/_internal/portalSearchGroups.js.map +1 -1
  58. package/dist/esm/search/_internal/portalSearchItems.js +6 -30
  59. package/dist/esm/search/_internal/portalSearchItems.js.map +1 -1
  60. package/dist/esm/search/_internal/portalSearchUsers.js +1 -2
  61. package/dist/esm/search/_internal/portalSearchUsers.js.map +1 -1
  62. package/dist/esm/search/fetchCatalog.js +59 -0
  63. package/dist/esm/search/fetchCatalog.js.map +1 -0
  64. package/dist/esm/search/hubSearch.js +1 -1
  65. package/dist/esm/search/hubSearch.js.map +1 -1
  66. package/dist/esm/search/index.js +3 -9
  67. package/dist/esm/search/index.js.map +1 -1
  68. package/dist/esm/search/serializeQueryForPortal.js +1 -1
  69. package/dist/esm/search/serializeQueryForPortal.js.map +1 -1
  70. package/dist/esm/search/types/index.js +0 -5
  71. package/dist/esm/search/types/index.js.map +1 -1
  72. package/dist/esm/search/upgradeCatalogSchema.js +66 -0
  73. package/dist/esm/search/upgradeCatalogSchema.js.map +1 -0
  74. package/dist/esm/search/utils.js +1 -204
  75. package/dist/esm/search/utils.js.map +1 -1
  76. package/dist/esm/types/IMessage.js +1 -0
  77. package/dist/esm/types/IMessage.js.map +1 -0
  78. package/dist/esm/types/index.js +2 -0
  79. package/dist/esm/types/index.js.map +1 -0
  80. package/dist/esm/types.js.map +1 -1
  81. package/dist/node/{search/types/ICollection.js → core/traits/WithCatalog.js} +1 -1
  82. package/dist/node/core/traits/WithCatalog.js.map +1 -0
  83. package/dist/node/index.js +1 -0
  84. package/dist/node/index.js.map +1 -1
  85. package/dist/node/projects/HubProjects.js.map +1 -1
  86. package/dist/node/search/Catalog.js +350 -0
  87. package/dist/node/search/Catalog.js.map +1 -0
  88. package/dist/node/search/Collection.js +37 -18
  89. package/dist/node/search/Collection.js.map +1 -1
  90. package/dist/node/search/_internal/{ipredicate-utils.js → expandPredicate.js} +1 -1
  91. package/dist/node/search/_internal/expandPredicate.js.map +1 -0
  92. package/dist/node/search/_internal/hubSearchItems.js +4 -139
  93. package/dist/node/search/_internal/hubSearchItems.js.map +1 -1
  94. package/dist/node/search/_internal/index.js +0 -1
  95. package/dist/node/search/_internal/index.js.map +1 -1
  96. package/dist/node/search/_internal/portalSearchGroups.js +2 -3
  97. package/dist/node/search/_internal/portalSearchGroups.js.map +1 -1
  98. package/dist/node/search/_internal/portalSearchItems.js +6 -31
  99. package/dist/node/search/_internal/portalSearchItems.js.map +1 -1
  100. package/dist/node/search/_internal/portalSearchUsers.js +2 -3
  101. package/dist/node/search/_internal/portalSearchUsers.js.map +1 -1
  102. package/dist/node/search/fetchCatalog.js +50 -0
  103. package/dist/node/search/fetchCatalog.js.map +1 -0
  104. package/dist/node/search/hubSearch.js +1 -1
  105. package/dist/node/search/hubSearch.js.map +1 -1
  106. package/dist/node/search/index.js +3 -9
  107. package/dist/node/search/index.js.map +1 -1
  108. package/dist/node/search/serializeQueryForPortal.js +2 -2
  109. package/dist/node/search/serializeQueryForPortal.js.map +1 -1
  110. package/dist/node/search/types/index.js +0 -5
  111. package/dist/node/search/types/index.js.map +1 -1
  112. package/dist/node/search/upgradeCatalogSchema.js +71 -0
  113. package/dist/node/search/upgradeCatalogSchema.js.map +1 -0
  114. package/dist/node/search/utils.js +1 -213
  115. package/dist/node/search/utils.js.map +1 -1
  116. package/dist/node/{search/types/ICatalog.js → types/IMessage.js} +1 -1
  117. package/dist/node/types/IMessage.js.map +1 -0
  118. package/dist/node/types/index.js +5 -0
  119. package/dist/node/types/index.js.map +1 -0
  120. package/dist/node/types.js.map +1 -1
  121. package/dist/types/core/traits/WithCatalog.d.ts +7 -0
  122. package/dist/types/index.d.ts +1 -0
  123. package/dist/types/search/Catalog.d.ts +143 -0
  124. package/dist/types/search/Collection.d.ts +23 -2
  125. package/dist/types/search/_internal/{ipredicate-utils.d.ts → expandPredicate.d.ts} +0 -0
  126. package/dist/types/search/_internal/hubSearchItems.d.ts +3 -4
  127. package/dist/types/search/_internal/index.d.ts +0 -1
  128. package/dist/types/search/_internal/portalSearchItems.d.ts +15 -15
  129. package/dist/types/search/fetchCatalog.d.ts +10 -0
  130. package/dist/types/search/index.d.ts +3 -9
  131. package/dist/types/search/types/IHubSearchOptions.d.ts +5 -1
  132. package/dist/types/search/types/IHubSearchResponse.d.ts +3 -3
  133. package/dist/types/search/types/index.d.ts +0 -5
  134. package/dist/types/search/types/types.d.ts +0 -206
  135. package/dist/types/search/upgradeCatalogSchema.d.ts +12 -0
  136. package/dist/types/search/utils.d.ts +2 -58
  137. package/dist/types/types/IMessage.d.ts +32 -0
  138. package/dist/types/types/index.d.ts +1 -0
  139. package/dist/types/types.d.ts +0 -2
  140. package/dist/umd/common.umd.js +1374 -2450
  141. package/dist/umd/common.umd.js.map +1 -1
  142. package/package.json +1 -1
  143. package/dist/es2017/search/_internal/ipredicate-utils.js.map +0 -1
  144. package/dist/es2017/search/_internal/state.js +0 -155
  145. package/dist/es2017/search/_internal/state.js.map +0 -1
  146. package/dist/es2017/search/_searchContent.js +0 -116
  147. package/dist/es2017/search/_searchContent.js.map +0 -1
  148. package/dist/es2017/search/_searchGroups.js +0 -88
  149. package/dist/es2017/search/_searchGroups.js.map +0 -1
  150. package/dist/es2017/search/_searchUsers.js +0 -89
  151. package/dist/es2017/search/_searchUsers.js.map +0 -1
  152. package/dist/es2017/search/collectionState.js +0 -60
  153. package/dist/es2017/search/collectionState.js.map +0 -1
  154. package/dist/es2017/search/content-utils.js +0 -455
  155. package/dist/es2017/search/content-utils.js.map +0 -1
  156. package/dist/es2017/search/convertCatalog.js +0 -33
  157. package/dist/es2017/search/convertCatalog.js.map +0 -1
  158. package/dist/es2017/search/filter-utils.js +0 -31
  159. package/dist/es2017/search/filter-utils.js.map +0 -1
  160. package/dist/es2017/search/group-utils.js +0 -142
  161. package/dist/es2017/search/group-utils.js.map +0 -1
  162. package/dist/es2017/search/types/ICatalog.js +0 -1
  163. package/dist/es2017/search/types/ICatalog.js.map +0 -1
  164. package/dist/es2017/search/types/ICollection.js +0 -1
  165. package/dist/es2017/search/types/ICollection.js.map +0 -1
  166. package/dist/es2017/search/types/IFacet.js +0 -1
  167. package/dist/es2017/search/types/IFacet.js.map +0 -1
  168. package/dist/es2017/search/types/IFacetOption.js +0 -1
  169. package/dist/es2017/search/types/IFacetOption.js.map +0 -1
  170. package/dist/es2017/search/types/IHubApiSearchRequest.js +0 -1
  171. package/dist/es2017/search/types/IHubApiSearchRequest.js.map +0 -1
  172. package/dist/es2017/search/user-utils.js +0 -139
  173. package/dist/es2017/search/user-utils.js.map +0 -1
  174. package/dist/esm/search/_internal/ipredicate-utils.js.map +0 -1
  175. package/dist/esm/search/_internal/state.js +0 -155
  176. package/dist/esm/search/_internal/state.js.map +0 -1
  177. package/dist/esm/search/_searchContent.js +0 -118
  178. package/dist/esm/search/_searchContent.js.map +0 -1
  179. package/dist/esm/search/_searchGroups.js +0 -91
  180. package/dist/esm/search/_searchGroups.js.map +0 -1
  181. package/dist/esm/search/_searchUsers.js +0 -92
  182. package/dist/esm/search/_searchUsers.js.map +0 -1
  183. package/dist/esm/search/collectionState.js +0 -61
  184. package/dist/esm/search/collectionState.js.map +0 -1
  185. package/dist/esm/search/content-utils.js +0 -462
  186. package/dist/esm/search/content-utils.js.map +0 -1
  187. package/dist/esm/search/convertCatalog.js +0 -33
  188. package/dist/esm/search/convertCatalog.js.map +0 -1
  189. package/dist/esm/search/filter-utils.js +0 -31
  190. package/dist/esm/search/filter-utils.js.map +0 -1
  191. package/dist/esm/search/group-utils.js +0 -146
  192. package/dist/esm/search/group-utils.js.map +0 -1
  193. package/dist/esm/search/types/ICatalog.js +0 -1
  194. package/dist/esm/search/types/ICatalog.js.map +0 -1
  195. package/dist/esm/search/types/ICollection.js +0 -1
  196. package/dist/esm/search/types/ICollection.js.map +0 -1
  197. package/dist/esm/search/types/IFacet.js +0 -1
  198. package/dist/esm/search/types/IFacet.js.map +0 -1
  199. package/dist/esm/search/types/IFacetOption.js +0 -1
  200. package/dist/esm/search/types/IFacetOption.js.map +0 -1
  201. package/dist/esm/search/types/IHubApiSearchRequest.js +0 -1
  202. package/dist/esm/search/types/IHubApiSearchRequest.js.map +0 -1
  203. package/dist/esm/search/user-utils.js +0 -143
  204. package/dist/esm/search/user-utils.js.map +0 -1
  205. package/dist/node/search/_internal/ipredicate-utils.js.map +0 -1
  206. package/dist/node/search/_internal/state.js +0 -166
  207. package/dist/node/search/_internal/state.js.map +0 -1
  208. package/dist/node/search/_searchContent.js +0 -120
  209. package/dist/node/search/_searchContent.js.map +0 -1
  210. package/dist/node/search/_searchGroups.js +0 -92
  211. package/dist/node/search/_searchGroups.js.map +0 -1
  212. package/dist/node/search/_searchUsers.js +0 -93
  213. package/dist/node/search/_searchUsers.js.map +0 -1
  214. package/dist/node/search/collectionState.js +0 -65
  215. package/dist/node/search/collectionState.js.map +0 -1
  216. package/dist/node/search/content-utils.js +0 -466
  217. package/dist/node/search/content-utils.js.map +0 -1
  218. package/dist/node/search/convertCatalog.js +0 -37
  219. package/dist/node/search/convertCatalog.js.map +0 -1
  220. package/dist/node/search/filter-utils.js +0 -36
  221. package/dist/node/search/filter-utils.js.map +0 -1
  222. package/dist/node/search/group-utils.js +0 -148
  223. package/dist/node/search/group-utils.js.map +0 -1
  224. package/dist/node/search/types/ICatalog.js.map +0 -1
  225. package/dist/node/search/types/ICollection.js.map +0 -1
  226. package/dist/node/search/types/IFacet.js +0 -3
  227. package/dist/node/search/types/IFacet.js.map +0 -1
  228. package/dist/node/search/types/IFacetOption.js +0 -3
  229. package/dist/node/search/types/IFacetOption.js.map +0 -1
  230. package/dist/node/search/types/IHubApiSearchRequest.js +0 -3
  231. package/dist/node/search/types/IHubApiSearchRequest.js.map +0 -1
  232. package/dist/node/search/user-utils.js +0 -145
  233. package/dist/node/search/user-utils.js.map +0 -1
  234. package/dist/types/search/_internal/state.d.ts +0 -70
  235. package/dist/types/search/_searchContent.d.ts +0 -9
  236. package/dist/types/search/_searchGroups.d.ts +0 -17
  237. package/dist/types/search/_searchUsers.d.ts +0 -31
  238. package/dist/types/search/collectionState.d.ts +0 -19
  239. package/dist/types/search/content-utils.d.ts +0 -83
  240. package/dist/types/search/convertCatalog.d.ts +0 -6
  241. package/dist/types/search/filter-utils.d.ts +0 -13
  242. package/dist/types/search/group-utils.d.ts +0 -36
  243. package/dist/types/search/types/ICatalog.d.ts +0 -87
  244. package/dist/types/search/types/ICollection.d.ts +0 -28
  245. package/dist/types/search/types/IFacet.d.ts +0 -62
  246. package/dist/types/search/types/IFacetOption.d.ts +0 -30
  247. package/dist/types/search/types/IHubApiSearchRequest.d.ts +0 -16
  248. 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.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"group-utils.js","sourceRoot":"","sources":["../../../src/search/group-utils.ts"],"names":[],"mappings":";;;AACA,wBAUW;AACX,0BAA2D;AAE3D,mCAAmC;AAEnC;;;;;;;;;GASG;AACH,SAAgB,iBAAiB,CAC/B,OAA+B;IAE/B,mCAAmC;IACnC,UAAM,CAAC,IAAI,CACT,0GAA0G,CAC3G,CAAC;IACF,0DAA0D;IAC1D,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;IAChD,mCAAmC;IACnC,MAAM,UAAU,GAAG,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;IAC3C,MAAM,aAAa,GAAG,CAAC,YAAY,EAAE,MAAM,EAAE,GAAG,UAAU,CAAC,CAAC;IAE5D,wDAAwD;IACxD,6CAA6C;IAC7C,MAAM,MAAM,GAAG,QAAQ,CAAC,MAAM,CAC5B,CAAC,GAAoB,EAAE,KAAK,EAAE,EAAE;QAC9B,iBAAiB;QACjB,MAAM,C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-1 +0,0 @@
1
- {"version":3,"file":"ICollection.js","sourceRoot":"","sources":["../../../../src/search/types/ICollection.ts"],"names":[],"mappings":""}
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=IFacet.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"IFacet.js","sourceRoot":"","sources":["../../../../src/search/types/IFacet.ts"],"names":[],"mappings":""}
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=IFacetOption.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"IFacetOption.js","sourceRoot":"","sources":["../../../../src/search/types/IFacetOption.ts"],"names":[],"mappings":""}
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=IHubApiSearchRequest.js.map
@@ -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":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AAkB,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,6 +0,0 @@
1
- import { IHubCatalog } from "./types";
2
- /**
3
- * Convert the original site catalog structure into a formal ICatalog
4
- * @param original
5
- */
6
- export declare function convertCatalog(original: any): IHubCatalog;
@@ -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;