tuitio-client/README.md

45 lines
1.8 KiB
Markdown
Raw Normal View History

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!
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!
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
1.0.3 - Added LICENSE file
1.0.4 - TuitioState's token property can be null
1.1.0 - In this version, the account logout method and the latest changes published by Tuitio were implemented.
1.2.0 - Has been implemented the "user-info" method exposed by the Tuitio API.
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-03-30 19:27:56 +03:00
1.2.2 - Upgraded @flare/js-utils package.