Repository navigation
Added a web app guide and the optional outnote.api helpers - #43
Merged
Merged
Conversation
The guide shows a native-feeling frontend and an API-layer cache, both with and without outnote.api. ClientPool saves rotated refresh tokens through your own function, and ApiCache adds a per-user cache to any framework.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a guide to building a native-feeling web app on OutNote, and an optional module that makes the API side easier.
docs/frontend-and-api.mdUses only normal calls like
emails()andchats(), notstream()orSQLiteCache.outnote.apiand without it, so you can own all the code.outnote.apiOptional and framework-free, using only the standard library plus OutNote's existing dependencies.
import outnotedoesn't load it, and a test checks that.ApiCache: answers from memory, refreshes in the background, and merges identical requests. A slow old read can't overwrite a newer write.ClientPool: one client per user, with token requests one at a time per user. It calls yoursave_tokenwhen a refresh token rotates, which previously could only be saved to a file.respond()anderror_response(): ETag and304handling, andGraphErrorto a status andRetry-After.Testing
tests/test_api.py, and Ruff and mypy are clean.304, instant and undone actions, API down, fully offline, user separation and sign-out clearing.Not tested: the complete app against Microsoft, real authentication, many users at once, or several API servers.