@fingerprintjs/fingerprintjs-pro-spa
Advanced tools
Comparing version 0.4.0 to 0.4.1
@@ -0,1 +1,7 @@ | ||
#### 0.4.1 (2022-06-29) | ||
##### Documentation Changes | ||
* add more jsdoc comments ([3100b989](https://github.com/fingerprintjs/fingerprintjs-pro-spa/commit/3100b989bb7c90de179ae87865caeafe0c7688ad)) | ||
### 0.4.0 (2022-05-25) | ||
@@ -2,0 +8,0 @@ |
/** | ||
* FingerprintJS Pro SPA v0.4.0 - Copyright (c) FingerprintJS, Inc, 2022 (https://fingerprintjs.com) | ||
* FingerprintJS Pro SPA v0.4.1 - Copyright (c) FingerprintJS, Inc, 2022 (https://fingerprintjs.com) | ||
* Licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) license. | ||
@@ -59,2 +59,5 @@ */ | ||
/** | ||
* Implementation of caching that uses local storage | ||
* */ | ||
class LocalStorageCache { | ||
@@ -89,2 +92,5 @@ constructor(prefix = CACHE_KEY_PREFIX) { | ||
/** | ||
* Implementation of caching that uses session storage | ||
* */ | ||
class SessionStorageCache { | ||
@@ -94,5 +100,15 @@ constructor(prefix = CACHE_KEY_PREFIX) { | ||
} | ||
/** | ||
* It takes a key and an entry, and sets the entry in the session storage with the key | ||
* @param {string} key - The key to store the entry under. | ||
* @param {Cacheable} entry - The value to be stored in the cache. | ||
*/ | ||
set(key, entry) { | ||
window.sessionStorage.setItem(getKeyWithPrefix(key, this.prefix), JSON.stringify(entry)); | ||
} | ||
/** | ||
* It gets the value of the key from the session storage, parses it as JSON, and returns it | ||
* @param {string} key - The key to store the data under. | ||
* @returns The value of the key in the sessionStorage. | ||
*/ | ||
get(key) { | ||
@@ -110,5 +126,13 @@ const json = window.sessionStorage.getItem(getKeyWithPrefix(key, this.prefix)); | ||
} | ||
/** | ||
* It removes the item from session storage with the given key | ||
* @param {string} key - The key to store the value under. | ||
*/ | ||
remove(key) { | ||
window.sessionStorage.removeItem(getKeyWithPrefix(key, this.prefix)); | ||
} | ||
/** | ||
* It returns an array of all the keys in the session storage that start with the prefix | ||
* @returns An array of all the keys in the sessionStorage that start with the prefix. | ||
*/ | ||
allKeys() { | ||
@@ -121,2 +145,5 @@ return Object.keys(window.sessionStorage) | ||
/** | ||
* Wraps a cache implementation and adds expiration logic | ||
* */ | ||
class CacheManager { | ||
@@ -128,2 +155,7 @@ constructor(cache, cacheTime = DEFAULT_CACHE_LIFE, nowProvider) { | ||
} | ||
/** | ||
* It gets a cache entry from the cache, and if it's expired, it removes it from the cache | ||
* @param cacheKey - CacheKey<TExtended> | ||
* @returns A promise that resolves to a cache entry or undefined. | ||
*/ | ||
get(cacheKey) { | ||
@@ -144,2 +176,7 @@ return tslib.__awaiter(this, void 0, void 0, function* () { | ||
} | ||
/** | ||
* It takes a cache key and a cache entry, wraps the cache entry, and then sets the wrapped cache entry in the cache | ||
* @param cacheKey - CacheKey<TExtended> | ||
* @param {CacheEntry} entry - The cache entry to be stored. | ||
*/ | ||
set(cacheKey, entry) { | ||
@@ -151,2 +188,5 @@ return tslib.__awaiter(this, void 0, void 0, function* () { | ||
} | ||
/** | ||
* It gets all the keys in the cache, and then removes them all | ||
*/ | ||
clearCache() { | ||
@@ -170,2 +210,5 @@ return tslib.__awaiter(this, void 0, void 0, function* () { | ||
/** | ||
* Implementation of caching that uses in-memory storage | ||
* */ | ||
class InMemoryCache { | ||
@@ -197,2 +240,5 @@ constructor() { | ||
/** | ||
* Implementation of stub cache that is used when cache is disabled by user | ||
* */ | ||
class CacheStub { | ||
@@ -217,3 +263,3 @@ set() { } | ||
var version = "0.4.0"; | ||
var version = "0.4.1"; | ||
@@ -220,0 +266,0 @@ const cacheLocationBuilders = { |
/** | ||
* FingerprintJS Pro SPA v0.4.0 - Copyright (c) FingerprintJS, Inc, 2022 (https://fingerprintjs.com) | ||
* FingerprintJS Pro SPA v0.4.1 - Copyright (c) FingerprintJS, Inc, 2022 (https://fingerprintjs.com) | ||
* Licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) license. | ||
@@ -66,2 +66,5 @@ */ | ||
/** | ||
* Implementation of caching that uses local storage | ||
* */ | ||
declare class LocalStorageCache implements ICache { | ||
@@ -76,11 +79,35 @@ prefix: string; | ||
/** | ||
* Implementation of caching that uses session storage | ||
* */ | ||
declare class SessionStorageCache implements ICache { | ||
prefix: string; | ||
constructor(prefix?: string); | ||
/** | ||
* It takes a key and an entry, and sets the entry in the session storage with the key | ||
* @param {string} key - The key to store the entry under. | ||
* @param {Cacheable} entry - The value to be stored in the cache. | ||
*/ | ||
set<T = Cacheable>(key: string, entry: T): void; | ||
/** | ||
* It gets the value of the key from the session storage, parses it as JSON, and returns it | ||
* @param {string} key - The key to store the data under. | ||
* @returns The value of the key in the sessionStorage. | ||
*/ | ||
get<T = Cacheable>(key: string): T | undefined; | ||
/** | ||
* It removes the item from session storage with the given key | ||
* @param {string} key - The key to store the value under. | ||
*/ | ||
remove(key: string): void; | ||
/** | ||
* It returns an array of all the keys in the session storage that start with the prefix | ||
* @returns An array of all the keys in the sessionStorage that start with the prefix. | ||
*/ | ||
allKeys(): string[]; | ||
} | ||
/** | ||
* Implementation of caching that uses in-memory storage | ||
* */ | ||
declare class InMemoryCache { | ||
@@ -90,2 +117,5 @@ enclosedCache: ICache; | ||
/** | ||
* Implementation of stub cache that is used when cache is disabled by user | ||
* */ | ||
declare class CacheStub implements ICache { | ||
@@ -92,0 +122,0 @@ set(): void; |
/** | ||
* FingerprintJS Pro SPA v0.4.0 - Copyright (c) FingerprintJS, Inc, 2022 (https://fingerprintjs.com) | ||
* FingerprintJS Pro SPA v0.4.1 - Copyright (c) FingerprintJS, Inc, 2022 (https://fingerprintjs.com) | ||
* Licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) license. | ||
@@ -35,2 +35,5 @@ */ | ||
/** | ||
* Implementation of caching that uses local storage | ||
* */ | ||
class LocalStorageCache { | ||
@@ -65,2 +68,5 @@ constructor(prefix = CACHE_KEY_PREFIX) { | ||
/** | ||
* Implementation of caching that uses session storage | ||
* */ | ||
class SessionStorageCache { | ||
@@ -70,5 +76,15 @@ constructor(prefix = CACHE_KEY_PREFIX) { | ||
} | ||
/** | ||
* It takes a key and an entry, and sets the entry in the session storage with the key | ||
* @param {string} key - The key to store the entry under. | ||
* @param {Cacheable} entry - The value to be stored in the cache. | ||
*/ | ||
set(key, entry) { | ||
window.sessionStorage.setItem(getKeyWithPrefix(key, this.prefix), JSON.stringify(entry)); | ||
} | ||
/** | ||
* It gets the value of the key from the session storage, parses it as JSON, and returns it | ||
* @param {string} key - The key to store the data under. | ||
* @returns The value of the key in the sessionStorage. | ||
*/ | ||
get(key) { | ||
@@ -86,5 +102,13 @@ const json = window.sessionStorage.getItem(getKeyWithPrefix(key, this.prefix)); | ||
} | ||
/** | ||
* It removes the item from session storage with the given key | ||
* @param {string} key - The key to store the value under. | ||
*/ | ||
remove(key) { | ||
window.sessionStorage.removeItem(getKeyWithPrefix(key, this.prefix)); | ||
} | ||
/** | ||
* It returns an array of all the keys in the session storage that start with the prefix | ||
* @returns An array of all the keys in the sessionStorage that start with the prefix. | ||
*/ | ||
allKeys() { | ||
@@ -97,2 +121,5 @@ return Object.keys(window.sessionStorage) | ||
/** | ||
* Wraps a cache implementation and adds expiration logic | ||
* */ | ||
class CacheManager { | ||
@@ -104,2 +131,7 @@ constructor(cache, cacheTime = DEFAULT_CACHE_LIFE, nowProvider) { | ||
} | ||
/** | ||
* It gets a cache entry from the cache, and if it's expired, it removes it from the cache | ||
* @param cacheKey - CacheKey<TExtended> | ||
* @returns A promise that resolves to a cache entry or undefined. | ||
*/ | ||
get(cacheKey) { | ||
@@ -120,2 +152,7 @@ return __awaiter(this, void 0, void 0, function* () { | ||
} | ||
/** | ||
* It takes a cache key and a cache entry, wraps the cache entry, and then sets the wrapped cache entry in the cache | ||
* @param cacheKey - CacheKey<TExtended> | ||
* @param {CacheEntry} entry - The cache entry to be stored. | ||
*/ | ||
set(cacheKey, entry) { | ||
@@ -127,2 +164,5 @@ return __awaiter(this, void 0, void 0, function* () { | ||
} | ||
/** | ||
* It gets all the keys in the cache, and then removes them all | ||
*/ | ||
clearCache() { | ||
@@ -146,2 +186,5 @@ return __awaiter(this, void 0, void 0, function* () { | ||
/** | ||
* Implementation of caching that uses in-memory storage | ||
* */ | ||
class InMemoryCache { | ||
@@ -173,2 +216,5 @@ constructor() { | ||
/** | ||
* Implementation of stub cache that is used when cache is disabled by user | ||
* */ | ||
class CacheStub { | ||
@@ -193,3 +239,3 @@ set() { } | ||
var version = "0.4.0"; | ||
var version = "0.4.1"; | ||
@@ -196,0 +242,0 @@ const cacheLocationBuilders = { |
{ | ||
"name": "@fingerprintjs/fingerprintjs-pro-spa", | ||
"version": "0.4.0", | ||
"version": "0.4.1", | ||
"description": "FingerprintJS Pro JavaScript agent for Single-Page Applications (SPA)", | ||
@@ -5,0 +5,0 @@ "main": "dist/fp-pro-spa.cjs.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
45501
836