0.2.2 • Published 7 months ago

strava-cz-sdk v0.2.2

Weekly downloads
-
License
MIT
Repository
-
Last release
7 months ago

strava-cz-sdk

Node.js API wrapper for strava.cz. This library uses the new JSON API of strava.cz.

This package is not affiliated with strava.cz in any way.

Installation

To install the package, run:

npm install strava-cz-sdk

Usage

Using auth credentials

First we need to login to strava.cz with our username, password and we need our canteeen number. You can find your canteen number on strava.cz website.

import { login } from 'strava-cz-sdk';

// login to strava.cz
const stravaAuth = await login({
    username: 'username',
    password: 'password',
    canteenNumber: 'canteenNumber'
}); // returns AuthStore object 

After we are logged in, we can use the stravaAuth object to get our orders.

import { login, getOrders } from 'strava-cz-sdk';

const stravaAuth = await login({
    username: 'username',
    password: 'password',
    canteenNumber: 'canteenNumber'
});

const orders = await getOrders(stravaAuth); // returns array of orders

To get the dispense information, we need to use the getDispense function.

import { login, getDispense } from 'strava-cz-sdk';

const stravaAuth = await login({
    username: 'username',
    password: 'password',
    canteenNumber: 'canteenNumber'
});

const dispense = await getDispense(stravaAuth); // returns dispense object

To get payment information, we need to use the getPayments function.

import { login, getPayments } from 'strava-cz-sdk';

const stravaAuth = await login({
    username: 'username',
    password: 'password',
    canteenNumber: 'canteenNumber'
});

const payments = await getPayments(stravaAuth); // returns array of payments

To get the canteen information, we need to use the getCanteenInfo function.

import { login, getCanteenInfo } from 'strava-cz-sdk';

const stravaAuth = await login({
    username: 'username',
    password: 'password',
    canteenNumber: 'canteenNumber'
});

const canteenInfo = await getCanteenInfo(stravaAuth); // returns canteen info object

Without auth credentials

If you want to get the public information about the canteen, you can use the getPublicCanteenInfo function.

import { getPublicCanteenInfo } from 'strava-cz-sdk';

const canteenInfo = await getPublicCanteenInfo('canteenNumber'); // returns canteen info object

To get the public canteen menu, you can use the getPublicMenu function.

import { getPublicMenu } from 'strava-cz-sdk';

const menu = await getPublicMenu('canteenNumber'); // returns array of menu items

License

This project is licensed under the MIT License - see the LICENSE file for details.

Contributing

Feel free to contribute to this project. Just create a pull request and I will review it as soon as possible.

0.2.2

7 months ago

0.2.1

7 months ago

0.2.0

7 months ago

0.1.1

7 months ago

0.1.0

7 months ago