@shopgate/engage 7.12.5 → 7.12.6

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shopgate/engage",
3
- "version": "7.12.5",
3
+ "version": "7.12.6",
4
4
  "description": "Shopgate's ENGAGE library.",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Shopgate <support@shopgate.com>",
@@ -16,12 +16,12 @@
16
16
  ],
17
17
  "dependencies": {
18
18
  "@shopgate/native-modules": "1.0.0-beta.18",
19
- "@shopgate/pwa-common": "7.12.5",
20
- "@shopgate/pwa-common-commerce": "7.12.5",
21
- "@shopgate/pwa-core": "7.12.5",
22
- "@shopgate/pwa-ui-ios": "7.12.5",
23
- "@shopgate/pwa-ui-material": "7.12.5",
24
- "@shopgate/pwa-ui-shared": "7.12.5",
19
+ "@shopgate/pwa-common": "7.12.6",
20
+ "@shopgate/pwa-common-commerce": "7.12.6",
21
+ "@shopgate/pwa-core": "7.12.6",
22
+ "@shopgate/pwa-ui-ios": "7.12.6",
23
+ "@shopgate/pwa-ui-material": "7.12.6",
24
+ "@shopgate/pwa-ui-shared": "7.12.6",
25
25
  "@stripe/react-stripe-js": "^1.1.2",
26
26
  "@stripe/stripe-js": "^1.3.1",
27
27
  "@virtuous/conductor": "~2.5.0",
@@ -0,0 +1,4 @@
1
+ import{main$}from'@shopgate/pwa-common/streams';import{SUCCESS_REGISTRATION}from"../constants/actionTypes";/**
2
+ * Gets triggered when registration was successful via the shopgate.user.register pipeline
3
+ * @type {Observable}
4
+ */export var registrationSuccess$=main$.filter(function(_ref){var action=_ref.action;return action.type===SUCCESS_REGISTRATION;});
@@ -1,5 +1,5 @@
1
- import{main$,makeGetPrevRoute,getCurrentRoute,historyPop}from'@shopgate/engage/core';import{LOGIN_PATH}from'@shopgate/pwa-common/constants/RoutePaths';import{successLogin}from'@shopgate/pwa-common/action-creators';import{SUCCESS_REGISTRATION}from"../constants";/**
1
+ import{makeGetPrevRoute,getCurrentRoute,historyPop}from'@shopgate/engage/core';import{LOGIN_PATH}from'@shopgate/pwa-common/constants/RoutePaths';import{REGISTRATION_FORM_LOGIN_STRATEGY}from'@shopgate/pwa-common/constants/user';import{successLogin}from'@shopgate/pwa-common/action-creators';import{registrationSuccess$}from"../streams";/**
2
2
  * @param {Function} subscribe Subscribes to an observable.
3
- */export default function registration(subscribe){var registrationSuccess$=main$.filter(function(_ref){var action=_ref.action;return action.type===SUCCESS_REGISTRATION;});subscribe(registrationSuccess$,function(_ref2){var dispatch=_ref2.dispatch,getState=_ref2.getState;var currentRoute=getCurrentRoute(getState());var redirect;if(currentRoute){// Try to get the login page from the router stack to extract the original redirect target
4
- var getPrevRoute=makeGetPrevRoute();var routeId=currentRoute.id;var _ref3=getPrevRoute(getState(),{routeId:routeId})||{},pattern=_ref3.pattern,state=_ref3.state;if(pattern===LOGIN_PATH&&(state===null||state===void 0?void 0:state.redirect)){redirect=state.redirect;}}// TODO improve navigation since the login page will be briefly visible
5
- dispatch(historyPop());dispatch(successLogin(redirect));});}
3
+ */export default function registration(subscribe){subscribe(registrationSuccess$,function(_ref){var _action$response;var dispatch=_ref.dispatch,getState=_ref.getState,action=_ref.action;var currentRoute=getCurrentRoute(getState());var redirect;if(currentRoute){// Try to get the login page from the router stack to extract the original redirect target
4
+ var getPrevRoute=makeGetPrevRoute();var routeId=currentRoute.id;var _ref2=getPrevRoute(getState(),{routeId:routeId})||{},pattern=_ref2.pattern,state=_ref2.state;if(pattern===LOGIN_PATH&&(state===null||state===void 0?void 0:state.redirect)){redirect=state.redirect;}}// TODO improve navigation since the login page will be briefly visible
5
+ dispatch(historyPop());dispatch(successLogin(redirect,REGISTRATION_FORM_LOGIN_STRATEGY,action===null||action===void 0?void 0:(_action$response=action.response)===null||_action$response===void 0?void 0:_action$response.sessionLifetimeInSeconds));});}
package/user/index.js CHANGED
@@ -3,4 +3,4 @@ export{disableLogin}from'@shopgate/pwa-common/action-creators/user';// ACTIONS
3
3
  export{default as fetchRegisterUrl}from'@shopgate/pwa-common/actions/user/fetchRegisterUrl';export{default as fetchUser}from'@shopgate/pwa-common/actions/user/fetchUser';export{default as login}from'@shopgate/pwa-common/actions/user/login';export{default as logout}from'@shopgate/pwa-common/actions/user/logout';// CONSTANTS
4
4
  export*from'@shopgate/pwa-common/constants/Registration';export*from'@shopgate/pwa-common/constants/user';export{REGISTER_PATH,LOGIN_PATH};// SELECTORS
5
5
  export*from'@shopgate/pwa-common/selectors/user';export*from"./selectors/login";export*from"./selectors/data";// STREAMS
6
- export*from'@shopgate/pwa-common/streams/user';
6
+ export*from'@shopgate/pwa-common/streams/user';export{registrationSuccess$}from'@shopgate/engage/registration/streams';