@jphil/bookwhen-client 0.2.0 → 0.2.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.
Files changed (2) hide show
  1. package/README.md +21 -12
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,8 +1,6 @@
1
1
  # `@jphil/bookwhen-client`
2
2
 
3
- \[wip\]!
4
-
5
- An API client library for the [Bookwhen](https://www.bookwhen.com) booking platform [API (v2)](https://api.bookwhen.com/v2), written in Typescript for NodeJS. Intended for server-side environments.
3
+ An API client library for the [Bookwhen](https://www.bookwhen.com) booking platform [API (v2)](https://api.bookwhen.com/v2), written in Typescript for NodeJS. Intended for server-side environments. \[wip\]!
6
4
 
7
5
  ## Table of Contents
8
6
 
@@ -37,13 +35,24 @@ pnpm add @jphil/bookwhen-client
37
35
  !N.B. this usage structure may change as I progress towards a 1.0.0
38
36
 
39
37
  ```typescript
40
- import { createBookwhenClient } from 'bookwhen-client';
38
+ // import the client factory
39
+ import { createBookwhenClient } from '@jphil/bookwhen-client';
40
+
41
+ // create the client (optional debug param to get requests logged to console)
42
+ const client = createBookwhenClient({ apiKey: 'your-API-key'[, debug = true]});
43
+
44
+ // use events Service method to get a single event
45
+ const event = client.events.getById({eventId: 'some-id'});
46
+
47
+ // get all events
48
+ const events = client.events.getMultiple();
41
49
 
42
- const client = createBookwhenClient(YOUR_API_KEY)
43
- const event = client.event.getByID({myEventId});
44
- const events = client.event.getMultiple({
45
- filters: ["filter1", "filter2"]
46
- includes: ["inc1", "inc2"]
50
+ // get all events in 2025
51
+ const events_2025 = client.events.getMultiple({
52
+ filters: [
53
+ from: '20250101',
54
+ to: '20251231'
55
+ ]
47
56
  });
48
57
 
49
58
  ```
@@ -69,9 +78,9 @@ Please see the docs in the CONTRIBUTIONS.md file, thanks!
69
78
 
70
79
  ### Todos
71
80
  - [] put Zod in place in more areas to strengthen runtime type guards
72
- - [] refine error handling
73
- - [] write more integration tests
74
- - [] write services for the other integrations
81
+ - [] flesh out e2e tests
82
+ - [] write services for the other models in the API
83
+ - [] create e2e test github action workflow
75
84
 
76
85
  ## License
77
86
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jphil/bookwhen-client",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "",
5
5
  "private": false,
6
6
  "main": "dist/index.js",