fork of indigo with slightly nicer lexgen

lexgen and cborgen with latest lexicons (#932)

authored by rafael and committed by GitHub 9f7ea1d5 516b993e

+145
api/atproto/cbor_gen.go
··· 19 var _ = math.E 20 var _ = sort.Sort 21 22 func (t *RepoStrongRef) MarshalCBOR(w io.Writer) error { 23 if t == nil { 24 _, err := w.Write(cbg.CborNull)
··· 19 var _ = math.E 20 var _ = sort.Sort 21 22 + func (t *LexiconSchema) MarshalCBOR(w io.Writer) error { 23 + if t == nil { 24 + _, err := w.Write(cbg.CborNull) 25 + return err 26 + } 27 + 28 + cw := cbg.NewCborWriter(w) 29 + 30 + if _, err := cw.Write([]byte{162}); err != nil { 31 + return err 32 + } 33 + 34 + // t.LexiconTypeID (string) (string) 35 + if len("$type") > 1000000 { 36 + return xerrors.Errorf("Value in field \"$type\" was too long") 37 + } 38 + 39 + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("$type"))); err != nil { 40 + return err 41 + } 42 + if _, err := cw.WriteString(string("$type")); err != nil { 43 + return err 44 + } 45 + 46 + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("com.atproto.lexicon.schema"))); err != nil { 47 + return err 48 + } 49 + if _, err := cw.WriteString(string("com.atproto.lexicon.schema")); err != nil { 50 + return err 51 + } 52 + 53 + // t.Lexicon (int64) (int64) 54 + if len("lexicon") > 1000000 { 55 + return xerrors.Errorf("Value in field \"lexicon\" was too long") 56 + } 57 + 58 + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("lexicon"))); err != nil { 59 + return err 60 + } 61 + if _, err := cw.WriteString(string("lexicon")); err != nil { 62 + return err 63 + } 64 + 65 + if t.Lexicon >= 0 { 66 + if err := cw.WriteMajorTypeHeader(cbg.MajUnsignedInt, uint64(t.Lexicon)); err != nil { 67 + return err 68 + } 69 + } else { 70 + if err := cw.WriteMajorTypeHeader(cbg.MajNegativeInt, uint64(-t.Lexicon-1)); err != nil { 71 + return err 72 + } 73 + } 74 + 75 + return nil 76 + } 77 + 78 + func (t *LexiconSchema) UnmarshalCBOR(r io.Reader) (err error) { 79 + *t = LexiconSchema{} 80 + 81 + cr := cbg.NewCborReader(r) 82 + 83 + maj, extra, err := cr.ReadHeader() 84 + if err != nil { 85 + return err 86 + } 87 + defer func() { 88 + if err == io.EOF { 89 + err = io.ErrUnexpectedEOF 90 + } 91 + }() 92 + 93 + if maj != cbg.MajMap { 94 + return fmt.Errorf("cbor input should be of type map") 95 + } 96 + 97 + if extra > cbg.MaxLength { 98 + return fmt.Errorf("LexiconSchema: map struct too large (%d)", extra) 99 + } 100 + 101 + n := extra 102 + 103 + nameBuf := make([]byte, 7) 104 + for i := uint64(0); i < n; i++ { 105 + nameLen, ok, err := cbg.ReadFullStringIntoBuf(cr, nameBuf, 1000000) 106 + if err != nil { 107 + return err 108 + } 109 + 110 + if !ok { 111 + // Field doesn't exist on this type, so ignore it 112 + if err := cbg.ScanForLinks(cr, func(cid.Cid) {}); err != nil { 113 + return err 114 + } 115 + continue 116 + } 117 + 118 + switch string(nameBuf[:nameLen]) { 119 + // t.LexiconTypeID (string) (string) 120 + case "$type": 121 + 122 + { 123 + sval, err := cbg.ReadStringWithMax(cr, 1000000) 124 + if err != nil { 125 + return err 126 + } 127 + 128 + t.LexiconTypeID = string(sval) 129 + } 130 + // t.Lexicon (int64) (int64) 131 + case "lexicon": 132 + { 133 + maj, extra, err := cr.ReadHeader() 134 + if err != nil { 135 + return err 136 + } 137 + var extraI int64 138 + switch maj { 139 + case cbg.MajUnsignedInt: 140 + extraI = int64(extra) 141 + if extraI < 0 { 142 + return fmt.Errorf("int64 positive overflow") 143 + } 144 + case cbg.MajNegativeInt: 145 + extraI = int64(extra) 146 + if extraI < 0 { 147 + return fmt.Errorf("int64 negative overflow") 148 + } 149 + extraI = -1 - extraI 150 + default: 151 + return fmt.Errorf("wrong type for int64 field: %d", maj) 152 + } 153 + 154 + t.Lexicon = int64(extraI) 155 + } 156 + 157 + default: 158 + // Field doesn't exist on this type, so ignore it 159 + if err := cbg.ScanForLinks(r, func(cid.Cid) {}); err != nil { 160 + return err 161 + } 162 + } 163 + } 164 + 165 + return nil 166 + } 167 func (t *RepoStrongRef) MarshalCBOR(w io.Writer) error { 168 if t == nil { 169 _, err := w.Write(cbg.CborNull)
+19
api/atproto/lexiconschema.go
···
··· 1 + // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. 2 + 3 + package atproto 4 + 5 + // schema: com.atproto.lexicon.schema 6 + 7 + import ( 8 + "github.com/bluesky-social/indigo/lex/util" 9 + ) 10 + 11 + func init() { 12 + util.RegisterType("com.atproto.lexicon.schema", &LexiconSchema{}) 13 + } // 14 + // RECORDTYPE: LexiconSchema 15 + type LexiconSchema struct { 16 + LexiconTypeID string `json:"$type,const=com.atproto.lexicon.schema" cborgen:"$type,const=com.atproto.lexicon.schema"` 17 + // lexicon: Indicates the 'version' of the Lexicon language. Must be '1' for the current atproto/Lexicon schema system. 18 + Lexicon int64 `json:"lexicon" cborgen:"lexicon"` 19 + }
+96
api/bsky/cbor_gen.go
··· 6202 6203 return nil 6204 } 6205 func (t *FeedThreadgate_FollowingRule) MarshalCBOR(w io.Writer) error { 6206 if t == nil { 6207 _, err := w.Write(cbg.CborNull)
··· 6202 6203 return nil 6204 } 6205 + func (t *FeedThreadgate_FollowerRule) MarshalCBOR(w io.Writer) error { 6206 + if t == nil { 6207 + _, err := w.Write(cbg.CborNull) 6208 + return err 6209 + } 6210 + 6211 + cw := cbg.NewCborWriter(w) 6212 + 6213 + if _, err := cw.Write([]byte{161}); err != nil { 6214 + return err 6215 + } 6216 + 6217 + // t.LexiconTypeID (string) (string) 6218 + if len("$type") > 1000000 { 6219 + return xerrors.Errorf("Value in field \"$type\" was too long") 6220 + } 6221 + 6222 + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("$type"))); err != nil { 6223 + return err 6224 + } 6225 + if _, err := cw.WriteString(string("$type")); err != nil { 6226 + return err 6227 + } 6228 + 6229 + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("app.bsky.feed.threadgate#followerRule"))); err != nil { 6230 + return err 6231 + } 6232 + if _, err := cw.WriteString(string("app.bsky.feed.threadgate#followerRule")); err != nil { 6233 + return err 6234 + } 6235 + return nil 6236 + } 6237 + 6238 + func (t *FeedThreadgate_FollowerRule) UnmarshalCBOR(r io.Reader) (err error) { 6239 + *t = FeedThreadgate_FollowerRule{} 6240 + 6241 + cr := cbg.NewCborReader(r) 6242 + 6243 + maj, extra, err := cr.ReadHeader() 6244 + if err != nil { 6245 + return err 6246 + } 6247 + defer func() { 6248 + if err == io.EOF { 6249 + err = io.ErrUnexpectedEOF 6250 + } 6251 + }() 6252 + 6253 + if maj != cbg.MajMap { 6254 + return fmt.Errorf("cbor input should be of type map") 6255 + } 6256 + 6257 + if extra > cbg.MaxLength { 6258 + return fmt.Errorf("FeedThreadgate_FollowerRule: map struct too large (%d)", extra) 6259 + } 6260 + 6261 + n := extra 6262 + 6263 + nameBuf := make([]byte, 5) 6264 + for i := uint64(0); i < n; i++ { 6265 + nameLen, ok, err := cbg.ReadFullStringIntoBuf(cr, nameBuf, 1000000) 6266 + if err != nil { 6267 + return err 6268 + } 6269 + 6270 + if !ok { 6271 + // Field doesn't exist on this type, so ignore it 6272 + if err := cbg.ScanForLinks(cr, func(cid.Cid) {}); err != nil { 6273 + return err 6274 + } 6275 + continue 6276 + } 6277 + 6278 + switch string(nameBuf[:nameLen]) { 6279 + // t.LexiconTypeID (string) (string) 6280 + case "$type": 6281 + 6282 + { 6283 + sval, err := cbg.ReadStringWithMax(cr, 1000000) 6284 + if err != nil { 6285 + return err 6286 + } 6287 + 6288 + t.LexiconTypeID = string(sval) 6289 + } 6290 + 6291 + default: 6292 + // Field doesn't exist on this type, so ignore it 6293 + if err := cbg.ScanForLinks(r, func(cid.Cid) {}); err != nil { 6294 + return err 6295 + } 6296 + } 6297 + } 6298 + 6299 + return nil 6300 + } 6301 func (t *FeedThreadgate_FollowingRule) MarshalCBOR(w io.Writer) error { 6302 if t == nil { 6303 _, err := w.Write(cbg.CborNull)
+8
api/bsky/feeddefs.go
··· 362 Repost string `json:"repost" cborgen:"repost"` 363 } 364 365 // FeedDefs_ThreadViewPost is a "threadViewPost" in the app.bsky.feed.defs schema. 366 // 367 // RECORDTYPE: FeedDefs_ThreadViewPost ··· 370 Parent *FeedDefs_ThreadViewPost_Parent `json:"parent,omitempty" cborgen:"parent,omitempty"` 371 Post *FeedDefs_PostView `json:"post" cborgen:"post"` 372 Replies []*FeedDefs_ThreadViewPost_Replies_Elem `json:"replies,omitempty" cborgen:"replies,omitempty"` 373 } 374 375 type FeedDefs_ThreadViewPost_Parent struct {
··· 362 Repost string `json:"repost" cborgen:"repost"` 363 } 364 365 + // FeedDefs_ThreadContext is a "threadContext" in the app.bsky.feed.defs schema. 366 + // 367 + // Metadata about this post within the context of the thread it is in. 368 + type FeedDefs_ThreadContext struct { 369 + RootAuthorLike *string `json:"rootAuthorLike,omitempty" cborgen:"rootAuthorLike,omitempty"` 370 + } 371 + 372 // FeedDefs_ThreadViewPost is a "threadViewPost" in the app.bsky.feed.defs schema. 373 // 374 // RECORDTYPE: FeedDefs_ThreadViewPost ··· 377 Parent *FeedDefs_ThreadViewPost_Parent `json:"parent,omitempty" cborgen:"parent,omitempty"` 378 Post *FeedDefs_PostView `json:"post" cborgen:"post"` 379 Replies []*FeedDefs_ThreadViewPost_Replies_Elem `json:"replies,omitempty" cborgen:"replies,omitempty"` 380 + ThreadContext *FeedDefs_ThreadContext `json:"threadContext,omitempty" cborgen:"threadContext,omitempty"` 381 } 382 383 type FeedDefs_ThreadViewPost_Parent struct {
+23
api/bsky/feedthreadgate.go
··· 30 31 type FeedThreadgate_Allow_Elem struct { 32 FeedThreadgate_MentionRule *FeedThreadgate_MentionRule 33 FeedThreadgate_FollowingRule *FeedThreadgate_FollowingRule 34 FeedThreadgate_ListRule *FeedThreadgate_ListRule 35 } ··· 38 if t.FeedThreadgate_MentionRule != nil { 39 t.FeedThreadgate_MentionRule.LexiconTypeID = "app.bsky.feed.threadgate#mentionRule" 40 return json.Marshal(t.FeedThreadgate_MentionRule) 41 } 42 if t.FeedThreadgate_FollowingRule != nil { 43 t.FeedThreadgate_FollowingRule.LexiconTypeID = "app.bsky.feed.threadgate#followingRule" ··· 59 case "app.bsky.feed.threadgate#mentionRule": 60 t.FeedThreadgate_MentionRule = new(FeedThreadgate_MentionRule) 61 return json.Unmarshal(b, t.FeedThreadgate_MentionRule) 62 case "app.bsky.feed.threadgate#followingRule": 63 t.FeedThreadgate_FollowingRule = new(FeedThreadgate_FollowingRule) 64 return json.Unmarshal(b, t.FeedThreadgate_FollowingRule) ··· 80 if t.FeedThreadgate_MentionRule != nil { 81 return t.FeedThreadgate_MentionRule.MarshalCBOR(w) 82 } 83 if t.FeedThreadgate_FollowingRule != nil { 84 return t.FeedThreadgate_FollowingRule.MarshalCBOR(w) 85 } ··· 98 case "app.bsky.feed.threadgate#mentionRule": 99 t.FeedThreadgate_MentionRule = new(FeedThreadgate_MentionRule) 100 return t.FeedThreadgate_MentionRule.UnmarshalCBOR(bytes.NewReader(b)) 101 case "app.bsky.feed.threadgate#followingRule": 102 t.FeedThreadgate_FollowingRule = new(FeedThreadgate_FollowingRule) 103 return t.FeedThreadgate_FollowingRule.UnmarshalCBOR(bytes.NewReader(b)) ··· 108 default: 109 return nil 110 } 111 } 112 113 // FeedThreadgate_FollowingRule is a "followingRule" in the app.bsky.feed.threadgate schema.
··· 30 31 type FeedThreadgate_Allow_Elem struct { 32 FeedThreadgate_MentionRule *FeedThreadgate_MentionRule 33 + FeedThreadgate_FollowerRule *FeedThreadgate_FollowerRule 34 FeedThreadgate_FollowingRule *FeedThreadgate_FollowingRule 35 FeedThreadgate_ListRule *FeedThreadgate_ListRule 36 } ··· 39 if t.FeedThreadgate_MentionRule != nil { 40 t.FeedThreadgate_MentionRule.LexiconTypeID = "app.bsky.feed.threadgate#mentionRule" 41 return json.Marshal(t.FeedThreadgate_MentionRule) 42 + } 43 + if t.FeedThreadgate_FollowerRule != nil { 44 + t.FeedThreadgate_FollowerRule.LexiconTypeID = "app.bsky.feed.threadgate#followerRule" 45 + return json.Marshal(t.FeedThreadgate_FollowerRule) 46 } 47 if t.FeedThreadgate_FollowingRule != nil { 48 t.FeedThreadgate_FollowingRule.LexiconTypeID = "app.bsky.feed.threadgate#followingRule" ··· 64 case "app.bsky.feed.threadgate#mentionRule": 65 t.FeedThreadgate_MentionRule = new(FeedThreadgate_MentionRule) 66 return json.Unmarshal(b, t.FeedThreadgate_MentionRule) 67 + case "app.bsky.feed.threadgate#followerRule": 68 + t.FeedThreadgate_FollowerRule = new(FeedThreadgate_FollowerRule) 69 + return json.Unmarshal(b, t.FeedThreadgate_FollowerRule) 70 case "app.bsky.feed.threadgate#followingRule": 71 t.FeedThreadgate_FollowingRule = new(FeedThreadgate_FollowingRule) 72 return json.Unmarshal(b, t.FeedThreadgate_FollowingRule) ··· 88 if t.FeedThreadgate_MentionRule != nil { 89 return t.FeedThreadgate_MentionRule.MarshalCBOR(w) 90 } 91 + if t.FeedThreadgate_FollowerRule != nil { 92 + return t.FeedThreadgate_FollowerRule.MarshalCBOR(w) 93 + } 94 if t.FeedThreadgate_FollowingRule != nil { 95 return t.FeedThreadgate_FollowingRule.MarshalCBOR(w) 96 } ··· 109 case "app.bsky.feed.threadgate#mentionRule": 110 t.FeedThreadgate_MentionRule = new(FeedThreadgate_MentionRule) 111 return t.FeedThreadgate_MentionRule.UnmarshalCBOR(bytes.NewReader(b)) 112 + case "app.bsky.feed.threadgate#followerRule": 113 + t.FeedThreadgate_FollowerRule = new(FeedThreadgate_FollowerRule) 114 + return t.FeedThreadgate_FollowerRule.UnmarshalCBOR(bytes.NewReader(b)) 115 case "app.bsky.feed.threadgate#followingRule": 116 t.FeedThreadgate_FollowingRule = new(FeedThreadgate_FollowingRule) 117 return t.FeedThreadgate_FollowingRule.UnmarshalCBOR(bytes.NewReader(b)) ··· 122 default: 123 return nil 124 } 125 + } 126 + 127 + // FeedThreadgate_FollowerRule is a "followerRule" in the app.bsky.feed.threadgate schema. 128 + // 129 + // Allow replies from actors who follow you. 130 + // 131 + // RECORDTYPE: FeedThreadgate_FollowerRule 132 + type FeedThreadgate_FollowerRule struct { 133 + LexiconTypeID string `json:"$type,const=app.bsky.feed.threadgate#followerRule" cborgen:"$type,const=app.bsky.feed.threadgate#followerRule"` 134 } 135 136 // FeedThreadgate_FollowingRule is a "followingRule" in the app.bsky.feed.threadgate schema.
+57 -13
api/ozone/moderationdefs.go
··· 40 UpdatedAt *string `json:"updatedAt,omitempty" cborgen:"updatedAt,omitempty"` 41 } 42 43 // ModerationDefs_BlobView is a "blobView" in the tools.ozone.moderation.defs schema. 44 type ModerationDefs_BlobView struct { 45 Cid string `json:"cid" cborgen:"cid"` ··· 172 LexiconTypeID string `json:"$type,const=tools.ozone.moderation.defs#modEventLabel" cborgen:"$type,const=tools.ozone.moderation.defs#modEventLabel"` 173 Comment *string `json:"comment,omitempty" cborgen:"comment,omitempty"` 174 CreateLabelVals []string `json:"createLabelVals" cborgen:"createLabelVals"` 175 NegateLabelVals []string `json:"negateLabelVals" cborgen:"negateLabelVals"` 176 } 177 ··· 800 Uri string `json:"uri" cborgen:"uri"` 801 } 802 803 // ModerationDefs_RepoView is a "repoView" in the tools.ozone.moderation.defs schema. 804 // 805 // RECORDTYPE: ModerationDefs_RepoView ··· 849 850 // ModerationDefs_SubjectStatusView is a "subjectStatusView" in the tools.ozone.moderation.defs schema. 851 type ModerationDefs_SubjectStatusView struct { 852 // appealed: True indicates that the a previously taken moderator action was appealed against, by the author of the content. False indicates last appeal was resolved by moderators. 853 Appealed *bool `json:"appealed,omitempty" cborgen:"appealed,omitempty"` 854 // comment: Sticky comment on the subject. ··· 858 Hosting *ModerationDefs_SubjectStatusView_Hosting `json:"hosting,omitempty" cborgen:"hosting,omitempty"` 859 Id int64 `json:"id" cborgen:"id"` 860 // lastAppealedAt: Timestamp referencing when the author of the subject appealed a moderation action 861 - LastAppealedAt *string `json:"lastAppealedAt,omitempty" cborgen:"lastAppealedAt,omitempty"` 862 - LastReportedAt *string `json:"lastReportedAt,omitempty" cborgen:"lastReportedAt,omitempty"` 863 - LastReviewedAt *string `json:"lastReviewedAt,omitempty" cborgen:"lastReviewedAt,omitempty"` 864 - LastReviewedBy *string `json:"lastReviewedBy,omitempty" cborgen:"lastReviewedBy,omitempty"` 865 - MuteReportingUntil *string `json:"muteReportingUntil,omitempty" cborgen:"muteReportingUntil,omitempty"` 866 - MuteUntil *string `json:"muteUntil,omitempty" cborgen:"muteUntil,omitempty"` 867 - ReviewState *string `json:"reviewState" cborgen:"reviewState"` 868 - Subject *ModerationDefs_SubjectStatusView_Subject `json:"subject" cborgen:"subject"` 869 - SubjectBlobCids []string `json:"subjectBlobCids,omitempty" cborgen:"subjectBlobCids,omitempty"` 870 - SubjectRepoHandle *string `json:"subjectRepoHandle,omitempty" cborgen:"subjectRepoHandle,omitempty"` 871 - SuspendUntil *string `json:"suspendUntil,omitempty" cborgen:"suspendUntil,omitempty"` 872 - Tags []string `json:"tags,omitempty" cborgen:"tags,omitempty"` 873 - Takendown *bool `json:"takendown,omitempty" cborgen:"takendown,omitempty"` 874 // updatedAt: Timestamp referencing when the last update was made to the moderation status of the subject 875 UpdatedAt string `json:"updatedAt" cborgen:"updatedAt"` 876 }
··· 40 UpdatedAt *string `json:"updatedAt,omitempty" cborgen:"updatedAt,omitempty"` 41 } 42 43 + // ModerationDefs_AccountStats is a "accountStats" in the tools.ozone.moderation.defs schema. 44 + // 45 + // Statistics about a particular account subject 46 + type ModerationDefs_AccountStats struct { 47 + // appealCount: Total number of appeals against a moderation action on the account 48 + AppealCount *int64 `json:"appealCount,omitempty" cborgen:"appealCount,omitempty"` 49 + // escalateCount: Number of times the account was escalated 50 + EscalateCount *int64 `json:"escalateCount,omitempty" cborgen:"escalateCount,omitempty"` 51 + // reportCount: Total number of reports on the account 52 + ReportCount *int64 `json:"reportCount,omitempty" cborgen:"reportCount,omitempty"` 53 + // suspendCount: Number of times the account was suspended 54 + SuspendCount *int64 `json:"suspendCount,omitempty" cborgen:"suspendCount,omitempty"` 55 + // takedownCount: Number of times the account was taken down 56 + TakedownCount *int64 `json:"takedownCount,omitempty" cborgen:"takedownCount,omitempty"` 57 + } 58 + 59 // ModerationDefs_BlobView is a "blobView" in the tools.ozone.moderation.defs schema. 60 type ModerationDefs_BlobView struct { 61 Cid string `json:"cid" cborgen:"cid"` ··· 188 LexiconTypeID string `json:"$type,const=tools.ozone.moderation.defs#modEventLabel" cborgen:"$type,const=tools.ozone.moderation.defs#modEventLabel"` 189 Comment *string `json:"comment,omitempty" cborgen:"comment,omitempty"` 190 CreateLabelVals []string `json:"createLabelVals" cborgen:"createLabelVals"` 191 + // durationInHours: Indicates how long the label will remain on the subject. Only applies on labels that are being added. 192 + DurationInHours *int64 `json:"durationInHours,omitempty" cborgen:"durationInHours,omitempty"` 193 NegateLabelVals []string `json:"negateLabelVals" cborgen:"negateLabelVals"` 194 } 195 ··· 818 Uri string `json:"uri" cborgen:"uri"` 819 } 820 821 + // ModerationDefs_RecordsStats is a "recordsStats" in the tools.ozone.moderation.defs schema. 822 + // 823 + // Statistics about a set of record subject items 824 + type ModerationDefs_RecordsStats struct { 825 + // appealedCount: Number of items that were appealed at least once 826 + AppealedCount *int64 `json:"appealedCount,omitempty" cborgen:"appealedCount,omitempty"` 827 + // escalatedCount: Number of items that were escalated at least once 828 + EscalatedCount *int64 `json:"escalatedCount,omitempty" cborgen:"escalatedCount,omitempty"` 829 + // pendingCount: Number of item currently in "reviewOpen" or "reviewEscalated" state 830 + PendingCount *int64 `json:"pendingCount,omitempty" cborgen:"pendingCount,omitempty"` 831 + // processedCount: Number of item currently in "reviewNone" or "reviewClosed" state 832 + ProcessedCount *int64 `json:"processedCount,omitempty" cborgen:"processedCount,omitempty"` 833 + // reportedCount: Number of items that were reported at least once 834 + ReportedCount *int64 `json:"reportedCount,omitempty" cborgen:"reportedCount,omitempty"` 835 + // subjectCount: Total number of item in the set 836 + SubjectCount *int64 `json:"subjectCount,omitempty" cborgen:"subjectCount,omitempty"` 837 + // takendownCount: Number of item currently taken down 838 + TakendownCount *int64 `json:"takendownCount,omitempty" cborgen:"takendownCount,omitempty"` 839 + // totalReports: Cumulative sum of the number of reports on the items in the set 840 + TotalReports *int64 `json:"totalReports,omitempty" cborgen:"totalReports,omitempty"` 841 + } 842 + 843 // ModerationDefs_RepoView is a "repoView" in the tools.ozone.moderation.defs schema. 844 // 845 // RECORDTYPE: ModerationDefs_RepoView ··· 889 890 // ModerationDefs_SubjectStatusView is a "subjectStatusView" in the tools.ozone.moderation.defs schema. 891 type ModerationDefs_SubjectStatusView struct { 892 + // accountStats: Statistics related to the account subject 893 + AccountStats *ModerationDefs_AccountStats `json:"accountStats,omitempty" cborgen:"accountStats,omitempty"` 894 // appealed: True indicates that the a previously taken moderator action was appealed against, by the author of the content. False indicates last appeal was resolved by moderators. 895 Appealed *bool `json:"appealed,omitempty" cborgen:"appealed,omitempty"` 896 // comment: Sticky comment on the subject. ··· 900 Hosting *ModerationDefs_SubjectStatusView_Hosting `json:"hosting,omitempty" cborgen:"hosting,omitempty"` 901 Id int64 `json:"id" cborgen:"id"` 902 // lastAppealedAt: Timestamp referencing when the author of the subject appealed a moderation action 903 + LastAppealedAt *string `json:"lastAppealedAt,omitempty" cborgen:"lastAppealedAt,omitempty"` 904 + LastReportedAt *string `json:"lastReportedAt,omitempty" cborgen:"lastReportedAt,omitempty"` 905 + LastReviewedAt *string `json:"lastReviewedAt,omitempty" cborgen:"lastReviewedAt,omitempty"` 906 + LastReviewedBy *string `json:"lastReviewedBy,omitempty" cborgen:"lastReviewedBy,omitempty"` 907 + MuteReportingUntil *string `json:"muteReportingUntil,omitempty" cborgen:"muteReportingUntil,omitempty"` 908 + MuteUntil *string `json:"muteUntil,omitempty" cborgen:"muteUntil,omitempty"` 909 + // recordsStats: Statistics related to the record subjects authored by the subject's account 910 + RecordsStats *ModerationDefs_RecordsStats `json:"recordsStats,omitempty" cborgen:"recordsStats,omitempty"` 911 + ReviewState *string `json:"reviewState" cborgen:"reviewState"` 912 + Subject *ModerationDefs_SubjectStatusView_Subject `json:"subject" cborgen:"subject"` 913 + SubjectBlobCids []string `json:"subjectBlobCids,omitempty" cborgen:"subjectBlobCids,omitempty"` 914 + SubjectRepoHandle *string `json:"subjectRepoHandle,omitempty" cborgen:"subjectRepoHandle,omitempty"` 915 + SuspendUntil *string `json:"suspendUntil,omitempty" cborgen:"suspendUntil,omitempty"` 916 + Tags []string `json:"tags,omitempty" cborgen:"tags,omitempty"` 917 + Takendown *bool `json:"takendown,omitempty" cborgen:"takendown,omitempty"` 918 // updatedAt: Timestamp referencing when the last update was made to the moderation status of the subject 919 UpdatedAt string `json:"updatedAt" cborgen:"updatedAt"` 920 }
+37 -31
api/ozone/moderationqueryStatuses.go
··· 29 // includeAllUserRecords: All subjects, or subjects from given 'collections' param, belonging to the account specified in the 'subject' param will be returned. 30 // includeMuted: By default, we don't include muted subjects in the results. Set this to true to include them. 31 // lastReviewedBy: Get all subject statuses that were reviewed by a specific moderator 32 // onlyMuted: When set to true, only muted subjects and reporters will be returned. 33 // queueCount: Number of queues being used by moderators. Subjects will be split among all queues. 34 // queueIndex: Index of the queue to fetch subjects from. Works only when queueCount value is specified. ··· 41 // subject: The subject to get the status for. 42 // subjectType: If specified, subjects of the given type (account or record) will be returned. When this is set to 'account' the 'collections' parameter will be ignored. When includeAllUserRecords or subject is set, this will be ignored. 43 // takendown: Get subjects that were taken down 44 - func ModerationQueryStatuses(ctx context.Context, c *xrpc.Client, appealed bool, collections []string, comment string, cursor string, excludeTags []string, hostingDeletedAfter string, hostingDeletedBefore string, hostingStatuses []string, hostingUpdatedAfter string, hostingUpdatedBefore string, ignoreSubjects []string, includeAllUserRecords bool, includeMuted bool, lastReviewedBy string, limit int64, onlyMuted bool, queueCount int64, queueIndex int64, queueSeed string, reportedAfter string, reportedBefore string, reviewState string, reviewedAfter string, reviewedBefore string, sortDirection string, sortField string, subject string, subjectType string, tags []string, takendown bool) (*ModerationQueryStatuses_Output, error) { 45 var out ModerationQueryStatuses_Output 46 47 params := map[string]interface{}{ 48 - "appealed": appealed, 49 - "collections": collections, 50 - "comment": comment, 51 - "cursor": cursor, 52 - "excludeTags": excludeTags, 53 - "hostingDeletedAfter": hostingDeletedAfter, 54 - "hostingDeletedBefore": hostingDeletedBefore, 55 - "hostingStatuses": hostingStatuses, 56 - "hostingUpdatedAfter": hostingUpdatedAfter, 57 - "hostingUpdatedBefore": hostingUpdatedBefore, 58 - "ignoreSubjects": ignoreSubjects, 59 - "includeAllUserRecords": includeAllUserRecords, 60 - "includeMuted": includeMuted, 61 - "lastReviewedBy": lastReviewedBy, 62 - "limit": limit, 63 - "onlyMuted": onlyMuted, 64 - "queueCount": queueCount, 65 - "queueIndex": queueIndex, 66 - "queueSeed": queueSeed, 67 - "reportedAfter": reportedAfter, 68 - "reportedBefore": reportedBefore, 69 - "reviewState": reviewState, 70 - "reviewedAfter": reviewedAfter, 71 - "reviewedBefore": reviewedBefore, 72 - "sortDirection": sortDirection, 73 - "sortField": sortField, 74 - "subject": subject, 75 - "subjectType": subjectType, 76 - "tags": tags, 77 - "takendown": takendown, 78 } 79 if err := c.Do(ctx, xrpc.Query, "", "tools.ozone.moderation.queryStatuses", params, nil, &out); err != nil { 80 return nil, err
··· 29 // includeAllUserRecords: All subjects, or subjects from given 'collections' param, belonging to the account specified in the 'subject' param will be returned. 30 // includeMuted: By default, we don't include muted subjects in the results. Set this to true to include them. 31 // lastReviewedBy: Get all subject statuses that were reviewed by a specific moderator 32 + // minAccountSuspendCount: If specified, only subjects that belong to an account that has at least this many suspensions will be returned. 33 + // minReportedRecordsCount: If specified, only subjects that belong to an account that has at least this many reported records will be returned. 34 + // minTakendownRecordsCount: If specified, only subjects that belong to an account that has at least this many taken down records will be returned. 35 // onlyMuted: When set to true, only muted subjects and reporters will be returned. 36 // queueCount: Number of queues being used by moderators. Subjects will be split among all queues. 37 // queueIndex: Index of the queue to fetch subjects from. Works only when queueCount value is specified. ··· 44 // subject: The subject to get the status for. 45 // subjectType: If specified, subjects of the given type (account or record) will be returned. When this is set to 'account' the 'collections' parameter will be ignored. When includeAllUserRecords or subject is set, this will be ignored. 46 // takendown: Get subjects that were taken down 47 + func ModerationQueryStatuses(ctx context.Context, c *xrpc.Client, appealed bool, collections []string, comment string, cursor string, excludeTags []string, hostingDeletedAfter string, hostingDeletedBefore string, hostingStatuses []string, hostingUpdatedAfter string, hostingUpdatedBefore string, ignoreSubjects []string, includeAllUserRecords bool, includeMuted bool, lastReviewedBy string, limit int64, minAccountSuspendCount int64, minReportedRecordsCount int64, minTakendownRecordsCount int64, onlyMuted bool, queueCount int64, queueIndex int64, queueSeed string, reportedAfter string, reportedBefore string, reviewState string, reviewedAfter string, reviewedBefore string, sortDirection string, sortField string, subject string, subjectType string, tags []string, takendown bool) (*ModerationQueryStatuses_Output, error) { 48 var out ModerationQueryStatuses_Output 49 50 params := map[string]interface{}{ 51 + "appealed": appealed, 52 + "collections": collections, 53 + "comment": comment, 54 + "cursor": cursor, 55 + "excludeTags": excludeTags, 56 + "hostingDeletedAfter": hostingDeletedAfter, 57 + "hostingDeletedBefore": hostingDeletedBefore, 58 + "hostingStatuses": hostingStatuses, 59 + "hostingUpdatedAfter": hostingUpdatedAfter, 60 + "hostingUpdatedBefore": hostingUpdatedBefore, 61 + "ignoreSubjects": ignoreSubjects, 62 + "includeAllUserRecords": includeAllUserRecords, 63 + "includeMuted": includeMuted, 64 + "lastReviewedBy": lastReviewedBy, 65 + "limit": limit, 66 + "minAccountSuspendCount": minAccountSuspendCount, 67 + "minReportedRecordsCount": minReportedRecordsCount, 68 + "minTakendownRecordsCount": minTakendownRecordsCount, 69 + "onlyMuted": onlyMuted, 70 + "queueCount": queueCount, 71 + "queueIndex": queueIndex, 72 + "queueSeed": queueSeed, 73 + "reportedAfter": reportedAfter, 74 + "reportedBefore": reportedBefore, 75 + "reviewState": reviewState, 76 + "reviewedAfter": reviewedAfter, 77 + "reviewedBefore": reviewedBefore, 78 + "sortDirection": sortDirection, 79 + "sortField": sortField, 80 + "subject": subject, 81 + "subjectType": subjectType, 82 + "tags": tags, 83 + "takendown": takendown, 84 } 85 if err := c.Do(ctx, xrpc.Query, "", "tools.ozone.moderation.queryStatuses", params, nil, &out); err != nil { 86 return nil, err
+2
gen/main.go
··· 62 bsky.FeedThreadgate{}, 63 bsky.FeedThreadgate_ListRule{}, 64 bsky.FeedThreadgate_MentionRule{}, 65 bsky.FeedThreadgate_FollowingRule{}, 66 bsky.GraphStarterpack_FeedItem{}, 67 bsky.GraphStarterpack{}, ··· 88 } 89 90 if err := genCfg.WriteMapEncodersToFile("api/atproto/cbor_gen.go", "atproto", 91 atproto.RepoStrongRef{}, 92 atproto.SyncSubscribeRepos_Commit{}, 93 atproto.SyncSubscribeRepos_Handle{},
··· 62 bsky.FeedThreadgate{}, 63 bsky.FeedThreadgate_ListRule{}, 64 bsky.FeedThreadgate_MentionRule{}, 65 + bsky.FeedThreadgate_FollowerRule{}, 66 bsky.FeedThreadgate_FollowingRule{}, 67 bsky.GraphStarterpack_FeedItem{}, 68 bsky.GraphStarterpack{}, ··· 89 } 90 91 if err := genCfg.WriteMapEncodersToFile("api/atproto/cbor_gen.go", "atproto", 92 + atproto.LexiconSchema{}, 93 atproto.RepoStrongRef{}, 94 atproto.SyncSubscribeRepos_Commit{}, 95 atproto.SyncSubscribeRepos_Handle{},