@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/LICENSE.txt +674 -0
- package/README.md +65 -0
- package/dist/planka-client.d.ts +1406 -0
- package/dist/planka-client.js +470 -0
- package/dist/planka-client.umd.cjs +1 -0
- package/package.json +69 -0
- package/src/index.ts +2 -0
- package/src/services.ts +951 -0
- package/src/types.ts +1042 -0
package/README.md
ADDED
@@ -0,0 +1,65 @@
|
|
1
|
+
# ๐ Planka Client
|
2
|
+
  
|
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.
|