Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

vtex-render-session

Package Overview
Dependencies
Maintainers
58
Versions
48
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vtex-render-session - npm Package Compare versions

Comparing version 1.8.1-beta to 1.8.1-beta.0

2

CHANGELOG.md

@@ -10,2 +10,4 @@ # Changelog

## [1.8.1-beta.0] - 2020-02-11
## [1.8.1-beta] - 2020-02-11

@@ -12,0 +14,0 @@ ### Fixed

31

dist/index.js

@@ -147,2 +147,3 @@ /******/ (function(modules) { // webpackBootstrap

};
var bindingChanged = window.__RUNTIME__ && window.__RUNTIME__.bindingChanged;
var bindingId = window.__RUNTIME__ && window.__RUNTIME__.binding && window.__RUNTIME__.binding.id;

@@ -222,12 +223,20 @@ var supportedLocales = window.__RUNTIME__ && window.__RUNTIME__.culture && window.__RUNTIME__.culture.availableLocales || [];

var onError = function (err) { return console.log('Error while loading session with error: ', err); };
var 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);
var sessionPromise;
if (bindingChanged) {
sessionPromise = clearSession()
.then(createInitialSessionRequest)
.catch(onError);
}
else {
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);
}
window.__RENDER_7_SESSION__ = window.__RENDER_8_SESSION__ = {

@@ -254,2 +263,2 @@ patchSession: patchSession,

/******/ });
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vd2VicGFjay9ib290c3RyYXAiLCJ3ZWJwYWNrOi8vLy4vY29uc3RhbnRzLnRzIiwid2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hSZXRyeShgJHtyb290UGF0aH0vYXBpL3Nlc3Npb25zL2ludmFsaWRUb2tlbj9pdGVtcz0qYCwge1xuICAgIGNyZWRlbnRpYWxzOiAnc2FtZS1vcmlnaW4nLFxuICAgIGhlYWRlcnM6IG5ldyBIZWFkZXJzKHsgJ0NvbnRlbnQtVHlwZSc6ICdhcHBsaWNhdGlvbi9qc29uJyB9KSxcbiAgICBtZXRob2Q6ICdHRVQnLFxuICB9LCAxKVxufVxuXG5jb25zdCBvbkVycm9yID0gKGVycjogYW55KSA9PiBjb25zb2xlLmxvZygnRXJyb3Igd2hpbGUgbG9hZGluZyBzZXNzaW9uIHdpdGggZXJyb3I6ICcsIGVycilcblxuY29uc3Qgc2Vzc2lvblByb21pc2UgPSBjcmVhdGVJbml0aWFsU2Vzc2lvblJlcXVlc3QoKVxuICAudGhlbihyZXN1bHQgPT4ge1xuICAgIGlmICghcmVzdWx0LnJlc3BvbnNlIHx8XG4gICAgICAhcmVzdWx0LnJlc3BvbnNlLm5hbWVzcGFjZXMuYWNjb3VudC5iaW5kaW5nSWQgfHxcbiAgICAgIHJlc3VsdC5yZXNwb25zZS5uYW1lc3BhY2VzLmFjY291bnQuYmluZGluZ0lkLnZhbHVlID09PSBiaW5kaW5nSWRcbiAgICApIHtcbiAgICAgIHJldHVybiByZXN1bHRcbiAgICB9XG5cbiAgICByZXR1cm4gY2xlYXJTZXNzaW9uKCkudGhlbihjcmVhdGVJbml0aWFsU2Vzc2lvblJlcXVlc3QpXG4gIH0pXG4gIC5jYXRjaChvbkVycm9yKTtcblxuKHdpbmRvdyBhcyBhbnkpLl9fUkVOREVSXzdfU0VTU0lPTl9fID0gKHdpbmRvdyBhcyBhbnkpLl9fUkVOREVSXzhfU0VTU0lPTl9fID0ge1xuICBwYXRjaFNlc3Npb24sXG4gIHNlc3Npb25Qcm9taXNlLFxufVxuXG5leHBvcnQge31cbiJdLCJzb3VyY2VSb290IjoiIn0=
//# sourceMappingURL=data:application/json;charset=utf-8;base64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U+ID0+XG4gICAgbmV3IFByb21pc2UoKHJlc29sdmUsIHJlamVjdCkgPT4ge1xuICAgICAgY29uc3QgdGltZW91dCA9IHNldFRpbWVvdXQoKCkgPT4ge1xuICAgICAgICBkaWRUaW1lb3V0ID0gdHJ1ZVxuICAgICAgICByZWplY3QobmV3IEVycm9yKCdGZXRjaCB0aW1lZCBvdXQnKSlcbiAgICAgIH0sIEZFVENIX1RJTUVPVVQpXG4gICAgICBmZXRjaCh1cmwsIGluaXQpLnRoZW4ocmVzcG9uc2UgPT4ge1xuICAgICAgICBjbGVhclRpbWVvdXQodGltZW91dClcbiAgICAgICAgaWYgKCFkaWRUaW1lb3V0KSB7XG4gICAgICAgICAgcmVzb2x2ZShyZXNwb25zZSlcbiAgICAgICAgfVxuICAgICAgfSkuY2F0Y2goZXJyID0+ICB7XG4gICAgICAgIGNsZWFyVGltZW91dCh0aW1lb3V0KVxuICAgICAgICBpZiAoZGlkVGltZW91dCkge1xuICAgICAgICAgIHJldHVyblxuICAgICAgICB9XG4gICAgICAgIHJlamVjdChlcnIpXG4gICAgICB9KVxuICAgIH0pLnRoZW4oKHJlc3BvbnNlOiBhbnkpID0+IHtcbiAgICAgIHN0YXR1cyA9IHJlc3BvbnNlLnN0YXR1c1xuICAgICAgcmV0dXJuIHJlc3BvbnNlLmpzb24oKVxuICAgICAgICAudGhlbigoZGF0YTogYW55KSA9PiAoe3Jlc3BvbnNlOiBkYXRhLCBlcnJvcjogbnVsbH0pKVxuICAgIH0pLmNhdGNoKChlcnJvcikgPT4ge1xuICAgICAgY29uc29sZS5lcnJvcihlcnJvcilcblxuICAgICAgaWYgKGF0dGVtcHQgPj0gbWF4UmV0cmllcyB8fCAhY2FuUmV0cnkoc3RhdHVzKSB8fCBkaWRUaW1lb3V0KSB7XG4gICAgICAgIHJldHVybiB7cmVzcG9uc2U6IG51bGwsIGVycm9yOiB7bWVzc2FnZTogJ01heGltdW0gbnVtYmVyIG9mIGF0dGVtcHRzIGFjaGlldmVkI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YXRlSW5pdGlhbFNlc3Npb25SZXF1ZXN0KVxuICAgIC5jYXRjaChvbkVycm9yKVxufSBlbHNlIHtcbiAgc2Vzc2lvblByb21pc2UgPSBjcmVhdGVJbml0aWFsU2Vzc2lvblJlcXVlc3QoKVxuICAgIC50aGVuKHJlc3VsdCA9PiB7XG4gICAgICBpZiAoIXJlc3VsdC5yZXNwb25zZSB8fFxuICAgICAgICAhcmVzdWx0LnJlc3BvbnNlLm5hbWVzcGFjZXMuYWNjb3VudC5iaW5kaW5nSWQgfHxcbiAgICAgICAgcmVzdWx0LnJlc3BvbnNlLm5hbWVzcGFjZXMuYWNjb3VudC5iaW5kaW5nSWQudmFsdWUgPT09IGJpbmRpbmdJZFxuICAgICAgKSB7XG4gICAgICAgIHJldHVybiByZXN1bHRcbiAgICAgIH1cblxuICAgICAgcmV0dXJuIGNsZWFyU2Vzc2lvbigpLnRoZW4oY3JlYXRlSW5pdGlhbFNlc3Npb25SZXF1ZXN0KVxuICAgIH0pXG4gICAgLmNhdGNoKG9uRXJyb3IpXG59XG5cbih3aW5kb3cgYXMgYW55KS5fX1JFTkRFUl83X1NFU1NJT05fXyA9ICh3aW5kb3cgYXMgYW55KS5fX1JFTkRFUl84X1NFU1NJT05fXyA9IHtcbiAgcGF0Y2hTZXNzaW9uLFxuICBzZXNzaW9uUHJvbWlzZSxcbn1cblxuZXhwb3J0IHt9XG4iXSwic291cmNlUm9vdCI6IiJ9

@@ -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=t(2),r=window.__RUNTIME__&&window.__RUNTIME__.binding&&window.__RUNTIME__.binding.id,i=window.__RUNTIME__&&window.__RUNTIME__.culture&&window.__RUNTIME__.culture.availableLocales||[],u=window.__RUNTIME__&&window.__RUNTIME__.rootPath||"",c=[408,425,429,500,501,502,503,504,505,506,507,508,510,511],s=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 c.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()},a=(window.location.search?"&":"?")+"items="+o.ITEMS.join(","),l=i.length>0?"&supportedLocales="+i.join(","):"",d=r?"&__bindingId="+r:"",p=function(){return s(u+"/api/sessions"+window.location.search+a+l+d,{body:"{}",credentials:"same-origin",headers:new Headers({"Content-Type":"application/json"}),method:"POST"})},_=p().then(function(e){return e.response&&e.response.namespaces.account.bindingId&&e.response.namespaces.account.bindingId.value!==r?s(u+"/api/sessions/invalidToken?items=*",{credentials:"same-origin",headers:new Headers({"Content-Type":"application/json"}),method:"GET"},1).then(p):e}).catch(function(e){return console.log("Error while loading session with error: ",e)});window.__RENDER_7_SESSION__=window.__RENDER_8_SESSION__={patchSession:function(e){return s(u+"/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:_}},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=(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"]}]);
{
"name": "vtex-render-session",
"version": "1.8.1-beta",
"version": "1.8.1-beta.0",
"description": "Adds session as external to render runtime",

@@ -5,0 +5,0 @@ "scripts": {

@@ -34,2 +34,3 @@ import { ITEMS } from './constants'

},
bindingChanged?: boolean,
culture: {

@@ -43,2 +44,3 @@ availableLocales: string[]

const bindingChanged = window.__RUNTIME__ && window.__RUNTIME__.bindingChanged
const bindingId = window.__RUNTIME__ && window.__RUNTIME__.binding && window.__RUNTIME__.binding.id

@@ -129,14 +131,21 @@ const supportedLocales = window.__RUNTIME__ && window.__RUNTIME__.culture && window.__RUNTIME__.culture.availableLocales || []

const sessionPromise = createInitialSessionRequest()
.then(result => {
if (!result.response ||
!result.response.namespaces.account.bindingId ||
result.response.namespaces.account.bindingId.value === bindingId
) {
return result
}
let sessionPromise: Promise<void | SessionResponse>
if (bindingChanged) {
sessionPromise = clearSession()
.then(createInitialSessionRequest)
.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);
return clearSession().then(createInitialSessionRequest)
})
.catch(onError)
}

@@ -143,0 +152,0 @@ (window as any).__RENDER_7_SESSION__ = (window as any).__RENDER_8_SESSION__ = {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc