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

rest-client-sdk

Package Overview
Dependencies
Maintainers
1
Versions
109
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rest-client-sdk - npm Package Compare versions

Comparing version 0.6.0 to 0.7.0

17

dist/TokenStorage.js

@@ -20,17 +20,22 @@ Object.defineProperty(exports,"__esModule",{value:true});var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"in descriptor)descriptor.writable=true;Object.defineProperty(target,descriptor.key,descriptor);}}return function(Constructor,protoProps,staticProps){if(protoProps)defineProperties(Constructor.prototype,protoProps);if(staticProps)defineProperties(Constructor,staticProps);return Constructor;};}();function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}var ACCESS_TOKEN_KEY='rest_client_sdk.api.access_token';var

{var _this=this;
if(!this._hasATokenBeenGenerated&&!this._tokenGenerator.canAutogenerateToken){
return this._asyncStorage.getItem(ACCESS_TOKEN_KEY).
then(function(token){
if(!token){
if(!_this._hasATokenBeenGenerated&&!_this._tokenGenerator.canAutogenerateToken){
throw new Error('No token has been generated yet.');}
if(!this._hasATokenBeenGenerated&&this._tokenGenerator.canAutogenerateToken){
return this._tokenGenerator.generateToken().
if(!_this._hasATokenBeenGenerated&&_this._tokenGenerator.canAutogenerateToken){
return _this._tokenGenerator.generateToken().
then(function(){return _this._asyncStorage.getItem(ACCESS_TOKEN_KEY);}).
then(function(token){return token&&JSON.parse(token).access_token;});}
then(function(generatedToken){return generatedToken&&JSON.parse(generatedToken).access_token;});}}
return this._asyncStorage.getItem(ACCESS_TOKEN_KEY).
then(function(token){return token&&JSON.parse(token).access_token;});}},{key:'logout',value:function logout()
return token&&JSON.parse(token).access_token;});}},{key:'logout',value:function logout()
{

@@ -37,0 +42,0 @@ return this._asyncStorage.removeItem(ACCESS_TOKEN_KEY);}},{key:'generateToken',value:function generateToken(

{
"name": "rest-client-sdk",
"version": "0.6.0",
"version": "0.7.0",
"description": "Rest Client SDK for API",

@@ -5,0 +5,0 @@ "main": "dist/index.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