Socket
Socket
Sign inDemoInstall

fb-graph-api

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fb-graph-api - npm Package Compare versions

Comparing version 1.0.9 to 1.0.10

11

dist/FBGraphAPI.js

@@ -48,2 +48,13 @@ "use strict";

}
}, {
key: "isValid",
value: function isValid(inputToken) {
var _this2 = this;
return new Promise(function (resolve, reject) {
_this2.debugToken(inputToken).then(function (data) {
return resolve(data.is_valid);
}).catch(reject);
});
}
}]);

@@ -50,0 +61,0 @@

13

dist/RequestAPI.js

@@ -29,10 +29,13 @@ 'use strict';

if (e) {
console.log('e', e);
reject({ message: 'Somethjng wrong' });
console.log('e', e);
} else {
console.log('res.statusCode debugAccessToken', res.statusCode);
if (res.statusCode !== 200) {
if (res.statusCode === 200) {
resolve(body.data);
} else if (res.statusCode === 400) {
reject({
message: body.error && body.error.message ? body.error.message : 'Something wrong with FB API'
});
} else {
reject({ message: 'something wrong statusCode' });
} else {
resolve(body.data);
}

@@ -39,0 +42,0 @@ }

{
"name": "fb-graph-api",
"version": "1.0.9",
"version": "1.0.10",
"description": "NodeJS Library for Facebook Graph API",

@@ -5,0 +5,0 @@ "homepage": "https://github.com/CoericK/fb-graph-api",

@@ -36,2 +36,10 @@ import {

}
isValid(inputToken) {
return new Promise((resolve, reject) => {
this.debugToken(inputToken)
.then(data => resolve(data.is_valid))
.catch(reject)
});
}
}

@@ -38,0 +46,0 @@

@@ -17,22 +17,26 @@ import request from 'request';

request.get({
url: `${BASE_URL}/debug_token?access_token=${appAccessToken}&input_token=${inputToken}`,
json: true
}, (e, res, body) => {
if (e) {
reject({message: 'Somethjng wrong'})
console.log('e', e);
} else {
console.log('res.statusCode debugAccessToken', res.statusCode);
if (res.statusCode !== 200) {
reject({message: 'something wrong statusCode'});
request
.get({
url: `${BASE_URL}/debug_token?access_token=${appAccessToken}&input_token=${inputToken}`,
json: true
}, (e, res, body) => {
if (e) {
console.log('e', e);
reject({message: 'Somethjng wrong'});
} else {
resolve(body.data);
if (res.statusCode === 200) {
resolve(body.data);
} else if (res.statusCode === 400) {
reject({
message: body.error && body.error.message ? body.error.message : `Something wrong with FB API`,
});
} else {
reject({message: 'something wrong statusCode'});
}
}
});
}
});
}
});
};
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