this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

update to latest lexicons

+1214 -107
+41 -11
api/atproto/admindefs.go
··· 11 11 "github.com/bluesky-social/indigo/lex/util" 12 12 ) 13 13 14 + // AdminDefs_AccountView is a "accountView" in the com.atproto.admin.defs schema. 15 + type AdminDefs_AccountView struct { 16 + Did string `json:"did" cborgen:"did"` 17 + Email *string `json:"email,omitempty" cborgen:"email,omitempty"` 18 + EmailConfirmedAt *string `json:"emailConfirmedAt,omitempty" cborgen:"emailConfirmedAt,omitempty"` 19 + Handle string `json:"handle" cborgen:"handle"` 20 + IndexedAt string `json:"indexedAt" cborgen:"indexedAt"` 21 + InviteNote *string `json:"inviteNote,omitempty" cborgen:"inviteNote,omitempty"` 22 + InvitedBy *ServerDefs_InviteCode `json:"invitedBy,omitempty" cborgen:"invitedBy,omitempty"` 23 + Invites []*ServerDefs_InviteCode `json:"invites,omitempty" cborgen:"invites,omitempty"` 24 + InvitesDisabled *bool `json:"invitesDisabled,omitempty" cborgen:"invitesDisabled,omitempty"` 25 + } 26 + 14 27 // AdminDefs_ActionReversal is a "actionReversal" in the com.atproto.admin.defs schema. 15 28 type AdminDefs_ActionReversal struct { 16 29 CreatedAt string `json:"createdAt" cborgen:"createdAt"` ··· 246 259 Uri string `json:"uri" cborgen:"uri"` 247 260 } 248 261 262 + // AdminDefs_RepoBlobRef is a "repoBlobRef" in the com.atproto.admin.defs schema. 263 + // 264 + // RECORDTYPE: AdminDefs_RepoBlobRef 265 + type AdminDefs_RepoBlobRef struct { 266 + LexiconTypeID string `json:"$type,const=com.atproto.admin.defs#repoBlobRef" cborgen:"$type,const=com.atproto.admin.defs#repoBlobRef"` 267 + Cid string `json:"cid" cborgen:"cid"` 268 + Did string `json:"did" cborgen:"did"` 269 + RecordUri *string `json:"recordUri,omitempty" cborgen:"recordUri,omitempty"` 270 + } 271 + 249 272 // AdminDefs_RepoRef is a "repoRef" in the com.atproto.admin.defs schema. 250 273 // 251 274 // RECORDTYPE: AdminDefs_RepoRef ··· 272 295 273 296 // AdminDefs_RepoViewDetail is a "repoViewDetail" in the com.atproto.admin.defs schema. 274 297 type AdminDefs_RepoViewDetail struct { 275 - Did string `json:"did" cborgen:"did"` 276 - Email *string `json:"email,omitempty" cborgen:"email,omitempty"` 277 - Handle string `json:"handle" cborgen:"handle"` 278 - IndexedAt string `json:"indexedAt" cborgen:"indexedAt"` 279 - InviteNote *string `json:"inviteNote,omitempty" cborgen:"inviteNote,omitempty"` 280 - InvitedBy *ServerDefs_InviteCode `json:"invitedBy,omitempty" cborgen:"invitedBy,omitempty"` 281 - Invites []*ServerDefs_InviteCode `json:"invites,omitempty" cborgen:"invites,omitempty"` 282 - InvitesDisabled *bool `json:"invitesDisabled,omitempty" cborgen:"invitesDisabled,omitempty"` 283 - Labels []*LabelDefs_Label `json:"labels,omitempty" cborgen:"labels,omitempty"` 284 - Moderation *AdminDefs_ModerationDetail `json:"moderation" cborgen:"moderation"` 285 - RelatedRecords []*util.LexiconTypeDecoder `json:"relatedRecords" cborgen:"relatedRecords"` 298 + Did string `json:"did" cborgen:"did"` 299 + Email *string `json:"email,omitempty" cborgen:"email,omitempty"` 300 + EmailConfirmedAt *string `json:"emailConfirmedAt,omitempty" cborgen:"emailConfirmedAt,omitempty"` 301 + Handle string `json:"handle" cborgen:"handle"` 302 + IndexedAt string `json:"indexedAt" cborgen:"indexedAt"` 303 + InviteNote *string `json:"inviteNote,omitempty" cborgen:"inviteNote,omitempty"` 304 + InvitedBy *ServerDefs_InviteCode `json:"invitedBy,omitempty" cborgen:"invitedBy,omitempty"` 305 + Invites []*ServerDefs_InviteCode `json:"invites,omitempty" cborgen:"invites,omitempty"` 306 + InvitesDisabled *bool `json:"invitesDisabled,omitempty" cborgen:"invitesDisabled,omitempty"` 307 + Labels []*LabelDefs_Label `json:"labels,omitempty" cborgen:"labels,omitempty"` 308 + Moderation *AdminDefs_ModerationDetail `json:"moderation" cborgen:"moderation"` 309 + RelatedRecords []*util.LexiconTypeDecoder `json:"relatedRecords" cborgen:"relatedRecords"` 286 310 } 287 311 288 312 // AdminDefs_RepoViewNotFound is a "repoViewNotFound" in the com.atproto.admin.defs schema. ··· 400 424 default: 401 425 return nil 402 426 } 427 + } 428 + 429 + // AdminDefs_StatusAttr is a "statusAttr" in the com.atproto.admin.defs schema. 430 + type AdminDefs_StatusAttr struct { 431 + Applied bool `json:"applied" cborgen:"applied"` 432 + Ref *string `json:"ref,omitempty" cborgen:"ref,omitempty"` 403 433 } 404 434 405 435 // AdminDefs_VideoDetails is a "videoDetails" in the com.atproto.admin.defs schema.
+25
api/atproto/admingetAccountInfo.go
··· 1 + // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. 2 + 3 + package atproto 4 + 5 + // schema: com.atproto.admin.getAccountInfo 6 + 7 + import ( 8 + "context" 9 + 10 + "github.com/bluesky-social/indigo/xrpc" 11 + ) 12 + 13 + // AdminGetAccountInfo calls the XRPC method "com.atproto.admin.getAccountInfo". 14 + func AdminGetAccountInfo(ctx context.Context, c *xrpc.Client, did string) (*AdminDefs_AccountView, error) { 15 + var out AdminDefs_AccountView 16 + 17 + params := map[string]interface{}{ 18 + "did": did, 19 + } 20 + if err := c.Do(ctx, xrpc.Query, "", "com.atproto.admin.getAccountInfo", params, nil, &out); err != nil { 21 + return nil, err 22 + } 23 + 24 + return &out, nil 25 + }
+79
api/atproto/admingetSubjectStatus.go
··· 1 + // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. 2 + 3 + package atproto 4 + 5 + // schema: com.atproto.admin.getSubjectStatus 6 + 7 + import ( 8 + "context" 9 + "encoding/json" 10 + "fmt" 11 + 12 + "github.com/bluesky-social/indigo/lex/util" 13 + "github.com/bluesky-social/indigo/xrpc" 14 + ) 15 + 16 + // AdminGetSubjectStatus_Output is the output of a com.atproto.admin.getSubjectStatus call. 17 + type AdminGetSubjectStatus_Output struct { 18 + Subject *AdminGetSubjectStatus_Output_Subject `json:"subject" cborgen:"subject"` 19 + Takedown *AdminDefs_StatusAttr `json:"takedown,omitempty" cborgen:"takedown,omitempty"` 20 + } 21 + 22 + type AdminGetSubjectStatus_Output_Subject struct { 23 + AdminDefs_RepoRef *AdminDefs_RepoRef 24 + RepoStrongRef *RepoStrongRef 25 + AdminDefs_RepoBlobRef *AdminDefs_RepoBlobRef 26 + } 27 + 28 + func (t *AdminGetSubjectStatus_Output_Subject) MarshalJSON() ([]byte, error) { 29 + if t.AdminDefs_RepoRef != nil { 30 + t.AdminDefs_RepoRef.LexiconTypeID = "com.atproto.admin.defs#repoRef" 31 + return json.Marshal(t.AdminDefs_RepoRef) 32 + } 33 + if t.RepoStrongRef != nil { 34 + t.RepoStrongRef.LexiconTypeID = "com.atproto.repo.strongRef" 35 + return json.Marshal(t.RepoStrongRef) 36 + } 37 + if t.AdminDefs_RepoBlobRef != nil { 38 + t.AdminDefs_RepoBlobRef.LexiconTypeID = "com.atproto.admin.defs#repoBlobRef" 39 + return json.Marshal(t.AdminDefs_RepoBlobRef) 40 + } 41 + return nil, fmt.Errorf("cannot marshal empty enum") 42 + } 43 + func (t *AdminGetSubjectStatus_Output_Subject) UnmarshalJSON(b []byte) error { 44 + typ, err := util.TypeExtract(b) 45 + if err != nil { 46 + return err 47 + } 48 + 49 + switch typ { 50 + case "com.atproto.admin.defs#repoRef": 51 + t.AdminDefs_RepoRef = new(AdminDefs_RepoRef) 52 + return json.Unmarshal(b, t.AdminDefs_RepoRef) 53 + case "com.atproto.repo.strongRef": 54 + t.RepoStrongRef = new(RepoStrongRef) 55 + return json.Unmarshal(b, t.RepoStrongRef) 56 + case "com.atproto.admin.defs#repoBlobRef": 57 + t.AdminDefs_RepoBlobRef = new(AdminDefs_RepoBlobRef) 58 + return json.Unmarshal(b, t.AdminDefs_RepoBlobRef) 59 + 60 + default: 61 + return nil 62 + } 63 + } 64 + 65 + // AdminGetSubjectStatus calls the XRPC method "com.atproto.admin.getSubjectStatus". 66 + func AdminGetSubjectStatus(ctx context.Context, c *xrpc.Client, blob string, did string, uri string) (*AdminGetSubjectStatus_Output, error) { 67 + var out AdminGetSubjectStatus_Output 68 + 69 + params := map[string]interface{}{ 70 + "blob": blob, 71 + "did": did, 72 + "uri": uri, 73 + } 74 + if err := c.Do(ctx, xrpc.Query, "", "com.atproto.admin.getSubjectStatus", params, nil, &out); err != nil { 75 + return nil, err 76 + } 77 + 78 + return &out, nil 79 + }
+5 -6
api/atproto/adminsearchRepos.go
··· 19 19 // AdminSearchRepos calls the XRPC method "com.atproto.admin.searchRepos". 20 20 // 21 21 // term: DEPRECATED: use 'q' instead 22 - func AdminSearchRepos(ctx context.Context, c *xrpc.Client, cursor string, invitedBy string, limit int64, q string, term string) (*AdminSearchRepos_Output, error) { 22 + func AdminSearchRepos(ctx context.Context, c *xrpc.Client, cursor string, limit int64, q string, term string) (*AdminSearchRepos_Output, error) { 23 23 var out AdminSearchRepos_Output 24 24 25 25 params := map[string]interface{}{ 26 - "cursor": cursor, 27 - "invitedBy": invitedBy, 28 - "limit": limit, 29 - "q": q, 30 - "term": term, 26 + "cursor": cursor, 27 + "limit": limit, 28 + "q": q, 29 + "term": term, 31 30 } 32 31 if err := c.Do(ctx, xrpc.Query, "", "com.atproto.admin.searchRepos", params, nil, &out); err != nil { 33 32 return nil, err
+122
api/atproto/adminupdateSubjectStatus.go
··· 1 + // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. 2 + 3 + package atproto 4 + 5 + // schema: com.atproto.admin.updateSubjectStatus 6 + 7 + import ( 8 + "context" 9 + "encoding/json" 10 + "fmt" 11 + 12 + "github.com/bluesky-social/indigo/lex/util" 13 + "github.com/bluesky-social/indigo/xrpc" 14 + ) 15 + 16 + // AdminUpdateSubjectStatus_Input is the input argument to a com.atproto.admin.updateSubjectStatus call. 17 + type AdminUpdateSubjectStatus_Input struct { 18 + Subject *AdminUpdateSubjectStatus_Input_Subject `json:"subject" cborgen:"subject"` 19 + Takedown *AdminDefs_StatusAttr `json:"takedown,omitempty" cborgen:"takedown,omitempty"` 20 + } 21 + 22 + type AdminUpdateSubjectStatus_Input_Subject struct { 23 + AdminDefs_RepoRef *AdminDefs_RepoRef 24 + RepoStrongRef *RepoStrongRef 25 + AdminDefs_RepoBlobRef *AdminDefs_RepoBlobRef 26 + } 27 + 28 + func (t *AdminUpdateSubjectStatus_Input_Subject) MarshalJSON() ([]byte, error) { 29 + if t.AdminDefs_RepoRef != nil { 30 + t.AdminDefs_RepoRef.LexiconTypeID = "com.atproto.admin.defs#repoRef" 31 + return json.Marshal(t.AdminDefs_RepoRef) 32 + } 33 + if t.RepoStrongRef != nil { 34 + t.RepoStrongRef.LexiconTypeID = "com.atproto.repo.strongRef" 35 + return json.Marshal(t.RepoStrongRef) 36 + } 37 + if t.AdminDefs_RepoBlobRef != nil { 38 + t.AdminDefs_RepoBlobRef.LexiconTypeID = "com.atproto.admin.defs#repoBlobRef" 39 + return json.Marshal(t.AdminDefs_RepoBlobRef) 40 + } 41 + return nil, fmt.Errorf("cannot marshal empty enum") 42 + } 43 + func (t *AdminUpdateSubjectStatus_Input_Subject) UnmarshalJSON(b []byte) error { 44 + typ, err := util.TypeExtract(b) 45 + if err != nil { 46 + return err 47 + } 48 + 49 + switch typ { 50 + case "com.atproto.admin.defs#repoRef": 51 + t.AdminDefs_RepoRef = new(AdminDefs_RepoRef) 52 + return json.Unmarshal(b, t.AdminDefs_RepoRef) 53 + case "com.atproto.repo.strongRef": 54 + t.RepoStrongRef = new(RepoStrongRef) 55 + return json.Unmarshal(b, t.RepoStrongRef) 56 + case "com.atproto.admin.defs#repoBlobRef": 57 + t.AdminDefs_RepoBlobRef = new(AdminDefs_RepoBlobRef) 58 + return json.Unmarshal(b, t.AdminDefs_RepoBlobRef) 59 + 60 + default: 61 + return nil 62 + } 63 + } 64 + 65 + // AdminUpdateSubjectStatus_Output is the output of a com.atproto.admin.updateSubjectStatus call. 66 + type AdminUpdateSubjectStatus_Output struct { 67 + Subject *AdminUpdateSubjectStatus_Output_Subject `json:"subject" cborgen:"subject"` 68 + Takedown *AdminDefs_StatusAttr `json:"takedown,omitempty" cborgen:"takedown,omitempty"` 69 + } 70 + 71 + type AdminUpdateSubjectStatus_Output_Subject struct { 72 + AdminDefs_RepoRef *AdminDefs_RepoRef 73 + RepoStrongRef *RepoStrongRef 74 + AdminDefs_RepoBlobRef *AdminDefs_RepoBlobRef 75 + } 76 + 77 + func (t *AdminUpdateSubjectStatus_Output_Subject) MarshalJSON() ([]byte, error) { 78 + if t.AdminDefs_RepoRef != nil { 79 + t.AdminDefs_RepoRef.LexiconTypeID = "com.atproto.admin.defs#repoRef" 80 + return json.Marshal(t.AdminDefs_RepoRef) 81 + } 82 + if t.RepoStrongRef != nil { 83 + t.RepoStrongRef.LexiconTypeID = "com.atproto.repo.strongRef" 84 + return json.Marshal(t.RepoStrongRef) 85 + } 86 + if t.AdminDefs_RepoBlobRef != nil { 87 + t.AdminDefs_RepoBlobRef.LexiconTypeID = "com.atproto.admin.defs#repoBlobRef" 88 + return json.Marshal(t.AdminDefs_RepoBlobRef) 89 + } 90 + return nil, fmt.Errorf("cannot marshal empty enum") 91 + } 92 + func (t *AdminUpdateSubjectStatus_Output_Subject) UnmarshalJSON(b []byte) error { 93 + typ, err := util.TypeExtract(b) 94 + if err != nil { 95 + return err 96 + } 97 + 98 + switch typ { 99 + case "com.atproto.admin.defs#repoRef": 100 + t.AdminDefs_RepoRef = new(AdminDefs_RepoRef) 101 + return json.Unmarshal(b, t.AdminDefs_RepoRef) 102 + case "com.atproto.repo.strongRef": 103 + t.RepoStrongRef = new(RepoStrongRef) 104 + return json.Unmarshal(b, t.RepoStrongRef) 105 + case "com.atproto.admin.defs#repoBlobRef": 106 + t.AdminDefs_RepoBlobRef = new(AdminDefs_RepoBlobRef) 107 + return json.Unmarshal(b, t.AdminDefs_RepoBlobRef) 108 + 109 + default: 110 + return nil 111 + } 112 + } 113 + 114 + // AdminUpdateSubjectStatus calls the XRPC method "com.atproto.admin.updateSubjectStatus". 115 + func AdminUpdateSubjectStatus(ctx context.Context, c *xrpc.Client, input *AdminUpdateSubjectStatus_Input) (*AdminUpdateSubjectStatus_Output, error) { 116 + var out AdminUpdateSubjectStatus_Output 117 + if err := c.Do(ctx, xrpc.Procedure, "application/json", "com.atproto.admin.updateSubjectStatus", nil, input, &out); err != nil { 118 + return nil, err 119 + } 120 + 121 + return &out, nil 122 + }
+13 -10
api/atproto/servercreateAccount.go
··· 7 7 import ( 8 8 "context" 9 9 10 + "github.com/bluesky-social/indigo/lex/util" 10 11 "github.com/bluesky-social/indigo/xrpc" 11 12 ) 12 13 13 14 // ServerCreateAccount_Input is the input argument to a com.atproto.server.createAccount call. 14 15 type ServerCreateAccount_Input struct { 15 - Did *string `json:"did,omitempty" cborgen:"did,omitempty"` 16 - Email string `json:"email" cborgen:"email"` 17 - Handle string `json:"handle" cborgen:"handle"` 18 - InviteCode *string `json:"inviteCode,omitempty" cborgen:"inviteCode,omitempty"` 19 - Password string `json:"password" cborgen:"password"` 20 - RecoveryKey *string `json:"recoveryKey,omitempty" cborgen:"recoveryKey,omitempty"` 16 + Did *string `json:"did,omitempty" cborgen:"did,omitempty"` 17 + Email *string `json:"email,omitempty" cborgen:"email,omitempty"` 18 + Handle string `json:"handle" cborgen:"handle"` 19 + InviteCode *string `json:"inviteCode,omitempty" cborgen:"inviteCode,omitempty"` 20 + Password *string `json:"password,omitempty" cborgen:"password,omitempty"` 21 + PlcOp *util.LexiconTypeDecoder `json:"plcOp,omitempty" cborgen:"plcOp,omitempty"` 22 + RecoveryKey *string `json:"recoveryKey,omitempty" cborgen:"recoveryKey,omitempty"` 21 23 } 22 24 23 25 // ServerCreateAccount_Output is the output of a com.atproto.server.createAccount call. 24 26 type ServerCreateAccount_Output struct { 25 - AccessJwt string `json:"accessJwt" cborgen:"accessJwt"` 26 - Did string `json:"did" cborgen:"did"` 27 - Handle string `json:"handle" cborgen:"handle"` 28 - RefreshJwt string `json:"refreshJwt" cborgen:"refreshJwt"` 27 + AccessJwt string `json:"accessJwt" cborgen:"accessJwt"` 28 + Did string `json:"did" cborgen:"did"` 29 + DidDoc *util.LexiconTypeDecoder `json:"didDoc,omitempty" cborgen:"didDoc,omitempty"` 30 + Handle string `json:"handle" cborgen:"handle"` 31 + RefreshJwt string `json:"refreshJwt" cborgen:"refreshJwt"` 29 32 } 30 33 31 34 // ServerCreateAccount calls the XRPC method "com.atproto.server.createAccount".
+8 -6
api/atproto/servercreateSession.go
··· 7 7 import ( 8 8 "context" 9 9 10 + "github.com/bluesky-social/indigo/lex/util" 10 11 "github.com/bluesky-social/indigo/xrpc" 11 12 ) 12 13 ··· 19 20 20 21 // ServerCreateSession_Output is the output of a com.atproto.server.createSession call. 21 22 type ServerCreateSession_Output struct { 22 - AccessJwt string `json:"accessJwt" cborgen:"accessJwt"` 23 - Did string `json:"did" cborgen:"did"` 24 - Email *string `json:"email,omitempty" cborgen:"email,omitempty"` 25 - EmailConfirmed *bool `json:"emailConfirmed,omitempty" cborgen:"emailConfirmed,omitempty"` 26 - Handle string `json:"handle" cborgen:"handle"` 27 - RefreshJwt string `json:"refreshJwt" cborgen:"refreshJwt"` 23 + AccessJwt string `json:"accessJwt" cborgen:"accessJwt"` 24 + Did string `json:"did" cborgen:"did"` 25 + DidDoc *util.LexiconTypeDecoder `json:"didDoc,omitempty" cborgen:"didDoc,omitempty"` 26 + Email *string `json:"email,omitempty" cborgen:"email,omitempty"` 27 + EmailConfirmed *bool `json:"emailConfirmed,omitempty" cborgen:"emailConfirmed,omitempty"` 28 + Handle string `json:"handle" cborgen:"handle"` 29 + RefreshJwt string `json:"refreshJwt" cborgen:"refreshJwt"` 28 30 } 29 31 30 32 // ServerCreateSession calls the XRPC method "com.atproto.server.createSession".
+6 -4
api/atproto/servergetSession.go
··· 7 7 import ( 8 8 "context" 9 9 10 + "github.com/bluesky-social/indigo/lex/util" 10 11 "github.com/bluesky-social/indigo/xrpc" 11 12 ) 12 13 13 14 // ServerGetSession_Output is the output of a com.atproto.server.getSession call. 14 15 type ServerGetSession_Output struct { 15 - Did string `json:"did" cborgen:"did"` 16 - Email *string `json:"email,omitempty" cborgen:"email,omitempty"` 17 - EmailConfirmed *bool `json:"emailConfirmed,omitempty" cborgen:"emailConfirmed,omitempty"` 18 - Handle string `json:"handle" cborgen:"handle"` 16 + Did string `json:"did" cborgen:"did"` 17 + DidDoc *util.LexiconTypeDecoder `json:"didDoc,omitempty" cborgen:"didDoc,omitempty"` 18 + Email *string `json:"email,omitempty" cborgen:"email,omitempty"` 19 + EmailConfirmed *bool `json:"emailConfirmed,omitempty" cborgen:"emailConfirmed,omitempty"` 20 + Handle string `json:"handle" cborgen:"handle"` 19 21 } 20 22 21 23 // ServerGetSession calls the XRPC method "com.atproto.server.getSession".
+6 -4
api/atproto/serverrefreshSession.go
··· 7 7 import ( 8 8 "context" 9 9 10 + "github.com/bluesky-social/indigo/lex/util" 10 11 "github.com/bluesky-social/indigo/xrpc" 11 12 ) 12 13 13 14 // ServerRefreshSession_Output is the output of a com.atproto.server.refreshSession call. 14 15 type ServerRefreshSession_Output struct { 15 - AccessJwt string `json:"accessJwt" cborgen:"accessJwt"` 16 - Did string `json:"did" cborgen:"did"` 17 - Handle string `json:"handle" cborgen:"handle"` 18 - RefreshJwt string `json:"refreshJwt" cborgen:"refreshJwt"` 16 + AccessJwt string `json:"accessJwt" cborgen:"accessJwt"` 17 + Did string `json:"did" cborgen:"did"` 18 + DidDoc *util.LexiconTypeDecoder `json:"didDoc,omitempty" cborgen:"didDoc,omitempty"` 19 + Handle string `json:"handle" cborgen:"handle"` 20 + RefreshJwt string `json:"refreshJwt" cborgen:"refreshJwt"` 19 21 } 20 22 21 23 // ServerRefreshSession calls the XRPC method "com.atproto.server.refreshSession".
+33
api/atproto/serverreserveSigningKey.go
··· 1 + // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. 2 + 3 + package atproto 4 + 5 + // schema: com.atproto.server.reserveSigningKey 6 + 7 + import ( 8 + "context" 9 + 10 + "github.com/bluesky-social/indigo/xrpc" 11 + ) 12 + 13 + // ServerReserveSigningKey_Input is the input argument to a com.atproto.server.reserveSigningKey call. 14 + type ServerReserveSigningKey_Input struct { 15 + // did: The did to reserve a new did:key for 16 + Did *string `json:"did,omitempty" cborgen:"did,omitempty"` 17 + } 18 + 19 + // ServerReserveSigningKey_Output is the output of a com.atproto.server.reserveSigningKey call. 20 + type ServerReserveSigningKey_Output struct { 21 + // signingKey: Public signing key in the form of a did:key. 22 + SigningKey string `json:"signingKey" cborgen:"signingKey"` 23 + } 24 + 25 + // ServerReserveSigningKey calls the XRPC method "com.atproto.server.reserveSigningKey". 26 + func ServerReserveSigningKey(ctx context.Context, c *xrpc.Client, input *ServerReserveSigningKey_Input) (*ServerReserveSigningKey_Output, error) { 27 + var out ServerReserveSigningKey_Output 28 + if err := c.Do(ctx, xrpc.Procedure, "application/json", "com.atproto.server.reserveSigningKey", nil, input, &out); err != nil { 29 + return nil, err 30 + } 31 + 32 + return &out, nil 33 + }
+31
api/atproto/tempfetchLabels.go
··· 1 + // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. 2 + 3 + package atproto 4 + 5 + // schema: com.atproto.temp.fetchLabels 6 + 7 + import ( 8 + "context" 9 + 10 + "github.com/bluesky-social/indigo/xrpc" 11 + ) 12 + 13 + // TempFetchLabels_Output is the output of a com.atproto.temp.fetchLabels call. 14 + type TempFetchLabels_Output struct { 15 + Labels []*LabelDefs_Label `json:"labels" cborgen:"labels"` 16 + } 17 + 18 + // TempFetchLabels calls the XRPC method "com.atproto.temp.fetchLabels". 19 + func TempFetchLabels(ctx context.Context, c *xrpc.Client, limit int64, since int64) (*TempFetchLabels_Output, error) { 20 + var out TempFetchLabels_Output 21 + 22 + params := map[string]interface{}{ 23 + "limit": limit, 24 + "since": since, 25 + } 26 + if err := c.Do(ctx, xrpc.Query, "", "com.atproto.temp.fetchLabels", params, nil, &out); err != nil { 27 + return nil, err 28 + } 29 + 30 + return &out, nil 31 + }
+7 -6
api/bsky/actordefs.go
··· 184 184 185 185 // ActorDefs_ViewerState is a "viewerState" in the app.bsky.actor.defs schema. 186 186 type ActorDefs_ViewerState struct { 187 - BlockedBy *bool `json:"blockedBy,omitempty" cborgen:"blockedBy,omitempty"` 188 - Blocking *string `json:"blocking,omitempty" cborgen:"blocking,omitempty"` 189 - FollowedBy *string `json:"followedBy,omitempty" cborgen:"followedBy,omitempty"` 190 - Following *string `json:"following,omitempty" cborgen:"following,omitempty"` 191 - Muted *bool `json:"muted,omitempty" cborgen:"muted,omitempty"` 192 - MutedByList *GraphDefs_ListViewBasic `json:"mutedByList,omitempty" cborgen:"mutedByList,omitempty"` 187 + BlockedBy *bool `json:"blockedBy,omitempty" cborgen:"blockedBy,omitempty"` 188 + Blocking *string `json:"blocking,omitempty" cborgen:"blocking,omitempty"` 189 + BlockingByList *GraphDefs_ListViewBasic `json:"blockingByList,omitempty" cborgen:"blockingByList,omitempty"` 190 + FollowedBy *string `json:"followedBy,omitempty" cborgen:"followedBy,omitempty"` 191 + Following *string `json:"following,omitempty" cborgen:"following,omitempty"` 192 + Muted *bool `json:"muted,omitempty" cborgen:"muted,omitempty"` 193 + MutedByList *GraphDefs_ListViewBasic `json:"mutedByList,omitempty" cborgen:"mutedByList,omitempty"` 193 194 }
+361 -1
api/bsky/cbor_gen.go
··· 1677 1677 } 1678 1678 1679 1679 cw := cbg.NewCborWriter(w) 1680 + fieldCount := 3 1680 1681 1681 - if _, err := cw.Write([]byte{162}); err != nil { 1682 + if t.AspectRatio == nil { 1683 + fieldCount-- 1684 + } 1685 + 1686 + if _, err := cw.Write(cbg.CborEncodeMajorType(cbg.MajMap, uint64(fieldCount))); err != nil { 1682 1687 return err 1683 1688 } 1684 1689 ··· 1720 1725 if err := t.Image.MarshalCBOR(cw); err != nil { 1721 1726 return err 1722 1727 } 1728 + 1729 + // t.AspectRatio (bsky.EmbedImages_AspectRatio) (struct) 1730 + if t.AspectRatio != nil { 1731 + 1732 + if len("aspectRatio") > cbg.MaxLength { 1733 + return xerrors.Errorf("Value in field \"aspectRatio\" was too long") 1734 + } 1735 + 1736 + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("aspectRatio"))); err != nil { 1737 + return err 1738 + } 1739 + if _, err := cw.WriteString(string("aspectRatio")); err != nil { 1740 + return err 1741 + } 1742 + 1743 + if err := t.AspectRatio.MarshalCBOR(cw); err != nil { 1744 + return err 1745 + } 1746 + } 1723 1747 return nil 1724 1748 } 1725 1749 ··· 1788 1812 t.Image = new(util.LexBlob) 1789 1813 if err := t.Image.UnmarshalCBOR(cr); err != nil { 1790 1814 return xerrors.Errorf("unmarshaling t.Image pointer: %w", err) 1815 + } 1816 + } 1817 + 1818 + } 1819 + // t.AspectRatio (bsky.EmbedImages_AspectRatio) (struct) 1820 + case "aspectRatio": 1821 + 1822 + { 1823 + 1824 + b, err := cr.ReadByte() 1825 + if err != nil { 1826 + return err 1827 + } 1828 + if b != cbg.CborNull[0] { 1829 + if err := cr.UnreadByte(); err != nil { 1830 + return err 1831 + } 1832 + t.AspectRatio = new(EmbedImages_AspectRatio) 1833 + if err := t.AspectRatio.UnmarshalCBOR(cr); err != nil { 1834 + return xerrors.Errorf("unmarshaling t.AspectRatio pointer: %w", err) 1791 1835 } 1792 1836 } 1793 1837 ··· 4752 4796 4753 4797 return nil 4754 4798 } 4799 + func (t *GraphListblock) MarshalCBOR(w io.Writer) error { 4800 + if t == nil { 4801 + _, err := w.Write(cbg.CborNull) 4802 + return err 4803 + } 4804 + 4805 + cw := cbg.NewCborWriter(w) 4806 + 4807 + if _, err := cw.Write([]byte{163}); err != nil { 4808 + return err 4809 + } 4810 + 4811 + // t.LexiconTypeID (string) (string) 4812 + if len("$type") > cbg.MaxLength { 4813 + return xerrors.Errorf("Value in field \"$type\" was too long") 4814 + } 4815 + 4816 + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("$type"))); err != nil { 4817 + return err 4818 + } 4819 + if _, err := cw.WriteString(string("$type")); err != nil { 4820 + return err 4821 + } 4822 + 4823 + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("app.bsky.graph.listblock"))); err != nil { 4824 + return err 4825 + } 4826 + if _, err := cw.WriteString(string("app.bsky.graph.listblock")); err != nil { 4827 + return err 4828 + } 4829 + 4830 + // t.Subject (string) (string) 4831 + if len("subject") > cbg.MaxLength { 4832 + return xerrors.Errorf("Value in field \"subject\" was too long") 4833 + } 4834 + 4835 + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("subject"))); err != nil { 4836 + return err 4837 + } 4838 + if _, err := cw.WriteString(string("subject")); err != nil { 4839 + return err 4840 + } 4841 + 4842 + if len(t.Subject) > cbg.MaxLength { 4843 + return xerrors.Errorf("Value in field t.Subject was too long") 4844 + } 4845 + 4846 + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Subject))); err != nil { 4847 + return err 4848 + } 4849 + if _, err := cw.WriteString(string(t.Subject)); err != nil { 4850 + return err 4851 + } 4852 + 4853 + // t.CreatedAt (string) (string) 4854 + if len("createdAt") > cbg.MaxLength { 4855 + return xerrors.Errorf("Value in field \"createdAt\" was too long") 4856 + } 4857 + 4858 + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("createdAt"))); err != nil { 4859 + return err 4860 + } 4861 + if _, err := cw.WriteString(string("createdAt")); err != nil { 4862 + return err 4863 + } 4864 + 4865 + if len(t.CreatedAt) > cbg.MaxLength { 4866 + return xerrors.Errorf("Value in field t.CreatedAt was too long") 4867 + } 4868 + 4869 + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.CreatedAt))); err != nil { 4870 + return err 4871 + } 4872 + if _, err := cw.WriteString(string(t.CreatedAt)); err != nil { 4873 + return err 4874 + } 4875 + return nil 4876 + } 4877 + 4878 + func (t *GraphListblock) UnmarshalCBOR(r io.Reader) (err error) { 4879 + *t = GraphListblock{} 4880 + 4881 + cr := cbg.NewCborReader(r) 4882 + 4883 + maj, extra, err := cr.ReadHeader() 4884 + if err != nil { 4885 + return err 4886 + } 4887 + defer func() { 4888 + if err == io.EOF { 4889 + err = io.ErrUnexpectedEOF 4890 + } 4891 + }() 4892 + 4893 + if maj != cbg.MajMap { 4894 + return fmt.Errorf("cbor input should be of type map") 4895 + } 4896 + 4897 + if extra > cbg.MaxLength { 4898 + return fmt.Errorf("GraphListblock: map struct too large (%d)", extra) 4899 + } 4900 + 4901 + var name string 4902 + n := extra 4903 + 4904 + for i := uint64(0); i < n; i++ { 4905 + 4906 + { 4907 + sval, err := cbg.ReadString(cr) 4908 + if err != nil { 4909 + return err 4910 + } 4911 + 4912 + name = string(sval) 4913 + } 4914 + 4915 + switch name { 4916 + // t.LexiconTypeID (string) (string) 4917 + case "$type": 4918 + 4919 + { 4920 + sval, err := cbg.ReadString(cr) 4921 + if err != nil { 4922 + return err 4923 + } 4924 + 4925 + t.LexiconTypeID = string(sval) 4926 + } 4927 + // t.Subject (string) (string) 4928 + case "subject": 4929 + 4930 + { 4931 + sval, err := cbg.ReadString(cr) 4932 + if err != nil { 4933 + return err 4934 + } 4935 + 4936 + t.Subject = string(sval) 4937 + } 4938 + // t.CreatedAt (string) (string) 4939 + case "createdAt": 4940 + 4941 + { 4942 + sval, err := cbg.ReadString(cr) 4943 + if err != nil { 4944 + return err 4945 + } 4946 + 4947 + t.CreatedAt = string(sval) 4948 + } 4949 + 4950 + default: 4951 + // Field doesn't exist on this type, so ignore it 4952 + cbg.ScanForLinks(r, func(cid.Cid) {}) 4953 + } 4954 + } 4955 + 4956 + return nil 4957 + } 4958 + func (t *EmbedImages_AspectRatio) MarshalCBOR(w io.Writer) error { 4959 + if t == nil { 4960 + _, err := w.Write(cbg.CborNull) 4961 + return err 4962 + } 4963 + 4964 + cw := cbg.NewCborWriter(w) 4965 + 4966 + if _, err := cw.Write([]byte{162}); err != nil { 4967 + return err 4968 + } 4969 + 4970 + // t.Width (int64) (int64) 4971 + if len("width") > cbg.MaxLength { 4972 + return xerrors.Errorf("Value in field \"width\" was too long") 4973 + } 4974 + 4975 + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("width"))); err != nil { 4976 + return err 4977 + } 4978 + if _, err := cw.WriteString(string("width")); err != nil { 4979 + return err 4980 + } 4981 + 4982 + if t.Width >= 0 { 4983 + if err := cw.WriteMajorTypeHeader(cbg.MajUnsignedInt, uint64(t.Width)); err != nil { 4984 + return err 4985 + } 4986 + } else { 4987 + if err := cw.WriteMajorTypeHeader(cbg.MajNegativeInt, uint64(-t.Width-1)); err != nil { 4988 + return err 4989 + } 4990 + } 4991 + 4992 + // t.Height (int64) (int64) 4993 + if len("height") > cbg.MaxLength { 4994 + return xerrors.Errorf("Value in field \"height\" was too long") 4995 + } 4996 + 4997 + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("height"))); err != nil { 4998 + return err 4999 + } 5000 + if _, err := cw.WriteString(string("height")); err != nil { 5001 + return err 5002 + } 5003 + 5004 + if t.Height >= 0 { 5005 + if err := cw.WriteMajorTypeHeader(cbg.MajUnsignedInt, uint64(t.Height)); err != nil { 5006 + return err 5007 + } 5008 + } else { 5009 + if err := cw.WriteMajorTypeHeader(cbg.MajNegativeInt, uint64(-t.Height-1)); err != nil { 5010 + return err 5011 + } 5012 + } 5013 + return nil 5014 + } 5015 + 5016 + func (t *EmbedImages_AspectRatio) UnmarshalCBOR(r io.Reader) (err error) { 5017 + *t = EmbedImages_AspectRatio{} 5018 + 5019 + cr := cbg.NewCborReader(r) 5020 + 5021 + maj, extra, err := cr.ReadHeader() 5022 + if err != nil { 5023 + return err 5024 + } 5025 + defer func() { 5026 + if err == io.EOF { 5027 + err = io.ErrUnexpectedEOF 5028 + } 5029 + }() 5030 + 5031 + if maj != cbg.MajMap { 5032 + return fmt.Errorf("cbor input should be of type map") 5033 + } 5034 + 5035 + if extra > cbg.MaxLength { 5036 + return fmt.Errorf("EmbedImages_AspectRatio: map struct too large (%d)", extra) 5037 + } 5038 + 5039 + var name string 5040 + n := extra 5041 + 5042 + for i := uint64(0); i < n; i++ { 5043 + 5044 + { 5045 + sval, err := cbg.ReadString(cr) 5046 + if err != nil { 5047 + return err 5048 + } 5049 + 5050 + name = string(sval) 5051 + } 5052 + 5053 + switch name { 5054 + // t.Width (int64) (int64) 5055 + case "width": 5056 + { 5057 + maj, extra, err := cr.ReadHeader() 5058 + var extraI int64 5059 + if err != nil { 5060 + return err 5061 + } 5062 + switch maj { 5063 + case cbg.MajUnsignedInt: 5064 + extraI = int64(extra) 5065 + if extraI < 0 { 5066 + return fmt.Errorf("int64 positive overflow") 5067 + } 5068 + case cbg.MajNegativeInt: 5069 + extraI = int64(extra) 5070 + if extraI < 0 { 5071 + return fmt.Errorf("int64 negative overflow") 5072 + } 5073 + extraI = -1 - extraI 5074 + default: 5075 + return fmt.Errorf("wrong type for int64 field: %d", maj) 5076 + } 5077 + 5078 + t.Width = int64(extraI) 5079 + } 5080 + // t.Height (int64) (int64) 5081 + case "height": 5082 + { 5083 + maj, extra, err := cr.ReadHeader() 5084 + var extraI int64 5085 + if err != nil { 5086 + return err 5087 + } 5088 + switch maj { 5089 + case cbg.MajUnsignedInt: 5090 + extraI = int64(extra) 5091 + if extraI < 0 { 5092 + return fmt.Errorf("int64 positive overflow") 5093 + } 5094 + case cbg.MajNegativeInt: 5095 + extraI = int64(extra) 5096 + if extraI < 0 { 5097 + return fmt.Errorf("int64 negative overflow") 5098 + } 5099 + extraI = -1 - extraI 5100 + default: 5101 + return fmt.Errorf("wrong type for int64 field: %d", maj) 5102 + } 5103 + 5104 + t.Height = int64(extraI) 5105 + } 5106 + 5107 + default: 5108 + // Field doesn't exist on this type, so ignore it 5109 + cbg.ScanForLinks(r, func(cid.Cid) {}) 5110 + } 5111 + } 5112 + 5113 + return nil 5114 + }
+15 -5
api/bsky/embedimages.go
··· 17 17 Images []*EmbedImages_Image `json:"images" cborgen:"images"` 18 18 } 19 19 20 + // EmbedImages_AspectRatio is a "aspectRatio" in the app.bsky.embed.images schema. 21 + // 22 + // width:height represents an aspect ratio. It may be approximate, and may not correspond to absolute dimensions in any given unit. 23 + type EmbedImages_AspectRatio struct { 24 + Height int64 `json:"height" cborgen:"height"` 25 + Width int64 `json:"width" cborgen:"width"` 26 + } 27 + 20 28 // EmbedImages_Image is a "image" in the app.bsky.embed.images schema. 21 29 type EmbedImages_Image struct { 22 - Alt string `json:"alt" cborgen:"alt"` 23 - Image *util.LexBlob `json:"image" cborgen:"image"` 30 + Alt string `json:"alt" cborgen:"alt"` 31 + AspectRatio *EmbedImages_AspectRatio `json:"aspectRatio,omitempty" cborgen:"aspectRatio,omitempty"` 32 + Image *util.LexBlob `json:"image" cborgen:"image"` 24 33 } 25 34 26 35 // EmbedImages_View is a "view" in the app.bsky.embed.images schema. ··· 33 42 34 43 // EmbedImages_ViewImage is a "viewImage" in the app.bsky.embed.images schema. 35 44 type EmbedImages_ViewImage struct { 36 - Alt string `json:"alt" cborgen:"alt"` 37 - Fullsize string `json:"fullsize" cborgen:"fullsize"` 38 - Thumb string `json:"thumb" cborgen:"thumb"` 45 + Alt string `json:"alt" cborgen:"alt"` 46 + AspectRatio *EmbedImages_AspectRatio `json:"aspectRatio,omitempty" cborgen:"aspectRatio,omitempty"` 47 + Fullsize string `json:"fullsize" cborgen:"fullsize"` 48 + Thumb string `json:"thumb" cborgen:"thumb"` 39 49 }
+19
api/bsky/graphlistblock.go
··· 1 + // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. 2 + 3 + package bsky 4 + 5 + // schema: app.bsky.graph.listblock 6 + 7 + import ( 8 + "github.com/bluesky-social/indigo/lex/util" 9 + ) 10 + 11 + func init() { 12 + util.RegisterType("app.bsky.graph.listblock", &GraphListblock{}) 13 + } // 14 + // RECORDTYPE: GraphListblock 15 + type GraphListblock struct { 16 + LexiconTypeID string `json:"$type,const=app.bsky.graph.listblock" cborgen:"$type,const=app.bsky.graph.listblock"` 17 + CreatedAt string `json:"createdAt" cborgen:"createdAt"` 18 + Subject string `json:"subject" cborgen:"subject"` 19 + }
+2 -2
cmd/gosky/account.go
··· 79 79 } 80 80 81 81 acc, err := comatproto.ServerCreateAccount(context.TODO(), xrpcc, &comatproto.ServerCreateAccount_Input{ 82 - Email: email, 82 + Email: &email, 83 83 Handle: handle, 84 84 InviteCode: invite, 85 - Password: password, 85 + Password: &password, 86 86 }) 87 87 if err != nil { 88 88 return err
+4 -2
cmd/stress/main.go
··· 104 104 domain := cfg.AvailableUserDomains[0] 105 105 fmt.Println("domain: ", domain) 106 106 107 + email := fmt.Sprintf("user-%s@test.com", id) 108 + pass := "password" 107 109 resp, err := comatproto.ServerCreateAccount(ctx, xrpcc, &comatproto.ServerCreateAccount_Input{ 108 - Email: fmt.Sprintf("user-%s@test.com", id), 110 + Email: &email, 109 111 Handle: "user-" + id + domain, 110 - Password: "password", 112 + Password: &pass, 111 113 InviteCode: invite, 112 114 }) 113 115 if err != nil {
+2 -2
fakedata/generators.go
··· 51 51 password := gofakeit.Password(true, true, true, true, true, 24) 52 52 ctx := context.TODO() 53 53 resp, err := comatproto.ServerCreateAccount(ctx, xrpcc, &comatproto.ServerCreateAccount_Input{ 54 - Email: email, 54 + Email: &email, 55 55 Handle: handle, 56 56 InviteCode: inviteCode, 57 - Password: password, 57 + Password: &password, 58 58 }) 59 59 if err != nil { 60 60 return nil, err
+2
gen/main.go
··· 45 45 bsky.GraphList{}, 46 46 bsky.GraphListitem{}, 47 47 bsky.FeedGenerator{}, 48 + bsky.GraphListblock{}, 49 + bsky.EmbedImages_AspectRatio{}, 48 50 /*bsky.EmbedImages_View{}, 49 51 bsky.EmbedRecord_View{}, bsky.EmbedRecordWithMedia_View{}, 50 52 bsky.EmbedExternal_View{}, bsky.EmbedImages_ViewImage{},
+68 -6
pds/handlers.go
··· 276 276 } 277 277 278 278 func (s *Server) handleComAtprotoServerCreateAccount(ctx context.Context, body *comatprototypes.ServerCreateAccount_Input) (*comatprototypes.ServerCreateAccount_Output, error) { 279 + if body.Email == nil { 280 + return nil, fmt.Errorf("email is required") 281 + } 279 282 280 - if err := validateEmail(body.Email); err != nil { 283 + if body.Password == nil { 284 + return nil, fmt.Errorf("password is required") 285 + } 286 + 287 + if err := validateEmail(*body.Email); err != nil { 281 288 return nil, err 282 289 } 283 290 ··· 302 309 303 310 u := User{ 304 311 Handle: body.Handle, 305 - Password: body.Password, 312 + Password: *body.Password, 306 313 RecoveryKey: recoveryKey, 307 - Email: body.Email, 314 + Email: *body.Email, 308 315 } 309 316 if err := s.db.Create(&u).Error; err != nil { 310 317 return nil, err ··· 639 646 func (s *Server) handleComAtprotoAdminReverseModerationAction(ctx context.Context, body *comatprototypes.AdminReverseModerationAction_Input) (*comatprototypes.AdminDefs_ActionView, error) { 640 647 panic("nyi") 641 648 } 642 - func (s *Server) handleComAtprotoAdminSearchRepos(ctx context.Context, cursor string, invitedBy string, limit int, term string) (*comatprototypes.AdminSearchRepos_Output, error) { 649 + func (s *Server) handleComAtprotoAdminSearchRepos(ctx context.Context, cursor string, limit int, q string, term string) (*comatprototypes.AdminSearchRepos_Output, error) { 643 650 panic("nyi") 644 651 } 645 652 func (s *Server) handleComAtprotoAdminTakeModerationAction(ctx context.Context, body *comatprototypes.AdminTakeModerationAction_Input) (*comatprototypes.AdminDefs_ActionView, error) { ··· 666 673 panic("nyi") 667 674 } 668 675 669 - func (s *Server) handleAppBskyActorSearchActors(ctx context.Context, cursor string, limit int, term string) (*appbskytypes.ActorSearchActors_Output, error) { 676 + func (s *Server) handleAppBskyActorSearchActors(ctx context.Context, cursor string, limit int, q string, term string) (*appbskytypes.ActorSearchActors_Output, error) { 670 677 panic("nyi") 671 678 } 672 679 673 - func (s *Server) handleAppBskyActorSearchActorsTypeahead(ctx context.Context, limit int, term string) (*appbskytypes.ActorSearchActorsTypeahead_Output, error) { 680 + func (s *Server) handleAppBskyActorSearchActorsTypeahead(ctx context.Context, limit int, q string, term string) (*appbskytypes.ActorSearchActorsTypeahead_Output, error) { 674 681 panic("nyi") 675 682 } 676 683 ··· 831 838 func (s *Server) handleComAtprotoTempUpgradeRepoVersion(ctx context.Context, body *comatprototypes.TempUpgradeRepoVersion_Input) error { 832 839 panic("nyi") 833 840 } 841 + 842 + func (s *Server) handleAppBskyFeedGetListFeed(ctx context.Context, cursor string, limit int, list string) (*appbskytypes.FeedGetListFeed_Output, error) { 843 + panic("nyi") 844 + } 845 + 846 + func (s *Server) handleAppBskyFeedGetSuggestedFeeds(ctx context.Context, cursor string, limit int) (*appbskytypes.FeedGetSuggestedFeeds_Output, error) { 847 + panic("nyi") 848 + } 849 + 850 + func (s *Server) handleAppBskyFeedSearchPosts(ctx context.Context, cursor string, limit int, q string) (*appbskytypes.FeedSearchPosts_Output, error) { 851 + panic("nyi") 852 + } 853 + 854 + func (s *Server) handleAppBskyGraphGetListBlocks(ctx context.Context, cursor string, limit int) (*appbskytypes.GraphGetListBlocks_Output, error) { 855 + panic("nyi") 856 + } 857 + 858 + func (s *Server) handleAppBskyGraphGetSuggestedFollowsByActor(ctx context.Context, actor string) (*appbskytypes.GraphGetSuggestedFollowsByActor_Output, error) { 859 + panic("nyi") 860 + } 861 + 862 + func (s *Server) handleAppBskyUnspeccedSearchActorsSkeleton(ctx context.Context, cursor string, limit int, q string, typeahead *bool) (*appbskytypes.UnspeccedSearchActorsSkeleton_Output, error) { 863 + panic("nyi") 864 + } 865 + func (s *Server) handleAppBskyUnspeccedSearchPostsSkeleton(ctx context.Context, cursor string, limit int, q string) (*appbskytypes.UnspeccedSearchPostsSkeleton_Output, error) { 866 + panic("nyi") 867 + } 868 + func (s *Server) handleComAtprotoAdminGetAccountInfo(ctx context.Context, did string) (*comatprototypes.AdminDefs_AccountView, error) { 869 + panic("nyi") 870 + } 871 + func (s *Server) handleComAtprotoAdminGetSubjectStatus(ctx context.Context, blob string, did string, uri string) (*comatprototypes.AdminGetSubjectStatus_Output, error) { 872 + panic("nyi") 873 + } 874 + 875 + func (s *Server) handleComAtprotoAdminUpdateSubjectStatus(ctx context.Context, body *comatprototypes.AdminUpdateSubjectStatus_Input) (*comatprototypes.AdminUpdateSubjectStatus_Output, error) { 876 + panic("nyi") 877 + } 878 + func (s *Server) handleComAtprotoServerConfirmEmail(ctx context.Context, body *comatprototypes.ServerConfirmEmail_Input) error { 879 + panic("nyi") 880 + } 881 + func (s *Server) handleComAtprotoServerRequestEmailConfirmation(ctx context.Context) error { 882 + panic("nyi") 883 + } 884 + func (s *Server) handleComAtprotoServerRequestEmailUpdate(ctx context.Context) (*comatprototypes.ServerRequestEmailUpdate_Output, error) { 885 + panic("nyi") 886 + } 887 + func (s *Server) handleComAtprotoServerReserveSigningKey(ctx context.Context, body *comatprototypes.ServerReserveSigningKey_Input) (*comatprototypes.ServerReserveSigningKey_Output, error) { 888 + panic("nyi") 889 + } 890 + func (s *Server) handleComAtprotoServerUpdateEmail(ctx context.Context, body *comatprototypes.ServerUpdateEmail_Input) error { 891 + panic("nyi") 892 + } 893 + func (s *Server) handleComAtprotoTempFetchLabels(ctx context.Context, limit int, since *int) (*comatprototypes.TempFetchLabels_Output, error) { 894 + panic("nyi") 895 + }
+8 -4
pds/handlers_test.go
··· 75 75 s, cleanup := newTestServer(t) 76 76 defer cleanup() 77 77 78 + e := "test@foo.com" 79 + p := "password" 78 80 o, err := s.handleComAtprotoServerCreateAccount(context.Background(), &atproto.ServerCreateAccount_Input{ 79 - Email: "test@foo.com", 80 - Password: "password", 81 + Email: &e, 82 + Password: &p, 81 83 Handle: "testman.test", 82 84 }) 83 85 if err != nil { ··· 97 99 s, cleanup := newTestServer(t) 98 100 defer cleanup() 99 101 102 + e := "test@foo.com" 103 + p := "password" 100 104 o, err := s.handleComAtprotoServerCreateAccount(context.Background(), &atproto.ServerCreateAccount_Input{ 101 - Email: "test@foo.com", 102 - Password: "password", 105 + Email: &e, 106 + Password: &p, 103 107 Handle: "testman.test", 104 108 }) 105 109 if err != nil {
+353 -36
pds/stubs.go
··· 27 27 e.GET("/xrpc/app.bsky.feed.getFeedGenerators", s.HandleAppBskyFeedGetFeedGenerators) 28 28 e.GET("/xrpc/app.bsky.feed.getFeedSkeleton", s.HandleAppBskyFeedGetFeedSkeleton) 29 29 e.GET("/xrpc/app.bsky.feed.getLikes", s.HandleAppBskyFeedGetLikes) 30 + e.GET("/xrpc/app.bsky.feed.getListFeed", s.HandleAppBskyFeedGetListFeed) 30 31 e.GET("/xrpc/app.bsky.feed.getPostThread", s.HandleAppBskyFeedGetPostThread) 31 32 e.GET("/xrpc/app.bsky.feed.getPosts", s.HandleAppBskyFeedGetPosts) 32 33 e.GET("/xrpc/app.bsky.feed.getRepostedBy", s.HandleAppBskyFeedGetRepostedBy) 34 + e.GET("/xrpc/app.bsky.feed.getSuggestedFeeds", s.HandleAppBskyFeedGetSuggestedFeeds) 33 35 e.GET("/xrpc/app.bsky.feed.getTimeline", s.HandleAppBskyFeedGetTimeline) 36 + e.GET("/xrpc/app.bsky.feed.searchPosts", s.HandleAppBskyFeedSearchPosts) 34 37 e.GET("/xrpc/app.bsky.graph.getBlocks", s.HandleAppBskyGraphGetBlocks) 35 38 e.GET("/xrpc/app.bsky.graph.getFollowers", s.HandleAppBskyGraphGetFollowers) 36 39 e.GET("/xrpc/app.bsky.graph.getFollows", s.HandleAppBskyGraphGetFollows) 37 40 e.GET("/xrpc/app.bsky.graph.getList", s.HandleAppBskyGraphGetList) 41 + e.GET("/xrpc/app.bsky.graph.getListBlocks", s.HandleAppBskyGraphGetListBlocks) 38 42 e.GET("/xrpc/app.bsky.graph.getListMutes", s.HandleAppBskyGraphGetListMutes) 39 43 e.GET("/xrpc/app.bsky.graph.getLists", s.HandleAppBskyGraphGetLists) 40 44 e.GET("/xrpc/app.bsky.graph.getMutes", s.HandleAppBskyGraphGetMutes) 45 + e.GET("/xrpc/app.bsky.graph.getSuggestedFollowsByActor", s.HandleAppBskyGraphGetSuggestedFollowsByActor) 41 46 e.POST("/xrpc/app.bsky.graph.muteActor", s.HandleAppBskyGraphMuteActor) 42 47 e.POST("/xrpc/app.bsky.graph.muteActorList", s.HandleAppBskyGraphMuteActorList) 43 48 e.POST("/xrpc/app.bsky.graph.unmuteActor", s.HandleAppBskyGraphUnmuteActor) ··· 46 51 e.GET("/xrpc/app.bsky.notification.listNotifications", s.HandleAppBskyNotificationListNotifications) 47 52 e.POST("/xrpc/app.bsky.notification.registerPush", s.HandleAppBskyNotificationRegisterPush) 48 53 e.POST("/xrpc/app.bsky.notification.updateSeen", s.HandleAppBskyNotificationUpdateSeen) 49 - e.POST("/xrpc/app.bsky.unspecced.applyLabels", s.HandleAppBskyUnspeccedApplyLabels) 50 54 e.GET("/xrpc/app.bsky.unspecced.getPopular", s.HandleAppBskyUnspeccedGetPopular) 51 55 e.GET("/xrpc/app.bsky.unspecced.getPopularFeedGenerators", s.HandleAppBskyUnspeccedGetPopularFeedGenerators) 52 56 e.GET("/xrpc/app.bsky.unspecced.getTimelineSkeleton", s.HandleAppBskyUnspeccedGetTimelineSkeleton) 57 + e.GET("/xrpc/app.bsky.unspecced.searchActorsSkeleton", s.HandleAppBskyUnspeccedSearchActorsSkeleton) 58 + e.GET("/xrpc/app.bsky.unspecced.searchPostsSkeleton", s.HandleAppBskyUnspeccedSearchPostsSkeleton) 53 59 return nil 54 60 } 55 61 ··· 150 156 return err 151 157 } 152 158 } else { 153 - limit = 50 159 + limit = 25 154 160 } 161 + q := c.QueryParam("q") 155 162 term := c.QueryParam("term") 156 163 var out *appbskytypes.ActorSearchActors_Output 157 164 var handleErr error 158 - // func (s *Server) handleAppBskyActorSearchActors(ctx context.Context,cursor string,limit int,term string) (*appbskytypes.ActorSearchActors_Output, error) 159 - out, handleErr = s.handleAppBskyActorSearchActors(ctx, cursor, limit, term) 165 + // func (s *Server) handleAppBskyActorSearchActors(ctx context.Context,cursor string,limit int,q string,term string) (*appbskytypes.ActorSearchActors_Output, error) 166 + out, handleErr = s.handleAppBskyActorSearchActors(ctx, cursor, limit, q, term) 160 167 if handleErr != nil { 161 168 return handleErr 162 169 } ··· 175 182 return err 176 183 } 177 184 } else { 178 - limit = 50 185 + limit = 10 179 186 } 187 + q := c.QueryParam("q") 180 188 term := c.QueryParam("term") 181 189 var out *appbskytypes.ActorSearchActorsTypeahead_Output 182 190 var handleErr error 183 - // func (s *Server) handleAppBskyActorSearchActorsTypeahead(ctx context.Context,limit int,term string) (*appbskytypes.ActorSearchActorsTypeahead_Output, error) 184 - out, handleErr = s.handleAppBskyActorSearchActorsTypeahead(ctx, limit, term) 191 + // func (s *Server) handleAppBskyActorSearchActorsTypeahead(ctx context.Context,limit int,q string,term string) (*appbskytypes.ActorSearchActorsTypeahead_Output, error) 192 + out, handleErr = s.handleAppBskyActorSearchActorsTypeahead(ctx, limit, q, term) 185 193 if handleErr != nil { 186 194 return handleErr 187 195 } ··· 388 396 return c.JSON(200, out) 389 397 } 390 398 399 + func (s *Server) HandleAppBskyFeedGetListFeed(c echo.Context) error { 400 + ctx, span := otel.Tracer("server").Start(c.Request().Context(), "HandleAppBskyFeedGetListFeed") 401 + defer span.End() 402 + cursor := c.QueryParam("cursor") 403 + 404 + var limit int 405 + if p := c.QueryParam("limit"); p != "" { 406 + var err error 407 + limit, err = strconv.Atoi(p) 408 + if err != nil { 409 + return err 410 + } 411 + } else { 412 + limit = 50 413 + } 414 + list := c.QueryParam("list") 415 + var out *appbskytypes.FeedGetListFeed_Output 416 + var handleErr error 417 + // func (s *Server) handleAppBskyFeedGetListFeed(ctx context.Context,cursor string,limit int,list string) (*appbskytypes.FeedGetListFeed_Output, error) 418 + out, handleErr = s.handleAppBskyFeedGetListFeed(ctx, cursor, limit, list) 419 + if handleErr != nil { 420 + return handleErr 421 + } 422 + return c.JSON(200, out) 423 + } 424 + 391 425 func (s *Server) HandleAppBskyFeedGetPostThread(c echo.Context) error { 392 426 ctx, span := otel.Tracer("server").Start(c.Request().Context(), "HandleAppBskyFeedGetPostThread") 393 427 defer span.End() ··· 466 500 return c.JSON(200, out) 467 501 } 468 502 503 + func (s *Server) HandleAppBskyFeedGetSuggestedFeeds(c echo.Context) error { 504 + ctx, span := otel.Tracer("server").Start(c.Request().Context(), "HandleAppBskyFeedGetSuggestedFeeds") 505 + defer span.End() 506 + cursor := c.QueryParam("cursor") 507 + 508 + var limit int 509 + if p := c.QueryParam("limit"); p != "" { 510 + var err error 511 + limit, err = strconv.Atoi(p) 512 + if err != nil { 513 + return err 514 + } 515 + } else { 516 + limit = 50 517 + } 518 + var out *appbskytypes.FeedGetSuggestedFeeds_Output 519 + var handleErr error 520 + // func (s *Server) handleAppBskyFeedGetSuggestedFeeds(ctx context.Context,cursor string,limit int) (*appbskytypes.FeedGetSuggestedFeeds_Output, error) 521 + out, handleErr = s.handleAppBskyFeedGetSuggestedFeeds(ctx, cursor, limit) 522 + if handleErr != nil { 523 + return handleErr 524 + } 525 + return c.JSON(200, out) 526 + } 527 + 469 528 func (s *Server) HandleAppBskyFeedGetTimeline(c echo.Context) error { 470 529 ctx, span := otel.Tracer("server").Start(c.Request().Context(), "HandleAppBskyFeedGetTimeline") 471 530 defer span.End() ··· 492 551 return c.JSON(200, out) 493 552 } 494 553 554 + func (s *Server) HandleAppBskyFeedSearchPosts(c echo.Context) error { 555 + ctx, span := otel.Tracer("server").Start(c.Request().Context(), "HandleAppBskyFeedSearchPosts") 556 + defer span.End() 557 + cursor := c.QueryParam("cursor") 558 + 559 + var limit int 560 + if p := c.QueryParam("limit"); p != "" { 561 + var err error 562 + limit, err = strconv.Atoi(p) 563 + if err != nil { 564 + return err 565 + } 566 + } else { 567 + limit = 25 568 + } 569 + q := c.QueryParam("q") 570 + var out *appbskytypes.FeedSearchPosts_Output 571 + var handleErr error 572 + // func (s *Server) handleAppBskyFeedSearchPosts(ctx context.Context,cursor string,limit int,q string) (*appbskytypes.FeedSearchPosts_Output, error) 573 + out, handleErr = s.handleAppBskyFeedSearchPosts(ctx, cursor, limit, q) 574 + if handleErr != nil { 575 + return handleErr 576 + } 577 + return c.JSON(200, out) 578 + } 579 + 495 580 func (s *Server) HandleAppBskyGraphGetBlocks(c echo.Context) error { 496 581 ctx, span := otel.Tracer("server").Start(c.Request().Context(), "HandleAppBskyGraphGetBlocks") 497 582 defer span.End() ··· 595 680 return c.JSON(200, out) 596 681 } 597 682 683 + func (s *Server) HandleAppBskyGraphGetListBlocks(c echo.Context) error { 684 + ctx, span := otel.Tracer("server").Start(c.Request().Context(), "HandleAppBskyGraphGetListBlocks") 685 + defer span.End() 686 + cursor := c.QueryParam("cursor") 687 + 688 + var limit int 689 + if p := c.QueryParam("limit"); p != "" { 690 + var err error 691 + limit, err = strconv.Atoi(p) 692 + if err != nil { 693 + return err 694 + } 695 + } else { 696 + limit = 50 697 + } 698 + var out *appbskytypes.GraphGetListBlocks_Output 699 + var handleErr error 700 + // func (s *Server) handleAppBskyGraphGetListBlocks(ctx context.Context,cursor string,limit int) (*appbskytypes.GraphGetListBlocks_Output, error) 701 + out, handleErr = s.handleAppBskyGraphGetListBlocks(ctx, cursor, limit) 702 + if handleErr != nil { 703 + return handleErr 704 + } 705 + return c.JSON(200, out) 706 + } 707 + 598 708 func (s *Server) HandleAppBskyGraphGetListMutes(c echo.Context) error { 599 709 ctx, span := otel.Tracer("server").Start(c.Request().Context(), "HandleAppBskyGraphGetListMutes") 600 710 defer span.End() ··· 665 775 var handleErr error 666 776 // func (s *Server) handleAppBskyGraphGetMutes(ctx context.Context,cursor string,limit int) (*appbskytypes.GraphGetMutes_Output, error) 667 777 out, handleErr = s.handleAppBskyGraphGetMutes(ctx, cursor, limit) 778 + if handleErr != nil { 779 + return handleErr 780 + } 781 + return c.JSON(200, out) 782 + } 783 + 784 + func (s *Server) HandleAppBskyGraphGetSuggestedFollowsByActor(c echo.Context) error { 785 + ctx, span := otel.Tracer("server").Start(c.Request().Context(), "HandleAppBskyGraphGetSuggestedFollowsByActor") 786 + defer span.End() 787 + actor := c.QueryParam("actor") 788 + var out *appbskytypes.GraphGetSuggestedFollowsByActor_Output 789 + var handleErr error 790 + // func (s *Server) handleAppBskyGraphGetSuggestedFollowsByActor(ctx context.Context,actor string) (*appbskytypes.GraphGetSuggestedFollowsByActor_Output, error) 791 + out, handleErr = s.handleAppBskyGraphGetSuggestedFollowsByActor(ctx, actor) 668 792 if handleErr != nil { 669 793 return handleErr 670 794 } ··· 813 937 return nil 814 938 } 815 939 816 - func (s *Server) HandleAppBskyUnspeccedApplyLabels(c echo.Context) error { 817 - ctx, span := otel.Tracer("server").Start(c.Request().Context(), "HandleAppBskyUnspeccedApplyLabels") 818 - defer span.End() 819 - 820 - var body appbskytypes.UnspeccedApplyLabels_Input 821 - if err := c.Bind(&body); err != nil { 822 - return err 823 - } 824 - var handleErr error 825 - // func (s *Server) handleAppBskyUnspeccedApplyLabels(ctx context.Context,body *appbskytypes.UnspeccedApplyLabels_Input) error 826 - handleErr = s.handleAppBskyUnspeccedApplyLabels(ctx, &body) 827 - if handleErr != nil { 828 - return handleErr 829 - } 830 - return nil 831 - } 832 - 833 940 func (s *Server) HandleAppBskyUnspeccedGetPopular(c echo.Context) error { 834 941 ctx, span := otel.Tracer("server").Start(c.Request().Context(), "HandleAppBskyUnspeccedGetPopular") 835 942 defer span.End() ··· 917 1024 return c.JSON(200, out) 918 1025 } 919 1026 1027 + func (s *Server) HandleAppBskyUnspeccedSearchActorsSkeleton(c echo.Context) error { 1028 + ctx, span := otel.Tracer("server").Start(c.Request().Context(), "HandleAppBskyUnspeccedSearchActorsSkeleton") 1029 + defer span.End() 1030 + cursor := c.QueryParam("cursor") 1031 + 1032 + var limit int 1033 + if p := c.QueryParam("limit"); p != "" { 1034 + var err error 1035 + limit, err = strconv.Atoi(p) 1036 + if err != nil { 1037 + return err 1038 + } 1039 + } else { 1040 + limit = 25 1041 + } 1042 + q := c.QueryParam("q") 1043 + 1044 + var typeahead *bool 1045 + if p := c.QueryParam("typeahead"); p != "" { 1046 + typeahead_val, err := strconv.ParseBool(p) 1047 + if err != nil { 1048 + return err 1049 + } 1050 + typeahead = &typeahead_val 1051 + } 1052 + var out *appbskytypes.UnspeccedSearchActorsSkeleton_Output 1053 + var handleErr error 1054 + // func (s *Server) handleAppBskyUnspeccedSearchActorsSkeleton(ctx context.Context,cursor string,limit int,q string,typeahead *bool) (*appbskytypes.UnspeccedSearchActorsSkeleton_Output, error) 1055 + out, handleErr = s.handleAppBskyUnspeccedSearchActorsSkeleton(ctx, cursor, limit, q, typeahead) 1056 + if handleErr != nil { 1057 + return handleErr 1058 + } 1059 + return c.JSON(200, out) 1060 + } 1061 + 1062 + func (s *Server) HandleAppBskyUnspeccedSearchPostsSkeleton(c echo.Context) error { 1063 + ctx, span := otel.Tracer("server").Start(c.Request().Context(), "HandleAppBskyUnspeccedSearchPostsSkeleton") 1064 + defer span.End() 1065 + cursor := c.QueryParam("cursor") 1066 + 1067 + var limit int 1068 + if p := c.QueryParam("limit"); p != "" { 1069 + var err error 1070 + limit, err = strconv.Atoi(p) 1071 + if err != nil { 1072 + return err 1073 + } 1074 + } else { 1075 + limit = 25 1076 + } 1077 + q := c.QueryParam("q") 1078 + var out *appbskytypes.UnspeccedSearchPostsSkeleton_Output 1079 + var handleErr error 1080 + // func (s *Server) handleAppBskyUnspeccedSearchPostsSkeleton(ctx context.Context,cursor string,limit int,q string) (*appbskytypes.UnspeccedSearchPostsSkeleton_Output, error) 1081 + out, handleErr = s.handleAppBskyUnspeccedSearchPostsSkeleton(ctx, cursor, limit, q) 1082 + if handleErr != nil { 1083 + return handleErr 1084 + } 1085 + return c.JSON(200, out) 1086 + } 1087 + 920 1088 func (s *Server) RegisterHandlersComAtproto(e *echo.Echo) error { 921 1089 e.POST("/xrpc/com.atproto.admin.disableAccountInvites", s.HandleComAtprotoAdminDisableAccountInvites) 922 1090 e.POST("/xrpc/com.atproto.admin.disableInviteCodes", s.HandleComAtprotoAdminDisableInviteCodes) 923 1091 e.POST("/xrpc/com.atproto.admin.enableAccountInvites", s.HandleComAtprotoAdminEnableAccountInvites) 1092 + e.GET("/xrpc/com.atproto.admin.getAccountInfo", s.HandleComAtprotoAdminGetAccountInfo) 924 1093 e.GET("/xrpc/com.atproto.admin.getInviteCodes", s.HandleComAtprotoAdminGetInviteCodes) 925 1094 e.GET("/xrpc/com.atproto.admin.getModerationAction", s.HandleComAtprotoAdminGetModerationAction) 926 1095 e.GET("/xrpc/com.atproto.admin.getModerationActions", s.HandleComAtprotoAdminGetModerationActions) ··· 928 1097 e.GET("/xrpc/com.atproto.admin.getModerationReports", s.HandleComAtprotoAdminGetModerationReports) 929 1098 e.GET("/xrpc/com.atproto.admin.getRecord", s.HandleComAtprotoAdminGetRecord) 930 1099 e.GET("/xrpc/com.atproto.admin.getRepo", s.HandleComAtprotoAdminGetRepo) 1100 + e.GET("/xrpc/com.atproto.admin.getSubjectStatus", s.HandleComAtprotoAdminGetSubjectStatus) 931 1101 e.POST("/xrpc/com.atproto.admin.resolveModerationReports", s.HandleComAtprotoAdminResolveModerationReports) 932 1102 e.POST("/xrpc/com.atproto.admin.reverseModerationAction", s.HandleComAtprotoAdminReverseModerationAction) 933 1103 e.GET("/xrpc/com.atproto.admin.searchRepos", s.HandleComAtprotoAdminSearchRepos) ··· 935 1105 e.POST("/xrpc/com.atproto.admin.takeModerationAction", s.HandleComAtprotoAdminTakeModerationAction) 936 1106 e.POST("/xrpc/com.atproto.admin.updateAccountEmail", s.HandleComAtprotoAdminUpdateAccountEmail) 937 1107 e.POST("/xrpc/com.atproto.admin.updateAccountHandle", s.HandleComAtprotoAdminUpdateAccountHandle) 1108 + e.POST("/xrpc/com.atproto.admin.updateSubjectStatus", s.HandleComAtprotoAdminUpdateSubjectStatus) 938 1109 e.GET("/xrpc/com.atproto.identity.resolveHandle", s.HandleComAtprotoIdentityResolveHandle) 939 1110 e.POST("/xrpc/com.atproto.identity.updateHandle", s.HandleComAtprotoIdentityUpdateHandle) 940 1111 e.GET("/xrpc/com.atproto.label.queryLabels", s.HandleComAtprotoLabelQueryLabels) ··· 947 1118 e.GET("/xrpc/com.atproto.repo.listRecords", s.HandleComAtprotoRepoListRecords) 948 1119 e.POST("/xrpc/com.atproto.repo.putRecord", s.HandleComAtprotoRepoPutRecord) 949 1120 e.POST("/xrpc/com.atproto.repo.uploadBlob", s.HandleComAtprotoRepoUploadBlob) 1121 + e.POST("/xrpc/com.atproto.server.confirmEmail", s.HandleComAtprotoServerConfirmEmail) 950 1122 e.POST("/xrpc/com.atproto.server.createAccount", s.HandleComAtprotoServerCreateAccount) 951 1123 e.POST("/xrpc/com.atproto.server.createAppPassword", s.HandleComAtprotoServerCreateAppPassword) 952 1124 e.POST("/xrpc/com.atproto.server.createInviteCode", s.HandleComAtprotoServerCreateInviteCode) ··· 960 1132 e.GET("/xrpc/com.atproto.server.listAppPasswords", s.HandleComAtprotoServerListAppPasswords) 961 1133 e.POST("/xrpc/com.atproto.server.refreshSession", s.HandleComAtprotoServerRefreshSession) 962 1134 e.POST("/xrpc/com.atproto.server.requestAccountDelete", s.HandleComAtprotoServerRequestAccountDelete) 1135 + e.POST("/xrpc/com.atproto.server.requestEmailConfirmation", s.HandleComAtprotoServerRequestEmailConfirmation) 1136 + e.POST("/xrpc/com.atproto.server.requestEmailUpdate", s.HandleComAtprotoServerRequestEmailUpdate) 963 1137 e.POST("/xrpc/com.atproto.server.requestPasswordReset", s.HandleComAtprotoServerRequestPasswordReset) 1138 + e.POST("/xrpc/com.atproto.server.reserveSigningKey", s.HandleComAtprotoServerReserveSigningKey) 964 1139 e.POST("/xrpc/com.atproto.server.resetPassword", s.HandleComAtprotoServerResetPassword) 965 1140 e.POST("/xrpc/com.atproto.server.revokeAppPassword", s.HandleComAtprotoServerRevokeAppPassword) 1141 + e.POST("/xrpc/com.atproto.server.updateEmail", s.HandleComAtprotoServerUpdateEmail) 966 1142 e.GET("/xrpc/com.atproto.sync.getBlob", s.HandleComAtprotoSyncGetBlob) 967 1143 e.GET("/xrpc/com.atproto.sync.getBlocks", s.HandleComAtprotoSyncGetBlocks) 968 1144 e.GET("/xrpc/com.atproto.sync.getCheckout", s.HandleComAtprotoSyncGetCheckout) ··· 974 1150 e.GET("/xrpc/com.atproto.sync.listRepos", s.HandleComAtprotoSyncListRepos) 975 1151 e.POST("/xrpc/com.atproto.sync.notifyOfUpdate", s.HandleComAtprotoSyncNotifyOfUpdate) 976 1152 e.POST("/xrpc/com.atproto.sync.requestCrawl", s.HandleComAtprotoSyncRequestCrawl) 977 - e.POST("/xrpc/com.atproto.temp.upgradeRepoVersion", s.HandleComAtprotoTempUpgradeRepoVersion) 1153 + e.GET("/xrpc/com.atproto.temp.fetchLabels", s.HandleComAtprotoTempFetchLabels) 978 1154 return nil 979 1155 } 980 1156 ··· 1027 1203 return handleErr 1028 1204 } 1029 1205 return nil 1206 + } 1207 + 1208 + func (s *Server) HandleComAtprotoAdminGetAccountInfo(c echo.Context) error { 1209 + ctx, span := otel.Tracer("server").Start(c.Request().Context(), "HandleComAtprotoAdminGetAccountInfo") 1210 + defer span.End() 1211 + did := c.QueryParam("did") 1212 + var out *comatprototypes.AdminDefs_AccountView 1213 + var handleErr error 1214 + // func (s *Server) handleComAtprotoAdminGetAccountInfo(ctx context.Context,did string) (*comatprototypes.AdminDefs_AccountView, error) 1215 + out, handleErr = s.handleComAtprotoAdminGetAccountInfo(ctx, did) 1216 + if handleErr != nil { 1217 + return handleErr 1218 + } 1219 + return c.JSON(200, out) 1030 1220 } 1031 1221 1032 1222 func (s *Server) HandleComAtprotoAdminGetInviteCodes(c echo.Context) error { ··· 1196 1386 return c.JSON(200, out) 1197 1387 } 1198 1388 1389 + func (s *Server) HandleComAtprotoAdminGetSubjectStatus(c echo.Context) error { 1390 + ctx, span := otel.Tracer("server").Start(c.Request().Context(), "HandleComAtprotoAdminGetSubjectStatus") 1391 + defer span.End() 1392 + blob := c.QueryParam("blob") 1393 + did := c.QueryParam("did") 1394 + uri := c.QueryParam("uri") 1395 + var out *comatprototypes.AdminGetSubjectStatus_Output 1396 + var handleErr error 1397 + // func (s *Server) handleComAtprotoAdminGetSubjectStatus(ctx context.Context,blob string,did string,uri string) (*comatprototypes.AdminGetSubjectStatus_Output, error) 1398 + out, handleErr = s.handleComAtprotoAdminGetSubjectStatus(ctx, blob, did, uri) 1399 + if handleErr != nil { 1400 + return handleErr 1401 + } 1402 + return c.JSON(200, out) 1403 + } 1404 + 1199 1405 func (s *Server) HandleComAtprotoAdminResolveModerationReports(c echo.Context) error { 1200 1406 ctx, span := otel.Tracer("server").Start(c.Request().Context(), "HandleComAtprotoAdminResolveModerationReports") 1201 1407 defer span.End() ··· 1236 1442 ctx, span := otel.Tracer("server").Start(c.Request().Context(), "HandleComAtprotoAdminSearchRepos") 1237 1443 defer span.End() 1238 1444 cursor := c.QueryParam("cursor") 1239 - invitedBy := c.QueryParam("invitedBy") 1240 1445 1241 1446 var limit int 1242 1447 if p := c.QueryParam("limit"); p != "" { ··· 1248 1453 } else { 1249 1454 limit = 50 1250 1455 } 1456 + q := c.QueryParam("q") 1251 1457 term := c.QueryParam("term") 1252 1458 var out *comatprototypes.AdminSearchRepos_Output 1253 1459 var handleErr error 1254 - // func (s *Server) handleComAtprotoAdminSearchRepos(ctx context.Context,cursor string,invitedBy string,limit int,term string) (*comatprototypes.AdminSearchRepos_Output, error) 1255 - out, handleErr = s.handleComAtprotoAdminSearchRepos(ctx, cursor, invitedBy, limit, term) 1460 + // func (s *Server) handleComAtprotoAdminSearchRepos(ctx context.Context,cursor string,limit int,q string,term string) (*comatprototypes.AdminSearchRepos_Output, error) 1461 + out, handleErr = s.handleComAtprotoAdminSearchRepos(ctx, cursor, limit, q, term) 1256 1462 if handleErr != nil { 1257 1463 return handleErr 1258 1464 } ··· 1327 1533 return handleErr 1328 1534 } 1329 1535 return nil 1536 + } 1537 + 1538 + func (s *Server) HandleComAtprotoAdminUpdateSubjectStatus(c echo.Context) error { 1539 + ctx, span := otel.Tracer("server").Start(c.Request().Context(), "HandleComAtprotoAdminUpdateSubjectStatus") 1540 + defer span.End() 1541 + 1542 + var body comatprototypes.AdminUpdateSubjectStatus_Input 1543 + if err := c.Bind(&body); err != nil { 1544 + return err 1545 + } 1546 + var out *comatprototypes.AdminUpdateSubjectStatus_Output 1547 + var handleErr error 1548 + // func (s *Server) handleComAtprotoAdminUpdateSubjectStatus(ctx context.Context,body *comatprototypes.AdminUpdateSubjectStatus_Input) (*comatprototypes.AdminUpdateSubjectStatus_Output, error) 1549 + out, handleErr = s.handleComAtprotoAdminUpdateSubjectStatus(ctx, &body) 1550 + if handleErr != nil { 1551 + return handleErr 1552 + } 1553 + return c.JSON(200, out) 1330 1554 } 1331 1555 1332 1556 func (s *Server) HandleComAtprotoIdentityResolveHandle(c echo.Context) error { ··· 1561 1785 return c.JSON(200, out) 1562 1786 } 1563 1787 1788 + func (s *Server) HandleComAtprotoServerConfirmEmail(c echo.Context) error { 1789 + ctx, span := otel.Tracer("server").Start(c.Request().Context(), "HandleComAtprotoServerConfirmEmail") 1790 + defer span.End() 1791 + 1792 + var body comatprototypes.ServerConfirmEmail_Input 1793 + if err := c.Bind(&body); err != nil { 1794 + return err 1795 + } 1796 + var handleErr error 1797 + // func (s *Server) handleComAtprotoServerConfirmEmail(ctx context.Context,body *comatprototypes.ServerConfirmEmail_Input) error 1798 + handleErr = s.handleComAtprotoServerConfirmEmail(ctx, &body) 1799 + if handleErr != nil { 1800 + return handleErr 1801 + } 1802 + return nil 1803 + } 1804 + 1564 1805 func (s *Server) HandleComAtprotoServerCreateAccount(c echo.Context) error { 1565 1806 ctx, span := otel.Tracer("server").Start(c.Request().Context(), "HandleComAtprotoServerCreateAccount") 1566 1807 defer span.End() ··· 1779 2020 return nil 1780 2021 } 1781 2022 2023 + func (s *Server) HandleComAtprotoServerRequestEmailConfirmation(c echo.Context) error { 2024 + ctx, span := otel.Tracer("server").Start(c.Request().Context(), "HandleComAtprotoServerRequestEmailConfirmation") 2025 + defer span.End() 2026 + var handleErr error 2027 + // func (s *Server) handleComAtprotoServerRequestEmailConfirmation(ctx context.Context) error 2028 + handleErr = s.handleComAtprotoServerRequestEmailConfirmation(ctx) 2029 + if handleErr != nil { 2030 + return handleErr 2031 + } 2032 + return nil 2033 + } 2034 + 2035 + func (s *Server) HandleComAtprotoServerRequestEmailUpdate(c echo.Context) error { 2036 + ctx, span := otel.Tracer("server").Start(c.Request().Context(), "HandleComAtprotoServerRequestEmailUpdate") 2037 + defer span.End() 2038 + var out *comatprototypes.ServerRequestEmailUpdate_Output 2039 + var handleErr error 2040 + // func (s *Server) handleComAtprotoServerRequestEmailUpdate(ctx context.Context) (*comatprototypes.ServerRequestEmailUpdate_Output, error) 2041 + out, handleErr = s.handleComAtprotoServerRequestEmailUpdate(ctx) 2042 + if handleErr != nil { 2043 + return handleErr 2044 + } 2045 + return c.JSON(200, out) 2046 + } 2047 + 1782 2048 func (s *Server) HandleComAtprotoServerRequestPasswordReset(c echo.Context) error { 1783 2049 ctx, span := otel.Tracer("server").Start(c.Request().Context(), "HandleComAtprotoServerRequestPasswordReset") 1784 2050 defer span.End() ··· 1796 2062 return nil 1797 2063 } 1798 2064 2065 + func (s *Server) HandleComAtprotoServerReserveSigningKey(c echo.Context) error { 2066 + ctx, span := otel.Tracer("server").Start(c.Request().Context(), "HandleComAtprotoServerReserveSigningKey") 2067 + defer span.End() 2068 + 2069 + var body comatprototypes.ServerReserveSigningKey_Input 2070 + if err := c.Bind(&body); err != nil { 2071 + return err 2072 + } 2073 + var out *comatprototypes.ServerReserveSigningKey_Output 2074 + var handleErr error 2075 + // func (s *Server) handleComAtprotoServerReserveSigningKey(ctx context.Context,body *comatprototypes.ServerReserveSigningKey_Input) (*comatprototypes.ServerReserveSigningKey_Output, error) 2076 + out, handleErr = s.handleComAtprotoServerReserveSigningKey(ctx, &body) 2077 + if handleErr != nil { 2078 + return handleErr 2079 + } 2080 + return c.JSON(200, out) 2081 + } 2082 + 1799 2083 func (s *Server) HandleComAtprotoServerResetPassword(c echo.Context) error { 1800 2084 ctx, span := otel.Tracer("server").Start(c.Request().Context(), "HandleComAtprotoServerResetPassword") 1801 2085 defer span.End() ··· 1830 2114 return nil 1831 2115 } 1832 2116 2117 + func (s *Server) HandleComAtprotoServerUpdateEmail(c echo.Context) error { 2118 + ctx, span := otel.Tracer("server").Start(c.Request().Context(), "HandleComAtprotoServerUpdateEmail") 2119 + defer span.End() 2120 + 2121 + var body comatprototypes.ServerUpdateEmail_Input 2122 + if err := c.Bind(&body); err != nil { 2123 + return err 2124 + } 2125 + var handleErr error 2126 + // func (s *Server) handleComAtprotoServerUpdateEmail(ctx context.Context,body *comatprototypes.ServerUpdateEmail_Input) error 2127 + handleErr = s.handleComAtprotoServerUpdateEmail(ctx, &body) 2128 + if handleErr != nil { 2129 + return handleErr 2130 + } 2131 + return nil 2132 + } 2133 + 1833 2134 func (s *Server) HandleComAtprotoSyncGetBlob(c echo.Context) error { 1834 2135 ctx, span := otel.Tracer("server").Start(c.Request().Context(), "HandleComAtprotoSyncGetBlob") 1835 2136 defer span.End() ··· 2021 2322 return nil 2022 2323 } 2023 2324 2024 - func (s *Server) HandleComAtprotoTempUpgradeRepoVersion(c echo.Context) error { 2025 - ctx, span := otel.Tracer("server").Start(c.Request().Context(), "HandleComAtprotoTempUpgradeRepoVersion") 2325 + func (s *Server) HandleComAtprotoTempFetchLabels(c echo.Context) error { 2326 + ctx, span := otel.Tracer("server").Start(c.Request().Context(), "HandleComAtprotoTempFetchLabels") 2026 2327 defer span.End() 2027 2328 2028 - var body comatprototypes.TempUpgradeRepoVersion_Input 2029 - if err := c.Bind(&body); err != nil { 2030 - return err 2329 + var limit int 2330 + if p := c.QueryParam("limit"); p != "" { 2331 + var err error 2332 + limit, err = strconv.Atoi(p) 2333 + if err != nil { 2334 + return err 2335 + } 2336 + } else { 2337 + limit = 50 2031 2338 } 2339 + 2340 + var since *int 2341 + if p := c.QueryParam("since"); p != "" { 2342 + since_val, err := strconv.Atoi(p) 2343 + if err != nil { 2344 + return err 2345 + } 2346 + since = &since_val 2347 + } 2348 + var out *comatprototypes.TempFetchLabels_Output 2032 2349 var handleErr error 2033 - // func (s *Server) handleComAtprotoTempUpgradeRepoVersion(ctx context.Context,body *comatprototypes.TempUpgradeRepoVersion_Input) error 2034 - handleErr = s.handleComAtprotoTempUpgradeRepoVersion(ctx, &body) 2350 + // func (s *Server) handleComAtprotoTempFetchLabels(ctx context.Context,limit int,since *int) (*comatprototypes.TempFetchLabels_Output, error) 2351 + out, handleErr = s.handleComAtprotoTempFetchLabels(ctx, limit, since) 2035 2352 if handleErr != nil { 2036 2353 return handleErr 2037 2354 } 2038 - return nil 2355 + return c.JSON(200, out) 2039 2356 }
+4 -2
testing/utils.go
··· 198 198 } 199 199 200 200 fmt.Println("HOST: ", c.Host) 201 + email := handle + "@fake.com" 202 + pass := "password" 201 203 out, err := atproto.ServerCreateAccount(ctx, c, &atproto.ServerCreateAccount_Input{ 202 - Email: handle + "@fake.com", 204 + Email: &email, 203 205 Handle: handle, 204 - Password: "password", 206 + Password: &pass, 205 207 }) 206 208 if err != nil { 207 209 return nil, err