cash-tokenizer-client
Advanced tools
Comparing version 0.0.1 to 0.0.2
37
index.js
@@ -0,1 +1,2 @@ | ||
const EventSource = require('eventsource') | ||
const rp = require('request-promise-native') | ||
@@ -33,26 +34,16 @@ const defaultConfig = { | ||
//async function login(username, password){ | ||
// let options = { | ||
// method: 'POST', | ||
// uri: config.apiServerAddress + '/auth/login', | ||
// json: true, | ||
// form: { | ||
// username, | ||
// password | ||
// }, | ||
// headers: { | ||
// 'Content-Type': 'application/x-www-form-urlencoded' | ||
// } | ||
// } | ||
// try{ | ||
// let response = await rp(options) | ||
// return response | ||
// } catch(err){ | ||
// console.log('ERROR with calling /auth/login:', err) | ||
// return { | ||
// result: false | ||
// } | ||
// } | ||
//} | ||
function subscribeToExecutedRedemptionsPubSub(fn){ | ||
const uri = config.apiServerAddress+'/redemptions/subscribeToExecutedPubSub' | ||
const es = new EventSource(uri) | ||
es.addEventListener('executedRedemption', function (e) { | ||
if(!e.close){ | ||
e.close = function (){ | ||
es._close() | ||
} | ||
} | ||
fn(e) | ||
}) | ||
} | ||
return { | ||
@@ -59,0 +50,0 @@ isAPIRunning, |
{ | ||
"name": "cash-tokenizer-client", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"description": "A nodejs client for the cash-tokenizer API", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
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
2971
47