@zengenti/contensis-react-base 3.0.2-beta.30 → 3.0.2-beta.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/{App-eefb5b8f.js → App-21a7d836.js} +29 -61
- package/cjs/App-21a7d836.js.map +1 -0
- package/cjs/{ContensisDeliveryApi-e2b3ce60.js → ContensisDeliveryApi-c079b03a.js} +35 -68
- package/cjs/ContensisDeliveryApi-c079b03a.js.map +1 -0
- package/cjs/{RouteLoader-85bee645.js → RouteLoader-7f0d107a.js} +5 -9
- package/cjs/RouteLoader-7f0d107a.js.map +1 -0
- package/cjs/{ToJs-29de3c36.js → ToJs-6e9cfa69.js} +2 -2
- package/cjs/ToJs-6e9cfa69.js.map +1 -0
- package/cjs/client.js +11 -15
- package/cjs/client.js.map +1 -1
- package/cjs/contensis-react-base.js +348 -25
- package/cjs/contensis-react-base.js.map +1 -1
- package/cjs/forms.js +74 -57
- package/cjs/forms.js.map +1 -1
- package/cjs/{ChangePassword.container-7306be55.js → login-2a6b5be0.js} +84 -247
- package/cjs/login-2a6b5be0.js.map +1 -0
- package/cjs/redux.js +3 -3
- package/cjs/routing.js +3 -5
- package/cjs/routing.js.map +1 -1
- package/cjs/{selectors-a6eac513.js → selectors-bcca60f4.js} +9 -5
- package/cjs/selectors-bcca60f4.js.map +1 -0
- package/cjs/user.js +159 -34
- package/cjs/user.js.map +1 -1
- package/cjs/util.js +3 -7
- package/cjs/util.js.map +1 -1
- package/cjs/{version-9edb5540.js → version-4077e706.js} +2 -2
- package/cjs/{version-9edb5540.js.map → version-4077e706.js.map} +1 -1
- package/cjs/{version-d3b5fbde.js → version-fe28099e.js} +3 -3
- package/cjs/{version-d3b5fbde.js.map → version-fe28099e.js.map} +1 -1
- package/esm/{App-2db3d689.js → App-2af18a99.js} +24 -55
- package/esm/App-2af18a99.js.map +1 -0
- package/esm/{ContensisDeliveryApi-50b8fd7c.js → ContensisDeliveryApi-5660ee0e.js} +36 -67
- package/esm/ContensisDeliveryApi-5660ee0e.js.map +1 -0
- package/esm/{RouteLoader-3e77f6a4.js → RouteLoader-6eac364e.js} +5 -9
- package/esm/RouteLoader-6eac364e.js.map +1 -0
- package/esm/{ToJs-e533a70a.js → ToJs-9b30636a.js} +2 -2
- package/esm/ToJs-9b30636a.js.map +1 -0
- package/esm/client.js +12 -16
- package/esm/client.js.map +1 -1
- package/esm/contensis-react-base.js +349 -25
- package/esm/contensis-react-base.js.map +1 -1
- package/esm/forms.js +74 -57
- package/esm/forms.js.map +1 -1
- package/esm/{ChangePassword.container-54b4011d.js → login-71ff3fcb.js} +78 -230
- package/esm/login-71ff3fcb.js.map +1 -0
- package/esm/redux.js +6 -6
- package/esm/routing.js +3 -5
- package/esm/routing.js.map +1 -1
- package/esm/{selectors-5061d7c8.js → selectors-74de49a3.js} +10 -5
- package/esm/selectors-74de49a3.js.map +1 -0
- package/esm/user.js +151 -22
- package/esm/user.js.map +1 -1
- package/esm/util.js +3 -5
- package/esm/util.js.map +1 -1
- package/esm/{version-7550d14d.js → version-b15807c5.js} +3 -3
- package/esm/{version-7550d14d.js.map → version-b15807c5.js.map} +1 -1
- package/esm/{version-1ef42ad1.js → version-ef107106.js} +2 -2
- package/esm/{version-1ef42ad1.js.map → version-ef107106.js.map} +1 -1
- package/models/client/client.d.ts +1 -1
- package/models/config.d.ts +4 -4
- package/models/redux/appstate.d.ts +1 -1
- package/models/routing/redux/actions.d.ts +6 -10
- package/models/routing/redux/selectors.d.ts +3 -3
- package/models/routing/redux/types.d.ts +1 -0
- package/models/routing/routes.d.ts +17 -20
- package/models/search/models/Queries.d.ts +10 -8
- package/models/search/models/Search.d.ts +24 -24
- package/models/search/models/SearchActions.d.ts +33 -33
- package/models/search/models/SearchState.d.ts +11 -11
- package/models/search/models/SearchUtil.d.ts +1 -1
- package/models/search/models/WithSearch.d.ts +1 -1
- package/models/search/redux/actions.d.ts +4 -4
- package/models/search/redux/selectors.d.ts +27 -27
- package/models/search/redux/util.d.ts +1 -1
- package/models/search/search/expressions.d.ts +4 -4
- package/models/search/search/util.d.ts +2 -2
- package/models/search/transformations/state-to-queryparams.mapper.d.ts +1 -1
- package/models/server/features/linkdepth-api/LinkDepthSearchService.d.ts +1 -1
- package/models/server/features/linkdepth-api/search.d.ts +2 -2
- package/models/server/internalServer.d.ts +5 -7
- package/models/server/util/bundles.d.ts +2 -2
- package/models/server/util/handleExceptions.d.ts +1 -1
- package/models/testImmer/redux/reducer.d.ts +1 -1
- package/models/user/components/Login.d.ts +3 -2
- package/models/user/containers/ChangePassword.container.d.ts +2 -2
- package/models/user/containers/ForgotPassword.container.d.ts +2 -2
- package/models/user/containers/Login.container.d.ts +2 -2
- package/models/user/containers/Registration.container.d.ts +2 -2
- package/models/user/hocs/withLogin.d.ts +11 -5
- package/models/user/hocs/withRegistration.d.ts +8 -2
- package/models/user/redux/actions.d.ts +2 -2
- package/models/user/redux/sagas/login.d.ts +8 -9
- package/models/user/redux/selectors.d.ts +4 -4
- package/models/user/util/CookieHelper.class.d.ts +3 -15
- package/models/user/util/LoginHelper.class.d.ts +23 -27
- package/models/util/ContensisDeliveryApi.d.ts +14 -21
- package/models/util/ToJs.d.ts +1 -1
- package/models/util/index.d.ts +1 -1
- package/models/util/json-mapper.d.ts +1 -1
- package/package.json +10 -9
- package/cjs/App-eefb5b8f.js.map +0 -1
- package/cjs/ChangePassword.container-7306be55.js.map +0 -1
- package/cjs/ContensisDeliveryApi-e2b3ce60.js.map +0 -1
- package/cjs/CookieConstants-000427db.js +0 -10
- package/cjs/CookieConstants-000427db.js.map +0 -1
- package/cjs/CookieHelper.class-daeb09dd.js +0 -52
- package/cjs/CookieHelper.class-daeb09dd.js.map +0 -1
- package/cjs/RouteLoader-85bee645.js.map +0 -1
- package/cjs/ToJs-29de3c36.js.map +0 -1
- package/cjs/selectors-a6eac513.js.map +0 -1
- package/esm/App-2db3d689.js.map +0 -1
- package/esm/ChangePassword.container-54b4011d.js.map +0 -1
- package/esm/ContensisDeliveryApi-50b8fd7c.js.map +0 -1
- package/esm/CookieConstants-3d3b6531.js +0 -6
- package/esm/CookieConstants-3d3b6531.js.map +0 -1
- package/esm/CookieHelper.class-4d6ee27b.js +0 -49
- package/esm/CookieHelper.class-4d6ee27b.js.map +0 -1
- package/esm/RouteLoader-3e77f6a4.js.map +0 -1
- package/esm/ToJs-e533a70a.js.map +0 -1
- package/esm/selectors-5061d7c8.js.map +0 -1
- package/models/user/util/CookieConstants.d.ts +0 -7
|
@@ -3,22 +3,20 @@
|
|
|
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-
|
|
7
|
-
var version = require('./version-
|
|
8
|
-
var version$1 = require('./version-
|
|
9
|
-
var selectors = require('./selectors-
|
|
10
|
-
var
|
|
11
|
-
var ChangePassword_container = require('./ChangePassword.container-7306be55.js');
|
|
12
|
-
var React = require('react');
|
|
13
|
-
require('react-cookie');
|
|
14
|
-
require('react-redux');
|
|
15
|
-
require('jsonpath-mapper');
|
|
16
|
-
var reducers = require('./reducers-9afb5f89.js');
|
|
6
|
+
var ContensisDeliveryApi = require('./ContensisDeliveryApi-c079b03a.js');
|
|
7
|
+
var version = require('./version-4077e706.js');
|
|
8
|
+
var version$1 = require('./version-fe28099e.js');
|
|
9
|
+
var selectors = require('./selectors-bcca60f4.js');
|
|
10
|
+
var login = require('./login-2a6b5be0.js');
|
|
17
11
|
var contensisDeliveryApi = require('contensis-delivery-api');
|
|
18
|
-
var
|
|
12
|
+
var awaitToJs = require('await-to-js');
|
|
13
|
+
var reducers = require('./reducers-9afb5f89.js');
|
|
14
|
+
var ToJs = require('./ToJs-6e9cfa69.js');
|
|
15
|
+
var React = require('react');
|
|
19
16
|
require('react-hot-loader');
|
|
17
|
+
require('jsonpath-mapper');
|
|
20
18
|
require('query-string');
|
|
21
|
-
var RouteLoader = require('./RouteLoader-
|
|
19
|
+
var RouteLoader = require('./RouteLoader-7f0d107a.js');
|
|
22
20
|
|
|
23
21
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
24
22
|
|
|
@@ -41,7 +39,6 @@ function _interopNamespace(e) {
|
|
|
41
39
|
}
|
|
42
40
|
|
|
43
41
|
var log__namespace = /*#__PURE__*/_interopNamespace(log);
|
|
44
|
-
var to__default = /*#__PURE__*/_interopDefaultLegacy(to);
|
|
45
42
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
46
43
|
|
|
47
44
|
// Create a history depending on the environment
|
|
@@ -138,10 +135,8 @@ function* getRouteSaga(action) {
|
|
|
138
135
|
routes: {
|
|
139
136
|
ContentTypeMappings = {}
|
|
140
137
|
} = {},
|
|
141
|
-
staticRoute
|
|
142
|
-
cookies
|
|
138
|
+
staticRoute
|
|
143
139
|
} = action;
|
|
144
|
-
const api = ContensisDeliveryApi.cachedSearchWithCookies(cookies.raw);
|
|
145
140
|
|
|
146
141
|
// Inject redux { key, reducer, saga } provided by staticRoute
|
|
147
142
|
if (staticRoute && staticRoute.route.injectRedux) yield effects.call(reduxInjectorSaga, staticRoute.route.injectRedux);
|
|
@@ -211,7 +206,7 @@ function* getRouteSaga(action) {
|
|
|
211
206
|
// -- apparently it is not correct to request latest content
|
|
212
207
|
// with Node API
|
|
213
208
|
|
|
214
|
-
let previewEntry = yield
|
|
209
|
+
let previewEntry = yield ContensisDeliveryApi.deliveryApi.getClient(deliveryApiStatus, project).entries.get({
|
|
215
210
|
id: entryGuid,
|
|
216
211
|
language,
|
|
217
212
|
linkDepth: entryLinkDepth
|
|
@@ -228,53 +223,28 @@ function* getRouteSaga(action) {
|
|
|
228
223
|
} else {
|
|
229
224
|
var _pathNode, _pathNode$entry, _pathNode$entry$sys;
|
|
230
225
|
// Handle all other routes
|
|
231
|
-
|
|
232
|
-
[nodeError, pathNode] = yield to__default["default"](api.getNode({
|
|
226
|
+
pathNode = yield ContensisDeliveryApi.cachedSearch.getNode({
|
|
233
227
|
depth: 0,
|
|
234
228
|
path: currentPath,
|
|
235
229
|
entryFields: setContentTypeLimits ? ['sys.contentTypeId', 'sys.id'] : staticRouteFields || '*',
|
|
236
230
|
entryLinkDepth: setContentTypeLimits ? 0 : typeof staticRouteLinkDepth !== 'undefined' ? staticRouteLinkDepth : entryLinkDepth,
|
|
237
231
|
language: defaultLang,
|
|
238
232
|
versionStatus: deliveryApiStatus
|
|
239
|
-
}, project)
|
|
240
|
-
|
|
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 ({
|
|
233
|
+
}, project);
|
|
234
|
+
({
|
|
265
235
|
entry
|
|
266
236
|
} = pathNode || {});
|
|
267
237
|
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) {
|
|
268
238
|
var _payload$items;
|
|
269
239
|
// Get fields[] and linkDepth from ContentTypeMapping to get the entry data
|
|
270
240
|
// and current node's ordinates at a specified depth with specified fields
|
|
271
|
-
contentTypeMapping =
|
|
241
|
+
contentTypeMapping = login.findContentTypeMapping(ContentTypeMappings, pathNode.entry.sys.contentTypeId) || {};
|
|
272
242
|
const {
|
|
273
243
|
fields,
|
|
274
244
|
linkDepth
|
|
275
245
|
} = contentTypeMapping;
|
|
276
246
|
const query = routeEntryByFieldsQuery(pathNode.entry.sys.id, pathNode.entry.sys.language, fields, deliveryApiStatus);
|
|
277
|
-
const payload = yield
|
|
247
|
+
const payload = yield ContensisDeliveryApi.cachedSearch.search(query, typeof linkDepth !== 'undefined' ? linkDepth : entryLinkDepth || 0, project);
|
|
278
248
|
if ((payload === null || payload === void 0 ? void 0 : (_payload$items = payload.items) === null || _payload$items === void 0 ? void 0 : _payload$items.length) > 0) {
|
|
279
249
|
pathNode.entry = entry = payload.items[0];
|
|
280
250
|
}
|
|
@@ -284,7 +254,6 @@ function* getRouteSaga(action) {
|
|
|
284
254
|
// make calls to fetch node ancestors, children,
|
|
285
255
|
// siblings or entire node tree
|
|
286
256
|
[ancestors, children, siblings] = yield effects.call(resolveCurrentNodeOrdinates, {
|
|
287
|
-
api,
|
|
288
257
|
appsays,
|
|
289
258
|
contentTypeMapping,
|
|
290
259
|
language: defaultLang,
|
|
@@ -295,7 +264,7 @@ function* getRouteSaga(action) {
|
|
|
295
264
|
});
|
|
296
265
|
if (children) pathNode.children = children;
|
|
297
266
|
}
|
|
298
|
-
const resolvedContentTypeMapping =
|
|
267
|
+
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) || {};
|
|
299
268
|
|
|
300
269
|
// Inject redux { key, reducer, saga } provided by ContentTypeMapping
|
|
301
270
|
if (resolvedContentTypeMapping.injectRedux) yield effects.call(reduxInjectorSaga, resolvedContentTypeMapping.injectRedux);
|
|
@@ -311,7 +280,7 @@ function* getRouteSaga(action) {
|
|
|
311
280
|
}
|
|
312
281
|
if (requireLogin !== false) {
|
|
313
282
|
// Do not call the login feature saga if requireLogin is false
|
|
314
|
-
yield effects.call(
|
|
283
|
+
yield effects.call(login.handleRequiresLoginSaga, {
|
|
315
284
|
...action,
|
|
316
285
|
entry,
|
|
317
286
|
requireLogin
|
|
@@ -334,7 +303,6 @@ function* getRouteSaga(action) {
|
|
|
334
303
|
}
|
|
335
304
|
}
|
|
336
305
|
function* resolveCurrentNodeOrdinates({
|
|
337
|
-
api,
|
|
338
306
|
appsays,
|
|
339
307
|
contentTypeMapping,
|
|
340
308
|
language,
|
|
@@ -359,7 +327,7 @@ function* resolveCurrentNodeOrdinates({
|
|
|
359
327
|
if (doNavigation === true || doNavigation.ancestors) {
|
|
360
328
|
apiCall[0] = function* getAncestors() {
|
|
361
329
|
try {
|
|
362
|
-
return yield
|
|
330
|
+
return yield ContensisDeliveryApi.cachedSearch.getAncestors({
|
|
363
331
|
id: pathNode.id,
|
|
364
332
|
language,
|
|
365
333
|
versionStatus
|
|
@@ -375,7 +343,7 @@ function* resolveCurrentNodeOrdinates({
|
|
|
375
343
|
const childrenOptions = typeof nodeOptions.children === 'boolean' ? {} : nodeOptions.children;
|
|
376
344
|
apiCall[1] = function* getChildren() {
|
|
377
345
|
try {
|
|
378
|
-
return yield
|
|
346
|
+
return yield ContensisDeliveryApi.cachedSearch.getNode({
|
|
379
347
|
depth: childrenOptions.depth !== undefined ? childrenOptions.depth : childrenDepth,
|
|
380
348
|
path,
|
|
381
349
|
entryFields: childrenOptions.fields || fields || undefined,
|
|
@@ -393,7 +361,7 @@ function* resolveCurrentNodeOrdinates({
|
|
|
393
361
|
apiCall[2] = function* getSiblings() {
|
|
394
362
|
try {
|
|
395
363
|
var _nodeOptions$siblings, _nodeOptions$siblings2;
|
|
396
|
-
return yield
|
|
364
|
+
return yield ContensisDeliveryApi.cachedSearch.getSiblings({
|
|
397
365
|
id: pathNode.id,
|
|
398
366
|
entryFields: (nodeOptions === null || nodeOptions === void 0 ? void 0 : (_nodeOptions$siblings = nodeOptions.siblings) === null || _nodeOptions$siblings === void 0 ? void 0 : _nodeOptions$siblings.fields) || fields || undefined,
|
|
399
367
|
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,
|
|
@@ -538,7 +506,7 @@ function* registerSaga({
|
|
|
538
506
|
});
|
|
539
507
|
if (response.ok) {
|
|
540
508
|
let mappedResponse;
|
|
541
|
-
const [, responseBody] = yield
|
|
509
|
+
const [, responseBody] = yield awaitToJs.to(response.json());
|
|
542
510
|
if (responseBody) {
|
|
543
511
|
// Allow use of response mapper to convert the successful user object
|
|
544
512
|
// from the api response body into a user object of any format
|
|
@@ -563,7 +531,7 @@ function* registerSaga({
|
|
|
563
531
|
// Not OK responses, these can be due to service availability
|
|
564
532
|
// or status codes echoed from the responses received from
|
|
565
533
|
// management api when registering the user
|
|
566
|
-
const [, errorResponse] = yield
|
|
534
|
+
const [, errorResponse] = yield awaitToJs.to(response.json());
|
|
567
535
|
const error = errorResponse && errorResponse.error || errorResponse || {};
|
|
568
536
|
// Get something meaningful from the response if there is no message in the body
|
|
569
537
|
if (!error.message) {
|
|
@@ -750,10 +718,10 @@ function* changePasswordSaga(action) {
|
|
|
750
718
|
type: reducers.CHANGE_USER_PASSWORD_SENDING
|
|
751
719
|
});
|
|
752
720
|
const clientCredentials = yield effects.select(ToJs.selectClientCredentials, 'js');
|
|
753
|
-
const client = yield
|
|
721
|
+
const client = yield login.getManagementApiClient({
|
|
754
722
|
...clientCredentials
|
|
755
723
|
});
|
|
756
|
-
const [err, res] = yield
|
|
724
|
+
const [err, res] = yield awaitToJs.to(client.security.users.updatePassword(changePasswordObject));
|
|
757
725
|
if (err) {
|
|
758
726
|
var _err$data, _err$data$data, _err$data2;
|
|
759
727
|
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);
|
|
@@ -779,7 +747,7 @@ function* changePasswordSaga(action) {
|
|
|
779
747
|
}
|
|
780
748
|
}
|
|
781
749
|
|
|
782
|
-
const userSagas = [...
|
|
750
|
+
const userSagas = [...login.loginSagas, ...registerSagas, ...resetPasswordSagas];
|
|
783
751
|
|
|
784
752
|
// index.js
|
|
785
753
|
function rootSaga (featureSagas = []) {
|
|
@@ -837,4 +805,4 @@ exports.browserHistory = browserHistory;
|
|
|
837
805
|
exports.history = history;
|
|
838
806
|
exports.pickProject = pickProject;
|
|
839
807
|
exports.rootSaga = rootSaga;
|
|
840
|
-
//# sourceMappingURL=App-
|
|
808
|
+
//# sourceMappingURL=App-21a7d836.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"App-21a7d836.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 { Query } from '~/util/ContensisDeliveryApi';\nimport { fieldExpression, defaultExpressions } from './expressions';\n\nexport const routeEntryByFieldsQuery = (\n id: string,\n language = 'en-GB',\n fields: string[] = [],\n versionStatus: 'published' | 'latest' = '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 * 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 { ensureNodeTreeSaga } from '~/redux/sagas/navigation';\nimport { handleRequiresLoginSaga } from '~/user/redux/sagas/login';\n\nimport { findContentTypeMapping } from '../util/find-contenttype-mapping';\nimport { routeEntryByFieldsQuery } from '../util/queries';\nimport { cachedSearch, deliveryApi } from '~/util/ContensisDeliveryApi';\nimport { injectRedux as reduxInjector } from '~/redux/store/injectors';\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 } = action;\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 deliveryApi\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 pathNode = yield cachedSearch.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 ({ 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 cachedSearch.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 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 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 cachedSearch.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 cachedSearch.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 cachedSearch.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","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","cachedSearch","getNode","entryFields","_payload$items","findContentTypeMapping","search","items","resolveCurrentNodeOrdinates","resolvedContentTypeMapping","onRouteLoaded","handleRequiresLoginSaga","preventScrollTop","scrollTo","_staticRoute$route3","_staticRoute$route3$f","_appsays","entryMapper","do404","e","stack","do500","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","status","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","to","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","api","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","includes","AppRoot","props","React","createElement","RouteLoader"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA;AACA,MAAMA,eAAe,GACnB,OAAOC,MAAM,KAAK,WAAW,GAAGC,8BAAoB,GAAGC,6BAAmB,CAAA;AAE/DC,MAAAA,OAAO,GAAGA,CAACC,OAAO,GAAG,EAAE,KAAKL,eAAe,CAACK,OAAO,EAAC;AACpDC,MAAAA,cAAc,GAAGN,eAAe;;ACMtC,MAAMO,eAAe,GAAG,CAACC,iBAAS,CAACC,qBAAa,EAAEC,kBAAkB,CAAC,CAAC,CAAA;AAEtE,UAAUA,kBAAkBA,CAACC,MAAM,EAAE;AAC1C,EAAA,MAAMC,KAAK,GAAG,MAAMC,cAAM,EAAE,CAAA;EAC5B,IAAI;AACF,IAAA,IAAI,CAACC,2BAAiB,CAACF,KAAK,CAAC,EAAE;AAC7B,MAAA,MAAMG,wBAAwB,GAAG,MAAMF,cAAM,CAACG,2BAAmB,CAAC,CAAA;AAClE,MAAA,MAAMC,OAAO,GAAG,MAAMJ,cAAM,CAACK,8BAAoB,CAAC,CAAA;AAClD,MAAA,MAAMC,KAAK,GAAG,MAAMC,gCAAW,CAC5BC,SAAS,CAACN,wBAAwB,EAAEE,OAAO,CAAC,CAC5CE,KAAK,CAACG,OAAO,CAAC;AACbC,QAAAA,KAAK,EAAEZ,MAAM,CAACa,SAAS,IAAI,CAAC;QAC5BC,QAAQ,EAAEd,MAAM,CAACc,QAAAA;AACnB,OAAC,CAAC,CAAA;AACJ,MAAA,IAAIN,KAAK,EAAE;AACT,QAAA,MAAMO,WAAG,CAAC;AAAEC,UAAAA,IAAI,EAAEC,qBAAa;AAAET,UAAAA,KAAAA;AAAM,SAAC,CAAC,CAAA;AAC3C,OAAC,MAAM;AACL,QAAA,MAAMO,WAAG,CAAC;AAAEC,UA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AE,CAAA;AAClB,GAAA;AACA;EACA,OAAOrB,OAAO,KAAK,SAAS,GAAGyS,CAAC,CAACpR,EAAE,GAAGrB,OAAO,CAAA;AAC/C;;AC3CM2S,MAAAA,OAAO,GAAIC,KAAmB,IAAK;AACvC,EAAA,oBAAOC,yBAAA,CAAAC,aAAA,CAACC,uBAAW,EAAKH,KAAK,CAAI,CAAA;AACnC;;;;;;;;"}
|
|
@@ -2,24 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
var contensisDeliveryApi = require('contensis-delivery-api');
|
|
4
4
|
var queryString = require('query-string');
|
|
5
|
-
var selectors = require('./selectors-
|
|
6
|
-
var version = require('./version-
|
|
7
|
-
var CookieConstants = require('./CookieConstants-000427db.js');
|
|
8
|
-
var CookieHelper_class = require('./CookieHelper.class-daeb09dd.js');
|
|
5
|
+
var selectors = require('./selectors-bcca60f4.js');
|
|
6
|
+
var version = require('./version-4077e706.js');
|
|
9
7
|
|
|
10
|
-
const getSsrReferer = () => {
|
|
11
|
-
if (typeof window === 'undefined') {
|
|
12
|
-
const state = version.reduxStore.getState();
|
|
13
|
-
const referer = `${selectors.selectCurrentHostname(state)}${selectors.selectCurrentPath(state)}${selectors.selectCurrentSearch(state)}`;
|
|
14
|
-
return referer;
|
|
15
|
-
}
|
|
16
|
-
return '';
|
|
17
|
-
};
|
|
18
8
|
const storeSurrogateKeys = response => {
|
|
19
9
|
const keys = response.headers.get ? response.headers.get('surrogate-key') : response.headers.map['surrogate-key'];
|
|
20
10
|
if (keys) version.reduxStore === null || version.reduxStore === void 0 ? void 0 : version.reduxStore.dispatch(selectors.setSurrogateKeys(keys, response.url));
|
|
21
11
|
};
|
|
22
|
-
const getClientConfig =
|
|
12
|
+
const getClientConfig = project => {
|
|
23
13
|
let config = DELIVERY_API_CONFIG; /* global DELIVERY_API_CONFIG */
|
|
24
14
|
config.responseHandler = {};
|
|
25
15
|
if (project) {
|
|
@@ -28,12 +18,9 @@ const getClientConfig = (project, cookies) => {
|
|
|
28
18
|
|
|
29
19
|
// we only want the surrogate key header in a server context
|
|
30
20
|
if (typeof window === 'undefined') {
|
|
31
|
-
config.defaultHeaders =
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
'x-crb-ssr': true // add this for support tracing
|
|
35
|
-
});
|
|
36
|
-
|
|
21
|
+
config.defaultHeaders = {
|
|
22
|
+
'x-require-surrogate-key': true
|
|
23
|
+
};
|
|
37
24
|
config.responseHandler[200] = storeSurrogateKeys;
|
|
38
25
|
}
|
|
39
26
|
if (typeof window !== 'undefined' && PROXY_DELIVERY_API /* global PROXY_DELIVERY_API */) {
|
|
@@ -41,19 +28,10 @@ const getClientConfig = (project, cookies) => {
|
|
|
41
28
|
config.rootUrl = '';
|
|
42
29
|
config.responseHandler[404] = () => null;
|
|
43
30
|
}
|
|
44
|
-
if (cookies) {
|
|
45
|
-
const cookieHeader = CookieHelper_class.mapCookieHeader(CookieConstants.findLoginCookies(cookies));
|
|
46
|
-
if (cookieHeader) {
|
|
47
|
-
config.defaultHeaders = Object.assign(config.defaultHeaders || {}, {
|
|
48
|
-
Cookie: cookieHeader
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
31
|
return config;
|
|
53
32
|
};
|
|
54
33
|
class DeliveryApi {
|
|
55
|
-
constructor(
|
|
56
|
-
this.cookies = void 0;
|
|
34
|
+
constructor() {
|
|
57
35
|
this.getClientSideVersionStatus = () => {
|
|
58
36
|
if (typeof window !== 'undefined') {
|
|
59
37
|
// Allow overriding versionStatus with the querystring
|
|
@@ -93,17 +71,17 @@ class DeliveryApi {
|
|
|
93
71
|
}
|
|
94
72
|
return 'published';
|
|
95
73
|
};
|
|
96
|
-
this.search = (query, linkDepth, project) => {
|
|
97
|
-
const client = contensisDeliveryApi.Client.create(getClientConfig(project
|
|
74
|
+
this.search = (query, linkDepth, project, env) => {
|
|
75
|
+
const client = contensisDeliveryApi.Client.create(getClientConfig(project));
|
|
98
76
|
return client.entries.search(query, typeof linkDepth !== 'undefined' ? linkDepth : 1);
|
|
99
77
|
};
|
|
100
|
-
this.getClient = (deliveryApiStatus = 'published', project) => {
|
|
101
|
-
const baseConfig = getClientConfig(project
|
|
78
|
+
this.getClient = (deliveryApiStatus = 'published', project, env) => {
|
|
79
|
+
const baseConfig = getClientConfig(project);
|
|
102
80
|
baseConfig.versionStatus = deliveryApiStatus;
|
|
103
81
|
return contensisDeliveryApi.Client.create(baseConfig);
|
|
104
82
|
};
|
|
105
|
-
this.getEntry = (id, linkDepth = 0, deliveryApiStatus = 'published', project) => {
|
|
106
|
-
const baseConfig = getClientConfig(project
|
|
83
|
+
this.getEntry = (id, linkDepth = 0, deliveryApiStatus = 'published', project, env) => {
|
|
84
|
+
const baseConfig = getClientConfig(project);
|
|
107
85
|
baseConfig.versionStatus = deliveryApiStatus;
|
|
108
86
|
const client = contensisDeliveryApi.Client.create(baseConfig);
|
|
109
87
|
// return client.entries.get(id, linkDepth);
|
|
@@ -112,11 +90,9 @@ class DeliveryApi {
|
|
|
112
90
|
linkDepth
|
|
113
91
|
});
|
|
114
92
|
};
|
|
115
|
-
this.cookies = cookies;
|
|
116
93
|
}
|
|
117
94
|
}
|
|
118
95
|
const deliveryApi = new DeliveryApi();
|
|
119
|
-
const deliveryApiWithCookies = cookies => new DeliveryApi(cookies);
|
|
120
96
|
class CacheNode {
|
|
121
97
|
constructor(key, value) {
|
|
122
98
|
this.key = key;
|
|
@@ -187,62 +163,56 @@ class LruCache {
|
|
|
187
163
|
this.size--;
|
|
188
164
|
}
|
|
189
165
|
}
|
|
190
|
-
|
|
191
|
-
// CachedSearch does not cache results in SSR by design
|
|
192
166
|
class CachedSearch {
|
|
193
|
-
constructor(
|
|
167
|
+
constructor() {
|
|
194
168
|
this.cache = new LruCache();
|
|
195
|
-
this.cookies = void 0;
|
|
196
169
|
this.taxonomyLookup = {};
|
|
197
|
-
this.getClient = new DeliveryApi(this.cookies).getClient;
|
|
198
|
-
this.cookies = cookies;
|
|
199
170
|
}
|
|
200
|
-
search(query, linkDepth, project) {
|
|
201
|
-
const client = contensisDeliveryApi.Client.create(getClientConfig(project
|
|
171
|
+
search(query, linkDepth, project, env) {
|
|
172
|
+
const client = contensisDeliveryApi.Client.create(getClientConfig(project));
|
|
202
173
|
return this.request(project + JSON.stringify(query) + linkDepth.toString(), () => client.entries.search(query, linkDepth));
|
|
203
174
|
}
|
|
204
|
-
searchUsingPost(query, linkDepth = 0, project = '') {
|
|
205
|
-
const client = contensisDeliveryApi.Client.create(getClientConfig(project
|
|
175
|
+
searchUsingPost(query, linkDepth = 0, project = '', env) {
|
|
176
|
+
const client = contensisDeliveryApi.Client.create(getClientConfig(project));
|
|
206
177
|
return this.request(project + JSON.stringify(query) + linkDepth.toString(), () => client.entries.searchUsingPost(query, linkDepth));
|
|
207
178
|
}
|
|
208
|
-
get(id, linkDepth, versionStatus, project) {
|
|
209
|
-
const client = contensisDeliveryApi.Client.create(getClientConfig(project
|
|
179
|
+
get(id, linkDepth, versionStatus, project, env) {
|
|
180
|
+
const client = contensisDeliveryApi.Client.create(getClientConfig(project));
|
|
210
181
|
client.clientConfig.versionStatus = versionStatus;
|
|
211
182
|
return this.request(id, () => client.entries.get({
|
|
212
183
|
id,
|
|
213
184
|
linkDepth
|
|
214
185
|
}));
|
|
215
186
|
}
|
|
216
|
-
getContentType(id, project) {
|
|
217
|
-
const client = contensisDeliveryApi.Client.create(getClientConfig(project
|
|
187
|
+
getContentType(id, project, env) {
|
|
188
|
+
const client = contensisDeliveryApi.Client.create(getClientConfig(project));
|
|
218
189
|
return this.request(`[CONTENT TYPE] ${id} ${project}`, () => client.contentTypes.get(id));
|
|
219
190
|
}
|
|
220
|
-
getTaxonomyNode(key, project) {
|
|
221
|
-
const client = contensisDeliveryApi.Client.create(getClientConfig(project
|
|
191
|
+
getTaxonomyNode(key, project, env) {
|
|
192
|
+
const client = contensisDeliveryApi.Client.create(getClientConfig(project));
|
|
222
193
|
return this.request(`[TAXONOMY NODE] ${key}`, () => client.taxonomy.resolveChildren(key).then(node => this.extendTaxonomyNode(node)));
|
|
223
194
|
}
|
|
224
|
-
getRootNode(options, project) {
|
|
225
|
-
const client = contensisDeliveryApi.Client.create(getClientConfig(project
|
|
195
|
+
getRootNode(options, project, env) {
|
|
196
|
+
const client = contensisDeliveryApi.Client.create(getClientConfig(project));
|
|
226
197
|
return this.request(`${project} / ${JSON.stringify(options)}`, () => client.nodes.getRoot(options));
|
|
227
198
|
}
|
|
228
|
-
getNode(options, project) {
|
|
229
|
-
const client = contensisDeliveryApi.Client.create(getClientConfig(project
|
|
199
|
+
getNode(options, project, env) {
|
|
200
|
+
const client = contensisDeliveryApi.Client.create(getClientConfig(project));
|
|
230
201
|
return this.request(`${project} ${options && options.path || options} ${JSON.stringify(options)}`, () => client.nodes.get(options));
|
|
231
202
|
}
|
|
232
|
-
getAncestors(options, project) {
|
|
233
|
-
const client = contensisDeliveryApi.Client.create(getClientConfig(project
|
|
203
|
+
getAncestors(options, project, env) {
|
|
204
|
+
const client = contensisDeliveryApi.Client.create(getClientConfig(project));
|
|
234
205
|
return this.request(`${project} [A] ${options && options.id || options} ${JSON.stringify(options)}`, () => client.nodes.getAncestors(options));
|
|
235
206
|
}
|
|
236
|
-
getChildren(options, project) {
|
|
237
|
-
const client = contensisDeliveryApi.Client.create(getClientConfig(project
|
|
207
|
+
getChildren(options, project, env) {
|
|
208
|
+
const client = contensisDeliveryApi.Client.create(getClientConfig(project));
|
|
238
209
|
return this.request(`${project} [C] ${options && options.id || options} ${JSON.stringify(options)}`, () => client.nodes.getChildren(options));
|
|
239
210
|
}
|
|
240
|
-
getSiblings(options, project) {
|
|
241
|
-
const client = contensisDeliveryApi.Client.create(getClientConfig(project
|
|
211
|
+
getSiblings(options, project, env) {
|
|
212
|
+
const client = contensisDeliveryApi.Client.create(getClientConfig(project));
|
|
242
213
|
return this.request(`${project} [S] ${options && options.id || options} ${JSON.stringify(options)}`, () => client.nodes.getSiblings(options));
|
|
243
214
|
}
|
|
244
215
|
request(key, execute) {
|
|
245
|
-
// do not cache results in SSR
|
|
246
216
|
if (!this.cache.get(key) || typeof window == 'undefined') {
|
|
247
217
|
let promise = execute();
|
|
248
218
|
this.cache.set(key, promise);
|
|
@@ -254,11 +224,8 @@ class CachedSearch {
|
|
|
254
224
|
}
|
|
255
225
|
}
|
|
256
226
|
const cachedSearch = new CachedSearch();
|
|
257
|
-
const cachedSearchWithCookies = cookies => new CachedSearch(cookies);
|
|
258
227
|
|
|
259
228
|
exports.cachedSearch = cachedSearch;
|
|
260
|
-
exports.cachedSearchWithCookies = cachedSearchWithCookies;
|
|
261
229
|
exports.deliveryApi = deliveryApi;
|
|
262
|
-
exports.deliveryApiWithCookies = deliveryApiWithCookies;
|
|
263
230
|
exports.getClientConfig = getClientConfig;
|
|
264
|
-
//# sourceMappingURL=ContensisDeliveryApi-
|
|
231
|
+
//# sourceMappingURL=ContensisDeliveryApi-c079b03a.js.map
|