commit f5cea56a6f38442f04eee9c78e4592698151a0b2
parent c8aea621ab8000f4abc2f28f821aa830e1dbb0ef
Author: Sebastian <sebasjm@gmail.com>
Date: Fri, 26 Apr 2024 13:54:12 -0300
cache evict for exchange
Diffstat:
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git 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 {