laboral-kutxa
TypeScript icon, indicating that this package has built-in type declarations

1.1.0 • Public • Published

laboral-kutxa.js

Tests Coverage Status Documentation npm version

Unofficial Laboral Kutxa JS library

Install

npm install laboral-kutxa

Library Usage

Reading through the misProductos list:

import { login, getMyProducts } from "laboral-kutxa";

const main = async () => {
  const { USERNAME, PASSWORD } = process.env;
  const { token } = await login(USERNAME, PASSWORD);
  const products = await getMyProducts(token);
  products.misProductos.map(({ alias, grupo }) => ({ alias, grupo }));
};

Output:

[
  { alias: "CUENTA 0,0", grupo: "cuentasCorrientes" },
  { alias: "VISA ELECTRÓN", grupo: "tarjetas" },
  { alias: "PRESTAMO", grupo: "prestamos" },
];

Accessing the aggregated amounts per account types:

const products = await getMyProducts(token);
const { _CuentasCorrientes: currentAccount, _Financiacion: financing } =
  products._Importes;
console.log({ currentAccount, financing });

Output:

{
  currentAccount: { cantidad: 1234.56, moneda: 'EUR' },
  financing: { cantidad: 123456.78, moneda: 'EUR' }
}

CLI Usage

It's also possible to consume the CLI directly to access the account.

npx laboral-kutxa --balance

Readme

Keywords

none

Package Sidebar

Install

npm i laboral-kutxa

Weekly Downloads

3

Version

1.1.0

License

MIT

Unpacked Size

17.3 kB

Total Files

8

Last publish

Collaborators

  • andre.miras