aboutsummaryrefslogtreecommitdiff
path: root/packages/web-util
diff options
context:
space:
mode:
authorSebastian <sebasjm@gmail.com>2024-04-22 12:50:25 -0300
committerSebastian <sebasjm@gmail.com>2024-04-22 12:50:25 -0300
commit82b8e83ca635bd27954565e2c29c77e0a75b3fc0 (patch)
tree0f73cdfde72d2cbaa43be332a9beab1080283a89 /packages/web-util
parent5db4cb99e3f16c8471117ca7443bc323180e67ec (diff)
downloadwallet-core-82b8e83ca635bd27954565e2c29c77e0a75b3fc0.tar.xz
fix #8398
Diffstat (limited to 'packages/web-util')
-rw-r--r--packages/web-util/src/context/activity.ts2
-rw-r--r--packages/web-util/src/context/challenger-api.ts14
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,