askrobots / dbbasic-object-server
Public
Runs live, versioned Python application objects on one VM, with a suite of apps: projects, notes, tasks, files and more.
danq9
signup: the person chooses the password and name on the confirm page
83c7aa6
2 weeks, 5 days ago
History
dbbasic-package.json · 5.0 KB · 77 lines
| 1 | { |
| 2 | "id": "app-messaging", |
| 3 | "name": "Messaging", |
| 4 | "version": "0.2.0", |
| 5 | "description": "Mailbox / unified-inbox data model: threads, messages, normalized recipients, and drafts -- owner-scoped CRUD, no public read anywhere (a mailbox is private). A faithful port of a private predecessor-system audit, not part of this repo -- that source's messaging was fundamentally an email inbox backed by external mail infrastructure (IMAP/SMTP/mailcow) plus an AI triage layer. This package ports the DATA MODEL ONLY, at the level the audit documented it: message_threads (thread_type, subject, participant snapshot, star/archive/trash flags, an unread rollup, a running message count), messages (thread_id, direction inbound/outbound, from_address, subject, body_text, is_read, sent_at/received_at, in_reply_to/external_message_id for a future IMAP linkage), message_recipients (normalized To/Cc/Bcc addressing per message, matching the source's own MessageRecipient normalization), and message_drafts (an unsent message, kept as its own model rather than a status value on messages, again matching the source's own split). messages.json opts into \"storage\": \"append\" -- a message is a write-hot, rarely-content-edited log entry once sent or received (only is_read flips), the same profile that put app-thread's thread_comments and app-catalog's stock_moves on append storage; every other collection here stays classic (default), matching forum_topics' choice for a smaller, frequently-flag-toggled container. Deferred entirely, on purpose, not built here: IMAP/SMTP transport and the mailcow admin layer (the audit's separate email_hosting/ control panel -- an adapter around an external system, same category as a locked/adapter package), AI email triage/summarization/rules-engine (the audit's dove/ layer sitting over messaging -- thread classification states, sender reputation, an actions-as-data rules engine; a real feature, just not this package's job), SMS/Twilio conversational intake (the audit's separate twilio_integration/ -- inbound voice/SMS, infra-bound, unrelated to the inbox data model), and message attachments (the audit's MessageAttachment pointed at a file_manager.File model this codebase has no package for yet -- no attachment field or collection is invented here to avoid a dangling relation). Also carried-but-inert, matching the same fields-not-behavior posture forum_topics uses for ai_summary: message_count is a running total nothing here increments (a UI/page-load or handler concern, not built); is_read on both message_threads and messages defaults true because this package ships no inbound-transport insertion path, so nothing created here (by hand, seed, or draft save) needs an unread badge -- a future sync job is what should flip it false on newly-synced inbound mail. The thread permalink /inbox/{thread_id:uuid} is now a seeded 59 detail view (site_view_render): a composed page of four generic block renderers -- an editable+deletable `detail` block (thread; star/archive/trash/read toggles are edited via the detail block's owner edit form, not one-click buttons), a `related` block (flat messages by thread_id -- messages were never nested/self-threaded), a `markdown` block carrying the \"nothing is sent\" note, and a `form` block with fixed:{thread_id:$record_id} (Save Draft, FK locked to the page's thread). No bespoke per-thread page. The row-filtered collection API still means only the signed-in owner ever sees real content here -- the composed view is exactly as owner-private as the page it replaces. One site route remains undeclared here (same precedent as app-invoices' /invoices/{invoice_id:uuid}): /inbox -> site_inbox (the owner's threads, newest-first).", |
| 6 | "compatibility": { |
| 7 | "dbbasic_object_server": ">=0.1.0" |
| 8 | }, |
| 9 | "dependencies": ["app-views"], |
| 10 | "objects": [ |
| 11 | { |
| 12 | "id": "site_inbox", |
| 13 | "path": "objects/site/inbox.py" |
| 14 | } |
| 15 | ], |
| 16 | "schemas": [ |
| 17 | { |
| 18 | "collection": "message_threads", |
| 19 | "path": "schemas/message_threads.json" |
| 20 | }, |
| 21 | { |
| 22 | "collection": "messages", |
| 23 | "path": "schemas/messages.json" |
| 24 | }, |
| 25 | { |
| 26 | "collection": "message_recipients", |
| 27 | "path": "schemas/message_recipients.json" |
| 28 | }, |
| 29 | { |
| 30 | "collection": "message_drafts", |
| 31 | "path": "schemas/message_drafts.json" |
| 32 | } |
| 33 | ], |
| 34 | "permissions": [ |
| 35 | { |
| 36 | "path": "permissions/rules.json" |
| 37 | } |
| 38 | ], |
| 39 | "seed": [ |
| 40 | { |
| 41 | "collection": "message_threads", |
| 42 | "path": "seed/message_threads.tsv" |
| 43 | }, |
| 44 | { |
| 45 | "collection": "messages", |
| 46 | "path": "seed/messages.tsv" |
| 47 | }, |
| 48 | { |
| 49 | "collection": "message_recipients", |
| 50 | "path": "seed/message_recipients.tsv" |
| 51 | }, |
| 52 | { |
| 53 | "collection": "message_drafts", |
| 54 | "path": "seed/message_drafts.tsv" |
| 55 | }, |
| 56 | { |
| 57 | "collection": "views", |
| 58 | "path": "seed/views.tsv" |
| 59 | }, |
| 60 | { |
| 61 | "collection": "site_routes", |
| 62 | "path": "seed/site_routes.tsv" |
| 63 | } |
| 64 | ], |
| 65 | "migrations": [], |
| 66 | "nav": [ |
| 67 | { |
| 68 | "id": "inbox", |
| 69 | "label": "Inbox", |
| 70 | "path": "/inbox", |
| 71 | "blurb": "Private message threads between accounts", |
| 72 | "surface": "member", |
| 73 | "group": "Work", |
| 74 | "order": 110 |
| 75 | } |
| 76 | ] |
| 77 | } |