Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement client for ha #3

Open
wants to merge 20 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Build and Deploy
on: [push]

jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/[email protected]
with:
fetch-depth: 0

- name: Install and Build 🔧
run: |
npm install
npm run docs:build

- name: Deploy 🚀
uses: JamesIves/[email protected]
with:
branch: gh-pages
folder: docs
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
canhazdata
certs
node_modules
coverage
lib
docs
681 changes: 20 additions & 661 deletions LICENSE

Large diffs are not rendered by default.

7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,15 @@ const changedDocument = await client.getOne('tests', { query: { id: document.id
// client.on('DELETE:/tests/.*', ...)
// client.on('(PUT|PATCH):/tests/uuid-uuid-uuid-uuid', ...)

client.on('POST:/tests/.*', (path, collectionId, resourceId, pattern) => {
client.on('POST:/tests/.*', (path, method, collectionId, resourceId, pattern) => {
console.log(path) // === 'POST:/tests/uuid-uuid-uuid-uuid'
console.log(method) // === 'POST'
console.log(collectionId) // === 'tests'
console.log(resourceId) // === 'uuid-uuid-uuid-uuid'
console.log(pattern) // === 'POST:/tests/.*'
})

console.log( {
console.log({
document, /* { a: 1 } */
changed, /* { changes: 1 } */
changedDocument, /* { b: 2 } */
Expand Down Expand Up @@ -207,4 +208,4 @@ await client.unlock(lockId);
</details>

## License
This project is licensed under the terms of the AGPL-3.0 license.
This project is licensed under the terms of the MIT license.
38 changes: 0 additions & 38 deletions constants.js

This file was deleted.

Loading