Monorepo for Tangled tangled.org
2

Configure Feed

Select the types of activity you want to include in your feed.

lexicons/sync: getRepoRefs & listRepos

Lewis: May this revision serve well! <lewis@tangled.org>

author
Lewis
committer
Tangled
date (Jun 23, 2026, 7:19 PM +0300) commit 46d18d69 parent 8f7170fd change-id yrzxwnnv
+315
+62
api/tangled/gitlistRefs.go
··· 1 + // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. 2 + 3 + package tangled 4 + 5 + // schema: sh.tangled.git.listRefs 6 + 7 + import ( 8 + "context" 9 + 10 + "github.com/bluesky-social/indigo/lex/util" 11 + ) 12 + 13 + const ( 14 + GitListRefsNSID = "sh.tangled.git.listRefs" 15 + ) 16 + 17 + // GitListRefs_DefaultBranch is a "defaultBranch" in the sh.tangled.git.listRefs schema. 18 + type GitListRefs_DefaultBranch struct { 19 + // head: 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. 20 + Head *string `json:"head,omitempty" cborgen:"head,omitempty"` 21 + // ref: Default branch ref name that HEAD points at, eg. refs/heads/main. 22 + Ref string `json:"ref" cborgen:"ref"` 23 + } 24 + 25 + // GitListRefs_Output is the output of a sh.tangled.git.listRefs call. 26 + type GitListRefs_Output struct { 27 + // cursor: Cursor for the next page, absent when the last page is reached 28 + Cursor *string `json:"cursor,omitempty" cborgen:"cursor,omitempty"` 29 + DefaultBranch *GitListRefs_DefaultBranch `json:"defaultBranch,omitempty" cborgen:"defaultBranch,omitempty"` 30 + Refs []*GitListRefs_Ref `json:"refs" cborgen:"refs"` 31 + } 32 + 33 + // GitListRefs_Ref is a "ref" in the sh.tangled.git.listRefs schema. 34 + type GitListRefs_Ref struct { 35 + // ref: Full ref name, eg. refs/heads/main or refs/tags/v1.0 36 + Ref string `json:"ref" cborgen:"ref"` 37 + // sha: Object SHA the ref points at. Width depends on the repo's git object-format. 38 + Sha string `json:"sha" cborgen:"sha"` 39 + } 40 + 41 + // GitListRefs calls the XRPC method "sh.tangled.git.listRefs". 42 + // 43 + // cursor: Pagination cursor 44 + // limit: Maximum number of refs to return in this page 45 + // repo: DID of the git repo as minted by the knot 46 + func GitListRefs(ctx context.Context, c util.LexClient, cursor string, limit int64, repo string) (*GitListRefs_Output, error) { 47 + var out GitListRefs_Output 48 + 49 + params := map[string]interface{}{} 50 + if cursor != "" { 51 + params["cursor"] = cursor 52 + } 53 + if limit != 0 { 54 + params["limit"] = limit 55 + } 56 + params["repo"] = repo 57 + if err := c.LexDo(ctx, util.Query, "", "sh.tangled.git.listRefs", params, nil, &out); err != nil { 58 + return nil, err 59 + } 60 + 61 + return &out, nil 62 + }
+62
api/tangled/synclistRepos.go
··· 1 + // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. 2 + 3 + package tangled 4 + 5 + // schema: sh.tangled.sync.listRepos 6 + 7 + import ( 8 + "context" 9 + 10 + "github.com/bluesky-social/indigo/lex/util" 11 + ) 12 + 13 + const ( 14 + SyncListReposNSID = "sh.tangled.sync.listRepos" 15 + ) 16 + 17 + // SyncListRepos_DefaultBranch is a "defaultBranch" in the sh.tangled.sync.listRepos schema. 18 + type SyncListRepos_DefaultBranch struct { 19 + // head: 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. 20 + Head *string `json:"head,omitempty" cborgen:"head,omitempty"` 21 + // ref: Default branch ref name, eg. refs/heads/main. 22 + Ref string `json:"ref" cborgen:"ref"` 23 + } 24 + 25 + // SyncListRepos_Output is the output of a sh.tangled.sync.listRepos call. 26 + type SyncListRepos_Output struct { 27 + Cursor *string `json:"cursor,omitempty" cborgen:"cursor,omitempty"` 28 + Repos []*SyncListRepos_Repo `json:"repos" cborgen:"repos"` 29 + } 30 + 31 + // SyncListRepos_Repo is a "repo" in the sh.tangled.sync.listRepos schema. 32 + type SyncListRepos_Repo struct { 33 + DefaultBranch *SyncListRepos_DefaultBranch `json:"defaultBranch,omitempty" cborgen:"defaultBranch,omitempty"` 34 + // repo: DID of the git repo as minted by the knot 35 + Repo string `json:"repo" cborgen:"repo"` 36 + // status: Serving status of the repo according to the knot. 37 + Status string `json:"status" cborgen:"status"` 38 + } 39 + 40 + // SyncListRepos calls the XRPC method "sh.tangled.sync.listRepos". 41 + // 42 + // cursor: Pagination cursor 43 + // order: Sort direction over the service's repo listing order. 44 + func SyncListRepos(ctx context.Context, c util.LexClient, cursor string, limit int64, order string) (*SyncListRepos_Output, error) { 45 + var out SyncListRepos_Output 46 + 47 + params := map[string]interface{}{} 48 + if cursor != "" { 49 + params["cursor"] = cursor 50 + } 51 + if limit != 0 { 52 + params["limit"] = limit 53 + } 54 + if order != "" { 55 + params["order"] = order 56 + } 57 + if err := c.LexDo(ctx, util.Query, "", "sh.tangled.sync.listRepos", params, nil, &out); err != nil { 58 + return nil, err 59 + } 60 + 61 + return &out, nil 62 + }
+100
lexicons/git/listRefs.json
··· 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 + }
+1
lexicons/repo/describeRepo.json
··· 33 33 }, 34 34 "rkey": { 35 35 "type": "string", 36 + "format": "record-key", 36 37 "description": "Current rkey of the sh.tangled.repo record tracked by this knot" 37 38 } 38 39 }
+90
lexicons/sync/listRepos.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "sh.tangled.sync.listRepos", 4 + "defs": { 5 + "main": { 6 + "type": "query", 7 + "description": "List git repos hosted on this service.", 8 + "parameters": { 9 + "type": "params", 10 + "properties": { 11 + "cursor": { 12 + "type": "string", 13 + "description": "Pagination cursor" 14 + }, 15 + "limit": { 16 + "type": "integer", 17 + "minimum": 1, 18 + "maximum": 1000, 19 + "default": 50 20 + }, 21 + "order": { 22 + "type": "string", 23 + "knownValues": ["asc", "desc"], 24 + "default": "desc", 25 + "description": "Sort direction over the service's repo listing order." 26 + } 27 + } 28 + }, 29 + "output": { 30 + "encoding": "application/json", 31 + "schema": { 32 + "type": "object", 33 + "required": ["repos"], 34 + "properties": { 35 + "repos": { 36 + "type": "array", 37 + "items": { "type": "ref", "ref": "#repo" }, 38 + "maxLength": 1000 39 + }, 40 + "cursor": { "type": "string" } 41 + } 42 + } 43 + }, 44 + "errors": [ 45 + { 46 + "name": "InvalidRequest", 47 + "description": "Invalid request parameters" 48 + } 49 + ] 50 + }, 51 + "repo": { 52 + "type": "object", 53 + "required": ["repo", "status"], 54 + "properties": { 55 + "repo": { 56 + "type": "string", 57 + "format": "did", 58 + "description": "DID of the git repo as minted by the knot" 59 + }, 60 + "status": { 61 + "type": "string", 62 + "knownValues": ["active", "archived", "disabled"], 63 + "description": "Serving status of the repo according to the knot." 64 + }, 65 + "defaultBranch": { 66 + "type": "ref", 67 + "ref": "#defaultBranch" 68 + } 69 + } 70 + }, 71 + "defaultBranch": { 72 + "type": "object", 73 + "required": ["ref"], 74 + "properties": { 75 + "ref": { 76 + "type": "string", 77 + "description": "Default branch ref name, eg. refs/heads/main.", 78 + "maxGraphemes": 256, 79 + "maxLength": 2560 80 + }, 81 + "head": { 82 + "type": "string", 83 + "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.", 84 + "minLength": 40, 85 + "maxLength": 128 86 + } 87 + } 88 + } 89 + } 90 + }