@vyng/truecaller-node
Advanced tools
Comparing version 1.0.5 to 1.0.6
@@ -9,6 +9,7 @@ // lib/fetchPublicKey.js | ||
const publicKeyUrl = 'https://api4.truecaller.com/v1/key'; | ||
const defaultExpire = 1000 * 60 * 60 * 24; // 24 hours | ||
const internalFetchPublicKeys = async (url) => { | ||
const internalFetchPublicKeys = async (url = publicKeyUrl) => { | ||
const { body } = await request({ | ||
url: url || publicKeyUrl, | ||
url, | ||
method: 'GET', | ||
@@ -30,6 +31,5 @@ json: true, | ||
{ | ||
maxAge: 1000, // 1000 * 60 * 30, // 30 minutes, | ||
maxAge: defaultExpire, | ||
isPromise: true, | ||
// Due to a bug, make this work: | ||
onExpire: (params) => fetchPublicKeys(...params), | ||
updateExpire: true, | ||
}, | ||
@@ -36,0 +36,0 @@ ); |
{ | ||
"name": "@vyng/truecaller-node", | ||
"version": "1.0.5", | ||
"version": "1.0.6", | ||
"description": "Node Truecaller profile verification", | ||
@@ -29,3 +29,3 @@ "main": "index.js", | ||
"devDependencies": { | ||
"eslint": "5.16.0", | ||
"eslint": "6.0.0", | ||
"eslint-config-airbnb-base": "13.1.0", | ||
@@ -32,0 +32,0 @@ "eslint-plugin-import": "2.17.3" |
@@ -26,4 +26,3 @@ # Truecaller for Node | ||
publicKeys: undefined, // Explicitly specifies public keys. Useful in case truecaller changes their fetch. | ||
} | ||
}; | ||
... | ||
@@ -38,2 +37,2 @@ const profile = await truecaller.verifyProfile(profile, options); | ||
### Notes | ||
If publicKeys are not explicitly specified, then truecaller-node will fetch and cache public keys every 30 minutes. | ||
If publicKeys are not explicitly specified, then truecaller-node will fetch and cache public keys for 24 hours. |
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
5799
37