+19
-17
api/atproto/admindefs.go
+19
-17
api/atproto/admindefs.go
···
228
228
//
229
229
// RECORDTYPE: AdminDefs_RepoView
230
230
type AdminDefs_RepoView struct {
231
-
LexiconTypeID string `json:"$type,const=com.atproto.admin.defs" cborgen:"$type,const=com.atproto.admin.defs"`
232
-
Did string `json:"did" cborgen:"did"`
233
-
Email *string `json:"email,omitempty" cborgen:"email,omitempty"`
234
-
Handle string `json:"handle" cborgen:"handle"`
235
-
IndexedAt string `json:"indexedAt" cborgen:"indexedAt"`
236
-
InvitedBy *ServerDefs_InviteCode `json:"invitedBy,omitempty" cborgen:"invitedBy,omitempty"`
237
-
Moderation *AdminDefs_Moderation `json:"moderation" cborgen:"moderation"`
238
-
RelatedRecords []*util.LexiconTypeDecoder `json:"relatedRecords" cborgen:"relatedRecords"`
231
+
LexiconTypeID string `json:"$type,const=com.atproto.admin.defs" cborgen:"$type,const=com.atproto.admin.defs"`
232
+
Did string `json:"did" cborgen:"did"`
233
+
Email *string `json:"email,omitempty" cborgen:"email,omitempty"`
234
+
Handle string `json:"handle" cborgen:"handle"`
235
+
IndexedAt string `json:"indexedAt" cborgen:"indexedAt"`
236
+
InvitedBy *ServerDefs_InviteCode `json:"invitedBy,omitempty" cborgen:"invitedBy,omitempty"`
237
+
InvitesDisabled *bool `json:"invitesDisabled,omitempty" cborgen:"invitesDisabled,omitempty"`
238
+
Moderation *AdminDefs_Moderation `json:"moderation" cborgen:"moderation"`
239
+
RelatedRecords []*util.LexiconTypeDecoder `json:"relatedRecords" cborgen:"relatedRecords"`
239
240
}
240
241
241
242
// AdminDefs_RepoViewDetail is a "repoViewDetail" in the com.atproto.admin.defs schema.
242
243
type AdminDefs_RepoViewDetail struct {
243
-
Did string `json:"did" cborgen:"did"`
244
-
Email *string `json:"email,omitempty" cborgen:"email,omitempty"`
245
-
Handle string `json:"handle" cborgen:"handle"`
246
-
IndexedAt string `json:"indexedAt" cborgen:"indexedAt"`
247
-
InvitedBy *ServerDefs_InviteCode `json:"invitedBy,omitempty" cborgen:"invitedBy,omitempty"`
248
-
Invites []*ServerDefs_InviteCode `json:"invites,omitempty" cborgen:"invites,omitempty"`
249
-
Labels []*LabelDefs_Label `json:"labels,omitempty" cborgen:"labels,omitempty"`
250
-
Moderation *AdminDefs_ModerationDetail `json:"moderation" cborgen:"moderation"`
251
-
RelatedRecords []*util.LexiconTypeDecoder `json:"relatedRecords" cborgen:"relatedRecords"`
244
+
Did string `json:"did" cborgen:"did"`
245
+
Email *string `json:"email,omitempty" cborgen:"email,omitempty"`
246
+
Handle string `json:"handle" cborgen:"handle"`
247
+
IndexedAt string `json:"indexedAt" cborgen:"indexedAt"`
248
+
InvitedBy *ServerDefs_InviteCode `json:"invitedBy,omitempty" cborgen:"invitedBy,omitempty"`
249
+
Invites []*ServerDefs_InviteCode `json:"invites,omitempty" cborgen:"invites,omitempty"`
250
+
InvitesDisabled *bool `json:"invitesDisabled,omitempty" cborgen:"invitesDisabled,omitempty"`
251
+
Labels []*LabelDefs_Label `json:"labels,omitempty" cborgen:"labels,omitempty"`
252
+
Moderation *AdminDefs_ModerationDetail `json:"moderation" cborgen:"moderation"`
253
+
RelatedRecords []*util.LexiconTypeDecoder `json:"relatedRecords" cborgen:"relatedRecords"`
252
254
}
253
255
254
256
// AdminDefs_ReportView is a "reportView" in the com.atproto.admin.defs schema.
+25
api/atproto/admindisableAccountInvites.go
+25
api/atproto/admindisableAccountInvites.go
···
1
+
// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
2
+
3
+
package atproto
4
+
5
+
// schema: com.atproto.admin.disableAccountInvites
6
+
7
+
import (
8
+
"context"
9
+
10
+
"github.com/bluesky-social/indigo/xrpc"
11
+
)
12
+
13
+
// AdminDisableAccountInvites_Input is the input argument to a com.atproto.admin.disableAccountInvites call.
14
+
type AdminDisableAccountInvites_Input struct {
15
+
Account string `json:"account" cborgen:"account"`
16
+
}
17
+
18
+
// AdminDisableAccountInvites calls the XRPC method "com.atproto.admin.disableAccountInvites".
19
+
func AdminDisableAccountInvites(ctx context.Context, c *xrpc.Client, input *AdminDisableAccountInvites_Input) error {
20
+
if err := c.Do(ctx, xrpc.Procedure, "application/json", "com.atproto.admin.disableAccountInvites", nil, input, nil); err != nil {
21
+
return err
22
+
}
23
+
24
+
return nil
25
+
}
+25
api/atproto/adminenableAccountInvites.go
+25
api/atproto/adminenableAccountInvites.go
···
1
+
// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
2
+
3
+
package atproto
4
+
5
+
// schema: com.atproto.admin.enableAccountInvites
6
+
7
+
import (
8
+
"context"
9
+
10
+
"github.com/bluesky-social/indigo/xrpc"
11
+
)
12
+
13
+
// AdminEnableAccountInvites_Input is the input argument to a com.atproto.admin.enableAccountInvites call.
14
+
type AdminEnableAccountInvites_Input struct {
15
+
Account string `json:"account" cborgen:"account"`
16
+
}
17
+
18
+
// AdminEnableAccountInvites calls the XRPC method "com.atproto.admin.enableAccountInvites".
19
+
func AdminEnableAccountInvites(ctx context.Context, c *xrpc.Client, input *AdminEnableAccountInvites_Input) error {
20
+
if err := c.Do(ctx, xrpc.Procedure, "application/json", "com.atproto.admin.enableAccountInvites", nil, input, nil); err != nil {
21
+
return err
22
+
}
23
+
24
+
return nil
25
+
}
+6
-5
api/atproto/admingetModerationReports.go
+6
-5
api/atproto/admingetModerationReports.go
···
17
17
}
18
18
19
19
// AdminGetModerationReports calls the XRPC method "com.atproto.admin.getModerationReports".
20
-
func AdminGetModerationReports(ctx context.Context, c *xrpc.Client, cursor string, limit int64, resolved bool, subject string) (*AdminGetModerationReports_Output, error) {
20
+
func AdminGetModerationReports(ctx context.Context, c *xrpc.Client, actionType string, cursor string, limit int64, resolved bool, subject string) (*AdminGetModerationReports_Output, error) {
21
21
var out AdminGetModerationReports_Output
22
22
23
23
params := map[string]interface{}{
24
-
"cursor": cursor,
25
-
"limit": limit,
26
-
"resolved": resolved,
27
-
"subject": subject,
24
+
"actionType": actionType,
25
+
"cursor": cursor,
26
+
"limit": limit,
27
+
"resolved": resolved,
28
+
"subject": subject,
28
29
}
29
30
if err := c.Do(ctx, xrpc.Query, "", "com.atproto.admin.getModerationReports", params, nil, &out); err != nil {
30
31
return nil, err
+28
api/atproto/reporebaseRepo.go
+28
api/atproto/reporebaseRepo.go
···
1
+
// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
2
+
3
+
package atproto
4
+
5
+
// schema: com.atproto.repo.rebaseRepo
6
+
7
+
import (
8
+
"context"
9
+
10
+
"github.com/bluesky-social/indigo/xrpc"
11
+
)
12
+
13
+
// RepoRebaseRepo_Input is the input argument to a com.atproto.repo.rebaseRepo call.
14
+
type RepoRebaseRepo_Input struct {
15
+
// repo: The handle or DID of the repo.
16
+
Repo string `json:"repo" cborgen:"repo"`
17
+
// swapCommit: Compare and swap with the previous commit by cid.
18
+
SwapCommit *string `json:"swapCommit,omitempty" cborgen:"swapCommit,omitempty"`
19
+
}
20
+
21
+
// RepoRebaseRepo calls the XRPC method "com.atproto.repo.rebaseRepo".
22
+
func RepoRebaseRepo(ctx context.Context, c *xrpc.Client, input *RepoRebaseRepo_Input) error {
23
+
if err := c.Do(ctx, xrpc.Procedure, "application/json", "com.atproto.repo.rebaseRepo", nil, input, nil); err != nil {
24
+
return err
25
+
}
26
+
27
+
return nil
28
+
}
+1
api/atproto/servercreateAccount.go
+1
api/atproto/servercreateAccount.go
···
12
12
13
13
// ServerCreateAccount_Input is the input argument to a com.atproto.server.createAccount call.
14
14
type ServerCreateAccount_Input struct {
15
+
Did *string `json:"did,omitempty" cborgen:"did,omitempty"`
15
16
Email string `json:"email" cborgen:"email"`
16
17
Handle string `json:"handle" cborgen:"handle"`
17
18
InviteCode *string `json:"inviteCode,omitempty" cborgen:"inviteCode,omitempty"`
+62
-3
api/bsky/actordefs.go
+62
-3
api/bsky/actordefs.go
···
5
5
// schema: app.bsky.actor.defs
6
6
7
7
import (
8
+
"encoding/json"
9
+
"fmt"
10
+
8
11
comatprototypes "github.com/bluesky-social/indigo/api/atproto"
12
+
"github.com/bluesky-social/indigo/lex/util"
9
13
)
10
14
15
+
// ActorDefs_AdultContentPref is a "adultContentPref" in the app.bsky.actor.defs schema.
16
+
//
17
+
// RECORDTYPE: ActorDefs_AdultContentPref
18
+
type ActorDefs_AdultContentPref struct {
19
+
LexiconTypeID string `json:"$type,const=app.bsky.actor.defs" cborgen:"$type,const=app.bsky.actor.defs"`
20
+
Enabled bool `json:"enabled" cborgen:"enabled"`
21
+
}
22
+
23
+
// ActorDefs_ContentLabelPref is a "contentLabelPref" in the app.bsky.actor.defs schema.
24
+
//
25
+
// RECORDTYPE: ActorDefs_ContentLabelPref
26
+
type ActorDefs_ContentLabelPref struct {
27
+
LexiconTypeID string `json:"$type,const=app.bsky.actor.defs" cborgen:"$type,const=app.bsky.actor.defs"`
28
+
Label string `json:"label" cborgen:"label"`
29
+
Visibility string `json:"visibility" cborgen:"visibility"`
30
+
}
31
+
32
+
type ActorDefs_Preferences_Elem struct {
33
+
ActorDefs_AdultContentPref *ActorDefs_AdultContentPref
34
+
ActorDefs_ContentLabelPref *ActorDefs_ContentLabelPref
35
+
}
36
+
37
+
func (t *ActorDefs_Preferences_Elem) MarshalJSON() ([]byte, error) {
38
+
if t.ActorDefs_AdultContentPref != nil {
39
+
t.ActorDefs_AdultContentPref.LexiconTypeID = "app.bsky.actor.defs#adultContentPref"
40
+
return json.Marshal(t.ActorDefs_AdultContentPref)
41
+
}
42
+
if t.ActorDefs_ContentLabelPref != nil {
43
+
t.ActorDefs_ContentLabelPref.LexiconTypeID = "app.bsky.actor.defs#contentLabelPref"
44
+
return json.Marshal(t.ActorDefs_ContentLabelPref)
45
+
}
46
+
return nil, fmt.Errorf("cannot marshal empty enum")
47
+
}
48
+
func (t *ActorDefs_Preferences_Elem) UnmarshalJSON(b []byte) error {
49
+
typ, err := util.TypeExtract(b)
50
+
if err != nil {
51
+
return err
52
+
}
53
+
54
+
switch typ {
55
+
case "app.bsky.actor.defs#adultContentPref":
56
+
t.ActorDefs_AdultContentPref = new(ActorDefs_AdultContentPref)
57
+
return json.Unmarshal(b, t.ActorDefs_AdultContentPref)
58
+
case "app.bsky.actor.defs#contentLabelPref":
59
+
t.ActorDefs_ContentLabelPref = new(ActorDefs_ContentLabelPref)
60
+
return json.Unmarshal(b, t.ActorDefs_ContentLabelPref)
61
+
62
+
default:
63
+
return nil
64
+
}
65
+
}
66
+
11
67
// ActorDefs_ProfileView is a "profileView" in the app.bsky.actor.defs schema.
12
68
type ActorDefs_ProfileView struct {
13
69
Avatar *string `json:"avatar,omitempty" cborgen:"avatar,omitempty"`
···
48
104
49
105
// ActorDefs_ViewerState is a "viewerState" in the app.bsky.actor.defs schema.
50
106
type ActorDefs_ViewerState struct {
51
-
FollowedBy *string `json:"followedBy,omitempty" cborgen:"followedBy,omitempty"`
52
-
Following *string `json:"following,omitempty" cborgen:"following,omitempty"`
53
-
Muted *bool `json:"muted,omitempty" cborgen:"muted,omitempty"`
107
+
BlockedBy *bool `json:"blockedBy,omitempty" cborgen:"blockedBy,omitempty"`
108
+
Blocking *string `json:"blocking,omitempty" cborgen:"blocking,omitempty"`
109
+
FollowedBy *string `json:"followedBy,omitempty" cborgen:"followedBy,omitempty"`
110
+
Following *string `json:"following,omitempty" cborgen:"following,omitempty"`
111
+
Muted *bool `json:"muted,omitempty" cborgen:"muted,omitempty"`
112
+
MutedByList *GraphDefs_ListViewBasic `json:"mutedByList,omitempty" cborgen:"mutedByList,omitempty"`
54
113
}
+723
api/bsky/cbor_gen.go
+723
api/bsky/cbor_gen.go
···
3235
3235
3236
3236
return nil
3237
3237
}
3238
+
func (t *GraphBlock) MarshalCBOR(w io.Writer) error {
3239
+
if t == nil {
3240
+
_, err := w.Write(cbg.CborNull)
3241
+
return err
3242
+
}
3243
+
3244
+
cw := cbg.NewCborWriter(w)
3245
+
3246
+
if _, err := cw.Write([]byte{163}); err != nil {
3247
+
return err
3248
+
}
3249
+
3250
+
// t.LexiconTypeID (string) (string)
3251
+
if len("$type") > cbg.MaxLength {
3252
+
return xerrors.Errorf("Value in field \"$type\" was too long")
3253
+
}
3254
+
3255
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("$type"))); err != nil {
3256
+
return err
3257
+
}
3258
+
if _, err := io.WriteString(w, string("$type")); err != nil {
3259
+
return err
3260
+
}
3261
+
3262
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("app.bsky.graph.block"))); err != nil {
3263
+
return err
3264
+
}
3265
+
if _, err := io.WriteString(w, string("app.bsky.graph.block")); err != nil {
3266
+
return err
3267
+
}
3268
+
3269
+
// t.Subject (string) (string)
3270
+
if len("subject") > cbg.MaxLength {
3271
+
return xerrors.Errorf("Value in field \"subject\" was too long")
3272
+
}
3273
+
3274
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("subject"))); err != nil {
3275
+
return err
3276
+
}
3277
+
if _, err := io.WriteString(w, string("subject")); err != nil {
3278
+
return err
3279
+
}
3280
+
3281
+
if len(t.Subject) > cbg.MaxLength {
3282
+
return xerrors.Errorf("Value in field t.Subject was too long")
3283
+
}
3284
+
3285
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Subject))); err != nil {
3286
+
return err
3287
+
}
3288
+
if _, err := io.WriteString(w, string(t.Subject)); err != nil {
3289
+
return err
3290
+
}
3291
+
3292
+
// t.CreatedAt (string) (string)
3293
+
if len("createdAt") > cbg.MaxLength {
3294
+
return xerrors.Errorf("Value in field \"createdAt\" was too long")
3295
+
}
3296
+
3297
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("createdAt"))); err != nil {
3298
+
return err
3299
+
}
3300
+
if _, err := io.WriteString(w, string("createdAt")); err != nil {
3301
+
return err
3302
+
}
3303
+
3304
+
if len(t.CreatedAt) > cbg.MaxLength {
3305
+
return xerrors.Errorf("Value in field t.CreatedAt was too long")
3306
+
}
3307
+
3308
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.CreatedAt))); err != nil {
3309
+
return err
3310
+
}
3311
+
if _, err := io.WriteString(w, string(t.CreatedAt)); err != nil {
3312
+
return err
3313
+
}
3314
+
return nil
3315
+
}
3316
+
3317
+
func (t *GraphBlock) UnmarshalCBOR(r io.Reader) (err error) {
3318
+
*t = GraphBlock{}
3319
+
3320
+
cr := cbg.NewCborReader(r)
3321
+
3322
+
maj, extra, err := cr.ReadHeader()
3323
+
if err != nil {
3324
+
return err
3325
+
}
3326
+
defer func() {
3327
+
if err == io.EOF {
3328
+
err = io.ErrUnexpectedEOF
3329
+
}
3330
+
}()
3331
+
3332
+
if maj != cbg.MajMap {
3333
+
return fmt.Errorf("cbor input should be of type map")
3334
+
}
3335
+
3336
+
if extra > cbg.MaxLength {
3337
+
return fmt.Errorf("GraphBlock: map struct too large (%d)", extra)
3338
+
}
3339
+
3340
+
var name string
3341
+
n := extra
3342
+
3343
+
for i := uint64(0); i < n; i++ {
3344
+
3345
+
{
3346
+
sval, err := cbg.ReadString(cr)
3347
+
if err != nil {
3348
+
return err
3349
+
}
3350
+
3351
+
name = string(sval)
3352
+
}
3353
+
3354
+
switch name {
3355
+
// t.LexiconTypeID (string) (string)
3356
+
case "$type":
3357
+
3358
+
{
3359
+
sval, err := cbg.ReadString(cr)
3360
+
if err != nil {
3361
+
return err
3362
+
}
3363
+
3364
+
t.LexiconTypeID = string(sval)
3365
+
}
3366
+
// t.Subject (string) (string)
3367
+
case "subject":
3368
+
3369
+
{
3370
+
sval, err := cbg.ReadString(cr)
3371
+
if err != nil {
3372
+
return err
3373
+
}
3374
+
3375
+
t.Subject = string(sval)
3376
+
}
3377
+
// t.CreatedAt (string) (string)
3378
+
case "createdAt":
3379
+
3380
+
{
3381
+
sval, err := cbg.ReadString(cr)
3382
+
if err != nil {
3383
+
return err
3384
+
}
3385
+
3386
+
t.CreatedAt = string(sval)
3387
+
}
3388
+
3389
+
default:
3390
+
// Field doesn't exist on this type, so ignore it
3391
+
cbg.ScanForLinks(r, func(cid.Cid) {})
3392
+
}
3393
+
}
3394
+
3395
+
return nil
3396
+
}
3397
+
func (t *GraphList) MarshalCBOR(w io.Writer) error {
3398
+
if t == nil {
3399
+
_, err := w.Write(cbg.CborNull)
3400
+
return err
3401
+
}
3402
+
3403
+
cw := cbg.NewCborWriter(w)
3404
+
fieldCount := 7
3405
+
3406
+
if t.Avatar == nil {
3407
+
fieldCount--
3408
+
}
3409
+
3410
+
if t.Description == nil {
3411
+
fieldCount--
3412
+
}
3413
+
3414
+
if t.DescriptionFacets == nil {
3415
+
fieldCount--
3416
+
}
3417
+
3418
+
if _, err := cw.Write(cbg.CborEncodeMajorType(cbg.MajMap, uint64(fieldCount))); err != nil {
3419
+
return err
3420
+
}
3421
+
3422
+
// t.Name (string) (string)
3423
+
if len("name") > cbg.MaxLength {
3424
+
return xerrors.Errorf("Value in field \"name\" was too long")
3425
+
}
3426
+
3427
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("name"))); err != nil {
3428
+
return err
3429
+
}
3430
+
if _, err := io.WriteString(w, string("name")); err != nil {
3431
+
return err
3432
+
}
3433
+
3434
+
if len(t.Name) > cbg.MaxLength {
3435
+
return xerrors.Errorf("Value in field t.Name was too long")
3436
+
}
3437
+
3438
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Name))); err != nil {
3439
+
return err
3440
+
}
3441
+
if _, err := io.WriteString(w, string(t.Name)); err != nil {
3442
+
return err
3443
+
}
3444
+
3445
+
// t.LexiconTypeID (string) (string)
3446
+
if len("$type") > cbg.MaxLength {
3447
+
return xerrors.Errorf("Value in field \"$type\" was too long")
3448
+
}
3449
+
3450
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("$type"))); err != nil {
3451
+
return err
3452
+
}
3453
+
if _, err := io.WriteString(w, string("$type")); err != nil {
3454
+
return err
3455
+
}
3456
+
3457
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("app.bsky.graph.list"))); err != nil {
3458
+
return err
3459
+
}
3460
+
if _, err := io.WriteString(w, string("app.bsky.graph.list")); err != nil {
3461
+
return err
3462
+
}
3463
+
3464
+
// t.Avatar (util.LexBlob) (struct)
3465
+
if t.Avatar != nil {
3466
+
3467
+
if len("avatar") > cbg.MaxLength {
3468
+
return xerrors.Errorf("Value in field \"avatar\" was too long")
3469
+
}
3470
+
3471
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("avatar"))); err != nil {
3472
+
return err
3473
+
}
3474
+
if _, err := io.WriteString(w, string("avatar")); err != nil {
3475
+
return err
3476
+
}
3477
+
3478
+
if err := t.Avatar.MarshalCBOR(cw); err != nil {
3479
+
return err
3480
+
}
3481
+
}
3482
+
3483
+
// t.Purpose (string) (string)
3484
+
if len("purpose") > cbg.MaxLength {
3485
+
return xerrors.Errorf("Value in field \"purpose\" was too long")
3486
+
}
3487
+
3488
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("purpose"))); err != nil {
3489
+
return err
3490
+
}
3491
+
if _, err := io.WriteString(w, string("purpose")); err != nil {
3492
+
return err
3493
+
}
3494
+
3495
+
if t.Purpose == nil {
3496
+
if _, err := cw.Write(cbg.CborNull); err != nil {
3497
+
return err
3498
+
}
3499
+
} else {
3500
+
if len(*t.Purpose) > cbg.MaxLength {
3501
+
return xerrors.Errorf("Value in field t.Purpose was too long")
3502
+
}
3503
+
3504
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(*t.Purpose))); err != nil {
3505
+
return err
3506
+
}
3507
+
if _, err := io.WriteString(w, string(*t.Purpose)); err != nil {
3508
+
return err
3509
+
}
3510
+
}
3511
+
3512
+
// t.CreatedAt (string) (string)
3513
+
if len("createdAt") > cbg.MaxLength {
3514
+
return xerrors.Errorf("Value in field \"createdAt\" was too long")
3515
+
}
3516
+
3517
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("createdAt"))); err != nil {
3518
+
return err
3519
+
}
3520
+
if _, err := io.WriteString(w, string("createdAt")); err != nil {
3521
+
return err
3522
+
}
3523
+
3524
+
if len(t.CreatedAt) > cbg.MaxLength {
3525
+
return xerrors.Errorf("Value in field t.CreatedAt was too long")
3526
+
}
3527
+
3528
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.CreatedAt))); err != nil {
3529
+
return err
3530
+
}
3531
+
if _, err := io.WriteString(w, string(t.CreatedAt)); err != nil {
3532
+
return err
3533
+
}
3534
+
3535
+
// t.Description (string) (string)
3536
+
if t.Description != nil {
3537
+
3538
+
if len("description") > cbg.MaxLength {
3539
+
return xerrors.Errorf("Value in field \"description\" was too long")
3540
+
}
3541
+
3542
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("description"))); err != nil {
3543
+
return err
3544
+
}
3545
+
if _, err := io.WriteString(w, string("description")); err != nil {
3546
+
return err
3547
+
}
3548
+
3549
+
if t.Description == nil {
3550
+
if _, err := cw.Write(cbg.CborNull); err != nil {
3551
+
return err
3552
+
}
3553
+
} else {
3554
+
if len(*t.Description) > cbg.MaxLength {
3555
+
return xerrors.Errorf("Value in field t.Description was too long")
3556
+
}
3557
+
3558
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(*t.Description))); err != nil {
3559
+
return err
3560
+
}
3561
+
if _, err := io.WriteString(w, string(*t.Description)); err != nil {
3562
+
return err
3563
+
}
3564
+
}
3565
+
}
3566
+
3567
+
// t.DescriptionFacets ([]*bsky.RichtextFacet) (slice)
3568
+
if t.DescriptionFacets != nil {
3569
+
3570
+
if len("descriptionFacets") > cbg.MaxLength {
3571
+
return xerrors.Errorf("Value in field \"descriptionFacets\" was too long")
3572
+
}
3573
+
3574
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("descriptionFacets"))); err != nil {
3575
+
return err
3576
+
}
3577
+
if _, err := io.WriteString(w, string("descriptionFacets")); err != nil {
3578
+
return err
3579
+
}
3580
+
3581
+
if len(t.DescriptionFacets) > cbg.MaxLength {
3582
+
return xerrors.Errorf("Slice value in field t.DescriptionFacets was too long")
3583
+
}
3584
+
3585
+
if err := cw.WriteMajorTypeHeader(cbg.MajArray, uint64(len(t.DescriptionFacets))); err != nil {
3586
+
return err
3587
+
}
3588
+
for _, v := range t.DescriptionFacets {
3589
+
if err := v.MarshalCBOR(cw); err != nil {
3590
+
return err
3591
+
}
3592
+
}
3593
+
}
3594
+
return nil
3595
+
}
3596
+
3597
+
func (t *GraphList) UnmarshalCBOR(r io.Reader) (err error) {
3598
+
*t = GraphList{}
3599
+
3600
+
cr := cbg.NewCborReader(r)
3601
+
3602
+
maj, extra, err := cr.ReadHeader()
3603
+
if err != nil {
3604
+
return err
3605
+
}
3606
+
defer func() {
3607
+
if err == io.EOF {
3608
+
err = io.ErrUnexpectedEOF
3609
+
}
3610
+
}()
3611
+
3612
+
if maj != cbg.MajMap {
3613
+
return fmt.Errorf("cbor input should be of type map")
3614
+
}
3615
+
3616
+
if extra > cbg.MaxLength {
3617
+
return fmt.Errorf("GraphList: map struct too large (%d)", extra)
3618
+
}
3619
+
3620
+
var name string
3621
+
n := extra
3622
+
3623
+
for i := uint64(0); i < n; i++ {
3624
+
3625
+
{
3626
+
sval, err := cbg.ReadString(cr)
3627
+
if err != nil {
3628
+
return err
3629
+
}
3630
+
3631
+
name = string(sval)
3632
+
}
3633
+
3634
+
switch name {
3635
+
// t.Name (string) (string)
3636
+
case "name":
3637
+
3638
+
{
3639
+
sval, err := cbg.ReadString(cr)
3640
+
if err != nil {
3641
+
return err
3642
+
}
3643
+
3644
+
t.Name = string(sval)
3645
+
}
3646
+
// t.LexiconTypeID (string) (string)
3647
+
case "$type":
3648
+
3649
+
{
3650
+
sval, err := cbg.ReadString(cr)
3651
+
if err != nil {
3652
+
return err
3653
+
}
3654
+
3655
+
t.LexiconTypeID = string(sval)
3656
+
}
3657
+
// t.Avatar (util.LexBlob) (struct)
3658
+
case "avatar":
3659
+
3660
+
{
3661
+
3662
+
b, err := cr.ReadByte()
3663
+
if err != nil {
3664
+
return err
3665
+
}
3666
+
if b != cbg.CborNull[0] {
3667
+
if err := cr.UnreadByte(); err != nil {
3668
+
return err
3669
+
}
3670
+
t.Avatar = new(util.LexBlob)
3671
+
if err := t.Avatar.UnmarshalCBOR(cr); err != nil {
3672
+
return xerrors.Errorf("unmarshaling t.Avatar pointer: %w", err)
3673
+
}
3674
+
}
3675
+
3676
+
}
3677
+
// t.Purpose (string) (string)
3678
+
case "purpose":
3679
+
3680
+
{
3681
+
b, err := cr.ReadByte()
3682
+
if err != nil {
3683
+
return err
3684
+
}
3685
+
if b != cbg.CborNull[0] {
3686
+
if err := cr.UnreadByte(); err != nil {
3687
+
return err
3688
+
}
3689
+
3690
+
sval, err := cbg.ReadString(cr)
3691
+
if err != nil {
3692
+
return err
3693
+
}
3694
+
3695
+
t.Purpose = (*string)(&sval)
3696
+
}
3697
+
}
3698
+
// t.CreatedAt (string) (string)
3699
+
case "createdAt":
3700
+
3701
+
{
3702
+
sval, err := cbg.ReadString(cr)
3703
+
if err != nil {
3704
+
return err
3705
+
}
3706
+
3707
+
t.CreatedAt = string(sval)
3708
+
}
3709
+
// t.Description (string) (string)
3710
+
case "description":
3711
+
3712
+
{
3713
+
b, err := cr.ReadByte()
3714
+
if err != nil {
3715
+
return err
3716
+
}
3717
+
if b != cbg.CborNull[0] {
3718
+
if err := cr.UnreadByte(); err != nil {
3719
+
return err
3720
+
}
3721
+
3722
+
sval, err := cbg.ReadString(cr)
3723
+
if err != nil {
3724
+
return err
3725
+
}
3726
+
3727
+
t.Description = (*string)(&sval)
3728
+
}
3729
+
}
3730
+
// t.DescriptionFacets ([]*bsky.RichtextFacet) (slice)
3731
+
case "descriptionFacets":
3732
+
3733
+
maj, extra, err = cr.ReadHeader()
3734
+
if err != nil {
3735
+
return err
3736
+
}
3737
+
3738
+
if extra > cbg.MaxLength {
3739
+
return fmt.Errorf("t.DescriptionFacets: array too large (%d)", extra)
3740
+
}
3741
+
3742
+
if maj != cbg.MajArray {
3743
+
return fmt.Errorf("expected cbor array")
3744
+
}
3745
+
3746
+
if extra > 0 {
3747
+
t.DescriptionFacets = make([]*RichtextFacet, extra)
3748
+
}
3749
+
3750
+
for i := 0; i < int(extra); i++ {
3751
+
3752
+
var v RichtextFacet
3753
+
if err := v.UnmarshalCBOR(cr); err != nil {
3754
+
return err
3755
+
}
3756
+
3757
+
t.DescriptionFacets[i] = &v
3758
+
}
3759
+
3760
+
default:
3761
+
// Field doesn't exist on this type, so ignore it
3762
+
cbg.ScanForLinks(r, func(cid.Cid) {})
3763
+
}
3764
+
}
3765
+
3766
+
return nil
3767
+
}
3768
+
func (t *GraphListitem) MarshalCBOR(w io.Writer) error {
3769
+
if t == nil {
3770
+
_, err := w.Write(cbg.CborNull)
3771
+
return err
3772
+
}
3773
+
3774
+
cw := cbg.NewCborWriter(w)
3775
+
3776
+
if _, err := cw.Write([]byte{164}); err != nil {
3777
+
return err
3778
+
}
3779
+
3780
+
// t.List (string) (string)
3781
+
if len("list") > cbg.MaxLength {
3782
+
return xerrors.Errorf("Value in field \"list\" was too long")
3783
+
}
3784
+
3785
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("list"))); err != nil {
3786
+
return err
3787
+
}
3788
+
if _, err := io.WriteString(w, string("list")); err != nil {
3789
+
return err
3790
+
}
3791
+
3792
+
if len(t.List) > cbg.MaxLength {
3793
+
return xerrors.Errorf("Value in field t.List was too long")
3794
+
}
3795
+
3796
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.List))); err != nil {
3797
+
return err
3798
+
}
3799
+
if _, err := io.WriteString(w, string(t.List)); err != nil {
3800
+
return err
3801
+
}
3802
+
3803
+
// t.LexiconTypeID (string) (string)
3804
+
if len("$type") > cbg.MaxLength {
3805
+
return xerrors.Errorf("Value in field \"$type\" was too long")
3806
+
}
3807
+
3808
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("$type"))); err != nil {
3809
+
return err
3810
+
}
3811
+
if _, err := io.WriteString(w, string("$type")); err != nil {
3812
+
return err
3813
+
}
3814
+
3815
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("app.bsky.graph.listitem"))); err != nil {
3816
+
return err
3817
+
}
3818
+
if _, err := io.WriteString(w, string("app.bsky.graph.listitem")); err != nil {
3819
+
return err
3820
+
}
3821
+
3822
+
// t.Subject (string) (string)
3823
+
if len("subject") > cbg.MaxLength {
3824
+
return xerrors.Errorf("Value in field \"subject\" was too long")
3825
+
}
3826
+
3827
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("subject"))); err != nil {
3828
+
return err
3829
+
}
3830
+
if _, err := io.WriteString(w, string("subject")); err != nil {
3831
+
return err
3832
+
}
3833
+
3834
+
if len(t.Subject) > cbg.MaxLength {
3835
+
return xerrors.Errorf("Value in field t.Subject was too long")
3836
+
}
3837
+
3838
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Subject))); err != nil {
3839
+
return err
3840
+
}
3841
+
if _, err := io.WriteString(w, string(t.Subject)); err != nil {
3842
+
return err
3843
+
}
3844
+
3845
+
// t.CreatedAt (string) (string)
3846
+
if len("createdAt") > cbg.MaxLength {
3847
+
return xerrors.Errorf("Value in field \"createdAt\" was too long")
3848
+
}
3849
+
3850
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("createdAt"))); err != nil {
3851
+
return err
3852
+
}
3853
+
if _, err := io.WriteString(w, string("createdAt")); err != nil {
3854
+
return err
3855
+
}
3856
+
3857
+
if len(t.CreatedAt) > cbg.MaxLength {
3858
+
return xerrors.Errorf("Value in field t.CreatedAt was too long")
3859
+
}
3860
+
3861
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.CreatedAt))); err != nil {
3862
+
return err
3863
+
}
3864
+
if _, err := io.WriteString(w, string(t.CreatedAt)); err != nil {
3865
+
return err
3866
+
}
3867
+
return nil
3868
+
}
3869
+
3870
+
func (t *GraphListitem) UnmarshalCBOR(r io.Reader) (err error) {
3871
+
*t = GraphListitem{}
3872
+
3873
+
cr := cbg.NewCborReader(r)
3874
+
3875
+
maj, extra, err := cr.ReadHeader()
3876
+
if err != nil {
3877
+
return err
3878
+
}
3879
+
defer func() {
3880
+
if err == io.EOF {
3881
+
err = io.ErrUnexpectedEOF
3882
+
}
3883
+
}()
3884
+
3885
+
if maj != cbg.MajMap {
3886
+
return fmt.Errorf("cbor input should be of type map")
3887
+
}
3888
+
3889
+
if extra > cbg.MaxLength {
3890
+
return fmt.Errorf("GraphListitem: map struct too large (%d)", extra)
3891
+
}
3892
+
3893
+
var name string
3894
+
n := extra
3895
+
3896
+
for i := uint64(0); i < n; i++ {
3897
+
3898
+
{
3899
+
sval, err := cbg.ReadString(cr)
3900
+
if err != nil {
3901
+
return err
3902
+
}
3903
+
3904
+
name = string(sval)
3905
+
}
3906
+
3907
+
switch name {
3908
+
// t.List (string) (string)
3909
+
case "list":
3910
+
3911
+
{
3912
+
sval, err := cbg.ReadString(cr)
3913
+
if err != nil {
3914
+
return err
3915
+
}
3916
+
3917
+
t.List = string(sval)
3918
+
}
3919
+
// t.LexiconTypeID (string) (string)
3920
+
case "$type":
3921
+
3922
+
{
3923
+
sval, err := cbg.ReadString(cr)
3924
+
if err != nil {
3925
+
return err
3926
+
}
3927
+
3928
+
t.LexiconTypeID = string(sval)
3929
+
}
3930
+
// t.Subject (string) (string)
3931
+
case "subject":
3932
+
3933
+
{
3934
+
sval, err := cbg.ReadString(cr)
3935
+
if err != nil {
3936
+
return err
3937
+
}
3938
+
3939
+
t.Subject = string(sval)
3940
+
}
3941
+
// t.CreatedAt (string) (string)
3942
+
case "createdAt":
3943
+
3944
+
{
3945
+
sval, err := cbg.ReadString(cr)
3946
+
if err != nil {
3947
+
return err
3948
+
}
3949
+
3950
+
t.CreatedAt = string(sval)
3951
+
}
3952
+
3953
+
default:
3954
+
// Field doesn't exist on this type, so ignore it
3955
+
cbg.ScanForLinks(r, func(cid.Cid) {})
3956
+
}
3957
+
}
3958
+
3959
+
return nil
3960
+
}
+16
api/bsky/embedrecord.go
+16
api/bsky/embedrecord.go
···
29
29
Record *EmbedRecord_View_Record `json:"record" cborgen:"record"`
30
30
}
31
31
32
+
// EmbedRecord_ViewBlocked is a "viewBlocked" in the app.bsky.embed.record schema.
33
+
//
34
+
// RECORDTYPE: EmbedRecord_ViewBlocked
35
+
type EmbedRecord_ViewBlocked struct {
36
+
LexiconTypeID string `json:"$type,const=app.bsky.embed.record" cborgen:"$type,const=app.bsky.embed.record"`
37
+
Uri string `json:"uri" cborgen:"uri"`
38
+
}
39
+
32
40
// EmbedRecord_ViewNotFound is a "viewNotFound" in the app.bsky.embed.record schema.
33
41
//
34
42
// RECORDTYPE: EmbedRecord_ViewNotFound
···
105
113
type EmbedRecord_View_Record struct {
106
114
EmbedRecord_ViewRecord *EmbedRecord_ViewRecord
107
115
EmbedRecord_ViewNotFound *EmbedRecord_ViewNotFound
116
+
EmbedRecord_ViewBlocked *EmbedRecord_ViewBlocked
108
117
}
109
118
110
119
func (t *EmbedRecord_View_Record) MarshalJSON() ([]byte, error) {
···
116
125
t.EmbedRecord_ViewNotFound.LexiconTypeID = "app.bsky.embed.record#viewNotFound"
117
126
return json.Marshal(t.EmbedRecord_ViewNotFound)
118
127
}
128
+
if t.EmbedRecord_ViewBlocked != nil {
129
+
t.EmbedRecord_ViewBlocked.LexiconTypeID = "app.bsky.embed.record#viewBlocked"
130
+
return json.Marshal(t.EmbedRecord_ViewBlocked)
131
+
}
119
132
return nil, fmt.Errorf("cannot marshal empty enum")
120
133
}
121
134
func (t *EmbedRecord_View_Record) UnmarshalJSON(b []byte) error {
···
131
144
case "app.bsky.embed.record#viewNotFound":
132
145
t.EmbedRecord_ViewNotFound = new(EmbedRecord_ViewNotFound)
133
146
return json.Unmarshal(b, t.EmbedRecord_ViewNotFound)
147
+
case "app.bsky.embed.record#viewBlocked":
148
+
t.EmbedRecord_ViewBlocked = new(EmbedRecord_ViewBlocked)
149
+
return json.Unmarshal(b, t.EmbedRecord_ViewBlocked)
134
150
135
151
default:
136
152
return nil
+25
api/bsky/feeddefs.go
+25
api/bsky/feeddefs.go
···
12
12
"github.com/bluesky-social/indigo/lex/util"
13
13
)
14
14
15
+
// FeedDefs_BlockedPost is a "blockedPost" in the app.bsky.feed.defs schema.
16
+
//
17
+
// RECORDTYPE: FeedDefs_BlockedPost
18
+
type FeedDefs_BlockedPost struct {
19
+
LexiconTypeID string `json:"$type,const=app.bsky.feed.defs" cborgen:"$type,const=app.bsky.feed.defs"`
20
+
Blocked bool `json:"blocked" cborgen:"blocked"`
21
+
Uri string `json:"uri" cborgen:"uri"`
22
+
}
23
+
15
24
// FeedDefs_FeedViewPost is a "feedViewPost" in the app.bsky.feed.defs schema.
16
25
type FeedDefs_FeedViewPost struct {
17
26
Post *FeedDefs_PostView `json:"post" cborgen:"post"`
···
149
158
type FeedDefs_ThreadViewPost_Parent struct {
150
159
FeedDefs_ThreadViewPost *FeedDefs_ThreadViewPost
151
160
FeedDefs_NotFoundPost *FeedDefs_NotFoundPost
161
+
FeedDefs_BlockedPost *FeedDefs_BlockedPost
152
162
}
153
163
154
164
func (t *FeedDefs_ThreadViewPost_Parent) MarshalJSON() ([]byte, error) {
···
160
170
t.FeedDefs_NotFoundPost.LexiconTypeID = "app.bsky.feed.defs#notFoundPost"
161
171
return json.Marshal(t.FeedDefs_NotFoundPost)
162
172
}
173
+
if t.FeedDefs_BlockedPost != nil {
174
+
t.FeedDefs_BlockedPost.LexiconTypeID = "app.bsky.feed.defs#blockedPost"
175
+
return json.Marshal(t.FeedDefs_BlockedPost)
176
+
}
163
177
return nil, fmt.Errorf("cannot marshal empty enum")
164
178
}
165
179
func (t *FeedDefs_ThreadViewPost_Parent) UnmarshalJSON(b []byte) error {
···
175
189
case "app.bsky.feed.defs#notFoundPost":
176
190
t.FeedDefs_NotFoundPost = new(FeedDefs_NotFoundPost)
177
191
return json.Unmarshal(b, t.FeedDefs_NotFoundPost)
192
+
case "app.bsky.feed.defs#blockedPost":
193
+
t.FeedDefs_BlockedPost = new(FeedDefs_BlockedPost)
194
+
return json.Unmarshal(b, t.FeedDefs_BlockedPost)
178
195
179
196
default:
180
197
return nil
···
184
201
type FeedDefs_ThreadViewPost_Replies_Elem struct {
185
202
FeedDefs_ThreadViewPost *FeedDefs_ThreadViewPost
186
203
FeedDefs_NotFoundPost *FeedDefs_NotFoundPost
204
+
FeedDefs_BlockedPost *FeedDefs_BlockedPost
187
205
}
188
206
189
207
func (t *FeedDefs_ThreadViewPost_Replies_Elem) MarshalJSON() ([]byte, error) {
···
195
213
t.FeedDefs_NotFoundPost.LexiconTypeID = "app.bsky.feed.defs#notFoundPost"
196
214
return json.Marshal(t.FeedDefs_NotFoundPost)
197
215
}
216
+
if t.FeedDefs_BlockedPost != nil {
217
+
t.FeedDefs_BlockedPost.LexiconTypeID = "app.bsky.feed.defs#blockedPost"
218
+
return json.Marshal(t.FeedDefs_BlockedPost)
219
+
}
198
220
return nil, fmt.Errorf("cannot marshal empty enum")
199
221
}
200
222
func (t *FeedDefs_ThreadViewPost_Replies_Elem) UnmarshalJSON(b []byte) error {
···
210
232
case "app.bsky.feed.defs#notFoundPost":
211
233
t.FeedDefs_NotFoundPost = new(FeedDefs_NotFoundPost)
212
234
return json.Unmarshal(b, t.FeedDefs_NotFoundPost)
235
+
case "app.bsky.feed.defs#blockedPost":
236
+
t.FeedDefs_BlockedPost = new(FeedDefs_BlockedPost)
237
+
return json.Unmarshal(b, t.FeedDefs_BlockedPost)
213
238
214
239
default:
215
240
return nil
+8
api/bsky/feedgetPostThread.go
+8
api/bsky/feedgetPostThread.go
···
21
21
type FeedGetPostThread_Output_Thread struct {
22
22
FeedDefs_ThreadViewPost *FeedDefs_ThreadViewPost
23
23
FeedDefs_NotFoundPost *FeedDefs_NotFoundPost
24
+
FeedDefs_BlockedPost *FeedDefs_BlockedPost
24
25
}
25
26
26
27
func (t *FeedGetPostThread_Output_Thread) MarshalJSON() ([]byte, error) {
···
32
33
t.FeedDefs_NotFoundPost.LexiconTypeID = "app.bsky.feed.defs#notFoundPost"
33
34
return json.Marshal(t.FeedDefs_NotFoundPost)
34
35
}
36
+
if t.FeedDefs_BlockedPost != nil {
37
+
t.FeedDefs_BlockedPost.LexiconTypeID = "app.bsky.feed.defs#blockedPost"
38
+
return json.Marshal(t.FeedDefs_BlockedPost)
39
+
}
35
40
return nil, fmt.Errorf("cannot marshal empty enum")
36
41
}
37
42
func (t *FeedGetPostThread_Output_Thread) UnmarshalJSON(b []byte) error {
···
47
52
case "app.bsky.feed.defs#notFoundPost":
48
53
t.FeedDefs_NotFoundPost = new(FeedDefs_NotFoundPost)
49
54
return json.Unmarshal(b, t.FeedDefs_NotFoundPost)
55
+
case "app.bsky.feed.defs#blockedPost":
56
+
t.FeedDefs_BlockedPost = new(FeedDefs_BlockedPost)
57
+
return json.Unmarshal(b, t.FeedDefs_BlockedPost)
50
58
51
59
default:
52
60
return nil
+19
api/bsky/graphblock.go
+19
api/bsky/graphblock.go
···
1
+
// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
2
+
3
+
package bsky
4
+
5
+
// schema: app.bsky.graph.block
6
+
7
+
import (
8
+
"github.com/bluesky-social/indigo/lex/util"
9
+
)
10
+
11
+
func init() {
12
+
util.RegisterType("app.bsky.graph.block", &GraphBlock{})
13
+
} //
14
+
// RECORDTYPE: GraphBlock
15
+
type GraphBlock struct {
16
+
LexiconTypeID string `json:"$type,const=app.bsky.graph.block" cborgen:"$type,const=app.bsky.graph.block"`
17
+
CreatedAt string `json:"createdAt" cborgen:"createdAt"`
18
+
Subject string `json:"subject" cborgen:"subject"`
19
+
}
+38
api/bsky/graphdefs.go
+38
api/bsky/graphdefs.go
···
1
+
// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
2
+
3
+
package bsky
4
+
5
+
// schema: app.bsky.graph.defs
6
+
7
+
// GraphDefs_ListItemView is a "listItemView" in the app.bsky.graph.defs schema.
8
+
type GraphDefs_ListItemView struct {
9
+
Subject *ActorDefs_ProfileView `json:"subject" cborgen:"subject"`
10
+
}
11
+
12
+
// GraphDefs_ListView is a "listView" in the app.bsky.graph.defs schema.
13
+
type GraphDefs_ListView struct {
14
+
Avatar *string `json:"avatar,omitempty" cborgen:"avatar,omitempty"`
15
+
Creator *ActorDefs_ProfileView `json:"creator" cborgen:"creator"`
16
+
Description *string `json:"description,omitempty" cborgen:"description,omitempty"`
17
+
DescriptionFacets []*RichtextFacet `json:"descriptionFacets,omitempty" cborgen:"descriptionFacets,omitempty"`
18
+
IndexedAt string `json:"indexedAt" cborgen:"indexedAt"`
19
+
Name string `json:"name" cborgen:"name"`
20
+
Purpose *string `json:"purpose" cborgen:"purpose"`
21
+
Uri string `json:"uri" cborgen:"uri"`
22
+
Viewer *GraphDefs_ListViewerState `json:"viewer,omitempty" cborgen:"viewer,omitempty"`
23
+
}
24
+
25
+
// GraphDefs_ListViewBasic is a "listViewBasic" in the app.bsky.graph.defs schema.
26
+
type GraphDefs_ListViewBasic struct {
27
+
Avatar *string `json:"avatar,omitempty" cborgen:"avatar,omitempty"`
28
+
IndexedAt *string `json:"indexedAt,omitempty" cborgen:"indexedAt,omitempty"`
29
+
Name string `json:"name" cborgen:"name"`
30
+
Purpose *string `json:"purpose" cborgen:"purpose"`
31
+
Uri string `json:"uri" cborgen:"uri"`
32
+
Viewer *GraphDefs_ListViewerState `json:"viewer,omitempty" cborgen:"viewer,omitempty"`
33
+
}
34
+
35
+
// GraphDefs_ListViewerState is a "listViewerState" in the app.bsky.graph.defs schema.
36
+
type GraphDefs_ListViewerState struct {
37
+
Muted *bool `json:"muted,omitempty" cborgen:"muted,omitempty"`
38
+
}
+32
api/bsky/graphgetBlocks.go
+32
api/bsky/graphgetBlocks.go
···
1
+
// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
2
+
3
+
package bsky
4
+
5
+
// schema: app.bsky.graph.getBlocks
6
+
7
+
import (
8
+
"context"
9
+
10
+
"github.com/bluesky-social/indigo/xrpc"
11
+
)
12
+
13
+
// GraphGetBlocks_Output is the output of a app.bsky.graph.getBlocks call.
14
+
type GraphGetBlocks_Output struct {
15
+
Blocks []*ActorDefs_ProfileView `json:"blocks" cborgen:"blocks"`
16
+
Cursor *string `json:"cursor,omitempty" cborgen:"cursor,omitempty"`
17
+
}
18
+
19
+
// GraphGetBlocks calls the XRPC method "app.bsky.graph.getBlocks".
20
+
func GraphGetBlocks(ctx context.Context, c *xrpc.Client, cursor string, limit int64) (*GraphGetBlocks_Output, error) {
21
+
var out GraphGetBlocks_Output
22
+
23
+
params := map[string]interface{}{
24
+
"cursor": cursor,
25
+
"limit": limit,
26
+
}
27
+
if err := c.Do(ctx, xrpc.Query, "", "app.bsky.graph.getBlocks", params, nil, &out); err != nil {
28
+
return nil, err
29
+
}
30
+
31
+
return &out, nil
32
+
}
+34
api/bsky/graphgetList.go
+34
api/bsky/graphgetList.go
···
1
+
// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
2
+
3
+
package bsky
4
+
5
+
// schema: app.bsky.graph.getList
6
+
7
+
import (
8
+
"context"
9
+
10
+
"github.com/bluesky-social/indigo/xrpc"
11
+
)
12
+
13
+
// GraphGetList_Output is the output of a app.bsky.graph.getList call.
14
+
type GraphGetList_Output struct {
15
+
Cursor *string `json:"cursor,omitempty" cborgen:"cursor,omitempty"`
16
+
Items []*GraphDefs_ListItemView `json:"items" cborgen:"items"`
17
+
List *GraphDefs_ListView `json:"list" cborgen:"list"`
18
+
}
19
+
20
+
// GraphGetList calls the XRPC method "app.bsky.graph.getList".
21
+
func GraphGetList(ctx context.Context, c *xrpc.Client, cursor string, limit int64, list string) (*GraphGetList_Output, error) {
22
+
var out GraphGetList_Output
23
+
24
+
params := map[string]interface{}{
25
+
"cursor": cursor,
26
+
"limit": limit,
27
+
"list": list,
28
+
}
29
+
if err := c.Do(ctx, xrpc.Query, "", "app.bsky.graph.getList", params, nil, &out); err != nil {
30
+
return nil, err
31
+
}
32
+
33
+
return &out, nil
34
+
}
+32
api/bsky/graphgetListMutes.go
+32
api/bsky/graphgetListMutes.go
···
1
+
// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
2
+
3
+
package bsky
4
+
5
+
// schema: app.bsky.graph.getListMutes
6
+
7
+
import (
8
+
"context"
9
+
10
+
"github.com/bluesky-social/indigo/xrpc"
11
+
)
12
+
13
+
// GraphGetListMutes_Output is the output of a app.bsky.graph.getListMutes call.
14
+
type GraphGetListMutes_Output struct {
15
+
Cursor *string `json:"cursor,omitempty" cborgen:"cursor,omitempty"`
16
+
Lists []*GraphDefs_ListView `json:"lists" cborgen:"lists"`
17
+
}
18
+
19
+
// GraphGetListMutes calls the XRPC method "app.bsky.graph.getListMutes".
20
+
func GraphGetListMutes(ctx context.Context, c *xrpc.Client, cursor string, limit int64) (*GraphGetListMutes_Output, error) {
21
+
var out GraphGetListMutes_Output
22
+
23
+
params := map[string]interface{}{
24
+
"cursor": cursor,
25
+
"limit": limit,
26
+
}
27
+
if err := c.Do(ctx, xrpc.Query, "", "app.bsky.graph.getListMutes", params, nil, &out); err != nil {
28
+
return nil, err
29
+
}
30
+
31
+
return &out, nil
32
+
}
+33
api/bsky/graphgetLists.go
+33
api/bsky/graphgetLists.go
···
1
+
// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
2
+
3
+
package bsky
4
+
5
+
// schema: app.bsky.graph.getLists
6
+
7
+
import (
8
+
"context"
9
+
10
+
"github.com/bluesky-social/indigo/xrpc"
11
+
)
12
+
13
+
// GraphGetLists_Output is the output of a app.bsky.graph.getLists call.
14
+
type GraphGetLists_Output struct {
15
+
Cursor *string `json:"cursor,omitempty" cborgen:"cursor,omitempty"`
16
+
Lists []*GraphDefs_ListView `json:"lists" cborgen:"lists"`
17
+
}
18
+
19
+
// GraphGetLists calls the XRPC method "app.bsky.graph.getLists".
20
+
func GraphGetLists(ctx context.Context, c *xrpc.Client, actor string, cursor string, limit int64) (*GraphGetLists_Output, error) {
21
+
var out GraphGetLists_Output
22
+
23
+
params := map[string]interface{}{
24
+
"actor": actor,
25
+
"cursor": cursor,
26
+
"limit": limit,
27
+
}
28
+
if err := c.Do(ctx, xrpc.Query, "", "app.bsky.graph.getLists", params, nil, &out); err != nil {
29
+
return nil, err
30
+
}
31
+
32
+
return &out, nil
33
+
}
+23
api/bsky/graphlist.go
+23
api/bsky/graphlist.go
···
1
+
// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
2
+
3
+
package bsky
4
+
5
+
// schema: app.bsky.graph.list
6
+
7
+
import (
8
+
"github.com/bluesky-social/indigo/lex/util"
9
+
)
10
+
11
+
func init() {
12
+
util.RegisterType("app.bsky.graph.list", &GraphList{})
13
+
} //
14
+
// RECORDTYPE: GraphList
15
+
type GraphList struct {
16
+
LexiconTypeID string `json:"$type,const=app.bsky.graph.list" cborgen:"$type,const=app.bsky.graph.list"`
17
+
Avatar *util.LexBlob `json:"avatar,omitempty" cborgen:"avatar,omitempty"`
18
+
CreatedAt string `json:"createdAt" cborgen:"createdAt"`
19
+
Description *string `json:"description,omitempty" cborgen:"description,omitempty"`
20
+
DescriptionFacets []*RichtextFacet `json:"descriptionFacets,omitempty" cborgen:"descriptionFacets,omitempty"`
21
+
Name string `json:"name" cborgen:"name"`
22
+
Purpose *string `json:"purpose" cborgen:"purpose"`
23
+
}
+20
api/bsky/graphlistitem.go
+20
api/bsky/graphlistitem.go
···
1
+
// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
2
+
3
+
package bsky
4
+
5
+
// schema: app.bsky.graph.listitem
6
+
7
+
import (
8
+
"github.com/bluesky-social/indigo/lex/util"
9
+
)
10
+
11
+
func init() {
12
+
util.RegisterType("app.bsky.graph.listitem", &GraphListitem{})
13
+
} //
14
+
// RECORDTYPE: GraphListitem
15
+
type GraphListitem struct {
16
+
LexiconTypeID string `json:"$type,const=app.bsky.graph.listitem" cborgen:"$type,const=app.bsky.graph.listitem"`
17
+
CreatedAt string `json:"createdAt" cborgen:"createdAt"`
18
+
List string `json:"list" cborgen:"list"`
19
+
Subject string `json:"subject" cborgen:"subject"`
20
+
}
+25
api/bsky/graphmuteActorList.go
+25
api/bsky/graphmuteActorList.go
···
1
+
// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
2
+
3
+
package bsky
4
+
5
+
// schema: app.bsky.graph.muteActorList
6
+
7
+
import (
8
+
"context"
9
+
10
+
"github.com/bluesky-social/indigo/xrpc"
11
+
)
12
+
13
+
// GraphMuteActorList_Input is the input argument to a app.bsky.graph.muteActorList call.
14
+
type GraphMuteActorList_Input struct {
15
+
List string `json:"list" cborgen:"list"`
16
+
}
17
+
18
+
// GraphMuteActorList calls the XRPC method "app.bsky.graph.muteActorList".
19
+
func GraphMuteActorList(ctx context.Context, c *xrpc.Client, input *GraphMuteActorList_Input) error {
20
+
if err := c.Do(ctx, xrpc.Procedure, "application/json", "app.bsky.graph.muteActorList", nil, input, nil); err != nil {
21
+
return err
22
+
}
23
+
24
+
return nil
25
+
}
+25
api/bsky/graphunmuteActorList.go
+25
api/bsky/graphunmuteActorList.go
···
1
+
// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
2
+
3
+
package bsky
4
+
5
+
// schema: app.bsky.graph.unmuteActorList
6
+
7
+
import (
8
+
"context"
9
+
10
+
"github.com/bluesky-social/indigo/xrpc"
11
+
)
12
+
13
+
// GraphUnmuteActorList_Input is the input argument to a app.bsky.graph.unmuteActorList call.
14
+
type GraphUnmuteActorList_Input struct {
15
+
List string `json:"list" cborgen:"list"`
16
+
}
17
+
18
+
// GraphUnmuteActorList calls the XRPC method "app.bsky.graph.unmuteActorList".
19
+
func GraphUnmuteActorList(ctx context.Context, c *xrpc.Client, input *GraphUnmuteActorList_Input) error {
20
+
if err := c.Do(ctx, xrpc.Procedure, "application/json", "app.bsky.graph.unmuteActorList", nil, input, nil); err != nil {
21
+
return err
22
+
}
23
+
24
+
return nil
25
+
}
+4
-3
api/bsky/unspeccedgetPopular.go
+4
-3
api/bsky/unspeccedgetPopular.go
···
17
17
}
18
18
19
19
// UnspeccedGetPopular calls the XRPC method "app.bsky.unspecced.getPopular".
20
-
func UnspeccedGetPopular(ctx context.Context, c *xrpc.Client, cursor string, limit int64) (*UnspeccedGetPopular_Output, error) {
20
+
func UnspeccedGetPopular(ctx context.Context, c *xrpc.Client, cursor string, includeNsfw bool, limit int64) (*UnspeccedGetPopular_Output, error) {
21
21
var out UnspeccedGetPopular_Output
22
22
23
23
params := map[string]interface{}{
24
-
"cursor": cursor,
25
-
"limit": limit,
24
+
"cursor": cursor,
25
+
"includeNsfw": includeNsfw,
26
+
"limit": limit,
26
27
}
27
28
if err := c.Do(ctx, xrpc.Query, "", "app.bsky.unspecced.getPopular", params, nil, &out); err != nil {
28
29
return nil, err
+44
-1
cmd/gosky/admin.go
+44
-1
cmd/gosky/admin.go
···
6
6
"fmt"
7
7
"os"
8
8
"sort"
9
+
"strings"
9
10
"sync"
10
11
"time"
11
12
12
13
"github.com/bluesky-social/indigo/api"
14
+
"github.com/bluesky-social/indigo/api/atproto"
13
15
comatproto "github.com/bluesky-social/indigo/api/atproto"
14
16
cliutil "github.com/bluesky-social/indigo/cmd/gosky/util"
15
17
cli "github.com/urfave/cli/v2"
···
21
23
buildInviteTreeCmd,
22
24
checkUserCmd,
23
25
reportsCmd,
26
+
disableInvitesCmd,
24
27
},
25
28
}
26
29
···
102
105
fmt.Println(rep.Email)
103
106
fmt.Println("indexed at: ", rep.IndexedAt)
104
107
fmt.Printf("Invited by: %s\n", invby)
108
+
if rep.InvitesDisabled != nil && *rep.InvitesDisabled {
109
+
fmt.Println("INVITES DISABLED")
110
+
}
105
111
106
112
var invited []*comatproto.AdminDefs_RepoViewDetail
107
113
var lk sync.Mutex
···
370
376
adminKey := cctx.String("admin-password")
371
377
xrpcc.AdminToken = &adminKey
372
378
373
-
resp, err := comatproto.AdminGetModerationReports(ctx, xrpcc, "", 100, true, "")
379
+
resp, err := comatproto.AdminGetModerationReports(ctx, xrpcc, "", "", 100, true, "")
374
380
if err != nil {
375
381
return err
376
382
}
···
402
408
return nil
403
409
},
404
410
}
411
+
412
+
var disableInvitesCmd = &cli.Command{
413
+
Name: "disableInvites",
414
+
Flags: []cli.Flag{
415
+
&cli.StringFlag{
416
+
Name: "admin-password",
417
+
EnvVars: []string{"ATP_AUTH_ADMIN_PASSWORD"},
418
+
Required: true,
419
+
},
420
+
},
421
+
Action: func(cctx *cli.Context) error {
422
+
423
+
xrpcc, err := cliutil.GetXrpcClient(cctx, false)
424
+
if err != nil {
425
+
return err
426
+
}
427
+
428
+
ctx := context.Background()
429
+
430
+
adminKey := cctx.String("admin-password")
431
+
xrpcc.AdminToken = &adminKey
432
+
433
+
handle := cctx.Args().First()
434
+
if !strings.HasPrefix(handle, "did:") {
435
+
resp, err := atproto.IdentityResolveHandle(ctx, xrpcc, handle)
436
+
if err != nil {
437
+
return err
438
+
}
439
+
440
+
handle = resp.Did
441
+
}
442
+
443
+
return comatproto.AdminDisableAccountInvites(ctx, xrpcc, &comatproto.AdminDisableAccountInvites_Input{
444
+
Account: handle,
445
+
})
446
+
},
447
+
}
+3
gen/main.go
+3
gen/main.go
···
41
41
bsky.RichtextFacet_Link{}, bsky.RichtextFacet_Mention{},
42
42
bsky.EmbedRecordWithMedia{},
43
43
bsky.FeedDefs_NotFoundPost{},
44
+
bsky.GraphBlock{},
45
+
bsky.GraphList{},
46
+
bsky.GraphListitem{},
44
47
/*bsky.EmbedImages_View{},
45
48
bsky.EmbedRecord_View{}, bsky.EmbedRecordWithMedia_View{},
46
49
bsky.EmbedExternal_View{}, bsky.EmbedImages_ViewImage{},
+260
-4
pds/stubs.go
+260
-4
pds/stubs.go
···
11
11
)
12
12
13
13
func (s *Server) RegisterHandlersAppBsky(e *echo.Echo) error {
14
+
e.GET("/xrpc/app.bsky.actor.getPreferences", s.HandleAppBskyActorGetPreferences)
14
15
e.GET("/xrpc/app.bsky.actor.getProfile", s.HandleAppBskyActorGetProfile)
15
16
e.GET("/xrpc/app.bsky.actor.getProfiles", s.HandleAppBskyActorGetProfiles)
16
17
e.GET("/xrpc/app.bsky.actor.getSuggestions", s.HandleAppBskyActorGetSuggestions)
18
+
e.POST("/xrpc/app.bsky.actor.putPreferences", s.HandleAppBskyActorPutPreferences)
17
19
e.GET("/xrpc/app.bsky.actor.searchActors", s.HandleAppBskyActorSearchActors)
18
20
e.GET("/xrpc/app.bsky.actor.searchActorsTypeahead", s.HandleAppBskyActorSearchActorsTypeahead)
19
21
e.GET("/xrpc/app.bsky.feed.getAuthorFeed", s.HandleAppBskyFeedGetAuthorFeed)
20
22
e.GET("/xrpc/app.bsky.feed.getLikes", s.HandleAppBskyFeedGetLikes)
21
23
e.GET("/xrpc/app.bsky.feed.getPostThread", s.HandleAppBskyFeedGetPostThread)
24
+
e.GET("/xrpc/app.bsky.feed.getPosts", s.HandleAppBskyFeedGetPosts)
22
25
e.GET("/xrpc/app.bsky.feed.getRepostedBy", s.HandleAppBskyFeedGetRepostedBy)
23
26
e.GET("/xrpc/app.bsky.feed.getTimeline", s.HandleAppBskyFeedGetTimeline)
27
+
e.GET("/xrpc/app.bsky.graph.getBlocks", s.HandleAppBskyGraphGetBlocks)
24
28
e.GET("/xrpc/app.bsky.graph.getFollowers", s.HandleAppBskyGraphGetFollowers)
25
29
e.GET("/xrpc/app.bsky.graph.getFollows", s.HandleAppBskyGraphGetFollows)
30
+
e.GET("/xrpc/app.bsky.graph.getList", s.HandleAppBskyGraphGetList)
31
+
e.GET("/xrpc/app.bsky.graph.getListMutes", s.HandleAppBskyGraphGetListMutes)
32
+
e.GET("/xrpc/app.bsky.graph.getLists", s.HandleAppBskyGraphGetLists)
26
33
e.GET("/xrpc/app.bsky.graph.getMutes", s.HandleAppBskyGraphGetMutes)
27
34
e.POST("/xrpc/app.bsky.graph.muteActor", s.HandleAppBskyGraphMuteActor)
35
+
e.POST("/xrpc/app.bsky.graph.muteActorList", s.HandleAppBskyGraphMuteActorList)
28
36
e.POST("/xrpc/app.bsky.graph.unmuteActor", s.HandleAppBskyGraphUnmuteActor)
37
+
e.POST("/xrpc/app.bsky.graph.unmuteActorList", s.HandleAppBskyGraphUnmuteActorList)
29
38
e.GET("/xrpc/app.bsky.notification.getUnreadCount", s.HandleAppBskyNotificationGetUnreadCount)
30
39
e.GET("/xrpc/app.bsky.notification.listNotifications", s.HandleAppBskyNotificationListNotifications)
31
40
e.POST("/xrpc/app.bsky.notification.updateSeen", s.HandleAppBskyNotificationUpdateSeen)
32
41
e.GET("/xrpc/app.bsky.unspecced.getPopular", s.HandleAppBskyUnspeccedGetPopular)
33
42
return nil
43
+
}
44
+
45
+
func (s *Server) HandleAppBskyActorGetPreferences(c echo.Context) error {
46
+
ctx, span := otel.Tracer("server").Start(c.Request().Context(), "HandleAppBskyActorGetPreferences")
47
+
defer span.End()
48
+
var out *appbskytypes.ActorGetPreferences_Output
49
+
var handleErr error
50
+
// func (s *Server) handleAppBskyActorGetPreferences(ctx context.Context) (*appbskytypes.ActorGetPreferences_Output, error)
51
+
out, handleErr = s.handleAppBskyActorGetPreferences(ctx)
52
+
if handleErr != nil {
53
+
return handleErr
54
+
}
55
+
return c.JSON(200, out)
34
56
}
35
57
36
58
func (s *Server) HandleAppBskyActorGetProfile(c echo.Context) error {
···
87
109
return c.JSON(200, out)
88
110
}
89
111
112
+
func (s *Server) HandleAppBskyActorPutPreferences(c echo.Context) error {
113
+
ctx, span := otel.Tracer("server").Start(c.Request().Context(), "HandleAppBskyActorPutPreferences")
114
+
defer span.End()
115
+
116
+
var body appbskytypes.ActorPutPreferences_Input
117
+
if err := c.Bind(&body); err != nil {
118
+
return err
119
+
}
120
+
var handleErr error
121
+
// func (s *Server) handleAppBskyActorPutPreferences(ctx context.Context,body *appbskytypes.ActorPutPreferences_Input) error
122
+
handleErr = s.handleAppBskyActorPutPreferences(ctx, &body)
123
+
if handleErr != nil {
124
+
return handleErr
125
+
}
126
+
return nil
127
+
}
128
+
90
129
func (s *Server) HandleAppBskyActorSearchActors(c echo.Context) error {
91
130
ctx, span := otel.Tracer("server").Start(c.Request().Context(), "HandleAppBskyActorSearchActors")
92
131
defer span.End()
···
214
253
return c.JSON(200, out)
215
254
}
216
255
256
+
func (s *Server) HandleAppBskyFeedGetPosts(c echo.Context) error {
257
+
ctx, span := otel.Tracer("server").Start(c.Request().Context(), "HandleAppBskyFeedGetPosts")
258
+
defer span.End()
259
+
260
+
uris := c.QueryParams()["uris"]
261
+
var out *appbskytypes.FeedGetPosts_Output
262
+
var handleErr error
263
+
// func (s *Server) handleAppBskyFeedGetPosts(ctx context.Context,uris []string) (*appbskytypes.FeedGetPosts_Output, error)
264
+
out, handleErr = s.handleAppBskyFeedGetPosts(ctx, uris)
265
+
if handleErr != nil {
266
+
return handleErr
267
+
}
268
+
return c.JSON(200, out)
269
+
}
270
+
217
271
func (s *Server) HandleAppBskyFeedGetRepostedBy(c echo.Context) error {
218
272
ctx, span := otel.Tracer("server").Start(c.Request().Context(), "HandleAppBskyFeedGetRepostedBy")
219
273
defer span.End()
···
267
321
return c.JSON(200, out)
268
322
}
269
323
324
+
func (s *Server) HandleAppBskyGraphGetBlocks(c echo.Context) error {
325
+
ctx, span := otel.Tracer("server").Start(c.Request().Context(), "HandleAppBskyGraphGetBlocks")
326
+
defer span.End()
327
+
cursor := c.QueryParam("cursor")
328
+
329
+
var limit int
330
+
if p := c.QueryParam("limit"); p != "" {
331
+
var err error
332
+
limit, err = strconv.Atoi(p)
333
+
if err != nil {
334
+
return err
335
+
}
336
+
} else {
337
+
limit = 50
338
+
}
339
+
var out *appbskytypes.GraphGetBlocks_Output
340
+
var handleErr error
341
+
// func (s *Server) handleAppBskyGraphGetBlocks(ctx context.Context,cursor string,limit int) (*appbskytypes.GraphGetBlocks_Output, error)
342
+
out, handleErr = s.handleAppBskyGraphGetBlocks(ctx, cursor, limit)
343
+
if handleErr != nil {
344
+
return handleErr
345
+
}
346
+
return c.JSON(200, out)
347
+
}
348
+
270
349
func (s *Server) HandleAppBskyGraphGetFollowers(c echo.Context) error {
271
350
ctx, span := otel.Tracer("server").Start(c.Request().Context(), "HandleAppBskyGraphGetFollowers")
272
351
defer span.End()
···
319
398
return c.JSON(200, out)
320
399
}
321
400
401
+
func (s *Server) HandleAppBskyGraphGetList(c echo.Context) error {
402
+
ctx, span := otel.Tracer("server").Start(c.Request().Context(), "HandleAppBskyGraphGetList")
403
+
defer span.End()
404
+
cursor := c.QueryParam("cursor")
405
+
406
+
var limit int
407
+
if p := c.QueryParam("limit"); p != "" {
408
+
var err error
409
+
limit, err = strconv.Atoi(p)
410
+
if err != nil {
411
+
return err
412
+
}
413
+
} else {
414
+
limit = 50
415
+
}
416
+
list := c.QueryParam("list")
417
+
var out *appbskytypes.GraphGetList_Output
418
+
var handleErr error
419
+
// func (s *Server) handleAppBskyGraphGetList(ctx context.Context,cursor string,limit int,list string) (*appbskytypes.GraphGetList_Output, error)
420
+
out, handleErr = s.handleAppBskyGraphGetList(ctx, cursor, limit, list)
421
+
if handleErr != nil {
422
+
return handleErr
423
+
}
424
+
return c.JSON(200, out)
425
+
}
426
+
427
+
func (s *Server) HandleAppBskyGraphGetListMutes(c echo.Context) error {
428
+
ctx, span := otel.Tracer("server").Start(c.Request().Context(), "HandleAppBskyGraphGetListMutes")
429
+
defer span.End()
430
+
cursor := c.QueryParam("cursor")
431
+
432
+
var limit int
433
+
if p := c.QueryParam("limit"); p != "" {
434
+
var err error
435
+
limit, err = strconv.Atoi(p)
436
+
if err != nil {
437
+
return err
438
+
}
439
+
} else {
440
+
limit = 50
441
+
}
442
+
var out *appbskytypes.GraphGetListMutes_Output
443
+
var handleErr error
444
+
// func (s *Server) handleAppBskyGraphGetListMutes(ctx context.Context,cursor string,limit int) (*appbskytypes.GraphGetListMutes_Output, error)
445
+
out, handleErr = s.handleAppBskyGraphGetListMutes(ctx, cursor, limit)
446
+
if handleErr != nil {
447
+
return handleErr
448
+
}
449
+
return c.JSON(200, out)
450
+
}
451
+
452
+
func (s *Server) HandleAppBskyGraphGetLists(c echo.Context) error {
453
+
ctx, span := otel.Tracer("server").Start(c.Request().Context(), "HandleAppBskyGraphGetLists")
454
+
defer span.End()
455
+
actor := c.QueryParam("actor")
456
+
cursor := c.QueryParam("cursor")
457
+
458
+
var limit int
459
+
if p := c.QueryParam("limit"); p != "" {
460
+
var err error
461
+
limit, err = strconv.Atoi(p)
462
+
if err != nil {
463
+
return err
464
+
}
465
+
} else {
466
+
limit = 50
467
+
}
468
+
var out *appbskytypes.GraphGetLists_Output
469
+
var handleErr error
470
+
// func (s *Server) handleAppBskyGraphGetLists(ctx context.Context,actor string,cursor string,limit int) (*appbskytypes.GraphGetLists_Output, error)
471
+
out, handleErr = s.handleAppBskyGraphGetLists(ctx, actor, cursor, limit)
472
+
if handleErr != nil {
473
+
return handleErr
474
+
}
475
+
return c.JSON(200, out)
476
+
}
477
+
322
478
func (s *Server) HandleAppBskyGraphGetMutes(c echo.Context) error {
323
479
ctx, span := otel.Tracer("server").Start(c.Request().Context(), "HandleAppBskyGraphGetMutes")
324
480
defer span.End()
···
361
517
return nil
362
518
}
363
519
520
+
func (s *Server) HandleAppBskyGraphMuteActorList(c echo.Context) error {
521
+
ctx, span := otel.Tracer("server").Start(c.Request().Context(), "HandleAppBskyGraphMuteActorList")
522
+
defer span.End()
523
+
524
+
var body appbskytypes.GraphMuteActorList_Input
525
+
if err := c.Bind(&body); err != nil {
526
+
return err
527
+
}
528
+
var handleErr error
529
+
// func (s *Server) handleAppBskyGraphMuteActorList(ctx context.Context,body *appbskytypes.GraphMuteActorList_Input) error
530
+
handleErr = s.handleAppBskyGraphMuteActorList(ctx, &body)
531
+
if handleErr != nil {
532
+
return handleErr
533
+
}
534
+
return nil
535
+
}
536
+
364
537
func (s *Server) HandleAppBskyGraphUnmuteActor(c echo.Context) error {
365
538
ctx, span := otel.Tracer("server").Start(c.Request().Context(), "HandleAppBskyGraphUnmuteActor")
366
539
defer span.End()
···
372
545
var handleErr error
373
546
// func (s *Server) handleAppBskyGraphUnmuteActor(ctx context.Context,body *appbskytypes.GraphUnmuteActor_Input) error
374
547
handleErr = s.handleAppBskyGraphUnmuteActor(ctx, &body)
548
+
if handleErr != nil {
549
+
return handleErr
550
+
}
551
+
return nil
552
+
}
553
+
554
+
func (s *Server) HandleAppBskyGraphUnmuteActorList(c echo.Context) error {
555
+
ctx, span := otel.Tracer("server").Start(c.Request().Context(), "HandleAppBskyGraphUnmuteActorList")
556
+
defer span.End()
557
+
558
+
var body appbskytypes.GraphUnmuteActorList_Input
559
+
if err := c.Bind(&body); err != nil {
560
+
return err
561
+
}
562
+
var handleErr error
563
+
// func (s *Server) handleAppBskyGraphUnmuteActorList(ctx context.Context,body *appbskytypes.GraphUnmuteActorList_Input) error
564
+
handleErr = s.handleAppBskyGraphUnmuteActorList(ctx, &body)
375
565
if handleErr != nil {
376
566
return handleErr
377
567
}
···
440
630
defer span.End()
441
631
cursor := c.QueryParam("cursor")
442
632
633
+
var includeNsfw bool
634
+
if p := c.QueryParam("includeNsfw"); p != "" {
635
+
var err error
636
+
includeNsfw, err = strconv.ParseBool(p)
637
+
if err != nil {
638
+
return err
639
+
}
640
+
} else {
641
+
includeNsfw = false
642
+
}
643
+
443
644
var limit int
444
645
if p := c.QueryParam("limit"); p != "" {
445
646
var err error
···
452
653
}
453
654
var out *appbskytypes.UnspeccedGetPopular_Output
454
655
var handleErr error
455
-
// func (s *Server) handleAppBskyUnspeccedGetPopular(ctx context.Context,cursor string,limit int) (*appbskytypes.UnspeccedGetPopular_Output, error)
456
-
out, handleErr = s.handleAppBskyUnspeccedGetPopular(ctx, cursor, limit)
656
+
// func (s *Server) handleAppBskyUnspeccedGetPopular(ctx context.Context,cursor string,includeNsfw bool,limit int) (*appbskytypes.UnspeccedGetPopular_Output, error)
657
+
out, handleErr = s.handleAppBskyUnspeccedGetPopular(ctx, cursor, includeNsfw, limit)
457
658
if handleErr != nil {
458
659
return handleErr
459
660
}
···
461
662
}
462
663
463
664
func (s *Server) RegisterHandlersComAtproto(e *echo.Echo) error {
665
+
e.POST("/xrpc/com.atproto.admin.disableAccountInvites", s.HandleComAtprotoAdminDisableAccountInvites)
464
666
e.POST("/xrpc/com.atproto.admin.disableInviteCodes", s.HandleComAtprotoAdminDisableInviteCodes)
667
+
e.POST("/xrpc/com.atproto.admin.enableAccountInvites", s.HandleComAtprotoAdminEnableAccountInvites)
465
668
e.GET("/xrpc/com.atproto.admin.getInviteCodes", s.HandleComAtprotoAdminGetInviteCodes)
466
669
e.GET("/xrpc/com.atproto.admin.getModerationAction", s.HandleComAtprotoAdminGetModerationAction)
467
670
e.GET("/xrpc/com.atproto.admin.getModerationActions", s.HandleComAtprotoAdminGetModerationActions)
···
486
689
e.GET("/xrpc/com.atproto.repo.getRecord", s.HandleComAtprotoRepoGetRecord)
487
690
e.GET("/xrpc/com.atproto.repo.listRecords", s.HandleComAtprotoRepoListRecords)
488
691
e.POST("/xrpc/com.atproto.repo.putRecord", s.HandleComAtprotoRepoPutRecord)
692
+
e.POST("/xrpc/com.atproto.repo.rebaseRepo", s.HandleComAtprotoRepoRebaseRepo)
489
693
e.POST("/xrpc/com.atproto.repo.uploadBlob", s.HandleComAtprotoRepoUploadBlob)
490
694
e.POST("/xrpc/com.atproto.server.createAccount", s.HandleComAtprotoServerCreateAccount)
491
695
e.POST("/xrpc/com.atproto.server.createAppPassword", s.HandleComAtprotoServerCreateAppPassword)
···
517
721
return nil
518
722
}
519
723
724
+
func (s *Server) HandleComAtprotoAdminDisableAccountInvites(c echo.Context) error {
725
+
ctx, span := otel.Tracer("server").Start(c.Request().Context(), "HandleComAtprotoAdminDisableAccountInvites")
726
+
defer span.End()
727
+
728
+
var body comatprototypes.AdminDisableAccountInvites_Input
729
+
if err := c.Bind(&body); err != nil {
730
+
return err
731
+
}
732
+
var handleErr error
733
+
// func (s *Server) handleComAtprotoAdminDisableAccountInvites(ctx context.Context,body *comatprototypes.AdminDisableAccountInvites_Input) error
734
+
handleErr = s.handleComAtprotoAdminDisableAccountInvites(ctx, &body)
735
+
if handleErr != nil {
736
+
return handleErr
737
+
}
738
+
return nil
739
+
}
740
+
520
741
func (s *Server) HandleComAtprotoAdminDisableInviteCodes(c echo.Context) error {
521
742
ctx, span := otel.Tracer("server").Start(c.Request().Context(), "HandleComAtprotoAdminDisableInviteCodes")
522
743
defer span.End()
···
528
749
var handleErr error
529
750
// func (s *Server) handleComAtprotoAdminDisableInviteCodes(ctx context.Context,body *comatprototypes.AdminDisableInviteCodes_Input) error
530
751
handleErr = s.handleComAtprotoAdminDisableInviteCodes(ctx, &body)
752
+
if handleErr != nil {
753
+
return handleErr
754
+
}
755
+
return nil
756
+
}
757
+
758
+
func (s *Server) HandleComAtprotoAdminEnableAccountInvites(c echo.Context) error {
759
+
ctx, span := otel.Tracer("server").Start(c.Request().Context(), "HandleComAtprotoAdminEnableAccountInvites")
760
+
defer span.End()
761
+
762
+
var body comatprototypes.AdminEnableAccountInvites_Input
763
+
if err := c.Bind(&body); err != nil {
764
+
return err
765
+
}
766
+
var handleErr error
767
+
// func (s *Server) handleComAtprotoAdminEnableAccountInvites(ctx context.Context,body *comatprototypes.AdminEnableAccountInvites_Input) error
768
+
handleErr = s.handleComAtprotoAdminEnableAccountInvites(ctx, &body)
531
769
if handleErr != nil {
532
770
return handleErr
533
771
}
···
625
863
func (s *Server) HandleComAtprotoAdminGetModerationReports(c echo.Context) error {
626
864
ctx, span := otel.Tracer("server").Start(c.Request().Context(), "HandleComAtprotoAdminGetModerationReports")
627
865
defer span.End()
866
+
actionType := c.QueryParam("actionType")
628
867
cursor := c.QueryParam("cursor")
629
868
630
869
var limit int
···
649
888
subject := c.QueryParam("subject")
650
889
var out *comatprototypes.AdminGetModerationReports_Output
651
890
var handleErr error
652
-
// func (s *Server) handleComAtprotoAdminGetModerationReports(ctx context.Context,cursor string,limit int,resolved *bool,subject string) (*comatprototypes.AdminGetModerationReports_Output, error)
653
-
out, handleErr = s.handleComAtprotoAdminGetModerationReports(ctx, cursor, limit, resolved, subject)
891
+
// func (s *Server) handleComAtprotoAdminGetModerationReports(ctx context.Context,actionType string,cursor string,limit int,resolved *bool,subject string) (*comatprototypes.AdminGetModerationReports_Output, error)
892
+
out, handleErr = s.handleComAtprotoAdminGetModerationReports(ctx, actionType, cursor, limit, resolved, subject)
654
893
if handleErr != nil {
655
894
return handleErr
656
895
}
···
1016
1255
return handleErr
1017
1256
}
1018
1257
return c.JSON(200, out)
1258
+
}
1259
+
1260
+
func (s *Server) HandleComAtprotoRepoRebaseRepo(c echo.Context) error {
1261
+
ctx, span := otel.Tracer("server").Start(c.Request().Context(), "HandleComAtprotoRepoRebaseRepo")
1262
+
defer span.End()
1263
+
1264
+
var body comatprototypes.RepoRebaseRepo_Input
1265
+
if err := c.Bind(&body); err != nil {
1266
+
return err
1267
+
}
1268
+
var handleErr error
1269
+
// func (s *Server) handleComAtprotoRepoRebaseRepo(ctx context.Context,body *comatprototypes.RepoRebaseRepo_Input) error
1270
+
handleErr = s.handleComAtprotoRepoRebaseRepo(ctx, &body)
1271
+
if handleErr != nil {
1272
+
return handleErr
1273
+
}
1274
+
return nil
1019
1275
}
1020
1276
1021
1277
func (s *Server) HandleComAtprotoRepoUploadBlob(c echo.Context) error {