From 9312a62b8b6ec29adf830c3b1658f45caece940b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Przemys=C5=82aw=20=C5=BBydek?= Date: Tue, 19 Sep 2023 13:10:20 +0200 Subject: [PATCH 1/2] fix: introduce FpjsSpaOptions type --- src/client.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/client.ts b/src/client.ts index 4282a56..1e1ead6 100644 --- a/src/client.ts +++ b/src/client.ts @@ -46,10 +46,14 @@ const cacheFactory = (location: CacheLocation) => { return cacheLocationBuilders[location] } -interface CustomAgent { +export interface CustomAgent { load: (options: FingerprintJS.LoadOptions) => Promise } +export interface FpjsSpaOptions extends FpjsClientOptions { + customAgent?: CustomAgent +} + /** * FingerprintJS SDK for Single Page Applications */ @@ -58,12 +62,12 @@ export class FpjsClient { private loadOptions: FingerprintJS.LoadOptions private agent: FingerprintJS.Agent private agentPromise: Promise | null - private customAgent?: CustomAgent + private readonly customAgent?: CustomAgent readonly cacheLocation?: CacheLocation private inFlightRequests = new Map>() - constructor(private options: FpjsClientOptions & { customAgent?: CustomAgent }) { + constructor(options: FpjsSpaOptions) { this.agentPromise = null this.customAgent = options.customAgent From 73064be007a684922ed823f94298dd3c5a96f9f5 Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Tue, 19 Sep 2023 12:46:33 +0000 Subject: [PATCH 2/2] chore(release): 1.1.3 [skip ci] ## [1.1.3](https://github.com/fingerprintjs/fingerprintjs-pro-spa/compare/v1.1.2...v1.1.3) (2023-09-19) ### Bug Fixes * introduce FpjsSpaOptions type ([9312a62](https://github.com/fingerprintjs/fingerprintjs-pro-spa/commit/9312a62b8b6ec29adf830c3b1658f45caece940b)) --- CHANGELOG.md | 7 +++++++ package.json | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6cf7b93..58e96b5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +## [1.1.3](https://github.com/fingerprintjs/fingerprintjs-pro-spa/compare/v1.1.2...v1.1.3) (2023-09-19) + + +### Bug Fixes + +* introduce FpjsSpaOptions type ([9312a62](https://github.com/fingerprintjs/fingerprintjs-pro-spa/commit/9312a62b8b6ec29adf830c3b1658f45caece940b)) + ## [1.1.2](https://github.com/fingerprintjs/fingerprintjs-pro-spa/compare/v1.1.1...v1.1.2) (2023-09-12) diff --git a/package.json b/package.json index f37470b..890d0e7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@fingerprintjs/fingerprintjs-pro-spa", - "version": "1.1.2", + "version": "1.1.3", "description": "FingerprintJS Pro JavaScript agent for Single-Page Applications (SPA)", "main": "dist/fp-pro-spa.cjs.js", "module": "dist/fp-pro-spa.esm.js",