facebook-send-api-sdk
Advanced tools
Comparing version 0.0.1 to 0.0.2
{ | ||
"name": "facebook-send-api-sdk", | ||
"version": "0.0.01", | ||
"version": "0.0.02", | ||
"description": "Facebook SendApi SDK", | ||
@@ -5,0 +5,0 @@ "main": "./src/index.js", |
@@ -12,7 +12,6 @@ 'use strict'; | ||
function SendApiSdk(accessToken) { | ||
apiUrl = 'https://graph.facebook.com/v2.11/me/messages?access_token=' + accessToken; | ||
function SendApiSdk() { | ||
apiUrl = 'https://graph.facebook.com/v2.11/me/messages?access_token='; | ||
requestOptions = { | ||
method: 'POST', | ||
uri: apiUrl, | ||
json: true | ||
@@ -22,4 +21,5 @@ }; | ||
SendApiSdk.prototype.sendMessage = function (messageRequestOrTemplate, typing) { | ||
SendApiSdk.prototype.sendMessage = function (accessToken, messageRequestOrTemplate, typing) { | ||
const options = JSON.parse(JSON.stringify(requestOptions)); | ||
options.uri = apiUrl + accessToken; | ||
options.body = messageRequestOrTemplate; | ||
@@ -49,9 +49,10 @@ | ||
SendApiSdk.prototype.sendTypingIndicator = function (recipient) { | ||
return SendApiSdk.prototype.sendAction(recipient, constants.MessageState.TYPING_ON); | ||
SendApiSdk.prototype.sendTypingIndicator = function (accessToken, recipient) { | ||
return SendApiSdk.prototype.sendAction(accessToken, recipient, constants.MessageState.TYPING_ON); | ||
}; | ||
SendApiSdk.prototype.sendAction = function (recipient, sender_action) { | ||
SendApiSdk.prototype.sendAction = function (accessToken, recipient, sender_action) { | ||
const options = JSON.parse(JSON.stringify(requestOptions)); | ||
options.uri = apiUrl + accessToken; | ||
options.body = { | ||
@@ -58,0 +59,0 @@ recipient: recipient, |
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
20531
586