@zengenti/contensis-react-base 3.1.1-beta.2 → 3.1.1-beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/{App-a1dbd7aa.js → App-2eae74ad.js} +8 -8
- package/cjs/{App-a1dbd7aa.js.map → App-2eae74ad.js.map} +1 -1
- package/cjs/{ChangePassword.container-f3f94d8f.js → ChangePassword.container-10176dc6.js} +138 -142
- package/cjs/ChangePassword.container-10176dc6.js.map +1 -0
- package/cjs/{ContensisDeliveryApi-f521ae6d.js → ContensisDeliveryApi-fa344ffa.js} +2 -2
- package/cjs/{ContensisDeliveryApi-f521ae6d.js.map → ContensisDeliveryApi-fa344ffa.js.map} +1 -1
- package/cjs/{RouteLoader-014a95b9.js → RouteLoader-b74a77b5.js} +2 -2
- package/cjs/{RouteLoader-014a95b9.js.map → RouteLoader-b74a77b5.js.map} +1 -1
- package/cjs/ToJs-0a4a398d.js +507 -0
- package/cjs/ToJs-0a4a398d.js.map +1 -0
- package/cjs/client.js +8 -8
- package/cjs/contensis-react-base.js +10 -8
- package/cjs/contensis-react-base.js.map +1 -1
- package/cjs/{reducers-9afb5f89.js → reducers-ea1b2dc0.js} +1 -1
- package/cjs/{reducers-9afb5f89.js.map → reducers-ea1b2dc0.js.map} +1 -1
- package/cjs/redux.js +3 -3
- package/cjs/routing.js +2 -2
- package/cjs/user.js +3 -3
- package/cjs/user.js.map +1 -1
- package/cjs/util.js +3 -3
- package/cjs/{version-989bde88.js → version-bb4a3418.js} +2 -2
- package/cjs/{version-989bde88.js.map → version-bb4a3418.js.map} +1 -1
- package/cjs/{version-7f40f0c9.js → version-c2a37225.js} +2 -2
- package/cjs/{version-7f40f0c9.js.map → version-c2a37225.js.map} +1 -1
- package/esm/{App-c1ac80a3.js → App-24dd05d6.js} +8 -8
- package/esm/{App-c1ac80a3.js.map → App-24dd05d6.js.map} +1 -1
- package/esm/{ChangePassword.container-7cedf0d7.js → ChangePassword.container-51c4a04b.js} +138 -142
- package/esm/ChangePassword.container-51c4a04b.js.map +1 -0
- package/esm/{ContensisDeliveryApi-f2dbd377.js → ContensisDeliveryApi-e2c1c1f5.js} +2 -2
- package/esm/{ContensisDeliveryApi-f2dbd377.js.map → ContensisDeliveryApi-e2c1c1f5.js.map} +1 -1
- package/esm/{RouteLoader-cf80cfd0.js → RouteLoader-3837e459.js} +2 -2
- package/esm/{RouteLoader-cf80cfd0.js.map → RouteLoader-3837e459.js.map} +1 -1
- package/esm/ToJs-d321983a.js +476 -0
- package/esm/ToJs-d321983a.js.map +1 -0
- package/esm/client.js +9 -9
- package/esm/contensis-react-base.js +11 -9
- package/esm/contensis-react-base.js.map +1 -1
- package/esm/{reducers-3d5c37d1.js → reducers-919da5e0.js} +1 -1
- package/esm/{reducers-3d5c37d1.js.map → reducers-919da5e0.js.map} +1 -1
- package/esm/redux.js +5 -5
- package/esm/routing.js +2 -2
- package/esm/user.js +5 -5
- package/esm/user.js.map +1 -1
- package/esm/util.js +3 -3
- package/esm/{version-f1375303.js → version-5a0b9406.js} +2 -2
- package/esm/{version-f1375303.js.map → version-5a0b9406.js.map} +1 -1
- package/esm/{version-36d9d7e8.js → version-f6660b69.js} +2 -2
- package/esm/{version-36d9d7e8.js.map → version-f6660b69.js.map} +1 -1
- package/models/user/hocs/withLogin.d.ts +4 -3
- package/models/user/hooks/useLogin.d.ts +4 -4
- package/models/user/redux/actions.d.ts +7 -6
- package/models/user/redux/sagas/index.d.ts +1 -1
- package/models/user/redux/sagas/login.d.ts +5 -17
- package/models/user/redux/types.d.ts +21 -21
- package/models/user/state.d.ts +12 -0
- package/models/user/transformations/mapClientCredentials.d.ts +3 -1
- package/models/user/util/ContensisManagementApi.d.ts +10 -9
- package/models/user/util/CookieHelper.class.d.ts +7 -4
- package/models/user/util/LoginHelper.class.d.ts +27 -36
- package/models/user/util/OidcUserManager.d.ts +1 -1
- package/package.json +1 -1
- package/cjs/ChangePassword.container-f3f94d8f.js.map +0 -1
- package/cjs/ToJs-64970869.js +0 -175
- package/cjs/ToJs-64970869.js.map +0 -1
- package/esm/ChangePassword.container-7cedf0d7.js.map +0 -1
- package/esm/ToJs-f92e40c1.js +0 -144
- package/esm/ToJs-f92e40c1.js.map +0 -1
|
@@ -210,4 +210,4 @@ var UserReducer = produce((state, action) => {
|
|
|
210
210
|
}, initialUserState);
|
|
211
211
|
|
|
212
212
|
export { CHANGE_USER_PASSWORD as C, LOGIN_USER as L, REGISTER_USER as R, SET_AUTHENTICATION_STATE as S, UserReducer as U, VALIDATE_USER as V, REGISTER_USER_SUCCESS as a, REGISTER_USER_FAILED as b, REQUEST_USER_PASSWORD_RESET as c, RESET_USER_PASSWORD as d, REQUEST_USER_PASSWORD_RESET_SENDING as e, REQUEST_USER_PASSWORD_RESET_SUCCESS as f, REQUEST_USER_PASSWORD_RESET_ERROR as g, RESET_USER_PASSWORD_SENDING as h, RESET_USER_PASSWORD_SUCCESS as i, RESET_USER_PASSWORD_ERROR as j, CHANGE_USER_PASSWORD_ERROR as k, CHANGE_USER_PASSWORD_SENDING as l, CHANGE_USER_PASSWORD_SUCCESS as m, LOGOUT_USER as n, initialUserState as o, types as t };
|
|
213
|
-
//# sourceMappingURL=reducers-
|
|
213
|
+
//# sourceMappingURL=reducers-919da5e0.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reducers-3d5c37d1.js","sources":["../src/user/redux/types.js","../src/user/redux/reducers.ts"],"sourcesContent":["const ACTION_PREFIX = '@USER/';\nexport const VALIDATE_USER = `${ACTION_PREFIX}VALIDATE_USER`;\nexport const SET_AUTHENTICATION_STATE = `${ACTION_PREFIX}SET_AUTHENTICATION_STATE`;\nexport const LOGIN_USER = `${ACTION_PREFIX}LOGIN_USER`;\nexport const LOGIN_SUCCESSFUL = `${ACTION_PREFIX}LOGIN_SUCCESSFUL`;\nexport const LOGIN_FAILED = `${ACTION_PREFIX}LOGIN_FAILED`;\nexport const LOGOUT_USER = `${ACTION_PREFIX}LOGOUT_USER`;\nexport const REGISTER_USER = `${ACTION_PREFIX}REGISTER_USER`;\nexport const REGISTER_USER_SUCCESS = `${ACTION_PREFIX}REGISTER_USER_SUCCESS`;\nexport const REGISTER_USER_FAILED = `${ACTION_PREFIX}REGISTER_USER_FAILED`;\n\nexport const REQUEST_USER_PASSWORD_RESET = `${ACTION_PREFIX}REQUEST_USER_PASSWORD_RESET`;\nexport const RESET_USER_PASSWORD = `${ACTION_PREFIX}RESET_USER_PASSWORD`;\nexport const REQUEST_USER_PASSWORD_RESET_SENDING = `${ACTION_PREFIX}REQUEST_USER_PASSWORD_RESET_SENDING`;\nexport const REQUEST_USER_PASSWORD_RESET_SUCCESS = `${ACTION_PREFIX}REQUEST_USER_PASSWORD_RESET_SUCCESS`;\nexport const REQUEST_USER_PASSWORD_RESET_ERROR = `${ACTION_PREFIX}REQUEST_USER_PASSWORD_RESET_ERROR`;\nexport const RESET_USER_PASSWORD_SENDING = `${ACTION_PREFIX}RESET_USER_PASSWORD_SENDING`;\nexport const RESET_USER_PASSWORD_SUCCESS = `${ACTION_PREFIX}RESET_USER_PASSWORD_SUCCESS`;\nexport const RESET_USER_PASSWORD_ERROR = `${ACTION_PREFIX}RESET_USER_PASSWORD_ERROR`;\n\nexport const CHANGE_USER_PASSWORD = `${ACTION_PREFIX}CHANGE_USER_PASSWORD`;\nexport const CHANGE_USER_PASSWORD_SENDING = `${ACTION_PREFIX}CHANGE_USER_PASSWORD_SENDING`;\nexport const CHANGE_USER_PASSWORD_SUCCESS = `${ACTION_PREFIX}CHANGE_USER_PASSWORD_SUCCESS`;\nexport const CHANGE_USER_PASSWORD_ERROR = `${ACTION_PREFIX}CHANGE_USER_PASSWORD_ERROR`;\n","import { Draft, produce } from 'immer';\nimport { AppState } from '~/redux/appstate';\nimport {\n REGISTER_USER,\n REGISTER_USER_FAILED,\n REGISTER_USER_SUCCESS,\n SET_AUTHENTICATION_STATE,\n LOGIN_USER,\n LOGOUT_USER,\n REQUEST_USER_PASSWORD_RESET_SENDING,\n REQUEST_USER_PASSWORD_RESET_SUCCESS,\n REQUEST_USER_PASSWORD_RESET_ERROR,\n RESET_USER_PASSWORD_SENDING,\n RESET_USER_PASSWORD_SUCCESS,\n RESET_USER_PASSWORD_ERROR,\n CHANGE_USER_PASSWORD_SENDING,\n CHANGE_USER_PASSWORD_SUCCESS,\n CHANGE_USER_PASSWORD_ERROR,\n} from './types';\n\nconst defaultAuthenticationState = {\n clientCredentials: null,\n errorMessage: null,\n isAuthenticated: false,\n isAuthenticationError: false,\n isError: false,\n isLoading: false,\n};\n\nconst defaultPasswordResetRequestValues = {\n isSending: false,\n sent: false,\n error: null,\n};\n\nconst defaultResetPasswordValues = {\n isSending: false,\n sent: false,\n error: null,\n};\n\nconst defaultChangePasswordValues = {\n isSending: false,\n sent: false,\n error: null,\n};\n\nconst defaultRegistrationValues = {\n isLoading: false,\n success: false,\n error: null,\n};\n\nexport const initialUserState = {\n authenticationState: defaultAuthenticationState,\n passwordResetRequest: defaultPasswordResetRequestValues,\n resetPassword: defaultResetPasswordValues,\n changePassword: defaultChangePasswordValues,\n groups: [],\n};\n\nexport default produce((state: Draft<AppState['user']>, action) => {\n switch (action.type) {\n case LOGOUT_USER: {\n return initialUserState;\n }\n case LOGIN_USER:\n case SET_AUTHENTICATION_STATE: {\n if (!action.authenticationState) {\n action.authenticationState = defaultAuthenticationState;\n }\n\n const {\n authenticationState: {\n clientCredentials = null,\n errorMessage = null,\n isAuthenticated,\n isAuthenticationError = false,\n isError = false,\n isLoading = action.type === LOGIN_USER,\n },\n user,\n } = action;\n\n if (user) {\n user.name =\n `${user.firstName}${user.lastName ? ` ${user.lastName}` : ''}` ||\n null;\n user.isZengentiStaff = user.email.includes('@zengenti.com');\n }\n\n state = {\n ...initialUserState,\n ...(user || state),\n authenticationState: {\n clientCredentials,\n errorMessage,\n isAuthenticated:\n isAuthenticated || state?.authenticationState?.isAuthenticated,\n isAuthenticationError,\n isError,\n isLoading,\n },\n };\n return state;\n }\n // REGISTER_USER is the trigger to set the user.registration initial state\n // and will set user.registration.isLoading to true\n // REGISTER_USER_FAILED will unset user.registration.isLoading and will set\n // the value in user.registration.error\n // REGISTER_USER_SUCCESS will unset user.registration.isLoading and will\n // set user.registration to the created user from the api response\n case REGISTER_USER:\n case REGISTER_USER_FAILED:\n case REGISTER_USER_SUCCESS: {\n const { error, user } = action;\n\n // Set registration object from the supplied action.user\n // so we can call these values back later\n state.registration = (user ||\n state.registration ||\n defaultRegistrationValues) as typeof defaultRegistrationValues;\n\n // Set registration flags so the UI can track the status\n state.registration.success = action.type === REGISTER_USER_SUCCESS;\n state.registration.error = error || false;\n state.registration.isLoading = action.type === REGISTER_USER;\n return;\n }\n case REQUEST_USER_PASSWORD_RESET_SENDING:\n if (state.passwordResetRequest) {\n state.passwordResetRequest = { ...defaultPasswordResetRequestValues };\n state.passwordResetRequest.isSending = true;\n }\n return;\n case REQUEST_USER_PASSWORD_RESET_SUCCESS:\n if (state.passwordResetRequest) {\n state.passwordResetRequest.isSending = false;\n state.passwordResetRequest.sent = true;\n }\n return;\n case REQUEST_USER_PASSWORD_RESET_ERROR:\n if (state.passwordResetRequest) {\n state.passwordResetRequest.isSending = false;\n state.passwordResetRequest.error = action.error;\n }\n return;\n case RESET_USER_PASSWORD_SENDING:\n if (state.resetPassword) {\n state.resetPassword.isSending = true;\n }\n return;\n case RESET_USER_PASSWORD_SUCCESS:\n if (state.resetPassword) {\n state.resetPassword.isSending = false;\n state.resetPassword.sent = true;\n }\n return;\n case RESET_USER_PASSWORD_ERROR:\n if (state.resetPassword) {\n state.resetPassword.isSending = false;\n state.resetPassword.error = action.error;\n }\n return;\n case CHANGE_USER_PASSWORD_SENDING:\n if (state.changePassword) {\n state.changePassword.isSending = true;\n }\n return;\n case CHANGE_USER_PASSWORD_SUCCESS:\n if (state.changePassword) {\n state.changePassword.isSending = false;\n state.changePassword.sent = true;\n }\n return;\n case CHANGE_USER_PASSWORD_ERROR:\n if (state.changePassword) {\n state.changePassword.isSending = false;\n state.changePassword.error = action.error;\n }\n return;\n default:\n return;\n }\n}, initialUserState);\n"],"names":["ACTION_PREFIX","VALIDATE_USER","SET_AUTHENTICATION_STATE","LOGIN_USER","LOGIN_SUCCESSFUL","LOGIN_FAILED","LOGOUT_USER","REGISTER_USER","REGISTER_USER_SUCCESS","REGISTER_USER_FAILED","REQUEST_USER_PASSWORD_RESET","RESET_USER_PASSWORD","REQUEST_USER_PASSWORD_RESET_SENDING","REQUEST_USER_PASSWORD_RESET_SUCCESS","REQUEST_USER_PASSWORD_RESET_ERROR","RESET_USER_PASSWORD_SENDING","RESET_USER_PASSWORD_SUCCESS","RESET_USER_PASSWORD_ERROR","CHANGE_USER_PASSWORD","CHANGE_USER_PASSWORD_SENDING","CHANGE_USER_PASSWORD_SUCCESS","CHANGE_USER_PASSWORD_ERROR","defaultAuthenticationState","clientCredentials","errorMessage","isAuthenticated","isAuthenticationError","isError","isLoading","defaultPasswordResetRequestValues","isSending","sent","error","defaultResetPasswordValues","defaultChangePasswordValues","defaultRegistrationValues","success","initialUserState","authenticationState","passwordResetRequest","resetPassword","changePassword","groups","produce","state","action","type","_state","_state$authentication","user","name","firstName","lastName","isZengentiStaff","email","includes","registration"],"mappings":";;AAAA,MAAMA,aAAa,GAAG,QAAQ,CAAA;AACjBC,MAAAA,aAAa,GAAI,CAAA,EAAED,aAAc,CAAc,aAAA,EAAA;AAC/CE,MAAAA,wBAAwB,GAAI,CAAA,EAAEF,aAAc,CAAyB,wBAAA,EAAA;AACrEG,MAAAA,UAAU,GAAI,CAAA,EAAEH,aAAc,CAAW,UAAA,EAAA;AAC/C,MAAMI,gBAAgB,GAAI,CAAA,EAAEJ,aAAc,CAAiB,gBAAA,CAAA,CAAA;AAC3D,MAAMK,YAAY,GAAI,CAAA,EAAEL,aAAc,CAAa,YAAA,CAAA,CAAA;AAC7CM,MAAAA,WAAW,GAAI,CAAA,EAAEN,aAAc,CAAY,WAAA,EAAA;AAC3CO,MAAAA,aAAa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AAA;AAC3C,OAAA;AACA,MAAA,OAAA;AACF,IAAA;AACE,MAAA,OAAA;AAAO,GAAA;AAEb,CAAC,EAAEK,gBAAgB,CAAC;;;;"}
|
|
1
|
+
{"version":3,"file":"reducers-919da5e0.js","sources":["../src/user/redux/types.ts","../src/user/redux/reducers.ts"],"sourcesContent":["const ACTION_PREFIX = '@USER/';\nexport const VALIDATE_USER = `${ACTION_PREFIX}VALIDATE_USER`;\nexport const SET_AUTHENTICATION_STATE = `${ACTION_PREFIX}SET_AUTHENTICATION_STATE`;\nexport const LOGIN_USER = `${ACTION_PREFIX}LOGIN_USER`;\nexport const LOGIN_SUCCESSFUL = `${ACTION_PREFIX}LOGIN_SUCCESSFUL`;\nexport const LOGIN_FAILED = `${ACTION_PREFIX}LOGIN_FAILED`;\nexport const LOGOUT_USER = `${ACTION_PREFIX}LOGOUT_USER`;\nexport const REGISTER_USER = `${ACTION_PREFIX}REGISTER_USER`;\nexport const REGISTER_USER_SUCCESS = `${ACTION_PREFIX}REGISTER_USER_SUCCESS`;\nexport const REGISTER_USER_FAILED = `${ACTION_PREFIX}REGISTER_USER_FAILED`;\n\nexport const REQUEST_USER_PASSWORD_RESET = `${ACTION_PREFIX}REQUEST_USER_PASSWORD_RESET`;\nexport const RESET_USER_PASSWORD = `${ACTION_PREFIX}RESET_USER_PASSWORD`;\nexport const REQUEST_USER_PASSWORD_RESET_SENDING = `${ACTION_PREFIX}REQUEST_USER_PASSWORD_RESET_SENDING`;\nexport const REQUEST_USER_PASSWORD_RESET_SUCCESS = `${ACTION_PREFIX}REQUEST_USER_PASSWORD_RESET_SUCCESS`;\nexport const REQUEST_USER_PASSWORD_RESET_ERROR = `${ACTION_PREFIX}REQUEST_USER_PASSWORD_RESET_ERROR`;\nexport const RESET_USER_PASSWORD_SENDING = `${ACTION_PREFIX}RESET_USER_PASSWORD_SENDING`;\nexport const RESET_USER_PASSWORD_SUCCESS = `${ACTION_PREFIX}RESET_USER_PASSWORD_SUCCESS`;\nexport const RESET_USER_PASSWORD_ERROR = `${ACTION_PREFIX}RESET_USER_PASSWORD_ERROR`;\n\nexport const CHANGE_USER_PASSWORD = `${ACTION_PREFIX}CHANGE_USER_PASSWORD`;\nexport const CHANGE_USER_PASSWORD_SENDING = `${ACTION_PREFIX}CHANGE_USER_PASSWORD_SENDING`;\nexport const CHANGE_USER_PASSWORD_SUCCESS = `${ACTION_PREFIX}CHANGE_USER_PASSWORD_SUCCESS`;\nexport const CHANGE_USER_PASSWORD_ERROR = `${ACTION_PREFIX}CHANGE_USER_PASSWORD_ERROR`;\n","import { Draft, produce } from 'immer';\nimport { AppState } from '~/redux/appstate';\nimport {\n REGISTER_USER,\n REGISTER_USER_FAILED,\n REGISTER_USER_SUCCESS,\n SET_AUTHENTICATION_STATE,\n LOGIN_USER,\n LOGOUT_USER,\n REQUEST_USER_PASSWORD_RESET_SENDING,\n REQUEST_USER_PASSWORD_RESET_SUCCESS,\n REQUEST_USER_PASSWORD_RESET_ERROR,\n RESET_USER_PASSWORD_SENDING,\n RESET_USER_PASSWORD_SUCCESS,\n RESET_USER_PASSWORD_ERROR,\n CHANGE_USER_PASSWORD_SENDING,\n CHANGE_USER_PASSWORD_SUCCESS,\n CHANGE_USER_PASSWORD_ERROR,\n} from './types';\n\nconst defaultAuthenticationState = {\n clientCredentials: null,\n errorMessage: null,\n isAuthenticated: false,\n isAuthenticationError: false,\n isError: false,\n isLoading: false,\n};\n\nconst defaultPasswordResetRequestValues = {\n isSending: false,\n sent: false,\n error: null,\n};\n\nconst defaultResetPasswordValues = {\n isSending: false,\n sent: false,\n error: null,\n};\n\nconst defaultChangePasswordValues = {\n isSending: false,\n sent: false,\n error: null,\n};\n\nconst defaultRegistrationValues = {\n isLoading: false,\n success: false,\n error: null,\n};\n\nexport const initialUserState = {\n authenticationState: defaultAuthenticationState,\n passwordResetRequest: defaultPasswordResetRequestValues,\n resetPassword: defaultResetPasswordValues,\n changePassword: defaultChangePasswordValues,\n groups: [],\n};\n\nexport default produce((state: Draft<AppState['user']>, action) => {\n switch (action.type) {\n case LOGOUT_USER: {\n return initialUserState;\n }\n case LOGIN_USER:\n case SET_AUTHENTICATION_STATE: {\n if (!action.authenticationState) {\n action.authenticationState = defaultAuthenticationState;\n }\n\n const {\n authenticationState: {\n clientCredentials = null,\n errorMessage = null,\n isAuthenticated,\n isAuthenticationError = false,\n isError = false,\n isLoading = action.type === LOGIN_USER,\n },\n user,\n } = action;\n\n if (user) {\n user.name =\n `${user.firstName}${user.lastName ? ` ${user.lastName}` : ''}` ||\n null;\n user.isZengentiStaff = user.email.includes('@zengenti.com');\n }\n\n state = {\n ...initialUserState,\n ...(user || state),\n authenticationState: {\n clientCredentials,\n errorMessage,\n isAuthenticated:\n isAuthenticated || state?.authenticationState?.isAuthenticated,\n isAuthenticationError,\n isError,\n isLoading,\n },\n };\n return state;\n }\n // REGISTER_USER is the trigger to set the user.registration initial state\n // and will set user.registration.isLoading to true\n // REGISTER_USER_FAILED will unset user.registration.isLoading and will set\n // the value in user.registration.error\n // REGISTER_USER_SUCCESS will unset user.registration.isLoading and will\n // set user.registration to the created user from the api response\n case REGISTER_USER:\n case REGISTER_USER_FAILED:\n case REGISTER_USER_SUCCESS: {\n const { error, user } = action;\n\n // Set registration object from the supplied action.user\n // so we can call these values back later\n state.registration = (user ||\n state.registration ||\n defaultRegistrationValues) as typeof defaultRegistrationValues;\n\n // Set registration flags so the UI can track the status\n state.registration.success = action.type === REGISTER_USER_SUCCESS;\n state.registration.error = error || false;\n state.registration.isLoading = action.type === REGISTER_USER;\n return;\n }\n case REQUEST_USER_PASSWORD_RESET_SENDING:\n if (state.passwordResetRequest) {\n state.passwordResetRequest = { ...defaultPasswordResetRequestValues };\n state.passwordResetRequest.isSending = true;\n }\n return;\n case REQUEST_USER_PASSWORD_RESET_SUCCESS:\n if (state.passwordResetRequest) {\n state.passwordResetRequest.isSending = false;\n state.passwordResetRequest.sent = true;\n }\n return;\n case REQUEST_USER_PASSWORD_RESET_ERROR:\n if (state.passwordResetRequest) {\n state.passwordResetRequest.isSending = false;\n state.passwordResetRequest.error = action.error;\n }\n return;\n case RESET_USER_PASSWORD_SENDING:\n if (state.resetPassword) {\n state.resetPassword.isSending = true;\n }\n return;\n case RESET_USER_PASSWORD_SUCCESS:\n if (state.resetPassword) {\n state.resetPassword.isSending = false;\n state.resetPassword.sent = true;\n }\n return;\n case RESET_USER_PASSWORD_ERROR:\n if (state.resetPassword) {\n state.resetPassword.isSending = false;\n state.resetPassword.error = action.error;\n }\n return;\n case CHANGE_USER_PASSWORD_SENDING:\n if (state.changePassword) {\n state.changePassword.isSending = true;\n }\n return;\n case CHANGE_USER_PASSWORD_SUCCESS:\n if (state.changePassword) {\n state.changePassword.isSending = false;\n state.changePassword.sent = true;\n }\n return;\n case CHANGE_USER_PASSWORD_ERROR:\n if (state.changePassword) {\n state.changePassword.isSending = false;\n state.changePassword.error = action.error;\n }\n return;\n default:\n return;\n }\n}, initialUserState);\n"],"names":["ACTION_PREFIX","VALIDATE_USER","SET_AUTHENTICATION_STATE","LOGIN_USER","LOGIN_SUCCESSFUL","LOGIN_FAILED","LOGOUT_USER","REGISTER_USER","REGISTER_USER_SUCCESS","REGISTER_USER_FAILED","REQUEST_USER_PASSWORD_RESET","RESET_USER_PASSWORD","REQUEST_USER_PASSWORD_RESET_SENDING","REQUEST_USER_PASSWORD_RESET_SUCCESS","REQUEST_USER_PASSWORD_RESET_ERROR","RESET_USER_PASSWORD_SENDING","RESET_USER_PASSWORD_SUCCESS","RESET_USER_PASSWORD_ERROR","CHANGE_USER_PASSWORD","CHANGE_USER_PASSWORD_SENDING","CHANGE_USER_PASSWORD_SUCCESS","CHANGE_USER_PASSWORD_ERROR","defaultAuthenticationState","clientCredentials","errorMessage","isAuthenticated","isAuthenticationError","isError","isLoading","defaultPasswordResetRequestValues","isSending","sent","error","defaultResetPasswordValues","defaultChangePasswordValues","defaultRegistrationValues","success","initialUserState","authenticationState","passwordResetRequest","resetPassword","changePassword","groups","produce","state","action","type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cAAc,EAAE;AACxBG,QAAAA,KAAK,CAACH,cAAc,CAACX,SAAS,GAAG,IAAI,CAAA;AACvC,OAAA;AACA,MAAA,OAAA;AACF,IAAA,KAAKV,4BAA4B;MAC/B,IAAIwB,KAAK,CAACH,cAAc,EAAE;AACxBG,QAAAA,KAAK,CAACH,cAAc,CAACX,SAAS,GAAG,KAAK,CAAA;AACtCc,QAAAA,KAAK,CAACH,cAAc,CAACV,IAAI,GAAG,IAAI,CAAA;AAClC,OAAA;AACA,MAAA,OAAA;AACF,IAAA,KAAKV,0BAA0B;MAC7B,IAAIuB,KAAK,CAACH,cAAc,EAAE;AACxBG,QAAAA,KAAK,CAACH,cAAc,CAACX,SAAS,GAAG,KAAK,CAAA;AACtCc,QAAAA,KAAK,CAACH,cAAc,CAACT,KAAK,GAAGa,MAAM,CAACb,KAAK,CAAA;AAC3C,OAAA;AACA,MAAA,OAAA;AACF,IAAA;AACE,MAAA,OAAA;AAAO,GAAA;AAEb,CAAC,EAAEK,gBAAgB,CAAC;;;;"}
|
package/esm/redux.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { n as navigation$2, v as version$1, G as GET_NODE_TREE, e as version$3 } from './version-
|
|
2
|
-
export { r as store } from './version-
|
|
1
|
+
import { n as navigation$2, v as version$1, G as GET_NODE_TREE, e as version$3 } from './version-f6660b69.js';
|
|
2
|
+
export { r as store } from './version-f6660b69.js';
|
|
3
3
|
import { F as routing$1, E as action, G as routing$2, H as routing$3 } from './selectors-1f0cc787.js';
|
|
4
4
|
export { E as action, g as getIn, I as getJS } from './selectors-1f0cc787.js';
|
|
5
|
-
import { v as version$2, n as navigation$3 } from './version-
|
|
6
|
-
export { c as convertSagaArray, b as injectReducer, i as injectRedux, d as injectSaga, u as useInjectRedux } from './version-
|
|
5
|
+
import { v as version$2, n as navigation$3 } from './version-5a0b9406.js';
|
|
6
|
+
export { c as convertSagaArray, b as injectReducer, i as injectRedux, d as injectSaga, u as useInjectRedux } from './version-5a0b9406.js';
|
|
7
7
|
import 'redux';
|
|
8
8
|
import 'redux-thunk';
|
|
9
9
|
import 'redux-saga';
|
|
10
10
|
import 'redux-injectors';
|
|
11
11
|
import 'immer';
|
|
12
|
-
import './reducers-
|
|
12
|
+
import './reducers-919da5e0.js';
|
|
13
13
|
import 'jsonpath-mapper';
|
|
14
14
|
import 'query-string';
|
|
15
15
|
import '@redux-saga/core/effects';
|
package/esm/routing.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { G as actions, H as selectors, F as types } from './selectors-1f0cc787.js';
|
|
2
|
-
export { R as RouteLoader } from './RouteLoader-
|
|
2
|
+
export { R as RouteLoader } from './RouteLoader-3837e459.js';
|
|
3
3
|
import 'jsonpath-mapper';
|
|
4
4
|
import 'query-string';
|
|
5
5
|
import 'react';
|
|
@@ -9,5 +9,5 @@ import 'react-hot-loader';
|
|
|
9
9
|
import 'react-router-dom';
|
|
10
10
|
import 'react-router-config';
|
|
11
11
|
import 'reselect';
|
|
12
|
-
import './ToJs-
|
|
12
|
+
import './ToJs-d321983a.js';
|
|
13
13
|
//# sourceMappingURL=routing.js.map
|
package/esm/user.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { a as loginUser, b as logoutUser, r as registerUser } from './ChangePassword.container-
|
|
2
|
-
export { C as ChangePassword, F as ForgotPasswordContainer, d as LoginContainer, L as LoginHelper, R as RegistrationContainer, c as actions, h as handleRequiresLoginSaga, k as refreshSecurityToken, j as useChangePassword, i as useForgotPassword, u as useLogin, e as useRegistration } from './ChangePassword.container-
|
|
1
|
+
import { a as loginUser, b as logoutUser, r as registerUser } from './ChangePassword.container-51c4a04b.js';
|
|
2
|
+
export { C as ChangePassword, F as ForgotPasswordContainer, d as LoginContainer, L as LoginHelper, R as RegistrationContainer, c as actions, h as handleRequiresLoginSaga, k as refreshSecurityToken, j as useChangePassword, i as useForgotPassword, u as useLogin, e as useRegistration } from './ChangePassword.container-51c4a04b.js';
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import { useCookies } from 'react-cookie';
|
|
5
5
|
import { connect } from 'react-redux';
|
|
6
|
-
import { C as CookieHelper, t as toJS, c as selectUserErrorMessage, a as selectUserIsAuthenticated, d as selectUserIsAuthenticationError, e as selectUserIsError, f as selectUserIsLoading, g as selectUser, h as selectUserRegistrationError, i as selectUserRegistrationIsLoading, j as selectUserRegistrationIsSuccess, k as selectUserRegistration } from './ToJs-
|
|
7
|
-
export { y as selectors } from './ToJs-
|
|
8
|
-
export { o as initialUserState, U as reducer, t as types } from './reducers-
|
|
6
|
+
import { C as CookieHelper, t as toJS, c as selectUserErrorMessage, a as selectUserIsAuthenticated, d as selectUserIsAuthenticationError, e as selectUserIsError, f as selectUserIsLoading, g as selectUser, h as selectUserRegistrationError, i as selectUserRegistrationIsLoading, j as selectUserRegistrationIsSuccess, k as selectUserRegistration } from './ToJs-d321983a.js';
|
|
7
|
+
export { y as selectors } from './ToJs-d321983a.js';
|
|
8
|
+
export { o as initialUserState, U as reducer, t as types } from './reducers-919da5e0.js';
|
|
9
9
|
import '@redux-saga/core/effects';
|
|
10
10
|
import './selectors-1f0cc787.js';
|
|
11
11
|
import 'jsonpath-mapper';
|
package/esm/user.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user.js","sources":["../src/user/hocs/withLogin.
|
|
1
|
+
{"version":3,"file":"user.js","sources":["../src/user/hocs/withLogin.tsx","../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';\nimport { AppState } from '~/redux/appstate';\n\nconst getDisplayName = (WrappedComponent: React.ComponentType) => {\n return WrappedComponent.displayName || WrappedComponent.name || 'Component';\n};\n\nconst withLogin = (WrappedComponent: React.ComponentType) => {\n const mapStateToProps = (state: AppState) => {\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: string, password: string) =>\n loginUser(username, password, cookies),\n logoutUser: (redirectPath?: string) => 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":";;;;;;;;;;;;;;;;AAgBA,MAAMA,gBAAc,GAAIC,gBAAqC,IAAK;EAChE,OAAOA,gBAAgB,CAACC,WAAW,IAAID,gBAAgB,CAACE,IAAI,IAAI,WAAW,CAAA;AAC7E,CAAC,CAAA;AAEKC,MAAAA,SAAS,GAAIH,gBAAqC,IAAK;EAC3D,MAAMI,eAAe,GAAIC,KAAe,IAAK;IAC3C,OAAO;AACLC,MAAAA,YAAY,EAAEC,sBAAsB,CAACF,KAAK,CAAC;AAC3CG,MAAAA,eAAe,EAAEC,yBAAyB,CAACJ,KAAK,CAAC;AACjDK,MAAAA,qBAAqB,EAAEC,+BAA+B,CAACN,KAAK,CAAC;AAC7DO,MAAAA,OAAO,EAAEC,iBAAiB,CAACR,KAAK,CAAC;AACjCS,MAAAA,SAAS,EAAEC,mBAAmB,CAACV,KAAK,CAAC;AACrCW,MAAAA,IAAI,EAAEC,UAAU,CAACZ,KAAK,CAAC;AACvB;AACAa,MAAAA,mBAAmB,EAAEP,+BAA+B,CAACN,KAAK,CAAC;AAC3D;MACAc,KAAK,EAAEN,iBAAiB,CAACR,KAAK,CAAA;KAC/B,CAAA;GACF,CAAA;EAED,MAAMe,kBAAkB,GAAGA,MAAM;IAC/B,MAAMC,OAAO,GAAG,IAAIC,YAAY,CAAC,GAAGC,UAAU,EAAE,CAAC,CAAA;AAEjD,IAA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C3B,eAAe,EACfoB,kBAAkB,CACnB,CAACQ,IAAI,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/esm/util.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
export { s as setCachingHeaders, u as urls } from './urls-eac9a747.js';
|
|
2
|
-
export { c as cachedSearch, a as cachedSearchWithCookies, d as deliveryApi, b as deliveryApiWithCookies, g as getClientConfig } from './ContensisDeliveryApi-
|
|
2
|
+
export { c as cachedSearch, a as cachedSearchWithCookies, d as deliveryApi, b as deliveryApiWithCookies, g as getClientConfig } from './ContensisDeliveryApi-e2c1c1f5.js';
|
|
3
3
|
import mapJson, { jpath } from 'jsonpath-mapper';
|
|
4
4
|
export { jpath, default as mapJson } from 'jsonpath-mapper';
|
|
5
5
|
import React from 'react';
|
|
6
6
|
import { connect } from 'react-redux';
|
|
7
7
|
import { b as selectCurrentProject } from './selectors-1f0cc787.js';
|
|
8
|
-
import { f as selectCommitRef, g as selectBuildNumber, s as selectVersionStatus } from './version-
|
|
8
|
+
import { f as selectCommitRef, g as selectBuildNumber, s as selectVersionStatus } from './version-f6660b69.js';
|
|
9
9
|
import styled from 'styled-components';
|
|
10
10
|
import 'contensis-delivery-api';
|
|
11
11
|
import 'query-string';
|
|
@@ -15,7 +15,7 @@ import 'redux-thunk';
|
|
|
15
15
|
import 'redux-saga';
|
|
16
16
|
import 'redux-injectors';
|
|
17
17
|
import 'immer';
|
|
18
|
-
import './reducers-
|
|
18
|
+
import './reducers-919da5e0.js';
|
|
19
19
|
|
|
20
20
|
/**
|
|
21
21
|
*
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { g as getImmutableOrJS, E as action } from './selectors-1f0cc787.js';
|
|
2
2
|
import { all } from '@redux-saga/core/effects';
|
|
3
|
-
import { r as reduxStore, b as SET_VERSION_STATUS, d as SET_VERSION } from './version-
|
|
3
|
+
import { r as reduxStore, b as SET_VERSION_STATUS, d as SET_VERSION } from './version-f6660b69.js';
|
|
4
4
|
|
|
5
5
|
const hasNavigationTree = state => getImmutableOrJS(state, ['navigation', 'isReady']);
|
|
6
6
|
const selectNavigationRoot = state => getImmutableOrJS(state, ['navigation', 'root']);
|
|
@@ -84,4 +84,4 @@ var version = /*#__PURE__*/Object.freeze({
|
|
|
84
84
|
});
|
|
85
85
|
|
|
86
86
|
export { setVersion as a, injectReducer as b, convertSagaArray as c, injectSaga as d, hasNavigationTree as h, injectRedux as i, navigation as n, setVersionStatus as s, useInjectRedux as u, version as v };
|
|
87
|
-
//# sourceMappingURL=version-
|
|
87
|
+
//# sourceMappingURL=version-5a0b9406.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version-
|
|
1
|
+
{"version":3,"file":"version-5a0b9406.js","sources":["../src/redux/selectors/navigation.js","../src/redux/store/injectors.js","../src/redux/actions/version.js"],"sourcesContent":["import { getImmutableOrJS as getIn } from '~/redux/util';\n\nexport const hasNavigationTree = state =>\n getIn(state, ['navigation', 'isReady']);\n\nexport const selectNavigationRoot = state =>\n getIn(state, ['navigation', 'root']);\n\nexport const selectNavigationChildren = state =>\n getIn(state, ['navigation', 'root', 'children']);\n\nexport const selectNavigationDepends = () => [];\n","import { all } from 'redux-saga/effects';\nimport { reduxStore as DefaultStore } from './store';\n\nexport const convertSagaArray = sagas => {\n if (Array.isArray(sagas))\n return function* rootSaga() {\n yield all(sagas);\n };\n return sagas;\n};\n\nexport const injectReducer = ({ key, reducer }, store = DefaultStore) => {\n if (\n Reflect.has(store.injectedReducers, key) &&\n store.injectedReducers[key] === reducer\n )\n return;\n store.injectedReducers[key] = reducer;\n\n store.replaceReducer(store.createReducer(store.injectedReducers));\n};\n\nexport const injectSaga = ({ key, saga }, store = DefaultStore) => {\n const rootSaga = convertSagaArray(saga);\n let hasSaga = Reflect.has(store.injectedSagas, key);\n\n if (process.env.NODE_ENV !== 'production') {\n const oldDescriptor = store.injectedSagas[key]; // enable hot reloading of daemon and once-till-unmount sagas\n\n if (hasSaga && oldDescriptor.saga !== rootSaga) {\n oldDescriptor.task.cancel();\n hasSaga = false;\n }\n }\n console.info('injectSaga, key: ', key, 'hasSaga: ', hasSaga);\n\n if (!hasSaga) {\n store.injectedSagas[key] = {\n key,\n saga: rootSaga,\n task: store.runSaga(rootSaga),\n };\n }\n};\n\nexport const injectRedux = ({ key, reducer, saga }, store = DefaultStore) => {\n console.info('injectRedux, key: ', key);\n if (reducer) injectReducer({ key, reducer }, store);\n if (saga) injectSaga({ key, saga }, store);\n};\n\nexport const useInjectRedux = injectRedux;\n","import { action } from '../util';\nimport { SET_VERSION, SET_VERSION_STATUS } from '../types/version';\n\nexport const setVersion = (commitRef, buildNo) =>\n action(SET_VERSION, { commitRef, buildNo });\n\nexport const setVersionStatus = status =>\n action(SET_VERSION_STATUS, { status });\n"],"names":["hasNavigationTree","state","getIn","selectNavigationRoot","selectNavigationChildren","selectNavigationDepends","convertSagaArray","sagas","Array","isArray","rootSaga","all","injectReducer","key","reducer","store","DefaultStore","Reflect","has","injectedReducers","replaceReducer","createReducer","injectSaga","saga","hasSaga","injectedSagas","process","env","NODE_ENV","oldDescriptor","task","cancel","console","info","runSaga","injectRedux","useInjectRedux","setVersion","commitRef","buildNo","action","SET_VERSION","setVersionStatus","status","SET_VERSION_STATUS"],"mappings":";;;;AAEaA,MAAAA,iBAAiB,GAAGC,KAAK,IACpCC,gBAAK,CAACD,KAAK,EAAE,CAAC,YAAY,EAAE,SAAS,CAAC,EAAC;AAElC,MAAME,oBAAoB,GAAGF,KAAK,IACvCC,gBAAK,CAACD,KAAK,EAAE,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC,CAAA;AAE/B,MAAMG,wBAAwB,GAAGH,KAAK,IAC3CC,gBAAK,CAACD,KAAK,EAAE,CAAC,YAA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|
4
4
|
import { createInjectorsEnhancer } from 'redux-injectors';
|
|
5
5
|
import { produce, original } from 'immer';
|
|
6
6
|
import { C as SET_TARGET_PROJECT, D as SET_SURROGATE_KEYS, o as SET_SIBLINGS, e as SET_ROUTE, S as SET_NAVIGATION_PATH, U as UPDATE_LOADING_STATE, m as SET_ENTRY, n as SET_ANCESTORS, g as getImmutableOrJS } from './selectors-1f0cc787.js';
|
|
7
|
-
import { U as UserReducer } from './reducers-
|
|
7
|
+
import { U as UserReducer } from './reducers-919da5e0.js';
|
|
8
8
|
|
|
9
9
|
const ACTION_PREFIX = '@NAVIGATION/';
|
|
10
10
|
const GET_NODE_TREE = `${ACTION_PREFIX}_GET_NODE_TREE`;
|
|
@@ -319,4 +319,4 @@ var version = /*#__PURE__*/Object.freeze({
|
|
|
319
319
|
});
|
|
320
320
|
|
|
321
321
|
export { GET_NODE_TREE as G, SET_NODE_TREE as S, GET_NODE_TREE_ERROR as a, SET_VERSION_STATUS as b, createStore as c, SET_VERSION as d, version as e, selectCommitRef as f, selectBuildNumber as g, navigation as n, reduxStore as r, selectVersionStatus as s, version$1 as v };
|
|
322
|
-
//# sourceMappingURL=version-
|
|
322
|
+
//# sourceMappingURL=version-f6660b69.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version-36d9d7e8.js","sources":["../src/redux/types/navigation.js","../src/redux/reducers/navigation.ts","../src/routing/redux/reducers.ts","../src/redux/types/version.js","../src/redux/reducers/version.ts","../src/redux/store/routerMiddleware.js","../src/redux/store/store.ts","../src/redux/selectors/version.js"],"sourcesContent":["const ACTION_PREFIX = '@NAVIGATION/';\nexport const GET_NODE_TREE = `${ACTION_PREFIX}_GET_NODE_TREE`;\nexport const SET_NODE_TREE = `${ACTION_PREFIX}_SET_NODE_TREE`;\nexport const GET_NODE_TREE_ERROR = `${ACTION_PREFIX}_GET_NODE_TREE_ERROR`;\n","import { Draft, produce } from 'immer';\nimport { SET_NODE_TREE, GET_NODE_TREE_ERROR } from '~/redux/types/navigation';\n\nconst initialState = {\n root: null,\n error: {\n isError: false,\n message: null,\n },\n isReady: false,\n};\n\nexport default produce((state: Draft<any>, action) => {\n switch (action.type) {\n case SET_NODE_TREE: {\n state.root = action.nodes;\n state.isReady = true;\n return;\n }\n case GET_NODE_TREE_ERROR: {\n state.error.isError = true;\n state.error.message = action.error || 'Unknown error occurred';\n return;\n }\n default:\n return;\n }\n}, initialState);\n","import { Draft, original, produce } from 'immer';\n\nimport {\n SET_ENTRY,\n SET_NAVIGATION_PATH,\n SET_ANCESTORS,\n SET_TARGET_PROJECT,\n SET_ROUTE,\n SET_SIBLINGS,\n SET_SURROGATE_KEYS,\n UPDATE_LOADING_STATE,\n} from './types';\n\nconst initialState = {\n canonicalPath: null,\n currentHostname: null,\n currentPath: '/',\n currentNode: {},\n currentNodeAncestors: [],\n currentProject: 'unknown',\n entryID: null,\n entry: null,\n error: undefined,\n isError: false,\n isLoading: false,\n location: {},\n mappedEntry: null,\n notFound: false,\n staticRoute: null,\n statusCode: 200,\n surrogateKeys: [],\n apiCalls: [],\n};\n\nexport default produce((state: Draft<any>, action) => {\n switch (action.type) {\n case SET_ANCESTORS: {\n state.currentNodeAncestors = action.ancestors;\n return;\n }\n case SET_ENTRY: {\n const {\n entry,\n error,\n mappedEntry,\n node = {},\n isError = false,\n isLoading = false,\n notFound = false,\n statusCode,\n currentPath,\n } = action;\n\n let defaultStatus = 200;\n if (notFound === true && isError === false) defaultStatus = 404;\n else if (isError === true) defaultStatus = statusCode || 500;\n\n if (!entry) {\n state.entryID = null;\n state.entry = null;\n state.error = error;\n state.mappedEntry = null;\n state.isError = isError;\n state.isLoading = isLoading;\n state.notFound = notFound;\n state.statusCode = statusCode || defaultStatus;\n state.canonicalPath = currentPath;\n } else {\n state.entryID = action.id;\n state.entry = entry;\n state.error = error;\n state.isError = isError;\n state.isLoading = isLoading;\n state.notFound = notFound;\n state.statusCode = statusCode || defaultStatus;\n state.canonicalPath = entry.sys.uri || currentPath;\n\n if (mappedEntry && Object.keys(mappedEntry).length > 0) {\n state.mappedEntry = mappedEntry;\n state.entry = { sys: entry.sys };\n }\n }\n\n if (!node) {\n state.currentNode = null;\n } else {\n // On Set Node, we reset all dependants.\n state.currentNode = node;\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { entry, ...nodeWithoutEntry } = node; // We have the entry stored elsewhere, so lets not keep it twice.\n state.currentNode = nodeWithoutEntry;\n }\n\n return;\n }\n case UPDATE_LOADING_STATE: {\n state.isLoading = action.isLoading;\n return;\n }\n case SET_NAVIGATION_PATH: {\n let staticRoute = {} as any;\n if (action.staticRoute) {\n staticRoute = { ...action.staticRoute };\n }\n if (action.path) {\n // Don't run a path update on initial load as we allready should have it in redux\n const entryUri = state?.entry?.sys?.uri;\n if (entryUri !== action.path) {\n state.currentPath = action.path;\n state.location = action.location;\n state.staticRoute = {\n ...staticRoute,\n route: { ...staticRoute.route, component: null },\n };\n state.isLoading = typeof window !== 'undefined';\n } else {\n state.location = action.location;\n state.staticRoute = {\n ...staticRoute,\n route: { ...staticRoute.route, component: null },\n };\n }\n }\n return;\n }\n case SET_ROUTE: {\n state.nextPath = action.path;\n return;\n }\n case SET_SIBLINGS: {\n // Can be null in some cases like the homepage.\n let currentNodeSiblingParent = null;\n if (action.siblings && action.siblings.length > 0) {\n currentNodeSiblingParent = action.siblings[0].parentId;\n }\n\n state.currentNodeSiblings = action.siblings;\n state.currentNodeSiblingsParent = currentNodeSiblingParent;\n return;\n }\n case SET_SURROGATE_KEYS: {\n const newKeys = (action.keys || '').split(' ');\n const allKeys = [...original(state.surrogateKeys), ...newKeys];\n const uniqueKeys = [...new Set(allKeys)];\n state.surrogateKeys = uniqueKeys;\n\n state.apiCalls = [\n ...original(state.apiCalls),\n [action.status, newKeys.length, action.url],\n ];\n return;\n }\n case SET_TARGET_PROJECT: {\n state.currentProject = action.project;\n state.allowedGroups = action.allowedGroups;\n state.currentHostname = action.hostname;\n return;\n }\n default:\n return state;\n }\n}, initialState);\n","const VERSION_PREFIX = '@VERSION/';\nexport const SET_VERSION = `${VERSION_PREFIX}SET_VERSION`;\nexport const SET_VERSION_STATUS = `${VERSION_PREFIX}SET_VERSION_STATUS`;\n","import { Draft, produce } from 'immer';\nimport { SET_VERSION, SET_VERSION_STATUS } from '~/redux/types/version';\n\nconst initialState = {\n commitRef: null,\n buildNo: null,\n contensisVersionStatus: null as 'latest' | 'published' | null,\n};\n\nexport default produce((state: Draft<any>, action) => {\n switch (action.type) {\n case SET_VERSION_STATUS: {\n state.contensisVersionStatus = action.status;\n return;\n }\n case SET_VERSION: {\n state.commitRef = action.commitRef;\n state.buildNo = action.buildNo;\n return;\n }\n default:\n return;\n }\n}, initialState);\n","/**\n * This middleware captures 'CALL_HISTORY_METHOD' actions to redirect to the\n * provided history object. This will prevent these actions from reaching your\n * reducer or any middleware that comes after this one.\n */\n/* eslint-disable no-unused-vars */\nconst routerMiddleware = history => store => next => action => {\n if (action.type !== 'CALL_HISTORY_METHOD') {\n return next(action);\n }\n\n const {\n payload: { method, args },\n } = action;\n history[method](...args);\n};\n\nexport default routerMiddleware;\n","import {\n applyMiddleware,\n combineReducers,\n compose,\n createStore,\n Action,\n Store,\n StoreEnhancer,\n} from 'redux';\nimport thunkMiddleware from 'redux-thunk';\nimport createSagaMiddleware, { END } from 'redux-saga';\nimport { createInjectorsEnhancer } from 'redux-injectors';\n\n// Core reducers\nimport NavigationReducer from '../reducers/navigation';\nimport RoutingReducer from '~/routing/redux/reducers';\nimport UserReducer from '~/user/redux/reducers';\nimport VersionReducer from '../reducers/version';\nimport routerMiddleware from './routerMiddleware';\nimport { AppState } from '../appstate';\nimport { History, MemoryHistory } from 'history';\nimport { StateType } from '~/config';\n\n/* eslint-disable no-underscore-dangle */\ndeclare let window: Window &\n typeof globalThis & {\n __REDUX_DEVTOOLS_EXTENSION__: any;\n };\n\ntype ReduxAppStore = Store<AppState, Action<any>>;\n\ntype ReduxSagaAppStore = ReduxAppStore & {\n runSaga: ReturnType<typeof createSagaMiddleware>['run'];\n close: () => void;\n};\n\nexport let reduxStore: ReduxSagaAppStore;\n\nexport default async (\n featureReducers: any,\n initialState: AppState,\n history: History | MemoryHistory,\n stateType: StateType\n) => {\n let reduxDevToolsMiddleware = f => f;\n\n if (typeof window != 'undefined') {\n reduxDevToolsMiddleware = window.__REDUX_DEVTOOLS_EXTENSION__\n ? window.__REDUX_DEVTOOLS_EXTENSION__()\n : f => f;\n }\n\n const sagaMiddleware = createSagaMiddleware();\n\n const reducers = {\n navigation: NavigationReducer,\n routing: RoutingReducer,\n user: UserReducer,\n version: VersionReducer,\n ...featureReducers,\n };\n\n // Reassign the combiner and fromJS functions when\n // stateType is 'immutable' with dynamic imports\n let combiner = combineReducers;\n let fromJS = <T = any>(obj: T) => obj;\n globalThis.STATE_TYPE = stateType;\n\n if (stateType === 'immutable') {\n globalThis.immutable = await import(\n /* webpackChunkName: \"immutable\" */ 'immutable'\n );\n\n fromJS = (\n await import(/* webpackChunkName: \"from-js\" */ '~/util/fromJSLeaveImmer')\n ).default;\n\n combiner = (\n await import(/* webpackChunkName: \"redux-immutable\" */ 'redux-immutable')\n ).combineReducers;\n }\n\n const createReducer = (injectedReducers = {}) => {\n const rootReducer = combiner<AppState>({\n ...injectedReducers,\n // other non-injected reducers go here\n ...reducers,\n });\n\n return rootReducer;\n };\n\n const store = (initialState: AppState) => {\n const runSaga = sagaMiddleware.run;\n\n const middleware: StoreEnhancer<{\n runSaga: ReturnType<typeof createSagaMiddleware>['run'];\n close: () => void;\n }> = compose(\n applyMiddleware(\n thunkMiddleware,\n sagaMiddleware,\n routerMiddleware(history)\n ),\n createInjectorsEnhancer({\n createReducer,\n runSaga,\n }),\n reduxDevToolsMiddleware\n );\n\n const store = createStore(createReducer(), initialState, middleware);\n\n store.runSaga = runSaga;\n store.close = () => store.dispatch(END);\n return store;\n };\n\n reduxStore = store(fromJS(initialState));\n return reduxStore;\n};\n","import { getImmutableOrJS as getIn } from '~/redux/util';\n\nexport const selectCommitRef = state => getIn(state, ['version', 'commitRef']);\n\nexport const selectBuildNumber = state => getIn(state, ['version', 'buildNo']);\n\nexport const selectVersionStatus = state =>\n getIn(state, ['version', 'contensisVersionStatus']);\n"],"names":["ACTION_PREFIX","GET_NODE_TREE","SET_NODE_TREE","GET_NODE_TREE_ERROR","initialState","root","error","isError","message","isReady","produce","state","action","type","nodes","canonicalPath","currentHostname","currentPath","currentNode","currentNodeAncestors","currentProject","entryID","entry","undefined","isLoading","location","mappedEntry","notFound","staticRoute","statusCode","surrogateKeys","apiCalls","SET_ANCESTORS","ancestors","SET_ENTRY","node","defaultStatus","id","sys","uri","Object","keys","length","nodeWithoutEntry","UPDATE_LOADING_STATE","SET_NAVIGATION_PATH","path","_state$entry","_state$entry$sys","entryUri","route","component","window","SET_ROUTE","nextPath","SET_SIBLINGS","currentNodeSiblingParent","siblings","parentId","currentNodeSiblings","currentNodeSiblingsParent","SET_SURROGATE_KEYS","newKeys","split","allKeys","original","uniqueKeys","Set","status","url","SET_TARGET_PROJECT","project","allowedGroups","hostname","VERSION_PREFIX","SET_VERSION","SET_VERSION_STATUS","commitRef","buildNo","contensisVersionStatus","routerMiddleware","history","store","next","payload","method","args","reduxStore","featureReducers","stateType","reduxDevToolsMiddleware","f","__REDUX_DEVTOOLS_EXTENSION__","sagaMiddleware","createSagaMiddleware","reducers","navigation","NavigationReducer","routing","RoutingReducer","user","UserReducer","version","VersionReducer","combiner","combineReducers","fromJS","obj","globalThis","STATE_TYPE","immutable","default","createReducer","injectedReducers","rootReducer","runSaga","run","middleware","compose","applyMiddleware","thunkMiddleware","createInjectorsEnhancer","createStore","close","dispatch","END","selectCommitRef","getIn","selectBuildNumber","selectVersionStatus"],"mappings":";;;;;;;;AAAA,MAAMA,aAAa,GAAG,cAAc,CAAA;AACvBC,MAAAA,aAAa,GAAI,CAAA,EAAED,aAAc,CAAe,cAAA,EAAA;AAChDE,MAAAA,aAAa,GAAI,CAAA,EAAEF,aAAc,CAAe,cAAA,EAAA;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A;AACxC,EAAA,OAAOmF,UAAU,CAAA;AACnB,CAAC;;ACtHYuC,MAAAA,eAAe,GAAGnH,KAAK,IAAIoH,gBAAK,CAACpH,KAAK,EAAE,CAAC,SAAS,EAAE,WAAW,CAAC,EAAC;AAEjEqH,MAAAA,iBAAiB,GAAGrH,KAAK,IAAIoH,gBAAK,CAACpH,KAAK,EAAE,CAAC,SAAS,EAAE,SAAS,CAAC,EAAC;AAEjEsH,MAAAA,mBAAmB,GAAGtH,KAAK,IACtCoH,gBAAK,CAACpH,KAAK,EAAE,CAAC,SAAS,EAAE,wBAAwB,CAAC;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"version-f6660b69.js","sources":["../src/redux/types/navigation.js","../src/redux/reducers/navigation.ts","../src/routing/redux/reducers.ts","../src/redux/types/version.js","../src/redux/reducers/version.ts","../src/redux/store/routerMiddleware.js","../src/redux/store/store.ts","../src/redux/selectors/version.js"],"sourcesContent":["const ACTION_PREFIX = '@NAVIGATION/';\nexport const GET_NODE_TREE = `${ACTION_PREFIX}_GET_NODE_TREE`;\nexport const SET_NODE_TREE = `${ACTION_PREFIX}_SET_NODE_TREE`;\nexport const GET_NODE_TREE_ERROR = `${ACTION_PREFIX}_GET_NODE_TREE_ERROR`;\n","import { Draft, produce } from 'immer';\nimport { SET_NODE_TREE, GET_NODE_TREE_ERROR } from '~/redux/types/navigation';\n\nconst initialState = {\n root: null,\n error: {\n isError: false,\n message: null,\n },\n isReady: false,\n};\n\nexport default produce((state: Draft<any>, action) => {\n switch (action.type) {\n case SET_NODE_TREE: {\n state.root = action.nodes;\n state.isReady = true;\n return;\n }\n case GET_NODE_TREE_ERROR: {\n state.error.isError = true;\n state.error.message = action.error || 'Unknown error occurred';\n return;\n }\n default:\n return;\n }\n}, initialState);\n","import { Draft, original, produce } from 'immer';\n\nimport {\n SET_ENTRY,\n SET_NAVIGATION_PATH,\n SET_ANCESTORS,\n SET_TARGET_PROJECT,\n SET_ROUTE,\n SET_SIBLINGS,\n SET_SURROGATE_KEYS,\n UPDATE_LOADING_STATE,\n} from './types';\n\nconst initialState = {\n canonicalPath: null,\n currentHostname: null,\n currentPath: '/',\n currentNode: {},\n currentNodeAncestors: [],\n currentProject: 'unknown',\n entryID: null,\n entry: null,\n error: undefined,\n isError: false,\n isLoading: false,\n location: {},\n mappedEntry: null,\n notFound: false,\n staticRoute: null,\n statusCode: 200,\n surrogateKeys: [],\n apiCalls: [],\n};\n\nexport default produce((state: Draft<any>, action) => {\n switch (action.type) {\n case SET_ANCESTORS: {\n state.currentNodeAncestors = action.ancestors;\n return;\n }\n case SET_ENTRY: {\n const {\n entry,\n error,\n mappedEntry,\n node = {},\n isError = false,\n isLoading = false,\n notFound = false,\n statusCode,\n currentPath,\n } = action;\n\n let defaultStatus = 200;\n if (notFound === true && isError === false) defaultStatus = 404;\n else if (isError === true) defaultStatus = statusCode || 500;\n\n if (!entry) {\n state.entryID = null;\n state.entry = null;\n state.error = error;\n state.mappedEntry = null;\n state.isError = isError;\n state.isLoading = isLoading;\n state.notFound = notFound;\n state.statusCode = statusCode || defaultStatus;\n state.canonicalPath = currentPath;\n } else {\n state.entryID = action.id;\n state.entry = entry;\n state.error = error;\n state.isError = isError;\n state.isLoading = isLoading;\n state.notFound = notFound;\n state.statusCode = statusCode || defaultStatus;\n state.canonicalPath = entry.sys.uri || currentPath;\n\n if (mappedEntry && Object.keys(mappedEntry).length > 0) {\n state.mappedEntry = mappedEntry;\n state.entry = { sys: entry.sys };\n }\n }\n\n if (!node) {\n state.currentNode = null;\n } else {\n // On Set Node, we reset all dependants.\n state.currentNode = node;\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { entry, ...nodeWithoutEntry } = node; // We have the entry stored elsewhere, so lets not keep it twice.\n state.currentNode = nodeWithoutEntry;\n }\n\n return;\n }\n case UPDATE_LOADING_STATE: {\n state.isLoading = action.isLoading;\n return;\n }\n case SET_NAVIGATION_PATH: {\n let staticRoute = {} as any;\n if (action.staticRoute) {\n staticRoute = { ...action.staticRoute };\n }\n if (action.path) {\n // Don't run a path update on initial load as we allready should have it in redux\n const entryUri = state?.entry?.sys?.uri;\n if (entryUri !== action.path) {\n state.currentPath = action.path;\n state.location = action.location;\n state.staticRoute = {\n ...staticRoute,\n route: { ...staticRoute.route, component: null },\n };\n state.isLoading = typeof window !== 'undefined';\n } else {\n state.location = action.location;\n state.staticRoute = {\n ...staticRoute,\n route: { ...staticRoute.route, component: null },\n };\n }\n }\n return;\n }\n case SET_ROUTE: {\n state.nextPath = action.path;\n return;\n }\n case SET_SIBLINGS: {\n // Can be null in some cases like the homepage.\n let currentNodeSiblingParent = null;\n if (action.siblings && action.siblings.length > 0) {\n currentNodeSiblingParent = action.siblings[0].parentId;\n }\n\n state.currentNodeSiblings = action.siblings;\n state.currentNodeSiblingsParent = currentNodeSiblingParent;\n return;\n }\n case SET_SURROGATE_KEYS: {\n const newKeys = (action.keys || '').split(' ');\n const allKeys = [...original(state.surrogateKeys), ...newKeys];\n const uniqueKeys = [...new Set(allKeys)];\n state.surrogateKeys = uniqueKeys;\n\n state.apiCalls = [\n ...original(state.apiCalls),\n [action.status, newKeys.length, action.url],\n ];\n return;\n }\n case SET_TARGET_PROJECT: {\n state.currentProject = action.project;\n state.allowedGroups = action.allowedGroups;\n state.currentHostname = action.hostname;\n return;\n }\n default:\n return state;\n }\n}, initialState);\n","const VERSION_PREFIX = '@VERSION/';\nexport const SET_VERSION = `${VERSION_PREFIX}SET_VERSION`;\nexport const SET_VERSION_STATUS = `${VERSION_PREFIX}SET_VERSION_STATUS`;\n","import { Draft, produce } from 'immer';\nimport { SET_VERSION, SET_VERSION_STATUS } from '~/redux/types/version';\n\nconst initialState = {\n commitRef: null,\n buildNo: null,\n contensisVersionStatus: null as 'latest' | 'published' | null,\n};\n\nexport default produce((state: Draft<any>, action) => {\n switch (action.type) {\n case SET_VERSION_STATUS: {\n state.contensisVersionStatus = action.status;\n return;\n }\n case SET_VERSION: {\n state.commitRef = action.commitRef;\n state.buildNo = action.buildNo;\n return;\n }\n default:\n return;\n }\n}, initialState);\n","/**\n * This middleware captures 'CALL_HISTORY_METHOD' actions to redirect to the\n * provided history object. This will prevent these actions from reaching your\n * reducer or any middleware that comes after this one.\n */\n/* eslint-disable no-unused-vars */\nconst routerMiddleware = history => store => next => action => {\n if (action.type !== 'CALL_HISTORY_METHOD') {\n return next(action);\n }\n\n const {\n payload: { method, args },\n } = action;\n history[method](...args);\n};\n\nexport default routerMiddleware;\n","import {\n applyMiddleware,\n combineReducers,\n compose,\n createStore,\n Action,\n Store,\n StoreEnhancer,\n} from 'redux';\nimport thunkMiddleware from 'redux-thunk';\nimport createSagaMiddleware, { END } from 'redux-saga';\nimport { createInjectorsEnhancer } from 'redux-injectors';\n\n// Core reducers\nimport NavigationReducer from '../reducers/navigation';\nimport RoutingReducer from '~/routing/redux/reducers';\nimport UserReducer from '~/user/redux/reducers';\nimport VersionReducer from '../reducers/version';\nimport routerMiddleware from './routerMiddleware';\nimport { AppState } from '../appstate';\nimport { History, MemoryHistory } from 'history';\nimport { StateType } from '~/config';\n\n/* eslint-disable no-underscore-dangle */\ndeclare let window: Window &\n typeof globalThis & {\n __REDUX_DEVTOOLS_EXTENSION__: any;\n };\n\ntype ReduxAppStore = Store<AppState, Action<any>>;\n\ntype ReduxSagaAppStore = ReduxAppStore & {\n runSaga: ReturnType<typeof createSagaMiddleware>['run'];\n close: () => void;\n};\n\nexport let reduxStore: ReduxSagaAppStore;\n\nexport default async (\n featureReducers: any,\n initialState: AppState,\n history: History | MemoryHistory,\n stateType: StateType\n) => {\n let reduxDevToolsMiddleware = f => f;\n\n if (typeof window != 'undefined') {\n reduxDevToolsMiddleware = window.__REDUX_DEVTOOLS_EXTENSION__\n ? window.__REDUX_DEVTOOLS_EXTENSION__()\n : f => f;\n }\n\n const sagaMiddleware = createSagaMiddleware();\n\n const reducers = {\n navigation: NavigationReducer,\n routing: RoutingReducer,\n user: UserReducer,\n version: VersionReducer,\n ...featureReducers,\n };\n\n // Reassign the combiner and fromJS functions when\n // stateType is 'immutable' with dynamic imports\n let combiner = combineReducers;\n let fromJS = <T = any>(obj: T) => obj;\n globalThis.STATE_TYPE = stateType;\n\n if (stateType === 'immutable') {\n globalThis.immutable = await import(\n /* webpackChunkName: \"immutable\" */ 'immutable'\n );\n\n fromJS = (\n await import(/* webpackChunkName: \"from-js\" */ '~/util/fromJSLeaveImmer')\n ).default;\n\n combiner = (\n await import(/* webpackChunkName: \"redux-immutable\" */ 'redux-immutable')\n ).combineReducers;\n }\n\n const createReducer = (injectedReducers = {}) => {\n const rootReducer = combiner<AppState>({\n ...injectedReducers,\n // other non-injected reducers go here\n ...reducers,\n });\n\n return rootReducer;\n };\n\n const store = (initialState: AppState) => {\n const runSaga = sagaMiddleware.run;\n\n const middleware: StoreEnhancer<{\n runSaga: ReturnType<typeof createSagaMiddleware>['run'];\n close: () => void;\n }> = compose(\n applyMiddleware(\n thunkMiddleware,\n sagaMiddleware,\n routerMiddleware(history)\n ),\n createInjectorsEnhancer({\n createReducer,\n runSaga,\n }),\n reduxDevToolsMiddleware\n );\n\n const store = createStore(createReducer(), initialState, middleware);\n\n store.runSaga = runSaga;\n store.close = () => store.dispatch(END);\n return store;\n };\n\n reduxStore = store(fromJS(initialState));\n return reduxStore;\n};\n","import { getImmutableOrJS as getIn } from '~/redux/util';\n\nexport const selectCommitRef = state => getIn(state, ['version', 'commitRef']);\n\nexport const selectBuildNumber = state => getIn(state, ['version', 'buildNo']);\n\nexport const selectVersionStatus = state =>\n getIn(state, ['version', 'contensisVersionStatus']);\n"],"names":["ACTION_PREFIX","GET_NODE_TREE","SET_NODE_TREE","GET_NODE_TREE_ERROR","initialState","root","error","isError","message","isReady","produce","state","action","type","nodes","canonicalPath","currentHostname","currentPath","currentNode","currentNodeAncestors","currentProject","entryID","entry","undefined","isLoading","location","mappedEntry","notFound","staticRoute","statusCode","surrogateKeys","apiCalls","SET_ANCESTORS","ancestors","SET_ENTRY","node","defaultStatus","id","sys","uri","Object","keys","length","nodeWithoutEntry","UPDATE_LOADING_STATE","SET_NAVIGATION_PATH","path","_state$entry","_state$entry$sys","entryUri","route","component","window","SET_ROUTE","nextPath","SET_SIBLINGS","currentNodeSiblingParent","siblings","parentId","currentNodeSiblings","currentNodeSiblingsParent","SET_SURROGATE_KEYS","newKeys","split","allKeys","original","uniqueKeys","Set","status","url","SET_TARGET_PROJECT","project","allowedGroups","hostname","VERSION_PREFIX","SET_VERSION","SET_VERSION_STATUS","commitRef","buildNo","contensisVersionStatus","routerMiddleware","history","store","next","payload","method","args","reduxStore","featureReducers","stateType","reduxDevToolsMiddleware","f","__REDUX_DEVTOOLS_EXTENSION__","sagaMiddleware","createSagaMiddleware","reducers","navigation","NavigationReducer","routing","RoutingReducer","user","UserReducer","version","VersionReducer","combiner","combineReducers","fromJS","obj","globalThis","STATE_TYPE","immutable","default","createReducer","injectedReducers","rootReducer","runSaga","run","middleware","compose","applyMiddleware","thunkMiddleware","createInjectorsEnhancer","createStore","close","dispatch","END","selectCommitRef","getIn","selectBuildNumber","selectVersionStatus"],"mappings":";;;;;;;;AAAA,MAAMA,aAAa,GAAG,cAAc,CAAA;AACvBC,MAAAA,aAAa,GAAI,CAAA,EAAED,aAAc,CAAe,cAAA,EAAA;AAChDE,MAAAA,aAAa,GAAI,CAAA,EAAEF,aAAc,CAAe,cAAA,EAAA;AAChDG,MAAAA,mBAAmB,GAAI,CAAA,EAAEH,aAAc,CAAqB,oBAAA;;;;;;;;;ACAzE,MAAMI,cAAY,GAAG;AACnBC,EAAAA,IAAI,EAAE,IAAI;AACVC,EAAAA,KAAK,EAAE;AACLC,IAAAA,OAAO,EAAE,KAAK;AACdC,IAAAA,OAAO,EAAE,IAAA;GACV;AACDC,EAAAA,OAAO,EAAE,KAAA;AACX,CAAC,CAAA;AAED,wBAAeC,OAAO,CAAC,CAACC,KAAiB,EAAEC,MAAM,KAAK;EACpD,QAAQA,MAAM,CAACC,IAAI;AACjB,IAAA,KAAKX,aAAa;AAAE,MAAA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 -1,6 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
declare
|
|
1
|
+
import React from 'react';
|
|
2
|
+
declare const withLogin: (WrappedComponent: React.ComponentType) => {
|
|
3
3
|
(): JSX.Element;
|
|
4
4
|
displayName: string;
|
|
5
|
-
WrappedComponent:
|
|
5
|
+
WrappedComponent: React.ComponentType<{}>;
|
|
6
6
|
};
|
|
7
|
+
export default withLogin;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
logoutUser: (redirectPath: any) => any;
|
|
1
|
+
declare const useLogin: () => {
|
|
2
|
+
loginUser: (username: string, password: string) => any;
|
|
3
|
+
logoutUser: (redirectPath?: string) => any;
|
|
5
4
|
errorMessage: any;
|
|
6
5
|
isAuthenticated: any;
|
|
7
6
|
isAuthenticationError: any;
|
|
@@ -12,3 +11,4 @@ declare function useLogin(): {
|
|
|
12
11
|
authenticationErrorMessage: any;
|
|
13
12
|
error: any;
|
|
14
13
|
};
|
|
14
|
+
export default useLogin;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
export
|
|
6
|
-
export
|
|
1
|
+
import { CookieHelper } from '../util/CookieHelper.class';
|
|
2
|
+
export declare const loginUser: (username: string, password: string, cookies?: CookieHelper) => any;
|
|
3
|
+
export declare const logoutUser: (redirectPath?: string, cookies?: CookieHelper) => any;
|
|
4
|
+
export declare const registerUser: (user: any, mappers: any) => any;
|
|
5
|
+
export declare const requestPasswordReset: (userEmailObject: any) => any;
|
|
6
|
+
export declare const resetPassword: (resetPasswordObject: any) => any;
|
|
7
|
+
export declare const changePassword: (userId: any, currentPassword: any, newPassword: any) => any;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const userSagas: import("redux-saga/effects").ForkEffect<never>[];
|
|
1
|
+
export declare const userSagas: import("redux-saga/effects").ForkEffect<never>[];
|
|
@@ -1,9 +1,5 @@
|
|
|
1
|
-
export
|
|
2
|
-
|
|
3
|
-
}[] | {
|
|
4
|
-
message: string;
|
|
5
|
-
data: any;
|
|
6
|
-
}[]> | import("redux-saga/effects").PutEffect<{
|
|
1
|
+
export declare const loginSagas: import("redux-saga/effects").ForkEffect<never>[];
|
|
2
|
+
export declare function handleRequiresLoginSaga(action: any): Generator<import("redux-saga/effects").SelectEffect | import("redux-saga/effects").CallEffect<Generator<import("redux-saga/effects").SelectEffect | Promise<any[]> | import("redux-saga/effects").PutEffect<{
|
|
7
3
|
type: string;
|
|
8
4
|
authenticationState: {
|
|
9
5
|
isLoading: boolean;
|
|
@@ -15,15 +11,8 @@ export function handleRequiresLoginSaga(action: any): Generator<import("redux-sa
|
|
|
15
11
|
errorMessage: any;
|
|
16
12
|
};
|
|
17
13
|
}> | import("redux-saga/effects").CallEffect<Generator<Promise<{
|
|
18
|
-
authenticationState:
|
|
19
|
-
|
|
20
|
-
isAuthenticated: boolean;
|
|
21
|
-
isAuthenticationError: boolean;
|
|
22
|
-
isError: boolean;
|
|
23
|
-
};
|
|
24
|
-
user: Error | {
|
|
25
|
-
groups: any;
|
|
26
|
-
} | null | undefined;
|
|
14
|
+
authenticationState: import("../../state").AuthenticationState;
|
|
15
|
+
user: any;
|
|
27
16
|
}> | import("redux-saga/effects").PutEffect<{
|
|
28
17
|
type: string;
|
|
29
18
|
authenticationState: any;
|
|
@@ -36,5 +25,4 @@ export function handleRequiresLoginSaga(action: any): Generator<import("redux-sa
|
|
|
36
25
|
cookies: any;
|
|
37
26
|
securityToken: any;
|
|
38
27
|
}>, any, any>;
|
|
39
|
-
export function refreshSecurityToken(): Generator<any, void, unknown>;
|
|
40
|
-
export const loginSagas: import("redux-saga/effects").ForkEffect<never>[];
|
|
28
|
+
export declare function refreshSecurityToken(): Generator<any, void, unknown>;
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
export const VALIDATE_USER: string;
|
|
2
|
-
export const SET_AUTHENTICATION_STATE: string;
|
|
3
|
-
export const LOGIN_USER: string;
|
|
4
|
-
export const LOGIN_SUCCESSFUL: string;
|
|
5
|
-
export const LOGIN_FAILED: string;
|
|
6
|
-
export const LOGOUT_USER: string;
|
|
7
|
-
export const REGISTER_USER: string;
|
|
8
|
-
export const REGISTER_USER_SUCCESS: string;
|
|
9
|
-
export const REGISTER_USER_FAILED: string;
|
|
10
|
-
export const REQUEST_USER_PASSWORD_RESET: string;
|
|
11
|
-
export const RESET_USER_PASSWORD: string;
|
|
12
|
-
export const REQUEST_USER_PASSWORD_RESET_SENDING: string;
|
|
13
|
-
export const REQUEST_USER_PASSWORD_RESET_SUCCESS: string;
|
|
14
|
-
export const REQUEST_USER_PASSWORD_RESET_ERROR: string;
|
|
15
|
-
export const RESET_USER_PASSWORD_SENDING: string;
|
|
16
|
-
export const RESET_USER_PASSWORD_SUCCESS: string;
|
|
17
|
-
export const RESET_USER_PASSWORD_ERROR: string;
|
|
18
|
-
export const CHANGE_USER_PASSWORD: string;
|
|
19
|
-
export const CHANGE_USER_PASSWORD_SENDING: string;
|
|
20
|
-
export const CHANGE_USER_PASSWORD_SUCCESS: string;
|
|
21
|
-
export const CHANGE_USER_PASSWORD_ERROR: string;
|
|
1
|
+
export declare const VALIDATE_USER: string;
|
|
2
|
+
export declare const SET_AUTHENTICATION_STATE: string;
|
|
3
|
+
export declare const LOGIN_USER: string;
|
|
4
|
+
export declare const LOGIN_SUCCESSFUL: string;
|
|
5
|
+
export declare const LOGIN_FAILED: string;
|
|
6
|
+
export declare const LOGOUT_USER: string;
|
|
7
|
+
export declare const REGISTER_USER: string;
|
|
8
|
+
export declare const REGISTER_USER_SUCCESS: string;
|
|
9
|
+
export declare const REGISTER_USER_FAILED: string;
|
|
10
|
+
export declare const REQUEST_USER_PASSWORD_RESET: string;
|
|
11
|
+
export declare const RESET_USER_PASSWORD: string;
|
|
12
|
+
export declare const REQUEST_USER_PASSWORD_RESET_SENDING: string;
|
|
13
|
+
export declare const REQUEST_USER_PASSWORD_RESET_SUCCESS: string;
|
|
14
|
+
export declare const REQUEST_USER_PASSWORD_RESET_ERROR: string;
|
|
15
|
+
export declare const RESET_USER_PASSWORD_SENDING: string;
|
|
16
|
+
export declare const RESET_USER_PASSWORD_SUCCESS: string;
|
|
17
|
+
export declare const RESET_USER_PASSWORD_ERROR: string;
|
|
18
|
+
export declare const CHANGE_USER_PASSWORD: string;
|
|
19
|
+
export declare const CHANGE_USER_PASSWORD_SENDING: string;
|
|
20
|
+
export declare const CHANGE_USER_PASSWORD_SUCCESS: string;
|
|
21
|
+
export declare const CHANGE_USER_PASSWORD_ERROR: string;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Group, User } from 'contensis-management-api/lib/models';
|
|
2
|
+
import { ManagementApiClientCredentials } from './util/ContensisManagementApi';
|
|
3
|
+
export type AuthenticationState = {
|
|
4
|
+
clientCredentials: ManagementApiClientCredentials | null;
|
|
5
|
+
isAuthenticated: boolean;
|
|
6
|
+
isAuthenticationError: boolean;
|
|
7
|
+
isError: boolean;
|
|
8
|
+
errorMessage?: string | null;
|
|
9
|
+
};
|
|
10
|
+
export type UserWithGroups = User & {
|
|
11
|
+
groups: Group[];
|
|
12
|
+
};
|
|
@@ -1,2 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import { Client } from 'contensis-management-api';
|
|
2
|
+
import { ManagementApiClientCredentials } from '../util/ContensisManagementApi';
|
|
3
|
+
declare const _default: (obj: Client) => ManagementApiClientCredentials;
|
|
2
4
|
export default _default;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
export
|
|
2
|
-
bearerToken
|
|
3
|
-
bearerTokenExpiryDate
|
|
4
|
-
refreshToken
|
|
5
|
-
refreshTokenExpiryDate
|
|
6
|
-
contensisClassicToken
|
|
7
|
-
username
|
|
8
|
-
password
|
|
9
|
-
}
|
|
1
|
+
export type ManagementApiClientCredentials = {
|
|
2
|
+
bearerToken?: string;
|
|
3
|
+
bearerTokenExpiryDate?: Date;
|
|
4
|
+
refreshToken?: string;
|
|
5
|
+
refreshTokenExpiryDate?: Date;
|
|
6
|
+
contensisClassicToken?: string;
|
|
7
|
+
username?: string;
|
|
8
|
+
password?: string;
|
|
9
|
+
};
|
|
10
|
+
export declare const getManagementApiClient: ({ bearerToken, bearerTokenExpiryDate, refreshToken, refreshTokenExpiryDate, contensisClassicToken, username, password, }: ManagementApiClientCredentials) => Promise<import("contensis-management-api").Client>;
|
|
@@ -1,14 +1,17 @@
|
|
|
1
|
+
import FallbackCookies from 'universal-cookie';
|
|
1
2
|
type Cookies = {
|
|
2
3
|
[k: string]: string;
|
|
3
4
|
};
|
|
4
5
|
export declare class CookieHelper {
|
|
5
6
|
private cookies;
|
|
6
|
-
private
|
|
7
|
-
private
|
|
7
|
+
private set?;
|
|
8
|
+
private remove?;
|
|
9
|
+
private fallback;
|
|
8
10
|
get raw(): Cookies;
|
|
9
|
-
|
|
11
|
+
get cookie(): FallbackCookies;
|
|
12
|
+
constructor(cookies?: {
|
|
10
13
|
[k: string]: string;
|
|
11
|
-
}, setCookie
|
|
14
|
+
}, setCookie?: CookieHelper['set'], removeCookie?: CookieHelper['remove']);
|
|
12
15
|
GetCookie(name: string): string | null;
|
|
13
16
|
SetCookie(name: string, value: string, maxAgeDays?: number): void;
|
|
14
17
|
DeleteCookie(name: string): void;
|