forked from tangled.org/core
Monorepo for Tangled — https://tangled.org

lexicons,api: generate xrpc defs for all the things

Signed-off-by: Anirudh Oppiliappan <anirudh@tangled.sh>

+35
api/tangled/knothealth.go
···
+
// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
+
+
package tangled
+
+
// schema: sh.tangled.knot.health
+
+
import (
+
"context"
+
+
"github.com/bluesky-social/indigo/lex/util"
+
)
+
+
const (
+
KnotHealthNSID = "sh.tangled.knot.health"
+
)
+
+
// KnotHealth_Output is the output of a sh.tangled.knot.health call.
+
type KnotHealth_Output struct {
+
// status: Health status of the knot
+
Status string `json:"status" cborgen:"status"`
+
// timestamp: Timestamp of the health check
+
Timestamp *string `json:"timestamp,omitempty" cborgen:"timestamp,omitempty"`
+
// version: Version of the knot server
+
Version *string `json:"version,omitempty" cborgen:"version,omitempty"`
+
}
+
+
// KnotHealth calls the XRPC method "sh.tangled.knot.health".
+
func KnotHealth(ctx context.Context, c util.LexClient) (*KnotHealth_Output, error) {
+
var out KnotHealth_Output
+
if err := c.LexDo(ctx, util.Query, "", "sh.tangled.knot.health", nil, nil, &out); err != nil {
+
return nil, err
+
}
+
+
return &out, nil
+
}
+34
api/tangled/repocreate.go
···
+
// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
+
+
package tangled
+
+
// schema: sh.tangled.repo.create
+
+
import (
+
"context"
+
+
"github.com/bluesky-social/indigo/lex/util"
+
)
+
+
const (
+
RepoCreateNSID = "sh.tangled.repo.create"
+
)
+
+
// RepoCreate_Input is the input argument to a sh.tangled.repo.create call.
+
type RepoCreate_Input struct {
+
// defaultBranch: Default branch to push to
+
DefaultBranch *string `json:"defaultBranch,omitempty" cborgen:"defaultBranch,omitempty"`
+
// rkey: Rkey of the repository record
+
Rkey string `json:"rkey" cborgen:"rkey"`
+
// source: A source URL to clone from, populate this when forking or importing a repository.
+
Source *string `json:"source,omitempty" cborgen:"source,omitempty"`
+
}
+
+
// RepoCreate calls the XRPC method "sh.tangled.repo.create".
+
func RepoCreate(ctx context.Context, c util.LexClient, input *RepoCreate_Input) error {
+
if err := c.LexDo(ctx, util.Procedure, "application/json", "sh.tangled.repo.create", nil, input, nil); err != nil {
+
return err
+
}
+
+
return nil
+
}
+32
api/tangled/repodelete.go
···
+
// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
+
+
package tangled
+
+
// schema: sh.tangled.repo.delete
+
+
import (
+
"context"
+
+
"github.com/bluesky-social/indigo/lex/util"
+
)
+
+
const (
+
RepoDeleteNSID = "sh.tangled.repo.delete"
+
)
+
+
// RepoDelete_Input is the input argument to a sh.tangled.repo.delete call.
+
type RepoDelete_Input struct {
+
// did: DID of the repository owner
+
Did string `json:"did" cborgen:"did"`
+
// name: Name of the repository to delete
+
Name string `json:"name" cborgen:"name"`
+
}
+
+
// RepoDelete calls the XRPC method "sh.tangled.repo.delete".
+
func RepoDelete(ctx context.Context, c util.LexClient, input *RepoDelete_Input) error {
+
if err := c.LexDo(ctx, util.Procedure, "application/json", "sh.tangled.repo.delete", nil, input, nil); err != nil {
+
return err
+
}
+
+
return nil
+
}
+45
api/tangled/repoforkStatus.go
···
+
// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
+
+
package tangled
+
+
// schema: sh.tangled.repo.forkStatus
+
+
import (
+
"context"
+
+
"github.com/bluesky-social/indigo/lex/util"
+
)
+
+
const (
+
RepoForkStatusNSID = "sh.tangled.repo.forkStatus"
+
)
+
+
// RepoForkStatus_Input is the input argument to a sh.tangled.repo.forkStatus call.
+
type RepoForkStatus_Input struct {
+
// branch: Branch to check status for
+
Branch string `json:"branch" cborgen:"branch"`
+
// did: DID of the fork owner
+
Did string `json:"did" cborgen:"did"`
+
// hiddenRef: Hidden ref to use for comparison
+
HiddenRef string `json:"hiddenRef" cborgen:"hiddenRef"`
+
// name: Name of the forked repository
+
Name string `json:"name" cborgen:"name"`
+
// source: Source repository URL
+
Source string `json:"source" cborgen:"source"`
+
}
+
+
// RepoForkStatus_Output is the output of a sh.tangled.repo.forkStatus call.
+
type RepoForkStatus_Output struct {
+
// status: Fork status: 0=UpToDate, 1=FastForwardable, 2=Conflict, 3=MissingBranch
+
Status int64 `json:"status" cborgen:"status"`
+
}
+
+
// RepoForkStatus calls the XRPC method "sh.tangled.repo.forkStatus".
+
func RepoForkStatus(ctx context.Context, c util.LexClient, input *RepoForkStatus_Input) (*RepoForkStatus_Output, error) {
+
var out RepoForkStatus_Output
+
if err := c.LexDo(ctx, util.Procedure, "application/json", "sh.tangled.repo.forkStatus", nil, input, &out); err != nil {
+
return nil, err
+
}
+
+
return &out, nil
+
}
+36
api/tangled/repoforkSync.go
···
+
// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
+
+
package tangled
+
+
// schema: sh.tangled.repo.forkSync
+
+
import (
+
"context"
+
+
"github.com/bluesky-social/indigo/lex/util"
+
)
+
+
const (
+
RepoForkSyncNSID = "sh.tangled.repo.forkSync"
+
)
+
+
// RepoForkSync_Input is the input argument to a sh.tangled.repo.forkSync call.
+
type RepoForkSync_Input struct {
+
// branch: Branch to sync
+
Branch string `json:"branch" cborgen:"branch"`
+
// did: DID of the fork owner
+
Did string `json:"did" cborgen:"did"`
+
// name: Name of the forked repository
+
Name string `json:"name" cborgen:"name"`
+
// source: AT-URI of the source repository
+
Source string `json:"source" cborgen:"source"`
+
}
+
+
// RepoForkSync calls the XRPC method "sh.tangled.repo.forkSync".
+
func RepoForkSync(ctx context.Context, c util.LexClient, input *RepoForkSync_Input) error {
+
if err := c.LexDo(ctx, util.Procedure, "application/json", "sh.tangled.repo.forkSync", nil, input, nil); err != nil {
+
return err
+
}
+
+
return nil
+
}
+45
api/tangled/repohiddenRef.go
···
+
// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
+
+
package tangled
+
+
// schema: sh.tangled.repo.hiddenRef
+
+
import (
+
"context"
+
+
"github.com/bluesky-social/indigo/lex/util"
+
)
+
+
const (
+
RepoHiddenRefNSID = "sh.tangled.repo.hiddenRef"
+
)
+
+
// RepoHiddenRef_Input is the input argument to a sh.tangled.repo.hiddenRef call.
+
type RepoHiddenRef_Input struct {
+
// forkRef: Fork reference name
+
ForkRef string `json:"forkRef" cborgen:"forkRef"`
+
// remoteRef: Remote reference name
+
RemoteRef string `json:"remoteRef" cborgen:"remoteRef"`
+
// repo: AT-URI of the repository
+
Repo string `json:"repo" cborgen:"repo"`
+
}
+
+
// RepoHiddenRef_Output is the output of a sh.tangled.repo.hiddenRef call.
+
type RepoHiddenRef_Output struct {
+
// error: Error message if creation failed
+
Error *string `json:"error,omitempty" cborgen:"error,omitempty"`
+
// ref: The created hidden ref name
+
Ref *string `json:"ref,omitempty" cborgen:"ref,omitempty"`
+
// success: Whether the hidden ref was created successfully
+
Success bool `json:"success" cborgen:"success"`
+
}
+
+
// RepoHiddenRef calls the XRPC method "sh.tangled.repo.hiddenRef".
+
func RepoHiddenRef(ctx context.Context, c util.LexClient, input *RepoHiddenRef_Input) (*RepoHiddenRef_Output, error) {
+
var out RepoHiddenRef_Output
+
if err := c.LexDo(ctx, util.Procedure, "application/json", "sh.tangled.repo.hiddenRef", nil, input, &out); err != nil {
+
return nil, err
+
}
+
+
return &out, nil
+
}
+44
api/tangled/repomerge.go
···
+
// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
+
+
package tangled
+
+
// schema: sh.tangled.repo.merge
+
+
import (
+
"context"
+
+
"github.com/bluesky-social/indigo/lex/util"
+
)
+
+
const (
+
RepoMergeNSID = "sh.tangled.repo.merge"
+
)
+
+
// RepoMerge_Input is the input argument to a sh.tangled.repo.merge call.
+
type RepoMerge_Input struct {
+
// authorEmail: Author email for the merge commit
+
AuthorEmail *string `json:"authorEmail,omitempty" cborgen:"authorEmail,omitempty"`
+
// authorName: Author name for the merge commit
+
AuthorName *string `json:"authorName,omitempty" cborgen:"authorName,omitempty"`
+
// branch: Target branch to merge into
+
Branch string `json:"branch" cborgen:"branch"`
+
// commitBody: Additional commit message body
+
CommitBody *string `json:"commitBody,omitempty" cborgen:"commitBody,omitempty"`
+
// commitMessage: Merge commit message
+
CommitMessage *string `json:"commitMessage,omitempty" cborgen:"commitMessage,omitempty"`
+
// did: DID of the repository owner
+
Did string `json:"did" cborgen:"did"`
+
// name: Name of the repository
+
Name string `json:"name" cborgen:"name"`
+
// patch: Patch content to merge
+
Patch string `json:"patch" cborgen:"patch"`
+
}
+
+
// RepoMerge calls the XRPC method "sh.tangled.repo.merge".
+
func RepoMerge(ctx context.Context, c util.LexClient, input *RepoMerge_Input) error {
+
if err := c.LexDo(ctx, util.Procedure, "application/json", "sh.tangled.repo.merge", nil, input, nil); err != nil {
+
return err
+
}
+
+
return nil
+
}
+57
api/tangled/repomergeCheck.go
···
+
// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
+
+
package tangled
+
+
// schema: sh.tangled.repo.mergeCheck
+
+
import (
+
"context"
+
+
"github.com/bluesky-social/indigo/lex/util"
+
)
+
+
const (
+
RepoMergeCheckNSID = "sh.tangled.repo.mergeCheck"
+
)
+
+
// RepoMergeCheck_ConflictInfo is a "conflictInfo" in the sh.tangled.repo.mergeCheck schema.
+
type RepoMergeCheck_ConflictInfo struct {
+
// filename: Name of the conflicted file
+
Filename string `json:"filename" cborgen:"filename"`
+
// reason: Reason for the conflict
+
Reason string `json:"reason" cborgen:"reason"`
+
}
+
+
// RepoMergeCheck_Input is the input argument to a sh.tangled.repo.mergeCheck call.
+
type RepoMergeCheck_Input struct {
+
// branch: Target branch to merge into
+
Branch string `json:"branch" cborgen:"branch"`
+
// did: DID of the repository owner
+
Did string `json:"did" cborgen:"did"`
+
// name: Name of the repository
+
Name string `json:"name" cborgen:"name"`
+
// patch: Patch or pull request to check for merge conflicts
+
Patch string `json:"patch" cborgen:"patch"`
+
}
+
+
// RepoMergeCheck_Output is the output of a sh.tangled.repo.mergeCheck call.
+
type RepoMergeCheck_Output struct {
+
// conflicts: List of files with merge conflicts
+
Conflicts []*RepoMergeCheck_ConflictInfo `json:"conflicts,omitempty" cborgen:"conflicts,omitempty"`
+
// error: Error message if check failed
+
Error *string `json:"error,omitempty" cborgen:"error,omitempty"`
+
// is_conflicted: Whether the merge has conflicts
+
Is_conflicted bool `json:"is_conflicted" cborgen:"is_conflicted"`
+
// message: Additional message about the merge check
+
Message *string `json:"message,omitempty" cborgen:"message,omitempty"`
+
}
+
+
// RepoMergeCheck calls the XRPC method "sh.tangled.repo.mergeCheck".
+
func RepoMergeCheck(ctx context.Context, c util.LexClient, input *RepoMergeCheck_Input) (*RepoMergeCheck_Output, error) {
+
var out RepoMergeCheck_Output
+
if err := c.LexDo(ctx, util.Procedure, "application/json", "sh.tangled.repo.mergeCheck", nil, input, &out); err != nil {
+
return nil, err
+
}
+
+
return &out, nil
+
}
+24
lexicons/knot/knot.json
···
+
{
+
"lexicon": 1,
+
"id": "sh.tangled.knot",
+
"needsCbor": true,
+
"needsType": true,
+
"defs": {
+
"main": {
+
"type": "record",
+
"key": "any",
+
"record": {
+
"type": "object",
+
"required": [
+
"createdAt"
+
],
+
"properties": {
+
"createdAt": {
+
"type": "string",
+
"format": "datetime"
+
}
+
}
+
}
+
}
+
}
+
}
+33
lexicons/repo/create.json
···
+
{
+
"lexicon": 1,
+
"id": "sh.tangled.repo.create",
+
"defs": {
+
"main": {
+
"type": "procedure",
+
"description": "Create a new repository",
+
"input": {
+
"encoding": "application/json",
+
"schema": {
+
"type": "object",
+
"required": [
+
"rkey"
+
],
+
"properties": {
+
"rkey": {
+
"type": "string",
+
"description": "Rkey of the repository record"
+
},
+
"defaultBranch": {
+
"type": "string",
+
"description": "Default branch to push to"
+
},
+
"source": {
+
"type": "string",
+
"description": "A source URL to clone from, populate this when forking or importing a repository."
+
}
+
}
+
}
+
}
+
}
+
}
+
}
+28
lexicons/repo/delete.json
···
+
{
+
"lexicon": 1,
+
"id": "sh.tangled.repo.delete",
+
"defs": {
+
"main": {
+
"type": "procedure",
+
"description": "Delete a repository",
+
"input": {
+
"encoding": "application/json",
+
"schema": {
+
"type": "object",
+
"required": ["did", "name"],
+
"properties": {
+
"did": {
+
"type": "string",
+
"format": "did",
+
"description": "DID of the repository owner"
+
},
+
"name": {
+
"type": "string",
+
"description": "Name of the repository to delete"
+
}
+
}
+
}
+
}
+
}
+
}
+
}
+53
lexicons/repo/forkStatus.json
···
+
{
+
"lexicon": 1,
+
"id": "sh.tangled.repo.forkStatus",
+
"defs": {
+
"main": {
+
"type": "procedure",
+
"description": "Check fork status relative to upstream source",
+
"input": {
+
"encoding": "application/json",
+
"schema": {
+
"type": "object",
+
"required": ["did", "name", "source", "branch", "hiddenRef"],
+
"properties": {
+
"did": {
+
"type": "string",
+
"format": "did",
+
"description": "DID of the fork owner"
+
},
+
"name": {
+
"type": "string",
+
"description": "Name of the forked repository"
+
},
+
"source": {
+
"type": "string",
+
"description": "Source repository URL"
+
},
+
"branch": {
+
"type": "string",
+
"description": "Branch to check status for"
+
},
+
"hiddenRef": {
+
"type": "string",
+
"description": "Hidden ref to use for comparison"
+
}
+
}
+
}
+
},
+
"output": {
+
"encoding": "application/json",
+
"schema": {
+
"type": "object",
+
"required": ["status"],
+
"properties": {
+
"status": {
+
"type": "integer",
+
"description": "Fork status: 0=UpToDate, 1=FastForwardable, 2=Conflict, 3=MissingBranch"
+
}
+
}
+
}
+
}
+
}
+
}
+
}
+42
lexicons/repo/forkSync.json
···
+
{
+
"lexicon": 1,
+
"id": "sh.tangled.repo.forkSync",
+
"defs": {
+
"main": {
+
"type": "procedure",
+
"description": "Sync a forked repository with its upstream source",
+
"input": {
+
"encoding": "application/json",
+
"schema": {
+
"type": "object",
+
"required": [
+
"did",
+
"source",
+
"name",
+
"branch"
+
],
+
"properties": {
+
"did": {
+
"type": "string",
+
"format": "did",
+
"description": "DID of the fork owner"
+
},
+
"source": {
+
"type": "string",
+
"format": "at-uri",
+
"description": "AT-URI of the source repository"
+
},
+
"name": {
+
"type": "string",
+
"description": "Name of the forked repository"
+
},
+
"branch": {
+
"type": "string",
+
"description": "Branch to sync"
+
}
+
}
+
}
+
}
+
}
+
}
+
}
+59
lexicons/repo/hiddenRef.json
···
+
{
+
"lexicon": 1,
+
"id": "sh.tangled.repo.hiddenRef",
+
"defs": {
+
"main": {
+
"type": "procedure",
+
"description": "Create a hidden ref in a repository",
+
"input": {
+
"encoding": "application/json",
+
"schema": {
+
"type": "object",
+
"required": [
+
"repo",
+
"forkRef",
+
"remoteRef"
+
],
+
"properties": {
+
"repo": {
+
"type": "string",
+
"format": "at-uri",
+
"description": "AT-URI of the repository"
+
},
+
"forkRef": {
+
"type": "string",
+
"description": "Fork reference name"
+
},
+
"remoteRef": {
+
"type": "string",
+
"description": "Remote reference name"
+
}
+
}
+
}
+
},
+
"output": {
+
"encoding": "application/json",
+
"schema": {
+
"type": "object",
+
"required": [
+
"success"
+
],
+
"properties": {
+
"success": {
+
"type": "boolean",
+
"description": "Whether the hidden ref was created successfully"
+
},
+
"ref": {
+
"type": "string",
+
"description": "The created hidden ref name"
+
},
+
"error": {
+
"type": "string",
+
"description": "Error message if creation failed"
+
}
+
}
+
}
+
}
+
}
+
}
+
}
+52
lexicons/repo/merge.json
···
+
{
+
"lexicon": 1,
+
"id": "sh.tangled.repo.merge",
+
"defs": {
+
"main": {
+
"type": "procedure",
+
"description": "Merge a patch into a repository branch",
+
"input": {
+
"encoding": "application/json",
+
"schema": {
+
"type": "object",
+
"required": ["did", "name", "patch", "branch"],
+
"properties": {
+
"did": {
+
"type": "string",
+
"format": "did",
+
"description": "DID of the repository owner"
+
},
+
"name": {
+
"type": "string",
+
"description": "Name of the repository"
+
},
+
"patch": {
+
"type": "string",
+
"description": "Patch content to merge"
+
},
+
"branch": {
+
"type": "string",
+
"description": "Target branch to merge into"
+
},
+
"authorName": {
+
"type": "string",
+
"description": "Author name for the merge commit"
+
},
+
"authorEmail": {
+
"type": "string",
+
"description": "Author email for the merge commit"
+
},
+
"commitBody": {
+
"type": "string",
+
"description": "Additional commit message body"
+
},
+
"commitMessage": {
+
"type": "string",
+
"description": "Merge commit message"
+
}
+
}
+
}
+
}
+
}
+
}
+
}
+79
lexicons/repo/mergeCheck.json
···
+
{
+
"lexicon": 1,
+
"id": "sh.tangled.repo.mergeCheck",
+
"defs": {
+
"main": {
+
"type": "procedure",
+
"description": "Check if a merge is possible between two branches",
+
"input": {
+
"encoding": "application/json",
+
"schema": {
+
"type": "object",
+
"required": ["did", "name", "patch", "branch"],
+
"properties": {
+
"did": {
+
"type": "string",
+
"format": "did",
+
"description": "DID of the repository owner"
+
},
+
"name": {
+
"type": "string",
+
"description": "Name of the repository"
+
},
+
"patch": {
+
"type": "string",
+
"description": "Patch or pull request to check for merge conflicts"
+
},
+
"branch": {
+
"type": "string",
+
"description": "Target branch to merge into"
+
}
+
}
+
}
+
},
+
"output": {
+
"encoding": "application/json",
+
"schema": {
+
"type": "object",
+
"required": ["is_conflicted"],
+
"properties": {
+
"is_conflicted": {
+
"type": "boolean",
+
"description": "Whether the merge has conflicts"
+
},
+
"conflicts": {
+
"type": "array",
+
"description": "List of files with merge conflicts",
+
"items": {
+
"type": "ref",
+
"ref": "#conflictInfo"
+
}
+
},
+
"message": {
+
"type": "string",
+
"description": "Additional message about the merge check"
+
},
+
"error": {
+
"type": "string",
+
"description": "Error message if check failed"
+
}
+
}
+
}
+
}
+
},
+
"conflictInfo": {
+
"type": "object",
+
"required": ["filename", "reason"],
+
"properties": {
+
"filename": {
+
"type": "string",
+
"description": "Name of the conflicted file"
+
},
+
"reason": {
+
"type": "string",
+
"description": "Reason for the conflict"
+
}
+
}
+
}
+
}
+
}