@zengenti/contensis-react-base 3.0.2-beta.32 → 3.0.2-beta.33

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 (54) hide show
  1. package/cjs/{App-21a7d836.js → App-c74fb1ff.js} +8 -8
  2. package/cjs/App-c74fb1ff.js.map +1 -0
  3. package/cjs/{ContensisDeliveryApi-c079b03a.js → ContensisDeliveryApi-c373405a.js} +154 -121
  4. package/cjs/ContensisDeliveryApi-c373405a.js.map +1 -0
  5. package/cjs/{RouteLoader-7f0d107a.js → RouteLoader-c048673f.js} +3 -3
  6. package/cjs/{RouteLoader-7f0d107a.js.map → RouteLoader-c048673f.js.map} +1 -1
  7. package/cjs/{ToJs-6e9cfa69.js → ToJs-c5bbd17a.js} +2 -2
  8. package/cjs/{ToJs-6e9cfa69.js.map → ToJs-c5bbd17a.js.map} +1 -1
  9. package/cjs/client.js +8 -8
  10. package/cjs/contensis-react-base.js +8 -8
  11. package/cjs/{login-2a6b5be0.js → login-3df93749.js} +3 -3
  12. package/cjs/{login-2a6b5be0.js.map → login-3df93749.js.map} +1 -1
  13. package/cjs/redux.js +3 -3
  14. package/cjs/routing.js +3 -3
  15. package/cjs/{selectors-bcca60f4.js → selectors-c7873cd7.js} +2 -1
  16. package/cjs/{selectors-bcca60f4.js.map → selectors-c7873cd7.js.map} +1 -1
  17. package/cjs/user.js +3 -3
  18. package/cjs/util.js +3 -3
  19. package/cjs/{version-4077e706.js → version-6998435a.js} +2 -2
  20. package/cjs/{version-4077e706.js.map → version-6998435a.js.map} +1 -1
  21. package/cjs/{version-fe28099e.js → version-fe0119b6.js} +3 -3
  22. package/cjs/{version-fe28099e.js.map → version-fe0119b6.js.map} +1 -1
  23. package/esm/{App-2af18a99.js → App-ade8773a.js} +8 -8
  24. package/esm/App-ade8773a.js.map +1 -0
  25. package/esm/{ContensisDeliveryApi-5660ee0e.js → ContensisDeliveryApi-5bb364b9.js} +154 -121
  26. package/esm/ContensisDeliveryApi-5bb364b9.js.map +1 -0
  27. package/esm/{RouteLoader-6eac364e.js → RouteLoader-e6c2c8d6.js} +3 -3
  28. package/esm/{RouteLoader-6eac364e.js.map → RouteLoader-e6c2c8d6.js.map} +1 -1
  29. package/esm/{ToJs-9b30636a.js → ToJs-7233c038.js} +2 -2
  30. package/esm/{ToJs-9b30636a.js.map → ToJs-7233c038.js.map} +1 -1
  31. package/esm/client.js +9 -9
  32. package/esm/contensis-react-base.js +9 -9
  33. package/esm/{login-71ff3fcb.js → login-c3cfb5ad.js} +3 -3
  34. package/esm/{login-71ff3fcb.js.map → login-c3cfb5ad.js.map} +1 -1
  35. package/esm/redux.js +6 -6
  36. package/esm/routing.js +3 -3
  37. package/esm/{selectors-74de49a3.js → selectors-ff21e98a.js} +2 -2
  38. package/esm/{selectors-74de49a3.js.map → selectors-ff21e98a.js.map} +1 -1
  39. package/esm/user.js +4 -4
  40. package/esm/util.js +3 -3
  41. package/esm/{version-b15807c5.js → version-88653900.js} +3 -3
  42. package/esm/{version-b15807c5.js.map → version-88653900.js.map} +1 -1
  43. package/esm/{version-ef107106.js → version-aebe50f2.js} +2 -2
  44. package/esm/{version-ef107106.js.map → version-aebe50f2.js.map} +1 -1
  45. package/models/routing/util/queries.d.ts +3 -2
  46. package/models/user/util/CookieConstants.d.ts +8 -0
  47. package/models/util/CachedDeliveryApi.d.ts +25 -0
  48. package/models/util/ContensisDeliveryApi.d.ts +20 -44
  49. package/models/util/LruCache.d.ts +12 -0
  50. package/package.json +1 -1
  51. package/cjs/App-21a7d836.js.map +0 -1
  52. package/cjs/ContensisDeliveryApi-c079b03a.js.map +0 -1
  53. package/esm/App-2af18a99.js.map +0 -1
  54. package/esm/ContensisDeliveryApi-5660ee0e.js.map +0 -1
@@ -1,96 +1,12 @@
1
1
  import { Client } from 'contensis-delivery-api';
2
2
  import { parse } from 'query-string';
3
- import { A as setSurrogateKeys } from './selectors-74de49a3.js';
4
- import { r as reduxStore } from './version-ef107106.js';
3
+ import { A as selectCurrentHostname, w as selectCurrentPath, o as selectCurrentSearch, B as setSurrogateKeys } from './selectors-ff21e98a.js';
4
+ import { r as reduxStore } from './version-aebe50f2.js';
5
5
 
6
- const storeSurrogateKeys = response => {
7
- const keys = response.headers.get ? response.headers.get('surrogate-key') : response.headers.map['surrogate-key'];
8
- if (keys) reduxStore === null || reduxStore === void 0 ? void 0 : reduxStore.dispatch(setSurrogateKeys(keys, response.url));
9
- };
10
- const getClientConfig = project => {
11
- let config = DELIVERY_API_CONFIG; /* global DELIVERY_API_CONFIG */
12
- config.responseHandler = {};
13
- if (project) {
14
- config.projectId = project;
15
- }
6
+ const LOGIN_COOKIE = 'ContensisCMSUserName';
7
+ const REFRESH_TOKEN_COOKIE = 'RefreshToken';
8
+ const findLoginCookies = cookies => typeof cookies === 'object' ? Object.fromEntries(Object.entries(cookies).filter(([name]) => [LOGIN_COOKIE, REFRESH_TOKEN_COOKIE].includes(name))) : cookies;
16
9
 
17
- // we only want the surrogate key header in a server context
18
- if (typeof window === 'undefined') {
19
- config.defaultHeaders = {
20
- 'x-require-surrogate-key': true
21
- };
22
- config.responseHandler[200] = storeSurrogateKeys;
23
- }
24
- if (typeof window !== 'undefined' && PROXY_DELIVERY_API /* global PROXY_DELIVERY_API */) {
25
- // ensure a relative url is used to bypass the need for CORS (separate OPTIONS calls)
26
- config.rootUrl = '';
27
- config.responseHandler[404] = () => null;
28
- }
29
- return config;
30
- };
31
- class DeliveryApi {
32
- constructor() {
33
- this.getClientSideVersionStatus = () => {
34
- if (typeof window !== 'undefined') {
35
- // Allow overriding versionStatus with the querystring
36
- const {
37
- versionStatus
38
- } = parse(window.location.search);
39
- if (versionStatus) return versionStatus;
40
- // Client-side we will have a global variable set if rendered by SSR in production
41
- if (typeof window.versionStatus !== 'undefined') return window.versionStatus;
42
- // For localhost development we can only work out versionStatus from the current hostname
43
- const currentHostname = window.location.hostname;
44
- return this.getVersionStatusFromHostname(currentHostname);
45
- }
46
- return null;
47
- };
48
- this.getServerSideVersionStatus = request => request.query.versionStatus || deliveryApi.getVersionStatusFromHeaders(request.headers) || deliveryApi.getVersionStatusFromHostname(request.hostname);
49
- this.getVersionStatusFromHeaders = headers => {
50
- const versionStatusHeader = headers['x-entry-versionstatus'];
51
- if (typeof versionStatusHeader !== 'undefined') return versionStatusHeader;
52
- return null;
53
- };
54
- this.getVersionStatusFromHostname = currentHostname => {
55
- if (currentHostname.indexOf('localhost') > -1) return 'latest';
56
- if (currentHostname.endsWith('contensis.cloud')) {
57
- if (currentHostname.indexOf('preview.') > -1) {
58
- return 'latest';
59
- } else {
60
- return 'published';
61
- }
62
- }
63
- if (currentHostname.endsWith('cloud.contensis.com')) {
64
- if (currentHostname.indexOf('preview-') > -1) {
65
- return 'latest';
66
- } else {
67
- return 'published';
68
- }
69
- }
70
- return 'published';
71
- };
72
- this.search = (query, linkDepth, project, env) => {
73
- const client = Client.create(getClientConfig(project));
74
- return client.entries.search(query, typeof linkDepth !== 'undefined' ? linkDepth : 1);
75
- };
76
- this.getClient = (deliveryApiStatus = 'published', project, env) => {
77
- const baseConfig = getClientConfig(project);
78
- baseConfig.versionStatus = deliveryApiStatus;
79
- return Client.create(baseConfig);
80
- };
81
- this.getEntry = (id, linkDepth = 0, deliveryApiStatus = 'published', project, env) => {
82
- const baseConfig = getClientConfig(project);
83
- baseConfig.versionStatus = deliveryApiStatus;
84
- const client = Client.create(baseConfig);
85
- // return client.entries.get(id, linkDepth);
86
- return client.entries.get({
87
- id,
88
- linkDepth
89
- });
90
- };
91
- }
92
- }
93
- const deliveryApi = new DeliveryApi();
94
10
  class CacheNode {
95
11
  constructor(key, value) {
96
12
  this.key = key;
@@ -161,58 +77,61 @@ class LruCache {
161
77
  this.size--;
162
78
  }
163
79
  }
80
+
81
+ // CachedSearch does not cache results in SSR by design
164
82
  class CachedSearch {
165
- constructor() {
83
+ constructor(cookies) {
166
84
  this.cache = new LruCache();
167
- this.taxonomyLookup = {};
85
+ this.cookies = void 0;
86
+ this.cookies = cookies;
87
+ }
88
+ getClient(...args) {
89
+ return new DeliveryApi(this.cookies).getClient(...args);
168
90
  }
169
- search(query, linkDepth, project, env) {
170
- const client = Client.create(getClientConfig(project));
171
- return this.request(project + JSON.stringify(query) + linkDepth.toString(), () => client.entries.search(query, linkDepth));
91
+ search(query, linkDepth = 0, project) {
92
+ const client = Client.create(getClientConfig(project, this.cookies));
93
+ return this.request(`${project}+${JSON.stringify(query)}+${linkDepth}`, () => client.entries.search(query, linkDepth));
172
94
  }
173
- searchUsingPost(query, linkDepth = 0, project = '', env) {
174
- const client = Client.create(getClientConfig(project));
175
- return this.request(project + JSON.stringify(query) + linkDepth.toString(), () => client.entries.searchUsingPost(query, linkDepth));
95
+ searchUsingPost(query, linkDepth = 0, project = '') {
96
+ const client = Client.create(getClientConfig(project, this.cookies));
97
+ return this.request(`${project}+${JSON.stringify(query)}+${linkDepth}`, () => client.entries.searchUsingPost(query, linkDepth));
176
98
  }
177
- get(id, linkDepth, versionStatus, project, env) {
178
- const client = Client.create(getClientConfig(project));
99
+ get(id, linkDepth = 0, versionStatus = 'published', project) {
100
+ const client = Client.create(getClientConfig(project, this.cookies));
179
101
  client.clientConfig.versionStatus = versionStatus;
180
102
  return this.request(id, () => client.entries.get({
181
103
  id,
182
104
  linkDepth
183
105
  }));
184
106
  }
185
- getContentType(id, project, env) {
186
- const client = Client.create(getClientConfig(project));
107
+ getContentType(id, project) {
108
+ const client = Client.create(getClientConfig(project, this.cookies));
187
109
  return this.request(`[CONTENT TYPE] ${id} ${project}`, () => client.contentTypes.get(id));
188
110
  }
189
- getTaxonomyNode(key, project, env) {
190
- const client = Client.create(getClientConfig(project));
191
- return this.request(`[TAXONOMY NODE] ${key}`, () => client.taxonomy.resolveChildren(key).then(node => this.extendTaxonomyNode(node)));
192
- }
193
- getRootNode(options, project, env) {
194
- const client = Client.create(getClientConfig(project));
111
+ getRootNode(options, project) {
112
+ const client = Client.create(getClientConfig(project, this.cookies));
195
113
  return this.request(`${project} / ${JSON.stringify(options)}`, () => client.nodes.getRoot(options));
196
114
  }
197
- getNode(options, project, env) {
198
- const client = Client.create(getClientConfig(project));
199
- return this.request(`${project} ${options && options.path || options} ${JSON.stringify(options)}`, () => client.nodes.get(options));
115
+ getNode(options, project) {
116
+ const client = Client.create(getClientConfig(project, this.cookies));
117
+ return this.request(`${project} ${options && typeof options !== 'string' ? 'path' in options ? options.path : options.id : options} ${JSON.stringify(options)}`, () => client.nodes.get(options));
200
118
  }
201
- getAncestors(options, project, env) {
202
- const client = Client.create(getClientConfig(project));
203
- return this.request(`${project} [A] ${options && options.id || options} ${JSON.stringify(options)}`, () => client.nodes.getAncestors(options));
119
+ getAncestors(options, project) {
120
+ const client = Client.create(getClientConfig(project, this.cookies));
121
+ return this.request(`${project} [A] ${options && typeof options !== 'string' && options.id || options} ${JSON.stringify(options)}`, () => client.nodes.getAncestors(options));
204
122
  }
205
- getChildren(options, project, env) {
206
- const client = Client.create(getClientConfig(project));
207
- return this.request(`${project} [C] ${options && options.id || options} ${JSON.stringify(options)}`, () => client.nodes.getChildren(options));
123
+ getChildren(options, project) {
124
+ const client = Client.create(getClientConfig(project, this.cookies));
125
+ return this.request(`${project} [C] ${options && typeof options !== 'string' && options.id || options} ${JSON.stringify(options)}`, () => client.nodes.getChildren(options));
208
126
  }
209
- getSiblings(options, project, env) {
210
- const client = Client.create(getClientConfig(project));
211
- return this.request(`${project} [S] ${options && options.id || options} ${JSON.stringify(options)}`, () => client.nodes.getSiblings(options));
127
+ getSiblings(options, project) {
128
+ const client = Client.create(getClientConfig(project, this.cookies));
129
+ return this.request(`${project} [S] ${options && typeof options !== 'string' && options.id || options} ${JSON.stringify(options)}`, () => client.nodes.getSiblings(options));
212
130
  }
213
131
  request(key, execute) {
132
+ // do not cache results in SSR
214
133
  if (!this.cache.get(key) || typeof window == 'undefined') {
215
- let promise = execute();
134
+ const promise = execute();
216
135
  this.cache.set(key, promise);
217
136
  promise.catch(() => {
218
137
  this.cache.remove(key);
@@ -223,5 +142,119 @@ class CachedSearch {
223
142
  }
224
143
  const cachedSearch = new CachedSearch();
225
144
 
145
+ const mapCookieHeader = cookies => typeof cookies === 'object' ? Object.entries(cookies).map(([name, value]) => `${name}=${value}`).join('; ') : cookies;
146
+ const getSsrReferer = () => {
147
+ if (typeof window === 'undefined') {
148
+ const state = reduxStore.getState();
149
+ const referer = `${selectCurrentHostname(state)}${selectCurrentPath(state)}${selectCurrentSearch(state)}`;
150
+ return referer;
151
+ }
152
+ return '';
153
+ };
154
+ const storeSurrogateKeys = response => {
155
+ const keys = response.headers.get ? response.headers.get('surrogate-key') : response.headers.map['surrogate-key'];
156
+ if (keys) reduxStore === null || reduxStore === void 0 ? void 0 : reduxStore.dispatch(setSurrogateKeys(keys, response.url));
157
+ };
158
+ const getClientConfig = (project, cookies) => {
159
+ const config = DELIVERY_API_CONFIG; /* global DELIVERY_API_CONFIG */
160
+ config.responseHandler = {};
161
+ if (project) {
162
+ config.projectId = project;
163
+ }
164
+
165
+ // we only want the surrogate key header in a server context
166
+ if (typeof window === 'undefined') {
167
+ config.defaultHeaders = Object.assign(config.defaultHeaders || {}, {
168
+ referer: getSsrReferer(),
169
+ 'x-require-surrogate-key': true,
170
+ 'x-crb-ssr': true // add this for support tracing
171
+ });
172
+
173
+ config.responseHandler[200] = storeSurrogateKeys;
174
+ }
175
+ if (typeof window !== 'undefined' && PROXY_DELIVERY_API /* global PROXY_DELIVERY_API */) {
176
+ // ensure a relative url is used to bypass the need for CORS (separate OPTIONS calls)
177
+ config.rootUrl = '';
178
+ config.responseHandler[404] = () => null;
179
+ }
180
+ if (cookies) {
181
+ const cookieHeader = mapCookieHeader(findLoginCookies(cookies));
182
+ if (cookieHeader) {
183
+ config.defaultHeaders = Object.assign(config.defaultHeaders || {}, {
184
+ Cookie: cookieHeader
185
+ });
186
+ }
187
+ }
188
+ return config;
189
+ };
190
+
191
+ // export * from 'contensis-delivery-api';
192
+
193
+ class DeliveryApi {
194
+ constructor(cookies) {
195
+ this.cookies = void 0;
196
+ this.getClientSideVersionStatus = () => {
197
+ if (typeof window !== 'undefined') {
198
+ // Allow overriding versionStatus with the querystring
199
+ const {
200
+ versionStatus
201
+ } = parse(window.location.search);
202
+ if (versionStatus) return versionStatus;
203
+ // Client-side we will have a global variable set if rendered by SSR in production
204
+ if (typeof window.versionStatus !== 'undefined') return window.versionStatus;
205
+ // For localhost development we can only work out versionStatus from the current hostname
206
+ const currentHostname = window.location.hostname;
207
+ return this.getVersionStatusFromHostname(currentHostname);
208
+ }
209
+ return null;
210
+ };
211
+ this.getServerSideVersionStatus = request => request.query.versionStatus || deliveryApi.getVersionStatusFromHeaders(request.headers) || deliveryApi.getVersionStatusFromHostname(request.hostname);
212
+ this.getVersionStatusFromHeaders = headers => {
213
+ const versionStatusHeader = headers['x-entry-versionstatus'];
214
+ if (typeof versionStatusHeader !== 'undefined') return versionStatusHeader;
215
+ return null;
216
+ };
217
+ this.getVersionStatusFromHostname = currentHostname => {
218
+ if (currentHostname.indexOf('localhost') > -1) return 'latest';
219
+ if (currentHostname.endsWith('contensis.cloud')) {
220
+ if (currentHostname.indexOf('preview.') > -1) {
221
+ return 'latest';
222
+ } else {
223
+ return 'published';
224
+ }
225
+ }
226
+ if (currentHostname.endsWith('cloud.contensis.com')) {
227
+ if (currentHostname.indexOf('preview-') > -1) {
228
+ return 'latest';
229
+ } else {
230
+ return 'published';
231
+ }
232
+ }
233
+ return 'published';
234
+ };
235
+ this.search = (query, linkDepth = 0, project) => {
236
+ const client = Client.create(getClientConfig(project, this.cookies));
237
+ return client.entries.search(query, typeof linkDepth !== 'undefined' ? linkDepth : 1);
238
+ };
239
+ this.getClient = (versionStatus = 'published', project) => {
240
+ const baseConfig = getClientConfig(project, this.cookies);
241
+ baseConfig.versionStatus = versionStatus;
242
+ return Client.create(baseConfig);
243
+ };
244
+ this.getEntry = (id, linkDepth = 0, versionStatus = 'published', project) => {
245
+ const baseConfig = getClientConfig(project, this.cookies);
246
+ baseConfig.versionStatus = versionStatus;
247
+ const client = Client.create(baseConfig);
248
+ // return client.entries.get(id, linkDepth);
249
+ return client.entries.get({
250
+ id,
251
+ linkDepth
252
+ });
253
+ };
254
+ this.cookies = cookies;
255
+ }
256
+ }
257
+ const deliveryApi = new DeliveryApi();
258
+
226
259
  export { cachedSearch as c, deliveryApi as d, getClientConfig as g };
227
- //# sourceMappingURL=ContensisDeliveryApi-5660ee0e.js.map
260
+ //# sourceMappingURL=ContensisDeliveryApi-5bb364b9.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ContensisDeliveryApi-5bb364b9.js","sources":["../src/user/util/CookieConstants.ts","../src/util/LruCache.js","../src/util/CachedDeliveryApi.ts","../src/util/ContensisDeliveryApi.ts"],"sourcesContent":["export const LOGIN_COOKIE = 'ContensisCMSUserName';\nexport const REFRESH_TOKEN_COOKIE = 'RefreshToken';\n\nexport type CookieObject = { [name: string]: any };\n\nexport const findLoginCookies = (cookies: CookieObject | string) =>\n typeof cookies === 'object'\n ? Object.fromEntries(\n Object.entries(cookies).filter(([name]) =>\n [LOGIN_COOKIE, REFRESH_TOKEN_COOKIE].includes(name)\n )\n )\n : cookies;\n","class CacheNode {\n constructor(key, value) {\n this.key = key;\n this.value = value;\n this.next = null;\n this.prev = null;\n }\n}\n\nexport class LruCache {\n constructor(limit = 100) {\n this.map = {};\n this.head = null;\n this.tail = null;\n this.limit = limit || 100;\n this.size = 0;\n }\n\n get(key) {\n if (this.map[key]) {\n let value = this.map[key].value;\n let node = new CacheNode(key, value);\n this.remove(key);\n this.setHead(node);\n return value;\n }\n }\n\n set(key, value) {\n let node = new CacheNode(key, value);\n if (this.map[key]) {\n this.remove(key);\n } else {\n if (this.size >= this.limit) {\n delete this.map[this.tail.key];\n this.size--;\n this.tail = this.tail.prev;\n this.tail.next = null;\n }\n }\n this.setHead(node);\n }\n\n setHead(node) {\n node.next = this.head;\n node.prev = null;\n if (this.head) {\n this.head.prev = node;\n }\n this.head = node;\n if (!this.tail) {\n this.tail = node;\n }\n this.size++;\n this.map[node.key] = node;\n }\n\n remove(key) {\n let node = this.map[key];\n if (!node) return; // This is sometimes null and crashes the container without this check\n\n if (node.prev) {\n node.prev.next = node.next;\n } else {\n this.head = node.next;\n }\n if (node.next) {\n node.next.prev = node.prev;\n } else {\n this.tail = node.prev;\n }\n delete this.map[key];\n this.size--;\n }\n}\n","import { VersionStatus } from 'contensis-core-api';\nimport { Client, Query } from 'contensis-delivery-api';\nimport {\n INodeOperations,\n NodeGetRootOptions,\n} from 'contensis-delivery-api/lib/models';\n\nimport { DeliveryApi, getClientConfig } from './ContensisDeliveryApi';\nimport { LruCache } from './LruCache';\nimport { CookieObject } from '~/user/util/CookieConstants';\n\n// CachedSearch does not cache results in SSR by design\nclass CachedSearch {\n cache = new LruCache();\n cookies?: CookieObject;\n\n constructor(cookies?: CookieObject) {\n this.cookies = cookies;\n }\n\n getClient(...args: Parameters<DeliveryApi['getClient']>) {\n return new DeliveryApi(this.cookies).getClient(...args);\n }\n\n search(query: Query, linkDepth = 0, project?: string) {\n const client = Client.create(getClientConfig(project, this.cookies));\n return this.request(\n `${project}+${JSON.stringify(query)}+${linkDepth}`,\n () => client.entries.search(query, linkDepth)\n );\n }\n\n searchUsingPost(query: Query, linkDepth = 0, project = '') {\n const client = Client.create(getClientConfig(project, this.cookies));\n return this.request(\n `${project}+${JSON.stringify(query)}+${linkDepth}`,\n () => (client.entries as any).searchUsingPost(query, linkDepth)\n );\n }\n\n get(\n id: string,\n linkDepth = 0,\n versionStatus: VersionStatus = 'published',\n project?: string\n ) {\n const client = Client.create(getClientConfig(project, this.cookies));\n client.clientConfig.versionStatus = versionStatus;\n return this.request(id, () => client.entries.get({ id, linkDepth }));\n }\n\n getContentType(id: string, project?: string) {\n const client = Client.create(getClientConfig(project, this.cookies));\n return this.request(`[CONTENT TYPE] ${id} ${project}`, () =>\n client.contentTypes.get(id)\n );\n }\n\n getRootNode(options: NodeGetRootOptions, project?: string) {\n const client = Client.create(getClientConfig(project, this.cookies));\n return this.request(`${project} / ${JSON.stringify(options)}`, () =>\n client.nodes.getRoot(options)\n );\n }\n\n getNode(options: Parameters<INodeOperations['get']>[0], project?: string) {\n const client = Client.create(getClientConfig(project, this.cookies));\n return this.request(\n `${project} ${\n options && typeof options !== 'string'\n ? 'path' in options\n ? options.path\n : options.id\n : options\n } ${JSON.stringify(options)}`,\n () => client.nodes.get(options)\n );\n }\n\n getAncestors(\n options: Parameters<INodeOperations['getAncestors']>[0],\n project?: string\n ) {\n const client = Client.create(getClientConfig(project, this.cookies));\n return this.request(\n `${project} [A] ${\n (options && typeof options !== 'string' && options.id) || options\n } ${JSON.stringify(options)}`,\n () => client.nodes.getAncestors(options)\n );\n }\n\n getChildren(\n options: Parameters<INodeOperations['getChildren']>[0],\n project?: string\n ) {\n const client = Client.create(getClientConfig(project, this.cookies));\n return this.request(\n `${project} [C] ${\n (options && typeof options !== 'string' && options.id) || options\n } ${JSON.stringify(options)}`,\n () => client.nodes.getChildren(options)\n );\n }\n\n getSiblings(\n options: Parameters<INodeOperations['getSiblings']>[0],\n project?: string\n ) {\n const client = Client.create(getClientConfig(project, this.cookies));\n return this.request(\n `${project} [S] ${\n (options && typeof options !== 'string' && options.id) || options\n } ${JSON.stringify(options)}`,\n () => client.nodes.getSiblings(options)\n );\n }\n\n request<T extends () => Promise<any>>(key: string, execute: T) {\n // do not cache results in SSR\n if (!this.cache.get(key) || typeof window == 'undefined') {\n const promise = execute();\n this.cache.set(key, promise);\n promise.catch(() => {\n this.cache.remove(key);\n });\n }\n return this.cache.get(key) as ReturnType<T>;\n }\n}\n\nexport const cachedSearch = new CachedSearch();\nexport const cachedSearchWithCookies = (cookies?: CookieObject) =>\n new CachedSearch(cookies);\n","import { VersionStatus } from 'contensis-core-api';\nimport { Client, Query } from 'contensis-delivery-api';\nimport { Config } from 'contensis-delivery-api/lib/models';\nimport { parse } from 'query-string';\nimport { setSurrogateKeys } from '~/routing/redux/actions';\nimport { reduxStore } from '~/redux/store/store';\nimport {\n selectCurrentHostname,\n selectCurrentPath,\n selectCurrentSearch,\n} from '~/routing/redux/selectors';\nimport { CookieObject, findLoginCookies } from '~/user/util/CookieConstants';\nimport { Request } from 'express';\nimport { IncomingHttpHeaders } from 'http';\n\nconst mapCookieHeader = (cookies: CookieObject | string) =>\n typeof cookies === 'object'\n ? Object.entries(cookies)\n .map(([name, value]) => `${name}=${value}`)\n .join('; ')\n : cookies;\n\nconst getSsrReferer = () => {\n if (typeof window === 'undefined') {\n const state = reduxStore.getState();\n const referer = `${selectCurrentHostname(state)}${selectCurrentPath(\n state\n )}${selectCurrentSearch(state)}`;\n\n return referer;\n }\n return '';\n};\n\nconst storeSurrogateKeys = (response: any) => {\n const keys = response.headers.get\n ? response.headers.get('surrogate-key')\n : response.headers.map['surrogate-key'];\n if (keys) reduxStore?.dispatch(setSurrogateKeys(keys, response.url));\n};\n\nexport const getClientConfig = (project?: string, cookies?: CookieObject) => {\n const config: Config = DELIVERY_API_CONFIG; /* global DELIVERY_API_CONFIG */\n config.responseHandler = {};\n\n if (project) {\n config.projectId = project;\n }\n\n // we only want the surrogate key header in a server context\n if (typeof window === 'undefined') {\n config.defaultHeaders = Object.assign(config.defaultHeaders || {}, {\n referer: getSsrReferer(),\n 'x-require-surrogate-key': true,\n 'x-crb-ssr': true, // add this for support tracing\n });\n config.responseHandler[200] = storeSurrogateKeys;\n }\n\n if (\n typeof window !== 'undefined' &&\n PROXY_DELIVERY_API /* global PROXY_DELIVERY_API */\n ) {\n // ensure a relative url is used to bypass the need for CORS (separate OPTIONS calls)\n config.rootUrl = '';\n config.responseHandler[404] = () => null;\n }\n\n if (cookies) {\n const cookieHeader = mapCookieHeader(findLoginCookies(cookies));\n if (cookieHeader) {\n config.defaultHeaders = Object.assign(config.defaultHeaders || {}, {\n Cookie: cookieHeader,\n });\n }\n }\n\n return config;\n};\n\n// export * from 'contensis-delivery-api';\n\ndeclare let window: Window &\n typeof globalThis & {\n versionStatus?: VersionStatus;\n };\n\nexport class DeliveryApi {\n cookies?: CookieObject;\n\n constructor(cookies?: CookieObject) {\n this.cookies = cookies;\n }\n\n getClientSideVersionStatus = () => {\n if (typeof window !== 'undefined') {\n // Allow overriding versionStatus with the querystring\n const { versionStatus } = parse(window.location.search);\n if (versionStatus) return versionStatus;\n // Client-side we will have a global variable set if rendered by SSR in production\n if (typeof window.versionStatus !== 'undefined')\n return window.versionStatus;\n // For localhost development we can only work out versionStatus from the current hostname\n const currentHostname = window.location.hostname;\n return this.getVersionStatusFromHostname(currentHostname);\n }\n return null;\n };\n\n getServerSideVersionStatus = (request: Request) =>\n request.query.versionStatus ||\n deliveryApi.getVersionStatusFromHeaders(request.headers) ||\n deliveryApi.getVersionStatusFromHostname(request.hostname);\n\n getVersionStatusFromHeaders = (headers: IncomingHttpHeaders) => {\n const versionStatusHeader = headers['x-entry-versionstatus'];\n if (typeof versionStatusHeader !== 'undefined') return versionStatusHeader;\n return null;\n };\n\n getVersionStatusFromHostname = (currentHostname: string) => {\n if (currentHostname.indexOf('localhost') > -1) return 'latest';\n\n if (currentHostname.endsWith('contensis.cloud')) {\n if (currentHostname.indexOf('preview.') > -1) {\n return 'latest';\n } else {\n return 'published';\n }\n }\n\n if (currentHostname.endsWith('cloud.contensis.com')) {\n if (currentHostname.indexOf('preview-') > -1) {\n return 'latest';\n } else {\n return 'published';\n }\n }\n\n return 'published';\n };\n\n search = (query: Query, linkDepth = 0, project?: string) => {\n const client = Client.create(getClientConfig(project, this.cookies));\n return client.entries.search(\n query,\n typeof linkDepth !== 'undefined' ? linkDepth : 1\n );\n };\n\n getClient = (versionStatus: VersionStatus = 'published', project) => {\n const baseConfig = getClientConfig(project, this.cookies);\n baseConfig.versionStatus = versionStatus;\n return Client.create(baseConfig);\n };\n\n getEntry = (\n id: string,\n linkDepth = 0,\n versionStatus: VersionStatus = 'published',\n project?: string\n ) => {\n const baseConfig = getClientConfig(project, this.cookies);\n baseConfig.versionStatus = versionStatus;\n const client = Client.create(baseConfig);\n // return client.entries.get(id, linkDepth);\n return client.entries.get({ id, linkDepth });\n };\n}\n\nexport const deliveryApi = new DeliveryApi();\n\nexport const deliveryApiWithCookies = (cookies?: CookieObject) =>\n new DeliveryApi(cookies);\n\nexport * from './CachedDeliveryApi';\n"],"names":["LOGIN_COOKIE","REFRESH_TOKEN_COOKIE","findLoginCookies","cookies","Object","fromEntries","entries","filter","name","includes","CacheNode","constructor","key","value","next","prev","LruCache","limit","map","head","tail","size","get","node","remove","setHead","set","CachedSearch","cache","getClient","args","DeliveryApi","search","query","linkDepth","project","client","Client","create","getClientConfig","request","JSON","stringify","searchUsingPost","id","versionStatus","clientConfig","getContentType","contentTypes","getRootNode","options","nodes","getRoot","getNode","path","getAncestors","getChildren","getSiblings","execute","window","promise","catch","cachedSearch","mapCookieHeader","join","getSsrReferer","state","reduxStore","getState","referer","selectCurrentHostname","selectCurrentPath","selectCurrentSearch","storeSurrogateKeys","response","keys","headers","dispatch","setSurrogateKeys","url","config","DELIVERY_API_CONFIG","responseHandler","projectId","defaultHeaders","assign","PROXY_DELIVERY_API","rootUrl","cookieHeader","Cookie","getClientSideVersionStatus","parse","location","currentHostname","hostname","getVersionStatusFromHostname","getServerSideVersionStatus","deliveryApi","getVersionStatusFromHeaders","versionStatusHeader","indexOf","endsWith","baseConfig","getEntry"],"mappings":";;;;;AAAO,MAAMA,YAAY,GAAG,sBAAsB,CAAA;AAC3C,MAAMC,oBAAoB,GAAG,cAAc,CAAA;AAI3C,MAAMC,gBAAgB,GAAIC,OAA8B,IAC7D,OAAOA,OAAO,KAAK,QAAQ,GACvBC,MAAM,CAACC,WAAW,CAChBD,MAAM,CAACE,OAAO,CAACH,OAAO,CAAC,CAACI,MAAM,CAAC,CAAC,CAACC,IAAI,CAAC,KACpC,CAACR,YAAY,EAAEC,oBAAoB,CAAC,CAACQ,QAAQ,CAACD,IAAI,CAAC,CACpD,CACF,GACDL,OAAO;;ACZb,MAAMO,SAAS,CAAC;AACdC,EAAAA,WAAWA,CAACC,GAAG,EAAEC,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,SAAS,GAAG,CAAC,CACjD,CAAA;KACF,CAAA;IAAA,IAEDL,CAAAA,SAAS,GAAG,CAACgB,aAA4B,GAAG,WAAW,EAAEV,OAAO,KAAK;MACnE,MAAMmE,UAAU,GAAG/D,eAAe,CAACJ,OAAO,EAAE,IAAI,CAAChC,OAAO,CAAC,CAAA;MACzDmG,UAAU,CAACzD,aAAa,GAAGA,aAAa,CAAA;AACxC,MAAA,OAAOR,MAAM,CAACC,MAAM,CAACgE,UAAU,CAAC,CAAA;KACjC,CAAA;AAAA,IAAA,IAAA,CAEDC,QAAQ,GAAG,CACT3D,EAAU,EACVV,SAAS,GAAG,CAAC,EACbW,aAA4B,GAAG,WAAW,EAC1CV,OAAgB,KACb;MACH,MAAMmE,UAAU,GAAG/D,eAAe,CAACJ,OAAO,EAAE,IAAI,CAAChC,OAAO,CAAC,CAAA;MACzDmG,UAAU,CAACzD,aAAa,GAAGA,aAAa,CAAA;AACxC,MAAA,MAAMT,MAAM,GAAGC,MAAM,CAACC,MAAM,CAACgE,UAAU,CAAC,CAAA;AACxC;AACA,MAAA,OAAOlE,MAAM,CAAC9B,OAAO,CAACgB,GAAG,CAAC;QAAEsB,EAAE;AAAEV,QAAAA,SAAAA;AAAU,OAAC,CAAC,CAAA;KAC7C,CAAA;IA5EC,IAAI,CAAC/B,OAAO,GAAGA,OAAO,CAAA;AACxB,GAAA;AA4EF,CAAA;AAEa8F,MAAAA,WAAW,GAAG,IAAIlE,WAAW;;;;"}
@@ -4,8 +4,8 @@ import { hot } from 'react-hot-loader';
4
4
  import { Route, useLocation, Redirect } from 'react-router-dom';
5
5
  import { matchRoutes, renderRoutes } from 'react-router-config';
6
6
  import { createSelector } from 'reselect';
7
- import { r as selectRouteEntryContentTypeId, a as selectRouteEntry, t as selectRouteIsError, u as selectIsNotFound, v as selectRouteLoading, k as selectMappedEntry, b as selectCurrentProject, w as selectCurrentPath, x as selectRouteStatusCode, y as selectRouteErrorMessage, z as setNavigationPath } from './selectors-74de49a3.js';
8
- import { a as selectUserIsAuthenticated, b as selectUserGroups, t as toJS, m as matchUserGroup } from './ToJs-9b30636a.js';
7
+ import { r as selectRouteEntryContentTypeId, a as selectRouteEntry, t as selectRouteIsError, u as selectIsNotFound, v as selectRouteLoading, k as selectMappedEntry, b as selectCurrentProject, w as selectCurrentPath, x as selectRouteStatusCode, y as selectRouteErrorMessage, z as setNavigationPath } from './selectors-ff21e98a.js';
8
+ import { a as selectUserIsAuthenticated, b as selectUserGroups, t as toJS, m as matchUserGroup } from './ToJs-7233c038.js';
9
9
 
10
10
  const NotFound = ({
11
11
  statusCode,
@@ -191,4 +191,4 @@ const mapDispatchToProps = {
191
191
  var RouteLoader$1 = hot(module)(connect(mapStateToPropsMemoized, mapDispatchToProps)(toJS(RouteLoader)));
192
192
 
193
193
  export { RouteLoader$1 as R };
194
- //# sourceMappingURL=RouteLoader-6eac364e.js.map
194
+ //# sourceMappingURL=RouteLoader-e6c2c8d6.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"RouteLoader-6eac364e.js","sources":["../src/routing/components/NotFound.tsx","../src/routing/components/Status.tsx","../src/routing/components/RouteLoader.tsx"],"sourcesContent":["import React from 'react';\n\nconst NotFound = ({\n statusCode,\n statusText,\n}: {\n statusCode: number;\n statusText: string;\n}) => (\n <>\n <header>\n <h1>{statusCode || '404'} Page Not Found</h1>\n {statusText && (\n <h2\n style={{\n background: '#eee',\n color: '#666',\n fontSize: '100%',\n padding: '10px',\n }}\n >\n {statusText}\n </h2>\n )}\n </header>\n </>\n);\n\nexport default NotFound;\n","import React, { PropsWithChildren } from 'react';\nimport { Route } from 'react-router-dom';\n\nexport const Status = ({\n code,\n children,\n}: PropsWithChildren<{ code: number }>) => {\n return (\n <Route\n render={({ staticContext }) => {\n if (staticContext) staticContext.statusCode = code;\n return children;\n }}\n />\n );\n};\n","import React, { useEffect, useCallback } from 'react';\nimport { connect } from 'react-redux';\nimport { hot } from 'react-hot-loader';\nimport { Redirect, useLocation } from 'react-router-dom';\nimport { renderRoutes, matchRoutes, RouteConfig } from 'react-router-config';\nimport { createSelector } from 'reselect';\n\nimport NotFound from './NotFound';\nimport { Status } from './Status';\n\nimport {\n selectCurrentPath,\n selectCurrentProject,\n selectIsNotFound,\n selectMappedEntry,\n selectRouteEntry,\n selectRouteEntryContentTypeId,\n selectRouteErrorMessage,\n selectRouteIsError,\n selectRouteLoading,\n selectRouteStatusCode,\n} from '../redux/selectors';\nimport { setNavigationPath } from '../redux/actions';\n\nimport {\n selectUserGroups,\n selectUserIsAuthenticated,\n} from '~/user/redux/selectors';\nimport { matchUserGroup } from '~/user/util/matchGroups';\n\nimport { toJS } from '~/util/ToJs';\nimport { Entry } from 'contensis-delivery-api/lib/models';\nimport { AppRootProps, RouteComponentProps, RouteLoaderProps } from '../routes';\n\nconst replaceDoubleSlashRecursive = (path: string) => {\n const nextPath = path.replace(/\\/\\//, '/');\n\n if (nextPath.match(/\\/\\//)) {\n return replaceDoubleSlashRecursive(nextPath);\n }\n\n return nextPath;\n};\n\nconst getTrimmedPath = path => {\n if (path !== '/') {\n const nextPath = replaceDoubleSlashRecursive(path);\n const lastChar = nextPath[nextPath.length - 1];\n if (lastChar === '/') {\n return nextPath.substring(0, nextPath.length - 1);\n }\n }\n return path;\n};\n\ninterface IReduxProps {\n contentTypeId: string | null;\n entry: Entry | null;\n isError: boolean;\n isNotFound: boolean;\n isLoading: boolean;\n isLoggedIn: boolean;\n mappedEntry: any;\n projectId: string;\n setNavigationPath: typeof setNavigationPath;\n statePath: string;\n statusCode: any;\n statusText: string;\n userGroups: any;\n}\n\nconst RouteLoader = ({\n contentTypeId,\n entry,\n isError,\n isLoading,\n isLoggedIn,\n isNotFound,\n loadingComponent,\n mappedEntry,\n notFoundComponent,\n projectId,\n routes,\n setNavigationPath,\n statePath,\n statusCode,\n statusText,\n userGroups,\n withEvents,\n trailingSlashRedirectCode = 302,\n}: AppRootProps & RouteLoaderProps & IReduxProps) => {\n const location = useLocation();\n // Always ensure paths are trimmed of trailing slashes so urls are always unique\n const trimmedPath = getTrimmedPath(location.pathname);\n\n // Match any Static Routes a developer has defined\n const matchedStaticRoute = () =>\n matchRoutes(routes.StaticRoutes as RouteConfig[], location.pathname);\n const isStaticRoute = () => matchedStaticRoute().length > 0;\n\n const staticRoute = isStaticRoute() && matchedStaticRoute()[0];\n const routeRequiresLogin = staticRoute && staticRoute.route.requireLogin;\n\n const setPath = useCallback(() => {\n // Use serverPath to control the path we send to siteview node api to resolve a route\n let serverPath = '';\n if (staticRoute && staticRoute.match && staticRoute.match.isExact) {\n const { match, route } = staticRoute;\n\n if (route.path?.includes('*')) {\n // Send the whole url to api if we have matched route containing wildcard\n serverPath = match.url;\n } else if (typeof route.fetchNodeLevel === 'number') {\n // Send all url parts to a specified level to api\n serverPath = match.url\n .split('/')\n .splice(0, route.fetchNodeLevel + 1)\n .join('/');\n } else if (route.fetchNode?.params) {\n const fetchNodeParams: string[] = route.fetchNode.params;\n const routeParams: { [key: string]: string } = match.params;\n\n const regexExp = new RegExp(\n Object.keys(routeParams)\n .map(p => `:${p}`)\n .join('|'),\n 'g'\n );\n\n serverPath = match.path\n .replace(/\\?/g, '')\n .replace(regexExp, matched => {\n const param = matched.replace(':', '');\n if (fetchNodeParams.includes(param)) return routeParams[param];\n else return '';\n })\n .replace(/\\/$/, '');\n } else {\n // Send all non-parameterised url parts to api\n serverPath = (route.path as string)\n ?.split('/')\n .filter(p => !p.startsWith(':'))\n .join('/');\n }\n }\n\n setNavigationPath(\n serverPath || trimmedPath,\n location,\n staticRoute,\n withEvents,\n statePath,\n routes\n );\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [\n setNavigationPath,\n // staticRoute,\n withEvents,\n location,\n routes,\n // statePath,\n trimmedPath,\n ]);\n\n if (typeof window == 'undefined') setPath();\n\n useEffect(() => {\n setPath();\n }, [location, setPath]);\n\n // Need to redirect when url endswith a /\n if (location.pathname.length > trimmedPath.length) {\n return (\n <Status code={trailingSlashRedirectCode}>\n <Redirect to={`${trimmedPath}${location.search}${location.hash}`} />\n </Status>\n );\n }\n\n // Render any Static Routes a developer has defined\n if (isStaticRoute() && !(!isLoggedIn && routeRequiresLogin)) {\n if (matchUserGroup(userGroups, routeRequiresLogin))\n return renderRoutes(\n routes.StaticRoutes as RouteConfig[],\n {\n projectId,\n contentTypeId,\n entry,\n mappedEntry,\n isLoggedIn,\n } as RouteComponentProps\n );\n }\n\n // Render a supplied Loading component if the route\n // is not a static route and is in a loading state\n if (isLoading && !isNotFound && loadingComponent) {\n const LoadingComponent = loadingComponent;\n return <LoadingComponent />;\n }\n\n // Match any defined Content Type Mappings\n if (contentTypeId && !(!isLoggedIn && routeRequiresLogin)) {\n const MatchedComponent = routes.ContentTypeMappings.find(\n item => item.contentTypeID === contentTypeId\n );\n\n if (MatchedComponent && !(MatchedComponent.requireLogin && !isLoggedIn)) {\n if (matchUserGroup(userGroups, MatchedComponent.requireLogin))\n return (\n <MatchedComponent.component\n projectId={projectId}\n contentTypeId={contentTypeId}\n entry={entry}\n mappedEntry={mappedEntry}\n isLoggedIn={isLoggedIn}\n />\n );\n }\n }\n\n const NotFoundComponent = notFoundComponent ? notFoundComponent : NotFound;\n if (isNotFound || isError) {\n return (\n <Status code={statusCode}>\n <NotFoundComponent statusCode={statusCode} statusText={statusText} />\n </Status>\n );\n }\n\n return null;\n};\nconst mapStateToPropsMemoized = createSelector(\n selectRouteEntryContentTypeId,\n selectRouteEntry,\n selectRouteIsError,\n selectIsNotFound,\n selectRouteLoading,\n selectUserIsAuthenticated,\n selectMappedEntry,\n selectCurrentProject,\n selectCurrentPath,\n selectRouteStatusCode,\n selectRouteErrorMessage,\n selectUserGroups,\n (\n contentTypeId,\n entry,\n isError,\n isNotFound,\n isLoading,\n isLoggedIn,\n mappedEntry,\n projectId,\n statePath,\n statusCode,\n statusText,\n userGroups\n ) => ({\n contentTypeId,\n entry,\n isError,\n isNotFound,\n isLoading,\n isLoggedIn,\n mappedEntry,\n projectId,\n statePath,\n statusCode,\n statusText,\n userGroups,\n })\n);\n\nconst mapDispatchToProps = {\n setNavigationPath,\n};\n\nexport default hot(module)(\n connect(mapStateToPropsMemoized, mapDispatchToProps)(toJS(RouteLoader))\n) as unknown as (props: AppRootProps & RouteLoaderProps) => JSX.Element;\n"],"names":["NotFound","statusCode","statusText","React","createElement","Fragment","style","background","color","fontSize","padding","Status","code","children","Route","render","staticContext","replaceDoubleSlashRecursive","path","nextPath","replace","match","getTrimmedPath","lastChar","length","substring","RouteLoader","contentTypeId","entry","isError","isLoading","isLoggedIn","isNotFound","loadingComponent","mappedEntry","notFoundComponent","projectId","routes","setNavigationPath","statePath","userGroups","withEvents","trailingSlashRedirectCode","location","useLocation","trimmedPath","pathname","matchedStaticRoute","matchRoutes","StaticRoutes","isStaticRoute","staticRoute","routeRequiresLogin","route","requireLogin","setPath","useCallback","serverPath","isExact","_route$path","_route$fetchNode","includes","url","fetchNodeLevel","split","splice","join","fetchNode","params","fetchNodeParams","routeParams","regexExp","RegExp","Object","keys","map","p","matched","param","_route$path2","filter","startsWith","window","useEffect","Redirect","to","search","hash","matchUserGroup","renderRoutes","LoadingComponent","MatchedComponent","ContentTypeMappings","find","item","contentTypeID","component","NotFoundComponent","mapStateToPropsMemoized","createSelector","selectRouteEntryContentTypeId","selectRouteEntry","selectRouteIsError","selectIsNotFound","selectRouteLoading","selectUserIsAuthenticated","selectMappedEntry","selectCurrentProject","selectCurrentPath","selectRouteStatusCode","selectRouteErrorMessage","selectUserGroups","mapDispatchToProps","hot","module","connect","toJS"],"mappings":";;;;;;;;;AAEA,MAAMA,QAAQ,GAAGA,CAAC;EAChBC,UAAU;AACVC,EAAAA,UAAAA;AAIF,CAAC,kBACCC,KAAA,CAAAC,aAAA,CAAAD,KAAA,CAAAE,QAAA,EACEF,IAAAA,eAAAA,KAAA,CAAAC,aAAA,CACED,QAAAA,EAAAA,IAAAA,eAAAA,KAAA,CAAAC,aAAA,CAAKH,IAAAA,EAAAA,IAAAA,EAAAA,UAAU,IAAI,KA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uBAAuB,EAAEc,kBAAkB,CAAC,CAACI,IAAI,CAAC1F,WAAW,CAAC,CAAC,CACxE;;;;"}
1
+ {"version":3,"file":"RouteLoader-e6c2c8d6.js","sources":["../src/routing/components/NotFound.tsx","../src/routing/components/Status.tsx","../src/routing/components/RouteLoader.tsx"],"sourcesContent":["import React from 'react';\n\nconst NotFound = ({\n statusCode,\n statusText,\n}: {\n statusCode: number;\n statusText: string;\n}) => (\n <>\n <header>\n <h1>{statusCode || '404'} Page Not Found</h1>\n {statusText && (\n <h2\n style={{\n background: '#eee',\n color: '#666',\n fontSize: '100%',\n padding: '10px',\n }}\n >\n {statusText}\n </h2>\n )}\n </header>\n </>\n);\n\nexport default NotFound;\n","import React, { PropsWithChildren } from 'react';\nimport { Route } from 'react-router-dom';\n\nexport const Status = ({\n code,\n children,\n}: PropsWithChildren<{ code: number }>) => {\n return (\n <Route\n render={({ staticContext }) => {\n if (staticContext) staticContext.statusCode = code;\n return children;\n }}\n />\n );\n};\n","import React, { useEffect, useCallback } from 'react';\nimport { connect } from 'react-redux';\nimport { hot } from 'react-hot-loader';\nimport { Redirect, useLocation } from 'react-router-dom';\nimport { renderRoutes, matchRoutes, RouteConfig } from 'react-router-config';\nimport { createSelector } from 'reselect';\n\nimport NotFound from './NotFound';\nimport { Status } from './Status';\n\nimport {\n selectCurrentPath,\n selectCurrentProject,\n selectIsNotFound,\n selectMappedEntry,\n selectRouteEntry,\n selectRouteEntryContentTypeId,\n selectRouteErrorMessage,\n selectRouteIsError,\n selectRouteLoading,\n selectRouteStatusCode,\n} from '../redux/selectors';\nimport { setNavigationPath } from '../redux/actions';\n\nimport {\n selectUserGroups,\n selectUserIsAuthenticated,\n} from '~/user/redux/selectors';\nimport { matchUserGroup } from '~/user/util/matchGroups';\n\nimport { toJS } from '~/util/ToJs';\nimport { Entry } from 'contensis-delivery-api/lib/models';\nimport { AppRootProps, RouteComponentProps, RouteLoaderProps } from '../routes';\n\nconst replaceDoubleSlashRecursive = (path: string) => {\n const nextPath = path.replace(/\\/\\//, '/');\n\n if (nextPath.match(/\\/\\//)) {\n return replaceDoubleSlashRecursive(nextPath);\n }\n\n return nextPath;\n};\n\nconst getTrimmedPath = path => {\n if (path !== '/') {\n const nextPath = replaceDoubleSlashRecursive(path);\n const lastChar = nextPath[nextPath.length - 1];\n if (lastChar === '/') {\n return nextPath.substring(0, nextPath.length - 1);\n }\n }\n return path;\n};\n\ninterface IReduxProps {\n contentTypeId: string | null;\n entry: Entry | null;\n isError: boolean;\n isNotFound: boolean;\n isLoading: boolean;\n isLoggedIn: boolean;\n mappedEntry: any;\n projectId: string;\n setNavigationPath: typeof setNavigationPath;\n statePath: string;\n statusCode: any;\n statusText: string;\n userGroups: any;\n}\n\nconst RouteLoader = ({\n contentTypeId,\n entry,\n isError,\n isLoading,\n isLoggedIn,\n isNotFound,\n loadingComponent,\n mappedEntry,\n notFoundComponent,\n projectId,\n routes,\n setNavigationPath,\n statePath,\n statusCode,\n statusText,\n userGroups,\n withEvents,\n trailingSlashRedirectCode = 302,\n}: AppRootProps & RouteLoaderProps & IReduxProps) => {\n const location = useLocation();\n // Always ensure paths are trimmed of trailing slashes so urls are always unique\n const trimmedPath = getTrimmedPath(location.pathname);\n\n // Match any Static Routes a developer has defined\n const matchedStaticRoute = () =>\n matchRoutes(routes.StaticRoutes as RouteConfig[], location.pathname);\n const isStaticRoute = () => matchedStaticRoute().length > 0;\n\n const staticRoute = isStaticRoute() && matchedStaticRoute()[0];\n const routeRequiresLogin = staticRoute && staticRoute.route.requireLogin;\n\n const setPath = useCallback(() => {\n // Use serverPath to control the path we send to siteview node api to resolve a route\n let serverPath = '';\n if (staticRoute && staticRoute.match && staticRoute.match.isExact) {\n const { match, route } = staticRoute;\n\n if (route.path?.includes('*')) {\n // Send the whole url to api if we have matched route containing wildcard\n serverPath = match.url;\n } else if (typeof route.fetchNodeLevel === 'number') {\n // Send all url parts to a specified level to api\n serverPath = match.url\n .split('/')\n .splice(0, route.fetchNodeLevel + 1)\n .join('/');\n } else if (route.fetchNode?.params) {\n const fetchNodeParams: string[] = route.fetchNode.params;\n const routeParams: { [key: string]: string } = match.params;\n\n const regexExp = new RegExp(\n Object.keys(routeParams)\n .map(p => `:${p}`)\n .join('|'),\n 'g'\n );\n\n serverPath = match.path\n .replace(/\\?/g, '')\n .replace(regexExp, matched => {\n const param = matched.replace(':', '');\n if (fetchNodeParams.includes(param)) return routeParams[param];\n else return '';\n })\n .replace(/\\/$/, '');\n } else {\n // Send all non-parameterised url parts to api\n serverPath = (route.path as string)\n ?.split('/')\n .filter(p => !p.startsWith(':'))\n .join('/');\n }\n }\n\n setNavigationPath(\n serverPath || trimmedPath,\n location,\n staticRoute,\n withEvents,\n statePath,\n routes\n );\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [\n setNavigationPath,\n // staticRoute,\n withEvents,\n location,\n routes,\n // statePath,\n trimmedPath,\n ]);\n\n if (typeof window == 'undefined') setPath();\n\n useEffect(() => {\n setPath();\n }, [location, setPath]);\n\n // Need to redirect when url endswith a /\n if (location.pathname.length > trimmedPath.length) {\n return (\n <Status code={trailingSlashRedirectCode}>\n <Redirect to={`${trimmedPath}${location.search}${location.hash}`} />\n </Status>\n );\n }\n\n // Render any Static Routes a developer has defined\n if (isStaticRoute() && !(!isLoggedIn && routeRequiresLogin)) {\n if (matchUserGroup(userGroups, routeRequiresLogin))\n return renderRoutes(\n routes.StaticRoutes as RouteConfig[],\n {\n projectId,\n contentTypeId,\n entry,\n mappedEntry,\n isLoggedIn,\n } as RouteComponentProps\n );\n }\n\n // Render a supplied Loading component if the route\n // is not a static route and is in a loading state\n if (isLoading && !isNotFound && loadingComponent) {\n const LoadingComponent = loadingComponent;\n return <LoadingComponent />;\n }\n\n // Match any defined Content Type Mappings\n if (contentTypeId && !(!isLoggedIn && routeRequiresLogin)) {\n const MatchedComponent = routes.ContentTypeMappings.find(\n item => item.contentTypeID === contentTypeId\n );\n\n if (MatchedComponent && !(MatchedComponent.requireLogin && !isLoggedIn)) {\n if (matchUserGroup(userGroups, MatchedComponent.requireLogin))\n return (\n <MatchedComponent.component\n projectId={projectId}\n contentTypeId={contentTypeId}\n entry={entry}\n mappedEntry={mappedEntry}\n isLoggedIn={isLoggedIn}\n />\n );\n }\n }\n\n const NotFoundComponent = notFoundComponent ? notFoundComponent : NotFound;\n if (isNotFound || isError) {\n return (\n <Status code={statusCode}>\n <NotFoundComponent statusCode={statusCode} statusText={statusText} />\n </Status>\n );\n }\n\n return null;\n};\nconst mapStateToPropsMemoized = createSelector(\n selectRouteEntryContentTypeId,\n selectRouteEntry,\n selectRouteIsError,\n selectIsNotFound,\n selectRouteLoading,\n selectUserIsAuthenticated,\n selectMappedEntry,\n selectCurrentProject,\n selectCurrentPath,\n selectRouteStatusCode,\n selectRouteErrorMessage,\n selectUserGroups,\n (\n contentTypeId,\n entry,\n isError,\n isNotFound,\n isLoading,\n isLoggedIn,\n mappedEntry,\n projectId,\n statePath,\n statusCode,\n statusText,\n userGroups\n ) => ({\n contentTypeId,\n entry,\n isError,\n isNotFound,\n isLoading,\n isLoggedIn,\n mappedEntry,\n projectId,\n statePath,\n statusCode,\n statusText,\n userGroups,\n })\n);\n\nconst mapDispatchToProps = {\n setNavigationPath,\n};\n\nexport default hot(module)(\n connect(mapStateToPropsMemoized, mapDispatchToProps)(toJS(RouteLoader))\n) as unknown as (props: AppRootProps & RouteLoaderProps) => JSX.Element;\n"],"names":["NotFound","statusCode","statusText","React","createElement","Fragment","style","background","color","fontSize","padding","Status","code","children","Route","render","staticContext","replaceDoubleSlashRecursive","path","nextPath","replace","match","getTrimmedPath","lastChar","length","substring","RouteLoader","contentTypeId","entry","isError","isLoading","isLoggedIn","isNotFound","loadingComponent","mappedEntry","notFoundComponent","projectId","routes","setNavigationPath","statePath","userGroups","withEvents","trailingSlashRedirectCode","location","useLocation","trimmedPath","pathname","matchedStaticRoute","matchRoutes","StaticRoutes","isStaticRoute","staticRoute","routeRequiresLogin","route","requireLogin","setPath","useCallback","serverPath","isExact","_route$path","_route$fetchNode","includes","url","fetchNodeLevel","split","splice","join","fetchNode","params","fetchNodeParams","routeParams","regexExp","RegExp","Object","keys","map","p","matched","param","_route$path2","filter","startsWith","window","useEffect","Redirect","to","search","hash","matchUserGroup","renderRoutes","LoadingComponent","MatchedComponent","ContentTypeMappings","find","item","contentTypeID","component","NotFoundComponent","mapStateToPropsMemoized","createSelector","selectRouteEntryContentTypeId","selectRouteEntry","selectRouteIsError","selectIsNotFound","selectRouteLoading","selectUserIsAuthenticated","selectMappedEntry","selectCurrentProject","selectCurrentPath","selectRouteStatusCode","selectRouteErrorMessage","selectUserGroups","mapDispatchToProps","hot","module","connect","toJS"],"mappings":";;;;;;;;;AAEA,MAAMA,QAAQ,GAAGA,CAAC;EAChBC,UAAU;AACVC,EAAAA,UAAAA;AAIF,CAAC,kBACCC,KAAA,CAAAC,aAAA,CAAAD,KAAA,CAAAE,QAAA,EACEF,IAAAA,eAAAA,KAAA,CAAAC,aAAA,CACED,QAAAA,EAAAA,IAAAA,eAAAA,KAAA,CAAAC,aAAA,CAAKH,IAAAA,EAAAA,IAAAA,EAAAA,UAAU,IAAI,KAAK,EAAC,iBAAe,CAAK,EAC5CC,UAAU,iBACTC,KAAA,CAAAC,aAAA,CAAA,IAAA,EAAA;AACEE,EAAAA,KAAK,EAAE;AACLC,IAAAA,UAAU,EAAE,MAAM;AAClBC,IAAAA,KAAK,EAAE,MAAM;AACbC,IAAAA,QAAQ,EAAE,MAAM;AAChBC,IAAAA,OAAO,EAAE,MAAA;AACX,GAAA;AAAE,CAEDR,EAAAA,UAAU,CAEd,CACM,CAEZ;;ACvBM,MAAMS,MAAM,GAAGA,CAAC;EACrBC,IAAI;AACJC,EAAAA,QAAAA;AACmC,CAAC,KAAK;AACzC,EAAA,oBACEV,KAAA,CAAAC,aAAA,CAACU,KAAK,EAAA;AACJC,IAAAA,MAAM,EAAEA,CAAC;AAAEC,MAAAA,aAAAA;AAAc,KAAC,KAAK;AAC7B,MAAA,IA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ACb,CAAC,CAAA;AACD,MAAMgG,uBAAuB,GAAGC,cAAc,CAC5CC,6BAA6B,EAC7BC,gBAAgB,EAChBC,kBAAkB,EAClBC,gBAAgB,EAChBC,kBAAkB,EAClBC,yBAAyB,EACzBC,iBAAiB,EACjBC,oBAAoB,EACpBC,iBAAiB,EACjBC,qBAAqB,EACrBC,uBAAuB,EACvBC,gBAAgB,EAChB,CACEpF,aAAa,EACbC,KAAK,EACLC,OAAO,EACPG,UAAU,EACVF,SAAS,EACTC,UAAU,EACVG,WAAW,EACXE,SAAS,EACTG,SAAS,EACTtC,UAAU,EACVC,UAAU,EACVsC,UAAU,MACN;EACJb,aAAa;EACbC,KAAK;EACLC,OAAO;EACPG,UAAU;EACVF,SAAS;EACTC,UAAU;EACVG,WAAW;EACXE,SAAS;EACTG,SAAS;EACTtC,UAAU;EACVC,UAAU;AACVsC,EAAAA,UAAAA;AACF,CAAC,CAAC,CACH,CAAA;AAED,MAAMwE,kBAAkB,GAAG;AACzB1E,EAAAA,iBAAAA;AACF,CAAC,CAAA;AAED,oBAAe2E,GAAG,CAACC,MAAM,CAAC,CACxBC,OAAO,CAACjB,uBAAuB,EAAEc,kBAAkB,CAAC,CAACI,IAAI,CAAC1F,WAAW,CAAC,CAAC,CACxE;;;;"}
@@ -1,4 +1,4 @@
1
- import { g as getImmutableOrJS } from './selectors-74de49a3.js';
1
+ import { g as getImmutableOrJS } from './selectors-ff21e98a.js';
2
2
  import React from 'react';
3
3
 
4
4
  const selectUserIsLoading = state => getImmutableOrJS(state, ['user', 'authenticationState', 'isLoading']);
@@ -95,4 +95,4 @@ const toJS = WrappedComponent => wrappedComponentProps => {
95
95
  };
96
96
 
97
97
  export { selectUserIsAuthenticated as a, selectUserGroups as b, selectUserErrorMessage as c, selectUserIsAuthenticationError as d, selectUserIsError as e, selectUserIsLoading as f, selectUser as g, selectUserRegistrationError as h, selectUserRegistrationIsLoading as i, selectUserRegistrationIsSuccess as j, selectUserRegistration as k, selectPasswordResetRequestSending as l, matchUserGroup as m, selectPasswordResetRequestSent as n, selectPasswordResetRequestError as o, selectResetPasswordSending as p, selectResetPasswordSent as q, selectResetPasswordError as r, selectClientCredentials as s, toJS as t, selectChangePasswordSending as u, selectChangePasswordSent as v, selectUserGuid as w, selectChangePasswordError as x, selectors as y };
98
- //# sourceMappingURL=ToJs-9b30636a.js.map
98
+ //# sourceMappingURL=ToJs-7233c038.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ToJs-9b30636a.js","sources":["../src/user/redux/selectors.ts","../src/user/util/matchGroups.ts","../src/util/ToJs.tsx"],"sourcesContent":["import { StateType } from '~/config';\nimport { AppState } from '~/redux/appstate';\nimport { getImmutableOrJS as getIn } from '~/redux/util';\n\nexport const selectUserIsLoading = (state: AppState) =>\n getIn(state, ['user', 'authenticationState', 'isLoading']);\n\nexport const selectUserIsAuthenticated = (state: AppState) =>\n getIn(state, ['user', 'authenticationState', 'isAuthenticated']);\n\nexport const selectUserIsAuthenticationError = (state: AppState) =>\n getIn(state, ['user', 'authenticationState', 'isAuthenticationError']);\n\nexport const selectUserIsError = (state: AppState) =>\n getIn(state, ['user', 'authenticationState', 'isError']);\n\n/**\n * DEPRECATED 12/2021 - use selectUserErrorMessage instead\n * @param state AppState\n * @returns string\n */\nexport const selectUserAuthenticationErrorMessage = (state: AppState) =>\n getIn(state, ['user', 'authenticationState', 'errorMessage']);\n\nexport const selectUserErrorMessage = (state: AppState) =>\n getIn(state, ['user', 'authenticationState', 'errorMessage']);\n\nexport const selectClientCredentials = (\n state: AppState,\n returnType?: StateType\n) =>\n getIn(\n state,\n ['user', 'authenticationState', 'clientCredentials'],\n {},\n returnType\n );\n\nexport const selectUser = (state: AppState, returnType?: StateType) =>\n getIn(state, 'user', {}, returnType);\n\nexport const selectUserIsZengentiStaff = (state: AppState) =>\n getIn(state, ['user', 'isZengentiStaff']);\n\nexport const selectUserGuid = (state: AppState) => getIn(state, ['user', 'id']);\n\nexport const selectUsername = (state: AppState) =>\n getIn(state, ['user', 'username']);\n\nexport const selectUserEmail = (state: AppState) =>\n getIn(state, ['user', 'email']);\n\nexport const selectUserGroups = (state: AppState, returnType?: StateType) =>\n getIn(state, ['user', 'groups'], [], returnType);\n\nexport const selectUserSecurityToken = (state: AppState) =>\n getIn(state, [\n 'user',\n 'authenticationState',\n 'clientCredentials',\n 'contensisClassicToken',\n ]);\n\nexport const selectUserRegistration = (\n state: AppState,\n returnType?: StateType\n) => getIn(state, ['user', 'registration'], {}, returnType);\n\nexport const selectUserRegistrationError = (state: AppState) =>\n getIn(state, ['user', 'registration', 'error'], false);\n\nexport const selectUserRegistrationIsLoading = (state: AppState) =>\n getIn(state, ['user', 'registration', 'isLoading'], false);\n\nexport const selectUserRegistrationIsSuccess = (state: AppState) =>\n getIn(state, ['user', 'registration', 'success'], false);\n\nexport const selectPasswordResetRequestSending = (state: AppState) =>\n getIn(state, ['user', 'passwordResetRequest', 'isSending']);\n\nexport const selectPasswordResetRequestSent = (state: AppState) =>\n getIn(state, ['user', 'passwordResetRequest', 'sent']);\n\nexport const selectPasswordResetRequestError = (state: AppState) =>\n getIn(state, ['user', 'passwordResetRequest', 'error']);\n\nexport const selectResetPasswordSending = (state: AppState) =>\n getIn(state, ['user', 'resetPassword', 'isSending']);\n\nexport const selectResetPasswordSent = (state: AppState) =>\n getIn(state, ['user', 'resetPassword', 'sent']);\n\nexport const selectResetPasswordError = (state: AppState) =>\n getIn(state, ['user', 'resetPassword', 'error']);\n\nexport const selectChangePasswordSending = (state: AppState) =>\n getIn(state, ['user', 'changePassword', 'isSending']);\n\nexport const selectChangePasswordSent = (state: AppState) =>\n getIn(state, ['user', 'changePassword', 'sent']);\n\nexport const selectChangePasswordError = (state: AppState) =>\n getIn(state, ['user', 'changePassword', 'error']);\n","import { Group } from 'contensis-management-api/lib/models';\nimport { RequireLogin } from '~/routing/routes';\n\nexport const matchUserGroup = (\n userGroups: Group[] = [],\n requiredGroups: RequireLogin = []\n) => {\n if (\n !Array.isArray(requiredGroups) ||\n (Array.isArray(requiredGroups) && requiredGroups.length === 0)\n )\n return true;\n\n const groupMatch = requiredGroups.some(requiredGroup => {\n return userGroups.some(userGroup => {\n if (requiredGroup.id === userGroup.id) {\n return true;\n }\n if (requiredGroup.name === userGroup.name) {\n return true;\n }\n });\n });\n return groupMatch;\n};\n","/* eslint-disable react/display-name */\n/* eslint-disable @typescript-eslint/naming-convention */\nimport React from 'react';\n\nexport const toJS =\n <Props extends { [key: string]: any }>(\n WrappedComponent: React.ComponentType<Props>\n ): React.ComponentType<Props> =>\n (wrappedComponentProps: Props) => {\n const KEY = 0;\n const VALUE = 1;\n\n const propsJS = Object.entries(wrappedComponentProps).reduce<Props>(\n (newProps: any, wrappedComponentProp) => {\n const propKey = wrappedComponentProp[KEY];\n const propValue = wrappedComponentProp[VALUE];\n newProps[propKey] =\n propValue && typeof propValue === 'object' && 'toJS' in propValue\n ? propValue.toJS()\n : propValue;\n return newProps as Props;\n },\n {} as Props\n );\n\n return <WrappedComponent {...propsJS} />;\n };\n"],"names":["selectUserIsLoading","state","getIn","selectUserIsAuthenticated","selectUserIsAuthenticationError","selectUserIsError","selectUserAuthenticationErrorMessage","selectUserErrorMessage","selectClientCredentials","returnType","selectUser","selectUserIsZengentiStaff","selectUserGuid","selectUsername","selectUserEmail","selectUserGroups","selectUserSecurityToken","selectUserRegistration","selectUserRegistrationError","selectUserRegistrationIsLoading","selectUserRegistrationIsSuccess","selectPasswordResetRequestSending","selectPasswordResetRequestSent","selectPasswordResetRequestError","selectResetPasswordSending","selectResetPasswordSent","selectResetPasswordError","selectChangePasswordSending","selectChangePasswordSent","selectChangePasswordError","matchUserGroup","userGroups","requiredGroups","Array","isArray","length","groupMatch","some","requiredGroup","userGroup","id","name","toJS","WrappedComponent","wrappedComponentProps","KEY","VALUE","propsJS","Object","entries","reduce","newProps","wrappedComponentProp","propKey","propValue","React","createElement"],"mappings":";;;MAIaA,mBAAmB,GAAIC,KAAe,IACjDC,gBAAK,CAACD,KAAK,EAAE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,EAAE,EAAE;AACrC,QAAA,OAAO,IAAI,CAAA;AACb,OAAA;AACA,MAAA,IAAIF,aAAa,CAACG,IAAI,KAAKF,SAAS,CAACE,IAAI,EAAE;AACzC,QAAA,OAAO,IAAI,CAAA;AACb,OAAA;AACF,KAAC,CAAC,CAAA;AACJ,GAAC,CAAC,CAAA;AACF,EAAA,OAAOL,UAAU,CAAA;AACnB;;ACxBA;MAIaM,IAAI,GAEbC,gBAA4C,IAE7CC,qBAA4B,IAAK;EAChC,MAAMC,GAAG,GAAG,CAAC,CAAA;EACb,MAAMC,KAAK,GAAG,CAAC,CAAA;AAEf,EAAA,MAAMC,OAAO,GAAGC,MAAM,CAACC,OAAO,CAACL,qBAAqB,CAAC,CAACM,MAAM,CAC1D,CAACC,QAAa,EAAEC,oBAAoB,KAAK;AACvC,IAAA,MAAMC,OAAO,GAAGD,oBAAoB,CAACP,GAAG,CAAC,CAAA;AACzC,IAAA,MAAMS,SAAS,GAAGF,oBAAoB,CAACN,KAAK,CAAC,CAAA;IAC7CK,QAAQ,CAACE,OAAO,CAAC,GACfC,SAAS,IAAI,OAAOA,SAAS,KAAK,QAAQ,IAAI,MAAM,IAAIA,SAAS,GAC7DA,SAAS,CAACZ,IAAI,EAAE,GAChBY,SAAS,CAAA;AACf,IAAA,OAAOH,QAAQ,CAAA;GAChB,EACD,EAAE,CACH,CAAA;AAED,EAAA,oBAAOI,KAAA,CAAAC,aAAA,CAACb,gBAAgB,EAAKI,OAAO,CAAI,CAAA;AAC1C;;;;"}
1
+ {"version":3,"file":"ToJs-7233c038.js","sources":["../src/user/redux/selectors.ts","../src/user/util/matchGroups.ts","../src/util/ToJs.tsx"],"sourcesContent":["import { StateType } from '~/config';\nimport { AppState } from '~/redux/appstate';\nimport { getImmutableOrJS as getIn } from '~/redux/util';\n\nexport const selectUserIsLoading = (state: AppState) =>\n getIn(state, ['user', 'authenticationState', 'isLoading']);\n\nexport const selectUserIsAuthenticated = (state: AppState) =>\n getIn(state, ['user', 'authenticationState', 'isAuthenticated']);\n\nexport const selectUserIsAuthenticationError = (state: AppState) =>\n getIn(state, ['user', 'authenticationState', 'isAuthenticationError']);\n\nexport const selectUserIsError = (state: AppState) =>\n getIn(state, ['user', 'authenticationState', 'isError']);\n\n/**\n * DEPRECATED 12/2021 - use selectUserErrorMessage instead\n * @param state AppState\n * @returns string\n */\nexport const selectUserAuthenticationErrorMessage = (state: AppState) =>\n getIn(state, ['user', 'authenticationState', 'errorMessage']);\n\nexport const selectUserErrorMessage = (state: AppState) =>\n getIn(state, ['user', 'authenticationState', 'errorMessage']);\n\nexport const selectClientCredentials = (\n state: AppState,\n returnType?: StateType\n) =>\n getIn(\n state,\n ['user', 'authenticationState', 'clientCredentials'],\n {},\n returnType\n );\n\nexport const selectUser = (state: AppState, returnType?: StateType) =>\n getIn(state, 'user', {}, returnType);\n\nexport const selectUserIsZengentiStaff = (state: AppState) =>\n getIn(state, ['user', 'isZengentiStaff']);\n\nexport const selectUserGuid = (state: AppState) => getIn(state, ['user', 'id']);\n\nexport const selectUsername = (state: AppState) =>\n getIn(state, ['user', 'username']);\n\nexport const selectUserEmail = (state: AppState) =>\n getIn(state, ['user', 'email']);\n\nexport const selectUserGroups = (state: AppState, returnType?: StateType) =>\n getIn(state, ['user', 'groups'], [], returnType);\n\nexport const selectUserSecurityToken = (state: AppState) =>\n getIn(state, [\n 'user',\n 'authenticationState',\n 'clientCredentials',\n 'contensisClassicToken',\n ]);\n\nexport const selectUserRegistration = (\n state: AppState,\n returnType?: StateType\n) => getIn(state, ['user', 'registration'], {}, returnType);\n\nexport const selectUserRegistrationError = (state: AppState) =>\n getIn(state, ['user', 'registration', 'error'], false);\n\nexport const selectUserRegistrationIsLoading = (state: AppState) =>\n getIn(state, ['user', 'registration', 'isLoading'], false);\n\nexport const selectUserRegistrationIsSuccess = (state: AppState) =>\n getIn(state, ['user', 'registration', 'success'], false);\n\nexport const selectPasswordResetRequestSending = (state: AppState) =>\n getIn(state, ['user', 'passwordResetRequest', 'isSending']);\n\nexport const selectPasswordResetRequestSent = (state: AppState) =>\n getIn(state, ['user', 'passwordResetRequest', 'sent']);\n\nexport const selectPasswordResetRequestError = (state: AppState) =>\n getIn(state, ['user', 'passwordResetRequest', 'error']);\n\nexport const selectResetPasswordSending = (state: AppState) =>\n getIn(state, ['user', 'resetPassword', 'isSending']);\n\nexport const selectResetPasswordSent = (state: AppState) =>\n getIn(state, ['user', 'resetPassword', 'sent']);\n\nexport const selectResetPasswordError = (state: AppState) =>\n getIn(state, ['user', 'resetPassword', 'error']);\n\nexport const selectChangePasswordSending = (state: AppState) =>\n getIn(state, ['user', 'changePassword', 'isSending']);\n\nexport const selectChangePasswordSent = (state: AppState) =>\n getIn(state, ['user', 'changePassword', 'sent']);\n\nexport const selectChangePasswordError = (state: AppState) =>\n getIn(state, ['user', 'changePassword', 'error']);\n","import { Group } from 'contensis-management-api/lib/models';\nimport { RequireLogin } from '~/routing/routes';\n\nexport const matchUserGroup = (\n userGroups: Group[] = [],\n requiredGroups: RequireLogin = []\n) => {\n if (\n !Array.isArray(requiredGroups) ||\n (Array.isArray(requiredGroups) && requiredGroups.length === 0)\n )\n return true;\n\n const groupMatch = requiredGroups.some(requiredGroup => {\n return userGroups.some(userGroup => {\n if (requiredGroup.id === userGroup.id) {\n return true;\n }\n if (requiredGroup.name === userGroup.name) {\n return true;\n }\n });\n });\n return groupMatch;\n};\n","/* eslint-disable react/display-name */\n/* eslint-disable @typescript-eslint/naming-convention */\nimport React from 'react';\n\nexport const toJS =\n <Props extends { [key: string]: any }>(\n WrappedComponent: React.ComponentType<Props>\n ): React.ComponentType<Props> =>\n (wrappedComponentProps: Props) => {\n const KEY = 0;\n const VALUE = 1;\n\n const propsJS = Object.entries(wrappedComponentProps).reduce<Props>(\n (newProps: any, wrappedComponentProp) => {\n const propKey = wrappedComponentProp[KEY];\n const propValue = wrappedComponentProp[VALUE];\n newProps[propKey] =\n propValue && typeof propValue === 'object' && 'toJS' in propValue\n ? propValue.toJS()\n : propValue;\n return newProps as Props;\n },\n {} as Props\n );\n\n return <WrappedComponent {...propsJS} />;\n };\n"],"names":["selectUserIsLoading","state","getIn","selectUserIsAuthenticated","selectUserIsAuthenticationError","selectUserIsError","selectUserAuthenticationErrorMessage","selectUserErrorMessage","selectClientCredentials","returnType","selectUser","selectUserIsZengentiStaff","selectUserGuid","selectUsername","selectUserEmail","selectUserGroups","selectUserSecurityToken","selectUserRegistration","selectUserRegistrationError","selectUserRegistrationIsLoading","selectUserRegistrationIsSuccess","selectPasswordResetRequestSending","selectPasswordResetRequestSent","selectPasswordResetRequestError","selectResetPasswordSending","selectResetPasswordSent","selectResetPasswordError","selectChangePasswordSending","selectChangePasswordSent","selectChangePasswordError","matchUserGroup","userGroups","requiredGroups","Array","isArray","length","groupMatch","some","requiredGroup","userGroup","id","name","toJS","WrappedComponent","wrappedComponentProps","KEY","VALUE","propsJS","Object","entries","reduce","newProps","wrappedComponentProp","propKey","propValue","React","createElement"],"mappings":";;;MAIaA,mBAAmB,GAAIC,KAAe,IACjDC,gBAAK,CAACD,KAAK,EAAE,CAAC,MAAM,EAAE,qBAAqB,EAAE,WAAW,CAAC,EAAC;MAE/CE,yBAAyB,GAAIF,KAAe,IACvDC,gBAAK,CAACD,KAAK,EAAE,CAAC,MAAM,EAAE,qBAAqB,EAAE,iBAAiB,CAAC,EAAC;MAErDG,+BAA+B,GAAIH,KAAe,IAC7DC,gBAAK,CAACD,KAAK,EAAE,CAAC,MAAM,EAAE,qBAAqB,EAAE,uBAAuB,CAAC,EAAC;MAE3DI,iBAAiB,GAAIJ,KAAe,IAC/CC,gBAAK,CAACD,KAAK,EAAE,CAAC,MAAM,EAAE,qBAAqB,EAAE,SAAS,CAAC,EAAC;;AAE1D;AACA;AACA;AACA;AACA;AACO,MAAMK,oCAAoC,GAAIL,KAAe,IAClEC,gBAAK,CAACD,KAAK,EAAE,CAAC,MAAM,EAAE,qBAAqB,EAAE,cAAc,CAAC,CAAC,CAAA;MAElDM,sBAAsB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AAA;AACzC,IAAA,MAAMS,SAAS,GAAGF,oBAAoB,CAACN,KAAK,CAAC,CAAA;IAC7CK,QAAQ,CAACE,OAAO,CAAC,GACfC,SAAS,IAAI,OAAOA,SAAS,KAAK,QAAQ,IAAI,MAAM,IAAIA,SAAS,GAC7DA,SAAS,CAACZ,IAAI,EAAE,GAChBY,SAAS,CAAA;AACf,IAAA,OAAOH,QAAQ,CAAA;GAChB,EACD,EAAE,CACH,CAAA;AAED,EAAA,oBAAOI,KAAA,CAAAC,aAAA,CAACb,gBAAgB,EAAKI,OAAO,CAAI,CAAA;AAC1C;;;;"}
package/esm/client.js CHANGED
@@ -7,12 +7,12 @@ import { Router } from 'react-router-dom';
7
7
  import { loadableReady } from '@loadable/component';
8
8
  import { parse } from 'query-string';
9
9
  import { CookiesProvider } from 'react-cookie';
10
- import { c as createStore, s as selectVersionStatus } from './version-ef107106.js';
11
- import { s as setVersionStatus } from './version-b15807c5.js';
12
- import { b as browserHistory, r as rootSaga, p as pickProject } from './App-2af18a99.js';
13
- export { A as ReactApp } from './App-2af18a99.js';
14
- import { c as setCurrentProject } from './selectors-74de49a3.js';
15
- import { d as deliveryApi } from './ContensisDeliveryApi-5660ee0e.js';
10
+ import { c as createStore, s as selectVersionStatus } from './version-aebe50f2.js';
11
+ import { s as setVersionStatus } from './version-88653900.js';
12
+ import { b as browserHistory, r as rootSaga, p as pickProject } from './App-ade8773a.js';
13
+ export { A as ReactApp } from './App-ade8773a.js';
14
+ import { c as setCurrentProject } from './selectors-ff21e98a.js';
15
+ import { d as deliveryApi } from './ContensisDeliveryApi-5bb364b9.js';
16
16
  import 'redux';
17
17
  import 'redux-thunk';
18
18
  import 'redux-saga';
@@ -23,13 +23,13 @@ import './reducers-3d5c37d1.js';
23
23
  import '@redux-saga/core/effects';
24
24
  import 'history';
25
25
  import 'loglevel';
26
- import './login-71ff3fcb.js';
27
- import './ToJs-9b30636a.js';
26
+ import './login-c3cfb5ad.js';
27
+ import './ToJs-7233c038.js';
28
28
  import 'jsonpath-mapper';
29
29
  import 'await-to-js';
30
30
  import 'js-cookie';
31
31
  import 'contensis-delivery-api';
32
- import './RouteLoader-6eac364e.js';
32
+ import './RouteLoader-e6c2c8d6.js';
33
33
  import 'react-router-config';
34
34
  import 'reselect';
35
35