Cotton code
406 lines · 8.2 KB · JSONRaw
{  "format_version": 1,  "id": "bin",  "name": "Binned record",  "plural": "Bin",  "picture": {    "photo": "photo:78ea5af271ac9c036a367d637ecb2c1f0e8bc7723056a3438454235fc63cdbf5",    "object": "tool-bin"  },  "builtin": true,  "engine": "bin",  "binned": {    "from": "table",    "restore": {      "state": "restored"    }  },  "columns": [    {      "key": "title",      "type": "text",      "readonly": true    },    {      "key": "table",      "name": "Table",      "type": "text",      "readonly": true    },    {      "key": "kind",      "name": "Kind",      "type": "choice",      "choices": [        "email",        "email_thread",        "secret",        "decision",        "note",        "event",        "goal",        "mood",        "alarm",        "meeting",        "photo",        "video",        "document",        "message",        "screenplay_character",        "news_topic",        "todo",        "group",        "record",        "database"      ],      "labels": {        "email": "Email",        "email_thread": "Conversation",        "secret": "Password",        "decision": "Decision",        "note": "Note",        "event": "Event",        "goal": "Goal",        "mood": "Mood",        "alarm": "Alarm",        "meeting": "Meeting",        "photo": "Photo",        "video": "Video",        "document": "Document",        "message": "Message",        "screenplay_character": "Character",        "news_topic": "News topic",        "todo": "Todo",        "group": "Group",        "record": "Record",        "database": "Database"      },      "readonly": true    },    {      "key": "trashed_at",      "name": "Binned",      "type": "date",      "readonly": true    },    {  "key": "state",  "name": "State",  "type": "choice",  "choices": [    "binned",    "restored",    "database_binned"  ],  "readonly": true,  "labels": {    "binned": "Binned",    "restored": "Restored",    "database_binned": "Database binned"  }},    {      "key": "removed_by",      "name": "Removed by",      "type": "text",      "readonly": true,      "reading": "removed by {value}"    },    {      "key": "creator_name",      "name": "Deleted by",      "type": "text",      "readonly": true,      "reading": "deleted by {value}"    },    {      "key": "can_restore",      "name": "Can restore",      "type": "bool",      "readonly": true    },    {      "key": "database_id",      "name": "Database",      "type": "text",      "readonly": true    }  ],  "title": "title",  "date": "trashed_at",  "project": null,  "order": null,  "sort": {    "column": "trashed_at",    "descending": true  },  "group": {    "column": "kind",    "sections": [      {        "heading": "Emails",        "values": [          "email"        ]      },      {        "heading": "Conversations",        "values": [          "email_thread"        ]      },      {        "heading": "Passwords",        "values": [          "secret"        ]      },      {        "heading": "Decisions",        "values": [          "decision"        ]      },      {        "heading": "Notes",        "values": [          "note"        ]      },      {        "heading": "Calendar",        "values": [          "event"        ]      },      {        "heading": "Goals",        "values": [          "goal"        ]      },      {        "heading": "Moods",        "values": [          "mood"        ]      },      {        "heading": "Alarms",        "values": [          "alarm"        ]      },      {        "heading": "Meetings",        "values": [          "meeting"        ]      },      {        "heading": "Photos",        "values": [          "photo"        ]      },      {        "heading": "Videos",        "values": [          "video"        ]      },      {        "heading": "Documents",        "values": [          "document"        ]      },      {        "heading": "Messages",        "values": [          "message"        ]      },      {        "heading": "Characters",        "values": [          "screenplay_character"        ]      },      {        "heading": "News topics",        "values": [          "news_topic"        ]      },      {        "heading": "Todos",        "values": [          "todo"        ]      },      {        "heading": "Groups",        "values": [          "group"        ]      },      {        "heading": "Records",        "values": [          "record"        ]      },      {        "heading": "Databases",        "values": [          "database"        ]      }    ]  },  "count_words": {    "column": "state",    "units": {      "binned": {        "one": "item",        "other": "items"      },      "database_binned": {        "one": "database",        "other": "databases"      }    }  },  "dimmed": {    "column": "state",    "values": [      "binned"    ]  },  "deletion": {    "label": "Delete forever",    "confirm": "Delete forever",    "undo": false  },  "search": [    "title"  ],  "slip": {    "title": "title",    "subtitle": [      "removed_by",      "creator_name"    ],    "trailing": null,    "photo": null,    "toggle": null,    "caption": {      "dates": [        "trashed_at"      ]    },    "answers": {      "column": "state",      "values": {        "restored": "Restore"      },      "when": [        "binned"      ],      "leaves": false    }  },  "tile": {    "face": "slip-list"  },  "empty": {    "title": "The bin is empty",    "message": "Records wait here until you restore or erase them. Database files and their media are kept for 30 days; only their creator can restore them."  },  "clear": {    "label": "Empty the bin",    "title": "Empty the bin?",    "message": "This erases Cotton's copy of all {count} — it cannot be undone. Your mail provider keeps its own bin, so mail you binned is still there until they clear it.",    "confirm": "Empty",    "done": "Bin emptied"  },  "page": [    {      "heading": null,      "columns": [        "title",        "trashed_at"      ],      "answers": {        "column": "state",        "values": {          "restored": "Restore"        },        "when": [          "binned"        ]      }    }  ],  "instructions": "The one bin: emails, conversations, passwords, decisions, groups and records of the owner's own tables that the owner removed, waiting until they are restored or the bin is emptied. Restoring sets state to restored (restore_from_bin); deleting a row erases that record for good, and only the owner's Empty the bin does that. Database rows use state database_binned: only the creator may restore before 30 days; removed members cannot restore. A phone removed from a shared database lists that database here with removed_by (who removed it) in place of creator_name; it is hidden everywhere else, and only a new invitation brings it back, as a fresh copy. Database files and media are purged after 30 days, through the same retention path as removed copies. They cannot be erased early by Empty the bin.",  "commands": [    {      "id": "delete",      "label": "Delete forever",      "kind": "delete",      "verb": "delete_record",      "data": {        "table": "bin"      },      "bindings": {        "id": "$id"      },      "when": {        "state": "binned"      },      "confirm": "It is erased for good and cannot come back.",      "receipt": "Erased",      "does": "destroys"    },    {      "id": "restore_database",      "label": "Restore",      "kind": "update",      "object": "restore",      "method": "databases.restore",      "bindings": {        "databaseId": "database_id"      },      "when": {        "can_restore": true      },      "receipt": "Restored"    }  ],  "parts": {    "shape": "sheet",    "head": {      "facts": [        "trashed_at"      ]    },    "links": [],    "lists": [],    "acts": {      "more": [        "restore_database"      ],      "away": "delete"    },    "cards": []  },  "tool": {    "name": "Bin",    "key": "bin",    "icon": "trash-2",    "card_stock": "grey",    "route": "/bin"  ,"purpose":"Deleted records you can restore or remove."},  "tables": []}