@gewis/planka-client 2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,65 @@
1
+ # ๐Ÿš€ Planka Client
2
+ ![npm version](https://img.shields.io/npm/v/@gewis/planka-client) ![License](https://img.shields.io/github/license/GEWIS/planka-client) ![Build Status](https://img.shields.io/github/actions/workflow/status/GEWIS/planka-client/lint-and-build.yaml)
3
+
4
+
5
+ A simple client for [Planka](https://github.com/plankanban/planka) generated from its OpenAPI specification using [openapi-ts](https://heyapi.dev/openapi-ts/).
6
+
7
+ See [PlankAPI](https://github.com/gewis/plankapi) for an implementation using this client.
8
+
9
+ ## Installation
10
+
11
+ Add the following dependency to your `package.json`:
12
+
13
+ ```sh
14
+ npm install @gewis/planka-client
15
+ ```
16
+
17
+ or using Yarn:
18
+
19
+ ```sh
20
+ yarn add @gewis/planka-client
21
+ ```
22
+
23
+ ## ๐Ÿ“ฆ Usage
24
+
25
+ Import the desired service and call the required endpoint. Check out [Heyapi](https://heyapi.dev/openapi-ts/clients/fetch.html#fetch-api) for more details.
26
+
27
+ ```typescript
28
+ import { client, authorize } from '@gewis/planka-client';
29
+
30
+ client.setConfig({
31
+ baseUrl: 'https://example.com',
32
+ });
33
+
34
+ /** Fetch access token with `authorize` or `authorizeOidc` */
35
+ const accessToken = authorize(...);
36
+
37
+ client.setConfig({
38
+ baseUrl: 'https://example.com',
39
+ headers: {
40
+ Authorization: `Bearer ${accessToken}`
41
+ }
42
+ });
43
+ ```
44
+
45
+ ## ๐Ÿงช Testing
46
+
47
+ 1. Start Planka with:
48
+
49
+ ```sh
50
+ docker compose up -d
51
+ ```
52
+
53
+ 2. Run tests:
54
+
55
+ ```sh
56
+ yarn test
57
+ ```
58
+
59
+ ## ๐Ÿ“„ License
60
+
61
+ This project is licensed under the GNU General Public License v3.0 - see the [LICENSE](LICENSE) file for details.
62
+
63
+ ## ๐ŸŒŸ Contributing
64
+
65
+ Contributions are welcome! Feel free to open issues or submit pull requests.