cli MVP
This commit is contained in:
parent
367c19386c
commit
1ea50c50bc
62 changed files with 9982 additions and 608 deletions
196
packaging/dbus/net.catcrafts.Nostro1.xml
Normal file
196
packaging/dbus/net.catcrafts.Nostro1.xml
Normal file
|
|
@ -0,0 +1,196 @@
|
|||
<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
|
||||
"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
|
||||
<!-- SPDX-License-Identifier: LGPL-3.0-only -->
|
||||
<!-- SPDX-FileCopyrightText: Copyright (C) 2026 Catcrafts® -->
|
||||
<!-- nostrod's interface: net.catcrafts.Nostro1 on the system bus, at /net/catcrafts/Nostro1. Generate a proxy from
|
||||
this file (gdbus-codegen, qdbusxml2cpp, zbus-xmlgen); C++ programs can use Nostro::Client instead. A test in nostro
|
||||
keeps this file the interface nostrod serves.
|
||||
|
||||
Every call is answered for the calling user only, and authorised with polkit first
|
||||
(packaging/system/net.catcrafts.Nostro1.policy): allow interactive authorization on your calls, so the user can be
|
||||
asked for their password, and give them a timeout of minutes. Every reply ends with `notes`, the warnings the
|
||||
library gave during the call, to show the user.
|
||||
|
||||
Conventions:
|
||||
account an account's name or IBAN
|
||||
to, from an IBAN, an e-mail address, or a phone number starting with +
|
||||
amount in the currency's smallest unit (1250 is 12.50), positive; balances and transactions are negative
|
||||
when money goes out
|
||||
currency an ISO code: "EUR"
|
||||
times x: microseconds since 1970-01-01 00:00 UTC
|
||||
optionals an array of zero or one element (ax)
|
||||
|
||||
Types:
|
||||
connectors (Connectors) a(ssssb): name, bank ("bunq"), environment ("production" or "sandbox"),
|
||||
auth ("api key" or "oauth"), whether a call to the bank works now
|
||||
connectors (Accounts) a(ssa(ssssx)): connector name, bank, accounts: name, BIC, IBAN, currency, balance
|
||||
query (Transactions) a{sv}, each key optional: search s, amount x, from x, to x, limit t (100)
|
||||
transactions a(sssssxxss): name, BIC, IBAN, description, currency, amount, time, the bank's
|
||||
id, the bank's kind ("MASTERCARD/PAYMENT")
|
||||
schedule (xaxsusax): start, end, unit (ONCE, HOURLY, DAILY, WEEKLY, MONTHLY, YEARLY),
|
||||
every n units, status (ACTIVE, FINISHED, CANCELLED), next run
|
||||
request (sent) (ts(ss)sxaxsxs): id, status, counterparty (name, IBAN), currency, amount asked,
|
||||
amount paid, description, created, bunq.me link
|
||||
requests (incoming) a(tss(ss)sxsx): id, status, type (INTERNAL, DIRECT_DEBIT, ...), counterparty,
|
||||
currency, amount, description, created
|
||||
scheduled a(t(ss)sxs(xaxsusax)): id, counterparty, currency, amount, description, schedule
|
||||
drafts a(tssa((ss)sxs)s): id, status, created by, entries (counterparty, currency,
|
||||
amount, description), bunq's time of its last change
|
||||
cards / updated (tsssssssss): id, kind, product type, status, order status, name on card,
|
||||
second line, last four digits, expiry, IBAN it pays from
|
||||
account / chosen (ssssx): the account apps' checkouts pay from (net.catcrafts.Nostro1.Checkout),
|
||||
as in Accounts; DefaultCheckoutAccount has none until one is chosen, or once
|
||||
it is gone. An account reached through OAuth cannot pay a shop, and is refused.
|
||||
|
||||
Errors, besides org.freedesktop.DBus.Error.AccessDenied (refused, or polkit did not answer) and
|
||||
org.freedesktop.DBus.Error.InteractiveAuthorizationRequired:
|
||||
net.catcrafts.Nostro1.Error.InvalidArgument refused before anything was sent
|
||||
net.catcrafts.Nostro1.Error.Cancelled the user did not authenticate: nothing was done
|
||||
net.catcrafts.Nostro1.Error.Bank the bank's own refusal
|
||||
net.catcrafts.Nostro1.Error.OAuthCannotPay an OAuth connection may only pay the user's own accounts
|
||||
net.catcrafts.Nostro1.Error.NoCheckoutAccount (checkout) no account is chosen to pay checkouts from
|
||||
net.catcrafts.Nostro1.Error.Failed anything else; a payment that failed this way may have been made -->
|
||||
<node>
|
||||
<interface name="net.catcrafts.Nostro1">
|
||||
<method name="Connectors">
|
||||
<arg type="a(ssssb)" name="connectors" direction="out"/>
|
||||
<arg type="as" name="notes" direction="out"/>
|
||||
</method>
|
||||
<method name="AddBunq">
|
||||
<arg type="s" name="apiKey" direction="in"/>
|
||||
<arg type="s" name="allowedIps" direction="in"/>
|
||||
<arg type="s" name="environment" direction="in"/>
|
||||
<arg type="s" name="name" direction="out"/>
|
||||
<arg type="s" name="addedEnvironment" direction="out"/>
|
||||
<arg type="u" name="accounts" direction="out"/>
|
||||
<arg type="as" name="notes" direction="out"/>
|
||||
</method>
|
||||
<method name="AddBunqOAuth">
|
||||
<arg type="s" name="environment" direction="in"/>
|
||||
<arg type="s" name="clientId" direction="in"/>
|
||||
<arg type="s" name="clientSecret" direction="in"/>
|
||||
<arg type="s" name="redirectUri" direction="in"/>
|
||||
<arg type="s" name="code" direction="in"/>
|
||||
<arg type="s" name="name" direction="out"/>
|
||||
<arg type="s" name="addedEnvironment" direction="out"/>
|
||||
<arg type="u" name="accounts" direction="out"/>
|
||||
<arg type="as" name="notes" direction="out"/>
|
||||
</method>
|
||||
<method name="RemoveConnector">
|
||||
<arg type="s" name="connector" direction="in"/>
|
||||
<arg type="s" name="name" direction="out"/>
|
||||
<arg type="as" name="notes" direction="out"/>
|
||||
</method>
|
||||
<method name="Accounts">
|
||||
<arg type="a(ssa(ssssx))" name="connectors" direction="out"/>
|
||||
<arg type="as" name="notes" direction="out"/>
|
||||
</method>
|
||||
<method name="Transactions">
|
||||
<arg type="s" name="account" direction="in"/>
|
||||
<arg type="a{sv}" name="query" direction="in"/>
|
||||
<arg type="a(sssssxxss)" name="transactions" direction="out"/>
|
||||
<arg type="as" name="notes" direction="out"/>
|
||||
</method>
|
||||
<method name="Send">
|
||||
<arg type="s" name="account" direction="in"/>
|
||||
<arg type="s" name="to" direction="in"/>
|
||||
<arg type="s" name="name" direction="in"/>
|
||||
<arg type="x" name="amount" direction="in"/>
|
||||
<arg type="s" name="description" direction="in"/>
|
||||
<arg type="t" name="id" direction="out"/>
|
||||
<arg type="s" name="currency" direction="out"/>
|
||||
<arg type="as" name="notes" direction="out"/>
|
||||
</method>
|
||||
<method name="Schedule">
|
||||
<arg type="s" name="account" direction="in"/>
|
||||
<arg type="s" name="to" direction="in"/>
|
||||
<arg type="s" name="name" direction="in"/>
|
||||
<arg type="x" name="amount" direction="in"/>
|
||||
<arg type="s" name="description" direction="in"/>
|
||||
<arg type="(xaxsusax)" name="schedule" direction="in"/>
|
||||
<arg type="t" name="id" direction="out"/>
|
||||
<arg type="s" name="currency" direction="out"/>
|
||||
<arg type="as" name="notes" direction="out"/>
|
||||
</method>
|
||||
<method name="Request">
|
||||
<arg type="s" name="account" direction="in"/>
|
||||
<arg type="s" name="from" direction="in"/>
|
||||
<arg type="s" name="name" direction="in"/>
|
||||
<arg type="x" name="amount" direction="in"/>
|
||||
<arg type="s" name="description" direction="in"/>
|
||||
<arg type="(ts(ss)sxaxsxs)" name="request" direction="out"/>
|
||||
<arg type="as" name="notes" direction="out"/>
|
||||
</method>
|
||||
<method name="Requests">
|
||||
<arg type="s" name="account" direction="in"/>
|
||||
<arg type="a(ts(ss)sxaxsxs)" name="requests" direction="out"/>
|
||||
<arg type="as" name="notes" direction="out"/>
|
||||
</method>
|
||||
<method name="RevokeRequest">
|
||||
<arg type="s" name="account" direction="in"/>
|
||||
<arg type="t" name="id" direction="in"/>
|
||||
<arg type="as" name="notes" direction="out"/>
|
||||
</method>
|
||||
<method name="IncomingRequests">
|
||||
<arg type="s" name="account" direction="in"/>
|
||||
<arg type="a(tss(ss)sxsx)" name="requests" direction="out"/>
|
||||
<arg type="as" name="notes" direction="out"/>
|
||||
</method>
|
||||
<method name="RespondToRequest">
|
||||
<arg type="s" name="account" direction="in"/>
|
||||
<arg type="t" name="id" direction="in"/>
|
||||
<arg type="b" name="accept" direction="in"/>
|
||||
<arg type="as" name="notes" direction="out"/>
|
||||
</method>
|
||||
<method name="ScheduledPayments">
|
||||
<arg type="s" name="account" direction="in"/>
|
||||
<arg type="a(t(ss)sxs(xaxsusax))" name="scheduled" direction="out"/>
|
||||
<arg type="as" name="notes" direction="out"/>
|
||||
</method>
|
||||
<method name="CancelScheduledPayment">
|
||||
<arg type="s" name="account" direction="in"/>
|
||||
<arg type="t" name="id" direction="in"/>
|
||||
<arg type="as" name="notes" direction="out"/>
|
||||
</method>
|
||||
<method name="Draft">
|
||||
<arg type="s" name="account" direction="in"/>
|
||||
<arg type="s" name="to" direction="in"/>
|
||||
<arg type="s" name="name" direction="in"/>
|
||||
<arg type="x" name="amount" direction="in"/>
|
||||
<arg type="s" name="description" direction="in"/>
|
||||
<arg type="t" name="id" direction="out"/>
|
||||
<arg type="s" name="currency" direction="out"/>
|
||||
<arg type="as" name="notes" direction="out"/>
|
||||
</method>
|
||||
<method name="DraftPayments">
|
||||
<arg type="s" name="account" direction="in"/>
|
||||
<arg type="a(tssa((ss)sxs)s)" name="drafts" direction="out"/>
|
||||
<arg type="as" name="notes" direction="out"/>
|
||||
</method>
|
||||
<method name="RespondToDraftPayment">
|
||||
<arg type="s" name="account" direction="in"/>
|
||||
<arg type="t" name="id" direction="in"/>
|
||||
<arg type="b" name="accept" direction="in"/>
|
||||
<arg type="as" name="notes" direction="out"/>
|
||||
</method>
|
||||
<method name="Cards">
|
||||
<arg type="a(ssa(tsssssssss))" name="connectors" direction="out"/>
|
||||
<arg type="as" name="notes" direction="out"/>
|
||||
</method>
|
||||
<method name="SetCardStatus">
|
||||
<arg type="t" name="card" direction="in"/>
|
||||
<arg type="s" name="status" direction="in"/>
|
||||
<arg type="(tsssssssss)" name="updated" direction="out"/>
|
||||
<arg type="as" name="notes" direction="out"/>
|
||||
</method>
|
||||
<method name="DefaultCheckoutAccount">
|
||||
<arg type="a(ssssx)" name="account" direction="out"/>
|
||||
<arg type="as" name="notes" direction="out"/>
|
||||
</method>
|
||||
<method name="SetDefaultCheckoutAccount">
|
||||
<arg type="s" name="account" direction="in"/>
|
||||
<arg type="(ssssx)" name="chosen" direction="out"/>
|
||||
<arg type="as" name="notes" direction="out"/>
|
||||
</method>
|
||||
</interface>
|
||||
</node>
|
||||
Loading…
Reference in a new issue