this repo has no description
0
fork

Configure Feed

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

add helper command for generating invite codes (#119)

I'm not using the lexgen stuff because the auth is different for this
route. Not quite sure how to properly deal with that yet so i'm yoloing
a one-off http request

authored by

Whyrusleeping and committed by
GitHub
69574f4a d02bb762

+597 -71
+7
api/atproto/admindefs.go
··· 20 20 21 21 type AdminDefs_ActionView struct { 22 22 Action *string `json:"action" cborgen:"action"` 23 + CreateLabelVals []string `json:"createLabelVals,omitempty" cborgen:"createLabelVals,omitempty"` 23 24 CreatedAt string `json:"createdAt" cborgen:"createdAt"` 24 25 CreatedBy string `json:"createdBy" cborgen:"createdBy"` 25 26 Id int64 `json:"id" cborgen:"id"` 27 + NegateLabelVals []string `json:"negateLabelVals,omitempty" cborgen:"negateLabelVals,omitempty"` 26 28 Reason string `json:"reason" cborgen:"reason"` 27 29 ResolvedReportIds []int64 `json:"resolvedReportIds" cborgen:"resolvedReportIds"` 28 30 Reversal *AdminDefs_ActionReversal `json:"reversal,omitempty" cborgen:"reversal,omitempty"` ··· 37 39 38 40 type AdminDefs_ActionViewDetail struct { 39 41 Action *string `json:"action" cborgen:"action"` 42 + CreateLabelVals []string `json:"createLabelVals,omitempty" cborgen:"createLabelVals,omitempty"` 40 43 CreatedAt string `json:"createdAt" cborgen:"createdAt"` 41 44 CreatedBy string `json:"createdBy" cborgen:"createdBy"` 42 45 Id int64 `json:"id" cborgen:"id"` 46 + NegateLabelVals []string `json:"negateLabelVals,omitempty" cborgen:"negateLabelVals,omitempty"` 43 47 Reason string `json:"reason" cborgen:"reason"` 44 48 ResolvedReports []*AdminDefs_ReportView `json:"resolvedReports" cborgen:"resolvedReports"` 45 49 Reversal *AdminDefs_ActionReversal `json:"reversal,omitempty" cborgen:"reversal,omitempty"` ··· 213 217 Email *string `json:"email,omitempty" cborgen:"email,omitempty"` 214 218 Handle string `json:"handle" cborgen:"handle"` 215 219 IndexedAt string `json:"indexedAt" cborgen:"indexedAt"` 220 + InvitedBy *ServerDefs_InviteCode `json:"invitedBy,omitempty" cborgen:"invitedBy,omitempty"` 216 221 Moderation *AdminDefs_Moderation `json:"moderation" cborgen:"moderation"` 217 222 RelatedRecords []*util.LexiconTypeDecoder `json:"relatedRecords" cborgen:"relatedRecords"` 218 223 } ··· 222 227 Email *string `json:"email,omitempty" cborgen:"email,omitempty"` 223 228 Handle string `json:"handle" cborgen:"handle"` 224 229 IndexedAt string `json:"indexedAt" cborgen:"indexedAt"` 230 + InvitedBy *ServerDefs_InviteCode `json:"invitedBy,omitempty" cborgen:"invitedBy,omitempty"` 231 + Invites []*ServerDefs_InviteCode `json:"invites,omitempty" cborgen:"invites,omitempty"` 225 232 Moderation *AdminDefs_ModerationDetail `json:"moderation" cborgen:"moderation"` 226 233 RelatedRecords []*util.LexiconTypeDecoder `json:"relatedRecords" cborgen:"relatedRecords"` 227 234 }
+25
api/atproto/admindisableInviteCodes.go
··· 1 + package atproto 2 + 3 + import ( 4 + "context" 5 + 6 + "github.com/bluesky-social/indigo/xrpc" 7 + ) 8 + 9 + // schema: com.atproto.admin.disableInviteCodes 10 + 11 + func init() { 12 + } 13 + 14 + type AdminDisableInviteCodes_Input struct { 15 + Accounts []string `json:"accounts,omitempty" cborgen:"accounts,omitempty"` 16 + Codes []string `json:"codes,omitempty" cborgen:"codes,omitempty"` 17 + } 18 + 19 + func AdminDisableInviteCodes(ctx context.Context, c *xrpc.Client, input *AdminDisableInviteCodes_Input) error { 20 + if err := c.Do(ctx, xrpc.Procedure, "application/json", "com.atproto.admin.disableInviteCodes", nil, input, nil); err != nil { 21 + return err 22 + } 23 + 24 + return nil 25 + }
+32
api/atproto/admingetInviteCodes.go
··· 1 + package atproto 2 + 3 + import ( 4 + "context" 5 + 6 + "github.com/bluesky-social/indigo/xrpc" 7 + ) 8 + 9 + // schema: com.atproto.admin.getInviteCodes 10 + 11 + func init() { 12 + } 13 + 14 + type AdminGetInviteCodes_Output struct { 15 + Codes []*ServerDefs_InviteCode `json:"codes" cborgen:"codes"` 16 + Cursor *string `json:"cursor,omitempty" cborgen:"cursor,omitempty"` 17 + } 18 + 19 + func AdminGetInviteCodes(ctx context.Context, c *xrpc.Client, cursor string, limit int64, sort string) (*AdminGetInviteCodes_Output, error) { 20 + var out AdminGetInviteCodes_Output 21 + 22 + params := map[string]interface{}{ 23 + "cursor": cursor, 24 + "limit": limit, 25 + "sort": sort, 26 + } 27 + if err := c.Do(ctx, xrpc.Query, "", "com.atproto.admin.getInviteCodes", params, nil, &out); err != nil { 28 + return nil, err 29 + } 30 + 31 + return &out, nil 32 + }
+5 -4
api/atproto/adminsearchRepos.go
··· 16 16 Repos []*AdminDefs_RepoView `json:"repos" cborgen:"repos"` 17 17 } 18 18 19 - func AdminSearchRepos(ctx context.Context, c *xrpc.Client, cursor string, limit int64, term string) (*AdminSearchRepos_Output, error) { 19 + func AdminSearchRepos(ctx context.Context, c *xrpc.Client, cursor string, invitedBy string, limit int64, term string) (*AdminSearchRepos_Output, error) { 20 20 var out AdminSearchRepos_Output 21 21 22 22 params := map[string]interface{}{ 23 - "cursor": cursor, 24 - "limit": limit, 25 - "term": term, 23 + "cursor": cursor, 24 + "invitedBy": invitedBy, 25 + "limit": limit, 26 + "term": term, 26 27 } 27 28 if err := c.Do(ctx, xrpc.Query, "", "com.atproto.admin.searchRepos", params, nil, &out); err != nil { 28 29 return nil, err
+2
api/atproto/admintakeModerationAction.go
··· 16 16 17 17 type AdminTakeModerationAction_Input struct { 18 18 Action string `json:"action" cborgen:"action"` 19 + CreateLabelVals []string `json:"createLabelVals,omitempty" cborgen:"createLabelVals,omitempty"` 19 20 CreatedBy string `json:"createdBy" cborgen:"createdBy"` 21 + NegateLabelVals []string `json:"negateLabelVals,omitempty" cborgen:"negateLabelVals,omitempty"` 20 22 Reason string `json:"reason" cborgen:"reason"` 21 23 Subject *AdminTakeModerationAction_Input_Subject `json:"subject" cborgen:"subject"` 22 24 SubjectBlobCids []string `json:"subjectBlobCids,omitempty" cborgen:"subjectBlobCids,omitempty"`
+8
api/atproto/labeldefs.go
··· 1 + package atproto 2 + 3 + // schema: com.atproto.label.defs 4 + 5 + func init() { 6 + } 7 + 8 + type LabelDefs_Label interface{}
+33
api/atproto/labelqueryLabels.go
··· 1 + package atproto 2 + 3 + import ( 4 + "context" 5 + 6 + "github.com/bluesky-social/indigo/xrpc" 7 + ) 8 + 9 + // schema: com.atproto.label.queryLabels 10 + 11 + func init() { 12 + } 13 + 14 + type LabelQueryLabels_Output struct { 15 + Cursor *string `json:"cursor,omitempty" cborgen:"cursor,omitempty"` 16 + Labels []*LabelDefs_Label `json:"labels" cborgen:"labels"` 17 + } 18 + 19 + func LabelQueryLabels(ctx context.Context, c *xrpc.Client, cursor string, limit int64, sources []string, uriPatterns []string) (*LabelQueryLabels_Output, error) { 20 + var out LabelQueryLabels_Output 21 + 22 + params := map[string]interface{}{ 23 + "cursor": cursor, 24 + "limit": limit, 25 + "sources": sources, 26 + "uriPatterns": uriPatterns, 27 + } 28 + if err := c.Do(ctx, xrpc.Query, "", "com.atproto.label.queryLabels", params, nil, &out); err != nil { 29 + return nil, err 30 + } 31 + 32 + return &out, nil 33 + }
+16
api/atproto/labelsubscribeLabels.go
··· 1 + package atproto 2 + 3 + // schema: com.atproto.label.subscribeLabels 4 + 5 + func init() { 6 + } 7 + 8 + type LabelSubscribeLabels_Info struct { 9 + Message *string `json:"message,omitempty" cborgen:"message,omitempty"` 10 + Name string `json:"name" cborgen:"name"` 11 + } 12 + 13 + type LabelSubscribeLabels_Labels struct { 14 + Labels []*LabelDefs_Label `json:"labels" cborgen:"labels"` 15 + Seq int64 `json:"seq" cborgen:"seq"` 16 + }
+2 -1
api/atproto/repolistRecords.go
··· 23 23 Value *util.LexiconTypeDecoder `json:"value" cborgen:"value"` 24 24 } 25 25 26 - func RepoListRecords(ctx context.Context, c *xrpc.Client, collection string, limit int64, repo string, reverse bool, rkeyEnd string, rkeyStart string) (*RepoListRecords_Output, error) { 26 + func RepoListRecords(ctx context.Context, c *xrpc.Client, collection string, cursor string, limit int64, repo string, reverse bool, rkeyEnd string, rkeyStart string) (*RepoListRecords_Output, error) { 27 27 var out RepoListRecords_Output 28 28 29 29 params := map[string]interface{}{ 30 30 "collection": collection, 31 + "cursor": cursor, 31 32 "limit": limit, 32 33 "repo": repo, 33 34 "reverse": reverse,
+2 -1
api/atproto/servercreateInviteCode.go
··· 12 12 } 13 13 14 14 type ServerCreateInviteCode_Input struct { 15 - UseCount int64 `json:"useCount" cborgen:"useCount"` 15 + ForAccount *string `json:"forAccount,omitempty" cborgen:"forAccount,omitempty"` 16 + UseCount int64 `json:"useCount" cborgen:"useCount"` 16 17 } 17 18 18 19 type ServerCreateInviteCode_Output struct {
+31
api/atproto/servercreateInviteCodes.go
··· 1 + package atproto 2 + 3 + import ( 4 + "context" 5 + 6 + "github.com/bluesky-social/indigo/xrpc" 7 + ) 8 + 9 + // schema: com.atproto.server.createInviteCodes 10 + 11 + func init() { 12 + } 13 + 14 + type ServerCreateInviteCodes_Input struct { 15 + CodeCount int64 `json:"codeCount" cborgen:"codeCount"` 16 + ForAccount *string `json:"forAccount,omitempty" cborgen:"forAccount,omitempty"` 17 + UseCount int64 `json:"useCount" cborgen:"useCount"` 18 + } 19 + 20 + type ServerCreateInviteCodes_Output struct { 21 + Codes []string `json:"codes" cborgen:"codes"` 22 + } 23 + 24 + func ServerCreateInviteCodes(ctx context.Context, c *xrpc.Client, input *ServerCreateInviteCodes_Input) (*ServerCreateInviteCodes_Output, error) { 25 + var out ServerCreateInviteCodes_Output 26 + if err := c.Do(ctx, xrpc.Procedure, "application/json", "com.atproto.server.createInviteCodes", nil, input, &out); err != nil { 27 + return nil, err 28 + } 29 + 30 + return &out, nil 31 + }
+7 -6
api/atproto/servercreateSession.go
··· 12 12 } 13 13 14 14 type ServerCreateSession_Input struct { 15 - Identifier *string `json:"identifier,omitempty" cborgen:"identifier,omitempty"` 16 - Password string `json:"password" cborgen:"password"` 15 + Identifier string `json:"identifier" cborgen:"identifier"` 16 + Password string `json:"password" cborgen:"password"` 17 17 } 18 18 19 19 type ServerCreateSession_Output struct { 20 - AccessJwt string `json:"accessJwt" cborgen:"accessJwt"` 21 - Did string `json:"did" cborgen:"did"` 22 - Handle string `json:"handle" cborgen:"handle"` 23 - RefreshJwt string `json:"refreshJwt" cborgen:"refreshJwt"` 20 + AccessJwt string `json:"accessJwt" cborgen:"accessJwt"` 21 + Did string `json:"did" cborgen:"did"` 22 + Email *string `json:"email,omitempty" cborgen:"email,omitempty"` 23 + Handle string `json:"handle" cborgen:"handle"` 24 + RefreshJwt string `json:"refreshJwt" cborgen:"refreshJwt"` 24 25 } 25 26 26 27 func ServerCreateSession(ctx context.Context, c *xrpc.Client, input *ServerCreateSession_Input) (*ServerCreateSession_Output, error) {
+21
api/atproto/serverdefs.go
··· 1 + package atproto 2 + 3 + // schema: com.atproto.server.defs 4 + 5 + func init() { 6 + } 7 + 8 + type ServerDefs_InviteCode struct { 9 + Available int64 `json:"available" cborgen:"available"` 10 + Code string `json:"code" cborgen:"code"` 11 + CreatedAt string `json:"createdAt" cborgen:"createdAt"` 12 + CreatedBy string `json:"createdBy" cborgen:"createdBy"` 13 + Disabled bool `json:"disabled" cborgen:"disabled"` 14 + ForAccount string `json:"forAccount" cborgen:"forAccount"` 15 + Uses []*ServerDefs_InviteCodeUse `json:"uses" cborgen:"uses"` 16 + } 17 + 18 + type ServerDefs_InviteCodeUse struct { 19 + UsedAt string `json:"usedAt" cborgen:"usedAt"` 20 + UsedBy string `json:"usedBy" cborgen:"usedBy"` 21 + }
+30
api/atproto/servergetAccountInviteCodes.go
··· 1 + package atproto 2 + 3 + import ( 4 + "context" 5 + 6 + "github.com/bluesky-social/indigo/xrpc" 7 + ) 8 + 9 + // schema: com.atproto.server.getAccountInviteCodes 10 + 11 + func init() { 12 + } 13 + 14 + type ServerGetAccountInviteCodes_Output struct { 15 + Codes []*ServerDefs_InviteCode `json:"codes" cborgen:"codes"` 16 + } 17 + 18 + func ServerGetAccountInviteCodes(ctx context.Context, c *xrpc.Client, createAvailable bool, includeUsed bool) (*ServerGetAccountInviteCodes_Output, error) { 19 + var out ServerGetAccountInviteCodes_Output 20 + 21 + params := map[string]interface{}{ 22 + "createAvailable": createAvailable, 23 + "includeUsed": includeUsed, 24 + } 25 + if err := c.Do(ctx, xrpc.Query, "", "com.atproto.server.getAccountInviteCodes", params, nil, &out); err != nil { 26 + return nil, err 27 + } 28 + 29 + return &out, nil 30 + }
+3 -2
api/atproto/servergetSession.go
··· 12 12 } 13 13 14 14 type ServerGetSession_Output struct { 15 - Did string `json:"did" cborgen:"did"` 16 - Handle string `json:"handle" cborgen:"handle"` 15 + Did string `json:"did" cborgen:"did"` 16 + Email *string `json:"email,omitempty" cborgen:"email,omitempty"` 17 + Handle string `json:"handle" cborgen:"handle"` 17 18 } 18 19 19 20 func ServerGetSession(ctx context.Context, c *xrpc.Client) (*ServerGetSession_Output, error) {
+36
api/atproto/synclistRepos.go
··· 1 + package atproto 2 + 3 + import ( 4 + "context" 5 + 6 + "github.com/bluesky-social/indigo/xrpc" 7 + ) 8 + 9 + // schema: com.atproto.sync.listRepos 10 + 11 + func init() { 12 + } 13 + 14 + type SyncListRepos_Output struct { 15 + Cursor *string `json:"cursor,omitempty" cborgen:"cursor,omitempty"` 16 + Repos []*SyncListRepos_Repo `json:"repos" cborgen:"repos"` 17 + } 18 + 19 + type SyncListRepos_Repo struct { 20 + Did string `json:"did" cborgen:"did"` 21 + Head string `json:"head" cborgen:"head"` 22 + } 23 + 24 + func SyncListRepos(ctx context.Context, c *xrpc.Client, cursor string, limit int64) (*SyncListRepos_Output, error) { 25 + var out SyncListRepos_Output 26 + 27 + params := map[string]interface{}{ 28 + "cursor": cursor, 29 + "limit": limit, 30 + } 31 + if err := c.Do(ctx, xrpc.Query, "", "com.atproto.sync.listRepos", params, nil, &out); err != nil { 32 + return nil, err 33 + } 34 + 35 + return &out, nil 36 + }
+30 -23
api/bsky/actordefs.go
··· 1 1 package bsky 2 2 3 + import ( 4 + comatprototypes "github.com/bluesky-social/indigo/api/atproto" 5 + ) 6 + 3 7 // schema: app.bsky.actor.defs 4 8 5 9 func init() { 6 10 } 7 11 8 12 type ActorDefs_ProfileView struct { 9 - Avatar *string `json:"avatar,omitempty" cborgen:"avatar,omitempty"` 10 - Description *string `json:"description,omitempty" cborgen:"description,omitempty"` 11 - Did string `json:"did" cborgen:"did"` 12 - DisplayName *string `json:"displayName,omitempty" cborgen:"displayName,omitempty"` 13 - Handle string `json:"handle" cborgen:"handle"` 14 - IndexedAt *string `json:"indexedAt,omitempty" cborgen:"indexedAt,omitempty"` 15 - Viewer *ActorDefs_ViewerState `json:"viewer,omitempty" cborgen:"viewer,omitempty"` 13 + Avatar *string `json:"avatar,omitempty" cborgen:"avatar,omitempty"` 14 + Description *string `json:"description,omitempty" cborgen:"description,omitempty"` 15 + Did string `json:"did" cborgen:"did"` 16 + DisplayName *string `json:"displayName,omitempty" cborgen:"displayName,omitempty"` 17 + Handle string `json:"handle" cborgen:"handle"` 18 + IndexedAt *string `json:"indexedAt,omitempty" cborgen:"indexedAt,omitempty"` 19 + Labels []*comatprototypes.LabelDefs_Label `json:"labels,omitempty" cborgen:"labels,omitempty"` 20 + Viewer *ActorDefs_ViewerState `json:"viewer,omitempty" cborgen:"viewer,omitempty"` 16 21 } 17 22 18 23 type ActorDefs_ProfileViewBasic struct { 19 - Avatar *string `json:"avatar,omitempty" cborgen:"avatar,omitempty"` 20 - Did string `json:"did" cborgen:"did"` 21 - DisplayName *string `json:"displayName,omitempty" cborgen:"displayName,omitempty"` 22 - Handle string `json:"handle" cborgen:"handle"` 23 - Viewer *ActorDefs_ViewerState `json:"viewer,omitempty" cborgen:"viewer,omitempty"` 24 + Avatar *string `json:"avatar,omitempty" cborgen:"avatar,omitempty"` 25 + Did string `json:"did" cborgen:"did"` 26 + DisplayName *string `json:"displayName,omitempty" cborgen:"displayName,omitempty"` 27 + Handle string `json:"handle" cborgen:"handle"` 28 + Labels []*comatprototypes.LabelDefs_Label `json:"labels,omitempty" cborgen:"labels,omitempty"` 29 + Viewer *ActorDefs_ViewerState `json:"viewer,omitempty" cborgen:"viewer,omitempty"` 24 30 } 25 31 26 32 type ActorDefs_ProfileViewDetailed struct { 27 - Avatar *string `json:"avatar,omitempty" cborgen:"avatar,omitempty"` 28 - Banner *string `json:"banner,omitempty" cborgen:"banner,omitempty"` 29 - Description *string `json:"description,omitempty" cborgen:"description,omitempty"` 30 - Did string `json:"did" cborgen:"did"` 31 - DisplayName *string `json:"displayName,omitempty" cborgen:"displayName,omitempty"` 32 - FollowersCount *int64 `json:"followersCount,omitempty" cborgen:"followersCount,omitempty"` 33 - FollowsCount *int64 `json:"followsCount,omitempty" cborgen:"followsCount,omitempty"` 34 - Handle string `json:"handle" cborgen:"handle"` 35 - IndexedAt *string `json:"indexedAt,omitempty" cborgen:"indexedAt,omitempty"` 36 - PostsCount *int64 `json:"postsCount,omitempty" cborgen:"postsCount,omitempty"` 37 - Viewer *ActorDefs_ViewerState `json:"viewer,omitempty" cborgen:"viewer,omitempty"` 33 + Avatar *string `json:"avatar,omitempty" cborgen:"avatar,omitempty"` 34 + Banner *string `json:"banner,omitempty" cborgen:"banner,omitempty"` 35 + Description *string `json:"description,omitempty" cborgen:"description,omitempty"` 36 + Did string `json:"did" cborgen:"did"` 37 + DisplayName *string `json:"displayName,omitempty" cborgen:"displayName,omitempty"` 38 + FollowersCount *int64 `json:"followersCount,omitempty" cborgen:"followersCount,omitempty"` 39 + FollowsCount *int64 `json:"followsCount,omitempty" cborgen:"followsCount,omitempty"` 40 + Handle string `json:"handle" cborgen:"handle"` 41 + IndexedAt *string `json:"indexedAt,omitempty" cborgen:"indexedAt,omitempty"` 42 + Labels []*comatprototypes.LabelDefs_Label `json:"labels,omitempty" cborgen:"labels,omitempty"` 43 + PostsCount *int64 `json:"postsCount,omitempty" cborgen:"postsCount,omitempty"` 44 + Viewer *ActorDefs_ViewerState `json:"viewer,omitempty" cborgen:"viewer,omitempty"` 38 45 } 39 46 40 47 type ActorDefs_ViewerState struct {
+12 -10
api/bsky/feeddefs.go
··· 4 4 "encoding/json" 5 5 "fmt" 6 6 7 + comatprototypes "github.com/bluesky-social/indigo/api/atproto" 7 8 "github.com/bluesky-social/indigo/lex/util" 8 9 ) 9 10 ··· 53 54 } 54 55 55 56 type FeedDefs_PostView struct { 56 - Author *ActorDefs_ProfileViewBasic `json:"author" cborgen:"author"` 57 - Cid string `json:"cid" cborgen:"cid"` 58 - Embed *FeedDefs_PostView_Embed `json:"embed,omitempty" cborgen:"embed,omitempty"` 59 - IndexedAt string `json:"indexedAt" cborgen:"indexedAt"` 60 - LikeCount *int64 `json:"likeCount,omitempty" cborgen:"likeCount,omitempty"` 61 - Record *util.LexiconTypeDecoder `json:"record" cborgen:"record"` 62 - ReplyCount *int64 `json:"replyCount,omitempty" cborgen:"replyCount,omitempty"` 63 - RepostCount *int64 `json:"repostCount,omitempty" cborgen:"repostCount,omitempty"` 64 - Uri string `json:"uri" cborgen:"uri"` 65 - Viewer *FeedDefs_ViewerState `json:"viewer,omitempty" cborgen:"viewer,omitempty"` 57 + Author *ActorDefs_ProfileViewBasic `json:"author" cborgen:"author"` 58 + Cid string `json:"cid" cborgen:"cid"` 59 + Embed *FeedDefs_PostView_Embed `json:"embed,omitempty" cborgen:"embed,omitempty"` 60 + IndexedAt string `json:"indexedAt" cborgen:"indexedAt"` 61 + Labels []*comatprototypes.LabelDefs_Label `json:"labels,omitempty" cborgen:"labels,omitempty"` 62 + LikeCount *int64 `json:"likeCount,omitempty" cborgen:"likeCount,omitempty"` 63 + Record *util.LexiconTypeDecoder `json:"record" cborgen:"record"` 64 + ReplyCount *int64 `json:"replyCount,omitempty" cborgen:"replyCount,omitempty"` 65 + RepostCount *int64 `json:"repostCount,omitempty" cborgen:"repostCount,omitempty"` 66 + Uri string `json:"uri" cborgen:"uri"` 67 + Viewer *FeedDefs_ViewerState `json:"viewer,omitempty" cborgen:"viewer,omitempty"` 66 68 } 67 69 68 70 type FeedDefs_PostView_Embed struct {
+10 -8
api/bsky/notificationlistNotifications.go
··· 3 3 import ( 4 4 "context" 5 5 6 + comatprototypes "github.com/bluesky-social/indigo/api/atproto" 6 7 "github.com/bluesky-social/indigo/lex/util" 7 8 "github.com/bluesky-social/indigo/xrpc" 8 9 ) ··· 13 14 } 14 15 15 16 type NotificationListNotifications_Notification struct { 16 - Author *ActorDefs_ProfileView `json:"author" cborgen:"author"` 17 - Cid string `json:"cid" cborgen:"cid"` 18 - IndexedAt string `json:"indexedAt" cborgen:"indexedAt"` 19 - IsRead bool `json:"isRead" cborgen:"isRead"` 20 - Reason string `json:"reason" cborgen:"reason"` 21 - ReasonSubject *string `json:"reasonSubject,omitempty" cborgen:"reasonSubject,omitempty"` 22 - Record *util.LexiconTypeDecoder `json:"record" cborgen:"record"` 23 - Uri string `json:"uri" cborgen:"uri"` 17 + Author *ActorDefs_ProfileView `json:"author" cborgen:"author"` 18 + Cid string `json:"cid" cborgen:"cid"` 19 + IndexedAt string `json:"indexedAt" cborgen:"indexedAt"` 20 + IsRead bool `json:"isRead" cborgen:"isRead"` 21 + Labels []*comatprototypes.LabelDefs_Label `json:"labels,omitempty" cborgen:"labels,omitempty"` 22 + Reason string `json:"reason" cborgen:"reason"` 23 + ReasonSubject *string `json:"reasonSubject,omitempty" cborgen:"reasonSubject,omitempty"` 24 + Record *util.LexiconTypeDecoder `json:"record" cborgen:"record"` 25 + Uri string `json:"uri" cborgen:"uri"` 24 26 } 25 27 26 28 type NotificationListNotifications_Output struct {
+4
bgs/handlers.go
··· 125 125 func (s *BGS) handleComAtprotoSyncListBlobs(ctx context.Context, did string, earliest string, latest string) (*comatprototypes.SyncListBlobs_Output, error) { 126 126 panic("NYI") 127 127 } 128 + 129 + func (s *BGS) handleComAtprotoSyncListRepos(ctx context.Context, cursor string, limit int) (*comatprototypes.SyncListRepos_Output, error) { 130 + panic("NYI") 131 + }
+27
bgs/stubs.go
··· 2 2 3 3 import ( 4 4 "io" 5 + "strconv" 5 6 6 7 comatprototypes "github.com/bluesky-social/indigo/api/atproto" 7 8 "github.com/labstack/echo/v4" ··· 21 22 e.GET("/xrpc/com.atproto.sync.getRecord", s.HandleComAtprotoSyncGetRecord) 22 23 e.GET("/xrpc/com.atproto.sync.getRepo", s.HandleComAtprotoSyncGetRepo) 23 24 e.GET("/xrpc/com.atproto.sync.listBlobs", s.HandleComAtprotoSyncListBlobs) 25 + e.GET("/xrpc/com.atproto.sync.listRepos", s.HandleComAtprotoSyncListRepos) 24 26 e.GET("/xrpc/com.atproto.sync.notifyOfUpdate", s.HandleComAtprotoSyncNotifyOfUpdate) 25 27 e.GET("/xrpc/com.atproto.sync.requestCrawl", s.HandleComAtprotoSyncRequestCrawl) 26 28 return nil ··· 145 147 var handleErr error 146 148 // func (s *BGS) handleComAtprotoSyncListBlobs(ctx context.Context,did string,earliest string,latest string) (*comatprototypes.SyncListBlobs_Output, error) 147 149 out, handleErr = s.handleComAtprotoSyncListBlobs(ctx, did, earliest, latest) 150 + if handleErr != nil { 151 + return handleErr 152 + } 153 + return c.JSON(200, out) 154 + } 155 + 156 + func (s *BGS) HandleComAtprotoSyncListRepos(c echo.Context) error { 157 + ctx, span := otel.Tracer("server").Start(c.Request().Context(), "HandleComAtprotoSyncListRepos") 158 + defer span.End() 159 + cursor := c.QueryParam("cursor") 160 + 161 + var limit int 162 + if p := c.QueryParam("limit"); p != "" { 163 + var err error 164 + limit, err = strconv.Atoi(p) 165 + if err != nil { 166 + return err 167 + } 168 + } else { 169 + limit = 500 170 + } 171 + var out *comatprototypes.SyncListRepos_Output 172 + var handleErr error 173 + // func (s *BGS) handleComAtprotoSyncListRepos(ctx context.Context,cursor string,limit int) (*comatprototypes.SyncListRepos_Output, error) 174 + out, handleErr = s.handleComAtprotoSyncListRepos(ctx, cursor, limit) 148 175 if handleErr != nil { 149 176 return handleErr 150 177 }
+1 -1
cmd/beemo/main.go
··· 110 110 } 111 111 112 112 auth, err := comatproto.ServerCreateSession(context.TODO(), xrpcc, &comatproto.ServerCreateSession_Input{ 113 - Identifier: &xrpcc.Auth.Handle, 113 + Identifier: xrpcc.Auth.Handle, 114 114 Password: cctx.String("password"), 115 115 }) 116 116 if err != nil {
+57 -1
cmd/gosky/main.go
··· 82 82 readRepoStreamCmd, 83 83 handleCmd, 84 84 getRecordCmd, 85 + createInviteCmd, 85 86 } 86 87 87 88 app.RunAndExitOnError() ··· 134 135 password := cctx.Args().Get(1) 135 136 136 137 ses, err := comatproto.ServerCreateSession(context.TODO(), xrpcc, &comatproto.ServerCreateSession_Input{ 137 - Identifier: &handle, 138 + Identifier: handle, 138 139 Password: password, 139 140 }) 140 141 if err != nil { ··· 1008 1009 return nil 1009 1010 }, 1010 1011 } 1012 + 1013 + var createInviteCmd = &cli.Command{ 1014 + Name: "createInvite", 1015 + Flags: []cli.Flag{ 1016 + &cli.StringFlag{ 1017 + Name: "admin-password", 1018 + EnvVars: []string{"ATP_AUTH_ADMIN_PASSWORD"}, 1019 + Required: true, 1020 + }, 1021 + &cli.IntFlag{ 1022 + Name: "useCount", 1023 + Value: 1, 1024 + }, 1025 + &cli.IntFlag{ 1026 + Name: "num", 1027 + Value: 1, 1028 + }, 1029 + }, 1030 + Action: func(cctx *cli.Context) error { 1031 + xrpcc, err := cliutil.GetXrpcClient(cctx, false) 1032 + if err != nil { 1033 + return err 1034 + } 1035 + 1036 + count := cctx.Int("useCount") 1037 + num := cctx.Int("num") 1038 + 1039 + var usrdid *string 1040 + if forUser := cctx.Args().Get(0); forUser != "" { 1041 + resp, err := comatproto.IdentityResolveHandle(context.TODO(), xrpcc, forUser) 1042 + if err != nil { 1043 + return err 1044 + } 1045 + 1046 + usrdid = &resp.Did 1047 + } 1048 + 1049 + adminKey := cctx.String("admin-password") 1050 + xrpcc.AdminToken = &adminKey 1051 + 1052 + for i := 0; i < num; i++ { 1053 + resp, err := comatproto.ServerCreateInviteCode(context.TODO(), xrpcc, &comatproto.ServerCreateInviteCode_Input{ 1054 + UseCount: int64(count), 1055 + ForAccount: usrdid, 1056 + }) 1057 + if err != nil { 1058 + return err 1059 + } 1060 + 1061 + fmt.Println(resp.Code) 1062 + } 1063 + 1064 + return nil 1065 + }, 1066 + }
+1 -1
fakedata/accounts.go
··· 86 86 } 87 87 // use XRPC client to re-auth using user/pass 88 88 auth, err := comatproto.ServerCreateSession(context.TODO(), xrpcc, &comatproto.ServerCreateSession_Input{ 89 - Identifier: &ac.Auth.Handle, 89 + Identifier: ac.Auth.Handle, 90 90 Password: ac.Password, 91 91 }) 92 92 if err != nil {
+1 -1
lex/gen.go
··· 903 903 return err 904 904 } 905 905 } else { 906 - %s = %T 906 + %s = %v 907 907 } 908 908 `, k, k, k, k, t.Default.(bool)) 909 909 } else {
+29 -5
pds/handlers.go
··· 451 451 }, nil 452 452 } 453 453 454 - func (s *Server) handleComAtprotoRepoListRecords(ctx context.Context, collection string, limit int, repo string, reverse *bool, rkeyEnd string, rkeyStart string) (*comatprototypes.RepoListRecords_Output, error) { 454 + func (s *Server) handleComAtprotoRepoListRecords(ctx context.Context, collection string, cursor string, limit int, repo string, reverse *bool, rkeyEnd string, rkeyStart string) (*comatprototypes.RepoListRecords_Output, error) { 455 455 panic("not yet implemented") 456 456 } 457 457 ··· 473 473 var ErrInvalidUsernameOrPassword = fmt.Errorf("invalid username or password") 474 474 475 475 func (s *Server) handleComAtprotoServerCreateSession(ctx context.Context, body *comatprototypes.ServerCreateSession_Input) (*comatprototypes.ServerCreateSession_Output, error) { 476 - u, err := s.lookupUserByHandle(ctx, *body.Identifier) 476 + u, err := s.lookupUserByHandle(ctx, body.Identifier) 477 477 if err != nil { 478 478 return nil, err 479 479 } ··· 482 482 return nil, ErrInvalidUsernameOrPassword 483 483 } 484 484 485 - tok, err := s.createAuthTokenForUser(ctx, *body.Identifier, u.Did) 485 + tok, err := s.createAuthTokenForUser(ctx, body.Identifier, u.Did) 486 486 if err != nil { 487 487 return nil, err 488 488 } 489 489 490 490 return &comatprototypes.ServerCreateSession_Output{ 491 - Handle: *body.Identifier, 491 + Handle: body.Identifier, 492 492 Did: u.Did, 493 493 AccessJwt: tok.AccessJwt, 494 494 RefreshJwt: tok.RefreshJwt, ··· 645 645 func (s *Server) handleComAtprotoAdminReverseModerationAction(ctx context.Context, body *comatprototypes.AdminReverseModerationAction_Input) (*comatprototypes.AdminDefs_ActionView, error) { 646 646 panic("nyi") 647 647 } 648 - func (s *Server) handleComAtprotoAdminSearchRepos(ctx context.Context, before string, limit int, term string) (*comatprototypes.AdminSearchRepos_Output, error) { 648 + func (s *Server) handleComAtprotoAdminSearchRepos(ctx context.Context, cursor string, invitedBy string, limit int, term string) (*comatprototypes.AdminSearchRepos_Output, error) { 649 649 panic("nyi") 650 650 } 651 651 func (s *Server) handleComAtprotoAdminTakeModerationAction(ctx context.Context, body *comatprototypes.AdminTakeModerationAction_Input) (*comatprototypes.AdminDefs_ActionView, error) { ··· 695 695 func (s *Server) handleComAtprotoRepoDescribeRepo(ctx context.Context, repo string) (*comatprototypes.RepoDescribeRepo_Output, error) { 696 696 panic("nyi") 697 697 } 698 + 699 + func (s *Server) handleComAtprotoAdminDisableInviteCodes(ctx context.Context, body *comatprototypes.AdminDisableInviteCodes_Input) error { 700 + panic("nyi") 701 + } 702 + 703 + func (s *Server) handleComAtprotoAdminGetInviteCodes(ctx context.Context, cursor string, limit int, sort string) (*comatprototypes.AdminGetInviteCodes_Output, error) { 704 + panic("nyi") 705 + } 706 + 707 + func (s *Server) handleComAtprotoLabelQueryLabels(ctx context.Context, cursor string, limit int, sources []string, uriPatterns []string) (*comatprototypes.LabelQueryLabels_Output, error) { 708 + panic("nyi") 709 + } 710 + 711 + func (s *Server) handleComAtprotoServerCreateInviteCodes(ctx context.Context, body *comatprototypes.ServerCreateInviteCodes_Input) (*comatprototypes.ServerCreateInviteCodes_Output, error) { 712 + panic("nyi") 713 + } 714 + 715 + func (s *Server) handleComAtprotoServerGetAccountInviteCodes(ctx context.Context, createAvailable bool, includeUsed bool) (*comatprototypes.ServerGetAccountInviteCodes_Output, error) { 716 + panic("nyi") 717 + } 718 + 719 + func (s *Server) handleComAtprotoSyncListRepos(ctx context.Context, cursor string, limit int) (*comatprototypes.SyncListRepos_Output, error) { 720 + panic("nyi") 721 + }
+2 -2
pds/handlers_test.go
··· 106 106 t.Fatal(err) 107 107 } 108 108 so, err := s.handleComAtprotoServerCreateSession(context.Background(), &atproto.ServerCreateSession_Input{ 109 - Identifier: &o.Handle, 109 + Identifier: o.Handle, 110 110 Password: "password", 111 111 }) 112 112 if err != nil { ··· 117 117 } 118 118 119 119 _, err = s.handleComAtprotoServerCreateSession(context.Background(), &atproto.ServerCreateSession_Input{ 120 - Identifier: &o.Handle, 120 + Identifier: o.Handle, 121 121 Password: "invalid", 122 122 }) 123 123 if err != ErrInvalidUsernameOrPassword {
+162 -4
pds/stubs.go
··· 459 459 } 460 460 461 461 func (s *Server) RegisterHandlersComAtproto(e *echo.Echo) error { 462 + e.POST("/xrpc/com.atproto.admin.disableInviteCodes", s.HandleComAtprotoAdminDisableInviteCodes) 463 + e.GET("/xrpc/com.atproto.admin.getInviteCodes", s.HandleComAtprotoAdminGetInviteCodes) 462 464 e.GET("/xrpc/com.atproto.admin.getModerationAction", s.HandleComAtprotoAdminGetModerationAction) 463 465 e.GET("/xrpc/com.atproto.admin.getModerationActions", s.HandleComAtprotoAdminGetModerationActions) 464 466 e.GET("/xrpc/com.atproto.admin.getModerationReport", s.HandleComAtprotoAdminGetModerationReport) ··· 471 473 e.POST("/xrpc/com.atproto.admin.takeModerationAction", s.HandleComAtprotoAdminTakeModerationAction) 472 474 e.GET("/xrpc/com.atproto.identity.resolveHandle", s.HandleComAtprotoIdentityResolveHandle) 473 475 e.POST("/xrpc/com.atproto.identity.updateHandle", s.HandleComAtprotoIdentityUpdateHandle) 476 + e.GET("/xrpc/com.atproto.label.queryLabels", s.HandleComAtprotoLabelQueryLabels) 474 477 e.POST("/xrpc/com.atproto.moderation.createReport", s.HandleComAtprotoModerationCreateReport) 475 478 e.POST("/xrpc/com.atproto.repo.applyWrites", s.HandleComAtprotoRepoApplyWrites) 476 479 e.POST("/xrpc/com.atproto.repo.createRecord", s.HandleComAtprotoRepoCreateRecord) ··· 482 485 e.POST("/xrpc/com.atproto.repo.uploadBlob", s.HandleComAtprotoRepoUploadBlob) 483 486 e.POST("/xrpc/com.atproto.server.createAccount", s.HandleComAtprotoServerCreateAccount) 484 487 e.POST("/xrpc/com.atproto.server.createInviteCode", s.HandleComAtprotoServerCreateInviteCode) 488 + e.POST("/xrpc/com.atproto.server.createInviteCodes", s.HandleComAtprotoServerCreateInviteCodes) 485 489 e.POST("/xrpc/com.atproto.server.createSession", s.HandleComAtprotoServerCreateSession) 486 490 e.POST("/xrpc/com.atproto.server.deleteAccount", s.HandleComAtprotoServerDeleteAccount) 487 491 e.POST("/xrpc/com.atproto.server.deleteSession", s.HandleComAtprotoServerDeleteSession) 488 492 e.GET("/xrpc/com.atproto.server.describeServer", s.HandleComAtprotoServerDescribeServer) 493 + e.GET("/xrpc/com.atproto.server.getAccountInviteCodes", s.HandleComAtprotoServerGetAccountInviteCodes) 489 494 e.GET("/xrpc/com.atproto.server.getSession", s.HandleComAtprotoServerGetSession) 490 495 e.POST("/xrpc/com.atproto.server.refreshSession", s.HandleComAtprotoServerRefreshSession) 491 496 e.POST("/xrpc/com.atproto.server.requestAccountDelete", s.HandleComAtprotoServerRequestAccountDelete) ··· 499 504 e.GET("/xrpc/com.atproto.sync.getRecord", s.HandleComAtprotoSyncGetRecord) 500 505 e.GET("/xrpc/com.atproto.sync.getRepo", s.HandleComAtprotoSyncGetRepo) 501 506 e.GET("/xrpc/com.atproto.sync.listBlobs", s.HandleComAtprotoSyncListBlobs) 507 + e.GET("/xrpc/com.atproto.sync.listRepos", s.HandleComAtprotoSyncListRepos) 502 508 e.GET("/xrpc/com.atproto.sync.notifyOfUpdate", s.HandleComAtprotoSyncNotifyOfUpdate) 503 509 e.GET("/xrpc/com.atproto.sync.requestCrawl", s.HandleComAtprotoSyncRequestCrawl) 504 510 return nil 505 511 } 506 512 513 + func (s *Server) HandleComAtprotoAdminDisableInviteCodes(c echo.Context) error { 514 + ctx, span := otel.Tracer("server").Start(c.Request().Context(), "HandleComAtprotoAdminDisableInviteCodes") 515 + defer span.End() 516 + 517 + var body comatprototypes.AdminDisableInviteCodes_Input 518 + if err := c.Bind(&body); err != nil { 519 + return err 520 + } 521 + var handleErr error 522 + // func (s *Server) handleComAtprotoAdminDisableInviteCodes(ctx context.Context,body *comatprototypes.AdminDisableInviteCodes_Input) error 523 + handleErr = s.handleComAtprotoAdminDisableInviteCodes(ctx, &body) 524 + if handleErr != nil { 525 + return handleErr 526 + } 527 + return nil 528 + } 529 + 530 + func (s *Server) HandleComAtprotoAdminGetInviteCodes(c echo.Context) error { 531 + ctx, span := otel.Tracer("server").Start(c.Request().Context(), "HandleComAtprotoAdminGetInviteCodes") 532 + defer span.End() 533 + cursor := c.QueryParam("cursor") 534 + 535 + var limit int 536 + if p := c.QueryParam("limit"); p != "" { 537 + var err error 538 + limit, err = strconv.Atoi(p) 539 + if err != nil { 540 + return err 541 + } 542 + } else { 543 + limit = 100 544 + } 545 + sort := c.QueryParam("sort") 546 + var out *comatprototypes.AdminGetInviteCodes_Output 547 + var handleErr error 548 + // func (s *Server) handleComAtprotoAdminGetInviteCodes(ctx context.Context,cursor string,limit int,sort string) (*comatprototypes.AdminGetInviteCodes_Output, error) 549 + out, handleErr = s.handleComAtprotoAdminGetInviteCodes(ctx, cursor, limit, sort) 550 + if handleErr != nil { 551 + return handleErr 552 + } 553 + return c.JSON(200, out) 554 + } 555 + 507 556 func (s *Server) HandleComAtprotoAdminGetModerationAction(c echo.Context) error { 508 557 ctx, span := otel.Tracer("server").Start(c.Request().Context(), "HandleComAtprotoAdminGetModerationAction") 509 558 defer span.End() ··· 670 719 ctx, span := otel.Tracer("server").Start(c.Request().Context(), "HandleComAtprotoAdminSearchRepos") 671 720 defer span.End() 672 721 cursor := c.QueryParam("cursor") 722 + invitedBy := c.QueryParam("invitedBy") 673 723 674 724 var limit int 675 725 if p := c.QueryParam("limit"); p != "" { ··· 684 734 term := c.QueryParam("term") 685 735 var out *comatprototypes.AdminSearchRepos_Output 686 736 var handleErr error 687 - // func (s *Server) handleComAtprotoAdminSearchRepos(ctx context.Context,cursor string,limit int,term string) (*comatprototypes.AdminSearchRepos_Output, error) 688 - out, handleErr = s.handleComAtprotoAdminSearchRepos(ctx, cursor, limit, term) 737 + // func (s *Server) handleComAtprotoAdminSearchRepos(ctx context.Context,cursor string,invitedBy string,limit int,term string) (*comatprototypes.AdminSearchRepos_Output, error) 738 + out, handleErr = s.handleComAtprotoAdminSearchRepos(ctx, cursor, invitedBy, limit, term) 689 739 if handleErr != nil { 690 740 return handleErr 691 741 } ··· 739 789 return handleErr 740 790 } 741 791 return nil 792 + } 793 + 794 + func (s *Server) HandleComAtprotoLabelQueryLabels(c echo.Context) error { 795 + ctx, span := otel.Tracer("server").Start(c.Request().Context(), "HandleComAtprotoLabelQueryLabels") 796 + defer span.End() 797 + cursor := c.QueryParam("cursor") 798 + 799 + var limit int 800 + if p := c.QueryParam("limit"); p != "" { 801 + var err error 802 + limit, err = strconv.Atoi(p) 803 + if err != nil { 804 + return err 805 + } 806 + } else { 807 + limit = 50 808 + } 809 + 810 + sources := c.QueryParams()["sources"] 811 + 812 + uriPatterns := c.QueryParams()["uriPatterns"] 813 + var out *comatprototypes.LabelQueryLabels_Output 814 + var handleErr error 815 + // func (s *Server) handleComAtprotoLabelQueryLabels(ctx context.Context,cursor string,limit int,sources []string,uriPatterns []string) (*comatprototypes.LabelQueryLabels_Output, error) 816 + out, handleErr = s.handleComAtprotoLabelQueryLabels(ctx, cursor, limit, sources, uriPatterns) 817 + if handleErr != nil { 818 + return handleErr 819 + } 820 + return c.JSON(200, out) 742 821 } 743 822 744 823 func (s *Server) HandleComAtprotoModerationCreateReport(c echo.Context) error { ··· 846 925 ctx, span := otel.Tracer("server").Start(c.Request().Context(), "HandleComAtprotoRepoListRecords") 847 926 defer span.End() 848 927 collection := c.QueryParam("collection") 928 + cursor := c.QueryParam("cursor") 849 929 850 930 var limit int 851 931 if p := c.QueryParam("limit"); p != "" { ··· 871 951 rkeyStart := c.QueryParam("rkeyStart") 872 952 var out *comatprototypes.RepoListRecords_Output 873 953 var handleErr error 874 - // func (s *Server) handleComAtprotoRepoListRecords(ctx context.Context,collection string,limit int,repo string,reverse *bool,rkeyEnd string,rkeyStart string) (*comatprototypes.RepoListRecords_Output, error) 875 - out, handleErr = s.handleComAtprotoRepoListRecords(ctx, collection, limit, repo, reverse, rkeyEnd, rkeyStart) 954 + // func (s *Server) handleComAtprotoRepoListRecords(ctx context.Context,collection string,cursor string,limit int,repo string,reverse *bool,rkeyEnd string,rkeyStart string) (*comatprototypes.RepoListRecords_Output, error) 955 + out, handleErr = s.handleComAtprotoRepoListRecords(ctx, collection, cursor, limit, repo, reverse, rkeyEnd, rkeyStart) 876 956 if handleErr != nil { 877 957 return handleErr 878 958 } ··· 948 1028 return c.JSON(200, out) 949 1029 } 950 1030 1031 + func (s *Server) HandleComAtprotoServerCreateInviteCodes(c echo.Context) error { 1032 + ctx, span := otel.Tracer("server").Start(c.Request().Context(), "HandleComAtprotoServerCreateInviteCodes") 1033 + defer span.End() 1034 + 1035 + var body comatprototypes.ServerCreateInviteCodes_Input 1036 + if err := c.Bind(&body); err != nil { 1037 + return err 1038 + } 1039 + var out *comatprototypes.ServerCreateInviteCodes_Output 1040 + var handleErr error 1041 + // func (s *Server) handleComAtprotoServerCreateInviteCodes(ctx context.Context,body *comatprototypes.ServerCreateInviteCodes_Input) (*comatprototypes.ServerCreateInviteCodes_Output, error) 1042 + out, handleErr = s.handleComAtprotoServerCreateInviteCodes(ctx, &body) 1043 + if handleErr != nil { 1044 + return handleErr 1045 + } 1046 + return c.JSON(200, out) 1047 + } 1048 + 951 1049 func (s *Server) HandleComAtprotoServerCreateSession(c echo.Context) error { 952 1050 ctx, span := otel.Tracer("server").Start(c.Request().Context(), "HandleComAtprotoServerCreateSession") 953 1051 defer span.End() ··· 1008 1106 return c.JSON(200, out) 1009 1107 } 1010 1108 1109 + func (s *Server) HandleComAtprotoServerGetAccountInviteCodes(c echo.Context) error { 1110 + ctx, span := otel.Tracer("server").Start(c.Request().Context(), "HandleComAtprotoServerGetAccountInviteCodes") 1111 + defer span.End() 1112 + 1113 + var createAvailable bool 1114 + if p := c.QueryParam("createAvailable"); p != "" { 1115 + var err error 1116 + createAvailable, err = strconv.ParseBool(p) 1117 + if err != nil { 1118 + return err 1119 + } 1120 + } else { 1121 + createAvailable = true 1122 + } 1123 + 1124 + var includeUsed bool 1125 + if p := c.QueryParam("includeUsed"); p != "" { 1126 + var err error 1127 + includeUsed, err = strconv.ParseBool(p) 1128 + if err != nil { 1129 + return err 1130 + } 1131 + } else { 1132 + includeUsed = true 1133 + } 1134 + var out *comatprototypes.ServerGetAccountInviteCodes_Output 1135 + var handleErr error 1136 + // func (s *Server) handleComAtprotoServerGetAccountInviteCodes(ctx context.Context,createAvailable bool,includeUsed bool) (*comatprototypes.ServerGetAccountInviteCodes_Output, error) 1137 + out, handleErr = s.handleComAtprotoServerGetAccountInviteCodes(ctx, createAvailable, includeUsed) 1138 + if handleErr != nil { 1139 + return handleErr 1140 + } 1141 + return c.JSON(200, out) 1142 + } 1143 + 1011 1144 func (s *Server) HandleComAtprotoServerGetSession(c echo.Context) error { 1012 1145 ctx, span := otel.Tracer("server").Start(c.Request().Context(), "HandleComAtprotoServerGetSession") 1013 1146 defer span.End() ··· 1199 1332 var handleErr error 1200 1333 // func (s *Server) handleComAtprotoSyncListBlobs(ctx context.Context,did string,earliest string,latest string) (*comatprototypes.SyncListBlobs_Output, error) 1201 1334 out, handleErr = s.handleComAtprotoSyncListBlobs(ctx, did, earliest, latest) 1335 + if handleErr != nil { 1336 + return handleErr 1337 + } 1338 + return c.JSON(200, out) 1339 + } 1340 + 1341 + func (s *Server) HandleComAtprotoSyncListRepos(c echo.Context) error { 1342 + ctx, span := otel.Tracer("server").Start(c.Request().Context(), "HandleComAtprotoSyncListRepos") 1343 + defer span.End() 1344 + cursor := c.QueryParam("cursor") 1345 + 1346 + var limit int 1347 + if p := c.QueryParam("limit"); p != "" { 1348 + var err error 1349 + limit, err = strconv.Atoi(p) 1350 + if err != nil { 1351 + return err 1352 + } 1353 + } else { 1354 + limit = 500 1355 + } 1356 + var out *comatprototypes.SyncListRepos_Output 1357 + var handleErr error 1358 + // func (s *Server) handleComAtprotoSyncListRepos(ctx context.Context,cursor string,limit int) (*comatprototypes.SyncListRepos_Output, error) 1359 + out, handleErr = s.handleComAtprotoSyncListRepos(ctx, cursor, limit) 1202 1360 if handleErr != nil { 1203 1361 return handleErr 1204 1362 }
+1 -1
repomgr/ingest_test.go
··· 60 60 61 61 repoman := NewRepoManager(maindb, cs, &util.FakeKeyManager{}) 62 62 63 - fi, err := os.Open("../testing/divy.repo") 63 + fi, err := os.Open("../testing/test_files/divy.repo") 64 64 if err != nil { 65 65 t.Fatal(err) 66 66 }