generated from obsidianmd/obsidian-sample-plugin
-
-
Notifications
You must be signed in to change notification settings - Fork 6
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
Update Syncthing configuration & REST API datasource #137
Draft
LBF38
wants to merge
31
commits into
master
Choose a base branch
from
feat/syncthing-configuration
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains 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
fix util function to validate simple types. fix toJSON method in last model
* chore(deps): 📦 add valibot dependency * feat(dev): ⚗️ testing valibot in real usecase mobile and desktop real test example. add SyncthingSystemStatus object/schema. valibot allows to easily parse the data coming from unknown json. * refactor(dev): ♻️ add date schema to validate date * feat(dev): 🐛 update date validation update SyncthingSystemStatus to validate date types * refactor(dev): ♻️ move date validations * refactor(dev): ♻️ move url property to settings * refactor(dev): ♻️ update all code to valibot change all types used in the codebase move to valibot schemas for easy JSON validation and typing. * refactor(dev): 🔥 clean unused code
remove code specific to mobile
add valibot validation/parsing inside the function. directly manage the error inside the function. help to make it easier when calling API endpoints. TODO: add support for more HTTP methods such as POST/PUT
update configuration view to have a msg when syncthing needs to be restarted. add slot in warning message. add method param in requestEndpoint for syncthing REST datasource.
add more properties from configuration definition. add button in settings tab to test the configuration endpoint.
create the full TS wrapper over the Syncthing API This is the first commit for implementing every Syncthing endpoints
continue refactoring to implement all syncthing endpoints
using the new architecture/syntax. Still need some real tests to check endpoints and syntax
update stats_device and stats_folder
update devices and folders cluster endpoints. WIP: Still need to implement the DELETE part and test them.
all endpoints implemented
refactor all endpoints. Still need to verify and implement some endpoints
working on folder endpoints. still need to implement some methods for folder_versions
refactored all endpoints. need to test them. also need to verify syntax/validate the output
add all schemas to validate events from API calls. will help to handle all Syncthing events.
add events entities to validate API calls implement the endpoints still need to validate, when I will consume the endpoint
use of svelte/stores for better reactivity
add a modal to test all the refactoring for Syncthing REST API access this is experimental. Will be enhanced to test all features against a Syncthing instance (created only for that)
docker compose file to create new Syncthing instances for testing purposes
change all methods to arrow functions to capture `this` in proper context. also add a svelte component to test all the functions and methods. will see how I check all the methods in Obsidian and if really necessary too.
update code to test some approaches for testing the syncthing remote datasource methods
add a first simple svelte component to test xstate will be using it for more components, in particular configuration modal component
testing the xstate machines to use it for fetching configuration and updating UI. this is for testing purposes for now
made simple xstate machine to fetch all the configuration from Syncthing instance. for now, it fetches the config and can fail or succeed. more features will be implemented afterwards. a failure message is shown when there is an error occuring in the config modal.
change to npx for commitlint package
add call to syncthing system status for myID device info also created a syncthingController machine to orchestrate all the config table fetch/update logic.
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.
This PR will improve the Syncthing configuration panel shown inside the Obsidian settings. Later on, this panel could be accessed via the command palette to easier access to the modal.
Moreover, it improves the Syncthing remote datasource to have full validation on all API calls to the Syncthing REST API. (WIP: this should be verified against real API calls, might have some errors from there).
Finally, it aims to improve reactivity inside the Svelte components and the whole plugin by using svelte/stores.
Closes #10