@jphil/bookwhen-client 0.0.2 → 0.0.8
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 +7 -0
- package/README.md +122 -0
- package/dist/index.d.ts +1 -3
- package/dist/index.js +3 -6
- package/dist/index.js.map +1 -0
- package/dist/index.test.d.ts +1 -0
- package/dist/index.test.js +7 -0
- package/dist/index.test.js.map +1 -0
- package/package.json +35 -12
- package/.changeset/README.md +0 -8
- package/.changeset/config.json +0 -11
- package/.eslintrc.json +0 -14
- package/.github/workflows/main.yml +0 -29
- package/.github/workflows/publish.yml +0 -37
- package/.husky/commit-msg +0 -1
- package/.husky/pre-commit +0 -2
- package/.nvmrc +0 -1
- package/.prettierrc.json +0 -5
- package/CHANGELOG.md +0 -7
- package/README +0 -29
- package/commitlint.config.cjs +0 -1
- package/dist/index.cjs +0 -32
- package/dist/index.d.cts +0 -3
- package/eslint.config.js +0 -26
- package/src/index.test.ts +0 -7
- package/src/index.ts +0 -3
- package/tsconfig.json +0 -16
- package/vite.config.ts +0 -5
package/LICENSE
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
ISC License
|
|
2
|
+
|
|
3
|
+
Copyright 2024 Justin Philpott
|
|
4
|
+
|
|
5
|
+
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
|
|
6
|
+
|
|
7
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
# `@jphil/bookwhen-client`
|
|
2
|
+
|
|
3
|
+
\[wip\]!
|
|
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.
|
|
6
|
+
|
|
7
|
+
## Table of Contents
|
|
8
|
+
|
|
9
|
+
- [Overview](#overview)
|
|
10
|
+
- [Features](#features)
|
|
11
|
+
- [Installation](#installation)
|
|
12
|
+
- [Usage](#usage)
|
|
13
|
+
- [Configuration](#configuration)
|
|
14
|
+
- [Contributing](#contributing)
|
|
15
|
+
- [Roadmap](#roadmap)
|
|
16
|
+
- [License](#license)
|
|
17
|
+
|
|
18
|
+
## Overview
|
|
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)
|
|
21
|
+
|
|
22
|
+
## Features
|
|
23
|
+
|
|
24
|
+
- Lightweight and easy to integrate
|
|
25
|
+
- Fully typed for TypeScript support
|
|
26
|
+
|
|
27
|
+
## Installation
|
|
28
|
+
|
|
29
|
+
Install via pnpm:
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
pnpm add @jphil/bookwhen-client
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Usage
|
|
36
|
+
|
|
37
|
+
\[wip\]!
|
|
38
|
+
|
|
39
|
+
```typescript
|
|
40
|
+
// ... todo
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Configuration
|
|
44
|
+
|
|
45
|
+
Required configuration options:
|
|
46
|
+
|
|
47
|
+
- **apiKey**: Your Bookwhen API key (required)
|
|
48
|
+
|
|
49
|
+
API requests to the Bookwhen API are authenticated using Basic Authentication with the API Key as the username and a blank password.
|
|
50
|
+
|
|
51
|
+
API keys can be generated in the [API tokens setup area of your Bookwhen account](https://YOUR-ACCOUNT-NAME.bookwhen.com/settings/api_access_permission_sets).
|
|
52
|
+
|
|
53
|
+
## Contributing
|
|
54
|
+
|
|
55
|
+
### How to Contribute
|
|
56
|
+
|
|
57
|
+
Thank you for your interest in contributing!
|
|
58
|
+
|
|
59
|
+
This library follows the standard Github Flow contribution workflow, have a read of the guide to [Github Flow](https://docs.github.com/en/get-started/using-github/github-flow#following-github-flow) from the Github docs, if you're not familiar.
|
|
60
|
+
|
|
61
|
+
### Contribution Requirements
|
|
62
|
+
|
|
63
|
+
- Use the [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/) style when writing your commit messages.
|
|
64
|
+
- Ensure you create a [changeset](https://github.com/changesets/changesets) as the final commit before creating a new PR (or updating one).
|
|
65
|
+
|
|
66
|
+
#### Setting Up Husky for Contributions
|
|
67
|
+
|
|
68
|
+
This project uses Husky for Git hooks and Commitlint to enforce commit message standards.
|
|
69
|
+
|
|
70
|
+
Install Dependencies: First, clone the repository and install the project dependencies, which include Husky:
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
git clone <repository-url>
|
|
74
|
+
cd <repository-directory>
|
|
75
|
+
pnpm install
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
Activate Husky Hooks: After installing dependencies, you need to initialize Husky's Git hooks. Run the following command:
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
pnpm husky install
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
This command sets up a .husky/ directory in the project, linking the necessary scripts to Git’s hook system. Once activated, Husky will automatically enforce commit message standards during commits.
|
|
85
|
+
|
|
86
|
+
Thank you for helping maintain commit quality and consistency!
|
|
87
|
+
|
|
88
|
+
\[wip\]!
|
|
89
|
+
|
|
90
|
+
## CI
|
|
91
|
+
|
|
92
|
+
>>> consider changesets in the following?
|
|
93
|
+
|
|
94
|
+
### Contrib flow
|
|
95
|
+
|
|
96
|
+
- Contrib user clones repo locally
|
|
97
|
+
- Contrib user creates a feature branch
|
|
98
|
+
- Contrib user generates commits to feature branch
|
|
99
|
+
- Contrib user create a PR back to the origin/[default branch]
|
|
100
|
+
- CI pipeline activates and runs at least tests && build
|
|
101
|
+
-> On success PR can be merged to main by Maintainer
|
|
102
|
+
-> On fail PR needs updating until tests and build success
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
### Maintainer flow
|
|
106
|
+
|
|
107
|
+
- Maintainer decides that code on main is ready to release
|
|
108
|
+
- Mt pulls main
|
|
109
|
+
- Mt checks out new "release" branch
|
|
110
|
+
- Mt runs: pnpm changeset add
|
|
111
|
+
- Mt commits results when happy with the change set
|
|
112
|
+
- Mt run changeset version
|
|
113
|
+
[WIP]
|
|
114
|
+
|
|
115
|
+
## Roadmap
|
|
116
|
+
|
|
117
|
+
- Keep up with any future changes or additions to the [Bookwhen API](https://api.bookwhen.com/v2).
|
|
118
|
+
|
|
119
|
+
## License
|
|
120
|
+
|
|
121
|
+
ISC License. See [LICENSE](LICENSE) for more information.
|
|
122
|
+
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,IAAI,GAAG,GAAG,EAAE;IACvB,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;AAC5B,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +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;AAE9C,QAAQ,CAAC,WAAW,EAAE,GAAG,EAAE;IACzB,EAAE,CAAC,gBAAgB,EAAE,GAAG,EAAE;QACxB,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACpB,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,16 +1,35 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jphil/bookwhen-client",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.8",
|
|
4
4
|
"description": "",
|
|
5
5
|
"private": false,
|
|
6
|
-
"main": "
|
|
7
|
-
"module": "
|
|
8
|
-
"types": "
|
|
9
|
-
"keywords": [
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"module": "dist/index.mjs",
|
|
8
|
+
"types": "dist/index.d.ts",
|
|
9
|
+
"keywords": [
|
|
10
|
+
"bookwhen",
|
|
11
|
+
"booking",
|
|
12
|
+
"api client"
|
|
13
|
+
],
|
|
10
14
|
"type": "module",
|
|
11
|
-
"author":
|
|
15
|
+
"author": {
|
|
16
|
+
"name": "Justin Philpott",
|
|
17
|
+
"email": "justin@jphil.dev"
|
|
18
|
+
},
|
|
19
|
+
"homepage": "https://github.com/justinphilpott/bookwhen-client",
|
|
20
|
+
"bugs": {
|
|
21
|
+
"url": "https://github.com/justinphilpott/bookwhen-client/issues"
|
|
22
|
+
},
|
|
23
|
+
"repository": {
|
|
24
|
+
"type": "git",
|
|
25
|
+
"url": "https://github.com/justinphilpott/bookwhen-client.git"
|
|
26
|
+
},
|
|
27
|
+
"files": [
|
|
28
|
+
"dist"
|
|
29
|
+
],
|
|
12
30
|
"license": "ISC",
|
|
13
31
|
"devDependencies": {
|
|
32
|
+
"@arethetypeswrong/cli": "^0.16.4",
|
|
14
33
|
"@changesets/cli": "^2.27.9",
|
|
15
34
|
"@commitlint/cli": "^19.5.0",
|
|
16
35
|
"@commitlint/config-conventional": "^19.5.0",
|
|
@@ -36,14 +55,18 @@
|
|
|
36
55
|
},
|
|
37
56
|
"scripts": {
|
|
38
57
|
"dev": "vitest",
|
|
39
|
-
"build": "
|
|
58
|
+
"build": "tsc",
|
|
40
59
|
"lint": "tsc",
|
|
41
60
|
"test": "vitest run",
|
|
42
|
-
"ci": "pnpm lint && pnpm test && pnpm build",
|
|
43
|
-
"release": "pnpm lint && pnpm test && pnpm build && changeset publish",
|
|
44
|
-
"commit": "cz",
|
|
45
61
|
"type-check": "tsc --noEmit",
|
|
46
|
-
"
|
|
47
|
-
"
|
|
62
|
+
"check-exports": "attw --pack . --ignore-rules=cjs-resolves-to-esm",
|
|
63
|
+
"prettier-check": "prettier --check 'src/**/*.ts'",
|
|
64
|
+
"format": "prettier --write 'src/**/*.ts' README.md",
|
|
65
|
+
"pre-commit": "pnpm lint && pnpm build",
|
|
66
|
+
"commit": "cz",
|
|
67
|
+
"prepush": "pnpm test",
|
|
68
|
+
"local-release": "changeset version && changeset publish",
|
|
69
|
+
"release": "pnpm lint && pnpm test && pnpm build && changeset publish",
|
|
70
|
+
"ci": "pnpm test && pnpm check-exports && pnpm build"
|
|
48
71
|
}
|
|
49
72
|
}
|
package/.changeset/README.md
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
# Changesets
|
|
2
|
-
|
|
3
|
-
Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
|
|
4
|
-
with multi-package repos, or single-package repos to help you version and publish your code. You can
|
|
5
|
-
find the full documentation for it [in our repository](https://github.com/changesets/changesets)
|
|
6
|
-
|
|
7
|
-
We have a quick list of common questions to get you started engaging with this project in
|
|
8
|
-
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)
|
package/.changeset/config.json
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://unpkg.com/@changesets/config@3.0.3/schema.json",
|
|
3
|
-
"changelog": "@changesets/cli/changelog",
|
|
4
|
-
"commit": false,
|
|
5
|
-
"fixed": [],
|
|
6
|
-
"linked": [],
|
|
7
|
-
"access": "public",
|
|
8
|
-
"baseBranch": "main",
|
|
9
|
-
"updateInternalDependencies": "patch",
|
|
10
|
-
"ignore": []
|
|
11
|
-
}
|
package/.eslintrc.json
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
name: CI
|
|
2
|
-
on:
|
|
3
|
-
push:
|
|
4
|
-
branches:
|
|
5
|
-
- '**'
|
|
6
|
-
|
|
7
|
-
jobs:
|
|
8
|
-
build:
|
|
9
|
-
runs-on: ubuntu-latest
|
|
10
|
-
steps:
|
|
11
|
-
- name: Checkout code
|
|
12
|
-
uses: actions/checkout@v4
|
|
13
|
-
|
|
14
|
-
- name: Set up pnpm
|
|
15
|
-
uses: pnpm/action-setup@v4
|
|
16
|
-
with:
|
|
17
|
-
version: 9
|
|
18
|
-
|
|
19
|
-
- name: Set up Node.js
|
|
20
|
-
uses: actions/setup-node@v4
|
|
21
|
-
with:
|
|
22
|
-
node-version: 20.x
|
|
23
|
-
cache: 'pnpm'
|
|
24
|
-
|
|
25
|
-
- name: Install dependencies
|
|
26
|
-
run: pnpm install --frozen-lockfile
|
|
27
|
-
|
|
28
|
-
- name: Run CI
|
|
29
|
-
run: pnpm run ci
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
name: Publish
|
|
2
|
-
on:
|
|
3
|
-
push:
|
|
4
|
-
branches:
|
|
5
|
-
- 'main'
|
|
6
|
-
|
|
7
|
-
concurrency: ${{ github.workflow }}-${{ github.ref }}
|
|
8
|
-
|
|
9
|
-
jobs:
|
|
10
|
-
publish:
|
|
11
|
-
runs-on: ubuntu-latest
|
|
12
|
-
steps:
|
|
13
|
-
- name: Checkout code
|
|
14
|
-
uses: actions/checkout@v4
|
|
15
|
-
|
|
16
|
-
- name: Set up pnpm
|
|
17
|
-
uses: pnpm/action-setup@v4
|
|
18
|
-
with:
|
|
19
|
-
version: 9
|
|
20
|
-
|
|
21
|
-
- name: Set up Node.js
|
|
22
|
-
uses: actions/setup-node@v4
|
|
23
|
-
with:
|
|
24
|
-
node-version: 20.x
|
|
25
|
-
cache: 'pnpm'
|
|
26
|
-
|
|
27
|
-
- name: Install dependencies
|
|
28
|
-
run: pnpm install --frozen-lockfile
|
|
29
|
-
|
|
30
|
-
- name: Create Release Pull Request or Publish
|
|
31
|
-
id: changesets
|
|
32
|
-
uses: changesets/action@v1
|
|
33
|
-
with:
|
|
34
|
-
publish: pnpm release
|
|
35
|
-
env:
|
|
36
|
-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
37
|
-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
package/.husky/commit-msg
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
pnpx commitlint --edit "$1"
|
package/.husky/pre-commit
DELETED
package/.nvmrc
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
v18
|
package/.prettierrc.json
DELETED
package/CHANGELOG.md
DELETED
package/README
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
# Bookwhen Client
|
|
2
|
-
|
|
3
|
-
[](http://commitizen.github.io/cz-cli/)
|
|
4
|
-
|
|
5
|
-
## About this Repo
|
|
6
|
-
|
|
7
|
-
bookwhen-client exist to provide an easy interface for pulling data from the bookwhen API (V2)
|
|
8
|
-
|
|
9
|
-
## Setting Up Husky for Contributions
|
|
10
|
-
|
|
11
|
-
This project uses Husky for Git hooks and Commitlint to enforce commit message standards.
|
|
12
|
-
|
|
13
|
-
Install Dependencies: First, clone the repository and install the project dependencies, which include Husky:
|
|
14
|
-
|
|
15
|
-
bash
|
|
16
|
-
|
|
17
|
-
git clone <repository-url>
|
|
18
|
-
cd <repository-directory>
|
|
19
|
-
pnpm install
|
|
20
|
-
|
|
21
|
-
Activate Husky Hooks: After installing dependencies, you need to initialize Husky's Git hooks. Run the following command:
|
|
22
|
-
|
|
23
|
-
bash
|
|
24
|
-
|
|
25
|
-
pnpm husky install
|
|
26
|
-
|
|
27
|
-
This command sets up a .husky/ directory in the project, linking the necessary scripts to Git’s hook system. Once activated, Husky will automatically enforce commit message standards during commits.
|
|
28
|
-
|
|
29
|
-
Thank you for helping maintain commit quality and consistency!
|
package/commitlint.config.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
module.exports = { extends: ['@commitlint/config-conventional'] };
|
package/dist/index.cjs
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
|
-
// src/index.ts
|
|
21
|
-
var src_exports = {};
|
|
22
|
-
__export(src_exports, {
|
|
23
|
-
test: () => test
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(src_exports);
|
|
26
|
-
var test = () => {
|
|
27
|
-
console.log("hello test");
|
|
28
|
-
};
|
|
29
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
30
|
-
0 && (module.exports = {
|
|
31
|
-
test
|
|
32
|
-
});
|
package/dist/index.d.cts
DELETED
package/eslint.config.js
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
// eslint.config.js
|
|
2
|
-
import eslintPluginPrettier from "eslint-plugin-prettier";
|
|
3
|
-
import eslintConfigPrettier from "eslint-config-prettier";
|
|
4
|
-
|
|
5
|
-
export default [
|
|
6
|
-
{
|
|
7
|
-
files: ["**/*.js", "**/*.ts", "**/*.tsx"],
|
|
8
|
-
languageOptions: {
|
|
9
|
-
ecmaVersion: 2021,
|
|
10
|
-
sourceType: "module",
|
|
11
|
-
globals: {
|
|
12
|
-
browser: true,
|
|
13
|
-
es6: true,
|
|
14
|
-
node: true,
|
|
15
|
-
},
|
|
16
|
-
},
|
|
17
|
-
plugins: {
|
|
18
|
-
prettier: eslintPluginPrettier,
|
|
19
|
-
},
|
|
20
|
-
rules: {
|
|
21
|
-
...eslintConfigPrettier.rules, // integrates Prettier rules
|
|
22
|
-
// Add any custom rules here, e.g.:
|
|
23
|
-
// "semi": ["error", "always"]
|
|
24
|
-
},
|
|
25
|
-
},
|
|
26
|
-
];
|
package/src/index.test.ts
DELETED
package/src/index.ts
DELETED
package/tsconfig.json
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"target": "ES2021",
|
|
4
|
-
"module": "nodenext",
|
|
5
|
-
"moduleResolution": "nodenext",
|
|
6
|
-
"noEmit": true,
|
|
7
|
-
"esModuleInterop": true,
|
|
8
|
-
"forceConsistentCasingInFileNames": true,
|
|
9
|
-
"strict": true,
|
|
10
|
-
"skipLibCheck": true,
|
|
11
|
-
"outDir": "./dist",
|
|
12
|
-
"baseUrl": "./"
|
|
13
|
-
},
|
|
14
|
-
"include": ["src/**/*"], // Include your source files
|
|
15
|
-
"exclude": ["node_modules", "dist"] // Exclude unnecessary directories
|
|
16
|
-
}
|