diff options
-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 { |