This package provides a simple interface for collecting transactions from a bank account using the Fio API. It can work with data in the "YYYY-MM-DD" format or Date instances. It also allows you to add custom columns and map their values using functions.
To install the package, use the following command:
yarn add @randajan/fio-api
import Fio from "@randajan/fio-api";
// Create an instance of Fio for the bank account with the given token
const fio = Fio.create("Your-account-ID", "Your-Fio-api-token");
// Get the latest transactions on the account
fio.paysLast((fio, pay) => {
console.log("Transaction no.", index + 1);
console.log("Date:", pay("Datum"));
console.log("Amount:", pay("Objem"));
console.log("Account number:", pay("Protiúčet"));
// ... other transaction details ...
});
// Get transactions in a specific period
const fromDate = "2023-01-01";
const toDate = "2023-07-25";
fio.paysByPeriod(fromDate, toDate, (fio, pay) => {
console.log("Transaction no.", index + 1);
console.log("Date:", pay("Datum"));
console.log("Amount:", pay("Objem"));
console.log("Account number:", pay("Protiúčet"));
// ... other transaction details ...
});
Creates an instance of Fio for the bank account with the specified accountId and Fio API token.
Fetches data from the Fio API server for the given path. Returns a list of transactions on the account.
Fetches data from the Fio API server for the given path and performs data mapping using the callback function.
Gets the latest transactions on the account and performs data mapping using the callback function.
Gets transactions in a specific period and performs data mapping using the callback function.
Converts the given date to the "YYYY-MM-DD" format. It can also accept Date instances.
Adds aliases for the column with the given ID or alias.
Adds a custom getter (trait) for mapping the values of the column with the given ID or alias.
Adds an alias for the user. By default it's used at trait
Get an alias for the user.
MIT
By using this package, you agree to the licensing terms.