@zengenti/contensis-react-base 3.0.0-beta.2 → 3.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/README.md +4 -4
- package/cjs/{App-581b6653.js → App-7ecf6d63.js} +43 -27
- package/cjs/App-7ecf6d63.js.map +1 -0
- package/cjs/{RouteLoader-282c03ab.js → RouteLoader-fb056e9e.js} +44 -30
- package/cjs/RouteLoader-fb056e9e.js.map +1 -0
- package/cjs/ToJs-5da8a85e.js +124 -0
- package/cjs/ToJs-5da8a85e.js.map +1 -0
- package/cjs/{actions-12871aca.js → actions-43f4daa4.js} +6 -6
- package/cjs/{actions-12871aca.js.map → actions-43f4daa4.js.map} +1 -1
- package/cjs/client.js +43 -22
- package/cjs/client.js.map +1 -1
- package/cjs/contensis-react-base.js +42 -46
- package/cjs/contensis-react-base.js.map +1 -1
- package/cjs/forms.js +275 -275
- package/cjs/forms.js.map +1 -1
- package/cjs/fromJSLeaveImmer-65d26804.js +28 -0
- package/cjs/fromJSLeaveImmer-65d26804.js.map +1 -0
- package/cjs/{login-81d7f9ef.js → login-5e3972d3.js} +28 -31
- package/cjs/login-5e3972d3.js.map +1 -0
- package/cjs/{reducers-fde41d6b.js → reducers-60dafd94.js} +2 -2
- package/cjs/reducers-60dafd94.js.map +1 -0
- package/cjs/redux.js +13 -14
- package/cjs/redux.js.map +1 -1
- package/cjs/routing.js +9 -8
- package/cjs/routing.js.map +1 -1
- package/cjs/search.js +172 -147
- package/cjs/search.js.map +1 -1
- package/cjs/{selectors-ed26ed97.js → selectors-2c1b1183.js} +8 -4
- package/cjs/selectors-2c1b1183.js.map +1 -0
- package/cjs/user.js +16 -16
- package/cjs/user.js.map +1 -1
- package/cjs/util.js +36 -40
- package/cjs/util.js.map +1 -1
- package/cjs/{version-f061e409.js → version-6f8f4530.js} +54 -45
- package/cjs/version-6f8f4530.js.map +1 -0
- package/cjs/{version-0c190929.js → version-dcfdafd9.js} +5 -5
- package/cjs/{version-0c190929.js.map → version-dcfdafd9.js.map} +1 -1
- package/esm/{App-122f28a3.js → App-3642ea1a.js} +24 -27
- package/esm/App-3642ea1a.js.map +1 -0
- package/esm/{RouteLoader-c2faac87.js → RouteLoader-c8565e6e.js} +37 -23
- package/esm/RouteLoader-c8565e6e.js.map +1 -0
- package/esm/ToJs-1f2e6395.js +93 -0
- package/esm/ToJs-1f2e6395.js.map +1 -0
- package/esm/{actions-3cc39599.js → actions-1e19267f.js} +5 -5
- package/esm/{actions-3cc39599.js.map → actions-1e19267f.js.map} +1 -1
- package/esm/client.js +22 -20
- package/esm/client.js.map +1 -1
- package/esm/contensis-react-base.js +24 -28
- package/esm/contensis-react-base.js.map +1 -1
- package/esm/forms.js +5 -5
- package/esm/forms.js.map +1 -1
- package/esm/fromJSLeaveImmer-e2f0f331.js +26 -0
- package/esm/fromJSLeaveImmer-e2f0f331.js.map +1 -0
- package/esm/{login-92db44d1.js → login-1b08ac1a.js} +12 -12
- package/esm/login-1b08ac1a.js.map +1 -0
- package/esm/{reducers-d6c0edb1.js → reducers-6f6801ed.js} +2 -2
- package/esm/reducers-6f6801ed.js.map +1 -0
- package/esm/redux.js +14 -13
- package/esm/redux.js.map +1 -1
- package/esm/routing.js +9 -8
- package/esm/routing.js.map +1 -1
- package/esm/search.js +142 -135
- package/esm/search.js.map +1 -1
- package/esm/{selectors-82e71d8e.js → selectors-65f0f31c.js} +9 -6
- package/esm/selectors-65f0f31c.js.map +1 -0
- package/esm/user.js +15 -15
- package/esm/user.js.map +1 -1
- package/esm/util.js +5 -5
- package/esm/util.js.map +1 -1
- package/esm/version-696796d7.js +15 -0
- package/esm/{version-59c8f9be.js.map → version-696796d7.js.map} +1 -1
- package/esm/{version-cb9cd09d.js → version-eca1e4ca.js} +34 -24
- package/esm/version-eca1e4ca.js.map +1 -0
- package/models/redux/appstate.d.ts +0 -1
- package/models/redux/reducers/navigation.d.ts +1 -6
- package/models/redux/reducers/version.d.ts +1 -5
- package/models/routing/redux/reducers.d.ts +1 -21
- package/models/routing/redux/selectors.d.ts +1 -1
- package/models/search/hooks/useMinilist.hook.d.ts +2 -15
- package/models/search/models/Queries.d.ts +8 -5
- package/models/search/models/Search.d.ts +9 -8
- package/models/search/models/SearchProps.d.ts +16 -2
- package/models/search/models/SearchState.d.ts +3 -0
- package/models/search/models/index.d.ts +2 -2
- package/models/search/redux/reducers.d.ts +226 -314
- package/models/search/redux/selectors.d.ts +4 -10
- package/models/search/search/expressions.d.ts +2 -6
- package/models/search/transformations/filter-to-filterexpression.mapper.d.ts +6 -0
- package/models/search/transformations/filters-to-filterexpressions.mapper.d.ts +3 -0
- package/models/testImmer/redux/reducer.d.ts +1 -7
- package/models/user/hocs/withLogin.d.ts +2 -2
- package/models/user/hooks/useChangePassword.d.ts +5 -5
- package/models/user/hooks/useForgotPassword.d.ts +6 -6
- package/models/user/hooks/useLogin.d.ts +7 -45
- package/models/user/hooks/useRegistration.d.ts +4 -4
- package/models/user/redux/reducers.d.ts +1 -27
- package/models/user/redux/selectors.d.ts +28 -71
- package/models/util/merge.d.ts +1 -0
- package/package-lock.json +1893 -4633
- package/package.json +46 -47
- package/cjs/App-581b6653.js.map +0 -1
- package/cjs/RouteLoader-282c03ab.js.map +0 -1
- package/cjs/ToJs-87edc45d.js +0 -230
- package/cjs/ToJs-87edc45d.js.map +0 -1
- package/cjs/fromJSLeaveImmer-9b550c8e.js +0 -40
- package/cjs/fromJSLeaveImmer-9b550c8e.js.map +0 -1
- package/cjs/login-81d7f9ef.js.map +0 -1
- package/cjs/reducers-fde41d6b.js.map +0 -1
- package/cjs/selectors-ed26ed97.js.map +0 -1
- package/cjs/version-f061e409.js.map +0 -1
- package/esm/App-122f28a3.js.map +0 -1
- package/esm/RouteLoader-c2faac87.js.map +0 -1
- package/esm/ToJs-52fee252.js +0 -199
- package/esm/ToJs-52fee252.js.map +0 -1
- package/esm/fromJSLeaveImmer-e44d1a91.js +0 -38
- package/esm/fromJSLeaveImmer-e44d1a91.js.map +0 -1
- package/esm/login-92db44d1.js.map +0 -1
- package/esm/reducers-d6c0edb1.js.map +0 -1
- package/esm/selectors-82e71d8e.js.map +0 -1
- package/esm/version-59c8f9be.js +0 -15
- package/esm/version-cb9cd09d.js.map +0 -1
- package/models/search/transformations/filters-to-filterexpression.d.ts +0 -1
- package/models/search/transformations/filters-to-filterexpression.mapper.d.ts +0 -2
package/esm/ToJs-52fee252.js
DELETED
|
@@ -1,199 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { r as getJS } from './selectors-82e71d8e.js';
|
|
3
|
-
|
|
4
|
-
const select = state => getJS(state, 'user');
|
|
5
|
-
|
|
6
|
-
const selectUserIsLoading = state => {
|
|
7
|
-
var _select, _select$authenticatio;
|
|
8
|
-
|
|
9
|
-
return (_select = select(state)) === null || _select === void 0 ? void 0 : (_select$authenticatio = _select.authenticationState) === null || _select$authenticatio === void 0 ? void 0 : _select$authenticatio.loading;
|
|
10
|
-
};
|
|
11
|
-
const selectUserIsAuthenticated = state => {
|
|
12
|
-
var _select2, _select2$authenticati;
|
|
13
|
-
|
|
14
|
-
return (_select2 = select(state)) === null || _select2 === void 0 ? void 0 : (_select2$authenticati = _select2.authenticationState) === null || _select2$authenticati === void 0 ? void 0 : _select2$authenticati.authenticated;
|
|
15
|
-
};
|
|
16
|
-
const selectUserAuthenticationError = state => {
|
|
17
|
-
var _select3, _select3$authenticati;
|
|
18
|
-
|
|
19
|
-
return (_select3 = select(state)) === null || _select3 === void 0 ? void 0 : (_select3$authenticati = _select3.authenticationState) === null || _select3$authenticati === void 0 ? void 0 : _select3$authenticati.authenticationError;
|
|
20
|
-
};
|
|
21
|
-
const selectUserAuthenticationErrorMessage = state => {
|
|
22
|
-
var _select4, _select4$authenticati;
|
|
23
|
-
|
|
24
|
-
return (_select4 = select(state)) === null || _select4 === void 0 ? void 0 : (_select4$authenticati = _select4.authenticationState) === null || _select4$authenticati === void 0 ? void 0 : _select4$authenticati.authenticationErrorMessage;
|
|
25
|
-
};
|
|
26
|
-
const selectUserError = state => {
|
|
27
|
-
var _select5, _select5$authenticati;
|
|
28
|
-
|
|
29
|
-
return (_select5 = select(state)) === null || _select5 === void 0 ? void 0 : (_select5$authenticati = _select5.authenticationState) === null || _select5$authenticati === void 0 ? void 0 : _select5$authenticati.error;
|
|
30
|
-
};
|
|
31
|
-
const selectUserErrorMessage = state => {
|
|
32
|
-
var _select6, _select6$authenticati;
|
|
33
|
-
|
|
34
|
-
return (_select6 = select(state)) === null || _select6 === void 0 ? void 0 : (_select6$authenticati = _select6.authenticationState) === null || _select6$authenticati === void 0 ? void 0 : _select6$authenticati.errorMessage;
|
|
35
|
-
};
|
|
36
|
-
const selectClientCredentials = state => {
|
|
37
|
-
var _select7, _select7$authenticati;
|
|
38
|
-
|
|
39
|
-
return (_select7 = select(state)) === null || _select7 === void 0 ? void 0 : (_select7$authenticati = _select7.authenticationState) === null || _select7$authenticati === void 0 ? void 0 : _select7$authenticati.clientCredentials;
|
|
40
|
-
};
|
|
41
|
-
const selectUser = state => state === null || state === void 0 ? void 0 : state.user;
|
|
42
|
-
const selectUserIsZengentiStaff = state => {
|
|
43
|
-
var _select8;
|
|
44
|
-
|
|
45
|
-
return (_select8 = select(state)) === null || _select8 === void 0 ? void 0 : _select8.isZengentiStaff;
|
|
46
|
-
};
|
|
47
|
-
const selectUserGuid = state => {
|
|
48
|
-
var _select9;
|
|
49
|
-
|
|
50
|
-
return (_select9 = select(state)) === null || _select9 === void 0 ? void 0 : _select9.id;
|
|
51
|
-
};
|
|
52
|
-
const selectUsername = state => {
|
|
53
|
-
var _select10;
|
|
54
|
-
|
|
55
|
-
return (_select10 = select(state)) === null || _select10 === void 0 ? void 0 : _select10.username;
|
|
56
|
-
};
|
|
57
|
-
const selectUserEmail = state => {
|
|
58
|
-
var _select11;
|
|
59
|
-
|
|
60
|
-
return (_select11 = select(state)) === null || _select11 === void 0 ? void 0 : _select11.email;
|
|
61
|
-
};
|
|
62
|
-
const selectUserGroups = state => {
|
|
63
|
-
var _select12;
|
|
64
|
-
|
|
65
|
-
return (_select12 = select(state)) === null || _select12 === void 0 ? void 0 : _select12.groups;
|
|
66
|
-
};
|
|
67
|
-
const selectUserSecurityToken = state => {
|
|
68
|
-
var _select13, _select13$authenticat, _select13$authenticat2;
|
|
69
|
-
|
|
70
|
-
return (_select13 = select(state)) === null || _select13 === void 0 ? void 0 : (_select13$authenticat = _select13.authenticationState) === null || _select13$authenticat === void 0 ? void 0 : (_select13$authenticat2 = _select13$authenticat.clientCredentials) === null || _select13$authenticat2 === void 0 ? void 0 : _select13$authenticat2.contensisClassicToken;
|
|
71
|
-
};
|
|
72
|
-
const selectUserRegistration = state => {
|
|
73
|
-
var _select14;
|
|
74
|
-
|
|
75
|
-
return ((_select14 = select(state)) === null || _select14 === void 0 ? void 0 : _select14.registration) || {};
|
|
76
|
-
};
|
|
77
|
-
const selectUserRegistrationError = state => {
|
|
78
|
-
var _select15, _select15$registratio;
|
|
79
|
-
|
|
80
|
-
return ((_select15 = select(state)) === null || _select15 === void 0 ? void 0 : (_select15$registratio = _select15.registration) === null || _select15$registratio === void 0 ? void 0 : _select15$registratio.error) || false;
|
|
81
|
-
};
|
|
82
|
-
const selectUserRegistrationIsLoading = state => {
|
|
83
|
-
var _select16, _select16$registratio;
|
|
84
|
-
|
|
85
|
-
return ((_select16 = select(state)) === null || _select16 === void 0 ? void 0 : (_select16$registratio = _select16.registration) === null || _select16$registratio === void 0 ? void 0 : _select16$registratio.loading) || false;
|
|
86
|
-
};
|
|
87
|
-
const selectUserRegistrationIsSuccess = state => {
|
|
88
|
-
var _select17, _select17$registratio;
|
|
89
|
-
|
|
90
|
-
return ((_select17 = select(state)) === null || _select17 === void 0 ? void 0 : (_select17$registratio = _select17.registration) === null || _select17$registratio === void 0 ? void 0 : _select17$registratio.success) || false;
|
|
91
|
-
};
|
|
92
|
-
const selectPasswordResetRequestSending = state => {
|
|
93
|
-
var _select18, _select18$passwordRes;
|
|
94
|
-
|
|
95
|
-
return (_select18 = select(state)) === null || _select18 === void 0 ? void 0 : (_select18$passwordRes = _select18.passwordResetRequest) === null || _select18$passwordRes === void 0 ? void 0 : _select18$passwordRes.isSending;
|
|
96
|
-
};
|
|
97
|
-
const selectPasswordResetRequestSent = state => {
|
|
98
|
-
var _select19, _select19$passwordRes;
|
|
99
|
-
|
|
100
|
-
return (_select19 = select(state)) === null || _select19 === void 0 ? void 0 : (_select19$passwordRes = _select19.passwordResetRequest) === null || _select19$passwordRes === void 0 ? void 0 : _select19$passwordRes.sent;
|
|
101
|
-
};
|
|
102
|
-
const selectPasswordResetRequestError = state => {
|
|
103
|
-
var _select20, _select20$passwordRes;
|
|
104
|
-
|
|
105
|
-
return (_select20 = select(state)) === null || _select20 === void 0 ? void 0 : (_select20$passwordRes = _select20.passwordResetRequest) === null || _select20$passwordRes === void 0 ? void 0 : _select20$passwordRes.error;
|
|
106
|
-
};
|
|
107
|
-
const selectResetPasswordSending = state => {
|
|
108
|
-
var _select21, _select21$resetPasswo;
|
|
109
|
-
|
|
110
|
-
return (_select21 = select(state)) === null || _select21 === void 0 ? void 0 : (_select21$resetPasswo = _select21.resetPassword) === null || _select21$resetPasswo === void 0 ? void 0 : _select21$resetPasswo.isSending;
|
|
111
|
-
};
|
|
112
|
-
const selectResetPasswordSent = state => {
|
|
113
|
-
var _select22, _select22$resetPasswo;
|
|
114
|
-
|
|
115
|
-
return (_select22 = select(state)) === null || _select22 === void 0 ? void 0 : (_select22$resetPasswo = _select22.resetPassword) === null || _select22$resetPasswo === void 0 ? void 0 : _select22$resetPasswo.sent;
|
|
116
|
-
};
|
|
117
|
-
const selectResetPasswordError = state => {
|
|
118
|
-
var _select23, _select23$resetPasswo;
|
|
119
|
-
|
|
120
|
-
return (_select23 = select(state)) === null || _select23 === void 0 ? void 0 : (_select23$resetPasswo = _select23.resetPassword) === null || _select23$resetPasswo === void 0 ? void 0 : _select23$resetPasswo.error;
|
|
121
|
-
};
|
|
122
|
-
const selectChangePasswordSending = state => {
|
|
123
|
-
var _select24, _select24$changePassw;
|
|
124
|
-
|
|
125
|
-
return (_select24 = select(state)) === null || _select24 === void 0 ? void 0 : (_select24$changePassw = _select24.changePassword) === null || _select24$changePassw === void 0 ? void 0 : _select24$changePassw.isSending;
|
|
126
|
-
};
|
|
127
|
-
const selectChangePasswordSent = state => {
|
|
128
|
-
var _select25, _select25$changePassw;
|
|
129
|
-
|
|
130
|
-
return (_select25 = select(state)) === null || _select25 === void 0 ? void 0 : (_select25$changePassw = _select25.changePassword) === null || _select25$changePassw === void 0 ? void 0 : _select25$changePassw.sent;
|
|
131
|
-
};
|
|
132
|
-
const selectChangePasswordError = state => {
|
|
133
|
-
var _select26, _select26$changePassw;
|
|
134
|
-
|
|
135
|
-
return (_select26 = select(state)) === null || _select26 === void 0 ? void 0 : (_select26$changePassw = _select26.changePassword) === null || _select26$changePassw === void 0 ? void 0 : _select26$changePassw.error;
|
|
136
|
-
};
|
|
137
|
-
|
|
138
|
-
var selectors = /*#__PURE__*/Object.freeze({
|
|
139
|
-
__proto__: null,
|
|
140
|
-
selectUserIsLoading: selectUserIsLoading,
|
|
141
|
-
selectUserIsAuthenticated: selectUserIsAuthenticated,
|
|
142
|
-
selectUserAuthenticationError: selectUserAuthenticationError,
|
|
143
|
-
selectUserAuthenticationErrorMessage: selectUserAuthenticationErrorMessage,
|
|
144
|
-
selectUserError: selectUserError,
|
|
145
|
-
selectUserErrorMessage: selectUserErrorMessage,
|
|
146
|
-
selectClientCredentials: selectClientCredentials,
|
|
147
|
-
selectUser: selectUser,
|
|
148
|
-
selectUserIsZengentiStaff: selectUserIsZengentiStaff,
|
|
149
|
-
selectUserGuid: selectUserGuid,
|
|
150
|
-
selectUsername: selectUsername,
|
|
151
|
-
selectUserEmail: selectUserEmail,
|
|
152
|
-
selectUserGroups: selectUserGroups,
|
|
153
|
-
selectUserSecurityToken: selectUserSecurityToken,
|
|
154
|
-
selectUserRegistration: selectUserRegistration,
|
|
155
|
-
selectUserRegistrationError: selectUserRegistrationError,
|
|
156
|
-
selectUserRegistrationIsLoading: selectUserRegistrationIsLoading,
|
|
157
|
-
selectUserRegistrationIsSuccess: selectUserRegistrationIsSuccess,
|
|
158
|
-
selectPasswordResetRequestSending: selectPasswordResetRequestSending,
|
|
159
|
-
selectPasswordResetRequestSent: selectPasswordResetRequestSent,
|
|
160
|
-
selectPasswordResetRequestError: selectPasswordResetRequestError,
|
|
161
|
-
selectResetPasswordSending: selectResetPasswordSending,
|
|
162
|
-
selectResetPasswordSent: selectResetPasswordSent,
|
|
163
|
-
selectResetPasswordError: selectResetPasswordError,
|
|
164
|
-
selectChangePasswordSending: selectChangePasswordSending,
|
|
165
|
-
selectChangePasswordSent: selectChangePasswordSent,
|
|
166
|
-
selectChangePasswordError: selectChangePasswordError
|
|
167
|
-
});
|
|
168
|
-
|
|
169
|
-
const matchUserGroup = (userGroups = [], requiredGroups = []) => {
|
|
170
|
-
if (!Array.isArray(requiredGroups) || Array.isArray(requiredGroups) && requiredGroups.length === 0) return true;
|
|
171
|
-
const groupMatch = requiredGroups.some(requiredGroup => {
|
|
172
|
-
return userGroups.some(userGroup => {
|
|
173
|
-
if (requiredGroup.id === userGroup.id) {
|
|
174
|
-
return true;
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
if (requiredGroup.name === userGroup.name) {
|
|
178
|
-
return true;
|
|
179
|
-
}
|
|
180
|
-
});
|
|
181
|
-
});
|
|
182
|
-
return groupMatch;
|
|
183
|
-
};
|
|
184
|
-
|
|
185
|
-
/* eslint-disable react/display-name */
|
|
186
|
-
const toJS = WrappedComponent => wrappedComponentProps => {
|
|
187
|
-
const KEY = 0;
|
|
188
|
-
const VALUE = 1;
|
|
189
|
-
const propsJS = Object.entries(wrappedComponentProps).reduce((newProps, wrappedComponentProp) => {
|
|
190
|
-
const propKey = wrappedComponentProp[KEY];
|
|
191
|
-
const propValue = wrappedComponentProp[VALUE];
|
|
192
|
-
newProps[propKey] = propValue && typeof propValue === 'object' && 'toJS' in propValue ? propValue.toJS() : propValue;
|
|
193
|
-
return newProps;
|
|
194
|
-
}, {});
|
|
195
|
-
return /*#__PURE__*/React.createElement(WrappedComponent, propsJS);
|
|
196
|
-
};
|
|
197
|
-
|
|
198
|
-
export { selectUserIsAuthenticated as a, selectUserGroups as b, selectUserAuthenticationError as c, selectUserAuthenticationErrorMessage as d, selectUserError as e, selectUserErrorMessage as f, selectUserIsLoading as g, selectUser as h, selectUserRegistrationError as i, selectUserRegistrationIsLoading as j, selectUserRegistrationIsSuccess as k, selectUserRegistration as l, matchUserGroup as m, selectPasswordResetRequestSending as n, selectPasswordResetRequestSent as o, selectPasswordResetRequestError as p, selectResetPasswordSending as q, selectResetPasswordSent as r, selectClientCredentials as s, toJS as t, selectResetPasswordError as u, selectChangePasswordSending as v, selectChangePasswordSent as w, selectUserGuid as x, selectChangePasswordError as y, selectors as z };
|
|
199
|
-
//# sourceMappingURL=ToJs-52fee252.js.map
|
package/esm/ToJs-52fee252.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ToJs-52fee252.js","sources":["../src/user/redux/selectors.ts","../src/user/util/matchGroups.ts","../src/util/ToJs.tsx"],"sourcesContent":["import { AppState } from '~/redux/appstate';\nimport { getJS } from '~/redux/util';\n\nconst select = (state: AppState) => getJS(state, 'user');\n\nexport const selectUserIsLoading = (state: AppState) =>\n select(state)?.authenticationState?.loading;\n\nexport const selectUserIsAuthenticated = (state: AppState) =>\n select(state)?.authenticationState?.authenticated;\n\nexport const selectUserAuthenticationError = (state: AppState) =>\n select(state)?.authenticationState?.authenticationError;\n\nexport const selectUserAuthenticationErrorMessage = (state: AppState) =>\n select(state)?.authenticationState?.authenticationErrorMessage;\n\nexport const selectUserError = (state: AppState) =>\n select(state)?.authenticationState?.error;\n\nexport const selectUserErrorMessage = (state: AppState) =>\n select(state)?.authenticationState?.errorMessage;\n\nexport const selectClientCredentials = (state: AppState) =>\n select(state)?.authenticationState?.clientCredentials;\n\nexport const selectUser = (state: AppState) => state?.user;\n\nexport const selectUserIsZengentiStaff = (state: AppState) =>\n select(state)?.isZengentiStaff;\n\nexport const selectUserGuid = (state: AppState) => select(state)?.id;\n\nexport const selectUsername = (state: AppState) => select(state)?.username;\n\nexport const selectUserEmail = (state: AppState) => select(state)?.email;\n\nexport const selectUserGroups = (state: AppState) => select(state)?.groups;\n\nexport const selectUserSecurityToken = (state: AppState) =>\n select(state)?.authenticationState?.clientCredentials?.contensisClassicToken;\n\nexport const selectUserRegistration = (state: AppState) =>\n select(state)?.registration || {};\n\nexport const selectUserRegistrationError = (state: AppState) =>\n select(state)?.registration?.error || false;\n\nexport const selectUserRegistrationIsLoading = (state: AppState) =>\n select(state)?.registration?.loading || false;\n\nexport const selectUserRegistrationIsSuccess = (state: AppState) =>\n select(state)?.registration?.success || false;\n\nexport const selectPasswordResetRequestSending = (state: AppState) =>\n select(state)?.passwordResetRequest?.isSending;\n\nexport const selectPasswordResetRequestSent = (state: AppState) =>\n select(state)?.passwordResetRequest?.sent;\n\nexport const selectPasswordResetRequestError = (state: AppState) =>\n select(state)?.passwordResetRequest?.error;\n\nexport const selectResetPasswordSending = (state: AppState) =>\n select(state)?.resetPassword?.isSending;\n\nexport const selectResetPasswordSent = (state: AppState) =>\n select(state)?.resetPassword?.sent;\n\nexport const selectResetPasswordError = (state: AppState) =>\n select(state)?.resetPassword?.error;\n\nexport const selectChangePasswordSending = (state: AppState) =>\n select(state)?.changePassword?.isSending;\n\nexport const selectChangePasswordSent = (state: AppState) =>\n select(state)?.changePassword?.sent;\n\nexport const selectChangePasswordError = (state: AppState) =>\n select(state)?.changePassword?.error;\n","import { Group } from 'contensis-management-api/lib/models';\nimport { RequireLogin } from '~/routing/routes';\n\nexport const matchUserGroup = (\n userGroups: Group[] = [],\n requiredGroups: RequireLogin = []\n) => {\n if (\n !Array.isArray(requiredGroups) ||\n (Array.isArray(requiredGroups) && requiredGroups.length === 0)\n )\n return true;\n\n const groupMatch = requiredGroups.some(requiredGroup => {\n return userGroups.some(userGroup => {\n if (requiredGroup.id === userGroup.id) {\n return true;\n }\n if (requiredGroup.name === userGroup.name) {\n return true;\n }\n });\n });\n return groupMatch;\n};\n","/* eslint-disable react/display-name */\n/* eslint-disable @typescript-eslint/naming-convention */\nimport React from 'react';\n\nexport const toJS =\n <Props extends { [key: string]: any }>(\n WrappedComponent: React.ComponentType<Props>\n ): React.ComponentType<Props> =>\n (wrappedComponentProps: Props) => {\n const KEY = 0;\n const VALUE = 1;\n\n const propsJS = Object.entries(wrappedComponentProps).reduce<Props>(\n (newProps: any, wrappedComponentProp) => {\n const propKey = wrappedComponentProp[KEY];\n const propValue = wrappedComponentProp[VALUE];\n newProps[propKey] =\n propValue && typeof propValue === 'object' && 'toJS' in propValue\n ? propValue.toJS()\n : propValue;\n return newProps as Props;\n },\n {} as Props\n );\n\n return <WrappedComponent {...propsJS} />;\n };\n"],"names":["select","state","getJS","selectUserIsLoading","authenticationState","loading","selectUserIsAuthenticated","authenticated","selectUserAuthenticationError","authenticationError","selectUserAuthenticationErrorMessage","authenticationErrorMessage","selectUserError","error","selectUserErrorMessage","errorMessage","selectClientCredentials","clientCredentials","selectUser","user","selectUserIsZengentiStaff","isZengentiStaff","selectUserGuid","id","selectUsername","username","selectUserEmail","email","selectUserGroups","groups","selectUserSecurityToken","contensisClassicToken","selectUserRegistration","registration","selectUserRegistrationError","selectUserRegistrationIsLoading","selectUserRegistrationIsSuccess","success","selectPasswordResetRequestSending","passwordResetRequest","isSending","selectPasswordResetRequestSent","sent","selectPasswordResetRequestError","selectResetPasswordSending","resetPassword","selectResetPasswordSent","selectResetPasswordError","selectChangePasswordSending","changePassword","selectChangePasswordSent","selectChangePasswordError","matchUserGroup","userGroups","requiredGroups","Array","isArray","length","groupMatch","some","requiredGroup","userGroup","name","toJS","WrappedComponent","wrappedComponentProps","KEY","VALUE","propsJS","Object","entries","reduce","newProps","wrappedComponentProp","propKey","propValue"],"mappings":";;;AAGA,MAAMA,MAAM,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,IAAP;AAEF,QAAMC,UAAU,GAAGJ,cAAc,CAACK,IAAf,CAAoBC,aAAa,IAAI;AACtD,WAAOP,UAAU,CAACM,IAAX,CAAgBE,SAAS,IAAI;AAClC,UAAID,aAAa,CAACrC,EAAd,KAAqBsC,SAAS,CAACtC,EAAnC,EAAuC;AACrC,eAAO,IAAP;AACD;;AACD,UAAIqC,aAAa,CAACE,IAAd,KAAuBD,SAAS,CAACC,IAArC,EAA2C;AACzC,eAAO,IAAP;AACD;AACF,KAPM,CAAP;AAQD,GATkB,CAAnB;AAUA,SAAOJ,UAAP;AACD;;ACxBD;MAIaK,IAAI,GAEbC,gBADF,IAGCC,qBAAD,IAAkC;AAChC,QAAMC,GAAG,GAAG,CAAZ;AACA,QAAMC,KAAK,GAAG,CAAd;AAEA,QAAMC,OAAO,GAAGC,MAAM,CAACC,OAAP,CAAeL,qBAAf,EAAsCM,MAAtC,CACd,CAACC,QAAD,EAAgBC,oBAAhB,KAAyC;AACvC,UAAMC,OAAO,GAAGD,oBAAoB,CAACP,GAAD,CAApC;AACA,UAAMS,SAAS,GAAGF,oBAAoB,CAACN,KAAD,CAAtC;AACAK,IAAAA,QAAQ,CAACE,OAAD,CAAR,GACEC,SAAS,IAAI,OAAOA,SAAP,KAAqB,QAAlC,IAA8C,UAAUA,SAAxD,GACIA,SAAS,CAACZ,IAAV,EADJ,GAEIY,SAHN;AAIA,WAAOH,QAAP;AACD,GATa,EAUd,EAVc,CAAhB;AAaA,sBAAO,oBAAC,gBAAD,EAAsBJ,OAAtB,CAAP;AACD;;;;"}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { Seq } from 'immutable';
|
|
2
|
-
|
|
3
|
-
const fromJSOrdered = js => {
|
|
4
|
-
return typeof js !== 'object' || js === null ? js : Array.isArray(js) ? Seq(js).map(fromJSOrdered).toList() : Seq(js).map(fromJSOrdered).toOrderedMap();
|
|
5
|
-
};
|
|
6
|
-
|
|
7
|
-
const fromJSLeaveImmer = js => {
|
|
8
|
-
// console.info(js);
|
|
9
|
-
// if (typeof js !== 'object' || js === null) return js;
|
|
10
|
-
// // console.info(`from js - here is js ${JSON.stringify(js)}`);
|
|
11
|
-
// const convertedObject = isOrdered ? OrderedMap() : fromJS({});
|
|
12
|
-
// const keys = Object.keys(js);
|
|
13
|
-
// keys.forEach(key => {
|
|
14
|
-
// if (key === 'immer') {
|
|
15
|
-
// convertedObject.set(key, js[key]);
|
|
16
|
-
// // console.info(`LOOK! - immer untouched bar root key "${key}"`);
|
|
17
|
-
// } else {
|
|
18
|
-
// // console.info(`LOOK! - normal immutable feature "${key}"`);
|
|
19
|
-
// convertedObject.set(key, isOrdered ? fromJSOrdered(js) : fromJS(js));
|
|
20
|
-
// }
|
|
21
|
-
// });
|
|
22
|
-
const immutableObj = fromJSOrdered(js);
|
|
23
|
-
|
|
24
|
-
if (immutableObj && 'set' in immutableObj && typeof immutableObj.set === 'function') {
|
|
25
|
-
// convert the immer parts of the state back
|
|
26
|
-
// to plain JS while retuning an immutable state object
|
|
27
|
-
let immutableState = immutableObj;
|
|
28
|
-
['immer', 'navigation', 'routing', 'search', 'user', 'version'].map(key => {
|
|
29
|
-
if (js[key] && immutableObj.get(key)) immutableState = immutableState.set(key, js[key]);
|
|
30
|
-
});
|
|
31
|
-
return immutableState;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
return immutableObj;
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
export default fromJSLeaveImmer;
|
|
38
|
-
//# sourceMappingURL=fromJSLeaveImmer-e44d1a91.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fromJSLeaveImmer-e44d1a91.js","sources":["../src/util/fromJSOrdered.js","../src/util/fromJSLeaveImmer.js"],"sourcesContent":["import { Seq } from 'immutable';\n\nconst fromJSOrdered = js => {\n return typeof js !== 'object' || js === null\n ? js\n : Array.isArray(js)\n ? Seq(js).map(fromJSOrdered).toList()\n : Seq(js).map(fromJSOrdered).toOrderedMap();\n};\n\nexport default fromJSOrdered;\n","import fromJSOrdered from './fromJSOrdered';\n\nconst fromJSLeaveImmer = js => {\n // console.info(js);\n // if (typeof js !== 'object' || js === null) return js;\n // // console.info(`from js - here is js ${JSON.stringify(js)}`);\n // const convertedObject = isOrdered ? OrderedMap() : fromJS({});\n // const keys = Object.keys(js);\n // keys.forEach(key => {\n // if (key === 'immer') {\n // convertedObject.set(key, js[key]);\n // // console.info(`LOOK! - immer untouched bar root key \"${key}\"`);\n // } else {\n // // console.info(`LOOK! - normal immutable feature \"${key}\"`);\n // convertedObject.set(key, isOrdered ? fromJSOrdered(js) : fromJS(js));\n // }\n // });\n const immutableObj = fromJSOrdered(js);\n if (\n immutableObj &&\n 'set' in immutableObj &&\n typeof immutableObj.set === 'function'\n ) {\n // convert the immer parts of the state back\n // to plain JS while retuning an immutable state object\n let immutableState = immutableObj;\n ['immer', 'navigation', 'routing', 'search', 'user', 'version'].map(key => {\n if (js[key] && immutableObj.get(key))\n immutableState = immutableState.set(key, js[key]);\n });\n return immutableState;\n }\n return immutableObj;\n};\nexport default fromJSLeaveImmer;\n"],"names":["fromJSOrdered","js","Array","isArray","Seq","map","toList","toOrderedMap","fromJSLeaveImmer","immutableObj","set","immutableState","key","get"],"mappings":";;AAEA,MAAMA,aAAa,GAAGC,EAAE,IAAI;AAC1B,SAAO,OAAOA,EAAP,KAAc,QAAd,IAA0BA,EAAE,KAAK,IAAjC,GACHA,EADG,GAEHC,KAAK,CAACC,OAAN,CAAcF,EAAd,IACAG,GAAG,CAACH,EAAD,CAAH,CAAQI,GAAR,CAAYL,aAAZ,EAA2BM,MAA3B,EADA,GAEAF,GAAG,CAACH,EAAD,CAAH,CAAQI,GAAR,CAAYL,aAAZ,EAA2BO,YAA3B,EAJJ;AAKD,CAND;;MCAMC,gBAAgB,GAAGP,EAAE,IAAI;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAMQ,YAAY,GAAGT,aAAa,CAACC,EAAD,CAAlC;;AACA,MACEQ,YAAY,IACZ,SAASA,YADT,IAEA,OAAOA,YAAY,CAACC,GAApB,KAA4B,UAH9B,EAIE;AACA;AACA;AACA,QAAIC,cAAc,GAAGF,YAArB;AACA,KAAC,OAAD,EAAU,YAAV,EAAwB,SAAxB,EAAmC,QAAnC,EAA6C,MAA7C,EAAqD,SAArD,EAAgEJ,GAAhE,CAAoEO,GAAG,IAAI;AACzE,UAAIX,EAAE,CAACW,GAAD,CAAF,IAAWH,YAAY,CAACI,GAAb,CAAiBD,GAAjB,CAAf,EACED,cAAc,GAAGA,cAAc,CAACD,GAAf,CAAmBE,GAAnB,EAAwBX,EAAE,CAACW,GAAD,CAA1B,CAAjB;AACH,KAHD;AAIA,WAAOD,cAAP;AACD;;AACD,SAAOF,YAAP;AACD;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"login-92db44d1.js","sources":["../src/routing/util/find-contenttype-mapping.ts","../src/user/transformations/mapClientCredentials.js","../src/user/util/ContensisManagementApi.js","../src/user/util/CookieHelper.class.js","../src/user/util/OidcUserManager.js","../src/user/util/LoginHelper.class.js","../src/user/redux/sagas/login.js"],"sourcesContent":["import { ContentTypeMapping } from '../routes';\n\nexport const findContentTypeMapping = (\n ContentTypeMappings: ContentTypeMapping[],\n contentTypeId: string\n) => ContentTypeMappings.find(ct => ct.contentTypeID === contentTypeId);\n","import { mapJson } from '~/util/json-mapper';\n\nconst clientCredentials = {\n bearerToken: 'bearerToken',\n bearerTokenExpiryDate: ({ bearerTokenExpiryDate }) =>\n bearerTokenExpiryDate.toISOString(),\n refreshToken: 'refreshToken',\n refreshTokenExpiryDate: ({ refreshTokenExpiryDate }) =>\n refreshTokenExpiryDate.toISOString(),\n contensisClassicToken: 'contensisClassicToken',\n};\nexport default obj => mapJson(obj, clientCredentials);\n","// import { Client } from 'contensis-management-api';\n\nexport const getManagementApiClient = async ({\n bearerToken,\n bearerTokenExpiryDate,\n refreshToken,\n refreshTokenExpiryDate,\n contensisClassicToken,\n username,\n password,\n}) => {\n const rootUrl = SERVERS.api || SERVERS.cms; /* global SERVERS */\n const projectId = PROJECTS[0].id; /* global PROJECTS */\n\n let config = {};\n if (refreshToken) {\n config = {\n clientType: 'contensis_classic_refresh_token',\n clientDetails: {\n refreshToken,\n },\n };\n } else {\n config = {\n clientType: 'contensis_classic',\n clientDetails: {\n username,\n password,\n },\n };\n }\n const { Client } = await import('contensis-management-api');\n\n const client = Client.create({\n ...config,\n projectId,\n rootUrl,\n });\n\n if (bearerToken) client.bearerToken = bearerToken;\n if (bearerTokenExpiryDate)\n client.bearerTokenExpiryDate = bearerTokenExpiryDate;\n if (refreshToken) client.refreshToken = refreshToken;\n if (refreshTokenExpiryDate)\n client.refreshTokenExpiryDate = refreshTokenExpiryDate;\n if (contensisClassicToken)\n client.contensisClassicToken = contensisClassicToken;\n\n return client;\n};\n","import Cookies from 'js-cookie';\n\nconst COOKIE_VALID_DAYS = 1; // 0 = Session cookie\n\n// Override the default js-cookie conversion / encoding\n// methods so the written values work with Contensis sites\nconst _cookie = Cookies.withConverter({\n read: value => decodeURIComponent(value),\n write: value => encodeURIComponent(value),\n});\n\nexport class CookieHelper {\n static GetCookie(name) {\n let cookie = _cookie.get(name);\n if (typeof cookie == 'undefined') {\n return null;\n }\n return cookie;\n }\n\n static SetCookie(name, value, maxAgeDays = COOKIE_VALID_DAYS) {\n maxAgeDays === 0\n ? _cookie.set(name, value)\n : _cookie.set(name, value, { expires: maxAgeDays });\n }\n\n static DeleteCookie(name) {\n _cookie.remove(name);\n }\n}\n","const context = typeof window != 'undefined' ? window : global;\nconst requireOidc =\n process.env.NODE_ENV === 'development'\n ? WSFED_LOGIN === 'true' /* global WSFED_LOGIN */\n : context.WSFED_LOGIN === 'true';\n\nconst servers = SERVERS; /* global SERVERS */\n\nexport const userManagerConfig =\n typeof window !== 'undefined'\n ? {\n authority: `${servers.cms}/authenticate/`,\n client_id: 'WebsiteAdfsClient',\n redirect_uri: window.location.toString(),\n post_logout_redirect_uri: window.location.toString(),\n response_type: 'id_token',\n scope: 'openid',\n filterProtocolClaims: false,\n }\n : {};\n\nexport const createUserManager = async config => {\n if (typeof window !== 'undefined' && requireOidc) {\n try {\n const { UserManager } = await import(\n /* webpackChunkName: \"oidcclient\" */ 'oidc-client'\n );\n return new UserManager(config);\n } catch (e) {\n // eslint-disable-next-line no-console\n console.log('Exception in createUserManager: ', e);\n }\n } else return {};\n};\n\n//const userManager = createUserManager(userManagerConfig);\n\n// export default userManager;\n","/* eslint-disable require-atomic-updates */\nimport { getManagementApiClient } from './ContensisManagementApi';\nimport { to } from 'await-to-js';\n\nimport { CookieHelper } from './CookieHelper.class';\n\nimport mapClientCredentials from '../transformations/mapClientCredentials';\nimport { createUserManager, userManagerConfig } from './OidcUserManager';\n\nexport const LOGIN_COOKIE = 'ContensisCMSUserName';\nexport const REFRESH_TOKEN_COOKIE = 'RefreshToken';\n\nconst context = typeof window != 'undefined' ? window : global;\n\nexport class LoginHelper {\n static CMS_URL = SERVERS.cms /* global SERVERS */;\n static WSFED_LOGIN =\n process.env.NODE_ENV === 'development'\n ? WSFED_LOGIN === 'true' /* global WSFED_LOGIN */\n : context.WSFED_LOGIN === 'true';\n static LOGIN_ROUTE = '/account/login';\n static ACCESS_DENIED_ROUTE = '/account/access-denied';\n\n static SetLoginCookies({ contensisClassicToken, refreshToken }) {\n console.info(\n 'SetLoginCookies:',\n LOGIN_COOKIE,\n contensisClassicToken,\n REFRESH_TOKEN_COOKIE,\n refreshToken\n );\n if (contensisClassicToken)\n CookieHelper.SetCookie(LOGIN_COOKIE, contensisClassicToken);\n if (refreshToken)\n CookieHelper.SetCookie(REFRESH_TOKEN_COOKIE, refreshToken);\n }\n\n static GetCachedCredentials() {\n return {\n bearerToken: null,\n bearerTokenExpiryDate: null,\n refreshToken: CookieHelper.GetCookie(REFRESH_TOKEN_COOKIE),\n refreshTokenExpiryDate: null,\n contensisClassicToken: CookieHelper.GetCookie(LOGIN_COOKIE),\n };\n }\n\n static ClearCachedCredentials() {\n CookieHelper.DeleteCookie(LOGIN_COOKIE);\n CookieHelper.DeleteCookie(REFRESH_TOKEN_COOKIE);\n }\n\n static async LoginUser({ username, password, clientCredentials }) {\n let credentials = clientCredentials;\n let authenticationState = {\n authenticated: false,\n authenticationError: false,\n error: false,\n clientCredentials: null,\n };\n let transientClient;\n let user;\n\n if (username && password) {\n // Get a management client with username and password\n transientClient = await getManagementApiClient({\n username,\n password,\n });\n\n // Ensure the client has requested a bearer token\n const [loginError, clientBearerToken] = await to(\n transientClient.ensureBearerToken()\n );\n\n // Problem getting token with username and password\n if (loginError) {\n const authenticationError = loginError.name.includes(\n 'ContensisAuthenticationError'\n );\n authenticationState = {\n authenticated: false,\n authenticationError: authenticationError,\n authenticationErrorMessage:\n (authenticationError && loginError.message) || null,\n error: !authenticationError,\n errorMessage: (!authenticationError && loginError.message) || null,\n clientCredentials: null,\n };\n LoginHelper.ClearCachedCredentials();\n }\n\n // Got a token using username and password\n if (clientBearerToken) {\n // Set credentials so we can continue to GetUserDetails\n credentials = mapClientCredentials(transientClient);\n LoginHelper.SetLoginCookies(credentials);\n authenticationState = {\n authenticated: true,\n authenticationError: false,\n error: false,\n clientCredentials: credentials,\n };\n }\n }\n\n // If we have credentials supplied by a successful username and password login\n // or clientCredentials supplied in the options argument we can continue to\n // fetch the user's details\n if (credentials) {\n const client =\n transientClient || (await getManagementApiClient(credentials));\n const [error, userDetails] = await LoginHelper.GetUserDetails(client);\n\n if (error) {\n authenticationState = {\n authenticated: false,\n authenticationError: false,\n error: { message: error.message, stack: error.stack },\n clientCredentials: null,\n };\n LoginHelper.ClearCachedCredentials();\n } else {\n // Ensure we get latest refreshToken and contensisClassicToken from the latest client\n const latestCredentials = mapClientCredentials(client);\n LoginHelper.SetLoginCookies(latestCredentials);\n\n user = userDetails;\n authenticationState = {\n authenticated: true,\n authenticationError: false,\n error: false,\n clientCredentials: latestCredentials,\n };\n }\n }\n\n return { authenticationState, user };\n }\n\n static GetUserDetails = async client => {\n let userError,\n groupsError,\n user = {},\n groupsResult;\n\n [userError, user] = await to(client.security.users.getCurrent());\n if (user && user.id) {\n [groupsError, groupsResult] = await to(\n client.security.users.getUserGroups({\n userId: user.id,\n includeInherited: true,\n })\n );\n // Set groups attribute in user object to be the items\n // array from the getUserGroups result\n if (groupsResult && groupsResult.items) user.groups = groupsResult.items;\n\n //If groups call fails then log the error but allow the user to login still\n // eslint-disable-next-line no-console\n if (groupsError) console.log(groupsError);\n }\n return [userError, user];\n };\n\n static LogoutUser(redirectPath) {\n LoginHelper.ClearCachedCredentials();\n if (LoginHelper.WSFED_LOGIN) {\n LoginHelper.WsFedLogout(redirectPath);\n } else {\n if (redirectPath) LoginHelper.ClientRedirectToPath(redirectPath);\n else LoginHelper.ClientRedirectToSignInPage();\n }\n }\n\n static ClientRedirectToHome(location) {\n if (typeof window != 'undefined') {\n let url = '/';\n if (location) {\n const { search, hash } = location;\n url = search ? `${url}${search}` : url;\n url = hash ? `${url}${hash}` : url;\n }\n window.location.href = url;\n }\n }\n\n static async ClientRedirectToSignInPage(redirectPath) {\n if (LoginHelper.WSFED_LOGIN) {\n await LoginHelper.WsFedLogout();\n await LoginHelper.WsFedLogin();\n } else {\n // Standard Contensis Login\n let url = LoginHelper.LOGIN_ROUTE;\n if (typeof redirectPath === 'string')\n url = `${url}?redirect_uri=${redirectPath}`;\n if (\n typeof location !== 'undefined' &&\n redirectPath !== LoginHelper.LOGIN_ROUTE\n )\n location.replace(url);\n }\n }\n\n static ClientRedirectToAccessDeniedPage(originalPath) {\n let url = LoginHelper.ACCESS_DENIED_ROUTE;\n if (originalPath === url) return;\n\n if (typeof originalPath === 'string')\n url = `${url}?original_uri=${originalPath}`;\n if (typeof location !== 'undefined') location.href = url;\n }\n\n static ClientRedirectToPath(redirectPath) {\n if (typeof redirectPath === 'string') {\n if (typeof location !== 'undefined') window.location.href = redirectPath;\n } else LoginHelper.ClientRedirectToHome();\n }\n\n static async WsFedLogin(redirectUri) {\n const userManager = await createUserManager(userManagerConfig);\n userManager.signinRedirect({\n scope: 'openid',\n response_type: 'id_token',\n redirect_uri: redirectUri || window.location.toString(),\n });\n }\n\n static async WsFedLogout(redirectPath) {\n await fetch(\n `${LoginHelper.CMS_URL}/authenticate/logout?jsonResponseRequired=true`,\n {\n credentials: 'include',\n }\n );\n if (redirectPath) {\n window.location = redirectPath;\n }\n }\n\n static async GetCredentialsForSecurityToken(securityToken) {\n const [error, response] = await to(\n fetch(`${LoginHelper.CMS_URL}/REST/Contensis/Security/IsAuthenticated`, {\n method: 'POST',\n headers: {\n Accept: 'application/json',\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify({\n securityToken: encodeURIComponent(securityToken),\n }),\n })\n );\n if (error) return [{ message: 'Failed to fetch credentials' }];\n if (response.ok) {\n const [parseError, body] = await to(response.json());\n if (parseError) return [parseError];\n\n const { LogonResult, ApplicationData = [] } = body;\n if (LogonResult !== 0) {\n return [\n { message: 'Security token is invalid', data: ApplicationData },\n ];\n }\n if (ApplicationData.length > 0) {\n let refreshToken;\n ApplicationData.forEach(item => {\n if (item.Key === 'ContensisSecurityRefreshToken')\n refreshToken = item.Value;\n });\n if (!refreshToken) {\n return [\n {\n message:\n 'Fetch credentials: Unable to find ContensisSecurityRefreshToken',\n },\n ];\n }\n return [undefined, refreshToken];\n } else {\n return [\n {\n message:\n 'Fetch credentials: Unable to find ContensisSecurityRefreshToken',\n },\n ];\n }\n } else {\n return [\n {\n message: `Fetch credentials error: ${response.status} ${response.statusText}`,\n },\n ];\n }\n }\n\n static isZengentiStaff(email) {\n const emailRefs = ['@zengenti', '@contensis'];\n\n return emailRefs.some(emailRef => {\n if (email.includes(emailRef)) {\n return true;\n }\n });\n }\n}\n","import { takeEvery, select, put, call } from 'redux-saga/effects';\nimport {\n SET_AUTHENTICATION_STATE,\n LOGIN_USER,\n LOGOUT_USER,\n VALIDATE_USER,\n} from '../types';\nimport {\n selectUserIsAuthenticated,\n selectClientCredentials,\n selectUserGroups,\n} from '../selectors';\n\nimport { setRoute } from '~/routing/redux/actions';\nimport { selectCurrentSearch } from '~/routing/redux/selectors';\nimport { findContentTypeMapping } from '~/routing/util/find-contenttype-mapping';\n\nimport mapClientCredentials from '~/user/transformations/mapClientCredentials';\n\nimport { getManagementApiClient } from '~/user/util/ContensisManagementApi';\nimport { LoginHelper } from '~/user/util/LoginHelper.class';\nimport { matchUserGroup } from '~/user/util/matchGroups';\nimport { queryParams } from '~/util/navigation';\n\nexport const loginSagas = [\n takeEvery(LOGIN_USER, loginUserSaga),\n takeEvery(LOGOUT_USER, logoutUserSaga),\n takeEvery(VALIDATE_USER, validateUserSaga),\n takeEvery(SET_AUTHENTICATION_STATE, redirectAfterSuccessfulLoginSaga),\n];\n\nexport function* handleRequiresLoginSaga(action) {\n const {\n entry,\n requireLogin,\n routes: { ContentTypeMappings },\n staticRoute,\n } = action;\n let userLoggedIn = yield select(selectUserIsAuthenticated);\n\n // Check for a securityToken in querystring\n const currentQs = queryParams(yield select(selectCurrentSearch));\n const securityToken = currentQs.securityToken || currentQs.securitytoken;\n\n // Check if any of the defined routes have \"requireLogin\" attribute\n const { requireLogin: authRoute } = (staticRoute && staticRoute.route) || {};\n const { requireLogin: authContentType } =\n (entry &&\n findContentTypeMapping(ContentTypeMappings, entry?.sys?.contentTypeId)) ||\n {};\n\n // If requireLogin, authRoute or authContentType has been specified as an\n // array of groups we can merge all the arrays and match on any group supplied\n const routeRequiresGroups = [\n ...((Array.isArray(authContentType) && authContentType) || []),\n ...((Array.isArray(authRoute) && authRoute) || []),\n ...((Array.isArray(requireLogin) && requireLogin) || []),\n ];\n const routeRequiresLogin = !!authContentType || !!authRoute || !!requireLogin;\n\n if (!userLoggedIn) {\n // If cookies or securityToken are found on any route change\n // always validate and login the user\n if (routeRequiresLogin) {\n // If routeRequiresLogin do a blocking call that returns userLoggedIn\n userLoggedIn = yield call(validateUserSaga, { securityToken });\n }\n // otherwise do a non blocking put to handle validation in the background\n else yield put({ type: VALIDATE_USER, securityToken });\n }\n\n if (routeRequiresLogin) {\n // If a security token is in the querystring and we are not already\n // logged in something is wrong and we won't bother going on another redirect loop\n if (!userLoggedIn && !securityToken) {\n LoginHelper.ClientRedirectToSignInPage(action.location.pathname);\n } else if (routeRequiresGroups.length > 0) {\n const userGroups = yield select(selectUserGroups);\n const groupMatch = matchUserGroup(userGroups, routeRequiresGroups);\n\n if (!groupMatch)\n LoginHelper.ClientRedirectToAccessDeniedPage(action.location.pathname);\n }\n }\n}\n\nfunction* validateUserSaga({ securityToken }) {\n if (securityToken) {\n // If we have just a security token we will call a CMS endpoint\n // and provide us with a RefreshToken cookie we can use during login\n const [error, refreshToken] =\n yield LoginHelper.GetCredentialsForSecurityToken(securityToken);\n if (refreshToken)\n LoginHelper.SetLoginCookies({\n contensisClassicToken: securityToken,\n refreshToken,\n });\n if (error)\n yield put({\n type: SET_AUTHENTICATION_STATE,\n authenticationState: {\n error: { message: error.message, stack: error.stack },\n },\n });\n }\n\n // Check for refreshToken in cookies\n const clientCredentials = LoginHelper.GetCachedCredentials();\n\n // Log the user in if a refreshToken is found\n if (clientCredentials.refreshToken)\n yield call(loginUserSaga, { clientCredentials });\n\n // Tell any callers have we successfully logged in?\n return yield select(selectUserIsAuthenticated);\n}\n\nfunction* loginUserSaga(action = {}) {\n const { username, password, clientCredentials } = action;\n\n // If a WSFED_LOGIN site has dispatched the loginUser action\n // just redirect them to the Identity Provider sign in\n if (action.type === LOGIN_USER && LoginHelper.WSFED_LOGIN)\n LoginHelper.ClientRedirectToSignInPage();\n\n const { authenticationState, user } = yield LoginHelper.LoginUser({\n username,\n password,\n clientCredentials,\n });\n\n yield put({\n type: SET_AUTHENTICATION_STATE,\n authenticationState,\n user,\n });\n}\nconst removeHostnamePart = path => {\n // eslint-disable-next-line no-console\n console.log(path);\n const relativePath = '/' + path.split('/').splice(3).join('/');\n // eslint-disable-next-line no-console\n console.log(relativePath);\n return relativePath;\n};\n\nfunction* redirectAfterSuccessfulLoginSaga() {\n const isLoggedIn = yield select(selectUserIsAuthenticated);\n const { redirect_uri: redirectPath, ReturnURL: assetRedirectPath } =\n queryParams(yield select(selectCurrentSearch));\n\n if (isLoggedIn && assetRedirectPath && typeof window != 'undefined') {\n const path = removeHostnamePart(assetRedirectPath);\n // This has to be a hard href to get the app to\n // leave React and hit the server for the IIS hosted assets\n window.location.href = path;\n // yield put(setRoute(path)); // does not work in this scenario\n } else if (isLoggedIn && redirectPath) {\n yield put(setRoute(redirectPath));\n }\n}\n\nfunction* logoutUserSaga({ redirectPath }) {\n yield put({\n type: SET_AUTHENTICATION_STATE,\n user: null,\n });\n yield LoginHelper.LogoutUser(redirectPath);\n}\n\nexport function* refreshSecurityToken() {\n const clientCredentials = yield select(selectClientCredentials);\n if (Object.keys(clientCredentials).length > 0) {\n const client = yield getManagementApiClient(clientCredentials);\n yield client.authenticate();\n\n const authenticationState = {};\n\n const newClientCredentials = mapClientCredentials(client);\n\n authenticationState.clientCredentials = newClientCredentials;\n\n yield put({\n type: SET_AUTHENTICATION_STATE,\n authenticationState,\n });\n }\n}\n"],"names":["findContentTypeMapping","ContentTypeMappings","contentTypeId","find","ct","contentTypeID","clientCredentials","bearerToken","bearerTokenExpiryDate","toISOString","refreshToken","refreshTokenExpiryDate","contensisClassicToken","obj","mapJson","getManagementApiClient","username","password","rootUrl","SERVERS","api","cms","projectId","PROJECTS","id","config","clientType","clientDetails","Client","client","create","COOKIE_VALID_DAYS","_cookie","Cookies","withConverter","read","value","decodeURIComponent","write","encodeURIComponent","CookieHelper","GetCookie","name","cookie","get","SetCookie","maxAgeDays","set","expires","DeleteCookie","remove","context","window","global","requireOidc","process","env","NODE_ENV","WSFED_LOGIN","servers","userManagerConfig","authority","client_id","redirect_uri","location","toString","post_logout_redirect_uri","response_type","scope","filterProtocolClaims","createUserManager","UserManager","e","console","log","LOGIN_COOKIE","REFRESH_TOKEN_COOKIE","LoginHelper","SetLoginCookies","info","GetCachedCredentials","ClearCachedCredentials","LoginUser","credentials","authenticationState","authenticated","authenticationError","error","transientClient","user","loginError","clientBearerToken","to","ensureBearerToken","includes","authenticationErrorMessage","message","errorMessage","mapClientCredentials","userDetails","GetUserDetails","stack","latestCredentials","LogoutUser","redirectPath","WsFedLogout","ClientRedirectToPath","ClientRedirectToSignInPage","ClientRedirectToHome","url","search","hash","href","WsFedLogin","LOGIN_ROUTE","replace","ClientRedirectToAccessDeniedPage","originalPath","ACCESS_DENIED_ROUTE","redirectUri","userManager","signinRedirect","fetch","CMS_URL","GetCredentialsForSecurityToken","securityToken","response","method","headers","Accept","body","JSON","stringify","ok","parseError","json","LogonResult","ApplicationData","data","length","forEach","item","Key","Value","undefined","status","statusText","isZengentiStaff","email","emailRefs","some","emailRef","userError","groupsError","groupsResult","security","users","getCurrent","getUserGroups","userId","includeInherited","items","groups","loginSagas","takeEvery","LOGIN_USER","loginUserSaga","LOGOUT_USER","logoutUserSaga","VALIDATE_USER","validateUserSaga","SET_AUTHENTICATION_STATE","redirectAfterSuccessfulLoginSaga","handleRequiresLoginSaga","action","entry","requireLogin","routes","staticRoute","userLoggedIn","select","selectUserIsAuthenticated","currentQs","queryParams","selectCurrentSearch","securitytoken","authRoute","route","authContentType","sys","routeRequiresGroups","Array","isArray","routeRequiresLogin","call","put","type","pathname","userGroups","selectUserGroups","groupMatch","matchUserGroup","removeHostnamePart","path","relativePath","split","splice","join","isLoggedIn","ReturnURL","assetRedirectPath","setRoute","refreshSecurityToken","selectClientCredentials","Object","keys","authenticate","newClientCredentials"],"mappings":";;;;;;;;;MAEaA,sBAAsB,GAAG,CACpCC,mBADoC,EAEpCC,aAFoC,KAGjCD,mBAAmB,CAACE,IAApB,CAAyBC,EAAE,IAAIA,EAAE,CAACC,aAAH,KAAqBH,aAApD;;ACHL,MAAMI,iBAAiB,GAAG;AACxBC,EAAAA,WAAW,EAAE,aADW;AAExBC,EAAAA,qBAAqB,EAAE,CAAC;AAAEA,IAAAA;AAAF,GAAD,KACrBA,q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FQ,KAAD,CAAT;AAID;AACF;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"reducers-d6c0edb1.js","sources":["../src/user/redux/types.js","../src/user/redux/reducers.ts"],"sourcesContent":["const ACTION_PREFIX = '@USER/';\nexport const VALIDATE_USER = `${ACTION_PREFIX}VALIDATE_USER`;\nexport const SET_AUTHENTICATION_STATE = `${ACTION_PREFIX}SET_AUTHENTICATION_STATE`;\nexport const LOGIN_USER = `${ACTION_PREFIX}LOGIN_USER`;\nexport const LOGIN_SUCCESSFUL = `${ACTION_PREFIX}LOGIN_SUCCESSFUL`;\nexport const LOGIN_FAILED = `${ACTION_PREFIX}LOGIN_FAILED`;\nexport const LOGOUT_USER = `${ACTION_PREFIX}LOGOUT_USER`;\nexport const REGISTER_USER = `${ACTION_PREFIX}REGISTER_USER`;\nexport const REGISTER_USER_SUCCESS = `${ACTION_PREFIX}REGISTER_USER_SUCCESS`;\nexport const REGISTER_USER_FAILED = `${ACTION_PREFIX}REGISTER_USER_FAILED`;\n\nexport const REQUEST_USER_PASSWORD_RESET = `${ACTION_PREFIX}REQUEST_USER_PASSWORD_RESET`;\nexport const RESET_USER_PASSWORD = `${ACTION_PREFIX}RESET_USER_PASSWORD`;\nexport const REQUEST_USER_PASSWORD_RESET_SENDING = `${ACTION_PREFIX}REQUEST_USER_PASSWORD_RESET_SENDING`;\nexport const REQUEST_USER_PASSWORD_RESET_SUCCESS = `${ACTION_PREFIX}REQUEST_USER_PASSWORD_RESET_SUCCESS`;\nexport const REQUEST_USER_PASSWORD_RESET_ERROR = `${ACTION_PREFIX}REQUEST_USER_PASSWORD_RESET_ERROR`;\nexport const RESET_USER_PASSWORD_SENDING = `${ACTION_PREFIX}RESET_USER_PASSWORD_SENDING`;\nexport const RESET_USER_PASSWORD_SUCCESS = `${ACTION_PREFIX}RESET_USER_PASSWORD_SUCCESS`;\nexport const RESET_USER_PASSWORD_ERROR = `${ACTION_PREFIX}RESET_USER_PASSWORD_ERROR`;\n\nexport const CHANGE_USER_PASSWORD = `${ACTION_PREFIX}CHANGE_USER_PASSWORD`;\nexport const CHANGE_USER_PASSWORD_SENDING = `${ACTION_PREFIX}CHANGE_USER_PASSWORD_SENDING`;\nexport const CHANGE_USER_PASSWORD_SUCCESS = `${ACTION_PREFIX}CHANGE_USER_PASSWORD_SUCCESS`;\nexport const CHANGE_USER_PASSWORD_ERROR = `${ACTION_PREFIX}CHANGE_USER_PASSWORD_ERROR`;\n","import { Draft, produce } from 'immer';\nimport { AppState } from '~/redux/appstate';\nimport {\n REGISTER_USER,\n REGISTER_USER_FAILED,\n REGISTER_USER_SUCCESS,\n SET_AUTHENTICATION_STATE,\n LOGIN_USER,\n LOGOUT_USER,\n REQUEST_USER_PASSWORD_RESET_SENDING,\n REQUEST_USER_PASSWORD_RESET_SUCCESS,\n REQUEST_USER_PASSWORD_RESET_ERROR,\n RESET_USER_PASSWORD_SENDING,\n RESET_USER_PASSWORD_SUCCESS,\n RESET_USER_PASSWORD_ERROR,\n CHANGE_USER_PASSWORD_SENDING,\n CHANGE_USER_PASSWORD_SUCCESS,\n CHANGE_USER_PASSWORD_ERROR,\n} from './types';\n\nconst defaultAuthenticationState = {\n authenticated: false,\n authenticationError: false,\n authenticationErrorMessage: null,\n clientCredentials: null,\n error: false,\n errorMessage: null,\n loading: false,\n};\n\nconst defaultPasswordResetRequestValues = {\n isSending: false,\n sent: false,\n error: null,\n};\n\nconst defaultResetPasswordValues = {\n isSending: false,\n sent: false,\n error: null,\n};\n\nconst defaultChangePasswordValues = {\n isSending: false,\n sent: false,\n error: null,\n};\n\nconst defaultRegistrationValues = {\n loading: false,\n success: false,\n error: null,\n};\n\nexport const initialUserState = {\n authenticationState: defaultAuthenticationState,\n passwordResetRequest: defaultPasswordResetRequestValues,\n resetPassword: defaultResetPasswordValues,\n changePassword: defaultChangePasswordValues,\n groups: [],\n};\n\nexport default produce((state: Draft<AppState['user']>, action) => {\n switch (action.type) {\n case LOGIN_USER:\n case LOGOUT_USER:\n case SET_AUTHENTICATION_STATE: {\n if (!action.authenticationState) {\n action.authenticationState = defaultAuthenticationState;\n }\n\n const loading = action.type === LOGIN_USER;\n\n const {\n authenticationState: {\n error = false,\n errorMessage = null,\n authenticated,\n authenticationError = false,\n authenticationErrorMessage = null,\n clientCredentials = null,\n },\n user,\n } = action;\n\n if (user) {\n user.name = `${user.firstName} ${user.lastName}`;\n user.isZengentiStaff = user.email.includes('@zengenti.com');\n }\n\n state = {\n ...initialUserState,\n ...(user || state),\n authenticationState: {\n authenticated:\n authenticated || state?.authenticationState?.authenticated,\n authenticationError,\n authenticationErrorMessage,\n clientCredentials,\n error,\n errorMessage,\n loading,\n },\n };\n return;\n }\n // REGISTER_USER is the trigger to set the user.registration initial state\n // and will set user.registration.loading to true\n // REGISTER_USER_FAILED will unset user.registration.loading and will set\n // the value in user.registration.error\n // REGISTER_USER_SUCCESS will unset user.registration.loading and will\n // set user.registration to the created user from the api response\n case REGISTER_USER:\n case REGISTER_USER_FAILED:\n case REGISTER_USER_SUCCESS: {\n const { error, user } = action;\n\n // Set registration object from the supplied action.user\n // so we can call these values back later\n state.registration = (user ||\n state.registration ||\n defaultRegistrationValues) as typeof defaultRegistrationValues;\n\n // Set registration flags so the UI can track the status\n state.registration.success = action.type === REGISTER_USER_SUCCESS;\n state.registration.error = error || false;\n state.registration.loading = action.type === REGISTER_USER;\n return;\n }\n case REQUEST_USER_PASSWORD_RESET_SENDING:\n state.passwordResetRequest = defaultPasswordResetRequestValues;\n state.passwordResetRequest.isSending = true;\n return;\n case REQUEST_USER_PASSWORD_RESET_SUCCESS:\n if (state.passwordResetRequest) {\n state.passwordResetRequest.isSending = false;\n state.passwordResetRequest.sent = true;\n }\n return;\n case REQUEST_USER_PASSWORD_RESET_ERROR:\n if (state.passwordResetRequest) {\n state.passwordResetRequest.isSending = false;\n state.passwordResetRequest.error = action.error;\n }\n return;\n case RESET_USER_PASSWORD_SENDING:\n if (state.resetPassword) {\n state.resetPassword.isSending = true;\n }\n return;\n case RESET_USER_PASSWORD_SUCCESS:\n if (state.resetPassword) {\n state.resetPassword.isSending = false;\n state.resetPassword.sent = true;\n }\n return;\n case RESET_USER_PASSWORD_ERROR:\n if (state.resetPassword) {\n state.resetPassword.isSending = false;\n state.resetPassword.error = action.error;\n }\n return;\n case CHANGE_USER_PASSWORD_SENDING:\n if (state.changePassword) {\n state.changePassword.isSending = true;\n }\n return;\n case CHANGE_USER_PASSWORD_SUCCESS:\n if (state.changePassword) {\n state.changePassword.isSending = false;\n state.changePassword.sent = true;\n }\n return;\n case CHANGE_USER_PASSWORD_ERROR:\n if (state.changePassword) {\n state.changePassword.isSending = false;\n state.changePassword.error = action.error;\n }\n return;\n default:\n return;\n }\n}, initialUserState);\n"],"names":["ACTION_PREFIX","VALIDATE_USER","SET_AUTHENTICATION_STATE","LOGIN_USER","LOGIN_SUCCESSFUL","LOGIN_FAILED","LOGOUT_USER","REGISTER_USER","REGISTER_USER_SUCCESS","REGISTER_USER_FAILED","REQUEST_USER_PASSWORD_RESET","RESET_USER_PASSWORD","REQUEST_USER_PASSWORD_RESET_SENDING","REQUEST_USER_PASSWORD_RESET_SUCCESS","REQUEST_USER_PASSWORD_RESET_ERROR","RESET_USER_PASSWORD_SENDING","RESET_USER_PASSWORD_SUCCESS","RESET_USER_PASSWORD_ERROR","CHANGE_USER_PASSWORD","CHANGE_USER_PASSWORD_SENDING","CHANGE_USER_PASSWORD_SUCCESS","CHANGE_USER_PASSWORD_ERROR","defaultAuthenticationState","authenticated","authenticationError","authenticationErrorMessage","clientCredentials","error","errorMessage","loading","defaultPasswordResetRequestValues","isSending","sent","defaultResetPasswordValues","defaultChangePasswordValues","defaultRegistrationValues","success","initialUserState","authenticationState","passwordResetRequest","resetPassword","changePassword","groups","produce","state","action","type","user","name","firstName","lastName","isZengentiStaff","email","includes","registration"],"mappings":";;AAAA,MAAMA,aAAa,GAAG,QAAtB;MACaC,aAAa,GAAI,GAAED,aAAc;MACjCE,wBAAwB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ArB,GAA4B,IAA5B;AACD;;AACD;;AACF,SAAKX,0BAAL;AACE,UAAIuB,KAAK,CAACH,cAAV,EAA0B;AACxBG,QAAAA,KAAK,CAACH,cAAN,CAAqBV,SAArB,GAAiC,KAAjC;AACAa,QAAAA,KAAK,CAACH,cAAN,CAAqBd,KAArB,GAA6BkB,MAAM,CAAClB,KAApC;AACD;;AACD;;AACF;AACE;AArHJ;AAuHD,CAxHqB,EAwHnBU,gBAxHmB,CAAtB;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"selectors-82e71d8e.js","sources":["../src/redux/util.ts","../src/util/navigation.js","../src/routing/redux/selectors.ts"],"sourcesContent":["import { jpath } from '~/util/json-mapper';\n\nexport const action = (type: string, payload: any = {}) => ({\n type,\n ...payload,\n});\n\nexport const getJS = <S extends Record<string, unknown>, T extends keyof S>(\n state: S,\n stateKey: T\n) => {\n if (\n 'get' in state &&\n typeof state.get === 'function' &&\n 'toJS' in state &&\n typeof state.toJS === 'function'\n ) {\n return state.get(stateKey) as S[T];\n }\n return state[stateKey];\n};\n\nexport const getImmutableOrJS = <\n S extends Record<string, unknown>,\n T extends keyof S | any\n>(\n state: S,\n stateKey: T | T[],\n fallbackValue?: any,\n returnType: 'immutable' | 'js' = globalThis.STATE_TYPE\n) => {\n // Find a fromJS function from global that is dynamically loaded in createStore\n // or replace with a stub function for non-immutable gets\n const fromJS =\n returnType === 'immutable'\n ? globalThis.immutable?.fromJSOrdered || globalThis.immutable?.fromJS\n : v => v;\n\n if (\n state &&\n 'get' in state &&\n typeof state.get === 'function' &&\n 'getIn' in state &&\n typeof state.getIn === 'function' &&\n 'toJS' in state &&\n typeof state.toJS === 'function'\n ) {\n if (Array.isArray(stateKey))\n return fromJS(state.getIn(stateKey, fallbackValue));\n return fromJS(state.get(stateKey, fallbackValue)) as S[T | any];\n }\n\n if (Array.isArray(stateKey) && state && typeof state === 'object') {\n const result = jpath(stateKey.join('.'), state);\n if (typeof result === 'undefined') return fallbackValue;\n return result;\n }\n\n const result =\n state && typeof state === 'object' ? state[stateKey as string] : undefined;\n if (typeof result === 'undefined') return fallbackValue;\n return result;\n};\n","import queryString from 'query-string';\n\nexport function queryParams(search) {\n return queryString.parse(\n typeof window != 'undefined' ? window.location.search : search\n );\n}\nexport const routeParams = staticRoute =>\n staticRoute && staticRoute.match ? staticRoute.match.params : {};\n\nexport const buildUrl = (route, params) => {\n const qs = queryString.stringify(params);\n const path = qs ? `${route}?${qs}` : route;\n return path;\n};\n\nexport const clientHostname = () =>\n `${window.location.protocol}//${window.location.hostname}:${window.location.port}`;\n","import { Entry } from 'contensis-delivery-api/lib/models';\nimport { StateType } from '~/config';\nimport { AppState } from '~/redux/appstate';\nimport { getImmutableOrJS as getIn } from '~/redux/util';\nimport { queryParams } from '~/util/navigation';\n\nexport const selectRouteEntry = (state: AppState, returnType?: StateType) =>\n getIn(state, ['routing', 'entry'], {} as Entry, returnType);\n\nexport const selectMappedEntry = (state: AppState, returnType?: StateType) =>\n getIn(state, ['routing', 'mappedEntry'], null, returnType);\n\nexport const selectNodeDepends = (state: AppState) =>\n getIn(state, ['routing', 'nodeDepends'], []);\n\nexport const selectCurrentHostname = (state: AppState) =>\n getIn(state, ['routing', 'currentHostname']);\n\nexport const selectCurrentTreeID = (state: AppState) =>\n getIn(state, ['routing', 'currentHostname']);\n\nexport const selectRouteEntryEntryId = (state: AppState) =>\n getIn(state, ['routing', 'entry', 'sys', 'id'], null);\n\nexport const selectRouteEntryContentTypeId = (state: AppState) => {\n const entry = selectRouteEntry(state);\n return getIn(entry, ['sys', 'contentTypeId'], null);\n};\n\nexport const selectRouteEntryLanguage = (state: AppState) => {\n const entry = selectRouteEntry(state);\n return getIn(entry, ['sys', 'language'], null);\n};\n\nexport const selectRouteEntrySlug = (state: AppState) => {\n const entry = selectRouteEntry(state);\n return getIn(entry, ['sys', 'slug'], null);\n};\n\nexport const selectRouteEntryID = (state: AppState) =>\n getIn(state, ['routing', 'entryID']);\n\nexport const selectCurrentPath = (state: AppState) =>\n getIn(state, ['routing', 'currentPath']);\nexport const selectCurrentLocation = (state: AppState) =>\n getIn(state, ['routing', 'location']);\nexport const selectCurrentSearch = (state: AppState) =>\n getIn(state, ['routing', 'location', 'search']);\nexport const selectCurrentHash = (state: AppState) =>\n getIn(state, ['routing', 'location', 'hash']);\nexport const selectQueryStringAsObject = (state: AppState) =>\n queryParams(selectCurrentSearch(state));\nexport const selectCurrentProject = (state: AppState) =>\n getIn(state, ['routing', 'currentProject']);\nexport const selectIsNotFound = (state: AppState) =>\n getIn(state, ['routing', 'notFound']);\nexport const selectCurrentAncestors = (state: AppState) =>\n getIn(state, ['routing', 'currentNodeAncestors'], []);\nexport const selectCurrentSiblings = (state: AppState) =>\n getIn(state, ['routing', 'currentNodeSiblings'], []);\nexport const selectCurrentNode = (state: AppState, returnType?: StateType) =>\n getIn(state, ['routing', 'currentNode'], null, returnType);\nexport const selectCurrentChildren = state =>\n getIn(state, ['routing', 'currentNode', 'children'], []);\n\nexport const selectBreadcrumb = (state: AppState) => {\n return selectCurrentAncestors(state).push(selectCurrentNode(state));\n};\nexport const selectRouteErrorMessage = (state: AppState) => {\n const error = getIn(state, ['routing', 'error']);\n return getIn(error, ['data', 'message'], getIn(error, 'statusText'));\n};\nexport const selectRouteIsError = (state: AppState) =>\n getIn(state, ['routing', 'isError']);\nexport const selectRouteLoading = (state: AppState) =>\n getIn(state, ['routing', 'isLoading']);\nexport const selectRouteStatusCode = (state: AppState) =>\n getIn(state, ['routing', 'statusCode']);\nexport const selectStaticRoute = (state: AppState) =>\n getIn(state, ['routing', 'staticRoute']);\n"],"names":["action","type","payload","getJS","state","stateKey","get","toJS","getImmutableOrJS","fallbackValue","returnType","globalThis","STATE_TYPE","fromJS","immutable","fromJSOrdered","v","getIn","Array","isArray","result","jpath","join","undefined","queryParams","search","queryString","parse","window","location","selectRouteEntry","selectMappedEntry","selectNodeDepends","selectCurrentHostname","selectCurrentTreeID","selectRouteEntryEntryId","selectRouteEntryContentTypeId","entry","selectRouteEntryLanguage","selectRouteEntrySlug","selectRouteEntryID","selectCurrentPath","selectCurrentLocation","selectCurrentSearch","selectCurrentHash","selectQueryStringAsObject","selectCurrentProject","selectIsNotFound","selectCurrentAncestors","selectCurrentSiblings","selectCurrentNode","selectCurrentChildren","selectBreadcrumb","push","selectRouteErrorMessage","error","selectRouteIsError","selectRouteLoading","selectRouteStatusCode","selectStaticRoute"],"mappings":";;;MAEaA,MAAM,GAAG,CAACC,IAAD,EAAeC,OAAY,GAAG,EAA9B,MAAsC;AAC1DD,EAAAA,IAD0D;AAE1D,KAAGC;AAFuD,CAAtC;MAKTC,KAAK,GAAG,CACnBC,KADmB,EAEnBC,QAFmB,KAGhB;AACH,MACE,SAASD,KAAT,IACA,OAAOA,KAAK,CAACE,GAAb,KAAqB,UADrB,IAEA,UAAUF,KAFV,IAGA,OAAOA,KAAK,CAACG,IAAb,KAAsB,UAJxB,EAKE;AACA,WAAOH,KAAK,CAACE,GAAN,CAAUD,QAAV,CAAP;AACD;;AACD,SAAOD,KAAK,CAACC,QAAD,CAAZ;AACD;MAEYG,gBAAgB,GAAG,CAI9BJ,KAJ8B,EAK9BC,QAL8B,EAM9BI,aAN8B,EAO9BC,UAA8B,GAAGC,UAAU,CAACC,UAPd,KAQ3B;AAAA;;AACH;AACA;AACA,QAAMC,MAAM,GACVH,UAAU,KAAK,WAAf,GACI,0BAAAC,UAAU,CAACG,SAAX,gFAAsBC,aAAtB,gCAAuCJ,UAAU,CAACG,SAAlD,2DAAuC,uBAAsBD,MAA7D,CADJ,GAEIG,CAAC,IAAIA,CAHX;;AAKA,MACEZ,KAAK,IACL,SAASA,KADT,IAEA,OAAOA,KAAK,CAACE,GAAb,KAAqB,UAFrB,IAGA,WAAWF,KAHX,IAIA,OAAOA,KAAK,CAACa,KAAb,KAAuB,UAJvB,IAKA,UAAUb,KALV,IAMA,OAAOA,KAAK,CAACG,IAAb,KAAsB,UAPxB,EAQE;AACA,QAAIW,KA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iBAAiB,CAAC9C,KAAD,CAApD,CAAP;AACD,CAFM;MAGMkD,uBAAuB,GAAIlD,KAAD,IAAqB;AAC1D,QAAMmD,KAAK,GAAGtC,gBAAK,CAACb,KAAD,EAAQ,CAAC,SAAD,EAAY,OAAZ,CAAR,CAAnB;AACA,SAAOa,gBAAK,CAACsC,KAAD,EAAQ,CAAC,MAAD,EAAS,SAAT,CAAR,EAA6BtC,gBAAK,CAACsC,KAAD,EAAQ,YAAR,CAAlC,CAAZ;AACD;MACYC,kBAAkB,GAAIpD,KAAD,IAChCa,gBAAK,CAACb,KAAD,EAAQ,CAAC,SAAD,EAAY,SAAZ,CAAR;MACMqD,kBAAkB,GAAIrD,KAAD,IAChCa,gBAAK,CAACb,KAAD,EAAQ,CAAC,SAAD,EAAY,WAAZ,CAAR;MACMsD,qBAAqB,GAAItD,KAAD,IACnCa,gBAAK,CAACb,KAAD,EAAQ,CAAC,SAAD,EAAY,YAAZ,CAAR;AACA,MAAMuD,iBAAiB,GAAIvD,KAAD,IAC/Ba,gBAAK,CAACb,KAAD,EAAQ,CAAC,SAAD,EAAY,aAAZ,CAAR,CADA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/esm/version-59c8f9be.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { g as getImmutableOrJS } from './selectors-82e71d8e.js';
|
|
2
|
-
|
|
3
|
-
const selectCommitRef = state => getImmutableOrJS(state, ['routing', 'commitRef']);
|
|
4
|
-
const selectBuildNumber = state => getImmutableOrJS(state, ['routing', 'buildNo']);
|
|
5
|
-
const selectVersionStatus = state => getImmutableOrJS(state, ['routing', 'contensisVersionStatus']);
|
|
6
|
-
|
|
7
|
-
var version = /*#__PURE__*/Object.freeze({
|
|
8
|
-
__proto__: null,
|
|
9
|
-
selectCommitRef: selectCommitRef,
|
|
10
|
-
selectBuildNumber: selectBuildNumber,
|
|
11
|
-
selectVersionStatus: selectVersionStatus
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
export { selectCommitRef as a, selectBuildNumber as b, selectVersionStatus as s, version as v };
|
|
15
|
-
//# sourceMappingURL=version-59c8f9be.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"version-cb9cd09d.js","sources":["../src/redux/types/navigation.js","../src/redux/reducers/navigation.ts","../src/routing/redux/reducers.ts","../src/redux/types/version.js","../src/redux/reducers/version.ts","../src/redux/store/routerMiddleware.js","../src/redux/store/store.ts","../src/redux/selectors/navigation.js","../src/redux/store/injectors.js","../src/redux/actions/version.js"],"sourcesContent":["const ACTION_PREFIX = '@NAVIGATION/';\nexport const GET_NODE_TREE = `${ACTION_PREFIX}_GET_NODE_TREE`;\nexport const SET_NODE_TREE = `${ACTION_PREFIX}_SET_NODE_TREE`;\nexport const GET_NODE_TREE_ERROR = `${ACTION_PREFIX}_GET_NODE_TREE_ERROR`;\n","import { Draft, produce } from 'immer';\nimport { SET_NODE_TREE, GET_NODE_TREE_ERROR } from '~/redux/types/navigation';\n\nconst initialState = {\n root: null,\n treeDepends: [],\n isError: false,\n isReady: false,\n};\n\nexport default produce((state: Draft<any>, action) => {\n switch (action.type) {\n case SET_NODE_TREE: {\n state.root = action.nodes;\n state.isReady = true;\n return;\n }\n case GET_NODE_TREE_ERROR: {\n state.isError = true;\n return;\n }\n default:\n return;\n }\n}, initialState);\n","import { Draft, produce } from 'immer';\n\nimport {\n SET_ENTRY,\n SET_NAVIGATION_PATH,\n SET_ANCESTORS,\n SET_TARGET_PROJECT,\n SET_ROUTE,\n SET_SIBLINGS,\n SET_SURROGATE_KEYS,\n UPDATE_LOADING_STATE,\n} from './types';\n\nconst initialState = {\n currentHostname: null,\n contentTypeId: null,\n currentPath: '/',\n currentNode: {},\n currentNodeAncestors: [],\n currentProject: 'unknown',\n entryID: null,\n entry: null,\n currentTreeId: null,\n entryDepends: [],\n error: undefined,\n isError: false,\n isLoading: false,\n location: {},\n mappedEntry: null,\n nodeDepends: [],\n notFound: false,\n staticRoute: null,\n statusCode: 200,\n};\n\nexport default produce((state: Draft<any>, action) => {\n switch (action.type) {\n case SET_ANCESTORS: {\n state.currentNodeAncestors = action.ancestors;\n return;\n }\n case SET_ENTRY: {\n const {\n entry,\n error,\n mappedEntry,\n node = {},\n isError = false,\n isLoading = false,\n notFound = false,\n statusCode,\n } = action;\n\n let defaultStatus = 200;\n if (notFound === true && isError === false) defaultStatus = 404;\n else if (isError === true) defaultStatus = statusCode || 500;\n\n if (!entry) {\n state.entryID = null;\n state.entry = null;\n state.error = error;\n state.mappedEntry = null;\n state.isError = isError;\n state.isLoading = isLoading;\n state.notFound = notFound;\n state.statusCode = statusCode || defaultStatus;\n } else {\n state.entryID = action.id;\n state.entry = entry;\n state.error = error;\n state.isError = isError;\n state.isLoading = isLoading;\n state.notFound = notFound;\n state.statusCode = statusCode || defaultStatus;\n\n if (mappedEntry && Object.keys(mappedEntry).length > 0) {\n state.mappedEntry = mappedEntry;\n state.entry = { sys: entry.sys };\n }\n }\n\n if (!node) {\n state.nodeDepends = null;\n state.currentNode = null;\n } else {\n // On Set Node, we reset all dependants.\n state.currentNode = node;\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { entry, ...nodeWithoutEntry } = node; // We have the entry stored elsewhere, so lets not keep it twice.\n state.currentNode = nodeWithoutEntry;\n }\n return;\n }\n case UPDATE_LOADING_STATE: {\n state.isLoading = action.isLoading;\n return;\n }\n case SET_NAVIGATION_PATH: {\n let staticRoute = {} as any;\n if (action.staticRoute) {\n staticRoute = { ...action.staticRoute };\n }\n if (action.path) {\n // Don't run a path update on initial load as we allready should have it in redux\n const entryUri = state?.entry?.sys?.uri;\n if (entryUri !== action.path) {\n state.currentPath = action.path;\n state.location = action.location;\n state.staticRoute = {\n ...staticRoute,\n route: { ...staticRoute.route, component: null },\n };\n\n state.isLoading = typeof window !== 'undefined';\n } else {\n state.location = action.location;\n state.staticRoute = {\n ...staticRoute,\n route: { ...staticRoute.route, component: null },\n };\n }\n }\n return;\n }\n case SET_ROUTE: {\n state.nextPath = action.path;\n return;\n }\n case SET_SIBLINGS: {\n // Can be null in some cases like the homepage.\n let currentNodeSiblingParent = null;\n let siblingIDs = [];\n if (action.siblings && action.siblings.length > 0) {\n currentNodeSiblingParent = action.siblings[0].parentId;\n siblingIDs = action.siblings.map(node => node.id);\n }\n const currentNodeDepends = state.nodeDepends;\n const allNodeDepends = [\n ...new Set([...new Set(siblingIDs), currentNodeDepends]),\n ];\n state.nodeDepends = allNodeDepends;\n state.currentNodeSiblings = action.siblings;\n state.currentNodeSiblingsParent = currentNodeSiblingParent;\n return;\n }\n case SET_SURROGATE_KEYS: {\n state.surrogateKeys = action.keys;\n return;\n }\n case SET_TARGET_PROJECT: {\n state.currentProject = action.project;\n state.currentTreeId = ''; // getTreeID(action.project))\n state.allowedGroups = action.allowedGroups;\n state.currentHostname = action.hostname;\n return;\n }\n default:\n return state;\n }\n}, initialState);\n","const VERSION_PREFIX = '@VERSION/';\nexport const SET_VERSION = `${VERSION_PREFIX}SET_VERSION`;\nexport const SET_VERSION_STATUS = `${VERSION_PREFIX}SET_VERSION_STATUS`;\n","import { Draft, produce } from 'immer';\nimport { SET_VERSION, SET_VERSION_STATUS } from '~/redux/types/version';\n\nconst initialState = {\n commitRef: null,\n buildNo: null,\n contensisVersionStatus: 'published',\n};\n\nexport default produce((state: Draft<any>, action) => {\n switch (action.type) {\n case SET_VERSION_STATUS: {\n state.contensisVersionStatus = action.status;\n return;\n }\n case SET_VERSION: {\n state.commitRef = action.commitRef;\n state.buildNo = action.buildNo;\n return;\n }\n default:\n return;\n }\n}, initialState);\n","/**\n * This middleware captures 'CALL_HISTORY_METHOD' actions to redirect to the\n * provided history object. This will prevent these actions from reaching your\n * reducer or any middleware that comes after this one.\n */\n/* eslint-disable no-unused-vars */\nconst routerMiddleware = history => store => next => action => {\n if (action.type !== 'CALL_HISTORY_METHOD') {\n return next(action);\n }\n\n const {\n payload: { method, args },\n } = action;\n history[method](...args);\n};\n\nexport default routerMiddleware;\n","import {\n applyMiddleware,\n combineReducers,\n compose,\n createStore,\n Action,\n Store,\n StoreEnhancer,\n} from 'redux';\nimport thunkMiddleware from 'redux-thunk';\nimport createSagaMiddleware, { END } from 'redux-saga';\nimport { createInjectorsEnhancer } from 'redux-injectors';\n\n// Core reducers\nimport NavigationReducer from '../reducers/navigation';\nimport RoutingReducer from '~/routing/redux/reducers';\nimport UserReducer from '~/user/redux/reducers';\nimport VersionReducer from '../reducers/version';\nimport routerMiddleware from './routerMiddleware';\nimport { AppState } from '../appstate';\nimport { History, MemoryHistory } from 'history';\nimport { StateType } from '~/config';\n\nexport let reduxStore;\n\n/* eslint-disable no-underscore-dangle */\ndeclare let window: Window &\n typeof globalThis & {\n __REDUX_DEVTOOLS_EXTENSION__: any;\n };\n\nexport default async (\n featureReducers: any,\n initialState: AppState,\n history: History | MemoryHistory,\n stateType: StateType\n) => {\n let reduxDevToolsMiddleware = f => f;\n\n if (typeof window != 'undefined') {\n reduxDevToolsMiddleware = window.__REDUX_DEVTOOLS_EXTENSION__\n ? window.__REDUX_DEVTOOLS_EXTENSION__()\n : f => f;\n }\n\n const sagaMiddleware = createSagaMiddleware();\n\n const reducers = {\n navigation: NavigationReducer,\n routing: RoutingReducer,\n user: UserReducer,\n version: VersionReducer,\n ...featureReducers,\n };\n\n // Reassign the combiner and fromJS functions when\n // stateType is 'immutable' with dynamic imports\n let combiner = combineReducers;\n let fromJS: any = (obj: any) => obj;\n globalThis.STATE_TYPE = stateType;\n\n if (stateType === 'immutable') {\n globalThis.immutable = await import(\n /* webpackChunkName: \"immutable\" */ 'immutable'\n );\n\n fromJS = (\n await import(/* webpackChunkName: \"from-js\" */ '~/util/fromJSLeaveImmer')\n ).default;\n\n combiner = (\n await import(/* webpackChunkName: \"redux-immutable\" */ 'redux-immutable')\n ).combineReducers;\n }\n\n const createReducer = (injectedReducers = {}) => {\n const rootReducer = combiner<AppState>({\n ...injectedReducers,\n // other non-injected reducers go here\n ...reducers,\n });\n\n return rootReducer;\n };\n\n const store = (initialState: AppState) => {\n const runSaga = sagaMiddleware.run;\n\n const middleware: StoreEnhancer<\n {\n dispatch: unknown;\n },\n unknown\n > = compose(\n applyMiddleware(\n thunkMiddleware,\n sagaMiddleware,\n routerMiddleware(history)\n ),\n createInjectorsEnhancer({\n createReducer,\n runSaga,\n }),\n reduxDevToolsMiddleware\n );\n\n const store: Store<AppState, Action<any>> & {\n runSaga?: typeof runSaga;\n close?: () => void;\n } = createStore<AppState, Action<any>, unknown, unknown>(\n createReducer(),\n initialState,\n middleware\n );\n\n store.runSaga = runSaga;\n store.close = () => store.dispatch(END);\n\n return store;\n };\n\n reduxStore = store(fromJS(initialState));\n return reduxStore;\n};\n","import { getImmutableOrJS as getIn } from '~/redux/util';\n\nexport const hasNavigationTree = state =>\n getIn(state, ['navigation', 'isReady']);\n\nexport const selectNavigationRoot = state =>\n getIn(state, ['navigation', 'root']);\n\nexport const selectNavigationDepends = state =>\n getIn(state, ['navigation', 'treeDepends']);\n","import { all } from 'redux-saga/effects';\nimport { reduxStore as DefaultStore } from './store';\n\nexport const convertSagaArray = sagas => {\n if (Array.isArray(sagas))\n return function* rootSaga() {\n yield all(sagas);\n };\n return sagas;\n};\n\nexport const injectReducer = ({ key, reducer }, store = DefaultStore) => {\n if (\n Reflect.has(store.injectedReducers, key) &&\n store.injectedReducers[key] === reducer\n )\n return;\n store.injectedReducers[key] = reducer;\n\n store.replaceReducer(store.createReducer(store.injectedReducers));\n};\n\nexport const injectSaga = ({ key, saga }, store = DefaultStore) => {\n const rootSaga = convertSagaArray(saga);\n let hasSaga = Reflect.has(store.injectedSagas, key);\n\n if (process.env.NODE_ENV !== 'production') {\n const oldDescriptor = store.injectedSagas[key]; // enable hot reloading of daemon and once-till-unmount sagas\n\n if (hasSaga && oldDescriptor.saga !== rootSaga) {\n oldDescriptor.task.cancel();\n hasSaga = false;\n }\n }\n console.info('injectSaga, key: ', key, 'hasSaga: ', hasSaga);\n\n if (!hasSaga) {\n store.injectedSagas[key] = {\n key,\n saga: rootSaga,\n task: store.runSaga(rootSaga),\n };\n }\n};\n\nexport const injectRedux = ({ key, reducer, saga }, store = DefaultStore) => {\n console.info('injectRedux, key: ', key);\n if (reducer) injectReducer({ key, reducer }, store);\n if (saga) injectSaga({ key, saga }, store);\n};\n\nexport const useInjectRedux = injectRedux;\n","import { action } from '../util';\nimport { SET_VERSION, SET_VERSION_STATUS } from '../types/version';\n\nexport const setVersion = (commitRef, buildNo) =>\n action(SET_VERSION, { commitRef, buildNo });\n\nexport const setVersionStatus = status =>\n action(SET_VERSION_STATUS, { status });\n"],"names":["ACTION_PREFIX","GET_NODE_TREE","SET_NODE_TREE","GET_NODE_TREE_ERROR","initialState","root","treeDepends","isError","isReady","produce","state","action","type","nodes","currentHostname","contentTypeId","currentPath","currentNode","currentNodeAncestors","currentProject","entryID","entry","currentTreeId","entryDepends","error","undefined","isLoading","location","mappedEntry","nodeDepends","notFound","staticRoute","statusCode","SET_ANCESTORS","ancestors","SET_ENTRY","node","defaultStatus","id","Object","keys","length","sys","nodeWithoutEntry","UPDATE_LOADING_STATE","SET_NAVIGATION_PATH","path","entryUri","uri","route","component","window","SET_ROUTE","nextPath","SET_SIBLINGS","currentNodeSiblingParent","siblingIDs","siblings","parentId","map","currentNodeDepends","allNodeDepends","Set","currentNodeSiblings","currentNodeSiblingsParent","SET_SURROGATE_KEYS","surrogateKeys","SET_TARGET_PROJECT","project","allowedGroups","hostname","VERSION_PREFIX","SET_VERSION","SET_VERSION_STATUS","commitRef","buildNo","contensisVersionStatus","status","routerMiddleware","history","store","next","payload","method","args","reduxStore","featureReducers","stateType","reduxDevToolsMiddleware","f","__REDUX_DEVTOOLS_EXTENSION__","sagaMiddleware","createSagaMiddleware","reducers","navigation","NavigationReducer","routing","RoutingReducer","user","UserReducer","version","VersionReducer","combiner","combineReducers","fromJS","obj","globalThis","STATE_TYPE","immutable","default","createReducer","injectedReducers","rootReducer","runSaga","run","middleware","compose","applyMiddleware","thunkMiddleware","createInjectorsEnhancer","createStore","close","dispatch","END","hasNavigationTree","getIn","selectNavigationRoot","selectNavigationDepends","convertSagaArray","sagas","Array","isArray","rootSaga","all","injectReducer","key","reducer","DefaultStore","Reflect","has","replaceReducer","injectSaga","saga","hasSaga","injectedSagas","process","env","NODE_ENV","oldDescriptor","task","cancel","console","info","injectRedux","useInjectRedux","setVersion","setVersionStatus"],"mappings":";;;;;;;;;;AAAA,MAAMA,aAAa,GAAG,cAAtB;MACaC,aAAa,GAAI,GAAED,aAAc;MACjCE,aAAa,GAAI,GAAEF,aAAc;MACjCG,mBAAmB,GAAI,GAAEH,aAAc;;;;;;;;;ACApD,MAAMI,YAAY,GAAG;AACnBC,EAAAA,IAAI,EAAE,IADa;AAEnBC,EAAAA,WAAW,EAAE,EAFM;AAGnBC,EAAAA,OAAO,EAAE,KAHU;AAInBC,EAAAA,OAAO,EAAE;AAJU,CAArB;AAOA,wBAAeC,OAAO,CAAC,CAACC,KAAD,EAAoBC,MAApB,KAA+B;AACpD,UAAQA,MAAM,CAACC,IAAf;AACE,SAAKV,aAAL;AAAoB;AAClBQ,QAAAA,KAAK,CAACL,IAAN,GAAaM,MAAM,CAACE,KAApB;AACAH,QAAAA,KAAK,CAACF,OAAN,GAAgB,IAAhB;AACA;AACD;;AACD,SAAKL,mBAAL;AAA0B;AACxBO,QAAAA,KAAK,CAACH,OAAN,GAAgB,IAAhB;AACA;AACD;;AACD;AACE;AAXJ;AAaD,CAdqB,EAcnBH,YAdmB,CAAtB;;ACGA,MAAMA,cAAY,GAAG;AACnBU,EAAAA,eAAe,EAAE,IADE;AAEnBC,EAAAA,aAAa,EAAE,IAFI;AAGnBC,EAAAA,WAAW,EAAE,GAHM;AAInBC,EAAAA,WAAW,EAAE,EAJM;AAKnBC,EAAAA,oBAAoB,EAAE,EALH;AAMnBC,EAAAA,cAAc,EAAE,SANG;AAOnBC,EAAAA,OAAO,EAAE,IAPU;AAQnBC,EAAAA,KAAK,EAAE,IARY;AASnBC,EAA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