Fix/plugin examples cleanup #23
Merged
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.
🧩 Add Demo API Endpoint, Improve Plugin State Handling, and Backend Refactor
🔍 Overview
This PR introduces a range of backend and frontend updates to support better plugin state management, enable future plugin demos, and improve developer experience:
demo.pyAPI endpoint with full CRUD support for demonstration pluginsPluginStateServicethrough asynchronous readiness handlingcreate_setting_instanceto bypass SQLAlchemy relationship issuesROADMAP.mdentry📦 Backend Changes
1.
demo.py: New Demo Plugin EndpointCreated a FastAPI router for
/demo/routes.Includes endpoints:
GET /demo/items: Retrieve user-specific demo itemsPOST /demo/items: Create itemPUT /demo/items/{id}: Update itemDELETE /demo/items/{id}: Delete itemGET /demo/status: API and user statsGET /demo/health: Health checkUses in-memory storage (for non-production use).
2.
settings.py: Raw SQL InsertionSettingInstance.'current'user_id to the actual user at runtime.3.
api.pydemo.router🧠 Plugin State Enhancements
PluginStateService.tsensureInitialized()method to awaitPageContextServiceavailability.PluginStateFactory.tsserviceBridge.tspluginStateservice lookup.🧪 How to Test
/api/v1/demo/health– should return200 OK/api/v1/demo/itemsto create/view your items📝 Notes
/demoendpoints are scaffold-only and safe for use in examples or testing.