taler-typescript-core

Wallet core logic and WebUIs for various components
Log | Files | Refs | Submodules | README | LICENSE

commit 203d31ea370668e1eba5d281e82ce78226dba241
parent cf6962d7a9c211ee7be21ae2be5f1359e116cbee
Author: Florian Dold <florian@dold.me>
Date:   Tue, 21 Jul 2026 19:41:09 +0200

fix api version range of corebank

Diffstat:
Mpackages/taler-util/src/http-client/bank-core.ts | 72+++++++++++++++++++++++++++++++++++++++++++++++++++++++++---------------
1 file changed, 57 insertions(+), 15 deletions(-)

diff --git a/packages/taler-util/src/http-client/bank-core.ts b/packages/taler-util/src/http-client/bank-core.ts @@ -132,7 +132,7 @@ export enum TalerCoreBankCacheEviction { * Uses libtool's current:revision:age versioning. */ export class TalerCoreBankHttpClient { - public static readonly PROTOCOL_VERSION = "10:0:2"; + public static readonly PROTOCOL_VERSION = "12:0:2"; httpLib: HttpRequestLibrary; cacheEvictor: CacheEvictor<TalerCoreBankCacheEviction>; @@ -169,7 +169,10 @@ export class TalerCoreBankHttpClient { body: TokenRequest, params: { challengeIds?: string[] } = {}, ) { - const url = new URL(`accounts/${pathSegment(username)}/token`, this.baseUrl); + const url = new URL( + `accounts/${pathSegment(username)}/token`, + this.baseUrl, + ); this.checkUsernameAuthMatch(username, auth); @@ -504,7 +507,10 @@ export class TalerCoreBankHttpClient { body: AccountPasswordChange, params: { challengeIds?: string[] } = {}, ) { - const url = new URL(`accounts/${pathSegment(auth.username)}/auth`, this.baseUrl); + const url = new URL( + `accounts/${pathSegment(auth.username)}/auth`, + this.baseUrl, + ); const headers: Record<string, string> = {}; headers.Authorization = makeBearerTokenAuthHeader(auth.token); @@ -652,7 +658,10 @@ export class TalerCoreBankHttpClient { auth: UserAndToken, params?: PaginationParams & LongPollParams, ) { - const url = new URL(`accounts/${pathSegment(auth.username)}/transactions`, this.baseUrl); + const url = new URL( + `accounts/${pathSegment(auth.username)}/transactions`, + this.baseUrl, + ); addPaginationParams(url, params); addLongPollingParam(url, params); const resp = await this.httpLib.fetch(url.href, { @@ -714,7 +723,10 @@ export class TalerCoreBankHttpClient { body: CreateTransactionRequest, params: { challengeIds?: string[] } = {}, ) { - const url = new URL(`accounts/${pathSegment(auth.username)}/transactions`, this.baseUrl); + const url = new URL( + `accounts/${pathSegment(auth.username)}/transactions`, + this.baseUrl, + ); const headers: Record<string, string> = {}; headers.Authorization = makeBearerTokenAuthHeader(auth.token); if (params.challengeIds && params.challengeIds.length > 0) { @@ -777,7 +789,10 @@ export class TalerCoreBankHttpClient { auth: UserAndToken, body: BankAccountCreateWithdrawalRequest, ) { - const url = new URL(`accounts/${pathSegment(auth.username)}/withdrawals`, this.baseUrl); + const url = new URL( + `accounts/${pathSegment(auth.username)}/withdrawals`, + this.baseUrl, + ); const resp = await this.httpLib.fetch(url.href, { method: "POST", headers: { @@ -956,7 +971,10 @@ export class TalerCoreBankHttpClient { body: CashoutRequest, params: { challengeIds?: string[] } = {}, ) { - const url = new URL(`accounts/${pathSegment(auth.username)}/cashouts`, this.baseUrl); + const url = new URL( + `accounts/${pathSegment(auth.username)}/cashouts`, + this.baseUrl, + ); const headers: Record<string, string> = {}; headers.Authorization = makeBearerTokenAuthHeader(auth.token); if (params.challengeIds && params.challengeIds.length > 0) { @@ -1052,7 +1070,10 @@ export class TalerCoreBankHttpClient { * */ async getAccountCashouts(auth: UserAndToken, pagination?: PaginationParams) { - const url = new URL(`accounts/${pathSegment(auth.username)}/cashouts`, this.baseUrl); + const url = new URL( + `accounts/${pathSegment(auth.username)}/cashouts`, + this.baseUrl, + ); addPaginationParams(url, pagination); const resp = await this.httpLib.fetch(url.href, { method: "GET", @@ -1156,7 +1177,10 @@ export class TalerCoreBankHttpClient { cid: number, body: ConversionRateClassInput, ) { - const url = new URL(`conversion-rate-classes/${pathSegment(cid)}`, this.baseUrl); + const url = new URL( + `conversion-rate-classes/${pathSegment(cid)}`, + this.baseUrl, + ); const resp = await this.httpLib.fetch(url.href, { method: "PATCH", headers: { @@ -1197,7 +1221,10 @@ export class TalerCoreBankHttpClient { * */ async deleteConversionRateClass(auth: AccessToken, cid: number) { - const url = new URL(`conversion-rate-classes/${pathSegment(cid)}`, this.baseUrl); + const url = new URL( + `conversion-rate-classes/${pathSegment(cid)}`, + this.baseUrl, + ); const resp = await this.httpLib.fetch(url.href, { method: "DELETE", @@ -1238,7 +1265,10 @@ export class TalerCoreBankHttpClient { * */ async getConversionRateClass(auth: AccessToken, cid: number) { - const url = new URL(`conversion-rate-classes/${pathSegment(cid)}`, this.baseUrl); + const url = new URL( + `conversion-rate-classes/${pathSegment(cid)}`, + this.baseUrl, + ); const resp = await this.httpLib.fetch(url.href, { method: "GET", headers: { @@ -1307,7 +1337,10 @@ export class TalerCoreBankHttpClient { */ async sendChallenge(username: string, cid: string) { - const url = new URL(`accounts/${pathSegment(username)}/challenge/${pathSegment(cid)}`, this.baseUrl); + const url = new URL( + `accounts/${pathSegment(username)}/challenge/${pathSegment(cid)}`, + this.baseUrl, + ); const resp = await this.httpLib.fetch(url.href, { method: "POST", }); @@ -1453,7 +1486,10 @@ export class TalerCoreBankHttpClient { * */ getWireGatewayAPI(username: string): URL { - return new URL(`accounts/${pathSegment(username)}/taler-wire-gateway/`, this.baseUrl); + return new URL( + `accounts/${pathSegment(username)}/taler-wire-gateway/`, + this.baseUrl, + ); } /** @@ -1461,7 +1497,10 @@ export class TalerCoreBankHttpClient { * */ getRevenueAPI(username: string): URL { - return new URL(`accounts/${pathSegment(username)}/taler-revenue/`, this.baseUrl); + return new URL( + `accounts/${pathSegment(username)}/taler-revenue/`, + this.baseUrl, + ); } /** @@ -1469,7 +1508,10 @@ export class TalerCoreBankHttpClient { * */ getConversionInfoAPIForUser(username: string): URL { - return new URL(`accounts/${pathSegment(username)}/conversion-info/`, this.baseUrl); + return new URL( + `accounts/${pathSegment(username)}/conversion-info/`, + this.baseUrl, + ); } /**