porting all github actions from bluesky-social/indigo to tangled CI

Bump lexgen and support #identity events on the firehose

+143
api/atproto/cbor_gen.go
··· 984 984 985 985 return nil 986 986 } 987 + func (t *SyncSubscribeRepos_Identity) MarshalCBOR(w io.Writer) error { 988 + if t == nil { 989 + _, err := w.Write(cbg.CborNull) 990 + return err 991 + } 992 + 993 + cw := cbg.NewCborWriter(w) 994 + 995 + if _, err := cw.Write([]byte{162}); err != nil { 996 + return err 997 + } 998 + 999 + // t.Did (string) (string) 1000 + if uint64(len("did")) > cbg.MaxLength { 1001 + return xerrors.Errorf("Value in field \"did\" was too long") 1002 + } 1003 + 1004 + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("did"))); err != nil { 1005 + return err 1006 + } 1007 + if _, err := cw.WriteString(string("did")); err != nil { 1008 + return err 1009 + } 1010 + 1011 + if uint64(len(t.Did)) > cbg.MaxLength { 1012 + return xerrors.Errorf("Value in field t.Did was too long") 1013 + } 1014 + 1015 + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Did))); err != nil { 1016 + return err 1017 + } 1018 + if _, err := cw.WriteString(string(t.Did)); err != nil { 1019 + return err 1020 + } 1021 + 1022 + // t.Seq (int64) (int64) 1023 + if uint64(len("seq")) > cbg.MaxLength { 1024 + return xerrors.Errorf("Value in field \"seq\" was too long") 1025 + } 1026 + 1027 + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("seq"))); err != nil { 1028 + return err 1029 + } 1030 + if _, err := cw.WriteString(string("seq")); err != nil { 1031 + return err 1032 + } 1033 + 1034 + if t.Seq >= 0 { 1035 + if err := cw.WriteMajorTypeHeader(cbg.MajUnsignedInt, uint64(t.Seq)); err != nil { 1036 + return err 1037 + } 1038 + } else { 1039 + if err := cw.WriteMajorTypeHeader(cbg.MajNegativeInt, uint64(-t.Seq-1)); err != nil { 1040 + return err 1041 + } 1042 + } 1043 + return nil 1044 + } 1045 + 1046 + func (t *SyncSubscribeRepos_Identity) UnmarshalCBOR(r io.Reader) (err error) { 1047 + *t = SyncSubscribeRepos_Identity{} 1048 + 1049 + cr := cbg.NewCborReader(r) 1050 + 1051 + maj, extra, err := cr.ReadHeader() 1052 + if err != nil { 1053 + return err 1054 + } 1055 + defer func() { 1056 + if err == io.EOF { 1057 + err = io.ErrUnexpectedEOF 1058 + } 1059 + }() 1060 + 1061 + if maj != cbg.MajMap { 1062 + return fmt.Errorf("cbor input should be of type map") 1063 + } 1064 + 1065 + if extra > cbg.MaxLength { 1066 + return fmt.Errorf("SyncSubscribeRepos_Identity: map struct too large (%d)", extra) 1067 + } 1068 + 1069 + var name string 1070 + n := extra 1071 + 1072 + for i := uint64(0); i < n; i++ { 1073 + 1074 + { 1075 + sval, err := cbg.ReadString(cr) 1076 + if err != nil { 1077 + return err 1078 + } 1079 + 1080 + name = string(sval) 1081 + } 1082 + 1083 + switch name { 1084 + // t.Did (string) (string) 1085 + case "did": 1086 + 1087 + { 1088 + sval, err := cbg.ReadString(cr) 1089 + if err != nil { 1090 + return err 1091 + } 1092 + 1093 + t.Did = string(sval) 1094 + } 1095 + // t.Seq (int64) (int64) 1096 + case "seq": 1097 + { 1098 + maj, extra, err := cr.ReadHeader() 1099 + var extraI int64 1100 + if err != nil { 1101 + return err 1102 + } 1103 + switch maj { 1104 + case cbg.MajUnsignedInt: 1105 + extraI = int64(extra) 1106 + if extraI < 0 { 1107 + return fmt.Errorf("int64 positive overflow") 1108 + } 1109 + case cbg.MajNegativeInt: 1110 + extraI = int64(extra) 1111 + if extraI < 0 { 1112 + return fmt.Errorf("int64 negative overflow") 1113 + } 1114 + extraI = -1 - extraI 1115 + default: 1116 + return fmt.Errorf("wrong type for int64 field: %d", maj) 1117 + } 1118 + 1119 + t.Seq = int64(extraI) 1120 + } 1121 + 1122 + default: 1123 + // Field doesn't exist on this type, so ignore it 1124 + cbg.ScanForLinks(r, func(cid.Cid) {}) 1125 + } 1126 + } 1127 + 1128 + return nil 1129 + } 987 1130 func (t *SyncSubscribeRepos_Info) MarshalCBOR(w io.Writer) error { 988 1131 if t == nil { 989 1132 _, err := w.Write(cbg.CborNull)
+31
api/atproto/identitygetRecommendedDidCredentials.go
··· 1 + // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. 2 + 3 + package atproto 4 + 5 + // schema: com.atproto.identity.getRecommendedDidCredentials 6 + 7 + import ( 8 + "context" 9 + 10 + "github.com/bluesky-social/indigo/lex/util" 11 + "github.com/bluesky-social/indigo/xrpc" 12 + ) 13 + 14 + // IdentityGetRecommendedDidCredentials_Output is the output of a com.atproto.identity.getRecommendedDidCredentials call. 15 + type IdentityGetRecommendedDidCredentials_Output struct { 16 + AlsoKnownAs []string `json:"alsoKnownAs,omitempty" cborgen:"alsoKnownAs,omitempty"` 17 + // rotationKeys: Recommended rotation keys for PLC dids. Should be undefined (or ignored) for did:webs. 18 + RotationKeys []string `json:"rotationKeys,omitempty" cborgen:"rotationKeys,omitempty"` 19 + Services *util.LexiconTypeDecoder `json:"services,omitempty" cborgen:"services,omitempty"` 20 + VerificationMethods *util.LexiconTypeDecoder `json:"verificationMethods,omitempty" cborgen:"verificationMethods,omitempty"` 21 + } 22 + 23 + // IdentityGetRecommendedDidCredentials calls the XRPC method "com.atproto.identity.getRecommendedDidCredentials". 24 + func IdentityGetRecommendedDidCredentials(ctx context.Context, c *xrpc.Client) (*IdentityGetRecommendedDidCredentials_Output, error) { 25 + var out IdentityGetRecommendedDidCredentials_Output 26 + if err := c.Do(ctx, xrpc.Query, "", "com.atproto.identity.getRecommendedDidCredentials", nil, nil, &out); err != nil { 27 + return nil, err 28 + } 29 + 30 + return &out, nil 31 + }
+20
api/atproto/identityrequestPlcOperationSignature.go
··· 1 + // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. 2 + 3 + package atproto 4 + 5 + // schema: com.atproto.identity.requestPlcOperationSignature 6 + 7 + import ( 8 + "context" 9 + 10 + "github.com/bluesky-social/indigo/xrpc" 11 + ) 12 + 13 + // IdentityRequestPlcOperationSignature calls the XRPC method "com.atproto.identity.requestPlcOperationSignature". 14 + func IdentityRequestPlcOperationSignature(ctx context.Context, c *xrpc.Client) error { 15 + if err := c.Do(ctx, xrpc.Procedure, "", "com.atproto.identity.requestPlcOperationSignature", nil, nil, nil); err != nil { 16 + return err 17 + } 18 + 19 + return nil 20 + }
+38
api/atproto/identitysignPlcOperation.go
··· 1 + // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. 2 + 3 + package atproto 4 + 5 + // schema: com.atproto.identity.signPlcOperation 6 + 7 + import ( 8 + "context" 9 + 10 + "github.com/bluesky-social/indigo/lex/util" 11 + "github.com/bluesky-social/indigo/xrpc" 12 + ) 13 + 14 + // IdentitySignPlcOperation_Input is the input argument to a com.atproto.identity.signPlcOperation call. 15 + type IdentitySignPlcOperation_Input struct { 16 + AlsoKnownAs []string `json:"alsoKnownAs,omitempty" cborgen:"alsoKnownAs,omitempty"` 17 + RotationKeys []string `json:"rotationKeys,omitempty" cborgen:"rotationKeys,omitempty"` 18 + Services *util.LexiconTypeDecoder `json:"services,omitempty" cborgen:"services,omitempty"` 19 + // token: A token received through com.atproto.identity.requestPlcOperationSignature 20 + Token *string `json:"token,omitempty" cborgen:"token,omitempty"` 21 + VerificationMethods *util.LexiconTypeDecoder `json:"verificationMethods,omitempty" cborgen:"verificationMethods,omitempty"` 22 + } 23 + 24 + // IdentitySignPlcOperation_Output is the output of a com.atproto.identity.signPlcOperation call. 25 + type IdentitySignPlcOperation_Output struct { 26 + // operation: A signed DID PLC operation. 27 + Operation *util.LexiconTypeDecoder `json:"operation" cborgen:"operation"` 28 + } 29 + 30 + // IdentitySignPlcOperation calls the XRPC method "com.atproto.identity.signPlcOperation". 31 + func IdentitySignPlcOperation(ctx context.Context, c *xrpc.Client, input *IdentitySignPlcOperation_Input) (*IdentitySignPlcOperation_Output, error) { 32 + var out IdentitySignPlcOperation_Output 33 + if err := c.Do(ctx, xrpc.Procedure, "application/json", "com.atproto.identity.signPlcOperation", nil, input, &out); err != nil { 34 + return nil, err 35 + } 36 + 37 + return &out, nil 38 + }
+26
api/atproto/identitysubmitPlcOperation.go
··· 1 + // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. 2 + 3 + package atproto 4 + 5 + // schema: com.atproto.identity.submitPlcOperation 6 + 7 + import ( 8 + "context" 9 + 10 + "github.com/bluesky-social/indigo/lex/util" 11 + "github.com/bluesky-social/indigo/xrpc" 12 + ) 13 + 14 + // IdentitySubmitPlcOperation_Input is the input argument to a com.atproto.identity.submitPlcOperation call. 15 + type IdentitySubmitPlcOperation_Input struct { 16 + Operation *util.LexiconTypeDecoder `json:"operation" cborgen:"operation"` 17 + } 18 + 19 + // IdentitySubmitPlcOperation calls the XRPC method "com.atproto.identity.submitPlcOperation". 20 + func IdentitySubmitPlcOperation(ctx context.Context, c *xrpc.Client, input *IdentitySubmitPlcOperation_Input) error { 21 + if err := c.Do(ctx, xrpc.Procedure, "application/json", "com.atproto.identity.submitPlcOperation", nil, input, nil); err != nil { 22 + return err 23 + } 24 + 25 + return nil 26 + }
+1
api/atproto/identityupdateHandle.go
··· 12 12 13 13 // IdentityUpdateHandle_Input is the input argument to a com.atproto.identity.updateHandle call. 14 14 type IdentityUpdateHandle_Input struct { 15 + // handle: The new handle. 15 16 Handle string `json:"handle" cborgen:"handle"` 16 17 } 17 18
+3 -1
api/atproto/moderationcreateReport.go
··· 15 15 16 16 // ModerationCreateReport_Input is the input argument to a com.atproto.moderation.createReport call. 17 17 type ModerationCreateReport_Input struct { 18 - Reason *string `json:"reason,omitempty" cborgen:"reason,omitempty"` 18 + // reason: Additional context about the content and violation. 19 + Reason *string `json:"reason,omitempty" cborgen:"reason,omitempty"` 20 + // reasonType: Indicates the broad category of violation the report is for. 19 21 ReasonType *string `json:"reasonType" cborgen:"reasonType"` 20 22 Subject *ModerationCreateReport_Input_Subject `json:"subject" cborgen:"subject"` 21 23 }
+7 -6
api/atproto/repoapplyWrites.go
··· 15 15 16 16 // RepoApplyWrites_Create is a "create" in the com.atproto.repo.applyWrites schema. 17 17 // 18 - // Create a new record. 18 + // Operation which creates a new record. 19 19 // 20 20 // RECORDTYPE: RepoApplyWrites_Create 21 21 type RepoApplyWrites_Create struct { ··· 27 27 28 28 // RepoApplyWrites_Delete is a "delete" in the com.atproto.repo.applyWrites schema. 29 29 // 30 - // Delete an existing record. 30 + // Operation which deletes an existing record. 31 31 // 32 32 // RECORDTYPE: RepoApplyWrites_Delete 33 33 type RepoApplyWrites_Delete struct { ··· 38 38 39 39 // RepoApplyWrites_Input is the input argument to a com.atproto.repo.applyWrites call. 40 40 type RepoApplyWrites_Input struct { 41 - // repo: The handle or DID of the repo. 42 - Repo string `json:"repo" cborgen:"repo"` 41 + // repo: The handle or DID of the repo (aka, current account). 42 + Repo string `json:"repo" cborgen:"repo"` 43 + // swapCommit: If provided, the entire operation will fail if the current repo commit CID does not match this value. Used to prevent conflicting repo mutations. 43 44 SwapCommit *string `json:"swapCommit,omitempty" cborgen:"swapCommit,omitempty"` 44 - // validate: Flag for validating the records. 45 + // validate: Can be set to 'false' to skip Lexicon schema validation of record data, for all operations. 45 46 Validate *bool `json:"validate,omitempty" cborgen:"validate,omitempty"` 46 47 Writes []*RepoApplyWrites_Input_Writes_Elem `json:"writes" cborgen:"writes"` 47 48 } ··· 91 92 92 93 // RepoApplyWrites_Update is a "update" in the com.atproto.repo.applyWrites schema. 93 94 // 94 - // Update an existing record. 95 + // Operation which updates an existing record. 95 96 // 96 97 // RECORDTYPE: RepoApplyWrites_Update 97 98 type RepoApplyWrites_Update struct {
+4 -4
api/atproto/repocreateRecord.go
··· 15 15 type RepoCreateRecord_Input struct { 16 16 // collection: The NSID of the record collection. 17 17 Collection string `json:"collection" cborgen:"collection"` 18 - // record: The record to create. 18 + // record: The record itself. Must contain a $type field. 19 19 Record *util.LexiconTypeDecoder `json:"record" cborgen:"record"` 20 - // repo: The handle or DID of the repo. 20 + // repo: The handle or DID of the repo (aka, current account). 21 21 Repo string `json:"repo" cborgen:"repo"` 22 - // rkey: The key of the record. 22 + // rkey: The Record Key. 23 23 Rkey *string `json:"rkey,omitempty" cborgen:"rkey,omitempty"` 24 24 // swapCommit: Compare and swap with the previous commit by CID. 25 25 SwapCommit *string `json:"swapCommit,omitempty" cborgen:"swapCommit,omitempty"` 26 - // validate: Flag for validating the record. 26 + // validate: Can be set to 'false' to skip Lexicon schema validation of record data. 27 27 Validate *bool `json:"validate,omitempty" cborgen:"validate,omitempty"` 28 28 } 29 29
+2 -2
api/atproto/repodeleteRecord.go
··· 14 14 type RepoDeleteRecord_Input struct { 15 15 // collection: The NSID of the record collection. 16 16 Collection string `json:"collection" cborgen:"collection"` 17 - // repo: The handle or DID of the repo. 17 + // repo: The handle or DID of the repo (aka, current account). 18 18 Repo string `json:"repo" cborgen:"repo"` 19 - // rkey: The key of the record. 19 + // rkey: The Record Key. 20 20 Rkey string `json:"rkey" cborgen:"rkey"` 21 21 // swapCommit: Compare and swap with the previous commit by CID. 22 22 SwapCommit *string `json:"swapCommit,omitempty" cborgen:"swapCommit,omitempty"`
+8 -5
api/atproto/repodescribeRepo.go
··· 12 12 13 13 // RepoDescribeRepo_Output is the output of a com.atproto.repo.describeRepo call. 14 14 type RepoDescribeRepo_Output struct { 15 - Collections []string `json:"collections" cborgen:"collections"` 16 - Did string `json:"did" cborgen:"did"` 17 - DidDoc interface{} `json:"didDoc" cborgen:"didDoc"` 18 - Handle string `json:"handle" cborgen:"handle"` 19 - HandleIsCorrect bool `json:"handleIsCorrect" cborgen:"handleIsCorrect"` 15 + // collections: List of all the collections (NSIDs) for which this repo contains at least one record. 16 + Collections []string `json:"collections" cborgen:"collections"` 17 + Did string `json:"did" cborgen:"did"` 18 + // didDoc: The complete DID document for this account. 19 + DidDoc interface{} `json:"didDoc" cborgen:"didDoc"` 20 + Handle string `json:"handle" cborgen:"handle"` 21 + // handleIsCorrect: Indicates if handle is currently valid (resolves bi-directionally) 22 + HandleIsCorrect bool `json:"handleIsCorrect" cborgen:"handleIsCorrect"` 20 23 } 21 24 22 25 // RepoDescribeRepo calls the XRPC method "com.atproto.repo.describeRepo".
+1 -1
api/atproto/repogetRecord.go
··· 23 23 // cid: The CID of the version of the record. If not specified, then return the most recent version. 24 24 // collection: The NSID of the record collection. 25 25 // repo: The handle or DID of the repo. 26 - // rkey: The key of the record. 26 + // rkey: The Record Key. 27 27 func RepoGetRecord(ctx context.Context, c *xrpc.Client, cid string, collection string, repo string, rkey string) (*RepoGetRecord_Output, error) { 28 28 var out RepoGetRecord_Output 29 29
+21
api/atproto/repoimportRepo.go
··· 1 + // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. 2 + 3 + package atproto 4 + 5 + // schema: com.atproto.repo.importRepo 6 + 7 + import ( 8 + "context" 9 + "io" 10 + 11 + "github.com/bluesky-social/indigo/xrpc" 12 + ) 13 + 14 + // RepoImportRepo calls the XRPC method "com.atproto.repo.importRepo". 15 + func RepoImportRepo(ctx context.Context, c *xrpc.Client, input io.Reader) error { 16 + if err := c.Do(ctx, xrpc.Procedure, "application/vnd.ipld.car", "com.atproto.repo.importRepo", nil, input, nil); err != nil { 17 + return err 18 + } 19 + 20 + return nil 21 + }
+38
api/atproto/repolistMissingBlobs.go
··· 1 + // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. 2 + 3 + package atproto 4 + 5 + // schema: com.atproto.repo.listMissingBlobs 6 + 7 + import ( 8 + "context" 9 + 10 + "github.com/bluesky-social/indigo/xrpc" 11 + ) 12 + 13 + // RepoListMissingBlobs_Output is the output of a com.atproto.repo.listMissingBlobs call. 14 + type RepoListMissingBlobs_Output struct { 15 + Blobs []*RepoListMissingBlobs_RecordBlob `json:"blobs" cborgen:"blobs"` 16 + Cursor *string `json:"cursor,omitempty" cborgen:"cursor,omitempty"` 17 + } 18 + 19 + // RepoListMissingBlobs_RecordBlob is a "recordBlob" in the com.atproto.repo.listMissingBlobs schema. 20 + type RepoListMissingBlobs_RecordBlob struct { 21 + Cid string `json:"cid" cborgen:"cid"` 22 + RecordUri string `json:"recordUri" cborgen:"recordUri"` 23 + } 24 + 25 + // RepoListMissingBlobs calls the XRPC method "com.atproto.repo.listMissingBlobs". 26 + func RepoListMissingBlobs(ctx context.Context, c *xrpc.Client, cursor string, limit int64) (*RepoListMissingBlobs_Output, error) { 27 + var out RepoListMissingBlobs_Output 28 + 29 + params := map[string]interface{}{ 30 + "cursor": cursor, 31 + "limit": limit, 32 + } 33 + if err := c.Do(ctx, xrpc.Query, "", "com.atproto.repo.listMissingBlobs", params, nil, &out); err != nil { 34 + return nil, err 35 + } 36 + 37 + return &out, nil 38 + }
+4 -4
api/atproto/repoputRecord.go
··· 17 17 Collection string `json:"collection" cborgen:"collection"` 18 18 // record: The record to write. 19 19 Record *util.LexiconTypeDecoder `json:"record" cborgen:"record"` 20 - // repo: The handle or DID of the repo. 20 + // repo: The handle or DID of the repo (aka, current account). 21 21 Repo string `json:"repo" cborgen:"repo"` 22 - // rkey: The key of the record. 22 + // rkey: The Record Key. 23 23 Rkey string `json:"rkey" cborgen:"rkey"` 24 24 // swapCommit: Compare and swap with the previous commit by CID. 25 25 SwapCommit *string `json:"swapCommit,omitempty" cborgen:"swapCommit,omitempty"` 26 - // swapRecord: Compare and swap with the previous record by CID. 26 + // swapRecord: Compare and swap with the previous record by CID. WARNING: nullable and optional field; may cause problems with golang implementation 27 27 SwapRecord *string `json:"swapRecord" cborgen:"swapRecord"` 28 - // validate: Flag for validating the record. 28 + // validate: Can be set to 'false' to skip Lexicon schema validation of record data. 29 29 Validate *bool `json:"validate,omitempty" cborgen:"validate,omitempty"` 30 30 } 31 31
+20
api/atproto/serveractivateAccount.go
··· 1 + // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. 2 + 3 + package atproto 4 + 5 + // schema: com.atproto.server.activateAccount 6 + 7 + import ( 8 + "context" 9 + 10 + "github.com/bluesky-social/indigo/xrpc" 11 + ) 12 + 13 + // ServerActivateAccount calls the XRPC method "com.atproto.server.activateAccount". 14 + func ServerActivateAccount(ctx context.Context, c *xrpc.Client) error { 15 + if err := c.Do(ctx, xrpc.Procedure, "", "com.atproto.server.activateAccount", nil, nil, nil); err != nil { 16 + return err 17 + } 18 + 19 + return nil 20 + }
+34
api/atproto/servercheckAccountStatus.go
··· 1 + // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. 2 + 3 + package atproto 4 + 5 + // schema: com.atproto.server.checkAccountStatus 6 + 7 + import ( 8 + "context" 9 + 10 + "github.com/bluesky-social/indigo/xrpc" 11 + ) 12 + 13 + // ServerCheckAccountStatus_Output is the output of a com.atproto.server.checkAccountStatus call. 14 + type ServerCheckAccountStatus_Output struct { 15 + Activated bool `json:"activated" cborgen:"activated"` 16 + ExpectedBlobs int64 `json:"expectedBlobs" cborgen:"expectedBlobs"` 17 + ImportedBlobs int64 `json:"importedBlobs" cborgen:"importedBlobs"` 18 + IndexedRecords int64 `json:"indexedRecords" cborgen:"indexedRecords"` 19 + PrivateStateValues int64 `json:"privateStateValues" cborgen:"privateStateValues"` 20 + RepoBlocks int64 `json:"repoBlocks" cborgen:"repoBlocks"` 21 + RepoCommit string `json:"repoCommit" cborgen:"repoCommit"` 22 + RepoRev string `json:"repoRev" cborgen:"repoRev"` 23 + ValidDid bool `json:"validDid" cborgen:"validDid"` 24 + } 25 + 26 + // ServerCheckAccountStatus calls the XRPC method "com.atproto.server.checkAccountStatus". 27 + func ServerCheckAccountStatus(ctx context.Context, c *xrpc.Client) (*ServerCheckAccountStatus_Output, error) { 28 + var out ServerCheckAccountStatus_Output 29 + if err := c.Do(ctx, xrpc.Query, "", "com.atproto.server.checkAccountStatus", nil, nil, &out); err != nil { 30 + return nil, err 31 + } 32 + 33 + return &out, nil 34 + }
+20 -11
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"` 16 - Email *string `json:"email,omitempty" cborgen:"email,omitempty"` 17 - Handle string `json:"handle" cborgen:"handle"` 18 - InviteCode *string `json:"inviteCode,omitempty" cborgen:"inviteCode,omitempty"` 19 - Password *string `json:"password,omitempty" cborgen:"password,omitempty"` 20 - PlcOp *interface{} `json:"plcOp,omitempty" cborgen:"plcOp,omitempty"` 21 - RecoveryKey *string `json:"recoveryKey,omitempty" cborgen:"recoveryKey,omitempty"` 22 - VerificationCode *string `json:"verificationCode,omitempty" cborgen:"verificationCode,omitempty"` 23 - VerificationPhone *string `json:"verificationPhone,omitempty" cborgen:"verificationPhone,omitempty"` 15 + // did: Pre-existing atproto DID, being imported to a new account. 16 + Did *string `json:"did,omitempty" cborgen:"did,omitempty"` 17 + Email *string `json:"email,omitempty" cborgen:"email,omitempty"` 18 + // handle: Requested handle for the account. 19 + Handle string `json:"handle" cborgen:"handle"` 20 + InviteCode *string `json:"inviteCode,omitempty" cborgen:"inviteCode,omitempty"` 21 + // password: Initial account password. May need to meet instance-specific password strength requirements. 22 + Password *string `json:"password,omitempty" cborgen:"password,omitempty"` 23 + // plcOp: A signed DID PLC operation to be submitted as part of importing an existing account to this instance. NOTE: this optional field may be updated when full account migration is implemented. 24 + PlcOp *interface{} `json:"plcOp,omitempty" cborgen:"plcOp,omitempty"` 25 + // recoveryKey: DID PLC rotation key (aka, recovery key) to be included in PLC creation operation. 26 + RecoveryKey *string `json:"recoveryKey,omitempty" cborgen:"recoveryKey,omitempty"` 27 + VerificationCode *string `json:"verificationCode,omitempty" cborgen:"verificationCode,omitempty"` 28 + VerificationPhone *string `json:"verificationPhone,omitempty" cborgen:"verificationPhone,omitempty"` 24 29 } 25 30 26 31 // ServerCreateAccount_Output is the output of a com.atproto.server.createAccount call. 32 + // 33 + // Account login session returned on successful account creation. 27 34 type ServerCreateAccount_Output struct { 28 - AccessJwt string `json:"accessJwt" cborgen:"accessJwt"` 29 - Did string `json:"did" cborgen:"did"` 35 + AccessJwt string `json:"accessJwt" cborgen:"accessJwt"` 36 + // did: The DID of the new account. 37 + Did string `json:"did" cborgen:"did"` 38 + // didDoc: Complete DID document. 30 39 DidDoc *interface{} `json:"didDoc,omitempty" cborgen:"didDoc,omitempty"` 31 40 Handle string `json:"handle" cborgen:"handle"` 32 41 RefreshJwt string `json:"refreshJwt" cborgen:"refreshJwt"`
+1
api/atproto/servercreateAppPassword.go
··· 19 19 20 20 // ServerCreateAppPassword_Input is the input argument to a com.atproto.server.createAppPassword call. 21 21 type ServerCreateAppPassword_Input struct { 22 + // name: A short name for the App Password, to help distinguish them. 22 23 Name string `json:"name" cborgen:"name"` 23 24 } 24 25
+26
api/atproto/serverdeactivateAccount.go
··· 1 + // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. 2 + 3 + package atproto 4 + 5 + // schema: com.atproto.server.deactivateAccount 6 + 7 + import ( 8 + "context" 9 + 10 + "github.com/bluesky-social/indigo/xrpc" 11 + ) 12 + 13 + // ServerDeactivateAccount_Input is the input argument to a com.atproto.server.deactivateAccount call. 14 + type ServerDeactivateAccount_Input struct { 15 + // deleteAfter: A recommendation to server as to how long they should hold onto the deactivated account before deleting. 16 + DeleteAfter *string `json:"deleteAfter,omitempty" cborgen:"deleteAfter,omitempty"` 17 + } 18 + 19 + // ServerDeactivateAccount calls the XRPC method "com.atproto.server.deactivateAccount". 20 + func ServerDeactivateAccount(ctx context.Context, c *xrpc.Client, input *ServerDeactivateAccount_Input) error { 21 + if err := c.Do(ctx, xrpc.Procedure, "application/json", "com.atproto.server.deactivateAccount", nil, input, nil); err != nil { 22 + return err 23 + } 24 + 25 + return nil 26 + }
+9 -4
api/atproto/serverdescribeServer.go
··· 18 18 19 19 // ServerDescribeServer_Output is the output of a com.atproto.server.describeServer call. 20 20 type ServerDescribeServer_Output struct { 21 - AvailableUserDomains []string `json:"availableUserDomains" cborgen:"availableUserDomains"` 22 - InviteCodeRequired *bool `json:"inviteCodeRequired,omitempty" cborgen:"inviteCodeRequired,omitempty"` 23 - Links *ServerDescribeServer_Links `json:"links,omitempty" cborgen:"links,omitempty"` 24 - PhoneVerificationRequired *bool `json:"phoneVerificationRequired,omitempty" cborgen:"phoneVerificationRequired,omitempty"` 21 + // availableUserDomains: List of domain suffixes that can be used in account handles. 22 + AvailableUserDomains []string `json:"availableUserDomains" cborgen:"availableUserDomains"` 23 + Did string `json:"did" cborgen:"did"` 24 + // inviteCodeRequired: If true, an invite code must be supplied to create an account on this instance. 25 + InviteCodeRequired *bool `json:"inviteCodeRequired,omitempty" cborgen:"inviteCodeRequired,omitempty"` 26 + // links: URLs of service policy documents. 27 + Links *ServerDescribeServer_Links `json:"links,omitempty" cborgen:"links,omitempty"` 28 + // phoneVerificationRequired: If true, a phone verification token must be supplied to create an account on this instance. 29 + PhoneVerificationRequired *bool `json:"phoneVerificationRequired,omitempty" cborgen:"phoneVerificationRequired,omitempty"` 25 30 } 26 31 27 32 // ServerDescribeServer calls the XRPC method "com.atproto.server.describeServer".
+2
api/atproto/servergetAccountInviteCodes.go
··· 16 16 } 17 17 18 18 // ServerGetAccountInviteCodes calls the XRPC method "com.atproto.server.getAccountInviteCodes". 19 + // 20 + // createAvailable: Controls whether any new 'earned' but not 'created' invites should be created. 19 21 func ServerGetAccountInviteCodes(ctx context.Context, c *xrpc.Client, createAvailable bool, includeUsed bool) (*ServerGetAccountInviteCodes_Output, error) { 20 22 var out ServerGetAccountInviteCodes_Output 21 23
+32
api/atproto/servergetServiceAuth.go
··· 1 + // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. 2 + 3 + package atproto 4 + 5 + // schema: com.atproto.server.getServiceAuth 6 + 7 + import ( 8 + "context" 9 + 10 + "github.com/bluesky-social/indigo/xrpc" 11 + ) 12 + 13 + // ServerGetServiceAuth_Output is the output of a com.atproto.server.getServiceAuth call. 14 + type ServerGetServiceAuth_Output struct { 15 + Token string `json:"token" cborgen:"token"` 16 + } 17 + 18 + // ServerGetServiceAuth calls the XRPC method "com.atproto.server.getServiceAuth". 19 + // 20 + // aud: The DID of the service that the token will be used to authenticate with 21 + func ServerGetServiceAuth(ctx context.Context, c *xrpc.Client, aud string) (*ServerGetServiceAuth_Output, error) { 22 + var out ServerGetServiceAuth_Output 23 + 24 + params := map[string]interface{}{ 25 + "aud": aud, 26 + } 27 + if err := c.Do(ctx, xrpc.Query, "", "com.atproto.server.getServiceAuth", params, nil, &out); err != nil { 28 + return nil, err 29 + } 30 + 31 + return &out, nil 32 + }
+2 -2
api/atproto/serverreserveSigningKey.go
··· 12 12 13 13 // ServerReserveSigningKey_Input is the input argument to a com.atproto.server.reserveSigningKey call. 14 14 type ServerReserveSigningKey_Input struct { 15 - // did: The did to reserve a new did:key for 15 + // did: The DID to reserve a key for. 16 16 Did *string `json:"did,omitempty" cborgen:"did,omitempty"` 17 17 } 18 18 19 19 // ServerReserveSigningKey_Output is the output of a com.atproto.server.reserveSigningKey call. 20 20 type ServerReserveSigningKey_Output struct { 21 - // signingKey: Public signing key in the form of a did:key. 21 + // signingKey: The public key for the reserved signing key, in did:key serialization. 22 22 SigningKey string `json:"signingKey" cborgen:"signingKey"` 23 23 } 24 24
+1 -1
api/atproto/syncgetBlob.go
··· 14 14 // SyncGetBlob calls the XRPC method "com.atproto.sync.getBlob". 15 15 // 16 16 // cid: The CID of the blob to fetch 17 - // did: The DID of the repo. 17 + // did: The DID of the account. 18 18 func SyncGetBlob(ctx context.Context, c *xrpc.Client, cid string, did string) ([]byte, error) { 19 19 buf := new(bytes.Buffer) 20 20
+1
api/atproto/syncgetRecord.go
··· 15 15 // 16 16 // commit: An optional past commit CID. 17 17 // did: The DID of the repo. 18 + // rkey: Record Key 18 19 func SyncGetRecord(ctx context.Context, c *xrpc.Client, collection string, commit string, did string, rkey string) ([]byte, error) { 19 20 buf := new(bytes.Buffer) 20 21
+1 -1
api/atproto/syncgetRepo.go
··· 14 14 // SyncGetRepo calls the XRPC method "com.atproto.sync.getRepo". 15 15 // 16 16 // did: The DID of the repo. 17 - // since: The revision of the repo to catch up from. 17 + // since: The revision ('rev') of the repo to create a diff from. 18 18 func SyncGetRepo(ctx context.Context, c *xrpc.Client, did string, since string) ([]byte, error) { 19 19 buf := new(bytes.Buffer) 20 20
+2 -1
api/atproto/synclistRepos.go
··· 18 18 19 19 // SyncListRepos_Repo is a "repo" in the com.atproto.sync.listRepos schema. 20 20 type SyncListRepos_Repo struct { 21 - Did string `json:"did" cborgen:"did"` 21 + Did string `json:"did" cborgen:"did"` 22 + // head: Current repo commit CID 22 23 Head string `json:"head" cborgen:"head"` 23 24 Rev string `json:"rev" cborgen:"rev"` 24 25 }
+1 -1
api/atproto/syncnotifyOfUpdate.go
··· 12 12 13 13 // SyncNotifyOfUpdate_Input is the input argument to a com.atproto.sync.notifyOfUpdate call. 14 14 type SyncNotifyOfUpdate_Input struct { 15 - // hostname: Hostname of the service that is notifying of update. 15 + // hostname: Hostname of the current service (usually a PDS) that is notifying of update. 16 16 Hostname string `json:"hostname" cborgen:"hostname"` 17 17 } 18 18
+1 -1
api/atproto/syncrequestCrawl.go
··· 12 12 13 13 // SyncRequestCrawl_Input is the input argument to a com.atproto.sync.requestCrawl call. 14 14 type SyncRequestCrawl_Input struct { 15 - // hostname: Hostname of the service that is requesting to be crawled. 15 + // hostname: Hostname of the current service (eg, PDS) that is requesting to be crawled. 16 16 Hostname string `json:"hostname" cborgen:"hostname"` 17 17 } 18 18
+39 -15
api/atproto/syncsubscribeRepos.go
··· 9 9 ) 10 10 11 11 // SyncSubscribeRepos_Commit is a "commit" in the com.atproto.sync.subscribeRepos schema. 12 + // 13 + // Represents an update of repository state. Note that empty commits are allowed, which include no repo data changes, but an update to rev and signature. 12 14 type SyncSubscribeRepos_Commit struct { 13 15 Blobs []util.LexLink `json:"blobs" cborgen:"blobs"` 14 - // blocks: CAR file containing relevant blocks. 15 - Blocks util.LexBytes `json:"blocks,omitempty" cborgen:"blocks,omitempty"` 16 + // blocks: CAR file containing relevant blocks, as a diff since the previous repo state. 17 + Blocks util.LexBytes `json:"blocks,omitempty" cborgen:"blocks,omitempty"` 18 + // commit: Repo commit object CID. 16 19 Commit util.LexLink `json:"commit" cborgen:"commit"` 17 20 Ops []*SyncSubscribeRepos_RepoOp `json:"ops" cborgen:"ops"` 18 - Prev *util.LexLink `json:"prev" cborgen:"prev"` 19 - Rebase bool `json:"rebase" cborgen:"rebase"` 20 - Repo string `json:"repo" cborgen:"repo"` 21 - // rev: The rev of the emitted commit. 21 + // prev: DEPRECATED -- unused. WARNING -- nullable and optional; stick with optional to ensure golang interoperability. 22 + Prev *util.LexLink `json:"prev" cborgen:"prev"` 23 + // rebase: DEPRECATED -- unused 24 + Rebase bool `json:"rebase" cborgen:"rebase"` 25 + // repo: The repo this event comes from. 26 + Repo string `json:"repo" cborgen:"repo"` 27 + // rev: The rev of the emitted commit. Note that this information is also in the commit object included in blocks, unless this is a tooBig event. 22 28 Rev string `json:"rev" cborgen:"rev"` 23 - Seq int64 `json:"seq" cborgen:"seq"` 24 - // since: The rev of the last emitted commit from this repo. 25 - Since *string `json:"since" cborgen:"since"` 26 - Time string `json:"time" cborgen:"time"` 27 - TooBig bool `json:"tooBig" cborgen:"tooBig"` 29 + // seq: The stream sequence number of this message. 30 + Seq int64 `json:"seq" cborgen:"seq"` 31 + // since: The rev of the last emitted commit from this repo (if any). 32 + Since *string `json:"since" cborgen:"since"` 33 + // time: Timestamp of when this message was originally broadcast. 34 + Time string `json:"time" cborgen:"time"` 35 + // tooBig: Indicates that this commit contained too many ops, or data size was too large. Consumers will need to make a separate request to get missing data. 36 + TooBig bool `json:"tooBig" cborgen:"tooBig"` 28 37 } 29 38 30 39 // SyncSubscribeRepos_Handle is a "handle" in the com.atproto.sync.subscribeRepos schema. 40 + // 41 + // Represents an update of the account's handle, or transition to/from invalid state. NOTE: Will be deprecated in favor of #identity. 31 42 type SyncSubscribeRepos_Handle struct { 32 43 Did string `json:"did" cborgen:"did"` 33 44 Handle string `json:"handle" cborgen:"handle"` 34 45 Seq int64 `json:"seq" cborgen:"seq"` 35 46 Time string `json:"time" cborgen:"time"` 47 + } 48 + 49 + // SyncSubscribeRepos_Identity is a "identity" in the com.atproto.sync.subscribeRepos schema. 50 + // 51 + // Represents a change to an account's identity. Could be an updated handle, signing key, or pds hosting endpoint. Serves as a prod to all downstream services to refresh their identity cache. 52 + type SyncSubscribeRepos_Identity struct { 53 + Did string `json:"did" cborgen:"did"` 54 + Seq int64 `json:"seq" cborgen:"seq"` 36 55 } 37 56 38 57 // SyncSubscribeRepos_Info is a "info" in the com.atproto.sync.subscribeRepos schema. ··· 42 61 } 43 62 44 63 // SyncSubscribeRepos_Migrate is a "migrate" in the com.atproto.sync.subscribeRepos schema. 64 + // 65 + // Represents an account moving from one PDS instance to another. NOTE: not implemented; account migration uses #identity instead 45 66 type SyncSubscribeRepos_Migrate struct { 46 67 Did string `json:"did" cborgen:"did"` 47 68 MigrateTo *string `json:"migrateTo" cborgen:"migrateTo"` ··· 51 72 52 73 // SyncSubscribeRepos_RepoOp is a "repoOp" in the com.atproto.sync.subscribeRepos schema. 53 74 // 54 - // A repo operation, ie a write of a single record. For creates and updates, CID is the record's CID as of this operation. For deletes, it's null. 75 + // A repo operation, ie a mutation of a single record. 55 76 type SyncSubscribeRepos_RepoOp struct { 56 - Action string `json:"action" cborgen:"action"` 57 - Cid *util.LexLink `json:"cid" cborgen:"cid"` 58 - Path string `json:"path" cborgen:"path"` 77 + Action string `json:"action" cborgen:"action"` 78 + // cid: For creates and updates, the new record CID. For deletions, null. 79 + Cid *util.LexLink `json:"cid" cborgen:"cid"` 80 + Path string `json:"path" cborgen:"path"` 59 81 } 60 82 61 83 // SyncSubscribeRepos_Tombstone is a "tombstone" in the com.atproto.sync.subscribeRepos schema. 84 + // 85 + // Indicates that an account has been deleted. NOTE: may be deprecated in favor of #identity or a future #account event 62 86 type SyncSubscribeRepos_Tombstone struct { 63 87 Did string `json:"did" cborgen:"did"` 64 88 Seq int64 `json:"seq" cborgen:"seq"`
+3
api/bsky/actordefs.go
··· 186 186 LexiconTypeID string `json:"$type,const=app.bsky.actor.defs#savedFeedsPref" cborgen:"$type,const=app.bsky.actor.defs#savedFeedsPref"` 187 187 Pinned []string `json:"pinned" cborgen:"pinned"` 188 188 Saved []string `json:"saved" cborgen:"saved"` 189 + TimelineIndex *int64 `json:"timelineIndex,omitempty" cborgen:"timelineIndex,omitempty"` 189 190 } 190 191 191 192 // ActorDefs_ThreadViewPref is a "threadViewPref" in the app.bsky.actor.defs schema. ··· 200 201 } 201 202 202 203 // ActorDefs_ViewerState is a "viewerState" in the app.bsky.actor.defs schema. 204 + // 205 + // Metadata about the requesting account's relationship with the subject account. Only has meaningful content for authed requests. 203 206 type ActorDefs_ViewerState struct { 204 207 BlockedBy *bool `json:"blockedBy,omitempty" cborgen:"blockedBy,omitempty"` 205 208 Blocking *string `json:"blocking,omitempty" cborgen:"blocking,omitempty"`
+2
api/bsky/actorgetProfile.go
··· 11 11 ) 12 12 13 13 // ActorGetProfile calls the XRPC method "app.bsky.actor.getProfile". 14 + // 15 + // actor: Handle or DID of account to fetch profile of. 14 16 func ActorGetProfile(ctx context.Context, c *xrpc.Client, actor string) (*ActorDefs_ProfileViewDetailed, error) { 15 17 var out ActorDefs_ProfileViewDetailed 16 18
+11 -6
api/bsky/actorprofile.go
··· 20 20 } // 21 21 // RECORDTYPE: ActorProfile 22 22 type ActorProfile struct { 23 - LexiconTypeID string `json:"$type,const=app.bsky.actor.profile" cborgen:"$type,const=app.bsky.actor.profile"` 24 - Avatar *util.LexBlob `json:"avatar,omitempty" cborgen:"avatar,omitempty"` 25 - Banner *util.LexBlob `json:"banner,omitempty" cborgen:"banner,omitempty"` 26 - Description *string `json:"description,omitempty" cborgen:"description,omitempty"` 27 - DisplayName *string `json:"displayName,omitempty" cborgen:"displayName,omitempty"` 28 - Labels *ActorProfile_Labels `json:"labels,omitempty" cborgen:"labels,omitempty"` 23 + LexiconTypeID string `json:"$type,const=app.bsky.actor.profile" cborgen:"$type,const=app.bsky.actor.profile"` 24 + // avatar: Small image to be displayed next to posts from account. AKA, 'profile picture' 25 + Avatar *util.LexBlob `json:"avatar,omitempty" cborgen:"avatar,omitempty"` 26 + // banner: Larger horizontal image to display behind profile view. 27 + Banner *util.LexBlob `json:"banner,omitempty" cborgen:"banner,omitempty"` 28 + // description: Free-form profile description text. 29 + Description *string `json:"description,omitempty" cborgen:"description,omitempty"` 30 + DisplayName *string `json:"displayName,omitempty" cborgen:"displayName,omitempty"` 31 + // labels: Self-label values, specific to the Bluesky application, on the overall account. 32 + Labels *ActorProfile_Labels `json:"labels,omitempty" cborgen:"labels,omitempty"` 29 33 } 30 34 35 + // Self-label values, specific to the Bluesky application, on the overall account. 31 36 type ActorProfile_Labels struct { 32 37 LabelDefs_SelfLabels *comatprototypes.LabelDefs_SelfLabels 33 38 }
+2
api/bsky/embedexternal.go
··· 11 11 func init() { 12 12 util.RegisterType("app.bsky.embed.external#main", &EmbedExternal{}) 13 13 } // EmbedExternal is a "main" in the app.bsky.embed.external schema. 14 + // A representation of some externally linked content (eg, a URL and 'card'), embedded in a Bluesky record (eg, a post). 15 + // 14 16 // RECORDTYPE: EmbedExternal 15 17 type EmbedExternal struct { 16 18 LexiconTypeID string `json:"$type,const=app.bsky.embed.external" cborgen:"$type,const=app.bsky.embed.external"`
+6 -2
api/bsky/embedimages.go
··· 27 27 28 28 // EmbedImages_Image is a "image" in the app.bsky.embed.images schema. 29 29 type EmbedImages_Image struct { 30 + // alt: Alt text description of the image, for accessibility. 30 31 Alt string `json:"alt" cborgen:"alt"` 31 32 AspectRatio *EmbedImages_AspectRatio `json:"aspectRatio,omitempty" cborgen:"aspectRatio,omitempty"` 32 33 Image *util.LexBlob `json:"image" cborgen:"image"` ··· 42 43 43 44 // EmbedImages_ViewImage is a "viewImage" in the app.bsky.embed.images schema. 44 45 type EmbedImages_ViewImage struct { 46 + // alt: Alt text description of the image, for accessibility. 45 47 Alt string `json:"alt" cborgen:"alt"` 46 48 AspectRatio *EmbedImages_AspectRatio `json:"aspectRatio,omitempty" cborgen:"aspectRatio,omitempty"` 47 - Fullsize string `json:"fullsize" cborgen:"fullsize"` 48 - Thumb string `json:"thumb" cborgen:"thumb"` 49 + // fullsize: Fully-qualified URL where a large version of the image can be fetched. May or may not be the exact original blob. For example, CDN location provided by the App View. 50 + Fullsize string `json:"fullsize" cborgen:"fullsize"` 51 + // thumb: Fully-qualified URL where a thumbnail of the image can be fetched. For example, CDN location provided by the App View. 52 + Thumb string `json:"thumb" cborgen:"thumb"` 49 53 }
+2 -1
api/bsky/embedrecord.go
··· 59 59 IndexedAt string `json:"indexedAt" cborgen:"indexedAt"` 60 60 Labels []*comatprototypes.LabelDefs_Label `json:"labels,omitempty" cborgen:"labels,omitempty"` 61 61 Uri string `json:"uri" cborgen:"uri"` 62 - Value *util.LexiconTypeDecoder `json:"value" cborgen:"value"` 62 + // value: The record data itself. 63 + Value *util.LexiconTypeDecoder `json:"value" cborgen:"value"` 63 64 } 64 65 65 66 type EmbedRecord_ViewRecord_Embeds_Elem struct {
+2
api/bsky/feeddefs.go
··· 411 411 } 412 412 413 413 // FeedDefs_ViewerState is a "viewerState" in the app.bsky.feed.defs schema. 414 + // 415 + // Metadata about the requesting account's relationship with the subject content. Only has meaningful content for authed requests. 414 416 type FeedDefs_ViewerState struct { 415 417 Like *string `json:"like,omitempty" cborgen:"like,omitempty"` 416 418 ReplyDisabled *bool `json:"replyDisabled,omitempty" cborgen:"replyDisabled,omitempty"`
+10 -8
api/bsky/feedgenerator.go
··· 20 20 } // 21 21 // RECORDTYPE: FeedGenerator 22 22 type FeedGenerator struct { 23 - LexiconTypeID string `json:"$type,const=app.bsky.feed.generator" cborgen:"$type,const=app.bsky.feed.generator"` 24 - Avatar *util.LexBlob `json:"avatar,omitempty" cborgen:"avatar,omitempty"` 25 - CreatedAt string `json:"createdAt" cborgen:"createdAt"` 26 - Description *string `json:"description,omitempty" cborgen:"description,omitempty"` 27 - DescriptionFacets []*RichtextFacet `json:"descriptionFacets,omitempty" cborgen:"descriptionFacets,omitempty"` 28 - Did string `json:"did" cborgen:"did"` 29 - DisplayName string `json:"displayName" cborgen:"displayName"` 30 - Labels *FeedGenerator_Labels `json:"labels,omitempty" cborgen:"labels,omitempty"` 23 + LexiconTypeID string `json:"$type,const=app.bsky.feed.generator" cborgen:"$type,const=app.bsky.feed.generator"` 24 + Avatar *util.LexBlob `json:"avatar,omitempty" cborgen:"avatar,omitempty"` 25 + CreatedAt string `json:"createdAt" cborgen:"createdAt"` 26 + Description *string `json:"description,omitempty" cborgen:"description,omitempty"` 27 + DescriptionFacets []*RichtextFacet `json:"descriptionFacets,omitempty" cborgen:"descriptionFacets,omitempty"` 28 + Did string `json:"did" cborgen:"did"` 29 + DisplayName string `json:"displayName" cborgen:"displayName"` 30 + // labels: Self-label values 31 + Labels *FeedGenerator_Labels `json:"labels,omitempty" cborgen:"labels,omitempty"` 31 32 } 32 33 34 + // Self-label values 33 35 type FeedGenerator_Labels struct { 34 36 LabelDefs_SelfLabels *comatprototypes.LabelDefs_SelfLabels 35 37 }
+2
api/bsky/feedgetAuthorFeed.go
··· 17 17 } 18 18 19 19 // FeedGetAuthorFeed calls the XRPC method "app.bsky.feed.getAuthorFeed". 20 + // 21 + // filter: Combinations of post/repost types to include in response. 20 22 func FeedGetAuthorFeed(ctx context.Context, c *xrpc.Client, actor string, cursor string, filter string, limit int64) (*FeedGetAuthorFeed_Output, error) { 21 23 var out FeedGetAuthorFeed_Output 22 24
+7 -3
api/bsky/feedgetFeedGenerator.go
··· 12 12 13 13 // FeedGetFeedGenerator_Output is the output of a app.bsky.feed.getFeedGenerator call. 14 14 type FeedGetFeedGenerator_Output struct { 15 - IsOnline bool `json:"isOnline" cborgen:"isOnline"` 16 - IsValid bool `json:"isValid" cborgen:"isValid"` 17 - View *FeedDefs_GeneratorView `json:"view" cborgen:"view"` 15 + // isOnline: Indicates whether the feed generator service has been online recently, or else seems to be inactive. 16 + IsOnline bool `json:"isOnline" cborgen:"isOnline"` 17 + // isValid: Indicates whether the feed generator service is compatible with the record declaration. 18 + IsValid bool `json:"isValid" cborgen:"isValid"` 19 + View *FeedDefs_GeneratorView `json:"view" cborgen:"view"` 18 20 } 19 21 20 22 // FeedGetFeedGenerator calls the XRPC method "app.bsky.feed.getFeedGenerator". 23 + // 24 + // feed: AT-URI of the feed generator record. 21 25 func FeedGetFeedGenerator(ctx context.Context, c *xrpc.Client, feed string) (*FeedGetFeedGenerator_Output, error) { 22 26 var out FeedGetFeedGenerator_Output 23 27
+2
api/bsky/feedgetFeedSkeleton.go
··· 17 17 } 18 18 19 19 // FeedGetFeedSkeleton calls the XRPC method "app.bsky.feed.getFeedSkeleton". 20 + // 21 + // feed: Reference to feed generator record describing the specific feed being requested. 20 22 func FeedGetFeedSkeleton(ctx context.Context, c *xrpc.Client, cursor string, feed string, limit int64) (*FeedGetFeedSkeleton_Output, error) { 21 23 var out FeedGetFeedSkeleton_Output 22 24
+3
api/bsky/feedgetLikes.go
··· 26 26 } 27 27 28 28 // FeedGetLikes calls the XRPC method "app.bsky.feed.getLikes". 29 + // 30 + // cid: CID of the subject record (aka, specific version of record), to filter likes. 31 + // uri: AT-URI of the subject (eg, a post record). 29 32 func FeedGetLikes(ctx context.Context, c *xrpc.Client, cid string, cursor string, limit int64, uri string) (*FeedGetLikes_Output, error) { 30 33 var out FeedGetLikes_Output 31 34
+2
api/bsky/feedgetListFeed.go
··· 17 17 } 18 18 19 19 // FeedGetListFeed calls the XRPC method "app.bsky.feed.getListFeed". 20 + // 21 + // list: Reference (AT-URI) to the list record. 20 22 func FeedGetListFeed(ctx context.Context, c *xrpc.Client, cursor string, limit int64, list string) (*FeedGetListFeed_Output, error) { 21 23 var out FeedGetListFeed_Output 22 24
+4
api/bsky/feedgetPostThread.go
··· 62 62 } 63 63 64 64 // FeedGetPostThread calls the XRPC method "app.bsky.feed.getPostThread". 65 + // 66 + // depth: How many levels of reply depth should be included in response. 67 + // parentHeight: How many levels of parent (and grandparent, etc) post to include. 68 + // uri: Reference (AT-URI) to post record. 65 69 func FeedGetPostThread(ctx context.Context, c *xrpc.Client, depth int64, parentHeight int64, uri string) (*FeedGetPostThread_Output, error) { 66 70 var out FeedGetPostThread_Output 67 71
+2
api/bsky/feedgetPosts.go
··· 16 16 } 17 17 18 18 // FeedGetPosts calls the XRPC method "app.bsky.feed.getPosts". 19 + // 20 + // uris: List of post AT-URIs to return hydrated views for. 19 21 func FeedGetPosts(ctx context.Context, c *xrpc.Client, uris []string) (*FeedGetPosts_Output, error) { 20 22 var out FeedGetPosts_Output 21 23
+3
api/bsky/feedgetRepostedBy.go
··· 19 19 } 20 20 21 21 // FeedGetRepostedBy calls the XRPC method "app.bsky.feed.getRepostedBy". 22 + // 23 + // cid: If supplied, filters to reposts of specific version (by CID) of the post record. 24 + // uri: Reference (AT-URI) of post record 22 25 func FeedGetRepostedBy(ctx context.Context, c *xrpc.Client, cid string, cursor string, limit int64, uri string) (*FeedGetRepostedBy_Output, error) { 23 26 var out FeedGetRepostedBy_Output 24 27
+2
api/bsky/feedgetTimeline.go
··· 17 17 } 18 18 19 19 // FeedGetTimeline calls the XRPC method "app.bsky.feed.getTimeline". 20 + // 21 + // algorithm: Variant 'algorithm' for timeline. Implementation-specific. NOTE: most feed flexibility has been moved to feed generator mechanism. 20 22 func FeedGetTimeline(ctx context.Context, c *xrpc.Client, algorithm string, cursor string, limit int64) (*FeedGetTimeline_Output, error) { 21 23 var out FeedGetTimeline_Output 22 24
+16 -10
api/bsky/feedpost.go
··· 20 20 } // 21 21 // RECORDTYPE: FeedPost 22 22 type FeedPost struct { 23 - LexiconTypeID string `json:"$type,const=app.bsky.feed.post" cborgen:"$type,const=app.bsky.feed.post"` 24 - CreatedAt string `json:"createdAt" cborgen:"createdAt"` 25 - Embed *FeedPost_Embed `json:"embed,omitempty" cborgen:"embed,omitempty"` 26 - // entities: Deprecated: replaced by app.bsky.richtext.facet. 23 + LexiconTypeID string `json:"$type,const=app.bsky.feed.post" cborgen:"$type,const=app.bsky.feed.post"` 24 + // createdAt: Client-declared timestamp when this post was originally created. 25 + CreatedAt string `json:"createdAt" cborgen:"createdAt"` 26 + Embed *FeedPost_Embed `json:"embed,omitempty" cborgen:"embed,omitempty"` 27 + // entities: DEPRECATED: replaced by app.bsky.richtext.facet. 27 28 Entities []*FeedPost_Entity `json:"entities,omitempty" cborgen:"entities,omitempty"` 28 - Facets []*RichtextFacet `json:"facets,omitempty" cborgen:"facets,omitempty"` 29 - Labels *FeedPost_Labels `json:"labels,omitempty" cborgen:"labels,omitempty"` 30 - Langs []string `json:"langs,omitempty" cborgen:"langs,omitempty"` 31 - Reply *FeedPost_ReplyRef `json:"reply,omitempty" cborgen:"reply,omitempty"` 32 - // tags: Additional non-inline tags describing this post. 29 + // facets: Annotations of text (mentions, URLs, hashtags, etc) 30 + Facets []*RichtextFacet `json:"facets,omitempty" cborgen:"facets,omitempty"` 31 + // labels: Self-label values for this post. Effectively content warnings. 32 + Labels *FeedPost_Labels `json:"labels,omitempty" cborgen:"labels,omitempty"` 33 + // langs: Indicates human language of post primary text content. 34 + Langs []string `json:"langs,omitempty" cborgen:"langs,omitempty"` 35 + Reply *FeedPost_ReplyRef `json:"reply,omitempty" cborgen:"reply,omitempty"` 36 + // tags: Additional hashtags, in addition to any included in post text and facets. 33 37 Tags []string `json:"tags,omitempty" cborgen:"tags,omitempty"` 34 - Text string `json:"text" cborgen:"text"` 38 + // text: The primary post content. May be an empty string, if there are embeds. 39 + Text string `json:"text" cborgen:"text"` 35 40 } 36 41 37 42 type FeedPost_Embed struct { ··· 140 145 Value string `json:"value" cborgen:"value"` 141 146 } 142 147 148 + // Self-label values for this post. Effectively content warnings. 143 149 type FeedPost_Labels struct { 144 150 LabelDefs_SelfLabels *comatprototypes.LabelDefs_SelfLabels 145 151 }
+2 -1
api/bsky/feedthreadgate.go
··· 22 22 LexiconTypeID string `json:"$type,const=app.bsky.feed.threadgate" cborgen:"$type,const=app.bsky.feed.threadgate"` 23 23 Allow []*FeedThreadgate_Allow_Elem `json:"allow,omitempty" cborgen:"allow,omitempty"` 24 24 CreatedAt string `json:"createdAt" cborgen:"createdAt"` 25 - Post string `json:"post" cborgen:"post"` 25 + // post: Reference (AT-URI) to the post record. 26 + Post string `json:"post" cborgen:"post"` 26 27 } 27 28 28 29 type FeedThreadgate_Allow_Elem struct {
+2 -1
api/bsky/graphblock.go
··· 15 15 type GraphBlock struct { 16 16 LexiconTypeID string `json:"$type,const=app.bsky.graph.block" cborgen:"$type,const=app.bsky.graph.block"` 17 17 CreatedAt string `json:"createdAt" cborgen:"createdAt"` 18 - Subject string `json:"subject" cborgen:"subject"` 18 + // subject: DID of the account to be blocked. 19 + Subject string `json:"subject" cborgen:"subject"` 19 20 }
+2
api/bsky/graphgetList.go
··· 18 18 } 19 19 20 20 // GraphGetList calls the XRPC method "app.bsky.graph.getList". 21 + // 22 + // list: Reference (AT-URI) of the list record to hydrate. 21 23 func GraphGetList(ctx context.Context, c *xrpc.Client, cursor string, limit int64, list string) (*GraphGetList_Output, error) { 22 24 var out GraphGetList_Output 23 25
+2
api/bsky/graphgetLists.go
··· 17 17 } 18 18 19 19 // GraphGetLists calls the XRPC method "app.bsky.graph.getLists". 20 + // 21 + // actor: The account (actor) to enumerate lists from. 20 22 func GraphGetLists(ctx context.Context, c *xrpc.Client, actor string, cursor string, limit int64) (*GraphGetLists_Output, error) { 21 23 var out GraphGetLists_Output 22 24
+3
api/bsky/graphgetRelationships.go
··· 55 55 } 56 56 57 57 // GraphGetRelationships calls the XRPC method "app.bsky.graph.getRelationships". 58 + // 59 + // actor: Primary account requesting relationships for. 60 + // others: List of 'other' accounts to be related back to the primary. 58 61 func GraphGetRelationships(ctx context.Context, c *xrpc.Client, actor string, others []string) (*GraphGetRelationships_Output, error) { 59 62 var out GraphGetRelationships_Output 60 63
+4 -2
api/bsky/graphlist.go
··· 26 26 Description *string `json:"description,omitempty" cborgen:"description,omitempty"` 27 27 DescriptionFacets []*RichtextFacet `json:"descriptionFacets,omitempty" cborgen:"descriptionFacets,omitempty"` 28 28 Labels *GraphList_Labels `json:"labels,omitempty" cborgen:"labels,omitempty"` 29 - Name string `json:"name" cborgen:"name"` 30 - Purpose *string `json:"purpose" cborgen:"purpose"` 29 + // name: Display name for list; can not be empty. 30 + Name string `json:"name" cborgen:"name"` 31 + // purpose: Defines the purpose of the list (aka, moderation-oriented or curration-oriented) 32 + Purpose *string `json:"purpose" cborgen:"purpose"` 31 33 } 32 34 33 35 type GraphList_Labels struct {
+2 -1
api/bsky/graphlistblock.go
··· 15 15 type GraphListblock struct { 16 16 LexiconTypeID string `json:"$type,const=app.bsky.graph.listblock" cborgen:"$type,const=app.bsky.graph.listblock"` 17 17 CreatedAt string `json:"createdAt" cborgen:"createdAt"` 18 - Subject string `json:"subject" cborgen:"subject"` 18 + // subject: Reference (AT-URI) to the mod list record. 19 + Subject string `json:"subject" cborgen:"subject"` 19 20 }
+4 -2
api/bsky/graphlistitem.go
··· 15 15 type GraphListitem struct { 16 16 LexiconTypeID string `json:"$type,const=app.bsky.graph.listitem" cborgen:"$type,const=app.bsky.graph.listitem"` 17 17 CreatedAt string `json:"createdAt" cborgen:"createdAt"` 18 - List string `json:"list" cborgen:"list"` 19 - Subject string `json:"subject" cborgen:"subject"` 18 + // list: Reference (AT-URI) to the list record (app.bsky.graph.list). 19 + List string `json:"list" cborgen:"list"` 20 + // subject: The account which is included on the list. 21 + Subject string `json:"subject" cborgen:"subject"` 20 22 }
+6 -4
api/bsky/richtextfacet.go
··· 15 15 ) 16 16 17 17 // RichtextFacet is a "main" in the app.bsky.richtext.facet schema. 18 + // 19 + // Annotation of a sub-string within rich text. 18 20 type RichtextFacet struct { 19 21 Features []*RichtextFacet_Features_Elem `json:"features" cborgen:"features"` 20 22 Index *RichtextFacet_ByteSlice `json:"index" cborgen:"index"` ··· 22 24 23 25 // RichtextFacet_ByteSlice is a "byteSlice" in the app.bsky.richtext.facet schema. 24 26 // 25 - // A text segment. Start is inclusive, end is exclusive. Indices are for utf8-encoded strings. 27 + // Specifies the sub-string range a facet feature applies to. Start index is inclusive, end index is exclusive. Indices are zero-indexed, counting bytes of the UTF-8 encoded text. NOTE: some languages, like Javascript, use UTF-16 or Unicode codepoints for string slice indexing; in these languages, convert to byte arrays before working with facets. 26 28 type RichtextFacet_ByteSlice struct { 27 29 ByteEnd int64 `json:"byteEnd" cborgen:"byteEnd"` 28 30 ByteStart int64 `json:"byteStart" cborgen:"byteStart"` ··· 112 114 113 115 // RichtextFacet_Link is a "link" in the app.bsky.richtext.facet schema. 114 116 // 115 - // A facet feature for links. 117 + // Facet feature for a URL. The text URL may have been simplified or truncated, but the facet reference should be a complete URL. 116 118 // 117 119 // RECORDTYPE: RichtextFacet_Link 118 120 type RichtextFacet_Link struct { ··· 122 124 123 125 // RichtextFacet_Mention is a "mention" in the app.bsky.richtext.facet schema. 124 126 // 125 - // A facet feature for actor mentions. 127 + // Facet feature for mention of another account. The text is usually a handle, including a '@' prefix, but the facet reference is a DID. 126 128 // 127 129 // RECORDTYPE: RichtextFacet_Mention 128 130 type RichtextFacet_Mention struct { ··· 132 134 133 135 // RichtextFacet_Tag is a "tag" in the app.bsky.richtext.facet schema. 134 136 // 135 - // A hashtag. 137 + // Facet feature for a hashtag. The text usually includes a '#' prefix, but the facet reference should not (except in the case of 'double hash tags'). 136 138 // 137 139 // RECORDTYPE: RichtextFacet_Tag 138 140 type RichtextFacet_Tag struct {
+11 -1
automod/engine/persisthelpers.go
··· 118 118 // NOTE: this is running in an inner loop (if there are multiple reports), which is a bit inefficient, but seems acceptable 119 119 120 120 // AdminQueryModerationEvents(ctx context.Context, c *xrpc.Client, createdBy string, cursor string, inc ludeAllUserRecords bool, limit int64, sortDirection string, subject string, types []string) 121 - resp, err := comatproto.AdminQueryModerationEvents(ctx, xrpcc, xrpcc.Auth.Did, "", false, 5, "", did.String(), []string{"com.atproto.admin.defs#modEventReport"}) 121 + resp, err := comatproto.AdminQueryModerationEvents( 122 + ctx, 123 + xrpcc, 124 + xrpcc.Auth.Did, 125 + "", 126 + false, 127 + 5, 128 + "", 129 + did.String(), 130 + []string{"com.atproto.admin.defs#modEventReport"}, 131 + ) 122 132 if err != nil { 123 133 return false, err 124 134 }
+24
bgs/bgs.go
··· 932 932 } 933 933 934 934 return nil 935 + case env.Identity != nil: 936 + log.Infow("bgs got identity event", "did", env.Identity.Did) 937 + // Flush any cached DID documents for this user 938 + bgs.didr.FlushCacheFor(env.Identity.Did) 939 + 940 + // Refetch the DID doc and update our cached keys and handle etc. 941 + _, err := bgs.createExternalUser(ctx, env.Identity.Did) 942 + if err != nil { 943 + return err 944 + } 945 + 946 + // Broadcast the identity event to all consumers 947 + err = bgs.events.AddEvent(ctx, &events.XRPCStreamEvent{ 948 + Identity: &comatproto.SyncSubscribeRepos_Identity{ 949 + Did: env.Identity.Did, 950 + Seq: env.Identity.Seq, 951 + }, 952 + }) 953 + if err != nil { 954 + log.Errorw("failed to broadcast Identity event", "error", err, "did", env.Identity.Did) 955 + return fmt.Errorf("failed to broadcast Identity event: %w", err) 956 + } 957 + 958 + return nil 935 959 case env.RepoMigrate != nil: 936 960 if _, err := bgs.createExternalUser(ctx, env.RepoMigrate.Did); err != nil { 937 961 return err
+19
events/consumer.go
··· 17 17 type RepoStreamCallbacks struct { 18 18 RepoCommit func(evt *comatproto.SyncSubscribeRepos_Commit) error 19 19 RepoHandle func(evt *comatproto.SyncSubscribeRepos_Handle) error 20 + Identity func(evt *comatproto.SyncSubscribeRepos_Identity) error 20 21 RepoInfo func(evt *comatproto.SyncSubscribeRepos_Info) error 21 22 RepoMigrate func(evt *comatproto.SyncSubscribeRepos_Migrate) error 22 23 RepoTombstone func(evt *comatproto.SyncSubscribeRepos_Tombstone) error ··· 35 36 return rsc.RepoInfo(xev.RepoInfo) 36 37 case xev.RepoMigrate != nil && rsc.RepoMigrate != nil: 37 38 return rsc.RepoMigrate(xev.RepoMigrate) 39 + case xev.Identity != nil && rsc.Identity != nil: 40 + return rsc.Identity(xev.Identity) 38 41 case xev.RepoTombstone != nil && rsc.RepoTombstone != nil: 39 42 return rsc.RepoTombstone(xev.RepoTombstone) 40 43 case xev.LabelLabels != nil && rsc.LabelLabels != nil: ··· 211 214 212 215 if err := sched.AddWork(ctx, evt.Did, &XRPCStreamEvent{ 213 216 RepoHandle: &evt, 217 + }); err != nil { 218 + return err 219 + } 220 + case "#identity": 221 + var evt comatproto.SyncSubscribeRepos_Identity 222 + if err := evt.UnmarshalCBOR(r); err != nil { 223 + return err 224 + } 225 + 226 + if evt.Seq < lastSeq { 227 + log.Errorf("Got events out of order from stream (seq = %d, prev = %d)", evt.Seq, lastSeq) 228 + } 229 + lastSeq = evt.Seq 230 + 231 + if err := sched.AddWork(ctx, evt.Did, &XRPCStreamEvent{ 232 + Identity: &evt, 214 233 }); err != nil { 215 234 return err 216 235 }
+3
events/events.go
··· 137 137 Error *ErrorFrame 138 138 RepoCommit *comatproto.SyncSubscribeRepos_Commit 139 139 RepoHandle *comatproto.SyncSubscribeRepos_Handle 140 + Identity *comatproto.SyncSubscribeRepos_Identity 140 141 RepoInfo *comatproto.SyncSubscribeRepos_Info 141 142 RepoMigrate *comatproto.SyncSubscribeRepos_Migrate 142 143 RepoTombstone *comatproto.SyncSubscribeRepos_Tombstone ··· 279 280 return evt.RepoMigrate.Seq 280 281 case evt.RepoTombstone != nil: 281 282 return evt.RepoTombstone.Seq 283 + case evt.Identity != nil: 284 + return evt.Identity.Seq 282 285 case evt.RepoInfo != nil: 283 286 return -1 284 287 case evt.Error != nil:
+2
events/persist.go
··· 43 43 e.RepoCommit.Seq = mp.seq 44 44 case e.RepoHandle != nil: 45 45 e.RepoHandle.Seq = mp.seq 46 + case e.Identity != nil: 47 + e.Identity.Seq = mp.seq 46 48 case e.RepoMigrate != nil: 47 49 e.RepoMigrate.Seq = mp.seq 48 50 case e.RepoTombstone != nil:
+2
events/yolopersist.go
··· 29 29 e.RepoCommit.Seq = yp.seq 30 30 case e.RepoHandle != nil: 31 31 e.RepoHandle.Seq = yp.seq 32 + case e.Identity != nil: 33 + e.Identity.Seq = yp.seq 32 34 case e.RepoMigrate != nil: 33 35 e.RepoMigrate.Seq = yp.seq 34 36 case e.RepoTombstone != nil:
+1
gen/main.go
··· 67 67 atproto.RepoStrongRef{}, 68 68 atproto.SyncSubscribeRepos_Commit{}, 69 69 atproto.SyncSubscribeRepos_Handle{}, 70 + atproto.SyncSubscribeRepos_Identity{}, 70 71 atproto.SyncSubscribeRepos_Info{}, 71 72 atproto.SyncSubscribeRepos_Migrate{}, 72 73 atproto.SyncSubscribeRepos_RepoOp{},
+1 -1
lex/gen.go
··· 469 469 inpvar = "input" 470 470 inpenc = s.Input.Encoding 471 471 switch s.Input.Encoding { 472 - case EncodingCBOR, EncodingANY: 472 + case EncodingCBOR, EncodingCAR, EncodingANY: 473 473 params = fmt.Sprintf("%s, input io.Reader", params) 474 474 case EncodingJSON: 475 475 params = fmt.Sprintf("%s, input *%s_Input", params, fname)
+7
sonar/sonar.go
··· 126 126 lastEvtProcessedAtGauge.WithLabelValues(s.SocketURL).Set(float64(now.UnixNano())) 127 127 lastEvtCreatedEvtProcessedGapGauge.WithLabelValues(s.SocketURL).Set(float64(now.Sub(t).Seconds())) 128 128 lastSeqGauge.WithLabelValues(s.SocketURL).Set(float64(xe.RepoHandle.Seq)) 129 + case xe.Identity != nil: 130 + eventsProcessedCounter.WithLabelValues("identity", s.SocketURL).Inc() 131 + now := time.Now() 132 + s.ProgMux.Lock() 133 + s.Progress.LastSeq = xe.RepoHandle.Seq 134 + s.Progress.LastSeqProcessedAt = now 135 + s.ProgMux.Unlock() 129 136 case xe.RepoInfo != nil: 130 137 eventsProcessedCounter.WithLabelValues("repo_info", s.SocketURL).Inc() 131 138 case xe.RepoMigrate != nil: