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

vtex-render-session

Package Overview
Dependencies
Maintainers
54
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.0-beta.1 to 1.8.0-beta.2

6

CHANGELOG.md

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

## [1.8.0-beta] - 2020-01-10
## [1.8.0-beta.2] - 2020-01-13
## [1.8.0-beta.0] - 2020-01-10
### Added
- Bindings support
## [1.7.0] - 2019-12-17

@@ -14,0 +18,0 @@ ### Added

17

dist/index.min.js

@@ -1,16 +0,1 @@

!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/",n(n.s=2)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1),o=n(6);t.IMPERSONATED_KEY="vtex-impersonated-customer-email";var i=function(){return function(e){var n=this;this.setSession=function(e,i){if(void 0===e&&(e=""),i&&i[t.IMPERSONATED_KEY]){var u=i[t.IMPERSONATED_KEY];u&&u.value?r.setCookie(t.IMPERSONATED_KEY,u.value,1):r.deleteCookie(t.IMPERSONATED_KEY)}return o.fetchWithRetry(n.path+"/api/sessions"+e,{body:i?JSON.stringify({public:i}):"{}",credentials:"same-origin",headers:new Headers({"Content-Type":"application/json"}),method:"POST"}).catch(function(e){return console.log("Error while loading session with error: ",e)})},this.patchSession=function(e,t){return void 0===e&&(e=""),o.fetchWithRetry(n.path+"/api/sessions"+e,{body:t?JSON.stringify(t):"{}",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)})},this.getSession=function(e){void 0===e&&(e={});var t=e.items?e.items:"*";return o.fetchWithRetry(n.path+"/api/sessions?items="+t,{credentials:"same-origin",headers:new Headers({"Content-Type":"application/json"}),method:"GET"}).catch(function(e){return console.log("Error while getting session with error: ",e)})},this.getSegment=function(){return o.fetchWithRetry(n.path+"/api/segments",{credentials:"same-origin",headers:new Headers({"Content-Type":"application/json"}),method:"GET"}).catch(function(e){return console.log("Error while getting segment with error: ",e)})},this.path=e}}();t.Session=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setCookie=function(e,t,n){var r=e.replace(/[^#$&+\^`|]/g,encodeURIComponent).replace(/\(/g,"%28").replace(/\)/g,"%29"),o=(t+"").replace(/[^!#$&-+\--:<-\[\]-~]/g,encodeURIComponent),i="";if(n){var u=new Date;u.setDate(u.getDate()+n),i="expires="+u.toUTCString()}var c=r+"="+o+"; path=/; "+i;document.cookie=c},t.deleteCookie=function(e){document.cookie=e+"=; expires=Thu, 01 Jan 1970 00:00:01 GMT; path=/;"}},function(e,t,n){e.exports=n(3)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(4),o=n(7);window.__RUNTIME__?r.default():o.default()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5),o=n(0);t.default=function(){var e=window.__RUNTIME__.culture&&window.__RUNTIME__.culture.availableLocales||[],t=window.__RUNTIME__.rootPath||"",n=new o.Session(t),i=(window.location.search?"&":"?")+"items="+r.ITEMS.join(","),u=e.length>0?"&supportedLocales="+e.join(","):"",c=""+window.location.search+i+u,a=n.setSession(c);window.__RENDER_7_SESSION__=window.__RENDER_8_SESSION__={patchSession:function(e){return n.patchSession(window.location.search,e)},sessionPromise:a}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.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"]},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=[408,425,429,500,501,502,503,504,505,506,507,508,510,511];t.fetchWithRetry=function(e,t,n){void 0===n&&(n=3);var o=500,i=!1,u=function(c){return void 0===c&&(c=0),new Promise(function(n,r){var o=setTimeout(function(){i=!0,r(new Error("Fetch timed out"))},7e3);fetch(e,t).then(function(e){clearTimeout(o),i||n(e)}).catch(function(e){clearTimeout(o),i||r(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),c>=n||!function(e){return r.includes(e)}(o)||i?{response:null,error:{message:"Maximum number of attempts achieved or request timed out"}}:function(e){return new Promise(function(t){return setTimeout(t,e)})}(500*Math.pow(2,c)).then(function(){return u(++c)})})};return u()}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(8),o=n(0),i=n(1),u=function(e){function t(t){var n=e.call(this,t)||this;return n.setSessionParams=function(e){return n.setSession("",e)},n.setParameter=function(e,t,r){void 0===r&&(r={}),console.warn("`vtexjs.session.setParameter` is deprecated. Please use `vtexjs.session.setSessionParams` instead.");var u=void 0===r.autoRefresh||r.autoRefresh;e===o.IMPERSONATED_KEY&&(t?i.setCookie(e,t,1):i.deleteCookie(e));var c=e?{key:{value:t}}:{};return n.setSessionParams(c).then(function(){u&&window.location.reload()})},n}return r.__extends(t,e),t}(o.Session);t.default=function(){var e=window.location.origin;window.vtexjs=window.vtexjs||{},window.vtexjs.session=new u(e),document.addEventListener("DOMContentLoaded",function(){window.vtexjs.session.setSession().then(function(){return window.dispatchEvent(new Event("session.done"))}),document.addEventListener("authenticatedUser.vtexid",function(){window.vtexjs.session.setSession().then(function(){return window.dispatchEvent(new Event("session.done"))})})})}},function(e,t,n){"use strict";n.r(t),n.d(t,"__extends",function(){return o}),n.d(t,"__assign",function(){return i}),n.d(t,"__rest",function(){return u}),n.d(t,"__decorate",function(){return c}),n.d(t,"__param",function(){return a}),n.d(t,"__metadata",function(){return s}),n.d(t,"__awaiter",function(){return f}),n.d(t,"__generator",function(){return l}),n.d(t,"__exportStar",function(){return d}),n.d(t,"__values",function(){return p}),n.d(t,"__read",function(){return h}),n.d(t,"__spread",function(){return _}),n.d(t,"__await",function(){return y}),n.d(t,"__asyncGenerator",function(){return v}),n.d(t,"__asyncDelegator",function(){return m}),n.d(t,"__asyncValues",function(){return w}),n.d(t,"__makeTemplateObject",function(){return b}),n.d(t,"__importStar",function(){return S}),n.d(t,"__importDefault",function(){return g});
/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
var r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function o(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var i=function(){return(i=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function u(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&(n[r[o]]=e[r[o]])}return n}function c(e,t,n,r){var o,i=arguments.length,u=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)u=Reflect.decorate(e,t,n,r);else for(var c=e.length-1;c>=0;c--)(o=e[c])&&(u=(i<3?o(u):i>3?o(t,n,u):o(t,n))||u);return i>3&&u&&Object.defineProperty(t,n,u),u}function a(e,t){return function(n,r){t(n,r,e)}}function s(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function f(e,t,n,r){return new(n||(n=Promise))(function(o,i){function u(e){try{a(r.next(e))}catch(e){i(e)}}function c(e){try{a(r.throw(e))}catch(e){i(e)}}function a(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(u,c)}a((r=r.apply(e,t||[])).next())})}function l(e,t){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(i){return function(c){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=t.call(e,u)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,c])}}}function d(e,t){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}function p(e){var t="function"==typeof Symbol&&e[Symbol.iterator],n=0;return t?t.call(e):{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}}}function h(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),u=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)u.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return u}function _(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(h(arguments[t]));return e}function y(e){return this instanceof y?(this.v=e,this):new y(e)}function v(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,o=n.apply(e,t||[]),i=[];return r={},u("next"),u("throw"),u("return"),r[Symbol.asyncIterator]=function(){return this},r;function u(e){o[e]&&(r[e]=function(t){return new Promise(function(n,r){i.push([e,t,n,r])>1||c(e,t)})})}function c(e,t){try{(n=o[e](t)).value instanceof y?Promise.resolve(n.value.v).then(a,s):f(i[0][2],n)}catch(e){f(i[0][3],e)}var n}function a(e){c("next",e)}function s(e){c("throw",e)}function f(e,t){e(t),i.shift(),i.length&&c(i[0][0],i[0][1])}}function m(e){var t,n;return t={},r("next"),r("throw",function(e){throw e}),r("return"),t[Symbol.iterator]=function(){return this},t;function r(r,o){t[r]=e[r]?function(t){return(n=!n)?{value:y(e[r](t)),done:"return"===r}:o?o(t):t}:o}}function w(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=p(e),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(n){t[n]=e[n]&&function(t){return new Promise(function(r,o){(function(e,t,n,r){Promise.resolve(r).then(function(t){e({value:t,done:n})},t)})(r,o,(t=e[n](t)).done,t.value)})}}}function b(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}function S(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function g(e){return e&&e.__esModule?e:{default:e}}}]);
!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(","):"",f=u?"&__bindingId="+u:"",p=function(){return l(s+"/api/sessions"+window.location.search+d+_+f,{body:"{}",credentials:"same-origin",headers:new Headers({"Content-Type":"application/json"}),method:"POST"})};o=i?l(s+"/api/sessions/invalidToken?items=*",{credentials:"same-origin",headers:new Headers({"Content-Type":"application/json"}),method:"GET"},1).then(p).catch(function(e){return console.log("Error while loading session with error: ",e)}):p().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 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.0-beta.1",
"version": "1.8.0-beta.2",
"description": "Adds session as external to render runtime",

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

@@ -1,9 +0,19 @@

import setIOWindow from './io'
import setPortalWindow from './portal'
import { Session } from './session'
import { SessionResponse } from './utils/fetch'
import { ITEMS } from './constants'
interface SessionResponse {
response: Response | null,
error: any,
}
const delay = (ms: number): Promise<void> => {
return new Promise(resolve => setTimeout(resolve, ms))
}
declare global {
interface Window {
// IOWindow
__RUNTIME__: {
binding?: {
id: string
},
bindingChanged?: boolean,
culture: {

@@ -13,22 +23,105 @@ availableLocales: string[]

rootPath?: string
},
__RENDER_7_SESSION__: {
patchSession: (data?: any) => Promise<void | SessionResponse>,
sessionPromise: Promise<void | SessionResponse>,
},
__RENDER_8_SESSION__: {
patchSession: (data?: any) => Promise<void | SessionResponse>,
sessionPromise: Promise<void | SessionResponse>,
}
// Portal
vtexjs: {
session: Session
}
}
}
if (window.__RUNTIME__) {
setIOWindow()
const bindingChanged = window.__RUNTIME__ && window.__RUNTIME__.bindingChanged
const bindingId = window.__RUNTIME__ && window.__RUNTIME__.binding && window.__RUNTIME__.binding.id
const supportedLocales = window.__RUNTIME__ && window.__RUNTIME__.culture && window.__RUNTIME__.culture.availableLocales || []
const rootPath = window.__RUNTIME__ && window.__RUNTIME__.rootPath || ''
const RETRY_STATUSES = [ 408, 425, 429, 500, 501, 502, 503, 504, 505, 506, 507, 508, 510, 511 ]
const FETCH_TIMEOUT = 7000
const canRetry = (status: number) => RETRY_STATUSES.includes(status)
const fetchWithRetry = (url: string, init: RequestInit, maxRetries: number = 3) => {
let status = 500
let didTimeout = false
const callFetch = (attempt: number = 0): Promise<SessionResponse> =>
new Promise((resolve, reject) => {
const timeout = setTimeout(() => {
didTimeout = true
reject(new Error('Fetch timed out'))
}, FETCH_TIMEOUT)
fetch(url, init).then(response => {
clearTimeout(timeout)
if (!didTimeout) {
resolve(response)
}
}).catch(err => {
clearTimeout(timeout)
if (didTimeout) {
return
}
reject(err)
})
}).then((response: any) => {
status = response.status
return response.json()
.then((data: any) => ({response: data, error: null}))
}).catch((error) => {
console.error(error)
if (attempt >= maxRetries || !canRetry(status) || didTimeout) {
return {response: null, error: {message: 'Maximum number of attempts achieved or request timed out'}} as SessionResponse
}
const ms = (2 ** attempt) * 500
return delay(ms)
.then(() => callFetch(++attempt))
})
return callFetch()
}
const patchSession = (data?: any) => fetchWithRetry(`${rootPath}/api/sessions${window.location.search}`, {
body: data ? JSON.stringify(data) : '{}',
credentials: 'same-origin',
headers: new Headers({ 'Content-Type': 'application/json' }),
method: 'PATCH',
}).catch(err => console.log('Error while patching session with error: ', err))
const items = `${window.location.search ? '&' : '?'}items=${ITEMS.join(',')}`
const supportedLocalesSearch = supportedLocales.length > 0
? `&supportedLocales=${supportedLocales.join(',')}`
: ''
const bindingIdSearch = bindingId
? `&__bindingId=${bindingId}`
: ''
const createInitialSessionRequest = () => {
return fetchWithRetry(`${rootPath}/api/sessions${window.location.search}${items}${supportedLocalesSearch}${bindingIdSearch}`, {
body: '{}',
credentials: 'same-origin',
headers: new Headers({ 'Content-Type': 'application/json' }),
method: 'POST',
})
}
const clearSession = () => {
return fetchWithRetry(`${rootPath}/api/sessions/invalidToken?items=*`, {
credentials: 'same-origin',
headers: new Headers({ 'Content-Type': 'application/json' }),
method: 'GET',
}, 1)
}
let sessionPromise: Promise<void | SessionResponse>
if (bindingChanged) {
sessionPromise = clearSession()
.then(createInitialSessionRequest)
.catch((err: any) => console.log('Error while loading session with error: ', err));
} else {
setPortalWindow()
sessionPromise = createInitialSessionRequest()
.catch((err: any) => console.log('Error while loading session with error: ', err));
}
(window as any).__RENDER_7_SESSION__ = (window as any).__RENDER_8_SESSION__ = {
patchSession,
sessionPromise,
}
export {}

Sorry, the diff of this file is too big to display

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