aboutsummaryrefslogtreecommitdiff
path: root/packages/taler-wallet-cli/src/index.ts
diff options
context:
space:
mode:
authorFlorian Dold <florian@dold.me>2023-09-01 10:52:15 +0200
committerFlorian Dold <florian@dold.me>2023-09-01 10:52:15 +0200
commit64e78d03a117fffeb18e18154d9028a2532285a5 (patch)
tree116d1c79b9419f114b6b5f42ce0c8eeb6e88c928 /packages/taler-wallet-cli/src/index.ts
parent79973a63dd31c0d84b677a2a1511b1dffc6218b8 (diff)
downloadwallet-core-64e78d03a117fffeb18e18154d9028a2532285a5.tar.xz
wallet-core: implement and test stored backups
Diffstat (limited to 'packages/taler-wallet-cli/src/index.ts')
-rw-r--r--packages/taler-wallet-cli/src/index.ts42
1 files changed, 41 insertions, 1 deletions
diff --git a/packages/taler-wallet-cli/src/index.ts b/packages/taler-wallet-cli/src/index.ts
index 36e7f7768..a0f44fb41 100644
--- a/packages/taler-wallet-cli/src/index.ts
+++ b/packages/taler-wallet-cli/src/index.ts
@@ -883,7 +883,7 @@ backupCli.subcommand("exportDb", "export-db").action(async (args) => {
});
});
-backupCli.subcommand("storeBackup", "store-backup").action(async (args) => {
+backupCli.subcommand("storeBackup", "store").action(async (args) => {
await withWallet(args, async (wallet) => {
const resp = await wallet.client.call(
WalletApiOperation.CreateStoredBackup,
@@ -893,6 +893,46 @@ backupCli.subcommand("storeBackup", "store-backup").action(async (args) => {
});
});
+backupCli.subcommand("storeBackup", "list-stored").action(async (args) => {
+ await withWallet(args, async (wallet) => {
+ const resp = await wallet.client.call(
+ WalletApiOperation.ListStoredBackups,
+ {},
+ );
+ console.log(JSON.stringify(resp, undefined, 2));
+ });
+});
+
+backupCli
+ .subcommand("storeBackup", "delete-stored")
+ .requiredArgument("name", clk.STRING)
+ .action(async (args) => {
+ await withWallet(args, async (wallet) => {
+ const resp = await wallet.client.call(
+ WalletApiOperation.DeleteStoredBackup,
+ {
+ name: args.storeBackup.name,
+ },
+ );
+ console.log(JSON.stringify(resp, undefined, 2));
+ });
+ });
+
+backupCli
+ .subcommand("recoverBackup", "recover-stored")
+ .requiredArgument("name", clk.STRING)
+ .action(async (args) => {
+ await withWallet(args, async (wallet) => {
+ const resp = await wallet.client.call(
+ WalletApiOperation.RecoverStoredBackup,
+ {
+ name: args.recoverBackup.name,
+ },
+ );
+ console.log(JSON.stringify(resp, undefined, 2));
+ });
+ });
+
backupCli.subcommand("importDb", "import-db").action(async (args) => {
await withWallet(args, async (wallet) => {
const dumpRaw = await read(process.stdin);