Skip to content
This repository has been archived by the owner on Nov 9, 2021. It is now read-only.

Convert to TypeScript #54

Merged
merged 13 commits into from
Aug 3, 2020
Merged

Convert to TypeScript #54

merged 13 commits into from
Aug 3, 2020

Conversation

nihalgonsalves
Copy link
Collaborator

@nihalgonsalves nihalgonsalves commented Aug 2, 2020

BREAKING CHANGES:

  • Drops support for ‘password’ authentication type
  • Config overhaul (see README for migration guide)
  • alwaysOpenSwitch renamed to dangerouslyEnableAlwaysOpenSwitch

Minor changes:

  • Automatically setup default snapshot image for the video doorbell
  • Better API rate-limit handling and logging
  • Local webhook URLs now have a unique ID
  • Webhook URLs are rotated periodically (same interval as the location updates)

Non-feature changes:

  • Convert to TypeScript
  • Add test server config generation for easy local testing
  • Add automatic doc generation for configuration and defaults
  • Refactor callbacks to async/await
  • Refactor prototype setup to ES6+ class
  • Move all API requests into single client
  • Deduplicate other code
  • Fix stray Buffer() call => Buffer.alloc()

TODO:

  • @lukasroegner Enable GitHub Pages for /docs
  • Bump major version (here)
  • Publish release

BREAKING CHANGE: alwaysOpenSwitch renamed to dangerouslyEnableAlwaysOpenSwitch
@lukasroegner
Copy link
Owner

GitHub pages enabled for /docs.

@nihalgonsalves nihalgonsalves merged commit 6580811 into master Aug 3, 2020
@nihalgonsalves nihalgonsalves deleted the ng/ts branch August 3, 2020 07:52
@nihalgonsalves
Copy link
Collaborator Author

nihalgonsalves commented Aug 3, 2020

@lukasroegner thanks! you can look at the docs here: https://lukasroegner.github.io/homebridge-nello/ (maybe we could put that into the repo website URL)

Specifically the config documentation here: https://lukasroegner.github.io/homebridge-nello/modules/_config_.html

That's generated from: https://github.com/lukasroegner/homebridge-nello/blob/master/src/config.ts

@lukasroegner
Copy link
Owner

@nihalgonsalves Thanks, that's great!

I noticed that the following link doesn't work: "Nello Public API: see all methods in APIClient" in the docs

@nihalgonsalves
Copy link
Collaborator Author

nihalgonsalves commented Aug 3, 2020

Ah, makes sense, it's a relative link and typegen doesn't know what to do with it (though it works from GitHub's interface). Fixed in cca0d19.

I'll create a patch release now to see if everything works correctly.

@nihalgonsalves
Copy link
Collaborator Author

nihalgonsalves commented Aug 3, 2020

Hm, I get this error once I moved it to the other workflow in cca0d19

npm ERR! code E404
69
npm ERR! 404 Not Found - PUT https://registry.npmjs.org/homebridge-nello - Not found
70
npm ERR! 404 
71

https://github.com/lukasroegner/homebridge-nello/runs/939936500?check_suite_focus=true

Is the secret somehow restricted to only one workflow?

@lukasroegner
Copy link
Owner

I checked that, the NPM Access Token I created is allowed to publish (you only have the option to "read" or "read and publish").

@nihalgonsalves
Copy link
Collaborator Author

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants