synapsepay
Advanced tools
Comparing version 0.0.3 to 0.1.0
var request = require('superagent'); | ||
var mime = require('mime'); | ||
var CryptoJS = require('crypto-js'); | ||
var _ = require('underscore')._; | ||
const os = require('os'); | ||
@@ -42,2 +44,11 @@ var Helpers = { | ||
return (hashed === given_hmac); | ||
}, | ||
getUserIP: function() { | ||
return _.chain(os.networkInterfaces()) | ||
.values() | ||
.flatten() | ||
.find({family: 'IPv4', internal: false}) | ||
.value() | ||
.address; | ||
} | ||
@@ -44,0 +55,0 @@ }; |
@@ -50,2 +50,11 @@ var APIClient = require('./APIClient.js'); | ||
User.prototype.addDocuments = function(payload, callback){ | ||
var url = this.json['_links']['self']['href']; | ||
var self = this; | ||
var config = this.getAPIConfig(); | ||
APIClient.patch(url, config, payload, function(err, json){ | ||
self.updateJSON(err, json, callback); | ||
}); | ||
}; | ||
User.prototype.addDoc = function(payload, callback){ | ||
@@ -78,2 +87,2 @@ var url = this.json['_links']['self']['href']; | ||
module.exports = User; | ||
module.exports = User; |
@@ -10,3 +10,8 @@ var APIClient = require('./APIClient.js'); | ||
}; | ||
var url = client.baseUrl + '/users'; | ||
var url = `${client.baseUrl}/users`; | ||
if(options.query) { | ||
url += `?query=${options.query}`; | ||
} | ||
if(options){ | ||
@@ -13,0 +18,0 @@ if(options._id){ |
{ | ||
"name": "synapsepay", | ||
"version": "0.0.3", | ||
"version": "0.1.0", | ||
"description": "Node.js Library for SynapsePay API v3 Rest", | ||
@@ -25,4 +25,5 @@ "main": "index.js", | ||
"mime": "^1.3.0", | ||
"superagent": "^1.5.0" | ||
"superagent": "^1.5.0", | ||
"underscore": "^1.8.3" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
31226
949
6
+ Addedunderscore@^1.8.3
+ Addedunderscore@1.13.7(transitive)