diff options
author | Sebastian <sebasjm@gmail.com> | 2024-04-26 13:54:12 -0300 |
---|---|---|
committer | Sebastian <sebasjm@gmail.com> | 2024-04-26 13:54:12 -0300 |
commit | f5cea56a6f38442f04eee9c78e4592698151a0b2 (patch) | |
tree | ba45a504ac182b806918abffc9f9a4064469155f | |
parent | c8aea621ab8000f4abc2f28f821aa830e1dbb0ef (diff) | |
download | wallet-core-f5cea56a6f38442f04eee9c78e4592698151a0b2.tar.gz wallet-core-f5cea56a6f38442f04eee9c78e4592698151a0b2.tar.bz2 wallet-core-f5cea56a6f38442f04eee9c78e4592698151a0b2.zip |
cache evict for exchange
-rw-r--r-- | packages/taler-util/src/http-client/exchange.ts | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/packages/taler-util/src/http-client/exchange.ts b/packages/taler-util/src/http-client/exchange.ts index ea7f44cf9..0ff1a8874 100644 --- a/packages/taler-util/src/http-client/exchange.ts +++ b/packages/taler-util/src/http-client/exchange.ts @@ -33,7 +33,7 @@ import { codecForExchangeConfig, codecForExchangeKeys, } from "./types.js"; -import { addPaginationParams } from "./utils.js"; +import { CacheEvictor, addPaginationParams, nullEvictor } from "./utils.js"; export type TalerExchangeResultByMethod< prop extends keyof TalerExchangeHttpClient, @@ -42,17 +42,25 @@ export type TalerExchangeErrorsByMethod< prop extends keyof TalerExchangeHttpClient, > = FailCasesByMethod<TalerExchangeHttpClient, prop>; +export enum TalerExchangeCacheEviction { + CREATE_DESCISION, +} + + /** */ export class TalerExchangeHttpClient { httpLib: HttpRequestLibrary; public readonly PROTOCOL_VERSION = "18:0:1"; + cacheEvictor: CacheEvictor<TalerExchangeCacheEviction>; constructor( readonly baseUrl: string, httpClient?: HttpRequestLibrary, + cacheEvictor?: CacheEvictor<TalerExchangeCacheEviction>, ) { this.httpLib = httpClient ?? createPlatformHttpLib(); + this.cacheEvictor = cacheEvictor ?? nullEvictor; } isCompatible(version: string): boolean { |