@zengenti/contensis-react-base 3.0.2-beta.39 → 3.0.2-beta.40

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 (116) hide show
  1. package/cjs/{App-6c803238.js → App-7ff737fa.js} +61 -29
  2. package/cjs/App-7ff737fa.js.map +1 -0
  3. package/cjs/{login-8eed92af.js → ChangePassword.container-a617190b.js} +246 -84
  4. package/cjs/ChangePassword.container-a617190b.js.map +1 -0
  5. package/cjs/{ContensisDeliveryApi-e37e14a9.js → ContensisDeliveryApi-9e32960d.js} +9 -8
  6. package/cjs/ContensisDeliveryApi-9e32960d.js.map +1 -0
  7. package/cjs/CookieConstants-000427db.js +10 -0
  8. package/cjs/CookieConstants-000427db.js.map +1 -0
  9. package/cjs/{RouteLoader-a49e4e93.js → RouteLoader-049e81e5.js} +8 -5
  10. package/cjs/RouteLoader-049e81e5.js.map +1 -0
  11. package/cjs/{ToJs-43cedc5c.js → ToJs-149fc5e1.js} +49 -2
  12. package/cjs/ToJs-149fc5e1.js.map +1 -0
  13. package/cjs/client.js +14 -11
  14. package/cjs/client.js.map +1 -1
  15. package/cjs/contensis-react-base.js +24 -348
  16. package/cjs/contensis-react-base.js.map +1 -1
  17. package/cjs/redux.js +3 -3
  18. package/cjs/routing.js +4 -3
  19. package/cjs/routing.js.map +1 -1
  20. package/cjs/{selectors-fa836926.js → selectors-46b689d0.js} +4 -9
  21. package/cjs/selectors-46b689d0.js.map +1 -0
  22. package/cjs/user.js +33 -159
  23. package/cjs/user.js.map +1 -1
  24. package/cjs/util.js +6 -3
  25. package/cjs/util.js.map +1 -1
  26. package/cjs/{version-396cb8de.js → version-79a027cb.js} +2 -2
  27. package/cjs/{version-396cb8de.js.map → version-79a027cb.js.map} +1 -1
  28. package/cjs/{version-3060974c.js → version-afd4f77e.js} +3 -3
  29. package/cjs/{version-3060974c.js.map → version-afd4f77e.js.map} +1 -1
  30. package/esm/{App-bf3b5cdb.js → App-ff944c78.js} +55 -24
  31. package/esm/App-ff944c78.js.map +1 -0
  32. package/esm/{login-e4b1447e.js → ChangePassword.container-ae0f9ce4.js} +229 -78
  33. package/esm/ChangePassword.container-ae0f9ce4.js.map +1 -0
  34. package/esm/{ContensisDeliveryApi-8dbb3249.js → ContensisDeliveryApi-c66b0cc3.js} +7 -8
  35. package/esm/ContensisDeliveryApi-c66b0cc3.js.map +1 -0
  36. package/esm/CookieConstants-3d3b6531.js +6 -0
  37. package/esm/CookieConstants-3d3b6531.js.map +1 -0
  38. package/esm/{RouteLoader-58774c81.js → RouteLoader-02eef6d9.js} +8 -5
  39. package/esm/RouteLoader-02eef6d9.js.map +1 -0
  40. package/esm/{ToJs-b18ab86e.js → ToJs-ae860aad.js} +49 -3
  41. package/esm/ToJs-ae860aad.js.map +1 -0
  42. package/esm/client.js +15 -12
  43. package/esm/client.js.map +1 -1
  44. package/esm/contensis-react-base.js +24 -349
  45. package/esm/contensis-react-base.js.map +1 -1
  46. package/esm/redux.js +6 -6
  47. package/esm/routing.js +4 -3
  48. package/esm/routing.js.map +1 -1
  49. package/esm/{selectors-62746dce.js → selectors-01074974.js} +4 -9
  50. package/esm/selectors-01074974.js.map +1 -0
  51. package/esm/user.js +21 -151
  52. package/esm/user.js.map +1 -1
  53. package/esm/util.js +4 -3
  54. package/esm/util.js.map +1 -1
  55. package/esm/{version-1600ca2a.js → version-0fbd1b82.js} +3 -3
  56. package/esm/{version-1600ca2a.js.map → version-0fbd1b82.js.map} +1 -1
  57. package/esm/{version-29368be6.js → version-346a9787.js} +2 -2
  58. package/esm/{version-29368be6.js.map → version-346a9787.js.map} +1 -1
  59. package/models/client/client.d.ts +1 -1
  60. package/models/config.d.ts +4 -4
  61. package/models/redux/appstate.d.ts +1 -1
  62. package/models/routing/redux/actions.d.ts +10 -6
  63. package/models/routing/redux/selectors.d.ts +3 -3
  64. package/models/routing/redux/types.d.ts +0 -1
  65. package/models/routing/routes.d.ts +20 -17
  66. package/models/search/models/Queries.d.ts +8 -10
  67. package/models/search/models/Search.d.ts +24 -24
  68. package/models/search/models/SearchActions.d.ts +33 -33
  69. package/models/search/models/SearchState.d.ts +11 -11
  70. package/models/search/models/SearchUtil.d.ts +1 -1
  71. package/models/search/models/WithSearch.d.ts +1 -1
  72. package/models/search/redux/actions.d.ts +4 -4
  73. package/models/search/redux/selectors.d.ts +27 -27
  74. package/models/search/redux/types.d.ts +21 -21
  75. package/models/search/redux/util.d.ts +1 -1
  76. package/models/search/search/ContensisDeliveryApi.d.ts +1 -1
  77. package/models/search/search/expressions.d.ts +4 -4
  78. package/models/search/search/util.d.ts +2 -2
  79. package/models/search/transformations/state-to-queryparams.mapper.d.ts +1 -1
  80. package/models/server/features/linkdepth-api/LinkDepthSearchService.d.ts +1 -1
  81. package/models/server/features/linkdepth-api/search.d.ts +2 -2
  82. package/models/server/internalServer.d.ts +7 -5
  83. package/models/server/util/bundles.d.ts +2 -2
  84. package/models/server/util/handleExceptions.d.ts +1 -1
  85. package/models/testImmer/redux/reducer.d.ts +1 -1
  86. package/models/user/components/Login.d.ts +2 -3
  87. package/models/user/containers/ChangePassword.container.d.ts +2 -2
  88. package/models/user/containers/ForgotPassword.container.d.ts +2 -2
  89. package/models/user/containers/Login.container.d.ts +2 -2
  90. package/models/user/containers/Registration.container.d.ts +2 -2
  91. package/models/user/hocs/withLogin.d.ts +5 -11
  92. package/models/user/hocs/withRegistration.d.ts +2 -8
  93. package/models/user/redux/actions.d.ts +2 -2
  94. package/models/user/redux/sagas/login.d.ts +9 -8
  95. package/models/user/redux/selectors.d.ts +4 -4
  96. package/models/user/util/CookieConstants.d.ts +1 -1
  97. package/models/user/util/CookieHelper.class.d.ts +15 -3
  98. package/models/user/util/LoginHelper.class.d.ts +27 -23
  99. package/models/util/CachedDeliveryApi.d.ts +1 -1
  100. package/models/util/ContensisDeliveryApi.d.ts +4 -4
  101. package/models/util/ToJs.d.ts +1 -1
  102. package/models/util/index.d.ts +1 -1
  103. package/models/util/json-mapper.d.ts +1 -1
  104. package/package.json +9 -10
  105. package/cjs/App-6c803238.js.map +0 -1
  106. package/cjs/ContensisDeliveryApi-e37e14a9.js.map +0 -1
  107. package/cjs/RouteLoader-a49e4e93.js.map +0 -1
  108. package/cjs/ToJs-43cedc5c.js.map +0 -1
  109. package/cjs/login-8eed92af.js.map +0 -1
  110. package/cjs/selectors-fa836926.js.map +0 -1
  111. package/esm/App-bf3b5cdb.js.map +0 -1
  112. package/esm/ContensisDeliveryApi-8dbb3249.js.map +0 -1
  113. package/esm/RouteLoader-58774c81.js.map +0 -1
  114. package/esm/ToJs-b18ab86e.js.map +0 -1
  115. package/esm/login-e4b1447e.js.map +0 -1
  116. package/esm/selectors-62746dce.js.map +0 -1
package/cjs/redux.js CHANGED
@@ -2,9 +2,9 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var version$1 = require('./version-396cb8de.js');
6
- var selectors$1 = require('./selectors-fa836926.js');
7
- var version$2 = require('./version-3060974c.js');
5
+ var version$1 = require('./version-79a027cb.js');
6
+ var selectors$1 = require('./selectors-46b689d0.js');
7
+ var version$2 = require('./version-afd4f77e.js');
8
8
  require('redux');
9
9
  require('redux-thunk');
10
10
  require('redux-saga');
package/cjs/routing.js CHANGED
@@ -2,17 +2,18 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var selectors = require('./selectors-fa836926.js');
6
- var RouteLoader = require('./RouteLoader-a49e4e93.js');
5
+ var selectors = require('./selectors-46b689d0.js');
6
+ var RouteLoader = require('./RouteLoader-049e81e5.js');
7
7
  require('jsonpath-mapper');
8
8
  require('query-string');
9
9
  require('react');
10
+ require('react-cookie');
10
11
  require('react-redux');
11
12
  require('react-hot-loader');
12
13
  require('react-router-dom');
13
14
  require('react-router-config');
14
15
  require('reselect');
15
- require('./ToJs-43cedc5c.js');
16
+ require('./ToJs-149fc5e1.js');
16
17
 
17
18
 
18
19
 
@@ -1 +1 @@
1
- {"version":3,"file":"routing.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"routing.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;"}
@@ -44,7 +44,6 @@ const SET_ANCESTORS = `${ROUTING_PREFIX}_SET_ANCESTORS`;
44
44
  const SET_SIBLINGS = `${ROUTING_PREFIX}_SET_SIBLINGS`;
45
45
  const SET_ENTRY_ID = `${ROUTING_PREFIX}_SET_ENTRY_ID`;
46
46
  const SET_SURROGATE_KEYS = `${ROUTING_PREFIX}_SET_SURROGATE_KEYS`;
47
- const SET_NAVIGATION_NOT_FOUND = `${ROUTING_PREFIX}_SET_NOT_FOUND`;
48
47
  const SET_NAVIGATION_PATH = `${ROUTING_PREFIX}_SET_NAVIGATION_PATH`;
49
48
  const SET_TARGET_PROJECT = `${ROUTING_PREFIX}_SET_TARGET_PROJECT`;
50
49
  const SET_ROUTE = `${ROUTING_PREFIX}_SET_ROUTE`;
@@ -59,23 +58,20 @@ var routing$2 = /*#__PURE__*/Object.freeze({
59
58
  SET_SIBLINGS: SET_SIBLINGS,
60
59
  SET_ENTRY_ID: SET_ENTRY_ID,
61
60
  SET_SURROGATE_KEYS: SET_SURROGATE_KEYS,
62
- SET_NAVIGATION_NOT_FOUND: SET_NAVIGATION_NOT_FOUND,
63
61
  SET_NAVIGATION_PATH: SET_NAVIGATION_PATH,
64
62
  SET_TARGET_PROJECT: SET_TARGET_PROJECT,
65
63
  SET_ROUTE: SET_ROUTE,
66
64
  UPDATE_LOADING_STATE: UPDATE_LOADING_STATE
67
65
  });
68
66
 
69
- const setNotFound = notFound => action(SET_NAVIGATION_NOT_FOUND, {
70
- notFound
71
- });
72
- const setNavigationPath = (path, location, staticRoute, withEvents, statePath, routes) => action(SET_NAVIGATION_PATH, {
67
+ const setNavigationPath = (path, location, staticRoute, withEvents, statePath, routes, cookies) => action(SET_NAVIGATION_PATH, {
73
68
  path,
74
69
  location,
75
70
  staticRoute,
76
71
  withEvents,
77
72
  statePath,
78
- routes
73
+ routes,
74
+ cookies
79
75
  });
80
76
  const setCurrentProject = (project, allowedGroups, hostname) => action(SET_TARGET_PROJECT, {
81
77
  project,
@@ -96,7 +92,6 @@ const setSurrogateKeys = (keys, url) => action(SET_SURROGATE_KEYS, {
96
92
 
97
93
  var routing$1 = /*#__PURE__*/Object.freeze({
98
94
  __proto__: null,
99
- setNotFound: setNotFound,
100
95
  setNavigationPath: setNavigationPath,
101
96
  setCurrentProject: setCurrentProject,
102
97
  setRoute: setRoute,
@@ -225,4 +220,4 @@ exports.setCurrentProject = setCurrentProject;
225
220
  exports.setNavigationPath = setNavigationPath;
226
221
  exports.setRoute = setRoute;
227
222
  exports.setSurrogateKeys = setSurrogateKeys;
228
- //# sourceMappingURL=selectors-fa836926.js.map
223
+ //# sourceMappingURL=selectors-46b689d0.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"selectors-46b689d0.js","sources":["../src/redux/util.ts","../src/routing/redux/types.ts","../src/routing/redux/actions.ts","../src/util/navigation.js","../src/routing/redux/selectors.ts"],"sourcesContent":["import { jpath } from '~/util/json-mapper';\n\nexport const action = (type: string, payload: any = {}) => ({\n type,\n ...payload,\n});\n\nexport const getJS = <S extends Record<string, unknown>, T extends keyof S>(\n state: S,\n stateKey: T\n) => {\n if (\n 'get' in state &&\n typeof state.get === 'function' &&\n 'toJS' in state &&\n typeof state.toJS === 'function'\n ) {\n return state.get(stateKey) as S[T];\n }\n return state[stateKey];\n};\n\nexport const getImmutableOrJS = <\n S extends Record<string, unknown>,\n T extends keyof S | any\n>(\n state: S,\n stateKey: T | T[],\n fallbackValue?: any,\n returnType: 'immutable' | 'js' = globalThis.STATE_TYPE\n) => {\n // Find a fromJS function from global that is dynamically loaded in createStore\n // or replace with a stub function for non-immutable gets\n const fromJS =\n returnType === 'immutable'\n ? globalThis.immutable?.fromJSOrdered || globalThis.immutable?.fromJS\n : v => v;\n\n if (\n state &&\n 'get' in state &&\n typeof state.get === 'function' &&\n 'getIn' in state &&\n typeof state.getIn === 'function' &&\n 'toJS' in state &&\n typeof state.toJS === 'function'\n ) {\n if (Array.isArray(stateKey))\n return fromJS(state.getIn(stateKey, fallbackValue));\n return fromJS(state.get(stateKey, fallbackValue)) as S[T | any];\n }\n\n if (Array.isArray(stateKey) && state && typeof state === 'object') {\n const result = jpath(stateKey.join('.'), state);\n if (typeof result === 'undefined') return fallbackValue;\n return result;\n }\n\n const result =\n state && typeof state === 'object' ? state[stateKey as string] : undefined;\n if (typeof result === 'undefined') return fallbackValue;\n return result;\n};\n","const ROUTING_PREFIX = '@ROUTING/';\nexport const GET_ENTRY = `${ROUTING_PREFIX}_GET_ENTRY`;\nexport const SET_ENTRY = `${ROUTING_PREFIX}_SET_ENTRY`;\nexport const SET_NODE = `${ROUTING_PREFIX}_SET_NODE`;\nexport const SET_ANCESTORS = `${ROUTING_PREFIX}_SET_ANCESTORS`;\nexport const SET_SIBLINGS = `${ROUTING_PREFIX}_SET_SIBLINGS`;\nexport const SET_ENTRY_ID = `${ROUTING_PREFIX}_SET_ENTRY_ID`;\nexport const SET_SURROGATE_KEYS = `${ROUTING_PREFIX}_SET_SURROGATE_KEYS`;\n\nexport const SET_NAVIGATION_PATH = `${ROUTING_PREFIX}_SET_NAVIGATION_PATH`;\n\nexport const SET_TARGET_PROJECT = `${ROUTING_PREFIX}_SET_TARGET_PROJECT`;\n\nexport const SET_ROUTE = `${ROUTING_PREFIX}_SET_ROUTE`;\n\nexport const UPDATE_LOADING_STATE = `${ROUTING_PREFIX}_UPDATE_LOADING_STATE`;\n","import { useLocation } from 'react-router-dom';\nimport { action } from '~/redux/util';\nimport {\n SET_ENTRY,\n SET_NAVIGATION_PATH,\n SET_TARGET_PROJECT,\n SET_ROUTE,\n SET_SURROGATE_KEYS,\n} from './types';\n\nimport { Entry } from 'contensis-delivery-api/lib/models';\nimport { MatchedRoute, RouteConfig } from 'react-router-config';\nimport { AppRoutes, WithEvents } from '../routes';\nimport { CookieHelper } from '~/user/util/CookieHelper.class';\n\nexport const setNavigationPath = (\n path: string,\n location: ReturnType<typeof useLocation>,\n staticRoute: MatchedRoute<any, RouteConfig> | undefined,\n withEvents: WithEvents,\n statePath: string,\n routes: AppRoutes,\n cookies: CookieHelper\n) =>\n action(SET_NAVIGATION_PATH, {\n path,\n location,\n staticRoute,\n withEvents,\n statePath,\n routes,\n cookies,\n });\n\nexport const setCurrentProject = (\n project: string,\n allowedGroups: any,\n hostname: string\n) => action(SET_TARGET_PROJECT, { project, allowedGroups, hostname });\n\nexport const setRoute = (path: string, state?: any) =>\n action(SET_ROUTE, { path, state });\n\nexport const setRouteEntry = (entry: Entry) => action(SET_ENTRY, { entry });\n\nexport const setSurrogateKeys = (keys: string, url: string) =>\n action(SET_SURROGATE_KEYS, { keys, url });\n","import queryString from 'query-string';\n\nexport function queryParams(search) {\n return queryString.parse(\n typeof window != 'undefined' ? window.location.search : search\n );\n}\nexport const routeParams = staticRoute =>\n staticRoute && staticRoute.match ? staticRoute.match.params : {};\n\nexport const buildUrl = (route, params) => {\n const qs = queryString.stringify(params);\n const path = qs ? `${route}?${qs}` : route;\n return path;\n};\n\nexport const clientHostname = () =>\n `${window.location.protocol}//${window.location.hostname}:${window.location.port}`;\n","import { Entry } from 'contensis-delivery-api/lib/models';\nimport { StateType } from '~/config';\nimport { AppState } from '~/redux/appstate';\nimport { getImmutableOrJS as getIn } from '~/redux/util';\nimport { queryParams } from '~/util/navigation';\n\nexport const selectRouteEntry = (state: AppState, returnType?: StateType) =>\n getIn(state, ['routing', 'entry'], {} as Entry, returnType);\n\nexport const selectMappedEntry = (state: AppState, returnType?: StateType) =>\n getIn(state, ['routing', 'mappedEntry'], null, returnType);\n\nexport const selectSurrogateKeys = (state: AppState) => {\n const keys = getIn(state, ['routing', 'surrogateKeys'], [], 'js');\n return keys;\n};\nexport const selectCurrentHostname = (state: AppState) =>\n getIn(state, ['routing', 'currentHostname']);\n\nexport const selectCurrentTreeID = (state: AppState) =>\n getIn(state, ['routing', 'currentHostname']);\n\nexport const selectRouteEntryEntryId = (state: AppState) =>\n getIn(state, ['routing', 'entry', 'sys', 'id'], null);\n\nexport const selectRouteEntryContentTypeId = (state: AppState) => {\n const entry = selectRouteEntry(state);\n return getIn(entry, ['sys', 'contentTypeId'], null);\n};\n\nexport const selectRouteEntryLanguage = (state: AppState) => {\n const entry = selectRouteEntry(state);\n return getIn(entry, ['sys', 'language'], null);\n};\n\nexport const selectRouteEntrySlug = (state: AppState) => {\n const entry = selectRouteEntry(state);\n return getIn(entry, ['sys', 'slug'], null);\n};\n\nexport const selectRouteEntryID = (state: AppState) =>\n getIn(state, ['routing', 'entryID']);\n\nexport const selectCanonicalPath = (state: AppState) => {\n return getIn(state, ['routing', 'canonicalPath']);\n};\n\nexport const selectCurrentPath = (state: AppState) =>\n getIn(state, ['routing', 'currentPath']);\n\nexport const selectCurrentLocation = (state: AppState) =>\n getIn(state, ['routing', 'location']);\nexport const selectCurrentSearch = (state: AppState) =>\n getIn(state, ['routing', 'location', 'search']);\nexport const selectCurrentHash = (state: AppState) =>\n getIn(state, ['routing', 'location', 'hash']);\nexport const selectQueryStringAsObject = (state: AppState) =>\n queryParams(selectCurrentSearch(state));\nexport const selectCurrentProject = (state: AppState) =>\n getIn(state, ['routing', 'currentProject']);\nexport const selectIsNotFound = (state: AppState) =>\n getIn(state, ['routing', 'notFound']);\nexport const selectCurrentAncestors = (state: AppState) =>\n getIn(state, ['routing', 'currentNodeAncestors'], []);\nexport const selectCurrentSiblings = (state: AppState) =>\n getIn(state, ['routing', 'currentNodeSiblings'], []);\nexport const selectCurrentNode = (state: AppState, returnType?: StateType) =>\n getIn(state, ['routing', 'currentNode'], null, returnType);\nexport const selectCurrentChildren = state =>\n getIn(state, ['routing', 'currentNode', 'children'], []);\n\nexport const selectBreadcrumb = (state: AppState) => {\n return [...selectCurrentAncestors(state), selectCurrentNode(state)];\n};\nexport const selectRouteErrorMessage = (state: AppState) => {\n const error = getIn(state, ['routing', 'error']);\n return getIn(error, ['data', 'message'], getIn(error, 'statusText'));\n};\nexport const selectRouteIsError = (state: AppState) =>\n getIn(state, ['routing', 'isError']);\nexport const selectRouteLoading = (state: AppState) =>\n getIn(state, ['routing', 'isLoading']);\nexport const selectRouteStatusCode = (state: AppState) =>\n getIn(state, ['routing', 'statusCode']);\nexport const selectStaticRoute = (state: AppState) =>\n getIn(state, ['routing', 'staticRoute']);\n"],"names":["action","type","payload","getJS","state","stateKey","get","toJS","getImmutableOrJS","fallbackValue","returnType","globalThis","STATE_TYPE","_globalThis$immutable","_globalThis$immutable2","fromJS","immutable","fromJSOrdered","v","getIn","Array","isArray","result","jpath","join","undefined","ROUTING_PREFIX","GET_ENTRY","SET_ENTRY","SET_NODE","SET_ANCESTORS","SET_SIBLINGS","SET_ENTRY_ID","SET_SURROGATE_KEYS","SET_NAVIGATION_PATH","SET_TARGET_PROJECT","SET_ROUTE","UPDATE_LOADING_STATE","setNavigationPath","path","location","staticRoute","withEvents","statePath","routes","cookies","setCurrentProject","project","allowedGroups","hostname","setRoute","setRouteEntry","entry","setSurrogateKeys","keys","url","queryParams","search","queryString","parse","window","selectRouteEntry","selectMappedEntry","selectSurrogateKeys","selectCurrentHostname","selectCurrentTreeID","selectRouteEntryEntryId","selectRouteEntryContentTypeId","selectRouteEntryLanguage","selectRouteEntrySlug","selectRouteEntryID","selectCanonicalPath","selectCurrentPath","selectCurrentLocation","selectCurrentSearch","selectCurrentHash","selectQueryStringAsObject","selectCurrentProject","selectIsNotFound","selectCurrentAncestors","selectCurrentSiblings","selectCurrentNode","selectCurrentChildren","selectBreadcrumb","selectRouteErrorMessage","error","selectRouteIsError","selectRouteLoading","selectRouteStatusCode","selectStaticRoute"],"mappings":";;;;;;;;;AAEO,MAAMA,MAAM,GAAGA,CAACC,IAAY,EAAEC,OAAY,GAAG,EAAE,MAAM;EAC1DD,IAAI;EACJ,GAAGC,OAAAA;AACL,CAAC,EAAC;MAEWC,KAAK,GAAGA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AC;AACzBmF,MAAAA,kBAAkB,GAAInF,KAAe,IAChDe,gBAAK,CAACf,KAAK,EAAE,CAAC,SAAS,EAAE,WAAW,CAAC,EAAC;AAC3BoF,MAAAA,qBAAqB,GAAIpF,KAAe,IACnDe,gBAAK,CAACf,KAAK,EAAE,CAAC,SAAS,EAAE,YAAY,CAAC,EAAC;AAClC,MAAMqF,iBAAiB,GAAIrF,KAAe,IAC/Ce,gBAAK,CAACf,KAAK,EAAE,CAAC,SAAS,EAAE,aAAa,CAAC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
package/cjs/user.js CHANGED
@@ -2,155 +2,23 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var login = require('./login-8eed92af.js');
5
+ var ChangePassword_container = require('./ChangePassword.container-a617190b.js');
6
+ var React = require('react');
7
+ var reactCookie = require('react-cookie');
6
8
  var reactRedux = require('react-redux');
7
- var selectors = require('./selectors-fa836926.js');
9
+ var ToJs = require('./ToJs-149fc5e1.js');
8
10
  var reducers = require('./reducers-9afb5f89.js');
9
- var ToJs = require('./ToJs-43cedc5c.js');
10
11
  require('@redux-saga/core/effects');
12
+ require('./selectors-46b689d0.js');
11
13
  require('jsonpath-mapper');
12
- require('await-to-js');
13
- require('js-cookie');
14
14
  require('query-string');
15
+ require('await-to-js');
16
+ require('./CookieConstants-000427db.js');
15
17
  require('immer');
16
- require('react');
17
-
18
- const loginUser = (username, password) => selectors.action(reducers.LOGIN_USER, {
19
- username,
20
- password
21
- });
22
- const logoutUser = redirectPath => selectors.action(reducers.LOGOUT_USER, {
23
- redirectPath
24
- });
25
- const registerUser = (user, mappers) => selectors.action(reducers.REGISTER_USER, {
26
- user,
27
- mappers
28
- });
29
- const requestPasswordReset = userEmailObject => selectors.action(reducers.REQUEST_USER_PASSWORD_RESET, {
30
- userEmailObject
31
- });
32
- const resetPassword = resetPasswordObject => selectors.action(reducers.RESET_USER_PASSWORD, {
33
- resetPasswordObject
34
- });
35
- const changePassword = (userId, currentPassword, newPassword) => selectors.action(reducers.CHANGE_USER_PASSWORD, {
36
- userId,
37
- currentPassword,
38
- newPassword
39
- });
40
-
41
- var actions = /*#__PURE__*/Object.freeze({
42
- __proto__: null,
43
- loginUser: loginUser,
44
- logoutUser: logoutUser,
45
- registerUser: registerUser,
46
- requestPasswordReset: requestPasswordReset,
47
- resetPassword: resetPassword,
48
- changePassword: changePassword
49
- });
50
-
51
- const useLogin = () => {
52
- const dispatch = reactRedux.useDispatch();
53
- const select = reactRedux.useSelector;
54
- return {
55
- loginUser: (username, password) => dispatch(loginUser(username, password)),
56
- logoutUser: redirectPath => dispatch(logoutUser(redirectPath)),
57
- errorMessage: select(ToJs.selectUserErrorMessage),
58
- isAuthenticated: select(ToJs.selectUserIsAuthenticated),
59
- isAuthenticationError: select(ToJs.selectUserIsAuthenticationError),
60
- isError: select(ToJs.selectUserIsError),
61
- isLoading: select(ToJs.selectUserIsLoading),
62
- user: select(ToJs.selectUser),
63
- // DEPRECATED: authenticationError is deprecated use isAuthenticationError instead
64
- authenticationError: select(ToJs.selectUserIsAuthenticationError),
65
- // DEPRECATED: authenticationErrorMessage is deprecated use errorMessage instead
66
- authenticationErrorMessage: select(ToJs.selectUserErrorMessage),
67
- // DEPRECATED: error is deprecated use isError instead
68
- error: select(ToJs.selectUserIsError)
69
- };
70
- };
71
18
 
72
- const LoginContainer = ({
73
- children,
74
- ...props
75
- }) => {
76
- const userProps = useLogin();
77
- return children(userProps);
78
- };
79
- LoginContainer.propTypes = {};
80
- var Login_container = ToJs.toJS(LoginContainer);
19
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
81
20
 
82
- const useRegistration = () => {
83
- const dispatch = reactRedux.useDispatch();
84
- const select = reactRedux.useSelector;
85
- return {
86
- registerUser: (user, mappers) => dispatch(registerUser(user, mappers)),
87
- error: select(ToJs.selectUserRegistrationError),
88
- isLoading: select(ToJs.selectUserRegistrationIsLoading),
89
- isSuccess: select(ToJs.selectUserRegistrationIsSuccess),
90
- user: select(ToJs.selectUserRegistration)
91
- };
92
- };
93
-
94
- const RegistrationContainer = ({
95
- children,
96
- ...props
97
- }) => {
98
- const userProps = useRegistration();
99
- return children(userProps);
100
- };
101
- RegistrationContainer.propTypes = {};
102
- var Registration_container = ToJs.toJS(RegistrationContainer);
103
-
104
- const useForgotPassword = () => {
105
- const dispatch = reactRedux.useDispatch();
106
- const select = reactRedux.useSelector;
107
- return {
108
- isLoading: select(ToJs.selectPasswordResetRequestSending),
109
- isSuccess: select(ToJs.selectPasswordResetRequestSent),
110
- error: select(ToJs.selectPasswordResetRequestError),
111
- requestPasswordReset: userEmailObject => dispatch(requestPasswordReset(userEmailObject)),
112
- setNewPassword: {
113
- queryString: select(selectors.selectCurrentSearch),
114
- isLoading: select(ToJs.selectResetPasswordSending),
115
- isSuccess: select(ToJs.selectResetPasswordSent),
116
- error: select(ToJs.selectResetPasswordError),
117
- submit: resetPasswordObject => dispatch(resetPassword(resetPasswordObject))
118
- }
119
- };
120
- };
121
-
122
- const ForgotPasswordContainer = ({
123
- children,
124
- ...props
125
- }) => {
126
- const userProps = useForgotPassword();
127
- return children(userProps);
128
- };
129
- ForgotPasswordContainer.propTypes = {};
130
- var ForgotPassword_container = ToJs.toJS(ForgotPasswordContainer);
131
-
132
- const useChangePassword = () => {
133
- const dispatch = reactRedux.useDispatch();
134
- const select = reactRedux.useSelector;
135
- return {
136
- isLoading: select(ToJs.selectChangePasswordSending),
137
- isSuccess: select(ToJs.selectChangePasswordSent),
138
- userId: select(ToJs.selectUserGuid),
139
- isLoggedIn: select(ToJs.selectUserIsAuthenticated),
140
- error: select(ToJs.selectChangePasswordError),
141
- changePassword: (userId, currentPassword, newPassword) => dispatch(changePassword(userId, currentPassword, newPassword))
142
- };
143
- };
144
-
145
- const ChangePasswordContainer = ({
146
- children,
147
- ...props
148
- }) => {
149
- const userProps = useChangePassword();
150
- return children(userProps);
151
- };
152
- ChangePasswordContainer.propTypes = {};
153
- var ChangePassword_container = ToJs.toJS(ChangePasswordContainer);
21
+ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
154
22
 
155
23
  const getDisplayName$1 = WrappedComponent => {
156
24
  return WrappedComponent.displayName || WrappedComponent.name || 'Component';
@@ -158,6 +26,7 @@ const getDisplayName$1 = WrappedComponent => {
158
26
  const withLogin = WrappedComponent => {
159
27
  const mapStateToProps = state => {
160
28
  return {
29
+ errorMessage: ToJs.selectUserErrorMessage(state),
161
30
  isAuthenticated: ToJs.selectUserIsAuthenticated(state),
162
31
  isAuthenticationError: ToJs.selectUserIsAuthenticationError(state),
163
32
  isError: ToJs.selectUserIsError(state),
@@ -169,12 +38,17 @@ const withLogin = WrappedComponent => {
169
38
  error: ToJs.selectUserIsError(state)
170
39
  };
171
40
  };
172
- const mapDispatchToProps = {
173
- loginUser,
174
- logoutUser
41
+ const ConnectedComponent = () => {
42
+ const cookies = new ToJs.CookieHelper(...reactCookie.useCookies());
43
+ const mapDispatchToProps = {
44
+ loginUser: (username, password) => ChangePassword_container.loginUser(username, password, cookies),
45
+ logoutUser: redirectPath => ChangePassword_container.logoutUser(redirectPath, cookies)
46
+ };
47
+ const FinalComponent = reactRedux.connect(mapStateToProps, mapDispatchToProps)(ToJs.toJS(WrappedComponent));
48
+ return /*#__PURE__*/React__default["default"].createElement(FinalComponent, null);
175
49
  };
176
- const ConnectedComponent = reactRedux.connect(mapStateToProps, mapDispatchToProps)(ToJs.toJS(WrappedComponent));
177
50
  ConnectedComponent.displayName = `${getDisplayName$1(WrappedComponent)}`;
51
+ ConnectedComponent.WrappedComponent = WrappedComponent;
178
52
  return ConnectedComponent;
179
53
  };
180
54
 
@@ -191,29 +65,29 @@ const withRegistration = WrappedComponent => {
191
65
  };
192
66
  };
193
67
  const mapDispatchToProps = {
194
- registerUser
68
+ registerUser: ChangePassword_container.registerUser
195
69
  };
196
70
  const ConnectedComponent = reactRedux.connect(mapStateToProps, mapDispatchToProps)(ToJs.toJS(WrappedComponent));
197
71
  ConnectedComponent.displayName = `${getDisplayName(WrappedComponent)}`;
198
72
  return ConnectedComponent;
199
73
  };
200
74
 
201
- exports.LoginHelper = login.LoginHelper;
202
- exports.handleRequiresLoginSaga = login.handleRequiresLoginSaga;
203
- exports.refreshSecurityToken = login.refreshSecurityToken;
75
+ exports.ChangePassword = ChangePassword_container.ChangePassword_container;
76
+ exports.ForgotPasswordContainer = ChangePassword_container.ForgotPassword_container;
77
+ exports.LoginContainer = ChangePassword_container.Login_container;
78
+ exports.LoginHelper = ChangePassword_container.LoginHelper;
79
+ exports.RegistrationContainer = ChangePassword_container.Registration_container;
80
+ exports.actions = ChangePassword_container.actions;
81
+ exports.handleRequiresLoginSaga = ChangePassword_container.handleRequiresLoginSaga;
82
+ exports.refreshSecurityToken = ChangePassword_container.refreshSecurityToken;
83
+ exports.useChangePassword = ChangePassword_container.useChangePassword;
84
+ exports.useForgotPassword = ChangePassword_container.useForgotPassword;
85
+ exports.useLogin = ChangePassword_container.useLogin;
86
+ exports.useRegistration = ChangePassword_container.useRegistration;
87
+ exports.selectors = ToJs.selectors;
204
88
  exports.initialUserState = reducers.initialUserState;
205
89
  exports.reducer = reducers.UserReducer;
206
90
  exports.types = reducers.types;
207
- exports.selectors = ToJs.selectors;
208
- exports.ChangePassword = ChangePassword_container;
209
- exports.ForgotPasswordContainer = ForgotPassword_container;
210
- exports.LoginContainer = Login_container;
211
- exports.RegistrationContainer = Registration_container;
212
- exports.actions = actions;
213
- exports.useChangePassword = useChangePassword;
214
- exports.useForgotPassword = useForgotPassword;
215
- exports.useLogin = useLogin;
216
- exports.useRegistration = useRegistration;
217
91
  exports.withLogin = withLogin;
218
92
  exports.withRegistration = withRegistration;
219
93
  //# sourceMappingURL=user.js.map
package/cjs/user.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"user.js","sources":["../src/user/redux/actions.js","../src/user/hooks/useLogin.js","../src/user/containers/Login.container.js","../src/user/hooks/useRegistration.js","../src/user/containers/Registration.container.js","../src/user/hooks/useForgotPassword.js","../src/user/containers/ForgotPassword.container.js","../src/user/hooks/useChangePassword.js","../src/user/containers/ChangePassword.container.js","../src/user/hocs/withLogin.js","../src/user/hocs/withRegistration.js"],"sourcesContent":["import { action } from '~/redux/util';\nimport {\n CHANGE_USER_PASSWORD,\n LOGIN_USER,\n LOGOUT_USER,\n REGISTER_USER,\n REQUEST_USER_PASSWORD_RESET,\n RESET_USER_PASSWORD,\n} from './types';\n\nexport const loginUser = (username, password) =>\n action(LOGIN_USER, { username, password });\n\nexport const logoutUser = redirectPath => action(LOGOUT_USER, { redirectPath });\n\nexport const registerUser = (user, mappers) =>\n action(REGISTER_USER, {\n user,\n mappers,\n });\n\nexport const requestPasswordReset = userEmailObject =>\n action(REQUEST_USER_PASSWORD_RESET, { userEmailObject });\n\nexport const resetPassword = resetPasswordObject =>\n action(RESET_USER_PASSWORD, { resetPasswordObject });\n\nexport const changePassword = (userId, currentPassword, newPassword) =>\n action(CHANGE_USER_PASSWORD, { userId, currentPassword, newPassword });\n","import { useDispatch, useSelector } from 'react-redux';\nimport { loginUser, logoutUser } from '../redux/actions';\nimport {\n selectUser,\n selectUserIsAuthenticationError,\n selectUserIsError,\n selectUserErrorMessage,\n selectUserIsAuthenticated,\n selectUserIsLoading,\n} from '../redux/selectors';\n\nconst useLogin = () => {\n const dispatch = useDispatch();\n const select = useSelector;\n\n return {\n loginUser: (username, password) => dispatch(loginUser(username, password)),\n logoutUser: redirectPath => dispatch(logoutUser(redirectPath)),\n errorMessage: select(selectUserErrorMessage),\n isAuthenticated: select(selectUserIsAuthenticated),\n isAuthenticationError: select(selectUserIsAuthenticationError),\n isError: select(selectUserIsError),\n isLoading: select(selectUserIsLoading),\n user: select(selectUser),\n // DEPRECATED: authenticationError is deprecated use isAuthenticationError instead\n authenticationError: select(selectUserIsAuthenticationError),\n // DEPRECATED: authenticationErrorMessage is deprecated use errorMessage instead\n authenticationErrorMessage: select(selectUserErrorMessage),\n // DEPRECATED: error is deprecated use isError instead\n error: select(selectUserIsError),\n };\n};\n\nexport default useLogin;\n","import useLogin from '../hooks/useLogin';\nimport { toJS } from '~/util/ToJs';\n\nconst LoginContainer = ({ children, ...props }) => {\n const userProps = useLogin(props);\n return children(userProps);\n};\n\nLoginContainer.propTypes = {};\n\nexport default toJS(LoginContainer);\n","import { useDispatch, useSelector } from 'react-redux';\nimport { registerUser } from '../redux/actions';\nimport {\n selectUserRegistration,\n selectUserRegistrationError,\n selectUserRegistrationIsLoading,\n selectUserRegistrationIsSuccess,\n} from '../redux/selectors';\n\nconst useRegistration = () => {\n const dispatch = useDispatch();\n const select = useSelector;\n\n return {\n registerUser: (user, mappers) => dispatch(registerUser(user, mappers)),\n error: select(selectUserRegistrationError),\n isLoading: select(selectUserRegistrationIsLoading),\n isSuccess: select(selectUserRegistrationIsSuccess),\n user: select(selectUserRegistration),\n };\n};\n\nexport default useRegistration;\n","import useRegistration from '../hooks/useRegistration';\nimport { toJS } from '~/util/ToJs';\n\nconst RegistrationContainer = ({ children, ...props }) => {\n const userProps = useRegistration(props);\n return children(userProps);\n};\n\nRegistrationContainer.propTypes = {};\n\nexport default toJS(RegistrationContainer);\n","import { useDispatch, useSelector } from 'react-redux';\nimport { requestPasswordReset, resetPassword } from '../redux/actions';\nimport {\n selectPasswordResetRequestError,\n selectPasswordResetRequestSending,\n selectPasswordResetRequestSent,\n selectResetPasswordSending,\n selectResetPasswordSent,\n selectResetPasswordError,\n} from '../redux/selectors';\nimport { selectCurrentSearch } from '~/routing/redux/selectors';\n\nconst useForgotPassword = () => {\n const dispatch = useDispatch();\n const select = useSelector;\n\n return {\n isLoading: select(selectPasswordResetRequestSending),\n isSuccess: select(selectPasswordResetRequestSent),\n error: select(selectPasswordResetRequestError),\n requestPasswordReset: userEmailObject =>\n dispatch(requestPasswordReset(userEmailObject)),\n\n setNewPassword: {\n queryString: select(selectCurrentSearch),\n isLoading: select(selectResetPasswordSending),\n isSuccess: select(selectResetPasswordSent),\n error: select(selectResetPasswordError),\n submit: resetPasswordObject =>\n dispatch(resetPassword(resetPasswordObject)),\n },\n };\n};\n\nexport default useForgotPassword;\n","import useForgotPassword from '../hooks/useForgotPassword';\nimport { toJS } from '~/util/ToJs';\n\nconst ForgotPasswordContainer = ({ children, ...props }) => {\n const userProps = useForgotPassword(props);\n return children(userProps);\n};\n\nForgotPasswordContainer.propTypes = {};\n\nexport default toJS(ForgotPasswordContainer);\n","import { useDispatch, useSelector } from 'react-redux';\nimport { changePassword } from '../redux/actions';\nimport {\n selectChangePasswordSending,\n selectChangePasswordSent,\n selectChangePasswordError,\n selectUserIsAuthenticated,\n selectUserGuid,\n} from '../redux/selectors';\n\nconst useChangePassword = () => {\n const dispatch = useDispatch();\n const select = useSelector;\n\n return {\n isLoading: select(selectChangePasswordSending),\n isSuccess: select(selectChangePasswordSent),\n userId: select(selectUserGuid),\n isLoggedIn: select(selectUserIsAuthenticated),\n error: select(selectChangePasswordError),\n changePassword: (userId, currentPassword, newPassword) =>\n dispatch(changePassword(userId, currentPassword, newPassword)),\n };\n};\n\nexport default useChangePassword;\n","import useChangePassword from '../hooks/useChangePassword';\nimport { toJS } from '~/util/ToJs';\n\nconst ChangePasswordContainer = ({ children, ...props }) => {\n const userProps = useChangePassword(props);\n return children(userProps);\n};\n\nChangePasswordContainer.propTypes = {};\n\nexport default toJS(ChangePasswordContainer);\n","import { connect } from 'react-redux';\nimport { loginUser, logoutUser } from '../redux/actions';\nimport {\n selectUser,\n selectUserIsAuthenticationError,\n selectUserIsError,\n selectUserIsAuthenticated,\n selectUserIsLoading,\n} from '../redux/selectors';\nimport { toJS } from '~/util/ToJs';\n\nconst getDisplayName = WrappedComponent => {\n return WrappedComponent.displayName || WrappedComponent.name || 'Component';\n};\n\nconst withLogin = WrappedComponent => {\n const mapStateToProps = state => {\n return {\n isAuthenticated: selectUserIsAuthenticated(state),\n isAuthenticationError: selectUserIsAuthenticationError(state),\n isError: selectUserIsError(state),\n isLoading: selectUserIsLoading(state),\n user: selectUser(state),\n // DEPRECATED: authenticationError is deprecated use isAuthenticationError instead\n authenticationError: selectUserIsAuthenticationError(state),\n // DEPRECATED: error is deprecated use isError instead\n error: selectUserIsError(state),\n };\n };\n\n const mapDispatchToProps = {\n loginUser,\n logoutUser,\n };\n\n const ConnectedComponent = connect(\n mapStateToProps,\n mapDispatchToProps\n )(toJS(WrappedComponent));\n\n ConnectedComponent.displayName = `${getDisplayName(WrappedComponent)}`;\n\n return ConnectedComponent;\n};\n\nexport default withLogin;\n","import { connect } from 'react-redux';\nimport { registerUser } from '../redux/actions';\nimport {\n selectUserRegistration,\n selectUserRegistrationError,\n selectUserRegistrationIsLoading,\n selectUserRegistrationIsSuccess,\n} from '../redux/selectors';\nimport { toJS } from '~/util/ToJs';\n\nconst getDisplayName = WrappedComponent => {\n return WrappedComponent.displayName || WrappedComponent.name || 'Component';\n};\n\nconst withRegistration = WrappedComponent => {\n const mapStateToProps = state => {\n return {\n error: selectUserRegistrationError(state),\n isLoading: selectUserRegistrationIsLoading(state),\n isSuccess: selectUserRegistrationIsSuccess(state),\n user: selectUserRegistration(state),\n };\n };\n\n const mapDispatchToProps = {\n registerUser,\n };\n\n const ConnectedComponent = connect(\n mapStateToProps,\n mapDispatchToProps\n )(toJS(WrappedComponent));\n\n ConnectedComponent.displayName = `${getDisplayName(WrappedComponent)}`;\n\n return ConnectedComponent;\n};\n\nexport default withRegistration;\n"],"names":["loginUser","username","password","action","LOGIN_USER","logoutUser","redirectPath","LOGOUT_USER","registerUser","user","mappers","REGISTER_USER","requestPasswordReset","userEmailObject","REQUEST_USER_PASSWORD_RESET","resetPassword","resetPasswordObject","RESET_USER_PASSWORD","changePassword","userId","currentPassword","newPassword","CHANGE_USER_PASSWORD","useLogin","dispatch","useDispatch","select","useSelector","errorMessage","selectUserErrorMessage","isAuthenticated","selectUserIsAuthenticated","isAuthenticationError","selectUserIsAuthenticationError","isError","selectUserIsError","isLoading","selectUserIsLoading","selectUser","authenticationError","authenticationErrorMessage","error","LoginContainer","children","props","userProps","propTypes","toJS","useRegistration","selectUserRegistrationError","selectUserRegistrationIsLoading","isSuccess","selectUserRegistrationIsSuccess","selectUserRegistration","RegistrationContainer","useForgotPassword","selectPasswordResetRequestSending","selectPasswordResetRequestSent","selectPasswordResetRequestError","setNewPassword","queryString","selectCurrentSearch","selectResetPasswordSending","selectResetPasswordSent","selectResetPasswordError","submit","ForgotPasswordContainer","useChangePassword","selectChangePasswordSending","selectChangePasswordSent","selectUserGuid","isLoggedIn","selectChangePasswordError","ChangePasswordContainer","getDisplayName","WrappedComponent","displayName","name","withLogin","mapStateToProps","state","mapDispatchToProps","ConnectedComponent","connect","withRegistration"],"mappings":";;;;;;;;;;;;;;;;;AAUO,MAAMA,SAAS,GAAGA,CAACC,QAAQ,EAAEC,QAAQ,KAC1CC,gBAAM,CAACC,mBAAU,EAAE;EAAEH,QAAQ;AAAEC,EAAAA,QAAAA;AAAS,CAAC,CAAC,CAAA;AAErC,MAAMG,UAAU,GAAGC,YAAY,IAAIH,gBAAM,CAACI,oBAAW,EAAE;AAAED,EAAAA,YAAAA;AAAa,CAAC,CAAC,CAAA;AAExE,MAAME,YAAY,GAAGA,CAACC,IAAI,EAAEC,OAAO,KACxCP,gBAAM,CAACQ,sBAAa,EAAE;EACpBF,IAAI;AACJC,EAAAA,OAAAA;AACF,CAAC,CAAC,CAAA;AAEG,MAAME,oBAAoB,GAAGC,eAAe,IACjDV,gBAAM,CAACW,oCAA2B,EAAE;AAAED,EAAAA,eAAAA;AAAgB,CAAC,CAAC,CAAA;AAEnD,MAAME,aAAa,GAAGC,mBAAmB,IAC9Cb,gBAAM,CAACc,4BAAmB,EAAE;AAAED,EAAAA,mBAAAA;AAAoB,CAAC,CAAC,CAAA;AAE/C,MAAME,cAAc,GAAGA,CAACC,MAAM,EAAEC,eAAe,EAAEC,WAAW,KACjElB,gBAAM,CAACmB,6BAAoB,EAAE;E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AA,EAAEF,gBAAc,CAACC,gBAAgB,CAAE,CAAC,CAAA,CAAA;AAEtE,EAAA,OAAOO,kBAAkB,CAAA;AAC3B;;ACjCA,MAAMR,cAAc,GAAGC,gBAAgB,IAAI;EACzC,OAAOA,gBAAgB,CAACC,WAAW,IAAID,gBAAgB,CAACE,IAAI,IAAI,WAAW,CAAA;AAC7E,CAAC,CAAA;AAEKO,MAAAA,gBAAgB,GAAGT,gBAAgB,IAAI;EAC3C,MAAMI,eAAe,GAAGC,KAAK,IAAI;IAC/B,OAAO;AACLvC,MAAAA,KAAK,EAAEQ,gCAA2B,CAAC+B,KAAK,CAAC;AACzC5C,MAAAA,SAAS,EAAEc,oCAA+B,CAAC8B,KAAK,CAAC;AACjD7B,MAAAA,SAAS,EAAEC,oCAA+B,CAAC4B,KAAK,CAAC;MACjDvE,IAAI,EAAE4C,2BAAsB,CAAC2B,KAAK,CAAA;KACnC,CAAA;GACF,CAAA;AAED,EAAA,MAAMC,kBAAkB,GAAG;AACzBzE,IAAAA,YAAAA;GACD,CAAA;AAED,EAAA,MAAM0E,kBAAkB,GAAGC,kBAAO,CAChCJ,eAAe,EACfE,kBAAkB,CACnB,CAAClC,SAAI,CAAC4B,gBAAgB,CAAC,CAAC,CAAA;EAEzBO,kBAAkB,CAACN,WAAW,GAAI,CAAA,EAAEF,cAAc,CAACC,gBAAgB,CAAE,CAAC,CAAA,CAAA;AAEtE,EAAA,OAAOO,kBAAkB,CAAA;AAC3B;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"user.js","sources":["../src/user/hocs/withLogin.js","../src/user/hocs/withRegistration.js"],"sourcesContent":["import React from 'react';\nimport { useCookies } from 'react-cookie';\nimport { connect } from 'react-redux';\nimport { loginUser, logoutUser } from '../redux/actions';\nimport {\n selectUser,\n selectUserErrorMessage,\n selectUserIsAuthenticationError,\n selectUserIsError,\n selectUserIsAuthenticated,\n selectUserIsLoading,\n} from '../redux/selectors';\nimport { CookieHelper } from '../util/CookieHelper.class';\nimport { toJS } from '~/util/ToJs';\n\nconst getDisplayName = WrappedComponent => {\n return WrappedComponent.displayName || WrappedComponent.name || 'Component';\n};\n\nconst withLogin = WrappedComponent => {\n const mapStateToProps = state => {\n return {\n errorMessage: selectUserErrorMessage(state),\n isAuthenticated: selectUserIsAuthenticated(state),\n isAuthenticationError: selectUserIsAuthenticationError(state),\n isError: selectUserIsError(state),\n isLoading: selectUserIsLoading(state),\n user: selectUser(state),\n // DEPRECATED: authenticationError is deprecated use isAuthenticationError instead\n authenticationError: selectUserIsAuthenticationError(state),\n // DEPRECATED: error is deprecated use isError instead\n error: selectUserIsError(state),\n };\n };\n\n const ConnectedComponent = () => {\n const cookies = new CookieHelper(...useCookies());\n\n const mapDispatchToProps = {\n loginUser: (username, password) => loginUser(username, password, cookies),\n logoutUser: redirectPath => logoutUser(redirectPath, cookies),\n };\n\n const FinalComponent = connect(\n mapStateToProps,\n mapDispatchToProps\n )(toJS(WrappedComponent));\n\n return <FinalComponent />;\n };\n\n ConnectedComponent.displayName = `${getDisplayName(WrappedComponent)}`;\n ConnectedComponent.WrappedComponent = WrappedComponent;\n\n return ConnectedComponent;\n};\n\nexport default withLogin;\n","import { connect } from 'react-redux';\nimport { registerUser } from '../redux/actions';\nimport {\n selectUserRegistration,\n selectUserRegistrationError,\n selectUserRegistrationIsLoading,\n selectUserRegistrationIsSuccess,\n} from '../redux/selectors';\nimport { toJS } from '~/util/ToJs';\n\nconst getDisplayName = WrappedComponent => {\n return WrappedComponent.displayName || WrappedComponent.name || 'Component';\n};\n\nconst withRegistration = WrappedComponent => {\n const mapStateToProps = state => {\n return {\n error: selectUserRegistrationError(state),\n isLoading: selectUserRegistrationIsLoading(state),\n isSuccess: selectUserRegistrationIsSuccess(state),\n user: selectUserRegistration(state),\n };\n };\n\n const mapDispatchToProps = {\n registerUser,\n };\n\n const ConnectedComponent = connect(\n mapStateToProps,\n mapDispatchToProps\n )(toJS(WrappedComponent));\n\n ConnectedComponent.displayName = `${getDisplayName(WrappedComponent)}`;\n\n return ConnectedComponent;\n};\n\nexport default withRegistration;\n"],"names":["getDisplayName","WrappedComponent","displayName","name","withLogin","mapStateToProps","state","errorMessage","selectUserErrorMessage","isAuthenticated","selectUserIsAuthenticated","isAuthenticationError","selectUserIsAuthenticationError","isError","selectUserIsError","isLoading","selectUserIsLoading","user","selectUser","authenticationError","error","ConnectedComponent","cookies","CookieHelper","useCookies","mapDispatchToProps","loginUser","username","password","logoutUser","redirectPath","FinalComponent","connect","toJS","React","createElement","withRegistration","selectUserRegistrationError","selectUserRegistrationIsLoading","isSuccess","selectUserRegistrationIsSuccess","selectUserRegistration","registerUser"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAeA,MAAMA,gBAAc,GAAGC,gBAAgB,IAAI;EACzC,OAAOA,gBAAgB,CAACC,WAAW,IAAID,gBAAgB,CAACE,IAAI,IAAI,WAAW,CAAA;AAC7E,CAAC,CAAA;AAEKC,MAAAA,SAAS,GAAGH,gBAAgB,IAAI;EACpC,MAAMI,eAAe,GAAGC,KAAK,IAAI;IAC/B,OAAO;AACLC,MAAAA,YAAY,EAAEC,2BAAsB,CAACF,KAAK,CAAC;AAC3CG,MAAAA,eAAe,EAAEC,8BAAyB,CAACJ,KAAK,CAAC;AACjDK,MAAAA,qBAAqB,EAAEC,oCAA+B,CAACN,KAAK,CAAC;AAC7DO,MAAAA,OAAO,EAAEC,sBAAiB,CAACR,KAAK,CAAC;AACjCS,MAAAA,SAAS,EAAEC,wBAAmB,CAACV,KAAK,CAAC;AACrCW,MAAAA,IAAI,EAAEC,eAAU,CAACZ,KAAK,CAAC;AACvB;AACAa,MAAAA,mBAAmB,EAAEP,oCAA+B,CAACN,KAAK,CAAC;AAC3D;MACAc,KAAK,EAAEN,sBAAiB,CAACR,KAAK,CAAA;KAC/B,CAAA;GACF,CAAA;EAED,MAAMe,kBAAkB,GAAGA,MAAM;IAC/B,MAAMC,OAAO,GAAG,IAAIC,iBAAY,CAAC,GAAGC,sBAAU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,MAAMrB,kBAAkB,GAAGW,kBAAO,CAChC3B,eAAe,EACfoB,kBAAkB,CACnB,CAACQ,SAAI,CAAChC,gBAAgB,CAAC,CAAC,CAAA;EAEzBoB,kBAAkB,CAACnB,WAAW,GAAI,CAAA,EAAEF,cAAc,CAACC,gBAAgB,CAAE,CAAC,CAAA,CAAA;AAEtE,EAAA,OAAOoB,kBAAkB,CAAA;AAC3B;;;;;;;;;;;;;;;;;;;;;"}
package/cjs/util.js CHANGED
@@ -3,15 +3,16 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var urls = require('./urls-6fcaf4c6.js');
6
- var ContensisDeliveryApi = require('./ContensisDeliveryApi-e37e14a9.js');
6
+ var ContensisDeliveryApi = require('./ContensisDeliveryApi-9e32960d.js');
7
7
  var mapJson = require('jsonpath-mapper');
8
8
  var React = require('react');
9
9
  var reactRedux = require('react-redux');
10
- var selectors = require('./selectors-fa836926.js');
11
- var version = require('./version-396cb8de.js');
10
+ var selectors = require('./selectors-46b689d0.js');
11
+ var version = require('./version-79a027cb.js');
12
12
  var styled = require('styled-components');
13
13
  require('contensis-delivery-api');
14
14
  require('query-string');
15
+ require('./CookieConstants-000427db.js');
15
16
  require('redux');
16
17
  require('redux-thunk');
17
18
  require('redux-saga');
@@ -303,7 +304,9 @@ var VersionInfo$1 = reactRedux.connect(mapStateToVersionInfo)(VersionInfo);
303
304
  exports.setCachingHeaders = urls.setCachingHeaders;
304
305
  exports.urls = urls.url;
305
306
  exports.cachedSearch = ContensisDeliveryApi.cachedSearch;
307
+ exports.cachedSearchWithCookies = ContensisDeliveryApi.cachedSearchWithCookies;
306
308
  exports.deliveryApi = ContensisDeliveryApi.deliveryApi;
309
+ exports.deliveryApiWithCookies = ContensisDeliveryApi.deliveryApiWithCookies;
307
310
  exports.getClientConfig = ContensisDeliveryApi.getClientConfig;
308
311
  Object.defineProperty(exports, 'jpath', {
309
312
  enumerable: true,