kitsas-library

Kitsas Library

Library to connect Kitsas Server. See also template to Kitsas addon.

This typedoc documentation is available at GitHub pages

npm install kitsas-library
Component Usage
KitsasService Static class to connect server
KitsasConnectionInterface General operations
KitsasOfficeInterface Accounting office, bookshelves and roles
KitsasBookInterface Accounting interface

First create a connection with KitsasService.

import { KitsasService } from 'kitsaslibrary';

const connection = await KitsasService.connect({
username: 'name@kitsas.fi',
password: 'secret',
});
const books = await connection.getBooks();
const book = await connection.getBook('92e71a5d-1c33-4cc9-aa83-281c05c8e4c2');
const document : CreateVoucherDto = { ... } ;
await book.saveVoucher(document, []);
const connection = await KitsasService.connect({
username: 'test@kitsas.fi',
password: 'Test+12345',
mock: true,
});