Monorepo for Tangled
tangled.org
1{
2 "lexicon": 1,
3 "id": "sh.tangled.git.listRefs",
4 "defs": {
5 "main": {
6 "type": "query",
7 "description": "List every ref & its commit SHA for a git repo, equivalent to git ls-remote. Gives the full ref state of a repo.",
8 "parameters": {
9 "type": "params",
10 "required": ["repo"],
11 "properties": {
12 "repo": {
13 "type": "string",
14 "format": "did",
15 "description": "DID of the git repo as minted by the knot"
16 },
17 "limit": {
18 "type": "integer",
19 "minimum": 1,
20 "maximum": 1000,
21 "default": 100,
22 "description": "Maximum number of refs to return in this page"
23 },
24 "cursor": {
25 "type": "string",
26 "description": "Pagination cursor"
27 }
28 }
29 },
30 "output": {
31 "encoding": "application/json",
32 "schema": {
33 "type": "object",
34 "required": ["refs"],
35 "properties": {
36 "refs": {
37 "type": "array",
38 "items": { "type": "ref", "ref": "#ref" },
39 "maxLength": 1000
40 },
41 "cursor": {
42 "type": "string",
43 "description": "Cursor for the next page, absent when the last page is reached"
44 },
45 "defaultBranch": {
46 "type": "ref",
47 "ref": "#defaultBranch"
48 }
49 }
50 }
51 },
52 "errors": [
53 {
54 "name": "RepoNotFound",
55 "description": "Repo is not registered on this knot"
56 },
57 {
58 "name": "InvalidRequest",
59 "description": "Invalid request parameters"
60 }
61 ]
62 },
63 "ref": {
64 "type": "object",
65 "required": ["ref", "sha"],
66 "properties": {
67 "ref": {
68 "type": "string",
69 "description": "Full ref name, eg. refs/heads/main or refs/tags/v1.0",
70 "maxGraphemes": 256,
71 "maxLength": 2560
72 },
73 "sha": {
74 "type": "string",
75 "description": "Object SHA the ref points at. Width depends on the repo's git object-format.",
76 "minLength": 40,
77 "maxLength": 128
78 }
79 }
80 },
81 "defaultBranch": {
82 "type": "object",
83 "required": ["ref"],
84 "properties": {
85 "ref": {
86 "type": "string",
87 "description": "Default branch ref name that HEAD points at, eg. refs/heads/main.",
88 "maxGraphemes": 256,
89 "maxLength": 2560
90 },
91 "head": {
92 "type": "string",
93 "description": "Commit SHA at the tip of the default branch, for reconciling against a last-known state. Width depends on the repo's git object-format.",
94 "minLength": 40,
95 "maxLength": 128
96 }
97 }
98 }
99 }
100}