diff --git a/api/tangled/tempdefs.go b/api/tangled/tempdefs.go index 13c32a88..75e2e303 100644 --- a/api/tangled/tempdefs.go +++ b/api/tangled/tempdefs.go @@ -10,20 +10,6 @@ import ( const () -// GitTempDefs_Blob is a "blob" in the sh.tangled.git.temp.defs schema. -// -// blob metadata. This object doesn't include the blob content -type GitTempDefs_Blob struct { - LastCommit *GitTempDefs_Commit `json:"lastCommit" cborgen:"lastCommit"` - Mode string `json:"mode" cborgen:"mode"` - // name: The file name - Name string `json:"name" cborgen:"name"` - // size: File size in bytes - Size int64 `json:"size" cborgen:"size"` - // submodule: Submodule information if path is a submodule - Submodule *GitTempDefs_Submodule `json:"submodule,omitempty" cborgen:"submodule,omitempty"` -} - // GitTempDefs_Branch is a "branch" in the sh.tangled.git.temp.defs schema. type GitTempDefs_Branch struct { // commit: hydrated commit object diff --git a/api/tangled/tempgetEntity.go b/api/tangled/tempgetEntity.go deleted file mode 100644 index 6cd88ba5..00000000 --- a/api/tangled/tempgetEntity.go +++ /dev/null @@ -1,36 +0,0 @@ -// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. - -package tangled - -// schema: sh.tangled.git.temp.getEntity - -import ( - "context" - - "github.com/bluesky-social/indigo/lex/util" -) - -const ( - GitTempGetEntityNSID = "sh.tangled.git.temp.getEntity" -) - -// GitTempGetEntity calls the XRPC method "sh.tangled.git.temp.getEntity". -// -// path: path of the entity -// ref: Git reference (branch, tag, or commit SHA) -// repo: DID of the repository -func GitTempGetEntity(ctx context.Context, c util.LexClient, path string, ref string, repo string) (*GitTempDefs_Blob, error) { - var out GitTempDefs_Blob - - params := map[string]interface{}{} - params["path"] = path - if ref != "" { - params["ref"] = ref - } - params["repo"] = repo - if err := c.LexDo(ctx, util.Query, "", "sh.tangled.git.temp.getEntity", params, nil, &out); err != nil { - return nil, err - } - - return &out, nil -} diff --git a/api/tangled/tempgetEntry.go b/api/tangled/tempgetEntry.go new file mode 100644 index 00000000..34894b40 --- /dev/null +++ b/api/tangled/tempgetEntry.go @@ -0,0 +1,47 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package tangled + +// schema: sh.tangled.git.temp.getEntry + +import ( + "context" + + "github.com/bluesky-social/indigo/lex/util" +) + +const ( + GitTempGetEntryNSID = "sh.tangled.git.temp.getEntry" +) + +// GitTempGetEntry_Output is the output of a sh.tangled.git.temp.getEntry call. +type GitTempGetEntry_Output struct { + LastCommit *GitTempDefs_Commit `json:"lastCommit,omitempty" cborgen:"lastCommit,omitempty"` + Mode string `json:"mode" cborgen:"mode"` + // name: The file name + Name string `json:"name" cborgen:"name"` + Oid string `json:"oid" cborgen:"oid"` + // submodule: Submodule information if path is a submodule + Submodule *GitTempDefs_Submodule `json:"submodule,omitempty" cborgen:"submodule,omitempty"` +} + +// GitTempGetEntry calls the XRPC method "sh.tangled.git.temp.getEntry". +// +// path: path of the entity +// ref: Git revision (branch, tag, or commit id) +// repo: DID of the repository +func GitTempGetEntry(ctx context.Context, c util.LexClient, path string, ref string, repo string) (*GitTempGetEntry_Output, error) { + var out GitTempGetEntry_Output + + params := map[string]interface{}{} + params["path"] = path + if ref != "" { + params["ref"] = ref + } + params["repo"] = repo + if err := c.LexDo(ctx, util.Query, "", "sh.tangled.git.temp.getEntry", params, nil, &out); err != nil { + return nil, err + } + + return &out, nil +} diff --git a/lexicons/git/temp/defs.json b/lexicons/git/temp/defs.json index 3209b71d..2eff550d 100644 --- a/lexicons/git/temp/defs.json +++ b/lexicons/git/temp/defs.json @@ -2,33 +2,6 @@ "lexicon": 1, "id": "sh.tangled.git.temp.defs", "defs": { - "blob": { - "type": "object", - "description": "blob metadata. This object doesn't include the blob content", - "required": ["name", "mode", "size", "lastCommit"], - "properties": { - "name": { - "type": "string", - "description": "The file name" - }, - "mode": { - "type": "string" - }, - "size": { - "type": "integer", - "description": "File size in bytes" - }, - "lastCommit": { - "type": "ref", - "ref": "#commit" - }, - "submodule": { - "type": "ref", - "ref": "#submodule", - "description": "Submodule information if path is a submodule" - } - } - }, "branch": { "type": "object", "required": ["name", "commit"], diff --git a/lexicons/git/temp/getEntity.json b/lexicons/git/temp/getEntity.json deleted file mode 100644 index 76633535..00000000 --- a/lexicons/git/temp/getEntity.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "lexicon": 1, - "id": "sh.tangled.git.temp.getEntity", - "defs": { - "main": { - "type": "query", - "description": "get metadata of blob by ref and path", - "parameters": { - "type": "params", - "required": ["repo", "path"], - "properties": { - "repo": { - "type": "string", - "format": "did", - "description": "DID of the repository" - }, - "ref": { - "type": "string", - "description": "Git reference (branch, tag, or commit SHA)", - "default": "HEAD" - }, - "path": { - "type": "string", - "description": "path of the entity" - } - } - }, - "output": { - "encoding": "application/json", - "schema": { - "type": "ref", - "ref": "sh.tangled.git.temp.defs#blob" - } - }, - "errors": [ - { - "name": "RepoNotFound", - "description": "Repository not found or access denied" - }, - { - "name": "BlobNotFound", - "description": "Blob not found" - }, - { - "name": "InvalidRequest", - "description": "Invalid request parameters" - } - ] - } - } -} diff --git a/lexicons/git/temp/getEntry.json b/lexicons/git/temp/getEntry.json new file mode 100644 index 00000000..a443ecca --- /dev/null +++ b/lexicons/git/temp/getEntry.json @@ -0,0 +1,77 @@ +{ + "lexicon": 1, + "id": "sh.tangled.git.temp.getEntry", + "defs": { + "main": { + "type": "query", + "description": "get metadata of blob by ref and path", + "parameters": { + "type": "params", + "required": ["repo", "path"], + "properties": { + "repo": { + "type": "string", + "format": "did", + "description": "DID of the repository" + }, + "ref": { + "type": "string", + "description": "Git revision (branch, tag, or commit id)", + "default": "HEAD" + }, + "path": { + "type": "string", + "description": "path of the entity" + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": ["name", "mode", "oid"], + "properties": { + "name": { + "type": "string", + "description": "The file name" + }, + "mode": { + "type": "string", + "enum": ["0040000", "0100644", "0100664", "0100755", "0120000", "0160000"] + }, + "oid": { + "type": "string" + }, + "lastCommit": { + "type": "ref", + "ref": "sh.tangled.git.temp.defs#commit" + }, + "submodule": { + "type": "ref", + "ref": "sh.tangled.git.temp.defs#submodule", + "description": "Submodule information if path is a submodule" + } + } + } + }, + "errors": [ + { + "name": "RepoNotFound", + "description": "Repository not found or access denied" + }, + { + "name": "RefNotFound", + "description": "Git reference not found" + }, + { + "name": "EntryNotFound", + "description": "Entry not found" + }, + { + "name": "InvalidRequest", + "description": "Invalid request parameters" + } + ] + } + } +}