Comparing version 0.0.5 to 0.0.6
@@ -19,20 +19,9 @@ const path = require('path'); | ||
module.exports = class BankId { | ||
constructor({} = {}) { | ||
constructor({ refreshInterval=1000, production=false } = {}) { | ||
this.options = { | ||
refreshInterval, | ||
production, | ||
}; | ||
} | ||
getClient() { | ||
return new Promise((resolve, reject) => { | ||
if (this.client === undefined) { | ||
this._createClient().then(client => { | ||
this.client = client; | ||
resolve(client); | ||
}, reject); | ||
} | ||
else { | ||
resolve(this.client); | ||
} | ||
}); | ||
} | ||
authenticate(pno, callback) { | ||
@@ -64,3 +53,3 @@ return new Promise((resolve, reject) => { | ||
authenticateAndCollect(pno, refreshInterval=1000) { | ||
authenticateAndCollect(pno) { | ||
return new Promise((resolve, reject) => { | ||
@@ -81,3 +70,3 @@ this.authenticate(pno) | ||
}); | ||
}, refreshInterval); | ||
}, this.options.refreshInterval); | ||
}, reject); | ||
@@ -87,2 +76,16 @@ }); | ||
getClient() { | ||
return new Promise((resolve, reject) => { | ||
if (this.client === undefined) { | ||
this._createClient().then(client => { | ||
this.client = client; | ||
resolve(client); | ||
}, reject); | ||
} | ||
else { | ||
resolve(this.client); | ||
} | ||
}); | ||
} | ||
_createClient() { | ||
@@ -89,0 +92,0 @@ const pfx = fs.readFileSync(path.resolve(__dirname, 'FPTestcert2_20150818_102329.pfx')); |
{ | ||
"name": "bankid", | ||
"description": "", | ||
"version": "0.0.5", | ||
"version": "0.0.6", | ||
"main": "bankid.js", | ||
@@ -6,0 +6,0 @@ "repository": { |
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
30402
131