klara-js
TypeScript icon, indicating that this package has built-in type declarations

0.0.5 • Public • Published

klara-js

Retrieve and manage your ePost/klara snail mail with ease.


Build, Lint and Test Status GitHub issues GitHub pull requests License codecov


⚠️ This project is still in development and not ready for production use. ⚠️
Can't wait to use it? Feel free to contribute.

📝 Table of Contents

🧐 About

klara-js allows you to easily fetch physical snail mail from your ePost/Klara account. Additionally, you can also manage your snail mail by creating, updating and deleting it.

⚠️ Disclaimer

This project is not affiliated with Swiss Post or Klara in any way. It is an unofficial API wrapper for the Klara API. Use at your own risk. We are not responsible for any damage caused by the use of this library.

🏁 Features

  • Search
  • Fetch
  • Download
  • Create

🏁 Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

Prerequisites

Please make sure you have installed the following tools:

  • Node.js - JavaScript runtime environment
  • TypeScript - Typescript compiler
  • A epost.ch account whose address is verified and has enabled Scanning Services.

And a package manager of your choice:

  • npm - Node.js package manager
  • yarn - Node.js package manager

Installing

Install the package via npm:

npm install klara-js --save

or via yarn:

yarn add klara-js

🎈 Usage

Basic usage

import Klara from 'klara-js';

// Create a new instance
const klara = new Klara('username', 'password');

// Fetch tenants (optional, defaults to first tenant)
const tenants = await klara.user.tenants();
klara.use(tenants[0]);

// Login
await klara.login();

// Fetch all letters
await klara.letterbox.find();

// Fetch a specific letter
await klara.letterbox.findOne("letter-id");

// Remove a letter
await klara.letterbox.delete("letter-id");

// Download a letter
await klara.letterbox.download("letter-id", "./letter.pdf");

📜 License

In the vast realm of code, where ideas intertwine and innovation knows no bounds, I find myself continually amazed by the unwavering spirit of collaboration that defines the open source community. It's a world where developers, like you and me, share their creations, their insights, and their expertise with an unparalleled generosity. Countless times, whether through serendipitous discovery or through meticulous research, I've stumbled upon remarkable projects that have enriched my own journey as a developer.

Recognizing the profound impact that the open source community has had on my own growth, I've made a personal commitment to give back to this tapestry of ingenuity. The code is licensed under the APGL license, which means that you're free to use, remix, and build upon it. It's my way of extending the thread of collaboration that binds us as developers.

However, I also understand the diverse needs that drive us in this community. If you're considering utilizing this project for commercial purposes in which copyleft is no option, I invite you to reach out. While there isn't a fixed license model in place, I believe in the power of optimism and negotiation. Let's work together to find a solution that aligns with your goals while respecting the effort and intent behind this work.

🔧 Running the tests

Tests are written with jest. You can run them with the following command:

npm run test

⛏️ Built Using

✍️ Authors

Package Sidebar

Install

npm i klara-js

Weekly Downloads

2

Version

0.0.5

License

MIT

Unpacked Size

123 kB

Total Files

72

Last publish

Collaborators

  • sjutz