@zengenti/contensis-react-base 3.0.2-beta.8 → 3.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (140) hide show
  1. package/README.md +38 -2
  2. package/cjs/{App-81a45001.js → App-7ff737fa.js} +70 -34
  3. package/cjs/App-7ff737fa.js.map +1 -0
  4. package/cjs/{login-51b66359.js → ChangePassword.container-a617190b.js} +246 -84
  5. package/cjs/ChangePassword.container-a617190b.js.map +1 -0
  6. package/cjs/{ContensisDeliveryApi-de88df2a.js → ContensisDeliveryApi-9e32960d.js} +156 -122
  7. package/cjs/ContensisDeliveryApi-9e32960d.js.map +1 -0
  8. package/cjs/CookieConstants-000427db.js +10 -0
  9. package/cjs/CookieConstants-000427db.js.map +1 -0
  10. package/cjs/{RouteLoader-47d70a26.js → RouteLoader-049e81e5.js} +8 -5
  11. package/cjs/RouteLoader-049e81e5.js.map +1 -0
  12. package/cjs/{ToJs-61c03582.js → ToJs-149fc5e1.js} +49 -2
  13. package/cjs/ToJs-149fc5e1.js.map +1 -0
  14. package/cjs/_commonjsHelpers-b3309d7b.js +11 -0
  15. package/cjs/_commonjsHelpers-b3309d7b.js.map +1 -0
  16. package/cjs/client.js +14 -12
  17. package/cjs/client.js.map +1 -1
  18. package/cjs/contensis-react-base.js +46 -360
  19. package/cjs/contensis-react-base.js.map +1 -1
  20. package/cjs/forms.js +3498 -127
  21. package/cjs/forms.js.map +1 -1
  22. package/cjs/redux.js +3 -4
  23. package/cjs/redux.js.map +1 -1
  24. package/cjs/routing.js +4 -3
  25. package/cjs/routing.js.map +1 -1
  26. package/cjs/{sagas-6d12e7ca.js → sagas-e04b94c1.js} +44 -20
  27. package/cjs/sagas-e04b94c1.js.map +1 -0
  28. package/cjs/search.js +13 -13
  29. package/cjs/search.js.map +1 -1
  30. package/cjs/{selectors-c76c2676.js → selectors-46b689d0.js} +11 -11
  31. package/cjs/selectors-46b689d0.js.map +1 -0
  32. package/cjs/user.js +33 -159
  33. package/cjs/user.js.map +1 -1
  34. package/cjs/util.js +6 -4
  35. package/cjs/util.js.map +1 -1
  36. package/cjs/{version-38afaf2a.js → version-79a027cb.js} +12 -23
  37. package/cjs/version-79a027cb.js.map +1 -0
  38. package/cjs/{version-886f49d8.js → version-afd4f77e.js} +3 -3
  39. package/cjs/{version-886f49d8.js.map → version-afd4f77e.js.map} +1 -1
  40. package/esm/{App-5f914483.js → App-ff944c78.js} +64 -29
  41. package/esm/App-ff944c78.js.map +1 -0
  42. package/esm/{login-4d07c2de.js → ChangePassword.container-ae0f9ce4.js} +229 -78
  43. package/esm/ChangePassword.container-ae0f9ce4.js.map +1 -0
  44. package/esm/{ContensisDeliveryApi-ad06857d.js → ContensisDeliveryApi-c66b0cc3.js} +155 -123
  45. package/esm/ContensisDeliveryApi-c66b0cc3.js.map +1 -0
  46. package/esm/CookieConstants-3d3b6531.js +6 -0
  47. package/esm/CookieConstants-3d3b6531.js.map +1 -0
  48. package/esm/{RouteLoader-f5d5f733.js → RouteLoader-02eef6d9.js} +8 -5
  49. package/esm/RouteLoader-02eef6d9.js.map +1 -0
  50. package/esm/{ToJs-0066e629.js → ToJs-ae860aad.js} +49 -3
  51. package/esm/ToJs-ae860aad.js.map +1 -0
  52. package/esm/_commonjsHelpers-1789f0cf.js +8 -0
  53. package/esm/_commonjsHelpers-1789f0cf.js.map +1 -0
  54. package/esm/client.js +15 -13
  55. package/esm/client.js.map +1 -1
  56. package/esm/contensis-react-base.js +45 -360
  57. package/esm/contensis-react-base.js.map +1 -1
  58. package/esm/forms.js +3500 -129
  59. package/esm/forms.js.map +1 -1
  60. package/esm/redux.js +6 -7
  61. package/esm/redux.js.map +1 -1
  62. package/esm/routing.js +4 -3
  63. package/esm/routing.js.map +1 -1
  64. package/esm/{sagas-53d2aefb.js → sagas-933a8fc8.js} +44 -20
  65. package/esm/sagas-933a8fc8.js.map +1 -0
  66. package/esm/search.js +14 -14
  67. package/esm/search.js.map +1 -1
  68. package/esm/{selectors-3f0d804d.js → selectors-01074974.js} +11 -12
  69. package/esm/selectors-01074974.js.map +1 -0
  70. package/esm/user.js +21 -151
  71. package/esm/user.js.map +1 -1
  72. package/esm/util.js +4 -4
  73. package/esm/{version-f4629693.js → version-0fbd1b82.js} +3 -3
  74. package/esm/{version-f4629693.js.map → version-0fbd1b82.js.map} +1 -1
  75. package/esm/{version-dd31c7f0.js → version-346a9787.js} +13 -23
  76. package/esm/version-346a9787.js.map +1 -0
  77. package/models/client/client.d.ts +1 -1
  78. package/models/config.d.ts +4 -4
  79. package/models/redux/appstate.d.ts +2 -1
  80. package/models/routing/redux/actions.d.ts +10 -6
  81. package/models/routing/redux/selectors.d.ts +5 -4
  82. package/models/routing/redux/types.d.ts +0 -1
  83. package/models/routing/routes.d.ts +20 -17
  84. package/models/routing/util/queries.d.ts +3 -2
  85. package/models/search/models/Queries.d.ts +9 -10
  86. package/models/search/models/Search.d.ts +26 -24
  87. package/models/search/models/SearchActions.d.ts +36 -36
  88. package/models/search/models/SearchState.d.ts +11 -11
  89. package/models/search/models/SearchUtil.d.ts +1 -1
  90. package/models/search/models/WithSearch.d.ts +1 -1
  91. package/models/search/redux/actions.d.ts +7 -7
  92. package/models/search/redux/selectors.d.ts +27 -27
  93. package/models/search/redux/types.d.ts +21 -21
  94. package/models/search/redux/util.d.ts +2 -2
  95. package/models/search/search/ContensisDeliveryApi.d.ts +1 -1
  96. package/models/search/search/expressions.d.ts +4 -4
  97. package/models/search/search/util.d.ts +2 -2
  98. package/models/search/transformations/state-to-queryparams.mapper.d.ts +1 -1
  99. package/models/server/features/linkdepth-api/LinkDepthSearchService.d.ts +1 -1
  100. package/models/server/features/linkdepth-api/search.d.ts +3 -3
  101. package/models/server/internalServer.d.ts +7 -5
  102. package/models/server/util/bundles.d.ts +2 -2
  103. package/models/server/util/handleExceptions.d.ts +1 -1
  104. package/models/testImmer/redux/reducer.d.ts +1 -1
  105. package/models/user/components/Login.d.ts +2 -3
  106. package/models/user/containers/ChangePassword.container.d.ts +2 -2
  107. package/models/user/containers/ForgotPassword.container.d.ts +2 -2
  108. package/models/user/containers/Login.container.d.ts +2 -2
  109. package/models/user/containers/Registration.container.d.ts +2 -2
  110. package/models/user/hocs/withLogin.d.ts +5 -11
  111. package/models/user/hocs/withRegistration.d.ts +2 -8
  112. package/models/user/redux/actions.d.ts +2 -2
  113. package/models/user/redux/sagas/login.d.ts +9 -8
  114. package/models/user/redux/selectors.d.ts +4 -4
  115. package/models/user/util/CookieConstants.d.ts +8 -0
  116. package/models/user/util/CookieHelper.class.d.ts +15 -3
  117. package/models/user/util/LoginHelper.class.d.ts +27 -23
  118. package/models/util/CachedDeliveryApi.d.ts +25 -0
  119. package/models/util/ContensisDeliveryApi.d.ts +20 -44
  120. package/models/util/LruCache.d.ts +12 -0
  121. package/models/util/ToJs.d.ts +1 -1
  122. package/models/util/index.d.ts +1 -1
  123. package/models/util/json-mapper.d.ts +1 -1
  124. package/package.json +10 -11
  125. package/cjs/App-81a45001.js.map +0 -1
  126. package/cjs/ContensisDeliveryApi-de88df2a.js.map +0 -1
  127. package/cjs/RouteLoader-47d70a26.js.map +0 -1
  128. package/cjs/ToJs-61c03582.js.map +0 -1
  129. package/cjs/login-51b66359.js.map +0 -1
  130. package/cjs/sagas-6d12e7ca.js.map +0 -1
  131. package/cjs/selectors-c76c2676.js.map +0 -1
  132. package/cjs/version-38afaf2a.js.map +0 -1
  133. package/esm/App-5f914483.js.map +0 -1
  134. package/esm/ContensisDeliveryApi-ad06857d.js.map +0 -1
  135. package/esm/RouteLoader-f5d5f733.js.map +0 -1
  136. package/esm/ToJs-0066e629.js.map +0 -1
  137. package/esm/login-4d07c2de.js.map +0 -1
  138. package/esm/sagas-53d2aefb.js.map +0 -1
  139. package/esm/selectors-3f0d804d.js.map +0 -1
  140. package/esm/version-dd31c7f0.js.map +0 -1
package/README.md CHANGED
@@ -25,7 +25,7 @@ The core of your Contensis React application is in package `@zengenti/contensis-
25
25
  The package handles things such as:
26
26
 
27
27
  - Peer dependencies such as React, react-router-dom, immutable, react-redux... etc.
28
- - Server side express application serving an isomorphic web app
28
+ - Server side express application serving a Universal JavaScript web app
29
29
  - Client side sub-package to handle client-side rendering and hydration
30
30
  - Creation of redux store and global state management for core features
31
31
  - Routing handled automatically via RouteLoader component which will load entries based on a given url
@@ -105,7 +105,7 @@ Sometimes VSCode may import the reference automatically from an unsupported plac
105
105
 
106
106
  As of v2.5.0 TypeScript declarations are available to use, and will also benefit applications written in JavaScript
107
107
 
108
- All models are exported with the default package `@zengenti/contensis-react-base`
108
+ All models are exported with the default package `@zengenti/contensis-react-base`
109
109
 
110
110
  When importing Types to use in your own TypeScript project, try to always use the root import path e.g. `import { ModelName } from '@zengenti/contensis-react-base';`
111
111
 
@@ -126,6 +126,42 @@ https://www.conventionalcommits.org/en/v1.0.0/#summary
126
126
 
127
127
  # Changelog
128
128
 
129
+ #### 3.1.0 (2024-01-18)
130
+
131
+ ##### New Features
132
+
133
+ * Handle 401/403 response from Delivery API (27628a7)
134
+ * add referer header to delivery api requests in ssr (27628a7)
135
+ * able to specify an array of specific exception types to add listeners and exception handlers for and fixes server not exiting cleanly (27628a7)
136
+ * Canonical Path support (033e212c)
137
+ * Upgraded to Styled Components v6 beta (breaking change for Styled Components) (19c114ce)
138
+ * /search package support for setting dynamic pageSize and fix for /forms subpackage after recent refactoring of imports (1b04662d)
139
+
140
+ ##### Bug Fixes
141
+
142
+ * ensure `surrogate-key` response header does not exceed 2000 keys and dedupe surrogate keys as they are collected and aggregated (e50c3583)
143
+ * update forms package - accessible country searchable dropdown (ab1bd37d)
144
+ * manually update version to align with another branch so that the ci versioning doesn't fail. (ef0cf3ba)
145
+ * prefer x-orig-host over host header for currentHostname (6f34c5e2)
146
+ * ensureNodeTreeSaga now respects language setting (1e67e8fb)
147
+ * forms package import fix (e847ceca)
148
+ * `object is not extensible` error when using `selectBreadcrumb` with immer state (59ca555b)
149
+ * Revert update of Styled Components due to babel compiling issues. (23ef4ab4)
150
+ * Increase number of user groups returned when requesting user details. (7d9e59a0)
151
+ * allow use of exported delivery api methods which inherit cache invalidation features (2eeaed7b)
152
+ * User reducer - Create object copy instead of referencing directly (1dad589b)
153
+ * preview toolbar cannot edit the correct entry after client-side navigation (4df782cc)
154
+ * exported `server` object is not working as expected (b3ce8a81)
155
+
156
+ ##### Refactors
157
+
158
+ * delivery api utilities now in TypeScript (0b1e8911)
159
+
160
+ ##### Build System / Dependencies
161
+
162
+ * fix error in release action (c03516c9)
163
+ * fix issue with path transformations not applied to alias imports in d.ts files (27628a7)
164
+
129
165
  #### 3.0.1 (2023-01-27)
130
166
 
131
167
  ##### Bug Fixes
@@ -3,20 +3,22 @@
3
3
  var history$1 = require('history');
4
4
  var effects = require('@redux-saga/core/effects');
5
5
  var log = require('loglevel');
6
- var ContensisDeliveryApi = require('./ContensisDeliveryApi-de88df2a.js');
7
- var version = require('./version-38afaf2a.js');
8
- var version$1 = require('./version-886f49d8.js');
9
- var selectors = require('./selectors-c76c2676.js');
10
- var login = require('./login-51b66359.js');
11
- var contensisDeliveryApi = require('contensis-delivery-api');
12
- var awaitToJs = require('await-to-js');
13
- var reducers = require('./reducers-9afb5f89.js');
14
- var ToJs = require('./ToJs-61c03582.js');
6
+ var ContensisDeliveryApi = require('./ContensisDeliveryApi-9e32960d.js');
7
+ var version = require('./version-79a027cb.js');
8
+ var version$1 = require('./version-afd4f77e.js');
9
+ var selectors = require('./selectors-46b689d0.js');
10
+ var to = require('await-to-js');
11
+ var ChangePassword_container = require('./ChangePassword.container-a617190b.js');
15
12
  var React = require('react');
16
- require('react-hot-loader');
13
+ require('react-cookie');
14
+ require('react-redux');
17
15
  require('jsonpath-mapper');
16
+ var reducers = require('./reducers-9afb5f89.js');
17
+ var contensisDeliveryApi = require('contensis-delivery-api');
18
+ var ToJs = require('./ToJs-149fc5e1.js');
19
+ require('react-hot-loader');
18
20
  require('query-string');
19
- var RouteLoader = require('./RouteLoader-47d70a26.js');
21
+ var RouteLoader = require('./RouteLoader-049e81e5.js');
20
22
 
21
23
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
22
24
 
@@ -39,6 +41,7 @@ function _interopNamespace(e) {
39
41
  }
40
42
 
41
43
  var log__namespace = /*#__PURE__*/_interopNamespace(log);
44
+ var to__default = /*#__PURE__*/_interopDefaultLegacy(to);
42
45
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
43
46
 
44
47
  // Create a history depending on the environment
@@ -54,7 +57,8 @@ function* ensureNodeTreeSaga(action) {
54
57
  const deliveryApiVersionStatus = yield effects.select(version.selectVersionStatus);
55
58
  const project = yield effects.select(selectors.selectCurrentProject);
56
59
  const nodes = yield ContensisDeliveryApi.deliveryApi.getClient(deliveryApiVersionStatus, project).nodes.getRoot({
57
- depth: action.treeDepth || 0
60
+ depth: action.treeDepth || 0,
61
+ language: action.language
58
62
  });
59
63
  if (nodes) {
60
64
  yield effects.put({
@@ -134,8 +138,10 @@ function* getRouteSaga(action) {
134
138
  routes: {
135
139
  ContentTypeMappings = {}
136
140
  } = {},
137
- staticRoute
141
+ staticRoute,
142
+ cookies
138
143
  } = action;
144
+ const api = ContensisDeliveryApi.cachedSearchWithCookies(cookies.raw);
139
145
 
140
146
  // Inject redux { key, reducer, saga } provided by staticRoute
141
147
  if (staticRoute && staticRoute.route.injectRedux) yield effects.call(reduxInjectorSaga, staticRoute.route.injectRedux);
@@ -189,7 +195,7 @@ function* getRouteSaga(action) {
189
195
  type: selectors.UPDATE_LOADING_STATE,
190
196
  isLoading: false
191
197
  });
192
- } else yield effects.call(setRouteEntry, routeEntry, yield effects.select(selectors.selectCurrentNode), yield effects.select(selectors.selectCurrentAncestors), yield effects.select(selectors.selectCurrentSiblings));
198
+ } else yield effects.call(setRouteEntry, currentPath, routeEntry, yield effects.select(selectors.selectCurrentNode), yield effects.select(selectors.selectCurrentAncestors), yield effects.select(selectors.selectCurrentSiblings));
193
199
  } else {
194
200
  // Handle preview routes
195
201
  if (isPreview) {
@@ -205,7 +211,7 @@ function* getRouteSaga(action) {
205
211
  // -- apparently it is not correct to request latest content
206
212
  // with Node API
207
213
 
208
- let previewEntry = yield ContensisDeliveryApi.deliveryApi.getClient(deliveryApiStatus, project).entries.get({
214
+ let previewEntry = yield api.getClient(deliveryApiStatus, project).entries.get({
209
215
  id: entryGuid,
210
216
  language,
211
217
  linkDepth: entryLinkDepth
@@ -222,28 +228,53 @@ function* getRouteSaga(action) {
222
228
  } else {
223
229
  var _pathNode, _pathNode$entry, _pathNode$entry$sys;
224
230
  // Handle all other routes
225
- pathNode = yield ContensisDeliveryApi.cachedSearch.getNode({
231
+ let nodeError = undefined;
232
+ [nodeError, pathNode] = yield to__default["default"](api.getNode({
226
233
  depth: 0,
227
234
  path: currentPath,
228
235
  entryFields: setContentTypeLimits ? ['sys.contentTypeId', 'sys.id'] : staticRouteFields || '*',
229
236
  entryLinkDepth: setContentTypeLimits ? 0 : typeof staticRouteLinkDepth !== 'undefined' ? staticRouteLinkDepth : entryLinkDepth,
230
237
  language: defaultLang,
231
238
  versionStatus: deliveryApiStatus
232
- }, project);
233
- ({
239
+ }, project));
240
+ if (nodeError) {
241
+ if ([401, 403].includes(nodeError.status)) {
242
+ // Capture specific auth errors with the delivery api
243
+ // and fire the user down the handleRequiresLoginSaga
244
+ // If auth was successful via a refreshToken we need to reload the page
245
+ // to run this getRouteSaga again with the security token cookie
246
+ const userLoggedIn = yield effects.call(ChangePassword_container.handleRequiresLoginSaga, {
247
+ ...action,
248
+ requireLogin: true
249
+ });
250
+ if (userLoggedIn && nodeError.status === 401) {
251
+ // Reload the route so we can re-run the routing request now the
252
+ // authentication cookies are written
253
+ return yield effects.call(setRouteSaga, {
254
+ path: currentPath
255
+ });
256
+ } else if (userLoggedIn && nodeError.status === 403) {
257
+ return yield effects.call(setRouteSaga, {
258
+ path: ChangePassword_container.LoginHelper.GetAccessDeniedRoute(currentPath)
259
+ });
260
+ } else {
261
+ return yield effects.call(do500, nodeError);
262
+ }
263
+ } else throw nodeError;
264
+ } else ({
234
265
  entry
235
266
  } = pathNode || {});
236
267
  if (setContentTypeLimits && (_pathNode = pathNode) !== null && _pathNode !== void 0 && (_pathNode$entry = _pathNode.entry) !== null && _pathNode$entry !== void 0 && (_pathNode$entry$sys = _pathNode$entry.sys) !== null && _pathNode$entry$sys !== void 0 && _pathNode$entry$sys.id) {
237
268
  var _payload$items;
238
269
  // Get fields[] and linkDepth from ContentTypeMapping to get the entry data
239
270
  // and current node's ordinates at a specified depth with specified fields
240
- contentTypeMapping = login.findContentTypeMapping(ContentTypeMappings, pathNode.entry.sys.contentTypeId) || {};
271
+ contentTypeMapping = ChangePassword_container.findContentTypeMapping(ContentTypeMappings, pathNode.entry.sys.contentTypeId) || {};
241
272
  const {
242
273
  fields,
243
274
  linkDepth
244
275
  } = contentTypeMapping;
245
276
  const query = routeEntryByFieldsQuery(pathNode.entry.sys.id, pathNode.entry.sys.language, fields, deliveryApiStatus);
246
- const payload = yield ContensisDeliveryApi.cachedSearch.search(query, typeof linkDepth !== 'undefined' ? linkDepth : entryLinkDepth || 0, project);
277
+ const payload = yield api.search(query, typeof linkDepth !== 'undefined' ? linkDepth : entryLinkDepth || 0, project);
247
278
  if ((payload === null || payload === void 0 ? void 0 : (_payload$items = payload.items) === null || _payload$items === void 0 ? void 0 : _payload$items.length) > 0) {
248
279
  pathNode.entry = entry = payload.items[0];
249
280
  }
@@ -253,6 +284,7 @@ function* getRouteSaga(action) {
253
284
  // make calls to fetch node ancestors, children,
254
285
  // siblings or entire node tree
255
286
  [ancestors, children, siblings] = yield effects.call(resolveCurrentNodeOrdinates, {
287
+ api,
256
288
  appsays,
257
289
  contentTypeMapping,
258
290
  language: defaultLang,
@@ -263,7 +295,7 @@ function* getRouteSaga(action) {
263
295
  });
264
296
  if (children) pathNode.children = children;
265
297
  }
266
- const resolvedContentTypeMapping = login.findContentTypeMapping(ContentTypeMappings, (_pathNode2 = pathNode) === null || _pathNode2 === void 0 ? void 0 : (_pathNode2$entry = _pathNode2.entry) === null || _pathNode2$entry === void 0 ? void 0 : (_pathNode2$entry$sys = _pathNode2$entry.sys) === null || _pathNode2$entry$sys === void 0 ? void 0 : _pathNode2$entry$sys.contentTypeId) || {};
298
+ const resolvedContentTypeMapping = ChangePassword_container.findContentTypeMapping(ContentTypeMappings, (_pathNode2 = pathNode) === null || _pathNode2 === void 0 ? void 0 : (_pathNode2$entry = _pathNode2.entry) === null || _pathNode2$entry === void 0 ? void 0 : (_pathNode2$entry$sys = _pathNode2$entry.sys) === null || _pathNode2$entry$sys === void 0 ? void 0 : _pathNode2$entry$sys.contentTypeId) || {};
267
299
 
268
300
  // Inject redux { key, reducer, saga } provided by ContentTypeMapping
269
301
  if (resolvedContentTypeMapping.injectRedux) yield effects.call(reduxInjectorSaga, resolvedContentTypeMapping.injectRedux);
@@ -279,7 +311,7 @@ function* getRouteSaga(action) {
279
311
  }
280
312
  if (requireLogin !== false) {
281
313
  // Do not call the login feature saga if requireLogin is false
282
- yield effects.call(login.handleRequiresLoginSaga, {
314
+ yield effects.call(ChangePassword_container.handleRequiresLoginSaga, {
283
315
  ...action,
284
316
  entry,
285
317
  requireLogin
@@ -292,9 +324,9 @@ function* getRouteSaga(action) {
292
324
  if ((_pathNode3 = pathNode) !== null && _pathNode3 !== void 0 && (_pathNode3$entry = _pathNode3.entry) !== null && _pathNode3$entry !== void 0 && (_pathNode3$entry$sys = _pathNode3$entry.sys) !== null && _pathNode3$entry$sys !== void 0 && _pathNode3$entry$sys.id) {
293
325
  var _staticRoute$route3, _staticRoute$route3$f, _appsays;
294
326
  entry = pathNode.entry;
295
- yield effects.call(setRouteEntry, entry, pathNode, ancestors, siblings, (staticRoute === null || staticRoute === void 0 ? void 0 : (_staticRoute$route3 = staticRoute.route) === null || _staticRoute$route3 === void 0 ? void 0 : (_staticRoute$route3$f = _staticRoute$route3.fetchNode) === null || _staticRoute$route3$f === void 0 ? void 0 : _staticRoute$route3$f.entryMapper) || resolvedContentTypeMapping.entryMapper, false, (_appsays = appsays) === null || _appsays === void 0 ? void 0 : _appsays.refetchNode);
327
+ yield effects.call(setRouteEntry, currentPath, entry, pathNode, ancestors, siblings, (staticRoute === null || staticRoute === void 0 ? void 0 : (_staticRoute$route3 = staticRoute.route) === null || _staticRoute$route3 === void 0 ? void 0 : (_staticRoute$route3$f = _staticRoute$route3.fetchNode) === null || _staticRoute$route3$f === void 0 ? void 0 : _staticRoute$route3$f.entryMapper) || resolvedContentTypeMapping.entryMapper, false, (_appsays = appsays) === null || _appsays === void 0 ? void 0 : _appsays.refetchNode);
296
328
  } else {
297
- if (staticRoute) yield effects.call(setRouteEntry, null, pathNode, ancestors, siblings);else yield effects.call(do404);
329
+ if (staticRoute) yield effects.call(setRouteEntry, currentPath, null, pathNode, ancestors, siblings);else yield effects.call(do404);
298
330
  }
299
331
  } catch (e) {
300
332
  log__namespace.error(...['Error running route saga:', e, e.stack]);
@@ -302,6 +334,7 @@ function* getRouteSaga(action) {
302
334
  }
303
335
  }
304
336
  function* resolveCurrentNodeOrdinates({
337
+ api,
305
338
  appsays,
306
339
  contentTypeMapping,
307
340
  language,
@@ -326,7 +359,7 @@ function* resolveCurrentNodeOrdinates({
326
359
  if (doNavigation === true || doNavigation.ancestors) {
327
360
  apiCall[0] = function* getAncestors() {
328
361
  try {
329
- return yield ContensisDeliveryApi.cachedSearch.getAncestors({
362
+ return yield api.getAncestors({
330
363
  id: pathNode.id,
331
364
  language,
332
365
  versionStatus
@@ -342,7 +375,7 @@ function* resolveCurrentNodeOrdinates({
342
375
  const childrenOptions = typeof nodeOptions.children === 'boolean' ? {} : nodeOptions.children;
343
376
  apiCall[1] = function* getChildren() {
344
377
  try {
345
- return yield ContensisDeliveryApi.cachedSearch.getNode({
378
+ return yield api.getNode({
346
379
  depth: childrenOptions.depth !== undefined ? childrenOptions.depth : childrenDepth,
347
380
  path,
348
381
  entryFields: childrenOptions.fields || fields || undefined,
@@ -360,7 +393,7 @@ function* resolveCurrentNodeOrdinates({
360
393
  apiCall[2] = function* getSiblings() {
361
394
  try {
362
395
  var _nodeOptions$siblings, _nodeOptions$siblings2;
363
- return yield ContensisDeliveryApi.cachedSearch.getSiblings({
396
+ return yield api.getSiblings({
364
397
  id: pathNode.id,
365
398
  entryFields: (nodeOptions === null || nodeOptions === void 0 ? void 0 : (_nodeOptions$siblings = nodeOptions.siblings) === null || _nodeOptions$siblings === void 0 ? void 0 : _nodeOptions$siblings.fields) || fields || undefined,
366
399
  entryLinkDepth: typeof (nodeOptions === null || nodeOptions === void 0 ? void 0 : (_nodeOptions$siblings2 = nodeOptions.siblings) === null || _nodeOptions$siblings2 === void 0 ? void 0 : _nodeOptions$siblings2.linkDepth) !== 'undefined' ? nodeOptions.siblings.linkDepth : typeof linkDepth !== 'undefined' ? linkDepth : entryLinkDepth,
@@ -381,10 +414,12 @@ function* resolveCurrentNodeOrdinates({
381
414
  if (typeof window !== 'undefined') {
382
415
  return yield effects.put({
383
416
  type: version.GET_NODE_TREE,
417
+ language,
384
418
  treeDepth
385
419
  });
386
420
  } else {
387
421
  return yield effects.call(ensureNodeTreeSaga, {
422
+ language,
388
423
  treeDepth
389
424
  });
390
425
  }
@@ -393,7 +428,7 @@ function* resolveCurrentNodeOrdinates({
393
428
  const [ancestors, nodeWithChildren, siblings] = yield effects.all([loadAncestors(), loadChildren(), loadSiblings(), loadTree()]);
394
429
  return [ancestors, nodeWithChildren === null || nodeWithChildren === void 0 ? void 0 : nodeWithChildren.children, siblings];
395
430
  }
396
- function* setRouteEntry(entry, node, ancestors, siblings, entryMapper, notFound = false, remapEntry = false) {
431
+ function* setRouteEntry(currentPath, entry, node, ancestors, siblings, entryMapper, notFound = false, remapEntry = false) {
397
432
  const entrySys = entry && entry.sys || {};
398
433
 
399
434
  // Update a window global to provide the preview toolbar
@@ -410,6 +445,7 @@ function* setRouteEntry(entry, node, ancestors, siblings, entryMapper, notFound
410
445
  yield effects.all([effects.put({
411
446
  type: selectors.SET_ENTRY,
412
447
  id: entrySys.id,
448
+ currentPath,
413
449
  entry,
414
450
  mappedEntry,
415
451
  node,
@@ -502,7 +538,7 @@ function* registerSaga({
502
538
  });
503
539
  if (response.ok) {
504
540
  let mappedResponse;
505
- const [, responseBody] = yield awaitToJs.to(response.json());
541
+ const [, responseBody] = yield to.to(response.json());
506
542
  if (responseBody) {
507
543
  // Allow use of response mapper to convert the successful user object
508
544
  // from the api response body into a user object of any format
@@ -527,7 +563,7 @@ function* registerSaga({
527
563
  // Not OK responses, these can be due to service availability
528
564
  // or status codes echoed from the responses received from
529
565
  // management api when registering the user
530
- const [, errorResponse] = yield awaitToJs.to(response.json());
566
+ const [, errorResponse] = yield to.to(response.json());
531
567
  const error = errorResponse && errorResponse.error || errorResponse || {};
532
568
  // Get something meaningful from the response if there is no message in the body
533
569
  if (!error.message) {
@@ -714,10 +750,10 @@ function* changePasswordSaga(action) {
714
750
  type: reducers.CHANGE_USER_PASSWORD_SENDING
715
751
  });
716
752
  const clientCredentials = yield effects.select(ToJs.selectClientCredentials, 'js');
717
- const client = yield login.getManagementApiClient({
753
+ const client = yield ChangePassword_container.getManagementApiClient({
718
754
  ...clientCredentials
719
755
  });
720
- const [err, res] = yield awaitToJs.to(client.security.users.updatePassword(changePasswordObject));
756
+ const [err, res] = yield to.to(client.security.users.updatePassword(changePasswordObject));
721
757
  if (err) {
722
758
  var _err$data, _err$data$data, _err$data2;
723
759
  const error = (err === null || err === void 0 ? void 0 : (_err$data = err.data) === null || _err$data === void 0 ? void 0 : (_err$data$data = _err$data.data) === null || _err$data$data === void 0 ? void 0 : _err$data$data.length) > 0 && err.data.data[0].message || (err === null || err === void 0 ? void 0 : (_err$data2 = err.data) === null || _err$data2 === void 0 ? void 0 : _err$data2.message);
@@ -743,7 +779,7 @@ function* changePasswordSaga(action) {
743
779
  }
744
780
  }
745
781
 
746
- const userSagas = [...login.loginSagas, ...registerSagas, ...resetPasswordSagas];
782
+ const userSagas = [...ChangePassword_container.loginSagas, ...registerSagas, ...resetPasswordSagas];
747
783
 
748
784
  // index.js
749
785
  function rootSaga (featureSagas = []) {
@@ -801,4 +837,4 @@ exports.browserHistory = browserHistory;
801
837
  exports.history = history;
802
838
  exports.pickProject = pickProject;
803
839
  exports.rootSaga = rootSaga;
804
- //# sourceMappingURL=App-81a45001.js.map
840
+ //# sourceMappingURL=App-7ff737fa.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"App-7ff737fa.js","sources":["../src/redux/store/history.js","../src/redux/sagas/navigation.js","../src/util/schema.ts","../src/routing/util/expressions.ts","../src/routing/util/queries.ts","../src/routing/redux/sagas.js","../src/user/redux/sagas/register.js","../src/user/util/userHelper.js","../src/user/redux/sagas/resetPassword.js","../src/user/redux/sagas/index.js","../src/redux/sagas/index.js","../src/util/pickProject.js","../src/app/App.tsx"],"sourcesContent":["import { createBrowserHistory, createMemoryHistory } from 'history';\n\n// Create a history depending on the environment\nconst selectedHistory =\n typeof window !== 'undefined' ? createBrowserHistory : createMemoryHistory;\n\nexport const history = (options = {}) => selectedHistory(options);\nexport const browserHistory = selectedHistory();\n","import { takeEvery, put, select } from 'redux-saga/effects';\nimport * as log from 'loglevel';\n\nimport { deliveryApi } from '~/util/ContensisDeliveryApi';\nimport {\n GET_NODE_TREE,\n SET_NODE_TREE,\n GET_NODE_TREE_ERROR,\n} from '~/redux/types/navigation';\nimport { hasNavigationTree } from '~/redux/selectors/navigation';\nimport { selectVersionStatus } from '~/redux/selectors/version';\nimport { selectCurrentProject } from '~/routing/redux/selectors';\n\nexport const navigationSagas = [takeEvery(GET_NODE_TREE, ensureNodeTreeSaga)];\n\nexport function* ensureNodeTreeSaga(action) {\n const state = yield select();\n try {\n if (!hasNavigationTree(state)) {\n const deliveryApiVersionStatus = yield select(selectVersionStatus);\n const project = yield select(selectCurrentProject);\n const nodes = yield deliveryApi\n .getClient(deliveryApiVersionStatus, project)\n .nodes.getRoot({\n depth: action.treeDepth || 0,\n language: action.language,\n });\n if (nodes) {\n yield put({ type: SET_NODE_TREE, nodes });\n } else {\n yield put({ type: GET_NODE_TREE_ERROR });\n }\n }\n } catch (ex) {\n log.error(...['Error running ensureNodeTreeSaga:', ex]);\n yield put({ type: GET_NODE_TREE_ERROR, error: ex.toString() });\n }\n}\n","export const DataFormats = {\n entry: 'entry',\n webpage: 'webpage',\n};\n\nconst sys = {\n contentTypeId: 'sys.contentTypeId',\n dataFormat: 'sys.dataFormat',\n filename: 'sys.properties.filename',\n id: 'sys.id',\n includeInSearch: 'sys.metadata.includeInSearch',\n slug: 'sys.slug',\n uri: 'sys.uri',\n versionStatus: 'sys.versionStatus',\n};\n\nexport const Fields = {\n entryTitle: 'entryTitle',\n entryDescription: 'entryDescription',\n keywords: 'keywords',\n sys,\n contentTypeId: 'sys.contentTypeId',\n wildcard: '*',\n};\n\nexport const VersionStatus = {\n published: 'published',\n latest: 'latest',\n};\n","import { IExpression } from 'contensis-core-api';\nimport { Op } from 'contensis-delivery-api';\nimport { Fields } from '~/util/schema';\n\nexport const fieldExpression = (\n field: string,\n value: string | string[],\n operator = 'equalTo',\n weight = null\n) => {\n if (!field || !value) return [];\n if (Array.isArray(value)) return equalToOrIn(field, value, operator);\n else\n return !weight\n ? [Op[operator](field, value)]\n : [Op[operator](field, value).weight(weight)];\n};\n\nexport const defaultExpressions = (\n versionStatus: 'published' | 'latest'\n): IExpression[] => {\n return [Op.equalTo(Fields.sys.versionStatus, versionStatus)];\n};\n\nconst equalToOrIn = (field: string, arr: string[], operator = 'equalTo') =>\n arr.length === 0\n ? []\n : arr.length === 1\n ? [Op[operator](field, arr[0])]\n : [Op.in(field, ...arr)];\n","import { VersionStatus } from 'contensis-core-api';\nimport { Query } from 'contensis-delivery-api';\nimport { fieldExpression, defaultExpressions } from './expressions';\n\nexport const routeEntryByFieldsQuery = (\n id: string,\n language = 'en-GB',\n fields: string[] = [],\n versionStatus: VersionStatus = 'published'\n) => {\n const query = new Query(\n ...[\n ...fieldExpression('sys.id', id),\n ...fieldExpression('sys.language', language),\n ...defaultExpressions(versionStatus),\n ]\n );\n query.fields = fields;\n return query;\n};\n","import to from 'await-to-js';\nimport * as log from 'loglevel';\nimport { takeEvery, put, select, call, all } from 'redux-saga/effects';\n\nimport {\n SET_ENTRY,\n SET_ANCESTORS,\n SET_NAVIGATION_PATH,\n SET_ROUTE,\n SET_SIBLINGS,\n UPDATE_LOADING_STATE,\n} from './types';\nimport { GET_NODE_TREE } from '~/redux/types/navigation';\nimport {\n selectCurrentAncestors,\n selectCurrentNode,\n selectCurrentProject,\n selectCurrentSiblings,\n selectMappedEntry,\n selectRouteEntry,\n selectRouteEntryEntryId,\n selectRouteEntryLanguage,\n} from './selectors';\nimport { hasNavigationTree } from '~/redux/selectors/navigation';\nimport { selectVersionStatus } from '~/redux/selectors/version';\nimport { handleRequiresLoginSaga } from '~/user/redux/sagas/login';\nimport { ensureNodeTreeSaga } from '~/redux/sagas/navigation';\nimport { injectRedux as reduxInjector } from '~/redux/store/injectors';\n\nimport { LoginHelper } from '~/user';\nimport { findContentTypeMapping } from '../util/find-contenttype-mapping';\nimport { routeEntryByFieldsQuery } from '../util/queries';\nimport { cachedSearchWithCookies } from '~/util/ContensisDeliveryApi';\n\nexport const routingSagas = [\n takeEvery(SET_NAVIGATION_PATH, getRouteSaga),\n takeEvery(SET_ROUTE, setRouteSaga),\n];\n\n/**\n * To navigate / push a specific route via redux middleware\n * @param {path, state} action\n */\nfunction* setRouteSaga(action) {\n yield put({\n type: 'CALL_HISTORY_METHOD',\n payload: {\n method: 'push',\n args: [action.path, action.state],\n },\n });\n}\n\nfunction* getRouteSaga(action) {\n let entry = null;\n try {\n const {\n withEvents,\n routes: { ContentTypeMappings = {} } = {},\n staticRoute,\n cookies,\n } = action;\n const api = cachedSearchWithCookies(cookies.raw);\n\n // Inject redux { key, reducer, saga } provided by staticRoute\n if (staticRoute && staticRoute.route.injectRedux)\n yield call(reduxInjectorSaga, staticRoute.route.injectRedux);\n\n // Variables we will pass to setRouteEntry\n let pathNode = null,\n ancestors = null,\n children = [],\n siblings = null;\n\n let contentTypeMapping = {};\n\n // These variables are the return values from\n // calls to withEvents.onRouteLoad and onRouteLoaded\n let appsays,\n requireLogin = false;\n\n if (withEvents && withEvents.onRouteLoad) {\n appsays = yield withEvents.onRouteLoad(action);\n }\n\n const staticRouteLinkDepth = staticRoute?.route?.params?.linkDepth;\n const staticRouteFields = staticRoute?.route?.params?.fields;\n const entryLinkDepth =\n appsays && appsays.entryLinkDepth !== undefined\n ? appsays.entryLinkDepth\n : 2;\n const setContentTypeLimits =\n (typeof staticRouteLinkDepth === 'undefined' || !staticRouteFields) &&\n !!ContentTypeMappings.find(\n ct => ct.fields || ct.linkDepth || ct.nodeOptions\n );\n\n const state = yield select();\n const routeEntry = selectRouteEntry(state, 'js');\n const routeNode = selectCurrentNode(state, 'js');\n const currentPath = action.path; //selectCurrentPath(state);\n const deliveryApiStatus = selectVersionStatus(state);\n const project = selectCurrentProject(state);\n // const isHome = currentPath === '/';\n const isPreview = currentPath && currentPath.startsWith('/preview/');\n const defaultLang = (appsays && appsays.defaultLang) || 'en-GB';\n\n if (\n !isPreview &&\n ((appsays && appsays.customRouting) ||\n (staticRoute && !staticRoute.route.fetchNode) ||\n (routeEntry &&\n action.statePath === action.path &&\n (appsays && appsays.refetchNode) !== true))\n ) {\n // To prevent erroneous 404s and wasted network calls, this covers\n // - appsays customRouting and does SET_ENTRY etc. via the consuming app\n // - all staticRoutes (where custom 'route.fetchNode' attribute is falsey)\n // - standard Contensis SiteView Routing where we already have that entry in state\n if (\n routeEntry &&\n (!staticRoute || (staticRoute.route && staticRoute.route.fetchNode))\n ) {\n pathNode = { ...routeNode, entry: null };\n pathNode.entry = entry = routeEntry;\n //Do nothing, the entry is allready the right one.\n // yield put({\n // type: SET_ENTRY,\n // entry,\n // node: routeNode,\n // isLoading: false,\n // });\n yield put({\n type: UPDATE_LOADING_STATE,\n isLoading: false,\n });\n } else\n yield call(\n setRouteEntry,\n currentPath,\n routeEntry,\n yield select(selectCurrentNode),\n yield select(selectCurrentAncestors),\n yield select(selectCurrentSiblings)\n );\n } else {\n // Handle preview routes\n if (isPreview) {\n let splitPath = currentPath.split('/');\n let entryGuid = splitPath[2];\n let language = defaultLang;\n if (splitPath.length >= 3) {\n //set lang key if available in the path, else use default lang\n //assumes preview url on content type is: http://preview.ALIAS.contensis.cloud/preview/{GUID}/{LANG}\n if (splitPath.length == 4) language = splitPath[3];\n // According to product dev we cannot use Node API\n // for previewing entries as it gives a response of []\n // -- apparently it is not correct to request latest content\n // with Node API\n\n let previewEntry = yield api\n .getClient(deliveryApiStatus, project)\n .entries.get({\n id: entryGuid,\n language,\n linkDepth: entryLinkDepth,\n });\n if (previewEntry) {\n pathNode = { entry: previewEntry };\n ({ entry } = pathNode || {});\n }\n }\n } else {\n // Handle all other routes\n let nodeError = undefined;\n [nodeError, pathNode] = yield to(\n api.getNode(\n {\n depth: 0,\n path: currentPath,\n entryFields: setContentTypeLimits\n ? ['sys.contentTypeId', 'sys.id']\n : staticRouteFields || '*',\n entryLinkDepth: setContentTypeLimits\n ? 0\n : typeof staticRouteLinkDepth !== 'undefined'\n ? staticRouteLinkDepth\n : entryLinkDepth,\n language: defaultLang,\n versionStatus: deliveryApiStatus,\n },\n project\n )\n );\n if (nodeError) {\n if ([401, 403].includes(nodeError.status)) {\n // Capture specific auth errors with the delivery api\n // and fire the user down the handleRequiresLoginSaga\n // If auth was successful via a refreshToken we need to reload the page\n // to run this getRouteSaga again with the security token cookie\n const userLoggedIn = yield call(handleRequiresLoginSaga, {\n ...action,\n requireLogin: true,\n });\n if (userLoggedIn && nodeError.status === 401) {\n // Reload the route so we can re-run the routing request now the\n // authentication cookies are written\n return yield call(setRouteSaga, { path: currentPath });\n } else if (userLoggedIn && nodeError.status === 403) {\n return yield call(setRouteSaga, {\n path: LoginHelper.GetAccessDeniedRoute(currentPath),\n });\n } else {\n return yield call(do500, nodeError);\n }\n } else throw nodeError;\n } else ({ entry } = pathNode || {});\n\n if (setContentTypeLimits && pathNode?.entry?.sys?.id) {\n // Get fields[] and linkDepth from ContentTypeMapping to get the entry data\n // and current node's ordinates at a specified depth with specified fields\n contentTypeMapping =\n findContentTypeMapping(\n ContentTypeMappings,\n pathNode.entry.sys.contentTypeId\n ) || {};\n const { fields, linkDepth } = contentTypeMapping;\n const query = routeEntryByFieldsQuery(\n pathNode.entry.sys.id,\n pathNode.entry.sys.language,\n fields,\n deliveryApiStatus\n );\n const payload = yield api.search(\n query,\n typeof linkDepth !== 'undefined' ? linkDepth : entryLinkDepth || 0,\n project\n );\n if (payload?.items?.length > 0) {\n pathNode.entry = entry = payload.items[0];\n }\n }\n }\n\n // make calls to fetch node ancestors, children,\n // siblings or entire node tree\n [ancestors, children, siblings] = yield call(\n resolveCurrentNodeOrdinates,\n {\n api,\n appsays,\n contentTypeMapping,\n language: defaultLang,\n path: currentPath,\n pathNode,\n project,\n versionStatus: deliveryApiStatus,\n }\n );\n\n if (children) pathNode.children = children;\n }\n\n const resolvedContentTypeMapping =\n findContentTypeMapping(\n ContentTypeMappings,\n pathNode?.entry?.sys?.contentTypeId\n ) || {};\n\n // Inject redux { key, reducer, saga } provided by ContentTypeMapping\n if (resolvedContentTypeMapping.injectRedux)\n yield call(reduxInjectorSaga, resolvedContentTypeMapping.injectRedux);\n\n if (withEvents && withEvents.onRouteLoaded) {\n // Check if the app has provided a requireLogin boolean flag or groups array\n // in addition to checking if requireLogin is set in the route definition\n ({ requireLogin } =\n (yield withEvents.onRouteLoaded({ ...action, entry })) || {});\n }\n\n if (requireLogin !== false) {\n // Do not call the login feature saga if requireLogin is false\n yield call(handleRequiresLoginSaga, {\n ...action,\n entry,\n requireLogin,\n });\n }\n\n if (!appsays || !appsays.preventScrollTop) {\n // Scroll into View\n if (typeof window !== 'undefined') window.scrollTo(0, 0);\n }\n\n if (pathNode?.entry?.sys?.id) {\n entry = pathNode.entry;\n\n yield call(\n setRouteEntry,\n currentPath,\n entry,\n pathNode,\n ancestors,\n siblings,\n staticRoute?.route?.fetchNode?.entryMapper ||\n resolvedContentTypeMapping.entryMapper,\n false,\n appsays?.refetchNode\n );\n } else {\n if (staticRoute)\n yield call(\n setRouteEntry,\n currentPath,\n null,\n pathNode,\n ancestors,\n siblings\n );\n else yield call(do404);\n }\n } catch (e) {\n log.error(...['Error running route saga:', e, e.stack]);\n yield call(do500, e);\n }\n}\n\nfunction* resolveCurrentNodeOrdinates({\n api,\n appsays,\n contentTypeMapping,\n language,\n path,\n pathNode,\n project,\n versionStatus,\n}) {\n const apiCall = [() => null, () => null, () => null, () => null];\n\n // if appsays customNavigation: true, we will set doNavigation to false\n // if appsays customNavigation: { ... }, we will set doNavigation to the customNavigation object and check for child elements\n // if appsays nothing we will set doNavigation to true and continue to do navigation calls\n const doNavigation =\n !appsays ||\n (appsays?.customNavigation === true\n ? false\n : appsays?.customNavigation || true);\n\n const {\n entryLinkDepth = 0,\n fields,\n linkDepth,\n nodeOptions = {},\n } = contentTypeMapping;\n\n if (pathNode && pathNode.id) {\n if (doNavigation === true || doNavigation.ancestors) {\n apiCall[0] = function* getAncestors() {\n try {\n return yield api.getAncestors(\n {\n id: pathNode.id,\n language,\n versionStatus,\n },\n project\n );\n } catch (ex) {\n log.info('Problem fetching ancestors', ex);\n return [];\n }\n };\n }\n\n const childrenDepth =\n doNavigation === true || doNavigation.children === true\n ? 1\n : (doNavigation && doNavigation.children) || 0;\n\n if (\n (typeof nodeOptions?.children === 'undefined' && childrenDepth > 0) ||\n nodeOptions.children\n ) {\n const childrenOptions =\n typeof nodeOptions.children === 'boolean' ? {} : nodeOptions.children;\n apiCall[1] = function* getChildren() {\n try {\n return yield api.getNode(\n {\n depth:\n childrenOptions.depth !== undefined\n ? childrenOptions.depth\n : childrenDepth,\n path,\n entryFields: childrenOptions.fields || fields || undefined,\n entryLinkDepth:\n typeof childrenOptions.linkDepth !== 'undefined'\n ? childrenOptions.linkDepth\n : typeof linkDepth !== 'undefined'\n ? linkDepth\n : entryLinkDepth,\n language,\n versionStatus,\n },\n project\n );\n } catch (ex) {\n log.info('Problem fetching children', ex);\n return [];\n }\n };\n }\n\n if (\n (typeof nodeOptions?.siblings === 'undefined' && doNavigation.siblings) ||\n nodeOptions.siblings\n ) {\n apiCall[2] = function* getSiblings() {\n try {\n return yield api.getSiblings(\n {\n id: pathNode.id,\n entryFields: nodeOptions?.siblings?.fields || fields || undefined,\n entryLinkDepth:\n typeof nodeOptions?.siblings?.linkDepth !== 'undefined'\n ? nodeOptions.siblings.linkDepth\n : typeof linkDepth !== 'undefined'\n ? linkDepth\n : entryLinkDepth,\n includeInMenu: true,\n language,\n versionStatus,\n },\n project\n );\n } catch (ex) {\n log.info('Problem fetching siblings', ex);\n return [];\n }\n };\n }\n }\n\n const isTreeLoaded = yield select(hasNavigationTree);\n if (!isTreeLoaded && (doNavigation === true || doNavigation.tree))\n apiCall[3] = function* getNodeTree() {\n const treeDepth =\n doNavigation === true ||\n !doNavigation.tree ||\n doNavigation.tree === true\n ? 2\n : doNavigation.tree;\n\n if (typeof window !== 'undefined') {\n return yield put({\n type: GET_NODE_TREE,\n language,\n treeDepth,\n });\n } else {\n return yield call(ensureNodeTreeSaga, {\n language,\n treeDepth,\n });\n }\n };\n\n const [loadAncestors, loadChildren, loadSiblings, loadTree] = apiCall;\n const [ancestors, nodeWithChildren, siblings] = yield all([\n loadAncestors(),\n loadChildren(),\n loadSiblings(),\n loadTree(),\n ]);\n return [ancestors, nodeWithChildren?.children, siblings];\n}\n\nfunction* setRouteEntry(\n currentPath,\n entry,\n node,\n ancestors,\n siblings,\n entryMapper,\n notFound = false,\n remapEntry = false\n) {\n const entrySys = (entry && entry.sys) || {};\n\n // Update a window global to provide the preview toolbar\n // an updated entry id in client-side navigation\n if (typeof window !== 'undefined') window.ContensisEntryId = entrySys.id;\n\n const currentEntryId = yield select(selectRouteEntryEntryId);\n const currentEntryLang = yield select(selectRouteEntryLanguage);\n const mappedEntry =\n currentEntryId === entrySys.id &&\n currentEntryLang === entrySys.language &&\n remapEntry === false\n ? (yield select(selectMappedEntry, 'js')) || {}\n : yield mapRouteEntry(entryMapper, {\n ...node,\n entry,\n ancestors,\n siblings,\n });\n\n yield all([\n put({\n type: SET_ENTRY,\n id: entrySys.id,\n currentPath,\n entry,\n mappedEntry,\n node,\n notFound,\n }),\n ancestors &&\n put({\n type: SET_ANCESTORS,\n ancestors,\n }),\n siblings &&\n put({\n type: SET_SIBLINGS,\n siblings,\n }),\n ]);\n}\n\nfunction* mapRouteEntry(entryMapper, node) {\n try {\n if (typeof entryMapper === 'function') {\n const state = yield select();\n const mappedEntry = yield call(entryMapper, node, state);\n return mappedEntry;\n }\n } catch (e) {\n log.error(...['Error running entryMapper:', e, e.stack]);\n }\n return;\n}\n\nfunction* do404() {\n yield call(clientReloadHitServer);\n yield put({\n type: SET_ENTRY,\n id: null,\n entry: null,\n notFound: true,\n });\n}\n\nfunction* clientReloadHitServer() {\n const stateEntry = yield select(selectRouteEntry);\n\n // If in client and there is a stateEntry.sys field reload the page,\n // on the 2nd load stateEntry.sys should be null at this point,\n // we do not wish to reload again and get stuck in an infinite reloading loop\n if (typeof window !== 'undefined' && (stateEntry?.sys || null)) {\n window.location.reload();\n }\n}\n\nfunction* do500(error) {\n yield put({\n type: SET_ENTRY,\n id: null,\n entry: null,\n notFound: true,\n isError: true,\n error,\n statusCode: error && error.status ? error.status : 500,\n });\n}\n\nfunction* reduxInjectorSaga(injectorFn) {\n if (typeof injectorFn === 'function') {\n const { key, reducer, saga } = yield injectorFn();\n reduxInjector({ key, reducer, saga });\n }\n}\n","import { to } from 'await-to-js';\nimport { put, select, takeEvery } from 'redux-saga/effects';\nimport { setRoute } from '~/routing/redux/actions';\nimport { selectCurrentSearch } from '~/routing/redux/selectors';\nimport { queryParams } from '~/util/navigation';\nimport {\n REGISTER_USER,\n REGISTER_USER_SUCCESS,\n REGISTER_USER_FAILED,\n} from '../types';\n\nexport const registerSagas = [\n takeEvery(REGISTER_USER, registerSaga),\n takeEvery(REGISTER_USER_SUCCESS, redirectSaga),\n];\n\nfunction* registerSaga({ user, mappers }) {\n let requestBody = user;\n // Allow use of request mapper to take a user object\n // of any format and return the payload for the api request\n if (mappers && mappers.request && typeof mappers.request === 'function') {\n requestBody = yield mappers.request(user);\n }\n\n // Make POST call to register API\n const response = yield fetch('/account/register', {\n method: 'POST',\n headers: {\n Accept: 'application/json',\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify(requestBody),\n });\n\n if (response.ok) {\n let mappedResponse;\n const [, responseBody] = yield to(response.json());\n if (responseBody) {\n // Allow use of response mapper to convert the successful user object\n // from the api response body into a user object of any format\n if (\n mappers &&\n mappers.response &&\n typeof mappers.response === 'function'\n ) {\n mappedResponse = yield mappers.response(responseBody);\n }\n // Update user object with mappedResponse or responseBody\n yield put({\n type: REGISTER_USER_SUCCESS,\n user: mappedResponse || responseBody,\n });\n } else {\n // OK response but unable to parse the response body\n yield put({\n type: REGISTER_USER_FAILED,\n error: {\n message:\n 'Unable to parse the created user from the register service response',\n },\n });\n }\n } else {\n // Not OK responses, these can be due to service availability\n // or status codes echoed from the responses received from\n // management api when registering the user\n const [, errorResponse] = yield to(response.json());\n const error = (errorResponse && errorResponse.error) || errorResponse || {};\n // Get something meaningful from the response if there is no message in the body\n if (!error.message) {\n error.message = `Registration service: ${response.statusText}`;\n error.status = response.status;\n }\n yield put({\n type: REGISTER_USER_FAILED,\n error,\n });\n }\n}\n\nfunction* redirectSaga() {\n // Check if querystring contains a redirect_uri\n const currentQs = queryParams(yield select(selectCurrentSearch));\n const redirectUri = currentQs.redirect_uri || currentQs.redirect;\n\n // We must use redux based navigation to preserve the registration state\n if (redirectUri) yield put(setRoute(redirectUri));\n}\n","const PAP_URL = 'https://pap.zengenti.com';\n\nconst USER_ENVS_URI = 'my-environments';\nconst USER_RESEND_VERIFICATION_URI = 'account/verify/resend';\nconst USER_REQUEST_PASSWORD_RESET_URI = 'account/reset';\nconst USER_RESET_PASSWORD_URI = 'account/reset/password';\n\nconst USER_ENVS_URL = `${PAP_URL}/${USER_ENVS_URI}`;\n\nconst BASE_OPTIONS = {\n method: 'GET',\n headers: { 'Content-Type': 'application/json' },\n};\n\nexport class UserHelper {\n static async GetUsersEnvironments(securityToken) {\n const options = {\n ...BASE_OPTIONS,\n headers: {\n 'x-security-token': securityToken,\n },\n };\n return await UserHelper.get(USER_ENVS_URL, options);\n }\n static async ResendUserVerification(userEmail) {\n const options = {\n ...BASE_OPTIONS,\n };\n return await UserHelper.get(\n `/${USER_RESEND_VERIFICATION_URI}?user=${userEmail}`,\n options\n );\n }\n static async RequestPasswordReset(userEmailObject) {\n const options = {\n ...BASE_OPTIONS,\n body: JSON.stringify(userEmailObject),\n };\n options.method = 'POST';\n\n return await UserHelper.get(`/${USER_REQUEST_PASSWORD_RESET_URI}`, options);\n }\n static async ResetPassword(resetPasswordObject) {\n const options = {\n ...BASE_OPTIONS,\n body: JSON.stringify(resetPasswordObject),\n };\n options.method = 'POST';\n\n return await UserHelper.get(`/${USER_RESET_PASSWORD_URI}`, options);\n }\n\n static async get(url, options = BASE_OPTIONS) {\n try {\n const responseBody = await api(url, options);\n return responseBody;\n } catch (err) {\n return { error: { message: err.message } };\n }\n }\n}\n\nasync function api(url, options) {\n return fetch(url, options)\n .then(async response => {\n return response.json().then(data => data);\n })\n .catch(error => {\n throw error;\n });\n}\n","import { put, takeEvery, select } from 'redux-saga/effects';\nimport { to } from 'await-to-js';\nimport { getManagementApiClient } from '~/user/util/ContensisManagementApi';\nimport { UserHelper } from '~/user/util/userHelper';\nimport { selectClientCredentials } from '../selectors';\nimport {\n REQUEST_USER_PASSWORD_RESET,\n RESET_USER_PASSWORD,\n REQUEST_USER_PASSWORD_RESET_ERROR,\n REQUEST_USER_PASSWORD_RESET_SENDING,\n REQUEST_USER_PASSWORD_RESET_SUCCESS,\n RESET_USER_PASSWORD_ERROR,\n RESET_USER_PASSWORD_SENDING,\n RESET_USER_PASSWORD_SUCCESS,\n CHANGE_USER_PASSWORD,\n CHANGE_USER_PASSWORD_SENDING,\n CHANGE_USER_PASSWORD_SUCCESS,\n CHANGE_USER_PASSWORD_ERROR,\n} from '../types';\n\nexport const resetPasswordSagas = [\n takeEvery(REQUEST_USER_PASSWORD_RESET, requestPasswordResetSaga),\n takeEvery(RESET_USER_PASSWORD, resetPasswordSaga),\n takeEvery(CHANGE_USER_PASSWORD, changePasswordSaga),\n];\n\nfunction* requestPasswordResetSaga(action) {\n const userEmailObject = action.userEmailObject;\n yield put({\n type: REQUEST_USER_PASSWORD_RESET_SENDING,\n });\n if (userEmailObject && userEmailObject.userEmail) {\n try {\n const passwordResetRequestResponse =\n yield UserHelper.RequestPasswordReset(userEmailObject);\n\n if (passwordResetRequestResponse) {\n if (!passwordResetRequestResponse.error) {\n yield put({\n type: REQUEST_USER_PASSWORD_RESET_SUCCESS,\n });\n } else {\n yield put({\n type: REQUEST_USER_PASSWORD_RESET_ERROR,\n error: passwordResetRequestResponse.error.message,\n });\n }\n } else {\n yield put({\n type: REQUEST_USER_PASSWORD_RESET_ERROR,\n error: 'No response from server',\n });\n }\n } catch (error) {\n yield put({\n type: REQUEST_USER_PASSWORD_RESET_ERROR,\n error: error && error.toString(),\n });\n }\n } else {\n yield put({\n type: REQUEST_USER_PASSWORD_RESET_ERROR,\n error: 'Invalid object',\n });\n }\n}\n\nfunction* resetPasswordSaga(action) {\n const resetPasswordObject = action.resetPasswordObject;\n\n yield put({\n type: RESET_USER_PASSWORD_SENDING,\n });\n if (resetPasswordObject.token && resetPasswordObject.password) {\n try {\n const resetPasswordResponse = yield UserHelper.ResetPassword(\n resetPasswordObject\n );\n\n if (resetPasswordResponse) {\n if (!resetPasswordResponse.error) {\n yield put({\n type: RESET_USER_PASSWORD_SUCCESS,\n });\n } else {\n const error =\n (resetPasswordResponse.error.data &&\n resetPasswordResponse.error.data.length > 0 &&\n resetPasswordResponse.error.data[0].message) ||\n resetPasswordResponse.error.message;\n yield put({\n type: RESET_USER_PASSWORD_ERROR,\n error,\n });\n }\n } else {\n yield put({\n type: RESET_USER_PASSWORD_ERROR,\n error: 'No response from server',\n });\n }\n } catch (error) {\n yield put({\n type: RESET_USER_PASSWORD_ERROR,\n error: error && error.toString(),\n });\n }\n } else {\n yield put({\n type: RESET_USER_PASSWORD_ERROR,\n error: 'Invalid object',\n });\n }\n}\n\n// userId\n// existingPassword\n// newPassword\nfunction* changePasswordSaga(action) {\n if (\n !action ||\n !action.userId ||\n !action.currentPassword ||\n !action.newPassword\n ) {\n yield put({\n type: CHANGE_USER_PASSWORD_ERROR,\n error: 'Invalid action object sent to changePassword saga',\n });\n return;\n }\n\n try {\n const changePasswordObject = {\n userId: action.userId,\n existing: action.currentPassword,\n new: action.newPassword,\n };\n\n yield put({\n type: CHANGE_USER_PASSWORD_SENDING,\n });\n const clientCredentials = yield select(selectClientCredentials, 'js');\n const client = yield getManagementApiClient({ ...clientCredentials });\n\n const [err, res] = yield to(\n client.security.users.updatePassword(changePasswordObject)\n );\n\n if (err) {\n const error =\n (err?.data?.data?.length > 0 && err.data.data[0].message) ||\n err?.data?.message;\n yield put({\n type: CHANGE_USER_PASSWORD_ERROR,\n error,\n });\n return;\n }\n\n // // eslint-disable-next-line no-console\n // console.log(changePasswordObject);\n // // eslint-disable-next-line no-console\n // console.log(userCredentialsObject);\n yield put({\n type: CHANGE_USER_PASSWORD_SUCCESS,\n });\n } catch (error) {\n yield put({\n type: CHANGE_USER_PASSWORD_ERROR,\n error: error && error.toString(),\n });\n }\n}\n","import { loginSagas } from './login';\nimport { registerSagas } from './register';\nimport { resetPasswordSagas } from './resetPassword';\n\nexport const userSagas = [\n ...loginSagas,\n ...registerSagas,\n ...resetPasswordSagas,\n];\n","// index.js\nimport { all } from 'redux-saga/effects';\nimport { navigationSagas } from './navigation';\nimport { routingSagas } from '~/routing/redux/sagas';\nimport { userSagas } from '~/user/redux/sagas';\n\nexport default function (featureSagas = []) {\n return function* rootSaga() {\n const subSagas = [...routingSagas, ...navigationSagas, ...userSagas];\n yield all([...subSagas, ...featureSagas]);\n };\n}\n","const servers = SERVERS; /* global SERVERS */\nconst alias = servers.alias.toLowerCase();\nconst publicUri = PUBLIC_URI; /* global PUBLIC_URI */\nconst projects = PROJECTS; /* global PROJECTS */\n\n// return a projectId via the request hostname\nconst pickProject = (hostname, query) => {\n // if localhost we can only infer via a querystring, and take your word for it\n if (hostname == 'localhost') {\n return (query && query.p) || projects[0].id;\n }\n\n // if hostname is the actual public uri we can return the first project from the list\n if (hostname == publicUri) {\n return projects[0].id;\n }\n\n let project = 'unknown';\n\n // // go through all the defined projects\n // Object.entries(projects).map(([, p]) => {\n const p = projects[0];\n\n // check if we're accessing via the project's public uri\n if (hostname.includes(p.publicUri)) project = p.id;\n\n // the url structure is different for website (we don't prefix)\n if (p.id.startsWith('website')) {\n // check for internal and external hostnames\n // we check live and preview distinctly so our rule does not clash with\n // hostnames that use a project prefix\n if (\n hostname.includes(`live-${alias}.cloud.contensis.com`) ||\n hostname.includes(`live.${alias}.contensis.cloud`) ||\n hostname.includes(`preview-${alias}.cloud.contensis.com`) ||\n hostname.includes(`preview.${alias}.contensis.cloud`)\n )\n project = p.id;\n } else {\n // check for internal and external hostnames, prefixed with the projectId\n if (\n hostname.includes(`${p.id.toLowerCase()}-${alias}.cloud.contensis.com`) ||\n hostname.includes(`${p.id.toLowerCase()}.${alias}.contensis.cloud`)\n )\n project = p.id;\n }\n // });\n return project === 'unknown' ? p.id : project;\n};\n\nexport default pickProject;\n","import React from 'react';\nimport { hot } from 'react-hot-loader';\nimport { AppRootProps } from '../routing/routes';\nimport { RouteLoader } from '../routing';\n\nconst AppRoot = (props: AppRootProps) => {\n return <RouteLoader {...props} />;\n};\n\nexport default hot(module)(AppRoot);\n"],"names":["selectedHistory","window","createBrowserHistory","createMemoryHistory","history","options","browserHistory","navigationSagas","takeEvery","GET_NODE_TREE","ensureNodeTreeSaga","action","state","select","hasNavigationTree","deliveryApiVersionStatus","selectVersionStatus","project","selectCurrentProject","nodes","deliveryApi","getClient","getRoot","depth","treeDepth","language","put","type","SET_NODE_TREE","GET_NODE_TREE_ERROR","ex","log","error","toString","sys","contentTypeId","dataFormat","filename","id","includeInSearch","slug","uri","versionStatus","Fields","entryTitle","entryDescription","keywords","wildcard","fieldExpression","field","value","operator","weight","Array","isArray","equalToOrIn","Op","defaultExpressions","equalTo","arr","length","in","routeEntryByFieldsQuery","fields","query","Query","routingSagas","SET_NAVIGATION_PATH","getRouteSaga","SET_ROUTE","setRouteSaga","payload","method","args","path","entry","_staticRoute$route","_staticRoute$route$pa","_staticRoute$route2","_staticRoute$route2$p","_pathNode2","_pathNode2$entry","_pathNode2$entry$sys","_pathNode3","_pathNode3$entry","_pathNode3$entry$sys","withEvents","routes","ContentTypeMappings","staticRoute","cookies","api","cachedSearchWithCookies","raw","route","injectRedux","call","reduxInjectorSaga","pathNode","ancestors","children","siblings","contentTypeMapping","appsays","requireLogin","onRouteLoad","staticRouteLinkDepth","params","linkDepth","staticRouteFields","entryLinkDepth","undefined","setContentTypeLimits","find","ct","nodeOptions","routeEntry","selectRouteEntry","routeNode","selectCurrentNode","currentPath","deliveryApiStatus","isPreview","startsWith","defaultLang","customRouting","fetchNode","statePath","refetchNode","UPDATE_LOADING_STATE","isLoading","setRouteEntry","selectCurrentAncestors","selectCurrentSiblings","splitPath","split","entryGuid","previewEntry","entries","get","_pathNode","_pathNode$entry","_pathNode$entry$sys","nodeError","to","getNode","entryFields","includes","status","userLoggedIn","handleRequiresLoginSaga","LoginHelper","GetAccessDeniedRoute","do500","_payload$items","findContentTypeMapping","search","items","resolveCurrentNodeOrdinates","resolvedContentTypeMapping","onRouteLoaded","preventScrollTop","scrollTo","_staticRoute$route3","_staticRoute$route3$f","_appsays","entryMapper","do404","e","stack","apiCall","doNavigation","customNavigation","getAncestors","info","childrenDepth","childrenOptions","getChildren","getSiblings","_nodeOptions$siblings","_nodeOptions$siblings2","includeInMenu","isTreeLoaded","tree","getNodeTree","loadAncestors","loadChildren","loadSiblings","loadTree","nodeWithChildren","all","node","notFound","remapEntry","entrySys","ContensisEntryId","currentEntryId","selectRouteEntryEntryId","currentEntryLang","selectRouteEntryLanguage","mappedEntry","selectMappedEntry","mapRouteEntry","SET_ENTRY","SET_ANCESTORS","SET_SIBLINGS","clientReloadHitServer","stateEntry","location","reload","isError","statusCode","injectorFn","key","reducer","saga","reduxInjector","registerSagas","REGISTER_USER","registerSaga","REGISTER_USER_SUCCESS","redirectSaga","user","mappers","requestBody","request","response","fetch","headers","Accept","body","JSON","stringify","ok","mappedResponse","responseBody","json","REGISTER_USER_FAILED","message","errorResponse","statusText","currentQs","queryParams","selectCurrentSearch","redirectUri","redirect_uri","redirect","setRoute","PAP_URL","USER_ENVS_URI","USER_RESEND_VERIFICATION_URI","USER_REQUEST_PASSWORD_RESET_URI","USER_RESET_PASSWORD_URI","USER_ENVS_URL","BASE_OPTIONS","UserHelper","GetUsersEnvironments","securityToken","ResendUserVerification","userEmail","RequestPasswordReset","userEmailObject","ResetPassword","resetPasswordObject","url","err","then","data","catch","resetPasswordSagas","REQUEST_USER_PASSWORD_RESET","requestPasswordResetSaga","RESET_USER_PASSWORD","resetPasswordSaga","CHANGE_USER_PASSWORD","changePasswordSaga","REQUEST_USER_PASSWORD_RESET_SENDING","passwordResetRequestResponse","REQUEST_USER_PASSWORD_RESET_SUCCESS","REQUEST_USER_PASSWORD_RESET_ERROR","RESET_USER_PASSWORD_SENDING","token","password","resetPasswordResponse","RESET_USER_PASSWORD_SUCCESS","RESET_USER_PASSWORD_ERROR","userId","currentPassword","newPassword","CHANGE_USER_PASSWORD_ERROR","changePasswordObject","existing","new","CHANGE_USER_PASSWORD_SENDING","clientCredentials","selectClientCredentials","client","getManagementApiClient","res","security","users","updatePassword","_err$data","_err$data$data","_err$data2","CHANGE_USER_PASSWORD_SUCCESS","userSagas","loginSagas","featureSagas","rootSaga","subSagas","servers","SERVERS","alias","toLowerCase","publicUri","PUBLIC_URI","projects","PROJECTS","pickProject","hostname","p","AppRoot","props","React","createElement","RouteLoader"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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