@zengenti/contensis-react-base 3.0.2-beta.30 → 3.0.2-beta.32
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/cjs/{App-eefb5b8f.js → App-21a7d836.js} +29 -61
- package/cjs/App-21a7d836.js.map +1 -0
- package/cjs/{ContensisDeliveryApi-e2b3ce60.js → ContensisDeliveryApi-c079b03a.js} +35 -68
- package/cjs/ContensisDeliveryApi-c079b03a.js.map +1 -0
- package/cjs/{RouteLoader-85bee645.js → RouteLoader-7f0d107a.js} +5 -9
- package/cjs/RouteLoader-7f0d107a.js.map +1 -0
- package/cjs/{ToJs-29de3c36.js → ToJs-6e9cfa69.js} +2 -2
- package/cjs/ToJs-6e9cfa69.js.map +1 -0
- package/cjs/_commonjsHelpers-b3309d7b.js +11 -0
- package/cjs/_commonjsHelpers-b3309d7b.js.map +1 -0
- package/cjs/client.js +11 -15
- package/cjs/client.js.map +1 -1
- package/cjs/contensis-react-base.js +350 -28
- package/cjs/contensis-react-base.js.map +1 -1
- package/cjs/forms.js +3057 -1046
- package/cjs/forms.js.map +1 -1
- package/cjs/{ChangePassword.container-7306be55.js → login-2a6b5be0.js} +84 -247
- package/cjs/login-2a6b5be0.js.map +1 -0
- package/cjs/redux.js +3 -3
- package/cjs/routing.js +3 -5
- package/cjs/routing.js.map +1 -1
- package/cjs/{selectors-a6eac513.js → selectors-bcca60f4.js} +9 -5
- package/cjs/selectors-bcca60f4.js.map +1 -0
- package/cjs/user.js +159 -34
- package/cjs/user.js.map +1 -1
- package/cjs/util.js +3 -7
- package/cjs/util.js.map +1 -1
- package/cjs/{version-9edb5540.js → version-4077e706.js} +2 -2
- package/cjs/{version-9edb5540.js.map → version-4077e706.js.map} +1 -1
- package/cjs/{version-d3b5fbde.js → version-fe28099e.js} +3 -3
- package/cjs/{version-d3b5fbde.js.map → version-fe28099e.js.map} +1 -1
- package/esm/{App-2db3d689.js → App-2af18a99.js} +24 -55
- package/esm/App-2af18a99.js.map +1 -0
- package/esm/{ContensisDeliveryApi-50b8fd7c.js → ContensisDeliveryApi-5660ee0e.js} +36 -67
- package/esm/ContensisDeliveryApi-5660ee0e.js.map +1 -0
- package/esm/{RouteLoader-3e77f6a4.js → RouteLoader-6eac364e.js} +5 -9
- package/esm/RouteLoader-6eac364e.js.map +1 -0
- package/esm/{ToJs-e533a70a.js → ToJs-9b30636a.js} +2 -2
- package/esm/ToJs-9b30636a.js.map +1 -0
- package/esm/_commonjsHelpers-1789f0cf.js +8 -0
- package/esm/_commonjsHelpers-1789f0cf.js.map +1 -0
- package/esm/client.js +12 -16
- package/esm/client.js.map +1 -1
- package/esm/contensis-react-base.js +350 -27
- package/esm/contensis-react-base.js.map +1 -1
- package/esm/forms.js +3058 -1047
- package/esm/forms.js.map +1 -1
- package/esm/{ChangePassword.container-54b4011d.js → login-71ff3fcb.js} +78 -230
- package/esm/login-71ff3fcb.js.map +1 -0
- package/esm/redux.js +6 -6
- package/esm/routing.js +3 -5
- package/esm/routing.js.map +1 -1
- package/esm/{selectors-5061d7c8.js → selectors-74de49a3.js} +10 -5
- package/esm/selectors-74de49a3.js.map +1 -0
- package/esm/user.js +151 -22
- package/esm/user.js.map +1 -1
- package/esm/util.js +3 -5
- package/esm/util.js.map +1 -1
- package/esm/{version-7550d14d.js → version-b15807c5.js} +3 -3
- package/esm/{version-7550d14d.js.map → version-b15807c5.js.map} +1 -1
- package/esm/{version-1ef42ad1.js → version-ef107106.js} +2 -2
- package/esm/{version-1ef42ad1.js.map → version-ef107106.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 +1 -1
- package/models/routing/redux/actions.d.ts +6 -10
- package/models/routing/redux/selectors.d.ts +3 -3
- package/models/routing/redux/types.d.ts +1 -0
- package/models/routing/routes.d.ts +17 -20
- package/models/search/models/Queries.d.ts +10 -8
- package/models/search/models/Search.d.ts +24 -24
- package/models/search/models/SearchActions.d.ts +33 -33
- 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 +4 -4
- package/models/search/redux/selectors.d.ts +27 -27
- package/models/search/redux/util.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 +2 -2
- package/models/server/internalServer.d.ts +5 -7
- 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 +3 -2
- 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 +11 -5
- package/models/user/hocs/withRegistration.d.ts +8 -2
- package/models/user/redux/actions.d.ts +2 -2
- package/models/user/redux/sagas/login.d.ts +8 -9
- package/models/user/redux/selectors.d.ts +4 -4
- package/models/user/util/CookieHelper.class.d.ts +3 -15
- package/models/user/util/LoginHelper.class.d.ts +23 -27
- package/models/util/ContensisDeliveryApi.d.ts +14 -21
- 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 -9
- package/cjs/App-eefb5b8f.js.map +0 -1
- package/cjs/ChangePassword.container-7306be55.js.map +0 -1
- package/cjs/ContensisDeliveryApi-e2b3ce60.js.map +0 -1
- package/cjs/CookieConstants-000427db.js +0 -10
- package/cjs/CookieConstants-000427db.js.map +0 -1
- package/cjs/CookieHelper.class-daeb09dd.js +0 -52
- package/cjs/CookieHelper.class-daeb09dd.js.map +0 -1
- package/cjs/RouteLoader-85bee645.js.map +0 -1
- package/cjs/ToJs-29de3c36.js.map +0 -1
- package/cjs/selectors-a6eac513.js.map +0 -1
- package/esm/App-2db3d689.js.map +0 -1
- package/esm/ChangePassword.container-54b4011d.js.map +0 -1
- package/esm/ContensisDeliveryApi-50b8fd7c.js.map +0 -1
- package/esm/CookieConstants-3d3b6531.js +0 -6
- package/esm/CookieConstants-3d3b6531.js.map +0 -1
- package/esm/CookieHelper.class-4d6ee27b.js +0 -49
- package/esm/CookieHelper.class-4d6ee27b.js.map +0 -1
- package/esm/RouteLoader-3e77f6a4.js.map +0 -1
- package/esm/ToJs-e533a70a.js.map +0 -1
- package/esm/selectors-5061d7c8.js.map +0 -1
- package/models/user/util/CookieConstants.d.ts +0 -7
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var ContensisDeliveryApi = require('./ContensisDeliveryApi-
|
|
5
|
+
var ContensisDeliveryApi = require('./ContensisDeliveryApi-c079b03a.js');
|
|
6
6
|
var contensisDeliveryApi = require('contensis-delivery-api');
|
|
7
7
|
var React = require('react');
|
|
8
8
|
var reactRedux = require('react-redux');
|
|
@@ -27,20 +27,18 @@ var reactRouterDom = require('react-router-dom');
|
|
|
27
27
|
var reactRouterConfig = require('react-router-config');
|
|
28
28
|
var reactHelmet = require('react-helmet');
|
|
29
29
|
var styled = require('styled-components');
|
|
30
|
-
var serialize = require('serialize-javascript');
|
|
30
|
+
var serialize$1 = require('serialize-javascript');
|
|
31
31
|
var minifyCssString = require('minify-css-string');
|
|
32
32
|
var server$1 = require('@loadable/server');
|
|
33
33
|
var lodash = require('lodash');
|
|
34
|
+
var _commonjsHelpers = require('./_commonjsHelpers-b3309d7b.js');
|
|
34
35
|
var lodashClean = require('lodash-clean');
|
|
35
36
|
var reactCookie = require('react-cookie');
|
|
36
|
-
var
|
|
37
|
-
var
|
|
38
|
-
var
|
|
39
|
-
var
|
|
40
|
-
var selectors = require('./selectors-a6eac513.js');
|
|
37
|
+
var version = require('./version-4077e706.js');
|
|
38
|
+
var App = require('./App-21a7d836.js');
|
|
39
|
+
var version$1 = require('./version-fe28099e.js');
|
|
40
|
+
var selectors = require('./selectors-bcca60f4.js');
|
|
41
41
|
var chalk = require('chalk');
|
|
42
|
-
require('./CookieConstants-000427db.js');
|
|
43
|
-
require('./CookieHelper.class-daeb09dd.js');
|
|
44
42
|
require('loglevel');
|
|
45
43
|
require('@redux-saga/core/effects');
|
|
46
44
|
require('redux');
|
|
@@ -49,11 +47,12 @@ require('redux-saga');
|
|
|
49
47
|
require('redux-injectors');
|
|
50
48
|
require('./reducers-9afb5f89.js');
|
|
51
49
|
require('history');
|
|
50
|
+
require('./login-2a6b5be0.js');
|
|
51
|
+
require('./ToJs-6e9cfa69.js');
|
|
52
52
|
require('await-to-js');
|
|
53
|
-
require('
|
|
54
|
-
require('./ToJs-29de3c36.js');
|
|
53
|
+
require('js-cookie');
|
|
55
54
|
require('react-hot-loader');
|
|
56
|
-
require('./RouteLoader-
|
|
55
|
+
require('./RouteLoader-7f0d107a.js');
|
|
57
56
|
|
|
58
57
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
59
58
|
|
|
@@ -64,9 +63,8 @@ var http__default = /*#__PURE__*/_interopDefaultLegacy(http);
|
|
|
64
63
|
var httpProxy__default = /*#__PURE__*/_interopDefaultLegacy(httpProxy);
|
|
65
64
|
var fs__default = /*#__PURE__*/_interopDefaultLegacy(fs);
|
|
66
65
|
var path__default = /*#__PURE__*/_interopDefaultLegacy(path);
|
|
67
|
-
var serialize__default = /*#__PURE__*/_interopDefaultLegacy(serialize);
|
|
66
|
+
var serialize__default = /*#__PURE__*/_interopDefaultLegacy(serialize$1);
|
|
68
67
|
var minifyCssString__default = /*#__PURE__*/_interopDefaultLegacy(minifyCssString);
|
|
69
|
-
var cookiesMiddleware__default = /*#__PURE__*/_interopDefaultLegacy(cookiesMiddleware);
|
|
70
68
|
var chalk__default = /*#__PURE__*/_interopDefaultLegacy(chalk);
|
|
71
69
|
|
|
72
70
|
/**
|
|
@@ -814,8 +812,6 @@ const DisplayStartupConfiguration = config => {
|
|
|
814
812
|
/* eslint-enable no-console */
|
|
815
813
|
};
|
|
816
814
|
|
|
817
|
-
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
818
|
-
|
|
819
815
|
/**
|
|
820
816
|
* Removes all key-value entries from the list cache.
|
|
821
817
|
*
|
|
@@ -1095,7 +1091,7 @@ var _stackHas = stackHas$1;
|
|
|
1095
1091
|
|
|
1096
1092
|
/** Detect free variable `global` from Node.js. */
|
|
1097
1093
|
|
|
1098
|
-
var freeGlobal$1 = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
|
|
1094
|
+
var freeGlobal$1 = typeof _commonjsHelpers.commonjsGlobal == 'object' && _commonjsHelpers.commonjsGlobal && _commonjsHelpers.commonjsGlobal.Object === Object && _commonjsHelpers.commonjsGlobal;
|
|
1099
1095
|
|
|
1100
1096
|
var _freeGlobal = freeGlobal$1;
|
|
1101
1097
|
|
|
@@ -3598,6 +3594,332 @@ function cloneDeep(value) {
|
|
|
3598
3594
|
|
|
3599
3595
|
var cloneDeep_1 = cloneDeep;
|
|
3600
3596
|
|
|
3597
|
+
/*!
|
|
3598
|
+
* cookie
|
|
3599
|
+
* Copyright(c) 2012-2014 Roman Shtylman
|
|
3600
|
+
* Copyright(c) 2015 Douglas Christopher Wilson
|
|
3601
|
+
* MIT Licensed
|
|
3602
|
+
*/
|
|
3603
|
+
|
|
3604
|
+
/**
|
|
3605
|
+
* Module exports.
|
|
3606
|
+
* @public
|
|
3607
|
+
*/
|
|
3608
|
+
|
|
3609
|
+
var parse_1 = parse;
|
|
3610
|
+
var serialize_1 = serialize;
|
|
3611
|
+
|
|
3612
|
+
/**
|
|
3613
|
+
* Module variables.
|
|
3614
|
+
* @private
|
|
3615
|
+
*/
|
|
3616
|
+
|
|
3617
|
+
var decode = decodeURIComponent;
|
|
3618
|
+
var encode = encodeURIComponent;
|
|
3619
|
+
|
|
3620
|
+
/**
|
|
3621
|
+
* RegExp to match field-content in RFC 7230 sec 3.2
|
|
3622
|
+
*
|
|
3623
|
+
* field-content = field-vchar [ 1*( SP / HTAB ) field-vchar ]
|
|
3624
|
+
* field-vchar = VCHAR / obs-text
|
|
3625
|
+
* obs-text = %x80-FF
|
|
3626
|
+
*/
|
|
3627
|
+
|
|
3628
|
+
var fieldContentRegExp = /^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;
|
|
3629
|
+
|
|
3630
|
+
/**
|
|
3631
|
+
* Parse a cookie header.
|
|
3632
|
+
*
|
|
3633
|
+
* Parse the given cookie header string into an object
|
|
3634
|
+
* The object has the various cookies as keys(names) => values
|
|
3635
|
+
*
|
|
3636
|
+
* @param {string} str
|
|
3637
|
+
* @param {object} [options]
|
|
3638
|
+
* @return {object}
|
|
3639
|
+
* @public
|
|
3640
|
+
*/
|
|
3641
|
+
|
|
3642
|
+
function parse(str, options) {
|
|
3643
|
+
if (typeof str !== 'string') {
|
|
3644
|
+
throw new TypeError('argument str must be a string');
|
|
3645
|
+
}
|
|
3646
|
+
|
|
3647
|
+
var obj = {};
|
|
3648
|
+
var opt = options || {};
|
|
3649
|
+
var pairs = str.split(';');
|
|
3650
|
+
var dec = opt.decode || decode;
|
|
3651
|
+
|
|
3652
|
+
for (var i = 0; i < pairs.length; i++) {
|
|
3653
|
+
var pair = pairs[i];
|
|
3654
|
+
var index = pair.indexOf('=');
|
|
3655
|
+
|
|
3656
|
+
// skip things that don't look like key=value
|
|
3657
|
+
if (index < 0) {
|
|
3658
|
+
continue;
|
|
3659
|
+
}
|
|
3660
|
+
|
|
3661
|
+
var key = pair.substring(0, index).trim();
|
|
3662
|
+
|
|
3663
|
+
// only assign once
|
|
3664
|
+
if (undefined == obj[key]) {
|
|
3665
|
+
var val = pair.substring(index + 1, pair.length).trim();
|
|
3666
|
+
|
|
3667
|
+
// quoted values
|
|
3668
|
+
if (val[0] === '"') {
|
|
3669
|
+
val = val.slice(1, -1);
|
|
3670
|
+
}
|
|
3671
|
+
|
|
3672
|
+
obj[key] = tryDecode(val, dec);
|
|
3673
|
+
}
|
|
3674
|
+
}
|
|
3675
|
+
|
|
3676
|
+
return obj;
|
|
3677
|
+
}
|
|
3678
|
+
|
|
3679
|
+
/**
|
|
3680
|
+
* Serialize data into a cookie header.
|
|
3681
|
+
*
|
|
3682
|
+
* Serialize the a name value pair into a cookie string suitable for
|
|
3683
|
+
* http headers. An optional options object specified cookie parameters.
|
|
3684
|
+
*
|
|
3685
|
+
* serialize('foo', 'bar', { httpOnly: true })
|
|
3686
|
+
* => "foo=bar; httpOnly"
|
|
3687
|
+
*
|
|
3688
|
+
* @param {string} name
|
|
3689
|
+
* @param {string} val
|
|
3690
|
+
* @param {object} [options]
|
|
3691
|
+
* @return {string}
|
|
3692
|
+
* @public
|
|
3693
|
+
*/
|
|
3694
|
+
|
|
3695
|
+
function serialize(name, val, options) {
|
|
3696
|
+
var opt = options || {};
|
|
3697
|
+
var enc = opt.encode || encode;
|
|
3698
|
+
|
|
3699
|
+
if (typeof enc !== 'function') {
|
|
3700
|
+
throw new TypeError('option encode is invalid');
|
|
3701
|
+
}
|
|
3702
|
+
|
|
3703
|
+
if (!fieldContentRegExp.test(name)) {
|
|
3704
|
+
throw new TypeError('argument name is invalid');
|
|
3705
|
+
}
|
|
3706
|
+
|
|
3707
|
+
var value = enc(val);
|
|
3708
|
+
|
|
3709
|
+
if (value && !fieldContentRegExp.test(value)) {
|
|
3710
|
+
throw new TypeError('argument val is invalid');
|
|
3711
|
+
}
|
|
3712
|
+
|
|
3713
|
+
var str = name + '=' + value;
|
|
3714
|
+
|
|
3715
|
+
if (null != opt.maxAge) {
|
|
3716
|
+
var maxAge = opt.maxAge - 0;
|
|
3717
|
+
|
|
3718
|
+
if (isNaN(maxAge) || !isFinite(maxAge)) {
|
|
3719
|
+
throw new TypeError('option maxAge is invalid')
|
|
3720
|
+
}
|
|
3721
|
+
|
|
3722
|
+
str += '; Max-Age=' + Math.floor(maxAge);
|
|
3723
|
+
}
|
|
3724
|
+
|
|
3725
|
+
if (opt.domain) {
|
|
3726
|
+
if (!fieldContentRegExp.test(opt.domain)) {
|
|
3727
|
+
throw new TypeError('option domain is invalid');
|
|
3728
|
+
}
|
|
3729
|
+
|
|
3730
|
+
str += '; Domain=' + opt.domain;
|
|
3731
|
+
}
|
|
3732
|
+
|
|
3733
|
+
if (opt.path) {
|
|
3734
|
+
if (!fieldContentRegExp.test(opt.path)) {
|
|
3735
|
+
throw new TypeError('option path is invalid');
|
|
3736
|
+
}
|
|
3737
|
+
|
|
3738
|
+
str += '; Path=' + opt.path;
|
|
3739
|
+
}
|
|
3740
|
+
|
|
3741
|
+
if (opt.expires) {
|
|
3742
|
+
if (typeof opt.expires.toUTCString !== 'function') {
|
|
3743
|
+
throw new TypeError('option expires is invalid');
|
|
3744
|
+
}
|
|
3745
|
+
|
|
3746
|
+
str += '; Expires=' + opt.expires.toUTCString();
|
|
3747
|
+
}
|
|
3748
|
+
|
|
3749
|
+
if (opt.httpOnly) {
|
|
3750
|
+
str += '; HttpOnly';
|
|
3751
|
+
}
|
|
3752
|
+
|
|
3753
|
+
if (opt.secure) {
|
|
3754
|
+
str += '; Secure';
|
|
3755
|
+
}
|
|
3756
|
+
|
|
3757
|
+
if (opt.sameSite) {
|
|
3758
|
+
var sameSite = typeof opt.sameSite === 'string'
|
|
3759
|
+
? opt.sameSite.toLowerCase() : opt.sameSite;
|
|
3760
|
+
|
|
3761
|
+
switch (sameSite) {
|
|
3762
|
+
case true:
|
|
3763
|
+
str += '; SameSite=Strict';
|
|
3764
|
+
break;
|
|
3765
|
+
case 'lax':
|
|
3766
|
+
str += '; SameSite=Lax';
|
|
3767
|
+
break;
|
|
3768
|
+
case 'strict':
|
|
3769
|
+
str += '; SameSite=Strict';
|
|
3770
|
+
break;
|
|
3771
|
+
case 'none':
|
|
3772
|
+
str += '; SameSite=None';
|
|
3773
|
+
break;
|
|
3774
|
+
default:
|
|
3775
|
+
throw new TypeError('option sameSite is invalid');
|
|
3776
|
+
}
|
|
3777
|
+
}
|
|
3778
|
+
|
|
3779
|
+
return str;
|
|
3780
|
+
}
|
|
3781
|
+
|
|
3782
|
+
/**
|
|
3783
|
+
* Try decoding a string using a decoding function.
|
|
3784
|
+
*
|
|
3785
|
+
* @param {string} str
|
|
3786
|
+
* @param {function} decode
|
|
3787
|
+
* @private
|
|
3788
|
+
*/
|
|
3789
|
+
|
|
3790
|
+
function tryDecode(str, decode) {
|
|
3791
|
+
try {
|
|
3792
|
+
return decode(str);
|
|
3793
|
+
} catch (e) {
|
|
3794
|
+
return str;
|
|
3795
|
+
}
|
|
3796
|
+
}
|
|
3797
|
+
|
|
3798
|
+
function hasDocumentCookie() {
|
|
3799
|
+
// Can we get/set cookies on document.cookie?
|
|
3800
|
+
return typeof document === 'object' && typeof document.cookie === 'string';
|
|
3801
|
+
}
|
|
3802
|
+
function parseCookies(cookies, options) {
|
|
3803
|
+
if (typeof cookies === 'string') {
|
|
3804
|
+
return parse_1(cookies, options);
|
|
3805
|
+
}
|
|
3806
|
+
else if (typeof cookies === 'object' && cookies !== null) {
|
|
3807
|
+
return cookies;
|
|
3808
|
+
}
|
|
3809
|
+
else {
|
|
3810
|
+
return {};
|
|
3811
|
+
}
|
|
3812
|
+
}
|
|
3813
|
+
function isParsingCookie(value, doNotParse) {
|
|
3814
|
+
if (typeof doNotParse === 'undefined') {
|
|
3815
|
+
// We guess if the cookie start with { or [, it has been serialized
|
|
3816
|
+
doNotParse =
|
|
3817
|
+
!value || (value[0] !== '{' && value[0] !== '[' && value[0] !== '"');
|
|
3818
|
+
}
|
|
3819
|
+
return !doNotParse;
|
|
3820
|
+
}
|
|
3821
|
+
function readCookie(value, options) {
|
|
3822
|
+
if (options === void 0) { options = {}; }
|
|
3823
|
+
var cleanValue = cleanupCookieValue(value);
|
|
3824
|
+
if (isParsingCookie(cleanValue, options.doNotParse)) {
|
|
3825
|
+
try {
|
|
3826
|
+
return JSON.parse(cleanValue);
|
|
3827
|
+
}
|
|
3828
|
+
catch (e) {
|
|
3829
|
+
// At least we tried
|
|
3830
|
+
}
|
|
3831
|
+
}
|
|
3832
|
+
// Ignore clean value if we failed the deserialization
|
|
3833
|
+
// It is not relevant anymore to trim those values
|
|
3834
|
+
return value;
|
|
3835
|
+
}
|
|
3836
|
+
function cleanupCookieValue(value) {
|
|
3837
|
+
// express prepend j: before serializing a cookie
|
|
3838
|
+
if (value && value[0] === 'j' && value[1] === ':') {
|
|
3839
|
+
return value.substr(2);
|
|
3840
|
+
}
|
|
3841
|
+
return value;
|
|
3842
|
+
}
|
|
3843
|
+
|
|
3844
|
+
var __assign = (undefined && undefined.__assign) || function () {
|
|
3845
|
+
__assign = Object.assign || function(t) {
|
|
3846
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
3847
|
+
s = arguments[i];
|
|
3848
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
3849
|
+
t[p] = s[p];
|
|
3850
|
+
}
|
|
3851
|
+
return t;
|
|
3852
|
+
};
|
|
3853
|
+
return __assign.apply(this, arguments);
|
|
3854
|
+
};
|
|
3855
|
+
var Cookies = /** @class */ (function () {
|
|
3856
|
+
function Cookies(cookies, options) {
|
|
3857
|
+
var _this = this;
|
|
3858
|
+
this.changeListeners = [];
|
|
3859
|
+
this.HAS_DOCUMENT_COOKIE = false;
|
|
3860
|
+
this.cookies = parseCookies(cookies, options);
|
|
3861
|
+
new Promise(function () {
|
|
3862
|
+
_this.HAS_DOCUMENT_COOKIE = hasDocumentCookie();
|
|
3863
|
+
}).catch(function () { });
|
|
3864
|
+
}
|
|
3865
|
+
Cookies.prototype._updateBrowserValues = function (parseOptions) {
|
|
3866
|
+
if (!this.HAS_DOCUMENT_COOKIE) {
|
|
3867
|
+
return;
|
|
3868
|
+
}
|
|
3869
|
+
this.cookies = parse_1(document.cookie, parseOptions);
|
|
3870
|
+
};
|
|
3871
|
+
Cookies.prototype._emitChange = function (params) {
|
|
3872
|
+
for (var i = 0; i < this.changeListeners.length; ++i) {
|
|
3873
|
+
this.changeListeners[i](params);
|
|
3874
|
+
}
|
|
3875
|
+
};
|
|
3876
|
+
Cookies.prototype.get = function (name, options, parseOptions) {
|
|
3877
|
+
if (options === void 0) { options = {}; }
|
|
3878
|
+
this._updateBrowserValues(parseOptions);
|
|
3879
|
+
return readCookie(this.cookies[name], options);
|
|
3880
|
+
};
|
|
3881
|
+
Cookies.prototype.getAll = function (options, parseOptions) {
|
|
3882
|
+
if (options === void 0) { options = {}; }
|
|
3883
|
+
this._updateBrowserValues(parseOptions);
|
|
3884
|
+
var result = {};
|
|
3885
|
+
for (var name_1 in this.cookies) {
|
|
3886
|
+
result[name_1] = readCookie(this.cookies[name_1], options);
|
|
3887
|
+
}
|
|
3888
|
+
return result;
|
|
3889
|
+
};
|
|
3890
|
+
Cookies.prototype.set = function (name, value, options) {
|
|
3891
|
+
var _a;
|
|
3892
|
+
if (typeof value === 'object') {
|
|
3893
|
+
value = JSON.stringify(value);
|
|
3894
|
+
}
|
|
3895
|
+
this.cookies = __assign(__assign({}, this.cookies), (_a = {}, _a[name] = value, _a));
|
|
3896
|
+
if (this.HAS_DOCUMENT_COOKIE) {
|
|
3897
|
+
document.cookie = serialize_1(name, value, options);
|
|
3898
|
+
}
|
|
3899
|
+
this._emitChange({ name: name, value: value, options: options });
|
|
3900
|
+
};
|
|
3901
|
+
Cookies.prototype.remove = function (name, options) {
|
|
3902
|
+
var finalOptions = (options = __assign(__assign({}, options), { expires: new Date(1970, 1, 1, 0, 0, 1), maxAge: 0 }));
|
|
3903
|
+
this.cookies = __assign({}, this.cookies);
|
|
3904
|
+
delete this.cookies[name];
|
|
3905
|
+
if (this.HAS_DOCUMENT_COOKIE) {
|
|
3906
|
+
document.cookie = serialize_1(name, '', finalOptions);
|
|
3907
|
+
}
|
|
3908
|
+
this._emitChange({ name: name, value: undefined, options: options });
|
|
3909
|
+
};
|
|
3910
|
+
Cookies.prototype.addChangeListener = function (callback) {
|
|
3911
|
+
this.changeListeners.push(callback);
|
|
3912
|
+
};
|
|
3913
|
+
Cookies.prototype.removeChangeListener = function (callback) {
|
|
3914
|
+
var idx = this.changeListeners.indexOf(callback);
|
|
3915
|
+
if (idx >= 0) {
|
|
3916
|
+
this.changeListeners.splice(idx, 1);
|
|
3917
|
+
}
|
|
3918
|
+
};
|
|
3919
|
+
return Cookies;
|
|
3920
|
+
}());
|
|
3921
|
+
var Cookies$1 = Cookies;
|
|
3922
|
+
|
|
3601
3923
|
var stringifyAttributes = ((attributes = {}) => Object.entries(attributes).map(([key, value], idx) => `${idx !== 0 ? ' ' : ''}${key}${value ? `="${value}"` : ''}`).join(' '));
|
|
3602
3924
|
|
|
3603
3925
|
/* eslint-disable no-console */
|
|
@@ -3687,7 +4009,7 @@ const getBundleData = (config, staticRoutePath) => {
|
|
|
3687
4009
|
legacy: loadableBundleData(config, staticRoutePath, 'legacy'),
|
|
3688
4010
|
modern: loadableBundleData(config, staticRoutePath, 'modern')
|
|
3689
4011
|
};
|
|
3690
|
-
if (!bundleData.default ||
|
|
4012
|
+
if (!bundleData.default || bundleData.default === {}) bundleData.default = bundleData.legacy || bundleData.modern;
|
|
3691
4013
|
return bundleData;
|
|
3692
4014
|
};
|
|
3693
4015
|
|
|
@@ -3787,11 +4109,10 @@ const getVersionInfo = staticFolderPath => {
|
|
|
3787
4109
|
};
|
|
3788
4110
|
|
|
3789
4111
|
/* eslint-disable no-console */
|
|
3790
|
-
|
|
3791
|
-
// Default exception types to add event listeners for
|
|
3792
|
-
|
|
3793
|
-
|
|
3794
|
-
const exceptionTypes = Array.isArray(handleExceptions) ? handleExceptions : handleExceptions === false ? [] : handleDefaultEvents;
|
|
4112
|
+
const unhandledExceptionHandler = (handleExceptions = true) => {
|
|
4113
|
+
const exceptionTypes = handleExceptions === true ? ['uncaughtException', 'unhandledRejection', 'SIGTERM', 'SIGINT'] // Default exception types to add event listeners for
|
|
4114
|
+
: Array.isArray(handleExceptions) // In future we could accept an array of specific exception types to handle for a specific application?
|
|
4115
|
+
? handleExceptions : [];
|
|
3795
4116
|
for (const type of exceptionTypes) {
|
|
3796
4117
|
process.on(type, err => {
|
|
3797
4118
|
if (err && err instanceof Error) {
|
|
@@ -3827,13 +4148,14 @@ const webApp = (app, ReactApp, config) => {
|
|
|
3827
4148
|
const attributes = stringifyAttributes(scripts.attributes);
|
|
3828
4149
|
scripts.startup = scripts.startup || startupScriptFilename;
|
|
3829
4150
|
const responseHandler = typeof handleResponses === 'function' ? handleResponses : handleResponse;
|
|
3830
|
-
if (handleExceptions !== false) unhandledExceptionHandler(
|
|
4151
|
+
if (handleExceptions !== false) unhandledExceptionHandler(); // Create `process.on` event handlers for unhandled exceptions (Node v15+)
|
|
3831
4152
|
|
|
3832
4153
|
const versionInfo = getVersionInfo(staticFolderPath);
|
|
3833
|
-
app.get('/*',
|
|
4154
|
+
app.get('/*', async (request, response) => {
|
|
3834
4155
|
const {
|
|
3835
4156
|
url
|
|
3836
4157
|
} = request;
|
|
4158
|
+
const cookies = new Cookies$1(request.headers.cookie);
|
|
3837
4159
|
const matchedStaticRoute = () => reactRouterConfig.matchRoutes(routes.StaticRoutes, request.path);
|
|
3838
4160
|
const isStaticRoute = () => matchedStaticRoute().length > 0;
|
|
3839
4161
|
const staticRoute = isStaticRoute() && matchedStaticRoute()[0];
|
|
@@ -3883,7 +4205,7 @@ const webApp = (app, ReactApp, config) => {
|
|
|
3883
4205
|
const jsx = /*#__PURE__*/React__default["default"].createElement(server$1.ChunkExtractorManager, {
|
|
3884
4206
|
extractor: loadableExtractor.commonLoadableExtractor
|
|
3885
4207
|
}, /*#__PURE__*/React__default["default"].createElement(reactCookie.CookiesProvider, {
|
|
3886
|
-
cookies:
|
|
4208
|
+
cookies: cookies
|
|
3887
4209
|
}, /*#__PURE__*/React__default["default"].createElement(reactRedux.Provider, {
|
|
3888
4210
|
store: store
|
|
3889
4211
|
}, /*#__PURE__*/React__default["default"].createElement(reactRouterDom.StaticRouter, {
|
|
@@ -3961,7 +4283,7 @@ const webApp = (app, ReactApp, config) => {
|
|
|
3961
4283
|
serialisedReduxData = `<script ${attributes}>window.versionStatus = "${versionStatus}"; window.REDUX_DATA = ${serialisedReduxData}</script>`;
|
|
3962
4284
|
}
|
|
3963
4285
|
}
|
|
3964
|
-
if ((context.statusCode || 200)
|
|
4286
|
+
if ((context.statusCode || 200) > 400) {
|
|
3965
4287
|
accessMethod.STATIC = true;
|
|
3966
4288
|
}
|
|
3967
4289
|
|
|
@@ -4027,6 +4349,7 @@ const start = (ReactApp, config, ServerFeatures) => {
|
|
|
4027
4349
|
global.PROXY_DELIVERY_API = config.proxyDeliveryApi;
|
|
4028
4350
|
global.REVERSE_PROXY_PATHS = Object(config.reverseProxyPaths);
|
|
4029
4351
|
app.disable('x-powered-by');
|
|
4352
|
+
|
|
4030
4353
|
// Output some information about the used build/startup configuration
|
|
4031
4354
|
DisplayStartupConfiguration(config);
|
|
4032
4355
|
ServerFeatures(app);
|
|
@@ -4045,7 +4368,6 @@ const start = (ReactApp, config, ServerFeatures) => {
|
|
|
4045
4368
|
app.on('stop', () => {
|
|
4046
4369
|
server.close(function () {
|
|
4047
4370
|
console.info('GoodBye :(');
|
|
4048
|
-
process.exit();
|
|
4049
4371
|
});
|
|
4050
4372
|
});
|
|
4051
4373
|
});
|