diff options
Diffstat (limited to 'packages/taler-harness/src/index.ts')
-rw-r--r-- | packages/taler-harness/src/index.ts | 45 |
1 files changed, 41 insertions, 4 deletions
diff --git a/packages/taler-harness/src/index.ts b/packages/taler-harness/src/index.ts index ec99232f5..841e17dc7 100644 --- a/packages/taler-harness/src/index.ts +++ b/packages/taler-harness/src/index.ts @@ -170,6 +170,39 @@ const sandcastleCli = testingCli.subcommand("sandcastleArgs", "sandcastle", { help: "Subcommands for handling GNU Taler sandcastle deployments.", }); +const configCli = testingCli.subcommand("configArgs", "config", { + help: "Subcommands for handling the Taler configuration.", +}); + +configCli.subcommand("show", "show").action(async (args) => { + const config = Configuration.load(); + const cfgStr = config.stringify({ + diagnostics: true, + }); + console.log(cfgStr); +}); + +configCli + .subcommand("get", "get") + .requiredArgument("section", clk.STRING) + .requiredArgument("option", clk.STRING) + .flag("file", ["-f"]) + .action(async (args) => { + const config = Configuration.load(); + let res; + if (args.get.file) { + res = config.getString(args.get.section, args.get.option); + } else { + res = config.getPath(args.get.section, args.get.option); + } + if (res.isDefined()) { + console.log(res.value); + } else { + console.warn("not found"); + process.exit(1); + } + }); + const deploymentCli = testingCli.subcommand("deploymentArgs", "deployment", { help: "Subcommands for handling GNU Taler deployments.", }); @@ -208,8 +241,10 @@ deploymentCli const bankAccessApiClient = new BankAccessApiClient({ baseUrl: args.tipTopup.bankAccessUrl, - username: args.tipTopup.bankAccount, - password: args.tipTopup.bankPassword, + auth: { + username: args.tipTopup.bankAccount, + password: args.tipTopup.bankPassword, + }, allowHttp: true, }); @@ -219,10 +254,12 @@ deploymentCli console.log("payto URI:", paytoUri); - const transactions = await bankAccessApiClient.getTransactions(); + const transactions = await bankAccessApiClient.getTransactions( + args.tipTopup.bankAccount, + ); console.log("transactions:", j2s(transactions)); - await bankAccessApiClient.createTransaction({ + await bankAccessApiClient.createTransaction(args.tipTopup.bankAccount, { amount, paytoUri, }); |