@zengenti/contensis-react-base 2.4.1-beta.9 → 2.5.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.
Files changed (190) hide show
  1. package/CHANGELOG.md +61 -0
  2. package/README.md +77 -0
  3. package/cjs/{App-f3164dab.js → App-79703372.js} +236 -22
  4. package/cjs/App-79703372.js.map +1 -0
  5. package/cjs/{RouteLoader-5c44f039.js → RouteLoader-f67bbf9e.js} +8 -39
  6. package/cjs/RouteLoader-f67bbf9e.js.map +1 -0
  7. package/cjs/{ToJs-ca9bea03.js → ToJs-d72e5b10.js} +58 -2
  8. package/cjs/ToJs-d72e5b10.js.map +1 -0
  9. package/cjs/{actions-e22726ed.js → actions-e9f69947.js} +1 -1
  10. package/cjs/actions-e9f69947.js.map +1 -0
  11. package/cjs/client.js +121 -16
  12. package/cjs/client.js.map +1 -1
  13. package/cjs/contensis-react-base.js +41 -52
  14. package/cjs/contensis-react-base.js.map +1 -1
  15. package/cjs/forms.js +1 -1
  16. package/cjs/{login-6c0ef139.js → login-4f274c6a.js} +8 -5
  17. package/cjs/login-4f274c6a.js.map +1 -0
  18. package/cjs/reducers-cb531715.js +207 -0
  19. package/cjs/reducers-cb531715.js.map +1 -0
  20. package/cjs/redux.js +15 -16
  21. package/cjs/redux.js.map +1 -1
  22. package/cjs/routing.js +4 -5
  23. package/cjs/routing.js.map +1 -1
  24. package/cjs/search.js +6 -4
  25. package/cjs/search.js.map +1 -1
  26. package/cjs/{selectors-69c3d37c.js → selectors-1295124a.js} +9 -1
  27. package/cjs/selectors-1295124a.js.map +1 -0
  28. package/cjs/user.js +82 -27
  29. package/cjs/user.js.map +1 -1
  30. package/cjs/util.js +21 -91
  31. package/cjs/util.js.map +1 -1
  32. package/cjs/{injectors-72d5b989.js → version-3a808c12.js} +21 -6
  33. package/cjs/version-3a808c12.js.map +1 -0
  34. package/esm/{App-08311b77.js → App-452c2ab3.js} +223 -8
  35. package/esm/App-452c2ab3.js.map +1 -0
  36. package/esm/{RouteLoader-2cfdfc5c.js → RouteLoader-dedcc835.js} +8 -38
  37. package/esm/RouteLoader-dedcc835.js.map +1 -0
  38. package/esm/{ToJs-19a3244a.js → ToJs-6e7b247c.js} +47 -3
  39. package/esm/ToJs-6e7b247c.js.map +1 -0
  40. package/esm/{actions-fda5e103.js → actions-ddd9c623.js} +1 -1
  41. package/esm/actions-ddd9c623.js.map +1 -0
  42. package/esm/client.js +121 -16
  43. package/esm/client.js.map +1 -1
  44. package/esm/contensis-react-base.js +38 -49
  45. package/esm/contensis-react-base.js.map +1 -1
  46. package/esm/forms.js +1 -1
  47. package/esm/{login-c05fee0e.js → login-1f9ad133.js} +8 -6
  48. package/esm/login-1f9ad133.js.map +1 -0
  49. package/esm/reducers-feab84fc.js +183 -0
  50. package/esm/reducers-feab84fc.js.map +1 -0
  51. package/esm/redux.js +5 -6
  52. package/esm/redux.js.map +1 -1
  53. package/esm/routing.js +4 -5
  54. package/esm/routing.js.map +1 -1
  55. package/esm/search.js +6 -4
  56. package/esm/search.js.map +1 -1
  57. package/esm/{selectors-170581d2.js → selectors-68799788.js} +9 -1
  58. package/esm/selectors-68799788.js.map +1 -0
  59. package/esm/user.js +80 -29
  60. package/esm/user.js.map +1 -1
  61. package/esm/util.js +20 -90
  62. package/esm/util.js.map +1 -1
  63. package/esm/{injectors-3cbe3981.js → version-64906b26.js} +20 -5
  64. package/esm/version-64906b26.js.map +1 -0
  65. package/models/app/App.d.ts +3 -1
  66. package/models/app/pages/VersionInfo/components/VersionInfo.d.ts +39 -1
  67. package/models/app/pages/VersionInfo/components/VersionInfo.styled.d.ts +1 -1
  68. package/models/app/pages/VersionInfo/index.d.ts +1 -1
  69. package/models/app/pages/VersionInfo/transformations/state-to-versioninfoprops.mapper.d.ts +2 -1
  70. package/models/client/client.d.ts +9 -3
  71. package/models/client/index.d.ts +3 -1
  72. package/models/config.d.ts +33 -0
  73. package/models/index.d.ts +5 -0
  74. package/models/redux/actions/navigation.d.ts +1 -3
  75. package/models/redux/actions/version.d.ts +2 -6
  76. package/models/redux/store/history.d.ts +2 -2
  77. package/models/redux/store/injectors.d.ts +4 -4
  78. package/models/redux/store/store.d.ts +2 -2
  79. package/models/redux/util.d.ts +1 -3
  80. package/models/routing/components/Loading.d.ts +5 -4
  81. package/models/routing/components/NotFound.d.ts +5 -11
  82. package/models/routing/components/RouteLoader.d.ts +2 -1
  83. package/models/routing/components/Status.d.ts +4 -11
  84. package/models/routing/redux/actions.d.ts +6 -18
  85. package/models/routing/redux/reducers.d.ts +2 -2
  86. package/models/routing/redux/selectors.d.ts +2 -0
  87. package/models/routing/redux/types.d.ts +12 -12
  88. package/models/routing/routes.d.ts +99 -0
  89. package/models/routing/util/expressions.d.ts +2 -10
  90. package/models/routing/util/find-contenttype-mapping.d.ts +2 -1
  91. package/models/routing/util/queries.d.ts +2 -2
  92. package/models/search/containers/withListing.d.ts +4 -0
  93. package/models/search/containers/withSearch.d.ts +4 -0
  94. package/models/search/hooks/useMinilist.hook.d.ts +23 -0
  95. package/models/search/index.d.ts +16 -1
  96. package/models/search/models/Enums.d.ts +5 -0
  97. package/models/search/models/Queries.d.ts +43 -0
  98. package/models/search/models/Search.d.ts +180 -0
  99. package/models/search/models/SearchActions.d.ts +127 -0
  100. package/models/search/models/SearchProps.d.ts +45 -0
  101. package/models/search/models/SearchState.d.ts +83 -0
  102. package/models/search/models/SearchUtil.d.ts +6 -0
  103. package/models/search/models/index.d.ts +3 -0
  104. package/models/search/redux/actions.d.ts +39 -0
  105. package/models/search/redux/queries.d.ts +3 -0
  106. package/models/search/redux/reducers.d.ts +4 -0
  107. package/models/search/redux/sagas.d.ts +20 -0
  108. package/models/search/redux/schema.d.ts +9 -0
  109. package/models/search/redux/selectors.d.ts +112 -0
  110. package/models/search/redux/types.d.ts +20 -0
  111. package/models/search/redux/util.d.ts +25 -0
  112. package/models/search/search/ContensisDeliveryApi.d.ts +32 -0
  113. package/models/search/search/ToJs.d.ts +4 -0
  114. package/models/search/search/expressions.d.ts +29 -0
  115. package/models/search/search/performance.d.ts +1 -0
  116. package/models/search/search/schema.d.ts +28 -0
  117. package/models/search/search/util.d.ts +21 -0
  118. package/models/search/transformations/entry-to-filteritem.mapper.d.ts +2 -0
  119. package/models/search/transformations/filters-to-filterexpression.d.ts +1 -0
  120. package/models/search/transformations/filters-to-filterexpression.mapper.d.ts +2 -0
  121. package/models/search/transformations/searchresult-to-state.mapper.d.ts +6 -0
  122. package/models/search/transformations/state-to-queryparams.mapper.d.ts +12 -0
  123. package/models/search/transformations/state-to-searchuri.d.ts +14 -0
  124. package/models/server/features/caching/cacheDuration.schema.d.ts +2 -2
  125. package/models/server/features/caching/cacheHashing.d.ts +1 -1
  126. package/models/server/features/caching/setCachingHeaders.d.ts +4 -3
  127. package/models/server/features/response-handler/index.d.ts +5 -3
  128. package/models/server/features/response-handler/types.d.ts +5 -5
  129. package/models/server/features/reverse-proxy/index.d.ts +3 -2
  130. package/models/server/features/static-assets/index.d.ts +10 -5
  131. package/models/server/internalServer.d.ts +9 -8
  132. package/models/server/middleware/bundleManipulation.d.ts +6 -5
  133. package/models/server/middleware/resolveStartup.d.ts +13 -1
  134. package/models/server/util/displayStartupConfiguration.d.ts +1 -1
  135. package/models/server/util/staticPaths.d.ts +1 -1
  136. package/models/server/util/stringifyAttributes.d.ts +1 -1
  137. package/models/server/webApp.d.ts +8 -1
  138. package/models/{app/features/testImmer → testImmer}/redux/reducer.d.ts +0 -0
  139. package/models/{app/features/testImmer → testImmer}/redux/selectors.d.ts +0 -0
  140. package/models/user/containers/ChangePassword.container.d.ts +2 -0
  141. package/models/user/containers/ForgotPassword.container.d.ts +2 -0
  142. package/models/user/hocs/withLogin.d.ts +2 -0
  143. package/models/user/hocs/withRegistration.d.ts +2 -0
  144. package/models/user/hooks/useChangePassword.d.ts +9 -0
  145. package/models/user/hooks/useForgotPassword.d.ts +14 -0
  146. package/models/user/{containers → hooks}/useLogin.d.ts +2 -0
  147. package/models/user/{containers → hooks}/useRegistration.d.ts +2 -2
  148. package/models/user/index.d.ts +9 -5
  149. package/models/user/redux/actions.d.ts +6 -9
  150. package/models/user/redux/sagas/resetPassword.d.ts +1 -0
  151. package/models/user/redux/selectors.d.ts +11 -0
  152. package/models/user/redux/types.d.ts +12 -0
  153. package/models/user/util/LoginHelper.class.d.ts +1 -1
  154. package/models/user/util/matchGroups.d.ts +3 -1
  155. package/models/user/util/userHelper.d.ts +12 -0
  156. package/models/util/index.d.ts +1 -2
  157. package/models/util/json-mapper.d.ts +9 -0
  158. package/models/{schema.d.ts → util/schema.d.ts} +0 -0
  159. package/package-lock.json +7833 -7781
  160. package/package.json +14 -11
  161. package/cjs/App-f3164dab.js.map +0 -1
  162. package/cjs/RouteLoader-5c44f039.js.map +0 -1
  163. package/cjs/ToJs-ca9bea03.js.map +0 -1
  164. package/cjs/actions-e22726ed.js.map +0 -1
  165. package/cjs/injectors-72d5b989.js.map +0 -1
  166. package/cjs/login-6c0ef139.js.map +0 -1
  167. package/cjs/reducers-91e3e239.js +0 -119
  168. package/cjs/reducers-91e3e239.js.map +0 -1
  169. package/cjs/selectors-69c3d37c.js.map +0 -1
  170. package/cjs/version-7d8852f6.js +0 -23
  171. package/cjs/version-7d8852f6.js.map +0 -1
  172. package/esm/App-08311b77.js.map +0 -1
  173. package/esm/RouteLoader-2cfdfc5c.js.map +0 -1
  174. package/esm/ToJs-19a3244a.js.map +0 -1
  175. package/esm/actions-fda5e103.js.map +0 -1
  176. package/esm/injectors-3cbe3981.js.map +0 -1
  177. package/esm/login-c05fee0e.js.map +0 -1
  178. package/esm/reducers-f855681f.js +0 -108
  179. package/esm/reducers-f855681f.js.map +0 -1
  180. package/esm/selectors-170581d2.js.map +0 -1
  181. package/esm/version-937d57fb.js +0 -19
  182. package/esm/version-937d57fb.js.map +0 -1
  183. package/models/app/features/link/components/Link.d.ts +0 -22
  184. package/models/app/features/link/index.d.ts +0 -2
  185. package/models/app/pages/Home/Homepage.d.ts +0 -11
  186. package/models/app/routes/StaticRoutes.d.ts +0 -23
  187. package/models/routing/util/search.d.ts +0 -7
  188. package/models/server/index.d.ts +0 -3
  189. package/models/user/containers/withLogin.d.ts +0 -2
  190. package/models/user/containers/withRegistration.d.ts +0 -2
@@ -0,0 +1,43 @@
1
+ import { Query } from 'contensis-core-api';
2
+ import { VersionStatus } from 'contensis-core-api/lib/models';
3
+ import { Operators } from 'contensis-delivery-api/lib/entries/query';
4
+ import { CustomWhereClause, FeaturedResults, WeightedSearchField } from './Search';
5
+ export declare type FieldOperators = Exclude<keyof Operators, 'and' | 'or' | 'not'>;
6
+ export declare type SearchQueryOptions = {
7
+ assetTypes: string[];
8
+ contentTypeIds: string[];
9
+ customWhere: any;
10
+ dynamicOrderBy: string[];
11
+ excludeIds: string[];
12
+ featuredResults: FeaturedResults;
13
+ fields: string[];
14
+ filters: {
15
+ key: string;
16
+ value: string;
17
+ operator: FieldOperators;
18
+ }[];
19
+ includeInSearchFields: string[];
20
+ languages: string[];
21
+ pageSize: number;
22
+ pageIndex: number;
23
+ orderBy: string[];
24
+ searchTerm: string;
25
+ versionStatus: VersionStatus;
26
+ webpageTemplates: string[];
27
+ weightedSearchFields: WeightedSearchField[];
28
+ };
29
+ export declare type QueryParams = SearchQueryOptions & {
30
+ env: string;
31
+ internalPageIndex: number;
32
+ internalPaging: boolean;
33
+ linkDepth: number;
34
+ loadMorePaging: boolean;
35
+ pagesLoaded: number[];
36
+ prevPageIndex: number;
37
+ projectId: string;
38
+ selectedFilters: {
39
+ [key: string]: string;
40
+ };
41
+ };
42
+ export declare type SearchQuery = ({ contentTypeIds, customWhere, dynamicOrderBy, excludeIds, featuredResults, fields, filters, languages, pageSize, pageIndex, orderBy, searchTerm, versionStatus, webpageTemplates, weightedSearchFields, }: SearchQueryOptions, isFeatured?: boolean) => Query;
43
+ export declare type FilterQuery = (contentTypeIds: string[], versionStatus: VersionStatus, customWhere?: CustomWhereClause) => Query;
@@ -0,0 +1,180 @@
1
+ import { Context } from './Enums';
2
+ import { AppState } from './SearchState';
3
+ export declare type Tab = {
4
+ /** The facet to render as default */
5
+ defaultFacet?: string;
6
+ /** The zero-based incrementing id assigned to the tab */
7
+ id: number;
8
+ /** The tab's label for rendering */
9
+ label: string;
10
+ /** The facet to render the total results count as default */
11
+ totalCount?: string;
12
+ };
13
+ export declare type CustomApi = {
14
+ /** The uri of the REST API implementing a simple GET request */
15
+ uri: string;
16
+ };
17
+ export declare type Listing = {
18
+ /** Experimental: use a custom API to retrieve search results */
19
+ customApi?: CustomApi;
20
+ /** Experimental: override the rootUrl of the Delivery API client */
21
+ env?: string;
22
+ /** An object with a key for each filter that is required in this facet */
23
+ filters?: SearchFilters;
24
+ /** Use this to target the search to a project other than the default configured */
25
+ projectId?: string;
26
+ /** Query params object to drive the search for this facet */
27
+ queryParams: QueryParams;
28
+ /** Display title */
29
+ title: string;
30
+ };
31
+ export declare type Facet = {
32
+ /** The first facet to be shown if no facet is supplied via a route parameter [default false] */
33
+ isDefault?: boolean;
34
+ /** Set to true to temporarily disable the facet [default false] */
35
+ isDisabled?: boolean;
36
+ /** The id of the tab the facet applies to. Use 0 for default or the id assigned to the tab */
37
+ tabId?: number;
38
+ } & Listing;
39
+ export declare type SearchFilters = {
40
+ [key: string]: SearchFilter;
41
+ };
42
+ export declare type SearchFilter = {
43
+ /** The content type id we will dynamically load entries from and load into state under the items[] */
44
+ contentTypeId?: string | string[];
45
+ /** An array of CustomWhereClause to include in the search query when dynamically loading entries via the contentTypeId key */
46
+ customWhere?: CustomWhereClause;
47
+ /** The content type field we will apply the filter key to, to filter the list of returned results. */
48
+ fieldId: string | string[];
49
+ /** The Delivery API search operator we will use to filter the list of returned results. */
50
+ fieldOperator?: string;
51
+ /** The taxonomy path we will dynamically load into state under the items[] */
52
+ path?: string;
53
+ /** Setting to true will sync selected filters under matching filter keys in other facets */
54
+ isGrouped?: boolean;
55
+ /** Setting to true will ensure only one value can be selected at a time for this filter */
56
+ isSingleSelect?: boolean;
57
+ /** Supply an empty array or a hardcoded list of FilterItem depending on the type of filter we require */
58
+ items: FilterItem[];
59
+ /** The title to render next to the filter */
60
+ title: string;
61
+ };
62
+ export declare type FilterItem = {
63
+ /** Whether the filter is in a selected state */
64
+ isSelected?: boolean;
65
+ /** This will usually be the entry id or the taxonomy key */
66
+ key: string;
67
+ /** This will usually be the entry slug or the taxonomy path */
68
+ path?: string;
69
+ /** The title to render next to the filter item */
70
+ title: string;
71
+ };
72
+ export declare type FeaturedResults = {
73
+ /** If the featured results are flagged with a certain field value, specify the fieldId containing the flagged value */
74
+ fieldId?: string | string[];
75
+ /** If the featured results are flagged with a certain field value, specify the value in the flagged fieldId */
76
+ fieldValue?: any;
77
+ /** If the featured results exist in a special content type provide a contentTypeId */
78
+ contentTypeId?: string | string[];
79
+ /** The number of featured results to retrieve */
80
+ count?: number;
81
+ };
82
+ export declare type QueryParams = {
83
+ /** An array of assetTypes to search over (sys.dataFormat == 'asset'); Prefix an entry with a "!" to exclude that asset type from the search */
84
+ assetTypes?: string[];
85
+ /** An array of contentTypeIds to search over (sys.dataFormat == 'entry'); Prefix an entry with a "!" to exclude that content type from the search */
86
+ contentTypeIds: string[];
87
+ /** An array of CustomWhereClause to include in the search query */
88
+ customWhere?: CustomWhereClause;
89
+ /** Add parameters to drive an additional set of featured results */
90
+ featuredResults?: FeaturedResults;
91
+ /** An array of fields to return for each entry in the items[] */
92
+ fields?: string[];
93
+ /** Specify a boolean type field to use for excluding entries we don't want returned in search result */
94
+ includeInSearch?: string[];
95
+ /** Whether or not to load all results with the first page and handle all pagination yourself */
96
+ internalPaging?: boolean;
97
+ /** The linkDepth to apply to the facet search (defaults to 0) */
98
+ linkDepth?: number;
99
+ /** Alters the pagination style to retain previously loaded pages of results after loading next pages */
100
+ loadMorePaging?: boolean;
101
+ /** An array of orderBy expressions to add to the search query */
102
+ orderBy?: string[];
103
+ /** The number of items returned per page in the search */
104
+ pageSize?: number;
105
+ /** Allow a configured minilist to read the search.term set in state (defaults to false) */
106
+ useSearchTerm?: boolean;
107
+ /** An array of webpageTemplates to search over (sys.dataFormat == 'webpage'); Prefix an entry with a "!" to exclude that webpage template from the search */
108
+ webpageTemplates?: string[];
109
+ /** An array of WeightedSearchField to include in the search query */
110
+ weightedSearchFields?: WeightedSearchField[];
111
+ };
112
+ export declare type WhereClause = {
113
+ /** The field we wish to query */
114
+ field: string;
115
+ /** The value we want to evaluate with the chosen operator */
116
+ [key: string]: any;
117
+ };
118
+ /**
119
+ * N.B. This shares syntax with adding where operators to a search query when using the Delivery API via HTTP, and should be used sparingly for exceptional cases where the standard query falls short
120
+ */
121
+ export declare type CustomWhereClause = (WhereClause | {
122
+ not: WhereClause;
123
+ } | {
124
+ and: WhereClause[];
125
+ } | {
126
+ or: WhereClause[];
127
+ })[];
128
+ export declare type WeightedSearchField = {
129
+ /** The id of the field to query against */
130
+ fieldId: string;
131
+ /** The weighting applied to the field */
132
+ weight: number;
133
+ };
134
+ /**
135
+ * To provide all the necessary state information in order to render a fully featured search using Zengenti Isomorphic Base
136
+ *
137
+ * You need to provide a search configuration to the reducer so the initialState for your search can be set, this tells the package what you need your search to do, and where to get its data from.
138
+ */
139
+ export declare type SearchConfig = {
140
+ /** An object with a key for each facet that is required for the search */
141
+ facets: {
142
+ [key: string]: Facet;
143
+ };
144
+ /** An object with a key for each independent listing that is required for the site */
145
+ listings?: {
146
+ [key: string]: Listing;
147
+ };
148
+ /** An object with a key for each independent listing that is required for the site */
149
+ minilist?: {
150
+ [key: string]: Listing;
151
+ };
152
+ /** An Array of Tabs */
153
+ tabs: Tab[];
154
+ };
155
+ export declare type ConfigTypes = {
156
+ [key: string]: Facet;
157
+ } | {
158
+ [key: string]: Listing;
159
+ };
160
+ export declare type Mappers = {
161
+ customApi?: (queryParams: QueryParams) => {
162
+ [key: string]: string;
163
+ };
164
+ results: (entries: any[], facet?: string, context?: Context, state?: AppState) => any[];
165
+ filterItems?: (entries: any[]) => any[];
166
+ navigate?: ({ state, facet, orderBy, pageIndex, term, }: {
167
+ state: AppState;
168
+ facet?: string;
169
+ orderBy?: string;
170
+ pageIndex: number;
171
+ term?: string;
172
+ }) => NavigateUri;
173
+ resultsInfo?: (state: AppState) => any;
174
+ };
175
+ export declare type NavigateUri = {
176
+ path: string;
177
+ search: string;
178
+ hash: string;
179
+ };
180
+ export declare type SearchTransformations = Mappers;
@@ -0,0 +1,127 @@
1
+ import { List } from 'immutable';
2
+ import { PagedList } from 'contensis-core-api';
3
+ import { Entry, TaxonomyNode } from 'contensis-delivery-api/lib/models';
4
+ import { Context } from '../models/Enums';
5
+ import { Facet, Listing, Mappers } from '../models/Search';
6
+ import { AppState } from './SearchState';
7
+ import { QueryParams } from './Queries';
8
+ import { TimedSearchResponse } from './SearchUtil';
9
+ declare type Action = {
10
+ type: string;
11
+ };
12
+ export declare type WithMappers<T> = T & {
13
+ mappers: Mappers;
14
+ };
15
+ export declare type DebugFlags = boolean | {
16
+ executeSearch?: boolean;
17
+ preloadOtherFacets?: boolean;
18
+ };
19
+ export declare type TriggerSearchParams = {
20
+ config?: Facet | Listing;
21
+ context: Context;
22
+ debug?: DebugFlags;
23
+ defaultLang?: string;
24
+ excludeIds?: string[];
25
+ facet: string;
26
+ mapper?: Mappers['results'];
27
+ mappers?: Mappers;
28
+ params?: {
29
+ [key: string]: string;
30
+ };
31
+ };
32
+ export declare type TriggerSearchAction = Action & TriggerSearchParams;
33
+ export declare type TriggerSearchActionCreator = (p: TriggerSearchParams) => TriggerSearchAction;
34
+ declare type InitListingParams = {
35
+ context: Context;
36
+ debug?: DebugFlags;
37
+ defaultLang?: string;
38
+ facet: string;
39
+ listingType?: string;
40
+ mapper?: Mappers['results'];
41
+ mappers?: Mappers;
42
+ params: {
43
+ [key: string]: string;
44
+ };
45
+ preload?: boolean;
46
+ };
47
+ export declare type InitListingAction = Action & InitListingParams & {
48
+ ssr?: boolean;
49
+ };
50
+ export declare type InitListingActionCreator = (p: InitListingParams) => InitListingAction;
51
+ export declare type LoadFiltersSearchResults = Action & {
52
+ error: any;
53
+ facetKey: string;
54
+ filterKey: string;
55
+ payload: TaxonomyNode | PagedList<Entry>;
56
+ selectedKeys: List<string>;
57
+ context: Context;
58
+ mapper: Mappers['filterItems'];
59
+ };
60
+ export declare type SearchResults = {
61
+ action: ExecuteSearchAction;
62
+ featuredResult?: TimedSearchResponse;
63
+ pageIndex: number;
64
+ prevResults: List<any>;
65
+ result: TimedSearchResponse;
66
+ state: AppState;
67
+ };
68
+ export declare type LoadFiltersCompleteAction = Action & {
69
+ error: any;
70
+ facetKey: string;
71
+ filterKey: string;
72
+ payload: TaxonomyNode | PagedList<Entry>;
73
+ selectedKeys: List<string>;
74
+ context: Context;
75
+ mapper: Mappers['filterItems'];
76
+ };
77
+ export declare type EnsureSearchAction = InitListingAction & {
78
+ ogState: AppState;
79
+ };
80
+ export declare type ExecuteSearchAction = EnsureSearchAction & {
81
+ preload: boolean;
82
+ queryParams: QueryParams;
83
+ };
84
+ export declare type SetSearchEntriesParams = {
85
+ type: string;
86
+ context: Context;
87
+ defaultLang: string;
88
+ facet: string;
89
+ mappers: Mappers;
90
+ nextFacet: Facet;
91
+ preload: boolean;
92
+ ogState: AppState;
93
+ debug: DebugFlags;
94
+ params: {
95
+ [key: string]: string;
96
+ };
97
+ };
98
+ export declare type SetSearchEntriesAction = Action & SetSearchEntriesParams;
99
+ export declare type ApplySearchFilterAction = Action & {
100
+ filter: string;
101
+ key: string;
102
+ };
103
+ export declare type ApplySearchFilterActionCreator = (filter: string, key: string) => ApplySearchFilterAction;
104
+ export declare type ClearFiltersAction = Action;
105
+ export declare type ClearFiltersActionCreator = () => ClearFiltersAction;
106
+ export declare type UpdateCurrentFacetAction = Action & {
107
+ facet: string;
108
+ };
109
+ export declare type UpdateCurrentFacetActionCreator = (facet: string) => UpdateCurrentFacetAction;
110
+ export declare type UpdateCurrentTabAction = Action & {
111
+ id: number;
112
+ };
113
+ export declare type UpdateCurrentTabActionCreator = (id: number) => UpdateCurrentFacetAction;
114
+ export declare type UpdateSearchTermAction = Action & {
115
+ term: string;
116
+ };
117
+ export declare type UpdateSearchTermActionCreator = (term: string) => UpdateSearchTermAction;
118
+ export declare type UpdateSortOrderAction = Action & {
119
+ orderBy: string;
120
+ facet: string;
121
+ };
122
+ export declare type UpdateSortOrderActionCreator = (orderBy: string, facet: string) => UpdateSortOrderAction;
123
+ export declare type UpdatePageIndexAction = Action & {
124
+ pageIndex: number;
125
+ };
126
+ export declare type UpdatePageIndexActionCreator = (pageIndex: number) => UpdatePageIndexAction;
127
+ export {};
@@ -0,0 +1,45 @@
1
+ import { clearFilters, updateCurrentFacet, updateCurrentTab, updatePageIndex, updateSearchTerm, updateSelectedFilters, updateSortOrder } from '../redux/actions';
2
+ import { Facet, Facets, Filters, Paging } from '../models/SearchState';
3
+ export interface ListingProps<SearchResults = any> {
4
+ clearFilters: typeof clearFilters;
5
+ currentListing: string;
6
+ currentPageIndex: number;
7
+ featured: SearchResults[];
8
+ filters: Filters;
9
+ isLoading: boolean;
10
+ paging: Paging;
11
+ pageIsLoading: boolean;
12
+ results: SearchResults[];
13
+ resultsInfo: any;
14
+ searchTerm: string;
15
+ sortOrder: string[];
16
+ updateCurrentFacet: typeof updateCurrentFacet;
17
+ updatePageIndex: typeof updatePageIndex;
18
+ updateSearchTerm: typeof updateSearchTerm;
19
+ updateSelectedFilters: typeof updateSelectedFilters;
20
+ updateSortOrder: typeof updateSortOrder;
21
+ }
22
+ export interface SearchProps<SearchResults = any> {
23
+ clearFilters: typeof clearFilters;
24
+ currentFacet: string;
25
+ currentPageIndex: number;
26
+ currentTabIndex: number;
27
+ facet: Facet;
28
+ facets: Facets;
29
+ featuredResults: SearchResults[];
30
+ filters: Filters;
31
+ isLoading: boolean;
32
+ paging: Paging;
33
+ pageIsLoading: boolean;
34
+ results: SearchResults[];
35
+ resultsInfo: any;
36
+ searchTerm: string;
37
+ sortOrder: string[];
38
+ tabsAndFacets: any;
39
+ updateCurrentFacet: typeof updateCurrentFacet;
40
+ updateCurrentTab: typeof updateCurrentTab;
41
+ updatePageIndex: typeof updatePageIndex;
42
+ updateSearchTerm: typeof updateSearchTerm;
43
+ updateSelectedFilters: typeof updateSelectedFilters;
44
+ updateSortOrder: typeof updateSortOrder;
45
+ }
@@ -0,0 +1,83 @@
1
+ import { List, Map, OrderedMap } from 'immutable';
2
+ import { initialState, searchFacet } from '../redux/schema';
3
+ import { CustomWhereClause } from './Search';
4
+ export declare type AppState = Map<'search', typeof initialState>;
5
+ export declare type SearchState = {
6
+ currentFacet: string;
7
+ term: string;
8
+ facets: OrderedMap<string, OrderedMap<string, typeof searchFacet>>;
9
+ tabs: List<Tab>;
10
+ config: Map<string, boolean>;
11
+ };
12
+ export declare type Facets = {
13
+ [key: string]: Facet;
14
+ };
15
+ export declare type Facet = {
16
+ entries: {
17
+ isLoading: boolean;
18
+ isError: boolean;
19
+ };
20
+ featuredEntries: {
21
+ isLoading: boolean;
22
+ isError: boolean;
23
+ };
24
+ featuredResults: any[];
25
+ filters: Filters;
26
+ pagingInfo: {
27
+ isLoading: boolean;
28
+ pageCount: number;
29
+ pageSize: number;
30
+ pageIndex: number;
31
+ totalCount: number;
32
+ };
33
+ preloaded: boolean;
34
+ queryDuration: number;
35
+ queryParams: {
36
+ contentTypeIds: string[];
37
+ dynamicOrderBy: string[];
38
+ };
39
+ results: any[];
40
+ tabId: number;
41
+ title: string;
42
+ };
43
+ export declare type Filters = {
44
+ [key: string]: Filter;
45
+ };
46
+ export declare type Filter = {
47
+ contentTypeId?: string;
48
+ customWhere?: CustomWhereClause;
49
+ fieldId?: string;
50
+ isGrouped?: boolean;
51
+ isSingleSelect?: boolean;
52
+ isLoading: boolean;
53
+ isError: boolean;
54
+ items?: FilterItem[];
55
+ path?: string;
56
+ title?: string;
57
+ };
58
+ export declare type FilterItem = {
59
+ contentTypeId?: string;
60
+ title?: string;
61
+ type?: string;
62
+ key: string;
63
+ path?: string;
64
+ isSelected: boolean;
65
+ };
66
+ export declare type Paging = {
67
+ isLoading: boolean;
68
+ pageCount: number;
69
+ pageIndex: number;
70
+ pageSize: number;
71
+ pagesLoaded: number[];
72
+ prevPageIndex: number;
73
+ totalCount: number;
74
+ };
75
+ export declare type Tab = {
76
+ currentFacet: string;
77
+ facets: {
78
+ [key: string]: Facet;
79
+ };
80
+ id: number;
81
+ label: string;
82
+ totalCount: number;
83
+ };
@@ -0,0 +1,6 @@
1
+ import { Entry } from 'contensis-delivery-api/lib/models';
2
+ import { PagedList } from 'contensis-core-api';
3
+ export declare type TimedSearchResponse = {
4
+ duration: number;
5
+ payload: PagedList<Entry> | any[];
6
+ };
@@ -0,0 +1,3 @@
1
+ export type { CustomApi, CustomWhereClause, Facet as SearchFacet, FeaturedResults, FilterItem, Listing, NavigateUri, QueryParams, SearchConfig, SearchFilter, SearchFilters, SearchTransformations, Tab, WeightedSearchField, } from './Search';
2
+ export type { ListingProps, SearchProps } from './SearchProps';
3
+ export type { Facet, Filter, Filters } from './SearchState';
@@ -0,0 +1,39 @@
1
+ import { Mappers } from '../models/Search';
2
+ import { ClearFiltersActionCreator, InitListingActionCreator, TriggerSearchActionCreator } from '../models/SearchActions';
3
+ export declare const withMappers: <T>(action: T, mappers: Mappers) => T & {
4
+ mappers: Mappers;
5
+ };
6
+ export declare const triggerSearch: TriggerSearchActionCreator;
7
+ export declare const initListing: InitListingActionCreator;
8
+ export declare const navigate: (path: string, state?: any) => {
9
+ type: string;
10
+ path: string;
11
+ state: any;
12
+ };
13
+ export declare const clearFilters: ClearFiltersActionCreator;
14
+ export declare const updatePageIndex: (pageIndex: number) => {
15
+ type: string;
16
+ pageIndex: number;
17
+ };
18
+ export declare const updateCurrentFacet: (facet: string) => {
19
+ type: string;
20
+ facet: string;
21
+ };
22
+ export declare const updateCurrentTab: (id: number) => {
23
+ type: string;
24
+ id: number;
25
+ };
26
+ export declare const updateSearchTerm: (term: string) => {
27
+ type: string;
28
+ term: string;
29
+ };
30
+ export declare const updateSelectedFilters: (filter: string, key: string) => {
31
+ type: string;
32
+ filter: string;
33
+ key: string;
34
+ };
35
+ export declare const updateSortOrder: (orderBy: string, facet?: string | undefined) => {
36
+ type: string;
37
+ orderBy: string;
38
+ facet: string | undefined;
39
+ };
@@ -0,0 +1,3 @@
1
+ import { FilterQuery, SearchQuery } from '../models/Queries';
2
+ export declare const filterQuery: FilterQuery;
3
+ export declare const searchQuery: SearchQuery;
@@ -0,0 +1,4 @@
1
+ import { List, Map, OrderedMap } from 'immutable';
2
+ import { SearchConfig } from '../models/Search';
3
+ declare const _default: (config: SearchConfig) => (state: OrderedMap<string, string | Map<string, boolean> | OrderedMap<string, OrderedMap<string, OrderedMap<string, string | number | List<any> | Map<string, boolean | List<any>> | Map<string, number | boolean | List<any>> | Map<unknown, unknown> | null>>> | List<import("../models/SearchState").Tab>> | undefined, action: any) => any;
4
+ export default _default;
@@ -0,0 +1,20 @@
1
+ import { AppState } from '../models/SearchState';
2
+ import { InitListingAction, TriggerSearchAction } from '../models/SearchActions';
3
+ import { Mappers } from '../models/Search';
4
+ import { Context } from '../models/Enums';
5
+ export declare const searchSagas: import("redux-saga/effects").ForkEffect<never>[];
6
+ export declare function setRouteFilters(action: InitListingAction): Generator<import("redux-saga/effects").SelectEffect | import("redux-saga/effects").PutEffect<InitListingAction> | import("redux-saga/effects").CallEffect<void>, void, AppState>;
7
+ export declare function doSearch(action: TriggerSearchAction): Generator<import("redux-saga/effects").SelectEffect | import("redux-saga/effects").PutEffect<{
8
+ type: string;
9
+ config?: import("../models/Search").Listing | import("../models/Search").Facet | undefined;
10
+ context: Context;
11
+ debug?: import("../models/SearchActions").DebugFlags | undefined;
12
+ defaultLang?: string | undefined;
13
+ excludeIds?: string[] | undefined;
14
+ facet: string;
15
+ mapper?: ((entries: any[], facet?: string | undefined, context?: Context | undefined, state?: AppState | undefined) => any[]) | undefined;
16
+ mappers?: Mappers | undefined;
17
+ params?: {
18
+ [key: string]: string;
19
+ } | undefined;
20
+ }> | import("redux-saga/effects").PutEffect<InitListingAction> | import("redux-saga/effects").CallEffect<void>, void, AppState>;
@@ -0,0 +1,9 @@
1
+ import { List, Map, OrderedMap } from 'immutable';
2
+ import { CustomWhereClause } from '../models/Search';
3
+ export declare const entries: Map<string, boolean | List<any>>;
4
+ export declare const pagingInfo: Map<string, number | boolean | List<any>>;
5
+ export declare const searchFacet: OrderedMap<string, string | number | List<any> | Map<string, boolean | List<any>> | Map<string, number | boolean | List<any>> | Map<unknown, unknown> | null>;
6
+ export declare const searchTab: Map<string, string | number | OrderedMap<unknown, unknown> | undefined>;
7
+ export declare const filtering: Map<string, string | boolean | List<CustomWhereClause> | List<Map<string, string | boolean>>>;
8
+ export declare const filterItem: Map<string, string | boolean>;
9
+ export declare const initialState: OrderedMap<string, string | Map<string, boolean> | OrderedMap<string, OrderedMap<string, OrderedMap<string, string | number | List<any> | Map<string, boolean | List<any>> | Map<string, number | boolean | List<any>> | Map<unknown, unknown> | null>>> | List<import("../models/SearchState").Tab>>;