From 593305966ad289c44d816722f393835364e8d6a3 Mon Sep 17 00:00:00 2001 From: whyrusleeping Date: Tue, 12 Dec 2023 12:41:44 -0800 Subject: [PATCH] rm commented out code --- api/atproto/repodescribeRepo.go | 11 ++++++----- api/atproto/servercreateAccount.go | 25 +++++++++++++------------ api/atproto/servergetSession.go | 11 ++++++----- lex/gen.go | 7 ------- 4 files changed, 25 insertions(+), 29 deletions(-) diff --git a/api/atproto/repodescribeRepo.go b/api/atproto/repodescribeRepo.go index f6fac4b68..4755fa376 100644 --- a/api/atproto/repodescribeRepo.go +++ b/api/atproto/repodescribeRepo.go @@ -7,16 +7,17 @@ package atproto import ( "context" + "github.com/bluesky-social/indigo/lex/util" "github.com/bluesky-social/indigo/xrpc" ) // RepoDescribeRepo_Output is the output of a com.atproto.repo.describeRepo call. type RepoDescribeRepo_Output struct { - Collections []string `json:"collections" cborgen:"collections"` - Did string `json:"did" cborgen:"did"` - DidDoc interface{} `json:"didDoc" cborgen:"didDoc"` - Handle string `json:"handle" cborgen:"handle"` - HandleIsCorrect bool `json:"handleIsCorrect" cborgen:"handleIsCorrect"` + Collections []string `json:"collections" cborgen:"collections"` + Did string `json:"did" cborgen:"did"` + DidDoc *util.LexiconTypeDecoder `json:"didDoc" cborgen:"didDoc"` + Handle string `json:"handle" cborgen:"handle"` + HandleIsCorrect bool `json:"handleIsCorrect" cborgen:"handleIsCorrect"` } // RepoDescribeRepo calls the XRPC method "com.atproto.repo.describeRepo". diff --git a/api/atproto/servercreateAccount.go b/api/atproto/servercreateAccount.go index 3ef944e41..5f12573c8 100644 --- a/api/atproto/servercreateAccount.go +++ b/api/atproto/servercreateAccount.go @@ -7,27 +7,28 @@ package atproto import ( "context" + "github.com/bluesky-social/indigo/lex/util" "github.com/bluesky-social/indigo/xrpc" ) // ServerCreateAccount_Input is the input argument to a com.atproto.server.createAccount call. type ServerCreateAccount_Input struct { - Did *string `json:"did,omitempty" cborgen:"did,omitempty"` - Email *string `json:"email,omitempty" cborgen:"email,omitempty"` - Handle string `json:"handle" cborgen:"handle"` - InviteCode *string `json:"inviteCode,omitempty" cborgen:"inviteCode,omitempty"` - Password *string `json:"password,omitempty" cborgen:"password,omitempty"` - PlcOp *interface{} `json:"plcOp,omitempty" cborgen:"plcOp,omitempty"` - RecoveryKey *string `json:"recoveryKey,omitempty" cborgen:"recoveryKey,omitempty"` + Did *string `json:"did,omitempty" cborgen:"did,omitempty"` + Email *string `json:"email,omitempty" cborgen:"email,omitempty"` + Handle string `json:"handle" cborgen:"handle"` + InviteCode *string `json:"inviteCode,omitempty" cborgen:"inviteCode,omitempty"` + Password *string `json:"password,omitempty" cborgen:"password,omitempty"` + PlcOp *util.LexiconTypeDecoder `json:"plcOp,omitempty" cborgen:"plcOp,omitempty"` + RecoveryKey *string `json:"recoveryKey,omitempty" cborgen:"recoveryKey,omitempty"` } // ServerCreateAccount_Output is the output of a com.atproto.server.createAccount call. type ServerCreateAccount_Output struct { - AccessJwt string `json:"accessJwt" cborgen:"accessJwt"` - Did string `json:"did" cborgen:"did"` - DidDoc *interface{} `json:"didDoc,omitempty" cborgen:"didDoc,omitempty"` - Handle string `json:"handle" cborgen:"handle"` - RefreshJwt string `json:"refreshJwt" cborgen:"refreshJwt"` + AccessJwt string `json:"accessJwt" cborgen:"accessJwt"` + Did string `json:"did" cborgen:"did"` + DidDoc *util.LexiconTypeDecoder `json:"didDoc,omitempty" cborgen:"didDoc,omitempty"` + Handle string `json:"handle" cborgen:"handle"` + RefreshJwt string `json:"refreshJwt" cborgen:"refreshJwt"` } // ServerCreateAccount calls the XRPC method "com.atproto.server.createAccount". diff --git a/api/atproto/servergetSession.go b/api/atproto/servergetSession.go index 3af41baf8..0c2704897 100644 --- a/api/atproto/servergetSession.go +++ b/api/atproto/servergetSession.go @@ -7,16 +7,17 @@ package atproto import ( "context" + "github.com/bluesky-social/indigo/lex/util" "github.com/bluesky-social/indigo/xrpc" ) // ServerGetSession_Output is the output of a com.atproto.server.getSession call. type ServerGetSession_Output struct { - Did string `json:"did" cborgen:"did"` - DidDoc *interface{} `json:"didDoc,omitempty" cborgen:"didDoc,omitempty"` - Email *string `json:"email,omitempty" cborgen:"email,omitempty"` - EmailConfirmed *bool `json:"emailConfirmed,omitempty" cborgen:"emailConfirmed,omitempty"` - Handle string `json:"handle" cborgen:"handle"` + Did string `json:"did" cborgen:"did"` + DidDoc *util.LexiconTypeDecoder `json:"didDoc,omitempty" cborgen:"didDoc,omitempty"` + Email *string `json:"email,omitempty" cborgen:"email,omitempty"` + EmailConfirmed *bool `json:"emailConfirmed,omitempty" cborgen:"emailConfirmed,omitempty"` + Handle string `json:"handle" cborgen:"handle"` } // ServerGetSession calls the XRPC method "com.atproto.server.getSession". diff --git a/lex/gen.go b/lex/gen.go index 6348d5782..0bcd489e5 100644 --- a/lex/gen.go +++ b/lex/gen.go @@ -1199,13 +1199,6 @@ func (ts *TypeSchema) writeTypeDefinition(name string, w io.Writer) error { case "boolean": pf("type %s bool\n", name) case "object": - /* - if len(ts.Properties) == 0 { - pf("type %s interface{}\n", name) - return nil - } - */ - if ts.needsType { pf("//\n// RECORDTYPE: %s\n", name) }