New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@st-graphics/premium

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@st-graphics/premium - npm Package Compare versions

Comparing version 0.2.4 to 0.2.5

37

client/premium.js

@@ -43,2 +43,4 @@ const inProduction = process.env.NODE_ENV === 'production'

window.fetch = window.fetch || fetch
function PremiumClient () {}

@@ -71,3 +73,4 @@

const url = SERVICE_URL + '/get-session'
return fetch(url, {withCredentials: true})
return window.fetch(url, {credentials: 'include'})
.then(function (res) { return res.json() })
}

@@ -81,15 +84,16 @@

const url = SERVICE_URL + '/content?' + stringifyQuery(query)
return fetch(url, {withCredentials: true})
return window.fetch(url, {credentials: 'include'})
.then(function (res) { return res.json() })
.then(function (res) {
if (res.renewed) console.log('Credential renewed')
return fetch(res.signed_url)
return window.fetch(res.signed_url)
.then(function (res) { return res.json() })
.then(function (json) { return Object.assign(json, {user: res.user}) })
})
.catch(function () {
return self.fetchPublicContent(resourceKey)
})
.catch(function () { return self.fetchPublicContent(resourceKey) })
}
PremiumClient.prototype.fetchPublicContent = function (resourceKey) {
return fetch(BUCKET_URL + resourceKey)
return window.fetch(BUCKET_URL + resourceKey)
.then(function (res) { return res.json() })
}

@@ -109,9 +113,20 @@

})
xhr.withCredentials = options.withCredentials
xhr.withCredentials = options.credentials === 'include'
xhr.onreadystatechange = function () {
if (xhr.readyState === 4) {
try {
const json = JSON.parse(xhr.response)
if (xhr.status === 200) resolve(json)
else reject(new Error(json.message))
const response = Object.create({
text () {
return xhr.responseText
},
json () {
return JSON.parse(xhr.responseText)
}
})
response.ok = xhr.status === 200
response.status = xhr.status
response.statusText = xhr.statusText
response.url = xhr.responseURL
response.headers = xhr.getAllResponseHeaders()
resolve(response)
} catch (err) {

@@ -118,0 +133,0 @@ reject(err)

{
"name": "@st-graphics/premium",
"version": "0.2.4",
"version": "0.2.5",
"description": "ST Graphics Premium implementation",

@@ -5,0 +5,0 @@ "main": "client/premium.js",

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