diff --git a/api/tangled/tangledowner.go b/api/tangled/tangledowner.go new file mode 100644 --- /dev/null +++ b/api/tangled/tangledowner.go @@ -0,0 +1,30 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package tangled + +// schema: sh.tangled.owner + +import ( + "context" + + "github.com/bluesky-social/indigo/lex/util" +) + +const ( + OwnerNSID = "sh.tangled.owner" +) + +// Owner_Output is the output of a sh.tangled.owner call. +type Owner_Output struct { + Owner string `json:"owner" cborgen:"owner"` +} + +// Owner calls the XRPC method "sh.tangled.owner". +func Owner(ctx context.Context, c util.LexClient) (*Owner_Output, error) { + var out Owner_Output + if err := c.LexDo(ctx, util.Query, "", "sh.tangled.owner", nil, nil, &out); err != nil { + return nil, err + } + + return &out, nil +} diff --git a/lexicons/owner.json b/lexicons/owner.json new file mode 100644 --- /dev/null +++ b/lexicons/owner.json @@ -0,0 +1,31 @@ +{ + "lexicon": 1, + "id": "sh.tangled.owner", + "defs": { + "main": { + "type": "query", + "description": "Get the owner of a service", + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "owner" + ], + "properties": { + "owner": { + "type": "string", + "format": "did" + } + } + } + }, + "errors": [ + { + "name": "OwnerNotFound", + "description": "Owner is not set for this service" + } + ] + } + } +} diff --git a/xrpc/errors/errors.go b/xrpc/errors/errors.go --- a/xrpc/errors/errors.go +++ b/xrpc/errors/errors.go @@ -51,6 +51,11 @@ WithTag("MissingActorDid"), WithMessage("actor DID not supplied"), ) +var OwnerNotFoundError = NewXrpcError( + WithTag("OwnerNotFound"), + WithMessage("owner not set for this service"), +) + var AuthError = func(err error) XrpcError { return NewXrpcError( WithTag("Auth"),