From 668ffa7302d9f1629848c250904fd269979bb8b0 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Wed, 1 Dec 2021 18:16:40 +0100 Subject: wallet-core: implement exportDb API call --- packages/taler-wallet-core/src/wallet.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'packages/taler-wallet-core/src/wallet.ts') diff --git a/packages/taler-wallet-core/src/wallet.ts b/packages/taler-wallet-core/src/wallet.ts index 7233af3af..04213ddc9 100644 --- a/packages/taler-wallet-core/src/wallet.ts +++ b/packages/taler-wallet-core/src/wallet.ts @@ -123,6 +123,7 @@ import { import { AuditorTrustRecord, CoinSourceType, + exportDb, ReserveRecordStatus, WalletStoresV1, } from "./db.js"; @@ -183,6 +184,7 @@ import { readSuccessResponseJsonOrThrow, } from "./util/http.js"; import { getMerchantInfo } from "./operations/merchants.js"; +import { Event, IDBDatabase } from "@gnu-taler/idb-bridge"; const builtinAuditors: AuditorTrustRecord[] = [ { @@ -953,6 +955,10 @@ async function dispatchRequestInternal( logger.info(`started fakebank withdrawal: ${j2s(fbResp)}`); return {}; } + case "exportDb": { + const dbDump = await exportDb(ws.db.idbHandle()); + return dbDump; + } } throw OperationFailedError.fromCode( TalerErrorCode.WALLET_CORE_API_OPERATION_UNKNOWN, @@ -997,7 +1003,7 @@ export async function handleCoreApiRequest( try { logger.error("Caught unexpected exception:"); logger.error(e.stack); - } catch (e) { } + } catch (e) {} return { type: "error", operation, -- cgit v1.2.3