@fingerprintjs/fingerprintjs-pro-spa
Advanced tools
Comparing version 1.2.0-test.2 to 1.2.0
/** | ||
* FingerprintJS Pro SPA v1.2.0-test.2 - Copyright (c) FingerprintJS, Inc, 2023 (https://fingerprint.com) | ||
* FingerprintJS Pro SPA v1.2.0 - Copyright (c) FingerprintJS, Inc, 2023 (https://fingerprint.com) | ||
* Licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) license. | ||
@@ -11,3 +11,3 @@ */ | ||
var tslib = require('tslib'); | ||
var FingerprintJS = require('@fingerprintjs/fingerprintjs-pro'); | ||
var FingerprintJSPro = require('@fingerprintjs/fingerprintjs-pro'); | ||
@@ -32,3 +32,3 @@ function _interopNamespace(e) { | ||
var FingerprintJS__namespace = /*#__PURE__*/_interopNamespace(FingerprintJS); | ||
var FingerprintJSPro__namespace = /*#__PURE__*/_interopNamespace(FingerprintJSPro); | ||
@@ -255,3 +255,3 @@ const CACHE_KEY_PREFIX = '@fpjs@client@'; | ||
var version = "1.2.0-test.2"; | ||
var version = "1.2.0"; | ||
@@ -295,5 +295,5 @@ const cacheLocationBuilders = { | ||
var _a; | ||
this.options = options; | ||
this.inFlightRequests = new Map(); | ||
this.agentPromise = null; | ||
this.customAgent = options.customAgent; | ||
this.agent = { | ||
@@ -333,5 +333,8 @@ get: () => { | ||
init() { | ||
var _a; | ||
return tslib.__awaiter(this, void 0, void 0, function* () { | ||
if (!this.agentPromise) { | ||
this.agentPromise = FingerprintJS__namespace.load(this.loadOptions) | ||
const agentLoader = (_a = this.customAgent) !== null && _a !== void 0 ? _a : FingerprintJSPro__namespace; | ||
this.agentPromise = agentLoader | ||
.load(this.loadOptions) | ||
.then((agent) => { | ||
@@ -399,14 +402,22 @@ this.agent = agent; | ||
Object.defineProperty(exports, 'defaultEndpoint', { | ||
enumerable: true, | ||
get: function () { return FingerprintJS.defaultEndpoint; } | ||
}); | ||
Object.defineProperty(exports, 'defaultScriptUrlPattern', { | ||
enumerable: true, | ||
get: function () { return FingerprintJS.defaultScriptUrlPattern; } | ||
}); | ||
Object.defineProperty(exports, 'defaultTlsEndpoint', { | ||
enumerable: true, | ||
get: function () { return FingerprintJS.defaultTlsEndpoint; } | ||
}); | ||
/** | ||
* @deprecated | ||
* | ||
* Use `FingerprintJSPro.defaultEndpoint` instead, this export will be removed in the next major version | ||
* */ | ||
const defaultEndpoint = FingerprintJSPro__namespace.defaultEndpoint; | ||
/** | ||
* @deprecated | ||
* | ||
* Use `FingerprintJSPro.defaultTlsEndpoint` instead, this export will be removed in the next major version | ||
*/ | ||
const defaultTlsEndpoint = FingerprintJSPro__namespace.defaultTlsEndpoint; | ||
/** | ||
* @deprecated | ||
* | ||
* Use `FingerprintJSPro.defaultScriptUrlPattern` instead, this export will be removed in the next major version | ||
*/ | ||
const defaultScriptUrlPattern = FingerprintJSPro__namespace.defaultScriptUrlPattern; | ||
exports.FingerprintJSPro = FingerprintJSPro__namespace; | ||
exports.CacheStub = CacheStub; | ||
@@ -417,1 +428,4 @@ exports.FpjsClient = FpjsClient; | ||
exports.SessionStorageCache = SessionStorageCache; | ||
exports.defaultEndpoint = defaultEndpoint; | ||
exports.defaultScriptUrlPattern = defaultScriptUrlPattern; | ||
exports.defaultTlsEndpoint = defaultTlsEndpoint; |
/** | ||
* FingerprintJS Pro SPA v1.2.0-test.2 - Copyright (c) FingerprintJS, Inc, 2023 (https://fingerprint.com) | ||
* FingerprintJS Pro SPA v1.2.0 - Copyright (c) FingerprintJS, Inc, 2023 (https://fingerprint.com) | ||
* Licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) license. | ||
@@ -7,4 +7,4 @@ */ | ||
import * as FingerprintJS from '@fingerprintjs/fingerprintjs-pro'; | ||
import { GetOptions } from '@fingerprintjs/fingerprintjs-pro'; | ||
export { Agent, ExtendedGetResult, GetOptions, GetResult, LoadOptions, defaultEndpoint, defaultScriptUrlPattern, defaultTlsEndpoint } from '@fingerprintjs/fingerprintjs-pro'; | ||
import { GetOptions as GetOptions$1 } from '@fingerprintjs/fingerprintjs-pro'; | ||
export { FingerprintJS as FingerprintJSPro }; | ||
@@ -52,3 +52,3 @@ type VisitorData<TExtended extends boolean = false> = TExtended extends false ? FingerprintJS.GetResult : FingerprintJS.ExtendedGetResult; | ||
extendedResult: boolean | TExtended; | ||
constructor(options: GetOptions<TExtended>); | ||
constructor(options: GetOptions$1<TExtended>); | ||
/** | ||
@@ -127,2 +127,8 @@ * Converts this `CacheKey` instance into a string for use in a cache | ||
interface CustomAgent { | ||
load: (options: FingerprintJS.LoadOptions) => Promise<FingerprintJS.Agent>; | ||
} | ||
interface FpjsSpaOptions extends FpjsClientOptions { | ||
customAgent?: CustomAgent; | ||
} | ||
/** | ||
@@ -132,3 +138,2 @@ * FingerprintJS SDK for Single Page Applications | ||
declare class FpjsClient { | ||
private options; | ||
private cacheManager; | ||
@@ -138,5 +143,6 @@ private loadOptions; | ||
private agentPromise; | ||
private readonly customAgent?; | ||
readonly cacheLocation?: CacheLocation; | ||
private inFlightRequests; | ||
constructor(options: FpjsClientOptions); | ||
constructor(options: FpjsSpaOptions); | ||
/** | ||
@@ -154,3 +160,3 @@ * Loads FPJS JS agent with certain settings and stores the instance in memory | ||
*/ | ||
getVisitorData<TExtended extends boolean>(options?: GetOptions<TExtended>, ignoreCache?: boolean): Promise<VisitorData<TExtended>>; | ||
getVisitorData<TExtended extends boolean>(options?: GetOptions$1<TExtended>, ignoreCache?: boolean): Promise<VisitorData<TExtended>>; | ||
/** | ||
@@ -163,6 +169,60 @@ * Clears visitor data from cache regardless of the cache implementation | ||
*/ | ||
static makeCacheKey<TExtended extends boolean>(options: GetOptions<TExtended>): CacheKey<TExtended>; | ||
static makeCacheKey<TExtended extends boolean>(options: GetOptions$1<TExtended>): CacheKey<TExtended>; | ||
private _identify; | ||
} | ||
export { CacheLocation, CacheStub, Cacheable, FpjsClient, FpjsClientOptions, ICache, InMemoryCache, LocalStorageCache, SessionStorageCache, VisitorData }; | ||
/** | ||
* @deprecated | ||
* | ||
* Use `FingerprintJSPro.defaultEndpoint` instead, this export will be removed in the next major version | ||
* */ | ||
declare const defaultEndpoint: { | ||
default: "endpoint"; | ||
}; | ||
/** | ||
* @deprecated | ||
* | ||
* Use `FingerprintJSPro.defaultTlsEndpoint` instead, this export will be removed in the next major version | ||
*/ | ||
declare const defaultTlsEndpoint: { | ||
default: "tlsEndpoint"; | ||
}; | ||
/** | ||
* @deprecated | ||
* | ||
* Use `FingerprintJSPro.defaultScriptUrlPattern` instead, this export will be removed in the next major version | ||
*/ | ||
declare const defaultScriptUrlPattern: string; | ||
/** | ||
* @deprecated | ||
* | ||
* Use `FingerprintJSPro.Agent` instead, this export will be removed in the next major version | ||
* */ | ||
type Agent = FingerprintJS.Agent; | ||
/** | ||
* @deprecated | ||
* | ||
* Use `FingerprintJSPro.GetOptions` instead, this export will be removed in the next major version | ||
*/ | ||
type GetOptions<TExtended extends boolean, TIP = unknown> = FingerprintJS.GetOptions<TExtended, TIP>; | ||
/** | ||
* @deprecated | ||
* | ||
* Use `FingerprintJSPro.GetResult` instead, this export will be removed in the next major version | ||
*/ | ||
type GetResult = FingerprintJS.GetResult; | ||
/** | ||
* @deprecated | ||
* | ||
* Use `FingerprintJSPro.LoadOptions` instead, this export will be removed in the next major version | ||
*/ | ||
type LoadOptions = FingerprintJS.LoadOptions; | ||
/** | ||
* @deprecated | ||
* | ||
* Use `FingerprintJSPro.ExtendedGetResult` instead, this export will be removed in the next major version | ||
*/ | ||
type ExtendedGetResult = FingerprintJS.ExtendedGetResult; | ||
export { Agent, CacheLocation, CacheStub, Cacheable, CustomAgent, ExtendedGetResult, FpjsClient, FpjsClientOptions, FpjsSpaOptions, GetOptions, GetResult, ICache, InMemoryCache, LoadOptions, LocalStorageCache, SessionStorageCache, VisitorData, defaultEndpoint, defaultScriptUrlPattern, defaultTlsEndpoint }; |
/** | ||
* FingerprintJS Pro SPA v1.2.0-test.2 - Copyright (c) FingerprintJS, Inc, 2023 (https://fingerprint.com) | ||
* FingerprintJS Pro SPA v1.2.0 - Copyright (c) FingerprintJS, Inc, 2023 (https://fingerprint.com) | ||
* Licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) license. | ||
@@ -7,4 +7,4 @@ */ | ||
import { __awaiter } from 'tslib'; | ||
import * as FingerprintJS from '@fingerprintjs/fingerprintjs-pro'; | ||
export { defaultEndpoint, defaultScriptUrlPattern, defaultTlsEndpoint } from '@fingerprintjs/fingerprintjs-pro'; | ||
import * as FingerprintJSPro from '@fingerprintjs/fingerprintjs-pro'; | ||
export { FingerprintJSPro }; | ||
@@ -231,3 +231,3 @@ const CACHE_KEY_PREFIX = '@fpjs@client@'; | ||
var version = "1.2.0-test.2"; | ||
var version = "1.2.0"; | ||
@@ -271,5 +271,5 @@ const cacheLocationBuilders = { | ||
var _a; | ||
this.options = options; | ||
this.inFlightRequests = new Map(); | ||
this.agentPromise = null; | ||
this.customAgent = options.customAgent; | ||
this.agent = { | ||
@@ -309,5 +309,8 @@ get: () => { | ||
init() { | ||
var _a; | ||
return __awaiter(this, void 0, void 0, function* () { | ||
if (!this.agentPromise) { | ||
this.agentPromise = FingerprintJS.load(this.loadOptions) | ||
const agentLoader = (_a = this.customAgent) !== null && _a !== void 0 ? _a : FingerprintJSPro; | ||
this.agentPromise = agentLoader | ||
.load(this.loadOptions) | ||
.then((agent) => { | ||
@@ -375,2 +378,21 @@ this.agent = agent; | ||
export { CacheLocation, CacheStub, FpjsClient, InMemoryCache, LocalStorageCache, SessionStorageCache }; | ||
/** | ||
* @deprecated | ||
* | ||
* Use `FingerprintJSPro.defaultEndpoint` instead, this export will be removed in the next major version | ||
* */ | ||
const defaultEndpoint = FingerprintJSPro.defaultEndpoint; | ||
/** | ||
* @deprecated | ||
* | ||
* Use `FingerprintJSPro.defaultTlsEndpoint` instead, this export will be removed in the next major version | ||
*/ | ||
const defaultTlsEndpoint = FingerprintJSPro.defaultTlsEndpoint; | ||
/** | ||
* @deprecated | ||
* | ||
* Use `FingerprintJSPro.defaultScriptUrlPattern` instead, this export will be removed in the next major version | ||
*/ | ||
const defaultScriptUrlPattern = FingerprintJSPro.defaultScriptUrlPattern; | ||
export { CacheLocation, CacheStub, FpjsClient, InMemoryCache, LocalStorageCache, SessionStorageCache, defaultEndpoint, defaultScriptUrlPattern, defaultTlsEndpoint }; |
{ | ||
"name": "@fingerprintjs/fingerprintjs-pro-spa", | ||
"version": "1.2.0-test.2", | ||
"version": "1.2.0", | ||
"description": "FingerprintJS Pro JavaScript agent for Single-Page Applications (SPA)", | ||
@@ -53,3 +53,3 @@ "main": "dist/fp-pro-spa.cjs.js", | ||
"dependencies": { | ||
"@fingerprintjs/fingerprintjs-pro": "^3.8.4", | ||
"@fingerprintjs/fingerprintjs-pro": "^3.8.5", | ||
"tslib": "^2.5.0" | ||
@@ -56,0 +56,0 @@ }, |
@@ -86,4 +86,3 @@ <p align="center"> | ||
FpjsClient, | ||
// defaultEndpoint, | ||
// defaultScriptUrlPattern | ||
FingerprintJSPro | ||
} from '@fingerprintjs/fingerprintjs-pro-spa'; | ||
@@ -96,4 +95,4 @@ | ||
apiKey: "<PUBLIC_API_KEY>", | ||
// endpoint: ["<CUSTOM_ENDPOINT>", defaultEndpoint], | ||
// scriptUrlPattern: ["<CUSTOM_SCRIPT_URL>", defaultScriptUrlPattern], | ||
// endpoint: ["<CUSTOM_ENDPOINT>", FingerprintJSPro.defaultEndpoint], | ||
// scriptUrlPattern: ["<CUSTOM_SCRIPT_URL>", FingerprintJSPro.defaultScriptUrlPattern], | ||
// region: "eu" | ||
@@ -100,0 +99,0 @@ } |
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
48536
1000
0
185