@zengenti/contensis-react-base 4.0.0-beta.2 → 4.0.0-beta.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (209) hide show
  1. package/LICENSE +7 -0
  2. package/README.md +18 -478
  3. package/cjs/{App-b56aca04.js → App-BNcmM8rN.js} +215 -234
  4. package/cjs/App-BNcmM8rN.js.map +1 -0
  5. package/cjs/{ChangePassword.container-ae35785e.js → ChangePassword.container-642SYfpS.js} +209 -286
  6. package/cjs/ChangePassword.container-642SYfpS.js.map +1 -0
  7. package/cjs/CookieHelper.class-BoY5TrIi.js +562 -0
  8. package/cjs/CookieHelper.class-BoY5TrIi.js.map +1 -0
  9. package/cjs/{RouteLoader-c06dccd5.js → RouteLoader-DvyYYyIE.js} +55 -68
  10. package/cjs/RouteLoader-DvyYYyIE.js.map +1 -0
  11. package/cjs/{ContensisDeliveryApi-4fcf049d.js → SSRContext-D66GKlH7.js} +165 -119
  12. package/cjs/SSRContext-D66GKlH7.js.map +1 -0
  13. package/cjs/{ToJs-a8d8f3f0.js → ToJs-C9jwV7YB.js} +26 -80
  14. package/cjs/ToJs-C9jwV7YB.js.map +1 -0
  15. package/cjs/{_commonjsHelpers-b3309d7b.js → _commonjsHelpers-BJu3ubxk.js} +1 -1
  16. package/cjs/_commonjsHelpers-BJu3ubxk.js.map +1 -0
  17. package/cjs/client.js +67 -65
  18. package/cjs/client.js.map +1 -1
  19. package/cjs/contensis-react-base.js +386 -3293
  20. package/cjs/contensis-react-base.js.map +1 -1
  21. package/cjs/{fromJSLeaveImmer-e74c673c.js → fromJSLeaveImmer-Blvlk4t2.js} +3 -7
  22. package/{esm/fromJSLeaveImmer-0114ffcf.js.map → cjs/fromJSLeaveImmer-Blvlk4t2.js.map} +1 -1
  23. package/cjs/redux.js +18 -19
  24. package/cjs/redux.js.map +1 -1
  25. package/cjs/routing.js +13 -6
  26. package/cjs/routing.js.map +1 -1
  27. package/cjs/sagas-CbZhaRNd.js +6010 -0
  28. package/cjs/sagas-CbZhaRNd.js.map +1 -0
  29. package/cjs/search.js +105 -305
  30. package/cjs/search.js.map +1 -1
  31. package/cjs/selectors-wCs5fHD4.js +460 -0
  32. package/cjs/selectors-wCs5fHD4.js.map +1 -0
  33. package/cjs/{version-34d91f68.js → store-CADDS7cV.js} +44 -111
  34. package/cjs/store-CADDS7cV.js.map +1 -0
  35. package/cjs/{urls-6fcaf4c6.js → urls-DVIwGZmd.js} +1 -1
  36. package/{esm/urls-eac9a747.js.map → cjs/urls-DVIwGZmd.js.map} +1 -1
  37. package/cjs/user.js +12 -20
  38. package/cjs/user.js.map +1 -1
  39. package/cjs/util.js +108 -115
  40. package/cjs/util.js.map +1 -1
  41. package/cjs/{version-a410c88e.js → version-ASZx0NDG.js} +19 -22
  42. package/{esm/version-9f29becb.js.map → cjs/version-ASZx0NDG.js.map} +1 -1
  43. package/cjs/version-CM-bJ62L.js +20 -0
  44. package/cjs/version-CM-bJ62L.js.map +1 -0
  45. package/esm/{App-83107d7e.js → App-CfIZbvU9.js} +176 -195
  46. package/esm/App-CfIZbvU9.js.map +1 -0
  47. package/esm/{ChangePassword.container-76fd5e9b.js → ChangePassword.container-Q7bElOVz.js} +191 -250
  48. package/esm/ChangePassword.container-Q7bElOVz.js.map +1 -0
  49. package/esm/CookieHelper.class-DzleKOOc.js +555 -0
  50. package/esm/CookieHelper.class-DzleKOOc.js.map +1 -0
  51. package/esm/{RouteLoader-29fd689a.js → RouteLoader-qJA3UqTM.js} +40 -53
  52. package/esm/RouteLoader-qJA3UqTM.js.map +1 -0
  53. package/esm/{ContensisDeliveryApi-fe57a037.js → SSRContext-C743Oeli.js} +159 -120
  54. package/esm/SSRContext-C743Oeli.js.map +1 -0
  55. package/esm/{ToJs-df57f31d.js → ToJs-CpPNdcXS.js} +24 -77
  56. package/esm/ToJs-CpPNdcXS.js.map +1 -0
  57. package/esm/{_commonjsHelpers-1789f0cf.js → _commonjsHelpers-BFTU3MAI.js} +1 -1
  58. package/esm/_commonjsHelpers-BFTU3MAI.js.map +1 -0
  59. package/esm/client.js +55 -53
  60. package/esm/client.js.map +1 -1
  61. package/esm/contensis-react-base.js +317 -3222
  62. package/esm/contensis-react-base.js.map +1 -1
  63. package/esm/{fromJSLeaveImmer-0114ffcf.js → fromJSLeaveImmer-C_YACmOf.js} +2 -6
  64. package/{cjs/fromJSLeaveImmer-e74c673c.js.map → esm/fromJSLeaveImmer-C_YACmOf.js.map} +1 -1
  65. package/esm/redux.js +9 -8
  66. package/esm/redux.js.map +1 -1
  67. package/esm/routing.js +13 -4
  68. package/esm/routing.js.map +1 -1
  69. package/esm/sagas-xJU-zOpn.js +5916 -0
  70. package/esm/sagas-xJU-zOpn.js.map +1 -0
  71. package/esm/search.js +113 -311
  72. package/esm/search.js.map +1 -1
  73. package/esm/selectors-CBdCY0u3.js +396 -0
  74. package/esm/selectors-CBdCY0u3.js.map +1 -0
  75. package/esm/{version-3d9911e2.js → store-uQZKjfA8.js} +36 -81
  76. package/esm/store-uQZKjfA8.js.map +1 -0
  77. package/esm/{urls-eac9a747.js → urls-DfCisos-.js} +1 -1
  78. package/{cjs/urls-6fcaf4c6.js.map → esm/urls-DfCisos-.js.map} +1 -1
  79. package/esm/user.js +7 -13
  80. package/esm/user.js.map +1 -1
  81. package/esm/util.js +66 -74
  82. package/esm/util.js.map +1 -1
  83. package/esm/{version-9f29becb.js → version-B9nPx4IF.js} +6 -9
  84. package/{cjs/version-a410c88e.js.map → esm/version-B9nPx4IF.js.map} +1 -1
  85. package/esm/version-D773TD9j.js +15 -0
  86. package/esm/version-D773TD9j.js.map +1 -0
  87. package/models/app/App.d.ts +1 -1
  88. package/models/app/pages/VersionInfo/components/VersionInfo.d.ts +1 -1
  89. package/models/app/pages/VersionInfo/components/VersionInfo.styled.d.ts +2 -1
  90. package/models/client/client.d.ts +1 -1
  91. package/models/index.d.ts +1 -2
  92. package/models/models/AppRouteProps.d.ts +11 -0
  93. package/models/models/ContentTypeMapping.d.ts +89 -0
  94. package/models/models/EntryMapper.d.ts +3 -0
  95. package/models/models/GetRouteActionArgs.d.ts +15 -0
  96. package/models/models/MatchedRoute.d.ts +4 -0
  97. package/models/models/ReduxInjector.d.ts +5 -0
  98. package/models/models/RequireLogin.d.ts +6 -0
  99. package/models/models/RouteComponent.d.ts +4 -0
  100. package/models/models/RouteComponentProps.d.ts +9 -0
  101. package/models/models/RouteLoaderProps.d.ts +9 -0
  102. package/models/models/RouteNode.d.ts +5 -0
  103. package/models/models/SSRContext.d.ts +11 -0
  104. package/models/models/StaticRoute.d.ts +60 -0
  105. package/models/models/WithEvents.d.ts +58 -0
  106. package/models/models/config/AppConfig.d.ts +12 -0
  107. package/models/{config.d.ts → models/config/ServerConfig.d.ts} +3 -12
  108. package/models/models/config/StateType.d.ts +1 -0
  109. package/models/models/config/index.d.ts +3 -0
  110. package/models/models/index.d.ts +16 -0
  111. package/models/redux/actions/index.d.ts +2 -2
  112. package/models/redux/sagas/navigation.d.ts +1 -3
  113. package/models/redux/selectors/index.d.ts +2 -2
  114. package/models/redux/store/injectors.d.ts +16 -4
  115. package/models/redux/store/store.d.ts +10 -4
  116. package/models/redux/types/index.d.ts +2 -2
  117. package/models/redux/types/navigation.d.ts +3 -3
  118. package/models/redux/types/version.d.ts +2 -2
  119. package/models/routing/components/Redirect.d.ts +1 -1
  120. package/models/routing/components/RouteLoader.d.ts +1 -1
  121. package/models/routing/components/StaticRouteLoader.d.ts +1 -1
  122. package/models/routing/components/Status.d.ts +1 -1
  123. package/models/routing/redux/actions.d.ts +3 -4
  124. package/models/routing/redux/selectors.d.ts +2 -2
  125. package/models/routing/redux/types.d.ts +11 -11
  126. package/models/routing/routes.d.ts +1 -1
  127. package/models/routing/util/find-contenttype-mapping.d.ts +1 -1
  128. package/models/routing/util/queries.d.ts +2 -2
  129. package/models/search/models/Queries.d.ts +4 -2
  130. package/models/search/models/Search.d.ts +8 -1
  131. package/models/search/models/SearchActions.d.ts +3 -2
  132. package/models/search/models/SearchState.d.ts +5 -1
  133. package/models/search/redux/reducers.d.ts +2 -257
  134. package/models/search/redux/schema.d.ts +1 -1
  135. package/models/search/redux/selectors.d.ts +5 -5
  136. package/models/search/search/ContensisDeliveryApi.d.ts +2 -2
  137. package/models/search/search/ToJs.d.ts +1 -1
  138. package/models/search/search/expressions.d.ts +3 -3
  139. package/models/search/search/util.d.ts +17 -2
  140. package/models/search/transformations/searchresult-to-state.mapper.d.ts +1 -2
  141. package/models/server/features/caching/cacheDuration.schema.d.ts +1 -0
  142. package/models/server/features/linkdepth-api/search.d.ts +1 -1
  143. package/models/server/features/static-assets/index.d.ts +1 -1
  144. package/models/server/internalServer.d.ts +1 -1
  145. package/models/server/util/bundles.d.ts +1 -1
  146. package/models/server/util/headers.d.ts +1 -1
  147. package/models/server/webApp.d.ts +1 -1
  148. package/models/user/components/Login.d.ts +1 -1
  149. package/models/user/components/LoginForm.d.ts +6 -6
  150. package/models/user/components/LogoutForm.d.ts +4 -4
  151. package/models/user/components.styled/Login.styled.d.ts +1 -1
  152. package/models/user/components.styled/LoginForm.styled.d.ts +1 -1
  153. package/models/user/hocs/withLogin.d.ts +4 -4
  154. package/models/user/hooks/useLogin.d.ts +4 -4
  155. package/models/user/redux/actions.d.ts +7 -6
  156. package/models/user/redux/sagas/index.d.ts +1 -1
  157. package/models/user/redux/sagas/login.d.ts +5 -17
  158. package/models/user/redux/selectors.d.ts +1 -2
  159. package/models/user/redux/types.d.ts +21 -21
  160. package/models/user/state.d.ts +12 -0
  161. package/models/user/transformations/mapClientCredentials.d.ts +3 -1
  162. package/models/user/util/ContensisManagementApi.d.ts +10 -9
  163. package/models/user/util/CookieConstants.d.ts +1 -0
  164. package/models/user/util/CookieHelper.class.d.ts +8 -4
  165. package/models/user/util/LoginHelper.class.d.ts +25 -37
  166. package/models/user/util/OidcUserManager.d.ts +1 -1
  167. package/models/user/util/matchGroups.d.ts +1 -1
  168. package/models/util/CachedDeliveryApi.d.ts +11 -10
  169. package/models/util/ContensisDeliveryApi.d.ts +11 -7
  170. package/models/util/SSRContext.d.ts +29 -0
  171. package/models/util/index.d.ts +1 -0
  172. package/models/util/json-mapper.d.ts +4 -5
  173. package/package.json +71 -92
  174. package/cjs/App-b56aca04.js.map +0 -1
  175. package/cjs/ChangePassword.container-ae35785e.js.map +0 -1
  176. package/cjs/ContensisDeliveryApi-4fcf049d.js.map +0 -1
  177. package/cjs/CookieConstants-000427db.js +0 -10
  178. package/cjs/CookieConstants-000427db.js.map +0 -1
  179. package/cjs/RouteLoader-c06dccd5.js.map +0 -1
  180. package/cjs/ToJs-a8d8f3f0.js.map +0 -1
  181. package/cjs/_commonjsHelpers-b3309d7b.js.map +0 -1
  182. package/cjs/forms.js +0 -5998
  183. package/cjs/forms.js.map +0 -1
  184. package/cjs/reducers-73a03ef4.js +0 -257
  185. package/cjs/reducers-73a03ef4.js.map +0 -1
  186. package/cjs/sagas-570f23ba.js +0 -2175
  187. package/cjs/sagas-570f23ba.js.map +0 -1
  188. package/cjs/selectors-14caa813.js +0 -228
  189. package/cjs/selectors-14caa813.js.map +0 -1
  190. package/cjs/version-34d91f68.js.map +0 -1
  191. package/esm/App-83107d7e.js.map +0 -1
  192. package/esm/ChangePassword.container-76fd5e9b.js.map +0 -1
  193. package/esm/ContensisDeliveryApi-fe57a037.js.map +0 -1
  194. package/esm/CookieConstants-3d3b6531.js +0 -6
  195. package/esm/CookieConstants-3d3b6531.js.map +0 -1
  196. package/esm/RouteLoader-29fd689a.js.map +0 -1
  197. package/esm/ToJs-df57f31d.js.map +0 -1
  198. package/esm/_commonjsHelpers-1789f0cf.js.map +0 -1
  199. package/esm/forms.js +0 -5984
  200. package/esm/forms.js.map +0 -1
  201. package/esm/reducers-aa8cef1e.js +0 -234
  202. package/esm/reducers-aa8cef1e.js.map +0 -1
  203. package/esm/sagas-07e82e18.js +0 -2083
  204. package/esm/sagas-07e82e18.js.map +0 -1
  205. package/esm/selectors-691caf02.js +0 -186
  206. package/esm/selectors-691caf02.js.map +0 -1
  207. package/esm/version-3d9911e2.js.map +0 -1
  208. package/models/forms/index.d.ts +0 -1
  209. /package/models/{redux/appstate.d.ts → models/AppState.d.ts} +0 -0
@@ -0,0 +1,89 @@
1
+ import { FieldLinkDepths } from 'contensis-core-api';
2
+ import { EntryMapper } from './EntryMapper';
3
+ import { ReduxInjector } from './ReduxInjector';
4
+ import { RouteComponent } from './RouteComponent';
5
+ import { RouteComponentProps } from './RouteComponentProps';
6
+ import { RequireLogin } from './RequireLogin';
7
+ export type ContentTypeMapping = {
8
+ /** The unique identifier for the content type to map. */
9
+ contentTypeID: string;
10
+ /**
11
+ * The React component that should be rendered for this content type.
12
+ */
13
+ component: RouteComponent<RouteComponentProps>;
14
+ /**
15
+ * Optional entry mapper to transform entry data before passing it to the component.
16
+ */
17
+ entryMapper?: EntryMapper;
18
+ /**
19
+ * An array of field IDs used to restrict the fields returned for an entry.
20
+ */
21
+ fields?: string[];
22
+ /**
23
+ * Injects Redux dependencies or actions into the route if needed.
24
+ */
25
+ injectRedux?: ReduxInjector;
26
+ /**
27
+ * The depth at which to resolve the full entry data for a linked entry or asset.
28
+ * Maximum depth is 10, with a recommended maximum of 4.
29
+ *
30
+ * A default depth of 2 is applied via `routeLoadOptions` in `onRouteLoad`.
31
+ */
32
+ linkDepth?: number;
33
+ /**
34
+ * Custom link depths for specific field paths to resolve full entry data for a linked entry or asset.
35
+ * Maximum depth is 10, with a recommended maximum of 4.
36
+ *
37
+ * This option is available only in Contensis version 16+.
38
+ */
39
+ fieldLinkDepths?: FieldLinkDepths;
40
+ /**
41
+ * Options for configuring how Site View Node data is handled, including children and siblings.
42
+ */
43
+ nodeOptions?: {
44
+ children?: {
45
+ /** The depth of descendants to include for the node. */
46
+ depth: number;
47
+ /**
48
+ * An array of field IDs used to restrict the fields returned for each entry.
49
+ */
50
+ fields?: string[];
51
+ /**
52
+ * The depth at which to resolve the full entry data for a linked entry or asset.
53
+ * Maximum depth is 10, with a recommended maximum of 4.
54
+ *
55
+ * A default depth of 2 is applied via `routeLoadOptions` in `onRouteLoad`.
56
+ */
57
+ linkDepth?: number;
58
+ /**
59
+ * Custom link depths for specific field paths to resolve full entry data for a linked entry or asset.
60
+ * Maximum depth is 10, with a recommended maximum of 4.
61
+ *
62
+ * This option is available only in Contensis version 16+.
63
+ */
64
+ fieldLinkDepths?: FieldLinkDepths;
65
+ } | boolean;
66
+ siblings?: {
67
+ /** The depth of descendants to include for the node. */
68
+ fields?: string[];
69
+ /**
70
+ * The depth at which to resolve the full entry data for a linked entry or asset.
71
+ * Maximum depth is 10, with a recommended maximum of 4.
72
+ *
73
+ * A default depth of 2 is applied via `routeLoadOptions` in `onRouteLoad`.
74
+ */
75
+ linkDepth?: number;
76
+ /**
77
+ * Custom link depths for specific field paths to resolve full entry data for a linked entry or asset.
78
+ * Maximum depth is 10, with a recommended maximum of 4.
79
+ *
80
+ * This option is available only in Contensis version 16+.
81
+ */
82
+ fieldLinkDepths?: FieldLinkDepths;
83
+ } | boolean;
84
+ };
85
+ /**
86
+ * Specifies whether login is required to access the content for this type.
87
+ */
88
+ requireLogin?: RequireLogin;
89
+ };
@@ -0,0 +1,3 @@
1
+ import { AppState } from './AppState';
2
+ import { RouteNode } from './RouteNode';
3
+ export type EntryMapper = (<MappedProps>(node: RouteNode, state?: AppState) => MappedProps | unknown) | (<MappedProps>(node: RouteNode, state?: AppState) => Promise<MappedProps | unknown>);
@@ -0,0 +1,15 @@
1
+ import { useLocation } from 'react-router-dom';
2
+ import { AppRoutes } from './AppRouteProps';
3
+ import { MatchedRoute } from './MatchedRoute';
4
+ import { SSRContext } from './SSRContext';
5
+ import { StaticRoute } from './StaticRoute';
6
+ import { WithEvents } from './WithEvents';
7
+ export type GetRouteActionArgs = {
8
+ location: ReturnType<typeof useLocation>;
9
+ path: string;
10
+ routes: AppRoutes;
11
+ ssr: SSRContext;
12
+ staticRoute?: MatchedRoute<any, StaticRoute>;
13
+ statePath: string;
14
+ withEvents: WithEvents;
15
+ };
@@ -0,0 +1,4 @@
1
+ import type { RouteObject, RouteMatch } from 'react-router';
2
+ export type MatchedRoute<ParamKey extends string = string, TRouteObject extends RouteObject = RouteObject> = Omit<RouteMatch<ParamKey>, 'route'> & {
3
+ route: TRouteObject;
4
+ };
@@ -0,0 +1,5 @@
1
+ export type ReduxInjector = () => Promise<{
2
+ key: string;
3
+ reducer: any;
4
+ saga: any;
5
+ }>;
@@ -0,0 +1,6 @@
1
+ type UserGroupRequisite = {
2
+ id?: string;
3
+ name?: string;
4
+ };
5
+ export type RequireLogin = boolean | UserGroupRequisite[];
6
+ export {};
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ import { LoadableComponent } from '@loadable/component';
3
+ import { RouteComponentProps } from './RouteComponentProps';
4
+ export type RouteComponent<Props> = LoadableComponent<RouteComponentProps> | React.ComponentType<Props>;
@@ -0,0 +1,9 @@
1
+ import { Entry } from 'contensis-delivery-api';
2
+ export type RouteComponentProps<P = any> = {
3
+ [key: string]: any;
4
+ projectId?: string;
5
+ contentTypeId?: string;
6
+ entry?: Entry | null;
7
+ mappedEntry?: P;
8
+ isLoggedIn?: boolean;
9
+ };
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ export type RouteLoaderProps = {
3
+ loadingComponent?: React.ComponentType;
4
+ notFoundComponent?: React.ComponentType<{
5
+ statusCode: number;
6
+ statusText: string;
7
+ }>;
8
+ trailingSlashRedirectCode?: 301 | 302;
9
+ };
@@ -0,0 +1,5 @@
1
+ import { Node } from 'contensis-delivery-api';
2
+ export type RouteNode = Node & {
3
+ ancestors: Node[];
4
+ children: Node[];
5
+ };
@@ -0,0 +1,11 @@
1
+ import { Request, Response } from 'express';
2
+ import { Dispatch } from "../../node_modules/redux";
3
+ import { CookieHelper } from "../user/util/CookieHelper.class";
4
+ import { cachedSearchWithCookies } from "../util";
5
+ export type SSRContext = {
6
+ api: ReturnType<typeof cachedSearchWithCookies>;
7
+ cookies: CookieHelper;
8
+ dispatch: Dispatch<any>;
9
+ request?: Request;
10
+ response?: Response;
11
+ };
@@ -0,0 +1,60 @@
1
+ import { FieldLinkDepths } from 'contensis-core-api';
2
+ import { RouteComponent } from './RouteComponent';
3
+ import { RouteComponentProps } from './RouteComponentProps';
4
+ import { EntryMapper } from './EntryMapper';
5
+ import { ReduxInjector } from './ReduxInjector';
6
+ import { RequireLogin } from './RequireLogin';
7
+ import type { RouteObject } from 'react-router';
8
+ export type StaticRoute = Omit<RouteObject, 'children'> & {
9
+ index?: false | undefined;
10
+ /**
11
+ * The React component that should be rendered for this route.
12
+ */
13
+ component?: RouteComponent<RouteComponentProps>;
14
+ /**
15
+ * Options for configuring how Site View Node data is handled.
16
+ */
17
+ children?: StaticRoute[];
18
+ fetchNode?: boolean | {
19
+ /**
20
+ * Params[] allows you pass parameters into the site view query on your static node fetch
21
+ * If your route is `/authors/:author` and your params[] array has author
22
+ * `{ params: [ 'author' ] }`, this will grab the route params and replace it with it's value
23
+ * e.g `{` author: 'jane-doe' }`, your path would become `/authors/jane-doe`
24
+ */
25
+ params?: string[];
26
+ /**
27
+ * The depth at which to resolve the full entry data for a linked entry or asset.
28
+ * Maximum depth is 10, with a recommended maximum of 4.
29
+ *
30
+ * A default depth of 2 is applied via `routeLoadOptions` in `onRouteLoad`.
31
+ */
32
+ linkDepth?: number;
33
+ /**
34
+ * Custom link depths for specific field paths to resolve full entry data for a linked entry or asset.
35
+ * Maximum depth is 10, with a recommended maximum of 4.
36
+ *
37
+ * This option is available only in Contensis version 16+.
38
+ */
39
+ fieldLinkDepths?: FieldLinkDepths;
40
+ /** The depth of descendants to include for the node. */
41
+ fields?: string[];
42
+ /**
43
+ * Optional entry mapper to transform entry data before passing it to the component.
44
+ */
45
+ entryMapper?: EntryMapper;
46
+ };
47
+ /** The depth of descendants to include for the node. */
48
+ fetchNodeLevel?: number;
49
+ /**
50
+ * Injects Redux dependencies or actions into the route if needed.
51
+ */
52
+ injectRedux?: ReduxInjector;
53
+ /**
54
+ * Specifies whether login is required to access the content for this type.
55
+ */
56
+ requireLogin?: RequireLogin;
57
+ ssr?: boolean;
58
+ ssrOnly?: boolean;
59
+ fullPath?: string;
60
+ };
@@ -0,0 +1,58 @@
1
+ import { FieldLinkDepths } from 'contensis-core-api';
2
+ import { Entry } from 'contensis-delivery-api';
3
+ import { GetRouteActionArgs } from './GetRouteActionArgs';
4
+ import { RequireLogin } from './RequireLogin';
5
+ export type OnRouteLoadArgs = Omit<GetRouteActionArgs, 'withEvents'>;
6
+ export type OnRouteLoadedArgs = OnRouteLoadArgs & {
7
+ entry?: Entry | any;
8
+ };
9
+ /**
10
+ * Configuration options to customize the app state during route changes.
11
+ * These options are evaluated on each route action, establishing the "default" behavior.
12
+ */
13
+ export type RouteLoadOptions = {
14
+ /**
15
+ * Determines whether to query related Site View Nodes by default during routing.
16
+ * Allows specifying the depth of query for ancestors, children, siblings, and the entire tree structure.
17
+ */
18
+ customNavigation?: boolean | {
19
+ ancestors: boolean | number;
20
+ children: boolean | number;
21
+ siblings: boolean | number;
22
+ tree: boolean | number;
23
+ };
24
+ customRouting?: boolean;
25
+ /**
26
+ * Sets the default language for the Site View during route changes.
27
+ *
28
+ * @default 'en-GB'
29
+ */
30
+ defaultLang?: string;
31
+ /**
32
+ * Defines the default depth for resolving full entry data for a linked entry or asset during route changes.
33
+ * Maximum depth is 10, with a recommended maximum of 4.
34
+ *
35
+ * @default 2
36
+ */
37
+ entryLinkDepth?: number;
38
+ /**
39
+ * Specifies custom depths for resolving full entry data for specific field paths in linked entries or assets during route changes.
40
+ * Maximum depth is 10, with a recommended maximum of 4.
41
+
42
+ *
43
+ * Available only in Contensis version 16+.
44
+ */
45
+ entryFieldLinkDepths?: FieldLinkDepths;
46
+ /**
47
+ * Disables the automatic scroll-to-top behavior when navigating to a new route.
48
+ */
49
+ preventScrollTop?: boolean;
50
+ refetchNode?: true;
51
+ };
52
+ export type RouteLoadedOptions = {
53
+ requireLogin?: RequireLogin;
54
+ };
55
+ export type WithEvents = {
56
+ onRouteLoad: (args: OnRouteLoadArgs) => Generator<void | RouteLoadOptions>;
57
+ onRouteLoaded: (args: OnRouteLoadedArgs) => Generator<void | RouteLoadedOptions>;
58
+ };
@@ -0,0 +1,12 @@
1
+ import { AppRoutes } from '../AppRouteProps';
2
+ import { WithEvents } from '../WithEvents';
3
+ import { StateType } from './StateType';
4
+ export type AppConfig = {
5
+ stateType?: StateType;
6
+ routes: AppRoutes;
7
+ withReducers: {
8
+ [key: string]: any;
9
+ };
10
+ withSagas: any[];
11
+ withEvents: WithEvents;
12
+ };
@@ -1,18 +1,9 @@
1
- import { AppRoutes, WithEvents } from './routing/routes';
2
- import handleResponse from './server/features/response-handler';
3
- export type StateType = 'immutable' | 'js';
4
- export type AppConfig = {
5
- stateType?: StateType;
6
- routes: AppRoutes;
7
- withReducers: {
8
- [key: string]: any;
9
- };
10
- withSagas: any[];
11
- withEvents: WithEvents;
12
- };
1
+ import { AppConfig } from './AppConfig';
2
+ import handleResponse from "../../server/features/response-handler";
13
3
  export type ServerConfig = AppConfig & {
14
4
  appRootPath?: string;
15
5
  disableSsrRedux?: boolean;
6
+ enableSsrCookies?: boolean;
16
7
  handleResponses?: typeof handleResponse;
17
8
  handleExceptions?: boolean | string[];
18
9
  reverseProxyPaths?: string[];
@@ -0,0 +1 @@
1
+ export type StateType = 'immutable' | 'js';
@@ -0,0 +1,3 @@
1
+ export * from './AppConfig';
2
+ export * from './ServerConfig';
3
+ export * from './StateType';
@@ -0,0 +1,16 @@
1
+ export * from './config';
2
+ export * from './AppRouteProps';
3
+ export * from './AppState';
4
+ export * from './ContentTypeMapping';
5
+ export * from './EntryMapper';
6
+ export * from './GetRouteActionArgs';
7
+ export * from './MatchedRoute';
8
+ export * from './ReduxInjector';
9
+ export * from './RequireLogin';
10
+ export * from './RouteComponent';
11
+ export * from './RouteComponentProps';
12
+ export * from './RouteLoaderProps';
13
+ export * from './RouteNode';
14
+ export * from './SSRContext';
15
+ export * from './StaticRoute';
16
+ export * from './WithEvents';
@@ -4,6 +4,6 @@ declare namespace _default {
4
4
  export { version };
5
5
  }
6
6
  export default _default;
7
- import * as navigation from "./navigation";
7
+ import * as navigation from './navigation';
8
8
  import * as routing from "../../routing/redux/actions";
9
- import * as version from "./version";
9
+ import * as version from './version';
@@ -1,4 +1,2 @@
1
- export function ensureNodeTreeSaga(action: any): Generator<Promise<import("contensis-delivery-api/lib/models").Node> | import("redux-saga/effects").SelectEffect | import("redux-saga/effects").PutEffect<{
2
- type: string;
3
- }>, void, unknown>;
1
+ export function ensureNodeTreeSaga(action: any): Generator<any, void, unknown>;
4
2
  export const navigationSagas: import("redux-saga/effects").ForkEffect<never>[];
@@ -4,6 +4,6 @@ declare namespace _default {
4
4
  export { version };
5
5
  }
6
6
  export default _default;
7
- import * as navigation from "./navigation";
7
+ import * as navigation from './navigation';
8
8
  import * as routing from "../../routing/redux/selectors";
9
- import * as version from "./version";
9
+ import * as version from './version';
@@ -2,18 +2,30 @@ export function convertSagaArray(sagas: any): any;
2
2
  export function injectReducer({ key, reducer }: {
3
3
  key: any;
4
4
  reducer: any;
5
- }, store?: any): void;
5
+ }, store?: import("../../../node_modules/redux").Store<import("../..").AppState, import("../../../node_modules/redux").Action<any>> & {
6
+ runSaga: <S extends import("redux-saga").Saga>(saga: S, ...args: Parameters<S>) => import("redux-saga").Task<any>;
7
+ close: () => void;
8
+ }): void;
6
9
  export function injectSaga({ key, saga }: {
7
10
  key: any;
8
11
  saga: any;
9
- }, store?: any): void;
12
+ }, store?: import("../../../node_modules/redux").Store<import("../..").AppState, import("../../../node_modules/redux").Action<any>> & {
13
+ runSaga: <S extends import("redux-saga").Saga>(saga: S, ...args: Parameters<S>) => import("redux-saga").Task<any>;
14
+ close: () => void;
15
+ }): void;
10
16
  export function injectRedux({ key, reducer, saga }: {
11
17
  key: any;
12
18
  reducer: any;
13
19
  saga: any;
14
- }, store?: any): void;
20
+ }, store?: import("../../../node_modules/redux").Store<import("../..").AppState, import("../../../node_modules/redux").Action<any>> & {
21
+ runSaga: <S extends import("redux-saga").Saga>(saga: S, ...args: Parameters<S>) => import("redux-saga").Task<any>;
22
+ close: () => void;
23
+ }): void;
15
24
  export function useInjectRedux({ key, reducer, saga }: {
16
25
  key: any;
17
26
  reducer: any;
18
27
  saga: any;
19
- }, store?: any): void;
28
+ }, store?: import("../../../node_modules/redux").Store<import("../..").AppState, import("../../../node_modules/redux").Action<any>> & {
29
+ runSaga: <S extends import("redux-saga").Saga>(saga: S, ...args: Parameters<S>) => import("redux-saga").Task<any>;
30
+ close: () => void;
31
+ }): void;
@@ -1,6 +1,12 @@
1
- import { AppState } from '../appstate';
1
+ import { Action, Store } from "../../../node_modules/redux";
2
+ import createSagaMiddleware from 'redux-saga';
3
+ import { AppState, StateType } from "../../models";
2
4
  import { History, MemoryHistory } from 'history';
3
- import { StateType } from "../../config";
4
- export declare let reduxStore: any;
5
- declare const _default: (featureReducers: any, initialState: AppState, history: History | MemoryHistory, stateType: StateType) => Promise<any>;
5
+ type ReduxAppStore = Store<AppState, Action<any>>;
6
+ type ReduxSagaAppStore = ReduxAppStore & {
7
+ runSaga: ReturnType<typeof createSagaMiddleware>['run'];
8
+ close: () => void;
9
+ };
10
+ export declare let reduxStore: ReduxSagaAppStore;
11
+ declare const _default: (featureReducers: any, initialState: AppState, history: History | MemoryHistory, stateType: StateType) => Promise<ReduxSagaAppStore>;
6
12
  export default _default;
@@ -4,6 +4,6 @@ declare namespace _default {
4
4
  export { version };
5
5
  }
6
6
  export default _default;
7
- import * as navigation from "./navigation";
7
+ import * as navigation from './navigation';
8
8
  import * as routing from "../../routing/redux/types";
9
- import * as version from "./version";
9
+ import * as version from './version';
@@ -1,3 +1,3 @@
1
- export const GET_NODE_TREE: string;
2
- export const SET_NODE_TREE: string;
3
- export const GET_NODE_TREE_ERROR: string;
1
+ export const GET_NODE_TREE: "@NAVIGATION/_GET_NODE_TREE";
2
+ export const SET_NODE_TREE: "@NAVIGATION/_SET_NODE_TREE";
3
+ export const GET_NODE_TREE_ERROR: "@NAVIGATION/_GET_NODE_TREE_ERROR";
@@ -1,2 +1,2 @@
1
- export const SET_VERSION: string;
2
- export const SET_VERSION_STATUS: string;
1
+ export const SET_VERSION: "@VERSION/SET_VERSION";
2
+ export const SET_VERSION_STATUS: "@VERSION/SET_VERSION_STATUS";
@@ -1,5 +1,5 @@
1
1
  import React, { PropsWithChildren } from 'react';
2
- export declare const Redirect: ({ code, to, }: React.PropsWithChildren<{
2
+ export declare const Redirect: ({ code, to, }: PropsWithChildren<{
3
3
  code: 301 | 302;
4
4
  to: string;
5
5
  }>) => React.JSX.Element;
@@ -1,4 +1,4 @@
1
1
  /// <reference types="react" />
2
- import { AppRootProps, RouteLoaderProps } from '../routes';
2
+ import { AppRootProps, RouteLoaderProps } from "../../models";
3
3
  declare const _default: (props: AppRootProps & RouteLoaderProps) => JSX.Element;
4
4
  export default _default;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import type { StaticRoute } from '../routes';
2
+ import type { StaticRoute } from "../../models";
3
3
  export interface StaticRouteLoaderProps {
4
4
  staticRoutes: StaticRoute[];
5
5
  }
@@ -1,4 +1,4 @@
1
1
  import React, { PropsWithChildren } from 'react';
2
- export declare const Status: ({ code, children, }: React.PropsWithChildren<{
2
+ export declare const Status: ({ code, children, }: PropsWithChildren<{
3
3
  code: number;
4
4
  }>) => React.JSX.Element;
@@ -1,9 +1,8 @@
1
1
  import { useLocation } from 'react-router-dom';
2
2
  import { Entry } from 'contensis-delivery-api/lib/models';
3
- import { AppRoutes, MatchedRoute, StaticRoute, WithEvents } from '../routes';
4
- import { CookieHelper } from "../../user/util/CookieHelper.class";
5
- export declare const setNavigationPath: (path: string, location: ReturnType<typeof useLocation>, staticRoute: MatchedRoute<string, StaticRoute> | undefined, withEvents: WithEvents, statePath: string, routes: AppRoutes, cookies: CookieHelper) => any;
3
+ import { AppRoutes, MatchedRoute, StaticRoute, SSRContext, WithEvents } from "../../models";
4
+ export declare const setNavigationPath: (path: string, location: ReturnType<typeof useLocation>, staticRoute: MatchedRoute<string, StaticRoute> | undefined, withEvents: WithEvents, statePath: string, routes: AppRoutes, ssr: SSRContext) => any;
6
5
  export declare const setCurrentProject: (project: string, allowedGroups: any, hostname: string) => any;
7
6
  export declare const setRoute: (path: string, state?: any) => any;
8
7
  export declare const setRouteEntry: (entry: Entry) => any;
9
- export declare const setSurrogateKeys: (keys: string, url: string) => any;
8
+ export declare const setSurrogateKeys: (keys: string, url: string, status: number) => any;
@@ -1,8 +1,8 @@
1
- import { StateType } from "../../config";
2
- import { AppState } from "../../redux/appstate";
1
+ import { AppState, StateType } from "../../models";
3
2
  export declare const selectRouteEntry: (state: AppState, returnType?: StateType) => any;
4
3
  export declare const selectMappedEntry: (state: AppState, returnType?: StateType) => any;
5
4
  export declare const selectSurrogateKeys: (state: AppState) => any;
5
+ export declare const selectSsrApiCalls: (state: AppState) => any;
6
6
  export declare const selectCurrentHostname: (state: AppState) => any;
7
7
  export declare const selectCurrentTreeID: (state: AppState) => any;
8
8
  export declare const selectRouteEntryEntryId: (state: AppState) => any;
@@ -1,11 +1,11 @@
1
- export declare const GET_ENTRY: string;
2
- export declare const SET_ENTRY: string;
3
- export declare const SET_NODE: string;
4
- export declare const SET_ANCESTORS: string;
5
- export declare const SET_SIBLINGS: string;
6
- export declare const SET_ENTRY_ID: string;
7
- export declare const SET_SURROGATE_KEYS: string;
8
- export declare const SET_NAVIGATION_PATH: string;
9
- export declare const SET_TARGET_PROJECT: string;
10
- export declare const SET_ROUTE: string;
11
- export declare const UPDATE_LOADING_STATE: string;
1
+ export declare const GET_ENTRY = "@ROUTING/_GET_ENTRY";
2
+ export declare const SET_ENTRY = "@ROUTING/_SET_ENTRY";
3
+ export declare const SET_NODE = "@ROUTING/_SET_NODE";
4
+ export declare const SET_ANCESTORS = "@ROUTING/_SET_ANCESTORS";
5
+ export declare const SET_SIBLINGS = "@ROUTING/_SET_SIBLINGS";
6
+ export declare const SET_ENTRY_ID = "@ROUTING/_SET_ENTRY_ID";
7
+ export declare const SET_SURROGATE_KEYS = "@ROUTING/_SET_SURROGATE_KEYS";
8
+ export declare const SET_NAVIGATION_PATH = "@ROUTING/_SET_NAVIGATION_PATH";
9
+ export declare const SET_TARGET_PROJECT = "@ROUTING/_SET_TARGET_PROJECT";
10
+ export declare const SET_ROUTE = "@ROUTING/_SET_ROUTE";
11
+ export declare const UPDATE_LOADING_STATE = "@ROUTING/_UPDATE_LOADING_STATE";
@@ -1,7 +1,7 @@
1
1
  import type { RouteObject, RouteMatch } from 'react-router';
2
2
  import { Entry, Node } from 'contensis-delivery-api/lib/models';
3
3
  import React from 'react';
4
- import { AppState } from "../redux/appstate";
4
+ import { AppState } from "../models";
5
5
  import { CookieHelper } from "../user/util/CookieHelper.class";
6
6
  type RouteComponent<Props> = React.ComponentType<Props>;
7
7
  export type RouteNode = Node & {
@@ -1,2 +1,2 @@
1
- import { ContentTypeMapping } from '../routes';
1
+ import { ContentTypeMapping } from "../../models";
2
2
  export declare const findContentTypeMapping: (ContentTypeMappings: ContentTypeMapping[], contentTypeId: string) => ContentTypeMapping | undefined;
@@ -1,3 +1,3 @@
1
- import { VersionStatus } from 'contensis-core-api';
1
+ import { FieldLinkDepths, VersionStatus } from 'contensis-core-api';
2
2
  import { Query } from 'contensis-delivery-api';
3
- export declare const routeEntryByFieldsQuery: (id: string, language?: string, fields?: string[], versionStatus?: VersionStatus) => Query;
3
+ export declare const routeEntryByFieldsQuery: (id: string, language: string | undefined, contentTypeId: string | undefined, fields: string[] | undefined, fieldLinkDepths: FieldLinkDepths, versionStatus?: VersionStatus) => Query;
@@ -1,4 +1,4 @@
1
- import { Operators, Query, VersionStatus } from 'contensis-core-api';
1
+ import { FieldLinkDepths, Operators, Query, QueryAggregations, VersionStatus } from 'contensis-core-api';
2
2
  import { CustomWhereClause, FeaturedResults, WeightedSearchField } from './Search';
3
3
  export type FieldOperators = Exclude<keyof Operators, 'and' | 'or' | 'not'>;
4
4
  export type LogicOperators = 'and' | 'or' | 'not';
@@ -9,12 +9,14 @@ export type FilterExpression = {
9
9
  logicOperator: LogicOperators;
10
10
  };
11
11
  export type SearchQueryOptions = {
12
+ aggregations: QueryAggregations;
12
13
  assetTypes: string[];
13
14
  contentTypeIds: string[];
14
15
  customWhere: any;
15
16
  dynamicOrderBy: string[];
16
17
  excludeIds: string[];
17
18
  featuredResults: FeaturedResults;
19
+ fieldLinkDepths: FieldLinkDepths;
18
20
  fields: string[];
19
21
  filters: FilterExpression[];
20
22
  fuzzySearch?: boolean;
@@ -42,5 +44,5 @@ export type QueryParams = SearchQueryOptions & {
42
44
  [key: string]: string;
43
45
  };
44
46
  };
45
- export type SearchQuery = ({ contentTypeIds, customWhere, dynamicOrderBy, excludeIds, featuredResults, fields, filters, fuzzySearch, languages, pageSize, pageIndex, omitDefaultSearchFields, orderBy, searchTerm, versionStatus, webpageTemplates, weightedSearchFields, }: SearchQueryOptions, isFeatured?: boolean) => Query;
47
+ export type SearchQuery = ({ aggregations, contentTypeIds, customWhere, dynamicOrderBy, excludeIds, featuredResults, fields, filters, fuzzySearch, languages, pageSize, pageIndex, omitDefaultSearchFields, orderBy, searchTerm, versionStatus, webpageTemplates, weightedSearchFields, }: SearchQueryOptions, isFeatured?: boolean) => Query;
46
48
  export type FilterQuery = (contentTypeIds: string[], versionStatus: VersionStatus, customWhere?: CustomWhereClause) => Query;
@@ -1,5 +1,6 @@
1
+ import { FieldLinkDepths, QueryAggregations } from 'contensis-core-api';
1
2
  import { Entry } from 'contensis-delivery-api/lib/models';
2
- import MappingTemplate from 'jsonpath-mapper/dist/models/Template';
3
+ import { MappingTemplate } from 'jsonpath-mapper';
3
4
  import { Context } from './Enums';
4
5
  import { FieldOperators, LogicOperators } from './Queries';
5
6
  import { AppState } from './SearchState';
@@ -96,11 +97,15 @@ export type SearchQueryParams = {
96
97
  assetTypes?: string[];
97
98
  /** An array of contentTypeIds to search over (sys.dataFormat == 'entry'); Prefix an entry with a "!" to exclude that content type from the search */
98
99
  contentTypeIds: string[];
100
+ /** Any additional field aggregations to add to the search query */
101
+ customAggregations?: QueryAggregations;
99
102
  /** An array of CustomWhereClause to include in the search query */
100
103
  customWhere?: CustomWhereClause;
101
104
  /** Add parameters to drive an additional set of featured results */
102
105
  featuredResults?: FeaturedResults;
103
106
  /** An array of fields to return for each entry in the items[] */
107
+ fieldLinkDepths?: FieldLinkDepths;
108
+ /** An array of fields to return for each entry in the items[] */
104
109
  fields?: string[];
105
110
  /** Allows a “fuzzy” search (defaults to `false`) */
106
111
  fuzzySearch?: boolean;
@@ -120,6 +125,8 @@ export type SearchQueryParams = {
120
125
  pageSize?: number;
121
126
  /** Allow a configured minilist to read the search.term set in state (defaults to false) */
122
127
  useSearchTerm?: boolean;
128
+ /** Allow overriding of versionStatus, irrespective of environment */
129
+ versionStatus?: 'latest' | 'published';
123
130
  /** An array of webpageTemplates to search over (sys.dataFormat == 'webpage'); Prefix an entry with a "!" to exclude that webpage template from the search */
124
131
  webpageTemplates?: string[];
125
132
  /** An array of WeightedSearchField to include in the search query */