@sermas/api-client 1.0.0-alpha.16 → 1.0.0-alpha.17

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.
Files changed (2) hide show
  1. package/README.md +40 -0
  2. package/package.json +2 -2
package/README.md ADDED
@@ -0,0 +1,40 @@
1
+ # Sermas typescript API client
2
+
3
+ ## Installation
4
+
5
+ ```sh
6
+ npm i -s @sermas/api-client
7
+ ```
8
+
9
+ ## Usage
10
+
11
+ ```ts
12
+ import {createSermasClient} from '@sermas/api-client'
13
+
14
+
15
+ const main = async () => {
16
+
17
+ const client = await createSermasClient({
18
+ appId: 'my-app',
19
+ access_token: '<token>',
20
+ refresh_token: '<token>',
21
+ domain: 'http://localhost:8080',
22
+ })
23
+
24
+ const res = await client.api.authentication.whoami()
25
+
26
+ console.log(`Hello from ${res.preferred_username}`)
27
+
28
+ }
29
+
30
+ main().catch(e => console.error(e))
31
+ ```
32
+
33
+
34
+ ## Development
35
+
36
+ Set the `API_URL` env and run
37
+
38
+ ```sh
39
+ make generate
40
+ ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sermas/api-client",
3
- "version": "1.0.0-alpha.16",
3
+ "version": "1.0.0-alpha.17",
4
4
  "description": "Sermas API client",
5
5
  "type": "module",
6
6
  "main": "./index.cjs",
@@ -21,7 +21,7 @@
21
21
  "scripts": {
22
22
  "dev": "NODE_NO_WARNINGS=1 NODE_TLS_REJECT_UNAUTHORIZED=0 nodemon -w ./src/index.ts",
23
23
  "clean": "rm -rf ./dist",
24
- "build": "npm run clean && tsup ./src && cp package.json ./dist",
24
+ "build": "npm run clean && tsup ./src && cp ./package.json ./README.md ./dist",
25
25
  "build:watch": "npm run clean && tsup --watch",
26
26
  "test": "jest",
27
27
  "generate:openapi": "rm -rf ./src/libs/openapi && openapi --useUnionTypes --input ./openapi.json --output ./src/libs/openapi --name SermasApi --client axios && node --loader ts-node/esm ./src/openapi-generator.ts",