Cotton code
134 lines · 5.2 KB · JSONRaw
{"format_version":1,"id":"repo_label","name":"Label","plural":"Labels","picture":null,"builtin":true,"engine":"repos","columns":[{"key":"name","name":"Name","type":"text","required":true,"readonly":true},{"key":"meta","name":"Colour and use","type":"text","readonly":true},{"key":"color","name":"Colour","type":"text","readonly":true},{"key":"description","name":"What it is for","type":"text","readonly":true},{"key":"origin","name":"Hosted by","type":"text","readonly":true},{"key":"repo_id","name":"Repository","type":"link","link_to":"repository","readonly":true}],"title":"name","date":null,"project":null,"order":null,"slip":{"title":"name","subtitle":"meta","trailing":null,"photo":null,"toggle":null},"tile":{"face":"slip-list"},"page":[{"heading":null,"columns":["name","color","description"]},{"heading":"Details","columns":["origin","repo_id"]}],"empty":{"title":"No labels.","message":"This repository has no labels yet."},"instructions":"A label is one word of a repository's label vocabulary, which its pull requests and issues can wear. Its colour is six hexadecimal digits the host draws it in; Cotton prints the word. Renaming or deleting one on a git host changes every pull request and issue carrying it.","commands":[{"id":"edit","object": "edit","label":"Edit","kind":"update","method":"repo.editLabel","bindings":{"id":"repo_id","name":"name","color":"color","description":"description"},"receipt":"Updated label"},{"id":"delete","label":"Delete","kind":"delete","method":"repo.deleteLabel","bindings":{"id":"repo_id","name":"name"},"confirm":"Delete this label?","receipt":"Deleted","does":"destroys"}],"delete":false,  "tables": [    {      "name": "cotton_repo_labels",      "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": "repo_id",          "type": "TEXT",          "default": null,          "nullable": false,          "primary_key": false,          "declaration": "\n    repo_id TEXT NOT NULL",          "position": 2        },        {          "name": "name",          "type": "TEXT",          "default": null,          "nullable": false,          "primary_key": false,          "declaration": "\n    name TEXT NOT NULL",          "position": 3        },        {          "name": "color",          "type": "TEXT",          "default": null,          "nullable": true,          "primary_key": false,          "declaration": "\n    color TEXT",          "position": 4        },        {          "name": "description",          "type": "TEXT",          "default": null,          "nullable": true,          "primary_key": false,          "declaration": "\n    description TEXT",          "position": 5        },        {          "name": "remote_id",          "type": "INTEGER",          "default": null,          "nullable": true,          "primary_key": false,          "declaration": "\n    remote_id INTEGER",          "position": 6        },        {          "name": "created_at",          "type": "TEXT",          "default": null,          "nullable": false,          "primary_key": false,          "declaration": "\n    created_at TEXT NOT NULL",          "position": 7        },        {          "name": "updated_at",          "type": "TEXT",          "default": null,          "nullable": false,          "primary_key": false,          "declaration": "\n    updated_at TEXT NOT NULL",          "position": 8        },        {          "name": "_hlc",          "type": "TEXT",          "default": "''",          "nullable": false,          "primary_key": false,          "declaration": "\n    _hlc TEXT NOT NULL DEFAULT ''",          "position": 9        },        {          "name": "_born",          "type": "TEXT",          "default": null,          "nullable": true,          "primary_key": false,          "declaration": "\n    _born TEXT",          "position": 10        }      ],      "constraints": [        {          "declaration": "\n    UNIQUE (workspace_id, repo_id, name)",          "position": 11        },        {          "declaration": "\n    CHECK (length(trim(name)) > 0)",          "position": 12        },        {          "declaration": "\n    FOREIGN KEY (workspace_id) REFERENCES cotton_workspaces(id) ON DELETE CASCADE",          "position": 13        },        {          "declaration": "\n    FOREIGN KEY (repo_id) REFERENCES cotton_repos(id)\n  ",          "position": 14        }      ],      "prefix": "CREATE TABLE IF NOT EXISTS cotton_repo_labels (",      "suffix": ")",      "indexes": [        "CREATE INDEX IF NOT EXISTS idx_cotton_repo_labels_repo ON cotton_repo_labels (workspace_id, repo_id, name)",        "CREATE INDEX IF NOT EXISTS idx_cotton_repo_labels_author ON cotton_repo_labels (substr(_hlc, 20), _hlc)"      ],      "full_text": [],      "triggers": []    }  ]}