diff options
Diffstat (limited to 'packages/web-util/src')
-rw-r--r-- | packages/web-util/src/context/activity.ts | 2 | ||||
-rw-r--r-- | packages/web-util/src/context/challenger-api.ts | 14 |
2 files changed, 10 insertions, 6 deletions
diff --git a/packages/web-util/src/context/activity.ts b/packages/web-util/src/context/activity.ts index 3cfd83bda..fd366cbe5 100644 --- a/packages/web-util/src/context/activity.ts +++ b/packages/web-util/src/context/activity.ts @@ -67,6 +67,6 @@ export interface BankLib { } export interface ChallengerLib { - bank: ChallengerHttpClient; + challenger: ChallengerHttpClient; } diff --git a/packages/web-util/src/context/challenger-api.ts b/packages/web-util/src/context/challenger-api.ts index 960f1db0d..8748f5f69 100644 --- a/packages/web-util/src/context/challenger-api.ts +++ b/packages/web-util/src/context/challenger-api.ts @@ -15,7 +15,9 @@ */ import { + CacheEvictor, ChallengerApi, + ChallengerCacheEviction, ChallengerHttpClient, LibtoolVersion, ObservabilityEvent, @@ -63,7 +65,9 @@ enum VersionHint { NONE, } -type Evictors = Record<string, never>; +type Evictors = { + challenger?: CacheEvictor<ChallengerCacheEviction>; +} type ConfigResult<T> = | undefined @@ -174,10 +178,10 @@ function buildChallengerApiClient( }, }); - const bank = new ChallengerHttpClient(url.href, httpLib); + const challenger = new ChallengerHttpClient(url.href, httpLib, evictors.challenger); async function getRemoteConfig(): Promise<ChallengerApi.ChallengerTermsOfServiceResponse> { - const resp = await bank.getConfig(); + const resp = await challenger.getConfig(); if (resp.type === "fail") { throw TalerError.fromUncheckedDetail(resp.detail); } @@ -186,9 +190,9 @@ function buildChallengerApiClient( return { getRemoteConfig, - VERSION: bank.PROTOCOL_VERSION, + VERSION: challenger.PROTOCOL_VERSION, lib: { - bank, + challenger, }, onActivity: tracker.subscribe, cancelRequest: httpLib.cancelRequest, |