this repo has no description
0
fork

Configure Feed

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

update lexicons to latest

+1074 -92
+25
api/atproto/admindeleteAccount.go
··· 1 + // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. 2 + 3 + package atproto 4 + 5 + // schema: com.atproto.admin.deleteAccount 6 + 7 + import ( 8 + "context" 9 + 10 + "github.com/bluesky-social/indigo/xrpc" 11 + ) 12 + 13 + // AdminDeleteAccount_Input is the input argument to a com.atproto.admin.deleteAccount call. 14 + type AdminDeleteAccount_Input struct { 15 + Did string `json:"did" cborgen:"did"` 16 + } 17 + 18 + // AdminDeleteAccount calls the XRPC method "com.atproto.admin.deleteAccount". 19 + func AdminDeleteAccount(ctx context.Context, c *xrpc.Client, input *AdminDeleteAccount_Input) error { 20 + if err := c.Do(ctx, xrpc.Procedure, "application/json", "com.atproto.admin.deleteAccount", nil, input, nil); err != nil { 21 + return err 22 + } 23 + 24 + return nil 25 + }
+62 -15
api/atproto/cbor_gen.go
··· 525 525 } 526 526 527 527 for i := 0; i < int(extra); i++ { 528 + { 529 + var maj byte 530 + var extra uint64 531 + var err error 532 + _ = maj 533 + _ = extra 534 + _ = err 528 535 529 - var v SyncSubscribeRepos_RepoOp 530 - if err := v.UnmarshalCBOR(cr); err != nil { 531 - return err 532 - } 536 + { 537 + 538 + b, err := cr.ReadByte() 539 + if err != nil { 540 + return err 541 + } 542 + if b != cbg.CborNull[0] { 543 + if err := cr.UnreadByte(); err != nil { 544 + return err 545 + } 546 + t.Ops[i] = new(SyncSubscribeRepos_RepoOp) 547 + if err := t.Ops[i].UnmarshalCBOR(cr); err != nil { 548 + return xerrors.Errorf("unmarshaling t.Ops[i] pointer: %w", err) 549 + } 550 + } 533 551 534 - t.Ops[i] = &v 552 + } 553 + } 535 554 } 536 555 537 556 // t.Rev (string) (string) ··· 634 653 } 635 654 636 655 for i := 0; i < int(extra); i++ { 656 + { 657 + var maj byte 658 + var extra uint64 659 + var err error 660 + _ = maj 661 + _ = extra 662 + _ = err 637 663 638 - var v util.LexLink 639 - if err := v.UnmarshalCBOR(cr); err != nil { 640 - return err 664 + { 665 + 666 + if err := t.Blobs[i].UnmarshalCBOR(cr); err != nil { 667 + return xerrors.Errorf("unmarshaling t.Blobs[i]: %w", err) 668 + } 669 + 670 + } 641 671 } 642 - 643 - t.Blobs[i] = v 644 672 } 645 673 646 674 // t.Since (string) (string) ··· 1802 1830 } 1803 1831 1804 1832 for i := 0; i < int(extra); i++ { 1833 + { 1834 + var maj byte 1835 + var extra uint64 1836 + var err error 1837 + _ = maj 1838 + _ = extra 1839 + _ = err 1805 1840 1806 - var v LabelDefs_SelfLabel 1807 - if err := v.UnmarshalCBOR(cr); err != nil { 1808 - return err 1809 - } 1841 + { 1842 + 1843 + b, err := cr.ReadByte() 1844 + if err != nil { 1845 + return err 1846 + } 1847 + if b != cbg.CborNull[0] { 1848 + if err := cr.UnreadByte(); err != nil { 1849 + return err 1850 + } 1851 + t.Values[i] = new(LabelDefs_SelfLabel) 1852 + if err := t.Values[i].UnmarshalCBOR(cr); err != nil { 1853 + return xerrors.Errorf("unmarshaling t.Values[i] pointer: %w", err) 1854 + } 1855 + } 1810 1856 1811 - t.Values[i] = &v 1857 + } 1858 + } 1812 1859 } 1813 1860 1814 1861 default:
+8 -7
api/atproto/servercreateSession.go
··· 7 7 import ( 8 8 "context" 9 9 10 + "github.com/bluesky-social/indigo/lex/util" 10 11 "github.com/bluesky-social/indigo/xrpc" 11 12 ) 12 13 ··· 19 20 20 21 // ServerCreateSession_Output is the output of a com.atproto.server.createSession call. 21 22 type ServerCreateSession_Output struct { 22 - AccessJwt string `json:"accessJwt" cborgen:"accessJwt"` 23 - Did string `json:"did" cborgen:"did"` 24 - DidDoc *interface{} `json:"didDoc,omitempty" cborgen:"didDoc,omitempty"` 25 - Email *string `json:"email,omitempty" cborgen:"email,omitempty"` 26 - EmailConfirmed *bool `json:"emailConfirmed,omitempty" cborgen:"emailConfirmed,omitempty"` 27 - Handle string `json:"handle" cborgen:"handle"` 28 - RefreshJwt string `json:"refreshJwt" cborgen:"refreshJwt"` 23 + AccessJwt string `json:"accessJwt" cborgen:"accessJwt"` 24 + Did string `json:"did" cborgen:"did"` 25 + DidDoc *util.LexiconTypeDecoder `json:"didDoc,omitempty" cborgen:"didDoc,omitempty"` 26 + Email *string `json:"email,omitempty" cborgen:"email,omitempty"` 27 + EmailConfirmed *bool `json:"emailConfirmed,omitempty" cborgen:"emailConfirmed,omitempty"` 28 + Handle string `json:"handle" cborgen:"handle"` 29 + RefreshJwt string `json:"refreshJwt" cborgen:"refreshJwt"` 29 30 } 30 31 31 32 // ServerCreateSession calls the XRPC method "com.atproto.server.createSession".
+6 -5
api/atproto/serverrefreshSession.go
··· 7 7 import ( 8 8 "context" 9 9 10 + "github.com/bluesky-social/indigo/lex/util" 10 11 "github.com/bluesky-social/indigo/xrpc" 11 12 ) 12 13 13 14 // ServerRefreshSession_Output is the output of a com.atproto.server.refreshSession call. 14 15 type ServerRefreshSession_Output struct { 15 - AccessJwt string `json:"accessJwt" cborgen:"accessJwt"` 16 - Did string `json:"did" cborgen:"did"` 17 - DidDoc *interface{} `json:"didDoc,omitempty" cborgen:"didDoc,omitempty"` 18 - Handle string `json:"handle" cborgen:"handle"` 19 - RefreshJwt string `json:"refreshJwt" cborgen:"refreshJwt"` 16 + AccessJwt string `json:"accessJwt" cborgen:"accessJwt"` 17 + Did string `json:"did" cborgen:"did"` 18 + DidDoc *util.LexiconTypeDecoder `json:"didDoc,omitempty" cborgen:"didDoc,omitempty"` 19 + Handle string `json:"handle" cborgen:"handle"` 20 + RefreshJwt string `json:"refreshJwt" cborgen:"refreshJwt"` 20 21 } 21 22 22 23 // ServerRefreshSession calls the XRPC method "com.atproto.server.refreshSession".
+27
api/atproto/temppushBlob.go
··· 1 + // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. 2 + 3 + package atproto 4 + 5 + // schema: com.atproto.temp.pushBlob 6 + 7 + import ( 8 + "context" 9 + "io" 10 + 11 + "github.com/bluesky-social/indigo/xrpc" 12 + ) 13 + 14 + // TempPushBlob calls the XRPC method "com.atproto.temp.pushBlob". 15 + // 16 + // did: The DID of the repo. 17 + func TempPushBlob(ctx context.Context, c *xrpc.Client, input io.Reader, did string) error { 18 + 19 + params := map[string]interface{}{ 20 + "did": did, 21 + } 22 + if err := c.Do(ctx, xrpc.Procedure, "*/*", "com.atproto.temp.pushBlob", params, input, nil); err != nil { 23 + return err 24 + } 25 + 26 + return nil 27 + }
+37
api/atproto/temptransferAccount.go
··· 1 + // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. 2 + 3 + package atproto 4 + 5 + // schema: com.atproto.temp.transferAccount 6 + 7 + import ( 8 + "context" 9 + 10 + "github.com/bluesky-social/indigo/lex/util" 11 + "github.com/bluesky-social/indigo/xrpc" 12 + ) 13 + 14 + // TempTransferAccount_Input is the input argument to a com.atproto.temp.transferAccount call. 15 + type TempTransferAccount_Input struct { 16 + Did string `json:"did" cborgen:"did"` 17 + Handle string `json:"handle" cborgen:"handle"` 18 + PlcOp *util.LexiconTypeDecoder `json:"plcOp" cborgen:"plcOp"` 19 + } 20 + 21 + // TempTransferAccount_Output is the output of a com.atproto.temp.transferAccount call. 22 + type TempTransferAccount_Output struct { 23 + AccessJwt string `json:"accessJwt" cborgen:"accessJwt"` 24 + Did string `json:"did" cborgen:"did"` 25 + Handle string `json:"handle" cborgen:"handle"` 26 + RefreshJwt string `json:"refreshJwt" cborgen:"refreshJwt"` 27 + } 28 + 29 + // TempTransferAccount calls the XRPC method "com.atproto.temp.transferAccount". 30 + func TempTransferAccount(ctx context.Context, c *xrpc.Client, input *TempTransferAccount_Input) (*TempTransferAccount_Output, error) { 31 + var out TempTransferAccount_Output 32 + if err := c.Do(ctx, xrpc.Procedure, "application/json", "com.atproto.temp.transferAccount", nil, input, &out); err != nil { 33 + return nil, err 34 + } 35 + 36 + return &out, nil 37 + }
+720 -42
api/bsky/cbor_gen.go
··· 370 370 } 371 371 372 372 for i := 0; i < int(extra); i++ { 373 - 374 373 { 375 - sval, err := cbg.ReadString(cr) 376 - if err != nil { 377 - return err 378 - } 374 + var maj byte 375 + var extra uint64 376 + var err error 377 + _ = maj 378 + _ = extra 379 + _ = err 379 380 380 - t.Tags[i] = string(sval) 381 + { 382 + sval, err := cbg.ReadString(cr) 383 + if err != nil { 384 + return err 385 + } 386 + 387 + t.Tags[i] = string(sval) 388 + } 381 389 } 382 390 } 383 391 ··· 444 452 } 445 453 446 454 for i := 0; i < int(extra); i++ { 447 - 448 455 { 449 - sval, err := cbg.ReadString(cr) 450 - if err != nil { 451 - return err 452 - } 456 + var maj byte 457 + var extra uint64 458 + var err error 459 + _ = maj 460 + _ = extra 461 + _ = err 453 462 454 - t.Langs[i] = string(sval) 463 + { 464 + sval, err := cbg.ReadString(cr) 465 + if err != nil { 466 + return err 467 + } 468 + 469 + t.Langs[i] = string(sval) 470 + } 455 471 } 456 472 } 457 473 ··· 496 512 } 497 513 498 514 for i := 0; i < int(extra); i++ { 515 + { 516 + var maj byte 517 + var extra uint64 518 + var err error 519 + _ = maj 520 + _ = extra 521 + _ = err 499 522 500 - var v RichtextFacet 501 - if err := v.UnmarshalCBOR(cr); err != nil { 502 - return err 503 - } 523 + { 524 + 525 + b, err := cr.ReadByte() 526 + if err != nil { 527 + return err 528 + } 529 + if b != cbg.CborNull[0] { 530 + if err := cr.UnreadByte(); err != nil { 531 + return err 532 + } 533 + t.Facets[i] = new(RichtextFacet) 534 + if err := t.Facets[i].UnmarshalCBOR(cr); err != nil { 535 + return xerrors.Errorf("unmarshaling t.Facets[i] pointer: %w", err) 536 + } 537 + } 504 538 505 - t.Facets[i] = &v 539 + } 540 + } 506 541 } 507 542 508 543 // t.Labels (bsky.FeedPost_Labels) (struct) ··· 546 581 } 547 582 548 583 for i := 0; i < int(extra); i++ { 584 + { 585 + var maj byte 586 + var extra uint64 587 + var err error 588 + _ = maj 589 + _ = extra 590 + _ = err 549 591 550 - var v FeedPost_Entity 551 - if err := v.UnmarshalCBOR(cr); err != nil { 552 - return err 592 + { 593 + 594 + b, err := cr.ReadByte() 595 + if err != nil { 596 + return err 597 + } 598 + if b != cbg.CborNull[0] { 599 + if err := cr.UnreadByte(); err != nil { 600 + return err 601 + } 602 + t.Entities[i] = new(FeedPost_Entity) 603 + if err := t.Entities[i].UnmarshalCBOR(cr); err != nil { 604 + return xerrors.Errorf("unmarshaling t.Entities[i] pointer: %w", err) 605 + } 606 + } 607 + 608 + } 553 609 } 554 - 555 - t.Entities[i] = &v 556 610 } 557 611 558 612 // t.CreatedAt (string) (string) ··· 1319 1373 } 1320 1374 1321 1375 for i := 0; i < int(extra); i++ { 1376 + { 1377 + var maj byte 1378 + var extra uint64 1379 + var err error 1380 + _ = maj 1381 + _ = extra 1382 + _ = err 1322 1383 1323 - var v EmbedImages_Image 1324 - if err := v.UnmarshalCBOR(cr); err != nil { 1325 - return err 1326 - } 1384 + { 1385 + 1386 + b, err := cr.ReadByte() 1387 + if err != nil { 1388 + return err 1389 + } 1390 + if b != cbg.CborNull[0] { 1391 + if err := cr.UnreadByte(); err != nil { 1392 + return err 1393 + } 1394 + t.Images[i] = new(EmbedImages_Image) 1395 + if err := t.Images[i].UnmarshalCBOR(cr); err != nil { 1396 + return xerrors.Errorf("unmarshaling t.Images[i] pointer: %w", err) 1397 + } 1398 + } 1327 1399 1328 - t.Images[i] = &v 1400 + } 1401 + } 1329 1402 } 1330 1403 1331 1404 default: ··· 2761 2834 } 2762 2835 2763 2836 for i := 0; i < int(extra); i++ { 2837 + { 2838 + var maj byte 2839 + var extra uint64 2840 + var err error 2841 + _ = maj 2842 + _ = extra 2843 + _ = err 2764 2844 2765 - var v RichtextFacet_Features_Elem 2766 - if err := v.UnmarshalCBOR(cr); err != nil { 2767 - return err 2768 - } 2845 + { 2846 + 2847 + b, err := cr.ReadByte() 2848 + if err != nil { 2849 + return err 2850 + } 2851 + if b != cbg.CborNull[0] { 2852 + if err := cr.UnreadByte(); err != nil { 2853 + return err 2854 + } 2855 + t.Features[i] = new(RichtextFacet_Features_Elem) 2856 + if err := t.Features[i].UnmarshalCBOR(cr); err != nil { 2857 + return xerrors.Errorf("unmarshaling t.Features[i] pointer: %w", err) 2858 + } 2859 + } 2769 2860 2770 - t.Features[i] = &v 2861 + } 2862 + } 2771 2863 } 2772 2864 2773 2865 default: ··· 4188 4280 } 4189 4281 4190 4282 for i := 0; i < int(extra); i++ { 4283 + { 4284 + var maj byte 4285 + var extra uint64 4286 + var err error 4287 + _ = maj 4288 + _ = extra 4289 + _ = err 4191 4290 4192 - var v RichtextFacet 4193 - if err := v.UnmarshalCBOR(cr); err != nil { 4194 - return err 4195 - } 4291 + { 4292 + 4293 + b, err := cr.ReadByte() 4294 + if err != nil { 4295 + return err 4296 + } 4297 + if b != cbg.CborNull[0] { 4298 + if err := cr.UnreadByte(); err != nil { 4299 + return err 4300 + } 4301 + t.DescriptionFacets[i] = new(RichtextFacet) 4302 + if err := t.DescriptionFacets[i].UnmarshalCBOR(cr); err != nil { 4303 + return xerrors.Errorf("unmarshaling t.DescriptionFacets[i] pointer: %w", err) 4304 + } 4305 + } 4196 4306 4197 - t.DescriptionFacets[i] = &v 4307 + } 4308 + } 4198 4309 } 4199 4310 4200 4311 default: ··· 4779 4890 } 4780 4891 4781 4892 for i := 0; i < int(extra); i++ { 4893 + { 4894 + var maj byte 4895 + var extra uint64 4896 + var err error 4897 + _ = maj 4898 + _ = extra 4899 + _ = err 4782 4900 4783 - var v RichtextFacet 4784 - if err := v.UnmarshalCBOR(cr); err != nil { 4785 - return err 4901 + { 4902 + 4903 + b, err := cr.ReadByte() 4904 + if err != nil { 4905 + return err 4906 + } 4907 + if b != cbg.CborNull[0] { 4908 + if err := cr.UnreadByte(); err != nil { 4909 + return err 4910 + } 4911 + t.DescriptionFacets[i] = new(RichtextFacet) 4912 + if err := t.DescriptionFacets[i].UnmarshalCBOR(cr); err != nil { 4913 + return xerrors.Errorf("unmarshaling t.DescriptionFacets[i] pointer: %w", err) 4914 + } 4915 + } 4916 + 4917 + } 4786 4918 } 4787 - 4788 - t.DescriptionFacets[i] = &v 4789 4919 } 4790 4920 4791 4921 default: ··· 5112 5242 5113 5243 return nil 5114 5244 } 5245 + func (t *FeedThreadgate) MarshalCBOR(w io.Writer) error { 5246 + if t == nil { 5247 + _, err := w.Write(cbg.CborNull) 5248 + return err 5249 + } 5250 + 5251 + cw := cbg.NewCborWriter(w) 5252 + fieldCount := 4 5253 + 5254 + if t.Allow == nil { 5255 + fieldCount-- 5256 + } 5257 + 5258 + if _, err := cw.Write(cbg.CborEncodeMajorType(cbg.MajMap, uint64(fieldCount))); err != nil { 5259 + return err 5260 + } 5261 + 5262 + // t.Post (string) (string) 5263 + if len("post") > cbg.MaxLength { 5264 + return xerrors.Errorf("Value in field \"post\" was too long") 5265 + } 5266 + 5267 + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("post"))); err != nil { 5268 + return err 5269 + } 5270 + if _, err := cw.WriteString(string("post")); err != nil { 5271 + return err 5272 + } 5273 + 5274 + if len(t.Post) > cbg.MaxLength { 5275 + return xerrors.Errorf("Value in field t.Post was too long") 5276 + } 5277 + 5278 + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Post))); err != nil { 5279 + return err 5280 + } 5281 + if _, err := cw.WriteString(string(t.Post)); err != nil { 5282 + return err 5283 + } 5284 + 5285 + // t.LexiconTypeID (string) (string) 5286 + if len("$type") > cbg.MaxLength { 5287 + return xerrors.Errorf("Value in field \"$type\" was too long") 5288 + } 5289 + 5290 + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("$type"))); err != nil { 5291 + return err 5292 + } 5293 + if _, err := cw.WriteString(string("$type")); err != nil { 5294 + return err 5295 + } 5296 + 5297 + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("app.bsky.feed.threadgate"))); err != nil { 5298 + return err 5299 + } 5300 + if _, err := cw.WriteString(string("app.bsky.feed.threadgate")); err != nil { 5301 + return err 5302 + } 5303 + 5304 + // t.Allow ([]*bsky.FeedThreadgate_Allow_Elem) (slice) 5305 + if t.Allow != nil { 5306 + 5307 + if len("allow") > cbg.MaxLength { 5308 + return xerrors.Errorf("Value in field \"allow\" was too long") 5309 + } 5310 + 5311 + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("allow"))); err != nil { 5312 + return err 5313 + } 5314 + if _, err := cw.WriteString(string("allow")); err != nil { 5315 + return err 5316 + } 5317 + 5318 + if len(t.Allow) > cbg.MaxLength { 5319 + return xerrors.Errorf("Slice value in field t.Allow was too long") 5320 + } 5321 + 5322 + if err := cw.WriteMajorTypeHeader(cbg.MajArray, uint64(len(t.Allow))); err != nil { 5323 + return err 5324 + } 5325 + for _, v := range t.Allow { 5326 + if err := v.MarshalCBOR(cw); err != nil { 5327 + return err 5328 + } 5329 + } 5330 + } 5331 + 5332 + // t.CreatedAt (string) (string) 5333 + if len("createdAt") > cbg.MaxLength { 5334 + return xerrors.Errorf("Value in field \"createdAt\" was too long") 5335 + } 5336 + 5337 + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("createdAt"))); err != nil { 5338 + return err 5339 + } 5340 + if _, err := cw.WriteString(string("createdAt")); err != nil { 5341 + return err 5342 + } 5343 + 5344 + if len(t.CreatedAt) > cbg.MaxLength { 5345 + return xerrors.Errorf("Value in field t.CreatedAt was too long") 5346 + } 5347 + 5348 + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.CreatedAt))); err != nil { 5349 + return err 5350 + } 5351 + if _, err := cw.WriteString(string(t.CreatedAt)); err != nil { 5352 + return err 5353 + } 5354 + return nil 5355 + } 5356 + 5357 + func (t *FeedThreadgate) UnmarshalCBOR(r io.Reader) (err error) { 5358 + *t = FeedThreadgate{} 5359 + 5360 + cr := cbg.NewCborReader(r) 5361 + 5362 + maj, extra, err := cr.ReadHeader() 5363 + if err != nil { 5364 + return err 5365 + } 5366 + defer func() { 5367 + if err == io.EOF { 5368 + err = io.ErrUnexpectedEOF 5369 + } 5370 + }() 5371 + 5372 + if maj != cbg.MajMap { 5373 + return fmt.Errorf("cbor input should be of type map") 5374 + } 5375 + 5376 + if extra > cbg.MaxLength { 5377 + return fmt.Errorf("FeedThreadgate: map struct too large (%d)", extra) 5378 + } 5379 + 5380 + var name string 5381 + n := extra 5382 + 5383 + for i := uint64(0); i < n; i++ { 5384 + 5385 + { 5386 + sval, err := cbg.ReadString(cr) 5387 + if err != nil { 5388 + return err 5389 + } 5390 + 5391 + name = string(sval) 5392 + } 5393 + 5394 + switch name { 5395 + // t.Post (string) (string) 5396 + case "post": 5397 + 5398 + { 5399 + sval, err := cbg.ReadString(cr) 5400 + if err != nil { 5401 + return err 5402 + } 5403 + 5404 + t.Post = string(sval) 5405 + } 5406 + // t.LexiconTypeID (string) (string) 5407 + case "$type": 5408 + 5409 + { 5410 + sval, err := cbg.ReadString(cr) 5411 + if err != nil { 5412 + return err 5413 + } 5414 + 5415 + t.LexiconTypeID = string(sval) 5416 + } 5417 + // t.Allow ([]*bsky.FeedThreadgate_Allow_Elem) (slice) 5418 + case "allow": 5419 + 5420 + maj, extra, err = cr.ReadHeader() 5421 + if err != nil { 5422 + return err 5423 + } 5424 + 5425 + if extra > cbg.MaxLength { 5426 + return fmt.Errorf("t.Allow: array too large (%d)", extra) 5427 + } 5428 + 5429 + if maj != cbg.MajArray { 5430 + return fmt.Errorf("expected cbor array") 5431 + } 5432 + 5433 + if extra > 0 { 5434 + t.Allow = make([]*FeedThreadgate_Allow_Elem, extra) 5435 + } 5436 + 5437 + for i := 0; i < int(extra); i++ { 5438 + { 5439 + var maj byte 5440 + var extra uint64 5441 + var err error 5442 + _ = maj 5443 + _ = extra 5444 + _ = err 5445 + 5446 + { 5447 + 5448 + b, err := cr.ReadByte() 5449 + if err != nil { 5450 + return err 5451 + } 5452 + if b != cbg.CborNull[0] { 5453 + if err := cr.UnreadByte(); err != nil { 5454 + return err 5455 + } 5456 + t.Allow[i] = new(FeedThreadgate_Allow_Elem) 5457 + if err := t.Allow[i].UnmarshalCBOR(cr); err != nil { 5458 + return xerrors.Errorf("unmarshaling t.Allow[i] pointer: %w", err) 5459 + } 5460 + } 5461 + 5462 + } 5463 + } 5464 + } 5465 + 5466 + // t.CreatedAt (string) (string) 5467 + case "createdAt": 5468 + 5469 + { 5470 + sval, err := cbg.ReadString(cr) 5471 + if err != nil { 5472 + return err 5473 + } 5474 + 5475 + t.CreatedAt = string(sval) 5476 + } 5477 + 5478 + default: 5479 + // Field doesn't exist on this type, so ignore it 5480 + cbg.ScanForLinks(r, func(cid.Cid) {}) 5481 + } 5482 + } 5483 + 5484 + return nil 5485 + } 5486 + func (t *FeedThreadgate_ListRule) MarshalCBOR(w io.Writer) error { 5487 + if t == nil { 5488 + _, err := w.Write(cbg.CborNull) 5489 + return err 5490 + } 5491 + 5492 + cw := cbg.NewCborWriter(w) 5493 + 5494 + if _, err := cw.Write([]byte{162}); err != nil { 5495 + return err 5496 + } 5497 + 5498 + // t.List (string) (string) 5499 + if len("list") > cbg.MaxLength { 5500 + return xerrors.Errorf("Value in field \"list\" was too long") 5501 + } 5502 + 5503 + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("list"))); err != nil { 5504 + return err 5505 + } 5506 + if _, err := cw.WriteString(string("list")); err != nil { 5507 + return err 5508 + } 5509 + 5510 + if len(t.List) > cbg.MaxLength { 5511 + return xerrors.Errorf("Value in field t.List was too long") 5512 + } 5513 + 5514 + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.List))); err != nil { 5515 + return err 5516 + } 5517 + if _, err := cw.WriteString(string(t.List)); err != nil { 5518 + return err 5519 + } 5520 + 5521 + // t.LexiconTypeID (string) (string) 5522 + if len("$type") > cbg.MaxLength { 5523 + return xerrors.Errorf("Value in field \"$type\" was too long") 5524 + } 5525 + 5526 + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("$type"))); err != nil { 5527 + return err 5528 + } 5529 + if _, err := cw.WriteString(string("$type")); err != nil { 5530 + return err 5531 + } 5532 + 5533 + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("app.bsky.feed.threadgate#listRule"))); err != nil { 5534 + return err 5535 + } 5536 + if _, err := cw.WriteString(string("app.bsky.feed.threadgate#listRule")); err != nil { 5537 + return err 5538 + } 5539 + return nil 5540 + } 5541 + 5542 + func (t *FeedThreadgate_ListRule) UnmarshalCBOR(r io.Reader) (err error) { 5543 + *t = FeedThreadgate_ListRule{} 5544 + 5545 + cr := cbg.NewCborReader(r) 5546 + 5547 + maj, extra, err := cr.ReadHeader() 5548 + if err != nil { 5549 + return err 5550 + } 5551 + defer func() { 5552 + if err == io.EOF { 5553 + err = io.ErrUnexpectedEOF 5554 + } 5555 + }() 5556 + 5557 + if maj != cbg.MajMap { 5558 + return fmt.Errorf("cbor input should be of type map") 5559 + } 5560 + 5561 + if extra > cbg.MaxLength { 5562 + return fmt.Errorf("FeedThreadgate_ListRule: map struct too large (%d)", extra) 5563 + } 5564 + 5565 + var name string 5566 + n := extra 5567 + 5568 + for i := uint64(0); i < n; i++ { 5569 + 5570 + { 5571 + sval, err := cbg.ReadString(cr) 5572 + if err != nil { 5573 + return err 5574 + } 5575 + 5576 + name = string(sval) 5577 + } 5578 + 5579 + switch name { 5580 + // t.List (string) (string) 5581 + case "list": 5582 + 5583 + { 5584 + sval, err := cbg.ReadString(cr) 5585 + if err != nil { 5586 + return err 5587 + } 5588 + 5589 + t.List = string(sval) 5590 + } 5591 + // t.LexiconTypeID (string) (string) 5592 + case "$type": 5593 + 5594 + { 5595 + sval, err := cbg.ReadString(cr) 5596 + if err != nil { 5597 + return err 5598 + } 5599 + 5600 + t.LexiconTypeID = string(sval) 5601 + } 5602 + 5603 + default: 5604 + // Field doesn't exist on this type, so ignore it 5605 + cbg.ScanForLinks(r, func(cid.Cid) {}) 5606 + } 5607 + } 5608 + 5609 + return nil 5610 + } 5611 + func (t *FeedThreadgate_MentionRule) MarshalCBOR(w io.Writer) error { 5612 + if t == nil { 5613 + _, err := w.Write(cbg.CborNull) 5614 + return err 5615 + } 5616 + 5617 + cw := cbg.NewCborWriter(w) 5618 + 5619 + if _, err := cw.Write([]byte{161}); err != nil { 5620 + return err 5621 + } 5622 + 5623 + // t.LexiconTypeID (string) (string) 5624 + if len("$type") > cbg.MaxLength { 5625 + return xerrors.Errorf("Value in field \"$type\" was too long") 5626 + } 5627 + 5628 + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("$type"))); err != nil { 5629 + return err 5630 + } 5631 + if _, err := cw.WriteString(string("$type")); err != nil { 5632 + return err 5633 + } 5634 + 5635 + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("app.bsky.feed.threadgate#mentionRule"))); err != nil { 5636 + return err 5637 + } 5638 + if _, err := cw.WriteString(string("app.bsky.feed.threadgate#mentionRule")); err != nil { 5639 + return err 5640 + } 5641 + return nil 5642 + } 5643 + 5644 + func (t *FeedThreadgate_MentionRule) UnmarshalCBOR(r io.Reader) (err error) { 5645 + *t = FeedThreadgate_MentionRule{} 5646 + 5647 + cr := cbg.NewCborReader(r) 5648 + 5649 + maj, extra, err := cr.ReadHeader() 5650 + if err != nil { 5651 + return err 5652 + } 5653 + defer func() { 5654 + if err == io.EOF { 5655 + err = io.ErrUnexpectedEOF 5656 + } 5657 + }() 5658 + 5659 + if maj != cbg.MajMap { 5660 + return fmt.Errorf("cbor input should be of type map") 5661 + } 5662 + 5663 + if extra > cbg.MaxLength { 5664 + return fmt.Errorf("FeedThreadgate_MentionRule: map struct too large (%d)", extra) 5665 + } 5666 + 5667 + var name string 5668 + n := extra 5669 + 5670 + for i := uint64(0); i < n; i++ { 5671 + 5672 + { 5673 + sval, err := cbg.ReadString(cr) 5674 + if err != nil { 5675 + return err 5676 + } 5677 + 5678 + name = string(sval) 5679 + } 5680 + 5681 + switch name { 5682 + // t.LexiconTypeID (string) (string) 5683 + case "$type": 5684 + 5685 + { 5686 + sval, err := cbg.ReadString(cr) 5687 + if err != nil { 5688 + return err 5689 + } 5690 + 5691 + t.LexiconTypeID = string(sval) 5692 + } 5693 + 5694 + default: 5695 + // Field doesn't exist on this type, so ignore it 5696 + cbg.ScanForLinks(r, func(cid.Cid) {}) 5697 + } 5698 + } 5699 + 5700 + return nil 5701 + } 5702 + func (t *FeedThreadgate_FollowingRule) MarshalCBOR(w io.Writer) error { 5703 + if t == nil { 5704 + _, err := w.Write(cbg.CborNull) 5705 + return err 5706 + } 5707 + 5708 + cw := cbg.NewCborWriter(w) 5709 + 5710 + if _, err := cw.Write([]byte{161}); err != nil { 5711 + return err 5712 + } 5713 + 5714 + // t.LexiconTypeID (string) (string) 5715 + if len("$type") > cbg.MaxLength { 5716 + return xerrors.Errorf("Value in field \"$type\" was too long") 5717 + } 5718 + 5719 + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("$type"))); err != nil { 5720 + return err 5721 + } 5722 + if _, err := cw.WriteString(string("$type")); err != nil { 5723 + return err 5724 + } 5725 + 5726 + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("app.bsky.feed.threadgate#followingRule"))); err != nil { 5727 + return err 5728 + } 5729 + if _, err := cw.WriteString(string("app.bsky.feed.threadgate#followingRule")); err != nil { 5730 + return err 5731 + } 5732 + return nil 5733 + } 5734 + 5735 + func (t *FeedThreadgate_FollowingRule) UnmarshalCBOR(r io.Reader) (err error) { 5736 + *t = FeedThreadgate_FollowingRule{} 5737 + 5738 + cr := cbg.NewCborReader(r) 5739 + 5740 + maj, extra, err := cr.ReadHeader() 5741 + if err != nil { 5742 + return err 5743 + } 5744 + defer func() { 5745 + if err == io.EOF { 5746 + err = io.ErrUnexpectedEOF 5747 + } 5748 + }() 5749 + 5750 + if maj != cbg.MajMap { 5751 + return fmt.Errorf("cbor input should be of type map") 5752 + } 5753 + 5754 + if extra > cbg.MaxLength { 5755 + return fmt.Errorf("FeedThreadgate_FollowingRule: map struct too large (%d)", extra) 5756 + } 5757 + 5758 + var name string 5759 + n := extra 5760 + 5761 + for i := uint64(0); i < n; i++ { 5762 + 5763 + { 5764 + sval, err := cbg.ReadString(cr) 5765 + if err != nil { 5766 + return err 5767 + } 5768 + 5769 + name = string(sval) 5770 + } 5771 + 5772 + switch name { 5773 + // t.LexiconTypeID (string) (string) 5774 + case "$type": 5775 + 5776 + { 5777 + sval, err := cbg.ReadString(cr) 5778 + if err != nil { 5779 + return err 5780 + } 5781 + 5782 + t.LexiconTypeID = string(sval) 5783 + } 5784 + 5785 + default: 5786 + // Field doesn't exist on this type, so ignore it 5787 + cbg.ScanForLinks(r, func(cid.Cid) {}) 5788 + } 5789 + } 5790 + 5791 + return nil 5792 + }
+3 -8
api/bsky/feeddefs.go
··· 314 314 Parent *FeedDefs_ThreadViewPost_Parent `json:"parent,omitempty" cborgen:"parent,omitempty"` 315 315 Post *FeedDefs_PostView `json:"post" cborgen:"post"` 316 316 Replies []*FeedDefs_ThreadViewPost_Replies_Elem `json:"replies,omitempty" cborgen:"replies,omitempty"` 317 - Viewer *FeedDefs_ViewerThreadState `json:"viewer,omitempty" cborgen:"viewer,omitempty"` 318 317 } 319 318 320 319 type FeedDefs_ThreadViewPost_Parent struct { ··· 413 412 414 413 // FeedDefs_ViewerState is a "viewerState" in the app.bsky.feed.defs schema. 415 414 type FeedDefs_ViewerState struct { 416 - Like *string `json:"like,omitempty" cborgen:"like,omitempty"` 417 - Repost *string `json:"repost,omitempty" cborgen:"repost,omitempty"` 418 - } 419 - 420 - // FeedDefs_ViewerThreadState is a "viewerThreadState" in the app.bsky.feed.defs schema. 421 - type FeedDefs_ViewerThreadState struct { 422 - CanReply *bool `json:"canReply,omitempty" cborgen:"canReply,omitempty"` 415 + Like *string `json:"like,omitempty" cborgen:"like,omitempty"` 416 + ReplyDisabled *bool `json:"replyDisabled,omitempty" cborgen:"replyDisabled,omitempty"` 417 + Repost *string `json:"repost,omitempty" cborgen:"repost,omitempty"` 423 418 }
+136
api/bsky/feedthreadgate.go
··· 1 + // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. 2 + 3 + package bsky 4 + 5 + // schema: app.bsky.feed.threadgate 6 + 7 + import ( 8 + "bytes" 9 + "encoding/json" 10 + "fmt" 11 + "io" 12 + 13 + "github.com/bluesky-social/indigo/lex/util" 14 + cbg "github.com/whyrusleeping/cbor-gen" 15 + ) 16 + 17 + func init() { 18 + util.RegisterType("app.bsky.feed.threadgate", &FeedThreadgate{}) 19 + } // 20 + // RECORDTYPE: FeedThreadgate 21 + type FeedThreadgate struct { 22 + LexiconTypeID string `json:"$type,const=app.bsky.feed.threadgate" cborgen:"$type,const=app.bsky.feed.threadgate"` 23 + Allow []*FeedThreadgate_Allow_Elem `json:"allow,omitempty" cborgen:"allow,omitempty"` 24 + CreatedAt string `json:"createdAt" cborgen:"createdAt"` 25 + Post string `json:"post" cborgen:"post"` 26 + } 27 + 28 + type FeedThreadgate_Allow_Elem struct { 29 + FeedThreadgate_MentionRule *FeedThreadgate_MentionRule 30 + FeedThreadgate_FollowingRule *FeedThreadgate_FollowingRule 31 + FeedThreadgate_ListRule *FeedThreadgate_ListRule 32 + } 33 + 34 + func (t *FeedThreadgate_Allow_Elem) MarshalJSON() ([]byte, error) { 35 + if t.FeedThreadgate_MentionRule != nil { 36 + t.FeedThreadgate_MentionRule.LexiconTypeID = "app.bsky.feed.threadgate#mentionRule" 37 + return json.Marshal(t.FeedThreadgate_MentionRule) 38 + } 39 + if t.FeedThreadgate_FollowingRule != nil { 40 + t.FeedThreadgate_FollowingRule.LexiconTypeID = "app.bsky.feed.threadgate#followingRule" 41 + return json.Marshal(t.FeedThreadgate_FollowingRule) 42 + } 43 + if t.FeedThreadgate_ListRule != nil { 44 + t.FeedThreadgate_ListRule.LexiconTypeID = "app.bsky.feed.threadgate#listRule" 45 + return json.Marshal(t.FeedThreadgate_ListRule) 46 + } 47 + return nil, fmt.Errorf("cannot marshal empty enum") 48 + } 49 + func (t *FeedThreadgate_Allow_Elem) UnmarshalJSON(b []byte) error { 50 + typ, err := util.TypeExtract(b) 51 + if err != nil { 52 + return err 53 + } 54 + 55 + switch typ { 56 + case "app.bsky.feed.threadgate#mentionRule": 57 + t.FeedThreadgate_MentionRule = new(FeedThreadgate_MentionRule) 58 + return json.Unmarshal(b, t.FeedThreadgate_MentionRule) 59 + case "app.bsky.feed.threadgate#followingRule": 60 + t.FeedThreadgate_FollowingRule = new(FeedThreadgate_FollowingRule) 61 + return json.Unmarshal(b, t.FeedThreadgate_FollowingRule) 62 + case "app.bsky.feed.threadgate#listRule": 63 + t.FeedThreadgate_ListRule = new(FeedThreadgate_ListRule) 64 + return json.Unmarshal(b, t.FeedThreadgate_ListRule) 65 + 66 + default: 67 + return nil 68 + } 69 + } 70 + 71 + func (t *FeedThreadgate_Allow_Elem) MarshalCBOR(w io.Writer) error { 72 + 73 + if t == nil { 74 + _, err := w.Write(cbg.CborNull) 75 + return err 76 + } 77 + if t.FeedThreadgate_MentionRule != nil { 78 + return t.FeedThreadgate_MentionRule.MarshalCBOR(w) 79 + } 80 + if t.FeedThreadgate_FollowingRule != nil { 81 + return t.FeedThreadgate_FollowingRule.MarshalCBOR(w) 82 + } 83 + if t.FeedThreadgate_ListRule != nil { 84 + return t.FeedThreadgate_ListRule.MarshalCBOR(w) 85 + } 86 + return fmt.Errorf("cannot cbor marshal empty enum") 87 + } 88 + func (t *FeedThreadgate_Allow_Elem) UnmarshalCBOR(r io.Reader) error { 89 + typ, b, err := util.CborTypeExtractReader(r) 90 + if err != nil { 91 + return err 92 + } 93 + 94 + switch typ { 95 + case "app.bsky.feed.threadgate#mentionRule": 96 + t.FeedThreadgate_MentionRule = new(FeedThreadgate_MentionRule) 97 + return t.FeedThreadgate_MentionRule.UnmarshalCBOR(bytes.NewReader(b)) 98 + case "app.bsky.feed.threadgate#followingRule": 99 + t.FeedThreadgate_FollowingRule = new(FeedThreadgate_FollowingRule) 100 + return t.FeedThreadgate_FollowingRule.UnmarshalCBOR(bytes.NewReader(b)) 101 + case "app.bsky.feed.threadgate#listRule": 102 + t.FeedThreadgate_ListRule = new(FeedThreadgate_ListRule) 103 + return t.FeedThreadgate_ListRule.UnmarshalCBOR(bytes.NewReader(b)) 104 + 105 + default: 106 + return nil 107 + } 108 + } 109 + 110 + // FeedThreadgate_FollowingRule is a "followingRule" in the app.bsky.feed.threadgate schema. 111 + // 112 + // Allow replies from actors you follow. 113 + // 114 + // RECORDTYPE: FeedThreadgate_FollowingRule 115 + type FeedThreadgate_FollowingRule struct { 116 + LexiconTypeID string `json:"$type,const=app.bsky.feed.threadgate#followingRule" cborgen:"$type,const=app.bsky.feed.threadgate#followingRule"` 117 + } 118 + 119 + // FeedThreadgate_ListRule is a "listRule" in the app.bsky.feed.threadgate schema. 120 + // 121 + // Allow replies from actors on a list. 122 + // 123 + // RECORDTYPE: FeedThreadgate_ListRule 124 + type FeedThreadgate_ListRule struct { 125 + LexiconTypeID string `json:"$type,const=app.bsky.feed.threadgate#listRule" cborgen:"$type,const=app.bsky.feed.threadgate#listRule"` 126 + List string `json:"list" cborgen:"list"` 127 + } 128 + 129 + // FeedThreadgate_MentionRule is a "mentionRule" in the app.bsky.feed.threadgate schema. 130 + // 131 + // Allow replies from actors mentioned in your post. 132 + // 133 + // RECORDTYPE: FeedThreadgate_MentionRule 134 + type FeedThreadgate_MentionRule struct { 135 + LexiconTypeID string `json:"$type,const=app.bsky.feed.threadgate#mentionRule" cborgen:"$type,const=app.bsky.feed.threadgate#mentionRule"` 136 + }
+1
api/bsky/graphdefs.go
··· 7 7 // GraphDefs_ListItemView is a "listItemView" in the app.bsky.graph.defs schema. 8 8 type GraphDefs_ListItemView struct { 9 9 Subject *ActorDefs_ProfileView `json:"subject" cborgen:"subject"` 10 + Uri string `json:"uri" cborgen:"uri"` 10 11 } 11 12 12 13 // GraphDefs_ListView is a "listView" in the app.bsky.graph.defs schema.
+24 -5
api/label/cbor_gen.go
··· 719 719 } 720 720 721 721 for i := 0; i < int(extra); i++ { 722 + { 723 + var maj byte 724 + var extra uint64 725 + var err error 726 + _ = maj 727 + _ = extra 728 + _ = err 722 729 723 - var v Label 724 - if err := v.UnmarshalCBOR(cr); err != nil { 725 - return err 726 - } 730 + { 731 + 732 + b, err := cr.ReadByte() 733 + if err != nil { 734 + return err 735 + } 736 + if b != cbg.CborNull[0] { 737 + if err := cr.UnreadByte(); err != nil { 738 + return err 739 + } 740 + t.Labels[i] = new(Label) 741 + if err := t.Labels[i].UnmarshalCBOR(cr); err != nil { 742 + return xerrors.Errorf("unmarshaling t.Labels[i] pointer: %w", err) 743 + } 744 + } 727 745 728 - t.Labels[i] = &v 746 + } 747 + } 729 748 } 730 749 731 750 default:
+4
gen/main.go
··· 47 47 bsky.FeedGenerator{}, 48 48 bsky.GraphListblock{}, 49 49 bsky.EmbedImages_AspectRatio{}, 50 + bsky.FeedThreadgate{}, 51 + bsky.FeedThreadgate_ListRule{}, 52 + bsky.FeedThreadgate_MentionRule{}, 53 + bsky.FeedThreadgate_FollowingRule{}, 50 54 /*bsky.EmbedImages_View{}, 51 55 bsky.EmbedRecord_View{}, bsky.EmbedRecordWithMedia_View{}, 52 56 bsky.EmbedExternal_View{}, bsky.EmbedImages_ViewImage{},
+7 -5
lex/gen.go
··· 173 173 174 174 if ts.Input != nil { 175 175 if ts.Input.Schema == nil { 176 - if ts.Input.Encoding != "application/cbor" && ts.Input.Encoding != "*/*" { 176 + if ts.Input.Encoding != "application/cbor" && ts.Input.Encoding != "*/*" && ts.Input.Encoding != "application/vnd.ipld.car" { 177 177 panic(fmt.Sprintf("strange input type def in %s", s.ID)) 178 178 } 179 179 } else { ··· 1199 1199 case "boolean": 1200 1200 pf("type %s bool\n", name) 1201 1201 case "object": 1202 - if len(ts.Properties) == 0 { 1203 - pf("type %s interface{}\n", name) 1204 - return nil 1205 - } 1202 + /* 1203 + if len(ts.Properties) == 0 { 1204 + pf("type %s interface{}\n", name) 1205 + return nil 1206 + } 1207 + */ 1206 1208 1207 1209 if ts.needsType { 1208 1210 pf("//\n// RECORDTYPE: %s\n", name)
+14 -5
mst/cbor_gen.go
··· 139 139 } 140 140 141 141 for i := 0; i < int(extra); i++ { 142 + { 143 + var maj byte 144 + var extra uint64 145 + var err error 146 + _ = maj 147 + _ = extra 148 + _ = err 142 149 143 - var v treeEntry 144 - if err := v.UnmarshalCBOR(cr); err != nil { 145 - return err 150 + { 151 + 152 + if err := t.Entries[i].UnmarshalCBOR(cr); err != nil { 153 + return xerrors.Errorf("unmarshaling t.Entries[i]: %w", err) 154 + } 155 + 156 + } 146 157 } 147 - 148 - t.Entries[i] = v 149 158 } 150 159 151 160 // t.Left (cid.Cid) (struct)