@jphil/bookwhen-client 0.1.0 → 0.1.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 +7 -7
- package/dist/client/BookwhenClient.js +1 -1
- package/dist/client/BookwhenClient.js.map +1 -1
- package/dist/index.js +0 -2
- package/dist/index.js.map +1 -1
- package/dist/index.test.js +0 -5
- package/dist/index.test.js.map +1 -1
- package/package.json +6 -4
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
\[wip\]!
|
|
4
4
|
|
|
5
|
-
An API client library for the [Bookwhen](www.bookwhen.com) booking platform [API (v2)](https://api.bookwhen.com/v2), written in Typescript for NodeJS. Intended for server-side environments.
|
|
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.
|
|
6
6
|
|
|
7
7
|
## Table of Contents
|
|
8
8
|
|
|
@@ -17,7 +17,7 @@ An API client library for the [Bookwhen](www.bookwhen.com) booking platform [API
|
|
|
17
17
|
|
|
18
18
|
## Overview
|
|
19
19
|
|
|
20
|
-
You'll likely be at least somewhat familiar with the [Bookwhen](www.bookwhen.com) booking platform if you've landed here. But if not, you'll want to have a look at their [API (v2) documentation](https://api.bookwhen.com/v2). There's also a nice [Swagger style layout of the Bookwhen API v2 docs](https://petstore.swagger.io/?url=https://api.bookwhen.com/v2/openapi.yaml)
|
|
20
|
+
You'll likely be at least somewhat familiar with the [Bookwhen](https://www.bookwhen.com) booking platform if you've landed here. But if not, you'll want to have a look at their [API (v2) documentation](https://api.bookwhen.com/v2). There's also a nice [Swagger style layout of the Bookwhen API v2 docs](https://petstore.swagger.io/?url=https://api.bookwhen.com/v2/openapi.yaml)
|
|
21
21
|
|
|
22
22
|
## Features
|
|
23
23
|
|
|
@@ -67,11 +67,11 @@ Please see the docs in the CONTRIBUTIONS.md file, thanks!
|
|
|
67
67
|
- Keep up with any future changes or additions to the [Bookwhen API](https://api.bookwhen.com/v2), additions will be driven mainly by this.
|
|
68
68
|
- Possibly add a "fields" param to service methods to allow response filtering
|
|
69
69
|
|
|
70
|
-
|
|
71
|
-
[]
|
|
72
|
-
[]
|
|
73
|
-
[]
|
|
74
|
-
[]
|
|
70
|
+
### Todos
|
|
71
|
+
- [] 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
|
|
75
75
|
|
|
76
76
|
## License
|
|
77
77
|
|
|
@@ -45,7 +45,7 @@ export class BookwhenClient {
|
|
|
45
45
|
export function createBookwhenClient(options) {
|
|
46
46
|
const { apiKey, baseURL = 'https://api.bookwhen.com/v2' } = options;
|
|
47
47
|
const axiosInstance = axios.create({
|
|
48
|
-
baseURL:
|
|
48
|
+
baseURL: baseURL,
|
|
49
49
|
auth: { username: apiKey, password: '' },
|
|
50
50
|
});
|
|
51
51
|
axiosInstance.interceptors.response.use((response) => response.data ?? response, (error) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BookwhenClient.js","sourceRoot":"","sources":["../../src/client/BookwhenClient.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC,CAAE,mDAAmD;AAC/G,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AAEzE;;;;GAIG;AACH,MAAM,OAAO,cAAc;IAQL;IAPZ,YAAY,CAAgB;IAEpC;;;;OAIG;IACH,YAAoB,aAA4B;QAA5B,kBAAa,GAAb,aAAa,CAAe;QAC9C,IAAI,CAAC,aAAa,EAAE,CAAC;YACnB,MAAM,IAAI,KAAK,CAAC,qDAAqD,CAAC,CAAC;QACzE,CAAC;IACH,CAAC;IAED;;;;;;;;OAQG;IACH,IAAI,MAAM;QACR,IAAI,CA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,CAAC,CAAC;IAEH,aAAa,CAAC,YAAY,CAAC,QAAQ,CAAC,GAAG,CACrC,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,IAAI,QAAQ,EACvC,CAAC,KAAK,EAAE,EAAE;QACR,IAAI,KAAK,CAAC,QAAQ,EAAE,CAAC;YACnB,MAAM,MAAM,GAAG,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC;YACrC,MAAM,WAAW,GAAG,wBAAwB,CAAC,MAAM,CAAC,CAAC;YACrD,IAAI,WAAW,EAAE,CAAC;gBAChB,OAAO,OAAO,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC;YACxD,CAAC;QACH,CAAC;aAAM,IAAI,KAAK,CAAC,OAAO,EAAE,CAAC;YACzB,MAAM,IAAI,KAAK,CAAC,sCAAsC,CAAC,CAAC;QAC1D,CAAC;aAAM,CAAC;YACN,MAAM,IAAI,KAAK,CAAC,0CAA0C,CAAC,CAAC;QAC9D,CAAC;QACD,OAAO,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IAC/B,CAAC,CACF,CAAC;IAEF,OAAO,IAAI,cAAc,CAAC,aAAa,CAAC,CAAC;AAC3C,CAAC"}
|
package/dist/index.js
CHANGED
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,qCAAqC,CAAC;AAEpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC"}
|
package/dist/index.test.js
CHANGED
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
import { describe, it, expect } from 'vitest';
|
|
2
|
-
import * as dotenv from 'dotenv';
|
|
3
2
|
import { createBookwhenClient } from './index.js';
|
|
4
|
-
dotenv.config();
|
|
5
3
|
describe('index.ts', () => {
|
|
6
|
-
it('should load environment variables', () => {
|
|
7
|
-
expect(process.env).toHaveProperty('NODE_ENV');
|
|
8
|
-
});
|
|
9
4
|
it('should export BookwhenClient', () => {
|
|
10
5
|
expect(createBookwhenClient).toBeDefined();
|
|
11
6
|
});
|
package/dist/index.test.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.test.js","sourceRoot":"","sources":["../src/index.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,
|
|
1
|
+
{"version":3,"file":"index.test.js","sourceRoot":"","sources":["../src/index.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAElD,QAAQ,CAAC,UAAU,EAAE,GAAG,EAAE;IACtB,EAAE,CAAC,8BAA8B,EAAE,GAAG,EAAE;QACpC,MAAM,CAAC,oBAAoB,CAAC,CAAC,WAAW,EAAE,CAAC;IAC/C,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jphil/bookwhen-client",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"private": false,
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -37,7 +37,6 @@
|
|
|
37
37
|
"@typescript-eslint/eslint-plugin": "^8.13.0",
|
|
38
38
|
"@typescript-eslint/parser": "^8.13.0",
|
|
39
39
|
"@vitest/coverage-v8": "2.1.3",
|
|
40
|
-
"axios": "^1.7.7",
|
|
41
40
|
"c8": "^10.1.2",
|
|
42
41
|
"commitizen": "^4.3.1",
|
|
43
42
|
"cz-conventional-changelog": "^3.3.0",
|
|
@@ -51,14 +50,17 @@
|
|
|
51
50
|
"typescript": "^5.6.3",
|
|
52
51
|
"vite": "^5.4.10",
|
|
53
52
|
"vite-tsconfig-paths": "^5.1.0",
|
|
54
|
-
"vitest": "^2.1.3"
|
|
55
|
-
"zod": "^3.23.8"
|
|
53
|
+
"vitest": "^2.1.3"
|
|
56
54
|
},
|
|
57
55
|
"config": {
|
|
58
56
|
"commitizen": {
|
|
59
57
|
"path": "./node_modules/cz-conventional-changelog"
|
|
60
58
|
}
|
|
61
59
|
},
|
|
60
|
+
"dependencies": {
|
|
61
|
+
"axios": "^1.7.7",
|
|
62
|
+
"zod": "^3.23.8"
|
|
63
|
+
},
|
|
62
64
|
"scripts": {
|
|
63
65
|
"dev": "vitest",
|
|
64
66
|
"build": "tsc",
|