{ "format_version": 1, "id": "story", "name": "Story", "plural": "Social", "builtin": true, "visibility": "owner", "date": "posted_at", "title": "caption", "columns": [ { "key": "source", "name": "App", "type": "text", "labels": { "cellular": "Phone call", "facetime_audio": "FaceTime audio", "facetime_video": "FaceTime video", "whatsapp": "WhatsApp", "com.apple.telephony": "Phone call", "com.apple.facetime": "FaceTime", "com.skype.skype": "Skype", "com.skype.skypeforiphone": "Skype", "com.microsoft.skype.teams": "Microsoft Teams", "us.zoom.videomeetings": "Zoom", "com.google.meetings": "Google Meet", "com.google.gvdialer": "Google Voice", "ph.telegra.telegraph": "Telegram", "org.whispersystems.signal": "Signal", "com.viber": "Viber", "com.facebook.messenger": "Messenger", "com.burbn.instagram": "Instagram", "jp.naver.line": "LINE", "com.tencent.xin": "WeChat", "com.hammerandchisel.discord": "Discord", "com.tinyspeck.chatlyio": "Slack", "com.cisco.webex.meetings": "Webex", "net.whatsapp.whatsapp": "WhatsApp", "net.whatsapp.whatsappsmb": "WhatsApp Business" }, "format": "app-name", "readonly": true, "fact": true, "reading": "{value}" }, { "key": "account", "type": "text", "readonly": true }, { "key": "external_id", "type": "text", "readonly": true }, { "key": "person_id", "name": "Who", "type": "link", "link_to": "person", "readonly": true }, { "key": "sender", "name": "From", "type": "text", "readonly": true }, { "key": "sender_label", "name": "Shown as", "type": "text", "readonly": true, "fact": true, "reading": "{value}" }, { "key": "kind", "name": "Kind", "type": "text", "labels": { "photo": "Photo", "video": "Video" }, "readonly": true }, { "key": "caption", "name": "Caption", "type": "longtext", "readonly": true }, { "key": "media_key", "name": "Picture", "type": "photo", "readonly": true, "placeholder": "Picture unavailable", "caption": "caption" }, { "key": "media_content_type", "type": "text", "readonly": true }, { "key": "media_dropped_at", "name": "Picture let go", "type": "date", "readonly": true }, { "key": "posted_at", "name": "Posted", "type": "date", "format": "calendar-datetime", "readonly": true, "fact": true, "reading": "{value}" }, { "key": "expires_at", "name": "App expiry", "type": "date", "readonly": true }, { "key": "seen_at", "type": "date", "format": "calendar-datetime", "readonly": true }, { "key": "kept", "name": "Kept", "type": "bool", "readonly": true }, { "key": "retention_line", "name": "Kept", "type": "text", "readonly": true }, { "key": "expiry_line", "name": "In the app", "type": "text", "readonly": true }, { "key": "reactions", "name": "Reactions", "type": "text", "readonly": true } ], "seal": { "clear": [ "person_id", "posted_at", "expires_at" ], "blind": [ "caption" ], "blind_exact": [ "external_id" ] }, "instructions": "A story is a status or story someone posted on WhatsApp (later Instagram, Facebook), held after the app lets it go: who posted it (person, or the name the app showed and their number), the caption, the picture, when it was posted and when the app dropped it. Rows stay for ever; a picture stays only for someone on a People record or a story the owner kept (Keep), and is let go a day after posting otherwise. A story is never a chat message, and reading it here marks nothing seen in the app.", "tables": [ { "name": "cotton_stories", "columns": [ { "name": "id", "type": "TEXT", "default": null, "nullable": true, "primary_key": true, "declaration": "\n id TEXT PRIMARY KEY", "position": 0 }, { "name": "workspace_id", "type": "TEXT", "default": null, "nullable": false, "primary_key": false, "declaration": "\n workspace_id TEXT NOT NULL", "position": 1 }, { "name": "source", "type": "TEXT", "default": null, "nullable": false, "primary_key": false, "declaration": "\n source TEXT NOT NULL CHECK (source IN ('whatsapp', 'instagram', 'facebook'))", "position": 2 }, { "name": "account", "type": "TEXT", "default": null, "nullable": false, "primary_key": false, "declaration": "\n account TEXT NOT NULL", "position": 3 }, { "name": "external_id", "type": "TEXT", "default": null, "nullable": false, "primary_key": false, "declaration": "\n external_id TEXT NOT NULL", "position": 4 }, { "name": "person_id", "type": "TEXT", "default": null, "nullable": true, "primary_key": false, "declaration": "\n person_id TEXT", "position": 5 }, { "name": "sender", "type": "TEXT", "default": null, "nullable": true, "primary_key": false, "declaration": "\n sender TEXT", "position": 6 }, { "name": "sender_label", "type": "TEXT", "default": null, "nullable": true, "primary_key": false, "declaration": "\n sender_label TEXT", "position": 7 }, { "name": "kind", "type": "TEXT", "default": null, "nullable": false, "primary_key": false, "declaration": "\n kind TEXT NOT NULL", "position": 8 }, { "name": "caption", "type": "TEXT", "default": null, "nullable": true, "primary_key": false, "declaration": "\n caption TEXT", "position": 9 }, { "name": "media_key", "type": "TEXT", "default": null, "nullable": true, "primary_key": false, "declaration": "\n media_key TEXT", "position": 10 }, { "name": "media_content_type", "type": "TEXT", "default": null, "nullable": true, "primary_key": false, "declaration": "\n media_content_type TEXT", "position": 11 }, { "name": "media_dropped_at", "type": "TEXT", "default": null, "nullable": true, "primary_key": false, "declaration": "\n media_dropped_at TEXT", "position": 12 }, { "name": "posted_at", "type": "TEXT", "default": null, "nullable": false, "primary_key": false, "declaration": "\n posted_at TEXT NOT NULL", "position": 13 }, { "name": "expires_at", "type": "TEXT", "default": null, "nullable": false, "primary_key": false, "declaration": "\n expires_at TEXT NOT NULL", "position": 14 }, { "name": "seen_at", "type": "TEXT", "default": null, "nullable": true, "primary_key": false, "declaration": "\n seen_at TEXT", "position": 15 }, { "name": "kept", "type": "INTEGER", "default": "0", "nullable": false, "primary_key": false, "declaration": "\n kept INTEGER NOT NULL DEFAULT 0 CHECK (kept IN (0, 1))", "position": 16 }, { "name": "created_at", "type": "TEXT", "default": null, "nullable": false, "primary_key": false, "declaration": "\n created_at TEXT NOT NULL", "position": 17 }, { "name": "_hlc", "type": "TEXT", "default": "''", "nullable": false, "primary_key": false, "declaration": "\n _hlc TEXT NOT NULL DEFAULT ''", "position": 18 }, { "name": "_born", "type": "TEXT", "default": null, "nullable": true, "primary_key": false, "declaration": "\n _born TEXT", "position": 19 } ], "constraints": [ { "declaration": "\n UNIQUE (workspace_id, source, external_id)", "position": 20 }, { "declaration": "\n CHECK (trim(external_id) <> '')", "position": 21 }, { "declaration": "\n FOREIGN KEY (workspace_id) REFERENCES cotton_workspaces(id) ON DELETE CASCADE\n ", "position": 22 } ], "prefix": "CREATE TABLE cotton_stories (", "suffix": ")", "indexes": [ "CREATE INDEX idx_cotton_stories_posted ON cotton_stories (workspace_id, posted_at)", "CREATE INDEX idx_cotton_stories_person ON cotton_stories (person_id)", "CREATE INDEX IF NOT EXISTS idx_cotton_stories_author ON cotton_stories (substr(_hlc, 20), _hlc)" ], "full_text": [], "triggers": [] } ], "picture": { "photo": "photo:51ec4b79f6e238265a5afb50500b92eaf61fb199ac1c93515b7915544511464c", "object": "tool-stories" }, "engine": "messages", "project": null, "order": null, "slip": { "title": "caption", "subtitle": "sender_label", "trailing": "posted_at", "photo": "media_key", "toggle": null, "title_fallback": "sender_label" }, "tile": { "face": "polaroid-grid" }, "page": [ { "heading": null, "columns": [ "media_key", "caption" ], "hand": [ "sender_label", "posted_at", "source" ] }, { "heading": null, "columns": [ "person_id" ], "when": { "column": "person_id", "present": true } }, { "heading": null, "columns": [ "media_dropped_at" ], "when": { "column": "media_dropped_at", "present": true } }, { "heading": "Details", "columns": [ "sender", "kind", "expires_at", "kept" ] } ], "add": false, "stories": { "picture": { "caption": "caption", "subtitle": "posted_at" }, "page": { "caption": "caption" }, "video": { "column": "kind", "values": [ "video" ] } }, "sort": { "column": "posted_at", "descending": true }, "group": { "column": "person_id" }, "layout": "sheet", "grid": { "columns": 4 }, "empty": { "title": "No stories yet.", "message": "Statuses people post on WhatsApp land here, kept after the app lets them go." }, "search": [ "caption" ], "delete": false, "commands": [ { "id": "keep", "label": "Keep", "object": "tick", "kind": "update", "verb": "update_record", "data": { "table": "story", "patch": { "kept": true } }, "bindings": { "id": "$id" }, "when": { "kept": false }, "receipt": "Kept", "undo": "unkeep", "does": "completes" }, { "id": "unkeep", "label": "Don't keep", "object": "undo", "kind": "update", "verb": "update_record", "data": { "table": "story", "patch": { "kept": false } }, "bindings": { "id": "$id" }, "when": { "kept": true }, "receipt": "Not kept", "undo": "keep" }, { "id": "person", "label": "Open person", "object": "person", "kind": "open", "opens": "person_id" } ], "card": { "face": "plain", "fields": [ { "slot": "photo", "column": "media_key" }, { "slot": "title", "column": "caption" }, { "slot": "subtitle", "column": "sender_label" }, { "slot": "facts", "column": "posted_at", "also": [ "source", "kind", "expiry_line", "retention_line" ] } ] }, "tool": { "views": [ { "id": "all", "label": "All", "visibility": "owner", "is_default": true, "read": { "table": "story" } } ], "name": "Social", "purpose": "Stories and the moments they bring together.", "key": "stories", "icon": "images", "card_stock": "slate", "route": "/lists/story" }, "parts": { "shape": "desk", "head": { "facts": [ "sender_label", "posted_at", "source" ] }, "links": [], "body": "caption", "lists": [], "acts": { "main": "keep", "more": [ "unkeep", "person" ] }, "strip": [ { "column": "media_key" }, { "column": "retention_line" }, { "column": "expiry_line" }, { "column": "reactions" } ] }, "groups": { "stack": "polaroids" } }