@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.
- package/LICENSE +7 -0
- package/README.md +18 -478
- package/cjs/{App-b56aca04.js → App-BNcmM8rN.js} +215 -234
- package/cjs/App-BNcmM8rN.js.map +1 -0
- package/cjs/{ChangePassword.container-ae35785e.js → ChangePassword.container-642SYfpS.js} +209 -286
- package/cjs/ChangePassword.container-642SYfpS.js.map +1 -0
- package/cjs/CookieHelper.class-BoY5TrIi.js +562 -0
- package/cjs/CookieHelper.class-BoY5TrIi.js.map +1 -0
- package/cjs/{RouteLoader-c06dccd5.js → RouteLoader-DvyYYyIE.js} +55 -68
- package/cjs/RouteLoader-DvyYYyIE.js.map +1 -0
- package/cjs/{ContensisDeliveryApi-4fcf049d.js → SSRContext-D66GKlH7.js} +165 -119
- package/cjs/SSRContext-D66GKlH7.js.map +1 -0
- package/cjs/{ToJs-a8d8f3f0.js → ToJs-C9jwV7YB.js} +26 -80
- package/cjs/ToJs-C9jwV7YB.js.map +1 -0
- package/cjs/{_commonjsHelpers-b3309d7b.js → _commonjsHelpers-BJu3ubxk.js} +1 -1
- package/cjs/_commonjsHelpers-BJu3ubxk.js.map +1 -0
- package/cjs/client.js +67 -65
- package/cjs/client.js.map +1 -1
- package/cjs/contensis-react-base.js +386 -3293
- package/cjs/contensis-react-base.js.map +1 -1
- package/cjs/{fromJSLeaveImmer-e74c673c.js → fromJSLeaveImmer-Blvlk4t2.js} +3 -7
- package/{esm/fromJSLeaveImmer-0114ffcf.js.map → cjs/fromJSLeaveImmer-Blvlk4t2.js.map} +1 -1
- package/cjs/redux.js +18 -19
- package/cjs/redux.js.map +1 -1
- package/cjs/routing.js +13 -6
- package/cjs/routing.js.map +1 -1
- package/cjs/sagas-CbZhaRNd.js +6010 -0
- package/cjs/sagas-CbZhaRNd.js.map +1 -0
- package/cjs/search.js +105 -305
- package/cjs/search.js.map +1 -1
- package/cjs/selectors-wCs5fHD4.js +460 -0
- package/cjs/selectors-wCs5fHD4.js.map +1 -0
- package/cjs/{version-34d91f68.js → store-CADDS7cV.js} +44 -111
- package/cjs/store-CADDS7cV.js.map +1 -0
- package/cjs/{urls-6fcaf4c6.js → urls-DVIwGZmd.js} +1 -1
- package/{esm/urls-eac9a747.js.map → cjs/urls-DVIwGZmd.js.map} +1 -1
- package/cjs/user.js +12 -20
- package/cjs/user.js.map +1 -1
- package/cjs/util.js +108 -115
- package/cjs/util.js.map +1 -1
- package/cjs/{version-a410c88e.js → version-ASZx0NDG.js} +19 -22
- package/{esm/version-9f29becb.js.map → cjs/version-ASZx0NDG.js.map} +1 -1
- package/cjs/version-CM-bJ62L.js +20 -0
- package/cjs/version-CM-bJ62L.js.map +1 -0
- package/esm/{App-83107d7e.js → App-CfIZbvU9.js} +176 -195
- package/esm/App-CfIZbvU9.js.map +1 -0
- package/esm/{ChangePassword.container-76fd5e9b.js → ChangePassword.container-Q7bElOVz.js} +191 -250
- package/esm/ChangePassword.container-Q7bElOVz.js.map +1 -0
- package/esm/CookieHelper.class-DzleKOOc.js +555 -0
- package/esm/CookieHelper.class-DzleKOOc.js.map +1 -0
- package/esm/{RouteLoader-29fd689a.js → RouteLoader-qJA3UqTM.js} +40 -53
- package/esm/RouteLoader-qJA3UqTM.js.map +1 -0
- package/esm/{ContensisDeliveryApi-fe57a037.js → SSRContext-C743Oeli.js} +159 -120
- package/esm/SSRContext-C743Oeli.js.map +1 -0
- package/esm/{ToJs-df57f31d.js → ToJs-CpPNdcXS.js} +24 -77
- package/esm/ToJs-CpPNdcXS.js.map +1 -0
- package/esm/{_commonjsHelpers-1789f0cf.js → _commonjsHelpers-BFTU3MAI.js} +1 -1
- package/esm/_commonjsHelpers-BFTU3MAI.js.map +1 -0
- package/esm/client.js +55 -53
- package/esm/client.js.map +1 -1
- package/esm/contensis-react-base.js +317 -3222
- package/esm/contensis-react-base.js.map +1 -1
- package/esm/{fromJSLeaveImmer-0114ffcf.js → fromJSLeaveImmer-C_YACmOf.js} +2 -6
- package/{cjs/fromJSLeaveImmer-e74c673c.js.map → esm/fromJSLeaveImmer-C_YACmOf.js.map} +1 -1
- package/esm/redux.js +9 -8
- package/esm/redux.js.map +1 -1
- package/esm/routing.js +13 -4
- package/esm/routing.js.map +1 -1
- package/esm/sagas-xJU-zOpn.js +5916 -0
- package/esm/sagas-xJU-zOpn.js.map +1 -0
- package/esm/search.js +113 -311
- package/esm/search.js.map +1 -1
- package/esm/selectors-CBdCY0u3.js +396 -0
- package/esm/selectors-CBdCY0u3.js.map +1 -0
- package/esm/{version-3d9911e2.js → store-uQZKjfA8.js} +36 -81
- package/esm/store-uQZKjfA8.js.map +1 -0
- package/esm/{urls-eac9a747.js → urls-DfCisos-.js} +1 -1
- package/{cjs/urls-6fcaf4c6.js.map → esm/urls-DfCisos-.js.map} +1 -1
- package/esm/user.js +7 -13
- package/esm/user.js.map +1 -1
- package/esm/util.js +66 -74
- package/esm/util.js.map +1 -1
- package/esm/{version-9f29becb.js → version-B9nPx4IF.js} +6 -9
- package/{cjs/version-a410c88e.js.map → esm/version-B9nPx4IF.js.map} +1 -1
- package/esm/version-D773TD9j.js +15 -0
- package/esm/version-D773TD9j.js.map +1 -0
- package/models/app/App.d.ts +1 -1
- package/models/app/pages/VersionInfo/components/VersionInfo.d.ts +1 -1
- package/models/app/pages/VersionInfo/components/VersionInfo.styled.d.ts +2 -1
- package/models/client/client.d.ts +1 -1
- package/models/index.d.ts +1 -2
- package/models/models/AppRouteProps.d.ts +11 -0
- package/models/models/ContentTypeMapping.d.ts +89 -0
- package/models/models/EntryMapper.d.ts +3 -0
- package/models/models/GetRouteActionArgs.d.ts +15 -0
- package/models/models/MatchedRoute.d.ts +4 -0
- package/models/models/ReduxInjector.d.ts +5 -0
- package/models/models/RequireLogin.d.ts +6 -0
- package/models/models/RouteComponent.d.ts +4 -0
- package/models/models/RouteComponentProps.d.ts +9 -0
- package/models/models/RouteLoaderProps.d.ts +9 -0
- package/models/models/RouteNode.d.ts +5 -0
- package/models/models/SSRContext.d.ts +11 -0
- package/models/models/StaticRoute.d.ts +60 -0
- package/models/models/WithEvents.d.ts +58 -0
- package/models/models/config/AppConfig.d.ts +12 -0
- package/models/{config.d.ts → models/config/ServerConfig.d.ts} +3 -12
- package/models/models/config/StateType.d.ts +1 -0
- package/models/models/config/index.d.ts +3 -0
- package/models/models/index.d.ts +16 -0
- package/models/redux/actions/index.d.ts +2 -2
- package/models/redux/sagas/navigation.d.ts +1 -3
- package/models/redux/selectors/index.d.ts +2 -2
- package/models/redux/store/injectors.d.ts +16 -4
- package/models/redux/store/store.d.ts +10 -4
- package/models/redux/types/index.d.ts +2 -2
- package/models/redux/types/navigation.d.ts +3 -3
- package/models/redux/types/version.d.ts +2 -2
- package/models/routing/components/Redirect.d.ts +1 -1
- package/models/routing/components/RouteLoader.d.ts +1 -1
- package/models/routing/components/StaticRouteLoader.d.ts +1 -1
- package/models/routing/components/Status.d.ts +1 -1
- package/models/routing/redux/actions.d.ts +3 -4
- package/models/routing/redux/selectors.d.ts +2 -2
- package/models/routing/redux/types.d.ts +11 -11
- package/models/routing/routes.d.ts +1 -1
- package/models/routing/util/find-contenttype-mapping.d.ts +1 -1
- package/models/routing/util/queries.d.ts +2 -2
- package/models/search/models/Queries.d.ts +4 -2
- package/models/search/models/Search.d.ts +8 -1
- package/models/search/models/SearchActions.d.ts +3 -2
- package/models/search/models/SearchState.d.ts +5 -1
- package/models/search/redux/reducers.d.ts +2 -257
- package/models/search/redux/schema.d.ts +1 -1
- package/models/search/redux/selectors.d.ts +5 -5
- package/models/search/search/ContensisDeliveryApi.d.ts +2 -2
- package/models/search/search/ToJs.d.ts +1 -1
- package/models/search/search/expressions.d.ts +3 -3
- package/models/search/search/util.d.ts +17 -2
- package/models/search/transformations/searchresult-to-state.mapper.d.ts +1 -2
- package/models/server/features/caching/cacheDuration.schema.d.ts +1 -0
- package/models/server/features/linkdepth-api/search.d.ts +1 -1
- package/models/server/features/static-assets/index.d.ts +1 -1
- package/models/server/internalServer.d.ts +1 -1
- package/models/server/util/bundles.d.ts +1 -1
- package/models/server/util/headers.d.ts +1 -1
- package/models/server/webApp.d.ts +1 -1
- package/models/user/components/Login.d.ts +1 -1
- package/models/user/components/LoginForm.d.ts +6 -6
- package/models/user/components/LogoutForm.d.ts +4 -4
- package/models/user/components.styled/Login.styled.d.ts +1 -1
- package/models/user/components.styled/LoginForm.styled.d.ts +1 -1
- package/models/user/hocs/withLogin.d.ts +4 -4
- package/models/user/hooks/useLogin.d.ts +4 -4
- package/models/user/redux/actions.d.ts +7 -6
- package/models/user/redux/sagas/index.d.ts +1 -1
- package/models/user/redux/sagas/login.d.ts +5 -17
- package/models/user/redux/selectors.d.ts +1 -2
- package/models/user/redux/types.d.ts +21 -21
- package/models/user/state.d.ts +12 -0
- package/models/user/transformations/mapClientCredentials.d.ts +3 -1
- package/models/user/util/ContensisManagementApi.d.ts +10 -9
- package/models/user/util/CookieConstants.d.ts +1 -0
- package/models/user/util/CookieHelper.class.d.ts +8 -4
- package/models/user/util/LoginHelper.class.d.ts +25 -37
- package/models/user/util/OidcUserManager.d.ts +1 -1
- package/models/user/util/matchGroups.d.ts +1 -1
- package/models/util/CachedDeliveryApi.d.ts +11 -10
- package/models/util/ContensisDeliveryApi.d.ts +11 -7
- package/models/util/SSRContext.d.ts +29 -0
- package/models/util/index.d.ts +1 -0
- package/models/util/json-mapper.d.ts +4 -5
- package/package.json +71 -92
- package/cjs/App-b56aca04.js.map +0 -1
- package/cjs/ChangePassword.container-ae35785e.js.map +0 -1
- package/cjs/ContensisDeliveryApi-4fcf049d.js.map +0 -1
- package/cjs/CookieConstants-000427db.js +0 -10
- package/cjs/CookieConstants-000427db.js.map +0 -1
- package/cjs/RouteLoader-c06dccd5.js.map +0 -1
- package/cjs/ToJs-a8d8f3f0.js.map +0 -1
- package/cjs/_commonjsHelpers-b3309d7b.js.map +0 -1
- package/cjs/forms.js +0 -5998
- package/cjs/forms.js.map +0 -1
- package/cjs/reducers-73a03ef4.js +0 -257
- package/cjs/reducers-73a03ef4.js.map +0 -1
- package/cjs/sagas-570f23ba.js +0 -2175
- package/cjs/sagas-570f23ba.js.map +0 -1
- package/cjs/selectors-14caa813.js +0 -228
- package/cjs/selectors-14caa813.js.map +0 -1
- package/cjs/version-34d91f68.js.map +0 -1
- package/esm/App-83107d7e.js.map +0 -1
- package/esm/ChangePassword.container-76fd5e9b.js.map +0 -1
- package/esm/ContensisDeliveryApi-fe57a037.js.map +0 -1
- package/esm/CookieConstants-3d3b6531.js +0 -6
- package/esm/CookieConstants-3d3b6531.js.map +0 -1
- package/esm/RouteLoader-29fd689a.js.map +0 -1
- package/esm/ToJs-df57f31d.js.map +0 -1
- package/esm/_commonjsHelpers-1789f0cf.js.map +0 -1
- package/esm/forms.js +0 -5984
- package/esm/forms.js.map +0 -1
- package/esm/reducers-aa8cef1e.js +0 -234
- package/esm/reducers-aa8cef1e.js.map +0 -1
- package/esm/sagas-07e82e18.js +0 -2083
- package/esm/sagas-07e82e18.js.map +0 -1
- package/esm/selectors-691caf02.js +0 -186
- package/esm/selectors-691caf02.js.map +0 -1
- package/esm/version-3d9911e2.js.map +0 -1
- package/models/forms/index.d.ts +0 -1
- /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,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,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 {
|
|
2
|
-
import handleResponse from
|
|
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,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
|
|
7
|
+
import * as navigation from './navigation';
|
|
8
8
|
import * as routing from "../../routing/redux/actions";
|
|
9
|
-
import * as version from
|
|
9
|
+
import * as version from './version';
|
|
@@ -1,4 +1,2 @@
|
|
|
1
|
-
export function ensureNodeTreeSaga(action: any): Generator<
|
|
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
|
|
7
|
+
import * as navigation from './navigation';
|
|
8
8
|
import * as routing from "../../routing/redux/selectors";
|
|
9
|
-
import * as version from
|
|
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?:
|
|
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?:
|
|
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?:
|
|
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?:
|
|
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 {
|
|
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
|
-
|
|
4
|
-
|
|
5
|
-
|
|
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
|
|
7
|
+
import * as navigation from './navigation';
|
|
8
8
|
import * as routing from "../../routing/redux/types";
|
|
9
|
-
import * as version from
|
|
9
|
+
import * as version from './version';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export const GET_NODE_TREE:
|
|
2
|
-
export const SET_NODE_TREE:
|
|
3
|
-
export const GET_NODE_TREE_ERROR:
|
|
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:
|
|
2
|
-
export const SET_VERSION_STATUS:
|
|
1
|
+
export const SET_VERSION: "@VERSION/SET_VERSION";
|
|
2
|
+
export const SET_VERSION_STATUS: "@VERSION/SET_VERSION_STATUS";
|
|
@@ -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
|
|
4
|
-
|
|
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 "../../
|
|
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
|
|
2
|
-
export declare const SET_ENTRY
|
|
3
|
-
export declare const SET_NODE
|
|
4
|
-
export declare const SET_ANCESTORS
|
|
5
|
-
export declare const SET_SIBLINGS
|
|
6
|
-
export declare const SET_ENTRY_ID
|
|
7
|
-
export declare const SET_SURROGATE_KEYS
|
|
8
|
-
export declare const SET_NAVIGATION_PATH
|
|
9
|
-
export declare const SET_TARGET_PROJECT
|
|
10
|
-
export declare const SET_ROUTE
|
|
11
|
-
export declare const UPDATE_LOADING_STATE
|
|
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 "../
|
|
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
|
|
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
|
|
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
|
|
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 */
|