···11+// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
22+33+package tangled
44+55+// schema: sh.tangled.git.listRefs
66+77+import (
88+ "context"
99+1010+ "github.com/bluesky-social/indigo/lex/util"
1111+)
1212+1313+const (
1414+ GitListRefsNSID = "sh.tangled.git.listRefs"
1515+)
1616+1717+// GitListRefs_DefaultBranch is a "defaultBranch" in the sh.tangled.git.listRefs schema.
1818+type GitListRefs_DefaultBranch struct {
1919+ // 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.
2020+ Head *string `json:"head,omitempty" cborgen:"head,omitempty"`
2121+ // ref: Default branch ref name that HEAD points at, eg. refs/heads/main.
2222+ Ref string `json:"ref" cborgen:"ref"`
2323+}
2424+2525+// GitListRefs_Output is the output of a sh.tangled.git.listRefs call.
2626+type GitListRefs_Output struct {
2727+ // cursor: Cursor for the next page, absent when the last page is reached
2828+ Cursor *string `json:"cursor,omitempty" cborgen:"cursor,omitempty"`
2929+ DefaultBranch *GitListRefs_DefaultBranch `json:"defaultBranch,omitempty" cborgen:"defaultBranch,omitempty"`
3030+ Refs []*GitListRefs_Ref `json:"refs" cborgen:"refs"`
3131+}
3232+3333+// GitListRefs_Ref is a "ref" in the sh.tangled.git.listRefs schema.
3434+type GitListRefs_Ref struct {
3535+ // ref: Full ref name, eg. refs/heads/main or refs/tags/v1.0
3636+ Ref string `json:"ref" cborgen:"ref"`
3737+ // sha: Object SHA the ref points at. Width depends on the repo's git object-format.
3838+ Sha string `json:"sha" cborgen:"sha"`
3939+}
4040+4141+// GitListRefs calls the XRPC method "sh.tangled.git.listRefs".
4242+//
4343+// cursor: Pagination cursor
4444+// limit: Maximum number of refs to return in this page
4545+// repo: DID of the git repo as minted by the knot
4646+func GitListRefs(ctx context.Context, c util.LexClient, cursor string, limit int64, repo string) (*GitListRefs_Output, error) {
4747+ var out GitListRefs_Output
4848+4949+ params := map[string]interface{}{}
5050+ if cursor != "" {
5151+ params["cursor"] = cursor
5252+ }
5353+ if limit != 0 {
5454+ params["limit"] = limit
5555+ }
5656+ params["repo"] = repo
5757+ if err := c.LexDo(ctx, util.Query, "", "sh.tangled.git.listRefs", params, nil, &out); err != nil {
5858+ return nil, err
5959+ }
6060+6161+ return &out, nil
6262+}
+62
api/tangled/synclistRepos.go
···11+// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
22+33+package tangled
44+55+// schema: sh.tangled.sync.listRepos
66+77+import (
88+ "context"
99+1010+ "github.com/bluesky-social/indigo/lex/util"
1111+)
1212+1313+const (
1414+ SyncListReposNSID = "sh.tangled.sync.listRepos"
1515+)
1616+1717+// SyncListRepos_DefaultBranch is a "defaultBranch" in the sh.tangled.sync.listRepos schema.
1818+type SyncListRepos_DefaultBranch struct {
1919+ // 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.
2020+ Head *string `json:"head,omitempty" cborgen:"head,omitempty"`
2121+ // ref: Default branch ref name, eg. refs/heads/main.
2222+ Ref string `json:"ref" cborgen:"ref"`
2323+}
2424+2525+// SyncListRepos_Output is the output of a sh.tangled.sync.listRepos call.
2626+type SyncListRepos_Output struct {
2727+ Cursor *string `json:"cursor,omitempty" cborgen:"cursor,omitempty"`
2828+ Repos []*SyncListRepos_Repo `json:"repos" cborgen:"repos"`
2929+}
3030+3131+// SyncListRepos_Repo is a "repo" in the sh.tangled.sync.listRepos schema.
3232+type SyncListRepos_Repo struct {
3333+ DefaultBranch *SyncListRepos_DefaultBranch `json:"defaultBranch,omitempty" cborgen:"defaultBranch,omitempty"`
3434+ // repo: DID of the git repo as minted by the knot
3535+ Repo string `json:"repo" cborgen:"repo"`
3636+ // status: Serving status of the repo according to the knot.
3737+ Status string `json:"status" cborgen:"status"`
3838+}
3939+4040+// SyncListRepos calls the XRPC method "sh.tangled.sync.listRepos".
4141+//
4242+// cursor: Pagination cursor
4343+// order: Sort direction over the service's repo listing order.
4444+func SyncListRepos(ctx context.Context, c util.LexClient, cursor string, limit int64, order string) (*SyncListRepos_Output, error) {
4545+ var out SyncListRepos_Output
4646+4747+ params := map[string]interface{}{}
4848+ if cursor != "" {
4949+ params["cursor"] = cursor
5050+ }
5151+ if limit != 0 {
5252+ params["limit"] = limit
5353+ }
5454+ if order != "" {
5555+ params["order"] = order
5656+ }
5757+ if err := c.LexDo(ctx, util.Query, "", "sh.tangled.sync.listRepos", params, nil, &out); err != nil {
5858+ return nil, err
5959+ }
6060+6161+ return &out, nil
6262+}
+100
lexicons/git/listRefs.json
···11+{
22+ "lexicon": 1,
33+ "id": "sh.tangled.git.listRefs",
44+ "defs": {
55+ "main": {
66+ "type": "query",
77+ "description": "List every ref & its commit SHA for a git repo, equivalent to git ls-remote. Gives the full ref state of a repo.",
88+ "parameters": {
99+ "type": "params",
1010+ "required": ["repo"],
1111+ "properties": {
1212+ "repo": {
1313+ "type": "string",
1414+ "format": "did",
1515+ "description": "DID of the git repo as minted by the knot"
1616+ },
1717+ "limit": {
1818+ "type": "integer",
1919+ "minimum": 1,
2020+ "maximum": 1000,
2121+ "default": 100,
2222+ "description": "Maximum number of refs to return in this page"
2323+ },
2424+ "cursor": {
2525+ "type": "string",
2626+ "description": "Pagination cursor"
2727+ }
2828+ }
2929+ },
3030+ "output": {
3131+ "encoding": "application/json",
3232+ "schema": {
3333+ "type": "object",
3434+ "required": ["refs"],
3535+ "properties": {
3636+ "refs": {
3737+ "type": "array",
3838+ "items": { "type": "ref", "ref": "#ref" },
3939+ "maxLength": 1000
4040+ },
4141+ "cursor": {
4242+ "type": "string",
4343+ "description": "Cursor for the next page, absent when the last page is reached"
4444+ },
4545+ "defaultBranch": {
4646+ "type": "ref",
4747+ "ref": "#defaultBranch"
4848+ }
4949+ }
5050+ }
5151+ },
5252+ "errors": [
5353+ {
5454+ "name": "RepoNotFound",
5555+ "description": "Repo is not registered on this knot"
5656+ },
5757+ {
5858+ "name": "InvalidRequest",
5959+ "description": "Invalid request parameters"
6060+ }
6161+ ]
6262+ },
6363+ "ref": {
6464+ "type": "object",
6565+ "required": ["ref", "sha"],
6666+ "properties": {
6767+ "ref": {
6868+ "type": "string",
6969+ "description": "Full ref name, eg. refs/heads/main or refs/tags/v1.0",
7070+ "maxGraphemes": 256,
7171+ "maxLength": 2560
7272+ },
7373+ "sha": {
7474+ "type": "string",
7575+ "description": "Object SHA the ref points at. Width depends on the repo's git object-format.",
7676+ "minLength": 40,
7777+ "maxLength": 128
7878+ }
7979+ }
8080+ },
8181+ "defaultBranch": {
8282+ "type": "object",
8383+ "required": ["ref"],
8484+ "properties": {
8585+ "ref": {
8686+ "type": "string",
8787+ "description": "Default branch ref name that HEAD points at, eg. refs/heads/main.",
8888+ "maxGraphemes": 256,
8989+ "maxLength": 2560
9090+ },
9191+ "head": {
9292+ "type": "string",
9393+ "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.",
9494+ "minLength": 40,
9595+ "maxLength": 128
9696+ }
9797+ }
9898+ }
9999+ }
100100+}
+1
lexicons/repo/describeRepo.json
···3333 },
3434 "rkey": {
3535 "type": "string",
3636+ "format": "record-key",
3637 "description": "Current rkey of the sh.tangled.repo record tracked by this knot"
3738 }
3839 }