2023-02-08 18:14:57 +02:00
# Tuitio client
2023-02-07 00:32:31 +02:00
## Introduction
2023-02-11 05:06:14 +02:00
Tuitio client is an npm package written in typescript that facilitates the integration of a javascript application with [Tuitio ](https://lab.code-rove.com/gitea/tudor.stanciu/tuitio ).
2023-02-07 00:32:31 +02:00
## Package installation
The package installation can be done in two ways:
2023-02-08 18:14:57 +02:00
- from the command line: `npm install @flare/tuitio-client@1.0.0`
- from the package.json file: `"@flare/tuitio-client": "1.0.0"`
2023-02-07 00:32:31 +02:00
## How to use the package
2023-02-11 15:58:48 +02:00
```javascript!
2023-03-14 21:12:16 +02:00
const { TuitioClient, fetch } = require("@flare/tuitio-client");
2023-02-11 15:58:48 +02:00
const TuitioClient = require("@flare/tuitio-client");
2023-03-18 00:41:42 +02:00
const type { TuitioLoginResponse, TuitioLogoutResponse, TuitioState } = require("@flare/tuitio-client");
2023-02-11 15:58:48 +02:00
```
```javascript!
2023-03-14 21:12:16 +02:00
import { TuitioClient, fetch } from "@flare/tuitio-client";
2023-02-11 15:58:48 +02:00
import TuitioClient from "@flare/tuitio-client";
2023-03-18 00:41:42 +02:00
import type { TuitioLoginResponse, TuitioLogoutResponse, TuitioState } from "@flare/tuitio-client";
2023-02-11 15:58:48 +02:00
```
2023-02-07 00:32:31 +02:00
## Unit testing
2023-02-11 16:01:16 +02:00
Unit testing is done using [Jest ](https://jestjs.io/ ). This is an awesome testing framework created by Facebook.
The files containing tests are identified by the extension `*.test.ts` .
2023-02-07 00:32:31 +02:00
All tests in the package can be executed by running: `npm test` .
## Changelog
2023-02-11 15:58:48 +02:00
1.0.0 - Package initialization
2023-02-11 17:49:04 +02:00
1.0.1 - Export Tuitio types
2023-02-11 22:26:32 +02:00
1.0.2 - Validate that Tuitio's URL parameter is a valid URL
2023-02-12 02:42:30 +02:00
1.0.3 - Added LICENSE file
2023-03-14 21:12:16 +02:00
1.0.4 - TuitioState's token property can be null
2023-03-28 19:20:32 +03:00
1.1.0 - In this version, the account logout method and the latest changes published by Tuitio were implemented.
2023-03-29 20:01:58 +03:00
1.2.0 - Has been implemented the "user-info" method exposed by the Tuitio API.
2023-03-30 19:20:47 +03:00
1.2.1 - Added decodeToken function. The token is obtained directly by the function from local storage. If the token is missing, the function returns null.
2023-04-03 18:16:11 +03:00
1.2.2 - Upgraded @flare/js -utils package.
2023-04-03 18:16:36 +03:00
1.2.3 - Added user group and role types after enriching the "user-info" result.