@zengenti/contensis-react-base 4.0.0-beta.2 → 4.0.0-beta.20
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 +24 -478
- package/cjs/{App-b56aca04.js → App-C_1U2j24.js} +218 -236
- package/cjs/App-C_1U2j24.js.map +1 -0
- package/cjs/{ChangePassword.container-ae35785e.js → ChangePassword.container-H4i1yRi6.js} +240 -315
- package/cjs/ChangePassword.container-H4i1yRi6.js.map +1 -0
- package/cjs/{ContensisDeliveryApi-4fcf049d.js → ContensisDeliveryApi-lcZ45Kxx.js} +125 -118
- package/cjs/ContensisDeliveryApi-lcZ45Kxx.js.map +1 -0
- package/cjs/{CookieConstants-000427db.js → CookieConstants-DfPiWCRZ.js} +3 -1
- package/cjs/CookieConstants-DfPiWCRZ.js.map +1 -0
- package/cjs/CookieHelper.class-Det3qfdU.js +462 -0
- package/cjs/CookieHelper.class-Det3qfdU.js.map +1 -0
- package/cjs/{RouteLoader-c06dccd5.js → RouteLoader-CAkG-Y5y.js} +62 -74
- package/cjs/RouteLoader-CAkG-Y5y.js.map +1 -0
- package/cjs/SSRContext-ciyKagks.js +71 -0
- package/cjs/SSRContext-ciyKagks.js.map +1 -0
- package/cjs/ToJs-BsWqWjdm.js +23 -0
- package/cjs/ToJs-BsWqWjdm.js.map +1 -0
- package/cjs/VersionInfo-D0mF1vkY.js +204 -0
- package/cjs/VersionInfo-D0mF1vkY.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 +47 -71
- package/cjs/client.js.map +1 -1
- package/cjs/contensis-react-base.js +645 -3303
- 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/{ToJs-a8d8f3f0.js → matchGroups-CNt2aNoC.js} +22 -96
- package/cjs/matchGroups-CNt2aNoC.js.map +1 -0
- package/cjs/redux.js +20 -20
- package/cjs/redux.js.map +1 -1
- package/cjs/routing.js +19 -7
- package/cjs/routing.js.map +1 -1
- package/cjs/sagas-CMBI1syl.js +5835 -0
- package/cjs/sagas-CMBI1syl.js.map +1 -0
- package/cjs/search.js +119 -321
- package/cjs/search.js.map +1 -1
- package/cjs/selectors-Bp_TrwG5.js +468 -0
- package/cjs/selectors-Bp_TrwG5.js.map +1 -0
- package/cjs/{version-34d91f68.js → store-CO5xslDu.js} +44 -114
- package/cjs/store-CO5xslDu.js.map +1 -0
- package/cjs/user.js +28 -33
- package/cjs/user.js.map +1 -1
- package/cjs/util-CTvFvplw.js +148 -0
- package/cjs/util-CTvFvplw.js.map +1 -0
- package/cjs/util.js +87 -215
- package/cjs/util.js.map +1 -1
- package/cjs/version-BolvQdgT.js +20 -0
- package/cjs/version-BolvQdgT.js.map +1 -0
- package/cjs/{version-a410c88e.js → version-DabwEeLw.js} +19 -22
- package/{esm/version-9f29becb.js.map → cjs/version-DabwEeLw.js.map} +1 -1
- package/esm/{App-83107d7e.js → App-DdEKwCTJ.js} +178 -196
- package/esm/App-DdEKwCTJ.js.map +1 -0
- package/esm/{ChangePassword.container-76fd5e9b.js → ChangePassword.container-BzycNMRX.js} +193 -250
- package/esm/ChangePassword.container-BzycNMRX.js.map +1 -0
- package/esm/{ContensisDeliveryApi-fe57a037.js → ContensisDeliveryApi-BgfEEyIk.js} +124 -119
- package/esm/ContensisDeliveryApi-BgfEEyIk.js.map +1 -0
- package/esm/{CookieConstants-3d3b6531.js → CookieConstants-DEmbwzYr.js} +3 -2
- package/esm/CookieConstants-DEmbwzYr.js.map +1 -0
- package/esm/CookieHelper.class-C6rTRl_1.js +459 -0
- package/esm/CookieHelper.class-C6rTRl_1.js.map +1 -0
- package/esm/{RouteLoader-29fd689a.js → RouteLoader-Bk6e6UV-.js} +46 -58
- package/esm/RouteLoader-Bk6e6UV-.js.map +1 -0
- package/esm/SSRContext-CXRqYy6B.js +63 -0
- package/esm/SSRContext-CXRqYy6B.js.map +1 -0
- package/esm/ToJs-BnRRHk6f.js +17 -0
- package/esm/ToJs-BnRRHk6f.js.map +1 -0
- package/esm/VersionInfo-j6NR0QJR.js +193 -0
- package/esm/VersionInfo-j6NR0QJR.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 +39 -62
- package/esm/client.js.map +1 -1
- package/esm/contensis-react-base.js +616 -3272
- 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/{ToJs-df57f31d.js → matchGroups-Bq8QnqFx.js} +23 -91
- package/esm/matchGroups-Bq8QnqFx.js.map +1 -0
- package/esm/redux.js +11 -9
- package/esm/redux.js.map +1 -1
- package/esm/routing.js +18 -5
- package/esm/routing.js.map +1 -1
- package/esm/sagas-BFQ4tBq_.js +5743 -0
- package/esm/sagas-BFQ4tBq_.js.map +1 -0
- package/esm/search.js +124 -323
- package/esm/search.js.map +1 -1
- package/esm/selectors-CNC7sDxg.js +404 -0
- package/esm/selectors-CNC7sDxg.js.map +1 -0
- package/esm/{version-3d9911e2.js → store-CtDx5MLq.js} +38 -85
- package/esm/store-CtDx5MLq.js.map +1 -0
- package/esm/user.js +10 -13
- package/esm/user.js.map +1 -1
- package/esm/util-BC8LWRKL.js +136 -0
- package/esm/util-BC8LWRKL.js.map +1 -0
- package/esm/util.js +69 -201
- package/esm/util.js.map +1 -1
- package/esm/version-CaL4czqJ.js +15 -0
- package/esm/version-CaL4czqJ.js.map +1 -0
- package/esm/{version-9f29becb.js → version-CfABeHJA.js} +6 -9
- package/{cjs/version-a410c88e.js.map → esm/version-CfABeHJA.js.map} +1 -1
- package/models/app/App.d.ts +1 -1
- package/models/app/pages/VersionInfo/components/VersionInfo.d.ts +4 -1
- package/models/app/pages/VersionInfo/components/VersionInfo.styled.d.ts +1 -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/{redux/appstate.d.ts → models/AppState.d.ts} +3 -3
- 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 +8 -0
- package/models/models/ReduxInjector.d.ts +5 -0
- package/models/models/RequireLogin.d.ts +6 -0
- package/models/models/RouteComponent.d.ts +3 -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 +32 -0
- package/models/models/StaticRoute.d.ts +61 -0
- package/models/models/WithEvents.d.ts +58 -0
- package/models/models/config/AppConfig.d.ts +13 -0
- package/models/{config.d.ts → models/config/ServerConfig.d.ts} +4 -12
- package/models/models/config/StateType.d.ts +2 -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/redux/util.d.ts +1 -1
- package/models/routing/components/Redirect.d.ts +1 -1
- package/models/routing/components/RouteLoader.d.ts +3 -3
- package/models/routing/components/StaticRouteLoader.d.ts +1 -1
- package/models/routing/components/Status.d.ts +1 -1
- package/models/routing/httpContext.d.ts +0 -1
- package/models/routing/index.d.ts +1 -0
- package/models/routing/redux/actions.d.ts +3 -4
- package/models/routing/redux/selectors.d.ts +44 -4
- package/models/routing/redux/types.d.ts +11 -11
- package/models/routing/util/expressions.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/containers/withListing.d.ts +4 -1
- package/models/search/containers/withSearch.d.ts +4 -1
- package/models/search/models/Queries.d.ts +6 -6
- package/models/search/models/Search.d.ts +13 -4
- package/models/search/models/SearchActions.d.ts +29 -12
- package/models/search/models/SearchProps.d.ts +4 -10
- package/models/search/models/SearchState.d.ts +8 -2
- package/models/search/redux/getIn.d.ts +2 -2
- package/models/search/redux/reducers.d.ts +5 -261
- package/models/search/redux/sagas.d.ts +13 -14
- package/models/search/redux/schema.d.ts +2 -2
- package/models/search/redux/selectors.d.ts +10 -10
- package/models/search/redux/util.d.ts +9 -1
- package/models/search/search/ContensisDeliveryApi.d.ts +6 -26
- package/models/search/search/expressions.d.ts +3 -3
- package/models/search/search/util.d.ts +25 -8
- 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 +2 -2
- package/models/server/features/response-handler/render-stream.d.ts +25 -0
- package/models/server/features/static-assets/index.d.ts +3 -3
- package/models/server/internalServer.d.ts +2 -3
- package/models/server/util/bundles.d.ts +10 -10
- package/models/server/util/headers.d.ts +1 -1
- package/models/server/util/html.d.ts +23 -0
- package/models/server/util/jsx.d.ts +42 -0
- 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/hocs/withRegistration.d.ts +6 -3
- 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 +19 -12
- package/models/util/ContensisDeliveryApi.d.ts +11 -9
- package/models/util/NoSSR.d.ts +6 -0
- package/models/util/SSRContext.d.ts +24 -0
- package/models/util/donotuse_useHistory.d.ts +6 -0
- package/models/util/index.d.ts +5 -1
- package/models/util/json-mapper.d.ts +4 -5
- package/models/util/useIsClient.d.ts +6 -0
- package/package.json +75 -97
- 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.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/urls-6fcaf4c6.js +0 -25
- package/cjs/urls-6fcaf4c6.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.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/urls-eac9a747.js +0 -22
- package/esm/urls-eac9a747.js.map +0 -1
- package/esm/version-3d9911e2.js.map +0 -1
- package/models/forms/index.d.ts +0 -1
- package/models/routing/routes.d.ts +0 -133
- package/models/search/search/ToJs.d.ts +0 -4
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { ChunkExtractor } from '@loadable/server';
|
|
2
|
-
import { ServerConfig } from "../../
|
|
2
|
+
import { ServerConfig } from "../../models";
|
|
3
3
|
export declare const loadableBundleData: ({ stats, templates }: ServerConfig, staticRoutePath: string, build?: string) => {
|
|
4
|
-
stats?: string | null
|
|
4
|
+
stats?: string | null;
|
|
5
5
|
templates?: {
|
|
6
6
|
templateHTML: string;
|
|
7
7
|
templateHTMLStatic: string;
|
|
8
8
|
templateHTMLFragment: string;
|
|
9
|
-
} | null
|
|
9
|
+
} | null;
|
|
10
10
|
};
|
|
11
11
|
type LoadableChunkExtractors = {
|
|
12
12
|
legacy?: ChunkExtractor;
|
|
@@ -16,29 +16,29 @@ type LoadableChunkExtractors = {
|
|
|
16
16
|
export declare const loadableChunkExtractors: () => LoadableChunkExtractors;
|
|
17
17
|
export declare const getBundleData: (config: ServerConfig, staticRoutePath: string) => {
|
|
18
18
|
default: {
|
|
19
|
-
stats?: string | null
|
|
19
|
+
stats?: string | null;
|
|
20
20
|
templates?: {
|
|
21
21
|
templateHTML: string;
|
|
22
22
|
templateHTMLStatic: string;
|
|
23
23
|
templateHTMLFragment: string;
|
|
24
|
-
} | null
|
|
24
|
+
} | null;
|
|
25
25
|
};
|
|
26
26
|
legacy: {
|
|
27
|
-
stats?: string | null
|
|
27
|
+
stats?: string | null;
|
|
28
28
|
templates?: {
|
|
29
29
|
templateHTML: string;
|
|
30
30
|
templateHTMLStatic: string;
|
|
31
31
|
templateHTMLFragment: string;
|
|
32
|
-
} | null
|
|
32
|
+
} | null;
|
|
33
33
|
};
|
|
34
34
|
modern: {
|
|
35
|
-
stats?: string | null
|
|
35
|
+
stats?: string | null;
|
|
36
36
|
templates?: {
|
|
37
37
|
templateHTML: string;
|
|
38
38
|
templateHTMLStatic: string;
|
|
39
39
|
templateHTMLFragment: string;
|
|
40
|
-
} | null
|
|
40
|
+
} | null;
|
|
41
41
|
};
|
|
42
42
|
};
|
|
43
|
-
export declare const getBundleTags: (loadableExtractor: LoadableChunkExtractors, scripts: ServerConfig[
|
|
43
|
+
export declare const getBundleTags: (loadableExtractor: LoadableChunkExtractors, scripts: ServerConfig["scripts"], staticRoutePath?: string) => string;
|
|
44
44
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Response } from 'express';
|
|
2
|
-
import { AppState } from "../../
|
|
2
|
+
import { AppState } from "../../models";
|
|
3
3
|
export declare const addStandardHeaders: (state: AppState, response: Response, packagejson: any, groups: {
|
|
4
4
|
globalGroups?: any[];
|
|
5
5
|
allowedGroups?: any[];
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Add assets to templateHTML in the positions represented
|
|
3
|
+
* by replacing specific keys wrapped in handlebars depending
|
|
4
|
+
* on the accessMethod(s) that have been set (or updated)
|
|
5
|
+
* while processing the request
|
|
6
|
+
*/
|
|
7
|
+
export declare const replaceHtml: ({ bundleTags, html, htmlAttributes, metadata, state, styleTags, title, templateHTML, templateHTMLFragment, templateHTMLStatic, }: {
|
|
8
|
+
bundleTags?: string | undefined;
|
|
9
|
+
html?: string | undefined;
|
|
10
|
+
htmlAttributes?: string | undefined;
|
|
11
|
+
metadata?: string | undefined;
|
|
12
|
+
state?: string | undefined;
|
|
13
|
+
styleTags?: string | undefined;
|
|
14
|
+
title?: string | undefined;
|
|
15
|
+
templateHTML?: string | undefined;
|
|
16
|
+
templateHTMLFragment?: string | undefined;
|
|
17
|
+
templateHTMLStatic?: string | undefined;
|
|
18
|
+
}, accessMethod: {
|
|
19
|
+
DYNAMIC: boolean;
|
|
20
|
+
REDUX: boolean;
|
|
21
|
+
FRAGMENT: boolean;
|
|
22
|
+
STATIC: boolean;
|
|
23
|
+
}) => string;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { ChunkExtractor } from '@loadable/server';
|
|
2
|
+
import { Request, Response } from 'express';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { ServerStyleSheet } from 'styled-components';
|
|
5
|
+
import Cookies from 'universal-cookie';
|
|
6
|
+
import { AppRoutes, SSRAccessMethod, WithEvents } from "../../models";
|
|
7
|
+
import { reduxStore } from "../../redux/store/store";
|
|
8
|
+
import { HttpContextValues } from "../../routing/httpContext";
|
|
9
|
+
/**
|
|
10
|
+
* Produce the JSX wrapped in the necessary Providers
|
|
11
|
+
* to render the app in SSR
|
|
12
|
+
* @param ReactApp the JSX to render
|
|
13
|
+
* @param { providers, props, ssrAssets }
|
|
14
|
+
* @returns the final JSX to render decorated with all Provider and App props
|
|
15
|
+
*/
|
|
16
|
+
export declare const ssrJsxProducer: (ReactApp: React.ComponentType<any>, { providers, props, }: {
|
|
17
|
+
/** Providers enrich the JSX */
|
|
18
|
+
providers: {
|
|
19
|
+
loadable: {
|
|
20
|
+
extractor: ChunkExtractor;
|
|
21
|
+
};
|
|
22
|
+
cookies?: Cookies;
|
|
23
|
+
redux: typeof reduxStore;
|
|
24
|
+
httpContext: HttpContextValues;
|
|
25
|
+
router: {
|
|
26
|
+
url: string;
|
|
27
|
+
};
|
|
28
|
+
styledComponents?: {
|
|
29
|
+
sheet: ServerStyleSheet;
|
|
30
|
+
};
|
|
31
|
+
ssrContext: {
|
|
32
|
+
accessMethod: SSRAccessMethod;
|
|
33
|
+
request: Request;
|
|
34
|
+
response: Response;
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
/** Props are supplied to the ReactApp */
|
|
38
|
+
props: {
|
|
39
|
+
routes: AppRoutes;
|
|
40
|
+
withEvents: WithEvents;
|
|
41
|
+
};
|
|
42
|
+
}) => React.JSX.Element;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Express } from 'express';
|
|
3
|
-
import { ServerConfig } from "../
|
|
3
|
+
import { ServerConfig } from "../models";
|
|
4
4
|
declare const webApp: (app: Express, ReactApp: React.ComponentType<any>, config: ServerConfig & {
|
|
5
5
|
allowedGroups?: string[];
|
|
6
6
|
globalGroups?: string[];
|
|
@@ -6,11 +6,11 @@ declare function LoginForm({ authenticationError, loading, loginUser }: {
|
|
|
6
6
|
}): React.JSX.Element;
|
|
7
7
|
declare namespace LoginForm {
|
|
8
8
|
namespace propTypes {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
let loginException: PropTypes.Requireable<boolean>;
|
|
10
|
+
let authenticationError: PropTypes.Requireable<boolean>;
|
|
11
|
+
let loading: PropTypes.Requireable<boolean>;
|
|
12
|
+
let loginUser: PropTypes.Requireable<(...args: any[]) => any>;
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
|
-
import React from
|
|
16
|
-
import PropTypes from
|
|
15
|
+
import React from 'react';
|
|
16
|
+
import PropTypes from 'prop-types';
|
|
@@ -5,9 +5,9 @@ declare function LogoutForm({ logoutUser, user }: {
|
|
|
5
5
|
}): React.JSX.Element;
|
|
6
6
|
declare namespace LogoutForm {
|
|
7
7
|
namespace propTypes {
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
let logoutUser: PropTypes.Requireable<(...args: any[]) => any>;
|
|
9
|
+
let user: PropTypes.Requireable<object>;
|
|
10
10
|
}
|
|
11
11
|
}
|
|
12
|
-
import React from
|
|
13
|
-
import PropTypes from
|
|
12
|
+
import React from 'react';
|
|
13
|
+
import PropTypes from 'prop-types';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export default LoginStyled;
|
|
2
|
-
declare const LoginStyled:
|
|
2
|
+
declare const LoginStyled: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export default LoginFormStyled;
|
|
2
|
-
declare const LoginFormStyled:
|
|
2
|
+
declare const LoginFormStyled: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
declare
|
|
1
|
+
import React from 'react';
|
|
2
|
+
declare const withLogin: (WrappedComponent: React.ComponentType) => {
|
|
3
3
|
(): React.JSX.Element;
|
|
4
4
|
displayName: string;
|
|
5
|
-
WrappedComponent:
|
|
5
|
+
WrappedComponent: React.ComponentType<{}>;
|
|
6
6
|
};
|
|
7
|
-
|
|
7
|
+
export default withLogin;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
export default withRegistration;
|
|
2
2
|
declare function withRegistration(WrappedComponent: any): import("react-redux").ConnectedComponent<(wrappedComponentProps: {
|
|
3
3
|
[key: string]: any;
|
|
4
|
-
}) => import("react").JSX.Element,
|
|
5
|
-
[
|
|
6
|
-
|
|
4
|
+
}) => import("react").JSX.Element, {
|
|
5
|
+
[x: string]: any;
|
|
6
|
+
[x: number]: any;
|
|
7
|
+
context?: import("react").Context<import("react-redux").ReactReduxContextValue<any, import("../../../node_modules/redux").UnknownAction> | null> | undefined;
|
|
8
|
+
store?: import("../../../node_modules/redux").Store | undefined;
|
|
9
|
+
}>;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
logoutUser: (redirectPath: any) => any;
|
|
1
|
+
declare const useLogin: () => {
|
|
2
|
+
loginUser: (username: string, password: string) => any;
|
|
3
|
+
logoutUser: (redirectPath?: string) => any;
|
|
5
4
|
errorMessage: any;
|
|
6
5
|
isAuthenticated: any;
|
|
7
6
|
isAuthenticationError: any;
|
|
@@ -12,3 +11,4 @@ declare function useLogin(): {
|
|
|
12
11
|
authenticationErrorMessage: any;
|
|
13
12
|
error: any;
|
|
14
13
|
};
|
|
14
|
+
export default useLogin;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
export
|
|
6
|
-
export
|
|
1
|
+
import { CookieHelper } from '../util/CookieHelper.class';
|
|
2
|
+
export declare const loginUser: (username: string, password: string, cookies?: CookieHelper) => any;
|
|
3
|
+
export declare const logoutUser: (redirectPath?: string, cookies?: CookieHelper) => any;
|
|
4
|
+
export declare const registerUser: (user: any, mappers: any) => any;
|
|
5
|
+
export declare const requestPasswordReset: (userEmailObject: any) => any;
|
|
6
|
+
export declare const resetPassword: (resetPasswordObject: any) => any;
|
|
7
|
+
export declare const changePassword: (userId: any, currentPassword: any, newPassword: any) => any;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const userSagas: import("redux-saga/effects").ForkEffect<never>[];
|
|
1
|
+
export declare const userSagas: import("redux-saga/effects").ForkEffect<never>[];
|
|
@@ -1,9 +1,5 @@
|
|
|
1
|
-
export
|
|
2
|
-
|
|
3
|
-
}[] | {
|
|
4
|
-
message: string;
|
|
5
|
-
data: any;
|
|
6
|
-
}[]> | import("redux-saga/effects").PutEffect<{
|
|
1
|
+
export declare const loginSagas: import("redux-saga/effects").ForkEffect<never>[];
|
|
2
|
+
export declare function handleRequiresLoginSaga(action: any): Generator<import("redux-saga/effects").SelectEffect | import("redux-saga/effects").CallEffect<Generator<import("redux-saga/effects").SelectEffect | Promise<any[]> | import("redux-saga/effects").PutEffect<{
|
|
7
3
|
type: string;
|
|
8
4
|
authenticationState: {
|
|
9
5
|
isLoading: boolean;
|
|
@@ -15,15 +11,8 @@ export function handleRequiresLoginSaga(action: any): Generator<import("redux-sa
|
|
|
15
11
|
errorMessage: any;
|
|
16
12
|
};
|
|
17
13
|
}> | import("redux-saga/effects").CallEffect<Generator<Promise<{
|
|
18
|
-
authenticationState:
|
|
19
|
-
|
|
20
|
-
isAuthenticated: boolean;
|
|
21
|
-
isAuthenticationError: boolean;
|
|
22
|
-
isError: boolean;
|
|
23
|
-
};
|
|
24
|
-
user: Error | {
|
|
25
|
-
groups: any;
|
|
26
|
-
} | null | undefined;
|
|
14
|
+
authenticationState: import("../../state").AuthenticationState;
|
|
15
|
+
user: any;
|
|
27
16
|
}> | import("redux-saga/effects").PutEffect<{
|
|
28
17
|
type: string;
|
|
29
18
|
authenticationState: any;
|
|
@@ -36,5 +25,4 @@ export function handleRequiresLoginSaga(action: any): Generator<import("redux-sa
|
|
|
36
25
|
cookies: any;
|
|
37
26
|
securityToken: any;
|
|
38
27
|
}>, any, any>;
|
|
39
|
-
export function refreshSecurityToken(): Generator<any, void, unknown>;
|
|
40
|
-
export const loginSagas: import("redux-saga/effects").ForkEffect<never>[];
|
|
28
|
+
export declare function refreshSecurityToken(): Generator<any, void, unknown>;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { StateType } from "../../
|
|
2
|
-
import { AppState } from "../../redux/appstate";
|
|
1
|
+
import { AppState, StateType } from "../../models";
|
|
3
2
|
export declare const selectUserIsLoading: (state: AppState) => any;
|
|
4
3
|
export declare const selectUserIsAuthenticated: (state: AppState) => any;
|
|
5
4
|
export declare const selectUserIsAuthenticationError: (state: AppState) => any;
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
export const VALIDATE_USER
|
|
2
|
-
export const SET_AUTHENTICATION_STATE
|
|
3
|
-
export const LOGIN_USER
|
|
4
|
-
export const LOGIN_SUCCESSFUL
|
|
5
|
-
export const LOGIN_FAILED
|
|
6
|
-
export const LOGOUT_USER
|
|
7
|
-
export const REGISTER_USER
|
|
8
|
-
export const REGISTER_USER_SUCCESS
|
|
9
|
-
export const REGISTER_USER_FAILED
|
|
10
|
-
export const REQUEST_USER_PASSWORD_RESET
|
|
11
|
-
export const RESET_USER_PASSWORD
|
|
12
|
-
export const REQUEST_USER_PASSWORD_RESET_SENDING
|
|
13
|
-
export const REQUEST_USER_PASSWORD_RESET_SUCCESS
|
|
14
|
-
export const REQUEST_USER_PASSWORD_RESET_ERROR
|
|
15
|
-
export const RESET_USER_PASSWORD_SENDING
|
|
16
|
-
export const RESET_USER_PASSWORD_SUCCESS
|
|
17
|
-
export const RESET_USER_PASSWORD_ERROR
|
|
18
|
-
export const CHANGE_USER_PASSWORD
|
|
19
|
-
export const CHANGE_USER_PASSWORD_SENDING
|
|
20
|
-
export const CHANGE_USER_PASSWORD_SUCCESS
|
|
21
|
-
export const CHANGE_USER_PASSWORD_ERROR
|
|
1
|
+
export declare const VALIDATE_USER = "@USER/VALIDATE_USER";
|
|
2
|
+
export declare const SET_AUTHENTICATION_STATE = "@USER/SET_AUTHENTICATION_STATE";
|
|
3
|
+
export declare const LOGIN_USER = "@USER/LOGIN_USER";
|
|
4
|
+
export declare const LOGIN_SUCCESSFUL = "@USER/LOGIN_SUCCESSFUL";
|
|
5
|
+
export declare const LOGIN_FAILED = "@USER/LOGIN_FAILED";
|
|
6
|
+
export declare const LOGOUT_USER = "@USER/LOGOUT_USER";
|
|
7
|
+
export declare const REGISTER_USER = "@USER/REGISTER_USER";
|
|
8
|
+
export declare const REGISTER_USER_SUCCESS = "@USER/REGISTER_USER_SUCCESS";
|
|
9
|
+
export declare const REGISTER_USER_FAILED = "@USER/REGISTER_USER_FAILED";
|
|
10
|
+
export declare const REQUEST_USER_PASSWORD_RESET = "@USER/REQUEST_USER_PASSWORD_RESET";
|
|
11
|
+
export declare const RESET_USER_PASSWORD = "@USER/RESET_USER_PASSWORD";
|
|
12
|
+
export declare const REQUEST_USER_PASSWORD_RESET_SENDING = "@USER/REQUEST_USER_PASSWORD_RESET_SENDING";
|
|
13
|
+
export declare const REQUEST_USER_PASSWORD_RESET_SUCCESS = "@USER/REQUEST_USER_PASSWORD_RESET_SUCCESS";
|
|
14
|
+
export declare const REQUEST_USER_PASSWORD_RESET_ERROR = "@USER/REQUEST_USER_PASSWORD_RESET_ERROR";
|
|
15
|
+
export declare const RESET_USER_PASSWORD_SENDING = "@USER/RESET_USER_PASSWORD_SENDING";
|
|
16
|
+
export declare const RESET_USER_PASSWORD_SUCCESS = "@USER/RESET_USER_PASSWORD_SUCCESS";
|
|
17
|
+
export declare const RESET_USER_PASSWORD_ERROR = "@USER/RESET_USER_PASSWORD_ERROR";
|
|
18
|
+
export declare const CHANGE_USER_PASSWORD = "@USER/CHANGE_USER_PASSWORD";
|
|
19
|
+
export declare const CHANGE_USER_PASSWORD_SENDING = "@USER/CHANGE_USER_PASSWORD_SENDING";
|
|
20
|
+
export declare const CHANGE_USER_PASSWORD_SUCCESS = "@USER/CHANGE_USER_PASSWORD_SUCCESS";
|
|
21
|
+
export declare const CHANGE_USER_PASSWORD_ERROR = "@USER/CHANGE_USER_PASSWORD_ERROR";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Group, User } from 'contensis-management-api/lib/models';
|
|
2
|
+
import { ManagementApiClientCredentials } from './util/ContensisManagementApi';
|
|
3
|
+
export type AuthenticationState = {
|
|
4
|
+
clientCredentials: ManagementApiClientCredentials | null;
|
|
5
|
+
isAuthenticated: boolean;
|
|
6
|
+
isAuthenticationError: boolean;
|
|
7
|
+
isError: boolean;
|
|
8
|
+
errorMessage?: string | null;
|
|
9
|
+
};
|
|
10
|
+
export type UserWithGroups = User & {
|
|
11
|
+
groups: Group[];
|
|
12
|
+
};
|
|
@@ -1,2 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import { Client } from 'contensis-management-api';
|
|
2
|
+
import { ManagementApiClientCredentials } from '../util/ContensisManagementApi';
|
|
3
|
+
declare const _default: (obj: Client) => ManagementApiClientCredentials;
|
|
2
4
|
export default _default;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
export
|
|
2
|
-
bearerToken
|
|
3
|
-
bearerTokenExpiryDate
|
|
4
|
-
refreshToken
|
|
5
|
-
refreshTokenExpiryDate
|
|
6
|
-
contensisClassicToken
|
|
7
|
-
username
|
|
8
|
-
password
|
|
9
|
-
}
|
|
1
|
+
export type ManagementApiClientCredentials = {
|
|
2
|
+
bearerToken?: string;
|
|
3
|
+
bearerTokenExpiryDate?: Date;
|
|
4
|
+
refreshToken?: string;
|
|
5
|
+
refreshTokenExpiryDate?: Date;
|
|
6
|
+
contensisClassicToken?: string;
|
|
7
|
+
username?: string;
|
|
8
|
+
password?: string;
|
|
9
|
+
};
|
|
10
|
+
export declare const getManagementApiClient: ({ bearerToken, bearerTokenExpiryDate, refreshToken, refreshTokenExpiryDate, contensisClassicToken, username, password, }: ManagementApiClientCredentials) => Promise<import("contensis-management-api").Client>;
|
|
@@ -1,14 +1,18 @@
|
|
|
1
|
+
import FallbackCookies from 'universal-cookie';
|
|
1
2
|
type Cookies = {
|
|
2
3
|
[k: string]: string;
|
|
3
4
|
};
|
|
4
5
|
export declare class CookieHelper {
|
|
5
6
|
private cookies;
|
|
6
|
-
private
|
|
7
|
-
private
|
|
7
|
+
private set?;
|
|
8
|
+
private remove?;
|
|
9
|
+
private update?;
|
|
10
|
+
private fallback;
|
|
8
11
|
get raw(): Cookies;
|
|
9
|
-
|
|
12
|
+
get cookie(): FallbackCookies;
|
|
13
|
+
constructor(cookies?: {
|
|
10
14
|
[k: string]: string;
|
|
11
|
-
}, setCookie
|
|
15
|
+
}, setCookie?: CookieHelper['set'], removeCookie?: CookieHelper['remove'], updateCookies?: CookieHelper['update']);
|
|
12
16
|
GetCookie(name: string): string | null;
|
|
13
17
|
SetCookie(name: string, value: string, maxAgeDays?: number): void;
|
|
14
18
|
DeleteCookie(name: string): void;
|
|
@@ -1,54 +1,42 @@
|
|
|
1
|
-
|
|
1
|
+
import { ManagementApiClientCredentials } from './ContensisManagementApi';
|
|
2
|
+
import { AuthenticationState, UserWithGroups } from '../state';
|
|
3
|
+
import { Client } from 'contensis-management-api';
|
|
4
|
+
import { CookieHelper } from './CookieHelper.class';
|
|
5
|
+
export declare class LoginHelper {
|
|
2
6
|
static CMS_URL: string;
|
|
3
7
|
static WSFED_LOGIN: boolean;
|
|
4
8
|
static LOGIN_ROUTE: string;
|
|
5
9
|
static ACCESS_DENIED_ROUTE: string;
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
static ClientRedirectToHome(location
|
|
11
|
-
static ClientRedirectToSignInPage(redirectPath
|
|
10
|
+
cookies: CookieHelper;
|
|
11
|
+
constructor(cookies?: CookieHelper);
|
|
12
|
+
static withCookies: (cookieHelper: CookieHelper) => LoginHelper;
|
|
13
|
+
static GetUserDetails: (client: Client) => Promise<[Error | null, UserWithGroups | undefined]>;
|
|
14
|
+
static ClientRedirectToHome(location?: Location): void;
|
|
15
|
+
static ClientRedirectToSignInPage(redirectPath?: string): Promise<void>;
|
|
12
16
|
static GetAccessDeniedRoute(originalPath: any): string;
|
|
13
17
|
static ClientRedirectToAccessDeniedPage(originalPath: any): void;
|
|
14
18
|
static ClientRedirectToPath(redirectPath: any): void;
|
|
15
|
-
static WsFedLogin(redirectUri
|
|
19
|
+
static WsFedLogin(redirectUri?: string): Promise<void>;
|
|
16
20
|
static RemoveSecurityTokenQuery(): void;
|
|
17
|
-
static WsFedLogout(redirectPath
|
|
18
|
-
static GetCredentialsForSecurityToken(securityToken:
|
|
19
|
-
|
|
20
|
-
}[] | {
|
|
21
|
-
message: string;
|
|
22
|
-
data: any;
|
|
23
|
-
}[]>;
|
|
24
|
-
constructor(cookies: any);
|
|
25
|
-
cookies: any;
|
|
26
|
-
SetLoginCookies({ contensisClassicToken, refreshToken }: {
|
|
27
|
-
contensisClassicToken: any;
|
|
28
|
-
refreshToken: any;
|
|
29
|
-
}): void;
|
|
21
|
+
static WsFedLogout(redirectPath?: string): Promise<void>;
|
|
22
|
+
static GetCredentialsForSecurityToken(securityToken: string): Promise<any[]>;
|
|
23
|
+
SetLoginCookies({ bearerToken, contensisClassicToken, refreshToken, }: ManagementApiClientCredentials): void;
|
|
30
24
|
GetCachedCredentials(): {
|
|
31
25
|
bearerToken: null;
|
|
32
26
|
bearerTokenExpiryDate: null;
|
|
33
|
-
refreshToken:
|
|
27
|
+
refreshToken: string | null;
|
|
34
28
|
refreshTokenExpiryDate: null;
|
|
35
|
-
contensisClassicToken:
|
|
29
|
+
contensisClassicToken: string | null;
|
|
30
|
+
securityToken: null;
|
|
36
31
|
};
|
|
37
32
|
ClearCachedCredentials(): void;
|
|
38
|
-
LoginUser({ username, password, clientCredentials }: {
|
|
39
|
-
username
|
|
40
|
-
password
|
|
41
|
-
clientCredentials
|
|
33
|
+
LoginUser({ username, password, clientCredentials, }: {
|
|
34
|
+
username?: string;
|
|
35
|
+
password?: string;
|
|
36
|
+
clientCredentials?: ManagementApiClientCredentials;
|
|
42
37
|
}): Promise<{
|
|
43
|
-
authenticationState:
|
|
44
|
-
|
|
45
|
-
isAuthenticated: boolean;
|
|
46
|
-
isAuthenticationError: boolean;
|
|
47
|
-
isError: boolean;
|
|
48
|
-
};
|
|
49
|
-
user: Error | {
|
|
50
|
-
groups: any;
|
|
51
|
-
} | null | undefined;
|
|
38
|
+
authenticationState: AuthenticationState;
|
|
39
|
+
user: any;
|
|
52
40
|
}>;
|
|
53
|
-
LogoutUser(redirectPath
|
|
41
|
+
LogoutUser(redirectPath?: string): void;
|
|
54
42
|
}
|
|
@@ -16,4 +16,4 @@ export declare const userManagerConfig: {
|
|
|
16
16
|
scope?: undefined;
|
|
17
17
|
filterProtocolClaims?: undefined;
|
|
18
18
|
};
|
|
19
|
-
export declare const createUserManager: (config: UserManagerSettings) => Promise<
|
|
19
|
+
export declare const createUserManager: (config: UserManagerSettings) => Promise<import("oidc-client").UserManager | undefined>;
|
|
@@ -1,25 +1,32 @@
|
|
|
1
1
|
import { VersionStatus } from 'contensis-core-api';
|
|
2
2
|
import { Client, Query } from 'contensis-delivery-api';
|
|
3
3
|
import { INodeOperations, NodeGetRootOptions } from 'contensis-delivery-api/lib/models';
|
|
4
|
-
import { DeliveryApi } from './ContensisDeliveryApi';
|
|
4
|
+
import { DeliveryApi, SSRContext } from './ContensisDeliveryApi';
|
|
5
5
|
import { LruCache } from './LruCache';
|
|
6
6
|
import { CookieObject } from "../user/util/CookieConstants";
|
|
7
|
-
declare class CachedSearch {
|
|
7
|
+
export declare class CachedSearch {
|
|
8
8
|
cache: LruCache;
|
|
9
9
|
cookies?: CookieObject;
|
|
10
|
-
|
|
10
|
+
ssr?: SSRContext;
|
|
11
|
+
constructor(ssr?: SSRContext);
|
|
11
12
|
getClient(...args: Parameters<DeliveryApi['getClient']>): Client;
|
|
12
|
-
search(query: Query, linkDepth?: number, project?: string): Promise<import("contensis-core-api").
|
|
13
|
+
search(query: Query, linkDepth?: number, project?: string): Promise<import("contensis-core-api").PagedSearchList<import("contensis-delivery-api").Entry>>;
|
|
13
14
|
searchUsingPost(query: Query, linkDepth?: number, project?: string): any;
|
|
14
|
-
get(id: string, linkDepth?: number, versionStatus?: VersionStatus, project?: string): Promise<import("contensis-delivery-api
|
|
15
|
+
get(id: string, linkDepth?: number, versionStatus?: VersionStatus, project?: string, fields?: string[]): Promise<import("contensis-delivery-api").Entry>;
|
|
15
16
|
getContentType(id: string, project?: string): Promise<import("contensis-core-api").ContentType>;
|
|
16
|
-
getRootNode(options: NodeGetRootOptions, project?: string): Promise<import("contensis-delivery-api
|
|
17
|
-
getNode(options: Parameters<INodeOperations['get']>[0], project?: string): Promise<import("contensis-delivery-api
|
|
18
|
-
getAncestors(options: Parameters<INodeOperations['getAncestors']>[0], project?: string): Promise<import("contensis-delivery-api
|
|
19
|
-
getChildren(options: Parameters<INodeOperations['getChildren']>[0], project?: string): Promise<import("contensis-delivery-api
|
|
20
|
-
getSiblings(options: Parameters<INodeOperations['getSiblings']>[0], project?: string): Promise<import("contensis-delivery-api
|
|
17
|
+
getRootNode(options: NodeGetRootOptions, versionStatus?: VersionStatus, project?: string): Promise<import("contensis-delivery-api").Node<import("contensis-delivery-api").Entry>>;
|
|
18
|
+
getNode(options: Parameters<INodeOperations['get']>[0], project?: string): Promise<import("contensis-delivery-api").Node<import("contensis-delivery-api").Entry>>;
|
|
19
|
+
getAncestors(options: Parameters<INodeOperations['getAncestors']>[0], project?: string): Promise<import("contensis-delivery-api").Node<import("contensis-delivery-api").Entry>[]>;
|
|
20
|
+
getChildren(options: Parameters<INodeOperations['getChildren']>[0], project?: string): Promise<import("contensis-delivery-api").Node<import("contensis-delivery-api").Entry>[]>;
|
|
21
|
+
getSiblings(options: Parameters<INodeOperations['getSiblings']>[0], project?: string): Promise<import("contensis-delivery-api").Node<import("contensis-delivery-api").Entry>[]>;
|
|
21
22
|
request<T extends () => Promise<any>>(key: string, execute: T): ReturnType<T>;
|
|
23
|
+
/** Use the cached API for fetch requests */
|
|
24
|
+
fetch(uri: RequestInfo, opts?: RequestInit): Promise<Response>;
|
|
22
25
|
}
|
|
23
26
|
export declare const cachedSearch: CachedSearch;
|
|
24
|
-
|
|
25
|
-
|
|
27
|
+
/** Create a cached search instance attached to the current environment
|
|
28
|
+
* SSR context and connected to your environment via global variable
|
|
29
|
+
* `DELIVERY_API_CONFIG` */
|
|
30
|
+
export declare const cachedSearchWithContext: (ssr?: SSRContext) => CachedSearch;
|
|
31
|
+
/** @deprecated Use cachedSearchWithContext instead */
|
|
32
|
+
export declare const cachedSearchWithCookies: (ssr?: SSRContext) => CachedSearch;
|
|
@@ -1,21 +1,23 @@
|
|
|
1
1
|
import { VersionStatus } from 'contensis-core-api';
|
|
2
|
-
import { Client, Query } from 'contensis-delivery-api';
|
|
3
|
-
import { Config } from 'contensis-delivery-api/lib/models';
|
|
2
|
+
import { Client, Config, Query } from 'contensis-delivery-api';
|
|
4
3
|
import { CookieObject } from "../user/util/CookieConstants";
|
|
5
4
|
import { Request } from 'express';
|
|
6
5
|
import { IncomingHttpHeaders } from 'http';
|
|
7
|
-
|
|
6
|
+
import { SSRContext as SSRContextType } from "../models";
|
|
7
|
+
export type SSRContext = Omit<SSRContextType, 'api'>;
|
|
8
|
+
export declare const getClientConfig: (project?: string, ssr?: SSRContext) => Config;
|
|
8
9
|
export declare class DeliveryApi {
|
|
9
10
|
cookies?: CookieObject;
|
|
10
|
-
|
|
11
|
+
ssr?: SSRContext;
|
|
12
|
+
constructor(ssr?: SSRContext);
|
|
11
13
|
getClientSideVersionStatus: () => any;
|
|
12
|
-
getServerSideVersionStatus: (request: Request) => string |
|
|
14
|
+
getServerSideVersionStatus: (request: Request) => string | import("qs").ParsedQs | (string | import("qs").ParsedQs)[];
|
|
13
15
|
getVersionStatusFromHeaders: (headers: IncomingHttpHeaders) => string | string[] | null;
|
|
14
16
|
getVersionStatusFromHostname: (currentHostname: string) => "published" | "latest";
|
|
15
|
-
search: (query: Query, linkDepth?: number, project?: string) => Promise<import("contensis-core-api").
|
|
16
|
-
getClient: (versionStatus
|
|
17
|
-
getEntry: (id: string, linkDepth?: number, versionStatus?: VersionStatus, project?: string) => Promise<import("contensis-delivery-api
|
|
17
|
+
search: (query: Query, linkDepth?: number, project?: string) => Promise<import("contensis-core-api").PagedSearchList<import("contensis-delivery-api").Entry>>;
|
|
18
|
+
getClient: (versionStatus?: VersionStatus, project?: string) => Client;
|
|
19
|
+
getEntry: (id: string, linkDepth?: number, versionStatus?: VersionStatus, project?: string) => Promise<import("contensis-delivery-api").Entry>;
|
|
18
20
|
}
|
|
19
21
|
export declare const deliveryApi: DeliveryApi;
|
|
20
|
-
export declare const deliveryApiWithCookies: (
|
|
22
|
+
export declare const deliveryApiWithCookies: (ssr?: SSRContext) => DeliveryApi;
|
|
21
23
|
export * from './CachedDeliveryApi';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Request, Response } from 'express';
|
|
2
|
+
import React, { PropsWithChildren } from 'react';
|
|
3
|
+
import { SSRAccessMethod, SSRContext as SSRContextType } from "../models";
|
|
4
|
+
/**
|
|
5
|
+
* SSRContextProvider allows us to hold and access request-scoped references
|
|
6
|
+
* throughout the component tree
|
|
7
|
+
*
|
|
8
|
+
* adding this in client side allows consumers to write universal code and use
|
|
9
|
+
* the same helpers and request-scoped refs for api, cookies and redux dispatcher
|
|
10
|
+
* as in SSR */
|
|
11
|
+
export declare const SSRContextProvider: ({ accessMethod, children, request, response, }: PropsWithChildren<{
|
|
12
|
+
accessMethod?: SSRAccessMethod;
|
|
13
|
+
request?: Request;
|
|
14
|
+
response?: Response;
|
|
15
|
+
}>) => React.JSX.Element;
|
|
16
|
+
/**
|
|
17
|
+
* Server side usage provides access to request-scoped references throughout the component tree
|
|
18
|
+
*
|
|
19
|
+
* Client side usage allows consumers to write universal code, using the same
|
|
20
|
+
* helpers and request-scoped refs for api, cookies and redux dispatcher as in SSR
|
|
21
|
+
* @returns SSRContextType
|
|
22
|
+
*/
|
|
23
|
+
export declare const useSSRContext: () => SSRContextType;
|
|
24
|
+
export declare const useDeliveryApi: () => import("./CachedDeliveryApi").CachedSearch;
|