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

yodata-client-js

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

yodata-client-js - npm Package Compare versions

Comparing version 0.0.4 to 0.0.8

2

package.json

@@ -19,3 +19,3 @@ {

},
"version": "0.0.4",
"version": "0.0.8",
"main": "yodata.client.js",

@@ -22,0 +22,0 @@ "private": false,

@@ -1,2 +0,2 @@

(function(){
(function() {
// Base object, `window` in the browser, `exports` in node.

@@ -8,3 +8,3 @@ var base = this;

var client = function yodataClient(options) {
var client = function yodataClient(options) {
this.authToken = options.authToken;

@@ -27,18 +27,15 @@ this._authStateChangeHandler = undefined;

headers: { 'Authorization' : 'Bearer ' + authToken },
success:function(res, textStatus, jqXHR)
{
success:function(res, textStatus, jqXHR) {
callback(null, res);
},
error: function(res, textStatus, errorThrown)
{
error: function(res, textStatus, errorThrown) {
callback(res.responseJSON, null);
}
});
}
else {
} else {
var options = {
url: url,
method: type,
headers: {
'Authorization' : 'Bearer ' + authToken
headers: {
'Authorization' : 'Bearer ' + authToken
}

@@ -52,3 +49,3 @@ }

var request = require("request");
var request = require('request');

@@ -61,8 +58,7 @@ request(options, function(err, response, body) {

callback(err, typeof body === "object" ? body : JSON.parse(body));
callback(err, typeof body === 'object' ? body : JSON.parse(body));
});
}
}
else {
} else {
callback(new Error('User is not logged in'), null);

@@ -87,11 +83,9 @@ }

dataType: 'json',
processData: false,
contentType: false,
processData: false,
contentType: false,
headers: { 'Authorization' : 'Bearer ' + authToken },
success:function(res, textStatus, jqXHR)
{
success:function(res, textStatus, jqXHR) {
callback(null, res);
},
error: function(res, textStatus, errorThrown)
{
error: function(res, textStatus, errorThrown) {
callback(res.responseJSON, null);

@@ -108,3 +102,3 @@ }

var request = require("request");
var request = require('request');

@@ -120,4 +114,3 @@ request(options, function(err, response, body) {

}
}
else {
} else {
callback(new Error('User is not logged in'), null);

@@ -240,3 +233,3 @@ }

// ------------------------
client.prototype.getApiUrl = function () {
client.prototype.getApiUrl = function() {
return YD_API_BASE_URL;

@@ -261,18 +254,13 @@ }

// Export class to `window` or `exports` object
if (typeof exports !== 'undefined') {
if (typeof module !== 'undefined' && module.exports) {
exports = module.exports = client;
}
exports.YDClient = client;
} else {
base.YDClient = client;
}
if (typeof define === 'function' && define.amd) {
if (typeof Package !== 'undefined') {
YDClient = client;
} else if (typeof define === 'function' && define.amd) {
define('YDClient', [], function() {
return client;
return client;
});
} else if (typeof module !== 'undefined' && module.exports) {
module.exports = client;
} else {
base.YDClient = client;
}
}.call(this));
}.call(this));
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