vtex-render-session
Advanced tools
Comparing version 1.8.1-beta.0 to 1.8.1
@@ -10,7 +10,5 @@ # Changelog | ||
## [1.8.1-beta.0] - 2020-02-11 | ||
## [1.8.1-beta] - 2020-02-11 | ||
## [1.8.1] - 2020-04-01 | ||
### Fixed | ||
- Use session bindingId to decide session clean up. | ||
- Fix bad session URL when window.location.search changes. | ||
@@ -17,0 +15,0 @@ ## [1.8.0] - 2020-01-13 |
@@ -102,3 +102,2 @@ /******/ (function(modules) { // webpackBootstrap | ||
"account.accountName", | ||
"account.bindingId", | ||
"store.channel", | ||
@@ -200,3 +199,2 @@ "store.countryCode", | ||
}).catch(function (err) { return console.log('Error while patching session with error: ', err); }); }; | ||
var items = (window.location.search ? '&' : '?') + "items=" + constants_1.ITEMS.join(','); | ||
var supportedLocalesSearch = supportedLocales.length > 0 | ||
@@ -209,2 +207,3 @@ ? "&supportedLocales=" + supportedLocales.join(',') | ||
var createInitialSessionRequest = function () { | ||
var items = (window.location.search ? '&' : '?') + "items=" + constants_1.ITEMS.join(','); | ||
return fetchWithRetry(rootPath + "/api/sessions" + window.location.search + items + supportedLocalesSearch + bindingIdSearch, { | ||
@@ -233,10 +232,2 @@ body: '{}', | ||
sessionPromise = createInitialSessionRequest() | ||
.then(function (result) { | ||
if (!result.response || | ||
!result.response.namespaces.account.bindingId || | ||
result.response.namespaces.account.bindingId.value === bindingId) { | ||
return result; | ||
} | ||
return clearSession().then(createInitialSessionRequest); | ||
}) | ||
.catch(onError); | ||
@@ -265,2 +256,2 @@ } | ||
/******/ }); | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vd2VicGFjay9ib290c3RyYXAiLCJ3ZWJwYWNrOi8vLy4vY29uc3RhbnRzLnRzIiwid2VicGFjazovLy8uL2luZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQTtBQUNBOztBQUVBO0FBQ0E7O0F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AgIH0sIEZFVENIX1RJTUVPVVQpXG4gICAgICBmZXRjaCh1cmwsIGluaXQpLnRoZW4ocmVzcG9uc2UgPT4ge1xuICAgICAgICBjbGVhclRpbWVvdXQodGltZW91dClcbiAgICAgICAgaWYgKCFkaWRUaW1lb3V0KSB7XG4gICAgICAgICAgcmVzb2x2ZShyZXNwb25zZSlcbiAgICAgICAgfVxuICAgICAgfSkuY2F0Y2goZXJyID0+ICB7XG4gICAgICAgIGNsZWFyVGltZW91dCh0aW1lb3V0KVxuICAgICAgICBpZiAoZGlkVGltZW91dCkge1xuICAgICAgICAgIHJldHVyblxuICAgICAgICB9XG4gICAgICAgIHJlamVjdChlcnIpXG4gICAgICB9KVxuICAgIH0pLnRoZW4oKHJlc3BvbnNlOiBhbnkpID0+IHtcbiAgICAgIHN0YXR1cyA9IHJlc3BvbnNlLnN0YXR1c1xuICAgICAgcmV0dXJuIHJlc3BvbnNlLmpzb24oKVxuICAgICAgICAudGhlbigoZGF0YTogYW55KSA9PiAoe3Jlc3BvbnNlOiBkYXRhLCBlcnJvcjogbnVsbH0pKVxuICAgIH0pLmNhdGNoKChlcnJvcikgPT4ge1xuICAgICAgY29uc29sZS5lcnJvcihlcnJvcilcblxuICAgICAgaWYgKGF0dGVtcHQgPj0gbWF4UmV0cmllcyB8fCAhY2FuUmV0cnkoc3RhdHVzKSB8fCBkaWRUaW1lb3V0KSB7XG4gICAgICAgIHJldHVybiB7cmVzcG9uc2U6IG51bGwsIGVycm9yOiB7bWVzc2FnZTogJ01heGltdW0gbnVtYmVyIG9mIGF0dGVtcHRzIGFjaGlldmVkIG9yIHJlcXVlc3QgdGltZWQgb3V0J319IGFzIFNlc3Npb25SZXNwb25zZVxuICAgICAgfVxuXG4gICAgICBjb25zdCBtcyA9ICgyICoqIGF0dGVtcHQpICogNTAwXG4gICAgICByZXR1cm4gZGVsYXkobXMpXG4gICAgICAgIC50aGVuKCgpID0+IGNhbGxGZXRjaCgrK2F0dGVtcHQpKVxuICAgIH0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gICBmZXRjaCh1cmwsIGluaXQpLnRoZW4ocmVzcG9uc2UgPT4ge1xuICAgICAgICBjbGVhclRpbWVvdXQodGltZW91dClcbiAgICAgICAgaWYgKCFkaWRUaW1lb3V0KSB7XG4gICAgICAgICAgcmVzb2x2ZShyZXNwb25zZSlcbiAgICAgICAgfVxuICAgICAgfSkuY2F0Y2goZXJyID0+ICB7XG4gICAgICAgIGNsZWFyVGltZW91dCh0aW1lb3V0KVxuICAgICAgICBpZiAoZGlkVGltZW91dCkge1xuICAgICAgICAgIHJldHVyblxuICAgICAgICB9XG4gICAgICAgIHJlamVjdChlcnIpXG4gICAgICB9KVxuICAgIH0pLnRoZW4oKHJlc3BvbnNlOiBhbnkpID0+IHtcbiAgICAgIHN0YXR1cyA9IHJlc3BvbnNlLnN0YXR1c1xuICAgICAgcmV0dXJuIHJlc3BvbnNlLmpzb24oKVxuICAgICAgICAudGhlbigoZGF0YTogYW55KSA9PiAoe3Jlc3BvbnNlOiBkYXRhLCBlcnJvcjogbnVsbH0pKVxuICAgIH0pLmNhdGNoKChlcnJvcikgPT4ge1xuICAgICAgY29uc29sZS5lcnJvcihlcnJvcilcblxuICAgICAgaWYgKGF0dGVtcHQgPj0gbWF4UmV0cmllcyB8fCAhY2FuUmV0cnkoc3RhdHVzKSB8fCBkaWRUaW1lb3V0KSB7XG4gICAgICAgIHJldHVybiB7cmVzcG9uc2U6IG51bGwsIGVycm9yOiB7bWVzc2FnZTogJ01heGltdW0gbnVtYmVyIG9mIGF0dGVtcHRzIGFjaGlldmVkIG9yIHJlcXVlc3QgdGltZWQgb3V0J319IGFzIFNlc3Npb25SZXNwb25zZVxuICAgICAgfVxuXG4gICAgICBjb25zdCBtcyA9ICgyICoqIGF0dGVtcHQpICogNTAwXG4gICAgICByZXR1cm4gZGVsYXkobXMpXG4gICAgICAgIC50aGVuKCgpID0+IGNhbGxGZXRjaCgrK2F0dGVtcHQpKVxuICAgIH0pXG5cbiAgcmV0dXJuIGNhbGxGZXRjaC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XMgYW55KS5fX1JFTkRFUl84X1NFU1NJT05fXyA9IHtcbiAgcGF0Y2hTZXNzaW9uLFxuICBzZXNzaW9uUHJvbWlzZSxcbn1cblxuZXhwb3J0IHt9XG4iXSwic291cmNlUm9vdCI6IiJ9 |
@@ -1,1 +0,1 @@ | ||
!function(e){var n={};function t(o){if(n[o])return n[o].exports;var r=n[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,t),r.l=!0,r.exports}t.m=e,t.c=n,t.d=function(e,n,o){t.o(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:o})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,n){if(1&n&&(e=t(e)),8&n)return e;if(4&n&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(t.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&n&&"string"!=typeof e)for(var r in e)t.d(o,r,function(n){return e[n]}.bind(null,r));return o},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},t.p="/",t(t.s=0)}([function(e,n,t){e.exports=t(1)},function(e,n,t){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var o,r=t(2),i=window.__RUNTIME__&&window.__RUNTIME__.bindingChanged,u=window.__RUNTIME__&&window.__RUNTIME__.binding&&window.__RUNTIME__.binding.id,c=window.__RUNTIME__&&window.__RUNTIME__.culture&&window.__RUNTIME__.culture.availableLocales||[],s=window.__RUNTIME__&&window.__RUNTIME__.rootPath||"",a=[408,425,429,500,501,502,503,504,505,506,507,508,510,511],l=function(e,n,t){void 0===t&&(t=3);var o=500,r=!1,i=function(u){return void 0===u&&(u=0),new Promise(function(t,o){var i=setTimeout(function(){r=!0,o(new Error("Fetch timed out"))},7e3);fetch(e,n).then(function(e){clearTimeout(i),r||t(e)}).catch(function(e){clearTimeout(i),r||o(e)})}).then(function(e){return o=e.status,e.json().then(function(e){return{response:e,error:null}})}).catch(function(e){return console.error(e),u>=t||!function(e){return a.includes(e)}(o)||r?{response:null,error:{message:"Maximum number of attempts achieved or request timed out"}}:function(e){return new Promise(function(n){return setTimeout(n,e)})}(500*Math.pow(2,u)).then(function(){return i(++u)})})};return i()},d=(window.location.search?"&":"?")+"items="+r.ITEMS.join(","),_=c.length>0?"&supportedLocales="+c.join(","):"",p=u?"&__bindingId="+u:"",f=function(){return l(s+"/api/sessions"+window.location.search+d+_+p,{body:"{}",credentials:"same-origin",headers:new Headers({"Content-Type":"application/json"}),method:"POST"})},m=function(){return l(s+"/api/sessions/invalidToken?items=*",{credentials:"same-origin",headers:new Headers({"Content-Type":"application/json"}),method:"GET"},1)},w=function(e){return console.log("Error while loading session with error: ",e)};o=i?m().then(f).catch(w):f().then(function(e){return e.response&&e.response.namespaces.account.bindingId&&e.response.namespaces.account.bindingId.value!==u?m().then(f):e}).catch(w),window.__RENDER_7_SESSION__=window.__RENDER_8_SESSION__={patchSession:function(e){return l(s+"/api/sessions"+window.location.search,{body:e?JSON.stringify(e):"{}",credentials:"same-origin",headers:new Headers({"Content-Type":"application/json"}),method:"PATCH"}).catch(function(e){return console.log("Error while patching session with error: ",e)})},sessionPromise:o}},function(e,n,t){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.ITEMS=["account.id","account.accountName","account.bindingId","store.channel","store.countryCode","store.cultureInfo","store.currencyCode","store.currencySymbol","store.admin_cultureInfo","creditControl.creditAccounts","creditControl.deadlines","creditControl.minimumInstallmentValue","authentication.storeUserId","authentication.storeUserEmail","profile.firstName","profile.document","profile.email","profile.id","profile.isAuthenticated","profile.lastName","profile.phone","public.favoritePickup","public.utm_source","public.utm_medium","public.utm_campaign","public.utmi_cp","public.utmi_p","public.utmi_pc"]}]); | ||
!function(e){var n={};function t(o){if(n[o])return n[o].exports;var r=n[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,t),r.l=!0,r.exports}t.m=e,t.c=n,t.d=function(e,n,o){t.o(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:o})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,n){if(1&n&&(e=t(e)),8&n)return e;if(4&n&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(t.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&n&&"string"!=typeof e)for(var r in e)t.d(o,r,function(n){return e[n]}.bind(null,r));return o},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},t.p="/",t(t.s=0)}([function(e,n,t){e.exports=t(1)},function(e,n,t){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var o,r=t(2),i=window.__RUNTIME__&&window.__RUNTIME__.bindingChanged,u=window.__RUNTIME__&&window.__RUNTIME__.binding&&window.__RUNTIME__.binding.id,c=window.__RUNTIME__&&window.__RUNTIME__.culture&&window.__RUNTIME__.culture.availableLocales||[],s=window.__RUNTIME__&&window.__RUNTIME__.rootPath||"",a=[408,425,429,500,501,502,503,504,505,506,507,508,510,511],l=function(e,n,t){void 0===t&&(t=3);var o=500,r=!1,i=function(u){return void 0===u&&(u=0),new Promise(function(t,o){var i=setTimeout(function(){r=!0,o(new Error("Fetch timed out"))},7e3);fetch(e,n).then(function(e){clearTimeout(i),r||t(e)}).catch(function(e){clearTimeout(i),r||o(e)})}).then(function(e){return o=e.status,e.json().then(function(e){return{response:e,error:null}})}).catch(function(e){return console.error(e),u>=t||!function(e){return a.includes(e)}(o)||r?{response:null,error:{message:"Maximum number of attempts achieved or request timed out"}}:function(e){return new Promise(function(n){return setTimeout(n,e)})}(500*Math.pow(2,u)).then(function(){return i(++u)})})};return i()},d=c.length>0?"&supportedLocales="+c.join(","):"",_=u?"&__bindingId="+u:"",f=function(){var e=(window.location.search?"&":"?")+"items="+r.ITEMS.join(",");return l(s+"/api/sessions"+window.location.search+e+d+_,{body:"{}",credentials:"same-origin",headers:new Headers({"Content-Type":"application/json"}),method:"POST"})},p=function(e){return console.log("Error while loading session with error: ",e)};o=i?l(s+"/api/sessions/invalidToken?items=*",{credentials:"same-origin",headers:new Headers({"Content-Type":"application/json"}),method:"GET"},1).then(f).catch(p):f().catch(p),window.__RENDER_7_SESSION__=window.__RENDER_8_SESSION__={patchSession:function(e){return l(s+"/api/sessions"+window.location.search,{body:e?JSON.stringify(e):"{}",credentials:"same-origin",headers:new Headers({"Content-Type":"application/json"}),method:"PATCH"}).catch(function(e){return console.log("Error while patching session with error: ",e)})},sessionPromise:o}},function(e,n,t){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.ITEMS=["account.id","account.accountName","store.channel","store.countryCode","store.cultureInfo","store.currencyCode","store.currencySymbol","store.admin_cultureInfo","creditControl.creditAccounts","creditControl.deadlines","creditControl.minimumInstallmentValue","authentication.storeUserId","authentication.storeUserEmail","profile.firstName","profile.document","profile.email","profile.id","profile.isAuthenticated","profile.lastName","profile.phone","public.favoritePickup","public.utm_source","public.utm_medium","public.utm_campaign","public.utmi_cp","public.utmi_p","public.utmi_pc"]}]); |
{ | ||
"name": "vtex-render-session", | ||
"version": "1.8.1-beta.0", | ||
"version": "1.8.1", | ||
"description": "Adds session as external to render runtime", | ||
@@ -5,0 +5,0 @@ "scripts": { |
export const ITEMS = [ | ||
"account.id", | ||
"account.accountName", | ||
"account.bindingId", | ||
"store.channel", | ||
@@ -6,0 +5,0 @@ "store.countryCode", |
import { ITEMS } from './constants' | ||
interface SessionNamespaceItem { | ||
value: string | ||
keepAlive?: boolean | ||
} | ||
type AccountFields = 'id' | 'accountName' | 'bindingId' | ||
type SessionNamespace<T extends string> = Record<T, SessionNamespaceItem> | ||
interface SessionResponseItems { | ||
id: string | ||
namespaces: { | ||
account: SessionNamespace<AccountFields> | ||
} | ||
} | ||
interface SessionResponse { | ||
response: SessionResponseItems | null, | ||
response: Response | null, | ||
error: any, | ||
@@ -100,4 +84,2 @@ } | ||
const items = `${window.location.search ? '&' : '?'}items=${ITEMS.join(',')}` | ||
const supportedLocalesSearch = supportedLocales.length > 0 | ||
@@ -112,2 +94,3 @@ ? `&supportedLocales=${supportedLocales.join(',')}` | ||
const createInitialSessionRequest = () => { | ||
const items = `${window.location.search ? '&' : '?'}items=${ITEMS.join(',')}` | ||
return fetchWithRetry(`${rootPath}/api/sessions${window.location.search}${items}${supportedLocalesSearch}${bindingIdSearch}`, { | ||
@@ -135,16 +118,6 @@ body: '{}', | ||
.then(createInitialSessionRequest) | ||
.catch(onError) | ||
.catch(onError); | ||
} else { | ||
sessionPromise = createInitialSessionRequest() | ||
.then(result => { | ||
if (!result.response || | ||
!result.response.namespaces.account.bindingId || | ||
result.response.namespaces.account.bindingId.value === bindingId | ||
) { | ||
return result | ||
} | ||
return clearSession().then(createInitialSessionRequest) | ||
}) | ||
.catch(onError) | ||
.catch(onError); | ||
} | ||
@@ -151,0 +124,0 @@ |
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
1
39822
454