@zengenti/contensis-react-base 3.0.2-beta.9 → 3.1.1-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +38 -2
- package/cjs/{App-81a45001.js → App-555eebb0.js} +70 -34
- package/cjs/App-555eebb0.js.map +1 -0
- package/cjs/{login-51b66359.js → ChangePassword.container-f3f94d8f.js} +246 -84
- package/cjs/ChangePassword.container-f3f94d8f.js.map +1 -0
- package/cjs/{ContensisDeliveryApi-de88df2a.js → ContensisDeliveryApi-ea5ffdc2.js} +162 -122
- package/cjs/ContensisDeliveryApi-ea5ffdc2.js.map +1 -0
- package/cjs/CookieConstants-000427db.js +10 -0
- package/cjs/CookieConstants-000427db.js.map +1 -0
- package/cjs/{RouteLoader-47d70a26.js → RouteLoader-014a95b9.js} +8 -5
- package/cjs/RouteLoader-014a95b9.js.map +1 -0
- package/cjs/{ToJs-61c03582.js → ToJs-64970869.js} +49 -2
- package/cjs/ToJs-64970869.js.map +1 -0
- package/cjs/_commonjsHelpers-b3309d7b.js +11 -0
- package/cjs/_commonjsHelpers-b3309d7b.js.map +1 -0
- package/cjs/client.js +14 -12
- package/cjs/client.js.map +1 -1
- package/cjs/contensis-react-base.js +47 -361
- package/cjs/contensis-react-base.js.map +1 -1
- package/cjs/forms.js +3495 -127
- package/cjs/forms.js.map +1 -1
- package/cjs/redux.js +3 -4
- package/cjs/redux.js.map +1 -1
- package/cjs/routing.js +4 -3
- package/cjs/routing.js.map +1 -1
- package/cjs/{sagas-6d12e7ca.js → sagas-e04b94c1.js} +44 -20
- package/cjs/sagas-e04b94c1.js.map +1 -0
- package/cjs/search.js +13 -13
- package/cjs/search.js.map +1 -1
- package/cjs/{selectors-c76c2676.js → selectors-8e56cc34.js} +14 -13
- package/cjs/selectors-8e56cc34.js.map +1 -0
- package/cjs/user.js +33 -159
- package/cjs/user.js.map +1 -1
- package/cjs/util.js +6 -4
- package/cjs/util.js.map +1 -1
- package/cjs/{version-886f49d8.js → version-91b90ee8.js} +3 -3
- package/cjs/{version-886f49d8.js.map → version-91b90ee8.js.map} +1 -1
- package/cjs/{version-38afaf2a.js → version-fb4ba30b.js} +16 -24
- package/cjs/version-fb4ba30b.js.map +1 -0
- package/esm/{App-5f914483.js → App-aaea6310.js} +64 -29
- package/esm/App-aaea6310.js.map +1 -0
- package/esm/{login-4d07c2de.js → ChangePassword.container-724c8e0a.js} +229 -78
- package/esm/ChangePassword.container-724c8e0a.js.map +1 -0
- package/esm/ContensisDeliveryApi-fe53fa10.js +265 -0
- package/esm/ContensisDeliveryApi-fe53fa10.js.map +1 -0
- package/esm/CookieConstants-3d3b6531.js +6 -0
- package/esm/CookieConstants-3d3b6531.js.map +1 -0
- package/esm/{RouteLoader-f5d5f733.js → RouteLoader-fe64ca81.js} +8 -5
- package/esm/RouteLoader-fe64ca81.js.map +1 -0
- package/esm/{ToJs-0066e629.js → ToJs-c75473e9.js} +49 -3
- package/esm/ToJs-c75473e9.js.map +1 -0
- package/esm/_commonjsHelpers-1789f0cf.js +8 -0
- package/esm/_commonjsHelpers-1789f0cf.js.map +1 -0
- package/esm/client.js +15 -13
- package/esm/client.js.map +1 -1
- package/esm/contensis-react-base.js +46 -361
- package/esm/contensis-react-base.js.map +1 -1
- package/esm/forms.js +3497 -129
- package/esm/forms.js.map +1 -1
- package/esm/redux.js +6 -7
- package/esm/redux.js.map +1 -1
- package/esm/routing.js +4 -3
- package/esm/routing.js.map +1 -1
- package/esm/{sagas-53d2aefb.js → sagas-933a8fc8.js} +44 -20
- package/esm/sagas-933a8fc8.js.map +1 -0
- package/esm/search.js +14 -14
- package/esm/search.js.map +1 -1
- package/esm/{selectors-3f0d804d.js → selectors-0fe67d47.js} +14 -14
- package/esm/selectors-0fe67d47.js.map +1 -0
- package/esm/user.js +21 -151
- package/esm/user.js.map +1 -1
- package/esm/util.js +4 -4
- package/esm/{version-dd31c7f0.js → version-7ea8bea8.js} +17 -24
- package/esm/version-7ea8bea8.js.map +1 -0
- package/esm/{version-f4629693.js → version-f42f7bdc.js} +3 -3
- package/esm/{version-f4629693.js.map → version-f42f7bdc.js.map} +1 -1
- package/models/client/client.d.ts +1 -1
- package/models/config.d.ts +4 -4
- package/models/redux/appstate.d.ts +2 -1
- package/models/routing/redux/actions.d.ts +10 -6
- package/models/routing/redux/selectors.d.ts +5 -4
- package/models/routing/redux/types.d.ts +0 -1
- package/models/routing/routes.d.ts +20 -17
- package/models/routing/util/queries.d.ts +3 -2
- package/models/search/models/Queries.d.ts +9 -10
- package/models/search/models/Search.d.ts +26 -24
- package/models/search/models/SearchActions.d.ts +36 -36
- package/models/search/models/SearchState.d.ts +11 -11
- package/models/search/models/SearchUtil.d.ts +1 -1
- package/models/search/models/WithSearch.d.ts +1 -1
- package/models/search/redux/actions.d.ts +7 -7
- package/models/search/redux/selectors.d.ts +27 -27
- package/models/search/redux/types.d.ts +21 -21
- package/models/search/redux/util.d.ts +2 -2
- package/models/search/search/ContensisDeliveryApi.d.ts +1 -1
- package/models/search/search/expressions.d.ts +4 -4
- package/models/search/search/util.d.ts +2 -2
- package/models/search/transformations/state-to-queryparams.mapper.d.ts +1 -1
- package/models/server/features/linkdepth-api/LinkDepthSearchService.d.ts +1 -1
- package/models/server/features/linkdepth-api/search.d.ts +3 -3
- package/models/server/internalServer.d.ts +7 -5
- package/models/server/util/bundles.d.ts +2 -2
- package/models/server/util/handleExceptions.d.ts +1 -1
- package/models/testImmer/redux/reducer.d.ts +1 -1
- package/models/user/components/Login.d.ts +2 -3
- package/models/user/containers/ChangePassword.container.d.ts +2 -2
- package/models/user/containers/ForgotPassword.container.d.ts +2 -2
- package/models/user/containers/Login.container.d.ts +2 -2
- package/models/user/containers/Registration.container.d.ts +2 -2
- package/models/user/hocs/withLogin.d.ts +5 -11
- package/models/user/hocs/withRegistration.d.ts +2 -8
- package/models/user/redux/actions.d.ts +2 -2
- package/models/user/redux/sagas/login.d.ts +9 -8
- package/models/user/redux/selectors.d.ts +4 -4
- package/models/user/util/CookieConstants.d.ts +8 -0
- package/models/user/util/CookieHelper.class.d.ts +15 -3
- package/models/user/util/LoginHelper.class.d.ts +27 -23
- package/models/util/CachedDeliveryApi.d.ts +25 -0
- package/models/util/ContensisDeliveryApi.d.ts +20 -44
- package/models/util/LruCache.d.ts +12 -0
- package/models/util/ToJs.d.ts +1 -1
- package/models/util/index.d.ts +1 -1
- package/models/util/json-mapper.d.ts +1 -1
- package/package.json +10 -11
- package/cjs/App-81a45001.js.map +0 -1
- package/cjs/ContensisDeliveryApi-de88df2a.js.map +0 -1
- package/cjs/RouteLoader-47d70a26.js.map +0 -1
- package/cjs/ToJs-61c03582.js.map +0 -1
- package/cjs/login-51b66359.js.map +0 -1
- package/cjs/sagas-6d12e7ca.js.map +0 -1
- package/cjs/selectors-c76c2676.js.map +0 -1
- package/cjs/version-38afaf2a.js.map +0 -1
- package/esm/App-5f914483.js.map +0 -1
- package/esm/ContensisDeliveryApi-ad06857d.js +0 -227
- package/esm/ContensisDeliveryApi-ad06857d.js.map +0 -1
- package/esm/RouteLoader-f5d5f733.js.map +0 -1
- package/esm/ToJs-0066e629.js.map +0 -1
- package/esm/login-4d07c2de.js.map +0 -1
- package/esm/sagas-53d2aefb.js.map +0 -1
- package/esm/selectors-3f0d804d.js.map +0 -1
- package/esm/version-dd31c7f0.js.map +0 -1
package/esm/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sources":["../src/client/client.tsx"],"sourcesContent":["import 'isomorphic-fetch';\nimport React from 'react';\nimport { render, hydrate } from 'react-dom';\nimport { AppContainer } from 'react-hot-loader';\nimport { Provider as ReduxProvider } from 'react-redux';\nimport { Router } from 'react-router-dom';\nimport { loadableReady } from '@loadable/component';\nimport { parse } from 'query-string';\nimport { CookiesProvider } from 'react-cookie';\n\nimport { selectVersionStatus } from '~/redux/selectors/version';\nimport { setVersionStatus } from '~/redux/actions/version';\nimport rootSaga from '~/redux/sagas';\nimport { browserHistory as history } from '~/redux/store/history';\nimport createStore from '~/redux/store/store';\n\nimport { setCurrentProject } from '~/routing/redux/actions';\n\nimport { deliveryApi } from '~/util/ContensisDeliveryApi';\nimport pickProject from '~/util/pickProject';\n\nimport { AppConfig } from '~/config';\n\ndeclare let window: typeof globalThis & {\n isDynamic;\n REDUX_DATA;\n};\n\ntype ReactAppProps = { routes: any; withEvents: any };\n\nclass ClientApp {\n constructor(ReactApp: React.ComponentType<ReactAppProps>, config: AppConfig) {\n const documentRoot = document.getElementById('root');\n\n const {\n stateType = 'immutable',\n routes,\n withReducers,\n withSagas,\n withEvents,\n } = config;\n\n const GetClientJSX = store => {\n const ClientJsx = (\n <
|
|
1
|
+
{"version":3,"file":"client.js","sources":["../src/client/client.tsx"],"sourcesContent":["import 'isomorphic-fetch';\nimport React from 'react';\nimport { render, hydrate } from 'react-dom';\nimport { AppContainer } from 'react-hot-loader';\nimport { Provider as ReduxProvider } from 'react-redux';\nimport { Router } from 'react-router-dom';\nimport { loadableReady } from '@loadable/component';\nimport { parse } from 'query-string';\nimport { CookiesProvider } from 'react-cookie';\n\nimport { selectVersionStatus } from '~/redux/selectors/version';\nimport { setVersionStatus } from '~/redux/actions/version';\nimport rootSaga from '~/redux/sagas';\nimport { browserHistory as history } from '~/redux/store/history';\nimport createStore from '~/redux/store/store';\n\nimport { setCurrentProject } from '~/routing/redux/actions';\n\nimport { deliveryApi } from '~/util/ContensisDeliveryApi';\nimport pickProject from '~/util/pickProject';\n\nimport { AppConfig } from '~/config';\n\ndeclare let window: typeof globalThis & {\n isDynamic;\n REDUX_DATA;\n};\n\ntype ReactAppProps = { routes: any; withEvents: any };\n\n// Fix TS2769 error No overload matches this call\nconst Container = AppContainer as any; // as typeof AppContainer;\n\nclass ClientApp {\n constructor(ReactApp: React.ComponentType<ReactAppProps>, config: AppConfig) {\n const documentRoot = document.getElementById('root');\n\n const {\n stateType = 'immutable',\n routes,\n withReducers,\n withSagas,\n withEvents,\n } = config;\n\n const GetClientJSX = store => {\n const ClientJsx = (\n <Container>\n <CookiesProvider>\n <ReduxProvider store={store}>\n <Router history={history}>\n <ReactApp routes={routes} withEvents={withEvents} />\n </Router>\n </ReduxProvider>\n </CookiesProvider>\n </Container>\n );\n return ClientJsx;\n };\n\n const isProduction = !(process.env.NODE_ENV !== 'production');\n\n /**\n * Webpack HMR Setup.\n */\n const HMRRenderer = Component => {\n if (isProduction)\n loadableReady(\n () => {\n hydrate(Component, documentRoot);\n },\n { namespace: 'modern' }\n );\n else render(Component, documentRoot);\n };\n\n const hmr = store => {\n // webpack Hot Module Replacement API\n if (module.hot) {\n module.hot.accept(ReactApp as unknown as string, () => {\n // if you are using harmony modules ({modules:false})\n HMRRenderer(GetClientJSX(store));\n });\n }\n };\n\n const qs = parse(window.location.search);\n const versionStatus = deliveryApi.getClientSideVersionStatus();\n\n if (\n window.isDynamic ||\n window.REDUX_DATA ||\n process.env.NODE_ENV !== 'production'\n ) {\n createStore(withReducers, window.REDUX_DATA, history, stateType).then(\n store => {\n const state = store.getState();\n const ssrVersionStatus = selectVersionStatus(state);\n if (!ssrVersionStatus)\n store.dispatch(setVersionStatus(versionStatus));\n\n /* eslint-disable no-console */\n console.log('Hydrating from inline Redux');\n /* eslint-enable no-console */\n store.runSaga(rootSaga(withSagas));\n store.dispatch(\n setCurrentProject(\n pickProject(window.location.hostname, qs),\n [],\n window.location.hostname\n )\n );\n\n delete window.REDUX_DATA;\n HMRRenderer(GetClientJSX(store));\n\n hmr(store);\n }\n );\n } else {\n fetch(`${window.location.pathname}?redux=true`)\n .then(response => response.json())\n .then(data => {\n const ssRedux = JSON.parse(data);\n createStore(withReducers, ssRedux, history, stateType).then(store => {\n store.dispatch(setVersionStatus(versionStatus));\n\n store.runSaga(rootSaga(withSagas));\n store.dispatch(\n setCurrentProject(\n pickProject(window.location.hostname, qs),\n [],\n window.location.hostname\n )\n );\n\n HMRRenderer(GetClientJSX(store));\n\n hmr(store);\n });\n });\n }\n }\n}\n\nexport default ClientApp;\n"],"names":["Container","AppContainer","ClientApp","constructor","ReactApp","config","documentRoot","document","getElementById","stateType","routes","withReducers","withSagas","withEvents","GetClientJSX","store","ClientJsx","React","createElement","CookiesProvider","ReduxProvider","Router","history","isProduction","process","env","NODE_ENV","HMRRenderer","Component","loadableReady","hydrate","namespace","render","hmr","module","hot","accept","qs","parse","window","location","search","versionStatus","deliveryApi","getClientSideVersionStatus","isDynamic","REDUX_DATA","createStore","then","state","getState","ssrVersionStatus","selectVersionStatus","dispatch","setVersionStatus","console","log","runSaga","rootSaga","setCurrentProject","pickProject","hostname","fetch","pathname","response","json","data","ssRedux","JSON"],"mappings":"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"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as cachedSearch, d as deliveryApi } from './ContensisDeliveryApi-
|
|
1
|
+
import { c as cachedSearch, d as deliveryApi } from './ContensisDeliveryApi-fe53fa10.js';
|
|
2
2
|
import { Query as Query$1 } from 'contensis-delivery-api';
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import { Provider } from 'react-redux';
|
|
@@ -6,7 +6,7 @@ import mapJson from 'jsonpath-mapper';
|
|
|
6
6
|
import 'reselect';
|
|
7
7
|
import 'deepmerge';
|
|
8
8
|
import 'query-string';
|
|
9
|
-
import { d as defaultExpressions, c as contentTypeIdExpression, f as filterExpressions, t as termExpressions, o as orderByExpression, a as customWhereExpressions } from './sagas-
|
|
9
|
+
import { d as defaultExpressions, c as contentTypeIdExpression, f as filterExpressions, t as termExpressions, o as orderByExpression, a as customWhereExpressions } from './sagas-933a8fc8.js';
|
|
10
10
|
import 'immer';
|
|
11
11
|
import 'deep-equal';
|
|
12
12
|
import { Op, Query } from 'contensis-core-api';
|
|
@@ -23,18 +23,21 @@ import { StaticRouter } from 'react-router-dom';
|
|
|
23
23
|
import { matchRoutes } from 'react-router-config';
|
|
24
24
|
import { Helmet } from 'react-helmet';
|
|
25
25
|
import { ServerStyleSheet } from 'styled-components';
|
|
26
|
-
import serialize
|
|
26
|
+
import serialize from 'serialize-javascript';
|
|
27
27
|
import minifyCssString from 'minify-css-string';
|
|
28
28
|
import { ChunkExtractor, ChunkExtractorManager } from '@loadable/server';
|
|
29
29
|
import { identity, noop } from 'lodash';
|
|
30
|
+
import { c as commonjsGlobal } from './_commonjsHelpers-1789f0cf.js';
|
|
30
31
|
import { buildCleaner } from 'lodash-clean';
|
|
31
32
|
import { CookiesProvider } from 'react-cookie';
|
|
32
|
-
import
|
|
33
|
-
import {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
import { s as
|
|
33
|
+
import cookiesMiddleware from 'universal-cookie-express';
|
|
34
|
+
import { c as createStore } from './version-7ea8bea8.js';
|
|
35
|
+
import { h as history, p as pickProject, r as rootSaga } from './App-aaea6310.js';
|
|
36
|
+
export { A as ReactApp } from './App-aaea6310.js';
|
|
37
|
+
import { s as setVersionStatus, a as setVersion } from './version-f42f7bdc.js';
|
|
38
|
+
import { s as selectSurrogateKeys, a as selectRouteEntry, b as selectCurrentProject, g as getImmutableOrJS, c as setCurrentProject } from './selectors-0fe67d47.js';
|
|
37
39
|
import chalk from 'chalk';
|
|
40
|
+
import './CookieConstants-3d3b6531.js';
|
|
38
41
|
import 'loglevel';
|
|
39
42
|
import '@redux-saga/core/effects';
|
|
40
43
|
import 'redux';
|
|
@@ -43,12 +46,11 @@ import 'redux-saga';
|
|
|
43
46
|
import 'redux-injectors';
|
|
44
47
|
import './reducers-3d5c37d1.js';
|
|
45
48
|
import 'history';
|
|
46
|
-
import './login-4d07c2de.js';
|
|
47
|
-
import './ToJs-0066e629.js';
|
|
48
49
|
import 'await-to-js';
|
|
49
|
-
import 'js
|
|
50
|
+
import './ChangePassword.container-724c8e0a.js';
|
|
51
|
+
import './ToJs-c75473e9.js';
|
|
50
52
|
import 'react-hot-loader';
|
|
51
|
-
import './RouteLoader-
|
|
53
|
+
import './RouteLoader-fe64ca81.js';
|
|
52
54
|
|
|
53
55
|
/**
|
|
54
56
|
* Util class holds our search results helper boilerplate methods
|
|
@@ -630,8 +632,8 @@ const makeLinkDepthMiddleware = ({
|
|
|
630
632
|
|
|
631
633
|
const servers$1 = SERVERS; /* global SERVERS */
|
|
632
634
|
const project = PROJECT; /* global PROJECT */
|
|
633
|
-
const alias = ALIAS; /* global ALIAS */
|
|
634
|
-
const deliveryApiHostname = url(alias, project).api;
|
|
635
|
+
const alias$1 = ALIAS; /* global ALIAS */
|
|
636
|
+
const deliveryApiHostname = url(alias$1, project).api;
|
|
635
637
|
const assetProxy = httpProxy.createProxyServer();
|
|
636
638
|
const deliveryProxy = httpProxy.createProxyServer();
|
|
637
639
|
const reverseProxies = (app, reverseProxyPaths = []) => {
|
|
@@ -795,8 +797,6 @@ const DisplayStartupConfiguration = config => {
|
|
|
795
797
|
/* eslint-enable no-console */
|
|
796
798
|
};
|
|
797
799
|
|
|
798
|
-
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
799
|
-
|
|
800
800
|
/**
|
|
801
801
|
* Removes all key-value entries from the list cache.
|
|
802
802
|
*
|
|
@@ -3579,332 +3579,6 @@ function cloneDeep(value) {
|
|
|
3579
3579
|
|
|
3580
3580
|
var cloneDeep_1 = cloneDeep;
|
|
3581
3581
|
|
|
3582
|
-
/*!
|
|
3583
|
-
* cookie
|
|
3584
|
-
* Copyright(c) 2012-2014 Roman Shtylman
|
|
3585
|
-
* Copyright(c) 2015 Douglas Christopher Wilson
|
|
3586
|
-
* MIT Licensed
|
|
3587
|
-
*/
|
|
3588
|
-
|
|
3589
|
-
/**
|
|
3590
|
-
* Module exports.
|
|
3591
|
-
* @public
|
|
3592
|
-
*/
|
|
3593
|
-
|
|
3594
|
-
var parse_1 = parse;
|
|
3595
|
-
var serialize_1 = serialize;
|
|
3596
|
-
|
|
3597
|
-
/**
|
|
3598
|
-
* Module variables.
|
|
3599
|
-
* @private
|
|
3600
|
-
*/
|
|
3601
|
-
|
|
3602
|
-
var decode = decodeURIComponent;
|
|
3603
|
-
var encode = encodeURIComponent;
|
|
3604
|
-
|
|
3605
|
-
/**
|
|
3606
|
-
* RegExp to match field-content in RFC 7230 sec 3.2
|
|
3607
|
-
*
|
|
3608
|
-
* field-content = field-vchar [ 1*( SP / HTAB ) field-vchar ]
|
|
3609
|
-
* field-vchar = VCHAR / obs-text
|
|
3610
|
-
* obs-text = %x80-FF
|
|
3611
|
-
*/
|
|
3612
|
-
|
|
3613
|
-
var fieldContentRegExp = /^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;
|
|
3614
|
-
|
|
3615
|
-
/**
|
|
3616
|
-
* Parse a cookie header.
|
|
3617
|
-
*
|
|
3618
|
-
* Parse the given cookie header string into an object
|
|
3619
|
-
* The object has the various cookies as keys(names) => values
|
|
3620
|
-
*
|
|
3621
|
-
* @param {string} str
|
|
3622
|
-
* @param {object} [options]
|
|
3623
|
-
* @return {object}
|
|
3624
|
-
* @public
|
|
3625
|
-
*/
|
|
3626
|
-
|
|
3627
|
-
function parse(str, options) {
|
|
3628
|
-
if (typeof str !== 'string') {
|
|
3629
|
-
throw new TypeError('argument str must be a string');
|
|
3630
|
-
}
|
|
3631
|
-
|
|
3632
|
-
var obj = {};
|
|
3633
|
-
var opt = options || {};
|
|
3634
|
-
var pairs = str.split(';');
|
|
3635
|
-
var dec = opt.decode || decode;
|
|
3636
|
-
|
|
3637
|
-
for (var i = 0; i < pairs.length; i++) {
|
|
3638
|
-
var pair = pairs[i];
|
|
3639
|
-
var index = pair.indexOf('=');
|
|
3640
|
-
|
|
3641
|
-
// skip things that don't look like key=value
|
|
3642
|
-
if (index < 0) {
|
|
3643
|
-
continue;
|
|
3644
|
-
}
|
|
3645
|
-
|
|
3646
|
-
var key = pair.substring(0, index).trim();
|
|
3647
|
-
|
|
3648
|
-
// only assign once
|
|
3649
|
-
if (undefined == obj[key]) {
|
|
3650
|
-
var val = pair.substring(index + 1, pair.length).trim();
|
|
3651
|
-
|
|
3652
|
-
// quoted values
|
|
3653
|
-
if (val[0] === '"') {
|
|
3654
|
-
val = val.slice(1, -1);
|
|
3655
|
-
}
|
|
3656
|
-
|
|
3657
|
-
obj[key] = tryDecode(val, dec);
|
|
3658
|
-
}
|
|
3659
|
-
}
|
|
3660
|
-
|
|
3661
|
-
return obj;
|
|
3662
|
-
}
|
|
3663
|
-
|
|
3664
|
-
/**
|
|
3665
|
-
* Serialize data into a cookie header.
|
|
3666
|
-
*
|
|
3667
|
-
* Serialize the a name value pair into a cookie string suitable for
|
|
3668
|
-
* http headers. An optional options object specified cookie parameters.
|
|
3669
|
-
*
|
|
3670
|
-
* serialize('foo', 'bar', { httpOnly: true })
|
|
3671
|
-
* => "foo=bar; httpOnly"
|
|
3672
|
-
*
|
|
3673
|
-
* @param {string} name
|
|
3674
|
-
* @param {string} val
|
|
3675
|
-
* @param {object} [options]
|
|
3676
|
-
* @return {string}
|
|
3677
|
-
* @public
|
|
3678
|
-
*/
|
|
3679
|
-
|
|
3680
|
-
function serialize(name, val, options) {
|
|
3681
|
-
var opt = options || {};
|
|
3682
|
-
var enc = opt.encode || encode;
|
|
3683
|
-
|
|
3684
|
-
if (typeof enc !== 'function') {
|
|
3685
|
-
throw new TypeError('option encode is invalid');
|
|
3686
|
-
}
|
|
3687
|
-
|
|
3688
|
-
if (!fieldContentRegExp.test(name)) {
|
|
3689
|
-
throw new TypeError('argument name is invalid');
|
|
3690
|
-
}
|
|
3691
|
-
|
|
3692
|
-
var value = enc(val);
|
|
3693
|
-
|
|
3694
|
-
if (value && !fieldContentRegExp.test(value)) {
|
|
3695
|
-
throw new TypeError('argument val is invalid');
|
|
3696
|
-
}
|
|
3697
|
-
|
|
3698
|
-
var str = name + '=' + value;
|
|
3699
|
-
|
|
3700
|
-
if (null != opt.maxAge) {
|
|
3701
|
-
var maxAge = opt.maxAge - 0;
|
|
3702
|
-
|
|
3703
|
-
if (isNaN(maxAge) || !isFinite(maxAge)) {
|
|
3704
|
-
throw new TypeError('option maxAge is invalid')
|
|
3705
|
-
}
|
|
3706
|
-
|
|
3707
|
-
str += '; Max-Age=' + Math.floor(maxAge);
|
|
3708
|
-
}
|
|
3709
|
-
|
|
3710
|
-
if (opt.domain) {
|
|
3711
|
-
if (!fieldContentRegExp.test(opt.domain)) {
|
|
3712
|
-
throw new TypeError('option domain is invalid');
|
|
3713
|
-
}
|
|
3714
|
-
|
|
3715
|
-
str += '; Domain=' + opt.domain;
|
|
3716
|
-
}
|
|
3717
|
-
|
|
3718
|
-
if (opt.path) {
|
|
3719
|
-
if (!fieldContentRegExp.test(opt.path)) {
|
|
3720
|
-
throw new TypeError('option path is invalid');
|
|
3721
|
-
}
|
|
3722
|
-
|
|
3723
|
-
str += '; Path=' + opt.path;
|
|
3724
|
-
}
|
|
3725
|
-
|
|
3726
|
-
if (opt.expires) {
|
|
3727
|
-
if (typeof opt.expires.toUTCString !== 'function') {
|
|
3728
|
-
throw new TypeError('option expires is invalid');
|
|
3729
|
-
}
|
|
3730
|
-
|
|
3731
|
-
str += '; Expires=' + opt.expires.toUTCString();
|
|
3732
|
-
}
|
|
3733
|
-
|
|
3734
|
-
if (opt.httpOnly) {
|
|
3735
|
-
str += '; HttpOnly';
|
|
3736
|
-
}
|
|
3737
|
-
|
|
3738
|
-
if (opt.secure) {
|
|
3739
|
-
str += '; Secure';
|
|
3740
|
-
}
|
|
3741
|
-
|
|
3742
|
-
if (opt.sameSite) {
|
|
3743
|
-
var sameSite = typeof opt.sameSite === 'string'
|
|
3744
|
-
? opt.sameSite.toLowerCase() : opt.sameSite;
|
|
3745
|
-
|
|
3746
|
-
switch (sameSite) {
|
|
3747
|
-
case true:
|
|
3748
|
-
str += '; SameSite=Strict';
|
|
3749
|
-
break;
|
|
3750
|
-
case 'lax':
|
|
3751
|
-
str += '; SameSite=Lax';
|
|
3752
|
-
break;
|
|
3753
|
-
case 'strict':
|
|
3754
|
-
str += '; SameSite=Strict';
|
|
3755
|
-
break;
|
|
3756
|
-
case 'none':
|
|
3757
|
-
str += '; SameSite=None';
|
|
3758
|
-
break;
|
|
3759
|
-
default:
|
|
3760
|
-
throw new TypeError('option sameSite is invalid');
|
|
3761
|
-
}
|
|
3762
|
-
}
|
|
3763
|
-
|
|
3764
|
-
return str;
|
|
3765
|
-
}
|
|
3766
|
-
|
|
3767
|
-
/**
|
|
3768
|
-
* Try decoding a string using a decoding function.
|
|
3769
|
-
*
|
|
3770
|
-
* @param {string} str
|
|
3771
|
-
* @param {function} decode
|
|
3772
|
-
* @private
|
|
3773
|
-
*/
|
|
3774
|
-
|
|
3775
|
-
function tryDecode(str, decode) {
|
|
3776
|
-
try {
|
|
3777
|
-
return decode(str);
|
|
3778
|
-
} catch (e) {
|
|
3779
|
-
return str;
|
|
3780
|
-
}
|
|
3781
|
-
}
|
|
3782
|
-
|
|
3783
|
-
function hasDocumentCookie() {
|
|
3784
|
-
// Can we get/set cookies on document.cookie?
|
|
3785
|
-
return typeof document === 'object' && typeof document.cookie === 'string';
|
|
3786
|
-
}
|
|
3787
|
-
function parseCookies(cookies, options) {
|
|
3788
|
-
if (typeof cookies === 'string') {
|
|
3789
|
-
return parse_1(cookies, options);
|
|
3790
|
-
}
|
|
3791
|
-
else if (typeof cookies === 'object' && cookies !== null) {
|
|
3792
|
-
return cookies;
|
|
3793
|
-
}
|
|
3794
|
-
else {
|
|
3795
|
-
return {};
|
|
3796
|
-
}
|
|
3797
|
-
}
|
|
3798
|
-
function isParsingCookie(value, doNotParse) {
|
|
3799
|
-
if (typeof doNotParse === 'undefined') {
|
|
3800
|
-
// We guess if the cookie start with { or [, it has been serialized
|
|
3801
|
-
doNotParse =
|
|
3802
|
-
!value || (value[0] !== '{' && value[0] !== '[' && value[0] !== '"');
|
|
3803
|
-
}
|
|
3804
|
-
return !doNotParse;
|
|
3805
|
-
}
|
|
3806
|
-
function readCookie(value, options) {
|
|
3807
|
-
if (options === void 0) { options = {}; }
|
|
3808
|
-
var cleanValue = cleanupCookieValue(value);
|
|
3809
|
-
if (isParsingCookie(cleanValue, options.doNotParse)) {
|
|
3810
|
-
try {
|
|
3811
|
-
return JSON.parse(cleanValue);
|
|
3812
|
-
}
|
|
3813
|
-
catch (e) {
|
|
3814
|
-
// At least we tried
|
|
3815
|
-
}
|
|
3816
|
-
}
|
|
3817
|
-
// Ignore clean value if we failed the deserialization
|
|
3818
|
-
// It is not relevant anymore to trim those values
|
|
3819
|
-
return value;
|
|
3820
|
-
}
|
|
3821
|
-
function cleanupCookieValue(value) {
|
|
3822
|
-
// express prepend j: before serializing a cookie
|
|
3823
|
-
if (value && value[0] === 'j' && value[1] === ':') {
|
|
3824
|
-
return value.substr(2);
|
|
3825
|
-
}
|
|
3826
|
-
return value;
|
|
3827
|
-
}
|
|
3828
|
-
|
|
3829
|
-
var __assign = (undefined && undefined.__assign) || function () {
|
|
3830
|
-
__assign = Object.assign || function(t) {
|
|
3831
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
3832
|
-
s = arguments[i];
|
|
3833
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
3834
|
-
t[p] = s[p];
|
|
3835
|
-
}
|
|
3836
|
-
return t;
|
|
3837
|
-
};
|
|
3838
|
-
return __assign.apply(this, arguments);
|
|
3839
|
-
};
|
|
3840
|
-
var Cookies = /** @class */ (function () {
|
|
3841
|
-
function Cookies(cookies, options) {
|
|
3842
|
-
var _this = this;
|
|
3843
|
-
this.changeListeners = [];
|
|
3844
|
-
this.HAS_DOCUMENT_COOKIE = false;
|
|
3845
|
-
this.cookies = parseCookies(cookies, options);
|
|
3846
|
-
new Promise(function () {
|
|
3847
|
-
_this.HAS_DOCUMENT_COOKIE = hasDocumentCookie();
|
|
3848
|
-
}).catch(function () { });
|
|
3849
|
-
}
|
|
3850
|
-
Cookies.prototype._updateBrowserValues = function (parseOptions) {
|
|
3851
|
-
if (!this.HAS_DOCUMENT_COOKIE) {
|
|
3852
|
-
return;
|
|
3853
|
-
}
|
|
3854
|
-
this.cookies = parse_1(document.cookie, parseOptions);
|
|
3855
|
-
};
|
|
3856
|
-
Cookies.prototype._emitChange = function (params) {
|
|
3857
|
-
for (var i = 0; i < this.changeListeners.length; ++i) {
|
|
3858
|
-
this.changeListeners[i](params);
|
|
3859
|
-
}
|
|
3860
|
-
};
|
|
3861
|
-
Cookies.prototype.get = function (name, options, parseOptions) {
|
|
3862
|
-
if (options === void 0) { options = {}; }
|
|
3863
|
-
this._updateBrowserValues(parseOptions);
|
|
3864
|
-
return readCookie(this.cookies[name], options);
|
|
3865
|
-
};
|
|
3866
|
-
Cookies.prototype.getAll = function (options, parseOptions) {
|
|
3867
|
-
if (options === void 0) { options = {}; }
|
|
3868
|
-
this._updateBrowserValues(parseOptions);
|
|
3869
|
-
var result = {};
|
|
3870
|
-
for (var name_1 in this.cookies) {
|
|
3871
|
-
result[name_1] = readCookie(this.cookies[name_1], options);
|
|
3872
|
-
}
|
|
3873
|
-
return result;
|
|
3874
|
-
};
|
|
3875
|
-
Cookies.prototype.set = function (name, value, options) {
|
|
3876
|
-
var _a;
|
|
3877
|
-
if (typeof value === 'object') {
|
|
3878
|
-
value = JSON.stringify(value);
|
|
3879
|
-
}
|
|
3880
|
-
this.cookies = __assign(__assign({}, this.cookies), (_a = {}, _a[name] = value, _a));
|
|
3881
|
-
if (this.HAS_DOCUMENT_COOKIE) {
|
|
3882
|
-
document.cookie = serialize_1(name, value, options);
|
|
3883
|
-
}
|
|
3884
|
-
this._emitChange({ name: name, value: value, options: options });
|
|
3885
|
-
};
|
|
3886
|
-
Cookies.prototype.remove = function (name, options) {
|
|
3887
|
-
var finalOptions = (options = __assign(__assign({}, options), { expires: new Date(1970, 1, 1, 0, 0, 1), maxAge: 0 }));
|
|
3888
|
-
this.cookies = __assign({}, this.cookies);
|
|
3889
|
-
delete this.cookies[name];
|
|
3890
|
-
if (this.HAS_DOCUMENT_COOKIE) {
|
|
3891
|
-
document.cookie = serialize_1(name, '', finalOptions);
|
|
3892
|
-
}
|
|
3893
|
-
this._emitChange({ name: name, value: undefined, options: options });
|
|
3894
|
-
};
|
|
3895
|
-
Cookies.prototype.addChangeListener = function (callback) {
|
|
3896
|
-
this.changeListeners.push(callback);
|
|
3897
|
-
};
|
|
3898
|
-
Cookies.prototype.removeChangeListener = function (callback) {
|
|
3899
|
-
var idx = this.changeListeners.indexOf(callback);
|
|
3900
|
-
if (idx >= 0) {
|
|
3901
|
-
this.changeListeners.splice(idx, 1);
|
|
3902
|
-
}
|
|
3903
|
-
};
|
|
3904
|
-
return Cookies;
|
|
3905
|
-
}());
|
|
3906
|
-
var Cookies$1 = Cookies;
|
|
3907
|
-
|
|
3908
3582
|
var stringifyAttributes = ((attributes = {}) => Object.entries(attributes).map(([key, value], idx) => `${idx !== 0 ? ' ' : ''}${key}${value ? `="${value}"` : ''}`).join(' '));
|
|
3909
3583
|
|
|
3910
3584
|
/* eslint-disable no-console */
|
|
@@ -3994,7 +3668,7 @@ const getBundleData = (config, staticRoutePath) => {
|
|
|
3994
3668
|
legacy: loadableBundleData(config, staticRoutePath, 'legacy'),
|
|
3995
3669
|
modern: loadableBundleData(config, staticRoutePath, 'modern')
|
|
3996
3670
|
};
|
|
3997
|
-
if (!bundleData.default || bundleData.default
|
|
3671
|
+
if (!bundleData.default || Object.keys(bundleData.default || {}).length === 0) bundleData.default = bundleData.legacy || bundleData.modern;
|
|
3998
3672
|
return bundleData;
|
|
3999
3673
|
};
|
|
4000
3674
|
|
|
@@ -4047,17 +3721,24 @@ const getBundleTags = (loadableExtractor, scripts, staticRoutePath = 'static') =
|
|
|
4047
3721
|
return startupTag;
|
|
4048
3722
|
};
|
|
4049
3723
|
|
|
3724
|
+
const alias = ALIAS; /* global ALIAS */
|
|
3725
|
+
|
|
4050
3726
|
const addStandardHeaders = (state, response, packagejson, groups) => {
|
|
4051
3727
|
if (state) {
|
|
4052
3728
|
try {
|
|
4053
3729
|
console.info('About to add headers');
|
|
4054
3730
|
const routingSurrogateKeys = selectSurrogateKeys(state);
|
|
4055
|
-
|
|
4056
|
-
|
|
3731
|
+
console.info(`[addStandardHeaders] ${routingSurrogateKeys.length} surrogate keys for ${response.req.url}`);
|
|
3732
|
+
// Check length of surrogate keys and prevent potential header overflow
|
|
3733
|
+
// errors in prod by replacing with `any-update` header that will indiscriminately
|
|
3734
|
+
// invalidate the SSR page cache when any content is updated
|
|
3735
|
+
const surrogateKeys = routingSurrogateKeys.length >= 2000 ? `${alias}_any-update` : routingSurrogateKeys.join(' ');
|
|
3736
|
+
const surrogateKeyHeader = `${packagejson.name}-app ${surrogateKeys}`;
|
|
3737
|
+
response.setHeader('surrogate-key', surrogateKeyHeader);
|
|
4057
3738
|
addVarnishAuthenticationHeaders(state, response, groups);
|
|
4058
|
-
response.setHeader('
|
|
3739
|
+
response.setHeader('surrogate-control', `max-age=${getCacheDuration(response.statusCode)}`);
|
|
4059
3740
|
} catch (e) {
|
|
4060
|
-
console.info('Error
|
|
3741
|
+
console.info('Error adding headers', e.message);
|
|
4061
3742
|
}
|
|
4062
3743
|
}
|
|
4063
3744
|
};
|
|
@@ -4094,10 +3775,11 @@ const getVersionInfo = staticFolderPath => {
|
|
|
4094
3775
|
};
|
|
4095
3776
|
|
|
4096
3777
|
/* eslint-disable no-console */
|
|
4097
|
-
|
|
4098
|
-
|
|
4099
|
-
|
|
4100
|
-
|
|
3778
|
+
|
|
3779
|
+
// Default exception types to add event listeners for
|
|
3780
|
+
const handleDefaultEvents = ['uncaughtException', 'unhandledRejection'];
|
|
3781
|
+
const unhandledExceptionHandler = (handleExceptions = handleDefaultEvents) => {
|
|
3782
|
+
const exceptionTypes = Array.isArray(handleExceptions) ? handleExceptions : handleExceptions === false ? [] : handleDefaultEvents;
|
|
4101
3783
|
for (const type of exceptionTypes) {
|
|
4102
3784
|
process.on(type, err => {
|
|
4103
3785
|
if (err && err instanceof Error) {
|
|
@@ -4133,14 +3815,13 @@ const webApp = (app, ReactApp, config) => {
|
|
|
4133
3815
|
const attributes = stringifyAttributes(scripts.attributes);
|
|
4134
3816
|
scripts.startup = scripts.startup || startupScriptFilename;
|
|
4135
3817
|
const responseHandler = typeof handleResponses === 'function' ? handleResponses : handleResponse;
|
|
4136
|
-
if (handleExceptions !== false) unhandledExceptionHandler(); // Create `process.on` event handlers for unhandled exceptions (Node v15+)
|
|
3818
|
+
if (handleExceptions !== false) unhandledExceptionHandler(handleExceptions); // Create `process.on` event handlers for unhandled exceptions (Node v15+)
|
|
4137
3819
|
|
|
4138
3820
|
const versionInfo = getVersionInfo(staticFolderPath);
|
|
4139
|
-
app.get('/*', async (request, response) => {
|
|
3821
|
+
app.get('/*', cookiesMiddleware(), async (request, response) => {
|
|
4140
3822
|
const {
|
|
4141
3823
|
url
|
|
4142
3824
|
} = request;
|
|
4143
|
-
const cookies = new Cookies$1(request.headers.cookie);
|
|
4144
3825
|
const matchedStaticRoute = () => matchRoutes(routes.StaticRoutes, request.path);
|
|
4145
3826
|
const isStaticRoute = () => matchedStaticRoute().length > 0;
|
|
4146
3827
|
const staticRoute = isStaticRoute() && matchedStaticRoute()[0];
|
|
@@ -4176,17 +3857,21 @@ const webApp = (app, ReactApp, config) => {
|
|
|
4176
3857
|
|
|
4177
3858
|
// dispatch any global and non-saga related actions before calling our JSX
|
|
4178
3859
|
const versionStatus = deliveryApi.getServerSideVersionStatus(request);
|
|
4179
|
-
|
|
3860
|
+
|
|
3861
|
+
// In server-side blocks world, the hostname requested by the client resides in the x-orig-host header
|
|
3862
|
+
// Because of this, we prioritize x-orig-host when setting our hostname
|
|
3863
|
+
const hostname = request.headers['x-orig-host'] || request.hostname;
|
|
3864
|
+
console.info(`Request for ${request.path} hostname: ${hostname} versionStatus: ${versionStatus}`);
|
|
4180
3865
|
store.dispatch(setVersionStatus(versionStatus));
|
|
4181
3866
|
store.dispatch(setVersion(versionInfo.commitRef, versionInfo.buildNo));
|
|
4182
|
-
const project = pickProject(
|
|
3867
|
+
const project = pickProject(hostname, request.query);
|
|
4183
3868
|
const groups = allowedGroups && allowedGroups[project];
|
|
4184
|
-
store.dispatch(setCurrentProject(project, groups,
|
|
3869
|
+
store.dispatch(setCurrentProject(project, groups, hostname));
|
|
4185
3870
|
const loadableExtractor = loadableChunkExtractors();
|
|
4186
3871
|
const jsx = /*#__PURE__*/React.createElement(ChunkExtractorManager, {
|
|
4187
3872
|
extractor: loadableExtractor.commonLoadableExtractor
|
|
4188
3873
|
}, /*#__PURE__*/React.createElement(CookiesProvider, {
|
|
4189
|
-
cookies:
|
|
3874
|
+
cookies: request.universalCookies
|
|
4190
3875
|
}, /*#__PURE__*/React.createElement(Provider, {
|
|
4191
3876
|
store: store
|
|
4192
3877
|
}, /*#__PURE__*/React.createElement(StaticRouter, {
|
|
@@ -4237,7 +3922,7 @@ const webApp = (app, ReactApp, config) => {
|
|
|
4237
3922
|
// After running rootSaga there should be an additional react-loadable
|
|
4238
3923
|
// code-split bundles for any page components as well as core app bundles
|
|
4239
3924
|
const bundleTags = getBundleTags(loadableExtractor, scripts, staticRoutePath);
|
|
4240
|
-
let serialisedReduxData = serialize
|
|
3925
|
+
let serialisedReduxData = serialize(buildCleaner({
|
|
4241
3926
|
isArray: identity,
|
|
4242
3927
|
isBoolean: identity,
|
|
4243
3928
|
isDate: identity,
|
|
@@ -4264,7 +3949,7 @@ const webApp = (app, ReactApp, config) => {
|
|
|
4264
3949
|
serialisedReduxData = `<script ${attributes}>window.versionStatus = "${versionStatus}"; window.REDUX_DATA = ${serialisedReduxData}</script>`;
|
|
4265
3950
|
}
|
|
4266
3951
|
}
|
|
4267
|
-
if ((context.statusCode || 200)
|
|
3952
|
+
if ((context.statusCode || 200) >= 404) {
|
|
4268
3953
|
accessMethod.STATIC = true;
|
|
4269
3954
|
}
|
|
4270
3955
|
|
|
@@ -4330,7 +4015,6 @@ const start = (ReactApp, config, ServerFeatures) => {
|
|
|
4330
4015
|
global.PROXY_DELIVERY_API = config.proxyDeliveryApi;
|
|
4331
4016
|
global.REVERSE_PROXY_PATHS = Object(config.reverseProxyPaths);
|
|
4332
4017
|
app.disable('x-powered-by');
|
|
4333
|
-
|
|
4334
4018
|
// Output some information about the used build/startup configuration
|
|
4335
4019
|
DisplayStartupConfiguration(config);
|
|
4336
4020
|
ServerFeatures(app);
|
|
@@ -4349,6 +4033,7 @@ const start = (ReactApp, config, ServerFeatures) => {
|
|
|
4349
4033
|
app.on('stop', () => {
|
|
4350
4034
|
server.close(function () {
|
|
4351
4035
|
console.info('GoodBye :(');
|
|
4036
|
+
process.exit();
|
|
4352
4037
|
});
|
|
4353
4038
|
});
|
|
4354
4039
|
});
|