webapp.sticky_notes_api module
Sticky Notes API for Markdown preview - Stores user-specific notes per file in MongoDB - Endpoints: list, create, update, delete
- webapp.sticky_notes_api.kickoff_index_warmup(*, background=True, delay_seconds=0.0)[מקור]
Run index warmup once during startup so requests won’t block on it.
- webapp.sticky_notes_api.list_notes(file_id)
List all sticky notes for current user and file.
- פרמטרים:
file_id (str)
- webapp.sticky_notes_api.reminders_summary()
Return minimal summary for persistent UI badge.
- Response:
{ ok, has_due: bool, count_due: int, next: { note_id, file_id, remind_at } | null }
- webapp.sticky_notes_api.reminders_list()
Return a list of due sticky‑note reminders for the current user.
Response:
{ "ok": true, "items": [ { "note_id": "...", "file_id": "...", "preview": "...", "anchor_id": "h2-intro", "anchor_text": "Intro" } ], "count": 1 }
- webapp.sticky_notes_api.reminders_ack()
Mark current due reminder as acknowledged (user opened it).
- webapp.sticky_notes_api.create_note(file_id)
Create a new sticky note for a file.
- פרמטרים:
file_id (str)
- webapp.sticky_notes_api.update_note(note_id)
Update existing note; only owner can update.
- פרמטרים:
note_id (str)
- webapp.sticky_notes_api.delete_note(note_id)
Delete a note; only owner can delete.
- פרמטרים:
note_id (str)
- webapp.sticky_notes_api.batch_update_notes()
Batch update multiple notes in one request.
Body format (JSON):
{ "updates": [ { "id": "...", "content": "...", "position": {"x": 120, "y": 240}, "size": {"width": 260, "height": 200}, "color": "#FFFFCC", "is_minimized": false, "line_start": 10, "line_end": null, "anchor_id": "h2-intro", "anchor_text": "Intro", "prev_updated_at": "2024-01-01T00:00:00+00:00" } ] }
Response JSON contains
resultswith per-item status, e.g. 200/409.